@arshad-shah/cynosure 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (687) hide show
  1. package/README.md +6 -6
  2. package/dist/_virtual/_rolldown/runtime.js +12 -0
  3. package/dist/adapters/astro/index.d.ts +53 -0
  4. package/dist/adapters/astro/index.js +27 -0
  5. package/dist/adapters/astro/index.js.map +1 -0
  6. package/dist/adapters/vite/index.d.ts +11 -0
  7. package/dist/adapters/vite/index.js +33 -12
  8. package/dist/adapters/vite/index.js.map +1 -1
  9. package/dist/brands/googleplay.d.ts +2 -0
  10. package/dist/brands/googleplay.js +17 -0
  11. package/dist/brands/googleplay.js.map +1 -0
  12. package/dist/brands/index.d.ts +1 -0
  13. package/dist/brands/index.js +132 -130
  14. package/dist/components/Accordion/Accordion.d.ts +1 -1
  15. package/dist/components/Accordion/Accordion.js +26 -26
  16. package/dist/components/Accordion/Accordion.js.map +1 -1
  17. package/dist/components/Announcer/Announcer.d.ts +2 -1
  18. package/dist/components/Announcer/Announcer.js +32 -34
  19. package/dist/components/Announcer/Announcer.js.map +1 -1
  20. package/dist/components/AppShell/AppShell.js +41 -41
  21. package/dist/components/AppShell/AppShell.js.map +1 -1
  22. package/dist/components/Avatar/Avatar.js +20 -20
  23. package/dist/components/Avatar/Avatar.js.map +1 -1
  24. package/dist/components/Badge/Badge.d.ts +19 -5
  25. package/dist/components/Badge/Badge.js +19 -13
  26. package/dist/components/Badge/Badge.js.map +1 -1
  27. package/dist/components/Button/Button.d.ts +30 -6
  28. package/dist/components/Button/Button.js +50 -42
  29. package/dist/components/Button/Button.js.map +1 -1
  30. package/dist/components/Calendar/Calendar.js +158 -161
  31. package/dist/components/Calendar/Calendar.js.map +1 -1
  32. package/dist/components/Calendar/dates.js +42 -38
  33. package/dist/components/Calendar/dates.js.map +1 -1
  34. package/dist/components/Card/Card.d.ts +22 -2
  35. package/dist/components/Card/Card.js +60 -52
  36. package/dist/components/Card/Card.js.map +1 -1
  37. package/dist/components/ChatMessage/ChatMessage.d.ts +55 -0
  38. package/dist/components/ChatMessage/ChatMessage.js +50 -0
  39. package/dist/components/ChatMessage/ChatMessage.js.map +1 -0
  40. package/dist/components/ChatMessage/index.d.ts +1 -0
  41. package/dist/components/Checkbox/Checkbox.d.ts +4 -4
  42. package/dist/components/Checkbox/Checkbox.js +33 -8
  43. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  44. package/dist/components/Checklist/Checklist.js +21 -21
  45. package/dist/components/Checklist/Checklist.js.map +1 -1
  46. package/dist/components/Choice/Choice.d.ts +73 -0
  47. package/dist/components/Choice/Choice.js +41 -0
  48. package/dist/components/Choice/Choice.js.map +1 -0
  49. package/dist/components/Choice/index.d.ts +1 -0
  50. package/dist/components/CodeBlock/CodeBlock.d.ts +6 -1
  51. package/dist/components/CodeBlock/CodeBlock.js +40 -37
  52. package/dist/components/CodeBlock/CodeBlock.js.map +1 -1
  53. package/dist/components/ColorField/ColorField.d.ts +3 -2
  54. package/dist/components/ColorField/ColorField.js +202 -212
  55. package/dist/components/ColorField/ColorField.js.map +1 -1
  56. package/dist/components/ColorField/read-color.js +5 -6
  57. package/dist/components/ColorField/read-color.js.map +1 -1
  58. package/dist/components/ColorSwatches/ColorSwatches.js +42 -33
  59. package/dist/components/ColorSwatches/ColorSwatches.js.map +1 -1
  60. package/dist/components/Combobox/Combobox.d.ts +13 -2
  61. package/dist/components/Combobox/Combobox.js +118 -129
  62. package/dist/components/Combobox/Combobox.js.map +1 -1
  63. package/dist/components/CommandPalette/CommandPalette.d.ts +14 -1
  64. package/dist/components/CommandPalette/CommandPalette.js +153 -109
  65. package/dist/components/CommandPalette/CommandPalette.js.map +1 -1
  66. package/dist/components/CommandPalette/index.d.ts +1 -1
  67. package/dist/components/CompareSlider/CompareSlider.js +14 -14
  68. package/dist/components/CompareSlider/CompareSlider.js.map +1 -1
  69. package/dist/components/Container/Container.d.ts +2 -2
  70. package/dist/components/Container/Container.js +17 -13
  71. package/dist/components/Container/Container.js.map +1 -1
  72. package/dist/components/ContextMenu/ContextMenu.d.ts +27 -13
  73. package/dist/components/ContextMenu/ContextMenu.js +64 -46
  74. package/dist/components/ContextMenu/ContextMenu.js.map +1 -1
  75. package/dist/components/CopyButton/CopyButton.js +41 -41
  76. package/dist/components/CopyButton/CopyButton.js.map +1 -1
  77. package/dist/components/DataGrid/DataGrid.d.ts +135 -0
  78. package/dist/components/DataGrid/DataGrid.js +385 -0
  79. package/dist/components/DataGrid/DataGrid.js.map +1 -0
  80. package/dist/components/DataGrid/index.d.ts +1 -0
  81. package/dist/components/DateField/DateField.d.ts +4 -3
  82. package/dist/components/DateField/DateField.js +70 -59
  83. package/dist/components/DateField/DateField.js.map +1 -1
  84. package/dist/components/DeviceFrame/DeviceFrame.d.ts +63 -0
  85. package/dist/components/DeviceFrame/DeviceFrame.js +54 -0
  86. package/dist/components/DeviceFrame/DeviceFrame.js.map +1 -0
  87. package/dist/components/DeviceFrame/index.d.ts +1 -0
  88. package/dist/components/Dialog/Dialog.d.ts +10 -1
  89. package/dist/components/Dialog/Dialog.js +82 -81
  90. package/dist/components/Dialog/Dialog.js.map +1 -1
  91. package/dist/components/Disclosure/Disclosure.d.ts +15 -1
  92. package/dist/components/Disclosure/Disclosure.js +37 -30
  93. package/dist/components/Disclosure/Disclosure.js.map +1 -1
  94. package/dist/components/DocumentViewport/DocumentViewport.js +54 -57
  95. package/dist/components/DocumentViewport/DocumentViewport.js.map +1 -1
  96. package/dist/components/EmptyState/EmptyState.d.ts +5 -2
  97. package/dist/components/EmptyState/EmptyState.js.map +1 -1
  98. package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +59 -0
  99. package/dist/components/ErrorBoundary/ErrorBoundary.js +53 -0
  100. package/dist/components/ErrorBoundary/ErrorBoundary.js.map +1 -0
  101. package/dist/components/ErrorBoundary/index.d.ts +1 -0
  102. package/dist/components/Field/Field.d.ts +38 -5
  103. package/dist/components/Field/Field.js +48 -42
  104. package/dist/components/Field/Field.js.map +1 -1
  105. package/dist/components/Field/index.d.ts +1 -1
  106. package/dist/components/FileDrop/FileDrop.d.ts +26 -1
  107. package/dist/components/FileDrop/FileDrop.js +150 -99
  108. package/dist/components/FileDrop/FileDrop.js.map +1 -1
  109. package/dist/components/FloatingToolbar/FloatingToolbar.js +80 -77
  110. package/dist/components/FloatingToolbar/FloatingToolbar.js.map +1 -1
  111. package/dist/components/Grid/Grid.d.ts +32 -11
  112. package/dist/components/Grid/Grid.js +78 -48
  113. package/dist/components/Grid/Grid.js.map +1 -1
  114. package/dist/components/Grid/index.d.ts +1 -1
  115. package/dist/components/Heading/Heading.d.ts +4 -2
  116. package/dist/components/Heading/Heading.js.map +1 -1
  117. package/dist/components/HighlightedText/HighlightedText.d.ts +40 -0
  118. package/dist/components/HighlightedText/HighlightedText.js +36 -0
  119. package/dist/components/HighlightedText/HighlightedText.js.map +1 -0
  120. package/dist/components/HighlightedText/index.d.ts +2 -0
  121. package/dist/components/HotkeyField/HotkeyField.d.ts +84 -0
  122. package/dist/components/HotkeyField/HotkeyField.js +161 -0
  123. package/dist/components/HotkeyField/HotkeyField.js.map +1 -0
  124. package/dist/components/HotkeyField/index.d.ts +1 -0
  125. package/dist/components/HoverCard/HoverCard.js +6 -6
  126. package/dist/components/HoverCard/HoverCard.js.map +1 -1
  127. package/dist/components/IconButton/IconButton.d.ts +16 -1
  128. package/dist/components/IconButton/IconButton.js +20 -15
  129. package/dist/components/IconButton/IconButton.js.map +1 -1
  130. package/dist/components/IconTile/IconTile.d.ts +45 -0
  131. package/dist/components/IconTile/IconTile.js +25 -0
  132. package/dist/components/IconTile/IconTile.js.map +1 -0
  133. package/dist/components/IconTile/index.d.ts +1 -0
  134. package/dist/components/Image/Image.js.map +1 -1
  135. package/dist/components/Inline/Inline.d.ts +3 -3
  136. package/dist/components/Inline/Inline.js +12 -22
  137. package/dist/components/Inline/Inline.js.map +1 -1
  138. package/dist/components/Kbd/Kbd.d.ts +0 -2
  139. package/dist/components/Kbd/Kbd.js +16 -22
  140. package/dist/components/Kbd/Kbd.js.map +1 -1
  141. package/dist/components/KeyValueEditor/KeyValueEditor.js +37 -36
  142. package/dist/components/KeyValueEditor/KeyValueEditor.js.map +1 -1
  143. package/dist/components/KeyValueEditor/bulk.js +3 -4
  144. package/dist/components/KeyValueEditor/bulk.js.map +1 -1
  145. package/dist/components/Link/Link.d.ts +9 -1
  146. package/dist/components/Link/Link.js +20 -18
  147. package/dist/components/Link/Link.js.map +1 -1
  148. package/dist/components/List/List.d.ts +73 -0
  149. package/dist/components/List/List.js +64 -0
  150. package/dist/components/List/List.js.map +1 -0
  151. package/dist/components/List/index.d.ts +1 -0
  152. package/dist/components/ListRow/ListRow.d.ts +105 -0
  153. package/dist/components/ListRow/ListRow.js +164 -0
  154. package/dist/components/ListRow/ListRow.js.map +1 -0
  155. package/dist/components/ListRow/index.d.ts +1 -0
  156. package/dist/components/LoadingDots/LoadingDots.d.ts +7 -2
  157. package/dist/components/LoadingDots/LoadingDots.js +28 -18
  158. package/dist/components/LoadingDots/LoadingDots.js.map +1 -1
  159. package/dist/components/Menu/Menu.d.ts +29 -11
  160. package/dist/components/Menu/Menu.js +204 -111
  161. package/dist/components/Menu/Menu.js.map +1 -1
  162. package/dist/components/Menubar/Menubar.d.ts +40 -0
  163. package/dist/components/Menubar/Menubar.js +82 -0
  164. package/dist/components/Menubar/Menubar.js.map +1 -0
  165. package/dist/components/Menubar/index.d.ts +1 -0
  166. package/dist/components/Notice/Notice.d.ts +11 -2
  167. package/dist/components/Notice/Notice.js +31 -27
  168. package/dist/components/Notice/Notice.js.map +1 -1
  169. package/dist/components/NumberField/NumberField.d.ts +8 -3
  170. package/dist/components/NumberField/NumberField.js +151 -100
  171. package/dist/components/NumberField/NumberField.js.map +1 -1
  172. package/dist/components/OptionList/OptionList.d.ts +102 -0
  173. package/dist/components/OptionList/OptionList.js +98 -0
  174. package/dist/components/OptionList/OptionList.js.map +1 -0
  175. package/dist/components/OptionList/index.d.ts +1 -0
  176. package/dist/components/OverlayFrame/OverlayFrame.d.ts +33 -0
  177. package/dist/components/OverlayFrame/OverlayFrame.js +20 -0
  178. package/dist/components/OverlayFrame/OverlayFrame.js.map +1 -0
  179. package/dist/components/OverlayFrame/index.d.ts +1 -0
  180. package/dist/components/PageHeader/PageHeader.d.ts +6 -0
  181. package/dist/components/PageHeader/PageHeader.js +27 -27
  182. package/dist/components/PageHeader/PageHeader.js.map +1 -1
  183. package/dist/components/Pagination/Pagination.js +31 -30
  184. package/dist/components/Pagination/Pagination.js.map +1 -1
  185. package/dist/components/PanZoomCanvas/PanZoomCanvas.d.ts +71 -4
  186. package/dist/components/PanZoomCanvas/PanZoomCanvas.js +197 -141
  187. package/dist/components/PanZoomCanvas/PanZoomCanvas.js.map +1 -1
  188. package/dist/components/PanZoomCanvas/index.d.ts +1 -1
  189. package/dist/components/PathField/PathField.d.ts +68 -0
  190. package/dist/components/PathField/PathField.js +67 -0
  191. package/dist/components/PathField/PathField.js.map +1 -0
  192. package/dist/components/PathField/index.d.ts +1 -0
  193. package/dist/components/Popover/Popover.d.ts +16 -3
  194. package/dist/components/Popover/Popover.js +51 -42
  195. package/dist/components/Popover/Popover.js.map +1 -1
  196. package/dist/components/ProgressBar/ProgressBar.d.ts +4 -3
  197. package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
  198. package/dist/components/QRCode/QRCode.d.ts +56 -0
  199. package/dist/components/QRCode/QRCode.js +48 -0
  200. package/dist/components/QRCode/QRCode.js.map +1 -0
  201. package/dist/components/QRCode/index.d.ts +1 -0
  202. package/dist/components/RadioGroup/RadioGroup.js +32 -24
  203. package/dist/components/RadioGroup/RadioGroup.js.map +1 -1
  204. package/dist/components/RowActions/RowActions.d.ts +35 -0
  205. package/dist/components/RowActions/RowActions.js +38 -0
  206. package/dist/components/RowActions/RowActions.js.map +1 -0
  207. package/dist/components/RowActions/index.d.ts +1 -0
  208. package/dist/components/ScrollArea/ScrollArea.d.ts +55 -0
  209. package/dist/components/ScrollArea/ScrollArea.js +55 -0
  210. package/dist/components/ScrollArea/ScrollArea.js.map +1 -0
  211. package/dist/components/ScrollArea/index.d.ts +1 -0
  212. package/dist/components/SearchField/SearchField.d.ts +17 -0
  213. package/dist/components/SearchField/SearchField.js +31 -17
  214. package/dist/components/SearchField/SearchField.js.map +1 -1
  215. package/dist/components/SearchField/index.d.ts +1 -1
  216. package/dist/components/Section/Section.d.ts +57 -0
  217. package/dist/components/Section/Section.js +27 -0
  218. package/dist/components/Section/Section.js.map +1 -0
  219. package/dist/components/Section/index.d.ts +1 -0
  220. package/dist/components/SegmentedControl/SegmentedControl.d.ts +6 -3
  221. package/dist/components/SegmentedControl/SegmentedControl.js +24 -20
  222. package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
  223. package/dist/components/Select/Select.d.ts +22 -6
  224. package/dist/components/Select/Select.js +155 -156
  225. package/dist/components/Select/Select.js.map +1 -1
  226. package/dist/components/SelectionFrame/frame-math.js +19 -20
  227. package/dist/components/SelectionFrame/frame-math.js.map +1 -1
  228. package/dist/components/Sheet/Sheet.js +12 -7
  229. package/dist/components/Sheet/Sheet.js.map +1 -1
  230. package/dist/components/SideNav/SideNav.d.ts +13 -1
  231. package/dist/components/SideNav/SideNav.js +100 -91
  232. package/dist/components/SideNav/SideNav.js.map +1 -1
  233. package/dist/components/SignaturePad/SignaturePad.js +63 -62
  234. package/dist/components/SignaturePad/SignaturePad.js.map +1 -1
  235. package/dist/components/SignaturePad/ink.js +0 -1
  236. package/dist/components/SignaturePad/ink.js.map +1 -1
  237. package/dist/components/SiteFooter/SiteFooter.d.ts +66 -0
  238. package/dist/components/SiteFooter/SiteFooter.js +80 -0
  239. package/dist/components/SiteFooter/SiteFooter.js.map +1 -0
  240. package/dist/components/SiteFooter/index.d.ts +1 -0
  241. package/dist/components/SiteHeader/SiteHeader.d.ts +78 -0
  242. package/dist/components/SiteHeader/SiteHeader.js +114 -0
  243. package/dist/components/SiteHeader/SiteHeader.js.map +1 -0
  244. package/dist/components/SiteHeader/index.d.ts +1 -0
  245. package/dist/components/SkipLink/SkipLink.d.ts +42 -0
  246. package/dist/components/SkipLink/SkipLink.js +43 -0
  247. package/dist/components/SkipLink/SkipLink.js.map +1 -0
  248. package/dist/components/SkipLink/index.d.ts +1 -0
  249. package/dist/components/Slider/Slider.js +88 -91
  250. package/dist/components/Slider/Slider.js.map +1 -1
  251. package/dist/components/SortButton/SortButton.d.ts +36 -0
  252. package/dist/components/SortButton/SortButton.js +35 -0
  253. package/dist/components/SortButton/SortButton.js.map +1 -0
  254. package/dist/components/SortButton/index.d.ts +1 -0
  255. package/dist/components/SortableList/SortableList.js +146 -120
  256. package/dist/components/SortableList/SortableList.js.map +1 -1
  257. package/dist/components/SplitPane/SplitPane.d.ts +32 -12
  258. package/dist/components/SplitPane/SplitPane.js +105 -59
  259. package/dist/components/SplitPane/SplitPane.js.map +1 -1
  260. package/dist/components/Stack/Stack.d.ts +16 -7
  261. package/dist/components/Stack/Stack.js +32 -18
  262. package/dist/components/Stack/Stack.js.map +1 -1
  263. package/dist/components/Stack/index.d.ts +1 -1
  264. package/dist/components/Stat/Stat.d.ts +88 -0
  265. package/dist/components/Stat/Stat.js +105 -0
  266. package/dist/components/Stat/Stat.js.map +1 -0
  267. package/dist/components/Stat/index.d.ts +1 -0
  268. package/dist/components/StatusBar/StatusBar.d.ts +95 -0
  269. package/dist/components/StatusBar/StatusBar.js +110 -0
  270. package/dist/components/StatusBar/StatusBar.js.map +1 -0
  271. package/dist/components/StatusBar/index.d.ts +1 -0
  272. package/dist/components/Steps/Steps.d.ts +10 -4
  273. package/dist/components/Steps/Steps.js +31 -30
  274. package/dist/components/Steps/Steps.js.map +1 -1
  275. package/dist/components/Switch/Switch.d.ts +4 -4
  276. package/dist/components/Switch/Switch.js +18 -7
  277. package/dist/components/Switch/Switch.js.map +1 -1
  278. package/dist/components/Table/Table.d.ts +6 -6
  279. package/dist/components/Table/Table.js +73 -102
  280. package/dist/components/Table/Table.js.map +1 -1
  281. package/dist/components/Tabs/Tabs.d.ts +55 -6
  282. package/dist/components/Tabs/Tabs.js +288 -169
  283. package/dist/components/Tabs/Tabs.js.map +1 -1
  284. package/dist/components/TagInput/TagInput.d.ts +10 -2
  285. package/dist/components/TagInput/TagInput.js +137 -148
  286. package/dist/components/TagInput/TagInput.js.map +1 -1
  287. package/dist/components/Text/Text.d.ts +6 -0
  288. package/dist/components/Text/Text.js +18 -17
  289. package/dist/components/Text/Text.js.map +1 -1
  290. package/dist/components/TextArea/TextArea.d.ts +37 -6
  291. package/dist/components/TextArea/TextArea.js +200 -72
  292. package/dist/components/TextArea/TextArea.js.map +1 -1
  293. package/dist/components/TextArea/index.d.ts +1 -1
  294. package/dist/components/TextField/TextField.d.ts +22 -6
  295. package/dist/components/TextField/TextField.js +59 -53
  296. package/dist/components/TextField/TextField.js.map +1 -1
  297. package/dist/components/ThemeToggle/ThemeToggle.d.ts +7 -1
  298. package/dist/components/ThemeToggle/ThemeToggle.js +33 -30
  299. package/dist/components/ThemeToggle/ThemeToggle.js.map +1 -1
  300. package/dist/components/TimeField/TimeField.d.ts +4 -3
  301. package/dist/components/TimeField/TimeField.js +197 -183
  302. package/dist/components/TimeField/TimeField.js.map +1 -1
  303. package/dist/components/TitleBar/TitleBar.d.ts +91 -0
  304. package/dist/components/TitleBar/TitleBar.js +80 -0
  305. package/dist/components/TitleBar/TitleBar.js.map +1 -0
  306. package/dist/components/TitleBar/index.d.ts +1 -0
  307. package/dist/components/Toast/Toast.d.ts +17 -2
  308. package/dist/components/Toast/Toast.js +166 -147
  309. package/dist/components/Toast/Toast.js.map +1 -1
  310. package/dist/components/Toast/index.d.ts +1 -1
  311. package/dist/components/Toolbar/Toolbar.js +11 -12
  312. package/dist/components/Toolbar/Toolbar.js.map +1 -1
  313. package/dist/components/Tooltip/Tooltip.d.ts +23 -1
  314. package/dist/components/Tooltip/Tooltip.js +50 -31
  315. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  316. package/dist/components/Tree/Tree.d.ts +92 -11
  317. package/dist/components/Tree/Tree.js +332 -164
  318. package/dist/components/Tree/Tree.js.map +1 -1
  319. package/dist/components/VirtualList/VirtualList.d.ts +27 -4
  320. package/dist/components/VirtualList/VirtualList.js +179 -145
  321. package/dist/components/VirtualList/VirtualList.js.map +1 -1
  322. package/dist/components/VirtualList/index.d.ts +1 -1
  323. package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +24 -0
  324. package/dist/components/VisuallyHidden/VisuallyHidden.js +17 -0
  325. package/dist/components/VisuallyHidden/VisuallyHidden.js.map +1 -0
  326. package/dist/components/VisuallyHidden/index.d.ts +1 -0
  327. package/dist/components/ZoomControls/ZoomControls.d.ts +6 -2
  328. package/dist/components/ZoomControls/ZoomControls.js +37 -37
  329. package/dist/components/ZoomControls/ZoomControls.js.map +1 -1
  330. package/dist/entries/tokens.js +22 -16
  331. package/dist/foundations/ChoiceBase/ChoiceBase.js +15 -13
  332. package/dist/foundations/ChoiceBase/ChoiceBase.js.map +1 -1
  333. package/dist/foundations/HiddenValue/HiddenValue.js +5 -5
  334. package/dist/foundations/HiddenValue/HiddenValue.js.map +1 -1
  335. package/dist/foundations/Icon/Icon.d.ts +6 -1
  336. package/dist/foundations/Icon/Icon.js +15 -14
  337. package/dist/foundations/Icon/Icon.js.map +1 -1
  338. package/dist/foundations/LiveRegion/LiveRegion.d.ts +33 -0
  339. package/dist/foundations/LiveRegion/LiveRegion.js +29 -0
  340. package/dist/foundations/LiveRegion/LiveRegion.js.map +1 -0
  341. package/dist/foundations/LiveRegion/index.d.ts +1 -0
  342. package/dist/foundations/canvas-size.d.ts +14 -0
  343. package/dist/foundations/canvas-size.js +32 -0
  344. package/dist/foundations/canvas-size.js.map +1 -0
  345. package/dist/foundations/dir.js +0 -1
  346. package/dist/foundations/dir.js.map +1 -1
  347. package/dist/foundations/draft.d.ts +14 -0
  348. package/dist/foundations/draft.js +22 -0
  349. package/dist/foundations/draft.js.map +1 -0
  350. package/dist/foundations/edge.d.ts +20 -0
  351. package/dist/foundations/edge.js +26 -0
  352. package/dist/foundations/edge.js.map +1 -0
  353. package/dist/foundations/focus.d.ts +5 -0
  354. package/dist/foundations/focus.js +10 -0
  355. package/dist/foundations/focus.js.map +1 -0
  356. package/dist/foundations/hotkey.d.ts +23 -1
  357. package/dist/foundations/hotkey.js +48 -26
  358. package/dist/foundations/hotkey.js.map +1 -1
  359. package/dist/foundations/icon-size.d.ts +7 -0
  360. package/dist/foundations/icon-size.js +6 -0
  361. package/dist/foundations/icon-size.js.map +1 -0
  362. package/dist/foundations/image-outcome.d.ts +8 -3
  363. package/dist/foundations/image-outcome.js +12 -8
  364. package/dist/foundations/image-outcome.js.map +1 -1
  365. package/dist/foundations/keys.js +12 -13
  366. package/dist/foundations/keys.js.map +1 -1
  367. package/dist/foundations/layout.d.ts +81 -0
  368. package/dist/foundations/layout.js +29 -0
  369. package/dist/foundations/layout.js.map +1 -0
  370. package/dist/foundations/listbox.d.ts +47 -2
  371. package/dist/foundations/listbox.js +56 -25
  372. package/dist/foundations/listbox.js.map +1 -1
  373. package/dist/foundations/math.d.ts +25 -0
  374. package/dist/foundations/math.js +14 -3
  375. package/dist/foundations/math.js.map +1 -1
  376. package/dist/foundations/media-query.d.ts +5 -0
  377. package/dist/foundations/media-query.js +14 -0
  378. package/dist/foundations/media-query.js.map +1 -0
  379. package/dist/foundations/motion.d.ts +12 -0
  380. package/dist/foundations/motion.js +21 -0
  381. package/dist/foundations/motion.js.map +1 -0
  382. package/dist/foundations/option-icon.d.ts +3 -1
  383. package/dist/foundations/option-icon.js +6 -6
  384. package/dist/foundations/option-icon.js.map +1 -1
  385. package/dist/foundations/printing.d.ts +6 -0
  386. package/dist/foundations/printing.js +17 -0
  387. package/dist/foundations/printing.js.map +1 -0
  388. package/dist/foundations/qr.d.ts +42 -0
  389. package/dist/foundations/qr.js +245 -0
  390. package/dist/foundations/qr.js.map +1 -0
  391. package/dist/foundations/refs.d.ts +8 -0
  392. package/dist/foundations/refs.js +14 -0
  393. package/dist/foundations/refs.js.map +1 -0
  394. package/dist/foundations/reorder.js +5 -6
  395. package/dist/foundations/reorder.js.map +1 -1
  396. package/dist/foundations/roving-focus.d.ts +10 -0
  397. package/dist/foundations/roving-focus.js +34 -31
  398. package/dist/foundations/roving-focus.js.map +1 -1
  399. package/dist/foundations/scroll-align.d.ts +11 -0
  400. package/dist/foundations/scroll-align.js +8 -0
  401. package/dist/foundations/scroll-align.js.map +1 -0
  402. package/dist/foundations/sort.d.ts +13 -0
  403. package/dist/foundations/sort.js +26 -0
  404. package/dist/foundations/sort.js.map +1 -0
  405. package/dist/foundations/text-match.d.ts +11 -0
  406. package/dist/foundations/text-match.js +20 -0
  407. package/dist/foundations/text-match.js.map +1 -0
  408. package/dist/foundations/tone-icons.js +4 -5
  409. package/dist/foundations/tone-icons.js.map +1 -1
  410. package/dist/foundations/use-follow.d.ts +29 -0
  411. package/dist/foundations/use-follow.js +51 -0
  412. package/dist/foundations/use-follow.js.map +1 -0
  413. package/dist/foundations/virtual-window.d.ts +22 -5
  414. package/dist/foundations/virtual-window.js +58 -54
  415. package/dist/foundations/virtual-window.js.map +1 -1
  416. package/dist/foundations/zoom-gestures.d.ts +23 -1
  417. package/dist/foundations/zoom-gestures.js +123 -84
  418. package/dist/foundations/zoom-gestures.js.map +1 -1
  419. package/dist/foundations/zoom.d.ts +10 -4
  420. package/dist/foundations/zoom.js +16 -17
  421. package/dist/foundations/zoom.js.map +1 -1
  422. package/dist/icons/book-marked.d.ts +2 -0
  423. package/dist/icons/book-marked.js +14 -0
  424. package/dist/icons/book-marked.js.map +1 -0
  425. package/dist/icons/boxes.d.ts +2 -0
  426. package/dist/icons/boxes.js +34 -0
  427. package/dist/icons/boxes.js.map +1 -0
  428. package/dist/icons/by-name.d.ts +11 -0
  429. package/dist/icons/by-name.js +11 -0
  430. package/dist/icons/by-name.js.map +1 -0
  431. package/dist/icons/cable.d.ts +2 -0
  432. package/dist/icons/cable.js +14 -0
  433. package/dist/icons/cable.js.map +1 -0
  434. package/dist/icons/calendar-days.d.ts +2 -0
  435. package/dist/icons/calendar-days.js +24 -0
  436. package/dist/icons/calendar-days.js.map +1 -0
  437. package/dist/icons/check-check.d.ts +2 -0
  438. package/dist/icons/check-check.js +17 -0
  439. package/dist/icons/check-check.js.map +1 -0
  440. package/dist/icons/check-square.d.ts +2 -0
  441. package/dist/icons/check-square.js +14 -0
  442. package/dist/icons/check-square.js.map +1 -0
  443. package/dist/icons/clipboard-paste.d.ts +2 -0
  444. package/dist/icons/clipboard-paste.js +30 -0
  445. package/dist/icons/clipboard-paste.js.map +1 -0
  446. package/dist/icons/crescent.d.ts +2 -0
  447. package/dist/icons/crescent.js +14 -0
  448. package/dist/icons/crescent.js.map +1 -0
  449. package/dist/icons/facet.d.ts +274 -0
  450. package/dist/icons/facet.js +830 -0
  451. package/dist/icons/facet.js.map +1 -0
  452. package/dist/icons/file-plus.d.ts +2 -0
  453. package/dist/icons/file-plus.js +14 -0
  454. package/dist/icons/file-plus.js.map +1 -0
  455. package/dist/icons/file-question.d.ts +2 -0
  456. package/dist/icons/file-question.js +14 -0
  457. package/dist/icons/file-question.js.map +1 -0
  458. package/dist/icons/file-search.d.ts +2 -0
  459. package/dist/icons/file-search.js +24 -0
  460. package/dist/icons/file-search.js.map +1 -0
  461. package/dist/icons/function.d.ts +2 -0
  462. package/dist/icons/function.js +20 -0
  463. package/dist/icons/function.js.map +1 -0
  464. package/dist/icons/gauge.d.ts +2 -0
  465. package/dist/icons/gauge.js +14 -0
  466. package/dist/icons/gauge.js.map +1 -0
  467. package/dist/icons/hourglass.d.ts +2 -0
  468. package/dist/icons/hourglass.js +14 -0
  469. package/dist/icons/hourglass.js.map +1 -0
  470. package/dist/icons/index.d.ts +1 -240
  471. package/dist/icons/index.js +546 -478
  472. package/dist/icons/kaaba.d.ts +2 -0
  473. package/dist/icons/kaaba.js +14 -0
  474. package/dist/icons/kaaba.js.map +1 -0
  475. package/dist/icons/keywords.d.ts +35 -1
  476. package/dist/icons/keywords.js +274 -1
  477. package/dist/icons/keywords.js.map +1 -1
  478. package/dist/icons/languages.d.ts +2 -0
  479. package/dist/icons/languages.js +14 -0
  480. package/dist/icons/languages.js.map +1 -0
  481. package/dist/icons/list-tree.d.ts +2 -0
  482. package/dist/icons/list-tree.js +14 -0
  483. package/dist/icons/list-tree.js.map +1 -0
  484. package/dist/icons/loader.d.ts +2 -0
  485. package/dist/icons/loader.js +14 -0
  486. package/dist/icons/loader.js.map +1 -0
  487. package/dist/icons/monitor-down.d.ts +2 -0
  488. package/dist/icons/monitor-down.js +24 -0
  489. package/dist/icons/monitor-down.js.map +1 -0
  490. package/dist/icons/mosque.d.ts +2 -0
  491. package/dist/icons/mosque.js +14 -0
  492. package/dist/icons/mosque.js.map +1 -0
  493. package/dist/icons/panel-right.d.ts +2 -0
  494. package/dist/icons/panel-right.js +20 -0
  495. package/dist/icons/panel-right.js.map +1 -0
  496. package/dist/icons/party-popper.d.ts +2 -0
  497. package/dist/icons/party-popper.js +14 -0
  498. package/dist/icons/party-popper.js.map +1 -0
  499. package/dist/icons/power-off.d.ts +2 -0
  500. package/dist/icons/power-off.js +14 -0
  501. package/dist/icons/power-off.js.map +1 -0
  502. package/dist/icons/prayer-beads.d.ts +2 -0
  503. package/dist/icons/prayer-beads.js +67 -0
  504. package/dist/icons/prayer-beads.js.map +1 -0
  505. package/dist/icons/qr-code.d.ts +2 -0
  506. package/dist/icons/qr-code.js +38 -0
  507. package/dist/icons/qr-code.js.map +1 -0
  508. package/dist/icons/refresh-cw.d.ts +2 -0
  509. package/dist/icons/refresh-cw.js +14 -0
  510. package/dist/icons/refresh-cw.js.map +1 -0
  511. package/dist/icons/rocket.d.ts +2 -0
  512. package/dist/icons/rocket.js +21 -0
  513. package/dist/icons/rocket.js.map +1 -0
  514. package/dist/icons/rows.d.ts +2 -0
  515. package/dist/icons/rows.js +20 -0
  516. package/dist/icons/rows.js.map +1 -0
  517. package/dist/icons/scissors.d.ts +2 -0
  518. package/dist/icons/scissors.js +26 -0
  519. package/dist/icons/scissors.js.map +1 -0
  520. package/dist/icons/shield-question.d.ts +2 -0
  521. package/dist/icons/shield-question.js +14 -0
  522. package/dist/icons/shield-question.js.map +1 -0
  523. package/dist/icons/square-plus.d.ts +2 -0
  524. package/dist/icons/square-plus.js +20 -0
  525. package/dist/icons/square-plus.js.map +1 -0
  526. package/dist/icons/text-select.d.ts +2 -0
  527. package/dist/icons/text-select.js +14 -0
  528. package/dist/icons/text-select.js.map +1 -0
  529. package/dist/icons/types.d.ts +1 -1
  530. package/dist/icons/types.js +2 -1
  531. package/dist/icons/types.js.map +1 -1
  532. package/dist/icons/window-maximize.d.ts +2 -0
  533. package/dist/icons/window-maximize.js +14 -0
  534. package/dist/icons/window-maximize.js.map +1 -0
  535. package/dist/icons/window-restore.d.ts +2 -0
  536. package/dist/icons/window-restore.js +20 -0
  537. package/dist/icons/window-restore.js.map +1 -0
  538. package/dist/index.d.ts +38 -9
  539. package/dist/index.js +326 -249
  540. package/dist/overlay/dismiss.js +15 -13
  541. package/dist/overlay/dismiss.js.map +1 -1
  542. package/dist/overlay/floating.d.ts +7 -2
  543. package/dist/overlay/floating.js +29 -21
  544. package/dist/overlay/floating.js.map +1 -1
  545. package/dist/overlay/listbox-layer.d.ts +3 -2
  546. package/dist/overlay/listbox-layer.js.map +1 -1
  547. package/dist/overlay/position.d.ts +5 -2
  548. package/dist/overlay/position.js +19 -19
  549. package/dist/overlay/position.js.map +1 -1
  550. package/dist/overlay/toast-host.js +3 -2
  551. package/dist/overlay/toast-host.js.map +1 -1
  552. package/dist/overlay/use-anchored-position.d.ts +2 -2
  553. package/dist/overlay/use-anchored-position.js +25 -25
  554. package/dist/overlay/use-anchored-position.js.map +1 -1
  555. package/dist/styles/announcer.css +1 -1
  556. package/dist/styles/app-shell.css +1 -1
  557. package/dist/styles/avatar.css +1 -1
  558. package/dist/styles/badge.css +1 -1
  559. package/dist/styles/base.css +1 -1
  560. package/dist/styles/button.css +1 -1
  561. package/dist/styles/calendar.css +1 -1
  562. package/dist/styles/card.css +1 -1
  563. package/dist/styles/chat-message.css +1 -0
  564. package/dist/styles/checkbox.css +1 -1
  565. package/dist/styles/choice-base.css +1 -0
  566. package/dist/styles/choice.css +1 -1
  567. package/dist/styles/code-block.css +1 -1
  568. package/dist/styles/color-field.css +1 -1
  569. package/dist/styles/combobox.css +1 -1
  570. package/dist/styles/command-palette.css +1 -1
  571. package/dist/styles/copy-button.css +1 -1
  572. package/dist/styles/data-grid.css +1 -0
  573. package/dist/styles/date-field.css +1 -1
  574. package/dist/styles/device-frame.css +1 -0
  575. package/dist/styles/dialog.css +1 -1
  576. package/dist/styles/disclosure.css +1 -1
  577. package/dist/styles/error-boundary.css +1 -0
  578. package/dist/styles/field.css +1 -1
  579. package/dist/styles/file-drop.css +1 -1
  580. package/dist/styles/floating-toolbar.css +1 -1
  581. package/dist/styles/generated-css.d.ts +1 -1
  582. package/dist/styles/generated-css.js +3 -3
  583. package/dist/styles/generated-css.js.map +1 -1
  584. package/dist/styles/grid.css +1 -1
  585. package/dist/styles/heading.css +1 -1
  586. package/dist/styles/highlighted-text.css +1 -0
  587. package/dist/styles/hotkey-field.css +1 -0
  588. package/dist/styles/icon-tile.css +1 -0
  589. package/dist/styles/icon.css +1 -1
  590. package/dist/styles/inline.css +1 -0
  591. package/dist/styles/key-value-editor.css +1 -1
  592. package/dist/styles/link.css +1 -1
  593. package/dist/styles/list-row.css +1 -0
  594. package/dist/styles/list.css +1 -0
  595. package/dist/styles/loading-dots.css +1 -1
  596. package/dist/styles/manifest.json +852 -0
  597. package/dist/styles/menu.css +1 -1
  598. package/dist/styles/menubar.css +1 -0
  599. package/dist/styles/notice.css +1 -1
  600. package/dist/styles/number-field.css +1 -1
  601. package/dist/styles/option-list.css +1 -0
  602. package/dist/styles/overlay-frame.css +1 -0
  603. package/dist/styles/pagination.css +1 -1
  604. package/dist/styles/pan-zoom-canvas.css +1 -1
  605. package/dist/styles/path-field.css +1 -0
  606. package/dist/styles/popover.css +1 -1
  607. package/dist/styles/progress-bar.css +1 -1
  608. package/dist/styles/qr-code.css +1 -0
  609. package/dist/styles/radio-group.css +1 -1
  610. package/dist/styles/row-actions.css +1 -0
  611. package/dist/styles/scroll-area.css +1 -0
  612. package/dist/styles/search-field.css +1 -1
  613. package/dist/styles/section.css +1 -0
  614. package/dist/styles/segmented-control.css +1 -1
  615. package/dist/styles/select.css +1 -1
  616. package/dist/styles/sheet.css +1 -1
  617. package/dist/styles/side-nav.css +1 -1
  618. package/dist/styles/site-footer.css +1 -0
  619. package/dist/styles/site-header.css +1 -0
  620. package/dist/styles/skip-link.css +1 -0
  621. package/dist/styles/sort-button.css +1 -0
  622. package/dist/styles/sortable-list.css +1 -1
  623. package/dist/styles/split-pane.css +1 -1
  624. package/dist/styles/stack.css +1 -1
  625. package/dist/styles/stat.css +1 -0
  626. package/dist/styles/status-bar.css +1 -0
  627. package/dist/styles/steps.css +1 -1
  628. package/dist/styles/switch.css +1 -0
  629. package/dist/styles/table.css +1 -1
  630. package/dist/styles/tabs.css +1 -1
  631. package/dist/styles/tag-input.css +1 -1
  632. package/dist/styles/text-area.css +1 -1
  633. package/dist/styles/text-field.css +1 -1
  634. package/dist/styles/text.css +1 -1
  635. package/dist/styles/time-field.css +1 -1
  636. package/dist/styles/title-bar.css +1 -0
  637. package/dist/styles/toast.css +1 -1
  638. package/dist/styles/tokens.css +3 -3
  639. package/dist/styles/tree.css +1 -1
  640. package/dist/styles/virtual-list.css +1 -1
  641. package/dist/styles/visually-hidden.css +1 -0
  642. package/dist/styles.css +3 -3
  643. package/dist/theme/CynosureTheme.d.ts +7 -3
  644. package/dist/theme/CynosureTheme.js +47 -31
  645. package/dist/theme/CynosureTheme.js.map +1 -1
  646. package/dist/theme/index.d.ts +1 -0
  647. package/dist/theme/theme-context.d.ts +9 -0
  648. package/dist/theme/theme-context.js +8 -0
  649. package/dist/theme/theme-context.js.map +1 -0
  650. package/dist/theme/theme-init-script.js +0 -1
  651. package/dist/theme/theme-init-script.js.map +1 -1
  652. package/dist/theme/use-color-mode.d.ts +3 -2
  653. package/dist/theme/use-color-mode.js +35 -38
  654. package/dist/theme/use-color-mode.js.map +1 -1
  655. package/dist/theme/use-cynosure-theme.d.ts +18 -0
  656. package/dist/theme/use-cynosure-theme.js +23 -0
  657. package/dist/theme/use-cynosure-theme.js.map +1 -0
  658. package/dist/tokens/chart-themes.d.ts +38 -0
  659. package/dist/tokens/chart-themes.js +35 -0
  660. package/dist/tokens/chart-themes.js.map +1 -0
  661. package/dist/tokens/create-theme.d.ts +11 -1
  662. package/dist/tokens/create-theme.js +194 -125
  663. package/dist/tokens/create-theme.js.map +1 -1
  664. package/dist/tokens/defaults.d.ts +3 -3
  665. package/dist/tokens/defaults.js +1 -0
  666. package/dist/tokens/defaults.js.map +1 -1
  667. package/dist/tokens/editor-themes.d.ts +9 -2
  668. package/dist/tokens/editor-themes.js +43 -42
  669. package/dist/tokens/editor-themes.js.map +1 -1
  670. package/dist/tokens/index.d.ts +3 -1
  671. package/dist/tokens/named-themes.d.ts +41 -0
  672. package/dist/tokens/named-themes.js +118 -0
  673. package/dist/tokens/named-themes.js.map +1 -0
  674. package/dist/tokens/schema.d.ts +24 -1
  675. package/dist/tokens/schema.js +13 -0
  676. package/dist/tokens/schema.js.map +1 -0
  677. package/dist/tokens/to-css.js +34 -31
  678. package/dist/tokens/to-css.js.map +1 -1
  679. package/package.json +15 -6
  680. package/dist/components/Checkbox/ChoiceRow.d.ts +0 -39
  681. package/dist/components/Checkbox/ChoiceRow.js +0 -58
  682. package/dist/components/Checkbox/ChoiceRow.js.map +0 -1
  683. package/dist/components/Stack/space.d.ts +0 -18
  684. package/dist/components/Stack/space.js +0 -12
  685. package/dist/components/Stack/space.js.map +0 -1
  686. package/dist/styles/hidden-value.css +0 -1
  687. package/dist/styles/iconbutton.css +0 -1
