@arshad-shah/cynosure 0.3.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 (290) hide show
  1. package/README.md +3 -3
  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/Announcer/Announcer.js +5 -5
  14. package/dist/components/Announcer/Announcer.js.map +1 -1
  15. package/dist/components/AppShell/AppShell.js +50 -53
  16. package/dist/components/AppShell/AppShell.js.map +1 -1
  17. package/dist/components/Avatar/Avatar.js +20 -20
  18. package/dist/components/Avatar/Avatar.js.map +1 -1
  19. package/dist/components/Button/Button.d.ts +17 -3
  20. package/dist/components/Button/Button.js +51 -44
  21. package/dist/components/Button/Button.js.map +1 -1
  22. package/dist/components/Calendar/Calendar.js +69 -69
  23. package/dist/components/Calendar/Calendar.js.map +1 -1
  24. package/dist/components/Card/Card.d.ts +8 -1
  25. package/dist/components/Card/Card.js.map +1 -1
  26. package/dist/components/Checkbox/Checkbox.d.ts +4 -4
  27. package/dist/components/Checkbox/Checkbox.js +33 -8
  28. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  29. package/dist/components/Checklist/Checklist.js +21 -21
  30. package/dist/components/Checklist/Checklist.js.map +1 -1
  31. package/dist/components/Choice/Choice.d.ts +73 -0
  32. package/dist/components/Choice/Choice.js +41 -0
  33. package/dist/components/Choice/Choice.js.map +1 -0
  34. package/dist/components/Choice/index.d.ts +1 -0
  35. package/dist/components/ColorField/ColorField.js +198 -207
  36. package/dist/components/ColorField/ColorField.js.map +1 -1
  37. package/dist/components/Combobox/Combobox.js +86 -115
  38. package/dist/components/Combobox/Combobox.js.map +1 -1
  39. package/dist/components/Container/Container.d.ts +2 -2
  40. package/dist/components/Container/Container.js +17 -13
  41. package/dist/components/Container/Container.js.map +1 -1
  42. package/dist/components/CopyButton/CopyButton.js +29 -28
  43. package/dist/components/CopyButton/CopyButton.js.map +1 -1
  44. package/dist/components/DeviceFrame/DeviceFrame.d.ts +63 -0
  45. package/dist/components/DeviceFrame/DeviceFrame.js +54 -0
  46. package/dist/components/DeviceFrame/DeviceFrame.js.map +1 -0
  47. package/dist/components/DeviceFrame/index.d.ts +1 -0
  48. package/dist/components/Dialog/Dialog.d.ts +10 -1
  49. package/dist/components/Dialog/Dialog.js +82 -77
  50. package/dist/components/Dialog/Dialog.js.map +1 -1
  51. package/dist/components/EmptyState/EmptyState.d.ts +5 -2
  52. package/dist/components/EmptyState/EmptyState.js.map +1 -1
  53. package/dist/components/Field/Field.js +31 -33
  54. package/dist/components/Field/Field.js.map +1 -1
  55. package/dist/components/FileDrop/FileDrop.js +14 -14
  56. package/dist/components/FileDrop/FileDrop.js.map +1 -1
  57. package/dist/components/FloatingToolbar/FloatingToolbar.js +7 -6
  58. package/dist/components/FloatingToolbar/FloatingToolbar.js.map +1 -1
  59. package/dist/components/Grid/Grid.d.ts +32 -11
  60. package/dist/components/Grid/Grid.js +68 -46
  61. package/dist/components/Grid/Grid.js.map +1 -1
  62. package/dist/components/Grid/index.d.ts +1 -1
  63. package/dist/components/Heading/Heading.d.ts +4 -2
  64. package/dist/components/Heading/Heading.js.map +1 -1
  65. package/dist/components/IconButton/IconButton.d.ts +16 -1
  66. package/dist/components/IconButton/IconButton.js +14 -10
  67. package/dist/components/IconButton/IconButton.js.map +1 -1
  68. package/dist/components/IconTile/IconTile.d.ts +45 -0
  69. package/dist/components/IconTile/IconTile.js +25 -0
  70. package/dist/components/IconTile/IconTile.js.map +1 -0
  71. package/dist/components/IconTile/index.d.ts +1 -0
  72. package/dist/components/Image/Image.js.map +1 -1
  73. package/dist/components/Inline/Inline.d.ts +3 -3
  74. package/dist/components/Inline/Inline.js +12 -22
  75. package/dist/components/Inline/Inline.js.map +1 -1
  76. package/dist/components/KeyValueEditor/KeyValueEditor.js +37 -36
  77. package/dist/components/KeyValueEditor/KeyValueEditor.js.map +1 -1
  78. package/dist/components/Link/Link.d.ts +9 -1
  79. package/dist/components/Link/Link.js +20 -18
  80. package/dist/components/Link/Link.js.map +1 -1
  81. package/dist/components/List/List.d.ts +73 -0
  82. package/dist/components/List/List.js +64 -0
  83. package/dist/components/List/List.js.map +1 -0
  84. package/dist/components/List/index.d.ts +1 -0
  85. package/dist/components/Notice/Notice.js +12 -11
  86. package/dist/components/Notice/Notice.js.map +1 -1
  87. package/dist/components/OptionList/OptionList.d.ts +69 -0
  88. package/dist/components/OptionList/OptionList.js +75 -0
  89. package/dist/components/OptionList/OptionList.js.map +1 -0
  90. package/dist/components/OptionList/index.d.ts +1 -0
  91. package/dist/components/PageHeader/PageHeader.d.ts +6 -0
  92. package/dist/components/PageHeader/PageHeader.js +27 -27
  93. package/dist/components/PageHeader/PageHeader.js.map +1 -1
  94. package/dist/components/Pagination/Pagination.js +31 -30
  95. package/dist/components/Pagination/Pagination.js.map +1 -1
  96. package/dist/components/QRCode/QRCode.d.ts +56 -0
  97. package/dist/components/QRCode/QRCode.js +48 -0
  98. package/dist/components/QRCode/QRCode.js.map +1 -0
  99. package/dist/components/QRCode/index.d.ts +1 -0
  100. package/dist/components/RadioGroup/RadioGroup.js +32 -24
  101. package/dist/components/RadioGroup/RadioGroup.js.map +1 -1
  102. package/dist/components/Section/Section.d.ts +57 -0
  103. package/dist/components/Section/Section.js +27 -0
  104. package/dist/components/Section/Section.js.map +1 -0
  105. package/dist/components/Section/index.d.ts +1 -0
  106. package/dist/components/SegmentedControl/SegmentedControl.js +12 -12
  107. package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
  108. package/dist/components/Select/Select.js +106 -133
  109. package/dist/components/Select/Select.js.map +1 -1
  110. package/dist/components/Sheet/Sheet.js +12 -7
  111. package/dist/components/Sheet/Sheet.js.map +1 -1
  112. package/dist/components/SideNav/SideNav.js +55 -53
  113. package/dist/components/SideNav/SideNav.js.map +1 -1
  114. package/dist/components/SiteFooter/SiteFooter.d.ts +66 -0
  115. package/dist/components/SiteFooter/SiteFooter.js +80 -0
  116. package/dist/components/SiteFooter/SiteFooter.js.map +1 -0
  117. package/dist/components/SiteFooter/index.d.ts +1 -0
  118. package/dist/components/SiteHeader/SiteHeader.d.ts +78 -0
  119. package/dist/components/SiteHeader/SiteHeader.js +114 -0
  120. package/dist/components/SiteHeader/SiteHeader.js.map +1 -0
  121. package/dist/components/SiteHeader/index.d.ts +1 -0
  122. package/dist/components/SkipLink/SkipLink.d.ts +42 -0
  123. package/dist/components/SkipLink/SkipLink.js +43 -0
  124. package/dist/components/SkipLink/SkipLink.js.map +1 -0
  125. package/dist/components/SkipLink/index.d.ts +1 -0
  126. package/dist/components/SortableList/SortableList.js +13 -13
  127. package/dist/components/SortableList/SortableList.js.map +1 -1
  128. package/dist/components/Stack/Stack.d.ts +16 -7
  129. package/dist/components/Stack/Stack.js +25 -18
  130. package/dist/components/Stack/Stack.js.map +1 -1
  131. package/dist/components/Stack/index.d.ts +1 -1
  132. package/dist/components/Stack/space.d.ts +29 -0
  133. package/dist/components/Stack/space.js +16 -5
  134. package/dist/components/Stack/space.js.map +1 -1
  135. package/dist/components/Stat/Stat.d.ts +88 -0
  136. package/dist/components/Stat/Stat.js +105 -0
  137. package/dist/components/Stat/Stat.js.map +1 -0
  138. package/dist/components/Stat/index.d.ts +1 -0
  139. package/dist/components/Steps/Steps.d.ts +10 -4
  140. package/dist/components/Steps/Steps.js +31 -30
  141. package/dist/components/Steps/Steps.js.map +1 -1
  142. package/dist/components/Switch/Switch.d.ts +4 -4
  143. package/dist/components/Switch/Switch.js +18 -7
  144. package/dist/components/Switch/Switch.js.map +1 -1
  145. package/dist/components/Table/Table.js +11 -12
  146. package/dist/components/Table/Table.js.map +1 -1
  147. package/dist/components/Tabs/Tabs.d.ts +4 -1
  148. package/dist/components/Tabs/Tabs.js +71 -70
  149. package/dist/components/Tabs/Tabs.js.map +1 -1
  150. package/dist/components/TagInput/TagInput.js +76 -97
  151. package/dist/components/TagInput/TagInput.js.map +1 -1
  152. package/dist/components/TextField/TextField.d.ts +4 -0
  153. package/dist/components/TextField/TextField.js +30 -29
  154. package/dist/components/TextField/TextField.js.map +1 -1
  155. package/dist/components/ThemeToggle/ThemeToggle.d.ts +7 -1
  156. package/dist/components/ThemeToggle/ThemeToggle.js +33 -30
  157. package/dist/components/ThemeToggle/ThemeToggle.js.map +1 -1
  158. package/dist/components/Toast/Toast.js +22 -20
  159. package/dist/components/Toast/Toast.js.map +1 -1
  160. package/dist/components/Tooltip/Tooltip.d.ts +6 -1
  161. package/dist/components/Tooltip/Tooltip.js +19 -19
  162. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  163. package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +24 -0
  164. package/dist/components/VisuallyHidden/VisuallyHidden.js +17 -0
  165. package/dist/components/VisuallyHidden/VisuallyHidden.js.map +1 -0
  166. package/dist/components/VisuallyHidden/index.d.ts +1 -0
  167. package/dist/foundations/ChoiceBase/ChoiceBase.js +8 -8
  168. package/dist/foundations/ChoiceBase/ChoiceBase.js.map +1 -1
  169. package/dist/foundations/HiddenValue/HiddenValue.js +5 -5
  170. package/dist/foundations/HiddenValue/HiddenValue.js.map +1 -1
  171. package/dist/foundations/Icon/Icon.d.ts +6 -1
  172. package/dist/foundations/Icon/Icon.js +15 -14
  173. package/dist/foundations/Icon/Icon.js.map +1 -1
  174. package/dist/foundations/image-outcome.d.ts +8 -3
  175. package/dist/foundations/image-outcome.js +12 -8
  176. package/dist/foundations/image-outcome.js.map +1 -1
  177. package/dist/foundations/printing.d.ts +6 -0
  178. package/dist/foundations/printing.js +17 -0
  179. package/dist/foundations/printing.js.map +1 -0
  180. package/dist/foundations/qr.d.ts +42 -0
  181. package/dist/foundations/qr.js +246 -0
  182. package/dist/foundations/qr.js.map +1 -0
  183. package/dist/icons/book-marked.d.ts +2 -0
  184. package/dist/icons/book-marked.js +14 -0
  185. package/dist/icons/book-marked.js.map +1 -0
  186. package/dist/icons/calendar-days.d.ts +2 -0
  187. package/dist/icons/calendar-days.js +24 -0
  188. package/dist/icons/calendar-days.js.map +1 -0
  189. package/dist/icons/check-square.d.ts +2 -0
  190. package/dist/icons/check-square.js +14 -0
  191. package/dist/icons/check-square.js.map +1 -0
  192. package/dist/icons/crescent.d.ts +2 -0
  193. package/dist/icons/crescent.js +14 -0
  194. package/dist/icons/crescent.js.map +1 -0
  195. package/dist/icons/index.d.ts +10 -0
  196. package/dist/icons/index.js +436 -416
  197. package/dist/icons/kaaba.d.ts +2 -0
  198. package/dist/icons/kaaba.js +14 -0
  199. package/dist/icons/kaaba.js.map +1 -0
  200. package/dist/icons/keywords.d.ts +11 -1
  201. package/dist/icons/keywords.js +89 -1
  202. package/dist/icons/keywords.js.map +1 -1
  203. package/dist/icons/list-tree.d.ts +2 -0
  204. package/dist/icons/list-tree.js +14 -0
  205. package/dist/icons/list-tree.js.map +1 -0
  206. package/dist/icons/mosque.d.ts +2 -0
  207. package/dist/icons/mosque.js +14 -0
  208. package/dist/icons/mosque.js.map +1 -0
  209. package/dist/icons/prayer-beads.d.ts +2 -0
  210. package/dist/icons/prayer-beads.js +67 -0
  211. package/dist/icons/prayer-beads.js.map +1 -0
  212. package/dist/icons/qr-code.d.ts +2 -0
  213. package/dist/icons/qr-code.js +38 -0
  214. package/dist/icons/qr-code.js.map +1 -0
  215. package/dist/icons/refresh-cw.d.ts +2 -0
  216. package/dist/icons/refresh-cw.js +14 -0
  217. package/dist/icons/refresh-cw.js.map +1 -0
  218. package/dist/icons/types.d.ts +1 -1
  219. package/dist/icons/types.js +2 -1
  220. package/dist/icons/types.js.map +1 -1
  221. package/dist/index.d.ts +16 -2
  222. package/dist/index.js +274 -241
  223. package/dist/styles/announcer.css +1 -1
  224. package/dist/styles/app-shell.css +1 -1
  225. package/dist/styles/avatar.css +1 -1
  226. package/dist/styles/base.css +1 -1
  227. package/dist/styles/button.css +1 -1
  228. package/dist/styles/calendar.css +1 -1
  229. package/dist/styles/card.css +1 -1
  230. package/dist/styles/checkbox.css +1 -1
  231. package/dist/styles/choice-base.css +1 -0
  232. package/dist/styles/choice.css +1 -1
  233. package/dist/styles/color-field.css +1 -1
  234. package/dist/styles/combobox.css +1 -1
  235. package/dist/styles/copy-button.css +1 -1
  236. package/dist/styles/date-field.css +1 -1
  237. package/dist/styles/device-frame.css +1 -0
  238. package/dist/styles/dialog.css +1 -1
  239. package/dist/styles/disclosure.css +1 -1
  240. package/dist/styles/field.css +1 -1
  241. package/dist/styles/file-drop.css +1 -1
  242. package/dist/styles/floating-toolbar.css +1 -1
  243. package/dist/styles/generated-css.d.ts +1 -1
  244. package/dist/styles/generated-css.js +1 -1
  245. package/dist/styles/generated-css.js.map +1 -1
  246. package/dist/styles/grid.css +1 -1
  247. package/dist/styles/heading.css +1 -1
  248. package/dist/styles/icon-tile.css +1 -0
  249. package/dist/styles/icon.css +1 -1
  250. package/dist/styles/inline.css +1 -0
  251. package/dist/styles/key-value-editor.css +1 -1
  252. package/dist/styles/link.css +1 -1
  253. package/dist/styles/list.css +1 -0
  254. package/dist/styles/manifest.json +715 -0
  255. package/dist/styles/notice.css +1 -1
  256. package/dist/styles/number-field.css +1 -1
  257. package/dist/styles/option-list.css +1 -0
  258. package/dist/styles/pagination.css +1 -1
  259. package/dist/styles/qr-code.css +1 -0
  260. package/dist/styles/radio-group.css +1 -1
  261. package/dist/styles/section.css +1 -0
  262. package/dist/styles/segmented-control.css +1 -1
  263. package/dist/styles/select.css +1 -1
  264. package/dist/styles/sheet.css +1 -1
  265. package/dist/styles/side-nav.css +1 -1
  266. package/dist/styles/site-footer.css +1 -0
  267. package/dist/styles/site-header.css +1 -0
  268. package/dist/styles/skip-link.css +1 -0
  269. package/dist/styles/sortable-list.css +1 -1
  270. package/dist/styles/stack.css +1 -1
  271. package/dist/styles/stat.css +1 -0
  272. package/dist/styles/steps.css +1 -1
  273. package/dist/styles/switch.css +1 -0
  274. package/dist/styles/table.css +1 -1
  275. package/dist/styles/tabs.css +1 -1
  276. package/dist/styles/tag-input.css +1 -1
  277. package/dist/styles/text-field.css +1 -1
  278. package/dist/styles/time-field.css +1 -1
  279. package/dist/styles/toast.css +1 -1
  280. package/dist/styles/visually-hidden.css +1 -0
  281. package/dist/styles.css +1 -1
  282. package/dist/tokens/create-theme.js +137 -108
  283. package/dist/tokens/create-theme.js.map +1 -1
  284. package/package.json +6 -1
  285. package/dist/components/Checkbox/ChoiceRow.d.ts +0 -39
  286. package/dist/components/Checkbox/ChoiceRow.js +0 -58
  287. package/dist/components/Checkbox/ChoiceRow.js.map +0 -1
  288. package/dist/styles/hidden-value.css +0 -1
  289. package/dist/styles/iconbutton.css +0 -1
  290. package/dist/styles/search-field.css +0 -1
