@namroodinc/liquid-editorial 0.2.0 → 0.2.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 (303) hide show
  1. package/README.md +38 -1
  2. package/UPGRADING.md +78 -0
  3. package/dist/chunks/{Board-BLhB5_xx.cjs → Board-BUJ5CinL.cjs} +2 -2
  4. package/dist/chunks/Board-BUJ5CinL.cjs.map +1 -0
  5. package/dist/chunks/{Board-BTFSzn6c.js → Board-Cyrda2qG.js} +2 -2
  6. package/dist/chunks/Board-Cyrda2qG.js.map +1 -0
  7. package/dist/chunks/FormEditor-8bz3pOdP.cjs.map +1 -1
  8. package/dist/chunks/FormEditor-DuW8x78Y.js.map +1 -1
  9. package/dist/chunks/Icon-ByUB0L1a.js +78 -0
  10. package/dist/chunks/Icon-ByUB0L1a.js.map +1 -0
  11. package/dist/chunks/Icon-CW6qJcDy.cjs +2 -0
  12. package/dist/chunks/Icon-CW6qJcDy.cjs.map +1 -0
  13. package/dist/chunks/RichTextEditor-BxtlbjXj.cjs.map +1 -1
  14. package/dist/chunks/RichTextEditor-Dnx4i7bQ.js.map +1 -1
  15. package/dist/chunks/dialogStack-6yv3NXFD.js +43 -0
  16. package/dist/chunks/dialogStack-6yv3NXFD.js.map +1 -0
  17. package/dist/chunks/dialogStack-C9SLVu6Q.cjs +2 -0
  18. package/dist/chunks/dialogStack-C9SLVu6Q.cjs.map +1 -0
  19. package/dist/chunks/observeElementWidth-BCJM2FAw.cjs +2 -0
  20. package/dist/chunks/observeElementWidth-BCJM2FAw.cjs.map +1 -0
  21. package/dist/chunks/observeElementWidth-BlQOlW2t.js +12 -0
  22. package/dist/chunks/observeElementWidth-BlQOlW2t.js.map +1 -0
  23. package/dist/components/AppShell/index.cjs +1 -1
  24. package/dist/components/AppShell/index.cjs.map +1 -1
  25. package/dist/components/AppShell/index.d.cts +5 -1
  26. package/dist/components/AppShell/index.d.cts.map +1 -1
  27. package/dist/components/AppShell/index.d.ts +5 -1
  28. package/dist/components/AppShell/index.d.ts.map +1 -1
  29. package/dist/components/AppShell/index.js +53 -60
  30. package/dist/components/AppShell/index.js.map +1 -1
  31. package/dist/components/AppShell/style.css +48 -6
  32. package/dist/components/AssetCard/index.cjs +1 -1
  33. package/dist/components/AssetCard/index.cjs.map +1 -1
  34. package/dist/components/AssetCard/index.d.cts +1 -1
  35. package/dist/components/AssetCard/index.d.cts.map +1 -1
  36. package/dist/components/AssetCard/index.d.ts +1 -1
  37. package/dist/components/AssetCard/index.d.ts.map +1 -1
  38. package/dist/components/AssetCard/index.js +1 -1
  39. package/dist/components/AssetCard/index.js.map +1 -1
  40. package/dist/components/AssetCard/style.css +20 -9
  41. package/dist/components/AssetGrid/index.cjs +1 -1
  42. package/dist/components/AssetGrid/index.cjs.map +1 -1
  43. package/dist/components/AssetGrid/index.d.cts +1 -1
  44. package/dist/components/AssetGrid/index.d.cts.map +1 -1
  45. package/dist/components/AssetGrid/index.d.ts +1 -1
  46. package/dist/components/AssetGrid/index.d.ts.map +1 -1
  47. package/dist/components/AssetGrid/index.js +1 -1
  48. package/dist/components/AssetGrid/index.js.map +1 -1
  49. package/dist/components/Avatar/index.cjs.map +1 -1
  50. package/dist/components/Avatar/index.d.cts.map +1 -1
  51. package/dist/components/Avatar/index.d.ts.map +1 -1
  52. package/dist/components/Avatar/index.js.map +1 -1
  53. package/dist/components/Badge/index.cjs.map +1 -1
  54. package/dist/components/Badge/index.d.cts.map +1 -1
  55. package/dist/components/Badge/index.d.ts.map +1 -1
  56. package/dist/components/Badge/index.js.map +1 -1
  57. package/dist/components/Badge/style.css +2 -1
  58. package/dist/components/Board/index.cjs +1 -1
  59. package/dist/components/Board/index.d.cts.map +1 -1
  60. package/dist/components/Board/index.d.ts.map +1 -1
  61. package/dist/components/Board/index.js +1 -1
  62. package/dist/components/Board/keyboard.d.cts.map +1 -1
  63. package/dist/components/Board/keyboard.d.ts.map +1 -1
  64. package/dist/components/Board/moves.d.cts.map +1 -1
  65. package/dist/components/Board/moves.d.ts.map +1 -1
  66. package/dist/components/Board/style.css +12 -7
  67. package/dist/components/Button/index.cjs +1 -1
  68. package/dist/components/Button/index.cjs.map +1 -1
  69. package/dist/components/Button/index.d.cts.map +1 -1
  70. package/dist/components/Button/index.d.ts.map +1 -1
  71. package/dist/components/Button/index.js +1 -1
  72. package/dist/components/Button/index.js.map +1 -1
  73. package/dist/components/Button/style.css +1 -1
  74. package/dist/components/ButtonGroup/index.cjs.map +1 -1
  75. package/dist/components/ButtonGroup/index.d.cts.map +1 -1
  76. package/dist/components/ButtonGroup/index.d.ts.map +1 -1
  77. package/dist/components/ButtonGroup/index.js.map +1 -1
  78. package/dist/components/ButtonGroup/style.css +1 -0
  79. package/dist/components/Choice/index.cjs.map +1 -1
  80. package/dist/components/Choice/index.d.cts.map +1 -1
  81. package/dist/components/Choice/index.d.ts.map +1 -1
  82. package/dist/components/Choice/index.js.map +1 -1
  83. package/dist/components/Choice/style.css +1 -1
  84. package/dist/components/Container/style.css +1 -0
  85. package/dist/components/DatePicker/index.cjs +1 -1
  86. package/dist/components/DatePicker/index.cjs.map +1 -1
  87. package/dist/components/DatePicker/index.d.cts.map +1 -1
  88. package/dist/components/DatePicker/index.d.ts.map +1 -1
  89. package/dist/components/DatePicker/index.js +1 -1
  90. package/dist/components/DatePicker/index.js.map +1 -1
  91. package/dist/components/DatePicker/style.css +3 -1
  92. package/dist/components/Drawer/index.cjs +1 -1
  93. package/dist/components/Drawer/index.cjs.map +1 -1
  94. package/dist/components/Drawer/index.d.cts.map +1 -1
  95. package/dist/components/Drawer/index.d.ts.map +1 -1
  96. package/dist/components/Drawer/index.js +72 -70
  97. package/dist/components/Drawer/index.js.map +1 -1
  98. package/dist/components/Drawer/style.css +7 -2
  99. package/dist/components/EditLayout/index.cjs +2 -0
  100. package/dist/components/EditLayout/index.cjs.map +1 -0
  101. package/dist/components/EditLayout/index.d.cts +25 -0
  102. package/dist/components/EditLayout/index.d.cts.map +1 -0
  103. package/dist/components/EditLayout/index.d.ts +25 -0
  104. package/dist/components/EditLayout/index.d.ts.map +1 -0
  105. package/dist/components/EditLayout/index.js +239 -0
  106. package/dist/components/EditLayout/index.js.map +1 -0
  107. package/dist/components/EditLayout/style.css +226 -0
  108. package/dist/components/EntryPicker/index.cjs +1 -1
  109. package/dist/components/EntryPicker/index.cjs.map +1 -1
  110. package/dist/components/EntryPicker/index.d.cts.map +1 -1
  111. package/dist/components/EntryPicker/index.d.ts.map +1 -1
  112. package/dist/components/EntryPicker/index.js +1 -1
  113. package/dist/components/EntryPicker/index.js.map +1 -1
  114. package/dist/components/Field/index.cjs.map +1 -1
  115. package/dist/components/Field/index.d.cts.map +1 -1
  116. package/dist/components/Field/index.d.ts.map +1 -1
  117. package/dist/components/Field/index.js.map +1 -1
  118. package/dist/components/Field/style.css +1 -1
  119. package/dist/components/FieldAffix/index.cjs.map +1 -1
  120. package/dist/components/FieldAffix/index.d.cts.map +1 -1
  121. package/dist/components/FieldAffix/index.d.ts.map +1 -1
  122. package/dist/components/FieldAffix/index.js.map +1 -1
  123. package/dist/components/FormEditor/control.d.cts +1 -1
  124. package/dist/components/FormEditor/control.d.cts.map +1 -1
  125. package/dist/components/FormEditor/control.d.ts +1 -1
  126. package/dist/components/FormEditor/control.d.ts.map +1 -1
  127. package/dist/components/FormEditor/index.d.cts +1 -1
  128. package/dist/components/FormEditor/index.d.cts.map +1 -1
  129. package/dist/components/FormEditor/index.d.ts +1 -1
  130. package/dist/components/FormEditor/index.d.ts.map +1 -1
  131. package/dist/components/FormEditor/model.d.cts.map +1 -1
  132. package/dist/components/FormEditor/model.d.ts.map +1 -1
  133. package/dist/components/FormEditor/style.css +3 -1
  134. package/dist/components/Icon/icons.d.cts +1 -0
  135. package/dist/components/Icon/icons.d.cts.map +1 -1
  136. package/dist/components/Icon/icons.d.ts +1 -0
  137. package/dist/components/Icon/icons.d.ts.map +1 -1
  138. package/dist/components/Icon/index.cjs +1 -1
  139. package/dist/components/Icon/index.js +1 -1
  140. package/dist/components/Icon/style.css +1 -1
  141. package/dist/components/ImageCropper/index.cjs.map +1 -1
  142. package/dist/components/ImageCropper/index.d.cts +1 -1
  143. package/dist/components/ImageCropper/index.d.cts.map +1 -1
  144. package/dist/components/ImageCropper/index.d.ts +1 -1
  145. package/dist/components/ImageCropper/index.d.ts.map +1 -1
  146. package/dist/components/ImageCropper/index.js.map +1 -1
  147. package/dist/components/ImageCropper/style.css +28 -5
  148. package/dist/components/Menu/index.cjs.map +1 -1
  149. package/dist/components/Menu/index.d.cts.map +1 -1
  150. package/dist/components/Menu/index.d.ts.map +1 -1
  151. package/dist/components/Menu/index.js.map +1 -1
  152. package/dist/components/Menu/style.css +0 -1
  153. package/dist/components/Modal/index.cjs +1 -1
  154. package/dist/components/Modal/index.cjs.map +1 -1
  155. package/dist/components/Modal/index.d.cts.map +1 -1
  156. package/dist/components/Modal/index.d.ts.map +1 -1
  157. package/dist/components/Modal/index.js +47 -46
  158. package/dist/components/Modal/index.js.map +1 -1
  159. package/dist/components/Modal/style.css +2 -2
  160. package/dist/components/NumberField/index.cjs.map +1 -1
  161. package/dist/components/NumberField/index.d.cts.map +1 -1
  162. package/dist/components/NumberField/index.d.ts.map +1 -1
  163. package/dist/components/NumberField/index.js.map +1 -1
  164. package/dist/components/NumberField/style.css +4 -6
  165. package/dist/components/Pagination/index.cjs.map +1 -1
  166. package/dist/components/Pagination/index.d.cts.map +1 -1
  167. package/dist/components/Pagination/index.d.ts.map +1 -1
  168. package/dist/components/Pagination/index.js.map +1 -1
  169. package/dist/components/Popover/index.cjs.map +1 -1
  170. package/dist/components/Popover/index.d.cts.map +1 -1
  171. package/dist/components/Popover/index.d.ts.map +1 -1
  172. package/dist/components/Popover/index.js.map +1 -1
  173. package/dist/components/RichTextEditor/document.d.cts.map +1 -1
  174. package/dist/components/RichTextEditor/document.d.ts.map +1 -1
  175. package/dist/components/RichTextEditor/index.d.cts.map +1 -1
  176. package/dist/components/RichTextEditor/index.d.ts.map +1 -1
  177. package/dist/components/RichTextEditor/style.css +2 -2
  178. package/dist/components/SearchField/index.cjs +1 -1
  179. package/dist/components/SearchField/index.cjs.map +1 -1
  180. package/dist/components/SearchField/index.d.cts.map +1 -1
  181. package/dist/components/SearchField/index.d.ts.map +1 -1
  182. package/dist/components/SearchField/index.js +1 -1
  183. package/dist/components/SearchField/index.js.map +1 -1
  184. package/dist/components/SearchField/style.css +0 -1
  185. package/dist/components/Select/index.cjs +1 -1
  186. package/dist/components/Select/index.cjs.map +1 -1
  187. package/dist/components/Select/index.d.cts.map +1 -1
  188. package/dist/components/Select/index.d.ts.map +1 -1
  189. package/dist/components/Select/index.js +1 -1
  190. package/dist/components/Select/index.js.map +1 -1
  191. package/dist/components/SelectionCard/index.cjs.map +1 -1
  192. package/dist/components/SelectionCard/index.d.cts +1 -1
  193. package/dist/components/SelectionCard/index.d.cts.map +1 -1
  194. package/dist/components/SelectionCard/index.d.ts +1 -1
  195. package/dist/components/SelectionCard/index.d.ts.map +1 -1
  196. package/dist/components/SelectionCard/index.js.map +1 -1
  197. package/dist/components/SelectionCard/style.css +1 -5
  198. package/dist/components/SideNav/index.cjs +1 -1
  199. package/dist/components/SideNav/index.cjs.map +1 -1
  200. package/dist/components/SideNav/index.d.cts.map +1 -1
  201. package/dist/components/SideNav/index.d.ts.map +1 -1
  202. package/dist/components/SideNav/index.js +1 -1
  203. package/dist/components/SideNav/index.js.map +1 -1
  204. package/dist/components/SideNav/style.css +7 -2
  205. package/dist/components/Skeleton/index.cjs.map +1 -1
  206. package/dist/components/Skeleton/index.d.cts.map +1 -1
  207. package/dist/components/Skeleton/index.d.ts.map +1 -1
  208. package/dist/components/Skeleton/index.js.map +1 -1
  209. package/dist/components/Skeleton/style.css +2 -2
  210. package/dist/components/Slider/index.cjs.map +1 -1
  211. package/dist/components/Slider/index.d.cts.map +1 -1
  212. package/dist/components/Slider/index.d.ts.map +1 -1
  213. package/dist/components/Slider/index.js.map +1 -1
  214. package/dist/components/Slider/style.css +5 -16
  215. package/dist/components/SortableList/index.cjs +1 -1
  216. package/dist/components/SortableList/index.cjs.map +1 -1
  217. package/dist/components/SortableList/index.d.cts.map +1 -1
  218. package/dist/components/SortableList/index.d.ts.map +1 -1
  219. package/dist/components/SortableList/index.js +1 -1
  220. package/dist/components/SortableList/index.js.map +1 -1
  221. package/dist/components/SortableList/style.css +1 -1
  222. package/dist/components/Stepper/index.cjs +1 -1
  223. package/dist/components/Stepper/index.cjs.map +1 -1
  224. package/dist/components/Stepper/index.d.cts.map +1 -1
  225. package/dist/components/Stepper/index.d.ts.map +1 -1
  226. package/dist/components/Stepper/index.js +1 -1
  227. package/dist/components/Stepper/index.js.map +1 -1
  228. package/dist/components/Stepper/style.css +2 -2
  229. package/dist/components/SubNav/index.cjs +1 -1
  230. package/dist/components/SubNav/index.cjs.map +1 -1
  231. package/dist/components/SubNav/index.d.cts.map +1 -1
  232. package/dist/components/SubNav/index.d.ts.map +1 -1
  233. package/dist/components/SubNav/index.js +1 -1
  234. package/dist/components/SubNav/index.js.map +1 -1
  235. package/dist/components/Switch/index.cjs.map +1 -1
  236. package/dist/components/Switch/index.d.cts.map +1 -1
  237. package/dist/components/Switch/index.d.ts.map +1 -1
  238. package/dist/components/Switch/index.js.map +1 -1
  239. package/dist/components/Switch/style.css +2 -1
  240. package/dist/components/Table/index.cjs +1 -1
  241. package/dist/components/Table/index.cjs.map +1 -1
  242. package/dist/components/Table/index.d.cts.map +1 -1
  243. package/dist/components/Table/index.d.ts.map +1 -1
  244. package/dist/components/Table/index.js +1 -1
  245. package/dist/components/Table/index.js.map +1 -1
  246. package/dist/components/Table/style.css +1 -0
  247. package/dist/components/TagsInput/index.cjs.map +1 -1
  248. package/dist/components/TagsInput/index.d.cts.map +1 -1
  249. package/dist/components/TagsInput/index.d.ts.map +1 -1
  250. package/dist/components/TagsInput/index.js.map +1 -1
  251. package/dist/components/TagsInput/style.css +2 -1
  252. package/dist/components/TextField/index.cjs.map +1 -1
  253. package/dist/components/TextField/index.d.cts.map +1 -1
  254. package/dist/components/TextField/index.d.ts.map +1 -1
  255. package/dist/components/TextField/index.js.map +1 -1
  256. package/dist/components/Time/index.cjs.map +1 -1
  257. package/dist/components/Time/index.d.cts.map +1 -1
  258. package/dist/components/Time/index.d.ts.map +1 -1
  259. package/dist/components/Time/index.js.map +1 -1
  260. package/dist/components/Time/style.css +1 -2
  261. package/dist/components/Toast/index.cjs +1 -1
  262. package/dist/components/Toast/index.cjs.map +1 -1
  263. package/dist/components/Toast/index.d.cts.map +1 -1
  264. package/dist/components/Toast/index.d.ts.map +1 -1
  265. package/dist/components/Toast/index.js +1 -1
  266. package/dist/components/Toast/index.js.map +1 -1
  267. package/dist/components/Toast/style.css +1 -1
  268. package/dist/components/TopNav/index.cjs +1 -1
  269. package/dist/components/TopNav/index.cjs.map +1 -1
  270. package/dist/components/TopNav/index.d.cts.map +1 -1
  271. package/dist/components/TopNav/index.d.ts.map +1 -1
  272. package/dist/components/TopNav/index.js +1 -1
  273. package/dist/components/TopNav/index.js.map +1 -1
  274. package/dist/index.cjs +1 -1
  275. package/dist/index.d.cts +9 -7
  276. package/dist/index.d.cts.map +1 -1
  277. package/dist/index.d.ts +9 -7
  278. package/dist/index.d.ts.map +1 -1
  279. package/dist/index.js +4 -3
  280. package/dist/internal/dialogStack.d.cts +9 -0
  281. package/dist/internal/dialogStack.d.cts.map +1 -0
  282. package/dist/internal/dialogStack.d.ts +9 -0
  283. package/dist/internal/dialogStack.d.ts.map +1 -0
  284. package/dist/internal/lockBodyScroll.d.cts +7 -0
  285. package/dist/internal/lockBodyScroll.d.cts.map +1 -0
  286. package/dist/internal/lockBodyScroll.d.ts +7 -0
  287. package/dist/internal/lockBodyScroll.d.ts.map +1 -0
  288. package/dist/internal/observeElementWidth.d.cts +3 -0
  289. package/dist/internal/observeElementWidth.d.cts.map +1 -0
  290. package/dist/internal/observeElementWidth.d.ts +3 -0
  291. package/dist/internal/observeElementWidth.d.ts.map +1 -0
  292. package/dist/reset.css +29 -4
  293. package/dist/styles.css +20 -16
  294. package/dist/test/dragEvent.d.cts.map +1 -1
  295. package/dist/test/dragEvent.d.ts.map +1 -1
  296. package/dist/tokens.css +77 -40
  297. package/package.json +9 -2
  298. package/dist/chunks/Board-BLhB5_xx.cjs.map +0 -1
  299. package/dist/chunks/Board-BTFSzn6c.js.map +0 -1
  300. package/dist/chunks/Icon-CGY1FNXT.js +0 -77
  301. package/dist/chunks/Icon-CGY1FNXT.js.map +0 -1
  302. package/dist/chunks/Icon-CWsA1W83.cjs +0 -2
  303. package/dist/chunks/Icon-CWsA1W83.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Icon","mergeRefs","isItem","isValidElement","child","SortableList","forwardRef","rest","dndId","useId","activeId","setActiveId","useState","order","setOrder","items","prevItems","setPrevItems","sensors","useSensors","useSensor","PointerSensor","KeyboardSensor","sortableKeyboardCoordinates","handleStart","useCallback","event","handleEnd","over","active","from","to","next","arrayMove","onReorder","childArray","Children","children","rows","ordered","id","activeRow","DndContext","closestCenter","restrictToVerticalAxis","SortableContext","verticalListSortingStrategy","className","DragOverlay","renderDragOverlay","SortableListItem","useSortable","setNodeRef","ref","CSS","transform","isDragging","Button","label","attributes","listeners","action"],"sources":["../../../src/components/SortableList/index.tsx"],"sourcesContent":["import {\n Children,\n forwardRef,\n isValidElement,\n useCallback,\n useId,\n useState,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport {\n DndContext,\n DragOverlay,\n KeyboardSensor,\n PointerSensor,\n closestCenter,\n useSensor,\n useSensors,\n type DragEndEvent,\n type DragStartEvent,\n} from \"@dnd-kit/core\";\nimport { restrictToVerticalAxis } from \"@dnd-kit/modifiers\";\nimport {\n SortableContext,\n arrayMove,\n sortableKeyboardCoordinates,\n useSortable,\n verticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport { Button } from \"../Button\";\nimport { Icon } from \"../Icon\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport \"./style.css\";\n\nexport interface SortableListProps extends Omit<HTMLAttributes<HTMLUListElement>, \"onDragEnd\"> {\n /** Item ids in render order. */\n items: string[];\n /** Fired with the whole list in its new order. Apply it to your own state. */\n onReorder?: (items: string[]) => void;\n /** Rendered inside the drag overlay while a row is in the air. Defaults to the row's content. */\n renderDragOverlay?: (id: string) => ReactNode;\n children?: ReactNode;\n}\n\ntype ItemElement = ReactElement<SortableListItemProps>;\n\nfunction isItem(child: ReactNode): child is ItemElement {\n return isValidElement<SortableListItemProps>(child) && typeof child.props.id === \"string\";\n}\n\n/**\n * A single vertical list you can re-order — the board's mechanics without the\n * lanes. Each row carries a grip on the left. The list keeps the dropped order\n * itself, so it works on its own; pass `onReorder` to mirror it into your data.\n * A new `items` value from the parent always wins.\n */\nexport const SortableList = forwardRef<HTMLUListElement, SortableListProps>(\n function SortableList({ items, onReorder, renderDragOverlay, className, children, ...rest }, ref) {\n const dndId = useId();\n const [activeId, setActiveId] = useState<string | null>(null);\n const [order, setOrder] = useState(items);\n const [prevItems, setPrevItems] = useState(items);\n if (items !== prevItems && items.join(\"\\u0000\") !== prevItems.join(\"\\u0000\")) {\n setPrevItems(items);\n setOrder(items);\n }\n const sensors = useSensors(\n useSensor(PointerSensor, { activationConstraint: { distance: 4 } }),\n useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }),\n );\n\n const handleStart = useCallback((event: DragStartEvent) => {\n setActiveId(String(event.active.id));\n }, []);\n\n const handleEnd = useCallback(\n (event: DragEndEvent) => {\n setActiveId(null);\n const { active, over } = event;\n if (!over || active.id === over.id) return;\n const from = order.indexOf(String(active.id));\n const to = order.indexOf(String(over.id));\n if (from < 0 || to < 0) return;\n const next = arrayMove(order, from, to);\n setOrder(next);\n onReorder?.(next);\n },\n [order, onReorder],\n );\n\n // Rows follow the list's own order; anything that isn't a row keeps its place at the end.\n const childArray = Children.toArray(children);\n const rows = new Map(childArray.filter(isItem).map((child) => [child.props.id, child]));\n const ordered = [\n ...order.flatMap((id) => rows.get(id) ?? []),\n ...childArray.filter((child) => !isItem(child) || !order.includes(child.props.id)),\n ];\n const activeRow = activeId ? rows.get(activeId) : undefined;\n\n return (\n <DndContext\n id={`ds-sortable-list-${dndId}`}\n sensors={sensors}\n collisionDetection={closestCenter}\n modifiers={[restrictToVerticalAxis]}\n onDragStart={handleStart}\n onDragEnd={handleEnd}\n onDragCancel={() => setActiveId(null)}\n >\n <SortableContext items={order} strategy={verticalListSortingStrategy}>\n <ul\n ref={ref}\n className={[\"ds-sortable-list\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {ordered}\n </ul>\n </SortableContext>\n <DragOverlay>\n {activeId ? (\n <div className=\"ds-sortable-item\" data-overlay>\n <span className=\"ds-sortable-item__handle\" aria-hidden=\"true\">\n <Icon name=\"grip-vertical\" />\n </span>\n <div className=\"ds-sortable-item__content\">\n {renderDragOverlay ? renderDragOverlay(activeId) : activeRow?.props.children}\n </div>\n </div>\n ) : null}\n </DragOverlay>\n </DndContext>\n );\n },\n);\n\nexport interface SortableListItemProps extends HTMLAttributes<HTMLLIElement> {\n id: string;\n /** Accessible name announced when the row is picked up. */\n label?: string;\n /** A control at the end of the row, e.g. a menu or a delete button. */\n action?: ReactNode;\n children?: ReactNode;\n}\n\n/** One row of a `SortableList`. The grip on the left is the only handle. */\nexport const SortableListItem = forwardRef<HTMLLIElement, SortableListItemProps>(\n function SortableListItem({ id, label, action, className, children, ...rest }, ref) {\n const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({\n id,\n });\n\n return (\n <li\n ref={mergeRefs(setNodeRef, ref)}\n style={{ transform: CSS.Translate.toString(transform), transition }}\n className={[\"ds-sortable-item\", className].filter(Boolean).join(\" \")}\n data-dragging={isDragging || undefined}\n {...rest}\n >\n <Button\n variant=\"simple\"\n size=\"sm\"\n isIconOnly\n iconStart=\"grip-vertical\"\n className=\"ds-sortable-item__handle\"\n aria-label={label ? `Move ${label}` : \"Move item\"}\n {...attributes}\n {...listeners}\n />\n <div className=\"ds-sortable-item__content\">{children}</div>\n {action && <div className=\"ds-sortable-item__action\">{action}</div>}\n </li>\n );\n },\n);\n"],"mappings":";;;;;;;;;;AAgDA,SAASE,EAAO,GAAwC;CACtD,OAAOC,EAAsCC,CAAK,KAAK,OAAOA,EAAM,MAAM,MAAO;AACnF;AAQA,IAAaC,IAAeC,EAC1B,SAAsB,EAAE,UAAO,cAAW,sBAAmB,cAAW,aAAU,GAAGC,KAAQ,GAAK;CAChG,IAAMC,IAAQC,EAAM,GACd,CAACC,GAAUC,KAAeC,EAAwB,IAAI,GACtD,CAACC,GAAOC,KAAYF,EAASG,CAAK,GAClC,CAACC,GAAWC,KAAgBL,EAASG,CAAK;CAChD,AAAIA,MAAUC,KAAaD,EAAM,KAAK,IAAQ,MAAMC,EAAU,KAAK,IAAQ,MACzEC,EAAaF,CAAK,GAClBD,EAASC,CAAK;CAEhB,IAAMG,IAAUC,EACdC,EAAUC,GAAe,EAAE,sBAAsB,EAAE,UAAU,EAAE,EAAE,CAAC,GAClED,EAAUE,GAAgB,EAAE,kBAAkBC,EAA4B,CAAC,CAC7E,GAEMC,IAAcC,GAAa,MAA0B;EACzD,EAAY,OAAOC,EAAM,OAAO,EAAE,CAAC;CACrC,GAAG,CAAC,CAAC,GAECC,IAAYF,GACf,MAAwB;EACvB,EAAY,IAAI;EAChB,IAAM,EAAE,WAAQ,YAASC;EACzB,IAAI,CAACE,KAAQC,EAAO,OAAOD,EAAK,IAAI;EACpC,IAAME,IAAOjB,EAAM,QAAQ,OAAOgB,EAAO,EAAE,CAAC,GACtCE,IAAKlB,EAAM,QAAQ,OAAOe,EAAK,EAAE,CAAC;EACxC,IAAIE,IAAO,KAAKC,IAAK,GAAG;EACxB,IAAMC,IAAOC,EAAUpB,GAAOiB,GAAMC,CAAE;EAEtC,AADAjB,EAASkB,CAAI,GACbE,IAAYF,CAAI;CAClB,GACA,CAACnB,GAAOqB,CAAS,CACnB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Y,cAAW,eAAY,cAAW,eAAY,kBAAe4C,EAAY,EAC3F,MACF,CAAC;CAED,OACE,kBAAC,MAAD;EACE,KAAKlD,EAAUmD,GAAYC,CAAG;EAC9B,OAAO;GAAE,WAAWC,EAAI,UAAU,SAASC,CAAS;GAAG;EAAW;EAClE,WAAW,CAAC,oBAAoBR,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EACnE,iBAAeS,KAAc,KAAA;EAC7B,GAAIjD;EALN,UAAA;GAOE,kBAACkD,GAAD;IACE,SAAQ;IACR,MAAK;IACL,YAAA;IACA,WAAU;IACV,WAAU;IACV,cAAYC,IAAQ,QAAQA,MAAU;IACtC,GAAIC;IACJ,GAAIC;GACL,CAAA;GACD,kBAAC,OAAD;IAAK,WAAU;IAA6B;GAAc,CAAA;GACzDC,KAAU,kBAAC,OAAD;IAAK,WAAU;IAA4B,UAAAA;GAAY,CAAA;EAChE;;AAER,CACF"}
