@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
package/esm/button/types.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { Override, StyleOverride } from '../overrides';
|
|
|
4
4
|
import { StatefulTooltipProps } from '../tooltip';
|
|
5
5
|
import { ClassName, Intent, Variant, SpacewebComponentProps, Size } from '../types';
|
|
6
6
|
import { ValueOf } from '../utility-types';
|
|
7
|
+
import { AriaRole } from 'react';
|
|
7
8
|
export declare type Shape = 'default' | 'round' | 'square' | 'pill';
|
|
8
9
|
export type { Size };
|
|
9
10
|
export declare type ButtonOverrides = {
|
|
@@ -35,6 +36,7 @@ export declare type ButtonProps = SpacewebComponentProps<{
|
|
|
35
36
|
disabled?: boolean;
|
|
36
37
|
fullWidth?: boolean;
|
|
37
38
|
autoFocus?: boolean;
|
|
39
|
+
role?: AriaRole | undefined;
|
|
38
40
|
href?: string;
|
|
39
41
|
target?: string;
|
|
40
42
|
rel?: string;
|
|
@@ -45,5 +47,6 @@ export declare type ButtonProps = SpacewebComponentProps<{
|
|
|
45
47
|
startEnhancer?: React.ReactNode;
|
|
46
48
|
type?: 'submit' | 'reset' | 'button';
|
|
47
49
|
tooltipContent?: StatefulTooltipProps['content'];
|
|
50
|
+
tabIndex?: number | undefined;
|
|
48
51
|
}>;
|
|
49
52
|
export declare type VariantAdapterProps = Record<Variant, ValueOf<typeof KIND>>;
|
|
@@ -14,6 +14,7 @@ declare const ButtonGroup: import("react").ForwardRefExoticComponent<Omit<{
|
|
|
14
14
|
intent?: import("..").Intent | undefined;
|
|
15
15
|
variant?: import("..").Variant | import("../button/IconTextButton").Variant | undefined;
|
|
16
16
|
activateOnFocus?: boolean | undefined;
|
|
17
|
+
role?: import("react").AriaRole | undefined;
|
|
17
18
|
}, "style" | "className"> & {
|
|
18
19
|
$as?: import("react").ElementType<any> | undefined;
|
|
19
20
|
className?: import("..").Styles;
|
|
@@ -7,14 +7,18 @@ import { useOverrides } from '../overrides';
|
|
|
7
7
|
import { StyledRoot, renderButtonGroupChild } from './styled-components';
|
|
8
8
|
import useCombinedRefs from '../hooks/useCombinedRef';
|
|
9
9
|
import { useTabsKeyboardNavigation } from '../hooks/useTabsKeyboardNavigation';
|
|
10
|
+
import { useStyle } from '../style';
|
|
11
|
+
import { getDefaultSize } from '../helpers/themeHelpers';
|
|
10
12
|
var ButtonGroup = forwardRef(function (_a, ref) {
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
+
var _b;
|
|
14
|
+
var className = _a.className, style = _a.style, activateOnFocus = _a.activateOnFocus, _c = _a.overrides, overrides = _c === void 0 ? {} : _c, role = _a.role, props = __rest(_a, ["className", "style", "activateOnFocus", "overrides", "role"]);
|
|
15
|
+
var _d = useTabsKeyboardNavigation({ activateOnFocus: activateOnFocus }), parentElementRef = _d.parentElementRef, onKeyDown = _d.onKeyDown;
|
|
13
16
|
var combinedRef = useCombinedRefs(ref, parentElementRef);
|
|
14
|
-
var
|
|
17
|
+
var theme = useStyle().theme;
|
|
18
|
+
var _e = __read(useOverrides(overrides.Root, StyledRoot), 2), Root = _e[0], rootProps = _e[1];
|
|
15
19
|
var renderChild = useMemo(function () { return renderButtonGroupChild.bind(null, __assign(__assign({}, props), { onKeyDown: onKeyDown })); }, [props, onKeyDown]);
|
|
16
|
-
var sharedProps = add$props(_pick(props, ['intent', '
|
|
17
|
-
return (_jsx(Root, __assign({ "data-spaceweb": "button-group", "aria-multiselectable": props.mode === 'checkbox', className: className, style: style, ref: combinedRef }, sharedProps, rootProps, { children: Children.map(props.children, renderChild) }), void 0));
|
|
20
|
+
var sharedProps = add$props(__assign(__assign({}, _pick(props, ['intent', 'variant', 'shape', 'mode'])), { size: (_b = props.size) !== null && _b !== void 0 ? _b : getDefaultSize(theme) }));
|
|
21
|
+
return (_jsx(Root, __assign({ "data-spaceweb": "button-group", "aria-multiselectable": props.mode === 'checkbox', className: className, style: style, ref: combinedRef, role: role }, sharedProps, rootProps, { children: Children.map(props.children, renderChild) }), void 0));
|
|
18
22
|
});
|
|
19
23
|
ButtonGroup.defaultProps = {
|
|
20
24
|
mode: 'radio',
|
|
@@ -14,6 +14,7 @@ declare const StatefulButtonGroup: import("react").ForwardRefExoticComponent<Omi
|
|
|
14
14
|
intent?: import("..").Intent | undefined;
|
|
15
15
|
variant?: import("..").Variant | import("../button/IconTextButton").Variant | undefined;
|
|
16
16
|
activateOnFocus?: boolean | undefined;
|
|
17
|
+
role?: import("react").AriaRole | undefined;
|
|
17
18
|
}, "style" | "className"> & {
|
|
18
19
|
$as?: import("react").ElementType<any> | undefined;
|
|
19
20
|
className?: import("..").Styles;
|
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { StyleObject, StyleUtils } from '../types';
|
|
3
3
|
import { ButtonGroupChildProps, ButtonGroupProps } from './types';
|
|
4
|
+
export declare const buttonGroupButtonSizeMap: {
|
|
5
|
+
xxxs: {
|
|
6
|
+
height: string;
|
|
7
|
+
marginTop: string;
|
|
8
|
+
marginBottom: string;
|
|
9
|
+
containerBorderRadius: string;
|
|
10
|
+
};
|
|
11
|
+
xs: {
|
|
12
|
+
height: string;
|
|
13
|
+
marginTop: string;
|
|
14
|
+
marginBottom: string;
|
|
15
|
+
containerBorderRadius: string;
|
|
16
|
+
};
|
|
17
|
+
sm: {
|
|
18
|
+
height: string;
|
|
19
|
+
marginTop: string;
|
|
20
|
+
marginBottom: string;
|
|
21
|
+
containerBorderRadius: string;
|
|
22
|
+
};
|
|
23
|
+
md: {
|
|
24
|
+
height: string;
|
|
25
|
+
marginTop: string;
|
|
26
|
+
marginBottom: string;
|
|
27
|
+
containerBorderRadius: string;
|
|
28
|
+
};
|
|
29
|
+
lg: {
|
|
30
|
+
height: string;
|
|
31
|
+
marginTop: string;
|
|
32
|
+
marginBottom: string;
|
|
33
|
+
containerBorderRadius: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export declare const getButtonGroupSizeTheme: (theme: any, size: any, prop: any) => any;
|
|
4
37
|
export declare const StyledRoot: import("../style/styled").StyledComponent;
|
|
5
38
|
export declare const hyperspaceButtonOverrides: (utils: StyleUtils, props: any) => StyleObject;
|
|
6
39
|
export declare const renderButtonGroupChild: (props: Omit<{
|
|
@@ -18,6 +51,7 @@ export declare const renderButtonGroupChild: (props: Omit<{
|
|
|
18
51
|
intent?: import("../types").Intent | undefined;
|
|
19
52
|
variant?: import("../types").Variant | import("../button/IconTextButton").Variant | undefined;
|
|
20
53
|
activateOnFocus?: boolean | undefined;
|
|
54
|
+
role?: React.AriaRole | undefined;
|
|
21
55
|
}, "style" | "className"> & {
|
|
22
56
|
$as?: React.ElementType<any> | undefined;
|
|
23
57
|
className?: import("../types").Styles;
|
|
@@ -6,29 +6,73 @@ import { createButtonStyles } from '../button/styled-components';
|
|
|
6
6
|
import { borderColor, borderRadius, borderStyle, borderWidth } from '../helpers/longHandHelpers';
|
|
7
7
|
import { getFocusVisibleStyles } from '../helpers/commonStyles';
|
|
8
8
|
import styled from '../style/styled';
|
|
9
|
+
import { getComponentSizeTheme, getDefaultSize } from '../helpers/themeHelpers';
|
|
9
10
|
// NOTE - This method is meant to be used by ButtonGroup only and not a generic one. This shouldn't be used to take style specific decisions.
|
|
10
11
|
var isHyperSpaceUI = function (theme) { return theme.name.includes('hyperspace'); };
|
|
11
|
-
export var
|
|
12
|
+
export var buttonGroupButtonSizeMap = {
|
|
13
|
+
xxxs: {
|
|
14
|
+
height: '20px',
|
|
15
|
+
marginTop: '1px',
|
|
16
|
+
marginBottom: '1px',
|
|
17
|
+
containerBorderRadius: '5px',
|
|
18
|
+
},
|
|
19
|
+
xs: {
|
|
20
|
+
height: '26px',
|
|
21
|
+
marginTop: '2px',
|
|
22
|
+
marginBottom: '2px',
|
|
23
|
+
containerBorderRadius: '7px',
|
|
24
|
+
},
|
|
25
|
+
sm: {
|
|
26
|
+
height: '26px',
|
|
27
|
+
marginTop: '2px',
|
|
28
|
+
marginBottom: '2px',
|
|
29
|
+
containerBorderRadius: '7px',
|
|
30
|
+
},
|
|
31
|
+
md: {
|
|
32
|
+
height: '32px',
|
|
33
|
+
marginTop: '3px',
|
|
34
|
+
marginBottom: '3px',
|
|
35
|
+
containerBorderRadius: '8px',
|
|
36
|
+
},
|
|
37
|
+
lg: {
|
|
38
|
+
height: '32px',
|
|
39
|
+
marginTop: '3px',
|
|
40
|
+
marginBottom: '3px',
|
|
41
|
+
containerBorderRadius: '8px',
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
export var getButtonGroupSizeTheme = function (theme, size, prop) {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
return ((_a = getComponentSizeTheme(theme, 'buttonGroup', size, getDefaultSize(theme))) === null || _a === void 0 ? void 0 : _a[prop]) ||
|
|
47
|
+
((_b = buttonGroupButtonSizeMap[size || getDefaultSize(theme)]) === null || _b === void 0 ? void 0 : _b[prop]) ||
|
|
48
|
+
buttonGroupButtonSizeMap[getDefaultSize(theme)][prop];
|
|
49
|
+
};
|
|
50
|
+
export var StyledRoot = styled('div', 'inline-flex items-center', function (_a, _b) {
|
|
12
51
|
var theme = _a.theme, px2rem = _a.px2rem;
|
|
52
|
+
var $size = _b.$size;
|
|
13
53
|
if (!isHyperSpaceUI(theme))
|
|
14
54
|
return {};
|
|
15
|
-
|
|
55
|
+
var containerBorderRadius = getButtonGroupSizeTheme(theme, $size, 'containerBorderRadius');
|
|
56
|
+
return __assign(__assign(__assign(__assign({ backgroundColor: theme.spr.ui01 }, borderStyle('solid')), borderColor(theme.spr.ui03)), borderWidth('1px')), borderRadius(containerBorderRadius));
|
|
16
57
|
});
|
|
17
58
|
var isSelected = function (selected, index) { return (_isArray(selected) ? selected.includes(index) : selected === index); };
|
|
18
59
|
var isAnyButtonSelected = function (selected) { return (typeof selected === 'number' && selected >= 0) || Boolean(selected === null || selected === void 0 ? void 0 : selected.length); };
|
|
19
60
|
export var hyperspaceButtonOverrides = function (utils, props) {
|
|
20
61
|
var theme = utils.theme, px2rem = utils.px2rem;
|
|
21
|
-
var $isIconButton = props.$isIconButton, $index = props.$index, $childrenCount = props.$childrenCount, $isSelected = props.$isSelected;
|
|
22
|
-
|
|
62
|
+
var $isIconButton = props.$isIconButton, $index = props.$index, $childrenCount = props.$childrenCount, $isSelected = props.$isSelected, $size = props.$size;
|
|
63
|
+
var height = getButtonGroupSizeTheme(theme, $size, 'height');
|
|
64
|
+
var marginTop = getButtonGroupSizeTheme(theme, $size, 'marginTop');
|
|
65
|
+
var marginBottom = getButtonGroupSizeTheme(theme, $size, 'marginBottom');
|
|
66
|
+
return _merge(__assign(__assign(__assign(__assign(__assign(__assign({
|
|
23
67
|
// To keep all the buttons equidistant remove marginLeft from all buttons except the first one
|
|
24
|
-
marginLeft: $index === 0 ? px2rem(
|
|
68
|
+
marginLeft: $index === 0 ? px2rem(2) : '0px', marginRight: $index === $childrenCount - 1 ? px2rem(2) : px2rem(3), fontSize: px2rem(12), lineHeight: px2rem(16) }, borderRadius(px2rem(4))), (!$isIconButton
|
|
25
69
|
? {
|
|
26
70
|
paddingTop: px2rem(8),
|
|
27
71
|
paddingBottom: px2rem(8),
|
|
28
72
|
paddingLeft: px2rem(12),
|
|
29
73
|
paddingRight: px2rem(12),
|
|
30
74
|
}
|
|
31
|
-
: { height:
|
|
75
|
+
: { height: height, width: height, marginTop: marginTop, marginBottom: marginBottom })), createButtonStyles({
|
|
32
76
|
color: theme.spr.text01,
|
|
33
77
|
hoverColor: theme.spr.text01,
|
|
34
78
|
activeColor: theme.spr.text04,
|
|
@@ -41,8 +85,11 @@ export var hyperspaceButtonOverrides = function (utils, props) {
|
|
|
41
85
|
};
|
|
42
86
|
var baseButtonStyle = function (childrenCount, index, utils, props) {
|
|
43
87
|
var theme = utils.theme;
|
|
44
|
-
var $variant = props.$variant;
|
|
45
|
-
var
|
|
88
|
+
var $variant = props.$variant, $size = props.$size;
|
|
89
|
+
var height = getButtonGroupSizeTheme(theme, $size, 'height');
|
|
90
|
+
var marginTop = getButtonGroupSizeTheme(theme, $size, 'marginTop');
|
|
91
|
+
var marginBottom = getButtonGroupSizeTheme(theme, $size, 'marginBottom');
|
|
92
|
+
var baseStyles = { fontWeight: theme.fontWeight.normal, height: height, marginTop: marginTop, marginBottom: marginBottom };
|
|
46
93
|
if (isHyperSpaceUI(theme)) {
|
|
47
94
|
return __assign(__assign({}, baseStyles), hyperspaceButtonOverrides(utils, __assign(__assign({}, props), { $index: index, $childrenCount: childrenCount })));
|
|
48
95
|
}
|
|
@@ -3,6 +3,7 @@ import { Overrides, Override } from '../overrides';
|
|
|
3
3
|
import { Variant, Size, ClassName, SpacewebComponentProps, Intent } from '../types';
|
|
4
4
|
import { Variant as IconTextButtonVariant } from '../button/IconTextButton';
|
|
5
5
|
import { Shape, ButtonSharedProps } from '../button';
|
|
6
|
+
import { AriaRole } from 'react';
|
|
6
7
|
declare type ButtonGroupOverrides = {
|
|
7
8
|
Root?: Override<any>;
|
|
8
9
|
};
|
|
@@ -20,6 +21,7 @@ export declare type ButtonGroupProps = SpacewebComponentProps<{
|
|
|
20
21
|
intent?: Intent;
|
|
21
22
|
variant?: Variant | IconTextButtonVariant;
|
|
22
23
|
activateOnFocus?: boolean;
|
|
24
|
+
role?: AriaRole | undefined;
|
|
23
25
|
}>;
|
|
24
26
|
export declare type ButtonGroupChildProps = {
|
|
25
27
|
className?: ClassName;
|
|
@@ -26,7 +26,12 @@ export default function useCheckboxAdapter(props) {
|
|
|
26
26
|
props: add$props({ size: size, intent: intent }),
|
|
27
27
|
},
|
|
28
28
|
// https://prod-gitlab.sprinklr.com/sprinklr/frontend/spaceweb/-/issues/406 - baseui adds position absolute
|
|
29
|
-
Input: {
|
|
29
|
+
Input: {
|
|
30
|
+
style: { position: 'static' },
|
|
31
|
+
props: {
|
|
32
|
+
'aria-required': restProps['aria-required'],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
30
35
|
}, overrides);
|
|
31
36
|
var inputRefObj = useCombineRefObjects(props.inputRef);
|
|
32
37
|
return __assign(__assign({}, restProps), { overrides: convertedOverrides, inputRef: inputRefObj, onMouseEnter: props.onMouseEnter, onMouseLeave: props.onMouseLeave, onFocus: props.onFocus, onBlur: props.onBlur });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { ColorPickerOverrides } from './types';
|
|
3
|
+
declare type ContentProps = {
|
|
4
|
+
color?: string;
|
|
5
|
+
overrides?: ColorPickerOverrides;
|
|
6
|
+
onChange: (color?: string) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const ColorPalette: ({ color: selectedColor, overrides, onChange }: ContentProps) => ReactElement;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { __assign, __read } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
// import { Typography } from '../typography';
|
|
4
|
+
import { Box } from '../box';
|
|
5
|
+
import { Grid } from '../grid';
|
|
6
|
+
import { Swatch as DefaultSwatch } from './Swatch';
|
|
7
|
+
// import { useTheme } from '../theme';
|
|
8
|
+
import { useOverrides } from '../overrides';
|
|
9
|
+
import { COLOR_PALETTE } from './colors';
|
|
10
|
+
export var ColorPalette = function (_a) {
|
|
11
|
+
// const { theme } = useTheme();
|
|
12
|
+
var selectedColor = _a.color, overrides = _a.overrides, onChange = _a.onChange;
|
|
13
|
+
var _b = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.Swatches, Grid), 2), Swatches = _b[0], swatchesProps = _b[1];
|
|
14
|
+
var _c = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.Swatch, DefaultSwatch), 2), Swatch = _c[0], swatchProps = _c[1];
|
|
15
|
+
// const sprinklrClrTokens = useMemo(
|
|
16
|
+
// () => Object.keys(theme.spr).filter((token: string): boolean => token.startsWith('clr')),
|
|
17
|
+
// [theme]
|
|
18
|
+
// );
|
|
19
|
+
return (_jsx(Box, { children: _jsx(Swatches, __assign({ cols: 10, colGap: 1, rowGap: 1 }, swatchesProps, { children: COLOR_PALETTE.map(function (row) {
|
|
20
|
+
return row.map(function (color) { return (_jsx(Swatch, __assign({ color: color, overrides: overrides, onChange: onChange, isSelected: selectedColor === color }, swatchProps), color)); });
|
|
21
|
+
}) }), void 0) }, void 0));
|
|
22
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { __assign, __read } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Typography } from '../typography';
|
|
4
|
+
import { Box } from '../box';
|
|
5
|
+
import { ColorPalette } from './ColorPalette';
|
|
6
|
+
import ResetColorIcon from '../icon/components/reset-color';
|
|
7
|
+
import { Button } from '../button';
|
|
8
|
+
import { useOverrides } from '../overrides';
|
|
9
|
+
import { useLocale } from '../locale';
|
|
10
|
+
import { StyledRoot } from './styled-component';
|
|
11
|
+
var RESET_CLASSNAME = [
|
|
12
|
+
'spr-text-01 hover:spr-text-04',
|
|
13
|
+
function (_a) {
|
|
14
|
+
var theme = _a.theme;
|
|
15
|
+
return ({
|
|
16
|
+
':disabled': {
|
|
17
|
+
color: theme.spr.text01,
|
|
18
|
+
':hover': {
|
|
19
|
+
color: theme.spr.text01,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
export var ColorPicker = function (_a) {
|
|
26
|
+
var value = _a.value, overrides = _a.overrides, heading = _a.heading, onChange = _a.onChange, resetButtonLabel = _a.resetButtonLabel;
|
|
27
|
+
var locale = useLocale();
|
|
28
|
+
var _b = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.Heading, Typography), 2), Heading = _b[0], headingProps = _b[1];
|
|
29
|
+
var _c = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.Root, StyledRoot), 2), Root = _c[0], rootProps = _c[1];
|
|
30
|
+
return (_jsxs(Root, __assign({}, rootProps, { children: [heading ? (_jsx(Heading, __assign({ "$as": "div", className: "spr-text-03", weight: "bold", variant: "bs3" }, headingProps, { children: heading }), void 0)) : null, _jsx(ColorPalette, { color: value, onChange: onChange, overrides: overrides }, void 0), _jsx(Box, __assign({ className: "flex justify-start -ml-1.5" }, { children: _jsx(Button, __assign({ startEnhancer: _jsx(ResetColorIcon, { size: 12 }, void 0), variant: "minimal", size: "xxxs", className: RESET_CLASSNAME, disabled: !value, onClick: function () { return onChange(undefined); } }, { children: resetButtonLabel !== null && resetButtonLabel !== void 0 ? resetButtonLabel : locale.colorPicker.resetButtonLabel }), void 0) }), void 0)] }), void 0));
|
|
31
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { ClassName } from '../types';
|
|
3
|
+
import { ColorPickerOverrides } from './types';
|
|
4
|
+
declare type SwatchProps = {
|
|
5
|
+
color: string;
|
|
6
|
+
isSelected: boolean;
|
|
7
|
+
onChange: (color?: string) => void;
|
|
8
|
+
className?: ClassName;
|
|
9
|
+
overrides?: ColorPickerOverrides;
|
|
10
|
+
};
|
|
11
|
+
export declare const Swatch: import("react").MemoExoticComponent<({ color, isSelected, onChange, className, overrides, ...props }: SwatchProps) => ReactElement>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { __assign, __read, __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { themeTokenToHex } from '../helpers';
|
|
4
|
+
import { BaseButton } from '../base-button';
|
|
5
|
+
import DefaultTickIcon from '../icon/components/tick';
|
|
6
|
+
import { getContrastRatio } from './getContrastRatio';
|
|
7
|
+
import { useTheme } from '../theme';
|
|
8
|
+
import { memo, useCallback, useMemo } from 'react';
|
|
9
|
+
import { useOverrides } from '../overrides';
|
|
10
|
+
export var Swatch = memo(function (_a) {
|
|
11
|
+
var color = _a.color, isSelected = _a.isSelected, onChange = _a.onChange, className = _a.className, overrides = _a.overrides, props = __rest(_a, ["color", "isSelected", "onChange", "className", "overrides"]);
|
|
12
|
+
var theme = useTheme().theme;
|
|
13
|
+
var _b = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.TickIcon, DefaultTickIcon), 2), TickIcon = _b[0], tickIconProps = _b[1];
|
|
14
|
+
var contrastRatioWithTickIcon = useMemo(function () { return (isSelected ? getContrastRatio(color, themeTokenToHex(theme.spr.icon05)) : 0); }, [theme, isSelected, color]);
|
|
15
|
+
var contrastRatioWithBgColor = useMemo(function () { return getContrastRatio(color, themeTokenToHex(theme.spr.popup)); }, [theme, color]);
|
|
16
|
+
var handleChange = useCallback(function () { return onChange(color); }, [color, onChange]);
|
|
17
|
+
return (_jsx(BaseButton, __assign({ onClick: handleChange, className: [
|
|
18
|
+
'cursor-pointer h-5 w-5 rounded-full flex justify-center items-center',
|
|
19
|
+
contrastRatioWithBgColor < 1.1 ? 'border-1 border-solid spr-border-03' : '',
|
|
20
|
+
{
|
|
21
|
+
backgroundColor: color,
|
|
22
|
+
transition: '0.15s ease-in-out',
|
|
23
|
+
':hover': {
|
|
24
|
+
transform: 'scale(1.2)',
|
|
25
|
+
},
|
|
26
|
+
':focus': {
|
|
27
|
+
transform: 'scale(1.2)',
|
|
28
|
+
},
|
|
29
|
+
':focus-visible': {
|
|
30
|
+
transform: 'scale(1.2)',
|
|
31
|
+
outlineWidth: '1px',
|
|
32
|
+
outlineOffset: '1px',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
className,
|
|
36
|
+
], tabIndex: 0 }, props, { children: isSelected ? (_jsx(TickIcon, __assign({ className: contrastRatioWithTickIcon < 4.5 ? 'spr-icon-01' : 'spr-icon-05', size: 10 }, tickIconProps), void 0)) : null }), void 0));
|
|
37
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const COLOR_PALETTE: string[][];
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
var SLATE_COLORS = [
|
|
2
|
+
'#FFFFFE',
|
|
3
|
+
'#F3F3F3',
|
|
4
|
+
'#EFEFEF',
|
|
5
|
+
'#DADAD9',
|
|
6
|
+
'#CCCCCC',
|
|
7
|
+
'#B7B7B7',
|
|
8
|
+
'#999999',
|
|
9
|
+
'#676666',
|
|
10
|
+
'#444343',
|
|
11
|
+
'#000000',
|
|
12
|
+
];
|
|
13
|
+
var RED_COLORS = [
|
|
14
|
+
'#fef2f2',
|
|
15
|
+
'#fee2e2',
|
|
16
|
+
'#fecaca',
|
|
17
|
+
'#fca5a5',
|
|
18
|
+
'#f87171',
|
|
19
|
+
'#dc2626',
|
|
20
|
+
'#b91c1c',
|
|
21
|
+
'#991b1b',
|
|
22
|
+
'#7f1d1d',
|
|
23
|
+
'#450a0a',
|
|
24
|
+
];
|
|
25
|
+
var AMBER_COLORS = [
|
|
26
|
+
'#fffbeb',
|
|
27
|
+
'#fef3c7',
|
|
28
|
+
'#fde68a',
|
|
29
|
+
'#fcd34d',
|
|
30
|
+
'#fbbf24',
|
|
31
|
+
'#d97706',
|
|
32
|
+
'#b45309',
|
|
33
|
+
'#92400e',
|
|
34
|
+
'#78350f',
|
|
35
|
+
'#451a03',
|
|
36
|
+
];
|
|
37
|
+
var GREEN_COLORS = [
|
|
38
|
+
'#f0fdf4',
|
|
39
|
+
'#dcfce7',
|
|
40
|
+
'#bbf7d0',
|
|
41
|
+
'#86efac',
|
|
42
|
+
'#4ade80',
|
|
43
|
+
'#16a34a',
|
|
44
|
+
'#15803d',
|
|
45
|
+
'#166534',
|
|
46
|
+
'#14532d',
|
|
47
|
+
'#052e16',
|
|
48
|
+
];
|
|
49
|
+
var BLUE_COLORS = [
|
|
50
|
+
'#eff6ff',
|
|
51
|
+
'#dbeafe',
|
|
52
|
+
'#bfdbfe',
|
|
53
|
+
'#93c5fd',
|
|
54
|
+
'#60a5fa',
|
|
55
|
+
'#2563eb',
|
|
56
|
+
'#1d4ed8',
|
|
57
|
+
'#1e40af',
|
|
58
|
+
'#1e3a8a',
|
|
59
|
+
'#172554',
|
|
60
|
+
];
|
|
61
|
+
var VIOLET_COLORS = [
|
|
62
|
+
'#f5f3ff',
|
|
63
|
+
'#ede9fe',
|
|
64
|
+
'#ddd6fe',
|
|
65
|
+
'#c4b5fd',
|
|
66
|
+
'#a78bfa',
|
|
67
|
+
'#7c3aed',
|
|
68
|
+
'#6d28d9',
|
|
69
|
+
'#5b21b6',
|
|
70
|
+
'#4c1d95',
|
|
71
|
+
'#2e1065',
|
|
72
|
+
];
|
|
73
|
+
var FUCHSIA_COLORS = [
|
|
74
|
+
'#fdf4ff',
|
|
75
|
+
'#fae8ff',
|
|
76
|
+
'#f5d0fe',
|
|
77
|
+
'#f0abfc',
|
|
78
|
+
'#e879f9',
|
|
79
|
+
'#c026d3',
|
|
80
|
+
'#a21caf',
|
|
81
|
+
'#86198f',
|
|
82
|
+
'#701a75',
|
|
83
|
+
'#4a044e',
|
|
84
|
+
];
|
|
85
|
+
var ROSE_COLORS = [
|
|
86
|
+
'#fff1f2',
|
|
87
|
+
'#ffe4e6',
|
|
88
|
+
'#fecdd3',
|
|
89
|
+
'#fda4af',
|
|
90
|
+
'#fb7185',
|
|
91
|
+
'#e11d48',
|
|
92
|
+
'#be123c',
|
|
93
|
+
'#9f1239',
|
|
94
|
+
'#881337',
|
|
95
|
+
'#4c0519',
|
|
96
|
+
];
|
|
97
|
+
export var COLOR_PALETTE = [
|
|
98
|
+
SLATE_COLORS,
|
|
99
|
+
RED_COLORS,
|
|
100
|
+
AMBER_COLORS,
|
|
101
|
+
GREEN_COLORS,
|
|
102
|
+
BLUE_COLORS,
|
|
103
|
+
VIOLET_COLORS,
|
|
104
|
+
FUCHSIA_COLORS,
|
|
105
|
+
ROSE_COLORS,
|
|
106
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getContrastRatio: (color1: string, color2: string) => number;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { __read } from "tslib";
|
|
2
|
+
// https://medium.muz.li/the-science-of-color-contrast-an-expert-designers-guide-33e84c41d156
|
|
3
|
+
var hexToRgb = function (hex) {
|
|
4
|
+
var r = parseInt(hex.substring(1, 3), 16);
|
|
5
|
+
var g = parseInt(hex.substring(3, 5), 16);
|
|
6
|
+
var b = parseInt(hex.substring(5, 7), 16);
|
|
7
|
+
return [r, g, b];
|
|
8
|
+
};
|
|
9
|
+
var getRelativeLuminance = function (rgb) {
|
|
10
|
+
var _a = __read(rgb.map(function (c) { return c / 255; }), 3), r = _a[0], g = _a[1], b = _a[2];
|
|
11
|
+
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
12
|
+
};
|
|
13
|
+
export var getContrastRatio = function (color1, color2) {
|
|
14
|
+
var rgb1 = hexToRgb(color1);
|
|
15
|
+
var rgb2 = hexToRgb(color2);
|
|
16
|
+
var l1 = getRelativeLuminance(rgb1);
|
|
17
|
+
var l2 = getRelativeLuminance(rgb2);
|
|
18
|
+
return (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05);
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const StyledRoot: import("../style/styled").StyledComponent;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Override } from '../overrides';
|
|
2
|
+
export declare type ColorPickerOverrides = {
|
|
3
|
+
Root?: Override<Record<string, any>>;
|
|
4
|
+
Heading?: Override<Record<string, any>>;
|
|
5
|
+
Swatches?: Override<Record<string, any>>;
|
|
6
|
+
Swatch?: Override<Record<string, any>>;
|
|
7
|
+
TickIcon?: Override<Record<string, any>>;
|
|
8
|
+
};
|
|
9
|
+
export declare type ColorPickerProps = {
|
|
10
|
+
overrides?: ColorPickerOverrides;
|
|
11
|
+
value?: string;
|
|
12
|
+
onChange: (value?: string) => void;
|
|
13
|
+
heading?: string;
|
|
14
|
+
resetButtonLabel?: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
//hooks
|
|
3
|
+
import { useCurrency } from './useCurrency';
|
|
4
|
+
//constants
|
|
5
|
+
import { DEFAULT_VARIANT, DEFAULT_CURRENCY } from './constants';
|
|
6
|
+
export var Currency = function (_a) {
|
|
7
|
+
var value = _a.value, _b = _a.variant, variant = _b === void 0 ? DEFAULT_VARIANT : _b, _c = _a.currency, currency = _c === void 0 ? DEFAULT_CURRENCY : _c, currencyOptions = _a.currencyOptions;
|
|
8
|
+
var formattedCurrency = useCurrency({ value: value, variant: variant, currency: currency, currencyOptions: currencyOptions });
|
|
9
|
+
return _jsx(_Fragment, { children: formattedCurrency }, void 0);
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useLocale } from '../locale';
|
|
2
|
+
import { getFormattedCurrency } from './utils';
|
|
3
|
+
import { DEFAULT_CURRENCY, DEFAULT_VARIANT } from './constants';
|
|
4
|
+
export var useCurrency = function (_a) {
|
|
5
|
+
var value = _a.value, _b = _a.currency, currency = _b === void 0 ? DEFAULT_CURRENCY : _b, _c = _a.variant, variant = _c === void 0 ? DEFAULT_VARIANT : _c, currencyOptions = _a.currencyOptions;
|
|
6
|
+
var langCode = useLocale().langCode;
|
|
7
|
+
return getFormattedCurrency({ value: value, locale: langCode, variant: variant, currencyOptions: currencyOptions, currency: currency });
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NumberVariant } from '../utils/intlNumberFormatUtils/types';
|
|
2
|
+
export declare const getFormattedCurrency: ({ value, locale, variant, currencyOptions, currency, }: {
|
|
3
|
+
value: number;
|
|
4
|
+
locale: string;
|
|
5
|
+
variant: NumberVariant;
|
|
6
|
+
currency: string;
|
|
7
|
+
currencyOptions?: Intl.NumberFormatOptions | undefined;
|
|
8
|
+
}) => string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import { getFormattedNumber } from '../utils/intlNumberFormatUtils';
|
|
3
|
+
export var getFormattedCurrency = function (_a) {
|
|
4
|
+
var value = _a.value, locale = _a.locale, variant = _a.variant, currencyOptions = _a.currencyOptions, currency = _a.currency;
|
|
5
|
+
var intlNumberFormatterOptions = __assign({ style: 'currency', currency: currency }, currencyOptions);
|
|
6
|
+
return getFormattedNumber({ value: value, locale: locale, variant: variant, numberOptions: intlNumberFormatterOptions });
|
|
7
|
+
};
|