@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
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { PaymentCardOverrides as BasePaymentCardOverrides } from 'baseui/payment-card';
|
|
2
2
|
import { PaymentCardProps, StatefulPaymentCardProps } from './types';
|
|
3
3
|
declare type AdapterProps = Omit<PaymentCardProps | StatefulPaymentCardProps, 'autoFocus'>;
|
|
4
|
+
declare type BaseWebCardSize = 'default' | 'mini' | 'compact';
|
|
4
5
|
declare const usePaymentCardBasewebAdapter: (props: AdapterProps) => Omit<AdapterProps, 'size' | 'variant' | 'className' | 'overrides' | 'style' | 'intent'> & {
|
|
5
6
|
overrides?: BasePaymentCardOverrides;
|
|
7
|
+
size: BaseWebCardSize;
|
|
6
8
|
};
|
|
7
9
|
export default usePaymentCardBasewebAdapter;
|
|
@@ -1,12 +1,35 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
|
+
import _pick from 'lodash/pick';
|
|
2
3
|
import { useContextualFormProps } from '../form-control/context';
|
|
3
4
|
import useInputBasewebAdapter from '../input/basewebAdapters';
|
|
4
5
|
import { getIconWrapperStyles } from './styled-components';
|
|
5
6
|
import { add$props } from '../helpers';
|
|
6
7
|
import { mergeOverrides } from '../overrides';
|
|
8
|
+
import { SIZE } from 'baseui/input';
|
|
9
|
+
import { getDefaultSize } from '../helpers/themeHelpers';
|
|
10
|
+
import { useStyle } from '../style/';
|
|
11
|
+
var getBasewebPaymentCardSizeMap = function (_size) {
|
|
12
|
+
switch (_size) {
|
|
13
|
+
case 'lg':
|
|
14
|
+
return SIZE.default;
|
|
15
|
+
case 'md':
|
|
16
|
+
return SIZE.default;
|
|
17
|
+
case 'sm':
|
|
18
|
+
return SIZE.compact;
|
|
19
|
+
case 'xs':
|
|
20
|
+
return SIZE.compact;
|
|
21
|
+
case 'xxxs':
|
|
22
|
+
return SIZE.mini;
|
|
23
|
+
default:
|
|
24
|
+
return SIZE.default;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
7
27
|
var usePaymentCardBasewebAdapter = function (props) {
|
|
8
|
-
var _a
|
|
9
|
-
var
|
|
28
|
+
var _a, _b;
|
|
29
|
+
var contextualProps = useContextualFormProps(props);
|
|
30
|
+
var sharedProps = add$props(_pick(contextualProps, ['size', 'variant', 'intent']));
|
|
31
|
+
var theme = useStyle().theme;
|
|
32
|
+
var _size = (_b = (_a = contextualProps.size) !== null && _a !== void 0 ? _a : sharedProps.$size) !== null && _b !== void 0 ? _b : getDefaultSize(theme);
|
|
10
33
|
var basePaymentCardStyles = {
|
|
11
34
|
Input: {
|
|
12
35
|
style: { paddingLeft: '0px' },
|
|
@@ -16,7 +39,7 @@ var usePaymentCardBasewebAdapter = function (props) {
|
|
|
16
39
|
props: sharedProps,
|
|
17
40
|
},
|
|
18
41
|
};
|
|
19
|
-
var adaptedProps = useInputBasewebAdapter(__assign(__assign({},
|
|
20
|
-
return adaptedProps;
|
|
42
|
+
var adaptedProps = useInputBasewebAdapter(__assign(__assign({}, contextualProps), { overrides: mergeOverrides(basePaymentCardStyles, contextualProps.overrides) }));
|
|
43
|
+
return __assign(__assign({}, adaptedProps), { size: getBasewebPaymentCardSizeMap(_size) });
|
|
21
44
|
};
|
|
22
45
|
export default usePaymentCardBasewebAdapter;
|
|
@@ -1,12 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import { getComponentSizeTheme, getDefaultSize } from '../helpers/themeHelpers';
|
|
3
|
+
// todo: fix this and derive from input styles
|
|
4
|
+
var SIZES_STYLES_MAP = {
|
|
5
|
+
xxxs: {
|
|
6
|
+
height: '22px',
|
|
7
|
+
},
|
|
8
|
+
xs: {
|
|
9
|
+
height: '30px',
|
|
10
|
+
},
|
|
11
|
+
sm: {
|
|
12
|
+
height: '34px',
|
|
13
|
+
},
|
|
14
|
+
md: {
|
|
15
|
+
height: '38px',
|
|
16
|
+
},
|
|
17
|
+
lg: {
|
|
18
|
+
height: '38px',
|
|
19
|
+
},
|
|
20
|
+
};
|
|
2
21
|
export var getIconWrapperStyles = function (_a, _b) {
|
|
3
22
|
var theme = _a.theme;
|
|
4
23
|
var $size = _b.$size;
|
|
5
|
-
var styles = {
|
|
6
|
-
|
|
7
|
-
marginRight: '',
|
|
8
|
-
};
|
|
9
|
-
var inputSizeTheme = getComponentSizeTheme(theme, 'input', $size, 'lg');
|
|
24
|
+
var styles = __assign({ marginLeft: '', marginRight: '', lineHeight: '', fontSize: '', borderRadius: '' }, SIZES_STYLES_MAP[$size]);
|
|
25
|
+
var inputSizeTheme = getComponentSizeTheme(theme, 'input', $size, getDefaultSize(theme));
|
|
10
26
|
styles.marginLeft = styles.marginRight = inputSizeTheme.paddingX;
|
|
27
|
+
styles.fontSize = inputSizeTheme.fontSize;
|
|
28
|
+
styles.lineHeight = inputSizeTheme.lineHeight;
|
|
29
|
+
styles.borderRadius = (inputSizeTheme === null || inputSizeTheme === void 0 ? void 0 : inputSizeTheme.borderRadius) || theme.input.borderRadius;
|
|
11
30
|
return styles;
|
|
12
31
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
1
2
|
import { PaymentCardProps as BasePaymentCardProps, StatefulPaymentCardProps as BaseStatefulPaymentCardProps, PaymentCardOverrides as BasePaymentCardOverrides } from 'baseui/payment-card';
|
|
2
3
|
import { Override } from '../overrides';
|
|
3
4
|
import { SpacewebComponentProps, Intent } from '../types';
|
|
@@ -11,7 +12,8 @@ declare type CommonInputProps = {
|
|
|
11
12
|
overrides?: PaymentCardOverrides;
|
|
12
13
|
intent?: Intent;
|
|
13
14
|
autoFocus?: FocusPosition;
|
|
15
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
14
16
|
};
|
|
15
|
-
export declare type PaymentCardProps = Omit<SpacewebComponentProps<BasePaymentCardProps>, 'size' | 'overrides' | 'positive' | 'error' | 'autoFocus'> & CommonInputProps;
|
|
16
|
-
export declare type StatefulPaymentCardProps = Omit<SpacewebComponentProps<BaseStatefulPaymentCardProps>, 'size' | 'overrides' | 'positive' | 'error' | 'autoFocus'> & CommonInputProps;
|
|
17
|
+
export declare type PaymentCardProps = Omit<SpacewebComponentProps<BasePaymentCardProps>, 'size' | 'overrides' | 'positive' | 'error' | 'autoFocus' | 'inputRef'> & CommonInputProps;
|
|
18
|
+
export declare type StatefulPaymentCardProps = Omit<SpacewebComponentProps<BaseStatefulPaymentCardProps>, 'size' | 'overrides' | 'positive' | 'error' | 'autoFocus' | 'inputRef'> & CommonInputProps;
|
|
17
19
|
export {};
|
|
@@ -10,6 +10,6 @@ var CountrySelectContainer = function (props) {
|
|
|
10
10
|
var _a = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.CountrySelectContainer, StyledCountrySelectContainer), 2), CountrySelectComponent = _a[0], countrySelectContainerProps = _a[1];
|
|
11
11
|
var countrySelectProps = __assign(__assign({}, props), { overrides: _pick(overrides, ['CountrySelect', 'FlagContainer']) });
|
|
12
12
|
var dialCodeProps = __assign(__assign({}, _pick(props, ['size', 'value'])), { overrides: _pick(overrides, ['DialCode']) });
|
|
13
|
-
return (_jsxs(CountrySelectComponent, __assign({}, countrySelectContainerProps, { children: [_jsx(CountrySelect, __assign({}, countrySelectProps), void 0), _jsx(DialCode, __assign({}, dialCodeProps), void 0)] }), void 0));
|
|
13
|
+
return (_jsxs(CountrySelectComponent, __assign({ dir: "ltr" }, countrySelectContainerProps, { children: [_jsx(CountrySelect, __assign({}, countrySelectProps), void 0), _jsx(DialCode, __assign({}, dialCodeProps), void 0)] }), void 0));
|
|
14
14
|
};
|
|
15
15
|
export default CountrySelectContainer;
|
|
@@ -7,7 +7,6 @@ import { Select as DefaultSelect } from '../select';
|
|
|
7
7
|
import { ListItem } from '../list';
|
|
8
8
|
import { Typography } from '../typography';
|
|
9
9
|
import FlagContainer from './flag-container';
|
|
10
|
-
import VirtualizedCountrySelectDropdown from './virtualized-country-select-dropdown';
|
|
11
10
|
import { useLocale } from '../locale';
|
|
12
11
|
import { mergeOverrides, useOverrides } from '../overrides';
|
|
13
12
|
import { iso2FlagEmoji, countrySelectFilterOptions } from './utils';
|
|
@@ -17,7 +16,7 @@ var SelectListItem = React.forwardRef(function (_a, ref) {
|
|
|
17
16
|
return (_jsxs(ListItem, __assign({}, rest, { startEnhancer: iso2FlagEmoji(id), ref: ref }, { children: [dialCode, _jsxs(Typography, __assign({ "data-testid": id, "data-entity-type": "country-label", className: "spr-text-03 ml-1" }, { children: ["(", mapIsoToLabel ? mapIsoToLabel(id) : label, ")"] }), void 0)] }), void 0));
|
|
18
17
|
});
|
|
19
18
|
var CountrySelect = function (props) {
|
|
20
|
-
var size = props.size, disabled = props.disabled, inputRef = props.inputRef, onChange = props.onChange, value = props.value, mapIsoToLabel = props.mapIsoToLabel, maxDropdownHeight = props.maxDropdownHeight, maxDropdownWidth = props.maxDropdownWidth, overrides = props.overrides;
|
|
19
|
+
var size = props.size, disabled = props.disabled, inputRef = props.inputRef, onChange = props.onChange, countries = props.countries, value = props.value, mapIsoToLabel = props.mapIsoToLabel, maxDropdownHeight = props.maxDropdownHeight, maxDropdownWidth = props.maxDropdownWidth, overrides = props.overrides;
|
|
21
20
|
var locale = useLocale();
|
|
22
21
|
var overlayContentContainerRef = useRef();
|
|
23
22
|
var mergedOverrides = useMemo(function () {
|
|
@@ -26,7 +25,6 @@ var CountrySelect = function (props) {
|
|
|
26
25
|
props: {
|
|
27
26
|
overrides: {
|
|
28
27
|
Menu: {
|
|
29
|
-
component: VirtualizedCountrySelectDropdown,
|
|
30
28
|
props: {
|
|
31
29
|
'data-testid': 'country-select-menu',
|
|
32
30
|
parentRef: overlayContentContainerRef,
|
|
@@ -68,7 +66,7 @@ var CountrySelect = function (props) {
|
|
|
68
66
|
},
|
|
69
67
|
},
|
|
70
68
|
}, overrides);
|
|
71
|
-
}, [mapIsoToLabel,
|
|
69
|
+
}, [mapIsoToLabel, overrides, size]);
|
|
72
70
|
var _a = __read(useOverrides(mergedOverrides === null || mergedOverrides === void 0 ? void 0 : mergedOverrides.CountrySelect, DefaultSelect), 2), Select = _a[0], selectProps = _a[1];
|
|
73
71
|
var flagContainerProps = {
|
|
74
72
|
size: size,
|
|
@@ -78,7 +76,7 @@ var CountrySelect = function (props) {
|
|
|
78
76
|
};
|
|
79
77
|
return (
|
|
80
78
|
// @ts-ignore
|
|
81
|
-
_jsx(Select, __assign({ type: "overlay", options: COUNTRY_SELECT_OPTIONS, value: [value.country], onChange: function (params) {
|
|
79
|
+
_jsx(Select, __assign({ type: "overlay", options: countries !== null && countries !== void 0 ? countries : COUNTRY_SELECT_OPTIONS, value: [value.country], onChange: function (params) {
|
|
82
80
|
if (onChange) {
|
|
83
81
|
onChange(__assign(__assign({}, value), { country: params.option }));
|
|
84
82
|
}
|
|
@@ -86,6 +84,6 @@ var CountrySelect = function (props) {
|
|
|
86
84
|
if (inputRef && inputRef.current) {
|
|
87
85
|
inputRef.current.focus();
|
|
88
86
|
}
|
|
89
|
-
}, disabled: disabled, placeholder: locale.phoneInput.countrySelectPlaceholder, maxDropdownHeight: maxDropdownHeight, overlayWidth: maxDropdownWidth, filterOptions: countrySelectFilterOptions }, selectProps, { children: _jsx(FlagContainer, __assign({}, flagContainerProps), void 0) }), void 0));
|
|
87
|
+
}, disabled: disabled, placeholder: locale.phoneInput.countrySelectPlaceholder, maxDropdownHeight: maxDropdownHeight, overlayWidth: maxDropdownWidth, filterOptions: countrySelectFilterOptions, virtual: true }, selectProps, { children: _jsx(FlagContainer, __assign({}, flagContainerProps), void 0) }), void 0));
|
|
90
88
|
};
|
|
91
89
|
export default CountrySelect;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { PhoneInputOverrides, Country } from './types';
|
|
1
|
+
import { InputVariant } from '../input';
|
|
2
|
+
import { Country, PhoneInputOverrides } from './types';
|
|
4
3
|
declare const defaultProps: {
|
|
5
4
|
clearable: boolean;
|
|
6
5
|
focusLock: boolean;
|
|
7
6
|
disabled: boolean;
|
|
8
|
-
intent: Intent;
|
|
9
7
|
maxDropdownHeight: string;
|
|
10
8
|
maxDropdownWidth: string;
|
|
11
9
|
name: undefined;
|
|
@@ -13,11 +11,10 @@ declare const defaultProps: {
|
|
|
13
11
|
overrides: PhoneInputOverrides;
|
|
14
12
|
positive: boolean;
|
|
15
13
|
required: boolean;
|
|
16
|
-
size: InputSize;
|
|
17
14
|
variant: InputVariant;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
};
|
|
16
|
+
export declare const defaultValue: {
|
|
17
|
+
country: Country;
|
|
18
|
+
phoneNumber: string;
|
|
22
19
|
};
|
|
23
20
|
export default defaultProps;
|
|
@@ -3,7 +3,6 @@ var defaultProps = {
|
|
|
3
3
|
clearable: false,
|
|
4
4
|
focusLock: false,
|
|
5
5
|
disabled: false,
|
|
6
|
-
intent: 'default',
|
|
7
6
|
maxDropdownHeight: DEFAULT_MAX_DROPDOWN_HEIGHT,
|
|
8
7
|
maxDropdownWidth: DEFAULT_MAX_DROPDOWN_WIDTH,
|
|
9
8
|
name: undefined,
|
|
@@ -11,15 +10,14 @@ var defaultProps = {
|
|
|
11
10
|
overrides: {},
|
|
12
11
|
positive: false,
|
|
13
12
|
required: false,
|
|
14
|
-
size: 'lg',
|
|
15
13
|
variant: 'default',
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
phoneNumber: '',
|
|
14
|
+
};
|
|
15
|
+
export var defaultValue = {
|
|
16
|
+
country: {
|
|
17
|
+
label: 'United States',
|
|
18
|
+
id: 'US',
|
|
19
|
+
dialCode: '+1',
|
|
23
20
|
},
|
|
21
|
+
phoneNumber: '',
|
|
24
22
|
};
|
|
25
23
|
export default defaultProps;
|
|
@@ -13,6 +13,6 @@ var FlagContainer = forwardRef(function (props, ref) {
|
|
|
13
13
|
var locale = useLocale();
|
|
14
14
|
var sharedProps = add$props({ iso: iso, inputSize: inputSize });
|
|
15
15
|
var _a = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.FlagContainer, DefaultButton), 2), Button = _a[0], buttonProps = _a[1];
|
|
16
|
-
return (_jsx(Button, __assign({ "aria-label": locale.phoneInput.flagContainerAriaLabel, variant: "minimal", size: "
|
|
16
|
+
return (_jsx(Button, __assign({ "aria-label": locale.phoneInput.flagContainerAriaLabel, variant: "minimal", size: "xxxs", type: "button", className: [getFlagContainerStyles], "data-iso": iso, ref: ref }, sharedProps, buttonProps, rest, { children: iso2FlagEmoji(iso) }), void 0));
|
|
17
17
|
});
|
|
18
18
|
export default FlagContainer;
|
|
@@ -6,7 +6,6 @@ declare const PhoneInput: {
|
|
|
6
6
|
clearable: boolean;
|
|
7
7
|
focusLock: boolean;
|
|
8
8
|
disabled: boolean;
|
|
9
|
-
intent: import("..").Intent;
|
|
10
9
|
maxDropdownHeight: string;
|
|
11
10
|
maxDropdownWidth: string;
|
|
12
11
|
name: undefined;
|
|
@@ -14,12 +13,7 @@ declare const PhoneInput: {
|
|
|
14
13
|
overrides: import("./types").PhoneInputOverrides;
|
|
15
14
|
positive: boolean;
|
|
16
15
|
required: boolean;
|
|
17
|
-
size: import("../input").InputSize;
|
|
18
16
|
variant: import("../input").InputVariant;
|
|
19
|
-
value: {
|
|
20
|
-
country: import("./types").Country;
|
|
21
|
-
phoneNumber: string;
|
|
22
|
-
};
|
|
23
17
|
};
|
|
24
18
|
};
|
|
25
19
|
export default PhoneInput;
|
|
@@ -5,26 +5,34 @@ import _pick from 'lodash/pick';
|
|
|
5
5
|
import { Input as DefaultInput } from '../input';
|
|
6
6
|
import CountrySelectContainer from './country-select-container';
|
|
7
7
|
import { getRootStyles, getInputStyles } from './styled-components';
|
|
8
|
-
import { sanitize } from './utils';
|
|
8
|
+
import { getDefaultValue, sanitize } from './utils';
|
|
9
9
|
import { useOverrides, mergeOverrides } from '../overrides';
|
|
10
10
|
import { useLocale } from '../locale';
|
|
11
11
|
import defaultProps from './default-props';
|
|
12
|
+
import { useContextualFormProps } from '../form-control/context';
|
|
13
|
+
import { useStyle } from '../style';
|
|
14
|
+
import { getDefaultSize } from '../helpers/themeHelpers';
|
|
12
15
|
var PhoneInput = function (props) {
|
|
13
|
-
var
|
|
16
|
+
var _a;
|
|
17
|
+
var _b = useContextualFormProps(props), _size = _b.size, variant = _b.variant, intent = _b.intent, disabled = _b.disabled, overrides = _b.overrides, mapIsoToLabel = _b.mapIsoToLabel, maxDropdownHeight = _b.maxDropdownHeight, maxDropdownWidth = _b.maxDropdownWidth, onInputChange = _b.onInputChange, onChange = _b.onChange, propValue = _b.value, countries = _b.countries, rest = __rest(_b, ["size", "variant", "intent", "disabled", "overrides", "mapIsoToLabel", "maxDropdownHeight", "maxDropdownWidth", "onInputChange", "onChange", "value", "countries"]);
|
|
18
|
+
var _c = useStyle(), isRTL = _c.isRTL, theme = _c.theme;
|
|
19
|
+
var size = _size !== null && _size !== void 0 ? _size : getDefaultSize(theme);
|
|
14
20
|
var locale = useLocale();
|
|
15
21
|
var inputRef = useRef(null);
|
|
22
|
+
var value = propValue !== null && propValue !== void 0 ? propValue : getDefaultValue(countries);
|
|
16
23
|
var mergedOverrides = mergeOverrides({
|
|
17
24
|
Input: {
|
|
18
25
|
props: {
|
|
19
|
-
overrides: {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
overrides: (_a = {
|
|
27
|
+
Root: {
|
|
28
|
+
style: getRootStyles,
|
|
29
|
+
props: { $disabled: disabled },
|
|
30
|
+
},
|
|
31
|
+
Input: {
|
|
32
|
+
style: getInputStyles,
|
|
33
|
+
}
|
|
26
34
|
},
|
|
27
|
-
|
|
35
|
+
_a[isRTL ? 'After' : 'Before'] = {
|
|
28
36
|
component: CountrySelectContainer,
|
|
29
37
|
props: {
|
|
30
38
|
size: size,
|
|
@@ -35,14 +43,15 @@ var PhoneInput = function (props) {
|
|
|
35
43
|
mapIsoToLabel: mapIsoToLabel,
|
|
36
44
|
maxDropdownHeight: maxDropdownHeight,
|
|
37
45
|
maxDropdownWidth: maxDropdownWidth,
|
|
46
|
+
countries: countries,
|
|
38
47
|
overrides: _pick(overrides, ['CountrySelect', 'CountrySelectContainer', 'FlagContainer', 'DialCode']),
|
|
39
48
|
},
|
|
40
49
|
},
|
|
41
|
-
|
|
50
|
+
_a),
|
|
42
51
|
},
|
|
43
52
|
},
|
|
44
53
|
}, overrides);
|
|
45
|
-
var
|
|
54
|
+
var _d = __read(useOverrides(mergedOverrides === null || mergedOverrides === void 0 ? void 0 : mergedOverrides.Input, DefaultInput), 2), Input = _d[0], inputProps = _d[1];
|
|
46
55
|
return (_jsx(Input, __assign({ "aria-label": locale.phoneInput.inputAriaLabel, size: size, variant: variant, intent: intent, disabled: disabled, onChange: function (e) {
|
|
47
56
|
var number = sanitize(e.currentTarget.value);
|
|
48
57
|
if (onChange) {
|
|
@@ -2,10 +2,11 @@ import { __assign, __read } from "tslib";
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import defaultProps from './default-props';
|
|
4
4
|
import { STATE_CHANGE_TYPE } from './constants';
|
|
5
|
+
import { getDefaultValue } from './utils';
|
|
5
6
|
var defaultStateReducer = function (type, nextState) { return nextState; };
|
|
6
7
|
var StatefulPhoneInputContainer = function (props) {
|
|
7
|
-
var clearable = props.clearable, disabled = props.disabled, id = props.id,
|
|
8
|
-
var
|
|
8
|
+
var clearable = props.clearable, disabled = props.disabled, id = props.id, initialState = props.initialState, intent = props.intent, maxDropdownHeight = props.maxDropdownHeight, maxDropdownWidth = props.maxDropdownWidth, mapIsoToLabel = props.mapIsoToLabel, name = props.name, _a = props.onChange, onChange = _a === void 0 ? defaultProps.onChange : _a, overrides = props.overrides, placeholder = props.placeholder, required = props.required, size = props.size, _b = props.stateReducer, stateReducer = _b === void 0 ? defaultStateReducer : _b, variant = props.variant, countries = props.countries;
|
|
9
|
+
var _c = __read(useState(initialState !== null && initialState !== void 0 ? initialState : getDefaultValue(countries)), 2), state = _c[0], setState = _c[1];
|
|
9
10
|
var internalSetState = function (type, nextState) {
|
|
10
11
|
setState(stateReducer(type, nextState, state));
|
|
11
12
|
};
|
|
@@ -14,6 +15,6 @@ var StatefulPhoneInputContainer = function (props) {
|
|
|
14
15
|
onChange({ country: country, phoneNumber: phoneNumber });
|
|
15
16
|
internalSetState(STATE_CHANGE_TYPE.onChange, __assign(__assign({}, state), { country: country, phoneNumber: phoneNumber }));
|
|
16
17
|
};
|
|
17
|
-
return props.children(__assign(__assign({}, defaultProps), { 'aria-label': props['aria-label'], 'aria-labelledby': props['aria-labelledby'], 'aria-describedby': props['aria-describedby'], clearable: clearable, disabled: disabled, id: id, intent: intent, maxDropdownHeight: maxDropdownHeight, maxDropdownWidth: maxDropdownWidth, mapIsoToLabel: mapIsoToLabel, name: name, overrides: overrides, placeholder: placeholder, required: required, size: size, variant: variant, value: state, onChange: statefulOnChange }));
|
|
18
|
+
return props.children(__assign(__assign({}, defaultProps), { 'aria-label': props['aria-label'], 'aria-labelledby': props['aria-labelledby'], 'aria-describedby': props['aria-describedby'], clearable: clearable, disabled: disabled, id: id, intent: intent, maxDropdownHeight: maxDropdownHeight, maxDropdownWidth: maxDropdownWidth, mapIsoToLabel: mapIsoToLabel, name: name, overrides: overrides, placeholder: placeholder, required: required, size: size, variant: variant, value: state, onChange: statefulOnChange, countries: countries }));
|
|
18
19
|
};
|
|
19
20
|
export default StatefulPhoneInputContainer;
|
|
@@ -6,7 +6,6 @@ declare const StatefulPhoneInput: {
|
|
|
6
6
|
clearable: boolean;
|
|
7
7
|
focusLock: boolean;
|
|
8
8
|
disabled: boolean;
|
|
9
|
-
intent: import("..").Intent;
|
|
10
9
|
maxDropdownHeight: string;
|
|
11
10
|
maxDropdownWidth: string;
|
|
12
11
|
name: undefined;
|
|
@@ -14,12 +13,7 @@ declare const StatefulPhoneInput: {
|
|
|
14
13
|
overrides: import("./types").PhoneInputOverrides;
|
|
15
14
|
positive: boolean;
|
|
16
15
|
required: boolean;
|
|
17
|
-
size: import("../input").InputSize;
|
|
18
16
|
variant: import("../input").InputVariant;
|
|
19
|
-
value: {
|
|
20
|
-
country: import("./types").Country;
|
|
21
|
-
phoneNumber: string;
|
|
22
|
-
};
|
|
23
17
|
};
|
|
24
18
|
};
|
|
25
19
|
export default StatefulPhoneInput;
|
|
@@ -8,6 +8,14 @@ export declare const getFlagContainerStyles: (string | (({ theme, px2rem }: {
|
|
|
8
8
|
export declare const getRootStyles: ({}: {}, { $disabled }: {
|
|
9
9
|
$disabled: any;
|
|
10
10
|
}) => "cursor-not-allowed" | undefined;
|
|
11
|
-
export declare const getInputStyles
|
|
11
|
+
export declare const getInputStyles: ({ theme, px2rem }: {
|
|
12
|
+
theme: any;
|
|
13
|
+
px2rem: any;
|
|
14
|
+
}, { $size }: {
|
|
15
|
+
$size: any;
|
|
16
|
+
}) => {
|
|
17
|
+
paddingLeft: string;
|
|
18
|
+
paddingRight: string;
|
|
19
|
+
};
|
|
12
20
|
export declare const StyledCountrySelectContainer: import("../style/styled").StyledComponent;
|
|
13
21
|
export declare const StyledDialCode: import("../style/styled").StyledComponent;
|
|
@@ -1,35 +1,49 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
2
|
import { styled } from '../style';
|
|
3
|
+
import { getComponentSizeTheme, getDefaultSize } from '../helpers/themeHelpers';
|
|
3
4
|
var dialCodeSizeConfig = function (px2rem) { return ({
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
xxxs: { fontSize: px2rem(10) },
|
|
6
|
+
xs: { fontSize: px2rem(12) },
|
|
7
|
+
sm: { fontSize: px2rem(14) },
|
|
8
|
+
md: { fontSize: px2rem(16) },
|
|
6
9
|
lg: { fontSize: px2rem(16) },
|
|
7
10
|
}); };
|
|
8
11
|
var getSizeConfig = function (px2rem, size) { var _a; return (_a = dialCodeSizeConfig(px2rem)[size]) !== null && _a !== void 0 ? _a : dialCodeSizeConfig(px2rem).lg; };
|
|
9
12
|
export var getFlagContainerStyles = [
|
|
10
|
-
'min-w-0 spr-ui-05 px-2 text-16 rounded-4',
|
|
13
|
+
'min-w-0 spr-ui-05 px-2 py-0.5 text-16 rounded-4',
|
|
11
14
|
function (_a, _b) {
|
|
12
15
|
var theme = _a.theme, px2rem = _a.px2rem;
|
|
13
16
|
var $inputSize = _b.$inputSize, $isFocusVisible = _b.$isFocusVisible;
|
|
14
|
-
|
|
17
|
+
var inputSizeTheme = getComponentSizeTheme(theme, 'input', $inputSize, getDefaultSize(theme));
|
|
18
|
+
return __assign({ marginLeft: inputSizeTheme.paddingX, marginRight: '0 /* @noflip */' }, ($isFocusVisible && {
|
|
15
19
|
':focus': {
|
|
16
20
|
outline: "1px solid ".concat(theme.spr.focus01),
|
|
17
21
|
},
|
|
18
|
-
}))
|
|
22
|
+
}));
|
|
19
23
|
},
|
|
20
24
|
];
|
|
21
25
|
export var getRootStyles = function (_a, _b) {
|
|
22
26
|
var $disabled = _b.$disabled;
|
|
23
27
|
return ($disabled ? 'cursor-not-allowed' : undefined);
|
|
24
28
|
};
|
|
25
|
-
export var getInputStyles =
|
|
29
|
+
export var getInputStyles = function (_a, _b) {
|
|
30
|
+
var theme = _a.theme, px2rem = _a.px2rem;
|
|
31
|
+
var $size = _b.$size;
|
|
32
|
+
var inputSizeTheme = getComponentSizeTheme(theme, 'input', $size, getDefaultSize(theme));
|
|
33
|
+
return {
|
|
34
|
+
paddingLeft: "".concat(px2rem(4), " /* @noflip */"),
|
|
35
|
+
paddingRight: "".concat(inputSizeTheme.paddingX, " /* @noflip */"),
|
|
36
|
+
};
|
|
37
|
+
};
|
|
26
38
|
export var StyledCountrySelectContainer = styled('div', 'flex items-center');
|
|
27
|
-
export var StyledDialCode = styled('div', 'flex items-center
|
|
39
|
+
export var StyledDialCode = styled('div', 'flex items-center font-medium', function (_a, _b) {
|
|
28
40
|
var px2rem = _a.px2rem;
|
|
29
41
|
var $size = _b.$size;
|
|
30
42
|
var sizeTheme = getSizeConfig(px2rem, $size);
|
|
31
43
|
var styles = {
|
|
32
44
|
fontSize: sizeTheme.fontSize,
|
|
45
|
+
marginLeft: "".concat(px2rem(4), " /* @noflip */"),
|
|
46
|
+
marginRight: '0 /* @noflip */',
|
|
33
47
|
};
|
|
34
48
|
return styles;
|
|
35
49
|
});
|
|
@@ -28,6 +28,7 @@ export declare type PhoneInputProps = Omit<InputProps, 'value' | 'onChange'> & {
|
|
|
28
28
|
value?: Value;
|
|
29
29
|
mapIsoToLabel?: (iso: string) => string;
|
|
30
30
|
maxDropdownHeight?: string;
|
|
31
|
+
countries?: Array<Country>;
|
|
31
32
|
maxDropdownWidth?: string;
|
|
32
33
|
overrides?: PhoneInputOverrides;
|
|
33
34
|
};
|
|
@@ -37,7 +38,7 @@ export declare type StatefulPhoneInputContainerProps = Omit<PhoneInputProps, 'ch
|
|
|
37
38
|
stateReducer?: StateReducer;
|
|
38
39
|
children: (props: PhoneInputProps) => any;
|
|
39
40
|
};
|
|
40
|
-
export declare type CountrySelectContainerProps = Required<Pick<PhoneInputProps, 'size' | 'disabled' | 'onChange' | 'mapIsoToLabel' | 'maxDropdownHeight' | 'maxDropdownWidth'>> & {
|
|
41
|
+
export declare type CountrySelectContainerProps = Required<Pick<PhoneInputProps, 'size' | 'disabled' | 'onChange' | 'mapIsoToLabel' | 'maxDropdownHeight' | 'maxDropdownWidth' | 'countries'>> & {
|
|
41
42
|
overrides?: Pick<PhoneInputOverrides, 'CountrySelectContainer' | 'CountrySelect' | 'FlagContainer' | 'DialCode'>;
|
|
42
43
|
value: State;
|
|
43
44
|
};
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Value } from './types';
|
|
1
|
+
import { Value as ValueT } from '../select/types';
|
|
2
|
+
import { Value, Country } from './types';
|
|
3
3
|
export declare const iso2FlagEmoji: (iso: string) => string | undefined;
|
|
4
4
|
export declare const sanitize: (value?: string) => string;
|
|
5
5
|
export declare const getPhoneNumberWithCountryDialCode: (value: Value) => string | undefined;
|
|
6
|
-
export declare const countrySelectFilterOptions:
|
|
6
|
+
export declare const countrySelectFilterOptions: (options: ValueT, filterValue: string, excludeOptions?: ValueT | undefined | null, params?: {
|
|
7
|
+
valueKey: string;
|
|
8
|
+
labelKey: string;
|
|
9
|
+
}) => ValueT;
|
|
10
|
+
export declare const getDefaultValue: (countries?: Country[] | undefined) => {
|
|
11
|
+
country: Country;
|
|
12
|
+
phoneNumber: string;
|
|
13
|
+
};
|
package/esm/phone-input/utils.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { __assign, __read, __spreadArray } from "tslib";
|
|
2
|
+
import _isEmpty from 'lodash/isEmpty';
|
|
2
3
|
import { filterOptions } from '../select/utils/default-filter-options';
|
|
3
|
-
import { ISO_REGEX, ISO_TO_FLAG_OFFSET } from './constants';
|
|
4
|
+
import { COUNTRIES, ISO_REGEX, ISO_TO_FLAG_OFFSET } from './constants';
|
|
5
|
+
import { defaultValue } from './default-props';
|
|
4
6
|
export var iso2FlagEmoji = function (iso) {
|
|
5
7
|
if (!ISO_REGEX.test(iso)) {
|
|
6
|
-
return;
|
|
8
|
+
return undefined;
|
|
7
9
|
}
|
|
8
10
|
var chars = Array.from(iso.toUpperCase()).map(function (char) { return char.charCodeAt(0) + ISO_TO_FLAG_OFFSET; });
|
|
9
11
|
return String.fromCodePoint.apply(String, __spreadArray([], __read(chars), false));
|
|
@@ -14,14 +16,17 @@ export var sanitize = function (value) {
|
|
|
14
16
|
};
|
|
15
17
|
export var getPhoneNumberWithCountryDialCode = function (value) {
|
|
16
18
|
if (value === undefined || value.country === undefined || value.phoneNumber === undefined) {
|
|
17
|
-
return;
|
|
19
|
+
return undefined;
|
|
18
20
|
}
|
|
19
21
|
return value.country.dialCode.concat(value.phoneNumber);
|
|
20
22
|
};
|
|
21
23
|
export var countrySelectFilterOptions = function (options, filterValue, excludeOptions, params) {
|
|
22
|
-
return filterOptions(options, filterValue, excludeOptions, __assign(__assign({}, params), { filterOption: function (_a,
|
|
24
|
+
return filterOptions(options, filterValue, excludeOptions, __assign(__assign({}, params), { filterOption: function (_a, _filterValue) {
|
|
23
25
|
var label = _a.label, dialCode = _a.dialCode;
|
|
24
|
-
var filterValueLowerCase =
|
|
26
|
+
var filterValueLowerCase = _filterValue.toLowerCase();
|
|
25
27
|
return label.toLowerCase().includes(filterValueLowerCase) || dialCode.includes(filterValueLowerCase);
|
|
26
28
|
} }));
|
|
27
29
|
};
|
|
30
|
+
export var getDefaultValue = function (countries) {
|
|
31
|
+
return countries && !_isEmpty(countries) ? { country: COUNTRIES[countries[0].id], phoneNumber: '' } : defaultValue;
|
|
32
|
+
};
|
package/esm/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/esm/popover/adapter.js
CHANGED
|
@@ -23,3 +23,18 @@ export var placementMap = {
|
|
|
23
23
|
rightTop: PLACEMENT.rightTop,
|
|
24
24
|
rightBottom: PLACEMENT.rightBottom,
|
|
25
25
|
};
|
|
26
|
+
export var rtlPlacementMap = {
|
|
27
|
+
auto: PLACEMENT.auto,
|
|
28
|
+
bottom: PLACEMENT.bottom,
|
|
29
|
+
bottomLeft: PLACEMENT.bottomRight,
|
|
30
|
+
bottomRight: PLACEMENT.bottomLeft,
|
|
31
|
+
top: PLACEMENT.top,
|
|
32
|
+
topLeft: PLACEMENT.topRight,
|
|
33
|
+
topRight: PLACEMENT.topLeft,
|
|
34
|
+
left: PLACEMENT.right,
|
|
35
|
+
leftTop: PLACEMENT.rightTop,
|
|
36
|
+
leftBottom: PLACEMENT.rightBottom,
|
|
37
|
+
right: PLACEMENT.left,
|
|
38
|
+
rightTop: PLACEMENT.leftTop,
|
|
39
|
+
rightBottom: PLACEMENT.leftBottom,
|
|
40
|
+
};
|
package/esm/popover/overrides.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __assign, __read, __rest } from "tslib";
|
|
2
2
|
import { getOppositePosition, splitPlacement } from './utils';
|
|
3
3
|
import { ARROW_WIDTH } from './constants';
|
|
4
|
+
import { borderRadius } from '../helpers/longHandHelpers';
|
|
4
5
|
var arrowPositionStyle = function (_a, _b) {
|
|
5
6
|
var theme = _a.theme;
|
|
6
7
|
var _c = _b.$placement, $placement = _c === void 0 ? 'bottom' : _c;
|
|
@@ -29,16 +30,7 @@ export var getPseudoElementPosition = function (placement, popoverMargin) {
|
|
|
29
30
|
export var getBodyStyles = function (_a, _b) {
|
|
30
31
|
var theme = _a.theme;
|
|
31
32
|
var _c = _b.$placement, $placement = _c === void 0 ? 'bottom' : _c, _d = _b.$popoverMargin, $popoverMargin = _d === void 0 ? 0 : _d, $showArrow = _b.$showArrow, rest = __rest(_b, ["$placement", "$popoverMargin", "$showArrow"]);
|
|
32
|
-
return ({
|
|
33
|
-
backgroundColor: theme.spr.popup,
|
|
34
|
-
color: theme.spr.text01,
|
|
35
|
-
boxShadow: 'none',
|
|
36
|
-
borderTopLeftRadius: theme.popover.borderRadius,
|
|
37
|
-
borderTopRightRadius: theme.popover.borderRadius,
|
|
38
|
-
borderBottomRightRadius: theme.popover.borderRadius,
|
|
39
|
-
borderBottomLeftRadius: theme.popover.borderRadius,
|
|
40
|
-
'::before': __assign({ content: '" "', position: 'absolute' }, getPseudoElementPosition($placement, $showArrow ? $popoverMargin + ARROW_WIDTH : $popoverMargin)),
|
|
41
|
-
});
|
|
33
|
+
return (__assign(__assign({ backgroundColor: theme.spr.popup, color: theme.spr.text01, boxShadow: 'none' }, borderRadius(theme.popover.borderRadius)), { '::before': __assign({ content: '" "', position: 'absolute' }, getPseudoElementPosition($placement, $showArrow ? $popoverMargin + ARROW_WIDTH : $popoverMargin)) }));
|
|
42
34
|
};
|
|
43
35
|
export var arrowStyles = [
|
|
44
36
|
function (utils) {
|
|
@@ -57,13 +49,10 @@ export var arrowStyles = [
|
|
|
57
49
|
},
|
|
58
50
|
arrowPositionStyle,
|
|
59
51
|
];
|
|
60
|
-
export var getInnerStyles = [
|
|
52
|
+
export var getInnerStyles = [
|
|
53
|
+
'border-solid border-1 spr-popup-border spr-shadow-02 spr-text-01 spr-popup',
|
|
54
|
+
function (_a) {
|
|
61
55
|
var theme = _a.theme;
|
|
62
|
-
return ({
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
borderBottomRightRadius: theme.popover.borderRadius,
|
|
66
|
-
borderBottomLeftRadius: theme.popover.borderRadius,
|
|
67
|
-
fontFamily: theme.fontFamily.sans,
|
|
68
|
-
});
|
|
69
|
-
}];
|
|
56
|
+
return (__assign(__assign({}, borderRadius(theme.popover.borderRadius)), { fontFamily: theme.fontFamily.sans }));
|
|
57
|
+
},
|
|
58
|
+
];
|
package/esm/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;
|