@sprinklrjs/spaceweb 11.0.0 → 12.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/allComponentsAndUtilities.d.ts +1 -0
- package/allComponentsAndUtilities.js +2 -1
- package/asyncSelect/asyncSelect.d.ts +4 -2
- package/asyncSelect/asyncSelect.js +43 -108
- package/asyncSelect/groupedAsyncSelect.d.ts +5 -0
- package/asyncSelect/groupedAsyncSelect.js +41 -0
- package/asyncSelect/helpers.d.ts +8 -2
- package/asyncSelect/helpers.js +35 -4
- package/asyncSelect/hooks/useAsyncOptionHandlers.d.ts +16 -11
- package/asyncSelect/hooks/useAsyncOptionHandlers.js +73 -26
- package/asyncSelect/hooks/useAsyncSelect.d.ts +10 -0
- package/asyncSelect/hooks/useAsyncSelect.js +182 -0
- package/asyncSelect/hooks/useResolveSelectedOptions.d.ts +10 -7
- package/asyncSelect/hooks/useResolveSelectedOptions.js +59 -47
- package/asyncSelect/index.d.ts +4 -1
- package/asyncSelect/index.js +8 -0
- package/asyncSelect/types.d.ts +61 -9
- package/avatar/avatar.js +12 -2
- package/avatar/styled-component.js +7 -22
- package/badge/styled-component.js +10 -8
- package/banner/banner.js +1 -1
- package/breadcrumb/breadcrumb-item.d.ts +7 -0
- package/breadcrumb/breadcrumb-item.js +41 -0
- package/breadcrumb/breadcrumb.d.ts +7 -0
- package/breadcrumb/breadcrumb.js +29 -0
- package/breadcrumb/index.d.ts +4 -0
- package/breadcrumb/index.js +17 -0
- package/breadcrumb/package.json +4 -0
- package/breadcrumb/styled-components.d.ts +7 -0
- package/breadcrumb/styled-components.js +19 -0
- package/breadcrumb/types.d.ts +38 -0
- package/breadcrumb/types.js +2 -0
- package/button/Button.d.ts +2 -0
- package/button/Button.js +13 -1
- package/button/IconButton/IconButton.d.ts +2 -4
- package/button/IconButton/IconButton.js +5 -2
- package/button/IconButton/types.d.ts +10 -1
- package/button/basewebAdapter.d.ts +3 -1
- package/button/styled-components.js +30 -25
- package/button/types.d.ts +3 -0
- package/button-group/ButtonGroup.d.ts +1 -0
- package/button-group/ButtonGroup.js +9 -5
- package/button-group/StatefulButtonGroup.d.ts +1 -0
- package/button-group/styled-components.d.ts +34 -0
- package/button-group/styled-components.js +57 -9
- package/button-group/types.d.ts +2 -0
- package/checkbox/basewebAdapters.js +6 -1
- package/color-picker/ColorPalette.d.ts +9 -0
- package/color-picker/ColorPalette.js +26 -0
- package/color-picker/ColorPicker.d.ts +3 -0
- package/color-picker/ColorPicker.js +35 -0
- package/color-picker/Swatch.d.ts +12 -0
- package/color-picker/Swatch.js +40 -0
- package/color-picker/colors.d.ts +1 -0
- package/color-picker/colors.js +109 -0
- package/color-picker/getContrastRatio.d.ts +1 -0
- package/color-picker/getContrastRatio.js +23 -0
- package/color-picker/index.d.ts +3 -0
- package/color-picker/index.js +7 -0
- package/color-picker/locale.d.ts +3 -0
- package/color-picker/locale.js +2 -0
- package/color-picker/package.json +4 -0
- package/color-picker/styled-component.d.ts +1 -0
- package/color-picker/styled-component.js +5 -0
- package/color-picker/types.d.ts +15 -0
- package/color-picker/types.js +2 -0
- package/currency/Currency.d.ts +3 -0
- package/currency/Currency.js +14 -0
- package/currency/constants.d.ts +3 -0
- package/currency/constants.js +8 -0
- package/currency/index.d.ts +5 -0
- package/currency/index.js +12 -0
- package/currency/package.json +4 -0
- package/currency/types.d.ts +7 -0
- package/currency/types.js +2 -0
- package/currency/useCurrency.d.ts +2 -0
- package/currency/useCurrency.js +12 -0
- package/currency/utils.d.ts +8 -0
- package/currency/utils.js +11 -0
- package/date-input/Before.d.ts +4 -2
- package/date-input/Before.js +4 -4
- package/date-input/CalendarIconButton.js +7 -1
- package/date-input/DateInput.d.ts +1 -1
- package/date-input/DateInput.js +46 -25
- package/date-input/styled-components.d.ts +2 -2
- package/date-input/styled-components.js +10 -8
- package/date-input/types.d.ts +4 -2
- package/date-picker/Calendar.js +5 -3
- package/date-picker/DateInput.js +16 -14
- package/date-picker/DatePickerContent.d.ts +9 -3
- package/date-picker/DatePickerContent.js +59 -8
- package/date-picker/DatePickerInput.js +9 -6
- package/date-picker/StatelessDatePicker.js +35 -16
- package/date-picker/locale.d.ts +2 -0
- package/date-picker/stateful-container.js +11 -8
- package/date-picker/styled-components.js +53 -3
- package/date-picker/types.d.ts +10 -1
- package/date-picker/utils.d.ts +3 -1
- package/date-picker/utils.js +8 -3
- package/date-time/DateTime.d.ts +3 -0
- package/date-time/DateTime.js +12 -0
- package/date-time/index.d.ts +3 -0
- package/date-time/index.js +9 -0
- package/date-time/package.json +4 -0
- package/date-time/types.d.ts +21 -0
- package/date-time/types.js +18 -0
- package/date-time/useDateTime.d.ts +2 -0
- package/date-time/useDateTime.js +13 -0
- package/date-time/variants.d.ts +4 -0
- package/date-time/variants.js +87 -0
- package/esm/allComponentsAndUtilities.d.ts +1 -0
- package/esm/allComponentsAndUtilities.js +2 -0
- package/esm/asyncSelect/asyncSelect.d.ts +4 -2
- package/esm/asyncSelect/asyncSelect.js +46 -111
- package/esm/asyncSelect/groupedAsyncSelect.d.ts +5 -0
- package/esm/asyncSelect/groupedAsyncSelect.js +37 -0
- package/esm/asyncSelect/helpers.d.ts +8 -2
- package/esm/asyncSelect/helpers.js +31 -3
- package/esm/asyncSelect/hooks/useAsyncOptionHandlers.d.ts +16 -11
- package/esm/asyncSelect/hooks/useAsyncOptionHandlers.js +76 -29
- package/esm/asyncSelect/hooks/useAsyncSelect.d.ts +10 -0
- package/esm/asyncSelect/hooks/useAsyncSelect.js +178 -0
- package/esm/asyncSelect/hooks/useResolveSelectedOptions.d.ts +10 -7
- package/esm/asyncSelect/hooks/useResolveSelectedOptions.js +62 -50
- package/esm/asyncSelect/index.d.ts +4 -1
- package/esm/asyncSelect/index.js +3 -0
- package/esm/asyncSelect/types.d.ts +61 -9
- package/esm/avatar/avatar.js +12 -2
- package/esm/avatar/styled-component.js +7 -22
- package/esm/badge/styled-component.js +10 -8
- package/esm/banner/banner.js +1 -1
- package/esm/breadcrumb/breadcrumb-item.d.ts +7 -0
- package/esm/breadcrumb/breadcrumb-item.js +39 -0
- package/esm/breadcrumb/breadcrumb.d.ts +7 -0
- package/esm/breadcrumb/breadcrumb.js +27 -0
- package/esm/breadcrumb/index.d.ts +4 -0
- package/esm/breadcrumb/index.js +3 -0
- package/esm/breadcrumb/styled-components.d.ts +7 -0
- package/esm/breadcrumb/styled-components.js +15 -0
- package/esm/breadcrumb/types.d.ts +38 -0
- package/esm/breadcrumb/types.js +1 -0
- package/esm/button/Button.d.ts +2 -0
- package/esm/button/Button.js +13 -1
- package/esm/button/IconButton/IconButton.d.ts +2 -4
- package/esm/button/IconButton/IconButton.js +5 -2
- package/esm/button/IconButton/types.d.ts +10 -1
- package/esm/button/basewebAdapter.d.ts +3 -1
- package/esm/button/styled-components.js +30 -25
- package/esm/button/types.d.ts +3 -0
- package/esm/button-group/ButtonGroup.d.ts +1 -0
- package/esm/button-group/ButtonGroup.js +9 -5
- package/esm/button-group/StatefulButtonGroup.d.ts +1 -0
- package/esm/button-group/styled-components.d.ts +34 -0
- package/esm/button-group/styled-components.js +55 -8
- package/esm/button-group/types.d.ts +2 -0
- package/esm/checkbox/basewebAdapters.js +6 -1
- package/esm/color-picker/ColorPalette.d.ts +9 -0
- package/esm/color-picker/ColorPalette.js +22 -0
- package/esm/color-picker/ColorPicker.d.ts +3 -0
- package/esm/color-picker/ColorPicker.js +31 -0
- package/esm/color-picker/Swatch.d.ts +12 -0
- package/esm/color-picker/Swatch.js +37 -0
- package/esm/color-picker/colors.d.ts +1 -0
- package/esm/color-picker/colors.js +106 -0
- package/esm/color-picker/getContrastRatio.d.ts +1 -0
- package/esm/color-picker/getContrastRatio.js +19 -0
- package/esm/color-picker/index.d.ts +3 -0
- package/esm/color-picker/index.js +2 -0
- package/esm/color-picker/locale.d.ts +3 -0
- package/esm/color-picker/locale.js +1 -0
- package/esm/color-picker/styled-component.d.ts +1 -0
- package/esm/color-picker/styled-component.js +2 -0
- package/esm/color-picker/types.d.ts +15 -0
- package/esm/color-picker/types.js +1 -0
- package/esm/currency/Currency.d.ts +3 -0
- package/esm/currency/Currency.js +10 -0
- package/esm/currency/constants.d.ts +3 -0
- package/esm/currency/constants.js +5 -0
- package/esm/currency/index.d.ts +5 -0
- package/esm/currency/index.js +5 -0
- package/esm/currency/types.d.ts +7 -0
- package/esm/currency/types.js +1 -0
- package/esm/currency/useCurrency.d.ts +2 -0
- package/esm/currency/useCurrency.js +8 -0
- package/esm/currency/utils.d.ts +8 -0
- package/esm/currency/utils.js +7 -0
- package/esm/date-input/Before.d.ts +4 -2
- package/esm/date-input/Before.js +4 -4
- package/esm/date-input/CalendarIconButton.js +7 -1
- package/esm/date-input/DateInput.d.ts +1 -1
- package/esm/date-input/DateInput.js +47 -26
- package/esm/date-input/styled-components.d.ts +2 -2
- package/esm/date-input/styled-components.js +10 -7
- package/esm/date-input/types.d.ts +4 -2
- package/esm/date-picker/Calendar.js +5 -3
- package/esm/date-picker/DateInput.js +17 -15
- package/esm/date-picker/DatePickerContent.d.ts +9 -3
- package/esm/date-picker/DatePickerContent.js +60 -9
- package/esm/date-picker/DatePickerInput.js +9 -6
- package/esm/date-picker/StatelessDatePicker.js +35 -16
- package/esm/date-picker/locale.d.ts +2 -0
- package/esm/date-picker/stateful-container.js +11 -8
- package/esm/date-picker/styled-components.js +53 -3
- package/esm/date-picker/types.d.ts +10 -1
- package/esm/date-picker/utils.d.ts +3 -1
- package/esm/date-picker/utils.js +9 -4
- package/esm/date-time/DateTime.d.ts +3 -0
- package/esm/date-time/DateTime.js +8 -0
- package/esm/date-time/index.d.ts +3 -0
- package/esm/date-time/index.js +3 -0
- package/esm/date-time/types.d.ts +21 -0
- package/esm/date-time/types.js +15 -0
- package/esm/date-time/useDateTime.d.ts +2 -0
- package/esm/date-time/useDateTime.js +9 -0
- package/esm/date-time/variants.d.ts +4 -0
- package/esm/date-time/variants.js +84 -0
- package/esm/form-control/form-control.d.ts +1 -1
- package/esm/form-control/form-control.js +17 -12
- package/esm/form-control/styled-component.js +17 -6
- package/esm/helpers/ClearIconButton.js +3 -1
- package/esm/helpers/StyledTombstone.d.ts +1 -0
- package/esm/helpers/StyledTombstone.js +17 -0
- package/esm/helpers/baseui/useConvertOverrides.js +6 -1
- package/esm/helpers/commonStyles.js +3 -6
- package/esm/helpers/index.d.ts +1 -0
- package/esm/helpers/index.js +8 -0
- package/esm/helpers/themeHelpers.d.ts +1 -0
- package/esm/helpers/themeHelpers.js +13 -0
- package/esm/hooks/useAutoFocus.js +6 -0
- package/esm/hooks/useMatchMedia.js +13 -2
- package/esm/icon/components/alert-solid.js +2 -0
- package/esm/icon/components/alert.js +2 -0
- package/esm/icon/components/calendar-solid.js +2 -0
- package/esm/icon/components/chevron-down.js +2 -0
- package/esm/icon/components/chevron-left.d.ts +3 -0
- package/esm/icon/components/chevron-left.js +8 -0
- package/esm/icon/components/chevron-right.d.ts +3 -0
- package/esm/icon/components/chevron-right.js +8 -0
- package/esm/icon/components/close.js +2 -0
- package/esm/icon/components/error-clr.js +2 -0
- package/esm/icon/components/error-solid.js +2 -0
- package/esm/icon/components/error.js +2 -0
- package/esm/icon/components/imagePreview.js +2 -0
- package/esm/icon/components/info.js +2 -0
- package/esm/icon/components/play-video.js +2 -0
- package/esm/icon/components/reset-color.d.ts +3 -0
- package/esm/icon/components/reset-color.js +8 -0
- package/esm/icon/components/search.js +2 -0
- package/esm/icon/components/tick.js +2 -0
- package/esm/icon/components/tickCircle-solid.js +2 -0
- package/esm/icon/components/user.js +2 -0
- package/esm/icon/components/video-non-playable.js +2 -0
- package/esm/index.d.ts +2 -0
- package/esm/index.js +2 -0
- package/esm/input/basewebAdapters.js +18 -3
- package/esm/input/styled-components.js +8 -6
- package/esm/input/types.d.ts +4 -1
- package/esm/layer/useLayersContextValue.js +3 -2
- package/esm/list/avatar-list-item.d.ts +12 -22
- package/esm/list/avatar-list-item.js +6 -4
- package/esm/list/index.d.ts +1 -1
- package/esm/list/index.js +1 -1
- package/esm/list/list-item.d.ts +3 -1
- package/esm/list/list-item.js +9 -6
- package/esm/list/styled-component.d.ts +1 -0
- package/esm/list/styled-component.js +23 -15
- package/esm/list/types.d.ts +3 -0
- package/esm/locale/en_US.js +26 -0
- package/esm/locale/types.d.ts +19 -0
- package/esm/menu/MenuContext.d.ts +2 -1
- package/esm/menu/MenuContext.js +1 -0
- package/esm/menu/menu-item.d.ts +4 -1
- package/esm/menu/menu-item.js +11 -11
- package/esm/menu/menu.d.ts +1 -0
- package/esm/menu/menu.js +11 -11
- package/esm/menu/types.d.ts +1 -0
- package/esm/menu/useKeyboardNavigation.d.ts +6 -3
- package/esm/menu/useKeyboardNavigation.js +21 -14
- package/esm/menu/useStatefulMenu.d.ts +5 -2
- package/esm/menu/useStatefulMenu.js +14 -8
- package/esm/modal/modal.js +3 -1
- package/esm/modal/overrides.d.ts +2 -2
- package/esm/modal/overrides.js +6 -7
- package/esm/modal/styled-components.js +7 -7
- package/esm/number/Number.d.ts +3 -0
- package/esm/number/Number.js +10 -0
- package/esm/number/constants.d.ts +2 -0
- package/esm/number/constants.js +4 -0
- package/esm/number/index.d.ts +5 -0
- package/esm/number/index.js +5 -0
- package/esm/number/types.d.ts +6 -0
- package/esm/number/types.js +1 -0
- package/esm/number/useNumber.d.ts +2 -0
- package/esm/number/useNumber.js +8 -0
- package/esm/overrides/index.d.ts +1 -1
- package/esm/overrides/index.js +1 -1
- package/esm/overrides/mergeOverrides.d.ts +3 -2
- package/esm/overrides/mergeOverrides.js +1 -1
- package/esm/payment-card/basewebAdapters.d.ts +2 -0
- package/esm/payment-card/basewebAdapters.js +23 -1
- package/esm/payment-card/styled-components.js +25 -6
- package/esm/phone-input/country-select-container.js +1 -1
- package/esm/phone-input/country-select.js +3 -3
- package/esm/phone-input/default-props.d.ts +5 -5
- package/esm/phone-input/default-props.js +7 -7
- package/esm/phone-input/flag-container.js +1 -1
- package/esm/phone-input/phone-input.d.ts +0 -4
- package/esm/phone-input/phone-input.js +20 -12
- package/esm/phone-input/stateful-phone-input-container.js +4 -3
- package/esm/phone-input/stateful-phone-input.d.ts +0 -4
- package/esm/phone-input/styled-components.d.ts +9 -1
- package/esm/phone-input/styled-components.js +21 -7
- package/esm/phone-input/types.d.ts +2 -1
- package/esm/phone-input/utils.d.ts +5 -1
- package/esm/phone-input/utils.js +6 -1
- package/esm/popover/adapter.d.ts +1 -0
- package/esm/popover/adapter.js +15 -0
- package/esm/popover/overrides.js +8 -19
- package/esm/popover/popover.d.ts +1 -0
- package/esm/popover/popover.js +9 -4
- package/esm/popover/stateful-popover.js +2 -2
- package/esm/popover/types.d.ts +3 -0
- package/esm/popover/utils.d.ts +12 -0
- package/esm/popover/utils.js +9 -0
- package/esm/progress/linear/styled-component.d.ts +1 -1
- package/esm/progress/linear/styled-component.js +5 -5
- package/esm/radio/styled-components.js +5 -5
- package/esm/search/index.d.ts +1 -0
- package/esm/search/index.js +1 -0
- package/esm/search/search.d.ts +1 -1
- package/esm/search/search.js +15 -6
- package/esm/search/stateful-search.d.ts +3 -0
- package/esm/search/stateful-search.js +15 -0
- package/esm/search/styled-components.d.ts +1 -10
- package/esm/search/styled-components.js +54 -24
- package/esm/search/types.d.ts +8 -2
- package/esm/select/base-select.d.ts +22 -5
- package/esm/select/base-select.js +174 -82
- package/esm/select/constants.d.ts +3 -0
- package/esm/select/constants.js +3 -1
- package/esm/select/default-props.d.ts +1 -0
- package/esm/select/default-props.js +3 -0
- package/esm/select/index.d.ts +2 -2
- package/esm/select/index.js +2 -2
- package/esm/select/locale.d.ts +4 -0
- package/esm/select/mobileSelect/MobileSheet.js +3 -1
- package/esm/select/multi-value.js +22 -12
- package/esm/select/overlaySelect/OverlaySelect.js +1 -0
- package/esm/select/overlaySelect/hooks/useOverlaySelectOverrides.d.ts +2 -1
- package/esm/select/overlaySelect/hooks/useOverlaySelectOverrides.js +13 -16
- package/esm/select/overrides.d.ts +3 -0
- package/esm/select/overrides.js +19 -6
- package/esm/select/select.d.ts +1 -0
- package/esm/select/select.js +9 -3
- package/esm/select/selectMenuAdapter/CollapsibleSelectMenu.d.ts +118 -0
- package/esm/select/selectMenuAdapter/CollapsibleSelectMenu.js +70 -0
- package/esm/select/selectMenuAdapter/SelectMenuAdapter.d.ts +2 -34
- package/esm/select/selectMenuAdapter/SelectMenuAdapter.js +3 -3
- package/esm/select/selectMenuAdapter/SelectMenuItem.d.ts +4 -1
- package/esm/select/selectMenuAdapter/hooks/useGetExpandedGroup.d.ts +6 -0
- package/esm/select/selectMenuAdapter/hooks/useGetExpandedGroup.js +16 -0
- package/esm/select/selectMenuAdapter/types.d.ts +42 -0
- package/esm/select/selectMenuAdapter/types.js +1 -0
- package/esm/select/stateful-select.d.ts +1 -0
- package/esm/select/styled-component.d.ts +10 -1
- package/esm/select/styled-component.js +39 -15
- package/esm/select/types.d.ts +23 -1
- package/esm/select/types.js +1 -0
- package/esm/select/utils/default-filter-options.d.ts +2 -1
- package/esm/select/utils/default-filter-options.js +5 -1
- package/esm/select/utils/hidden-element.d.ts +6 -0
- package/esm/select/utils/hidden-element.js +16 -0
- package/esm/select/utils/merge-options.d.ts +2 -0
- package/esm/select/utils/merge-options.js +18 -0
- package/esm/select/utils/test-utils.d.ts +1 -0
- package/esm/select/utils/test-utils.js +7 -0
- package/esm/slider/styled-components.js +4 -4
- package/esm/snackbar/Snackbar.js +12 -12
- package/esm/snackbar/styled-component.js +9 -6
- package/esm/spacewebProvider/SpacewebProvider.d.ts +2 -0
- package/esm/spacewebProvider/SpacewebProvider.js +9 -9
- package/esm/stack/stack.js +6 -13
- package/esm/style/_buildUtils.d.ts +1 -1
- package/esm/style/_buildUtils.js +3 -1
- package/esm/style/_parseStyle.js +7 -2
- package/esm/style/useMemoizedStyletron.js +6 -1
- package/esm/switch/styled-components.js +3 -3
- package/esm/tag/avatar-tag.js +23 -16
- package/esm/tag/styled-components.js +32 -27
- package/esm/tag/tag.js +20 -12
- package/esm/tag/types.d.ts +2 -2
- package/esm/tag/utils.d.ts +50 -0
- package/esm/tag/utils.js +64 -0
- package/esm/textarea/basewebAdapters.js +3 -3
- package/esm/textarea/textarea.js +3 -3
- package/esm/textarea/types.d.ts +2 -2
- package/esm/theme/Provider.d.ts +10 -0
- package/esm/theme/Provider.js +61 -0
- package/esm/theme/context.d.ts +1 -10
- package/esm/theme/context.js +1 -61
- package/esm/theme/index.d.ts +1 -0
- package/esm/theme/index.js +1 -0
- package/esm/time-picker/TimePicker.js +4 -1
- package/esm/time-range-picker/RangeSelectorContainer.js +1 -1
- package/esm/time-range-picker/TimeRangePicker.js +20 -12
- package/esm/time-range-picker/index.d.ts +1 -1
- package/esm/time-range-picker/index.js +1 -1
- package/esm/time-range-picker/types.d.ts +1 -2
- package/esm/time-range-picker/utils.d.ts +33 -4
- package/esm/time-range-picker/utils.js +49 -15
- package/esm/time-zone-picker/types.d.ts +2 -0
- package/esm/tooltip/overrides.js +0 -1
- package/esm/tooltip/stateful-tooltip.js +2 -2
- package/esm/tooltip/tooltip.d.ts +1 -1
- package/esm/tooltip/tooltip.js +5 -2
- package/esm/tooltip/types.d.ts +2 -0
- package/esm/types.d.ts +2 -1
- package/esm/typography/Typography.js +14 -1
- package/esm/typography/constants.d.ts +56 -0
- package/esm/typography/constants.js +56 -0
- package/esm/typography/index.d.ts +1 -0
- package/esm/typography/index.js +1 -0
- package/esm/typography/styled-components.js +12 -4
- package/esm/typography/types.d.ts +1 -1
- package/esm/utils/intlNumberFormatUtils/index.d.ts +7 -0
- package/esm/utils/intlNumberFormatUtils/index.js +36 -0
- package/esm/utils/intlNumberFormatUtils/types.d.ts +21 -0
- package/esm/utils/intlNumberFormatUtils/types.js +6 -0
- package/form-control/form-control.d.ts +1 -1
- package/form-control/form-control.js +16 -11
- package/form-control/styled-component.js +17 -6
- package/helpers/ClearIconButton.js +3 -1
- package/helpers/StyledTombstone.d.ts +1 -0
- package/helpers/StyledTombstone.js +21 -0
- package/helpers/baseui/useConvertOverrides.js +6 -1
- package/helpers/commonStyles.js +3 -6
- package/helpers/index.d.ts +1 -0
- package/helpers/index.js +10 -1
- package/helpers/themeHelpers.d.ts +1 -0
- package/helpers/themeHelpers.js +15 -1
- package/hooks/useAutoFocus.js +6 -0
- package/hooks/useMatchMedia.js +13 -2
- package/icon/components/alert-solid.js +2 -0
- package/icon/components/alert.js +2 -0
- package/icon/components/calendar-solid.js +2 -0
- package/icon/components/chevron-down.js +2 -0
- package/icon/components/chevron-left.d.ts +3 -0
- package/icon/components/chevron-left.js +11 -0
- package/icon/components/chevron-right.d.ts +3 -0
- package/icon/components/chevron-right.js +11 -0
- package/icon/components/close.js +2 -0
- package/icon/components/error-clr.js +2 -0
- package/icon/components/error-solid.js +2 -0
- package/icon/components/error.js +2 -0
- package/icon/components/imagePreview.js +2 -0
- package/icon/components/info.js +2 -0
- package/icon/components/play-video.js +2 -0
- package/icon/components/reset-color.d.ts +3 -0
- package/icon/components/reset-color.js +11 -0
- package/icon/components/search.js +2 -0
- package/icon/components/tick.js +2 -0
- package/icon/components/tickCircle-solid.js +2 -0
- package/icon/components/user.js +2 -0
- package/icon/components/video-non-playable.js +2 -0
- package/index.d.ts +2 -0
- package/index.js +3 -0
- package/input/basewebAdapters.js +18 -3
- package/input/styled-components.js +7 -5
- package/input/types.d.ts +4 -1
- package/layer/useLayersContextValue.js +2 -1
- package/list/avatar-list-item.d.ts +12 -22
- package/list/avatar-list-item.js +5 -3
- package/list/index.d.ts +1 -1
- package/list/index.js +2 -1
- package/list/list-item.d.ts +3 -1
- package/list/list-item.js +9 -6
- package/list/styled-component.d.ts +1 -0
- package/list/styled-component.js +24 -16
- package/list/types.d.ts +3 -0
- package/locale/en_US.js +26 -0
- package/locale/types.d.ts +19 -0
- package/menu/MenuContext.d.ts +2 -1
- package/menu/MenuContext.js +1 -0
- package/menu/menu-item.d.ts +4 -1
- package/menu/menu-item.js +11 -11
- package/menu/menu.d.ts +1 -0
- package/menu/menu.js +11 -11
- package/menu/types.d.ts +1 -0
- package/menu/useKeyboardNavigation.d.ts +6 -3
- package/menu/useKeyboardNavigation.js +21 -14
- package/menu/useStatefulMenu.d.ts +5 -2
- package/menu/useStatefulMenu.js +14 -8
- package/modal/modal.js +3 -1
- package/modal/overrides.d.ts +2 -2
- package/modal/overrides.js +6 -7
- package/modal/styled-components.js +7 -7
- package/number/Number.d.ts +3 -0
- package/number/Number.js +14 -0
- package/number/constants.d.ts +2 -0
- package/number/constants.js +7 -0
- package/number/index.d.ts +5 -0
- package/number/index.js +12 -0
- package/number/package.json +4 -0
- package/number/types.d.ts +6 -0
- package/number/types.js +2 -0
- package/number/useNumber.d.ts +2 -0
- package/number/useNumber.js +12 -0
- package/overrides/index.d.ts +1 -1
- package/overrides/index.js +2 -1
- package/overrides/mergeOverrides.d.ts +3 -2
- package/overrides/mergeOverrides.js +2 -1
- package/package.json +8 -5
- package/payment-card/basewebAdapters.d.ts +2 -0
- package/payment-card/basewebAdapters.js +23 -1
- package/payment-card/styled-components.js +24 -5
- package/phone-input/country-select-container.js +1 -1
- package/phone-input/country-select.js +3 -3
- package/phone-input/default-props.d.ts +5 -5
- package/phone-input/default-props.js +8 -7
- package/phone-input/flag-container.js +1 -1
- package/phone-input/phone-input.d.ts +0 -4
- package/phone-input/phone-input.js +19 -11
- package/phone-input/stateful-phone-input-container.js +4 -3
- package/phone-input/stateful-phone-input.d.ts +0 -4
- package/phone-input/styled-components.d.ts +9 -1
- package/phone-input/styled-components.js +22 -7
- package/phone-input/types.d.ts +2 -1
- package/phone-input/utils.d.ts +5 -1
- package/phone-input/utils.js +7 -1
- package/popover/adapter.d.ts +1 -0
- package/popover/adapter.js +16 -1
- package/popover/overrides.js +8 -19
- package/popover/popover.d.ts +1 -0
- package/popover/popover.js +8 -3
- package/popover/stateful-popover.js +2 -2
- package/popover/types.d.ts +3 -0
- package/popover/utils.d.ts +12 -0
- package/popover/utils.js +11 -1
- package/progress/linear/styled-component.d.ts +1 -1
- package/progress/linear/styled-component.js +5 -5
- package/radio/styled-components.js +5 -5
- package/search/index.d.ts +1 -0
- package/search/index.js +3 -1
- package/search/search.d.ts +1 -1
- package/search/search.js +14 -5
- package/search/stateful-search.d.ts +3 -0
- package/search/stateful-search.js +19 -0
- package/search/styled-components.d.ts +1 -10
- package/search/styled-components.js +56 -25
- package/search/types.d.ts +8 -2
- package/select/base-select.d.ts +22 -5
- package/select/base-select.js +172 -80
- package/select/constants.d.ts +3 -0
- package/select/constants.js +4 -2
- package/select/default-props.d.ts +1 -0
- package/select/default-props.js +3 -0
- package/select/index.d.ts +2 -2
- package/select/index.js +4 -1
- package/select/locale.d.ts +4 -0
- package/select/mobileSelect/MobileSheet.js +3 -1
- package/select/multi-value.js +21 -11
- package/select/overlaySelect/OverlaySelect.js +1 -0
- package/select/overlaySelect/hooks/useOverlaySelectOverrides.d.ts +2 -1
- package/select/overlaySelect/hooks/useOverlaySelectOverrides.js +13 -16
- package/select/overrides.d.ts +3 -0
- package/select/overrides.js +20 -6
- package/select/select.d.ts +1 -0
- package/select/select.js +9 -3
- package/select/selectMenuAdapter/CollapsibleSelectMenu.d.ts +118 -0
- package/select/selectMenuAdapter/CollapsibleSelectMenu.js +74 -0
- package/select/selectMenuAdapter/SelectMenuAdapter.d.ts +2 -34
- package/select/selectMenuAdapter/SelectMenuAdapter.js +3 -3
- package/select/selectMenuAdapter/SelectMenuItem.d.ts +4 -1
- package/select/selectMenuAdapter/hooks/useGetExpandedGroup.d.ts +6 -0
- package/select/selectMenuAdapter/hooks/useGetExpandedGroup.js +20 -0
- package/select/selectMenuAdapter/types.d.ts +42 -0
- package/select/selectMenuAdapter/types.js +2 -0
- package/select/stateful-select.d.ts +1 -0
- package/select/styled-component.d.ts +10 -1
- package/select/styled-component.js +38 -14
- package/select/types.d.ts +23 -1
- package/select/types.js +2 -1
- package/select/utils/default-filter-options.d.ts +2 -1
- package/select/utils/default-filter-options.js +6 -5
- package/select/utils/hidden-element.d.ts +6 -0
- package/select/utils/hidden-element.js +19 -0
- package/select/utils/merge-options.d.ts +2 -0
- package/select/utils/merge-options.js +22 -0
- package/select/utils/test-utils.d.ts +1 -0
- package/select/utils/test-utils.js +11 -0
- package/slider/styled-components.js +4 -4
- package/snackbar/Snackbar.js +12 -12
- package/snackbar/styled-component.js +9 -6
- package/spacewebProvider/SpacewebProvider.d.ts +2 -0
- package/spacewebProvider/SpacewebProvider.js +8 -8
- package/stack/stack.js +6 -13
- package/style/_buildUtils.d.ts +1 -1
- package/style/_buildUtils.js +3 -1
- package/style/_parseStyle.js +7 -2
- package/style/useMemoizedStyletron.js +6 -1
- package/switch/styled-components.js +3 -3
- package/tag/avatar-tag.js +23 -16
- package/tag/styled-components.js +32 -27
- package/tag/tag.js +19 -11
- package/tag/types.d.ts +2 -2
- package/tag/utils.d.ts +50 -0
- package/tag/utils.js +67 -1
- package/textarea/basewebAdapters.js +2 -2
- package/textarea/textarea.js +2 -2
- package/textarea/types.d.ts +2 -2
- package/theme/Provider.d.ts +10 -0
- package/theme/Provider.js +65 -0
- package/theme/context.d.ts +1 -10
- package/theme/context.js +1 -61
- package/theme/index.d.ts +1 -0
- package/theme/index.js +1 -0
- package/time-picker/TimePicker.js +4 -1
- package/time-range-picker/RangeSelectorContainer.js +1 -1
- package/time-range-picker/TimeRangePicker.js +19 -11
- package/time-range-picker/index.d.ts +1 -1
- package/time-range-picker/index.js +4 -1
- package/time-range-picker/types.d.ts +1 -2
- package/time-range-picker/utils.d.ts +33 -4
- package/time-range-picker/utils.js +53 -17
- package/time-zone-picker/types.d.ts +2 -0
- package/tooltip/overrides.js +0 -1
- package/tooltip/stateful-tooltip.js +2 -2
- package/tooltip/tooltip.d.ts +1 -1
- package/tooltip/tooltip.js +5 -2
- package/tooltip/types.d.ts +2 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/types.d.ts +2 -1
- package/typography/Typography.js +14 -1
- package/typography/constants.d.ts +56 -0
- package/typography/constants.js +57 -1
- package/typography/index.d.ts +1 -0
- package/typography/index.js +3 -1
- package/typography/styled-components.js +11 -3
- package/typography/types.d.ts +1 -1
- package/utils/intlNumberFormatUtils/index.d.ts +7 -0
- package/utils/intlNumberFormatUtils/index.js +40 -0
- package/utils/intlNumberFormatUtils/types.d.ts +21 -0
- package/utils/intlNumberFormatUtils/types.js +9 -0
- package/utils/package.json +4 -0
- package/esm/icon/components/chevron-right-solid.d.ts +0 -3
- package/esm/icon/components/chevron-right-solid.js +0 -6
- package/icon/components/chevron-right-solid.d.ts +0 -3
- package/icon/components/chevron-right-solid.js +0 -9
|
@@ -11,6 +11,10 @@ var locale_1 = require("../locale");
|
|
|
11
11
|
var menu_item_1 = (0, tslib_1.__importDefault)(require("../menu/menu-item"));
|
|
12
12
|
var style_1 = require("../style");
|
|
13
13
|
var themeHelpers_1 = require("../helpers/themeHelpers");
|
|
14
|
+
var omit_1 = (0, tslib_1.__importDefault)(require("lodash/omit"));
|
|
15
|
+
var react_uid_1 = require("react-uid");
|
|
16
|
+
var hidden_element_1 = require("./utils/hidden-element");
|
|
17
|
+
var i18n_interpolation_1 = (0, tslib_1.__importDefault)(require("baseui/helpers/i18n-interpolation"));
|
|
14
18
|
var StyledSelect = (0, withThemeOverride_1.default)(select_1.Select, function (theme) { return ({
|
|
15
19
|
borders: {
|
|
16
20
|
inputBorderRadius: theme.input.borderRadius,
|
|
@@ -55,16 +59,10 @@ exports.StyledInputContainer = (0, style_1.styled)('div', 'relative inline-block
|
|
|
55
59
|
};
|
|
56
60
|
});
|
|
57
61
|
exports.StyledInput = (0, style_1.styled)('input', 'bg-transparent border-none inline-block m-0 p-0 max-w-full box-content outline-none', function (_, props) {
|
|
58
|
-
var $searchable = props.$searchable, $width = props.$width;
|
|
59
|
-
return {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
fontSize: 'inherit',
|
|
63
|
-
fontWeight: 'inherit',
|
|
64
|
-
letterSpacing: 'normal',
|
|
65
|
-
width: !$searchable ? '1px' : $width || '100%',
|
|
66
|
-
boxShadow: 'none',
|
|
67
|
-
};
|
|
62
|
+
var $searchable = props.$searchable, $width = props.$width, $disabled = props.$disabled;
|
|
63
|
+
return (0, tslib_1.__assign)({ color: 'inherit', lineHeight: 'inherit', fontSize: 'inherit', fontWeight: 'inherit', letterSpacing: 'normal', width: !$searchable ? '1px' : $width || '100%', boxShadow: 'none', '::placeholder': {
|
|
64
|
+
color: 'transparent',
|
|
65
|
+
} }, ($disabled ? { '-webkit-text-fill-color': 'transparent' } : {}));
|
|
68
66
|
});
|
|
69
67
|
var DEFAULT_OVERLAY_WIDTH = '300px';
|
|
70
68
|
var StyledOverlayContentContainer = (0, style_1.styled)('div', 'overflow-auto', function (_a, _b) {
|
|
@@ -73,14 +71,40 @@ var StyledOverlayContentContainer = (0, style_1.styled)('div', 'overflow-auto',
|
|
|
73
71
|
return ((0, tslib_1.__assign)({ width: $overlayWidth || DEFAULT_OVERLAY_WIDTH }, (0, longHandHelpers_1.borderRadius)('inherit')));
|
|
74
72
|
});
|
|
75
73
|
exports.StyledOverlayContentContainer = StyledOverlayContentContainer;
|
|
74
|
+
var getCommaSeparatedValues = function (value, labelKey, locale) {
|
|
75
|
+
var commaSeparatedValues = value === null || value === void 0 ? void 0 : value.map(function (val) { return val[labelKey]; }).join(',');
|
|
76
|
+
return value && value.length > 0
|
|
77
|
+
? "".concat((0, i18n_interpolation_1.default)(locale.select.selectedValuesPrefix, { values: commaSeparatedValues }))
|
|
78
|
+
: '';
|
|
79
|
+
};
|
|
76
80
|
var InputContainer = function (_a) {
|
|
77
|
-
var
|
|
78
|
-
|
|
81
|
+
var _b;
|
|
82
|
+
var menuId = _a.menuId, size = _a.size, $value = _a.$value, $labelKey = _a.$labelKey, placeholder = _a.placeholder, props = (0, tslib_1.__rest)(_a, ["menuId", "size", "$value", "$labelKey", "placeholder"]);
|
|
83
|
+
var locale = (0, locale_1.useLocale)();
|
|
84
|
+
var commaSeparatedValues = getCommaSeparatedValues($value, $labelKey, locale);
|
|
85
|
+
var baseAriaDescribedBy = (_b = props['aria-describedby']) !== null && _b !== void 0 ? _b : '';
|
|
86
|
+
var selectedValuesId = (0, react_uid_1.useUID)();
|
|
87
|
+
var ariaDescribedBy = commaSeparatedValues ? "".concat(selectedValuesId, " ").concat(baseAriaDescribedBy) : baseAriaDescribedBy;
|
|
88
|
+
var containerRef = React.useRef(null);
|
|
89
|
+
if (!props.$searchable) {
|
|
90
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [commaSeparatedValues ? (0, jsx_runtime_1.jsx)(hidden_element_1.HiddenElement, (0, tslib_1.__assign)({ id: selectedValuesId }, { children: commaSeparatedValues }), void 0) : null, (0, jsx_runtime_1.jsx)(exports.StyledInputContainer, (0, tslib_1.__assign)({}, props, { "$selectSize": size, "aria-owns": props.$isOpen ? menuId : null, "aria-describedby": ariaDescribedBy, "aria-expanded": props.$isOpen, role: "combobox", ref: containerRef, "aria-placeholder": placeholder !== null && placeholder !== void 0 ? placeholder : locale.select.selectPlaceholder, "aria-haspopup": "listbox" }, { children: props.children
|
|
91
|
+
? React.cloneElement(React.Children.only(props.children), { onFocus: function () { var _a; return (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.focus(); } })
|
|
92
|
+
: null }), void 0)] }, void 0));
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
return (0, jsx_runtime_1.jsx)(exports.StyledInputContainer, (0, tslib_1.__assign)({}, props, { "$selectSize": size }), void 0);
|
|
96
|
+
}
|
|
79
97
|
};
|
|
80
98
|
exports.InputContainer = InputContainer;
|
|
81
99
|
var Input = React.forwardRef(function (_a, ref) {
|
|
82
|
-
var
|
|
83
|
-
|
|
100
|
+
var _b;
|
|
101
|
+
var id = _a.id, menuId = _a.menuId, placeholder = _a.placeholder, $value = _a.$value, $labelKey = _a.$labelKey, props = (0, tslib_1.__rest)(_a, ["id", "menuId", "placeholder", "$value", "$labelKey"]);
|
|
102
|
+
var locale = (0, locale_1.useLocale)();
|
|
103
|
+
var commaSeparatedValues = getCommaSeparatedValues($value, $labelKey, locale);
|
|
104
|
+
var baseAriaDescribedBy = (_b = props['aria-describedby']) !== null && _b !== void 0 ? _b : '';
|
|
105
|
+
var selectedValuesId = (0, react_uid_1.useUID)();
|
|
106
|
+
var ariaDescribedBy = commaSeparatedValues || props['aria-label'] ? "".concat(selectedValuesId, " ").concat(baseAriaDescribedBy) : baseAriaDescribedBy;
|
|
107
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [commaSeparatedValues || props['aria-label'] ? ((0, jsx_runtime_1.jsx)(hidden_element_1.HiddenElement, (0, tslib_1.__assign)({ id: selectedValuesId }, { children: "".concat(commaSeparatedValues, " ").concat(props['aria-label'] || '') }), void 0)) : null, (0, jsx_runtime_1.jsx)(exports.StyledInput, (0, tslib_1.__assign)({}, (0, omit_1.default)(props, 'aria-label'), { id: id, "aria-controls": props.$searchable && props.$isOpen ? menuId : null, ref: ref, "aria-describedby": ariaDescribedBy, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : locale.select.selectPlaceholder }), void 0)] }, void 0));
|
|
84
108
|
});
|
|
85
109
|
exports.Input = Input;
|
|
86
110
|
var select_2 = require("baseui/select");
|
package/select/types.d.ts
CHANGED
|
@@ -7,7 +7,10 @@ import { Intent, SpacewebComponentProps } from '../types';
|
|
|
7
7
|
import { PopoverProps } from '../popover/types';
|
|
8
8
|
import { ValueOf } from '../utility-types';
|
|
9
9
|
import { Value } from 'baseui/select/types';
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* lg size is deprecated. Please use md.
|
|
12
|
+
*/
|
|
13
|
+
export declare type Size = 'xxxs' | 'xs' | 'sm' | 'md' | 'lg';
|
|
11
14
|
export declare type Type = 'select' | 'search';
|
|
12
15
|
declare type OverridableComponent = keyof Omit<BaseuiSelectOverrides, 'Dropdown' | 'DropdownListItem' | 'DropdownOption'> | 'Menu' | 'MenuItem' | 'NoResults' | 'Divider' | 'ListItemText' | 'OverlayContentContainer';
|
|
13
16
|
export declare type SelectActions = {
|
|
@@ -34,12 +37,27 @@ export declare type BaseSelectProps = SpacewebComponentProps<Omit<BaseuiSelectPr
|
|
|
34
37
|
onPaste?: (event: React.ClipboardEvent) => Options | undefined;
|
|
35
38
|
virtual?: boolean;
|
|
36
39
|
ignoreBoundary?: boolean;
|
|
40
|
+
delimiter?: string;
|
|
41
|
+
clearAsOption?: boolean;
|
|
42
|
+
clearAsOptionLabel?: string;
|
|
43
|
+
selectOnTab?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* This is an internal prop being used in AsyncSelect. Not meant for consumer.
|
|
46
|
+
* If true, selectAll event won't return all options in values.
|
|
47
|
+
*/
|
|
48
|
+
__selectAllShouldReturnAllOptions?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* This is an internal prop being used in AsyncSelect.
|
|
51
|
+
* Selected state of SelectAll option will be decided based on this prop if __selectAllShouldReturnAllOptions is true.
|
|
52
|
+
*/
|
|
53
|
+
__selectAllSelected?: boolean;
|
|
37
54
|
};
|
|
38
55
|
declare type Merge<A, B> = Omit<A, keyof B> & B;
|
|
39
56
|
export declare type OverlaySelectProps = Merge<BaseSelectProps, {
|
|
40
57
|
type: 'overlay';
|
|
41
58
|
overlayWidth?: string;
|
|
42
59
|
children: PopoverProps['children'];
|
|
60
|
+
scrollContainer?: 'overlayContainer' | 'menuContainer';
|
|
43
61
|
}>;
|
|
44
62
|
export declare type MobileSelectProps = Merge<OverlaySelectProps, {
|
|
45
63
|
type: 'mobile';
|
|
@@ -79,8 +97,12 @@ export declare type DropdownProps = Omit<BaseDropdownProps, 'overrides' | 'size'
|
|
|
79
97
|
type?: Type;
|
|
80
98
|
};
|
|
81
99
|
export declare const SELECT_ALL_ID = "__selectAll";
|
|
100
|
+
export declare const CLEAR_OPTION_ID = "__clear";
|
|
82
101
|
declare type RemoveValue = () => void;
|
|
83
102
|
export declare type MultiValueProps = Omit<TagProps, 'overrides'> & SharedProps & {
|
|
103
|
+
$isContainerFocused?: boolean;
|
|
104
|
+
$valueByIdMap: Record<string, Option>;
|
|
105
|
+
$valueKey: string;
|
|
84
106
|
value: Option;
|
|
85
107
|
removeValue: RemoveValue;
|
|
86
108
|
selectSize: Size;
|
package/select/types.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import defaultFilterOptions from 'baseui/select/utils/default-filter-options';
|
|
2
|
+
export declare const filterOptions: typeof defaultFilterOptions;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.filterOptions = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
7
5
|
// todo: no deep import
|
|
8
|
-
var default_filter_options_1 = require("baseui/select/utils/default-filter-options");
|
|
9
|
-
|
|
6
|
+
var default_filter_options_1 = (0, tslib_1.__importDefault)(require("baseui/select/utils/default-filter-options"));
|
|
7
|
+
var filterOptions = function (options, filterValue, excludeOptions, newProps) {
|
|
8
|
+
return (0, default_filter_options_1.default)(options, filterValue, excludeOptions, (0, tslib_1.__assign)({ matchProp: 'label' }, newProps));
|
|
9
|
+
};
|
|
10
|
+
exports.filterOptions = filterOptions;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HiddenElement = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var HiddenElement = function (_a) {
|
|
7
|
+
var id = _a.id, children = _a.children;
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)("div", (0, tslib_1.__assign)({ id: id, style: {
|
|
9
|
+
border: 0,
|
|
10
|
+
clip: 'rect(0 0 0 0)',
|
|
11
|
+
height: '0px',
|
|
12
|
+
margin: '-1px',
|
|
13
|
+
overflow: 'hidden',
|
|
14
|
+
padding: 0,
|
|
15
|
+
position: 'absolute',
|
|
16
|
+
width: '0px',
|
|
17
|
+
} }, { children: children }), void 0));
|
|
18
|
+
};
|
|
19
|
+
exports.HiddenElement = HiddenElement;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mergeOptions = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var utils_1 = require("baseui/select/utils");
|
|
6
|
+
var constants_1 = require("../constants");
|
|
7
|
+
function removeDuplicates(valueKey, options) {
|
|
8
|
+
var keySet = new Set();
|
|
9
|
+
return options.filter(function (opt) {
|
|
10
|
+
var key = (opt.__optgroup || constants_1.UNGROUPED_ID) + opt[valueKey];
|
|
11
|
+
var shouldAdd = !keySet.has(key);
|
|
12
|
+
keySet.add(key);
|
|
13
|
+
return shouldAdd;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function mergeOptions(valueKey, options1, options2) {
|
|
17
|
+
if (options1 === void 0) { options1 = []; }
|
|
18
|
+
if (options2 === void 0) { options2 = []; }
|
|
19
|
+
var optArr1 = (0, utils_1.normalizeOptions)(options1), optArr2 = (0, utils_1.normalizeOptions)(options2);
|
|
20
|
+
return removeDuplicates(valueKey, (0, tslib_1.__spreadArray)((0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(optArr1), false), (0, tslib_1.__read)(optArr2), false));
|
|
21
|
+
}
|
|
22
|
+
exports.mergeOptions = mergeOptions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getSelectedOptions: (container?: HTMLElement | undefined) => (string | null)[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSelectedOptions = void 0;
|
|
4
|
+
var react_1 = require("@testing-library/react");
|
|
5
|
+
var getSelectedOptions = function (container) {
|
|
6
|
+
var elements = container
|
|
7
|
+
? (0, react_1.getAllByTestId)(container, 'combobox-selected-value')
|
|
8
|
+
: react_1.screen.getAllByTestId('combobox-selected-value');
|
|
9
|
+
return elements.map(function (item) { return item.textContent; });
|
|
10
|
+
};
|
|
11
|
+
exports.getSelectedOptions = getSelectedOptions;
|
|
@@ -7,7 +7,7 @@ var longHandHelpers_1 = require("../helpers/longHandHelpers");
|
|
|
7
7
|
var intentHelper_1 = require("../helpers/intentHelper");
|
|
8
8
|
var helpers_1 = require("../helpers");
|
|
9
9
|
var addOpacity = function (token, opacity) {
|
|
10
|
-
return token.includes('rgb') ? token.split(')')[0] + opacity
|
|
10
|
+
return token.includes('rgb') ? "".concat(token.split(')')[0] + opacity, ")") : (0, helpers_1.hex2rgb)(token, opacity);
|
|
11
11
|
};
|
|
12
12
|
var secondaryIntentColor = function (_a, _b) {
|
|
13
13
|
var theme = _a.theme;
|
|
@@ -26,13 +26,13 @@ var secondaryIntentColor = function (_a, _b) {
|
|
|
26
26
|
exports.getInnerTrackStyles = [
|
|
27
27
|
'w-full self-center',
|
|
28
28
|
function (_a, _b) {
|
|
29
|
-
var theme = _a.theme,
|
|
29
|
+
var theme = _a.theme, px2rem = _a.px2rem;
|
|
30
30
|
var $disabled = _b.$disabled, $value = _b.$value, $min = _b.$min, $max = _b.$max, $intent = _b.$intent;
|
|
31
31
|
var intentPrimary = (0, intentHelper_1.intentColor)({ theme: theme }, { $intent: $intent });
|
|
32
32
|
var intentSecondary = secondaryIntentColor({ theme: theme }, { $intent: $intent });
|
|
33
33
|
var scaledValue = $value.map(function (value) { return ((value - $min) / ($max - $min)) * 100; });
|
|
34
|
-
var gradientDirection =
|
|
35
|
-
return (0, tslib_1.__assign)({ background: scaledValue.length
|
|
34
|
+
var gradientDirection = 'to right';
|
|
35
|
+
return (0, tslib_1.__assign)({ background: scaledValue.length === 1
|
|
36
36
|
? "linear-gradient(".concat(gradientDirection, ", \n ").concat(intentPrimary, " ").concat(scaledValue[0], "%, \n ").concat(intentSecondary, " ").concat(scaledValue[0], "%)")
|
|
37
37
|
: "linear-gradient(".concat(gradientDirection, ", \n ").concat(intentSecondary, " ").concat(scaledValue[0], "%,\n ").concat(intentPrimary, " ").concat(scaledValue[0], "% ").concat(scaledValue[1], "%, \n ").concat(intentSecondary, " ").concat(scaledValue[1], "%)"), opacity: $disabled ? '0.6' : '1', height: px2rem('6px'), cursor: $disabled ? 'not-allowed' : 'inherit' }, (0, longHandHelpers_1.borderRadius)('6px'));
|
|
38
38
|
},
|
package/snackbar/Snackbar.js
CHANGED
|
@@ -13,6 +13,7 @@ var constants_1 = require("./constants");
|
|
|
13
13
|
var layer_2 = require("../layer");
|
|
14
14
|
var styled_component_1 = require("./styled-component");
|
|
15
15
|
var useSnackbar_1 = (0, tslib_1.__importDefault)(require("./useSnackbar"));
|
|
16
|
+
var locale_1 = require("../locale");
|
|
16
17
|
var Snackbar = function (_a) {
|
|
17
18
|
var _b = _a.intent, _intent = _b === void 0 ? 'success' : _b, _message = _a.message, _c = _a.disableManualClose, disableManualClose = _c === void 0 ? false : _c, _d = _a.placement, placement = _d === void 0 ? 'bottom' : _d, _e = _a.autoHide, autoHide = _e === void 0 ? true : _e, _f = _a.autoHideDuration, autoHideDuration = _f === void 0 ? constants_1.TYPE_TO_HIDE_DURATION[_intent] : _f, _g = _a.hideOnClickAway, hideOnClickAway = _g === void 0 ? true : _g, overrides = _a.overrides, _h = _a.onClose, onClose = _h === void 0 ? noop_1.default : _h;
|
|
18
19
|
var _j = (0, useSnackbar_1.default)({
|
|
@@ -42,18 +43,17 @@ var Snackbar = function (_a) {
|
|
|
42
43
|
var _r = (0, tslib_1.__read)((0, overrides_1.useOverrides)(overrides === null || overrides === void 0 ? void 0 : overrides.IntentIcon, IntentIconComponent), 2), IntentIcon = _r[0], intentIconProps = _r[1];
|
|
43
44
|
var _s = (0, tslib_1.__read)((0, overrides_1.useOverrides)(overrides === null || overrides === void 0 ? void 0 : overrides.CloseIcon, close_1.default), 2), Close = _s[0], closeProps = _s[1];
|
|
44
45
|
var _t = (0, tslib_1.__read)((0, overrides_1.useOverrides)(overrides === null || overrides === void 0 ? void 0 : overrides.CloseIconButton, button_1.IconButton)), CloseIconButton = _t[0], closeIconButtonProps = _t.slice(1);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
var locale = (0, locale_1.useLocale)();
|
|
47
|
+
return shouldRender ? ((0, jsx_runtime_1.jsx)(layer_2.LayersManager, (0, tslib_1.__assign)({ zIndex: layer_2.Z_INDEX.SNACKBAR }, { children: (0, jsx_runtime_1.jsx)(Layer, (0, tslib_1.__assign)({}, sharedProps, layerProps, { children: (0, jsx_runtime_1.jsx)(PlacementContainer, (0, tslib_1.__assign)({ "data-spaceweb": "snackbar", "data-testid": "snackbar" }, sharedProps, placementContainerProps, { children: (0, jsx_runtime_1.jsx)(SnackbarContainer, (0, tslib_1.__assign)({}, snackbarContainerProps, { ref: snackbarContainerRef, role: "alert" }, sharedProps, snackbarContainerOverrideProps, { children: (0, jsx_runtime_1.jsxs)(ContentContainer, (0, tslib_1.__assign)({}, sharedProps, contentContainerProps, { children: [(0, jsx_runtime_1.jsx)(IconsContainer, (0, tslib_1.__assign)({}, sharedProps, iconsContainerProps, { children: (0, jsx_runtime_1.jsx)(IntentIcon, (0, tslib_1.__assign)({ size: 14, className: styled_component_1.getIconStyles }, sharedProps, intentIconProps), void 0) }), void 0), (0, jsx_runtime_1.jsx)(Message, (0, tslib_1.__assign)({ "aria-atomic": true, "aria-live": "assertive" }, sharedProps, messageProps, { children: (0, react_1.isValidElement)(message) ? (0, react_1.cloneElement)(message) : message }), void 0), !disableManualClose && ((0, jsx_runtime_1.jsx)(CloseIconButton, (0, tslib_1.__assign)({ shape: "square", className: [
|
|
48
|
+
'cursor-pointer h-4 w-4 ml-3 rounded-2 min-w-0 border-0 flex-shrink-0',
|
|
49
|
+
{
|
|
50
|
+
':focus': {
|
|
51
|
+
backgroundColor: '#48484C',
|
|
52
|
+
},
|
|
53
|
+
':hover': {
|
|
54
|
+
backgroundColor: '#48484C',
|
|
55
|
+
},
|
|
52
56
|
},
|
|
53
|
-
|
|
54
|
-
backgroundColor: '#48484C',
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
], onClick: function () { return handleClose('manualClose'); } }, sharedProps, closeIconButtonProps, { children: (0, jsx_runtime_1.jsx)(Close, (0, tslib_1.__assign)({ "data-testid": "snackbar-close", size: 10, className: { fill: '#A0A0A8' } }, sharedProps, closeProps), void 0) }), void 0))] }), void 0) }), void 0) }), void 0) }), void 0)) : null;
|
|
57
|
+
], onClick: function () { return handleClose('manualClose'); }, "aria-label": locale.snackbar.closeAriaLabel }, sharedProps, closeIconButtonProps, { children: (0, jsx_runtime_1.jsx)(Close, (0, tslib_1.__assign)({ "data-testid": "snackbar-close", size: 10, className: { fill: '#A0A0A8' } }, sharedProps, closeProps), void 0) }), void 0))] }), void 0) }), void 0) }), void 0) }), void 0) }), void 0)) : null;
|
|
58
58
|
};
|
|
59
59
|
exports.default = Snackbar;
|
|
@@ -59,25 +59,28 @@ exports.StyledPlacementContainer = (0, style_1.styled)('div', 'flex flex-col fix
|
|
|
59
59
|
exports.StyledSnackbarContainer = (0, style_1.styled)('div', 'pointer-events-auto flex spr-shadow-01 overflow-hidden rounded-8 relative', function (_a) {
|
|
60
60
|
var px2rem = _a.px2rem;
|
|
61
61
|
return ({
|
|
62
|
-
minHeight: px2rem(
|
|
62
|
+
minHeight: px2rem(52),
|
|
63
63
|
maxWidth: px2rem(432),
|
|
64
64
|
minWidth: px2rem(250),
|
|
65
65
|
});
|
|
66
66
|
});
|
|
67
|
-
exports.StyledIconsContainer = (0, style_1.styled)('div', 'flex items-center justify-center rounded-
|
|
67
|
+
exports.StyledIconsContainer = (0, style_1.styled)('div', 'flex items-center justify-center rounded-8', function (_a) {
|
|
68
68
|
var px2rem = _a.px2rem;
|
|
69
69
|
return ({
|
|
70
|
-
width: px2rem(
|
|
71
|
-
height: px2rem(
|
|
70
|
+
width: px2rem(14),
|
|
71
|
+
height: px2rem(14),
|
|
72
72
|
});
|
|
73
73
|
});
|
|
74
|
-
exports.StyledContentContainer = (0, style_1.styled)('div', 'py-
|
|
74
|
+
exports.StyledContentContainer = (0, style_1.styled)('div', 'py-2 px-3 overflow-hidden flex items-center flex-1', function (_a) {
|
|
75
75
|
var theme = _a.theme;
|
|
76
76
|
return ({
|
|
77
77
|
backgroundColor: theme.name.includes('dark') ? theme.spr.ui05 : '#212123',
|
|
78
78
|
});
|
|
79
79
|
});
|
|
80
|
-
exports.StyledMessage = (0, style_1.styled)('div', '
|
|
80
|
+
exports.StyledMessage = (0, style_1.styled)('div', 'font-500 text-14 ml-3 flex-1 flex items-center spr-text-05', {
|
|
81
|
+
lineHeight: '18px',
|
|
82
|
+
wordBreak: 'break-word',
|
|
83
|
+
});
|
|
81
84
|
var getIconStyles = function (utils, props) { return ({
|
|
82
85
|
fill: (0, intentHelper_1.intentColor)(utils, props, utils.theme.supportSuccess),
|
|
83
86
|
}); };
|
|
@@ -8,6 +8,7 @@ export declare type Props = {
|
|
|
8
8
|
children: ReactNode;
|
|
9
9
|
debug?: boolean;
|
|
10
10
|
direction?: Direction;
|
|
11
|
+
langCode?: string;
|
|
11
12
|
styleEngine?: StandardEngine;
|
|
12
13
|
layersZIndex?: number;
|
|
13
14
|
overrides?: {
|
|
@@ -17,6 +18,7 @@ export declare type Props = {
|
|
|
17
18
|
theme: ThemeModule;
|
|
18
19
|
locale?: React.ComponentProps<typeof LocaleProvider>['locale'];
|
|
19
20
|
ownerDocument?: Document;
|
|
21
|
+
density?: 'COMPACT' | 'COMFORTABLE' | 'SPACIOUS' | 'DEFAULT' | undefined;
|
|
20
22
|
};
|
|
21
23
|
declare function SpacewebProviderWithDoc({ ownerDocument, children, ...rest }: Props): ReactElement;
|
|
22
24
|
export default SpacewebProviderWithDoc;
|
|
@@ -8,26 +8,26 @@ var focusVisible_1 = require("baseui/utils/focusVisible");
|
|
|
8
8
|
var DocumentProvider_1 = require("./DocumentProvider");
|
|
9
9
|
var styleEngine_1 = require("../styleEngine");
|
|
10
10
|
var themes_1 = (0, tslib_1.__importDefault)(require("../themes"));
|
|
11
|
-
var utils_1 = require("./utils");
|
|
12
11
|
var locale_1 = require("../locale");
|
|
13
12
|
var layer_1 = require("../layer");
|
|
14
13
|
var theme_1 = require("../theme");
|
|
15
14
|
function SpacewebProvider(props) {
|
|
16
|
-
var children = props.children, _a = props.
|
|
15
|
+
var children = props.children, _a = props.layersZIndex, layersZIndex = _a === void 0 ? layer_1.LAYERS_DEFAULT_ZINDEX : _a, overrides = props.overrides, theme = props.theme, locale = props.locale, _b = props.debug, debug = _b === void 0 ? false : _b, density = props.density, langCode = props.langCode;
|
|
17
16
|
var doc = (0, DocumentProvider_1.useDocument)();
|
|
18
17
|
var styleEngine = props.styleEngine || (0, styleEngine_1.getStyleEngine)(doc);
|
|
19
18
|
// TODO: This must be removed once baseui code exposes focusVisible from utils/index
|
|
20
19
|
// https://github.com/uber/baseweb/issues/3322
|
|
21
20
|
(0, react_1.useEffect)(function () {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
return undefined;
|
|
21
|
+
(0, focusVisible_1.initFocusVisible)({ ownerDocument: doc });
|
|
22
|
+
return function () { return (0, focusVisible_1.teardown)(doc); };
|
|
23
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
27
24
|
}, []);
|
|
25
|
+
var outerTheme = (0, theme_1.useTheme)();
|
|
26
|
+
var direction = props.direction || outerTheme.direction || 'ltr';
|
|
27
|
+
var localeValue = (0, react_1.useMemo)(function () { return ((0, tslib_1.__assign)((0, tslib_1.__assign)({}, locale), { langCode: langCode })); }, [locale, langCode]);
|
|
28
28
|
var themeValue = (0, react_1.useMemo)(function () { return ((0, tslib_1.__assign)((0, tslib_1.__assign)({}, theme), { direction: direction })); }, [theme, direction]);
|
|
29
29
|
var baseProviderTheme = (0, react_1.useMemo)(function () { return ((0, tslib_1.__assign)((0, tslib_1.__assign)({}, themes_1.default[theme.theme.name]), { direction: direction })); }, [direction, theme]);
|
|
30
|
-
return ((0, jsx_runtime_1.jsx)(styleEngine_1.StyleProvider, (0, tslib_1.__assign)({ debug: debug, styleEngine: styleEngine }, { children: (0, jsx_runtime_1.jsx)(theme_1.ThemeProvider, (0, tslib_1.__assign)({ theme: themeValue, containerElement: doc === null || doc === void 0 ? void 0 : doc.documentElement }, { children: (0, jsx_runtime_1.jsx)(locale_1.LocaleProvider, (0, tslib_1.__assign)({ locale:
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(styleEngine_1.StyleProvider, (0, tslib_1.__assign)({ debug: debug, styleEngine: styleEngine }, { children: (0, jsx_runtime_1.jsx)(theme_1.ThemeProvider, (0, tslib_1.__assign)({ theme: themeValue, containerElement: doc === null || doc === void 0 ? void 0 : doc.documentElement, density: density }, { children: (0, jsx_runtime_1.jsx)(locale_1.LocaleProvider, (0, tslib_1.__assign)({ locale: localeValue }, { children: (0, jsx_runtime_1.jsx)(CustomBaseProvider_1.default, (0, tslib_1.__assign)({ overrides: overrides, theme: baseProviderTheme }, { children: (0, jsx_runtime_1.jsx)(layer_1.LayersManager, (0, tslib_1.__assign)({ zIndex: layersZIndex, host: doc === null || doc === void 0 ? void 0 : doc.body }, { children: children }), void 0) }), void 0) }), void 0) }), void 0) }), void 0));
|
|
31
31
|
}
|
|
32
32
|
function SpacewebProviderWithDoc(_a) {
|
|
33
33
|
var ownerDocument = _a.ownerDocument, children = _a.children, rest = (0, tslib_1.__rest)(_a, ["ownerDocument", "children"]);
|
package/stack/stack.js
CHANGED
|
@@ -24,23 +24,16 @@ var getStackClassNames = function (props) {
|
|
|
24
24
|
var direction = props.direction, gap = props.gap;
|
|
25
25
|
var _a = modifyGapParam(gap), prefix = _a.prefix, gapVal = _a.gapVal;
|
|
26
26
|
var stackClassName = [direction === 'horizontal' ? 'flex flex-row' : 'flex flex-col'];
|
|
27
|
-
var stackItemClassName = [
|
|
28
|
-
function (_a) {
|
|
29
|
-
var themeDirection = _a.direction;
|
|
30
|
-
var marginDir = themeDirection === 'rtl' ? 'mr' : 'ml';
|
|
31
|
-
return direction === 'horizontal' ? "".concat(prefix).concat(marginDir, "-").concat(gapVal) : "".concat(prefix, "mt-").concat(gapVal);
|
|
32
|
-
},
|
|
33
|
-
];
|
|
27
|
+
var stackItemClassName = [direction === 'horizontal' ? "".concat(prefix, "ml-").concat(gapVal) : "".concat(prefix, "mt-").concat(gapVal)];
|
|
34
28
|
BREAKPOINTS.forEach(function (bp) {
|
|
35
29
|
if (props[bp]) {
|
|
36
30
|
stackClassName.push(props[bp].direction === 'horizontal' ? "".concat(bp, ":flex ").concat(bp, ":flex-row") : "".concat(bp, ":flex ").concat(bp, ":flex-col"));
|
|
37
|
-
var _a = modifyGapParam(props[bp].gap),
|
|
38
|
-
stackItemClassName.push(function (
|
|
39
|
-
var
|
|
40
|
-
var marginDir = themeDirection === 'rtl' ? 'mr' : 'ml';
|
|
31
|
+
var _a = modifyGapParam(props[bp].gap), prefixBp_1 = _a.prefix, gapValBp_1 = _a.gapVal;
|
|
32
|
+
stackItemClassName.push(function () {
|
|
33
|
+
var marginDir = 'ml';
|
|
41
34
|
return props[bp].direction === 'horizontal'
|
|
42
|
-
? "".concat(bp, ":").concat(
|
|
43
|
-
: "".concat(bp, ":").concat(
|
|
35
|
+
? "".concat(bp, ":").concat(prefixBp_1).concat(marginDir, "-").concat(gapValBp_1, " ").concat(bp, ":mt-0")
|
|
36
|
+
: "".concat(bp, ":").concat(prefixBp_1, "mt-").concat(gapValBp_1, " ").concat(bp, ":").concat(marginDir, "-0");
|
|
44
37
|
});
|
|
45
38
|
}
|
|
46
39
|
});
|
package/style/_buildUtils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { StyleUtils, ThemeContext, StyleObject } from '../types';
|
|
2
2
|
declare type StyletronCSS = (arg: StyleObject) => string;
|
|
3
|
-
declare const _default: (
|
|
3
|
+
declare const _default: (_ctx: ThemeContext, styletronCSS: StyletronCSS) => StyleUtils;
|
|
4
4
|
export default _default;
|
package/style/_buildUtils.js
CHANGED
|
@@ -4,7 +4,9 @@ var tslib_1 = require("tslib");
|
|
|
4
4
|
var _getStyle_1 = (0, tslib_1.__importDefault)(require("./_getStyle"));
|
|
5
5
|
var _css_1 = (0, tslib_1.__importDefault)(require("./_css"));
|
|
6
6
|
var _px2rem_1 = (0, tslib_1.__importDefault)(require("./_px2rem"));
|
|
7
|
-
exports.default = (function (
|
|
7
|
+
exports.default = (function (_ctx, styletronCSS) {
|
|
8
|
+
// console.log('theme', _ctx.theme);
|
|
9
|
+
var ctx = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, _ctx), { isRTL: _ctx.direction === 'rtl' });
|
|
8
10
|
var css = _css_1.default.bind(null, ctx, styletronCSS);
|
|
9
11
|
var getStyle = _getStyle_1.default.bind(null, ctx);
|
|
10
12
|
var px2rem = _px2rem_1.default.bind(null, ctx);
|
package/style/_parseStyle.js
CHANGED
|
@@ -28,7 +28,7 @@ var _parseStyle = function (utils, props) {
|
|
|
28
28
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
29
29
|
args[_i - 2] = arguments[_i];
|
|
30
30
|
}
|
|
31
|
-
var invalidArgs = [];
|
|
31
|
+
var invalidArgs = [], directionStyleObject;
|
|
32
32
|
if (!args.length)
|
|
33
33
|
return [{}, invalidArgs];
|
|
34
34
|
var styleObject = flattenDeep(args).reduce(function (mergedStyleObject, arg) {
|
|
@@ -66,6 +66,11 @@ var _parseStyle = function (utils, props) {
|
|
|
66
66
|
}
|
|
67
67
|
return (0, merge_1.default)(mergedStyleObject, arg);
|
|
68
68
|
}, {});
|
|
69
|
-
|
|
69
|
+
/**
|
|
70
|
+
* merging directionStyles at last to make sure priority of styles with ltr/rtl pseudo selector is more.
|
|
71
|
+
* e.g. `rtl:ml-2 ml-3` -> ml-2 should be applied when direction is rtl
|
|
72
|
+
*/
|
|
73
|
+
var styleObjectWithRtlStyles = directionStyleObject ? (0, merge_1.default)(styleObject, directionStyleObject) : styleObject;
|
|
74
|
+
return [styleObjectWithRtlStyles, invalidArgs];
|
|
70
75
|
};
|
|
71
76
|
exports.default = _parseStyle;
|
|
@@ -3,14 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
4
|
var baseui_1 = require("baseui");
|
|
5
5
|
var react_1 = require("react");
|
|
6
|
+
var rtl_css_js_1 = (0, tslib_1.__importDefault)(require("rtl-css-js"));
|
|
6
7
|
var useLatest_1 = require("../hooks/useLatest");
|
|
8
|
+
var context_1 = require("../theme/context");
|
|
9
|
+
var identity = function (x) { return x; };
|
|
7
10
|
/**
|
|
8
11
|
* styletron returns new `styletronCSS` function each time the hook is called. This hook memorizes the css function and returns same reference every time.
|
|
9
12
|
*/
|
|
10
13
|
var useMemoizedStyletron = function () {
|
|
11
14
|
var _a = (0, tslib_1.__read)((0, baseui_1.useStyletron)(), 2), styletronCSS = _a[0], theme = _a[1];
|
|
15
|
+
var ctx = (0, context_1.useTheme)();
|
|
12
16
|
var cssRef = (0, useLatest_1.useLatest)(styletronCSS);
|
|
13
|
-
var
|
|
17
|
+
var decorator = ctx.direction === 'rtl' ? rtl_css_js_1.default : identity;
|
|
18
|
+
var css = (0, react_1.useCallback)(function (arg) { return cssRef.current(decorator(arg)); }, [cssRef, decorator]);
|
|
14
19
|
return [css, theme];
|
|
15
20
|
};
|
|
16
21
|
exports.default = useMemoizedStyletron;
|
|
@@ -36,7 +36,7 @@ var getToggleTrackOverrides = function (utils, props) {
|
|
|
36
36
|
break;
|
|
37
37
|
}
|
|
38
38
|
return getStyle([
|
|
39
|
-
'box-border border-1 m-0 border-transparent border-solid',
|
|
39
|
+
'box-border border-1 m-0 border-transparent border-solid flex-none',
|
|
40
40
|
($isHovered || $isFocusVisible) && !$checked && !$disabled ? 'spr-border-06' : '',
|
|
41
41
|
$isFocusVisible ? 'outline-01' : '',
|
|
42
42
|
styles,
|
|
@@ -44,9 +44,9 @@ var getToggleTrackOverrides = function (utils, props) {
|
|
|
44
44
|
};
|
|
45
45
|
exports.getToggleTrackOverrides = getToggleTrackOverrides;
|
|
46
46
|
var getToggleOverrides = function (utils, props) {
|
|
47
|
-
var px2rem = utils.px2rem,
|
|
47
|
+
var px2rem = utils.px2rem, theme = utils.theme, getStyle = utils.getStyle;
|
|
48
48
|
var $size = props.$size, $checked = props.$checked, $disabled = props.$disabled, $isFocusVisible = props.$isFocusVisible;
|
|
49
|
-
var styles = (0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)({ backgroundColor: $disabled ? theme.spr.ui03 : theme.spr.ui01, height: px2rem(12), width: px2rem(12) }, (0, longHandHelpers_1.margin)(px2rem(1))), (0, longHandHelpers_1.borderRadius)('50%')), { transform: $checked ?
|
|
49
|
+
var styles = (0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)({ backgroundColor: $disabled ? theme.spr.ui03 : theme.spr.ui01, height: px2rem(12), width: px2rem(12) }, (0, longHandHelpers_1.margin)(px2rem(1))), (0, longHandHelpers_1.borderRadius)('50%')), { transform: $checked ? 'translateX(100%)' : '', transition: 'transform 200ms', boxShadow: 'none' });
|
|
50
50
|
switch ($size) {
|
|
51
51
|
case 'lg':
|
|
52
52
|
styles.height = styles.width = px2rem(16);
|
package/tag/avatar-tag.js
CHANGED
|
@@ -4,23 +4,30 @@ var tslib_1 = require("tslib");
|
|
|
4
4
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
var react_1 = require("react");
|
|
6
6
|
var avatar_1 = require("../avatar");
|
|
7
|
-
var longHandHelpers_1 = require("../helpers/longHandHelpers");
|
|
8
|
-
var themeHelpers_1 = require("../helpers/themeHelpers");
|
|
9
7
|
var tag_1 = (0, tslib_1.__importDefault)(require("./tag"));
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
var tagBorderRadius = (0, themeHelpers_1.getComponentTheme)(theme, 'multiSelect').tagBorderRadius;
|
|
13
|
-
return (0, tslib_1.__assign)((0, tslib_1.__assign)({}, (tagBorderRadius && (0, longHandHelpers_1.borderRadius)(tagBorderRadius))), { marginLeft: px2rem(4) });
|
|
14
|
-
};
|
|
15
|
-
var avatarRootStyles = function (_a) {
|
|
16
|
-
var theme = _a.theme;
|
|
17
|
-
var avatarMarginLeft = (0, themeHelpers_1.getComponentTheme)(theme, 'tag').avatarMarginLeft;
|
|
18
|
-
return { marginLeft: avatarMarginLeft };
|
|
19
|
-
};
|
|
8
|
+
var style_1 = require("../style");
|
|
9
|
+
var utils_1 = require("./utils");
|
|
20
10
|
var AvatarTag = function (props) {
|
|
21
|
-
var avatarProps = props.avatarProps, startEnhancer = props.startEnhancer, className = props.className, tagProps = (0, tslib_1.__rest)(props, ["avatarProps", "startEnhancer", "className"]);
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
|
|
11
|
+
var avatarProps = props.avatarProps, startEnhancer = props.startEnhancer, className = props.className, _size = props.size, tagProps = (0, tslib_1.__rest)(props, ["avatarProps", "startEnhancer", "className", "size"]);
|
|
12
|
+
var theme = (0, style_1.useStyle)().theme;
|
|
13
|
+
var size = _size !== null && _size !== void 0 ? _size : (0, utils_1.getDefaultTagSize)(theme);
|
|
14
|
+
var avatarIconSize = (0, utils_1.getTagSizeTheme)(theme, size).avatarIconSize;
|
|
15
|
+
var customTagOverrides = {
|
|
16
|
+
StartEnhancer: {
|
|
17
|
+
style: function (_a, _b) {
|
|
18
|
+
var $size = _b.$size;
|
|
19
|
+
return ($size === 'lg' ? { marginLeft: '8px' } : {});
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
Action: {
|
|
23
|
+
style: function (_a, _b) {
|
|
24
|
+
var $size = _b.$size;
|
|
25
|
+
return ($size === 'lg' ? { marginRight: '4px' } : {});
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
var startEnhancerOverride = (0, react_1.useCallback)(function (sharedProps) { return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [typeof startEnhancer === 'function' ? startEnhancer(sharedProps) : startEnhancer, (0, jsx_runtime_1.jsx)(avatar_1.Avatar, (0, tslib_1.__assign)({ size: avatarIconSize }, avatarProps, { className: [avatarProps === null || avatarProps === void 0 ? void 0 : avatarProps.className] }), void 0)] }, void 0)); }, [avatarProps, startEnhancer, avatarIconSize]);
|
|
30
|
+
var mergedClassName = (0, react_1.useMemo)(function () { return [className]; }, [className]);
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(tag_1.default, (0, tslib_1.__assign)({ overrides: customTagOverrides, size: size, startEnhancer: startEnhancerOverride, className: mergedClassName }, tagProps), void 0));
|
|
25
32
|
};
|
|
26
33
|
exports.default = AvatarTag;
|