@@ -0,0 +1,88 @@
1
+ import { type CSSProperties, type MouseEventHandler, type ReactNode } from "react";
2
+ import type { IconData } from "../../icons/types.js";
3
+ import type { Size, Tone } from "../../tokens/schema.js";
4
+ export interface StatTokens {
5
+ /** Space between the icon tile and the text. */
6
+ gap: string;
7
+ /** Colour of the label and the description. */
8
+ labelColor: string;
9
+ /** Font family of the value. Falls back to the display font. */
10
+ valueFont: string;
11
+ /** Font weight of the value. */
12
+ valueWeight: string;
13
+ /** Font size of the value at `size="sm"`. */
14
+ valueSizeSm: string;
15
+ /** Font size of the value at `size="md"`. */
16
+ valueSizeMd: string;
17
+ /** Font size of the value at `size="lg"`. */
18
+ valueSizeLg: string;
19
+ }
20
+ declare module "../../tokens/schema.js" {
21
+ interface ComponentTokens {
22
+ stat: StatTokens;
23
+ }
24
+ }
25
+ export type StatDirection = "up" | "down" | "flat";
26
+ export interface StatDelta {
27
+ /** The change as shown, e.g. "12%" or "+£1,200". */
28
+ value: string;
29
+ /**
30
+ * Which way it moved: picks the arrow and the spoken word. Default: "up" when `value` starts with "+", "down" when
31
+ * it starts with "-" or "−", otherwise "flat".
32
+ */
33
+ direction?: StatDirection | undefined;
34
+ /**
35
+ * Colour of the change. Default: "success" for up, "danger" for down, "neutral" for flat. Set it when down is good
36
+ * news (costs, errors, load time).
37
+ */
38
+ tone?: Tone | undefined;
39
+ }
40
+ export interface StatLabels {
41
+ /** Spoken for a rise, from the delta's value without its sign. Default "up 12%". */
42
+ up: (value: string) => string;
43
+ /** Spoken for a fall. Default "down 12%". */
44
+ down: (value: string) => string;
45
+ /** Spoken when nothing moved. Default "unchanged at 0%". */
46
+ flat: (value: string) => string;
47
+ }
48
+ export interface StatProps {
49
+ /** What is measured ("Revenue"). Read before the value. */
50
+ label: ReactNode;
51
+ /** The figure ("£12,400"). Digits are tabular, so stats in a row line up. */
52
+ value: ReactNode;
53
+ /** A unit written after the value, smaller ("ms", "users"). */
54
+ unit?: ReactNode;
55
+ /** A line under the value: what the figure covers ("Last 30 days") or how it compares ("vs last month"). */
56
+ description?: ReactNode;
57
+ /** The change since last time: an arrow, the value in a tone, and a spoken direction ("up 12%"). */
58
+ delta?: StatDelta | undefined;
59
+ /** An icon on an IconTile at the start of the stat. Decorative: the label names the stat. */
60
+ icon?: IconData | undefined;
61
+ /** Colour of the icon tile. Default "accent". */
62
+ iconTone?: Tone;
63
+ /** Size of the value, the text, the icon tile and the padding. Default "md". */
64
+ size?: Size;
65
+ /** `start`: icon beside the text, text at the start. `center`: icon above, everything centred. Default "start". */
66
+ align?: "start" | "center";
67
+ /** The card's look, as Card's: `surface` raised, `outline` border only, `soft` tinted. Default "surface". */
68
+ variant?: "surface" | "outline" | "soft";
69
+ /** Element of a static stat: `li` inside a list of stats, `article` for a stat that stands alone. Default "div". */
70
+ as?: "div" | "li" | "article";
71
+ /** Makes the whole stat a link to the figure's detail (through Card, so unsafe schemes are not linked). */
72
+ href?: string | undefined;
73
+ /** With `href`: where it opens, e.g. `_blank`. */
74
+ target?: string | undefined;
75
+ /** With `href`: called when the link is followed, before the browser navigates. */
76
+ onClick?: MouseEventHandler<HTMLElement> | undefined;
77
+ /** Replace the built-in English words spoken with the delta. */
78
+ labels?: Partial<StatLabels>;
79
+ /** Added to the root element, for layout. */
80
+ className?: string;
81
+ /** Layout only. Restyle through --cy-stat-* tokens. */
82
+ style?: CSSProperties;
83
+ }
84
+ /**
85
+ * A figure with its label (a KPI tile): the value, an optional unit, change and description, on a Card. The label and
86
+ * the figures are a description list, so they are read as "Revenue, £12,400, up 12%".
87
+ */
88
+ export declare const Stat: import("react").ForwardRefExoticComponent<StatProps & import("react").RefAttributes<HTMLElement>>;
@@ -0,0 +1,105 @@
1
+ "use client";
2
+ import { Icon as E } from "../../foundations/Icon/Icon.js";
3
+ import { Card as I } from "../Card/Card.js";
4
+ import { minus as L } from "../../icons/minus.js";
5
+ import { IconTile as T } from "../IconTile/IconTile.js";
6
+ import { arrowDown as $ } from "../../icons/arrow-down.js";
7
+ import { arrowUp as O } from "../../icons/arrow-up.js";
8
+ import { forwardRef as R } from "react";
9
+ import { jsx as a, jsxs as c } from "react/jsx-runtime";
10
+ var b = {
11
+ up: (t) => `up ${t}`,
12
+ down: (t) => `down ${t}`,
13
+ flat: (t) => `unchanged at ${t}`
14
+ }, j = {
15
+ up: O,
16
+ down: $,
17
+ flat: L
18
+ }, G = {
19
+ up: "success",
20
+ down: "danger",
21
+ flat: "neutral"
22
+ }, U = /^[+\-\u2212]\s*/, _ = {
23
+ sm: "sm",
24
+ md: "md",
25
+ lg: "lg"
26
+ };
27
+ function B(t) {
28
+ const s = t.trim()[0];
29
+ return s === "+" ? "up" : s === "-" || s === "−" ? "down" : "flat";
30
+ }
31
+ var K = R(function({ label: s, value: N, unit: o, description: l, delta: r, icon: m, iconTone: h = "accent", size: n = "md", align: w = "start", variant: g = "surface", as: e = "div", href: d, target: u, onClick: p, labels: A, className: v, style: f }, S) {
32
+ const D = {
33
+ ...b,
34
+ ...A
35
+ }, i = r ? r.direction ?? B(r.value) : "flat", x = e, y = /* @__PURE__ */ a(I, {
36
+ ref: S,
37
+ as: e,
38
+ variant: g,
39
+ padding: _[n],
40
+ ...d !== void 0 && {
41
+ href: d,
42
+ ...u !== void 0 && { target: u },
43
+ ...p !== void 0 && { onClick: p }
44
+ },
45
+ className: v ? `cy-stat ${v}` : "cy-stat",
46
+ ...f !== void 0 && { style: f },
47
+ children: /* @__PURE__ */ c("div", {
48
+ className: "cy-stat-body cy-reset",
49
+ "data-size": n,
50
+ "data-align": w,
51
+ children: [m && /* @__PURE__ */ a(T, {
52
+ icon: m,
53
+ tone: h,
54
+ size: n
55
+ }), /* @__PURE__ */ c("dl", {
56
+ className: "cy-stat-list cy-reset",
57
+ children: [
58
+ /* @__PURE__ */ a("dt", {
59
+ className: "cy-stat-label",
60
+ children: s
61
+ }),
62
+ /* @__PURE__ */ c("dd", {
63
+ className: "cy-stat-value",
64
+ children: [N, o != null && /* @__PURE__ */ a("span", {
65
+ className: "cy-stat-unit",
66
+ children: o
67
+ })]
68
+ }),
69
+ r && /* @__PURE__ */ c("dd", {
70
+ className: "cy-stat-delta",
71
+ "data-tone": r.tone ?? G[i],
72
+ children: [
73
+ /* @__PURE__ */ a(E, {
74
+ icon: j[i],
75
+ size: "sm"
76
+ }),
77
+ /* @__PURE__ */ a("span", {
78
+ className: "cy-reset",
79
+ "aria-hidden": "true",
80
+ children: r.value
81
+ }),
82
+ /* @__PURE__ */ a("span", {
83
+ className: "cy-visually-hidden",
84
+ children: D[i](r.value.trim().replace(U, ""))
85
+ })
86
+ ]
87
+ }),
88
+ l != null && /* @__PURE__ */ a("dd", {
89
+ className: "cy-stat-description",
90
+ children: l
91
+ })
92
+ ]
93
+ })]
94
+ })
95
+ });
96
+ return d !== void 0 && e !== "div" ? /* @__PURE__ */ a(x, {
97
+ className: "cy-stat-item cy-reset",
98
+ children: y
99
+ }) : y;
100
+ });
101
+ export {
102
+ K as Stat
103
+ };
104
+
105
+ //# sourceMappingURL=Stat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Stat.js","names":["Icon","Card","minus","IconTile","arrowDown","arrowUp","forwardRef","jsx","jsxs","DEFAULT_LABELS","value","ARROWS","DELTA_TONES","SIGN","PADDING","directionOf","sign","Stat","label","unit","description","delta","icon","iconTone","size","align","variant","as","href","target","onClick","labels","className","style","ref","text","direction","As","card"],"sources":["../../../src/components/Stat/Stat.tsx"],"sourcesContent":["import { type CSSProperties, forwardRef, type MouseEventHandler, type ReactNode } from \"react\";\nimport { Icon } from \"../../foundations/Icon/Icon.js\";\nimport { arrowDown } from \"../../icons/arrow-down.js\";\nimport { arrowUp } from \"../../icons/arrow-up.js\";\nimport { minus } from \"../../icons/minus.js\";\nimport type { IconData } from \"../../icons/types.js\";\nimport type { Size, Tone } from \"../../tokens/schema.js\";\nimport { Card } from \"../Card/Card.js\";\nimport { IconTile } from \"../IconTile/IconTile.js\";\n\nexport interface StatTokens {\n /** Space between the icon tile and the text. */\n gap: string;\n /** Colour of the label and the description. */\n labelColor: string;\n /** Font family of the value. Falls back to the display font. */\n valueFont: string;\n /** Font weight of the value. */\n valueWeight: string;\n /** Font size of the value at `size=\"sm\"`. */\n valueSizeSm: string;\n /** Font size of the value at `size=\"md\"`. */\n valueSizeMd: string;\n /** Font size of the value at `size=\"lg\"`. */\n valueSizeLg: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n stat: StatTokens;\n }\n}\n\nexport type StatDirection = \"up\" | \"down\" | \"flat\";\n\nexport interface StatDelta {\n /** The change as shown, e.g. \"12%\" or \"+£1,200\". */\n value: string;\n /**\n * Which way it moved: picks the arrow and the spoken word. Default: \"up\" when `value` starts with \"+\", \"down\" when\n * it starts with \"-\" or \"−\", otherwise \"flat\".\n */\n direction?: StatDirection | undefined;\n /**\n * Colour of the change. Default: \"success\" for up, \"danger\" for down, \"neutral\" for flat. Set it when down is good\n * news (costs, errors, load time).\n */\n tone?: Tone | undefined;\n}\n\nexport interface StatLabels {\n /** Spoken for a rise, from the delta's value without its sign. Default \"up 12%\". */\n up: (value: string) => string;\n /** Spoken for a fall. Default \"down 12%\". */\n down: (value: string) => string;\n /** Spoken when nothing moved. Default \"unchanged at 0%\". */\n flat: (value: string) => string;\n}\n\nexport interface StatProps {\n /** What is measured (\"Revenue\"). Read before the value. */\n label: ReactNode;\n /** The figure (\"£12,400\"). Digits are tabular, so stats in a row line up. */\n value: ReactNode;\n /** A unit written after the value, smaller (\"ms\", \"users\"). */\n unit?: ReactNode;\n /** A line under the value: what the figure covers (\"Last 30 days\") or how it compares (\"vs last month\"). */\n description?: ReactNode;\n /** The change since last time: an arrow, the value in a tone, and a spoken direction (\"up 12%\"). */\n delta?: StatDelta | undefined;\n /** An icon on an IconTile at the start of the stat. Decorative: the label names the stat. */\n icon?: IconData | undefined;\n /** Colour of the icon tile. Default \"accent\". */\n iconTone?: Tone;\n /** Size of the value, the text, the icon tile and the padding. Default \"md\". */\n size?: Size;\n /** `start`: icon beside the text, text at the start. `center`: icon above, everything centred. Default \"start\". */\n align?: \"start\" | \"center\";\n /** The card's look, as Card's: `surface` raised, `outline` border only, `soft` tinted. Default \"surface\". */\n variant?: \"surface\" | \"outline\" | \"soft\";\n /** Element of a static stat: `li` inside a list of stats, `article` for a stat that stands alone. Default \"div\". */\n as?: \"div\" | \"li\" | \"article\";\n /** Makes the whole stat a link to the figure's detail (through Card, so unsafe schemes are not linked). */\n href?: string | undefined;\n /** With `href`: where it opens, e.g. `_blank`. */\n target?: string | undefined;\n /** With `href`: called when the link is followed, before the browser navigates. */\n onClick?: MouseEventHandler<HTMLElement> | undefined;\n /** Replace the built-in English words spoken with the delta. */\n labels?: Partial<StatLabels>;\n /** Added to the root element, for layout. */\n className?: string;\n /** Layout only. Restyle through --cy-stat-* tokens. */\n style?: CSSProperties;\n}\n\nconst DEFAULT_LABELS: StatLabels = {\n up: (value) => `up ${value}`,\n down: (value) => `down ${value}`,\n flat: (value) => `unchanged at ${value}`,\n};\nconst ARROWS = { up: arrowUp, down: arrowDown, flat: minus };\nconst DELTA_TONES = { up: \"success\", down: \"danger\", flat: \"neutral\" } as const;\n/** A leading plus or minus: the spoken word already says which way. */\nconst SIGN = /^[+\\-\\u2212]\\s*/;\nconst PADDING = { sm: \"sm\", md: \"md\", lg: \"lg\" } as const;\n\n/** The direction a delta's value implies when none is given. */\nfunction directionOf(value: string): StatDirection {\n const sign = value.trim()[0];\n return sign === \"+\" ? \"up\" : sign === \"-\" || sign === \"−\" ? \"down\" : \"flat\";\n}\n\n/**\n * A figure with its label (a KPI tile): the value, an optional unit, change and description, on a Card. The label and\n * the figures are a description list, so they are read as \"Revenue, £12,400, up 12%\".\n */\nexport const Stat = forwardRef<HTMLElement, StatProps>(function Stat(\n {\n label,\n value,\n unit,\n description,\n delta,\n icon,\n iconTone = \"accent\",\n size = \"md\",\n align = \"start\",\n variant = \"surface\",\n as = \"div\",\n href,\n target,\n onClick,\n labels,\n className,\n style,\n },\n ref,\n) {\n const text = { ...DEFAULT_LABELS, ...labels };\n const direction = delta ? (delta.direction ?? directionOf(delta.value)) : \"flat\";\n const As = as;\n const card = (\n <Card\n ref={ref}\n as={as}\n variant={variant}\n padding={PADDING[size]}\n {...(href !== undefined && {\n href,\n ...(target !== undefined && { target }),\n ...(onClick !== undefined && { onClick }),\n })}\n className={className ? `cy-stat ${className}` : \"cy-stat\"}\n {...(style !== undefined && { style })}\n >\n <div className=\"cy-stat-body cy-reset\" data-size={size} data-align={align}>\n {icon && <IconTile icon={icon} tone={iconTone} size={size} />}\n <dl className=\"cy-stat-list cy-reset\">\n <dt className=\"cy-stat-label\">{label}</dt>\n <dd className=\"cy-stat-value\">\n {value}\n {unit != null && <span className=\"cy-stat-unit\">{unit}</span>}\n </dd>\n {delta && (\n <dd className=\"cy-stat-delta\" data-tone={delta.tone ?? DELTA_TONES[direction]}>\n <Icon icon={ARROWS[direction]} size=\"sm\" />\n <span className=\"cy-reset\" aria-hidden=\"true\">\n {delta.value}\n </span>\n <span className=\"cy-visually-hidden\">\n {text[direction](delta.value.trim().replace(SIGN, \"\"))}\n </span>\n </dd>\n )}\n {description != null && <dd className=\"cy-stat-description\">{description}</dd>}\n </dl>\n </div>\n </Card>\n );\n // A linked stat in a list keeps its list item: the link goes inside it.\n return href !== undefined && as !== \"div\" ? <As className=\"cy-stat-item cy-reset\">{card}</As> : card;\n});\n"],"mappings":";;;;;;;;;AAgGA,IAAMS,IAA6B;AAAA,EACjC,IAAA,CAAKC,MAAU,MAAMA,CAAA;AAAA,EACrB,MAAA,CAAOA,MAAU,QAAQA,CAAA;AAAA,EACzB,MAAA,CAAOA,MAAU,gBAAgBA,CAAA;AACnC,GACMC,IAAS;AAAA,EAAE,IAAIN;AAAA,EAAS,MAAMD;AAAA,EAAW,MAAMF;AAAM,GACrDU,IAAc;AAAA,EAAE,IAAI;AAAA,EAAW,MAAM;AAAA,EAAU,MAAM;AAAU,GAE/DC,IAAO,mBACPC,IAAU;AAAA,EAAE,IAAI;AAAA,EAAM,IAAI;AAAA,EAAM,IAAI;AAAK;AAG/C,SAASC,EAAYL,GAA8B;AACjD,QAAMM,IAAON,EAAM,KAAK,EAAE,CAAA;AAC1B,SAAOM,MAAS,MAAM,OAAOA,MAAS,OAAOA,MAAS,MAAM,SAAS;AACvE;AAMA,IAAaC,IAAOX,EAAmC,SACrD,EACE,OAAAY,GACA,OAAAR,GACA,MAAAS,GACA,aAAAC,GACA,OAAAC,GACA,MAAAC,GACA,UAAAC,IAAW,UACX,MAAAC,IAAO,MACP,OAAAC,IAAQ,SACR,SAAAC,IAAU,WACV,IAAAC,IAAK,OACL,MAAAC,GACA,QAAAC,GACA,SAAAC,GACA,QAAAC,GACA,WAAAC,GACA,OAAAC,EAAA,GAEFC,GACA;AACA,QAAMC,IAAO;AAAA,IAAE,GAAG1B;AAAA,IAAgB,GAAGsB;AAAA,EAAO,GACtCK,IAAYf,IAASA,EAAM,aAAaN,EAAYM,EAAM,KAAK,IAAK,QACpEgB,IAAKV,GACLW,IACJ,gBAAA/B,EAACN,GAAD;AAAA,IACO,KAAAiC;AAAA,IACD,IAAAP;AAAA,IACK,SAAAD;AAAA,IACT,SAASZ,EAAQU,CAAA;AAAA,IACjB,GAAKI,MAAS,UAAa;AAAA,MACzB,MAAAA;AAAA,MACA,GAAIC,MAAW,UAAa,EAAE,QAAAA,EAAO;AAAA,MACrC,GAAIC,MAAY,UAAa,EAAE,SAAAA,EAAQ;AAAA,IACzC;AAAA,IACA,WAAWE,IAAY,WAAWA,CAAA,KAAc;AAAA,IAChD,GAAKC,MAAU,UAAa,EAAE,OAAAA,EAAM;AAAA,IAEpC,UAAA,gBAAAzB,EAAC,OAAD;AAAA,MAAK,WAAU;AAAA,MAAwB,aAAWgB;AAAA,MAAM,cAAYC;AAAA,MAApE,UAAA,CACGH,KAAQ,gBAAAf,EAACJ,GAAD;AAAA,QAAgB,MAAAmB;AAAA,QAAM,MAAMC;AAAA,QAAgB,MAAAC;AAAA,MAAO,CAAA,GAC5D,gBAAAhB,EAAC,MAAD;AAAA,QAAI,WAAU;AAAA,QAAd,UAAA;AAAA,UACE,gBAAAD,EAAC,MAAD;AAAA,YAAI,WAAU;AAAA,YAAiB,UAAAW;AAAA,UAAU,CAAA;AAAA,UACzC,gBAAAV,EAAC,MAAD;AAAA,YAAI,WAAU;AAAA,YAAd,UAAA,CACGE,GACAS,KAAQ,QAAQ,gBAAAZ,EAAC,QAAD;AAAA,cAAM,WAAU;AAAA,cAAgB,UAAAY;AAAA,YAAW,CAAA,CAC1D;AAAA,U;A,UACHE,KACC,gBAAAb,EAAC,MAAD;AAAA,YAAI,WAAU;AAAA,YAAgB,aAAWa,EAAM,QAAQT,EAAYwB,CAAA;AAAA,YAAnE,UAAA;AAAA,cACE,gBAAA7B,EAACP,GAAD;AAAA,gBAAM,MAAMW,EAAOyB,CAAA;AAAA,gBAAY,MAAK;AAAA,cAAM,CAAA;AAAA,cAC1C,gBAAA7B,EAAC,QAAD;AAAA,gBAAM,WAAU;AAAA,gBAAW,eAAY;AAAA,gBACpC,UAAAc,EAAM;AAAA,cACH,CAAA;AAAA,cACN,gBAAAd,EAAC,QAAD;AAAA,gBAAM,WAAU;AAAA,gBACb,UAAA4B,EAAKC,CAAA,EAAWf,EAAM,MAAM,KAAK,EAAE,QAAQR,GAAM,EAAE,CAAC;AAAA,cACjD,CAAA;AAAA,YACJ;AAAA,U;A,UAELO,KAAe,QAAQ,gBAAAb,EAAC,MAAD;AAAA,YAAI,WAAU;AAAA,YAAuB,UAAAa;AAAA,UAAgB,CAAA;AAAA,QAC3E;AAAA,MACD,CAAA,CAAA;AAAA,I;A,EACD,CAAA;AAGR,SAAOQ,MAAS,UAAaD,MAAO,QAAQ,gBAAApB,EAAC8B,GAAD;AAAA,IAAI,WAAU;AAAA,IAAyB,UAAAC;AAAA,EAAS,CAAA,IAAIA;AAClG,CAAC"}
@@ -0,0 +1 @@
1
+ export { Stat, type StatDelta, type StatDirection, type StatLabels, type StatProps, type StatTokens, } from "./Stat.js";
@@ -25,7 +25,7 @@ export interface StepItem {
25
25
  disabled?: boolean;
26
26
  }
