@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
@@ -2,14 +2,14 @@
2
2
  import { useClientLayoutEffect as u } from "../client-layout-effect.js";
3
3
  import { useRef as m } from "react";
4
4
  import { jsx as d } from "react/jsx-runtime";
5
- function E({ name: c, value: i, form: a, required: o, requiredMessage: s = "Please choose a value.", onReset: t, disabled: f, onInvalid: r }) {
5
+ function E({ name: c, value: i, form: a, required: s, requiredMessage: o = "Please choose a value.", onReset: t, disabled: f, onInvalid: r }) {
6
6
  const n = m(null);
7
7
  return u(() => {
8
- n.current?.setCustomValidity(o && !i ? s : "");
8
+ n.current?.setCustomValidity(s && !i ? o : "");
9
9
  }, [
10
- o,
10
+ s,
11
11
  i,
12
- s
12
+ o
13
13
  ]), u(() => {
14
14
  const e = n.current;
15
15
  if (!(!e || !r))
@@ -20,7 +20,7 @@ function E({ name: c, value: i, form: a, required: o, requiredMessage: s = "Plea
20
20
  return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
21
21
  }, [t]), /* @__PURE__ */ d("input", {
22
22
  ref: n,
23
- className: "cy-hidden-value",
23
+ className: "cy-visually-hidden",
24
24
  name: c,
25
25
  form: a,
26
26
  value: i,
@@ -1 +1 @@
1
- {"version":3,"file":"HiddenValue.js","names":["useClientLayoutEffect","useRef","jsx","HiddenValue","name","value","form","required","requiredMessage","onReset","disabled","onInvalid","ref","input","owner"],"sources":["../../../src/foundations/HiddenValue/HiddenValue.tsx"],"sourcesContent":["import { useRef } from \"react\";\nimport { useClientLayoutEffect } from \"../client-layout-effect.js\";\n\nexport interface HiddenValueProps {\n /** Form field name the value is submitted under. */\n name?: string | undefined;\n /** The value to submit. */\n value: string;\n /** `id` of the form to submit with, when rendered outside it. */\n form?: string | undefined;\n /** Fails form validation while value is empty. */\n required?: boolean | undefined;\n /** Message used when required and empty. */\n requiredMessage?: string;\n /** Called when the owning form is reset, so the widget can restore its default. */\n onReset?: (() => void) | undefined;\n /** Disabled values are neither submitted nor validated (like native disabled controls). */\n disabled?: boolean | undefined;\n /**\n * Called when validation fails. Call `event.preventDefault()` to stop the browser reporting on this hidden input,\n * then focus and explain on the widget's visible control instead.\n */\n onInvalid?: ((event: Event) => void) | undefined;\n}\n\n/** Foundation: lets custom widgets (Select) take part in native forms: FormData, reset, required and disabled. */\nexport function HiddenValue({\n name,\n value,\n form,\n required,\n requiredMessage = \"Please choose a value.\",\n onReset,\n disabled,\n onInvalid,\n}: HiddenValueProps) {\n const ref = useRef<HTMLInputElement>(null);\n useClientLayoutEffect(() => {\n ref.current?.setCustomValidity(required && !value ? requiredMessage : \"\");\n }, [required, value, requiredMessage]);\n useClientLayoutEffect(() => {\n const input = ref.current;\n if (!input || !onInvalid) return;\n input.addEventListener(\"invalid\", onInvalid);\n return () => input.removeEventListener(\"invalid\", onInvalid);\n }, [onInvalid]);\n useClientLayoutEffect(() => {\n const owner = ref.current?.form;\n if (!owner || !onReset) return;\n owner.addEventListener(\"reset\", onReset);\n return () => owner.removeEventListener(\"reset\", onReset);\n }, [onReset]);\n // A text input (not type=hidden) so constraint validation applies; it is visually and semantically hidden.\n return (\n <input\n ref={ref}\n className=\"cy-hidden-value\"\n name={name}\n form={form}\n value={value}\n disabled={disabled}\n onChange={() => {}}\n tabIndex={-1}\n aria-hidden=\"true\"\n />\n );\n}\n"],"mappings":";;;;AA0BA,SAAgBG,EAAY,EAC1B,MAAAC,GACA,OAAAC,GACA,MAAAC,GACA,UAAAC,GACA,iBAAAC,IAAkB,0BAClB,SAAAC,GACA,UAAAC,GACA,WAAAC,EAAA,GACmB;AACnB,QAAMC,IAAMX,EAAyB,IAAI;AACzC,SAAAD,EAAA,MAA4B;AAC1B,IAAAY,EAAI,SAAS,kBAAkBL,KAAY,CAACF,IAAQG,IAAkB,EAAE;AAAA,EAC1E,GAAG;AAAA,IAACD;AAAA,IAAUF;AAAA,IAAOG;AAAA,EAAe,CAAC,GACrCR,EAAA,MAA4B;AAC1B,UAAMa,IAAQD,EAAI;AAClB,QAAI,GAACC,KAAS,CAACF;AACf,aAAAE,EAAM,iBAAiB,WAAWF,CAAS,GAC3C,MAAaE,EAAM,oBAAoB,WAAWF,CAAS;AAAA,EAC7D,GAAG,CAACA,CAAS,CAAC,GACdX,EAAA,MAA4B;AAC1B,UAAMc,IAAQF,EAAI,SAAS;AAC3B,QAAI,GAACE,KAAS,CAACL;AACf,aAAAK,EAAM,iBAAiB,SAASL,CAAO,GACvC,MAAaK,EAAM,oBAAoB,SAASL,CAAO;AAAA,EACzD,GAAG,CAACA,CAAO,CAAC,GAGV,gBAAAP,EAAC,SAAD;AAAA,IACO,KAAAU;AAAA,IACL,WAAU;AAAA,IACJ,MAAAR;AAAA,IACA,MAAAE;AAAA,IACC,OAAAD;AAAA,IACG,UAAAK;AAAA,IACV,UAAA,MAAgB;AAAA,IAAC;AAAA,IACjB,UAAU;AAAA,IACV,eAAY;AAAA,EACb,CAAA;AAEL"}
1
+ {"version":3,"file":"HiddenValue.js","names":["useClientLayoutEffect","useRef","jsx","HiddenValue","name","value","form","required","requiredMessage","onReset","disabled","onInvalid","ref","input","owner"],"sources":["../../../src/foundations/HiddenValue/HiddenValue.tsx"],"sourcesContent":["import { useRef } from \"react\";\nimport { useClientLayoutEffect } from \"../client-layout-effect.js\";\n\nexport interface HiddenValueProps {\n /** Form field name the value is submitted under. */\n name?: string | undefined;\n /** The value to submit. */\n value: string;\n /** `id` of the form to submit with, when rendered outside it. */\n form?: string | undefined;\n /** Fails form validation while value is empty. */\n required?: boolean | undefined;\n /** Message used when required and empty. */\n requiredMessage?: string;\n /** Called when the owning form is reset, so the widget can restore its default. */\n onReset?: (() => void) | undefined;\n /** Disabled values are neither submitted nor validated (like native disabled controls). */\n disabled?: boolean | undefined;\n /**\n * Called when validation fails. Call `event.preventDefault()` to stop the browser reporting on this hidden input,\n * then focus and explain on the widget's visible control instead.\n */\n onInvalid?: ((event: Event) => void) | undefined;\n}\n\n/** Foundation: lets custom widgets (Select) take part in native forms: FormData, reset, required and disabled. */\nexport function HiddenValue({\n name,\n value,\n form,\n required,\n requiredMessage = \"Please choose a value.\",\n onReset,\n disabled,\n onInvalid,\n}: HiddenValueProps) {\n const ref = useRef<HTMLInputElement>(null);\n useClientLayoutEffect(() => {\n ref.current?.setCustomValidity(required && !value ? requiredMessage : \"\");\n }, [required, value, requiredMessage]);\n useClientLayoutEffect(() => {\n const input = ref.current;\n if (!input || !onInvalid) return;\n input.addEventListener(\"invalid\", onInvalid);\n return () => input.removeEventListener(\"invalid\", onInvalid);\n }, [onInvalid]);\n useClientLayoutEffect(() => {\n const owner = ref.current?.form;\n if (!owner || !onReset) return;\n owner.addEventListener(\"reset\", onReset);\n return () => owner.removeEventListener(\"reset\", onReset);\n }, [onReset]);\n // A text input (not type=hidden) so constraint validation applies; it is visually and semantically hidden.\n return (\n <input\n ref={ref}\n className=\"cy-visually-hidden\"\n name={name}\n form={form}\n value={value}\n disabled={disabled}\n onChange={() => {}}\n tabIndex={-1}\n aria-hidden=\"true\"\n />\n );\n}\n"],"mappings":";;;;AA0BA,SAAgBG,EAAY,EAC1B,MAAAC,GACA,OAAAC,GACA,MAAAC,GACA,UAAAC,GACA,iBAAAC,IAAkB,0BAClB,SAAAC,GACA,UAAAC,GACA,WAAAC,EAAA,GACmB;AACnB,QAAMC,IAAMX,EAAyB,IAAI;AACzC,SAAAD,EAAA,MAA4B;AAC1B,IAAAY,EAAI,SAAS,kBAAkBL,KAAY,CAACF,IAAQG,IAAkB,EAAE;AAAA,EAC1E,GAAG;AAAA,IAACD;AAAA,IAAUF;AAAA,IAAOG;AAAA,EAAe,CAAC,GACrCR,EAAA,MAA4B;AAC1B,UAAMa,IAAQD,EAAI;AAClB,QAAI,GAACC,KAAS,CAACF;AACf,aAAAE,EAAM,iBAAiB,WAAWF,CAAS,GAC3C,MAAaE,EAAM,oBAAoB,WAAWF,CAAS;AAAA,EAC7D,GAAG,CAACA,CAAS,CAAC,GACdX,EAAA,MAA4B;AAC1B,UAAMc,IAAQF,EAAI,SAAS;AAC3B,QAAI,GAACE,KAAS,CAACL;AACf,aAAAK,EAAM,iBAAiB,SAASL,CAAO,GACvC,MAAaK,EAAM,oBAAoB,SAASL,CAAO;AAAA,EACzD,GAAG,CAACA,CAAO,CAAC,GAGV,gBAAAP,EAAC,SAAD;AAAA,IACO,KAAAU;AAAA,IACL,WAAU;AAAA,IACJ,MAAAR;AAAA,IACA,MAAAE;AAAA,IACC,OAAAD;AAAA,IACG,UAAAK;AAAA,IACV,UAAA,MAAgB;AAAA,IAAC;AAAA,IACjB,UAAU;AAAA,IACV,eAAY;AAAA,EACb,CAAA;AAEL"}
@@ -12,6 +12,11 @@ export interface IconProps {
12
12
  tone?: Tone | "inherit" | "muted";
13
13
  /** Any CSS colour; overrides `tone` for one-off cases. `brand` draws a brand mark in its owner's colour. */
14
14
  color?: string;
15
+ /**
16
+ * The icon points along the reading direction (a chevron for previous or next, an arrow for back): it is mirrored
17
+ * in right-to-left text. Default false.
18
+ */
19
+ flipRtl?: boolean;
15
20
  /** Added to the `<svg>` element, for layout. */
16
21
  className?: string;
17
22
  /** Layout only. */
@@ -21,4 +26,4 @@ export interface IconProps {
21
26
  * Foundation: renders a Facet icon (stroke, currentColor) or a brand mark (filled, exactly as its owner publishes it)
22
27
  * as inline SVG.
23
28
  */
24
- export declare function Icon({ icon, label, size, tone, color, className, style }: IconProps): import("react").JSX.Element;
29
+ export declare function Icon({ icon, label, size, tone, color, flipRtl, className, style, }: IconProps): import("react").JSX.Element;
@@ -1,34 +1,35 @@
1
1
  "use client";
2
- import { createElement as f } from "react";
3
- import { jsx as p } from "react/jsx-runtime";
4
- function u({ icon: e, label: t, size: i = "md", tone: o = "inherit", color: a, className: n, style: d }) {
5
- const c = typeof i == "number" ? { "--cy-icon-size": `${i}px` } : void 0, r = a === "brand" ? e.brand ? `#${e.brand.hex}` : void 0 : a;
6
- return /* @__PURE__ */ p("svg", {
7
- className: n ? `cy-reset cy-icon ${n}` : "cy-reset cy-icon",
2
+ import { createElement as p } from "react";
3
+ import { jsx as v } from "react/jsx-runtime";
4
+ function h({ icon: e, label: t, size: i = "md", tone: a = "inherit", color: o, flipRtl: d = !1, className: r, style: c }) {
5
+ const l = typeof i == "number" ? { "--cy-icon-size": `${i}px` } : void 0, n = o === "brand" ? e.brand ? `#${e.brand.hex}` : void 0 : o;
6
+ return /* @__PURE__ */ v("svg", {
7
+ className: r ? `cy-reset cy-icon ${r}` : "cy-reset cy-icon",
8
8
  viewBox: "0 0 24 24",
9
9
  "data-size": typeof i == "number" ? void 0 : i,
10
10
  "data-motion": e.motion,
11
11
  "data-fill": e.fill ? "" : void 0,
12
- "data-tone": o === "inherit" ? void 0 : o,
12
+ "data-tone": a === "inherit" ? void 0 : a,
13
+ "data-flip-rtl": d ? "" : void 0,
13
14
  style: {
14
- ...c,
15
- ...r ? { color: r } : {},
16
- ...d
15
+ ...l,
16
+ ...n ? { color: n } : {},
17
+ ...c
17
18
  },
18
19
  focusable: "false",
19
20
  ...t ? {
20
21
  role: "img",
21
22
  "aria-label": t
22
23
  } : { "aria-hidden": !0 },
23
- children: e.body.map(([m, { animate: l, ...s }], y) => f(m, {
24
+ children: e.body.map(([m, { animate: s, ...f }], y) => p(m, {
24
25
  key: y,
25
- ...s,
26
- className: l ? "cy-icon-animate" : void 0
26
+ ...f,
27
+ className: s ? "cy-icon-animate" : void 0
27
28
  }))
28
29
  });
29
30
  }
30
31
  export {
31
- u as Icon
32
+ h as Icon
32
33
  };
33
34
 
34
35
  //# sourceMappingURL=Icon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.js","names":["createElement","jsx","Icon","icon","label","size","tone","color","className","style","sizing","paint","tag","animate","attrs","i"],"sources":["../../../src/foundations/Icon/Icon.tsx"],"sourcesContent":["import { type CSSProperties, createElement } from \"react\";\nimport type { IconData } from \"../../icons/types.js\";\nimport type { Tone } from \"../../tokens/schema.js\";\n\nexport interface IconProps {\n /** The icon to draw: a Facet icon or a brand mark. */\n icon: IconData;\n /** Gives the icon `role=\"img\"` and this accessible name. Omit for decorative icons. */\n label?: string;\n /** A named size, or a number of pixels. Default \"md\". */\n size?: \"sm\" | \"md\" | \"lg\" | number;\n /** Semantic colour. `inherit` (default) uses the current text colour. */\n tone?: Tone | \"inherit\" | \"muted\";\n /** Any CSS colour; overrides `tone` for one-off cases. `brand` draws a brand mark in its owner's colour. */\n color?: string;\n /** Added to the `<svg>` element, for layout. */\n className?: string;\n /** Layout only. */\n style?: CSSProperties;\n}\n\n/**\n * Foundation: renders a Facet icon (stroke, currentColor) or a brand mark (filled, exactly as its owner publishes it)\n * as inline SVG.\n */\nexport function Icon({ icon, label, size = \"md\", tone = \"inherit\", color, className, style }: IconProps) {\n const sizing = typeof size === \"number\" ? ({ \"--cy-icon-size\": `${size}px` } as CSSProperties) : undefined;\n const paint = color === \"brand\" ? (icon.brand ? `#${icon.brand.hex}` : undefined) : color;\n return (\n // biome-ignore lint/a11y/noSvgWithoutTitle: named via aria-label when labelled, aria-hidden when decorative\n <svg\n className={className ? `cy-reset cy-icon ${className}` : \"cy-reset cy-icon\"}\n viewBox=\"0 0 24 24\"\n data-size={typeof size === \"number\" ? undefined : size}\n data-motion={icon.motion}\n data-fill={icon.fill ? \"\" : undefined}\n data-tone={tone === \"inherit\" ? undefined : tone}\n style={{ ...sizing, ...(paint ? { color: paint } : {}), ...style }}\n focusable=\"false\"\n {...(label ? { role: \"img\", \"aria-label\": label } : { \"aria-hidden\": true })}\n >\n {icon.body.map(([tag, { animate, ...attrs }], i) =>\n createElement(tag, { key: i, ...attrs, className: animate ? \"cy-icon-animate\" : undefined }),\n )}\n </svg>\n );\n}\n"],"mappings":";;;AAyBA,SAAgBE,EAAK,EAAE,MAAAC,GAAM,OAAAC,GAAO,MAAAC,IAAO,MAAM,MAAAC,IAAO,WAAW,OAAAC,GAAO,WAAAC,GAAW,OAAAC,EAAA,GAAoB;AACvG,QAAMC,IAAS,OAAOL,KAAS,WAAY,EAAE,kBAAkB,GAAGA,CAAA,KAAS,IAAsB,QAC3FM,IAAQJ,MAAU,UAAWJ,EAAK,QAAQ,IAAIA,EAAK,MAAM,GAAA,KAAQ,SAAaI;AACpF,SAEE,gBAAAN,EAAC,OAAD;AAAA,IACE,WAAWO,IAAY,oBAAoBA,CAAA,KAAc;AAAA,IACzD,SAAQ;AAAA,IACR,aAAW,OAAOH,KAAS,WAAW,SAAYA;AAAA,IAClD,eAAaF,EAAK;AAAA,IAClB,aAAWA,EAAK,OAAO,KAAK;AAAA,IAC5B,aAAWG,MAAS,YAAY,SAAYA;AAAA,IAC5C,OAAO;AAAA,MAAE,GAAGI;AAAA,MAAQ,GAAIC,IAAQ,EAAE,OAAOA,EAAM,IAAI,CAAC;AAAA,MAAI,GAAGF;AAAA,IAAM;AAAA,IACjE,WAAU;AAAA,IACV,GAAKL,IAAQ;AAAA,MAAE,MAAM;AAAA,MAAO,cAAcA;AAAA,IAAM,IAAI,EAAE,eAAe,GAAK;AAAA,IAEzE,UAAAD,EAAK,KAAK,IAAA,CAAK,CAACS,GAAK,EAAE,SAAAC,GAAS,GAAGC,EAAA,CAAA,GAAUC,MAC5Cf,EAAcY,GAAK;AAAA,MAAE,KAAKG;AAAA,MAAG,GAAGD;AAAA,MAAO,WAAWD,IAAU,oBAAoB;AAAA,IAAU,CAAC,CAC7F;AAAA,EACG,CAAA;AAET"}
1
+ {"version":3,"file":"Icon.js","names":["createElement","jsx","Icon","icon","label","size","tone","color","flipRtl","className","style","sizing","paint","tag","animate","attrs","i"],"sources":["../../../src/foundations/Icon/Icon.tsx"],"sourcesContent":["import { type CSSProperties, createElement } from \"react\";\nimport type { IconData } from \"../../icons/types.js\";\nimport type { Tone } from \"../../tokens/schema.js\";\n\nexport interface IconProps {\n /** The icon to draw: a Facet icon or a brand mark. */\n icon: IconData;\n /** Gives the icon `role=\"img\"` and this accessible name. Omit for decorative icons. */\n label?: string;\n /** A named size, or a number of pixels. Default \"md\". */\n size?: \"sm\" | \"md\" | \"lg\" | number;\n /** Semantic colour. `inherit` (default) uses the current text colour. */\n tone?: Tone | \"inherit\" | \"muted\";\n /** Any CSS colour; overrides `tone` for one-off cases. `brand` draws a brand mark in its owner's colour. */\n color?: string;\n /**\n * The icon points along the reading direction (a chevron for previous or next, an arrow for back): it is mirrored\n * in right-to-left text. Default false.\n */\n flipRtl?: boolean;\n /** Added to the `<svg>` element, for layout. */\n className?: string;\n /** Layout only. */\n style?: CSSProperties;\n}\n\n/**\n * Foundation: renders a Facet icon (stroke, currentColor) or a brand mark (filled, exactly as its owner publishes it)\n * as inline SVG.\n */\nexport function Icon({\n icon,\n label,\n size = \"md\",\n tone = \"inherit\",\n color,\n flipRtl = false,\n className,\n style,\n}: IconProps) {\n const sizing = typeof size === \"number\" ? ({ \"--cy-icon-size\": `${size}px` } as CSSProperties) : undefined;\n const paint = color === \"brand\" ? (icon.brand ? `#${icon.brand.hex}` : undefined) : color;\n return (\n // biome-ignore lint/a11y/noSvgWithoutTitle: named via aria-label when labelled, aria-hidden when decorative\n <svg\n className={className ? `cy-reset cy-icon ${className}` : \"cy-reset cy-icon\"}\n viewBox=\"0 0 24 24\"\n data-size={typeof size === \"number\" ? undefined : size}\n data-motion={icon.motion}\n data-fill={icon.fill ? \"\" : undefined}\n data-tone={tone === \"inherit\" ? undefined : tone}\n data-flip-rtl={flipRtl ? \"\" : undefined}\n style={{ ...sizing, ...(paint ? { color: paint } : {}), ...style }}\n focusable=\"false\"\n {...(label ? { role: \"img\", \"aria-label\": label } : { \"aria-hidden\": true })}\n >\n {icon.body.map(([tag, { animate, ...attrs }], i) =>\n createElement(tag, { key: i, ...attrs, className: animate ? \"cy-icon-animate\" : undefined }),\n )}\n </svg>\n );\n}\n"],"mappings":";;;AA8BA,SAAgBE,EAAK,EACnB,MAAAC,GACA,OAAAC,GACA,MAAAC,IAAO,MACP,MAAAC,IAAO,WACP,OAAAC,GACA,SAAAC,IAAU,IACV,WAAAC,GACA,OAAAC,EAAA,GACY;AACZ,QAAMC,IAAS,OAAON,KAAS,WAAY,EAAE,kBAAkB,GAAGA,CAAA,KAAS,IAAsB,QAC3FO,IAAQL,MAAU,UAAWJ,EAAK,QAAQ,IAAIA,EAAK,MAAM,GAAA,KAAQ,SAAaI;AACpF,SAEE,gBAAAN,EAAC,OAAD;AAAA,IACE,WAAWQ,IAAY,oBAAoBA,CAAA,KAAc;AAAA,IACzD,SAAQ;AAAA,IACR,aAAW,OAAOJ,KAAS,WAAW,SAAYA;AAAA,IAClD,eAAaF,EAAK;AAAA,IAClB,aAAWA,EAAK,OAAO,KAAK;AAAA,IAC5B,aAAWG,MAAS,YAAY,SAAYA;AAAA,IAC5C,iBAAeE,IAAU,KAAK;AAAA,IAC9B,OAAO;AAAA,MAAE,GAAGG;AAAA,MAAQ,GAAIC,IAAQ,EAAE,OAAOA,EAAM,IAAI,CAAC;AAAA,MAAI,GAAGF;AAAA,IAAM;AAAA,IACjE,WAAU;AAAA,IACV,GAAKN,IAAQ;AAAA,MAAE,MAAM;AAAA,MAAO,cAAcA;AAAA,IAAM,IAAI,EAAE,eAAe,GAAK;AAAA,IAEzE,UAAAD,EAAK,KAAK,IAAA,CAAK,CAACU,GAAK,EAAE,SAAAC,GAAS,GAAGC,EAAA,CAAA,GAAUC,MAC5ChB,EAAca,GAAK;AAAA,MAAE,KAAKG;AAAA,MAAG,GAAGD;AAAA,MAAO,WAAWD,IAAU,oBAAoB;AAAA,IAAU,CAAC,CAC7F;AAAA,EACG,CAAA;AAET"}
@@ -1,12 +1,17 @@
1
1
  import { type RefObject } from "react";
2
- /** Whether a picture is still on its way, arrived, or could not be shown. */
3
- export type ImageOutcome = "loading" | "loaded" | "error";
2
+ /**
3
+ * Whether a picture is still on its way, arrived, or could not be shown. `pending` is before any script has looked at
4
+ * it (the server's HTML, and a page that is never hydrated): the picture is shown as the browser has it.
5
+ */
6
+ export type ImageOutcome = "pending" | "loading" | "loaded" | "error";
4
7
  /**
5
8
  * Follows one `<img>` from loading to loaded or failed. `key` names the picture (its `src`, with `srcSet` if any): a
6
9
  * new key starts again from "loading", whatever happened to the last one. Give the img a React `key` of the same
7
10
  * value, so `complete` never describes the picture before, and call `loaded` and `failed` from its `onLoad` and
8
11
  * `onError`. A picture that finished before React attached (cached, or sent in the server's HTML) fires neither
9
- * event, so it is also read from the element when the key changes. Image and Avatar use it.
12
+ * event, so it is also read from the element when the key changes. Until script runs the outcome is `pending`, so
13
+ * markup rendered on the server shows its picture even on a page that is never hydrated; on mount an unfinished
14
+ * picture becomes `loading` before the first paint. Image and Avatar use it.
10
15
  */
11
16
  export declare function useImageOutcome(img: RefObject<HTMLImageElement | null>, key: string): {
12
17
  outcome: ImageOutcome;
@@ -1,11 +1,15 @@
1
1
  "use client";
2
- import { useClientLayoutEffect as d } from "./client-layout-effect.js";
3
- import { useState as m } from "react";
4
- function s(l, e) {
5
- const [u, t] = m();
6
- return d(() => {
7
- const o = l.current;
8
- if (!o?.complete) return;
2
+ import { useClientLayoutEffect as l } from "./client-layout-effect.js";
3
+ import { useState as i } from "react";
4
+ function s(d, e) {
5
+ const [u, t] = i();
6
+ return l(() => {
7
+ const o = d.current;
8
+ if (!o) return;
9
+ if (!o.complete) return t({
10
+ key: e,
11
+ outcome: "loading"
12
+ });
9
13
  if (o.naturalWidth > 0) return t({
10
14
  key: e,
11
15
  outcome: "loaded"
@@ -21,7 +25,7 @@ function s(l, e) {
21
25
  n = !1;
22
26
  };
23
27
  }, [e]), {
24
- outcome: u?.key === e ? u.outcome : "loading",
28
+ outcome: u?.key === e ? u.outcome : "pending",
25
29
  loaded: () => t({
26
30
  key: e,
27
31
  outcome: "loaded"
@@ -1 +1 @@
1
- {"version":3,"file":"image-outcome.js","names":["useClientLayoutEffect","useState","useImageOutcome","img","key","settled","setSettled","el","current","settle","outcome","resolve"],"sources":["../../src/foundations/image-outcome.ts"],"sourcesContent":["import { type RefObject, useState } from \"react\";\nimport { useClientLayoutEffect } from \"./client-layout-effect.js\";\n\n/** Whether a picture is still on its way, arrived, or could not be shown. */\nexport type ImageOutcome = \"loading\" | \"loaded\" | \"error\";\n\n/**\n * Follows one `<img>` from loading to loaded or failed. `key` names the picture (its `src`, with `srcSet` if any): a\n * new key starts again from \"loading\", whatever happened to the last one. Give the img a React `key` of the same\n * value, so `complete` never describes the picture before, and call `loaded` and `failed` from its `onLoad` and\n * `onError`. A picture that finished before React attached (cached, or sent in the server's HTML) fires neither\n * event, so it is also read from the element when the key changes. Image and Avatar use it.\n */\nexport function useImageOutcome(img: RefObject<HTMLImageElement | null>, key: string) {\n const [settled, setSettled] = useState<{ key: string; outcome: ImageOutcome }>();\n useClientLayoutEffect(() => {\n const el = img.current;\n if (!el?.complete) return;\n if (el.naturalWidth > 0) return setSettled({ key, outcome: \"loaded\" });\n // Finished with no size: broken, or a picture without one of its own (some SVG). Decoding tells them apart.\n let current = true;\n const settle = (outcome: ImageOutcome) => () => {\n if (current) setSettled({ key, outcome });\n };\n new Promise((resolve) => resolve(el.decode())).then(settle(\"loaded\"), settle(\"error\"));\n return () => {\n current = false;\n };\n }, [key]);\n return {\n outcome: settled?.key === key ? settled.outcome : (\"loading\" as ImageOutcome),\n loaded: () => setSettled({ key, outcome: \"loaded\" }),\n failed: () => setSettled({ key, outcome: \"error\" }),\n };\n}\n"],"mappings":";;;AAaA,SAAgBE,EAAgBC,GAAyCC,GAAa;AACpF,QAAM,CAACC,GAASC,CAAA,IAAcL,EAAiD;AAC/E,SAAAD,EAAA,MAA4B;AAC1B,UAAMO,IAAKJ,EAAI;AACf,QAAI,CAACI,GAAI,SAAU;AACnB,QAAIA,EAAG,eAAe,EAAG,QAAOD,EAAW;AAAA,MAAE,KAAAF;AAAA,MAAK,SAAS;AAAA,IAAS,CAAC;AAErE,QAAII,IAAU;AACd,UAAMC,IAAA,CAAUC,MAAA,MAAgC;AAC9C,MAAIF,KAASF,EAAW;AAAA,QAAE,KAAAF;AAAA,QAAK,SAAAM;AAAA,MAAQ,CAAC;AAAA,IAC1C;AACA,eAAI,QAAA,CAASC,MAAYA,EAAQJ,EAAG,OAAO,CAAC,CAAC,EAAE,KAAKE,EAAO,QAAQ,GAAGA,EAAO,OAAO,CAAC,GACrF,MAAa;AACX,MAAAD,IAAU;AAAA,IACZ;AAAA,EACF,GAAG,CAACJ,CAAG,CAAC,GACD;AAAA,IACL,SAASC,GAAS,QAAQD,IAAMC,EAAQ,UAAW;AAAA,IACnD,QAAA,MAAcC,EAAW;AAAA,MAAE,KAAAF;AAAA,MAAK,SAAS;AAAA,IAAS,CAAC;AAAA,IACnD,QAAA,MAAcE,EAAW;AAAA,MAAE,KAAAF;AAAA,MAAK,SAAS;AAAA,IAAQ,CAAC;AAAA,EACpD;AACF"}
1
+ {"version":3,"file":"image-outcome.js","names":["useClientLayoutEffect","useState","useImageOutcome","img","key","settled","setSettled","el","current","settle","outcome","resolve"],"sources":["../../src/foundations/image-outcome.ts"],"sourcesContent":["import { type RefObject, useState } from \"react\";\nimport { useClientLayoutEffect } from \"./client-layout-effect.js\";\n\n/**\n * Whether a picture is still on its way, arrived, or could not be shown. `pending` is before any script has looked at\n * it (the server's HTML, and a page that is never hydrated): the picture is shown as the browser has it.\n */\nexport type ImageOutcome = \"pending\" | \"loading\" | \"loaded\" | \"error\";\n\n/**\n * Follows one `<img>` from loading to loaded or failed. `key` names the picture (its `src`, with `srcSet` if any): a\n * new key starts again from \"loading\", whatever happened to the last one. Give the img a React `key` of the same\n * value, so `complete` never describes the picture before, and call `loaded` and `failed` from its `onLoad` and\n * `onError`. A picture that finished before React attached (cached, or sent in the server's HTML) fires neither\n * event, so it is also read from the element when the key changes. Until script runs the outcome is `pending`, so\n * markup rendered on the server shows its picture even on a page that is never hydrated; on mount an unfinished\n * picture becomes `loading` before the first paint. Image and Avatar use it.\n */\nexport function useImageOutcome(img: RefObject<HTMLImageElement | null>, key: string) {\n const [settled, setSettled] = useState<{ key: string; outcome: ImageOutcome }>();\n useClientLayoutEffect(() => {\n const el = img.current;\n if (!el) return;\n if (!el.complete) return setSettled({ key, outcome: \"loading\" });\n if (el.naturalWidth > 0) return setSettled({ key, outcome: \"loaded\" });\n // Finished with no size: broken, or a picture without one of its own (some SVG). Decoding tells them apart.\n let current = true;\n const settle = (outcome: ImageOutcome) => () => {\n if (current) setSettled({ key, outcome });\n };\n new Promise((resolve) => resolve(el.decode())).then(settle(\"loaded\"), settle(\"error\"));\n return () => {\n current = false;\n };\n }, [key]);\n return {\n outcome: settled?.key === key ? settled.outcome : (\"pending\" as ImageOutcome),\n loaded: () => setSettled({ key, outcome: \"loaded\" }),\n failed: () => setSettled({ key, outcome: \"error\" }),\n };\n}\n"],"mappings":";;;AAkBA,SAAgBE,EAAgBC,GAAyCC,GAAa;AACpF,QAAM,CAACC,GAASC,CAAA,IAAcL,EAAiD;AAC/E,SAAAD,EAAA,MAA4B;AAC1B,UAAMO,IAAKJ,EAAI;AACf,QAAI,CAACI,EAAI;AACT,QAAI,CAACA,EAAG,SAAU,QAAOD,EAAW;AAAA,MAAE,KAAAF;AAAA,MAAK,SAAS;AAAA,IAAU,CAAC;AAC/D,QAAIG,EAAG,eAAe,EAAG,QAAOD,EAAW;AAAA,MAAE,KAAAF;AAAA,MAAK,SAAS;AAAA,IAAS,CAAC;AAErE,QAAII,IAAU;AACd,UAAMC,IAAA,CAAUC,MAAA,MAAgC;AAC9C,MAAIF,KAASF,EAAW;AAAA,QAAE,KAAAF;AAAA,QAAK,SAAAM;AAAA,MAAQ,CAAC;AAAA,IAC1C;AACA,eAAI,QAAA,CAASC,MAAYA,EAAQJ,EAAG,OAAO,CAAC,CAAC,EAAE,KAAKE,EAAO,QAAQ,GAAGA,EAAO,OAAO,CAAC,GACrF,MAAa;AACX,MAAAD,IAAU;AAAA,IACZ;AAAA,EACF,GAAG,CAACJ,CAAG,CAAC,GACD;AAAA,IACL,SAASC,GAAS,QAAQD,IAAMC,EAAQ,UAAW;AAAA,IACnD,QAAA,MAAcC,EAAW;AAAA,MAAE,KAAAF;AAAA,MAAK,SAAS;AAAA,IAAS,CAAC;AAAA,IACnD,QAAA,MAAcE,EAAW;AAAA,MAAE,KAAAF;AAAA,MAAK,SAAS;AAAA,IAAQ,CAAC;AAAA,EACpD;AACF"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * True while the page is being printed (from the browser's `beforeprint` to `afterprint`). The update is flushed
3
+ * synchronously, so content rendered for print is in the page before the browser lays it out. Tabs uses it to print
4
+ * every panel.
5
+ */
6
+ export declare function usePrinting(): boolean;
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import { useEffect as i, useState as s } from "react";
3
+ import { flushSync as o } from "react-dom";
4
+ function a() {
5
+ const [r, e] = s(!1);
6
+ return i(() => {
7
+ const t = () => o(() => e(!0)), n = () => e(!1);
8
+ return addEventListener("beforeprint", t), addEventListener("afterprint", n), () => {
9
+ removeEventListener("beforeprint", t), removeEventListener("afterprint", n);
10
+ };
11
+ }, []), r;
12
+ }
13
+ export {
14
+ a as usePrinting
15
+ };
16
+
17
+ //# sourceMappingURL=printing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"printing.js","names":["useEffect","useState","flushSync","usePrinting","printing","setPrinting","start","end"],"sources":["../../src/foundations/printing.ts"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { flushSync } from \"react-dom\";\n\n/**\n * True while the page is being printed (from the browser's `beforeprint` to `afterprint`). The update is flushed\n * synchronously, so content rendered for print is in the page before the browser lays it out. Tabs uses it to print\n * every panel.\n */\nexport function usePrinting(): boolean {\n const [printing, setPrinting] = useState(false);\n useEffect(() => {\n const start = () => flushSync(() => setPrinting(true));\n const end = () => setPrinting(false);\n addEventListener(\"beforeprint\", start);\n addEventListener(\"afterprint\", end);\n return () => {\n removeEventListener(\"beforeprint\", start);\n removeEventListener(\"afterprint\", end);\n };\n }, []);\n return printing;\n}\n"],"mappings":";;;AAQA,SAAgBG,IAAuB;AACrC,QAAM,CAACC,GAAUC,CAAA,IAAeJ,EAAS,EAAK;AAC9C,SAAAD,EAAA,MAAgB;AACd,UAAMM,IAAA,MAAcJ,EAAA,MAAgBG,EAAY,EAAI,CAAC,GAC/CE,IAAA,MAAYF,EAAY,EAAK;AACnC,4BAAiB,eAAeC,CAAK,GACrC,iBAAiB,cAAcC,CAAG,GAClC,MAAa;AACX,0BAAoB,eAAeD,CAAK,GACxC,oBAAoB,cAAcC,CAAG;AAAA,IACvC;AAAA,EACF,GAAG,CAAC,CAAC,GACEH;AACT"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * QR code encoder (ISO/IEC 18004), pure and dependency-free: versions 1 to 40, levels L, M, Q and H, numeric,
3
+ * alphanumeric or byte (UTF-8) mode, Reed–Solomon error correction, and the mask with the lowest standard penalty.
4
+ * QRCode draws with it; it is also exported for pages without React (`qrMatrix`, `qrPath`, `qrToSvg`).
5
+ */
6
+ /** Error correction level: how much of the code can be damaged or covered and still scan (L 7%, M 15%, Q 25%, H 30%). */
7
+ export type QrLevel = "L" | "M" | "Q" | "H";
8
+ export interface QrOptions {
9
+ /** Error correction level. Default "M". */
10
+ level?: QrLevel;
11
+ /** Forces one of the eight mask patterns (0 to 7). Default: the one with the lowest penalty, as the standard asks. */
12
+ mask?: number;
13
+ }
14
+ /**
15
+ * The modules of a QR code for `value`, as rows of booleans (true is dark), without the quiet zone. The smallest
16
+ * version that holds the text is used; numeric and alphanumeric text use their compact modes, anything else is
17
+ * UTF-8 bytes. Throws a RangeError when the text does not fit in version 40 at this level.
18
+ */
19
+ export declare function qrMatrix(value: string, { level, mask }?: QrOptions): boolean[][];
20
+ /**
21
+ * SVG path data for a matrix: one `M x y h w v1 h-w z` rectangle per horizontal run of dark modules, one unit per
22
+ * module, shifted by `quietZone` modules so the path sits in a `viewBox` of `size + 2 × quietZone`.
23
+ */
24
+ export declare function qrPath(matrix: boolean[][], quietZone?: number): string;
25
+ export interface QrToSvgOptions extends QrOptions {
26
+ /** Light modules around the code, which scanners need (the standard asks for 4). Default 4. */
27
+ quietZone?: number;
28
+ /** Width and height: a number of pixels or any CSS length. Default: none (the SVG fills what holds it). */
29
+ size?: number | string;
30
+ /** Accessible name. Default "QR code". */
31
+ label?: string;
32
+ /** Colour of the dark modules. Default black. */
33
+ color?: string;
34
+ /** Colour of the light modules and the quiet zone. Default white. */
35
+ background?: string;
36
+ }
37
+ /**
38
+ * A QR code as a standalone SVG string, for pages without React and for files (an email, a print, a download). Its
39
+ * colours are written into it, so it scans without the Cynosure stylesheet; black on white unless `color` and
40
+ * `background` say otherwise.
41
+ */
42
+ export declare function qrToSvg(value: string, { quietZone, size, label, color, background, ...options }?: QrToSvgOptions): string;
@@ -0,0 +1,246 @@
1
+ "use client";
2
+ var q = "LMQH", B = [
3
+ 1,
4
+ 0,
5
+ 3,
6
+ 2
7
+ ], T = [
8
+ "0 7 10 15 20 26 18 20 24 30 18 20 24 26 30 22 24 28 30 28 28 28 28 30 30 26 28 30 30 30 30 30 30 30 30 30 30 30 30 30 30",
9
+ "0 10 16 26 18 24 16 18 22 22 26 30 22 22 24 24 28 28 26 26 26 26 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28",
10
+ "0 13 22 18 26 18 24 18 22 20 24 28 26 24 20 30 24 28 28 26 30 28 30 30 30 30 28 30 30 30 30 30 30 30 30 30 30 30 30 30 30",
11
+ "0 17 28 22 16 22 28 26 26 24 28 24 28 22 24 24 30 28 28 26 28 30 24 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30"
12
+ ].map((t) => t.split(" ").map(Number)), k = [
13
+ "0 1 1 1 1 1 2 2 2 2 4 4 4 4 4 6 6 6 6 7 8 8 9 9 10 12 12 12 13 14 15 16 17 18 19 19 20 21 22 24 25",
14
+ "0 1 1 1 2 2 4 4 4 5 5 5 8 9 9 10 10 11 13 14 16 17 17 18 20 21 23 25 26 28 29 31 33 35 37 38 40 43 45 47 49",
15
+ "0 1 1 2 2 4 4 6 6 8 8 8 10 12 16 12 17 16 18 21 20 23 23 25 27 29 34 34 35 38 40 43 45 48 51 53 56 59 62 65 68",
16
+ "0 1 1 2 4 4 4 5 6 8 8 11 11 16 16 18 16 19 21 25 25 25 34 30 32 35 37 40 42 45 48 51 54 57 60 63 66 70 74 77 81"
17
+ ].map((t) => t.split(" ").map(Number)), N = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
18
+ function P(t) {
19
+ let o = (16 * t + 128) * t + 64;
20
+ if (t >= 2) {
21
+ const r = Math.floor(t / 7) + 2;
22
+ o -= (25 * r - 10) * r - 55, t >= 7 && (o -= 36);
23
+ }
24
+ return o;
25
+ }
26
+ var S = (t, o) => Math.floor(P(t) / 8) - (T[o]?.[t] ?? 0) * (k[o]?.[t] ?? 0);
27
+ function O(t, o) {
28
+ let r = 0;
29
+ for (let i = 7; i >= 0; i--)
30
+ r = r << 1 ^ (r >>> 7) * 285, r ^= (o >>> i & 1) * t;
31
+ return r;
32
+ }
33
+ function F(t) {
34
+ const o = new Array(t).fill(0);
35
+ o[t - 1] = 1;
36
+ let r = 1;
37
+ for (let i = 0; i < t; i++) {
38
+ for (let e = 0; e < t; e++) o[e] = O(o[e], r) ^ (e + 1 < t ? o[e + 1] : 0);
39
+ r = O(r, 2);
40
+ }
41
+ return o;
42
+ }
43
+ function K(t, o) {
44
+ const r = o.map(() => 0);
45
+ for (const i of t) {
46
+ const e = i ^ r.shift();
47
+ r.push(0), o.forEach((s, a) => {
48
+ r[a] = r[a] ^ O(s, e);
49
+ });
50
+ }
51
+ return r;
52
+ }
53
+ function Q(t, o, r) {
54
+ const i = k[r]?.[o], e = T[r]?.[o], s = Math.floor(P(o) / 8), a = i - s % i, w = Math.floor(s / i), p = F(e), h = [];
55
+ for (let b = 0, u = 0; b < i; b++) {
56
+ const $ = t.slice(u, u + w - e + (b < a ? 0 : 1));
57
+ u += $.length;
58
+ const v = K($, p);
59
+ b < a && $.push(0), h.push($.concat(v));
60
+ }
61
+ const M = [];
62
+ for (let b = 0; b < w + 1; b++) h.forEach((u, $) => {
63
+ (b !== w - e || $ >= a) && M.push(u[b]);
64
+ });
65
+ return M;
66
+ }
67
+ function _(t) {
68
+ const o = [], r = (e, s) => {
69
+ for (let a = s - 1; a >= 0; a--) o.push(e >>> a & 1);
70
+ };
71
+ if (/^\d*$/.test(t)) {
72
+ for (let e = 0; e < t.length; e += 3) {
73
+ const s = t.slice(e, e + 3);
74
+ r(Number(s), s.length * 3 + 1);
75
+ }
76
+ return {
77
+ mode: 1,
78
+ count: t.length,
79
+ bits: o,
80
+ widths: [
81
+ 10,
82
+ 12,
83
+ 14
84
+ ]
85
+ };
86
+ }
87
+ if ([...t].every((e) => N.includes(e))) {
88
+ for (let e = 0; e < t.length; e += 2) {
89
+ const s = N.indexOf(t[e]);
90
+ e + 1 < t.length ? r(s * 45 + N.indexOf(t[e + 1]), 11) : r(s, 6);
91
+ }
92
+ return {
93
+ mode: 2,
94
+ count: t.length,
95
+ bits: o,
96
+ widths: [
97
+ 9,
98
+ 11,
99
+ 13
100
+ ]
101
+ };
102
+ }
103
+ const i = new TextEncoder().encode(t);
104
+ for (const e of i) r(e, 8);
105
+ return {
106
+ mode: 4,
107
+ count: i.length,
108
+ bits: o,
109
+ widths: [
110
+ 8,
111
+ 16,
112
+ 16
113
+ ]
114
+ };
115
+ }
116
+ var D = [
117
+ (t, o) => (t + o) % 2 === 0,
118
+ (t, o) => o % 2 === 0,
119
+ (t) => t % 3 === 0,
120
+ (t, o) => (t + o) % 3 === 0,
121
+ (t, o) => (Math.floor(t / 3) + Math.floor(o / 2)) % 2 === 0,
122
+ (t, o) => t * o % 2 + t * o % 3 === 0,
123
+ (t, o) => (t * o % 2 + t * o % 3) % 2 === 0,
124
+ (t, o) => ((t + o) % 2 + t * o % 3) % 2 === 0
125
+ ];
126
+ function H(t) {
127
+ const o = t.length;
128
+ let r = 0, i = 0;
129
+ for (let e = 0; e < o; e++) {
130
+ let s = 0, a = 0, w = 0, p = 0;
131
+ for (let h = 0; h < o; h++) {
132
+ const M = t[e]?.[h], b = t[h]?.[e];
133
+ M && i++, h > 0 && M === t[e]?.[h - 1] ? s++ : (s >= 5 && (r += s - 2), s = 1), h > 0 && b === t[h - 1]?.[e] ? a++ : (a >= 5 && (r += a - 2), a = 1), w = w << 1 & 2047 | (M ? 1 : 0), p = p << 1 & 2047 | (b ? 1 : 0), h >= 10 && ((w === 1488 || w === 93) && (r += 40), (p === 1488 || p === 93) && (r += 40)), e < o - 1 && h < o - 1 && M === t[e]?.[h + 1] && M === t[e + 1]?.[h] && M === t[e + 1]?.[h + 1] && (r += 3);
134
+ }
135
+ s >= 5 && (r += s - 2), a >= 5 && (r += a - 2);
136
+ }
137
+ return r + Math.abs(Math.ceil(i * 100 / (o * o) / 5) - 10) * 10;
138
+ }
139
+ function V(t, { level: o = "M", mask: r } = {}) {
140
+ const i = Math.max(0, q.indexOf(o)), e = _(t);
141
+ let s = 1, a = 0;
142
+ for (; ; s++) {
143
+ if (s > 40) throw new RangeError("The value is too long for a QR code at this error correction level.");
144
+ const n = e.widths[s < 10 ? 0 : s < 27 ? 1 : 2];
145
+ if (a = 4 + n + e.bits.length, e.count < 2 ** n && a <= S(s, i) * 8) break;
146
+ }
147
+ const w = S(s, i) * 8, p = [], h = (n, f) => {
148
+ for (let l = f - 1; l >= 0; l--) p.push(n >>> l & 1);
149
+ };
150
+ h(e.mode, 4), h(e.count, e.widths[s < 10 ? 0 : s < 27 ? 1 : 2]), p.push(...e.bits), h(0, Math.min(4, w - p.length)), h(0, (8 - p.length % 8) % 8);
151
+ for (let n = 236; p.length < w; n ^= 253) h(n, 8);
152
+ const M = [];
153
+ for (let n = 0; n < p.length; n += 8) M.push(p.slice(n, n + 8).reduce((f, l) => f << 1 | l, 0));
154
+ const b = Q(M, s, i), u = s * 4 + 17, $ = Array.from({ length: u }, () => new Array(u).fill(!1)), v = Array.from({ length: u }, () => new Array(u).fill(!1)), m = (n, f, l) => {
155
+ $[f][n] = l, v[f][n] = !0;
156
+ };
157
+ for (let n = 0; n < u; n++)
158
+ m(6, n, n % 2 === 0), m(n, 6, n % 2 === 0);
159
+ for (const [n, f] of [
160
+ [3, 3],
161
+ [u - 4, 3],
162
+ [3, u - 4]
163
+ ]) for (let l = -4; l <= 4; l++) for (let d = -4; d <= 4; d++) {
164
+ const g = Math.max(Math.abs(d), Math.abs(l)), c = n + d, x = f + l;
165
+ c >= 0 && c < u && x >= 0 && x < u && m(c, x, g !== 2 && g !== 4);
166
+ }
167
+ const E = [];
168
+ if (s > 1) {
169
+ const n = Math.floor(s / 7) + 2, f = Math.floor((s * 8 + n * 3 + 5) / (n * 4 - 4)) * 2;
170
+ for (let l = u - 7; E.length < n - 1; l -= f) E.unshift(l);
171
+ E.unshift(6);
172
+ }
173
+ const I = E.length - 1;
174
+ E.forEach((n, f) => {
175
+ E.forEach((l, d) => {
176
+ if (!(f === 0 && d === 0 || f === 0 && d === I || f === I && d === 0))
177
+ for (let g = -2; g <= 2; g++) for (let c = -2; c <= 2; c++) m(n + c, l + g, Math.max(Math.abs(c), Math.abs(g)) !== 1);
178
+ });
179
+ });
180
+ const C = (n) => {
181
+ const f = B[i] << 3 | n;
182
+ let l = f;
183
+ for (let c = 0; c < 10; c++) l = l << 1 ^ (l >>> 9) * 1335;
184
+ const d = (f << 10 | l) ^ 21522, g = (c) => (d >>> c & 1) === 1;
185
+ for (let c = 0; c <= 5; c++) m(8, c, g(c));
186
+ m(8, 7, g(6)), m(8, 8, g(7)), m(7, 8, g(8));
187
+ for (let c = 9; c < 15; c++) m(14 - c, 8, g(c));
188
+ for (let c = 0; c < 8; c++) m(u - 1 - c, 8, g(c));
189
+ for (let c = 8; c < 15; c++) m(8, u - 15 + c, g(c));
190
+ m(8, u - 8, !0);
191
+ };
192
+ if (C(0), s >= 7) {
193
+ let n = s;
194
+ for (let l = 0; l < 12; l++) n = n << 1 ^ (n >>> 11) * 7973;
195
+ const f = s << 12 | n;
196
+ for (let l = 0; l < 18; l++) {
197
+ const d = (f >>> l & 1) === 1, g = u - 11 + l % 3, c = Math.floor(l / 3);
198
+ m(g, c, d), m(c, g, d);
199
+ }
200
+ }
201
+ let A = 0;
202
+ for (let n = u - 1; n >= 1; n -= 2) {
203
+ n === 6 && (n = 5);
204
+ for (let f = 0; f < u; f++) for (let l = 0; l < 2; l++) {
205
+ const d = n - l, g = (n + 1 & 2) === 0 ? u - 1 - f : f;
206
+ !v[g]?.[d] && A < b.length * 8 && ($[g][d] = (b[A >>> 3] >>> 7 - (A & 7) & 1) === 1, A++);
207
+ }
208
+ }
209
+ const L = (n) => {
210
+ const f = D[n];
211
+ for (let l = 0; l < u; l++) for (let d = 0; d < u; d++) !v[l]?.[d] && f(d, l) && ($[l][d] = !$[l]?.[d]);
212
+ };
213
+ let R = r !== void 0 && r >= 0 && r < 8 ? Math.floor(r) : -1;
214
+ if (R < 0) {
215
+ let n = Number.POSITIVE_INFINITY;
216
+ for (let f = 0; f < 8; f++) {
217
+ L(f), C(f);
218
+ const l = H($);
219
+ l < n && (n = l, R = f), L(f);
220
+ }
221
+ }
222
+ return L(R), C(R), $;
223
+ }
224
+ function z(t, o = 4) {
225
+ let r = "";
226
+ return t.forEach((i, e) => {
227
+ for (let s = 0; s < i.length; s++) {
228
+ if (!i[s]) continue;
229
+ let a = 1;
230
+ for (; i[s + a]; ) a++;
231
+ r += `M${s + o} ${e + o}h${a}v1h-${a}z`, s += a;
232
+ }
233
+ }), r;
234
+ }
235
+ var y = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
236
+ function U(t, { quietZone: o = 4, size: r, label: i = "QR code", color: e = "#000", background: s = "#fff", ...a } = {}) {
237
+ const w = V(t, a), p = Math.max(0, Math.floor(o)), h = w.length + p * 2, M = typeof r == "number" ? `${r}px` : r;
238
+ return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${h} ${h}"${M ? ` width="${y(M)}" height="${y(M)}"` : ""} shape-rendering="crispEdges" role="img" aria-label="${y(i)}"><rect width="${h}" height="${h}" fill="${y(s)}"/><path fill="${y(e)}" d="${z(w, p)}"/></svg>`;
239
+ }
240
+ export {
241
+ V as qrMatrix,
242
+ z as qrPath,
243
+ U as qrToSvg
244
+ };
245
+
246
+ //# sourceMappingURL=qr.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qr.js","names":["LEVELS","FORMAT","ECC_PER_BLOCK","row","BLOCKS","ALPHANUMERIC","rawModules","ver","n","align","dataCodewords","lvl","gfMul","x","y","z","rsDivisor","degree","result","root","j","rsRemainder","data","divisor","b","factor","coef","i","interleave","count","eccLen","raw","short","shortLen","blocks","k","dat","ecc","block","encodeData","text","bits","put","value","length","chunk","c","a","bytes","MASKS","_","penalty","m","size","points","dark","runRow","runCol","bitsRow","bitsCol","col","qrMatrix","level","mask","seg","used","width","capacity","v","pad","codewords","modules","reserved","set","cx","cy","dy","dx","dist","step","pos","last","ax","ay","drawFormat","msk","fmt","rem","bits15","bit","bits18","right","vert","applyMask","flip","chosen","best","score","qrPath","matrix","quietZone","d","w","escapeAttr","qrToSvg","label","color","background","options","q","box"],"sources":["../../src/foundations/qr.ts"],"sourcesContent":["/**\n * QR code encoder (ISO/IEC 18004), pure and dependency-free: versions 1 to 40, levels L, M, Q and H, numeric,\n * alphanumeric or byte (UTF-8) mode, Reed–Solomon error correction, and the mask with the lowest standard penalty.\n * QRCode draws with it; it is also exported for pages without React (`qrMatrix`, `qrPath`, `qrToSvg`).\n */\n\n/** Error correction level: how much of the code can be damaged or covered and still scan (L 7%, M 15%, Q 25%, H 30%). */\nexport type QrLevel = \"L\" | \"M\" | \"Q\" | \"H\";\n\nexport interface QrOptions {\n /** Error correction level. Default \"M\". */\n level?: QrLevel;\n /** Forces one of the eight mask patterns (0 to 7). Default: the one with the lowest penalty, as the standard asks. */\n mask?: number;\n}\n\nconst LEVELS = \"LMQH\";\n// Format bits of each level, in the order of LEVELS.\nconst FORMAT = [1, 0, 3, 2];\n// Error correction codewords per block, by level then version (index 0 unused). Strings keep the bundle small.\nconst ECC_PER_BLOCK = [\n \"0 7 10 15 20 26 18 20 24 30 18 20 24 26 30 22 24 28 30 28 28 28 28 30 30 26 28 30 30 30 30 30 30 30 30 30 30 30 30 30 30\",\n \"0 10 16 26 18 24 16 18 22 22 26 30 22 22 24 24 28 28 26 26 26 26 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28\",\n \"0 13 22 18 26 18 24 18 22 20 24 28 26 24 20 30 24 28 28 26 30 28 30 30 30 30 28 30 30 30 30 30 30 30 30 30 30 30 30 30 30\",\n \"0 17 28 22 16 22 28 26 26 24 28 24 28 22 24 24 30 28 28 26 28 30 24 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30\",\n].map((row) => row.split(\" \").map(Number));\n// Number of error correction blocks, by level then version (index 0 unused).\nconst BLOCKS = [\n \"0 1 1 1 1 1 2 2 2 2 4 4 4 4 4 6 6 6 6 7 8 8 9 9 10 12 12 12 13 14 15 16 17 18 19 19 20 21 22 24 25\",\n \"0 1 1 1 2 2 4 4 4 5 5 5 8 9 9 10 10 11 13 14 16 17 17 18 20 21 23 25 26 28 29 31 33 35 37 38 40 43 45 47 49\",\n \"0 1 1 2 2 4 4 6 6 8 8 8 10 12 16 12 17 16 18 21 20 23 23 25 27 29 34 34 35 38 40 43 45 48 51 53 56 59 62 65 68\",\n \"0 1 1 2 4 4 4 5 6 8 8 11 11 16 16 18 16 19 21 25 25 25 34 30 32 35 37 40 42 45 48 51 54 57 60 63 66 70 74 77 81\",\n].map((row) => row.split(\" \").map(Number));\nconst ALPHANUMERIC = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:\";\n\n/** Modules left for data and error correction once the function patterns are drawn. */\nfunction rawModules(ver: number): number {\n let n = (16 * ver + 128) * ver + 64;\n if (ver >= 2) {\n const align = Math.floor(ver / 7) + 2;\n n -= (25 * align - 10) * align - 55;\n if (ver >= 7) n -= 36;\n }\n return n;\n}\n\nconst dataCodewords = (ver: number, lvl: number) =>\n Math.floor(rawModules(ver) / 8) - (ECC_PER_BLOCK[lvl]?.[ver] ?? 0) * (BLOCKS[lvl]?.[ver] ?? 0);\n\n/** Multiplication in GF(2^8) modulo x^8 + x^4 + x^3 + x^2 + 1. */\nfunction gfMul(x: number, y: number): number {\n let z = 0;\n for (let i = 7; i >= 0; i--) {\n z = (z << 1) ^ ((z >>> 7) * 0x11d);\n z ^= ((y >>> i) & 1) * x;\n }\n return z;\n}\n\n/** Reed–Solomon generator polynomial of the given degree (leading term left out). */\nfunction rsDivisor(degree: number): number[] {\n const result = new Array<number>(degree).fill(0);\n result[degree - 1] = 1;\n let root = 1;\n for (let i = 0; i < degree; i++) {\n for (let j = 0; j < degree; j++) {\n result[j] = gfMul(result[j] as number, root) ^ (j + 1 < degree ? (result[j + 1] as number) : 0);\n }\n root = gfMul(root, 2);\n }\n return result;\n}\n\nfunction rsRemainder(data: number[], divisor: number[]): number[] {\n const result = divisor.map(() => 0);\n for (const b of data) {\n const factor = b ^ (result.shift() as number);\n result.push(0);\n divisor.forEach((coef, i) => {\n result[i] = (result[i] as number) ^ gfMul(coef, factor);\n });\n }\n return result;\n}\n\n/** Splits data into blocks, adds error correction to each and interleaves them. */\nfunction interleave(data: number[], ver: number, lvl: number): number[] {\n const count = BLOCKS[lvl]?.[ver] as number;\n const eccLen = ECC_PER_BLOCK[lvl]?.[ver] as number;\n const raw = Math.floor(rawModules(ver) / 8);\n const short = count - (raw % count);\n const shortLen = Math.floor(raw / count);\n const divisor = rsDivisor(eccLen);\n const blocks: number[][] = [];\n for (let i = 0, k = 0; i < count; i++) {\n const dat = data.slice(k, k + shortLen - eccLen + (i < short ? 0 : 1));\n k += dat.length;\n const ecc = rsRemainder(dat, divisor);\n if (i < short) dat.push(0);\n blocks.push(dat.concat(ecc));\n }\n const result: number[] = [];\n for (let i = 0; i < shortLen + 1; i++)\n blocks.forEach((block, j) => {\n if (i !== shortLen - eccLen || j >= short) result.push(block[i] as number);\n });\n return result;\n}\n\n/** Picks the most compact single mode for the whole text, and its data bits (without the header). */\nfunction encodeData(text: string): { mode: number; count: number; bits: number[]; widths: number[] } {\n const bits: number[] = [];\n const put = (value: number, length: number) => {\n for (let i = length - 1; i >= 0; i--) bits.push((value >>> i) & 1);\n };\n if (/^\\d*$/.test(text)) {\n for (let i = 0; i < text.length; i += 3) {\n const chunk = text.slice(i, i + 3);\n put(Number(chunk), chunk.length * 3 + 1);\n }\n return { mode: 1, count: text.length, bits, widths: [10, 12, 14] };\n }\n if ([...text].every((c) => ALPHANUMERIC.includes(c))) {\n for (let i = 0; i < text.length; i += 2) {\n const a = ALPHANUMERIC.indexOf(text[i] as string);\n if (i + 1 < text.length) put(a * 45 + ALPHANUMERIC.indexOf(text[i + 1] as string), 11);\n else put(a, 6);\n }\n return { mode: 2, count: text.length, bits, widths: [9, 11, 13] };\n }\n const bytes = new TextEncoder().encode(text);\n for (const b of bytes) put(b, 8);\n return { mode: 4, count: bytes.length, bits, widths: [8, 16, 16] };\n}\n\n/** The masks, by number: true where a data module is flipped. `x` is the column, `y` the row. */\nconst MASKS: ((x: number, y: number) => boolean)[] = [\n (x, y) => (x + y) % 2 === 0,\n (_, y) => y % 2 === 0,\n (x) => x % 3 === 0,\n (x, y) => (x + y) % 3 === 0,\n (x, y) => (Math.floor(x / 3) + Math.floor(y / 2)) % 2 === 0,\n (x, y) => ((x * y) % 2) + ((x * y) % 3) === 0,\n (x, y) => (((x * y) % 2) + ((x * y) % 3)) % 2 === 0,\n (x, y) => (((x + y) % 2) + ((x * y) % 3)) % 2 === 0,\n];\n\n/** Penalty of a finished symbol: runs, 2×2 blocks, finder-like patterns and dark/light balance (ISO/IEC 18004 7.8.3). */\nfunction penalty(m: boolean[][]): number {\n const size = m.length;\n let points = 0;\n let dark = 0;\n for (let i = 0; i < size; i++) {\n let runRow = 0;\n let runCol = 0;\n let bitsRow = 0;\n let bitsCol = 0;\n for (let j = 0; j < size; j++) {\n const row = m[i]?.[j] as boolean;\n const col = m[j]?.[i] as boolean;\n if (row) dark++;\n // Runs of five or more modules of one colour, along rows and columns.\n if (j > 0 && row === m[i]?.[j - 1]) runRow++;\n else {\n if (runRow >= 5) points += runRow - 2;\n runRow = 1;\n }\n if (j > 0 && col === m[j - 1]?.[i]) runCol++;\n else {\n if (runCol >= 5) points += runCol - 2;\n runCol = 1;\n }\n // 1:1:3:1:1 finder-like patterns with four light modules on one side.\n bitsRow = ((bitsRow << 1) & 0x7ff) | (row ? 1 : 0);\n bitsCol = ((bitsCol << 1) & 0x7ff) | (col ? 1 : 0);\n if (j >= 10) {\n if (bitsRow === 0x5d0 || bitsRow === 0x05d) points += 40;\n if (bitsCol === 0x5d0 || bitsCol === 0x05d) points += 40;\n }\n // 2×2 blocks of one colour.\n if (\n i < size - 1 &&\n j < size - 1 &&\n row === m[i]?.[j + 1] &&\n row === m[i + 1]?.[j] &&\n row === m[i + 1]?.[j + 1]\n )\n points += 3;\n }\n if (runRow >= 5) points += runRow - 2;\n if (runCol >= 5) points += runCol - 2;\n }\n return points + Math.abs(Math.ceil((dark * 100) / (size * size) / 5) - 10) * 10;\n}\n\n/**\n * The modules of a QR code for `value`, as rows of booleans (true is dark), without the quiet zone. The smallest\n * version that holds the text is used; numeric and alphanumeric text use their compact modes, anything else is\n * UTF-8 bytes. Throws a RangeError when the text does not fit in version 40 at this level.\n */\nexport function qrMatrix(value: string, { level = \"M\", mask }: QrOptions = {}): boolean[][] {\n const lvl = Math.max(0, LEVELS.indexOf(level));\n const seg = encodeData(value);\n let ver = 1;\n let used = 0;\n for (; ; ver++) {\n if (ver > 40) throw new RangeError(\"The value is too long for a QR code at this error correction level.\");\n const width = seg.widths[ver < 10 ? 0 : ver < 27 ? 1 : 2] as number;\n used = 4 + width + seg.bits.length;\n if (seg.count < 2 ** width && used <= dataCodewords(ver, lvl) * 8) break;\n }\n const capacity = dataCodewords(ver, lvl) * 8;\n const bits: number[] = [];\n const put = (v: number, n: number) => {\n for (let i = n - 1; i >= 0; i--) bits.push((v >>> i) & 1);\n };\n put(seg.mode, 4);\n put(seg.count, seg.widths[ver < 10 ? 0 : ver < 27 ? 1 : 2] as number);\n bits.push(...seg.bits);\n put(0, Math.min(4, capacity - bits.length));\n put(0, (8 - (bits.length % 8)) % 8);\n for (let pad = 0xec; bits.length < capacity; pad ^= 0xec ^ 0x11) put(pad, 8);\n const codewords: number[] = [];\n for (let i = 0; i < bits.length; i += 8)\n codewords.push(bits.slice(i, i + 8).reduce((a, b) => (a << 1) | b, 0));\n const data = interleave(codewords, ver, lvl);\n\n const size = ver * 4 + 17;\n const modules = Array.from({ length: size }, () => new Array<boolean>(size).fill(false));\n const reserved = Array.from({ length: size }, () => new Array<boolean>(size).fill(false));\n const set = (x: number, y: number, dark: boolean) => {\n (modules[y] as boolean[])[x] = dark;\n (reserved[y] as boolean[])[x] = true;\n };\n\n // Timing patterns, then finders (with their separators) over them, then alignment patterns.\n for (let i = 0; i < size; i++) {\n set(6, i, i % 2 === 0);\n set(i, 6, i % 2 === 0);\n }\n for (const [cx, cy] of [\n [3, 3],\n [size - 4, 3],\n [3, size - 4],\n ] as const)\n for (let dy = -4; dy <= 4; dy++)\n for (let dx = -4; dx <= 4; dx++) {\n const dist = Math.max(Math.abs(dx), Math.abs(dy));\n const x = cx + dx;\n const y = cy + dy;\n if (x >= 0 && x < size && y >= 0 && y < size) set(x, y, dist !== 2 && dist !== 4);\n }\n const align: number[] = [];\n if (ver > 1) {\n const count = Math.floor(ver / 7) + 2;\n const step = Math.floor((ver * 8 + count * 3 + 5) / (count * 4 - 4)) * 2;\n for (let pos = size - 7; align.length < count - 1; pos -= step) align.unshift(pos);\n align.unshift(6);\n }\n // Alignment patterns everywhere on the grid except over the three finders.\n const last = align.length - 1;\n align.forEach((ax, i) => {\n align.forEach((ay, j) => {\n if ((i === 0 && j === 0) || (i === 0 && j === last) || (i === last && j === 0)) return;\n for (let dy = -2; dy <= 2; dy++)\n for (let dx = -2; dx <= 2; dx++) set(ax + dx, ay + dy, Math.max(Math.abs(dx), Math.abs(dy)) !== 1);\n });\n });\n\n const drawFormat = (msk: number) => {\n const fmt = ((FORMAT[lvl] as number) << 3) | msk;\n let rem = fmt;\n for (let i = 0; i < 10; i++) rem = (rem << 1) ^ ((rem >>> 9) * 0x537);\n const bits15 = ((fmt << 10) | rem) ^ 0x5412;\n const bit = (i: number) => ((bits15 >>> i) & 1) === 1;\n for (let i = 0; i <= 5; i++) set(8, i, bit(i));\n set(8, 7, bit(6));\n set(8, 8, bit(7));\n set(7, 8, bit(8));\n for (let i = 9; i < 15; i++) set(14 - i, 8, bit(i));\n for (let i = 0; i < 8; i++) set(size - 1 - i, 8, bit(i));\n for (let i = 8; i < 15; i++) set(8, size - 15 + i, bit(i));\n set(8, size - 8, true);\n };\n drawFormat(0);\n if (ver >= 7) {\n let rem = ver;\n for (let i = 0; i < 12; i++) rem = (rem << 1) ^ ((rem >>> 11) * 0x1f25);\n const bits18 = (ver << 12) | rem;\n for (let i = 0; i < 18; i++) {\n const dark = ((bits18 >>> i) & 1) === 1;\n const a = size - 11 + (i % 3);\n const b = Math.floor(i / 3);\n set(a, b, dark);\n set(b, a, dark);\n }\n }\n\n // Data in two-module columns, zigzagging up and down from the bottom right, skipping the vertical timing pattern.\n let i = 0;\n for (let right = size - 1; right >= 1; right -= 2) {\n if (right === 6) right = 5;\n for (let vert = 0; vert < size; vert++)\n for (let j = 0; j < 2; j++) {\n const x = right - j;\n const y = ((right + 1) & 2) === 0 ? size - 1 - vert : vert;\n if (!reserved[y]?.[x] && i < data.length * 8) {\n (modules[y] as boolean[])[x] = (((data[i >>> 3] as number) >>> (7 - (i & 7))) & 1) === 1;\n i++;\n }\n }\n }\n\n const applyMask = (msk: number) => {\n const flip = MASKS[msk] as (x: number, y: number) => boolean;\n for (let y = 0; y < size; y++)\n for (let x = 0; x < size; x++)\n if (!reserved[y]?.[x] && flip(x, y)) (modules[y] as boolean[])[x] = !modules[y]?.[x];\n };\n let chosen = mask !== undefined && mask >= 0 && mask < 8 ? Math.floor(mask) : -1;\n if (chosen < 0) {\n let best = Number.POSITIVE_INFINITY;\n for (let msk = 0; msk < 8; msk++) {\n applyMask(msk);\n drawFormat(msk);\n const score = penalty(modules);\n if (score < best) {\n best = score;\n chosen = msk;\n }\n applyMask(msk);\n }\n }\n applyMask(chosen);\n drawFormat(chosen);\n return modules;\n}\n\n/**\n * SVG path data for a matrix: one `M x y h w v1 h-w z` rectangle per horizontal run of dark modules, one unit per\n * module, shifted by `quietZone` modules so the path sits in a `viewBox` of `size + 2 × quietZone`.\n */\nexport function qrPath(matrix: boolean[][], quietZone = 4): string {\n let d = \"\";\n matrix.forEach((row, y) => {\n for (let x = 0; x < row.length; x++) {\n if (!row[x]) continue;\n let w = 1;\n while (row[x + w]) w++;\n d += `M${x + quietZone} ${y + quietZone}h${w}v1h-${w}z`;\n x += w;\n }\n });\n return d;\n}\n\nexport interface QrToSvgOptions extends QrOptions {\n /** Light modules around the code, which scanners need (the standard asks for 4). Default 4. */\n quietZone?: number;\n /** Width and height: a number of pixels or any CSS length. Default: none (the SVG fills what holds it). */\n size?: number | string;\n /** Accessible name. Default \"QR code\". */\n label?: string;\n /** Colour of the dark modules. Default black. */\n color?: string;\n /** Colour of the light modules and the quiet zone. Default white. */\n background?: string;\n}\n\nconst escapeAttr = (text: string) =>\n text.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\"/g, \"&quot;\");\n\n/**\n * A QR code as a standalone SVG string, for pages without React and for files (an email, a print, a download). Its\n * colours are written into it, so it scans without the Cynosure stylesheet; black on white unless `color` and\n * `background` say otherwise.\n */\nexport function qrToSvg(\n value: string,\n {\n quietZone = 4,\n size,\n label = \"QR code\",\n color = \"#000\",\n background = \"#fff\",\n ...options\n }: QrToSvgOptions = {},\n): string {\n const matrix = qrMatrix(value, options);\n const q = Math.max(0, Math.floor(quietZone));\n const box = matrix.length + q * 2;\n const length = typeof size === \"number\" ? `${size}px` : size;\n const dims = length ? ` width=\"${escapeAttr(length)}\" height=\"${escapeAttr(length)}\"` : \"\";\n return (\n `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 ${box} ${box}\"${dims} shape-rendering=\"crispEdges\" ` +\n `role=\"img\" aria-label=\"${escapeAttr(label)}\"><rect width=\"${box}\" height=\"${box}\" fill=\"${escapeAttr(background)}\"/>` +\n `<path fill=\"${escapeAttr(color)}\" d=\"${qrPath(matrix, q)}\"/></svg>`\n );\n}\n"],"mappings":";AAgBA,IAAMA,IAAS,QAETC,IAAS;AAAA,EAAC;AAAA,EAAG;AAAA,EAAG;AAAA,EAAG;AAAC,GAEpBC,IAAgB;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,IAAA,CAAKC,MAAQA,EAAI,MAAM,GAAG,EAAE,IAAI,MAAM,CAAC,GAEnCC,IAAS;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,IAAA,CAAKD,MAAQA,EAAI,MAAM,GAAG,EAAE,IAAI,MAAM,CAAC,GACnCE,IAAe;AAGrB,SAASC,EAAWC,GAAqB;AACvC,MAAIC,KAAK,KAAKD,IAAM,OAAOA,IAAM;A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type { IconData } from "./types.js";
2
+ export declare const bookMarked: IconData;
@@ -0,0 +1,14 @@
1
+ var a = {
2
+ name: "book-marked",
3
+ category: "files",
4
+ body: [["path", { d: "M5 19.5v-14A2.5 2.5 0 0 1 7.5 3H19v18H7a2 2 0 0 1-2-2 2 2 0 0 1 2-2h12" }], ["path", {
5
+ d: "M10 3v7l2.25-1.75L14.5 10V3",
6
+ animate: !0
7
+ }]],
8
+ motion: "drop"
9
+ };
10
+ export {
11
+ a as bookMarked
12
+ };
13
+
14
+ //# sourceMappingURL=book-marked.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"book-marked.js","names":["bookMarked"],"sources":["../../src/icons/book-marked.ts"],"sourcesContent":["import type { IconData } from \"./types.js\";\n\nexport const bookMarked: IconData = {\n name: \"book-marked\",\n category: \"files\",\n body: [\n [\"path\", { d: \"M5 19.5v-14A2.5 2.5 0 0 1 7.5 3H19v18H7a2 2 0 0 1-2-2 2 2 0 0 1 2-2h12\" }],\n [\"path\", { d: \"M10 3v7l2.25-1.75L14.5 10V3\", animate: true }],\n ],\n motion: \"drop\",\n};\n"],"mappings":"AAEA,IAAaA,IAAuB;AAAA,EAClC,MAAM;AAAA,EACN,UAAU;AAAA,EACV,MAAM,CACJ,CAAC,QAAQ,EAAE,GAAG,yEAAyE,CAAC,GACxF,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAA+B,SAAS;AAAA,EAAK,CAAC,CAC9D;AAAA,EACA,QAAQ;AACV"}
@@ -0,0 +1,2 @@
1
+ import type { IconData } from "./types.js";
2
+ export declare const calendarDays: IconData;