1.6.4 • Published 9 days ago

@kyndryl-design-system/shidoka-foundation v1.6.4

Weekly downloads
-
License
-
Repository
github
Last release
9 days ago

Shidoka Foundation

shidoka-foundation

Contributing to this project

Read the Contributing Guide here.

Using this library in another project

Install the package

npm install @kyndryl-design-system/shidoka-foundation -S

Import the root stylesheet to your app's global styles

The method used (SCSS @use, CSS @import, JS import, or <style> tag) will vary based on your framework/bundler. Some examples:

SCSS

@use '@kyndryl-design-system/shidoka-foundation/scss/root.scss';

CSS

@import '@kyndryl-design-system/shidoka-foundation/css/root.css';

JS

import '@kyndryl-design-system/shidoka-foundation/css/root.css';

Use CSS tokens/variables

You can make use of tokens/variables included in root.css such as --kd-header-height to pad the body for the fixed position header, --kd-page-gutter for the padding on your main container, or any of the color tokens.

Start using components

See Storybook for the full components documentation.

Example: Component with Sub-components

This example imports a component AND all of it's subcomponents by targeting the index file.

import '@kyndryl-design-system/shidoka-foundation/components/example';
<kd-example>
  <kd-example-sub></kd-example-sub>
</kd-example>

Example: Single Component

This example imports one specific component by targeting the component file directly.

import '@kyndryl-design-system/shidoka-foundation/components/example/example-sub';
<kd-example-sub></kd-example-sub>

React usage

React does not yet support automatic interop with Web Components. This means that React treats all props passed to Web Components as string attributes. It sounds like they are planning to release it eventually, and is now available behind an @experimental flag. Until you've upgraded to a version of React that has support, you will need to use a library like @lit/react to use these components in React.

Some options for React wrapper libraries:

  1. @lit/react
  2. reactify-wc
  3. wc-react

Server-Side Rendering (SSR)

When using with an SSR framework like Next.js, you will encounter errors with code that only runs client-side, like window references for example. This is because web components cannot render on the server. Here is an article that provides some methods to work around this: Using Non-SSR Friendly Components with Next.js and How to entirely disable server-side rendering in next.js v13?. Basically, they need their rendering deferred to only happen on the client-side.

Here is some additional information about why SSR does not work for web components, and some potential polyfills/solutions to enable server rendering: https://lit.dev/docs/ssr/overview/

1.6.4

9 days ago

1.6.3

9 days ago

1.6.2

14 days ago

1.6.1

14 days ago

1.6.0

28 days ago

1.5.1

1 month ago

1.5.0

1 month ago

1.4.13

1 month ago

1.4.12

1 month ago

1.4.11

1 month ago

1.4.10

1 month ago

1.4.6

1 month ago

1.4.5

1 month ago

1.4.9-beta.1

1 month ago

1.4.4

1 month ago

1.4.9-beta.2

1 month ago

1.4.3

1 month ago

1.4.2

1 month ago

1.4.9-beta.3

1 month ago

1.4.9-beta.4

1 month ago

1.4.9

1 month ago

1.4.8

1 month ago

1.4.7

1 month ago

1.4.1

1 month ago

1.4.0

2 months ago

1.3.17

2 months ago

1.3.18

2 months ago

1.3.16

2 months ago

1.3.19

2 months ago

1.3.20

2 months ago

1.3.21

2 months ago

1.3.22

2 months ago

1.3.14

2 months ago

1.3.15

2 months ago

1.3.13

2 months ago

1.3.12

3 months ago

1.3.7

3 months ago

1.3.10

3 months ago

1.3.11

3 months ago

1.3.9

3 months ago

1.3.8

3 months ago

1.3.6

3 months ago

1.3.5

3 months ago

1.3.4

4 months ago

1.3.3

4 months ago

1.3.2

4 months ago

1.3.1

4 months ago

1.3.0

5 months ago

1.2.0

5 months ago

1.1.0

5 months ago

1.0.0

6 months ago

1.0.0-beta.38

6 months ago

1.0.0-beta.37

6 months ago

1.0.0-beta.36

7 months ago

1.0.0-beta.35

7 months ago

1.0.0-beta.34

7 months ago

1.0.0-beta.33

7 months ago

1.0.0-beta.32

7 months ago

1.0.0-beta.31

7 months ago

1.0.0-beta.30

7 months ago

1.0.0-beta.29

7 months ago

1.0.0-beta.28

7 months ago

1.0.0-beta.27

7 months ago

1.0.0-beta.26

8 months ago

1.0.0-beta.25

8 months ago