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

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 (169) hide show
  1. package/dist/index.d.ts +3 -1
  2. package/dist/index.js +3 -1
  3. package/dist/logics/avatar-placeholder/get-avatar-placeholder.d.ts +0 -2
  4. package/dist/logics/avatar-placeholder/get-avatar-placeholder.js +1 -2
  5. package/dist/logics/avatar-placeholder/should-show-avatar-placeholder.d.ts +1 -3
  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 +0 -2
  9. package/dist/logics/bool/to-bool.js +1 -2
  10. package/dist/logics/bool/to-strbool.d.ts +0 -2
  11. package/dist/logics/bool/to-strbool.js +1 -2
  12. package/dist/logics/cc/cc-all.d.ts +1 -3
  13. package/dist/logics/cc/cc-all.js +1 -2
  14. package/dist/logics/cc/cc-all.js.map +1 -1
  15. package/dist/logics/cc/cc.d.ts +1 -3
  16. package/dist/logics/cc/cc.js +1 -2
  17. package/dist/logics/cc/cc.js.map +1 -1
  18. package/dist/logics/checkbox-control/checkbox-control.d.ts +4 -6
  19. package/dist/logics/checkbox-control/checkbox-control.js +2 -3
  20. package/dist/logics/checkbox-control/checkbox-control.js.map +1 -1
  21. package/dist/logics/dialog-control/dialog-control.d.ts +4 -6
  22. package/dist/logics/dialog-control/dialog-control.js +1 -2
  23. package/dist/logics/dialog-control/dialog-control.js.map +1 -1
  24. package/dist/logics/input-control/input-control.d.ts +2 -4
  25. package/dist/logics/input-control/input-control.js +1 -2
  26. package/dist/logics/input-control/input-control.js.map +1 -1
  27. package/dist/logics/label-marker/label-marker.d.ts +1 -3
  28. package/dist/logics/label-marker/label-marker.js +1 -2
  29. package/dist/logics/label-marker/label-marker.js.map +1 -1
  30. package/dist/logics/menu-control/menu-control.d.ts +4 -6
  31. package/dist/logics/menu-control/menu-control.js +1 -2
  32. package/dist/logics/menu-control/menu-control.js.map +1 -1
  33. package/dist/logics/ms/ms-all.d.ts +2 -3
  34. package/dist/logics/ms/ms-all.js +1 -2
  35. package/dist/logics/ms/ms-all.js.map +1 -1
  36. package/dist/logics/popover-control/popover-control.d.ts +2 -4
  37. package/dist/logics/popover-control/popover-control.js +1 -2
  38. package/dist/logics/popover-control/popover-control.js.map +1 -1
  39. package/dist/logics/progress-control/progress-control.d.ts +3 -5
  40. package/dist/logics/progress-control/progress-control.js +1 -2
  41. package/dist/logics/progress-control/progress-control.js.map +1 -1
  42. package/dist/logics/radio-control/radio-control.d.ts +3 -5
  43. package/dist/logics/radio-control/radio-control.js +1 -2
  44. package/dist/logics/radio-control/radio-control.js.map +1 -1
  45. package/dist/logics/radiogroup-control/radiogroup-control.d.ts +2 -4
  46. package/dist/logics/radiogroup-control/radiogroup-control.js +1 -2
  47. package/dist/logics/radiogroup-control/radiogroup-control.js.map +1 -1
  48. package/dist/logics/segmented-control/segmented-control.d.ts +1 -3
  49. package/dist/logics/segmented-control/segmented-control.js +1 -2
  50. package/dist/logics/segmented-control/segmented-control.js.map +1 -1
  51. package/dist/logics/tabs-control/tabs-control.d.ts +4 -6
  52. package/dist/logics/tabs-control/tabs-control.js +1 -2
  53. package/dist/logics/tabs-control/tabs-control.js.map +1 -1
  54. package/dist/logics/tabs-control/tabs-keymap.js +1 -2
  55. package/dist/logics/tabs-control/tabs-keymap.js.map +1 -1
  56. package/dist/logics/tooltip-control/tooltip-control.d.ts +2 -4
  57. package/dist/logics/tooltip-control/tooltip-control.js +1 -2
  58. package/dist/logics/tooltip-control/tooltip-control.js.map +1 -1
  59. package/dist/recipes/alert/alert.d.ts +2 -4
  60. package/dist/recipes/alert/alert.js +5 -4
  61. package/dist/recipes/alert/alert.js.map +1 -1
  62. package/dist/recipes/anchor/anchor.d.ts +0 -2
  63. package/dist/recipes/anchor/anchor.js +1 -2
  64. package/dist/recipes/avatar/avatar.d.ts +0 -2
  65. package/dist/recipes/avatar/avatar.js +1 -2
  66. package/dist/recipes/blockquote/blockquote.d.ts +0 -2
  67. package/dist/recipes/blockquote/blockquote.js +4 -3
  68. package/dist/recipes/blockquote/blockquote.js.map +1 -1
  69. package/dist/recipes/button/button.d.ts +6 -4
  70. package/dist/recipes/button/button.js +8 -5
  71. package/dist/recipes/button/button.js.map +1 -1
  72. package/dist/recipes/checkbox/checkbox.d.ts +2 -24
  73. package/dist/recipes/checkbox/checkbox.js +14 -20
  74. package/dist/recipes/checkbox/checkbox.js.map +1 -1
  75. package/dist/recipes/code/code.d.ts +0 -2
  76. package/dist/recipes/code/code.js +1 -2
  77. package/dist/recipes/container/container.d.ts +0 -2
  78. package/dist/recipes/container/container.js +1 -2
  79. package/dist/recipes/details/details.d.ts +3 -5
  80. package/dist/recipes/details/details.js +10 -6
  81. package/dist/recipes/details/details.js.map +1 -1
  82. package/dist/recipes/dialog/dialog.d.ts +3 -3
  83. package/dist/recipes/dialog/dialog.js +6 -3
  84. package/dist/recipes/dialog/dialog.js.map +1 -1
  85. package/dist/recipes/dl/dl.d.ts +0 -2
  86. package/dist/recipes/dl/dl.js +6 -3
  87. package/dist/recipes/dl/dl.js.map +1 -1
  88. package/dist/recipes/drawer/drawer.d.ts +0 -2
  89. package/dist/recipes/drawer/drawer.js +1 -2
  90. package/dist/recipes/fieldset/fieldset.d.ts +0 -2
  91. package/dist/recipes/fieldset/fieldset.js +4 -3
  92. package/dist/recipes/fieldset/fieldset.js.map +1 -1
  93. package/dist/recipes/focus-ring/focus-ring.d.ts +0 -2
  94. package/dist/recipes/focus-ring/focus-ring.js +1 -2
  95. package/dist/recipes/heading/heading.d.ts +0 -2
  96. package/dist/recipes/heading/heading.js +1 -2
  97. package/dist/recipes/hr/hr.d.ts +0 -2
  98. package/dist/recipes/hr/hr.js +4 -3
  99. package/dist/recipes/hr/hr.js.map +1 -1
  100. package/dist/recipes/input/input.d.ts +3 -5
  101. package/dist/recipes/input/input.js +6 -5
  102. package/dist/recipes/input/input.js.map +1 -1
  103. package/dist/recipes/label/label.d.ts +0 -2
  104. package/dist/recipes/label/label.js +1 -2
  105. package/dist/recipes/menu/menu.d.ts +0 -2
  106. package/dist/recipes/menu/menu.js +1 -2
  107. package/dist/recipes/paragraph/paragraph.d.ts +0 -2
  108. package/dist/recipes/paragraph/paragraph.js +1 -2
  109. package/dist/recipes/popover/popover.d.ts +0 -2
  110. package/dist/recipes/popover/popover.js +4 -3
  111. package/dist/recipes/popover/popover.js.map +1 -1
  112. package/dist/recipes/progress/progress.d.ts +0 -2
  113. package/dist/recipes/progress/progress.js +1 -2
  114. package/dist/recipes/radio/radio.d.ts +3 -5
  115. package/dist/recipes/radio/radio.js +7 -6
  116. package/dist/recipes/radio/radio.js.map +1 -1
  117. package/dist/recipes/radiogroup/radiogroup.d.ts +0 -2
  118. package/dist/recipes/radiogroup/radiogroup.js +1 -2
  119. package/dist/recipes/section/section.d.ts +3 -3
  120. package/dist/recipes/section/section.js +6 -3
  121. package/dist/recipes/section/section.js.map +1 -1
  122. package/dist/recipes/segmented-control/segmented-control.d.ts +0 -2
  123. package/dist/recipes/segmented-control/segmented-control.js +5 -3
  124. package/dist/recipes/segmented-control/segmented-control.js.map +1 -1
  125. package/dist/recipes/select/select.d.ts +2 -4
  126. package/dist/recipes/select/select.js +6 -5
  127. package/dist/recipes/select/select.js.map +1 -1
  128. package/dist/recipes/skip-link/skip-link.d.ts +6 -0
  129. package/dist/recipes/skip-link/skip-link.js +9 -0
  130. package/dist/recipes/skip-link/skip-link.js.map +1 -0
  131. package/dist/recipes/table/table.d.ts +6 -6
  132. package/dist/recipes/table/table.js +17 -7
  133. package/dist/recipes/table/table.js.map +1 -1
  134. package/dist/recipes/tabs/tabs.d.ts +0 -2
  135. package/dist/recipes/tabs/tabs.js +4 -3
  136. package/dist/recipes/tabs/tabs.js.map +1 -1
  137. package/dist/recipes/text/text.d.ts +53 -0
  138. package/dist/recipes/text/text.js +42 -0
  139. package/dist/recipes/text/text.js.map +1 -0
  140. package/dist/recipes/visually-hidden/visually-hidden.d.ts +0 -2
  141. package/dist/recipes/visually-hidden/visually-hidden.js +1 -2
  142. package/dist/style.css +1 -1
  143. package/dist/styles/css-vars.d.ts +0 -2
  144. package/dist/styles/css-vars.js +1 -2
  145. package/dist/styles/make-recipe-type.d.ts +0 -2
  146. package/dist/styles/make-recipe.d.ts +1 -3
  147. package/dist/styles/make-recipe.js +3 -4
  148. package/dist/styles/make-recipe.js.map +1 -1
  149. package/dist/styles/primitive-css/active.module.js +1 -2
  150. package/dist/styles/primitive-css/base.module.js +2 -2
  151. package/dist/styles/primitive-css/base.module.js.map +1 -1
  152. package/dist/styles/primitive-css/checked.module.js +5 -4
  153. package/dist/styles/primitive-css/checked.module.js.map +1 -1
  154. package/dist/styles/primitive-css/composite.module.js +1 -2
  155. package/dist/styles/primitive-css/disabled.module.js +1 -2
  156. package/dist/styles/primitive-css/focus.module.js +1 -2
  157. package/dist/styles/primitive-css/hover.module.js +3 -3
  158. package/dist/styles/primitive-css/hover.module.js.map +1 -1
  159. package/dist/styles/primitive-css/icon.module.js +2 -4
  160. package/dist/styles/primitive-css/icon.module.js.map +1 -1
  161. package/dist/styles/primitive-css/misc.module.js +3 -3
  162. package/dist/styles/primitive-css/misc.module.js.map +1 -1
  163. package/dist/styles/primitive-css/neutral.module.js +18 -12
  164. package/dist/styles/primitive-css/neutral.module.js.map +1 -1
  165. package/dist/styles/primitive-css/pseudo-element.module.js +1 -2
  166. package/dist/styles/primitive.gen.d.ts +48 -17
  167. package/dist/styles/primitive.gen.js +36 -18
  168. package/dist/styles/primitive.gen.js.map +1 -1
  169. package/package.json +2 -2
