@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
@@ -9,48 +9,48 @@ import { chevronRight as me } from "../../icons/chevron-right.js";
9
9
  import { chevronLeft as ye } from "../../icons/chevron-left.js";
10
10
  import { Popover as Ce } from "../Popover/Popover.js";
11
11
  import { addDays as y, addMonths as E, clampDate as P, firstDayOfWeek as Fe, fromISODate as O, inMonth as ue, toISODate as Ee, weekendDays as Pe } from "./dates.js";
12
- import { useId as Oe, useRef as N, useState as he } from "react";
12
+ import { useId as Oe, useRef as b, useState as he } from "react";
13
13
  import { jsx as r, jsxs as v } from "react/jsx-runtime";
14
- var ze = {
14
+ var Re = {
15
15
  previous: "Previous month",
16
16
  next: "Next month",
17
17
  monthPicker: "Choose month and year",
18
18
  previousYear: "Previous year",
19
19
  nextYear: "Next year"
20
- }, Le = [
20
+ }, ze = [
21
21
  "accent",
22
22
  "neutral",
23
23
  "danger",
24
24
  "success",
25
25
  "warning",
26
26
  "info"
27
- ], Ye = 3, _e = Array.from({ length: 12 }, (h, D) => D);
28
- function Re({ month: h, children: D, onPick: z, min: g, max: f, locale: S, text: b, size: L }) {
29
- const [l, s] = he(null), p = l ?? Number(h.slice(0, 4)), d = (o, a) => new Intl.DateTimeFormat(S, { month: o }).format(new Date(2001, a, 1)), $ = (o, a, Y, _) => /* @__PURE__ */ r(H, {
30
- icon: Y,
31
- label: a,
27
+ ], Le = 3, Ye = Array.from({ length: 12 }, (h, D) => D);
28
+ function _e({ month: h, children: D, onPick: R, min: g, max: f, locale: S, text: N, size: z }) {
29
+ const [l, a] = he(null), p = l ?? Number(h.slice(0, 4)), d = (o, c) => new Intl.DateTimeFormat(S, { month: o }).format(new Date(2001, c, 1)), $ = (o, c, L, Y) => /* @__PURE__ */ r(H, {
30
+ icon: L,
31
+ label: c,
32
32
  variant: "ghost",
33
33
  tone: "neutral",
34
34
  size: "sm",
35
- className: "cy-calendar-flip",
36
- disabled: _,
37
- onClick: () => s(p + o)
35
+ flipRtl: !0,
36
+ disabled: Y,
37
+ onClick: () => a(p + o)
38
38
  });
39
39
  return /* @__PURE__ */ r(Ce, {
40
- label: b.monthPicker,
40
+ label: N.monthPicker,
41
41
  size: "sm",
42
42
  open: l !== null,
43
- onOpenChange: (o) => s(o ? Number(h.slice(0, 4)) : null),
43
+ onOpenChange: (o) => a(o ? Number(h.slice(0, 4)) : null),
44
44
  trigger: (o) => /* @__PURE__ */ v(de, {
45
45
  ...o,
46
46
  variant: "ghost",
47
47
  tone: "neutral",
48
- size: L === "lg" ? "md" : "sm",
48
+ size: z === "lg" ? "md" : "sm",
49
49
  iconEnd: Me,
50
50
  className: "cy-calendar-jump",
51
51
  children: [D, /* @__PURE__ */ r("span", {
52
52
  className: "cy-visually-hidden",
53
- children: b.monthPicker
53
+ children: N.monthPicker
54
54
  })]
55
55
  }),
56
56
  children: /* @__PURE__ */ v("div", {
@@ -58,76 +58,76 @@ function Re({ month: h, children: D, onPick: z, min: g, max: f, locale: S, text:
58
58
  children: [/* @__PURE__ */ v("div", {
59
59
  className: "cy-calendar-head cy-reset",
60
60
  children: [
61
- $(-1, b.previousYear, ye, g !== void 0 && p <= Number(g.slice(0, 4))),
61
+ $(-1, N.previousYear, ye, g !== void 0 && p <= Number(g.slice(0, 4))),
62
62
  /* @__PURE__ */ r("span", {
63
63
  className: "cy-calendar-title cy-reset",
64
64
  "aria-live": "polite",
65
65
  children: new Intl.DateTimeFormat(S, { year: "numeric" }).format(new Date(p, 0, 1))
66
66
  }),
67
- $(1, b.nextYear, me, f !== void 0 && p >= Number(f.slice(0, 4)))
67
+ $(1, N.nextYear, me, f !== void 0 && p >= Number(f.slice(0, 4)))
68
68
  ]
69
69
  }), /* @__PURE__ */ r("div", {
70
70
  className: "cy-calendar-months cy-reset",
71
- children: _e.map((o) => {
72
- const a = `${String(p).padStart(4, "0")}-${String(o + 1).padStart(2, "0")}`;
71
+ children: Ye.map((o) => {
72
+ const c = `${String(p).padStart(4, "0")}-${String(o + 1).padStart(2, "0")}`;
73
73
  return /* @__PURE__ */ r(de, {
74
- variant: a === h ? "soft" : "ghost",
75
- tone: a === h ? "accent" : "neutral",
74
+ variant: c === h ? "soft" : "ghost",
75
+ tone: c === h ? "accent" : "neutral",
76
76
  size: "sm",
77
77
  fullWidth: !0,
78
78
  "aria-label": `${d("long", o)} ${p}`,
79
- "aria-current": a === h || void 0,
80
- disabled: g !== void 0 && a < g.slice(0, 7) || f !== void 0 && a > f.slice(0, 7),
79
+ "aria-current": c === h || void 0,
80
+ disabled: g !== void 0 && c < g.slice(0, 7) || f !== void 0 && c > f.slice(0, 7),
81
81
  onClick: () => {
82
- s(null), z(a);
82
+ a(null), R(c);
83
83
  },
84
84
  children: d("short", o)
85
- }, a);
85
+ }, c);
86
86
  })
87
87
  })]
88
88
  })
89
89
  });
90
90
  }
91
- function Qe({ value: h, defaultValue: D = null, onChange: z, defaultFocusedDate: g, month: f, defaultMonth: S, onMonthChange: b, monthPicker: L = !1, min: l, max: s, isDateDisabled: p, locale: d, weekStartsOn: $, today: o, renderDay: a, markDay: Y, labels: _, size: W = "md", className: q, style: fe }) {
92
- const R = {
93
- ...ze,
94
- ..._
95
- }, x = Oe(), j = o ?? Ee(/* @__PURE__ */ new Date()), [i, pe] = ie(h, D, z), [n, V] = ie(f?.slice(0, 7), () => (S ?? P(i ?? g ?? j, l, s)).slice(0, 7), (e) => b?.(`${e}-01`)), X = (e, t) => {
91
+ function Qe({ value: h, defaultValue: D = null, onChange: R, defaultFocusedDate: g, month: f, defaultMonth: S, onMonthChange: N, monthPicker: z = !1, min: l, max: a, isDateDisabled: p, locale: d, weekStartsOn: $, today: o, renderDay: c, markDay: L, labels: Y, size: W = "md", className: q, style: fe }) {
92
+ const _ = {
93
+ ...Re,
94
+ ...Y
95
+ }, x = Oe(), j = o ?? Ee(/* @__PURE__ */ new Date()), [i, pe] = ie(h, D, R), [n, V] = ie(f?.slice(0, 7), () => (S ?? P(i ?? g ?? j, l, a)).slice(0, 7), (e) => N?.(`${e}-01`)), X = (e, t) => {
96
96
  if (e.slice(0, 7) === t) return e;
97
- const u = P(ue(e, t), l, s);
97
+ const u = P(ue(e, t), l, a);
98
98
  return u.slice(0, 7) === t ? u : ue(e, t);
99
- }, [c, G] = he(() => X(P(i ?? g ?? j, l, s), n)), I = N(null), M = N(!1), T = N(null), B = N(null);
100
- let k = c;
101
- const J = N(i);
99
+ }, [s, G] = he(() => X(P(i ?? g ?? j, l, a), n)), I = b(null), M = b(!1), T = b(null), B = b(null);
100
+ let k = s;
101
+ const J = b(i);
102
102
  J.current !== i && (J.current = i, i?.slice(0, 7) === n ? k = i : i && (T.current = i, f === void 0 && (B.current = i.slice(0, 7))));
103
- const Q = N(n);
104
- Q.current !== n && (Q.current = n, k = X(T.current ?? k, n), T.current = null, I.current?.contains(I.current.ownerDocument.activeElement) && (M.current = !0)), k !== c && G(k), Te(() => {
103
+ const Q = b(n);
104
+ Q.current !== n && (Q.current = n, k = X(T.current ?? k, n), T.current = null, I.current?.contains(I.current.ownerDocument.activeElement) && (M.current = !0)), k !== s && G(k), Te(() => {
105
105
  const e = B.current;
106
106
  B.current = null, e && e !== n && V(e), M.current && (M.current = !1, I.current?.querySelector('[tabindex="0"]')?.focus());
107
107
  });
108
- const A = N(n);
108
+ const A = b(n);
109
109
  A.current = n;
110
110
  const K = (e, t = null) => {
111
111
  T.current = t, e !== A.current && (f === void 0 && (A.current = e), V(e));
112
112
  }, Z = (e) => K(E(`${A.current}-01`, e).slice(0, 7)), ee = (e) => {
113
- const t = P(e, l, s);
113
+ const t = P(e, l, a);
114
114
  if (t.slice(0, 7) !== n) return K(t.slice(0, 7), t);
115
- t !== c && (M.current = !0, G(t));
116
- }, ve = (e) => l !== void 0 && e < l || s !== void 0 && e > s, te = (e) => ve(e) || !!p?.(e), re = (e) => {
115
+ t !== s && (M.current = !0, G(t));
116
+ }, ve = (e) => l !== void 0 && e < l || a !== void 0 && e > a, te = (e) => ve(e) || !!p?.(e), re = (e) => {
117
117
  te(e) || pe(e);
118
- }, ne = $ ?? Fe(d), ge = Pe(d), C = O(`${n}-01`), ae = (C.getDay() - ne + 7) % 7, we = y(`${n}-01`, -ae), Ne = new Date(C.getFullYear(), C.getMonth() + 1, 0).getDate(), be = Math.ceil((ae + Ne) / 7), ce = Array.from({ length: be }, (e, t) => Array.from({ length: 7 }, (u, m) => y(we, t * 7 + m))), se = (e) => new Intl.DateTimeFormat(d, { weekday: e }), De = new Intl.DateTimeFormat(d, { dateStyle: "full" }), ke = new Intl.DateTimeFormat(d, { day: "numeric" }), Se = (e) => {
119
- const t = Ae(e.currentTarget) ? -1 : 1, u = (O(c).getDay() - ne + 7) % 7, m = {
120
- ArrowLeft: () => y(c, -t),
121
- ArrowRight: () => y(c, t),
122
- ArrowUp: () => y(c, -7),
123
- ArrowDown: () => y(c, 7),
124
- Home: () => y(c, -u),
125
- End: () => y(c, 6 - u),
126
- PageUp: () => E(c, e.shiftKey ? -12 : -1),
127
- PageDown: () => E(c, e.shiftKey ? 12 : 1)
118
+ }, ne = $ ?? Fe(d), ge = Pe(d), C = O(`${n}-01`), ce = (C.getDay() - ne + 7) % 7, we = y(`${n}-01`, -ce), be = new Date(C.getFullYear(), C.getMonth() + 1, 0).getDate(), Ne = Math.ceil((ce + be) / 7), se = Array.from({ length: Ne }, (e, t) => Array.from({ length: 7 }, (u, m) => y(we, t * 7 + m))), ae = (e) => new Intl.DateTimeFormat(d, { weekday: e }), De = new Intl.DateTimeFormat(d, { dateStyle: "full" }), ke = new Intl.DateTimeFormat(d, { day: "numeric" }), Se = (e) => {
119
+ const t = Ae(e.currentTarget) ? -1 : 1, u = (O(s).getDay() - ne + 7) % 7, m = {
120
+ ArrowLeft: () => y(s, -t),
121
+ ArrowRight: () => y(s, t),
122
+ ArrowUp: () => y(s, -7),
123
+ ArrowDown: () => y(s, 7),
124
+ Home: () => y(s, -u),
125
+ End: () => y(s, 6 - u),
126
+ PageUp: () => E(s, e.shiftKey ? -12 : -1),
127
+ PageDown: () => E(s, e.shiftKey ? 12 : 1)
128
128
  };
129
129
  if (e.key === "Enter" || e.key === " ") {
130
- e.preventDefault(), re(c);
130
+ e.preventDefault(), re(s);
131
131
  return;
132
132
  }
133
133
  const w = m[e.key];
@@ -144,39 +144,39 @@ function Qe({ value: h, defaultValue: D = null, onChange: z, defaultFocusedDate:
144
144
  return /* @__PURE__ */ v("div", {
145
145
  className: q ? `cy-calendar ${q}` : "cy-calendar",
146
146
  "data-size": W,
147
- "data-days": a ? "" : void 0,
147
+ "data-days": c ? "" : void 0,
148
148
  style: fe,
149
149
  children: [/* @__PURE__ */ v("div", {
150
150
  className: "cy-calendar-head cy-reset",
151
151
  children: [
152
152
  /* @__PURE__ */ r(H, {
153
153
  icon: ye,
154
- label: R.previous,
154
+ label: _.previous,
155
155
  variant: "ghost",
156
156
  tone: "neutral",
157
157
  size: "sm",
158
- className: "cy-calendar-flip",
158
+ flipRtl: !0,
159
159
  disabled: l !== void 0 && y(`${n}-01`, -1) < l,
160
160
  onClick: () => Z(-1)
161
161
  }),
162
- L ? /* @__PURE__ */ r(Re, {
162
+ z ? /* @__PURE__ */ r(_e, {
163
163
  month: n,
164
164
  onPick: K,
165
165
  min: l,
166
- max: s,
166
+ max: a,
167
167
  locale: d,
168
- text: R,
168
+ text: _,
169
169
  size: W,
170
170
  children: oe
171
171
  }) : oe,
172
172
  /* @__PURE__ */ r(H, {
173
173
  icon: me,
174
- label: R.next,
174
+ label: _.next,
175
175
  variant: "ghost",
176
176
  tone: "neutral",
177
177
  size: "sm",
178
- className: "cy-calendar-flip",
179
- disabled: s !== void 0 && $e > s,
178
+ flipRtl: !0,
179
+ disabled: a !== void 0 && $e > a,
180
180
  onClick: () => Z(1)
181
181
  })
182
182
  ]
@@ -190,19 +190,19 @@ function Qe({ value: h, defaultValue: D = null, onChange: z, defaultFocusedDate:
190
190
  className: "cy-reset",
191
191
  children: /* @__PURE__ */ r("tr", {
192
192
  className: "cy-reset",
193
- children: ce[0].map((e) => {
193
+ children: se[0].map((e) => {
194
194
  const t = O(e);
195
195
  return /* @__PURE__ */ r("th", {
196
196
  scope: "col",
197
- abbr: se("long").format(t),
197
+ abbr: ae("long").format(t),
198
198
  className: "cy-calendar-weekday cy-reset",
199
- children: se("short").format(t)
199
+ children: ae("short").format(t)
200
200
  }, e);
201
201
  })
202
202
  })
203
203
  }), /* @__PURE__ */ r("tbody", {
204
204
  className: "cy-reset",
205
- children: ce.map((e) => /* @__PURE__ */ r("tr", {
205
+ children: se.map((e) => /* @__PURE__ */ r("tr", {
206
206
  className: "cy-reset",
207
207
  children: e.map((t) => {
208
208
  const u = O(t), m = {
@@ -211,10 +211,10 @@ function Qe({ value: h, defaultValue: D = null, onChange: z, defaultFocusedDate:
211
211
  outside: t.slice(0, 7) !== n,
212
212
  disabled: te(t),
213
213
  weekend: ge.includes(u.getDay())
214
- }, w = Y?.(t, m), U = w?.dots?.slice(0, Ye);
214
+ }, w = L?.(t, m), U = w?.dots?.slice(0, Le);
215
215
  return /* @__PURE__ */ v("td", {
216
216
  role: "gridcell",
217
- tabIndex: t === c ? 0 : -1,
217
+ tabIndex: t === s ? 0 : -1,
218
218
  "aria-selected": m.selected,
219
219
  "aria-disabled": m.disabled || void 0,
220
220
  "aria-current": m.today ? "date" : void 0,
@@ -239,7 +239,7 @@ function Qe({ value: h, defaultValue: D = null, onChange: z, defaultFocusedDate:
239
239
  className: "cy-calendar-dots cy-reset",
240
240
  "aria-hidden": "true",
241
241
  children: U.map((F, Ie) => {
242
- const le = Le.includes(F);
242
+ const le = ze.includes(F);
243
243
  return /* @__PURE__ */ r("span", {
244
244
  className: "cy-calendar-dot cy-reset",
245
245
  "data-tone": le ? F : void 0,
@@ -247,9 +247,9 @@ function Qe({ value: h, defaultValue: D = null, onChange: z, defaultFocusedDate:
247
247
  }, `${Ie}${F}`);
248
248
  })
249
249
  }),
250
- a && /* @__PURE__ */ r("span", {
250
+ c && /* @__PURE__ */ r("span", {
251
251
  className: "cy-calendar-extra cy-reset",
252
- children: a(t, m)
252
+ children: c(t, m)
253
253
  })
254
254
  ]
255
255
  }, t);
@@ -1 +1 @@
1
- {"version":3,"file":"Calendar.js","names":["useControllableState","chevronDown","useClientLayoutEffect","Button","isRtl","IconButton","chevronRight","chevronLeft","Popover","addDays","addMonths","clampDate","firstDayOfWeek","fromISODate","inMonth","toISODate","weekendDays","useId","useRef","useState","jsx","jsxs","DEFAULT_LABELS","TONES","MAX_DOTS","MONTHS","_","i","MonthPicker","month","children","onPick","min","max","locale","text","size","year","setYear","shown","name","style","yearStep","by","label","icon","off","open","props","at","Calendar","value","defaultValue","onChange","defaultFocusedDate","monthProp","defaultMonth","onMonthChange","monthPicker","isDateDisabled","weekStartsOn","todayProp","renderDay","markDay","labels","className","id","today","selected","setSelected","setMonth","next","within","date","m","day","focused","setFocusedState","grid","moveFocus","pending","follow","shownValue","shownMonth","live","show","page","focus","to","disabled","choose","weekStart","weekend","first","lead","gridStart","daysInMonth","weeks","rows","w","d","weekday","fullDate","dayNumber","onKeyDown","event","across","dow","moves","move","nextMonth","title","week","state","mark","dots","dot","tone"],"sources":["../../../src/components/Calendar/Calendar.tsx"],"sourcesContent":["import { type CSSProperties, type KeyboardEvent, type ReactNode, useId, useRef, useState } from \"react\";\nimport { useClientLayoutEffect } from \"../../foundations/client-layout-effect.js\";\nimport { useControllableState } from \"../../foundations/controllable.js\";\nimport { isRtl } from \"../../foundations/dir.js\";\nimport { chevronDown } from \"../../icons/chevron-down.js\";\nimport { chevronLeft } from \"../../icons/chevron-left.js\";\nimport { chevronRight } from \"../../icons/chevron-right.js\";\nimport type { Size, Tone } from \"../../tokens/schema.js\";\nimport { Button } from \"../Button/Button.js\";\nimport { IconButton } from \"../IconButton/IconButton.js\";\nimport { Popover } from \"../Popover/Popover.js\";\nimport {\n addDays,\n addMonths,\n clampDate,\n firstDayOfWeek,\n fromISODate,\n inMonth,\n toISODate,\n weekendDays,\n} from \"./dates.js\";\n\nexport interface CalendarTokens {\n /** Size of a day cell (it never drops below the touch hit area). */\n cellSize: string;\n /** Background of the selected day. */\n selectedBackground: string;\n /** With `renderDay`: the least height of a day (never below the hit area). */\n contentSize: string;\n /** How much of a marked day's tone is mixed into its background (a percentage). */\n toneMix: string;\n /** Size of a day's dots. */\n dotSize: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n calendar: CalendarTokens;\n }\n}\n\nexport interface CalendarDayState {\n /** The day is the selected date. */\n selected: boolean;\n /** The day is today. */\n today: boolean;\n /** A day of the previous or next month, shown to fill the weeks. */\n outside: boolean;\n /** The day cannot be chosen: outside `min` and `max`, or `isDateDisabled`. */\n disabled: boolean;\n /** A weekend day in the `locale` (Saturday and Sunday where the browser does not know the locale's weekend). */\n weekend: boolean;\n}\n\n/** How `markDay` marks a day. Every part is optional. */\nexport interface CalendarDayMark {\n /** Tints the day's background softly with this tone. Give a `label` too when the colour means something. */\n tone?: Tone | undefined;\n /**\n * Small dots under the day's number, one per entry: a tone, or any CSS colour (a category's colour). At most three\n * are drawn; further entries are dropped.\n */\n dots?: readonly (Tone | (string & {}))[] | undefined;\n /** Added to the day's accessible name after its date (\"3 tasks\", \"Weekend\"), so the marks are not colour alone. */\n label?: string | undefined;\n}\n\nexport interface CalendarLabels {\n /** The button to the month before. Default \"Previous month\". */\n previous: string;\n /** The button to the month after. Default \"Next month\". */\n next: string;\n /** With `monthPicker`: names the panel of months and years, and is added to the heading button's name. Default \"Choose month and year\". */\n monthPicker: string;\n /** With `monthPicker`: the button to the year before. Default \"Previous year\". */\n previousYear: string;\n /** With `monthPicker`: the button to the year after. Default \"Next year\". */\n nextYear: string;\n}\n\nexport interface CalendarProps {\n /** The selected date, `YYYY-MM-DD`, or null for none. */\n value?: string | null;\n /** The date selected at first, when uncontrolled. */\n defaultValue?: string | null;\n /** Called when a day is chosen, with its date as `YYYY-MM-DD`. */\n onChange?: (date: string) => void;\n /** The date focus starts on when nothing is selected. Default: today. */\n defaultFocusedDate?: string;\n /**\n * The month shown, controlled: `YYYY-MM`, or any `YYYY-MM-DD` date of that month. The grid then only moves when this\n * changes: paging, the month picker, keys that leave the month and choosing a day of another month call\n * `onMonthChange` and wait for it. A new `value` in another month does not move a controlled month.\n */\n month?: string | undefined;\n /** The month shown at first, when uncontrolled (`YYYY-MM` or `YYYY-MM-DD`). Default: the month of the selected or focused date. */\n defaultMonth?: string | undefined;\n /**\n * Called with the first day of a month (`YYYY-MM-01`) when the month shown changes (to load that month's events) or,\n * with `month`, when another month is asked for.\n */\n onMonthChange?: (firstDay: string) => void;\n /**\n * Turns the month heading into a button that opens a panel to jump to any month and year. Months and years outside\n * `min` and `max` cannot be chosen. Default false.\n */\n monthPicker?: boolean | undefined;\n /** Earliest and latest dates that can be reached and chosen. */\n min?: string | undefined;\n /** Latest date (`YYYY-MM-DD`) that can be reached and chosen. */\n max?: string | undefined;\n /** Dates that can be focused but not chosen (fully booked, weekends). */\n isDateDisabled?: ((date: string) => boolean) | undefined;\n /** Locale for month and day names (and the first day of the week). Default: the browser's. */\n locale?: string | undefined;\n /** 0 Sunday to 6 Saturday. Default: the locale's first day, else Monday. */\n weekStartsOn?: number | undefined;\n /** What counts as today. Default: the device's date. */\n today?: string | undefined;\n /** Extra content inside a day, under its number: a dot for events, a planner's items. */\n renderDay?: ((date: string, state: CalendarDayState) => ReactNode) | undefined;\n /**\n * Marks a day without drawing it: return `{ tone, dots, label }` to tint its background, put up to three dots under\n * its number and add words to its name, or nothing to leave it plain. Weekends: `(_, day) => day.weekend ? { tone:\n * \"neutral\", label: \"Weekend\" } : undefined`.\n */\n markDay?: ((date: string, state: CalendarDayState) => CalendarDayMark | undefined) | undefined;\n /** Replace the built-in English text: the month buttons, and the month picker's name and year buttons. */\n labels?: Partial<CalendarLabels>;\n /** Size of the day cells and text. Default \"md\". */\n size?: Size;\n /** Added to the root element, for layout. */\n className?: string;\n /** Layout only. Restyle through --cy-calendar-* tokens. */\n style?: CSSProperties;\n}\n\nconst DEFAULT_LABELS: CalendarLabels = {\n previous: \"Previous month\",\n next: \"Next month\",\n monthPicker: \"Choose month and year\",\n previousYear: \"Previous year\",\n nextYear: \"Next year\",\n};\n\nconst TONES: readonly string[] = [\"accent\", \"neutral\", \"danger\", \"success\", \"warning\", \"info\"];\nconst MAX_DOTS = 3;\nconst MONTHS = Array.from({ length: 12 }, (_, i) => i);\n\n/** The heading as a button, and its panel: a year to step through and that year's twelve months. */\nfunction MonthPicker({\n month,\n children,\n onPick,\n min,\n max,\n locale,\n text,\n size,\n}: {\n month: string;\n children: ReactNode;\n onPick: (month: string) => void;\n min: string | undefined;\n max: string | undefined;\n locale: string | undefined;\n text: CalendarLabels;\n size: Size;\n}) {\n // The year the panel shows while open; null while closed.\n const [year, setYear] = useState<number | null>(null);\n const shown = year ?? Number(month.slice(0, 4));\n const name = (style: \"long\" | \"short\", i: number) =>\n new Intl.DateTimeFormat(locale, { month: style }).format(new Date(2001, i, 1));\n const yearStep = (by: number, label: string, icon: typeof chevronLeft, off: boolean) => (\n <IconButton\n icon={icon}\n label={label}\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n className=\"cy-calendar-flip\"\n disabled={off}\n onClick={() => setYear(shown + by)}\n />\n );\n return (\n <Popover\n label={text.monthPicker}\n size=\"sm\"\n open={year !== null}\n onOpenChange={(open) => setYear(open ? Number(month.slice(0, 4)) : null)}\n trigger={(props) => (\n <Button\n {...props}\n variant=\"ghost\"\n tone=\"neutral\"\n size={size === \"lg\" ? \"md\" : \"sm\"}\n iconEnd={chevronDown}\n className=\"cy-calendar-jump\"\n >\n {children}\n <span className=\"cy-visually-hidden\">{text.monthPicker}</span>\n </Button>\n )}\n >\n <div className=\"cy-calendar-picker cy-reset\">\n <div className=\"cy-calendar-head cy-reset\">\n {yearStep(\n -1,\n text.previousYear,\n chevronLeft,\n min !== undefined && shown <= Number(min.slice(0, 4)),\n )}\n <span className=\"cy-calendar-title cy-reset\" aria-live=\"polite\">\n {new Intl.DateTimeFormat(locale, { year: \"numeric\" }).format(new Date(shown, 0, 1))}\n </span>\n {yearStep(1, text.nextYear, chevronRight, max !== undefined && shown >= Number(max.slice(0, 4)))}\n </div>\n <div className=\"cy-calendar-months cy-reset\">\n {MONTHS.map((i) => {\n const at = `${String(shown).padStart(4, \"0\")}-${String(i + 1).padStart(2, \"0\")}`;\n return (\n <Button\n key={at}\n variant={at === month ? \"soft\" : \"ghost\"}\n tone={at === month ? \"accent\" : \"neutral\"}\n size=\"sm\"\n fullWidth\n aria-label={`${name(\"long\", i)} ${shown}`}\n aria-current={at === month || undefined}\n disabled={\n (min !== undefined && at < min.slice(0, 7)) || (max !== undefined && at > max.slice(0, 7))\n }\n onClick={() => {\n setYear(null);\n onPick(at);\n }}\n >\n {name(\"short\", i)}\n </Button>\n );\n })}\n </div>\n </div>\n </Popover>\n );\n}\n\n/**\n * A month of days to pick one from, or to lay out a month's plans on (`renderDay`, `markDay`): the WAI-ARIA APG date\n * grid. One Tab stop on the focused day; arrows move by day and week, Page Up/Down by month (Shift: year), Home/End to\n * the week's ends, Enter or Space chooses.\n */\nexport function Calendar({\n value,\n defaultValue = null,\n onChange,\n defaultFocusedDate,\n month: monthProp,\n defaultMonth,\n onMonthChange,\n monthPicker = false,\n min,\n max,\n isDateDisabled,\n locale,\n weekStartsOn,\n today: todayProp,\n renderDay,\n markDay,\n labels,\n size = \"md\",\n className,\n style,\n}: CalendarProps) {\n const text = { ...DEFAULT_LABELS, ...labels };\n const id = useId();\n const today = todayProp ?? toISODate(new Date());\n const [selected, setSelected] = useControllableState<string | null>(\n value,\n defaultValue,\n onChange as ((date: string | null) => void) | undefined,\n );\n const [month, setMonth] = useControllableState<string>(\n monthProp?.slice(0, 7),\n () => (defaultMonth ?? clampDate(selected ?? defaultFocusedDate ?? today, min, max)).slice(0, 7),\n (next) => onMonthChange?.(`${next}-01`),\n );\n // The focused day is always a day of the month shown: the same day number, kept within the limits where it can be.\n const within = (date: string, m: string) => {\n if (date.slice(0, 7) === m) return date;\n const day = clampDate(inMonth(date, m), min, max);\n return day.slice(0, 7) === m ? day : inMonth(date, m);\n };\n const [focused, setFocusedState] = useState(() =>\n within(clampDate(selected ?? defaultFocusedDate ?? today, min, max), month),\n );\n const grid = useRef<HTMLTableElement>(null);\n const moveFocus = useRef(false);\n // The day to focus once its month is shown (asked for with the keys, a click, or a new value).\n const pending = useRef<string | null>(null);\n // A month to show after this render: an outside change to the selection, when the month is not controlled.\n const follow = useRef<string | null>(null);\n\n let day = focused;\n const shownValue = useRef(selected);\n if (shownValue.current !== selected) {\n shownValue.current = selected;\n if (selected?.slice(0, 7) === month) day = selected;\n else if (selected) {\n pending.current = selected;\n if (monthProp === undefined) follow.current = selected.slice(0, 7);\n }\n }\n const shownMonth = useRef(month);\n if (shownMonth.current !== month) {\n shownMonth.current = month;\n day = within(pending.current ?? day, month);\n pending.current = null;\n // Focus that was on a day stays in the grid, on the new month's day.\n if (grid.current?.contains(grid.current.ownerDocument.activeElement)) moveFocus.current = true;\n }\n if (day !== focused) setFocusedState(day);\n\n useClientLayoutEffect(() => {\n const next = follow.current;\n follow.current = null;\n if (next && next !== month) setMonth(next);\n if (!moveFocus.current) return;\n moveFocus.current = false;\n grid.current?.querySelector<HTMLElement>('[tabindex=\"0\"]')?.focus();\n });\n\n // The month as of the last request, so two presses before a render move two months.\n const live = useRef(month);\n live.current = month;\n /** Shows a month (or, when the month is controlled, asks for it), with the day to focus there. */\n const show = (m: string, date: string | null = null) => {\n pending.current = date;\n if (m === live.current) return;\n if (monthProp === undefined) live.current = m;\n setMonth(m);\n };\n const page = (by: number) => show(addMonths(`${live.current}-01`, by).slice(0, 7));\n const focus = (date: string) => {\n const to = clampDate(date, min, max);\n if (to.slice(0, 7) !== month) return show(to.slice(0, 7), to);\n if (to === focused) return;\n moveFocus.current = true;\n setFocusedState(to);\n };\n const off = (date: string) => (min !== undefined && date < min) || (max !== undefined && date > max);\n const disabled = (date: string) => off(date) || !!isDateDisabled?.(date);\n const choose = (date: string) => {\n if (disabled(date)) return;\n setSelected(date);\n };\n\n // The weeks shown: from the week holding the 1st to the week holding the last day.\n const weekStart = weekStartsOn ?? firstDayOfWeek(locale);\n const weekend = weekendDays(locale);\n const first = fromISODate(`${month}-01`) as Date;\n const lead = (first.getDay() - weekStart + 7) % 7;\n const gridStart = addDays(`${month}-01`, -lead);\n const daysInMonth = new Date(first.getFullYear(), first.getMonth() + 1, 0).getDate();\n const weeks = Math.ceil((lead + daysInMonth) / 7);\n const rows = Array.from({ length: weeks }, (_, w) =>\n Array.from({ length: 7 }, (_, d) => addDays(gridStart, w * 7 + d)),\n );\n\n const weekday = (style: \"long\" | \"short\") => new Intl.DateTimeFormat(locale, { weekday: style });\n const fullDate = new Intl.DateTimeFormat(locale, { dateStyle: \"full\" });\n const dayNumber = new Intl.DateTimeFormat(locale, { day: \"numeric\" });\n\n const onKeyDown = (event: KeyboardEvent<HTMLTableElement>) => {\n const across = isRtl(event.currentTarget) ? -1 : 1;\n const dow = ((fromISODate(focused) as Date).getDay() - weekStart + 7) % 7;\n const moves: Record<string, () => string> = {\n ArrowLeft: () => addDays(focused, -across),\n ArrowRight: () => addDays(focused, across),\n ArrowUp: () => addDays(focused, -7),\n ArrowDown: () => addDays(focused, 7),\n Home: () => addDays(focused, -dow),\n End: () => addDays(focused, 6 - dow),\n PageUp: () => addMonths(focused, event.shiftKey ? -12 : -1),\n PageDown: () => addMonths(focused, event.shiftKey ? 12 : 1),\n };\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n choose(focused);\n return;\n }\n const move = moves[event.key];\n if (!move) return;\n event.preventDefault();\n focus(move());\n };\n\n const nextMonth = addMonths(`${month}-01`, 1);\n const title = (\n <span className=\"cy-calendar-title cy-reset\" id={`${id}-title`} aria-live=\"polite\">\n {new Intl.DateTimeFormat(locale, { month: \"long\", year: \"numeric\" }).format(first)}\n </span>\n );\n return (\n <div\n className={className ? `cy-calendar ${className}` : \"cy-calendar\"}\n data-size={size}\n data-days={renderDay ? \"\" : undefined}\n style={style}\n >\n <div className=\"cy-calendar-head cy-reset\">\n <IconButton\n icon={chevronLeft}\n label={text.previous}\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n className=\"cy-calendar-flip\"\n disabled={min !== undefined && addDays(`${month}-01`, -1) < min}\n onClick={() => page(-1)}\n />\n {monthPicker ? (\n <MonthPicker\n month={month}\n onPick={show}\n min={min}\n max={max}\n locale={locale}\n text={text}\n size={size}\n >\n {title}\n </MonthPicker>\n ) : (\n title\n )}\n <IconButton\n icon={chevronRight}\n label={text.next}\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n className=\"cy-calendar-flip\"\n disabled={max !== undefined && nextMonth > max}\n onClick={() => page(1)}\n />\n </div>\n <table\n ref={grid}\n // biome-ignore lint/a11y/noNoninteractiveElementToInteractiveRole: the APG date grid is a table with role grid\n role=\"grid\"\n aria-labelledby={`${id}-title`}\n className=\"cy-calendar-grid cy-reset\"\n onKeyDown={onKeyDown}\n >\n <thead className=\"cy-reset\">\n <tr className=\"cy-reset\">\n {(rows[0] as string[]).map((date) => {\n const d = fromISODate(date) as Date;\n return (\n <th\n key={date}\n scope=\"col\"\n abbr={weekday(\"long\").format(d)}\n className=\"cy-calendar-weekday cy-reset\"\n >\n {weekday(\"short\").format(d)}\n </th>\n );\n })}\n </tr>\n </thead>\n <tbody className=\"cy-reset\">\n {rows.map((week) => (\n <tr key={week[0]} className=\"cy-reset\">\n {week.map((date) => {\n const at = fromISODate(date) as Date;\n const state: CalendarDayState = {\n selected: date === selected,\n today: date === today,\n outside: date.slice(0, 7) !== month,\n disabled: disabled(date),\n weekend: weekend.includes(at.getDay()),\n };\n const mark = markDay?.(date, state);\n const dots = mark?.dots?.slice(0, MAX_DOTS);\n return (\n // biome-ignore lint/a11y/useKeyWithClickEvents: the grid handles the keys for every day (roving focus)\n <td\n key={date}\n // biome-ignore lint/a11y/noNoninteractiveElementToInteractiveRole: a day of the APG date grid\n role=\"gridcell\"\n tabIndex={date === focused ? 0 : -1}\n aria-selected={state.selected}\n aria-disabled={state.disabled || undefined}\n aria-current={state.today ? \"date\" : undefined}\n data-outside={state.outside ? \"\" : undefined}\n data-tone={mark?.tone}\n data-date={date}\n className=\"cy-calendar-day cy-reset\"\n onClick={() => {\n focus(date);\n choose(date);\n }}\n >\n {/* The name is the full date, any mark's label, then any content; the number alone is seen. */}\n <span className=\"cy-visually-hidden\">\n {fullDate.format(at)}\n {mark?.label && `, ${mark.label}`}\n </span>\n <span className=\"cy-calendar-number cy-reset\" aria-hidden=\"true\">\n {dayNumber.format(at)}\n </span>\n {dots && dots.length > 0 && (\n <span className=\"cy-calendar-dots cy-reset\" aria-hidden=\"true\">\n {dots.map((dot, i) => {\n const tone = TONES.includes(dot);\n return (\n <span\n key={`${i}${dot}`}\n className=\"cy-calendar-dot cy-reset\"\n data-tone={tone ? dot : undefined}\n style={tone ? undefined : ({ \"--_tone\": dot } as CSSProperties)}\n />\n );\n })}\n </span>\n )}\n {renderDay && (\n <span className=\"cy-calendar-extra cy-reset\">{renderDay(date, state)}</span>\n )}\n </td>\n );\n })}\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A,CAAA;AAAA,E;AAET"}
1
+ {"version":3,"file":"Calendar.js","names":["useControllableState","chevronDown","useClientLayoutEffect","Button","isRtl","IconButton","chevronRight","chevronLeft","Popover","addDays","addMonths","clampDate","firstDayOfWeek","fromISODate","inMonth","toISODate","weekendDays","useId","useRef","useState","jsx","jsxs","DEFAULT_LABELS","TONES","MAX_DOTS","MONTHS","_","i","MonthPicker","month","children","onPick","min","max","locale","text","size","year","setYear","shown","name","style","yearStep","by","label","icon","off","open","props","at","Calendar","value","defaultValue","onChange","defaultFocusedDate","monthProp","defaultMonth","onMonthChange","monthPicker","isDateDisabled","weekStartsOn","todayProp","renderDay","markDay","labels","className","id","today","selected","setSelected","setMonth","next","within","date","m","day","focused","setFocusedState","grid","moveFocus","pending","follow","shownValue","shownMonth","live","show","page","focus","to","disabled","choose","weekStart","weekend","first","lead","gridStart","daysInMonth","weeks","rows","w","d","weekday","fullDate","dayNumber","onKeyDown","event","across","dow","moves","move","nextMonth","title","week","state","mark","dots","dot","tone"],"sources":["../../../src/components/Calendar/Calendar.tsx"],"sourcesContent":["import { type CSSProperties, type KeyboardEvent, type ReactNode, useId, useRef, useState } from \"react\";\nimport { useClientLayoutEffect } from \"../../foundations/client-layout-effect.js\";\nimport { useControllableState } from \"../../foundations/controllable.js\";\nimport { isRtl } from \"../../foundations/dir.js\";\nimport { chevronDown } from \"../../icons/chevron-down.js\";\nimport { chevronLeft } from \"../../icons/chevron-left.js\";\nimport { chevronRight } from \"../../icons/chevron-right.js\";\nimport type { Size, Tone } from \"../../tokens/schema.js\";\nimport { Button } from \"../Button/Button.js\";\nimport { IconButton } from \"../IconButton/IconButton.js\";\nimport { Popover } from \"../Popover/Popover.js\";\nimport {\n addDays,\n addMonths,\n clampDate,\n firstDayOfWeek,\n fromISODate,\n inMonth,\n toISODate,\n weekendDays,\n} from \"./dates.js\";\n\nexport interface CalendarTokens {\n /** Size of a day cell (it never drops below the touch hit area). */\n cellSize: string;\n /** Background of the selected day. */\n selectedBackground: string;\n /** With `renderDay`: the least height of a day (never below the hit area). */\n contentSize: string;\n /** How much of a marked day's tone is mixed into its background (a percentage). */\n toneMix: string;\n /** Size of a day's dots. */\n dotSize: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n calendar: CalendarTokens;\n }\n}\n\nexport interface CalendarDayState {\n /** The day is the selected date. */\n selected: boolean;\n /** The day is today. */\n today: boolean;\n /** A day of the previous or next month, shown to fill the weeks. */\n outside: boolean;\n /** The day cannot be chosen: outside `min` and `max`, or `isDateDisabled`. */\n disabled: boolean;\n /** A weekend day in the `locale` (Saturday and Sunday where the browser does not know the locale's weekend). */\n weekend: boolean;\n}\n\n/** How `markDay` marks a day. Every part is optional. */\nexport interface CalendarDayMark {\n /** Tints the day's background softly with this tone. Give a `label` too when the colour means something. */\n tone?: Tone | undefined;\n /**\n * Small dots under the day's number, one per entry: a tone, or any CSS colour (a category's colour). At most three\n * are drawn; further entries are dropped.\n */\n dots?: readonly (Tone | (string & {}))[] | undefined;\n /** Added to the day's accessible name after its date (\"3 tasks\", \"Weekend\"), so the marks are not colour alone. */\n label?: string | undefined;\n}\n\nexport interface CalendarLabels {\n /** The button to the month before. Default \"Previous month\". */\n previous: string;\n /** The button to the month after. Default \"Next month\". */\n next: string;\n /** With `monthPicker`: names the panel of months and years, and is added to the heading button's name. Default \"Choose month and year\". */\n monthPicker: string;\n /** With `monthPicker`: the button to the year before. Default \"Previous year\". */\n previousYear: string;\n /** With `monthPicker`: the button to the year after. Default \"Next year\". */\n nextYear: string;\n}\n\nexport interface CalendarProps {\n /** The selected date, `YYYY-MM-DD`, or null for none. */\n value?: string | null;\n /** The date selected at first, when uncontrolled. */\n defaultValue?: string | null;\n /** Called when a day is chosen, with its date as `YYYY-MM-DD`. */\n onChange?: (date: string) => void;\n /** The date focus starts on when nothing is selected. Default: today. */\n defaultFocusedDate?: string;\n /**\n * The month shown, controlled: `YYYY-MM`, or any `YYYY-MM-DD` date of that month. The grid then only moves when this\n * changes: paging, the month picker, keys that leave the month and choosing a day of another month call\n * `onMonthChange` and wait for it. A new `value` in another month does not move a controlled month.\n */\n month?: string | undefined;\n /** The month shown at first, when uncontrolled (`YYYY-MM` or `YYYY-MM-DD`). Default: the month of the selected or focused date. */\n defaultMonth?: string | undefined;\n /**\n * Called with the first day of a month (`YYYY-MM-01`) when the month shown changes (to load that month's events) or,\n * with `month`, when another month is asked for.\n */\n onMonthChange?: (firstDay: string) => void;\n /**\n * Turns the month heading into a button that opens a panel to jump to any month and year. Months and years outside\n * `min` and `max` cannot be chosen. Default false.\n */\n monthPicker?: boolean | undefined;\n /** Earliest and latest dates that can be reached and chosen. */\n min?: string | undefined;\n /** Latest date (`YYYY-MM-DD`) that can be reached and chosen. */\n max?: string | undefined;\n /** Dates that can be focused but not chosen (fully booked, weekends). */\n isDateDisabled?: ((date: string) => boolean) | undefined;\n /** Locale for month and day names (and the first day of the week). Default: the browser's. */\n locale?: string | undefined;\n /** 0 Sunday to 6 Saturday. Default: the locale's first day, else Monday. */\n weekStartsOn?: number | undefined;\n /** What counts as today. Default: the device's date. */\n today?: string | undefined;\n /** Extra content inside a day, under its number: a dot for events, a planner's items. */\n renderDay?: ((date: string, state: CalendarDayState) => ReactNode) | undefined;\n /**\n * Marks a day without drawing it: return `{ tone, dots, label }` to tint its background, put up to three dots under\n * its number and add words to its name, or nothing to leave it plain. Weekends: `(_, day) => day.weekend ? { tone:\n * \"neutral\", label: \"Weekend\" } : undefined`.\n */\n markDay?: ((date: string, state: CalendarDayState) => CalendarDayMark | undefined) | undefined;\n /** Replace the built-in English text: the month buttons, and the month picker's name and year buttons. */\n labels?: Partial<CalendarLabels>;\n /** Size of the day cells and text. Default \"md\". */\n size?: Size;\n /** Added to the root element, for layout. */\n className?: string;\n /** Layout only. Restyle through --cy-calendar-* tokens. */\n style?: CSSProperties;\n}\n\nconst DEFAULT_LABELS: CalendarLabels = {\n previous: \"Previous month\",\n next: \"Next month\",\n monthPicker: \"Choose month and year\",\n previousYear: \"Previous year\",\n nextYear: \"Next year\",\n};\n\nconst TONES: readonly string[] = [\"accent\", \"neutral\", \"danger\", \"success\", \"warning\", \"info\"];\nconst MAX_DOTS = 3;\nconst MONTHS = Array.from({ length: 12 }, (_, i) => i);\n\n/** The heading as a button, and its panel: a year to step through and that year's twelve months. */\nfunction MonthPicker({\n month,\n children,\n onPick,\n min,\n max,\n locale,\n text,\n size,\n}: {\n month: string;\n children: ReactNode;\n onPick: (month: string) => void;\n min: string | undefined;\n max: string | undefined;\n locale: string | undefined;\n text: CalendarLabels;\n size: Size;\n}) {\n // The year the panel shows while open; null while closed.\n const [year, setYear] = useState<number | null>(null);\n const shown = year ?? Number(month.slice(0, 4));\n const name = (style: \"long\" | \"short\", i: number) =>\n new Intl.DateTimeFormat(locale, { month: style }).format(new Date(2001, i, 1));\n const yearStep = (by: number, label: string, icon: typeof chevronLeft, off: boolean) => (\n <IconButton\n icon={icon}\n label={label}\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n flipRtl\n disabled={off}\n onClick={() => setYear(shown + by)}\n />\n );\n return (\n <Popover\n label={text.monthPicker}\n size=\"sm\"\n open={year !== null}\n onOpenChange={(open) => setYear(open ? Number(month.slice(0, 4)) : null)}\n trigger={(props) => (\n <Button\n {...props}\n variant=\"ghost\"\n tone=\"neutral\"\n size={size === \"lg\" ? \"md\" : \"sm\"}\n iconEnd={chevronDown}\n className=\"cy-calendar-jump\"\n >\n {children}\n <span className=\"cy-visually-hidden\">{text.monthPicker}</span>\n </Button>\n )}\n >\n <div className=\"cy-calendar-picker cy-reset\">\n <div className=\"cy-calendar-head cy-reset\">\n {yearStep(\n -1,\n text.previousYear,\n chevronLeft,\n min !== undefined && shown <= Number(min.slice(0, 4)),\n )}\n <span className=\"cy-calendar-title cy-reset\" aria-live=\"polite\">\n {new Intl.DateTimeFormat(locale, { year: \"numeric\" }).format(new Date(shown, 0, 1))}\n </span>\n {yearStep(1, text.nextYear, chevronRight, max !== undefined && shown >= Number(max.slice(0, 4)))}\n </div>\n <div className=\"cy-calendar-months cy-reset\">\n {MONTHS.map((i) => {\n const at = `${String(shown).padStart(4, \"0\")}-${String(i + 1).padStart(2, \"0\")}`;\n return (\n <Button\n key={at}\n variant={at === month ? \"soft\" : \"ghost\"}\n tone={at === month ? \"accent\" : \"neutral\"}\n size=\"sm\"\n fullWidth\n aria-label={`${name(\"long\", i)} ${shown}`}\n aria-current={at === month || undefined}\n disabled={\n (min !== undefined && at < min.slice(0, 7)) || (max !== undefined && at > max.slice(0, 7))\n }\n onClick={() => {\n setYear(null);\n onPick(at);\n }}\n >\n {name(\"short\", i)}\n </Button>\n );\n })}\n </div>\n </div>\n </Popover>\n );\n}\n\n/**\n * A month of days to pick one from, or to lay out a month's plans on (`renderDay`, `markDay`): the WAI-ARIA APG date\n * grid. One Tab stop on the focused day; arrows move by day and week, Page Up/Down by month (Shift: year), Home/End to\n * the week's ends, Enter or Space chooses.\n */\nexport function Calendar({\n value,\n defaultValue = null,\n onChange,\n defaultFocusedDate,\n month: monthProp,\n defaultMonth,\n onMonthChange,\n monthPicker = false,\n min,\n max,\n isDateDisabled,\n locale,\n weekStartsOn,\n today: todayProp,\n renderDay,\n markDay,\n labels,\n size = \"md\",\n className,\n style,\n}: CalendarProps) {\n const text = { ...DEFAULT_LABELS, ...labels };\n const id = useId();\n const today = todayProp ?? toISODate(new Date());\n const [selected, setSelected] = useControllableState<string | null>(\n value,\n defaultValue,\n onChange as ((date: string | null) => void) | undefined,\n );\n const [month, setMonth] = useControllableState<string>(\n monthProp?.slice(0, 7),\n () => (defaultMonth ?? clampDate(selected ?? defaultFocusedDate ?? today, min, max)).slice(0, 7),\n (next) => onMonthChange?.(`${next}-01`),\n );\n // The focused day is always a day of the month shown: the same day number, kept within the limits where it can be.\n const within = (date: string, m: string) => {\n if (date.slice(0, 7) === m) return date;\n const day = clampDate(inMonth(date, m), min, max);\n return day.slice(0, 7) === m ? day : inMonth(date, m);\n };\n const [focused, setFocusedState] = useState(() =>\n within(clampDate(selected ?? defaultFocusedDate ?? today, min, max), month),\n );\n const grid = useRef<HTMLTableElement>(null);\n const moveFocus = useRef(false);\n // The day to focus once its month is shown (asked for with the keys, a click, or a new value).\n const pending = useRef<string | null>(null);\n // A month to show after this render: an outside change to the selection, when the month is not controlled.\n const follow = useRef<string | null>(null);\n\n let day = focused;\n const shownValue = useRef(selected);\n if (shownValue.current !== selected) {\n shownValue.current = selected;\n if (selected?.slice(0, 7) === month) day = selected;\n else if (selected) {\n pending.current = selected;\n if (monthProp === undefined) follow.current = selected.slice(0, 7);\n }\n }\n const shownMonth = useRef(month);\n if (shownMonth.current !== month) {\n shownMonth.current = month;\n day = within(pending.current ?? day, month);\n pending.current = null;\n // Focus that was on a day stays in the grid, on the new month's day.\n if (grid.current?.contains(grid.current.ownerDocument.activeElement)) moveFocus.current = true;\n }\n if (day !== focused) setFocusedState(day);\n\n useClientLayoutEffect(() => {\n const next = follow.current;\n follow.current = null;\n if (next && next !== month) setMonth(next);\n if (!moveFocus.current) return;\n moveFocus.current = false;\n grid.current?.querySelector<HTMLElement>('[tabindex=\"0\"]')?.focus();\n });\n\n // The month as of the last request, so two presses before a render move two months.\n const live = useRef(month);\n live.current = month;\n /** Shows a month (or, when the month is controlled, asks for it), with the day to focus there. */\n const show = (m: string, date: string | null = null) => {\n pending.current = date;\n if (m === live.current) return;\n if (monthProp === undefined) live.current = m;\n setMonth(m);\n };\n const page = (by: number) => show(addMonths(`${live.current}-01`, by).slice(0, 7));\n const focus = (date: string) => {\n const to = clampDate(date, min, max);\n if (to.slice(0, 7) !== month) return show(to.slice(0, 7), to);\n if (to === focused) return;\n moveFocus.current = true;\n setFocusedState(to);\n };\n const off = (date: string) => (min !== undefined && date < min) || (max !== undefined && date > max);\n const disabled = (date: string) => off(date) || !!isDateDisabled?.(date);\n const choose = (date: string) => {\n if (disabled(date)) return;\n setSelected(date);\n };\n\n // The weeks shown: from the week holding the 1st to the week holding the last day.\n const weekStart = weekStartsOn ?? firstDayOfWeek(locale);\n const weekend = weekendDays(locale);\n const first = fromISODate(`${month}-01`) as Date;\n const lead = (first.getDay() - weekStart + 7) % 7;\n const gridStart = addDays(`${month}-01`, -lead);\n const daysInMonth = new Date(first.getFullYear(), first.getMonth() + 1, 0).getDate();\n const weeks = Math.ceil((lead + daysInMonth) / 7);\n const rows = Array.from({ length: weeks }, (_, w) =>\n Array.from({ length: 7 }, (_, d) => addDays(gridStart, w * 7 + d)),\n );\n\n const weekday = (style: \"long\" | \"short\") => new Intl.DateTimeFormat(locale, { weekday: style });\n const fullDate = new Intl.DateTimeFormat(locale, { dateStyle: \"full\" });\n const dayNumber = new Intl.DateTimeFormat(locale, { day: \"numeric\" });\n\n const onKeyDown = (event: KeyboardEvent<HTMLTableElement>) => {\n const across = isRtl(event.currentTarget) ? -1 : 1;\n const dow = ((fromISODate(focused) as Date).getDay() - weekStart + 7) % 7;\n const moves: Record<string, () => string> = {\n ArrowLeft: () => addDays(focused, -across),\n ArrowRight: () => addDays(focused, across),\n ArrowUp: () => addDays(focused, -7),\n ArrowDown: () => addDays(focused, 7),\n Home: () => addDays(focused, -dow),\n End: () => addDays(focused, 6 - dow),\n PageUp: () => addMonths(focused, event.shiftKey ? -12 : -1),\n PageDown: () => addMonths(focused, event.shiftKey ? 12 : 1),\n };\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n choose(focused);\n return;\n }\n const move = moves[event.key];\n if (!move) return;\n event.preventDefault();\n focus(move());\n };\n\n const nextMonth = addMonths(`${month}-01`, 1);\n const title = (\n <span className=\"cy-calendar-title cy-reset\" id={`${id}-title`} aria-live=\"polite\">\n {new Intl.DateTimeFormat(locale, { month: \"long\", year: \"numeric\" }).format(first)}\n </span>\n );\n return (\n <div\n className={className ? `cy-calendar ${className}` : \"cy-calendar\"}\n data-size={size}\n data-days={renderDay ? \"\" : undefined}\n style={style}\n >\n <div className=\"cy-calendar-head cy-reset\">\n <IconButton\n icon={chevronLeft}\n label={text.previous}\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n flipRtl\n disabled={min !== undefined && addDays(`${month}-01`, -1) < min}\n onClick={() => page(-1)}\n />\n {monthPicker ? (\n <MonthPicker\n month={month}\n onPick={show}\n min={min}\n max={max}\n locale={locale}\n text={text}\n size={size}\n >\n {title}\n </MonthPicker>\n ) : (\n title\n )}\n <IconButton\n icon={chevronRight}\n label={text.next}\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n flipRtl\n disabled={max !== undefined && nextMonth > max}\n onClick={() => page(1)}\n />\n </div>\n <table\n ref={grid}\n // biome-ignore lint/a11y/noNoninteractiveElementToInteractiveRole: the APG date grid is a table with role grid\n role=\"grid\"\n aria-labelledby={`${id}-title`}\n className=\"cy-calendar-grid cy-reset\"\n onKeyDown={onKeyDown}\n >\n <thead className=\"cy-reset\">\n <tr className=\"cy-reset\">\n {(rows[0] as string[]).map((date) => {\n const d = fromISODate(date) as Date;\n return (\n <th\n key={date}\n scope=\"col\"\n abbr={weekday(\"long\").format(d)}\n className=\"cy-calendar-weekday cy-reset\"\n >\n {weekday(\"short\").format(d)}\n </th>\n );\n })}\n </tr>\n </thead>\n <tbody className=\"cy-reset\">\n {rows.map((week) => (\n <tr key={week[0]} className=\"cy-reset\">\n {week.map((date) => {\n const at = fromISODate(date) as Date;\n const state: CalendarDayState = {\n selected: date === selected,\n today: date === today,\n outside: date.slice(0, 7) !== month,\n disabled: disabled(date),\n weekend: weekend.includes(at.getDay()),\n };\n const mark = markDay?.(date, state);\n const dots = mark?.dots?.slice(0, MAX_DOTS);\n return (\n // biome-ignore lint/a11y/useKeyWithClickEvents: the grid handles the keys for every day (roving focus)\n <td\n key={date}\n // biome-ignore lint/a11y/noNoninteractiveElementToInteractiveRole: a day of the APG date grid\n role=\"gridcell\"\n tabIndex={date === focused ? 0 : -1}\n aria-selected={state.selected}\n aria-disabled={state.disabled || undefined}\n aria-current={state.today ? \"date\" : undefined}\n data-outside={state.outside ? \"\" : undefined}\n data-tone={mark?.tone}\n data-date={date}\n className=\"cy-calendar-day cy-reset\"\n onClick={() => {\n focus(date);\n choose(date);\n }}\n >\n {/* The name is the full date, any mark's label, then any content; the number alone is seen. */}\n <span className=\"cy-visually-hidden\">\n {fullDate.format(at)}\n {mark?.label && `, ${mark.label}`}\n </span>\n <span className=\"cy-calendar-number cy-reset\" aria-hidden=\"true\">\n {dayNumber.format(at)}\n </span>\n {dots && dots.length > 0 && (\n <span className=\"cy-calendar-dots cy-reset\" aria-hidden=\"true\">\n {dots.map((dot, i) => {\n const tone = TONES.includes(dot);\n return (\n <span\n key={`${i}${dot}`}\n className=\"cy-calendar-dot cy-reset\"\n data-tone={tone ? dot : undefined}\n style={tone ? undefined : ({ \"--_tone\": dot } as CSSProperties)}\n />\n );\n })}\n </span>\n )}\n {renderDay && (\n <span className=\"cy-calendar-extra cy-reset\">{renderDay(date, state)}</span>\n )}\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAyIA,IAAMsB,KAAiC;AAAA,EACrC,UAAU;AAAA,EACV,MAAM;AAAA,EACN,aAAa;AAAA,EACb,cAAc;AAAA,EACd,UAAU;AACZ,GAEMC,KAA2B;AAAA,EAAC;AAAA,EAAU;AAAA,EAAW;AAAA,EAAU;AAAA,EAAW;AAAA,EAAW;AAAM,GACvFC,KAAW,GACXC,KAAS,MAAM,KAAK,EAAE,QAAQ,GAAG,GAAA,CAAIC,GAAGC,MAAMA,CAAC;AAGrD,SAASC,GAAY,EACnB,OAAAC,GACA,UAAAC,GACA,QAAAC,GACA,KAAAC,GACA,KAAAC,GACA,QAAAC,GACA,MAAAC,GACA,MAAAC,EAAA,GAUC;AAED,QAAM,CAACC,GAAMC,CAAA,IAAWnB,GAAwB,IAAI,GAC9CoB,IAAQF,KAAQ,OAAOR,EAAM,MAAM,GAAG,CAAC,CAAC,GACxCW,IAAA,CAAQC,GAAyBd,MACrC,IAAI,KAAK,eAAeO,G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IAAA,CAAKC,GAAKzF,OAAM;AACpB,0BAAM0F,KAAO9F,GAAM,SAAS6F,CAAG;AAC/B,2BACE,gBAAAhG,EAAC,QAAD;AAAA,sBAEE,WAAU;AAAA,sBACV,aAAWiG,KAAOD,IAAM;AAAA,sBACxB,OAAOC,KAAO,SAAa,EAAE,WAAWD,EAAI;AAAA,oBAC7C,GAJM,GAAGzF,EAAA,GAAIyF,CAAA,EAIb;AAAA,kBAEL,CAAC;AAAA,gBACG,CAAA;AAAA,gBAEPtD,KACC,gBAAA1C,EAAC,QAAD;AAAA,kBAAM,WAAU;AAAA,kBAA8B,UAAA0C,EAAUW,GAAMwC,CAAK;AAAA,gBAAQ,CAAA;AAAA,cAE3E;AAAA,YA1CG,GAAAxC,CA0CH;AAAA,UAER,CAAC;AAAA,QACC,GA5DKuC,EAAK,CAAA,CA4DV,CACL;AAAA,MACI,CAAA,CACF;AAAA,IACJ,CAAA,CAAA;AAAA,E;AAET"}
@@ -1,6 +1,8 @@
1
- import { type CSSProperties, type MouseEventHandler, type ReactNode } from "react";
1
+ import { type AriaAttributes, type CSSProperties, type MouseEventHandler, type ReactNode } from "react";
2
2
  import type { Tone } from "../../tokens/schema.js";
3
3
  export interface CardTokens {
4
+ /** Border colour of the current card of a set (`aria-current`). Default: the accent. */
5
+ currentBorder: string;
4
6
  bg: string;
5
7
  border: string;
6
8
  radius: string;
@@ -49,6 +51,11 @@ export interface CardProps {
49
51
  children?: ReactNode;
50
52
  /** Accessible name of the card, set on the card element. */
51
53
  "aria-label"?: string;
54
+ /**
55
+ * Marks a link or button card as the current one of a set: `"page"` for the page being shown (a card grid of
56
+ * sections), or `"step"`, `"location"`, `true`. Read by screen readers, and the card's border takes the accent.
57
+ */
58
+ "aria-current"?: AriaAttributes["aria-current"];
52
59
  /** Set on the card element, to find it in tests. */
53
60
  "data-testid"?: string;
54
61
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","names":["Tag","ButtonBase","LinkBase","forwardRef","jsx","jsxs","TONES","Card","props","ref","actions","style","card","variant","padding","tone","as","href","target","onClick","disabled","edge","className","children","rest","custom","common"],"sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type ElementType,\n forwardRef,\n type MouseEventHandler,\n type ReactNode,\n} from \"react\";\nimport { ButtonBase } from \"../../foundations/ButtonBase/ButtonBase.js\";\nimport { LinkBase } from \"../../foundations/LinkBase/LinkBase.js\";\nimport type { Tone } from \"../../tokens/schema.js\";\n\nexport interface CardTokens {\n bg: string;\n border: string;\n radius: string;\n shadow: string;\n softMix: string;\n edgeWidth: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n card: CardTokens;\n }\n}\n\nconst TONES: readonly string[] = [\"accent\", \"neutral\", \"danger\", \"success\", \"warning\", \"info\"];\n\nexport interface CardProps {\n /** `surface` raised panel, `outline` border only, `soft` tone-tinted fill. */\n variant?: \"surface\" | \"outline\" | \"soft\";\n /** Space between the card's edge and its content. Default \"md\". */\n padding?: \"none\" | \"sm\" | \"md\" | \"lg\";\n /** Semantic colour. Default \"neutral\". */\n tone?: Tone;\n /**\n * A coloured edge on the card's inline-start side (left in left-to-right text), e.g. a task's category. A tone name\n * uses that tone's colour; any other string is a CSS colour. Colour alone carries no meaning for many people: say\n * the same thing in the card's text or a Badge. Default: no edge.\n */\n edge?: Tone | (string & {});\n /** Element for a static card. Ignored when `href` or `onClick` makes the whole card interactive. */\n as?: \"div\" | \"section\" | \"article\" | \"li\" | \"aside\";\n /** Makes the whole card a link (rendered through LinkBase, so unsafe schemes are not linked). */\n href?: string;\n /** With `href`: where it opens, e.g. `_blank`. */\n target?: string;\n /** Makes the whole card a button. */\n onClick?: MouseEventHandler<HTMLElement>;\n /** With `onClick` (and no `href`): the card cannot be pressed. */\n disabled?: boolean;\n /**\n * Buttons that sit on the card but act on their own (a game card's 2-player mode, a file card's menu). They are placed\n * over the card's top end, outside its one link or button, so nothing interactive is nested.\n */\n actions?: ReactNode;\n /** Added to the card element, for layout. */\n className?: string;\n /** Layout only. */\n style?: CSSProperties;\n /** The card's content. Keep it non-interactive when the card is a link or a button. */\n children?: ReactNode;\n /** Accessible name of the card, set on the card element. */\n \"aria-label\"?: string;\n /** Set on the card element, to find it in tests. */\n \"data-testid\"?: string;\n}\n\n/** Content container. With `href` or `onClick` the whole card is one link or button (no nested controls). */\nexport const Card = forwardRef<HTMLElement, CardProps>(function CardRender(props, ref) {\n // With actions, the card itself stays one target and the actions are its siblings in a shared frame. Layout\n // (`style`) goes on the frame; the card fills it.\n if (props.actions !== undefined && (props.href !== undefined || props.onClick)) {\n const { actions, style, ...card } = props;\n return (\n <div className=\"cy-card-frame cy-reset\" style={style}>\n <Card ref={ref} {...card} />\n <div className=\"cy-card-actions cy-reset\">{actions}</div>\n </div>\n );\n }\n const {\n variant = \"surface\",\n padding = \"md\",\n tone = \"neutral\",\n as = \"div\",\n href,\n target,\n onClick,\n disabled,\n actions,\n edge,\n className,\n style,\n children,\n ...rest\n } = props;\n // A tone name is mapped to its token in CSS; any other colour is handed over as a private custom property.\n const custom = !!edge && !TONES.includes(edge);\n const common = {\n ...rest,\n className: className ? `cy-card ${className}` : \"cy-card\",\n style: custom ? ({ \"--_edge\": edge, ...style } as CSSProperties) : style,\n \"data-edge\": edge ? (custom ? \"custom\" : edge) : undefined,\n \"data-variant\": variant,\n \"data-padding\": padding,\n \"data-tone\": tone,\n };\n if (href !== undefined)\n return (\n <LinkBase\n ref={ref as never}\n {...common}\n href={href}\n target={target}\n data-interactive=\"\"\n onClick={onClick}\n >\n {children}\n </LinkBase>\n );\n if (onClick)\n return (\n <ButtonBase ref={ref as never} {...common} onClick={onClick} disabled={disabled} data-interactive=\"\">\n {children}\n </ButtonBase>\n );\n const Tag = as as ElementType;\n return (\n <Tag ref={ref} {...common}>\n {children}\n {actions !== undefined && <div className=\"cy-card-actions cy-reset\">{actions}</div>}\n </Tag>\n );\n});\nCard.displayName = \"Card\";\n"],"mappings":";;;;;AA0BA,IAA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AiB;AAAA,IACR,SAAAC;AAAA,IAER,UAAAI;AAAA,EACO,CAAA,IAEVJ,IAEA,gBAAAf,EAACH,GAAD;AAAA,IAAiB,KAAAQ;AAAA,IAAc,GAAIiB;AAAA,IAAiB,SAAAP;AAAA,IAAmB,UAAAC;AAAA,IAAU,oBAAiB;AAAA,IAC/F,UAAAG;AAAA,EACS,CAAA,IAId,gBAAAlB,EAACL,GAAD;AAAA,IAAU,KAAAS;AAAA,IAAK,GAAIiB;AAAA,IAAnB,UAAA,CACGH,GACAb,MAAY,UAAa,gBAAAN,EAAC,OAAD;AAAA,MAAK,WAAU;AAAA,MAA4B,UAAAM;AAAA,IAAa,CAAA,CAC/E;AAAA,E;AAET,CAAC;AACDH,EAAK,cAAc"}
1
+ {"version":3,"file":"Card.js","names":["Tag","ButtonBase","LinkBase","forwardRef","jsx","jsxs","TONES","Card","props","ref","actions","style","card","variant","padding","tone","as","href","target","onClick","disabled","edge","className","children","rest","custom","common"],"sources":["../../../src/components/Card/Card.tsx"],"sourcesContent":["import {\n type AriaAttributes,\n type CSSProperties,\n type ElementType,\n forwardRef,\n type MouseEventHandler,\n type ReactNode,\n} from \"react\";\nimport { ButtonBase } from \"../../foundations/ButtonBase/ButtonBase.js\";\nimport { LinkBase } from \"../../foundations/LinkBase/LinkBase.js\";\nimport type { Tone } from \"../../tokens/schema.js\";\n\nexport interface CardTokens {\n /** Border colour of the current card of a set (`aria-current`). Default: the accent. */\n currentBorder: string;\n bg: string;\n border: string;\n radius: string;\n shadow: string;\n softMix: string;\n edgeWidth: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n card: CardTokens;\n }\n}\n\nconst TONES: readonly string[] = [\"accent\", \"neutral\", \"danger\", \"success\", \"warning\", \"info\"];\n\nexport interface CardProps {\n /** `surface` raised panel, `outline` border only, `soft` tone-tinted fill. */\n variant?: \"surface\" | \"outline\" | \"soft\";\n /** Space between the card's edge and its content. Default \"md\". */\n padding?: \"none\" | \"sm\" | \"md\" | \"lg\";\n /** Semantic colour. Default \"neutral\". */\n tone?: Tone;\n /**\n * A coloured edge on the card's inline-start side (left in left-to-right text), e.g. a task's category. A tone name\n * uses that tone's colour; any other string is a CSS colour. Colour alone carries no meaning for many people: say\n * the same thing in the card's text or a Badge. Default: no edge.\n */\n edge?: Tone | (string & {});\n /** Element for a static card. Ignored when `href` or `onClick` makes the whole card interactive. */\n as?: \"div\" | \"section\" | \"article\" | \"li\" | \"aside\";\n /** Makes the whole card a link (rendered through LinkBase, so unsafe schemes are not linked). */\n href?: string;\n /** With `href`: where it opens, e.g. `_blank`. */\n target?: string;\n /** Makes the whole card a button. */\n onClick?: MouseEventHandler<HTMLElement>;\n /** With `onClick` (and no `href`): the card cannot be pressed. */\n disabled?: boolean;\n /**\n * Buttons that sit on the card but act on their own (a game card's 2-player mode, a file card's menu). They are placed\n * over the card's top end, outside its one link or button, so nothing interactive is nested.\n */\n actions?: ReactNode;\n /** Added to the card element, for layout. */\n className?: string;\n /** Layout only. */\n style?: CSSProperties;\n /** The card's content. Keep it non-interactive when the card is a link or a button. */\n children?: ReactNode;\n /** Accessible name of the card, set on the card element. */\n \"aria-label\"?: string;\n /**\n * Marks a link or button card as the current one of a set: `\"page\"` for the page being shown (a card grid of\n * sections), or `\"step\"`, `\"location\"`, `true`. Read by screen readers, and the card's border takes the accent.\n */\n \"aria-current\"?: AriaAttributes[\"aria-current\"];\n /** Set on the card element, to find it in tests. */\n \"data-testid\"?: string;\n}\n\n/** Content container. With `href` or `onClick` the whole card is one link or button (no nested controls). */\nexport const Card = forwardRef<HTMLElement, CardProps>(function CardRender(props, ref) {\n // With actions, the card itself stays one target and the actions are its siblings in a shared frame. Layout\n // (`style`) goes on the frame; the card fills it.\n if (props.actions !== undefined && (props.href !== undefined || props.onClick)) {\n const { actions, style, ...card } = props;\n return (\n <div className=\"cy-card-frame cy-reset\" style={style}>\n <Card ref={ref} {...card} />\n <div className=\"cy-card-actions cy-reset\">{actions}</div>\n </div>\n );\n }\n const {\n variant = \"surface\",\n padding = \"md\",\n tone = \"neutral\",\n as = \"div\",\n href,\n target,\n onClick,\n disabled,\n actions,\n edge,\n className,\n style,\n children,\n ...rest\n } = props;\n // A tone name is mapped to its token in CSS; any other colour is handed over as a private custom property.\n const custom = !!edge && !TONES.includes(edge);\n const common = {\n ...rest,\n className: className ? `cy-card ${className}` : \"cy-card\",\n style: custom ? ({ \"--_edge\": edge, ...style } as CSSProperties) : style,\n \"data-edge\": edge ? (custom ? \"custom\" : edge) : undefined,\n \"data-variant\": variant,\n \"data-padding\": padding,\n \"data-tone\": tone,\n };\n if (href !== undefined)\n return (\n <LinkBase\n ref={ref as never}\n {...common}\n href={href}\n target={target}\n data-interactive=\"\"\n onClick={onClick}\n >\n {children}\n </LinkBase>\n );\n if (onClick)\n return (\n <ButtonBase ref={ref as never} {...common} onClick={onClick} disabled={disabled} data-interactive=\"\">\n {children}\n </ButtonBase>\n );\n const Tag = as as ElementType;\n return (\n <Tag ref={ref} {...common}>\n {children}\n {actions !== undefined && <div className=\"cy-card-actions cy-reset\">{actions}</div>}\n </Tag>\n );\n});\nCard.displayName = \"Card\";\n"],"mappings":";;;;;AA6BA,IAAMM,IAA2B;AAAA,EAAC;AAAA,EAAU;AAAA,EAAW;AAAA,EAAU;AAAA,EAAW;AAAA,EAAW;AAAM,GAgDhFC,IAAOJ,EAAmC,SAAoBK,GAAOC,GAAK;AAGrF,MAAID,EAAM,YAAY,WAAcA,EAAM,SAAS,UAAaA,EAAM,UAAU;AAC9E,UAAM,EAAE,SAAAE,GAAS,OAAAC,GAAO,GAAGC,EAAA,IAASJ;AACpC,WACE,gBAAAH,EAAC,OAAD;AAAA,MAAK,WAAU;AAAA,MAAgC,OAAAM;AAAA,MAA/C,UAAA,CACE,gBAAAP,EAACG,GAAD;AAAA,QAAW,KAAAE;AAAA,QAAK,GAAIG;AAAA,MAAO,CAAA,GAC3B,gBAAAR,EAAC,OAAD;AAAA,QAAK,WAAU;AAAA,QAA4B,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oiceRowProps } from "./ChoiceRow.js";
1
+ import { type ChoiceControlProps } from "../Choice/Choice.js";
2
2
  export interface CheckboxTokens {
3
3
  size: string;
4
4
  radius: string;
@@ -11,7 +11,7 @@ declare module "../../tokens/schema.js" {
11
11
  checkbox: CheckboxTokens;
12
12
  }
13
13
  }
14
- export interface CheckboxProps extends ChoiceRowProps {
14
+ export interface CheckboxProps extends ChoiceControlProps {
15
15
  /** Mixed state (announced as "mixed"), e.g. a partially selected "select all". */
16
16
  indeterminate?: boolean;
17
17
  /**
@@ -20,5 +20,5 @@ export interface CheckboxProps extends ChoiceRowProps {
20
20
  */
21
21
  strikeWhenChecked?: boolean;
22
22
  }
23
- /** Checkbox on a native input: forms, reset, required and keyboard come for free. */
24
- export declare function Checkbox({ strikeWhenChecked, ...props }: CheckboxProps): import("react").JSX.Element;
23
+ /** Checkbox on a native input, in a Choice row: forms, reset, required and keyboard come for free. */
24
+ export declare function Checkbox({ indeterminate, strikeWhenChecked, size, tone, className, ...props }: CheckboxProps): import("react").JSX.Element;
@@ -1,15 +1,40 @@
1
1
  "use client";
2
- import { ChoiceRow as r } from "./ChoiceRow.js";
3
- import { jsx as i } from "react/jsx-runtime";
4
- function n({ strikeWhenChecked: o = !1, ...e }) {
5
- return /* @__PURE__ */ i(r, {
6
- kind: "checkbox",
7
- strike: o,
8
- ...e
2
+ import { Icon as r } from "../../foundations/Icon/Icon.js";
3
+ import { check as n } from "../../icons/check.js";
4
+ import { ChoiceBase as h } from "../../foundations/ChoiceBase/ChoiceBase.js";
5
+ import { minus as f } from "../../icons/minus.js";
6
+ import { Choice as p } from "../Choice/Choice.js";
7
+ import { jsx as c, jsxs as x } from "react/jsx-runtime";
8
+ function C({ indeterminate: m = !1, strikeWhenChecked: a = !1, size: o = "md", tone: s = "accent", className: e, ...t }) {
9
+ return /* @__PURE__ */ c(p, {
10
+ ...t,
11
+ size: o,
12
+ strikeWhenChecked: a,
13
+ className: `cy-checkbox-row${e ? ` ${e}` : ""}`,
14
+ control: (i) => /* @__PURE__ */ x("span", {
15
+ className: "cy-checkbox",
16
+ "data-size": o,
17
+ "data-tone": s,
18
+ children: [
19
+ /* @__PURE__ */ c(h, {
20
+ ...i,
21
+ type: "checkbox",
22
+ indeterminate: m
23
+ }),
24
+ /* @__PURE__ */ c(r, {
25
+ icon: n,
26
+ className: "cy-checkbox-mark"
27
+ }),
28
+ /* @__PURE__ */ c(r, {
29
+ icon: f,
30
+ className: "cy-checkbox-dash"
31
+ })
32
+ ]
33
+ })
9
34
  });
10
35
  }
11
36
  export {
12
- n as Checkbox
37
+ C as Checkbox
13
38
  };
14
39
 
15
40
  //# sourceMappingURL=Checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","names":["ChoiceRow","jsx","Checkbox","strikeWhenChecked","props"],"sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import { ChoiceRow, type ChoiceRowProps } from \"./ChoiceRow.js\";\n\nexport interface CheckboxTokens {\n size: string;\n radius: string;\n border: string;\n doneColor: string;\n strikeWidth: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n checkbox: CheckboxTokens;\n }\n}\n\nexport interface CheckboxProps extends ChoiceRowProps {\n /** Mixed state (announced as \"mixed\"), e.g. a partially selected \"select all\". */\n indeterminate?: boolean;\n /**\n * Checklist style: while the box is checked, the label is struck through and muted (and the description muted), so\n * a done task reads as done. Not applied while `indeterminate`. Default false.\n */\n strikeWhenChecked?: boolean;\n}\n\n/** Checkbox on a native input: forms, reset, required and keyboard come for free. */\nexport function Checkbox({ strikeWhenChecked = false, ...props }: CheckboxProps) {\n return <ChoiceRow kind=\"checkbox\" strike={strikeWhenChecked} {...props} />;\n}\n"],"mappings":";;;AA2BA,SAAgBE,EAAS,EAAE,mBAAAC,IAAoB,IAAO,GAAGC,EAAA,GAAwB;AAC/E,SAAO,gBAAAH,EAACD,GAAD;AAAA,IAAW,MAAK;AAAA,IAAW,QAAQG;AAAA,IAAmB,GAAIC;AAAA,EAAQ,CAAA;AAC3E"}
1
+ {"version":3,"file":"Checkbox.js","names":["Icon","check","ChoiceBase","minus","Choice","jsx","jsxs","Checkbox","indeterminate","strikeWhenChecked","size","tone","className","props","input"],"sources":["../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import { ChoiceBase } from \"../../foundations/ChoiceBase/ChoiceBase.js\";\nimport { Icon } from \"../../foundations/Icon/Icon.js\";\nimport { check } from \"../../icons/check.js\";\nimport { minus } from \"../../icons/minus.js\";\nimport { Choice, type ChoiceControlProps } from \"../Choice/Choice.js\";\n\nexport interface CheckboxTokens {\n size: string;\n radius: string;\n border: string;\n doneColor: string;\n strikeWidth: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n checkbox: CheckboxTokens;\n }\n}\n\nexport interface CheckboxProps extends ChoiceControlProps {\n /** Mixed state (announced as \"mixed\"), e.g. a partially selected \"select all\". */\n indeterminate?: boolean;\n /**\n * Checklist style: while the box is checked, the label is struck through and muted (and the description muted), so\n * a done task reads as done. Not applied while `indeterminate`. Default false.\n */\n strikeWhenChecked?: boolean;\n}\n\n/** Checkbox on a native input, in a Choice row: forms, reset, required and keyboard come for free. */\nexport function Checkbox({\n indeterminate = false,\n strikeWhenChecked = false,\n size = \"md\",\n tone = \"accent\",\n className,\n ...props\n}: CheckboxProps) {\n return (\n <Choice\n {...props}\n size={size}\n strikeWhenChecked={strikeWhenChecked}\n // The row carries the checkbox's own class too: it maps the checkbox's done tokens onto the row's.\n className={`cy-checkbox-row${className ? ` ${className}` : \"\"}`}\n control={(input) => (\n <span className=\"cy-checkbox\" data-size={size} data-tone={tone}>\n <ChoiceBase {...input} type=\"checkbox\" indeterminate={indeterminate} />\n <Icon icon={check} className=\"cy-checkbox-mark\" />\n <Icon icon={minus} className=\"cy-checkbox-dash\" />\n </span>\n )}\n />\n );\n}\n"],"mappings":";;;;;;;AA+BA,SAAgBO,EAAS,EACvB,eAAAC,IAAgB,IAChB,mBAAAC,IAAoB,IACpB,MAAAC,IAAO,MACP,MAAAC,IAAO,UACP,WAAAC,GACA,GAAGC,EAAA,GACa;AAChB,SACE,gBAAAR,EAACD,GAAD;AAAA,IACE,GAAIS;AAAA,IACE,MAAAH;AAAA,IACa,mBAAAD;AAAA,IAEnB,WAAW,kBAAkBG,IAAY,IAAIA,CAAA,KAAc,EAAA;AAAA,IAC3D,SAAA,CAAUE,MACR,gBAAAR,EAAC,QAAD;AAAA,MAAM,WAAU;AAAA,MAAc,aAAWI;AAAA,MAAM,aAAWC;AAAA,MAA1D,UAAA;AAAA,QACE,gBAAAN,EAACH,GAAD;AAAA,UAAY,GAAIY;AAAA,UAAO,MAAK;AAAA,UAA0B,eAAAN;AAAA,QAAgB,CAAA;AAAA,QACtE,gBAAAH,EAACL,GAAD;AAAA,UAAM,MAAMC;AAAA,UAAO,WAAU;AAAA,QAAoB,CAAA;AAAA,QACjD,gBAAAI,EAACL,GAAD;AAAA,UAAM,MAAMG;AAAA,UAAO,WAAU;AAAA,QAAoB,CAAA;AAAA,MAC7C;AAAA,I;A,EAET,CAAA;AAEL"}