1
+ {"version":3,"file":"index.js","names":["Icon","mergeRefs","isItem","isValidElement","child","SortableList","forwardRef","rest","dndId","useId","activeId","setActiveId","useState","order","setOrder","items","prevItems","setPrevItems","sensors","useSensors","useSensor","PointerSensor","KeyboardSensor","sortableKeyboardCoordinates","handleStart","useCallback","event","handleEnd","over","active","from","to","next","arrayMove","onReorder","childArray","Children","children","rows","ordered","id","activeRow","DndContext","closestCenter","restrictToVerticalAxis","SortableContext","verticalListSortingStrategy","className","DragOverlay","renderDragOverlay","SortableListItem","useSortable","setNodeRef","ref","CSS","transform","isDragging","Button","label","attributes","listeners","action"],"sources":["../../../src/components/SortableList/index.tsx"],"sourcesContent":["import {\n Children,\n forwardRef,\n isValidElement,\n useCallback,\n useId,\n useState,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport {\n DndContext,\n DragOverlay,\n KeyboardSensor,\n PointerSensor,\n closestCenter,\n useSensor,\n useSensors,\n type DragEndEvent,\n type DragStartEvent,\n} from \"@dnd-kit/core\";\nimport { restrictToVerticalAxis } from \"@dnd-kit/modifiers\";\nimport {\n SortableContext,\n arrayMove,\n sortableKeyboardCoordinates,\n useSortable,\n verticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport { Button } from \"../Button\";\nimport { Icon } from \"../Icon\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport \"./style.css\";\n\nexport interface SortableListProps extends Omit<HTMLAttributes<HTMLUListElement>, \"onDragEnd\"> {\n /** Item ids in render order. */\n items: string[];\n /** Fired with the whole list in its new order. Apply it to your own state. */\n onReorder?: (items: string[]) => void;\n /** Rendered inside the drag overlay while a row is in the air. Defaults to the row's content. */\n renderDragOverlay?: (id: string) => ReactNode;\n children?: ReactNode;\n}\n\ntype ItemElement = ReactElement<SortableListItemProps>;\n\nfunction isItem(child: ReactNode): child is ItemElement {\n return isValidElement<SortableListItemProps>(child) && typeof child.props.id === \"string\";\n}\n\n/**\n * A single vertical list you can re-order — the board's mechanics without the\n * lanes. Each row carries a grip on the left. The list keeps the dropped order\n * itself, so it works on its own; pass `onReorder` to mirror it into your data.\n * A new `items` value from the parent always wins.\n */\nexport const SortableList = forwardRef<HTMLUListElement, SortableListProps>(function SortableList(\n { items, onReorder, renderDragOverlay, className, children, ...rest },\n ref,\n) {\n const dndId = useId();\n const [activeId, setActiveId] = useState<string | null>(null);\n const [order, setOrder] = useState(items);\n const [prevItems, setPrevItems] = useState(items);\n if (items !== prevItems && items.join(\"\\u0000\") !== prevItems.join(\"\\u0000\")) {\n setPrevItems(items);\n setOrder(items);\n }\n const sensors = useSensors(\n useSensor(PointerSensor, { activationConstraint: { distance: 4 } }),\n useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }),\n );\n\n const handleStart = useCallback((event: DragStartEvent) => {\n setActiveId(String(event.active.id));\n }, []);\n\n const handleEnd = useCallback(\n (event: DragEndEvent) => {\n setActiveId(null);\n const { active, over } = event;\n if (!over || active.id === over.id) return;\n const from = order.indexOf(String(active.id));\n const to = order.indexOf(String(over.id));\n if (from < 0 || to < 0) return;\n const next = arrayMove(order, from, to);\n setOrder(next);\n onReorder?.(next);\n },\n [order, onReorder],\n );\n\n // Rows follow the list's own order; anything that isn't a row keeps its place at the end.\n const childArray = Children.toArray(children);\n const rows = new Map(childArray.filter(isItem).map((child) => [child.props.id, child]));\n const ordered = [\n ...order.flatMap((id) => rows.get(id) ?? []),\n ...childArray.filter((child) => !isItem(child) || !order.includes(child.props.id)),\n ];\n const activeRow = activeId ? rows.get(activeId) : undefined;\n\n return (\n <DndContext\n id={`ds-sortable-list-${dndId}`}\n sensors={sensors}\n collisionDetection={closestCenter}\n modifiers={[restrictToVerticalAxis]}\n onDragStart={handleStart}\n onDragEnd={handleEnd}\n onDragCancel={() => setActiveId(null)}\n >\n <SortableContext\n items={order}\n strategy={verticalListSortingStrategy}\n >\n <ul\n ref={ref}\n className={[\"ds-sortable-list\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {ordered}\n </ul>\n </SortableContext>\n <DragOverlay>\n {activeId ? (\n <div\n className=\"ds-sortable-item\"\n data-overlay\n >\n <span\n className=\"ds-sortable-item__handle\"\n aria-hidden=\"true\"\n >\n <Icon name=\"grip-vertical\" />\n </span>\n <div className=\"ds-sortable-item__content\">\n {renderDragOverlay ? renderDragOverlay(activeId) : activeRow?.props.children}\n </div>\n </div>\n ) : null}\n </DragOverlay>\n </DndContext>\n );\n});\n\nexport interface SortableListItemProps extends HTMLAttributes<HTMLLIElement> {\n id: string;\n /** Accessible name announced when the row is picked up. */\n label?: string;\n /** A control at the end of the row, e.g. a menu or a delete button. */\n action?: ReactNode;\n children?: ReactNode;\n}\n\n/** One row of a `SortableList`. The grip on the left is the only handle. */\nexport const SortableListItem = forwardRef<HTMLLIElement, SortableListItemProps>(\n function SortableListItem({ id, label, action, className, children, ...rest }, ref) {\n const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({\n id,\n });\n\n return (\n <li\n ref={mergeRefs(setNodeRef, ref)}\n style={{ transform: CSS.Translate.toString(transform), transition }}\n className={[\"ds-sortable-item\", className].filter(Boolean).join(\" \")}\n data-dragging={isDragging || undefined}\n {...rest}\n >\n <Button\n variant=\"simple\"\n size=\"sm\"\n isIconOnly\n iconStart=\"grip-vertical\"\n className=\"ds-sortable-item__handle\"\n aria-label={label ? `Move ${label}` : \"Move item\"}\n {...attributes}\n {...listeners}\n />\n <div className=\"ds-sortable-item__content\">{children}</div>\n {action && <div className=\"ds-sortable-item__action\">{action}</div>}\n </li>\n );\n },\n);\n"],"mappings":";;;;;;;;;;AAgDA,SAASE,EAAO,GAAwC;CACtD,OAAOC,EAAsCC,CAAK,KAAK,OAAOA,EAAM,MAAM,MAAO;AACnF;AAQA,IAAaC,IAAeC,EAAgD,SAC1E,EAAE,UAAO,cAAW,sBAAmB,cAAW,aAAU,GAAGC,KAC/D,GACA;CACA,IAAMC,IAAQC,EAAM,GACd,CAACC,GAAUC,KAAeC,EAAwB,IAAI,GACtD,CAACC,GAAOC,KAAYF,EAASG,CAAK,GAClC,CAACC,GAAWC,KAAgBL,EAASG,CAAK;CAChD,AAAIA,MAAUC,KAAaD,EAAM,KAAK,IAAQ,MAAMC,EAAU,KAAK,IAAQ,MACzEC,EAAaF,CAAK,GAClBD,EAASC,CAAK;CAEhB,IAAMG,IAAUC,EACdC,EAAUC,GAAe,EAAE,sBAAsB,EAAE,UAAU,EAAE,EAAE,CAAC,GAClED,EAAUE,GAAgB,EAAE,kBAAkBC,EAA4B,CAAC,CAC7E,GAEMC,IAAcC,GAAa,MAA0B;EACzD,EAAY,OAAOC,EAAM,OAAO,EAAE,CAAC;CACrC,GAAG,CAAC,CAAC,GAECC,IAAYF,GACf,MAAwB;EACvB,EAAY,IAAI;EAChB,IAAM,EAAE,WAAQ,YAASC;EACzB,IAAI,CAACE,KAAQC,EAAO,OAAOD,EAAK,IAAI;EACpC,IAAME,IAAOjB,EAAM,QAAQ,OAAOgB,EAAO,EAAE,CA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D,IAAoBA,EAAkBvC,CAAQ,IAAI+B,GAAW,MAAM;GACjE,CAAA,CACF;EACH,CAAA,IAAA,KACO,CAAA,CACH;;AAEhB,CAAC,GAYYS,IAAmB5C,EAC9B,SAA0B,EAAE,OAAI,UAAO,WAAQ,cAAW,aAAU,GAAGC,KAAQ,GAAK;CAClF,IAAM,EAAE,eAAY,cAAW,eAAY,cAAW,eAAY,kBAAe4C,EAAY,EAC3F,MACF,CAAC;CAED,OACE,kBAAC,MAAD;EACE,KAAKlD,EAAUmD,GAAYC,CAAG;EAC9B,OAAO;GAAE,WAAWC,EAAI,UAAU,SAASC,CAAS;GAAG;EAAW;EAClE,WAAW,CAAC,oBAAoBR,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EACnE,iBAAeS,KAAc,KAAA;EAC7B,GAAIjD;EALN,UAAA;GAOE,kBAACkD,GAAD;IACE,SAAQ;IACR,MAAK;IACL,YAAA;IACA,WAAU;IACV,WAAU;IACV,cAAYC,IAAQ,QAAQA,MAAU;IACtC,GAAIC;IACJ,GAAIC;GACL,CAAA;GACD,kBAAC,OAAD;IAAK,WAAU;IAA6B;GAAc,CAAA;GACzDC,KAAU,kBAAC,OAAD;IAAK,WAAU;IAA4B,UAAAA;GAAY,CAAA;EAChE;;AAER,CACF"}
@@ -26,7 +26,7 @@
26
26
  }
27
27
 
28
28
  .ds-sortable-item[data-dragging] {
29
- opacity: 35%;
29
+ opacity: 0.35;
30
30
  }
31
31
 
