@hebium-ui/core 0.1.0-alpha.3 → 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 (147) hide show
  1. package/dist/index.d.ts +12 -2
  2. package/dist/index.js +15 -5
  3. package/dist/logics/avatar-placeholder/get-avatar-placeholder.d.ts +1 -2
  4. package/dist/logics/avatar-placeholder/should-show-avatar-placeholder.d.ts +1 -2
  5. package/dist/logics/bool/to-bool.d.ts +1 -2
  6. package/dist/logics/bool/to-strbool.d.ts +1 -2
  7. package/dist/logics/button-control/button-control.d.ts +16 -0
  8. package/dist/logics/button-control/button-control.js +26 -0
  9. package/dist/logics/button-control/button-control.js.map +1 -0
  10. package/dist/logics/cc/cc-all.d.ts +1 -2
  11. package/dist/logics/cc/cc.d.ts +1 -2
  12. package/dist/logics/checkbox-control/checkbox-control.d.ts +1 -2
  13. package/dist/logics/combobox-control/combobox-control.d.ts +100 -0
  14. package/dist/logics/combobox-control/combobox-control.js +100 -0
  15. package/dist/logics/combobox-control/combobox-control.js.map +1 -0
  16. package/dist/logics/combobox-control/combobox-filter.d.ts +13 -0
  17. package/dist/logics/combobox-control/combobox-filter.js +11 -0
  18. package/dist/logics/combobox-control/combobox-filter.js.map +1 -0
  19. package/dist/logics/combobox-control/combobox-navigation.d.ts +2 -0
  20. package/dist/logics/combobox-control/combobox-navigation.js +10 -0
  21. package/dist/logics/combobox-control/combobox-navigation.js.map +1 -0
  22. package/dist/logics/dialog-control/dialog-control.d.ts +1 -2
  23. package/dist/logics/input-control/input-control.d.ts +1 -2
  24. package/dist/logics/label-marker/label-marker.d.ts +1 -2
  25. package/dist/logics/menu-control/menu-control.d.ts +1 -2
  26. package/dist/logics/menu-control/menu-control.js.map +1 -1
  27. package/dist/logics/ms/ms-all.d.ts +1 -2
  28. package/dist/logics/multi-combobox-control/multi-combobox-control.d.ts +58 -0
  29. package/dist/logics/multi-combobox-control/multi-combobox-control.js +76 -0
  30. package/dist/logics/multi-combobox-control/multi-combobox-control.js.map +1 -0
  31. package/dist/logics/multi-combobox-control/multi-combobox-focus.d.ts +15 -0
  32. package/dist/logics/multi-combobox-control/multi-combobox-focus.js +46 -0
  33. package/dist/logics/multi-combobox-control/multi-combobox-focus.js.map +1 -0
  34. package/dist/logics/popover-control/popover-control.d.ts +3 -2
  35. package/dist/logics/popover-control/popover-control.js +5 -1
  36. package/dist/logics/popover-control/popover-control.js.map +1 -1
  37. package/dist/logics/progress-control/progress-control.d.ts +1 -2
  38. package/dist/logics/progress-control/progress-control.js +1 -1
  39. package/dist/logics/progress-control/progress-control.js.map +1 -1
  40. package/dist/logics/radio-control/radio-control.d.ts +1 -2
  41. package/dist/logics/radiogroup-control/radiogroup-control.d.ts +1 -2
  42. package/dist/logics/segmented-control/segmented-control.d.ts +2 -3
  43. package/dist/logics/segmented-control/segmented-control.js +1 -1
  44. package/dist/logics/segmented-control/segmented-control.js.map +1 -1
  45. package/dist/logics/tabs-control/tabs-control.d.ts +1 -2
  46. package/dist/logics/tooltip-control/tooltip-control.d.ts +1 -2
  47. package/dist/recipes/alert/alert.d.ts +2 -3
  48. package/dist/recipes/alert/alert.js +1 -5
  49. package/dist/recipes/alert/alert.js.map +1 -1
  50. package/dist/recipes/anchor/anchor.d.ts +1 -2
  51. package/dist/recipes/avatar/avatar.d.ts +1 -2
  52. package/dist/recipes/blockquote/blockquote.d.ts +1 -2
  53. package/dist/recipes/button/button.d.ts +10 -3
  54. package/dist/recipes/button/button.js +32 -12
  55. package/dist/recipes/button/button.js.map +1 -1
  56. package/dist/recipes/checkbox/checkbox.d.ts +2 -3
  57. package/dist/recipes/code/code.d.ts +1 -2
  58. package/dist/recipes/combobox/combobox.d.ts +8 -0
  59. package/dist/recipes/combobox/combobox.js +34 -0
  60. package/dist/recipes/combobox/combobox.js.map +1 -0
  61. package/dist/recipes/container/container.d.ts +1 -2
  62. package/dist/recipes/details/details.d.ts +1 -2
  63. package/dist/recipes/dialog/dialog.d.ts +1 -2
  64. package/dist/recipes/dl/dl.d.ts +1 -2
  65. package/dist/recipes/drawer/drawer.d.ts +1 -2
  66. package/dist/recipes/fieldset/fieldset.d.ts +1 -2
  67. package/dist/recipes/focus-ring/focus-ring.d.ts +1 -2
  68. package/dist/recipes/heading/heading.d.ts +1 -2
  69. package/dist/recipes/hr/hr.d.ts +1 -2
  70. package/dist/recipes/inline-feedback/inline-feedback.d.ts +50 -0
  71. package/dist/recipes/inline-feedback/inline-feedback.js +45 -0
  72. package/dist/recipes/inline-feedback/inline-feedback.js.map +1 -0
  73. package/dist/recipes/input/input.d.ts +1 -2
  74. package/dist/recipes/label/label.d.ts +2 -3
  75. package/dist/recipes/label/label.js +1 -0
  76. package/dist/recipes/label/label.js.map +1 -1
  77. package/dist/recipes/menu/menu.d.ts +1 -2
  78. package/dist/recipes/menu/menu.js +4 -1
  79. package/dist/recipes/menu/menu.js.map +1 -1
  80. package/dist/recipes/multi-combobox/multi-combobox.d.ts +8 -0
  81. package/dist/recipes/multi-combobox/multi-combobox.js +52 -0
  82. package/dist/recipes/multi-combobox/multi-combobox.js.map +1 -0
  83. package/dist/recipes/paragraph/paragraph.d.ts +1 -2
  84. package/dist/recipes/popover/popover.d.ts +1 -2
  85. package/dist/recipes/popover/popover.js +0 -1
  86. package/dist/recipes/popover/popover.js.map +1 -1
  87. package/dist/recipes/progress/progress.d.ts +2 -3
  88. package/dist/recipes/radio/radio.d.ts +2 -3
  89. package/dist/recipes/radiogroup/radiogroup.d.ts +1 -2
  90. package/dist/recipes/section/section.d.ts +1 -2
  91. package/dist/recipes/segmented-control/segmented-control.d.ts +1 -2
  92. package/dist/recipes/segmented-control/segmented-control.js +6 -3
  93. package/dist/recipes/segmented-control/segmented-control.js.map +1 -1
  94. package/dist/recipes/select/select.d.ts +1 -2
  95. package/dist/recipes/skip-link/skip-link.d.ts +1 -2
  96. package/dist/recipes/status-icon/status-icon.d.ts +55 -0
  97. package/dist/recipes/status-icon/status-icon.js +39 -0
  98. package/dist/recipes/status-icon/status-icon.js.map +1 -0
  99. package/dist/recipes/table/table.d.ts +1 -2
  100. package/dist/recipes/tabs/tabs.d.ts +1 -2
  101. package/dist/recipes/tag/tag.d.ts +64 -0
  102. package/dist/recipes/tag/tag.js +86 -0
  103. package/dist/recipes/tag/tag.js.map +1 -0
  104. package/dist/recipes/text/text.d.ts +1 -2
  105. package/dist/recipes/visually-hidden/visually-hidden.d.ts +1 -2
  106. package/dist/style.css +1 -1
  107. package/dist/styles/css-vars.d.ts +1 -2
  108. package/dist/styles/make-recipe-type.d.ts +1 -2
  109. package/dist/styles/make-recipe.d.ts +1 -2
  110. package/dist/styles/primitive-css/{active.module.js → active.module.css.js} +1 -1
  111. package/dist/styles/primitive-css/active.module.css.js.map +1 -0
  112. package/dist/styles/primitive-css/{base.module.js → base.module.css.js} +1 -1
  113. package/dist/styles/primitive-css/base.module.css.js.map +1 -0
  114. package/dist/styles/primitive-css/{checked.module.js → checked.module.css.js} +1 -1
  115. package/dist/styles/primitive-css/checked.module.css.js.map +1 -0
  116. package/dist/styles/primitive-css/composite.module.css.js +5 -0
  117. package/dist/styles/primitive-css/composite.module.css.js.map +1 -0
  118. package/dist/styles/primitive-css/{disabled.module.js → disabled.module.css.js} +1 -1
  119. package/dist/styles/primitive-css/disabled.module.css.js.map +1 -0
  120. package/dist/styles/primitive-css/{focus.module.js → focus.module.css.js} +3 -2
  121. package/dist/styles/primitive-css/focus.module.css.js.map +1 -0
  122. package/dist/styles/primitive-css/{hover.module.js → hover.module.css.js} +1 -1
  123. package/dist/styles/primitive-css/hover.module.css.js.map +1 -0
  124. package/dist/styles/primitive-css/{icon.module.js → icon.module.css.js} +6 -2
  125. package/dist/styles/primitive-css/icon.module.css.js.map +1 -0
  126. package/dist/styles/primitive-css/{misc.module.js → misc.module.css.js} +5 -4
  127. package/dist/styles/primitive-css/misc.module.css.js.map +1 -0
  128. package/dist/styles/primitive-css/{neutral.module.js → neutral.module.css.js} +11 -1
  129. package/dist/styles/primitive-css/neutral.module.css.js.map +1 -0
  130. package/dist/styles/primitive-css/{pseudo-element.module.js → pseudo-element.module.css.js} +1 -1
  131. package/dist/styles/primitive-css/pseudo-element.module.css.js.map +1 -0
  132. package/dist/styles/primitive.gen.d.ts +32 -4
  133. package/dist/styles/primitive.gen.js +42 -21
  134. package/dist/styles/primitive.gen.js.map +1 -1
  135. package/package.json +5 -5
  136. package/dist/styles/primitive-css/active.module.js.map +0 -1
  137. package/dist/styles/primitive-css/base.module.js.map +0 -1
  138. package/dist/styles/primitive-css/checked.module.js.map +0 -1
  139. package/dist/styles/primitive-css/composite.module.js +0 -5
  140. package/dist/styles/primitive-css/composite.module.js.map +0 -1
  141. package/dist/styles/primitive-css/disabled.module.js.map +0 -1
  142. package/dist/styles/primitive-css/focus.module.js.map +0 -1
  143. package/dist/styles/primitive-css/hover.module.js.map +0 -1
  144. package/dist/styles/primitive-css/icon.module.js.map +0 -1
  145. package/dist/styles/primitive-css/misc.module.js.map +0 -1
  146. package/dist/styles/primitive-css/neutral.module.js.map +0 -1
  147. package/dist/styles/primitive-css/pseudo-element.module.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -2,9 +2,13 @@ import { getAvatarPlaceholder } from "./logics/avatar-placeholder/get-avatar-pla