@@ -0,0 +1,14 @@
1
+ import { type RefObject } from "react";
2
+ /**
3
+ * The text of a typed field (a date, a time) while it is being edited, and the problem shown for it. While the draft is
4
+ * not a value `check` accepts, the input carries `check`'s message as its custom validity, so a form will not submit
5
+ * (the value it would submit is the last good one). `settle()` drops the draft and the problem: after a commit, a pick,
6
+ * or a form reset. DateField and TimeField use it.
7
+ */
8
+ export declare function useDraft(input: RefObject<HTMLInputElement | null>, check: (draft: string) => string | null): {
9
+ draft: string | null;
10
+ setDraft: import("react").Dispatch<import("react").SetStateAction<string | null>>;
11
+ problem: string | null;
12
+ setProblem: import("react").Dispatch<import("react").SetStateAction<string | null>>;
13
+ settle: () => void;
14
+ };
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ import { useClientLayoutEffect as a } from "./client-layout-effect.js";
3
+ import { useCallback as i, useState as u } from "react";
4
+ function m(r, o) {
5
+ const [t, l] = u(null), [s, e] = u(null), n = t === null ? null : o(t);
6
+ return a(() => {
7
+ r.current?.setCustomValidity(n ?? "");
8
+ }, [n]), {
9
+ draft: t,
10
+ setDraft: l,
11
+ problem: s,
12
+ setProblem: e,
13
+ settle: i(() => {
14
+ l(null), e(null);
15
+ }, [])
16
+ };
17
+ }
18
+ export {
19
+ m as useDraft
20
+ };
21
+
22
+ //# sourceMappingURL=draft.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft.js","names":["useClientLayoutEffect","useCallback","useState","useDraft","input","check","draft","setDraft","problem","setProblem","invalid"],"sources":["../../src/foundations/draft.ts"],"sourcesContent":["import { type RefObject, useCallback, useState } from \"react\";\nimport { useClientLayoutEffect } from \"./client-layout-effect.js\";\n\n/**\n * The text of a typed field (a date, a time) while it is being edited, and the problem shown for it. While the draft is\n * not a value `check` accepts, the input carries `check`'s message as its custom validity, so a form will not submit\n * (the value it would submit is the last good one). `settle()` drops the draft and the problem: after a commit, a pick,\n * or a form reset. DateField and TimeField use it.\n */\nexport function useDraft(input: RefObject<HTMLInputElement | null>, check: (draft: string) => string | null) {\n const [draft, setDraft] = useState<string | null>(null);\n const [problem, setProblem] = useState<string | null>(null);\n const invalid = draft === null ? null : check(draft);\n useClientLayoutEffect(() => {\n input.current?.setCustomValidity(invalid ?? \"\");\n }, [invalid]);\n const settle = useCallback(() => {\n setDraft(null);\n setProblem(null);\n }, []);\n return { draft, setDraft, problem, setProblem, settle };\n}\n"],"mappings":";;;AASA,SAAgBG,EAASC,GAA2CC,GAAyC;AAC3G,QAAM,CAACC,GAAOC,CAAA,IAAYL,EAAwB,IAAI,GAChD,CAACM,GAASC,CAAA,IAAcP,EAAwB,IAAI,GACpDQ,IAAUJ,MAAU,OAAO,OAAOD,EAAMC,CAAK;AACnD,SAAAN,EAAA,MAA4B;AAC1B,IAAAI,EAAM,SAAS,kBAAkBM,KAAW,EAAE;AAAA,EAChD,GAAG,CAACA,CAAO,CAAC,GAKL;AAAA,IAAE,OAAAJ;AAAA,IAAO,UAAAC;AAAA,IAAU,SAAAC;AAAA,IAAS,YAAAC;AAAA,IAAY,QAJhCR,EAAA,MAAkB;AAC/B,MAAAM,EAAS,IAAI,GACbE,EAAW,IAAI;AAAA,IACjB,GAAG,CAAC,CAC2C;AAAA,EAAO;AACxD"}
@@ -0,0 +1,20 @@
1
+ import type { CSSProperties } from "react";
2
+ import { type Tone } from "../tokens/schema.js";
3
+ /** An accent edge: a tone name, which uses that tone's colour, or any CSS colour. */
4
+ export type Edge = Tone | (string & {});
5
+ /** Whether `value` names a `Tone` (rather than being a CSS colour). */
6
+ export declare function isTone(value: string): value is Tone;
7
+ /**
8
+ * The CSS colour of a tone name or a CSS colour: a tone is its colour token (the ink for neutral), so a theme still
9
+ * recolours it; anything else is returned as it is. Edges (`edgeProps`) and Calendar's mark dots use it.
10
+ */
11
+ export declare function toneColour(value: Edge): string;
12
+ /**
13
+ * The attributes of an element drawing an accent edge (Card, Disclosure): `data-edge` (the tone, or "custom") for its
14
+ * stylesheet to draw the border, and the edge's colour (`toneColour`) as the private `--_edge` beside the caller's
15
+ * `style`.
16
+ */
17
+ export declare function edgeProps(edge: Edge | undefined, style: CSSProperties | undefined): {
18
+ "data-edge": string | undefined;
19
+ style: CSSProperties | undefined;
20
+ };
@@ -0,0 +1,26 @@
1
+ import { TONES as t } from "../tokens/schema.js";
2
+ function n(r) {
3
+ return t.includes(r);
4
+ }
5
+ function i(r) {
6
+ return n(r) ? r === "neutral" ? "var(--cy-color-ink)" : `var(--cy-color-${r})` : r;
7
+ }
8
+ function e(r, o) {
9
+ return r ? {
10
+ "data-edge": n(r) ? r : "custom",
11
+ style: {
12
+ "--_edge": i(r),
13
+ ...o
14
+ }
15
+ } : {
16
+ "data-edge": void 0,
17
+ style: o
18
+ };
19
+ }
20
+ export {
21
+ e as edgeProps,
22
+ n as isTone,
23
+ i as toneColour
24
+ };
25
+
26
+ //# sourceMappingURL=edge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edge.js","names":["TONES","isTone","value","toneColour","edgeProps","edge","style"],"sources":["../../src/foundations/edge.ts"],"sourcesContent":["import type { CSSProperties } from \"react\";\nimport { TONES, type Tone } from \"../tokens/schema.js\";\n\n/** An accent edge: a tone name, which uses that tone's colour, or any CSS colour. */\nexport type Edge = Tone | (string & {});\n\n/** Whether `value` names a `Tone` (rather than being a CSS colour). */\nexport function isTone(value: string): value is Tone {\n return (TONES as readonly string[]).includes(value);\n}\n\n/**\n * The CSS colour of a tone name or a CSS colour: a tone is its colour token (the ink for neutral), so a theme still\n * recolours it; anything else is returned as it is. Edges (`edgeProps`) and Calendar's mark dots use it.\n */\nexport function toneColour(value: Edge): string {\n if (!isTone(value)) return value;\n return value === \"neutral\" ? \"var(--cy-color-ink)\" : `var(--cy-color-${value})`;\n}\n\n/**\n * The attributes of an element drawing an accent edge (Card, Disclosure): `data-edge` (the tone, or \"custom\") for its\n * stylesheet to draw the border, and the edge's colour (`toneColour`) as the private `--_edge` beside the caller's\n * `style`.\n */\nexport function edgeProps(\n edge: Edge | undefined,\n style: CSSProperties | undefined,\n): { \"data-edge\": string | undefined; style: CSSProperties | undefined } {\n if (!edge) return { \"data-edge\": undefined, style };\n return {\n \"data-edge\": isTone(edge) ? edge : \"custom\",\n style: { \"--_edge\": toneColour(edge), ...style } as CSSProperties,\n };\n}\n"],"mappings":";AAOA,SAAgBC,EAAOC,GAA8B;AACnD,SAAQF,EAA4B,SAASE,CAAK;AACpD;AAMA,SAAgBC,EAAWD,GAAqB;AAC9C,SAAKD,EAAOC,CAAK,IACVA,MAAU,YAAY,wBAAwB,kBAAkBA,CAAA,MAD5CA;AAE7B;AAOA,SAAgBE,EACdC,GACAC,GACuE;AACvE,SAAKD,IACE;AAAA,IACL,aAAaJ,EAAOI,CAAI,IAAIA,IAAO;AAAA,IACnC,OAAO;AAAA,MAAE,WAAWF,EAAWE,CAAI;AAAA,MAAG,GAAGC;AAAA,IAAM;AAAA,EACjD,IAJkB;AAAA,IAAE,aAAa;AAAA,IAAW,OAAAA;AAAA,EAAM;AAKpD"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The focused element, looking inside open shadow roots: `document.activeElement` stops at the shadow host, so a
3
+ * component rendered in a shadow root would otherwise never see its own focused control. Null on the server.
4
+ */
5
+ export declare function deepActiveElement(doc?: Document | null): HTMLElement | null;
@@ -0,0 +1,10 @@
1
+ function n(t = typeof document > "u" ? null : document) {
2
+ let e = t?.activeElement ?? null;
3
+ for (; e?.shadowRoot?.activeElement; ) e = e.shadowRoot.activeElement;
4
+ return e;
5
+ }
6
+ export {
7
+ n as deepActiveElement
8
+ };
9
+
10
+ //# sourceMappingURL=focus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focus.js","names":["deepActiveElement","doc","active"],"sources":["../../src/foundations/focus.ts"],"sourcesContent":["/**\n * The focused element, looking inside open shadow roots: `document.activeElement` stops at the shadow host, so a\n * component rendered in a shadow root would otherwise never see its own focused control. Null on the server.\n */\nexport function deepActiveElement(doc: Document | null = typeof document === \"undefined\" ? null : document) {\n let active = doc?.activeElement ?? null;\n while (active?.shadowRoot?.activeElement) active = active.shadowRoot.activeElement;\n return active as HTMLElement | null;\n}\n"],"mappings":"AAIA,SAAgBA,EAAkBC,IAAuB,OAAO,WAAa,MAAc,OAAO,UAAU;AAC1G,MAAIC,IAASD,GAAK,iBAAiB;AACnC,SAAOC,GAAQ,YAAY,gBAAe,CAAAA,IAASA,EAAO,WAAW;AACrE,SAAOA;AACT"}
@@ -1,7 +1,29 @@
1
1
  /** True on Apple platforms, where `mod` means Command; elsewhere it means Control. */
