@sprinklrjs/spaceweb 10.1.0 → 12.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/allComponentsAndUtilities.d.ts +1 -0
- package/allComponentsAndUtilities.js +2 -1
- package/asyncSelect/asyncSelect.d.ts +4 -2
- package/asyncSelect/asyncSelect.js +43 -108
- package/asyncSelect/groupedAsyncSelect.d.ts +5 -0
- package/asyncSelect/groupedAsyncSelect.js +41 -0
- package/asyncSelect/helpers.d.ts +9 -3
- package/asyncSelect/helpers.js +35 -4
- package/asyncSelect/hooks/useAsyncOptionHandlers.d.ts +17 -12
- package/asyncSelect/hooks/useAsyncOptionHandlers.js +73 -26
- package/asyncSelect/hooks/useAsyncSelect.d.ts +10 -0
- package/asyncSelect/hooks/useAsyncSelect.js +182 -0
- package/asyncSelect/hooks/useResolveSelectedOptions.d.ts +10 -7
- package/asyncSelect/hooks/useResolveSelectedOptions.js +59 -47
- package/asyncSelect/index.d.ts +4 -1
- package/asyncSelect/index.js +8 -0
- package/asyncSelect/types.d.ts +63 -12
- package/avatar/avatar.js +12 -2
- package/avatar/index.d.ts +1 -1
- package/avatar/styled-component.js +7 -22
- package/avatar/types.d.ts +1 -1
- package/badge/styled-component.js +10 -8
- package/banner/banner-item.d.ts +12 -0
- package/banner/banner-item.js +14 -0
- package/banner/banner.d.ts +19 -0
- package/banner/banner.js +56 -0
- package/banner/index.d.ts +5 -0
- package/banner/index.js +14 -0
- package/banner/locale.d.ts +6 -0
- package/banner/locale.js +2 -0
- package/banner/package.json +4 -0
- package/banner/styled-component.d.ts +6 -0
- package/banner/styled-component.js +39 -0
- package/banner/types.d.ts +26 -0
- package/banner/types.js +2 -0
- package/breadcrumb/breadcrumb-item.d.ts +7 -0
- package/breadcrumb/breadcrumb-item.js +41 -0
- package/breadcrumb/breadcrumb.d.ts +7 -0
- package/breadcrumb/breadcrumb.js +29 -0
- package/breadcrumb/index.d.ts +4 -0
- package/breadcrumb/index.js +17 -0
- package/breadcrumb/package.json +4 -0
- package/breadcrumb/styled-components.d.ts +7 -0
- package/breadcrumb/styled-components.js +19 -0
- package/breadcrumb/types.d.ts +38 -0
- package/breadcrumb/types.js +2 -0
- package/button/Button.d.ts +3 -3
- package/button/Button.js +14 -2
- package/button/IconButton/IconButton.d.ts +2 -4
- package/button/IconButton/IconButton.js +5 -2
- package/button/IconButton/types.d.ts +10 -1
- package/button/basewebAdapter.d.ts +9 -6
- package/button/basewebAdapter.js +1 -1
- package/button/styled-components.js +30 -25
- package/button/types.d.ts +4 -1
- package/button-group/ButtonGroup.d.ts +1 -0
- package/button-group/ButtonGroup.js +9 -5
- package/button-group/StatefulButtonGroup.d.ts +1 -0
- package/button-group/index.d.ts +1 -2
- package/button-group/index.js +1 -5
- package/button-group/styled-components.d.ts +34 -0
- package/button-group/styled-components.js +60 -12
- package/button-group/types.d.ts +3 -0
- package/checkbox/basewebAdapters.d.ts +5 -2
- package/checkbox/basewebAdapters.js +9 -2
- package/checkbox/index.d.ts +1 -1
- package/checkbox/index.js +1 -2
- package/checkbox/styled-components.js +1 -1
- package/checkbox/types.d.ts +15 -8
- package/color-picker/ColorPalette.d.ts +9 -0
- package/color-picker/ColorPalette.js +26 -0
- package/color-picker/ColorPicker.d.ts +3 -0
- package/color-picker/ColorPicker.js +35 -0
- package/color-picker/Swatch.d.ts +12 -0
- package/color-picker/Swatch.js +40 -0
- package/color-picker/colors.d.ts +1 -0
- package/color-picker/colors.js +109 -0
- package/color-picker/getContrastRatio.d.ts +1 -0
- package/color-picker/getContrastRatio.js +23 -0
- package/color-picker/index.d.ts +3 -0
- package/color-picker/index.js +7 -0
- package/color-picker/locale.d.ts +3 -0
- package/color-picker/locale.js +2 -0
- package/color-picker/package.json +4 -0
- package/color-picker/styled-component.d.ts +1 -0
- package/color-picker/styled-component.js +5 -0
- package/color-picker/types.d.ts +15 -0
- package/color-picker/types.js +2 -0
- package/currency/Currency.d.ts +3 -0
- package/currency/Currency.js +14 -0
- package/currency/constants.d.ts +3 -0
- package/currency/constants.js +8 -0
- package/currency/index.d.ts +5 -0
- package/currency/index.js +12 -0
- package/currency/package.json +4 -0
- package/currency/types.d.ts +7 -0
- package/currency/types.js +2 -0
- package/currency/useCurrency.d.ts +2 -0
- package/currency/useCurrency.js +12 -0
- package/currency/utils.d.ts +8 -0
- package/currency/utils.js +11 -0
- package/date-input/Before.d.ts +4 -2
- package/date-input/Before.js +4 -4
- package/date-input/CalendarIconButton.js +7 -1
- package/date-input/DateInput.d.ts +1 -1
- package/date-input/DateInput.js +47 -26
- package/date-input/styled-components.d.ts +2 -2
- package/date-input/styled-components.js +10 -8
- package/date-input/types.d.ts +4 -2
- package/date-picker/Calendar.d.ts +1 -1
- package/date-picker/Calendar.js +16 -6
- package/date-picker/DateInput.d.ts +3 -2
- package/date-picker/DateInput.js +19 -17
- package/date-picker/DatePickerContent.d.ts +9 -3
- package/date-picker/DatePickerContent.js +59 -8
- package/date-picker/DatePickerInput.js +13 -16
- package/date-picker/DateTimeContainer.d.ts +4 -2
- package/date-picker/DateTimeContainer.js +5 -5
- package/date-picker/StatelessDatePicker.d.ts +1 -1
- package/date-picker/StatelessDatePicker.js +40 -20
- package/date-picker/TimeInput.d.ts +5 -2
- package/date-picker/TimeInput.js +4 -2
- package/date-picker/index.d.ts +1 -0
- package/date-picker/index.js +3 -1
- package/date-picker/locale.d.ts +2 -0
- package/date-picker/stateful-container.d.ts +1 -1
- package/date-picker/stateful-container.js +11 -8
- package/date-picker/styled-components.d.ts +0 -1
- package/date-picker/styled-components.js +54 -27
- package/date-picker/types.d.ts +10 -1
- package/date-picker/utils.d.ts +10 -7
- package/date-picker/utils.js +12 -4
- package/date-time/DateTime.d.ts +3 -0
- package/date-time/DateTime.js +12 -0
- package/date-time/index.d.ts +3 -0
- package/date-time/index.js +9 -0
- package/date-time/package.json +4 -0
- package/date-time/types.d.ts +21 -0
- package/date-time/types.js +18 -0
- package/date-time/useDateTime.d.ts +2 -0
- package/date-time/useDateTime.js +13 -0
- package/date-time/variants.d.ts +4 -0
- package/date-time/variants.js +87 -0
- package/esm/allComponentsAndUtilities.d.ts +1 -0
- package/esm/allComponentsAndUtilities.js +2 -0
- package/esm/asyncSelect/asyncSelect.d.ts +4 -2
- package/esm/asyncSelect/asyncSelect.js +46 -111
- package/esm/asyncSelect/groupedAsyncSelect.d.ts +5 -0
- package/esm/asyncSelect/groupedAsyncSelect.js +37 -0
- package/esm/asyncSelect/helpers.d.ts +9 -3
- package/esm/asyncSelect/helpers.js +31 -3
- package/esm/asyncSelect/hooks/useAsyncOptionHandlers.d.ts +17 -12
- package/esm/asyncSelect/hooks/useAsyncOptionHandlers.js +76 -29
- package/esm/asyncSelect/hooks/useAsyncSelect.d.ts +10 -0
- package/esm/asyncSelect/hooks/useAsyncSelect.js +178 -0
- package/esm/asyncSelect/hooks/useResolveSelectedOptions.d.ts +10 -7
- package/esm/asyncSelect/hooks/useResolveSelectedOptions.js +62 -50
- package/esm/asyncSelect/index.d.ts +4 -1
- package/esm/asyncSelect/index.js +3 -0
- package/esm/asyncSelect/types.d.ts +63 -12
- package/esm/avatar/avatar.js +12 -2
- package/esm/avatar/index.d.ts +1 -1
- package/esm/avatar/styled-component.js +7 -22
- package/esm/avatar/types.d.ts +1 -1
- package/esm/badge/styled-component.js +10 -8
- package/esm/banner/banner-item.d.ts +12 -0
- package/esm/banner/banner-item.js +12 -0
- package/esm/banner/banner.d.ts +19 -0
- package/esm/banner/banner.js +54 -0
- package/esm/banner/index.d.ts +5 -0
- package/esm/banner/index.js +3 -0
- package/esm/banner/locale.d.ts +6 -0
- package/esm/banner/locale.js +1 -0
- package/esm/banner/styled-component.d.ts +6 -0
- package/esm/banner/styled-component.js +35 -0
- package/esm/banner/types.d.ts +26 -0
- package/esm/banner/types.js +1 -0
- package/esm/breadcrumb/breadcrumb-item.d.ts +7 -0
- package/esm/breadcrumb/breadcrumb-item.js +39 -0
- package/esm/breadcrumb/breadcrumb.d.ts +7 -0
- package/esm/breadcrumb/breadcrumb.js +27 -0
- package/esm/breadcrumb/index.d.ts +4 -0
- package/esm/breadcrumb/index.js +3 -0
- package/esm/breadcrumb/styled-components.d.ts +7 -0
- package/esm/breadcrumb/styled-components.js +15 -0
- package/esm/breadcrumb/types.d.ts +38 -0
- package/esm/breadcrumb/types.js +1 -0
- package/esm/button/Button.d.ts +3 -3
- package/esm/button/Button.js +14 -2
- package/esm/button/IconButton/IconButton.d.ts +2 -4
- package/esm/button/IconButton/IconButton.js +5 -2
- package/esm/button/IconButton/types.d.ts +10 -1
- package/esm/button/basewebAdapter.d.ts +9 -6
- package/esm/button/basewebAdapter.js +1 -1
- package/esm/button/styled-components.js +30 -25
- package/esm/button/types.d.ts +4 -1
- package/esm/button-group/ButtonGroup.d.ts +1 -0
- package/esm/button-group/ButtonGroup.js +9 -5
- package/esm/button-group/StatefulButtonGroup.d.ts +1 -0
- package/esm/button-group/index.d.ts +1 -2
- package/esm/button-group/index.js +0 -1
- package/esm/button-group/styled-components.d.ts +34 -0
- package/esm/button-group/styled-components.js +58 -11
- package/esm/button-group/types.d.ts +3 -0
- package/esm/checkbox/basewebAdapters.d.ts +5 -2
- package/esm/checkbox/basewebAdapters.js +9 -2
- package/esm/checkbox/index.d.ts +1 -1
- package/esm/checkbox/index.js +1 -1
- package/esm/checkbox/styled-components.js +1 -1
- package/esm/checkbox/types.d.ts +15 -8
- package/esm/color-picker/ColorPalette.d.ts +9 -0
- package/esm/color-picker/ColorPalette.js +22 -0
- package/esm/color-picker/ColorPicker.d.ts +3 -0
- package/esm/color-picker/ColorPicker.js +31 -0
- package/esm/color-picker/Swatch.d.ts +12 -0
- package/esm/color-picker/Swatch.js +37 -0
- package/esm/color-picker/colors.d.ts +1 -0
- package/esm/color-picker/colors.js +106 -0
- package/esm/color-picker/getContrastRatio.d.ts +1 -0
- package/esm/color-picker/getContrastRatio.js +19 -0
- package/esm/color-picker/index.d.ts +3 -0
- package/esm/color-picker/index.js +2 -0
- package/esm/color-picker/locale.d.ts +3 -0
- package/esm/color-picker/locale.js +1 -0
- package/esm/color-picker/styled-component.d.ts +1 -0
- package/esm/color-picker/styled-component.js +2 -0
- package/esm/color-picker/types.d.ts +15 -0
- package/esm/color-picker/types.js +1 -0
- package/esm/currency/Currency.d.ts +3 -0
- package/esm/currency/Currency.js +10 -0
- package/esm/currency/constants.d.ts +3 -0
- package/esm/currency/constants.js +5 -0
- package/esm/currency/index.d.ts +5 -0
- package/esm/currency/index.js +5 -0
- package/esm/currency/types.d.ts +7 -0
- package/esm/currency/types.js +1 -0
- package/esm/currency/useCurrency.d.ts +2 -0
- package/esm/currency/useCurrency.js +8 -0
- package/esm/currency/utils.d.ts +8 -0
- package/esm/currency/utils.js +7 -0
- package/esm/date-input/Before.d.ts +4 -2
- package/esm/date-input/Before.js +4 -4
- package/esm/date-input/CalendarIconButton.js +7 -1
- package/esm/date-input/DateInput.d.ts +1 -1
- package/esm/date-input/DateInput.js +48 -27
- package/esm/date-input/styled-components.d.ts +2 -2
- package/esm/date-input/styled-components.js +10 -7
- package/esm/date-input/types.d.ts +4 -2
- package/esm/date-picker/Calendar.d.ts +1 -1
- package/esm/date-picker/Calendar.js +17 -7
- package/esm/date-picker/DateInput.d.ts +3 -2
- package/esm/date-picker/DateInput.js +20 -18
- package/esm/date-picker/DatePickerContent.d.ts +9 -3
- package/esm/date-picker/DatePickerContent.js +60 -9
- package/esm/date-picker/DatePickerInput.js +13 -16
- package/esm/date-picker/DateTimeContainer.d.ts +4 -2
- package/esm/date-picker/DateTimeContainer.js +5 -5
- package/esm/date-picker/StatelessDatePicker.d.ts +1 -1
- package/esm/date-picker/StatelessDatePicker.js +40 -20
- package/esm/date-picker/TimeInput.d.ts +5 -2
- package/esm/date-picker/TimeInput.js +4 -2
- package/esm/date-picker/index.d.ts +1 -0
- package/esm/date-picker/index.js +1 -0
- package/esm/date-picker/locale.d.ts +2 -0
- package/esm/date-picker/stateful-container.d.ts +1 -1
- package/esm/date-picker/stateful-container.js +11 -8
- package/esm/date-picker/styled-components.d.ts +0 -1
- package/esm/date-picker/styled-components.js +53 -26
- package/esm/date-picker/types.d.ts +10 -1
- package/esm/date-picker/utils.d.ts +10 -7
- package/esm/date-picker/utils.js +13 -5
- package/esm/date-time/DateTime.d.ts +3 -0
- package/esm/date-time/DateTime.js +8 -0
- package/esm/date-time/index.d.ts +3 -0
- package/esm/date-time/index.js +3 -0
- package/esm/date-time/types.d.ts +21 -0
- package/esm/date-time/types.js +15 -0
- package/esm/date-time/useDateTime.d.ts +2 -0
- package/esm/date-time/useDateTime.js +9 -0
- package/esm/date-time/variants.d.ts +4 -0
- package/esm/date-time/variants.js +84 -0
- package/esm/form-control/context.d.ts +6 -13
- package/esm/form-control/context.js +10 -9
- package/esm/form-control/form-control.d.ts +1 -1
- package/esm/form-control/form-control.js +17 -12
- package/esm/form-control/styled-component.js +18 -7
- package/esm/helpers/ClearIconButton.js +3 -1
- package/esm/helpers/StyledTombstone.d.ts +1 -0
- package/esm/helpers/StyledTombstone.js +17 -0
- package/esm/helpers/baseui/useConvertOverrides.js +6 -1
- package/esm/helpers/baseui/withThemeOverride.js +1 -1
- package/esm/helpers/commonStyles.d.ts +2 -2
- package/esm/helpers/commonStyles.js +3 -6
- package/esm/helpers/index.d.ts +1 -0
- package/esm/helpers/index.js +8 -0
- package/esm/helpers/styletron.d.ts +14 -3
- package/esm/helpers/themeHelpers.d.ts +1 -0
- package/esm/helpers/themeHelpers.js +13 -0
- package/esm/hooks/useAutoFocus.d.ts +6 -7
- package/esm/hooks/useAutoFocus.js +19 -13
- package/esm/hooks/useCombinedRef.d.ts +1 -0
- package/esm/hooks/useCombinedRef.js +33 -0
- package/esm/hooks/useIsMobileDevice.d.ts +1 -0
- package/esm/hooks/useIsMobileDevice.js +6 -0
- package/esm/hooks/useMatchMedia.d.ts +3 -0
- package/esm/hooks/useMatchMedia.js +49 -0
- package/esm/icon/components/alert-solid.js +2 -0
- package/esm/icon/components/alert.js +2 -0
- package/esm/icon/components/calendar-solid.js +2 -0
- package/esm/icon/components/chevron-down.js +2 -0
- package/esm/icon/components/chevron-left.d.ts +3 -0
- package/esm/icon/components/chevron-left.js +8 -0
- package/esm/icon/components/chevron-right.d.ts +3 -0
- package/esm/icon/components/chevron-right.js +8 -0
- package/esm/icon/components/close.js +2 -0
- package/esm/icon/components/error-clr.js +2 -0
- package/esm/icon/components/error-solid.js +2 -0
- package/esm/icon/components/error.js +2 -0
- package/esm/icon/components/imagePreview.js +2 -0
- package/esm/icon/components/info.js +2 -0
- package/esm/icon/components/play-video.js +2 -0
- package/esm/icon/components/reset-color.d.ts +3 -0
- package/esm/icon/components/reset-color.js +8 -0
- package/esm/icon/components/search.js +2 -0
- package/esm/icon/components/tick.js +2 -0
- package/esm/icon/components/tickCircle-solid.js +2 -0
- package/esm/icon/components/user.js +2 -0
- package/esm/icon/components/video-non-playable.js +2 -0
- package/esm/index.d.ts +2 -0
- package/esm/index.js +2 -0
- package/esm/input/basewebAdapters.d.ts +1 -1
- package/esm/input/basewebAdapters.js +18 -3
- package/esm/input/index.d.ts +2 -1
- package/esm/input/index.js +1 -0
- package/esm/input/styled-components.d.ts +1 -1
- package/esm/input/styled-components.js +8 -6
- package/esm/input/types.d.ts +10 -4
- package/esm/layer/useLayersContextValue.js +3 -2
- package/esm/list/avatar-list-item.d.ts +12 -22
- package/esm/list/avatar-list-item.js +8 -10
- package/esm/list/divider.js +6 -3
- package/esm/list/index.d.ts +1 -1
- package/esm/list/index.js +1 -1
- package/esm/list/list-item.d.ts +3 -1
- package/esm/list/list-item.js +9 -6
- package/esm/list/list.d.ts +10 -5
- package/esm/list/list.js +47 -6
- package/esm/list/styled-component.d.ts +1 -0
- package/esm/list/styled-component.js +23 -17
- package/esm/list/types.d.ts +8 -0
- package/esm/list/utils.d.ts +2 -0
- package/esm/list/utils.js +10 -0
- package/esm/locale/en_US.js +35 -0
- package/esm/locale/types.d.ts +21 -0
- package/esm/menu/MenuContext.d.ts +2 -1
- package/esm/menu/MenuContext.js +1 -0
- package/esm/menu/menu-item.d.ts +8 -2
- package/esm/menu/menu-item.js +11 -11
- package/esm/menu/menu.d.ts +6 -0
- package/esm/menu/menu.js +11 -11
- package/esm/menu/types.d.ts +1 -0
- package/esm/menu/useKeyboardNavigation.d.ts +6 -3
- package/esm/menu/useKeyboardNavigation.js +21 -14
- package/esm/menu/useStatefulMenu.d.ts +5 -2
- package/esm/menu/useStatefulMenu.js +14 -8
- package/esm/modal/adapter.d.ts +1 -1
- package/esm/modal/index.d.ts +1 -1
- package/esm/modal/index.js +1 -1
- package/esm/modal/modal.js +5 -5
- package/esm/modal/overrides.d.ts +2 -3
- package/esm/modal/overrides.js +6 -8
- package/esm/modal/styled-components.d.ts +1 -1
- package/esm/modal/styled-components.js +8 -8
- package/esm/number/Number.d.ts +3 -0
- package/esm/number/Number.js +10 -0
- package/esm/number/constants.d.ts +2 -0
- package/esm/number/constants.js +4 -0
- package/esm/number/index.d.ts +5 -0
- package/esm/number/index.js +5 -0
- package/esm/number/types.d.ts +6 -0
- package/esm/number/types.js +1 -0
- package/esm/number/useNumber.d.ts +2 -0
- package/esm/number/useNumber.js +8 -0
- package/esm/overrides/index.d.ts +1 -1
- package/esm/overrides/index.js +1 -1
- package/esm/overrides/mergeOverrides.d.ts +3 -2
- package/esm/overrides/mergeOverrides.js +5 -4
- package/esm/payment-card/basewebAdapters.d.ts +2 -0
- package/esm/payment-card/basewebAdapters.js +27 -4
- package/esm/payment-card/styled-components.js +25 -6
- package/esm/payment-card/types.d.ts +4 -2
- package/esm/phone-input/country-select-container.js +1 -1
- package/esm/phone-input/country-select.js +4 -6
- package/esm/phone-input/default-props.d.ts +6 -9
- package/esm/phone-input/default-props.js +7 -9
- package/esm/phone-input/flag-container.js +1 -1
- package/esm/phone-input/phone-input.d.ts +0 -6
- package/esm/phone-input/phone-input.js +21 -12
- package/esm/phone-input/stateful-phone-input-container.js +4 -3
- package/esm/phone-input/stateful-phone-input.d.ts +0 -6
- package/esm/phone-input/styled-components.d.ts +9 -1
- package/esm/phone-input/styled-components.js +21 -7
- package/esm/phone-input/types.d.ts +2 -1
- package/esm/phone-input/utils.d.ts +10 -3
- package/esm/phone-input/utils.js +10 -5
- package/esm/popover/adapter.d.ts +4 -3
- package/esm/popover/adapter.js +15 -0
- package/esm/popover/overrides.js +8 -19
- package/esm/popover/popover.d.ts +6 -3
- package/esm/popover/popover.js +13 -6
- package/esm/popover/stateful-popover.js +2 -2
- package/esm/popover/types.d.ts +10 -2
- package/esm/popover/types.js +2 -1
- package/esm/popover/utils.d.ts +12 -0
- package/esm/popover/utils.js +9 -0
- package/esm/progress/circular/styled-component.d.ts +1 -1
- package/esm/progress/circular/styled-component.js +3 -3
- package/esm/progress/linear/styled-component.d.ts +1 -1
- package/esm/progress/linear/styled-component.js +5 -5
- package/esm/radio/basewebAdapters.d.ts +8 -11
- package/esm/radio/basewebAdapters.js +6 -3
- package/esm/radio/radio.js +6 -5
- package/esm/radio/styled-components.js +9 -11
- package/esm/radio/types.d.ts +13 -6
- package/esm/search/index.d.ts +1 -0
- package/esm/search/index.js +1 -0
- package/esm/search/search.d.ts +1 -1
- package/esm/search/search.js +15 -6
- package/esm/search/stateful-search.d.ts +3 -0
- package/esm/search/stateful-search.js +15 -0
- package/esm/search/styled-components.d.ts +1 -10
- package/esm/search/styled-components.js +54 -24
- package/esm/search/types.d.ts +8 -2
- package/esm/select/adaptor.d.ts +1 -1
- package/esm/select/base-select.d.ts +36 -16
- package/esm/select/base-select.js +185 -88
- package/esm/select/constants.d.ts +3 -0
- package/esm/select/constants.js +3 -1
- package/esm/select/default-props.d.ts +9 -5
- package/esm/select/default-props.js +4 -1
- package/esm/select/index.d.ts +4 -4
- package/esm/select/index.js +3 -3
- package/esm/select/locale.d.ts +4 -0
- package/esm/select/mobileSelect/MobileSelect.js +3 -5
- package/esm/select/mobileSelect/MobileSheet.js +3 -1
- package/esm/select/multi-value.js +22 -12
- package/esm/select/overlaySelect/OverlaySelect.js +10 -18
- package/esm/select/overlaySelect/hooks/useControlRef.d.ts +9 -0
- package/esm/select/overlaySelect/hooks/useControlRef.js +33 -0
- package/esm/select/overlaySelect/hooks/useOverlaySelectOverrides.d.ts +24 -0
- package/esm/select/overlaySelect/{useOverlaySelectOverrides.js → hooks/useOverlaySelectOverrides.js} +31 -28
- package/esm/select/overlaySelect/{usePopover.d.ts → hooks/usePopover.d.ts} +1 -1
- package/esm/select/overlaySelect/{usePopover.js → hooks/usePopover.js} +2 -2
- package/esm/select/overrides.d.ts +3 -1
- package/esm/select/overrides.js +19 -13
- package/esm/select/select-variants.js +2 -2
- package/esm/select/select.d.ts +9 -5
- package/esm/select/select.js +9 -3
- package/esm/select/selectMenuAdapter/CollapsibleSelectMenu.d.ts +118 -0
- package/esm/select/selectMenuAdapter/CollapsibleSelectMenu.js +70 -0
- package/esm/select/selectMenuAdapter/SelectMenuAdapter.d.ts +2 -32
- package/esm/select/selectMenuAdapter/SelectMenuAdapter.js +11 -5
- package/esm/select/selectMenuAdapter/SelectMenuItem.d.ts +8 -2
- package/esm/select/selectMenuAdapter/SelectMenuItem.js +2 -4
- package/esm/select/selectMenuAdapter/hooks/useGetExpandedGroup.d.ts +6 -0
- package/esm/select/selectMenuAdapter/hooks/useGetExpandedGroup.js +16 -0
- package/esm/select/selectMenuAdapter/types.d.ts +42 -0
- package/esm/select/selectMenuAdapter/types.js +1 -0
- package/esm/select/stateful-select.d.ts +9 -5
- package/esm/select/stateful-select.js +3 -3
- package/esm/select/styled-component.d.ts +15 -4
- package/esm/select/styled-component.js +60 -10
- package/esm/select/types.d.ts +36 -9
- package/esm/select/types.js +1 -0
- package/esm/select/utils/default-filter-options.d.ts +2 -1
- package/esm/select/utils/default-filter-options.js +5 -1
- package/esm/select/utils/hidden-element.d.ts +6 -0
- package/esm/select/utils/hidden-element.js +16 -0
- package/esm/select/utils/merge-options.d.ts +2 -0
- package/esm/select/utils/merge-options.js +18 -0
- package/esm/select/utils/test-utils.d.ts +1 -0
- package/esm/select/utils/test-utils.js +7 -0
- package/esm/slider/mark.d.ts +3 -3
- package/esm/slider/slider.js +2 -1
- package/esm/slider/stateful-slider.js +1 -1
- package/esm/slider/styled-components.js +4 -4
- package/esm/slider/types.d.ts +9 -2
- package/esm/snackbar/Snackbar.js +12 -12
- package/esm/snackbar/styled-component.js +9 -6
- package/esm/spacewebProvider/CustomBaseProvider.js +1 -0
- package/esm/spacewebProvider/SpacewebProvider.d.ts +3 -1
- package/esm/spacewebProvider/SpacewebProvider.js +9 -9
- package/esm/stack/stack.js +6 -13
- package/esm/style/_buildUtils.d.ts +1 -1
- package/esm/style/_buildUtils.js +3 -1
- package/esm/style/_parseStyle.js +12 -7
- package/esm/style/useMemoizedStyletron.d.ts +1 -1
- package/esm/style/useMemoizedStyletron.js +6 -1
- package/esm/styleEngine/styleEngine.d.ts +1 -2
- package/esm/switch/__test__/switch.spec.js +13 -0
- package/esm/switch/styled-components.js +14 -21
- package/esm/switch/switch.js +5 -2
- package/esm/switch/types.d.ts +8 -11
- package/esm/tag/avatar-tag.js +23 -16
- package/esm/tag/styled-components.js +32 -27
- package/esm/tag/tag.js +20 -12
- package/esm/tag/types.d.ts +2 -2
- package/esm/tag/utils.d.ts +50 -0
- package/esm/tag/utils.js +64 -0
- package/esm/textarea/basewebAdapters.js +4 -4
- package/esm/textarea/styled-components.d.ts +1 -1
- package/esm/textarea/textarea.js +4 -8
- package/esm/textarea/types.d.ts +7 -5
- package/esm/theme/Provider.d.ts +10 -0
- package/esm/theme/Provider.js +61 -0
- package/esm/theme/context.d.ts +1 -10
- package/esm/theme/context.js +1 -61
- package/esm/theme/index.d.ts +1 -0
- package/esm/theme/index.js +1 -0
- package/esm/themes/index.js +1 -1
- package/esm/themes/responsive-theme.d.ts +2 -2
- package/esm/time-picker/TimePicker.d.ts +1 -6
- package/esm/time-picker/TimePicker.js +4 -4
- package/esm/time-picker/types.d.ts +3 -1
- package/esm/time-range-picker/RangeSelector.js +6 -5
- package/esm/time-range-picker/RangeSelectorContainer.js +27 -27
- package/esm/time-range-picker/TimeRangeList.js +8 -1
- package/esm/time-range-picker/TimeRangePicker.js +26 -17
- package/esm/time-range-picker/index.d.ts +1 -1
- package/esm/time-range-picker/index.js +1 -1
- package/esm/time-range-picker/locale.d.ts +3 -0
- package/esm/time-range-picker/types.d.ts +17 -3
- package/esm/time-range-picker/utils.d.ts +47 -18
- package/esm/time-range-picker/utils.js +94 -16
- package/esm/time-zone-picker/TimezonePicker.d.ts +1 -6
- package/esm/time-zone-picker/TimezonePicker.js +5 -7
- package/esm/time-zone-picker/types.d.ts +2 -0
- package/esm/tooltip/disabled-tooltip-container.d.ts +26 -1
- package/esm/tooltip/overrides.js +1 -2
- package/esm/tooltip/stateful-tooltip-container.d.ts +26 -1
- package/esm/tooltip/stateful-tooltip.d.ts +27 -1
- package/esm/tooltip/stateful-tooltip.js +2 -2
- package/esm/tooltip/tooltip.d.ts +1 -1
- package/esm/tooltip/tooltip.js +7 -4
- package/esm/tooltip/types.d.ts +12 -2
- package/esm/types.d.ts +5 -3
- package/esm/typography/Typography.js +14 -1
- package/esm/typography/constants.d.ts +56 -0
- package/esm/typography/constants.js +56 -0
- package/esm/typography/index.d.ts +1 -0
- package/esm/typography/index.js +1 -0
- package/esm/typography/styled-components.js +12 -4
- package/esm/typography/types.d.ts +1 -1
- package/esm/utils/intlNumberFormatUtils/index.d.ts +7 -0
- package/esm/utils/intlNumberFormatUtils/index.js +36 -0
- package/esm/utils/intlNumberFormatUtils/types.d.ts +21 -0
- package/esm/utils/intlNumberFormatUtils/types.js +6 -0
- package/esm/video/Video.js +4 -2
- package/esm/video/types.d.ts +2 -0
- package/form-control/context.d.ts +6 -13
- package/form-control/context.js +11 -10
- package/form-control/form-control.d.ts +1 -1
- package/form-control/form-control.js +16 -11
- package/form-control/styled-component.js +18 -7
- package/helpers/ClearIconButton.js +3 -1
- package/helpers/StyledTombstone.d.ts +1 -0
- package/helpers/StyledTombstone.js +21 -0
- package/helpers/baseui/useConvertOverrides.js +6 -1
- package/helpers/baseui/withThemeOverride.js +1 -1
- package/helpers/commonStyles.d.ts +2 -2
- package/helpers/commonStyles.js +3 -6
- package/helpers/index.d.ts +1 -0
- package/helpers/index.js +10 -1
- package/helpers/styletron.d.ts +14 -3
- package/helpers/themeHelpers.d.ts +1 -0
- package/helpers/themeHelpers.js +15 -1
- package/hooks/useAutoFocus.d.ts +6 -7
- package/hooks/useAutoFocus.js +19 -14
- package/hooks/useCombinedRef.d.ts +1 -0
- package/hooks/useCombinedRef.js +35 -1
- package/hooks/useIsMobileDevice.d.ts +1 -0
- package/hooks/useIsMobileDevice.js +11 -0
- package/hooks/useMatchMedia.d.ts +3 -0
- package/hooks/useMatchMedia.js +52 -0
- package/icon/components/alert-solid.js +2 -0
- package/icon/components/alert.js +2 -0
- package/icon/components/calendar-solid.js +2 -0
- package/icon/components/chevron-down.js +2 -0
- package/icon/components/chevron-left.d.ts +3 -0
- package/icon/components/chevron-left.js +11 -0
- package/icon/components/chevron-right.d.ts +3 -0
- package/icon/components/chevron-right.js +11 -0
- package/icon/components/close.js +2 -0
- package/icon/components/error-clr.js +2 -0
- package/icon/components/error-solid.js +2 -0
- package/icon/components/error.js +2 -0
- package/icon/components/imagePreview.js +2 -0
- package/icon/components/info.js +2 -0
- package/icon/components/play-video.js +2 -0
- package/icon/components/reset-color.d.ts +3 -0
- package/icon/components/reset-color.js +11 -0
- package/icon/components/search.js +2 -0
- package/icon/components/tick.js +2 -0
- package/icon/components/tickCircle-solid.js +2 -0
- package/icon/components/user.js +2 -0
- package/icon/components/video-non-playable.js +2 -0
- package/index.d.ts +2 -0
- package/index.js +3 -0
- package/input/basewebAdapters.d.ts +1 -1
- package/input/basewebAdapters.js +18 -3
- package/input/index.d.ts +2 -1
- package/input/index.js +3 -1
- package/input/styled-components.d.ts +1 -1
- package/input/styled-components.js +7 -5
- package/input/types.d.ts +10 -4
- package/layer/useLayersContextValue.js +2 -1
- package/list/avatar-list-item.d.ts +12 -22
- package/list/avatar-list-item.js +6 -8
- package/list/divider.js +6 -3
- package/list/index.d.ts +1 -1
- package/list/index.js +2 -1
- package/list/list-item.d.ts +3 -1
- package/list/list-item.js +9 -6
- package/list/list.d.ts +10 -5
- package/list/list.js +47 -6
- package/list/styled-component.d.ts +1 -0
- package/list/styled-component.js +24 -18
- package/list/types.d.ts +8 -0
- package/list/utils.d.ts +2 -0
- package/list/utils.js +14 -0
- package/locale/en_US.js +35 -0
- package/locale/types.d.ts +21 -0
- package/menu/MenuContext.d.ts +2 -1
- package/menu/MenuContext.js +1 -0
- package/menu/menu-item.d.ts +8 -2
- package/menu/menu-item.js +11 -11
- package/menu/menu.d.ts +6 -0
- package/menu/menu.js +11 -11
- package/menu/types.d.ts +1 -0
- package/menu/useKeyboardNavigation.d.ts +6 -3
- package/menu/useKeyboardNavigation.js +21 -14
- package/menu/useStatefulMenu.d.ts +5 -2
- package/menu/useStatefulMenu.js +14 -8
- package/modal/adapter.d.ts +1 -1
- package/modal/index.d.ts +1 -1
- package/modal/index.js +1 -2
- package/modal/modal.js +4 -4
- package/modal/overrides.d.ts +2 -3
- package/modal/overrides.js +7 -9
- package/modal/styled-components.d.ts +1 -1
- package/modal/styled-components.js +8 -9
- package/number/Number.d.ts +3 -0
- package/number/Number.js +14 -0
- package/number/constants.d.ts +2 -0
- package/number/constants.js +7 -0
- package/number/index.d.ts +5 -0
- package/number/index.js +12 -0
- package/number/package.json +4 -0
- package/number/types.d.ts +6 -0
- package/number/types.js +2 -0
- package/number/useNumber.d.ts +2 -0
- package/number/useNumber.js +12 -0
- package/overrides/index.d.ts +1 -1
- package/overrides/index.js +2 -1
- package/overrides/mergeOverrides.d.ts +3 -2
- package/overrides/mergeOverrides.js +6 -4
- package/package.json +18 -12
- package/payment-card/basewebAdapters.d.ts +2 -0
- package/payment-card/basewebAdapters.js +27 -4
- package/payment-card/styled-components.js +24 -5
- package/payment-card/types.d.ts +4 -2
- package/phone-input/country-select-container.js +1 -1
- package/phone-input/country-select.js +4 -6
- package/phone-input/default-props.d.ts +6 -9
- package/phone-input/default-props.js +8 -9
- package/phone-input/flag-container.js +1 -1
- package/phone-input/phone-input.d.ts +0 -6
- package/phone-input/phone-input.js +20 -11
- package/phone-input/stateful-phone-input-container.js +4 -3
- package/phone-input/stateful-phone-input.d.ts +0 -6
- package/phone-input/styled-components.d.ts +9 -1
- package/phone-input/styled-components.js +22 -7
- package/phone-input/types.d.ts +2 -1
- package/phone-input/utils.d.ts +10 -3
- package/phone-input/utils.js +11 -5
- package/popover/adapter.d.ts +4 -3
- package/popover/adapter.js +16 -1
- package/popover/overrides.js +8 -19
- package/popover/popover.d.ts +6 -3
- package/popover/popover.js +12 -5
- package/popover/stateful-popover.js +2 -2
- package/popover/types.d.ts +10 -2
- package/popover/types.js +5 -4
- package/popover/utils.d.ts +12 -0
- package/popover/utils.js +11 -1
- package/progress/circular/styled-component.d.ts +1 -1
- package/progress/circular/styled-component.js +4 -4
- package/progress/linear/styled-component.d.ts +1 -1
- package/progress/linear/styled-component.js +5 -5
- package/radio/basewebAdapters.d.ts +8 -11
- package/radio/basewebAdapters.js +6 -3
- package/radio/radio.js +6 -5
- package/radio/styled-components.js +9 -11
- package/radio/types.d.ts +13 -6
- package/search/index.d.ts +1 -0
- package/search/index.js +3 -1
- package/search/search.d.ts +1 -1
- package/search/search.js +14 -5
- package/search/stateful-search.d.ts +3 -0
- package/search/stateful-search.js +19 -0
- package/search/styled-components.d.ts +1 -10
- package/search/styled-components.js +56 -25
- package/search/types.d.ts +8 -2
- package/select/adaptor.d.ts +1 -1
- package/select/base-select.d.ts +36 -16
- package/select/base-select.js +183 -86
- package/select/constants.d.ts +3 -0
- package/select/constants.js +4 -2
- package/select/default-props.d.ts +9 -5
- package/select/default-props.js +4 -1
- package/select/index.d.ts +4 -4
- package/select/index.js +4 -2
- package/select/locale.d.ts +4 -0
- package/select/mobileSelect/MobileSelect.js +3 -5
- package/select/mobileSelect/MobileSheet.js +3 -1
- package/select/multi-value.js +21 -11
- package/select/overlaySelect/OverlaySelect.js +9 -17
- package/select/overlaySelect/hooks/useControlRef.d.ts +9 -0
- package/select/overlaySelect/hooks/useControlRef.js +37 -0
- package/select/overlaySelect/hooks/useOverlaySelectOverrides.d.ts +24 -0
- package/select/overlaySelect/{useOverlaySelectOverrides.js → hooks/useOverlaySelectOverrides.js} +31 -28
- package/select/overlaySelect/{usePopover.d.ts → hooks/usePopover.d.ts} +1 -1
- package/select/overlaySelect/{usePopover.js → hooks/usePopover.js} +2 -2
- package/select/overrides.d.ts +3 -1
- package/select/overrides.js +20 -14
- package/select/select-variants.js +2 -2
- package/select/select.d.ts +9 -5
- package/select/select.js +9 -3
- package/select/selectMenuAdapter/CollapsibleSelectMenu.d.ts +118 -0
- package/select/selectMenuAdapter/CollapsibleSelectMenu.js +74 -0
- package/select/selectMenuAdapter/SelectMenuAdapter.d.ts +2 -32
- package/select/selectMenuAdapter/SelectMenuAdapter.js +11 -5
- package/select/selectMenuAdapter/SelectMenuItem.d.ts +8 -2
- package/select/selectMenuAdapter/SelectMenuItem.js +2 -4
- package/select/selectMenuAdapter/hooks/useGetExpandedGroup.d.ts +6 -0
- package/select/selectMenuAdapter/hooks/useGetExpandedGroup.js +20 -0
- package/select/selectMenuAdapter/types.d.ts +42 -0
- package/select/selectMenuAdapter/types.js +2 -0
- package/select/stateful-select.d.ts +9 -5
- package/select/stateful-select.js +3 -3
- package/select/styled-component.d.ts +15 -4
- package/select/styled-component.js +58 -11
- package/select/types.d.ts +36 -9
- package/select/types.js +2 -1
- package/select/utils/default-filter-options.d.ts +2 -1
- package/select/utils/default-filter-options.js +6 -5
- package/select/utils/hidden-element.d.ts +6 -0
- package/select/utils/hidden-element.js +19 -0
- package/select/utils/merge-options.d.ts +2 -0
- package/select/utils/merge-options.js +22 -0
- package/select/utils/test-utils.d.ts +1 -0
- package/select/utils/test-utils.js +11 -0
- package/slider/mark.d.ts +3 -3
- package/slider/slider.js +2 -1
- package/slider/stateful-slider.js +1 -1
- package/slider/styled-components.js +4 -4
- package/slider/types.d.ts +9 -2
- package/snackbar/Snackbar.js +12 -12
- package/snackbar/styled-component.js +9 -6
- package/spacewebProvider/CustomBaseProvider.js +1 -0
- package/spacewebProvider/SpacewebProvider.d.ts +3 -1
- package/spacewebProvider/SpacewebProvider.js +8 -8
- package/stack/stack.js +6 -13
- package/style/_buildUtils.d.ts +1 -1
- package/style/_buildUtils.js +3 -1
- package/style/_parseStyle.js +12 -7
- package/style/useMemoizedStyletron.d.ts +1 -1
- package/style/useMemoizedStyletron.js +6 -1
- package/styleEngine/styleEngine.d.ts +1 -2
- package/switch/__test__/switch.spec.js +13 -0
- package/switch/styled-components.js +14 -21
- package/switch/switch.js +5 -2
- package/switch/types.d.ts +8 -11
- package/tag/avatar-tag.js +23 -16
- package/tag/styled-components.js +32 -27
- package/tag/tag.js +19 -11
- package/tag/types.d.ts +2 -2
- package/tag/utils.d.ts +50 -0
- package/tag/utils.js +67 -1
- package/textarea/basewebAdapters.js +3 -3
- package/textarea/styled-components.d.ts +1 -1
- package/textarea/textarea.js +3 -7
- package/textarea/types.d.ts +7 -5
- package/theme/Provider.d.ts +10 -0
- package/theme/Provider.js +65 -0
- package/theme/context.d.ts +1 -10
- package/theme/context.js +1 -61
- package/theme/index.d.ts +1 -0
- package/theme/index.js +1 -0
- package/themes/index.js +1 -1
- package/themes/responsive-theme.d.ts +2 -2
- package/time-picker/TimePicker.d.ts +1 -6
- package/time-picker/TimePicker.js +4 -4
- package/time-picker/types.d.ts +3 -1
- package/time-range-picker/RangeSelector.js +5 -4
- package/time-range-picker/RangeSelectorContainer.js +26 -26
- package/time-range-picker/TimeRangeList.js +8 -1
- package/time-range-picker/TimeRangePicker.js +25 -16
- package/time-range-picker/index.d.ts +1 -1
- package/time-range-picker/index.js +4 -1
- package/time-range-picker/locale.d.ts +3 -0
- package/time-range-picker/types.d.ts +17 -3
- package/time-range-picker/utils.d.ts +47 -18
- package/time-range-picker/utils.js +98 -17
- package/time-zone-picker/TimezonePicker.d.ts +1 -6
- package/time-zone-picker/TimezonePicker.js +5 -7
- package/time-zone-picker/types.d.ts +2 -0
- package/tooltip/disabled-tooltip-container.d.ts +26 -1
- package/tooltip/overrides.js +1 -2
- package/tooltip/stateful-tooltip-container.d.ts +26 -1
- package/tooltip/stateful-tooltip.d.ts +27 -1
- package/tooltip/stateful-tooltip.js +2 -2
- package/tooltip/tooltip.d.ts +1 -1
- package/tooltip/tooltip.js +7 -4
- package/tooltip/types.d.ts +12 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/types.d.ts +5 -3
- package/typography/Typography.js +14 -1
- package/typography/constants.d.ts +56 -0
- package/typography/constants.js +57 -1
- package/typography/index.d.ts +1 -0
- package/typography/index.js +3 -1
- package/typography/styled-components.js +11 -3
- package/typography/types.d.ts +1 -1
- package/utils/intlNumberFormatUtils/index.d.ts +7 -0
- package/utils/intlNumberFormatUtils/index.js +40 -0
- package/utils/intlNumberFormatUtils/types.d.ts +21 -0
- package/utils/intlNumberFormatUtils/types.js +9 -0
- package/utils/package.json +4 -0
- package/video/Video.js +4 -2
- package/video/types.d.ts +2 -0
- package/esm/icon/components/chevron-right-solid.d.ts +0 -3
- package/esm/icon/components/chevron-right-solid.js +0 -6
- package/esm/phone-input/virtualized-country-select-dropdown.d.ts +0 -31
- package/esm/phone-input/virtualized-country-select-dropdown.js +0 -33
- package/esm/select/overlaySelect/useOverlaySelectOverrides.d.ts +0 -14
- package/esm/style/_escapeClassName.d.ts +0 -6
- package/esm/style/_escapeClassName.js +0 -6
- package/icon/components/chevron-right-solid.d.ts +0 -3
- package/icon/components/chevron-right-solid.js +0 -9
- package/phone-input/virtualized-country-select-dropdown.d.ts +0 -31
- package/phone-input/virtualized-country-select-dropdown.js +0 -35
- package/select/overlaySelect/useOverlaySelectOverrides.d.ts +0 -14
- package/style/_escapeClassName.d.ts +0 -6
- package/style/_escapeClassName.js +0 -9
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Override } from '../overrides';
|
|
2
|
+
export declare type ColorPickerOverrides = {
|
|
3
|
+
Root?: Override<Record<string, any>>;
|
|
4
|
+
Heading?: Override<Record<string, any>>;
|
|
5
|
+
Swatches?: Override<Record<string, any>>;
|
|
6
|
+
Swatch?: Override<Record<string, any>>;
|
|
7
|
+
TickIcon?: Override<Record<string, any>>;
|
|
8
|
+
};
|
|
9
|
+
export declare type ColorPickerProps = {
|
|
10
|
+
overrides?: ColorPickerOverrides;
|
|
11
|
+
value?: string;
|
|
12
|
+
onChange: (value?: string) => void;
|
|
13
|
+
heading?: string;
|
|
14
|
+
resetButtonLabel?: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
//hooks
|
|
3
|
+
import { useCurrency } from './useCurrency';
|
|
4
|
+
//constants
|
|
5
|
+
import { DEFAULT_VARIANT, DEFAULT_CURRENCY } from './constants';
|
|
6
|
+
export var Currency = function (_a) {
|
|
7
|
+
var value = _a.value, _b = _a.variant, variant = _b === void 0 ? DEFAULT_VARIANT : _b, _c = _a.currency, currency = _c === void 0 ? DEFAULT_CURRENCY : _c, currencyOptions = _a.currencyOptions;
|
|
8
|
+
var formattedCurrency = useCurrency({ value: value, variant: variant, currency: currency, currencyOptions: currencyOptions });
|
|
9
|
+
return _jsx(_Fragment, { children: formattedCurrency }, void 0);
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useLocale } from '../locale';
|
|
2
|
+
import { getFormattedCurrency } from './utils';
|
|
3
|
+
import { DEFAULT_CURRENCY, DEFAULT_VARIANT } from './constants';
|
|
4
|
+
export var useCurrency = function (_a) {
|
|
5
|
+
var value = _a.value, _b = _a.currency, currency = _b === void 0 ? DEFAULT_CURRENCY : _b, _c = _a.variant, variant = _c === void 0 ? DEFAULT_VARIANT : _c, currencyOptions = _a.currencyOptions;
|
|
6
|
+
var langCode = useLocale().langCode;
|
|
7
|
+
return getFormattedCurrency({ value: value, locale: langCode, variant: variant, currencyOptions: currencyOptions, currency: currency });
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NumberVariant } from '../utils/intlNumberFormatUtils/types';
|
|
2
|
+
export declare const getFormattedCurrency: ({ value, locale, variant, currencyOptions, currency, }: {
|
|
3
|
+
value: number;
|
|
4
|
+
locale: string;
|
|
5
|
+
variant: NumberVariant;
|
|
6
|
+
currency: string;
|
|
7
|
+
currencyOptions?: Intl.NumberFormatOptions | undefined;
|
|
8
|
+
}) => string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import { getFormattedNumber } from '../utils/intlNumberFormatUtils';
|
|
3
|
+
export var getFormattedCurrency = function (_a) {
|
|
4
|
+
var value = _a.value, locale = _a.locale, variant = _a.variant, currencyOptions = _a.currencyOptions, currency = _a.currency;
|
|
5
|
+
var intlNumberFormatterOptions = __assign({ style: 'currency', currency: currency }, currencyOptions);
|
|
6
|
+
return getFormattedNumber({ value: value, locale: locale, variant: variant, numberOptions: intlNumberFormatterOptions });
|
|
7
|
+
};
|
|
@@ -2,16 +2,18 @@ import { ReactElement } from 'react';
|
|
|
2
2
|
import { SharedProps } from 'baseui/input';
|
|
3
3
|
import { WeekStartsOn } from '../date-picker';
|
|
4
4
|
import { Override } from '../overrides';
|
|
5
|
-
export declare const Before: ({ weekStartsOn, adapter, locale, overrides, onChange: _onChange, minDate, maxDate, value, timeSelect, ...props }: SharedProps & {
|
|
5
|
+
export declare const Before: ({ weekStartsOn, adapter, locale, overrides, onChange: _onChange, minDate, maxDate, value, timeSelect, showTimezone, timezone, ...props }: SharedProps & {
|
|
6
6
|
adapter?: any;
|
|
7
7
|
locale?: any;
|
|
8
8
|
overrides?: {
|
|
9
9
|
DatePicker?: Override<Record<string, any>> | undefined;
|
|
10
10
|
} | undefined;
|
|
11
|
-
onChange: (value?: Date | undefined) => void;
|
|
11
|
+
onChange: (value?: Date | undefined, timezone?: string | undefined) => void;
|
|
12
12
|
weekStartsOn?: WeekStartsOn | undefined;
|
|
13
13
|
minDate?: Date | undefined;
|
|
14
14
|
maxDate?: Date | undefined;
|
|
15
15
|
value?: Date | undefined;
|
|
16
16
|
timeSelect?: boolean | undefined;
|
|
17
|
+
showTimezone?: boolean | undefined;
|
|
18
|
+
timezone?: string | undefined;
|
|
17
19
|
}) => ReactElement;
|
package/esm/date-input/Before.js
CHANGED
|
@@ -5,11 +5,11 @@ import { DatePicker as DefaultDatePicker } from '../date-picker';
|
|
|
5
5
|
import { CalendarIconButton } from './CalendarIconButton';
|
|
6
6
|
import { mergeOverrides, useOverrides } from '../overrides';
|
|
7
7
|
export var Before = function (_a) {
|
|
8
|
-
var weekStartsOn = _a.weekStartsOn, adapter = _a.adapter, locale = _a.locale, overrides = _a.overrides, _onChange = _a.onChange, minDate = _a.minDate, maxDate = _a.maxDate, value = _a.value, timeSelect = _a.timeSelect, props = __rest(_a, ["weekStartsOn", "adapter", "locale", "overrides", "onChange", "minDate", "maxDate", "value", "timeSelect"]);
|
|
8
|
+
var weekStartsOn = _a.weekStartsOn, adapter = _a.adapter, locale = _a.locale, overrides = _a.overrides, _onChange = _a.onChange, minDate = _a.minDate, maxDate = _a.maxDate, value = _a.value, timeSelect = _a.timeSelect, _b = _a.showTimezone, showTimezone = _b === void 0 ? false : _b, timezone = _a.timezone, props = __rest(_a, ["weekStartsOn", "adapter", "locale", "overrides", "onChange", "minDate", "maxDate", "value", "timeSelect", "showTimezone", "timezone"]);
|
|
9
9
|
var onChange = useCallback(function (data) {
|
|
10
|
-
_onChange(data.value);
|
|
10
|
+
_onChange(data.value, data.timezone);
|
|
11
11
|
}, [_onChange]);
|
|
12
|
-
var
|
|
12
|
+
var _c = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.DatePicker, DefaultDatePicker), 2), DatePicker = _c[0], datePickerProps = _c[1];
|
|
13
13
|
var mergedOverrides = useMemo(function () {
|
|
14
14
|
var _a;
|
|
15
15
|
return mergeOverrides({
|
|
@@ -19,5 +19,5 @@ export var Before = function (_a) {
|
|
|
19
19
|
},
|
|
20
20
|
}, (_a = datePickerProps) === null || _a === void 0 ? void 0 : _a.overrides);
|
|
21
21
|
}, [datePickerProps, props]);
|
|
22
|
-
return (_jsx(DatePicker, __assign({ weekStartsOn: weekStartsOn, adapter: adapter, locale: locale, onChange: onChange, disabled: props.$disabled, timeSelect: timeSelect, minDate: minDate, maxDate: maxDate, value: value }, datePickerProps, { overrides: mergedOverrides }), void 0));
|
|
22
|
+
return (_jsx(DatePicker, __assign({ weekStartsOn: weekStartsOn, adapter: adapter, locale: locale, onChange: onChange, disabled: props.$disabled, timeSelect: timeSelect, minDate: minDate, maxDate: maxDate, value: value, showTimezone: showTimezone, timezone: timezone }, datePickerProps, { overrides: mergedOverrides }), void 0));
|
|
23
23
|
};
|
|
@@ -3,4 +3,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import BaseCalendarIcon from '../icon/components/calendar-solid';
|
|
4
4
|
import { IconButton } from '../button';
|
|
5
5
|
import { Box } from '../box';
|
|
6
|
-
|
|
6
|
+
import { useLocale } from '../locale';
|
|
7
|
+
import { useStyle } from '../style';
|
|
8
|
+
export var CalendarIconButton = function (props) {
|
|
9
|
+
var locale = useLocale();
|
|
10
|
+
var theme = useStyle().theme;
|
|
11
|
+
return (_jsx(Box, __assign({ className: "flex items-center h-full pl-1" }, { children: _jsx(IconButton, __assign({ size: theme.density === 'COMPACT' ? 'xxxs' : 'xxs', className: "flex items-center", disabled: props.$disabled, type: "button", "aria-label": locale.calendar.calendarButtonAriaLabel }, { children: _jsx(BaseCalendarIcon, {}, void 0) }), void 0) }), void 0));
|
|
12
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { DateInputProps } from './types';
|
|
3
|
-
export declare const DateInput: ({ adapter, formatString, mask, onChange, value, locale, weekStartsOn, maskChar, overrides, minDate, maxDate, timeSelect, ...restProps }: DateInputProps) => ReactElement;
|
|
3
|
+
export declare const DateInput: ({ adapter, formatString, mask, onChange, value, locale, weekStartsOn, maskChar, overrides, minDate, maxDate, timeSelect, showTimezone, timezone, ...restProps }: DateInputProps) => ReactElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __assign, __read, __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useMemo, useState, useCallback
|
|
3
|
+
import { useMemo, useState, useCallback } from 'react';
|
|
4
4
|
import InputMask from 'react-input-mask';
|
|
5
5
|
import DateHelpers from 'baseui/datepicker/utils/date-helpers';
|
|
6
6
|
import dateFnsAdapter from 'baseui/datepicker/utils/date-fns-adapter';
|
|
@@ -10,24 +10,18 @@ import { mergeOverrides } from '../overrides';
|
|
|
10
10
|
import { DEFAULT_FORMAT_STRING } from '../date-picker/constants';
|
|
11
11
|
import { prepareLocale, formatDate, normalizeDashes, isDayInRange } from '../date-picker/utils';
|
|
12
12
|
import { inputStyles } from './styled-components';
|
|
13
|
+
import { convertDateFromSystemTzToTargetTz, getSystemTzName, convertDateFromTargetTzToSystemTz, } from '../time-range-picker/utils';
|
|
14
|
+
import { useContextualFormProps } from '../form-control/context';
|
|
13
15
|
export var DateInput = function (_a) {
|
|
14
|
-
var _b = _a.adapter, adapter = _b === void 0 ? dateFnsAdapter : _b, _c = _a.formatString, formatString = _c === void 0 ? DEFAULT_FORMAT_STRING : _c, mask = _a.mask, onChange = _a.onChange, value = _a.value, locale = _a.locale, weekStartsOn = _a.weekStartsOn, _d = _a.maskChar, maskChar = _d === void 0 ? '_' : _d, overrides = _a.overrides, minDate = _a.minDate, maxDate = _a.maxDate, timeSelect = _a.timeSelect, restProps = __rest(_a, ["adapter", "formatString", "mask", "onChange", "value", "locale", "weekStartsOn", "maskChar", "overrides", "minDate", "maxDate", "timeSelect"]);
|
|
16
|
+
var _b = _a.adapter, adapter = _b === void 0 ? dateFnsAdapter : _b, _c = _a.formatString, formatString = _c === void 0 ? DEFAULT_FORMAT_STRING : _c, mask = _a.mask, onChange = _a.onChange, value = _a.value, locale = _a.locale, weekStartsOn = _a.weekStartsOn, _d = _a.maskChar, maskChar = _d === void 0 ? '_' : _d, overrides = _a.overrides, minDate = _a.minDate, maxDate = _a.maxDate, timeSelect = _a.timeSelect, _e = _a.showTimezone, showTimezone = _e === void 0 ? false : _e, _f = _a.timezone, timezone = _f === void 0 ? getSystemTzName() : _f, restProps = __rest(_a, ["adapter", "formatString", "mask", "onChange", "value", "locale", "weekStartsOn", "maskChar", "overrides", "minDate", "maxDate", "timeSelect", "showTimezone", "timezone"]);
|
|
17
|
+
var intent = useContextualFormProps(restProps).intent;
|
|
15
18
|
var dateFnsLocale = useMemo(function () { return prepareLocale(locale, { weekStartsOn: weekStartsOn }); }, [weekStartsOn, locale]);
|
|
16
19
|
var dateHelpers = useMemo(function () { return new DateHelpers(adapter); }, [adapter]);
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
maxDate: maxDate,
|
|
23
|
-
dateHelpers: dateHelpers,
|
|
24
|
-
})) {
|
|
25
|
-
setError(false);
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
setError(true);
|
|
29
|
-
}
|
|
30
|
-
}, [dateHelpers, maxDate, minDate, value]);
|
|
20
|
+
var timezoneAdaptedValue = useMemo(function () { return (value ? new Date(convertDateFromSystemTzToTargetTz(value, timezone)) : undefined); }, [value, timezone]);
|
|
21
|
+
var _g = __read(useState(function () {
|
|
22
|
+
return formatDate({ date: timezoneAdaptedValue, locale: dateFnsLocale, dateHelpers: dateHelpers, formatString: formatString });
|
|
23
|
+
}), 2), date = _g[0], setDate = _g[1];
|
|
24
|
+
var _h = __read(useState(function () { return !isDayInRange(timezoneAdaptedValue, { minDate: minDate, maxDate: maxDate, dateHelpers: dateHelpers }); }), 2), error = _h[0], setError = _h[1];
|
|
31
25
|
var getMask = useCallback(function () {
|
|
32
26
|
if (!mask && formatString !== DEFAULT_FORMAT_STRING) {
|
|
33
27
|
return null;
|
|
@@ -44,7 +38,10 @@ export var DateInput = function (_a) {
|
|
|
44
38
|
var _mask = getMask();
|
|
45
39
|
var _date = dateHelpers.date(dateString);
|
|
46
40
|
// to check the clearable cases
|
|
47
|
-
if ((typeof _mask === 'string' &&
|
|
41
|
+
if ((typeof _mask === 'string' &&
|
|
42
|
+
inputValue.replace(new RegExp(maskChar, 'g'), ' ') === _mask.replace(/[9|a|*]/g, ' ')) ||
|
|
43
|
+
inputValue.length === 0) {
|
|
44
|
+
setError(false);
|
|
48
45
|
onChange(null);
|
|
49
46
|
return;
|
|
50
47
|
}
|
|
@@ -55,19 +52,28 @@ export var DateInput = function (_a) {
|
|
|
55
52
|
_date = dateHelpers.parseString(dateString, formatString, dateFnsLocale);
|
|
56
53
|
}
|
|
57
54
|
var isValidDate = _date && dateHelpers.isValid(_date);
|
|
58
|
-
if (isValidDate) {
|
|
59
|
-
setError(
|
|
55
|
+
if (isValidDate && _date) {
|
|
56
|
+
setError(!isDayInRange(_date, { minDate: minDate, maxDate: maxDate, dateHelpers: dateHelpers }));
|
|
60
57
|
setDate(formatDate({ date: _date, locale: dateFnsLocale, dateHelpers: dateHelpers, formatString: formatString }));
|
|
61
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(_date);
|
|
58
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(new Date(convertDateFromTargetTzToSystemTz(_date, timezone)), timezone);
|
|
62
59
|
}
|
|
63
60
|
else {
|
|
61
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(null);
|
|
64
62
|
setError(true);
|
|
65
63
|
}
|
|
66
|
-
}, [onChange, dateFnsLocale, dateHelpers, formatString, getMask]);
|
|
67
|
-
var onCalendarDateChange = useCallback(function (_date) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
64
|
+
}, [onChange, dateFnsLocale, dateHelpers, formatString, getMask, timezone, maskChar, maxDate, minDate]);
|
|
65
|
+
var onCalendarDateChange = useCallback(function (_date, _timezone) {
|
|
66
|
+
// _date is timezone adapted date, original date is what user actually selected from calendar
|
|
67
|
+
var originalDate = new Date(convertDateFromSystemTzToTargetTz(_date, _timezone));
|
|
68
|
+
setDate(formatDate({
|
|
69
|
+
date: originalDate,
|
|
70
|
+
locale: dateFnsLocale,
|
|
71
|
+
dateHelpers: dateHelpers,
|
|
72
|
+
formatString: formatString,
|
|
73
|
+
}));
|
|
74
|
+
setError(!isDayInRange(originalDate, { minDate: minDate, maxDate: maxDate, dateHelpers: dateHelpers }));
|
|
75
|
+
onChange(_date, _timezone);
|
|
76
|
+
}, [onChange, dateFnsLocale, dateHelpers, formatString, minDate, maxDate]);
|
|
71
77
|
var mergedOverrides = useMemo(function () {
|
|
72
78
|
return mergeOverrides({
|
|
73
79
|
Before: {
|
|
@@ -77,16 +83,31 @@ export var DateInput = function (_a) {
|
|
|
77
83
|
locale: locale,
|
|
78
84
|
onChange: onCalendarDateChange,
|
|
79
85
|
weekStartsOn: weekStartsOn,
|
|
86
|
+
// passing value as it is as date picker will adapt this with timezone
|
|
80
87
|
value: value,
|
|
81
88
|
minDate: minDate,
|
|
82
89
|
maxDate: maxDate,
|
|
83
90
|
timeSelect: timeSelect,
|
|
91
|
+
showTimezone: showTimezone,
|
|
92
|
+
timezone: timezone,
|
|
84
93
|
},
|
|
85
94
|
},
|
|
86
95
|
Input: {
|
|
87
96
|
style: inputStyles,
|
|
88
97
|
},
|
|
89
98
|
}, overrides);
|
|
90
|
-
}, [
|
|
91
|
-
|
|
99
|
+
}, [
|
|
100
|
+
adapter,
|
|
101
|
+
onCalendarDateChange,
|
|
102
|
+
locale,
|
|
103
|
+
overrides,
|
|
104
|
+
value,
|
|
105
|
+
weekStartsOn,
|
|
106
|
+
minDate,
|
|
107
|
+
maxDate,
|
|
108
|
+
timeSelect,
|
|
109
|
+
showTimezone,
|
|
110
|
+
timezone,
|
|
111
|
+
]);
|
|
112
|
+
return (_jsx(InputMask, __assign({ mask: getMask(), value: date, maskChar: maskChar, onChange: handleInputChange, disabled: restProps.disabled, onBlur: restProps.onBlur }, { children: function (props) { return _jsx(Input, __assign({}, restProps, props, { intent: error ? 'error' : intent, overrides: mergedOverrides }), void 0); } }), void 0));
|
|
92
113
|
};
|
|
@@ -3,10 +3,13 @@ var dateInputSizeConfig = {
|
|
|
3
3
|
md: { paddingLeft: '4px' },
|
|
4
4
|
lg: { paddingLeft: '8px' },
|
|
5
5
|
};
|
|
6
|
-
export var inputStyles =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
export var inputStyles = [
|
|
7
|
+
'tabular-nums',
|
|
8
|
+
function (utils, _a) {
|
|
9
|
+
var _b;
|
|
10
|
+
var $size = _a.$size;
|
|
11
|
+
return ({
|
|
12
|
+
paddingLeft: ((_b = dateInputSizeConfig[$size]) !== null && _b !== void 0 ? _b : dateInputSizeConfig.lg).paddingLeft,
|
|
13
|
+
});
|
|
14
|
+
},
|
|
15
|
+
];
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { WeekStartsOn } from '../date-picker';
|
|
2
2
|
import { InputProps } from '../input';
|
|
3
|
-
export declare type DateInputProps = Omit<InputProps, 'value' | 'onChange' | '
|
|
3
|
+
export declare type DateInputProps = Omit<InputProps, 'value' | 'onChange' | 'min' | 'max' | 'debouncedOnChange' | 'debounceInterval' | 'type' | 'inputMode'> & {
|
|
4
4
|
formatString?: string;
|
|
5
5
|
adapter?: any;
|
|
6
6
|
mask?: string;
|
|
7
7
|
locale?: any;
|
|
8
8
|
value?: Date;
|
|
9
|
-
onChange: (value?: Date | null) => void;
|
|
9
|
+
onChange: (value?: Date | null, timezone?: string) => void;
|
|
10
10
|
weekStartsOn?: WeekStartsOn;
|
|
11
11
|
maskChar?: string;
|
|
12
12
|
minDate?: Date;
|
|
13
13
|
maxDate?: Date;
|
|
14
14
|
timeSelect?: boolean;
|
|
15
|
+
showTimezone?: boolean;
|
|
16
|
+
timezone?: string;
|
|
15
17
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SharedStyleProps } from './types';
|
|
3
|
-
declare const _default: import("react").ForwardRefExoticComponent<Omit<import("baseui/datepicker").CalendarProps
|
|
3
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<import("baseui/datepicker").CalendarProps<Date>, "overrides"> & {
|
|
4
4
|
formatString?: string | undefined;
|
|
5
5
|
overrides?: import("./types").DatepickerOverrides<SharedStyleProps> | undefined;
|
|
6
6
|
adapter?: any;
|
|
@@ -5,18 +5,21 @@ import { Calendar as BaseCalendar } from 'baseui/datepicker';
|
|
|
5
5
|
import dateFnsAdapter from 'baseui/datepicker/utils/date-fns-adapter';
|
|
6
6
|
import DateHelpers from 'baseui/datepicker/utils/date-helpers';
|
|
7
7
|
import { DENSITY } from 'baseui/datepicker/constants';
|
|
8
|
-
import
|
|
8
|
+
import _merge from 'lodash/merge';
|
|
9
|
+
import ChevronLeft from '../icon/components/chevron-left';
|
|
10
|
+
import ChevronRight from '../icon/components/chevron-right';
|
|
9
11
|
import { useConvertOverrides } from '../helpers/baseui/useConvertOverrides';
|
|
10
12
|
import { Popover } from '../popover';
|
|
11
13
|
import { Menu, MenuItem } from '../menu';
|
|
12
14
|
import { IconButton } from '../button';
|
|
13
|
-
import {
|
|
15
|
+
import { themeContext, useTheme } from '../theme';
|
|
14
16
|
import { DateTimeContainer } from './DateTimeContainer';
|
|
15
17
|
import withThemeOverride from '../helpers/baseui/withThemeOverride';
|
|
16
18
|
import { getDayStyles, getCalendarContainerStyles } from './styled-components';
|
|
17
19
|
import { DEFAULT_FORMAT_STRING } from './constants';
|
|
18
20
|
import { prepareLocale } from './utils';
|
|
19
|
-
|
|
21
|
+
import { useIsMobileDevice } from '../hooks/useIsMobileDevice';
|
|
22
|
+
var CALENDAR_CUSTOM_THEME = { theme: { input: { borderRadius: '4px', sizeSm: { borderRadius: '4px' } } } };
|
|
20
23
|
var MonthYearSelectMenu = function (props) {
|
|
21
24
|
var _a = __read(useState(props.initialState.highlightedIndex), 2), highlightedIndex = _a[0], setHighlightedIndex = _a[1];
|
|
22
25
|
var onItemSelect = props.onItemSelect;
|
|
@@ -41,6 +44,7 @@ var isHiddenPaginationButton = function (direction, order, monthsShown) {
|
|
|
41
44
|
var ArrowButton = function (_a) {
|
|
42
45
|
var $order = _a.$order, monthsShown = _a.monthsShown, direction = _a.direction, nextButtonProps = __rest(_a, ["$order", "monthsShown", "direction"]);
|
|
43
46
|
var isHidden = isHiddenPaginationButton(direction, $order, monthsShown);
|
|
47
|
+
var ChevronIcon = direction === 'next' ? ChevronRight : ChevronLeft;
|
|
44
48
|
return (_jsx(IconButton, __assign({ className: [
|
|
45
49
|
'h-6 w-6',
|
|
46
50
|
isHidden ? 'invisible' : 'visible',
|
|
@@ -50,13 +54,18 @@ var ArrowButton = function (_a) {
|
|
|
50
54
|
minWidth: px2rem(24),
|
|
51
55
|
});
|
|
52
56
|
},
|
|
53
|
-
] }, nextButtonProps, { children: _jsx(
|
|
57
|
+
] }, nextButtonProps, { children: _jsx(ChevronIcon, { size: 8 }, void 0) }), void 0));
|
|
54
58
|
};
|
|
55
59
|
var Calendar = function (_a) {
|
|
56
|
-
var
|
|
60
|
+
var _b;
|
|
61
|
+
var overrides = _a.overrides, _c = _a.adapter, adapter = _c === void 0 ? dateFnsAdapter : _c, _d = _a.formatString, formatString = _d === void 0 ? DEFAULT_FORMAT_STRING : _d, weekStartsOn = _a.weekStartsOn, props = __rest(_a, ["overrides", "adapter", "formatString", "weekStartsOn"]);
|
|
62
|
+
var currentTheme = useTheme();
|
|
63
|
+
var isMobileDevice = useIsMobileDevice();
|
|
64
|
+
var Provider = themeContext.Provider;
|
|
57
65
|
var dateHelpers = useMemo(function () { return new DateHelpers(adapter); }, [adapter]);
|
|
58
66
|
var todaySOD = adapter.startOfDay(new Date());
|
|
59
|
-
var
|
|
67
|
+
var value = props.value, onChange = props.onChange, range = props.range, timeSelectStart = props.timeSelectStart, timeSelectEnd = props.timeSelectEnd;
|
|
68
|
+
var monthsShown = isMobileDevice ? 1 : (_b = props.monthsShown) !== null && _b !== void 0 ? _b : 1;
|
|
60
69
|
var dateFnsLocale = useMemo(function () { return prepareLocale(props.locale, { weekStartsOn: weekStartsOn }); }, [weekStartsOn, props.locale]);
|
|
61
70
|
var setTime = useCallback(function (_a) {
|
|
62
71
|
var date = _a.date, hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds;
|
|
@@ -197,7 +206,8 @@ var Calendar = function (_a) {
|
|
|
197
206
|
props.minDate,
|
|
198
207
|
props.maxDate,
|
|
199
208
|
]);
|
|
200
|
-
|
|
209
|
+
var calendarTheme = useMemo(function () { return _merge({}, currentTheme, CALENDAR_CUSTOM_THEME); }, [currentTheme]);
|
|
210
|
+
return (_jsx(Provider, __assign({ value: calendarTheme }, { children: _jsx(BaseCalendar, __assign({ orientation: "vertical" }, props, { onChange: handleCalendarDateChange, overrides: convertedOverrides, timeSelectEnd: false, locale: dateFnsLocale, monthsShown: monthsShown,
|
|
201
211
|
//@ts-ignore baseweb has type inconsistency in declaration file
|
|
202
212
|
density: DENSITY.high }), void 0) }), void 0));
|
|
203
213
|
};
|
|
@@ -3,11 +3,12 @@ import DateHelpers from 'baseui/datepicker/utils/date-helpers';
|
|
|
3
3
|
export declare const isDateValid: (value: any) => boolean;
|
|
4
4
|
declare type DateInputProps = {
|
|
5
5
|
locale?: any;
|
|
6
|
-
dateHelpers: DateHelpers
|
|
6
|
+
dateHelpers: DateHelpers<Date>;
|
|
7
7
|
onChange: (date: Date) => void;
|
|
8
8
|
date?: Date | null;
|
|
9
9
|
minDate?: Date;
|
|
10
10
|
maxDate?: Date;
|
|
11
|
+
disabled?: boolean;
|
|
11
12
|
};
|
|
12
|
-
export declare const DateInput: React.MemoExoticComponent<({ dateHelpers, date, onChange, maxDate, minDate }: DateInputProps) => JSX.Element>;
|
|
13
|
+
export declare const DateInput: React.MemoExoticComponent<({ dateHelpers, date, onChange, maxDate, minDate, disabled }: DateInputProps) => JSX.Element>;
|
|
13
14
|
export {};
|
|
@@ -3,12 +3,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import getDaysInMonth from 'date-fns/getDaysInMonth';
|
|
5
5
|
import InputMask from 'react-input-mask';
|
|
6
|
-
import { borderColor } from '../helpers/longHandHelpers';
|
|
6
|
+
import { borderColor, borderRadius } from '../helpers/longHandHelpers';
|
|
7
7
|
import { Input } from '../input';
|
|
8
8
|
import { isDayInRange } from './utils';
|
|
9
9
|
import { Box } from '../box';
|
|
10
|
+
import { getComponentSizeTheme, getDefaultSize } from '../helpers/themeHelpers';
|
|
11
|
+
import { useTheme } from '../theme';
|
|
10
12
|
var COMMON_STYLE = [
|
|
11
|
-
'px-0 py-0 rounded-2
|
|
13
|
+
'px-0 py-0 rounded-2 focus:spr-ui-04 focus:spr-text-05 text-center',
|
|
12
14
|
function (_a) {
|
|
13
15
|
var theme = _a.theme, px2rem = _a.px2rem;
|
|
14
16
|
return ({
|
|
@@ -19,14 +21,13 @@ var COMMON_STYLE = [
|
|
|
19
21
|
caretColor: theme.spr.ui01,
|
|
20
22
|
},
|
|
21
23
|
fontVariantNumeric: 'tabular-nums',
|
|
22
|
-
lineHeight: px2rem(16),
|
|
23
24
|
});
|
|
24
25
|
},
|
|
25
26
|
];
|
|
26
27
|
var DATE_CLASSNAME = [
|
|
27
28
|
'text-center flex-none',
|
|
28
29
|
{
|
|
29
|
-
maxWidth: '1.
|
|
30
|
+
maxWidth: '1.9rem',
|
|
30
31
|
},
|
|
31
32
|
];
|
|
32
33
|
var DATE_OVERRIDES = {
|
|
@@ -43,7 +44,7 @@ var DATE_OVERRIDES = {
|
|
|
43
44
|
var MONTH_CLASSNAME = [
|
|
44
45
|
'text-center flex-none',
|
|
45
46
|
{
|
|
46
|
-
maxWidth: '2.
|
|
47
|
+
maxWidth: '2.7rem',
|
|
47
48
|
},
|
|
48
49
|
];
|
|
49
50
|
var MONTH_OVERRIDES = {
|
|
@@ -60,7 +61,7 @@ var MONTH_OVERRIDES = {
|
|
|
60
61
|
var YEAR_CLASSNAME = [
|
|
61
62
|
'text-center flex-none',
|
|
62
63
|
{
|
|
63
|
-
maxWidth: '3.
|
|
64
|
+
maxWidth: '3.7rem',
|
|
64
65
|
},
|
|
65
66
|
];
|
|
66
67
|
var YEAR_OVERRIDES = {
|
|
@@ -92,12 +93,15 @@ var MONTH_LABELS = [
|
|
|
92
93
|
var MIN_YEAR = 1900;
|
|
93
94
|
var MAX_YEAR = 2100;
|
|
94
95
|
export var isDateValid = function (value) { return value > 0 && value <= 31; };
|
|
96
|
+
export var DateInput = React.memo(
|
|
95
97
|
// eslint-disable-next-line max-statements
|
|
96
|
-
|
|
97
|
-
var
|
|
98
|
-
var
|
|
99
|
-
var
|
|
100
|
-
var
|
|
98
|
+
function (_a) {
|
|
99
|
+
var _b;
|
|
100
|
+
var dateHelpers = _a.dateHelpers, date = _a.date, onChange = _a.onChange, maxDate = _a.maxDate, minDate = _a.minDate, disabled = _a.disabled;
|
|
101
|
+
var theme = useTheme().theme;
|
|
102
|
+
var _c = __read(React.useState(function () { return (date ? dateHelpers.formatDate(date, 'dd') : ''); }), 2), day = _c[0], setDay = _c[1];
|
|
103
|
+
var _d = __read(React.useState(function () { return (date ? dateHelpers.getYear(date) : ''); }), 2), year = _d[0], setYear = _d[1];
|
|
104
|
+
var _e = __read(React.useState(false), 2), error = _e[0], setError = _e[1];
|
|
101
105
|
var minAllowedDate = 1;
|
|
102
106
|
var maxAllowedDate = getDaysInMonth(date || new Date());
|
|
103
107
|
var minYear = minDate ? dateHelpers.getYear(minDate) : MIN_YEAR;
|
|
@@ -110,7 +114,7 @@ export var DateInput = React.memo(function (_a) {
|
|
|
110
114
|
setError(true);
|
|
111
115
|
}
|
|
112
116
|
setDay(date ? dateHelpers.formatDate(date, 'dd') : '');
|
|
113
|
-
setYear(date ? dateHelpers.
|
|
117
|
+
setYear(date ? dateHelpers.getYear(date) : '');
|
|
114
118
|
}, [date, minDate, maxDate, dateHelpers]);
|
|
115
119
|
var updateDate = function (nextDate) {
|
|
116
120
|
if (isDateValid(nextDate)) {
|
|
@@ -206,11 +210,9 @@ export var DateInput = React.memo(function (_a) {
|
|
|
206
210
|
}
|
|
207
211
|
};
|
|
208
212
|
var month = date ? dateHelpers.formatDate(date, 'MMM') : '';
|
|
213
|
+
var inputSizeTheme = getComponentSizeTheme(theme, 'input', 'sm', getDefaultSize(theme));
|
|
209
214
|
return (_jsxs(Box, __assign({ "data-testid": "date-input", className: [
|
|
210
|
-
'px-3 flex items-center border-1 border-solid
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
return (__assign(__assign({}, borderColor(error ? theme.spr.supportError : theme.spr.ui03)), { height: px2rem(35) }));
|
|
214
|
-
},
|
|
215
|
-
] }, { children: [_jsx(InputMask, __assign({ onBlur: dateBlur, onKeyDown: dateKeyDown, mask: "99", value: day, onChange: dayChange, maskChar: "_" }, { children: function (props) { return (_jsx(Input, __assign({}, props, { className: DATE_CLASSNAME, overrides: DATE_OVERRIDES, placeholder: "dd", size: "sm" }), void 0)); } }), void 0), _jsx(InputMask, __assign({ value: month, onKeyDown: monthKeyDown, mask: "aaa", maskChar: "_" }, { children: function (props) { return (_jsx(Input, __assign({}, props, { className: MONTH_CLASSNAME, overrides: MONTH_OVERRIDES, placeholder: "MM", size: "sm" }), void 0)); } }), void 0), _jsx(InputMask, __assign({ onBlur: yearBlur, onKeyDown: yearKeyDown, mask: "9999", value: year, onChange: yearChange, maskChar: "_" }, { children: function (props) { return (_jsx(Input, __assign({}, props, { className: YEAR_CLASSNAME, overrides: YEAR_OVERRIDES, placeholder: "yyyy", size: "sm" }), void 0)); } }), void 0)] }), void 0));
|
|
215
|
+
'px-3 flex items-center border-1 border-solid border-box',
|
|
216
|
+
__assign(__assign(__assign(__assign({}, borderColor(error ? theme.spr.supportError : theme.spr.ui03)), borderRadius((_b = inputSizeTheme.borderRadius) !== null && _b !== void 0 ? _b : theme.input.borderRadius)), { paddingLeft: inputSizeTheme.paddingX, paddingRight: inputSizeTheme.paddingX, paddingTop: inputSizeTheme.paddingY, paddingBottom: inputSizeTheme.paddingY }), (disabled ? { backgroundColor: theme.spr.ui02 } : { backgroundColor: theme.spr.ui01 })),
|
|
217
|
+
] }, { children: [_jsx(InputMask, __assign({ onBlur: dateBlur, onKeyDown: dateKeyDown, mask: "99", value: day, onChange: dayChange, maskChar: "_", disabled: disabled }, { children: function (props) { return (_jsx(Input, __assign({}, props, { className: DATE_CLASSNAME, overrides: DATE_OVERRIDES, placeholder: "dd", size: "sm", disabled: disabled }), void 0)); } }), void 0), _jsx(InputMask, __assign({ value: month, onKeyDown: monthKeyDown, mask: "aaa", maskChar: "_", disabled: disabled }, { children: function (props) { return (_jsx(Input, __assign({}, props, { className: MONTH_CLASSNAME, overrides: MONTH_OVERRIDES, placeholder: "MM", size: "sm", disabled: disabled }), void 0)); } }), void 0), _jsx(InputMask, __assign({ onBlur: yearBlur, onKeyDown: yearKeyDown, mask: "9999", value: year, onChange: yearChange, maskChar: "_", disabled: disabled }, { children: function (props) { return (_jsx(Input, __assign({}, props, { className: YEAR_CLASSNAME, overrides: YEAR_OVERRIDES, placeholder: "yyyy", size: "sm", disabled: disabled }), void 0)); } }), void 0)] }), void 0));
|
|
216
218
|
});
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { DatepickerOverrides, CalendarProps } from './types';
|
|
3
|
-
declare type DatePickerContentProps = Omit<CalendarProps, 'timeSelectEnd' | 'timeSelectStart'> & {
|
|
2
|
+
import { DatepickerOverrides, CalendarProps, Nullable } from './types';
|
|
3
|
+
declare type DatePickerContentProps = Omit<CalendarProps, 'timeSelectEnd' | 'timeSelectStart' | 'onChange'> & {
|
|
4
4
|
overrides?: DatepickerOverrides;
|
|
5
5
|
timeSelect?: boolean;
|
|
6
6
|
onClose: () => void;
|
|
7
|
+
showTimezone?: boolean;
|
|
8
|
+
timezone: string;
|
|
9
|
+
onChange: (params: {
|
|
10
|
+
date?: Nullable<Date>[] | Nullable<Date>;
|
|
11
|
+
timezone?: string;
|
|
12
|
+
}) => void;
|
|
7
13
|
};
|
|
8
|
-
export declare const DatePickerContent: ({ value: _value, onChange, overrides, autoFocusCalendar, onClose, adapter, ...props }: DatePickerContentProps) => React.ReactElement;
|
|
14
|
+
export declare const DatePickerContent: ({ value: _value, onChange, overrides, autoFocusCalendar, onClose, adapter, showTimezone, timezone: _timezone, ...props }: DatePickerContentProps) => React.ReactElement;
|
|
9
15
|
export {};
|