@nxds/claude-design 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,13 +10,13 @@ npx nxds-cli@latest export claude-design
10
10
 
11
11
  The command writes a `nxds-design-system/project/` folder. Publish that folder as a Design System artifact in Claude, unchanged.
12
12
 
13
- | File | What it holds |
14
- | ------------------------------------------- | ------------------------------------------------------------- |
15
- | `project/tokens.json`, `project/tokens.css` | Every nxds token at the default appearance, in Light and Dark |
16
- | `project/components/bundle.js` | Every component as `window.Nxds`, for React 18.3.1 globals |
17
- | `project/components/bundle.css` | The component styles |
18
- | `project/components/index.d.ts` | One `<Name>Props` interface per component part |
19
- | `project/components/<Name>/` | A preview card and a README per component |
20
- | `coverage.md` | The props the canvas can't set, and why |
13
+ | File | What it holds |
14
+ | ------------------------------------------- | ---------------------------------------------------------------------------- |
15
+ | `project/tokens.json`, `project/tokens.css` | The tokens the components read, at the default appearance, in Light and Dark |
16
+ | `project/components/bundle.js` | Every component as `window.Nxds`, for React 18.3.1 globals |
17
+ | `project/components/bundle.css` | The component styles |
18
+ | `project/components/index.d.ts` | One `<Name>Props` interface per component part |
19
+ | `project/components/<Name>/` | A preview card and a README per component |
20
+ | `coverage.md` | The props the canvas can't set, and why |
21
21
 
22
22
  Docs: <https://nxds.dev>
package/coverage.md CHANGED
@@ -4,9 +4,9 @@
4
4
 
5
5
  | Control | Props |
6
6
  | --- | --- |
7
- | dropdown | 258 |
7
+ | dropdown | 259 |
8
8
  | toggle | 506 |
9
- | number | 84 |
9
+ | number | 83 |
10
10
  | text | 857 |
11
11
  | content | 358 |
12
12
  | none: takes a React element; an attribute holds text only | 34 |