@@ -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,15 @@ 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;
18
17
  export declare const popoverControl: {
19
18
  readonly getTriggerAttributes: typeof getTriggerAttributes;
20
19
  readonly getContentAttributes: typeof getContentAttributes;
21
20
  };
22
- //#endregion
23
21
  export {};
24
22
  //# sourceMappingURL=popover-control.d.ts.map
@@ -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,
@@ -15,7 +15,6 @@ const popoverControl = {
15
15
  getTriggerAttributes,
16
16
  getContentAttributes
17
17
  };
18
- //#endregion
19
18
  export { popoverControl };
20
19
 
21
20
  //# 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\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,OAAyD;CACrF,OAAO;EACL,IAAI,MAAM;EACV,SAAS;CACX;AACF;AAEA,MAAa,iBAAiB;CAC5B;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,5 @@ export declare const progressControl: {
41
40
  readonly getBarAttributes: typeof getBarAttributes;
42
41
  readonly getValueAttributes: typeof getValueAttributes;
43
42
  };
44
- //#endregion
45
43
  export {};
46
44
  //# sourceMappingURL=progress-control.d.ts.map
@@ -1,4 +1,4 @@
1
- //#region src/logics/progress-control/progress-control.ts
1
+ // src/logics/progress-control/progress-control.ts
2
2
  const INDETERMINATE_BAR_WIDTH = "15%";