2
2
  export declare const isApple: () => boolean;
3
- /** Parses "mod+shift+k" into a matcher for keyboard events. */
3
+ /**
4
+ * `isApple()` as a hook, decided after hydration so the server and the first client render agree (false until then).
5
+ * Kbd, HotkeyField and Menu write shortcuts with it.
6
+ */
7
+ export declare function useApple(): boolean;
8
+ /**
9
+ * Parses "mod+shift+k" into a matcher for keyboard events. The key is compared with the character typed and, when
10
+ * that is not a letter or digit (Option+K types "˚" on macOS, Shift+1 types "!"), with the physical key. A "+" can be
11
+ * the key itself ("mod++").
12
+ */
4
13
  export declare function matchesHotkey(combo: string, event: KeyboardEvent): boolean;
14
+ export interface HotkeyFromEventOptions {
15
+ /** Write for Apple platforms, where Command is `mod` and Control is `ctrl`. Default: this platform. */
16
+ apple?: boolean;
17
+ /** Accept keys without Control, Command or Alt ("k", "shift+/"). Function keys are always accepted. */
18
+ allowBare?: boolean;
19
+ }
20
+ /**
21
+ * The shortcut a key press makes, written as `useHotkey` reads it ("mod+shift+p"), or null when the press is not one
22
+ * yet: only modifiers held, a key with no name, or (without `allowBare`) a key that types rather than commands. The
23
+ * key is the character typed and, when that is not a letter or digit (Option+K types "˚", Shift+1 types "!", a dead
24
+ * key or another alphabet), the letter or digit printed on the physical key, so `matchesHotkey` matches it again.
25
+ */
26
+ export declare function hotkeyFromEvent(event: KeyboardEvent, options?: HotkeyFromEventOptions): string | null;
5
27
  /**
6
28
  * Calls `handler` when `combo` ("mod+k", "shift+?", "/") is pressed anywhere in the page, shadow roots included.
7
29
  * Shortcuts without Ctrl, Command or Alt are ignored while typing in a field, so "/" still types a slash. Any element
@@ -1,24 +1,44 @@
1
1
  "use client";
2
- import { useEffect as f, useRef as l } from "react";
3
- var c = () => typeof navigator < "u" && /Mac|iPhone|iPad|iPod/.test(navigator.platform || navigator.userAgent);
4
- function p(t, e) {
5
- const r = t.toLowerCase().split("+"), a = r.pop() ?? "", n = new Set(r.map((o) => o === "mod" ? c() ? "meta" : "ctrl" : o));
6
- return e.key.toLowerCase() === a && e.ctrlKey === n.has("ctrl") && e.metaKey === n.has("meta") && e.altKey === n.has("alt") && e.shiftKey === n.has("shift");
2
+ import { useClientLayoutEffect as f } from "./client-layout-effect.js";
3
+ import { useEffect as p, useRef as u, useState as y } from "react";
4
+ var l = () => typeof navigator < "u" && /Mac|iPhone|iPad|iPod/.test(navigator.platform || navigator.userAgent);
5
+ function L() {
6
+ const [t, r] = y(!1);
7
+ return f(() => r(l()), []), t;
7
8
  }
8
- var u = (t) => t instanceof HTMLElement && (t.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName));
9
- function w(t, e) {
10
- const r = l(e);
11
- r.current = e, f(() => {
9
+ var c = (t) => /^(?:Key[A-Z]|Digit\d)$/.test(t) ? t.slice(-1).toLowerCase() : "";
10
+ function m(t, r) {
11
+ const o = t.toLowerCase().split(/\+(?=.)/), a = o.pop() ?? "", s = a === "space" ? " " : a, e = new Set(o.map((i) => i === "mod" ? l() ? "meta" : "ctrl" : i)), n = r.key.toLowerCase();
12
+ return (n === s || !/^[a-z0-9]$/.test(n) && c(r.code ?? "") === s) && r.ctrlKey === e.has("ctrl") && r.metaKey === e.has("meta") && r.altKey === e.has("alt") && r.shiftKey === e.has("shift");
13
+ }
14
+ var d = /^(?:Control|Shift|Alt|AltGraph|Meta|OS|Hyper|Super|Fn|FnLock|CapsLock|NumLock|ScrollLock|Symbol|SymbolLock)$/;
15
+ function K(t, r = {}) {
16
+ const { apple: o = l(), allowBare: a = !1 } = r;
17
+ if (d.test(t.key)) return null;
18
+ const s = t.key.toLowerCase();
19
+ let e = /^[a-z0-9]$/.test(s) ? s : c(t.code) || s;
20
+ return e === " " && (e = "space"), !e || e === "dead" || e === "unidentified" || !(t.ctrlKey || t.metaKey || t.altKey) && !a && !/^f\d{1,2}$/.test(e) ? null : [...[
21
+ (o ? t.metaKey : t.ctrlKey) && "mod",
22
+ o && t.ctrlKey && "ctrl",
23
+ !o && t.metaKey && "meta",
24
+ t.altKey && "alt",
25
+ t.shiftKey && "shift"
26
+ ].filter(Boolean), e].join("+");
27
+ }
28
+ var h = (t) => t instanceof HTMLElement && (t.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName));
29
+ function S(t, r) {
30
+ const o = u(r);
31
+ o.current = r, p(() => {
12
32
  if (!t) return;
13
- const a = !/(^|\+)(mod|ctrl|meta|alt)\+/.test(t.toLowerCase()), n = (o) => {
14
- if (o.defaultPrevented || o.isComposing || !p(t, o)) return;
15
- const s = o.composedPath().filter((i) => i instanceof Element);
16
- s.some((i) => i.getAttribute("data-cy-hotkeys") === "off") || a && s[0] && u(s[0]) || (o.preventDefault(), r.current(o));
33
+ const a = !/(^|\+)(mod|ctrl|meta|alt)\+/.test(t.toLowerCase()), s = (e) => {
34
+ if (e.defaultPrevented || e.isComposing || !m(t, e)) return;
35
+ const n = e.composedPath().filter((i) => i instanceof Element);
36
+ n.some((i) => i.getAttribute("data-cy-hotkeys") === "off") || a && n[0] && h(n[0]) || (e.preventDefault(), o.current(e));
17
37
  };
18
- return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
38
+ return document.addEventListener("keydown", s), () => document.removeEventListener("keydown", s);
19
39
  }, [t]);
20
40
  }
21
- var m = {
41
+ var w = {
22
42
  mod: ["Cmd", "Ctrl"],
23
43
  ctrl: ["Ctrl", "Ctrl"],
24
44
  meta: ["Cmd", "Win"],
@@ -32,13 +52,13 @@ var m = {
32
52
  arrowleft: ["Left", "Left"],
33
53
  arrowright: ["Right", "Right"]
34
54
  };
35
- function C(t, e = c()) {
36
- return t.split(/\+(?=.)/).map((r) => {
37
- const a = m[r.toLowerCase()];
38
- return a ? e ? a[0] : a[1] : r.length === 1 || /^f\d{1,2}$/i.test(r) ? r.toUpperCase() : `${r.charAt(0).toUpperCase()}${r.slice(1)}`;
55
+ function k(t, r = l()) {
56
+ return t.split(/\+(?=.)/).map((o) => {
57
+ const a = w[o.toLowerCase()];
58
+ return a ? r ? a[0] : a[1] : o.length === 1 || /^f\d{1,2}$/i.test(o) ? o.toUpperCase() : `${o.charAt(0).toUpperCase()}${o.slice(1)}`;
39
59
  });
40
60
  }
41
- var d = {
61
+ var C = {
42
62
  Ctrl: "Control",
43
63
  Cmd: "Meta",
44
64
  Win: "Meta",
@@ -49,13 +69,15 @@ var d = {
49
69
  Down: "ArrowDown",
50
70
  Left: "ArrowLeft",
51
71
  Right: "ArrowRight"
52
- }, A = (t) => t.map((e) => d[e] ?? e).join("+");
72
+ }, g = (t) => t.map((r) => C[r] ?? r).join("+");
53
73
  export {
54
- A as ariaKeyShortcuts,
55
- c as isApple,
56
- p as matchesHotkey,
57
- C as shortcutKeys,
58
- w as useHotkey
74
+ g as ariaKeyShortcuts,
75
+ K as hotkeyFromEvent,
76
+ l as isApple,
77
+ m as matchesHotkey,
78
+ k as shortcutKeys,
79
+ L as useApple,
80
+ S as useHotkey
59
81
  };
60
82
 
61
83
  //# sourceMappingURL=hotkey.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hotkey.js","names":["useEffect","useRef","isApple","matchesHotkey","combo","event","parts","key","want","p","editable","el","useHotkey","handler","latest","plain","onKeyDown","path","n","CAPS","shortcutKeys","apple","part","caps","ARIA_NAMES","ariaKeyShortcuts","keys","k"],"sources":["../../src/foundations/hotkey.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n\n/** True on Apple platforms, where `mod` means Command; elsewhere it means Control. */\nexport const isApple = () =>\n typeof navigator !== \"undefined\" && /Mac|iPhone|iPad|iPod/.test(navigator.platform || navigator.userAgent);\n\n/** Parses \"mod+shift+k\" into a matcher for keyboard events. */\nexport function matchesHotkey(combo: string, event: KeyboardEvent): boolean {\n const parts = combo.toLowerCase().split(\"+\");\n const key = parts.pop() ?? \"\";\n const want = new Set(parts.map((p) => (p === \"mod\" ? (isApple() ? \"meta\" : \"ctrl\") : p)));\n return (\n event.key.toLowerCase() === key &&\n event.ctrlKey === want.has(\"ctrl\") &&\n event.metaKey === want.has(\"meta\") &&\n event.altKey === want.has(\"alt\") &&\n event.shiftKey === want.has(\"shift\")\n );\n}\n\nconst editable = (el: Element) =>\n el instanceof HTMLElement && (el.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(el.tagName));\n\n/**\n * Calls `handler` when `combo` (\"mod+k\", \"shift+?\", \"/\") is pressed anywhere in the page, shadow roots included.\n * Shortcuts without Ctrl, Command or Alt are ignored while typing in a field, so \"/\" still types a slash. Any element\n * can opt its subtree out with `data-cy-hotkeys=\"off\"` (a code editor with its own bindings).\n */\nexport function useHotkey(combo: string | false, handler: (event: KeyboardEvent) => void) {\n const latest = useRef(handler);\n latest.current = handler;\n useEffect(() => {\n if (!combo) return;\n const plain = !/(^|\\+)(mod|ctrl|meta|alt)\\+/.test(combo.toLowerCase());\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.defaultPrevented || event.isComposing || !matchesHotkey(combo, event)) return;\n const path = event.composedPath().filter((n): n is Element => n instanceof Element);\n if (path.some((el) => el.getAttribute(\"data-cy-hotkeys\") === \"off\")) return;\n if (plain && path[0] && editable(path[0])) return;\n event.preventDefault();\n latest.current(event);\n };\n document.addEventListener(\"keydown\", onKeyDown);\n return () => document.removeEventListener(\"keydown\", onKeyDown);\n }, [combo]);\n}\n\nconst CAPS: Record<string, [apple: string, other: string]> = {\n mod: [\"Cmd\", \"Ctrl\"],\n ctrl: [\"Ctrl\", \"Ctrl\"],\n meta: [\"Cmd\", \"Win\"],\n alt: [\"Option\", \"Alt\"],\n shift: [\"Shift\", \"Shift\"],\n escape: [\"Esc\", \"Esc\"],\n esc: [\"Esc\", \"Esc\"],\n space: [\"Space\", \"Space\"],\n arrowup: [\"Up\", \"Up\"],\n arrowdown: [\"Down\", \"Down\"],\n arrowleft: [\"Left\", \"Left\"],\n arrowright: [\"Right\", \"Right\"],\n};\n\n/**\n * The key caps for a shortcut written as `useHotkey` writes it, named for the platform: \"mod+shift+k\" is\n * [\"Cmd\", \"Shift\", \"K\"] on Apple platforms and [\"Ctrl\", \"Shift\", \"K\"] elsewhere.\n */\nexport function shortcutKeys(combo: string, apple = isApple()): string[] {\n // \"+\" itself can be the key (\"mod++\"): split on a joining \"+\" only.\n return combo.split(/\\+(?=.)/).map((part) => {\n const caps = CAPS[part.toLowerCase()];\n if (caps) return apple ? caps[0] : caps[1];\n if (part.length === 1 || /^f\\d{1,2}$/i.test(part)) return part.toUpperCase();\n return `${part.charAt(0).toUpperCase()}${part.slice(1)}`;\n });\n}\n\nconst ARIA_NAMES: Record<string, string> = {\n Ctrl: \"Control\",\n Cmd: \"Meta\",\n Win: \"Meta\",\n Opt: \"Alt\",\n Option: \"Alt\",\n Esc: \"Escape\",\n Up: \"ArrowUp\",\n Down: \"ArrowDown\",\n Left: \"ArrowLeft\",\n Right: \"ArrowRight\",\n};\n\n/** Key caps as an `aria-keyshortcuts` value: [\"Ctrl\", \"E\"] is \"Control+E\". */\nexport const ariaKeyShortcuts = (keys: string[]) => keys.map((k) => ARIA_NAMES[k] ?? k).join(\"+\");\n"],"mappings":"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"}
