@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
|
@@ -19,6 +19,7 @@ export declare type DateTimeSelectSharedProps = {
|
|
|
19
19
|
export declare type DatepickerOverrides<T = SharedStyleProps> = {
|
|
20
20
|
CalendarContainer?: Override<T>;
|
|
21
21
|
CalendarHeader?: Override<T>;
|
|
22
|
+
Calendar?: Override<CalendarProps & Record<string, any>>;
|
|
22
23
|
Day?: Override<T>;
|
|
23
24
|
Input?: Override<T>;
|
|
24
25
|
InputWrapper?: Override<T>;
|
|
@@ -43,7 +44,11 @@ export declare type DatepickerOverrides<T = SharedStyleProps> = {
|
|
|
43
44
|
Footer?: Override<T>;
|
|
44
45
|
DateTimeSelect?: Override<DateTimeSelectSharedProps>;
|
|
45
46
|
};
|
|
47
|
+
export declare type Nullable<T> = T | null | undefined;
|
|
46
48
|
export declare type StatelessDatePickerProps = Omit<BaseDatepickerProps, 'timeSelectStart' | 'timeSelectEnd' | 'value' | 'onChange' | 'quickSelect' | 'quickSelectOptions' | 'size' | 'overrides' | 'onDayClick' | 'onDayMouseOver' | 'onDayMouseLeave' | 'onMonthChange' | 'onYearChange' | 'formatString' | 'peekNextMonth' | 'fixedHeight'> & {
|
|
49
|
+
id?: string;
|
|
50
|
+
showTimezone?: boolean;
|
|
51
|
+
timezone?: string;
|
|
47
52
|
intent?: Intent;
|
|
48
53
|
timeSelect?: boolean;
|
|
49
54
|
onBlur?: () => void;
|
|
@@ -53,7 +58,8 @@ export declare type StatelessDatePickerProps = Omit<BaseDatepickerProps, 'timeSe
|
|
|
53
58
|
variant?: InputVariant;
|
|
54
59
|
value: Date | Date[] | undefined;
|
|
55
60
|
onChange?: (data: {
|
|
56
|
-
value?:
|
|
61
|
+
value?: Nullable<Date>[] | Nullable<Date>;
|
|
62
|
+
timezone?: string;
|
|
57
63
|
}) => any;
|
|
58
64
|
size?: InputSize;
|
|
59
65
|
overrides?: DatepickerOverrides;
|
|
@@ -75,8 +81,11 @@ export declare type StatefulContainerProps = {
|
|
|
75
81
|
value?: Date;
|
|
76
82
|
onChange?: (data: {
|
|
77
83
|
value?: Date | undefined | null;
|
|
84
|
+
timezone?: string;
|
|
78
85
|
}) => any;
|
|
79
86
|
startOpen?: boolean;
|
|
87
|
+
showTimezone?: boolean;
|
|
88
|
+
timezone?: string;
|
|
80
89
|
};
|
|
81
90
|
export declare type DatePickerProps = Omit<StatelessDatePickerProps, 'value' | 'range'> & Omit<StatefulContainerProps, 'children'>;
|
|
82
91
|
export declare type DatePickerSharedProps = SharedStylePropsT;
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
+
import DateHelpers from 'baseui/datepicker/utils/date-helpers';
|
|
1
2
|
import { Locale } from '../locale';
|
|
2
3
|
interface FormatDateParams {
|
|
3
4
|
date: Date | Date[] | undefined;
|
|
4
5
|
formatString?: string;
|
|
5
6
|
locale: any;
|
|
6
|
-
dateHelpers?:
|
|
7
|
+
dateHelpers?: DateHelpers<Date>;
|
|
8
|
+
timezone?: string;
|
|
9
|
+
showTimezone?: boolean;
|
|
7
10
|
}
|
|
8
11
|
export declare const normalizeDashes: (formatString: string) => string;
|
|
9
|
-
export declare const formatDate: (params: FormatDateParams) =>
|
|
10
|
-
export declare const getAriaLabel: (value: Date | Date[] | undefined, formatDisplayValue: (date?: Date | Date[] | undefined) => string
|
|
12
|
+
export declare const formatDate: ({ showTimezone, ...params }: FormatDateParams) => string;
|
|
13
|
+
export declare const getAriaLabel: (value: Date | Date[] | undefined, formatDisplayValue: (date?: Date | Date[] | undefined) => string, locale: Locale) => string;
|
|
11
14
|
export declare const prepareLocale: (locale?: globalThis.Locale, options?: {
|
|
12
15
|
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | undefined;
|
|
13
16
|
} | undefined) => any;
|
|
14
|
-
export declare const isTimeInRange: (date: Date | Date
|
|
15
|
-
minDate?: Date | undefined;
|
|
16
|
-
maxDate?: Date | undefined;
|
|
17
|
-
dateHelpers?:
|
|
17
|
+
export declare const isTimeInRange: (date: Date | Array<Date | undefined | null> | null | undefined, { minDate, maxDate, dateHelpers, }: {
|
|
18
|
+
minDate?: Date | null | undefined;
|
|
19
|
+
maxDate?: Date | null | undefined;
|
|
20
|
+
dateHelpers?: DateHelpers<Date> | undefined;
|
|
18
21
|
}) => boolean;
|
|
19
22
|
export declare const isDayInRange: (date: Date | Date[] | null | undefined, { minDate, maxDate, dateHelpers, }: {
|
|
20
23
|
minDate?: Date | undefined;
|
package/esm/date-picker/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
1
|
+
import { __assign, __rest } from "tslib";
|
|
2
2
|
import en from 'date-fns/locale/en-US';
|
|
3
3
|
import getInterpolatedString from 'baseui/helpers/i18n-interpolation';
|
|
4
4
|
import DateHelpers from 'baseui/datepicker/utils/date-helpers';
|
|
@@ -6,7 +6,8 @@ import dateFnsAdapter from 'baseui/datepicker/utils/date-fns-adapter';
|
|
|
6
6
|
import { DEFAULT_FORMAT_STRING } from './constants';
|
|
7
7
|
// replacing both hyphens and em-dashes with en-dashes
|
|
8
8
|
export var normalizeDashes = function (formatString) { return formatString.replace(/-/g, '–').replace(/—/g, '–'); };
|
|
9
|
-
export var formatDate = function (
|
|
9
|
+
export var formatDate = function (_a) {
|
|
10
|
+
var _b = _a.showTimezone, showTimezone = _b === void 0 ? false : _b, params = __rest(_a, ["showTimezone"]);
|
|
10
11
|
var date = params.date;
|
|
11
12
|
var formatString = params.formatString || normalizeDashes(DEFAULT_FORMAT_STRING);
|
|
12
13
|
var dateHelpers = params.dateHelpers || new DateHelpers(dateFnsAdapter);
|
|
@@ -18,10 +19,14 @@ export var formatDate = function (params) {
|
|
|
18
19
|
if (Array.isArray(date) && !date[0] && !date[1]) {
|
|
19
20
|
return '';
|
|
20
21
|
}
|
|
22
|
+
var formattedDate;
|
|
21
23
|
if (Array.isArray(date)) {
|
|
22
|
-
|
|
24
|
+
formattedDate = date.map(function (day) { return format(day); }).join(' – ');
|
|
23
25
|
}
|
|
24
|
-
|
|
26
|
+
else {
|
|
27
|
+
formattedDate = format(date);
|
|
28
|
+
}
|
|
29
|
+
return "".concat(formattedDate).concat(params.timezone && showTimezone ? " | ".concat(params.timezone) : '');
|
|
25
30
|
};
|
|
26
31
|
export var getAriaLabel = function (value, formatDisplayValue, locale) {
|
|
27
32
|
// No date selected
|
|
@@ -57,7 +62,10 @@ export var isTimeInRange = function (date, _a) {
|
|
|
57
62
|
return true;
|
|
58
63
|
}
|
|
59
64
|
if (Array.isArray(date)) {
|
|
60
|
-
return date.every(function (_date) {
|
|
65
|
+
return date.every(function (_date) {
|
|
66
|
+
return (!minDate || !_date || !dateHelpers.isBefore(_date, minDate)) &&
|
|
67
|
+
(!maxDate || !_date || !dateHelpers.isAfter(_date, maxDate));
|
|
68
|
+
});
|
|
61
69
|
}
|
|
62
70
|
return (!minDate || !dateHelpers.isBefore(date, minDate)) && (!maxDate || !dateHelpers.isAfter(date, maxDate));
|
|
63
71
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
//hooks
|
|
3
|
+
import { useDateTime } from './useDateTime';
|
|
4
|
+
export var DateTime = function (_a) {
|
|
5
|
+
var date = _a.date, variant = _a.variant, dateTimeOptions = _a.dateTimeOptions;
|
|
6
|
+
var formattedDate = useDateTime({ date: date, variant: variant, dateTimeOptions: dateTimeOptions });
|
|
7
|
+
return _jsx(_Fragment, { children: formattedDate }, void 0);
|
|
8
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ValueOf } from '../utility-types';
|
|
2
|
+
export declare const DATE_TIME_VARIANTS: {
|
|
3
|
+
readonly SHORT_DATE: "shortDate";
|
|
4
|
+
readonly MEDIUM_DATE: "mediumDate";
|
|
5
|
+
readonly LONG_DATE: "longDate";
|
|
6
|
+
readonly FULL_DATE: "fullDate";
|
|
7
|
+
readonly SHORT_TIME: "shortTime";
|
|
8
|
+
readonly MEDIUM_TIME: "mediumTime";
|
|
9
|
+
readonly LONG_TIME: "longTime";
|
|
10
|
+
readonly FULL_TIME: "fullTime";
|
|
11
|
+
readonly SHORT_DATE_TIME: "shortDateTime";
|
|
12
|
+
readonly MEDIUM_DATE_TIME: "mediumDateTime";
|
|
13
|
+
readonly LONG_DATE_TIME: "longDateTime";
|
|
14
|
+
readonly FULL_DATE_TIME: "fullDateTime";
|
|
15
|
+
readonly CUSTOM: "custom";
|
|
16
|
+
};
|
|
17
|
+
export declare type DateTimeProps = {
|
|
18
|
+
date: Date | number;
|
|
19
|
+
variant: ValueOf<typeof DATE_TIME_VARIANTS>;
|
|
20
|
+
dateTimeOptions?: Intl.DateTimeFormatOptions;
|
|
21
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export var DATE_TIME_VARIANTS = {
|
|
2
|
+
SHORT_DATE: 'shortDate',
|
|
3
|
+
MEDIUM_DATE: 'mediumDate',
|
|
4
|
+
LONG_DATE: 'longDate',
|
|
5
|
+
FULL_DATE: 'fullDate',
|
|
6
|
+
SHORT_TIME: 'shortTime',
|
|
7
|
+
MEDIUM_TIME: 'mediumTime',
|
|
8
|
+
LONG_TIME: 'longTime',
|
|
9
|
+
FULL_TIME: 'fullTime',
|
|
10
|
+
SHORT_DATE_TIME: 'shortDateTime',
|
|
11
|
+
MEDIUM_DATE_TIME: 'mediumDateTime',
|
|
12
|
+
LONG_DATE_TIME: 'longDateTime',
|
|
13
|
+
FULL_DATE_TIME: 'fullDateTime',
|
|
14
|
+
CUSTOM: 'custom',
|
|
15
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import { useLocale } from '../locale';
|
|
3
|
+
import { VARIANTS_DATE_FORMAT_OPTIONS } from './variants';
|
|
4
|
+
export var useDateTime = function (_a) {
|
|
5
|
+
var date = _a.date, variant = _a.variant, dateTimeOptions = _a.dateTimeOptions;
|
|
6
|
+
var variantOptions = VARIANTS_DATE_FORMAT_OPTIONS[variant];
|
|
7
|
+
var langCode = useLocale().langCode;
|
|
8
|
+
return Intl.DateTimeFormat(langCode, __assign(__assign({}, variantOptions), dateTimeOptions)).format(date);
|
|
9
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
var _a;
|
|
2
|
+
import { DATE_TIME_VARIANTS } from './types';
|
|
3
|
+
export var DEFAULT_VARIANT = DATE_TIME_VARIANTS.SHORT_DATE; //dd/mm/yyyy in en_US
|
|
4
|
+
export var VARIANTS_DATE_FORMAT_OPTIONS = (_a = {},
|
|
5
|
+
_a[DATE_TIME_VARIANTS.SHORT_DATE] = { year: 'numeric', month: 'numeric', day: 'numeric' },
|
|
6
|
+
_a[DATE_TIME_VARIANTS.MEDIUM_DATE] = {
|
|
7
|
+
year: 'numeric',
|
|
8
|
+
month: 'short',
|
|
9
|
+
day: 'numeric',
|
|
10
|
+
},
|
|
11
|
+
_a[DATE_TIME_VARIANTS.LONG_DATE] = {
|
|
12
|
+
year: 'numeric',
|
|
13
|
+
month: 'long',
|
|
14
|
+
day: 'numeric',
|
|
15
|
+
},
|
|
16
|
+
_a[DATE_TIME_VARIANTS.FULL_DATE] = {
|
|
17
|
+
year: 'numeric',
|
|
18
|
+
month: 'long',
|
|
19
|
+
day: 'numeric',
|
|
20
|
+
weekday: 'long',
|
|
21
|
+
},
|
|
22
|
+
_a[DATE_TIME_VARIANTS.SHORT_TIME] = {
|
|
23
|
+
hour: 'numeric',
|
|
24
|
+
minute: 'numeric',
|
|
25
|
+
hour12: true,
|
|
26
|
+
},
|
|
27
|
+
_a[DATE_TIME_VARIANTS.MEDIUM_TIME] = {
|
|
28
|
+
hour: 'numeric',
|
|
29
|
+
minute: 'numeric',
|
|
30
|
+
second: 'numeric',
|
|
31
|
+
hour12: true,
|
|
32
|
+
},
|
|
33
|
+
_a[DATE_TIME_VARIANTS.LONG_TIME] = {
|
|
34
|
+
hour: 'numeric',
|
|
35
|
+
minute: 'numeric',
|
|
36
|
+
second: 'numeric',
|
|
37
|
+
hour12: false,
|
|
38
|
+
timeZoneName: 'short',
|
|
39
|
+
},
|
|
40
|
+
_a[DATE_TIME_VARIANTS.FULL_TIME] = {
|
|
41
|
+
hour: 'numeric',
|
|
42
|
+
minute: 'numeric',
|
|
43
|
+
second: 'numeric',
|
|
44
|
+
hour12: false,
|
|
45
|
+
timeZoneName: 'long',
|
|
46
|
+
},
|
|
47
|
+
_a[DATE_TIME_VARIANTS.SHORT_DATE_TIME] = {
|
|
48
|
+
year: 'numeric',
|
|
49
|
+
month: 'numeric',
|
|
50
|
+
day: 'numeric',
|
|
51
|
+
hour: 'numeric',
|
|
52
|
+
minute: 'numeric',
|
|
53
|
+
hour12: true,
|
|
54
|
+
},
|
|
55
|
+
_a[DATE_TIME_VARIANTS.MEDIUM_DATE_TIME] = {
|
|
56
|
+
year: 'numeric',
|
|
57
|
+
month: 'short',
|
|
58
|
+
day: 'numeric',
|
|
59
|
+
hour: 'numeric',
|
|
60
|
+
minute: 'numeric',
|
|
61
|
+
hour12: true,
|
|
62
|
+
},
|
|
63
|
+
_a[DATE_TIME_VARIANTS.LONG_DATE_TIME] = {
|
|
64
|
+
year: 'numeric',
|
|
65
|
+
month: 'long',
|
|
66
|
+
day: 'numeric',
|
|
67
|
+
hour: 'numeric',
|
|
68
|
+
minute: 'numeric',
|
|
69
|
+
second: 'numeric',
|
|
70
|
+
hour12: true,
|
|
71
|
+
timeZoneName: 'short',
|
|
72
|
+
},
|
|
73
|
+
_a[DATE_TIME_VARIANTS.FULL_DATE_TIME] = {
|
|
74
|
+
year: 'numeric',
|
|
75
|
+
month: 'long',
|
|
76
|
+
day: 'numeric',
|
|
77
|
+
weekday: 'long',
|
|
78
|
+
hour: 'numeric',
|
|
79
|
+
minute: 'numeric',
|
|
80
|
+
second: 'numeric',
|
|
81
|
+
hour12: false,
|
|
82
|
+
timeZoneName: 'long',
|
|
83
|
+
},
|
|
84
|
+
_a);
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Intent } from '../types';
|
|
3
|
-
|
|
4
|
-
intent?: Intent | undefined;
|
|
5
|
-
}>;
|
|
6
|
-
export declare const FormControlProvider: import("react").Provider<{
|
|
7
|
-
intent?: Intent | undefined;
|
|
8
|
-
}>;
|
|
9
|
-
export declare const FormControlConsumer: import("react").Consumer<{
|
|
10
|
-
intent?: Intent | undefined;
|
|
11
|
-
}>;
|
|
12
|
-
export declare const useFormControl: () => {
|
|
3
|
+
declare type FormControlContextValueType = {
|
|
13
4
|
intent?: Intent;
|
|
14
5
|
};
|
|
6
|
+
export declare const FormControlProvider: import("react").Provider<FormControlContextValueType>;
|
|
7
|
+
export declare const FormControlConsumer: import("react").Consumer<FormControlContextValueType>;
|
|
8
|
+
export declare const useFormControl: () => FormControlContextValueType;
|
|
15
9
|
/**
|
|
16
10
|
* @param props
|
|
17
11
|
* uses form values to be passed using context to child components
|
|
18
12
|
* this hook can be scaled to incorporate multiple props
|
|
19
13
|
*/
|
|
20
|
-
export declare const useContextualFormProps: <T extends
|
|
21
|
-
|
|
22
|
-
}>(props: T) => T;
|
|
14
|
+
export declare const useContextualFormProps: <T extends FormControlContextValueType>(props: T, defaultProps?: FormControlContextValueType) => T;
|
|
15
|
+
export {};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
2
|
import { createContext, useContext } from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export var FormControlProvider =
|
|
6
|
-
export var FormControlConsumer =
|
|
7
|
-
export var useFormControl = function () { return useContext(
|
|
3
|
+
var FormControlContext = createContext({ intent: 'default' });
|
|
4
|
+
FormControlContext.displayName = 'FormControlContext';
|
|
5
|
+
export var FormControlProvider = FormControlContext.Provider;
|
|
6
|
+
export var FormControlConsumer = FormControlContext.Consumer;
|
|
7
|
+
export var useFormControl = function () { return useContext(FormControlContext); };
|
|
8
8
|
/**
|
|
9
9
|
* @param props
|
|
10
10
|
* uses form values to be passed using context to child components
|
|
11
11
|
* this hook can be scaled to incorporate multiple props
|
|
12
12
|
*/
|
|
13
|
-
export var useContextualFormProps = function (props) {
|
|
14
|
-
var _a;
|
|
15
|
-
|
|
16
|
-
var
|
|
13
|
+
export var useContextualFormProps = function (props, defaultProps) {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
if (defaultProps === void 0) { defaultProps = {}; }
|
|
16
|
+
var formControlValue = useFormControl();
|
|
17
|
+
var intent = (_b = (_a = props.intent) !== null && _a !== void 0 ? _a : formControlValue.intent) !== null && _b !== void 0 ? _b : defaultProps.intent;
|
|
17
18
|
return __assign(__assign({}, props), { intent: intent });
|
|
18
19
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { FormControlProps } from './types';
|
|
3
|
-
declare const FormControl:
|
|
3
|
+
declare const FormControl: React.ForwardRefExoticComponent<FormControlProps & React.RefAttributes<HTMLElement>>;
|
|
4
4
|
export { FormControl };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __assign, __read } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import { useMemo, useRef } from 'react';
|
|
3
|
+
import { useMemo, forwardRef } from 'react';
|
|
5
4
|
import * as React from 'react';
|
|
5
|
+
import { useUID } from 'react-uid';
|
|
6
6
|
import { add$props } from '../helpers';
|
|
7
7
|
import { Stack, StackItem } from '../stack';
|
|
8
8
|
import InfoIcon from '../icon/components/info';
|
|
@@ -23,32 +23,37 @@ function chooseRenderedHint(caption, error, positive, sharedProps) {
|
|
|
23
23
|
}
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
|
-
var FormControl = function (_a) {
|
|
26
|
+
var FormControl = forwardRef(function (_a, ref) {
|
|
27
27
|
var overrides = _a.overrides, label = _a.label, caption = _a.caption, disabled = _a.disabled, error = _a.error, positive = _a.positive, htmlFor = _a.htmlFor, children = _a.children, intent = _a.intent, required = _a.required, layout = _a.layout, $as = _a.$as, className = _a.className, subText = _a.subText, subTextAsIcon = _a.subTextAsIcon;
|
|
28
28
|
var onlyChildProps = React.Children.only(children).props;
|
|
29
|
-
var a11yCaptionId =
|
|
29
|
+
var a11yCaptionId = useUID();
|
|
30
|
+
var a11LabelId = useUID();
|
|
31
|
+
var a11SubTextId = useUID();
|
|
32
|
+
var fieldUniqueId = useUID();
|
|
30
33
|
// First try to infer id from props or children. Create new id if needed.
|
|
31
|
-
var a11yFieldId =
|
|
32
|
-
var sharedProps = __assign(__assign({}, add$props({ required: required, layout: layout, intent: intent, disabled: disabled })), { $error: !!error, $positive: !!positive });
|
|
34
|
+
var a11yFieldId = htmlFor || onlyChildProps.id || fieldUniqueId;
|
|
35
|
+
var sharedProps = __assign(__assign({}, add$props({ required: required, layout: layout, intent: intent, disabled: disabled })), { $error: !!error, $positive: !!positive, $hasSubText: !!subText, $subTextAsIcon: subTextAsIcon });
|
|
33
36
|
var hint = chooseRenderedHint(caption, error, positive, sharedProps);
|
|
34
37
|
var hintEl = intent === 'error' && (caption || error) ? (_jsxs(Stack, __assign({ direction: "horizontal", gap: 2, shrink: true }, { children: [_jsx(ErrorIcon, { size: 14 }, void 0), _jsx(StackItem, { children: hint }, void 0)] }), void 0)) : (hint);
|
|
35
38
|
var _b = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.LabelContainer, StyledLabelContainer), 2), LabelContainer = _b[0], labelContainerProps = _b[1], _c = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.Label, StyledLabel), 2), Label = _c[0], labelProps = _c[1], _d = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.RequiredDot, StyledRequiredDot), 2), RequiredDot = _d[0], requiredDotProps = _d[1], _e = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.Root, StyledRoot), 2), Root = _e[0], rootProps = _e[1], _f = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.SubText, StyledSubText), 2), SubText = _f[0], subTextProps = _f[1], _g = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.InfoIconContainer, StyledInfoIconContainer), 2), InfoIconContainer = _g[0], infoIconContainerProps = _g[1], _h = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.ControlContainer, StyledControlContainer), 2), ControlContainer = _h[0], controlContainerProps = _h[1], _j = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.Caption, StyledCaption), 2), Caption = _j[0], captionProps = _j[1], _k = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.SubTextTooltip, StatefulTooltip), 2), SubTextTooltip = _k[0], subTextTooltipProps = _k[1];
|
|
36
39
|
var formControlProviderValue = useMemo(function () { return ({ intent: intent }); }, [intent]);
|
|
37
40
|
var shouldRenderSubTextInTooltip = layout === 'horizontal' || subTextAsIcon;
|
|
38
|
-
return (_jsx(FormControlProvider, __assign({ value: formControlProviderValue }, { children: _jsxs(Root, __assign({ "data-testid": "form-control", "data-spaceweb": "form-control", className: className, "$as": $as }, sharedProps, rootProps, { children: [label && (_jsxs(LabelContainer, __assign({ "data-testid": "form-control-label-container" }, sharedProps, labelContainerProps, { children: [_jsx(Label, __assign({ "data-spaceweb": "form-control-label", htmlFor: a11yFieldId
|
|
41
|
+
return (_jsx(FormControlProvider, __assign({ value: formControlProviderValue }, { children: _jsxs(Root, __assign({ ref: ref, "data-testid": "form-control", "data-spaceweb": "form-control", className: className, "$as": $as }, sharedProps, rootProps, { children: [label && (_jsxs(LabelContainer, __assign({ "data-testid": "form-control-label-container" }, sharedProps, labelContainerProps, { children: [_jsx(Label, __assign({ id: a11LabelId, "data-spaceweb": "form-control-label", htmlFor: a11yFieldId }, sharedProps, labelProps, { children: typeof label === 'function' ? label(sharedProps) : label }), void 0), required && _jsx(RequiredDot, __assign({ "data-testid": "form-required" }, requiredDotProps), void 0), subText && shouldRenderSubTextInTooltip ? (_jsx(SubTextTooltip, __assign({ content: subText, size: "md" }, subTextTooltipProps, { children: _jsx(InfoIconContainer, __assign({}, infoIconContainerProps, { children: _jsx(InfoIcon, { className: "h-2 w-2" }, void 0) }), void 0) }), void 0)) : null] }), void 0)), subText && !shouldRenderSubTextInTooltip ? (_jsx(SubText, __assign({ id: a11SubTextId }, subTextProps, { children: typeof subText === 'function' ? subText(sharedProps) : subText }), void 0)) : null, _jsxs(ControlContainer, __assign({ "data-spaceweb": "form-control-container" }, sharedProps, controlContainerProps, { children: [React.Children.map(children, function (child, index) {
|
|
39
42
|
if (!child)
|
|
40
43
|
return null;
|
|
41
44
|
var key = child.key || String(index);
|
|
42
45
|
return React.cloneElement(child, {
|
|
43
46
|
key: key,
|
|
44
|
-
id: a11yFieldId
|
|
45
|
-
'aria-errormessage': error ? a11yCaptionId
|
|
46
|
-
'aria-describedby': caption || positive
|
|
47
|
+
id: a11yFieldId,
|
|
48
|
+
'aria-errormessage': error ? a11yCaptionId : null,
|
|
49
|
+
'aria-describedby': caption || positive || subText
|
|
50
|
+
? "".concat(subText ? a11SubTextId : '', " ").concat(caption ? a11yCaptionId : '', " ")
|
|
51
|
+
: null,
|
|
47
52
|
'aria-required': required ? 'true' : 'false',
|
|
48
53
|
disabled: onlyChildProps.disabled || disabled,
|
|
49
54
|
error: typeof onlyChildProps.error !== 'undefined' ? onlyChildProps.error : error,
|
|
50
55
|
positive: typeof onlyChildProps.positive !== 'undefined' ? onlyChildProps.positive : positive,
|
|
51
56
|
});
|
|
52
|
-
}), (caption || error || positive) && (_jsx(Caption, __assign({ "data-spaceweb": "form-control-caption", id: a11yCaptionId
|
|
53
|
-
};
|
|
57
|
+
}), (caption || error || positive) && (_jsx(Caption, __assign({ "data-spaceweb": "form-control-caption", id: a11yCaptionId }, sharedProps, captionProps, { children: hintEl }), void 0))] }), void 0)] }), void 0) }), void 0));
|
|
58
|
+
});
|
|
54
59
|
export { FormControl };
|
|
@@ -14,20 +14,31 @@ var getIntentColor = function (_a, _b) {
|
|
|
14
14
|
return { color: theme.spr.text02 };
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
export var StyledSubText = styled('div', 'spr-text-02
|
|
17
|
+
export var StyledSubText = styled('div', 'spr-text-02 mb-1', {
|
|
18
|
+
fontSize: '13px',
|
|
19
|
+
lineHeight: '16px',
|
|
20
|
+
fontWeight: 400,
|
|
21
|
+
});
|
|
18
22
|
export var StyledInfoIconContainer = styled('div', 'spr-ui-03 rounded-full flex items-center justify-center ml-2 flex-shrink-0', function (_a) {
|
|
19
23
|
var px2rem = _a.px2rem;
|
|
20
24
|
return ({ height: px2rem(14), width: px2rem(14) });
|
|
21
25
|
});
|
|
22
|
-
export var StyledRequiredDot = styled('span', '
|
|
23
|
-
export var StyledRoot = styled('div', '
|
|
26
|
+
export var StyledRequiredDot = styled('span', 'spr-support-error rounded-full h-1 w-1 flex-shrink-0 ml-1');
|
|
27
|
+
export var StyledRoot = styled('div', 'flex', function (utils, _a) {
|
|
24
28
|
var $layout = _a.$layout;
|
|
25
29
|
return $layout === 'horizontal' ? 'flex-row items-baseline' : 'flex-col';
|
|
26
30
|
});
|
|
27
|
-
export var StyledCaption = styled('div', 'typography-l2
|
|
28
|
-
export var StyledLabelContainer = styled('div', 'flex items-center
|
|
31
|
+
export var StyledCaption = styled('div', 'typography-l2 mt-1', getIntentColor);
|
|
32
|
+
export var StyledLabelContainer = styled('div', 'flex items-center w-full', function (utils, _a) {
|
|
29
33
|
var $layout = _a.$layout;
|
|
30
|
-
return $layout === 'horizontal' ? 'w-4/24 mr-2' : '';
|
|
34
|
+
return ($layout === 'horizontal' ? 'w-4/24 mr-2' : '');
|
|
35
|
+
}, function (utils, _a) {
|
|
36
|
+
var $hasSubText = _a.$hasSubText, $subTextAsIcon = _a.$subTextAsIcon;
|
|
37
|
+
return (!$hasSubText || $subTextAsIcon ? 'mb-1' : '');
|
|
38
|
+
});
|
|
39
|
+
export var StyledLabel = styled('label', 'spr-text-02', {
|
|
40
|
+
fontSize: '14px',
|
|
41
|
+
lineHeight: '18px',
|
|
42
|
+
fontWeight: 400,
|
|
31
43
|
});
|
|
32
|
-
export var StyledLabel = styled('label', 'typography-l2 spr-text-02');
|
|
33
44
|
export var StyledControlContainer = styled('div', 'w-full');
|
|
@@ -2,9 +2,11 @@ import { __assign, __rest } from "tslib";
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import IconButton from '../button/IconButton';
|
|
4
4
|
import Close from '../icon/components/close';
|
|
5
|
+
import { useLocale } from '../locale';
|
|
5
6
|
var ClearIconButton = function (_a) {
|
|
6
7
|
var size = _a.size, $size = _a.$size, $isOpen = _a.$isOpen, props = __rest(_a, ["size", "$size", "$isOpen"]);
|
|
7
|
-
|
|
8
|
+
var locale = useLocale();
|
|
9
|
+
return (_jsx(IconButton, __assign({ "aria-label": locale.input.clearAriaLabel }, props, { overrides: {
|
|
8
10
|
BaseButton: {
|
|
9
11
|
style: [
|
|
10
12
|
'h-5 w-5 spr-text-02 hover:spr-text-01 focus:spr-text-01 hover:spr-ui-03 focus:spr-ui-03 bg-transparent',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const StyledTombstone: import("../style/styled").StyledComponent;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import styled from '../style/styled';
|
|
2
|
+
export var StyledTombstone = styled('div', 'spr-ui-03 h-full w-full', {
|
|
3
|
+
animationDuration: '1s',
|
|
4
|
+
animationIterationCount: 'infinite',
|
|
5
|
+
animationTimingFunction: 'ease-in-out',
|
|
6
|
+
animationName: {
|
|
7
|
+
'0%': {
|
|
8
|
+
opacity: '1',
|
|
9
|
+
},
|
|
10
|
+
'50%': {
|
|
11
|
+
opacity: '0.4',
|
|
12
|
+
},
|
|
13
|
+
'100%': {
|
|
14
|
+
opacity: '1',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
});
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { __assign, __read, __spreadArray } from "tslib";
|
|
2
2
|
import _reduce from 'lodash/reduce';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
|
+
import rtlCSSJS from 'rtl-css-js';
|
|
4
5
|
import { mergeOverrides } from '../../overrides';
|
|
5
6
|
import _getStyleWithProps from '../../style/_getStyleWithProps';
|
|
6
7
|
import useStyle from '../../style/useStyle';
|
|
7
|
-
var
|
|
8
|
+
var identity = function (x) { return x; };
|
|
9
|
+
var convertOverrideObject = function (override, utils) { return (__assign(__assign({}, override), { style: function (props) {
|
|
10
|
+
var decorator = utils.isRTL ? rtlCSSJS : identity;
|
|
11
|
+
return decorator(_getStyleWithProps(utils, props, override.style));
|
|
12
|
+
} })); };
|
|
8
13
|
var mergeAndConvertOverrides = function (target, source, utils) {
|
|
9
14
|
if (source === void 0) { source = {}; }
|
|
10
15
|
var mergedOverrides = mergeOverrides(target, source);
|
|
@@ -12,7 +12,7 @@ var withThemeOverride = function (Component, mapSpaceThemeToBaseTheme) {
|
|
|
12
12
|
var ThemeOverridenComponent = React.forwardRef(function ThemeOverride(props, ref) {
|
|
13
13
|
var theme = useStyle().theme;
|
|
14
14
|
var _a = __read(useMemoizedStyletron(), 2), styletronTheme = _a[1];
|
|
15
|
-
var updatedTheme = createTheme(styletronTheme, mapSpaceThemeToBaseTheme(theme));
|
|
15
|
+
var updatedTheme = React.useMemo(function () { return createTheme(styletronTheme, mapSpaceThemeToBaseTheme(theme)); }, [styletronTheme, theme]);
|
|
16
16
|
return (_jsx(ThemeProvider, __assign({ theme: updatedTheme }, { children: _jsx(Component, __assign({ ref: ref }, props), void 0) }), void 0));
|
|
17
17
|
});
|
|
18
18
|
ThemeOverridenComponent.displayName = "withThemeOverride(".concat(Component.displayName || Component.name, ")");
|
|
@@ -9,8 +9,8 @@ export declare const chevronStyles: StyleFn<{
|
|
|
9
9
|
export declare const transparentScrollbarStyles: StyleObject;
|
|
10
10
|
export declare type OutlineProps = {
|
|
11
11
|
$outlineColor?: string;
|
|
12
|
-
$outlineWidth?:
|
|
13
|
-
$outlineOffset?:
|
|
12
|
+
$outlineWidth?: StyleObject['outlineWidth'];
|
|
13
|
+
$outlineOffset?: StyleObject['outlineOffset'];
|
|
14
14
|
$outlineStyle?: string;
|
|
15
15
|
};
|
|
16
16
|
export declare const getOutlineStyles: ({ theme }: StyleUtils, props?: OutlineProps | undefined) => StyleObject;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import { borderColor, borderRadius, borderStyle, borderWidth } from './longHandHelpers';
|
|
1
3
|
export var chevronStyles = function (_a, _b) {
|
|
2
4
|
var theme = _a.theme, px2rem = _a.px2rem;
|
|
3
5
|
var $isOpen = _b.$isOpen;
|
|
@@ -21,12 +23,7 @@ export var transparentScrollbarStyles = {
|
|
|
21
23
|
'::-webkit-scrollbar': {
|
|
22
24
|
backgroundColor: 'transparent',
|
|
23
25
|
},
|
|
24
|
-
'::-webkit-scrollbar-thumb': {
|
|
25
|
-
backgroundColor: 'darkgrey',
|
|
26
|
-
border: '4px solid transparent',
|
|
27
|
-
borderRadius: '8px',
|
|
28
|
-
backgroundClip: 'padding-box',
|
|
29
|
-
},
|
|
26
|
+
'::-webkit-scrollbar-thumb': __assign(__assign(__assign(__assign(__assign({ backgroundColor: 'darkgrey' }, borderRadius('8px')), borderWidth('4px')), borderStyle('solid')), borderColor('transparent')), { backgroundClip: 'padding-box' }),
|
|
30
27
|
};
|
|
31
28
|
export var getOutlineStyles = function (_a, props) {
|
|
32
29
|
var theme = _a.theme;
|
package/esm/helpers/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare const add$props: (props: Record<string, unknown>) => Record<strin
|
|
|
17
17
|
* @param value
|
|
18
18
|
*/
|
|
19
19
|
export declare const covertCSSVariablesToValue: <T extends string | object>(value: T) => T;
|
|
20
|
+
export declare const themeTokenToHex: (token: string) => string | null;
|
|
20
21
|
/**
|
|
21
22
|
* Converts hexadecimal color to RGB or RGBA (if alpha is provided)
|
|
22
23
|
* @param hex hexadecimal color
|
package/esm/helpers/index.js
CHANGED
|
@@ -44,6 +44,14 @@ export var covertCSSVariablesToValue = function (value) {
|
|
|
44
44
|
}
|
|
45
45
|
return value;
|
|
46
46
|
};
|
|
47
|
+
export var themeTokenToHex = function (token) {
|
|
48
|
+
var hex = covertCSSVariablesToValue(token);
|
|
49
|
+
var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
|
50
|
+
var parsed = hex.replace(shorthandRegex, function (m, r, g, b) {
|
|
51
|
+
return r + r + g + g + b + b;
|
|
52
|
+
});
|
|
53
|
+
return parsed;
|
|
54
|
+
};
|
|
47
55
|
/**
|
|
48
56
|
* Converts hexadecimal color to RGB or RGBA (if alpha is provided)
|
|
49
57
|
* @param hex hexadecimal color
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
/**
|
|
2
3
|
* @deprecated use spaceweb/styled
|
|
3
4
|
*/
|
|
4
|
-
export declare const styled:
|
|
5
|
+
export declare const styled: {
|
|
6
|
+
<C extends keyof JSX.IntrinsicElements | import("react").ComponentType<any>, P extends {}, Theme = ThemeT>(component: C, style: import("styletron-standard").StyleObject | ((props: Omit<P, "$theme"> & {
|
|
7
|
+
$theme: Theme;
|
|
8
|
+
}) => import("styletron-standard").StyleObject)): import("styletron-react").StyletronComponent<C, P>;
|
|
9
|
+
<C_1 extends keyof JSX.IntrinsicElements | import("react").ComponentType<any>>(component: C_1, style: import("styletron-standard").StyleObject): import("styletron-react").StyletronComponent<C_1, {}>;
|
|
10
|
+
};
|
|
5
11
|
/**
|
|
6
12
|
* @deprecated
|
|
7
13
|
*/
|
|
8
|
-
export declare const withStyle:
|
|
14
|
+
export declare const withStyle: {
|
|
15
|
+
<C extends import("styletron-react").StyletronComponent<any, any>, P extends {}, Theme = ThemeT>(component: C, style: import("styletron-standard").StyleObject | ((props: Omit<P, "$theme"> & {
|
|
16
|
+
$theme: Theme;
|
|
17
|
+
} & (C extends import("styletron-react").StyletronComponent<infer CC, infer PP> ? PP : never)) => import("styletron-standard").StyleObject)): C extends import("styletron-react").StyletronComponent<infer CC_1, infer PP_1> ? import("styletron-react").StyletronComponent<CC_1, P & PP_1> : never;
|
|
18
|
+
<C_1 extends import("styletron-react").StyletronComponent<any, any>>(component: C_1, style: import("styletron-standard").StyleObject): C_1;
|
|
19
|
+
};
|
|
9
20
|
/**
|
|
10
21
|
* @deprecated use spaceweb/useStyle
|
|
11
22
|
*/
|
|
12
|
-
export declare const useStyletron: () => [(
|
|
23
|
+
export declare const useStyletron: () => [(a: import("styletron-standard").StyleObject) => string, ThemeT];
|
|
@@ -2,3 +2,4 @@ import { Theme } from '@sprinklrjs/spaceweb-themes/types';
|
|
|
2
2
|
import { Size } from '../types';
|
|
3
3
|
export declare const getComponentTheme: (theme: Theme, componentName: string) => any;
|
|
4
4
|
export declare const getComponentSizeTheme: (theme: Theme, componentName: string, size: Size | undefined, defaultSize: Size) => any;
|
|
5
|
+
export declare const getDefaultSize: (theme: Theme) => 'md' | 'xxxs';
|