3
3
  function resolve(options) {
4
4
  const min = options.min ?? 0;
@@ -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 = \"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: 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,20 @@ 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
27
  export {};
30
28
  //# sourceMappingURL=radio-control.d.ts.map
@@ -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,15 @@ 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
22
  export {};
25
23
  //# sourceMappingURL=radiogroup-control.d.ts.map
@@ -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,4 +1,3 @@
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;
@@ -7,10 +6,9 @@ export interface SegmentedControlItemAttributes {
7
6
  type: "button" | undefined;
8
7
  "aria-pressed": 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
13
  export {};
16
14
  //# sourceMappingURL=segmented-control.d.ts.map
@@ -1,4 +1,4 @@
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,
@@ -6,7 +6,6 @@ function getItemAttributes(state, 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-pressed\": 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-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,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,5 @@ export declare const tabsControl: {
47
46
  readonly handleTabKeydown: typeof handleTabKeydown;
48
47
  readonly moveFocus: typeof moveFocus;
49
48
  };
50
- //#endregion
51
49
  export {};
52
50
  //# sourceMappingURL=tabs-control.d.ts.map
@@ -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,5 @@ export declare const tooltipControl: {
26
25
  readonly showTooltip: typeof showTooltip;
27
26
  readonly hideTooltip: typeof hideTooltip;
28
27
  };
29
- //#endregion
30
28
  export {};
31
29
  //# sourceMappingURL=tooltip-control.d.ts.map
@@ -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
3
  export declare const alertRecipe: Recipe<"icon" | "root" | "content" | "errorIcon" | "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
  };
@@ -61,5 +60,4 @@ export declare const alertRecipe: Recipe<"icon" | "root" | "content" | "errorIco
61
60
  }>;