2
2
  import { AvatarSource, shouldShowAvatarPlaceholder } from "./logics/avatar-placeholder/should-show-avatar-placeholder.js";
3
3
  import { toBool } from "./logics/bool/to-bool.js";
4
4
  import { Strbool, toStrbool } from "./logics/bool/to-strbool.js";
5
+ import { ButtonRootAttributes, ButtonStatusAttributes, buttonControl } from "./logics/button-control/button-control.js";
5
6
  import { cc } from "./logics/cc/cc.js";
6
7
  import { ccAll } from "./logics/cc/cc-all.js";
7
8
  import { CheckboxControlAttributes, CheckboxErrorAttributes, CheckboxLabelAttributes, CheckboxState, checkboxControl } from "./logics/checkbox-control/checkbox-control.js";
9
+ import { ComboboxMode, ComboboxSelectOption, ComboboxTextOption, filterComboboxOptions, getComboboxOptionText } from "./logics/combobox-control/combobox-filter.js";
10
+ import { ComboboxFormValueOptions, ComboboxFormValueProps, ComboboxInputAttributeState, ComboboxInputAttributes, ComboboxItemAttributes, ComboboxKeyAction, ComboboxKeyEvent, ComboboxKeyState, ComboboxListAttributes, ComboboxState, ComboboxValidationState, comboboxControl } from "./logics/combobox-control/combobox-control.js";
11
+ import { moveComboboxActiveValue } from "./logics/combobox-control/combobox-navigation.js";
8
12
  import { DialogCloseAttributes, DialogContentAttributeOptions, DialogContentAttributes, DialogHeadingAttributes, DialogState, DialogTriggerAttributeOptions, DialogTriggerAttributes, dialogControl } from "./logics/dialog-control/dialog-control.js";
9
13
  import { AlertSlots, AlertVariants, alertRecipe } from "./recipes/alert/alert.js";
10
14
  import { AnchorSlots, AnchorVariants, anchorRecipe } from "./recipes/anchor/anchor.js";
@@ -13,6 +17,8 @@ import { BlockquoteSlots, BlockquoteVariants, blockquoteRecipe } from "./recipes
13
17
  import { ButtonSlots, ButtonVariants, buttonRecipe } from "./recipes/button/button.js";
14
18
  import { CheckboxSlots, CheckboxVariants, checkboxRecipe } from "./recipes/checkbox/checkbox.js";
15
19
  import { CodeSlots, CodeVariants, codeRecipe } from "./recipes/code/code.js";
20
+ import { InputSlots, InputVariants, inputRecipe } from "./recipes/input/input.js";
21
+ import { ComboboxSlots, ComboboxVariants, comboboxRecipe } from "./recipes/combobox/combobox.js";
16
22
  import { ContainerSlots, ContainerVariants, containerRecipe } from "./recipes/container/container.js";
17
23
  import { DetailsSlots, DetailsVariants, detailsRecipe } from "./recipes/details/details.js";
18
24
  import { DialogSlots, DialogVariants, dialogRecipe } from "./recipes/dialog/dialog.js";
@@ -22,9 +28,10 @@ import { FieldsetSlots, FieldsetVariants, fieldsetRecipe } from "./recipes/field
22
28
  import { FocusRingSlots, FocusRingVariants, focusRingRecipe } from "./recipes/focus-ring/focus-ring.js";
23
29
  import { HeadingSlots, HeadingVariants, headingRecipe } from "./recipes/heading/heading.js";
24
30
  import { HrSlots, HrVariants, hrRecipe } from "./recipes/hr/hr.js";
25
- import { InputSlots, InputVariants, inputRecipe } from "./recipes/input/input.js";
31
+ import { InlineFeedbackSlots, InlineFeedbackVariants, inlineFeedbackRecipe } from "./recipes/inline-feedback/inline-feedback.js";
26
32
  import { LabelSlots, LabelVariants, labelRecipe } from "./recipes/label/label.js";
27
33
  import { MenuitemSlots, MenuitemVariants, menuitemRecipe } from "./recipes/menu/menu.js";
34
+ import { MultiComboboxSlots, MultiComboboxVariants, multiComboboxRecipe } from "./recipes/multi-combobox/multi-combobox.js";
28
35
  import { ParagraphSlots, ParagraphVariants, paragraphRecipe } from "./recipes/paragraph/paragraph.js";
29
36
  import { PopoverSlots, PopoverVariants, popoverRecipe } from "./recipes/popover/popover.js";
30
37
  import { ProgressSlots, ProgressVariants, progressRecipe } from "./recipes/progress/progress.js";
@@ -34,14 +41,17 @@ import { SectionSlots, SectionVariants, sectionRecipe } from "./recipes/section/
34
41
  import { SegmentedControlItemSlots, SegmentedControlItemVariants, SegmentedControlRootSlots, SegmentedControlRootVariants, segmentedControlItemRecipe, segmentedControlRootRecipe } from "./recipes/segmented-control/segmented-control.js";
35
42
  import { SelectSlots, SelectVariants, selectRecipe } from "./recipes/select/select.js";
36
43
  import { SkipLinkSlots, SkipLinkVariants, skipLinkRecipe } from "./recipes/skip-link/skip-link.js";
44
+ import { StatusIconSlots, StatusIconVariants, statusIconRecipe } from "./recipes/status-icon/status-icon.js";
37
45
  import { CaptionSlots, CaptionVariants, TableSlots, TableVariants, TdSlots, TdVariants, ThSlots, ThVariants, TrSlots, TrVariants, captionRecipe, tableRecipe, tdRecipe, thRecipe, trRecipe } from "./recipes/table/table.js";
38
46
  import { TabSlots, TabVariants, TablistSlots, TablistVariants, TabpanelSlots, TabpanelVariants, TabrootSlots, TabrootVariants, tabRecipe, tablistRecipe, tabpanelRecipe, tabrootRecipe } from "./recipes/tabs/tabs.js";
47
+ import { TagSlots, TagVariants, tagRecipe } from "./recipes/tag/tag.js";
39
48
  import { TextSlots, TextVariants, textRecipe } from "./recipes/text/text.js";
40
49
  import { VisuallyHiddenSlots, VisuallyHiddenVariants, visuallyHiddenRecipe } from "./recipes/visually-hidden/visually-hidden.js";
41
50
  import { InputControlAttributes, InputControlState, InputLabelAttributes, InputState, inputControl } from "./logics/input-control/input-control.js";
42
51
  import { DEFAULT_LABEL_MAKER, LabelMarker, LabelMarkerData, LabelMarkerNodeData, LabelMarkerNullData, labelMarker } from "./logics/label-marker/label-marker.js";
43
52
  import { MenuContentAttributeOptions, MenuContentAttributes, MenuItemActivation, MenuItemActivationOptions, MenuItemAttributeOptions, MenuItemAttributes, MenuState, MenuTriggerAttributeOptions, MenuTriggerAttributes, menuControl } from "./logics/menu-control/menu-control.js";
44
53
  import { msAll } from "./logics/ms/ms-all.js";
54
+ import { MultiComboboxFormValueProps, MultiComboboxItemState, MultiComboboxKeyAction, MultiComboboxState, multiComboboxControl } from "./logics/multi-combobox-control/multi-combobox-control.js";
45
55
  import { PopoverContentAttributes, PopoverState, PopoverTriggerAttributeOptions, PopoverTriggerAttributes, popoverControl } from "./logics/popover-control/popover-control.js";
46
56
  import { ProgressBarAttributes, ProgressLabelAttributes, ProgressResolveOptions, ProgressState, ProgressValueAttributes, progressControl } from "./logics/progress-control/progress-control.js";
47
57
  import { RadioControlAttributes, RadioErrorAttributes, RadioLabelAttributes, RadioState, radioControl } from "./logics/radio-control/radio-control.js";
