@hebium-ui/core 0.1.0-alpha.2 → 0.1.0-alpha.4

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 (224) hide show
  1. package/dist/index.d.ts +14 -2
  2. package/dist/index.js +17 -5
  3. package/dist/logics/avatar-placeholder/get-avatar-placeholder.d.ts +1 -4
  4. package/dist/logics/avatar-placeholder/get-avatar-placeholder.js +1 -2
  5. package/dist/logics/avatar-placeholder/should-show-avatar-placeholder.d.ts +2 -5
  6. package/dist/logics/avatar-placeholder/should-show-avatar-placeholder.js +1 -2
  7. package/dist/logics/avatar-placeholder/should-show-avatar-placeholder.js.map +1 -1
  8. package/dist/logics/bool/to-bool.d.ts +1 -4
  9. package/dist/logics/bool/to-bool.js +1 -2
  10. package/dist/logics/bool/to-strbool.d.ts +1 -4
  11. package/dist/logics/bool/to-strbool.js +1 -2
  12. package/dist/logics/button-control/button-control.d.ts +16 -0
  13. package/dist/logics/button-control/button-control.js +26 -0
  14. package/dist/logics/button-control/button-control.js.map +1 -0
  15. package/dist/logics/cc/cc-all.d.ts +2 -5
  16. package/dist/logics/cc/cc-all.js +1 -2
  17. package/dist/logics/cc/cc-all.js.map +1 -1
  18. package/dist/logics/cc/cc.d.ts +2 -5
  19. package/dist/logics/cc/cc.js +1 -2
  20. package/dist/logics/cc/cc.js.map +1 -1
  21. package/dist/logics/checkbox-control/checkbox-control.d.ts +5 -8
  22. package/dist/logics/checkbox-control/checkbox-control.js +2 -3
  23. package/dist/logics/checkbox-control/checkbox-control.js.map +1 -1
  24. package/dist/logics/combobox-control/combobox-control.d.ts +100 -0
  25. package/dist/logics/combobox-control/combobox-control.js +100 -0
  26. package/dist/logics/combobox-control/combobox-control.js.map +1 -0
  27. package/dist/logics/combobox-control/combobox-filter.d.ts +13 -0
  28. package/dist/logics/combobox-control/combobox-filter.js +11 -0
  29. package/dist/logics/combobox-control/combobox-filter.js.map +1 -0
  30. package/dist/logics/combobox-control/combobox-navigation.d.ts +2 -0
  31. package/dist/logics/combobox-control/combobox-navigation.js +10 -0
  32. package/dist/logics/combobox-control/combobox-navigation.js.map +1 -0
  33. package/dist/logics/dialog-control/dialog-control.d.ts +5 -8
  34. package/dist/logics/dialog-control/dialog-control.js +1 -2
  35. package/dist/logics/dialog-control/dialog-control.js.map +1 -1
  36. package/dist/logics/input-control/input-control.d.ts +3 -6
  37. package/dist/logics/input-control/input-control.js +1 -2
  38. package/dist/logics/input-control/input-control.js.map +1 -1
  39. package/dist/logics/label-marker/label-marker.d.ts +2 -5
  40. package/dist/logics/label-marker/label-marker.js +1 -2
  41. package/dist/logics/label-marker/label-marker.js.map +1 -1
  42. package/dist/logics/menu-control/menu-control.d.ts +5 -8
  43. package/dist/logics/menu-control/menu-control.js +1 -2
  44. package/dist/logics/menu-control/menu-control.js.map +1 -1
  45. package/dist/logics/ms/ms-all.d.ts +3 -5
  46. package/dist/logics/ms/ms-all.js +1 -2
  47. package/dist/logics/ms/ms-all.js.map +1 -1
  48. package/dist/logics/multi-combobox-control/multi-combobox-control.d.ts +58 -0
  49. package/dist/logics/multi-combobox-control/multi-combobox-control.js +76 -0
  50. package/dist/logics/multi-combobox-control/multi-combobox-control.js.map +1 -0
  51. package/dist/logics/multi-combobox-control/multi-combobox-focus.d.ts +15 -0
  52. package/dist/logics/multi-combobox-control/multi-combobox-focus.js +46 -0
  53. package/dist/logics/multi-combobox-control/multi-combobox-focus.js.map +1 -0
  54. package/dist/logics/popover-control/popover-control.d.ts +5 -6
  55. package/dist/logics/popover-control/popover-control.js +6 -3
  56. package/dist/logics/popover-control/popover-control.js.map +1 -1
  57. package/dist/logics/progress-control/progress-control.d.ts +4 -7
  58. package/dist/logics/progress-control/progress-control.js +2 -3
  59. package/dist/logics/progress-control/progress-control.js.map +1 -1
  60. package/dist/logics/radio-control/radio-control.d.ts +4 -7
  61. package/dist/logics/radio-control/radio-control.js +1 -2
  62. package/dist/logics/radio-control/radio-control.js.map +1 -1
  63. package/dist/logics/radiogroup-control/radiogroup-control.d.ts +3 -6
  64. package/dist/logics/radiogroup-control/radiogroup-control.js +1 -2
  65. package/dist/logics/radiogroup-control/radiogroup-control.js.map +1 -1
  66. package/dist/logics/segmented-control/segmented-control.d.ts +3 -6
  67. package/dist/logics/segmented-control/segmented-control.js +2 -3
  68. package/dist/logics/segmented-control/segmented-control.js.map +1 -1
  69. package/dist/logics/tabs-control/tabs-control.d.ts +5 -8
  70. package/dist/logics/tabs-control/tabs-control.js +1 -2
  71. package/dist/logics/tabs-control/tabs-control.js.map +1 -1
  72. package/dist/logics/tabs-control/tabs-keymap.js +1 -2
  73. package/dist/logics/tabs-control/tabs-keymap.js.map +1 -1
  74. package/dist/logics/tooltip-control/tooltip-control.d.ts +3 -6
  75. package/dist/logics/tooltip-control/tooltip-control.js +1 -2
  76. package/dist/logics/tooltip-control/tooltip-control.js.map +1 -1
  77. package/dist/recipes/alert/alert.d.ts +4 -7
  78. package/dist/recipes/alert/alert.js +6 -9
  79. package/dist/recipes/alert/alert.js.map +1 -1
  80. package/dist/recipes/anchor/anchor.d.ts +1 -4
  81. package/dist/recipes/anchor/anchor.js +1 -2
  82. package/dist/recipes/avatar/avatar.d.ts +1 -4
  83. package/dist/recipes/avatar/avatar.js +1 -2
  84. package/dist/recipes/blockquote/blockquote.d.ts +1 -4
  85. package/dist/recipes/blockquote/blockquote.js +4 -3
  86. package/dist/recipes/blockquote/blockquote.js.map +1 -1
  87. package/dist/recipes/button/button.d.ts +16 -7
  88. package/dist/recipes/button/button.js +39 -16
  89. package/dist/recipes/button/button.js.map +1 -1
  90. package/dist/recipes/checkbox/checkbox.d.ts +4 -27
  91. package/dist/recipes/checkbox/checkbox.js +14 -20
  92. package/dist/recipes/checkbox/checkbox.js.map +1 -1
  93. package/dist/recipes/code/code.d.ts +1 -4
  94. package/dist/recipes/code/code.js +1 -2
  95. package/dist/recipes/combobox/combobox.d.ts +8 -0
  96. package/dist/recipes/combobox/combobox.js +34 -0
  97. package/dist/recipes/combobox/combobox.js.map +1 -0
  98. package/dist/recipes/container/container.d.ts +1 -4
  99. package/dist/recipes/container/container.js +1 -2
  100. package/dist/recipes/details/details.d.ts +4 -7
  101. package/dist/recipes/details/details.js +10 -6
  102. package/dist/recipes/details/details.js.map +1 -1
  103. package/dist/recipes/dialog/dialog.d.ts +4 -5
  104. package/dist/recipes/dialog/dialog.js +6 -3
  105. package/dist/recipes/dialog/dialog.js.map +1 -1
  106. package/dist/recipes/dl/dl.d.ts +1 -4
  107. package/dist/recipes/dl/dl.js +6 -3
  108. package/dist/recipes/dl/dl.js.map +1 -1
  109. package/dist/recipes/drawer/drawer.d.ts +1 -4
  110. package/dist/recipes/drawer/drawer.js +1 -2
  111. package/dist/recipes/fieldset/fieldset.d.ts +1 -4
  112. package/dist/recipes/fieldset/fieldset.js +4 -3
  113. package/dist/recipes/fieldset/fieldset.js.map +1 -1
  114. package/dist/recipes/focus-ring/focus-ring.d.ts +1 -4
  115. package/dist/recipes/focus-ring/focus-ring.js +1 -2
  116. package/dist/recipes/heading/heading.d.ts +1 -4
  117. package/dist/recipes/heading/heading.js +1 -2
  118. package/dist/recipes/hr/hr.d.ts +1 -4
  119. package/dist/recipes/hr/hr.js +4 -3
  120. package/dist/recipes/hr/hr.js.map +1 -1
  121. package/dist/recipes/inline-feedback/inline-feedback.d.ts +50 -0
  122. package/dist/recipes/inline-feedback/inline-feedback.js +45 -0
  123. package/dist/recipes/inline-feedback/inline-feedback.js.map +1 -0
  124. package/dist/recipes/input/input.d.ts +4 -7
  125. package/dist/recipes/input/input.js +6 -5
  126. package/dist/recipes/input/input.js.map +1 -1
  127. package/dist/recipes/label/label.d.ts +2 -5
  128. package/dist/recipes/label/label.js +2 -2
  129. package/dist/recipes/label/label.js.map +1 -1
  130. package/dist/recipes/menu/menu.d.ts +1 -4
  131. package/dist/recipes/menu/menu.js +5 -3
  132. package/dist/recipes/menu/menu.js.map +1 -1
  133. package/dist/recipes/multi-combobox/multi-combobox.d.ts +8 -0
  134. package/dist/recipes/multi-combobox/multi-combobox.js +52 -0
  135. package/dist/recipes/multi-combobox/multi-combobox.js.map +1 -0
  136. package/dist/recipes/paragraph/paragraph.d.ts +1 -4
  137. package/dist/recipes/paragraph/paragraph.js +1 -2
  138. package/dist/recipes/popover/popover.d.ts +1 -4
  139. package/dist/recipes/popover/popover.js +4 -4
  140. package/dist/recipes/popover/popover.js.map +1 -1
  141. package/dist/recipes/progress/progress.d.ts +2 -5
  142. package/dist/recipes/progress/progress.js +1 -2
  143. package/dist/recipes/radio/radio.d.ts +4 -7
  144. package/dist/recipes/radio/radio.js +7 -6
  145. package/dist/recipes/radio/radio.js.map +1 -1
  146. package/dist/recipes/radiogroup/radiogroup.d.ts +1 -4
  147. package/dist/recipes/radiogroup/radiogroup.js +1 -2
  148. package/dist/recipes/section/section.d.ts +4 -5
  149. package/dist/recipes/section/section.js +6 -3
  150. package/dist/recipes/section/section.js.map +1 -1
  151. package/dist/recipes/segmented-control/segmented-control.d.ts +1 -4
  152. package/dist/recipes/segmented-control/segmented-control.js +11 -6
  153. package/dist/recipes/segmented-control/segmented-control.js.map +1 -1
  154. package/dist/recipes/select/select.d.ts +3 -6
  155. package/dist/recipes/select/select.js +6 -5
  156. package/dist/recipes/select/select.js.map +1 -1
  157. package/dist/recipes/skip-link/skip-link.d.ts +5 -0
  158. package/dist/recipes/skip-link/skip-link.js +9 -0
  159. package/dist/recipes/skip-link/skip-link.js.map +1 -0
  160. package/dist/recipes/status-icon/status-icon.d.ts +55 -0
  161. package/dist/recipes/status-icon/status-icon.js +39 -0
  162. package/dist/recipes/status-icon/status-icon.js.map +1 -0
  163. package/dist/recipes/table/table.d.ts +7 -8
  164. package/dist/recipes/table/table.js +17 -7
  165. package/dist/recipes/table/table.js.map +1 -1
  166. package/dist/recipes/tabs/tabs.d.ts +1 -4
  167. package/dist/recipes/tabs/tabs.js +4 -3
  168. package/dist/recipes/tabs/tabs.js.map +1 -1
  169. package/dist/recipes/tag/tag.d.ts +64 -0
  170. package/dist/recipes/tag/tag.js +86 -0
  171. package/dist/recipes/tag/tag.js.map +1 -0
  172. package/dist/recipes/text/text.d.ts +52 -0
  173. package/dist/recipes/text/text.js +42 -0
  174. package/dist/recipes/text/text.js.map +1 -0
  175. package/dist/recipes/visually-hidden/visually-hidden.d.ts +1 -4
  176. package/dist/recipes/visually-hidden/visually-hidden.js +1 -2
  177. package/dist/style.css +1 -1
  178. package/dist/styles/css-vars.d.ts +1 -4
  179. package/dist/styles/css-vars.js +1 -2
  180. package/dist/styles/make-recipe-type.d.ts +1 -4
  181. package/dist/styles/make-recipe.d.ts +2 -5
  182. package/dist/styles/make-recipe.js +3 -4
  183. package/dist/styles/make-recipe.js.map +1 -1
  184. package/dist/styles/primitive-css/{active.module.js → active.module.css.js} +2 -3
  185. package/dist/styles/primitive-css/active.module.css.js.map +1 -0
  186. package/dist/styles/primitive-css/{base.module.js → base.module.css.js} +3 -3
  187. package/dist/styles/primitive-css/base.module.css.js.map +1 -0
  188. package/dist/styles/primitive-css/checked.module.css.js +11 -0
  189. package/dist/styles/primitive-css/checked.module.css.js.map +1 -0
  190. package/dist/styles/primitive-css/composite.module.css.js +5 -0
  191. package/dist/styles/primitive-css/composite.module.css.js.map +1 -0
  192. package/dist/styles/primitive-css/{disabled.module.js → disabled.module.css.js} +2 -3
  193. package/dist/styles/primitive-css/disabled.module.css.js.map +1 -0
  194. package/dist/styles/primitive-css/focus.module.css.js +10 -0
  195. package/dist/styles/primitive-css/focus.module.css.js.map +1 -0
  196. package/dist/styles/primitive-css/{hover.module.js → hover.module.css.js} +4 -4
  197. package/dist/styles/primitive-css/hover.module.css.js.map +1 -0
  198. package/dist/styles/primitive-css/icon.module.css.js +13 -0
  199. package/dist/styles/primitive-css/icon.module.css.js.map +1 -0
  200. package/dist/styles/primitive-css/{misc.module.js → misc.module.css.js} +8 -7
  201. package/dist/styles/primitive-css/misc.module.css.js.map +1 -0
  202. package/dist/styles/primitive-css/{neutral.module.js → neutral.module.css.js} +29 -13
  203. package/dist/styles/primitive-css/neutral.module.css.js.map +1 -0
  204. package/dist/styles/primitive-css/{pseudo-element.module.js → pseudo-element.module.css.js} +2 -3
  205. package/dist/styles/primitive-css/pseudo-element.module.css.js.map +1 -0
  206. package/dist/styles/primitive.gen.d.ts +80 -21
  207. package/dist/styles/primitive.gen.js +77 -38
  208. package/dist/styles/primitive.gen.js.map +1 -1
  209. package/package.json +5 -5
  210. package/dist/styles/primitive-css/active.module.js.map +0 -1
  211. package/dist/styles/primitive-css/base.module.js.map +0 -1
  212. package/dist/styles/primitive-css/checked.module.js +0 -10
  213. package/dist/styles/primitive-css/checked.module.js.map +0 -1
  214. package/dist/styles/primitive-css/composite.module.js +0 -6
  215. package/dist/styles/primitive-css/composite.module.js.map +0 -1
  216. package/dist/styles/primitive-css/disabled.module.js.map +0 -1
  217. package/dist/styles/primitive-css/focus.module.js +0 -10
  218. package/dist/styles/primitive-css/focus.module.js.map +0 -1
  219. package/dist/styles/primitive-css/hover.module.js.map +0 -1
  220. package/dist/styles/primitive-css/icon.module.js +0 -11
  221. package/dist/styles/primitive-css/icon.module.js.map +0 -1
  222. package/dist/styles/primitive-css/misc.module.js.map +0 -1
  223. package/dist/styles/primitive-css/neutral.module.js.map +0 -1
  224. package/dist/styles/primitive-css/pseudo-element.module.js.map +0 -1
