@nxds/claude-design 0.0.0-stage → 0.6.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.
Files changed (153) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +21 -2
  3. package/coverage.md +174 -0
  4. package/files.json +594 -0
  5. package/package.json +18 -3
  6. package/project/README.md +97 -0
  7. package/project/components/Accordion/README.md +84 -0
  8. package/project/components/Accordion/preview.html +16 -0
  9. package/project/components/Alert/README.md +97 -0
  10. package/project/components/Alert/preview.html +16 -0
  11. package/project/components/AlertDialog/README.md +170 -0
  12. package/project/components/AlertDialog/preview.html +16 -0
  13. package/project/components/AspectRatio/README.md +23 -0
  14. package/project/components/AspectRatio/preview.html +16 -0
  15. package/project/components/Attachment/README.md +127 -0
  16. package/project/components/Attachment/preview.html +16 -0
  17. package/project/components/Avatar/README.md +73 -0
  18. package/project/components/Avatar/preview.html +16 -0
  19. package/project/components/Badge/README.md +27 -0
  20. package/project/components/Badge/preview.html +16 -0
  21. package/project/components/Breadcrumb/README.md +117 -0
  22. package/project/components/Breadcrumb/preview.html +16 -0
  23. package/project/components/Bubble/README.md +57 -0
  24. package/project/components/Bubble/preview.html +16 -0
  25. package/project/components/Button/README.md +35 -0
  26. package/project/components/Button/preview.html +16 -0
  27. package/project/components/ButtonGroup/README.md +54 -0
  28. package/project/components/ButtonGroup/preview.html +16 -0
  29. package/project/components/Card/README.md +92 -0
  30. package/project/components/Card/preview.html +16 -0
  31. package/project/components/Carousel/README.md +85 -0
  32. package/project/components/Carousel/preview.html +16 -0
  33. package/project/components/Chart/README.md +124 -0
  34. package/project/components/Chart/preview.html +16 -0
  35. package/project/components/Checkbox/README.md +30 -0
  36. package/project/components/Checkbox/preview.html +16 -0
  37. package/project/components/ChoiceCard/README.md +61 -0
  38. package/project/components/ChoiceCard/preview.html +16 -0
  39. package/project/components/ChoiceRow/README.md +58 -0
  40. package/project/components/ChoiceRow/preview.html +16 -0
  41. package/project/components/Collapsible/README.md +73 -0
  42. package/project/components/Collapsible/preview.html +16 -0
  43. package/project/components/Combobox/README.md +158 -0
  44. package/project/components/Combobox/preview.html +16 -0
  45. package/project/components/Command/README.md +152 -0
  46. package/project/components/Command/preview.html +16 -0
  47. package/project/components/ContextMenu/README.md +215 -0
  48. package/project/components/ContextMenu/preview.html +16 -0
  49. package/project/components/Cover/preview.html +101 -0
  50. package/project/components/DatePicker/README.md +104 -0
  51. package/project/components/DatePicker/preview.html +16 -0
  52. package/project/components/DescriptionList/README.md +57 -0
  53. package/project/components/DescriptionList/preview.html +16 -0
  54. package/project/components/Dialog/README.md +166 -0
  55. package/project/components/Dialog/preview.html +16 -0
  56. package/project/components/Drawer/README.md +188 -0
  57. package/project/components/Drawer/preview.html +16 -0
  58. package/project/components/DropdownMenu/README.md +250 -0
  59. package/project/components/DropdownMenu/preview.html +16 -0
  60. package/project/components/EmptyState/README.md +84 -0
  61. package/project/components/EmptyState/preview.html +16 -0
  62. package/project/components/Field/README.md +129 -0
  63. package/project/components/Field/preview.html +16 -0
  64. package/project/components/FilterBuilder/README.md +34 -0
  65. package/project/components/FilterBuilder/preview.html +16 -0
  66. package/project/components/FilterChip/README.md +31 -0
  67. package/project/components/FilterChip/preview.html +16 -0
  68. package/project/components/FilterCondition/README.md +66 -0
  69. package/project/components/FilterCondition/preview.html +16 -0
  70. package/project/components/Hide/README.md +26 -0
  71. package/project/components/Hide/preview.html +16 -0
  72. package/project/components/HoverCard/README.md +77 -0
  73. package/project/components/HoverCard/preview.html +16 -0
  74. package/project/components/Input/README.md +37 -0
  75. package/project/components/Input/preview.html +16 -0
  76. package/project/components/InputGroup/README.md +109 -0
  77. package/project/components/InputGroup/preview.html +16 -0
  78. package/project/components/InputOTP/README.md +72 -0
  79. package/project/components/InputOTP/preview.html +16 -0
  80. package/project/components/Item/README.md +124 -0
  81. package/project/components/Item/preview.html +16 -0
  82. package/project/components/Kbd/README.md +40 -0
  83. package/project/components/Kbd/preview.html +16 -0
  84. package/project/components/Label/README.md +25 -0
  85. package/project/components/Label/preview.html +16 -0
  86. package/project/components/Marker/README.md +48 -0
  87. package/project/components/Marker/preview.html +16 -0
  88. package/project/components/Menubar/README.md +266 -0
  89. package/project/components/Menubar/preview.html +16 -0
  90. package/project/components/Message/README.md +78 -0
  91. package/project/components/Message/preview.html +16 -0
  92. package/project/components/MessageScroller/README.md +84 -0
  93. package/project/components/MessageScroller/preview.html +16 -0
  94. package/project/components/MultiSelect/README.md +122 -0
  95. package/project/components/MultiSelect/preview.html +16 -0
  96. package/project/components/NativeSelect/README.md +56 -0
  97. package/project/components/NativeSelect/preview.html +16 -0
  98. package/project/components/NavigationMenu/README.md +153 -0
  99. package/project/components/NavigationMenu/preview.html +16 -0
  100. package/project/components/PageHeader/README.md +86 -0
  101. package/project/components/PageHeader/preview.html +16 -0
  102. package/project/components/Pagination/README.md +123 -0
  103. package/project/components/Pagination/preview.html +16 -0
  104. package/project/components/Popover/README.md +87 -0
  105. package/project/components/Popover/preview.html +16 -0
  106. package/project/components/Progress/README.md +27 -0
  107. package/project/components/Progress/preview.html +16 -0
  108. package/project/components/RadioGroup/README.md +67 -0
  109. package/project/components/RadioGroup/preview.html +16 -0
  110. package/project/components/Resizable/README.md +65 -0
  111. package/project/components/Resizable/preview.html +16 -0
  112. package/project/components/ScrollArea/README.md +42 -0
  113. package/project/components/ScrollArea/preview.html +16 -0
  114. package/project/components/Select/README.md +161 -0
  115. package/project/components/Select/preview.html +16 -0
  116. package/project/components/Separator/README.md +37 -0
  117. package/project/components/Separator/preview.html +16 -0
  118. package/project/components/Sheet/README.md +160 -0
  119. package/project/components/Sheet/preview.html +16 -0
  120. package/project/components/Show/README.md +26 -0
  121. package/project/components/Show/preview.html +16 -0
  122. package/project/components/Sidebar/README.md +290 -0
  123. package/project/components/Sidebar/preview.html +16 -0
  124. package/project/components/Skeleton/README.md +30 -0
  125. package/project/components/Skeleton/preview.html +16 -0
  126. package/project/components/Slider/README.md +38 -0
  127. package/project/components/Slider/preview.html +16 -0
  128. package/project/components/Sonner/README.md +37 -0
  129. package/project/components/Sonner/preview.html +16 -0
  130. package/project/components/Spinner/README.md +27 -0
  131. package/project/components/Spinner/preview.html +16 -0
  132. package/project/components/Switch/README.md +31 -0
  133. package/project/components/Switch/preview.html +16 -0
  134. package/project/components/Table/README.md +120 -0
  135. package/project/components/Table/preview.html +16 -0
  136. package/project/components/Tabs/README.md +81 -0
  137. package/project/components/Tabs/preview.html +16 -0
  138. package/project/components/Textarea/README.md +32 -0
  139. package/project/components/Textarea/preview.html +16 -0
  140. package/project/components/Toggle/README.md +33 -0
  141. package/project/components/Toggle/preview.html +16 -0
  142. package/project/components/ToggleGroup/README.md +64 -0
  143. package/project/components/ToggleGroup/preview.html +16 -0
  144. package/project/components/Toolbar/README.md +123 -0
  145. package/project/components/Toolbar/preview.html +16 -0
  146. package/project/components/Tooltip/README.md +84 -0
  147. package/project/components/Tooltip/preview.html +16 -0
  148. package/project/components/bundle.css +8329 -0
  149. package/project/components/bundle.js +346 -0
  150. package/project/components/index.d.ts +7902 -0
  151. package/project/design-system.json +34 -0
  152. package/project/tokens.css +702 -0
  153. package/project/tokens.json +2998 -0