62
61
  export type AlertVariants = RecipeVariants<typeof alertRecipe>;
63
62
  export type AlertSlots = RecipeSlots<typeof alertRecipe>;
64
- //#endregion
65
63
  //# sourceMappingURL=alert.d.ts.map
@@ -1,11 +1,13 @@
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
+ borderWidth: "base",
10
+ borderStyle: "solid",
9
11
  borderRadius: "base"
10
12
  },
11
13
  content: {
@@ -28,9 +30,9 @@ const alertRecipe = makeRecipe({
28
30
  variant: {
29
31
  light: { root: {
30
32
  bgColor: "base-alpha",
31
- border: "base-alpha-peak"
33
+ borderColor: "base-alpha-peak"
32
34
  } },
33
- outline: { root: { border: "base" } }
35
+ outline: { root: { borderColor: "base" } }
34
36
  },
35
37
  color: {
36
38
  accent: { root: { baseColor: "accent" } },
@@ -60,7 +62,6 @@ const alertRecipe = makeRecipe({
60
62
  padding: "md"
61
63
  }
62
64
  });
63
- //#endregion
64
65
  export { alertRecipe };
65
66
 
66
67
  //# 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 borderWidth: \"base\",\n borderStyle: \"solid\",\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 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,aAAa;GACb,aAAa;GACb,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,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"}
@@ -1,6 +1,5 @@
1
1
  import { Recipe } from "../../styles/make-recipe.js";
2
2
  import { RecipeSlots, RecipeVariants } from "../../styles/make-recipe-type.js";
3
- //#region src/recipes/anchor/anchor.d.ts
4
3
  export declare const anchorRecipe: Recipe<"root", {
5
4
  color: {
6
5
  accent: {
@@ -104,5 +103,4 @@ export declare const anchorRecipe: Recipe<"root", {
104
103
  }>;
105
104
  export type AnchorVariants = RecipeVariants<typeof anchorRecipe>;
106
105
  export type AnchorSlots = RecipeSlots<typeof anchorRecipe>;
107
- //#endregion
108
106
  //# sourceMappingURL=anchor.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { makeRecipe } from "../../styles/make-recipe.js";
2
- //#region src/recipes/anchor/anchor.ts
2
+ // src/recipes/anchor/anchor.ts
3
3
  const anchorRecipe = makeRecipe({
4
4
  base: { root: {
5
5
  reset: "true",
@@ -69,7 +69,6 @@ const anchorRecipe = makeRecipe({
69
69
  decoration: "underline"
70
70
  }
71
71
  });
72
- //#endregion
73
72
  export { anchorRecipe };
74
73
 
75
74
  //# sourceMappingURL=anchor.js.map
@@ -1,6 +1,5 @@
1
1
  import { Recipe } from "../../styles/make-recipe.js";
2
2
  import { RecipeSlots, RecipeVariants } from "../../styles/make-recipe-type.js";
3
- //#region src/recipes/avatar/avatar.d.ts
4
3
  export declare const avatartRecipe: Recipe<"root" | "img" | "placeholder", {
5
4
  background: {
6
5
  transparent: {
@@ -17,5 +16,4 @@ export declare const avatartRecipe: Recipe<"root" | "img" | "placeholder", {
17
16
  }>;
18
17
  export type AvatarVariants = RecipeVariants<typeof avatartRecipe>;
19
18
  export type AvatarSlots = RecipeSlots<typeof avatartRecipe>;
20
- //#endregion
21
19
  //# sourceMappingURL=avatar.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { makeRecipe } from "../../styles/make-recipe.js";
2
- //#region src/recipes/avatar/avatar.ts
2
+ // src/recipes/avatar/avatar.ts
3
3
  const avatartRecipe = makeRecipe({
4
4
  base: {
5
5
  root: {
@@ -25,7 +25,6 @@ const avatartRecipe = makeRecipe({
25
25
  } },
26
26
  defaultVariants: { background: "transparent" }
27
27
  });
28
- //#endregion
29
28
  export { avatartRecipe };
30
29
 
31
30
  //# sourceMappingURL=avatar.js.map
@@ -1,6 +1,5 @@
1
1
  import { Recipe } from "../../styles/make-recipe.js";
2
2
  import { RecipeSlots, RecipeVariants } from "../../styles/make-recipe-type.js";
3
- //#region src/recipes/blockquote/blockquote.d.ts
4
3
  export declare const blockquoteRecipe: Recipe<"root" | "blockquote" | "caption", {
5
4
  color: {
6
5
  accent: {
@@ -27,5 +26,4 @@ export declare const blockquoteRecipe: Recipe<"root" | "blockquote" | "caption",
27
26
  }>;
28
27
  export type BlockquoteVariants = RecipeVariants<typeof blockquoteRecipe>;
29
28
  export type BlockquoteSlots = RecipeSlots<typeof blockquoteRecipe>;
30
- //#endregion
31
29
  //# sourceMappingURL=blockquote.d.ts.map
@@ -1,11 +1,13 @@
1
1
  import { makeRecipe } from "../../styles/make-recipe.js";
2
- //#region src/recipes/blockquote/blockquote.ts
2
+ // src/recipes/blockquote/blockquote.ts
3
3
  const blockquoteRecipe = makeRecipe({
4
4
  base: {
5
5
  root: {
6
6
  reset: "true",
7
7
  baseBorderWidth: "3px",
8
- borderInlineStart: "base-bottom",
8
+ borderInlineStartWidth: "base",
9
+ borderStyle: "solid",
10
+ borderColor: "base-bottom",
9
11
  bgColor: "base-alpha",
10
12
  paddingBlock: "1x",
11
13
  paddingInline: "1.25x",
@@ -27,7 +29,6 @@ const blockquoteRecipe = makeRecipe({
27
29
  } },
28
30
  defaultVariants: { color: "neutral" }
29
31
  });
30
- //#endregion
31
32
  export { blockquoteRecipe };
32
33
 
33
34
  //# sourceMappingURL=blockquote.js.map