@@ -0,0 +1,46 @@
1
+ // src/logics/multi-combobox-control/multi-combobox-focus.ts
2
+ const TAG_REMOVE_BUTTON_ATTRIBUTE = "data-hui-multi-combobox-remove";
3
+ function getTagRemoveButtonAttributes(value) {
4
+ return { [TAG_REMOVE_BUTTON_ATTRIBUTE]: value };
5
+ }
6
+ function getTagRemoveButtons(root) {
7
+ return root?.isConnected ? Array.from(root.querySelectorAll(`button[${TAG_REMOVE_BUTTON_ATTRIBUTE}]`)) : [];
8
+ }
9
+ function canFocus(element) {
10
+ return element.isConnected && !element.matches(":disabled");
11
+ }
12
+ function getTagRemovalFocusValue(previousValues, removedValue, focusableValues) {
13
+ const index = previousValues.indexOf(removedValue);
14
+ if (index === -1) return null;
15
+ const nextValue = previousValues.slice(index + 1).find((value) => focusableValues.includes(value));
16
+ if (nextValue !== void 0) return nextValue;
17
+ return previousValues.slice(0, index).toReversed().find((value) => focusableValues.includes(value)) ?? null;
18
+ }
19
+ function createTagRemovalFocus({ root, input, button, value, removedValue }) {
20
+ if (!root || !input || !root.contains(button) || button.ownerDocument.activeElement !== button) return;
21
+ const previousValues = [...value];
22
+ return () => {
23
+ if (!root.isConnected) return;
24
+ const buttons = getTagRemoveButtons(root).filter(canFocus);
25
+ const buttonsByValue = /* @__PURE__ */ new Map();
26
+ for (const candidate of buttons) {
27
+ const candidateValue = candidate.getAttribute(TAG_REMOVE_BUTTON_ATTRIBUTE);
28
+ if (candidateValue === null) continue;
29
+ buttonsByValue.set(candidateValue, candidate);
30
+ }
31
+ const focusableValues = [...buttonsByValue.keys()];
32
+ const nextValue = getTagRemovalFocusValue(previousValues, removedValue, focusableValues);
33
+ const target = nextValue === null ? input : buttonsByValue.get(nextValue);
34
+ if (target && canFocus(target)) target.focus();
35
+ };
36
+ }
37
+ function focusLastTag(root, value) {
38
+ const lastValue = value.at(-1);
39
+ if (lastValue === void 0) return;
40
+ const button = getTagRemoveButtons(root).find((candidate) => candidate.getAttribute(TAG_REMOVE_BUTTON_ATTRIBUTE) === lastValue);
41
+ if (!button || !canFocus(button)) return;
42
+ button.focus();
43
+ }
44
+ export { createTagRemovalFocus, focusLastTag, getTagRemovalFocusValue, getTagRemoveButtonAttributes };
45
+
46
+ //# sourceMappingURL=multi-combobox-focus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multi-combobox-focus.js","names":[],"sources":["../../../src/logics/multi-combobox-control/multi-combobox-focus.ts"],"sourcesContent":["const TAG_REMOVE_BUTTON_ATTRIBUTE = \"data-hui-multi-combobox-remove\";\n\ninterface MultiComboboxTagRemoveButtonAttributes {\n \"data-hui-multi-combobox-remove\": string;\n}\n\nexport function getTagRemoveButtonAttributes(value: string): MultiComboboxTagRemoveButtonAttributes {\n return { [TAG_REMOVE_BUTTON_ATTRIBUTE]: value };\n}\n\nfunction getTagRemoveButtons(root: HTMLElement | null): HTMLButtonElement[] {\n return root?.isConnected\n ? Array.from(root.querySelectorAll<HTMLButtonElement>(`button[${TAG_REMOVE_BUTTON_ATTRIBUTE}]`))\n : [];\n}\n\nfunction canFocus(element: HTMLButtonElement | HTMLInputElement): boolean {\n return element.isConnected && !element.matches(\":disabled\");\n}\n\nexport function getTagRemovalFocusValue(\n previousValues: readonly string[],\n removedValue: string,\n focusableValues: readonly string[],\n): string | null {\n const index = previousValues.indexOf(removedValue);\n if (index === -1) return null;\n\n const nextValue = previousValues\n .slice(index + 1)\n .find((value) => focusableValues.includes(value));\n if (nextValue !== undefined) return nextValue;\n\n const previousValue = previousValues\n .slice(0, index)\n .toReversed()\n .find((value) => focusableValues.includes(value));\n return previousValue ?? null;\n}\n\ninterface MultiComboboxRemovalFocusOptions {\n root: HTMLElement | null;\n input: HTMLInputElement | null;\n button: HTMLButtonElement;\n value: readonly string[];\n removedValue: string;\n}\n\nexport function createTagRemovalFocus({\n root,\n input,\n button,\n value,\n removedValue,\n}: MultiComboboxRemovalFocusOptions): (() => void) | undefined {\n if (!root || !input || !root.contains(button) || button.ownerDocument.activeElement !== button) return;\n const previousValues = [...value];\n\n return () => {\n if (!root.isConnected) return;\n const buttons = getTagRemoveButtons(root).filter(canFocus);\n const buttonsByValue = new Map<string, HTMLButtonElement>();\n for (const candidate of buttons) {\n const candidateValue = candidate.getAttribute(TAG_REMOVE_BUTTON_ATTRIBUTE);\n if (candidateValue === null) continue;\n buttonsByValue.set(candidateValue, candidate);\n }\n\n const focusableValues = [...buttonsByValue.keys()];\n const nextValue = getTagRemovalFocusValue(previousValues, removedValue, focusableValues);\n const target = nextValue === null ? input : buttonsByValue.get(nextValue);\n if (target && canFocus(target)) target.focus();\n };\n}\n\nexport function focusLastTag(root: HTMLElement | null, value: readonly string[]): void {\n const lastValue = value.at(-1);\n if (lastValue === undefined) return;\n\n const button = getTagRemoveButtons(root).find((candidate) =>\n candidate.getAttribute(TAG_REMOVE_BUTTON_ATTRIBUTE) === lastValue\n );\n if (!button || !canFocus(button)) return;\n button.focus();\n}\n"],"mappings":";AAAA,MAAM,8BAA8B;AAMpC,SAAgB,6BAA6B,OAAuD;CAClG,OAAO,GAAG,8BAA8B,MAAM;AAChD;AAEA,SAAS,oBAAoB,MAA+C;CAC1E,OAAO,MAAM,cACT,MAAM,KAAK,KAAK,iBAAoC,UAAU,4BAA4B,EAAE,CAAC,IAC7F,CAAC;AACP;AAEA,SAAS,SAAS,SAAwD;CACxE,OAAO,QAAQ,eAAe,CAAC,QAAQ,QAAQ,WAAW;AAC5D;AAEA,SAAgB,wBACd,gBACA,cACA,iBACe;CACf,MAAM,QAAQ,eAAe,QAAQ,YAAY;CACjD,IAAI,UAAU,IAAI,OAAO;CAEzB,MAAM,YAAY,eACf,MAAM,QAAQ,CAAC,CAAC,CAChB,MAAM,UAAU,gBAAgB,SAAS,KAAK,CAAC;CAClD,IAAI,cAAc,KAAA,GAAW,OAAO;CAMpC,OAJsB,eACnB,MAAM,GAAG,KAAK,CAAC,CACf,WAAW,CAAC,CACZ,MAAM,UAAU,gBAAgB,SAAS,KAAK,CAC9B,KAAK;AAC1B;AAUA,SAAgB,sBAAsB,EACpC,MACA,OACA,QACA,OACA,gBAC6D;CAC7D,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,SAAS,MAAM,KAAK,OAAO,cAAc,kBAAkB,QAAQ;CAChG,MAAM,iBAAiB,CAAC,GAAG,KAAK;CAEhC,aAAa;EACX,IAAI,CAAC,KAAK,aAAa;EACvB,MAAM,UAAU,oBAAoB,IAAI,CAAC,CAAC,OAAO,QAAQ;EACzD,MAAM,iCAAiB,IAAI,IAA+B;EAC1D,KAAK,MAAM,aAAa,SAAS;GAC/B,MAAM,iBAAiB,UAAU,aAAa,2BAA2B;GACzE,IAAI,mBAAmB,MAAM;GAC7B,eAAe,IAAI,gBAAgB,SAAS;EAC9C;EAEA,MAAM,kBAAkB,CAAC,GAAG,eAAe,KAAK,CAAC;EACjD,MAAM,YAAY,wBAAwB,gBAAgB,cAAc,eAAe;EACvF,MAAM,SAAS,cAAc,OAAO,QAAQ,eAAe,IAAI,SAAS;EACxE,IAAI,UAAU,SAAS,MAAM,GAAG,OAAO,MAAM;CAC/C;AACF;AAEA,SAAgB,aAAa,MAA0B,OAAgC;CACrF,MAAM,YAAY,MAAM,GAAG,EAAE;CAC7B,IAAI,cAAc,KAAA,GAAW;CAE7B,MAAM,SAAS,oBAAoB,IAAI,CAAC,CAAC,MAAM,cAC7C,UAAU,aAAa,2BAA2B,MAAM,SAC1D;CACA,IAAI,CAAC,UAAU,CAAC,SAAS,MAAM,GAAG;CAClC,OAAO,MAAM;AACf"}
@@ -1,4 +1,3 @@
1
- //#region src/logics/popover-control/popover-control.d.ts
2
1
  export interface PopoverState {
3
2
  popoverId: string;
4
3
  }
