@vibe/core 3.77.1-alpha-eb809.0 → 3.77.1-alpha-45c3a.0
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/components/EditableTypography/EditableTypography.d.ts +4 -0
- package/dist/components/dialog/dist/Dialog/Dialog.js +1 -1
- package/dist/components/dialog/dist/Dialog/Dialog.js.map +1 -1
- package/dist/components/layers/dist/LayerProvider/LayerContext.js.map +1 -0
- package/dist/components/layers/dist/LayerProvider/LayerProvider.js.map +1 -0
- package/dist/metadata.json +18 -32
- package/dist/mocked_classnames/base/dist/BaseInput/BaseInput.js +2 -0
- package/dist/mocked_classnames/base/dist/BaseInput/BaseInput.js.map +1 -0
- package/dist/mocked_classnames/base/dist/BaseInput/BaseInput.module.scss.js +2 -0
- package/dist/mocked_classnames/base/dist/BaseInput/BaseInput.module.scss.js.map +1 -0
- package/dist/mocked_classnames/base/dist/_virtual/_tslib.js +2 -0
- package/dist/mocked_classnames/base/dist/_virtual/_tslib.js.map +1 -0
- package/dist/mocked_classnames/components/EditableTypography/EditableTypography.d.ts +4 -0
- package/dist/mocked_classnames/components/button/dist/Button/Button.js +2 -0
- package/dist/mocked_classnames/components/button/dist/Button/Button.js.map +1 -0
- package/dist/mocked_classnames/components/button/dist/Button/Button.module.scss.js +2 -0
- package/dist/mocked_classnames/components/button/dist/Button/Button.module.scss.js.map +1 -0
- package/dist/mocked_classnames/components/button/dist/Button/ButtonConstants.js +2 -0
- package/dist/mocked_classnames/components/button/dist/Button/ButtonConstants.js.map +1 -0
- package/dist/mocked_classnames/components/button/dist/Button/helper/dom-helpers.js +2 -0
- package/dist/mocked_classnames/components/button/dist/Button/helper/dom-helpers.js.map +1 -0
- package/dist/mocked_classnames/components/button/dist/Button/helper/useButtonLoading.js +2 -0
- package/dist/mocked_classnames/components/button/dist/Button/helper/useButtonLoading.js.map +1 -0
- package/dist/mocked_classnames/components/dialog/dist/Dialog/Dialog.js +2 -0
- package/dist/mocked_classnames/components/dialog/dist/Dialog/Dialog.js.map +1 -0
- package/dist/mocked_classnames/components/dialog/dist/Dialog/Dialog.module.scss.js +2 -0
- package/dist/mocked_classnames/components/dialog/dist/Dialog/Dialog.module.scss.js.map +1 -0
- package/dist/mocked_classnames/components/dialog/dist/Dialog/DialogConstants.js +2 -0
- package/dist/mocked_classnames/components/dialog/dist/Dialog/DialogConstants.js.map +1 -0
- package/dist/mocked_classnames/components/dialog/dist/Dialog/DialogContent/DialogContent.js +2 -0
- package/dist/mocked_classnames/components/dialog/dist/Dialog/DialogContent/DialogContent.js.map +1 -0
- package/dist/mocked_classnames/components/dialog/dist/Dialog/DialogContent/DialogContent.module.scss.js +2 -0
- package/dist/mocked_classnames/components/dialog/dist/Dialog/DialogContent/DialogContent.module.scss.js.map +1 -0
- package/dist/mocked_classnames/components/dialog/dist/Dialog/DialogContent/useDisableScroll.js +2 -0
- package/dist/mocked_classnames/components/dialog/dist/Dialog/DialogContent/useDisableScroll.js.map +1 -0
- package/dist/mocked_classnames/components/dialog/dist/Dialog/modifiers/observeContentResizeModifier.js +2 -0
- package/dist/mocked_classnames/components/dialog/dist/Dialog/modifiers/observeContentResizeModifier.js.map +1 -0
- package/dist/mocked_classnames/components/dialog/dist/Dialog/modifiers/observeReferenceResizeModifier.js +2 -0
- package/dist/mocked_classnames/components/dialog/dist/Dialog/modifiers/observeReferenceResizeModifier.js.map +1 -0
- package/dist/mocked_classnames/components/dialog/dist/Dialog/useForceUpdate.js +2 -0
- package/dist/mocked_classnames/components/dialog/dist/Dialog/useForceUpdate.js.map +1 -0
- package/dist/mocked_classnames/components/dialog/dist/Dialog/usePopover.js +2 -0
- package/dist/mocked_classnames/components/dialog/dist/Dialog/usePopover.js.map +1 -0
- package/dist/mocked_classnames/components/dialog/dist/DialogContentContainer/DialogContentContainer.js +2 -0
- package/dist/mocked_classnames/components/dialog/dist/DialogContentContainer/DialogContentContainer.js.map +1 -0
- package/dist/mocked_classnames/components/dialog/dist/DialogContentContainer/DialogContentContainer.module.scss.js +2 -0
- package/dist/mocked_classnames/components/dialog/dist/DialogContentContainer/DialogContentContainer.module.scss.js.map +1 -0
- package/dist/mocked_classnames/components/dialog/dist/Refable/Refable.js +2 -0
- package/dist/mocked_classnames/components/dialog/dist/Refable/Refable.js.map +1 -0
- package/dist/mocked_classnames/components/dialog/dist/_virtual/_tslib.js +2 -0
- package/dist/mocked_classnames/components/dialog/dist/_virtual/_tslib.js.map +1 -0
- package/dist/mocked_classnames/components/icon/dist/Icon/CustomSvgIcon/CustomSvgIcon.js +2 -0
- package/dist/mocked_classnames/components/icon/dist/Icon/CustomSvgIcon/CustomSvgIcon.js.map +1 -0
- package/dist/mocked_classnames/components/icon/dist/Icon/FontIcon/FontIcon.js +2 -0
- package/dist/mocked_classnames/components/icon/dist/Icon/FontIcon/FontIcon.js.map +1 -0
- package/dist/mocked_classnames/components/icon/dist/Icon/Icon.js +2 -0
- package/dist/mocked_classnames/components/icon/dist/Icon/Icon.js.map +1 -0
- package/dist/mocked_classnames/components/icon/dist/Icon/Icon.module.scss.js +2 -0
- package/dist/mocked_classnames/components/icon/dist/Icon/Icon.module.scss.js.map +1 -0
- package/dist/mocked_classnames/components/icon/dist/Icon/constants.js +2 -0
- package/dist/mocked_classnames/components/icon/dist/Icon/constants.js.map +1 -0
- package/dist/mocked_classnames/components/icon/dist/Icon/hooks/useIconProps.js +2 -0
- package/dist/mocked_classnames/components/icon/dist/Icon/hooks/useIconProps.js.map +1 -0
- package/dist/mocked_classnames/components/icon/dist/Icon/hooks/useIconScreenReaderAccessProps.js +2 -0
- package/dist/mocked_classnames/components/icon/dist/Icon/hooks/useIconScreenReaderAccessProps.js.map +1 -0
- package/dist/mocked_classnames/components/layers/dist/LayerProvider/LayerContext.js +2 -0
- package/dist/mocked_classnames/components/layers/dist/LayerProvider/LayerContext.js.map +1 -0
- package/dist/mocked_classnames/components/layers/dist/LayerProvider/LayerProvider.js +2 -0
- package/dist/mocked_classnames/components/layers/dist/LayerProvider/LayerProvider.js.map +1 -0
- package/dist/mocked_classnames/components/loader/dist/Loader/Loader.js +2 -0
- package/dist/mocked_classnames/components/loader/dist/Loader/Loader.js.map +1 -0
- package/dist/mocked_classnames/components/loader/dist/Loader/Loader.module.scss.js +2 -0
- package/dist/mocked_classnames/components/loader/dist/Loader/Loader.module.scss.js.map +1 -0
- package/dist/mocked_classnames/components/loader/dist/Loader/LoaderConstants.js +2 -0
- package/dist/mocked_classnames/components/loader/dist/Loader/LoaderConstants.js.map +1 -0
- package/dist/mocked_classnames/hooks/dist/useClickOutside/index.js +2 -0
- package/dist/mocked_classnames/hooks/dist/useClickOutside/index.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/_virtual/_tslib.js +2 -0
- package/dist/mocked_classnames/icons/dist/_virtual/_tslib.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/react/AddSmall.js +2 -0
- package/dist/mocked_classnames/icons/dist/react/AddSmall.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/react/Alert.js +2 -0
- package/dist/mocked_classnames/icons/dist/react/Alert.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/react/Check.js +2 -0
- package/dist/mocked_classnames/icons/dist/react/Check.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/react/CloseMedium.js +2 -0
- package/dist/mocked_classnames/icons/dist/react/CloseMedium.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/react/CloseSmall.js +2 -0
- package/dist/mocked_classnames/icons/dist/react/CloseSmall.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/react/DropdownChevronDown.js +2 -0
- package/dist/mocked_classnames/icons/dist/react/DropdownChevronDown.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/react/DropdownChevronRight.js +2 -0
- package/dist/mocked_classnames/icons/dist/react/DropdownChevronRight.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/react/DropdownChevronUp.js +2 -0
- package/dist/mocked_classnames/icons/dist/react/DropdownChevronUp.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/react/Favorite.js +2 -0
- package/dist/mocked_classnames/icons/dist/react/Favorite.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/react/Info.js +2 -0
- package/dist/mocked_classnames/icons/dist/react/Info.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/react/Menu.js +2 -0
- package/dist/mocked_classnames/icons/dist/react/Menu.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/react/MoveArrowLeft.js +2 -0
- package/dist/mocked_classnames/icons/dist/react/MoveArrowLeft.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/react/MoveArrowRight.js +2 -0
- package/dist/mocked_classnames/icons/dist/react/MoveArrowRight.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/react/NavigationChevronLeft.js +2 -0
- package/dist/mocked_classnames/icons/dist/react/NavigationChevronLeft.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/react/NavigationChevronRight.js +2 -0
- package/dist/mocked_classnames/icons/dist/react/NavigationChevronRight.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/react/NoColor.js +2 -0
- package/dist/mocked_classnames/icons/dist/react/NoColor.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/react/Remove.js +2 -0
- package/dist/mocked_classnames/icons/dist/react/Remove.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/react/Search.js +2 -0
- package/dist/mocked_classnames/icons/dist/react/Search.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/react/Sort.js +2 -0
- package/dist/mocked_classnames/icons/dist/react/Sort.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/react/SortAscending.js +2 -0
- package/dist/mocked_classnames/icons/dist/react/SortAscending.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/react/SortDescending.js +2 -0
- package/dist/mocked_classnames/icons/dist/react/SortDescending.js.map +1 -0
- package/dist/mocked_classnames/icons/dist/react/Warning.js +2 -0
- package/dist/mocked_classnames/icons/dist/react/Warning.js.map +1 -0
- package/dist/mocked_classnames/shared/dist/constants/keyCodes.js +2 -0
- package/dist/mocked_classnames/shared/dist/constants/keyCodes.js.map +1 -0
- package/dist/mocked_classnames/shared/dist/constants/sizes.js +2 -0
- package/dist/mocked_classnames/shared/dist/constants/sizes.js.map +1 -0
- package/dist/mocked_classnames/shared/dist/hooks/ssr/useIsMounted.js +2 -0
- package/dist/mocked_classnames/shared/dist/hooks/ssr/useIsMounted.js.map +1 -0
- package/dist/mocked_classnames/shared/dist/hooks/ssr/useIsomorphicLayoutEffect.js +2 -0
- package/dist/mocked_classnames/shared/dist/hooks/ssr/useIsomorphicLayoutEffect.js.map +1 -0
- package/dist/mocked_classnames/shared/dist/hooks/useEventListener.js +2 -0
- package/dist/mocked_classnames/shared/dist/hooks/useEventListener.js.map +1 -0
- package/dist/mocked_classnames/shared/dist/hooks/useKeyEvent.js +2 -0
- package/dist/mocked_classnames/shared/dist/hooks/useKeyEvent.js.map +1 -0
- package/dist/mocked_classnames/shared/dist/hooks/useMergeRef.js +2 -0
- package/dist/mocked_classnames/shared/dist/hooks/useMergeRef.js.map +1 -0
- package/dist/mocked_classnames/shared/dist/tests/constants.js +2 -0
- package/dist/mocked_classnames/shared/dist/tests/constants.js.map +1 -0
- package/dist/mocked_classnames/shared/dist/tests/test-ids-utils.js +2 -0
- package/dist/mocked_classnames/shared/dist/tests/test-ids-utils.js.map +1 -0
- package/dist/mocked_classnames/shared/dist/types/withStaticProps.js +2 -0
- package/dist/mocked_classnames/shared/dist/types/withStaticProps.js.map +1 -0
- package/dist/mocked_classnames/shared/dist/utils/dom-utils.js +2 -0
- package/dist/mocked_classnames/shared/dist/utils/dom-utils.js.map +1 -0
- package/dist/mocked_classnames/shared/dist/utils/function-utils.js +2 -0
- package/dist/mocked_classnames/shared/dist/utils/function-utils.js.map +1 -0
- package/dist/mocked_classnames/shared/dist/utils/screenReaderAccessHelper.js +2 -0
- package/dist/mocked_classnames/shared/dist/utils/screenReaderAccessHelper.js.map +1 -0
- package/dist/mocked_classnames/shared/dist/utils/ssr-utils.js +2 -0
- package/dist/mocked_classnames/shared/dist/utils/ssr-utils.js.map +1 -0
- package/dist/mocked_classnames/shared/dist/utils/typesciptCssModulesHelper.js +2 -0
- package/dist/mocked_classnames/shared/dist/utils/typesciptCssModulesHelper.js.map +1 -0
- package/dist/mocked_classnames/src/components/AlertBanner/AlertBanner.js +1 -1
- package/dist/mocked_classnames/src/components/AlertBanner/AlertBanner.js.map +1 -1
- package/dist/mocked_classnames/src/components/AlertBanner/AlertBannerButton/AlertBannerButton.js +1 -1
- package/dist/mocked_classnames/src/components/AlertBanner/AlertBannerButton/AlertBannerButton.js.map +1 -1
- package/dist/mocked_classnames/src/components/AttentionBox/AttentionBox.js +1 -1
- package/dist/mocked_classnames/src/components/AttentionBox/AttentionBox.js.map +1 -1
- package/dist/mocked_classnames/src/components/Avatar/AvatarBadge.js +1 -1
- package/dist/mocked_classnames/src/components/Avatar/AvatarBadge.js.map +1 -1
- package/dist/mocked_classnames/src/components/Avatar/AvatarContent.js +1 -1
- package/dist/mocked_classnames/src/components/Avatar/AvatarContent.js.map +1 -1
- package/dist/mocked_classnames/src/components/BaseListItem/utils.js +1 -1
- package/dist/mocked_classnames/src/components/BaseListItem/utils.js.map +1 -1
- package/dist/mocked_classnames/src/components/BreadcrumbsBar/BreadcrumbsBar.js +1 -1
- package/dist/mocked_classnames/src/components/BreadcrumbsBar/BreadcrumbsBar.js.map +1 -1
- package/dist/mocked_classnames/src/components/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/mocked_classnames/src/components/ButtonGroup/ButtonGroup.js.map +1 -1
- package/dist/mocked_classnames/src/components/ButtonGroup/ButtonWrapper.js +1 -1
- package/dist/mocked_classnames/src/components/ButtonGroup/ButtonWrapper.js.map +1 -1
- package/dist/mocked_classnames/src/components/Checkbox/Checkbox.js +1 -1
- package/dist/mocked_classnames/src/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/mocked_classnames/src/components/Chips/Chips.js +1 -1
- package/dist/mocked_classnames/src/components/Chips/Chips.js.map +1 -1
- package/dist/mocked_classnames/src/components/ColorPicker/ColorPicker.js +1 -1
- package/dist/mocked_classnames/src/components/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/mocked_classnames/src/components/ColorPicker/components/ColorPickerContent/ColorPickerClearButton.js +1 -1
- package/dist/mocked_classnames/src/components/ColorPicker/components/ColorPickerContent/ColorPickerClearButton.js.map +1 -1
- package/dist/mocked_classnames/src/components/ColorPicker/components/ColorPickerContent/ColorPickerContent.js +1 -1
- package/dist/mocked_classnames/src/components/ColorPicker/components/ColorPickerContent/ColorPickerContent.js.map +1 -1
- package/dist/mocked_classnames/src/components/ColorPicker/components/ColorPickerItemComponent/ColorPickerItemComponent.js +1 -1
- package/dist/mocked_classnames/src/components/ColorPicker/components/ColorPickerItemComponent/ColorPickerItemComponent.js.map +1 -1
- package/dist/mocked_classnames/src/components/Combobox/Combobox.js +1 -1
- package/dist/mocked_classnames/src/components/Combobox/Combobox.js.map +1 -1
- package/dist/mocked_classnames/src/components/Combobox/components/ComboboxOption/ComboboxOption.js +1 -1
- package/dist/mocked_classnames/src/components/Combobox/components/ComboboxOption/ComboboxOption.js.map +1 -1
- package/dist/mocked_classnames/src/components/DatePicker/DateNavigationItem/DateNavigationItem.js +1 -1
- package/dist/mocked_classnames/src/components/DatePicker/DateNavigationItem/DateNavigationItem.js.map +1 -1
- package/dist/mocked_classnames/src/components/DatePicker/DatePickerHeader/DatePickerHeader.js +1 -1
- package/dist/mocked_classnames/src/components/DatePicker/DatePickerHeader/DatePickerHeader.js.map +1 -1
- package/dist/mocked_classnames/src/components/DatePicker/YearPicker/YearsList.js +1 -1
- package/dist/mocked_classnames/src/components/DatePicker/YearPicker/YearsList.js.map +1 -1
- package/dist/mocked_classnames/src/components/Dropdown/Dropdown.js +1 -1
- package/dist/mocked_classnames/src/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/mocked_classnames/src/components/Dropdown/components/ChildrenContent/ChildrenContent.js +1 -1
- package/dist/mocked_classnames/src/components/Dropdown/components/ChildrenContent/ChildrenContent.js.map +1 -1
- package/dist/mocked_classnames/src/components/Dropdown/components/ClearIndicator/ClearIndicator.js +1 -1
- package/dist/mocked_classnames/src/components/Dropdown/components/ClearIndicator/ClearIndicator.js.map +1 -1
- package/dist/mocked_classnames/src/components/Dropdown/components/DropdownIndicator/DropdownIndicator.js +1 -1
- package/dist/mocked_classnames/src/components/Dropdown/components/DropdownIndicator/DropdownIndicator.js.map +1 -1
- package/dist/mocked_classnames/src/components/Dropdown/components/MultiValueContainer/MultiValueContainer.js +1 -1
- package/dist/mocked_classnames/src/components/Dropdown/components/MultiValueContainer/MultiValueContainer.js.map +1 -1
- package/dist/mocked_classnames/src/components/EditableTypography/EditableTypography.js +1 -1
- package/dist/mocked_classnames/src/components/EditableTypography/EditableTypography.js.map +1 -1
- package/dist/mocked_classnames/src/components/EmptyState/EmptyState.js +1 -1
- package/dist/mocked_classnames/src/components/EmptyState/EmptyState.js.map +1 -1
- package/dist/mocked_classnames/src/components/ExpandCollapse/ExpandCollapse.js +1 -1
- package/dist/mocked_classnames/src/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
- package/dist/mocked_classnames/src/components/FieldLabel/FieldLabel.js +1 -1
- package/dist/mocked_classnames/src/components/FieldLabel/FieldLabel.js.map +1 -1
- package/dist/mocked_classnames/src/components/IconButton/IconButton.js +1 -1
- package/dist/mocked_classnames/src/components/IconButton/IconButton.js.map +1 -1
- package/dist/mocked_classnames/src/components/Info/Info.js +1 -1
- package/dist/mocked_classnames/src/components/Info/Info.js.map +1 -1
- package/dist/mocked_classnames/src/components/Info/components/InfoDialogContent/InfoDialogContent.js +1 -1
- package/dist/mocked_classnames/src/components/Info/components/InfoDialogContent/InfoDialogContent.js.map +1 -1
- package/dist/mocked_classnames/src/components/LegacyModal/LegacyModal.js +1 -1
- package/dist/mocked_classnames/src/components/LegacyModal/LegacyModal.js.map +1 -1
- package/dist/mocked_classnames/src/components/LegacyModal/LegacyModalFooter/LegacyModalFooterButtons/LegacyModalFooterButtons.js +1 -1
- package/dist/mocked_classnames/src/components/LegacyModal/LegacyModalFooter/LegacyModalFooterButtons/LegacyModalFooterButtons.js.map +1 -1
- package/dist/mocked_classnames/src/components/LegacyModal/LegacyModalHeader/LegacyModalHeader.js +1 -1
- package/dist/mocked_classnames/src/components/LegacyModal/LegacyModalHeader/LegacyModalHeader.js.map +1 -1
- package/dist/mocked_classnames/src/components/Link/Link.js +1 -1
- package/dist/mocked_classnames/src/components/Link/Link.js.map +1 -1
- package/dist/mocked_classnames/src/components/ListItem/ListItem.js +1 -1
- package/dist/mocked_classnames/src/components/ListItem/ListItem.js.map +1 -1
- package/dist/mocked_classnames/src/components/ListItemIcon/ListItemIcon.js +1 -1
- package/dist/mocked_classnames/src/components/ListItemIcon/ListItemIcon.js.map +1 -1
- package/dist/mocked_classnames/src/components/Menu/Menu/Menu.js +1 -1
- package/dist/mocked_classnames/src/components/Menu/MenuItem/MenuItem.js +1 -1
- package/dist/mocked_classnames/src/components/Menu/MenuItem/MenuItem.js.map +1 -1
- package/dist/mocked_classnames/src/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.js +1 -1
- package/dist/mocked_classnames/src/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.js.map +1 -1
- package/dist/mocked_classnames/src/components/Menu/MenuItem/components/MenuItemSubMenu/MenuItemSubMenu.js +1 -1
- package/dist/mocked_classnames/src/components/Menu/MenuItem/components/MenuItemSubMenu/MenuItemSubMenu.js.map +1 -1
- package/dist/mocked_classnames/src/components/Menu/MenuItem/components/MenuItemSubMenuIcon/MenuItemSubMenuIcon.js +1 -1
- package/dist/mocked_classnames/src/components/Menu/MenuItem/components/MenuItemSubMenuIcon/MenuItemSubMenuIcon.js.map +1 -1
- package/dist/mocked_classnames/src/components/Menu/MenuItemButton/MenuItemButton.js +1 -1
- package/dist/mocked_classnames/src/components/Menu/MenuItemButton/MenuItemButton.js.map +1 -1
- package/dist/mocked_classnames/src/components/MenuButton/MenuButton.js +1 -1
- package/dist/mocked_classnames/src/components/MenuButton/MenuButton.js.map +1 -1
- package/dist/mocked_classnames/src/components/Modal/Modal/Modal.js +1 -1
- package/dist/mocked_classnames/src/components/Modal/Modal/Modal.js.map +1 -1
- package/dist/mocked_classnames/src/components/Modal/ModalHeader/ModalHeader.js +1 -1
- package/dist/mocked_classnames/src/components/Modal/ModalHeader/ModalHeader.js.map +1 -1
- package/dist/mocked_classnames/src/components/Modal/ModalTopActions/ModalTopActions.js +1 -1
- package/dist/mocked_classnames/src/components/Modal/footers/ModalFooterBase/ModalFooterBase.js +1 -1
- package/dist/mocked_classnames/src/components/Modal/footers/ModalFooterBase/ModalFooterBase.js.map +1 -1
- package/dist/mocked_classnames/src/components/MultiStepIndicator/MultiStepIndicator.js +1 -1
- package/dist/mocked_classnames/src/components/MultiStepIndicator/MultiStepIndicator.js.map +1 -1
- package/dist/mocked_classnames/src/components/MultiStepIndicator/components/StepIndicator/StepIndicator.js +1 -1
- package/dist/mocked_classnames/src/components/MultiStepIndicator/components/StepIndicator/StepIndicator.js.map +1 -1
- package/dist/mocked_classnames/src/components/NumberField/NumberField.js +1 -1
- package/dist/mocked_classnames/src/components/NumberField/NumberField.js.map +1 -1
- package/dist/mocked_classnames/src/components/NumberField/components/NumberFieldSpinButton/NumberFieldSpinButton.js +1 -1
- package/dist/mocked_classnames/src/components/NumberField/components/NumberFieldSpinButton/NumberFieldSpinButton.js.map +1 -1
- package/dist/mocked_classnames/src/components/Search/Search.js +1 -1
- package/dist/mocked_classnames/src/components/Search/Search.js.map +1 -1
- package/dist/mocked_classnames/src/components/Slider/SliderInfixHooks.js +1 -1
- package/dist/mocked_classnames/src/components/Slider/SliderInfixHooks.js.map +1 -1
- package/dist/mocked_classnames/src/components/SplitButton/SplitButton.js +1 -1
- package/dist/mocked_classnames/src/components/SplitButton/SplitButton.js.map +1 -1
- package/dist/mocked_classnames/src/components/SplitButton/SplitButtonConstants.js +1 -1
- package/dist/mocked_classnames/src/components/SplitButton/SplitButtonConstants.js.map +1 -1
- package/dist/mocked_classnames/src/components/Steps/StepsCommand.js +1 -1
- package/dist/mocked_classnames/src/components/Steps/StepsCommand.js.map +1 -1
- package/dist/mocked_classnames/src/components/Steps/StepsHeader.js +1 -1
- package/dist/mocked_classnames/src/components/Steps/StepsHeader.js.map +1 -1
- package/dist/mocked_classnames/src/components/Table/Table/tableHelpers.js +1 -1
- package/dist/mocked_classnames/src/components/Table/Table/tableHelpers.js.map +1 -1
- package/dist/mocked_classnames/src/components/Table/TableHeaderCell/TableHeaderCell.js +1 -1
- package/dist/mocked_classnames/src/components/Table/TableHeaderCell/TableHeaderCell.js.map +1 -1
- package/dist/mocked_classnames/src/components/Tabs/Tab/Tab.js +1 -1
- package/dist/mocked_classnames/src/components/Tabs/Tab/Tab.js.map +1 -1
- package/dist/mocked_classnames/src/components/TextField/TextField.js +1 -1
- package/dist/mocked_classnames/src/components/TextField/TextField.js.map +1 -1
- package/dist/mocked_classnames/src/components/Tipseen/Tipseen.js +1 -1
- package/dist/mocked_classnames/src/components/Tipseen/Tipseen.js.map +1 -1
- package/dist/mocked_classnames/src/components/Tipseen/TipseenContent.js +1 -1
- package/dist/mocked_classnames/src/components/Tipseen/TipseenContent.js.map +1 -1
- package/dist/mocked_classnames/src/components/Toast/Toast.js +1 -1
- package/dist/mocked_classnames/src/components/Toast/Toast.js.map +1 -1
- package/dist/mocked_classnames/src/components/Toast/ToastButton/ToastButton.js +1 -1
- package/dist/mocked_classnames/src/components/Toast/ToastButton/ToastButton.js.map +1 -1
- package/dist/mocked_classnames/src/components/Toast/ToastConstants.js +1 -1
- package/dist/mocked_classnames/src/components/Toast/ToastConstants.js.map +1 -1
- package/dist/mocked_classnames/src/components/Toast/ToastHelpers.js +1 -1
- package/dist/mocked_classnames/src/components/Toast/ToastHelpers.js.map +1 -1
- package/dist/mocked_classnames/src/components/Tooltip/Tooltip.js +1 -1
- package/dist/mocked_classnames/src/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/mocked_classnames/src/components/next/AttentionBox/components/AttentionBoxButton/AttentionBoxButton.js +1 -1
- package/dist/mocked_classnames/src/components/next/AttentionBox/components/AttentionBoxButton/AttentionBoxButton.js.map +1 -1
- package/dist/mocked_classnames/src/components/next/AttentionBox/components/AttentionBoxCloseButton/AttentionBoxCloseButton.js +1 -1
- package/dist/mocked_classnames/src/components/next/AttentionBox/components/AttentionBoxCloseButton/AttentionBoxCloseButton.js.map +1 -1
- package/dist/mocked_classnames/src/components/next/AttentionBox/components/AttentionBoxLeadingIcon/AttentionBoxLeadingIcon.js +1 -1
- package/dist/mocked_classnames/src/components/next/AttentionBox/components/AttentionBoxLeadingIcon/AttentionBoxLeadingIcon.js.map +1 -1
- package/dist/mocked_classnames/src/components/next/AttentionBox/consts/icons.js +1 -1
- package/dist/mocked_classnames/src/components/next/AttentionBox/consts/icons.js.map +1 -1
- package/dist/mocked_classnames/src/components/next/Dropdown/components/DropdownPopup/DropdownPopup.js +1 -1
- package/dist/mocked_classnames/src/components/next/Dropdown/components/DropdownPopup/DropdownPopup.js.map +1 -1
- package/dist/mocked_classnames/src/components/next/Dropdown/components/Menu/Menu.js +1 -1
- package/dist/mocked_classnames/src/components/next/Dropdown/components/Menu/Menu.js.map +1 -1
- package/dist/mocked_classnames/src/components/next/Dropdown/components/MultiSelectedValues/MultiSelectedValues.js +1 -1
- package/dist/mocked_classnames/src/components/next/Dropdown/components/MultiSelectedValues/MultiSelectedValues.js.map +1 -1
- package/dist/mocked_classnames/src/components/next/Dropdown/components/Trigger/DropdownInput.js +1 -1
- package/dist/mocked_classnames/src/components/next/Dropdown/components/Trigger/DropdownInput.js.map +1 -1
- package/dist/mocked_classnames/src/components/next/Dropdown/components/Trigger/TriggerActions.js +1 -1
- package/dist/mocked_classnames/src/components/next/Dropdown/components/Trigger/TriggerActions.js.map +1 -1
- package/dist/mocked_classnames/src/index.js +1 -1
- package/dist/src/components/Dropdown/Dropdown.js +1 -1
- package/dist/src/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/src/components/EditableTypography/EditableTypography.js +1 -1
- package/dist/src/components/EditableTypography/EditableTypography.js.map +1 -1
- package/dist/src/components/LegacyModal/LegacyModal.js +1 -1
- package/dist/src/components/LegacyModal/LegacyModal.js.map +1 -1
- package/dist/src/components/Modal/Modal/Modal.js +1 -1
- package/dist/src/components/Modal/Modal/Modal.js.map +1 -1
- package/dist/src/index.js +1 -1
- package/package.json +10 -10
- package/dist/components/layer/dist/LayerProvider/LayerContext.js.map +0 -1
- package/dist/components/layer/dist/LayerProvider/LayerProvider.js.map +0 -1
- /package/dist/components/{layer → layers}/dist/LayerProvider/LayerContext.js +0 -0
- /package/dist/components/{layer → layers}/dist/LayerProvider/LayerProvider.js +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defineProperty as e}from"../../../_virtual/_rollupPluginBabelHelpers.js";import t from"classnames";import i,{forwardRef as s,useCallback as o,useMemo as
|
|
1
|
+
import{defineProperty as e}from"../../../_virtual/_rollupPluginBabelHelpers.js";import t from"classnames";import i,{forwardRef as s,useCallback as o,useMemo as r}from"react";import l from"../Divider/Divider.js";import{NOOP as a}from"../../utils/function-utils.js";import n from"./components/StepIndicator/StepIndicator.js";import{MultiStepType as p,StepStatus as m,TextPlacement as c,Size as d}from"./MultiStepConstants.js";import{getTestId as f}from"../../tests/testIds.js";import{ComponentDefaultTestId as u}from"../../tests/constants.js";import{withStaticProps as v}from"../../types/withStaticProps.js";import"../../utils/colors-vars-map.js";import y from"./MultiStepIndicator.module.scss.js";import S from"../../../icons/dist/react/Check.js";var C=v(s((function(s,p){var m=s.className,c=s.steps,d=void 0===c?[]:c,v=s.type,C=void 0===v?"primary":v,N=s.stepComponentClassName,j=s.dividerComponentClassName,I=s.fulfilledStepIcon,g=void 0===I?S:I,b=s.fulfilledStepIconType,D=void 0===b?"svg":b,T=s.isFulfilledStepDisplayNumber,h=void 0!==T&&T,k=s.onClick,E=void 0===k?a:k,P=s.textPlacement,_=void 0===P?"horizontal":P,x=s.id,F=s["data-testid"],z="vertical"===_?"regular":s.size,w=o((function(s,o){return i.createElement(i.Fragment,{key:"".concat(s.titleText,"_").concat(o)},i.createElement(n,Object.assign({},s,{stepNumber:o+1,type:C,stepComponentClassName:N,fulfilledStepIcon:g,fulfilledStepIconType:D,onClick:E,isFulfilledStepDisplayNumber:h,size:z})),o!==d.length-1&&i.createElement(l,{className:t(y.divider,j,e({},y.compact,"compact"===z))}))}),[E,h,C,N,g,D,j,d.length,z]),M=o((function(e,s){return i.createElement(n,Object.assign({},e,{key:"".concat(e.titleText,"_").concat(s),stepNumber:s+1,type:C,stepComponentClassName:N,fulfilledStepIcon:g,fulfilledStepIconType:D,onClick:E,isFollowedByDivider:s!==d.length-1,stepDividerClassName:t(y.divider,j),isVertical:!0,isFulfilledStepDisplayNumber:h}))}),[E,h,C,N,g,D,j,d.length]),O=r((function(){return"vertical"===_?M:w}),[_,M,w]);return i.createElement("ol",{ref:p,id:x,"data-testid":F||f(u.MULTI_STEP_INDICATOR,x),className:t(y.wrapper,m)},d.map(O))})),{types:p,stepStatuses:m,textPlacements:c,sizes:d});export{C as default};
|
|
2
2
|
//# sourceMappingURL=MultiStepIndicator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiStepIndicator.js","sources":["../../../../../src/components/MultiStepIndicator/MultiStepIndicator.tsx"],"sourcesContent":["import cx from \"classnames\";\nimport React, { forwardRef, useCallback, useMemo } from \"react\";\nimport { Check } from \"@vibe/icons\";\nimport { type SubIcon } from \"@vibe/icon\";\nimport Divider from \"../../components/Divider/Divider\";\nimport { NOOP } from \"../../utils/function-utils\";\nimport StepIndicator from \"./components/StepIndicator/StepIndicator\";\nimport {\n MultiStepType as MultiStepTypeEnum,\n Size as SizeEnum,\n StepStatus as StepStatusEnum,\n TextPlacement as TextPlacementEnum\n} from \"./MultiStepConstants\";\nimport { type MultiStepType, type MultiStepSize, type TextPlacement, type Step } from \"./MultiStep.types\";\nimport { getTestId } from \"../../tests/test-ids-utils\";\nimport { ComponentDefaultTestId } from \"../../tests/constants\";\nimport { type VibeComponentProps, withStaticProps } from \"../../types\";\nimport styles from \"./MultiStepIndicator.module.scss\";\n\nexport interface MultiStepIndicatorProps extends VibeComponentProps {\n /**\n * The list of steps in the multi-step indicator.\n */\n steps?: Step[];\n /**\n * The visual style of the multi-step indicator.\n */\n type?: MultiStepType;\n /**\n * Class name applied to each step component.\n */\n stepComponentClassName?: string;\n /**\n * Class name applied to the divider between steps.\n */\n dividerComponentClassName?: string;\n /**\n * The icon used for fulfilled steps.\n */\n fulfilledStepIcon?: SubIcon;\n /**\n * The type of the fulfilled step icon.\n */\n fulfilledStepIconType?: \"svg\" | \"font\";\n /**\n * If true, displays the step number instead of the fulfilled step icon.\n */\n isFulfilledStepDisplayNumber?: boolean;\n /**\n * Callback fired when a step is clicked.\n */\n onClick?: (stepNumber: number) => void;\n /**\n * The placement of the step text.\n */\n textPlacement?: TextPlacement;\n /**\n * The size of the multi-step indicator.\n */\n size?: MultiStepSize;\n}\n\nconst MultiStepIndicator = forwardRef(\n (\n {\n className,\n steps = [],\n type = \"primary\",\n stepComponentClassName,\n dividerComponentClassName,\n fulfilledStepIcon = Check,\n fulfilledStepIconType = \"svg\",\n isFulfilledStepDisplayNumber = false,\n onClick = NOOP,\n textPlacement = \"horizontal\",\n id,\n size,\n \"data-testid\": dataTestId\n }: MultiStepIndicatorProps,\n ref: React.ForwardedRef<HTMLOListElement>\n ) => {\n const finalSize = textPlacement === \"vertical\" ? \"regular\" : size;\n\n const renderHorizontalStepIndicator = useCallback(\n (step: Step, index: number) => {\n return (\n <React.Fragment key={`${step.titleText}_${index}`}>\n <StepIndicator\n {...step}\n stepNumber={index + 1}\n type={type}\n stepComponentClassName={stepComponentClassName}\n fulfilledStepIcon={fulfilledStepIcon}\n fulfilledStepIconType={fulfilledStepIconType}\n onClick={onClick}\n isFulfilledStepDisplayNumber={isFulfilledStepDisplayNumber}\n size={finalSize}\n />\n {index !== steps.length - 1 && (\n <Divider\n className={cx(styles.divider, dividerComponentClassName, {\n [styles.compact]: finalSize === \"compact\"\n })}\n />\n )}\n </React.Fragment>\n );\n },\n [\n onClick,\n isFulfilledStepDisplayNumber,\n type,\n stepComponentClassName,\n fulfilledStepIcon,\n fulfilledStepIconType,\n dividerComponentClassName,\n steps.length,\n finalSize\n ]\n );\n\n const renderVerticalStepIndicator = useCallback(\n (step: Step, index: number) => {\n return (\n <StepIndicator\n {...step}\n key={`${step.titleText}_${index}`}\n stepNumber={index + 1}\n type={type}\n stepComponentClassName={stepComponentClassName}\n fulfilledStepIcon={fulfilledStepIcon}\n fulfilledStepIconType={fulfilledStepIconType}\n onClick={onClick}\n isFollowedByDivider={index !== steps.length - 1}\n stepDividerClassName={cx(styles.divider, dividerComponentClassName)}\n isVertical\n isFulfilledStepDisplayNumber={isFulfilledStepDisplayNumber}\n />\n );\n },\n [\n onClick,\n isFulfilledStepDisplayNumber,\n type,\n stepComponentClassName,\n fulfilledStepIcon,\n fulfilledStepIconType,\n dividerComponentClassName,\n steps.length\n ]\n );\n\n const stepRenderer = useMemo(\n () => (textPlacement === \"vertical\" ? renderVerticalStepIndicator : renderHorizontalStepIndicator),\n [textPlacement, renderVerticalStepIndicator, renderHorizontalStepIndicator]\n );\n\n return (\n <ol\n ref={ref}\n id={id}\n data-testid={dataTestId || getTestId(ComponentDefaultTestId.MULTI_STEP_INDICATOR, id)}\n className={cx(styles.wrapper, className)}\n >\n {steps.map(stepRenderer)}\n </ol>\n );\n }\n);\n\ninterface MultiStepIndicatorStaticProps {\n types: typeof MultiStepTypeEnum;\n stepStatuses: typeof StepStatusEnum;\n textPlacements: typeof TextPlacementEnum;\n sizes: typeof SizeEnum;\n}\n\nexport default withStaticProps<MultiStepIndicatorProps, MultiStepIndicatorStaticProps>(MultiStepIndicator, {\n types: MultiStepTypeEnum,\n stepStatuses: StepStatusEnum,\n textPlacements: TextPlacementEnum,\n sizes: SizeEnum\n});\n"],"names":["withStaticProps","forwardRef","_ref","ref","className","_ref$steps","steps","_ref$type","type","stepComponentClassName","dividerComponentClassName","_ref$fulfilledStepIco","fulfilledStepIcon","Check","_ref$fulfilledStepIco2","fulfilledStepIconType","_ref$isFulfilledStepD","isFulfilledStepDisplayNumber","_ref$onClick","onClick","NOOP","_ref$textPlacement","textPlacement","id","dataTestId","finalSize","size","renderHorizontalStepIndicator","useCallback","step","index","React","createElement","Fragment","key","concat","titleText","StepIndicator","Object","assign","stepNumber","length","Divider","cx","styles","divider","_defineProperty","compact","renderVerticalStepIndicator","isFollowedByDivider","stepDividerClassName","isVertical","stepRenderer","useMemo","getTestId","ComponentDefaultTestId","MULTI_STEP_INDICATOR","wrapper","map","types","MultiStepTypeEnum","stepStatuses","StepStatusEnum","textPlacements","TextPlacementEnum","sizes","SizeEnum"],"mappings":"
|
|
1
|
+
{"version":3,"file":"MultiStepIndicator.js","sources":["../../../../../src/components/MultiStepIndicator/MultiStepIndicator.tsx"],"sourcesContent":["import cx from \"classnames\";\nimport React, { forwardRef, useCallback, useMemo } from \"react\";\nimport { Check } from \"@vibe/icons\";\nimport { type SubIcon } from \"@vibe/icon\";\nimport Divider from \"../../components/Divider/Divider\";\nimport { NOOP } from \"../../utils/function-utils\";\nimport StepIndicator from \"./components/StepIndicator/StepIndicator\";\nimport {\n MultiStepType as MultiStepTypeEnum,\n Size as SizeEnum,\n StepStatus as StepStatusEnum,\n TextPlacement as TextPlacementEnum\n} from \"./MultiStepConstants\";\nimport { type MultiStepType, type MultiStepSize, type TextPlacement, type Step } from \"./MultiStep.types\";\nimport { getTestId } from \"../../tests/test-ids-utils\";\nimport { ComponentDefaultTestId } from \"../../tests/constants\";\nimport { type VibeComponentProps, withStaticProps } from \"../../types\";\nimport styles from \"./MultiStepIndicator.module.scss\";\n\nexport interface MultiStepIndicatorProps extends VibeComponentProps {\n /**\n * The list of steps in the multi-step indicator.\n */\n steps?: Step[];\n /**\n * The visual style of the multi-step indicator.\n */\n type?: MultiStepType;\n /**\n * Class name applied to each step component.\n */\n stepComponentClassName?: string;\n /**\n * Class name applied to the divider between steps.\n */\n dividerComponentClassName?: string;\n /**\n * The icon used for fulfilled steps.\n */\n fulfilledStepIcon?: SubIcon;\n /**\n * The type of the fulfilled step icon.\n */\n fulfilledStepIconType?: \"svg\" | \"font\";\n /**\n * If true, displays the step number instead of the fulfilled step icon.\n */\n isFulfilledStepDisplayNumber?: boolean;\n /**\n * Callback fired when a step is clicked.\n */\n onClick?: (stepNumber: number) => void;\n /**\n * The placement of the step text.\n */\n textPlacement?: TextPlacement;\n /**\n * The size of the multi-step indicator.\n */\n size?: MultiStepSize;\n}\n\nconst MultiStepIndicator = forwardRef(\n (\n {\n className,\n steps = [],\n type = \"primary\",\n stepComponentClassName,\n dividerComponentClassName,\n fulfilledStepIcon = Check,\n fulfilledStepIconType = \"svg\",\n isFulfilledStepDisplayNumber = false,\n onClick = NOOP,\n textPlacement = \"horizontal\",\n id,\n size,\n \"data-testid\": dataTestId\n }: MultiStepIndicatorProps,\n ref: React.ForwardedRef<HTMLOListElement>\n ) => {\n const finalSize = textPlacement === \"vertical\" ? \"regular\" : size;\n\n const renderHorizontalStepIndicator = useCallback(\n (step: Step, index: number) => {\n return (\n <React.Fragment key={`${step.titleText}_${index}`}>\n <StepIndicator\n {...step}\n stepNumber={index + 1}\n type={type}\n stepComponentClassName={stepComponentClassName}\n fulfilledStepIcon={fulfilledStepIcon}\n fulfilledStepIconType={fulfilledStepIconType}\n onClick={onClick}\n isFulfilledStepDisplayNumber={isFulfilledStepDisplayNumber}\n size={finalSize}\n />\n {index !== steps.length - 1 && (\n <Divider\n className={cx(styles.divider, dividerComponentClassName, {\n [styles.compact]: finalSize === \"compact\"\n })}\n />\n )}\n </React.Fragment>\n );\n },\n [\n onClick,\n isFulfilledStepDisplayNumber,\n type,\n stepComponentClassName,\n fulfilledStepIcon,\n fulfilledStepIconType,\n dividerComponentClassName,\n steps.length,\n finalSize\n ]\n );\n\n const renderVerticalStepIndicator = useCallback(\n (step: Step, index: number) => {\n return (\n <StepIndicator\n {...step}\n key={`${step.titleText}_${index}`}\n stepNumber={index + 1}\n type={type}\n stepComponentClassName={stepComponentClassName}\n fulfilledStepIcon={fulfilledStepIcon}\n fulfilledStepIconType={fulfilledStepIconType}\n onClick={onClick}\n isFollowedByDivider={index !== steps.length - 1}\n stepDividerClassName={cx(styles.divider, dividerComponentClassName)}\n isVertical\n isFulfilledStepDisplayNumber={isFulfilledStepDisplayNumber}\n />\n );\n },\n [\n onClick,\n isFulfilledStepDisplayNumber,\n type,\n stepComponentClassName,\n fulfilledStepIcon,\n fulfilledStepIconType,\n dividerComponentClassName,\n steps.length\n ]\n );\n\n const stepRenderer = useMemo(\n () => (textPlacement === \"vertical\" ? renderVerticalStepIndicator : renderHorizontalStepIndicator),\n [textPlacement, renderVerticalStepIndicator, renderHorizontalStepIndicator]\n );\n\n return (\n <ol\n ref={ref}\n id={id}\n data-testid={dataTestId || getTestId(ComponentDefaultTestId.MULTI_STEP_INDICATOR, id)}\n className={cx(styles.wrapper, className)}\n >\n {steps.map(stepRenderer)}\n </ol>\n );\n }\n);\n\ninterface MultiStepIndicatorStaticProps {\n types: typeof MultiStepTypeEnum;\n stepStatuses: typeof StepStatusEnum;\n textPlacements: typeof TextPlacementEnum;\n sizes: typeof SizeEnum;\n}\n\nexport default withStaticProps<MultiStepIndicatorProps, MultiStepIndicatorStaticProps>(MultiStepIndicator, {\n types: MultiStepTypeEnum,\n stepStatuses: StepStatusEnum,\n textPlacements: TextPlacementEnum,\n sizes: SizeEnum\n});\n"],"names":["withStaticProps","forwardRef","_ref","ref","className","_ref$steps","steps","_ref$type","type","stepComponentClassName","dividerComponentClassName","_ref$fulfilledStepIco","fulfilledStepIcon","Check","_ref$fulfilledStepIco2","fulfilledStepIconType","_ref$isFulfilledStepD","isFulfilledStepDisplayNumber","_ref$onClick","onClick","NOOP","_ref$textPlacement","textPlacement","id","dataTestId","finalSize","size","renderHorizontalStepIndicator","useCallback","step","index","React","createElement","Fragment","key","concat","titleText","StepIndicator","Object","assign","stepNumber","length","Divider","cx","styles","divider","_defineProperty","compact","renderVerticalStepIndicator","isFollowedByDivider","stepDividerClassName","isVertical","stepRenderer","useMemo","getTestId","ComponentDefaultTestId","MULTI_STEP_INDICATOR","wrapper","map","types","MultiStepTypeEnum","stepStatuses","StepStatusEnum","textPlacements","TextPlacementEnum","sizes","SizeEnum"],"mappings":"0uBA8DA,IAmHeA,EAAAA,EAnHYC,GACzB,SAAAC,EAgBEC,GACE,IAfAC,EAASF,EAATE,UAASC,EAAAH,EACTI,MAAAA,OAAQ,IAAHD,EAAG,GAAEA,EAAAE,EAAAL,EACVM,KAAAA,OAAO,IAAHD,EAAG,UAASA,EAChBE,EAAsBP,EAAtBO,uBACAC,EAAyBR,EAAzBQ,0BAAyBC,EAAAT,EACzBU,kBAAAA,OAAoBC,IAAHF,EAAGE,EAAKF,EAAAG,EAAAZ,EACzBa,sBAAAA,OAAwB,IAAHD,EAAG,MAAKA,EAAAE,EAAAd,EAC7Be,6BAAAA,OAA+B,IAAHD,GAAQA,EAAAE,EAAAhB,EACpCiB,QAAAA,OAAUC,IAAHF,EAAGE,EAAIF,EAAAG,EAAAnB,EACdoB,cAAAA,OAAgB,IAAHD,EAAG,aAAYA,EAC5BE,EAAErB,EAAFqB,GAEeC,EAAUtB,EAAzB,eAIIuB,EAA8B,aAAlBH,EAA+B,UAL3CpB,EAAJwB,KAOIC,EAAgCC,GACpC,SAACC,EAAYC,GACX,OACEC,EAAAC,cAACD,EAAME,SAAS,CAAAC,IAAG,GAAAC,OAAKN,EAAKO,UAAS,KAAAD,OAAIL,IACxCC,EAAAC,cAACK,EACKC,OAAAC,OAAA,CAAA,EAAAV,EACJ,CAAAW,WAAYV,EAAQ,EACpBtB,KAAMA,EACNC,uBAAwBA,EACxBG,kBAAmBA,EACnBG,sBAAuBA,EACvBI,QAASA,EACTF,6BAA8BA,EAC9BS,KAAMD,KAEPK,IAAUxB,EAAMmC,OAAS,GACxBV,EAACC,cAAAU,GACCtC,UAAWuC,EAAGC,EAAOC,QAASnC,EAAyBoC,EAAA,CAAA,EACpDF,EAAOG,QAAwB,YAAdtB,MAM7B,GACD,CACEN,EACAF,EACAT,EACAC,EACAG,EACAG,EACAL,EACAJ,EAAMmC,OACNhB,IAIEuB,EAA8BpB,GAClC,SAACC,EAAYC,GACX,OACEC,EAAAC,cAACK,EAAaC,OAAAC,OAAA,CAAA,EACRV,EACJ,CAAAK,IAAG,GAAAC,OAAKN,EAAKO,UAASD,KAAAA,OAAIL,GAC1BU,WAAYV,EAAQ,EACpBtB,KAAMA,EACNC,uBAAwBA,EACxBG,kBAAmBA,EACnBG,sBAAuBA,EACvBI,QAASA,EACT8B,oBAAqBnB,IAAUxB,EAAMmC,OAAS,EAC9CS,qBAAsBP,EAAGC,EAAOC,QAASnC,GACzCyC,cACAlC,6BAA8BA,IAGnC,GACD,CACEE,EACAF,EACAT,EACAC,EACAG,EACAG,EACAL,EACAJ,EAAMmC,SAIJW,EAAeC,GACnB,WAAA,MAAyB,aAAlB/B,EAA+B0B,EAA8BrB,CAA8B,GAClG,CAACL,EAAe0B,EAA6BrB,IAG/C,OACEI,EACEC,cAAA,KAAA,CAAA7B,IAAKA,EACLoB,GAAIA,EACS,cAAAC,GAAc8B,EAAUC,EAAuBC,qBAAsBjC,GAClFnB,UAAWuC,EAAGC,EAAOa,QAASrD,IAE7BE,EAAMoD,IAAIN,GAGjB,IAUyG,CACzGO,MAAOC,EACPC,aAAcC,EACdC,eAAgBC,EAChBC,MAAOC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{slicedToArray as e,toConsumableArray as t,defineProperty as i}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import{camelCase as n}from"es-toolkit";import{getStyle as a}from"../../../../helpers/typesciptCssModulesHelper.js";import{getTestId as o,ComponentDefaultTestId as r}from"../../../../tests/testIds.js";import l from"classnames";import{keyCodes as s}from"../../../../constants/keyCodes.js";import c,{useState as m,useRef as
|
|
1
|
+
import{slicedToArray as e,toConsumableArray as t,defineProperty as i}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import{camelCase as n}from"es-toolkit";import{getStyle as a}from"../../../../helpers/typesciptCssModulesHelper.js";import{getTestId as o,ComponentDefaultTestId as r}from"../../../../tests/testIds.js";import l from"classnames";import{keyCodes as s}from"../../../../constants/keyCodes.js";import c,{useState as m,useRef as p,useCallback as d,useEffect as u,useMemo as f}from"react";import{SwitchTransition as v,CSSTransition as y}from"react-transition-group";import _ from"../../../../hooks/useEventListener/index.js";import E from"../../../../hooks/useKeyEvent/index.js";import x from"../../../Divider/Divider.js";import{NOOP as b}from"../../../../utils/function-utils.js";import N from"../../../HiddenText/HiddenText.js";import k from"../../../Clickable/Clickable.js";import C from"./StepIndicator.module.scss.js";import I from"../../../../../components/icon/dist/Icon/Icon.js";import S from"../../../../../icons/dist/react/Check.js";var T=[s.ENTER,s.SPACE],j=function(e){var t=e.fulfilledStepIcon,i=e.fulfilledStepIconType;return"fulfilled"!==e.status||e.isFulfilledStepDisplayNumber?c.createElement(c.Fragment,null,e.stepNumber):c.createElement(I,{icon:t,className:l(C.numberContainerTextCheckIcon),iconType:i,ignoreFocusStyle:!0,ariaHidden:!0})},A=function(s){var I=s.stepComponentClassName,A=s.stepNumber,g=void 0===A?1:A,D=s.status,h=void 0===D?"pending":D,w=s.titleText,F=void 0===w?"Heading text":w,H=s.subtitleText,P=void 0===H?"Subtitle text":H,L=s.type,z=void 0===L?"primary":L,B=s.fulfilledStepIcon,R=void 0===B?S:B,V=s.fulfilledStepIconType,K=void 0===V?"svg":V,M=s.isFulfilledStepDisplayNumber,O=void 0!==M&&M,q=s.onClick,G=void 0===q?b:q,J=s.isFollowedByDivider,Q=void 0!==J&&J,U=s.stepDividerClassName,W=s.isVertical,X=void 0!==W&&W,Y=s.id,Z=s.size,$=void 0===Z?"regular":Z,ee=s["data-testid"],te=m(!1),ie=e(te,2),ne=ie[0],ae=ie[1],oe=p(null),re=p(h),le=d((function(){ae(!0)}),[ae]),se=d((function(){ae(!1)}),[ae]),ce=d((function(){return re.current!==h}),[re,h]),me=d((function(){G&&G(g)}),[G,g]);_({eventName:"animationend",callback:se,ref:oe}),E({keys:T,callback:me,ref:oe}),u((function(){ce()&&le()}),[h,ce,le]),u((function(){re.current=h}),[h]);var pe=f((function(){return"Step ".concat(g,": ").concat(F," - ").concat(P,", status: ").concat(h)}),[h,F,g,P]),de=function(e){return[a(C,n(e||"indicator")),a(C,n("type-".concat(z).concat(e))),a(C,n("status-".concat(h).concat(e))),a(C,n("size-".concat($).concat(e)))]};return c.createElement(k,{tabIndex:"-1",elementType:"li",className:l.apply(void 0,t(de("")).concat([I,i(i(i({},C.withAnimation,ne),C.clickable,G),C.textPlacementVertical,X)])),"aria-label":pe,onClick:me,"data-testid":ee||o(r.STEP_INDICATOR,Y)},c.createElement("div",{className:l.apply(void 0,t(de("__number-divider-container")))},c.createElement("div",{className:l.apply(void 0,t(de("__number-container"))),ref:oe,tabIndex:0,role:"button"},c.createElement(v,{mode:"out-in"},c.createElement(y,{classNames:{enter:C.swapEnter,enterActive:C.swapEnterActive,exit:C.swapExit,exitActive:C.swapExitActive},addEndListener:function(e,t){e.addEventListener("transitionend",t,!1)},key:h},c.createElement("span",{className:l.apply(void 0,t(de("__number-container__text")))},c.createElement(j,{fulfilledStepIcon:R,fulfilledStepIconType:K,isFulfilledStepDisplayNumber:O,stepNumber:g,status:h}))))),Q&&X&&c.createElement(x,{className:l(C.divider,U)})),c.createElement("div",{className:l.apply(void 0,t(de("__text-container")))},c.createElement("div",{className:l.apply(void 0,t(de("__text-container__title")))},c.createElement(N,{text:h})," ",c.createElement("span",{className:l.apply(void 0,t(de("__text-container__title__text")))},F)),"compact"!==$?c.createElement("span",{className:l.apply(void 0,t(de("__text-container__subtitle__text")))},P):null))};export{A as default};
|
|
2
2
|
//# sourceMappingURL=StepIndicator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepIndicator.js","sources":["../../../../../../../src/components/MultiStepIndicator/components/StepIndicator/StepIndicator.tsx"],"sourcesContent":["import { camelCase } from \"es-toolkit\";\nimport { getStyle } from \"../../../../helpers/typesciptCssModulesHelper\";\nimport { ComponentDefaultTestId, getTestId } from \"../../../../tests/test-ids-utils\";\nimport cx from \"classnames\";\nimport { keyCodes } from \"../../../../constants/keyCodes\";\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { CSSTransition, SwitchTransition } from \"react-transition-group\";\nimport useEventListener from \"../../../../hooks/useEventListener\";\nimport useKeyEvent from \"../../../../hooks/useKeyEvent\";\nimport { Icon } from \"@vibe/icon\";\nimport { Check } from \"@vibe/icons\";\nimport Divider from \"../../../../components/Divider/Divider\";\nimport { NOOP } from \"../../../../utils/function-utils\";\nimport HiddenText from \"../../../../components/HiddenText/HiddenText\";\nimport Clickable from \"../../../../components/Clickable/Clickable\";\nimport { type MultiStepSize, type MultiStepType, type StepStatus } from \"../../MultiStep.types\";\nimport styles from \"./StepIndicator.module.scss\";\nimport classNames from \"classnames\";\nimport { type VibeComponentProps } from \"../../../../types\";\nimport { type SubIcon } from \"@vibe/icon\";\n\nconst KEYS = [keyCodes.ENTER, keyCodes.SPACE];\n\nexport interface StepCircleDisplayProps {\n /**\n * The status of the step.\n */\n status: StepStatus;\n /**\n * If true, displays the step number instead of the fulfilled step icon.\n */\n isFulfilledStepDisplayNumber: boolean;\n /**\n * The icon displayed when the step is fulfilled.\n */\n fulfilledStepIcon: SubIcon;\n /**\n * The type of icon used.\n */\n fulfilledStepIconType: \"svg\" | \"font\";\n /**\n * The step number in the sequence.\n */\n stepNumber: number;\n}\n\nconst StepCircleDisplay: React.FC<StepCircleDisplayProps> = ({\n status,\n isFulfilledStepDisplayNumber,\n fulfilledStepIcon,\n fulfilledStepIconType,\n stepNumber\n}) => {\n return status === \"fulfilled\" && !isFulfilledStepDisplayNumber ? (\n <Icon\n icon={fulfilledStepIcon}\n className={classNames(styles.numberContainerTextCheckIcon)}\n iconType={fulfilledStepIconType}\n ignoreFocusStyle\n ariaHidden={true}\n />\n ) : (\n <>{stepNumber}</>\n );\n};\n\nexport interface StepIndicatorProps extends VibeComponentProps {\n /**\n * The status of the step.\n */\n status: StepStatus;\n /**\n * The main title text for the step.\n */\n titleText: string;\n /**\n * The subtitle text for the step.\n */\n subtitleText?: string;\n /**\n * The number of the step in the sequence.\n */\n stepNumber?: number;\n /**\n * Class name applied to the step component.\n */\n stepComponentClassName?: string;\n /**\n * The visual style of the step indicator.\n */\n type?: MultiStepType;\n /**\n * The icon used for a fulfilled step.\n */\n fulfilledStepIcon?: SubIcon;\n /**\n * The type of icon used.\n */\n fulfilledStepIconType?: \"svg\" | \"font\";\n /**\n * If true, displays the step number instead of the fulfilled step icon.\n */\n isFulfilledStepDisplayNumber?: boolean;\n /**\n * Callback fired when the step is clicked.\n */\n onClick?: (stepNumber: number) => void;\n /**\n * If true, adds a divider after the step.\n */\n isFollowedByDivider?: boolean;\n /**\n * Class name applied to the step divider.\n */\n stepDividerClassName?: string;\n /**\n * If true, the step indicator is displayed vertically.\n */\n isVertical?: boolean;\n /**\n * The size of the step indicator.\n */\n size?: MultiStepSize;\n}\n\nconst StepIndicator: React.FC<StepIndicatorProps> = ({\n stepComponentClassName,\n stepNumber = 1,\n status = \"pending\",\n titleText = \"Heading text\",\n subtitleText = \"Subtitle text\",\n type = \"primary\",\n fulfilledStepIcon = Check,\n fulfilledStepIconType = \"svg\",\n isFulfilledStepDisplayNumber = false,\n onClick = NOOP,\n isFollowedByDivider = false,\n stepDividerClassName,\n isVertical = false,\n id,\n size = \"regular\",\n \"data-testid\": dataTestId\n}: StepIndicatorProps) => {\n // Animations state\n const [statusChangeAnimationState, setStatusChangeAnimationState] = useState(false);\n\n // Refs\n const componentRef = useRef(null);\n const prevStatusRef = useRef(status);\n\n // Callbacks for modifying animation state\n const enableStatusChangeAnimation = useCallback(() => {\n setStatusChangeAnimationState(true);\n }, [setStatusChangeAnimationState]);\n\n const disableStatusChangeAnimation = useCallback(() => {\n setStatusChangeAnimationState(false);\n }, [setStatusChangeAnimationState]);\n\n const isStatusTransition = useCallback(() => prevStatusRef.current !== status, [prevStatusRef, status]);\n\n const handleClick = useCallback(() => {\n if (onClick) onClick(stepNumber);\n }, [onClick, stepNumber]);\n\n // Event listeners for removing animation.\n useEventListener({\n eventName: \"animationend\",\n callback: disableStatusChangeAnimation,\n ref: componentRef\n });\n\n useKeyEvent({\n keys: KEYS,\n callback: handleClick,\n ref: componentRef\n });\n\n // Effect - triggering animation when necessary.\n useEffect(() => {\n if (isStatusTransition()) {\n enableStatusChangeAnimation();\n }\n }, [status, isStatusTransition, enableStatusChangeAnimation]);\n\n // Effect - updating previous status ref value (for animation) after component update.\n useEffect(() => {\n prevStatusRef.current = status;\n }, [status]);\n\n const ariaLabel = useMemo(() => {\n return `Step ${stepNumber}: ${titleText} - ${subtitleText}, status: ${status}`;\n }, [status, titleText, stepNumber, subtitleText]);\n\n const getClassNamesWithSuffix = (suffix: string) => {\n return [\n getStyle(styles, camelCase(suffix || \"indicator\")),\n getStyle(styles, camelCase(`type-${type}${suffix}`)),\n getStyle(styles, camelCase(`status-${status}${suffix}`)),\n getStyle(styles, camelCase(`size-${size}${suffix}`))\n ];\n };\n\n return (\n <Clickable\n tabIndex=\"-1\"\n elementType=\"li\"\n className={cx(...getClassNamesWithSuffix(\"\"), stepComponentClassName, {\n [styles.withAnimation]: statusChangeAnimationState,\n [styles.clickable]: onClick,\n [styles.textPlacementVertical]: isVertical\n })}\n aria-label={ariaLabel}\n onClick={handleClick}\n data-testid={dataTestId || getTestId(ComponentDefaultTestId.STEP_INDICATOR, id)}\n >\n <div className={cx(...getClassNamesWithSuffix(\"__number-divider-container\"))}>\n <div\n className={cx(...getClassNamesWithSuffix(\"__number-container\"))}\n ref={componentRef}\n tabIndex={0}\n role=\"button\"\n >\n <SwitchTransition mode=\"out-in\">\n <CSSTransition<undefined>\n // CSSTransition needs to be specified with the generic parameter to decide type for addEndListener's callback\n // otherwise, addEndListener cb has only `done` param (ts error)\n classNames={{\n enter: styles.swapEnter,\n enterActive: styles.swapEnterActive,\n exit: styles.swapExit,\n exitActive: styles.swapExitActive\n }}\n addEndListener={(node: HTMLElement, done: () => void) => {\n node.addEventListener(\"transitionend\", done, false);\n }}\n key={status}\n >\n <span className={cx(...getClassNamesWithSuffix(\"__number-container__text\"))}>\n <StepCircleDisplay\n fulfilledStepIcon={fulfilledStepIcon}\n fulfilledStepIconType={fulfilledStepIconType}\n isFulfilledStepDisplayNumber={isFulfilledStepDisplayNumber}\n stepNumber={stepNumber}\n status={status}\n />\n </span>\n </CSSTransition>\n </SwitchTransition>\n </div>\n {isFollowedByDivider && isVertical && <Divider className={cx(styles.divider, stepDividerClassName)} />}\n </div>\n <div className={cx(...getClassNamesWithSuffix(\"__text-container\"))}>\n <div className={cx(...getClassNamesWithSuffix(\"__text-container__title\"))}>\n <HiddenText text={status} /> {/* for accessibility */}\n <span className={cx(...getClassNamesWithSuffix(\"__text-container__title__text\"))}>{titleText}</span>\n </div>\n {size !== \"compact\" ? (\n <span className={cx(...getClassNamesWithSuffix(\"__text-container__subtitle__text\"))}>{subtitleText}</span>\n ) : null}\n </div>\n </Clickable>\n );\n};\n\nexport default StepIndicator;\n"],"names":["KEYS","keyCodes","ENTER","SPACE","StepCircleDisplay","_ref","fulfilledStepIcon","fulfilledStepIconType","status","isFulfilledStepDisplayNumber","React","createElement","Fragment","stepNumber","Icon","icon","className","classNames","styles","numberContainerTextCheckIcon","iconType","ignoreFocusStyle","ariaHidden","StepIndicator","_ref2","stepComponentClassName","_ref2$stepNumber","_ref2$status","_ref2$titleText","titleText","_ref2$subtitleText","subtitleText","_ref2$type","type","_ref2$fulfilledStepIc","Check","_ref2$fulfilledStepIc2","_ref2$isFulfilledStep","_ref2$onClick","onClick","NOOP","_ref2$isFollowedByDiv","isFollowedByDivider","stepDividerClassName","_ref2$isVertical","isVertical","id","_ref2$size","size","dataTestId","_useState","useState","_useState2","_slicedToArray","statusChangeAnimationState","setStatusChangeAnimationState","componentRef","useRef","prevStatusRef","enableStatusChangeAnimation","useCallback","disableStatusChangeAnimation","isStatusTransition","current","handleClick","useEventListener","eventName","callback","ref","useKeyEvent","keys","useEffect","ariaLabel","useMemo","concat","getClassNamesWithSuffix","suffix","getStyle","camelCase","Clickable","tabIndex","elementType","cx","apply","_toConsumableArray","_defineProperty","withAnimation","clickable","textPlacementVertical","getTestId","ComponentDefaultTestId","STEP_INDICATOR","role","SwitchTransition","mode","CSSTransition","enter","swapEnter","enterActive","swapEnterActive","exit","swapExit","exitActive","swapExitActive","addEndListener","node","done","addEventListener","key","Divider","divider","HiddenText","text"],"mappings":"shCAqBA,IAAMA,EAAO,CAACC,EAASC,MAAOD,EAASE,OAyBjCC,EAAsD,SAArCC,GAMlB,IAHHC,EAAiBD,EAAjBC,kBACAC,EAAqBF,EAArBE,sBAGA,MAAkB,cANZF,EAANG,QAC4BH,EAA5BI,6BAcEC,EAAGC,cAAAD,EAAAE,SAAA,KAXKP,EAAVQ,YAGEH,gBAACI,EAAI,CACHC,KAAMT,EACNU,UAAWC,EAAWC,EAAOC,8BAC7BC,SAAUb,EACVc,oBACAC,YAAY,GAKlB,EA6DMC,EAA8C,SAAjCC,GAiBM,IAhBvBC,EAAsBD,EAAtBC,uBAAsBC,EAAAF,EACtBX,WAAAA,OAAa,IAAHa,EAAG,EAACA,EAAAC,EAAAH,EACdhB,OAAAA,OAAS,IAAHmB,EAAG,UAASA,EAAAC,EAAAJ,EAClBK,UAAAA,OAAY,IAAHD,EAAG,eAAcA,EAAAE,EAAAN,EAC1BO,aAAAA,OAAe,IAAHD,EAAG,gBAAeA,EAAAE,EAAAR,EAC9BS,KAAAA,OAAO,IAAHD,EAAG,UAASA,EAAAE,EAAAV,EAChBlB,kBAAAA,OAAoB6B,IAAHD,EAAGC,EAAKD,EAAAE,EAAAZ,EACzBjB,sBAAAA,OAAwB,IAAH6B,EAAG,MAAKA,EAAAC,EAAAb,EAC7Bf,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AA,MAAA,CAAAK,UAAWkE,EAAEC,WAAA,EAAAC,EAAIT,GAAwB,uBAC5CjE,EAAKC,cAAA,MAAA,CAAAK,UAAWkE,EAAEC,WAAA,EAAAC,EAAIT,GAAwB,8BAC5CjE,EAAAC,cAACoG,EAAU,CAACC,KAAMxG,QAClBE,EAAAC,cAAA,OAAA,CAAMK,UAAWkE,EAAEC,WAAA,EAAAC,EAAIT,GAAwB,oCAAoC9C,IAE3E,YAATmB,EACCtC,EAAMC,cAAA,OAAA,CAAAK,UAAWkE,EAAEC,WAAA,EAAAC,EAAIT,GAAwB,uCAAuC5C,GACpF,MAIZ"}
|
|
1
|
+
{"version":3,"file":"StepIndicator.js","sources":["../../../../../../../src/components/MultiStepIndicator/components/StepIndicator/StepIndicator.tsx"],"sourcesContent":["import { camelCase } from \"es-toolkit\";\nimport { getStyle } from \"../../../../helpers/typesciptCssModulesHelper\";\nimport { ComponentDefaultTestId, getTestId } from \"../../../../tests/test-ids-utils\";\nimport cx from \"classnames\";\nimport { keyCodes } from \"../../../../constants/keyCodes\";\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { CSSTransition, SwitchTransition } from \"react-transition-group\";\nimport useEventListener from \"../../../../hooks/useEventListener\";\nimport useKeyEvent from \"../../../../hooks/useKeyEvent\";\nimport { Icon } from \"@vibe/icon\";\nimport { Check } from \"@vibe/icons\";\nimport Divider from \"../../../../components/Divider/Divider\";\nimport { NOOP } from \"../../../../utils/function-utils\";\nimport HiddenText from \"../../../../components/HiddenText/HiddenText\";\nimport Clickable from \"../../../../components/Clickable/Clickable\";\nimport { type MultiStepSize, type MultiStepType, type StepStatus } from \"../../MultiStep.types\";\nimport styles from \"./StepIndicator.module.scss\";\nimport classNames from \"classnames\";\nimport { type VibeComponentProps } from \"../../../../types\";\nimport { type SubIcon } from \"@vibe/icon\";\n\nconst KEYS = [keyCodes.ENTER, keyCodes.SPACE];\n\nexport interface StepCircleDisplayProps {\n /**\n * The status of the step.\n */\n status: StepStatus;\n /**\n * If true, displays the step number instead of the fulfilled step icon.\n */\n isFulfilledStepDisplayNumber: boolean;\n /**\n * The icon displayed when the step is fulfilled.\n */\n fulfilledStepIcon: SubIcon;\n /**\n * The type of icon used.\n */\n fulfilledStepIconType: \"svg\" | \"font\";\n /**\n * The step number in the sequence.\n */\n stepNumber: number;\n}\n\nconst StepCircleDisplay: React.FC<StepCircleDisplayProps> = ({\n status,\n isFulfilledStepDisplayNumber,\n fulfilledStepIcon,\n fulfilledStepIconType,\n stepNumber\n}) => {\n return status === \"fulfilled\" && !isFulfilledStepDisplayNumber ? (\n <Icon\n icon={fulfilledStepIcon}\n className={classNames(styles.numberContainerTextCheckIcon)}\n iconType={fulfilledStepIconType}\n ignoreFocusStyle\n ariaHidden={true}\n />\n ) : (\n <>{stepNumber}</>\n );\n};\n\nexport interface StepIndicatorProps extends VibeComponentProps {\n /**\n * The status of the step.\n */\n status: StepStatus;\n /**\n * The main title text for the step.\n */\n titleText: string;\n /**\n * The subtitle text for the step.\n */\n subtitleText?: string;\n /**\n * The number of the step in the sequence.\n */\n stepNumber?: number;\n /**\n * Class name applied to the step component.\n */\n stepComponentClassName?: string;\n /**\n * The visual style of the step indicator.\n */\n type?: MultiStepType;\n /**\n * The icon used for a fulfilled step.\n */\n fulfilledStepIcon?: SubIcon;\n /**\n * The type of icon used.\n */\n fulfilledStepIconType?: \"svg\" | \"font\";\n /**\n * If true, displays the step number instead of the fulfilled step icon.\n */\n isFulfilledStepDisplayNumber?: boolean;\n /**\n * Callback fired when the step is clicked.\n */\n onClick?: (stepNumber: number) => void;\n /**\n * If true, adds a divider after the step.\n */\n isFollowedByDivider?: boolean;\n /**\n * Class name applied to the step divider.\n */\n stepDividerClassName?: string;\n /**\n * If true, the step indicator is displayed vertically.\n */\n isVertical?: boolean;\n /**\n * The size of the step indicator.\n */\n size?: MultiStepSize;\n}\n\nconst StepIndicator: React.FC<StepIndicatorProps> = ({\n stepComponentClassName,\n stepNumber = 1,\n status = \"pending\",\n titleText = \"Heading text\",\n subtitleText = \"Subtitle text\",\n type = \"primary\",\n fulfilledStepIcon = Check,\n fulfilledStepIconType = \"svg\",\n isFulfilledStepDisplayNumber = false,\n onClick = NOOP,\n isFollowedByDivider = false,\n stepDividerClassName,\n isVertical = false,\n id,\n size = \"regular\",\n \"data-testid\": dataTestId\n}: StepIndicatorProps) => {\n // Animations state\n const [statusChangeAnimationState, setStatusChangeAnimationState] = useState(false);\n\n // Refs\n const componentRef = useRef(null);\n const prevStatusRef = useRef(status);\n\n // Callbacks for modifying animation state\n const enableStatusChangeAnimation = useCallback(() => {\n setStatusChangeAnimationState(true);\n }, [setStatusChangeAnimationState]);\n\n const disableStatusChangeAnimation = useCallback(() => {\n setStatusChangeAnimationState(false);\n }, [setStatusChangeAnimationState]);\n\n const isStatusTransition = useCallback(() => prevStatusRef.current !== status, [prevStatusRef, status]);\n\n const handleClick = useCallback(() => {\n if (onClick) onClick(stepNumber);\n }, [onClick, stepNumber]);\n\n // Event listeners for removing animation.\n useEventListener({\n eventName: \"animationend\",\n callback: disableStatusChangeAnimation,\n ref: componentRef\n });\n\n useKeyEvent({\n keys: KEYS,\n callback: handleClick,\n ref: componentRef\n });\n\n // Effect - triggering animation when necessary.\n useEffect(() => {\n if (isStatusTransition()) {\n enableStatusChangeAnimation();\n }\n }, [status, isStatusTransition, enableStatusChangeAnimation]);\n\n // Effect - updating previous status ref value (for animation) after component update.\n useEffect(() => {\n prevStatusRef.current = status;\n }, [status]);\n\n const ariaLabel = useMemo(() => {\n return `Step ${stepNumber}: ${titleText} - ${subtitleText}, status: ${status}`;\n }, [status, titleText, stepNumber, subtitleText]);\n\n const getClassNamesWithSuffix = (suffix: string) => {\n return [\n getStyle(styles, camelCase(suffix || \"indicator\")),\n getStyle(styles, camelCase(`type-${type}${suffix}`)),\n getStyle(styles, camelCase(`status-${status}${suffix}`)),\n getStyle(styles, camelCase(`size-${size}${suffix}`))\n ];\n };\n\n return (\n <Clickable\n tabIndex=\"-1\"\n elementType=\"li\"\n className={cx(...getClassNamesWithSuffix(\"\"), stepComponentClassName, {\n [styles.withAnimation]: statusChangeAnimationState,\n [styles.clickable]: onClick,\n [styles.textPlacementVertical]: isVertical\n })}\n aria-label={ariaLabel}\n onClick={handleClick}\n data-testid={dataTestId || getTestId(ComponentDefaultTestId.STEP_INDICATOR, id)}\n >\n <div className={cx(...getClassNamesWithSuffix(\"__number-divider-container\"))}>\n <div\n className={cx(...getClassNamesWithSuffix(\"__number-container\"))}\n ref={componentRef}\n tabIndex={0}\n role=\"button\"\n >\n <SwitchTransition mode=\"out-in\">\n <CSSTransition<undefined>\n // CSSTransition needs to be specified with the generic parameter to decide type for addEndListener's callback\n // otherwise, addEndListener cb has only `done` param (ts error)\n classNames={{\n enter: styles.swapEnter,\n enterActive: styles.swapEnterActive,\n exit: styles.swapExit,\n exitActive: styles.swapExitActive\n }}\n addEndListener={(node: HTMLElement, done: () => void) => {\n node.addEventListener(\"transitionend\", done, false);\n }}\n key={status}\n >\n <span className={cx(...getClassNamesWithSuffix(\"__number-container__text\"))}>\n <StepCircleDisplay\n fulfilledStepIcon={fulfilledStepIcon}\n fulfilledStepIconType={fulfilledStepIconType}\n isFulfilledStepDisplayNumber={isFulfilledStepDisplayNumber}\n stepNumber={stepNumber}\n status={status}\n />\n </span>\n </CSSTransition>\n </SwitchTransition>\n </div>\n {isFollowedByDivider && isVertical && <Divider className={cx(styles.divider, stepDividerClassName)} />}\n </div>\n <div className={cx(...getClassNamesWithSuffix(\"__text-container\"))}>\n <div className={cx(...getClassNamesWithSuffix(\"__text-container__title\"))}>\n <HiddenText text={status} /> {/* for accessibility */}\n <span className={cx(...getClassNamesWithSuffix(\"__text-container__title__text\"))}>{titleText}</span>\n </div>\n {size !== \"compact\" ? (\n <span className={cx(...getClassNamesWithSuffix(\"__text-container__subtitle__text\"))}>{subtitleText}</span>\n ) : null}\n </div>\n </Clickable>\n );\n};\n\nexport default StepIndicator;\n"],"names":["KEYS","keyCodes","ENTER","SPACE","StepCircleDisplay","_ref","fulfilledStepIcon","fulfilledStepIconType","status","isFulfilledStepDisplayNumber","React","createElement","Fragment","stepNumber","Icon","icon","className","classNames","styles","numberContainerTextCheckIcon","iconType","ignoreFocusStyle","ariaHidden","StepIndicator","_ref2","stepComponentClassName","_ref2$stepNumber","_ref2$status","_ref2$titleText","titleText","_ref2$subtitleText","subtitleText","_ref2$type","type","_ref2$fulfilledStepIc","Check","_ref2$fulfilledStepIc2","_ref2$isFulfilledStep","_ref2$onClick","onClick","NOOP","_ref2$isFollowedByDiv","isFollowedByDivider","stepDividerClassName","_ref2$isVertical","isVertical","id","_ref2$size","size","dataTestId","_useState","useState","_useState2","_slicedToArray","statusChangeAnimationState","setStatusChangeAnimationState","componentRef","useRef","prevStatusRef","enableStatusChangeAnimation","useCallback","disableStatusChangeAnimation","isStatusTransition","current","handleClick","useEventListener","eventName","callback","ref","useKeyEvent","keys","useEffect","ariaLabel","useMemo","concat","getClassNamesWithSuffix","suffix","getStyle","camelCase","Clickable","tabIndex","elementType","cx","apply","_toConsumableArray","_defineProperty","withAnimation","clickable","textPlacementVertical","getTestId","ComponentDefaultTestId","STEP_INDICATOR","role","SwitchTransition","mode","CSSTransition","enter","swapEnter","enterActive","swapEnterActive","exit","swapExit","exitActive","swapExitActive","addEndListener","node","done","addEventListener","key","Divider","divider","HiddenText","text"],"mappings":"siCAqBA,IAAMA,EAAO,CAACC,EAASC,MAAOD,EAASE,OAyBjCC,EAAsD,SAArCC,GAMlB,IAHHC,EAAiBD,EAAjBC,kBACAC,EAAqBF,EAArBE,sBAGA,MAAkB,cANZF,EAANG,QAC4BH,EAA5BI,6BAcEC,EAAGC,cAAAD,EAAAE,SAAA,KAXKP,EAAVQ,YAGEH,gBAACI,EAAI,CACHC,KAAMT,EACNU,UAAWC,EAAWC,EAAOC,8BAC7BC,SAAUb,EACVc,oBACAC,YAAY,GAKlB,EA6DMC,EAA8C,SAAjCC,GAiBM,IAhBvBC,EAAsBD,EAAtBC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AOiF,gBACpBC,KAAMlF,EAAOmF,SACbC,WAAYpF,EAAOqF,gBAErBC,eAAgB,SAACC,EAAmBC,GAClCD,EAAKE,iBAAiB,gBAAiBD,GAAM,EAC9C,EACDE,IAAKpG,GAELE,EAAMC,cAAA,OAAA,CAAAK,UAAWkE,EAAEC,WAAA,EAAAC,EAAIT,GAAwB,+BAC7CjE,EAACC,cAAAP,EACC,CAAAE,kBAAmBA,EACnBC,sBAAuBA,EACvBE,6BAA8BA,EAC9BI,WAAYA,EACZL,OAAQA,QAMjBkC,GAAuBG,GAAcnC,EAACC,cAAAkG,GAAQ7F,UAAWkE,EAAGhE,EAAO4F,QAASnE,MAE/EjC,EAAKC,cAAA,MAAA,CAAAK,UAAWkE,EAAEC,WAAA,EAAAC,EAAIT,GAAwB,uBAC5CjE,EAAKC,cAAA,MAAA,CAAAK,UAAWkE,EAAEC,WAAA,EAAAC,EAAIT,GAAwB,8BAC5CjE,EAAAC,cAACoG,EAAU,CAACC,KAAMxG,QAClBE,EAAAC,cAAA,OAAA,CAAMK,UAAWkE,EAAEC,WAAA,EAAAC,EAAIT,GAAwB,oCAAoC9C,IAE3E,YAATmB,EACCtC,EAAMC,cAAA,OAAA,CAAAK,UAAWkE,EAAEC,WAAA,EAAAC,EAAIT,GAAwB,uCAAuC5C,GACpF,MAIZ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e}from"../../../_virtual/_tslib.js";import a,{forwardRef as n,useRef as t,useMemo as r}from"react";import i from"classnames";import o from"./hooks/useNumberFieldState.js";import l from"./hooks/useSpinButtonHandlers.js";import
|
|
1
|
+
import{__rest as e}from"../../../_virtual/_tslib.js";import a,{forwardRef as n,useRef as t,useMemo as r}from"react";import i from"classnames";import o from"./hooks/useNumberFieldState.js";import l from"./hooks/useSpinButtonHandlers.js";import s from"../FieldLabel/FieldLabel.js";import d from"../InfoText/InfoText.js";import m from"./components/NumberFieldSpinButton/NumberFieldSpinButton.js";import u from"./NumberField.module.scss.js";import c from"../Flex/Flex.js";import p from"../../hooks/useMergeRef.js";import{ComponentVibeId as f}from"../../tests/constants.js";import b from"../../../components/icon/dist/Icon/Icon.js";import x from"../../../base/dist/BaseInput/BaseInput.js";var h=n((function(n,h){var v=n.className,O=n.value,g=n.onChange,y=n.label,j=n.required,I=n.placeholder,F=n.infoText,B=n.error,N=n.success,C=n.disabled,E=n.readOnly,w=n.min,M=n.max,D=n.step,R=void 0===D?1:D,T=n.size,V=void 0===T?"medium":T,q=n.leftIcon,z=n["aria-label"],A=n.id,L=n["data-testid"],S=n.allowOutOfBounds,k=n.onValidityChange,_=e(n,["className","value","onChange","label","required","placeholder","infoText","error","success","disabled","readOnly","min","max","step","size","leftIcon","aria-label","id","data-testid","allowOutOfBounds","onValidityChange"]),K=t(null),H=p(h,K),U=o({value:O,onChange:g,min:w,max:M,step:R,disabled:C,readOnly:E,allowOutOfBounds:S,onValidityChange:k}),G=U.inputValue,J=U.numericValue,P=U.onChange,Q=U.onKeyDown,W=U.isAtMin,X=U.isAtMax,Y=l({onChange:g,value:J,step:R,min:w,max:M,allowOutOfBounds:S,readOnly:E,inputRef:K}),Z=Y.onIncrement,$=Y.onDecrement,ee=r((function(){return q?a.createElement(b,{icon:q,className:u.leftIcon}):null}),[q]),ae=r((function(){return a.createElement(m,{inputId:A,onIncrement:Z,onDecrement:$,disabled:C||E,size:V,isAtMin:W,isAtMax:X})}),[A,Z,$,C,E,V,W,X]),ne=r((function(){return F&&A?"".concat(A,"-info-text"):void 0}),[F,A]),te=r((function(){return y&&A?"".concat(A,"-label"):void 0}),[y,A]);return a.createElement(c,{direction:"column",align:"stretch",gap:"xs",className:i(u.numberField,v),"data-vibe":f.NUMBER_FIELD},a.createElement(s,{id:te,className:u.label,labelText:y,required:j,labelFor:A}),a.createElement(x,Object.assign({},_,{"data-testid":L,ref:H,id:A,value:G,onChange:P,onKeyDown:Q,placeholder:I,type:"text",inputMode:"numeric",inputRole:"spinbutton","aria-valuenow":J,"aria-valuemin":w,"aria-valuemax":M,"aria-required":j,"aria-label":z||y,"aria-labelledby":te,"aria-describedby":ne,disabled:C,readOnly:E,size:V,error:B,success:N,renderLeft:ee,renderRight:ae})),a.createElement(d,{id:ne,text:F,error:B,success:N,disabled:C,readOnly:E}))}));export{h as default};
|
|
2
2
|
//# sourceMappingURL=NumberField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberField.js","sources":["../../../../../src/components/NumberField/NumberField.tsx"],"sourcesContent":["import React, { forwardRef, useMemo, useRef } from \"react\";\nimport cx from \"classnames\";\nimport { type NumberFieldProps } from \"./NumberField.types\";\nimport useNumberFieldState from \"./hooks/useNumberFieldState\";\nimport useSpinButtonHandlers from \"./hooks/useSpinButtonHandlers\";\nimport { BaseInput } from \"@vibe/base\";\nimport FieldLabel from \"../FieldLabel/FieldLabel\";\nimport InfoText from \"../InfoText/InfoText\";\nimport { Icon } from \"@vibe/icon\";\nimport NumberFieldSpinButton from \"./components/NumberFieldSpinButton/NumberFieldSpinButton\";\nimport styles from \"./NumberField.module.scss\";\nimport Flex from \"../Flex/Flex\";\nimport useMergeRef from \"../../hooks/useMergeRef\";\nimport { ComponentVibeId } from \"../../tests/constants\";\n\nconst NumberField = forwardRef(\n (\n {\n className,\n value,\n onChange,\n label,\n required,\n placeholder,\n infoText,\n error,\n success,\n disabled,\n readOnly,\n min,\n max,\n step = 1,\n size = \"medium\",\n leftIcon,\n \"aria-label\": ariaLabel,\n id,\n \"data-testid\": dataTestId,\n allowOutOfBounds,\n onValidityChange,\n ...inputProps\n }: NumberFieldProps,\n ref: React.ForwardedRef<HTMLInputElement>\n ) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const mergedRef = useMergeRef<HTMLInputElement>(ref, inputRef);\n\n const {\n inputValue,\n numericValue,\n onChange: handleChange,\n onKeyDown,\n isAtMin,\n isAtMax\n } = useNumberFieldState({\n value,\n onChange,\n min,\n max,\n step,\n disabled,\n readOnly,\n allowOutOfBounds,\n onValidityChange\n });\n\n const { onIncrement, onDecrement } = useSpinButtonHandlers({\n onChange,\n value: numericValue,\n step,\n min,\n max,\n allowOutOfBounds,\n readOnly,\n inputRef\n });\n\n const renderedLeftIcon = useMemo(() => {\n if (!leftIcon) return null;\n return <Icon icon={leftIcon} className={styles.leftIcon} />;\n }, [leftIcon]);\n\n const renderedRightIcon = useMemo(() => {\n return (\n <NumberFieldSpinButton\n inputId={id}\n onIncrement={onIncrement}\n onDecrement={onDecrement}\n disabled={disabled || readOnly}\n size={size}\n isAtMin={isAtMin}\n isAtMax={isAtMax}\n />\n );\n }, [id, onIncrement, onDecrement, disabled, readOnly, size, isAtMin, isAtMax]);\n\n const infoTextId = useMemo(() => {\n return infoText && id ? `${id}-info-text` : undefined;\n }, [infoText, id]);\n\n const labelId = useMemo(() => {\n return label && id ? `${id}-label` : undefined;\n }, [label, id]);\n\n return (\n <Flex\n direction=\"column\"\n align=\"stretch\"\n gap=\"xs\"\n className={cx(styles.numberField, className)}\n data-vibe={ComponentVibeId.NUMBER_FIELD}\n >\n <FieldLabel id={labelId} className={styles.label} labelText={label} required={required} labelFor={id} />\n <BaseInput\n {...inputProps}\n data-testid={dataTestId}\n ref={mergedRef}\n id={id}\n value={inputValue}\n onChange={handleChange}\n onKeyDown={onKeyDown}\n placeholder={placeholder}\n type=\"text\"\n inputMode=\"numeric\"\n inputRole=\"spinbutton\"\n aria-valuenow={numericValue}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-required={required}\n aria-label={ariaLabel || label}\n aria-labelledby={labelId}\n aria-describedby={infoTextId}\n disabled={disabled}\n readOnly={readOnly}\n size={size}\n error={error}\n success={success}\n renderLeft={renderedLeftIcon}\n renderRight={renderedRightIcon}\n />\n <InfoText\n id={infoTextId}\n text={infoText}\n error={error}\n success={success}\n disabled={disabled}\n readOnly={readOnly}\n />\n </Flex>\n );\n }\n);\n\nexport default NumberField;\n"],"names":["NumberField","forwardRef","_a","ref","className","value","onChange","label","required","placeholder","infoText","error","success","disabled","readOnly","min","max","_a$step","step","_a$size","size","leftIcon","ariaLabel","id","dataTestId","allowOutOfBounds","onValidityChange","inputProps","__rest","inputRef","useRef","mergedRef","useMergeRef","_useNumberFieldState","useNumberFieldState","inputValue","numericValue","handleChange","onKeyDown","isAtMin","isAtMax","_useSpinButtonHandler","useSpinButtonHandlers","onIncrement","onDecrement","renderedLeftIcon","useMemo","React","createElement","Icon","icon","styles","renderedRightIcon","NumberFieldSpinButton","inputId","infoTextId","concat","undefined","labelId","Flex","direction","align","gap","cx","numberField","ComponentVibeId","NUMBER_FIELD","FieldLabel","labelText","labelFor","BaseInput","Object","assign","type","inputMode","inputRole","renderLeft","renderRight","InfoText","text"],"mappings":"
|
|
1
|
+
{"version":3,"file":"NumberField.js","sources":["../../../../../src/components/NumberField/NumberField.tsx"],"sourcesContent":["import React, { forwardRef, useMemo, useRef } from \"react\";\nimport cx from \"classnames\";\nimport { type NumberFieldProps } from \"./NumberField.types\";\nimport useNumberFieldState from \"./hooks/useNumberFieldState\";\nimport useSpinButtonHandlers from \"./hooks/useSpinButtonHandlers\";\nimport { BaseInput } from \"@vibe/base\";\nimport FieldLabel from \"../FieldLabel/FieldLabel\";\nimport InfoText from \"../InfoText/InfoText\";\nimport { Icon } from \"@vibe/icon\";\nimport NumberFieldSpinButton from \"./components/NumberFieldSpinButton/NumberFieldSpinButton\";\nimport styles from \"./NumberField.module.scss\";\nimport Flex from \"../Flex/Flex\";\nimport useMergeRef from \"../../hooks/useMergeRef\";\nimport { ComponentVibeId } from \"../../tests/constants\";\n\nconst NumberField = forwardRef(\n (\n {\n className,\n value,\n onChange,\n label,\n required,\n placeholder,\n infoText,\n error,\n success,\n disabled,\n readOnly,\n min,\n max,\n step = 1,\n size = \"medium\",\n leftIcon,\n \"aria-label\": ariaLabel,\n id,\n \"data-testid\": dataTestId,\n allowOutOfBounds,\n onValidityChange,\n ...inputProps\n }: NumberFieldProps,\n ref: React.ForwardedRef<HTMLInputElement>\n ) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const mergedRef = useMergeRef<HTMLInputElement>(ref, inputRef);\n\n const {\n inputValue,\n numericValue,\n onChange: handleChange,\n onKeyDown,\n isAtMin,\n isAtMax\n } = useNumberFieldState({\n value,\n onChange,\n min,\n max,\n step,\n disabled,\n readOnly,\n allowOutOfBounds,\n onValidityChange\n });\n\n const { onIncrement, onDecrement } = useSpinButtonHandlers({\n onChange,\n value: numericValue,\n step,\n min,\n max,\n allowOutOfBounds,\n readOnly,\n inputRef\n });\n\n const renderedLeftIcon = useMemo(() => {\n if (!leftIcon) return null;\n return <Icon icon={leftIcon} className={styles.leftIcon} />;\n }, [leftIcon]);\n\n const renderedRightIcon = useMemo(() => {\n return (\n <NumberFieldSpinButton\n inputId={id}\n onIncrement={onIncrement}\n onDecrement={onDecrement}\n disabled={disabled || readOnly}\n size={size}\n isAtMin={isAtMin}\n isAtMax={isAtMax}\n />\n );\n }, [id, onIncrement, onDecrement, disabled, readOnly, size, isAtMin, isAtMax]);\n\n const infoTextId = useMemo(() => {\n return infoText && id ? `${id}-info-text` : undefined;\n }, [infoText, id]);\n\n const labelId = useMemo(() => {\n return label && id ? `${id}-label` : undefined;\n }, [label, id]);\n\n return (\n <Flex\n direction=\"column\"\n align=\"stretch\"\n gap=\"xs\"\n className={cx(styles.numberField, className)}\n data-vibe={ComponentVibeId.NUMBER_FIELD}\n >\n <FieldLabel id={labelId} className={styles.label} labelText={label} required={required} labelFor={id} />\n <BaseInput\n {...inputProps}\n data-testid={dataTestId}\n ref={mergedRef}\n id={id}\n value={inputValue}\n onChange={handleChange}\n onKeyDown={onKeyDown}\n placeholder={placeholder}\n type=\"text\"\n inputMode=\"numeric\"\n inputRole=\"spinbutton\"\n aria-valuenow={numericValue}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-required={required}\n aria-label={ariaLabel || label}\n aria-labelledby={labelId}\n aria-describedby={infoTextId}\n disabled={disabled}\n readOnly={readOnly}\n size={size}\n error={error}\n success={success}\n renderLeft={renderedLeftIcon}\n renderRight={renderedRightIcon}\n />\n <InfoText\n id={infoTextId}\n text={infoText}\n error={error}\n success={success}\n disabled={disabled}\n readOnly={readOnly}\n />\n </Flex>\n );\n }\n);\n\nexport default NumberField;\n"],"names":["NumberField","forwardRef","_a","ref","className","value","onChange","label","required","placeholder","infoText","error","success","disabled","readOnly","min","max","_a$step","step","_a$size","size","leftIcon","ariaLabel","id","dataTestId","allowOutOfBounds","onValidityChange","inputProps","__rest","inputRef","useRef","mergedRef","useMergeRef","_useNumberFieldState","useNumberFieldState","inputValue","numericValue","handleChange","onKeyDown","isAtMin","isAtMax","_useSpinButtonHandler","useSpinButtonHandlers","onIncrement","onDecrement","renderedLeftIcon","useMemo","React","createElement","Icon","icon","styles","renderedRightIcon","NumberFieldSpinButton","inputId","infoTextId","concat","undefined","labelId","Flex","direction","align","gap","cx","numberField","ComponentVibeId","NUMBER_FIELD","FieldLabel","labelText","labelFor","BaseInput","Object","assign","type","inputMode","inputRole","renderLeft","renderRight","InfoText","text"],"mappings":"4qBAeMA,IAAAA,EAAcC,GAClB,SACEC,EAwBAC,OAvBEC,EAoBgBF,EApBhBE,UACAC,EAmBgBH,EAnBhBG,MACAC,EAkBgBJ,EAlBhBI,SACAC,EAiBgBL,EAjBhBK,MACAC,EAgBgBN,EAhBhBM,SACAC,EAegBP,EAfhBO,YACAC,EAcgBR,EAdhBQ,SACAC,EAagBT,EAbhBS,MACAC,EAYgBV,EAZhBU,QACAC,EAWgBX,EAXhBW,SACAC,EAUgBZ,EAVhBY,SACAC,EASgBb,EAThBa,IACAC,EAQgBd,EARhBc,IAAGC,EAQaf,EAPhBgB,KAAAA,OAAO,IAAHD,EAAG,EAACA,EAAAE,EAOQjB,EANhBkB,KAAAA,OAAO,IAAHD,EAAG,SAAQA,EACfE,EAKgBnB,EALhBmB,SACcC,EAIEpB,EAJhB,cACAqB,EAGgBrB,EAHhBqB,GACeC,EAECtB,EAFhB,eACAuB,EACgBvB,EADhBuB,iBACAC,EAAgBxB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AClD,EAAOgB,IAEX,OACEwB,EAAAC,cAACW,EAAI,CACHC,UAAU,SACVC,MAAM,UACNC,IAAI,KACJ1D,UAAW2D,EAAGZ,EAAOa,YAAa5D,GACvB,YAAA6D,EAAgBC,cAE3BnB,EAACC,cAAAmB,GAAW5C,GAAImC,GAAStD,UAAW+C,EAAO5C,MAAO6D,UAAW7D,EAAOC,SAAUA,EAAU6D,SAAU9C,IAClGwB,EAAAC,cAACsB,EACKC,OAAAC,OAAA,CAAA,EAAA7C,iBACSH,EACbrB,IAAK4B,EACLR,GAAIA,EACJlB,MAAO8B,EACP7B,SAAU+B,EACVC,UAAWA,EACX7B,YAAaA,EACbgE,KAAK,OACLC,UAAU,UACVC,UAAU,aAAY,gBACPvC,EAAY,gBACZrB,EACA,gBAAAC,kBACAR,EAAQ,aACXc,GAAaf,EACR,kBAAAmD,sBACCH,GAClB1C,SAAUA,EACVC,SAAUA,EACVM,KAAMA,EACNT,MAAOA,EACPC,QAASA,EACTgE,WAAY/B,GACZgC,YAAazB,MAEfL,EAAAC,cAAC8B,EAAQ,CACPvD,GAAIgC,GACJwB,KAAMrE,EACNC,MAAOA,EACPC,QAASA,EACTC,SAAUA,EACVC,SAAUA,IAIlB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import o from"classnames";import
|
|
1
|
+
import e from"react";import o from"classnames";import n from"../../../IconButton/IconButton.js";import t from"../../../Flex/Flex.js";import{getStyle as r}from"../../../../helpers/typesciptCssModulesHelper.js";import i from"./NumberFieldSpinButton.module.scss.js";import s from"../../../../../icons/dist/react/DropdownChevronUp.js";import a from"../../../../../icons/dist/react/DropdownChevronDown.js";var l=function(l){var c=l.inputId,m=l.onIncrement,p=l.onDecrement,d=l.disabled,u=l.isAtMin,f=l.isAtMax,C=o(i.spinButton,r(i,l.size)),b=i.icon;return e.createElement(t,{direction:"column",align:"stretch",justify:"center",onMouseDown:function(e){e.preventDefault()}},e.createElement(n,{ariaLabel:"Increase",hideTooltip:!0,ariaControls:c,tabIndex:-1,onClick:m,disabled:d||f,size:null,className:C,iconClassName:b,icon:s}),e.createElement(n,{ariaLabel:"Decrease",hideTooltip:!0,ariaControls:c,tabIndex:-1,onClick:p,disabled:d||u,size:null,className:C,iconClassName:b,icon:a}))};export{l as default};
|
|
2
2
|
//# sourceMappingURL=NumberFieldSpinButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberFieldSpinButton.js","sources":["../../../../../../../src/components/NumberField/components/NumberFieldSpinButton/NumberFieldSpinButton.tsx"],"sourcesContent":["import React from \"react\";\nimport cx from \"classnames\";\nimport { type NumberFieldSpinButtonProps } from \"./NumberFieldSpinButton.types\";\nimport IconButton from \"../../../IconButton/IconButton\";\nimport { DropdownChevronUp, DropdownChevronDown } from \"@vibe/icons\";\nimport Flex from \"../../../Flex/Flex\";\nimport { getStyle } from \"../../../../helpers/typesciptCssModulesHelper\";\nimport styles from \"./NumberFieldSpinButton.module.scss\";\n\nconst NumberFieldSpinButton = ({\n inputId,\n onIncrement,\n onDecrement,\n disabled,\n size,\n isAtMin,\n isAtMax\n}: NumberFieldSpinButtonProps) => {\n const iconButtonClassName = cx(styles.spinButton, getStyle(styles, size));\n const iconClassName = styles.icon;\n\n const handleMouseDown = (event: React.MouseEvent) => {\n // to prevent `IconButton`s from stealing focus\n event.preventDefault();\n };\n\n return (\n <Flex direction=\"column\" align=\"stretch\" justify=\"center\" onMouseDown={handleMouseDown}>\n <IconButton\n ariaLabel=\"Increase\"\n hideTooltip\n ariaControls={inputId}\n tabIndex={-1}\n onClick={onIncrement}\n disabled={disabled || isAtMax}\n size={null}\n className={iconButtonClassName}\n iconClassName={iconClassName}\n icon={DropdownChevronUp}\n />\n <IconButton\n ariaLabel=\"Decrease\"\n hideTooltip\n ariaControls={inputId}\n tabIndex={-1}\n onClick={onDecrement}\n disabled={disabled || isAtMin}\n size={null}\n className={iconButtonClassName}\n iconClassName={iconClassName}\n icon={DropdownChevronDown}\n />\n </Flex>\n );\n};\n\nexport default NumberFieldSpinButton;\n"],"names":["NumberFieldSpinButton","_ref","inputId","onIncrement","onDecrement","disabled","isAtMin","isAtMax","iconButtonClassName","cx","styles","spinButton","getStyle","size","iconClassName","icon","React","createElement","Flex","direction","align","justify","onMouseDown","event","preventDefault","IconButton","ariaLabel","hideTooltip","ariaControls","tabIndex","onClick","className","DropdownChevronUp","DropdownChevronDown"],"mappings":"
|
|
1
|
+
{"version":3,"file":"NumberFieldSpinButton.js","sources":["../../../../../../../src/components/NumberField/components/NumberFieldSpinButton/NumberFieldSpinButton.tsx"],"sourcesContent":["import React from \"react\";\nimport cx from \"classnames\";\nimport { type NumberFieldSpinButtonProps } from \"./NumberFieldSpinButton.types\";\nimport IconButton from \"../../../IconButton/IconButton\";\nimport { DropdownChevronUp, DropdownChevronDown } from \"@vibe/icons\";\nimport Flex from \"../../../Flex/Flex\";\nimport { getStyle } from \"../../../../helpers/typesciptCssModulesHelper\";\nimport styles from \"./NumberFieldSpinButton.module.scss\";\n\nconst NumberFieldSpinButton = ({\n inputId,\n onIncrement,\n onDecrement,\n disabled,\n size,\n isAtMin,\n isAtMax\n}: NumberFieldSpinButtonProps) => {\n const iconButtonClassName = cx(styles.spinButton, getStyle(styles, size));\n const iconClassName = styles.icon;\n\n const handleMouseDown = (event: React.MouseEvent) => {\n // to prevent `IconButton`s from stealing focus\n event.preventDefault();\n };\n\n return (\n <Flex direction=\"column\" align=\"stretch\" justify=\"center\" onMouseDown={handleMouseDown}>\n <IconButton\n ariaLabel=\"Increase\"\n hideTooltip\n ariaControls={inputId}\n tabIndex={-1}\n onClick={onIncrement}\n disabled={disabled || isAtMax}\n size={null}\n className={iconButtonClassName}\n iconClassName={iconClassName}\n icon={DropdownChevronUp}\n />\n <IconButton\n ariaLabel=\"Decrease\"\n hideTooltip\n ariaControls={inputId}\n tabIndex={-1}\n onClick={onDecrement}\n disabled={disabled || isAtMin}\n size={null}\n className={iconButtonClassName}\n iconClassName={iconClassName}\n icon={DropdownChevronDown}\n />\n </Flex>\n );\n};\n\nexport default NumberFieldSpinButton;\n"],"names":["NumberFieldSpinButton","_ref","inputId","onIncrement","onDecrement","disabled","isAtMin","isAtMax","iconButtonClassName","cx","styles","spinButton","getStyle","size","iconClassName","icon","React","createElement","Flex","direction","align","justify","onMouseDown","event","preventDefault","IconButton","ariaLabel","hideTooltip","ariaControls","tabIndex","onClick","className","DropdownChevronUp","DropdownChevronDown"],"mappings":"iZASA,IAAMA,EAAwB,SAAHC,GAQM,IAP/BC,EAAOD,EAAPC,QACAC,EAAWF,EAAXE,YACAC,EAAWH,EAAXG,YACAC,EAAQJ,EAARI,SAEAC,EAAOL,EAAPK,QACAC,EAAON,EAAPM,QAEMC,EAAsBC,EAAGC,EAAOC,WAAYC,EAASF,EAJvDT,EAAJY,OAKMC,EAAgBJ,EAAOK,KAO7B,OACEC,EAACC,cAAAC,GAAKC,UAAU,SAASC,MAAM,UAAUC,QAAQ,SAASC,YANpC,SAACC,GAEvBA,EAAMC,mBAKJR,EAAAC,cAACQ,EACC,CAAAC,UAAU,WACVC,aACA,EAAAC,aAAc1B,EACd2B,UAAW,EACXC,QAAS3B,EACTE,SAAUA,GAAYE,EACtBM,KAAM,KACNkB,UAAWvB,EACXM,cAAeA,EACfC,KAAMiB,IAERhB,EAACC,cAAAQ,GACCC,UAAU,WACVC,eACAC,aAAc1B,EACd2B,UAAW,EACXC,QAAS1B,EACTC,SAAUA,GAAYC,EACtBO,KAAM,KACNkB,UAAWvB,EACXM,cAAeA,EACfC,KAAMkB,IAId"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defineProperty as e}from"../../../_virtual/_rollupPluginBabelHelpers.js";import
|
|
1
|
+
import{defineProperty as e}from"../../../_virtual/_rollupPluginBabelHelpers.js";import o from"classnames";import a,{forwardRef as r,useRef as t,useCallback as n}from"react";import s from"../../hooks/useMergeRef.js";import{getTestId as i,ComponentDefaultTestId as l}from"../../tests/testIds.js";import c from"./Search.module.scss.js";import d from"../../hooks/useDebounceEvent/index.js";import m from"../IconButton/IconButton.js";import{ComponentVibeId as u}from"../../tests/constants.js";import p from"../../../components/loader/dist/Loader/Loader.js";import f from"../../../base/dist/BaseInput/BaseInput.js";import v from"../../../icons/dist/react/CloseSmall.js";import h from"../../../components/icon/dist/Icon/Icon.js";import C from"../../../icons/dist/react/Search.js";var b=r((function(r,b){var I,j,E,R,N,g,x,y,A,B,S=r.searchIconName,L=void 0===S?C:S,w=r.clearIconName,z=void 0===w?v:w,F=r.clearIconLabel,H=void 0===F?"Clear":F,_=r.renderAction,k=r.hideRenderActionOnInput,D=r.value,P=r.placeholder,T=r.size,V=void 0===T?"medium":T,K=r.disabled,O=r.loading,M=r.autoFocus,U=r.autoComplete,W=void 0===U?"off":U,q=r.inputAriaLabel,G=r.debounceRate,J=void 0===G?400:G,Q=r.searchResultsContainerId,X=r.currentAriaResultId,Y=r.onChange,Z=r.onFocus,$=r.onBlur,ee=r.onClear,oe=r.onKeyDown,ae=r.className,re=r.ariaExpanded,te=r.ariaHasPopup,ne=r.showClearIcon,se=void 0===ne||ne,ie=r.id,le=r["data-testid"];return I=t(null),j=s(b,I),E=d({delay:J,onChange:Y,initialStateValue:D}),R=E.inputValue,N=E.onEventChanged,x=n((function(){var e,o;K||(null===(o=null===(e=I.current)||void 0===e?void 0:e.focus)||void 0===o||o.call(e),g(),null==ee||ee())}),[K,g=E.clearValue,ee]),y=a.createElement(h,{icon:L,className:c.icon,iconType:"font",iconSize:"small"===V?"16px":"20px"}),A=a.createElement(m,{className:o(c.icon,e({},c.empty,!R)),icon:z,ariaLabel:H,onClick:x,size:"small"===V?"xs":"small","data-testid":i(l.CLEAN_SEARCH_BUTTON,ie)}),B=a.createElement(a.Fragment,null,O&&a.createElement(p,{size:"small"===V?"xs":20,color:"secondary",wrapperClassName:o(e({},c.loader,!R&&!_))}),se&&R&&!K&&A,!(k&&R)&&_),a.createElement(f,{ref:j,id:ie,type:"search","data-testid":le||i(l.SEARCH,ie),"data-vibe":u.SEARCH,className:o(c.searchWrapper,ae),inputClassName:c.search,value:R,renderLeft:y,renderRight:B,autoFocus:M,placeholder:P,disabled:K,onChange:N,onBlur:$,onFocus:Z,onKeyDown:oe,autoComplete:W,size:V,wrapperRole:"search",inputRole:Q?"combobox":void 0,"aria-label":q,"aria-busy":O,"aria-controls":re?Q:void 0,"aria-activedescendant":X,"aria-haspopup":te,"aria-expanded":re})}));export{b as default};
|
|
2
2
|
//# sourceMappingURL=Search.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Search.js","sources":["../../../../../src/components/Search/Search.tsx"],"sourcesContent":["import cx from \"classnames\";\nimport React, { forwardRef, useCallback, useRef } from \"react\";\nimport useMergeRef from \"../../hooks/useMergeRef\";\nimport { CloseSmall as CloseSmallIcon, Search as SearchIcon } from \"@vibe/icons\";\nimport { ComponentDefaultTestId, getTestId } from \"../../tests/test-ids-utils\";\nimport styles from \"./Search.module.scss\";\nimport { BaseInput } from \"@vibe/base\";\nimport useDebounceEvent from \"../../hooks/useDebounceEvent\";\nimport IconButton from \"../IconButton/IconButton\";\nimport { Icon } from \"@vibe/icon\";\nimport { type SearchProps } from \"./Search.types\";\nimport { Loader } from \"@vibe/loader\";\nimport { ComponentVibeId } from \"../../tests/constants\";\n\nconst Search = forwardRef(\n (\n {\n searchIconName = SearchIcon,\n clearIconName = CloseSmallIcon,\n clearIconLabel = \"Clear\",\n renderAction: RenderAction,\n hideRenderActionOnInput,\n value,\n placeholder,\n size = \"medium\",\n disabled,\n loading,\n autoFocus,\n autoComplete = \"off\",\n inputAriaLabel,\n debounceRate = 400,\n searchResultsContainerId,\n currentAriaResultId,\n onChange,\n onFocus,\n onBlur,\n onClear,\n onKeyDown,\n className,\n ariaExpanded,\n ariaHasPopup,\n showClearIcon = true,\n id,\n \"data-testid\": dataTestId\n }: SearchProps,\n ref: React.ForwardedRef<HTMLInputElement>\n ) => {\n const inputRef = useRef(null);\n const mergedRef = useMergeRef(ref, inputRef);\n\n const { inputValue, onEventChanged, clearValue } = useDebounceEvent({\n delay: debounceRate,\n onChange,\n initialStateValue: value\n });\n\n const onClearButtonClick = useCallback(() => {\n if (disabled) return;\n inputRef.current?.focus?.();\n clearValue();\n onClear?.();\n }, [disabled, clearValue, onClear]);\n\n const SearchIcon = (\n <Icon\n icon={searchIconName}\n className={styles.icon}\n iconType=\"font\"\n iconSize={size === \"small\" ? \"16px\" : \"20px\"}\n />\n );\n\n const ClearIcon = (\n <IconButton\n className={cx(styles.icon, { [styles.empty]: !inputValue })}\n icon={clearIconName}\n ariaLabel={clearIconLabel}\n onClick={onClearButtonClick}\n size={size === \"small\" ? \"xs\" : \"small\"}\n data-testid={getTestId(ComponentDefaultTestId.CLEAN_SEARCH_BUTTON, id)}\n />\n );\n\n const RenderRight = (\n <>\n {loading && (\n <Loader\n size={size === \"small\" ? \"xs\" : 20}\n color=\"secondary\"\n wrapperClassName={cx({ [styles.loader]: !inputValue && !RenderAction })}\n />\n )}\n {showClearIcon && inputValue && !disabled && ClearIcon}\n {!(hideRenderActionOnInput && inputValue) && RenderAction}\n </>\n );\n\n return (\n <BaseInput\n ref={mergedRef}\n id={id}\n type={\"search\"}\n data-testid={dataTestId || getTestId(ComponentDefaultTestId.SEARCH, id)}\n data-vibe={ComponentVibeId.SEARCH}\n className={cx(styles.searchWrapper, className)}\n inputClassName={styles.search}\n value={inputValue}\n renderLeft={SearchIcon}\n renderRight={RenderRight}\n autoFocus={autoFocus}\n placeholder={placeholder}\n disabled={disabled}\n onChange={onEventChanged}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n autoComplete={autoComplete}\n size={size}\n wrapperRole=\"search\"\n inputRole={searchResultsContainerId ? \"combobox\" : undefined}\n aria-label={inputAriaLabel}\n aria-busy={loading}\n aria-controls={ariaExpanded ? searchResultsContainerId : undefined}\n aria-activedescendant={currentAriaResultId}\n aria-haspopup={ariaHasPopup}\n aria-expanded={ariaExpanded}\n />\n );\n }\n);\n\nexport default Search;\n"],"names":["Search","forwardRef","_ref","ref","inputRef","mergedRef","_useDebounceEvent","inputValue","onEventChanged","clearValue","onClearButtonClick","SearchIcon","ClearIcon","RenderRight","_ref$searchIconName","searchIconName","_ref$clearIconName","clearIconName","CloseSmallIcon","_ref$clearIconLabel","clearIconLabel","RenderAction","renderAction","hideRenderActionOnInput","value","placeholder","_ref$size","size","disabled","loading","autoFocus","_ref$autoComplete","autoComplete","inputAriaLabel","_ref$debounceRate","debounceRate","searchResultsContainerId","currentAriaResultId","onChange","onFocus","onBlur","onClear","onKeyDown","className","ariaExpanded","ariaHasPopup","_ref$showClearIcon","showClearIcon","id","dataTestId","useRef","useMergeRef","useDebounceEvent","delay","initialStateValue","useCallback","_b","current","_a","focus","React","createElement","Icon","icon","styles","iconType","iconSize","IconButton","cx","_defineProperty","empty","ariaLabel","onClick","getTestId","ComponentDefaultTestId","CLEAN_SEARCH_BUTTON","Fragment","Loader","color","wrapperClassName","loader","BaseInput","type","SEARCH","ComponentVibeId","searchWrapper","inputClassName","search","renderLeft","renderRight","wrapperRole","inputRole","undefined"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Search.js","sources":["../../../../../src/components/Search/Search.tsx"],"sourcesContent":["import cx from \"classnames\";\nimport React, { forwardRef, useCallback, useRef } from \"react\";\nimport useMergeRef from \"../../hooks/useMergeRef\";\nimport { CloseSmall as CloseSmallIcon, Search as SearchIcon } from \"@vibe/icons\";\nimport { ComponentDefaultTestId, getTestId } from \"../../tests/test-ids-utils\";\nimport styles from \"./Search.module.scss\";\nimport { BaseInput } from \"@vibe/base\";\nimport useDebounceEvent from \"../../hooks/useDebounceEvent\";\nimport IconButton from \"../IconButton/IconButton\";\nimport { Icon } from \"@vibe/icon\";\nimport { type SearchProps } from \"./Search.types\";\nimport { Loader } from \"@vibe/loader\";\nimport { ComponentVibeId } from \"../../tests/constants\";\n\nconst Search = forwardRef(\n (\n {\n searchIconName = SearchIcon,\n clearIconName = CloseSmallIcon,\n clearIconLabel = \"Clear\",\n renderAction: RenderAction,\n hideRenderActionOnInput,\n value,\n placeholder,\n size = \"medium\",\n disabled,\n loading,\n autoFocus,\n autoComplete = \"off\",\n inputAriaLabel,\n debounceRate = 400,\n searchResultsContainerId,\n currentAriaResultId,\n onChange,\n onFocus,\n onBlur,\n onClear,\n onKeyDown,\n className,\n ariaExpanded,\n ariaHasPopup,\n showClearIcon = true,\n id,\n \"data-testid\": dataTestId\n }: SearchProps,\n ref: React.ForwardedRef<HTMLInputElement>\n ) => {\n const inputRef = useRef(null);\n const mergedRef = useMergeRef(ref, inputRef);\n\n const { inputValue, onEventChanged, clearValue } = useDebounceEvent({\n delay: debounceRate,\n onChange,\n initialStateValue: value\n });\n\n const onClearButtonClick = useCallback(() => {\n if (disabled) return;\n inputRef.current?.focus?.();\n clearValue();\n onClear?.();\n }, [disabled, clearValue, onClear]);\n\n const SearchIcon = (\n <Icon\n icon={searchIconName}\n className={styles.icon}\n iconType=\"font\"\n iconSize={size === \"small\" ? \"16px\" : \"20px\"}\n />\n );\n\n const ClearIcon = (\n <IconButton\n className={cx(styles.icon, { [styles.empty]: !inputValue })}\n icon={clearIconName}\n ariaLabel={clearIconLabel}\n onClick={onClearButtonClick}\n size={size === \"small\" ? \"xs\" : \"small\"}\n data-testid={getTestId(ComponentDefaultTestId.CLEAN_SEARCH_BUTTON, id)}\n />\n );\n\n const RenderRight = (\n <>\n {loading && (\n <Loader\n size={size === \"small\" ? \"xs\" : 20}\n color=\"secondary\"\n wrapperClassName={cx({ [styles.loader]: !inputValue && !RenderAction })}\n />\n )}\n {showClearIcon && inputValue && !disabled && ClearIcon}\n {!(hideRenderActionOnInput && inputValue) && RenderAction}\n </>\n );\n\n return (\n <BaseInput\n ref={mergedRef}\n id={id}\n type={\"search\"}\n data-testid={dataTestId || getTestId(ComponentDefaultTestId.SEARCH, id)}\n data-vibe={ComponentVibeId.SEARCH}\n className={cx(styles.searchWrapper, className)}\n inputClassName={styles.search}\n value={inputValue}\n renderLeft={SearchIcon}\n renderRight={RenderRight}\n autoFocus={autoFocus}\n placeholder={placeholder}\n disabled={disabled}\n onChange={onEventChanged}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n autoComplete={autoComplete}\n size={size}\n wrapperRole=\"search\"\n inputRole={searchResultsContainerId ? \"combobox\" : undefined}\n aria-label={inputAriaLabel}\n aria-busy={loading}\n aria-controls={ariaExpanded ? searchResultsContainerId : undefined}\n aria-activedescendant={currentAriaResultId}\n aria-haspopup={ariaHasPopup}\n aria-expanded={ariaExpanded}\n />\n );\n }\n);\n\nexport default Search;\n"],"names":["Search","forwardRef","_ref","ref","inputRef","mergedRef","_useDebounceEvent","inputValue","onEventChanged","clearValue","onClearButtonClick","SearchIcon","ClearIcon","RenderRight","_ref$searchIconName","searchIconName","_ref$clearIconName","clearIconName","CloseSmallIcon","_ref$clearIconLabel","clearIconLabel","RenderAction","renderAction","hideRenderActionOnInput","value","placeholder","_ref$size","size","disabled","loading","autoFocus","_ref$autoComplete","autoComplete","inputAriaLabel","_ref$debounceRate","debounceRate","searchResultsContainerId","currentAriaResultId","onChange","onFocus","onBlur","onClear","onKeyDown","className","ariaExpanded","ariaHasPopup","_ref$showClearIcon","showClearIcon","id","dataTestId","useRef","useMergeRef","useDebounceEvent","delay","initialStateValue","useCallback","_b","current","_a","focus","React","createElement","Icon","icon","styles","iconType","iconSize","IconButton","cx","_defineProperty","empty","ariaLabel","onClick","getTestId","ComponentDefaultTestId","CLEAN_SEARCH_BUTTON","Fragment","Loader","color","wrapperClassName","loader","BaseInput","type","SEARCH","ComponentVibeId","searchWrapper","inputClassName","search","renderLeft","renderRight","wrapperRole","inputRole","undefined"],"mappings":"qwBAcA,IAAMA,EAASC,GACb,SAAAC,EA8BEC,GAAyC,IAEnCC,EACAC,EAENC,EAAQC,EAAYC,EAAgBC,EAM9BC,EAOAC,EASAC,EAWAC,EAtCmCC,EAAAZ,EA5BvCa,eAAAA,OAAiBJ,IAAHG,EA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B,EAAOD,KAClBE,SAAS,OACTC,SAAmB,UAATvC,EAAmB,OAAS,SAIpCf,EACJgD,EAAAC,cAACM,EAAU,CACTxB,UAAWyB,EAAGJ,EAAOD,KAAIM,EAAKL,CAAAA,EAAAA,EAAOM,OAAS/D,IAC9CwD,KAAM9C,EACNsD,UAAWnD,EACXoD,QAAS9D,EACTiB,KAAe,UAATA,EAAmB,KAAO,QACnB,cAAA8C,EAAUC,EAAuBC,oBAAqB3B,MAIjEnC,EACJ+C,EAAAC,cAAAD,EAAAgB,SAAA,KACG/C,GACC+B,EAAAC,cAACgB,EACC,CAAAlD,KAAe,UAATA,EAAmB,KAAO,GAChCmD,MAAM,YACNC,iBAAkBX,EAAEC,KAAIL,EAAOgB,QAAUzE,IAAec,MAG3D0B,IAAiBxC,IAAeqB,GAAYhB,IAC1CW,GAA2BhB,IAAec,GAK/CuC,EAAAC,cAACoB,EAAS,CACR9E,IAAKE,EACL2C,GAAIA,GACJkC,KAAM,SACO,cAAAjC,IAAcwB,EAAUC,EAAuBS,OAAQnC,IAAG,YAC5DoC,EAAgBD,OAC3BxC,UAAWyB,EAAGJ,EAAOqB,cAAe1C,IACpC2C,eAAgBtB,EAAOuB,OACvB/D,MAAOjB,EACPiF,WAAY7E,EACZ8E,YAAa5E,EACbiB,UAAWA,EACXL,YAAaA,EACbG,SAAUA,EACVU,SAAU9B,EACVgC,OAAQA,EACRD,QAASA,EACTG,UAAWA,GACXV,aAAcA,EACdL,KAAMA,EACN+D,YAAY,SACZC,UAAWvD,EAA2B,gBAAawD,EAAS,aAChD3D,EAAc,YACfJ,EACI,gBAAAe,GAAeR,OAA2BwD,EAAS,wBAC3CvD,EAAmB,gBAC3BQ,GAAY,gBACZD,IAGpB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{typeof as e}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{__rest as t}from"../../../_virtual/_tslib.js";import i from"react";import{
|
|
1
|
+
import{typeof as e}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{__rest as t}from"../../../_virtual/_tslib.js";import i from"react";import{useSliderInfix as n,useSliderSelection as o}from"./SliderContext.js";import r from"./SelectionIndicator.js";import c from"../../../components/icon/dist/Icon/Icon.js";var l={clickable:!1,iconSize:18,ignoreFocusStyle:!0};function a(a){var s="postfix"===a,m=n(),f=m.prefix,p=m.postfix,u=m.indicateSelection,d=m.selectionIndicatorWidth,g=o(),j=g.value,v=g.valueText,x=s?p:f;if(u&&(s||g.ranged))return[!0,[],i.createElement(r,{key:a,kind:a}),{width:d}];if("object"===e(x)&&x.icon){var b=x.icon,y=t(x,["icon"]),S=Object.assign(Object.assign({},l),y);return[!0,[],i.createElement(c,Object.assign({key:"infix-icon",icon:b},S)),{}]}return"function"==typeof x?[!0,[],x(j,v),{}]:"string"==typeof x?[!0,["txt"],i.createElement(i.Fragment,null,x),{}]:void 0===x?[!1,[],null,{}]:[!0,[],i.createElement(i.Fragment,null,x),{}]}export{a as useSliderInfixComponent};
|
|
2
2
|
//# sourceMappingURL=SliderInfixHooks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliderInfixHooks.js","sources":["../../../../../src/components/Slider/SliderInfixHooks.tsx"],"sourcesContent":["import React, { type CSSProperties, type ReactElement } from \"react\";\nimport { type IconType, Icon } from \"@vibe/icon\";\nimport { type InfixKind } from \"./Slider.types\";\nimport { useSliderInfix, useSliderSelection } from \"./SliderContext\";\nimport SelectionIndicator from \"./SelectionIndicator\";\n\nconst defaultIconProps = {\n clickable: false,\n iconSize: 18,\n ignoreFocusStyle: true\n};\n\nexport function useSliderInfixComponent(kind: InfixKind): [boolean, string[], ReactElement, CSSProperties] {\n const isPostfix = kind === \"postfix\";\n const { prefix, postfix, indicateSelection, selectionIndicatorWidth } = useSliderInfix();\n const { ranged, value, valueText } = useSliderSelection();\n const infix = isPostfix ? postfix : prefix;\n\n if (indicateSelection && (isPostfix || ranged)) {\n return [true, [], <SelectionIndicator key={kind} kind={kind} />, { width: selectionIndicatorWidth }];\n }\n if (typeof infix === \"object\" && (infix as { icon: IconType }).icon) {\n const { icon, ...restIconProps } = infix as { icon: IconType };\n const iconProps = { ...defaultIconProps, ...restIconProps };\n return [true, [], <Icon key=\"infix-icon\" icon={icon} {...iconProps} />, {}];\n }\n if (typeof infix === \"function\") {\n return [true, [], infix(value, valueText), {}];\n }\n if (typeof infix === \"string\") {\n return [true, [\"txt\"], <>{infix}</>, {}];\n }\n if (typeof infix === \"undefined\") {\n return [false, [], null, {}];\n }\n return [true, [], <>{infix}</>, {}];\n}\n"],"names":["defaultIconProps","clickable","iconSize","ignoreFocusStyle","useSliderInfixComponent","kind","isPostfix","_useSliderInfix","useSliderInfix","prefix","postfix","indicateSelection","selectionIndicatorWidth","_useSliderSelection","useSliderSelection","value","valueText","infix","ranged","React","createElement","SelectionIndicator","key","width","_typeof","icon","restIconProps","__rest","iconProps","Object","assign","Icon","Fragment"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SliderInfixHooks.js","sources":["../../../../../src/components/Slider/SliderInfixHooks.tsx"],"sourcesContent":["import React, { type CSSProperties, type ReactElement } from \"react\";\nimport { type IconType, Icon } from \"@vibe/icon\";\nimport { type InfixKind } from \"./Slider.types\";\nimport { useSliderInfix, useSliderSelection } from \"./SliderContext\";\nimport SelectionIndicator from \"./SelectionIndicator\";\n\nconst defaultIconProps = {\n clickable: false,\n iconSize: 18,\n ignoreFocusStyle: true\n};\n\nexport function useSliderInfixComponent(kind: InfixKind): [boolean, string[], ReactElement, CSSProperties] {\n const isPostfix = kind === \"postfix\";\n const { prefix, postfix, indicateSelection, selectionIndicatorWidth } = useSliderInfix();\n const { ranged, value, valueText } = useSliderSelection();\n const infix = isPostfix ? postfix : prefix;\n\n if (indicateSelection && (isPostfix || ranged)) {\n return [true, [], <SelectionIndicator key={kind} kind={kind} />, { width: selectionIndicatorWidth }];\n }\n if (typeof infix === \"object\" && (infix as { icon: IconType }).icon) {\n const { icon, ...restIconProps } = infix as { icon: IconType };\n const iconProps = { ...defaultIconProps, ...restIconProps };\n return [true, [], <Icon key=\"infix-icon\" icon={icon} {...iconProps} />, {}];\n }\n if (typeof infix === \"function\") {\n return [true, [], infix(value, valueText), {}];\n }\n if (typeof infix === \"string\") {\n return [true, [\"txt\"], <>{infix}</>, {}];\n }\n if (typeof infix === \"undefined\") {\n return [false, [], null, {}];\n }\n return [true, [], <>{infix}</>, {}];\n}\n"],"names":["defaultIconProps","clickable","iconSize","ignoreFocusStyle","useSliderInfixComponent","kind","isPostfix","_useSliderInfix","useSliderInfix","prefix","postfix","indicateSelection","selectionIndicatorWidth","_useSliderSelection","useSliderSelection","value","valueText","infix","ranged","React","createElement","SelectionIndicator","key","width","_typeof","icon","restIconProps","__rest","iconProps","Object","assign","Icon","Fragment"],"mappings":"+TAMA,IAAMA,EAAmB,CACvBC,WAAW,EACXC,SAAU,GACVC,kBAAkB,GAGd,SAAUC,EAAwBC,GACtC,IAAMC,EAAqB,YAATD,EAClBE,EAAwEC,IAAhEC,EAAMF,EAANE,OAAQC,EAAOH,EAAPG,QAASC,EAAiBJ,EAAjBI,kBAAmBC,EAAuBL,EAAvBK,wBAC5CC,EAAqCC,IAArBC,EAAKF,EAALE,MAAOC,EAASH,EAATG,UACjBC,EAAQX,EAAYI,EAAUD,EAEpC,GAAIE,IAAsBL,GAHZO,EAANK,QAIN,MAAO,EAAC,EAAM,GAAIC,EAACC,cAAAC,EAAmB,CAAAC,IAAKjB,EAAMA,KAAMA,IAAU,CAAEkB,MAAOX,IAE5E,GAAqB,WAAjBY,EAAOP,IAAuBA,EAA6BQ,KAAM,CAC7D,IAAEA,EAA2BR,EAA3BQ,KAASC,EAAaC,EAAKV,EAA7B,CAA0B,SAC1BW,EAAiBC,OAAAC,OAAAD,OAAAC,OAAA,GAAA9B,GAAqB0B,GAC5C,MAAO,EAAC,EAAM,GAAIP,EAACC,cAAAW,iBAAKT,IAAI,aAAaG,KAAMA,GAAUG,IAAe,CAAA,EACzE,CACD,MAAqB,mBAAVX,EACF,EAAC,EAAM,GAAIA,EAAMF,EAAOC,GAAY,CAAA,GAExB,iBAAVC,EACF,EAAC,EAAM,CAAC,OAAQE,EAAAC,cAAAD,EAAAa,SAAA,KAAGf,GAAW,CAAE,QAEpB,IAAVA,EACF,EAAC,EAAO,GAAI,KAAM,CAAE,GAEtB,EAAC,EAAM,GAAIE,EAAGC,cAAAD,EAAAa,SAAA,KAAAf,GAAW,CAAE,EACpC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{slicedToArray as
|
|
1
|
+
import{slicedToArray as o,defineProperty as t,toConsumableArray as e}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{__rest as i}from"../../../_virtual/_tslib.js";import{camelCase as n}from"es-toolkit";import{getStyle as a}from"../../helpers/typesciptCssModulesHelper.js";import{getTestId as r,ComponentDefaultTestId as s}from"../../tests/testIds.js";import l from"classnames";import d,{useState as c,useRef as m,useCallback as u,useMemo as p}from"react";import{SplitButtonSecondaryContentPosition as g,ENTER_KEYS as f,DEFAULT_DIALOG_SHOW_TRIGGER as v,DEFAULT_DIALOG_HIDE_TRIGGER as y,DIALOG_MOVE_BY as D,SECONDARY_BUTTON_ARIA_LABEL as C,SECONDARY_BUTTON_WRAPPER_CLASSNAME as k}from"./SplitButtonConstants.js";import{withStaticPropsWithoutForwardRef as N}from"../../types/withStaticProps.js";import"../../utils/colors-vars-map.js";import{NOOP as T}from"../../utils/function-utils.js";import{isInsideClass as b}from"../../utils/dom-utils.js";import h from"../../hooks/useKeyEvent/index.js";import S from"../../hooks/useEventListener/index.js";import j from"./SplitButton.module.scss.js";import{ComponentVibeId as P}from"../../tests/constants.js";import I from"../../../components/button/dist/Button/Button.js";import B from"../../../components/dialog/dist/DialogContentContainer/DialogContentContainer.js";import{HideShowEvent as E,AnimationType as O}from"../../../components/dialog/dist/Dialog/DialogConstants.js";import _ from"../../../components/dialog/dist/Dialog/Dialog.js";import w from"../../../icons/dist/react/DropdownChevronDown.js";var z=N((function(g){var N=g.secondaryDialogContent,z=g.onSecondaryDialogDidShow,L=void 0===z?T:z,A=g.onSecondaryDialogDidHide,x=void 0===A?T:A,H=g.shouldCloseOnClickInsideDialog,R=g.zIndex,U=void 0===R?null:R,F=g.secondaryDialogClassName,K=void 0===F?"":F,M=g.secondaryDialogPosition,W=void 0===M?"bottom-start":M,Y=g.dialogContainerSelector,V=g.dialogPaddingSize,X=void 0===V?"medium":V,q=g.disabled,G=g.loading,J=g.kind,Q=void 0===J?"primary":J,Z=g.color,$=void 0===Z?"primary":Z,oo=g.className,to=g.leftIcon,eo=g.rightIcon,io=g.onClick,no=g.children,ao=g.marginLeft,ro=g.marginRight,so=g.active,lo=g.id,co=g["data-testid"],mo=i(g,["secondaryDialogContent","onSecondaryDialogDidShow","onSecondaryDialogDidHide","shouldCloseOnClickInsideDialog","zIndex","secondaryDialogClassName","secondaryDialogPosition","dialogContainerSelector","dialogPaddingSize","disabled","success","loading","kind","color","className","leftIcon","rightIcon","onClick","children","marginLeft","marginRight","active","id","data-testid"]),uo=c(!1),po=o(uo,2),go=po[0],fo=po[1],vo=c(!1),yo=o(vo,2),Do=yo[0],Co=yo[1],ko=c(!1),No=o(ko,2),To=No[0],bo=No[1],ho=m(null),So=m(null),jo=u((function(){return Co(!0)}),[Co]),Po=u((function(){return Co(!1)}),[Co]),Io=u((function(o){return!q&&!b(o.target,k)}),[q]),Bo=u((function(o){Io(o)&&bo(!0)}),[bo,Io]),Eo=u((function(){return bo(!1)}),[bo]),Oo=u((function(o){Io(o)&&bo(!0)}),[bo,Io]),_o=u((function(){fo(!0),L()}),[fo,L]),wo=u((function(o,t){fo(!1),x(),"esckey"===t&&So.current.focus()}),[fo,x]);S({eventName:"mouseenter",callback:jo,ref:ho}),S({eventName:"mouseleave",callback:Po,ref:ho}),S({eventName:"mousedown",callback:Bo,ref:ho}),S({eventName:"mouseup",callback:Eo,ref:ho}),S({eventName:"transitionend",callback:Eo,ref:ho}),h({keys:f,ref:ho,callback:Oo});var zo=p((function(){return l(j.button,a(j,n("kind-"+Q)),a(j,n("color-"+$)),t(t(t(t(t({},j.mainActive,so),j.active,To),j.splitContentOpen,go),j.hovered,Do),j.disabled,q),oo)}),[oo,Q,$,so,To,go,Do,q]),Lo=p((function(){return q?[]:v}),[q]),Ao=p((function(){return H?[].concat(e(y),[E.CONTENT_CLICK]):y}),[H]),xo=u((function(){var o="function"==typeof N?N():N;return d.createElement(B,{type:B.types.POPOVER,size:X},o)}),[N,X]),Ho=p((function(){return"bottom"===W?"":"bottom-start"===W?"bottom":"top"}),[W]);return d.createElement("div",{className:zo,ref:ho,id:lo,"data-testid":co||r(s.SPLIT_BUTTON,lo),"data-vibe":P.SPLIT_BUTTON},d.createElement(I,Object.assign({},mo,{preventClickAnimation:!0,leftIcon:to,rightIcon:eo,rightFlat:!0,color:$,kind:Q,active:so,onClick:io,className:j.mainButton,marginLeft:ao,onFocus:jo,onBlur:Po,disabled:q,loading:G,"data-testid":r(s.SPLIT_BUTTON_PRIMARY_BUTTON,lo)}),no),d.createElement("div",{className:j.secondaryButtonWrapper},d.createElement(_,{wrapperClassName:K,zIndex:U,content:xo,position:W,containerSelector:Y,startingEdge:Ho,animationType:O.EXPAND,moveBy:D,onDialogDidShow:_o,onDialogDidHide:wo,showTrigger:Lo,hideTrigger:Ao},d.createElement(I,Object.assign({},mo,{ref:So,preventClickAnimation:!0,leftFlat:!0,noSidePadding:!0,color:$,kind:Q,className:j.secondaryButton,active:go,marginRight:ro,onFocus:jo,onBlur:Po,disabled:q,ariaLabel:C,ariaHasPopup:!0,ariaExpanded:go,"data-testid":r(s.SPLIT_BUTTON_SECONDARY_BUTTON,lo)}),d.createElement("div",{className:j.secondaryButtonIconWrapper},d.createElement(w,{"aria-hidden":"true"}))))))}),{secondaryPositions:g,secondaryDialogPositions:g,sizes:I.sizes,colors:I.colors,kinds:I.kinds,inputTags:I.inputTags,dialogPaddingSizes:B.sizes});export{z as default};
|
|
2
2
|
//# sourceMappingURL=SplitButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplitButton.js","sources":["../../../../../src/components/SplitButton/SplitButton.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport { camelCase } from \"es-toolkit\";\nimport { getStyle } from \"../../helpers/typesciptCssModulesHelper\";\nimport { ComponentDefaultTestId, getTestId } from \"../../tests/test-ids-utils\";\nimport cx from \"classnames\";\n// Libraries import\nimport React, { type ReactElement, useCallback, useMemo, useRef, useState } from \"react\";\n// Constants import\nimport {\n DEFAULT_DIALOG_HIDE_TRIGGER,\n DEFAULT_DIALOG_SHOW_TRIGGER,\n DIALOG_MOVE_BY,\n ENTER_KEYS,\n SECONDARY_BUTTON_ARIA_LABEL,\n SECONDARY_BUTTON_WRAPPER_CLASSNAME,\n SplitButtonSecondaryContentPosition,\n type SplitButtonSecondaryContentPositionType\n} from \"./SplitButtonConstants\";\nimport { withStaticPropsWithoutForwardRef } from \"../../types\";\n// Utils import\nimport { NOOP } from \"../../utils/function-utils\";\nimport { isInsideClass } from \"../../utils/dom-utils\";\n// Hooks import\nimport useKeyEvent from \"../../hooks/useKeyEvent\";\nimport useEventListener from \"../../hooks/useEventListener\";\n// Components import\nimport { Button, type ButtonProps } from \"@vibe/button\";\nimport { DropdownChevronDown } from \"@vibe/icons\";\nimport {\n DialogContentContainer,\n type DialogSize,\n type DialogTriggerEvent,\n Dialog,\n type DialogEvent,\n type DialogPosition\n} from \"@vibe/dialog\";\nimport { DialogAnimationTypeEnum as AnimationType, DialogTriggerEventEnum as HideShowEvent } from \"@vibe/dialog\";\nimport styles from \"./SplitButton.module.scss\";\nimport { ComponentVibeId } from \"../../tests/constants\";\n\nexport interface SplitButtonProps extends ButtonProps {\n /**\n * The element or renderer that is displayed inside the dialog opened by clicking the secondary button.\n */\n secondaryDialogContent?: ReactElement | (() => string | ReactElement);\n /**\n * Callback fired when the secondary dialog is shown.\n */\n onSecondaryDialogDidShow?: () => void;\n /**\n * Callback fired when the secondary dialog is hidden.\n */\n onSecondaryDialogDidHide?: () => void;\n /**\n * The z-index applied to the secondary dialog.\n */\n zIndex?: number;\n /**\n * Class name applied to the wrapper of the secondary dialog.\n */\n secondaryDialogClassName?: string;\n /**\n * The position of the secondary dialog.\n */\n secondaryDialogPosition?: SplitButtonSecondaryContentPositionType;\n /**\n * The padding size inside the secondary dialog.\n */\n dialogPaddingSize?: DialogSize;\n /**\n * The CSS selector of the container where the dialog should be rendered.\n */\n dialogContainerSelector?: string;\n /**\n * If true, clicking inside the dialog will close it.\n */\n shouldCloseOnClickInsideDialog?: boolean;\n}\n\nconst SplitButton = ({\n secondaryDialogContent,\n onSecondaryDialogDidShow = NOOP,\n onSecondaryDialogDidHide = NOOP,\n shouldCloseOnClickInsideDialog,\n zIndex = null,\n secondaryDialogClassName = \"\",\n secondaryDialogPosition = \"bottom-start\",\n dialogContainerSelector,\n dialogPaddingSize = \"medium\",\n disabled,\n // success mode not working right now, need to fix it in different pr\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n success,\n loading,\n kind = \"primary\",\n color = \"primary\",\n className,\n leftIcon,\n rightIcon,\n onClick,\n children,\n marginLeft,\n marginRight,\n active,\n id,\n \"data-testid\": dataTestId,\n ...buttonProps\n}: SplitButtonProps) => {\n // State //\n const [isDialogOpen, setDialogOpen] = useState(false);\n const [isHovered, setIsHover] = useState(false);\n const [isActive, setIsActive] = useState(false);\n\n // Refs //\n const ref = useRef(null);\n const secondaryButtonRef = useRef(null);\n\n // Callbacks //\n const setHovered = useCallback(() => setIsHover(true), [setIsHover]);\n const setNotHovered = useCallback(() => setIsHover(false), [setIsHover]);\n\n const shouldSetActive = useCallback(\n (e: React.KeyboardEvent<HTMLElement>) => {\n if (disabled) return false;\n return !isInsideClass(e.target as HTMLElement, SECONDARY_BUTTON_WRAPPER_CLASSNAME);\n },\n [disabled]\n );\n\n const setActive = useCallback(\n (e: React.KeyboardEvent<HTMLElement>) => {\n if (!shouldSetActive(e)) return;\n setIsActive(true);\n },\n [setIsActive, shouldSetActive]\n );\n const setNotActive = useCallback(() => setIsActive(false), [setIsActive]);\n const setActiveOnEnter = useCallback(\n (e: React.KeyboardEvent<HTMLElement>) => {\n if (!shouldSetActive(e)) return;\n setIsActive(true);\n },\n [setIsActive, shouldSetActive]\n );\n\n const showDialog = useCallback(() => {\n setDialogOpen(true);\n onSecondaryDialogDidShow();\n }, [setDialogOpen, onSecondaryDialogDidShow]);\n\n const hideDialog = useCallback(\n (_: DialogEvent, eventName: DialogTriggerEvent) => {\n setDialogOpen(false);\n onSecondaryDialogDidHide();\n if (eventName === \"esckey\") {\n secondaryButtonRef.current.focus();\n }\n },\n [setDialogOpen, onSecondaryDialogDidHide]\n );\n\n // Event listeners //\n\n // Used to set both buttons as hovered no matter what button was hovered\n useEventListener({ eventName: \"mouseenter\", callback: setHovered, ref });\n useEventListener({ eventName: \"mouseleave\", callback: setNotHovered, ref });\n\n useEventListener({ eventName: \"mousedown\", callback: setActive, ref });\n useEventListener({ eventName: \"mouseup\", callback: setNotActive, ref });\n\n // Used to finish active transition if clicked on enter\n useEventListener({ eventName: \"transitionend\", callback: setNotActive, ref });\n\n // Key events\n useKeyEvent({ keys: ENTER_KEYS, ref, callback: setActiveOnEnter });\n\n const classNames = useMemo(\n () =>\n cx(\n styles.button,\n getStyle(styles, camelCase(\"kind-\" + kind)),\n getStyle(styles, camelCase(\"color-\" + color)),\n {\n [styles.mainActive]: active,\n [styles.active]: isActive,\n [styles.splitContentOpen]: isDialogOpen,\n [styles.hovered]: isHovered,\n [styles.disabled]: disabled\n },\n className\n ),\n [className, kind, color, active, isActive, isDialogOpen, isHovered, disabled]\n );\n\n const dialogShowTrigger = useMemo(() => (disabled ? [] : DEFAULT_DIALOG_SHOW_TRIGGER), [disabled]);\n\n const dialogHideTrigger = useMemo(() => {\n if (shouldCloseOnClickInsideDialog) return [...DEFAULT_DIALOG_HIDE_TRIGGER, HideShowEvent.CONTENT_CLICK];\n return DEFAULT_DIALOG_HIDE_TRIGGER;\n }, [shouldCloseOnClickInsideDialog]);\n\n const actionsContent = useCallback(() => {\n const content = typeof secondaryDialogContent === \"function\" ? secondaryDialogContent() : secondaryDialogContent;\n return (\n <DialogContentContainer type={DialogContentContainer.types.POPOVER} size={dialogPaddingSize}>\n {content}\n </DialogContentContainer>\n );\n }, [secondaryDialogContent, dialogPaddingSize]);\n\n const animationEdgePosition = useMemo(() => {\n if (secondaryDialogPosition === \"bottom\") {\n return \"\";\n }\n if (secondaryDialogPosition === \"bottom-start\") {\n return \"bottom\";\n }\n\n return \"top\";\n }, [secondaryDialogPosition]);\n\n return (\n <div\n className={classNames}\n ref={ref}\n id={id}\n data-testid={dataTestId || getTestId(ComponentDefaultTestId.SPLIT_BUTTON, id)}\n data-vibe={ComponentVibeId.SPLIT_BUTTON}\n >\n <Button\n {\n ...buttonProps /* We are enriching button with other props so we must use spreading */\n }\n preventClickAnimation\n leftIcon={leftIcon}\n rightIcon={rightIcon}\n rightFlat\n color={color}\n kind={kind}\n active={active}\n onClick={onClick}\n className={styles.mainButton}\n marginLeft={marginLeft}\n onFocus={setHovered}\n onBlur={setNotHovered}\n disabled={disabled}\n loading={loading}\n data-testid={getTestId(ComponentDefaultTestId.SPLIT_BUTTON_PRIMARY_BUTTON, id)}\n >\n {children}\n </Button>\n <div className={styles.secondaryButtonWrapper}>\n <Dialog\n wrapperClassName={secondaryDialogClassName}\n zIndex={zIndex}\n content={actionsContent}\n position={secondaryDialogPosition as DialogPosition}\n containerSelector={dialogContainerSelector}\n startingEdge={animationEdgePosition}\n animationType={AnimationType.EXPAND}\n moveBy={DIALOG_MOVE_BY}\n onDialogDidShow={showDialog}\n onDialogDidHide={hideDialog}\n showTrigger={dialogShowTrigger}\n hideTrigger={dialogHideTrigger}\n >\n <Button\n {...buttonProps}\n ref={secondaryButtonRef}\n preventClickAnimation\n leftFlat\n noSidePadding\n color={color}\n kind={kind}\n className={styles.secondaryButton}\n active={isDialogOpen}\n marginRight={marginRight}\n onFocus={setHovered}\n onBlur={setNotHovered}\n disabled={disabled}\n ariaLabel={SECONDARY_BUTTON_ARIA_LABEL}\n ariaHasPopup\n ariaExpanded={isDialogOpen}\n data-testid={getTestId(ComponentDefaultTestId.SPLIT_BUTTON_SECONDARY_BUTTON, id)}\n >\n <div className={styles.secondaryButtonIconWrapper}>\n <DropdownChevronDown aria-hidden=\"true\" />\n </div>\n </Button>\n </Dialog>\n </div>\n </div>\n );\n};\n\ninterface SplitButtonStaticProps {\n secondaryPositions: typeof SplitButtonSecondaryContentPosition;\n secondaryDialogPositions: typeof SplitButtonSecondaryContentPosition;\n sizes: typeof Button.sizes;\n colors: typeof Button.colors;\n kinds: typeof Button.kinds;\n inputTags: typeof Button.inputTags;\n dialogPaddingSizes: typeof DialogContentContainer.sizes;\n}\n\nexport default withStaticPropsWithoutForwardRef<SplitButtonProps, SplitButtonStaticProps>(SplitButton, {\n secondaryPositions: SplitButtonSecondaryContentPosition,\n secondaryDialogPositions: SplitButtonSecondaryContentPosition,\n sizes: Button.sizes,\n colors: Button.colors,\n kinds: Button.kinds,\n inputTags: Button.inputTags,\n dialogPaddingSizes: DialogContentContainer.sizes\n});\n"],"names":["withStaticPropsWithoutForwardRef","_a","secondaryDialogContent","_a$onSecondaryDialogD","onSecondaryDialogDidShow","NOOP","_a$onSecondaryDialogD2","onSecondaryDialogDidHide","shouldCloseOnClickInsideDialog","_a$zIndex","zIndex","_a$secondaryDialogCla","secondaryDialogClassName","_a$secondaryDialogPos","secondaryDialogPosition","dialogContainerSelector","_a$dialogPaddingSize","dialogPaddingSize","disabled","loading","_a$kind","kind","_a$color","color","className","leftIcon","rightIcon","onClick","children","marginLeft","marginRight","active","id","dataTestId","buttonProps","__rest","_useState","useState","_useState2","_slicedToArray","isDialogOpen","setDialogOpen","_useState3","_useState4","isHovered","setIsHover","_useState5","_useState6","isActive","setIsActive","ref","useRef","secondaryButtonRef","setHovered","useCallback","setNotHovered","shouldSetActive","e","isInsideClass","target","SECONDARY_BUTTON_WRAPPER_CLASSNAME","setActive","setNotActive","setActiveOnEnter","showDialog","hideDialog","_","eventName","current","focus","useEventListener","callback","useKeyEvent","keys","ENTER_KEYS","classNames","useMemo","cx","styles","button","getStyle","camelCase","_defineProperty","mainActive","splitContentOpen","hovered","dialogShowTrigger","DEFAULT_DIALOG_SHOW_TRIGGER","dialogHideTrigger","concat","_toConsumableArray","DEFAULT_DIALOG_HIDE_TRIGGER","HideShowEvent","CONTENT_CLICK","actionsContent","content","React","createElement","DialogContentContainer","type","types","POPOVER","size","animationEdgePosition","getTestId","ComponentDefaultTestId","SPLIT_BUTTON","ComponentVibeId","Button","Object","assign","preventClickAnimation","rightFlat","mainButton","onFocus","onBlur","SPLIT_BUTTON_PRIMARY_BUTTON","secondaryButtonWrapper","Dialog","wrapperClassName","position","containerSelector","startingEdge","animationType","AnimationType","EXPAND","moveBy","DIALOG_MOVE_BY","onDialogDidShow","onDialogDidHide","showTrigger","hideTrigger","leftFlat","noSidePadding","secondaryButton","ariaLabel","SECONDARY_BUTTON_ARIA_LABEL","ariaHasPopup","ariaExpanded","SPLIT_BUTTON_SECONDARY_BUTTON","secondaryButtonIconWrapper","DropdownChevronDown","secondaryPositions","SplitButtonSecondaryContentPosition","secondaryDialogPositions","sizes","colors","kinds","inputTags","dialogPaddingSizes"],"mappings":"24CA+EA,IAkOeA,EAAAA,GAlOK,SAACC,GAAA,IACnBC,EAyByBD,EAzBzBC,uBAAsBC,EAyBGF,EAxBzBG,yBAAAA,OAA2BC,IAAHF,EAAGE,EAAIF,EAAAG,EAwBNL,EAvBzBM,yBAAAA,OAA2BF,IAAHC,EAAGD,EAAIC,EAC/BE,EAsByBP,EAtBzBO,+BAA8BC,EAsBLR,EArBzBS,OAAAA,OAAS,IAAHD,EAAG,KAAIA,EAAAE,EAqBYV,EApBzBW,yBAAAA,OAA2B,IAAHD,EAAG,GAAEA,EAAAE,EAoBJZ,EAnBzBa,wBAAAA,OAA0B,IAAHD,EAAG,eAAcA,EACxCE,EAkByBd,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uBkC,8BAA+B3G,MAE7EgE,EAAAC,cAAA,MAAA,CAAKzE,UAAWsD,EAAO8D,4BACrB5C,EAACC,cAAA4C,EAAgC,CAAA,cAAA,aAO/C,GAYuG,CACrGC,mBAAoBC,EACpBC,yBAA0BD,EAC1BE,MAAOrC,EAAOqC,MACdC,OAAQtC,EAAOsC,OACfC,MAAOvC,EAAOuC,MACdC,UAAWxC,EAAOwC,UAClBC,mBAAoBnD,EAAuB+C"}
|
|
1
|
+
{"version":3,"file":"SplitButton.js","sources":["../../../../../src/components/SplitButton/SplitButton.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport { camelCase } from \"es-toolkit\";\nimport { getStyle } from \"../../helpers/typesciptCssModulesHelper\";\nimport { ComponentDefaultTestId, getTestId } from \"../../tests/test-ids-utils\";\nimport cx from \"classnames\";\n// Libraries import\nimport React, { type ReactElement, useCallback, useMemo, useRef, useState } from \"react\";\n// Constants import\nimport {\n DEFAULT_DIALOG_HIDE_TRIGGER,\n DEFAULT_DIALOG_SHOW_TRIGGER,\n DIALOG_MOVE_BY,\n ENTER_KEYS,\n SECONDARY_BUTTON_ARIA_LABEL,\n SECONDARY_BUTTON_WRAPPER_CLASSNAME,\n SplitButtonSecondaryContentPosition,\n type SplitButtonSecondaryContentPositionType\n} from \"./SplitButtonConstants\";\nimport { withStaticPropsWithoutForwardRef } from \"../../types\";\n// Utils import\nimport { NOOP } from \"../../utils/function-utils\";\nimport { isInsideClass } from \"../../utils/dom-utils\";\n// Hooks import\nimport useKeyEvent from \"../../hooks/useKeyEvent\";\nimport useEventListener from \"../../hooks/useEventListener\";\n// Components import\nimport { Button, type ButtonProps } from \"@vibe/button\";\nimport { DropdownChevronDown } from \"@vibe/icons\";\nimport {\n DialogContentContainer,\n type DialogSize,\n type DialogTriggerEvent,\n Dialog,\n type DialogEvent,\n type DialogPosition\n} from \"@vibe/dialog\";\nimport { DialogAnimationTypeEnum as AnimationType, DialogTriggerEventEnum as HideShowEvent } from \"@vibe/dialog\";\nimport styles from \"./SplitButton.module.scss\";\nimport { ComponentVibeId } from \"../../tests/constants\";\n\nexport interface SplitButtonProps extends ButtonProps {\n /**\n * The element or renderer that is displayed inside the dialog opened by clicking the secondary button.\n */\n secondaryDialogContent?: ReactElement | (() => string | ReactElement);\n /**\n * Callback fired when the secondary dialog is shown.\n */\n onSecondaryDialogDidShow?: () => void;\n /**\n * Callback fired when the secondary dialog is hidden.\n */\n onSecondaryDialogDidHide?: () => void;\n /**\n * The z-index applied to the secondary dialog.\n */\n zIndex?: number;\n /**\n * Class name applied to the wrapper of the secondary dialog.\n */\n secondaryDialogClassName?: string;\n /**\n * The position of the secondary dialog.\n */\n secondaryDialogPosition?: SplitButtonSecondaryContentPositionType;\n /**\n * The padding size inside the secondary dialog.\n */\n dialogPaddingSize?: DialogSize;\n /**\n * The CSS selector of the container where the dialog should be rendered.\n */\n dialogContainerSelector?: string;\n /**\n * If true, clicking inside the dialog will close it.\n */\n shouldCloseOnClickInsideDialog?: boolean;\n}\n\nconst SplitButton = ({\n secondaryDialogContent,\n onSecondaryDialogDidShow = NOOP,\n onSecondaryDialogDidHide = NOOP,\n shouldCloseOnClickInsideDialog,\n zIndex = null,\n secondaryDialogClassName = \"\",\n secondaryDialogPosition = \"bottom-start\",\n dialogContainerSelector,\n dialogPaddingSize = \"medium\",\n disabled,\n // success mode not working right now, need to fix it in different pr\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n success,\n loading,\n kind = \"primary\",\n color = \"primary\",\n className,\n leftIcon,\n rightIcon,\n onClick,\n children,\n marginLeft,\n marginRight,\n active,\n id,\n \"data-testid\": dataTestId,\n ...buttonProps\n}: SplitButtonProps) => {\n // State //\n const [isDialogOpen, setDialogOpen] = useState(false);\n const [isHovered, setIsHover] = useState(false);\n const [isActive, setIsActive] = useState(false);\n\n // Refs //\n const ref = useRef(null);\n const secondaryButtonRef = useRef(null);\n\n // Callbacks //\n const setHovered = useCallback(() => setIsHover(true), [setIsHover]);\n const setNotHovered = useCallback(() => setIsHover(false), [setIsHover]);\n\n const shouldSetActive = useCallback(\n (e: React.KeyboardEvent<HTMLElement>) => {\n if (disabled) return false;\n return !isInsideClass(e.target as HTMLElement, SECONDARY_BUTTON_WRAPPER_CLASSNAME);\n },\n [disabled]\n );\n\n const setActive = useCallback(\n (e: React.KeyboardEvent<HTMLElement>) => {\n if (!shouldSetActive(e)) return;\n setIsActive(true);\n },\n [setIsActive, shouldSetActive]\n );\n const setNotActive = useCallback(() => setIsActive(false), [setIsActive]);\n const setActiveOnEnter = useCallback(\n (e: React.KeyboardEvent<HTMLElement>) => {\n if (!shouldSetActive(e)) return;\n setIsActive(true);\n },\n [setIsActive, shouldSetActive]\n );\n\n const showDialog = useCallback(() => {\n setDialogOpen(true);\n onSecondaryDialogDidShow();\n }, [setDialogOpen, onSecondaryDialogDidShow]);\n\n const hideDialog = useCallback(\n (_: DialogEvent, eventName: DialogTriggerEvent) => {\n setDialogOpen(false);\n onSecondaryDialogDidHide();\n if (eventName === \"esckey\") {\n secondaryButtonRef.current.focus();\n }\n },\n [setDialogOpen, onSecondaryDialogDidHide]\n );\n\n // Event listeners //\n\n // Used to set both buttons as hovered no matter what button was hovered\n useEventListener({ eventName: \"mouseenter\", callback: setHovered, ref });\n useEventListener({ eventName: \"mouseleave\", callback: setNotHovered, ref });\n\n useEventListener({ eventName: \"mousedown\", callback: setActive, ref });\n useEventListener({ eventName: \"mouseup\", callback: setNotActive, ref });\n\n // Used to finish active transition if clicked on enter\n useEventListener({ eventName: \"transitionend\", callback: setNotActive, ref });\n\n // Key events\n useKeyEvent({ keys: ENTER_KEYS, ref, callback: setActiveOnEnter });\n\n const classNames = useMemo(\n () =>\n cx(\n styles.button,\n getStyle(styles, camelCase(\"kind-\" + kind)),\n getStyle(styles, camelCase(\"color-\" + color)),\n {\n [styles.mainActive]: active,\n [styles.active]: isActive,\n [styles.splitContentOpen]: isDialogOpen,\n [styles.hovered]: isHovered,\n [styles.disabled]: disabled\n },\n className\n ),\n [className, kind, color, active, isActive, isDialogOpen, isHovered, disabled]\n );\n\n const dialogShowTrigger = useMemo(() => (disabled ? [] : DEFAULT_DIALOG_SHOW_TRIGGER), [disabled]);\n\n const dialogHideTrigger = useMemo(() => {\n if (shouldCloseOnClickInsideDialog) return [...DEFAULT_DIALOG_HIDE_TRIGGER, HideShowEvent.CONTENT_CLICK];\n return DEFAULT_DIALOG_HIDE_TRIGGER;\n }, [shouldCloseOnClickInsideDialog]);\n\n const actionsContent = useCallback(() => {\n const content = typeof secondaryDialogContent === \"function\" ? secondaryDialogContent() : secondaryDialogContent;\n return (\n <DialogContentContainer type={DialogContentContainer.types.POPOVER} size={dialogPaddingSize}>\n {content}\n </DialogContentContainer>\n );\n }, [secondaryDialogContent, dialogPaddingSize]);\n\n const animationEdgePosition = useMemo(() => {\n if (secondaryDialogPosition === \"bottom\") {\n return \"\";\n }\n if (secondaryDialogPosition === \"bottom-start\") {\n return \"bottom\";\n }\n\n return \"top\";\n }, [secondaryDialogPosition]);\n\n return (\n <div\n className={classNames}\n ref={ref}\n id={id}\n data-testid={dataTestId || getTestId(ComponentDefaultTestId.SPLIT_BUTTON, id)}\n data-vibe={ComponentVibeId.SPLIT_BUTTON}\n >\n <Button\n {\n ...buttonProps /* We are enriching button with other props so we must use spreading */\n }\n preventClickAnimation\n leftIcon={leftIcon}\n rightIcon={rightIcon}\n rightFlat\n color={color}\n kind={kind}\n active={active}\n onClick={onClick}\n className={styles.mainButton}\n marginLeft={marginLeft}\n onFocus={setHovered}\n onBlur={setNotHovered}\n disabled={disabled}\n loading={loading}\n data-testid={getTestId(ComponentDefaultTestId.SPLIT_BUTTON_PRIMARY_BUTTON, id)}\n >\n {children}\n </Button>\n <div className={styles.secondaryButtonWrapper}>\n <Dialog\n wrapperClassName={secondaryDialogClassName}\n zIndex={zIndex}\n content={actionsContent}\n position={secondaryDialogPosition as DialogPosition}\n containerSelector={dialogContainerSelector}\n startingEdge={animationEdgePosition}\n animationType={AnimationType.EXPAND}\n moveBy={DIALOG_MOVE_BY}\n onDialogDidShow={showDialog}\n onDialogDidHide={hideDialog}\n showTrigger={dialogShowTrigger}\n hideTrigger={dialogHideTrigger}\n >\n <Button\n {...buttonProps}\n ref={secondaryButtonRef}\n preventClickAnimation\n leftFlat\n noSidePadding\n color={color}\n kind={kind}\n className={styles.secondaryButton}\n active={isDialogOpen}\n marginRight={marginRight}\n onFocus={setHovered}\n onBlur={setNotHovered}\n disabled={disabled}\n ariaLabel={SECONDARY_BUTTON_ARIA_LABEL}\n ariaHasPopup\n ariaExpanded={isDialogOpen}\n data-testid={getTestId(ComponentDefaultTestId.SPLIT_BUTTON_SECONDARY_BUTTON, id)}\n >\n <div className={styles.secondaryButtonIconWrapper}>\n <DropdownChevronDown aria-hidden=\"true\" />\n </div>\n </Button>\n </Dialog>\n </div>\n </div>\n );\n};\n\ninterface SplitButtonStaticProps {\n secondaryPositions: typeof SplitButtonSecondaryContentPosition;\n secondaryDialogPositions: typeof SplitButtonSecondaryContentPosition;\n sizes: typeof Button.sizes;\n colors: typeof Button.colors;\n kinds: typeof Button.kinds;\n inputTags: typeof Button.inputTags;\n dialogPaddingSizes: typeof DialogContentContainer.sizes;\n}\n\nexport default withStaticPropsWithoutForwardRef<SplitButtonProps, SplitButtonStaticProps>(SplitButton, {\n secondaryPositions: SplitButtonSecondaryContentPosition,\n secondaryDialogPositions: SplitButtonSecondaryContentPosition,\n sizes: Button.sizes,\n colors: Button.colors,\n kinds: Button.kinds,\n inputTags: Button.inputTags,\n dialogPaddingSizes: DialogContentContainer.sizes\n});\n"],"names":["withStaticPropsWithoutForwardRef","_a","secondaryDialogContent","_a$onSecondaryDialogD","onSecondaryDialogDidShow","NOOP","_a$onSecondaryDialogD2","onSecondaryDialogDidHide","shouldCloseOnClickInsideDialog","_a$zIndex","zIndex","_a$secondaryDialogCla","secondaryDialogClassName","_a$secondaryDialogPos","secondaryDialogPosition","dialogContainerSelector","_a$dialogPaddingSize","dialogPaddingSize","disabled","loading","_a$kind","kind","_a$color","color","className","leftIcon","rightIcon","onClick","children","marginLeft","marginRight","active","id","dataTestId","buttonProps","__rest","_useState","useState","_useState2","_slicedToArray","isDialogOpen","setDialogOpen","_useState3","_useState4","isHovered","setIsHover","_useState5","_useState6","isActive","setIsActive","ref","useRef","secondaryButtonRef","setHovered","useCallback","setNotHovered","shouldSetActive","e","isInsideClass","target","SECONDARY_BUTTON_WRAPPER_CLASSNAME","setActive","setNotActive","setActiveOnEnter","showDialog","hideDialog","_","eventName","current","focus","useEventListener","callback","useKeyEvent","keys","ENTER_KEYS","classNames","useMemo","cx","styles","button","getStyle","camelCase","_defineProperty","mainActive","splitContentOpen","hovered","dialogShowTrigger","DEFAULT_DIALOG_SHOW_TRIGGER","dialogHideTrigger","concat","_toConsumableArray","DEFAULT_DIALOG_HIDE_TRIGGER","HideShowEvent","CONTENT_CLICK","actionsContent","content","React","createElement","DialogContentContainer","type","types","POPOVER","size","animationEdgePosition","getTestId","ComponentDefaultTestId","SPLIT_BUTTON","ComponentVibeId","Button","Object","assign","preventClickAnimation","rightFlat","mainButton","onFocus","onBlur","SPLIT_BUTTON_PRIMARY_BUTTON","secondaryButtonWrapper","Dialog","wrapperClassName","position","containerSelector","startingEdge","animationType","AnimationType","EXPAND","moveBy","DIALOG_MOVE_BY","onDialogDidShow","onDialogDidHide","showTrigger","hideTrigger","leftFlat","noSidePadding","secondaryButton","ariaLabel","SECONDARY_BUTTON_ARIA_LABEL","ariaHasPopup","ariaExpanded","SPLIT_BUTTON_SECONDARY_BUTTON","secondaryButtonIconWrapper","DropdownChevronDown","secondaryPositions","SplitButtonSecondaryContentPosition","secondaryDialogPositions","sizes","colors","kinds","inputTags","dialogPaddingSizes"],"mappings":"khDA+EA,IAkOeA,EAAAA,GAlOK,SAACC,GAAA,IACnBC,EAyByBD,EAzBzBC,uBAAsBC,EAyBGF,EAxBzBG,yBAAAA,OAA2BC,IAAHF,EAAGE,EAAIF,EAAAG,EAwBNL,EAvBzBM,yB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EACD5E,GAAW,CACfgB,IAAKE,GACL2D,uBAAqB,EACrBqB,UAAQ,EACRC,eACA,EAAA9G,MAAOA,EACPF,KAAMA,EACNG,UAAWsD,EAAOwD,gBAClBvG,OAAQS,GACRV,YAAaA,GACboF,QAAS7D,GACT8D,OAAQ5D,GACRrC,SAAUA,EACVqH,UAAWC,EACXC,cACA,EAAAC,aAAclG,GAAY,cACbgE,EAAUC,EAAuBkC,8BAA+B3G,MAE7EgE,EAAAC,cAAA,MAAA,CAAKzE,UAAWsD,EAAO8D,4BACrB5C,EAACC,cAAA4C,EAAgC,CAAA,cAAA,aAO/C,GAYuG,CACrGC,mBAAoBC,EACpBC,yBAA0BD,EAC1BE,MAAOrC,EAAOqC,MACdC,OAAQtC,EAAOsC,OACfC,MAAOvC,EAAOuC,MACdC,UAAWxC,EAAOwC,UAClBC,mBAAoBnD,EAAuB+C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{keyCodes as t}from"../../constants/keyCodes.js";import"../../constants/sizes.js";import{
|
|
1
|
+
import{keyCodes as t}from"../../constants/keyCodes.js";import"../../constants/sizes.js";import{HideShowEvent as o}from"../../../components/dialog/dist/Dialog/DialogConstants.js";var s={main:8,secondary:0},n=[o.CLICK],a=[o.CLICK_OUTSIDE,o.CLICK,o.ESCAPE_KEY],T="monday-style-split-button__secondary-button-wrapper",i=[t.ENTER],m={BOTTOM:"bottom",BOTTOM_START:"bottom-start",BOTTOM_END:"bottom-end"},e={BOTTOM_START:"bottom-start",BOTTOM_MIDDLE:"bottom",BOTTOM_END:"bottom-end"},r="additional actions";export{a as DEFAULT_DIALOG_HIDE_TRIGGER,n as DEFAULT_DIALOG_SHOW_TRIGGER,s as DIALOG_MOVE_BY,m as DialogPosition,i as ENTER_KEYS,r as SECONDARY_BUTTON_ARIA_LABEL,T as SECONDARY_BUTTON_WRAPPER_CLASSNAME,e as SplitButtonSecondaryContentPosition};
|
|
2
2
|
//# sourceMappingURL=SplitButtonConstants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplitButtonConstants.js","sources":["../../../../../src/components/SplitButton/SplitButtonConstants.ts"],"sourcesContent":["// Constants\nimport { keyCodes } from \"../../constants\";\nimport { DialogTriggerEventEnum as HideShowEvent } from \"@vibe/dialog\";\n\nexport const DIALOG_MOVE_BY = { main: 8, secondary: 0 };\nexport const DEFAULT_DIALOG_SHOW_TRIGGER = [HideShowEvent.CLICK];\nexport const DEFAULT_DIALOG_HIDE_TRIGGER = [HideShowEvent.CLICK_OUTSIDE, HideShowEvent.CLICK, HideShowEvent.ESCAPE_KEY];\nexport const SECONDARY_BUTTON_WRAPPER_CLASSNAME = \"monday-style-split-button__secondary-button-wrapper\";\nexport const EMPTY_ARR: string[] = [];\n\nexport const ENTER_KEYS = [keyCodes.ENTER];\n\n//TODO Remove once change dialogPosition to const\nexport const DialogPosition = {\n BOTTOM: \"bottom\",\n BOTTOM_START: \"bottom-start\",\n BOTTOM_END: \"bottom-end\"\n} as const;\n\nexport const SplitButtonSecondaryContentPosition = {\n BOTTOM_START: DialogPosition.BOTTOM_START,\n BOTTOM_MIDDLE: DialogPosition.BOTTOM,\n BOTTOM_END: DialogPosition.BOTTOM_END\n} as const;\n\nexport type SplitButtonSecondaryContentPositionType =\n (typeof SplitButtonSecondaryContentPosition)[keyof typeof SplitButtonSecondaryContentPosition];\n\nexport const SECONDARY_BUTTON_ARIA_LABEL = \"additional actions\";\n"],"names":["DIALOG_MOVE_BY","main","secondary","DEFAULT_DIALOG_SHOW_TRIGGER","HideShowEvent","CLICK","DEFAULT_DIALOG_HIDE_TRIGGER","CLICK_OUTSIDE","ESCAPE_KEY","SECONDARY_BUTTON_WRAPPER_CLASSNAME","ENTER_KEYS","keyCodes","ENTER","DialogPosition","BOTTOM","BOTTOM_START","BOTTOM_END","SplitButtonSecondaryContentPosition","BOTTOM_MIDDLE","SECONDARY_BUTTON_ARIA_LABEL"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SplitButtonConstants.js","sources":["../../../../../src/components/SplitButton/SplitButtonConstants.ts"],"sourcesContent":["// Constants\nimport { keyCodes } from \"../../constants\";\nimport { DialogTriggerEventEnum as HideShowEvent } from \"@vibe/dialog\";\n\nexport const DIALOG_MOVE_BY = { main: 8, secondary: 0 };\nexport const DEFAULT_DIALOG_SHOW_TRIGGER = [HideShowEvent.CLICK];\nexport const DEFAULT_DIALOG_HIDE_TRIGGER = [HideShowEvent.CLICK_OUTSIDE, HideShowEvent.CLICK, HideShowEvent.ESCAPE_KEY];\nexport const SECONDARY_BUTTON_WRAPPER_CLASSNAME = \"monday-style-split-button__secondary-button-wrapper\";\nexport const EMPTY_ARR: string[] = [];\n\nexport const ENTER_KEYS = [keyCodes.ENTER];\n\n//TODO Remove once change dialogPosition to const\nexport const DialogPosition = {\n BOTTOM: \"bottom\",\n BOTTOM_START: \"bottom-start\",\n BOTTOM_END: \"bottom-end\"\n} as const;\n\nexport const SplitButtonSecondaryContentPosition = {\n BOTTOM_START: DialogPosition.BOTTOM_START,\n BOTTOM_MIDDLE: DialogPosition.BOTTOM,\n BOTTOM_END: DialogPosition.BOTTOM_END\n} as const;\n\nexport type SplitButtonSecondaryContentPositionType =\n (typeof SplitButtonSecondaryContentPosition)[keyof typeof SplitButtonSecondaryContentPosition];\n\nexport const SECONDARY_BUTTON_ARIA_LABEL = \"additional actions\";\n"],"names":["DIALOG_MOVE_BY","main","secondary","DEFAULT_DIALOG_SHOW_TRIGGER","HideShowEvent","CLICK","DEFAULT_DIALOG_HIDE_TRIGGER","CLICK_OUTSIDE","ESCAPE_KEY","SECONDARY_BUTTON_WRAPPER_CLASSNAME","ENTER_KEYS","keyCodes","ENTER","DialogPosition","BOTTOM","BOTTOM_START","BOTTOM_END","SplitButtonSecondaryContentPosition","BOTTOM_MIDDLE","SECONDARY_BUTTON_ARIA_LABEL"],"mappings":"kLAIO,IAAMA,EAAiB,CAAEC,KAAM,EAAGC,UAAW,GACvCC,EAA8B,CAACC,EAAcC,OAC7CC,EAA8B,CAACF,EAAcG,cAAeH,EAAcC,MAAOD,EAAcI,YAC/FC,EAAqC,sDAGrCC,EAAa,CAACC,EAASC,OAGvBC,EAAiB,CAC5BC,OAAQ,SACRC,aAAc,eACdC,WAAY,cAGDC,EAAsC,CACjDF,aAAcF,eACdK,cAAeL,SACfG,WAAYH,cAMDM,EAA8B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defineProperty as o}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{__rest as t}from"../../../_virtual/_tslib.js";import
|
|
1
|
+
import{defineProperty as o}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{__rest as t}from"../../../_virtual/_tslib.js";import r,{useMemo as i,useCallback as s}from"react";import e from"classnames";import{NOOP as n}from"../../utils/function-utils.js";import{NEXT_TEXT as m,BACK_TEXT as a}from"./StepsConstants.js";import{ComponentDefaultTestId as c}from"../../tests/constants.js";import p from"./StepsCommand.module.scss.js";import{camelCase as l}from"es-toolkit";import{getStyle as d}from"../../helpers/typesciptCssModulesHelper.js";import u from"../../../components/button/dist/Button/Button.js";import f from"../../../components/icon/dist/Icon/Icon.js";import v from"../../../icons/dist/react/NavigationChevronRight.js";import j from"../../../icons/dist/react/NavigationChevronLeft.js";var C=function(C){var b=C.isNext,S=void 0!==b&&b,_=C.onChangeActiveStep,h=void 0===_?n:_,N=C.activeStepIndex,g=C.stepsCount,A=C.isIconHidden,M=void 0!==A&&A,P=C.buttonProps,k=void 0===P?{}:P,y=C.color,B=void 0===y?"primary":y,D=k.children,E=t(k,["children"]),I=i((function(){return D||(S?m:a)}),[S,D]),O=S?N+1:N-1,R=s((function(o){return h(o,O)}),[O,h]),x=S&&N===g-1||!S&&0===N,H=S?v:j;return r.createElement(u,Object.assign({className:e(p.command,o({},p.backward,!S)),"data-testid":S?c.STEPS_FORWARD_COMMAND:c.STEPS_BACKWARD_COMMAND,kind:"tertiary",onClick:R,disabled:x,color:B},E),I,M?null:r.createElement(f,{icon:H,className:e(p.icon,d(p,l("color-"+B)),o({},p.disabled,x))}))};export{C as StepsCommand};
|
|
2
2
|
//# sourceMappingURL=StepsCommand.js.map
|