@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
package/phone-input/utils.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.countrySelectFilterOptions = exports.getPhoneNumberWithCountryDialCode = exports.sanitize = exports.iso2FlagEmoji = void 0;
|
|
3
|
+
exports.getDefaultValue = exports.countrySelectFilterOptions = exports.getPhoneNumberWithCountryDialCode = exports.sanitize = exports.iso2FlagEmoji = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
|
+
var isEmpty_1 = (0, tslib_1.__importDefault)(require("lodash/isEmpty"));
|
|
5
6
|
var default_filter_options_1 = require("../select/utils/default-filter-options");
|
|
6
7
|
var constants_1 = require("./constants");
|
|
8
|
+
var default_props_1 = require("./default-props");
|
|
7
9
|
var iso2FlagEmoji = function (iso) {
|
|
8
10
|
if (!constants_1.ISO_REGEX.test(iso)) {
|
|
9
|
-
return;
|
|
11
|
+
return undefined;
|
|
10
12
|
}
|
|
11
13
|
var chars = Array.from(iso.toUpperCase()).map(function (char) { return char.charCodeAt(0) + constants_1.ISO_TO_FLAG_OFFSET; });
|
|
12
14
|
return String.fromCodePoint.apply(String, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(chars), false));
|
|
@@ -19,16 +21,20 @@ var sanitize = function (value) {
|
|
|
19
21
|
exports.sanitize = sanitize;
|
|
20
22
|
var getPhoneNumberWithCountryDialCode = function (value) {
|
|
21
23
|
if (value === undefined || value.country === undefined || value.phoneNumber === undefined) {
|
|
22
|
-
return;
|
|
24
|
+
return undefined;
|
|
23
25
|
}
|
|
24
26
|
return value.country.dialCode.concat(value.phoneNumber);
|
|
25
27
|
};
|
|
26
28
|
exports.getPhoneNumberWithCountryDialCode = getPhoneNumberWithCountryDialCode;
|
|
27
29
|
var countrySelectFilterOptions = function (options, filterValue, excludeOptions, params) {
|
|
28
|
-
return (0, default_filter_options_1.filterOptions)(options, filterValue, excludeOptions, (0, tslib_1.__assign)((0, tslib_1.__assign)({}, params), { filterOption: function (_a,
|
|
30
|
+
return (0, default_filter_options_1.filterOptions)(options, filterValue, excludeOptions, (0, tslib_1.__assign)((0, tslib_1.__assign)({}, params), { filterOption: function (_a, _filterValue) {
|
|
29
31
|
var label = _a.label, dialCode = _a.dialCode;
|
|
30
|
-
var filterValueLowerCase =
|
|
32
|
+
var filterValueLowerCase = _filterValue.toLowerCase();
|
|
31
33
|
return label.toLowerCase().includes(filterValueLowerCase) || dialCode.includes(filterValueLowerCase);
|
|
32
34
|
} }));
|
|
33
35
|
};
|
|
34
36
|
exports.countrySelectFilterOptions = countrySelectFilterOptions;
|
|
37
|
+
var getDefaultValue = function (countries) {
|
|
38
|
+
return countries && !(0, isEmpty_1.default)(countries) ? { country: constants_1.COUNTRIES[countries[0].id], phoneNumber: '' } : default_props_1.defaultValue;
|
|
39
|
+
};
|
|
40
|
+
exports.getDefaultValue = getDefaultValue;
|
package/popover/adapter.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ACCESSIBILITY_TYPE, PLACEMENT, TRIGGER_TYPE } from 'baseui/popover';
|
|
2
2
|
import { AccessibilityType, TriggerType, Placement } from './types';
|
|
3
3
|
import { ValueOf } from '../utility-types';
|
|
4
|
-
export declare const accessibilityMap: Record<AccessibilityType, ValueOf<ACCESSIBILITY_TYPE>>;
|
|
5
|
-
export declare const triggerTypeMap: Record<TriggerType, ValueOf<TRIGGER_TYPE>>;
|
|
6
|
-
export declare const placementMap: Record<Placement, ValueOf<PLACEMENT>>;
|
|
4
|
+
export declare const accessibilityMap: Record<AccessibilityType, ValueOf<typeof ACCESSIBILITY_TYPE>>;
|
|
5
|
+
export declare const triggerTypeMap: Record<TriggerType, ValueOf<typeof TRIGGER_TYPE>>;
|
|
6
|
+
export declare const placementMap: Record<Placement, ValueOf<typeof PLACEMENT>>;
|
|
7
|
+
export declare const rtlPlacementMap: Record<Placement, ValueOf<typeof PLACEMENT>>;
|
package/popover/adapter.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.placementMap = exports.triggerTypeMap = exports.accessibilityMap = void 0;
|
|
3
|
+
exports.rtlPlacementMap = exports.placementMap = exports.triggerTypeMap = exports.accessibilityMap = void 0;
|
|
4
4
|
var popover_1 = require("baseui/popover");
|
|
5
5
|
exports.accessibilityMap = {
|
|
6
6
|
menu: popover_1.ACCESSIBILITY_TYPE.menu,
|
|
@@ -26,3 +26,18 @@ exports.placementMap = {
|
|
|
26
26
|
rightTop: popover_1.PLACEMENT.rightTop,
|
|
27
27
|
rightBottom: popover_1.PLACEMENT.rightBottom,
|
|
28
28
|
};
|
|
29
|
+
exports.rtlPlacementMap = {
|
|
30
|
+
auto: popover_1.PLACEMENT.auto,
|
|
31
|
+
bottom: popover_1.PLACEMENT.bottom,
|
|
32
|
+
bottomLeft: popover_1.PLACEMENT.bottomRight,
|
|
33
|
+
bottomRight: popover_1.PLACEMENT.bottomLeft,
|
|
34
|
+
top: popover_1.PLACEMENT.top,
|
|
35
|
+
topLeft: popover_1.PLACEMENT.topRight,
|
|
36
|
+
topRight: popover_1.PLACEMENT.topLeft,
|
|
37
|
+
left: popover_1.PLACEMENT.right,
|
|
38
|
+
leftTop: popover_1.PLACEMENT.rightTop,
|
|
39
|
+
leftBottom: popover_1.PLACEMENT.rightBottom,
|
|
40
|
+
right: popover_1.PLACEMENT.left,
|
|
41
|
+
rightTop: popover_1.PLACEMENT.leftTop,
|
|
42
|
+
rightBottom: popover_1.PLACEMENT.leftBottom,
|
|
43
|
+
};
|
package/popover/overrides.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.getInnerStyles = exports.arrowStyles = exports.getBodyStyles = exports.g
|
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var utils_1 = require("./utils");
|
|
6
6
|
var constants_1 = require("./constants");
|
|
7
|
+
var longHandHelpers_1 = require("../helpers/longHandHelpers");
|
|
7
8
|
var arrowPositionStyle = function (_a, _b) {
|
|
8
9
|
var theme = _a.theme;
|
|
9
10
|
var _c = _b.$placement, $placement = _c === void 0 ? 'bottom' : _c;
|
|
@@ -33,16 +34,7 @@ exports.getPseudoElementPosition = getPseudoElementPosition;
|
|
|
33
34
|
var getBodyStyles = function (_a, _b) {
|
|
34
35
|
var theme = _a.theme;
|
|
35
36
|
var _c = _b.$placement, $placement = _c === void 0 ? 'bottom' : _c, _d = _b.$popoverMargin, $popoverMargin = _d === void 0 ? 0 : _d, $showArrow = _b.$showArrow, rest = (0, tslib_1.__rest)(_b, ["$placement", "$popoverMargin", "$showArrow"]);
|
|
36
|
-
return ({
|
|
37
|
-
backgroundColor: theme.spr.popup,
|
|
38
|
-
color: theme.spr.text01,
|
|
39
|
-
boxShadow: 'none',
|
|
40
|
-
borderTopLeftRadius: theme.popover.borderRadius,
|
|
41
|
-
borderTopRightRadius: theme.popover.borderRadius,
|
|
42
|
-
borderBottomRightRadius: theme.popover.borderRadius,
|
|
43
|
-
borderBottomLeftRadius: theme.popover.borderRadius,
|
|
44
|
-
'::before': (0, tslib_1.__assign)({ content: '" "', position: 'absolute' }, (0, exports.getPseudoElementPosition)($placement, $showArrow ? $popoverMargin + constants_1.ARROW_WIDTH : $popoverMargin)),
|
|
45
|
-
});
|
|
37
|
+
return ((0, tslib_1.__assign)((0, tslib_1.__assign)({ backgroundColor: theme.spr.popup, color: theme.spr.text01, boxShadow: 'none' }, (0, longHandHelpers_1.borderRadius)(theme.popover.borderRadius)), { '::before': (0, tslib_1.__assign)({ content: '" "', position: 'absolute' }, (0, exports.getPseudoElementPosition)($placement, $showArrow ? $popoverMargin + constants_1.ARROW_WIDTH : $popoverMargin)) }));
|
|
46
38
|
};
|
|
47
39
|
exports.getBodyStyles = getBodyStyles;
|
|
48
40
|
exports.arrowStyles = [
|
|
@@ -62,13 +54,10 @@ exports.arrowStyles = [
|
|
|
62
54
|
},
|
|
63
55
|
arrowPositionStyle,
|
|
64
56
|
];
|
|
65
|
-
exports.getInnerStyles = [
|
|
57
|
+
exports.getInnerStyles = [
|
|
58
|
+
'border-solid border-1 spr-popup-border spr-shadow-02 spr-text-01 spr-popup',
|
|
59
|
+
function (_a) {
|
|
66
60
|
var theme = _a.theme;
|
|
67
|
-
return ({
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
borderBottomRightRadius: theme.popover.borderRadius,
|
|
71
|
-
borderBottomLeftRadius: theme.popover.borderRadius,
|
|
72
|
-
fontFamily: theme.fontFamily.sans,
|
|
73
|
-
});
|
|
74
|
-
}];
|
|
61
|
+
return ((0, tslib_1.__assign)((0, tslib_1.__assign)({}, (0, longHandHelpers_1.borderRadius)(theme.popover.borderRadius)), { fontFamily: theme.fontFamily.sans }));
|
|
62
|
+
},
|
|
63
|
+
];
|
package/popover/popover.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Popover as BasePopover } from 'baseui/popover';
|
|
2
1
|
import * as React from 'react';
|
|
3
|
-
declare const Popover: React.ForwardRefExoticComponent<Omit<import("baseui/popover").PopoverProps, "overrides" | "
|
|
2
|
+
declare const Popover: React.ForwardRefExoticComponent<Omit<import("baseui/popover").PopoverProps, "children" | "overrides" | "triggerType" | "placement"> & {
|
|
4
3
|
overrides?: ({
|
|
5
4
|
Body?: import("../overrides").Override<any> | undefined;
|
|
6
5
|
Arrow?: import("../overrides").Override<any> | undefined;
|
|
@@ -12,5 +11,9 @@ declare const Popover: React.ForwardRefExoticComponent<Omit<import("baseui/popov
|
|
|
12
11
|
isOpen: boolean;
|
|
13
12
|
}) => React.ReactNode);
|
|
14
13
|
targetElement?: HTMLElement | null | undefined;
|
|
15
|
-
|
|
14
|
+
triggerType?: import("./types").TriggerType | undefined;
|
|
15
|
+
placement?: "auto" | "bottom" | "left" | "right" | "top" | "topLeft" | "topRight" | "rightTop" | "rightBottom" | "bottomRight" | "bottomLeft" | "leftBottom" | "leftTop" | undefined;
|
|
16
|
+
innerRef?: React.Ref<HTMLElement> | undefined;
|
|
17
|
+
viewportAsBoundary?: boolean | undefined;
|
|
18
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
16
19
|
export default Popover;
|
package/popover/popover.js
CHANGED
|
@@ -4,6 +4,7 @@ var tslib_1 = require("tslib");
|
|
|
4
4
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
var popover_1 = require("baseui/popover");
|
|
6
6
|
var React = (0, tslib_1.__importStar)(require("react"));
|
|
7
|
+
var react_1 = require("react");
|
|
7
8
|
var overrides_1 = require("../overrides");
|
|
8
9
|
var hooks_1 = require("./hooks");
|
|
9
10
|
var useUniqueId_1 = (0, tslib_1.__importDefault)(require("../hooks/useUniqueId"));
|
|
@@ -13,29 +14,35 @@ var layer_1 = require("../layer");
|
|
|
13
14
|
var adapter_1 = require("./adapter");
|
|
14
15
|
var overrides_2 = require("./overrides");
|
|
15
16
|
var styled_components_1 = require("./styled-components");
|
|
17
|
+
var useCombinedRef_1 = (0, tslib_1.__importDefault)(require("../hooks/useCombinedRef"));
|
|
18
|
+
var style_1 = require("../style");
|
|
19
|
+
var utils_1 = require("./utils");
|
|
16
20
|
// @ts-ignore
|
|
17
21
|
popover_1.Popover.displayName = 'BaseUIPopover';
|
|
18
22
|
var Popover = React.forwardRef(function (_a, ref) {
|
|
19
|
-
var overrides = _a.overrides, children = _a.children,
|
|
20
|
-
var
|
|
23
|
+
var overrides = _a.overrides, children = _a.children, _b = _a.placement, placement = _b === void 0 ? 'auto' : _b, accessibilityType = _a.accessibilityType, _c = _a.triggerType, triggerType = _c === void 0 ? 'click' : _c, _d = _a.showArrow, showArrow = _d === void 0 ? false : _d, targetElement = _a.targetElement, isOpen = _a.isOpen, _e = _a.focusLock, focusLock = _e === void 0 ? false : _e, _f = _a.returnFocus, returnFocus = _f === void 0 ? triggerType === 'click' : _f, content = _a.content, popperOptions = _a.popperOptions, ignoreBoundary = _a.ignoreBoundary, viewportAsBoundary = _a.viewportAsBoundary, restProps = (0, tslib_1.__rest)(_a, ["overrides", "children", "placement", "accessibilityType", "triggerType", "showArrow", "targetElement", "isOpen", "focusLock", "returnFocus", "content", "popperOptions", "ignoreBoundary", "viewportAsBoundary"]);
|
|
24
|
+
var _g = (0, hooks_1.useContent)({ content: content }), setContentHost = _g.setContentHost, wrappedContent = _g.wrappedContent;
|
|
25
|
+
var isRTL = (0, style_1.useStyle)().isRTL;
|
|
21
26
|
var focusLockProps = (0, hooks_1.useFocusLock)({ returnFocus: returnFocus, focusLock: focusLock });
|
|
22
|
-
var
|
|
27
|
+
var _h = (0, tslib_1.__read)((0, overrides_1.useOverrides)(overrides === null || overrides === void 0 ? void 0 : overrides.ArrowTriangle, styled_components_1.StyledArrowTriangle), 2), ArrowTriangle = _h[0], arrowTriangleProps = _h[1];
|
|
23
28
|
var _overrides = (0, useConvertOverrides_1.useConvertOverrides)({
|
|
24
29
|
Body: { style: overrides_2.getBodyStyles },
|
|
25
30
|
Arrow: { style: overrides_2.arrowStyles, props: { children: (0, jsx_runtime_1.jsx)(ArrowTriangle, (0, tslib_1.__assign)({}, arrowTriangleProps), void 0) } },
|
|
26
31
|
Inner: { style: overrides_2.getInnerStyles, props: { ref: setContentHost } },
|
|
27
32
|
}, overrides, [overrides, setContentHost]);
|
|
28
33
|
var mappedProps = {
|
|
29
|
-
placement: placement && adapter_1.placementMap[placement],
|
|
34
|
+
placement: placement && isRTL ? adapter_1.rtlPlacementMap[placement] : adapter_1.placementMap[placement],
|
|
30
35
|
accessibilityType: accessibilityType && adapter_1.accessibilityMap[accessibilityType],
|
|
31
36
|
triggerType: triggerType && adapter_1.triggerTypeMap[triggerType],
|
|
32
37
|
};
|
|
38
|
+
var combinedRef = (0, useCombinedRef_1.default)(ref, restProps.innerRef);
|
|
33
39
|
var childNode = children;
|
|
34
40
|
if (typeof children === 'function') {
|
|
35
41
|
childNode = children({ isOpen: isOpen });
|
|
36
42
|
}
|
|
37
43
|
var id = (0, useUniqueId_1.default)();
|
|
38
|
-
|
|
44
|
+
var mergedPopperOptions = (0, react_1.useMemo)(function () { return ((0, tslib_1.__assign)((0, tslib_1.__assign)({}, (0, utils_1.getPopperOptions)({ ignoreBoundary: ignoreBoundary, viewportAsBoundary: viewportAsBoundary })), popperOptions)); }, [popperOptions, ignoreBoundary, viewportAsBoundary]);
|
|
45
|
+
return ((0, jsx_runtime_1.jsx)(layer_1.LayersManager, (0, tslib_1.__assign)({ zIndex: layer_1.Z_INDEX.POPOVER }, { children: (0, jsx_runtime_1.jsx)(popover_1.Popover, (0, tslib_1.__assign)({ id: id }, restProps, mappedProps, { showArrow: showArrow, isOpen: isOpen, overrides: _overrides, innerRef: combinedRef, content: wrappedContent }, focusLockProps, { popperOptions: mergedPopperOptions }, { children: (0, jsx_runtime_1.jsx)(PopoverEnahncer_1.PopoverChildEnhancer, (0, tslib_1.__assign)({ targetElement: targetElement }, { children: childNode }), void 0) }), void 0) }), void 0));
|
|
39
46
|
});
|
|
40
47
|
Popover.displayName = 'Popover';
|
|
41
48
|
exports.default = Popover;
|
|
@@ -6,8 +6,8 @@ var popover_1 = require("baseui/popover");
|
|
|
6
6
|
var popover_2 = (0, tslib_1.__importDefault)(require("./popover"));
|
|
7
7
|
var constants_1 = require("./constants");
|
|
8
8
|
function StatefulPopover(props) {
|
|
9
|
-
var children = props.children, _a = props.overrides, overrides = _a === void 0 ? {} : _a, restProps = (0, tslib_1.__rest)(props, ["children", "overrides"]);
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)(popover_1.StatefulContainer, (0, tslib_1.__assign)({}, restProps, { children: function (popoverProps) { return ((0, jsx_runtime_1.jsx)(popover_2.default, (0, tslib_1.__assign)({}, popoverProps, { overrides: overrides }, { children: children }), void 0)); } }), void 0));
|
|
9
|
+
var children = props.children, _a = props.overrides, overrides = _a === void 0 ? {} : _a, targetElement = props.targetElement, viewportAsBoundary = props.viewportAsBoundary, restProps = (0, tslib_1.__rest)(props, ["children", "overrides", "targetElement", "viewportAsBoundary"]);
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)(popover_1.StatefulContainer, (0, tslib_1.__assign)({}, restProps, { children: function (popoverProps) { return ((0, jsx_runtime_1.jsx)(popover_2.default, (0, tslib_1.__assign)({}, popoverProps, { overrides: overrides, targetElement: targetElement, viewportAsBoundary: viewportAsBoundary }, { children: children }), void 0)); } }), void 0));
|
|
11
11
|
}
|
|
12
12
|
StatefulPopover.defaultProps = {
|
|
13
13
|
accessibilityType: 'menu',
|
package/popover/types.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { TetherPlacement } from 'baseui/layer';
|
|
2
3
|
import { PopoverProps as BasePopoverProps, StatefulPopoverProps as BaseStatefulPopoverProps, StatefulPopoverContainerProps as BaseStatefulPopoverContainerProps, PopoverOverrides as BasePopoverOverrides } from 'baseui/popover';
|
|
3
4
|
import { Override } from '../overrides';
|
|
4
|
-
export declare type PopoverProps = Omit<BasePopoverProps, 'overrides' | 'children'> & {
|
|
5
|
+
export declare type PopoverProps = Omit<BasePopoverProps, 'overrides' | 'children' | 'triggerType' | 'placement'> & {
|
|
5
6
|
overrides?: {
|
|
6
7
|
[key in keyof BasePopoverOverrides]?: Override<any>;
|
|
7
8
|
} & {
|
|
@@ -11,6 +12,10 @@ export declare type PopoverProps = Omit<BasePopoverProps, 'overrides' | 'childre
|
|
|
11
12
|
isOpen: boolean;
|
|
12
13
|
}) => React.ReactNode);
|
|
13
14
|
targetElement?: HTMLElement | null;
|
|
15
|
+
triggerType?: TriggerType;
|
|
16
|
+
placement?: TetherPlacement;
|
|
17
|
+
innerRef?: React.Ref<HTMLElement>;
|
|
18
|
+
viewportAsBoundary?: boolean;
|
|
14
19
|
};
|
|
15
20
|
export declare type StatefulPopoverProps = Omit<BaseStatefulPopoverProps, 'overrides' | 'children'> & {
|
|
16
21
|
overrides?: {
|
|
@@ -19,6 +24,8 @@ export declare type StatefulPopoverProps = Omit<BaseStatefulPopoverProps, 'overr
|
|
|
19
24
|
children?: React.ReactNode | ((args: {
|
|
20
25
|
isOpen: boolean;
|
|
21
26
|
}) => React.ReactNode);
|
|
27
|
+
targetElement?: HTMLElement | null;
|
|
28
|
+
viewportAsBoundary?: boolean;
|
|
22
29
|
};
|
|
23
30
|
export declare type StatefulPopoverContainerProps = Omit<BaseStatefulPopoverContainerProps, 'overrides'> & {
|
|
24
31
|
overrides?: {
|
|
@@ -29,4 +36,5 @@ export declare type AccessibilityType = 'none' | 'menu' | 'tooltip';
|
|
|
29
36
|
export declare type TriggerType = 'click' | 'hover';
|
|
30
37
|
export declare type Placement = 'auto' | 'top' | 'topLeft' | 'topRight' | 'right' | 'rightTop' | 'rightBottom' | 'bottom' | 'bottomLeft' | 'bottomRight' | 'left' | 'leftTop' | 'leftBottom';
|
|
31
38
|
export type { Offset, SharedStylePropsArg as SharedProps, StateReducer, } from 'baseui/popover';
|
|
32
|
-
export {
|
|
39
|
+
export { STATE_CHANGE_TYPE, ANIMATE_IN_TIME, ANIMATE_OUT_TIME } from 'baseui/popover';
|
|
40
|
+
export { ARROW_SIZE, ARROW_WIDTH, POPOVER_MARGIN } from 'baseui/popover/constants';
|
package/popover/types.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.POPOVER_MARGIN = exports.ARROW_WIDTH = exports.ARROW_SIZE = exports.ANIMATE_OUT_TIME = exports.ANIMATE_IN_TIME = exports.STATE_CHANGE_TYPE = void 0;
|
|
4
4
|
var popover_1 = require("baseui/popover");
|
|
5
|
-
Object.defineProperty(exports, "ARROW_SIZE", { enumerable: true, get: function () { return popover_1.ARROW_SIZE; } });
|
|
6
|
-
Object.defineProperty(exports, "ARROW_WIDTH", { enumerable: true, get: function () { return popover_1.ARROW_WIDTH; } });
|
|
7
|
-
Object.defineProperty(exports, "POPOVER_MARGIN", { enumerable: true, get: function () { return popover_1.POPOVER_MARGIN; } });
|
|
8
5
|
Object.defineProperty(exports, "STATE_CHANGE_TYPE", { enumerable: true, get: function () { return popover_1.STATE_CHANGE_TYPE; } });
|
|
9
6
|
Object.defineProperty(exports, "ANIMATE_IN_TIME", { enumerable: true, get: function () { return popover_1.ANIMATE_IN_TIME; } });
|
|
10
7
|
Object.defineProperty(exports, "ANIMATE_OUT_TIME", { enumerable: true, get: function () { return popover_1.ANIMATE_OUT_TIME; } });
|
|
8
|
+
var constants_1 = require("baseui/popover/constants");
|
|
9
|
+
Object.defineProperty(exports, "ARROW_SIZE", { enumerable: true, get: function () { return constants_1.ARROW_SIZE; } });
|
|
10
|
+
Object.defineProperty(exports, "ARROW_WIDTH", { enumerable: true, get: function () { return constants_1.ARROW_WIDTH; } });
|
|
11
|
+
Object.defineProperty(exports, "POPOVER_MARGIN", { enumerable: true, get: function () { return constants_1.POPOVER_MARGIN; } });
|
package/popover/utils.d.ts
CHANGED
|
@@ -12,3 +12,15 @@ export declare function splitPlacement(placement: Placement): string[];
|
|
|
12
12
|
* left -> right
|
|
13
13
|
*/
|
|
14
14
|
export declare function getOppositePosition(position: string): string;
|
|
15
|
+
export declare const getPopperOptions: ({ ignoreBoundary, viewportAsBoundary, }: {
|
|
16
|
+
ignoreBoundary?: boolean | undefined;
|
|
17
|
+
viewportAsBoundary?: boolean | undefined;
|
|
18
|
+
}) => {
|
|
19
|
+
modifiers: {
|
|
20
|
+
preventOverflow: {
|
|
21
|
+
boundariesElement?: string | undefined;
|
|
22
|
+
enabled: boolean;
|
|
23
|
+
padding: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
package/popover/utils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOppositePosition = exports.splitPlacement = void 0;
|
|
3
|
+
exports.getPopperOptions = exports.getOppositePosition = exports.splitPlacement = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
4
5
|
/**
|
|
5
6
|
* Splits something like 'topLeft' to ['top', 'left'] for easier usage
|
|
6
7
|
* https://github.com/uber/baseweb/blob/master/src/popover/utils.js#L58
|
|
@@ -30,3 +31,12 @@ function getOppositePosition(position) {
|
|
|
30
31
|
return OPPOSITE_POSITIONS[position];
|
|
31
32
|
}
|
|
32
33
|
exports.getOppositePosition = getOppositePosition;
|
|
34
|
+
var getPopperOptions = function (_a) {
|
|
35
|
+
var ignoreBoundary = _a.ignoreBoundary, viewportAsBoundary = _a.viewportAsBoundary;
|
|
36
|
+
return ({
|
|
37
|
+
modifiers: {
|
|
38
|
+
preventOverflow: (0, tslib_1.__assign)({ enabled: !ignoreBoundary, padding: 0 }, (viewportAsBoundary && { boundariesElement: 'viewport' })),
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
exports.getPopperOptions = getPopperOptions;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const VIEWBOX_SIZE = 44;
|
|
1
2
|
export declare const getProgressInlineStyles: ({ strokeWidth, value, infinite, }: {
|
|
2
3
|
strokeWidth: number;
|
|
3
4
|
value: number;
|
|
@@ -5,7 +6,6 @@ export declare const getProgressInlineStyles: ({ strokeWidth, value, infinite, }
|
|
|
5
6
|
}) => {
|
|
6
7
|
strokeDashoffset: string;
|
|
7
8
|
};
|
|
8
|
-
export declare const VIEWBOX_SIZE = 44;
|
|
9
9
|
export declare const StyledRoot: import("../../style/styled").StyledComponent;
|
|
10
10
|
export declare const StyledBarContainer: import("../../style/styled").StyledComponent;
|
|
11
11
|
export declare const StyledSvg: import("../../style/styled").StyledComponent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StyledLabel = exports.StyledLabelContainer = exports.StyledProgress = exports.StyledBar = exports.StyledSvg = exports.StyledBarContainer = exports.StyledRoot = exports.
|
|
3
|
+
exports.StyledLabel = exports.StyledLabelContainer = exports.StyledProgress = exports.StyledBar = exports.StyledSvg = exports.StyledBarContainer = exports.StyledRoot = exports.getProgressInlineStyles = exports.VIEWBOX_SIZE = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
var style_1 = require("../../style");
|
|
@@ -14,6 +14,7 @@ var BaseProgress = function (_a) {
|
|
|
14
14
|
var inlineStyles = _a.inlineStyles, props = (0, tslib_1.__rest)(_a, ["inlineStyles"]);
|
|
15
15
|
return ((0, jsx_runtime_1.jsx)("circle", (0, tslib_1.__assign)({ style: inlineStyles }, props), void 0));
|
|
16
16
|
};
|
|
17
|
+
exports.VIEWBOX_SIZE = 44;
|
|
17
18
|
var getProgressInlineStyles = function (_a) {
|
|
18
19
|
var strokeWidth = _a.strokeWidth, value = _a.value, infinite = _a.infinite;
|
|
19
20
|
var circumference = 2 * Math.PI * ((exports.VIEWBOX_SIZE - strokeWidth) / 2);
|
|
@@ -22,7 +23,6 @@ var getProgressInlineStyles = function (_a) {
|
|
|
22
23
|
};
|
|
23
24
|
};
|
|
24
25
|
exports.getProgressInlineStyles = getProgressInlineStyles;
|
|
25
|
-
exports.VIEWBOX_SIZE = 44;
|
|
26
26
|
exports.StyledRoot = (0, style_1.styled)('span', 'relative inline-flex', function (_a, _b) {
|
|
27
27
|
var px2rem = _a.px2rem;
|
|
28
28
|
var $size = _b.$size;
|
|
@@ -62,14 +62,14 @@ exports.StyledBar = (0, style_1.styled)('circle', function (_a, _b) {
|
|
|
62
62
|
cx: px2rem(exports.VIEWBOX_SIZE),
|
|
63
63
|
cy: px2rem(exports.VIEWBOX_SIZE),
|
|
64
64
|
r: px2rem((exports.VIEWBOX_SIZE - $strokeWidth) / 2),
|
|
65
|
-
strokeWidth: $strokeWidth,
|
|
65
|
+
strokeWidth: $strokeWidth.toString(),
|
|
66
66
|
});
|
|
67
67
|
});
|
|
68
68
|
exports.StyledProgress = (0, style_1.styled)(BaseProgress, 'stroke-current', { fill: 'none' }, function (_a, _b) {
|
|
69
69
|
var px2rem = _a.px2rem;
|
|
70
70
|
var $infinite = _b.$infinite, $value = _b.$value, $strokeWidth = _b.$strokeWidth;
|
|
71
71
|
var circumference = 2 * Math.PI * ((exports.VIEWBOX_SIZE - $strokeWidth) / 2);
|
|
72
|
-
return (0, tslib_1.__assign)({ cx: px2rem(exports.VIEWBOX_SIZE), cy: px2rem(exports.VIEWBOX_SIZE), r: px2rem((exports.VIEWBOX_SIZE - $strokeWidth) / 2), strokeWidth: $strokeWidth }, (!$infinite
|
|
72
|
+
return (0, tslib_1.__assign)({ cx: px2rem(exports.VIEWBOX_SIZE), cy: px2rem(exports.VIEWBOX_SIZE), r: px2rem((exports.VIEWBOX_SIZE - $strokeWidth) / 2), strokeWidth: $strokeWidth.toString() }, (!$infinite
|
|
73
73
|
? {
|
|
74
74
|
willChange: 'strokeDashoffset',
|
|
75
75
|
transitionTimingFunction: 'ease',
|
|
@@ -8,7 +8,7 @@ export declare const StyledRoot: import("../../style/styled").StyledComponent;
|
|
|
8
8
|
export declare const StyledBar: import("../../style/styled").StyledComponent;
|
|
9
9
|
export declare const StyledProgress: import("../../style/styled").StyledComponent;
|
|
10
10
|
export declare const StyledLabel: import("../../style/styled").StyledComponent;
|
|
11
|
-
export declare const progressSegmentStyles: ({
|
|
11
|
+
export declare const progressSegmentStyles: ({ isRTL }: StyleUtils, { $first, $last }: {
|
|
12
12
|
$first: any;
|
|
13
13
|
$last: any;
|
|
14
14
|
}) => string[];
|
|
@@ -24,10 +24,10 @@ exports.StyledBar = (0, style_1.styled)('div', 'w-full relative overflow-hidden
|
|
|
24
24
|
});
|
|
25
25
|
exports.StyledProgress = (0, style_1.styled)(BaseProgress, 'h-full', function (_a, _b) {
|
|
26
26
|
var _c, _d, _e;
|
|
27
|
-
var theme = _a.theme,
|
|
27
|
+
var theme = _a.theme, isRTL = _a.isRTL;
|
|
28
28
|
var $color = _b.$color, $intent = _b.$intent, $value = _b.$value, $infinite = _b.$infinite;
|
|
29
|
-
var progressStart =
|
|
30
|
-
var progressEnd =
|
|
29
|
+
var progressStart = isRTL ? 'right' : 'left';
|
|
30
|
+
var progressEnd = isRTL ? 'left' : 'right';
|
|
31
31
|
return (0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)({ backgroundColor: $color || (0, helper_1.getIntentColor)($intent, theme), willChange: 'width' }, (0, longHandHelpers_1.borderRadius)('3px')), { transitionProperty: 'width', transitionTimingFunction: 'ease', transitionDuration: '400ms' }), ($infinite && {
|
|
32
32
|
width: '100%',
|
|
33
33
|
position: 'absolute',
|
|
@@ -52,10 +52,10 @@ exports.StyledProgress = (0, style_1.styled)(BaseProgress, 'h-full', function (_
|
|
|
52
52
|
});
|
|
53
53
|
exports.StyledLabel = (0, style_1.styled)('div', 'spr-text-02 mt-3 typography-l2', { fontVariantNumeric: 'tabular-nums' });
|
|
54
54
|
var progressSegmentStyles = function (_a, _b) {
|
|
55
|
-
var
|
|
55
|
+
var isRTL = _a.isRTL;
|
|
56
56
|
var $first = _b.$first, $last = _b.$last;
|
|
57
57
|
var style = [];
|
|
58
|
-
if (
|
|
58
|
+
if (isRTL) {
|
|
59
59
|
if (!$first)
|
|
60
60
|
style.push('rounded-r-0');
|
|
61
61
|
if (!$last)
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { Radio as BaseRadio, RadioGroup as BaseRadioGroup } from 'baseui/radio';
|
|
3
3
|
import { RadioGroupProps, RadioProps, Size } from './types';
|
|
4
4
|
import { Intent } from '../types';
|
|
5
|
-
export declare const SpaceRadioContext:
|
|
5
|
+
export declare const SpaceRadioContext: React.Context<{
|
|
6
6
|
size?: Size | undefined;
|
|
7
7
|
intent?: Intent | undefined;
|
|
8
8
|
}>;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
export declare const useRadioAdapter: <T extends RadioProps>(props: T) => Omit<T, "style" | "className" | "$outlineColor" | "$outlineWidth" | "$outlineOffset" | "$outlineStyle"> & {
|
|
15
|
-
overrides: RadioOverrides;
|
|
16
|
-
};
|
|
9
|
+
declare type BaseuiRadioGroupProps = React.ComponentProps<typeof BaseRadioGroup>;
|
|
10
|
+
export declare function useRadioGroupAdapter(props: RadioGroupProps): BaseuiRadioGroupProps;
|
|
11
|
+
declare type BaseuiRadioProps = React.ComponentProps<typeof BaseRadio>;
|
|
12
|
+
export declare const useRadioAdapter: (props: RadioProps) => BaseuiRadioProps;
|
|
13
|
+
export {};
|
package/radio/basewebAdapters.js
CHANGED
|
@@ -7,6 +7,7 @@ var helpers_1 = require("../helpers");
|
|
|
7
7
|
var useConvertOverrides_1 = require("../helpers/baseui/useConvertOverrides");
|
|
8
8
|
var styled_components_1 = require("./styled-components");
|
|
9
9
|
var context_1 = require("../form-control/context");
|
|
10
|
+
var useCombinedRef_1 = require("../hooks/useCombinedRef");
|
|
10
11
|
exports.SpaceRadioContext = (0, react_1.createContext)({
|
|
11
12
|
size: 'md',
|
|
12
13
|
intent: 'default',
|
|
@@ -19,7 +20,7 @@ function useRadioGroupAdapter(props) {
|
|
|
19
20
|
style: [className, style],
|
|
20
21
|
},
|
|
21
22
|
}, overrides);
|
|
22
|
-
return
|
|
23
|
+
return (0, tslib_1.__assign)((0, tslib_1.__assign)({}, restProps), { overrides: convertOverrides, onMouseEnter: props.onMouseEnter, onMouseLeave: props.onMouseLeave, onFocus: props.onFocus, onBlur: props.onBlur });
|
|
23
24
|
}
|
|
24
25
|
exports.useRadioGroupAdapter = useRadioGroupAdapter;
|
|
25
26
|
var useRadioAdapter = function (props) {
|
|
@@ -44,8 +45,10 @@ var useRadioAdapter = function (props) {
|
|
|
44
45
|
props: sharedProps,
|
|
45
46
|
},
|
|
46
47
|
// https://prod-gitlab.sprinklr.com/sprinklr/frontend/spaceweb/-/issues/472 - baseui adds position absolute
|
|
47
|
-
|
|
48
|
+
// static position gives unexpected behaviour in Safari. Using position fixed works well for the above issue and Safari as well.
|
|
49
|
+
Input: { style: { position: 'fixed' } },
|
|
48
50
|
}, props.overrides);
|
|
49
|
-
|
|
51
|
+
var inputRefObj = (0, useCombinedRef_1.useCombineRefObjects)(props.inputRef);
|
|
52
|
+
return (0, tslib_1.__assign)((0, tslib_1.__assign)({}, restProps), { overrides: overrides, onMouseEnter: props.onMouseEnter, onMouseLeave: props.onMouseLeave, onFocus: props.onFocus, onBlur: props.onBlur, inputRef: inputRefObj });
|
|
50
53
|
};
|
|
51
54
|
exports.useRadioAdapter = useRadioAdapter;
|
package/radio/radio.js
CHANGED
|
@@ -6,6 +6,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
6
6
|
var radio_1 = require("baseui/radio");
|
|
7
7
|
var react_1 = require("react");
|
|
8
8
|
var basewebAdapters_1 = require("./basewebAdapters");
|
|
9
|
+
var context_1 = require("../form-control/context");
|
|
9
10
|
// @ts-ignore
|
|
10
11
|
radio_1.Radio.displayName = 'BaseUIRadio';
|
|
11
12
|
// @ts-ignore
|
|
@@ -17,11 +18,11 @@ var Radio = function (props) {
|
|
|
17
18
|
exports.Radio = Radio;
|
|
18
19
|
exports.Radio.displayName = 'Radio';
|
|
19
20
|
var RadioGroup = function (props) {
|
|
20
|
-
var adaptedProps = (0, basewebAdapters_1.useRadioGroupAdapter)(props)
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
]);
|
|
21
|
+
var adaptedProps = (0, basewebAdapters_1.useRadioGroupAdapter)(props);
|
|
22
|
+
var _a = (0, context_1.useContextualFormProps)(props, {
|
|
23
|
+
intent: 'default',
|
|
24
|
+
}), formIntent = _a.intent, _b = _a.size, formSize = _b === void 0 ? 'md' : _b;
|
|
25
|
+
var memoizedProviderValue = (0, react_1.useMemo)(function () { return ({ size: formSize, intent: formIntent }); }, [formSize, formIntent]);
|
|
25
26
|
return ((0, jsx_runtime_1.jsx)(basewebAdapters_1.SpaceRadioContext.Provider, (0, tslib_1.__assign)({ value: memoizedProviderValue }, { children: (0, jsx_runtime_1.jsx)(radio_1.RadioGroup, (0, tslib_1.__assign)({}, adaptedProps), void 0) }), void 0));
|
|
26
27
|
};
|
|
27
28
|
exports.RadioGroup = RadioGroup;
|
|
@@ -76,7 +76,7 @@ var getRadioMarkOuterStyles = function (utils, props) {
|
|
|
76
76
|
exports.getRadioMarkOuterStyles = getRadioMarkOuterStyles;
|
|
77
77
|
var getRadioLabelStyles = function (_a, _b) {
|
|
78
78
|
var _c;
|
|
79
|
-
var
|
|
79
|
+
var px2rem = _a.px2rem;
|
|
80
80
|
var $labelPosition = _b.$labelPosition, $size = _b.$size;
|
|
81
81
|
var paddingDirection;
|
|
82
82
|
switch ($labelPosition) {
|
|
@@ -87,11 +87,11 @@ var getRadioLabelStyles = function (_a, _b) {
|
|
|
87
87
|
paddingDirection = 'Top';
|
|
88
88
|
break;
|
|
89
89
|
case 'left':
|
|
90
|
-
paddingDirection =
|
|
90
|
+
paddingDirection = 'Right';
|
|
91
91
|
break;
|
|
92
92
|
default:
|
|
93
93
|
case 'right':
|
|
94
|
-
paddingDirection =
|
|
94
|
+
paddingDirection = 'Left';
|
|
95
95
|
break;
|
|
96
96
|
}
|
|
97
97
|
var styles = (_c = {
|
|
@@ -117,25 +117,23 @@ var getRadioLabelStyles = function (_a, _b) {
|
|
|
117
117
|
exports.getRadioLabelStyles = getRadioLabelStyles;
|
|
118
118
|
var getRootStyles = function (_a, _b) {
|
|
119
119
|
var _c;
|
|
120
|
-
var
|
|
120
|
+
var px2rem = _a.px2rem;
|
|
121
121
|
var $align = _b.$align, $hasDescription = _b.$hasDescription, $size = _b.$size;
|
|
122
122
|
var isHorizontal = $align === 'horizontal';
|
|
123
|
-
var directionMargin =
|
|
123
|
+
var directionMargin = 'Right';
|
|
124
124
|
var styles = (_c = {},
|
|
125
125
|
_c["margin".concat(directionMargin)] = isHorizontal ? px2rem(30) : undefined,
|
|
126
|
-
_c.marginTop =
|
|
127
|
-
_c.marginBottom = $hasDescription
|
|
126
|
+
_c.marginTop = '0px',
|
|
127
|
+
_c.marginBottom = isHorizontal || $hasDescription ? undefined : px2rem(6),
|
|
128
128
|
_c);
|
|
129
129
|
switch ($size) {
|
|
130
130
|
case 'md':
|
|
131
131
|
styles["margin".concat(directionMargin)] = isHorizontal ? px2rem(38) : undefined;
|
|
132
|
-
styles.
|
|
133
|
-
styles.marginBottom = $hasDescription && !isHorizontal ? undefined : px2rem(8);
|
|
132
|
+
styles.marginBottom = isHorizontal || $hasDescription ? undefined : px2rem(8);
|
|
134
133
|
break;
|
|
135
134
|
case 'lg':
|
|
136
135
|
styles["margin".concat(directionMargin)] = isHorizontal ? px2rem(46) : undefined;
|
|
137
|
-
styles.
|
|
138
|
-
styles.marginBottom = $hasDescription && !isHorizontal ? undefined : px2rem(10);
|
|
136
|
+
styles.marginBottom = isHorizontal || $hasDescription ? undefined : px2rem(10);
|
|
139
137
|
break;
|
|
140
138
|
default:
|
|
141
139
|
break;
|
package/radio/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { RadioGroupProps as BaseRadioGroupProps, RadioProps as BaseRadioProps, RadioOverrides, RadioGroupOverrides } from 'baseui/radio';
|
|
2
3
|
import { Intent, SpacewebComponentProps } from '../types';
|
|
3
4
|
import { Override } from '../overrides';
|
|
@@ -21,17 +22,23 @@ export declare type SharedProps = {
|
|
|
21
22
|
$size?: Size;
|
|
22
23
|
$labelPosition?: LabelPosition;
|
|
23
24
|
};
|
|
24
|
-
|
|
25
|
+
declare type CommonProps = {
|
|
26
|
+
onMouseEnter?: (e: React.MouseEvent<HTMLInputElement>) => unknown;
|
|
27
|
+
onMouseLeave?: (e: React.MouseEvent<HTMLInputElement>) => unknown;
|
|
28
|
+
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => unknown;
|
|
29
|
+
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => unknown;
|
|
25
30
|
size?: Size;
|
|
26
31
|
intent?: Intent;
|
|
32
|
+
};
|
|
33
|
+
export declare type RadioProps = SpacewebComponentProps<Omit<BaseRadioProps, 'overrides' | 'isError' | keyof CommonProps>> & {
|
|
27
34
|
overrides?: {
|
|
28
35
|
[key in keyof RadioOverrides]?: Override<SharedProps>;
|
|
29
36
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
size?: Size;
|
|
37
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
38
|
+
} & OutlineProps & CommonProps;
|
|
39
|
+
export declare type RadioGroupProps = SpacewebComponentProps<Omit<BaseRadioGroupProps, 'overrides' | keyof CommonProps>> & {
|
|
34
40
|
overrides?: {
|
|
35
41
|
[key in keyof RadioGroupOverrides]?: Override<SharedProps>;
|
|
36
42
|
};
|
|
37
|
-
};
|
|
43
|
+
} & CommonProps;
|
|
44
|
+
export {};
|
package/search/index.d.ts
CHANGED
package/search/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Search = void 0;
|
|
3
|
+
exports.StatefulSearch = exports.Search = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var search_1 = require("./search");
|
|
6
6
|
Object.defineProperty(exports, "Search", { enumerable: true, get: function () { return search_1.Search; } });
|
|
7
|
+
var stateful_search_1 = require("./stateful-search");
|
|
8
|
+
Object.defineProperty(exports, "StatefulSearch", { enumerable: true, get: function () { return stateful_search_1.StatefulSearch; } });
|
|
7
9
|
(0, tslib_1.__exportStar)(require("./types"), exports);
|
package/search/search.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ import { IconButtonProps } from '../button/IconButton';
|
|
|
3
3
|
import { SearchProps } from './types';
|
|
4
4
|
export declare const ClearIconButton: ({ overrides, ...props }: IconButtonProps) => ReactElement;
|
|
5
5
|
export declare const Search: {
|
|
6
|
-
({ size, debounceInterval, placeholder, overrides, className, style, variant, ...props }: SearchProps): ReactElement;
|
|
6
|
+
({ size: _size, debounceInterval, placeholder, overrides, className, style, variant, ...props }: SearchProps): ReactElement;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|