@@ -0,0 +1,97 @@
1
+ nxds is a calm, dense product UI system: neutral surfaces, one brand colour, and state carried by tokens rather than decoration. Build every screen from the `Nxds` components and the tokens below.
2
+
3
+ ## Content fundamentals
4
+
5
+ - Write in plain, direct sentences. Address the reader as "you".
6
+ - Use sentence case for every label, title, button and menu item: "Save changes", not "Save Changes".
7
+ - Name the action on a button with a verb: "Create project", "Delete", "Invite people".
8
+ - Keep labels short. Put explanation in a description or helper text, never in the label.
9
+ - Write errors as what happened and what to do: "Enter an email address."
10
+ - No emoji in product copy, and no exclamation marks.
11
+
12
+ ## Colour
13
+
14
+ nxds is neutral-first. Surfaces are near-white in Light and near-black in Dark. Colour marks meaning, not decoration.
15
+
16
+ | Surface | Fill | Text on it |
17
+ | --------------------- | ------------------------- | ------------------------------- |
18
+ | Page | `nx-color-background` | `nx-color-foreground` |
19
+ | Card, panel | `nx-color-container` | `nx-color-container-foreground` |
20
+ | Menu, popover, dialog | `nx-color-popover` | `nx-color-popover-foreground` |
21
+ | Sidebar | `nx-color-nav-background` | `nx-color-nav-foreground` |
22
+ | Quiet well | `nx-color-muted` | `nx-color-muted-foreground` |
23
+
24
+ - Use `nx-color-primary-background` with `nx-color-primary-foreground` for the one main action in a view. Use `secondary` for the actions beside it.
25
+ - Show state with its family: `success`, `warning`, `error` and `information`. Use the solid `-background` fill for strong emphasis, and `-subtle` with `-subtle-foreground` for alerts, badges and banners.
26
+ - Pair every fill with the foreground its usage note names. Don't put `nx-color-muted-foreground` on a coloured fill.
27
+ - Hover and press use their own tokens, such as `nx-color-background-hover` and `nx-color-background-active`. Never fade a colour with opacity.
28
+ - Separate regions with `nx-color-border-default`. Use `nx-color-border-hairline` between rows.
29
+ - Show focus with `nx-color-focus-default`, and `nx-color-focus-error` on an invalid control.
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
+
33
+ Status is never colour alone. Every alert, badge and toast carries a word or an icon too.
34
+
35
+ ## Type
36
+
37
+ nxds sets text in the system UI face and code in the system monospace face.
38
+
39
+ | Use | Style |
40
+ | --------------------------- | ------------------------------------------------- |
41
+ | Page title | `typography-heading-large` |
42
+ | Section title | `typography-heading-medium` |
43
+ | Card title | `typography-heading-small` |
44
+ | Body copy | `typography-body-default` |
45
+ | Secondary copy, table cells | `typography-body-small` |
46
+ | Form labels | `typography-label-default` |
47
+ | Overlines, small caps | `typography-label-caps` |
48
+ | Code | `typography-code-block`, `typography-code-inline` |
49
+
50
+ Body copy is 14px. Keep one heading level per region, and step down one size at a time.
51
+
52
+ ## Spacing and layout
53
+
54
+ - Space with the 4px scale: `nx-spacing-1` is 4px, `nx-spacing-2` 8px, `nx-spacing-4` 16px, `nx-spacing-6` 24px.
55
+ - Pad cards and panels with `nx-container-p`. Gap their contents with `nx-container-gap`.
56
+ - Separate page sections with `nx-layout-section-gap`, and stack form rows with `nx-layout-stack-gap`.
57
+ - Lay out screens with flex or grid gaps from the scale. Don't hard-code pixel values.
58
+
59
+ ## Shape and elevation
60
+
61
+ - 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.
63
+ - 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
+ - Stack layers with the z-index tokens: `nx-z-index-sticky`, `nx-z-index-modal`, `nx-z-index-popover`, `nx-z-index-toast`.
65
+
66
+ ## Motion
67
+
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.
69
+
70
+ ## Iconography
71
+
72
+ - nxds uses Tabler icons, outline style, at 16px beside text. They are `Nxds.Icons.IconName`, such as `Nxds.Icons.IconPlus`.
73
+ - An icon takes the colour of its text. Don't tint icons on their own.
74
+ - An icon-only button needs an `aria-label`.
75
+ - No emoji as icons.
76
+
77
+ ## Using the components
78
+
79
+ - Mount components from `Nxds`, such as `Nxds.Button` and `Nxds.DialogContent`. Each component's card lists its parts and props.
80
+ - Compose a component from its parts, as its README shows: `Nxds.Card` holds `Nxds.CardHeader`, `Nxds.CardTitle` and `Nxds.CardContent`.
81
+ - Overlays (`Dialog`, `Popover`, `DropdownMenu`, `Select`, `Tooltip`) open from a trigger part, such as `Nxds.DialogTrigger`.
82
+ - Wrap a sidebar layout in `Nxds.SidebarProvider`, and mount `Nxds.Toaster` once to show toasts.
83
+ - Draw charts with `Nxds.ChartContainer` around `Nxds.Recharts` parts.
84
+
85
+ ## Themes
86
+
87
+ The system has a Light and a Dark theme. Set `data-theme="dark"` on `<html>` to switch, or add the `dark` class the way nxds apps do. Both switch every token and component.
88
+
89
+ ## Appearance
90
+
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.
92
+
93
+ ## Canvas rules
94
+
95
+ - Mount a component with `<x-import component-from-global-scope="Nxds.Button">`. Attributes set props, kebab-case to camelCase, and element content becomes `children`.
96
+ - An attribute holds text only. A prop that takes an element, a function or an object has no attribute.
97
+ - Lay out artboards with the spacing tokens, not raw pixel values.
@@ -0,0 +1,84 @@
1
+ # Accordion
2
+
3
+ Accordion shows and hides stacked sections of content. Use it when readers need only some sections of a long page. For a single section, use Collapsible.
4
+
5
+ ## On the canvas
6
+
7
+ ```html
8
+ <x-import component-from-global-scope="Nxds.Accordion" type="single" collapsible variant="stacked" class-name="nx:w-full nx:max-w-md">
9
+ <x-import component-from-global-scope="Nxds.AccordionItem" value="item-1">
10
+ <x-import component-from-global-scope="Nxds.AccordionTrigger">Is it accessible?</x-import>
11
+ <x-import component-from-global-scope="Nxds.AccordionContent">Yes. It adheres to the WAI-ARIA design pattern.</x-import>
12
+ </x-import>
13
+ <x-import component-from-global-scope="Nxds.AccordionItem" value="item-2">
14
+ <x-import component-from-global-scope="Nxds.AccordionTrigger">Is it styled?</x-import>
15
+ <x-import component-from-global-scope="Nxds.AccordionContent">Yes. It comes with default styles that match the nxds design system.</x-import>
16
+ </x-import>
17
+ <x-import component-from-global-scope="Nxds.AccordionItem" value="item-3">
18
+ <x-import component-from-global-scope="Nxds.AccordionTrigger">Is it animated?</x-import>
19
+ <x-import component-from-global-scope="Nxds.AccordionContent">Yes. It has smooth open/close animations built-in.</x-import>
20
+ </x-import>
21
+ </x-import>
22
+ ```
23
+
24
+ Attributes set props, kebab-case to camelCase. Element content becomes `children`. An attribute holds text, so a prop that takes an element, a function or an object has no attribute.
25
+
26
+ ## Parts
27
+
28
+ - `Nxds.Accordion` — Stacks sections that expand and collapse.
29
+ - `Nxds.AccordionContent`
30
+ - `Nxds.AccordionItem`
31
+ - `Nxds.AccordionTrigger`
32
+
33
+ ## Props
34
+
35
+ ### Accordion
36
+
37
+ | Prop | Type | Default | Control |
38
+ | --- | --- | --- | --- |
39
+ | `type` | `"single" \| "multiple"` | | dropdown |
40
+ | `value` | `string \| string[]` | | none (object) |
41
+ | `defaultValue` | `string \| string[]` | | none (object) |
42
+ | `onValueChange` | `((value: string) => void) \| ((value: string[]) => void)` | | none (function) |
43
+ | `disabled` | `boolean` | | toggle |
44
+ | `orientation` | `"horizontal" \| "vertical"` | | dropdown |
45
+ | `dir` | `"ltr" \| "rtl"` | | dropdown |
46
+ | `children` | `React.ReactNode` | | content |
47
+ | `className` | `string` | | text |
48
+ | `id` | `string` | | text |
49
+ | `asChild` | `boolean` | | toggle |
50
+ | `variant` | `"stacked" \| "floating"` | `"stacked"` | dropdown |
51
+
52
+ ### AccordionContent
53
+
54
+ | Prop | Type | Default | Control |
55
+ | --- | --- | --- | --- |
56
+ | `children` | `React.ReactNode` | | content |
57
+ | `className` | `string` | | text |
58
+ | `id` | `string` | | text |
59
+ | `asChild` | `boolean` | | toggle |
60
+ | `forceMount` | `true` | | toggle |
61
+
62
+ ### AccordionItem
63
+
64
+ | Prop | Type | Default | Control |
65
+ | --- | --- | --- | --- |
66
+ | `disabled` | `boolean` | | toggle |
67
+ | `value` | `string` | | text |
68
+ | `children` | `React.ReactNode` | | content |
69
+ | `className` | `string` | | text |
70
+ | `id` | `string` | | text |
71
+ | `asChild` | `boolean` | | toggle |
72
+
73
+ ### AccordionTrigger
74
+
75
+ | Prop | Type | Default | Control |
76
+ | --- | --- | --- | --- |
77
+ | `children` | `React.ReactNode` | | content |
78
+ | `className` | `string` | | text |
79
+ | `id` | `string` | | text |
80
+ | `name` | `string` | | text |
81
+ | `type` | `"button" \| "submit" \| "reset"` | | dropdown |
82
+ | `asChild` | `boolean` | | toggle |
83
+ | `disabled` | `boolean` | | toggle |
84
+ | `value` | `string \| number \| readonly string[]` | | none (object) |
@@ -0,0 +1,16 @@
1
+ <!-- @dsCard group="Data display" height=120 -->
2
+ <!doctype html>
3
+ <html lang="en">
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <title>Accordion</title>
7
+ <style>
8
+ body { margin: 0; background: var(--nx-color-background); color: var(--nx-color-foreground); font-family: var(--font-sans); }
9
+ #root { padding: var(--nx-spacing-6); }
10
+ </style>
11
+ </head>
12
+ <body>
13
+ <div id="root"></div>
14
+ <script>(()=>{var E=Object.create;var u=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var m=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}};var v=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of T(e))!P.call(t,r)&&r!==n&&u(t,r,{get:()=>e[r],enumerable:!(s=R(e,r))||s.enumerable});return t};var d=(t,e,n)=>(n=t!=null?E(K(t)):{},v(e||!t||!t.__esModule?u(n,"default",{value:t,enumerable:!0}):n,t));var y=m((b,A)=>{A.exports=window.Nxds});var l=m((D,f)=>{f.exports=window.React});var I=m((N,x)=>{x.exports={createRoot:window.ReactDOM.createRoot}});var o=d(y());var a=d(l());function g(t,e){return e===void 0?t:{...t,key:e}}function c(t,e,n){return(0,a.createElement)(t,g(e,n))}function i(t,e,n){let{children:s,...r}=e;return(0,a.createElement)(t,g(r,n),...s)}function p(){return i(o.Accordion,{type:"single",collapsible:!0,variant:"stacked",className:"nx:w-full nx:max-w-md",children:[i(o.AccordionItem,{value:"item-1",children:[c(o.AccordionTrigger,{children:"Is it accessible?"}),c(o.AccordionContent,{children:"Yes. It adheres to the WAI-ARIA design pattern."})]}),i(o.AccordionItem,{value:"item-2",children:[c(o.AccordionTrigger,{children:"Is it styled?"}),c(o.AccordionContent,{children:"Yes. It comes with default styles that match the nxds design system."})]}),i(o.AccordionItem,{value:"item-3",children:[c(o.AccordionTrigger,{children:"Is it animated?"}),c(o.AccordionContent,{children:"Yes. It has smooth open/close animations built-in."})]})]})}var w=d(l()),h=d(I());(0,h.createRoot)(document.getElementById("root")).render((0,w.createElement)(p));})();</script>
15
+ </body>
16
+ </html>
@@ -0,0 +1,97 @@
1
+ # Alert
2
+
3
+ Alert shows a status message inside the page. Use it for information, success, warning and error messages. Compose the icon, text, actions and close button as children.
4
+
5
+ - Stack layout: use no actions, or one or two Button actions. Leave out AlertClose.
6
+ - Inline layout: use AlertClose alone, one or two Button actions, or Buttons plus AlertClose.
7
+ - AlertClose doesn't remove the alert. Remove it in your own `onClick` handler.
8
+
9
+ ## On the canvas
10
+
11
+ ```html
12
+ <x-import component-from-global-scope="Nxds.Alert" layout="stack" presentation="card" variant="default" class-name="nx:max-w-md">
13
+ <x-import component-from-global-scope="Nxds.AlertIcon">
14
+ <x-import component-from-global-scope="Nxds.Icons.IconInfoCircle"></x-import>
15
+ </x-import>
16
+ <x-import component-from-global-scope="Nxds.AlertTitle">Information</x-import>
17
+ <x-import component-from-global-scope="Nxds.AlertDescription">This is an informational alert with an icon.</x-import>
18
+ </x-import>
19
+ ```
20
+
21
+ Attributes set props, kebab-case to camelCase. Element content becomes `children`. An attribute holds text, so a prop that takes an element, a function or an object has no attribute.
22
+
23
+ ## Parts
24
+
25
+ - `Nxds.Alert` — Shows a status message inside the page.
26
+ - `Nxds.AlertActions` — Holds one or two `Button` actions.
27
+ - `Nxds.AlertClose` — Close button, labelled "Dismiss alert" by default.
28
+ - `Nxds.AlertContent` — Wraps the title and description.
29
+ - `Nxds.AlertDescription` — Body text of an alert.
30
+ - `Nxds.AlertIcon` — Leading icon.
31
+ - `Nxds.AlertTitle` — Alert heading.
32
+
33
+ ## Props
34
+
35
+ ### Alert
36
+
37
+ | Prop | Type | Default | Control |
38
+ | --- | --- | --- | --- |
39
+ | `className` | `string` | | text |
40
+ | `id` | `string` | | text |
41
+ | `children` | `React.ReactNode` | | content |
42
+ | `layout` | `"inline" \| "stack"` | `"stack"` | dropdown |
43
+ | `variant` | `"default" \| "destructive" \| "success" \| "information" \| "warning"` | `"default"` | dropdown |
44
+ | `presentation` | `"banner" \| "card"` | `"card"` | dropdown |
45
+
46
+ ### AlertActions
47
+
48
+ | Prop | Type | Default | Control |
49
+ | --- | --- | --- | --- |
50
+ | `className` | `string` | | text |
51
+ | `id` | `string` | | text |
52
+ | `children` | `React.ReactNode` | | content |
53
+
54
+ ### AlertClose
55
+
56
+ | Prop | Type | Default | Control |
57
+ | --- | --- | --- | --- |
58
+ | `disabled` | `boolean` | | toggle |
59
+ | `name` | `string` | | text |
60
+ | `type` | `"button" \| "submit" \| "reset"` | `"button"` | dropdown |
61
+ | `value` | `string \| number \| readonly string[]` | | none (object) |
62
+ | `className` | `string` | | text |
63
+ | `id` | `string` | | text |
64
+ | `children` | `React.ReactNode` | | content |
65
+
66
+ ### AlertContent
67
+
68
+ | Prop | Type | Default | Control |
69
+ | --- | --- | --- | --- |
70
+ | `className` | `string` | | text |
71
+ | `id` | `string` | | text |
72
+ | `children` | `React.ReactNode` | | content |
73
+
74
+ ### AlertDescription
75
+
76
+ | Prop | Type | Default | Control |
77
+ | --- | --- | --- | --- |
78
+ | `className` | `string` | | text |
79
+ | `id` | `string` | | text |
80
+ | `children` | `React.ReactNode` | | content |
81
+
82
+ ### AlertIcon
83
+
84
+ | Prop | Type | Default | Control |
85
+ | --- | --- | --- | --- |
86
+ | `className` | `string` | | text |
87
+ | `id` | `string` | | text |
88
+ | `children` | `React.ReactNode` | | content |
89
+
90
+ ### AlertTitle
91
+
92
+ | Prop | Type | Default | Control |
93
+ | --- | --- | --- | --- |
94
+ | `asChild` | `boolean` | `false` | toggle |
95
+ | `className` | `string` | | text |
96
+ | `id` | `string` | | text |
97
+ | `children` | `React.ReactNode` | | content |
@@ -0,0 +1,16 @@
1
+ <!-- @dsCard group="Feedback" height=120 -->
2
+ <!doctype html>
3
+ <html lang="en">
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <title>Alert</title>
7
+ <style>
8
+ body { margin: 0; background: var(--nx-color-background); color: var(--nx-color-foreground); font-family: var(--font-sans); }
9
+ #root { padding: var(--nx-spacing-6); }
10
+ </style>
11
+ </head>
12
+ <body>
13
+ <div id="root"></div>
14
+ <script>(()=>{var P=Object.create;var d=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty;var l=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}};var k=(t,e,r,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of g(e))!j.call(t,n)&&n!==r&&d(t,n,{get:()=>e[n],enumerable:!(c=D(e,n))||c.enumerable});return t};var i=(t,e,r)=>(r=t!=null?P(N(t)):{},k(e||!t||!t.__esModule?d(r,"default",{value:t,enumerable:!0}):r,t));var u=l((B,f)=>{f.exports=window.Nxds.Icons});var y=l((C,x)=>{x.exports=window.Nxds});var m=l((F,w)=>{w.exports=window.React});var R=l((V,h)=>{h.exports={createRoot:window.ReactDOM.createRoot}});var I=i(u()),o=i(y());var s=i(m());function A(t,e){return e===void 0?t:{...t,key:e}}function a(t,e,r){return(0,s.createElement)(t,A(e,r))}function E(t,e,r){let{children:c,...n}=e;return(0,s.createElement)(t,A(n,r),...c)}function p(){return E(o.Alert,{layout:"stack",presentation:"card",variant:"default",className:"nx:max-w-md",children:[a(o.AlertIcon,{children:a(I.IconInfoCircle,{})}),a(o.AlertTitle,{children:"Information"}),a(o.AlertDescription,{children:"This is an informational alert with an icon."})]})}var T=i(m()),K=i(R());(0,K.createRoot)(document.getElementById("root")).render((0,T.createElement)(p));})();</script>
15
+ </body>
16
+ </html>
@@ -0,0 +1,170 @@
1
+ # AlertDialog
2
+
3
+ AlertDialog makes the user confirm or cancel before an action with serious results, such as deleting data. For lower-stakes modal tasks, use Dialog. For edge panels, use Sheet, or Drawer for drag-to-dismiss.
4
+
5
+ ## On the canvas
6
+
7
+ ```html
8
+ <x-import component-from-global-scope="Nxds.AlertDialog">
9
+ <x-import component-from-global-scope="Nxds.AlertDialogTrigger" as-child>
10
+ <x-import component-from-global-scope="Nxds.Button" variant="outline">Show dialog</x-import>
11
+ </x-import>
12
+ <x-import component-from-global-scope="Nxds.AlertDialogContent">
13
+ <x-import component-from-global-scope="Nxds.AlertDialogHeader">
14
+ <x-import component-from-global-scope="Nxds.AlertDialogTitle">Are you absolutely sure?</x-import>
15
+ <x-import component-from-global-scope="Nxds.AlertDialogDescription">This action cannot be undone. This will permanently update your account settings.</x-import>
16
+ </x-import>
17
+ <x-import component-from-global-scope="Nxds.AlertDialogFooter">
18
+ <x-import component-from-global-scope="Nxds.AlertDialogCancel">Cancel</x-import>
19
+ <x-import component-from-global-scope="Nxds.AlertDialogAction">Continue</x-import>
20
+ </x-import>
21
+ </x-import>
22
+ </x-import>
23
+ ```
24
+
25
+ Attributes set props, kebab-case to camelCase. Element content becomes `children`. An attribute holds text, so a prop that takes an element, a function or an object has no attribute.
26
+
27
+ ## Parts
28
+
29
+ - `Nxds.AlertDialog` — Modal that makes the user confirm or cancel before continuing.
30
+ - `Nxds.AlertDialogAction` — Confirm button.
31
+ - `Nxds.AlertDialogBody` — Holds the main content, aligned with the header and footer.
32
+ - `Nxds.AlertDialogCancel` — Cancel button, styled as an `outline` Button.
33
+ - `Nxds.AlertDialogContent` — Dialog panel, rendered in a portal over the overlay.
34
+ - `Nxds.AlertDialogDescription` — Explains the result of the action.
35
+ - `Nxds.AlertDialogFooter` — Holds the action buttons.
36
+ - `Nxds.AlertDialogHeader` — Holds the title and description.
37
+ - `Nxds.AlertDialogOverlay` — Dimmed backdrop behind the alert dialog.
38
+ - `Nxds.AlertDialogPortal` — Renders the alert dialog into `document.body`.
39
+ - `Nxds.AlertDialogTitle` — Dialog title.
40
+ - `Nxds.AlertDialogTrigger` — Opens the alert dialog.
41
+
42
+ ## Props
43
+
44
+ ### AlertDialog
45
+
46
+ | Prop | Type | Default | Control |
47
+ | --- | --- | --- | --- |
48
+ | `children` | `React.ReactNode` | | content |
49
+ | `defaultOpen` | `boolean` | | toggle |
50
+ | `open` | `boolean` | | toggle |
51
+ | `onOpenChange` | `(open: boolean) => void` | | none (function) |
52
+
53
+ ### AlertDialogAction
54
+
55
+ | Prop | Type | Default | Control |
56
+ | --- | --- | --- | --- |
57
+ | `children` | `React.ReactNode` | | content |
58
+ | `className` | `string` | | text |
59
+ | `id` | `string` | | text |
60
+ | `name` | `string` | | text |
61
+ | `type` | `"button" \| "submit" \| "reset"` | | dropdown |
62
+ | `asChild` | `boolean` | | toggle |
63
+ | `disabled` | `boolean` | | toggle |
64
+ | `value` | `string \| number \| readonly string[]` | | none (object) |
65
+ | `variant` | `"link" \| "default" \| "destructive" \| "error" \| "outline" \| "dashed" \| "secondary" \| "ghost"` | `"default"` | dropdown |
66
+ | `size` | `"default" \| "sm" \| "lg" \| "icon-sm" \| "icon" \| "icon-lg"` | `"default"` | dropdown |
67
+
68
+ ### AlertDialogBody
69
+
70
+ | Prop | Type | Default | Control |
71
+ | --- | --- | --- | --- |
72
+ | `className` | `string` | | text |
73
+ | `id` | `string` | | text |
74
+ | `children` | `React.ReactNode` | | content |
75
+
76
+ ### AlertDialogCancel
77
+
78
+ | Prop | Type | Default | Control |
79
+ | --- | --- | --- | --- |
80
+ | `children` | `React.ReactNode` | | content |
81
+ | `className` | `string` | | text |
82
+ | `id` | `string` | | text |
83
+ | `name` | `string` | | text |
84
+ | `type` | `"button" \| "submit" \| "reset"` | | dropdown |
85
+ | `asChild` | `boolean` | | toggle |
86
+ | `disabled` | `boolean` | | toggle |
87
+ | `value` | `string \| number \| readonly string[]` | | none (object) |
88
+ | `variant` | `"link" \| "default" \| "destructive" \| "error" \| "outline" \| "dashed" \| "secondary" \| "ghost"` | `"outline"` | dropdown |
89
+ | `size` | `"default" \| "sm" \| "lg" \| "icon-sm" \| "icon" \| "icon-lg"` | `"default"` | dropdown |
90
+
91
+ ### AlertDialogContent
92
+
93
+ | Prop | Type | Default | Control |
94
+ | --- | --- | --- | --- |
95
+ | `variant` | `"center" \| "default"` | `"default"` | dropdown |
96
+ | `children` | `React.ReactNode` | | content |
97
+ | `className` | `string` | | text |
98
+ | `id` | `string` | | text |
99
+ | `asChild` | `boolean` | | toggle |
100
+ | `forceMount` | `true` | | toggle |
101
+ | `onEscapeKeyDown` | `(event: KeyboardEvent) => void` | | none (function) |
102
+ | `onFocusOutside` | `(event: FocusOutsideEvent) => void` | | none (function) |
103
+ | `onOpenAutoFocus` | `(event: Event) => void` | | none (function) |
104
+ | `onCloseAutoFocus` | `(event: Event) => void` | | none (function) |
105
+
106
+ ### AlertDialogDescription
107
+
108
+ | Prop | Type | Default | Control |
109
+ | --- | --- | --- | --- |
110
+ | `children` | `React.ReactNode` | | content |
111
+ | `className` | `string` | | text |
112
+ | `id` | `string` | | text |
113
+ | `asChild` | `boolean` | | toggle |
114
+
115
+ ### AlertDialogFooter
116
+
117
+ | Prop | Type | Default | Control |
118
+ | --- | --- | --- | --- |
119
+ | `className` | `string` | | text |
120
+ | `id` | `string` | | text |
121
+ | `children` | `React.ReactNode` | | content |
122
+
123
+ ### AlertDialogHeader
124
+
125
+ | Prop | Type | Default | Control |
126
+ | --- | --- | --- | --- |
127
+ | `className` | `string` | | text |
128
+ | `id` | `string` | | text |
129
+ | `children` | `React.ReactNode` | | content |
130
+ | `variant` | `"center" \| "default"` | `"default"` | dropdown |
131
+
132
+ ### AlertDialogOverlay
133
+
134
+ | Prop | Type | Default | Control |
135
+ | --- | --- | --- | --- |
136
+ | `children` | `React.ReactNode` | | content |
137
+ | `className` | `string` | | text |
138
+ | `id` | `string` | | text |
139
+ | `asChild` | `boolean` | | toggle |
140
+ | `forceMount` | `true` | | toggle |
141
+
142
+ ### AlertDialogPortal
143
+
144
+ | Prop | Type | Default | Control |
145
+ | --- | --- | --- | --- |
146
+ | `children` | `React.ReactNode` | | content |
147
+ | `container` | `Element \| DocumentFragment` | | none (object) |
148
+ | `forceMount` | `true` | | toggle |
149
+
150
+ ### AlertDialogTitle
151
+
152
+ | Prop | Type | Default | Control |
153
+ | --- | --- | --- | --- |
154
+ | `children` | `React.ReactNode` | | content |
155
+ | `className` | `string` | | text |
156
+ | `id` | `string` | | text |
157
+ | `asChild` | `boolean` | | toggle |
158
+
159
+ ### AlertDialogTrigger
160
+
161
+ | Prop | Type | Default | Control |
162
+ | --- | --- | --- | --- |
163
+ | `children` | `React.ReactNode` | | content |
164
+ | `className` | `string` | | text |
165
+ | `id` | `string` | | text |
166
+ | `name` | `string` | | text |
167
+ | `type` | `"button" \| "submit" \| "reset"` | | dropdown |
168
+ | `asChild` | `boolean` | | toggle |
169
+ | `disabled` | `boolean` | | toggle |
170
+ | `value` | `string \| number \| readonly string[]` | | none (object) |
@@ -0,0 +1,16 @@
1
+ <!-- @dsCard group="Overlays" height=120 -->
2
+ <!doctype html>
3
+ <html lang="en">
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <title>AlertDialog</title>
7
+ <style>
8
+ body { margin: 0; background: var(--nx-color-background); color: var(--nx-color-foreground); font-family: var(--font-sans); }
9
+ #root { padding: var(--nx-spacing-6); }
10
+ </style>
11
+ </head>
12
+ <body>
13
+ <div id="root"></div>
14
+ <script>(()=>{var h=Object.create;var m=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var p=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}};var B=(t,e,r,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of R(e))!P.call(t,n)&&n!==r&&m(t,n,{get:()=>e[n],enumerable:!(c=C(e,n))||c.enumerable});return t};var i=(t,e,r)=>(r=t!=null?h(K(t)):{},B(e||!t||!t.__esModule?m(r,"default",{value:t,enumerable:!0}):r,t));var s=p((b,A)=>{A.exports=window.Nxds});var u=p((j,d)=>{d.exports=window.React});var x=p((v,w)=>{w.exports={createRoot:window.ReactDOM.createRoot}});var o=i(s()),f=i(s());var g=i(u());function y(t,e){return e===void 0?t:{...t,key:e}}function l(t,e,r){return(0,g.createElement)(t,y(e,r))}function a(t,e,r){let{children:c,...n}=e;return(0,g.createElement)(t,y(n,r),...c)}function D(){return a(o.AlertDialog,{children:[l(o.AlertDialogTrigger,{asChild:!0,children:l(f.Button,{variant:"outline",children:"Show dialog"})}),a(o.AlertDialogContent,{children:[a(o.AlertDialogHeader,{children:[l(o.AlertDialogTitle,{children:"Are you absolutely sure?"}),l(o.AlertDialogDescription,{children:"This action cannot be undone. This will permanently update your account settings."})]}),a(o.AlertDialogFooter,{children:[l(o.AlertDialogCancel,{children:"Cancel"}),l(o.AlertDialogAction,{children:"Continue"})]})]})]})}var T=i(u()),E=i(x());(0,E.createRoot)(document.getElementById("root")).render((0,T.createElement)(D));})();</script>
15
+ </body>
16
+ </html>
@@ -0,0 +1,23 @@
1
+ # AspectRatio
2
+
3
+ AspectRatio keeps its content at a fixed width-to-height ratio. Use it for images, video, embeds and maps. AspectRatio fills its parent width, so place it in a sized container.
4
+
5
+ ## On the canvas
6
+
7
+ ```html
8
+ <x-import component-from-global-scope="Nxds.AspectRatio">AspectRatio</x-import>
9
+ ```
10
+
11
+ Attributes set props, kebab-case to camelCase. Element content becomes `children`. An attribute holds text, so a prop that takes an element, a function or an object has no attribute.
12
+
13
+ ## Props
14
+
15
+ ### AspectRatio
16
+
17
+ | Prop | Type | Default | Control |
18
+ | --- | --- | --- | --- |
19
+ | `ratio` | `number` | | number |
20
+ | `children` | `React.ReactNode` | | content |
21
+ | `className` | `string` | | text |
22
+ | `id` | `string` | | text |
23
+ | `asChild` | `boolean` | | toggle |
@@ -0,0 +1,16 @@
1
+ <!-- @dsCard group="Layout" height=120 -->
2
+ <!doctype html>
3
+ <html lang="en">
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <title>AspectRatio</title>
7
+ <style>
8
+ body { margin: 0; background: var(--nx-color-background); color: var(--nx-color-foreground); font-family: var(--font-sans); }
9
+ #root { padding: var(--nx-spacing-6); }
10
+ </style>
11
+ </head>
12
+ <body>
13
+ <div id="root"></div>
14
+ <script>(()=>{var g=Object.create;var m=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var s=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var v=(e,t,n,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of h(t))!b.call(e,r)&&r!==n&&m(e,r,{get:()=>t[r],enumerable:!(d=P(t,r))||d.enumerable});return e};var i=(e,t,n)=>(n=e!=null?g(K(e)):{},v(t||!e||!e.__esModule?m(n,"default",{value:e,enumerable:!0}):n,e));var u=s((N,p)=>{p.exports=window.Nxds});var a=s((T,x)=>{x.exports=window.React});var w=s((F,y)=>{y.exports={createRoot:window.ReactDOM.createRoot}});var f=i(u());var l=i(a());function j(e,t){return t===void 0?e:{...e,key:t}}function o(e,t,n){return(0,l.createElement)(e,j(t,n))}function A({label:e}){return o("div",{className:"nx:flex nx:size-full nx:items-center nx:justify-center nx:rounded-md nx:bg-muted nx:text-muted-foreground nx:typography-label-small",children:e})}function c(){return o("div",{className:"nx:w-80",children:o(f.AspectRatio,{ratio:16/9,children:o(A,{label:"16 / 9"})})})}var R=i(a()),E=i(w());(0,E.createRoot)(document.getElementById("root")).render((0,R.createElement)(c));})();</script>
15
+ </body>
16
+ </html>