@lumx/core 4.17.1-alpha.1 → 4.17.1-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/_internal/_virtual/_rolldown/runtime.js +13 -0
- package/{js → _internal/js}/constants/browser/index.d.ts +6 -3
- package/_internal/js/constants/browser/index.js +15 -0
- package/_internal/js/constants/className/index.d.ts +7 -0
- package/_internal/js/constants/className/index.js +7 -0
- package/{js/constants/components/index.js → _internal/js/constants/components/index.d.ts} +13 -12
- package/_internal/js/constants/components/index.js +27 -0
- package/_internal/js/constants/enums/index.d.ts +207 -0
- package/_internal/js/constants/enums/index.js +165 -0
- package/{js/constants/keycodes/index.js → _internal/js/constants/keycodes/index.d.ts} +12 -11
- package/_internal/js/constants/keycodes/index.js +39 -0
- package/_internal/js/types/AriaAttributes.d.ts +32 -0
- package/_internal/js/types/Booleanish.d.ts +4 -0
- package/_internal/js/types/Callback.d.ts +7 -0
- package/_internal/js/types/CommonRef.d.ts +4 -0
- package/_internal/js/types/Direction.d.ts +4 -0
- package/_internal/js/types/Falsy.d.ts +8 -0
- package/_internal/js/types/GenericProps.d.ts +14 -0
- package/_internal/js/types/HasAriaDisabled.d.ts +9 -0
- package/_internal/js/types/HasAriaLabelOrLabelledBy.d.ts +19 -0
- package/_internal/js/types/HasChecked.d.ts +9 -0
- package/_internal/js/types/HasClassName.d.ts +9 -0
- package/_internal/js/types/HasCloseMode.d.ts +10 -0
- package/_internal/js/types/HasDisabled.d.ts +9 -0
- package/_internal/js/types/HasPolymorphicAs.d.ts +12 -0
- package/_internal/js/types/HasRequiredLinkHref.d.ts +6 -0
- package/_internal/js/types/HasTheme.d.ts +11 -0
- package/_internal/js/types/HeadingElement.d.ts +5 -0
- package/_internal/js/types/JSXElement.d.ts +13 -0
- package/_internal/js/types/KebabCase.d.ts +5 -0
- package/_internal/js/types/LumxClassName.d.ts +7 -0
- package/{js → _internal/js}/types/NamedProps.d.ts +4 -3
- package/{js → _internal/js}/types/NestedComponents.d.ts +5 -2
- package/_internal/js/types/ObjectValues.d.ts +8 -0
- package/{js → _internal/js}/types/PartialBy.d.ts +5 -2
- package/_internal/js/types/Point.d.ts +10 -0
- package/_internal/js/types/Predicate.d.ts +5 -0
- package/_internal/js/types/RectSize.d.ts +10 -0
- package/_internal/js/types/Selector.d.ts +11 -0
- package/_internal/js/types/Spacing.d.ts +4 -0
- package/_internal/js/types/TextElement.d.ts +7 -0
- package/_internal/js/types/ValueOf.d.ts +5 -0
- package/_internal/js/types/jsx/PropsToOverride.d.ts +5 -0
- package/_internal/js/utils/_internal/color/resolveColorWithVariants.js +9 -0
- package/{js → _internal/js}/utils/classNames/action-area/index.d.ts +5 -4
- package/_internal/js/utils/classNames/action-area/index.js +22 -0
- package/_internal/js/utils/classNames/bem/block.d.ts +1 -0
- package/_internal/js/utils/classNames/bem/block.js +16 -0
- package/_internal/js/utils/classNames/bem/element.d.ts +1 -0
- package/_internal/js/utils/classNames/bem/element.js +7 -0
- package/_internal/js/utils/classNames/bem/index.d.ts +18 -0
- package/_internal/js/utils/classNames/bem/index.js +22 -0
- package/_internal/js/utils/classNames/bem/modifier.js +19 -0
- package/_internal/js/utils/classNames/bem/types.d.ts +15 -0
- package/{js → _internal/js}/utils/classNames/color/index.d.ts +8 -4
- package/_internal/js/utils/classNames/color/index.js +50 -0
- package/{js → _internal/js}/utils/classNames/spacing/index.d.ts +23 -18
- package/_internal/js/utils/classNames/spacing/index.js +75 -0
- package/_internal/js/utils/classNames/typography/index.d.ts +10 -0
- package/_internal/js/utils/classNames/typography/index.js +10 -0
- package/_internal/js/utils/classNames/visually-hidden/index.d.ts +8 -0
- package/_internal/js/utils/classNames/visually-hidden/index.js +9 -0
- package/{js → _internal/js}/utils/events/keyboard.d.ts +7 -5
- package/_internal/js/utils/events/keyboard.js +39 -0
- package/{js → _internal/js}/utils/events/swipe.d.ts +4 -1
- package/_internal/js/utils/events/swipe.js +58 -0
- package/_internal/js/utils/selectors/getWithSelector.d.ts +7 -0
- package/_internal/js/utils/selectors/getWithSelector.js +9 -0
- package/_internal/js/utils/selectors/groupBySelector.d.ts +10 -0
- package/_internal/js/utils/selectors/groupBySelector.js +21 -0
- package/js/constants/index.d.ts +6 -5
- package/js/constants/index.js +6 -5
- package/js/types/index.d.ts +31 -30
- package/js/types/index.js +0 -1
- package/js/utils/classNames/index.d.ts +14 -7
- package/js/utils/classNames/index.js +27 -7
- package/js/utils/disabledState/index.d.ts +17 -14
- package/js/utils/disabledState/index.js +9 -8
- package/js/utils/index.d.ts +6 -3
- package/js/utils/index.js +6 -6
- package/js/utils/selectors/index.d.ts +3 -2
- package/js/utils/selectors/index.js +3 -2
- package/package.json +6 -12
- package/_internal/DPnPEC08.js +0 -9
- package/js/components/AlertDialog/Stories.d.ts +0 -115
- package/js/components/AlertDialog/Tests.d.ts +0 -11
- package/js/components/AlertDialog/index.d.ts +0 -91
- package/js/components/Avatar/Stories.d.ts +0 -52
- package/js/components/Avatar/Tests.d.ts +0 -11
- package/js/components/Avatar/index.d.ts +0 -50
- package/js/components/Badge/BadgeWrapper.d.ts +0 -13
- package/js/components/Badge/BadgeWrapperStories.d.ts +0 -29
- package/js/components/Badge/BadgeWrapperTests.d.ts +0 -9
- package/js/components/Badge/Stories.d.ts +0 -46
- package/js/components/Badge/Tests.d.ts +0 -12
- package/js/components/Badge/index.d.ts +0 -37
- package/js/components/Button/Button.d.ts +0 -48
- package/js/components/Button/ButtonGroup.d.ts +0 -36
- package/js/components/Button/ButtonGroupStories.d.ts +0 -33
- package/js/components/Button/ButtonRoot.d.ts +0 -55
- package/js/components/Button/ButtonRootTests.d.ts +0 -12
- package/js/components/Button/IconButton.d.ts +0 -45
- package/js/components/Button/IconButtonStories.d.ts +0 -210
- package/js/components/Button/IconButtonTests.d.ts +0 -15
- package/js/components/Button/Stories.d.ts +0 -302
- package/js/components/Button/Tests.d.ts +0 -15
- package/js/components/Checkbox/Stories.d.ts +0 -89
- package/js/components/Checkbox/Tests.d.ts +0 -15
- package/js/components/Checkbox/index.d.ts +0 -49
- package/js/components/Chip/ChipGroup.d.ts +0 -35
- package/js/components/Chip/ChipGroupStories.d.ts +0 -17
- package/js/components/Chip/ChipGroupTests.d.ts +0 -11
- package/js/components/Chip/SelectionChipGroup.d.ts +0 -56
- package/js/components/Chip/SelectionChipGroupStories.d.ts +0 -54
- package/js/components/Chip/SelectionChipGroupTests.d.ts +0 -23
- package/js/components/Chip/Stories.d.ts +0 -127
- package/js/components/Chip/Tests.d.ts +0 -11
- package/js/components/Chip/index.d.ts +0 -81
- package/js/components/Chip/setupSelectionChipGroupEvents.d.ts +0 -28
- package/js/components/Combobox/ComboboxButton.d.ts +0 -57
- package/js/components/Combobox/ComboboxInput.d.ts +0 -57
- package/js/components/Combobox/ComboboxList.d.ts +0 -47
- package/js/components/Combobox/ComboboxOption.d.ts +0 -74
- package/js/components/Combobox/ComboboxOptionAction.d.ts +0 -35
- package/js/components/Combobox/ComboboxOptionMoreInfo.d.ts +0 -54
- package/js/components/Combobox/ComboboxOptionSkeleton.d.ts +0 -47
- package/js/components/Combobox/ComboboxOptionTests.d.ts +0 -24
- package/js/components/Combobox/ComboboxPopover.d.ts +0 -41
- package/js/components/Combobox/ComboboxSection.d.ts +0 -58
- package/js/components/Combobox/ComboboxState.d.ts +0 -99
- package/js/components/Combobox/Stories.d.ts +0 -167
- package/js/components/Combobox/TestStories.d.ts +0 -186
- package/js/components/Combobox/Tests.d.ts +0 -169
- package/js/components/Combobox/constants.d.ts +0 -2
- package/js/components/Combobox/index.d.ts +0 -25
- package/js/components/Combobox/setupCombobox.d.ts +0 -24
- package/js/components/Combobox/setupComboboxButton.d.ts +0 -16
- package/js/components/Combobox/setupComboboxInput.d.ts +0 -24
- package/js/components/Combobox/setupListbox.d.ts +0 -23
- package/js/components/Combobox/subscribeComboboxState.d.ts +0 -23
- package/js/components/Combobox/types.d.ts +0 -166
- package/js/components/Combobox/utils.d.ts +0 -30
- package/js/components/Dialog/Stories.d.ts +0 -97
- package/js/components/Dialog/Tests.d.ts +0 -12
- package/js/components/Dialog/index.d.ts +0 -99
- package/js/components/Divider/Stories.d.ts +0 -21
- package/js/components/Divider/Tests.d.ts +0 -12
- package/js/components/Divider/index.d.ts +0 -27
- package/js/components/DragHandle/Stories.d.ts +0 -18
- package/js/components/DragHandle/Tests.d.ts +0 -12
- package/js/components/DragHandle/index.d.ts +0 -27
- package/js/components/ExpansionPanel/Stories.d.ts +0 -67
- package/js/components/ExpansionPanel/Tests.d.ts +0 -12
- package/js/components/ExpansionPanel/index.d.ts +0 -70
- package/js/components/Flag/Stories.d.ts +0 -120
- package/js/components/Flag/Tests.d.ts +0 -14
- package/js/components/Flag/index.d.ts +0 -34
- package/js/components/FlexBox/Stories.d.ts +0 -116
- package/js/components/FlexBox/Tests.d.ts +0 -13
- package/js/components/FlexBox/constants.d.ts +0 -4
- package/js/components/FlexBox/index.d.ts +0 -54
- package/js/components/FlexBox/types.d.ts +0 -7
- package/js/components/GenericBlock/Stories.d.ts +0 -74
- package/js/components/GenericBlock/Tests.d.ts +0 -13
- package/js/components/GenericBlock/constants.d.ts +0 -19
- package/js/components/GenericBlock/index.d.ts +0 -85
- package/js/components/GridColumn/GridColumn.d.ts +0 -48
- package/js/components/GridColumn/GridColumnStories.d.ts +0 -45
- package/js/components/GridColumn/GridColumnTests.d.ts +0 -12
- package/js/components/GridColumn/index.d.ts +0 -2
- package/js/components/Heading/Stories.d.ts +0 -90
- package/js/components/Heading/Tests.d.ts +0 -11
- package/js/components/Heading/constants.d.ts +0 -21
- package/js/components/Heading/index.d.ts +0 -44
- package/js/components/Heading/utils.d.ts +0 -8
- package/js/components/Icon/Stories.d.ts +0 -156
- package/js/components/Icon/Tests.d.ts +0 -14
- package/js/components/Icon/constants.d.ts +0 -1
- package/js/components/Icon/index.d.ts +0 -41
- package/js/components/ImageBlock/ImageCaption.d.ts +0 -36
- package/js/components/ImageBlock/Stories.d.ts +0 -187
- package/js/components/ImageBlock/Tests.d.ts +0 -11
- package/js/components/ImageBlock/index.d.ts +0 -63
- package/js/components/InlineList/Stories.d.ts +0 -64
- package/js/components/InlineList/Tests.d.ts +0 -12
- package/js/components/InlineList/index.d.ts +0 -53
- package/js/components/InputHelper/Stories.d.ts +0 -35
- package/js/components/InputHelper/Tests.d.ts +0 -12
- package/js/components/InputHelper/constants.d.ts +0 -3
- package/js/components/InputHelper/index.d.ts +0 -26
- package/js/components/InputLabel/Stories.d.ts +0 -40
- package/js/components/InputLabel/Tests.d.ts +0 -12
- package/js/components/InputLabel/index.d.ts +0 -29
- package/js/components/Lightbox/Stories.d.ts +0 -40
- package/js/components/Lightbox/Tests.d.ts +0 -11
- package/js/components/Lightbox/index.d.ts +0 -68
- package/js/components/Link/Stories.d.ts +0 -282
- package/js/components/Link/Tests.d.ts +0 -8
- package/js/components/Link/index.d.ts +0 -47
- package/js/components/LinkPreview/Stories.d.ts +0 -61
- package/js/components/LinkPreview/Tests.d.ts +0 -15
- package/js/components/LinkPreview/index.d.ts +0 -53
- package/js/components/List/ListDivider.d.ts +0 -33
- package/js/components/List/ListDividerStories.d.ts +0 -17
- package/js/components/List/ListDividerTests.d.ts +0 -11
- package/js/components/List/ListItem.d.ts +0 -58
- package/js/components/List/ListItemAction.d.ts +0 -24
- package/js/components/List/ListItemActionTests.d.ts +0 -11
- package/js/components/List/ListItemStories.d.ts +0 -53
- package/js/components/List/ListItemTests.d.ts +0 -12
- package/js/components/List/ListSection.d.ts +0 -45
- package/js/components/List/ListSectionStories.d.ts +0 -125
- package/js/components/List/ListSectionTests.d.ts +0 -13
- package/js/components/List/ListStories.d.ts +0 -34
- package/js/components/List/ListTests.d.ts +0 -11
- package/js/components/List/index.d.ts +0 -39
- package/js/components/Menu/MenuButton.d.ts +0 -41
- package/js/components/Menu/MenuButtonStories.d.ts +0 -50
- package/js/components/Menu/MenuButtonTestStories.d.ts +0 -31
- package/js/components/Menu/MenuButtonTests.d.ts +0 -34
- package/js/components/Menu/MenuItem.d.ts +0 -26
- package/js/components/Menu/MenuItemTests.d.ts +0 -11
- package/js/components/Menu/MenuList.d.ts +0 -16
- package/js/components/Menu/MenuPopover.d.ts +0 -18
- package/js/components/Menu/MenuTrigger.d.ts +0 -23
- package/js/components/Menu/setupMenu.d.ts +0 -18
- package/js/components/Menu/types.d.ts +0 -40
- package/js/components/Menu/utils.d.ts +0 -9
- package/js/components/Message/Stories.d.ts +0 -119
- package/js/components/Message/Tests.d.ts +0 -14
- package/js/components/Message/index.d.ts +0 -75
- package/js/components/Mosaic/Stories.d.ts +0 -102
- package/js/components/Mosaic/Tests.d.ts +0 -13
- package/js/components/Mosaic/index.d.ts +0 -40
- package/js/components/Popover/Stories.d.ts +0 -156
- package/js/components/Popover/Tests.d.ts +0 -11
- package/js/components/Popover/constants.d.ts +0 -43
- package/js/components/Popover/index.d.ts +0 -120
- package/js/components/Popover/types.d.ts +0 -35
- package/js/components/Popover/utils/buildPopoverMiddleware.d.ts +0 -25
- package/js/components/Popover/utils/computeArrowStyles.d.ts +0 -5
- package/js/components/Popover/utils/getFloatingPlacement.d.ts +0 -7
- package/js/components/Popover/utils/index.d.ts +0 -5
- package/js/components/Popover/utils/parseAutoPlacement.d.ts +0 -22
- package/js/components/Popover/utils/parseFitWidth.d.ts +0 -4
- package/js/components/PopoverDialog/Stories.d.ts +0 -44
- package/js/components/PopoverDialog/Tests.d.ts +0 -11
- package/js/components/PopoverDialog/index.d.ts +0 -22
- package/js/components/ProgressCircular/Stories.d.ts +0 -30
- package/js/components/ProgressCircular/Tests.d.ts +0 -11
- package/js/components/ProgressCircular/index.d.ts +0 -52
- package/js/components/ProgressLinear/Stories.d.ts +0 -11
- package/js/components/ProgressLinear/Tests.d.ts +0 -11
- package/js/components/ProgressLinear/index.d.ts +0 -27
- package/js/components/RadioButton/Stories.d.ts +0 -78
- package/js/components/RadioButton/Tests.d.ts +0 -15
- package/js/components/RadioButton/index.d.ts +0 -45
- package/js/components/RadioGroup/index.d.ts +0 -34
- package/js/components/RawClickable/Tests.d.ts +0 -14
- package/js/components/RawClickable/index.d.ts +0 -14
- package/js/components/SelectButton/Stories.d.ts +0 -135
- package/js/components/SelectButton/TestStories.d.ts +0 -45
- package/js/components/SelectButton/Tests.d.ts +0 -34
- package/js/components/SelectButton/index.d.ts +0 -88
- package/js/components/SelectTextField/Stories.d.ts +0 -192
- package/js/components/SelectTextField/TestStories.d.ts +0 -39
- package/js/components/SelectTextField/Tests.d.ts +0 -38
- package/js/components/SelectTextField/index.d.ts +0 -87
- package/js/components/Skeleton/SkeletonCircle.d.ts +0 -32
- package/js/components/Skeleton/SkeletonCircleStories.d.ts +0 -43
- package/js/components/Skeleton/SkeletonCircleTests.d.ts +0 -12
- package/js/components/Skeleton/SkeletonRectangle.d.ts +0 -47
- package/js/components/Skeleton/SkeletonRectangleStories.d.ts +0 -83
- package/js/components/Skeleton/SkeletonRectangleTests.d.ts +0 -13
- package/js/components/Skeleton/SkeletonTypography.d.ts +0 -37
- package/js/components/Skeleton/SkeletonTypographyStories.d.ts +0 -53
- package/js/components/Skeleton/SkeletonTypographyTests.d.ts +0 -13
- package/js/components/Skeleton/index.d.ts +0 -3
- package/js/components/Switch/Stories.d.ts +0 -94
- package/js/components/Switch/Tests.d.ts +0 -15
- package/js/components/Switch/index.d.ts +0 -47
- package/js/components/Table/Stories.d.ts +0 -30
- package/js/components/Table/TableBody.d.ts +0 -25
- package/js/components/Table/TableCell.d.ts +0 -55
- package/js/components/Table/TableCellStories.d.ts +0 -47
- package/js/components/Table/TableCellTests.d.ts +0 -11
- package/js/components/Table/TableHeader.d.ts +0 -29
- package/js/components/Table/TableRow.d.ts +0 -35
- package/js/components/Table/TableRowStories.d.ts +0 -23
- package/js/components/Table/Tests.d.ts +0 -11
- package/js/components/Table/constants.d.ts +0 -9
- package/js/components/Table/index.d.ts +0 -27
- package/js/components/Tabs/Tab.d.ts +0 -70
- package/js/components/Tabs/TabList.d.ts +0 -39
- package/js/components/Tabs/TabListTests.d.ts +0 -12
- package/js/components/Tabs/TabPanel.d.ts +0 -43
- package/js/components/Tabs/TabPanelTests.d.ts +0 -11
- package/js/components/Tabs/TabProviderTestUtils.d.ts +0 -17
- package/js/components/Tabs/Tests.d.ts +0 -11
- package/js/components/Tabs/constants.d.ts +0 -4
- package/js/components/Tabs/state.d.ts +0 -34
- package/js/components/Text/Stories.d.ts +0 -164
- package/js/components/Text/Tests.d.ts +0 -10
- package/js/components/Text/index.d.ts +0 -935
- package/js/components/TextField/RawInputText.d.ts +0 -24
- package/js/components/TextField/RawInputTextStories.d.ts +0 -16
- package/js/components/TextField/RawInputTextTests.d.ts +0 -11
- package/js/components/TextField/RawInputTextarea.d.ts +0 -23
- package/js/components/TextField/RawInputTextareaStories.d.ts +0 -21
- package/js/components/TextField/RawInputTextareaTests.d.ts +0 -11
- package/js/components/TextField/Stories.d.ts +0 -101
- package/js/components/TextField/Tests.d.ts +0 -14
- package/js/components/TextField/TextField.d.ts +0 -84
- package/js/components/TextField/constants.d.ts +0 -13
- package/js/components/Thumbnail/Stories.d.ts +0 -178
- package/js/components/Thumbnail/Tests.d.ts +0 -11
- package/js/components/Thumbnail/index.d.ts +0 -84
- package/js/components/Thumbnail/types.d.ts +0 -45
- package/js/components/Thumbnail/utils.d.ts +0 -79
- package/js/components/TimePickerField/Stories.d.ts +0 -64
- package/js/components/TimePickerField/Tests.d.ts +0 -29
- package/js/components/TimePickerField/index.d.ts +0 -119
- package/js/components/Toolbar/Stories.d.ts +0 -29
- package/js/components/Toolbar/Tests.d.ts +0 -12
- package/js/components/Toolbar/index.d.ts +0 -33
- package/js/components/Tooltip/Stories.d.ts +0 -61
- package/js/components/Tooltip/TestStories.d.ts +0 -72
- package/js/components/Tooltip/Tests.d.ts +0 -11
- package/js/components/Tooltip/constants.d.ts +0 -10
- package/js/components/Tooltip/index.d.ts +0 -65
- package/js/components/Tooltip/tooltipOpenManager.d.ts +0 -21
- package/js/components/Uploader/Stories.d.ts +0 -116
- package/js/components/Uploader/Tests.d.ts +0 -14
- package/js/components/Uploader/index.d.ts +0 -79
- package/js/components/UserBlock/Stories.d.ts +0 -153
- package/js/components/UserBlock/Tests.d.ts +0 -13
- package/js/components/UserBlock/index.d.ts +0 -145
- package/js/constants/_internal/design-tokens.d.ts +0 -5421
- package/js/constants/browser/index.js +0 -14
- package/js/constants/className/index.d.ts +0 -4
- package/js/constants/className/index.js +0 -6
- package/js/constants/components/index.d.ts +0 -24
- package/js/constants/enums/index.d.ts +0 -210
- package/js/constants/enums/index.js +0 -164
- package/js/constants/keycodes/index.d.ts +0 -36
- package/js/types/AriaAttributes.d.ts +0 -29
- package/js/types/Booleanish.d.ts +0 -1
- package/js/types/Callback.d.ts +0 -4
- package/js/types/CommonRef.d.ts +0 -1
- package/js/types/Direction.d.ts +0 -1
- package/js/types/Falsy.d.ts +0 -5
- package/js/types/GenericProps.d.ts +0 -10
- package/js/types/HasAriaDisabled.d.ts +0 -5
- package/js/types/HasAriaLabelOrLabelledBy.d.ts +0 -17
- package/js/types/HasChecked.d.ts +0 -6
- package/js/types/HasClassName.d.ts +0 -6
- package/js/types/HasCloseMode.d.ts +0 -7
- package/js/types/HasDisabled.d.ts +0 -6
- package/js/types/HasPolymorphicAs.d.ts +0 -8
- package/js/types/HasRequiredLinkHref.d.ts +0 -3
- package/js/types/HasTheme.d.ts +0 -7
- package/js/types/HeadingElement.d.ts +0 -2
- package/js/types/JSXElement.d.ts +0 -9
- package/js/types/KebabCase.d.ts +0 -2
- package/js/types/LumxClassName.d.ts +0 -3
- package/js/types/ObjectValues.d.ts +0 -5
- package/js/types/Point.d.ts +0 -7
- package/js/types/Predicate.d.ts +0 -2
- package/js/types/RectSize.d.ts +0 -7
- package/js/types/Selector.d.ts +0 -11
- package/js/types/Spacing.d.ts +0 -1
- package/js/types/TextElement.d.ts +0 -3
- package/js/types/ValueOf.d.ts +0 -2
- package/js/types/jsx/PropsToOverride.d.ts +0 -2
- package/js/utils/ClickAway/TestStories.d.ts +0 -36
- package/js/utils/ClickAway/index.d.ts +0 -34
- package/js/utils/InfiniteScroll/TestStories.d.ts +0 -50
- package/js/utils/InfiniteScroll/index.d.ts +0 -21
- package/js/utils/InfiniteScroll/setupInfiniteScrollObserver.d.ts +0 -8
- package/js/utils/Portal/Stories.d.ts +0 -29
- package/js/utils/Portal/Tests.d.ts +0 -25
- package/js/utils/Portal/index.d.ts +0 -25
- package/js/utils/_internal/color/index.d.ts +0 -1
- package/js/utils/_internal/color/resolveColorWithVariants.d.ts +0 -3
- package/js/utils/action-area/Stories.d.ts +0 -38
- package/js/utils/browser/createSelectorTreeWalker.d.ts +0 -13
- package/js/utils/browser/css/combineSize.d.ts +0 -4
- package/js/utils/browser/css/resolveCssSize.d.ts +0 -4
- package/js/utils/browser/css/types.d.ts +0 -7
- package/js/utils/browser/isFocusVisible.d.ts +0 -2
- package/js/utils/browser/isHoverNotSupported.d.ts +0 -2
- package/js/utils/browser/isPrintableKey.d.ts +0 -7
- package/js/utils/browser/lastDescendant.d.ts +0 -2
- package/js/utils/browser/querySelectorInclusive.d.ts +0 -11
- package/js/utils/browser/trackContainerFocus.d.ts +0 -11
- package/js/utils/classNames/action-area/index.js +0 -21
- package/js/utils/classNames/bem/block.d.ts +0 -15
- package/js/utils/classNames/bem/block.js +0 -26
- package/js/utils/classNames/bem/element.d.ts +0 -16
- package/js/utils/classNames/bem/element.js +0 -7
- package/js/utils/classNames/bem/index.d.ts +0 -18
- package/js/utils/classNames/bem/index.js +0 -22
- package/js/utils/classNames/bem/modifier.d.ts +0 -13
- package/js/utils/classNames/bem/modifier.js +0 -21
- package/js/utils/classNames/bem/types.d.ts +0 -11
- package/js/utils/classNames/color/index.js +0 -51
- package/js/utils/classNames/spacing/index.js +0 -73
- package/js/utils/classNames/typography/index.d.ts +0 -6
- package/js/utils/classNames/typography/index.js +0 -9
- package/js/utils/classNames/visually-hidden/index.d.ts +0 -5
- package/js/utils/classNames/visually-hidden/index.js +0 -11
- package/js/utils/events/index.d.ts +0 -2
- package/js/utils/events/keyboard.js +0 -44
- package/js/utils/events/swipe.js +0 -79
- package/js/utils/focus/constants.d.ts +0 -10
- package/js/utils/focus/getFirstAndLastFocusable.d.ts +0 -13
- package/js/utils/focus/getFocusableElements.d.ts +0 -1
- package/js/utils/focus/index.d.ts +0 -4
- package/js/utils/focus/setupFocusTrap.d.ts +0 -28
- package/js/utils/focusNavigation/createActiveItemState.d.ts +0 -26
- package/js/utils/focusNavigation/createGridFocusNavigation.d.ts +0 -16
- package/js/utils/focusNavigation/createListFocusNavigation.d.ts +0 -15
- package/js/utils/focusNavigation/createPendingNavigation.d.ts +0 -7
- package/js/utils/focusNavigation/index.d.ts +0 -5
- package/js/utils/focusNavigation/setupRovingTabIndex.d.ts +0 -37
- package/js/utils/focusNavigation/types.d.ts +0 -68
- package/js/utils/function/listenerTower.d.ts +0 -13
- package/js/utils/iterable/first.d.ts +0 -2
- package/js/utils/locale/getCurrentLocale.d.ts +0 -7
- package/js/utils/locale/index.d.ts +0 -1
- package/js/utils/select/findOptionById.d.ts +0 -13
- package/js/utils/select/getOptionDisplayName.d.ts +0 -8
- package/js/utils/select/renderSelectOptions.d.ts +0 -7
- package/js/utils/select/toggleSelection.d.ts +0 -23
- package/js/utils/select/types.d.ts +0 -243
- package/js/utils/selectors/getWithSelector.d.ts +0 -3
- package/js/utils/selectors/getWithSelector.js +0 -14
- package/js/utils/selectors/groupBySelector.d.ts +0 -6
- package/js/utils/selectors/groupBySelector.js +0 -21
- package/js/utils/theme/invertTheme.d.ts +0 -3
- package/js/utils/time/buildTimeList.d.ts +0 -34
- package/js/utils/time/formatTime.d.ts +0 -6
- package/js/utils/time/getDateAtTime.d.ts +0 -8
- package/js/utils/time/index.d.ts +0 -8
- package/js/utils/time/isDateOnTime.d.ts +0 -8
- package/js/utils/time/parseTimeInput.d.ts +0 -16
- package/js/utils/time/snapTimeToBounds.d.ts +0 -7
- package/js/utils/time/timeOfDayMinutes.d.ts +0 -4
- package/js/utils/typeahead/index.d.ts +0 -37
- package/stories/controls/color.d.ts +0 -15
- package/stories/controls/element.d.ts +0 -16
- package/stories/controls/focusPoint.d.ts +0 -8
- package/stories/controls/icons.d.ts +0 -66
- package/stories/controls/image.d.ts +0 -96
- package/stories/controls/selectArgType.d.ts +0 -7
- package/stories/controls/theme.d.ts +0 -7
- package/stories/controls/typography.d.ts +0 -8
- package/stories/controls/withUndefined.d.ts +0 -1
- package/stories/types.d.ts +0 -67
- package/stories/utils/CombinationsTable.d.ts +0 -26
- package/stories/utils/ThemingVariablesTable.d.ts +0 -29
- package/stories/utils/combinations.d.ts +0 -100
- package/stories/utils/concatPath.d.ts +0 -10
- package/stories/utils/disableArgTypes.d.ts +0 -7
- package/stories/utils/initDemoShadowDOMPortal.d.ts +0 -5
- package/stories/utils/lorem.d.ts +0 -7
- package/stories/utils/themeVariables.d.ts +0 -39
- package/stories/utils/toFlattenProps.d.ts +0 -12
- package/stories/utils/withCategory.d.ts +0 -4
- package/testing/commonTestsSuiteTL.d.ts +0 -87
- package/testing/index.d.ts +0 -1
- package/testing/queries.d.ts +0 -4
- /package/{css → src/css}/_retro-compat-v2.css +0 -0
- /package/{css → src/css}/design-tokens.css +0 -0
- /package/{css → src/css}/material.css +0 -0
- /package/{scss → src/scss}/_components.scss +0 -0
- /package/{scss → src/scss}/_components_classes.scss +0 -0
- /package/{scss → src/scss}/_core.scss +0 -0
- /package/{scss → src/scss}/_core_classes.scss +0 -0
- /package/{scss → src/scss}/_design-tokens.scss +0 -0
- /package/{scss → src/scss}/_retro-compat-v2.scss +0 -0
- /package/{scss → src/scss}/components/avatar/_index.scss +0 -0
- /package/{scss → src/scss}/components/badge/_index.scss +0 -0
- /package/{scss → src/scss}/components/button/_index.scss +0 -0
- /package/{scss → src/scss}/components/button/_mixins.scss +0 -0
- /package/{scss → src/scss}/components/button/_variables.scss +0 -0
- /package/{scss → src/scss}/components/checkbox/_index.scss +0 -0
- /package/{scss → src/scss}/components/checkbox/_mixins.scss +0 -0
- /package/{scss → src/scss}/components/chip/_index.scss +0 -0
- /package/{scss → src/scss}/components/chip/_mixins.scss +0 -0
- /package/{scss → src/scss}/components/chip/_variables.scss +0 -0
- /package/{scss → src/scss}/components/combobox/_index.scss +0 -0
- /package/{scss → src/scss}/components/comment-block/_index.scss +0 -0
- /package/{scss → src/scss}/components/date-picker/_index.scss +0 -0
- /package/{scss → src/scss}/components/dialog/_index.scss +0 -0
- /package/{scss → src/scss}/components/dialog/_variables.scss +0 -0
- /package/{scss → src/scss}/components/divider/_index.scss +0 -0
- /package/{scss → src/scss}/components/divider/_mixins.scss +0 -0
- /package/{scss → src/scss}/components/divider/_variables.scss +0 -0
- /package/{scss → src/scss}/components/drag-handle/_index.scss +0 -0
- /package/{scss → src/scss}/components/dropdown/_index.scss +0 -0
- /package/{scss → src/scss}/components/expansion-panel/_index.scss +0 -0
- /package/{scss → src/scss}/components/expansion-panel/_variables.scss +0 -0
- /package/{scss → src/scss}/components/flag/_index.scss +0 -0
- /package/{scss → src/scss}/components/flex-box/_index.scss +0 -0
- /package/{scss → src/scss}/components/generic-block/_index.scss +0 -0
- /package/{scss → src/scss}/components/grid/_index.scss +0 -0
- /package/{scss → src/scss}/components/grid-column/_index.scss +0 -0
- /package/{scss → src/scss}/components/icon/_index.scss +0 -0
- /package/{scss → src/scss}/components/icon/_mixins.scss +0 -0
- /package/{scss → src/scss}/components/icon/_variables.scss +0 -0
- /package/{scss → src/scss}/components/image-block/_index.scss +0 -0
- /package/{scss → src/scss}/components/image-lightbox/_index.scss +0 -0
- /package/{scss → src/scss}/components/inline-list/_index.scss +0 -0
- /package/{scss → src/scss}/components/input-helper/_index.scss +0 -0
- /package/{scss → src/scss}/components/input-helper/_mixins.scss +0 -0
- /package/{scss → src/scss}/components/input-helper/_variables.scss +0 -0
- /package/{scss → src/scss}/components/input-label/_index.scss +0 -0
- /package/{scss → src/scss}/components/input-label/_mixins.scss +0 -0
- /package/{scss → src/scss}/components/lightbox/_index.scss +0 -0
- /package/{scss → src/scss}/components/lightbox/_variables.scss +0 -0
- /package/{scss → src/scss}/components/link/_index.scss +0 -0
- /package/{scss → src/scss}/components/link/_mixins.scss +0 -0
- /package/{scss → src/scss}/components/link-preview/_index.scss +0 -0
- /package/{scss → src/scss}/components/list/_index.scss +0 -0
- /package/{scss → src/scss}/components/list/_mixins.scss +0 -0
- /package/{scss → src/scss}/components/list/_variables.scss +0 -0
- /package/{scss → src/scss}/components/menu/_index.scss +0 -0
- /package/{scss → src/scss}/components/message/_index.scss +0 -0
- /package/{scss → src/scss}/components/mosaic/_index.scss +0 -0
- /package/{scss → src/scss}/components/navigation/_index.scss +0 -0
- /package/{scss → src/scss}/components/navigation/_mixins.scss +0 -0
- /package/{scss → src/scss}/components/notification/_index.scss +0 -0
- /package/{scss → src/scss}/components/notification/_variables.scss +0 -0
- /package/{scss → src/scss}/components/notification-block/_index.scss +0 -0
- /package/{scss → src/scss}/components/popover/_index.scss +0 -0
- /package/{scss → src/scss}/components/popover/_variables.scss +0 -0
- /package/{scss → src/scss}/components/post-block/_index.scss +0 -0
- /package/{scss → src/scss}/components/progress/_index.scss +0 -0
- /package/{scss → src/scss}/components/progress/_variables.scss +0 -0
- /package/{scss → src/scss}/components/progress-tracker/_index.scss +0 -0
- /package/{scss → src/scss}/components/progress-tracker/_variables.scss +0 -0
- /package/{scss → src/scss}/components/radio-button/_index.scss +0 -0
- /package/{scss → src/scss}/components/radio-button/_mixins.scss +0 -0
- /package/{scss → src/scss}/components/select/_index.scss +0 -0
- /package/{scss → src/scss}/components/select/_mixins.scss +0 -0
- /package/{scss → src/scss}/components/side-navigation/_index.scss +0 -0
- /package/{scss → src/scss}/components/side-navigation/_mixins.scss +0 -0
- /package/{scss → src/scss}/components/skeleton/_index.scss +0 -0
- /package/{scss → src/scss}/components/skeleton/_mixins.scss +0 -0
- /package/{scss → src/scss}/components/slider/_index.scss +0 -0
- /package/{scss → src/scss}/components/slideshow/_index.scss +0 -0
- /package/{scss → src/scss}/components/slideshow/_variables.scss +0 -0
- /package/{scss → src/scss}/components/switch/_index.scss +0 -0
- /package/{scss → src/scss}/components/switch/_mixins.scss +0 -0
- /package/{scss → src/scss}/components/table/_index.scss +0 -0
- /package/{scss → src/scss}/components/table/_mixins.scss +0 -0
- /package/{scss → src/scss}/components/tabs/_index.scss +0 -0
- /package/{scss → src/scss}/components/tabs/_mixins.scss +0 -0
- /package/{scss → src/scss}/components/text/_index.scss +0 -0
- /package/{scss → src/scss}/components/text-field/_index.scss +0 -0
- /package/{scss → src/scss}/components/text-field/_mixins.scss +0 -0
- /package/{scss → src/scss}/components/text-field/_variables.scss +0 -0
- /package/{scss → src/scss}/components/thumbnail/_index.scss +0 -0
- /package/{scss → src/scss}/components/thumbnail/_variables.scss +0 -0
- /package/{scss → src/scss}/components/toolbar/_index.scss +0 -0
- /package/{scss → src/scss}/components/toolbar/_variables.scss +0 -0
- /package/{scss → src/scss}/components/tooltip/_index.scss +0 -0
- /package/{scss → src/scss}/components/tooltip/_variables.scss +0 -0
- /package/{scss → src/scss}/components/uploader/_index.scss +0 -0
- /package/{scss → src/scss}/components/user-block/_index.scss +0 -0
- /package/{scss → src/scss}/components-and-utils.scss +0 -0
- /package/{scss → src/scss}/core/_normalize.scss +0 -0
- /package/{scss → src/scss}/core/action-area/_index.scss +0 -0
- /package/{scss → src/scss}/core/base/_functions.scss +0 -0
- /package/{scss → src/scss}/core/base/_helpers.scss +0 -0
- /package/{scss → src/scss}/core/base/_index.scss +0 -0
- /package/{scss → src/scss}/core/base/_normalize.scss +0 -0
- /package/{scss → src/scss}/core/base/_variables.scss +0 -0
- /package/{scss → src/scss}/core/color/_functions.scss +0 -0
- /package/{scss → src/scss}/core/color/_index.scss +0 -0
- /package/{scss → src/scss}/core/color/_variables.scss +0 -0
- /package/{scss → src/scss}/core/elevation/_mixins.scss +0 -0
- /package/{scss → src/scss}/core/elevation/_variables.scss +0 -0
- /package/{scss → src/scss}/core/size/_variables.scss +0 -0
- /package/{scss → src/scss}/core/spacing/_index.scss +0 -0
- /package/{scss → src/scss}/core/spacing/_variables.scss +0 -0
- /package/{scss → src/scss}/core/state/_mixins.scss +0 -0
- /package/{scss → src/scss}/core/state/_variables.scss +0 -0
- /package/{scss → src/scss}/core/typography/_index.scss +0 -0
- /package/{scss → src/scss}/core/typography/_mixins.scss +0 -0
- /package/{scss → src/scss}/core/typography/_variables.scss +0 -0
- /package/{scss → src/scss}/lumx.scss +0 -0
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import classnames from 'classnames';
|
|
2
|
-
import { Size } from '../../../constants/enums/index.js';
|
|
3
|
-
import '../../../constants/browser/index.js';
|
|
4
|
-
|
|
5
|
-
/** Set of valid AbstractSize values for runtime detection. */
|
|
6
|
-
const ABSTRACT_SIZES = new Set([Size.tiny, Size.regular, Size.medium, Size.big, Size.huge]);
|
|
7
|
-
function isAbstractSize(value) {
|
|
8
|
-
return typeof value === 'string' && ABSTRACT_SIZES.has(value);
|
|
9
|
-
}
|
|
10
|
-
function spacing(type, directionOrSize, size) {
|
|
11
|
-
// Resolve shorthand: spacing(type, size) => spacing(type, undefined, size)
|
|
12
|
-
const isShorthand = isAbstractSize(directionOrSize) || (directionOrSize === null && size === undefined);
|
|
13
|
-
const direction = isShorthand ? undefined : directionOrSize ?? undefined;
|
|
14
|
-
const resolvedSize = isShorthand ? directionOrSize : size;
|
|
15
|
-
let baseClass = `lumx-spacing-${type}`;
|
|
16
|
-
if (direction && direction !== 'all') {
|
|
17
|
-
baseClass = `${baseClass}-${direction}`;
|
|
18
|
-
}
|
|
19
|
-
if (resolvedSize) {
|
|
20
|
-
baseClass = `${baseClass}-${resolvedSize}`;
|
|
21
|
-
}
|
|
22
|
-
else if (resolvedSize === null) {
|
|
23
|
-
baseClass = `${baseClass}-none`;
|
|
24
|
-
}
|
|
25
|
-
return baseClass;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Returns a list of lumx classnames for the given types, directions and sizes. For example, for
|
|
29
|
-
* arguments [
|
|
30
|
-
* { type: 'padding', direction: 'right', size: 'regular'},
|
|
31
|
-
* { type: 'margin', direction: 'left', size: 'big'},
|
|
32
|
-
* ]
|
|
33
|
-
* it returns lumx-spacing-padding-right-regular lumx-spacing-margin-left-big
|
|
34
|
-
* @param spacingConfigs - Array of spacing configurations with direction and size
|
|
35
|
-
* @returns string
|
|
36
|
-
*/
|
|
37
|
-
const spacings = (spacingConfigs) => classnames(spacingConfigs.map((spa) => spacing(spa.type, spa.direction, spa.size)));
|
|
38
|
-
function margin(directionOrSize, size) {
|
|
39
|
-
if (isAbstractSize(directionOrSize) || (directionOrSize === null && size === undefined)) {
|
|
40
|
-
return spacing('margin', directionOrSize);
|
|
41
|
-
}
|
|
42
|
-
return spacing('margin', directionOrSize ?? undefined, size);
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Returns a list of lumx margin classnames for the given directions and sizes. For example, for
|
|
46
|
-
* arguments [
|
|
47
|
-
* { direction: 'right', size: 'regular'},
|
|
48
|
-
* { direction: 'left', size: 'big'},
|
|
49
|
-
* ]
|
|
50
|
-
* it returns lumx-spacing-margin-right-regular lumx-spacing-margin-left-big
|
|
51
|
-
* @param marginConfigs - Array of padding configurations with direction and size
|
|
52
|
-
* @returns string
|
|
53
|
-
*/
|
|
54
|
-
const margins = (marginConfigs) => spacings(marginConfigs.map(({ direction, size }) => ({ type: 'margin', direction, size })));
|
|
55
|
-
function padding(directionOrSize, size) {
|
|
56
|
-
if (isAbstractSize(directionOrSize) || (directionOrSize === null && size === undefined)) {
|
|
57
|
-
return spacing('padding', directionOrSize);
|
|
58
|
-
}
|
|
59
|
-
return spacing('padding', directionOrSize ?? undefined, size);
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Returns a list of lumx padding classnames for the given directions and sizes. For example, for
|
|
63
|
-
* arguments [
|
|
64
|
-
* { direction: 'right', size: 'regular'},
|
|
65
|
-
* { direction: 'left', size: 'big'},
|
|
66
|
-
* ]
|
|
67
|
-
* it returns lumx-spacing-padding-right-regular lumx-spacing-padding-left-big
|
|
68
|
-
* @param paddingConfigs - Array of padding configurations with direction and size
|
|
69
|
-
* @returns Combined padding classnames as a string
|
|
70
|
-
*/
|
|
71
|
-
const paddings = (paddingConfigs) => spacings(paddingConfigs.map(({ direction, size }) => ({ type: 'padding', direction, size })));
|
|
72
|
-
|
|
73
|
-
export { margin, margins, padding, paddings, spacing, spacings };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import '../../../constants/enums/index.js';
|
|
2
|
-
import { VISUALLY_HIDDEN } from '../../../constants/className/index.js';
|
|
3
|
-
import '../../../constants/browser/index.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Visually hidden class name.
|
|
7
|
-
* Used to hide elements from view but keep them readable from screen readers
|
|
8
|
-
*/
|
|
9
|
-
const visuallyHidden = () => VISUALLY_HIDDEN;
|
|
10
|
-
|
|
11
|
-
export { visuallyHidden };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Make sure the pressed key is the enter key before calling the callback.
|
|
3
|
-
*
|
|
4
|
-
* @param handler The handler to call on enter/return press.
|
|
5
|
-
* @return The decorated function.
|
|
6
|
-
*/
|
|
7
|
-
function onEnterPressed(handler) {
|
|
8
|
-
return (evt) => {
|
|
9
|
-
if (evt.key !== 'Enter') {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
handler(evt);
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Make sure the pressed key is the escape key before calling the callback.
|
|
17
|
-
*
|
|
18
|
-
* @param handler The handler to call on enter/return press.
|
|
19
|
-
* @return The decorated function.
|
|
20
|
-
*/
|
|
21
|
-
function onEscapePressed(handler) {
|
|
22
|
-
return (evt) => {
|
|
23
|
-
if (evt.key !== 'Escape') {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
handler(evt);
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Handle button key pressed (Enter + Space).
|
|
31
|
-
*
|
|
32
|
-
* @param handler The handler to call.
|
|
33
|
-
* @return The decorated function.
|
|
34
|
-
*/
|
|
35
|
-
function onButtonPressed(handler) {
|
|
36
|
-
return (evt) => {
|
|
37
|
-
if (evt.key !== 'Enter' && evt.key !== ' ') {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
handler(evt);
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { onButtonPressed, onEnterPressed, onEscapePressed };
|
package/js/utils/events/swipe.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks whether the browser support passive events.
|
|
3
|
-
* @see https://github.com/Modernizr/Modernizr/blob/6d56d814b9682843313b16060adb25a58d83a317/feature-detects/dom/passiveeventlisteners.js
|
|
4
|
-
*/
|
|
5
|
-
function isPassiveEventAvailable() {
|
|
6
|
-
let supportsPassiveOption = false;
|
|
7
|
-
try {
|
|
8
|
-
const opts = Object.defineProperty({}, 'passive', {
|
|
9
|
-
get() {
|
|
10
|
-
supportsPassiveOption = true;
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
window.addEventListener('testPassiveEventSupport', () => { }, opts);
|
|
14
|
-
window.removeEventListener('testPassiveEventSupport', () => { }, opts);
|
|
15
|
-
}
|
|
16
|
-
catch (e) {
|
|
17
|
-
// ignored
|
|
18
|
-
}
|
|
19
|
-
return supportsPassiveOption;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Detects horizontal swipe direction without blocking the browser scroll using passive event.
|
|
23
|
-
* @see http://javascriptkit.com/javatutors/touchevents2.shtml
|
|
24
|
-
* @see https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
|
|
25
|
-
*/
|
|
26
|
-
function detectHorizontalSwipe(touchSurface, handleSwipe) {
|
|
27
|
-
let startX;
|
|
28
|
-
let startY;
|
|
29
|
-
// Required min distance traveled to be considered swipe.
|
|
30
|
-
const threshold = 150;
|
|
31
|
-
// Maximum distance allowed at the same time in perpendicular direction.
|
|
32
|
-
const restraint = 150;
|
|
33
|
-
// Maximum time allowed to travel that distance.
|
|
34
|
-
const allowedTime = 300;
|
|
35
|
-
let elapsedTime;
|
|
36
|
-
let startTime;
|
|
37
|
-
let finished;
|
|
38
|
-
const onTouchStart = (evt) => {
|
|
39
|
-
const [touch] = Array.from(evt.changedTouches);
|
|
40
|
-
startX = touch.pageX;
|
|
41
|
-
startY = touch.pageY;
|
|
42
|
-
// Record time when finger first makes contact with surface.
|
|
43
|
-
startTime = new Date().getTime();
|
|
44
|
-
finished = false;
|
|
45
|
-
};
|
|
46
|
-
const onTouchMove = (evt) => {
|
|
47
|
-
if (finished) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
elapsedTime = new Date().getTime() - startTime;
|
|
51
|
-
if (elapsedTime > allowedTime) {
|
|
52
|
-
// Touch swipe too long to be considered.
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
const [touch] = Array.from(evt.changedTouches);
|
|
56
|
-
// Get horizontal dist traveled by finger while in contact with surface.
|
|
57
|
-
const distX = touch.pageX - startX;
|
|
58
|
-
// Get vertical dist traveled by finger while in contact with surface.
|
|
59
|
-
const distY = touch.pageY - startY;
|
|
60
|
-
if (!(Math.abs(distX) >= threshold && Math.abs(distY) <= restraint)) {
|
|
61
|
-
// Swipe is not horizontal.
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
// Swipe direction.
|
|
65
|
-
const direction = distX < 0 ? 'left' : 'right';
|
|
66
|
-
handleSwipe(direction);
|
|
67
|
-
finished = true;
|
|
68
|
-
};
|
|
69
|
-
// Activate passive event if possible for better scrolling performance.
|
|
70
|
-
const eventOptions = isPassiveEventAvailable() ? { passive: true } : false;
|
|
71
|
-
touchSurface.addEventListener('touchstart', onTouchStart, eventOptions);
|
|
72
|
-
touchSurface.addEventListener('touchmove', onTouchMove, eventOptions);
|
|
73
|
-
return () => {
|
|
74
|
-
touchSurface.removeEventListener('touchstart', onTouchStart, eventOptions);
|
|
75
|
-
touchSurface.removeEventListener('touchmove', onTouchMove, eventOptions);
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export { detectHorizontalSwipe };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** CSS selector listing all tabbable elements. */
|
|
2
|
-
export declare const TABBABLE_ELEMENTS_SELECTOR = "a[href], button, textarea, input:not([type=\"hidden\"]):not([hidden]), [tabindex]";
|
|
3
|
-
/**
|
|
4
|
-
* CSS selector matching elements that should be excluded from focus traversal.
|
|
5
|
-
*
|
|
6
|
-
* Note: `aria-disabled` is intentionally NOT in this list — per ARIA semantics, an `aria-disabled` element
|
|
7
|
-
* remains focusable (and discoverable by assistive tech). To remove an element from the tab order, use
|
|
8
|
-
* `tabindex="-1"` instead.
|
|
9
|
-
*/
|
|
10
|
-
export declare const DISABLED_SELECTOR = "[hidden], [tabindex=\"-1\"], [disabled]:not([disabled=\"false\"])";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get first and last elements focusable in an element.
|
|
3
|
-
*
|
|
4
|
-
* @param parentElement The element in which to search focusable elements.
|
|
5
|
-
* @return first and last focusable elements
|
|
6
|
-
*/
|
|
7
|
-
export declare function getFirstAndLastFocusable(parentElement: HTMLElement | ShadowRoot): {
|
|
8
|
-
first: HTMLElement;
|
|
9
|
-
last: HTMLElement;
|
|
10
|
-
} | {
|
|
11
|
-
first?: undefined;
|
|
12
|
-
last?: undefined;
|
|
13
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getFocusableElements(element: HTMLElement | ShadowRoot): HTMLElement[];
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { getFirstAndLastFocusable } from './getFirstAndLastFocusable';
|
|
2
|
-
export { getFocusableElements } from './getFocusableElements';
|
|
3
|
-
export { setupFocusTrap, type SetupFocusTrapOptions } from './setupFocusTrap';
|
|
4
|
-
export { TABBABLE_ELEMENTS_SELECTOR, DISABLED_SELECTOR } from './constants';
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export interface SetupFocusTrapOptions {
|
|
2
|
-
/** The element in which to trap the focus. */
|
|
3
|
-
focusZoneElement: HTMLElement;
|
|
4
|
-
/**
|
|
5
|
-
* The element to focus when the trap is activated.
|
|
6
|
-
* Falls back to the first focusable element inside the zone, then to the zone element itself.
|
|
7
|
-
*/
|
|
8
|
-
focusElement?: HTMLElement | null;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Trap 'Tab' focus switch inside the `focusZoneElement`.
|
|
12
|
-
*
|
|
13
|
-
* Setup behavior:
|
|
14
|
-
* 1. Focus `focusElement` if provided and contained in the zone.
|
|
15
|
-
* 2. Otherwise focus the first focusable descendant.
|
|
16
|
-
* 3. Otherwise focus the zone element itself (falling back to setting `tabindex="-1"` if needed) so that
|
|
17
|
-
* keyboard users (especially screen reader users) land inside the trapped region (e.g. an empty dialog).
|
|
18
|
-
*
|
|
19
|
-
* Tab key behavior:
|
|
20
|
-
* - With at least one focusable descendant: focus cycles between the first and last focusable in the zone.
|
|
21
|
-
* - With no focusable descendant: Tab is swallowed and focus is restored to the zone element itself.
|
|
22
|
-
*
|
|
23
|
-
* Multiple traps stack — only the latest one is active; previous traps re-enable when the latest is torn down.
|
|
24
|
-
*
|
|
25
|
-
* @param options Trap configuration.
|
|
26
|
-
* @param signal AbortSignal used to tear down the trap.
|
|
27
|
-
*/
|
|
28
|
-
export declare function setupFocusTrap(options: SetupFocusTrapOptions, signal: AbortSignal): void;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { FocusNavigationCallbacks } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Internal state for tracking the active (focused) item.
|
|
4
|
-
* Shared by both list and grid navigation implementations.
|
|
5
|
-
*/
|
|
6
|
-
export interface ActiveItemState {
|
|
7
|
-
/** Get the currently active item. */
|
|
8
|
-
readonly active: HTMLElement | null;
|
|
9
|
-
/** Set the active item (handles deactivate/activate callbacks). */
|
|
10
|
-
setActive(item: HTMLElement | null): void;
|
|
11
|
-
/** Clear the active item (deactivate + clear callbacks). */
|
|
12
|
-
clear(): void;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Create shared active item state with cleanup on abort.
|
|
16
|
-
*
|
|
17
|
-
* Callback invocation:
|
|
18
|
-
* - `setActive(item)`: calls `onDeactivate(previous)` then `onActivate(item)`.
|
|
19
|
-
* - `clear()`: calls `onDeactivate(current)` then `onClear()`.
|
|
20
|
-
* - On `signal.abort()`: same as `clear()`.
|
|
21
|
-
*
|
|
22
|
-
* @param callbacks Focus state change callbacks.
|
|
23
|
-
* @param signal AbortSignal for cleanup.
|
|
24
|
-
* @param initialItem Optional item to silently pre-select on creation (no callbacks fired).
|
|
25
|
-
*/
|
|
26
|
-
export declare function createActiveItemState(callbacks: FocusNavigationCallbacks, signal: AbortSignal, initialItem?: HTMLElement | null): ActiveItemState;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { FocusNavigationCallbacks, FocusNavigationController, GridNavigationOptions } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Create a focus navigation controller for a 2D grid.
|
|
4
|
-
*
|
|
5
|
-
* Resolves rows and cells by querying the DOM and commits focus by updating the
|
|
6
|
-
* active-item state (which fires {@link FocusNavigationCallbacks}).
|
|
7
|
-
*
|
|
8
|
-
* Supports Up/Down between rows (with column memory) and Left/Right between cells
|
|
9
|
-
* (with wrapping across rows).
|
|
10
|
-
*
|
|
11
|
-
* @param options Grid navigation options (container, rowSelector, cellSelector, wrap).
|
|
12
|
-
* @param callbacks Callbacks for focus state changes.
|
|
13
|
-
* @param signal AbortSignal for cleanup.
|
|
14
|
-
* @returns FocusNavigationController instance.
|
|
15
|
-
*/
|
|
16
|
-
export declare function createGridFocusNavigation(options: GridNavigationOptions, callbacks: FocusNavigationCallbacks, signal: AbortSignal): FocusNavigationController;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { FocusNavigationCallbacks, ListFocusNavigationController, ListNavigationOptions } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Create a focus navigation controller for a 1D list.
|
|
4
|
-
*
|
|
5
|
-
* This controller is **stateless** — it does not maintain an internal reference to
|
|
6
|
-
* the active item. Instead it reads the active item from the DOM each time via the
|
|
7
|
-
* `getActiveItem` callback provided in the options. This avoids any desync between
|
|
8
|
-
* the controller's internal state and the actual DOM.
|
|
9
|
-
*
|
|
10
|
-
* @param options List navigation options (container, itemSelector, direction, wrap, getActiveItem).
|
|
11
|
-
* @param callbacks Callbacks for focus state changes.
|
|
12
|
-
* @param signal AbortSignal for cleanup.
|
|
13
|
-
* @returns ListFocusNavigationController instance.
|
|
14
|
-
*/
|
|
15
|
-
export declare function createListFocusNavigation(options: ListNavigationOptions, callbacks: FocusNavigationCallbacks, signal: AbortSignal): ListFocusNavigationController;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export type { FocusNavigationCallbacks, FocusNavigationController, FocusNavigationSelectors, GridNavigationOptions, ListFocusNavigationController, ListFocusNavigationSelectors, ListNavigationOptions, } from './types';
|
|
2
|
-
export type { RovingTabIndexOptions } from './setupRovingTabIndex';
|
|
3
|
-
export { createListFocusNavigation } from './createListFocusNavigation';
|
|
4
|
-
export { createGridFocusNavigation } from './createGridFocusNavigation';
|
|
5
|
-
export { setupRovingTabIndex } from './setupRovingTabIndex';
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { FocusNavigationController } from './types';
|
|
2
|
-
/** Options for {@link setupRovingTabIndex}. */
|
|
3
|
-
export interface RovingTabIndexOptions {
|
|
4
|
-
/** Container element holding the focusable items. */
|
|
5
|
-
container: HTMLElement;
|
|
6
|
-
/** CSS selector identifying focusable items within the container. */
|
|
7
|
-
itemSelector: string;
|
|
8
|
-
/**
|
|
9
|
-
* Navigation axis — determines which arrow keys navigate.
|
|
10
|
-
* - `'horizontal'` (default): Left/Right navigate.
|
|
11
|
-
* - `'vertical'`: Up/Down navigate.
|
|
12
|
-
*/
|
|
13
|
-
direction?: 'horizontal' | 'vertical';
|
|
14
|
-
/** CSS selector matching disabled items (skipped during navigation). */
|
|
15
|
-
itemDisabledSelector?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Attribute name indicating the selected item (e.g. `'aria-selected'`, `'aria-checked'`).
|
|
18
|
-
* When set, the roving tabindex will observe changes to this attribute and keep
|
|
19
|
-
* `tabindex="0"` in sync with the item whose attribute value is `"true"`.
|
|
20
|
-
* Default: `'aria-selected'`.
|
|
21
|
-
*/
|
|
22
|
-
itemSelectedAttr?: string;
|
|
23
|
-
/** Called when an item receives focus via keyboard navigation. */
|
|
24
|
-
onItemFocused?: (item: HTMLElement) => void;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Set up the roving tabindex pattern on a container element.
|
|
28
|
-
*
|
|
29
|
-
* - Keyboard navigation (Arrow keys, Home, End)
|
|
30
|
-
* - tabindex management (`0` on active, `-1` on others)
|
|
31
|
-
* - Mount normalization (single-tabstop invariant)
|
|
32
|
-
* - DOM mutation handling via MutationObserver:
|
|
33
|
-
* removal recovery, insertion normalization, disabled-state changes
|
|
34
|
-
*
|
|
35
|
-
* Torn down when `signal` is aborted.
|
|
36
|
-
*/
|
|
37
|
-
export declare function setupRovingTabIndex(options: RovingTabIndexOptions, signal: AbortSignal): FocusNavigationController;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
export interface FocusNavigationCallbacks {
|
|
2
|
-
onActivate(item: HTMLElement): void;
|
|
3
|
-
onDeactivate(item: HTMLElement): void;
|
|
4
|
-
onClear?(): void;
|
|
5
|
-
}
|
|
6
|
-
export interface ListNavigationOptions {
|
|
7
|
-
type: 'list';
|
|
8
|
-
container: HTMLElement;
|
|
9
|
-
itemSelector: string;
|
|
10
|
-
direction?: 'vertical' | 'horizontal';
|
|
11
|
-
wrap?: boolean;
|
|
12
|
-
itemDisabledSelector?: string;
|
|
13
|
-
getActiveItem?: () => HTMLElement | null;
|
|
14
|
-
}
|
|
15
|
-
export interface GridNavigationOptions {
|
|
16
|
-
type: 'grid';
|
|
17
|
-
container: HTMLElement;
|
|
18
|
-
rowSelector: string;
|
|
19
|
-
cellSelector: string;
|
|
20
|
-
wrap?: boolean;
|
|
21
|
-
}
|
|
22
|
-
/** Pure, side-effect-free selection layer for focus navigation. */
|
|
23
|
-
export interface FocusNavigationSelectors {
|
|
24
|
-
readonly activeItem: HTMLElement | null;
|
|
25
|
-
readonly hasNavigableItems: boolean;
|
|
26
|
-
getFirst(): HTMLElement | null;
|
|
27
|
-
getLast(): HTMLElement | null;
|
|
28
|
-
getMatching(predicate: (item: HTMLElement) => boolean): HTMLElement | null;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* List-specific selection layer.
|
|
32
|
-
* Adds {@link findNearestEnabled} and the combined enabled-item selector string.
|
|
33
|
-
*/
|
|
34
|
-
export interface ListFocusNavigationSelectors extends FocusNavigationSelectors {
|
|
35
|
-
readonly enabledItemSelector: string;
|
|
36
|
-
findNearestEnabled(anchor: Node): HTMLElement | null;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Focus navigation controller — the mover layer. Every method commits focus via
|
|
40
|
-
* {@link FocusNavigationCallbacks}. The pure read layer lives behind {@link selectors}.
|
|
41
|
-
*
|
|
42
|
-
* To move focus to the first/last navigable item:
|
|
43
|
-
* `goTo((s) => s.getFirst())` / `goTo((s) => s.getLast())`.
|
|
44
|
-
*/
|
|
45
|
-
export interface FocusNavigationController<Selectors extends FocusNavigationSelectors = FocusNavigationSelectors> {
|
|
46
|
-
readonly type: 'list' | 'grid';
|
|
47
|
-
readonly selectors: Selectors;
|
|
48
|
-
goToOffset(offset: number): boolean;
|
|
49
|
-
clear(): void;
|
|
50
|
-
goUp(): boolean;
|
|
51
|
-
goDown(): boolean;
|
|
52
|
-
goLeft(): boolean;
|
|
53
|
-
goRight(): boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Navigate via a resolver, deferring when the target is not yet in the DOM.
|
|
56
|
-
* ```ts
|
|
57
|
-
* nav.goTo((sel) => sel.getMatching(isSelected) ?? sel.getFirst());
|
|
58
|
-
* ```
|
|
59
|
-
*/
|
|
60
|
-
goTo(resolve: (selectors: Selectors) => HTMLElement | null): boolean;
|
|
61
|
-
/**
|
|
62
|
-
* Replay the pending navigation intent stored by {@link goTo}.
|
|
63
|
-
* No-op when nothing is pending.
|
|
64
|
-
*/
|
|
65
|
-
flushPendingNavigation(): void;
|
|
66
|
-
}
|
|
67
|
-
export interface ListFocusNavigationController extends FocusNavigationController<ListFocusNavigationSelectors> {
|
|
68
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type Listener = {
|
|
2
|
-
enable(): void;
|
|
3
|
-
disable(): void;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Keep track of listeners, only the last registered listener gets activated at any point (previously registered
|
|
7
|
-
* listener are disabled).
|
|
8
|
-
* When a listener gets unregistered, the previously registered listener gets enabled again.
|
|
9
|
-
*/
|
|
10
|
-
export declare function makeListenerTowerContext(): {
|
|
11
|
-
register(listener: Listener): void;
|
|
12
|
-
unregister(listener: Listener): void;
|
|
13
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { getCurrentLocale } from './getCurrentLocale';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Selector } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* Find the option whose id matches the given value.
|
|
4
|
-
*
|
|
5
|
-
* Used by Select* wrappers to resolve a selection event (which carries the option id
|
|
6
|
-
* as `selectedOption.value`) back to the original option object.
|
|
7
|
-
*
|
|
8
|
-
* @param options The list of options.
|
|
9
|
-
* @param getOptionId Selector returning the option id (matches `<Combobox.Option value>`).
|
|
10
|
-
* @param id The id to match against.
|
|
11
|
-
* @return The matching option, or `undefined` if none is found / inputs are nullish.
|
|
12
|
-
*/
|
|
13
|
-
export declare function findOptionById<O>(options: readonly O[] | undefined, getOptionId: Selector<O> | undefined, id: unknown): O | undefined;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Selector } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* Get the display name for a single option value.
|
|
4
|
-
*
|
|
5
|
-
* Resolves the option's display name by trying `getOptionName` first,
|
|
6
|
-
* then falling back to `getOptionId`, returning `''` for nullish values.
|
|
7
|
-
*/
|
|
8
|
-
export declare function getOptionDisplayName<O>(value: O | undefined, getOptionName?: Selector<O, string | undefined | null>, getOptionId?: Selector<O>): string;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { JSXElement } from '../../types';
|
|
2
|
-
import type { BaseSelectComponents, RenderSelectOptionsProps } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Render options as ComboboxOption elements.
|
|
5
|
-
* Framework-specific components are passed as a second argument.
|
|
6
|
-
*/
|
|
7
|
-
export declare function renderSelectOptions<O>(props: RenderSelectOptionsProps<O>, components: BaseSelectComponents): JSXElement;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { Selector } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* Compute the next selection state after a user toggles an option.
|
|
4
|
-
*
|
|
5
|
-
* Single-mode behaviour (`isMultiple=false`):
|
|
6
|
-
* - Returns the option matched by id (or `undefined` if none matches the id —
|
|
7
|
-
* e.g. when the consumer triggers a custom action via `beforeOptions`).
|
|
8
|
-
*
|
|
9
|
-
* Multi-mode behaviour (`isMultiple=true`):
|
|
10
|
-
* - If the option is already in the current value array → returns a new array with it removed.
|
|
11
|
-
* - Otherwise → returns a new array with the option appended.
|
|
12
|
-
* - If the id matches no option in `options` (e.g. custom actions), the current array is returned unchanged.
|
|
13
|
-
*
|
|
14
|
-
* Pure function: never mutates `currentValue`.
|
|
15
|
-
*
|
|
16
|
-
* @param options The list of options.
|
|
17
|
-
* @param getOptionId Selector returning the option id (matches `<Combobox.Option value>`).
|
|
18
|
-
* @param currentValue Current selection (option, array of options, or undefined).
|
|
19
|
-
* @param selectedOptionId Id of the option the user just selected.
|
|
20
|
-
* @param isMultiple Whether to use multi-select semantics.
|
|
21
|
-
* @return The new selection — `O | undefined` in single mode, `O[]` in multi mode.
|
|
22
|
-
*/
|
|
23
|
-
export declare function toggleSelection<O>(options: readonly O[] | undefined, getOptionId: Selector<O> | undefined, currentValue: O | O[] | undefined, selectedOptionId: unknown, isMultiple: boolean): O | O[] | undefined;
|