@senvenli/react 0.0.0-stage → 0.1.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 (636) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +32 -2
  3. package/dist/action/button-group.d.ts +26 -0
  4. package/dist/action/button-group.js +12 -0
  5. package/dist/action/button-group.js.map +1 -0
  6. package/dist/action/button.d.ts +42 -0
  7. package/dist/action/button.js +58 -0
  8. package/dist/action/button.js.map +1 -0
  9. package/dist/action/close-button.d.ts +12 -0
  10. package/dist/action/close-button.js +13 -0
  11. package/dist/action/close-button.js.map +1 -0
  12. package/dist/action/copy-button.d.ts +21 -0
  13. package/dist/action/copy-button.js +38 -0
  14. package/dist/action/copy-button.js.map +1 -0
  15. package/dist/action/fab.d.ts +29 -0
  16. package/dist/action/fab.js +57 -0
  17. package/dist/action/fab.js.map +1 -0
  18. package/dist/action/files.d.ts +70 -0
  19. package/dist/action/files.js +156 -0
  20. package/dist/action/files.js.map +1 -0
  21. package/dist/action/index.d.ts +23 -0
  22. package/dist/action/index.js +16 -0
  23. package/dist/action/index.js.map +1 -0
  24. package/dist/action/language-names.d.ts +19 -0
  25. package/dist/action/language-names.js +79 -0
  26. package/dist/action/language-names.js.map +1 -0
  27. package/dist/action/language-switcher.d.ts +57 -0
  28. package/dist/action/language-switcher.js +53 -0
  29. package/dist/action/language-switcher.js.map +1 -0
  30. package/dist/action/link-button.d.ts +57 -0
  31. package/dist/action/link-button.js +48 -0
  32. package/dist/action/link-button.js.map +1 -0
  33. package/dist/action/link.d.ts +24 -0
  34. package/dist/action/link.js +18 -0
  35. package/dist/action/link.js.map +1 -0
  36. package/dist/action/pressable.d.ts +40 -0
  37. package/dist/action/pressable.js +65 -0
  38. package/dist/action/pressable.js.map +1 -0
  39. package/dist/action/styles.d.ts +60 -0
  40. package/dist/action/styles.js +109 -0
  41. package/dist/action/styles.js.map +1 -0
  42. package/dist/action/theme-script.d.ts +12 -0
  43. package/dist/action/theme-script.js +23 -0
  44. package/dist/action/theme-script.js.map +1 -0
  45. package/dist/action/theme-switcher.d.ts +43 -0
  46. package/dist/action/theme-switcher.js +260 -0
  47. package/dist/action/theme-switcher.js.map +1 -0
  48. package/dist/action/theme-toggle.d.ts +43 -0
  49. package/dist/action/theme-toggle.js +259 -0
  50. package/dist/action/theme-toggle.js.map +1 -0
  51. package/dist/action/toggle.d.ts +44 -0
  52. package/dist/action/toggle.js +28 -0
  53. package/dist/action/toggle.js.map +1 -0
  54. package/dist/action/touch-target.d.ts +9 -0
  55. package/dist/action/touch-target.js +14 -0
  56. package/dist/action/touch-target.js.map +1 -0
  57. package/dist/charts/axis-width.d.ts +186 -0
  58. package/dist/charts/axis-width.js +1262 -0
  59. package/dist/charts/axis-width.js.map +1 -0
  60. package/dist/charts/bar-public.d.ts +16 -0
  61. package/dist/charts/bar-public.js +16 -0
  62. package/dist/charts/bar-public.js.map +1 -0
  63. package/dist/charts/chart-parts.d.ts +136 -0
  64. package/dist/charts/chart-parts.js +160 -0
  65. package/dist/charts/chart-parts.js.map +1 -0
  66. package/dist/charts/core-charts.d.ts +157 -0
  67. package/dist/charts/core-charts.js +505 -0
  68. package/dist/charts/core-charts.js.map +1 -0
  69. package/dist/charts/index.d.ts +12 -0
  70. package/dist/charts/index.js +8 -0
  71. package/dist/charts/index.js.map +1 -0
  72. package/dist/charts/list-charts.d.ts +124 -0
  73. package/dist/charts/list-charts.js +308 -0
  74. package/dist/charts/list-charts.js.map +1 -0
  75. package/dist/charts/more-charts.d.ts +138 -0
  76. package/dist/charts/more-charts.js +284 -0
  77. package/dist/charts/more-charts.js.map +1 -0
  78. package/dist/charts/report-charts.d.ts +138 -0
  79. package/dist/charts/report-charts.js +370 -0
  80. package/dist/charts/report-charts.js.map +1 -0
  81. package/dist/charts/value-tick.d.ts +178 -0
  82. package/dist/charts/value-tick.js +240 -0
  83. package/dist/charts/value-tick.js.map +1 -0
  84. package/dist/collection/data-table-url-hook.d.ts +34 -0
  85. package/dist/collection/data-table-url-hook.js +70 -0
  86. package/dist/collection/data-table-url-hook.js.map +1 -0
  87. package/dist/collection/data-table-url.d.ts +30 -0
  88. package/dist/collection/data-table-url.js +48 -0
  89. package/dist/collection/data-table-url.js.map +1 -0
  90. package/dist/collection/data-table.d.ts +112 -0
  91. package/dist/collection/data-table.js +188 -0
  92. package/dist/collection/data-table.js.map +1 -0
  93. package/dist/collection/grid-list-public.d.ts +18 -0
  94. package/dist/collection/grid-list-public.js +19 -0
  95. package/dist/collection/grid-list-public.js.map +1 -0
  96. package/dist/collection/grid-list.d.ts +73 -0
  97. package/dist/collection/grid-list.js +46 -0
  98. package/dist/collection/grid-list.js.map +1 -0
  99. package/dist/collection/index.d.ts +14 -0
  100. package/dist/collection/index.js +8 -0
  101. package/dist/collection/index.js.map +1 -0
  102. package/dist/collection/list.d.ts +61 -0
  103. package/dist/collection/list.js +38 -0
  104. package/dist/collection/list.js.map +1 -0
  105. package/dist/collection/selection-checkbox.d.ts +5 -0
  106. package/dist/collection/selection-checkbox.js +13 -0
  107. package/dist/collection/selection-checkbox.js.map +1 -0
  108. package/dist/collection/table.d.ts +91 -0
  109. package/dist/collection/table.js +183 -0
  110. package/dist/collection/table.js.map +1 -0
  111. package/dist/collection/tree.d.ts +31 -0
  112. package/dist/collection/tree.js +22 -0
  113. package/dist/collection/tree.js.map +1 -0
  114. package/dist/color/color.d.ts +87 -0
  115. package/dist/color/color.js +200 -0
  116. package/dist/color/color.js.map +1 -0
  117. package/dist/color/contrast.d.ts +34 -0
  118. package/dist/color/contrast.js +44 -0
  119. package/dist/color/contrast.js.map +1 -0
  120. package/dist/color/index.d.ts +4 -0
  121. package/dist/color/index.js +5 -0
  122. package/dist/color/index.js.map +1 -0
  123. package/dist/date/calendar.d.ts +71 -0
  124. package/dist/date/calendar.js +291 -0
  125. package/dist/date/calendar.js.map +1 -0
  126. package/dist/date/fields.d.ts +174 -0
  127. package/dist/date/fields.js +250 -0
  128. package/dist/date/fields.js.map +1 -0
  129. package/dist/date/index.d.ts +7 -0
  130. package/dist/date/index.js +6 -0
  131. package/dist/date/index.js.map +1 -0
  132. package/dist/date/month-grid.d.ts +31 -0
  133. package/dist/date/month-grid.js +115 -0
  134. package/dist/date/month-grid.js.map +1 -0
  135. package/dist/date/pickers.d.ts +118 -0
  136. package/dist/date/pickers.js +176 -0
  137. package/dist/date/pickers.js.map +1 -0
  138. package/dist/date/public.d.ts +25 -0
  139. package/dist/date/public.js +24 -0
  140. package/dist/date/public.js.map +1 -0
  141. package/dist/date/segments.d.ts +153 -0
  142. package/dist/date/segments.js +433 -0
  143. package/dist/date/segments.js.map +1 -0
  144. package/dist/defaults.d.ts +74 -0
  145. package/dist/defaults.js +100 -0
  146. package/dist/defaults.js.map +1 -0
  147. package/dist/density.d.ts +2 -0
  148. package/dist/density.js +2 -0
  149. package/dist/density.js.map +1 -0
  150. package/dist/display/avatar.d.ts +29 -0
  151. package/dist/display/avatar.js +71 -0
  152. package/dist/display/avatar.js.map +1 -0
  153. package/dist/display/badge.d.ts +65 -0
  154. package/dist/display/badge.js +99 -0
  155. package/dist/display/badge.js.map +1 -0
  156. package/dist/display/card.d.ts +72 -0
  157. package/dist/display/card.js +91 -0
  158. package/dist/display/card.js.map +1 -0
  159. package/dist/display/carousel.d.ts +47 -0
  160. package/dist/display/carousel.js +214 -0
  161. package/dist/display/carousel.js.map +1 -0
  162. package/dist/display/description-list.d.ts +25 -0
  163. package/dist/display/description-list.js +36 -0
  164. package/dist/display/description-list.js.map +1 -0
  165. package/dist/display/icon-aliases.d.ts +1 -0
  166. package/dist/display/icon-aliases.js +259 -0
  167. package/dist/display/icon-aliases.js.map +1 -0
  168. package/dist/display/icon-names.d.ts +4 -0
  169. package/dist/display/icon-names.js +2 -0
  170. package/dist/display/icon-names.js.map +1 -0
  171. package/dist/display/icon.d.ts +51 -0
  172. package/dist/display/icon.js +96 -0
  173. package/dist/display/icon.js.map +1 -0
  174. package/dist/display/image-crop.d.ts +106 -0
  175. package/dist/display/image-crop.js +117 -0
  176. package/dist/display/image-crop.js.map +1 -0
  177. package/dist/display/image-cropper.d.ts +68 -0
  178. package/dist/display/image-cropper.js +284 -0
  179. package/dist/display/image-cropper.js.map +1 -0
  180. package/dist/display/image-viewer.d.ts +54 -0
  181. package/dist/display/image-viewer.js +84 -0
  182. package/dist/display/image-viewer.js.map +1 -0
  183. package/dist/display/image.d.ts +26 -0
  184. package/dist/display/image.js +17 -0
  185. package/dist/display/image.js.map +1 -0
  186. package/dist/display/index.d.ts +29 -0
  187. package/dist/display/index.js +16 -0
  188. package/dist/display/index.js.map +1 -0
  189. package/dist/display/iso-chip.d.ts +19 -0
  190. package/dist/display/iso-chip.js +21 -0
  191. package/dist/display/iso-chip.js.map +1 -0
  192. package/dist/display/kbd.d.ts +11 -0
  193. package/dist/display/kbd.js +33 -0
  194. package/dist/display/kbd.js.map +1 -0
  195. package/dist/display/lozenge.d.ts +30 -0
  196. package/dist/display/lozenge.js +55 -0
  197. package/dist/display/lozenge.js.map +1 -0
  198. package/dist/display/scroll-area.d.ts +29 -0
  199. package/dist/display/scroll-area.js +95 -0
  200. package/dist/display/scroll-area.js.map +1 -0
  201. package/dist/display/separator.d.ts +13 -0
  202. package/dist/display/separator.js +24 -0
  203. package/dist/display/separator.js.map +1 -0
  204. package/dist/display/stat.d.ts +35 -0
  205. package/dist/display/stat.js +41 -0
  206. package/dist/display/stat.js.map +1 -0
  207. package/dist/display/timeline.d.ts +44 -0
  208. package/dist/display/timeline.js +111 -0
  209. package/dist/display/timeline.js.map +1 -0
  210. package/dist/display/typography.d.ts +37 -0
  211. package/dist/display/typography.js +53 -0
  212. package/dist/display/typography.js.map +1 -0
  213. package/dist/display/visually-hidden.d.ts +14 -0
  214. package/dist/display/visually-hidden.js +10 -0
  215. package/dist/display/visually-hidden.js.map +1 -0
  216. package/dist/feedback/banner.d.ts +46 -0
  217. package/dist/feedback/banner.js +157 -0
  218. package/dist/feedback/banner.js.map +1 -0
  219. package/dist/feedback/cooldown.d.ts +17 -0
  220. package/dist/feedback/cooldown.js +59 -0
  221. package/dist/feedback/cooldown.js.map +1 -0
  222. package/dist/feedback/empty-state.d.ts +35 -0
  223. package/dist/feedback/empty-state.js +39 -0
  224. package/dist/feedback/empty-state.js.map +1 -0
  225. package/dist/feedback/index.d.ts +12 -0
  226. package/dist/feedback/index.js +11 -0
  227. package/dist/feedback/index.js.map +1 -0
  228. package/dist/feedback/meter.d.ts +33 -0
  229. package/dist/feedback/meter.js +42 -0
  230. package/dist/feedback/meter.js.map +1 -0
  231. package/dist/feedback/motion.d.ts +9 -0
  232. package/dist/feedback/motion.js +57 -0
  233. package/dist/feedback/motion.js.map +1 -0
  234. package/dist/feedback/progress.d.ts +39 -0
  235. package/dist/feedback/progress.js +68 -0
  236. package/dist/feedback/progress.js.map +1 -0
  237. package/dist/feedback/skeleton.d.ts +48 -0
  238. package/dist/feedback/skeleton.js +61 -0
  239. package/dist/feedback/skeleton.js.map +1 -0
  240. package/dist/feedback/spinner.d.ts +19 -0
  241. package/dist/feedback/spinner.js +29 -0
  242. package/dist/feedback/spinner.js.map +1 -0
  243. package/dist/feedback/status-dot.d.ts +23 -0
  244. package/dist/feedback/status-dot.js +37 -0
  245. package/dist/feedback/status-dot.js.map +1 -0
  246. package/dist/form/countries.d.ts +34 -0
  247. package/dist/form/countries.js +273 -0
  248. package/dist/form/countries.js.map +1 -0
  249. package/dist/form/data-attributes.d.ts +11 -0
  250. package/dist/form/data-attributes.js +22 -0
  251. package/dist/form/data-attributes.js.map +1 -0
  252. package/dist/form/field-parts.d.ts +113 -0
  253. package/dist/form/field-parts.js +178 -0
  254. package/dist/form/field-parts.js.map +1 -0
  255. package/dist/form/field.d.ts +36 -0
  256. package/dist/form/field.js +65 -0
  257. package/dist/form/field.js.map +1 -0
  258. package/dist/form/files.d.ts +70 -0
  259. package/dist/form/files.js +156 -0
  260. package/dist/form/files.js.map +1 -0
  261. package/dist/form/form.d.ts +40 -0
  262. package/dist/form/form.js +74 -0
  263. package/dist/form/form.js.map +1 -0
  264. package/dist/form/image-crop.d.ts +106 -0
  265. package/dist/form/image-crop.js +117 -0
  266. package/dist/form/image-crop.js.map +1 -0
  267. package/dist/form/image-cropper.d.ts +68 -0
  268. package/dist/form/image-cropper.js +284 -0
  269. package/dist/form/image-cropper.js.map +1 -0
  270. package/dist/form/index.d.ts +24 -0
  271. package/dist/form/index.js +15 -0
  272. package/dist/form/index.js.map +1 -0
  273. package/dist/form/input-group.d.ts +63 -0
  274. package/dist/form/input-group.js +63 -0
  275. package/dist/form/input-group.js.map +1 -0
  276. package/dist/form/input-otp.d.ts +35 -0
  277. package/dist/form/input-otp.js +83 -0
  278. package/dist/form/input-otp.js.map +1 -0
  279. package/dist/form/input.d.ts +36 -0
  280. package/dist/form/input.js +41 -0
  281. package/dist/form/input.js.map +1 -0
  282. package/dist/form/number-field.d.ts +84 -0
  283. package/dist/form/number-field.js +81 -0
  284. package/dist/form/number-field.js.map +1 -0
  285. package/dist/form/otp-field.d.ts +37 -0
  286. package/dist/form/otp-field.js +116 -0
  287. package/dist/form/otp-field.js.map +1 -0
  288. package/dist/form/password-field.d.ts +61 -0
  289. package/dist/form/password-field.js +61 -0
  290. package/dist/form/password-field.js.map +1 -0
  291. package/dist/form/phone-field.d.ts +104 -0
  292. package/dist/form/phone-field.js +275 -0
  293. package/dist/form/phone-field.js.map +1 -0
  294. package/dist/form/phone-paste.d.ts +24 -0
  295. package/dist/form/phone-paste.js +40 -0
  296. package/dist/form/phone-paste.js.map +1 -0
  297. package/dist/form/phone.d.ts +159 -0
  298. package/dist/form/phone.js +309 -0
  299. package/dist/form/phone.js.map +1 -0
  300. package/dist/form/search-field.d.ts +29 -0
  301. package/dist/form/search-field.js +23 -0
  302. package/dist/form/search-field.js.map +1 -0
  303. package/dist/form/styles.d.ts +31 -0
  304. package/dist/form/styles.js +43 -0
  305. package/dist/form/styles.js.map +1 -0
  306. package/dist/form/text-area.d.ts +70 -0
  307. package/dist/form/text-area.js +93 -0
  308. package/dist/form/text-area.js.map +1 -0
  309. package/dist/form/text-field.d.ts +131 -0
  310. package/dist/form/text-field.js +59 -0
  311. package/dist/form/text-field.js.map +1 -0
  312. package/dist/form/validation.d.ts +145 -0
  313. package/dist/form/validation.js +136 -0
  314. package/dist/form/validation.js.map +1 -0
  315. package/dist/i18n.d.ts +438 -0
  316. package/dist/i18n.js +948 -0
  317. package/dist/i18n.js.map +1 -0
  318. package/dist/index.d.ts +9 -0
  319. package/dist/index.js +7 -0
  320. package/dist/index.js.map +1 -0
  321. package/dist/intl-locale.d.ts +30 -0
  322. package/dist/intl-locale.js +83 -0
  323. package/dist/intl-locale.js.map +1 -0
  324. package/dist/layers.d.ts +32 -0
  325. package/dist/layers.js +33 -0
  326. package/dist/layers.js.map +1 -0
  327. package/dist/layout/auth-form-layout.d.ts +71 -0
  328. package/dist/layout/auth-form-layout.js +61 -0
  329. package/dist/layout/auth-form-layout.js.map +1 -0
  330. package/dist/layout/auth-layout.d.ts +59 -0
  331. package/dist/layout/auth-layout.js +26 -0
  332. package/dist/layout/auth-layout.js.map +1 -0
  333. package/dist/layout/box.d.ts +26 -0
  334. package/dist/layout/box.js +16 -0
  335. package/dist/layout/box.js.map +1 -0
  336. package/dist/layout/grid.d.ts +27 -0
  337. package/dist/layout/grid.js +26 -0
  338. package/dist/layout/grid.js.map +1 -0
  339. package/dist/layout/index.d.ts +16 -0
  340. package/dist/layout/index.js +12 -0
  341. package/dist/layout/index.js.map +1 -0
  342. package/dist/layout/pressable.d.ts +40 -0
  343. package/dist/layout/pressable.js +65 -0
  344. package/dist/layout/pressable.js.map +1 -0
  345. package/dist/layout/reset-sent-card.d.ts +39 -0
  346. package/dist/layout/reset-sent-card.js +22 -0
  347. package/dist/layout/reset-sent-card.js.map +1 -0
  348. package/dist/layout/scroll-area.d.ts +29 -0
  349. package/dist/layout/scroll-area.js +95 -0
  350. package/dist/layout/scroll-area.js.map +1 -0
  351. package/dist/layout/section.d.ts +41 -0
  352. package/dist/layout/section.js +22 -0
  353. package/dist/layout/section.js.map +1 -0
  354. package/dist/layout/split.d.ts +50 -0
  355. package/dist/layout/split.js +35 -0
  356. package/dist/layout/split.js.map +1 -0
  357. package/dist/layout/stack.d.ts +44 -0
  358. package/dist/layout/stack.js +36 -0
  359. package/dist/layout/stack.js.map +1 -0
  360. package/dist/layout/tokens.d.ts +33 -0
  361. package/dist/layout/tokens.js +85 -0
  362. package/dist/layout/tokens.js.map +1 -0
  363. package/dist/layout/toolbar.d.ts +37 -0
  364. package/dist/layout/toolbar.js +334 -0
  365. package/dist/layout/toolbar.js.map +1 -0
  366. package/dist/navigate-context.d.ts +12 -0
  367. package/dist/navigate-context.js +13 -0
  368. package/dist/navigate-context.js.map +1 -0
  369. package/dist/navigation/accordion.d.ts +40 -0
  370. package/dist/navigation/accordion.js +33 -0
  371. package/dist/navigation/accordion.js.map +1 -0
  372. package/dist/navigation/bottom-nav.d.ts +29 -0
  373. package/dist/navigation/bottom-nav.js +48 -0
  374. package/dist/navigation/bottom-nav.js.map +1 -0
  375. package/dist/navigation/brand-link-context.d.ts +8 -0
  376. package/dist/navigation/brand-link-context.js +9 -0
  377. package/dist/navigation/brand-link-context.js.map +1 -0
  378. package/dist/navigation/breadcrumbs.d.ts +36 -0
  379. package/dist/navigation/breadcrumbs.js +51 -0
  380. package/dist/navigation/breadcrumbs.js.map +1 -0
  381. package/dist/navigation/dock.d.ts +27 -0
  382. package/dist/navigation/dock.js +47 -0
  383. package/dist/navigation/dock.js.map +1 -0
  384. package/dist/navigation/footer.d.ts +43 -0
  385. package/dist/navigation/footer.js +43 -0
  386. package/dist/navigation/footer.js.map +1 -0
  387. package/dist/navigation/index.d.ts +22 -0
  388. package/dist/navigation/index.js +17 -0
  389. package/dist/navigation/index.js.map +1 -0
  390. package/dist/navigation/language-names.d.ts +19 -0
  391. package/dist/navigation/language-names.js +79 -0
  392. package/dist/navigation/language-names.js.map +1 -0
  393. package/dist/navigation/language-switcher.d.ts +55 -0
  394. package/dist/navigation/language-switcher.js +53 -0
  395. package/dist/navigation/language-switcher.js.map +1 -0
  396. package/dist/navigation/nav-panel.d.ts +18 -0
  397. package/dist/navigation/nav-panel.js +51 -0
  398. package/dist/navigation/nav-panel.js.map +1 -0
  399. package/dist/navigation/navbar.d.ts +73 -0
  400. package/dist/navigation/navbar.js +64 -0
  401. package/dist/navigation/navbar.js.map +1 -0
  402. package/dist/navigation/page-header.d.ts +37 -0
  403. package/dist/navigation/page-header.js +50 -0
  404. package/dist/navigation/page-header.js.map +1 -0
  405. package/dist/navigation/pagination.d.ts +25 -0
  406. package/dist/navigation/pagination.js +51 -0
  407. package/dist/navigation/pagination.js.map +1 -0
  408. package/dist/navigation/panel-header.d.ts +37 -0
  409. package/dist/navigation/panel-header.js +50 -0
  410. package/dist/navigation/panel-header.js.map +1 -0
  411. package/dist/navigation/sidebar-script.d.ts +12 -0
  412. package/dist/navigation/sidebar-script.js +20 -0
  413. package/dist/navigation/sidebar-script.js.map +1 -0
  414. package/dist/navigation/sidebar.d.ts +149 -0
  415. package/dist/navigation/sidebar.js +332 -0
  416. package/dist/navigation/sidebar.js.map +1 -0
  417. package/dist/navigation/skip-link.d.ts +12 -0
  418. package/dist/navigation/skip-link.js +30 -0
  419. package/dist/navigation/skip-link.js.map +1 -0
  420. package/dist/navigation/stepper.d.ts +50 -0
  421. package/dist/navigation/stepper.js +96 -0
  422. package/dist/navigation/stepper.js.map +1 -0
  423. package/dist/navigation/tabs.d.ts +84 -0
  424. package/dist/navigation/tabs.js +118 -0
  425. package/dist/navigation/tabs.js.map +1 -0
  426. package/dist/navigation/toolbar.d.ts +37 -0
  427. package/dist/navigation/toolbar.js +334 -0
  428. package/dist/navigation/toolbar.js.map +1 -0
  429. package/dist/overlay/alert-dialog.d.ts +63 -0
  430. package/dist/overlay/alert-dialog.js +76 -0
  431. package/dist/overlay/alert-dialog.js.map +1 -0
  432. package/dist/overlay/command-palette.d.ts +53 -0
  433. package/dist/overlay/command-palette.js +130 -0
  434. package/dist/overlay/command-palette.js.map +1 -0
  435. package/dist/overlay/command.d.ts +53 -0
  436. package/dist/overlay/command.js +129 -0
  437. package/dist/overlay/command.js.map +1 -0
  438. package/dist/overlay/context-menu.d.ts +29 -0
  439. package/dist/overlay/context-menu.js +58 -0
  440. package/dist/overlay/context-menu.js.map +1 -0
  441. package/dist/overlay/dialog.d.ts +162 -0
  442. package/dist/overlay/dialog.js +174 -0
  443. package/dist/overlay/dialog.js.map +1 -0
  444. package/dist/overlay/drawer.d.ts +41 -0
  445. package/dist/overlay/drawer.js +114 -0
  446. package/dist/overlay/drawer.js.map +1 -0
  447. package/dist/overlay/floating.d.ts +142 -0
  448. package/dist/overlay/floating.js +226 -0
  449. package/dist/overlay/floating.js.map +1 -0
  450. package/dist/overlay/hover-card.d.ts +19 -0
  451. package/dist/overlay/hover-card.js +31 -0
  452. package/dist/overlay/hover-card.js.map +1 -0
  453. package/dist/overlay/index.d.ts +18 -0
  454. package/dist/overlay/index.js +12 -0
  455. package/dist/overlay/index.js.map +1 -0
  456. package/dist/overlay/overlay-base.d.ts +105 -0
  457. package/dist/overlay/overlay-base.js +250 -0
  458. package/dist/overlay/overlay-base.js.map +1 -0
  459. package/dist/overlay/overlay.d.ts +299 -0
  460. package/dist/overlay/overlay.js +558 -0
  461. package/dist/overlay/overlay.js.map +1 -0
  462. package/dist/overlay/toast.d.ts +58 -0
  463. package/dist/overlay/toast.js +145 -0
  464. package/dist/overlay/toast.js.map +1 -0
  465. package/dist/provider.d.ts +26 -0
  466. package/dist/provider.js +30 -0
  467. package/dist/provider.js.map +1 -0
  468. package/dist/selection/autocomplete.d.ts +54 -0
  469. package/dist/selection/autocomplete.js +122 -0
  470. package/dist/selection/autocomplete.js.map +1 -0
  471. package/dist/selection/checkbox.d.ts +56 -0
  472. package/dist/selection/checkbox.js +49 -0
  473. package/dist/selection/checkbox.js.map +1 -0
  474. package/dist/selection/choice-size.d.ts +26 -0
  475. package/dist/selection/choice-size.js +50 -0
  476. package/dist/selection/choice-size.js.map +1 -0
  477. package/dist/selection/choice-text.d.ts +21 -0
  478. package/dist/selection/choice-text.js +33 -0
  479. package/dist/selection/choice-text.js.map +1 -0
  480. package/dist/selection/combobox.d.ts +173 -0
  481. package/dist/selection/combobox.js +410 -0
  482. package/dist/selection/combobox.js.map +1 -0
  483. package/dist/selection/index.d.ts +20 -0
  484. package/dist/selection/index.js +13 -0
  485. package/dist/selection/index.js.map +1 -0
  486. package/dist/selection/list-box.d.ts +30 -0
  487. package/dist/selection/list-box.js +16 -0
  488. package/dist/selection/list-box.js.map +1 -0
  489. package/dist/selection/listbox.d.ts +44 -0
  490. package/dist/selection/listbox.js +49 -0
  491. package/dist/selection/listbox.js.map +1 -0
  492. package/dist/selection/match.d.ts +20 -0
  493. package/dist/selection/match.js +57 -0
  494. package/dist/selection/match.js.map +1 -0
  495. package/dist/selection/multi-select.d.ts +72 -0
  496. package/dist/selection/multi-select.js +138 -0
  497. package/dist/selection/multi-select.js.map +1 -0
  498. package/dist/selection/radio-card.d.ts +31 -0
  499. package/dist/selection/radio-card.js +29 -0
  500. package/dist/selection/radio-card.js.map +1 -0
  501. package/dist/selection/radio.d.ts +72 -0
  502. package/dist/selection/radio.js +64 -0
  503. package/dist/selection/radio.js.map +1 -0
  504. package/dist/selection/select-public.d.ts +19 -0
  505. package/dist/selection/select-public.js +24 -0
  506. package/dist/selection/select-public.js.map +1 -0
  507. package/dist/selection/select.d.ts +72 -0
  508. package/dist/selection/select.js +69 -0
  509. package/dist/selection/select.js.map +1 -0
  510. package/dist/selection/slider.d.ts +16 -0
  511. package/dist/selection/slider.js +44 -0
  512. package/dist/selection/slider.js.map +1 -0
  513. package/dist/selection/styles.d.ts +26 -0
  514. package/dist/selection/styles.js +78 -0
  515. package/dist/selection/styles.js.map +1 -0
  516. package/dist/selection/switch.d.ts +24 -0
  517. package/dist/selection/switch.js +27 -0
  518. package/dist/selection/switch.js.map +1 -0
  519. package/dist/selection/tag-group.d.ts +38 -0
  520. package/dist/selection/tag-group.js +45 -0
  521. package/dist/selection/tag-group.js.map +1 -0
  522. package/dist/tone.d.ts +6 -0
  523. package/dist/tone.js +2 -0
  524. package/dist/tone.js.map +1 -0
  525. package/dist/utils.d.ts +9 -0
  526. package/dist/utils.js +42 -0
  527. package/dist/utils.js.map +1 -0
  528. package/manifest/component.full.schema.json +391 -0
  529. package/manifest/component.schema.json +279 -0
  530. package/manifests/accordion.json +299 -0
  531. package/manifests/alert-dialog.json +261 -0
  532. package/manifests/area-chart.json +338 -0
  533. package/manifests/autocomplete.json +299 -0
  534. package/manifests/avatar.json +253 -0
  535. package/manifests/badge.json +288 -0
  536. package/manifests/banner.json +185 -0
  537. package/manifests/bar-chart.json +454 -0
  538. package/manifests/bar-list.json +262 -0
  539. package/manifests/bottom-nav.json +139 -0
  540. package/manifests/box.json +3450 -0
  541. package/manifests/breadcrumbs.json +199 -0
  542. package/manifests/button-group.json +2294 -0
  543. package/manifests/button.json +1211 -0
  544. package/manifests/calendar-heatmap.json +218 -0
  545. package/manifests/calendar.json +299 -0
  546. package/manifests/card.json +308 -0
  547. package/manifests/carousel.json +263 -0
  548. package/manifests/chart-parts.json +309 -0
  549. package/manifests/checkbox.json +998 -0
  550. package/manifests/close-button.json +1000 -0
  551. package/manifests/color-field.json +276 -0
  552. package/manifests/color-picker.json +161 -0
  553. package/manifests/color-swatch-picker.json +220 -0
  554. package/manifests/color-swatch.json +140 -0
  555. package/manifests/combobox.json +581 -0
  556. package/manifests/command.json +275 -0
  557. package/manifests/composed-chart.json +287 -0
  558. package/manifests/context-menu.json +148 -0
  559. package/manifests/copy-button.json +192 -0
  560. package/manifests/data-table.json +334 -0
  561. package/manifests/date-field.json +302 -0
  562. package/manifests/date-picker.json +472 -0
  563. package/manifests/description-list.json +201 -0
  564. package/manifests/dialog.json +322 -0
  565. package/manifests/donut-chart.json +264 -0
  566. package/manifests/drawer.json +211 -0
  567. package/manifests/empty-state.json +185 -0
  568. package/manifests/fab.json +172 -0
  569. package/manifests/field.json +209 -0
  570. package/manifests/file-upload.json +791 -0
  571. package/manifests/form.json +829 -0
  572. package/manifests/funnel-chart.json +223 -0
  573. package/manifests/gauge-chart.json +252 -0
  574. package/manifests/grid-list.json +335 -0
  575. package/manifests/grid.json +3482 -0
  576. package/manifests/heading.json +183 -0
  577. package/manifests/heatmap.json +265 -0
  578. package/manifests/hover-card.json +172 -0
  579. package/manifests/icon.json +201 -0
  580. package/manifests/image-cropper.json +295 -0
  581. package/manifests/image-viewer.json +198 -0
  582. package/manifests/image.json +193 -0
  583. package/manifests/index.json +2035 -0
  584. package/manifests/input-group.json +3571 -0
  585. package/manifests/input.json +1557 -0
  586. package/manifests/kbd.json +98 -0
  587. package/manifests/language-switcher.json +274 -0
  588. package/manifests/line-chart.json +342 -0
  589. package/manifests/link.json +867 -0
  590. package/manifests/list-box.json +213 -0
  591. package/manifests/menu.json +453 -0
  592. package/manifests/meter.json +145 -0
  593. package/manifests/navbar.json +281 -0
  594. package/manifests/otp-field.json +1029 -0
  595. package/manifests/page-header.json +164 -0
  596. package/manifests/pagination.json +181 -0
  597. package/manifests/popover.json +205 -0
  598. package/manifests/pressable.json +367 -0
  599. package/manifests/progress.json +282 -0
  600. package/manifests/radar-chart.json +229 -0
  601. package/manifests/radial-chart.json +195 -0
  602. package/manifests/radio.json +975 -0
  603. package/manifests/scatter-chart.json +277 -0
  604. package/manifests/scroll-area.json +127 -0
  605. package/manifests/section.json +169 -0
  606. package/manifests/select.json +474 -0
  607. package/manifests/separator.json +119 -0
  608. package/manifests/sidebar.json +584 -0
  609. package/manifests/skeleton.json +235 -0
  610. package/manifests/skip-link.json +89 -0
  611. package/manifests/slider.json +706 -0
  612. package/manifests/sparkline.json +208 -0
  613. package/manifests/spinner.json +105 -0
  614. package/manifests/split.json +6618 -0
  615. package/manifests/stack.json +3541 -0
  616. package/manifests/stat.json +192 -0
  617. package/manifests/stepper.json +279 -0
  618. package/manifests/switch.json +205 -0
  619. package/manifests/table.json +375 -0
  620. package/manifests/tabs.json +438 -0
  621. package/manifests/tag-group.json +264 -0
  622. package/manifests/text-area.json +1136 -0
  623. package/manifests/text.json +244 -0
  624. package/manifests/theme-switcher.json +152 -0
  625. package/manifests/time-field.json +284 -0
  626. package/manifests/timeline.json +196 -0
  627. package/manifests/toast.json +87 -0
  628. package/manifests/toggle-button.json +1489 -0
  629. package/manifests/toolbar.json +145 -0
  630. package/manifests/tooltip.json +181 -0
  631. package/manifests/tracker.json +192 -0
  632. package/manifests/tree.json +245 -0
  633. package/manifests/visually-hidden.json +114 -0
  634. package/package.json +117 -3
  635. package/styles/base.css +56 -0
  636. package/styles/theme.css +154 -0
