@sprinklrjs/spaceweb 10.1.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 +9 -3
- package/asyncSelect/helpers.js +35 -4
- package/asyncSelect/hooks/useAsyncOptionHandlers.d.ts +17 -12
- 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 +63 -12
- package/avatar/avatar.js +12 -2
- package/avatar/index.d.ts +1 -1
- package/avatar/styled-component.js +7 -22
- package/avatar/types.d.ts +1 -1
- package/badge/styled-component.js +10 -8
- package/banner/banner-item.d.ts +12 -0
- package/banner/banner-item.js +14 -0
- package/banner/banner.d.ts +19 -0
- package/banner/banner.js +56 -0
- package/banner/index.d.ts +5 -0
- package/banner/index.js +14 -0
- package/banner/locale.d.ts +6 -0
- package/banner/locale.js +2 -0
- package/banner/package.json +4 -0
- package/banner/styled-component.d.ts +6 -0
- package/banner/styled-component.js +39 -0
- package/banner/types.d.ts +26 -0
- package/banner/types.js +2 -0
- 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 +3 -3
- package/button/Button.js +14 -2
- 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 +9 -6
- package/button/basewebAdapter.js +1 -1
- package/button/styled-components.js +30 -25
- package/button/types.d.ts +4 -1
- 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/index.d.ts +1 -2
- package/button-group/index.js +1 -5
- package/button-group/styled-components.d.ts +34 -0
- package/button-group/styled-components.js +60 -12
- package/button-group/types.d.ts +3 -0
- package/checkbox/basewebAdapters.d.ts +5 -2
- package/checkbox/basewebAdapters.js +9 -2
- package/checkbox/index.d.ts +1 -1
- package/checkbox/index.js +1 -2
- package/checkbox/styled-components.js +1 -1
- package/checkbox/types.d.ts +15 -8
- 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 +47 -26
- 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.d.ts +1 -1
- package/date-picker/Calendar.js +16 -6
- package/date-picker/DateInput.d.ts +3 -2
- package/date-picker/DateInput.js +19 -17
- package/date-picker/DatePickerContent.d.ts +9 -3
- package/date-picker/DatePickerContent.js +59 -8
- package/date-picker/DatePickerInput.js +13 -16
- package/date-picker/DateTimeContainer.d.ts +4 -2
- package/date-picker/DateTimeContainer.js +5 -5
- package/date-picker/StatelessDatePicker.d.ts +1 -1
- package/date-picker/StatelessDatePicker.js +40 -20
- package/date-picker/TimeInput.d.ts +5 -2
- package/date-picker/TimeInput.js +4 -2
- package/date-picker/index.d.ts +1 -0
- package/date-picker/index.js +3 -1
- package/date-picker/locale.d.ts +2 -0
- package/date-picker/stateful-container.d.ts +1 -1
- package/date-picker/stateful-container.js +11 -8
- package/date-picker/styled-components.d.ts +0 -1
- package/date-picker/styled-components.js +54 -27
- package/date-picker/types.d.ts +10 -1
- package/date-picker/utils.d.ts +10 -7
- package/date-picker/utils.js +12 -4
- 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 +9 -3
- package/esm/asyncSelect/helpers.js +31 -3
- package/esm/asyncSelect/hooks/useAsyncOptionHandlers.d.ts +17 -12
- 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 +63 -12
- package/esm/avatar/avatar.js +12 -2
- package/esm/avatar/index.d.ts +1 -1
- package/esm/avatar/styled-component.js +7 -22
- package/esm/avatar/types.d.ts +1 -1
- package/esm/badge/styled-component.js +10 -8
- package/esm/banner/banner-item.d.ts +12 -0
- package/esm/banner/banner-item.js +12 -0
- package/esm/banner/banner.d.ts +19 -0
- package/esm/banner/banner.js +54 -0
- package/esm/banner/index.d.ts +5 -0
- package/esm/banner/index.js +3 -0
- package/esm/banner/locale.d.ts +6 -0
- package/esm/banner/locale.js +1 -0
- package/esm/banner/styled-component.d.ts +6 -0
- package/esm/banner/styled-component.js +35 -0
- package/esm/banner/types.d.ts +26 -0
- package/esm/banner/types.js +1 -0
- 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 +3 -3
- package/esm/button/Button.js +14 -2
- 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 +9 -6
- package/esm/button/basewebAdapter.js +1 -1
- package/esm/button/styled-components.js +30 -25
- package/esm/button/types.d.ts +4 -1
- 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/index.d.ts +1 -2
- package/esm/button-group/index.js +0 -1
- package/esm/button-group/styled-components.d.ts +34 -0
- package/esm/button-group/styled-components.js +58 -11
- package/esm/button-group/types.d.ts +3 -0
- package/esm/checkbox/basewebAdapters.d.ts +5 -2
- package/esm/checkbox/basewebAdapters.js +9 -2
- package/esm/checkbox/index.d.ts +1 -1
- package/esm/checkbox/index.js +1 -1
- package/esm/checkbox/styled-components.js +1 -1
- package/esm/checkbox/types.d.ts +15 -8
- 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 +48 -27
- 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.d.ts +1 -1
- package/esm/date-picker/Calendar.js +17 -7
- package/esm/date-picker/DateInput.d.ts +3 -2
- package/esm/date-picker/DateInput.js +20 -18
- package/esm/date-picker/DatePickerContent.d.ts +9 -3
- package/esm/date-picker/DatePickerContent.js +60 -9
- package/esm/date-picker/DatePickerInput.js +13 -16
- package/esm/date-picker/DateTimeContainer.d.ts +4 -2
- package/esm/date-picker/DateTimeContainer.js +5 -5
- package/esm/date-picker/StatelessDatePicker.d.ts +1 -1
- package/esm/date-picker/StatelessDatePicker.js +40 -20
- package/esm/date-picker/TimeInput.d.ts +5 -2
- package/esm/date-picker/TimeInput.js +4 -2
- package/esm/date-picker/index.d.ts +1 -0
- package/esm/date-picker/index.js +1 -0
- package/esm/date-picker/locale.d.ts +2 -0
- package/esm/date-picker/stateful-container.d.ts +1 -1
- package/esm/date-picker/stateful-container.js +11 -8
- package/esm/date-picker/styled-components.d.ts +0 -1
- package/esm/date-picker/styled-components.js +53 -26
- package/esm/date-picker/types.d.ts +10 -1
- package/esm/date-picker/utils.d.ts +10 -7
- package/esm/date-picker/utils.js +13 -5
- 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/context.d.ts +6 -13
- package/esm/form-control/context.js +10 -9
- 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 +18 -7
- 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/baseui/withThemeOverride.js +1 -1
- package/esm/helpers/commonStyles.d.ts +2 -2
- 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/styletron.d.ts +14 -3
- package/esm/helpers/themeHelpers.d.ts +1 -0
- package/esm/helpers/themeHelpers.js +13 -0
- package/esm/hooks/useAutoFocus.d.ts +6 -7
- package/esm/hooks/useAutoFocus.js +19 -13
- package/esm/hooks/useCombinedRef.d.ts +1 -0
- package/esm/hooks/useCombinedRef.js +33 -0
- package/esm/hooks/useIsMobileDevice.d.ts +1 -0
- package/esm/hooks/useIsMobileDevice.js +6 -0
- package/esm/hooks/useMatchMedia.d.ts +3 -0
- package/esm/hooks/useMatchMedia.js +49 -0
- 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.d.ts +1 -1
- package/esm/input/basewebAdapters.js +18 -3
- package/esm/input/index.d.ts +2 -1
- package/esm/input/index.js +1 -0
- package/esm/input/styled-components.d.ts +1 -1
- package/esm/input/styled-components.js +8 -6
- package/esm/input/types.d.ts +10 -4
- package/esm/layer/useLayersContextValue.js +3 -2
- package/esm/list/avatar-list-item.d.ts +12 -22
- package/esm/list/avatar-list-item.js +8 -10
- package/esm/list/divider.js +6 -3
- 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/list.d.ts +10 -5
- package/esm/list/list.js +47 -6
- package/esm/list/styled-component.d.ts +1 -0
- package/esm/list/styled-component.js +23 -17
- package/esm/list/types.d.ts +8 -0
- package/esm/list/utils.d.ts +2 -0
- package/esm/list/utils.js +10 -0
- package/esm/locale/en_US.js +35 -0
- package/esm/locale/types.d.ts +21 -0
- package/esm/menu/MenuContext.d.ts +2 -1
- package/esm/menu/MenuContext.js +1 -0
- package/esm/menu/menu-item.d.ts +8 -2
- package/esm/menu/menu-item.js +11 -11
- package/esm/menu/menu.d.ts +6 -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/adapter.d.ts +1 -1
- package/esm/modal/index.d.ts +1 -1
- package/esm/modal/index.js +1 -1
- package/esm/modal/modal.js +5 -5
- package/esm/modal/overrides.d.ts +2 -3
- package/esm/modal/overrides.js +6 -8
- package/esm/modal/styled-components.d.ts +1 -1
- package/esm/modal/styled-components.js +8 -8
- 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 +5 -4
- package/esm/payment-card/basewebAdapters.d.ts +2 -0
- package/esm/payment-card/basewebAdapters.js +27 -4
- package/esm/payment-card/styled-components.js +25 -6
- package/esm/payment-card/types.d.ts +4 -2
- package/esm/phone-input/country-select-container.js +1 -1
- package/esm/phone-input/country-select.js +4 -6
- package/esm/phone-input/default-props.d.ts +6 -9
- package/esm/phone-input/default-props.js +7 -9
- package/esm/phone-input/flag-container.js +1 -1
- package/esm/phone-input/phone-input.d.ts +0 -6
- package/esm/phone-input/phone-input.js +21 -12
- package/esm/phone-input/stateful-phone-input-container.js +4 -3
- package/esm/phone-input/stateful-phone-input.d.ts +0 -6
- 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 +10 -3
- package/esm/phone-input/utils.js +10 -5
- package/esm/popover/adapter.d.ts +4 -3
- package/esm/popover/adapter.js +15 -0
- package/esm/popover/overrides.js +8 -19
- package/esm/popover/popover.d.ts +6 -3
- package/esm/popover/popover.js +13 -6
- package/esm/popover/stateful-popover.js +2 -2
- package/esm/popover/types.d.ts +10 -2
- package/esm/popover/types.js +2 -1
- package/esm/popover/utils.d.ts +12 -0
- package/esm/popover/utils.js +9 -0
- package/esm/progress/circular/styled-component.d.ts +1 -1
- package/esm/progress/circular/styled-component.js +3 -3
- package/esm/progress/linear/styled-component.d.ts +1 -1
- package/esm/progress/linear/styled-component.js +5 -5
- package/esm/radio/basewebAdapters.d.ts +8 -11
- package/esm/radio/basewebAdapters.js +6 -3
- package/esm/radio/radio.js +6 -5
- package/esm/radio/styled-components.js +9 -11
- package/esm/radio/types.d.ts +13 -6
- 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/adaptor.d.ts +1 -1
- package/esm/select/base-select.d.ts +36 -16
- package/esm/select/base-select.js +185 -88
- package/esm/select/constants.d.ts +3 -0
- package/esm/select/constants.js +3 -1
- package/esm/select/default-props.d.ts +9 -5
- package/esm/select/default-props.js +4 -1
- package/esm/select/index.d.ts +4 -4
- package/esm/select/index.js +3 -3
- package/esm/select/locale.d.ts +4 -0
- package/esm/select/mobileSelect/MobileSelect.js +3 -5
- package/esm/select/mobileSelect/MobileSheet.js +3 -1
- package/esm/select/multi-value.js +22 -12
- package/esm/select/overlaySelect/OverlaySelect.js +10 -18
- package/esm/select/overlaySelect/hooks/useControlRef.d.ts +9 -0
- package/esm/select/overlaySelect/hooks/useControlRef.js +33 -0
- package/esm/select/overlaySelect/hooks/useOverlaySelectOverrides.d.ts +24 -0
- package/esm/select/overlaySelect/{useOverlaySelectOverrides.js → hooks/useOverlaySelectOverrides.js} +31 -28
- package/esm/select/overlaySelect/{usePopover.d.ts → hooks/usePopover.d.ts} +1 -1
- package/esm/select/overlaySelect/{usePopover.js → hooks/usePopover.js} +2 -2
- package/esm/select/overrides.d.ts +3 -1
- package/esm/select/overrides.js +19 -13
- package/esm/select/select-variants.js +2 -2
- package/esm/select/select.d.ts +9 -5
- 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 -32
- package/esm/select/selectMenuAdapter/SelectMenuAdapter.js +11 -5
- package/esm/select/selectMenuAdapter/SelectMenuItem.d.ts +8 -2
- package/esm/select/selectMenuAdapter/SelectMenuItem.js +2 -4
- 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 +9 -5
- package/esm/select/stateful-select.js +3 -3
- package/esm/select/styled-component.d.ts +15 -4
- package/esm/select/styled-component.js +60 -10
- package/esm/select/types.d.ts +36 -9
- 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/mark.d.ts +3 -3
- package/esm/slider/slider.js +2 -1
- package/esm/slider/stateful-slider.js +1 -1
- package/esm/slider/styled-components.js +4 -4
- package/esm/slider/types.d.ts +9 -2
- package/esm/snackbar/Snackbar.js +12 -12
- package/esm/snackbar/styled-component.js +9 -6
- package/esm/spacewebProvider/CustomBaseProvider.js +1 -0
- package/esm/spacewebProvider/SpacewebProvider.d.ts +3 -1
- 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 +12 -7
- package/esm/style/useMemoizedStyletron.d.ts +1 -1
- package/esm/style/useMemoizedStyletron.js +6 -1
- package/esm/styleEngine/styleEngine.d.ts +1 -2
- package/esm/switch/__test__/switch.spec.js +13 -0
- package/esm/switch/styled-components.js +14 -21
- package/esm/switch/switch.js +5 -2
- package/esm/switch/types.d.ts +8 -11
- 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 +4 -4
- package/esm/textarea/styled-components.d.ts +1 -1
- package/esm/textarea/textarea.js +4 -8
- package/esm/textarea/types.d.ts +7 -5
- 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/themes/index.js +1 -1
- package/esm/themes/responsive-theme.d.ts +2 -2
- package/esm/time-picker/TimePicker.d.ts +1 -6
- package/esm/time-picker/TimePicker.js +4 -4
- package/esm/time-picker/types.d.ts +3 -1
- package/esm/time-range-picker/RangeSelector.js +6 -5
- package/esm/time-range-picker/RangeSelectorContainer.js +27 -27
- package/esm/time-range-picker/TimeRangeList.js +8 -1
- package/esm/time-range-picker/TimeRangePicker.js +26 -17
- package/esm/time-range-picker/index.d.ts +1 -1
- package/esm/time-range-picker/index.js +1 -1
- package/esm/time-range-picker/locale.d.ts +3 -0
- package/esm/time-range-picker/types.d.ts +17 -3
- package/esm/time-range-picker/utils.d.ts +47 -18
- package/esm/time-range-picker/utils.js +94 -16
- package/esm/time-zone-picker/TimezonePicker.d.ts +1 -6
- package/esm/time-zone-picker/TimezonePicker.js +5 -7
- package/esm/time-zone-picker/types.d.ts +2 -0
- package/esm/tooltip/disabled-tooltip-container.d.ts +26 -1
- package/esm/tooltip/overrides.js +1 -2
- package/esm/tooltip/stateful-tooltip-container.d.ts +26 -1
- package/esm/tooltip/stateful-tooltip.d.ts +27 -1
- package/esm/tooltip/stateful-tooltip.js +2 -2
- package/esm/tooltip/tooltip.d.ts +1 -1
- package/esm/tooltip/tooltip.js +7 -4
- package/esm/tooltip/types.d.ts +12 -2
- package/esm/types.d.ts +5 -3
- 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/esm/video/Video.js +4 -2
- package/esm/video/types.d.ts +2 -0
- package/form-control/context.d.ts +6 -13
- package/form-control/context.js +11 -10
- package/form-control/form-control.d.ts +1 -1
- package/form-control/form-control.js +16 -11
- package/form-control/styled-component.js +18 -7
- 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/baseui/withThemeOverride.js +1 -1
- package/helpers/commonStyles.d.ts +2 -2
- package/helpers/commonStyles.js +3 -6
- package/helpers/index.d.ts +1 -0
- package/helpers/index.js +10 -1
- package/helpers/styletron.d.ts +14 -3
- package/helpers/themeHelpers.d.ts +1 -0
- package/helpers/themeHelpers.js +15 -1
- package/hooks/useAutoFocus.d.ts +6 -7
- package/hooks/useAutoFocus.js +19 -14
- package/hooks/useCombinedRef.d.ts +1 -0
- package/hooks/useCombinedRef.js +35 -1
- package/hooks/useIsMobileDevice.d.ts +1 -0
- package/hooks/useIsMobileDevice.js +11 -0
- package/hooks/useMatchMedia.d.ts +3 -0
- package/hooks/useMatchMedia.js +52 -0
- 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.d.ts +1 -1
- package/input/basewebAdapters.js +18 -3
- package/input/index.d.ts +2 -1
- package/input/index.js +3 -1
- package/input/styled-components.d.ts +1 -1
- package/input/styled-components.js +7 -5
- package/input/types.d.ts +10 -4
- package/layer/useLayersContextValue.js +2 -1
- package/list/avatar-list-item.d.ts +12 -22
- package/list/avatar-list-item.js +6 -8
- package/list/divider.js +6 -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/list.d.ts +10 -5
- package/list/list.js +47 -6
- package/list/styled-component.d.ts +1 -0
- package/list/styled-component.js +24 -18
- package/list/types.d.ts +8 -0
- package/list/utils.d.ts +2 -0
- package/list/utils.js +14 -0
- package/locale/en_US.js +35 -0
- package/locale/types.d.ts +21 -0
- package/menu/MenuContext.d.ts +2 -1
- package/menu/MenuContext.js +1 -0
- package/menu/menu-item.d.ts +8 -2
- package/menu/menu-item.js +11 -11
- package/menu/menu.d.ts +6 -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/adapter.d.ts +1 -1
- package/modal/index.d.ts +1 -1
- package/modal/index.js +1 -2
- package/modal/modal.js +4 -4
- package/modal/overrides.d.ts +2 -3
- package/modal/overrides.js +7 -9
- package/modal/styled-components.d.ts +1 -1
- package/modal/styled-components.js +8 -9
- 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 +6 -4
- package/package.json +18 -12
- package/payment-card/basewebAdapters.d.ts +2 -0
- package/payment-card/basewebAdapters.js +27 -4
- package/payment-card/styled-components.js +24 -5
- package/payment-card/types.d.ts +4 -2
- package/phone-input/country-select-container.js +1 -1
- package/phone-input/country-select.js +4 -6
- package/phone-input/default-props.d.ts +6 -9
- package/phone-input/default-props.js +8 -9
- package/phone-input/flag-container.js +1 -1
- package/phone-input/phone-input.d.ts +0 -6
- package/phone-input/phone-input.js +20 -11
- package/phone-input/stateful-phone-input-container.js +4 -3
- package/phone-input/stateful-phone-input.d.ts +0 -6
- 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 +10 -3
- package/phone-input/utils.js +11 -5
- package/popover/adapter.d.ts +4 -3
- package/popover/adapter.js +16 -1
- package/popover/overrides.js +8 -19
- package/popover/popover.d.ts +6 -3
- package/popover/popover.js +12 -5
- package/popover/stateful-popover.js +2 -2
- package/popover/types.d.ts +10 -2
- package/popover/types.js +5 -4
- package/popover/utils.d.ts +12 -0
- package/popover/utils.js +11 -1
- package/progress/circular/styled-component.d.ts +1 -1
- package/progress/circular/styled-component.js +4 -4
- package/progress/linear/styled-component.d.ts +1 -1
- package/progress/linear/styled-component.js +5 -5
- package/radio/basewebAdapters.d.ts +8 -11
- package/radio/basewebAdapters.js +6 -3
- package/radio/radio.js +6 -5
- package/radio/styled-components.js +9 -11
- package/radio/types.d.ts +13 -6
- 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/adaptor.d.ts +1 -1
- package/select/base-select.d.ts +36 -16
- package/select/base-select.js +183 -86
- package/select/constants.d.ts +3 -0
- package/select/constants.js +4 -2
- package/select/default-props.d.ts +9 -5
- package/select/default-props.js +4 -1
- package/select/index.d.ts +4 -4
- package/select/index.js +4 -2
- package/select/locale.d.ts +4 -0
- package/select/mobileSelect/MobileSelect.js +3 -5
- package/select/mobileSelect/MobileSheet.js +3 -1
- package/select/multi-value.js +21 -11
- package/select/overlaySelect/OverlaySelect.js +9 -17
- package/select/overlaySelect/hooks/useControlRef.d.ts +9 -0
- package/select/overlaySelect/hooks/useControlRef.js +37 -0
- package/select/overlaySelect/hooks/useOverlaySelectOverrides.d.ts +24 -0
- package/select/overlaySelect/{useOverlaySelectOverrides.js → hooks/useOverlaySelectOverrides.js} +31 -28
- package/select/overlaySelect/{usePopover.d.ts → hooks/usePopover.d.ts} +1 -1
- package/select/overlaySelect/{usePopover.js → hooks/usePopover.js} +2 -2
- package/select/overrides.d.ts +3 -1
- package/select/overrides.js +20 -14
- package/select/select-variants.js +2 -2
- package/select/select.d.ts +9 -5
- 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 -32
- package/select/selectMenuAdapter/SelectMenuAdapter.js +11 -5
- package/select/selectMenuAdapter/SelectMenuItem.d.ts +8 -2
- package/select/selectMenuAdapter/SelectMenuItem.js +2 -4
- 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 +9 -5
- package/select/stateful-select.js +3 -3
- package/select/styled-component.d.ts +15 -4
- package/select/styled-component.js +58 -11
- package/select/types.d.ts +36 -9
- 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/mark.d.ts +3 -3
- package/slider/slider.js +2 -1
- package/slider/stateful-slider.js +1 -1
- package/slider/styled-components.js +4 -4
- package/slider/types.d.ts +9 -2
- package/snackbar/Snackbar.js +12 -12
- package/snackbar/styled-component.js +9 -6
- package/spacewebProvider/CustomBaseProvider.js +1 -0
- package/spacewebProvider/SpacewebProvider.d.ts +3 -1
- 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 +12 -7
- package/style/useMemoizedStyletron.d.ts +1 -1
- package/style/useMemoizedStyletron.js +6 -1
- package/styleEngine/styleEngine.d.ts +1 -2
- package/switch/__test__/switch.spec.js +13 -0
- package/switch/styled-components.js +14 -21
- package/switch/switch.js +5 -2
- package/switch/types.d.ts +8 -11
- 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 +3 -3
- package/textarea/styled-components.d.ts +1 -1
- package/textarea/textarea.js +3 -7
- package/textarea/types.d.ts +7 -5
- 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/themes/index.js +1 -1
- package/themes/responsive-theme.d.ts +2 -2
- package/time-picker/TimePicker.d.ts +1 -6
- package/time-picker/TimePicker.js +4 -4
- package/time-picker/types.d.ts +3 -1
- package/time-range-picker/RangeSelector.js +5 -4
- package/time-range-picker/RangeSelectorContainer.js +26 -26
- package/time-range-picker/TimeRangeList.js +8 -1
- package/time-range-picker/TimeRangePicker.js +25 -16
- package/time-range-picker/index.d.ts +1 -1
- package/time-range-picker/index.js +4 -1
- package/time-range-picker/locale.d.ts +3 -0
- package/time-range-picker/types.d.ts +17 -3
- package/time-range-picker/utils.d.ts +47 -18
- package/time-range-picker/utils.js +98 -17
- package/time-zone-picker/TimezonePicker.d.ts +1 -6
- package/time-zone-picker/TimezonePicker.js +5 -7
- package/time-zone-picker/types.d.ts +2 -0
- package/tooltip/disabled-tooltip-container.d.ts +26 -1
- package/tooltip/overrides.js +1 -2
- package/tooltip/stateful-tooltip-container.d.ts +26 -1
- package/tooltip/stateful-tooltip.d.ts +27 -1
- package/tooltip/stateful-tooltip.js +2 -2
- package/tooltip/tooltip.d.ts +1 -1
- package/tooltip/tooltip.js +7 -4
- package/tooltip/types.d.ts +12 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/types.d.ts +5 -3
- 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/video/Video.js +4 -2
- package/video/types.d.ts +2 -0
- package/esm/icon/components/chevron-right-solid.d.ts +0 -3
- package/esm/icon/components/chevron-right-solid.js +0 -6
- package/esm/phone-input/virtualized-country-select-dropdown.d.ts +0 -31
- package/esm/phone-input/virtualized-country-select-dropdown.js +0 -33
- package/esm/select/overlaySelect/useOverlaySelectOverrides.d.ts +0 -14
- package/esm/style/_escapeClassName.d.ts +0 -6
- package/esm/style/_escapeClassName.js +0 -6
- package/icon/components/chevron-right-solid.d.ts +0 -3
- package/icon/components/chevron-right-solid.js +0 -9
- package/phone-input/virtualized-country-select-dropdown.d.ts +0 -31
- package/phone-input/virtualized-country-select-dropdown.js +0 -35
- package/select/overlaySelect/useOverlaySelectOverrides.d.ts +0 -14
- package/style/_escapeClassName.d.ts +0 -6
- package/style/_escapeClassName.js +0 -9
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { __read, __spreadArray } from "tslib";
|
|
2
|
+
import { normalizeOptions } from 'baseui/select/utils';
|
|
3
|
+
import { UNGROUPED_ID } from '../constants';
|
|
4
|
+
function removeDuplicates(valueKey, options) {
|
|
5
|
+
var keySet = new Set();
|
|
6
|
+
return options.filter(function (opt) {
|
|
7
|
+
var key = (opt.__optgroup || UNGROUPED_ID) + opt[valueKey];
|
|
8
|
+
var shouldAdd = !keySet.has(key);
|
|
9
|
+
keySet.add(key);
|
|
10
|
+
return shouldAdd;
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export function mergeOptions(valueKey, options1, options2) {
|
|
14
|
+
if (options1 === void 0) { options1 = []; }
|
|
15
|
+
if (options2 === void 0) { options2 = []; }
|
|
16
|
+
var optArr1 = normalizeOptions(options1), optArr2 = normalizeOptions(options2);
|
|
17
|
+
return removeDuplicates(valueKey, __spreadArray(__spreadArray([], __read(optArr1), false), __read(optArr2), false));
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getSelectedOptions: (container?: HTMLElement | undefined) => (string | null)[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { getAllByTestId, screen } from '@testing-library/react';
|
|
2
|
+
export var getSelectedOptions = function (container) {
|
|
3
|
+
var elements = container
|
|
4
|
+
? getAllByTestId(container, 'combobox-selected-value')
|
|
5
|
+
: screen.getAllByTestId('combobox-selected-value');
|
|
6
|
+
return elements.map(function (item) { return item.textContent; });
|
|
7
|
+
};
|
package/esm/slider/mark.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
declare const Mark: React.ForwardRefExoticComponent<import("baseui/slider").
|
|
2
|
+
declare const Mark: React.ForwardRefExoticComponent<import("baseui/slider").StyleProps & {
|
|
3
3
|
$intent?: boolean | undefined;
|
|
4
4
|
$step: number;
|
|
5
5
|
} & {
|
|
6
6
|
$markIndex: number;
|
|
7
7
|
overrides?: {
|
|
8
|
-
MarkLabel?: import("../overrides").Override<import("baseui/slider").
|
|
8
|
+
MarkLabel?: import("../overrides").Override<import("baseui/slider").StyleProps & {
|
|
9
9
|
$intent?: boolean | undefined;
|
|
10
10
|
$step: number;
|
|
11
11
|
} & Record<string, any>> | undefined;
|
|
12
12
|
} | undefined;
|
|
13
|
-
getMarkLabel: (props: import("baseui/slider").
|
|
13
|
+
getMarkLabel: (props: import("baseui/slider").StyleProps & {
|
|
14
14
|
$intent?: boolean | undefined;
|
|
15
15
|
$step: number;
|
|
16
16
|
} & {
|
package/esm/slider/slider.js
CHANGED
|
@@ -5,10 +5,11 @@ import { useConvertOverrides } from '../helpers/baseui/useConvertOverrides';
|
|
|
5
5
|
import Mark from './mark';
|
|
6
6
|
import { getInnerTrackStyles, getThumbStyles, getInnerThumbStyles, getThumbValueStyles } from './styled-components';
|
|
7
7
|
import { isServer } from '../spacewebProvider/utils';
|
|
8
|
+
// @ts-ignore
|
|
8
9
|
BaseSlider.displayName = 'BaseSlider';
|
|
9
10
|
var defaultMarkLabel = function (_a) {
|
|
10
11
|
var $markIndex = _a.$markIndex, $min = _a.$min, $step = _a.$step;
|
|
11
|
-
return "".concat($min + $markIndex * $step);
|
|
12
|
+
return "".concat(($min || 0) + $markIndex * $step);
|
|
12
13
|
};
|
|
13
14
|
var Slider = function (_a) {
|
|
14
15
|
var overrides = _a.overrides, markLabel = _a.markLabel, _b = _a.intent, intent = _b === void 0 ? 'default' : _b, _c = _a.getMarkLabel, getMarkLabel = _c === void 0 ? defaultMarkLabel : _c, className = _a.className, style = _a.style, restProps = __rest(_a, ["overrides", "markLabel", "intent", "getMarkLabel", "className", "style"]);
|
|
@@ -2,6 +2,6 @@ import { __assign } from "tslib";
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import StatefulContainer from './stateful-slider-container';
|
|
4
4
|
import Slider from './slider';
|
|
5
|
-
var StatefulSlider = function (props) { return (_jsx(StatefulContainer, __assign({}, props, { children: function (sliderProps) { return _jsx(Slider, __assign({}, sliderProps), void 0); } }), void 0)); };
|
|
5
|
+
var StatefulSlider = function (props) { return (_jsx(StatefulContainer, __assign({}, props, { children: function (sliderProps) { return _jsx(Slider, __assign({}, sliderProps, { overrides: props.overrides }), void 0); } }), void 0)); };
|
|
6
6
|
StatefulSlider.displayName = 'StatefulSlider';
|
|
7
7
|
export default StatefulSlider;
|
|
@@ -4,7 +4,7 @@ import { borderRadius, borderColor } from '../helpers/longHandHelpers';
|
|
|
4
4
|
import { intentColor } from '../helpers/intentHelper';
|
|
5
5
|
import { hex2rgb } from '../helpers';
|
|
6
6
|
var addOpacity = function (token, opacity) {
|
|
7
|
-
return token.includes('rgb') ? token.split(')')[0] + opacity
|
|
7
|
+
return token.includes('rgb') ? "".concat(token.split(')')[0] + opacity, ")") : hex2rgb(token, opacity);
|
|
8
8
|
};
|
|
9
9
|
var secondaryIntentColor = function (_a, _b) {
|
|
10
10
|
var theme = _a.theme;
|
|
@@ -23,13 +23,13 @@ var secondaryIntentColor = function (_a, _b) {
|
|
|
23
23
|
export var getInnerTrackStyles = [
|
|
24
24
|
'w-full self-center',
|
|
25
25
|
function (_a, _b) {
|
|
26
|
-
var theme = _a.theme,
|
|
26
|
+
var theme = _a.theme, px2rem = _a.px2rem;
|
|
27
27
|
var $disabled = _b.$disabled, $value = _b.$value, $min = _b.$min, $max = _b.$max, $intent = _b.$intent;
|
|
28
28
|
var intentPrimary = intentColor({ theme: theme }, { $intent: $intent });
|
|
29
29
|
var intentSecondary = secondaryIntentColor({ theme: theme }, { $intent: $intent });
|
|
30
30
|
var scaledValue = $value.map(function (value) { return ((value - $min) / ($max - $min)) * 100; });
|
|
31
|
-
var gradientDirection =
|
|
32
|
-
return __assign({ background: scaledValue.length
|
|
31
|
+
var gradientDirection = 'to right';
|
|
32
|
+
return __assign({ background: scaledValue.length === 1
|
|
33
33
|
? "linear-gradient(".concat(gradientDirection, ", \n ").concat(intentPrimary, " ").concat(scaledValue[0], "%, \n ").concat(intentSecondary, " ").concat(scaledValue[0], "%)")
|
|
34
34
|
: "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' }, borderRadius('6px'));
|
|
35
35
|
},
|
package/esm/slider/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { SliderProps as BaseSliderProps, StatefulContainerProps as BaseStatefulContainerProps, StatefulSliderProps as BaseStatefulSliderProps
|
|
2
|
+
import { SharedProps as BaseSharedProps, SliderProps as BaseSliderProps, StatefulContainerProps as BaseStatefulContainerProps, StatefulSliderProps as BaseStatefulSliderProps } from 'baseui/slider';
|
|
3
3
|
import { Intent, SpacewebComponentProps } from '../types';
|
|
4
4
|
import { Override } from '../overrides';
|
|
5
5
|
declare type GetMarkLabelFn = (props: SharedProps & {
|
|
@@ -26,7 +26,14 @@ export declare type SharedProps = BaseSharedProps & {
|
|
|
26
26
|
$step: number;
|
|
27
27
|
};
|
|
28
28
|
export declare type SliderProps = SpacewebComponentProps<Omit<BaseSliderProps, 'overrides'>> & CommonSliderProps;
|
|
29
|
-
export declare type StatefulContainerProps = SpacewebComponentProps<Omit<BaseStatefulContainerProps, 'overrides'>> & CommonSliderProps
|
|
29
|
+
export declare type StatefulContainerProps = SpacewebComponentProps<Omit<BaseStatefulContainerProps, 'overrides' | 'stateReducer' | 'min' | 'max' | 'step' | 'onChange' | 'onFinalChange'>> & CommonSliderProps & {
|
|
30
|
+
stateReducer?: BaseStatefulContainerProps['stateReducer'];
|
|
31
|
+
min?: BaseStatefulContainerProps['min'];
|
|
32
|
+
max?: BaseStatefulContainerProps['max'];
|
|
33
|
+
step?: BaseStatefulContainerProps['step'];
|
|
34
|
+
onChange?: BaseStatefulContainerProps['onChange'];
|
|
35
|
+
onFinalChange?: BaseStatefulContainerProps['onFinalChange'];
|
|
36
|
+
};
|
|
30
37
|
export declare type StatefulSliderProps = SpacewebComponentProps<Omit<BaseStatefulSliderProps, 'overrides'>> & CommonSliderProps;
|
|
31
38
|
export declare type MarkProps = SharedProps & {
|
|
32
39
|
$markIndex: number;
|
package/esm/snackbar/Snackbar.js
CHANGED
|
@@ -11,6 +11,7 @@ import { INTENT_TO_ICON, TYPE_TO_HIDE_DURATION } from './constants';
|
|
|
11
11
|
import { LayersManager, Z_INDEX } from '../layer';
|
|
12
12
|
import { StyledContentContainer, StyledIconsContainer, StyledMessage, StyledPlacementContainer, StyledSnackbarContainer, getIconStyles, } from './styled-component';
|
|
13
13
|
import useSnackbar from './useSnackbar';
|
|
14
|
+
import { useLocale } from '../locale';
|
|
14
15
|
var Snackbar = function (_a) {
|
|
15
16
|
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 ? 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 : _h;
|
|
16
17
|
var _j = useSnackbar({
|
|
@@ -40,18 +41,17 @@ var Snackbar = function (_a) {
|
|
|
40
41
|
var _r = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.IntentIcon, IntentIconComponent), 2), IntentIcon = _r[0], intentIconProps = _r[1];
|
|
41
42
|
var _s = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.CloseIcon, CloseIcon), 2), Close = _s[0], closeProps = _s[1];
|
|
42
43
|
var _t = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.CloseIconButton, IconButton)), CloseIconButton = _t[0], closeIconButtonProps = _t.slice(1);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
var locale = useLocale();
|
|
45
|
+
return shouldRender ? (_jsx(LayersManager, __assign({ zIndex: Z_INDEX.SNACKBAR }, { children: _jsx(Layer, __assign({}, sharedProps, layerProps, { children: _jsx(PlacementContainer, __assign({ "data-spaceweb": "snackbar", "data-testid": "snackbar" }, sharedProps, placementContainerProps, { children: _jsx(SnackbarContainer, __assign({}, snackbarContainerProps, { ref: snackbarContainerRef, role: "alert" }, sharedProps, snackbarContainerOverrideProps, { children: _jsxs(ContentContainer, __assign({}, sharedProps, contentContainerProps, { children: [_jsx(IconsContainer, __assign({}, sharedProps, iconsContainerProps, { children: _jsx(IntentIcon, __assign({ size: 14, className: getIconStyles }, sharedProps, intentIconProps), void 0) }), void 0), _jsx(Message, __assign({ "aria-atomic": true, "aria-live": "assertive" }, sharedProps, messageProps, { children: isValidElement(message) ? cloneElement(message) : message }), void 0), !disableManualClose && (_jsx(CloseIconButton, __assign({ shape: "square", className: [
|
|
46
|
+
'cursor-pointer h-4 w-4 ml-3 rounded-2 min-w-0 border-0 flex-shrink-0',
|
|
47
|
+
{
|
|
48
|
+
':focus': {
|
|
49
|
+
backgroundColor: '#48484C',
|
|
50
|
+
},
|
|
51
|
+
':hover': {
|
|
52
|
+
backgroundColor: '#48484C',
|
|
53
|
+
},
|
|
50
54
|
},
|
|
51
|
-
|
|
52
|
-
backgroundColor: '#48484C',
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
], onClick: function () { return handleClose('manualClose'); } }, sharedProps, closeIconButtonProps, { children: _jsx(Close, __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;
|
|
55
|
+
], onClick: function () { return handleClose('manualClose'); }, "aria-label": locale.snackbar.closeAriaLabel }, sharedProps, closeIconButtonProps, { children: _jsx(Close, __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;
|
|
56
56
|
};
|
|
57
57
|
export default Snackbar;
|
|
@@ -56,25 +56,28 @@ export var StyledPlacementContainer = styled('div', 'flex flex-col fixed right-0
|
|
|
56
56
|
export var StyledSnackbarContainer = styled('div', 'pointer-events-auto flex spr-shadow-01 overflow-hidden rounded-8 relative', function (_a) {
|
|
57
57
|
var px2rem = _a.px2rem;
|
|
58
58
|
return ({
|
|
59
|
-
minHeight: px2rem(
|
|
59
|
+
minHeight: px2rem(52),
|
|
60
60
|
maxWidth: px2rem(432),
|
|
61
61
|
minWidth: px2rem(250),
|
|
62
62
|
});
|
|
63
63
|
});
|
|
64
|
-
export var StyledIconsContainer = styled('div', 'flex items-center justify-center rounded-
|
|
64
|
+
export var StyledIconsContainer = styled('div', 'flex items-center justify-center rounded-8', function (_a) {
|
|
65
65
|
var px2rem = _a.px2rem;
|
|
66
66
|
return ({
|
|
67
|
-
width: px2rem(
|
|
68
|
-
height: px2rem(
|
|
67
|
+
width: px2rem(14),
|
|
68
|
+
height: px2rem(14),
|
|
69
69
|
});
|
|
70
70
|
});
|
|
71
|
-
export var StyledContentContainer = styled('div', 'py-
|
|
71
|
+
export var StyledContentContainer = styled('div', 'py-2 px-3 overflow-hidden flex items-center flex-1', function (_a) {
|
|
72
72
|
var theme = _a.theme;
|
|
73
73
|
return ({
|
|
74
74
|
backgroundColor: theme.name.includes('dark') ? theme.spr.ui05 : '#212123',
|
|
75
75
|
});
|
|
76
76
|
});
|
|
77
|
-
export var StyledMessage = styled('div', '
|
|
77
|
+
export var StyledMessage = styled('div', 'font-500 text-14 ml-3 flex-1 flex items-center spr-text-05', {
|
|
78
|
+
lineHeight: '18px',
|
|
79
|
+
wordBreak: 'break-word',
|
|
80
|
+
});
|
|
78
81
|
export var getIconStyles = function (utils, props) { return ({
|
|
79
82
|
fill: intentColor(utils, props, utils.theme.supportSuccess),
|
|
80
83
|
}); };
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { useConvertOverrides } from '../helpers/baseui/useConvertOverrides';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { BaseProvider } from 'baseui';
|
|
6
|
+
// @ts-ignore
|
|
6
7
|
BaseProvider.displayName = 'BaseUIProvider';
|
|
7
8
|
// NOTE: Reason https://baseweb.design/components/layer/#layersmanager
|
|
8
9
|
var BaseProviderOverrides = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from 'react';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { StandardEngine } from 'styletron-
|
|
3
|
+
import { StandardEngine } from 'styletron-standard';
|
|
4
4
|
import { Direction, ThemeModule } from '@sprinklrjs/spaceweb-themes/types';
|
|
5
5
|
import { Override } from '../overrides';
|
|
6
6
|
import { LocaleProvider } from '../locale';
|
|
@@ -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;
|
|
@@ -6,26 +6,26 @@ import { initFocusVisible, teardown } from 'baseui/utils/focusVisible';
|
|
|
6
6
|
import { DocumentProvider, useDocument } from './DocumentProvider';
|
|
7
7
|
import { StyleProvider, getStyleEngine } from '../styleEngine';
|
|
8
8
|
import BASEWEB_THEMES from '../themes';
|
|
9
|
-
import { isServer } from './utils';
|
|
10
9
|
import { LocaleProvider } from '../locale';
|
|
11
10
|
import { LAYERS_DEFAULT_ZINDEX, LayersManager } from '../layer';
|
|
12
|
-
import { ThemeProvider } from '../theme';
|
|
11
|
+
import { ThemeProvider, useTheme } from '../theme';
|
|
13
12
|
function SpacewebProvider(props) {
|
|
14
|
-
var children = props.children, _a = props.
|
|
13
|
+
var children = props.children, _a = props.layersZIndex, layersZIndex = _a === void 0 ? 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;
|
|
15
14
|
var doc = useDocument();
|
|
16
15
|
var styleEngine = props.styleEngine || getStyleEngine(doc);
|
|
17
16
|
// TODO: This must be removed once baseui code exposes focusVisible from utils/index
|
|
18
17
|
// https://github.com/uber/baseweb/issues/3322
|
|
19
18
|
useEffect(function () {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
return undefined;
|
|
19
|
+
initFocusVisible({ ownerDocument: doc });
|
|
20
|
+
return function () { return teardown(doc); };
|
|
21
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
25
22
|
}, []);
|
|
23
|
+
var outerTheme = useTheme();
|
|
24
|
+
var direction = props.direction || outerTheme.direction || 'ltr';
|
|
25
|
+
var localeValue = useMemo(function () { return (__assign(__assign({}, locale), { langCode: langCode })); }, [locale, langCode]);
|
|
26
26
|
var themeValue = useMemo(function () { return (__assign(__assign({}, theme), { direction: direction })); }, [theme, direction]);
|
|
27
27
|
var baseProviderTheme = useMemo(function () { return (__assign(__assign({}, BASEWEB_THEMES[theme.theme.name]), { direction: direction })); }, [direction, theme]);
|
|
28
|
-
return (_jsx(StyleProvider, __assign({ debug: debug, styleEngine: styleEngine }, { children: _jsx(ThemeProvider, __assign({ theme: themeValue, containerElement: doc === null || doc === void 0 ? void 0 : doc.documentElement }, { children: _jsx(LocaleProvider, __assign({ locale:
|
|
28
|
+
return (_jsx(StyleProvider, __assign({ debug: debug, styleEngine: styleEngine }, { children: _jsx(ThemeProvider, __assign({ theme: themeValue, containerElement: doc === null || doc === void 0 ? void 0 : doc.documentElement, density: density }, { children: _jsx(LocaleProvider, __assign({ locale: localeValue }, { children: _jsx(CustomBaseProvider, __assign({ overrides: overrides, theme: baseProviderTheme }, { children: _jsx(LayersManager, __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));
|
|
29
29
|
}
|
|
30
30
|
function SpacewebProviderWithDoc(_a) {
|
|
31
31
|
var ownerDocument = _a.ownerDocument, children = _a.children, rest = __rest(_a, ["ownerDocument", "children"]);
|
package/esm/stack/stack.js
CHANGED
|
@@ -22,23 +22,16 @@ var getStackClassNames = function (props) {
|
|
|
22
22
|
var direction = props.direction, gap = props.gap;
|
|
23
23
|
var _a = modifyGapParam(gap), prefix = _a.prefix, gapVal = _a.gapVal;
|
|
24
24
|
var stackClassName = [direction === 'horizontal' ? 'flex flex-row' : 'flex flex-col'];
|
|
25
|
-
var stackItemClassName = [
|
|
26
|
-
function (_a) {
|
|
27
|
-
var themeDirection = _a.direction;
|
|
28
|
-
var marginDir = themeDirection === 'rtl' ? 'mr' : 'ml';
|
|
29
|
-
return direction === 'horizontal' ? "".concat(prefix).concat(marginDir, "-").concat(gapVal) : "".concat(prefix, "mt-").concat(gapVal);
|
|
30
|
-
},
|
|
31
|
-
];
|
|
25
|
+
var stackItemClassName = [direction === 'horizontal' ? "".concat(prefix, "ml-").concat(gapVal) : "".concat(prefix, "mt-").concat(gapVal)];
|
|
32
26
|
BREAKPOINTS.forEach(function (bp) {
|
|
33
27
|
if (props[bp]) {
|
|
34
28
|
stackClassName.push(props[bp].direction === 'horizontal' ? "".concat(bp, ":flex ").concat(bp, ":flex-row") : "".concat(bp, ":flex ").concat(bp, ":flex-col"));
|
|
35
|
-
var _a = modifyGapParam(props[bp].gap),
|
|
36
|
-
stackItemClassName.push(function (
|
|
37
|
-
var
|
|
38
|
-
var marginDir = themeDirection === 'rtl' ? 'mr' : 'ml';
|
|
29
|
+
var _a = modifyGapParam(props[bp].gap), prefixBp_1 = _a.prefix, gapValBp_1 = _a.gapVal;
|
|
30
|
+
stackItemClassName.push(function () {
|
|
31
|
+
var marginDir = 'ml';
|
|
39
32
|
return props[bp].direction === 'horizontal'
|
|
40
|
-
? "".concat(bp, ":").concat(
|
|
41
|
-
: "".concat(bp, ":").concat(
|
|
33
|
+
? "".concat(bp, ":").concat(prefixBp_1).concat(marginDir, "-").concat(gapValBp_1, " ").concat(bp, ":mt-0")
|
|
34
|
+
: "".concat(bp, ":").concat(prefixBp_1, "mt-").concat(gapValBp_1, " ").concat(bp, ":").concat(marginDir, "-0");
|
|
42
35
|
});
|
|
43
36
|
}
|
|
44
37
|
});
|
|
@@ -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/esm/style/_buildUtils.js
CHANGED
|
@@ -2,7 +2,9 @@ import { __assign } from "tslib";
|
|
|
2
2
|
import _getStyle from './_getStyle';
|
|
3
3
|
import _css from './_css';
|
|
4
4
|
import _px2rem from './_px2rem';
|
|
5
|
-
export default (function (
|
|
5
|
+
export default (function (_ctx, styletronCSS) {
|
|
6
|
+
// console.log('theme', _ctx.theme);
|
|
7
|
+
var ctx = __assign(__assign({}, _ctx), { isRTL: _ctx.direction === 'rtl' });
|
|
6
8
|
var css = _css.bind(null, ctx, styletronCSS);
|
|
7
9
|
var getStyle = _getStyle.bind(null, ctx);
|
|
8
10
|
var px2rem = _px2rem.bind(null, ctx);
|
package/esm/style/_parseStyle.js
CHANGED
|
@@ -5,7 +5,6 @@ import { __read } from "tslib";
|
|
|
5
5
|
/* eslint @typescript-eslint/no-use-before-define: 0, @typescript-eslint/no-explicit-any: 0 */
|
|
6
6
|
import _flattenDeep from 'lodash/flattenDeep';
|
|
7
7
|
import _merge from 'lodash/merge';
|
|
8
|
-
import _escapeClassName from './_escapeClassName';
|
|
9
8
|
export var PSEUDO_SELECTORS = {
|
|
10
9
|
hover: ':hover',
|
|
11
10
|
focus: ':focus',
|
|
@@ -26,7 +25,7 @@ var _parseStyle = function (utils, props) {
|
|
|
26
25
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
27
26
|
args[_i - 2] = arguments[_i];
|
|
28
27
|
}
|
|
29
|
-
var invalidArgs = [];
|
|
28
|
+
var invalidArgs = [], directionStyleObject;
|
|
30
29
|
if (!args.length)
|
|
31
30
|
return [{}, invalidArgs];
|
|
32
31
|
var styleObject = flattenDeep(args).reduce(function (mergedStyleObject, arg) {
|
|
@@ -39,18 +38,19 @@ var _parseStyle = function (utils, props) {
|
|
|
39
38
|
var _a = __read(className.split(':'), 2), prefix = _a[0], prefixedClassName = _a[1];
|
|
40
39
|
if (utils.theme.screens[prefix]) {
|
|
41
40
|
var mediaQuery = "@media screen and (min-width: ".concat(utils.theme.screens[prefix], ")");
|
|
42
|
-
mergedStyleObject[mediaQuery] = Object.assign(mergedStyleObject[mediaQuery] || {}, utils.classes[
|
|
41
|
+
mergedStyleObject[mediaQuery] = Object.assign(mergedStyleObject[mediaQuery] || {}, utils.classes[prefixedClassName]);
|
|
43
42
|
isInvalidClassName = false;
|
|
44
43
|
}
|
|
45
44
|
if (PSEUDO_SELECTORS[prefix]) {
|
|
46
45
|
var prefixKey = PSEUDO_SELECTORS[prefix];
|
|
47
|
-
mergedStyleObject[prefixKey] = Object.assign(mergedStyleObject[prefixKey] || {}, utils.classes[
|
|
46
|
+
mergedStyleObject[prefixKey] = Object.assign(mergedStyleObject[prefixKey] || {}, utils.classes[prefixedClassName]);
|
|
48
47
|
isInvalidClassName = false;
|
|
49
48
|
}
|
|
50
49
|
}
|
|
51
|
-
var utilityStyle = utils.classes[
|
|
52
|
-
if (utilityStyle)
|
|
50
|
+
var utilityStyle = utils.classes[className];
|
|
51
|
+
if (utilityStyle) {
|
|
53
52
|
Object.assign(mergedStyleObject, utilityStyle);
|
|
53
|
+
}
|
|
54
54
|
else if (isInvalidClassName)
|
|
55
55
|
invalidArgs.push(className);
|
|
56
56
|
});
|
|
@@ -63,6 +63,11 @@ var _parseStyle = function (utils, props) {
|
|
|
63
63
|
}
|
|
64
64
|
return _merge(mergedStyleObject, arg);
|
|
65
65
|
}, {});
|
|
66
|
-
|
|
66
|
+
/**
|
|
67
|
+
* merging directionStyles at last to make sure priority of styles with ltr/rtl pseudo selector is more.
|
|
68
|
+
* e.g. `rtl:ml-2 ml-3` -> ml-2 should be applied when direction is rtl
|
|
69
|
+
*/
|
|
70
|
+
var styleObjectWithRtlStyles = directionStyleObject ? _merge(styleObject, directionStyleObject) : styleObject;
|
|
71
|
+
return [styleObjectWithRtlStyles, invalidArgs];
|
|
67
72
|
};
|
|
68
73
|
export default _parseStyle;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* styletron returns new `styletronCSS` function each time the hook is called. This hook memorizes the css function and returns same reference every time.
|
|
3
3
|
*/
|
|
4
|
-
declare const useMemoizedStyletron: () => [(
|
|
4
|
+
declare const useMemoizedStyletron: () => [(a: import("styletron-standard").StyleObject) => string, import("baseui").Theme];
|
|
5
5
|
export default useMemoizedStyletron;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { __read } from "tslib";
|
|
2
2
|
import { useStyletron } from 'baseui';
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
|
+
import rtlCSSJS from 'rtl-css-js';
|
|
4
5
|
import { useLatest } from '../hooks/useLatest';
|
|
6
|
+
import { useTheme } from '../theme/context';
|
|
7
|
+
var identity = function (x) { return x; };
|
|
5
8
|
/**
|
|
6
9
|
* styletron returns new `styletronCSS` function each time the hook is called. This hook memorizes the css function and returns same reference every time.
|
|
7
10
|
*/
|
|
8
11
|
var useMemoizedStyletron = function () {
|
|
9
12
|
var _a = __read(useStyletron(), 2), styletronCSS = _a[0], theme = _a[1];
|
|
13
|
+
var ctx = useTheme();
|
|
10
14
|
var cssRef = useLatest(styletronCSS);
|
|
11
|
-
var
|
|
15
|
+
var decorator = ctx.direction === 'rtl' ? rtlCSSJS : identity;
|
|
16
|
+
var css = useCallback(function (arg) { return cssRef.current(decorator(arg)); }, [cssRef, decorator]);
|
|
12
17
|
return [css, theme];
|
|
13
18
|
};
|
|
14
19
|
export default useMemoizedStyletron;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
-
import { Sheet } from '
|
|
3
|
-
import { StandardEngine } from '../types';
|
|
2
|
+
import { StandardEngine, Sheet } from '../types';
|
|
4
3
|
export declare type ProviderProps = {
|
|
5
4
|
styleEngine?: StandardEngine;
|
|
6
5
|
debug?: boolean;
|
|
@@ -5,6 +5,7 @@ import '@testing-library/jest-dom/extend-expect';
|
|
|
5
5
|
import { Switch } from '../index';
|
|
6
6
|
import { TestProvider, getCSSFromEl, getTestStyleUtils, setupBreakpoints } from '../../test-utils/test-provider';
|
|
7
7
|
import { mount } from 'enzyme';
|
|
8
|
+
import * as React from 'react';
|
|
8
9
|
var renderSwitch = function (_a) {
|
|
9
10
|
var _b = _a.size, size = _b === void 0 ? 'md' : _b, _c = _a.intent, intent = _c === void 0 ? 'default' : _c, rest = __rest(_a, ["size", "intent"]);
|
|
10
11
|
return render(_jsx(TestProvider, { children: _jsx(Switch, __assign({ size: size, intent: intent }, rest, { children: "Switch Label" }), void 0) }, void 0));
|
|
@@ -91,4 +92,16 @@ describe('Switch', function () {
|
|
|
91
92
|
});
|
|
92
93
|
});
|
|
93
94
|
});
|
|
95
|
+
describe('inputRef', function () {
|
|
96
|
+
test('refObject should have the reference of input.', function () {
|
|
97
|
+
var inputRef = React.createRef();
|
|
98
|
+
var container = renderSwitch({ inputRef: inputRef }).container;
|
|
99
|
+
expect(inputRef.current).toBe(container.querySelector('input'));
|
|
100
|
+
});
|
|
101
|
+
test('refCallback should be called with input ref.', function () {
|
|
102
|
+
var inputRefCallback = jest.fn();
|
|
103
|
+
var container = renderSwitch({ inputRef: inputRefCallback }).container;
|
|
104
|
+
expect(inputRefCallback).toHaveBeenCalledWith(container.querySelector('input'));
|
|
105
|
+
});
|
|
106
|
+
});
|
|
94
107
|
});
|
|
@@ -2,10 +2,9 @@ import { __assign } from "tslib";
|
|
|
2
2
|
import { hex2rgb } from '../helpers';
|
|
3
3
|
import { borderRadius, margin } from '../helpers/longHandHelpers';
|
|
4
4
|
import { intentColor } from '../helpers/intentHelper';
|
|
5
|
-
import { getOutlineStyles } from '../helpers/commonStyles';
|
|
6
5
|
var getTrackBackgroundColor = function (utils, props) {
|
|
7
6
|
var theme = utils.theme;
|
|
8
|
-
var $disabled = props.$disabled, $checked = props.$checked
|
|
7
|
+
var $disabled = props.$disabled, $checked = props.$checked;
|
|
9
8
|
if ($disabled) {
|
|
10
9
|
if ($checked) {
|
|
11
10
|
return hex2rgb(intentColor(utils, props), '0.5');
|
|
@@ -15,19 +14,12 @@ var getTrackBackgroundColor = function (utils, props) {
|
|
|
15
14
|
if ($checked) {
|
|
16
15
|
return intentColor(utils, props);
|
|
17
16
|
}
|
|
18
|
-
|
|
19
|
-
return hex2rgb(theme.spr.interactive01, '0.2');
|
|
20
|
-
}
|
|
21
|
-
return theme.spr.ui03;
|
|
17
|
+
return theme.spr.icon03;
|
|
22
18
|
};
|
|
23
19
|
export var getToggleTrackOverrides = function (utils, props) {
|
|
24
|
-
var px2rem = utils.px2rem;
|
|
25
|
-
var $size = props.$size, $isFocusVisible = props.$isFocusVisible;
|
|
26
|
-
var styles = __assign(__assign(
|
|
27
|
-
? __assign({}, getOutlineStyles(utils, {
|
|
28
|
-
$outlineOffset: '2px',
|
|
29
|
-
$outlineWidth: '2px',
|
|
30
|
-
})) : {}));
|
|
20
|
+
var px2rem = utils.px2rem, getStyle = utils.getStyle;
|
|
21
|
+
var $size = props.$size, $isFocusVisible = props.$isFocusVisible, $isHovered = props.$isHovered, $checked = props.$checked, $disabled = props.$disabled;
|
|
22
|
+
var styles = __assign(__assign({ height: px2rem(16), width: px2rem(28), backgroundColor: getTrackBackgroundColor(utils, props) }, borderRadius(px2rem(27))), { boxShadow: 'none' });
|
|
31
23
|
switch ($size) {
|
|
32
24
|
case 'lg':
|
|
33
25
|
styles.height = px2rem(20);
|
|
@@ -40,16 +32,17 @@ export var getToggleTrackOverrides = function (utils, props) {
|
|
|
40
32
|
default:
|
|
41
33
|
break;
|
|
42
34
|
}
|
|
43
|
-
return
|
|
35
|
+
return getStyle([
|
|
36
|
+
'box-border border-1 m-0 border-transparent border-solid flex-none',
|
|
37
|
+
($isHovered || $isFocusVisible) && !$checked && !$disabled ? 'spr-border-06' : '',
|
|
38
|
+
$isFocusVisible ? 'outline-01' : '',
|
|
39
|
+
styles,
|
|
40
|
+
]);
|
|
44
41
|
};
|
|
45
42
|
export var getToggleOverrides = function (utils, props) {
|
|
46
|
-
var px2rem = utils.px2rem,
|
|
43
|
+
var px2rem = utils.px2rem, theme = utils.theme, getStyle = utils.getStyle;
|
|
47
44
|
var $size = props.$size, $checked = props.$checked, $disabled = props.$disabled, $isFocusVisible = props.$isFocusVisible;
|
|
48
|
-
var styles = __assign(__assign(__assign(
|
|
49
|
-
? {
|
|
50
|
-
boxShadow: 'none',
|
|
51
|
-
}
|
|
52
|
-
: {}));
|
|
45
|
+
var styles = __assign(__assign(__assign({ backgroundColor: $disabled ? theme.spr.ui03 : theme.spr.ui01, height: px2rem(12), width: px2rem(12) }, margin(px2rem(1))), borderRadius('50%')), { transform: $checked ? 'translateX(100%)' : '', transition: 'transform 200ms', boxShadow: 'none' });
|
|
53
46
|
switch ($size) {
|
|
54
47
|
case 'lg':
|
|
55
48
|
styles.height = styles.width = px2rem(16);
|
|
@@ -60,7 +53,7 @@ export var getToggleOverrides = function (utils, props) {
|
|
|
60
53
|
default:
|
|
61
54
|
break;
|
|
62
55
|
}
|
|
63
|
-
return styles;
|
|
56
|
+
return getStyle(['flex items-center box-border', styles]);
|
|
64
57
|
};
|
|
65
58
|
export var getLabelOverrides = function (_a, _b) {
|
|
66
59
|
var px2rem = _a.px2rem, theme = _a.theme;
|
package/esm/switch/switch.js
CHANGED
|
@@ -3,13 +3,16 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { Checkbox, StatefulCheckbox } from '../checkbox';
|
|
4
4
|
import { STYLE_TYPE } from 'baseui/checkbox';
|
|
5
5
|
import { useSwitchAdapter } from './basewebAdapter';
|
|
6
|
+
import { useCombineRefObjects } from '../hooks/useCombinedRef';
|
|
6
7
|
export var Switch = function (props) {
|
|
7
8
|
var _a = useSwitchAdapter(props), overrides = _a.overrides, restProps = __rest(_a, ["overrides"]);
|
|
8
|
-
|
|
9
|
+
var inputRefObj = useCombineRefObjects(props.inputRef);
|
|
10
|
+
return (_jsx(Checkbox, __assign({ overrides: overrides, "data-spaceweb": "Switch", checkmarkType: STYLE_TYPE.toggle_round, labelPlacement: "right" }, restProps, { inputRef: inputRefObj }), void 0));
|
|
9
11
|
};
|
|
10
12
|
Switch.displayName = 'Switch';
|
|
11
13
|
export var StatefulSwitch = function (props) {
|
|
12
14
|
var _a = useSwitchAdapter(props), overrides = _a.overrides, restProps = __rest(_a, ["overrides"]);
|
|
13
|
-
|
|
15
|
+
var inputRefObj = useCombineRefObjects(props.inputRef);
|
|
16
|
+
return (_jsx(StatefulCheckbox, __assign({ overrides: overrides, "data-spaceweb": "StatefulSwitch", checkmarkType: STYLE_TYPE.toggle_round, labelPlacement: "right" }, restProps, { inputRef: inputRefObj }), void 0));
|
|
14
17
|
};
|
|
15
18
|
StatefulSwitch.displayName = 'StatefulSwitch';
|
package/esm/switch/types.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { CheckboxProps as BaseSwitchProps, StatefulCheckboxProps as BaseStatefulSwitchProps } from '
|
|
1
|
+
import { CheckboxProps as BaseSwitchProps, StatefulCheckboxProps as BaseStatefulSwitchProps } from '../checkbox';
|
|
2
2
|
import { SharedProps as BaseSharedProps } from 'baseui/input';
|
|
3
|
-
import { OutlineProps } from '../helpers/commonStyles';
|
|
4
3
|
import { Override } from '../overrides';
|
|
5
|
-
import { Intent
|
|
4
|
+
import { Intent } from '../types';
|
|
6
5
|
export declare type SwitchSize = 'sm' | 'md' | 'lg';
|
|
7
6
|
export declare type LabelPlacement = 'left' | 'right' | 'top' | 'bottom';
|
|
8
7
|
export declare type SharedProps = BaseSharedProps & {
|
|
@@ -12,17 +11,15 @@ export declare type SharedProps = BaseSharedProps & {
|
|
|
12
11
|
$isHovered: boolean;
|
|
13
12
|
$size: SwitchSize;
|
|
14
13
|
};
|
|
15
|
-
export declare type SwitchProps =
|
|
14
|
+
export declare type SwitchProps = Omit<BaseSwitchProps, 'overrides' | 'size'> & {
|
|
16
15
|
size?: SwitchSize;
|
|
17
|
-
intent?: Intent;
|
|
18
16
|
overrides?: {
|
|
19
|
-
[key in keyof BaseSwitchProps['overrides']]?: Override<SharedProps>;
|
|
17
|
+
[key in keyof Required<BaseSwitchProps>['overrides']]?: Override<SharedProps>;
|
|
20
18
|
};
|
|
21
|
-
}
|
|
22
|
-
export declare type StatefulSwitchProps =
|
|
19
|
+
};
|
|
20
|
+
export declare type StatefulSwitchProps = Omit<BaseStatefulSwitchProps, 'overrides' | 'size'> & {
|
|
23
21
|
size?: SwitchSize;
|
|
24
|
-
intent?: Intent;
|
|
25
22
|
overrides?: {
|
|
26
|
-
[key in keyof BaseStatefulSwitchProps['overrides']]?: Override<SharedProps>;
|
|
23
|
+
[key in keyof Required<BaseStatefulSwitchProps>['overrides']]?: Override<SharedProps>;
|
|
27
24
|
};
|
|
28
|
-
}
|
|
25
|
+
};
|