package/files.json CHANGED
@@ -1,7 +1,7 @@
1
1
  [
2
2
  {
3
3
  "path": "README.md",
4
- "sha256": "12d0eb7f124ee7374415b65e836b0db782f0227850e8fa54d627ce63361ae5c1"
4
+ "sha256": "ddcdccf84d6da9746ea2a3278118ef3c5c39dcfed0eef0aeda883fcf59338ef0"
5
5
  },
6
6
  {
7
7
  "path": "components/Accordion/README.md",
@@ -545,7 +545,7 @@
545
545
  },
546
546
  {
547
547
  "path": "components/ToggleGroup/README.md",
548
- "sha256": "4fe87b990175ad8b57a42229172b7113b075782e13c237aed41ef10dac72dee7"
548
+ "sha256": "491595cbc0134963d95f8946e184bd73cfca35b85a9cf97c8d96ac36f7d8f335"
549
549
  },
550
550
  {
551
551
  "path": "components/ToggleGroup/preview.html",
@@ -569,26 +569,26 @@
569
569
  },
570
570
  {
571
571
  "path": "components/bundle.css",
572
- "sha256": "aedba3fad8e8e388fe76906a67ecdb65e137e920ab02a97c982c5e280500a7e2"
572
+ "sha256": "825c98e626eb3495f9a74985cda28d6424495a454843ee8c3e24f11c3c87c33b"
573
573
  },
574
574
  {
575
575
  "path": "components/bundle.js",
576
- "sha256": "8d29bcf83e59d7aa499f6ca16fbd18b39cd0e33dcadf58ddd2c7805d58d7bfb7"
576
+ "sha256": "ed86d6b02bcb0680fd1820e1913ba24ab80f211575f78a7ed6680ff5a4eaf57d"
577
577
  },
578
578
  {
579
579
  "path": "components/index.d.ts",
580
- "sha256": "35cb3a2bc069dd75fc575330aac54f7a52ab4c529d0ba3fa01ed3b2e3be2e9ec"
580
+ "sha256": "3a9ac4b610e1f710c44d5b3fae4370189088e18e9ccf078d172899491c168044"
581
581
  },
582
582
  {
583
583
  "path": "design-system.json",
584
- "sha256": "953993668118d3116bae7c1304e396c404e8d42bbd0c13a293733dcc01df3c49"
584
+ "sha256": "ac176019190d8f49fae0b32ab19d162bc154a38f0a10d2eb44af753d549ca4f7"
585
585
  },
586
586
  {
587
587
  "path": "tokens.css",
588
- "sha256": "4a417149a21d98c51e276cc49938b9c259334ce8bd7da769d27af847a37ca530"
588
+ "sha256": "5e39516b7872b3fc46d629315ad566b06e5e01589c85eafcd5e9e586ddf050b3"
589
589
  },
590
590
  {
591
591
  "path": "tokens.json",
592
- "sha256": "06b18a9438782c0ad85af05392f848fb60b17343be227de3a1f436152e114e8d"
592
+ "sha256": "7d631a7f08f85eaeff57030f4aeb9dea7e4666366aa4e9e81fc0909dea311c0c"
593
593
  }
594
594
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxds/claude-design",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "nxds as a Claude Design System: tokens, a live React 18 component bundle, prop types and previews, ready to publish.",
5
5
  "keywords": [
6
6
  "nxds",
package/project/README.md CHANGED
@@ -28,7 +28,6 @@ nxds is neutral-first. Surfaces are near-white in Light and near-black in Dark.
28
28
  - Separate regions with `nx-color-border-default`. Use `nx-color-border-hairline` between rows.
29
29
  - Show focus with `nx-color-focus-default`, and `nx-color-focus-error` on an invalid control.
30
30
  - Plot chart series with `nx-color-chart-categorical-1` to `nx-color-chart-categorical-5`, in order.
31
- - Use the raw palette (`nx-color-blue-500` and its neighbours) only for one-off illustration. Components read semantic tokens only.
32
31
 
33
32
  Status is never colour alone. Every alert, badge and toast carries a word or an icon too.
34
33
 
@@ -59,13 +58,13 @@ Body copy is 14px. Keep one heading level per region, and step down one size at
59
58
  ## Shape and elevation
60
59
 
61
60
  - Round controls, inputs and cards with `nx-radius-md`. Buttons use `nx-radius-base`. Pills and avatars use `nx-radius-full`.
62
- - Draw every border at `nx-borderwidth-default`. Use `nx-borderwidth-thin` for hairlines.
61
+ - Draw every border at `nx-borderwidth-default`, and a selected or focused edge at `nx-borderwidth-thick`.
63
62
  - Prefer borders to shadows. Cards sit at `nx-shadow-sm`. Popovers, menus, dialogs and sheets lift with `nx-shadow-lg` on a frosted `nx-color-popover-alpha` surface. Flat content takes no shadow.
64
63
  - Stack layers with the z-index tokens: `nx-z-index-sticky`, `nx-z-index-modal`, `nx-z-index-popover`, `nx-z-index-toast`.
65
64
 
66
65
  ## Motion
67
66
 
68
- Motion answers input and then gets out of the way. Popovers, menus and routine state changes take 200ms, small fades and indicators 150ms, and pressed states 100ms. Nothing bounces. The tokens file has no motion family, so motion lives in the components.
67
+ Motion answers input and then gets out of the way. Popovers, menus and routine state changes take `nx-motion-duration-default` (200ms), small fades and indicators `nx-motion-duration-fast` (150ms), and pressed states `nx-motion-duration-faster` (100ms). Elements ease in on `nx-motion-ease-enter`. Nothing bounces.
69
68
 
70
69
  ## Iconography
71
70
 
@@ -88,7 +87,41 @@ The system has a Light and a Dark theme. Set `data-theme="dark"` on `<html>` to
88
87
 
89
88
  ## Appearance
90
89
 
91
- This system shows the default nxds appearance: a near-black brand colour on zinc surfaces, default density, subtle corners, quiet shadows and normal strokes. nxds apps can change these at runtime. Brand colour, surface tone, contrast, density, corners, elevation and stroke are appearance settings, not tokens, so they aren't editable here.
90
+ This system shows the default nxds appearance: a near-black brand colour on zinc surfaces, default density, subtle corners, quiet shadows and normal strokes.
91
+
92
+ Set an attribute on any element to change density, corners, elevation or stroke for everything inside it:
93
+
94
+ | Attribute | Values |
95
+ | --- | --- |
96
+ | `data-density` | `tight`, `compact`, `default`, `comfortable`, `relaxed`, `spacious` |
97
+ | `data-radius` | `square`, `subtle`, `smooth`, `round`, `extra-round` |
98
+ | `data-shadow` | `flat`, `quiet`, `soft`, `standard`, `strong` |
99
+ | `data-borderwidth` | `fine`, `normal`, `strong` |
100
+
101
+ Brand colour, surface tone and contrast are app-wide settings in nxds apps. They have no attribute.
102
+
103
+ ## On a Design canvas
104
+
105
+ Install these files with the system under `project/ds/<folder>/`. Link them in each artboard right after the `support.js` line, in this order:
106
+
107
+ 1. `tokens.css`: every token value, both themes and the text style classes. The components read their variables from it.
108
+ 2. `components/bundle.css`: the component styles and the appearance presets. It sets a token only inside a preset attribute.
109
+ 3. `components/bundle.js`: the components, as `window.Nxds`. The artboard supplies React 18, so skip `react` and `react-dom`.
110
+
111
+ ```html
112
+ <link rel="stylesheet" href="ds/<folder>/tokens.css" />
113
+ <link rel="stylesheet" href="ds/<folder>/components/bundle.css" />
114
+ <script src="ds/<folder>/components/bundle.js"></script>
115
+ ```
116
+
117
+ Add one `../` in front of each path for each folder the artboard is in.
118
+
119
+ The System page is read-only for this system. An edit there recompiles tokens.css without the theme layer, the font variables and the text style rules, so presets, fonts and text styles stop applying. Change the token in nxds and export again.
120
+
121
+ - Switch to dark with `data-theme="dark"` or the `dark` class on the artboard's root.
122
+ - Set a `data-density`, `data-radius`, `data-borderwidth` or `data-shadow` attribute from Appearance on any element to change everything inside it.
123
+ - Override a token by setting its variable on an element, such as `style="--nx-radius-md: 8px"`. Components inside that element follow.
124
+ - Read `components/<Name>/README.md` before you mount a component. It lists the component's parts and props.
92
125
 
93
126
  ## Canvas rules
94
127
 
@@ -46,7 +46,7 @@ Attributes set props, kebab-case to camelCase. Element content becomes `children
46
46
  | `asChild` | `boolean` | | toggle |
47
47
  | `variant` | `"default" \| "outline" \| "outline-primary"` | `"default"` | dropdown |
48
48
  | `size` | `"default" \| "sm" \| "lg"` | `"default"` | dropdown |
49
- | `spacing` | `number` | `0` | number |
49
+ | `spacing` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 0.5 \| 1.5 \| 2.5 \| 3.5 \| 9 \| 10 \| 11 \| 12 \| 14 \| 16 \| 20 \| 24 \| 28 \| 32 \| 36 \| 40 \| 44 \| 48 \| 52 \| 56 \| 60 \| 64 \| 72 \| 80 \| 96` | `0` | dropdown |
50
50
 
51
51
  ### ToggleGroupItem
52
52