@@ -0,0 +1,96 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Button as AriaButton, useLocale } from "react-aria-components";
5
+ import { cn } from "../utils.js";
6
+ import { IconGlyph } from "../display/icon.js";
7
+ import { progressStepsLabel, stepDoneLabel, stepFailedLabel, stepLabel, stepNeedsYouLabel, stepNowLabel, stepOfLabel, stepsAllDoneLabel, stepWithProviderLabel, } from "../i18n.js";
8
+ /** Per status: icon, bold fill, the text colour on that fill (its own on-colour, for contrast), words. */
9
+ const STATUS = {
10
+ "needs-you": { icon: "circle-alert", bar: "bg-ds-background-warning-bold", on: "text-ds-text-on-warning", text: "text-ds-text-warning", words: stepNeedsYouLabel },
11
+ "with-provider": { icon: "clock", bar: "bg-ds-background-information-bold", on: "text-ds-text-on-bold", text: "text-ds-text-information", words: stepWithProviderLabel },
12
+ failed: { icon: "circle-x", bar: "bg-ds-background-danger-bold", on: "text-ds-text-on-danger", text: "text-ds-text-danger", words: stepFailedLabel },
13
+ };
14
+ function resolve(props, locale) {
15
+ const { steps, currentStep, isComplete } = props;
16
+ const currentIndex = Math.max(0, steps.findIndex((step) => step.id === currentStep));
17
+ const marked = steps.some((step) => step.isDone !== undefined);
18
+ const done = new Set((marked ? steps.filter((step) => step.isDone) : steps.slice(0, currentIndex)).map((step) => step.id));
19
+ const journey = props.showStatus ?? steps.some((step) => step.status !== undefined);
20
+ return steps.map((step, index) => {
21
+ const state = isComplete ? "done" : step.id === steps[currentIndex]?.id ? "current" : done.has(step.id) ? "done" : "upcoming";
22
+ const status = step.status;
23
+ const words = step.statusText ??
24
+ (status ? STATUS[status].words(locale) : journey && state === "done" ? stepDoneLabel(locale) : journey && state === "current" ? stepNowLabel(locale) : undefined);
25
+ const icon = status ? STATUS[status].icon : journey && state === "done" ? "check" : undefined;
26
+ return { ...step, index, state, status, words, icon, hasText: step.statusText !== undefined };
27
+ });
28
+ }
29
+ /**
30
+ * Progress through an ordered flow and where the reader is in it. Horizontal: one 4px bar per step,
31
+ * "Step 3" over the name; in a container narrower than 36rem it becomes one line ("Step 3 / 5 · Domain")
32
+ * over a single bar, so a name never breaks letter by letter. Vertical: 24px nodes on a rail. A step's
33
+ * status is said in words and an icon, never by colour alone. `isComplete` shows a finished flow: every
34
+ * step done, none current.
35
+ */
36
+ export function Stepper(props) {
37
+ const { locale } = useLocale();
38
+ const steps = resolve(props, locale);
39
+ // A finished flow has no current step, so its currentStep is not checked.
40
+ const unknownStep = !props.isComplete && !props.steps.some((step) => step.id === props.currentStep);
41
+ // Once per unknown id: not on every render, nor twice under StrictMode's re-run of effects.
42
+ const warned = React.useRef(null);
43
+ React.useEffect(() => {
44
+ if (!unknownStep || warned.current === props.currentStep)
45
+ return;
46
+ warned.current = props.currentStep;
47
+ console.warn(`Stepper: currentStep "${props.currentStep}" is not one of the steps; the first step is shown as current.`);
48
+ }, [unknownStep, props.currentStep]);
49
+ // A finished flow with a step still failed or waiting on the reader says two opposite things: tell the
50
+ // developer, once per set of such steps. Development only, as Select's missing-name warning.
51
+ const contradicted = props.isComplete
52
+ ? steps.filter((step) => step.status === "failed" || step.status === "needs-you").map((step) => step.id).join(", ")
53
+ : "";
54
+ const warnedContradiction = React.useRef("");
55
+ React.useEffect(() => {
56
+ if (process.env.NODE_ENV === "production" || !contradicted || warnedContradiction.current === contradicted)
57
+ return;
58
+ warnedContradiction.current = contradicted;
59
+ console.warn(`Stepper: isComplete with a "failed" or "needs-you" step (${contradicted}) contradicts itself; settle the step before marking the flow complete.`);
60
+ }, [contradicted]);
61
+ const label = props["aria-label"] ?? progressStepsLabel(locale);
62
+ // Finished: the overall state is part of the name, which every screen reader says on entering the list.
63
+ const name = props.isComplete ? `${label}, ${stepsAllDoneLabel(locale)}` : label;
64
+ const complete = props.isComplete || undefined;
65
+ return props.orientation === "vertical" ? (_jsx(Vertical, { steps: steps, name: name, onStepPress: props.onStepPress, locale: locale, label: label, complete: complete })) : (_jsx(Horizontal, { steps: steps, name: name, onStepPress: props.onStepPress, locale: locale, label: label, complete: complete }));
66
+ }
67
+ /** The step name: a button back to a done step when the flow allows it, plain text otherwise. */
68
+ function StepName({ step, onStepPress, className }) {
69
+ if (step.state === "done" && onStepPress) {
70
+ return (_jsx(AriaButton, { onPress: () => onStepPress(step.id), "data-slot": "stepper-step-button", className: cn(className, "cursor-pointer rounded-ds-small text-start outline-hidden data-[hovered]:underline data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused"), children: step.label }));
71
+ }
72
+ return _jsx("span", { className: className, children: step.label });
73
+ }
74
+ function StatusWords({ step, locale }) {
75
+ // Outside a journey a done step shows only its bar or check; screen readers still hear that it is done.
76
+ if (!step.words)
77
+ return step.state === "done" ? _jsx("span", { className: "sr-only", children: `, ${stepDoneLabel(locale)}` }) : null;
78
+ return (_jsxs("span", { "data-slot": "stepper-step-status", className: cn("flex items-center gap-ds-050 text-body-small", step.status ? STATUS[step.status].text : "text-ds-text-subtlest"), children: [step.icon && _jsx(IconGlyph, { name: step.icon, size: "small" }), step.words] }));
79
+ }
80
+ function Horizontal({ steps, name, label, onStepPress, locale, complete }) {
81
+ const current = steps.find((step) => step.state === "current") ?? steps[0];
82
+ const fill = complete ? 100 : ((current.index + 1) / steps.length) * 100;
83
+ return (_jsxs("div", { "data-slot": "stepper", "data-orientation": "horizontal", "data-complete": complete && "", className: "@container", children: [_jsx("ol", { "aria-label": name, className: "m-0 hidden list-none gap-ds-100 p-0 @min-[36rem]:flex", children: steps.map((step) => (_jsxs("li", { "data-slot": "stepper-step", "data-state": step.state, "data-status": step.status, "aria-current": step.state === "current" ? "step" : undefined, className: "flex min-w-0 flex-1 flex-col gap-ds-100", children: [_jsx("span", { "aria-hidden": true, "data-slot": "stepper-step-bar", className: cn("h-1 rounded-ds-full", step.status ? STATUS[step.status].bar : step.state === "upcoming" ? "bg-ds-background-neutral-pressed" : "bg-ds-background-brand-bold") }), _jsxs("span", { className: "flex min-w-0 flex-col", children: [_jsx("span", { className: "text-body-small text-ds-text-subtlest", children: stepLabel(locale, step.index + 1) }), _jsx(StepName, { step: step, onStepPress: onStepPress, className: cn("text-body [overflow-wrap:normal] [word-break:normal] hyphens-auto", step.state === "current" ? "font-[600] text-ds-text" : step.state === "done" ? "font-[500] text-ds-text" : "font-[500] text-ds-text-subtle") }), _jsx(StatusWords, { step: step, locale: locale })] })] }, step.id))) }), _jsxs("div", { role: "group", "aria-label": complete ? label : name, "data-slot": "stepper-compact", className: "flex flex-col gap-ds-100 @min-[36rem]:hidden", children: [complete ? (_jsxs(_Fragment, { children: [_jsxs("p", { "data-slot": "stepper-compact-done", className: "m-0 flex items-center gap-ds-050 text-body font-[600] text-ds-text", children: [_jsx(IconGlyph, { name: "check", size: "small", strokeWidth: 3 }), stepsAllDoneLabel(locale)] }), steps
84
+ .filter((step) => step.words && (step.status || step.hasText))
85
+ .map((step) => (_jsxs("p", { "data-slot": "stepper-compact-step-status", className: "m-0 flex flex-wrap items-center gap-x-ds-050 text-body", children: [_jsx("span", { className: "text-ds-text-subtle", children: step.label }), _jsx("span", { "aria-hidden": true, className: "text-ds-text-subtlest", children: "\u00B7" }), _jsx(StatusWords, { step: step, locale: locale })] }, step.id)))] })) : (_jsxs("p", { className: "m-0 flex flex-wrap items-center gap-x-ds-050 text-body", children: [_jsx("span", { className: "text-ds-text-subtle", children: stepOfLabel(locale, current.index + 1, steps.length) }), _jsx("span", { "aria-hidden": true, className: "text-ds-text-subtlest", children: "\u00B7" }), _jsx("span", { className: "font-[600] text-ds-text", children: current.label }), current.words && (current.status || current.hasText) && (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": true, className: "text-ds-text-subtlest", children: "\u00B7" }), _jsx(StatusWords, { step: current, locale: locale })] }))] })), _jsx("span", { "aria-hidden": true, "data-slot": "stepper-compact-bar", className: "h-1 overflow-hidden rounded-ds-full bg-ds-background-neutral-pressed", children: _jsx("span", { className: cn("block h-full rounded-ds-full", !complete && current.status ? STATUS[current.status].bar : "bg-ds-background-brand-bold"), style: { width: `${fill}%` } }) })] })] }));
86
+ }
87
+ function Vertical({ steps, name, onStepPress, locale, complete }) {
88
+ return (_jsx("ol", { "aria-label": name, "data-slot": "stepper", "data-orientation": "vertical", "data-complete": complete && "", className: "m-0 flex list-none flex-col p-0", children: steps.map((step, i) => (_jsxs("li", { "data-slot": "stepper-step", "data-state": step.state, "data-status": step.status, "aria-current": step.state === "current" ? "step" : undefined, className: "grid grid-cols-[24px_1fr] gap-ds-150", children: [_jsxs("span", { className: "flex flex-col items-center", children: [_jsx("span", { "data-slot": "stepper-step-node", className: cn("grid size-6 shrink-0 place-items-center rounded-ds-full text-[12px] font-medium", step.status
89
+ ? cn(STATUS[step.status].bar, STATUS[step.status].on)
90
+ : step.state === "done"
91
+ ? "bg-ds-background-brand-bold text-ds-text-on-brand"
92
+ : step.state === "current"
93
+ ? "bg-ds-surface-raised text-ds-text inset-ring-2 inset-ring-ds-border-selected"
94
+ : "bg-ds-surface-raised text-ds-text-subtle inset-ring-[1.5px] inset-ring-ds-border-bold"), children: step.status ? (_jsx(IconGlyph, { name: STATUS[step.status].icon, size: "small" })) : step.state === "done" ? (_jsx(IconGlyph, { name: "check", size: "small", strokeWidth: 3 })) : (_jsx("span", { "aria-hidden": true, children: step.index + 1 })) }), i < steps.length - 1 && _jsx("span", { "aria-hidden": true, className: "my-1 min-h-3 w-px flex-1 bg-ds-border" })] }), _jsxs("span", { className: "flex min-w-0 flex-col gap-0.5 pb-ds-200", children: [_jsx(StepName, { step: step, onStepPress: onStepPress, className: cn("text-body-strong", step.state === "upcoming" ? "text-ds-text-subtle" : "text-ds-text") }), step.description && _jsx("span", { className: "text-body-small text-ds-text-subtlest", children: step.description }), _jsx(StatusWords, { step: step, locale: locale })] })] }, step.id))) }));
95
+ }
96
+ //# sourceMappingURL=stepper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stepper.js","sourceRoot":"","sources":["../../src/navigation/stepper.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAExE,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAiB,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AAgDjB,0GAA0G;AAC1G,MAAM,MAAM,GAAqH;IAC/H,WAAW,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,EAAE,+BAA+B,EAAE,EAAE,EAAE,yBAAyB,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAE,iBAAiB,EAAE;IAClK,eAAe,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,mCAAmC,EAAE,EAAE,EAAE,sBAAsB,EAAE,IAAI,EAAE,0BAA0B,EAAE,KAAK,EAAE,qBAAqB,EAAE;IACxK,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,8BAA8B,EAAE,EAAE,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AAM,CAAC,CAAC,CAAC,CAC1B,KAAC,SAAS,IAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAE,CAAC,GAAI,CACxD,CAAC,CAAC,CAAC,CACF,8CAAmB,IAAI,CAAC,KAAK,GAAG,CAAC,GAAQ,CAC1C,GACI,EACN,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,oCAAkB,SAAS,EAAC,uCAAuC,GAAG,IAC1F,EACP,gBAAM,SAAS,EAAC,yCAAyC,aACvD,KAAC,QAAQ,IACP,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,IAAI,CAAC,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,cAAc,CAAC,GACrG,EACD,IAAI,CAAC,WAAW,IAAI,eAAM,SAAS,EAAC,uCAAuC,YAAE,IAAI,CAAC,WAAW,GAAQ,EACtG,KAAC,WAAW,IAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAI,IACtC,KAvCF,IAAI,CAAC,EAAE,CAwCT,CACN,CAAC,GACC,CACN,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Button as AriaButton, useLocale } from \"react-aria-components\";\n\nimport { cn } from \"../utils\";\nimport { IconGlyph, type IconName } from \"../display/icon\";\nimport {\n progressStepsLabel,\n stepDoneLabel,\n stepFailedLabel,\n stepLabel,\n stepNeedsYouLabel,\n stepNowLabel,\n stepOfLabel,\n stepsAllDoneLabel,\n stepWithProviderLabel,\n} from \"../i18n\";\n\nexport type StepperStep = {\n id: string;\n /** The step's name (\"Extras\"); a noun, one or two words. */\n label: string;\n /** Vertical only: one line under the name (\"Name, price and availability\"). */\n description?: string;\n /** Done; by default every step before `currentStep` is. Set it on any step and only the steps marked are done. */\n isDone?: boolean;\n /** A journey across pages (signup → payment → setup): where this step stands, in words and an icon. */\n status?: StepStatus;\n /** Replaces the step's status words (\"With us · 1–2 business days\"). */\n statusText?: string;\n};\n\n/** A step that is waiting on someone or went wrong, shown in words and an icon, never colour alone. */\nexport type StepStatus = \"needs-you\" | \"with-provider\" | \"failed\";\n\nexport type StepperProps = {\n /** Three to six steps, in order. */\n steps: readonly StepperStep[];\n /** The step the reader is on: `aria-current=\"step\"`. Ignored with `isComplete`. */\n currentStep: string;\n /**\n * The flow is finished: every step shows its done state and none is current, so no step\n * carries `aria-current`. The list is named with the overall state (\"Progress, All steps done\"),\n * and the narrow one-line form reads \"All steps done\" over a full bar. A step's `status` or\n * `statusText` still speaks for it, in the list and, under the done line, in the narrow form\n * too (\"Domain · With us\"). A finished flow cannot also have a `failed` or `needs-you` step: that\n * pairing contradicts itself and warns in development; settle the step first. Left out, nothing changes.\n */\n isComplete?: boolean;\n /** Makes done steps pressable (back to an earlier step). Leave it out where the flow cannot go back. */\n onStepPress?: (id: string) => void;\n /** `horizontal` for a flow on one page (checkout, signup); `vertical` for checklists (onboarding, setup). */\n orientation?: \"horizontal\" | \"vertical\";\n /**\n * Done and current steps say so in words too (\"Done\", \"Now\"), as on a journey across pages. On by default when\n * any step has a `status`.\n */\n showStatus?: boolean;\n /** Names the list; \"Progress\" by default. */\n \"aria-label\"?: string;\n};\n\ntype State = \"done\" | \"current\" | \"upcoming\";\n\n/** Per status: icon, bold fill, the text colour on that fill (its own on-colour, for contrast), words. */\nconst STATUS: Record<StepStatus, { icon: IconName; bar: string; on: string; text: string; words: (locale: string) => string }> = {\n \"needs-you\": { icon: \"circle-alert\", bar: \"bg-ds-background-warning-bold\", on: \"text-ds-text-on-warning\", text: \"text-ds-text-warning\", words: stepNeedsYouLabel },\n \"with-provider\": { icon: \"clock\", bar: \"bg-ds-background-information-bold\", on: \"text-ds-text-on-bold\", text: \"text-ds-text-information\", words: stepWithProviderLabel },\n failed: { icon: \"circle-x\", bar: \"bg-ds-background-danger-bold\", on: \"text-ds-text-on-danger\", text: \"text-ds-text-danger\", words: stepFailedLabel },\n};\n\ntype Resolved = StepperStep & { index: number; state: State; status?: StepStatus; words?: string; icon?: IconName; hasText: boolean };\n\nfunction resolve(props: StepperProps, locale: string): Resolved[] {\n const { steps, currentStep, isComplete } = props;\n const currentIndex = Math.max(0, steps.findIndex((step) => step.id === currentStep));\n const marked = steps.some((step) => step.isDone !== undefined);\n const done = new Set((marked ? steps.filter((step) => step.isDone) : steps.slice(0, currentIndex)).map((step) => step.id));\n const journey = props.showStatus ?? steps.some((step) => step.status !== undefined);\n return steps.map((step, index) => {\n const state: State = isComplete ? \"done\" : step.id === steps[currentIndex]?.id ? \"current\" : done.has(step.id) ? \"done\" : \"upcoming\";\n const status = step.status;\n const words =\n step.statusText ??\n (status ? STATUS[status].words(locale) : journey && state === \"done\" ? stepDoneLabel(locale) : journey && state === \"current\" ? stepNowLabel(locale) : undefined);\n const icon = status ? STATUS[status].icon : journey && state === \"done\" ? \"check\" : undefined;\n return { ...step, index, state, status, words, icon, hasText: step.statusText !== undefined };\n });\n}\n\n/**\n * Progress through an ordered flow and where the reader is in it. Horizontal: one 4px bar per step,\n * \"Step 3\" over the name; in a container narrower than 36rem it becomes one line (\"Step 3 / 5 · Domain\")\n * over a single bar, so a name never breaks letter by letter. Vertical: 24px nodes on a rail. A step's\n * status is said in words and an icon, never by colour alone. `isComplete` shows a finished flow: every\n * step done, none current.\n */\nexport function Stepper(props: StepperProps) {\n const { locale } = useLocale();\n const steps = resolve(props, locale);\n // A finished flow has no current step, so its currentStep is not checked.\n const unknownStep = !props.isComplete && !props.steps.some((step) => step.id === props.currentStep);\n // Once per unknown id: not on every render, nor twice under StrictMode's re-run of effects.\n const warned = React.useRef<string | null>(null);\n React.useEffect(() => {\n if (!unknownStep || warned.current === props.currentStep) return;\n warned.current = props.currentStep;\n console.warn(`Stepper: currentStep \"${props.currentStep}\" is not one of the steps; the first step is shown as current.`);\n }, [unknownStep, props.currentStep]);\n // A finished flow with a step still failed or waiting on the reader says two opposite things: tell the\n // developer, once per set of such steps. Development only, as Select's missing-name warning.\n const contradicted = props.isComplete\n ? steps.filter((step) => step.status === \"failed\" || step.status === \"needs-you\").map((step) => step.id).join(\", \")\n : \"\";\n const warnedContradiction = React.useRef(\"\");\n React.useEffect(() => {\n if (process.env.NODE_ENV === \"production\" || !contradicted || warnedContradiction.current === contradicted) return;\n warnedContradiction.current = contradicted;\n console.warn(`Stepper: isComplete with a \"failed\" or \"needs-you\" step (${contradicted}) contradicts itself; settle the step before marking the flow complete.`);\n }, [contradicted]);\n const label = props[\"aria-label\"] ?? progressStepsLabel(locale);\n // Finished: the overall state is part of the name, which every screen reader says on entering the list.\n const name = props.isComplete ? `${label}, ${stepsAllDoneLabel(locale)}` : label;\n const complete = props.isComplete || undefined;\n return props.orientation === \"vertical\" ? (\n <Vertical steps={steps} name={name} onStepPress={props.onStepPress} locale={locale} label={label} complete={complete} />\n ) : (\n <Horizontal steps={steps} name={name} onStepPress={props.onStepPress} locale={locale} label={label} complete={complete} />\n );\n}\n\ntype Shared = { steps: Resolved[]; name: string; onStepPress?: (id: string) => void; locale: string; label: string; complete?: true };\n\n/** The step name: a button back to a done step when the flow allows it, plain text otherwise. */\nfunction StepName({ step, onStepPress, className }: { step: Resolved; onStepPress?: (id: string) => void; className: string }) {\n if (step.state === \"done\" && onStepPress) {\n return (\n <AriaButton\n onPress={() => onStepPress(step.id)}\n data-slot=\"stepper-step-button\"\n className={cn(className, \"cursor-pointer rounded-ds-small text-start outline-hidden data-[hovered]:underline data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused\")}\n >\n {step.label}\n </AriaButton>\n );\n }\n return <span className={className}>{step.label}</span>;\n}\n\nfunction StatusWords({ step, locale }: { step: Resolved; locale: string }) {\n // Outside a journey a done step shows only its bar or check; screen readers still hear that it is done.\n if (!step.words) return step.state === \"done\" ? <span className=\"sr-only\">{`, ${stepDoneLabel(locale)}`}</span> : null;\n return (\n <span data-slot=\"stepper-step-status\" className={cn(\"flex items-center gap-ds-050 text-body-small\", step.status ? STATUS[step.status].text : \"text-ds-text-subtlest\")}>\n {step.icon && <IconGlyph name={step.icon} size=\"small\" />}\n {step.words}\n </span>\n );\n}\n\nfunction Horizontal({ steps, name, label, onStepPress, locale, complete }: Shared) {\n const current = steps.find((step) => step.state === \"current\") ?? steps[0]!;\n const fill = complete ? 100 : ((current.index + 1) / steps.length) * 100;\n return (\n <div data-slot=\"stepper\" data-orientation=\"horizontal\" data-complete={complete && \"\"} className=\"@container\">\n <ol aria-label={name} className=\"m-0 hidden list-none gap-ds-100 p-0 @min-[36rem]:flex\">\n {steps.map((step) => (\n <li\n key={step.id}\n data-slot=\"stepper-step\"\n data-state={step.state}\n data-status={step.status}\n aria-current={step.state === \"current\" ? \"step\" : undefined}\n className=\"flex min-w-0 flex-1 flex-col gap-ds-100\"\n >\n <span\n aria-hidden\n data-slot=\"stepper-step-bar\"\n className={cn(\n \"h-1 rounded-ds-full\",\n step.status ? STATUS[step.status].bar : step.state === \"upcoming\" ? \"bg-ds-background-neutral-pressed\" : \"bg-ds-background-brand-bold\",\n )}\n />\n <span className=\"flex min-w-0 flex-col\">\n <span className=\"text-body-small text-ds-text-subtlest\">{stepLabel(locale, step.index + 1)}</span>\n <StepName\n step={step}\n onStepPress={onStepPress}\n className={cn(\n \"text-body [overflow-wrap:normal] [word-break:normal] hyphens-auto\",\n step.state === \"current\" ? \"font-[600] text-ds-text\" : step.state === \"done\" ? \"font-[500] text-ds-text\" : \"font-[500] text-ds-text-subtle\",\n )}\n />\n <StatusWords step={step} locale={locale} />\n </span>\n </li>\n ))}\n </ol>\n {/* Narrow container: where the reader is, in one line, over one bar. */}\n <div role=\"group\" aria-label={complete ? label : name} data-slot=\"stepper-compact\" className=\"flex flex-col gap-ds-100 @min-[36rem]:hidden\">\n {complete ? (\n <>\n {/* Finished: no step to point at, so the line says the whole flow is done. */}\n <p data-slot=\"stepper-compact-done\" className=\"m-0 flex items-center gap-ds-050 text-body font-[600] text-ds-text\">\n <IconGlyph name=\"check\" size=\"small\" strokeWidth={3} />\n {stepsAllDoneLabel(locale)}\n </p>\n {/* A step with its own status (`status` or `statusText`) says it here too, as it does in the list. */}\n {steps\n .filter((step) => step.words && (step.status || step.hasText))\n .map((step) => (\n <p key={step.id} data-slot=\"stepper-compact-step-status\" className=\"m-0 flex flex-wrap items-center gap-x-ds-050 text-body\">\n <span className=\"text-ds-text-subtle\">{step.label}</span>\n <span aria-hidden className=\"text-ds-text-subtlest\">·</span>\n <StatusWords step={step} locale={locale} />\n </p>\n ))}\n </>\n ) : (\n <p className=\"m-0 flex flex-wrap items-center gap-x-ds-050 text-body\">\n <span className=\"text-ds-text-subtle\">{stepOfLabel(locale, current.index + 1, steps.length)}</span>\n <span aria-hidden className=\"text-ds-text-subtlest\">·</span>\n <span className=\"font-[600] text-ds-text\">{current.label}</span>\n {current.words && (current.status || current.hasText) && (\n <>\n <span aria-hidden className=\"text-ds-text-subtlest\">·</span>\n <StatusWords step={current} locale={locale} />\n </>\n )}\n </p>\n )}\n <span aria-hidden data-slot=\"stepper-compact-bar\" className=\"h-1 overflow-hidden rounded-ds-full bg-ds-background-neutral-pressed\">\n <span\n className={cn(\"block h-full rounded-ds-full\", !complete && current.status ? STATUS[current.status].bar : \"bg-ds-background-brand-bold\")}\n style={{ width: `${fill}%` }}\n />\n </span>\n </div>\n </div>\n );\n}\n\nfunction Vertical({ steps, name, onStepPress, locale, complete }: Shared) {\n return (\n <ol aria-label={name} data-slot=\"stepper\" data-orientation=\"vertical\" data-complete={complete && \"\"} className=\"m-0 flex list-none flex-col p-0\">\n {steps.map((step, i) => (\n <li\n key={step.id}\n data-slot=\"stepper-step\"\n data-state={step.state}\n data-status={step.status}\n aria-current={step.state === \"current\" ? \"step\" : undefined}\n className=\"grid grid-cols-[24px_1fr] gap-ds-150\"\n >\n <span className=\"flex flex-col items-center\">\n <span\n data-slot=\"stepper-step-node\"\n className={cn(\n \"grid size-6 shrink-0 place-items-center rounded-ds-full text-[12px] font-medium\",\n step.status\n ? cn(STATUS[step.status].bar, STATUS[step.status].on)\n : step.state === \"done\"\n ? \"bg-ds-background-brand-bold text-ds-text-on-brand\"\n : step.state === \"current\"\n ? \"bg-ds-surface-raised text-ds-text inset-ring-2 inset-ring-ds-border-selected\"\n : \"bg-ds-surface-raised text-ds-text-subtle inset-ring-[1.5px] inset-ring-ds-border-bold\",\n )}\n >\n {step.status ? (\n <IconGlyph name={STATUS[step.status].icon} size=\"small\" />\n ) : step.state === \"done\" ? (\n <IconGlyph name=\"check\" size=\"small\" strokeWidth={3} />\n ) : (\n <span aria-hidden>{step.index + 1}</span>\n )}\n </span>\n {i < steps.length - 1 && <span aria-hidden className=\"my-1 min-h-3 w-px flex-1 bg-ds-border\" />}\n </span>\n <span className=\"flex min-w-0 flex-col gap-0.5 pb-ds-200\">\n <StepName\n step={step}\n onStepPress={onStepPress}\n className={cn(\"text-body-strong\", step.state === \"upcoming\" ? \"text-ds-text-subtle\" : \"text-ds-text\")}\n />\n {step.description && <span className=\"text-body-small text-ds-text-subtlest\">{step.description}</span>}\n <StatusWords step={step} locale={locale} />\n </span>\n </li>\n ))}\n </ol>\n );\n}\n"]}
@@ -0,0 +1,84 @@
1
+ import * as React from "react";
2
+ import { type Key } from "react-aria-components";
3
+ import { type ComponentSize, type WithMotion } from "../defaults.js";
4
+ export type TabItem = {
5
+ id: Key;
6
+ /** A noun, one or two words ("Orders"). */
7
+ label: string;
8
+ /** A count after the label (a Badge), e.g. open damage records. */
9
+ count?: number;
10
+ isDisabled?: boolean;
11
+ panel: React.ReactNode;
12
+ };
13
+ export type TabsProps = {
14
+ /**
15
+ * Two to six tabs as data. Leave it out and compose `TabList`, `Tab` and `TabPanel` as children instead,
16
+ * for a tab with an icon, a panel built elsewhere, or tabs rendered from your own components.
17
+ */
18
+ items?: readonly TabItem[];
19
+ /** With no `items`: a `TabList` of `Tab`s followed by one `TabPanel` per tab, matched by `id`. */
20
+ children?: React.ReactNode;
21
+ selectedKey?: Key;
22
+ defaultSelectedKey?: Key;
23
+ onSelectionChange?: (key: Key) => void;
24
+ /** Names the tab list when no heading above it does (with `items`; on `TabList` otherwise). */
25
+ "aria-label"?: string;
26
+ /** `underline` (default): a line under the selected tab; `pills`: a filled tab; `outline`: a framed tab. */
27
+ variant?: TabsVariant;
28
+ /** `horizontal` (default), or `vertical`: the tabs in a column beside the panels (settings pages). */
29
+ orientation?: "horizontal" | "vertical";
30
+ /** `small`, `medium` (default) or `large`; the provider default otherwise. */
31
+ size?: ComponentSize;
32
+ };
33
+ export type TabsVariant = "underline" | "pills" | "outline";
34
+ export type TabListProps = {
35
+ /** `Tab` elements. */
36
+ children: React.ReactNode;
37
+ /** Names the tab list when no heading above it does. */
38
+ "aria-label"?: string;
39
+ "aria-labelledby"?: string;
40
+ };
41
+ export type TabProps = {
42
+ /** Matches the `TabPanel` with the same `id`. */
43
+ id: Key;
44
+ /** The label: a noun, one or two words, optionally with an Icon before it. */
45
+ children: React.ReactNode;
46
+ /** A count after the label (a Badge); hidden at 0. */
47
+ count?: number;
48
+ isDisabled?: boolean;
49
+ };
50
+ export type TabPanelProps = {
51
+ /** Matches the `Tab` with the same `id`. */
52
+ id: Key;
53
+ children: React.ReactNode;
54
+ };
55
+ /**
56
+ * The row of tabs. On a narrow screen it scrolls sideways and keeps the selected tab in view, by scrolling
57
+ * the row alone, never the page (scrollIntoView would scroll every ancestor, the window included).
58
+ */
59
+ export declare function TabList({ children, "aria-label": label, "aria-labelledby": labelledBy }: TabListProps): React.JSX.Element;
60
+ /** One tab: its label, an optional count, and the sliding underline when selected. */
61
+ export declare function Tab({ id, children, count, isDisabled }: TabProps): React.JSX.Element;
62
+ /** A tab's view. It stays mounted while hidden, so its state (a scroll position, a half-filled filter) survives switching. */
63
+ export declare function TabPanel({ id, children }: TabPanelProps): React.JSX.Element;
64
+ export type SegmentedControlItem = {
65
+ id: Key;
66
+ label: string;
67
+ };
68
+ export type SegmentedControlProps = {
69
+ /** Names the group for assistive tech ("Period"); it is not shown. */
70
+ label: string;
71
+ /** Two to five short options ("Day", "Week", "Month"). */
72
+ items: readonly SegmentedControlItem[];
73
+ value?: Key;
74
+ defaultValue?: Key;
75
+ onChange?: (value: Key) => void;
76
+ isDisabled?: boolean;
77
+ };
78
+ /**
79
+ * Tabs' compact sibling for switching a filter or a scale (day · week · month), not for views. One
80
+ * option is always chosen; arrow keys move between them.
81
+ */
82
+ export declare function SegmentedControl({ label, items, value, defaultValue, onChange, isDisabled }: SegmentedControlProps): React.JSX.Element;
83
+ /** Tabs with its own `motion` (auto, reduce or none); see TabsBody for the component itself. */
84
+ export declare function Tabs({ motion, ...props }: TabsProps & WithMotion): React.JSX.Element;
@@ -0,0 +1,118 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { SelectionIndicator, Tab as AriaTab, TabList as AriaTabList, TabListStateContext, TabPanel as AriaTabPanel, Tabs as AriaTabs, ToggleButton as AriaToggleButton, ToggleButtonGroup as AriaToggleButtonGroup, } from "react-aria-components";
5
+ import { cn } from "../utils.js";
6
+ import { MotionScope, useComponentDefaults } from "../defaults.js";
7
+ import { Badge } from "../display/badge.js";
8
+ /** The selected tab's 2px underline (never colour alone); React Aria slides it to the next tab (no slide under reduced motion). */
9
+ const SLIDE = "transition-[translate,width,height] duration-(--ds-duration-medium) ease-ds-standard motion-reduce:transition-none";
10
+ const FILL = "absolute inset-0 -z-10 rounded-ds-control-medium bg-ds-background-neutral";
11
+ const FRAME = "absolute inset-0 -z-10 rounded-ds-control-medium inset-ring-1 inset-ring-ds-border-bold";
12
+ /** The selected mark, which React Aria slides to the next tab: a line, a fill or a frame (never colour alone). */
13
+ const TAB_INDICATOR = {
14
+ underline: {
15
+ horizontal: `absolute inset-x-0 -bottom-px h-0.5 rounded-t-ds-small bg-ds-border-selected ${SLIDE}`,
16
+ vertical: `absolute inset-y-0 -end-px w-0.5 rounded-s-ds-small bg-ds-border-selected ${SLIDE}`,
17
+ },
18
+ pills: { horizontal: `${FILL} ${SLIDE}`, vertical: `${FILL} ${SLIDE}` },
19
+ outline: { horizontal: `${FRAME} ${SLIDE}`, vertical: `${FRAME} ${SLIDE}` },
20
+ };
21
+ /** The row (or column) of tabs per variant: a rule along it for `underline`, nothing for the boxed ones. */
22
+ const TAB_LIST = {
23
+ underline: {
24
+ horizontal: "flex gap-ds-300 overflow-x-auto border-b border-ds-border",
25
+ vertical: "flex w-48 shrink-0 flex-col gap-ds-050 border-e border-ds-border pe-ds-200",
26
+ },
27
+ pills: { horizontal: "flex gap-ds-050 overflow-x-auto", vertical: "flex w-48 shrink-0 flex-col gap-ds-050" },
28
+ outline: { horizontal: "flex gap-ds-050 overflow-x-auto", vertical: "flex w-48 shrink-0 flex-col gap-ds-050" },
29
+ };
30
+ /** Tab height and type per size; the boxed variants (pills, outline) add inline padding. */
31
+ const TAB_SIZE = { small: "h-8 text-body-small", medium: "h-10", large: "h-12 text-body-large" };
32
+ const TAB_BOXED = { small: "px-ds-100", medium: "px-ds-150", large: "px-ds-200" };
33
+ /** What a TabList and its Tabs draw, from Tabs, so composed tabs look the same as `items`. */
34
+ const TabsLook = React.createContext({
35
+ variant: "underline",
36
+ orientation: "horizontal",
37
+ size: "medium",
38
+ });
39
+ const TAB = "relative isolate inline-flex h-10 shrink-0 cursor-default items-center gap-ds-075 rounded-ds-small text-body font-[500] whitespace-nowrap text-ds-text-subtle outline-hidden " +
40
+ "transition-colors duration-(--ds-duration-fast) motion-reduce:transition-none " +
41
+ "data-[hovered]:text-ds-text data-[selected]:text-ds-text " +
42
+ "data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused data-[disabled]:text-ds-text-disabled";
43
+ /**
44
+ * The row of tabs. On a narrow screen it scrolls sideways and keeps the selected tab in view, by scrolling
45
+ * the row alone, never the page (scrollIntoView would scroll every ancestor, the window included).
46
+ */
47
+ export function TabList({ children, "aria-label": label, "aria-labelledby": labelledBy }) {
48
+ const list = React.useRef(null);
49
+ const selected = React.useContext(TabListStateContext)?.selectedKey;
50
+ const look = React.useContext(TabsLook);
51
+ React.useEffect(() => {
52
+ const row = list.current;
53
+ const tab = row?.querySelector("[data-selected]");
54
+ if (!row || !tab)
55
+ return;
56
+ // Rect deltas work the same in RTL.
57
+ const outer = row.getBoundingClientRect();
58
+ const inner = tab.getBoundingClientRect();
59
+ if (inner.left < outer.left)
60
+ row.scrollLeft -= outer.left - inner.left;
61
+ else if (inner.right > outer.right)
62
+ row.scrollLeft += inner.right - outer.right;
63
+ }, [selected]);
64
+ return (_jsx(AriaTabList, { ref: list, "aria-label": label, "aria-labelledby": labelledBy, "data-slot": "tabs-list", className: cn(TAB_LIST[look.variant][look.orientation], "[scrollbar-width:none] [&::-webkit-scrollbar]:hidden"), children: children }));
65
+ }
66
+ /** One tab: its label, an optional count, and the sliding underline when selected. */
67
+ export function Tab({ id, children, count, isDisabled }) {
68
+ const look = React.useContext(TabsLook);
69
+ const boxed = look.variant !== "underline" && cn("rounded-ds-control-medium", TAB_BOXED[look.size]);
70
+ return (_jsxs(AriaTab, { id: id, isDisabled: isDisabled, "data-slot": "tab", className: cn(TAB, TAB_SIZE[look.size], boxed, look.orientation === "vertical" && "w-full justify-start"), children: [_jsx(SelectionIndicator, { "data-slot": "tab-indicator", className: TAB_INDICATOR[look.variant][look.orientation] }), children, count !== undefined && count > 0 && (_jsx("span", { "data-slot": "tab-count", className: "flex", children: _jsx(Badge, { variant: "count", value: count }) }))] }));
71
+ }
72
+ /** A tab's view. It stays mounted while hidden, so its state (a scroll position, a half-filled filter) survives switching. */
73
+ export function TabPanel({ id, children }) {
74
+ return (_jsx(AriaTabPanel, { id: id, shouldForceMount: true, "data-slot": "tab-panel", className: "outline-hidden data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused data-[inert]:hidden [&[inert]]:hidden", children: children }));
75
+ }
76
+ /**
77
+ * Switches between views of the same object without leaving the page. Arrow keys (mirrored in RTL),
78
+ * Home and End move between tabs; the selected tab holds focus. Give `items`, or compose `TabList`,
79
+ * `Tab` and `TabPanel` as children; both render the same parts.
80
+ */
81
+ function TabsBody({ items, children, selectedKey, defaultSelectedKey, onSelectionChange, "aria-label": label, variant = "underline", orientation = "horizontal", size: ownSize, }) {
82
+ const defaults = useComponentDefaults();
83
+ const size = ownSize ?? defaults.size ?? "medium";
84
+ const look = React.useMemo(() => ({ variant, orientation, size }), [variant, orientation, size]);
85
+ return (_jsx(TabsLook.Provider, { value: look, children: _jsx(AriaTabs, { selectedKey: selectedKey, defaultSelectedKey: defaultSelectedKey, onSelectionChange: onSelectionChange, orientation: orientation, "data-slot": "tabs", "data-variant": variant, className: orientation === "vertical" ? "flex gap-ds-400" : "flex flex-col gap-ds-200", children: items ? (_jsxs(_Fragment, { children: [_jsx(TabList, { "aria-label": label, children: items.map((item) => (_jsx(Tab, { id: item.id, count: item.count, isDisabled: item.isDisabled, children: item.label }, item.id))) }), items.map((item) => (_jsx(TabPanel, { id: item.id, children: item.panel }, item.id)))] })) : (children) }) }));
86
+ }
87
+ /**
88
+ * The selected segment's lifted surface (surface and shadow, not only colour); it slides to the next segment. Segments
89
+ * sit in the 2px-padded track, so their corner is the track's minus that padding: concentric at every radius.
90
+ */
91
+ const SEGMENT_INDICATOR = "absolute inset-0 -z-10 rounded-[max(0px,calc(var(--ds-radius-control-medium,var(--ds-radius-medium))-2px))] bg-ds-background-segment-selected shadow-ds-raised " +
92
+ "transition-[translate,width] duration-(--ds-duration-medium) ease-ds-standard motion-reduce:transition-none";
93
+ const SEGMENT = "inline-flex h-7 cursor-default items-center rounded-[max(0px,calc(var(--ds-radius-control-medium,var(--ds-radius-medium))-2px))] px-ds-150 text-body font-[500] whitespace-nowrap text-ds-text-subtle outline-hidden " +
94
+ "transition-[background-color,color,box-shadow] duration-(--ds-duration-fast) motion-reduce:transition-none " +
95
+ "data-[hovered]:text-ds-text " +
96
+ "relative isolate data-[selected]:text-ds-text " +
97
+ "data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused data-[disabled]:text-ds-text-disabled";
98
+ /**
99
+ * Tabs' compact sibling for switching a filter or a scale (day · week · month), not for views. One
100
+ * option is always chosen; arrow keys move between them.
101
+ */
102
+ export function SegmentedControl({ label, items, value, defaultValue, onChange, isDisabled }) {
103
+ const [own, setOwn] = React.useState(defaultValue ?? items[0]?.id);
104
+ const current = value ?? own;
105
+ return (_jsx(AriaToggleButtonGroup, { "aria-label": label, selectionMode: "single", disallowEmptySelection: true, selectedKeys: current === undefined ? [] : [current], onSelectionChange: (keys) => {
106
+ const next = [...keys][0];
107
+ if (next === undefined)
108
+ return;
109
+ if (value === undefined)
110
+ setOwn(next);
111
+ onChange?.(next);
112
+ }, isDisabled: isDisabled, "data-slot": "segmented-control", className: cn("inline-flex w-fit max-w-full self-start gap-0.5 overflow-x-auto rounded-ds-control-medium bg-ds-background-neutral p-0.5", "[scrollbar-width:none] [&::-webkit-scrollbar]:hidden"), children: items.map((item) => (_jsxs(AriaToggleButton, { id: item.id, "data-slot": "segment", className: SEGMENT, children: [_jsx(SelectionIndicator, { "data-slot": "segment-indicator", className: SEGMENT_INDICATOR }), item.label] }, item.id))) }));
113
+ }
114
+ /** Tabs with its own `motion` (auto, reduce or none); see TabsBody for the component itself. */
115
+ export function Tabs({ motion, ...props }) {
116
+ return (_jsx(MotionScope, { motion: motion, children: _jsx(TabsBody, { ...props }) }));
117
+ }
118
+ //# sourceMappingURL=tabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../src/navigation/tabs.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,GAAG,IAAI,OAAO,EACd,OAAO,IAAI,WAAW,EACtB,mBAAmB,EACnB,QAAQ,IAAI,YAAY,EACxB,IAAI,IAAI,QAAQ,EACh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I,CAAC,CAAC;YACtC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC,EACD,UAAU,EAAE,UAAU,eACZ,mBAAmB,EAC7B,SAAS,EAAE,EAAE,CAAC,0HAA0H,EAAE,sDAAsD,CAAC,YAEhM,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,MAAC,gBAAgB,IAAe,EAAE,EAAE,IAAI,CAAC,EAAE,eAAY,SAAS,EAAC,SAAS,EAAE,OAAO,aACjF,KAAC,kBAAkB,iBAAW,mBAAmB,EAAC,SAAS,EAAE,iBAAiB,GAAI,EACjF,IAAI,CAAC,KAAK,KAFU,IAAI,CAAC,EAAE,CAGX,CACpB,CAAC,GACoB,CACzB,CAAC;AACJ,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,EAA0B;IAC/D,OAAO,CACL,KAAC,WAAW,IAAC,MAAM,EAAE,MAAM,YACzB,KAAC,QAAQ,OAAM,KAAmB,GAAI,GAC1B,CACf,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n SelectionIndicator,\n Tab as AriaTab,\n TabList as AriaTabList,\n TabListStateContext,\n TabPanel as AriaTabPanel,\n Tabs as AriaTabs,\n ToggleButton as AriaToggleButton,\n ToggleButtonGroup as AriaToggleButtonGroup,\n type Key,\n} from \"react-aria-components\";\n\nimport { cn } from \"../utils\";\nimport { MotionScope, useComponentDefaults, type ComponentSize, type WithMotion } from \"../defaults\";\nimport { Badge } from \"../display/badge\";\n\nexport type TabItem = {\n id: Key;\n /** A noun, one or two words (\"Orders\"). */\n label: string;\n /** A count after the label (a Badge), e.g. open damage records. */\n count?: number;\n isDisabled?: boolean;\n panel: React.ReactNode;\n};\n\nexport type TabsProps = {\n /**\n * Two to six tabs as data. Leave it out and compose `TabList`, `Tab` and `TabPanel` as children instead,\n * for a tab with an icon, a panel built elsewhere, or tabs rendered from your own components.\n */\n items?: readonly TabItem[];\n /** With no `items`: a `TabList` of `Tab`s followed by one `TabPanel` per tab, matched by `id`. */\n children?: React.ReactNode;\n selectedKey?: Key;\n defaultSelectedKey?: Key;\n onSelectionChange?: (key: Key) => void;\n /** Names the tab list when no heading above it does (with `items`; on `TabList` otherwise). */\n \"aria-label\"?: string;\n /** `underline` (default): a line under the selected tab; `pills`: a filled tab; `outline`: a framed tab. */\n variant?: TabsVariant;\n /** `horizontal` (default), or `vertical`: the tabs in a column beside the panels (settings pages). */\n orientation?: \"horizontal\" | \"vertical\";\n /** `small`, `medium` (default) or `large`; the provider default otherwise. */\n size?: ComponentSize;\n};\n\nexport type TabsVariant = \"underline\" | \"pills\" | \"outline\";\n\nexport type TabListProps = {\n /** `Tab` elements. */\n children: React.ReactNode;\n /** Names the tab list when no heading above it does. */\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n};\n\nexport type TabProps = {\n /** Matches the `TabPanel` with the same `id`. */\n id: Key;\n /** The label: a noun, one or two words, optionally with an Icon before it. */\n children: React.ReactNode;\n /** A count after the label (a Badge); hidden at 0. */\n count?: number;\n isDisabled?: boolean;\n};\n\nexport type TabPanelProps = {\n /** Matches the `Tab` with the same `id`. */\n id: Key;\n children: React.ReactNode;\n};\n\n/** The selected tab's 2px underline (never colour alone); React Aria slides it to the next tab (no slide under reduced motion). */\nconst SLIDE = \"transition-[translate,width,height] duration-(--ds-duration-medium) ease-ds-standard motion-reduce:transition-none\";\nconst FILL = \"absolute inset-0 -z-10 rounded-ds-control-medium bg-ds-background-neutral\";\nconst FRAME = \"absolute inset-0 -z-10 rounded-ds-control-medium inset-ring-1 inset-ring-ds-border-bold\";\n\n/** The selected mark, which React Aria slides to the next tab: a line, a fill or a frame (never colour alone). */\nconst TAB_INDICATOR: Record<TabsVariant, Record<TabsOrientation, string>> = {\n underline: {\n horizontal: `absolute inset-x-0 -bottom-px h-0.5 rounded-t-ds-small bg-ds-border-selected ${SLIDE}`,\n vertical: `absolute inset-y-0 -end-px w-0.5 rounded-s-ds-small bg-ds-border-selected ${SLIDE}`,\n },\n pills: { horizontal: `${FILL} ${SLIDE}`, vertical: `${FILL} ${SLIDE}` },\n outline: { horizontal: `${FRAME} ${SLIDE}`, vertical: `${FRAME} ${SLIDE}` },\n};\n\n/** The row (or column) of tabs per variant: a rule along it for `underline`, nothing for the boxed ones. */\nconst TAB_LIST: Record<TabsVariant, Record<TabsOrientation, string>> = {\n underline: {\n horizontal: \"flex gap-ds-300 overflow-x-auto border-b border-ds-border\",\n vertical: \"flex w-48 shrink-0 flex-col gap-ds-050 border-e border-ds-border pe-ds-200\",\n },\n pills: { horizontal: \"flex gap-ds-050 overflow-x-auto\", vertical: \"flex w-48 shrink-0 flex-col gap-ds-050\" },\n outline: { horizontal: \"flex gap-ds-050 overflow-x-auto\", vertical: \"flex w-48 shrink-0 flex-col gap-ds-050\" },\n};\n\n/** Tab height and type per size; the boxed variants (pills, outline) add inline padding. */\nconst TAB_SIZE: Record<ComponentSize, string> = { small: \"h-8 text-body-small\", medium: \"h-10\", large: \"h-12 text-body-large\" };\nconst TAB_BOXED: Record<ComponentSize, string> = { small: \"px-ds-100\", medium: \"px-ds-150\", large: \"px-ds-200\" };\n\ntype TabsOrientation = \"horizontal\" | \"vertical\";\n\n/** What a TabList and its Tabs draw, from Tabs, so composed tabs look the same as `items`. */\nconst TabsLook = React.createContext<{ variant: TabsVariant; orientation: TabsOrientation; size: ComponentSize }>({\n variant: \"underline\",\n orientation: \"horizontal\",\n size: \"medium\",\n});\n\nconst TAB =\n \"relative isolate inline-flex h-10 shrink-0 cursor-default items-center gap-ds-075 rounded-ds-small text-body font-[500] whitespace-nowrap text-ds-text-subtle outline-hidden \" +\n \"transition-colors duration-(--ds-duration-fast) motion-reduce:transition-none \" +\n \"data-[hovered]:text-ds-text data-[selected]:text-ds-text \" +\n \"data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused data-[disabled]:text-ds-text-disabled\";\n\n/**\n * The row of tabs. On a narrow screen it scrolls sideways and keeps the selected tab in view, by scrolling\n * the row alone, never the page (scrollIntoView would scroll every ancestor, the window included).\n */\nexport function TabList({ children, \"aria-label\": label, \"aria-labelledby\": labelledBy }: TabListProps) {\n const list = React.useRef<HTMLDivElement>(null);\n const selected = React.useContext(TabListStateContext)?.selectedKey;\n const look = React.useContext(TabsLook);\n React.useEffect(() => {\n const row = list.current;\n const tab = row?.querySelector<HTMLElement>(\"[data-selected]\");\n if (!row || !tab) return;\n // Rect deltas work the same in RTL.\n const outer = row.getBoundingClientRect();\n const inner = tab.getBoundingClientRect();\n if (inner.left < outer.left) row.scrollLeft -= outer.left - inner.left;\n else if (inner.right > outer.right) row.scrollLeft += inner.right - outer.right;\n }, [selected]);\n return (\n <AriaTabList\n ref={list}\n aria-label={label}\n aria-labelledby={labelledBy}\n data-slot=\"tabs-list\"\n className={cn(TAB_LIST[look.variant][look.orientation], \"[scrollbar-width:none] [&::-webkit-scrollbar]:hidden\")}\n >\n {children}\n </AriaTabList>\n );\n}\n\n/** One tab: its label, an optional count, and the sliding underline when selected. */\nexport function Tab({ id, children, count, isDisabled }: TabProps) {\n const look = React.useContext(TabsLook);\n const boxed = look.variant !== \"underline\" && cn(\"rounded-ds-control-medium\", TAB_BOXED[look.size]);\n return (\n <AriaTab\n id={id}\n isDisabled={isDisabled}\n data-slot=\"tab\"\n className={cn(TAB, TAB_SIZE[look.size], boxed, look.orientation === \"vertical\" && \"w-full justify-start\")}\n >\n <SelectionIndicator data-slot=\"tab-indicator\" className={TAB_INDICATOR[look.variant][look.orientation]} />\n {children}\n {count !== undefined && count > 0 && (\n <span data-slot=\"tab-count\" className=\"flex\">\n <Badge variant=\"count\" value={count} />\n </span>\n )}\n </AriaTab>\n );\n}\n\n/** A tab's view. It stays mounted while hidden, so its state (a scroll position, a half-filled filter) survives switching. */\nexport function TabPanel({ id, children }: TabPanelProps) {\n return (\n <AriaTabPanel\n id={id}\n shouldForceMount\n data-slot=\"tab-panel\"\n className=\"outline-hidden data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused data-[inert]:hidden [&[inert]]:hidden\"\n >\n {children}\n </AriaTabPanel>\n );\n}\n\n/**\n * Switches between views of the same object without leaving the page. Arrow keys (mirrored in RTL),\n * Home and End move between tabs; the selected tab holds focus. Give `items`, or compose `TabList`,\n * `Tab` and `TabPanel` as children; both render the same parts.\n */\nfunction TabsBody({\n items, children, selectedKey, defaultSelectedKey, onSelectionChange, \"aria-label\": label, variant = \"underline\", orientation = \"horizontal\", size: ownSize,\n}: TabsProps) {\n const defaults = useComponentDefaults();\n const size = ownSize ?? defaults.size ?? \"medium\";\n const look = React.useMemo(() => ({ variant, orientation, size }), [variant, orientation, size]);\n return (\n <TabsLook.Provider value={look}>\n <AriaTabs\n selectedKey={selectedKey}\n defaultSelectedKey={defaultSelectedKey}\n onSelectionChange={onSelectionChange}\n orientation={orientation}\n data-slot=\"tabs\"\n data-variant={variant}\n className={orientation === \"vertical\" ? \"flex gap-ds-400\" : \"flex flex-col gap-ds-200\"}\n >\n {items ? (\n <>\n <TabList aria-label={label}>\n {items.map((item) => (\n <Tab key={item.id} id={item.id} count={item.count} isDisabled={item.isDisabled}>\n {item.label}\n </Tab>\n ))}\n </TabList>\n {items.map((item) => (\n <TabPanel key={item.id} id={item.id}>\n {item.panel}\n </TabPanel>\n ))}\n </>\n ) : (\n children\n )}\n </AriaTabs>\n </TabsLook.Provider>\n );\n}\n\nexport type SegmentedControlItem = { id: Key; label: string };\n\nexport type SegmentedControlProps = {\n /** Names the group for assistive tech (\"Period\"); it is not shown. */\n label: string;\n /** Two to five short options (\"Day\", \"Week\", \"Month\"). */\n items: readonly SegmentedControlItem[];\n value?: Key;\n defaultValue?: Key;\n onChange?: (value: Key) => void;\n isDisabled?: boolean;\n};\n\n/**\n * The selected segment's lifted surface (surface and shadow, not only colour); it slides to the next segment. Segments\n * sit in the 2px-padded track, so their corner is the track's minus that padding: concentric at every radius.\n */\nconst SEGMENT_INDICATOR =\n \"absolute inset-0 -z-10 rounded-[max(0px,calc(var(--ds-radius-control-medium,var(--ds-radius-medium))-2px))] bg-ds-background-segment-selected shadow-ds-raised \" +\n \"transition-[translate,width] duration-(--ds-duration-medium) ease-ds-standard motion-reduce:transition-none\";\n\nconst SEGMENT =\n \"inline-flex h-7 cursor-default items-center rounded-[max(0px,calc(var(--ds-radius-control-medium,var(--ds-radius-medium))-2px))] px-ds-150 text-body font-[500] whitespace-nowrap text-ds-text-subtle outline-hidden \" +\n \"transition-[background-color,color,box-shadow] duration-(--ds-duration-fast) motion-reduce:transition-none \" +\n \"data-[hovered]:text-ds-text \" +\n \"relative isolate data-[selected]:text-ds-text \" +\n \"data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused data-[disabled]:text-ds-text-disabled\";\n\n/**\n * Tabs' compact sibling for switching a filter or a scale (day · week · month), not for views. One\n * option is always chosen; arrow keys move between them.\n */\nexport function SegmentedControl({ label, items, value, defaultValue, onChange, isDisabled }: SegmentedControlProps) {\n const [own, setOwn] = React.useState<Key | undefined>(defaultValue ?? items[0]?.id);\n const current = value ?? own;\n return (\n <AriaToggleButtonGroup\n aria-label={label}\n selectionMode=\"single\"\n disallowEmptySelection\n selectedKeys={current === undefined ? [] : [current]}\n onSelectionChange={(keys) => {\n const next = [...keys][0];\n if (next === undefined) return;\n if (value === undefined) setOwn(next);\n onChange?.(next);\n }}\n isDisabled={isDisabled}\n data-slot=\"segmented-control\"\n className={cn(\"inline-flex w-fit max-w-full self-start gap-0.5 overflow-x-auto rounded-ds-control-medium bg-ds-background-neutral p-0.5\", \"[scrollbar-width:none] [&::-webkit-scrollbar]:hidden\")}\n >\n {items.map((item) => (\n <AriaToggleButton key={item.id} id={item.id} data-slot=\"segment\" className={SEGMENT}>\n <SelectionIndicator data-slot=\"segment-indicator\" className={SEGMENT_INDICATOR} />\n {item.label}\n </AriaToggleButton>\n ))}\n </AriaToggleButtonGroup>\n );\n}\n\n/** Tabs with its own `motion` (auto, reduce or none); see TabsBody for the component itself. */\nexport function Tabs({ motion, ...props }: TabsProps & WithMotion) {\n return (\n <MotionScope motion={motion}>\n <TabsBody {...(props as TabsProps)} />\n </MotionScope>\n );\n}\n"]}
@@ -0,0 +1,37 @@
1
+ import * as React from "react";
2
+ export type ToolbarProps = {
3
+ /** Compact (32px) controls acting on the view below: search, filters, date range, view switch, export. */
4
+ children: React.ReactNode;
5
+ /** Names the toolbar ("Order tools"). */
6
+ "aria-label": string;
7
+ };
8
+ /**
9
+ * Controls that act on the view below it. One Tab stop: arrow keys move between the controls (mirrored
10
+ * in RTL). Put a `ToolbarSpacer` before the view and export controls to push them to the end.
11
+ * A text-editing control inside (a SearchField's input, a DateField's segments) keeps ←/→ for its caret
12
+ * and segments; at its edge (the caret at the start or end, the first or last segment) the arrow moves on
13
+ * to the next control, so every control stays reachable by the arrows. Arrowing into a date or time field
14
+ * lands on the segment nearest the way in: in RTL the visually nearest one, whatever the DOM order of its
15
+ * segments. A raw `type="number"` or
16
+ * `type="email"` input with a value has no readable caret and keeps ←/→ (Tab leaves it); prefer NumberField,
17
+ * or TextField with `inputMode`, inside a toolbar.
18
+ */
19
+ export declare function Toolbar({ children, "aria-label": label }: ToolbarProps): React.JSX.Element;
20
+ /** Pushes the controls after it to the toolbar's end. */
21
+ export declare function ToolbarSpacer(): React.JSX.Element;
22
+ export type BulkBarProps = {
23
+ /** How many rows are selected; announced as it changes. */
24
+ selectedCount: number;
25
+ /** The bulk actions (compact Buttons): "Send reminder", "Export". */
26
+ actions: React.ReactNode;
27
+ /** Clears the selection; the bar goes with it. */
28
+ onClear: () => void;
29
+ /** Names the bar ("Selected orders"). */
30
+ "aria-label": string;
31
+ };
32
+ /**
33
+ * Replaces the toolbar while rows are selected: the count, the bulk actions and a clear button, on
34
+ * `ds-background-neutral-bold`. One Tab stop with arrow keys inside, like the toolbar. Buttons in the bar
35
+ * are drawn transparent with inverse text whatever their variant: pass default (not primary) actions.
36
+ */
37
+ export declare function BulkBar({ selectedCount, actions, onClear, "aria-label": label }: BulkBarProps): React.JSX.Element;