32
32
  .ds-sortable-item[data-overlay] {
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-CWsA1W83.cjs"),t=require("../Button/index.cjs");let n=require("react"),r=require("react/jsx-runtime");function i(e,t){return e<t?`complete`:e===t?`current`:`upcoming`}var a=(0,n.forwardRef)(function({steps:a,activeStep:o,size:s=`md`,label:c=`Progress`,onStepChange:l,className:u,...d},f){let p=(0,n.useId)();return(0,r.jsx)(`nav`,{ref:f,"aria-label":c,"data-size":s,className:[`ds-stepper`,u].filter(Boolean).join(` `),...d,children:(0,r.jsx)(`ol`,{className:`ds-stepper__list`,children:a.map((n,a)=>{let s=i(a,o),c=!!l&&s!==`upcoming`,u=(0,r.jsxs)(r.Fragment,{children:[s===`complete`?(0,r.jsx)(e.t,{name:`check`,size:16,"aria-hidden":`true`}):a+1,(0,r.jsx)(`span`,{id:`${p}-${a}-status`,className:`ds-stepper__sr`,children:s})]});return(0,r.jsxs)(`li`,{className:`ds-stepper__step`,"data-status":s,"aria-current":s===`current`?`step`:void 0,children:[(0,r.jsxs)(`span`,{className:`ds-stepper__track`,"aria-hidden":`true`,children:[(0,r.jsx)(`span`,{className:`ds-stepper__connector`,"data-side":`start`}),(0,r.jsx)(`span`,{className:`ds-stepper__connector`,"data-side":`end`})]}),c?(0,r.jsx)(t.Button,{className:`ds-stepper__marker`,variant:s===`complete`?`primary`:`active`,size:`sm`,isIconOnly:!0,"aria-labelledby":`${p}-${a}-label`,"aria-describedby":`${p}-${a}-status`,onClick:()=>l?.(a,n.id),children:u}):(0,r.jsx)(`span`,{className:`ds-stepper__marker`,children:u}),(0,r.jsxs)(`span`,{className:`ds-stepper__text`,children:[(0,r.jsx)(`span`,{id:`${p}-${a}-label`,className:`ds-stepper__label`,children:n.label}),n.description&&(0,r.jsx)(`span`,{className:`ds-stepper__description`,children:n.description})]})]},n.id)})})})});exports.Stepper=a;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-CW6qJcDy.cjs"),t=require("../Button/index.cjs");let n=require("react"),r=require("react/jsx-runtime");function i(e,t){return e<t?`complete`:e===t?`current`:`upcoming`}var a=(0,n.forwardRef)(function({steps:a,activeStep:o,size:s=`md`,label:c=`Progress`,onStepChange:l,className:u,...d},f){let p=(0,n.useId)();return(0,r.jsx)(`nav`,{ref:f,"aria-label":c,"data-size":s,className:[`ds-stepper`,u].filter(Boolean).join(` `),...d,children:(0,r.jsx)(`ol`,{className:`ds-stepper__list`,children:a.map((n,a)=>{let s=i(a,o),c=!!l&&s!==`upcoming`,u=(0,r.jsxs)(r.Fragment,{children:[s===`complete`?(0,r.jsx)(e.t,{name:`check`,size:16,"aria-hidden":`true`}):a+1,(0,r.jsx)(`span`,{id:`${p}-${a}-status`,className:`ds-stepper__sr`,children:s})]});return(0,r.jsxs)(`li`,{className:`ds-stepper__step`,"data-status":s,"aria-current":s===`current`?`step`:void 0,children:[(0,r.jsxs)(`span`,{className:`ds-stepper__track`,"aria-hidden":`true`,children:[(0,r.jsx)(`span`,{className:`ds-stepper__connector`,"data-side":`start`}),(0,r.jsx)(`span`,{className:`ds-stepper__connector`,"data-side":`end`})]}),c?(0,r.jsx)(t.Button,{className:`ds-stepper__marker`,variant:s===`complete`?`primary`:`active`,size:`sm`,isIconOnly:!0,"aria-labelledby":`${p}-${a}-label`,"aria-describedby":`${p}-${a}-status`,onClick:()=>l?.(a,n.id),children:u}):(0,r.jsx)(`span`,{className:`ds-stepper__marker`,children:u}),(0,r.jsxs)(`span`,{className:`ds-stepper__text`,children:[(0,r.jsx)(`span`,{id:`${p}-${a}-label`,className:`ds-stepper__label`,children:n.label}),n.description&&(0,r.jsx)(`span`,{className:`ds-stepper__description`,children:n.description})]})]},n.id)})})})});exports.Stepper=a;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["forwardRef","useId","_Fragment","Icon","Button","require_Icon","require_components_Button_index","react","react_jsx_runtime","statusOf","index","activeStep","Stepper","rest","id","label","size","className","steps","status","interactive","onStepChange","marker","step"],"sources":["../../../src/components/Stepper/index.tsx"],"sourcesContent":["import { forwardRef, useId, type HTMLAttributes, type ReactNode } from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport \"./style.css\";\n\nexport type StepperSize = \"sm\" | \"md\";\nexport type StepStatus = \"complete\" | \"current\" | \"upcoming\";\n\nexport interface Step {\n /** Stable key, and the value reported by `onStepChange`. */\n id: string;\n /** The step in the user's words — sentence case. */\n label: ReactNode;\n /** One line on what happens here. */\n description?: ReactNode;\n}\n\nexport interface StepperProps\n extends Omit<HTMLAttributes<HTMLElement>, \"onChange\" | \"children\"> {\n /** The ordered steps. Three or more spread evenly across the full width. */\n steps: Step[];\n /** Index of the step being worked on. Everything before it reads as complete. */\n activeStep: number;\n /** Marker scale. `sm` for a toolbar band, `md` for a page header. */\n size?: StepperSize;\n /** Accessible name for the progress bar. */\n label?: string;\n /**\n * Makes completed steps (and the current one) navigable. Omit for a\n * read-only progress indicator.\n */\n onStepChange?: (index: number, id: string) => void;\n}\n\nfunction statusOf(index: number, activeStep: number): StepStatus {\n if (index < activeStep) return \"complete\";\n if (index === activeStep) return \"current\";\n return \"upcoming\";\n}\n\n/**\n * A linear progress rail: 1 - 2 - 3. Steps share the row equally however many\n * there are, so the last marker always lands on the trailing edge.\n */\nexport const Stepper = forwardRef<HTMLElement, StepperProps>(function Stepper(\n { steps, activeStep, size = \"md\", label = \"Progress\", onStepChange, className, ...rest },\n ref,\n) {\n const id = useId();\n return (\n <nav\n ref={ref}\n aria-label={label}\n data-size={size}\n className={[\"ds-stepper\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n <ol className=\"ds-stepper__list\">\n {steps.map((step, index) => {\n const status = statusOf(index, activeStep);\n const interactive = Boolean(onStepChange) && status !== \"upcoming\";\n const marker = <>\n {status === \"complete\" ? <Icon name=\"check\" size={16} aria-hidden=\"true\" /> : index + 1}\n <span id={`${id}-${index}-status`} className=\"ds-stepper__sr\">{status}</span>\n </>;\n return (\n <li\n key={step.id}\n className=\"ds-stepper__step\"\n data-status={status}\n aria-current={status === \"current\" ? \"step\" : undefined}\n >\n <span className=\"ds-stepper__track\" aria-hidden=\"true\">\n <span className=\"ds-stepper__connector\" data-side=\"start\" />\n <span className=\"ds-stepper__connector\" data-side=\"end\" />\n </span>\n {interactive ? <Button\n className=\"ds-stepper__marker\"\n variant={status === \"complete\" ? \"primary\" : \"active\"}\n size=\"sm\"\n isIconOnly\n aria-labelledby={`${id}-${index}-label`}\n aria-describedby={`${id}-${index}-status`}\n onClick={() => onStepChange?.(index, step.id)}\n >{marker}</Button> : <span className=\"ds-stepper__marker\">{marker}</span>}\n <span className=\"ds-stepper__text\">\n <span id={`${id}-${index}-label`} className=\"ds-stepper__label\">{step.label}</span>\n {step.description && (\n <span className=\"ds-stepper__description\">{step.description}</span>\n )}\n </span>\n </li>\n );\n })}\n </ol>\n </nav>\n );\n});\n"],"mappings":"A,4MAkCA,SAASS,EAAS,EAAe,EAAgC,CAG/D,OAFIC,EAAQC,EAAmB,WAC3BD,IAAUC,EAAmB,UAC1B,UACT,CAMA,IAAaC,GAAA,EAAUZ,EAAAA,WAAAA,CAAsC,SAC3D,CAAE,QAAO,aAAY,OAAO,KAAM,QAAQ,WAAY,eAAc,YAAW,GAAGa,GAClF,EACA,CACA,IAAMC,GAAA,EAAKb,EAAAA,MAAAA,CAAM,EACjB,OACE,EAAAO,EAAA,IAAA,CAAC,MAAD,CACO,MACL,aAAYO,EACZ,YAAWC,EACX,UAAW,CAAC,aAAcC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAC7D,GAAIJ,EAEJ,UAAA,EAAAL,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,mBACX,SAAAU,EAAM,KAAK,EAAM,IAAU,CAC1B,IAAMC,EAASV,EAASC,EAAOC,CAAU,EACnCS,EAAc,EAAQC,GAAiBF,IAAW,WAClDG,GAAS,EAAAd,EAAA,KAAA,CAAAN,EAAAA,SAAA,CAAA,SAAA,CACZiB,IAAW,YAAa,EAAAX,EAAA,IAAA,CAACL,EAAAA,EAAD,CAAM,KAAK,QAAQ,KAAM,GAAI,cAAY,MAAQ,CAAA,EAAIO,EAAQ,GACtF,EAAAF,EAAA,IAAA,CAAC,OAAD,CAAM,GAAI,GAAGM,EAAG,GAAGJ,EAAM,SAAU,UAAU,iBAAkB,SAAAS,CAAa,CAAA,CAC5E,CAAA,CAAA,EACF,OACE,EAAAX,EAAA,KAAA,CAAC,KAAD,CAEE,UAAU,mBACV,cAAaW,EACb,eAAcA,IAAW,UAAY,OAAS,IAAA,GAJhD,SAAA,EAME,EAAAX,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,oBAAoB,cAAY,OAAhD,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,wBAAwB,YAAU,OAAS,CAAA,GAC3D,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,wBAAwB,YAAU,KAAO,CAAA,CACrD,C,GACLY,GAAc,EAAAZ,EAAA,IAAA,CAACJ,EAAAA,OAAD,CACb,UAAU,qBACV,QAASe,IAAW,WAAa,UAAY,SAC7C,KAAK,KACL,WAAA,GACA,kBAAiB,GAAGL,EAAG,GAAGJ,EAAM,QAChC,mBAAkB,GAAGI,EAAG,GAAGJ,EAAM,SACjC,YAAeW,IAAeX,EAAOa,EAAK,EAAE,EAC5C,SAAAD,CAAe,CAAA,GAAI,EAAAd,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,qBAAsB,SAAAc,CAAa,CAAA,GACxE,EAAAd,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,mBAAhB,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,GAAI,GAAGM,EAAG,GAAGJ,EAAM,QAAS,UAAU,oBAAqB,SAAAa,EAAK,KAAY,CAAA,EACjFA,EAAK,cACJ,EAAAf,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,0BAA2B,SAAAe,EAAK,WAAkB,CAAA,CAEhE,C,EACJ,CAxBG,EAAAA,EAAK,EAwBR,CAER,CAAC,CACC,CAAA,CACD,CAAA,CAET,CAAC,E"}
1
+ {"version":3,"file":"index.cjs","names":["forwardRef","useId","_Fragment","Icon","Button","require_Icon","require_components_Button_index","react","react_jsx_runtime","statusOf","index","activeStep","Stepper","rest","id","label","size","className","steps","status","interactive","onStepChange","marker","step"],"sources":["../../../src/components/Stepper/index.tsx"],"sourcesContent":["import { forwardRef, useId, type HTMLAttributes, type ReactNode } from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport \"./style.css\";\n\nexport type StepperSize = \"sm\" | \"md\";\nexport type StepStatus = \"complete\" | \"current\" | \"upcoming\";\n\nexport interface Step {\n /** Stable key, and the value reported by `onStepChange`. */\n id: string;\n /** The step in the user's words — sentence case. */\n label: ReactNode;\n /** One line on what happens here. */\n description?: ReactNode;\n}\n\nexport interface StepperProps extends Omit<HTMLAttributes<HTMLElement>, \"onChange\" | \"children\"> {\n /** The ordered steps. Three or more spread evenly across the full width. */\n steps: Step[];\n /** Index of the step being worked on. Everything before it reads as complete. */\n activeStep: number;\n /** Marker scale. `sm` for a toolbar band, `md` for a page header. */\n size?: StepperSize;\n /** Accessible name for the progress bar. */\n label?: string;\n /**\n * Makes completed steps (and the current one) navigable. Omit for a\n * read-only progress indicator.\n */\n onStepChange?: (index: number, id: string) => void;\n}\n\nfunction statusOf(index: number, activeStep: number): StepStatus {\n if (index < activeStep) return \"complete\";\n if (index === activeStep) return \"current\";\n return \"upcoming\";\n}\n\n/**\n * A linear progress rail: 1 - 2 - 3. Steps share the row equally however many\n * there are, so the last marker always lands on the trailing edge.\n */\nexport const Stepper = forwardRef<HTMLElement, StepperProps>(function Stepper(\n { steps, activeStep, size = \"md\", label = \"Progress\", onStepChange, className, ...rest },\n ref,\n) {\n const id = useId();\n return (\n <nav\n ref={ref}\n aria-label={label}\n data-size={size}\n className={[\"ds-stepper\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n <ol className=\"ds-stepper__list\">\n {steps.map((step, index) => {\n const status = statusOf(index, activeStep);\n const interactive = Boolean(onStepChange) && status !== \"upcoming\";\n const marker = (\n <>\n {status === \"complete\" ? (\n <Icon\n name=\"check\"\n size={16}\n aria-hidden=\"true\"\n />\n ) : (\n index + 1\n )}\n <span\n id={`${id}-${index}-status`}\n className=\"ds-stepper__sr\"\n >\n {status}\n </span>\n </>\n );\n return (\n <li\n key={step.id}\n className=\"ds-stepper__step\"\n data-status={status}\n aria-current={status === \"current\" ? \"step\" : undefined}\n >\n <span\n className=\"ds-stepper__track\"\n aria-hidden=\"true\"\n >\n <span\n className=\"ds-stepper__connector\"\n data-side=\"start\"\n />\n <span\n className=\"ds-stepper__connector\"\n data-side=\"end\"\n />\n </span>\n {interactive ? (\n <Button\n className=\"ds-stepper__marker\"\n variant={status === \"complete\" ? \"primary\" : \"active\"}\n size=\"sm\"\n isIconOnly\n aria-labelledby={`${id}-${index}-label`}\n aria-describedby={`${id}-${index}-status`}\n onClick={() => onStepChange?.(index, step.id)}\n >\n {marker}\n </Button>\n ) : (\n <span className=\"ds-stepper__marker\">{marker}</span>\n )}\n <span className=\"ds-stepper__text\">\n <span\n id={`${id}-${index}-label`}\n className=\"ds-stepper__label\"\n >\n {step.label}\n </span>\n {step.description && (\n <span className=\"ds-stepper__description\">{step.description}</span>\n )}\n </span>\n </li>\n );\n })}\n </ol>\n </nav>\n );\n});\n"],"mappings":"A,4MAiCA,SAASS,EAAS,EAAe,EAAgC,CAG/D,OAFIC,EAAQC,EAAmB,WAC3BD,IAAUC,EAAmB,UAC1B,UACT,CAMA,IAAaC,GAAA,EAAUZ,EAAAA,WAAAA,CAAsC,SAC3D,CAAE,QAAO,aAAY,OAAO,KAAM,QAAQ,WAAY,eAAc,YAAW,GAAGa,GAClF,EACA,CACA,IAAMC,GAAA,EAAKb,EAAAA,MAAAA,CAAM,EACjB,OACE,EAAAO,EAAA,IAAA,CAAC,MAAD,CACO,MACL,aAAYO,EACZ,YAAWC,EACX,UAAW,CAAC,aAAcC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAC7D,GAAIJ,EAEJ,UAAA,EAAAL,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,mBACX,SAAAU,EAAM,KAAK,EAAM,IAAU,CAC1B,IAAMC,E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AAK,cACJ,EAAAf,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,0BAA2B,SAAAe,EAAK,WAAkB,CAAA,CAEhE,C,EACJ,CA5CG,EAAAA,EAAK,EA4CR,CAER,CAAC,CACC,CAAA,CACD,CAAA,CAET,CAAC,E"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Stepper/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG/E,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;AACtC,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;AAE7D,MAAM,WAAW,IAAI;IACnB,4DAA4D;IAC5D,EAAE,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,KAAK,EAAE,SAAS,CAAC;IACjB,qCAAqC;IACrC,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB;AAED,MAAM,WAAW,YACf,SAAQ,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAClE,4EAA4E;IAC5E,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,iFAAiF;IACjF,UAAU,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD;AAQD;;;GAGG;AACH,eAAO,MAAM,OAAO,sGAqDlB,CAAC"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Stepper/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,cAAc,EAAE,K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AA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD;AAQD;;;GAGG;AACH,eAAO,MAAM,OAAO,sGAwFlB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { t as e } from "../../chunks/Icon-CGY1FNXT.js";
1
+ import { t as e } from "../../chunks/Icon-ByUB0L1a.js";
2
2
  import { Button as t } from "../Button/index.js";
3
3
  import { forwardRef as n, useId as r } from "react";
4
4
  import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_Fragment","Icon","Fragment$1","statusOf","index","activeStep","Stepper","forwardRef","rest","id","useId","label","size","className","steps","status","interactive","onStepChange","marker","Button","step"],"sources":["../../../src/components/Stepper/index.tsx"],"sourcesContent":["import { forwardRef, useId, type HTMLAttributes, type ReactNode } from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport \"./style.css\";\n\nexport type StepperSize = \"sm\" | \"md\";\nexport type StepStatus = \"complete\" | \"current\" | \"upcoming\";\n\nexport interface Step {\n /** Stable key, and the value reported by `onStepChange`. */\n id: string;\n /** The step in the user's words — sentence case. */\n label: ReactNode;\n /** One line on what happens here. */\n description?: ReactNode;\n}\n\nexport interface StepperProps\n extends Omit<HTMLAttributes<HTMLElement>, \"onChange\" | \"children\"> {\n /** The ordered steps. Three or more spread evenly across the full width. */\n steps: Step[];\n /** Index of the step being worked on. Everything before it reads as complete. */\n activeStep: number;\n /** Marker scale. `sm` for a toolbar band, `md` for a page header. */\n size?: StepperSize;\n /** Accessible name for the progress bar. */\n label?: string;\n /**\n * Makes completed steps (and the current one) navigable. Omit for a\n * read-only progress indicator.\n */\n onStepChange?: (index: number, id: string) => void;\n}\n\nfunction statusOf(index: number, activeStep: number): StepStatus {\n if (index < activeStep) return \"complete\";\n if (index === activeStep) return \"current\";\n return \"upcoming\";\n}\n\n/**\n * A linear progress rail: 1 - 2 - 3. Steps share the row equally however many\n * there are, so the last marker always lands on the trailing edge.\n */\nexport const Stepper = forwardRef<HTMLElement, StepperProps>(function Stepper(\n { steps, activeStep, size = \"md\", label = \"Progress\", onStepChange, className, ...rest },\n ref,\n) {\n const id = useId();\n return (\n <nav\n ref={ref}\n aria-label={label}\n data-size={size}\n className={[\"ds-stepper\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n <ol className=\"ds-stepper__list\">\n {steps.map((step, index) => {\n const status = statusOf(index, activeStep);\n const interactive = Boolean(onStepChange) && status !== \"upcoming\";\n const marker = <>\n {status === \"complete\" ? <Icon name=\"check\" size={16} aria-hidden=\"true\" /> : index + 1}\n <span id={`${id}-${index}-status`} className=\"ds-stepper__sr\">{status}</span>\n </>;\n return (\n <li\n key={step.id}\n className=\"ds-stepper__step\"\n data-status={status}\n aria-current={status === \"current\" ? \"step\" : undefined}\n >\n <span className=\"ds-stepper__track\" aria-hidden=\"true\">\n <span className=\"ds-stepper__connector\" data-side=\"start\" />\n <span className=\"ds-stepper__connector\" data-side=\"end\" />\n </span>\n {interactive ? <Button\n className=\"ds-stepper__marker\"\n variant={status === \"complete\" ? \"primary\" : \"active\"}\n size=\"sm\"\n isIconOnly\n aria-labelledby={`${id}-${index}-label`}\n aria-describedby={`${id}-${index}-status`}\n onClick={() => onStepChange?.(index, step.id)}\n >{marker}</Button> : <span className=\"ds-stepper__marker\">{marker}</span>}\n <span className=\"ds-stepper__text\">\n <span id={`${id}-${index}-label`} className=\"ds-stepper__label\">{step.label}</span>\n {step.description && (\n <span className=\"ds-stepper__description\">{step.description}</span>\n )}\n </span>\n </li>\n );\n })}\n </ol>\n </nav>\n );\n});\n"],"mappings":";;;;;AAkCA,SAASG,EAAS,GAAe,GAAgC;CAG/D,OAFIC,IAAQC,IAAmB,aAC3BD,MAAUC,IAAmB,YAC1B;AACT;AAMA,IAAaC,IAAUC,E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MACxE,kBAAC,QAAD;OAAM,WAAU;OAAhB,UAAA,CACE,kBAAC,QAAD;QAAM,IAAI,GAAGT,EAAG,GAAGL,EAAM;QAAS,WAAU;QAAqB,UAAAgB,EAAK;OAAY,CAAA,GACjFA,EAAK,eACJ,kBAAC,QAAD;QAAM,WAAU;QAA2B,UAAAA,EAAK;OAAkB,CAAA,CAEhE;;KACJ;IAxBG,GAAAA,EAAK,EAwBR;GAER,CAAC;EACC,CAAA;CACD,CAAA;AAET,CAAC"}
