@sprinklrjs/spaceweb 11.0.0 → 12.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/allComponentsAndUtilities.d.ts +1 -0
- package/allComponentsAndUtilities.js +2 -1
- package/asyncSelect/asyncSelect.d.ts +4 -2
- package/asyncSelect/asyncSelect.js +43 -108
- package/asyncSelect/groupedAsyncSelect.d.ts +5 -0
- package/asyncSelect/groupedAsyncSelect.js +41 -0
- package/asyncSelect/helpers.d.ts +8 -2
- package/asyncSelect/helpers.js +35 -4
- package/asyncSelect/hooks/useAsyncOptionHandlers.d.ts +16 -11
- package/asyncSelect/hooks/useAsyncOptionHandlers.js +73 -26
- package/asyncSelect/hooks/useAsyncSelect.d.ts +10 -0
- package/asyncSelect/hooks/useAsyncSelect.js +182 -0
- package/asyncSelect/hooks/useResolveSelectedOptions.d.ts +10 -7
- package/asyncSelect/hooks/useResolveSelectedOptions.js +59 -47
- package/asyncSelect/index.d.ts +4 -1
- package/asyncSelect/index.js +8 -0
- package/asyncSelect/types.d.ts +61 -9
- package/avatar/avatar.js +12 -2
- package/avatar/styled-component.js +7 -22
- package/badge/styled-component.js +10 -8
- package/banner/banner.js +1 -1
- package/breadcrumb/breadcrumb-item.d.ts +7 -0
- package/breadcrumb/breadcrumb-item.js +41 -0
- package/breadcrumb/breadcrumb.d.ts +7 -0
- package/breadcrumb/breadcrumb.js +29 -0
- package/breadcrumb/index.d.ts +4 -0
- package/breadcrumb/index.js +17 -0
- package/breadcrumb/package.json +4 -0
- package/breadcrumb/styled-components.d.ts +7 -0
- package/breadcrumb/styled-components.js +19 -0
- package/breadcrumb/types.d.ts +38 -0
- package/breadcrumb/types.js +2 -0
- package/button/Button.d.ts +2 -0
- package/button/Button.js +13 -1
- package/button/IconButton/IconButton.d.ts +2 -4
- package/button/IconButton/IconButton.js +5 -2
- package/button/IconButton/types.d.ts +10 -1
- package/button/basewebAdapter.d.ts +3 -1
- package/button/styled-components.js +30 -25
- package/button/types.d.ts +3 -0
- package/button-group/ButtonGroup.d.ts +1 -0
- package/button-group/ButtonGroup.js +9 -5
- package/button-group/StatefulButtonGroup.d.ts +1 -0
- package/button-group/styled-components.d.ts +34 -0
- package/button-group/styled-components.js +57 -9
- package/button-group/types.d.ts +2 -0
- package/checkbox/basewebAdapters.js +6 -1
- package/color-picker/ColorPalette.d.ts +9 -0
- package/color-picker/ColorPalette.js +26 -0
- package/color-picker/ColorPicker.d.ts +3 -0
- package/color-picker/ColorPicker.js +35 -0
- package/color-picker/Swatch.d.ts +12 -0
- package/color-picker/Swatch.js +40 -0
- package/color-picker/colors.d.ts +1 -0
- package/color-picker/colors.js +109 -0
- package/color-picker/getContrastRatio.d.ts +1 -0
- package/color-picker/getContrastRatio.js +23 -0
- package/color-picker/index.d.ts +3 -0
- package/color-picker/index.js +7 -0
- package/color-picker/locale.d.ts +3 -0
- package/color-picker/locale.js +2 -0
- package/color-picker/package.json +4 -0
- package/color-picker/styled-component.d.ts +1 -0
- package/color-picker/styled-component.js +5 -0
- package/color-picker/types.d.ts +15 -0
- package/color-picker/types.js +2 -0
- package/currency/Currency.d.ts +3 -0
- package/currency/Currency.js +14 -0
- package/currency/constants.d.ts +3 -0
- package/currency/constants.js +8 -0
- package/currency/index.d.ts +5 -0
- package/currency/index.js +12 -0
- package/currency/package.json +4 -0
- package/currency/types.d.ts +7 -0
- package/currency/types.js +2 -0
- package/currency/useCurrency.d.ts +2 -0
- package/currency/useCurrency.js +12 -0
- package/currency/utils.d.ts +8 -0
- package/currency/utils.js +11 -0
- package/date-input/Before.d.ts +4 -2
- package/date-input/Before.js +4 -4
- package/date-input/CalendarIconButton.js +7 -1
- package/date-input/DateInput.d.ts +1 -1
- package/date-input/DateInput.js +46 -25
- package/date-input/styled-components.d.ts +2 -2
- package/date-input/styled-components.js +10 -8
- package/date-input/types.d.ts +4 -2
- package/date-picker/Calendar.js +5 -3
- package/date-picker/DateInput.js +16 -14
- package/date-picker/DatePickerContent.d.ts +9 -3
- package/date-picker/DatePickerContent.js +59 -8
- package/date-picker/DatePickerInput.js +9 -6
- package/date-picker/StatelessDatePicker.js +35 -16
- package/date-picker/locale.d.ts +2 -0
- package/date-picker/stateful-container.js +11 -8
- package/date-picker/styled-components.js +53 -3
- package/date-picker/types.d.ts +10 -1
- package/date-picker/utils.d.ts +3 -1
- package/date-picker/utils.js +8 -3
- package/date-time/DateTime.d.ts +3 -0
- package/date-time/DateTime.js +12 -0
- package/date-time/index.d.ts +3 -0
- package/date-time/index.js +9 -0
- package/date-time/package.json +4 -0
- package/date-time/types.d.ts +21 -0
- package/date-time/types.js +18 -0
- package/date-time/useDateTime.d.ts +2 -0
- package/date-time/useDateTime.js +13 -0
- package/date-time/variants.d.ts +4 -0
- package/date-time/variants.js +87 -0
- package/esm/allComponentsAndUtilities.d.ts +1 -0
- package/esm/allComponentsAndUtilities.js +2 -0
- package/esm/asyncSelect/asyncSelect.d.ts +4 -2
- package/esm/asyncSelect/asyncSelect.js +46 -111
- package/esm/asyncSelect/groupedAsyncSelect.d.ts +5 -0
- package/esm/asyncSelect/groupedAsyncSelect.js +37 -0
- package/esm/asyncSelect/helpers.d.ts +8 -2
- package/esm/asyncSelect/helpers.js +31 -3
- package/esm/asyncSelect/hooks/useAsyncOptionHandlers.d.ts +16 -11
- package/esm/asyncSelect/hooks/useAsyncOptionHandlers.js +76 -29
- package/esm/asyncSelect/hooks/useAsyncSelect.d.ts +10 -0
- package/esm/asyncSelect/hooks/useAsyncSelect.js +178 -0
- package/esm/asyncSelect/hooks/useResolveSelectedOptions.d.ts +10 -7
- package/esm/asyncSelect/hooks/useResolveSelectedOptions.js +62 -50
- package/esm/asyncSelect/index.d.ts +4 -1
- package/esm/asyncSelect/index.js +3 -0
- package/esm/asyncSelect/types.d.ts +61 -9
- package/esm/avatar/avatar.js +12 -2
- package/esm/avatar/styled-component.js +7 -22
- package/esm/badge/styled-component.js +10 -8
- package/esm/banner/banner.js +1 -1
- package/esm/breadcrumb/breadcrumb-item.d.ts +7 -0
- package/esm/breadcrumb/breadcrumb-item.js +39 -0
- package/esm/breadcrumb/breadcrumb.d.ts +7 -0
- package/esm/breadcrumb/breadcrumb.js +27 -0
- package/esm/breadcrumb/index.d.ts +4 -0
- package/esm/breadcrumb/index.js +3 -0
- package/esm/breadcrumb/styled-components.d.ts +7 -0
- package/esm/breadcrumb/styled-components.js +15 -0
- package/esm/breadcrumb/types.d.ts +38 -0
- package/esm/breadcrumb/types.js +1 -0
- package/esm/button/Button.d.ts +2 -0
- package/esm/button/Button.js +13 -1
- package/esm/button/IconButton/IconButton.d.ts +2 -4
- package/esm/button/IconButton/IconButton.js +5 -2
- package/esm/button/IconButton/types.d.ts +10 -1
- package/esm/button/basewebAdapter.d.ts +3 -1
- package/esm/button/styled-components.js +30 -25
- package/esm/button/types.d.ts +3 -0
- package/esm/button-group/ButtonGroup.d.ts +1 -0
- package/esm/button-group/ButtonGroup.js +9 -5
- package/esm/button-group/StatefulButtonGroup.d.ts +1 -0
- package/esm/button-group/styled-components.d.ts +34 -0
- package/esm/button-group/styled-components.js +55 -8
- package/esm/button-group/types.d.ts +2 -0
- package/esm/checkbox/basewebAdapters.js +6 -1
- package/esm/color-picker/ColorPalette.d.ts +9 -0
- package/esm/color-picker/ColorPalette.js +22 -0
- package/esm/color-picker/ColorPicker.d.ts +3 -0
- package/esm/color-picker/ColorPicker.js +31 -0
- package/esm/color-picker/Swatch.d.ts +12 -0
- package/esm/color-picker/Swatch.js +37 -0
- package/esm/color-picker/colors.d.ts +1 -0
- package/esm/color-picker/colors.js +106 -0
- package/esm/color-picker/getContrastRatio.d.ts +1 -0
- package/esm/color-picker/getContrastRatio.js +19 -0
- package/esm/color-picker/index.d.ts +3 -0
- package/esm/color-picker/index.js +2 -0
- package/esm/color-picker/locale.d.ts +3 -0
- package/esm/color-picker/locale.js +1 -0
- package/esm/color-picker/styled-component.d.ts +1 -0
- package/esm/color-picker/styled-component.js +2 -0
- package/esm/color-picker/types.d.ts +15 -0
- package/esm/color-picker/types.js +1 -0
- package/esm/currency/Currency.d.ts +3 -0
- package/esm/currency/Currency.js +10 -0
- package/esm/currency/constants.d.ts +3 -0
- package/esm/currency/constants.js +5 -0
- package/esm/currency/index.d.ts +5 -0
- package/esm/currency/index.js +5 -0
- package/esm/currency/types.d.ts +7 -0
- package/esm/currency/types.js +1 -0
- package/esm/currency/useCurrency.d.ts +2 -0
- package/esm/currency/useCurrency.js +8 -0
- package/esm/currency/utils.d.ts +8 -0
- package/esm/currency/utils.js +7 -0
- package/esm/date-input/Before.d.ts +4 -2
- package/esm/date-input/Before.js +4 -4
- package/esm/date-input/CalendarIconButton.js +7 -1
- package/esm/date-input/DateInput.d.ts +1 -1
- package/esm/date-input/DateInput.js +47 -26
- package/esm/date-input/styled-components.d.ts +2 -2
- package/esm/date-input/styled-components.js +10 -7
- package/esm/date-input/types.d.ts +4 -2
- package/esm/date-picker/Calendar.js +5 -3
- package/esm/date-picker/DateInput.js +17 -15
- package/esm/date-picker/DatePickerContent.d.ts +9 -3
- package/esm/date-picker/DatePickerContent.js +60 -9
- package/esm/date-picker/DatePickerInput.js +9 -6
- package/esm/date-picker/StatelessDatePicker.js +35 -16
- package/esm/date-picker/locale.d.ts +2 -0
- package/esm/date-picker/stateful-container.js +11 -8
- package/esm/date-picker/styled-components.js +53 -3
- package/esm/date-picker/types.d.ts +10 -1
- package/esm/date-picker/utils.d.ts +3 -1
- package/esm/date-picker/utils.js +9 -4
- package/esm/date-time/DateTime.d.ts +3 -0
- package/esm/date-time/DateTime.js +8 -0
- package/esm/date-time/index.d.ts +3 -0
- package/esm/date-time/index.js +3 -0
- package/esm/date-time/types.d.ts +21 -0
- package/esm/date-time/types.js +15 -0
- package/esm/date-time/useDateTime.d.ts +2 -0
- package/esm/date-time/useDateTime.js +9 -0
- package/esm/date-time/variants.d.ts +4 -0
- package/esm/date-time/variants.js +84 -0
- package/esm/form-control/form-control.d.ts +1 -1
- package/esm/form-control/form-control.js +17 -12
- package/esm/form-control/styled-component.js +17 -6
- package/esm/helpers/ClearIconButton.js +3 -1
- package/esm/helpers/StyledTombstone.d.ts +1 -0
- package/esm/helpers/StyledTombstone.js +17 -0
- package/esm/helpers/baseui/useConvertOverrides.js +6 -1
- package/esm/helpers/commonStyles.js +3 -6
- package/esm/helpers/index.d.ts +1 -0
- package/esm/helpers/index.js +8 -0
- package/esm/helpers/themeHelpers.d.ts +1 -0
- package/esm/helpers/themeHelpers.js +13 -0
- package/esm/hooks/useAutoFocus.js +6 -0
- package/esm/hooks/useMatchMedia.js +13 -2
- package/esm/icon/components/alert-solid.js +2 -0
- package/esm/icon/components/alert.js +2 -0
- package/esm/icon/components/calendar-solid.js +2 -0
- package/esm/icon/components/chevron-down.js +2 -0
- package/esm/icon/components/chevron-left.d.ts +3 -0
- package/esm/icon/components/chevron-left.js +8 -0
- package/esm/icon/components/chevron-right.d.ts +3 -0
- package/esm/icon/components/chevron-right.js +8 -0
- package/esm/icon/components/close.js +2 -0
- package/esm/icon/components/error-clr.js +2 -0
- package/esm/icon/components/error-solid.js +2 -0
- package/esm/icon/components/error.js +2 -0
- package/esm/icon/components/imagePreview.js +2 -0
- package/esm/icon/components/info.js +2 -0
- package/esm/icon/components/play-video.js +2 -0
- package/esm/icon/components/reset-color.d.ts +3 -0
- package/esm/icon/components/reset-color.js +8 -0
- package/esm/icon/components/search.js +2 -0
- package/esm/icon/components/tick.js +2 -0
- package/esm/icon/components/tickCircle-solid.js +2 -0
- package/esm/icon/components/user.js +2 -0
- package/esm/icon/components/video-non-playable.js +2 -0
- package/esm/index.d.ts +2 -0
- package/esm/index.js +2 -0
- package/esm/input/basewebAdapters.js +18 -3
- package/esm/input/styled-components.js +8 -6
- package/esm/input/types.d.ts +4 -1
- package/esm/layer/useLayersContextValue.js +3 -2
- package/esm/list/avatar-list-item.d.ts +12 -22
- package/esm/list/avatar-list-item.js +6 -4
- package/esm/list/index.d.ts +1 -1
- package/esm/list/index.js +1 -1
- package/esm/list/list-item.d.ts +3 -1
- package/esm/list/list-item.js +9 -6
- package/esm/list/styled-component.d.ts +1 -0
- package/esm/list/styled-component.js +23 -15
- package/esm/list/types.d.ts +3 -0
- package/esm/locale/en_US.js +26 -0
- package/esm/locale/types.d.ts +19 -0
- package/esm/menu/MenuContext.d.ts +2 -1
- package/esm/menu/MenuContext.js +1 -0
- package/esm/menu/menu-item.d.ts +4 -1
- package/esm/menu/menu-item.js +11 -11
- package/esm/menu/menu.d.ts +1 -0
- package/esm/menu/menu.js +11 -11
- package/esm/menu/types.d.ts +1 -0
- package/esm/menu/useKeyboardNavigation.d.ts +6 -3
- package/esm/menu/useKeyboardNavigation.js +21 -14
- package/esm/menu/useStatefulMenu.d.ts +5 -2
- package/esm/menu/useStatefulMenu.js +14 -8
- package/esm/modal/modal.js +3 -1
- package/esm/modal/overrides.d.ts +2 -2
- package/esm/modal/overrides.js +6 -7
- package/esm/modal/styled-components.js +7 -7
- package/esm/number/Number.d.ts +3 -0
- package/esm/number/Number.js +10 -0
- package/esm/number/constants.d.ts +2 -0
- package/esm/number/constants.js +4 -0
- package/esm/number/index.d.ts +5 -0
- package/esm/number/index.js +5 -0
- package/esm/number/types.d.ts +6 -0
- package/esm/number/types.js +1 -0
- package/esm/number/useNumber.d.ts +2 -0
- package/esm/number/useNumber.js +8 -0
- package/esm/overrides/index.d.ts +1 -1
- package/esm/overrides/index.js +1 -1
- package/esm/overrides/mergeOverrides.d.ts +3 -2
- package/esm/overrides/mergeOverrides.js +1 -1
- package/esm/payment-card/basewebAdapters.d.ts +2 -0
- package/esm/payment-card/basewebAdapters.js +23 -1
- package/esm/payment-card/styled-components.js +25 -6
- package/esm/phone-input/country-select-container.js +1 -1
- package/esm/phone-input/country-select.js +3 -3
- package/esm/phone-input/default-props.d.ts +5 -5
- package/esm/phone-input/default-props.js +7 -7
- package/esm/phone-input/flag-container.js +1 -1
- package/esm/phone-input/phone-input.d.ts +0 -4
- package/esm/phone-input/phone-input.js +20 -12
- package/esm/phone-input/stateful-phone-input-container.js +4 -3
- package/esm/phone-input/stateful-phone-input.d.ts +0 -4
- package/esm/phone-input/styled-components.d.ts +9 -1
- package/esm/phone-input/styled-components.js +21 -7
- package/esm/phone-input/types.d.ts +2 -1
- package/esm/phone-input/utils.d.ts +5 -1
- package/esm/phone-input/utils.js +6 -1
- package/esm/popover/adapter.d.ts +1 -0
- package/esm/popover/adapter.js +15 -0
- package/esm/popover/overrides.js +8 -19
- package/esm/popover/popover.d.ts +1 -0
- package/esm/popover/popover.js +9 -4
- package/esm/popover/stateful-popover.js +2 -2
- package/esm/popover/types.d.ts +3 -0
- package/esm/popover/utils.d.ts +12 -0
- package/esm/popover/utils.js +9 -0
- package/esm/progress/linear/styled-component.d.ts +1 -1
- package/esm/progress/linear/styled-component.js +5 -5
- package/esm/radio/styled-components.js +5 -5
- package/esm/search/index.d.ts +1 -0
- package/esm/search/index.js +1 -0
- package/esm/search/search.d.ts +1 -1
- package/esm/search/search.js +15 -6
- package/esm/search/stateful-search.d.ts +3 -0
- package/esm/search/stateful-search.js +15 -0
- package/esm/search/styled-components.d.ts +1 -10
- package/esm/search/styled-components.js +54 -24
- package/esm/search/types.d.ts +8 -2
- package/esm/select/base-select.d.ts +22 -5
- package/esm/select/base-select.js +174 -82
- package/esm/select/constants.d.ts +3 -0
- package/esm/select/constants.js +3 -1
- package/esm/select/default-props.d.ts +1 -0
- package/esm/select/default-props.js +3 -0
- package/esm/select/index.d.ts +2 -2
- package/esm/select/index.js +2 -2
- package/esm/select/locale.d.ts +4 -0
- package/esm/select/mobileSelect/MobileSheet.js +3 -1
- package/esm/select/multi-value.js +22 -12
- package/esm/select/overlaySelect/OverlaySelect.js +1 -0
- package/esm/select/overlaySelect/hooks/useOverlaySelectOverrides.d.ts +2 -1
- package/esm/select/overlaySelect/hooks/useOverlaySelectOverrides.js +13 -16
- package/esm/select/overrides.d.ts +3 -0
- package/esm/select/overrides.js +19 -6
- package/esm/select/select.d.ts +1 -0
- package/esm/select/select.js +9 -3
- package/esm/select/selectMenuAdapter/CollapsibleSelectMenu.d.ts +118 -0
- package/esm/select/selectMenuAdapter/CollapsibleSelectMenu.js +70 -0
- package/esm/select/selectMenuAdapter/SelectMenuAdapter.d.ts +2 -34
- package/esm/select/selectMenuAdapter/SelectMenuAdapter.js +3 -3
- package/esm/select/selectMenuAdapter/SelectMenuItem.d.ts +4 -1
- package/esm/select/selectMenuAdapter/hooks/useGetExpandedGroup.d.ts +6 -0
- package/esm/select/selectMenuAdapter/hooks/useGetExpandedGroup.js +16 -0
- package/esm/select/selectMenuAdapter/types.d.ts +42 -0
- package/esm/select/selectMenuAdapter/types.js +1 -0
- package/esm/select/stateful-select.d.ts +1 -0
- package/esm/select/styled-component.d.ts +10 -1
- package/esm/select/styled-component.js +39 -15
- package/esm/select/types.d.ts +23 -1
- package/esm/select/types.js +1 -0
- package/esm/select/utils/default-filter-options.d.ts +2 -1
- package/esm/select/utils/default-filter-options.js +5 -1
- package/esm/select/utils/hidden-element.d.ts +6 -0
- package/esm/select/utils/hidden-element.js +16 -0
- package/esm/select/utils/merge-options.d.ts +2 -0
- package/esm/select/utils/merge-options.js +18 -0
- package/esm/select/utils/test-utils.d.ts +1 -0
- package/esm/select/utils/test-utils.js +7 -0
- package/esm/slider/styled-components.js +4 -4
- package/esm/snackbar/Snackbar.js +12 -12
- package/esm/snackbar/styled-component.js +9 -6
- package/esm/spacewebProvider/SpacewebProvider.d.ts +2 -0
- package/esm/spacewebProvider/SpacewebProvider.js +9 -9
- package/esm/stack/stack.js +6 -13
- package/esm/style/_buildUtils.d.ts +1 -1
- package/esm/style/_buildUtils.js +3 -1
- package/esm/style/_parseStyle.js +7 -2
- package/esm/style/useMemoizedStyletron.js +6 -1
- package/esm/switch/styled-components.js +3 -3
- package/esm/tag/avatar-tag.js +23 -16
- package/esm/tag/styled-components.js +32 -27
- package/esm/tag/tag.js +20 -12
- package/esm/tag/types.d.ts +2 -2
- package/esm/tag/utils.d.ts +50 -0
- package/esm/tag/utils.js +64 -0
- package/esm/textarea/basewebAdapters.js +3 -3
- package/esm/textarea/textarea.js +3 -3
- package/esm/textarea/types.d.ts +2 -2
- package/esm/theme/Provider.d.ts +10 -0
- package/esm/theme/Provider.js +61 -0
- package/esm/theme/context.d.ts +1 -10
- package/esm/theme/context.js +1 -61
- package/esm/theme/index.d.ts +1 -0
- package/esm/theme/index.js +1 -0
- package/esm/time-picker/TimePicker.js +4 -1
- package/esm/time-range-picker/RangeSelectorContainer.js +1 -1
- package/esm/time-range-picker/TimeRangePicker.js +20 -12
- package/esm/time-range-picker/index.d.ts +1 -1
- package/esm/time-range-picker/index.js +1 -1
- package/esm/time-range-picker/types.d.ts +1 -2
- package/esm/time-range-picker/utils.d.ts +33 -4
- package/esm/time-range-picker/utils.js +49 -15
- package/esm/time-zone-picker/types.d.ts +2 -0
- package/esm/tooltip/overrides.js +0 -1
- package/esm/tooltip/stateful-tooltip.js +2 -2
- package/esm/tooltip/tooltip.d.ts +1 -1
- package/esm/tooltip/tooltip.js +5 -2
- package/esm/tooltip/types.d.ts +2 -0
- package/esm/types.d.ts +2 -1
- package/esm/typography/Typography.js +14 -1
- package/esm/typography/constants.d.ts +56 -0
- package/esm/typography/constants.js +56 -0
- package/esm/typography/index.d.ts +1 -0
- package/esm/typography/index.js +1 -0
- package/esm/typography/styled-components.js +12 -4
- package/esm/typography/types.d.ts +1 -1
- package/esm/utils/intlNumberFormatUtils/index.d.ts +7 -0
- package/esm/utils/intlNumberFormatUtils/index.js +36 -0
- package/esm/utils/intlNumberFormatUtils/types.d.ts +21 -0
- package/esm/utils/intlNumberFormatUtils/types.js +6 -0
- package/form-control/form-control.d.ts +1 -1
- package/form-control/form-control.js +16 -11
- package/form-control/styled-component.js +17 -6
- package/helpers/ClearIconButton.js +3 -1
- package/helpers/StyledTombstone.d.ts +1 -0
- package/helpers/StyledTombstone.js +21 -0
- package/helpers/baseui/useConvertOverrides.js +6 -1
- package/helpers/commonStyles.js +3 -6
- package/helpers/index.d.ts +1 -0
- package/helpers/index.js +10 -1
- package/helpers/themeHelpers.d.ts +1 -0
- package/helpers/themeHelpers.js +15 -1
- package/hooks/useAutoFocus.js +6 -0
- package/hooks/useMatchMedia.js +13 -2
- package/icon/components/alert-solid.js +2 -0
- package/icon/components/alert.js +2 -0
- package/icon/components/calendar-solid.js +2 -0
- package/icon/components/chevron-down.js +2 -0
- package/icon/components/chevron-left.d.ts +3 -0
- package/icon/components/chevron-left.js +11 -0
- package/icon/components/chevron-right.d.ts +3 -0
- package/icon/components/chevron-right.js +11 -0
- package/icon/components/close.js +2 -0
- package/icon/components/error-clr.js +2 -0
- package/icon/components/error-solid.js +2 -0
- package/icon/components/error.js +2 -0
- package/icon/components/imagePreview.js +2 -0
- package/icon/components/info.js +2 -0
- package/icon/components/play-video.js +2 -0
- package/icon/components/reset-color.d.ts +3 -0
- package/icon/components/reset-color.js +11 -0
- package/icon/components/search.js +2 -0
- package/icon/components/tick.js +2 -0
- package/icon/components/tickCircle-solid.js +2 -0
- package/icon/components/user.js +2 -0
- package/icon/components/video-non-playable.js +2 -0
- package/index.d.ts +2 -0
- package/index.js +3 -0
- package/input/basewebAdapters.js +18 -3
- package/input/styled-components.js +7 -5
- package/input/types.d.ts +4 -1
- package/layer/useLayersContextValue.js +2 -1
- package/list/avatar-list-item.d.ts +12 -22
- package/list/avatar-list-item.js +5 -3
- package/list/index.d.ts +1 -1
- package/list/index.js +2 -1
- package/list/list-item.d.ts +3 -1
- package/list/list-item.js +9 -6
- package/list/styled-component.d.ts +1 -0
- package/list/styled-component.js +24 -16
- package/list/types.d.ts +3 -0
- package/locale/en_US.js +26 -0
- package/locale/types.d.ts +19 -0
- package/menu/MenuContext.d.ts +2 -1
- package/menu/MenuContext.js +1 -0
- package/menu/menu-item.d.ts +4 -1
- package/menu/menu-item.js +11 -11
- package/menu/menu.d.ts +1 -0
- package/menu/menu.js +11 -11
- package/menu/types.d.ts +1 -0
- package/menu/useKeyboardNavigation.d.ts +6 -3
- package/menu/useKeyboardNavigation.js +21 -14
- package/menu/useStatefulMenu.d.ts +5 -2
- package/menu/useStatefulMenu.js +14 -8
- package/modal/modal.js +3 -1
- package/modal/overrides.d.ts +2 -2
- package/modal/overrides.js +6 -7
- package/modal/styled-components.js +7 -7
- package/number/Number.d.ts +3 -0
- package/number/Number.js +14 -0
- package/number/constants.d.ts +2 -0
- package/number/constants.js +7 -0
- package/number/index.d.ts +5 -0
- package/number/index.js +12 -0
- package/number/package.json +4 -0
- package/number/types.d.ts +6 -0
- package/number/types.js +2 -0
- package/number/useNumber.d.ts +2 -0
- package/number/useNumber.js +12 -0
- package/overrides/index.d.ts +1 -1
- package/overrides/index.js +2 -1
- package/overrides/mergeOverrides.d.ts +3 -2
- package/overrides/mergeOverrides.js +2 -1
- package/package.json +8 -5
- package/payment-card/basewebAdapters.d.ts +2 -0
- package/payment-card/basewebAdapters.js +23 -1
- package/payment-card/styled-components.js +24 -5
- package/phone-input/country-select-container.js +1 -1
- package/phone-input/country-select.js +3 -3
- package/phone-input/default-props.d.ts +5 -5
- package/phone-input/default-props.js +8 -7
- package/phone-input/flag-container.js +1 -1
- package/phone-input/phone-input.d.ts +0 -4
- package/phone-input/phone-input.js +19 -11
- package/phone-input/stateful-phone-input-container.js +4 -3
- package/phone-input/stateful-phone-input.d.ts +0 -4
- package/phone-input/styled-components.d.ts +9 -1
- package/phone-input/styled-components.js +22 -7
- package/phone-input/types.d.ts +2 -1
- package/phone-input/utils.d.ts +5 -1
- package/phone-input/utils.js +7 -1
- package/popover/adapter.d.ts +1 -0
- package/popover/adapter.js +16 -1
- package/popover/overrides.js +8 -19
- package/popover/popover.d.ts +1 -0
- package/popover/popover.js +8 -3
- package/popover/stateful-popover.js +2 -2
- package/popover/types.d.ts +3 -0
- package/popover/utils.d.ts +12 -0
- package/popover/utils.js +11 -1
- package/progress/linear/styled-component.d.ts +1 -1
- package/progress/linear/styled-component.js +5 -5
- package/radio/styled-components.js +5 -5
- package/search/index.d.ts +1 -0
- package/search/index.js +3 -1
- package/search/search.d.ts +1 -1
- package/search/search.js +14 -5
- package/search/stateful-search.d.ts +3 -0
- package/search/stateful-search.js +19 -0
- package/search/styled-components.d.ts +1 -10
- package/search/styled-components.js +56 -25
- package/search/types.d.ts +8 -2
- package/select/base-select.d.ts +22 -5
- package/select/base-select.js +172 -80
- package/select/constants.d.ts +3 -0
- package/select/constants.js +4 -2
- package/select/default-props.d.ts +1 -0
- package/select/default-props.js +3 -0
- package/select/index.d.ts +2 -2
- package/select/index.js +4 -1
- package/select/locale.d.ts +4 -0
- package/select/mobileSelect/MobileSheet.js +3 -1
- package/select/multi-value.js +21 -11
- package/select/overlaySelect/OverlaySelect.js +1 -0
- package/select/overlaySelect/hooks/useOverlaySelectOverrides.d.ts +2 -1
- package/select/overlaySelect/hooks/useOverlaySelectOverrides.js +13 -16
- package/select/overrides.d.ts +3 -0
- package/select/overrides.js +20 -6
- package/select/select.d.ts +1 -0
- package/select/select.js +9 -3
- package/select/selectMenuAdapter/CollapsibleSelectMenu.d.ts +118 -0
- package/select/selectMenuAdapter/CollapsibleSelectMenu.js +74 -0
- package/select/selectMenuAdapter/SelectMenuAdapter.d.ts +2 -34
- package/select/selectMenuAdapter/SelectMenuAdapter.js +3 -3
- package/select/selectMenuAdapter/SelectMenuItem.d.ts +4 -1
- package/select/selectMenuAdapter/hooks/useGetExpandedGroup.d.ts +6 -0
- package/select/selectMenuAdapter/hooks/useGetExpandedGroup.js +20 -0
- package/select/selectMenuAdapter/types.d.ts +42 -0
- package/select/selectMenuAdapter/types.js +2 -0
- package/select/stateful-select.d.ts +1 -0
- package/select/styled-component.d.ts +10 -1
- package/select/styled-component.js +38 -14
- package/select/types.d.ts +23 -1
- package/select/types.js +2 -1
- package/select/utils/default-filter-options.d.ts +2 -1
- package/select/utils/default-filter-options.js +6 -5
- package/select/utils/hidden-element.d.ts +6 -0
- package/select/utils/hidden-element.js +19 -0
- package/select/utils/merge-options.d.ts +2 -0
- package/select/utils/merge-options.js +22 -0
- package/select/utils/test-utils.d.ts +1 -0
- package/select/utils/test-utils.js +11 -0
- package/slider/styled-components.js +4 -4
- package/snackbar/Snackbar.js +12 -12
- package/snackbar/styled-component.js +9 -6
- package/spacewebProvider/SpacewebProvider.d.ts +2 -0
- package/spacewebProvider/SpacewebProvider.js +8 -8
- package/stack/stack.js +6 -13
- package/style/_buildUtils.d.ts +1 -1
- package/style/_buildUtils.js +3 -1
- package/style/_parseStyle.js +7 -2
- package/style/useMemoizedStyletron.js +6 -1
- package/switch/styled-components.js +3 -3
- package/tag/avatar-tag.js +23 -16
- package/tag/styled-components.js +32 -27
- package/tag/tag.js +19 -11
- package/tag/types.d.ts +2 -2
- package/tag/utils.d.ts +50 -0
- package/tag/utils.js +67 -1
- package/textarea/basewebAdapters.js +2 -2
- package/textarea/textarea.js +2 -2
- package/textarea/types.d.ts +2 -2
- package/theme/Provider.d.ts +10 -0
- package/theme/Provider.js +65 -0
- package/theme/context.d.ts +1 -10
- package/theme/context.js +1 -61
- package/theme/index.d.ts +1 -0
- package/theme/index.js +1 -0
- package/time-picker/TimePicker.js +4 -1
- package/time-range-picker/RangeSelectorContainer.js +1 -1
- package/time-range-picker/TimeRangePicker.js +19 -11
- package/time-range-picker/index.d.ts +1 -1
- package/time-range-picker/index.js +4 -1
- package/time-range-picker/types.d.ts +1 -2
- package/time-range-picker/utils.d.ts +33 -4
- package/time-range-picker/utils.js +53 -17
- package/time-zone-picker/types.d.ts +2 -0
- package/tooltip/overrides.js +0 -1
- package/tooltip/stateful-tooltip.js +2 -2
- package/tooltip/tooltip.d.ts +1 -1
- package/tooltip/tooltip.js +5 -2
- package/tooltip/types.d.ts +2 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/types.d.ts +2 -1
- package/typography/Typography.js +14 -1
- package/typography/constants.d.ts +56 -0
- package/typography/constants.js +57 -1
- package/typography/index.d.ts +1 -0
- package/typography/index.js +3 -1
- package/typography/styled-components.js +11 -3
- package/typography/types.d.ts +1 -1
- package/utils/intlNumberFormatUtils/index.d.ts +7 -0
- package/utils/intlNumberFormatUtils/index.js +40 -0
- package/utils/intlNumberFormatUtils/types.d.ts +21 -0
- package/utils/intlNumberFormatUtils/types.js +9 -0
- package/utils/package.json +4 -0
- package/esm/icon/components/chevron-right-solid.d.ts +0 -3
- package/esm/icon/components/chevron-right-solid.js +0 -6
- package/icon/components/chevron-right-solid.d.ts +0 -3
- package/icon/components/chevron-right-solid.js +0 -9
|
@@ -14,6 +14,8 @@ var constants_1 = require("../date-picker/constants");
|
|
|
14
14
|
var overrides_1 = require("../overrides");
|
|
15
15
|
var utils_2 = require("../date-picker/utils");
|
|
16
16
|
var constants_2 = require("./constants");
|
|
17
|
+
var button_1 = require("../button");
|
|
18
|
+
var calendar_solid_1 = (0, tslib_1.__importDefault)(require("../icon/components/calendar-solid"));
|
|
17
19
|
var __DEV__ = process.env.NODE_ENV !== 'production';
|
|
18
20
|
var TimeRangePicker = function (_a) {
|
|
19
21
|
var _b = _a.adapter, adapter = _b === void 0 ? date_fns_adapter_1.default : _b, onSubmit = _a.onSubmit, _timezone = _a.timezone, value = _a.value, formatDisplayValue = _a.formatDisplayValue, timeRangePresets = _a.timeRangePresets, overrides = _a.overrides, timeSelect = _a.timeSelect, peekNextMonth = _a.peekNextMonth, excludeDates = _a.excludeDates, filterDate = _a.filterDate, minDate = _a.minDate, maxDate = _a.maxDate, _c = _a.placeholder, placeholder = _c === void 0 ? "".concat(constants_1.DEFAULT_FORMAT_STRING, "-").concat(constants_1.DEFAULT_FORMAT_STRING) : _c, _d = _a.formatString, formatString = _d === void 0 ? constants_1.DEFAULT_FORMAT_STRING : _d, onClose = _a.onClose, onChange = _a.onChange, showTimezoneInSummary = _a.showTimezoneInSummary, clearable = _a.clearable, onClear = _a.onClear, showFullDateInSummary = _a.showFullDateInSummary, autoSizeInput = _a.autoSizeInput, preset = _a.preset, _e = _a.startOpen, startOpen = _e === void 0 ? false : _e, fixedHeight = _a.fixedHeight, _f = _a.monthsShown, monthsShown = _f === void 0 ? 2 : _f, weekStartsOn = _a.weekStartsOn, _g = _a.disableTimezone, disableTimezone = _g === void 0 ? false : _g, _h = _a.displayVariant, displayVariant = _h === void 0 ? 'default' : _h, props = (0, tslib_1.__rest)(_a, ["adapter", "onSubmit", "timezone", "value", "formatDisplayValue", "timeRangePresets", "overrides", "timeSelect", "peekNextMonth", "excludeDates", "filterDate", "minDate", "maxDate", "placeholder", "formatString", "onClose", "onChange", "showTimezoneInSummary", "clearable", "onClear", "showFullDateInSummary", "autoSizeInput", "preset", "startOpen", "fixedHeight", "monthsShown", "weekStartsOn", "disableTimezone", "displayVariant"]);
|
|
@@ -44,9 +46,8 @@ var TimeRangePicker = function (_a) {
|
|
|
44
46
|
], false); }, [timeRangePresets, locale]);
|
|
45
47
|
var formatDate = (0, react_1.useCallback)(function (date, normalizedFormatString) {
|
|
46
48
|
if (normalizedFormatString === void 0) { normalizedFormatString = (0, utils_2.normalizeDashes)(formatString); }
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, [formatString, dateHelpers, timezone, dateFnsLocale]);
|
|
49
|
+
return dateHelpers.formatDate(date, normalizedFormatString, dateFnsLocale);
|
|
50
|
+
}, [formatString, dateHelpers, dateFnsLocale]);
|
|
50
51
|
var defaultFormatDisplayValue = (0, react_1.useCallback)(function (date, normalizedFormatString) {
|
|
51
52
|
var _a, _b;
|
|
52
53
|
if (normalizedFormatString === void 0) { normalizedFormatString = (0, utils_2.normalizeDashes)(formatString); }
|
|
@@ -100,8 +101,8 @@ var TimeRangePicker = function (_a) {
|
|
|
100
101
|
var timeRange = _a.timeRange, preset = _a.preset, timezone = _a.timezone;
|
|
101
102
|
// value is returned only for backward compatibility will be removed in future version.
|
|
102
103
|
if (preset === 'CUSTOM') {
|
|
103
|
-
var startMillis = (0, utils_1.
|
|
104
|
-
var endMillis = (0, utils_1.
|
|
104
|
+
var startMillis = (0, utils_1.convertDateFromTargetTzToSystemTz)(timeRange[0], timezone);
|
|
105
|
+
var endMillis = (0, utils_1.convertDateFromTargetTzToSystemTz)(timeRange[1], timezone);
|
|
105
106
|
var dates = [new Date(startMillis), new Date(endMillis)];
|
|
106
107
|
onSubmit((0, tslib_1.__assign)({ value: dates, preset: preset, date: dates }, (disableTimezone ? {} : { timezone: timezone })));
|
|
107
108
|
}
|
|
@@ -120,12 +121,18 @@ var TimeRangePicker = function (_a) {
|
|
|
120
121
|
else {
|
|
121
122
|
dates = (_c = (_b = (_a = (0, utils_1.getSelectedTimeRange)(preset !== null && preset !== void 0 ? preset : value, timeRangeList)) === null || _a === void 0 ? void 0 : _a.getTimeRangeLimits) === null || _b === void 0 ? void 0 : _b.call(_a, timezone)) !== null && _c !== void 0 ? _c : [];
|
|
122
123
|
}
|
|
123
|
-
return (0, tslib_1.__spreadArray)((0, tslib_1.__spreadArray)([], (0, tslib_1.__read)((dates[0] ? [(0, utils_1.
|
|
124
|
+
return (0, tslib_1.__spreadArray)((0, tslib_1.__spreadArray)([], (0, tslib_1.__read)((dates[0] ? [new Date((0, utils_1.convertDateFromSystemTzToTargetTz)(dates[0], timezone))] : [])), false), (0, tslib_1.__read)((dates[1] ? [new Date((0, utils_1.convertDateFromSystemTzToTargetTz)(dates[1], timezone))] : [])), false);
|
|
124
125
|
}, [value, timeRangeList, timezone, preset]);
|
|
125
126
|
var mergedOverrides = (0, react_1.useMemo)(function () {
|
|
126
127
|
return (0, overrides_1.mergeOverrides)({
|
|
127
|
-
Input: {
|
|
128
|
-
|
|
128
|
+
Input: (0, tslib_1.__assign)((0, tslib_1.__assign)({}, (displayVariant === 'iconButton'
|
|
129
|
+
? {
|
|
130
|
+
component: function () { return ((0, jsx_runtime_1.jsx)(button_1.IconButton, (0, tslib_1.__assign)({ tooltipContent: locale.calendar.calendarButtonAriaLabel, size: props.size, bordered: true, shape: "square" }, { children: (0, jsx_runtime_1.jsx)(calendar_solid_1.default, {}, void 0) }), void 0)); },
|
|
131
|
+
Before: {
|
|
132
|
+
component: function () { return null; },
|
|
133
|
+
},
|
|
134
|
+
}
|
|
135
|
+
: {})), { props: {
|
|
129
136
|
overrides: (0, tslib_1.__assign)({}, (displayVariant === 'compact'
|
|
130
137
|
? {
|
|
131
138
|
Before: {
|
|
@@ -133,8 +140,7 @@ var TimeRangePicker = function (_a) {
|
|
|
133
140
|
},
|
|
134
141
|
}
|
|
135
142
|
: {})),
|
|
136
|
-
},
|
|
137
|
-
},
|
|
143
|
+
} }),
|
|
138
144
|
InputWrapper: {
|
|
139
145
|
props: {
|
|
140
146
|
'data-testid': 'time-range',
|
|
@@ -178,6 +184,8 @@ var TimeRangePicker = function (_a) {
|
|
|
178
184
|
disableTimezone,
|
|
179
185
|
locale.timeRangePicker.popoverAriaLabel,
|
|
180
186
|
displayVariant,
|
|
187
|
+
locale.calendar.calendarButtonAriaLabel,
|
|
188
|
+
props.size,
|
|
181
189
|
]);
|
|
182
190
|
var handleInputChange = (0, react_1.useCallback)(function (_a) {
|
|
183
191
|
var _b = _a.value, _value = _b === void 0 ? [] : _b;
|
|
@@ -186,6 +194,6 @@ var TimeRangePicker = function (_a) {
|
|
|
186
194
|
onSubmit((0, tslib_1.__assign)({ value: _value, preset: 'CUSTOM', date: _value }, (disableTimezone ? {} : { timezone: timezone })));
|
|
187
195
|
onClear === null || onClear === void 0 ? void 0 : onClear();
|
|
188
196
|
}, [onSubmit, timezone, onClear, disableTimezone]);
|
|
189
|
-
return ((0, jsx_runtime_1.jsx)(date_picker_1.StatelessDatePicker, { value: timeRange, isOpen: isOpen, onFocus: handleOpen, onBlur: handleClose, formatDisplayValue: defaultFormatDisplayValue, trapTabbing: false, intent: props.intent, variant: props.variant, size: props.size, disabled: props.disabled, formatString: formatString, placeholder: placeholder, "aria-label": locale.timeRangePicker.ariaLabelRange, overrides: mergedOverrides, clearable: clearable, onChange: handleInputChange, autoSizeInput: autoSizeInput, locale: dateFnsLocale, mountNode: props.mountNode, minDate: minDate, maxDate: maxDate }, void 0));
|
|
197
|
+
return ((0, jsx_runtime_1.jsx)(date_picker_1.StatelessDatePicker, { value: timeRange, isOpen: isOpen, onFocus: handleOpen, onBlur: handleClose, formatDisplayValue: defaultFormatDisplayValue, trapTabbing: false, intent: props.intent, variant: props.variant, size: props.size, disabled: props.disabled, formatString: formatString, placeholder: placeholder, "aria-label": locale.timeRangePicker.ariaLabelRange, overrides: mergedOverrides, clearable: clearable, onChange: handleInputChange, autoSizeInput: autoSizeInput, locale: dateFnsLocale, mountNode: props.mountNode, minDate: minDate, maxDate: maxDate, "aria-describedby": props['aria-describedby'], "aria-labelledby": props['aria-labelledby'], required: props.required, id: props.id }, void 0));
|
|
190
198
|
};
|
|
191
199
|
exports.TimeRangePicker = TimeRangePicker;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { TimeRangePicker } from './TimeRangePicker';
|
|
2
|
-
export { getDefaultTimeRangePresets, formatSummaryValue } from './utils';
|
|
2
|
+
export { getDefaultTimeRangePresets, formatSummaryValue, convertDateFromSrcTzToTargetTz, convertDateFromSystemTzToTargetTz, convertDateFromTargetTzToSystemTz, } from './utils';
|
|
3
3
|
export type { TimeRangePickerLocale } from './locale';
|
|
4
4
|
export type { TimeRangePickerValue, TimeRangePickerProps, TimeRangePreset, TimeRangePickerOverrides, FormatString, } from './types';
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatSummaryValue = exports.getDefaultTimeRangePresets = exports.TimeRangePicker = void 0;
|
|
3
|
+
exports.convertDateFromTargetTzToSystemTz = exports.convertDateFromSystemTzToTargetTz = exports.convertDateFromSrcTzToTargetTz = exports.formatSummaryValue = exports.getDefaultTimeRangePresets = exports.TimeRangePicker = void 0;
|
|
4
4
|
var TimeRangePicker_1 = require("./TimeRangePicker");
|
|
5
5
|
Object.defineProperty(exports, "TimeRangePicker", { enumerable: true, get: function () { return TimeRangePicker_1.TimeRangePicker; } });
|
|
6
6
|
var utils_1 = require("./utils");
|
|
7
7
|
Object.defineProperty(exports, "getDefaultTimeRangePresets", { enumerable: true, get: function () { return utils_1.getDefaultTimeRangePresets; } });
|
|
8
8
|
Object.defineProperty(exports, "formatSummaryValue", { enumerable: true, get: function () { return utils_1.formatSummaryValue; } });
|
|
9
|
+
Object.defineProperty(exports, "convertDateFromSrcTzToTargetTz", { enumerable: true, get: function () { return utils_1.convertDateFromSrcTzToTargetTz; } });
|
|
10
|
+
Object.defineProperty(exports, "convertDateFromSystemTzToTargetTz", { enumerable: true, get: function () { return utils_1.convertDateFromSystemTzToTargetTz; } });
|
|
11
|
+
Object.defineProperty(exports, "convertDateFromTargetTzToSystemTz", { enumerable: true, get: function () { return utils_1.convertDateFromTargetTzToSystemTz; } });
|
|
@@ -39,7 +39,7 @@ export declare type TimeRangePickerValue = {
|
|
|
39
39
|
timezone?: string;
|
|
40
40
|
};
|
|
41
41
|
declare type Preset = string;
|
|
42
|
-
export declare type SizeVariant = 'default' | 'compact';
|
|
42
|
+
export declare type SizeVariant = 'default' | 'compact' | 'iconButton';
|
|
43
43
|
export declare type FormatSummaryValueOptions = {
|
|
44
44
|
date: Date[];
|
|
45
45
|
presetId: string;
|
|
@@ -60,7 +60,6 @@ export declare type TimeRangePickerProps = Omit<StatelessDatePickerProps, 'value
|
|
|
60
60
|
*/
|
|
61
61
|
value?: Preset | Date[];
|
|
62
62
|
preset?: Preset;
|
|
63
|
-
timezone?: string;
|
|
64
63
|
timeRangePresets?: TimeRangePreset[];
|
|
65
64
|
onSubmit: (timeRangePickerValue: TimeRangePickerValue) => void;
|
|
66
65
|
overrides?: TimeRangePickerOverrides;
|
|
@@ -3,18 +3,47 @@ import { Locale } from '../locale';
|
|
|
3
3
|
import { FormatSummaryValueOptions, TimeRangePreset } from './types';
|
|
4
4
|
export declare const getSelectedTimeRange: (selectedTimeRange: string | undefined, timeRangeOptions: Array<TimeRangePreset>) => TimeRangePreset | undefined;
|
|
5
5
|
export declare const getSystemTzName: () => string;
|
|
6
|
+
/**
|
|
7
|
+
@param date: Date object or epoch in source timezone
|
|
8
|
+
@param srcTz: source timezone
|
|
9
|
+
@param targetTz: target timezone
|
|
10
|
+
This function is used to convert the time from one timezone to another timezone.
|
|
11
|
+
Example use-case of this function
|
|
12
|
+
Lets say you want to find out what time it will be in New York when it is 6th Nov, 2022 00:00 in Los Angeles.
|
|
13
|
+
then you can call like:
|
|
14
|
+
convertDateFromSrcTzToTargetTz(new Date('6 Nov 2022, 00:00'), "America/Los_Angeles", "America/New_York")
|
|
15
|
+
this function will return 6 Nov 2022, 2:00 because generally NY is 3 hours ahead of LA but at 2:00AM NY will switch to DST
|
|
16
|
+
and hence it will be not 3:00AM but 2:00AM.
|
|
17
|
+
*/
|
|
18
|
+
export declare const convertDateFromSrcTzToTargetTz: (date: Date | number, srcTz?: string, targetTz?: string) => number;
|
|
19
|
+
/**
|
|
20
|
+
* @param date Date object or epoch representing the date in particular timezone
|
|
21
|
+
* @param timezone timezone of the date
|
|
22
|
+
* @returns epoch of the same time in system timezone
|
|
23
|
+
* Use case:
|
|
24
|
+
* Lets say user selects 6 Nov 2022, 00:00 from Time range picker and selects New York timezone.
|
|
25
|
+
* Now we want to find out what that time represents in our system timezone(Los Angeles) which in given case is 5 Nov 2022, 21:00
|
|
26
|
+
*/
|
|
27
|
+
export declare const convertDateFromTargetTzToSystemTz: (date: Date | number, timezone?: string) => number;
|
|
28
|
+
/**
|
|
29
|
+
* @param date date in system timezone
|
|
30
|
+
* @param timezone timezone in which you want to convert this date to
|
|
31
|
+
* @returns date in that timezone
|
|
32
|
+
* Use case:
|
|
33
|
+
* User will come back with 5 Nov 2022, 21:00 but has selected new york timezone so we want to find out
|
|
34
|
+
* what time it will be in new york when it is 5 Nov 2022, 21:00 in system timezone(Los Angeles), which is
|
|
35
|
+
* 6 Nov 2022, 00:00
|
|
36
|
+
*/
|
|
37
|
+
export declare const convertDateFromSystemTzToTargetTz: (date: Date | number, timezone?: string) => number;
|
|
6
38
|
/**
|
|
7
39
|
* returns milliseconds offset from timezone name
|
|
8
40
|
*/
|
|
9
41
|
export declare const getTzOffset: (timezone: string, date?: number | Date | undefined) => number;
|
|
10
42
|
/**
|
|
43
|
+
* @deprecated use convertDateFromTargetTzToSystemTz function to make sure you account for DST cases too
|
|
11
44
|
* convert epoch from one timezone to another
|
|
12
45
|
*/
|
|
13
46
|
export declare const switchEpochTimezone: (date: Date | number, tzFrom?: string, tzTo?: string) => number;
|
|
14
|
-
/**
|
|
15
|
-
* adapts date with the system timezone
|
|
16
|
-
*/
|
|
17
|
-
export declare const adaptDateWithSystemTz: (date: Date, selectedTimezone: string) => Date;
|
|
18
47
|
/**
|
|
19
48
|
* Adds or subtract the offset according to timezone passed so that we can get correct start date and end date in that timezone.
|
|
20
49
|
* ex. Lets say we are in Asia/Kolakata timezone on 19th Feb and time is 12:30 AM, and selected Asia/Kabul timezone and preset as Today.
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRangeError = exports.getHeight = exports.formatSummaryValue = exports.getDefaultTimeRangePresets = exports.getDateForGivenTimezone = exports.
|
|
3
|
+
exports.getRangeError = exports.getHeight = exports.formatSummaryValue = exports.getDefaultTimeRangePresets = exports.getDateForGivenTimezone = exports.switchEpochTimezone = exports.getTzOffset = exports.convertDateFromSystemTzToTargetTz = exports.convertDateFromTargetTzToSystemTz = exports.convertDateFromSrcTzToTargetTz = exports.getSystemTzName = exports.getSelectedTimeRange = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var constants_1 = require("../date-picker/constants");
|
|
6
6
|
var index_1900_2050_1 = require("timezone-support/dist/index-1900-2050");
|
|
7
7
|
var date_fns_adapter_1 = (0, tslib_1.__importDefault)(require("baseui/datepicker/utils/date-fns-adapter"));
|
|
8
8
|
var date_helpers_1 = (0, tslib_1.__importDefault)(require("baseui/datepicker/utils/date-helpers"));
|
|
9
9
|
var i18n_interpolation_1 = (0, tslib_1.__importDefault)(require("baseui/helpers/i18n-interpolation"));
|
|
10
|
+
var date_fns_1 = require("date-fns");
|
|
11
|
+
var date_fns_tz_1 = require("date-fns-tz");
|
|
10
12
|
var utils_1 = require("../date-picker/utils");
|
|
11
13
|
var constants_2 = require("./constants");
|
|
12
14
|
var getSelectedTimeRange = function (selectedTimeRange, timeRangeOptions) { return timeRangeOptions.find(function (_a) {
|
|
@@ -28,6 +30,51 @@ var getSystemTzName = function () {
|
|
|
28
30
|
return SYSTEM_TIMEZONE;
|
|
29
31
|
};
|
|
30
32
|
exports.getSystemTzName = getSystemTzName;
|
|
33
|
+
/**
|
|
34
|
+
@param date: Date object or epoch in source timezone
|
|
35
|
+
@param srcTz: source timezone
|
|
36
|
+
@param targetTz: target timezone
|
|
37
|
+
This function is used to convert the time from one timezone to another timezone.
|
|
38
|
+
Example use-case of this function
|
|
39
|
+
Lets say you want to find out what time it will be in New York when it is 6th Nov, 2022 00:00 in Los Angeles.
|
|
40
|
+
then you can call like:
|
|
41
|
+
convertDateFromSrcTzToTargetTz(new Date('6 Nov 2022, 00:00'), "America/Los_Angeles", "America/New_York")
|
|
42
|
+
this function will return 6 Nov 2022, 2:00 because generally NY is 3 hours ahead of LA but at 2:00AM NY will switch to DST
|
|
43
|
+
and hence it will be not 3:00AM but 2:00AM.
|
|
44
|
+
*/
|
|
45
|
+
var convertDateFromSrcTzToTargetTz = function (date, srcTz, targetTz) {
|
|
46
|
+
if (srcTz === void 0) { srcTz = (0, exports.getSystemTzName)(); }
|
|
47
|
+
if (targetTz === void 0) { targetTz = (0, exports.getSystemTzName)(); }
|
|
48
|
+
return +(0, date_fns_tz_1.utcToZonedTime)((0, date_fns_tz_1.zonedTimeToUtc)(date, srcTz), targetTz);
|
|
49
|
+
};
|
|
50
|
+
exports.convertDateFromSrcTzToTargetTz = convertDateFromSrcTzToTargetTz;
|
|
51
|
+
/**
|
|
52
|
+
* @param date Date object or epoch representing the date in particular timezone
|
|
53
|
+
* @param timezone timezone of the date
|
|
54
|
+
* @returns epoch of the same time in system timezone
|
|
55
|
+
* Use case:
|
|
56
|
+
* Lets say user selects 6 Nov 2022, 00:00 from Time range picker and selects New York timezone.
|
|
57
|
+
* Now we want to find out what that time represents in our system timezone(Los Angeles) which in given case is 5 Nov 2022, 21:00
|
|
58
|
+
*/
|
|
59
|
+
var convertDateFromTargetTzToSystemTz = function (date, timezone) {
|
|
60
|
+
if (timezone === void 0) { timezone = (0, exports.getSystemTzName)(); }
|
|
61
|
+
return (0, exports.convertDateFromSrcTzToTargetTz)(date, timezone, (0, exports.getSystemTzName)());
|
|
62
|
+
};
|
|
63
|
+
exports.convertDateFromTargetTzToSystemTz = convertDateFromTargetTzToSystemTz;
|
|
64
|
+
/**
|
|
65
|
+
* @param date date in system timezone
|
|
66
|
+
* @param timezone timezone in which you want to convert this date to
|
|
67
|
+
* @returns date in that timezone
|
|
68
|
+
* Use case:
|
|
69
|
+
* User will come back with 5 Nov 2022, 21:00 but has selected new york timezone so we want to find out
|
|
70
|
+
* what time it will be in new york when it is 5 Nov 2022, 21:00 in system timezone(Los Angeles), which is
|
|
71
|
+
* 6 Nov 2022, 00:00
|
|
72
|
+
*/
|
|
73
|
+
var convertDateFromSystemTzToTargetTz = function (date, timezone) {
|
|
74
|
+
if (timezone === void 0) { timezone = (0, exports.getSystemTzName)(); }
|
|
75
|
+
return (0, exports.convertDateFromSrcTzToTargetTz)(date, (0, exports.getSystemTzName)(), timezone);
|
|
76
|
+
};
|
|
77
|
+
exports.convertDateFromSystemTzToTargetTz = convertDateFromSystemTzToTargetTz;
|
|
31
78
|
/**
|
|
32
79
|
* returns milliseconds offset from timezone name
|
|
33
80
|
*/
|
|
@@ -39,6 +86,7 @@ var getTzOffset = function (timezone, date) {
|
|
|
39
86
|
};
|
|
40
87
|
exports.getTzOffset = getTzOffset;
|
|
41
88
|
/**
|
|
89
|
+
* @deprecated use convertDateFromTargetTzToSystemTz function to make sure you account for DST cases too
|
|
42
90
|
* convert epoch from one timezone to another
|
|
43
91
|
*/
|
|
44
92
|
var switchEpochTimezone = function (date, tzFrom, tzTo) {
|
|
@@ -50,14 +98,6 @@ var switchEpochTimezone = function (date, tzFrom, tzTo) {
|
|
|
50
98
|
return +date + offset;
|
|
51
99
|
};
|
|
52
100
|
exports.switchEpochTimezone = switchEpochTimezone;
|
|
53
|
-
/**
|
|
54
|
-
* adapts date with the system timezone
|
|
55
|
-
*/
|
|
56
|
-
var adaptDateWithSystemTz = function (date, selectedTimezone) {
|
|
57
|
-
var timestampInMillis = (0, exports.switchEpochTimezone)(date, selectedTimezone, (0, exports.getSystemTzName)());
|
|
58
|
-
return new Date(timestampInMillis);
|
|
59
|
-
};
|
|
60
|
-
exports.adaptDateWithSystemTz = adaptDateWithSystemTz;
|
|
61
101
|
/**
|
|
62
102
|
* Adds or subtract the offset according to timezone passed so that we can get correct start date and end date in that timezone.
|
|
63
103
|
* ex. Lets say we are in Asia/Kolakata timezone on 19th Feb and time is 12:30 AM, and selected Asia/Kabul timezone and preset as Today.
|
|
@@ -77,8 +117,8 @@ var getDateForGivenTimezone = function (timezone) {
|
|
|
77
117
|
exports.getDateForGivenTimezone = getDateForGivenTimezone;
|
|
78
118
|
var getDefaultTimeRangePresets = function (locale) {
|
|
79
119
|
var switchTimezoneOfRange = function (startDate, endDate, timezone) { return [
|
|
80
|
-
new Date((0, exports.
|
|
81
|
-
new Date((0, exports.
|
|
120
|
+
new Date((0, exports.convertDateFromTargetTzToSystemTz)(startDate, timezone)),
|
|
121
|
+
new Date((0, exports.convertDateFromTargetTzToSystemTz)(endDate, timezone)),
|
|
82
122
|
]; };
|
|
83
123
|
return [
|
|
84
124
|
{
|
|
@@ -144,9 +184,7 @@ var getDefaultTimeRangePresets = function (locale) {
|
|
|
144
184
|
var firstday = date.getDate() - (date.getDay() - 1) - 1;
|
|
145
185
|
var startDate = new Date(date.setDate(firstday));
|
|
146
186
|
startDate.setHours(0, 0, 0, 0);
|
|
147
|
-
var endDate = (0,
|
|
148
|
-
endDate.setMonth(startDate.getMonth());
|
|
149
|
-
endDate.setDate(startDate.getDate() + 6);
|
|
187
|
+
var endDate = (0, date_fns_1.addDays)(startDate, 6);
|
|
150
188
|
endDate.setHours(23, 59, 59, 999);
|
|
151
189
|
return switchTimezoneOfRange(startDate, endDate, timezone);
|
|
152
190
|
},
|
|
@@ -160,9 +198,7 @@ var getDefaultTimeRangePresets = function (locale) {
|
|
|
160
198
|
var lastday = date.getDate() - (date.getDay() - 1) - 2;
|
|
161
199
|
var endDate = new Date(date.setDate(lastday));
|
|
162
200
|
endDate.setHours(23, 59, 59, 999);
|
|
163
|
-
var startDate = (0,
|
|
164
|
-
startDate.setMonth(endDate.getMonth());
|
|
165
|
-
startDate.setDate(endDate.getDate() - 6);
|
|
201
|
+
var startDate = (0, date_fns_1.subDays)(endDate, 6);
|
|
166
202
|
startDate.setHours(0, 0, 0, 0);
|
|
167
203
|
return switchTimezoneOfRange(startDate, endDate, timezone);
|
|
168
204
|
},
|
package/tooltip/overrides.js
CHANGED
|
@@ -7,9 +7,9 @@ var useConvertOverrides_1 = require("../helpers/baseui/useConvertOverrides");
|
|
|
7
7
|
var stateful_tooltip_container_1 = (0, tslib_1.__importDefault)(require("./stateful-tooltip-container"));
|
|
8
8
|
var tooltip_1 = (0, tslib_1.__importDefault)(require("./tooltip"));
|
|
9
9
|
var StatefulTooltip = function (props) {
|
|
10
|
-
var children = props.children, size = props.size, label = props.label, _a = props.overrides, overrides = _a === void 0 ? {} : _a, restProps = (0, tslib_1.__rest)(props, ["children", "size", "label", "overrides"]);
|
|
10
|
+
var children = props.children, size = props.size, label = props.label, _a = props.overrides, overrides = _a === void 0 ? {} : _a, viewportAsBoundary = props.viewportAsBoundary, restProps = (0, tslib_1.__rest)(props, ["children", "size", "label", "overrides", "viewportAsBoundary"]);
|
|
11
11
|
var _overrides = (0, useConvertOverrides_1.useConvertOverrides)(overrides, undefined, [overrides]);
|
|
12
|
-
return ((0, jsx_runtime_1.jsx)(stateful_tooltip_container_1.default, (0, tslib_1.__assign)({ dismissOnClickOutside: true, dismissOnEsc: true, triggerType: "hover" }, restProps, { overrides: _overrides }, { children: function (tooltipProps) { return ((0, jsx_runtime_1.jsx)(tooltip_1.default, (0, tslib_1.__assign)({}, tooltipProps, { size: size, label: label }, { children: children }), void 0)); } }), void 0));
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)(stateful_tooltip_container_1.default, (0, tslib_1.__assign)({ dismissOnClickOutside: true, dismissOnEsc: true, triggerType: "hover" }, restProps, { overrides: _overrides }, { children: function (tooltipProps) { return ((0, jsx_runtime_1.jsx)(tooltip_1.default, (0, tslib_1.__assign)({}, tooltipProps, { size: size, label: label, viewportAsBoundary: viewportAsBoundary }, { children: children }), void 0)); } }), void 0));
|
|
13
13
|
};
|
|
14
14
|
StatefulTooltip.displayName = 'StatefulTooltip';
|
|
15
15
|
StatefulTooltip.defaultProps = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, default_props_1.default), { showArrow: true, focusLock: false, returnFocus: false });
|
package/tooltip/tooltip.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { TooltipProps } from './types';
|
|
3
3
|
declare const Tooltip: {
|
|
4
|
-
({ size, label, content, overrides, children, targetElement, isOpen, triggerType, returnFocus, focusLock, placement, ...restProps }: TooltipProps): ReactElement;
|
|
4
|
+
({ size, label, content, overrides, children, targetElement, isOpen, triggerType, returnFocus, focusLock, placement, popperOptions, ignoreBoundary, viewportAsBoundary, ...restProps }: TooltipProps): ReactElement;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
export default Tooltip;
|
package/tooltip/tooltip.js
CHANGED
|
@@ -5,6 +5,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
// TODO: baseui/tooltip is using Popover internally which we cannot override
|
|
6
6
|
var tooltip_1 = require("baseui/tooltip");
|
|
7
7
|
var React = (0, tslib_1.__importStar)(require("react"));
|
|
8
|
+
var react_1 = require("react");
|
|
8
9
|
var PopoverEnahncer_1 = require("../popover/PopoverEnahncer");
|
|
9
10
|
var useConvertOverrides_1 = require("../helpers/baseui/useConvertOverrides");
|
|
10
11
|
var layer_1 = require("../layer");
|
|
@@ -13,6 +14,7 @@ var hooks_1 = require("../popover/hooks");
|
|
|
13
14
|
var useUniqueId_1 = (0, tslib_1.__importDefault)(require("../hooks/useUniqueId"));
|
|
14
15
|
var overrides_2 = require("./overrides");
|
|
15
16
|
var styled_component_1 = require("./styled-component");
|
|
17
|
+
var utils_1 = require("../popover/utils");
|
|
16
18
|
var DISABLED_FOCUS_PROPS = {
|
|
17
19
|
autoFocus: false,
|
|
18
20
|
focusLock: false,
|
|
@@ -21,7 +23,7 @@ var DISABLED_FOCUS_PROPS = {
|
|
|
21
23
|
// @ts-ignore
|
|
22
24
|
tooltip_1.Tooltip.displayName = 'BaseUITooltip';
|
|
23
25
|
var Tooltip = function (_a) {
|
|
24
|
-
var _b = _a.size, size = _b === void 0 ? 'sm' : _b, label = _a.label, content = _a.content, _c = _a.overrides, overrides = _c === void 0 ? {} : _c, children = _a.children, targetElement = _a.targetElement, isOpen = _a.isOpen, _d = _a.triggerType, triggerType = _d === void 0 ? 'hover' : _d, _e = _a.returnFocus, returnFocus = _e === void 0 ? triggerType === 'click' : _e, _f = _a.focusLock, focusLock = _f === void 0 ? false : _f, _g = _a.placement, placement = _g === void 0 ? 'auto' : _g, restProps = (0, tslib_1.__rest)(_a, ["size", "label", "content", "overrides", "children", "targetElement", "isOpen", "triggerType", "returnFocus", "focusLock", "placement"]);
|
|
26
|
+
var _b = _a.size, size = _b === void 0 ? 'sm' : _b, label = _a.label, content = _a.content, _c = _a.overrides, overrides = _c === void 0 ? {} : _c, children = _a.children, targetElement = _a.targetElement, isOpen = _a.isOpen, _d = _a.triggerType, triggerType = _d === void 0 ? 'hover' : _d, _e = _a.returnFocus, returnFocus = _e === void 0 ? triggerType === 'click' : _e, _f = _a.focusLock, focusLock = _f === void 0 ? false : _f, _g = _a.placement, placement = _g === void 0 ? 'auto' : _g, popperOptions = _a.popperOptions, ignoreBoundary = _a.ignoreBoundary, viewportAsBoundary = _a.viewportAsBoundary, restProps = (0, tslib_1.__rest)(_a, ["size", "label", "content", "overrides", "children", "targetElement", "isOpen", "triggerType", "returnFocus", "focusLock", "placement", "popperOptions", "ignoreBoundary", "viewportAsBoundary"]);
|
|
25
27
|
var focusLockProps = (0, hooks_1.useFocusLock)({ returnFocus: returnFocus, focusLock: focusLock });
|
|
26
28
|
var sharedProps = { $size: size, $label: !!label };
|
|
27
29
|
var _h = (0, tslib_1.__read)((0, overrides_1.useOverrides)(overrides.Label, styled_component_1.StyledLabel), 2), Label = _h[0], labelProps = _h[1];
|
|
@@ -42,7 +44,8 @@ var Tooltip = function (_a) {
|
|
|
42
44
|
Inner: { style: overrides_2.innerStyles, props: (0, tslib_1.__assign)((0, tslib_1.__assign)({}, sharedProps), { ref: setContentHost }) },
|
|
43
45
|
}, overrides, [overrides, size, label, setContentHost]);
|
|
44
46
|
var id = (0, useUniqueId_1.default)();
|
|
45
|
-
|
|
47
|
+
var mergedPopperOptions = (0, react_1.useMemo)(function () { return ((0, tslib_1.__assign)((0, tslib_1.__assign)({}, (0, utils_1.getPopperOptions)({ ignoreBoundary: ignoreBoundary, viewportAsBoundary: viewportAsBoundary })), popperOptions)); }, [popperOptions, ignoreBoundary, viewportAsBoundary]);
|
|
48
|
+
return ((0, jsx_runtime_1.jsx)(layer_1.LayersManager, (0, tslib_1.__assign)({ zIndex: layer_1.Z_INDEX.POPOVER }, { children: (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, (0, tslib_1.__assign)({ id: id }, restProps, { triggerType: triggerType, isOpen: isOpen, overrides: _overrides, content: wrappedContent, placement: placement }, focusLockProps, (triggerType === 'hover' ? DISABLED_FOCUS_PROPS : {}), { popperOptions: mergedPopperOptions }, { children: (0, jsx_runtime_1.jsx)(PopoverEnahncer_1.PopoverChildEnhancer, (0, tslib_1.__assign)({ targetElement: targetElement }, { children: childNode }), void 0) }), void 0) }), void 0));
|
|
46
49
|
};
|
|
47
50
|
Tooltip.displayName = 'Tooltip';
|
|
48
51
|
exports.default = Tooltip;
|
package/tooltip/types.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export declare type StatefulTooltipProps = Omit<BaseStatefulTooltipProps, 'overr
|
|
|
39
39
|
dismissOnEsc?: boolean;
|
|
40
40
|
triggerType?: TriggerType;
|
|
41
41
|
placement?: TetherPlacement;
|
|
42
|
+
viewportAsBoundary?: boolean;
|
|
42
43
|
} & DeprecatedProps;
|
|
43
44
|
export declare type TooltipProps = Omit<BaseTooltipProps, 'overrides' | 'children' | 'autoFocus' | 'focusLock' | 'returnFocus' | 'triggerType' | 'placement'> & {
|
|
44
45
|
overrides?: {
|
|
@@ -54,6 +55,7 @@ export declare type TooltipProps = Omit<BaseTooltipProps, 'overrides' | 'childre
|
|
|
54
55
|
targetElement?: HTMLElement | null;
|
|
55
56
|
triggerType?: TriggerType;
|
|
56
57
|
placement?: TetherPlacement;
|
|
58
|
+
viewportAsBoundary?: boolean;
|
|
57
59
|
} & DeprecatedProps;
|
|
58
60
|
export type { Placement, TriggerType, AccessibilityType } from '../popover';
|
|
59
61
|
export type { StatefulTooltipContainerProps } from 'baseui/tooltip';
|