@hebium-ui/core 0.1.0-alpha.2 → 0.1.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +14 -2
- package/dist/index.js +17 -5
- package/dist/logics/avatar-placeholder/get-avatar-placeholder.d.ts +1 -4
- package/dist/logics/avatar-placeholder/get-avatar-placeholder.js +1 -2
- package/dist/logics/avatar-placeholder/should-show-avatar-placeholder.d.ts +2 -5
- package/dist/logics/avatar-placeholder/should-show-avatar-placeholder.js +1 -2
- package/dist/logics/avatar-placeholder/should-show-avatar-placeholder.js.map +1 -1
- package/dist/logics/bool/to-bool.d.ts +1 -4
- package/dist/logics/bool/to-bool.js +1 -2
- package/dist/logics/bool/to-strbool.d.ts +1 -4
- package/dist/logics/bool/to-strbool.js +1 -2
- package/dist/logics/button-control/button-control.d.ts +16 -0
- package/dist/logics/button-control/button-control.js +26 -0
- package/dist/logics/button-control/button-control.js.map +1 -0
- package/dist/logics/cc/cc-all.d.ts +2 -5
- package/dist/logics/cc/cc-all.js +1 -2
- package/dist/logics/cc/cc-all.js.map +1 -1
- package/dist/logics/cc/cc.d.ts +2 -5
- package/dist/logics/cc/cc.js +1 -2
- package/dist/logics/cc/cc.js.map +1 -1
- package/dist/logics/checkbox-control/checkbox-control.d.ts +5 -8
- package/dist/logics/checkbox-control/checkbox-control.js +2 -3
- package/dist/logics/checkbox-control/checkbox-control.js.map +1 -1
- package/dist/logics/combobox-control/combobox-control.d.ts +100 -0
- package/dist/logics/combobox-control/combobox-control.js +100 -0
- package/dist/logics/combobox-control/combobox-control.js.map +1 -0
- package/dist/logics/combobox-control/combobox-filter.d.ts +13 -0
- package/dist/logics/combobox-control/combobox-filter.js +11 -0
- package/dist/logics/combobox-control/combobox-filter.js.map +1 -0
- package/dist/logics/combobox-control/combobox-navigation.d.ts +2 -0
- package/dist/logics/combobox-control/combobox-navigation.js +10 -0
- package/dist/logics/combobox-control/combobox-navigation.js.map +1 -0
- package/dist/logics/dialog-control/dialog-control.d.ts +5 -8
- package/dist/logics/dialog-control/dialog-control.js +1 -2
- package/dist/logics/dialog-control/dialog-control.js.map +1 -1
- package/dist/logics/input-control/input-control.d.ts +3 -6
- package/dist/logics/input-control/input-control.js +1 -2
- package/dist/logics/input-control/input-control.js.map +1 -1
- package/dist/logics/label-marker/label-marker.d.ts +2 -5
- package/dist/logics/label-marker/label-marker.js +1 -2
- package/dist/logics/label-marker/label-marker.js.map +1 -1
- package/dist/logics/menu-control/menu-control.d.ts +5 -8
- package/dist/logics/menu-control/menu-control.js +1 -2
- package/dist/logics/menu-control/menu-control.js.map +1 -1
- package/dist/logics/ms/ms-all.d.ts +3 -5
- package/dist/logics/ms/ms-all.js +1 -2
- package/dist/logics/ms/ms-all.js.map +1 -1
- package/dist/logics/multi-combobox-control/multi-combobox-control.d.ts +58 -0
- package/dist/logics/multi-combobox-control/multi-combobox-control.js +76 -0
- package/dist/logics/multi-combobox-control/multi-combobox-control.js.map +1 -0
- package/dist/logics/multi-combobox-control/multi-combobox-focus.d.ts +15 -0
- package/dist/logics/multi-combobox-control/multi-combobox-focus.js +46 -0
- package/dist/logics/multi-combobox-control/multi-combobox-focus.js.map +1 -0
- package/dist/logics/popover-control/popover-control.d.ts +5 -6
- package/dist/logics/popover-control/popover-control.js +6 -3
- package/dist/logics/popover-control/popover-control.js.map +1 -1
- package/dist/logics/progress-control/progress-control.d.ts +4 -7
- package/dist/logics/progress-control/progress-control.js +2 -3
- package/dist/logics/progress-control/progress-control.js.map +1 -1
- package/dist/logics/radio-control/radio-control.d.ts +4 -7
- package/dist/logics/radio-control/radio-control.js +1 -2
- package/dist/logics/radio-control/radio-control.js.map +1 -1
- package/dist/logics/radiogroup-control/radiogroup-control.d.ts +3 -6
- package/dist/logics/radiogroup-control/radiogroup-control.js +1 -2
- package/dist/logics/radiogroup-control/radiogroup-control.js.map +1 -1
- package/dist/logics/segmented-control/segmented-control.d.ts +3 -6
- package/dist/logics/segmented-control/segmented-control.js +2 -3
- package/dist/logics/segmented-control/segmented-control.js.map +1 -1
- package/dist/logics/tabs-control/tabs-control.d.ts +5 -8
- package/dist/logics/tabs-control/tabs-control.js +1 -2
- package/dist/logics/tabs-control/tabs-control.js.map +1 -1
- package/dist/logics/tabs-control/tabs-keymap.js +1 -2
- package/dist/logics/tabs-control/tabs-keymap.js.map +1 -1
- package/dist/logics/tooltip-control/tooltip-control.d.ts +3 -6
- package/dist/logics/tooltip-control/tooltip-control.js +1 -2
- package/dist/logics/tooltip-control/tooltip-control.js.map +1 -1
- package/dist/recipes/alert/alert.d.ts +4 -7
- package/dist/recipes/alert/alert.js +6 -9
- package/dist/recipes/alert/alert.js.map +1 -1
- package/dist/recipes/anchor/anchor.d.ts +1 -4
- package/dist/recipes/anchor/anchor.js +1 -2
- package/dist/recipes/avatar/avatar.d.ts +1 -4
- package/dist/recipes/avatar/avatar.js +1 -2
- package/dist/recipes/blockquote/blockquote.d.ts +1 -4
- package/dist/recipes/blockquote/blockquote.js +4 -3
- package/dist/recipes/blockquote/blockquote.js.map +1 -1
- package/dist/recipes/button/button.d.ts +16 -7
- package/dist/recipes/button/button.js +39 -16
- package/dist/recipes/button/button.js.map +1 -1
- package/dist/recipes/checkbox/checkbox.d.ts +4 -27
- package/dist/recipes/checkbox/checkbox.js +14 -20
- package/dist/recipes/checkbox/checkbox.js.map +1 -1
- package/dist/recipes/code/code.d.ts +1 -4
- package/dist/recipes/code/code.js +1 -2
- package/dist/recipes/combobox/combobox.d.ts +8 -0
- package/dist/recipes/combobox/combobox.js +34 -0
- package/dist/recipes/combobox/combobox.js.map +1 -0
- package/dist/recipes/container/container.d.ts +1 -4
- package/dist/recipes/container/container.js +1 -2
- package/dist/recipes/details/details.d.ts +4 -7
- package/dist/recipes/details/details.js +10 -6
- package/dist/recipes/details/details.js.map +1 -1
- package/dist/recipes/dialog/dialog.d.ts +4 -5
- package/dist/recipes/dialog/dialog.js +6 -3
- package/dist/recipes/dialog/dialog.js.map +1 -1
- package/dist/recipes/dl/dl.d.ts +1 -4
- package/dist/recipes/dl/dl.js +6 -3
- package/dist/recipes/dl/dl.js.map +1 -1
- package/dist/recipes/drawer/drawer.d.ts +1 -4
- package/dist/recipes/drawer/drawer.js +1 -2
- package/dist/recipes/fieldset/fieldset.d.ts +1 -4
- package/dist/recipes/fieldset/fieldset.js +4 -3
- package/dist/recipes/fieldset/fieldset.js.map +1 -1
- package/dist/recipes/focus-ring/focus-ring.d.ts +1 -4
- package/dist/recipes/focus-ring/focus-ring.js +1 -2
- package/dist/recipes/heading/heading.d.ts +1 -4
- package/dist/recipes/heading/heading.js +1 -2
- package/dist/recipes/hr/hr.d.ts +1 -4
- package/dist/recipes/hr/hr.js +4 -3
- package/dist/recipes/hr/hr.js.map +1 -1
- package/dist/recipes/inline-feedback/inline-feedback.d.ts +50 -0
- package/dist/recipes/inline-feedback/inline-feedback.js +45 -0
- package/dist/recipes/inline-feedback/inline-feedback.js.map +1 -0
- package/dist/recipes/input/input.d.ts +4 -7
- package/dist/recipes/input/input.js +6 -5
- package/dist/recipes/input/input.js.map +1 -1
- package/dist/recipes/label/label.d.ts +2 -5
- package/dist/recipes/label/label.js +2 -2
- package/dist/recipes/label/label.js.map +1 -1
- package/dist/recipes/menu/menu.d.ts +1 -4
- package/dist/recipes/menu/menu.js +5 -3
- package/dist/recipes/menu/menu.js.map +1 -1
- package/dist/recipes/multi-combobox/multi-combobox.d.ts +8 -0
- package/dist/recipes/multi-combobox/multi-combobox.js +52 -0
- package/dist/recipes/multi-combobox/multi-combobox.js.map +1 -0
- package/dist/recipes/paragraph/paragraph.d.ts +1 -4
- package/dist/recipes/paragraph/paragraph.js +1 -2
- package/dist/recipes/popover/popover.d.ts +1 -4
- package/dist/recipes/popover/popover.js +4 -4
- package/dist/recipes/popover/popover.js.map +1 -1
- package/dist/recipes/progress/progress.d.ts +2 -5
- package/dist/recipes/progress/progress.js +1 -2
- package/dist/recipes/radio/radio.d.ts +4 -7
- package/dist/recipes/radio/radio.js +7 -6
- package/dist/recipes/radio/radio.js.map +1 -1
- package/dist/recipes/radiogroup/radiogroup.d.ts +1 -4
- package/dist/recipes/radiogroup/radiogroup.js +1 -2
- package/dist/recipes/section/section.d.ts +4 -5
- package/dist/recipes/section/section.js +6 -3
- package/dist/recipes/section/section.js.map +1 -1
- package/dist/recipes/segmented-control/segmented-control.d.ts +1 -4
- package/dist/recipes/segmented-control/segmented-control.js +11 -6
- package/dist/recipes/segmented-control/segmented-control.js.map +1 -1
- package/dist/recipes/select/select.d.ts +3 -6
- package/dist/recipes/select/select.js +6 -5
- package/dist/recipes/select/select.js.map +1 -1
- package/dist/recipes/skip-link/skip-link.d.ts +5 -0
- package/dist/recipes/skip-link/skip-link.js +9 -0
- package/dist/recipes/skip-link/skip-link.js.map +1 -0
- package/dist/recipes/status-icon/status-icon.d.ts +55 -0
- package/dist/recipes/status-icon/status-icon.js +39 -0
- package/dist/recipes/status-icon/status-icon.js.map +1 -0
- package/dist/recipes/table/table.d.ts +7 -8
- package/dist/recipes/table/table.js +17 -7
- package/dist/recipes/table/table.js.map +1 -1
- package/dist/recipes/tabs/tabs.d.ts +1 -4
- package/dist/recipes/tabs/tabs.js +4 -3
- package/dist/recipes/tabs/tabs.js.map +1 -1
- package/dist/recipes/tag/tag.d.ts +64 -0
- package/dist/recipes/tag/tag.js +86 -0
- package/dist/recipes/tag/tag.js.map +1 -0
- package/dist/recipes/text/text.d.ts +52 -0
- package/dist/recipes/text/text.js +42 -0
- package/dist/recipes/text/text.js.map +1 -0
- package/dist/recipes/visually-hidden/visually-hidden.d.ts +1 -4
- package/dist/recipes/visually-hidden/visually-hidden.js +1 -2
- package/dist/style.css +1 -1
- package/dist/styles/css-vars.d.ts +1 -4
- package/dist/styles/css-vars.js +1 -2
- package/dist/styles/make-recipe-type.d.ts +1 -4
- package/dist/styles/make-recipe.d.ts +2 -5
- package/dist/styles/make-recipe.js +3 -4
- package/dist/styles/make-recipe.js.map +1 -1
- package/dist/styles/primitive-css/{active.module.js → active.module.css.js} +2 -3
- package/dist/styles/primitive-css/active.module.css.js.map +1 -0
- package/dist/styles/primitive-css/{base.module.js → base.module.css.js} +3 -3
- package/dist/styles/primitive-css/base.module.css.js.map +1 -0
- package/dist/styles/primitive-css/checked.module.css.js +11 -0
- package/dist/styles/primitive-css/checked.module.css.js.map +1 -0
- package/dist/styles/primitive-css/composite.module.css.js +5 -0
- package/dist/styles/primitive-css/composite.module.css.js.map +1 -0
- package/dist/styles/primitive-css/{disabled.module.js → disabled.module.css.js} +2 -3
- package/dist/styles/primitive-css/disabled.module.css.js.map +1 -0
- package/dist/styles/primitive-css/focus.module.css.js +10 -0
- package/dist/styles/primitive-css/focus.module.css.js.map +1 -0
- package/dist/styles/primitive-css/{hover.module.js → hover.module.css.js} +4 -4
- package/dist/styles/primitive-css/hover.module.css.js.map +1 -0
- package/dist/styles/primitive-css/icon.module.css.js +13 -0
- package/dist/styles/primitive-css/icon.module.css.js.map +1 -0
- package/dist/styles/primitive-css/{misc.module.js → misc.module.css.js} +8 -7
- package/dist/styles/primitive-css/misc.module.css.js.map +1 -0
- package/dist/styles/primitive-css/{neutral.module.js → neutral.module.css.js} +29 -13
- package/dist/styles/primitive-css/neutral.module.css.js.map +1 -0
- package/dist/styles/primitive-css/{pseudo-element.module.js → pseudo-element.module.css.js} +2 -3
- package/dist/styles/primitive-css/pseudo-element.module.css.js.map +1 -0
- package/dist/styles/primitive.gen.d.ts +80 -21
- package/dist/styles/primitive.gen.js +77 -38
- package/dist/styles/primitive.gen.js.map +1 -1
- package/package.json +5 -5
- package/dist/styles/primitive-css/active.module.js.map +0 -1
- package/dist/styles/primitive-css/base.module.js.map +0 -1
- package/dist/styles/primitive-css/checked.module.js +0 -10
- package/dist/styles/primitive-css/checked.module.js.map +0 -1
- package/dist/styles/primitive-css/composite.module.js +0 -6
- package/dist/styles/primitive-css/composite.module.js.map +0 -1
- package/dist/styles/primitive-css/disabled.module.js.map +0 -1
- package/dist/styles/primitive-css/focus.module.js +0 -10
- package/dist/styles/primitive-css/focus.module.js.map +0 -1
- package/dist/styles/primitive-css/hover.module.js.map +0 -1
- package/dist/styles/primitive-css/icon.module.js +0 -11
- package/dist/styles/primitive-css/icon.module.js.map +0 -1
- package/dist/styles/primitive-css/misc.module.js.map +0 -1
- package/dist/styles/primitive-css/neutral.module.js.map +0 -1
- 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 {
|
|
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";
|
|
@@ -33,13 +40,18 @@ import { RadiogroupSlots, RadiogroupVariants, radiogroupRecipe } from "./recipes
|
|
|
33
40
|
import { SectionSlots, SectionVariants, sectionRecipe } from "./recipes/section/section.js";
|
|
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";
|
|
43
|
+
import { SkipLinkSlots, SkipLinkVariants, skipLinkRecipe } from "./recipes/skip-link/skip-link.js";
|
|
44
|
+
import { StatusIconSlots, StatusIconVariants, statusIconRecipe } from "./recipes/status-icon/status-icon.js";
|
|
36
45
|
import { CaptionSlots, CaptionVariants, TableSlots, TableVariants, TdSlots, TdVariants, ThSlots, ThVariants, TrSlots, TrVariants, captionRecipe, tableRecipe, tdRecipe, thRecipe, trRecipe } from "./recipes/table/table.js";
|
|
37
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";
|
|
48
|
+
import { TextSlots, TextVariants, textRecipe } from "./recipes/text/text.js";
|
|
38
49
|
import { VisuallyHiddenSlots, VisuallyHiddenVariants, visuallyHiddenRecipe } from "./recipes/visually-hidden/visually-hidden.js";
|
|
39
50
|
import { InputControlAttributes, InputControlState, InputLabelAttributes, InputState, inputControl } from "./logics/input-control/input-control.js";
|
|
40
51
|
import { DEFAULT_LABEL_MAKER, LabelMarker, LabelMarkerData, LabelMarkerNodeData, LabelMarkerNullData, labelMarker } from "./logics/label-marker/label-marker.js";
|
|
41
52
|
import { MenuContentAttributeOptions, MenuContentAttributes, MenuItemActivation, MenuItemActivationOptions, MenuItemAttributeOptions, MenuItemAttributes, MenuState, MenuTriggerAttributeOptions, MenuTriggerAttributes, menuControl } from "./logics/menu-control/menu-control.js";
|
|
42
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";
|
|
43
55
|
import { PopoverContentAttributes, PopoverState, PopoverTriggerAttributeOptions, PopoverTriggerAttributes, popoverControl } from "./logics/popover-control/popover-control.js";
|
|
44
56
|
import { ProgressBarAttributes, ProgressLabelAttributes, ProgressResolveOptions, ProgressState, ProgressValueAttributes, progressControl } from "./logics/progress-control/progress-control.js";
|
|
45
57
|
import { RadioControlAttributes, RadioErrorAttributes, RadioLabelAttributes, RadioState, radioControl } from "./logics/radio-control/radio-control.js";
|
|
@@ -48,4 +60,4 @@ import { SegmentedControlItemAttributes, SegmentedControlItemState, segmentedCon
|
|
|
48
60
|
import { TabsListAttributeOptions, TabsListAttributes, TabsPanelAttributes, TabsRootAttributes, TabsState, TabsTabAttributeOptions, TabsTabAttributes, tabsControl } from "./logics/tabs-control/tabs-control.js";
|
|
49
61
|
import { TooltipContentAttributes, TooltipState, TooltipTriggerAttributeOptions, TooltipTriggerAttributes, tooltipControl, triggerId } from "./logics/tooltip-control/tooltip-control.js";
|
|
50
62
|
import { CSS_VARS } from "./styles/css-vars.js";
|
|
51
|
-
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, Strbool, TabSlots, TabVariants, TableSlots, TableVariants, TablistSlots, TablistVariants, TabpanelSlots, TabpanelVariants, TabrootSlots, TabrootVariants, TabsListAttributeOptions, TabsListAttributes, TabsPanelAttributes, TabsRootAttributes, TabsState, TabsTabAttributeOptions, TabsTabAttributes, TdSlots, TdVariants, 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, tabRecipe, tableRecipe, tablistRecipe, tabpanelRecipe, tabrootRecipe, tabsControl, tdRecipe, 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,19 +42,22 @@ 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 {
|
|
45
|
+
import { inlineFeedbackRecipe } from "./recipes/inline-feedback/inline-feedback.js";
|
|
37
46
|
import { labelRecipe } from "./recipes/label/label.js";
|
|
38
|
-
import {
|
|
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";
|
|
44
52
|
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";
|
|
55
|
+
import { skipLinkRecipe } from "./recipes/skip-link/skip-link.js";
|
|
56
|
+
import { statusIconRecipe } from "./recipes/status-icon/status-icon.js";
|
|
47
57
|
import { captionRecipe, tableRecipe, tdRecipe, thRecipe, trRecipe } from "./recipes/table/table.js";
|
|
48
58
|
import { tabRecipe, tablistRecipe, tabpanelRecipe, tabrootRecipe } from "./recipes/tabs/tabs.js";
|
|
59
|
+
import { tagRecipe } from "./recipes/tag/tag.js";
|
|
60
|
+
import { textRecipe } from "./recipes/text/text.js";
|
|
49
61
|
import { visuallyHiddenRecipe } from "./recipes/visually-hidden/visually-hidden.js";
|
|
50
62
|
import { CSS_VARS } from "./styles/css-vars.js";
|
|
51
|
-
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, tabRecipe, tableRecipe, tablistRecipe, tabpanelRecipe, tabrootRecipe, tabsControl, tdRecipe, 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,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function getAvatarPlaceholder(name: string): string;
|
|
3
|
-
//#endregion
|
|
4
|
-
//# sourceMappingURL=get-avatar-placeholder.d.ts.map
|
|
1
|
+
export declare function getAvatarPlaceholder(name: string): string;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
// src/logics/avatar-placeholder/get-avatar-placeholder.ts
|
|
2
2
|
function getAvatarPlaceholder(name) {
|
|
3
3
|
const normalizedName = name.trim();
|
|
4
4
|
if (/[^\p{ASCII}]/u.test(normalizedName)) return Array.from(normalizedName)[0] ?? "";
|
|
5
5
|
return normalizedName.split(/\s+/).map((word) => word[0]?.toUpperCase()).join("").slice(0, 2);
|
|
6
6
|
}
|
|
7
|
-
//#endregion
|
|
8
7
|
export { getAvatarPlaceholder };
|
|
9
8
|
|
|
10
9
|
//# sourceMappingURL=get-avatar-placeholder.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/logics/avatar-placeholder/should-show-avatar-placeholder.d.ts
|
|
2
1
|
export interface AvatarSource<Value = string> {
|
|
3
2
|
src?: Value | undefined;
|
|
4
3
|
srcSet?: Value | undefined;
|
|
@@ -6,7 +5,5 @@ export interface AvatarSource<Value = string> {
|
|
|
6
5
|
interface AvatarPlaceholderOptions<Value = string> extends AvatarSource<Value> {
|
|
7
6
|
failedSource: AvatarSource<Value> | null;
|
|
8
7
|
}
|
|
9
|
-
export declare function shouldShowAvatarPlaceholder<Value = string>({ src, srcSet, failedSource }: AvatarPlaceholderOptions<Value
|
|
10
|
-
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=should-show-avatar-placeholder.d.ts.map
|
|
8
|
+
export declare function shouldShowAvatarPlaceholder<Value = string>({ src, srcSet, failedSource }: Readonly<AvatarPlaceholderOptions<Value>>): boolean;
|
|
9
|
+
export {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// src/logics/avatar-placeholder/should-show-avatar-placeholder.ts
|
|
2
2
|
function shouldShowAvatarPlaceholder({ src, srcSet, failedSource }) {
|
|
3
3
|
return !src && !srcSet || failedSource !== null && failedSource.src === src && failedSource.srcSet === srcSet;
|
|
4
4
|
}
|
|
5
|
-
//#endregion
|
|
6
5
|
export { shouldShowAvatarPlaceholder };
|
|
7
6
|
|
|
8
7
|
//# sourceMappingURL=should-show-avatar-placeholder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"should-show-avatar-placeholder.js","names":[],"sources":["../../../src/logics/avatar-placeholder/should-show-avatar-placeholder.ts"],"sourcesContent":["export interface AvatarSource<Value = string> {\n src?: Value | undefined;\n srcSet?: Value | undefined;\n}\n\ninterface AvatarPlaceholderOptions<Value = string> extends AvatarSource<Value> {\n failedSource: AvatarSource<Value> | null;\n}\n\nexport function shouldShowAvatarPlaceholder<Value = string>(\n { src, srcSet, failedSource }: AvatarPlaceholderOptions<Value
|
|
1
|
+
{"version":3,"file":"should-show-avatar-placeholder.js","names":[],"sources":["../../../src/logics/avatar-placeholder/should-show-avatar-placeholder.ts"],"sourcesContent":["export interface AvatarSource<Value = string> {\n src?: Value | undefined;\n srcSet?: Value | undefined;\n}\n\ninterface AvatarPlaceholderOptions<Value = string> extends AvatarSource<Value> {\n failedSource: AvatarSource<Value> | null;\n}\n\nexport function shouldShowAvatarPlaceholder<Value = string>(\n { src, srcSet, failedSource }: Readonly<AvatarPlaceholderOptions<Value>>,\n): boolean {\n return (!src && !srcSet)\n || (failedSource !== null && failedSource.src === src && failedSource.srcSet === srcSet);\n}\n"],"mappings":";AASA,SAAgB,4BACd,EAAE,KAAK,QAAQ,gBACN;CACT,OAAQ,CAAC,OAAO,CAAC,UACX,iBAAiB,QAAQ,aAAa,QAAQ,OAAO,aAAa,WAAW;AACrF"}
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function toBool(value: boolean | "true" | "false" | null | undefined): boolean;
|
|
3
|
-
//#endregion
|
|
4
|
-
//# sourceMappingURL=to-bool.d.ts.map
|
|
1
|
+
export declare function toBool(value: boolean | "true" | "false" | null | undefined): boolean;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// src/logics/bool/to-bool.ts
|
|
2
2
|
function toBool(value) {
|
|
3
3
|
if (value == null || value === void 0) return false;
|
|
4
4
|
return value !== false && value !== "false";
|
|
5
5
|
}
|
|
6
|
-
//#endregion
|
|
7
6
|
export { toBool };
|
|
8
7
|
|
|
9
8
|
//# sourceMappingURL=to-bool.js.map
|
|
@@ -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,7 +1,4 @@
|
|
|
1
|
-
//#region src/logics/cc/cc-all.d.ts
|
|
2
1
|
type SlotClassNames<S extends string> = Partial<Record<S, string | undefined>>;
|
|
3
2
|
/** Apply cc() to every slot of a recipe result, merging optional user overrides. Lovery C.C. **/
|
|
4
|
-
export declare function ccAll<S extends string>(recipe: Record<S, string
|
|
5
|
-
|
|
6
|
-
export {};
|
|
7
|
-
//# sourceMappingURL=cc-all.d.ts.map
|
|
3
|
+
export declare function ccAll<S extends string>(recipe: Readonly<Record<S, string>>, ...overrides: readonly Readonly<SlotClassNames<S>>[]): Record<S, string>;
|
|
4
|
+
export {};
|
package/dist/logics/cc/cc-all.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cc } from "./cc.js";
|
|
2
|
-
|
|
2
|
+
// src/logics/cc/cc-all.ts
|
|
3
3
|
/** Apply cc() to every slot of a recipe result, merging optional user overrides. Lovery C.C. **/
|
|
4
4
|
function ccAll(recipe, ...overrides) {
|
|
5
5
|
const result = {};
|
|
@@ -9,7 +9,6 @@ function ccAll(recipe, ...overrides) {
|
|
|
9
9
|
}
|
|
10
10
|
return result;
|
|
11
11
|
}
|
|
12
|
-
//#endregion
|
|
13
12
|
export { ccAll };
|
|
14
13
|
|
|
15
14
|
//# sourceMappingURL=cc-all.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cc-all.js","names":[],"sources":["../../../src/logics/cc/cc-all.ts"],"sourcesContent":["import { cc } from \"./cc\";\n\ntype SlotClassNames<S extends string> = Partial<Record<S, string | undefined>>;\n\n/** Apply cc() to every slot of a recipe result, merging optional user overrides. Lovery C.C. **/\nexport function ccAll<S extends string>(\n recipe: Record<S, string
|
|
1
|
+
{"version":3,"file":"cc-all.js","names":[],"sources":["../../../src/logics/cc/cc-all.ts"],"sourcesContent":["import { cc } from \"./cc\";\n\ntype SlotClassNames<S extends string> = Partial<Record<S, string | undefined>>;\n\n/** Apply cc() to every slot of a recipe result, merging optional user overrides. Lovery C.C. **/\nexport function ccAll<S extends string>(\n recipe: Readonly<Record<S, string>>,\n ...overrides: readonly Readonly<SlotClassNames<S>>[]\n): Record<S, string> {\n const result = {} as Record<S, string>;\n for (const key in recipe) {\n const targets = overrides.map((o) => o?.[key]);\n result[key] = cc(recipe[key], ...targets);\n }\n return result;\n}\n"],"mappings":";;;AAKA,SAAgB,MACd,QACA,GAAG,WACgB;CACnB,MAAM,SAAS,CAAC;CAChB,KAAK,MAAM,OAAO,QAAQ;EACxB,MAAM,UAAU,UAAU,KAAK,MAAM,IAAI,IAAI;EAC7C,OAAO,OAAO,GAAG,OAAO,MAAM,GAAG,OAAO;CAC1C;CACA,OAAO;AACT"}
|
package/dist/logics/cc/cc.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
//#region src/logics/cc/cc.d.ts
|
|
2
1
|
type ClassNameLike = string | null | undefined;
|
|
3
2
|
/** Concat ClassNames. Lovely C.C. **/
|
|
4
|
-
export declare function cc(...classNames: ClassNameLike[]): string;
|
|
5
|
-
|
|
6
|
-
export {};
|
|
7
|
-
//# sourceMappingURL=cc.d.ts.map
|
|
3
|
+
export declare function cc(...classNames: readonly ClassNameLike[]): string;
|
|
4
|
+
export {};
|
package/dist/logics/cc/cc.js
CHANGED
package/dist/logics/cc/cc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cc.js","names":[],"sources":["../../../src/logics/cc/cc.ts"],"sourcesContent":["type ClassNameLike = string | null | undefined;\n\n/** Concat ClassNames. Lovely C.C. **/\nexport function cc(...classNames: ClassNameLike[]): string {\n return classNames\n .filter(Boolean)\n .join(\" \");\n}\n"],"mappings":";;AAGA,SAAgB,GAAG,GAAG,
|
|
1
|
+
{"version":3,"file":"cc.js","names":[],"sources":["../../../src/logics/cc/cc.ts"],"sourcesContent":["type ClassNameLike = string | null | undefined;\n\n/** Concat ClassNames. Lovely C.C. **/\nexport function cc(...classNames: readonly ClassNameLike[]): string {\n return classNames\n .filter(Boolean)\n .join(\" \");\n}\n"],"mappings":";;AAGA,SAAgB,GAAG,GAAG,YAA8C;CAClE,OAAO,WACJ,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;AACb"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Strbool } from "../bool/to-strbool.js";
|
|
2
|
-
//#region src/logics/checkbox-control/checkbox-control.d.ts
|
|
3
2
|
export interface CheckboxState {
|
|
4
3
|
id: string;
|
|
5
4
|
invalid: boolean;
|
|
@@ -11,23 +10,21 @@ export interface CheckboxControlAttributes {
|
|
|
11
10
|
id: string;
|
|
12
11
|
"aria-invalid": boolean;
|
|
13
12
|
"aria-describedby": string | undefined;
|
|
14
|
-
"
|
|
13
|
+
"data-indeterminate": Strbool;
|
|
15
14
|
}
|
|
16
|
-
declare function getControlAttributes(state: CheckboxState): CheckboxControlAttributes;
|
|
15
|
+
declare function getControlAttributes(state: Readonly<CheckboxState>): CheckboxControlAttributes;
|
|
17
16
|
export interface CheckboxLabelAttributes {
|
|
18
17
|
for: string;
|
|
19
18
|
"data-disabled": Strbool;
|
|
20
19
|
}
|
|
21
|
-
declare function getLabelAttributes(state: CheckboxState): CheckboxLabelAttributes;
|
|
20
|
+
declare function getLabelAttributes(state: Readonly<CheckboxState>): CheckboxLabelAttributes;
|
|
22
21
|
export interface CheckboxErrorAttributes {
|
|
23
22
|
id: string;
|
|
24
23
|
}
|
|
25
|
-
declare function getErrorAttributes(state: CheckboxState): CheckboxErrorAttributes;
|
|
24
|
+
declare function getErrorAttributes(state: Readonly<CheckboxState>): CheckboxErrorAttributes;
|
|
26
25
|
export declare const checkboxControl: {
|
|
27
26
|
readonly getControlAttributes: typeof getControlAttributes;
|
|
28
27
|
readonly getLabelAttributes: typeof getLabelAttributes;
|
|
29
28
|
readonly getErrorAttributes: typeof getErrorAttributes;
|
|
30
29
|
};
|
|
31
|
-
|
|
32
|
-
export {};
|
|
33
|
-
//# sourceMappingURL=checkbox-control.d.ts.map
|
|
30
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toStrbool } from "../bool/to-strbool.js";
|
|
2
2
|
import { inputControl } from "../input-control/input-control.js";
|
|
3
|
-
|
|
3
|
+
// src/logics/checkbox-control/checkbox-control.ts
|
|
4
4
|
function errorId(state) {
|
|
5
5
|
return `${state.id}-error`;
|
|
6
6
|
}
|
|
@@ -9,7 +9,7 @@ function getControlAttributes(state) {
|
|
|
9
9
|
type: "checkbox",
|
|
10
10
|
...inputControl.getControlAttributes(state),
|
|
11
11
|
"aria-describedby": state.invalid ? errorId(state) : void 0,
|
|
12
|
-
"
|
|
12
|
+
"data-indeterminate": toStrbool(state.indeterminate)
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
function getLabelAttributes(state) {
|
|
@@ -26,7 +26,6 @@ const checkboxControl = {
|
|
|
26
26
|
getLabelAttributes,
|
|
27
27
|
getErrorAttributes
|
|
28
28
|
};
|
|
29
|
-
//#endregion
|
|
30
29
|
export { checkboxControl };
|
|
31
30
|
|
|
32
31
|
//# sourceMappingURL=checkbox-control.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox-control.js","names":[],"sources":["../../../src/logics/checkbox-control/checkbox-control.ts"],"sourcesContent":["import { type Strbool, toStrbool } from \"../bool\";\nimport { inputControl } from \"../input-control\";\n\nexport interface CheckboxState {\n id: string;\n invalid: boolean;\n indeterminate: boolean;\n disabled: boolean;\n}\n\nfunction errorId(state: CheckboxState): string {\n return `${state.id}-error`;\n}\n\nexport interface CheckboxControlAttributes {\n type: \"checkbox\";\n id: string;\n \"aria-invalid\": boolean;\n \"aria-describedby\": string | undefined;\n \"
|
|
1
|
+
{"version":3,"file":"checkbox-control.js","names":[],"sources":["../../../src/logics/checkbox-control/checkbox-control.ts"],"sourcesContent":["import { type Strbool, toStrbool } from \"../bool\";\nimport { inputControl } from \"../input-control\";\n\nexport interface CheckboxState {\n id: string;\n invalid: boolean;\n indeterminate: boolean;\n disabled: boolean;\n}\n\nfunction errorId(state: Readonly<CheckboxState>): string {\n return `${state.id}-error`;\n}\n\nexport interface CheckboxControlAttributes {\n type: \"checkbox\";\n id: string;\n \"aria-invalid\": boolean;\n \"aria-describedby\": string | undefined;\n \"data-indeterminate\": Strbool;\n}\n\nfunction getControlAttributes(state: Readonly<CheckboxState>): CheckboxControlAttributes {\n const inputAttributes = inputControl.getControlAttributes(state);\n\n return {\n type: \"checkbox\",\n ...inputAttributes,\n \"aria-describedby\": state.invalid ? errorId(state) : undefined,\n \"data-indeterminate\": toStrbool(state.indeterminate),\n };\n}\n\nexport interface CheckboxLabelAttributes {\n for: string;\n \"data-disabled\": Strbool;\n}\n\nfunction getLabelAttributes(state: Readonly<CheckboxState>): CheckboxLabelAttributes {\n return {\n for: state.id,\n \"data-disabled\": toStrbool(state.disabled),\n };\n}\n\nexport interface CheckboxErrorAttributes {\n id: string;\n}\n\nfunction getErrorAttributes(state: Readonly<CheckboxState>): CheckboxErrorAttributes {\n return {\n id: errorId(state),\n };\n}\n\nexport const checkboxControl = {\n getControlAttributes,\n getLabelAttributes,\n getErrorAttributes,\n} as const;\n"],"mappings":";;;AAUA,SAAS,QAAQ,OAAwC;CACvD,OAAO,GAAG,MAAM,GAAG;AACrB;AAUA,SAAS,qBAAqB,OAA2D;CAGvF,OAAO;EACL,MAAM;EACN,GAJsB,aAAa,qBAAqB,KAIvC;EACjB,oBAAoB,MAAM,UAAU,QAAQ,KAAK,IAAI,KAAA;EACrD,sBAAsB,UAAU,MAAM,aAAa;CACrD;AACF;AAOA,SAAS,mBAAmB,OAAyD;CACnF,OAAO;EACL,KAAK,MAAM;EACX,iBAAiB,UAAU,MAAM,QAAQ;CAC3C;AACF;AAMA,SAAS,mBAAmB,OAAyD;CACnF,OAAO,EACL,IAAI,QAAQ,KAAK,EACnB;AACF;AAEA,MAAa,kBAAkB;CAC7B;CACA;CACA;AACF"}
|
|
@@ -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
|