27
27
  export interface StepsLabels {
28
- /** Accessible name of the list. Default: "Progress". */
28
+ /** Accessible name of the list. Default: "Progress", or "Steps" for a how-to (no `current`). */
29
29
  list: string;
30
30
  /** Read after each step's label. Defaults: "completed", "current step", "not started", "has a problem". */
31
31
  complete: string;
@@ -36,8 +36,11 @@ export interface StepsLabels {
36
36
  export interface StepsProps {
37
37
  /** The steps, in order. */
38
38
  steps: StepItem[];
39
- /** `id` of the step the person is on. Steps before it are complete, steps after it upcoming. */
40
- current: string;
39
+ /**
40
+ * `id` of the step the person is on. Steps before it are complete, steps after it upcoming. Leave it out for a
41
+ * numbered how-to (steps to follow, not progress): every step is numbered alike and no status is read.
42
+ */
43
+ current?: string | undefined;
41
44
  /** Lays the steps out in a row or in a column. Default "horizontal". */
42
45
  orientation?: "horizontal" | "vertical";
43
46
  /** Makes steps buttons that go to that step. Leave it out for a read-only progress display. */
@@ -51,5 +54,8 @@ export interface StepsProps {
51
54
  /** Layout only. Restyle through --cy-steps-* tokens. */
52
55
  style?: CSSProperties;
53
56
  }
54
- /** Progress through an ordered flow (a setup wizard, a checkout): numbered steps with the current one marked. */
57
+ /**
58
+ * Progress through an ordered flow (a setup wizard, a checkout): numbered steps with the current one marked. Without
59
+ * `current`, a numbered how-to.
60
+ */
55
61
  export declare function Steps({ steps, current, orientation, onStepSelect, size, labels, className, style, }: StepsProps): import("react").JSX.Element;
@@ -1,39 +1,40 @@
1
1
  "use client";
2
- import { ButtonBase as b } from "../../foundations/ButtonBase/ButtonBase.js";
3
- import { Icon as p } from "../../foundations/Icon/Icon.js";
2
+ import { ButtonBase as v } from "../../foundations/ButtonBase/ButtonBase.js";
3
+ import { Icon as u } from "../../foundations/Icon/Icon.js";
4
4
  import { check as x } from "../../icons/check.js";
5
5
  import { alert as g } from "../../icons/alert.js";
6
- import { Fragment as v, jsx as s, jsxs as i } from "react/jsx-runtime";
7
- var z = {
6
+ import { Fragment as z, jsx as s, jsxs as o } from "react/jsx-runtime";
7
+ var k = {
8
8
  list: "Progress",
9
9
  complete: "completed",
10
10
  current: "current step",
11
11
  upcoming: "not started",
12
12
  error: "has a problem"
13
13
  };
14
- function C({ steps: a, current: u, orientation: y = "horizontal", onStepSelect: l, size: h = "md", labels: N, className: o, style: f }) {
15
- const d = {
16
- ...z,
17
- ...N
18
- }, r = a.findIndex((e) => e.id === u);
14
+ function E({ steps: c, current: l, orientation: h = "horizontal", onStepSelect: d, size: N = "md", labels: f, className: m, style: b }) {
15
+ const i = l === void 0, p = {
16
+ ...k,
17
+ ...i ? { list: "Steps" } : {},
18
+ ...f
19
+ }, a = i ? -1 : c.findIndex((e) => e.id === l);
19
20
  return /* @__PURE__ */ s("ol", {
20
- className: o ? `cy-steps ${o}` : "cy-steps",
21
- "aria-label": d.list,
22
- "data-orientation": y,
23
- "data-size": h,
24
- style: f,
25
- children: a.map((e, t) => {
26
- const c = e.status ?? (t === r ? "current" : r >= 0 && t < r ? "complete" : "upcoming"), n = t === r, m = /* @__PURE__ */ i(v, { children: [/* @__PURE__ */ s("span", {
21
+ className: m ? `cy-steps ${m}` : "cy-steps",
22
+ "aria-label": p.list,
23
+ "data-orientation": h,
24
+ "data-size": N,
25
+ style: b,
26
+ children: c.map((e, t) => {
27
+ const r = e.status ?? (i ? void 0 : t === a ? "current" : a >= 0 && t < a ? "complete" : "upcoming"), n = t === a, y = /* @__PURE__ */ o(z, { children: [/* @__PURE__ */ s("span", {
27
28
  className: "cy-steps-marker cy-reset",
28
29
  "aria-hidden": "true",
29
- children: c === "complete" ? /* @__PURE__ */ s(p, {
30
+ children: r === "complete" ? /* @__PURE__ */ s(u, {
30
31
  icon: x,
31
32
  size: "sm"
32
- }) : c === "error" ? /* @__PURE__ */ s(p, {
33
+ }) : r === "error" ? /* @__PURE__ */ s(u, {
33
34
  icon: g,
34
35
  size: "sm"
35
36
  }) : t + 1
36
- }), /* @__PURE__ */ i("span", {
37
+ }), /* @__PURE__ */ o("span", {
37
38
  className: "cy-steps-text cy-reset",
38
39
  children: [
39
40
  /* @__PURE__ */ s("span", {
@@ -44,28 +45,28 @@ function C({ steps: a, current: u, orientation: y = "horizontal", onStepSelect:
44
45
  className: "cy-steps-description cy-reset",
45
46
  children: e.description
46
47
  }),
47
- /* @__PURE__ */ s("span", {
48
- className: "cy-steps-hidden",
49
- children: `, ${d[c]}`
48
+ r && /* @__PURE__ */ s("span", {
49
+ className: "cy-visually-hidden",
50
+ children: `, ${p[r]}`
50
51
  })
51
52
  ]
52
53
  })] });
53
- return /* @__PURE__ */ i("li", {
54
+ return /* @__PURE__ */ o("li", {
54
55
  className: "cy-steps-item cy-reset",
55
- "data-status": c,
56
- children: [l ? /* @__PURE__ */ s(b, {
56
+ "data-status": r ?? "step",
57
+ children: [d ? /* @__PURE__ */ s(v, {
57
58
  className: "cy-steps-step cy-reset",
58
59
  "aria-current": n ? "step" : void 0,
59
60
  "aria-disabled": e.disabled || void 0,
60
61
  onClick: () => {
61
- !e.disabled && !n && l(e.id);
62
+ !e.disabled && !n && d(e.id);
62
63
  },
63
- children: m
64
+ children: y
64
65
  }) : /* @__PURE__ */ s("span", {
65
66
  className: "cy-steps-step cy-reset",
66
67
  "aria-current": n ? "step" : void 0,
67
- children: m
68
- }), t < a.length - 1 && /* @__PURE__ */ s("span", {
68
+ children: y
69
+ }), t < c.length - 1 && /* @__PURE__ */ s("span", {
69
70
  className: "cy-steps-line cy-reset",
70
71
  "aria-hidden": "true"
71
72
  })]
@@ -74,7 +75,7 @@ function C({ steps: a, current: u, orientation: y = "horizontal", onStepSelect:
74
75
  });
75
76
  }
76
77
  export {
77
- C as Steps
78
+ E as Steps
78
79
  };
79
80
 
80
81
  //# sourceMappingURL=Steps.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Steps.js","names":["_Fragment","ButtonBase","Icon","check","alert","Fragment","jsx","jsxs","DEFAULT_LABELS","Steps","steps","current","orientation","onStepSelect","size","labels","className","style","text","at","s","step","i","status","isCurrent","content"],"sources":["../../../src/components/Steps/Steps.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode } from \"react\";\nimport { ButtonBase } from \"../../foundations/ButtonBase/ButtonBase.js\";\nimport { Icon } from \"../../foundations/Icon/Icon.js\";\nimport { alert } from \"../../icons/alert.js\";\nimport { check } from \"../../icons/check.js\";\nimport type { Size } from \"../../tokens/schema.js\";\n\nexport interface StepsTokens {\n /** Diameter of the numbered marker. */\n markerSize: string;\n /** Thickness of the line between steps. */\n lineWidth: string;\n /** Space between steps. */\n gap: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n steps: StepsTokens;\n }\n}\n\nexport type StepStatus = \"complete\" | \"current\" | \"upcoming\" | \"error\";\n\nexport interface StepItem {\n id: string;\n label: ReactNode;\n /** A second line under the label. */\n description?: ReactNode;\n /** Overrides the status worked out from `current`: mark a step `error`, or `complete` out of order. */\n status?: \"complete\" | \"error\" | undefined;\n /** With `onStepSelect`: this step cannot be chosen. */\n disabled?: boolean;\n}\n\nexport interface StepsLabels {\n /** Accessible name of the list. Default: \"Progress\". */\n list: string;\n /** Read after each step's label. Defaults: \"completed\", \"current step\", \"not started\", \"has a problem\". */\n complete: string;\n current: string;\n upcoming: string;\n error: string;\n}\n\nexport interface StepsProps {\n /** The steps, in order. */\n steps: StepItem[];\n /** `id` of the step the person is on. Steps before it are complete, steps after it upcoming. */\n current: string;\n /** Lays the steps out in a row or in a column. Default \"horizontal\". */\n orientation?: \"horizontal\" | \"vertical\";\n /** Makes steps buttons that go to that step. Leave it out for a read-only progress display. */\n onStepSelect?: (id: string) => void;\n /** Text size of labels and markers. */\n size?: Size;\n /** Replace the built-in English text: the list's name and the status read after each step. */\n labels?: Partial<StepsLabels>;\n /** Added to the root element, for layout. */\n className?: string;\n /** Layout only. Restyle through --cy-steps-* tokens. */\n style?: CSSProperties;\n}\n\nconst DEFAULT_LABELS: StepsLabels = {\n list: \"Progress\",\n complete: \"completed\",\n current: \"current step\",\n upcoming: \"not started\",\n error: \"has a problem\",\n};\n\n/** Progress through an ordered flow (a setup wizard, a checkout): numbered steps with the current one marked. */\nexport function Steps({\n steps,\n current,\n orientation = \"horizontal\",\n onStepSelect,\n size = \"md\",\n labels,\n className,\n style,\n}: StepsProps) {\n const text = { ...DEFAULT_LABELS, ...labels };\n const at = steps.findIndex((s) => s.id === current);\n return (\n <ol\n className={className ? `cy-steps ${className}` : \"cy-steps\"}\n aria-label={text.list}\n data-orientation={orientation}\n data-size={size}\n style={style}\n >\n {steps.map((step, i) => {\n const status: StepStatus =\n step.status ?? (i === at ? \"current\" : at >= 0 && i < at ? \"complete\" : \"upcoming\");\n const isCurrent = i === at;\n const content = (\n <>\n <span className=\"cy-steps-marker cy-reset\" aria-hidden=\"true\">\n {status === \"complete\" ? (\n <Icon icon={check} size=\"sm\" />\n ) : status === \"error\" ? (\n <Icon icon={alert} size=\"sm\" />\n ) : (\n i + 1\n )}\n </span>\n <span className=\"cy-steps-text cy-reset\">\n <span className=\"cy-steps-label cy-reset\">{step.label}</span>\n {step.description != null && (\n <span className=\"cy-steps-description cy-reset\">{step.description}</span>\n )}\n <span className=\"cy-steps-hidden\">{`, ${text[status]}`}</span>\n </span>\n </>\n );\n return (\n <li key={step.id} className=\"cy-steps-item cy-reset\" data-status={status}>\n {onStepSelect ? (\n <ButtonBase\n className=\"cy-steps-step cy-reset\"\n aria-current={isCurrent ? \"step\" : undefined}\n aria-disabled={step.disabled || undefined}\n onClick={() => {\n if (!step.disabled && !isCurrent) onStepSelect(step.id);\n }}\n >\n {content}\n </ButtonBase>\n ) : (\n <span className=\"cy-steps-step cy-reset\" aria-current={isCurrent ? \"step\" : undefined}>\n {content}\n </span>\n )}\n {i < steps.length - 1 && <span className=\"cy-steps-line cy-reset\" aria-hidden=\"true\" />}\n </li>\n );\n })}\n </ol>\n );\n}\n"],"mappings":";;;;;;AAgEA,IAAMQ,IAA8B;AAAA,EAClC,MAAM;AAAA,EACN,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,OAAO;AACT;AAGA,SAAgBC,EAAM,EACpB,OAAAC,GACA,SAAAC,GACA,aAAAC,IAAc,cACd,cAAAC,GACA,MAAAC,IAAO,MACP,QAAAC,GACA,WAAAC,GACA,OAAAC,EAAA,GACa;AACb,QAAMC,IAAO;AAAA,IAAE,GAAGV;AAAA,IAAgB,GAAGO;AAAA,EAAO,GACtCI,IAAKT,EAAM,UAAA,CAAWU,MAAMA,EAAE,OAAOT,CAAO;AAClD,SACE,gBAAAL,EAAC,MAAD;AAAA,IACE,WAAWU,IAAY,YAAYA,CAAA,KAAc;AAAA,IACjD,cAAYE,EAAK;AAAA,IACjB,oBAAkBN;AAAA,IAClB,aAAWE;AAAA,IACJ,OAAAG;AAAA,IAEN,UAAAP,EAAM,IAAA,CAAKW,GAAMC,MAAM;AACtB,YAAMC,IACJF,EAAK,WAAWC,MAAMH,IAAK,YAAYA,KAAM,KAAKG,IAAIH,IAAK,aAAa,aACpEK,IAAYF,MAAMH,GAClBM,IACJ,gBAAAlB,EAAAP,GAAA,EAAA,UAAA,CACE,gBAAAM,EAAC,QAAD;AAAA,QAAM,WAAU;AAAA,QAA2B,eAAY;AAAA,QACpD,UAAAiB,MAAW,aACV,gBAAAjB,EAACJ,GAAD;AAAA,UAAM,MAAMC;AAAA,UAAO,MAAK;AAAA,QAAM,CAAA,IAC5BoB,MAAW,UACb,gBAAAjB,EAACJ,GAAD;AAAA,UAAM,MAAME;AAAA,UAAO,MAAK;AAAA,QAAM,CAAA,IAE9BkB,IAAI;AAAA,MAEF,CAAA,GACN,gBAAAf,EAAC,QAAD;AAAA,QAAM,WAAU;AAAA,QAAhB,UAAA;AAAA,UACE,gBAAAD,EAAC,QAAD;AAAA,YAAM,WAAU;AAAA,YAA2B,UAAAe,EAAK;AAAA,UAAY,CAAA;AAAA,UAC3DA,EAAK,eAAe,QACnB,gBAAAf,EAAC,QAAD;AAAA,YAAM,WAAU;AAAA,YAAiC,UAAAe,EAAK;AAAA,UAAkB,CAAA;AAAA,UAE1E,gBAAAf,EAAC,QAAD;AAAA,YAAM,WAAU;AAAA,YAAmB,UAAA,KAAKY,EAAKK,CAAA,CAAA;AAAA,UAAgB,CAAA;AAAA,QACzD;AAAA,MACN,CAAA,CAAA,EAAA,CAAA;AAEJ,aACE,gBAAAhB,EAAC,MAAD;AAAA,QAAkB,WAAU;AAAA,QAAyB,eAAagB;AAAA,QAAlE,UAAA,CACGV,IACC,gBAAAP,EAACL,GAAD;AAAA,UACE,WAAU;AAAA,UACV,gBAAcuB,IAAY,SAAS;AAAA,UACnC,iBAAeH,EAAK,YAAY;AAAA,UAChC,SAAA,MAAe;AACb,YAAI,CAACA,EAAK,YAAY,CAACG,KAAWX,EAAaQ,EAAK,EAAE;AAAA,UACxD;AAAA,UAEC,UAAAI;AAAA,QACS,CAAA,IAEZ,gBAAAnB,EAAC,QAAD;AAAA,UAAM,WAAU;AAAA,UAAyB,gBAAckB,IAAY,SAAS;AAAA,UACzE,UAAAC;AAAA,QACG,CAAA,GAEPH,IAAIZ,EAAM,SAAS,KAAK,gBAAAJ,EAAC,QAAD;AAAA,UAAM,WAAU;AAAA,UAAyB,eAAY;AAAA,QAAQ,CAAA,CACpF;AAAA,MAlBK,GAAAe,EAAK,EAkBV;AAAA,IAER,CAAC;AAAA,EACC,CAAA;AAER"}
1
+ {"version":3,"file":"Steps.js","names":["_Fragment","ButtonBase","Icon","check","alert","Fragment","jsx","jsxs","DEFAULT_LABELS","Steps","steps","current","orientation","onStepSelect","size","labels","className","style","howTo","text","at","s","step","i","status","isCurrent","content"],"sources":["../../../src/components/Steps/Steps.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode } from \"react\";\nimport { ButtonBase } from \"../../foundations/ButtonBase/ButtonBase.js\";\nimport { Icon } from \"../../foundations/Icon/Icon.js\";\nimport { alert } from \"../../icons/alert.js\";\nimport { check } from \"../../icons/check.js\";\nimport type { Size } from \"../../tokens/schema.js\";\n\nexport interface StepsTokens {\n /** Diameter of the numbered marker. */\n markerSize: string;\n /** Thickness of the line between steps. */\n lineWidth: string;\n /** Space between steps. */\n gap: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n steps: StepsTokens;\n }\n}\n\nexport type StepStatus = \"complete\" | \"current\" | \"upcoming\" | \"error\";\n\nexport interface StepItem {\n id: string;\n label: ReactNode;\n /** A second line under the label. */\n description?: ReactNode;\n /** Overrides the status worked out from `current`: mark a step `error`, or `complete` out of order. */\n status?: \"complete\" | \"error\" | undefined;\n /** With `onStepSelect`: this step cannot be chosen. */\n disabled?: boolean;\n}\n\nexport interface StepsLabels {\n /** Accessible name of the list. Default: \"Progress\", or \"Steps\" for a how-to (no `current`). */\n list: string;\n /** Read after each step's label. Defaults: \"completed\", \"current step\", \"not started\", \"has a problem\". */\n complete: string;\n current: string;\n upcoming: string;\n error: string;\n}\n\nexport interface StepsProps {\n /** The steps, in order. */\n steps: StepItem[];\n /**\n * `id` of the step the person is on. Steps before it are complete, steps after it upcoming. Leave it out for a\n * numbered how-to (steps to follow, not progress): every step is numbered alike and no status is read.\n */\n current?: string | undefined;\n /** Lays the steps out in a row or in a column. Default \"horizontal\". */\n orientation?: \"horizontal\" | \"vertical\";\n /** Makes steps buttons that go to that step. Leave it out for a read-only progress display. */\n onStepSelect?: (id: string) => void;\n /** Text size of labels and markers. */\n size?: Size;\n /** Replace the built-in English text: the list's name and the status read after each step. */\n labels?: Partial<StepsLabels>;\n /** Added to the root element, for layout. */\n className?: string;\n /** Layout only. Restyle through --cy-steps-* tokens. */\n style?: CSSProperties;\n}\n\nconst DEFAULT_LABELS: StepsLabels = {\n list: \"Progress\",\n complete: \"completed\",\n current: \"current step\",\n upcoming: \"not started\",\n error: \"has a problem\",\n};\n\n/**\n * Progress through an ordered flow (a setup wizard, a checkout): numbered steps with the current one marked. Without\n * `current`, a numbered how-to.\n */\nexport function Steps({\n steps,\n current,\n orientation = \"horizontal\",\n onStepSelect,\n size = \"md\",\n labels,\n className,\n style,\n}: StepsProps) {\n const howTo = current === undefined;\n const text = { ...DEFAULT_LABELS, ...(howTo ? { list: \"Steps\" } : {}), ...labels };\n const at = howTo ? -1 : steps.findIndex((s) => s.id === current);\n return (\n <ol\n className={className ? `cy-steps ${className}` : \"cy-steps\"}\n aria-label={text.list}\n data-orientation={orientation}\n data-size={size}\n style={style}\n >\n {steps.map((step, i) => {\n // A how-to has no progress: steps are plain unless one is marked (`status`), and nothing is read for them.\n const status: StepStatus | undefined =\n step.status ??\n (howTo ? undefined : i === at ? \"current\" : at >= 0 && i < at ? \"complete\" : \"upcoming\");\n const isCurrent = i === at;\n const content = (\n <>\n <span className=\"cy-steps-marker cy-reset\" aria-hidden=\"true\">\n {status === \"complete\" ? (\n <Icon icon={check} size=\"sm\" />\n ) : status === \"error\" ? (\n <Icon icon={alert} size=\"sm\" />\n ) : (\n i + 1\n )}\n </span>\n <span className=\"cy-steps-text cy-reset\">\n <span className=\"cy-steps-label cy-reset\">{step.label}</span>\n {step.description != null && (\n <span className=\"cy-steps-description cy-reset\">{step.description}</span>\n )}\n {status && <span className=\"cy-visually-hidden\">{`, ${text[status]}`}</span>}\n </span>\n </>\n );\n return (\n <li key={step.id} className=\"cy-steps-item cy-reset\" data-status={status ?? \"step\"}>\n {onStepSelect ? (\n <ButtonBase\n className=\"cy-steps-step cy-reset\"\n aria-current={isCurrent ? \"step\" : undefined}\n aria-disabled={step.disabled || undefined}\n onClick={() => {\n if (!step.disabled && !isCurrent) onStepSelect(step.id);\n }}\n >\n {content}\n </ButtonBase>\n ) : (\n <span className=\"cy-steps-step cy-reset\" aria-current={isCurrent ? \"step\" : undefined}>\n {content}\n </span>\n )}\n {i < steps.length - 1 && <span className=\"cy-steps-line cy-reset\" aria-hidden=\"true\" />}\n </li>\n );\n })}\n </ol>\n );\n}\n"],"mappings":";;;;;;AAmEA,IAAMQ,IAA8B;AAAA,EAClC,MAAM;AAAA,EACN,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,OAAO;AACT;AAMA,SAAgBC,EAAM,EACpB,OAAAC,GACA,SAAAC,GACA,aAAAC,IAAc,cACd,cAAAC,GACA,MAAAC,IAAO,MACP,QAAAC,GACA,WAAAC,GACA,OAAAC,EAAA,GACa;AACb,QAAMC,IAAQP,MAAY,QACpBQ,IAAO;AAAA,IAAE,GAAGX;AAAA,IAAgB,GAAIU,IAAQ,EAAE,MAAM,QAAQ,IAAI,CAAC;AAAA,IAAI,GAAGH;AAAA,EAAO,GAC3EK,IAAKF,IAAQ,KAAKR,EAAM,UAAA,CAAWW,MAAMA,EAAE,OAAOV,CAAO;AAC/D,SACE,gBAAAL,EAAC,MAAD;AAAA,IACE,WAAWU,IAAY,YAAYA,CAAA,KAAc;AAAA,IACjD,cAAYG,EAAK;AAAA,IACjB,oBAAkBP;AAAA,IAClB,aAAWE;AAAA,IACJ,OAAAG;AAAA,IAEN,UAAAP,EAAM,IAAA,CAAKY,GAAMC,MAAM;AAEtB,YAAMC,IACJF,EAAK,WACJJ,IAAQ,SAAYK,MAAMH,IAAK,YAAYA,KAAM,KAAKG,IAAIH,IAAK,aAAa,aACzEK,IAAYF,MAAMH,GAClBM,IACJ,gBAAAnB,EAAAP,GAAA,EAAA,UAAA,CACE,gBAAAM,EAAC,QAAD;AAAA,QAAM,WAAU;AAAA,QAA2B,eAAY;AAAA,QACpD,UAAAkB,MAAW,aACV,gBAAAlB,EAACJ,GAAD;AAAA,UAAM,MAAMC;AAAA,UAAO,MAAK;AAAA,QAAM,CAAA,IAC5BqB,MAAW,UACb,gBAAAlB,EAACJ,GAAD;AAAA,UAAM,MAAME;AAAA,UAAO,MAAK;AAAA,QAAM,CAAA,IAE9BmB,IAAI;AAAA,MAEF,CAAA,GACN,gBAAAhB,EAAC,QAAD;AAAA,QAAM,WAAU;AAAA,QAAhB,UAAA;AAAA,UACE,gBAAAD,EAAC,QAAD;AAAA,YAAM,WAAU;AAAA,YAA2B,UAAAgB,EAAK;AAAA,UAAY,CAAA;AAAA,UAC3DA,EAAK,eAAe,QACnB,gBAAAhB,EAAC,QAAD;AAAA,YAAM,WAAU;AAAA,YAAiC,UAAAgB,EAAK;AAAA,UAAkB,CAAA;AAAA,UAEzEE,KAAU,gBAAAlB,EAAC,QAAD;AAAA,YAAM,WAAU;AAAA,YAAsB,UAAA,KAAKa,EAAKK,CAAA,CAAA;AAAA,UAAgB,CAAA;AAAA,QACvE;AAAA,MACN,CAAA,CAAA,EAAA,CAAA;AAEJ,aACE,gBAAAjB,EAAC,MAAD;AAAA,QAAkB,WAAU;AAAA,QAAyB,eAAaiB,KAAU;AAAA,QAA5E,UAAA,CACGX,IACC,gBAAAP,EAACL,GAAD;AAAA,UACE,WAAU;AAAA,UACV,gBAAcwB,IAAY,SAAS;AAAA,UACnC,iBAAeH,EAAK,YAAY;AAAA,UAChC,SAAA,MAAe;AACb,YAAI,CAACA,EAAK,YAAY,CAACG,KAAWZ,EAAaS,EAAK,EAAE;AAAA,UACxD;AAAA,UAEC,UAAAI;AAAA,QACS,CAAA,IAEZ,gBAAApB,EAAC,QAAD;AAAA,UAAM,WAAU;AAAA,UAAyB,gBAAcmB,IAAY,SAAS;AAAA,UACzE,UAAAC;AAAA,QACG,CAAA,GAEPH,IAAIb,EAAM,SAAS,KAAK,gBAAAJ,EAAC,QAAD;AAAA,UAAM,WAAU;AAAA,UAAyB,eAAY;AAAA,QAAQ,CAAA,CACpF;AAAA,MAlBK,GAAAgB,EAAK,EAkBV;AAAA,IAER,CAAC;AAAA,EACC,CAAA;AAER"}
@@ -1,4 +1,4 @@
1
- import { type ChoiceRowProps } from "../Checkbox/ChoiceRow.js";
1
+ import { type ChoiceControlProps } from "../Choice/Choice.js";
2
2
  export interface SwitchTokens {
3
3
  width: string;
4
4
  height: string;
@@ -10,6 +10,6 @@ declare module "../../tokens/schema.js" {
10
10
  switch: SwitchTokens;
11
11
  }
12
12
  }
13
- export type SwitchProps = ChoiceRowProps;
14
- /** On/off switch (`role="switch"`) on a native checkbox. */
15
- export declare function Switch(props: SwitchProps): import("react").JSX.Element;
13
+ export type SwitchProps = ChoiceControlProps;
14
+ /** On/off switch (`role="switch"`) on a native checkbox, in a Choice row. */
15
+ export declare function Switch({ size, tone, ...props }: SwitchProps): import("react").JSX.Element;
@@ -1,14 +1,25 @@
1
1
  "use client";
2
- import { ChoiceRow as o } from "../Checkbox/ChoiceRow.js";
3
- import { jsx as t } from "react/jsx-runtime";
4
- function e(i) {
5
- return /* @__PURE__ */ t(o, {
6
- kind: "switch",
7
- ...i
2
+ import { ChoiceBase as r } from "../../foundations/ChoiceBase/ChoiceBase.js";
3
+ import { Choice as a } from "../Choice/Choice.js";
4
+ import { jsx as c, jsxs as i } from "react/jsx-runtime";
5
+ function p({ size: t = "md", tone: e = "accent", ...o }) {
6
+ return /* @__PURE__ */ c(a, {
7
+ ...o,
8
+ size: t,
9
+ control: (s) => /* @__PURE__ */ i("span", {
10
+ className: "cy-switch",
11
+ "data-size": t,
12
+ "data-tone": e,
13
+ children: [/* @__PURE__ */ c(r, {
14
+ ...s,
15
+ type: "checkbox",
16
+ role: "switch"
17
+ }), /* @__PURE__ */ c("span", { className: "cy-reset cy-switch-thumb" })]
18
+ })
8
19
  });
9
20
  }
10
21
  export {
11
- e as Switch
22
+ p as Switch
12
23
  };
13
24
 
14
25
  //# sourceMappingURL=Switch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","names":["ChoiceRow","jsx","Switch","props"],"sources":["../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import { ChoiceRow, type ChoiceRowProps } from \"../Checkbox/ChoiceRow.js\";\n\nexport interface SwitchTokens {\n width: string;\n height: string;\n thumbSize: string;\n offBg: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n switch: SwitchTokens;\n }\n}\n\nexport type SwitchProps = ChoiceRowProps;\n\n/** On/off switch (`role=\"switch\"`) on a native checkbox. */\nexport function Switch(props: SwitchProps) {\n return <ChoiceRow kind=\"switch\" {...props} />;\n}\n"],"mappings":";;;AAkBA,SAAgBE,EAAOC,GAAoB;AACzC,SAAO,gBAAAF,EAACD,GAAD;AAAA,IAAW,MAAK;AAAA,IAAS,GAAIG;AAAA,EAAQ,CAAA;AAC9C"}
1
+ {"version":3,"file":"Switch.js","names":["ChoiceBase","Choice","jsx","jsxs","Switch","size","tone","props","input"],"sources":["../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import { ChoiceBase } from \"../../foundations/ChoiceBase/ChoiceBase.js\";\nimport { Choice, type ChoiceControlProps } from \"../Choice/Choice.js\";\n\nexport interface SwitchTokens {\n width: string;\n height: string;\n thumbSize: string;\n offBg: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n switch: SwitchTokens;\n }\n}\n\nexport type SwitchProps = ChoiceControlProps;\n\n/** On/off switch (`role=\"switch\"`) on a native checkbox, in a Choice row. */\nexport function Switch({ size = \"md\", tone = \"accent\", ...props }: SwitchProps) {\n return (\n <Choice\n {...props}\n size={size}\n control={(input) => (\n <span className=\"cy-switch\" data-size={size} data-tone={tone}>\n <ChoiceBase {...input} type=\"checkbox\" role=\"switch\" />\n <span className=\"cy-reset cy-switch-thumb\" />\n </span>\n )}\n />\n );\n}\n"],"mappings":";;;;AAmBA,SAAgBI,EAAO,EAAE,MAAAC,IAAO,MAAM,MAAAC,IAAO,UAAU,GAAGC,EAAA,GAAsB;AAC9E,SACE,gBAAAL,EAACD,GAAD;AAAA,IACE,GAAIM;AAAA,IACE,MAAAF;AAAA,IACN,SAAA,CAAUG,MACR,gBAAAL,EAAC,QAAD;AAAA,MAAM,WAAU;AAAA,MAAY,aAAWE;AAAA,MAAM,aAAWC;AAAA,MAAxD,UAAA,CACE,gBAAAJ,EAACF,GAAD;AAAA,QAAY,GAAIQ;AAAA,QAAO,MAAK;AAAA,QAAW,MAAK;AAAA,MAAU,CAAA,GACtD,gBAAAN,EAAC,QAAD,EAAM,WAAU,2BAA4B,CAAA,CACxC;AAAA,I;A,EAET,CAAA;AAEL"}
@@ -23,7 +23,7 @@ function he({ caption: a, captionHidden: l = !1, columns: i, rows: o, getRowId:
23
23
  const N = {
24
24
  ...ee,
25
25
  ..._
26
- }, A = Y(), [n, v] = B(L, U, V), [G, H] = B(j, T, F), k = new Set(G), h = i.find((e) => e.rowHeader) ?? i[0], E = Z(() => {
26
+ }, $ = Y(), [n, v] = B(L, U, V), [G, H] = B(j, T, F), k = new Set(G), h = i.find((e) => e.rowHeader) ?? i[0], A = Z(() => {
27
27
  if (C || !n) return o;
28
28
  const e = i.find((s) => s.key === n.key);
29
29
  if (!e) return o;
@@ -45,7 +45,7 @@ function he({ caption: a, captionHidden: l = !1, columns: i, rows: o, getRowId:
45
45
  key: e,
46
46
  direction: "descending"
47
47
  }) : v(null);
48
- }, $ = (e) => {
48
+ }, E = (e) => {
49
49
  const c = o.map(f).filter((y) => e.has(y));
50
50
  H(c);
51
51
  }, d = o.map(f), S = d.filter((e) => k.has(e)).length, K = (e) => {
@@ -62,15 +62,14 @@ function he({ caption: a, captionHidden: l = !1, columns: i, rows: o, getRowId:
62
62
  ...x ? {
63
63
  tabIndex: 0,
64
64
  role: "region",
65
- "aria-labelledby": `${A}-caption`
65
+ "aria-labelledby": `${$}-caption`
66
66
  } : {},
67
67
  children: /* @__PURE__ */ b("table", {
68
68
  className: "cy-table-table cy-reset",
69
69
  children: [
70
70
  /* @__PURE__ */ t("caption", {
71
- id: `${A}-caption`,
72
- className: "cy-table-caption cy-reset",
73
- "data-hidden": l ? "" : void 0,
71
+ id: `${$}-caption`,
72
+ className: `cy-table-caption cy-reset${l ? " cy-visually-hidden" : ""}`,
74
73
  children: a
75
74
  }),
76
75
  /* @__PURE__ */ t("thead", {
@@ -82,13 +81,13 @@ function he({ caption: a, captionHidden: l = !1, columns: i, rows: o, getRowId:
82
81
  className: "cy-table-th cy-table-select cy-reset",
83
82
  children: /* @__PURE__ */ t(D, {
84
83
  label: /* @__PURE__ */ t("span", {
85
- className: "cy-table-hidden",
84
+ className: "cy-visually-hidden",
86
85
  children: N.selectAll
87
86
  }),
88
87
  checked: d.length > 0 && S === d.length,
89
88
  indeterminate: S > 0 && S < d.length,
90
89
  disabled: d.length === 0,
91
- onChange: (e) => $(e ? new Set(d) : /* @__PURE__ */ new Set())
90
+ onChange: (e) => E(e ? new Set(d) : /* @__PURE__ */ new Set())
92
91
  })
93
92
  }), i.map((e) => {
94
93
  const c = n?.key === e.key ? n.direction : void 0;
@@ -116,14 +115,14 @@ function he({ caption: a, captionHidden: l = !1, columns: i, rows: o, getRowId:
116
115
  }),
117
116
  /* @__PURE__ */ t("tbody", {
118
117
  className: "cy-reset",
119
- children: E.length === 0 ? /* @__PURE__ */ t("tr", {
118
+ children: A.length === 0 ? /* @__PURE__ */ t("tr", {
120
119
  className: "cy-reset",
121
120
  children: /* @__PURE__ */ t("td", {
122
121
  className: "cy-table-td cy-table-empty cy-reset",
123
122
  colSpan: i.length + (g ? 1 : 0),
124
123
  children: N.empty
125
124
  })
126
- }) : E.map((e) => {
125
+ }) : A.map((e) => {
127
126
  const c = f(e), y = k.has(c);
128
127
  return /* @__PURE__ */ b("tr", {
129
128
  className: "cy-table-row cy-reset",
@@ -132,13 +131,13 @@ function he({ caption: a, captionHidden: l = !1, columns: i, rows: o, getRowId:
132
131
  className: "cy-table-td cy-table-select cy-reset",
133
132
  children: /* @__PURE__ */ t(D, {
134
133
  label: /* @__PURE__ */ t("span", {
135
- className: "cy-table-hidden",
134
+ className: "cy-visually-hidden",
136
135
  children: N.selectRow(K(e))
137
136
  }),
138
137
  checked: y,
139
138
  onChange: (s) => {
140
139
  const r = new Set(k);
141
- s ? r.add(c) : r.delete(c), $(r);
140
+ s ? r.add(c) : r.delete(c), E(r);
142
141
  }
143
142
  })
144
143
  }), i.map((s) => {