1
+ {"version":3,"file":"hotkey.js","names":["useClientLayoutEffect","useEffect","useRef","useState","isApple","useApple","apple","setApple","codeKey","code","matchesHotkey","combo","event","parts","last","key","want","p","typed","MODIFIER_KEYS","hotkeyFromEvent","options","allowBare","editable","el","useHotkey","handler","latest","plain","onKeyDown","path","n","CAPS","shortcutKeys","part","caps","ARIA_NAMES","ariaKeyShortcuts","keys","k"],"sources":["../../src/foundations/hotkey.ts"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\nimport { useClientLayoutEffect } from \"./client-layout-effect.js\";\n\n/** True on Apple platforms, where `mod` means Command; elsewhere it means Control. */\nexport const isApple = () =>\n typeof navigator !== \"undefined\" && /Mac|iPhone|iPad|iPod/.test(navigator.platform || navigator.userAgent);\n\n/**\n * `isApple()` as a hook, decided after hydration so the server and the first client render agree (false until then).\n * Kbd, HotkeyField and Menu write shortcuts with it.\n */\nexport function useApple() {\n const [apple, setApple] = useState(false);\n useClientLayoutEffect(() => setApple(isApple()), []);\n return apple;\n}\n\n/** The letter or digit printed on the physical key (\"KeyK\" is \"k\", \"Digit1\" is \"1\"), or \"\". */\nconst codeKey = (code: string) => (/^(?:Key[A-Z]|Digit\\d)$/.test(code) ? code.slice(-1).toLowerCase() : \"\");\n\n/**\n * Parses \"mod+shift+k\" into a matcher for keyboard events. The key is compared with the character typed and, when\n * that is not a letter or digit (Option+K types \"˚\" on macOS, Shift+1 types \"!\"), with the physical key. A \"+\" can be\n * the key itself (\"mod++\").\n */\nexport function matchesHotkey(combo: string, event: KeyboardEvent): boolean {\n const parts = combo.toLowerCase().split(/\\+(?=.)/);\n const last = parts.pop() ?? \"\";\n const key = last === \"space\" ? \" \" : last;\n const want = new Set(parts.map((p) => (p === \"mod\" ? (isApple() ? \"meta\" : \"ctrl\") : p)));\n const typed = event.key.toLowerCase();\n const hit = typed === key || (!/^[a-z0-9]$/.test(typed) && codeKey(event.code ?? \"\") === key);\n return (\n hit &&\n event.ctrlKey === want.has(\"ctrl\") &&\n event.metaKey === want.has(\"meta\") &&\n event.altKey === want.has(\"alt\") &&\n event.shiftKey === want.has(\"shift\")\n );\n}\n\n/** Keys that only modify another key, or lock a mode: a shortcut waits for the key that follows them. */\nconst MODIFIER_KEYS =\n /^(?:Control|Shift|Alt|AltGraph|Meta|OS|Hyper|Super|Fn|FnLock|CapsLock|NumLock|ScrollLock|Symbol|SymbolLock)$/;\n\nexport interface HotkeyFromEventOptions {\n /** Write for Apple platforms, where Command is `mod` and Control is `ctrl`. Default: this platform. */\n apple?: boolean;\n /** Accept keys without Control, Command or Alt (\"k\", \"shift+/\"). Function keys are always accepted. */\n allowBare?: boolean;\n}\n\n/**\n * The shortcut a key press makes, written as `useHotkey` reads it (\"mod+shift+p\"), or null when the press is not one\n * yet: only modifiers held, a key with no name, or (without `allowBare`) a key that types rather than commands. The\n * key is the character typed and, when that is not a letter or digit (Option+K types \"˚\", Shift+1 types \"!\", a dead\n * key or another alphabet), the letter or digit printed on the physical key, so `matchesHotkey` matches it again.\n */\nexport function hotkeyFromEvent(event: KeyboardEvent, options: HotkeyFromEventOptions = {}): string | null {\n const { apple = isApple(), allowBare = false } = options;\n if (MODIFIER_KEYS.test(event.key)) return null;\n const typed = event.key.toLowerCase();\n let key = /^[a-z0-9]$/.test(typed) ? typed : codeKey(event.code) || typed;\n if (key === \" \") key = \"space\";\n if (!key || key === \"dead\" || key === \"unidentified\") return null;\n const command = event.ctrlKey || event.metaKey || event.altKey;\n if (!command && !allowBare && !/^f\\d{1,2}$/.test(key)) return null;\n const mods = [\n (apple ? event.metaKey : event.ctrlKey) && \"mod\",\n apple && event.ctrlKey && \"ctrl\",\n !apple && event.metaKey && \"meta\",\n event.altKey && \"alt\",\n event.shiftKey && \"shift\",\n ].filter(Boolean);\n return [...mods, key].join(\"+\");\n}\n\nconst editable = (el: Element) =>\n el instanceof HTMLElement && (el.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(el.tagName));\n\n/**\n * Calls `handler` when `combo` (\"mod+k\", \"shift+?\", \"/\") is pressed anywhere in the page, shadow roots included.\n * Shortcuts without Ctrl, Command or Alt are ignored while typing in a field, so \"/\" still types a slash. Any element\n * can opt its subtree out with `data-cy-hotkeys=\"off\"` (a code editor with its own bindings).\n */\nexport function useHotkey(combo: string | false, handler: (event: KeyboardEvent) => void) {\n const latest = useRef(handler);\n latest.current = handler;\n useEffect(() => {\n if (!combo) return;\n const plain = !/(^|\\+)(mod|ctrl|meta|alt)\\+/.test(combo.toLowerCase());\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.defaultPrevented || event.isComposing || !matchesHotkey(combo, event)) return;\n const path = event.composedPath().filter((n): n is Element => n instanceof Element);\n if (path.some((el) => el.getAttribute(\"data-cy-hotkeys\") === \"off\")) return;\n if (plain && path[0] && editable(path[0])) return;\n event.preventDefault();\n latest.current(event);\n };\n document.addEventListener(\"keydown\", onKeyDown);\n return () => document.removeEventListener(\"keydown\", onKeyDown);\n }, [combo]);\n}\n\nconst CAPS: Record<string, [apple: string, other: string]> = {\n mod: [\"Cmd\", \"Ctrl\"],\n ctrl: [\"Ctrl\", \"Ctrl\"],\n meta: [\"Cmd\", \"Win\"],\n alt: [\"Option\", \"Alt\"],\n shift: [\"Shift\", \"Shift\"],\n escape: [\"Esc\", \"Esc\"],\n esc: [\"Esc\", \"Esc\"],\n space: [\"Space\", \"Space\"],\n arrowup: [\"Up\", \"Up\"],\n arrowdown: [\"Down\", \"Down\"],\n arrowleft: [\"Left\", \"Left\"],\n arrowright: [\"Right\", \"Right\"],\n};\n\n/**\n * The key caps for a shortcut written as `useHotkey` writes it, named for the platform: \"mod+shift+k\" is\n * [\"Cmd\", \"Shift\", \"K\"] on Apple platforms and [\"Ctrl\", \"Shift\", \"K\"] elsewhere.\n */\nexport function shortcutKeys(combo: string, apple = isApple()): string[] {\n // \"+\" itself can be the key (\"mod++\"): split on a joining \"+\" only.\n return combo.split(/\\+(?=.)/).map((part) => {\n const caps = CAPS[part.toLowerCase()];\n if (caps) return apple ? caps[0] : caps[1];\n if (part.length === 1 || /^f\\d{1,2}$/i.test(part)) return part.toUpperCase();\n return `${part.charAt(0).toUpperCase()}${part.slice(1)}`;\n });\n}\n\nconst ARIA_NAMES: Record<string, string> = {\n Ctrl: \"Control\",\n Cmd: \"Meta\",\n Win: \"Meta\",\n Opt: \"Alt\",\n Option: \"Alt\",\n Esc: \"Escape\",\n Up: \"ArrowUp\",\n Down: \"ArrowDown\",\n Left: \"ArrowLeft\",\n Right: \"ArrowRight\",\n};\n\n/** Key caps as an `aria-keyshortcuts` value: [\"Ctrl\", \"E\"] is \"Control+E\". */\nexport const ariaKeyShortcuts = (keys: string[]) => keys.map((k) => ARIA_NAMES[k] ?? k).join(\"+\");\n"],"mappings":"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"}
@@ -0,0 +1,7 @@
1
+ import type { DenseSize } from "../tokens/schema.js";
2
+ /**
3
+ * The Icon size for a control of `size`: `sm` icons in `xs` controls, `md` in `sm` and `md`, `lg` in `lg`, about half
4
+ * the control's height from `md` up; a control without a size is `md`. Every control with an icon uses it, so a field,
5
+ * a button and a segment of the same size show the same icon.
6
+ */
7
+ export declare const iconSizeFor: (size?: DenseSize) => "sm" | "md" | "lg";
@@ -0,0 +1,6 @@
1
+ var o = (m = "md") => m === "xs" ? "sm" : m === "lg" ? "lg" : "md";
2
+ export {
3
+ o as iconSizeFor
4
+ };
5
+
6
+ //# sourceMappingURL=icon-size.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon-size.js","names":["iconSizeFor","size"],"sources":["../../src/foundations/icon-size.ts"],"sourcesContent":["import type { DenseSize } from \"../tokens/schema.js\";\n\n/**\n * The Icon size for a control of `size`: `sm` icons in `xs` controls, `md` in `sm` and `md`, `lg` in `lg`, about half\n * the control's height from `md` up; a control without a size is `md`. Every control with an icon uses it, so a field,\n * a button and a segment of the same size show the same icon.\n */\nexport const iconSizeFor = (size: DenseSize = \"md\"): \"sm\" | \"md\" | \"lg\" =>\n size === \"xs\" ? \"sm\" : size === \"lg\" ? \"lg\" : \"md\";\n"],"mappings":"AAOA,IAAaA,IAAA,CAAeC,IAAkB,SAC5CA,MAAS,OAAO,OAAOA,MAAS,OAAO,OAAO"}
@@ -1,12 +1,17 @@
1
1
  import { type RefObject } from "react";
