@arshad-shah/cynosure 0.2.0 → 0.4.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 (441) hide show
  1. package/README.md +5 -5
  2. package/dist/adapters/astro/index.d.ts +52 -0
  3. package/dist/adapters/astro/index.js +27 -0
  4. package/dist/adapters/astro/index.js.map +1 -0
  5. package/dist/adapters/vite/index.d.ts +11 -0
  6. package/dist/adapters/vite/index.js +33 -12
  7. package/dist/adapters/vite/index.js.map +1 -1
  8. package/dist/brands/googleplay.d.ts +2 -0
  9. package/dist/brands/googleplay.js +17 -0
  10. package/dist/brands/googleplay.js.map +1 -0
  11. package/dist/brands/index.d.ts +1 -0
  12. package/dist/brands/index.js +132 -130
  13. package/dist/components/Accordion/Accordion.d.ts +14 -0
  14. package/dist/components/Accordion/Accordion.js.map +1 -1
  15. package/dist/components/Announcer/Announcer.d.ts +1 -0
  16. package/dist/components/Announcer/Announcer.js +5 -5
  17. package/dist/components/Announcer/Announcer.js.map +1 -1
  18. package/dist/components/AppShell/AppShell.d.ts +22 -1
  19. package/dist/components/AppShell/AppShell.js +92 -83
  20. package/dist/components/AppShell/AppShell.js.map +1 -1
  21. package/dist/components/AppShell/index.d.ts +1 -1
  22. package/dist/components/AspectRatio/AspectRatio.d.ts +29 -0
  23. package/dist/components/AspectRatio/AspectRatio.js +21 -0
  24. package/dist/components/AspectRatio/AspectRatio.js.map +1 -0
  25. package/dist/components/AspectRatio/index.d.ts +1 -0
  26. package/dist/components/Avatar/Avatar.d.ts +96 -0
  27. package/dist/components/Avatar/Avatar.js +90 -0
  28. package/dist/components/Avatar/Avatar.js.map +1 -0
  29. package/dist/components/Avatar/index.d.ts +1 -0
  30. package/dist/components/Badge/Badge.d.ts +6 -0
  31. package/dist/components/Badge/Badge.js.map +1 -1
  32. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +55 -0
  33. package/dist/components/Breadcrumbs/Breadcrumbs.js +85 -0
  34. package/dist/components/Breadcrumbs/Breadcrumbs.js.map +1 -0
  35. package/dist/components/Breadcrumbs/index.d.ts +1 -0
  36. package/dist/components/Button/Button.d.ts +27 -2
  37. package/dist/components/Button/Button.js +62 -53
  38. package/dist/components/Button/Button.js.map +1 -1
  39. package/dist/components/Calendar/Calendar.d.ts +65 -7
  40. package/dist/components/Calendar/Calendar.js +209 -97
  41. package/dist/components/Calendar/Calendar.js.map +1 -1
  42. package/dist/components/Calendar/dates.d.ts +4 -0
  43. package/dist/components/Calendar/dates.js +41 -27
  44. package/dist/components/Calendar/dates.js.map +1 -1
  45. package/dist/components/Calendar/index.d.ts +1 -1
  46. package/dist/components/Card/Card.d.ts +35 -1
  47. package/dist/components/Card/Card.js +48 -36
  48. package/dist/components/Card/Card.js.map +1 -1
  49. package/dist/components/Card/index.d.ts +1 -1
  50. package/dist/components/Checkbox/Checkbox.d.ts +11 -4
  51. package/dist/components/Checkbox/Checkbox.js +33 -7
  52. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  53. package/dist/components/Checklist/Checklist.d.ts +65 -0
  54. package/dist/components/Checklist/Checklist.js +163 -0
  55. package/dist/components/Checklist/Checklist.js.map +1 -0
  56. package/dist/components/Checklist/index.d.ts +1 -0
  57. package/dist/components/Choice/Choice.d.ts +73 -0
  58. package/dist/components/Choice/Choice.js +41 -0
  59. package/dist/components/Choice/Choice.js.map +1 -0
  60. package/dist/components/Choice/index.d.ts +1 -0
  61. package/dist/components/CodeBlock/CodeBlock.d.ts +5 -0
  62. package/dist/components/CodeBlock/CodeBlock.js.map +1 -1
  63. package/dist/components/ColorField/ColorField.d.ts +12 -0
  64. package/dist/components/ColorField/ColorField.js +199 -208
  65. package/dist/components/ColorField/ColorField.js.map +1 -1
  66. package/dist/components/ColorSwatches/ColorSwatches.d.ts +5 -0
  67. package/dist/components/ColorSwatches/ColorSwatches.js +6 -6
  68. package/dist/components/ColorSwatches/ColorSwatches.js.map +1 -1
  69. package/dist/components/Combobox/Combobox.d.ts +20 -1
  70. package/dist/components/Combobox/Combobox.js +86 -111
  71. package/dist/components/Combobox/Combobox.js.map +1 -1
  72. package/dist/components/CommandPalette/CommandPalette.d.ts +9 -0
  73. package/dist/components/CommandPalette/CommandPalette.js +10 -10
  74. package/dist/components/CommandPalette/CommandPalette.js.map +1 -1
  75. package/dist/components/CompareSlider/CompareSlider.d.ts +4 -0
  76. package/dist/components/CompareSlider/CompareSlider.js +4 -4
  77. package/dist/components/CompareSlider/CompareSlider.js.map +1 -1
  78. package/dist/components/Container/Container.d.ts +44 -0
  79. package/dist/components/Container/Container.js +28 -0
  80. package/dist/components/Container/Container.js.map +1 -0
  81. package/dist/components/Container/index.d.ts +1 -0
  82. package/dist/components/ContextMenu/ContextMenu.d.ts +11 -0
  83. package/dist/components/ContextMenu/ContextMenu.js.map +1 -1
  84. package/dist/components/CopyButton/CopyButton.d.ts +8 -0
  85. package/dist/components/CopyButton/CopyButton.js +29 -28
  86. package/dist/components/CopyButton/CopyButton.js.map +1 -1
  87. package/dist/components/DateField/DateField.d.ts +17 -0
  88. package/dist/components/DateField/DateField.js +6 -6
  89. package/dist/components/DateField/DateField.js.map +1 -1
  90. package/dist/components/DescriptionList/DescriptionList.d.ts +3 -0
  91. package/dist/components/DescriptionList/DescriptionList.js.map +1 -1
  92. package/dist/components/DeviceFrame/DeviceFrame.d.ts +63 -0
  93. package/dist/components/DeviceFrame/DeviceFrame.js +54 -0
  94. package/dist/components/DeviceFrame/DeviceFrame.js.map +1 -0
  95. package/dist/components/DeviceFrame/index.d.ts +1 -0
  96. package/dist/components/Dialog/Dialog.d.ts +25 -2
  97. package/dist/components/Dialog/Dialog.js +89 -72
  98. package/dist/components/Dialog/Dialog.js.map +1 -1
  99. package/dist/components/Disclosure/Disclosure.d.ts +7 -0
  100. package/dist/components/Disclosure/Disclosure.js.map +1 -1
  101. package/dist/components/Divider/Divider.d.ts +59 -0
  102. package/dist/components/Divider/Divider.js +32 -0
  103. package/dist/components/Divider/Divider.js.map +1 -0
  104. package/dist/components/Divider/index.d.ts +1 -0
  105. package/dist/components/DocumentViewport/DocumentViewport.d.ts +8 -0
  106. package/dist/components/DocumentViewport/DocumentViewport.js.map +1 -1
  107. package/dist/components/EmptyState/EmptyState.d.ts +8 -2
  108. package/dist/components/EmptyState/EmptyState.js.map +1 -1
  109. package/dist/components/Field/Field.d.ts +6 -0
  110. package/dist/components/Field/Field.js +31 -33
  111. package/dist/components/Field/Field.js.map +1 -1
  112. package/dist/components/FileDrop/FileDrop.d.ts +8 -0
  113. package/dist/components/FileDrop/FileDrop.js +14 -14
  114. package/dist/components/FileDrop/FileDrop.js.map +1 -1
  115. package/dist/components/FloatingToolbar/FloatingToolbar.d.ts +4 -0
  116. package/dist/components/FloatingToolbar/FloatingToolbar.js +11 -10
  117. package/dist/components/FloatingToolbar/FloatingToolbar.js.map +1 -1
  118. package/dist/components/Grid/Grid.d.ts +57 -10
  119. package/dist/components/Grid/Grid.js +71 -28
  120. package/dist/components/Grid/Grid.js.map +1 -1
  121. package/dist/components/Grid/index.d.ts +1 -1
  122. package/dist/components/Heading/Heading.d.ts +59 -0
  123. package/dist/components/Heading/Heading.js +33 -0
  124. package/dist/components/Heading/Heading.js.map +1 -0
  125. package/dist/components/Heading/index.d.ts +1 -0
  126. package/dist/components/HoverCard/HoverCard.d.ts +1 -0
  127. package/dist/components/HoverCard/HoverCard.js.map +1 -1
  128. package/dist/components/IconButton/IconButton.d.ts +17 -1
  129. package/dist/components/IconButton/IconButton.js +14 -10
  130. package/dist/components/IconButton/IconButton.js.map +1 -1
  131. package/dist/components/IconTile/IconTile.d.ts +45 -0
  132. package/dist/components/IconTile/IconTile.js +25 -0
  133. package/dist/components/IconTile/IconTile.js.map +1 -0
  134. package/dist/components/IconTile/index.d.ts +1 -0
  135. package/dist/components/Image/Image.d.ts +62 -0
  136. package/dist/components/Image/Image.js +75 -0
  137. package/dist/components/Image/Image.js.map +1 -0
  138. package/dist/components/Image/index.d.ts +1 -0
  139. package/dist/components/Inline/Inline.d.ts +8 -4
  140. package/dist/components/Inline/Inline.js +12 -16
  141. package/dist/components/Inline/Inline.js.map +1 -1
  142. package/dist/components/Kbd/Kbd.d.ts +2 -0
  143. package/dist/components/Kbd/Kbd.js.map +1 -1
  144. package/dist/components/KeyValueEditor/KeyValueEditor.d.ts +7 -0
  145. package/dist/components/KeyValueEditor/KeyValueEditor.js +43 -42
  146. package/dist/components/KeyValueEditor/KeyValueEditor.js.map +1 -1
  147. package/dist/components/Link/Link.d.ts +16 -1
  148. package/dist/components/Link/Link.js +20 -18
  149. package/dist/components/Link/Link.js.map +1 -1
  150. package/dist/components/List/List.d.ts +73 -0
  151. package/dist/components/List/List.js +64 -0
  152. package/dist/components/List/List.js.map +1 -0
  153. package/dist/components/List/index.d.ts +1 -0
  154. package/dist/components/LoadingDots/LoadingDots.d.ts +2 -0
  155. package/dist/components/LoadingDots/LoadingDots.js.map +1 -1
  156. package/dist/components/Menu/Menu.d.ts +13 -1
  157. package/dist/components/Menu/Menu.js +37 -35
  158. package/dist/components/Menu/Menu.js.map +1 -1
  159. package/dist/components/Notice/Notice.d.ts +5 -0
  160. package/dist/components/Notice/Notice.js +12 -11
  161. package/dist/components/Notice/Notice.js.map +1 -1
  162. package/dist/components/NumberField/NumberField.d.ts +17 -0
  163. package/dist/components/NumberField/NumberField.js +8 -8
  164. package/dist/components/NumberField/NumberField.js.map +1 -1
  165. package/dist/components/OptionList/OptionList.d.ts +69 -0
  166. package/dist/components/OptionList/OptionList.js +75 -0
  167. package/dist/components/OptionList/OptionList.js.map +1 -0
  168. package/dist/components/OptionList/index.d.ts +1 -0
  169. package/dist/components/PageHeader/PageHeader.d.ts +67 -0
  170. package/dist/components/PageHeader/PageHeader.js +63 -0
  171. package/dist/components/PageHeader/PageHeader.js.map +1 -0
  172. package/dist/components/PageHeader/index.d.ts +1 -0
  173. package/dist/components/Pagination/Pagination.d.ts +77 -0
  174. package/dist/components/Pagination/Pagination.js +121 -0
  175. package/dist/components/Pagination/Pagination.js.map +1 -0
  176. package/dist/components/Pagination/index.d.ts +1 -0
  177. package/dist/components/PanZoomCanvas/PanZoomCanvas.d.ts +4 -0
  178. package/dist/components/PanZoomCanvas/PanZoomCanvas.js.map +1 -1
  179. package/dist/components/Popover/Popover.d.ts +10 -0
  180. package/dist/components/Popover/Popover.js.map +1 -1
  181. package/dist/components/ProgressBar/ProgressBar.d.ts +5 -0
  182. package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
  183. package/dist/components/ProgressOverlay/ProgressOverlay.d.ts +3 -0
  184. package/dist/components/ProgressOverlay/ProgressOverlay.js.map +1 -1
  185. package/dist/components/Prose/Prose.d.ts +1 -0
  186. package/dist/components/Prose/Prose.js.map +1 -1
  187. package/dist/components/QRCode/QRCode.d.ts +56 -0
  188. package/dist/components/QRCode/QRCode.js +48 -0
  189. package/dist/components/QRCode/QRCode.js.map +1 -0
  190. package/dist/components/QRCode/index.d.ts +1 -0
  191. package/dist/components/RadioGroup/RadioGroup.d.ts +13 -0
  192. package/dist/components/RadioGroup/RadioGroup.js +32 -24
  193. package/dist/components/RadioGroup/RadioGroup.js.map +1 -1
  194. package/dist/components/Section/Section.d.ts +57 -0
  195. package/dist/components/Section/Section.js +27 -0
  196. package/dist/components/Section/Section.js.map +1 -0
  197. package/dist/components/Section/index.d.ts +1 -0
  198. package/dist/components/SegmentedControl/SegmentedControl.d.ts +9 -0
  199. package/dist/components/SegmentedControl/SegmentedControl.js +12 -12
  200. package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
  201. package/dist/components/Select/Select.d.ts +18 -1
  202. package/dist/components/Select/Select.js +107 -125
  203. package/dist/components/Select/Select.js.map +1 -1
  204. package/dist/components/Select/index.d.ts +1 -0
  205. package/dist/components/SelectionFrame/SelectionFrame.d.ts +6 -0
  206. package/dist/components/SelectionFrame/SelectionFrame.js.map +1 -1
  207. package/dist/components/Sheet/Sheet.js +12 -7
  208. package/dist/components/Sheet/Sheet.js.map +1 -1
  209. package/dist/components/SideNav/SideNav.d.ts +37 -1
  210. package/dist/components/SideNav/SideNav.js +103 -74
  211. package/dist/components/SideNav/SideNav.js.map +1 -1
  212. package/dist/components/SideNav/index.d.ts +1 -1
  213. package/dist/components/SignaturePad/SignaturePad.d.ts +3 -0
  214. package/dist/components/SignaturePad/SignaturePad.js.map +1 -1
  215. package/dist/components/SiteFooter/SiteFooter.d.ts +66 -0
  216. package/dist/components/SiteFooter/SiteFooter.js +80 -0
  217. package/dist/components/SiteFooter/SiteFooter.js.map +1 -0
  218. package/dist/components/SiteFooter/index.d.ts +1 -0
  219. package/dist/components/SiteHeader/SiteHeader.d.ts +78 -0
  220. package/dist/components/SiteHeader/SiteHeader.js +114 -0
  221. package/dist/components/SiteHeader/SiteHeader.js.map +1 -0
  222. package/dist/components/SiteHeader/index.d.ts +1 -0
  223. package/dist/components/Skeleton/Skeleton.d.ts +1 -0
  224. package/dist/components/Skeleton/Skeleton.js.map +1 -1
  225. package/dist/components/SkipLink/SkipLink.d.ts +42 -0
  226. package/dist/components/SkipLink/SkipLink.js +43 -0
  227. package/dist/components/SkipLink/SkipLink.js.map +1 -0
  228. package/dist/components/SkipLink/index.d.ts +1 -0
  229. package/dist/components/Slider/Slider.d.ts +11 -0
  230. package/dist/components/Slider/Slider.js +6 -6
  231. package/dist/components/Slider/Slider.js.map +1 -1
  232. package/dist/components/SortableList/SortableList.d.ts +6 -0
  233. package/dist/components/SortableList/SortableList.js +13 -13
  234. package/dist/components/SortableList/SortableList.js.map +1 -1
  235. package/dist/components/SplitPane/SplitPane.d.ts +5 -0
  236. package/dist/components/SplitPane/SplitPane.js +4 -4
  237. package/dist/components/SplitPane/SplitPane.js.map +1 -1
  238. package/dist/components/Stack/Stack.d.ts +19 -6
  239. package/dist/components/Stack/Stack.js +26 -13
  240. package/dist/components/Stack/Stack.js.map +1 -1
  241. package/dist/components/Stack/index.d.ts +1 -0
  242. package/dist/components/Stack/space.d.ts +47 -0
  243. package/dist/components/Stack/space.js +23 -0
  244. package/dist/components/Stack/space.js.map +1 -0
  245. package/dist/components/Stat/Stat.d.ts +88 -0
  246. package/dist/components/Stat/Stat.js +105 -0
  247. package/dist/components/Stat/Stat.js.map +1 -0
  248. package/dist/components/Stat/index.d.ts +1 -0
  249. package/dist/components/Steps/Steps.d.ts +14 -4
  250. package/dist/components/Steps/Steps.js +31 -30
  251. package/dist/components/Steps/Steps.js.map +1 -1
  252. package/dist/components/Switch/Switch.d.ts +4 -4
  253. package/dist/components/Switch/Switch.js +18 -7
  254. package/dist/components/Switch/Switch.js.map +1 -1
  255. package/dist/components/Table/Table.d.ts +12 -0
  256. package/dist/components/Table/Table.js +11 -12
  257. package/dist/components/Table/Table.js.map +1 -1
  258. package/dist/components/Tabs/Tabs.d.ts +18 -1
  259. package/dist/components/Tabs/Tabs.js +74 -73
  260. package/dist/components/Tabs/Tabs.js.map +1 -1
  261. package/dist/components/TagInput/TagInput.d.ts +18 -0
  262. package/dist/components/TagInput/TagInput.js +79 -100
  263. package/dist/components/TagInput/TagInput.js.map +1 -1
  264. package/dist/components/Text/Text.d.ts +72 -0
  265. package/dist/components/Text/Text.js +30 -0
  266. package/dist/components/Text/Text.js.map +1 -0
  267. package/dist/components/Text/index.d.ts +1 -0
  268. package/dist/components/TextArea/TextArea.d.ts +10 -0
  269. package/dist/components/TextArea/TextArea.js +4 -4
  270. package/dist/components/TextArea/TextArea.js.map +1 -1
  271. package/dist/components/TextField/TextField.d.ts +17 -0
  272. package/dist/components/TextField/TextField.js +28 -27
  273. package/dist/components/TextField/TextField.js.map +1 -1
  274. package/dist/components/ThemeToggle/ThemeToggle.d.ts +11 -1
  275. package/dist/components/ThemeToggle/ThemeToggle.js +33 -30
  276. package/dist/components/ThemeToggle/ThemeToggle.js.map +1 -1
  277. package/dist/components/TimeField/TimeField.d.ts +62 -8
  278. package/dist/components/TimeField/TimeField.js +308 -72
  279. package/dist/components/TimeField/TimeField.js.map +1 -1
  280. package/dist/components/Toast/Toast.d.ts +25 -1
  281. package/dist/components/Toast/Toast.js +137 -126
  282. package/dist/components/Toast/Toast.js.map +1 -1
  283. package/dist/components/Toast/index.d.ts +1 -1
  284. package/dist/components/Toolbar/Toolbar.d.ts +3 -0
  285. package/dist/components/Toolbar/Toolbar.js.map +1 -1
  286. package/dist/components/Tooltip/Tooltip.d.ts +7 -1
  287. package/dist/components/Tooltip/Tooltip.js +19 -19
  288. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  289. package/dist/components/Tree/Tree.d.ts +8 -0
  290. package/dist/components/Tree/Tree.js.map +1 -1
  291. package/dist/components/VirtualList/VirtualList.d.ts +8 -0
  292. package/dist/components/VirtualList/VirtualList.js +4 -4
  293. package/dist/components/VirtualList/VirtualList.js.map +1 -1
  294. package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +24 -0
  295. package/dist/components/VisuallyHidden/VisuallyHidden.js +17 -0
  296. package/dist/components/VisuallyHidden/VisuallyHidden.js.map +1 -0
  297. package/dist/components/VisuallyHidden/index.d.ts +1 -0
  298. package/dist/components/ZoomControls/ZoomControls.d.ts +4 -0
  299. package/dist/components/ZoomControls/ZoomControls.js.map +1 -1
  300. package/dist/foundations/ChoiceBase/ChoiceBase.d.ts +1 -0
  301. package/dist/foundations/ChoiceBase/ChoiceBase.js +8 -8
  302. package/dist/foundations/ChoiceBase/ChoiceBase.js.map +1 -1
  303. package/dist/foundations/HiddenValue/HiddenValue.d.ts +3 -0
  304. package/dist/foundations/HiddenValue/HiddenValue.js +5 -5
  305. package/dist/foundations/HiddenValue/HiddenValue.js.map +1 -1
  306. package/dist/foundations/Icon/Icon.d.ts +9 -1
  307. package/dist/foundations/Icon/Icon.js +15 -14
  308. package/dist/foundations/Icon/Icon.js.map +1 -1
  309. package/dist/foundations/image-outcome.d.ts +20 -0
  310. package/dist/foundations/image-outcome.js +43 -0
  311. package/dist/foundations/image-outcome.js.map +1 -0
  312. package/dist/foundations/option-icon.d.ts +26 -0
  313. package/dist/foundations/option-icon.js +16 -0
  314. package/dist/foundations/option-icon.js.map +1 -0
  315. package/dist/foundations/printing.d.ts +6 -0
  316. package/dist/foundations/printing.js +17 -0
  317. package/dist/foundations/printing.js.map +1 -0
  318. package/dist/foundations/qr.d.ts +42 -0
  319. package/dist/foundations/qr.js +246 -0
  320. package/dist/foundations/qr.js.map +1 -0
  321. package/dist/icons/book-marked.d.ts +2 -0
  322. package/dist/icons/book-marked.js +14 -0
  323. package/dist/icons/book-marked.js.map +1 -0
  324. package/dist/icons/calendar-days.d.ts +2 -0
  325. package/dist/icons/calendar-days.js +24 -0
  326. package/dist/icons/calendar-days.js.map +1 -0
  327. package/dist/icons/check-square.d.ts +2 -0
  328. package/dist/icons/check-square.js +14 -0
  329. package/dist/icons/check-square.js.map +1 -0
  330. package/dist/icons/crescent.d.ts +2 -0
  331. package/dist/icons/crescent.js +14 -0
  332. package/dist/icons/crescent.js.map +1 -0
  333. package/dist/icons/index.d.ts +11 -0
  334. package/dist/icons/index.js +502 -480
  335. package/dist/icons/kaaba.d.ts +2 -0
  336. package/dist/icons/kaaba.js +14 -0
  337. package/dist/icons/kaaba.js.map +1 -0
  338. package/dist/icons/keywords.d.ts +259 -0
  339. package/dist/icons/keywords.js +1816 -0
  340. package/dist/icons/keywords.js.map +1 -0
  341. package/dist/icons/list-tree.d.ts +2 -0
  342. package/dist/icons/list-tree.js +14 -0
  343. package/dist/icons/list-tree.js.map +1 -0
  344. package/dist/icons/mosque.d.ts +2 -0
  345. package/dist/icons/mosque.js +14 -0
  346. package/dist/icons/mosque.js.map +1 -0
  347. package/dist/icons/prayer-beads.d.ts +2 -0
  348. package/dist/icons/prayer-beads.js +67 -0
  349. package/dist/icons/prayer-beads.js.map +1 -0
  350. package/dist/icons/qr-code.d.ts +2 -0
  351. package/dist/icons/qr-code.js +38 -0
  352. package/dist/icons/qr-code.js.map +1 -0
  353. package/dist/icons/refresh-cw.d.ts +2 -0
  354. package/dist/icons/refresh-cw.js +14 -0
  355. package/dist/icons/refresh-cw.js.map +1 -0
  356. package/dist/icons/types.d.ts +1 -1
  357. package/dist/icons/types.js +2 -1
  358. package/dist/icons/types.js.map +1 -1
  359. package/dist/index.d.ts +35 -10
  360. package/dist/index.js +280 -220
  361. package/dist/styles/announcer.css +1 -1
  362. package/dist/styles/app-shell.css +1 -1
  363. package/dist/styles/aspect-ratio.css +1 -0
  364. package/dist/styles/avatar.css +1 -0
  365. package/dist/styles/base.css +1 -1
  366. package/dist/styles/breadcrumbs.css +1 -0
  367. package/dist/styles/button.css +1 -1
  368. package/dist/styles/calendar.css +1 -1
  369. package/dist/styles/card.css +1 -1
  370. package/dist/styles/checkbox.css +1 -1
  371. package/dist/styles/checklist.css +1 -0
  372. package/dist/styles/choice-base.css +1 -0
  373. package/dist/styles/choice.css +1 -1
  374. package/dist/styles/color-field.css +1 -1
  375. package/dist/styles/combobox.css +1 -1
  376. package/dist/styles/container.css +1 -0
  377. package/dist/styles/copy-button.css +1 -1
  378. package/dist/styles/date-field.css +1 -1
  379. package/dist/styles/device-frame.css +1 -0
  380. package/dist/styles/dialog.css +1 -1
  381. package/dist/styles/disclosure.css +1 -1
  382. package/dist/styles/divider.css +1 -0
  383. package/dist/styles/field.css +1 -1
  384. package/dist/styles/file-drop.css +1 -1
  385. package/dist/styles/floating-toolbar.css +1 -1
  386. package/dist/styles/generated-css.d.ts +1 -1
  387. package/dist/styles/generated-css.js +1 -1
  388. package/dist/styles/generated-css.js.map +1 -1
  389. package/dist/styles/grid.css +1 -1
  390. package/dist/styles/heading.css +1 -0
  391. package/dist/styles/icon-tile.css +1 -0
  392. package/dist/styles/icon.css +1 -1
  393. package/dist/styles/image.css +1 -0
  394. package/dist/styles/inline.css +1 -0
  395. package/dist/styles/key-value-editor.css +1 -1
  396. package/dist/styles/link.css +1 -1
  397. package/dist/styles/list.css +1 -0
  398. package/dist/styles/manifest.json +715 -0
  399. package/dist/styles/menu.css +1 -1
  400. package/dist/styles/notice.css +1 -1
  401. package/dist/styles/number-field.css +1 -1
  402. package/dist/styles/option-list.css +1 -0
  403. package/dist/styles/page-header.css +1 -0
  404. package/dist/styles/pagination.css +1 -0
  405. package/dist/styles/qr-code.css +1 -0
  406. package/dist/styles/radio-group.css +1 -1
  407. package/dist/styles/section.css +1 -0
  408. package/dist/styles/segmented-control.css +1 -1
  409. package/dist/styles/select.css +1 -1
  410. package/dist/styles/sheet.css +1 -1
  411. package/dist/styles/side-nav.css +1 -1
  412. package/dist/styles/site-footer.css +1 -0
  413. package/dist/styles/site-header.css +1 -0
  414. package/dist/styles/skip-link.css +1 -0
  415. package/dist/styles/sortable-list.css +1 -1
  416. package/dist/styles/stack.css +1 -1
  417. package/dist/styles/stat.css +1 -0
  418. package/dist/styles/steps.css +1 -1
  419. package/dist/styles/switch.css +1 -0
  420. package/dist/styles/table.css +1 -1
  421. package/dist/styles/tabs.css +1 -1
  422. package/dist/styles/tag-input.css +1 -1
  423. package/dist/styles/text-field.css +1 -1
  424. package/dist/styles/text.css +1 -0
  425. package/dist/styles/time-field.css +1 -1
  426. package/dist/styles/toast.css +1 -1
  427. package/dist/styles/visually-hidden.css +1 -0
  428. package/dist/styles.css +1 -1
  429. package/dist/theme/CynosureTheme.d.ts +4 -0
  430. package/dist/theme/CynosureTheme.js.map +1 -1
  431. package/dist/tokens/create-theme.js +137 -108
  432. package/dist/tokens/create-theme.js.map +1 -1
  433. package/dist/tokens/to-css.js +12 -12
  434. package/dist/tokens/to-css.js.map +1 -1
  435. package/package.json +8 -3
  436. package/dist/components/Checkbox/ChoiceRow.d.ts +0 -23
  437. package/dist/components/Checkbox/ChoiceRow.js +0 -57
  438. package/dist/components/Checkbox/ChoiceRow.js.map +0 -1
  439. package/dist/styles/hidden-value.css +0 -1
  440. package/dist/styles/iconbutton.css +0 -1
  441. package/dist/styles/search-field.css +0 -1
