3.0.30 • Published 2 months ago

@nokkel/components v3.0.30

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

React Components

A repository for re-usable, React-based components for use across web applications within the Nokkel ecosystem.

Pre-requisites

Contributing

To create a component directory, run `npm run create:component --name="INSERT NAME HERE"

To create an icon, run `npm run create:icon --name="INSERT NAME HERE"

Nokkel components are structured like so:

src/
├── components/
│   └── [Component]/
│       ├── [Component].css
│       ├── [Component].stories.tsx
│       ├── [Component].tsx
│       ├── index.ts
│       └── types.ts
├── context/
│   ├── [context].tsx
│   └── index.ts
├── hooks/
│   ├── [hook].ts
│   └── index.ts
├── icons/
│   ├── [Icon]
|   ├── [Icon].stories.tsx
│   └── index.ts
├── styles/
│   └── global.css
├── sections/
│   └── [Section]/
│       ├── [Section].css
│       ├── [Section].stories.tsx
│       ├── [Section].tsx
│       ├── index.ts
│       └── types.ts
├── utils/
│   ├── [Util].ts
│   └── index.ts
└── index.ts
  • Component.css is where the component classes are stored. We use tailwind styles with the @apply for styles.
    • For brands, use the [data-theme="[brand]"] selector in order to change that specific class for brands.
    • See Button.css for a good example.
  • Component.stories.tsx is where the story for Storybook is stored.
    • Decorators may be used for containers in the case of responsive components.
    • Note: Storybook documentation oftentimes has a type issue with the satisfies Meta<typeof [Component]>. It's suggested to use the same pattern in Button.stories.tsx
    • The first story is used as the top example in Autodocs so it's best to ensure it has all the needed controls (though this can be manually added).
  • Component.tsx contains the actual component.
    • Using a Multi-line comment before the main export will be used by Autodocs in Storybook.
    • Add a data-testid=[component] for testing purposes and identification of component.
    • MaterialUI is used as a base for many components.
    • Button.tsx is a model component.
  • types.ts contains all the types such as props.
    • Comments before each props will be documented in storybook to help design know the fields that can be edited.
  • index.ts exports the component and types. We use this to export the component to the parent folder.
3.0.30

2 months ago

3.0.24

2 months ago

3.0.27

2 months ago

3.0.28

2 months ago

3.0.25

2 months ago

3.0.26

2 months ago

3.0.29

2 months ago

3.0.22

2 months ago

3.0.21

2 months ago

3.0.20

2 months ago

3.0.18

2 months ago

3.0.19

2 months ago

3.0.16

2 months ago

3.0.17

2 months ago

3.0.14

2 months ago

3.0.15

2 months ago

3.0.13

3 months ago

3.0.10

3 months ago

3.0.11

3 months ago

3.0.8

3 months ago

3.0.7

3 months ago

3.0.9

3 months ago

3.0.6

3 months ago

3.0.5

3 months ago

3.0.3

3 months ago

1.1.1

7 months ago

1.0.19

7 months ago

1.1.0

7 months ago

1.0.18

7 months ago

1.0.17

7 months ago

1.0.16

7 months ago

1.1.9

6 months ago

1.1.8

6 months ago

1.0.9

7 months ago

1.1.7

6 months ago

1.0.8

7 months ago

1.1.6

7 months ago

1.0.7

7 months ago

1.1.5

7 months ago

1.0.6

7 months ago

1.1.4

7 months ago

1.0.5

7 months ago

1.1.2

7 months ago

2.0.0-alpha.3

5 months ago

2.0.0-alpha.1

5 months ago

2.0.0-alpha.2

5 months ago

1.1.12

6 months ago

1.1.11

6 months ago

1.1.10

6 months ago

1.0.20

7 months ago

1.1.14

6 months ago

2.0.0

5 months ago

1.1.13

6 months ago

3.0.0

5 months ago

2.1.0-alpha.5

5 months ago

1.0.11

7 months ago

2.1.0-alpha.4

5 months ago

1.0.10

7 months ago

2.1.0-alpha.3

5 months ago

2.1.0-alpha.2

5 months ago

2.1.0-alpha.1

5 months ago

1.0.15

7 months ago

1.0.14

7 months ago

1.0.13

7 months ago

1.0.12

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

8 months ago

1.0.0

9 months ago