@nxds/claude-design 0.0.0-stage → 0.5.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/LICENSE +21 -0
- package/README.md +21 -2
- package/coverage.json +2823 -0
- package/coverage.md +174 -0
- package/files.json +594 -0
- package/package.json +18 -3
- package/project/README.md +97 -0
- package/project/components/Accordion/README.md +84 -0
- package/project/components/Accordion/preview.html +16 -0
- package/project/components/Alert/README.md +97 -0
- package/project/components/Alert/preview.html +16 -0
- package/project/components/AlertDialog/README.md +170 -0
- package/project/components/AlertDialog/preview.html +16 -0
- package/project/components/AspectRatio/README.md +23 -0
- package/project/components/AspectRatio/preview.html +16 -0
- package/project/components/Attachment/README.md +127 -0
- package/project/components/Attachment/preview.html +16 -0
- package/project/components/Avatar/README.md +76 -0
- package/project/components/Avatar/preview.html +16 -0
- package/project/components/Badge/README.md +27 -0
- package/project/components/Badge/preview.html +16 -0
- package/project/components/Breadcrumb/README.md +117 -0
- package/project/components/Breadcrumb/preview.html +16 -0
- package/project/components/Bubble/README.md +57 -0
- package/project/components/Bubble/preview.html +16 -0
- package/project/components/Button/README.md +35 -0
- package/project/components/Button/preview.html +16 -0
- package/project/components/ButtonGroup/README.md +54 -0
- package/project/components/ButtonGroup/preview.html +16 -0
- package/project/components/Card/README.md +92 -0
- package/project/components/Card/preview.html +16 -0
- package/project/components/Carousel/README.md +85 -0
- package/project/components/Carousel/preview.html +16 -0
- package/project/components/Chart/README.md +124 -0
- package/project/components/Chart/preview.html +16 -0
- package/project/components/Checkbox/README.md +30 -0
- package/project/components/Checkbox/preview.html +16 -0
- package/project/components/ChoiceCard/README.md +61 -0
- package/project/components/ChoiceCard/preview.html +16 -0
- package/project/components/ChoiceRow/README.md +58 -0
- package/project/components/ChoiceRow/preview.html +16 -0
- package/project/components/Collapsible/README.md +73 -0
- package/project/components/Collapsible/preview.html +16 -0
- package/project/components/Combobox/README.md +158 -0
- package/project/components/Combobox/preview.html +16 -0
- package/project/components/Command/README.md +152 -0
- package/project/components/Command/preview.html +16 -0
- package/project/components/ContextMenu/README.md +215 -0
- package/project/components/ContextMenu/preview.html +16 -0
- package/project/components/Cover/preview.html +101 -0
- package/project/components/DatePicker/README.md +104 -0
- package/project/components/DatePicker/preview.html +16 -0
- package/project/components/DescriptionList/README.md +57 -0
- package/project/components/DescriptionList/preview.html +16 -0
- package/project/components/Dialog/README.md +166 -0
- package/project/components/Dialog/preview.html +16 -0
- package/project/components/Drawer/README.md +188 -0
- package/project/components/Drawer/preview.html +16 -0
- package/project/components/DropdownMenu/README.md +250 -0
- package/project/components/DropdownMenu/preview.html +16 -0
- package/project/components/EmptyState/README.md +84 -0
- package/project/components/EmptyState/preview.html +16 -0
- package/project/components/Field/README.md +129 -0
- package/project/components/Field/preview.html +16 -0
- package/project/components/FilterBuilder/README.md +34 -0
- package/project/components/FilterBuilder/preview.html +16 -0
- package/project/components/FilterChip/README.md +31 -0
- package/project/components/FilterChip/preview.html +16 -0
- package/project/components/FilterCondition/README.md +66 -0
- package/project/components/FilterCondition/preview.html +16 -0
- package/project/components/Hide/README.md +26 -0
- package/project/components/Hide/preview.html +16 -0
- package/project/components/HoverCard/README.md +77 -0
- package/project/components/HoverCard/preview.html +16 -0
- package/project/components/Input/README.md +37 -0
- package/project/components/Input/preview.html +16 -0
- package/project/components/InputGroup/README.md +109 -0
- package/project/components/InputGroup/preview.html +16 -0
- package/project/components/InputOTP/README.md +72 -0
- package/project/components/InputOTP/preview.html +16 -0
- package/project/components/Item/README.md +124 -0
- package/project/components/Item/preview.html +16 -0
- package/project/components/Kbd/README.md +40 -0
- package/project/components/Kbd/preview.html +16 -0
- package/project/components/Label/README.md +25 -0
- package/project/components/Label/preview.html +16 -0
- package/project/components/Marker/README.md +48 -0
- package/project/components/Marker/preview.html +16 -0
- package/project/components/Menubar/README.md +266 -0
- package/project/components/Menubar/preview.html +16 -0
- package/project/components/Message/README.md +78 -0
- package/project/components/Message/preview.html +16 -0
- package/project/components/MessageScroller/README.md +84 -0
- package/project/components/MessageScroller/preview.html +16 -0
- package/project/components/MultiSelect/README.md +122 -0
- package/project/components/MultiSelect/preview.html +16 -0
- package/project/components/NativeSelect/README.md +56 -0
- package/project/components/NativeSelect/preview.html +16 -0
- package/project/components/NavigationMenu/README.md +153 -0
- package/project/components/NavigationMenu/preview.html +16 -0
- package/project/components/PageHeader/README.md +86 -0
- package/project/components/PageHeader/preview.html +16 -0
- package/project/components/Pagination/README.md +123 -0
- package/project/components/Pagination/preview.html +16 -0
- package/project/components/Popover/README.md +87 -0
- package/project/components/Popover/preview.html +16 -0
- package/project/components/Progress/README.md +27 -0
- package/project/components/Progress/preview.html +16 -0
- package/project/components/RadioGroup/README.md +67 -0
- package/project/components/RadioGroup/preview.html +16 -0
- package/project/components/Resizable/README.md +66 -0
- package/project/components/Resizable/preview.html +16 -0
- package/project/components/ScrollArea/README.md +42 -0
- package/project/components/ScrollArea/preview.html +16 -0
- package/project/components/Select/README.md +161 -0
- package/project/components/Select/preview.html +16 -0
- package/project/components/Separator/README.md +37 -0
- package/project/components/Separator/preview.html +16 -0
- package/project/components/Sheet/README.md +160 -0
- package/project/components/Sheet/preview.html +16 -0
- package/project/components/Show/README.md +26 -0
- package/project/components/Show/preview.html +16 -0
- package/project/components/Sidebar/README.md +290 -0
- package/project/components/Sidebar/preview.html +16 -0
- package/project/components/Skeleton/README.md +30 -0
- package/project/components/Skeleton/preview.html +16 -0
- package/project/components/Slider/README.md +38 -0
- package/project/components/Slider/preview.html +16 -0
- package/project/components/Sonner/README.md +37 -0
- package/project/components/Sonner/preview.html +16 -0
- package/project/components/Spinner/README.md +27 -0
- package/project/components/Spinner/preview.html +16 -0
- package/project/components/Switch/README.md +31 -0
- package/project/components/Switch/preview.html +16 -0
- package/project/components/Table/README.md +120 -0
- package/project/components/Table/preview.html +16 -0
- package/project/components/Tabs/README.md +81 -0
- package/project/components/Tabs/preview.html +16 -0
- package/project/components/Textarea/README.md +32 -0
- package/project/components/Textarea/preview.html +16 -0
- package/project/components/Toggle/README.md +33 -0
- package/project/components/Toggle/preview.html +16 -0
- package/project/components/ToggleGroup/README.md +64 -0
- package/project/components/ToggleGroup/preview.html +16 -0
- package/project/components/Toolbar/README.md +123 -0
- package/project/components/Toolbar/preview.html +16 -0
- package/project/components/Tooltip/README.md +84 -0
- package/project/components/Tooltip/preview.html +16 -0
- package/project/components/bundle.css +8329 -0
- package/project/components/bundle.js +346 -0
- package/project/components/index.d.ts +8349 -0
- package/project/design-system.json +34 -0
- package/project/tokens.css +702 -0
- package/project/tokens.json +2998 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Attachment
|
|
2
|
+
|
|
3
|
+
Attachment shows one file with its preview, name, size and upload state. Use it in upload queues and message composers. For a general list row, use Item.
|
|
4
|
+
|
|
5
|
+
## On the canvas
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<x-import component-from-global-scope="Nxds.Attachment" class-name="nx:w-80">
|
|
9
|
+
<x-import component-from-global-scope="Nxds.AttachmentMedia" variant="icon">
|
|
10
|
+
<x-import component-from-global-scope="Nxds.Icons.IconFileTypePdf"></x-import>
|
|
11
|
+
</x-import>
|
|
12
|
+
<x-import component-from-global-scope="Nxds.AttachmentContent">
|
|
13
|
+
<x-import component-from-global-scope="Nxds.AttachmentTitle">report.pdf</x-import>
|
|
14
|
+
<x-import component-from-global-scope="Nxds.AttachmentDescription">2.4 MB</x-import>
|
|
15
|
+
</x-import>
|
|
16
|
+
<x-import component-from-global-scope="Nxds.AttachmentActions">
|
|
17
|
+
<x-import component-from-global-scope="Nxds.Button" variant="ghost" size="icon-sm" aria-label="Remove report.pdf">
|
|
18
|
+
<x-import component-from-global-scope="Nxds.Icons.IconX"></x-import>
|
|
19
|
+
</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.Attachment` — One file with its preview, name, size, actions and upload state.
|
|
29
|
+
- `Nxds.AttachmentActions` — Trailing controls, such as remove or retry.
|
|
30
|
+
- `Nxds.AttachmentContent` — Middle column for the title, description and progress.
|
|
31
|
+
- `Nxds.AttachmentDescription` — Line under the file name, such as size or an error reason.
|
|
32
|
+
- `Nxds.AttachmentGroup` — Horizontally scrolling strip of attachments.
|
|
33
|
+
- `Nxds.AttachmentMedia` — Thumbnail or file-type icon.
|
|
34
|
+
- `Nxds.AttachmentProgress` — Upload progress bar for `AttachmentContent`.
|
|
35
|
+
- `Nxds.AttachmentTitle` — File name, truncated to one line.
|
|
36
|
+
- `Nxds.AttachmentTrigger` — Makes the whole card open or preview the file.
|
|
37
|
+
|
|
38
|
+
## Props
|
|
39
|
+
|
|
40
|
+
### Attachment
|
|
41
|
+
|
|
42
|
+
| Prop | Type | Default | Control |
|
|
43
|
+
| --- | --- | --- | --- |
|
|
44
|
+
| `state` | `"done" \| "error" \| "idle" \| "uploading" \| "processing"` | `"done"` | dropdown |
|
|
45
|
+
| `statusLabel` | `string` | | text |
|
|
46
|
+
| `children` | `React.ReactNode` | | content |
|
|
47
|
+
| `className` | `string` | | text |
|
|
48
|
+
| `id` | `string` | | text |
|
|
49
|
+
| `size` | `"default" \| "sm"` | `"default"` | dropdown |
|
|
50
|
+
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | dropdown |
|
|
51
|
+
|
|
52
|
+
### AttachmentActions
|
|
53
|
+
|
|
54
|
+
| Prop | Type | Default | Control |
|
|
55
|
+
| --- | --- | --- | --- |
|
|
56
|
+
| `className` | `string` | | text |
|
|
57
|
+
| `id` | `string` | | text |
|
|
58
|
+
| `children` | `React.ReactNode` | | content |
|
|
59
|
+
|
|
60
|
+
### AttachmentContent
|
|
61
|
+
|
|
62
|
+
| Prop | Type | Default | Control |
|
|
63
|
+
| --- | --- | --- | --- |
|
|
64
|
+
| `className` | `string` | | text |
|
|
65
|
+
| `id` | `string` | | text |
|
|
66
|
+
| `children` | `React.ReactNode` | | content |
|
|
67
|
+
|
|
68
|
+
### AttachmentDescription
|
|
69
|
+
|
|
70
|
+
| Prop | Type | Default | Control |
|
|
71
|
+
| --- | --- | --- | --- |
|
|
72
|
+
| `className` | `string` | | text |
|
|
73
|
+
| `id` | `string` | | text |
|
|
74
|
+
| `children` | `React.ReactNode` | | content |
|
|
75
|
+
|
|
76
|
+
### AttachmentGroup
|
|
77
|
+
|
|
78
|
+
| Prop | Type | Default | Control |
|
|
79
|
+
| --- | --- | --- | --- |
|
|
80
|
+
| `children` | `React.ReactNode` | | content |
|
|
81
|
+
| `className` | `string` | | text |
|
|
82
|
+
| `id` | `string` | | text |
|
|
83
|
+
| `aria-label` | `string` | | text |
|
|
84
|
+
| `aria-labelledby` | `string` | | text |
|
|
85
|
+
|
|
86
|
+
### AttachmentMedia
|
|
87
|
+
|
|
88
|
+
| Prop | Type | Default | Control |
|
|
89
|
+
| --- | --- | --- | --- |
|
|
90
|
+
| `className` | `string` | | text |
|
|
91
|
+
| `id` | `string` | | text |
|
|
92
|
+
| `children` | `React.ReactNode` | | content |
|
|
93
|
+
| `variant` | `"image" \| "default" \| "icon"` | `"default"` | dropdown |
|
|
94
|
+
|
|
95
|
+
### AttachmentProgress
|
|
96
|
+
|
|
97
|
+
| Prop | Type | Default | Control |
|
|
98
|
+
| --- | --- | --- | --- |
|
|
99
|
+
| `value` | `number` | | number |
|
|
100
|
+
| `max` | `number` | | number |
|
|
101
|
+
| `getValueLabel` | `(value: number, max: number) => string` | | none (function) |
|
|
102
|
+
| `children` | `React.ReactNode` | | content |
|
|
103
|
+
| `className` | `string` | | text |
|
|
104
|
+
| `id` | `string` | | text |
|
|
105
|
+
| `asChild` | `boolean` | | toggle |
|
|
106
|
+
|
|
107
|
+
### AttachmentTitle
|
|
108
|
+
|
|
109
|
+
| Prop | Type | Default | Control |
|
|
110
|
+
| --- | --- | --- | --- |
|
|
111
|
+
| `trailing` | `React.ReactNode` | | none (element) |
|
|
112
|
+
| `className` | `string` | | text |
|
|
113
|
+
| `id` | `string` | | text |
|
|
114
|
+
| `children` | `React.ReactNode` | | content |
|
|
115
|
+
|
|
116
|
+
### AttachmentTrigger
|
|
117
|
+
|
|
118
|
+
| Prop | Type | Default | Control |
|
|
119
|
+
| --- | --- | --- | --- |
|
|
120
|
+
| `asChild` | `boolean` | `false` | toggle |
|
|
121
|
+
| `disabled` | `boolean` | | toggle |
|
|
122
|
+
| `name` | `string` | | text |
|
|
123
|
+
| `type` | `"button" \| "submit" \| "reset"` | | dropdown |
|
|
124
|
+
| `value` | `string \| number \| readonly string[]` | | none (object) |
|
|
125
|
+
| `className` | `string` | | text |
|
|
126
|
+
| `id` | `string` | | text |
|
|
127
|
+
| `children` | `React.ReactNode` | | content |
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<!-- @dsCard group="Messaging" height=120 -->
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>Attachment</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 u=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var i=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(o){throw t=0,o}};var N=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of I(t))!v.call(e,c)&&c!==o&&u(e,c,{get:()=>t[c],enumerable:!(a=B(t,c))||a.enumerable});return e};var m=(e,t,o)=>(o=e!=null?g(M(e)):{},N(t||!e||!e.__esModule?u(o,"default",{value:e,enumerable:!0}):o,e));var y=i((C,A)=>{A.exports=window.Nxds.Icons});var d=i((F,x)=>{x.exports=window.Nxds});var f=i((b,w)=>{w.exports=window.React});var T=i((S,P)=>{P.exports={createRoot:window.ReactDOM.createRoot}});var s=m(y()),n=m(d()),R=m(d());var p=m(f());function E(e,t){return t===void 0?e:{...e,key:t}}function r(e,t,o){return(0,p.createElement)(e,E(t,o))}function l(e,t,o){let{children:a,...c}=t;return(0,p.createElement)(e,E(c,o),...a)}function h(){return l(n.Attachment,{className:"nx:w-80",children:[r(n.AttachmentMedia,{variant:"icon",children:r(s.IconFileTypePdf,{})}),l(n.AttachmentContent,{children:[r(n.AttachmentTitle,{children:"report.pdf"}),r(n.AttachmentDescription,{children:"2.4 MB"})]}),r(n.AttachmentActions,{children:r(R.Button,{variant:"ghost",size:"icon-sm","aria-label":"Remove report.pdf",children:r(s.IconX,{})})})]})}var D=m(f()),K=m(T());(0,K.createRoot)(document.getElementById("root")).render((0,D.createElement)(h));})();</script>
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Avatar
|
|
2
|
+
|
|
3
|
+
Avatar shows a person's profile image, with initials as the fallback. Use AvatarGroup to stack several people and AvatarStatus to show presence.
|
|
4
|
+
|
|
5
|
+
## On the canvas
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<x-import component-from-global-scope="Nxds.Avatar" size="md" shape="circle" ring="false">
|
|
9
|
+
<x-import component-from-global-scope="Nxds.AvatarImage" src="/avatars/ada.svg" alt="Ada Lovelace"></x-import>
|
|
10
|
+
<x-import component-from-global-scope="Nxds.AvatarFallback">AL</x-import>
|
|
11
|
+
</x-import>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
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.
|
|
15
|
+
|
|
16
|
+
## Parts
|
|
17
|
+
|
|
18
|
+
- `Nxds.Avatar` — Shows a person's profile image, with initials or an icon as the fallback.
|
|
19
|
+
- `Nxds.AvatarFallback` — Shows while the image loads or if it fails, usually initials or an icon.
|
|
20
|
+
- `Nxds.AvatarGroup`
|
|
21
|
+
- `Nxds.AvatarImage` — Profile image.
|
|
22
|
+
- `Nxds.AvatarStatus` — Presence dot in the avatar's corner, with a hidden label such as "Online" for screen readers.
|
|
23
|
+
|
|
24
|
+
## Props
|
|
25
|
+
|
|
26
|
+
### Avatar
|
|
27
|
+
|
|
28
|
+
| Prop | Type | Default | Control |
|
|
29
|
+
| --- | --- | --- | --- |
|
|
30
|
+
| `ring` | `boolean` | `false` | toggle |
|
|
31
|
+
| `children` | `React.ReactNode` | | content |
|
|
32
|
+
| `className` | `string` | | text |
|
|
33
|
+
| `id` | `string` | | text |
|
|
34
|
+
| `asChild` | `boolean` | | toggle |
|
|
35
|
+
| `size` | `"sm" \| "lg" \| "2xs" \| "xs" \| "md" \| "xl" \| "2xl" \| "3xl" \| "4xl"` | `"md"` | dropdown |
|
|
36
|
+
| `shape` | `"circle" \| "rounded"` | `"circle"` | dropdown |
|
|
37
|
+
|
|
38
|
+
### AvatarFallback
|
|
39
|
+
|
|
40
|
+
| Prop | Type | Default | Control |
|
|
41
|
+
| --- | --- | --- | --- |
|
|
42
|
+
| `delayMs` | `number` | | number |
|
|
43
|
+
| `children` | `React.ReactNode` | | content |
|
|
44
|
+
| `className` | `string` | | text |
|
|
45
|
+
| `id` | `string` | | text |
|
|
46
|
+
| `asChild` | `boolean` | | toggle |
|
|
47
|
+
|
|
48
|
+
### AvatarGroup
|
|
49
|
+
|
|
50
|
+
| Prop | Type | Default | Control |
|
|
51
|
+
| --- | --- | --- | --- |
|
|
52
|
+
| `max` | `number` | | number |
|
|
53
|
+
| `className` | `string` | | text |
|
|
54
|
+
| `id` | `string` | | text |
|
|
55
|
+
| `children` | `React.ReactNode` | | content |
|
|
56
|
+
| `size` | `"sm" \| "lg" \| "2xs" \| "xs" \| "md" \| "xl" \| "2xl" \| "3xl" \| "4xl"` | `"md"` | dropdown |
|
|
57
|
+
| `shape` | `"circle" \| "rounded"` | `"circle"` | dropdown |
|
|
58
|
+
|
|
59
|
+
### AvatarImage
|
|
60
|
+
|
|
61
|
+
| Prop | Type | Default | Control |
|
|
62
|
+
| --- | --- | --- | --- |
|
|
63
|
+
| `onLoadingStatusChange` | `(status: ImageLoadingStatus) => void` | | none (function) |
|
|
64
|
+
| `children` | `React.ReactNode` | | content |
|
|
65
|
+
| `className` | `string` | | text |
|
|
66
|
+
| `id` | `string` | | text |
|
|
67
|
+
| `asChild` | `boolean` | | toggle |
|
|
68
|
+
|
|
69
|
+
### AvatarStatus
|
|
70
|
+
|
|
71
|
+
| Prop | Type | Default | Control |
|
|
72
|
+
| --- | --- | --- | --- |
|
|
73
|
+
| `label` | `string` | | text |
|
|
74
|
+
| `className` | `string` | | text |
|
|
75
|
+
| `id` | `string` | | text |
|
|
76
|
+
| `status` | `"online" \| "away" \| "busy" \| "offline"` | `"online"` | dropdown |
|
|
@@ -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>Avatar</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 Z=Object.create;var C=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var n=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty;var u=(L,M)=>()=>{try{return M||L((M={exports:{}}).exports,M),M.exports}catch(j){throw M=0,j}};var b=(L,M,j,I)=>{if(M&&typeof M=="object"||typeof M=="function")for(let N of E(M))!o.call(L,N)&&N!==j&&C(L,N,{get:()=>M[N],enumerable:!(I=d(M,N))||I.enumerable});return L};var y=(L,M,j)=>(j=L!=null?Z(n(L)):{},b(M||!L||!L.__esModule?C(j,"default",{value:L,enumerable:!0}):j,L));var A=u((p,S)=>{S.exports=window.Nxds});var i=u((O,z)=>{z.exports=window.React});var x=u((v,m)=>{m.exports={createRoot:window.ReactDOM.createRoot}});var g=y(A());var t=y(i());function e(L,M){return M===void 0?L:{...L,key:M}}function c(L,M,j){return(0,t.createElement)(L,e(M,j))}function D(L,M,j){let{children:I,...N}=M;return(0,t.createElement)(L,e(N,j),...I)}function T(){return D(g.Avatar,{size:"md",shape:"circle",ring:!1,children:[c(g.AvatarImage,{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1NjAgNTYwIiBmaWxsPSJub25lIiBzaGFwZS1yZW5kZXJpbmc9ImF1dG8iPjxtZXRhZGF0YSB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6ZGN0ZXJtcz0iaHR0cDovL3B1cmwub3JnL2RjL3Rlcm1zLyI+PHJkZjpSREY+PHJkZjpEZXNjcmlwdGlvbj48ZGM6dGl0bGU+Tm90aW9uaXN0czwvZGM6dGl0bGU+PGRjOmNyZWF0b3I+Wm9pc2g8L2RjOmNyZWF0b3I+PGRjOnNvdXJjZSB4c2k6dHlwZT0iZGN0ZXJtczpVUkkiPmh0dHBzOi8vaGV5em9pc2guZ3Vtcm9hZC5jb20vbC9ub3Rpb25pc3RzPC9kYzpzb3VyY2U+PGRjdGVybXM6bGljZW5zZSB4c2k6dHlwZT0iZGN0ZXJtczpVUkkiPmh0dHBzOi8vY3JlYXRpdmVjb21tb25zLm9yZy9wdWJsaWNkb21haW4vemVyby8xLjAvPC9kY3Rlcm1zOmxpY2Vuc2U+PGRjOnJpZ2h0cz5SZW1peCBvZiDigJ5Ob3Rpb25pc3Rz4oCdIChodHRwczovL2hleXpvaXNoLmd1bXJvYWQuY29tL2wvbm90aW9uaXN0cykgYnkg4oCeWm9pc2jigJ0sIGxpY2Vuc2VkIHVuZGVyIOKAnkNDMCAxLjDigJ0gKGh0dHBzOi8vY3JlYXRpdmVjb21tb25zLm9yZy9wdWJsaWNkb21haW4vemVyby8xLjAvKTwvZGM6cmlnaHRzPjwvcmRmOkRlc2NyaXB0aW9uPjwvcmRmOlJERj48L21ldGFkYXRhPjxtYXNrIGlkPSJ2aWV3Ym94TWFzayI+PHJlY3Qgd2lkdGg9IjU2MCIgaGVpZ2h0PSI1NjAiIHJ4PSIwIiByeT0iMCIgeD0iMCIgeT0iMCIgZmlsbD0iI2ZmZiIgLz48L21hc2s+PGcgbWFzaz0idXJsKCN2aWV3Ym94TWFzaykiPjxyZWN0IGZpbGw9IiNmZmM1Y2QiIHdpZHRoPSI1NjAiIGhlaWdodD0iNTYwIiB4PSIwIiB5PSIwIiAvPjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEzNiAzMjgpIj48cGF0aCBkPSJNODAuNyA2NS40Yy0xLjEtNC42LTIuOC04LjggMi0xMC44Qzg2LjcgNTMgOTAgNTUgOTMgNThhNzYgNzYgMCAwIDAgMzQuNCAyMWMyNyA2LjcgNTEtLjUgNzEuMi0xOS45IDMuNC0zLjIgNi43LTYuNSAxMC4yLTkuNSAyLjQtMiA1LjEtMy4yIDgtLjcgMyAyLjcgMS41IDUuNC0uMSA4LTEzLjYgMjEuNC0zMS43IDM1LjgtNTguMSAzNy04IC4zLTE2LjEgMS0yNC4xLjgtMjIuNC0uNi0zOC0xNC4zLTUzLjgtMjkuM1pNNDkuMyA1NC41Yy40LTE1LjUgOC0yNS40IDE5LjctMzMgNC43LTMgOS40LTQgMTQuNS0yLjcgMy4zIDEgNi41IDIuNyA3IDYuNi43IDQuMy0yLjQgNS42LTYgNi44YTMwLjUgMzAuNSAwIDAgMC0yMS40IDIyLjljLTEgNC4zLTIgOS03IDkuNC01LjkuNi01LjItNS40LTYuOC0xMFpNMjMwLjQgMzVjMC04LjggNS40LTcuNCA5LjctNiA3LjIgMi4zIDE2IDE4LjYgMTQuNyAyNi41LS40IDIuNS0uNCA1LjMtMy4zIDYuNC0zLjQgMS4zLTUuOC0uNC03LjUtMy4xYTcxMCA3MTAgMCAwIDEtMTMuNi0yMy45WiIgZmlsbD0iIzAwMCIvPjwvZz48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyNDYgMTI1KSI+PHBhdGggZD0iTTQxLjIgMTk3LjZjLTUuNC00LjgtMTAuMi05LjQtNS41LTE1LjggNS02LjcgOS44LjEgMTQuNyAxLjQgMy4yLjkgNS42IDQuNCA5LjMgMy4zIDYuNS0xLjggMTQtMi41IDE1LTExLjQuOC04LjUtNi0xMC41LTExLjctMTMuMS00LjQtMi0xMyAxLTExLjMtOCAxLjUtOC4zIDkuMS03LjcgMTUuNi03LjFhMjUgMjUgMCAwIDEgMjQgMjVjLjUgMTYuMi04LjQgMjguNS0yMy4zIDMwLTguNyAxLTE4IDItMjYuOC00LjNaIiBmaWxsPSIjMDAwIi8+PC9nPjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKC00NSAxMzcpIj48cGF0aCBkPSJNNDE5LjYgMTExYy00LjItOS41LTkuOS0xNS4yLTE5LjgtMTUuNy02LS4zLTctNS4xLTguOS05LjggMi0xLjUgMy41LTMuNyA1LjMtMy44IDIxLjEtMS43IDQyLjQtMS44IDYzLjUtLjEgNiAuNCA5LjMgOCAzLjIgMTAuNC0xMCA0LTEyLjUgMTMuMi0xOC41IDE5LjgtOC4yIDktMTUuMiA5LjEtMjQuOC0uOFpNMjI4LjYgODEuNGMxMi4yLjcgMjMuMSAxIDM0IDIgMy42LjMgOCAxLjggOCA2LjcgMCA1LjYtNC42IDUuMi04LjMgNS4xLTYuMyAwLTkuNyAyLjctMTIuNSA4LjYtMy40IDcuNC02LjkgMTUuMy0xOCAxNC44LTEwLjUtLjUtMTUuMS03LjItMTguMS0xNS4yLTIuMi01LjctNS04LjQtMTEtOC4yLTMuNC4xLTcuMS0uMi03LjUtNC45LS40LTUgMy02IDctNy4yYTY3LjkgNjcuOSAwIDAgMSAyNi40LTEuN1oiIGZpbGw9IiMwMDAiLz48L2c+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTQ1IDEzNykiPjwvZz48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMTkgMTE0KSI+PHBhdGggZD0iTTU3LjUgNDEuOEM1MS4zIDQxLjMgNDYgNDEgNDEgNDFjLTUuNy0uMi04LjUtMy40LTktOC44LS41LTUuMyAzLTcgNy41LTguNSA4LjYtMyAxNy4xLS41IDI1LjIuNyAxNS40IDIuMSAzMS41LS42IDQ2LjQgNi4zIDUgMi4zIDguMyA0LjcgNi40IDEwLjMtMS44IDUuMi02LjEgNS4yLTEwLjYgNC4xLTE2LTMuNy0zMi40LjktNDkuNC0zLjNaTTI1MS44IDMyYzE3LjIuOSAzMy4xLTUgNDkuMy0xLjIgNCAxIDkgLjcgOC44IDcgMCA2LjItNC43IDcuNC05LjUgOC0xOSAyLjItMzggNC01Ni45IDYuNC01LjcuNy0xMSAuMS0xMi42LTUuNi0xLjctNS43IDQtNy44IDgtMTAgMy41LTIuMSA3LjgtMy4xIDEyLjktNC43WiIgZmlsbD0iIzAwMCIvPjwvZz48L2c+PC9zdmc+",alt:"Ada Lovelace"}),c(g.AvatarFallback,{children:"AL"})]})}var a=y(i()),Y=y(x());(0,Y.createRoot)(document.getElementById("root")).render((0,a.createElement)(T));})();</script>
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Badge
|
|
2
|
+
|
|
3
|
+
Badge labels an item with a short status, category or count. It is not interactive. Pair a status color with text or an icon, because color alone doesn't carry meaning.
|
|
4
|
+
|
|
5
|
+
## On the canvas
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<x-import component-from-global-scope="Nxds.Badge">Badge</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
|
+
### Badge
|
|
16
|
+
|
|
17
|
+
| Prop | Type | Default | Control |
|
|
18
|
+
| --- | --- | --- | --- |
|
|
19
|
+
| `isCaps` | `boolean` | `true` | toggle |
|
|
20
|
+
| `isNumber` | `boolean` | `false` | toggle |
|
|
21
|
+
| `leftIcon` | `React.ReactNode` | | none (element) |
|
|
22
|
+
| `rightIcon` | `React.ReactNode` | | none (element) |
|
|
23
|
+
| `className` | `string` | | text |
|
|
24
|
+
| `id` | `string` | | text |
|
|
25
|
+
| `children` | `React.ReactNode` | | content |
|
|
26
|
+
| `fill` | `"outline" \| "solid" \| "light"` | `"solid"` | dropdown |
|
|
27
|
+
| `variant` | `"default" \| "success" \| "information" \| "warning" \| "error" \| "secondary"` | `"default"` | dropdown |
|
|
@@ -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>Badge</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 R=Object.create;var c=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var p=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}};var D=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of K(e))!h.call(t,o)&&o!==r&&c(t,o,{get:()=>e[o],enumerable:!(i=B(e,o))||i.enumerable});return t};var n=(t,e,r)=>(r=t!=null?R(P(t)):{},D(e||!t||!t.__esModule?c(r,"default",{value:t,enumerable:!0}):r,t));var u=p((k,s)=>{s.exports=window.Nxds});var d=p((F,f)=>{f.exports=window.React});var w=p((O,x)=>{x.exports={createRoot:window.ReactDOM.createRoot}});var l=n(u());var m=n(d());function T(t,e){return e===void 0?t:{...t,key:e}}function y(t,e,r){return(0,m.createElement)(t,T(e,r))}function a(){return y(l.Badge,{children:"Badge"})}var E=n(d()),g=n(w());(0,g.createRoot)(document.getElementById("root")).render((0,E.createElement)(a));})();</script>
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Breadcrumb
|
|
2
|
+
|
|
3
|
+
Breadcrumb shows where the current page sits in your app's hierarchy. Use it on pages two or more levels deep. For top-level navigation, use NavigationMenu or Sidebar.
|
|
4
|
+
|
|
5
|
+
## On the canvas
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<x-import component-from-global-scope="Nxds.Breadcrumb">
|
|
9
|
+
<x-import component-from-global-scope="Nxds.BreadcrumbList">
|
|
10
|
+
<x-import component-from-global-scope="Nxds.BreadcrumbItem">
|
|
11
|
+
<x-import component-from-global-scope="Nxds.BreadcrumbLink" href="#">Home</x-import>
|
|
12
|
+
</x-import>
|
|
13
|
+
<x-import component-from-global-scope="Nxds.BreadcrumbSeparator"></x-import>
|
|
14
|
+
<x-import component-from-global-scope="Nxds.BreadcrumbItem">
|
|
15
|
+
<x-import component-from-global-scope="Nxds.BreadcrumbLink" href="#">Components</x-import>
|
|
16
|
+
</x-import>
|
|
17
|
+
<x-import component-from-global-scope="Nxds.BreadcrumbSeparator"></x-import>
|
|
18
|
+
<x-import component-from-global-scope="Nxds.BreadcrumbItem">
|
|
19
|
+
<x-import component-from-global-scope="Nxds.BreadcrumbPage">Breadcrumb</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.Breadcrumb` — Navigation trail in a `nav` landmark, showing where the current page sits.
|
|
30
|
+
- `Nxds.BreadcrumbEllipsis` — Button that stands in for collapsed middle items.
|
|
31
|
+
- `Nxds.BreadcrumbItem` — One `<li>` in the trail.
|
|
32
|
+
- `Nxds.BreadcrumbLink` — Link to an ancestor page.
|
|
33
|
+
- `Nxds.BreadcrumbList` — Ordered list that lays out the trail in one row.
|
|
34
|
+
- `Nxds.BreadcrumbMenuTrigger` — Icon button that shows alternate paths for the segment beside it.
|
|
35
|
+
- `Nxds.BreadcrumbPage` — Current page, marked with `aria-current="page"`.
|
|
36
|
+
- `Nxds.BreadcrumbSeparator` — Divider between items, a slash by default.
|
|
37
|
+
|
|
38
|
+
## Props
|
|
39
|
+
|
|
40
|
+
### Breadcrumb
|
|
41
|
+
|
|
42
|
+
| Prop | Type | Default | Control |
|
|
43
|
+
| --- | --- | --- | --- |
|
|
44
|
+
| `className` | `string` | | text |
|
|
45
|
+
| `id` | `string` | | text |
|
|
46
|
+
| `children` | `React.ReactNode` | | content |
|
|
47
|
+
|
|
48
|
+
### BreadcrumbEllipsis
|
|
49
|
+
|
|
50
|
+
| Prop | Type | Default | Control |
|
|
51
|
+
| --- | --- | --- | --- |
|
|
52
|
+
| `disabled` | `boolean` | | toggle |
|
|
53
|
+
| `name` | `string` | | text |
|
|
54
|
+
| `type` | `"button" \| "submit" \| "reset"` | `"button"` | dropdown |
|
|
55
|
+
| `value` | `string \| number \| readonly string[]` | | none (object) |
|
|
56
|
+
| `className` | `string` | | text |
|
|
57
|
+
| `id` | `string` | | text |
|
|
58
|
+
| `children` | `React.ReactNode` | | content |
|
|
59
|
+
|
|
60
|
+
### BreadcrumbItem
|
|
61
|
+
|
|
62
|
+
| Prop | Type | Default | Control |
|
|
63
|
+
| --- | --- | --- | --- |
|
|
64
|
+
| `value` | `string \| number \| readonly string[]` | | none (object) |
|
|
65
|
+
| `className` | `string` | | text |
|
|
66
|
+
| `id` | `string` | | text |
|
|
67
|
+
| `children` | `React.ReactNode` | | content |
|
|
68
|
+
|
|
69
|
+
### BreadcrumbLink
|
|
70
|
+
|
|
71
|
+
| Prop | Type | Default | Control |
|
|
72
|
+
| --- | --- | --- | --- |
|
|
73
|
+
| `asChild` | `boolean` | | toggle |
|
|
74
|
+
| `href` | `string` | | text |
|
|
75
|
+
| `target` | `HTMLAttributeAnchorTarget` | | none (object) |
|
|
76
|
+
| `type` | `string` | | text |
|
|
77
|
+
| `className` | `string` | | text |
|
|
78
|
+
| `id` | `string` | | text |
|
|
79
|
+
| `children` | `React.ReactNode` | | content |
|
|
80
|
+
|
|
81
|
+
### BreadcrumbList
|
|
82
|
+
|
|
83
|
+
| Prop | Type | Default | Control |
|
|
84
|
+
| --- | --- | --- | --- |
|
|
85
|
+
| `type` | `"a" \| "i" \| "1" \| "A" \| "I"` | | dropdown |
|
|
86
|
+
| `className` | `string` | | text |
|
|
87
|
+
| `id` | `string` | | text |
|
|
88
|
+
| `children` | `React.ReactNode` | | content |
|
|
89
|
+
|
|
90
|
+
### BreadcrumbMenuTrigger
|
|
91
|
+
|
|
92
|
+
| Prop | Type | Default | Control |
|
|
93
|
+
| --- | --- | --- | --- |
|
|
94
|
+
| `disabled` | `boolean` | | toggle |
|
|
95
|
+
| `name` | `string` | | text |
|
|
96
|
+
| `type` | `"button" \| "submit" \| "reset"` | `"button"` | dropdown |
|
|
97
|
+
| `value` | `string \| number \| readonly string[]` | | none (object) |
|
|
98
|
+
| `className` | `string` | | text |
|
|
99
|
+
| `id` | `string` | | text |
|
|
100
|
+
| `children` | `React.ReactNode` | | content |
|
|
101
|
+
|
|
102
|
+
### BreadcrumbPage
|
|
103
|
+
|
|
104
|
+
| Prop | Type | Default | Control |
|
|
105
|
+
| --- | --- | --- | --- |
|
|
106
|
+
| `className` | `string` | | text |
|
|
107
|
+
| `id` | `string` | | text |
|
|
108
|
+
| `children` | `React.ReactNode` | | content |
|
|
109
|
+
|
|
110
|
+
### BreadcrumbSeparator
|
|
111
|
+
|
|
112
|
+
| Prop | Type | Default | Control |
|
|
113
|
+
| --- | --- | --- | --- |
|
|
114
|
+
| `value` | `string \| number \| readonly string[]` | | none (object) |
|
|
115
|
+
| `className` | `string` | | text |
|
|
116
|
+
| `id` | `string` | | text |
|
|
117
|
+
| `children` | `React.ReactNode` | | content |
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<!-- @dsCard group="Navigation" height=120 -->
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>Breadcrumb</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 R=Object.create;var s=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,K=Object.prototype.hasOwnProperty;var u=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(o){throw e=0,o}};var L=(r,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of h(e))!K.call(r,m)&&m!==o&&s(r,m,{get:()=>e[m],enumerable:!(a=g(e,m))||a.enumerable});return r};var c=(r,e,o)=>(o=r!=null?R(I(r)):{},L(e||!r||!r.__esModule?s(o,"default",{value:r,enumerable:!0}):o,r));var b=u((D,B)=>{B.exports=window.Nxds});var i=u((T,f)=>{f.exports=window.React});var w=u((F,x)=>{x.exports={createRoot:window.ReactDOM.createRoot}});var t=c(b());var d=c(i());function y(r,e){return e===void 0?r:{...r,key:e}}function n(r,e,o){return(0,d.createElement)(r,y(e,o))}function l(r,e,o){let{children:a,...m}=e;return(0,d.createElement)(r,y(m,o),...a)}function p(){return n(t.Breadcrumb,{children:l(t.BreadcrumbList,{children:[n(t.BreadcrumbItem,{children:n(t.BreadcrumbLink,{href:"#",children:"Home"})}),n(t.BreadcrumbSeparator,{}),n(t.BreadcrumbItem,{children:n(t.BreadcrumbLink,{href:"#",children:"Components"})}),n(t.BreadcrumbSeparator,{}),n(t.BreadcrumbItem,{children:n(t.BreadcrumbPage,{children:"Breadcrumb"})})]})})}var E=c(i()),P=c(w());(0,P.createRoot)(document.getElementById("root")).render((0,E.createElement)(p));})();</script>
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Bubble
|
|
2
|
+
|
|
3
|
+
Bubble shows one message in a conversation. Use it as the body of a chat or assistant turn. For the avatar, header and footer around it, use Message.
|
|
4
|
+
|
|
5
|
+
## On the canvas
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<x-import component-from-global-scope="Nxds.Bubble" align="end" variant="destructive">Bubble</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
|
+
## Parts
|
|
14
|
+
|
|
15
|
+
- `Nxds.Bubble` — One message in a conversation.
|
|
16
|
+
- `Nxds.BubbleContent` — Message body.
|
|
17
|
+
- `Nxds.BubbleGroup` — Vertical stack of consecutive bubbles.
|
|
18
|
+
- `Nxds.BubbleReactions` — Reaction pill overhanging a corner of the bubble.
|
|
19
|
+
|
|
20
|
+
## Props
|
|
21
|
+
|
|
22
|
+
### Bubble
|
|
23
|
+
|
|
24
|
+
| Prop | Type | Default | Control |
|
|
25
|
+
| --- | --- | --- | --- |
|
|
26
|
+
| `className` | `string` | | text |
|
|
27
|
+
| `id` | `string` | | text |
|
|
28
|
+
| `children` | `React.ReactNode` | | content |
|
|
29
|
+
| `align` | `"end" \| "start"` | | dropdown |
|
|
30
|
+
| `variant` | `"destructive" \| "outline" \| "ghost" \| "muted" \| "primary"` | `"muted"` | dropdown |
|
|
31
|
+
|
|
32
|
+
### BubbleContent
|
|
33
|
+
|
|
34
|
+
| Prop | Type | Default | Control |
|
|
35
|
+
| --- | --- | --- | --- |
|
|
36
|
+
| `asChild` | `boolean` | `false` | toggle |
|
|
37
|
+
| `className` | `string` | | text |
|
|
38
|
+
| `id` | `string` | | text |
|
|
39
|
+
| `children` | `React.ReactNode` | | content |
|
|
40
|
+
|
|
41
|
+
### BubbleGroup
|
|
42
|
+
|
|
43
|
+
| Prop | Type | Default | Control |
|
|
44
|
+
| --- | --- | --- | --- |
|
|
45
|
+
| `className` | `string` | | text |
|
|
46
|
+
| `id` | `string` | | text |
|
|
47
|
+
| `children` | `React.ReactNode` | | content |
|
|
48
|
+
|
|
49
|
+
### BubbleReactions
|
|
50
|
+
|
|
51
|
+
| Prop | Type | Default | Control |
|
|
52
|
+
| --- | --- | --- | --- |
|
|
53
|
+
| `className` | `string` | | text |
|
|
54
|
+
| `id` | `string` | | text |
|
|
55
|
+
| `children` | `React.ReactNode` | | content |
|
|
56
|
+
| `align` | `"end" \| "start"` | `"end"` | dropdown |
|
|
57
|
+
| `side` | `"top" \| "bottom"` | `"bottom"` | dropdown |
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<!-- @dsCard group="Messaging" height=120 -->
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>Bubble</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 d=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var m=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}};var T=(t,e,n,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of K(e))!C.call(t,o)&&o!==n&&d(t,o,{get:()=>e[o],enumerable:!(u=R(e,o))||u.enumerable});return t};var i=(t,e,n)=>(n=t!=null?h(P(t)):{},T(e||!t||!t.__esModule?d(n,"default",{value:t,enumerable:!0}):n,t));var b=m((G,c)=>{c.exports=window.Nxds});var p=m((N,f)=>{f.exports=window.React});var g=m((A,w)=>{w.exports={createRoot:window.ReactDOM.createRoot}});var r=i(b());var a=i(p());function y(t,e){return e===void 0?t:{...t,key:e}}function l(t,e,n){return(0,a.createElement)(t,y(e,n))}function x(t,e,n){let{children:u,...o}=e;return(0,a.createElement)(t,y(o,n),...u)}var j="nx:w-full nx:max-w-md";function s(){return x(r.BubbleGroup,{className:j,children:[l(r.Bubble,{align:"start",children:l(r.BubbleContent,{children:"Start-aligned turns hug the inline start."})}),l(r.Bubble,{align:"end",variant:"primary",children:l(r.BubbleContent,{children:"End-aligned turns hug the inline end."})})]})}var B=i(p()),E=i(g());(0,E.createRoot)(document.getElementById("root")).render((0,B.createElement)(s));})();</script>
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Button
|
|
2
|
+
|
|
3
|
+
Button triggers an action. Use it for short, visible labels.
|
|
4
|
+
|
|
5
|
+
- Use one decorative icon slot at most: `startIcon` or `endIcon`.
|
|
6
|
+
- A loading button shows only a spinner and hides its icons.
|
|
7
|
+
- Icon-only buttons need `aria-label` or `aria-labelledby`.
|
|
8
|
+
|
|
9
|
+
## On the canvas
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<x-import component-from-global-scope="Nxds.Button">Button</x-import>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
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.
|
|
16
|
+
|
|
17
|
+
## Props
|
|
18
|
+
|
|
19
|
+
### Button
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Default | Control |
|
|
22
|
+
| --- | --- | --- | --- |
|
|
23
|
+
| `asChild` | `boolean` | `false` | toggle |
|
|
24
|
+
| `loading` | `boolean` | `false` | toggle |
|
|
25
|
+
| `startIcon` | `React.ReactNode` | | none (element) |
|
|
26
|
+
| `endIcon` | `React.ReactNode` | | none (element) |
|
|
27
|
+
| `disabled` | `boolean` | | toggle |
|
|
28
|
+
| `name` | `string` | | text |
|
|
29
|
+
| `type` | `"button" \| "submit" \| "reset"` | `"button"` | dropdown |
|
|
30
|
+
| `value` | `string \| number \| readonly string[]` | | none (object) |
|
|
31
|
+
| `className` | `string` | | text |
|
|
32
|
+
| `id` | `string` | | text |
|
|
33
|
+
| `children` | `React.ReactNode` | | content |
|
|
34
|
+
| `variant` | `"link" \| "default" \| "destructive" \| "error" \| "outline" \| "dashed" \| "secondary" \| "ghost"` | `"default"` | dropdown |
|
|
35
|
+
| `size` | `"default" \| "sm" \| "lg" \| "icon-sm" \| "icon" \| "icon-lg"` | `"default"` | dropdown |
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<!-- @dsCard group="Actions" height=120 -->
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>Button</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 B=Object.create;var s=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var p=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(o){throw e=0,o}};var D=(t,e,o,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of P(e))!h.call(t,r)&&r!==o&&s(t,r,{get:()=>e[r],enumerable:!(c=K(e,r))||c.enumerable});return t};var n=(t,e,o)=>(o=t!=null?B(g(t)):{},D(e||!t||!t.__esModule?s(o,"default",{value:t,enumerable:!0}):o,t));var a=p((k,d)=>{d.exports=window.Nxds});var m=p((F,f)=>{f.exports=window.React});var w=p((O,x)=>{x.exports={createRoot:window.ReactDOM.createRoot}});var l=n(a());var u=n(m());function T(t,e){return e===void 0?t:{...t,key:e}}function y(t,e,o){return(0,u.createElement)(t,T(e,o))}function i(){return y(l.Button,{children:"Button"})}var E=n(m()),R=n(w());(0,R.createRoot)(document.getElementById("root")).render((0,E.createElement)(i));})();</script>
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# ButtonGroup
|
|
2
|
+
|
|
3
|
+
ButtonGroup joins related buttons into one cluster with shared borders. Use it for a set of related actions or a split button. For an input with addons, use InputGroup.
|
|
4
|
+
|
|
5
|
+
## On the canvas
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<x-import component-from-global-scope="Nxds.ButtonGroup">
|
|
9
|
+
<x-import component-from-global-scope="Nxds.Button" variant="outline">Day</x-import>
|
|
10
|
+
<x-import component-from-global-scope="Nxds.Button" variant="outline">Week</x-import>
|
|
11
|
+
<x-import component-from-global-scope="Nxds.Button" variant="outline">Month</x-import>
|
|
12
|
+
</x-import>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
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.
|
|
16
|
+
|
|
17
|
+
## Parts
|
|
18
|
+
|
|
19
|
+
- `Nxds.ButtonGroup` — Joins Buttons, menu or select triggers, `ButtonGroupText` and `ButtonGroupSeparator` into one cluster with shared borders.
|
|
20
|
+
- `Nxds.ButtonGroupSeparator` — Divider between sub-groups that spans the whole group.
|
|
21
|
+
- `Nxds.ButtonGroupText` — Label or addon in a group, such as a prefix, unit or count.
|
|
22
|
+
|
|
23
|
+
## Props
|
|
24
|
+
|
|
25
|
+
### ButtonGroup
|
|
26
|
+
|
|
27
|
+
| Prop | Type | Default | Control |
|
|
28
|
+
| --- | --- | --- | --- |
|
|
29
|
+
| `size` | `"default" \| "sm" \| "lg"` | `"default"` | dropdown |
|
|
30
|
+
| `className` | `string` | | text |
|
|
31
|
+
| `id` | `string` | | text |
|
|
32
|
+
| `children` | `React.ReactNode` | | content |
|
|
33
|
+
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | dropdown |
|
|
34
|
+
|
|
35
|
+
### ButtonGroupSeparator
|
|
36
|
+
|
|
37
|
+
| Prop | Type | Default | Control |
|
|
38
|
+
| --- | --- | --- | --- |
|
|
39
|
+
| `orientation` | `"horizontal" \| "vertical"` | `"vertical"` | dropdown |
|
|
40
|
+
| `decorative` | `boolean` | `true` | toggle |
|
|
41
|
+
| `children` | `React.ReactNode` | | content |
|
|
42
|
+
| `className` | `string` | | text |
|
|
43
|
+
| `id` | `string` | | text |
|
|
44
|
+
| `asChild` | `boolean` | | toggle |
|
|
45
|
+
|
|
46
|
+
### ButtonGroupText
|
|
47
|
+
|
|
48
|
+
| Prop | Type | Default | Control |
|
|
49
|
+
| --- | --- | --- | --- |
|
|
50
|
+
| `asChild` | `boolean` | `false` | toggle |
|
|
51
|
+
| `size` | `"default" \| "sm" \| "lg"` | | dropdown |
|
|
52
|
+
| `className` | `string` | | text |
|
|
53
|
+
| `id` | `string` | | text |
|
|
54
|
+
| `children` | `React.ReactNode` | | content |
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<!-- @dsCard group="Actions" height=120 -->
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>ButtonGroup</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 f=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty;var m=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(o){throw t=0,o}};var T=(e,t,o,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of g(t))!G.call(e,n)&&n!==o&&f(e,n,{get:()=>t[n],enumerable:!(u=D(t,n))||u.enumerable});return e};var r=(e,t,o)=>(o=e!=null?h(v(e)):{},T(t||!e||!e.__esModule?f(o,"default",{value:e,enumerable:!0}):o,e));var c=m((k,l)=>{l.exports=window.Nxds});var s=m((M,y)=>{y.exports=window.React});var R=m((O,E)=>{E.exports={createRoot:window.ReactDOM.createRoot}});var B=r(c()),a=r(c());var i=r(s());function x(e,t){return t===void 0?e:{...e,key:t}}function p(e,t,o){return(0,i.createElement)(e,x(t,o))}function w(e,t,o){let{children:u,...n}=t;return(0,i.createElement)(e,x(n,o),...u)}function d(){return w(B.ButtonGroup,{children:[p(a.Button,{variant:"outline",children:"Day"}),p(a.Button,{variant:"outline",children:"Week"}),p(a.Button,{variant:"outline",children:"Month"})]})}var K=r(s()),P=r(R());(0,P.createRoot)(document.getElementById("root")).render((0,K.createElement)(d));})();</script>
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|