@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,123 @@
|
|
|
1
|
+
# Toolbar
|
|
2
|
+
|
|
3
|
+
Toolbar groups related controls behind one Tab stop. Arrow keys move between controls, and Home and End jump to the first and last. For actions that each need their own Tab stop, use a row of Buttons.
|
|
4
|
+
|
|
5
|
+
- Label the toolbar with `aria-label` or `aria-labelledby`.
|
|
6
|
+
- Build it from ToolbarButton, ToolbarLink, ToolbarToggleGroup and ToolbarToggleItem so every control joins the arrow-key order.
|
|
7
|
+
- ToolbarButton and ToolbarLink take Button `variant` and `size`, but not `loading` or icon slots.
|
|
8
|
+
- Use `asChild` to make a toolbar control a menu trigger.
|
|
9
|
+
- Keep text fields outside the toolbar, because arrow keys would conflict with typing.
|
|
10
|
+
- In narrow containers, controls wrap in DOM order and arrow keys still reach every row.
|
|
11
|
+
- Your app owns the commands, selection, visibility and placement.
|
|
12
|
+
|
|
13
|
+
## On the canvas
|
|
14
|
+
|
|
15
|
+
```html
|
|
16
|
+
<x-import component-from-global-scope="Nxds.Toolbar" orientation="horizontal" dir="ltr">Toolbar</x-import>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
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.
|
|
20
|
+
|
|
21
|
+
## Parts
|
|
22
|
+
|
|
23
|
+
- `Nxds.Toolbar` — Label the toolbar with aria-label or aria-labelledby.
|
|
24
|
+
- `Nxds.ToolbarButton`
|
|
25
|
+
- `Nxds.ToolbarGroup`
|
|
26
|
+
- `Nxds.ToolbarLink`
|
|
27
|
+
- `Nxds.ToolbarSeparator`
|
|
28
|
+
- `Nxds.ToolbarToggleGroup`
|
|
29
|
+
- `Nxds.ToolbarToggleItem`
|
|
30
|
+
|
|
31
|
+
## Props
|
|
32
|
+
|
|
33
|
+
### Toolbar
|
|
34
|
+
|
|
35
|
+
| Prop | Type | Default | Control |
|
|
36
|
+
| --- | --- | --- | --- |
|
|
37
|
+
| `orientation` | `"horizontal" \| "vertical"` | | dropdown |
|
|
38
|
+
| `loop` | `boolean` | | toggle |
|
|
39
|
+
| `dir` | `"ltr" \| "rtl"` | | dropdown |
|
|
40
|
+
| `children` | `React.ReactNode` | | content |
|
|
41
|
+
| `className` | `string` | | text |
|
|
42
|
+
| `id` | `string` | | text |
|
|
43
|
+
| `asChild` | `boolean` | | toggle |
|
|
44
|
+
|
|
45
|
+
### ToolbarButton
|
|
46
|
+
|
|
47
|
+
| Prop | Type | Default | Control |
|
|
48
|
+
| --- | --- | --- | --- |
|
|
49
|
+
| `children` | `React.ReactNode` | | content |
|
|
50
|
+
| `className` | `string` | | text |
|
|
51
|
+
| `id` | `string` | | text |
|
|
52
|
+
| `name` | `string` | | text |
|
|
53
|
+
| `type` | `"button" \| "submit" \| "reset"` | | dropdown |
|
|
54
|
+
| `asChild` | `boolean` | | toggle |
|
|
55
|
+
| `disabled` | `boolean` | | toggle |
|
|
56
|
+
| `value` | `string \| number \| readonly string[]` | | none (object) |
|
|
57
|
+
| `variant` | `"link" \| "default" \| "destructive" \| "error" \| "outline" \| "dashed" \| "secondary" \| "ghost"` | `"ghost"` | dropdown |
|
|
58
|
+
| `size` | `"default" \| "sm" \| "lg" \| "icon-sm" \| "icon" \| "icon-lg"` | `"sm"` | dropdown |
|
|
59
|
+
|
|
60
|
+
### ToolbarGroup
|
|
61
|
+
|
|
62
|
+
| Prop | Type | Default | Control |
|
|
63
|
+
| --- | --- | --- | --- |
|
|
64
|
+
| `className` | `string` | | text |
|
|
65
|
+
| `id` | `string` | | text |
|
|
66
|
+
| `children` | `React.ReactNode` | | content |
|
|
67
|
+
|
|
68
|
+
### ToolbarLink
|
|
69
|
+
|
|
70
|
+
| Prop | Type | Default | Control |
|
|
71
|
+
| --- | --- | --- | --- |
|
|
72
|
+
| `children` | `React.ReactNode` | | content |
|
|
73
|
+
| `className` | `string` | | text |
|
|
74
|
+
| `id` | `string` | | text |
|
|
75
|
+
| `target` | `HTMLAttributeAnchorTarget` | | none (object) |
|
|
76
|
+
| `type` | `string` | | text |
|
|
77
|
+
| `href` | `string` | | text |
|
|
78
|
+
| `asChild` | `boolean` | | toggle |
|
|
79
|
+
| `variant` | `"link" \| "default" \| "destructive" \| "error" \| "outline" \| "dashed" \| "secondary" \| "ghost"` | `"ghost"` | dropdown |
|
|
80
|
+
| `size` | `"default" \| "sm" \| "lg" \| "icon-sm" \| "icon" \| "icon-lg"` | `"sm"` | dropdown |
|
|
81
|
+
|
|
82
|
+
### ToolbarSeparator
|
|
83
|
+
|
|
84
|
+
| Prop | Type | Default | Control |
|
|
85
|
+
| --- | --- | --- | --- |
|
|
86
|
+
| `children` | `React.ReactNode` | | content |
|
|
87
|
+
| `className` | `string` | | text |
|
|
88
|
+
| `id` | `string` | | text |
|
|
89
|
+
| `orientation` | `"horizontal" \| "vertical"` | | dropdown |
|
|
90
|
+
| `asChild` | `boolean` | | toggle |
|
|
91
|
+
| `decorative` | `boolean` | | toggle |
|
|
92
|
+
|
|
93
|
+
### ToolbarToggleGroup
|
|
94
|
+
|
|
95
|
+
| Prop | Type | Default | Control |
|
|
96
|
+
| --- | --- | --- | --- |
|
|
97
|
+
| `children` | `React.ReactNode` | | content |
|
|
98
|
+
| `className` | `string` | | text |
|
|
99
|
+
| `id` | `string` | | text |
|
|
100
|
+
| `type` | `"single" \| "multiple"` | | dropdown |
|
|
101
|
+
| `orientation` | `"horizontal" \| "vertical"` | | dropdown |
|
|
102
|
+
| `defaultValue` | `string \| string[]` | | none (object) |
|
|
103
|
+
| `dir` | `"ltr" \| "rtl"` | | dropdown |
|
|
104
|
+
| `asChild` | `boolean` | | toggle |
|
|
105
|
+
| `disabled` | `boolean` | | toggle |
|
|
106
|
+
| `value` | `string \| string[]` | | none (object) |
|
|
107
|
+
| `loop` | `boolean` | | toggle |
|
|
108
|
+
| `onValueChange` | `((value: string) => void) \| ((value: string[]) => void)` | | none (function) |
|
|
109
|
+
| `rovingFocus` | `boolean` | | toggle |
|
|
110
|
+
|
|
111
|
+
### ToolbarToggleItem
|
|
112
|
+
|
|
113
|
+
| Prop | Type | Default | Control |
|
|
114
|
+
| --- | --- | --- | --- |
|
|
115
|
+
| `children` | `React.ReactNode` | | content |
|
|
116
|
+
| `className` | `string` | | text |
|
|
117
|
+
| `id` | `string` | | text |
|
|
118
|
+
| `name` | `string` | | text |
|
|
119
|
+
| `type` | `"button" \| "submit" \| "reset"` | | dropdown |
|
|
120
|
+
| `asChild` | `boolean` | | toggle |
|
|
121
|
+
| `disabled` | `boolean` | | toggle |
|
|
122
|
+
| `value` | `string` | | text |
|
|
123
|
+
| `size` | `"default" \| "sm" \| "lg" \| "icon-sm" \| "icon" \| "icon-lg"` | `"sm"` | 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>Toolbar</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 x=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,K=Object.prototype.hasOwnProperty;var c=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(a){throw e=0,a}};var S=(t,e,a,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of P(e))!K.call(t,s)&&s!==a&&x(t,s,{get:()=>e[s],enumerable:!(p=B(e,s))||p.enumerable});return t};var d=(t,e,a)=>(a=t!=null?E(k(t)):{},S(e||!t||!t.__esModule?x(a,"default",{value:t,enumerable:!0}):a,t));var m=c((D,b)=>{b.exports=window.React});var h=c((j,y)=>{y.exports=window.Nxds.Icons});var g=c((F,w)=>{w.exports=window.Nxds});var v=c((A,N)=>{N.exports={createRoot:window.ReactDOM.createRoot}});var T=d(m()),l=d(h()),r=d(g()),n=d(g());var u=d(m());function I(t,e){return e===void 0?t:{...t,key:e}}function o(t,e,a){return(0,u.createElement)(t,I(e,a))}function i(t,e,a){let{children:p,...s}=e;return(0,u.createElement)(t,I(s,a),...p)}function U(){let t=T.useId(),[e,a]=T.useState([]);return i("div",{className:"nx:grid nx:gap-4",children:[i(r.Toolbar,{"aria-label":"Text formatting",children:[i(n.Tooltip,{children:[o(n.TooltipTrigger,{asChild:!0,children:o("span",{className:"nx:inline-flex",children:o(r.ToolbarButton,{size:"icon-sm","aria-label":"Undo formatting",onClick:()=>a([]),className:"nx:text-muted-foreground",children:o(l.IconArrowBackUp,{"aria-hidden":"true"})})})}),o(n.TooltipContent,{children:"Reset formatting"})]}),o(r.ToolbarSeparator,{className:"nx:data-[orientation=vertical]:h-4"}),i(r.ToolbarToggleGroup,{type:"multiple",value:e,onValueChange:a,"aria-label":"Text style",children:[i(n.Tooltip,{children:[o(n.TooltipTrigger,{asChild:!0,children:o("span",{className:"nx:inline-flex",children:o(r.ToolbarToggleItem,{value:"bold","aria-label":"Bold",size:"icon-sm",children:o(l.IconBold,{"aria-hidden":"true"})})})}),o(n.TooltipContent,{children:"Bold"})]}),i(n.Tooltip,{children:[o(n.TooltipTrigger,{asChild:!0,children:o("span",{className:"nx:inline-flex",children:o(r.ToolbarToggleItem,{value:"italic","aria-label":"Italic",size:"icon-sm",children:o(l.IconItalic,{"aria-hidden":"true"})})})}),o(n.TooltipContent,{children:"Italic"})]}),i(n.Tooltip,{children:[o(n.TooltipTrigger,{asChild:!0,children:o("span",{className:"nx:inline-flex",children:o(r.ToolbarToggleItem,{value:"underline","aria-label":"Underline",size:"icon-sm",children:o(l.IconUnderline,{"aria-hidden":"true"})})})}),o(n.TooltipContent,{children:"Underline"})]})]}),o(r.ToolbarSeparator,{className:"nx:data-[orientation=vertical]:h-4"}),o(r.ToolbarLink,{className:"nx:text-muted-foreground",href:`#${t}`,children:"Preview"})]}),o("p",{id:t,className:"nx:typography-body-default nx:text-muted-foreground",style:{fontWeight:e.includes("bold")?700:void 0,fontStyle:e.includes("italic")?"italic":void 0,textDecoration:e.includes("underline")?"underline":void 0},children:"Select formatting to update this preview."})]})}function f(){return o(U,{})}var C=d(m()),R=d(v());(0,R.createRoot)(document.getElementById("root")).render((0,C.createElement)(f));})();</script>
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Tooltip
|
|
2
|
+
|
|
3
|
+
Tooltip shows a short hint when users hover over or focus a trigger. Use it for brief labels, such as the name of an icon button. Wrap a group of tooltips in `TooltipProvider` to share one open delay.
|
|
4
|
+
|
|
5
|
+
## On the canvas
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<x-import component-from-global-scope="Nxds.Tooltip">
|
|
9
|
+
<x-import component-from-global-scope="Nxds.TooltipTrigger" as-child>
|
|
10
|
+
<x-import component-from-global-scope="Nxds.Button" variant="outline">Hover me</x-import>
|
|
11
|
+
</x-import>
|
|
12
|
+
<x-import component-from-global-scope="Nxds.TooltipContent">
|
|
13
|
+
<p>This is a tooltip</p>
|
|
14
|
+
</x-import>
|
|
15
|
+
</x-import>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
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.
|
|
19
|
+
|
|
20
|
+
## Parts
|
|
21
|
+
|
|
22
|
+
- `Nxds.Tooltip` — Root of one tooltip.
|
|
23
|
+
- `Nxds.TooltipContent` — Popup that shows the tooltip text.
|
|
24
|
+
- `Nxds.TooltipProvider` — Optional.
|
|
25
|
+
- `Nxds.TooltipTrigger` — Element that opens the tooltip on hover or focus.
|
|
26
|
+
|
|
27
|
+
## Props
|
|
28
|
+
|
|
29
|
+
### Tooltip
|
|
30
|
+
|
|
31
|
+
| Prop | Type | Default | Control |
|
|
32
|
+
| --- | --- | --- | --- |
|
|
33
|
+
| `children` | `React.ReactNode` | | content |
|
|
34
|
+
| `open` | `boolean` | | toggle |
|
|
35
|
+
| `defaultOpen` | `boolean` | | toggle |
|
|
36
|
+
| `onOpenChange` | `(open: boolean) => void` | | none (function) |
|
|
37
|
+
| `delayDuration` | `number` | | number |
|
|
38
|
+
| `disableHoverableContent` | `boolean` | | toggle |
|
|
39
|
+
|
|
40
|
+
### TooltipContent
|
|
41
|
+
|
|
42
|
+
| Prop | Type | Default | Control |
|
|
43
|
+
| --- | --- | --- | --- |
|
|
44
|
+
| `forceMount` | `true` | | toggle |
|
|
45
|
+
| `aria-label` | `string` | | text |
|
|
46
|
+
| `onEscapeKeyDown` | `(event: KeyboardEvent) => void` | | none (function) |
|
|
47
|
+
| `onPointerDownOutside` | `(event: PointerDownOutsideEvent) => void` | | none (function) |
|
|
48
|
+
| `children` | `React.ReactNode` | | content |
|
|
49
|
+
| `className` | `string` | | text |
|
|
50
|
+
| `id` | `string` | | text |
|
|
51
|
+
| `align` | `"end" \| "center" \| "start"` | | dropdown |
|
|
52
|
+
| `asChild` | `boolean` | | toggle |
|
|
53
|
+
| `side` | `"top" \| "bottom" \| "left" \| "right"` | | dropdown |
|
|
54
|
+
| `sideOffset` | `number` | `4` | number |
|
|
55
|
+
| `alignOffset` | `number` | | number |
|
|
56
|
+
| `arrowPadding` | `number` | | number |
|
|
57
|
+
| `avoidCollisions` | `boolean` | | toggle |
|
|
58
|
+
| `collisionBoundary` | `Element \| Boundary[]` | | none (object) |
|
|
59
|
+
| `collisionPadding` | `number \| Partial<Record<"top" \| "bottom" \| "left" \| "right", number>>` | | none (object) |
|
|
60
|
+
| `sticky` | `"partial" \| "always"` | | dropdown |
|
|
61
|
+
| `hideWhenDetached` | `boolean` | | toggle |
|
|
62
|
+
| `updatePositionStrategy` | `"always" \| "optimized"` | | dropdown |
|
|
63
|
+
|
|
64
|
+
### TooltipProvider
|
|
65
|
+
|
|
66
|
+
| Prop | Type | Default | Control |
|
|
67
|
+
| --- | --- | --- | --- |
|
|
68
|
+
| `children` | `React.ReactNode` | | content |
|
|
69
|
+
| `delayDuration` | `number` | | number |
|
|
70
|
+
| `skipDelayDuration` | `number` | | number |
|
|
71
|
+
| `disableHoverableContent` | `boolean` | | toggle |
|
|
72
|
+
|
|
73
|
+
### TooltipTrigger
|
|
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="Overlays" height=120 -->
|
|
2
|
+
<!doctype html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>Tooltip</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 K=Object.create;var d=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var s=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(o){throw e=0,o}};var j=(t,e,o,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of B(e))!D.call(t,r)&&r!==o&&d(t,r,{get:()=>e[r],enumerable:!(l=P(e,r))||l.enumerable});return t};var i=(t,e,o)=>(o=t!=null?K(C(t)):{},j(e||!t||!t.__esModule?d(o,"default",{value:t,enumerable:!0}):o,t));var a=s((k,f)=>{f.exports=window.Nxds});var u=s((F,y)=>{y.exports=window.React});var g=s((N,E)=>{E.exports={createRoot:window.ReactDOM.createRoot}});var w=i(a()),n=i(a());var m=i(u());function T(t,e){return e===void 0?t:{...t,key:e}}function p(t,e,o){return(0,m.createElement)(t,T(e,o))}function x(t,e,o){let{children:l,...r}=e;return(0,m.createElement)(t,T(r,o),...l)}function c(){return x(n.Tooltip,{children:[p(n.TooltipTrigger,{asChild:!0,children:p(w.Button,{variant:"outline",children:"Hover me"})}),p(n.TooltipContent,{children:p("p",{children:"This is a tooltip"})})]})}var R=i(u()),h=i(g());(0,h.createRoot)(document.getElementById("root")).render((0,R.createElement)(c));})();</script>
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|