2
- /** Whether a picture is still on its way, arrived, or could not be shown. */
3
- export type ImageOutcome = "loading" | "loaded" | "error";
2
+ /**
3
+ * Whether a picture is still on its way, arrived, or could not be shown. `pending` is before any script has looked at
4
+ * it (the server's HTML, and a page that is never hydrated): the picture is shown as the browser has it.
5
+ */
6
+ export type ImageOutcome = "pending" | "loading" | "loaded" | "error";
4
7
  /**
5
8
  * Follows one `<img>` from loading to loaded or failed. `key` names the picture (its `src`, with `srcSet` if any): a
6
9
  * new key starts again from "loading", whatever happened to the last one. Give the img a React `key` of the same
7
10
  * value, so `complete` never describes the picture before, and call `loaded` and `failed` from its `onLoad` and
8
11
  * `onError`. A picture that finished before React attached (cached, or sent in the server's HTML) fires neither
9
- * event, so it is also read from the element when the key changes. Image and Avatar use it.
12
+ * event, so it is also read from the element when the key changes. Until script runs the outcome is `pending`, so
13
+ * markup rendered on the server shows its picture even on a page that is never hydrated; on mount an unfinished
14
+ * picture becomes `loading` before the first paint. Image and Avatar use it.
10
15
  */
