# CB Sting DLS

CB Sting DLS is a public React package for the Sting design system.

This repository is publish-only. Source code, tests, and the production build live in a separate local DLS source repository. This package repository only keeps npm metadata and the built `dist` folder that is published to npm.

For future releases, see [Publishing Guide](PUBLISHING.md).

## Install

```bash
npm install cb-sting-dls
```

Install the required peer dependencies if they are not already present in your app:

```bash
npm install react@18 react-dom@18
```

## Usage

Import components from the package root and load the design system stylesheet once in your app shell.

```tsx
import { SButton } from "cb-sting-dls";
import "cb-sting-dls/sting-react.css";

export function Example() {
  return <SButton>Save</SButton>;
}
```

## Sync The Build

Build the source package first:

```bash
cd ../cb-react-dls
pnpm --filter @chargebee/sting-tokens build
pnpm --filter sting-react build
```

Then sync the built files into this publish-only repo:

```bash
cd ../cb-sting-dls
npm run sync:dist
```

If the DLS source repo is not at `../cb-react-dls/packages/sting-react/dist`, pass the built folder explicitly:

```bash
DLS_DIST_PATH=/absolute/path/to/cb-react-dls/packages/sting-react/dist npm run sync:dist
```

The sync step requires these files to exist:

- `dist/index.js`
- `dist/index.d.ts`
- `dist/sting-react.css`

## Publish

Preview the package contents before publishing:

```bash
npm pack --dry-run
```

Publish to npm. Unscoped npm packages are public by default:

```bash
npm publish
```

Use `npm version patch`, `npm version minor`, or `npm version major` before publishing a new release.