@@ -0,0 +1,69 @@
1
+ import { type CSSProperties, type HTMLAttributes, type ReactNode } from "react";
2
+ export interface OptionListTokens {
3
+ bg: string;
4
+ shadow: string;
5
+ maxHeight: string;
6
+ maxWidth: string;
7
+ activeBg: string;
8
+ }
9
+ declare module "../../tokens/schema.js" {
10
+ interface ComponentTokens {
11
+ optionList: OptionListTokens;
12
+ }
13
+ }
14
+ export interface OptionListProps {
15
+ /** The list's id: the field's `aria-controls`, and the prefix of the options' ids. */
16
+ id: string;
17
+ /** Accessible name, when no visible label names the list through `aria-labelledby`. */
18
+ label?: string | undefined;
19
+ /** The id of the visible label that names the list. */
20
+ "aria-labelledby"?: string | undefined;
21
+ /** Options are still loading (`aria-busy`). */
22
+ busy?: boolean | undefined;
23
+ /** Added to the root element, for layout. */
24
+ className?: string;
25
+ /** Layout only. Restyle through --cy-option-list-* tokens. */
26
+ style?: CSSProperties;
27
+ /** OptionListItem, OptionListNote and OptionListGroup. */
28
+ children?: ReactNode;
29
+ }
30
+ /**
31
+ * The drop-down list of options under a field: Select, Combobox and TagInput draw their lists with it. It is a manual
32
+ * popover; show, place and dismiss it with `useListboxLayer`, and move the active option with
33
+ * `aria-activedescendant` from the field, which keeps focus.
34
+ */
35
+ export declare const OptionList: import("react").ForwardRefExoticComponent<OptionListProps & import("react").RefAttributes<HTMLDivElement>>;
36
+ export interface OptionListItemProps extends Omit<HTMLAttributes<HTMLDivElement>, "role" | "tabIndex" | "className" | "style" | "children"> {
37
+ /** The option's id, the target of the field's `aria-activedescendant`. */
38
+ id: string;
39
+ /** The option's text. */
40
+ label: ReactNode;
41
+ /** A second, muted line under the label. */
42
+ description?: ReactNode;
43
+ /** Drawn before the text: the option's icon. */
44
+ icon?: ReactNode;
45
+ /** The chosen option (`aria-selected`). */
46
+ selected?: boolean;
47
+ /** The option the arrow keys are on (highlighted). */
48
+ active?: boolean;
49
+ /** Shown but not choosable (`aria-disabled`). */
50
+ disabled?: boolean | undefined;
51
+ }
52
+ /** One option of an OptionList. A press never moves focus out of the field the list drops down from. */
53
+ export declare function OptionListItem({ id, label, description, icon, selected, active, disabled, onPointerDown, ...rest }: OptionListItemProps): import("react").JSX.Element;
54
+ export interface OptionListNoteProps {
55
+ /** The text: "No matches", "Loading…". */
56
+ children: ReactNode;
57
+ }
58
+ /** A line in place of options (nothing matches, still loading): an option that cannot be chosen. */
59
+ export declare function OptionListNote({ children }: OptionListNoteProps): import("react").JSX.Element;
60
+ export interface OptionListGroupProps {
61
+ /** The heading's id (it names the group). */
62
+ id: string;
63
+ /** The heading: small and muted, passed over by the arrow keys. */
64
+ label: ReactNode;
65
+ /** The group's OptionListItems. */
66
+ children: ReactNode;
67
+ }
68
+ /** A labelled run of options inside an OptionList. */
69
+ export declare function OptionListGroup({ id, label, children }: OptionListGroupProps): import("react").JSX.Element;
@@ -0,0 +1,75 @@
1
+ "use client";
2
+ import { forwardRef as u } from "react";
3
+ import { jsx as t, jsxs as p } from "react/jsx-runtime";
4
+ var m = u(function({ id: e, label: o, "aria-labelledby": a, busy: r, className: n, style: s, children: c }, l) {
5
+ return /* @__PURE__ */ t("div", {
6
+ ref: l,
7
+ id: e,
8
+ role: "listbox",
9
+ "aria-label": a ? void 0 : o,
10
+ "aria-labelledby": a,
11
+ "aria-busy": r || void 0,
12
+ className: `cy-option-list${n ? ` ${n}` : ""}`,
13
+ style: s,
14
+ popover: "manual",
15
+ children: c
16
+ });
17
+ });
18
+ function f({ id: i, label: e, description: o, icon: a, selected: r = !1, active: n = !1, disabled: s, onPointerDown: c, ...l }) {
19
+ return /* @__PURE__ */ p("div", {
20
+ ...l,
21
+ id: i,
22
+ role: "option",
23
+ "aria-selected": r,
24
+ "aria-disabled": s || void 0,
25
+ "data-active": n ? "" : void 0,
26
+ className: "cy-option-list-option",
27
+ tabIndex: -1,
28
+ onPointerDown: (d) => {
29
+ d.preventDefault(), c?.(d);
30
+ },
31
+ onKeyDown: l.onKeyDown ?? (() => {
32
+ }),
33
+ children: [a, /* @__PURE__ */ p("span", {
34
+ className: "cy-option-list-text",
35
+ children: [/* @__PURE__ */ t("span", {
36
+ className: "cy-option-list-label",
37
+ children: e
38
+ }), o && /* @__PURE__ */ t("span", {
39
+ className: "cy-option-list-description",
40
+ children: o
41
+ })]
42
+ })]
43
+ });
44
+ }
45
+ function v({ children: i }) {
46
+ return /* @__PURE__ */ t("div", {
47
+ role: "option",
48
+ "aria-disabled": "true",
49
+ "aria-selected": "false",
50
+ tabIndex: -1,
51
+ className: "cy-option-list-note",
52
+ children: i
53
+ });
54
+ }
55
+ function N({ id: i, label: e, children: o }) {
56
+ return /* @__PURE__ */ p("div", {
57
+ role: "group",
58
+ "aria-labelledby": i,
59
+ className: "cy-option-list-group cy-reset",
60
+ children: [/* @__PURE__ */ t("div", {
61
+ id: i,
62
+ className: "cy-option-list-group-label",
63
+ role: "presentation",
64
+ children: e
65
+ }), o]
66
+ });
67
+ }
68
+ export {
69
+ m as OptionList,
70
+ N as OptionListGroup,
71
+ f as OptionListItem,
72
+ v as OptionListNote
73
+ };
74
+
75
+ //# sourceMappingURL=OptionList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OptionList.js","names":["forwardRef","jsx","jsxs","OptionList","id","label","labelledBy","busy","className","style","children","ref","OptionListItem","description","icon","selected","active","disabled","onPointerDown","rest","event","OptionListNote","OptionListGroup"],"sources":["../../../src/components/OptionList/OptionList.tsx"],"sourcesContent":["import { type CSSProperties, forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\n\nexport interface OptionListTokens {\n bg: string;\n shadow: string;\n maxHeight: string;\n maxWidth: string;\n activeBg: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n optionList: OptionListTokens;\n }\n}\n\nexport interface OptionListProps {\n /** The list's id: the field's `aria-controls`, and the prefix of the options' ids. */\n id: string;\n /** Accessible name, when no visible label names the list through `aria-labelledby`. */\n label?: string | undefined;\n /** The id of the visible label that names the list. */\n \"aria-labelledby\"?: string | undefined;\n /** Options are still loading (`aria-busy`). */\n busy?: boolean | undefined;\n /** Added to the root element, for layout. */\n className?: string;\n /** Layout only. Restyle through --cy-option-list-* tokens. */\n style?: CSSProperties;\n /** OptionListItem, OptionListNote and OptionListGroup. */\n children?: ReactNode;\n}\n\n/**\n * The drop-down list of options under a field: Select, Combobox and TagInput draw their lists with it. It is a manual\n * popover; show, place and dismiss it with `useListboxLayer`, and move the active option with\n * `aria-activedescendant` from the field, which keeps focus.\n */\nexport const OptionList = forwardRef<HTMLDivElement, OptionListProps>(function OptionList(\n { id, label, \"aria-labelledby\": labelledBy, busy, className, style, children },\n ref,\n) {\n return (\n <div\n ref={ref}\n id={id}\n role=\"listbox\"\n aria-label={labelledBy ? undefined : label}\n aria-labelledby={labelledBy}\n aria-busy={busy || undefined}\n className={`cy-option-list${className ? ` ${className}` : \"\"}`}\n style={style}\n {...{ popover: \"manual\" }}\n >\n {children}\n </div>\n );\n});\n\nexport interface OptionListItemProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"role\" | \"tabIndex\" | \"className\" | \"style\" | \"children\"> {\n /** The option's id, the target of the field's `aria-activedescendant`. */\n id: string;\n /** The option's text. */\n label: ReactNode;\n /** A second, muted line under the label. */\n description?: ReactNode;\n /** Drawn before the text: the option's icon. */\n icon?: ReactNode;\n /** The chosen option (`aria-selected`). */\n selected?: boolean;\n /** The option the arrow keys are on (highlighted). */\n active?: boolean;\n /** Shown but not choosable (`aria-disabled`). */\n disabled?: boolean | undefined;\n}\n\n/** One option of an OptionList. A press never moves focus out of the field the list drops down from. */\nexport function OptionListItem({\n id,\n label,\n description,\n icon,\n selected = false,\n active = false,\n disabled,\n onPointerDown,\n ...rest\n}: OptionListItemProps) {\n return (\n <div\n {...rest}\n id={id}\n role=\"option\"\n aria-selected={selected}\n aria-disabled={disabled || undefined}\n data-active={active ? \"\" : undefined}\n className=\"cy-option-list-option\"\n tabIndex={-1}\n onPointerDown={(event) => {\n // Keep focus in the field: the options are aria-activedescendant targets.\n event.preventDefault();\n onPointerDown?.(event);\n }}\n onKeyDown={rest.onKeyDown ?? (() => {})}\n >\n {icon}\n <span className=\"cy-option-list-text\">\n <span className=\"cy-option-list-label\">{label}</span>\n {description && <span className=\"cy-option-list-description\">{description}</span>}\n </span>\n </div>\n );\n}\n\nexport interface OptionListNoteProps {\n /** The text: \"No matches\", \"Loading…\". */\n children: ReactNode;\n}\n\n/** A line in place of options (nothing matches, still loading): an option that cannot be chosen. */\nexport function OptionListNote({ children }: OptionListNoteProps) {\n return (\n <div\n role=\"option\"\n aria-disabled=\"true\"\n aria-selected=\"false\"\n tabIndex={-1}\n className=\"cy-option-list-note\"\n >\n {children}\n </div>\n );\n}\n\nexport interface OptionListGroupProps {\n /** The heading's id (it names the group). */\n id: string;\n /** The heading: small and muted, passed over by the arrow keys. */\n label: ReactNode;\n /** The group's OptionListItems. */\n children: ReactNode;\n}\n\n/** A labelled run of options inside an OptionList. */\nexport function OptionListGroup({ id, label, children }: OptionListGroupProps) {\n return (\n // biome-ignore lint/a11y/useSemanticElements: a group of options inside a listbox; a fieldset is a form control\n <div role=\"group\" aria-labelledby={id} className=\"cy-option-list-group cy-reset\">\n <div id={id} className=\"cy-option-list-group-label\" role=\"presentation\">\n {label}\n </div>\n {children}\n </div>\n );\n}\n"],"mappings":";;;AAsCA,IAAaG,IAAaH,EAA4C,SACpE,EAAE,IAAAI,GAAI,OAAAC,GAAO,mBAAmBC,GAAY,MAAAC,GAAM,WAAAC,GAAW,OAAAC,GAAO,UAAAC,EAAA,GACpEC,GACA;AACA,SACE,gBAAAV,EAAC,OAAD;AAAA,IACO,KAAAU;AAAA,IACD,IAAAP;AAAA,IACJ,MAAK;AAAA,IACL,cAAYE,IAAa,SAAYD;AAAA,IACrC,mBAAiBC;AAAA,IACjB,aAAWC,KAAQ;AAAA,IACnB,WAAW,iBAAiBC,IAAY,IAAIA,CAAA,KAAc,EAAA;AAAA,IACnD,OAAAC;AAAA,IACD,SAAS;AAAA,IAEd,UAAAC;AAAA,EACE,CAAA;AAET,CAAC;AAqBD,SAAgBE,EAAe,EAC7B,IAAAR,GACA,OAAAC,GACA,aAAAQ,GACA,MAAAC,GACA,UAAAC,IAAW,IACX,QAAAC,IAAS,IACT,UAAAC,GACA,eAAAC,GACA,GAA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List, OptionListGroup, type OptionListGroupProps, OptionListItem, type OptionListItemProps, OptionListNote, type OptionListNoteProps, type OptionListProps, type OptionListTokens, } from "./OptionList.js";
@@ -0,0 +1,67 @@
1
+ import { type CSSProperties, type ReactNode } from "react";
2
+ import { type HeadingSize } from "../Heading/Heading.js";
3
+ export interface PageHeaderTokens {
4
+ /** Space between the breadcrumbs, the title block, the actions and the content below them. */
5
+ gap: string;
6
+ /** Space between the eyebrow, the title, the description and the meta row. */
7
+ textGap: string;
8
+ /** Space between two actions and between items of the meta row. */
9
+ actionsGap: string;
10
+ /** Longest line of the description. */
11
+ descriptionMaxWidth: string;
12
+ /** Colour of the bottom border drawn by `divider`. */
13
+ dividerColor: string;
14
+ /** Space between the header's content and the bottom border drawn by `divider`. */
15
+ dividerSpace: string;
16
+ }
17
+ declare module "../../tokens/schema.js" {
18
+ interface ComponentTokens {
19
+ pageHeader: PageHeaderTokens;
20
+ }
21
+ }
22
+ export interface PageHeaderProps {
23
+ /** What the page or section is. Rendered as the header's one heading. */
24
+ title: ReactNode;
25
+ /** Heading level of the title, to fit the page outline. Default 1. */
26
+ headingLevel?: 1 | 2 | 3;
27
+ /**
28
+ * Size of the title. "md" is the usual size of the heading level (level 1 "2xl", level 2 "xl", level 3 "lg" in
29
+ * Heading's sizes); "lg" is the hero "display" size for a landing page. Default "md".
30
+ */
31
+ size?: "md" | "lg";
32
+ /**
33
+ * Any of Heading's sizes for the title, instead of the one `size` gives: `"3xl"` sits between "md" (2xl at level 1)
34
+ * and "lg" (display), for a section's landing page. The level and the rest of the header are unchanged.
35
+ */
36
+ titleSize?: HeadingSize | undefined;
37
+ /** A short label above the title that says where the page belongs. It comes before the title in reading order. */
38
+ eyebrow?: ReactNode | undefined;
39
+ /** One or two sentences under the title, as a lead paragraph. Pass inline content only. */
40
+ description?: ReactNode | undefined;
41
+ /** The trail to this page, shown above the eyebrow and the title. Pass a `Breadcrumbs`. */
42
+ breadcrumbs?: ReactNode | undefined;
43
+ /**
44
+ * The page's buttons. They sit at the inline end, level with the top of the title block, and move below the text
45
+ * when the header itself is narrower than 36rem or when `align` is "center".
46
+ */
47
+ actions?: ReactNode | undefined;
48
+ /** A row under the description for badges, dates and authors. It wraps. */
49
+ meta?: ReactNode | undefined;
50
+ /** Anything below the rest of the header, at full width: tabs, a search field. */
51
+ children?: ReactNode;
52
+ /** "start" for pages; "center" centres the text and puts the actions below it, for landing pages. Default "start". */
53
+ align?: "start" | "center";
54
+ /** Draws a bottom border with space above it, to separate the header from the page. Default false. */
55
+ divider?: boolean;
56
+ /**
57
+ * The element rendered. A `header` inside `main` is not a banner landmark, so no choice adds a landmark.
58
+ * Default "header".
59
+ */
60
+ as?: "header" | "div" | "section";
61
+ /** Added to the root element, for layout. */
62
+ className?: string | undefined;
63
+ /** Layout only. Restyle through --cy-page-header-* tokens. */
64
+ style?: CSSProperties | undefined;
65
+ }
66
+ /** The top of a page or a major section: where you are, what this is, a sentence about it and the page's actions. */
67
+ export declare const PageHeader: import("react").ForwardRefExoticComponent<PageHeaderProps & import("react").RefAttributes<HTMLElement>>;
@@ -0,0 +1,63 @@
1
+ "use client";
2
+ import { Heading as x } from "../Heading/Heading.js";
3
+ import { Text as p } from "../Text/Text.js";
4
+ import { forwardRef as u } from "react";
5
+ import { jsx as e, jsxs as a } from "react/jsx-runtime";
6
+ var z = u(function({ title: y, headingLevel: n = 1, size: r = "md", titleSize: d, eyebrow: c, description: s, breadcrumbs: i, actions: l, meta: t, children: h, align: g = "start", divider: o = !1, as: v = "header", className: m, style: N }, f) {
7
+ return /* @__PURE__ */ a(v, {
8
+ ref: f,
9
+ className: m ? `cy-page-header ${m}` : "cy-page-header",
10
+ "data-size": r,
11
+ "data-align": g,
12
+ "data-divider": o ? "" : void 0,
13
+ style: N,
14
+ children: [
15
+ i && /* @__PURE__ */ e("div", {
16
+ className: "cy-page-header-breadcrumbs cy-reset",
17
+ children: i
18
+ }),
19
+ /* @__PURE__ */ a("div", {
20
+ className: "cy-page-header-main cy-reset",
21
+ children: [/* @__PURE__ */ a("div", {
22
+ className: "cy-page-header-text cy-reset",
23
+ children: [
24
+ c && /* @__PURE__ */ e(p, {
25
+ as: "p",
26
+ variant: "eyebrow",
27
+ className: "cy-page-header-eyebrow",
28
+ children: c
29
+ }),
30
+ /* @__PURE__ */ e(x, {
31
+ level: n,
32
+ ...d ? { size: d } : r === "lg" ? { size: "display" } : {},
33
+ className: "cy-page-header-title",
34
+ children: y
35
+ }),
36
+ s && /* @__PURE__ */ e(p, {
37
+ as: "p",
38
+ variant: "lead",
39
+ className: "cy-page-header-description",
40
+ children: s
41
+ }),
42
+ t && /* @__PURE__ */ e("div", {
43
+ className: "cy-page-header-meta",
44
+ children: t
45
+ })
46
+ ]
47
+ }), l && /* @__PURE__ */ e("div", {
48
+ className: "cy-page-header-actions cy-reset",
49
+ children: l
50
+ })]
51
+ }),
52
+ h && /* @__PURE__ */ e("div", {
53
+ className: "cy-page-header-body cy-reset",
54
+ children: h
55
+ })
56
+ ]
57
+ });
58
+ });
59
+ export {
60
+ z as PageHeader
61
+ };
62
+
63
+ //# sourceMappingURL=PageHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageHeader.js","names":["Heading","Text","forwardRef","jsx","jsxs","PageHeader","title","headingLevel","size","titleSize","eyebrow","description","breadcrumbs","actions","meta","children","align","divider","Tag","className","style","ref"],"sources":["../../../src/components/PageHeader/PageHeader.tsx"],"sourcesContent":["import { type CSSProperties, forwardRef, type ReactNode } from \"react\";\nimport { Heading, type HeadingSize } from \"../Heading/Heading.js\";\nimport { Text } from \"../Text/Text.js\";\n\nexport interface PageHeaderTokens {\n /** Space between the breadcrumbs, the title block, the actions and the content below them. */\n gap: string;\n /** Space between the eyebrow, the title, the description and the meta row. */\n textGap: string;\n /** Space between two actions and between items of the meta row. */\n actionsGap: string;\n /** Longest line of the description. */\n descriptionMaxWidth: string;\n /** Colour of the bottom border drawn by `divider`. */\n dividerColor: string;\n /** Space between the header's content and the bottom border drawn by `divider`. */\n dividerSpace: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n pageHeader: PageHeaderTokens;\n }\n}\n\nexport interface PageHeaderProps {\n /** What the page or section is. Rendered as the header's one heading. */\n title: ReactNode;\n /** Heading level of the title, to fit the page outline. Default 1. */\n headingLevel?: 1 | 2 | 3;\n /**\n * Size of the title. \"md\" is the usual size of the heading level (level 1 \"2xl\", level 2 \"xl\", level 3 \"lg\" in\n * Heading's sizes); \"lg\" is the hero \"display\" size for a landing page. Default \"md\".\n */\n size?: \"md\" | \"lg\";\n /**\n * Any of Heading's sizes for the title, instead of the one `size` gives: `\"3xl\"` sits between \"md\" (2xl at level 1)\n * and \"lg\" (display), for a section's landing page. The level and the rest of the header are unchanged.\n */\n titleSize?: HeadingSize | undefined;\n /** A short label above the title that says where the page belongs. It comes before the title in reading order. */\n eyebrow?: ReactNode | undefined;\n /** One or two sentences under the title, as a lead paragraph. Pass inline content only. */\n description?: ReactNode | undefined;\n /** The trail to this page, shown above the eyebrow and the title. Pass a `Breadcrumbs`. */\n breadcrumbs?: ReactNode | undefined;\n /**\n * The page's buttons. They sit at the inline end, level with the top of the title block, and move below the text\n * when the header itself is narrower than 36rem or when `align` is \"center\".\n */\n actions?: ReactNode | undefined;\n /** A row under the description for badges, dates and authors. It wraps. */\n meta?: ReactNode | undefined;\n /** Anything below the rest of the header, at full width: tabs, a search field. */\n children?: ReactNode;\n /** \"start\" for pages; \"center\" centres the text and puts the actions below it, for landing pages. Default \"start\". */\n align?: \"start\" | \"center\";\n /** Draws a bottom border with space above it, to separate the header from the page. Default false. */\n divider?: boolean;\n /**\n * The element rendered. A `header` inside `main` is not a banner landmark, so no choice adds a landmark.\n * Default \"header\".\n */\n as?: \"header\" | \"div\" | \"section\";\n /** Added to the root element, for layout. */\n className?: string | undefined;\n /** Layout only. Restyle through --cy-page-header-* tokens. */\n style?: CSSProperties | undefined;\n}\n\n/** The top of a page or a major section: where you are, what this is, a sentence about it and the page's actions. */\nexport const PageHeader = forwardRef<HTMLElement, PageHeaderProps>(function PageHeader(\n {\n title,\n headingLevel = 1,\n size = \"md\",\n titleSize,\n eyebrow,\n description,\n breadcrumbs,\n actions,\n meta,\n children,\n align = \"start\",\n divider = false,\n as: Tag = \"header\",\n className,\n style,\n },\n ref,\n) {\n return (\n <Tag\n // One component, three elements: the ref is the element's own, typed as the common HTMLElement.\n ref={ref as never}\n className={className ? `cy-page-header ${className}` : \"cy-page-header\"}\n data-size={size}\n data-align={align}\n data-divider={divider ? \"\" : undefined}\n style={style}\n >\n {breadcrumbs && <div className=\"cy-page-header-breadcrumbs cy-reset\">{breadcrumbs}</div>}\n <div className=\"cy-page-header-main cy-reset\">\n <div className=\"cy-page-header-text cy-reset\">\n {eyebrow && (\n <Text as=\"p\" variant=\"eyebrow\" className=\"cy-page-header-eyebrow\">\n {eyebrow}\n </Text>\n )}\n <Heading\n level={headingLevel}\n {...(titleSize ? { size: titleSize } : size === \"lg\" ? { size: \"display\" as const } : {})}\n className=\"cy-page-header-title\"\n >\n {title}\n </Heading>\n {description && (\n <Text as=\"p\" variant=\"lead\" className=\"cy-page-header-description\">\n {description}\n </Text>\n )}\n {meta && <div className=\"cy-page-header-meta\">{meta}</div>}\n </div>\n {actions && <div className=\"cy-page-header-actions cy-reset\">{actions}</div>}\n </div>\n {children && <div className=\"cy-page-header-body cy-reset\">{children}</div>}\n </Tag>\n );\n});\n"],"mappings":";;;;;AAuEA,IAAaK,IAAaH,EAAyC,SACjE,EACE,OAAAI,GACA,cAAAC,IAAe,GACf,MAAAC,IAAO,MACP,WAAAC,GACA,SAAAC,GACA,aAAAC,GACA,aAAAC,GACA,SAAAC,GACA,MAAAC,GACA,UAAAC,GACA,OAAAC,IAAQ,SACR,SAAAC,IAAU,IACV,IAAIC,IAAM,UACV,WAAAC,GACA,OAAAC,EAAA,GAEFC,GACA;AACA,SACE,gBAAAjB,EAACc,GAAD;AAAA,IAEO,KAAAG;AAAA,IACL,WAAWF,IAAY,kBA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";
@@ -0,0 +1,77 @@
1
+ import { type CSSProperties, type MouseEvent } from "react";
2
+ export interface PaginationTokens {
3
+ /** Space between the controls. */
4
+ gap: string;
5
+ /** Inline padding of a page number (its width is never less than its height). */
6
+ pagePadding: string;
7
+ /** Colour of the ellipsis and of the "Page 3 of 10" text. */
8
+ mutedColor: string;
9
+ }
10
+ declare module "../../tokens/schema.js" {
11
+ interface ComponentTokens {
12
+ pagination: PaginationTokens;
13
+ }
14
+ }
15
+ export interface PaginationLabels {
16
+ /** Name of the navigation landmark. */
17
+ nav: string;
18
+ /** Name of the previous-page control. */
19
+ previous: string;
20
+ /** Name of the next-page control. */
21
+ next: string;
22
+ /** Name of the first-page control. */
23
+ first: string;
24
+ /** Name of the last-page control. */
25
+ last: string;
26
+ /** Name of a page number. The current one also carries `aria-current="page"`, so do not add "current" here. */
27
+ page: (page: number) => string;
28
+ /** Text of the compact variant, also announced when the page changes. */
29
+ status: (page: number, count: number) => string;
30
+ }
31
+ /** How many pages `total` items make at `pageSize` items a page: never less than 1. */
32
+ export declare function pageCount(total: number, pageSize: number): number;
33
+ /**
34
+ * The pages to show for `page` of `count`, in order, with `"gap"` where pages are left out. `boundaries` pages are
35
+ * always shown at each end and `siblings` each side of the current one. The list has the same length on every page
36
+ * (so the controls do not move under the pointer), and a gap never stands for a single page.
37
+ */
38
+ export declare function pageRange(page: number, count: number, siblings?: number, boundaries?: number): (number | "gap")[];
39
+ export interface PaginationProps {
40
+ /** How many pages there are. From a number of items, use `pageCount(total, pageSize)`. One page or fewer renders nothing. */
41
+ count: number;
42
+ /** The current page, from 1 (controlled). Values outside 1 to `count` are clamped. */
43
+ page?: number | undefined;
44
+ /** The page shown first when uncontrolled. Default 1. */
45
+ defaultPage?: number;
46
+ /**
47
+ * Called with the new page when a control is pressed, and with the click event. With `getHref`, a client-side router
48
+ * calls `event.preventDefault()` here to stop the browser following the link, then navigates itself.
49
+ */
50
+ onChange?: ((page: number, event: MouseEvent<HTMLElement>) => void) | undefined;
51
+ /** Pages shown each side of the current one. Default 1. */
52
+ siblings?: number;
53
+ /** Pages always shown at each end. Default 1. */
54
+ boundaries?: number;
55
+ /** `pages` shows numbered pages; `compact` shows only previous and next around "Page 3 of 10", for phones and tight spaces. Default "pages". */
56
+ variant?: "pages" | "compact";
57
+ /** Adds first-page and last-page controls. Default false. */
58
+ showEdges?: boolean;
59
+ /**
60
+ * The address of a page. When given, every page number and every control that leads to another page is a real link
61
+ * to it (works without JavaScript, opens in a new tab); the current page is a link with `aria-current="page"`.
62
+ * `onChange` still fires on a plain click.
63
+ */
64
+ getHref?: ((page: number) => string) | undefined;
65
+ /** Disables every control. Default false. */
66
+ disabled?: boolean;
67
+ /** Height and text size of the controls. Default "md". */
68
+ size?: "sm" | "md";
69
+ /** Replaces the built-in English strings. */
70
+ labels?: Partial<PaginationLabels> | undefined;
71
+ /** Added to the `nav` element, for layout. */
72
+ className?: string | undefined;
73
+ /** Layout only. Restyle through `--cy-pagination-*` tokens. */
74
+ style?: CSSProperties | undefined;
75
+ }
76
+ /** Moves between the pages of a list or table: a `nav` landmark of Buttons, with the current page marked. */
77
+ export declare const Pagination: import("react").ForwardRefExoticComponent<PaginationProps & import("react").RefAttributes<HTMLElement>>;
@@ -0,0 +1,121 @@
1
+ "use client";
2
+ import { useControllableState as F } from "../../foundations/controllable.js";
3
+ import { Icon as I } from "../../foundations/Icon/Icon.js";
4
+ import { useClientLayoutEffect as S } from "../../foundations/client-layout-effect.js";
5
+ import { Button as T } from "../Button/Button.js";
6
+ import { clamp as B } from "../../foundations/math.js";
7
+ import { IconButton as q } from "../IconButton/IconButton.js";
8
+ import { chevronRight as w } from "../../icons/chevron-right.js";
9
+ import { moreHorizontal as V } from "../../icons/more-horizontal.js";
10
+ import { chevronLeft as _ } from "../../icons/chevron-left.js";
11
+ import { chevronFirst as D } from "../../icons/chevron-first.js";
12
+ import { chevronLast as G } from "../../icons/chevron-last.js";
13
+ import { forwardRef as H, useRef as K } from "react";
14
+ import { jsx as i, jsxs as J } from "react/jsx-runtime";
15
+ var O = {
16
+ nav: "Pagination",
17
+ previous: "Previous page",
18
+ next: "Next page",
19
+ first: "First page",
20
+ last: "Last page",
21
+ page: (n) => `Page ${n}`,
22
+ status: (n, e) => `Page ${n} of ${e}`
23
+ }, y = (n, e) => Math.max(e, Math.floor(n) || 0);
24
+ function it(n, e) {
25
+ return e > 0 ? y(Math.ceil(n / e), 1) : 1;
26
+ }
27
+ function Q(n, e, N = 1, C = 1) {
28
+ const o = y(e, 0), f = y(N, 0), a = y(C, 0), s = (m, d) => Array.from({ length: d - m + 1 }, (M, v) => m + v);
29
+ if (o <= a * 2 + f * 2 + 3) return s(1, o);
30
+ const p = B(n - f, a + 2, o - a - f * 2 - 1), h = p + f * 2;
31
+ return [
32
+ ...s(1, a),
33
+ p > a + 2 ? "gap" : a + 1,
34
+ ...s(p, h),
35
+ h < o - a - 1 ? "gap" : o - a,
36
+ ...s(o - a + 1, o)
37
+ ];
38
+ }
39
+ var st = H(function({ count: e, page: N, defaultPage: C = 1, onChange: o, siblings: f = 1, boundaries: a = 1, variant: s = "pages", showEdges: p = !1, getHref: h, disabled: m = !1, size: d = "md", labels: M, className: v, style: j }, k) {
40
+ const l = {
41
+ ...O,
42
+ ...M
43
+ }, g = y(e, 1), [A, E] = F(N, C), c = B(Math.round(A) || 1, 1, g), P = K(null), L = K(null);
44
+ if (S(() => {
45
+ const t = L.current;
46
+ if (L.current = null, !t || t.isConnected && !t.matches(":disabled")) return;
47
+ const r = (u) => P.current?.querySelector(u);
48
+ (r("[aria-current]") ?? r(".cy-button:not(:disabled)"))?.focus();
49
+ }), g <= 1) return null;
50
+ const R = (t) => (r) => {
51
+ if (h && (r.metaKey || r.ctrlKey || r.shiftKey || r.altKey)) return;
52
+ const u = r.currentTarget;
53
+ u.getRootNode().activeElement === u && (L.current = u), t !== c && (E(t), o?.(t, r));
54
+ }, $ = (t, r) => r ? void 0 : h?.(t), x = (t, r, u) => {
55
+ const b = m || t === c;
56
+ return /* @__PURE__ */ i("li", {
57
+ className: "cy-reset cy-pagination-item",
58
+ children: /* @__PURE__ */ i(q, {
59
+ icon: r,
60
+ label: u,
61
+ size: d,
62
+ variant: "ghost",
63
+ flipRtl: !0,
64
+ disabled: b,
65
+ href: $(t, b),
66
+ onClick: R(t)
67
+ })
68
+ });
69
+ };
70
+ return /* @__PURE__ */ i("nav", {
71
+ ref: k,
72
+ className: `cy-pagination${v ? ` ${v}` : ""}`,
73
+ "aria-label": l.nav,
74
+ "data-size": d,
75
+ "data-variant": s,
76
+ style: j,
77
+ children: /* @__PURE__ */ J("ol", {
78
+ ref: P,
79
+ className: "cy-reset cy-pagination-list",
80
+ children: [
81
+ p && x(1, D, l.first),
82
+ x(Math.max(1, c - 1), _, l.previous),
83
+ s === "compact" ? /* @__PURE__ */ i("li", {
84
+ className: "cy-reset cy-pagination-item",
85
+ children: /* @__PURE__ */ i("span", {
86
+ className: "cy-reset cy-pagination-status",
87
+ role: "status",
88
+ children: l.status(c, g)
89
+ })
90
+ }) : Q(c, g, f, a).map((t, r) => t === "gap" ? /* @__PURE__ */ i("li", {
91
+ className: "cy-reset cy-pagination-gap",
92
+ "aria-hidden": "true",
93
+ children: /* @__PURE__ */ i(I, { icon: V })
94
+ }, `gap-${r}`) : /* @__PURE__ */ i("li", {
95
+ className: "cy-reset cy-pagination-item",
96
+ children: /* @__PURE__ */ i(T, {
97
+ className: "cy-pagination-page",
98
+ size: d,
99
+ variant: t === c ? "soft" : "ghost",
100
+ tone: t === c ? "accent" : "neutral",
101
+ "aria-label": l.page(t),
102
+ "aria-current": t === c ? "page" : void 0,
103
+ disabled: m,
104
+ href: $(t, m),
105
+ onClick: R(t),
106
+ children: t
107
+ })
108
+ }, t)),
109
+ x(Math.min(g, c + 1), w, l.next),
110
+ p && x(g, G, l.last)
111
+ ]
112
+ })
113
+ });
114
+ });
115
+ export {
116
+ st as Pagination,
117
+ it as pageCount,
118
+ Q as pageRange
119
+ };
120
+
121
+ //# sourceMappingURL=Pagination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pagination.js","names":["useControllableState","Icon","useClientLayoutEffect","Button","clamp","IconButton","chevronRight","moreHorizontal","chevronLeft","chevronFirst","chevronLast","forwardRef","useRef","jsx","jsxs","LABELS","page","count","whole","least","pageCount","total","pageSize","pageRange","siblings","boundaries","last","side","edge","run","from","to","_","i","Pagination","defaultPage","onChange","variant","showEdges","getHref","disabled","size","labels","className","style","ref","text","value","setValue","current","list","pressed","find","selector","go","event","control","hrefTo","off","step","icon","label","item","index"],"sources":["../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":["import { type CSSProperties, forwardRef, type MouseEvent, useRef } from \"react\";\nimport { useClientLayoutEffect } from \"../../foundations/client-layout-effect.js\";\nimport { useControllableState } from \"../../foundations/controllable.js\";\nimport { Icon } from \"../../foundations/Icon/Icon.js\";\nimport { clamp } from \"../../foundations/math.js\";\nimport { chevronFirst } from \"../../icons/chevron-first.js\";\nimport { chevronLast } from \"../../icons/chevron-last.js\";\nimport { chevronLeft } from \"../../icons/chevron-left.js\";\nimport { chevronRight } from \"../../icons/chevron-right.js\";\nimport { moreHorizontal } from \"../../icons/more-horizontal.js\";\nimport type { IconData } from \"../../icons/types.js\";\nimport { Button } from \"../Button/Button.js\";\nimport { IconButton } from \"../IconButton/IconButton.js\";\n\nexport interface PaginationTokens {\n /** Space between the controls. */\n gap: string;\n /** Inline padding of a page number (its width is never less than its height). */\n pagePadding: string;\n /** Colour of the ellipsis and of the \"Page 3 of 10\" text. */\n mutedColor: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n pagination: PaginationTokens;\n }\n}\n\nexport interface PaginationLabels {\n /** Name of the navigation landmark. */\n nav: string;\n /** Name of the previous-page control. */\n previous: string;\n /** Name of the next-page control. */\n next: string;\n /** Name of the first-page control. */\n first: string;\n /** Name of the last-page control. */\n last: string;\n /** Name of a page number. The current one also carries `aria-current=\"page\"`, so do not add \"current\" here. */\n page: (page: number) => string;\n /** Text of the compact variant, also announced when the page changes. */\n status: (page: number, count: number) => string;\n}\n\nconst LABELS: PaginationLabels = {\n nav: \"Pagination\",\n previous: \"Previous page\",\n next: \"Next page\",\n first: \"First page\",\n last: \"Last page\",\n page: (page) => `Page ${page}`,\n status: (page, count) => `Page ${page} of ${count}`,\n};\n\nconst whole = (n: number, least: number) => Math.max(least, Math.floor(n) || 0);\n\n/** How many pages `total` items make at `pageSize` items a page: never less than 1. */\nexport function pageCount(total: number, pageSize: number): number {\n return pageSize > 0 ? whole(Math.ceil(total / pageSize), 1) : 1;\n}\n\n/**\n * The pages to show for `page` of `count`, in order, with `\"gap\"` where pages are left out. `boundaries` pages are\n * always shown at each end and `siblings` each side of the current one. The list has the same length on every page\n * (so the controls do not move under the pointer), and a gap never stands for a single page.\n */\nexport function pageRange(page: number, count: number, siblings = 1, boundaries = 1): (number | \"gap\")[] {\n const last = whole(count, 0);\n const side = whole(siblings, 0);\n const edge = whole(boundaries, 0);\n const run = (from: number, to: number) => Array.from({ length: to - from + 1 }, (_, i) => from + i);\n if (last <= edge * 2 + side * 2 + 3) return run(1, last);\n const from = clamp(page - side, edge + 2, last - edge - side * 2 - 1);\n const to = from + side * 2;\n return [\n ...run(1, edge),\n from > edge + 2 ? \"gap\" : edge + 1,\n ...run(from, to),\n to < last - edge - 1 ? \"gap\" : last - edge,\n ...run(last - edge + 1, last),\n ];\n}\n\nexport interface PaginationProps {\n /** How many pages there are. From a number of items, use `pageCount(total, pageSize)`. One page or fewer renders nothing. */\n count: number;\n /** The current page, from 1 (controlled). Values outside 1 to `count` are clamped. */\n page?: number | undefined;\n /** The page shown first when uncontrolled. Default 1. */\n defaultPage?: number;\n /**\n * Called with the new page when a control is pressed, and with the click event. With `getHref`, a client-side router\n * calls `event.preventDefault()` here to stop the browser following the link, then navigates itself.\n */\n onChange?: ((page: number, event: MouseEvent<HTMLElement>) => void) | undefined;\n /** Pages shown each side of the current one. Default 1. */\n siblings?: number;\n /** Pages always shown at each end. Default 1. */\n boundaries?: number;\n /** `pages` shows numbered pages; `compact` shows only previous and next around \"Page 3 of 10\", for phones and tight spaces. Default \"pages\". */\n variant?: \"pages\" | \"compact\";\n /** Adds first-page and last-page controls. Default false. */\n showEdges?: boolean;\n /**\n * The address of a page. When given, every page number and every control that leads to another page is a real link\n * to it (works without JavaScript, opens in a new tab); the current page is a link with `aria-current=\"page\"`.\n * `onChange` still fires on a plain click.\n */\n getHref?: ((page: number) => string) | undefined;\n /** Disables every control. Default false. */\n disabled?: boolean;\n /** Height and text size of the controls. Default \"md\". */\n size?: \"sm\" | \"md\";\n /** Replaces the built-in English strings. */\n labels?: Partial<PaginationLabels> | undefined;\n /** Added to the `nav` element, for layout. */\n className?: string | undefined;\n /** Layout only. Restyle through `--cy-pagination-*` tokens. */\n style?: CSSProperties | undefined;\n}\n\n/** Moves between the pages of a list or table: a `nav` landmark of Buttons, with the current page marked. */\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination(\n {\n count,\n page,\n defaultPage = 1,\n onChange,\n siblings = 1,\n boundaries = 1,\n variant = \"pages\",\n showEdges = false,\n getHref,\n disabled = false,\n size = \"md\",\n labels,\n className,\n style,\n },\n ref,\n) {\n const text = { ...LABELS, ...labels };\n const last = whole(count, 1);\n const [value, setValue] = useControllableState(page, defaultPage);\n const current = clamp(Math.round(value) || 1, 1, last);\n const list = useRef<HTMLOListElement>(null);\n const pressed = useRef<Element | null>(null);\n\n // The pressed control had focus and can no longer hold it (previous on reaching page 1, where it is disabled or,\n // as a link, replaced by a button): focus goes to the current page, or to the control that still works.\n useClientLayoutEffect(() => {\n const from = pressed.current;\n pressed.current = null;\n if (!from || (from.isConnected && !from.matches(\":disabled\"))) return;\n const find = (selector: string) => list.current?.querySelector<HTMLElement>(selector);\n (find(\"[aria-current]\") ?? find(\".cy-button:not(:disabled)\"))?.focus();\n });\n\n if (last <= 1) return null;\n\n const go = (to: number) => (event: MouseEvent<HTMLElement>) => {\n // A link opened in a new tab or window leaves this page where it is.\n if (getHref && (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)) return;\n const control = event.currentTarget;\n if ((control.getRootNode() as Document | ShadowRoot).activeElement === control) pressed.current = control;\n if (to === current) return;\n setValue(to);\n onChange?.(to, event);\n };\n const hrefTo = (to: number, off: boolean) => (off ? undefined : getHref?.(to));\n const step = (to: number, icon: IconData, label: string) => {\n const off = disabled || to === current;\n return (\n <li className=\"cy-reset cy-pagination-item\">\n <IconButton\n icon={icon}\n label={label}\n size={size}\n variant=\"ghost\"\n // Previous and next point the way the pages run in the reading direction.\n flipRtl\n disabled={off}\n href={hrefTo(to, off)}\n onClick={go(to)}\n />\n </li>\n );\n };\n\n return (\n <nav\n ref={ref}\n className={`cy-pagination${className ? ` ${className}` : \"\"}`}\n aria-label={text.nav}\n data-size={size}\n data-variant={variant}\n style={style}\n >\n <ol ref={list} className=\"cy-reset cy-pagination-list\">\n {showEdges && step(1, chevronFirst, text.first)}\n {step(Math.max(1, current - 1), chevronLeft, text.previous)}\n {variant === \"compact\" ? (\n <li className=\"cy-reset cy-pagination-item\">\n <span className=\"cy-reset cy-pagination-status\" role=\"status\">\n {text.status(current, last)}\n </span>\n </li>\n ) : (\n pageRange(current, last, siblings, boundaries).map((item, index) =>\n item === \"gap\" ? (\n // Not a control and nothing to read: the page names on each side already say what is left out.\n <li key={`gap-${index}`} className=\"cy-reset cy-pagination-gap\" aria-hidden=\"true\">\n <Icon icon={moreHorizontal} />\n </li>\n ) : (\n <li key={item} className=\"cy-reset cy-pagination-item\">\n <Button\n className=\"cy-pagination-page\"\n size={size}\n variant={item === current ? \"soft\" : \"ghost\"}\n tone={item === current ? \"accent\" : \"neutral\"}\n aria-label={text.page(item)}\n aria-current={item === current ? \"page\" : undefined}\n disabled={disabled}\n href={hrefTo(item, disabled)}\n onClick={go(item)}\n >\n {item}\n </Button>\n </li>\n ),\n )\n )}\n {step(Math.min(last, current + 1), chevronRight, text.next)}\n {showEdges && step(last, chevronLast, text.last)}\n </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ACZ,GAAD,EAAM,MAAMM,EAAiB,CAAA;AAAA,QAC3B,GAFK,OAAOwD,CAAA,EAEZ,IAEJ,gBAAAlD,EAAC,MAAD;AAAA,UAAe,WAAU;AAAA,UACvB,UAAA,gBAAAA,EAACV,GAAD;AAAA,YACE,WAAU;AAAA,YACJ,MAAAsC;AAAA,YACN,SAASqB,MAASb,IAAU,SAAS;AAAA,YACrC,MAAMa,MAASb,IAAU,WAAW;AAAA,YACpC,cAAYH,EAAK,KAAKgB,CAAI;AAAA,YAC1B,gBAAcA,MAASb,IAAU,SAAS;AAAA,YAChC,UAAAT;AAAA,YACV,MAAMiB,EAAOK,GAAMtB,CAAQ;AAAA,YAC3B,SAASc,EAAGQ,CAAI;AAAA,YAEf,UAAAA;AAAA,UACK,CAAA;AAAA,QACN,GAdKA,CAcL,CAER;AAAA,QAEDH,EAAK,KAAK,IAAIjC,GAAMuB,IAAU,CAAC,GAAG3C,GAAcwC,EAAK,IAAI;AAAA,QACzDR,KAAaqB,EAAKjC,GAAMhB,GAAaoC,EAAK,IAAI;AAAA,MAC7C;AAAA,I;A,EACD,CAAA;AAET,CAAC"}
@@ -0,0 +1 @@
1
+ export { Pagination, type PaginationLabels, type PaginationProps, type PaginationTokens, pageCount, pageRange, } from "./Pagination.js";
@@ -44,9 +44,11 @@ export interface PanZoomCanvasLabels {
44
44
  export interface PanZoomCanvasProps {
45
45
  /** Names the canvas ("Schema diagram"). */
46
46
  label: string;
47
+ /** Controlled view: the pan offset and the zoom. */
47
48
  view?: CanvasView | undefined;
48
49
  /** Where it starts. Default: `bounds` fitted in view (or the origin at 100% without bounds). */
49
50
  defaultView?: CanvasView;
51
+ /** Called with the new view on every pan and zoom. */
50
52
  onViewChange?: ((view: CanvasView) => void) | undefined;
51
53
  /** The content's extent in canvas units, for fitting and the minimap. */
52
54
  bounds?: CanvasRect | undefined;
@@ -62,7 +64,9 @@ export interface PanZoomCanvasProps {
62
64
  renderScreen?: (screen: CanvasScreen) => ReactNode;
63
65
  /** The content, placed in canvas units (absolutely positioned children). */
64
66
  children?: ReactNode;
67
+ /** Replace the built-in English text: the zoom announcement. */
65
68
  labels?: Partial<PanZoomCanvasLabels>;
69
+ /** Added to the root element, for layout. */
66
70
  className?: string;
67
71
  /** Layout only (give it a height). Restyle through --cy-pan-zoom-canvas-* tokens. */
68
72
  style?: CSSProperties;