@ui-sdk/react 0.0.0-stage → 0.1.0-beta.1

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 (247) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +10 -2
  3. package/dist/accordion.d.ts +331 -0
  4. package/dist/accordion.js +25 -0
  5. package/dist/agent.d.ts +2 -0
  6. package/dist/agent.js +8 -0
  7. package/dist/alert-dialog.d.ts +56 -0
  8. package/dist/alert-dialog.js +45 -0
  9. package/dist/async-options.d.ts +22 -0
  10. package/dist/async-options.js +56 -0
  11. package/dist/autocomplete.d.ts +102 -0
  12. package/dist/autocomplete.js +195 -0
  13. package/dist/avatar.d.ts +301 -0
  14. package/dist/avatar.js +17 -0
  15. package/dist/button.d.ts +21 -0
  16. package/dist/button.js +45 -0
  17. package/dist/calendar-context.d.ts +10 -0
  18. package/dist/calendar-context.js +9 -0
  19. package/dist/calendar.d.ts +80 -0
  20. package/dist/calendar.js +257 -0
  21. package/dist/carousel.d.ts +52 -0
  22. package/dist/carousel.js +151 -0
  23. package/dist/checkbox.d.ts +24 -0
  24. package/dist/checkbox.js +98 -0
  25. package/dist/children.d.ts +38 -0
  26. package/dist/children.js +63 -0
  27. package/dist/collapsible.d.ts +302 -0
  28. package/dist/collapsible.js +19 -0
  29. package/dist/color-picker.d.ts +72 -0
  30. package/dist/color-picker.js +133 -0
  31. package/dist/color.d.ts +2 -0
  32. package/dist/color.js +22 -0
  33. package/dist/combobox.d.ts +152 -0
  34. package/dist/combobox.js +338 -0
  35. package/dist/command.d.ts +88 -0
  36. package/dist/command.js +233 -0
  37. package/dist/controller-target.d.ts +3 -0
  38. package/dist/controller-target.js +59 -0
  39. package/dist/date-input.d.ts +19 -0
  40. package/dist/date-input.js +58 -0
  41. package/dist/date-picker.d.ts +47 -0
  42. package/dist/date-picker.js +310 -0
  43. package/dist/date.d.ts +2 -0
  44. package/dist/date.js +60 -0
  45. package/dist/dialog-parts.d.ts +23 -0
  46. package/dist/dialog-parts.js +142 -0
  47. package/dist/dialog.d.ts +57 -0
  48. package/dist/dialog.js +32 -0
  49. package/dist/drawer.d.ts +70 -0
  50. package/dist/drawer.js +158 -0
  51. package/dist/editor-context.d.ts +4 -0
  52. package/dist/editor-context.js +9 -0
  53. package/dist/field-context.d.ts +47 -0
  54. package/dist/field-context.js +87 -0
  55. package/dist/field.d.ts +49 -0
  56. package/dist/field.js +169 -0
  57. package/dist/file-input.d.ts +46 -0
  58. package/dist/file-input.js +170 -0
  59. package/dist/form-inputs.d.ts +5 -0
  60. package/dist/form-inputs.js +22 -0
  61. package/dist/gesture.d.ts +1 -0
  62. package/dist/gesture.js +16 -0
  63. package/dist/history.d.ts +2 -0
  64. package/dist/history.js +12 -0
  65. package/dist/hover-card.d.ts +33 -0
  66. package/dist/hover-card.js +84 -0
  67. package/dist/image-cropper.d.ts +333 -0
  68. package/dist/image-cropper.js +37 -0
  69. package/dist/image.d.ts +2 -0
  70. package/dist/image.js +6 -0
  71. package/dist/input.d.ts +22 -0
  72. package/dist/input.js +51 -0
  73. package/dist/label.d.ts +294 -0
  74. package/dist/label.js +9 -0
  75. package/dist/list-items.d.ts +15 -0
  76. package/dist/list-items.js +39 -0
  77. package/dist/list-text.d.ts +4 -0
  78. package/dist/list-text.js +15 -0
  79. package/dist/listbox.d.ts +56 -0
  80. package/dist/listbox.js +122 -0
  81. package/dist/menu.d.ts +116 -0
  82. package/dist/menu.js +426 -0
  83. package/dist/menubar-context.d.ts +4 -0
  84. package/dist/menubar-context.js +7 -0
  85. package/dist/menubar.d.ts +11 -0
  86. package/dist/menubar.js +32 -0
  87. package/dist/meter.d.ts +312 -0
  88. package/dist/meter.js +30 -0
  89. package/dist/navigation-menu.d.ts +61 -0
  90. package/dist/navigation-menu.js +169 -0
  91. package/dist/number-input.d.ts +44 -0
  92. package/dist/number-input.js +185 -0
  93. package/dist/number.d.ts +2 -0
  94. package/dist/number.js +40 -0
  95. package/dist/observe.d.ts +2 -0
  96. package/dist/observe.js +8 -0
  97. package/dist/otp-input.d.ts +29 -0
  98. package/dist/otp-input.js +94 -0
  99. package/dist/overlays.d.ts +26 -0
  100. package/dist/overlays.js +82 -0
  101. package/dist/pagination.d.ts +336 -0
  102. package/dist/pagination.js +71 -0
  103. package/dist/password-input.d.ts +23 -0
  104. package/dist/password-input.js +65 -0
  105. package/dist/popover.d.ts +54 -0
  106. package/dist/popover.js +151 -0
  107. package/dist/popup.d.ts +41 -0
  108. package/dist/popup.js +180 -0
  109. package/dist/preferences.d.ts +35 -0
  110. package/dist/preferences.js +93 -0
  111. package/dist/primitive.d.ts +2 -0
  112. package/dist/primitive.js +14 -0
  113. package/dist/progress.d.ts +312 -0
  114. package/dist/progress.js +30 -0
  115. package/dist/radio.d.ts +22 -0
  116. package/dist/radio.js +86 -0
  117. package/dist/rating.d.ts +20 -0
  118. package/dist/rating.js +94 -0
  119. package/dist/render-element.d.ts +35 -0
  120. package/dist/render-element.js +103 -0
  121. package/dist/resizable.d.ts +302 -0
  122. package/dist/resizable.js +23 -0
  123. package/dist/scroll-area.d.ts +324 -0
  124. package/dist/scroll-area.js +49 -0
  125. package/dist/segmented-control.d.ts +24 -0
  126. package/dist/segmented-control.js +78 -0
  127. package/dist/segmented-input.d.ts +15 -0
  128. package/dist/segmented-input.js +48 -0
  129. package/dist/select.d.ts +125 -0
  130. package/dist/select.js +330 -0
  131. package/dist/separator.d.ts +290 -0
  132. package/dist/separator.js +9 -0
  133. package/dist/shortcuts.d.ts +32 -0
  134. package/dist/shortcuts.js +61 -0
  135. package/dist/slider.d.ts +38 -0
  136. package/dist/slider.js +163 -0
  137. package/dist/switch.d.ts +15 -0
  138. package/dist/switch.js +39 -0
  139. package/dist/tabs.d.ts +331 -0
  140. package/dist/tabs.js +28 -0
  141. package/dist/text-control.d.ts +22 -0
  142. package/dist/text-control.js +24 -0
  143. package/dist/text-match.d.ts +2 -0
  144. package/dist/text-match.js +8 -0
  145. package/dist/textarea.d.ts +10 -0
  146. package/dist/textarea.js +48 -0
  147. package/dist/time-input.d.ts +19 -0
  148. package/dist/time-input.js +63 -0
  149. package/dist/timeline.d.ts +327 -0
  150. package/dist/timeline.js +31 -0
  151. package/dist/toast-parts.d.ts +63 -0
  152. package/dist/toast-parts.js +144 -0
  153. package/dist/toast.d.ts +2 -0
  154. package/dist/toast.js +22 -0
  155. package/dist/toggle.d.ts +23 -0
  156. package/dist/toggle.js +76 -0
  157. package/dist/token-input.d.ts +35 -0
  158. package/dist/token-input.js +100 -0
  159. package/dist/toolbar-context.d.ts +6 -0
  160. package/dist/toolbar-context.js +16 -0
  161. package/dist/toolbar.d.ts +38 -0
  162. package/dist/toolbar.js +63 -0
  163. package/dist/tooltip.d.ts +39 -0
  164. package/dist/tooltip.js +108 -0
  165. package/dist/tree.d.ts +51 -0
  166. package/dist/tree.js +150 -0
  167. package/dist/trigger-menu.d.ts +83 -0
  168. package/dist/trigger-menu.js +167 -0
  169. package/dist/use-primitive.d.ts +178 -0
  170. package/dist/use-primitive.js +674 -0
  171. package/dist/waterfall.d.ts +80 -0
  172. package/dist/waterfall.js +108 -0
  173. package/docs/README.md +89 -0
  174. package/docs/agents.md +1523 -0
  175. package/docs/components/accordion.md +1391 -0
  176. package/docs/components/alert-dialog.md +850 -0
  177. package/docs/components/autocomplete.md +1963 -0
  178. package/docs/components/avatar.md +252 -0
  179. package/docs/components/button.md +444 -0
  180. package/docs/components/calendar.md +1687 -0
  181. package/docs/components/carousel.md +1244 -0
  182. package/docs/components/checkbox.md +1069 -0
  183. package/docs/components/collapsible.md +567 -0
  184. package/docs/components/color-picker.md +736 -0
  185. package/docs/components/combobox.md +3647 -0
  186. package/docs/components/command.md +1573 -0
  187. package/docs/components/date-input.md +608 -0
  188. package/docs/components/date-picker.md +1266 -0
  189. package/docs/components/dialog.md +1469 -0
  190. package/docs/components/drawer.md +1197 -0
  191. package/docs/components/field.md +549 -0
  192. package/docs/components/file-input.md +609 -0
  193. package/docs/components/hover-card.md +514 -0
  194. package/docs/components/image-cropper.md +579 -0
  195. package/docs/components/input.md +301 -0
  196. package/docs/components/label.md +217 -0
  197. package/docs/components/listbox.md +1130 -0
  198. package/docs/components/menu.md +1286 -0
  199. package/docs/components/menubar.md +455 -0
  200. package/docs/components/meter.md +304 -0
  201. package/docs/components/navigation-menu.md +1581 -0
  202. package/docs/components/number-input.md +1086 -0
  203. package/docs/components/otp-input.md +565 -0
  204. package/docs/components/pagination.md +648 -0
  205. package/docs/components/password-input.md +737 -0
  206. package/docs/components/popover.md +1552 -0
  207. package/docs/components/preferences.md +220 -0
  208. package/docs/components/progress.md +443 -0
  209. package/docs/components/radio.md +846 -0
  210. package/docs/components/rating.md +458 -0
  211. package/docs/components/resizable.md +982 -0
  212. package/docs/components/scroll-area.md +980 -0
  213. package/docs/components/segmented-control.md +465 -0
  214. package/docs/components/select.md +2133 -0
  215. package/docs/components/separator.md +243 -0
  216. package/docs/components/slider.md +1169 -0
  217. package/docs/components/switch.md +613 -0
  218. package/docs/components/tabs.md +1014 -0
  219. package/docs/components/textarea.md +318 -0
  220. package/docs/components/time-input.md +231 -0
  221. package/docs/components/timeline.md +677 -0
  222. package/docs/components/toast.md +1395 -0
  223. package/docs/components/toggle.md +541 -0
  224. package/docs/components/token-input.md +1007 -0
  225. package/docs/components/toolbar.md +787 -0
  226. package/docs/components/tooltip.md +884 -0
  227. package/docs/components/tree.md +1346 -0
  228. package/docs/components/trigger-menu.md +1257 -0
  229. package/docs/components/waterfall.md +754 -0
  230. package/docs/controllers.md +89 -0
  231. package/docs/core.md +8027 -0
  232. package/docs/custom-parts.md +120 -0
  233. package/docs/first-component.md +83 -0
  234. package/docs/forms.md +148 -0
  235. package/docs/hooks/async-options.md +366 -0
  236. package/docs/hooks/shortcuts.md +221 -0
  237. package/docs/installation.md +45 -0
  238. package/docs/introduction.md +32 -0
  239. package/docs/lists-and-menus.md +170 -0
  240. package/docs/llms.txt +1844 -0
  241. package/docs/parts-and-composition.md +93 -0
  242. package/docs/popups.md +117 -0
  243. package/docs/rendering.md +121 -0
  244. package/docs/server-rendering.md +253 -0
  245. package/docs/state-and-events.md +105 -0
  246. package/docs/styling-and-animation.md +176 -0
  247. package/package.json +333 -3