1
+ {"version":3,"file":"index.js","names":["_Fragment","Icon","Fragment$1","statusOf","index","activeStep","Stepper","forwardRef","rest","id","useId","label","size","className","steps","status","interactive","onStepChange","marker","Button","step"],"sources":["../../../src/components/Stepper/index.tsx"],"sourcesContent":["import { forwardRef, useId, type HTMLAttributes, type ReactNode } from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport \"./style.css\";\n\nexport type StepperSize = \"sm\" | \"md\";\nexport type StepStatus = \"complete\" | \"current\" | \"upcoming\";\n\nexport interface Step {\n /** Stable key, and the value reported by `onStepChange`. */\n id: string;\n /** The step in the user's words — sentence case. */\n label: ReactNode;\n /** One line on what happens here. */\n description?: ReactNode;\n}\n\nexport interface StepperProps extends Omit<HTMLAttributes<HTMLElement>, \"onChange\" | \"children\"> {\n /** The ordered steps. Three or more spread evenly across the full width. */\n steps: Step[];\n /** Index of the step being worked on. Everything before it reads as complete. */\n activeStep: number;\n /** Marker scale. `sm` for a toolbar band, `md` for a page header. */\n size?: StepperSize;\n /** Accessible name for the progress bar. */\n label?: string;\n /**\n * Makes completed steps (and the current one) navigable. Omit for a\n * read-only progress indicator.\n */\n onStepChange?: (index: number, id: string) => void;\n}\n\nfunction statusOf(index: number, activeStep: number): StepStatus {\n if (index < activeStep) return \"complete\";\n if (index === activeStep) return \"current\";\n return \"upcoming\";\n}\n\n/**\n * A linear progress rail: 1 - 2 - 3. Steps share the row equally however many\n * there are, so the last marker always lands on the trailing edge.\n */\nexport const Stepper = forwardRef<HTMLElement, StepperProps>(function Stepper(\n { steps, activeStep, size = \"md\", label = \"Progress\", onStepChange, className, ...rest },\n ref,\n) {\n const id = useId();\n return (\n <nav\n ref={ref}\n aria-label={label}\n data-size={size}\n className={[\"ds-stepper\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n <ol className=\"ds-stepper__list\">\n {steps.map((step, index) => {\n const status = statusOf(index, activeStep);\n const interactive = Boolean(onStepChange) && status !== \"upcoming\";\n const marker = (\n <>\n {status === \"complete\" ? (\n <Icon\n name=\"check\"\n size={16}\n aria-hidden=\"true\"\n />\n ) : (\n index + 1\n )}\n <span\n id={`${id}-${index}-status`}\n className=\"ds-stepper__sr\"\n >\n {status}\n </span>\n </>\n );\n return (\n <li\n key={step.id}\n className=\"ds-stepper__step\"\n data-status={status}\n aria-current={status === \"current\" ? \"step\" : undefined}\n >\n <span\n className=\"ds-stepper__track\"\n aria-hidden=\"true\"\n >\n <span\n className=\"ds-stepper__connector\"\n data-side=\"start\"\n />\n <span\n className=\"ds-stepper__connector\"\n data-side=\"end\"\n />\n </span>\n {interactive ? (\n <Button\n className=\"ds-stepper__marker\"\n variant={status === \"complete\" ? \"primary\" : \"active\"}\n size=\"sm\"\n isIconOnly\n aria-labelledby={`${id}-${index}-label`}\n aria-describedby={`${id}-${index}-status`}\n onClick={() => onStepChange?.(index, step.id)}\n >\n {marker}\n </Button>\n ) : (\n <span className=\"ds-stepper__marker\">{marker}</span>\n )}\n <span className=\"ds-stepper__text\">\n <span\n id={`${id}-${index}-label`}\n className=\"ds-stepper__label\"\n >\n {step.label}\n </span>\n {step.description && (\n <span className=\"ds-stepper__description\">{step.description}</span>\n )}\n </span>\n </li>\n );\n })}\n </ol>\n </nav>\n );\n});\n"],"mappings":";;;;;AAiCA,SAASG,EAAS,GAAe,GAAgC;CAG/D,OAFIC,IAAQC,IAAmB,aAC3BD,MAAUC,IAAmB,YAC1B;AACT;AAMA,IAAaC,IAAUC,EAAsC,SAC3D,EA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kBAAC,QAAD;QACE,IAAI,GAAGT,EAAG,GAAGL,EAAM;QACnB,WAAU;QAET,UAAAgB,EAAK;OACF,CAAA,GACLA,EAAK,eACJ,kBAAC,QAAD;QAAM,WAAU;QAA2B,UAAAA,EAAK;OAAkB,CAAA,CAEhE;;KACJ;IA5CG,GAAAA,EAAK,EA4CR;GAER,CAAC;EACC,CAAA;CACD,CAAA;AAET,CAAC"}
@@ -40,7 +40,7 @@
40
40
  .ds-stepper__connector {
41
41
  flex: 1 1 0;
42
42
  background: var(--control-border-color);
43
- opacity: 35%;
43
+ opacity: 0.35;
44
44
  }
45
45
 
46
46
  .ds-stepper__step:first-child .ds-stepper__connector[data-side="start"],
@@ -51,7 +51,7 @@
51
51
  .ds-stepper__step[data-status="complete"] .ds-stepper__connector,
52
52
  .ds-stepper__step[data-status="current"] .ds-stepper__connector[data-side="start"] {
53
53
  background: var(--color-primary);
54
- opacity: 100%;
54
+ opacity: 1;
55
55
  }
56
56
 