@@ -50,4 +60,4 @@ import { SegmentedControlItemAttributes, SegmentedControlItemState, segmentedCon
50
60
  import { TabsListAttributeOptions, TabsListAttributes, TabsPanelAttributes, TabsRootAttributes, TabsState, TabsTabAttributeOptions, TabsTabAttributes, tabsControl } from "./logics/tabs-control/tabs-control.js";
51
61
  import { TooltipContentAttributes, TooltipState, TooltipTriggerAttributeOptions, TooltipTriggerAttributes, tooltipControl, triggerId } from "./logics/tooltip-control/tooltip-control.js";
52
62
  import { CSS_VARS } from "./styles/css-vars.js";
53
- export { AlertSlots, AlertVariants, AnchorSlots, AnchorVariants, AvatarSlots, AvatarSource, AvatarVariants, BlockquoteSlots, BlockquoteVariants, ButtonSlots, ButtonVariants, CSS_VARS, CaptionSlots, CaptionVariants, CheckboxControlAttributes, CheckboxErrorAttributes, CheckboxLabelAttributes, CheckboxSlots, CheckboxState, CheckboxVariants, CodeSlots, CodeVariants, ContainerSlots, ContainerVariants, DEFAULT_LABEL_MAKER, DdSlots, DdVariants, DetailsSlots, DetailsVariants, DialogCloseAttributes, DialogContentAttributeOptions, DialogContentAttributes, DialogHeadingAttributes, DialogSlots, DialogState, DialogTriggerAttributeOptions, DialogTriggerAttributes, DialogVariants, DlSlots, DlVariants, DrawerSlots, DrawerVariants, DtSlots, DtVariants, FieldsetSlots, FieldsetVariants, FocusRingSlots, FocusRingVariants, HeadingSlots, HeadingVariants, HrSlots, HrVariants, InputControlAttributes, InputControlState, InputLabelAttributes, InputSlots, InputState, InputVariants, LabelMarker, LabelMarkerData, LabelMarkerNodeData, LabelMarkerNullData, LabelSlots, LabelVariants, MenuContentAttributeOptions, MenuContentAttributes, MenuItemActivation, MenuItemActivationOptions, MenuItemAttributeOptions, MenuItemAttributes, MenuState, MenuTriggerAttributeOptions, MenuTriggerAttributes, MenuitemSlots, MenuitemVariants, ParagraphSlots, ParagraphVariants, PopoverContentAttributes, PopoverSlots, PopoverState, PopoverTriggerAttributeOptions, PopoverTriggerAttributes, PopoverVariants, ProgressBarAttributes, ProgressLabelAttributes, ProgressResolveOptions, ProgressSlots, ProgressState, ProgressValueAttributes, ProgressVariants, RadioControlAttributes, RadioErrorAttributes, RadioLabelAttributes, RadioSlots, RadioState, RadioVariants, RadiogroupLabelAttributes, RadiogroupRootAttributes, RadiogroupSlots, RadiogroupState, RadiogroupVariants, SectionSlots, SectionVariants, SegmentedControlItemAttributes, SegmentedControlItemSlots, SegmentedControlItemState, SegmentedControlItemVariants, SegmentedControlRootSlots, SegmentedControlRootVariants, SelectSlots, SelectVariants, SkipLinkSlots, SkipLinkVariants, Strbool, TabSlots, TabVariants, TableSlots, TableVariants, TablistSlots, TablistVariants, TabpanelSlots, TabpanelVariants, TabrootSlots, TabrootVariants, TabsListAttributeOptions, TabsListAttributes, TabsPanelAttributes, TabsRootAttributes, TabsState, TabsTabAttributeOptions, TabsTabAttributes, TdSlots, TdVariants, TextSlots, TextVariants, ThSlots, ThVariants, TooltipContentAttributes, TooltipState, TooltipTriggerAttributeOptions, TooltipTriggerAttributes, TrSlots, TrVariants, VisuallyHiddenSlots, VisuallyHiddenVariants, alertRecipe, anchorRecipe, avatartRecipe, blockquoteRecipe, buttonRecipe, captionRecipe, cc, ccAll, checkboxControl, checkboxRecipe, codeRecipe, containerRecipe, ddRecipe, detailsRecipe, dialogControl, dialogRecipe, dlRecipe, drawerRecipe, dtRecipe, fieldsetRecipe, focusRingRecipe, getAvatarPlaceholder, headingRecipe, hrRecipe, inputControl, inputRecipe, labelMarker, labelRecipe, menuControl, menuitemRecipe, msAll, paragraphRecipe, popoverControl, popoverRecipe, progressControl, progressRecipe, radioControl, radioRecipe, radiogroupControl, radiogroupRecipe, sectionRecipe, segmentedControl, segmentedControlItemRecipe, segmentedControlRootRecipe, selectRecipe, shouldShowAvatarPlaceholder, skipLinkRecipe, tabRecipe, tableRecipe, tablistRecipe, tabpanelRecipe, tabrootRecipe, tabsControl, tdRecipe, textRecipe, thRecipe, toBool, toStrbool, tooltipControl, trRecipe, triggerId, visuallyHiddenRecipe };
63
+ export { AlertSlots, AlertVariants, AnchorSlots, AnchorVariants, AvatarSlots, AvatarSource, AvatarVariants, BlockquoteSlots, BlockquoteVariants, ButtonRootAttributes, ButtonSlots, ButtonStatusAttributes, ButtonVariants, CSS_VARS, CaptionSlots, CaptionVariants, CheckboxControlAttributes, CheckboxErrorAttributes, CheckboxLabelAttributes, CheckboxSlots, CheckboxState, CheckboxVariants, CodeSlots, CodeVariants, ComboboxFormValueOptions, ComboboxFormValueProps, ComboboxInputAttributeState, ComboboxInputAttributes, ComboboxItemAttributes, ComboboxKeyAction, ComboboxKeyEvent, ComboboxKeyState, ComboboxListAttributes, ComboboxMode, ComboboxSelectOption, ComboboxSlots, ComboboxState, ComboboxTextOption, ComboboxValidationState, ComboboxVariants, ContainerSlots, ContainerVariants, DEFAULT_LABEL_MAKER, DdSlots, DdVariants, DetailsSlots, DetailsVariants, DialogCloseAttributes, DialogContentAttributeOptions, DialogContentAttributes, DialogHeadingAttributes, DialogSlots, DialogState, DialogTriggerAttributeOptions, DialogTriggerAttributes, DialogVariants, DlSlots, DlVariants, DrawerSlots, DrawerVariants, DtSlots, DtVariants, FieldsetSlots, FieldsetVariants, FocusRingSlots, FocusRingVariants, HeadingSlots, HeadingVariants, HrSlots, HrVariants, InlineFeedbackSlots, InlineFeedbackVariants, InputControlAttributes, InputControlState, InputLabelAttributes, InputSlots, InputState, InputVariants, LabelMarker, LabelMarkerData, LabelMarkerNodeData, LabelMarkerNullData, LabelSlots, LabelVariants, MenuContentAttributeOptions, MenuContentAttributes, MenuItemActivation, MenuItemActivationOptions, MenuItemAttributeOptions, MenuItemAttributes, MenuState, MenuTriggerAttributeOptions, MenuTriggerAttributes, MenuitemSlots, MenuitemVariants, MultiComboboxFormValueProps, MultiComboboxItemState, MultiComboboxKeyAction, MultiComboboxSlots, MultiComboboxState, MultiComboboxVariants, ParagraphSlots, ParagraphVariants, PopoverContentAttributes, PopoverSlots, PopoverState, PopoverTriggerAttributeOptions, PopoverTriggerAttributes, PopoverVariants, ProgressBarAttributes, ProgressLabelAttributes, ProgressResolveOptions, ProgressSlots, ProgressState, ProgressValueAttributes, ProgressVariants, RadioControlAttributes, RadioErrorAttributes, RadioLabelAttributes, RadioSlots, RadioState, RadioVariants, RadiogroupLabelAttributes, RadiogroupRootAttributes, RadiogroupSlots, RadiogroupState, RadiogroupVariants, SectionSlots, SectionVariants, SegmentedControlItemAttributes, SegmentedControlItemSlots, SegmentedControlItemState, SegmentedControlItemVariants, SegmentedControlRootSlots, SegmentedControlRootVariants, SelectSlots, SelectVariants, SkipLinkSlots, SkipLinkVariants, StatusIconSlots, StatusIconVariants, Strbool, TabSlots, TabVariants, TableSlots, TableVariants, TablistSlots, TablistVariants, TabpanelSlots, TabpanelVariants, TabrootSlots, TabrootVariants, TabsListAttributeOptions, TabsListAttributes, TabsPanelAttributes, TabsRootAttributes, TabsState, TabsTabAttributeOptions, TabsTabAttributes, TagSlots, TagVariants, TdSlots, TdVariants, TextSlots, TextVariants, ThSlots, ThVariants, TooltipContentAttributes, TooltipState, TooltipTriggerAttributeOptions, TooltipTriggerAttributes, TrSlots, TrVariants, VisuallyHiddenSlots, VisuallyHiddenVariants, alertRecipe, anchorRecipe, avatartRecipe, blockquoteRecipe, buttonControl, buttonRecipe, captionRecipe, cc, ccAll, checkboxControl, checkboxRecipe, codeRecipe, comboboxControl, comboboxRecipe, containerRecipe, ddRecipe, detailsRecipe, dialogControl, dialogRecipe, dlRecipe, drawerRecipe, dtRecipe, fieldsetRecipe, filterComboboxOptions, focusRingRecipe, getAvatarPlaceholder, getComboboxOptionText, headingRecipe, hrRecipe, inlineFeedbackRecipe, inputControl, inputRecipe, labelMarker, labelRecipe, menuControl, menuitemRecipe, moveComboboxActiveValue, msAll, multiComboboxControl, multiComboboxRecipe, paragraphRecipe, popoverControl, popoverRecipe, progressControl, progressRecipe, radioControl, radioRecipe, radiogroupControl, radiogroupRecipe, sectionRecipe, segmentedControl, segmentedControlItemRecipe, segmentedControlRootRecipe, selectRecipe, shouldShowAvatarPlaceholder, skipLinkRecipe, statusIconRecipe, tabRecipe, tableRecipe, tablistRecipe, tabpanelRecipe, tabrootRecipe, tabsControl, tagRecipe, tdRecipe, textRecipe, thRecipe, toBool, toStrbool, tooltipControl, trRecipe, triggerId, visuallyHiddenRecipe };
package/dist/index.js CHANGED
@@ -2,15 +2,20 @@ import { getAvatarPlaceholder } from "./logics/avatar-placeholder/get-avatar-pla
2
2
  import { shouldShowAvatarPlaceholder } from "./logics/avatar-placeholder/should-show-avatar-placeholder.js";
3
3
  import { toBool } from "./logics/bool/to-bool.js";
4
4
  import { toStrbool } from "./logics/bool/to-strbool.js";
5
+ import { buttonControl } from "./logics/button-control/button-control.js";
5
6
  import { cc } from "./logics/cc/cc.js";
6
7
  import { ccAll } from "./logics/cc/cc-all.js";
7
8
  import { inputControl } from "./logics/input-control/input-control.js";
8
9
  import { checkboxControl } from "./logics/checkbox-control/checkbox-control.js";
10
+ import { popoverControl } from "./logics/popover-control/popover-control.js";
11
+ import { filterComboboxOptions, getComboboxOptionText } from "./logics/combobox-control/combobox-filter.js";
12
+ import { comboboxControl } from "./logics/combobox-control/combobox-control.js";
13
+ import { moveComboboxActiveValue } from "./logics/combobox-control/combobox-navigation.js";
9
14
  import { dialogControl } from "./logics/dialog-control/dialog-control.js";
10
15
  import { DEFAULT_LABEL_MAKER, labelMarker } from "./logics/label-marker/label-marker.js";
11
- import { popoverControl } from "./logics/popover-control/popover-control.js";
12
16
  import { menuControl } from "./logics/menu-control/menu-control.js";
13
17
  import { msAll } from "./logics/ms/ms-all.js";
18
+ import { multiComboboxControl } from "./logics/multi-combobox-control/multi-combobox-control.js";
14
19
  import { progressControl } from "./logics/progress-control/progress-control.js";
15
20
  import { radioControl } from "./logics/radio-control/radio-control.js";
16
21
  import { radiogroupControl } from "./logics/radiogroup-control/radiogroup-control.js";
@@ -24,6 +29,10 @@ import { blockquoteRecipe } from "./recipes/blockquote/blockquote.js";
24
29
  import { buttonRecipe } from "./recipes/button/button.js";
25
30
  import { checkboxRecipe } from "./recipes/checkbox/checkbox.js";
26
31
  import { codeRecipe } from "./recipes/code/code.js";
32
+ import { inputRecipe } from "./recipes/input/input.js";
33
+ import { menuitemRecipe } from "./recipes/menu/menu.js";
34
+ import { popoverRecipe } from "./recipes/popover/popover.js";
35
+ import { comboboxRecipe } from "./recipes/combobox/combobox.js";
27
36
  import { containerRecipe } from "./recipes/container/container.js";
28
37
  import { detailsRecipe } from "./recipes/details/details.js";
29
38
  import { dialogRecipe } from "./recipes/dialog/dialog.js";
@@ -33,11 +42,10 @@ import { fieldsetRecipe } from "./recipes/fieldset/fieldset.js";
33
42
  import { focusRingRecipe } from "./recipes/focus-ring/focus-ring.js";
34
43
  import { headingRecipe } from "./recipes/heading/heading.js";
35
44
  import { hrRecipe } from "./recipes/hr/hr.js";
36
- import { inputRecipe } from "./recipes/input/input.js";
45
+ import { inlineFeedbackRecipe } from "./recipes/inline-feedback/inline-feedback.js";
37
46
  import { labelRecipe } from "./recipes/label/label.js";
38
- import { menuitemRecipe } from "./recipes/menu/menu.js";
47
+ import { multiComboboxRecipe } from "./recipes/multi-combobox/multi-combobox.js";
39
48
  import { paragraphRecipe } from "./recipes/paragraph/paragraph.js";
40
- import { popoverRecipe } from "./recipes/popover/popover.js";
41
49
  import { progressRecipe } from "./recipes/progress/progress.js";
42
50
  import { radioRecipe } from "./recipes/radio/radio.js";
43
51
  import { radiogroupRecipe } from "./recipes/radiogroup/radiogroup.js";
@@ -45,9 +53,11 @@ import { sectionRecipe } from "./recipes/section/section.js";
45
53
  import { segmentedControlItemRecipe, segmentedControlRootRecipe } from "./recipes/segmented-control/segmented-control.js";
46
54
  import { selectRecipe } from "./recipes/select/select.js";
47
55
  import { skipLinkRecipe } from "./recipes/skip-link/skip-link.js";
56
+ import { statusIconRecipe } from "./recipes/status-icon/status-icon.js";
48
57
  import { captionRecipe, tableRecipe, tdRecipe, thRecipe, trRecipe } from "./recipes/table/table.js";
49
58
  import { tabRecipe, tablistRecipe, tabpanelRecipe, tabrootRecipe } from "./recipes/tabs/tabs.js";
59
+ import { tagRecipe } from "./recipes/tag/tag.js";
50
60
  import { textRecipe } from "./recipes/text/text.js";
51
61
  import { visuallyHiddenRecipe } from "./recipes/visually-hidden/visually-hidden.js";
52
62
  import { CSS_VARS } from "./styles/css-vars.js";
53
- export { CSS_VARS, DEFAULT_LABEL_MAKER, alertRecipe, anchorRecipe, avatartRecipe, blockquoteRecipe, buttonRecipe, captionRecipe, cc, ccAll, checkboxControl, checkboxRecipe, codeRecipe, containerRecipe, ddRecipe, detailsRecipe, dialogControl, dialogRecipe, dlRecipe, drawerRecipe, dtRecipe, fieldsetRecipe, focusRingRecipe, getAvatarPlaceholder, headingRecipe, hrRecipe, inputControl, inputRecipe, labelMarker, labelRecipe, menuControl, menuitemRecipe, msAll, paragraphRecipe, popoverControl, popoverRecipe, progressControl, progressRecipe, radioControl, radioRecipe, radiogroupControl, radiogroupRecipe, sectionRecipe, segmentedControl, segmentedControlItemRecipe, segmentedControlRootRecipe, selectRecipe, shouldShowAvatarPlaceholder, skipLinkRecipe, tabRecipe, tableRecipe, tablistRecipe, tabpanelRecipe, tabrootRecipe, tabsControl, tdRecipe, textRecipe, thRecipe, toBool, toStrbool, tooltipControl, trRecipe, triggerId, visuallyHiddenRecipe };
63
+ export { CSS_VARS, DEFAULT_LABEL_MAKER, alertRecipe, anchorRecipe, avatartRecipe, blockquoteRecipe, buttonControl, buttonRecipe, captionRecipe, cc, ccAll, checkboxControl, checkboxRecipe, codeRecipe, comboboxControl, comboboxRecipe, containerRecipe, ddRecipe, detailsRecipe, dialogControl, dialogRecipe, dlRecipe, drawerRecipe, dtRecipe, fieldsetRecipe, filterComboboxOptions, focusRingRecipe, getAvatarPlaceholder, getComboboxOptionText, headingRecipe, hrRecipe, inlineFeedbackRecipe, inputControl, inputRecipe, labelMarker, labelRecipe, menuControl, menuitemRecipe, moveComboboxActiveValue, msAll, multiComboboxControl, multiComboboxRecipe, paragraphRecipe, popoverControl, popoverRecipe, progressControl, progressRecipe, radioControl, radioRecipe, radiogroupControl, radiogroupRecipe, sectionRecipe, segmentedControl, segmentedControlItemRecipe, segmentedControlRootRecipe, selectRecipe, shouldShowAvatarPlaceholder, skipLinkRecipe, statusIconRecipe, tabRecipe, tableRecipe, tablistRecipe, tabpanelRecipe, tabrootRecipe, tabsControl, tagRecipe, tdRecipe, textRecipe, thRecipe, toBool, toStrbool, tooltipControl, trRecipe, triggerId, visuallyHiddenRecipe };
@@ -1,2 +1 @@
1
- export declare function getAvatarPlaceholder(name: string): string;
2
- //# sourceMappingURL=get-avatar-placeholder.d.ts.map
1
+ export declare function getAvatarPlaceholder(name: string): string;
@@ -6,5 +6,4 @@ interface AvatarPlaceholderOptions<Value = string> extends AvatarSource<Value> {
6
6
  failedSource: AvatarSource<Value> | null;
7
7
  }
8
8
  export declare function shouldShowAvatarPlaceholder<Value = string>({ src, srcSet, failedSource }: Readonly<AvatarPlaceholderOptions<Value>>): boolean;
9
- export {};
10
- //# sourceMappingURL=should-show-avatar-placeholder.d.ts.map
9
+ export {};
@@ -1,2 +1 @@
1
- export declare function toBool(value: boolean | "true" | "false" | null | undefined): boolean;
2
- //# sourceMappingURL=to-bool.d.ts.map
1
+ export declare function toBool(value: boolean | "true" | "false" | null | undefined): boolean;
@@ -1,3 +1,2 @@
1
1
  export type Strbool = "true" | "false";
2
- export declare function toStrbool(value: boolean): Strbool;
3
- //# sourceMappingURL=to-strbool.d.ts.map
2
+ export declare function toStrbool(value: boolean): Strbool;
@@ -0,0 +1,16 @@
1
+ export interface ButtonRootAttributes {
2
+ "aria-disabled"?: true;
3
+ }
4
+ declare function getRootAttributes(loading: boolean | undefined): ButtonRootAttributes;
5
+ export interface ButtonStatusAttributes {
6
+ "aria-live": "polite";
7
+ "aria-atomic": true;
8
+ }
9
+ declare function getStatusAttributes(): ButtonStatusAttributes;
10
+ declare function handleClick(event: Pick<Event, "preventDefault" | "stopPropagation">, loading: boolean | undefined, onClick?: (() => void) | undefined): void;
11
+ export declare const buttonControl: {
12
+ readonly getRootAttributes: typeof getRootAttributes;
13
+ readonly getStatusAttributes: typeof getStatusAttributes;
14
+ readonly handleClick: typeof handleClick;
15
+ };
16
+ export {};
@@ -0,0 +1,26 @@
1
+ // src/logics/button-control/button-control.ts
2
+ function getRootAttributes(loading) {
3
+ return loading ? { "aria-disabled": true } : {};
4
+ }
5
+ function getStatusAttributes() {
6
+ return {
7
+ "aria-live": "polite",
8
+ "aria-atomic": true
9
+ };
10
+ }
11
+ function handleClick(event, loading, onClick) {
12
+ if (loading) {
13
+ event.preventDefault();
14
+ event.stopPropagation();
15
+ return;
16
+ }
17
+ onClick?.();
18
+ }
19
+ const buttonControl = {
20
+ getRootAttributes,
21
+ getStatusAttributes,
22
+ handleClick
23
+ };
24
+ export { buttonControl };
25
+
26
+ //# sourceMappingURL=button-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button-control.js","names":[],"sources":["../../../src/logics/button-control/button-control.ts"],"sourcesContent":["export interface ButtonRootAttributes {\n \"aria-disabled\"?: true;\n}\n\nfunction getRootAttributes(loading: boolean | undefined): ButtonRootAttributes {\n return loading ? { \"aria-disabled\": true } : {};\n}\n\nexport interface ButtonStatusAttributes {\n \"aria-live\": \"polite\";\n \"aria-atomic\": true;\n}\n\nfunction getStatusAttributes(): ButtonStatusAttributes {\n return {\n \"aria-live\": \"polite\",\n \"aria-atomic\": true,\n };\n}\n\nfunction handleClick(\n event: Pick<Event, \"preventDefault\" | \"stopPropagation\">,\n loading: boolean | undefined,\n onClick?: (() => void) | undefined,\n): void {\n if (loading) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n onClick?.();\n}\n\nexport const buttonControl = {\n getRootAttributes,\n getStatusAttributes,\n handleClick,\n} as const;\n"],"mappings":";AAIA,SAAS,kBAAkB,SAAoD;CAC7E,OAAO,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;AAChD;AAOA,SAAS,sBAA8C;CACrD,OAAO;EACL,aAAa;EACb,eAAe;CACjB;AACF;AAEA,SAAS,YACP,OACA,SACA,SACM;CACN,IAAI,SAAS;EACX,MAAM,eAAe;EACrB,MAAM,gBAAgB;EACtB;CACF;CACA,UAAU;AACZ;AAEA,MAAa,gBAAgB;CAC3B;CACA;CACA;AACF"}
@@ -1,5 +1,4 @@
1
1
  type SlotClassNames<S extends string> = Partial<Record<S, string | undefined>>;
2
2
  /** Apply cc() to every slot of a recipe result, merging optional user overrides. Lovery C.C. **/
3
3
  export declare function ccAll<S extends string>(recipe: Readonly<Record<S, string>>, ...overrides: readonly Readonly<SlotClassNames<S>>[]): Record<S, string>;
4
- export {};
5
- //# sourceMappingURL=cc-all.d.ts.map
4
+ export {};
@@ -1,5 +1,4 @@
1
1
  type ClassNameLike = string | null | undefined;
2
2
  /** Concat ClassNames. Lovely C.C. **/
3
3
  export declare function cc(...classNames: readonly ClassNameLike[]): string;
4
- export {};
5
- //# sourceMappingURL=cc.d.ts.map
4
+ export {};
@@ -27,5 +27,4 @@ export declare const checkboxControl: {
27
27
  readonly getLabelAttributes: typeof getLabelAttributes;
28
28
  readonly getErrorAttributes: typeof getErrorAttributes;
29
29
  };
30
- export {};
31
- //# sourceMappingURL=checkbox-control.d.ts.map
30
+ export {};
@@ -0,0 +1,100 @@
1
+ import { Strbool } from "../bool/to-strbool.js";
2
+ import { ComboboxMode, ComboboxSelectOption } from "./combobox-filter.js";
3
+ export interface ComboboxState {
4
+ mode: ComboboxMode;
5
+ value: string | null;
6
+ query: string;
7
+ activeValue: string | null;
8
+ disabled: boolean;
9
+ readOnly: boolean;
10
+ }
11
+ declare function canEdit(state: Pick<ComboboxState, "disabled" | "readOnly">): boolean;
12
+ declare function getInputValue(state: Readonly<ComboboxState>, options: readonly ComboboxSelectOption[]): string;
13
+ type ComboboxValueUpdate = Pick<ComboboxState, "value" | "query">;
14
+ declare function edit(mode: ComboboxMode, text: string): ComboboxValueUpdate;
15
+ type ComboboxSelectionUpdate = ComboboxValueUpdate & {
16
+ value: NonNullable<ComboboxState["value"]>;
17
+ };
18
+ declare function select(state: Readonly<ComboboxState>, option: Readonly<ComboboxSelectOption>): ComboboxSelectionUpdate | null;
19
+ export interface ComboboxValidationState {
20
+ value: string | null;
21
+ required: boolean;
22
+ disabled: boolean;
23
+ readOnly: boolean;
24
+ requiredMessage?: string | undefined;
25
+ }
26
+ declare function getValidationMessage(state: Readonly<ComboboxValidationState>): string;
27
+ export interface ComboboxFormValueProps {
28
+ name: string;
29
+ value: string;
30
+ form: string | undefined;
31
+ disabled: boolean;
32
+ }
33
+ export interface ComboboxFormValueOptions {
34
+ name: string | undefined;
35
+ value: string | null;
36
+ form: string | undefined;
37
+ disabled: boolean;
38
+ }
39
+ declare function getFormValueProps({ name, value, form, disabled }: Readonly<ComboboxFormValueOptions>): ComboboxFormValueProps | null;
40
+ export type ComboboxKeyAction = "none" | "next" | "previous" | "commit" | "blocked" | "submit";
41
+ export interface ComboboxKeyEvent {
42
+ key: string;
43
+ isComposing: boolean;
44
+ keyCode: number;
45
+ altKey: boolean;
46
+ ctrlKey: boolean;
47
+ metaKey: boolean;
48
+ shiftKey: boolean;
49
+ }
50
+ export interface ComboboxKeyState extends Pick<ComboboxState, "disabled" | "readOnly"> {
51
+ opened: boolean;
52
+ }
53
+ declare function getKeyAction(event: Readonly<ComboboxKeyEvent>, state: Readonly<ComboboxKeyState>, activeOption: Readonly<ComboboxSelectOption> | undefined): ComboboxKeyAction;
54
+ export interface ComboboxInputAttributeState {
55
+ inputId: string;
56
+ listId: string;
57
+ activeId: string | undefined;
58
+ opened: boolean;
59
+ required: boolean;
60
+ }
61
+ export interface ComboboxInputAttributes {
62
+ id: string;
63
+ type: "text";
64
+ role: "combobox";
65
+ "aria-autocomplete": "list";
66
+ "aria-controls": string;
67
+ "aria-expanded": boolean;
68
+ "aria-activedescendant": string | undefined;
69
+ "aria-required": boolean;
70
+ }
71
+ declare function getInputAttributes(state: Readonly<ComboboxInputAttributeState>): ComboboxInputAttributes;
72
+ export interface ComboboxListAttributes {
73
+ id: string;
74
+ popover: "auto" | undefined;
75
+ hidden: boolean;
76
+ role: "listbox";
77
+ "aria-labelledby": string;
78
+ }
79
+ declare function getListAttributes(listId: string, inputId: string, state: Pick<ComboboxState, "disabled" | "readOnly">): ComboboxListAttributes;
80
+ export interface ComboboxItemAttributes {
81
+ id: string;
82
+ role: "option";
83
+ "aria-selected": boolean;
84
+ "aria-disabled": boolean;
85
+ "data-focus": Strbool;
86
+ }
87
+ declare function getItemAttributes(id: string, active: boolean, disabled: boolean): ComboboxItemAttributes;
88
+ export declare const comboboxControl: {
89
+ readonly canEdit: typeof canEdit;
90
+ readonly getInputValue: typeof getInputValue;
91
+ readonly edit: typeof edit;
92
+ readonly select: typeof select;
93
+ readonly getValidationMessage: typeof getValidationMessage;
94
+ readonly getFormValueProps: typeof getFormValueProps;
95
+ readonly getKeyAction: typeof getKeyAction;
96
+ readonly getInputAttributes: typeof getInputAttributes;
97
+ readonly getListAttributes: typeof getListAttributes;
98
+ readonly getItemAttributes: typeof getItemAttributes;
99
+ };
100
+ export {};
@@ -0,0 +1,100 @@
1
+ import { toStrbool } from "../bool/to-strbool.js";
2
+ import { popoverControl } from "../popover-control/popover-control.js";
3
+ import { getComboboxOptionText } from "./combobox-filter.js";
4
+ // src/logics/combobox-control/combobox-control.ts
5
+ const DEFAULT_REQUIRED_MESSAGE = "Please fill out this field.";
6
+ function canEdit(state) {
7
+ return !state.disabled && !state.readOnly;
8
+ }
9
+ function getInputValue(state, options) {
10
+ if (state.mode === "text") return state.value ?? "";
11
+ if (state.value === null) return state.query;
12
+ const option = options.find((candidate) => candidate.value === state.value);
13
+ return option ? getComboboxOptionText(state.mode, option) : state.value;
14
+ }
15
+ function edit(mode, text) {
16
+ return mode === "text" ? {
17
+ value: text,
18
+ query: ""
19
+ } : {
20
+ value: null,
21
+ query: text
22
+ };
23
+ }
24
+ function select(state, option) {
25
+ if (!canEdit(state) || option.disabled) return null;
26
+ return {
27
+ value: option.value,
28
+ query: ""
29
+ };
30
+ }
31
+ function getValidationMessage(state) {
32
+ if (!state.required || state.disabled || state.readOnly || state.value !== null && state.value !== "") return "";
33
+ return state.requiredMessage || DEFAULT_REQUIRED_MESSAGE;
34
+ }
35
+ function getFormValueProps({ name, value, form, disabled }) {
36
+ return name !== void 0 && value !== null ? {
37
+ name,
38
+ value,
39
+ form,
40
+ disabled
41
+ } : null;
42
+ }
43
+ function getKeyAction(event, state, activeOption) {
44
+ if (!canEdit(state) || event.isComposing || event.keyCode === 229) return "none";
45
+ if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return "none";
46
+ switch (event.key) {
47
+ case "ArrowDown": return "next";
48
+ case "ArrowUp": return state.opened ? "previous" : "none";
49
+ case "Enter":
50
+ if (!state.opened || !activeOption) return "submit";
51
+ return activeOption.disabled ? "blocked" : "commit";
52
+ default: return "none";
53
+ }
54
+ }
55
+ function getInputAttributes(state) {
56
+ return {
57
+ id: state.inputId,
58
+ type: "text",
59
+ role: "combobox",
60
+ "aria-autocomplete": "list",
61
+ "aria-controls": state.listId,
62
+ "aria-expanded": state.opened,
63
+ "aria-activedescendant": state.opened ? state.activeId : void 0,
64
+ "aria-required": state.required
65
+ };
66
+ }
67
+ function getListAttributes(listId, inputId, state) {
68
+ const editable = canEdit(state);
69
+ return {
70
+ ...popoverControl.getContentAttributes({ popoverId: listId }),
71
+ popover: editable ? "auto" : void 0,
72
+ hidden: !editable,
73
+ role: "listbox",
74
+ "aria-labelledby": inputId
75
+ };
76
+ }
77
+ function getItemAttributes(id, active, disabled) {
78
+ return {
79
+ id,
80
+ role: "option",
81
+ "aria-selected": active,
82
+ "aria-disabled": disabled,
83
+ "data-focus": toStrbool(active)
84
+ };
85
+ }
86
+ const comboboxControl = {
87
+ canEdit,
88
+ getInputValue,
89
+ edit,
90
+ select,
91
+ getValidationMessage,
92
+ getFormValueProps,
93
+ getKeyAction,
94
+ getInputAttributes,
95
+ getListAttributes,
96
+ getItemAttributes
97
+ };
98
+ export { comboboxControl };
99
+
100
+ //# sourceMappingURL=combobox-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox-control.js","names":[],"sources":["../../../src/logics/combobox-control/combobox-control.ts"],"sourcesContent":["import { type Strbool, toStrbool } from \"../bool\";\nimport { popoverControl } from \"../popover-control\";\nimport { type ComboboxMode, type ComboboxSelectOption, getComboboxOptionText } from \"./combobox-filter\";\n\nconst DEFAULT_REQUIRED_MESSAGE = \"Please fill out this field.\";\n\nexport interface ComboboxState {\n mode: ComboboxMode;\n value: string | null;\n query: string;\n activeValue: string | null;\n disabled: boolean;\n readOnly: boolean;\n}\n\nfunction canEdit(state: Pick<ComboboxState, \"disabled\" | \"readOnly\">): boolean {\n return !state.disabled && !state.readOnly;\n}\n\nfunction getInputValue(state: Readonly<ComboboxState>, options: readonly ComboboxSelectOption[]): string {\n if (state.mode === \"text\") return state.value ?? \"\";\n if (state.value === null) return state.query;\n const option = options.find((candidate) => candidate.value === state.value);\n return option ? getComboboxOptionText(state.mode, option) : state.value;\n}\n\ntype ComboboxValueUpdate = Pick<ComboboxState, \"value\" | \"query\">;\nfunction edit(mode: ComboboxMode, text: string): ComboboxValueUpdate {\n return mode === \"text\"\n ? { value: text, query: \"\" }\n : { value: null, query: text };\n}\n\ntype ComboboxSelectionUpdate = ComboboxValueUpdate & {\n value: NonNullable<ComboboxState[\"value\"]>;\n};\nfunction select(\n state: Readonly<ComboboxState>,\n option: Readonly<ComboboxSelectOption>,\n): ComboboxSelectionUpdate | null {\n if (!canEdit(state) || option.disabled) return null;\n return { value: option.value, query: \"\" };\n}\n\nexport interface ComboboxValidationState {\n value: string | null;\n required: boolean;\n disabled: boolean;\n readOnly: boolean;\n requiredMessage?: string | undefined;\n}\n\nfunction getValidationMessage(state: Readonly<ComboboxValidationState>): string {\n if (!state.required || state.disabled || state.readOnly || (state.value !== null && state.value !== \"\")) return \"\";\n return state.requiredMessage || DEFAULT_REQUIRED_MESSAGE;\n}\n\nexport interface ComboboxFormValueProps {\n name: string;\n value: string;\n form: string | undefined;\n disabled: boolean;\n}\n\nexport interface ComboboxFormValueOptions {\n name: string | undefined;\n value: string | null;\n form: string | undefined;\n disabled: boolean;\n}\n\nfunction getFormValueProps(\n { name, value, form, disabled }: Readonly<ComboboxFormValueOptions>,\n): ComboboxFormValueProps | null {\n return name !== undefined && value !== null ? { name, value, form, disabled } : null;\n}\n\nexport type ComboboxKeyAction = \"none\" | \"next\" | \"previous\" | \"commit\" | \"blocked\" | \"submit\";\n\nexport interface ComboboxKeyEvent {\n key: string;\n isComposing: boolean;\n keyCode: number;\n altKey: boolean;\n ctrlKey: boolean;\n metaKey: boolean;\n shiftKey: boolean;\n}\n\nexport interface ComboboxKeyState extends Pick<ComboboxState, \"disabled\" | \"readOnly\"> {\n opened: boolean;\n}\n\nfunction getKeyAction(\n event: Readonly<ComboboxKeyEvent>,\n state: Readonly<ComboboxKeyState>,\n activeOption: Readonly<ComboboxSelectOption> | undefined,\n): ComboboxKeyAction {\n if (!canEdit(state) || event.isComposing || event.keyCode === 229) return \"none\";\n if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return \"none\";\n switch (event.key) {\n case \"ArrowDown\":\n return \"next\";\n case \"ArrowUp\":\n return state.opened ? \"previous\" : \"none\";\n case \"Enter\":\n if (!state.opened || !activeOption) return \"submit\";\n return activeOption.disabled ? \"blocked\" : \"commit\";\n default:\n return \"none\";\n }\n}\n\nexport interface ComboboxInputAttributeState {\n inputId: string;\n listId: string;\n activeId: string | undefined;\n opened: boolean;\n required: boolean;\n}\n\nexport interface ComboboxInputAttributes {\n id: string;\n type: \"text\";\n role: \"combobox\";\n \"aria-autocomplete\": \"list\";\n \"aria-controls\": string;\n \"aria-expanded\": boolean;\n \"aria-activedescendant\": string | undefined;\n \"aria-required\": boolean;\n}\n\nfunction getInputAttributes(state: Readonly<ComboboxInputAttributeState>): ComboboxInputAttributes {\n return {\n id: state.inputId,\n type: \"text\",\n role: \"combobox\",\n \"aria-autocomplete\": \"list\",\n \"aria-controls\": state.listId,\n \"aria-expanded\": state.opened,\n \"aria-activedescendant\": state.opened ? state.activeId : undefined,\n \"aria-required\": state.required,\n } as const;\n}\n\nexport interface ComboboxListAttributes {\n id: string;\n popover: \"auto\" | undefined;\n hidden: boolean;\n role: \"listbox\";\n \"aria-labelledby\": string;\n}\n\nfunction getListAttributes(\n listId: string,\n inputId: string,\n state: Pick<ComboboxState, \"disabled\" | \"readOnly\">,\n): ComboboxListAttributes {\n const editable = canEdit(state);\n return {\n ...popoverControl.getContentAttributes({ popoverId: listId }),\n popover: editable ? \"auto\" : undefined,\n hidden: !editable,\n role: \"listbox\",\n \"aria-labelledby\": inputId,\n } as const;\n}\n\nexport interface ComboboxItemAttributes {\n id: string;\n role: \"option\";\n \"aria-selected\": boolean;\n \"aria-disabled\": boolean;\n \"data-focus\": Strbool;\n}\n\nfunction getItemAttributes(id: string, active: boolean, disabled: boolean): ComboboxItemAttributes {\n return {\n id,\n role: \"option\",\n \"aria-selected\": active,\n \"aria-disabled\": disabled,\n \"data-focus\": toStrbool(active),\n } as const;\n}\n\nexport const comboboxControl = {\n canEdit,\n getInputValue,\n edit,\n select,\n getValidationMessage,\n getFormValueProps,\n getKeyAction,\n getInputAttributes,\n getListAttributes,\n getItemAttributes,\n} as const;\n"],"mappings":";;;;AAIA,MAAM,2BAA2B;AAWjC,SAAS,QAAQ,OAA8D;CAC7E,OAAO,CAAC,MAAM,YAAY,CAAC,MAAM;AACnC;AAEA,SAAS,cAAc,OAAgC,SAAkD;CACvG,IAAI,MAAM,SAAS,QAAQ,OAAO,MAAM,SAAS;CACjD,IAAI,MAAM,UAAU,MAAM,OAAO,MAAM;CACvC,MAAM,SAAS,QAAQ,MAAM,cAAc,UAAU,UAAU,MAAM,KAAK;CAC1E,OAAO,SAAS,sBAAsB,MAAM,MAAM,MAAM,IAAI,MAAM;AACpE;AAGA,SAAS,KAAK,MAAoB,MAAmC;CACnE,OAAO,SAAS,SACZ;EAAE,OAAO;EAAM,OAAO;CAAG,IACzB;EAAE,OAAO;EAAM,OAAO;CAAK;AACjC;AAKA,SAAS,OACP,OACA,QACgC;CAChC,IAAI,CAAC,QAAQ,KAAK,KAAK,OAAO,UAAU,OAAO;CAC/C,OAAO;EAAE,OAAO,OAAO;EAAO,OAAO;CAAG;AAC1C;AAUA,SAAS,qBAAqB,OAAkD;CAC9E,IAAI,CAAC,MAAM,YAAY,MAAM,YAAY,MAAM,YAAa,MAAM,UAAU,QAAQ,MAAM,UAAU,IAAK,OAAO;CAChH,OAAO,MAAM,mBAAmB;AAClC;AAgBA,SAAS,kBACP,EAAE,MAAM,OAAO,MAAM,YACU;CAC/B,OAAO,SAAS,KAAA,KAAa,UAAU,OAAO;EAAE;EAAM;EAAO;EAAM;CAAS,IAAI;AAClF;AAkBA,SAAS,aACP,OACA,OACA,cACmB;CACnB,IAAI,CAAC,QAAQ,KAAK,KAAK,MAAM,eAAe,MAAM,YAAY,KAAK,OAAO;CAC1E,IAAI,MAAM,UAAU,MAAM,WAAW,MAAM,WAAW,MAAM,UAAU,OAAO;CAC7E,QAAQ,MAAM,KAAd;EACE,KAAK,aACH,OAAO;EACT,KAAK,WACH,OAAO,MAAM,SAAS,aAAa;EACrC,KAAK;GACH,IAAI,CAAC,MAAM,UAAU,CAAC,cAAc,OAAO;GAC3C,OAAO,aAAa,WAAW,YAAY;EAC7C,SACE,OAAO;CACX;AACF;AAqBA,SAAS,mBAAmB,OAAuE;CACjG,OAAO;EACL,IAAI,MAAM;EACV,MAAM;EACN,MAAM;EACN,qBAAqB;EACrB,iBAAiB,MAAM;EACvB,iBAAiB,MAAM;EACvB,yBAAyB,MAAM,SAAS,MAAM,WAAW,KAAA;EACzD,iBAAiB,MAAM;CACzB;AACF;AAUA,SAAS,kBACP,QACA,SACA,OACwB;CACxB,MAAM,WAAW,QAAQ,KAAK;CAC9B,OAAO;EACL,GAAG,eAAe,qBAAqB,EAAE,WAAW,OAAO,CAAC;EAC5D,SAAS,WAAW,SAAS,KAAA;EAC7B,QAAQ,CAAC;EACT,MAAM;EACN,mBAAmB;CACrB;AACF;AAUA,SAAS,kBAAkB,IAAY,QAAiB,UAA2C;CACjG,OAAO;EACL;EACA,MAAM;EACN,iBAAiB;EACjB,iBAAiB;EACjB,cAAc,UAAU,MAAM;CAChC;AACF;AAEA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
@@ -0,0 +1,13 @@
1
+ export interface ComboboxSelectOption {
2
+ value: string;
3
+ label?: string | undefined;
4
+ disabled?: boolean | undefined;
5
+ }
6
+ export interface ComboboxTextOption {
7
+ value: string;
8
+ disabled?: boolean | undefined;
9
+ label?: never;
10
+ }
11
+ export type ComboboxMode = "select" | "text";
12
+ export declare function getComboboxOptionText(mode: ComboboxMode, option: Readonly<ComboboxSelectOption>): string;
13
+ export declare function filterComboboxOptions<O extends ComboboxSelectOption>(mode: ComboboxMode, options: readonly O[], query: string): O[];
@@ -0,0 +1,11 @@
1
+ // src/logics/combobox-control/combobox-filter.ts
2
+ function getComboboxOptionText(mode, option) {
3
+ return mode === "select" ? option.label ?? option.value : option.value;
4
+ }
5
+ function filterComboboxOptions(mode, options, query) {
6
+ const search = query.trim().normalize("NFKC").toLowerCase();
7
+ return options.filter((option) => getComboboxOptionText(mode, option).normalize("NFKC").toLowerCase().includes(search));
8
+ }
9
+ export { filterComboboxOptions, getComboboxOptionText };
10
+
11
+ //# sourceMappingURL=combobox-filter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox-filter.js","names":[],"sources":["../../../src/logics/combobox-control/combobox-filter.ts"],"sourcesContent":["export interface ComboboxSelectOption {\n value: string;\n label?: string | undefined;\n disabled?: boolean | undefined;\n}\n\nexport interface ComboboxTextOption {\n value: string;\n disabled?: boolean | undefined;\n label?: never;\n}\n\nexport type ComboboxMode = \"select\" | \"text\";\n\nexport function getComboboxOptionText(mode: ComboboxMode, option: Readonly<ComboboxSelectOption>): string {\n return mode === \"select\" ? option.label ?? option.value : option.value;\n}\n\nexport function filterComboboxOptions<O extends ComboboxSelectOption>(\n mode: ComboboxMode,\n options: readonly O[],\n query: string,\n): O[] {\n const search = query.trim().normalize(\"NFKC\").toLowerCase();\n return options.filter((option) =>\n getComboboxOptionText(mode, option).normalize(\"NFKC\").toLowerCase().includes(search)\n );\n}\n"],"mappings":";AAcA,SAAgB,sBAAsB,MAAoB,QAAgD;CACxG,OAAO,SAAS,WAAW,OAAO,SAAS,OAAO,QAAQ,OAAO;AACnE;AAEA,SAAgB,sBACd,MACA,SACA,OACK;CACL,MAAM,SAAS,MAAM,KAAK,CAAC,CAAC,UAAU,MAAM,CAAC,CAAC,YAAY;CAC1D,OAAO,QAAQ,QAAQ,WACrB,sBAAsB,MAAM,MAAM,CAAC,CAAC,UAAU,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,MAAM,CACrF;AACF"}
@@ -0,0 +1,2 @@
1
+ import { ComboboxSelectOption } from "./combobox-filter.js";
2
+ export declare function moveComboboxActiveValue(options: readonly ComboboxSelectOption[], activeValue: string | null, direction: "next" | "previous"): string | null;
@@ -0,0 +1,10 @@
1
+ // src/logics/combobox-control/combobox-navigation.ts
2
+ function moveComboboxActiveValue(options, activeValue, direction) {
3
+ if (options.length === 0) return null;
4
+ const activeIndex = options.findIndex((option) => option.value === activeValue);
5
+ if (activeIndex === -1) return (direction === "next" ? options[0] : options.at(-1))?.value ?? null;
6
+ return options[activeIndex + (direction === "next" ? 1 : -1)]?.value ?? activeValue;
7
+ }
8
+ export { moveComboboxActiveValue };
9
+
10
+ //# sourceMappingURL=combobox-navigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox-navigation.js","names":[],"sources":["../../../src/logics/combobox-control/combobox-navigation.ts"],"sourcesContent":["import { type ComboboxSelectOption } from \"./combobox-filter\";\n\nexport function moveComboboxActiveValue(\n options: readonly ComboboxSelectOption[],\n activeValue: string | null,\n direction: \"next\" | \"previous\",\n): string | null {\n if (options.length === 0) return null;\n\n const activeIndex = options.findIndex((option) => option.value === activeValue);\n if (activeIndex === -1) {\n const initialOption = direction === \"next\" ? options[0] : options.at(-1);\n return initialOption?.value ?? null;\n }\n\n const step = direction === \"next\" ? 1 : -1;\n const nextOption = options[activeIndex + step];\n return nextOption?.value ?? activeValue;\n}\n"],"mappings":";AAEA,SAAgB,wBACd,SACA,aACA,WACe;CACf,IAAI,QAAQ,WAAW,GAAG,OAAO;CAEjC,MAAM,cAAc,QAAQ,WAAW,WAAW,OAAO,UAAU,WAAW;CAC9E,IAAI,gBAAgB,IAElB,QADsB,cAAc,SAAS,QAAQ,KAAK,QAAQ,GAAG,EAAE,EAAA,EACjD,SAAS;CAKjC,OADmB,QAAQ,eADd,cAAc,SAAS,IAAI,IAEvB,EAAE,SAAS;AAC9B"}
@@ -42,5 +42,4 @@ export declare const dialogControl: {
42
42
  readonly openDialog: typeof openDialog;
43
43
  readonly headingId: typeof headingId;
44
44
  };
45
- export {};
46
- //# sourceMappingURL=dialog-control.d.ts.map
45
+ export {};
@@ -23,5 +23,4 @@ export declare const inputControl: {
23
23
  readonly getControlAttributes: typeof getControlAttributes;
24
24
  readonly getLabelAttributes: typeof getLabelAttributes;
25
25
  };
26
- export {};
27
- //# sourceMappingURL=input-control.d.ts.map
26
+ export {};
@@ -30,5 +30,4 @@ export declare const DEFAULT_LABEL_MAKER: {
30
30
  readonly label: "(required)";
31
31
  };
32
32
  export declare function labelMarker<Node>(marker: Readonly<LabelMarker<Node>>, required: boolean | undefined): LabelMarkerData<Node>;
33
- export {};
34
- //# sourceMappingURL=label-marker.d.ts.map
33
+ export {};
@@ -57,5 +57,4 @@ export declare const menuControl: {
57
57
  readonly setMenuitemFocus: typeof setMenuitemFocus;
58
58
  readonly hideMenu: typeof hideMenu;
59
59
  };
60
- export {};
61
- //# sourceMappingURL=menu-control.d.ts.map
60
+ export {};
@@ -1 +1 @@
1
- {"version":3,"file":"menu-control.js","names":[],"sources":["../../../src/logics/menu-control/menu-control.ts"],"sourcesContent":["import { toStrbool } from \"../bool\";\nimport { popoverControl } from \"../popover-control\";\n\nexport interface MenuState {\n menuId: string;\n}\n\nexport type MenuItemActivation = \"managed\" | \"native\";\n\ntype indexMap = (currentIndex: number, itemsLength: number) => number;\nconst nextIndexMap: Readonly<Record<string, indexMap>> = {\n \"ArrowUp\": (currentIndex, itemsLength) => (currentIndex - 1 + itemsLength) % itemsLength,\n \"ArrowDown\": (currentIndex, itemsLength) => (currentIndex + 1) % itemsLength,\n \"Home\": (): number => 0,\n \"End\": (_, itemsLength) => itemsLength - 1,\n} as const;\n\nconst openKeys: ReadonlySet<string> = new Set([\"ArrowUp\", \"ArrowDown\", \"Enter\", \" \"]);\nconst itemMotionKeys: readonly string[] = Object.keys(nextIndexMap);\nconst itemActivationKeys: ReadonlySet<string> = new Set([\"Enter\", \" \"]);\n\nconst menuitemDatasetItemKey = \"data-hui-menuitem\";\nconst menuitemDatasetFocusKeyKey = \"data-hui-focus-key\";\nconst menuitemDatasetFocusKeyName = \"huiFocusKey\";\n\nfunction triggerId(menuId: string): string {\n return `${menuId}-trigger`;\n}\n\ninterface MenuitemDataset {\n [menuitemDatasetItemKey]: string;\n [menuitemDatasetFocusKeyKey]?: string;\n}\n\nfunction menuitemDataset(menuId: string, focusKey?: string): MenuitemDataset {\n if (focusKey) {\n return {\n [menuitemDatasetItemKey]: `${menuId}-item`,\n [menuitemDatasetFocusKeyKey]: focusKey,\n };\n } else {\n return {\n [menuitemDatasetItemKey]: `${menuId}-item`,\n };\n }\n}\n\nexport interface MenuTriggerAttributeOptions {\n isButtonElement: boolean;\n}\n\nexport interface MenuTriggerAttributes {\n id: string;\n popovertarget: string;\n type: \"button\" | undefined;\n}\n\nfunction getTriggerAttributes(\n state: Readonly<MenuState>,\n options: Readonly<MenuTriggerAttributeOptions>,\n): MenuTriggerAttributes {\n return {\n id: triggerId(state.menuId),\n ...popoverControl.getTriggerAttributes(\n { popoverId: state.menuId },\n options,\n ),\n };\n}\n\nexport interface MenuContentAttributeOptions {\n ariaLabel?: string | undefined;\n ariaLabelledBy?: string | undefined;\n}\n\nexport interface MenuContentAttributes {\n role: \"menu\";\n id: string;\n popover: \"auto\";\n \"aria-label\": string | undefined;\n \"aria-labelledby\": string | undefined;\n}\n\nfunction getContentAttributes(\n state: Readonly<MenuState>,\n options: Readonly<MenuContentAttributeOptions>,\n): MenuContentAttributes {\n return {\n role: \"menu\",\n ...popoverControl.getContentAttributes({ popoverId: state.menuId }),\n \"aria-label\": options.ariaLabel,\n \"aria-labelledby\": options.ariaLabelledBy\n ?? (!options.ariaLabel ? triggerId(state.menuId) : undefined),\n };\n}\n\nexport interface MenuItemAttributeOptions {\n focusKey?: string | undefined;\n disabled?: boolean | undefined;\n}\n\nexport interface MenuItemAttributes {\n role: \"menuitem\";\n tabindex: -1;\n \"aria-disabled\": \"true\" | \"false\" | undefined;\n \"data-hui-menuitem\": string;\n \"data-hui-focus-key\"?: string | undefined;\n}\n\nfunction getItemAttributes(\n state: Readonly<MenuState>,\n options: Readonly<MenuItemAttributeOptions>,\n): MenuItemAttributes {\n return {\n role: \"menuitem\",\n tabindex: -1,\n \"aria-disabled\": options.disabled === undefined ? undefined : toStrbool(options.disabled),\n ...menuitemDataset(state.menuId, options.focusKey),\n };\n}\n\nfunction getMenu(menuId: string): HTMLElement {\n const menu = document.getElementById(menuId);\n if (!(menu instanceof HTMLElement)) {\n throw new Error(\"[Hebium UI|Menu] Menu element is not found\");\n }\n return menu;\n}\n\nfunction getFocusableMenuitems(menuId: string): HTMLElement[] {\n const itemDataset = menuitemDataset(menuId);\n const menuitemList = getMenu(menuId).querySelectorAll(\n `[${menuitemDatasetItemKey}=\"${itemDataset[menuitemDatasetItemKey]}\"]`,\n );\n return Array.from(menuitemList)\n .filter((e) => e instanceof HTMLElement);\n}\n\nfunction isCharKey(key: string): boolean {\n return key.length === 1 && /^\\S$/.test(key);\n}\n\nfunction handleMenuTriggerKeydown(e: KeyboardEvent, menuId: string): void {\n if (!openKeys.has(e.key)) return;\n const trigger = e.target;\n if (!(trigger instanceof HTMLElement)) {\n throw new Error(\"[Hebuim UI|Menu] Only HTMLElement events are supported\");\n }\n const menu = getMenu(menuId);\n\n e.preventDefault();\n menu.showPopover({ source: trigger });\n if (e.key === \"ArrowUp\") {\n const menuitems = getFocusableMenuitems(menuId);\n menuitems.at(-1)?.focus();\n } else {\n const menuitems = getFocusableMenuitems(menuId);\n menuitems.at(0)?.focus();\n }\n}\n\ntype ItemAction = \"none\" | \"action\" | \"focus-move\" | \"focus-set\" | \"focus-out\";\nfunction handleMenuitemKeydown(e: KeyboardEvent, activation: MenuItemActivation): ItemAction {\n if (itemActivationKeys.has(e.key)) return activation === \"managed\" ? \"action\" : \"none\";\n if (itemMotionKeys.includes(e.key)) return \"focus-move\";\n if (e.key === \"Tab\") return \"focus-out\";\n if (isCharKey(e.key)) return \"focus-set\";\n return \"none\";\n}\n\nexport interface MenuItemActivationOptions {\n activation: MenuItemActivation;\n disabled: boolean;\n}\n\nfunction handleMenuitemActivation(\n e: Event,\n menuId: string,\n options: Readonly<MenuItemActivationOptions>,\n onActivate?: (() => void) | undefined,\n): void {\n if (e.defaultPrevented) return;\n if (options.activation === \"managed\") e.preventDefault();\n if (options.disabled) return;\n onActivate?.();\n hideMenu(menuId);\n}\n\nfunction moveMenuitemFocus(e: KeyboardEvent, menuId: string): void {\n const currentItem = e.target;\n if (!(currentItem instanceof HTMLElement)) {\n throw new Error(\"[Hebuim UI|Menu] Only HTMLElement events are supported\");\n }\n\n const menuitems = getFocusableMenuitems(menuId);\n const currentIndex = menuitems.indexOf(currentItem);\n\n const map = nextIndexMap[e.key];\n if (typeof map === \"undefined\") {\n throw new Error(\"[Hebuim UI|Menu] Unexpected event key: \" + e.key);\n }\n const nextIndex = map(currentIndex, menuitems.length);\n const nextElement = menuitems[nextIndex];\n\n e.preventDefault();\n nextElement?.focus();\n}\n\nfunction findFocusItemIndex(\n menuitems: readonly HTMLElement[],\n currentIndex: number,\n char: string,\n): number {\n const normalizedChar = char.toLowerCase();\n\n for (let offset = 1; offset <= menuitems.length; offset++) {\n const index = (currentIndex + offset) % menuitems.length;\n const item = menuitems[index];\n\n if (item?.dataset[menuitemDatasetFocusKeyName]?.toLowerCase() === normalizedChar) {\n return index;\n }\n }\n\n return -1;\n}\n\nfunction setMenuitemFocus(e: KeyboardEvent, menuId: string): void {\n const currentItem = e.target;\n if (!(currentItem instanceof HTMLElement)) {\n throw new Error(\"[Hebuim UI|Menu] Only HTMLElement events are supported\");\n }\n\n const menuitems = getFocusableMenuitems(menuId);\n const currentIndex = menuitems.indexOf(currentItem);\n const char = e.key.slice(0, 1);\n const nextIndex = findFocusItemIndex(menuitems, currentIndex, char);\n if (nextIndex === -1) return;\n const nextElement = menuitems[nextIndex];\n\n e.preventDefault();\n nextElement?.focus();\n}\n\nfunction hideMenu(menuId: string): void {\n const menu = getMenu(menuId);\n menu.hidePopover();\n}\n\nexport const menuControl = {\n getTriggerAttributes,\n getContentAttributes,\n getItemAttributes,\n handleMenuTriggerKeydown,\n handleMenuitemKeydown,\n handleMenuitemActivation,\n moveMenuitemFocus,\n setMenuitemFocus,\n hideMenu,\n} as const;\n"],"mappings":"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"}
1
+ {"version":3,"file":"menu-control.js","names":[],"sources":["../../../src/logics/menu-control/menu-control.ts"],"sourcesContent":["import { toStrbool } from \"../bool\";\nimport { popoverControl } from \"../popover-control\";\n\nexport interface MenuState {\n menuId: string;\n}\n\nexport type MenuItemActivation = \"managed\" | \"native\";\n\ntype indexMap = (currentIndex: number, itemsLength: number) => number;\nconst nextIndexMap: Readonly<Record<string, indexMap>> = {\n \"ArrowUp\": (currentIndex, itemsLength) => (currentIndex - 1 + itemsLength) % itemsLength,\n \"ArrowDown\": (currentIndex, itemsLength) => (currentIndex + 1) % itemsLength,\n \"Home\": (): number => 0,\n \"End\": (_, itemsLength) => itemsLength - 1,\n} as const;\n\nconst openKeys: ReadonlySet<string> = new Set([\"ArrowUp\", \"ArrowDown\", \"Enter\", \" \"]);\nconst itemMotionKeys: readonly string[] = Object.keys(nextIndexMap);\nconst itemActivationKeys: ReadonlySet<string> = new Set([\"Enter\", \" \"]);\n\nconst menuitemDatasetItemKey = \"data-hui-menuitem\";\nconst menuitemDatasetFocusKeyKey = \"data-hui-focus-key\";\nconst menuitemDatasetFocusKeyName = \"huiFocusKey\";\n\nfunction triggerId(menuId: string): string {\n return `${menuId}-trigger`;\n}\n\ninterface MenuitemDataset {\n [menuitemDatasetItemKey]: string;\n [menuitemDatasetFocusKeyKey]?: string;\n}\n\nfunction menuitemDataset(menuId: string, focusKey?: string): MenuitemDataset {\n if (focusKey) {\n return {\n [menuitemDatasetItemKey]: `${menuId}-item`,\n [menuitemDatasetFocusKeyKey]: focusKey,\n };\n } else {\n return {\n [menuitemDatasetItemKey]: `${menuId}-item`,\n };\n }\n}\n\nexport interface MenuTriggerAttributeOptions {\n isButtonElement: boolean;\n}\n\nexport interface MenuTriggerAttributes {\n id: string;\n popovertarget: string;\n type: \"button\" | undefined;\n}\n\nfunction getTriggerAttributes(\n state: Readonly<MenuState>,\n options: Readonly<MenuTriggerAttributeOptions>,\n): MenuTriggerAttributes {\n return {\n id: triggerId(state.menuId),\n ...popoverControl.getTriggerAttributes(\n { popoverId: state.menuId },\n options,\n ),\n };\n}\n\nexport interface MenuContentAttributeOptions {\n ariaLabel?: string | undefined;\n ariaLabelledBy?: string | undefined;\n}\n\nexport interface MenuContentAttributes {\n role: \"menu\";\n id: string;\n popover: \"auto\";\n \"aria-label\": string | undefined;\n \"aria-labelledby\": string | undefined;\n}\n\nfunction getContentAttributes(\n state: Readonly<MenuState>,\n options: Readonly<MenuContentAttributeOptions>,\n): MenuContentAttributes {\n return {\n role: \"menu\",\n ...popoverControl.getContentAttributes({ popoverId: state.menuId }),\n \"aria-label\": options.ariaLabel,\n \"aria-labelledby\": options.ariaLabelledBy\n ?? (!options.ariaLabel ? triggerId(state.menuId) : undefined),\n };\n}\n\nexport interface MenuItemAttributeOptions {\n focusKey?: string | undefined;\n disabled?: boolean | undefined;\n}\n\nexport interface MenuItemAttributes {\n role: \"menuitem\";\n tabindex: -1;\n \"aria-disabled\": \"true\" | \"false\" | undefined;\n \"data-hui-menuitem\": string;\n \"data-hui-focus-key\"?: string | undefined;\n}\n\nfunction getItemAttributes(\n state: Readonly<MenuState>,\n options: Readonly<MenuItemAttributeOptions>,\n): MenuItemAttributes {\n return {\n role: \"menuitem\",\n tabindex: -1,\n \"aria-disabled\": options.disabled === undefined ? undefined : toStrbool(options.disabled),\n ...menuitemDataset(state.menuId, options.focusKey),\n };\n}\n\nfunction getMenu(menuId: string): HTMLElement {\n const menu = document.getElementById(menuId);\n if (!(menu instanceof HTMLElement)) {\n throw new Error(\"[Hebium UI|Menu] Menu element is not found\");\n }\n return menu;\n}\n\nfunction getFocusableMenuitems(menuId: string): HTMLElement[] {\n const itemDataset = menuitemDataset(menuId);\n const menuitemList = getMenu(menuId).querySelectorAll(\n `[${menuitemDatasetItemKey}=\"${itemDataset[menuitemDatasetItemKey]}\"]`,\n );\n return Array.from(menuitemList)\n .filter((e) => e instanceof HTMLElement);\n}\n\nfunction isCharKey(key: string): boolean {\n return key.length === 1 && /^\\S$/.test(key);\n}\n\nfunction handleMenuTriggerKeydown(e: KeyboardEvent, menuId: string): void {\n if (!openKeys.has(e.key)) return;\n const trigger = e.target;\n if (!(trigger instanceof HTMLElement)) {\n throw new Error(\"[Hebuim UI|Menu] Only HTMLElement events are supported\");\n }\n const menu = getMenu(menuId);\n\n e.preventDefault();\n menu.showPopover({ source: trigger });\n if (e.key === \"ArrowUp\") {\n const menuitems = getFocusableMenuitems(menuId);\n menuitems.at(-1)?.focus();\n } else {\n const menuitems = getFocusableMenuitems(menuId);\n menuitems.at(0)?.focus();\n }\n}\n\ntype ItemAction = \"none\" | \"action\" | \"focus-move\" | \"focus-set\" | \"focus-out\";\nfunction handleMenuitemKeydown(e: KeyboardEvent, activation: MenuItemActivation): ItemAction {\n if (itemActivationKeys.has(e.key)) return activation === \"managed\" ? \"action\" : \"none\";\n if (itemMotionKeys.includes(e.key)) return \"focus-move\";\n if (e.key === \"Tab\") return \"focus-out\";\n if (isCharKey(e.key)) return \"focus-set\";\n return \"none\";\n}\n\nexport interface MenuItemActivationOptions {\n activation: MenuItemActivation;\n disabled: boolean;\n}\n\nfunction handleMenuitemActivation(\n e: Event,\n menuId: string,\n options: Readonly<MenuItemActivationOptions>,\n onActivate?: (() => void) | undefined,\n): void {\n if (e.defaultPrevented) return;\n if (options.activation === \"managed\") e.preventDefault();\n if (options.disabled) return;\n onActivate?.();\n hideMenu(menuId);\n}\n\nfunction moveMenuitemFocus(e: KeyboardEvent, menuId: string): void {\n const currentItem = e.target;\n if (!(currentItem instanceof HTMLElement)) {\n throw new Error(\"[Hebuim UI|Menu] Only HTMLElement events are supported\");\n }\n\n const menuitems = getFocusableMenuitems(menuId);\n const currentIndex = menuitems.indexOf(currentItem);\n\n const map = nextIndexMap[e.key];\n if (typeof map === \"undefined\") {\n throw new Error(\"[Hebuim UI|Menu] Unexpected event key: \" + e.key);\n }\n const nextIndex = map(currentIndex, menuitems.length);\n const nextElement = menuitems[nextIndex];\n\n e.preventDefault();\n nextElement?.focus();\n}\n\nfunction findFocusItemIndex(\n menuitems: readonly HTMLElement[],\n currentIndex: number,\n char: string,\n): number {\n const normalizedChar = char.toLowerCase();\n\n for (let offset = 1; offset <= menuitems.length; offset++) {\n const index = (currentIndex + offset) % menuitems.length;\n const item = menuitems[index];\n\n if (item?.dataset[menuitemDatasetFocusKeyName]?.toLowerCase() === normalizedChar) {\n return index;\n }\n }\n\n return -1;\n}\n\nfunction setMenuitemFocus(e: KeyboardEvent, menuId: string): void {\n const currentItem = e.target;\n if (!(currentItem instanceof HTMLElement)) {\n throw new Error(\"[Hebuim UI|Menu] Only HTMLElement events are supported\");\n }\n\n const menuitems = getFocusableMenuitems(menuId);\n const currentIndex = menuitems.indexOf(currentItem);\n const char = e.key.slice(0, 1);\n const nextIndex = findFocusItemIndex(menuitems, currentIndex, char);\n if (nextIndex === -1) return;\n const nextElement = menuitems[nextIndex];\n\n e.preventDefault();\n nextElement?.focus();\n}\n\nfunction hideMenu(menuId: string): void {\n const menu = getMenu(menuId);\n menu.hidePopover();\n}\n\nexport const menuControl = {\n getTriggerAttributes,\n getContentAttributes,\n getItemAttributes,\n handleMenuTriggerKeydown,\n handleMenuitemKeydown,\n handleMenuitemActivation,\n moveMenuitemFocus,\n setMenuitemFocus,\n hideMenu,\n} as const;\n"],"mappings":"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"}
@@ -2,5 +2,4 @@ type ReadonlySlotStyles<S extends string, P extends object> = Partial<Readonly<R
2
2
  type SlotStyles<S extends string, P extends object> = Partial<Record<S, P | undefined>>;
3
3
  /** Merge styles to every slot. **/
4
4
  export declare function msAll<S extends string, P extends object>(defaultStyels: ReadonlySlotStyles<S, P>, overrides: ReadonlySlotStyles<S, P>): SlotStyles<S, P>;
5
- export {};
6
- //# sourceMappingURL=ms-all.d.ts.map
5
+ export {};