@@ -0,0 +1,243 @@
1
+ # Separator
2
+
3
+ Divide groups of content with a horizontal or vertical line.
4
+
5
+ Use a separator between groups of content that a reader should take as separate, like a profile's header and its bio.
6
+
7
+ ```tsx title="basic.tsx"
8
+ import { Separator } from "@ui-sdk/react/separator"
9
+
10
+ function Example() {
11
+ return (
12
+ <div data-slot="stack">
13
+ <div data-slot="stack">
14
+ <h3>Hollis Grant</h3>
15
+ <p data-slot="hint">hollis@example.com</p>
16
+ </div>
17
+ <Separator />
18
+ <p>
19
+ Designs the billing and onboarding flows, and reviews every new pricing
20
+ page.
21
+ </p>
22
+ </div>
23
+ )
24
+ }
25
+
26
+ export { Example }
27
+ ```
28
+
29
+ Read the profile with a screen reader. It announces a separator between Hollis Grant's name and email and the bio below.
30
+
31
+ ## Installation
32
+
33
+ ```bash
34
+ npm install @ui-sdk/react @ui-sdk/core
35
+ ```
36
+
37
+ ## Usage
38
+
39
+ Import the separator and put it between two groups of content:
40
+
41
+ ```tsx
42
+ import { Separator } from "@ui-sdk/react/separator"
43
+
44
+ function Profile() {
45
+ return (
46
+ <section>
47
+ <h2>Hollis Grant</h2>
48
+ <Separator />
49
+ <p>Designs the billing and onboarding flows.</p>
50
+ </section>
51
+ )
52
+ }
53
+
54
+ export { Profile }
55
+ ```
56
+
57
+ ## Build Your Own
58
+
59
+ `@ui-sdk/react/separator` comes with a ready-made Separator. If you'd like to build your own, with your own name, start from the `separator` primitive in `@ui-sdk/core`:
60
+
61
+ ```ts title="divider.ts"
62
+ "use client"
63
+
64
+ import { separator } from "@ui-sdk/core/separator"
65
+ import { createParts } from "@ui-sdk/react/primitive"
66
+
67
+ const { Root: Divider } = createParts(separator, { root: "div" })
68
+
69
+ export { Divider }
70
+ ```
71
+
72
+ ```tsx
73
+ <Divider orientation="vertical" />
74
+ ```
75
+
76
+ `Divider` keeps the behavior, state and data attributes of the ready-made Separator: the `separator` role, `aria-orientation` and `data-orientation`. See [Rendering](../rendering.md) and [Custom Parts](../custom-parts.md) for more.
77
+
78
+ ## Vertical
79
+
80
+ Set `orientation="vertical"` for a line between items in a row. It takes the row's height.
81
+
82
+ ```tsx title="vertical.tsx"
83
+ import { Separator } from "@ui-sdk/react/separator"
84
+
85
+ function Example() {
86
+ return (
87
+ <nav aria-label="Legal" data-slot="row">
88
+ <a href="#">Privacy</a>
89
+ <Separator orientation="vertical" />
90
+ <a href="#">Terms</a>
91
+ <Separator orientation="vertical" />
92
+ <a href="#">Cookies</a>
93
+ </nav>
94
+ )
95
+ }
96
+
97
+ export { Example }
98
+ ```
99
+
100
+ Read across Privacy, Terms and Cookies. A screen reader announces a vertical separator between each link.
101
+
102
+ ## Stacked Content
103
+
104
+ A vertical separator stretches to the tallest item in its row, so it spans a number and its label.
105
+
106
+ ```tsx title="menu.tsx"
107
+ import { Separator } from "@ui-sdk/react/separator"
108
+
109
+ function Example() {
110
+ return (
111
+ <div data-slot="row">
112
+ <div data-slot="stack">
113
+ <span>24</span>
114
+ <span data-slot="hint">Projects</span>
115
+ </div>
116
+ <Separator orientation="vertical" />
117
+ <div data-slot="stack">
118
+ <span>1,280</span>
119
+ <span data-slot="hint">Followers</span>
120
+ </div>
121
+ <Separator orientation="vertical" />
122
+ <div data-slot="stack">
123
+ <span>312</span>
124
+ <span data-slot="hint">Following</span>
125
+ </div>
126
+ </div>
127
+ )
128
+ }
129
+
130
+ export { Example }
131
+ ```
132
+
133
+ Compare the lines with the stats. Each one runs the full height of Projects, Followers and Following.
134
+
135
+ ## Rows
136
+
137
+ Put a separator between each pair of rows to divide a list of details.
138
+
139
+ ```tsx title="list.tsx"
140
+ import { Separator } from "@ui-sdk/react/separator"
141
+
142
+ function Example() {
143
+ return (
144
+ <div data-slot="stack">
145
+ <dl>
146
+ <dt>Plan</dt>
147
+ <dd>Pro</dd>
148
+ </dl>
149
+ <Separator />
150
+ <dl>
151
+ <dt>Seats</dt>
152
+ <dd>8 of 10</dd>
153
+ </dl>
154
+ <Separator />
155
+ <dl>
156
+ <dt>Renews</dt>
157
+ <dd>December 1, 2026</dd>
158
+ </dl>
159
+ </div>
160
+ )
161
+ }
162
+
163
+ export { Example }
164
+ ```
165
+
166
+ Read the plan details with a screen reader. It announces a separator between Plan, Seats and Renews.
167
+
168
+ ## Decorative
169
+
170
+ Set `decorative` when the line adds no information. Here, the word “or” already says the two ways to sign in are separate, so a screen reader skips the lines.
171
+
172
+ ```tsx title="decorative.tsx"
173
+ import { Separator } from "@ui-sdk/react/separator"
174
+
175
+ function Example() {
176
+ return (
177
+ <div data-slot="stack">
178
+ <button type="button" data-variant="solid">
179
+ Sign In with Passkey
180
+ </button>
181
+ <div data-slot="row">
182
+ <Separator decorative />
183
+ <span>or</span>
184
+ <Separator decorative />
185
+ </div>
186
+ <button type="button">Email Me a Link</button>
187
+ </div>
188
+ )
189
+ }
190
+
191
+ export { Example }
192
+ ```
193
+
194
+ Read from Sign In with Passkey to Email Me a Link with a screen reader. It reads “or” and skips the lines.
195
+
196
+ A decorative separator gets `role="none"` and no `aria-orientation`. It keeps `data-orientation` for styling.
197
+
198
+ ## Custom Rendering
199
+
200
+ Pass `render` to use a different element, such as `render={<hr />}`. See [Parts and Composition](../parts-and-composition.md) for reading the separator's state.
201
+
202
+ ## Styling
203
+
204
+ The separator is unstyled. Give it a background, a height when it's horizontal and a width when it's vertical, and use `data-orientation` to tell them apart. A vertical line takes its row's height with `align-self: stretch`.
205
+
206
+ The separator has a `data-slot` of `separator`, and its `data-orientation` is listed under [Data Attributes](#data-attributes).
207
+
208
+ ## Data Attributes
209
+
210
+ ### Separator
211
+ `[data-slot="separator"]`
212
+
213
+ - `data-orientation` (`horizontal`, `vertical`): Which way the line runs.
214
+
215
+ ## API Reference
216
+
217
+ Props are the same as below, as React props.
218
+
219
+ ### Separator
220
+
221
+ - `orientation?` (`SeparatorOrientation`): Which way the line runs. A vertical separator divides items in a row.
222
+ - `decorative?` (`boolean`): Hides the separator from assistive technology with `role="none"`, for a line that's only visual. Leave it off when the separator divides content a screen reader should hear as separate, like groups of menu items.
223
+ - `debug?` (`boolean`): Logs every state change with its reason to the console, in development builds.
224
+
225
+ ### State
226
+
227
+ What render functions and state-based class names receive.
228
+
229
+ - `orientation` (`SeparatorOrientation`): Which way the line runs.
230
+
231
+ ## Accessibility
232
+
233
+ The component follows the [WAI-ARIA separator role](https://www.w3.org/TR/wai-aria-1.2/#separator). A separator divides content a screen reader should hear as separate, and it's announced with `role="separator"` and its `aria-orientation`. A decorative separator is only visual: it gets `role="none"`, so screen readers skip it. Use `decorative` only when the surrounding content already conveys the division. Either way, a separator never takes focus, so Tab moves past it.
234
+
235
+ ### Tested Behavior
236
+
237
+ Every line below is an automated test.
238
+
239
+ - A separator is announced with its orientation.
240
+ - A separator can't be focused.
241
+ - A separator carries its orientation for styling.
242
+
243
+ Runs in React, Vue and web components.