@@ -9,16 +8,16 @@ export interface PopoverTriggerAttributes {
9
8
  popovertarget: string;
10
9
  type: "button" | undefined;
11
10
  }
12
- declare function getTriggerAttributes(state: PopoverState, options: PopoverTriggerAttributeOptions): PopoverTriggerAttributes;
11
+ declare function getTriggerAttributes(state: Readonly<PopoverState>, options: Readonly<PopoverTriggerAttributeOptions>): PopoverTriggerAttributes;
13
12
  export interface PopoverContentAttributes {
14
13
  id: string;
15
14
  popover: "auto";
16
15
  }
17
- declare function getContentAttributes(state: PopoverState): PopoverContentAttributes;
16
+ declare function getContentAttributes(state: Readonly<PopoverState>): PopoverContentAttributes;
17
+ declare function isOpened(element: Element | null): boolean;
18
18
  export declare const popoverControl: {
19
19
  readonly getTriggerAttributes: typeof getTriggerAttributes;
20
20
  readonly getContentAttributes: typeof getContentAttributes;
21
+ readonly isOpened: typeof isOpened;
21
22
  };
22
- //#endregion
23
- export {};
24
- //# sourceMappingURL=popover-control.d.ts.map
23
+ export {};
@@ -1,4 +1,4 @@
1
- //#region src/logics/popover-control/popover-control.ts
1
+ // src/logics/popover-control/popover-control.ts
2
2
  function getTriggerAttributes(state, options) {
3
3
  return {
4
4
  popovertarget: state.popoverId,
@@ -11,11 +11,14 @@ function getContentAttributes(state) {
11
11
  popover: "auto"
12
12
  };
13
13
  }
14
+ function isOpened(element) {
15
+ return element?.matches(":popover-open") ?? false;
16
+ }
14
17
  const popoverControl = {
15
18
  getTriggerAttributes,
16
- getContentAttributes
19
+ getContentAttributes,
20
+ isOpened
17
21
  };
18
- //#endregion
19
22
  export { popoverControl };
20
23
 
21
24
  //# sourceMappingURL=popover-control.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"popover-control.js","names":[],"sources":["../../../src/logics/popover-control/popover-control.ts"],"sourcesContent":["export interface PopoverState {\n popoverId: string;\n}\n\nexport interface PopoverTriggerAttributeOptions {\n isButtonElement: boolean;\n}\n\nexport interface PopoverTriggerAttributes {\n popovertarget: string;\n type: \"button\" | undefined;\n}\n\nfunction getTriggerAttributes(\n state: PopoverState,\n options: PopoverTriggerAttributeOptions,\n): PopoverTriggerAttributes {\n return {\n popovertarget: state.popoverId,\n type: options.isButtonElement ? \"button\" : undefined,\n };\n}\n\nexport interface PopoverContentAttributes {\n id: string;\n popover: \"auto\";\n}\n\nfunction getContentAttributes(state: PopoverState): PopoverContentAttributes {\n return {\n id: state.popoverId,\n popover: \"auto\",\n };\n}\n\nexport const popoverControl = {\n getTriggerAttributes,\n getContentAttributes,\n} as const;\n"],"mappings":";AAaA,SAAS,qBACP,OACA,SAC0B;CAC1B,OAAO;EACL,eAAe,MAAM;EACrB,MAAM,QAAQ,kBAAkB,WAAW,KAAA;CAC7C;AACF;AAOA,SAAS,qBAAqB,OAA+C;CAC3E,OAAO;EACL,IAAI,MAAM;EACV,SAAS;CACX;AACF;AAEA,MAAa,iBAAiB;CAC5B;CACA;AACF"}
1
+ {"version":3,"file":"popover-control.js","names":[],"sources":["../../../src/logics/popover-control/popover-control.ts"],"sourcesContent":["export interface PopoverState {\n popoverId: string;\n}\n\nexport interface PopoverTriggerAttributeOptions {\n isButtonElement: boolean;\n}\n\nexport interface PopoverTriggerAttributes {\n popovertarget: string;\n type: \"button\" | undefined;\n}\n\nfunction getTriggerAttributes(\n state: Readonly<PopoverState>,\n options: Readonly<PopoverTriggerAttributeOptions>,\n): PopoverTriggerAttributes {\n return {\n popovertarget: state.popoverId,\n type: options.isButtonElement ? \"button\" : undefined,\n };\n}\n\nexport interface PopoverContentAttributes {\n id: string;\n popover: \"auto\";\n}\n\nfunction getContentAttributes(state: Readonly<PopoverState>): PopoverContentAttributes {\n return {\n id: state.popoverId,\n popover: \"auto\",\n };\n}\n\nfunction isOpened(element: Element | null): boolean {\n return element?.matches(\":popover-open\") ?? false;\n}\n\nexport const popoverControl = {\n getTriggerAttributes,\n getContentAttributes,\n isOpened,\n} as const;\n"],"mappings":";AAaA,SAAS,qBACP,OACA,SAC0B;CAC1B,OAAO;EACL,eAAe,MAAM;EACrB,MAAM,QAAQ,kBAAkB,WAAW,KAAA;CAC7C;AACF;AAOA,SAAS,qBAAqB,OAAyD;CACrF,OAAO;EACL,IAAI,MAAM;EACV,SAAS;CACX;AACF;AAEA,SAAS,SAAS,SAAkC;CAClD,OAAO,SAAS,QAAQ,eAAe,KAAK;AAC9C;AAEA,MAAa,iBAAiB;CAC5B;CACA;CACA;AACF"}
@@ -1,4 +1,3 @@
1
- //#region src/logics/progress-control/progress-control.d.ts
2
1
  export interface ProgressState {
3
2
  progressId: string;
4
3
  hasLabel: boolean;
@@ -17,11 +16,11 @@ export interface ProgressResolveOptions {
17
16
  value: number | undefined;
18
17
  valueText: string | undefined;
19
18
  }
20
- declare function resolve(options: ProgressResolveOptions): ProgressState;
19
+ declare function resolve(options: Readonly<ProgressResolveOptions>): ProgressState;
21
20
  export interface ProgressLabelAttributes {
22
21
  id: string;
23
22
  }
24
- declare function getLabelAttributes(state: ProgressState): ProgressLabelAttributes;
23
+ declare function getLabelAttributes(state: Readonly<ProgressState>): ProgressLabelAttributes;
25
24
  export interface ProgressBarAttributes {
26
25
  role: "progressbar";
27
26
  "aria-valuemin": number;
@@ -30,7 +29,7 @@ export interface ProgressBarAttributes {
30
29
  "aria-valuetext": string | undefined;
31
30
  "aria-labelledby": string | undefined;
32
31
  }
33
- declare function getBarAttributes(state: ProgressState): ProgressBarAttributes;
32
+ declare function getBarAttributes(state: Readonly<ProgressState>): ProgressBarAttributes;
34
33
  export interface ProgressValueAttributes {
35
34
  "aria-hidden": "true";
36
35
  }
@@ -41,6 +40,4 @@ export declare const progressControl: {
41
40
  readonly getBarAttributes: typeof getBarAttributes;
42
41
  readonly getValueAttributes: typeof getValueAttributes;
43
42
  };
44
- //#endregion
45
- export {};
46
- //# sourceMappingURL=progress-control.d.ts.map
43
+ export {};
@@ -1,5 +1,5 @@
1
- //#region src/logics/progress-control/progress-control.ts
2
- const INDETERMINATE_BAR_WIDTH = "15%";
1
+ // src/logics/progress-control/progress-control.ts
2
+ const INDETERMINATE_BAR_WIDTH = "30%";
3
3
  function resolve(options) {
4
4
  const min = options.min ?? 0;
5
5
  const max = options.max ?? 100;
@@ -42,7 +42,6 @@ const progressControl = {
42
42
  getBarAttributes,
43
43
  getValueAttributes
44
44
  };
45
- //#endregion
46
45
  export { progressControl };
47
46
 
48
47
  //# sourceMappingURL=progress-control.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"progress-control.js","names":[],"sources":["../../../src/logics/progress-control/progress-control.ts"],"sourcesContent":["const INDETERMINATE_BAR_WIDTH = \"15%\";\n\nexport interface ProgressState {\n progressId: string;\n hasLabel: boolean;\n isIndeterminate: boolean;\n min: number;\n max: number;\n value: number | undefined;\n valueText: string | undefined;\n width: string;\n}\n\nexport interface ProgressResolveOptions {\n progressId: string;\n hasLabel: boolean;\n min: number | undefined;\n max: number | undefined;\n value: number | undefined;\n valueText: string | undefined;\n}\n\nfunction resolve(options: ProgressResolveOptions): ProgressState {\n const min = options.min ?? 0;\n const max = options.max ?? 100;\n const range = max - min;\n const isIndeterminate = typeof options.value === \"undefined\";\n const percentage = typeof options.value === \"undefined\"\n ? undefined\n : range === 0\n ? 0\n : ((options.value - min) / range) * 100;\n\n return {\n progressId: options.progressId,\n hasLabel: options.hasLabel,\n isIndeterminate,\n min,\n max,\n value: options.value,\n valueText: options.valueText,\n width: percentage === undefined ? INDETERMINATE_BAR_WIDTH : `${percentage}%`,\n };\n}\n\nfunction labelId(progressId: string): string {\n return `${progressId}-label`;\n}\n\nexport interface ProgressLabelAttributes {\n id: string;\n}\n\nfunction getLabelAttributes(state: ProgressState): ProgressLabelAttributes {\n return {\n id: labelId(state.progressId),\n };\n}\n\nexport interface ProgressBarAttributes {\n role: \"progressbar\";\n \"aria-valuemin\": number;\n \"aria-valuemax\": number;\n \"aria-valuenow\": number | undefined;\n \"aria-valuetext\": string | undefined;\n \"aria-labelledby\": string | undefined;\n}\n\nfunction getBarAttributes(state: ProgressState): ProgressBarAttributes {\n return {\n role: \"progressbar\",\n \"aria-valuemin\": state.min,\n \"aria-valuemax\": state.max,\n \"aria-valuenow\": state.value,\n \"aria-valuetext\": state.valueText,\n \"aria-labelledby\": state.hasLabel ? labelId(state.progressId) : undefined,\n };\n}\n\nexport interface ProgressValueAttributes {\n \"aria-hidden\": \"true\";\n}\n\nfunction getValueAttributes(): ProgressValueAttributes {\n return {\n \"aria-hidden\": \"true\",\n };\n}\n\nexport const progressControl = {\n resolve,\n getLabelAttributes,\n getBarAttributes,\n getValueAttributes,\n} as const;\n"],"mappings":";AAAA,MAAM,0BAA0B;AAsBhC,SAAS,QAAQ,SAAgD;CAC/D,MAAM,MAAM,QAAQ,OAAO;CAC3B,MAAM,MAAM,QAAQ,OAAO;CAC3B,MAAM,QAAQ,MAAM;CACpB,MAAM,kBAAkB,OAAO,QAAQ,UAAU;CACjD,MAAM,aAAa,OAAO,QAAQ,UAAU,cACxC,KAAA,IACA,UAAU,IACV,KACE,QAAQ,QAAQ,OAAO,QAAS;CAEtC,OAAO;EACL,YAAY,QAAQ;EACpB,UAAU,QAAQ;EAClB;EACA;EACA;EACA,OAAO,QAAQ;EACf,WAAW,QAAQ;EACnB,OAAO,eAAe,KAAA,IAAY,0BAA0B,GAAG,WAAW;CAC5E;AACF;AAEA,SAAS,QAAQ,YAA4B;CAC3C,OAAO,GAAG,WAAW;AACvB;AAMA,SAAS,mBAAmB,OAA+C;CACzE,OAAO,EACL,IAAI,QAAQ,MAAM,UAAU,EAC9B;AACF;AAWA,SAAS,iBAAiB,OAA6C;CACrE,OAAO;EACL,MAAM;EACN,iBAAiB,MAAM;EACvB,iBAAiB,MAAM;EACvB,iBAAiB,MAAM;EACvB,kBAAkB,MAAM;EACxB,mBAAmB,MAAM,WAAW,QAAQ,MAAM,UAAU,IAAI,KAAA;CAClE;AACF;AAMA,SAAS,qBAA8C;CACrD,OAAO,EACL,eAAe,OACjB;AACF;AAEA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;AACF"}
1
+ {"version":3,"file":"progress-control.js","names":[],"sources":["../../../src/logics/progress-control/progress-control.ts"],"sourcesContent":["const INDETERMINATE_BAR_WIDTH = \"30%\";\n\nexport interface ProgressState {\n progressId: string;\n hasLabel: boolean;\n isIndeterminate: boolean;\n min: number;\n max: number;\n value: number | undefined;\n valueText: string | undefined;\n width: string;\n}\n\nexport interface ProgressResolveOptions {\n progressId: string;\n hasLabel: boolean;\n min: number | undefined;\n max: number | undefined;\n value: number | undefined;\n valueText: string | undefined;\n}\n\nfunction resolve(options: Readonly<ProgressResolveOptions>): ProgressState {\n const min = options.min ?? 0;\n const max = options.max ?? 100;\n const range = max - min;\n const isIndeterminate = typeof options.value === \"undefined\";\n const percentage = typeof options.value === \"undefined\"\n ? undefined\n : range === 0\n ? 0\n : ((options.value - min) / range) * 100;\n\n return {\n progressId: options.progressId,\n hasLabel: options.hasLabel,\n isIndeterminate,\n min,\n max,\n value: options.value,\n valueText: options.valueText,\n width: percentage === undefined ? INDETERMINATE_BAR_WIDTH : `${percentage}%`,\n };\n}\n\nfunction labelId(progressId: string): string {\n return `${progressId}-label`;\n}\n\nexport interface ProgressLabelAttributes {\n id: string;\n}\n\nfunction getLabelAttributes(state: Readonly<ProgressState>): ProgressLabelAttributes {\n return {\n id: labelId(state.progressId),\n };\n}\n\nexport interface ProgressBarAttributes {\n role: \"progressbar\";\n \"aria-valuemin\": number;\n \"aria-valuemax\": number;\n \"aria-valuenow\": number | undefined;\n \"aria-valuetext\": string | undefined;\n \"aria-labelledby\": string | undefined;\n}\n\nfunction getBarAttributes(state: Readonly<ProgressState>): ProgressBarAttributes {\n return {\n role: \"progressbar\",\n \"aria-valuemin\": state.min,\n \"aria-valuemax\": state.max,\n \"aria-valuenow\": state.value,\n \"aria-valuetext\": state.valueText,\n \"aria-labelledby\": state.hasLabel ? labelId(state.progressId) : undefined,\n };\n}\n\nexport interface ProgressValueAttributes {\n \"aria-hidden\": \"true\";\n}\n\nfunction getValueAttributes(): ProgressValueAttributes {\n return {\n \"aria-hidden\": \"true\",\n };\n}\n\nexport const progressControl = {\n resolve,\n getLabelAttributes,\n getBarAttributes,\n getValueAttributes,\n} as const;\n"],"mappings":";AAAA,MAAM,0BAA0B;AAsBhC,SAAS,QAAQ,SAA0D;CACzE,MAAM,MAAM,QAAQ,OAAO;CAC3B,MAAM,MAAM,QAAQ,OAAO;CAC3B,MAAM,QAAQ,MAAM;CACpB,MAAM,kBAAkB,OAAO,QAAQ,UAAU;CACjD,MAAM,aAAa,OAAO,QAAQ,UAAU,cACxC,KAAA,IACA,UAAU,IACV,KACE,QAAQ,QAAQ,OAAO,QAAS;CAEtC,OAAO;EACL,YAAY,QAAQ;EACpB,UAAU,QAAQ;EAClB;EACA;EACA;EACA,OAAO,QAAQ;EACf,WAAW,QAAQ;EACnB,OAAO,eAAe,KAAA,IAAY,0BAA0B,GAAG,WAAW;CAC5E;AACF;AAEA,SAAS,QAAQ,YAA4B;CAC3C,OAAO,GAAG,WAAW;AACvB;AAMA,SAAS,mBAAmB,OAAyD;CACnF,OAAO,EACL,IAAI,QAAQ,MAAM,UAAU,EAC9B;AACF;AAWA,SAAS,iBAAiB,OAAuD;CAC/E,OAAO;EACL,MAAM;EACN,iBAAiB,MAAM;EACvB,iBAAiB,MAAM;EACvB,iBAAiB,MAAM;EACvB,kBAAkB,MAAM;EACxB,mBAAmB,MAAM,WAAW,QAAQ,MAAM,UAAU,IAAI,KAAA;CAClE;AACF;AAMA,SAAS,qBAA8C;CACrD,OAAO,EACL,eAAe,OACjB;AACF;AAEA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;AACF"}
@@ -1,5 +1,4 @@
1
1
  import { Strbool } from "../bool/to-strbool.js";
2
- //#region src/logics/radio-control/radio-control.d.ts
3
2
  export interface RadioState {
4
3
  id: string;
5
4
  invalid: boolean;
@@ -10,21 +9,19 @@ export interface RadioControlAttributes {
10
9
  id: string;
11
10
  "aria-describedby": string | undefined;
12
11
  }
13
- declare function getControlAttributes(state: RadioState): RadioControlAttributes;
12
+ declare function getControlAttributes(state: Readonly<RadioState>): RadioControlAttributes;
14
13
  export interface RadioLabelAttributes {
15
14
  for: string;
16
15
  "data-disabled": Strbool;
17
16
  }
18
- declare function getLabelAttributes(state: RadioState): RadioLabelAttributes;
17
+ declare function getLabelAttributes(state: Readonly<RadioState>): RadioLabelAttributes;
19
18
  export interface RadioErrorAttributes {
20
19
  id: string;
21
20
  }
22
- declare function getErrorAttributes(state: RadioState): RadioErrorAttributes;
21
+ declare function getErrorAttributes(state: Readonly<RadioState>): RadioErrorAttributes;
23
22
  export declare const radioControl: {
24
23
  readonly getControlAttributes: typeof getControlAttributes;
25
24
  readonly getLabelAttributes: typeof getLabelAttributes;
26
25
  readonly getErrorAttributes: typeof getErrorAttributes;
27
26
  };
28
- //#endregion
29
- export {};
30
- //# sourceMappingURL=radio-control.d.ts.map
27
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { toStrbool } from "../bool/to-strbool.js";
2
- //#region src/logics/radio-control/radio-control.ts
2
+ // src/logics/radio-control/radio-control.ts
3
3
  function errorId(state) {
4
4
  return `${state.id}-error`;
5
5
  }
@@ -24,7 +24,6 @@ const radioControl = {
24
24
  getLabelAttributes,
25
25
  getErrorAttributes
26
26
  };
27
- //#endregion
28
27
  export { radioControl };
29
28
 
30
29
  //# sourceMappingURL=radio-control.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio-control.js","names":[],"sources":["../../../src/logics/radio-control/radio-control.ts"],"sourcesContent":["import { type Strbool, toStrbool } from \"../bool\";\n\nexport interface RadioState {\n id: string;\n invalid: boolean;\n disabled: boolean;\n}\n\nfunction errorId(state: RadioState): string {\n return `${state.id}-error`;\n}\n\nexport interface RadioControlAttributes {\n type: \"radio\";\n id: string;\n \"aria-describedby\": string | undefined;\n}\n\nfunction getControlAttributes(state: RadioState): RadioControlAttributes {\n return {\n type: \"radio\",\n id: state.id,\n \"aria-describedby\": state.invalid ? errorId(state) : undefined,\n };\n}\n\nexport interface RadioLabelAttributes {\n for: string;\n \"data-disabled\": Strbool;\n}\n\nfunction getLabelAttributes(state: RadioState): RadioLabelAttributes {\n return {\n for: state.id,\n \"data-disabled\": toStrbool(state.disabled),\n };\n}\n\nexport interface RadioErrorAttributes {\n id: string;\n}\n\nfunction getErrorAttributes(state: RadioState): RadioErrorAttributes {\n return {\n id: errorId(state),\n };\n}\n\nexport const radioControl = {\n getControlAttributes,\n getLabelAttributes,\n getErrorAttributes,\n} as const;\n"],"mappings":";;AAQA,SAAS,QAAQ,OAA2B;CAC1C,OAAO,GAAG,MAAM,GAAG;AACrB;AAQA,SAAS,qBAAqB,OAA2C;CACvE,OAAO;EACL,MAAM;EACN,IAAI,MAAM;EACV,oBAAoB,MAAM,UAAU,QAAQ,KAAK,IAAI,KAAA;CACvD;AACF;AAOA,SAAS,mBAAmB,OAAyC;CACnE,OAAO;EACL,KAAK,MAAM;EACX,iBAAiB,UAAU,MAAM,QAAQ;CAC3C;AACF;AAMA,SAAS,mBAAmB,OAAyC;CACnE,OAAO,EACL,IAAI,QAAQ,KAAK,EACnB;AACF;AAEA,MAAa,eAAe;CAC1B;CACA;CACA;AACF"}
1
+ {"version":3,"file":"radio-control.js","names":[],"sources":["../../../src/logics/radio-control/radio-control.ts"],"sourcesContent":["import { type Strbool, toStrbool } from \"../bool\";\n\nexport interface RadioState {\n id: string;\n invalid: boolean;\n disabled: boolean;\n}\n\nfunction errorId(state: Readonly<RadioState>): string {\n return `${state.id}-error`;\n}\n\nexport interface RadioControlAttributes {\n type: \"radio\";\n id: string;\n \"aria-describedby\": string | undefined;\n}\n\nfunction getControlAttributes(state: Readonly<RadioState>): RadioControlAttributes {\n return {\n type: \"radio\",\n id: state.id,\n \"aria-describedby\": state.invalid ? errorId(state) : undefined,\n };\n}\n\nexport interface RadioLabelAttributes {\n for: string;\n \"data-disabled\": Strbool;\n}\n\nfunction getLabelAttributes(state: Readonly<RadioState>): RadioLabelAttributes {\n return {\n for: state.id,\n \"data-disabled\": toStrbool(state.disabled),\n };\n}\n\nexport interface RadioErrorAttributes {\n id: string;\n}\n\nfunction getErrorAttributes(state: Readonly<RadioState>): RadioErrorAttributes {\n return {\n id: errorId(state),\n };\n}\n\nexport const radioControl = {\n getControlAttributes,\n getLabelAttributes,\n getErrorAttributes,\n} as const;\n"],"mappings":";;AAQA,SAAS,QAAQ,OAAqC;CACpD,OAAO,GAAG,MAAM,GAAG;AACrB;AAQA,SAAS,qBAAqB,OAAqD;CACjF,OAAO;EACL,MAAM;EACN,IAAI,MAAM;EACV,oBAAoB,MAAM,UAAU,QAAQ,KAAK,IAAI,KAAA;CACvD;AACF;AAOA,SAAS,mBAAmB,OAAmD;CAC7E,OAAO;EACL,KAAK,MAAM;EACX,iBAAiB,UAAU,MAAM,QAAQ;CAC3C;AACF;AAMA,SAAS,mBAAmB,OAAmD;CAC7E,OAAO,EACL,IAAI,QAAQ,KAAK,EACnB;AACF;AAEA,MAAa,eAAe;CAC1B;CACA;CACA;AACF"}
@@ -1,4 +1,3 @@
1
- //#region src/logics/radiogroup-control/radiogroup-control.d.ts
2
1
  export interface RadiogroupState {
3
2
  labelId: string;
4
3
  hasLabel: boolean;
@@ -10,16 +9,14 @@ export interface RadiogroupRootAttributes {
10
9
  "aria-invalid": boolean;
11
10
  "aria-labelledby": string | undefined;
12
11
  }
13
- declare function getRootAttributes(state: RadiogroupState): RadiogroupRootAttributes;
12
+ declare function getRootAttributes(state: Readonly<RadiogroupState>): RadiogroupRootAttributes;
14
13
  export interface RadiogroupLabelAttributes {
15
14
  id: string;
16
15
  "data-required": boolean;
17
16
  }
18
- declare function getLabelAttributes(state: RadiogroupState): RadiogroupLabelAttributes;
17
+ declare function getLabelAttributes(state: Readonly<RadiogroupState>): RadiogroupLabelAttributes;
19
18
  export declare const radiogroupControl: {
20
19
  readonly getRootAttributes: typeof getRootAttributes;
21
20
  readonly getLabelAttributes: typeof getLabelAttributes;
22
21
  };
23
- //#endregion
24
- export {};
25
- //# sourceMappingURL=radiogroup-control.d.ts.map
22
+ export {};
@@ -1,4 +1,4 @@
1
- //#region src/logics/radiogroup-control/radiogroup-control.ts
1
+ // src/logics/radiogroup-control/radiogroup-control.ts
2
2
  function getRootAttributes(state) {
3
3
  return {
4
4
  role: "radiogroup",
@@ -16,7 +16,6 @@ const radiogroupControl = {
16
16
  getRootAttributes,
17
17
  getLabelAttributes
18
18
  };
19
- //#endregion
20
19
  export { radiogroupControl };
21
20
 
22
21
  //# sourceMappingURL=radiogroup-control.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radiogroup-control.js","names":[],"sources":["../../../src/logics/radiogroup-control/radiogroup-control.ts"],"sourcesContent":["export interface RadiogroupState {\n labelId: string;\n hasLabel: boolean;\n invalid: boolean;\n required: boolean;\n}\n\nexport interface RadiogroupRootAttributes {\n role: \"radiogroup\";\n \"aria-invalid\": boolean;\n \"aria-labelledby\": string | undefined;\n}\n\nfunction getRootAttributes(state: RadiogroupState): RadiogroupRootAttributes {\n return {\n role: \"radiogroup\",\n \"aria-invalid\": state.invalid,\n \"aria-labelledby\": state.hasLabel ? state.labelId : undefined,\n };\n}\n\nexport interface RadiogroupLabelAttributes {\n id: string;\n \"data-required\": boolean;\n}\n\nfunction getLabelAttributes(state: RadiogroupState): RadiogroupLabelAttributes {\n return {\n id: state.labelId,\n \"data-required\": state.required,\n };\n}\n\nexport const radiogroupControl = {\n getRootAttributes,\n getLabelAttributes,\n} as const;\n"],"mappings":";AAaA,SAAS,kBAAkB,OAAkD;CAC3E,OAAO;EACL,MAAM;EACN,gBAAgB,MAAM;EACtB,mBAAmB,MAAM,WAAW,MAAM,UAAU,KAAA;CACtD;AACF;AAOA,SAAS,mBAAmB,OAAmD;CAC7E,OAAO;EACL,IAAI,MAAM;EACV,iBAAiB,MAAM;CACzB;AACF;AAEA,MAAa,oBAAoB;CAC/B;CACA;AACF"}
1
+ {"version":3,"file":"radiogroup-control.js","names":[],"sources":["../../../src/logics/radiogroup-control/radiogroup-control.ts"],"sourcesContent":["export interface RadiogroupState {\n labelId: string;\n hasLabel: boolean;\n invalid: boolean;\n required: boolean;\n}\n\nexport interface RadiogroupRootAttributes {\n role: \"radiogroup\";\n \"aria-invalid\": boolean;\n \"aria-labelledby\": string | undefined;\n}\n\nfunction getRootAttributes(state: Readonly<RadiogroupState>): RadiogroupRootAttributes {\n return {\n role: \"radiogroup\",\n \"aria-invalid\": state.invalid,\n \"aria-labelledby\": state.hasLabel ? state.labelId : undefined,\n };\n}\n\nexport interface RadiogroupLabelAttributes {\n id: string;\n \"data-required\": boolean;\n}\n\nfunction getLabelAttributes(state: Readonly<RadiogroupState>): RadiogroupLabelAttributes {\n return {\n id: state.labelId,\n \"data-required\": state.required,\n };\n}\n\nexport const radiogroupControl = {\n getRootAttributes,\n getLabelAttributes,\n} as const;\n"],"mappings":";AAaA,SAAS,kBAAkB,OAA4D;CACrF,OAAO;EACL,MAAM;EACN,gBAAgB,MAAM;EACtB,mBAAmB,MAAM,WAAW,MAAM,UAAU,KAAA;CACtD;AACF;AAOA,SAAS,mBAAmB,OAA6D;CACvF,OAAO;EACL,IAAI,MAAM;EACV,iBAAiB,MAAM;CACzB;AACF;AAEA,MAAa,oBAAoB;CAC/B;CACA;AACF"}
@@ -1,16 +1,13 @@
1
- //#region src/logics/segmented-control/segmented-control.d.ts
2
1
  export interface SegmentedControlItemState<Value extends string> {
3
2
  isButtonElement: boolean;
4
3
  selectedValue: Value | undefined;
5
4
  }
6
5
  export interface SegmentedControlItemAttributes {
7
6
  type: "button" | undefined;
8
- "aria-pressed": boolean;
7
+ "aria-current": boolean;
9
8
  }
10
- declare function getItemAttributes<Value extends string>(state: SegmentedControlItemState<Value>, value: Value): SegmentedControlItemAttributes;
9
+ declare function getItemAttributes<Value extends string>(state: Readonly<SegmentedControlItemState<Value>>, value: Value): SegmentedControlItemAttributes;
11
10
  export declare const segmentedControl: {
12
11
  readonly getItemAttributes: typeof getItemAttributes;
13
12
  };
14
- //#endregion
15
- export {};
16
- //# sourceMappingURL=segmented-control.d.ts.map
13
+ export {};
@@ -1,12 +1,11 @@
1
- //#region src/logics/segmented-control/segmented-control.ts
1
+ // src/logics/segmented-control/segmented-control.ts
2
2
  function getItemAttributes(state, value) {
3
3
  return {
4
4
  type: state.isButtonElement ? "button" : void 0,
5
- "aria-pressed": state.selectedValue === value
5
+ "aria-current": state.selectedValue === value
6
6
  };
7
7
  }
8
8
  const segmentedControl = { getItemAttributes };
9
- //#endregion
10
9
  export { segmentedControl };
11
10
 
12
11
  //# sourceMappingURL=segmented-control.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"segmented-control.js","names":[],"sources":["../../../src/logics/segmented-control/segmented-control.ts"],"sourcesContent":["export interface SegmentedControlItemState<Value extends string> {\n isButtonElement: boolean;\n selectedValue: Value | undefined;\n}\n\nexport interface SegmentedControlItemAttributes {\n type: \"button\" | undefined;\n \"aria-pressed\": boolean;\n}\n\nfunction getItemAttributes<Value extends string>(\n state: SegmentedControlItemState<Value>,\n value: Value,\n): SegmentedControlItemAttributes {\n return {\n type: state.isButtonElement ? \"button\" : undefined,\n \"aria-pressed\": state.selectedValue === value,\n };\n}\n\nexport const segmentedControl = {\n getItemAttributes,\n} as const;\n"],"mappings":";AAUA,SAAS,kBACP,OACA,OACgC;CAChC,OAAO;EACL,MAAM,MAAM,kBAAkB,WAAW,KAAA;EACzC,gBAAgB,MAAM,kBAAkB;CAC1C;AACF;AAEA,MAAa,mBAAmB,EAC9B,kBACF"}
1
+ {"version":3,"file":"segmented-control.js","names":[],"sources":["../../../src/logics/segmented-control/segmented-control.ts"],"sourcesContent":["export interface SegmentedControlItemState<Value extends string> {\n isButtonElement: boolean;\n selectedValue: Value | undefined;\n}\n\nexport interface SegmentedControlItemAttributes {\n type: \"button\" | undefined;\n \"aria-current\": boolean;\n}\n\nfunction getItemAttributes<Value extends string>(\n state: Readonly<SegmentedControlItemState<Value>>,\n value: Value,\n): SegmentedControlItemAttributes {\n return {\n type: state.isButtonElement ? \"button\" : undefined,\n \"aria-current\": state.selectedValue === value,\n };\n}\n\nexport const segmentedControl = {\n getItemAttributes,\n} as const;\n"],"mappings":";AAUA,SAAS,kBACP,OACA,OACgC;CAChC,OAAO;EACL,MAAM,MAAM,kBAAkB,WAAW,KAAA;EACzC,gBAAgB,MAAM,kBAAkB;CAC1C;AACF;AAEA,MAAa,mBAAmB,EAC9B,kBACF"}
@@ -1,4 +1,3 @@
1
- //#region src/logics/tabs-control/tabs-control.d.ts
2
1
  export interface TabsState<Value extends string> {
3
2
  rootId: string;
4
3
  selectedValue: Value | undefined;
@@ -6,7 +5,7 @@ export interface TabsState<Value extends string> {
6
5
  export interface TabsRootAttributes {
7
6
  id: string;
8
7
  }
9
- declare function getRootAttributes<Value extends string>(state: TabsState<Value>): TabsRootAttributes;
8
+ declare function getRootAttributes<Value extends string>(state: Readonly<TabsState<Value>>): TabsRootAttributes;
10
9
  export interface TabsListAttributeOptions {
11
10
  ariaLabel?: string | undefined;
12
11
  ariaLabelledBy?: string | undefined;
@@ -16,7 +15,7 @@ export interface TabsListAttributes {
16
15
  "aria-label": string | undefined;
17
16
  "aria-labelledby": string | undefined;
18
17
  }
19
- declare function getListAttributes<Value extends string>(state: TabsState<Value>, options: TabsListAttributeOptions): TabsListAttributes;
18
+ declare function getListAttributes<Value extends string>(state: Readonly<TabsState<Value>>, options: Readonly<TabsListAttributeOptions>): TabsListAttributes;
20
19
  export interface TabsTabAttributeOptions {
21
20
  isButtonElement: boolean;
22
21
  }
@@ -28,14 +27,14 @@ export interface TabsTabAttributes {
28
27
  "aria-controls": string;
29
28
  tabindex: 0 | -1;
30
29
  }
31
- declare function getTabAttributes<Value extends string>(state: TabsState<Value>, value: Value, options: TabsTabAttributeOptions): TabsTabAttributes;
30
+ declare function getTabAttributes<Value extends string>(state: Readonly<TabsState<Value>>, value: Value, options: Readonly<TabsTabAttributeOptions>): TabsTabAttributes;
32
31
  export interface TabsPanelAttributes {
33
32
  id: string;
34
33
  role: "tabpanel";
35
34
  "aria-labelledby": string;
36
35
  hidden: boolean;
37
36
  }
38
- declare function getPanelAttributes<Value extends string>(state: TabsState<Value>, value: Value): TabsPanelAttributes;
37
+ declare function getPanelAttributes<Value extends string>(state: Readonly<TabsState<Value>>, value: Value): TabsPanelAttributes;
39
38
  type Action = "none" | "activate" | "focus-move";
40
39
  declare function handleTabKeydown(e: KeyboardEvent): Action;
41
40
  declare function moveFocus(e: KeyboardEvent, rootId: string): void;
@@ -47,6 +46,4 @@ export declare const tabsControl: {
47
46
  readonly handleTabKeydown: typeof handleTabKeydown;
48
47
  readonly moveFocus: typeof moveFocus;
49
48
  };
50
- //#endregion
51
- export {};
52
- //# sourceMappingURL=tabs-control.d.ts.map
49
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { activationKeys, motionKeys, nextIndexMap } from "./tabs-keymap.js";
2
- //#region src/logics/tabs-control/tabs-control.ts
2
+ // src/logics/tabs-control/tabs-control.ts
3
3
  function tabId(rootId, value) {
4
4
  return `${rootId}-tab-${value}`;
5
5
  }
@@ -68,7 +68,6 @@ const tabsControl = {
68
68
  handleTabKeydown,
69
69
  moveFocus
70
70
  };
71
- //#endregion
72
71
  export { tabsControl };
73
72
 
74
73
  //# sourceMappingURL=tabs-control.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tabs-control.js","names":[],"sources":["../../../src/logics/tabs-control/tabs-control.ts"],"sourcesContent":["import { activationKeys, motionKeys, nextIndexMap } from \"./tabs-keymap\";\n\nexport interface TabsState<Value extends string> {\n rootId: string;\n selectedValue: Value | undefined;\n}\n\nfunction tabId(rootId: string, value: string): string {\n return `${rootId}-tab-${value}`;\n}\n\nfunction panelId(rootId: string, value: string): string {\n return `${rootId}-panel-${value}`;\n}\n\nexport interface TabsRootAttributes {\n id: string;\n}\n\nfunction getRootAttributes<Value extends string>(state: TabsState<Value>): TabsRootAttributes {\n return { id: state.rootId };\n}\n\nexport interface TabsListAttributeOptions {\n ariaLabel?: string | undefined;\n ariaLabelledBy?: string | undefined;\n}\n\nexport interface TabsListAttributes {\n role: \"tablist\";\n \"aria-label\": string | undefined;\n \"aria-labelledby\": string | undefined;\n}\n\nfunction getListAttributes<Value extends string>(\n state: TabsState<Value>,\n options: TabsListAttributeOptions,\n): TabsListAttributes {\n return {\n role: \"tablist\",\n \"aria-label\": options.ariaLabel,\n \"aria-labelledby\": options.ariaLabelledBy\n ?? (!options.ariaLabel && state.selectedValue\n ? tabId(state.rootId, state.selectedValue)\n : undefined),\n };\n}\n\nexport interface TabsTabAttributeOptions {\n isButtonElement: boolean;\n}\n\nexport interface TabsTabAttributes {\n id: string;\n role: \"tab\";\n type: \"button\" | undefined;\n \"aria-selected\": boolean;\n \"aria-controls\": string;\n tabindex: 0 | -1;\n}\n\nfunction getTabAttributes<Value extends string>(\n state: TabsState<Value>,\n value: Value,\n options: TabsTabAttributeOptions,\n): TabsTabAttributes {\n const selected = state.selectedValue === value;\n return {\n id: tabId(state.rootId, value),\n role: \"tab\",\n type: options.isButtonElement ? \"button\" : undefined,\n \"aria-selected\": selected,\n \"aria-controls\": panelId(state.rootId, value),\n tabindex: selected ? 0 : -1,\n };\n}\n\nexport interface TabsPanelAttributes {\n id: string;\n role: \"tabpanel\";\n \"aria-labelledby\": string;\n hidden: boolean;\n}\n\nfunction getPanelAttributes<Value extends string>(\n state: TabsState<Value>,\n value: Value,\n): TabsPanelAttributes {\n return {\n id: panelId(state.rootId, value),\n role: \"tabpanel\",\n \"aria-labelledby\": tabId(state.rootId, value),\n hidden: state.selectedValue !== value,\n };\n}\n\nfunction getRoot(rootId: string): HTMLElement {\n const root = document.getElementById(rootId);\n if (!(root instanceof HTMLElement)) {\n throw new Error(\"[Hebium UI|Tabs] Tabs root is not found\");\n }\n return root;\n}\n\nfunction getTabs(rootId: string): HTMLElement[] {\n const tabsList = getRoot(rootId).querySelectorAll(\"[role=\\\"tablist\\\"] > [role=\\\"tab\\\"]\");\n return Array.from(tabsList).filter((e) => e instanceof HTMLElement);\n}\n\ntype Action = \"none\" | \"activate\" | \"focus-move\";\n\nfunction handleTabKeydown(e: KeyboardEvent): Action {\n if (activationKeys.has(e.key)) return \"activate\";\n if (motionKeys.includes(e.key)) return \"focus-move\";\n return \"none\";\n}\n\nfunction moveFocus(e: KeyboardEvent, rootId: string): void {\n const currentTab = e.target;\n if (!(currentTab instanceof HTMLElement)) {\n throw new Error(\"[Hebium UI|Tabs] Only HTMLElement events are supported\");\n }\n\n const tabs = getTabs(rootId);\n const currentIndex = tabs.indexOf(currentTab);\n\n const map = nextIndexMap[e.key as keyof typeof nextIndexMap];\n if (typeof map === \"undefined\") {\n throw new Error(\"[Hebium UI|Tabs] Unexpected event key: \" + e.key);\n }\n const nextIndex = map(currentIndex, tabs.length);\n const nextElement = tabs[nextIndex];\n\n e.preventDefault();\n nextElement?.focus();\n}\n\nexport const tabsControl = {\n getRootAttributes,\n getListAttributes,\n getTabAttributes,\n getPanelAttributes,\n handleTabKeydown,\n moveFocus,\n} as const;\n"],"mappings":";;AAOA,SAAS,MAAM,QAAgB,OAAuB;CACpD,OAAO,GAAG,OAAO,OAAO;AAC1B;AAEA,SAAS,QAAQ,QAAgB,OAAuB;CACtD,OAAO,GAAG,OAAO,SAAS;AAC5B;AAMA,SAAS,kBAAwC,OAA6C;CAC5F,OAAO,EAAE,IAAI,MAAM,OAAO;AAC5B;AAaA,SAAS,kBACP,OACA,SACoB;CACpB,OAAO;EACL,MAAM;EACN,cAAc,QAAQ;EACtB,mBAAmB,QAAQ,mBACrB,CAAC,QAAQ,aAAa,MAAM,gBAC5B,MAAM,MAAM,QAAQ,MAAM,aAAa,IACvC,KAAA;CACR;AACF;AAeA,SAAS,iBACP,OACA,OACA,SACmB;CACnB,MAAM,WAAW,MAAM,kBAAkB;CACzC,OAAO;EACL,IAAI,MAAM,MAAM,QAAQ,KAAK;EAC7B,MAAM;EACN,MAAM,QAAQ,kBAAkB,WAAW,KAAA;EAC3C,iBAAiB;EACjB,iBAAiB,QAAQ,MAAM,QAAQ,KAAK;EAC5C,UAAU,WAAW,IAAI;CAC3B;AACF;AASA,SAAS,mBACP,OACA,OACqB;CACrB,OAAO;EACL,IAAI,QAAQ,MAAM,QAAQ,KAAK;EAC/B,MAAM;EACN,mBAAmB,MAAM,MAAM,QAAQ,KAAK;EAC5C,QAAQ,MAAM,kBAAkB;CAClC;AACF;AAEA,SAAS,QAAQ,QAA6B;CAC5C,MAAM,OAAO,SAAS,eAAe,MAAM;CAC3C,IAAI,EAAE,gBAAgB,cACpB,MAAM,IAAI,MAAM,yCAAyC;CAE3D,OAAO;AACT;AAEA,SAAS,QAAQ,QAA+B;CAC9C,MAAM,WAAW,QAAQ,MAAM,CAAC,CAAC,iBAAiB,qCAAqC;CACvF,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,QAAQ,MAAM,aAAa,WAAW;AACpE;AAIA,SAAS,iBAAiB,GAA0B;CAClD,IAAI,eAAe,IAAI,EAAE,GAAG,GAAG,OAAO;CACtC,IAAI,WAAW,SAAS,EAAE,GAAG,GAAG,OAAO;CACvC,OAAO;AACT;AAEA,SAAS,UAAU,GAAkB,QAAsB;CACzD,MAAM,aAAa,EAAE;CACrB,IAAI,EAAE,sBAAsB,cAC1B,MAAM,IAAI,MAAM,wDAAwD;CAG1E,MAAM,OAAO,QAAQ,MAAM;CAC3B,MAAM,eAAe,KAAK,QAAQ,UAAU;CAE5C,MAAM,MAAM,aAAa,EAAE;CAC3B,IAAI,OAAO,QAAQ,aACjB,MAAM,IAAI,MAAM,4CAA4C,EAAE,GAAG;CAGnE,MAAM,cAAc,KADF,IAAI,cAAc,KAAK,MACR;CAEjC,EAAE,eAAe;CACjB,aAAa,MAAM;AACrB;AAEA,MAAa,cAAc;CACzB;CACA;CACA;CACA;CACA;CACA;AACF"}
1
+ {"version":3,"file":"tabs-control.js","names":[],"sources":["../../../src/logics/tabs-control/tabs-control.ts"],"sourcesContent":["import { activationKeys, motionKeys, nextIndexMap } from \"./tabs-keymap\";\n\nexport interface TabsState<Value extends string> {\n rootId: string;\n selectedValue: Value | undefined;\n}\n\nfunction tabId(rootId: string, value: string): string {\n return `${rootId}-tab-${value}`;\n}\n\nfunction panelId(rootId: string, value: string): string {\n return `${rootId}-panel-${value}`;\n}\n\nexport interface TabsRootAttributes {\n id: string;\n}\n\nfunction getRootAttributes<Value extends string>(state: Readonly<TabsState<Value>>): TabsRootAttributes {\n return { id: state.rootId };\n}\n\nexport interface TabsListAttributeOptions {\n ariaLabel?: string | undefined;\n ariaLabelledBy?: string | undefined;\n}\n\nexport interface TabsListAttributes {\n role: \"tablist\";\n \"aria-label\": string | undefined;\n \"aria-labelledby\": string | undefined;\n}\n\nfunction getListAttributes<Value extends string>(\n state: Readonly<TabsState<Value>>,\n options: Readonly<TabsListAttributeOptions>,\n): TabsListAttributes {\n return {\n role: \"tablist\",\n \"aria-label\": options.ariaLabel,\n \"aria-labelledby\": options.ariaLabelledBy\n ?? (!options.ariaLabel && state.selectedValue\n ? tabId(state.rootId, state.selectedValue)\n : undefined),\n };\n}\n\nexport interface TabsTabAttributeOptions {\n isButtonElement: boolean;\n}\n\nexport interface TabsTabAttributes {\n id: string;\n role: \"tab\";\n type: \"button\" | undefined;\n \"aria-selected\": boolean;\n \"aria-controls\": string;\n tabindex: 0 | -1;\n}\n\nfunction getTabAttributes<Value extends string>(\n state: Readonly<TabsState<Value>>,\n value: Value,\n options: Readonly<TabsTabAttributeOptions>,\n): TabsTabAttributes {\n const selected = state.selectedValue === value;\n return {\n id: tabId(state.rootId, value),\n role: \"tab\",\n type: options.isButtonElement ? \"button\" : undefined,\n \"aria-selected\": selected,\n \"aria-controls\": panelId(state.rootId, value),\n tabindex: selected ? 0 : -1,\n };\n}\n\nexport interface TabsPanelAttributes {\n id: string;\n role: \"tabpanel\";\n \"aria-labelledby\": string;\n hidden: boolean;\n}\n\nfunction getPanelAttributes<Value extends string>(\n state: Readonly<TabsState<Value>>,\n value: Value,\n): TabsPanelAttributes {\n return {\n id: panelId(state.rootId, value),\n role: \"tabpanel\",\n \"aria-labelledby\": tabId(state.rootId, value),\n hidden: state.selectedValue !== value,\n };\n}\n\nfunction getRoot(rootId: string): HTMLElement {\n const root = document.getElementById(rootId);\n if (!(root instanceof HTMLElement)) {\n throw new Error(\"[Hebium UI|Tabs] Tabs root is not found\");\n }\n return root;\n}\n\nfunction getTabs(rootId: string): HTMLElement[] {\n const tabsList = getRoot(rootId).querySelectorAll(\"[role=\\\"tablist\\\"] > [role=\\\"tab\\\"]\");\n return Array.from(tabsList).filter((e) => e instanceof HTMLElement);\n}\n\ntype Action = \"none\" | \"activate\" | \"focus-move\";\n\nfunction handleTabKeydown(e: KeyboardEvent): Action {\n if (activationKeys.has(e.key)) return \"activate\";\n if (motionKeys.includes(e.key)) return \"focus-move\";\n return \"none\";\n}\n\nfunction moveFocus(e: KeyboardEvent, rootId: string): void {\n const currentTab = e.target;\n if (!(currentTab instanceof HTMLElement)) {\n throw new Error(\"[Hebium UI|Tabs] Only HTMLElement events are supported\");\n }\n\n const tabs = getTabs(rootId);\n const currentIndex = tabs.indexOf(currentTab);\n\n const map = nextIndexMap[e.key as keyof typeof nextIndexMap];\n if (typeof map === \"undefined\") {\n throw new Error(\"[Hebium UI|Tabs] Unexpected event key: \" + e.key);\n }\n const nextIndex = map(currentIndex, tabs.length);\n const nextElement = tabs[nextIndex];\n\n e.preventDefault();\n nextElement?.focus();\n}\n\nexport const tabsControl = {\n getRootAttributes,\n getListAttributes,\n getTabAttributes,\n getPanelAttributes,\n handleTabKeydown,\n moveFocus,\n} as const;\n"],"mappings":";;AAOA,SAAS,MAAM,QAAgB,OAAuB;CACpD,OAAO,GAAG,OAAO,OAAO;AAC1B;AAEA,SAAS,QAAQ,QAAgB,OAAuB;CACtD,OAAO,GAAG,OAAO,SAAS;AAC5B;AAMA,SAAS,kBAAwC,OAAuD;CACtG,OAAO,EAAE,IAAI,MAAM,OAAO;AAC5B;AAaA,SAAS,kBACP,OACA,SACoB;CACpB,OAAO;EACL,MAAM;EACN,cAAc,QAAQ;EACtB,mBAAmB,QAAQ,mBACrB,CAAC,QAAQ,aAAa,MAAM,gBAC5B,MAAM,MAAM,QAAQ,MAAM,aAAa,IACvC,KAAA;CACR;AACF;AAeA,SAAS,iBACP,OACA,OACA,SACmB;CACnB,MAAM,WAAW,MAAM,kBAAkB;CACzC,OAAO;EACL,IAAI,MAAM,MAAM,QAAQ,KAAK;EAC7B,MAAM;EACN,MAAM,QAAQ,kBAAkB,WAAW,KAAA;EAC3C,iBAAiB;EACjB,iBAAiB,QAAQ,MAAM,QAAQ,KAAK;EAC5C,UAAU,WAAW,IAAI;CAC3B;AACF;AASA,SAAS,mBACP,OACA,OACqB;CACrB,OAAO;EACL,IAAI,QAAQ,MAAM,QAAQ,KAAK;EAC/B,MAAM;EACN,mBAAmB,MAAM,MAAM,QAAQ,KAAK;EAC5C,QAAQ,MAAM,kBAAkB;CAClC;AACF;AAEA,SAAS,QAAQ,QAA6B;CAC5C,MAAM,OAAO,SAAS,eAAe,MAAM;CAC3C,IAAI,EAAE,gBAAgB,cACpB,MAAM,IAAI,MAAM,yCAAyC;CAE3D,OAAO;AACT;AAEA,SAAS,QAAQ,QAA+B;CAC9C,MAAM,WAAW,QAAQ,MAAM,CAAC,CAAC,iBAAiB,qCAAqC;CACvF,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,QAAQ,MAAM,aAAa,WAAW;AACpE;AAIA,SAAS,iBAAiB,GAA0B;CAClD,IAAI,eAAe,IAAI,EAAE,GAAG,GAAG,OAAO;CACtC,IAAI,WAAW,SAAS,EAAE,GAAG,GAAG,OAAO;CACvC,OAAO;AACT;AAEA,SAAS,UAAU,GAAkB,QAAsB;CACzD,MAAM,aAAa,EAAE;CACrB,IAAI,EAAE,sBAAsB,cAC1B,MAAM,IAAI,MAAM,wDAAwD;CAG1E,MAAM,OAAO,QAAQ,MAAM;CAC3B,MAAM,eAAe,KAAK,QAAQ,UAAU;CAE5C,MAAM,MAAM,aAAa,EAAE;CAC3B,IAAI,OAAO,QAAQ,aACjB,MAAM,IAAI,MAAM,4CAA4C,EAAE,GAAG;CAGnE,MAAM,cAAc,KADF,IAAI,cAAc,KAAK,MACR;CAEjC,EAAE,eAAe;CACjB,aAAa,MAAM;AACrB;AAEA,MAAa,cAAc;CACzB;CACA;CACA;CACA;CACA;CACA;AACF"}
@@ -1,4 +1,4 @@
1
- //#region src/logics/tabs-control/tabs-keymap.ts
1
+ // src/logics/tabs-control/tabs-keymap.ts
2
2
  const nextIndexMap = {
3
3
  ArrowLeft: (currentIndex, tabsLength) => (currentIndex - 1 + tabsLength) % tabsLength,
4
4
  ArrowRight: (currentIndex, tabsLength) => (currentIndex + 1) % tabsLength,
@@ -7,7 +7,6 @@ const nextIndexMap = {
7
7
  };
8
8
  const motionKeys = Object.keys(nextIndexMap);
9
9
  const activationKeys = /* @__PURE__ */ new Set(["Enter", " "]);
10
- //#endregion
11
10
  export { activationKeys, motionKeys, nextIndexMap };
12
11
 
13
12
  //# sourceMappingURL=tabs-keymap.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tabs-keymap.js","names":[],"sources":["../../../src/logics/tabs-control/tabs-keymap.ts"],"sourcesContent":["type IndexMap = (currentIndex: number, tabsLength: number) => number;\nexport const nextIndexMap = {\n ArrowLeft: (currentIndex, tabsLength) => (currentIndex - 1 + tabsLength) % tabsLength,\n ArrowRight: (currentIndex, tabsLength) => (currentIndex + 1) % tabsLength,\n Home: (): number => 0,\n End: (_, tabsLength) => tabsLength - 1,\n} as const satisfies Readonly<Record<string, IndexMap>>;\n\nexport const motionKeys = Object.keys(nextIndexMap);\nexport const activationKeys = new Set([\"Enter\", \" \"]);\n"],"mappings":";AACA,MAAa,eAAe;CAC1B,YAAY,cAAc,gBAAgB,eAAe,IAAI,cAAc;CAC3E,aAAa,cAAc,gBAAgB,eAAe,KAAK;CAC/D,YAAoB;CACpB,MAAM,GAAG,eAAe,aAAa;AACvC;AAEA,MAAa,aAAa,OAAO,KAAK,YAAY;AAClD,MAAa,iCAAiB,IAAI,IAAI,CAAC,SAAS,GAAG,CAAC"}
1
+ {"version":3,"file":"tabs-keymap.js","names":[],"sources":["../../../src/logics/tabs-control/tabs-keymap.ts"],"sourcesContent":["type IndexMap = (currentIndex: number, tabsLength: number) => number;\nexport const nextIndexMap = {\n ArrowLeft: (currentIndex, tabsLength) => (currentIndex - 1 + tabsLength) % tabsLength,\n ArrowRight: (currentIndex, tabsLength) => (currentIndex + 1) % tabsLength,\n Home: (): number => 0,\n End: (_, tabsLength) => tabsLength - 1,\n} as const satisfies Readonly<Record<string, IndexMap>>;\n\nexport const motionKeys: readonly string[] = Object.keys(nextIndexMap);\nexport const activationKeys: ReadonlySet<string> = new Set([\"Enter\", \" \"]);\n"],"mappings":";AACA,MAAa,eAAe;CAC1B,YAAY,cAAc,gBAAgB,eAAe,IAAI,cAAc;CAC3E,aAAa,cAAc,gBAAgB,eAAe,KAAK;CAC/D,YAAoB;CACpB,MAAM,GAAG,eAAe,aAAa;AACvC;AAEA,MAAa,aAAgC,OAAO,KAAK,YAAY;AACrE,MAAa,iCAAsC,IAAI,IAAI,CAAC,SAAS,GAAG,CAAC"}
@@ -1,4 +1,3 @@
1
- //#region src/logics/tooltip-control/tooltip-control.d.ts
2
1
  export interface TooltipState {
3
2
  tooltipId: string;
4
3
  }
@@ -11,13 +10,13 @@ export interface TooltipTriggerAttributes {
11
10
  type: "button" | undefined;
12
11
  "aria-describedby": string;
13
12
  }
14
- declare function getTriggerAttributes(state: TooltipState, options: TooltipTriggerAttributeOptions): TooltipTriggerAttributes;
13
+ declare function getTriggerAttributes(state: Readonly<TooltipState>, options: Readonly<TooltipTriggerAttributeOptions>): TooltipTriggerAttributes;
15
14
  export interface TooltipContentAttributes {
16
15
  role: "tooltip";
17
16
  id: string;
18
17
  popover: "hint";
19
18
  }
20
- declare function getContentAttributes(state: TooltipState): TooltipContentAttributes;
19
+ declare function getContentAttributes(state: Readonly<TooltipState>): TooltipContentAttributes;
21
20
  declare function showTooltip(tooltipId: string, source: HTMLElement): void;
22
21
  declare function hideTooltip(tooltipId: string): void;
23
22
  export declare const tooltipControl: {
@@ -26,6 +25,4 @@ export declare const tooltipControl: {
26
25
  readonly showTooltip: typeof showTooltip;
27
26
  readonly hideTooltip: typeof hideTooltip;
28
27
  };
29
- //#endregion
30
- export {};
31
- //# sourceMappingURL=tooltip-control.d.ts.map
28
+ export {};
@@ -1,4 +1,4 @@
1
- //#region src/logics/tooltip-control/tooltip-control.ts
1
+ // src/logics/tooltip-control/tooltip-control.ts
2
2
  const hideDelayMs = 75;
3
3
  const hideTimeoutMap = /* @__PURE__ */ new Map();
4
4
  function triggerId(tooltipId) {
@@ -47,7 +47,6 @@ const tooltipControl = {
47
47
  showTooltip,
48
48
  hideTooltip
49
49
  };
50
- //#endregion
51
50
  export { tooltipControl, triggerId };
52
51
 
53
52
  //# sourceMappingURL=tooltip-control.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-control.js","names":[],"sources":["../../../src/logics/tooltip-control/tooltip-control.ts"],"sourcesContent":["const hideDelayMs = 75;\n\nconst hideTimeoutMap = new Map<string, number>();\n\nexport interface TooltipState {\n tooltipId: string;\n}\n\nexport function triggerId(tooltipId: string): string {\n return `${tooltipId}-trigger`;\n}\n\nexport interface TooltipTriggerAttributeOptions {\n isButtonElement: boolean;\n}\n\nexport interface TooltipTriggerAttributes {\n id: string;\n type: \"button\" | undefined;\n \"aria-describedby\": string;\n}\n\nfunction getTriggerAttributes(\n state: TooltipState,\n options: TooltipTriggerAttributeOptions,\n): TooltipTriggerAttributes {\n return {\n id: triggerId(state.tooltipId),\n type: options.isButtonElement ? \"button\" : undefined,\n \"aria-describedby\": state.tooltipId,\n };\n}\n\nexport interface TooltipContentAttributes {\n role: \"tooltip\";\n id: string;\n popover: \"hint\";\n}\n\nfunction getContentAttributes(state: TooltipState): TooltipContentAttributes {\n return {\n role: \"tooltip\",\n id: state.tooltipId,\n popover: \"hint\",\n };\n}\n\nfunction getTooltip(tooltipId: string): HTMLElement {\n const tooltip = document.getElementById(tooltipId);\n if (!(tooltip instanceof HTMLElement)) {\n throw new Error(\"[Hebium UI|Tooltip] Tooltip element is not found\");\n }\n return tooltip;\n}\n\nfunction showTooltip(tooltipId: string, source: HTMLElement): void {\n const tooltip = getTooltip(tooltipId);\n\n const timeoutId = hideTimeoutMap.get(tooltipId);\n clearTimeout(timeoutId);\n\n tooltip.showPopover({ source });\n}\n\nfunction shouldHideTooltip(tooltip: HTMLElement, trigger: HTMLElement | null): boolean {\n const isTriggerFucused = trigger && trigger.matches(\":focus\");\n return !tooltip.matches(\":hover\") && !isTriggerFucused;\n}\n\nfunction hideTooltip(tooltipId: string): void {\n const tooltip = getTooltip(tooltipId);\n const trigger = document.getElementById(triggerId(tooltipId));\n\n // Delay hiding to keep the tooltip open while the pointer crosses the offset gap.\n const timeoutId = setTimeout(() => {\n if (shouldHideTooltip(tooltip, trigger)) {\n tooltip.hidePopover();\n }\n }, hideDelayMs);\n hideTimeoutMap.set(tooltipId, timeoutId);\n}\n\nexport const tooltipControl = {\n getTriggerAttributes,\n getContentAttributes,\n showTooltip,\n hideTooltip,\n} as const;\n"],"mappings":";AAAA,MAAM,cAAc;AAEpB,MAAM,iCAAiB,IAAI,IAAoB;AAM/C,SAAgB,UAAU,WAA2B;CACnD,OAAO,GAAG,UAAU;AACtB;AAYA,SAAS,qBACP,OACA,SAC0B;CAC1B,OAAO;EACL,IAAI,UAAU,MAAM,SAAS;EAC7B,MAAM,QAAQ,kBAAkB,WAAW,KAAA;EAC3C,oBAAoB,MAAM;CAC5B;AACF;AAQA,SAAS,qBAAqB,OAA+C;CAC3E,OAAO;EACL,MAAM;EACN,IAAI,MAAM;EACV,SAAS;CACX;AACF;AAEA,SAAS,WAAW,WAAgC;CAClD,MAAM,UAAU,SAAS,eAAe,SAAS;CACjD,IAAI,EAAE,mBAAmB,cACvB,MAAM,IAAI,MAAM,kDAAkD;CAEpE,OAAO;AACT;AAEA,SAAS,YAAY,WAAmB,QAA2B;CACjE,MAAM,UAAU,WAAW,SAAS;CAEpC,MAAM,YAAY,eAAe,IAAI,SAAS;CAC9C,aAAa,SAAS;CAEtB,QAAQ,YAAY,EAAE,OAAO,CAAC;AAChC;AAEA,SAAS,kBAAkB,SAAsB,SAAsC;CACrF,MAAM,mBAAmB,WAAW,QAAQ,QAAQ,QAAQ;CAC5D,OAAO,CAAC,QAAQ,QAAQ,QAAQ,KAAK,CAAC;AACxC;AAEA,SAAS,YAAY,WAAyB;CAC5C,MAAM,UAAU,WAAW,SAAS;CACpC,MAAM,UAAU,SAAS,eAAe,UAAU,SAAS,CAAC;CAG5D,MAAM,YAAY,iBAAiB;EACjC,IAAI,kBAAkB,SAAS,OAAO,GACpC,QAAQ,YAAY;CAExB,GAAG,WAAW;CACd,eAAe,IAAI,WAAW,SAAS;AACzC;AAEA,MAAa,iBAAiB;CAC5B;CACA;CACA;CACA;AACF"}
1
+ {"version":3,"file":"tooltip-control.js","names":[],"sources":["../../../src/logics/tooltip-control/tooltip-control.ts"],"sourcesContent":["const hideDelayMs = 75;\n\nconst hideTimeoutMap = new Map<string, number>();\n\nexport interface TooltipState {\n tooltipId: string;\n}\n\nexport function triggerId(tooltipId: string): string {\n return `${tooltipId}-trigger`;\n}\n\nexport interface TooltipTriggerAttributeOptions {\n isButtonElement: boolean;\n}\n\nexport interface TooltipTriggerAttributes {\n id: string;\n type: \"button\" | undefined;\n \"aria-describedby\": string;\n}\n\nfunction getTriggerAttributes(\n state: Readonly<TooltipState>,\n options: Readonly<TooltipTriggerAttributeOptions>,\n): TooltipTriggerAttributes {\n return {\n id: triggerId(state.tooltipId),\n type: options.isButtonElement ? \"button\" : undefined,\n \"aria-describedby\": state.tooltipId,\n };\n}\n\nexport interface TooltipContentAttributes {\n role: \"tooltip\";\n id: string;\n popover: \"hint\";\n}\n\nfunction getContentAttributes(state: Readonly<TooltipState>): TooltipContentAttributes {\n return {\n role: \"tooltip\",\n id: state.tooltipId,\n popover: \"hint\",\n };\n}\n\nfunction getTooltip(tooltipId: string): HTMLElement {\n const tooltip = document.getElementById(tooltipId);\n if (!(tooltip instanceof HTMLElement)) {\n throw new Error(\"[Hebium UI|Tooltip] Tooltip element is not found\");\n }\n return tooltip;\n}\n\nfunction showTooltip(tooltipId: string, source: HTMLElement): void {\n const tooltip = getTooltip(tooltipId);\n\n const timeoutId = hideTimeoutMap.get(tooltipId);\n clearTimeout(timeoutId);\n\n tooltip.showPopover({ source });\n}\n\nfunction shouldHideTooltip(tooltip: HTMLElement, trigger: HTMLElement | null): boolean {\n const isTriggerFucused = trigger && trigger.matches(\":focus\");\n return !tooltip.matches(\":hover\") && !isTriggerFucused;\n}\n\nfunction hideTooltip(tooltipId: string): void {\n const tooltip = getTooltip(tooltipId);\n const trigger = document.getElementById(triggerId(tooltipId));\n\n // Delay hiding to keep the tooltip open while the pointer crosses the offset gap.\n const timeoutId = setTimeout(() => {\n if (shouldHideTooltip(tooltip, trigger)) {\n tooltip.hidePopover();\n }\n }, hideDelayMs);\n hideTimeoutMap.set(tooltipId, timeoutId);\n}\n\nexport const tooltipControl = {\n getTriggerAttributes,\n getContentAttributes,\n showTooltip,\n hideTooltip,\n} as const;\n"],"mappings":";AAAA,MAAM,cAAc;AAEpB,MAAM,iCAAiB,IAAI,IAAoB;AAM/C,SAAgB,UAAU,WAA2B;CACnD,OAAO,GAAG,UAAU;AACtB;AAYA,SAAS,qBACP,OACA,SAC0B;CAC1B,OAAO;EACL,IAAI,UAAU,MAAM,SAAS;EAC7B,MAAM,QAAQ,kBAAkB,WAAW,KAAA;EAC3C,oBAAoB,MAAM;CAC5B;AACF;AAQA,SAAS,qBAAqB,OAAyD;CACrF,OAAO;EACL,MAAM;EACN,IAAI,MAAM;EACV,SAAS;CACX;AACF;AAEA,SAAS,WAAW,WAAgC;CAClD,MAAM,UAAU,SAAS,eAAe,SAAS;CACjD,IAAI,EAAE,mBAAmB,cACvB,MAAM,IAAI,MAAM,kDAAkD;CAEpE,OAAO;AACT;AAEA,SAAS,YAAY,WAAmB,QAA2B;CACjE,MAAM,UAAU,WAAW,SAAS;CAEpC,MAAM,YAAY,eAAe,IAAI,SAAS;CAC9C,aAAa,SAAS;CAEtB,QAAQ,YAAY,EAAE,OAAO,CAAC;AAChC;AAEA,SAAS,kBAAkB,SAAsB,SAAsC;CACrF,MAAM,mBAAmB,WAAW,QAAQ,QAAQ,QAAQ;CAC5D,OAAO,CAAC,QAAQ,QAAQ,QAAQ,KAAK,CAAC;AACxC;AAEA,SAAS,YAAY,WAAyB;CAC5C,MAAM,UAAU,WAAW,SAAS;CACpC,MAAM,UAAU,SAAS,eAAe,UAAU,SAAS,CAAC;CAG5D,MAAM,YAAY,iBAAiB;EACjC,IAAI,kBAAkB,SAAS,OAAO,GACpC,QAAQ,YAAY;CAExB,GAAG,WAAW;CACd,eAAe,IAAI,WAAW,SAAS;AACzC;AAEA,MAAa,iBAAiB;CAC5B;CACA;CACA;CACA;AACF"}
@@ -1,17 +1,16 @@
1
1
  import { Recipe } from "../../styles/make-recipe.js";
2
2
  import { RecipeSlots, RecipeVariants } from "../../styles/make-recipe-type.js";
3
- //#region src/recipes/alert/alert.d.ts
4
- export declare const alertRecipe: Recipe<"icon" | "root" | "content" | "errorIcon" | "message" | "description", {
3
+ export declare const alertRecipe: Recipe<"root" | "content" | "message" | "description", {
5
4
  variant: {
6
5
  light: {
7
6
  root: {
8
7
  bgColor: "base-alpha";
9
- border: "base-alpha-peak";
8
+ borderColor: "base-alpha-peak";
10
9
  };
11
10
  };
12
11
  outline: {
13
12
  root: {
14
- border: "base";
13
+ borderColor: "base";
15
14
  };
16
15
  };
17
16
  };
@@ -60,6 +59,4 @@ export declare const alertRecipe: Recipe<"icon" | "root" | "content" | "errorIco
60
59
  };
61
60
  }>;
62
61
  export type AlertVariants = RecipeVariants<typeof alertRecipe>;
63
- export type AlertSlots = RecipeSlots<typeof alertRecipe>;
64
- //#endregion
65
- //# sourceMappingURL=alert.d.ts.map
62
+ export type AlertSlots = RecipeSlots<typeof alertRecipe>;
@@ -1,22 +1,20 @@
1
1
  import { makeRecipe } from "../../styles/make-recipe.js";
2
- //#region src/recipes/alert/alert.ts
2
+ // src/recipes/alert/alert.ts
3
3
  const alertRecipe = makeRecipe({
4
4
  base: {
5
5
  root: {
6
6
  reset: "true",
7
7
  display: "flex",
8
8
  gap: "0.5x",
9
+ color: "base",
10
+ borderWidth: "base",
11
+ borderStyle: "solid",
9
12
  borderRadius: "base"
10
13
  },
11
14
  content: {
12
15
  display: "flex-col",
13
16
  rowGap: "0.5x"
14
17
  },
15
- icon: { lineHeight: "1" },
16
- errorIcon: {
17
- color: "base",
18
- icon: "error"
19
- },
20
18
  message: {
21
19
  fontWeight: "bold",
22
20
  lineHeight: "1",
@@ -28,9 +26,9 @@ const alertRecipe = makeRecipe({
28
26
  variant: {
29
27
  light: { root: {
30
28
  bgColor: "base-alpha",
31
- border: "base-alpha-peak"
29
+ borderColor: "base-alpha-peak"
32
30
  } },
33
- outline: { root: { border: "base" } }
31
+ outline: { root: { borderColor: "base" } }
34
32
  },
35
33
  color: {
36
34
  accent: { root: { baseColor: "accent" } },
@@ -60,7 +58,6 @@ const alertRecipe = makeRecipe({
60
58
  padding: "md"
61
59
  }
62
60
  });
63
- //#endregion
64
61
  export { alertRecipe };
65
62
 
66
63
  //# sourceMappingURL=alert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert.js","names":[],"sources":["../../../src/recipes/alert/alert.ts"],"sourcesContent":["import { makeRecipe } from \"~/styles/make-recipe\";\nimport { type RecipeSlots, type RecipeVariants } from \"~/styles/make-recipe-type\";\n\nexport const alertRecipe = makeRecipe({\n base: {\n root: {\n reset: \"true\",\n display: \"flex\",\n gap: \"0.5x\",\n borderRadius: \"base\",\n },\n content: {\n display: \"flex-col\",\n rowGap: \"0.5x\",\n },\n icon: {\n lineHeight: \"1\",\n },\n errorIcon: {\n color: \"base\",\n icon: \"error\",\n },\n message: {\n fontWeight: \"bold\",\n lineHeight: \"1\",\n color: \"base\",\n },\n description: {\n color: \"text\",\n },\n },\n variants: {\n variant: {\n light: {\n root: {\n bgColor: \"base-alpha\",\n border: \"base-alpha-peak\",\n },\n },\n outline: {\n root: {\n border: \"base\",\n },\n },\n },\n color: {\n accent: { root: { baseColor: \"accent\" } },\n danger: { root: { baseColor: \"danger\" } },\n caution: { root: { baseColor: \"caution\" } },\n neutral: { root: { baseColor: \"neutral\" } },\n },\n padding: {\n none: {},\n sm: {\n root: {\n paddingInline: \"0.75x\",\n paddingBlock: \"0.75x\",\n },\n },\n md: {\n root: {\n paddingInline: \"1x\",\n paddingBlock: \"1x\",\n },\n },\n lg: {\n root: {\n paddingInline: \"1.25x\",\n paddingBlock: \"1.25x\",\n },\n },\n },\n },\n defaultVariants: {\n variant: \"light\",\n color: \"danger\",\n padding: \"md\",\n },\n});\n\nexport type AlertVariants = RecipeVariants<typeof alertRecipe>;\nexport type AlertSlots = RecipeSlots<typeof alertRecipe>;\n"],"mappings":";;AAGA,MAAa,cAAc,WAAW;CACpC,MAAM;EACJ,MAAM;GACJ,OAAO;GACP,SAAS;GACT,KAAK;GACL,cAAc;EAChB;EACA,SAAS;GACP,SAAS;GACT,QAAQ;EACV;EACA,MAAM,EACJ,YAAY,IACd;EACA,WAAW;GACT,OAAO;GACP,MAAM;EACR;EACA,SAAS;GACP,YAAY;GACZ,YAAY;GACZ,OAAO;EACT;EACA,aAAa,EACX,OAAO,OACT;CACF;CACA,UAAU;EACR,SAAS;GACP,OAAO,EACL,MAAM;IACJ,SAAS;IACT,QAAQ;GACV,EACF;GACA,SAAS,EACP,MAAM,EACJ,QAAQ,OACV,EACF;EACF;EACA,OAAO;GACL,QAAQ,EAAE,MAAM,EAAE,WAAW,SAAS,EAAE;GACxC,QAAQ,EAAE,MAAM,EAAE,WAAW,SAAS,EAAE;GACxC,SAAS,EAAE,MAAM,EAAE,WAAW,UAAU,EAAE;GAC1C,SAAS,EAAE,MAAM,EAAE,WAAW,UAAU,EAAE;EAC5C;EACA,SAAS;GACP,MAAM,CAAC;GACP,IAAI,EACF,MAAM;IACJ,eAAe;IACf,cAAc;GAChB,EACF;GACA,IAAI,EACF,MAAM;IACJ,eAAe;IACf,cAAc;GAChB,EACF;GACA,IAAI,EACF,MAAM;IACJ,eAAe;IACf,cAAc;GAChB,EACF;EACF;CACF;CACA,iBAAiB;EACf,SAAS;EACT,OAAO;EACP,SAAS;CACX;AACF,CAAC"}
1
+ {"version":3,"file":"alert.js","names":[],"sources":["../../../src/recipes/alert/alert.ts"],"sourcesContent":["import { makeRecipe } from \"~/styles/make-recipe\";\nimport { type RecipeSlots, type RecipeVariants } from \"~/styles/make-recipe-type\";\n\nexport const alertRecipe = makeRecipe({\n base: {\n root: {\n reset: \"true\",\n display: \"flex\",\n gap: \"0.5x\",\n color: \"base\",\n borderWidth: \"base\",\n borderStyle: \"solid\",\n borderRadius: \"base\",\n },\n content: {\n display: \"flex-col\",\n rowGap: \"0.5x\",\n },\n message: {\n fontWeight: \"bold\",\n lineHeight: \"1\",\n color: \"base\",\n },\n description: {\n color: \"text\",\n },\n },\n variants: {\n variant: {\n light: {\n root: {\n bgColor: \"base-alpha\",\n borderColor: \"base-alpha-peak\",\n },\n },\n outline: {\n root: {\n borderColor: \"base\",\n },\n },\n },\n color: {\n accent: { root: { baseColor: \"accent\" } },\n danger: { root: { baseColor: \"danger\" } },\n caution: { root: { baseColor: \"caution\" } },\n neutral: { root: { baseColor: \"neutral\" } },\n },\n padding: {\n none: {},\n sm: {\n root: {\n paddingInline: \"0.75x\",\n paddingBlock: \"0.75x\",\n },\n },\n md: {\n root: {\n paddingInline: \"1x\",\n paddingBlock: \"1x\",\n },\n },\n lg: {\n root: {\n paddingInline: \"1.25x\",\n paddingBlock: \"1.25x\",\n },\n },\n },\n },\n defaultVariants: {\n variant: \"light\",\n color: \"danger\",\n padding: \"md\",\n },\n});\n\nexport type AlertVariants = RecipeVariants<typeof alertRecipe>;\nexport type AlertSlots = RecipeSlots<typeof alertRecipe>;\n"],"mappings":";;AAGA,MAAa,cAAc,WAAW;CACpC,MAAM;EACJ,MAAM;GACJ,OAAO;GACP,SAAS;GACT,KAAK;GACL,OAAO;GACP,aAAa;GACb,aAAa;GACb,cAAc;EAChB;EACA,SAAS;GACP,SAAS;GACT,QAAQ;EACV;EACA,SAAS;GACP,YAAY;GACZ,YAAY;GACZ,OAAO;EACT;EACA,aAAa,EACX,OAAO,OACT;CACF;CACA,UAAU;EACR,SAAS;GACP,OAAO,EACL,MAAM;IACJ,SAAS;IACT,aAAa;GACf,EACF;GACA,SAAS,EACP,MAAM,EACJ,aAAa,OACf,EACF;EACF;EACA,OAAO;GACL,QAAQ,EAAE,MAAM,EAAE,WAAW,SAAS,EAAE;GACxC,QAAQ,EAAE,MAAM,EAAE,WAAW,SAAS,EAAE;GACxC,SAAS,EAAE,MAAM,EAAE,WAAW,UAAU,EAAE;GAC1C,SAAS,EAAE,MAAM,EAAE,WAAW,UAAU,EAAE;EAC5C;EACA,SAAS;GACP,MAAM,CAAC;GACP,IAAI,EACF,MAAM;IACJ,eAAe;IACf,cAAc;GAChB,EACF;GACA,IAAI,EACF,MAAM;IACJ,eAAe;IACf,cAAc;GAChB,EACF;GACA,IAAI,EACF,MAAM;IACJ,eAAe;IACf,cAAc;GAChB,EACF;EACF;CACF;CACA,iBAAiB;EACf,SAAS;EACT,OAAO;EACP,SAAS;CACX;AACF,CAAC"}