button-inc / service-development-toolkit

Toolkit for button applications
Apache License 2.0
5 stars 3 forks source link

Cannot import components as named imports from Button-Theme #600

Closed joshgamache closed 1 year ago

joshgamache commented 1 year ago

Specifications

@button-inc/button-theme 1.0.0-alpha.6

Describe the bug

When importing components for use, they can only be imported using the submodule style import (import Card from '@button-inc/button-theme/Card', not using named imports (import { Card } from '@button-inc/button-theme')

How to reproduce

  1. Import a component for use with named import:
import { Card } from '@button-inc/button-theme'

export default function Page() {
  return (
  <Card>Test</Card>
  )
}

Expected behavior

Component should import and be useable.

Logs/tracebacks

TS Error on attempted import: Module '"@button-inc/button-theme"' has no exported member 'Grid'.ts(2305)

Additional context

Default exports are not set in button-theme's packages/button-theme/src/index.tsx like they are in bcgov-theme's packages/bcgov-theme/src/index.tsx, other than for Button. Adding the default exports for all components should resolve this issue.