11
16
  export declare function useImageOutcome(img: RefObject<HTMLImageElement | null>, key: string): {
12
17
  outcome: ImageOutcome;
@@ -1,11 +1,15 @@
1
1
  "use client";
2
- import { useClientLayoutEffect as d } from "./client-layout-effect.js";
3
- import { useState as m } from "react";
4
- function s(l, e) {
5
- const [u, t] = m();
6
- return d(() => {
7
- const o = l.current;
8
- if (!o?.complete) return;
2
+ import { useClientLayoutEffect as l } from "./client-layout-effect.js";
3
+ import { useState as i } from "react";
4
+ function s(d, e) {
5
+ const [u, t] = i();
6
+ return l(() => {
7
+ const o = d.current;
8
+ if (!o) return;
9
+ if (!o.complete) return t({
10
+ key: e,
11
+ outcome: "loading"
12
+ });
9
13
  if (o.naturalWidth > 0) return t({
10
14
  key: e,
11
15
  outcome: "loaded"
@@ -21,7 +25,7 @@ function s(l, e) {
21
25
  n = !1;
22
26
  };
23
27
  }, [e]), {
24
- outcome: u?.key === e ? u.outcome : "loading",
28
+ outcome: u?.key === e ? u.outcome : "pending",
25
29
  loaded: () => t({
26
30
  key: e,
27
31
  outcome: "loaded"
@@ -1 +1 @@
1
- {"version":3,"file":"image-outcome.js","names":["useClientLayoutEffect","useState","useImageOutcome","img","key","settled","setSettled","el","current","settle","outcome","resolve"],"sources":["../../src/foundations/image-outcome.ts"],"sourcesContent":["import { type RefObject, useState } from \"react\";\nimport { useClientLayoutEffect } from \"./client-layout-effect.js\";\n\n/** Whether a picture is still on its way, arrived, or could not be shown. */\nexport type ImageOutcome = \"loading\" | \"loaded\" | \"error\";\n\n/**\n * Follows one `<img>` from loading to loaded or failed. `key` names the picture (its `src`, with `srcSet` if any): a\n * new key starts again from \"loading\", whatever happened to the last one. Give the img a React `key` of the same\n * value, so `complete` never describes the picture before, and call `loaded` and `failed` from its `onLoad` and\n * `onError`. A picture that finished before React attached (cached, or sent in the server's HTML) fires neither\n * event, so it is also read from the element when the key changes. Image and Avatar use it.\n */\nexport function useImageOutcome(img: RefObject<HTMLImageElement | null>, key: string) {\n const [settled, setSettled] = useState<{ key: string; outcome: ImageOutcome }>();\n useClientLayoutEffect(() => {\n const el = img.current;\n if (!el?.complete) return;\n if (el.naturalWidth > 0) return setSettled({ key, outcome: \"loaded\" });\n // Finished with no size: broken, or a picture without one of its own (some SVG). Decoding tells them apart.\n let current = true;\n const settle = (outcome: ImageOutcome) => () => {\n if (current) setSettled({ key, outcome });\n };\n new Promise((resolve) => resolve(el.decode())).then(settle(\"loaded\"), settle(\"error\"));\n return () => {\n current = false;\n };\n }, [key]);\n return {\n outcome: settled?.key === key ? settled.outcome : (\"loading\" as ImageOutcome),\n loaded: () => setSettled({ key, outcome: \"loaded\" }),\n failed: () => setSettled({ key, outcome: \"error\" }),\n };\n}\n"],"mappings":";;;AAaA,SAAgBE,EAAgBC,GAAyCC,GAAa;AACpF,QAAM,CAACC,GAASC,CAAA,IAAcL,EAAiD;AAC/E,SAAAD,EAAA,MAA4B;AAC1B,UAAMO,IAAKJ,EAAI;AACf,QAAI,CAACI,GAAI,SAAU;AACnB,QAAIA,EAAG,eAAe,EAAG,QAAOD,EAAW;AAAA,MAAE,KAAAF;AAAA,MAAK,SAAS;AAAA,IAAS,CAAC;AAErE,QAAII,IAAU;AACd,UAAMC,IAAA,CAAUC,MAAA,MAAgC;AAC9C,MAAIF,KAASF,EAAW;AAAA,QAAE,KAAAF;AAAA,QAAK,SAAAM;AAAA,MAAQ,CAAC;AAAA,IAC1C;AACA,eAAI,QAAA,CAASC,MAAYA,EAAQJ,EAAG,OAAO,CAAC,CAAC,EAAE,KAAKE,EAAO,QAAQ,GAAGA,EAAO,OAAO,CAAC,GACrF,MAAa;AACX,MAAAD,IAAU;AAAA,IACZ;AAAA,EACF,GAAG,CAACJ,CAAG,CAAC,GACD;AAAA,IACL,SAASC,GAAS,QAAQD,IAAMC,EAAQ,UAAW;AAAA,IACnD,QAAA,MAAcC,EAAW;AAAA,MAAE,KAAAF;AAAA,MAAK,SAAS;AAAA,IAAS,CAAC;AAAA,IACnD,QAAA,MAAcE,EAAW;AAAA,MAAE,KAAAF;AAAA,MAAK,SAAS;AAAA,IAAQ,CAAC;AAAA,EACpD;AACF"}
1
+ {"version":3,"file":"image-outcome.js","names":["useClientLayoutEffect","useState","useImageOutcome","img","key","settled","setSettled","el","current","settle","outcome","resolve"],"sources":["../../src/foundations/image-outcome.ts"],"sourcesContent":["import { type RefObject, useState } from \"react\";\nimport { useClientLayoutEffect } from \"./client-layout-effect.js\";\n\n/**\n * Whether a picture is still on its way, arrived, or could not be shown. `pending` is before any script has looked at\n * it (the server's HTML, and a page that is never hydrated): the picture is shown as the browser has it.\n */\nexport type ImageOutcome = \"pending\" | \"loading\" | \"loaded\" | \"error\";\n\n/**\n * Follows one `<img>` from loading to loaded or failed. `key` names the picture (its `src`, with `srcSet` if any): a\n * new key starts again from \"loading\", whatever happened to the last one. Give the img a React `key` of the same\n * value, so `complete` never describes the picture before, and call `loaded` and `failed` from its `onLoad` and\n * `onError`. A picture that finished before React attached (cached, or sent in the server's HTML) fires neither\n * event, so it is also read from the element when the key changes. Until script runs the outcome is `pending`, so\n * markup rendered on the server shows its picture even on a page that is never hydrated; on mount an unfinished\n * picture becomes `loading` before the first paint. Image and Avatar use it.\n */\nexport function useImageOutcome(img: RefObject<HTMLImageElement | null>, key: string) {\n const [settled, setSettled] = useState<{ key: string; outcome: ImageOutcome }>();\n useClientLayoutEffect(() => {\n const el = img.current;\n if (!el) return;\n if (!el.complete) return setSettled({ key, outcome: \"loading\" });\n if (el.naturalWidth > 0) return setSettled({ key, outcome: \"loaded\" });\n // Finished with no size: broken, or a picture without one of its own (some SVG). Decoding tells them apart.\n let current = true;\n const settle = (outcome: ImageOutcome) => () => {\n if (current) setSettled({ key, outcome });\n };\n new Promise((resolve) => resolve(el.decode())).then(settle(\"loaded\"), settle(\"error\"));\n return () => {\n current = false;\n };\n }, [key]);\n return {\n outcome: settled?.key === key ? settled.outcome : (\"pending\" as ImageOutcome),\n loaded: () => setSettled({ key, outcome: \"loaded\" }),\n failed: () => setSettled({ key, outcome: \"error\" }),\n };\n}\n"],"mappings":";;;AAkBA,SAAgBE,EAAgBC,GAAyCC,GAAa;AACpF,QAAM,CAACC,GAASC,CAAA,IAAcL,EAAiD;AAC/E,SAAAD,EAAA,MAA4B;AAC1B,UAAMO,IAAKJ,EAAI;AACf,QAAI,CAACI,EAAI;AACT,QAAI,CAACA,EAAG,SAAU,QAAOD,EAAW;AAAA,MAAE,KAAAF;AAAA,MAAK,SAAS;AAAA,IAAU,CAAC;AAC/D,QAAIG,EAAG,eAAe,EAAG,QAAOD,EAAW;AAAA,MAAE,KAAAF;AAAA,MAAK,SAAS;AAAA,IAAS,CAAC;AAErE,QAAII,IAAU;AACd,UAAMC,IAAA,CAAUC,MAAA,MAAgC;AAC9C,MAAIF,KAASF,EAAW;AAAA,QAAE,KAAAF;AAAA,QAAK,SAAAM;AAAA,MAAQ,CAAC;AAAA,IAC1C;AACA,eAAI,QAAA,CAASC,MAAYA,EAAQJ,EAAG,OAAO,CAAC,CAAC,EAAE,KAAKE,EAAO,QAAQ,GAAGA,EAAO,OAAO,CAAC,GACrF,MAAa;AACX,MAAAD,IAAU;AAAA,IACZ;AAAA,EACF,GAAG,CAACJ,CAAG,CAAC,GACD;AAAA,IACL,SAASC,GAAS,QAAQD,IAAMC,EAAQ,UAAW;AAAA,IACnD,QAAA,MAAcC,EAAW;AAAA,MAAE,KAAAF;AAAA,MAAK,SAAS;AAAA,IAAS,CAAC;AAAA,IACnD,QAAA,MAAcE,EAAW;AAAA,MAAE,KAAAF;AAAA,MAAK,SAAS;AAAA,IAAQ,CAAC;AAAA,EACpD;AACF"}
@@ -1,22 +1,21 @@
1
- "use client";
2
1
  import { clamp as w } from "./math.js";
3
- function d(i) {
4
- const o = "nativeEvent" in i ? i.nativeEvent : i;
2
+ function d(r) {
3
+ const o = "nativeEvent" in r ? r.nativeEvent : r;
5
4
  return o.isComposing || o.keyCode === 229;
6
5
  }
7
- function m(i, o) {
8
- const { value: a, min: y, max: f, step: l, big: s = l * 10, axis: t = "both", rtl: n = !1, downAdds: k = !1 } = o, e = i.shiftKey ? s : l;
9
- let r;
10
- if (t !== "y" && (i.key === "ArrowRight" || i.key === "ArrowLeft")) r = i.key === "ArrowRight" !== n ? e : -e;
11
- else if (t !== "x" && (i.key === "ArrowUp" || i.key === "ArrowDown")) r = i.key === "ArrowUp" !== k ? e : -e;
6
+ function m(r, o) {
7
+ const { value: t, min: y, max: f, step: a, big: s = a * 10, axis: l = "both", rtl: n = !1, downAdds: k = !1 } = o, e = r.shiftKey ? s : a;
8
+ let i;
9
+ if (l !== "y" && (r.key === "ArrowRight" || r.key === "ArrowLeft")) i = r.key === "ArrowRight" !== n ? e : -e;
10
+ else if (l !== "x" && (r.key === "ArrowUp" || r.key === "ArrowDown")) i = r.key === "ArrowUp" !== k ? e : -e;
12
11
  else if (!o.arrowsOnly)
13
- if (i.key === "PageUp") r = s;
14
- else if (i.key === "PageDown") r = -s;
12
+ if (r.key === "PageUp") i = s;
13
+ else if (r.key === "PageDown") i = -s;
15
14
  else {
16
- if (i.key === "Home") return y;
17
- if (i.key === "End") return f;
15
+ if (r.key === "Home") return y;
16
+ if (r.key === "End") return f;
18
17
  }
19
- return r === void 0 ? void 0 : w(a + r, y, f);
18
+ return i === void 0 ? void 0 : w(t + i, y, f);
20
19
  }
21
20
  export {
22
21
  d as isComposing,
@@ -1 +1 @@
1
- {"version":3,"file":"keys.js","names":["clamp","isComposing","event","native","stepKey","options","value","min","max","step","big","axis","rtl","downAdds","by","delta"],"sources":["../../src/foundations/keys.ts"],"sourcesContent":["import type { KeyboardEvent as ReactKeyboardEvent } from \"react\";\nimport { clamp } from \"./math.js\";\n\n/**\n * True while an input method is composing (Chinese, Japanese, Korean…): the key belongs to the composition, not the\n * widget. Safari reports the composing Enter only as keyCode 229, so both are checked.\n */\nexport function isComposing(event: KeyboardEvent | ReactKeyboardEvent): boolean {\n const native = \"nativeEvent\" in event ? event.nativeEvent : event;\n return native.isComposing || native.keyCode === 229;\n}\n\nexport interface StepKeyOptions {\n value: number;\n min: number;\n max: number;\n step: number;\n /** Shift+arrows and Page Up/Down. Default `step × 10`. */\n big?: number;\n /** Which arrows move it: both pairs (a slider, default), only Left/Right, or only Up/Down. */\n axis?: \"both\" | \"x\" | \"y\";\n /** Right to left: Left adds and Right takes away. */\n rtl?: boolean;\n /** Down adds (a horizontal divider that grows the pane above it). Default: Up adds. */\n downAdds?: boolean;\n /** Only the arrows: no Page Up/Down, Home or End (one axis of a 2D area). */\n arrowsOnly?: boolean;\n}\n\n/**\n * The value a slider-style key moves to (WAI-ARIA APG slider), or undefined when the key does nothing: arrows ±step,\n * Shift+arrows and Page Up/Down ±big, Home and End to the ends. Clamped to min and max.\n */\nexport function stepKey(\n event: { key: string; shiftKey: boolean },\n options: StepKeyOptions,\n): number | undefined {\n const { value, min, max, step, big = step * 10, axis = \"both\", rtl = false, downAdds = false } = options;\n const by = event.shiftKey ? big : step;\n let delta: number | undefined;\n if (axis !== \"y\" && (event.key === \"ArrowRight\" || event.key === \"ArrowLeft\"))\n delta = (event.key === \"ArrowRight\") !== rtl ? by : -by;\n else if (axis !== \"x\" && (event.key === \"ArrowUp\" || event.key === \"ArrowDown\"))\n delta = (event.key === \"ArrowUp\") !== downAdds ? by : -by;\n else if (!options.arrowsOnly) {\n if (event.key === \"PageUp\") delta = big;\n else if (event.key === \"PageDown\") delta = -big;\n else if (event.key === \"Home\") return min;\n else if (event.key === \"End\") return max;\n }\n return delta === undefined ? undefined : clamp(value + delta, min, max);\n}\n"],"mappings":";;AAOA,SAAgBC,EAAYC,GAAoD;AAC9E,QAAMC,IAAS,iBAAiBD,IAAQA,EAAM,cAAcA;AAC5D,SAAOC,EAAO,eAAeA,EAAO,YAAY;AAClD;AAuBA,SAAgBC,EACdF,GACAG,GACoB;AACpB,QAAM,EAAE,OAAAC,GAAO,KAAAC,GAAK,KAAAC,GAAK,MAAAC,GAAM,KAAAC,IAAMD,IAAO,IAAI,MAAAE,IAAO,QAAQ,KAAAC,IAAM,IAAO,UAAAC,IAAW,GAAA,IAAUR,GAC3FS,IAAKZ,EAAM,WAAWQ,IAAMD;AAClC,MAAIM;AACJ,MAAIJ,MAAS,QAAQT,EAAM,QAAQ,gBAAgBA,EAAM,QAAQ,aAC/D,CAAAa,IAASb,EAAM,QAAQ,iBAAkBU,IAAME,IAAK,CAACA;AAAA,WAC9CH,MAAS,QAAQT,EAAM,QAAQ,aAAaA,EAAM,QAAQ,aACjE,CAAAa,IAASb,EAAM,QAAQ,cAAeW,IAAWC,IAAK,CAACA;AAAA,WAChD,CAACT,EAAQ;AAChB,QAAIH,EAAM,QAAQ,SAAU,CAAAa,IAAQL;AAAA,aAC3BR,EAAM,QAAQ,WAAY,CAAAa,IAAQ,CAACL;AAAA,SACvC;AAAA,UAAIR,EAAM,QAAQ,OAAQ,QAAOK;AACjC,UAAIL,EAAM,QAAQ,MAAO,QAAOM;AAAA;AAEvC,SAAOO,MAAU,SAAY,SAAYf,EAAMM,IAAQS,GAAOR,GAAKC,CAAG;AACxE"}
1
+ {"version":3,"file":"keys.js","names":["clamp","isComposing","event","native","stepKey","options","value","min","max","step","big","axis","rtl","downAdds","by","delta"],"sources":["../../src/foundations/keys.ts"],"sourcesContent":["import type { KeyboardEvent as ReactKeyboardEvent } from \"react\";\nimport { clamp } from \"./math.js\";\n\n/**\n * True while an input method is composing (Chinese, Japanese, Korean…): the key belongs to the composition, not the\n * widget. Safari reports the composing Enter only as keyCode 229, so both are checked.\n */\nexport function isComposing(event: KeyboardEvent | ReactKeyboardEvent): boolean {\n const native = \"nativeEvent\" in event ? event.nativeEvent : event;\n return native.isComposing || native.keyCode === 229;\n}\n\nexport interface StepKeyOptions {\n value: number;\n min: number;\n max: number;\n step: number;\n /** Shift+arrows and Page Up/Down. Default `step × 10`. */\n big?: number;\n /** Which arrows move it: both pairs (a slider, default), only Left/Right, or only Up/Down. */\n axis?: \"both\" | \"x\" | \"y\";\n /** Right to left: Left adds and Right takes away. */\n rtl?: boolean;\n /** Down adds (a horizontal divider that grows the pane above it). Default: Up adds. */\n downAdds?: boolean;\n /** Only the arrows: no Page Up/Down, Home or End (one axis of a 2D area). */\n arrowsOnly?: boolean;\n}\n\n/**\n * The value a slider-style key moves to (WAI-ARIA APG slider), or undefined when the key does nothing: arrows ±step,\n * Shift+arrows and Page Up/Down ±big, Home and End to the ends. Clamped to min and max.\n */\nexport function stepKey(\n event: { key: string; shiftKey: boolean },\n options: StepKeyOptions,\n): number | undefined {\n const { value, min, max, step, big = step * 10, axis = \"both\", rtl = false, downAdds = false } = options;\n const by = event.shiftKey ? big : step;\n let delta: number | undefined;\n if (axis !== \"y\" && (event.key === \"ArrowRight\" || event.key === \"ArrowLeft\"))\n delta = (event.key === \"ArrowRight\") !== rtl ? by : -by;\n else if (axis !== \"x\" && (event.key === \"ArrowUp\" || event.key === \"ArrowDown\"))\n delta = (event.key === \"ArrowUp\") !== downAdds ? by : -by;\n else if (!options.arrowsOnly) {\n if (event.key === \"PageUp\") delta = big;\n else if (event.key === \"PageDown\") delta = -big;\n else if (event.key === \"Home\") return min;\n else if (event.key === \"End\") return max;\n }\n return delta === undefined ? undefined : clamp(value + delta, min, max);\n}\n"],"mappings":";AAOA,SAAgBC,EAAYC,GAAoD;AAC9E,QAAMC,IAAS,iBAAiBD,IAAQA,EAAM,cAAcA;AAC5D,SAAOC,EAAO,eAAeA,EAAO,YAAY;AAClD;AAuBA,SAAgBC,EACdF,GACAG,GACoB;AACpB,QAAM,EAAE,OAAAC,GAAO,KAAAC,GAAK,KAAAC,GAAK,MAAAC,GAAM,KAAAC,IAAMD,IAAO,IAAI,MAAAE,IAAO,QAAQ,KAAAC,IAAM,IAAO,UAAAC,IAAW,GAAA,IAAUR,GAC3FS,IAAKZ,EAAM,WAAWQ,IAAMD;AAClC,MAAIM;AACJ,MAAIJ,MAAS,QAAQT,EAAM,QAAQ,gBAAgBA,EAAM,QAAQ,aAC/D,CAAAa,IAASb,EAAM,QAAQ,iBAAkBU,IAAME,IAAK,CAACA;AAAA,WAC9CH,MAAS,QAAQT,EAAM,QAAQ,aAAaA,EAAM,QAAQ,aACjE,CAAAa,IAASb,EAAM,QAAQ,cAAeW,IAAWC,IAAK,CAACA;AAAA,WAChD,CAACT,EAAQ;AAChB,QAAIH,EAAM,QAAQ,SAAU,CAAAa,IAAQL;AAAA,aAC3BR,EAAM,QAAQ,WAAY,CAAAa,IAAQ,CAACL;AAAA,SACvC;AAAA,UAAIR,EAAM,QAAQ,OAAQ,QAAOK;AACjC,UAAIL,EAAM,QAAQ,MAAO,QAAOM;AAAA;AAEvC,SAAOO,MAAU,SAAY,SAAYf,EAAMM,IAAQS,GAAOR,GAAKC,CAAG;AACxE"}
@@ -0,0 +1,81 @@
1
+ import type { AriaAttributes, HTMLAttributes } from "react";
2
+ /** A step of the theme's space scale (`--cy-space-0` … `--cy-space-10`). */
3
+ export type Space = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10";
4
+ /** The padding props shared by the layout primitives (Stack, Inline, Grid). */
5
+ export interface PaddingProps {
6
+ /** Space token of padding on all four sides of the box. Default: none. */
7
+ padding?: Space | undefined;
8
+ /** Space token of padding at the inline start and end (left and right in English). Wins over `padding`. */
9
+ paddingInline?: Space | undefined;
10
+ /** Space token of padding at the block start and end (top and bottom in English). Wins over `padding`. */
11
+ paddingBlock?: Space | undefined;
12
+ }
13
+ /** The space token a key stands for, as a CSS value. */
14
+ export declare const space: (key: Space) => string;
15
+ /**
16
+ * The private custom properties the layout CSS reads its padding from, for the sides that are set. Sides that are
17
+ * not set are left out: the stylesheet resets them to zero on every root, so a nested layout never inherits them.
18
+ */
19
+ export declare function paddingVars({ padding, paddingInline, paddingBlock }: PaddingProps): Record<string, string>;
20
+ /**
21
+ * The named widths of the layout scale. Grid's per-breakpoint `columns` measure the grid's own width; `hideBelow` and
22
+ * `hideAbove` measure the window. A breakpoint applies from its width upwards. `base.css` and `grid.css` repeat these
23
+ * values (a media or container query cannot read a custom property): change them together.
24
+ */
25
+ export declare const BREAKPOINTS: {
26
+ readonly sm: "30rem";
27
+ readonly md: "45rem";
28
+ readonly lg: "60rem";
29
+ readonly xl: "75rem";
30
+ };
31
+ /** A named width of the layout scale (`BREAKPOINTS`). */
32
+ export type Breakpoint = keyof typeof BREAKPOINTS;
33
+ /** Attributes every layout primitive passes to its element: an id to link to, a role and ARIA attributes. */
34
+ export interface LayoutAttributes extends Pick<HTMLAttributes<HTMLElement>, "id" | "role">, AriaAttributes {
35
+ }
36
+ /** Showing or hiding a layout box by the width of the window, with no script. */
37
+ export interface VisibilityProps {
38
+ /** Hidden while the window is narrower than this breakpoint (`md`: below 45rem). */
39
+ hideBelow?: Breakpoint | undefined;
40
+ /** Hidden from this breakpoint upwards (`md`: 45rem and wider). */
41
+ hideAbove?: Breakpoint | undefined;
42
+ }
43
+ /** The data attributes `base.css` hides a box by. */
44
+ export declare const visibilityAttrs: ({ hideBelow, hideAbove }: VisibilityProps) => {
45
+ "data-cy-hide-below": "sm" | "md" | "lg" | "xl" | undefined;
46
+ "data-cy-hide-above": "sm" | "md" | "lg" | "xl" | undefined;
47
+ };
48
+ /** How a layout box scrolls or clips what does not fit in it. */
49
+ export type BoxOverflow = "hidden" | "auto" | "visible";
50
+ /**
51
+ * How a layout box sizes itself inside its parent, for app shells (a body that takes the rest of a column and
52
+ * scrolls, a status bar item pushed to the end). `grow` and `shrink` act in a flex parent (Stack, Inline, a flex
53
+ * element); `fill` and `minSize` in any parent.
54
+ */
55
+ export interface BoxProps {
56
+ /** Take the free space along the parent's row or column (`flex-grow: 1`), pushing the boxes after it to the end. */
57
+ grow?: boolean | undefined;
58
+ /** `false` keeps the box at its own size when the parent's row or column runs out of room. Default true. */
59
+ shrink?: boolean | undefined;
60
+ /** As wide and as tall as the parent's content box (`100%` both ways). */
61
+ fill?: boolean | undefined;
62
+ /**
63
+ * `"0"` lets the box be smaller than its content, so a child can scroll instead of overflowing the page. A flex or
64
+ * grid child is otherwise at least as tall (and wide) as what it holds. Default: the CSS automatic minimum.
65
+ */
66
+ minSize?: "0" | undefined;
67
+ /**
68
+ * What happens to content that does not fit: `hidden` clips it, `auto` scrolls it, `visible` lets it overflow (the
69
+ * default). A box that scrolls content with nothing focusable in it should be a ScrollArea with a `label`, so
70
+ * keyboard users can scroll it.
71
+ */
72
+ overflow?: BoxOverflow | undefined;
73
+ }
74
+ /** The data attributes `base.css` sizes a box by. Unset props add nothing. */
75
+ export declare const boxAttrs: ({ grow, shrink, fill, minSize, overflow }: BoxProps) => {
76
+ "data-cy-grow": string | undefined;
77
+ "data-cy-shrink": string | undefined;
78
+ "data-cy-fill": string | undefined;
79
+ "data-cy-min-size": string | undefined;
80
+ "data-cy-overflow": BoxOverflow | undefined;
81
+ };
@@ -0,0 +1,29 @@
1
+ var t = (a) => `var(--cy-space-${a})`;
2
+ function s({ padding: a, paddingInline: r = a, paddingBlock: i = a }) {
3
+ const e = {};
4
+ return r && (e["--_pad-inline"] = t(r)), i && (e["--_pad-block"] = t(i)), e;
5
+ }
6
+ var v = {
7
+ sm: "30rem",
8
+ md: "45rem",
9
+ lg: "60rem",
10
+ xl: "75rem"
11
+ }, c = ({ hideBelow: a, hideAbove: r }) => ({
12
+ "data-cy-hide-below": a,
13
+ "data-cy-hide-above": r
14
+ }), d = ({ grow: a, shrink: r, fill: i, minSize: e, overflow: o }) => ({
15
+ "data-cy-grow": a ? "" : void 0,
16
+ "data-cy-shrink": r === !1 ? "false" : void 0,
17
+ "data-cy-fill": i ? "" : void 0,
18
+ "data-cy-min-size": e === "0" ? "0" : void 0,
19
+ "data-cy-overflow": o
20
+ });
21
+ export {
22
+ v as BREAKPOINTS,
23
+ d as boxAttrs,
24
+ s as paddingVars,
25
+ t as space,
26
+ c as visibilityAttrs
27
+ };
28
+
29
+ //# sourceMappingURL=layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.js","names":["space","key","paddingVars","padding","paddingInline","paddingBlock","vars","BREAKPOINTS","visibilityAttrs","hideBelow","hideAbove","boxAttrs","grow","shrink","fill","minSize","overflow"],"sources":["../../src/foundations/layout.ts"],"sourcesContent":["import type { AriaAttributes, HTMLAttributes } from \"react\";\n\n/** A step of the theme's space scale (`--cy-space-0` … `--cy-space-10`). */\nexport type Space = \"0\" | \"1\" | \"2\" | \"3\" | \"4\" | \"5\" | \"6\" | \"7\" | \"8\" | \"9\" | \"10\";\n\n/** The padding props shared by the layout primitives (Stack, Inline, Grid). */\nexport interface PaddingProps {\n /** Space token of padding on all four sides of the box. Default: none. */\n padding?: Space | undefined;\n /** Space token of padding at the inline start and end (left and right in English). Wins over `padding`. */\n paddingInline?: Space | undefined;\n /** Space token of padding at the block start and end (top and bottom in English). Wins over `padding`. */\n paddingBlock?: Space | undefined;\n}\n\n/** The space token a key stands for, as a CSS value. */\nexport const space = (key: Space) => `var(--cy-space-${key})`;\n\n/**\n * The private custom properties the layout CSS reads its padding from, for the sides that are set. Sides that are\n * not set are left out: the stylesheet resets them to zero on every root, so a nested layout never inherits them.\n */\nexport function paddingVars({ padding, paddingInline = padding, paddingBlock = padding }: PaddingProps) {\n const vars: Record<string, string> = {};\n if (paddingInline) vars[\"--_pad-inline\"] = space(paddingInline);\n if (paddingBlock) vars[\"--_pad-block\"] = space(paddingBlock);\n return vars;\n}\n\n/**\n * The named widths of the layout scale. Grid's per-breakpoint `columns` measure the grid's own width; `hideBelow` and\n * `hideAbove` measure the window. A breakpoint applies from its width upwards. `base.css` and `grid.css` repeat these\n * values (a media or container query cannot read a custom property): change them together.\n */\nexport const BREAKPOINTS = { sm: \"30rem\", md: \"45rem\", lg: \"60rem\", xl: \"75rem\" } as const;\n\n/** A named width of the layout scale (`BREAKPOINTS`). */\nexport type Breakpoint = keyof typeof BREAKPOINTS;\n\n/** Attributes every layout primitive passes to its element: an id to link to, a role and ARIA attributes. */\nexport interface LayoutAttributes extends Pick<HTMLAttributes<HTMLElement>, \"id\" | \"role\">, AriaAttributes {}\n\n/** Showing or hiding a layout box by the width of the window, with no script. */\nexport interface VisibilityProps {\n /** Hidden while the window is narrower than this breakpoint (`md`: below 45rem). */\n hideBelow?: Breakpoint | undefined;\n /** Hidden from this breakpoint upwards (`md`: 45rem and wider). */\n hideAbove?: Breakpoint | undefined;\n}\n\n/** The data attributes `base.css` hides a box by. */\nexport const visibilityAttrs = ({ hideBelow, hideAbove }: VisibilityProps) => ({\n \"data-cy-hide-below\": hideBelow,\n \"data-cy-hide-above\": hideAbove,\n});\n\n/** How a layout box scrolls or clips what does not fit in it. */\nexport type BoxOverflow = \"hidden\" | \"auto\" | \"visible\";\n\n/**\n * How a layout box sizes itself inside its parent, for app shells (a body that takes the rest of a column and\n * scrolls, a status bar item pushed to the end). `grow` and `shrink` act in a flex parent (Stack, Inline, a flex\n * element); `fill` and `minSize` in any parent.\n */\nexport interface BoxProps {\n /** Take the free space along the parent's row or column (`flex-grow: 1`), pushing the boxes after it to the end. */\n grow?: boolean | undefined;\n /** `false` keeps the box at its own size when the parent's row or column runs out of room. Default true. */\n shrink?: boolean | undefined;\n /** As wide and as tall as the parent's content box (`100%` both ways). */\n fill?: boolean | undefined;\n /**\n * `\"0\"` lets the box be smaller than its content, so a child can scroll instead of overflowing the page. A flex or\n * grid child is otherwise at least as tall (and wide) as what it holds. Default: the CSS automatic minimum.\n */\n minSize?: \"0\" | undefined;\n /**\n * What happens to content that does not fit: `hidden` clips it, `auto` scrolls it, `visible` lets it overflow (the\n * default). A box that scrolls content with nothing focusable in it should be a ScrollArea with a `label`, so\n * keyboard users can scroll it.\n */\n overflow?: BoxOverflow | undefined;\n}\n\n/** The data attributes `base.css` sizes a box by. Unset props add nothing. */\nexport const boxAttrs = ({ grow, shrink, fill, minSize, overflow }: BoxProps) => ({\n \"data-cy-grow\": grow ? \"\" : undefined,\n \"data-cy-shrink\": shrink === false ? \"false\" : undefined,\n \"data-cy-fill\": fill ? \"\" : undefined,\n \"data-cy-min-size\": minSize === \"0\" ? \"0\" : undefined,\n \"data-cy-overflow\": overflow,\n});\n"],"mappings":"AAgBA,IAAaA,IAAA,CAASC,MAAe,kBAAkBA,CAAA;AAMvD,SAAgBC,EAAY,EAAE,SAAAC,GAAS,eAAAC,IAAgBD,GAAS,cAAAE,IAAeF,EAAA,GAAyB;AACtG,QAAMG,IAA+B,CAAC;AACtC,SAAIF,MAAeE,EAAK,eAAA,IAAmBN,EAAMI,CAAa,IAC1DC,MAAcC,EAAK,cAAA,IAAkBN,EAAMK,CAAY,IACpDC;AACT;AAOA,IAAaC,IAAc;AAAA,EAAE,IAAI;AAAA,EAAS,IAAI;AAAA,EAAS,IAAI;AAAA,EAAS,IAAI;AAAQ,GAiBnEC,IAAA,CAAmB,EAAE,WAAAC,GAAW,WAAAC,EAAA,OAAkC;AAAA,EAC7E,sBAAsBD;AAAA,EACtB,sBAAsBC;AACxB,IA+BaC,IAAA,CAAY,EAAE,MAAAC,GAAM,QAAAC,GAAQ,MAAAC,GAAM,SAAAC,GAAS,UAAAC,EAAA,OAA0B;AAAA,EAChF,gBAAgBJ,IAAO,KAAK;AAAA,EAC5B,kBAAkBC,MAAW,KAAQ,UAAU;AAAA,EAC/C,gBAAgBC,IAAO,KAAK;AAAA,EAC5B,oBAAoBC,MAAY,MAAM,MAAM;AAAA,EAC5C,oBAAoBC;AACtB"}