# @kyndryl-design-system/foundation

> Foundation for Kyndryl Design System

Latest version **1.0.0-beta.1** (published 2023-07-26) · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @kyndryl-design-system/foundation
pnpm add @kyndryl-design-system/foundation
yarn add @kyndryl-design-system/foundation
bun add @kyndryl-design-system/foundation
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.0-beta.1 |
| Published | 2023-07-26 |
| First published | 2023-07-26 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 1.9 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | maulik-thaker1, jonathan-w-dudzik, frodesigns, brian-patrick |

## Links

- npm: https://www.npmjs.com/package/@kyndryl-design-system/foundation
- npm.io page: https://npm.io/package/@kyndryl-design-system/foundation

## Dependencies (4)

- [lit](https://npm.io/package/lit.md) ^2.5.0
- [@carbon/icons](https://npm.io/package/@carbon/icons.md) ^11.14.0
- [@carbon/icon-helpers](https://npm.io/package/@carbon/icon-helpers.md) ^10.37.0
- [query-selector-shadow-dom](https://npm.io/package/query-selector-shadow-dom.md) ^1.0.1

## Recent versions

- 1.0.0-beta.1 (latest) — 2023-07-26
- 1.0.0-beta.24 (beta) — 2023-08-30
- 1.0.0-beta.23 — 2023-08-28
- 1.0.0-beta.22 — 2023-08-25
- 1.0.0-beta.21 — 2023-08-18
- 1.0.0-beta.20 — 2023-08-18
- 1.0.0-beta.19 — 2023-08-18
- 1.0.0-beta.18 — 2023-08-18
- 1.0.0-beta.17 — 2023-08-17
- 1.0.0-beta.16 — 2023-08-17
- 1.0.0-beta.15 — 2023-08-16
- 1.0.0-beta.14 — 2023-08-16
- 1.0.0-beta.13 — 2023-08-16
- 1.0.0-beta.12 — 2023-08-16
- 1.0.0-beta.11 — 2023-08-15
- … 9 more at https://npm.io/package/@kyndryl-design-system/foundation/versions

## README

# Kyndryl Design System - Foundation

[![kyndryl-web-components](https://github.kyndryl.net/kyndryl-design-system/web-components/actions/workflows/actions.yml/badge.svg)](https://github.kyndryl.net/kyndryl-design-system/web-components/actions/workflows/actions.yml)

# Contributing to this project

Read the [Contributing Guide](https://github.kyndryl.net/kyndryl-design-system/foundation/blob/beta/CONTRIBUTING.md) here.

# Using this library in another project

## Install the package

<!-- Note: This will not work until you have configured the enterprise package registry following the instructions above. -->

```bash
# stable/main
npm install @kyndryl-design-system/foundation -S

# beta (use until first stable release)
npm install @kyndryl-design-system/foundation@beta -S
# when using beta, lock the version, as breaking changes can happen at any time
```

## Import the root styles to your app's global styles

The method used (JS Import, SCSS @use, CSS @import, or &lt;style&gt; tag) will vary based on your framework/bundler, but the stylesheet can be found in `node_modules` at:

```js
@kyndryl-design-system/foundation/scss/root.scss
// or
@kyndryl-design-system/foundation/css/root.css
```

### Use CSS tokens/variables

You can make use of tokens/variables included in root.css such as `--kyn-header-height` to pad the body for the fixed position header, `--kyn-spacing-gutter` for the padding on your main container, or any of the color tokens. These are very bare-bones currently, and will need to be fleshed out later.

## Start using components

See [Storybook](https://pages.github.kyndryl.net/kyndryl-design-system/foundation/) for the full components documentation.

### Example: Component with Sub-components

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

```js
import '@kyndryl-design-system/foundation/components/global/header';
```

```html
<kyn-header>
  <kyn-header-nav>
    <kyn-header-link>Link</kyn-header-link>
  </kyn-header-nav>
</kyn-header>
```

### Example: Single Component

This example imports the HeaderLink component by targeting the component file directly.

```js
import '@kyndryl-design-system/foundation/components/global/header/headerLink';
```

```html
<kyn-header-link>Link</kyn-header-link>
```

### 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 with React 19](https://github.com/facebook/react/issues/11347#issuecomment-988970952), 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 [reactify-wc](https://www.npmjs.com/package/reactify-wc) to use these components in React.

Some options for React wrapper libraries:

1. [reactify-wc](https://www.npmjs.com/package/reactify-wc)
2. [wc-react](https://www.npmjs.com/package/wc-react)
3. [@lit-labs/react](https://www.npmjs.com/package/@lit-labs/react)

### Server-Side Rendering (SSR)

When using with an SSR framework like Next.js, you may encounter errors with code that only runs client-side, like `window` references for example. Here is an article that provides some methods to work around this: [Using Non-SSR Friendly Components with Next.js](https://blog.bitsrc.io/using-non-ssr-friendly-components-with-next-js-916f38e8992c). Basically, for components that make use of something like `window`, they need their rendering deferred to only happen on the client-side.

---
_Source: https://npm.io/package/@kyndryl-design-system/foundation · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