57
57
  .ds-stepper__marker {
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-CWsA1W83.cjs"),t=require("../Button/index.cjs");let n=require("react"),r=require("react/jsx-runtime");var i=(0,n.forwardRef)(function({label:e,actions:t,className:n,children:i,...a},o){return(0,r.jsxs)(`nav`,{ref:o,"aria-label":e,className:[`ds-subnav`,n].filter(Boolean).join(` `),...a,children:[(0,r.jsx)(`ul`,{className:`ds-subnav__list`,children:i}),t&&(0,r.jsx)(`div`,{className:`ds-subnav__actions`,children:t})]})}),a=(0,n.forwardRef)(function({label:t,icon:n,isActive:i,count:a,className:o,...s},c){return(0,r.jsx)(`li`,{className:`ds-subnav__row`,children:(0,r.jsxs)(`a`,{ref:c,className:[`ds-subnav__item`,o].filter(Boolean).join(` `),"data-active":i||void 0,"aria-current":i?`page`:void 0,...s,children:[n&&(0,r.jsx)(e.t,{name:n}),t,a!==void 0&&(0,r.jsx)(`span`,{className:`ds-subnav__count`,children:a})]})})}),o=(0,n.forwardRef)(function({label:e,icon:n,isActive:i,count:a,disabled:o,className:s,...c},l){return(0,r.jsx)(`li`,{className:`ds-subnav__row`,children:(0,r.jsxs)(t.Button,{ref:l,variant:`simple`,iconStart:n,isDisabled:o,className:[`ds-subnav__item`,s].filter(Boolean).join(` `),"data-active":i||void 0,"aria-pressed":i,...c,children:[e,a!==void 0&&(0,r.jsx)(`span`,{className:`ds-subnav__count`,children:a})]})})});exports.SubNav=i,exports.SubNavButton=o,exports.SubNavItem=a;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-CW6qJcDy.cjs"),t=require("../Button/index.cjs");let n=require("react"),r=require("react/jsx-runtime");var i=(0,n.forwardRef)(function({label:e,actions:t,className:n,children:i,...a},o){return(0,r.jsxs)(`nav`,{ref:o,"aria-label":e,className:[`ds-subnav`,n].filter(Boolean).join(` `),...a,children:[(0,r.jsx)(`ul`,{className:`ds-subnav__list`,children:i}),t&&(0,r.jsx)(`div`,{className:`ds-subnav__actions`,children:t})]})}),a=(0,n.forwardRef)(function({label:t,icon:n,isActive:i,count:a,className:o,...s},c){return(0,r.jsx)(`li`,{className:`ds-subnav__row`,children:(0,r.jsxs)(`a`,{ref:c,className:[`ds-subnav__item`,o].filter(Boolean).join(` `),"data-active":i||void 0,"aria-current":i?`page`:void 0,...s,children:[n&&(0,r.jsx)(e.t,{name:n}),t,a!==void 0&&(0,r.jsx)(`span`,{className:`ds-subnav__count`,children:a})]})})}),o=(0,n.forwardRef)(function({label:e,icon:n,isActive:i,count:a,disabled:o,className:s,...c},l){return(0,r.jsx)(`li`,{className:`ds-subnav__row`,children:(0,r.jsxs)(t.Button,{ref:l,variant:`simple`,iconStart:n,isDisabled:o,className:[`ds-subnav__item`,s].filter(Boolean).join(` `),"data-active":i||void 0,"aria-pressed":i,...c,children:[e,a!==void 0&&(0,r.jsx)(`span`,{className:`ds-subnav__count`,children:a})]})})});exports.SubNav=i,exports.SubNavButton=o,exports.SubNavItem=a;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["forwardRef","Icon","Button","require_Icon","require_components_Button_index","react","react_jsx_runtime","SubNav","rest","label","className","actions","SubNavItem","isActive","icon","count","SubNavButton","disabled"],"sources":["../../../src/components/SubNav/index.tsx"],"sourcesContent":["import {\n forwardRef,\n type AnchorHTMLAttributes,\n type ButtonHTMLAttributes,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\nexport interface SubNavProps extends HTMLAttributes<HTMLElement> {\n /** Accessible name — say what the set switches, e.g. \"Article sections\". */\n label: string;\n /** Controls parked at the end of the row, e.g. a view switch. */\n actions?: ReactNode;\n children?: ReactNode;\n}\n\n/**\n * The second level: views inside one page — Content, Settings, Revisions. A\n * hairline rule runs the full width; the active item sits on the rail.\n */\nexport const SubNav = forwardRef<HTMLElement, SubNavProps>(function SubNav(\n { label, actions, className, children, ...rest },\n ref,\n) {\n return (\n <nav\n ref={ref}\n aria-label={label}\n className={[\"ds-subnav\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n <ul className=\"ds-subnav__list\">{children}</ul>\n {actions && <div className=\"ds-subnav__actions\">{actions}</div>}\n </nav>\n );\n});\n\ninterface SubNavItemBase {\n label: string;\n icon?: IconName;\n isActive?: boolean;\n /** A count beside the label — kept quiet, never a status colour. */\n count?: number;\n}\n\nexport interface SubNavItemProps\n extends SubNavItemBase,\n Omit<AnchorHTMLAttributes<HTMLAnchorElement>, \"children\"> {}\n\n/** One view, as a link. Use `SubNavButton` when the view is client state. */\nexport const SubNavItem = forwardRef<HTMLAnchorElement, SubNavItemProps>(\n function SubNavItem({ label, icon, isActive, count, className, ...rest }, ref) {\n return (\n <li className=\"ds-subnav__row\">\n <a\n ref={ref}\n className={[\"ds-subnav__item\", className].filter(Boolean).join(\" \")}\n data-active={isActive || undefined}\n aria-current={isActive ? \"page\" : undefined}\n {...rest}\n >\n {icon && <Icon name={icon} />}\n {label}\n {count !== undefined && <span className=\"ds-subnav__count\">{count}</span>}\n </a>\n </li>\n );\n },\n);\n\nexport interface SubNavButtonProps\n extends SubNavItemBase,\n Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"children\" | \"type\"> {}\n\n/** One view, as a control — for panes switched in place rather than routed. */\nexport const SubNavButton = forwardRef<HTMLButtonElement, SubNavButtonProps>(\n function SubNavButton({ label, icon, isActive, count, disabled, className, ...rest }, ref) {\n return (\n <li className=\"ds-subnav__row\">\n <Button\n ref={ref}\n variant=\"simple\"\n iconStart={icon}\n isDisabled={disabled}\n className={[\"ds-subnav__item\", className].filter(Boolean).join(\" \")}\n data-active={isActive || undefined}\n aria-pressed={isActive}\n {...rest}\n >\n {label}\n {count !== undefined && <span className=\"ds-subnav__count\">{count}</span>}\n </Button>\n </li>\n );\n },\n);\n"],"mappings":"A,4MAwBA,IAAaO,GAAA,EAASP,EAAAA,WAAAA,CAAqC,SACzD,CAAE,QAAO,UAAS,YAAW,WAAU,GAAGQ,GAC1C,EACA,CACA,OACE,EAAAF,EAAA,KAAA,CAAC,MAAD,CACO,MACL,aAAYG,EACZ,UAAW,CAAC,YAAaC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAC5D,GAAIF,EAJN,SAAA,EAME,EAAAF,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,kBAAmB,UAAa,CAAA,EAC7CK,IAAW,EAAAL,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,qBAAsB,SAAAK,CAAa,CAAA,CAC3D,C,EAET,CAAC,EAeYC,GAAA,EAAaZ,EAAAA,WAAAA,CACxB,SAAoB,CAAE,QAAO,OAAM,WAAU,QAAO,YAAW,GAAGQ,GAAQ,EAAK,CAC7E,OACE,EAAAF,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,iBACZ,UAAA,EAAAA,EAAA,KAAA,CAAC,IAAD,CACO,MACL,UAAW,CAAC,kBAAmBI,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAClE,cAAaG,GAAY,IAAA,GACzB,eAAcA,EAAW,OAAS,IAAA,GAClC,GAAIL,EALN,SAAA,CAOGM,IAAQ,EAAAR,EAAA,IAAA,CAACL,EAAAA,EAAD,CAAM,KAAMa,CAAO,CAAA,EAC3BL,EACAM,IAAU,IAAA,KAAa,EAAAT,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,mBAAoB,SAAAS,CAAY,CAAA,CACvE,C,EACD,CAAA,CAER,CACF,EAOaC,GAAA,EAAehB,EAAAA,WAAAA,CAC1B,SAAsB,CAAE,QAAO,OAAM,WAAU,QAAO,WAAU,YAAW,GAAGQ,GAAQ,EAAK,CACzF,OACE,EAAAF,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,iBACZ,UAAA,EAAAA,EAAA,KAAA,CAACJ,EAAAA,OAAD,CACO,MACL,QAAQ,SACR,UAAWY,EACX,WAAYG,EACZ,UAAW,CAAC,kBAAmBP,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAClE,cAAaG,GAAY,IAAA,GACzB,eAAcA,EACd,GAAIL,EARN,SAAA,CAUGC,EACAM,IAAU,IAAA,KAAa,EAAAT,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,mBAAoB,SAAAS,CAAY,CAAA,CAClE,C,EACN,CAAA,CAER,CACF,E"}
1
+ {"version":3,"file":"index.cjs","names":["forwardRef","Icon","Button","require_Icon","require_components_Button_index","react","react_jsx_runtime","SubNav","rest","label","className","actions","SubNavItem","isActive","icon","count","SubNavButton","disabled"],"sources":["../../../src/components/SubNav/index.tsx"],"sourcesContent":["import {\n forwardRef,\n type AnchorHTMLAttributes,\n type ButtonHTMLAttributes,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\nexport interface SubNavProps extends HTMLAttributes<HTMLElement> {\n /** Accessible name — say what the set switches, e.g. \"Article sections\". */\n label: string;\n /** Controls parked at the end of the row, e.g. a view switch. */\n actions?: ReactNode;\n children?: ReactNode;\n}\n\n/**\n * The second level: views inside one page — Content, Settings, Revisions. A\n * hairline rule runs the full width; the active item sits on the rail.\n */\nexport const SubNav = forwardRef<HTMLElement, SubNavProps>(function SubNav(\n { label, actions, className, children, ...rest },\n ref,\n) {\n return (\n <nav\n ref={ref}\n aria-label={label}\n className={[\"ds-subnav\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n <ul className=\"ds-subnav__list\">{children}</ul>\n {actions && <div className=\"ds-subnav__actions\">{actions}</div>}\n </nav>\n );\n});\n\ninterface SubNavItemBase {\n label: string;\n icon?: IconName;\n isActive?: boolean;\n /** A count beside the label — kept quiet, never a status colour. */\n count?: number;\n}\n\nexport interface SubNavItemProps\n extends SubNavItemBase, Omit<AnchorHTMLAttributes<HTMLAnchorElement>, \"children\"> {}\n\n/** One view, as a link. Use `SubNavButton` when the view is client state. */\nexport const SubNavItem = forwardRef<HTMLAnchorElement, SubNavItemProps>(function SubNavItem(\n { label, icon, isActive, count, className, ...rest },\n ref,\n) {\n return (\n <li className=\"ds-subnav__row\">\n <a\n ref={ref}\n className={[\"ds-subnav__item\", className].filter(Boolean).join(\" \")}\n data-active={isActive || undefined}\n aria-current={isActive ? \"page\" : undefined}\n {...rest}\n >\n {icon && <Icon name={icon} />}\n {label}\n {count !== undefined && <span className=\"ds-subnav__count\">{count}</span>}\n </a>\n </li>\n );\n});\n\nexport interface SubNavButtonProps\n extends SubNavItemBase, Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"children\" | \"type\"> {}\n\n/** One view, as a control — for panes switched in place rather than routed. */\nexport const SubNavButton = forwardRef<HTMLButtonElement, SubNavButtonProps>(function SubNavButton(\n { label, icon, isActive, count, disabled, className, ...rest },\n ref,\n) {\n return (\n <li className=\"ds-subnav__row\">\n <Button\n ref={ref}\n variant=\"simple\"\n iconStart={icon}\n isDisabled={disabled}\n className={[\"ds-subnav__item\", className].filter(Boolean).join(\" \")}\n data-active={isActive || undefined}\n aria-pressed={isActive}\n {...rest}\n >\n {label}\n {count !== undefined && <span className=\"ds-subnav__count\">{count}</span>}\n </Button>\n </li>\n );\n});\n"],"mappings":"A,4MAwBA,IAAaO,GAAA,EAASP,EAAAA,WAAAA,CAAqC,SACzD,CAAE,QAAO,UAAS,YAAW,WAAU,GAAGQ,GAC1C,EACA,CACA,OACE,EAAAF,EAAA,KAAA,CAAC,MAAD,CACO,MACL,aAAYG,EACZ,UAAW,CAAC,YAAaC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAC5D,GAAIF,EAJN,SAAA,EAME,EAAAF,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,kBAAmB,UAAa,CAAA,EAC7CK,IAAW,EAAAL,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,qBAAsB,SAAAK,CAAa,CAAA,CAC3D,C,EAET,CAAC,EAcYC,GAAA,EAAaZ,EAAAA,WAAAA,CAA+C,SACvE,CAAE,QAAO,OAAM,WAAU,QAAO,YAAW,GAAGQ,GAC9C,EACA,CACA,OACE,EAAAF,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,iBACZ,UAAA,EAAAA,EAAA,KAAA,CAAC,IAAD,CACO,MACL,UAAW,CAAC,kBAAmBI,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAClE,cAAaG,GAAY,IAAA,GACzB,eAAcA,EAAW,OAAS,IAAA,GAClC,GAAIL,EALN,SAAA,CAOGM,IAAQ,EAAAR,EAAA,IAAA,CAACL,EAAAA,EAAD,CAAM,KAAMa,CAAO,CAAA,EAC3BL,EACAM,IAAU,IAAA,KAAa,EAAAT,EAAA,IAAA,CAAC,OAAD,CAA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AAO,MAAM,YAAY,iHAoBxB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SubNav/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC9D,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,qGAejB,CAAC;AAEH,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eACf,SAAQ,cAAc,EAAE,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC;CAAG;AAEtF,6EAA6E;AAC7E,eAAO,MAAM,UAAU,+GAmBrB,CAAC;AAEH,MAAM,WAAW,iBACf,SAAQ,cAAc,EAAE,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;CAAG;AAE/F,+EAA+E;AAC/E,eAAO,MAAM,YAAY,iHAqBvB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { t as e } from "../../chunks/Icon-CGY1FNXT.js";
1
+ import { t as e } from "../../chunks/Icon-ByUB0L1a.js";
2
2
  import { Button as t } from "../Button/index.js";
3
3
  import { forwardRef as n } from "react";
4
4
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Icon","SubNav","forwardRef","rest","label","className","actions","SubNavItem","isActive","icon","count","SubNavButton","Button","disabled"],"sources":["../../../src/components/SubNav/index.tsx"],"sourcesContent":["import {\n forwardRef,\n type AnchorHTMLAttributes,\n type ButtonHTMLAttributes,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\nexport interface SubNavProps extends HTMLAttributes<HTMLElement> {\n /** Accessible name — say what the set switches, e.g. \"Article sections\". */\n label: string;\n /** Controls parked at the end of the row, e.g. a view switch. */\n actions?: ReactNode;\n children?: ReactNode;\n}\n\n/**\n * The second level: views inside one page — Content, Settings, Revisions. A\n * hairline rule runs the full width; the active item sits on the rail.\n */\nexport const SubNav = forwardRef<HTMLElement, SubNavProps>(function SubNav(\n { label, actions, className, children, ...rest },\n ref,\n) {\n return (\n <nav\n ref={ref}\n aria-label={label}\n className={[\"ds-subnav\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n <ul className=\"ds-subnav__list\">{children}</ul>\n {actions && <div className=\"ds-subnav__actions\">{actions}</div>}\n </nav>\n );\n});\n\ninterface SubNavItemBase {\n label: string;\n icon?: IconName;\n isActive?: boolean;\n /** A count beside the label — kept quiet, never a status colour. */\n count?: number;\n}\n\nexport interface SubNavItemProps\n extends SubNavItemBase,\n Omit<AnchorHTMLAttributes<HTMLAnchorElement>, \"children\"> {}\n\n/** One view, as a link. Use `SubNavButton` when the view is client state. */\nexport const SubNavItem = forwardRef<HTMLAnchorElement, SubNavItemProps>(\n function SubNavItem({ label, icon, isActive, count, className, ...rest }, ref) {\n return (\n <li className=\"ds-subnav__row\">\n <a\n ref={ref}\n className={[\"ds-subnav__item\", className].filter(Boolean).join(\" \")}\n data-active={isActive || undefined}\n aria-current={isActive ? \"page\" : undefined}\n {...rest}\n >\n {icon && <Icon name={icon} />}\n {label}\n {count !== undefined && <span className=\"ds-subnav__count\">{count}</span>}\n </a>\n </li>\n );\n },\n);\n\nexport interface SubNavButtonProps\n extends SubNavItemBase,\n Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"children\" | \"type\"> {}\n\n/** One view, as a control — for panes switched in place rather than routed. */\nexport const SubNavButton = forwardRef<HTMLButtonElement, SubNavButtonProps>(\n function SubNavButton({ label, icon, isActive, count, disabled, className, ...rest }, ref) {\n return (\n <li className=\"ds-subnav__row\">\n <Button\n ref={ref}\n variant=\"simple\"\n iconStart={icon}\n isDisabled={disabled}\n className={[\"ds-subnav__item\", className].filter(Boolean).join(\" \")}\n data-active={isActive || undefined}\n aria-pressed={isActive}\n {...rest}\n >\n {label}\n {count !== undefined && <span className=\"ds-subnav__count\">{count}</span>}\n </Button>\n </li>\n );\n },\n);\n"],"mappings":";;;;;AAwBA,IAAaC,IAASC,EAAqC,SACzD,EAAE,UAAO,YAAS,cAAW,aAAU,GAAGC,KAC1C,GACA;CACA,OACE,kBAAC,OAAD;EACO;EACL,cAAYC;EACZ,WAAW,CAAC,aAAaC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAC5D,GAAIF;EAJN,UAAA,CAME,kBAAC,MAAD;GAAI,WAAU;GAAmB;EAAa,CAAA,GAC7CG,KAAW,kBAAC,OAAD;GAAK,WAAU;GAAsB,UAAAA;EAAa,CAAA,CAC3D;;AAET,CAAC,GAeYC,IAAaL,EACxB,SAAoB,EAAE,UAAO,SAAM,aAAU,UAAO,cAAW,GAAGC,KAAQ,GAAK;CAC7E,OACE,kBAAC,MAAD;EAAI,WAAU;EACZ,UAAA,kBAAC,KAAD;GACO;GACL,WAAW,CAAC,mBAAmBE,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;GAClE,eAAaG,KAAY,KAAA;GACzB,gBAAcA,IAAW,SAAS,KAAA;GAClC,GAAIL;GALN,UAAA;IAOGM,KAAQ,kBAACT,GAAD,EAAM,MAAMS,EAAO,CAAA;IAC3BL;IACAM,MAAU,KAAA,KAAa,kBAAC,QAAD;KAAM,WAAU;KAAoB,UAAAA;IAAY,CAAA;GACvE;;CACD,CAAA;AAER,CACF,GAOaC,IAAeT,EAC1B,SAAsB,EAAE,UAAO,SAAM,aAAU,UAAO,aAAU,cAAW,GAAGC,KAAQ,GAAK;CACzF,OACE,kBAAC,MAAD;EAAI,WAAU;EACZ,UAAA,kBAACS,GAAD;GACO;GACL,SAAQ;GACR,WAAWH;GACX,YAAYI;GACZ,WAAW,CAAC,mBAAmBR,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;GAClE,eAAaG,KAAY,KAAA;GACzB,gBAAcA;GACd,GAAIL;GARN,UAAA,CAUGC,GACAM,MAAU,KAAA,KAAa,kBAAC,QAAD;IAAM,WAAU;IAAoB,UAAAA;GAAY,CAAA,CAClE;;CACN,CAAA;AAER,CACF"}
1
+ {"version":3,"file":"index.js","names":["Icon","SubNav","forwardRef","rest","label","className","actions","SubNavItem","isActive","icon","count","SubNavButton","Button","disabled"],"sources":["../../../src/components/SubNav/index.tsx"],"sourcesContent":["import {\n forwardRef,\n type AnchorHTMLAttributes,\n type ButtonHTMLAttributes,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\nexport interface SubNavProps extends HTMLAttributes<HTMLElement> {\n /** Accessible name — say what the set switches, e.g. \"Article sections\". */\n label: string;\n /** Controls parked at the end of the row, e.g. a view switch. */\n actions?: ReactNode;\n children?: ReactNode;\n}\n\n/**\n * The second level: views inside one page — Content, Settings, Revisions. A\n * hairline rule runs the full width; the active item sits on the rail.\n */\nexport const SubNav = forwardRef<HTMLElement, SubNavProps>(function SubNav(\n { label, actions, className, children, ...rest },\n ref,\n) {\n return (\n <nav\n ref={ref}\n aria-label={label}\n className={[\"ds-subnav\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n <ul className=\"ds-subnav__list\">{children}</ul>\n {actions && <div className=\"ds-subnav__actions\">{actions}</div>}\n </nav>\n );\n});\n\ninterface SubNavItemBase {\n label: string;\n icon?: IconName;\n isActive?: boolean;\n /** A count beside the label — kept quiet, never a status colour. */\n count?: number;\n}\n\nexport interface SubNavItemProps\n extends SubNavItemBase, Omit<AnchorHTMLAttributes<HTMLAnchorElement>, \"children\"> {}\n\n/** One view, as a link. Use `SubNavButton` when the view is client state. */\nexport const SubNavItem = forwardRef<HTMLAnchorElement, SubNavItemProps>(function SubNavItem(\n { label, icon, isActive, count, className, ...rest },\n ref,\n) {\n return (\n <li className=\"ds-subnav__row\">\n <a\n ref={ref}\n className={[\"ds-subnav__item\", className].filter(Boolean).join(\" \")}\n data-active={isActive || undefined}\n aria-current={isActive ? \"page\" : undefined}\n {...rest}\n >\n {icon && <Icon name={icon} />}\n {label}\n {count !== undefined && <span className=\"ds-subnav__count\">{count}</span>}\n </a>\n </li>\n );\n});\n\nexport interface SubNavButtonProps\n extends SubNavItemBase, Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"children\" | \"type\"> {}\n\n/** One view, as a control — for panes switched in place rather than routed. */\nexport const SubNavButton = forwardRef<HTMLButtonElement, SubNavButtonProps>(function SubNavButton(\n { label, icon, isActive, count, disabled, className, ...rest },\n ref,\n) {\n return (\n <li className=\"ds-subnav__row\">\n <Button\n ref={ref}\n variant=\"simple\"\n iconStart={icon}\n isDisabled={disabled}\n className={[\"ds-subnav__item\", className].filter(Boolean).join(\" \")}\n data-active={isActive || undefined}\n aria-pressed={isActive}\n {...rest}\n >\n {label}\n {count !== undefined && <span className=\"ds-subnav__count\">{count}</span>}\n </Button>\n </li>\n );\n});\n"],"mappings":";;;;;AAwBA,IAAaC,IAASC,EAAqC,SACzD,EAAE,UAAO,YAAS,cAAW,aAAU,GAAGC,KAC1C,GACA;CACA,OACE,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","names":["forwardRef","useState","Button","require_components_Button_index","react","react_jsx_runtime","cx","parts","Switch","rest","internal","setInternal","defaultSelected","current","isSelected","className","onClick","event","next","onSelectedChange","children"],"sources":["../../../src/components/Switch/index.tsx"],"sourcesContent":["import { forwardRef, useState, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { Button } from \"../Button\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport interface SwitchProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"onChange\" | \"value\" | \"disabled\"> {\n isSelected?: boolean;\n defaultSelected?: boolean;\n onSelectedChange?: (isSelected: boolean) => void;\n isDisabled?: boolean;\n /** Label to the right of the track. Omit it and pass `aria-label`. */\n children?: ReactNode;\n}\n\n/** An immediate on/off — it commits as it is pressed, no Save behind it. */\nexport const Switch = forwardRef<HTMLButtonElement, SwitchProps>(function Switch(\n {\n isSelected,\n defaultSelected = false,\n onSelectedChange,\n isDisabled = false,\n className,\n children,\n onClick,\n ...rest\n },\n ref,\n) {\n const [internal, setInternal] = useState(defaultSelected);\n const current = isSelected ?? internal;\n\n return (\n <label className={cx(\"ds-switch\", className)}>\n <Button\n ref={ref}\n variant={current ? \"primary\" : \"neutral\"}\n size=\"sm\"\n role=\"switch\"\n aria-checked={current}\n isDisabled={isDisabled}\n className=\"ds-switch__track\"\n onClick={(event) => {\n onClick?.(event);\n if (event.defaultPrevented) return;\n const next = !current;\n if (isSelected === undefined) setInternal(next);\n onSelectedChange?.(next);\n }}\n {...rest}\n >\n <span className=\"ds-switch__knob\" aria-hidden=\"true\" />\n </Button>\n {children && <span className=\"ds-switch__label\">{children}</span>}\n </label>\n );\n});\n"],"mappings":"A,gKAIA,SAASM,EAAG,GAAGC,EAAuC,CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,CACvC,CAaA,IAAaC,GAAA,EAASR,EAAAA,WAAAA,CAA2C,SAC/D,CACE,aACA,kBAAkB,GAClB,mBACA,aAAa,GACb,YACA,WACA,UACA,GAAGS,GAEL,EACA,CACA,GAAM,CAACC,EAAUC,IAAA,EAAeV,EAAAA,SAAAA,CAASW,CAAe,EAClDC,EAAUC,GAAcJ,EAE9B,OACE,EAAAL,EAAA,KAAA,CAAC,QAAD,CAAO,UAAWC,EAAG,YAAaS,CAAS,EAA3C,SAAA,EACE,EAAAV,EAAA,IAAA,CAACH,EAAAA,OAAD,CACO,MACL,QAASW,EAAU,UAAY,UAC/B,KAAK,KACL,KAAK,SACL,eAAcA,EACF,aACZ,UAAU,mBACV,QAAU,GAAU,CAElB,GADAG,IAAUC,CAAK,EACXA,EAAM,iBAAkB,OAC5B,IAAMC,EAAO,CAACL,EACVC,IAAe,IAAA,IAAWH,EAAYO,CAAI,EAC9CC,IAAmBD,CAAI,CACzB,EACA,GAAIT,EAEJ,UAAA,EAAAJ,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,kBAAkB,cAAY,MAAQ,CAAA,CAChD,CAAA,EACPe,IAAY,EAAAf,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,mBAAoB,UAAe,CAAA,CAC3D,C,EAEX,CAAC,E"}
1
+ {"version":3,"file":"index.cjs","names":["forwardRef","useState","Button","require_components_Button_index","react","react_jsx_runtime","cx","parts","Switch","rest","internal","setInternal","defaultSelected","current","isSelected","className","onClick","event","next","onSelectedChange","children"],"sources":["../../../src/components/Switch/index.tsx"],"sourcesContent":["import { forwardRef, useState, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { Button } from \"../Button\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport interface SwitchProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n \"onChange\" | \"value\" | \"disabled\"\n> {\n isSelected?: boolean;\n defaultSelected?: boolean;\n onSelectedChange?: (isSelected: boolean) => void;\n isDisabled?: boolean;\n /** Label to the right of the track. Omit it and pass `aria-label`. */\n children?: ReactNode;\n}\n\n/** An immediate on/off — it commits as it is pressed, no Save behind it. */\nexport const Switch = forwardRef<HTMLButtonElement, SwitchProps>(function Switch(\n {\n isSelected,\n defaultSelected = false,\n onSelectedChange,\n isDisabled = false,\n className,\n children,\n onClick,\n ...rest\n },\n ref,\n) {\n const [internal, setInternal] = useState(defaultSelected);\n const current = isSelected ?? internal;\n\n return (\n <label className={cx(\"ds-switch\", className)}>\n <Button\n ref={ref}\n variant={current ? \"primary\" : \"neutral\"}\n size=\"sm\"\n role=\"switch\"\n aria-checked={current}\n isDisabled={isDisabled}\n className=\"ds-switch__track\"\n onClick={(event) => {\n onClick?.(event);\n if (event.defaultPrevented) return;\n const next = !current;\n if (isSelected === undefined) setInternal(next);\n onSelectedChange?.(next);\n }}\n {...rest}\n >\n <span\n className=\"ds-switch__knob\"\n aria-hidden=\"true\"\n />\n </Button>\n {children && <span className=\"ds-switch__label\">{children}</span>}\n </label>\n );\n});\n"],"mappings":"A,gKAIA,SAASM,EAAG,GAAGC,EAAuC,CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,CACvC,CAeA,IAAaC,GAAA,EAASR,EAAAA,WAAAA,CAA2C,SAC/D,CACE,aACA,kBAAkB,GAClB,mBACA,aAAa,GACb,YACA,WACA,UACA,GAAGS,GAEL,EACA,CACA,GAAM,CAACC,EAAUC,IAAA,EAAeV,EAAAA,SAAAA,CAASW,CAAe,EAClDC,EAAUC,GAAcJ,EAE9B,OACE,EAAAL,EAAA,KAAA,CAAC,QAAD,CAAO,UAAWC,EAAG,YAAaS,CAAS,EAA3C,SAAA,EACE,EAAAV,EAAA,IAAA,CAACH,EAAAA,OAAD,CACO,MACL,QAASW,EAAU,UAAY,UAC/B,KAAK,KACL,KAAK,SACL,eAAcA,EACF,aACZ,UAAU,mBACV,QAAU,GAAU,CAElB,GADAG,IAAUC,CAAK,EACXA,EAAM,iBAAkB,OAC5B,IAAMC,EAAO,CAACL,EACVC,IAAe,IAAA,IAAWH,EAAYO,CAAI,EAC9CC,IAAmBD,CAAI,CACzB,EACA,GAAIT,EAEJ,UAAA,EAAAJ,EAAA,IAAA,CAAC,OAAD,CACE,UAAU,kBACV,cAAY,MACb,CAAA,CACK,CAAA,EACPe,IAAY,EAAAf,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,mBAAoB,UAAe,CAAA,CAC3D,C,EAEX,CAAC,E"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Switch/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAExF,OAAO,aAAa,CAAC;AAMrB,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC;IACxF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,4EAA4E;AAC5E,eAAO,MAAM,MAAM,2GAwCjB,CAAC"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Switch/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAExF,OAAO,aAAa,CAAC;AAMrB,MAAM,WAAW,WAAY,SAAQ,IAAI,CACvC,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,UAAU,GAAG,OAAO,GAAG,UAAU,CAClC;IACC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,4EAA4E;AAC5E,eAAO,MAAM,MAAM,2GA2CjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Switch/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAExF,OAAO,aAAa,CAAC;AAMrB,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC;IACxF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,4EAA4E;AAC5E,eAAO,MAAM,MAAM,2GAwCjB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Switch/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAExF,OAAO,aAAa,CAAC;AAMrB,MAAM,WAAW,WAAY,SAAQ,IAAI,CACvC,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,UAAU,GAAG,OAAO,GAAG,UAAU,CAClC;IACC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,4EAA4E;AAC5E,eAAO,MAAM,MAAM,2GA2CjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["cx","parts","Switch","forwardRef","rest","internal","setInternal","useState","defaultSelected","current","isSelected","className","Button","onClick","event","next","onSelectedChange","children"],"sources":["../../../src/components/Switch/index.tsx"],"sourcesContent":["import { forwardRef, useState, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { Button } from \"../Button\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport interface SwitchProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"onChange\" | \"value\" | \"disabled\"> {\n isSelected?: boolean;\n defaultSelected?: boolean;\n onSelectedChange?: (isSelected: boolean) => void;\n isDisabled?: boolean;\n /** Label to the right of the track. Omit it and pass `aria-label`. */\n children?: ReactNode;\n}\n\n/** An immediate on/off — it commits as it is pressed, no Save behind it. */\nexport const Switch = forwardRef<HTMLButtonElement, SwitchProps>(function Switch(\n {\n isSelected,\n defaultSelected = false,\n onSelectedChange,\n isDisabled = false,\n className,\n children,\n onClick,\n ...rest\n },\n ref,\n) {\n const [internal, setInternal] = useState(defaultSelected);\n const current = isSelected ?? internal;\n\n return (\n <label className={cx(\"ds-switch\", className)}>\n <Button\n ref={ref}\n variant={current ? \"primary\" : \"neutral\"}\n size=\"sm\"\n role=\"switch\"\n aria-checked={current}\n isDisabled={isDisabled}\n className=\"ds-switch__track\"\n onClick={(event) => {\n onClick?.(event);\n if (event.defaultPrevented) return;\n const next = !current;\n if (isSelected === undefined) setInternal(next);\n onSelectedChange?.(next);\n }}\n {...rest}\n >\n <span className=\"ds-switch__knob\" aria-hidden=\"true\" />\n </Button>\n {children && <span className=\"ds-switch__label\">{children}</span>}\n </label>\n );\n});\n"],"mappings":";;;;AAIA,SAASA,EAAG,GAAGC,GAAuC;CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AACvC;AAaA,IAAaC,IAASC,EAA2C,SAC/D,EACE,eACA,qBAAkB,IAClB,qBACA,gBAAa,IACb,cACA,aACA,YACA,GAAGC,KAEL,GACA;CACA,IAAM,CAACC,GAAUC,KAAeC,EAASC,CAAe,GAClDC,IAAUC,KAAcL;CAE9B,OACE,kBAAC,SAAD;EAAO,WAAWL,EAAG,aAAaW,CAAS;EAA3C,UAAA,CACE,kBAACC,GAAD;GACO;GACL,SAASH,IAAU,YAAY;GAC/B,MAAK;GACL,MAAK;GACL,gBAAcA;GACF;GACZ,WAAU;GACV,UAAU,MAAU;IAElB,IADAI,IAAUC,CAAK,GACXA,EAAM,kBAAkB;IAC5B,IAAMC,IAAO,CAACN;IAEd,AADIC,MAAe,KAAA,KAAWJ,EAAYS,CAAI,GAC9CC,IAAmBD,CAAI;GACzB;GACA,GAAIX;GAEJ,UAAA,kBAAC,QAAD;IAAM,WAAU;IAAkB,eAAY;GAAQ,CAAA;EAChD,CAAA,GACPa,KAAY,kBAAC,QAAD;GAAM,WAAU;GAAoB;EAAe,CAAA,CAC3D;;AAEX,CAAC"}
1
+ {"version":3,"file":"index.js","names":["cx","parts","Switch","forwardRef","rest","internal","setInternal","useState","defaultSelected","current","isSelected","className","Button","onClick","event","next","onSelectedChange","children"],"sources":["../../../src/components/Switch/index.tsx"],"sourcesContent":["import { forwardRef, useState, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { Button } from \"../Button\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport interface SwitchProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n \"onChange\" | \"value\" | \"disabled\"\n> {\n isSelected?: boolean;\n defaultSelected?: boolean;\n onSelectedChange?: (isSelected: boolean) => void;\n isDisabled?: boolean;\n /** Label to the right of the track. Omit it and pass `aria-label`. */\n children?: ReactNode;\n}\n\n/** An immediate on/off — it commits as it is pressed, no Save behind it. */\nexport const Switch = forwardRef<HTMLButtonElement, SwitchProps>(function Switch(\n {\n isSelected,\n defaultSelected = false,\n onSelectedChange,\n isDisabled = false,\n className,\n children,\n onClick,\n ...rest\n },\n ref,\n) {\n const [internal, setInternal] = useState(defaultSelected);\n const current = isSelected ?? internal;\n\n return (\n <label className={cx(\"ds-switch\", className)}>\n <Button\n ref={ref}\n variant={current ? \"primary\" : \"neutral\"}\n size=\"sm\"\n role=\"switch\"\n aria-checked={current}\n isDisabled={isDisabled}\n className=\"ds-switch__track\"\n onClick={(event) => {\n onClick?.(event);\n if (event.defaultPrevented) return;\n const next = !current;\n if (isSelected === undefined) setInternal(next);\n onSelectedChange?.(next);\n }}\n {...rest}\n >\n <span\n className=\"ds-switch__knob\"\n aria-hidden=\"true\"\n />\n </Button>\n {children && <span className=\"ds-switch__label\">{children}</span>}\n </label>\n );\n});\n"],"mappings":";;;;AAIA,SAASA,EAAG,GAAGC,GAAuC;CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AACvC;AAeA,IAAaC,IAASC,EAA2C,SAC/D,EACE,eACA,qBAAkB,IAClB,qBACA,gBAAa,IACb,cACA,aACA,YACA,GAAGC,KAEL,GACA;CACA,IAAM,CAACC,GAAUC,KAAeC,EAASC,CAAe,GAClDC,IAAUC,KAAcL;CAE9B,OACE,kBAAC,SAAD;EAAO,WAAWL,EAAG,aAAaW,CAAS;EAA3C,UAAA,CACE,kBAACC,GAAD;GACO;GACL,SAASH,IAAU,YAAY;GAC/B,MAAK;GACL,MAAK;GACL,gBAAcA;GACF;GACZ,WAAU;GACV,UAAU,MAAU;IAElB,IADAI,IAAUC,CAAK,GACXA,EAAM,kBAAkB;IAC5B,IAAMC,IAAO,CAACN;IAEd,AADIC,MAAe,KAAA,KAAWJ,EAAYS,CAAI,GAC9CC,IAAmBD,CAAI;GACzB;GACA,GAAIX;GAEJ,UAAA,kBAAC,QAAD;IACE,WAAU;IACV,eAAY;GACb,CAAA;EACK,CAAA,GACPa,KAAY,kBAAC,QAAD;GAAM,WAAU;GAAoB;EAAe,CAAA,CAC3D;;AAEX,CAAC"}
@@ -24,7 +24,8 @@
24
24
  border-radius: var(--radius-pill);
25
25
  background: var(--control-border-color);
26
26
  translate: 0 -50%;
27
- transition: translate var(--duration-fast) var(--ease-standard),
27
+ transition:
28
+ translate var(--duration-fast) var(--ease-standard),
28
29
  background-color var(--duration-fast) var(--ease-standard);
29
30
  }
30
31
 
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-CWsA1W83.cjs");let t=require("react"),n=require("react/jsx-runtime");function r(...e){return e.filter(Boolean).join(` `)}var i=(0,t.forwardRef)(function({className:e,children:t,...i},a){return(0,n.jsx)(`div`,{ref:a,className:r(`ds-table-frame`,e),...i,children:t})}),a=(0,t.forwardRef)(function({start:e,end:t,className:i,...a},o){return(0,n.jsxs)(`div`,{ref:o,className:r(`ds-table-toolbar`,i),...a,children:[(0,n.jsx)(`div`,{className:`ds-table-toolbar__group`,children:e}),(0,n.jsx)(`div`,{className:`ds-table-toolbar__group`,children:t})]})});function o(e){return t.Children.toArray(e).some(e=>(0,t.isValidElement)(e)&&(e.type!==t.Fragment||o(e.props.children)))}var s=(0,t.createContext)({emptyMessage:`No data found.`}),c=(0,t.forwardRef)(function({emptyMessage:e=`No data found.`,isEmpty:t,className:i,children:a,...o},c){return(0,n.jsx)(s.Provider,{value:{emptyMessage:e,isEmpty:t},children:(0,n.jsx)(`div`,{className:`ds-table-frame__scroll`,children:(0,n.jsx)(`table`,{...o,ref:c,className:r(`ds-table`,i),children:a})})})}),l=(0,t.forwardRef)(function({className:e,...t},r){return(0,n.jsx)(`thead`,{ref:r,className:e,...t})}),u=(0,t.forwardRef)(function({className:e,children:r,...i},a){let{emptyMessage:c,isEmpty:l}=(0,t.useContext)(s);return(0,n.jsx)(`tbody`,{ref:a,className:e,...i,children:l??!o(r)?(0,n.jsx)(d,{children:(0,n.jsx)(p,{colSpan:1e3,className:`ds-table__empty-cell`,children:(0,n.jsx)(m,{title:c,role:`status`})})}):r})}),d=(0,t.forwardRef)(function({isSelected:e=!1,isInteractive:t=!1,className:r,...i},a){return(0,n.jsx)(`tr`,{ref:a,"data-selected":e||void 0,"data-interactive":t||void 0,tabIndex:t?0:void 0,className:r,...i})}),f=(0,t.forwardRef)(function({align:e=`start`,width:t=`auto`,className:r,...i},a){return(0,n.jsx)(`th`,{ref:a,scope:`col`,"data-align":e,"data-width":t,className:r,...i})}),p=(0,t.forwardRef)(function({align:e=`start`,width:t=`auto`,emphasis:r=`default`,className:i,...a},o){return(0,n.jsx)(`td`,{ref:o,"data-align":e,"data-width":t,"data-emphasis":r==="default"?void 0:r,className:i,...a})}),m=(0,t.forwardRef)(function({icon:t=`info`,title:i=`No data found.`,description:a,action:o,className:s,...c},l){return(0,n.jsxs)(`div`,{ref:l,className:r(`ds-table-empty`,s),...c,children:[(0,n.jsx)(e.t,{name:t,size:24}),(0,n.jsx)(`span`,{style:{color:`var(--color-text)`,fontWeight:`var(--font-weight-bold)`},children:i}),a&&(0,n.jsx)(`span`,{children:a}),o]})});exports.Table=c,exports.TableBody=u,exports.TableCell=p,exports.TableEmpty=m,exports.TableFrame=i,exports.TableHead=l,exports.TableHeaderCell=f,exports.TableRow=d,exports.TableToolbar=a;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-CW6qJcDy.cjs");let t=require("react"),n=require("react/jsx-runtime");function r(...e){return e.filter(Boolean).join(` `)}var i=(0,t.forwardRef)(function({className:e,children:t,...i},a){return(0,n.jsx)(`div`,{ref:a,className:r(`ds-table-frame`,e),...i,children:t})}),a=(0,t.forwardRef)(function({start:e,end:t,className:i,...a},o){return(0,n.jsxs)(`div`,{ref:o,className:r(`ds-table-toolbar`,i),...a,children:[(0,n.jsx)(`div`,{className:`ds-table-toolbar__group`,children:e}),(0,n.jsx)(`div`,{className:`ds-table-toolbar__group`,children:t})]})});function o(e){return t.Children.toArray(e).some(e=>(0,t.isValidElement)(e)&&(e.type!==t.Fragment||o(e.props.children)))}var s=(0,t.createContext)({emptyMessage:`No data found.`}),c=(0,t.forwardRef)(function({emptyMessage:e=`No data found.`,isEmpty:t,className:i,children:a,...o},c){return(0,n.jsx)(s.Provider,{value:{emptyMessage:e,isEmpty:t},children:(0,n.jsx)(`div`,{className:`ds-table-frame__scroll`,children:(0,n.jsx)(`table`,{...o,ref:c,className:r(`ds-table`,i),children:a})})})}),l=(0,t.forwardRef)(function({className:e,...t},r){return(0,n.jsx)(`thead`,{ref:r,className:e,...t})}),u=(0,t.forwardRef)(function({className:e,children:r,...i},a){let{emptyMessage:c,isEmpty:l}=(0,t.useContext)(s);return(0,n.jsx)(`tbody`,{ref:a,className:e,...i,children:l??!o(r)?(0,n.jsx)(d,{children:(0,n.jsx)(p,{colSpan:1e3,className:`ds-table__empty-cell`,children:(0,n.jsx)(m,{title:c,role:`status`})})}):r})}),d=(0,t.forwardRef)(function({isSelected:e=!1,isInteractive:t=!1,className:r,...i},a){return(0,n.jsx)(`tr`,{ref:a,"data-selected":e||void 0,"data-interactive":t||void 0,tabIndex:t?0:void 0,className:r,...i})}),f=(0,t.forwardRef)(function({align:e=`start`,width:t=`auto`,className:r,...i},a){return(0,n.jsx)(`th`,{ref:a,scope:`col`,"data-align":e,"data-width":t,className:r,...i})}),p=(0,t.forwardRef)(function({align:e=`start`,width:t=`auto`,emphasis:r=`default`,className:i,...a},o){return(0,n.jsx)(`td`,{ref:o,"data-align":e,"data-width":t,"data-emphasis":r==="default"?void 0:r,className:i,...a})}),m=(0,t.forwardRef)(function({icon:t=`info`,title:i=`No data found.`,description:a,action:o,className:s,...c},l){return(0,n.jsxs)(`div`,{ref:l,className:r(`ds-table-empty`,s),...c,children:[(0,n.jsx)(e.t,{name:t,size:24}),(0,n.jsx)(`span`,{style:{color:`var(--color-text)`,fontWeight:`var(--font-weight-bold)`},children:i}),a&&(0,n.jsx)(`span`,{children:a}),o]})});exports.Table=c,exports.TableBody=u,exports.TableCell=p,exports.TableEmpty=m,exports.TableFrame=i,exports.TableHead=l,exports.TableHeaderCell=f,exports.TableRow=d,exports.TableToolbar=a;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["forwardRef","Children","isValidElement","Fragment","createContext","useContext","Icon","require_Icon","react","react_jsx_runtime","cx","parts","TableFrame","rest","className","TableToolbar","start","end","hasBodyContent","children","child","TableContext","Table","TableHead","TableBody","isEmpty","TableRow","TableCell","TableEmpty","emptyMessage","isSelected","isInteractive","TableHeaderCell","align","width","emphasis","icon","title","description","action"],"sources":["../../../src/components/Table/index.tsx"],"sourcesContent":["import {\n Children,\n Fragment,\n createContext,\n forwardRef,\n isValidElement,\n useContext,\n type HTMLAttributes,\n type ReactNode,\n type TableHTMLAttributes,\n type TdHTMLAttributes,\n type ThHTMLAttributes,\n} from \"react\";\nimport { Icon } from \"../Icon\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport interface TableFrameProps extends HTMLAttributes<HTMLDivElement> {\n children?: ReactNode;\n}\n\n/** The 3px collection frame every table, list and board sits inside. */\nexport const TableFrame = forwardRef<HTMLDivElement, TableFrameProps>(function TableFrame(\n { className, children, ...rest },\n ref,\n) {\n return (\n <div ref={ref} className={cx(\"ds-table-frame\", className)} {...rest}>\n {children}\n </div>\n );\n});\n\nexport interface TableToolbarProps extends HTMLAttributes<HTMLDivElement> {\n /** Left side — usually a select-all checkbox, a title and a count badge. */\n start?: ReactNode;\n /** Right side — filters and the one primary action. */\n end?: ReactNode;\n}\n\n/** The band above the rules: selection, title, count, filters, primary action. */\nexport const TableToolbar = forwardRef<HTMLDivElement, TableToolbarProps>(\n function TableToolbar({ start, end, className, ...rest }, ref) {\n return (\n <div ref={ref} className={cx(\"ds-table-toolbar\", className)} {...rest}>\n <div className=\"ds-table-toolbar__group\">{start}</div>\n <div className=\"ds-table-toolbar__group\">{end}</div>\n </div>\n );\n },\n);\n\nexport interface TableProps extends TableHTMLAttributes<HTMLTableElement> {\n /** Message shown when a body has no rows. */\n emptyMessage?: string;\n /** Override empty-child detection when rows are rendered by custom components. */\n isEmpty?: boolean;\n children?: ReactNode;\n}\n\nfunction hasBodyContent(children: ReactNode): boolean {\n return Children.toArray(children).some((child) =>\n isValidElement<{ children?: ReactNode }>(child) &&\n (child.type !== Fragment || hasBodyContent(child.props.children)),\n );\n}\n\nconst TableContext = createContext<{\n emptyMessage: string;\n isEmpty?: boolean;\n}>({ emptyMessage: \"No data found.\" });\n\n/** The rules layer. Always render it inside a `TableFrame`. */\nexport const Table = forwardRef<HTMLTableElement, TableProps>(function Table(\n { emptyMessage = \"No data found.\", isEmpty, className, children, ...rest },\n ref,\n) {\n return (\n <TableContext.Provider value={{ emptyMessage, isEmpty }}>\n <div className=\"ds-table-frame__scroll\">\n <table {...rest} ref={ref} className={cx(\"ds-table\", className)}>\n {children}\n </table>\n </div>\n </TableContext.Provider>\n );\n});\n\nexport const TableHead = forwardRef<HTMLTableSectionElement, HTMLAttributes<HTMLTableSectionElement>>(\n function TableHead({ className, ...rest }, ref) {\n return <thead ref={ref} className={className} {...rest} />;\n },\n);\n\nexport const TableBody = forwardRef<HTMLTableSectionElement, HTMLAttributes<HTMLTableSectionElement>>(\n function TableBody({ className, children, ...rest }, ref) {\n const { emptyMessage, isEmpty } = useContext(TableContext);\n return (\n <tbody ref={ref} className={className} {...rest}>\n {(isEmpty ?? !hasBodyContent(children)) ? (\n <TableRow>\n {/* HTML's maximum span covers the row without inspecting columns. */}\n <TableCell colSpan={1000} className=\"ds-table__empty-cell\">\n <TableEmpty title={emptyMessage} role=\"status\" />\n </TableCell>\n </TableRow>\n ) : children}\n </tbody>\n );\n },\n);\n\nexport interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {\n /** Paints the soft fill and the solid rail. Never changes the row's size. */\n isSelected?: boolean;\n /** Marks the row clickable: hover fill plus a pointer cursor. */\n isInteractive?: boolean;\n}\n\nexport const TableRow = forwardRef<HTMLTableRowElement, TableRowProps>(function TableRow(\n { isSelected = false, isInteractive = false, className, ...rest },\n ref,\n) {\n return (\n <tr\n ref={ref}\n data-selected={isSelected || undefined}\n data-interactive={isInteractive || undefined}\n tabIndex={isInteractive ? 0 : undefined}\n className={className}\n {...rest}\n />\n );\n});\n\nexport type TableAlign = \"start\" | \"end\";\nexport type TableCellWidth = \"auto\" | \"control\";\n\nexport interface TableHeaderCellProps\n extends Omit<ThHTMLAttributes<HTMLTableCellElement>, \"align\"> {\n align?: TableAlign;\n width?: TableCellWidth;\n}\n\nexport const TableHeaderCell = forwardRef<HTMLTableCellElement, TableHeaderCellProps>(\n function TableHeaderCell({ align = \"start\", width = \"auto\", className, ...rest }, ref) {\n return (\n <th\n ref={ref}\n scope=\"col\"\n data-align={align}\n data-width={width}\n className={className}\n {...rest}\n />\n );\n },\n);\n\nexport type TableCellEmphasis = \"default\" | \"primary\" | \"muted\";\n\nexport interface TableCellProps\n extends Omit<TdHTMLAttributes<HTMLTableCellElement>, \"align\"> {\n align?: TableAlign;\n width?: TableCellWidth;\n /** `primary` is the row's identity cell — one per row, never two. */\n emphasis?: TableCellEmphasis;\n}\n\nexport const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(function TableCell(\n { align = \"start\", width = \"auto\", emphasis = \"default\", className, ...rest },\n ref,\n) {\n return (\n <td\n ref={ref}\n data-align={align}\n data-width={width}\n data-emphasis={emphasis === \"default\" ? undefined : emphasis}\n className={className}\n {...rest}\n />\n );\n});\n\nexport interface TableEmptyProps extends HTMLAttributes<HTMLDivElement> {\n icon?: IconName;\n title?: string;\n description?: string;\n /** One action at most — the thing that ends the empty state. */\n action?: ReactNode;\n}\n\n/** What the frame shows when the collection has no rows. */\nexport const TableEmpty = forwardRef<HTMLDivElement, TableEmptyProps>(function TableEmpty(\n { icon = \"info\", title = \"No data found.\", description, action, className, ...rest },\n ref,\n) {\n return (\n <div ref={ref} className={cx(\"ds-table-empty\", className)} {...rest}>\n <Icon name={icon} size={24} />\n <span style={{ color: \"var(--color-text)\", fontWeight: \"var(--font-weight-bold)\" }}>\n {title}\n </span>\n {description && <span>{description}</span>}\n {action}\n </div>\n );\n});\n"],"mappings":"A,2KAiBA,SAASU,EAAG,GAAGC,EAAuC,CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,CACvC,CAOA,IAAaC,GAAA,EAAaZ,EAAAA,WAAAA,CAA4C,SACpE,CAAE,YAAW,WAAU,GAAGa,GAC1B,EACA,CACA,OACE,EAAAJ,EAAA,IAAA,CAAC,MAAD,CAAU,MAAK,UAAWC,EAAG,iBAAkBI,CAAS,EAAG,GAAID,EAC5D,UACE,CAAA,CAET,CAAC,EAUYE,GAAA,EAAef,EAAAA,WAAAA,CAC1B,SAAsB,CAAE,QAAO,MAAK,YAAW,GAAGa,GAAQ,EAAK,CAC7D,OACE,EAAAJ,EAAA,KAAA,CAAC,MAAD,CAAU,MAAK,UAAWC,EAAG,mBAAoBI,CAAS,EAAG,GAAID,EAAjE,SAAA,EACE,EAAAJ,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,0BAA2B,SAAAO,CAAW,CAAA,GACrD,EAAAP,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,0BAA2B,SAAAQ,CAAS,CAAA,CAChD,C,EAET,CACF,EAUA,SAASC,EAAe,EAA8B,CACpD,OAAOjB,EAAAA,SAAS,QAAQkB,CAAQ,CAAC,CAAC,KAAM,IAAA,EACtCjB,EAAAA,eAAAA,CAAyCkB,CAAK,IAC3CA,EAAM,OAASjB,EAAAA,UAAYe,EAAeE,EAAM,MAAM,QAAQ,EACnE,CACF,CAEA,IAAMC,GA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 {"version":3,"file":"index.cjs","names":["forwardRef","Children","isValidElement","Fragment","createContext","useContext","Icon","require_Icon","react","react_jsx_runtime","cx","parts","TableFrame","rest","className","TableToolbar","start","end","hasBodyContent","children","child","TableContext","Table","TableHead","TableBody","isEmpty","TableRow","TableCell","TableEmpty","emptyMessage","isSelected","isInteractive","TableHeaderCell","align","width","emphasis","icon","title","description","action"],"sources":["../../../src/components/Table/index.tsx"],"sourcesContent":["import {\n Children,\n Fragment,\n createContext,\n forwardRef,\n isValidElement,\n useContext,\n type HTMLAttributes,\n type ReactNode,\n type TableHTMLAttributes,\n type TdHTMLAttributes,\n type ThHTMLAttributes,\n} from \"react\";\nimport { Icon } from \"../Icon\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport interface TableFrameProps extends HTMLAttributes<HTMLDivElement> {\n children?: ReactNode;\n}\n\n/** The 3px collection frame every table, list and board sits inside. */\nexport const TableFrame = forwardRef<HTMLDivElement, TableFrameProps>(function TableFrame(\n { className, children, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n className={cx(\"ds-table-frame\", className)}\n {...rest}\n >\n {children}\n </div>\n );\n});\n\nexport interface TableToolbarProps extends HTMLAttributes<HTMLDivElement> {\n /** Left side — usually a select-all checkbox, a title and a count badge. */\n start?: ReactNode;\n /** Right side — filters and the one primary action. */\n end?: ReactNode;\n}\n\n/** The band above the rules: selection, title, count, filters, primary action. */\nexport const TableToolbar = forwardRef<HTMLDivElement, TableToolbarProps>(function TableToolbar(\n { start, end, className, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n className={cx(\"ds-table-toolbar\", className)}\n {...rest}\n >\n <div className=\"ds-table-toolbar__group\">{start}</div>\n <div className=\"ds-table-toolbar__group\">{end}</div>\n </div>\n );\n});\n\nexport interface TableProps extends TableHTMLAttributes<HTMLTableElement> {\n /** Message shown when a body has no rows. */\n emptyMessage?: string;\n /** Override empty-child detection when rows are rendered by custom components. */\n isEmpty?: boolean;\n children?: ReactNode;\n}\n\nfunction hasBodyContent(children: ReactNode): boolean {\n return Children.toArray(children).some(\n (child) =>\n isValidElement<{ children?: ReactNode }>(child) &&\n (child.type !== Fragment || hasBodyContent(child.props.children)),\n );\n}\n\nconst TableContext = createContext<{\n emptyMessage: string;\n isEmpty?: boolean;\n}>({ emptyMessage: \"No data found.\" });\n\n/** The rules layer. Always render it inside a `TableFrame`. */\nexport const Table = forwardRef<HTMLTableElement, TableProps>(function Table(\n { emptyMessage = \"No data found.\", isEmpty, className, children, ...rest },\n ref,\n) {\n return (\n <TableContext.Provider value={{ emptyMessage, isEmpty }}>\n <div className=\"ds-table-frame__scroll\">\n <table\n {...rest}\n ref={ref}\n className={cx(\"ds-table\", className)}\n >\n {children}\n </table>\n </div>\n </TableContext.Provider>\n );\n});\n\nexport const TableHead = forwardRef<\n HTMLTableSectionElement,\n HTMLAttributes<HTMLTableSectionElement>\n>(function TableHead({ className, ...rest }, ref) {\n return (\n <thead\n ref={ref}\n className={className}\n {...rest}\n />\n );\n});\n\nexport const TableBody = forwardRef<\n HTMLTableSectionElement,\n HTMLAttributes<HTMLTableSectionElement>\n>(function TableBody({ className, children, ...rest }, ref) {\n const { emptyMessage, isEmpty } = useContext(TableContext);\n return (\n <tbody\n ref={ref}\n className={className}\n {...rest}\n >\n {(isEmpty ?? !hasBodyContent(children)) ? (\n <TableRow>\n {/* HTML's maximum span covers the row without inspecting columns. */}\n <TableCell\n colSpan={1000}\n className=\"ds-table__empty-cell\"\n >\n <TableEmpty\n title={emptyMessage}\n role=\"status\"\n />\n </TableCell>\n </TableRow>\n ) : (\n children\n )}\n </tbody>\n );\n});\n\nexport interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {\n /** Paints the soft fill and the solid rail. Never changes the row's size. */\n isSelected?: boolean;\n /** Marks the row clickable: hover fill plus a pointer cursor. */\n isInteractive?: boolean;\n}\n\nexport const TableRow = forwardRef<HTMLTableRowElement, TableRowProps>(function TableRow(\n { isSelected = false, isInteractive = false, className, ...rest },\n ref,\n) {\n return (\n <tr\n ref={ref}\n data-selected={isSelected || undefined}\n data-interactive={isInteractive || undefined}\n tabIndex={isInteractive ? 0 : undefined}\n className={className}\n {...rest}\n />\n );\n});\n\nexport type TableAlign = \"start\" | \"end\";\nexport type TableCellWidth = \"auto\" | \"control\";\n\nexport interface TableHeaderCellProps extends Omit<\n ThHTMLAttributes<HTMLTableCellElement>,\n \"align\"\n> {\n align?: TableAlign;\n width?: TableCellWidth;\n}\n\nexport const TableHeaderCell = forwardRef<HTMLTableCellElement, TableHeaderCellProps>(\n function TableHeaderCell({ align = \"start\", width = \"auto\", className, ...rest }, ref) {\n return (\n <th\n ref={ref}\n scope=\"col\"\n data-align={align}\n data-width={width}\n className={className}\n {...rest}\n />\n );\n },\n);\n\nexport type TableCellEmphasis = \"default\" | \"primary\" | \"muted\";\n\nexport interface TableCellProps extends Omit<TdHTMLAttributes<HTMLTableCellElement>, \"align\"> {\n align?: TableAlign;\n width?: TableCellWidth;\n /** `primary` is the row's identity cell — one per row, never two. */\n emphasis?: TableCellEmphasis;\n}\n\nexport const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(function TableCell(\n { align = \"start\", width = \"auto\", emphasis = \"default\", className, ...rest },\n ref,\n) {\n return (\n <td\n ref={ref}\n data-align={align}\n data-width={width}\n data-emphasis={emphasis === \"default\" ? undefined : emphasis}\n className={className}\n {...rest}\n />\n );\n});\n\nexport interface TableEmptyProps extends HTMLAttributes<HTMLDivElement> {\n icon?: IconName;\n title?: string;\n description?: string;\n /** One action at most — the thing that ends the empty state. */\n action?: ReactNode;\n}\n\n/** What the frame shows when the collection has no rows. */\nexport const TableEmpty = forwardRef<HTMLDivElement, TableEmptyProps>(function TableEmpty(\n { icon = \"info\", title = \"No data found.\", description, action, className, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n className={cx(\"ds-table-empty\", className)}\n {...rest}\n >\n <Icon\n name={icon}\n size={24}\n />\n <span style={{ color: \"var(--color-text)\", fontWeight: \"var(--font-weight-bold)\" }}>\n {title}\n </span>\n {description && <span>{description}</span>}\n {action}\n </div>\n );\n});\n"],"mappings":"A,2KAiBA,SAASU,EAAG,GAAGC,EAAuC,CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,CACvC,CAOA,IAAaC,GAAA,EAAaZ,EAAAA,WAAAA,CAA4C,SACpE,CAAE,YAAW,WAAU,GAAGa,GAC1B,EACA,CACA,OACE,EAAAJ,EAAA,IAAA,CAAC,MAAD,CACO,MACL,UAAWC,EAAG,iBAAkBI,CAAS,EACzC,GAAID,EAEH,UACE,CAAA,CAET,CAAC,EAUYE,GAAA,EAAef,EAAAA,WAAAA,CAA8C,SACxE,CAAE,QAAO,MAAK,YAAW,GAAGa,GAC5B,EACA,CACA,OACE,EAAAJ,EAAA,KAAA,CAAC,MAAD,CACO,MACL,UAAWC,EAAG,mBAAoBI,CAAS,EAC3C,GAAID,EAHN,SAAA,EAKE,EAAAJ,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,0BAA2B,SAAAO,CAAW,CAAA,GACrD,EAAAP,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,0BAA2B,SAAAQ,CAAS,CAAA,CAChD,C,EAET,CAAC,EAUD,SAASC,EAAe,EAA8B,CACpD,OAAOjB,EAAAA,SAAS,QAAQkB,CAAQ,CAAC,CAAC,KAC/B,IAAA,EACCjB,EAAAA,eAAAA,CAAyCkB,CAAK,IAC7CA,EAAM,OAASjB,EAAAA,UAAYe,EAAeE,EAAM,MAAM,QAAQ,EACnE,CACF,CAEA,IAAMC,GAAA,EAAejB,EAAAA,cAAAA,CAGlB,CAAE,aAAc,gBAAiB,CAAC,EAGxBkB,GAAA,EAAQtB,EAAAA,WAAAA,CAAyC,SAC5D,CAAE,eAAe,iBAAkB,UAAS,YAAW,WAAU,GAAGa,GACpE,EACA,CACA,OACE,EAAAJ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,MAAM,UAAU,GAAG,OAAO,GAAG,KAAK,CAAC;AACzC,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,CAAC;AAEhD,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAChD,gBAAgB,CAAC,oBAAoB,CAAC,EACtC,OAAO,CACR;IACC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB;AAED,eAAO,MAAM,eAAe,uHAa3B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEhE,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC3F,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED,eAAO,MAAM,SAAS,iHAcpB,CAAC;AAEH,MAAM,WAAW,eAAgB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACrE,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,4DAA4D;AAC5D,eAAO,MAAM,UAAU,4GAqBrB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { t as e } from "../../chunks/Icon-CGY1FNXT.js";
1
+ import { t as e } from "../../chunks/Icon-ByUB0L1a.js";
2
2
  import { Children as t, Fragment as n, createContext as r, forwardRef as i, isValidElement as a, useContext as o } from "react";
3
3
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
4
4
  //#region src/components/Table/index.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Icon","cx","parts","TableFrame","forwardRef","rest","className","TableToolbar","start","end","hasBodyContent","Children","children","isValidElement","child","Fragment","TableContext","createContext","Table","TableHead","TableBody","useContext","isEmpty","TableRow","TableCell","TableEmpty","emptyMessage","isSelected","isInteractive","TableHeaderCell","align","width","emphasis","icon","title","description","action"],"sources":["../../../src/components/Table/index.tsx"],"sourcesContent":["import {\n Children,\n Fragment,\n createContext,\n forwardRef,\n isValidElement,\n useContext,\n type HTMLAttributes,\n type ReactNode,\n type TableHTMLAttributes,\n type TdHTMLAttributes,\n type ThHTMLAttributes,\n} from \"react\";\nimport { Icon } from \"../Icon\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport interface TableFrameProps extends HTMLAttributes<HTMLDivElement> {\n children?: ReactNode;\n}\n\n/** The 3px collection frame every table, list and board sits inside. */\nexport const TableFrame = forwardRef<HTMLDivElement, TableFrameProps>(function TableFrame(\n { className, children, ...rest },\n ref,\n) {\n return (\n <div ref={ref} className={cx(\"ds-table-frame\", className)} {...rest}>\n {children}\n </div>\n );\n});\n\nexport interface TableToolbarProps extends HTMLAttributes<HTMLDivElement> {\n /** Left side — usually a select-all checkbox, a title and a count badge. */\n start?: ReactNode;\n /** Right side — filters and the one primary action. */\n end?: ReactNode;\n}\n\n/** The band above the rules: selection, title, count, filters, primary action. */\nexport const TableToolbar = forwardRef<HTMLDivElement, TableToolbarProps>(\n function TableToolbar({ start, end, className, ...rest }, ref) {\n return (\n <div ref={ref} className={cx(\"ds-table-toolbar\", className)} {...rest}>\n <div className=\"ds-table-toolbar__group\">{start}</div>\n <div className=\"ds-table-toolbar__group\">{end}</div>\n </div>\n );\n },\n);\n\nexport interface TableProps extends TableHTMLAttributes<HTMLTableElement> {\n /** Message shown when a body has no rows. */\n emptyMessage?: string;\n /** Override empty-child detection when rows are rendered by custom components. */\n isEmpty?: boolean;\n children?: ReactNode;\n}\n\nfunction hasBodyContent(children: ReactNode): boolean {\n return Children.toArray(children).some((child) =>\n isValidElement<{ children?: ReactNode }>(child) &&\n (child.type !== Fragment || hasBodyContent(child.props.children)),\n );\n}\n\nconst TableContext = createContext<{\n emptyMessage: string;\n isEmpty?: boolean;\n}>({ emptyMessage: \"No data found.\" });\n\n/** The rules layer. Always render it inside a `TableFrame`. */\nexport const Table = forwardRef<HTMLTableElement, TableProps>(function Table(\n { emptyMessage = \"No data found.\", isEmpty, className, children, ...rest },\n ref,\n) {\n return (\n <TableContext.Provider value={{ emptyMessage, isEmpty }}>\n <div className=\"ds-table-frame__scroll\">\n <table {...rest} ref={ref} className={cx(\"ds-table\", className)}>\n {children}\n </table>\n </div>\n </TableContext.Provider>\n );\n});\n\nexport const TableHead = forwardRef<HTMLTableSectionElement, HTMLAttributes<HTMLTableSectionElement>>(\n function TableHead({ className, ...rest }, ref) {\n return <thead ref={ref} className={className} {...rest} />;\n },\n);\n\nexport const TableBody = forwardRef<HTMLTableSectionElement, HTMLAttributes<HTMLTableSectionElement>>(\n function TableBody({ className, children, ...rest }, ref) {\n const { emptyMessage, isEmpty } = useContext(TableContext);\n return (\n <tbody ref={ref} className={className} {...rest}>\n {(isEmpty ?? !hasBodyContent(children)) ? (\n <TableRow>\n {/* HTML's maximum span covers the row without inspecting columns. */}\n <TableCell colSpan={1000} className=\"ds-table__empty-cell\">\n <TableEmpty title={emptyMessage} role=\"status\" />\n </TableCell>\n </TableRow>\n ) : children}\n </tbody>\n );\n },\n);\n\nexport interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {\n /** Paints the soft fill and the solid rail. Never changes the row's size. */\n isSelected?: boolean;\n /** Marks the row clickable: hover fill plus a pointer cursor. */\n isInteractive?: boolean;\n}\n\nexport const TableRow = forwardRef<HTMLTableRowElement, TableRowProps>(function TableRow(\n { isSelected = false, isInteractive = false, className, ...rest },\n ref,\n) {\n return (\n <tr\n ref={ref}\n data-selected={isSelected || undefined}\n data-interactive={isInteractive || undefined}\n tabIndex={isInteractive ? 0 : undefined}\n className={className}\n {...rest}\n />\n );\n});\n\nexport type TableAlign = \"start\" | \"end\";\nexport type TableCellWidth = \"auto\" | \"control\";\n\nexport interface TableHeaderCellProps\n extends Omit<ThHTMLAttributes<HTMLTableCellElement>, \"align\"> {\n align?: TableAlign;\n width?: TableCellWidth;\n}\n\nexport const TableHeaderCell = forwardRef<HTMLTableCellElement, TableHeaderCellProps>(\n function TableHeaderCell({ align = \"start\", width = \"auto\", className, ...rest }, ref) {\n return (\n <th\n ref={ref}\n scope=\"col\"\n data-align={align}\n data-width={width}\n className={className}\n {...rest}\n />\n );\n },\n);\n\nexport type TableCellEmphasis = \"default\" | \"primary\" | \"muted\";\n\nexport interface TableCellProps\n extends Omit<TdHTMLAttributes<HTMLTableCellElement>, \"align\"> {\n align?: TableAlign;\n width?: TableCellWidth;\n /** `primary` is the row's identity cell — one per row, never two. */\n emphasis?: TableCellEmphasis;\n}\n\nexport const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(function TableCell(\n { align = \"start\", width = \"auto\", emphasis = \"default\", className, ...rest },\n ref,\n) {\n return (\n <td\n ref={ref}\n data-align={align}\n data-width={width}\n data-emphasis={emphasis === \"default\" ? undefined : emphasis}\n className={className}\n {...rest}\n />\n );\n});\n\nexport interface TableEmptyProps extends HTMLAttributes<HTMLDivElement> {\n icon?: IconName;\n title?: string;\n description?: string;\n /** One action at most — the thing that ends the empty state. */\n action?: ReactNode;\n}\n\n/** What the frame shows when the collection has no rows. */\nexport const TableEmpty = forwardRef<HTMLDivElement, TableEmptyProps>(function TableEmpty(\n { icon = \"info\", title = \"No data found.\", description, action, className, ...rest },\n ref,\n) {\n return (\n <div ref={ref} className={cx(\"ds-table-empty\", className)} {...rest}>\n <Icon name={icon} size={24} />\n <span style={{ color: \"var(--color-text)\", fontWeight: \"var(--font-weight-bold)\" }}>\n {title}\n </span>\n {description && <span>{description}</span>}\n {action}\n </div>\n );\n});\n"],"mappings":";;;;AAiBA,SAASC,EAAG,GAAGC,GAAuC;CACpD,OAAOA,EAAM,O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IAAM,MAAMiC;IAAM,MAAM;GAAK,CAAA;GAC7B,kBAAC,QAAD;IAAM,OAAO;KAAE,OAAO;KAAqB,YAAY;IAA0B;IAC9E,UAAAC;GACG,CAAA;GACLC,KAAe,kBAAC,QAAD,EAAA,UAAOA,EAAkB,CAAA;GACxCC;EACE;;AAET,CAAC"}
1
+ {"version":3,"file":"index.js","names":["Icon","cx","parts","TableFrame","forwardRef","rest","className","TableToolbar","start","end","hasBodyContent","Children","children","isValidElement","child","Fragment","TableContext","createContext","Table","TableHead","TableBody","useContext","isEmpty","TableRow","TableCell","TableEmpty","emptyMessage","isSelected","isInteractive","TableHeaderCell","align","width","emphasis","icon","title","description","action"],"sources":["../../../src/components/Table/index.tsx"],"sourcesContent":["import {\n Children,\n Fragment,\n createContext,\n forwardRef,\n isValidElement,\n useContext,\n type HTMLAttributes,\n type ReactNode,\n type TableHTMLAttributes,\n type TdHTMLAttributes,\n type ThHTMLAttributes,\n} from \"react\";\nimport { Icon } from \"../Icon\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport interface TableFrameProps extends HTMLAttributes<HTMLDivElement> {\n children?: ReactNode;\n}\n\n/** The 3px collection frame every table, list and board sits inside. */\nexport const TableFrame = forwardRef<HTMLDivElement, TableFrameProps>(function TableFrame(\n { className, children, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n className={cx(\"ds-table-frame\", className)}\n {...rest}\n >\n {children}\n </div>\n );\n});\n\nexport interface TableToolbarProps extends HTMLAttributes<HTMLDivElement> {\n /** Left side — usually a select-all checkbox, a title and a count badge. */\n start?: ReactNode;\n /** Right side — filters and the one primary action. */\n end?: ReactNode;\n}\n\n/** The band above the rules: selection, title, count, filters, primary action. */\nexport const TableToolbar = forwardRef<HTMLDivElement, TableToolbarProps>(function TableToolbar(\n { start, end, className, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n className={cx(\"ds-table-toolbar\", className)}\n {...rest}\n >\n <div className=\"ds-table-toolbar__group\">{start}</div>\n <div className=\"ds-table-toolbar__group\">{end}</div>\n </div>\n );\n});\n\nexport interface TableProps extends TableHTMLAttributes<HTMLTableElement> {\n /** Message shown when a body has no rows. */\n emptyMessage?: string;\n /** Override empty-child detection when rows are rendered by custom components. */\n isEmpty?: boolean;\n children?: ReactNode;\n}\n\nfunction hasBodyContent(children: ReactNode): boolean {\n return Children.toArray(children).some(\n (child) =>\n isValidElement<{ children?: ReactNode }>(child) &&\n (child.type !== Fragment || hasBodyContent(child.props.children)),\n );\n}\n\nconst TableContext = createContext<{\n emptyMessage: string;\n isEmpty?: boolean;\n}>({ emptyMessage: \"No data found.\" });\n\n/** The rules layer. Always render it inside a `TableFrame`. */\nexport const Table = forwardRef<HTMLTableElement, TableProps>(function Table(\n { emptyMessage = \"No data found.\", isEmpty, className, children, ...rest },\n ref,\n) {\n return (\n <TableContext.Provider value={{ emptyMessage, isEmpty }}>\n <div className=\"ds-table-frame__scroll\">\n <table\n {...rest}\n ref={ref}\n className={cx(\"ds-table\", className)}\n >\n {children}\n </table>\n </div>\n </TableContext.Provider>\n );\n});\n\nexport const TableHead = forwardRef<\n HTMLTableSectionElement,\n HTMLAttributes<HTMLTableSectionElement>\n>(function TableHead({ className, ...rest }, ref) {\n return (\n <thead\n ref={ref}\n className={className}\n {...rest}\n />\n );\n});\n\nexport const TableBody = forwardRef<\n HTMLTableSectionElement,\n HTMLAttributes<HTMLTableSectionElement>\n>(function TableBody({ className, children, ...rest }, ref) {\n const { emptyMessage, isEmpty } = useContext(TableContext);\n return (\n <tbody\n ref={ref}\n className={className}\n {...rest}\n >\n {(isEmpty ?? !hasBodyContent(children)) ? (\n <TableRow>\n {/* HTML's maximum span covers the row without inspecting columns. */}\n <TableCell\n colSpan={1000}\n className=\"ds-table__empty-cell\"\n >\n <TableEmpty\n title={emptyMessage}\n role=\"status\"\n />\n </TableCell>\n </TableRow>\n ) : (\n children\n )}\n </tbody>\n );\n});\n\nexport interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {\n /** Paints the soft fill and the solid rail. Never changes the row's size. */\n isSelected?: boolean;\n /** Marks the row clickable: hover fill plus a pointer cursor. */\n isInteractive?: boolean;\n}\n\nexport const TableRow = forwardRef<HTMLTableRowElement, TableRowProps>(function TableRow(\n { isSelected = false, isInteractive = false, className, ...rest },\n ref,\n) {\n return (\n <tr\n ref={ref}\n data-selected={isSelected || undefined}\n data-interactive={isInteractive || undefined}\n tabIndex={isInteractive ? 0 : undefined}\n className={className}\n {...rest}\n />\n );\n});\n\nexport type TableAlign = \"start\" | \"end\";\nexport type TableCellWidth = \"auto\" | \"control\";\n\nexport interface TableHeaderCellProps extends Omit<\n ThHTMLAttributes<HTMLTableCellElement>,\n \"align\"\n> {\n align?: TableAlign;\n width?: TableCellWidth;\n}\n\nexport const TableHeaderCell = forwardRef<HTMLTableCellElement, TableHeaderCellProps>(\n function TableHeaderCell({ align = \"start\", width = \"auto\", className, ...rest }, ref) {\n return (\n <th\n ref={ref}\n scope=\"col\"\n data-align={align}\n data-width={width}\n className={className}\n {...rest}\n />\n );\n },\n);\n\nexport type TableCellEmphasis = \"default\" | \"primary\" | \"muted\";\n\nexport interface TableCellProps extends Omit<TdHTMLAttributes<HTMLTableCellElement>, \"align\"> {\n align?: TableAlign;\n width?: TableCellWidth;\n /** `primary` is the row's identity cell — one per row, never two. */\n emphasis?: TableCellEmphasis;\n}\n\nexport const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(function TableCell(\n { align = \"start\", width = \"auto\", emphasis = \"default\", className, ...rest },\n ref,\n) {\n return (\n <td\n ref={ref}\n data-align={align}\n data-width={width}\n data-emphasis={emphasis === \"default\" ? undefined : emphasis}\n className={className}\n {...rest}\n />\n );\n});\n\nexport interface TableEmptyProps extends HTMLAttributes<HTMLDivElement> {\n icon?: IconName;\n title?: string;\n description?: string;\n /** One action at most — the thing that ends the empty state. */\n action?: ReactNode;\n}\n\n/** What the frame shows when the collection has no rows. */\nexport const TableEmpty = forwardRef<HTMLDivElement, TableEmptyProps>(function TableEmpty(\n { icon = \"info\", title = \"No data found.\", description, action, className, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n className={cx(\"ds-table-empty\", className)}\n {...rest}\n >\n <Icon\n name={icon}\n size={24}\n />\n <span style={{ color: \"var(--color-text)\", fontWeight: \"var(--font-weight-bold)\" }}>\n {title}\n </span>\n {description && <span>{description}</span>}\n {action}\n </div>\n );\n});\n"],"mappings":";;;;AAiBA,SAASC,EAAG,GAAGC,GAAuC;CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AACvC;AAOA,IAAaC,IAAaC,EAA4C,SACpE,EAAE,cAAW,aAAU,GAAGC,KAC1B,GACA;CACA,OACE,kBAAC,OAAD;EACO;EACL,WAAWJ,EAAG,kBAAkBK,CAAS;EACzC,GAAID;EAEH;CACE,CAAA;AAET,CAAC,GAUYE,IAAeH,EAA8C,SACxE,EAAE,UAAO,QAAK,cAAW,GAAGC,KAC5B,GACA;CACA,OACE,kBAAC,OAAD;EACO;EACL,WAAWJ,EAAG,oBAAoBK,CAAS;EAC3C,GAAID;EAHN,UAAA,CAKE,kBAAC,OAAD;GAAK,WAAU;GAA2B,UAAAG;EAAW,CAAA,GACrD,kBAAC,OAAD;GAAK,WAAU;GAA2B,UAAAC;EAAS,CAAA,CAChD;;AAET,CAAC;AAUD,SAASC,EAAe,GAA8B;CACpD,OAAOC,EAAS,QAAQC,CAAQ,CAAC,CAAC,MAC/B,MACCC,EAAyCC,CAAK,MAC7CA,EAAM,SAASC,KAAYL,EAAeI,EAAM,MAAM,QAAQ,EACnE;AACF;AAEA,IAAME,IAAeC,EAGlB,EAAE,cAAc,iBAAiB,CAAC,GAGxBC,IAAQd,EAAyC,SAC5D,EAAE,kBAAe,kBAAkB,YAAS,cAAW,aAAU,GAAGC,KACpE,GACA;CACA,OACE,kBAACW,EAAa,UAAd;EAAu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AGC,KACvE,GACA;CACA,OACE,kBAAC,MAAD;EACO;EACL,cAAYyB;EACZ,cAAYC;EACZ,iBAAeC,MAAa,YAAY,KAAA,IAAYA;EACzC;EACX,GAAI3B;CACL,CAAA;AAEL,CAAC,GAWYoB,IAAarB,EAA4C,SACpE,EAAE,UAAO,QAAQ,WAAQ,kBAAkB,gBAAa,WAAQ,cAAW,GAAGC,KAC9E,GACA;CACA,OACE,kBAAC,OAAD;EACO;EACL,WAAWJ,EAAG,kBAAkBK,CAAS;EACzC,GAAID;EAHN,UAAA;GAKE,kBAACL,GAAD;IACE,MAAMiC;IACN,MAAM;GACP,CAAA;GACD,kBAAC,QAAD;IAAM,OAAO;KAAE,OAAO;KAAqB,YAAY;IAA0B;IAC9E,UAAAC;GACG,CAAA;GACLC,KAAe,kBAAC,QAAD,EAAA,UAAOA,EAAkB,CAAA;GACxCC;EACE;;AAET,CAAC"}
@@ -86,6 +86,7 @@
86
86
 
87
87
  .ds-table tbody tr {
88
88
  border-block-end: var(--rule-width) solid var(--rule-color);
89
+
89
90
  /* The rail exists at every row so selection never shifts the layout. */
90
91
  box-shadow: inset var(--rail-width) 0 0 0 transparent;
91
92
  transition: background-color var(--duration-fast) var(--ease-standard);
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["forwardRef","useState","useRef","Button","require_components_Button_index","react","react_jsx_runtime","cx","parts","TagsInput","rest","internal","setInternal","defaultValue","current","value","draft","setDraft","inputRef","commit","next","onValueChange","add","tag","raw","max","className","size","isDisabled","isInvalid","event","item","node","ref","placeholder"],"sources":["../../../src/components/TagsInput/index.tsx"],"sourcesContent":["import { forwardRef, useRef, useState, type KeyboardEvent } from \"react\";\nimport { Button } from \"../Button\";\nimport type { FieldSize } from \"../Field\";\nimport \"../Field/style.css\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport interface TagsInputProps {\n value?: string[];\n defaultValue?: string[];\n onValueChange?: (value: string[]) => void;\n placeholder?: string;\n size?: FieldSize;\n /** Stop accepting new tags past this count. */\n max?: number;\n isDisabled?: boolean;\n isInvalid?: boolean;\n id?: string;\n className?: string;\n \"aria-label\"?: string;\n \"aria-describedby\"?: string;\n}\n\n/**\n * Free-text keywords. Enter or comma commits a tag, Backspace on an empty\n * input removes the last one. Tags are plain strings — never status tones.\n */\nexport const TagsInput = forwardRef<HTMLInputElement, TagsInputProps>(function TagsInput(\n {\n value,\n defaultValue = [],\n onValueChange,\n placeholder = \"Add a tag\",\n size = \"md\",\n max,\n isDisabled = false,\n isInvalid = false,\n className,\n ...rest\n },\n ref,\n) {\n const [internal, setInternal] = useState<string[]>(defaultValue);\n const current = value ?? internal;\n const [draft, setDraft] = useState(\"\");\n const inputRef = useRef<HTMLInputElement | null>(null);\n\n const commit = (next: string[]) => {\n if (value === undefined) setInternal(next);\n onValueChange?.(next);\n };\n\n const add = (raw: string) => {\n const tag = raw.trim();\n if (!tag || current.includes(tag)) return;\n if (max !== undefined && current.length >= max) return;\n commit([...current, tag]);\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"Enter\" || event.key === \",\") {\n event.preventDefault();\n add(draft);\n setDraft(\"\");\n } else if (event.key === \"Backspace\" && draft === \"\" && current.length > 0) {\n commit(current.slice(0, -1));\n }\n };\n\n return (\n <div\n className={cx(\"ds-field-skin\", \"ds-tags\", className)}\n data-size={size}\n data-disabled={isDisabled || undefined}\n aria-invalid={isInvalid || undefined}\n onClick={() => inputRef.current?.focus()}\n >\n {current.map((tag) => (\n <span key={tag} className=\"ds-tags__tag\">\n {tag}\n <Button\n variant=\"simple\"\n size=\"xs\"\n isIconOnly\n iconStart=\"x\"\n aria-label={`Remove ${tag}`}\n isDisabled={isDisabled}\n onClick={(event) => {\n event.stopPropagation();\n commit(current.filter((item) => item !== tag));\n }}\n />\n </span>\n ))}\n <input\n ref={(node) => {\n inputRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n type=\"text\"\n className=\"ds-tags__input\"\n value={draft}\n placeholder={current.length === 0 ? placeholder : \"\"}\n disabled={isDisabled}\n onChange={(event) => setDraft(event.target.value)}\n onKeyDown={onKeyDown}\n onBlur={() => {\n add(draft);\n setDraft(\"\");\n }}\n {...rest}\n />\n </div>\n );\n});\n"],"mappings":"A,2MAMA,SAASO,EAAG,GAAGC,EAAuC,CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,CACvC,CAsBA,IAAaC,GAAA,EAAYT,EAAAA,WAAAA,CAA6C,SACpE,CACE,QACA,eAAe,CAAC,EAChB,gBACA,cAAc,YACd,OAAO,KACP,MACA,aAAa,GACb,YAAY,GACZ,YACA,GAAGU,GAEL,EACA,CACA,GAAM,CAACC,EAAUC,IAAA,EAAeX,EAAAA,SAAAA,CAAmBY,CAAY,EACzDC,EAAUC,GAASJ,EACnB,CAACK,EAAOC,IAAA,EAAYhB,EAAAA,SAAAA,CAAS,EAAE,EAC/BiB,GAAA,EAAWhB,EAAAA,OAAAA,CAAgC,IAAI,EAE/CiB,EAAU,GAAmB,CAC7BJ,IAAU,IAAA,IAAWH,EAAYQ,CAAI,EACzCC,IAAgBD,CAAI,CACtB,EAEME,EAAO,GAAgB,CAC3B,IAAMC,EAAMC,EAAI,KAAK,EAChBD,GAAO,GAAQ,SAASA,CAAG,IAC5BE,IAAQ,IAAA,IAAaX,EAAQ,QAAUW,GAC3CN,EAAO,CAAC,GAAGL,EAASS,CAAG,CAAC,EAC1B,EAYA,OACE,EAAAjB,EAAA,KAAA,CAAC,MAAD,CACE,UAAWC,EAAG,gBAAiB,UAAWmB,CAAS,EACnD,YAAWC,EACX,gBAAeC,GAAc,IAAA,GAC7B,eAAcC,GAAa,IAAA,GAC3B,YAAeX,EAAS,SAAS,MAAM,EALzC,SAAA,CAOGJ,EAAQ,IAAK,IACZ,EAAAR,EAAA,KAAA,CAAC,OAAD,CAAgB,UAAU,eAA1B,SAAA,CACGiB,GACD,EAAAjB,EAAA,IAAA,CAACH,EAAAA,OAAD,CACE,QAAQ,SACR,KAAK,KACL,WAAA,GACA,UAAU,IACV,aAAY,UAAUoB,IACV,aACZ,QAAU,GAAU,CAClBO,EAAM,gBAAgB,EACtBX,EAAOL,EAAQ,OAAQ,GAASiB,IAASR,CAAG,CAAC,CAC/C,CACD,CAAA,CACG,CAdK,EAAAA,CAcL,CACP,GACD,EAAAjB,EAAA,IAAA,CAAC,QAAD,CACE,IAAM,GAAS,CACb,EAAS,QAAU0B,EACf,OAAOC,GAAQ,WAAYA,EAAID,CAAI,EAC9BC,IAAK,EAAI,QAAUD,EAC9B,EACA,KAAK,OACL,UAAU,iBACV,MAAOhB,EACP,YAAaF,EAAQ,SAAW,EAAIoB,EAAc,GAClD,SAAUN,EACV,SAAW,GAAUX,EAASa,EAAM,OAAO,KAAK,EACrC,UA/CE,GAA2C,CACxDA,EAAM,MAAQ,SAAWA,EAAM,MAAQ,KACzCA,EAAM,eAAe,EACrBR,EAAIN,CAAK,EACTC,EAAS,EAAE,GACFa,EAAM,MAAQ,aAAed,IAAU,IAAMF,EAAQ,OAAS,GACvEK,EAAOL,EAAQ,MAAM,EAAG,EAAE,CAAC,CAE/B,EAwCM,WAAc,CACZQ,EAAIN,CAAK,EACTC,EAAS,EAAE,CACb,EACA,GAAIP,CACL,CAAA,CACE,C,EAET,CAAC,E"}
1
+ {"version":3,"file":"index.cjs","names":["forwardRef","useState","useRef","Button","require_components_Button_index","react","react_jsx_runtime","cx","parts","TagsInput","rest","internal","setInternal","defaultValue","current","value","draft","setDraft","inputRef","commit","next","onValueChange","add","tag","raw","max","className","size","isDisabled","isInvalid","event","item","node","ref","placeholder"],"sources":["../../../src/components/TagsInput/index.tsx"],"sourcesContent":["import { forwardRef, useRef, useState, type KeyboardEvent } from \"react\";\nimport { Button } from \"../Button\";\nimport type { FieldSize } from \"../Field\";\nimport \"../Field/style.css\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport interface TagsInputProps {\n value?: string[];\n defaultValue?: string[];\n onValueChange?: (value: string[]) => void;\n placeholder?: string;\n size?: FieldSize;\n /** Stop accepting new tags past this count. */\n max?: number;\n isDisabled?: boolean;\n isInvalid?: boolean;\n id?: string;\n className?: string;\n \"aria-label\"?: string;\n \"aria-describedby\"?: string;\n}\n\n/**\n * Free-text keywords. Enter or comma commits a tag, Backspace on an empty\n * input removes the last one. Tags are plain strings — never status tones.\n */\nexport const TagsInput = forwardRef<HTMLInputElement, TagsInputProps>(function TagsInput(\n {\n value,\n defaultValue = [],\n onValueChange,\n placeholder = \"Add a tag\",\n size = \"md\",\n max,\n isDisabled = false,\n isInvalid = false,\n className,\n ...rest\n },\n ref,\n) {\n const [internal, setInternal] = useState<string[]>(defaultValue);\n const current = value ?? internal;\n const [draft, setDraft] = useState(\"\");\n const inputRef = useRef<HTMLInputElement | null>(null);\n\n const commit = (next: string[]) => {\n if (value === undefined) setInternal(next);\n onValueChange?.(next);\n };\n\n const add = (raw: string) => {\n const tag = raw.trim();\n if (!tag || current.includes(tag)) return;\n if (max !== undefined && current.length >= max) return;\n commit([...current, tag]);\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"Enter\" || event.key === \",\") {\n event.preventDefault();\n add(draft);\n setDraft(\"\");\n } else if (event.key === \"Backspace\" && draft === \"\" && current.length > 0) {\n commit(current.slice(0, -1));\n }\n };\n\n return (\n <div\n className={cx(\"ds-field-skin\", \"ds-tags\", className)}\n data-size={size}\n data-disabled={isDisabled || undefined}\n aria-invalid={isInvalid || undefined}\n onClick={() => inputRef.current?.focus()}\n >\n {current.map((tag) => (\n <span\n key={tag}\n className=\"ds-tags__tag\"\n >\n {tag}\n <Button\n variant=\"simple\"\n size=\"xs\"\n isIconOnly\n iconStart=\"x\"\n aria-label={`Remove ${tag}`}\n isDisabled={isDisabled}\n onClick={(event) => {\n event.stopPropagation();\n commit(current.filter((item) => item !== tag));\n }}\n />\n </span>\n ))}\n <input\n ref={(node) => {\n inputRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n type=\"text\"\n className=\"ds-tags__input\"\n value={draft}\n placeholder={current.length === 0 ? placeholder : \"\"}\n disabled={isDisabled}\n onChange={(event) => setDraft(event.target.value)}\n onKeyDown={onKeyDown}\n onBlur={() => {\n add(draft);\n setDraft(\"\");\n }}\n {...rest}\n />\n </div>\n );\n});\n"],"mappings":"A,2MAMA,SAASO,EAAG,GAAGC,EAAuC,CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,CACvC,CAsBA,IAAaC,GAAA,EAAYT,EAAAA,WAAAA,CAA6C,SACpE,CACE,QACA,eAAe,CAAC,EAChB,gBACA,cAAc,YACd,OAAO,KACP,MACA,aAAa,GACb,YAAY,GACZ,YACA,GAAGU,GAEL,EACA,CACA,GAAM,CAACC,EAAUC,IAAA,EAAeX,EAAAA,SAAAA,CAAmBY,CAAY,EACzDC,EAAUC,GAASJ,EACnB,CAACK,EAAOC,IAAA,EAAYhB,EAAAA,SAAAA,CAAS,EAAE,EAC/BiB,GAAA,EAAWhB,EAAAA,OAAAA,CAAgC,IAAI,EAE/CiB,EAAU,GAAmB,CAC7BJ,IAAU,IAAA,IAAWH,EAAYQ,CAAI,EACzCC,IAAgBD,CAAI,CACtB,EAEME,EAAO,GAAgB,CAC3B,IAAMC,EAAMC,EAAI,KAAK,EAChBD,GAAO,GAAQ,SAASA,CAAG,IAC5BE,IAAQ,IAAA,IAAaX,EAAQ,QAAUW,GAC3CN,EAAO,CAAC,GAAGL,EAASS,CAAG,CAAC,EAC1B,EAYA,OACE,EAAAjB,EAAA,KAAA,CAAC,MAAD,CACE,UAAWC,EAAG,gBAAiB,UAAWmB,CAAS,EACnD,YAAWC,EACX,gBAAeC,GAAc,IAAA,GAC7B,eAAcC,GAAa,IAAA,GAC3B,YAAeX,EAAS,S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