@sprinklrjs/spaceweb 10.1.0 → 12.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/allComponentsAndUtilities.d.ts +1 -0
- package/allComponentsAndUtilities.js +2 -1
- package/asyncSelect/asyncSelect.d.ts +4 -2
- package/asyncSelect/asyncSelect.js +43 -108
- package/asyncSelect/groupedAsyncSelect.d.ts +5 -0
- package/asyncSelect/groupedAsyncSelect.js +41 -0
- package/asyncSelect/helpers.d.ts +9 -3
- package/asyncSelect/helpers.js +35 -4
- package/asyncSelect/hooks/useAsyncOptionHandlers.d.ts +17 -12
- package/asyncSelect/hooks/useAsyncOptionHandlers.js +73 -26
- package/asyncSelect/hooks/useAsyncSelect.d.ts +10 -0
- package/asyncSelect/hooks/useAsyncSelect.js +182 -0
- package/asyncSelect/hooks/useResolveSelectedOptions.d.ts +10 -7
- package/asyncSelect/hooks/useResolveSelectedOptions.js +59 -47
- package/asyncSelect/index.d.ts +4 -1
- package/asyncSelect/index.js +8 -0
- package/asyncSelect/types.d.ts +63 -12
- package/avatar/avatar.js +12 -2
- package/avatar/index.d.ts +1 -1
- package/avatar/styled-component.js +7 -22
- package/avatar/types.d.ts +1 -1
- package/badge/styled-component.js +10 -8
- package/banner/banner-item.d.ts +12 -0
- package/banner/banner-item.js +14 -0
- package/banner/banner.d.ts +19 -0
- package/banner/banner.js +56 -0
- package/banner/index.d.ts +5 -0
- package/banner/index.js +14 -0
- package/banner/locale.d.ts +6 -0
- package/banner/locale.js +2 -0
- package/banner/package.json +4 -0
- package/banner/styled-component.d.ts +6 -0
- package/banner/styled-component.js +39 -0
- package/banner/types.d.ts +26 -0
- package/banner/types.js +2 -0
- package/breadcrumb/breadcrumb-item.d.ts +7 -0
- package/breadcrumb/breadcrumb-item.js +41 -0
- package/breadcrumb/breadcrumb.d.ts +7 -0
- package/breadcrumb/breadcrumb.js +29 -0
- package/breadcrumb/index.d.ts +4 -0
- package/breadcrumb/index.js +17 -0
- package/breadcrumb/package.json +4 -0
- package/breadcrumb/styled-components.d.ts +7 -0
- package/breadcrumb/styled-components.js +19 -0
- package/breadcrumb/types.d.ts +38 -0
- package/breadcrumb/types.js +2 -0
- package/button/Button.d.ts +3 -3
- package/button/Button.js +14 -2
- package/button/IconButton/IconButton.d.ts +2 -4
- package/button/IconButton/IconButton.js +5 -2
- package/button/IconButton/types.d.ts +10 -1
- package/button/basewebAdapter.d.ts +9 -6
- package/button/basewebAdapter.js +1 -1
- package/button/styled-components.js +30 -25
- package/button/types.d.ts +4 -1
- package/button-group/ButtonGroup.d.ts +1 -0
- package/button-group/ButtonGroup.js +9 -5
- package/button-group/StatefulButtonGroup.d.ts +1 -0
- package/button-group/index.d.ts +1 -2
- package/button-group/index.js +1 -5
- package/button-group/styled-components.d.ts +34 -0
- package/button-group/styled-components.js +60 -12
- package/button-group/types.d.ts +3 -0
- package/checkbox/basewebAdapters.d.ts +5 -2
- package/checkbox/basewebAdapters.js +9 -2
- package/checkbox/index.d.ts +1 -1
- package/checkbox/index.js +1 -2
- package/checkbox/styled-components.js +1 -1
- package/checkbox/types.d.ts +15 -8
- package/color-picker/ColorPalette.d.ts +9 -0
- package/color-picker/ColorPalette.js +26 -0
- package/color-picker/ColorPicker.d.ts +3 -0
- package/color-picker/ColorPicker.js +35 -0
- package/color-picker/Swatch.d.ts +12 -0
- package/color-picker/Swatch.js +40 -0
- package/color-picker/colors.d.ts +1 -0
- package/color-picker/colors.js +109 -0
- package/color-picker/getContrastRatio.d.ts +1 -0
- package/color-picker/getContrastRatio.js +23 -0
- package/color-picker/index.d.ts +3 -0
- package/color-picker/index.js +7 -0
- package/color-picker/locale.d.ts +3 -0
- package/color-picker/locale.js +2 -0
- package/color-picker/package.json +4 -0
- package/color-picker/styled-component.d.ts +1 -0
- package/color-picker/styled-component.js +5 -0
- package/color-picker/types.d.ts +15 -0
- package/color-picker/types.js +2 -0
- package/currency/Currency.d.ts +3 -0
- package/currency/Currency.js +14 -0
- package/currency/constants.d.ts +3 -0
- package/currency/constants.js +8 -0
- package/currency/index.d.ts +5 -0
- package/currency/index.js +12 -0
- package/currency/package.json +4 -0
- package/currency/types.d.ts +7 -0
- package/currency/types.js +2 -0
- package/currency/useCurrency.d.ts +2 -0
- package/currency/useCurrency.js +12 -0
- package/currency/utils.d.ts +8 -0
- package/currency/utils.js +11 -0
- package/date-input/Before.d.ts +4 -2
- package/date-input/Before.js +4 -4
- package/date-input/CalendarIconButton.js +7 -1
- package/date-input/DateInput.d.ts +1 -1
- package/date-input/DateInput.js +47 -26
- package/date-input/styled-components.d.ts +2 -2
- package/date-input/styled-components.js +10 -8
- package/date-input/types.d.ts +4 -2
- package/date-picker/Calendar.d.ts +1 -1
- package/date-picker/Calendar.js +16 -6
- package/date-picker/DateInput.d.ts +3 -2
- package/date-picker/DateInput.js +19 -17
- package/date-picker/DatePickerContent.d.ts +9 -3
- package/date-picker/DatePickerContent.js +59 -8
- package/date-picker/DatePickerInput.js +13 -16
- package/date-picker/DateTimeContainer.d.ts +4 -2
- package/date-picker/DateTimeContainer.js +5 -5
- package/date-picker/StatelessDatePicker.d.ts +1 -1
- package/date-picker/StatelessDatePicker.js +40 -20
- package/date-picker/TimeInput.d.ts +5 -2
- package/date-picker/TimeInput.js +4 -2
- package/date-picker/index.d.ts +1 -0
- package/date-picker/index.js +3 -1
- package/date-picker/locale.d.ts +2 -0
- package/date-picker/stateful-container.d.ts +1 -1
- package/date-picker/stateful-container.js +11 -8
- package/date-picker/styled-components.d.ts +0 -1
- package/date-picker/styled-components.js +54 -27
- package/date-picker/types.d.ts +10 -1
- package/date-picker/utils.d.ts +10 -7
- package/date-picker/utils.js +12 -4
- package/date-time/DateTime.d.ts +3 -0
- package/date-time/DateTime.js +12 -0
- package/date-time/index.d.ts +3 -0
- package/date-time/index.js +9 -0
- package/date-time/package.json +4 -0
- package/date-time/types.d.ts +21 -0
- package/date-time/types.js +18 -0
- package/date-time/useDateTime.d.ts +2 -0
- package/date-time/useDateTime.js +13 -0
- package/date-time/variants.d.ts +4 -0
- package/date-time/variants.js +87 -0
- package/esm/allComponentsAndUtilities.d.ts +1 -0
- package/esm/allComponentsAndUtilities.js +2 -0
- package/esm/asyncSelect/asyncSelect.d.ts +4 -2
- package/esm/asyncSelect/asyncSelect.js +46 -111
- package/esm/asyncSelect/groupedAsyncSelect.d.ts +5 -0
- package/esm/asyncSelect/groupedAsyncSelect.js +37 -0
- package/esm/asyncSelect/helpers.d.ts +9 -3
- package/esm/asyncSelect/helpers.js +31 -3
- package/esm/asyncSelect/hooks/useAsyncOptionHandlers.d.ts +17 -12
- package/esm/asyncSelect/hooks/useAsyncOptionHandlers.js +76 -29
- package/esm/asyncSelect/hooks/useAsyncSelect.d.ts +10 -0
- package/esm/asyncSelect/hooks/useAsyncSelect.js +178 -0
- package/esm/asyncSelect/hooks/useResolveSelectedOptions.d.ts +10 -7
- package/esm/asyncSelect/hooks/useResolveSelectedOptions.js +62 -50
- package/esm/asyncSelect/index.d.ts +4 -1
- package/esm/asyncSelect/index.js +3 -0
- package/esm/asyncSelect/types.d.ts +63 -12
- package/esm/avatar/avatar.js +12 -2
- package/esm/avatar/index.d.ts +1 -1
- package/esm/avatar/styled-component.js +7 -22
- package/esm/avatar/types.d.ts +1 -1
- package/esm/badge/styled-component.js +10 -8
- package/esm/banner/banner-item.d.ts +12 -0
- package/esm/banner/banner-item.js +12 -0
- package/esm/banner/banner.d.ts +19 -0
- package/esm/banner/banner.js +54 -0
- package/esm/banner/index.d.ts +5 -0
- package/esm/banner/index.js +3 -0
- package/esm/banner/locale.d.ts +6 -0
- package/esm/banner/locale.js +1 -0
- package/esm/banner/styled-component.d.ts +6 -0
- package/esm/banner/styled-component.js +35 -0
- package/esm/banner/types.d.ts +26 -0
- package/esm/banner/types.js +1 -0
- package/esm/breadcrumb/breadcrumb-item.d.ts +7 -0
- package/esm/breadcrumb/breadcrumb-item.js +39 -0
- package/esm/breadcrumb/breadcrumb.d.ts +7 -0
- package/esm/breadcrumb/breadcrumb.js +27 -0
- package/esm/breadcrumb/index.d.ts +4 -0
- package/esm/breadcrumb/index.js +3 -0
- package/esm/breadcrumb/styled-components.d.ts +7 -0
- package/esm/breadcrumb/styled-components.js +15 -0
- package/esm/breadcrumb/types.d.ts +38 -0
- package/esm/breadcrumb/types.js +1 -0
- package/esm/button/Button.d.ts +3 -3
- package/esm/button/Button.js +14 -2
- package/esm/button/IconButton/IconButton.d.ts +2 -4
- package/esm/button/IconButton/IconButton.js +5 -2
- package/esm/button/IconButton/types.d.ts +10 -1
- package/esm/button/basewebAdapter.d.ts +9 -6
- package/esm/button/basewebAdapter.js +1 -1
- package/esm/button/styled-components.js +30 -25
- package/esm/button/types.d.ts +4 -1
- package/esm/button-group/ButtonGroup.d.ts +1 -0
- package/esm/button-group/ButtonGroup.js +9 -5
- package/esm/button-group/StatefulButtonGroup.d.ts +1 -0
- package/esm/button-group/index.d.ts +1 -2
- package/esm/button-group/index.js +0 -1
- package/esm/button-group/styled-components.d.ts +34 -0
- package/esm/button-group/styled-components.js +58 -11
- package/esm/button-group/types.d.ts +3 -0
- package/esm/checkbox/basewebAdapters.d.ts +5 -2
- package/esm/checkbox/basewebAdapters.js +9 -2
- package/esm/checkbox/index.d.ts +1 -1
- package/esm/checkbox/index.js +1 -1
- package/esm/checkbox/styled-components.js +1 -1
- package/esm/checkbox/types.d.ts +15 -8
- package/esm/color-picker/ColorPalette.d.ts +9 -0
- package/esm/color-picker/ColorPalette.js +22 -0
- package/esm/color-picker/ColorPicker.d.ts +3 -0
- package/esm/color-picker/ColorPicker.js +31 -0
- package/esm/color-picker/Swatch.d.ts +12 -0
- package/esm/color-picker/Swatch.js +37 -0
- package/esm/color-picker/colors.d.ts +1 -0
- package/esm/color-picker/colors.js +106 -0
- package/esm/color-picker/getContrastRatio.d.ts +1 -0
- package/esm/color-picker/getContrastRatio.js +19 -0
- package/esm/color-picker/index.d.ts +3 -0
- package/esm/color-picker/index.js +2 -0
- package/esm/color-picker/locale.d.ts +3 -0
- package/esm/color-picker/locale.js +1 -0
- package/esm/color-picker/styled-component.d.ts +1 -0
- package/esm/color-picker/styled-component.js +2 -0
- package/esm/color-picker/types.d.ts +15 -0
- package/esm/color-picker/types.js +1 -0
- package/esm/currency/Currency.d.ts +3 -0
- package/esm/currency/Currency.js +10 -0
- package/esm/currency/constants.d.ts +3 -0
- package/esm/currency/constants.js +5 -0
- package/esm/currency/index.d.ts +5 -0
- package/esm/currency/index.js +5 -0
- package/esm/currency/types.d.ts +7 -0
- package/esm/currency/types.js +1 -0
- package/esm/currency/useCurrency.d.ts +2 -0
- package/esm/currency/useCurrency.js +8 -0
- package/esm/currency/utils.d.ts +8 -0
- package/esm/currency/utils.js +7 -0
- package/esm/date-input/Before.d.ts +4 -2
- package/esm/date-input/Before.js +4 -4
- package/esm/date-input/CalendarIconButton.js +7 -1
- package/esm/date-input/DateInput.d.ts +1 -1
- package/esm/date-input/DateInput.js +48 -27
- package/esm/date-input/styled-components.d.ts +2 -2
- package/esm/date-input/styled-components.js +10 -7
- package/esm/date-input/types.d.ts +4 -2
- package/esm/date-picker/Calendar.d.ts +1 -1
- package/esm/date-picker/Calendar.js +17 -7
- package/esm/date-picker/DateInput.d.ts +3 -2
- package/esm/date-picker/DateInput.js +20 -18
- package/esm/date-picker/DatePickerContent.d.ts +9 -3
- package/esm/date-picker/DatePickerContent.js +60 -9
- package/esm/date-picker/DatePickerInput.js +13 -16
- package/esm/date-picker/DateTimeContainer.d.ts +4 -2
- package/esm/date-picker/DateTimeContainer.js +5 -5
- package/esm/date-picker/StatelessDatePicker.d.ts +1 -1
- package/esm/date-picker/StatelessDatePicker.js +40 -20
- package/esm/date-picker/TimeInput.d.ts +5 -2
- package/esm/date-picker/TimeInput.js +4 -2
- package/esm/date-picker/index.d.ts +1 -0
- package/esm/date-picker/index.js +1 -0
- package/esm/date-picker/locale.d.ts +2 -0
- package/esm/date-picker/stateful-container.d.ts +1 -1
- package/esm/date-picker/stateful-container.js +11 -8
- package/esm/date-picker/styled-components.d.ts +0 -1
- package/esm/date-picker/styled-components.js +53 -26
- package/esm/date-picker/types.d.ts +10 -1
- package/esm/date-picker/utils.d.ts +10 -7
- package/esm/date-picker/utils.js +13 -5
- package/esm/date-time/DateTime.d.ts +3 -0
- package/esm/date-time/DateTime.js +8 -0
- package/esm/date-time/index.d.ts +3 -0
- package/esm/date-time/index.js +3 -0
- package/esm/date-time/types.d.ts +21 -0
- package/esm/date-time/types.js +15 -0
- package/esm/date-time/useDateTime.d.ts +2 -0
- package/esm/date-time/useDateTime.js +9 -0
- package/esm/date-time/variants.d.ts +4 -0
- package/esm/date-time/variants.js +84 -0
- package/esm/form-control/context.d.ts +6 -13
- package/esm/form-control/context.js +10 -9
- package/esm/form-control/form-control.d.ts +1 -1
- package/esm/form-control/form-control.js +17 -12
- package/esm/form-control/styled-component.js +18 -7
- package/esm/helpers/ClearIconButton.js +3 -1
- package/esm/helpers/StyledTombstone.d.ts +1 -0
- package/esm/helpers/StyledTombstone.js +17 -0
- package/esm/helpers/baseui/useConvertOverrides.js +6 -1
- package/esm/helpers/baseui/withThemeOverride.js +1 -1
- package/esm/helpers/commonStyles.d.ts +2 -2
- package/esm/helpers/commonStyles.js +3 -6
- package/esm/helpers/index.d.ts +1 -0
- package/esm/helpers/index.js +8 -0
- package/esm/helpers/styletron.d.ts +14 -3
- package/esm/helpers/themeHelpers.d.ts +1 -0
- package/esm/helpers/themeHelpers.js +13 -0
- package/esm/hooks/useAutoFocus.d.ts +6 -7
- package/esm/hooks/useAutoFocus.js +19 -13
- package/esm/hooks/useCombinedRef.d.ts +1 -0
- package/esm/hooks/useCombinedRef.js +33 -0
- package/esm/hooks/useIsMobileDevice.d.ts +1 -0
- package/esm/hooks/useIsMobileDevice.js +6 -0
- package/esm/hooks/useMatchMedia.d.ts +3 -0
- package/esm/hooks/useMatchMedia.js +49 -0
- package/esm/icon/components/alert-solid.js +2 -0
- package/esm/icon/components/alert.js +2 -0
- package/esm/icon/components/calendar-solid.js +2 -0
- package/esm/icon/components/chevron-down.js +2 -0
- package/esm/icon/components/chevron-left.d.ts +3 -0
- package/esm/icon/components/chevron-left.js +8 -0
- package/esm/icon/components/chevron-right.d.ts +3 -0
- package/esm/icon/components/chevron-right.js +8 -0
- package/esm/icon/components/close.js +2 -0
- package/esm/icon/components/error-clr.js +2 -0
- package/esm/icon/components/error-solid.js +2 -0
- package/esm/icon/components/error.js +2 -0
- package/esm/icon/components/imagePreview.js +2 -0
- package/esm/icon/components/info.js +2 -0
- package/esm/icon/components/play-video.js +2 -0
- package/esm/icon/components/reset-color.d.ts +3 -0
- package/esm/icon/components/reset-color.js +8 -0
- package/esm/icon/components/search.js +2 -0
- package/esm/icon/components/tick.js +2 -0
- package/esm/icon/components/tickCircle-solid.js +2 -0
- package/esm/icon/components/user.js +2 -0
- package/esm/icon/components/video-non-playable.js +2 -0
- package/esm/index.d.ts +2 -0
- package/esm/index.js +2 -0
- package/esm/input/basewebAdapters.d.ts +1 -1
- package/esm/input/basewebAdapters.js +18 -3
- package/esm/input/index.d.ts +2 -1
- package/esm/input/index.js +1 -0
- package/esm/input/styled-components.d.ts +1 -1
- package/esm/input/styled-components.js +8 -6
- package/esm/input/types.d.ts +10 -4
- package/esm/layer/useLayersContextValue.js +3 -2
- package/esm/list/avatar-list-item.d.ts +12 -22
- package/esm/list/avatar-list-item.js +8 -10
- package/esm/list/divider.js +6 -3
- package/esm/list/index.d.ts +1 -1
- package/esm/list/index.js +1 -1
- package/esm/list/list-item.d.ts +3 -1
- package/esm/list/list-item.js +9 -6
- package/esm/list/list.d.ts +10 -5
- package/esm/list/list.js +47 -6
- package/esm/list/styled-component.d.ts +1 -0
- package/esm/list/styled-component.js +23 -17
- package/esm/list/types.d.ts +8 -0
- package/esm/list/utils.d.ts +2 -0
- package/esm/list/utils.js +10 -0
- package/esm/locale/en_US.js +35 -0
- package/esm/locale/types.d.ts +21 -0
- package/esm/menu/MenuContext.d.ts +2 -1
- package/esm/menu/MenuContext.js +1 -0
- package/esm/menu/menu-item.d.ts +8 -2
- package/esm/menu/menu-item.js +11 -11
- package/esm/menu/menu.d.ts +6 -0
- package/esm/menu/menu.js +11 -11
- package/esm/menu/types.d.ts +1 -0
- package/esm/menu/useKeyboardNavigation.d.ts +6 -3
- package/esm/menu/useKeyboardNavigation.js +21 -14
- package/esm/menu/useStatefulMenu.d.ts +5 -2
- package/esm/menu/useStatefulMenu.js +14 -8
- package/esm/modal/adapter.d.ts +1 -1
- package/esm/modal/index.d.ts +1 -1
- package/esm/modal/index.js +1 -1
- package/esm/modal/modal.js +5 -5
- package/esm/modal/overrides.d.ts +2 -3
- package/esm/modal/overrides.js +6 -8
- package/esm/modal/styled-components.d.ts +1 -1
- package/esm/modal/styled-components.js +8 -8
- package/esm/number/Number.d.ts +3 -0
- package/esm/number/Number.js +10 -0
- package/esm/number/constants.d.ts +2 -0
- package/esm/number/constants.js +4 -0
- package/esm/number/index.d.ts +5 -0
- package/esm/number/index.js +5 -0
- package/esm/number/types.d.ts +6 -0
- package/esm/number/types.js +1 -0
- package/esm/number/useNumber.d.ts +2 -0
- package/esm/number/useNumber.js +8 -0
- package/esm/overrides/index.d.ts +1 -1
- package/esm/overrides/index.js +1 -1
- package/esm/overrides/mergeOverrides.d.ts +3 -2
- package/esm/overrides/mergeOverrides.js +5 -4
- package/esm/payment-card/basewebAdapters.d.ts +2 -0
- package/esm/payment-card/basewebAdapters.js +27 -4
- package/esm/payment-card/styled-components.js +25 -6
- package/esm/payment-card/types.d.ts +4 -2
- package/esm/phone-input/country-select-container.js +1 -1
- package/esm/phone-input/country-select.js +4 -6
- package/esm/phone-input/default-props.d.ts +6 -9
- package/esm/phone-input/default-props.js +7 -9
- package/esm/phone-input/flag-container.js +1 -1
- package/esm/phone-input/phone-input.d.ts +0 -6
- package/esm/phone-input/phone-input.js +21 -12
- package/esm/phone-input/stateful-phone-input-container.js +4 -3
- package/esm/phone-input/stateful-phone-input.d.ts +0 -6
- package/esm/phone-input/styled-components.d.ts +9 -1
- package/esm/phone-input/styled-components.js +21 -7
- package/esm/phone-input/types.d.ts +2 -1
- package/esm/phone-input/utils.d.ts +10 -3
- package/esm/phone-input/utils.js +10 -5
- package/esm/popover/adapter.d.ts +4 -3
- package/esm/popover/adapter.js +15 -0
- package/esm/popover/overrides.js +8 -19
- package/esm/popover/popover.d.ts +6 -3
- package/esm/popover/popover.js +13 -6
- package/esm/popover/stateful-popover.js +2 -2
- package/esm/popover/types.d.ts +10 -2
- package/esm/popover/types.js +2 -1
- package/esm/popover/utils.d.ts +12 -0
- package/esm/popover/utils.js +9 -0
- package/esm/progress/circular/styled-component.d.ts +1 -1
- package/esm/progress/circular/styled-component.js +3 -3
- package/esm/progress/linear/styled-component.d.ts +1 -1
- package/esm/progress/linear/styled-component.js +5 -5
- package/esm/radio/basewebAdapters.d.ts +8 -11
- package/esm/radio/basewebAdapters.js +6 -3
- package/esm/radio/radio.js +6 -5
- package/esm/radio/styled-components.js +9 -11
- package/esm/radio/types.d.ts +13 -6
- package/esm/search/index.d.ts +1 -0
- package/esm/search/index.js +1 -0
- package/esm/search/search.d.ts +1 -1
- package/esm/search/search.js +15 -6
- package/esm/search/stateful-search.d.ts +3 -0
- package/esm/search/stateful-search.js +15 -0
- package/esm/search/styled-components.d.ts +1 -10
- package/esm/search/styled-components.js +54 -24
- package/esm/search/types.d.ts +8 -2
- package/esm/select/adaptor.d.ts +1 -1
- package/esm/select/base-select.d.ts +36 -16
- package/esm/select/base-select.js +185 -88
- package/esm/select/constants.d.ts +3 -0
- package/esm/select/constants.js +3 -1
- package/esm/select/default-props.d.ts +9 -5
- package/esm/select/default-props.js +4 -1
- package/esm/select/index.d.ts +4 -4
- package/esm/select/index.js +3 -3
- package/esm/select/locale.d.ts +4 -0
- package/esm/select/mobileSelect/MobileSelect.js +3 -5
- package/esm/select/mobileSelect/MobileSheet.js +3 -1
- package/esm/select/multi-value.js +22 -12
- package/esm/select/overlaySelect/OverlaySelect.js +10 -18
- package/esm/select/overlaySelect/hooks/useControlRef.d.ts +9 -0
- package/esm/select/overlaySelect/hooks/useControlRef.js +33 -0
- package/esm/select/overlaySelect/hooks/useOverlaySelectOverrides.d.ts +24 -0
- package/esm/select/overlaySelect/{useOverlaySelectOverrides.js → hooks/useOverlaySelectOverrides.js} +31 -28
- package/esm/select/overlaySelect/{usePopover.d.ts → hooks/usePopover.d.ts} +1 -1
- package/esm/select/overlaySelect/{usePopover.js → hooks/usePopover.js} +2 -2
- package/esm/select/overrides.d.ts +3 -1
- package/esm/select/overrides.js +19 -13
- package/esm/select/select-variants.js +2 -2
- package/esm/select/select.d.ts +9 -5
- package/esm/select/select.js +9 -3
- package/esm/select/selectMenuAdapter/CollapsibleSelectMenu.d.ts +118 -0
- package/esm/select/selectMenuAdapter/CollapsibleSelectMenu.js +70 -0
- package/esm/select/selectMenuAdapter/SelectMenuAdapter.d.ts +2 -32
- package/esm/select/selectMenuAdapter/SelectMenuAdapter.js +11 -5
- package/esm/select/selectMenuAdapter/SelectMenuItem.d.ts +8 -2
- package/esm/select/selectMenuAdapter/SelectMenuItem.js +2 -4
- package/esm/select/selectMenuAdapter/hooks/useGetExpandedGroup.d.ts +6 -0
- package/esm/select/selectMenuAdapter/hooks/useGetExpandedGroup.js +16 -0
- package/esm/select/selectMenuAdapter/types.d.ts +42 -0
- package/esm/select/selectMenuAdapter/types.js +1 -0
- package/esm/select/stateful-select.d.ts +9 -5
- package/esm/select/stateful-select.js +3 -3
- package/esm/select/styled-component.d.ts +15 -4
- package/esm/select/styled-component.js +60 -10
- package/esm/select/types.d.ts +36 -9
- package/esm/select/types.js +1 -0
- package/esm/select/utils/default-filter-options.d.ts +2 -1
- package/esm/select/utils/default-filter-options.js +5 -1
- package/esm/select/utils/hidden-element.d.ts +6 -0
- package/esm/select/utils/hidden-element.js +16 -0
- package/esm/select/utils/merge-options.d.ts +2 -0
- package/esm/select/utils/merge-options.js +18 -0
- package/esm/select/utils/test-utils.d.ts +1 -0
- package/esm/select/utils/test-utils.js +7 -0
- package/esm/slider/mark.d.ts +3 -3
- package/esm/slider/slider.js +2 -1
- package/esm/slider/stateful-slider.js +1 -1
- package/esm/slider/styled-components.js +4 -4
- package/esm/slider/types.d.ts +9 -2
- package/esm/snackbar/Snackbar.js +12 -12
- package/esm/snackbar/styled-component.js +9 -6
- package/esm/spacewebProvider/CustomBaseProvider.js +1 -0
- package/esm/spacewebProvider/SpacewebProvider.d.ts +3 -1
- package/esm/spacewebProvider/SpacewebProvider.js +9 -9
- package/esm/stack/stack.js +6 -13
- package/esm/style/_buildUtils.d.ts +1 -1
- package/esm/style/_buildUtils.js +3 -1
- package/esm/style/_parseStyle.js +12 -7
- package/esm/style/useMemoizedStyletron.d.ts +1 -1
- package/esm/style/useMemoizedStyletron.js +6 -1
- package/esm/styleEngine/styleEngine.d.ts +1 -2
- package/esm/switch/__test__/switch.spec.js +13 -0
- package/esm/switch/styled-components.js +14 -21
- package/esm/switch/switch.js +5 -2
- package/esm/switch/types.d.ts +8 -11
- package/esm/tag/avatar-tag.js +23 -16
- package/esm/tag/styled-components.js +32 -27
- package/esm/tag/tag.js +20 -12
- package/esm/tag/types.d.ts +2 -2
- package/esm/tag/utils.d.ts +50 -0
- package/esm/tag/utils.js +64 -0
- package/esm/textarea/basewebAdapters.js +4 -4
- package/esm/textarea/styled-components.d.ts +1 -1
- package/esm/textarea/textarea.js +4 -8
- package/esm/textarea/types.d.ts +7 -5
- package/esm/theme/Provider.d.ts +10 -0
- package/esm/theme/Provider.js +61 -0
- package/esm/theme/context.d.ts +1 -10
- package/esm/theme/context.js +1 -61
- package/esm/theme/index.d.ts +1 -0
- package/esm/theme/index.js +1 -0
- package/esm/themes/index.js +1 -1
- package/esm/themes/responsive-theme.d.ts +2 -2
- package/esm/time-picker/TimePicker.d.ts +1 -6
- package/esm/time-picker/TimePicker.js +4 -4
- package/esm/time-picker/types.d.ts +3 -1
- package/esm/time-range-picker/RangeSelector.js +6 -5
- package/esm/time-range-picker/RangeSelectorContainer.js +27 -27
- package/esm/time-range-picker/TimeRangeList.js +8 -1
- package/esm/time-range-picker/TimeRangePicker.js +26 -17
- package/esm/time-range-picker/index.d.ts +1 -1
- package/esm/time-range-picker/index.js +1 -1
- package/esm/time-range-picker/locale.d.ts +3 -0
- package/esm/time-range-picker/types.d.ts +17 -3
- package/esm/time-range-picker/utils.d.ts +47 -18
- package/esm/time-range-picker/utils.js +94 -16
- package/esm/time-zone-picker/TimezonePicker.d.ts +1 -6
- package/esm/time-zone-picker/TimezonePicker.js +5 -7
- package/esm/time-zone-picker/types.d.ts +2 -0
- package/esm/tooltip/disabled-tooltip-container.d.ts +26 -1
- package/esm/tooltip/overrides.js +1 -2
- package/esm/tooltip/stateful-tooltip-container.d.ts +26 -1
- package/esm/tooltip/stateful-tooltip.d.ts +27 -1
- package/esm/tooltip/stateful-tooltip.js +2 -2
- package/esm/tooltip/tooltip.d.ts +1 -1
- package/esm/tooltip/tooltip.js +7 -4
- package/esm/tooltip/types.d.ts +12 -2
- package/esm/types.d.ts +5 -3
- package/esm/typography/Typography.js +14 -1
- package/esm/typography/constants.d.ts +56 -0
- package/esm/typography/constants.js +56 -0
- package/esm/typography/index.d.ts +1 -0
- package/esm/typography/index.js +1 -0
- package/esm/typography/styled-components.js +12 -4
- package/esm/typography/types.d.ts +1 -1
- package/esm/utils/intlNumberFormatUtils/index.d.ts +7 -0
- package/esm/utils/intlNumberFormatUtils/index.js +36 -0
- package/esm/utils/intlNumberFormatUtils/types.d.ts +21 -0
- package/esm/utils/intlNumberFormatUtils/types.js +6 -0
- package/esm/video/Video.js +4 -2
- package/esm/video/types.d.ts +2 -0
- package/form-control/context.d.ts +6 -13
- package/form-control/context.js +11 -10
- package/form-control/form-control.d.ts +1 -1
- package/form-control/form-control.js +16 -11
- package/form-control/styled-component.js +18 -7
- package/helpers/ClearIconButton.js +3 -1
- package/helpers/StyledTombstone.d.ts +1 -0
- package/helpers/StyledTombstone.js +21 -0
- package/helpers/baseui/useConvertOverrides.js +6 -1
- package/helpers/baseui/withThemeOverride.js +1 -1
- package/helpers/commonStyles.d.ts +2 -2
- package/helpers/commonStyles.js +3 -6
- package/helpers/index.d.ts +1 -0
- package/helpers/index.js +10 -1
- package/helpers/styletron.d.ts +14 -3
- package/helpers/themeHelpers.d.ts +1 -0
- package/helpers/themeHelpers.js +15 -1
- package/hooks/useAutoFocus.d.ts +6 -7
- package/hooks/useAutoFocus.js +19 -14
- package/hooks/useCombinedRef.d.ts +1 -0
- package/hooks/useCombinedRef.js +35 -1
- package/hooks/useIsMobileDevice.d.ts +1 -0
- package/hooks/useIsMobileDevice.js +11 -0
- package/hooks/useMatchMedia.d.ts +3 -0
- package/hooks/useMatchMedia.js +52 -0
- package/icon/components/alert-solid.js +2 -0
- package/icon/components/alert.js +2 -0
- package/icon/components/calendar-solid.js +2 -0
- package/icon/components/chevron-down.js +2 -0
- package/icon/components/chevron-left.d.ts +3 -0
- package/icon/components/chevron-left.js +11 -0
- package/icon/components/chevron-right.d.ts +3 -0
- package/icon/components/chevron-right.js +11 -0
- package/icon/components/close.js +2 -0
- package/icon/components/error-clr.js +2 -0
- package/icon/components/error-solid.js +2 -0
- package/icon/components/error.js +2 -0
- package/icon/components/imagePreview.js +2 -0
- package/icon/components/info.js +2 -0
- package/icon/components/play-video.js +2 -0
- package/icon/components/reset-color.d.ts +3 -0
- package/icon/components/reset-color.js +11 -0
- package/icon/components/search.js +2 -0
- package/icon/components/tick.js +2 -0
- package/icon/components/tickCircle-solid.js +2 -0
- package/icon/components/user.js +2 -0
- package/icon/components/video-non-playable.js +2 -0
- package/index.d.ts +2 -0
- package/index.js +3 -0
- package/input/basewebAdapters.d.ts +1 -1
- package/input/basewebAdapters.js +18 -3
- package/input/index.d.ts +2 -1
- package/input/index.js +3 -1
- package/input/styled-components.d.ts +1 -1
- package/input/styled-components.js +7 -5
- package/input/types.d.ts +10 -4
- package/layer/useLayersContextValue.js +2 -1
- package/list/avatar-list-item.d.ts +12 -22
- package/list/avatar-list-item.js +6 -8
- package/list/divider.js +6 -3
- package/list/index.d.ts +1 -1
- package/list/index.js +2 -1
- package/list/list-item.d.ts +3 -1
- package/list/list-item.js +9 -6
- package/list/list.d.ts +10 -5
- package/list/list.js +47 -6
- package/list/styled-component.d.ts +1 -0
- package/list/styled-component.js +24 -18
- package/list/types.d.ts +8 -0
- package/list/utils.d.ts +2 -0
- package/list/utils.js +14 -0
- package/locale/en_US.js +35 -0
- package/locale/types.d.ts +21 -0
- package/menu/MenuContext.d.ts +2 -1
- package/menu/MenuContext.js +1 -0
- package/menu/menu-item.d.ts +8 -2
- package/menu/menu-item.js +11 -11
- package/menu/menu.d.ts +6 -0
- package/menu/menu.js +11 -11
- package/menu/types.d.ts +1 -0
- package/menu/useKeyboardNavigation.d.ts +6 -3
- package/menu/useKeyboardNavigation.js +21 -14
- package/menu/useStatefulMenu.d.ts +5 -2
- package/menu/useStatefulMenu.js +14 -8
- package/modal/adapter.d.ts +1 -1
- package/modal/index.d.ts +1 -1
- package/modal/index.js +1 -2
- package/modal/modal.js +4 -4
- package/modal/overrides.d.ts +2 -3
- package/modal/overrides.js +7 -9
- package/modal/styled-components.d.ts +1 -1
- package/modal/styled-components.js +8 -9
- package/number/Number.d.ts +3 -0
- package/number/Number.js +14 -0
- package/number/constants.d.ts +2 -0
- package/number/constants.js +7 -0
- package/number/index.d.ts +5 -0
- package/number/index.js +12 -0
- package/number/package.json +4 -0
- package/number/types.d.ts +6 -0
- package/number/types.js +2 -0
- package/number/useNumber.d.ts +2 -0
- package/number/useNumber.js +12 -0
- package/overrides/index.d.ts +1 -1
- package/overrides/index.js +2 -1
- package/overrides/mergeOverrides.d.ts +3 -2
- package/overrides/mergeOverrides.js +6 -4
- package/package.json +18 -12
- package/payment-card/basewebAdapters.d.ts +2 -0
- package/payment-card/basewebAdapters.js +27 -4
- package/payment-card/styled-components.js +24 -5
- package/payment-card/types.d.ts +4 -2
- package/phone-input/country-select-container.js +1 -1
- package/phone-input/country-select.js +4 -6
- package/phone-input/default-props.d.ts +6 -9
- package/phone-input/default-props.js +8 -9
- package/phone-input/flag-container.js +1 -1
- package/phone-input/phone-input.d.ts +0 -6
- package/phone-input/phone-input.js +20 -11
- package/phone-input/stateful-phone-input-container.js +4 -3
- package/phone-input/stateful-phone-input.d.ts +0 -6
- package/phone-input/styled-components.d.ts +9 -1
- package/phone-input/styled-components.js +22 -7
- package/phone-input/types.d.ts +2 -1
- package/phone-input/utils.d.ts +10 -3
- package/phone-input/utils.js +11 -5
- package/popover/adapter.d.ts +4 -3
- package/popover/adapter.js +16 -1
- package/popover/overrides.js +8 -19
- package/popover/popover.d.ts +6 -3
- package/popover/popover.js +12 -5
- package/popover/stateful-popover.js +2 -2
- package/popover/types.d.ts +10 -2
- package/popover/types.js +5 -4
- package/popover/utils.d.ts +12 -0
- package/popover/utils.js +11 -1
- package/progress/circular/styled-component.d.ts +1 -1
- package/progress/circular/styled-component.js +4 -4
- package/progress/linear/styled-component.d.ts +1 -1
- package/progress/linear/styled-component.js +5 -5
- package/radio/basewebAdapters.d.ts +8 -11
- package/radio/basewebAdapters.js +6 -3
- package/radio/radio.js +6 -5
- package/radio/styled-components.js +9 -11
- package/radio/types.d.ts +13 -6
- package/search/index.d.ts +1 -0
- package/search/index.js +3 -1
- package/search/search.d.ts +1 -1
- package/search/search.js +14 -5
- package/search/stateful-search.d.ts +3 -0
- package/search/stateful-search.js +19 -0
- package/search/styled-components.d.ts +1 -10
- package/search/styled-components.js +56 -25
- package/search/types.d.ts +8 -2
- package/select/adaptor.d.ts +1 -1
- package/select/base-select.d.ts +36 -16
- package/select/base-select.js +183 -86
- package/select/constants.d.ts +3 -0
- package/select/constants.js +4 -2
- package/select/default-props.d.ts +9 -5
- package/select/default-props.js +4 -1
- package/select/index.d.ts +4 -4
- package/select/index.js +4 -2
- package/select/locale.d.ts +4 -0
- package/select/mobileSelect/MobileSelect.js +3 -5
- package/select/mobileSelect/MobileSheet.js +3 -1
- package/select/multi-value.js +21 -11
- package/select/overlaySelect/OverlaySelect.js +9 -17
- package/select/overlaySelect/hooks/useControlRef.d.ts +9 -0
- package/select/overlaySelect/hooks/useControlRef.js +37 -0
- package/select/overlaySelect/hooks/useOverlaySelectOverrides.d.ts +24 -0
- package/select/overlaySelect/{useOverlaySelectOverrides.js → hooks/useOverlaySelectOverrides.js} +31 -28
- package/select/overlaySelect/{usePopover.d.ts → hooks/usePopover.d.ts} +1 -1
- package/select/overlaySelect/{usePopover.js → hooks/usePopover.js} +2 -2
- package/select/overrides.d.ts +3 -1
- package/select/overrides.js +20 -14
- package/select/select-variants.js +2 -2
- package/select/select.d.ts +9 -5
- package/select/select.js +9 -3
- package/select/selectMenuAdapter/CollapsibleSelectMenu.d.ts +118 -0
- package/select/selectMenuAdapter/CollapsibleSelectMenu.js +74 -0
- package/select/selectMenuAdapter/SelectMenuAdapter.d.ts +2 -32
- package/select/selectMenuAdapter/SelectMenuAdapter.js +11 -5
- package/select/selectMenuAdapter/SelectMenuItem.d.ts +8 -2
- package/select/selectMenuAdapter/SelectMenuItem.js +2 -4
- package/select/selectMenuAdapter/hooks/useGetExpandedGroup.d.ts +6 -0
- package/select/selectMenuAdapter/hooks/useGetExpandedGroup.js +20 -0
- package/select/selectMenuAdapter/types.d.ts +42 -0
- package/select/selectMenuAdapter/types.js +2 -0
- package/select/stateful-select.d.ts +9 -5
- package/select/stateful-select.js +3 -3
- package/select/styled-component.d.ts +15 -4
- package/select/styled-component.js +58 -11
- package/select/types.d.ts +36 -9
- package/select/types.js +2 -1
- package/select/utils/default-filter-options.d.ts +2 -1
- package/select/utils/default-filter-options.js +6 -5
- package/select/utils/hidden-element.d.ts +6 -0
- package/select/utils/hidden-element.js +19 -0
- package/select/utils/merge-options.d.ts +2 -0
- package/select/utils/merge-options.js +22 -0
- package/select/utils/test-utils.d.ts +1 -0
- package/select/utils/test-utils.js +11 -0
- package/slider/mark.d.ts +3 -3
- package/slider/slider.js +2 -1
- package/slider/stateful-slider.js +1 -1
- package/slider/styled-components.js +4 -4
- package/slider/types.d.ts +9 -2
- package/snackbar/Snackbar.js +12 -12
- package/snackbar/styled-component.js +9 -6
- package/spacewebProvider/CustomBaseProvider.js +1 -0
- package/spacewebProvider/SpacewebProvider.d.ts +3 -1
- package/spacewebProvider/SpacewebProvider.js +8 -8
- package/stack/stack.js +6 -13
- package/style/_buildUtils.d.ts +1 -1
- package/style/_buildUtils.js +3 -1
- package/style/_parseStyle.js +12 -7
- package/style/useMemoizedStyletron.d.ts +1 -1
- package/style/useMemoizedStyletron.js +6 -1
- package/styleEngine/styleEngine.d.ts +1 -2
- package/switch/__test__/switch.spec.js +13 -0
- package/switch/styled-components.js +14 -21
- package/switch/switch.js +5 -2
- package/switch/types.d.ts +8 -11
- package/tag/avatar-tag.js +23 -16
- package/tag/styled-components.js +32 -27
- package/tag/tag.js +19 -11
- package/tag/types.d.ts +2 -2
- package/tag/utils.d.ts +50 -0
- package/tag/utils.js +67 -1
- package/textarea/basewebAdapters.js +3 -3
- package/textarea/styled-components.d.ts +1 -1
- package/textarea/textarea.js +3 -7
- package/textarea/types.d.ts +7 -5
- package/theme/Provider.d.ts +10 -0
- package/theme/Provider.js +65 -0
- package/theme/context.d.ts +1 -10
- package/theme/context.js +1 -61
- package/theme/index.d.ts +1 -0
- package/theme/index.js +1 -0
- package/themes/index.js +1 -1
- package/themes/responsive-theme.d.ts +2 -2
- package/time-picker/TimePicker.d.ts +1 -6
- package/time-picker/TimePicker.js +4 -4
- package/time-picker/types.d.ts +3 -1
- package/time-range-picker/RangeSelector.js +5 -4
- package/time-range-picker/RangeSelectorContainer.js +26 -26
- package/time-range-picker/TimeRangeList.js +8 -1
- package/time-range-picker/TimeRangePicker.js +25 -16
- package/time-range-picker/index.d.ts +1 -1
- package/time-range-picker/index.js +4 -1
- package/time-range-picker/locale.d.ts +3 -0
- package/time-range-picker/types.d.ts +17 -3
- package/time-range-picker/utils.d.ts +47 -18
- package/time-range-picker/utils.js +98 -17
- package/time-zone-picker/TimezonePicker.d.ts +1 -6
- package/time-zone-picker/TimezonePicker.js +5 -7
- package/time-zone-picker/types.d.ts +2 -0
- package/tooltip/disabled-tooltip-container.d.ts +26 -1
- package/tooltip/overrides.js +1 -2
- package/tooltip/stateful-tooltip-container.d.ts +26 -1
- package/tooltip/stateful-tooltip.d.ts +27 -1
- package/tooltip/stateful-tooltip.js +2 -2
- package/tooltip/tooltip.d.ts +1 -1
- package/tooltip/tooltip.js +7 -4
- package/tooltip/types.d.ts +12 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/types.d.ts +5 -3
- package/typography/Typography.js +14 -1
- package/typography/constants.d.ts +56 -0
- package/typography/constants.js +57 -1
- package/typography/index.d.ts +1 -0
- package/typography/index.js +3 -1
- package/typography/styled-components.js +11 -3
- package/typography/types.d.ts +1 -1
- package/utils/intlNumberFormatUtils/index.d.ts +7 -0
- package/utils/intlNumberFormatUtils/index.js +40 -0
- package/utils/intlNumberFormatUtils/types.d.ts +21 -0
- package/utils/intlNumberFormatUtils/types.js +9 -0
- package/utils/package.json +4 -0
- package/video/Video.js +4 -2
- package/video/types.d.ts +2 -0
- package/esm/icon/components/chevron-right-solid.d.ts +0 -3
- package/esm/icon/components/chevron-right-solid.js +0 -6
- package/esm/phone-input/virtualized-country-select-dropdown.d.ts +0 -31
- package/esm/phone-input/virtualized-country-select-dropdown.js +0 -33
- package/esm/select/overlaySelect/useOverlaySelectOverrides.d.ts +0 -14
- package/esm/style/_escapeClassName.d.ts +0 -6
- package/esm/style/_escapeClassName.js +0 -6
- package/icon/components/chevron-right-solid.d.ts +0 -3
- package/icon/components/chevron-right-solid.js +0 -9
- package/phone-input/virtualized-country-select-dropdown.d.ts +0 -31
- package/phone-input/virtualized-country-select-dropdown.js +0 -35
- package/select/overlaySelect/useOverlaySelectOverrides.d.ts +0 -14
- package/style/_escapeClassName.d.ts +0 -6
- package/style/_escapeClassName.js +0 -9
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { __assign, __read, __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef, memo, useState } from 'react';
|
|
4
|
+
import { useOverrides } from '../overrides';
|
|
5
|
+
import { StyledBanner, StyledBannerItemContainer, StyledHeaderContainer, StyledTitle, StyledTitleContainer, } from './styled-component';
|
|
6
|
+
import ErrorIcon from '../icon/components/error-clr';
|
|
7
|
+
import AlertIcon from '../icon/components/alert-solid';
|
|
8
|
+
import TickCircleIcon from '../icon/components/tickCircle-solid';
|
|
9
|
+
import { useStyle } from '../style';
|
|
10
|
+
import { StyledButtonLink } from '../link/styled-components';
|
|
11
|
+
import { useLocale } from '../locale';
|
|
12
|
+
import useStickyElement from '../hooks/useStickyElement';
|
|
13
|
+
function Icon(_a) {
|
|
14
|
+
var className = _a.className, _b = _a.intent, intent = _b === void 0 ? 'error' : _b, restProps = __rest(_a, ["className", "intent"]);
|
|
15
|
+
var theme = useStyle().theme;
|
|
16
|
+
var intentToIconMap = {
|
|
17
|
+
error: {
|
|
18
|
+
BaseIcon: ErrorIcon,
|
|
19
|
+
prop: [{ fill: theme.spr.supportError }],
|
|
20
|
+
},
|
|
21
|
+
warning: {
|
|
22
|
+
BaseIcon: AlertIcon,
|
|
23
|
+
prop: [{ fill: theme.spr.supportWarning }],
|
|
24
|
+
},
|
|
25
|
+
success: {
|
|
26
|
+
BaseIcon: TickCircleIcon,
|
|
27
|
+
prop: [{ fill: theme.spr.supportSuccess }],
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
var _c = intentToIconMap[intent], BaseIcon = _c.BaseIcon, prop = _c.prop;
|
|
31
|
+
return _jsx(BaseIcon, __assign({ className: ['mr-1.5 flex-shrink-0', prop, className] }, restProps, { size: 14 }), void 0);
|
|
32
|
+
}
|
|
33
|
+
function BaseToggleButton(_a) {
|
|
34
|
+
var show = _a.show, className = _a.className, onToggle = _a.onToggle, props = __rest(_a, ["show", "className", "onToggle"]);
|
|
35
|
+
var locale = useLocale();
|
|
36
|
+
var label = show ? locale.banner.toggleButtonHideLabel : locale.banner.toggleButtonShowLabel;
|
|
37
|
+
var ariaLabel = show ? locale.banner.toggleButtonHideAriaLabel : locale.banner.toggleButtonShowAriaLabel;
|
|
38
|
+
return (_jsx(StyledButtonLink, __assign({ "data-testid": "banner-toggle-button", "aria-label": ariaLabel, className: ['typography-l2 pl-2', className], onClick: function () { return onToggle(!show); }, "$show": show }, props, { children: label }), void 0));
|
|
39
|
+
}
|
|
40
|
+
var Banner = forwardRef(function (_a, ref) {
|
|
41
|
+
var _b = _a.intent, intent = _b === void 0 ? 'error' : _b, collapsible = _a.collapsible, title = _a.title, children = _a.children, _c = _a.overrides, overrides = _c === void 0 ? {} : _c, $as = _a.$as, role = _a.role, maxItemContainerHeight = _a.maxItemContainerHeight, restProps = __rest(_a, ["intent", "collapsible", "title", "children", "overrides", "$as", "role", "maxItemContainerHeight"]);
|
|
42
|
+
var _d = __read(useOverrides(overrides.Root, StyledBanner), 2), Root = _d[0], rootProps = _d[1];
|
|
43
|
+
var _e = __read(useOverrides(overrides.BannerItemContainer, StyledBannerItemContainer), 2), BannerItemContainer = _e[0], bannerItemContainerProps = _e[1];
|
|
44
|
+
var _f = __read(useOverrides(overrides.HeaderContainer, StyledHeaderContainer), 2), HeaderContainer = _f[0], headerContainerProps = _f[1];
|
|
45
|
+
var _g = __read(useOverrides(overrides.TitleContainer, StyledTitleContainer), 2), TitleContainer = _g[0], titleContainerProps = _g[1];
|
|
46
|
+
var _h = __read(useOverrides(overrides.HeaderTitle, StyledTitle), 2), HeaderTitle = _h[0], headerTitleProps = _h[1];
|
|
47
|
+
var _j = __read(useOverrides(overrides.HeaderIcon, Icon), 2), HeaderIcon = _j[0], headerIconProps = _j[1];
|
|
48
|
+
var _k = __read(useOverrides(overrides.ToggleButton, BaseToggleButton), 2), ToggleButton = _k[0], toggleButtonProps = _k[1];
|
|
49
|
+
var _l = __read(useState(true), 2), show = _l[0], setShow = _l[1];
|
|
50
|
+
var _m = useStickyElement(), isSticky = _m.isSticky, setStickySentinelRef = _m.setStickySentinelRef;
|
|
51
|
+
return (_jsxs(Root, __assign({ "data-spaceweb": "banner", "data-testid": "banner", intent: intent, collapsible: collapsible }, restProps, rootProps, { ref: ref }, { children: [_jsx("div", { ref: setStickySentinelRef }, void 0), _jsxs(HeaderContainer, __assign({}, headerContainerProps, { "$sticky": isSticky }, { children: [_jsxs(TitleContainer, __assign({}, titleContainerProps, { children: [_jsx(HeaderIcon, __assign({ intent: intent }, headerIconProps), void 0), _jsx(HeaderTitle, __assign({}, headerTitleProps, { children: title }), void 0)] }), void 0), collapsible && _jsx(ToggleButton, __assign({ show: show, onToggle: setShow }, toggleButtonProps), void 0)] }), void 0), show && children && (_jsx(BannerItemContainer, __assign({ "$as": $as, role: $as === 'ol' || $as === 'ul' ? 'list' : role, "$maxHeight": maxItemContainerHeight }, bannerItemContainerProps, { children: children }), void 0))] }), void 0));
|
|
52
|
+
});
|
|
53
|
+
Banner.displayName = 'Banner';
|
|
54
|
+
export default memo(Banner);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as Banner } from './banner';
|
|
2
|
+
export { default as BannerItem } from './banner-item';
|
|
3
|
+
export { StyledBanner, StyledBannerItem, StyledTitle } from './styled-component';
|
|
4
|
+
export type { BannerProps, BannerItemProps } from './types';
|
|
5
|
+
export type { BannerLocale } from './locale';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const StyledBanner: import("../style/styled").StyledComponent;
|
|
2
|
+
export declare const StyledBannerItemContainer: import("../style/styled").StyledComponent;
|
|
3
|
+
export declare const StyledTitleContainer: import("../style/styled").StyledComponent;
|
|
4
|
+
export declare const StyledHeaderContainer: import("../style/styled").StyledComponent;
|
|
5
|
+
export declare const StyledTitle: import("../style/styled").StyledComponent;
|
|
6
|
+
export declare const StyledBannerItem: import("../style/styled").StyledComponent;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import cx from '../classNames';
|
|
2
|
+
import { styled } from '../style';
|
|
3
|
+
var getBannerIntentStyles = function (_a, _b) {
|
|
4
|
+
var theme = _a.theme;
|
|
5
|
+
var intent = _b.intent;
|
|
6
|
+
switch (intent) {
|
|
7
|
+
case 'error':
|
|
8
|
+
default:
|
|
9
|
+
return {
|
|
10
|
+
borderColor: theme.spr.supportError,
|
|
11
|
+
};
|
|
12
|
+
case 'warning':
|
|
13
|
+
return {
|
|
14
|
+
borderColor: theme.spr.supportWarning,
|
|
15
|
+
};
|
|
16
|
+
case 'success':
|
|
17
|
+
return {
|
|
18
|
+
borderColor: theme.spr.supportSuccess,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export var StyledBanner = styled('div', 'box-border w-full rounded-8 border-solid border-1 font-medium overflow-auto pb-2', getBannerIntentStyles);
|
|
23
|
+
export var StyledBannerItemContainer = styled('div', 'box-border list-inside list-none typography-bl1 px-2 mt-0.5', function (_a, _b) {
|
|
24
|
+
var theme = _a.theme, getStyle = _a.getStyle;
|
|
25
|
+
var $as = _b.$as, $maxHeight = _b.$maxHeight;
|
|
26
|
+
return getStyle(cx({ 'list-decimal': $as === 'ol', 'list-disc': $as === 'ul' }), { maxHeight: $maxHeight });
|
|
27
|
+
});
|
|
28
|
+
export var StyledTitleContainer = styled('div', 'flex flex-row justify-center items-center');
|
|
29
|
+
export var StyledHeaderContainer = styled('div', 'flex flex-row justify-between sticky top-0 spr-ui-01 px-2 pt-2', function (_a, _b) {
|
|
30
|
+
var theme = _a.theme;
|
|
31
|
+
var $sticky = _b.$sticky;
|
|
32
|
+
return ({ boxShadow: $sticky ? theme.spr.shadow01 : 'none' });
|
|
33
|
+
});
|
|
34
|
+
export var StyledTitle = styled('div', 'typography-bl1 font-600');
|
|
35
|
+
export var StyledBannerItem = styled('li', 'typography-bl1');
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Override } from '../overrides/types';
|
|
2
|
+
import { SpacewebComponentProps } from '../types';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
export declare type BannerProps = Omit<SpacewebComponentProps, 'title'> & {
|
|
5
|
+
intent?: 'error' | 'warning' | 'success';
|
|
6
|
+
$as?: string;
|
|
7
|
+
collapsible?: boolean;
|
|
8
|
+
title: ReactNode;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
maxItemContainerHeight?: string;
|
|
11
|
+
overrides?: {
|
|
12
|
+
Root?: Override<Record<string, any>>;
|
|
13
|
+
BannerItemContainer?: Override<Record<string, any>>;
|
|
14
|
+
HeaderTitle?: Override<Record<string, any>>;
|
|
15
|
+
HeaderIcon?: Override<Record<string, any>>;
|
|
16
|
+
HeaderContainer?: Override<Record<string, any>>;
|
|
17
|
+
TitleContainer?: Override<Record<string, any>>;
|
|
18
|
+
ToggleButton?: Override<Record<string, any>>;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare type BannerItemProps = SpacewebComponentProps & {
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
overrides?: {
|
|
24
|
+
Root?: Override<Record<string, any>>;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BreadcrumbItemProps } from './types';
|
|
3
|
+
declare const BreadcrumbItem: {
|
|
4
|
+
({ children, isLastChild, overrides, onClick, index, startEnhancer, endEnhancer, separator, gap, ...restProps }: BreadcrumbItemProps): JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
export default BreadcrumbItem;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { __assign, __read, __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import _noop from 'lodash/noop';
|
|
4
|
+
import { Typography } from '../typography';
|
|
5
|
+
import { Link } from '../link';
|
|
6
|
+
import { StyledStartEnhancer, StyledEndEnhancer, StyledListItem, StyledSeparator, DEFAULT_SEPARATOR, } from './styled-components';
|
|
7
|
+
import { useOverrides, mergeOverrides } from '../overrides';
|
|
8
|
+
var breadcrumbItemOverrides = {
|
|
9
|
+
Link: {
|
|
10
|
+
style: [
|
|
11
|
+
'inline-flex text-16 leading-10',
|
|
12
|
+
function (_, _a) {
|
|
13
|
+
var $isLastChild = _a.$isLastChild;
|
|
14
|
+
return !$isLastChild ? { color: 'inherit', ':focus': { textDecoration: 'underline' } } : {};
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
var BreadcrumbItem = function (_a) {
|
|
20
|
+
var children = _a.children, _b = _a.isLastChild, isLastChild = _b === void 0 ? false : _b, overrides = _a.overrides, _c = _a.onClick, onClick = _c === void 0 ? _noop : _c, _d = _a.index, index = _d === void 0 ? 0 : _d, startEnhancer = _a.startEnhancer, endEnhancer = _a.endEnhancer, _e = _a.separator, separator = _e === void 0 ? DEFAULT_SEPARATOR : _e, _f = _a.gap, gap = _f === void 0 ? 4 : _f, restProps = __rest(_a, ["children", "isLastChild", "overrides", "onClick", "index", "startEnhancer", "endEnhancer", "separator", "gap"]);
|
|
21
|
+
var sharedProps = {
|
|
22
|
+
$gap: gap,
|
|
23
|
+
$withStartEnhancer: !!startEnhancer,
|
|
24
|
+
$withEndEnhancer: !!endEnhancer,
|
|
25
|
+
$isLastChild: isLastChild,
|
|
26
|
+
};
|
|
27
|
+
var mergedOverrides = mergeOverrides(breadcrumbItemOverrides, overrides);
|
|
28
|
+
var _g = __read(useOverrides(mergedOverrides === null || mergedOverrides === void 0 ? void 0 : mergedOverrides.ListItem, StyledListItem), 2), ListItem = _g[0], listItemProps = _g[1];
|
|
29
|
+
var _h = __read(useOverrides(mergedOverrides === null || mergedOverrides === void 0 ? void 0 : mergedOverrides.Link, !isLastChild ? Link : Typography), 2), LinkOverride = _h[0], linkOverrideProps = _h[1];
|
|
30
|
+
var _j = __read(useOverrides(mergedOverrides === null || mergedOverrides === void 0 ? void 0 : mergedOverrides.StartEnhancer, StyledStartEnhancer), 2), StartEnhancer = _j[0], startEnhancerProps = _j[1];
|
|
31
|
+
var _k = __read(useOverrides(mergedOverrides === null || mergedOverrides === void 0 ? void 0 : mergedOverrides.EndEnhancer, StyledEndEnhancer), 2), EndEnhancer = _k[0], endEnhancerProps = _k[1];
|
|
32
|
+
var _l = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.Separator, StyledSeparator), 2), BreadcrumbSeparator = _l[0], separatorWrapperProps = _l[1];
|
|
33
|
+
var renderEnhancer = function (enhancer) {
|
|
34
|
+
return typeof enhancer === 'function' ? enhancer(sharedProps) : enhancer;
|
|
35
|
+
};
|
|
36
|
+
return (_jsxs(ListItem, __assign({ "data-testid": "breadcrumb-list-item-".concat(index) }, sharedProps, listItemProps, { children: [_jsxs(LinkOverride, __assign({ "data-testid": "breadcrumb-item-link-".concat(index), onClick: function (e) { return onClick(e, index); } }, sharedProps, restProps, linkOverrideProps, { children: [startEnhancer && (_jsx(StartEnhancer, __assign({ "data-testid": "breadcrumb-item-startenhancer-".concat(index) }, sharedProps, startEnhancerProps, { children: renderEnhancer(startEnhancer) }), void 0)), children, endEnhancer && (_jsx(EndEnhancer, __assign({ "data-testid": "breadcrumb-item-endenhancer-".concat(index) }, sharedProps, endEnhancerProps, { children: renderEnhancer(endEnhancer) }), void 0))] }), void 0), !isLastChild && (_jsx(BreadcrumbSeparator, __assign({ "data-testid": "breadcrumb-item-separator-".concat(index), "aria-hidden": true }, sharedProps, separatorWrapperProps, { children: separator }), void 0))] }), void 0));
|
|
37
|
+
};
|
|
38
|
+
BreadcrumbItem.displayName = 'BreadcrumbItem';
|
|
39
|
+
export default BreadcrumbItem;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { __assign, __read } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createElement as _createElement } from "react";
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import BreadcrumbItem from './breadcrumb-item';
|
|
6
|
+
import { useOverrides } from '../overrides';
|
|
7
|
+
import { DEFAULT_SEPARATOR, StyledWrapper } from './styled-components';
|
|
8
|
+
var Breadcrumb = function (_a) {
|
|
9
|
+
var children = _a.children, _b = _a.separator, separator = _b === void 0 ? DEFAULT_SEPARATOR : _b, _c = _a.gap, gap = _c === void 0 ? 4 : _c, _d = _a.overrides, overrides = _d === void 0 ? {} : _d;
|
|
10
|
+
var _e = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.Root, StyledWrapper), 2), Root = _e[0], rootProps = _e[1];
|
|
11
|
+
var sharedProps = { $gap: gap };
|
|
12
|
+
var validChildren = React.Children.toArray(children).filter(React.isValidElement);
|
|
13
|
+
var breadcrumbItems = validChildren.map(function (child, index) {
|
|
14
|
+
var _a, _b, _c;
|
|
15
|
+
return child.type === BreadcrumbItem ? (React.cloneElement(child, {
|
|
16
|
+
key: (_a = child.key) !== null && _a !== void 0 ? _a : "breadcrumbItem-".concat(index),
|
|
17
|
+
separator: (_b = child.props.separator) !== null && _b !== void 0 ? _b : separator,
|
|
18
|
+
gap: (_c = child.props.gap) !== null && _c !== void 0 ? _c : gap,
|
|
19
|
+
})) : (_createElement(BreadcrumbItem, __assign({}, sharedProps, { key: "breadcrumbItem-".concat(index), separator: separator, gap: gap }), child));
|
|
20
|
+
});
|
|
21
|
+
return (_jsx("nav", { children: _jsx(Root, __assign({ "data-testid": "breadcrumb-root" }, sharedProps, rootProps, { children: React.Children.map(breadcrumbItems, function (breadcrumbItem, index) {
|
|
22
|
+
var isLastChild = index === breadcrumbItems.length - 1;
|
|
23
|
+
return React.cloneElement(breadcrumbItem, { isLastChild: isLastChild, index: index });
|
|
24
|
+
}) }), void 0) }, void 0));
|
|
25
|
+
};
|
|
26
|
+
Breadcrumb.displayName = 'Breadcrumb';
|
|
27
|
+
export default Breadcrumb;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as Breadcrumb } from './breadcrumb';
|
|
2
|
+
export { default as BreadcrumbItem } from './breadcrumb-item';
|
|
3
|
+
export { StyledSeparator, StyledEndEnhancer, StyledListItem, StyledWrapper, StyledStartEnhancer, DEFAULT_SEPARATOR, } from './styled-components';
|
|
4
|
+
export type { BreadcrumbItemProps, BreadcrumbProps, BreadcrumbSharedProps, BreadcrumbItemSharedProps } from './types';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledStartEnhancer: import("../style/styled").StyledComponent;
|
|
3
|
+
export declare const StyledEndEnhancer: import("../style/styled").StyledComponent;
|
|
4
|
+
export declare const StyledWrapper: import("../style/styled").StyledComponent;
|
|
5
|
+
export declare const StyledSeparator: import("../style/styled").StyledComponent;
|
|
6
|
+
export declare const StyledListItem: import("../style/styled").StyledComponent;
|
|
7
|
+
export declare const DEFAULT_SEPARATOR: JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { styled } from '../style';
|
|
3
|
+
import ChevronRightIcon from '../icon/components/chevron-right';
|
|
4
|
+
export var StyledStartEnhancer = styled('div', 'inline-flex items-center mr-1');
|
|
5
|
+
export var StyledEndEnhancer = styled('div', 'inline-flex items-center ml-1');
|
|
6
|
+
export var StyledWrapper = styled('ul', 'm-0 p-0 inline-flex items-center flex-wrap');
|
|
7
|
+
export var StyledSeparator = styled('span', 'inline-flex items-center', function (_, _a) {
|
|
8
|
+
var $gap = _a.$gap;
|
|
9
|
+
return {
|
|
10
|
+
marginLeft: "".concat($gap * 4, "px"),
|
|
11
|
+
marginRight: "".concat($gap * 4, "px"),
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
export var StyledListItem = styled('li', 'm-0 inline-flex items-center');
|
|
15
|
+
export var DEFAULT_SEPARATOR = _jsx(ChevronRightIcon, { size: 10 }, void 0);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { Override } from '../overrides';
|
|
3
|
+
import { LinkProps } from '../link';
|
|
4
|
+
export declare type Enhancer<SharedProps> = ReactNode | ((props: SharedProps) => ReactNode);
|
|
5
|
+
export declare type BreadcrumbItemSharedProps = {
|
|
6
|
+
$isLastChild?: boolean;
|
|
7
|
+
$withStartEnhancer: boolean;
|
|
8
|
+
$withEndEnhancer: boolean;
|
|
9
|
+
$gap: number;
|
|
10
|
+
};
|
|
11
|
+
export declare type BreadcrumbSharedProps = {
|
|
12
|
+
$gap: number;
|
|
13
|
+
};
|
|
14
|
+
export declare type BreadcrumbProps = {
|
|
15
|
+
separator?: ReactNode;
|
|
16
|
+
gap?: number;
|
|
17
|
+
overrides?: {
|
|
18
|
+
Root?: Override<Record<string, any>>;
|
|
19
|
+
};
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
};
|
|
22
|
+
export declare type BreadcrumbItemProps = Omit<LinkProps, 'onClick'> & {
|
|
23
|
+
isLastChild?: boolean;
|
|
24
|
+
gap?: number;
|
|
25
|
+
onClick?: (event: React.MouseEvent<HTMLElement>, index: number) => void;
|
|
26
|
+
index?: number;
|
|
27
|
+
separator?: ReactNode;
|
|
28
|
+
startEnhancer?: Enhancer<BreadcrumbItemSharedProps>;
|
|
29
|
+
endEnhancer?: Enhancer<BreadcrumbItemSharedProps>;
|
|
30
|
+
overrides?: {
|
|
31
|
+
Link?: Override<Record<string, any>>;
|
|
32
|
+
StartEnhancer?: Override<Record<string, any>>;
|
|
33
|
+
EndEnhancer?: Override<Record<string, any>>;
|
|
34
|
+
ListItem?: Override<Record<string, any>>;
|
|
35
|
+
Separator?: Override<Record<string, any>>;
|
|
36
|
+
};
|
|
37
|
+
children: ReactNode;
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/button/Button.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ declare const Button: React.ForwardRefExoticComponent<Omit<{
|
|
|
12
12
|
disabled?: boolean | undefined;
|
|
13
13
|
fullWidth?: boolean | undefined;
|
|
14
14
|
autoFocus?: boolean | undefined;
|
|
15
|
+
role?: React.AriaRole | undefined;
|
|
15
16
|
href?: string | undefined;
|
|
16
17
|
target?: string | undefined;
|
|
17
18
|
rel?: string | undefined;
|
|
@@ -21,9 +22,8 @@ declare const Button: React.ForwardRefExoticComponent<Omit<{
|
|
|
21
22
|
overrides?: import("./types").ButtonOverrides | undefined;
|
|
22
23
|
startEnhancer?: React.ReactNode;
|
|
23
24
|
type?: "button" | "reset" | "submit" | undefined;
|
|
24
|
-
tooltipContent?: React.ReactNode | (
|
|
25
|
-
|
|
26
|
-
}) => React.ReactNode);
|
|
25
|
+
tooltipContent?: React.ReactNode | import("baseui/popover").StatefulContentRenderProp;
|
|
26
|
+
tabIndex?: number | undefined;
|
|
27
27
|
}, "style" | "className"> & {
|
|
28
28
|
$as?: React.ElementType<any> | undefined;
|
|
29
29
|
className?: import("..").Styles;
|
package/esm/button/Button.js
CHANGED
|
@@ -12,10 +12,14 @@ import { add$props } from '../helpers';
|
|
|
12
12
|
import { StyledBaseButton as BaseButton } from '../base-button';
|
|
13
13
|
import { StatefulTooltip as DefaultStatefulTooltip, DisabledTooltipContainer } from '../tooltip';
|
|
14
14
|
import { useContextualFormProps } from '../form-control/context';
|
|
15
|
+
import useStyle from '../style/useStyle';
|
|
16
|
+
import { getDefaultSize } from '../helpers/themeHelpers';
|
|
15
17
|
BaseUIButton.displayName = 'BaseUIButton';
|
|
16
18
|
var Button = React.forwardRef(function (props, ref) {
|
|
17
19
|
var buttonRef = ref;
|
|
18
|
-
var _a = useContextualFormProps(props), _b = _a.variant, variant = _b === void 0 ? 'primary' : _b, _c = _a.intent, intent = _c === void 0 ? 'default' : _c,
|
|
20
|
+
var _a = useContextualFormProps(props), _b = _a.variant, variant = _b === void 0 ? 'primary' : _b, _c = _a.intent, intent = _c === void 0 ? 'default' : _c, _size = _a.size, fullWidth = _a.fullWidth, className = _a.className, style = _a.style, overrides = _a.overrides, tooltipContent = _a.tooltipContent, restProps = __rest(_a, ["variant", "intent", "size", "fullWidth", "className", "style", "overrides", "tooltipContent"]);
|
|
21
|
+
var _d = useStyle(), getStyle = _d.getStyle, isRTL = _d.isRTL, theme = _d.theme;
|
|
22
|
+
var size = _size !== null && _size !== void 0 ? _size : getDefaultSize(theme);
|
|
19
23
|
var buttonOverrides = React.useMemo(function () { return _omit(overrides, 'StatefulTooltip'); }, [overrides]);
|
|
20
24
|
var adaptedProps = adaptBaseButtonProps(__assign(__assign({}, restProps), { variant: variant, overrides: buttonOverrides }));
|
|
21
25
|
var convertedOverrides = useConvertOverrides(adaptedProps.overrides || {});
|
|
@@ -36,9 +40,17 @@ var Button = React.forwardRef(function (props, ref) {
|
|
|
36
40
|
width: '100%',
|
|
37
41
|
},
|
|
38
42
|
},
|
|
43
|
+
StartEnhancer: {
|
|
44
|
+
// This check should not be required. Overrides should first be merged and then converted for baseui.
|
|
45
|
+
// In Button we are converting overrides(that's when rtlCssJs gets applied) and then merging, which is wrong.
|
|
46
|
+
style: getStyle(isRTL ? 'ml-1' : 'mr-1'),
|
|
47
|
+
},
|
|
48
|
+
EndEnhancer: {
|
|
49
|
+
style: getStyle(isRTL ? 'mr-1' : 'ml-1'),
|
|
50
|
+
},
|
|
39
51
|
}, _pick(adaptedProps.overrides, 'BaseButton'));
|
|
40
52
|
var _e = __read(useOverrides(overrides === null || overrides === void 0 ? void 0 : overrides.StatefulTooltip, DefaultStatefulTooltip), 2), StatefulTooltip = _e[0], statefulTooltipProps = _e[1];
|
|
41
|
-
var buttonEl = (_jsx(BaseUIButton, __assign({ "data-spaceweb": "button", "data-testid": "button" }, adaptedProps, { overrides: __assign(__assign({}, convertedOverrides), mergedOverrides), ref: buttonRef }), void 0));
|
|
53
|
+
var buttonEl = (_jsx(BaseUIButton, __assign({ "data-spaceweb": "button", "data-testid": "button" }, adaptedProps, { onClick: adaptedProps.onClick, overrides: __assign(__assign({}, convertedOverrides), mergedOverrides), ref: buttonRef }), void 0));
|
|
42
54
|
if (adaptedProps.disabled && tooltipContent) {
|
|
43
55
|
return (_jsx(DisabledTooltipContainer, __assign({ placement: "bottom", content: tooltipContent }, statefulTooltipProps, { children: buttonEl }), void 0));
|
|
44
56
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
bordered?: boolean | undefined;
|
|
5
|
-
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
2
|
+
import { IconButtonProps } from './types';
|
|
3
|
+
declare const IconButton: import("react").ForwardRefExoticComponent<IconButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
4
|
export default IconButton;
|
|
@@ -5,16 +5,19 @@ import { mergeOverrides } from '../../overrides';
|
|
|
5
5
|
import { useStyle } from '../../style';
|
|
6
6
|
import Button from '../Button';
|
|
7
7
|
import { iconButtonStyles, renderIconButtonChild } from './styled-components';
|
|
8
|
+
import { getDefaultSize } from '../../helpers/themeHelpers';
|
|
8
9
|
var IconButton = forwardRef(function (props, ref) {
|
|
9
10
|
var theme = useStyle().theme;
|
|
10
|
-
var bordered = props.bordered,
|
|
11
|
+
var bordered = props.bordered, _size = props.size, className = props.className, style = props.style, _a = props.variant, variant = _a === void 0 ? 'minimal' : _a, _b = props.shape, shape = _b === void 0 ? 'round' : _b, buttonProps = __rest(props, ["bordered", "size", "className", "style", "variant", "shape"]);
|
|
12
|
+
var size = _size !== null && _size !== void 0 ? _size : getDefaultSize(theme);
|
|
11
13
|
var overrides = mergeOverrides({
|
|
12
14
|
BaseButton: {
|
|
13
15
|
style: [iconButtonStyles, className, style],
|
|
14
16
|
props: { $bordered: bordered, $size: size, $isIconButton: true },
|
|
15
17
|
},
|
|
16
18
|
}, buttonProps.overrides);
|
|
17
|
-
|
|
19
|
+
var ariaLabel = typeof buttonProps.tooltipContent === 'string' && !buttonProps.isLoading ? buttonProps.tooltipContent : undefined;
|
|
20
|
+
return (_jsx(Button, __assign({ variant: variant, shape: shape }, (ariaLabel ? { 'aria-label': ariaLabel } : {}), buttonProps, { overrides: overrides, ref: ref }, { children: Children.map(props.children, renderIconButtonChild.bind(null, theme, size)) }), void 0));
|
|
18
21
|
});
|
|
19
22
|
IconButton.displayName = 'IconButton';
|
|
20
23
|
export default IconButton;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { ButtonProps, ButtonSharedProps } from '../types';
|
|
2
2
|
import { Size } from '../../types';
|
|
3
|
-
|
|
3
|
+
import { StatefulTooltipProps } from '../../tooltip';
|
|
4
|
+
declare type BaseIconButtonProps = Omit<ButtonProps, 'size'> & {
|
|
4
5
|
size?: Size;
|
|
5
6
|
bordered?: boolean;
|
|
6
7
|
};
|
|
8
|
+
declare type IconButtonPropsWithAriaLabel = BaseIconButtonProps & {
|
|
9
|
+
'aria-label': string;
|
|
10
|
+
};
|
|
11
|
+
declare type IconButtonPropsWithTooltip = BaseIconButtonProps & {
|
|
12
|
+
tooltipContent: StatefulTooltipProps['content'];
|
|
13
|
+
};
|
|
14
|
+
export declare type IconButtonProps = IconButtonPropsWithAriaLabel | IconButtonPropsWithTooltip;
|
|
7
15
|
export declare type SharedProps = Omit<ButtonSharedProps, '$size'> & {
|
|
8
16
|
$size?: Size;
|
|
9
17
|
$bordered?: boolean;
|
|
10
18
|
};
|
|
19
|
+
export {};
|
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { KIND } from 'baseui/button';
|
|
3
2
|
import { ButtonProps } from './types';
|
|
4
3
|
declare const _default: (props: Omit<ButtonProps, 'size'>) => {
|
|
5
|
-
kind: import("../utility-types").ValueOf<
|
|
4
|
+
kind: import("../utility-types").ValueOf<{
|
|
5
|
+
readonly primary: "primary";
|
|
6
|
+
readonly secondary: "secondary";
|
|
7
|
+
readonly tertiary: "tertiary";
|
|
8
|
+
}>;
|
|
6
9
|
style?: import("..").Styles;
|
|
7
10
|
disabled?: boolean | undefined;
|
|
8
11
|
className?: import("..").Styles;
|
|
9
|
-
overrides?: import("./types").ButtonOverrides | undefined;
|
|
10
12
|
children?: import("react").ReactNode;
|
|
13
|
+
overrides?: import("./types").ButtonOverrides | undefined;
|
|
11
14
|
autoFocus?: boolean | undefined;
|
|
12
15
|
href?: string | undefined;
|
|
13
16
|
rel?: string | undefined;
|
|
14
17
|
shape?: import("./types").Shape | undefined;
|
|
15
18
|
target?: string | undefined;
|
|
16
19
|
type?: "button" | "reset" | "submit" | undefined;
|
|
20
|
+
tabIndex?: number | undefined;
|
|
21
|
+
role?: import("react").AriaRole | undefined;
|
|
17
22
|
onClick?: ((event: import("react").MouseEvent<HTMLElement, MouseEvent>) => any) | undefined;
|
|
18
23
|
$as?: import("react").ElementType<any> | undefined;
|
|
19
24
|
startEnhancer?: import("react").ReactNode;
|
|
20
25
|
endEnhancer?: import("react").ReactNode;
|
|
26
|
+
tooltipContent?: import("react").ReactNode | import("baseui/popover").StatefulContentRenderProp;
|
|
21
27
|
intent?: import("..").Intent | undefined;
|
|
22
28
|
isLoading?: boolean | undefined;
|
|
23
29
|
isSelected?: boolean | undefined;
|
|
24
30
|
fullWidth?: boolean | undefined;
|
|
25
|
-
tooltipContent?: import("react").ReactNode | ((args: {
|
|
26
|
-
close: () => void;
|
|
27
|
-
}) => import("react").ReactNode);
|
|
28
31
|
};
|
|
29
32
|
export default _default;
|
|
@@ -5,6 +5,6 @@ var variantMap = {
|
|
|
5
5
|
primary: KIND.primary,
|
|
6
6
|
secondary: KIND.secondary,
|
|
7
7
|
tertiary: KIND.tertiary,
|
|
8
|
-
minimal: KIND.
|
|
8
|
+
minimal: KIND.tertiary,
|
|
9
9
|
};
|
|
10
10
|
export default (function (props) { return (__assign(__assign({}, _omit(props, 'variant')), { kind: props.variant ? variantMap[props.variant] : KIND.primary })); });
|
|
@@ -60,8 +60,9 @@ var getPrimaryHoverColor = function (_a) {
|
|
|
60
60
|
});
|
|
61
61
|
};
|
|
62
62
|
var getBorderRadiiStyles = function (_a, _b) {
|
|
63
|
+
var _c;
|
|
63
64
|
var px2rem = _a.px2rem, theme = _a.theme;
|
|
64
|
-
var $shape = _b.$shape;
|
|
65
|
+
var $shape = _b.$shape, $size = _b.$size;
|
|
65
66
|
switch ($shape) {
|
|
66
67
|
case 'round':
|
|
67
68
|
return borderRadius(theme.borderRadius.full);
|
|
@@ -71,7 +72,7 @@ var getBorderRadiiStyles = function (_a, _b) {
|
|
|
71
72
|
return borderRadius(px2rem(theme.borderRadius['16']));
|
|
72
73
|
default:
|
|
73
74
|
}
|
|
74
|
-
return borderRadius(theme.button.borderRadius);
|
|
75
|
+
return borderRadius(((_c = getButtonSizeTheme(theme, $size)) === null || _c === void 0 ? void 0 : _c.borderRadius) || theme.button.borderRadius);
|
|
75
76
|
};
|
|
76
77
|
var getDimension = function (_a, _b) {
|
|
77
78
|
var theme = _a.theme, px2rem = _a.px2rem;
|
|
@@ -124,13 +125,13 @@ export var createButtonStyles = function (_a, _b) {
|
|
|
124
125
|
: {})), { ':active': activeStyles });
|
|
125
126
|
};
|
|
126
127
|
var getVariantStyles = function (utils, props) {
|
|
127
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
|
128
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
|
|
128
129
|
var theme = utils.theme;
|
|
129
130
|
var $variant = props.$variant, $isFocusVisible = props.$isFocusVisible, $intent = props.$intent, $isSelected = props.$isSelected;
|
|
130
131
|
switch ($variant) {
|
|
131
132
|
case 'primary':
|
|
132
133
|
default: {
|
|
133
|
-
var
|
|
134
|
+
var _7 = getPrimaryHighlightColor(utils, props), activeBackgroundColor = _7.backgroundColor, activeBorderColor = _7.borderColor, _8 = getPrimaryHoverColor(utils), hoverBackgroundColor = _8.backgroundColor, hoverBorderColor = _8.borderColor;
|
|
134
135
|
var backgroundColor = getIntentColor(utils, props), color = theme.spr.text05, borderColor = getIntentColor(utils, props);
|
|
135
136
|
var primaryButtonTheme = ((_a = theme.button) === null || _a === void 0 ? void 0 : _a.primary) || {};
|
|
136
137
|
var defaultIntentStyles = createButtonStyles({
|
|
@@ -154,36 +155,39 @@ var getVariantStyles = function (utils, props) {
|
|
|
154
155
|
: __assign(__assign(__assign({}, intentStyles), { ':hover': { opacity: '0.8' }, ':active': { opacity: '0.8' } }), ($isFocusVisible && { ':focus': { opacity: '0.8' } }));
|
|
155
156
|
}
|
|
156
157
|
case 'secondary': {
|
|
157
|
-
var
|
|
158
|
+
var _9 = theme.button.variantSecondary, color = _9.color, hoverBackgroundColor = _9.hoverBackgroundColor, activeBackgroundColor = _9.activeBackgroundColor;
|
|
158
159
|
var secondaryButtonTheme = ((_j = theme.button) === null || _j === void 0 ? void 0 : _j.secondary) || {};
|
|
159
160
|
return createButtonStyles({
|
|
160
161
|
color: (_k = secondaryButtonTheme.color) !== null && _k !== void 0 ? _k : color,
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
162
|
+
disabledColor: (_l = secondaryButtonTheme.disabledColor) !== null && _l !== void 0 ? _l : theme.spr.text03,
|
|
163
|
+
backgroundColor: (_m = secondaryButtonTheme.backgroundColor) !== null && _m !== void 0 ? _m : theme.spr.ui01,
|
|
164
|
+
hoverBackgroundColor: (_o = secondaryButtonTheme.hoverBackgroundColor) !== null && _o !== void 0 ? _o : hoverBackgroundColor,
|
|
165
|
+
activeBackgroundColor: (_p = secondaryButtonTheme.activeBackgroundColor) !== null && _p !== void 0 ? _p : activeBackgroundColor,
|
|
166
|
+
disabledBackgroundColor: (_q = secondaryButtonTheme.disabledBackgroundColor) !== null && _q !== void 0 ? _q : theme.spr.ui05,
|
|
167
|
+
borderColor: (_r = secondaryButtonTheme.borderColor) !== null && _r !== void 0 ? _r : theme.spr.interactive02,
|
|
168
|
+
hoverBorderColor: (_s = secondaryButtonTheme.hoverBorderColor) !== null && _s !== void 0 ? _s : theme.spr.border06,
|
|
169
|
+
activeBorderColor: (_t = secondaryButtonTheme.activeBorderColor) !== null && _t !== void 0 ? _t : theme.spr.interactive01,
|
|
170
|
+
disabledBorderColor: (_u = secondaryButtonTheme.disabledBorderColor) !== null && _u !== void 0 ? _u : theme.spr.border02,
|
|
167
171
|
}, props);
|
|
168
172
|
}
|
|
169
173
|
case 'tertiary': {
|
|
170
|
-
var tertiaryButtonTheme = ((
|
|
174
|
+
var tertiaryButtonTheme = ((_v = theme.button) === null || _v === void 0 ? void 0 : _v.tertiary) || {};
|
|
171
175
|
return createButtonStyles({
|
|
172
|
-
color: (
|
|
173
|
-
backgroundColor: (
|
|
174
|
-
hoverBackgroundColor: (
|
|
175
|
-
activeBackgroundColor: (
|
|
176
|
-
borderColor: (
|
|
176
|
+
color: (_w = tertiaryButtonTheme.color) !== null && _w !== void 0 ? _w : getIntentTextColor(utils, props),
|
|
177
|
+
backgroundColor: (_x = tertiaryButtonTheme.backgroundColor) !== null && _x !== void 0 ? _x : theme.spr.ui01,
|
|
178
|
+
hoverBackgroundColor: (_y = tertiaryButtonTheme.hoverBackgroundColor) !== null && _y !== void 0 ? _y : theme.spr.uiHover,
|
|
179
|
+
activeBackgroundColor: (_z = tertiaryButtonTheme.activeBackgroundColor) !== null && _z !== void 0 ? _z : theme.spr.uiFocus,
|
|
180
|
+
borderColor: (_0 = tertiaryButtonTheme.borderColor) !== null && _0 !== void 0 ? _0 : getIntentColor(utils, props),
|
|
177
181
|
}, props);
|
|
178
182
|
}
|
|
179
183
|
case 'minimal': {
|
|
180
|
-
var minimalButtonTheme = ((
|
|
184
|
+
var minimalButtonTheme = ((_1 = theme.button) === null || _1 === void 0 ? void 0 : _1.minimal) || {};
|
|
181
185
|
var styles = createButtonStyles({
|
|
182
|
-
color: (
|
|
183
|
-
backgroundColor: (
|
|
184
|
-
hoverBackgroundColor: (
|
|
185
|
-
activeBackgroundColor: (
|
|
186
|
-
borderColor: (
|
|
186
|
+
color: (_2 = minimalButtonTheme.color) !== null && _2 !== void 0 ? _2 : getIntentTextColor(utils, props),
|
|
187
|
+
backgroundColor: (_3 = minimalButtonTheme.backgroundColor) !== null && _3 !== void 0 ? _3 : 'transparent',
|
|
188
|
+
hoverBackgroundColor: (_4 = minimalButtonTheme.hoverBackgroundColor) !== null && _4 !== void 0 ? _4 : theme.spr.uiHover,
|
|
189
|
+
activeBackgroundColor: (_5 = minimalButtonTheme.activeBackgroundColor) !== null && _5 !== void 0 ? _5 : theme.spr.uiFocus,
|
|
190
|
+
borderColor: (_6 = minimalButtonTheme.borderColor) !== null && _6 !== void 0 ? _6 : 'transparent',
|
|
187
191
|
}, props);
|
|
188
192
|
styles.fontWeight = theme.fontWeight.normal;
|
|
189
193
|
return styles;
|
|
@@ -197,11 +201,12 @@ var getBaseStyles = function (_a, _b) {
|
|
|
197
201
|
};
|
|
198
202
|
export var getButtonStyles = [
|
|
199
203
|
function (utils, props) {
|
|
200
|
-
var $disabled = props.$disabled;
|
|
204
|
+
var $disabled = props.$disabled, $variant = props.$variant;
|
|
201
205
|
var theme = utils.theme;
|
|
202
206
|
return {
|
|
203
207
|
cursor: $disabled ? 'not-allowed' : 'pointer',
|
|
204
|
-
|
|
208
|
+
// for secondary variant disabled state, we are using correct tokens instead of relying on opacity
|
|
209
|
+
opacity: $disabled && $variant !== 'secondary' ? '0.6' : '1',
|
|
205
210
|
boxSizing: 'border-box',
|
|
206
211
|
outlineWidth: theme.borderWidth['0'],
|
|
207
212
|
};
|