@pega/cosmos-react-core 2.0.0-dev.9.2 → 2.0.0-rc.2
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/README.md +3 -3
- package/lib/components/Actions/Actions.js +1 -1
- package/lib/components/Actions/Actions.js.map +1 -1
- package/lib/components/AppShell/AppHeader.d.ts +2 -1
- package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.js +4 -9
- package/lib/components/AppShell/AppHeader.js.map +1 -1
- package/lib/components/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js +89 -62
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts +19 -16
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +227 -173
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.types.d.ts +7 -7
- package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.types.js.map +1 -1
- package/lib/components/AppShell/AppShellContext.d.ts +3 -0
- package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellContext.js +3 -1
- package/lib/components/AppShell/AppShellContext.js.map +1 -1
- package/lib/components/AppShell/AppShellList.d.ts +4 -3
- package/lib/components/AppShell/AppShellList.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellList.js +24 -19
- package/lib/components/AppShell/AppShellList.js.map +1 -1
- package/lib/components/AppShell/Drawer.d.ts.map +1 -1
- package/lib/components/AppShell/Drawer.js +7 -8
- package/lib/components/AppShell/Drawer.js.map +1 -1
- package/lib/components/AppShell/Operator.js +3 -5
- package/lib/components/AppShell/Operator.js.map +1 -1
- package/lib/components/AppShell/SkipNavigation.d.ts.map +1 -1
- package/lib/components/AppShell/SkipNavigation.js +30 -39
- package/lib/components/AppShell/SkipNavigation.js.map +1 -1
- package/lib/components/Avatar/Avatar.d.ts.map +1 -1
- package/lib/components/Avatar/Avatar.js +5 -4
- package/lib/components/Avatar/Avatar.js.map +1 -1
- package/lib/components/Backdrop/Backdrop.d.ts +1 -1
- package/lib/components/Backdrop/Backdrop.d.ts.map +1 -1
- package/lib/components/Backdrop/Backdrop.js +7 -6
- package/lib/components/Backdrop/Backdrop.js.map +1 -1
- package/lib/components/Badges/Alert.d.ts +2 -2
- package/lib/components/Badges/Alert.d.ts.map +1 -1
- package/lib/components/Badges/Alert.js +1 -1
- package/lib/components/Badges/Alert.js.map +1 -1
- package/lib/components/Badges/Count.js +1 -1
- package/lib/components/Badges/Count.js.map +1 -1
- package/lib/components/Badges/Selection.d.ts.map +1 -1
- package/lib/components/Badges/Selection.js +10 -9
- package/lib/components/Badges/Selection.js.map +1 -1
- package/lib/components/Badges/Status.d.ts +2 -2
- package/lib/components/Badges/Status.d.ts.map +1 -1
- package/lib/components/Badges/Status.js +1 -1
- package/lib/components/Badges/Status.js.map +1 -1
- package/lib/components/Badges/Tag.js +1 -1
- package/lib/components/Badges/Tag.js.map +1 -1
- package/lib/components/Banner/Banner.d.ts +2 -2
- package/lib/components/Banner/Banner.d.ts.map +1 -1
- package/lib/components/Banner/Banner.js +6 -8
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Boolean/BooleanDisplay.d.ts +2 -2
- package/lib/components/Boolean/BooleanDisplay.d.ts.map +1 -1
- package/lib/components/Boolean/BooleanDisplay.js +1 -2
- package/lib/components/Boolean/BooleanDisplay.js.map +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.js +13 -11
- package/lib/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/lib/components/Button/BareButton.d.ts.map +1 -1
- package/lib/components/Button/BareButton.js +21 -2
- package/lib/components/Button/BareButton.js.map +1 -1
- package/lib/components/Button/BareRoleButton.d.ts +12 -0
- package/lib/components/Button/BareRoleButton.d.ts.map +1 -0
- package/lib/components/Button/BareRoleButton.js +20 -0
- package/lib/components/Button/BareRoleButton.js.map +1 -0
- package/lib/components/Button/Button.d.ts +5 -0
- package/lib/components/Button/Button.d.ts.map +1 -1
- package/lib/components/Button/Button.js +34 -10
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Card/Card.d.ts.map +1 -1
- package/lib/components/Card/Card.js +3 -2
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/Card/CardContent.d.ts.map +1 -1
- package/lib/components/Card/CardContent.js +5 -4
- package/lib/components/Card/CardContent.js.map +1 -1
- package/lib/components/Card/CardFooter.d.ts.map +1 -1
- package/lib/components/Card/CardFooter.js +5 -4
- package/lib/components/Card/CardFooter.js.map +1 -1
- package/lib/components/Card/CardHeader.d.ts +3 -1
- package/lib/components/Card/CardHeader.d.ts.map +1 -1
- package/lib/components/Card/CardHeader.js +9 -7
- package/lib/components/Card/CardHeader.js.map +1 -1
- package/lib/components/Card/CardMedia.js +1 -1
- package/lib/components/Card/CardMedia.js.map +1 -1
- package/lib/components/Card/CollapsibleCard.d.ts.map +1 -1
- package/lib/components/Card/CollapsibleCard.js +5 -7
- package/lib/components/Card/CollapsibleCard.js.map +1 -1
- package/lib/components/Card/SelectableCard.js +1 -1
- package/lib/components/Card/SelectableCard.js.map +1 -1
- package/lib/components/Checkbox/Checkbox.d.ts +2 -2
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/Checkbox.js +1 -1
- package/lib/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.d.ts +2 -2
- package/lib/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.js +8 -11
- package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.js +30 -33
- package/lib/components/ComboBox/ComboBox.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.types.d.ts +2 -1
- package/lib/components/ComboBox/ComboBox.types.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.types.js.map +1 -1
- package/lib/components/ComboBox/ComboBoxInput.js +4 -4
- package/lib/components/ComboBox/ComboBoxInput.js.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +23 -29
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js +16 -12
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js.map +1 -1
- package/lib/components/Configuration/Configuration.js +11 -13
- package/lib/components/Configuration/Configuration.js.map +1 -1
- package/lib/components/Currency/CurrencyDisplay.d.ts +6 -2
- package/lib/components/Currency/CurrencyDisplay.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyDisplay.js +11 -7
- package/lib/components/Currency/CurrencyDisplay.js.map +1 -1
- package/lib/components/Currency/CurrencyInput.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.js +16 -16
- package/lib/components/Currency/CurrencyInput.js.map +1 -1
- package/lib/components/Currency/CurrencyInput.types.d.ts +6 -2
- package/lib/components/Currency/CurrencyInput.types.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.types.js.map +1 -1
- package/lib/components/Currency/utils.d.ts +12 -1
- package/lib/components/Currency/utils.d.ts.map +1 -1
- package/lib/components/Currency/utils.js +30 -2
- package/lib/components/Currency/utils.js.map +1 -1
- package/lib/components/DateTime/DateTime.types.d.ts +2 -1
- package/lib/components/DateTime/DateTime.types.d.ts.map +1 -1
- package/lib/components/DateTime/DateTime.types.js.map +1 -1
- package/lib/components/DateTime/DateTimeDisplay.d.ts +1 -1
- package/lib/components/DateTime/DateTimeDisplay.d.ts.map +1 -1
- package/lib/components/DateTime/DateTimeDisplay.js +14 -3
- package/lib/components/DateTime/DateTimeDisplay.js.map +1 -1
- package/lib/components/DateTime/DurationDisplay.d.ts.map +1 -1
- package/lib/components/DateTime/DurationDisplay.js +11 -6
- package/lib/components/DateTime/DurationDisplay.js.map +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +25 -27
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.js +10 -16
- package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.js +14 -3
- package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +42 -42
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DayOfWeekInput.d.ts +2 -0
- package/lib/components/DateTime/Input/DayOfWeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DayOfWeekInput.js +7 -5
- package/lib/components/DateTime/Input/DayOfWeekInput.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.js +3 -3
- package/lib/components/DateTime/Input/Duration/DurationInput.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/NumberUnit.js +4 -5
- package/lib/components/DateTime/Input/Duration/NumberUnit.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/Time.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/Time.js +12 -15
- package/lib/components/DateTime/Input/Duration/Time.js.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.js +12 -17
- package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
- package/lib/components/DateTime/Input/PartInput.js +3 -4
- package/lib/components/DateTime/Input/PartInput.js.map +1 -1
- package/lib/components/DateTime/Input/QuarterInput.d.ts +9 -0
- package/lib/components/DateTime/Input/QuarterInput.d.ts.map +1 -0
- package/lib/components/DateTime/Input/QuarterInput.js +102 -0
- package/lib/components/DateTime/Input/QuarterInput.js.map +1 -0
- package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.js +26 -30
- package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.js +22 -23
- package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
- package/lib/components/DateTime/Input/useAutoFocusNextInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/useAutoFocusNextInput.js +8 -9
- package/lib/components/DateTime/Input/useAutoFocusNextInput.js.map +1 -1
- package/lib/components/DateTime/Input/usePickerButton.js +4 -4
- package/lib/components/DateTime/Input/usePickerButton.js.map +1 -1
- package/lib/components/DateTime/Input/utils.d.ts +7 -0
- package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Input/utils.js +52 -10
- package/lib/components/DateTime/Input/utils.js.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.js +47 -72
- package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.styles.d.ts +2 -2
- package/lib/components/DateTime/Picker/Calendar.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.styles.js +16 -7
- package/lib/components/DateTime/Picker/Calendar.styles.js.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.js +13 -17
- package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/DateRangePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DateRangePicker.js +13 -17
- package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.js +9 -10
- package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/Weeks.js +9 -11
- package/lib/components/DateTime/Picker/Weeks.js.map +1 -1
- package/lib/components/DateTime/Picker/utils.d.ts +1 -0
- package/lib/components/DateTime/Picker/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/utils.js +3 -0
- package/lib/components/DateTime/Picker/utils.js.map +1 -1
- package/lib/components/DateTime/index.d.ts +2 -0
- package/lib/components/DateTime/index.d.ts.map +1 -1
- package/lib/components/DateTime/index.js +1 -0
- package/lib/components/DateTime/index.js.map +1 -1
- package/lib/components/Drawer/Drawer.js +6 -6
- package/lib/components/Drawer/Drawer.js.map +1 -1
- package/lib/components/Email/EmailDisplay.d.ts +2 -2
- package/lib/components/Email/EmailDisplay.d.ts.map +1 -1
- package/lib/components/Email/EmailDisplay.js +2 -2
- package/lib/components/Email/EmailDisplay.js.map +1 -1
- package/lib/components/EmojiPicker/EmojiDisplay.d.ts.map +1 -1
- package/lib/components/EmojiPicker/EmojiDisplay.js +1 -1
- package/lib/components/EmojiPicker/EmojiDisplay.js.map +1 -1
- package/lib/components/EmojiPicker/EmojiPicker.js +3 -4
- package/lib/components/EmojiPicker/EmojiPicker.js.map +1 -1
- package/lib/components/EmptyState/EmptyState.d.ts +14 -0
- package/lib/components/EmptyState/EmptyState.d.ts.map +1 -0
- package/lib/components/{NoItems/NoItems.js → EmptyState/EmptyState.js} +11 -8
- package/lib/components/EmptyState/EmptyState.js.map +1 -0
- package/lib/components/EmptyState/index.d.ts +4 -0
- package/lib/components/EmptyState/index.d.ts.map +1 -0
- package/lib/components/EmptyState/index.js +3 -0
- package/lib/components/EmptyState/index.js.map +1 -0
- package/lib/components/ErrorState/ErrorState.d.ts +16 -0
- package/lib/components/ErrorState/ErrorState.d.ts.map +1 -0
- package/lib/components/ErrorState/ErrorState.js +31 -0
- package/lib/components/ErrorState/ErrorState.js.map +1 -0
- package/lib/components/ErrorState/index.d.ts +4 -0
- package/lib/components/ErrorState/index.d.ts.map +1 -0
- package/lib/components/ErrorState/index.js +3 -0
- package/lib/components/ErrorState/index.js.map +1 -0
- package/lib/components/ExpandCollapse/ExpandCollapse.js +5 -5
- package/lib/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.js +6 -7
- package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.js +7 -6
- package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.d.ts +2 -2
- package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.js +5 -7
- package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/File/FileDisplay.d.ts +6 -3
- package/lib/components/File/FileDisplay.d.ts.map +1 -1
- package/lib/components/File/FileDisplay.js +7 -7
- package/lib/components/File/FileDisplay.js.map +1 -1
- package/lib/components/File/FileInput.d.ts +3 -3
- package/lib/components/File/FileInput.d.ts.map +1 -1
- package/lib/components/File/FileInput.js +18 -19
- package/lib/components/File/FileInput.js.map +1 -1
- package/lib/components/File/FileItem.d.ts +0 -2
- package/lib/components/File/FileItem.d.ts.map +1 -1
- package/lib/components/File/FileItem.js +3 -4
- package/lib/components/File/FileItem.js.map +1 -1
- package/lib/components/File/FileUploadItem.d.ts +4 -2
- package/lib/components/File/FileUploadItem.d.ts.map +1 -1
- package/lib/components/File/FileUploadItem.js +58 -20
- package/lib/components/File/FileUploadItem.js.map +1 -1
- package/lib/components/File/FileVisual.d.ts +7 -16
- package/lib/components/File/FileVisual.d.ts.map +1 -1
- package/lib/components/File/FileVisual.js +44 -47
- package/lib/components/File/FileVisual.js.map +1 -1
- package/lib/components/File/utils.js +2 -3
- package/lib/components/File/utils.js.map +1 -1
- package/lib/components/Flex/Flex.d.ts +17 -7
- package/lib/components/Flex/Flex.d.ts.map +1 -1
- package/lib/components/Flex/Flex.js +25 -9
- package/lib/components/Flex/Flex.js.map +1 -1
- package/lib/components/Form/Form.d.ts +7 -1
- package/lib/components/Form/Form.d.ts.map +1 -1
- package/lib/components/Form/Form.js +5 -4
- package/lib/components/Form/Form.js.map +1 -1
- package/lib/components/FormControl/FormControl.d.ts +1 -1
- package/lib/components/FormControl/FormControl.d.ts.map +1 -1
- package/lib/components/FormControl/FormControl.js +1 -1
- package/lib/components/FormControl/FormControl.js.map +1 -1
- package/lib/components/FormField/FormField.d.ts +5 -7
- package/lib/components/FormField/FormField.d.ts.map +1 -1
- package/lib/components/FormField/FormField.js +9 -19
- package/lib/components/FormField/FormField.js.map +1 -1
- package/lib/components/Grid/Grid.d.ts +1 -1
- package/lib/components/Grid/Grid.d.ts.map +1 -1
- package/lib/components/Grid/Grid.js +17 -21
- package/lib/components/Grid/Grid.js.map +1 -1
- package/lib/components/Icon/Icon.js +3 -5
- package/lib/components/Icon/Icon.js.map +1 -1
- package/lib/components/Icon/iconNames.d.ts +1 -1
- package/lib/components/Icon/iconNames.d.ts.map +1 -1
- package/lib/components/Icon/iconNames.js +2 -0
- package/lib/components/Icon/iconNames.js.map +1 -1
- package/lib/components/Icon/icons/compass-solid.icon.js +1 -2
- package/lib/components/Icon/icons/compass-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/dataviz-table-with-bars.icon.js +1 -4
- package/lib/components/Icon/icons/dataviz-table-with-bars.icon.js.map +1 -1
- package/lib/components/Icon/icons/dataviz-table-with-cross.icon.js +1 -2
- package/lib/components/Icon/icons/dataviz-table-with-cross.icon.js.map +1 -1
- package/lib/components/Icon/icons/dataviz-waterfall.icon.js +1 -5
- package/lib/components/Icon/icons/dataviz-waterfall.icon.js.map +1 -1
- package/lib/components/Icon/icons/dock.icon.d.ts +4 -0
- package/lib/components/Icon/icons/dock.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/dock.icon.js +6 -0
- package/lib/components/Icon/icons/dock.icon.js.map +1 -0
- package/lib/components/Icon/icons/filetype-text.icon.js +1 -4
- package/lib/components/Icon/icons/filetype-text.icon.js.map +1 -1
- package/lib/components/Icon/icons/folder-dollar.icon.js +1 -2
- package/lib/components/Icon/icons/folder-dollar.icon.js.map +1 -1
- package/lib/components/Icon/icons/freeze-column.icon.js +1 -2
- package/lib/components/Icon/icons/freeze-column.icon.js.map +1 -1
- package/lib/components/Icon/icons/galaxy.icon.js +1 -3
- package/lib/components/Icon/icons/galaxy.icon.js.map +1 -1
- package/lib/components/Icon/icons/grad-solid.icon.js +1 -2
- package/lib/components/Icon/icons/grad-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/grad.icon.js +1 -5
- package/lib/components/Icon/icons/grad.icon.js.map +1 -1
- package/lib/components/Icon/icons/list-number.icon.js +1 -6
- package/lib/components/Icon/icons/list-number.icon.js.map +1 -1
- package/lib/components/Icon/icons/list.icon.js +1 -6
- package/lib/components/Icon/icons/list.icon.js.map +1 -1
- package/lib/components/Icon/icons/pin.icon.js +1 -2
- package/lib/components/Icon/icons/pin.icon.js.map +1 -1
- package/lib/components/Icon/icons/search-solid.icon.js +1 -2
- package/lib/components/Icon/icons/search-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/tracer.icon.js +1 -2
- package/lib/components/Icon/icons/tracer.icon.js.map +1 -1
- package/lib/components/Icon/icons/tribox-solid.icon.js +1 -3
- package/lib/components/Icon/icons/tribox-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/tribox.icon.js +1 -3
- package/lib/components/Icon/icons/tribox.icon.js.map +1 -1
- package/lib/components/Icon/icons/undock.icon.d.ts +4 -0
- package/lib/components/Icon/icons/undock.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/undock.icon.js +6 -0
- package/lib/components/Icon/icons/undock.icon.js.map +1 -0
- package/lib/components/Image/Image.js +1 -1
- package/lib/components/Image/Image.js.map +1 -1
- package/lib/components/Image/index.d.ts +1 -1
- package/lib/components/Image/index.d.ts.map +1 -1
- package/lib/components/Image/index.js +1 -0
- package/lib/components/Image/index.js.map +1 -1
- package/lib/components/Input/Input.d.ts +2 -2
- package/lib/components/Input/Input.d.ts.map +1 -1
- package/lib/components/Input/Input.js +13 -13
- package/lib/components/Input/Input.js.map +1 -1
- package/lib/components/Input/Input.styles.js +2 -2
- package/lib/components/Input/Input.styles.js.map +1 -1
- package/lib/components/Label/Label.js +1 -1
- package/lib/components/Label/Label.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.d.ts +6 -0
- package/lib/components/Lightbox/Lightbox.d.ts.map +1 -0
- package/lib/components/Lightbox/Lightbox.js +129 -0
- package/lib/components/Lightbox/Lightbox.js.map +1 -0
- package/lib/components/Lightbox/Lightbox.styles.d.ts +11 -0
- package/lib/components/Lightbox/Lightbox.styles.d.ts.map +1 -0
- package/lib/components/Lightbox/Lightbox.styles.js +166 -0
- package/lib/components/Lightbox/Lightbox.styles.js.map +1 -0
- package/lib/components/Lightbox/Lightbox.types.d.ts +42 -0
- package/lib/components/Lightbox/Lightbox.types.d.ts.map +1 -0
- package/lib/components/Lightbox/Lightbox.types.js +2 -0
- package/lib/components/Lightbox/Lightbox.types.js.map +1 -0
- package/lib/components/Lightbox/index.d.ts +3 -0
- package/lib/components/Lightbox/index.d.ts.map +1 -0
- package/lib/components/Lightbox/index.js +2 -0
- package/lib/components/Lightbox/index.js.map +1 -0
- package/lib/components/Link/Link.js +5 -8
- package/lib/components/Link/Link.js.map +1 -1
- package/lib/components/List/CommaSeparatedList.d.ts +15 -0
- package/lib/components/List/CommaSeparatedList.d.ts.map +1 -0
- package/lib/components/List/CommaSeparatedList.js +61 -0
- package/lib/components/List/CommaSeparatedList.js.map +1 -0
- package/lib/components/List/List.d.ts +30 -0
- package/lib/components/List/List.d.ts.map +1 -0
- package/lib/components/List/List.js +56 -0
- package/lib/components/List/List.js.map +1 -0
- package/lib/components/List/OrderedList.d.ts +6 -0
- package/lib/components/List/OrderedList.d.ts.map +1 -0
- package/lib/components/List/OrderedList.js +6 -0
- package/lib/components/List/OrderedList.js.map +1 -0
- package/lib/components/List/UnorderedList.d.ts +6 -0
- package/lib/components/List/UnorderedList.d.ts.map +1 -0
- package/lib/components/List/UnorderedList.js +6 -0
- package/lib/components/List/UnorderedList.js.map +1 -0
- package/lib/components/List/index.d.ts +5 -0
- package/lib/components/List/index.d.ts.map +1 -0
- package/lib/components/List/index.js +4 -0
- package/lib/components/List/index.js.map +1 -0
- package/lib/components/Location/CurrentLocationButton.d.ts.map +1 -1
- package/lib/components/Location/CurrentLocationButton.js +7 -7
- package/lib/components/Location/CurrentLocationButton.js.map +1 -1
- package/lib/components/Location/Location.types.d.ts +2 -1
- package/lib/components/Location/Location.types.d.ts.map +1 -1
- package/lib/components/Location/Location.types.js.map +1 -1
- package/lib/components/Location/LocationDisplay.js +8 -9
- package/lib/components/Location/LocationDisplay.js.map +1 -1
- package/lib/components/Location/LocationInput.js +27 -28
- package/lib/components/Location/LocationInput.js.map +1 -1
- package/lib/components/Location/LocationView.js +8 -13
- package/lib/components/Location/LocationView.js.map +1 -1
- package/lib/components/Location/utils.js +11 -15
- package/lib/components/Location/utils.js.map +1 -1
- package/lib/components/Menu/FlyoutMenuList.d.ts.map +1 -1
- package/lib/components/Menu/FlyoutMenuList.js +12 -15
- package/lib/components/Menu/FlyoutMenuList.js.map +1 -1
- package/lib/components/Menu/Menu.context.d.ts.map +1 -1
- package/lib/components/Menu/Menu.context.js +2 -0
- package/lib/components/Menu/Menu.context.js.map +1 -1
- package/lib/components/Menu/Menu.d.ts.map +1 -1
- package/lib/components/Menu/Menu.js +89 -46
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/Menu.styles.d.ts +11 -0
- package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
- package/lib/components/Menu/Menu.styles.js +202 -3
- package/lib/components/Menu/Menu.styles.js.map +1 -1
- package/lib/components/Menu/Menu.types.d.ts +30 -12
- package/lib/components/Menu/Menu.types.d.ts.map +1 -1
- package/lib/components/Menu/Menu.types.js.map +1 -1
- package/lib/components/Menu/MenuGroup.d.ts +6 -0
- package/lib/components/Menu/MenuGroup.d.ts.map +1 -0
- package/lib/components/Menu/MenuGroup.js +17 -0
- package/lib/components/Menu/MenuGroup.js.map +1 -0
- package/lib/components/Menu/MenuItem.d.ts +0 -3
- package/lib/components/Menu/MenuItem.d.ts.map +1 -1
- package/lib/components/Menu/MenuItem.js +57 -164
- package/lib/components/Menu/MenuItem.js.map +1 -1
- package/lib/components/Menu/MenuList.d.ts +1 -1
- package/lib/components/Menu/MenuList.d.ts.map +1 -1
- package/lib/components/Menu/MenuList.js +28 -30
- package/lib/components/Menu/MenuList.js.map +1 -1
- package/lib/components/Menu/MenuListHeader.d.ts +0 -1
- package/lib/components/Menu/MenuListHeader.d.ts.map +1 -1
- package/lib/components/Menu/MenuListHeader.js +7 -55
- package/lib/components/Menu/MenuListHeader.js.map +1 -1
- package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
- package/lib/components/Menu/NavItemsList.js +2 -3
- package/lib/components/Menu/NavItemsList.js.map +1 -1
- package/lib/components/Menu/helpers.d.ts +13 -12
- package/lib/components/Menu/helpers.d.ts.map +1 -1
- package/lib/components/Menu/helpers.js +40 -36
- package/lib/components/Menu/helpers.js.map +1 -1
- package/lib/components/Menu/index.d.ts +2 -3
- package/lib/components/Menu/index.d.ts.map +1 -1
- package/lib/components/Menu/index.js +1 -2
- package/lib/components/Menu/index.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.d.ts +3 -1
- package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +13 -14
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MetaList/MetaList.d.ts +13 -4
- package/lib/components/MetaList/MetaList.d.ts.map +1 -1
- package/lib/components/MetaList/MetaList.js +34 -20
- package/lib/components/MetaList/MetaList.js.map +1 -1
- package/lib/components/Modal/Contexts.d.ts.map +1 -1
- package/lib/components/Modal/Contexts.js +3 -0
- package/lib/components/Modal/Contexts.js.map +1 -1
- package/lib/components/Modal/DockedModals.d.ts.map +1 -1
- package/lib/components/Modal/DockedModals.js +5 -4
- package/lib/components/Modal/DockedModals.js.map +1 -1
- package/lib/components/Modal/MinimizedModal.d.ts.map +1 -1
- package/lib/components/Modal/MinimizedModal.js +53 -38
- package/lib/components/Modal/MinimizedModal.js.map +1 -1
- package/lib/components/Modal/Modal.d.ts +1 -6
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Modal/Modal.js +82 -134
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/Modal/Modal.styles.d.ts +9 -0
- package/lib/components/Modal/Modal.styles.d.ts.map +1 -0
- package/lib/components/Modal/Modal.styles.js +135 -0
- package/lib/components/Modal/Modal.styles.js.map +1 -0
- package/lib/components/Modal/Modal.types.d.ts +56 -5
- package/lib/components/Modal/Modal.types.d.ts.map +1 -1
- package/lib/components/Modal/Modal.types.js.map +1 -1
- package/lib/components/Modal/ModalManager.d.ts.map +1 -1
- package/lib/components/Modal/ModalManager.js +74 -65
- package/lib/components/Modal/ModalManager.js.map +1 -1
- package/lib/components/MultiStep/MultiStep.d.ts.map +1 -1
- package/lib/components/MultiStep/MultiStep.js +10 -12
- package/lib/components/MultiStep/MultiStep.js.map +1 -1
- package/lib/components/MultiStep/MultiStep.styles.js +1 -1
- package/lib/components/MultiStep/MultiStep.styles.js.map +1 -1
- package/lib/components/MultiStep/MultiStep.types.d.ts +4 -2
- package/lib/components/MultiStep/MultiStep.types.d.ts.map +1 -1
- package/lib/components/MultiStep/MultiStep.types.js.map +1 -1
- package/lib/components/Number/NumberDisplay.d.ts +2 -2
- package/lib/components/Number/NumberDisplay.d.ts.map +1 -1
- package/lib/components/Number/NumberDisplay.js +1 -1
- package/lib/components/Number/NumberDisplay.js.map +1 -1
- package/lib/components/Number/NumberInput.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.js +18 -25
- package/lib/components/Number/NumberInput.js.map +1 -1
- package/lib/components/Number/NumberInput.styles.d.ts +2 -2
- package/lib/components/Number/NumberInput.styles.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.types.d.ts +2 -2
- package/lib/components/Number/NumberInput.types.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.types.js.map +1 -1
- package/lib/components/Number/utils.js +2 -3
- package/lib/components/Number/utils.js.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.d.ts +1 -1
- package/lib/components/PageTemplates/CategorySubPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.js +8 -18
- package/lib/components/PageTemplates/CategorySubPage.js.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.styles.d.ts +1 -1
- package/lib/components/PageTemplates/CategorySubPage.styles.d.ts.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.d.ts +7 -1
- package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.js +48 -28
- package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.d.ts +15 -6
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js +89 -79
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/PageTemplates/index.d.ts +3 -0
- package/lib/components/PageTemplates/index.d.ts.map +1 -1
- package/lib/components/PageTemplates/index.js +1 -0
- package/lib/components/PageTemplates/index.js.map +1 -1
- package/lib/components/Pagination/Pagination.d.ts +2 -2
- package/lib/components/Pagination/Pagination.d.ts.map +1 -1
- package/lib/components/Pagination/Pagination.js +7 -6
- package/lib/components/Pagination/Pagination.js.map +1 -1
- package/lib/components/Paragraph/ParagraphDisplay.d.ts +11 -0
- package/lib/components/Paragraph/ParagraphDisplay.d.ts.map +1 -0
- package/lib/components/Paragraph/ParagraphDisplay.js +11 -0
- package/lib/components/Paragraph/ParagraphDisplay.js.map +1 -0
- package/lib/components/Paragraph/index.d.ts +3 -0
- package/lib/components/Paragraph/index.d.ts.map +1 -0
- package/lib/components/Paragraph/index.js +2 -0
- package/lib/components/Paragraph/index.js.map +1 -0
- package/lib/components/Phone/PhoneDisplay.d.ts +2 -2
- package/lib/components/Phone/PhoneDisplay.d.ts.map +1 -1
- package/lib/components/Phone/PhoneDisplay.js +2 -3
- package/lib/components/Phone/PhoneDisplay.js.map +1 -1
- package/lib/components/Phone/PhoneInput.d.ts +2 -2
- package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
- package/lib/components/Phone/PhoneInput.js +18 -17
- package/lib/components/Phone/PhoneInput.js.map +1 -1
- package/lib/components/Phone/utils.js +2 -3
- package/lib/components/Phone/utils.js.map +1 -1
- package/lib/components/Popover/Popover.d.ts +0 -4
- package/lib/components/Popover/Popover.d.ts.map +1 -1
- package/lib/components/Popover/Popover.js +11 -122
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/Popover.styles.d.ts +5 -0
- package/lib/components/Popover/Popover.styles.d.ts.map +1 -0
- package/lib/components/Popover/Popover.styles.js +116 -0
- package/lib/components/Popover/Popover.styles.js.map +1 -0
- package/lib/components/Popover/PopoverManager.js +2 -2
- package/lib/components/Popover/PopoverManager.js.map +1 -1
- package/lib/components/Popover/index.d.ts +1 -1
- package/lib/components/Popover/index.d.ts.map +1 -1
- package/lib/components/Popover/index.js +1 -1
- package/lib/components/Popover/index.js.map +1 -1
- package/lib/components/Progress/Bar.js +2 -2
- package/lib/components/Progress/Bar.js.map +1 -1
- package/lib/components/Progress/Ellipsis.d.ts +1 -1
- package/lib/components/Progress/Ellipsis.d.ts.map +1 -1
- package/lib/components/Progress/Ellipsis.js +48 -50
- package/lib/components/Progress/Ellipsis.js.map +1 -1
- package/lib/components/Progress/Progress.js +3 -4
- package/lib/components/Progress/Progress.js.map +1 -1
- package/lib/components/Progress/Progress.types.d.ts +2 -2
- package/lib/components/Progress/Progress.types.d.ts.map +1 -1
- package/lib/components/Progress/Progress.types.js.map +1 -1
- package/lib/components/Progress/Ring.d.ts +1 -1
- package/lib/components/Progress/Ring.d.ts.map +1 -1
- package/lib/components/Progress/Ring.js +40 -40
- package/lib/components/Progress/Ring.js.map +1 -1
- package/lib/components/RadioButton/RadioButton.d.ts +2 -2
- package/lib/components/RadioButton/RadioButton.d.ts.map +1 -1
- package/lib/components/RadioButton/RadioButton.js +1 -1
- package/lib/components/RadioButton/RadioButton.js.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.d.ts +2 -2
- package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.js +7 -8
- package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts +4 -0
- package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts.map +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.js +19 -18
- package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
- package/lib/components/Rating/Rating.d.ts +2 -2
- package/lib/components/Rating/Rating.d.ts.map +1 -1
- package/lib/components/Rating/Rating.js +6 -7
- package/lib/components/Rating/Rating.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts +4 -4
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.js +14 -14
- package/lib/components/SearchInput/SearchInput.js.map +1 -1
- package/lib/components/Select/Option.js +1 -1
- package/lib/components/Select/Option.js.map +1 -1
- package/lib/components/Select/Select.d.ts.map +1 -1
- package/lib/components/Select/Select.js +15 -16
- package/lib/components/Select/Select.js.map +1 -1
- package/lib/components/Sentiment/Sentiment.d.ts +2 -2
- package/lib/components/Sentiment/Sentiment.d.ts.map +1 -1
- package/lib/components/Sentiment/Sentiment.js +1 -2
- package/lib/components/Sentiment/Sentiment.js.map +1 -1
- package/lib/components/Skeleton/LineSkeleton.js +1 -1
- package/lib/components/Skeleton/LineSkeleton.js.map +1 -1
- package/lib/components/Skeleton/ParagraphSkeleton.js +1 -1
- package/lib/components/Skeleton/ParagraphSkeleton.js.map +1 -1
- package/lib/components/Skeleton/RectangleSkeleton.js +1 -1
- package/lib/components/Skeleton/RectangleSkeleton.js.map +1 -1
- package/lib/components/Slider/Slider.d.ts.map +1 -1
- package/lib/components/Slider/Slider.js +12 -19
- package/lib/components/Slider/Slider.js.map +1 -1
- package/lib/components/Slider/Slider.styles.d.ts +4 -1
- package/lib/components/Slider/Slider.styles.d.ts.map +1 -1
- package/lib/components/Slider/Slider.styles.js +17 -5
- package/lib/components/Slider/Slider.styles.js.map +1 -1
- package/lib/components/Slider/Slider.types.d.ts +2 -2
- package/lib/components/Slider/Slider.types.d.ts.map +1 -1
- package/lib/components/Slider/Slider.types.js.map +1 -1
- package/lib/components/Slider/SliderTicks.d.ts +1 -0
- package/lib/components/Slider/SliderTicks.d.ts.map +1 -1
- package/lib/components/Slider/SliderTicks.js +19 -12
- package/lib/components/Slider/SliderTicks.js.map +1 -1
- package/lib/components/Slider/utils.d.ts +10 -11
- package/lib/components/Slider/utils.d.ts.map +1 -1
- package/lib/components/Slider/utils.js +24 -18
- package/lib/components/Slider/utils.js.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.d.ts +5 -5
- package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.js +3 -5
- package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
- package/lib/components/SummaryList/SummaryList.d.ts +8 -2
- package/lib/components/SummaryList/SummaryList.d.ts.map +1 -1
- package/lib/components/SummaryList/SummaryList.js +10 -11
- package/lib/components/SummaryList/SummaryList.js.map +1 -1
- package/lib/components/SummaryList/ViewAll.d.ts +1 -1
- package/lib/components/SummaryList/ViewAll.d.ts.map +1 -1
- package/lib/components/SummaryList/ViewAll.js +14 -10
- package/lib/components/SummaryList/ViewAll.js.map +1 -1
- package/lib/components/Switch/Switch.d.ts +2 -2
- package/lib/components/Switch/Switch.d.ts.map +1 -1
- package/lib/components/Switch/Switch.js +41 -30
- package/lib/components/Switch/Switch.js.map +1 -1
- package/lib/components/Table/Table.d.ts +2 -2
- package/lib/components/Table/Table.d.ts.map +1 -1
- package/lib/components/Table/Table.js +14 -13
- package/lib/components/Table/Table.js.map +1 -1
- package/lib/components/Tabs/Tab.d.ts +1 -1
- package/lib/components/Tabs/Tab.d.ts.map +1 -1
- package/lib/components/Tabs/Tab.js +9 -7
- package/lib/components/Tabs/Tab.js.map +1 -1
- package/lib/components/Tabs/TabPanel.d.ts +10 -2
- package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
- package/lib/components/Tabs/TabPanel.js +24 -8
- package/lib/components/Tabs/TabPanel.js.map +1 -1
- package/lib/components/Tabs/Tabs.d.ts +1 -0
- package/lib/components/Tabs/Tabs.d.ts.map +1 -1
- package/lib/components/Tabs/Tabs.js +22 -18
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/components/Tabs/Tabs.types.d.ts +2 -2
- package/lib/components/Tabs/Tabs.types.d.ts.map +1 -1
- package/lib/components/Tabs/Tabs.types.js.map +1 -1
- package/lib/components/Text/Text.d.ts +1 -1
- package/lib/components/Text/Text.d.ts.map +1 -1
- package/lib/components/Text/Text.js +2 -2
- package/lib/components/Text/Text.js.map +1 -1
- package/lib/components/TextArea/TextArea.d.ts +2 -2
- package/lib/components/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.js +31 -30
- package/lib/components/TextArea/TextArea.js.map +1 -1
- package/lib/components/Toaster/Toaster.d.ts +8 -36
- package/lib/components/Toaster/Toaster.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.js +97 -102
- package/lib/components/Toaster/Toaster.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.d.ts +6 -1
- package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/components/Tooltip/Tooltip.js +6 -13
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/components/Tree/StandardTree.d.ts +6 -0
- package/lib/components/Tree/StandardTree.d.ts.map +1 -0
- package/lib/components/Tree/StandardTree.js +175 -0
- package/lib/components/Tree/StandardTree.js.map +1 -0
- package/lib/components/Tree/StandardTree.styles.d.ts +13 -0
- package/lib/components/Tree/StandardTree.styles.d.ts.map +1 -0
- package/lib/components/Tree/StandardTree.styles.js +155 -0
- package/lib/components/Tree/StandardTree.styles.js.map +1 -0
- package/lib/components/Tree/StandardTree.types.d.ts +25 -0
- package/lib/components/Tree/StandardTree.types.d.ts.map +1 -0
- package/lib/components/Tree/StandardTree.types.js +2 -0
- package/lib/components/Tree/StandardTree.types.js.map +1 -0
- package/lib/components/Tree/Tree.d.ts +35 -49
- package/lib/components/Tree/Tree.d.ts.map +1 -1
- package/lib/components/Tree/Tree.js +18 -56
- package/lib/components/Tree/Tree.js.map +1 -1
- package/lib/components/Tree/helpers.d.ts +19 -0
- package/lib/components/Tree/helpers.d.ts.map +1 -0
- package/lib/components/Tree/helpers.js +180 -0
- package/lib/components/Tree/helpers.js.map +1 -0
- package/lib/components/Tree/index.d.ts +4 -2
- package/lib/components/Tree/index.d.ts.map +1 -1
- package/lib/components/Tree/index.js +3 -1
- package/lib/components/Tree/index.js.map +1 -1
- package/lib/components/URL/URLDisplay.d.ts +2 -2
- package/lib/components/URL/URLDisplay.d.ts.map +1 -1
- package/lib/components/URL/URLDisplay.js +2 -2
- package/lib/components/URL/URLDisplay.js.map +1 -1
- package/lib/hooks/index.d.ts +7 -4
- package/lib/hooks/index.d.ts.map +1 -1
- package/lib/hooks/index.js +7 -3
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useActiveDescendant.d.ts +17 -3
- package/lib/hooks/useActiveDescendant.d.ts.map +1 -1
- package/lib/hooks/useActiveDescendant.js +86 -64
- package/lib/hooks/useActiveDescendant.js.map +1 -1
- package/lib/hooks/useAutoResize.d.ts.map +1 -1
- package/lib/hooks/useAutoResize.js +6 -7
- package/lib/hooks/useAutoResize.js.map +1 -1
- package/lib/hooks/useBreakpoint.js +2 -4
- package/lib/hooks/useBreakpoint.js.map +1 -1
- package/lib/hooks/useDraggable.d.ts +8 -0
- package/lib/hooks/useDraggable.d.ts.map +1 -0
- package/lib/hooks/useDraggable.js +64 -0
- package/lib/hooks/useDraggable.js.map +1 -0
- package/lib/hooks/useFocusWithin.d.ts +1 -1
- package/lib/hooks/useFocusWithin.d.ts.map +1 -1
- package/lib/hooks/useFocusWithin.js +29 -24
- package/lib/hooks/useFocusWithin.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +505 -170
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useI18n.js +2 -2
- package/lib/hooks/useI18n.js.map +1 -1
- package/lib/hooks/useLongPress.d.ts +16 -0
- package/lib/hooks/useLongPress.d.ts.map +1 -0
- package/lib/hooks/useLongPress.js +59 -0
- package/lib/hooks/useLongPress.js.map +1 -0
- package/lib/hooks/useOuterEvent.js +1 -1
- package/lib/hooks/useOuterEvent.js.map +1 -1
- package/lib/hooks/useOverride.js +1 -1
- package/lib/hooks/useOverride.js.map +1 -1
- package/lib/hooks/useScrollStick.js +14 -3
- package/lib/hooks/useScrollStick.js.map +1 -1
- package/lib/hooks/useScrollToggle.d.ts +6 -0
- package/lib/hooks/useScrollToggle.d.ts.map +1 -0
- package/lib/hooks/useScrollToggle.js +40 -0
- package/lib/hooks/useScrollToggle.js.map +1 -0
- package/lib/hooks/useTransitionState.d.ts +39 -0
- package/lib/hooks/useTransitionState.d.ts.map +1 -0
- package/lib/hooks/useTransitionState.js +56 -0
- package/lib/hooks/useTransitionState.js.map +1 -0
- package/lib/i18n/default.d.ts +583 -0
- package/lib/i18n/default.d.ts.map +1 -0
- package/lib/i18n/default.js +627 -0
- package/lib/i18n/default.js.map +1 -0
- package/lib/i18n/i18n.d.ts +988 -318
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/i18n/i18n.js +1 -1
- package/lib/i18n/i18n.js.map +1 -1
- package/lib/i18n/index.d.ts +1 -0
- package/lib/i18n/index.d.ts.map +1 -1
- package/lib/i18n/index.js.map +1 -1
- package/lib/i18n/translate.d.ts +29 -4
- package/lib/i18n/translate.d.ts.map +1 -1
- package/lib/i18n/translate.js +21 -8
- package/lib/i18n/translate.js.map +1 -1
- package/lib/index.d.ts +8 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -2
- package/lib/index.js.map +1 -1
- package/lib/styles/GlobalStyle.d.ts.map +1 -1
- package/lib/styles/GlobalStyle.js +2 -26
- package/lib/styles/GlobalStyle.js.map +1 -1
- package/lib/theme/ThemeMachine.js +7 -1
- package/lib/theme/ThemeMachine.js.map +1 -1
- package/lib/theme/index.d.ts +1 -0
- package/lib/theme/index.d.ts.map +1 -1
- package/lib/theme/index.js +1 -0
- package/lib/theme/index.js.map +1 -1
- package/lib/theme/theme.d.ts +83 -53
- package/lib/theme/theme.d.ts.map +1 -1
- package/lib/theme/themeDefinition.json +50 -30
- package/lib/theme/themeOverrides.schema.json +24 -3
- package/lib/theme/themes/buildTheme.json +3 -39
- package/lib/theme/themes/darkTheme.json +6 -0
- package/lib/theme/themes/legacyBuildTheme.json +50 -0
- package/lib/types/types.d.ts +6 -1
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/types.js.map +1 -1
- package/lib/utils/utils.d.ts +41 -4
- package/lib/utils/utils.d.ts.map +1 -1
- package/lib/utils/utils.js +55 -9
- package/lib/utils/utils.js.map +1 -1
- package/package.json +10 -11
- package/lib/components/DateTime/Input/useButtonAriaLabel.d.ts +0 -3
- package/lib/components/DateTime/Input/useButtonAriaLabel.d.ts.map +0 -1
- package/lib/components/DateTime/Input/useButtonAriaLabel.js +0 -33
- package/lib/components/DateTime/Input/useButtonAriaLabel.js.map +0 -1
- package/lib/components/NoItems/NoItems.d.ts +0 -14
- package/lib/components/NoItems/NoItems.d.ts.map +0 -1
- package/lib/components/NoItems/NoItems.js.map +0 -1
- package/lib/components/NoItems/index.d.ts +0 -4
- package/lib/components/NoItems/index.d.ts.map +0 -1
- package/lib/components/NoItems/index.js +0 -3
- package/lib/components/NoItems/index.js.map +0 -1
- package/lib/i18n/default.json +0 -246
|
@@ -4,8 +4,10 @@ import styled, { css } from 'styled-components';
|
|
|
4
4
|
import { mix, transparentize } from 'polished';
|
|
5
5
|
import { tryCatch } from '../../utils/utils';
|
|
6
6
|
import BareButton, { StyledBareButton } from '../Button/BareButton';
|
|
7
|
-
import Icon, { StyledIcon } from '../Icon';
|
|
7
|
+
import Icon, { registerIcon, StyledIcon } from '../Icon';
|
|
8
|
+
import * as timesIcon from '../Icon/icons/times.icon';
|
|
8
9
|
import { useConsolidatedRef } from '../../hooks';
|
|
10
|
+
registerIcon(timesIcon);
|
|
9
11
|
export const StyledSelectable = styled.div(props => {
|
|
10
12
|
const { foreground, background } = props.theme.components.badges.selectable.base;
|
|
11
13
|
const { dark } = props.theme.base.palette;
|
|
@@ -63,25 +65,24 @@ const Selectable = forwardRef((props, ref) => {
|
|
|
63
65
|
const consolidatedRef = useConsolidatedRef(ref);
|
|
64
66
|
const { id, onSelect, onRemove, children, onClick, onKeyUp, ...restProps } = props;
|
|
65
67
|
const handleClick = (e) => {
|
|
66
|
-
onClick
|
|
67
|
-
onSelect
|
|
68
|
+
onClick?.(e);
|
|
69
|
+
onSelect?.(id);
|
|
68
70
|
};
|
|
69
71
|
const handleCloseClick = (e) => {
|
|
70
72
|
e.preventDefault();
|
|
71
73
|
e.stopPropagation();
|
|
72
|
-
onRemove
|
|
74
|
+
onRemove?.(id);
|
|
73
75
|
};
|
|
74
76
|
const handleKeyUp = (e) => {
|
|
75
|
-
onKeyUp
|
|
77
|
+
onKeyUp?.(e);
|
|
76
78
|
if (e.key === 'Enter') {
|
|
77
|
-
onSelect
|
|
79
|
+
onSelect?.(id);
|
|
78
80
|
}
|
|
79
81
|
if (e.key === 'Backspace' || e.key === 'Delete') {
|
|
80
|
-
onRemove
|
|
82
|
+
onRemove?.(id);
|
|
81
83
|
}
|
|
82
84
|
};
|
|
83
|
-
return (_jsxs(BareButton,
|
|
84
|
-
_jsx(BareButton, Object.assign({ tabIndex: '-1', onClick: handleCloseClick }, { children: _jsx(Icon, { name: 'times' }, void 0) }), void 0)] }), void 0));
|
|
85
|
+
return (_jsxs(BareButton, { role: 'button', tabIndex: '0', as: StyledSelectable, ref: consolidatedRef, onClick: handleClick, onKeyUp: handleKeyUp, ...restProps, children: [children, _jsx(BareButton, { tabIndex: '-1', onClick: handleCloseClick, children: _jsx(Icon, { name: 'times' }, void 0) }, void 0)] }, void 0));
|
|
85
86
|
});
|
|
86
87
|
export default Selectable;
|
|
87
88
|
//# sourceMappingURL=Selection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Selection.js","sourceRoot":"","sources":["../../../src/components/Badges/Selection.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkB,UAAU,EAAuC,MAAM,OAAO,CAAC;AACxF,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG/C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,UAAU,EAAE,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Selection.js","sourceRoot":"","sources":["../../../src/components/Badges/Selection.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkB,UAAU,EAAuC,MAAM,OAAO,C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C,CAAC;QACb,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,EAAE;YACrB,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;SAChB;QAED,IAAI,CAAC,CAAC,GAAG,KAAK,WAAW,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ,EAAE;YAC/C,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;SAChB;IACH,CAAC,CAAC;IAEF,OAAO,CACL,MAAC,UAAU,IACT,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAC,GAAG,EACZ,EAAE,EAAE,gBAAgB,EACpB,GAAG,EAAE,eAAe,EACpB,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,WAAW,KAChB,SAAS,aAEZ,QAAQ,EACT,KAAC,UAAU,IAAC,QAAQ,EAAC,IAAI,EAAC,OAAO,EAAE,gBAAgB,YACjD,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,WAAG,WACV,YACF,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { FC, MouseEvent, forwardRef, PropsWithoutRef, Ref, KeyboardEvent } from 'react';\nimport styled, { css } from 'styled-components';\nimport { mix, transparentize } from 'polished';\n\nimport { ForwardProps } from '../../types';\nimport { tryCatch } from '../../utils/utils';\nimport BareButton, { StyledBareButton } from '../Button/BareButton';\nimport Icon, { registerIcon, StyledIcon } from '../Icon';\nimport * as timesIcon from '../Icon/icons/times.icon';\nimport { useConsolidatedRef } from '../../hooks';\nimport { FormControlProps } from '../FormControl';\n\nregisterIcon(timesIcon);\n\nexport interface SelectableProps {\n /** An id that is used by the onSelect and onRemove functions if they are provided. */\n id: string;\n /** Takes an ID that represents the Badge. This function is called when the Badge is clicked. */\n onSelect?: (id: string) => void;\n /** Takes an ID that represents the Badge. This function is called when the Badge is closed by clicking the X. */\n onRemove?: (id: string) => void;\n /** The content of the Badge. */\n children: string;\n /** Makes the input non editable and non clickable. The browser defaults to false. */\n readOnly?: FormControlProps['readOnly'];\n /** Event handler called when the Badge is clicked. */\n onClick?: (event: MouseEvent) => void;\n /** Event handler fired on every keyup event. */\n onKeyUp?: (event: KeyboardEvent) => void;\n}\n\nexport const StyledSelectable = styled.div(props => {\n const { foreground, background } = props.theme.components.badges.selectable.base;\n const { dark } = props.theme.base.palette;\n const borderRadius = props.theme.base['border-radius'];\n const { spacing } = props.theme.base;\n\n const displayBackground = tryCatch(() => mix(0.15, background, '#ffffff'));\n const hoverBorder = tryCatch(() => mix(0.3, background, '#ffffff'));\n const boxShadowColor = tryCatch(() => transparentize(0.45, dark));\n\n const height = 1.125;\n return css`\n background: ${displayBackground};\n border: 0 solid transparent;\n border-radius: calc(${height} * ${borderRadius});\n color: ${foreground};\n cursor: default;\n display: inline-flex;\n align-items: center;\n font-size: 0.75rem;\n height: ${height}rem;\n padding: 0 ${spacing};\n min-width: max-content;\n line-height: 1;\n\n &:hover {\n color: ${props.theme.base.palette.interactive};\n box-shadow: inset 0 0 0 0.0625rem ${hoverBorder};\n\n ${StyledBareButton} {\n color: ${props.theme.base.palette.interactive};\n }\n }\n\n &:active {\n box-shadow: inset 0 0 0 0.0625rem ${background};\n }\n\n &:focus {\n color: ${props.theme.base.palette.interactive};\n box-shadow: 0 0 0.5rem -0.125rem ${boxShadowColor}, inset 0 0 0 0.125rem ${background};\n outline: none;\n\n ${StyledBareButton} {\n color: ${props.theme.base.palette.interactive};\n }\n }\n\n ${StyledIcon} {\n margin-inline-start: ${spacing};\n height: 1em;\n width: 1em;\n }\n `;\n});\n\nconst Selectable: FC<SelectableProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<SelectableProps>, ref: Ref<HTMLButtonElement>) => {\n const consolidatedRef = useConsolidatedRef(ref);\n const { id, onSelect, onRemove, children, onClick, onKeyUp, ...restProps } = props;\n\n const handleClick = (e: MouseEvent<HTMLDivElement>) => {\n onClick?.(e);\n onSelect?.(id);\n };\n\n const handleCloseClick = (e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n onRemove?.(id);\n };\n\n const handleKeyUp = (e: KeyboardEvent) => {\n onKeyUp?.(e);\n if (e.key === 'Enter') {\n onSelect?.(id);\n }\n\n if (e.key === 'Backspace' || e.key === 'Delete') {\n onRemove?.(id);\n }\n };\n\n return (\n <BareButton\n role='button'\n tabIndex='0'\n as={StyledSelectable}\n ref={consolidatedRef}\n onClick={handleClick}\n onKeyUp={handleKeyUp}\n {...restProps}\n >\n {children}\n <BareButton tabIndex='-1' onClick={handleCloseClick}>\n <Icon name='times' />\n </BareButton>\n </BareButton>\n );\n }\n);\n\nexport default Selectable;\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import { FC, ReactText } from 'react';
|
|
2
2
|
import { ForwardProps } from '../../types';
|
|
3
3
|
export interface StatusProps {
|
|
4
4
|
/** Determines the color to render the Badge as. This color is derived from the Theme. */
|
|
5
5
|
variant: 'success' | 'urgent' | 'warn' | 'pending' | 'info';
|
|
6
6
|
/** The content of the Badge, transformed to uppercase. */
|
|
7
|
-
children:
|
|
7
|
+
children: ReactText;
|
|
8
8
|
}
|
|
9
9
|
export declare const StyledStatus: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, StatusProps, never>;
|
|
10
10
|
declare const Status: FC<StatusProps & ForwardProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Status.d.ts","sourceRoot":"","sources":["../../../src/components/Badges/Status.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"Status.d.ts","sourceRoot":"","sources":["../../../src/components/Badges/Status.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAA+B,SAAS,EAAO,MAAM,OAAO,CAAC;AAMxE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,MAAM,WAAW,WAAW;IAC1B,yFAAyF;IACzF,OAAO,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;IAC5D,0DAA0D;IAC1D,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,YAAY,mHAqBvB,CAAC;AAIH,QAAA,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,GAAG,YAAY,CAW1C,CAAC;AAMF,eAAe,MAAM,CAAC"}
|
|
@@ -27,7 +27,7 @@ export const StyledStatus = styled.span(props => {
|
|
|
27
27
|
});
|
|
28
28
|
StyledStatus.defaultProps = defaultThemeProp;
|
|
29
29
|
const Status = forwardRef(({ variant, children, ...restProps }, ref) => {
|
|
30
|
-
return (_jsx(StyledStatus,
|
|
30
|
+
return (_jsx(StyledStatus, { ...restProps, variant: variant, ref: ref, children: children }, void 0));
|
|
31
31
|
});
|
|
32
32
|
Status.defaultProps = {
|
|
33
33
|
variant: 'info'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Status.js","sourceRoot":"","sources":["../../../src/components/Badges/Status.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"Status.js","sourceRoot":"","sources":["../../../src/components/Badges/Status.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,UAAU,EAAmC,MAAM,OAAO,CAAC;AACxE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AASvC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAc,KAAK,CAAC,EAAE;IAC3D,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;IACrC,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACvD,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC;IAEjD,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;IACrD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAElG,OAAO,GAAG,CAAA;wBACY,UAAU;iCACD,YAAY;aAChC,UAAU;wCACiB,MAAM;;iBAE7B,QAAQ,CAAC,GAAG;;wBAEL,OAAO;iBACd,OAAO;;GAErB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,YAAY,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE7C,MAAM,MAAM,GAAmC,UAAU,CACvD,CACE,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAgC,EACjE,GAAyB,EACzB,EAAE;IACF,OAAO,CACL,KAAC,YAAY,OAAK,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,YACpD,QAAQ,WACI,CAChB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,YAAY,GAAG;IACpB,OAAO,EAAE,MAAM;CAChB,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { FC, forwardRef, PropsWithoutRef, ReactText, Ref } from 'react';\nimport styled, { css } from 'styled-components';\nimport { rgba } from 'polished';\n\nimport { calculateFontSize } from '../../styles';\nimport { defaultThemeProp } from '../../theme';\nimport { ForwardProps } from '../../types';\nimport { tryCatch } from '../../utils';\n\nexport interface StatusProps {\n /** Determines the color to render the Badge as. This color is derived from the Theme. */\n variant: 'success' | 'urgent' | 'warn' | 'pending' | 'info';\n /** The content of the Badge, transformed to uppercase. */\n children: ReactText;\n}\n\nexport const StyledStatus = styled.span<StatusProps>(props => {\n const { spacing } = props.theme.base;\n const borderRadius = props.theme.base['border-radius'];\n const { status } = props.theme.components.badges;\n\n const { background, foreground } = status[props.variant];\n const shadow = tryCatch(() => rgba(foreground, 0.1));\n const fontSize = calculateFontSize(props.theme.base['font-size'], props.theme.base['font-scale']);\n\n return css`\n background-color: ${background};\n border-radius: calc(0.25 * ${borderRadius});\n color: ${foreground};\n box-shadow: inset 0 0 0 0.0625rem ${shadow};\n display: inline-block;\n font-size: ${fontSize.xxs};\n font-weight: bold;\n line-height: calc(${spacing} * 2.5);\n padding: 0 ${spacing};\n text-transform: uppercase;\n `;\n});\n\nStyledStatus.defaultProps = defaultThemeProp;\n\nconst Status: FC<StatusProps & ForwardProps> = forwardRef(\n (\n { variant, children, ...restProps }: PropsWithoutRef<StatusProps>,\n ref: Ref<HTMLSpanElement>\n ) => {\n return (\n <StyledStatus {...restProps} variant={variant} ref={ref}>\n {children}\n </StyledStatus>\n );\n }\n);\n\nStatus.defaultProps = {\n variant: 'info'\n};\n\nexport default Status;\n"]}
|
|
@@ -36,7 +36,7 @@ export const StyledTag = styled.span(props => {
|
|
|
36
36
|
});
|
|
37
37
|
StyledTag.defaultProps = defaultThemeProp;
|
|
38
38
|
const Tag = forwardRef(({ children, ...restProps }, ref) => {
|
|
39
|
-
return (_jsx(StyledTag,
|
|
39
|
+
return (_jsx(StyledTag, { ...restProps, tabIndex: 0, ref: ref, children: children }, void 0));
|
|
40
40
|
});
|
|
41
41
|
export default Tag;
|
|
42
42
|
//# sourceMappingURL=Tag.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../../src/components/Badges/Tag.tsx"],"names":[],"mappings":";AAAA,OAAO,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A6B,EAAE,GAAyB,EAAE,EAAE;IACnF,OAAO,CACL,KAAC,SAAS,OAAK,SAAS,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,YAC5C,QAAQ,WACC,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,GAAG,CAAC","sourcesContent":["import { FC, forwardRef, Ref, PropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\nimport { mix } from 'polished';\n\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils/utils';\nimport { ForwardProps } from '../../types';\n\nexport interface TagProps {\n /** The content of the Badge. */\n children: string;\n}\n\nexport const StyledTag = styled.span(props => {\n const borderRadius = props.theme.base['border-radius'];\n const { spacing } = props.theme.base;\n const { foreground, background } = props.theme.components.badges.tag;\n\n const borderColor = tryCatch(() =>\n mix(0.85, props.theme.base.palette['primary-background'], background)\n );\n const boxShadow = props.theme.base.shadow.focus;\n\n return css`\n border: 0.0625rem solid ${borderColor};\n border-radius: calc(0.25 * ${borderRadius});\n color: ${foreground};\n display: inline-block;\n font-size: 0.75rem;\n padding: 0 ${spacing};\n\n &:hover {\n border-color: ${background};\n }\n\n &:focus {\n border-color: ${background};\n box-shadow: ${boxShadow};\n outline: none;\n }\n\n &:active {\n border: 0.0625rem solid ${borderColor};\n box-shadow: none;\n }\n `;\n});\n\nStyledTag.defaultProps = defaultThemeProp;\n\nconst Tag: FC<TagProps & ForwardProps> = forwardRef(\n ({ children, ...restProps }: PropsWithoutRef<TagProps>, ref: Ref<HTMLSpanElement>) => {\n return (\n <StyledTag {...restProps} tabIndex={0} ref={ref}>\n {children}\n </StyledTag>\n );\n }\n);\n\nexport default Tag;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FunctionComponent, ReactNode, Ref } from 'react';
|
|
2
|
-
import { BaseProps, ForwardProps } from '../../types';
|
|
3
|
-
export interface BannerProps extends BaseProps {
|
|
2
|
+
import { BaseProps, ForwardProps, NoChildrenProp } from '../../types';
|
|
3
|
+
export interface BannerProps extends BaseProps, NoChildrenProp {
|
|
4
4
|
/** Controls the styling of the Banner. */
|
|
5
5
|
variant: 'urgent' | 'success' | 'warning' | 'info';
|
|
6
6
|
/** Heading text for the Banner. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.d.ts","sourceRoot":"","sources":["../../../src/components/Banner/Banner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAA+B,GAAG,EAAE,MAAM,OAAO,CAAC;AAIvF,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Banner.d.ts","sourceRoot":"","sources":["../../../src/components/Banner/Banner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAA+B,GAAG,EAAE,MAAM,OAAO,CAAC;AAIvF,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAYtE,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,cAAc;IAC5D,0CAA0C;IAC1C,OAAO,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;IACnD,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACrD,gEAAgE;IAChE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,yEAAyE;IACzE,EAAE,EAAE,MAAM,CAAC;IACX,iIAAiI;IACjI,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,oBAAoB;YAAuB,OAAO;SAS7D,CAAC;AAIH,eAAO,MAAM,mBAAmB;gBAA4B,OAAO;SAmBjE,CAAC;AAIH,eAAO,MAAM,mBAAmB;YAAuB,OAAO;SAS5D,CAAC;AAIH,eAAO,MAAM,yBAAyB,yGAQpC,CAAC;AAIH,eAAO,MAAM,yBAAyB,qKAAmB,CAAC;AAE1D,eAAO,MAAM,kBAAkB,mIAkB7B,CAAC;AAIH,eAAO,MAAM,YAAY,yGAKvB,CAAC;AAIH,QAAA,MAAM,MAAM,EAAE,iBAAiB,CAAC,WAAW,GAAG,YAAY,CAqGzD,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -3,12 +3,14 @@ import { forwardRef } from 'react';
|
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
4
|
import { getContrast, readableColor } from 'polished';
|
|
5
5
|
import { defaultThemeProp } from '../../theme';
|
|
6
|
-
import Icon from '../Icon';
|
|
6
|
+
import Icon, { registerIcon } from '../Icon';
|
|
7
|
+
import * as timesIcon from '../Icon/icons/times.icon';
|
|
7
8
|
import Button from '../Button';
|
|
8
9
|
import { tryCatch } from '../../utils';
|
|
9
10
|
import { useDirection, useI18n } from '../../hooks';
|
|
10
11
|
import Flex from '../Flex';
|
|
11
12
|
import Text from '../Text';
|
|
13
|
+
registerIcon(timesIcon);
|
|
12
14
|
export const StyledBannerMessages = styled.ul(({ theme, inline }) => {
|
|
13
15
|
return css `
|
|
14
16
|
list-style-position: inside;
|
|
@@ -105,17 +107,13 @@ const Banner = forwardRef(({ variant, heading, headingTag = 'h2', messages, onDi
|
|
|
105
107
|
bannerIcon = 'warn';
|
|
106
108
|
}
|
|
107
109
|
const t = useI18n();
|
|
108
|
-
return (_jsxs(Flex,
|
|
109
|
-
_jsxs(Flex, Object.assign({ container: singleLine ? { alignItems: 'center' } : { direction: 'column', gap: 1 }, item: { grow: 1 }, as: StyledBannerContent, hasDismiss: hasDismiss }, { children: [heading && (_jsx(Text, Object.assign({ variant: 'h4', as: headingTag }, { children: heading }), void 0)),
|
|
110
|
-
_jsx(StyledBannerMessages, Object.assign({ inline: inline }, { children: messages.map((msg, index) => (
|
|
110
|
+
return (_jsxs(Flex, { ...restProps, container: true, as: StyledBanner, role: role, "aria-live": ariaLive, id: id, ref: ref, children: [_jsx(Flex, { container: { justify: 'center', alignItems: 'center' }, item: { shrink: 0 }, as: StyledBannerStatus, variant: variant, children: _jsx(Icon, { name: bannerIcon }, void 0) }, void 0), _jsxs(Flex, { container: singleLine ? { alignItems: 'center' } : { direction: 'column', gap: 1 }, item: { grow: 1 }, as: StyledBannerContent, hasDismiss: hasDismiss, children: [heading && (_jsx(Text, { variant: 'h4', as: headingTag, children: heading }, void 0)), _jsx(StyledBannerMessages, { inline: inline, children: messages.map((msg, index) => (
|
|
111
111
|
// eslint-disable-next-line react/no-array-index-key
|
|
112
|
-
_jsx(StyledBannerMessage,
|
|
113
|
-
action] }), void 0),
|
|
114
|
-
onDismiss && (_jsx(Flex, Object.assign({ container: {
|
|
112
|
+
_jsx(StyledBannerMessage, { inline: inline, children: msg }, `${msg}+${index}`))) }, void 0), action] }, void 0), onDismiss && (_jsx(Flex, { container: {
|
|
115
113
|
direction: 'column',
|
|
116
114
|
justify: singleLine ? 'center' : undefined,
|
|
117
115
|
pad: [singleLine ? 0.5 : 1, 0.5, 0.5, 0]
|
|
118
|
-
}, as: StyledBannerDismissColumn
|
|
116
|
+
}, as: StyledBannerDismissColumn, children: _jsx(StyledBannerDismissButton, { variant: 'simple', icon: true, onClick: () => onDismiss(id), "aria-label": t('banner_dismiss_button_label_a11y'), children: _jsx(Icon, { name: 'times' }, void 0) }, void 0) }, void 0))] }, void 0));
|
|
119
117
|
});
|
|
120
118
|
export default Banner;
|
|
121
119
|
//# sourceMappingURL=Banner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.js","sourceRoot":"","sources":["../../../src/components/Banner/Banner.tsx"],"names":[],"mappings":";AA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O,EAAC,IAAI,EAAC,EAAE,EAAE,UAAU,gBAC9B,OAAO,YACH,CACR;oBAED,KAAC,oBAAoB,kBAAC,MAAM,EAAE,MAAM,gBACjC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC;wBAC5B,oDAAoD;wBACpD,KAAC,mBAAmB,kBAAyB,MAAM,EAAE,MAAM,gBACxD,GAAG,KADoB,GAAG,GAAG,IAAI,KAAK,EAAE,CAErB,CACvB,CAAC,YACmB;oBAEtB,MAAM,aACF;YAEN,SAAS,IAAI,CACZ,KAAC,IAAI,kBACH,SAAS,EAAE;oBACT,SAAS,EAAE,QAAQ;oBACnB,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;oBAC1C,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;iBACzC,EACD,EAAE,EAAE,yBAAyB,gBAE7B,KAAC,yBAAyB,kBACxB,OAAO,EAAC,QAAQ,EAChB,IAAI,QACJ,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,gBAChB,CAAC,CAAC,kCAAkC,CAAC,gBAEjD,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,WAAG,YACK,YACvB,CACR,aACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { FunctionComponent, ReactNode, forwardRef, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\nimport { getContrast, readableColor } from 'polished';\n\nimport { BaseProps, ForwardProps } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Icon from '../Icon';\nimport Button from '../Button';\nimport { tryCatch } from '../../utils';\nimport { useDirection, useI18n } from '../../hooks';\nimport Flex from '../Flex';\nimport Text from '../Text';\n\nexport interface BannerProps extends BaseProps {\n /** Controls the styling of the Banner. */\n variant: 'urgent' | 'success' | 'warning' | 'info';\n /** Heading text for the Banner. */\n heading?: string;\n /**\n * The heading tag to render the provided heading as. This is agnostic to the styling of the heading.\n * @default \"h2\"\n */\n headingTag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n /** Pass one or more descriptive messages to inform the user. */\n messages: string[];\n /** ID for the Banner. Used both as onDismiss callback arg and DOM id. */\n id: string;\n /** Link or Button provided to the user for next steps. Link should use regular href and Button should use an onClick handler. */\n action?: ReactNode;\n /** Callback when user explicitly dismisses the Banner. */\n onDismiss?: (id: string) => void;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledBannerMessages = styled.ul<{ inline: boolean }>(({ theme, inline }) => {\n return css`\n list-style-position: inside;\n ${inline &&\n css`\n display: inline-block;\n margin-inline-end: ${theme.base.spacing};\n `}\n `;\n});\n\nStyledBannerMessages.defaultProps = defaultThemeProp;\n\nexport const StyledBannerContent = styled.div<{ hasDismiss: boolean }>(({ theme, hasDismiss }) => {\n const { end } = useDirection();\n return css`\n position: relative;\n padding: calc(1.5 * ${theme.base.spacing});\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n border-inline-start: none;\n border-top-${end}-radius: ${theme.components.card['border-radius']};\n border-bottom-${end}-radius: ${theme.components.card['border-radius']};\n\n ${\n hasDismiss &&\n css`\n border-inline-end: none;\n padding-inline-end: calc(0.75 * ${theme.base.spacing});\n border-radius: 0;\n `\n }\n `;\n});\n\nStyledBannerContent.defaultProps = defaultThemeProp;\n\nexport const StyledBannerMessage = styled.li<{ inline: boolean }>(({ inline, theme }) => {\n return css`\n color: ${theme.base.palette['foreground-color']};\n ${inline &&\n css`\n display: inline-block;\n margin-inline-end: ${theme.base.spacing};\n `}\n `;\n});\n\nStyledBannerMessage.defaultProps = defaultThemeProp;\n\nexport const StyledBannerDismissColumn = styled.div(({ theme }) => {\n const { end } = useDirection();\n return css`\n border-top-${end}-radius: ${theme.components.card['border-radius']};\n border-bottom-${end}-radius: ${theme.components.card['border-radius']};\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n border-inline-start: none;\n `;\n});\n\nStyledBannerDismissColumn.defaultProps = defaultThemeProp;\n\nexport const StyledBannerDismissButton = styled(Button)``;\n\nexport const StyledBannerStatus = styled.div<Pick<BannerProps, 'variant'>>(({ variant, theme }) => {\n const { background: bg } = theme.components.banner[variant];\n const color = tryCatch(() =>\n getContrast(bg, theme.base.palette['primary-background']) >= 3\n ? theme.base.palette['primary-background']\n : readableColor(bg)\n );\n\n const { start } = useDirection();\n\n return css`\n background-color: ${bg};\n width: 3.125rem;\n color: ${color};\n border-top-${start}-radius: ${theme.components.card['border-radius']};\n border-bottom-${start}-radius: ${theme.components.card['border-radius']};\n font-size: 1.25rem;\n `;\n});\n\nStyledBannerStatus.defaultProps = defaultThemeProp;\n\nexport const StyledBanner = styled.div(({ theme }) => {\n return css`\n background: ${theme.components.card.background};\n border-radius: ${theme.components.card['border-radius']};\n `;\n});\n\nStyledBanner.defaultProps = defaultThemeProp;\n\nconst Banner: FunctionComponent<BannerProps & ForwardProps> = forwardRef(\n (\n {\n variant,\n heading,\n headingTag = 'h2',\n messages,\n onDismiss,\n action,\n id,\n ...restProps\n }: PropsWithoutRef<BannerProps>,\n ref: BannerProps['ref']\n ) => {\n const inline = messages.length === 1;\n const singleLine = inline && !heading;\n const hasDismiss = !!onDismiss;\n\n let bannerIcon = 'warn-solid';\n let role: string | undefined = 'alert';\n let ariaLive = 'assertive';\n\n if (variant === 'info') {\n bannerIcon = 'bulb-solid';\n ariaLive = 'polite';\n role = undefined;\n } else if (variant === 'success') {\n bannerIcon = 'check';\n ariaLive = 'polite';\n role = undefined;\n } else if (variant === 'warning') {\n bannerIcon = 'warn';\n }\n\n const t = useI18n();\n\n return (\n <Flex\n {...restProps}\n container\n as={StyledBanner}\n role={role}\n aria-live={ariaLive}\n id={id}\n ref={ref}\n >\n <Flex\n container={{ justify: 'center', alignItems: 'center' }}\n item={{ shrink: 0 }}\n as={StyledBannerStatus}\n variant={variant}\n >\n <Icon name={bannerIcon} />\n </Flex>\n\n <Flex\n container={singleLine ? { alignItems: 'center' } : { direction: 'column', gap: 1 }}\n item={{ grow: 1 }}\n as={StyledBannerContent}\n hasDismiss={hasDismiss}\n >\n {heading && (\n <Text variant='h4' as={headingTag}>\n {heading}\n </Text>\n )}\n\n <StyledBannerMessages inline={inline}>\n {messages.map((msg, index) => (\n // eslint-disable-next-line react/no-array-index-key\n <StyledBannerMessage key={`${msg}+${index}`} inline={inline}>\n {msg}\n </StyledBannerMessage>\n ))}\n </StyledBannerMessages>\n\n {action}\n </Flex>\n\n {onDismiss && (\n <Flex\n container={{\n direction: 'column',\n justify: singleLine ? 'center' : undefined,\n pad: [singleLine ? 0.5 : 1, 0.5, 0.5, 0]\n }}\n as={StyledBannerDismissColumn}\n >\n <StyledBannerDismissButton\n variant='simple'\n icon\n onClick={() => onDismiss(id)}\n aria-label={t('banner_dismiss_button_label_a11y')}\n >\n <Icon name='times' />\n </StyledBannerDismissButton>\n </Flex>\n )}\n </Flex>\n );\n }\n);\n\nexport default Banner;\n"]}
|
|
1
|
+
{"version":3,"file":"Banner.js","sourceRoot":"","sources":["../../../src/components/Banner/Banner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAgC,UAAU,EAAwB,MAAM,OAAO,CAAC;AACvF,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAC;AACtD,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,YAAY,EAA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AI,CACZ,KAAC,IAAI,IACH,SAAS,EAAE;oBACT,SAAS,EAAE,QAAQ;oBACnB,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;oBAC1C,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;iBACzC,EACD,EAAE,EAAE,yBAAyB,YAE7B,KAAC,yBAAyB,IACxB,OAAO,EAAC,QAAQ,EAChB,IAAI,QACJ,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,gBAChB,CAAC,CAAC,kCAAkC,CAAC,YAEjD,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,WAAG,WACK,WACvB,CACR,YACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { FunctionComponent, ReactNode, forwardRef, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\nimport { getContrast, readableColor } from 'polished';\n\nimport { BaseProps, ForwardProps, NoChildrenProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Icon, { registerIcon } from '../Icon';\nimport * as timesIcon from '../Icon/icons/times.icon';\nimport Button from '../Button';\nimport { tryCatch } from '../../utils';\nimport { useDirection, useI18n } from '../../hooks';\nimport Flex from '../Flex';\nimport Text from '../Text';\n\nregisterIcon(timesIcon);\n\nexport interface BannerProps extends BaseProps, NoChildrenProp {\n /** Controls the styling of the Banner. */\n variant: 'urgent' | 'success' | 'warning' | 'info';\n /** Heading text for the Banner. */\n heading?: string;\n /**\n * The heading tag to render the provided heading as. This is agnostic to the styling of the heading.\n * @default \"h2\"\n */\n headingTag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n /** Pass one or more descriptive messages to inform the user. */\n messages: string[];\n /** ID for the Banner. Used both as onDismiss callback arg and DOM id. */\n id: string;\n /** Link or Button provided to the user for next steps. Link should use regular href and Button should use an onClick handler. */\n action?: ReactNode;\n /** Callback when user explicitly dismisses the Banner. */\n onDismiss?: (id: string) => void;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledBannerMessages = styled.ul<{ inline: boolean }>(({ theme, inline }) => {\n return css`\n list-style-position: inside;\n ${inline &&\n css`\n display: inline-block;\n margin-inline-end: ${theme.base.spacing};\n `}\n `;\n});\n\nStyledBannerMessages.defaultProps = defaultThemeProp;\n\nexport const StyledBannerContent = styled.div<{ hasDismiss: boolean }>(({ theme, hasDismiss }) => {\n const { end } = useDirection();\n return css`\n position: relative;\n padding: calc(1.5 * ${theme.base.spacing});\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n border-inline-start: none;\n border-top-${end}-radius: ${theme.components.card['border-radius']};\n border-bottom-${end}-radius: ${theme.components.card['border-radius']};\n\n ${\n hasDismiss &&\n css`\n border-inline-end: none;\n padding-inline-end: calc(0.75 * ${theme.base.spacing});\n border-radius: 0;\n `\n }\n `;\n});\n\nStyledBannerContent.defaultProps = defaultThemeProp;\n\nexport const StyledBannerMessage = styled.li<{ inline: boolean }>(({ inline, theme }) => {\n return css`\n color: ${theme.base.palette['foreground-color']};\n ${inline &&\n css`\n display: inline-block;\n margin-inline-end: ${theme.base.spacing};\n `}\n `;\n});\n\nStyledBannerMessage.defaultProps = defaultThemeProp;\n\nexport const StyledBannerDismissColumn = styled.div(({ theme }) => {\n const { end } = useDirection();\n return css`\n border-top-${end}-radius: ${theme.components.card['border-radius']};\n border-bottom-${end}-radius: ${theme.components.card['border-radius']};\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n border-inline-start: none;\n `;\n});\n\nStyledBannerDismissColumn.defaultProps = defaultThemeProp;\n\nexport const StyledBannerDismissButton = styled(Button)``;\n\nexport const StyledBannerStatus = styled.div<Pick<BannerProps, 'variant'>>(({ variant, theme }) => {\n const { background: bg } = theme.components.banner[variant];\n const color = tryCatch(() =>\n getContrast(bg, theme.base.palette['primary-background']) >= 3\n ? theme.base.palette['primary-background']\n : readableColor(bg)\n );\n\n const { start } = useDirection();\n\n return css`\n background-color: ${bg};\n width: 3.125rem;\n color: ${color};\n border-top-${start}-radius: ${theme.components.card['border-radius']};\n border-bottom-${start}-radius: ${theme.components.card['border-radius']};\n font-size: 1.25rem;\n `;\n});\n\nStyledBannerStatus.defaultProps = defaultThemeProp;\n\nexport const StyledBanner = styled.div(({ theme }) => {\n return css`\n background: ${theme.components.card.background};\n border-radius: ${theme.components.card['border-radius']};\n `;\n});\n\nStyledBanner.defaultProps = defaultThemeProp;\n\nconst Banner: FunctionComponent<BannerProps & ForwardProps> = forwardRef(\n (\n {\n variant,\n heading,\n headingTag = 'h2',\n messages,\n onDismiss,\n action,\n id,\n ...restProps\n }: PropsWithoutRef<BannerProps>,\n ref: BannerProps['ref']\n ) => {\n const inline = messages.length === 1;\n const singleLine = inline && !heading;\n const hasDismiss = !!onDismiss;\n\n let bannerIcon = 'warn-solid';\n let role: string | undefined = 'alert';\n let ariaLive = 'assertive';\n\n if (variant === 'info') {\n bannerIcon = 'bulb-solid';\n ariaLive = 'polite';\n role = undefined;\n } else if (variant === 'success') {\n bannerIcon = 'check';\n ariaLive = 'polite';\n role = undefined;\n } else if (variant === 'warning') {\n bannerIcon = 'warn';\n }\n\n const t = useI18n();\n\n return (\n <Flex\n {...restProps}\n container\n as={StyledBanner}\n role={role}\n aria-live={ariaLive}\n id={id}\n ref={ref}\n >\n <Flex\n container={{ justify: 'center', alignItems: 'center' }}\n item={{ shrink: 0 }}\n as={StyledBannerStatus}\n variant={variant}\n >\n <Icon name={bannerIcon} />\n </Flex>\n\n <Flex\n container={singleLine ? { alignItems: 'center' } : { direction: 'column', gap: 1 }}\n item={{ grow: 1 }}\n as={StyledBannerContent}\n hasDismiss={hasDismiss}\n >\n {heading && (\n <Text variant='h4' as={headingTag}>\n {heading}\n </Text>\n )}\n\n <StyledBannerMessages inline={inline}>\n {messages.map((msg, index) => (\n // eslint-disable-next-line react/no-array-index-key\n <StyledBannerMessage key={`${msg}+${index}`} inline={inline}>\n {msg}\n </StyledBannerMessage>\n ))}\n </StyledBannerMessages>\n\n {action}\n </Flex>\n\n {onDismiss && (\n <Flex\n container={{\n direction: 'column',\n justify: singleLine ? 'center' : undefined,\n pad: [singleLine ? 0.5 : 1, 0.5, 0.5, 0]\n }}\n as={StyledBannerDismissColumn}\n >\n <StyledBannerDismissButton\n variant='simple'\n icon\n onClick={() => onDismiss(id)}\n aria-label={t('banner_dismiss_button_label_a11y')}\n >\n <Icon name='times' />\n </StyledBannerDismissButton>\n </Flex>\n )}\n </Flex>\n );\n }\n);\n\nexport default Banner;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FunctionComponent, Ref } from 'react';
|
|
2
|
-
import { BaseProps, ForwardProps } from '../../types';
|
|
3
|
-
export interface BooleanDisplayProps extends BaseProps {
|
|
2
|
+
import { BaseProps, ForwardProps, NoChildrenProp } from '../../types';
|
|
3
|
+
export interface BooleanDisplayProps extends BaseProps, NoChildrenProp {
|
|
4
4
|
/** Boolean value */
|
|
5
5
|
value?: boolean;
|
|
6
6
|
/** The text to be displayed when value is true.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BooleanDisplay.d.ts","sourceRoot":"","sources":["../../../src/components/Boolean/BooleanDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAK5E,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"BooleanDisplay.d.ts","sourceRoot":"","sources":["../../../src/components/Boolean/BooleanDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAK5E,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGtE,MAAM,WAAW,mBAAoB,SAAQ,SAAS,EAAE,cAAc;IACpE,oBAAoB;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC;CAC5B;AAYD,QAAA,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,GAAG,YAAY,CAyBzE,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -18,8 +18,7 @@ const BooleanDisplay = forwardRef(({ value, trueLabel, falseLabel, ...restProps
|
|
|
18
18
|
const displayText = value
|
|
19
19
|
? trueLabel || t('boolean_display_true_label')
|
|
20
20
|
: falseLabel || t('boolean_display_false_label');
|
|
21
|
-
return (_jsx(StyledBooleanDisplay,
|
|
22
|
-
displayText] }, void 0)) : (_jsx("span", Object.assign({ "aria-hidden": 'true' }, { children: "\u2013\u2013" }), void 0)) }), void 0));
|
|
21
|
+
return (_jsx(StyledBooleanDisplay, { ref: ref, ...restProps, children: value !== undefined ? (_jsxs(_Fragment, { children: [_jsx(Icon, { name: iconName }, void 0), displayText] }, void 0)) : (_jsx("span", { "aria-hidden": 'true', children: "\u2013\u2013" }, void 0)) }, void 0));
|
|
23
22
|
});
|
|
24
23
|
export default BooleanDisplay;
|
|
25
24
|
//# sourceMappingURL=BooleanDisplay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BooleanDisplay.js","sourceRoot":"","sources":["../../../src/components/Boolean/BooleanDisplay.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA2C,MAAM,OAAO,CAAC;AAC5E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,gB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E,EAAE;IACrD,OAAO,GAAG,CAAA;MACN,UAAU;2BACW,KAAK,CAAC,IAAI,CAAC,OAAO;;GAE1C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,oBAAoB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAErD,MAAM,cAAc,GAA0D,UAAU,CACtF,CACE,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,SAAS,EAAwC,EACpF,GAA+B,EAC/B,EAAE;IACF,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;IAC3C,MAAM,WAAW,GAAG,KAAK;QACvB,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,4BAA4B,CAAC;QAC9C,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,6BAA6B,CAAC,CAAC;IAEnD,OAAO,CACL,KAAC,oBAAoB,IAAC,GAAG,EAAE,GAAG,KAAM,SAAS,YAC1C,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,CACrB,8BACE,KAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,WAAI,EACvB,WAAW,YACX,CACJ,CAAC,CAAC,CAAC,CACF,8BAAkB,MAAM,qCAAsB,CAC/C,WACoB,CACxB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { useI18n } from '../../hooks';\nimport { defaultThemeProp } from '../../theme';\nimport { BaseProps, ForwardProps, NoChildrenProp } from '../../types';\nimport Icon, { StyledIcon } from '../Icon';\n\nexport interface BooleanDisplayProps extends BaseProps, NoChildrenProp {\n /** Boolean value */\n value?: boolean;\n /** The text to be displayed when value is true.\n * @default \"Yes\"\n */\n trueLabel?: string;\n /** The text to be displayed when value is false.\n * @default \"No\"\n */\n falseLabel?: string;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLSpanElement>;\n}\n\nconst StyledBooleanDisplay = styled.span(({ theme }) => {\n return css`\n ${StyledIcon} {\n margin-inline-end: ${theme.base.spacing};\n }\n `;\n});\n\nStyledBooleanDisplay.defaultProps = defaultThemeProp;\n\nconst BooleanDisplay: FunctionComponent<BooleanDisplayProps & ForwardProps> = forwardRef(\n (\n { value, trueLabel, falseLabel, ...restProps }: PropsWithoutRef<BooleanDisplayProps>,\n ref: BooleanDisplayProps['ref']\n ) => {\n const t = useI18n();\n\n const iconName = value ? 'check' : 'times';\n const displayText = value\n ? trueLabel || t('boolean_display_true_label')\n : falseLabel || t('boolean_display_false_label');\n\n return (\n <StyledBooleanDisplay ref={ref} {...restProps}>\n {value !== undefined ? (\n <>\n <Icon name={iconName} />\n {displayText}\n </>\n ) : (\n <span aria-hidden='true'>––</span>\n )}\n </StyledBooleanDisplay>\n );\n }\n);\n\nexport default BooleanDisplay;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FunctionComponent, Ref } from 'react';
|
|
2
|
-
import { BaseProps, ForwardProps } from '../../types';
|
|
2
|
+
import { BaseProps, ForwardProps, NoChildrenProp } from '../../types';
|
|
3
3
|
import { MenuItemProps } from '../Menu';
|
|
4
|
-
export interface BreadcrumbsProps extends BaseProps {
|
|
4
|
+
export interface BreadcrumbsProps extends BaseProps, NoChildrenProp {
|
|
5
5
|
/** A set of actions representing the chronological hierarchy of pages or locations leading to the current view. */
|
|
6
6
|
path: MenuItemProps[];
|
|
7
7
|
/** Ref forwarded to the wrapping element. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAEjB,GAAG,EAIJ,MAAM,OAAO,CAAC;AAKf,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAEjB,GAAG,EAIJ,MAAM,OAAO,CAAC;AAKf,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAUtE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAIxC,MAAM,WAAW,gBAAiB,SAAQ,SAAS,EAAE,cAAc;IACjE,mHAAmH;IACnH,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,6CAA6C;IAC7C,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,iBAAiB;sBAAkC,OAAO;SAoBtE,CAAC;AAIF,QAAA,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,YAAY,CAoGnE,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -7,15 +7,20 @@ import { debounce } from '../../utils';
|
|
|
7
7
|
import Button from '../Button';
|
|
8
8
|
import Flex from '../Flex';
|
|
9
9
|
import Link from '../Link';
|
|
10
|
-
import Icon from '../Icon';
|
|
10
|
+
import Icon, { StyledIcon, registerIcon } from '../Icon';
|
|
11
|
+
import * as caretLeftIcon from '../Icon/icons/caret-left.icon';
|
|
12
|
+
import * as caretRightIcon from '../Icon/icons/caret-right.icon';
|
|
11
13
|
import MenuButton from '../MenuButton';
|
|
12
14
|
import Text from '../Text';
|
|
15
|
+
registerIcon(caretLeftIcon, caretRightIcon);
|
|
13
16
|
export const StyledBreadcrumbs = styled.div(({ oneItemRemaining }) => css `
|
|
14
17
|
white-space: nowrap;
|
|
15
18
|
overflow: visible;
|
|
16
19
|
visibility: hidden;
|
|
17
20
|
|
|
18
|
-
|
|
21
|
+
${StyledIcon} {
|
|
22
|
+
width: 1em;
|
|
23
|
+
height: 1em;
|
|
19
24
|
flex-shrink: 0;
|
|
20
25
|
}
|
|
21
26
|
|
|
@@ -67,22 +72,19 @@ const Breadcrumbs = forwardRef(({ path, ...restProps }, ref) => {
|
|
|
67
72
|
}
|
|
68
73
|
}, [breadcrumbsEl, numMenuItems]);
|
|
69
74
|
const { end } = useDirection();
|
|
70
|
-
return (_jsxs(Flex,
|
|
71
|
-
_jsx(Icon, { name: `caret-${end}` }, void 0)] }, void 0)),
|
|
72
|
-
path.slice(numMenuItems).map((crumb, index) => {
|
|
75
|
+
return (_jsxs(Flex, { ...restProps, container: { gap: 1, alignItems: 'center' }, as: StyledBreadcrumbs, oneItemRemaining: numMenuItems === path.length - 1, ref: breadcrumbRef, children: [numMenuItems > 0 && (_jsxs(_Fragment, { children: [_jsx(MenuButton, { text: 'Links', iconOnly: true, variant: 'link', icon: 'folder-hierarchy-solid', menu: { items: path.slice(0, numMenuItems).reverse() } }, void 0), _jsx(Icon, { name: `caret-${end}` }, void 0)] }, void 0)), path.slice(numMenuItems).map((crumb, index) => {
|
|
73
76
|
const { id, primary, visual, ...restCrumbProps } = crumb;
|
|
74
77
|
let Comp;
|
|
75
78
|
if (crumb.href)
|
|
76
|
-
Comp = (_jsxs(Link,
|
|
79
|
+
Comp = (_jsxs(Link, { href: crumb.href, ...restCrumbProps, children: [visual, " ", primary] }, id));
|
|
77
80
|
else if (crumb.onClick)
|
|
78
|
-
Comp = (_jsxs(Button,
|
|
81
|
+
Comp = (_jsxs(Button, { variant: 'link', ...restCrumbProps, children: [visual, " ", primary] }, id));
|
|
79
82
|
else
|
|
80
|
-
Comp = (_jsxs(Text,
|
|
83
|
+
Comp = (_jsxs(Text, { ...restCrumbProps, children: [visual, " ", primary] }, id));
|
|
81
84
|
if (index === path.slice(numMenuItems).length - 1)
|
|
82
85
|
return Comp;
|
|
83
|
-
return (_jsxs(Fragment, { children: [Comp,
|
|
84
|
-
|
|
85
|
-
})] }), void 0));
|
|
86
|
+
return (_jsxs(Fragment, { children: [Comp, _jsx(Icon, { name: `caret-${end}` }, void 0)] }, id));
|
|
87
|
+
})] }, void 0));
|
|
86
88
|
});
|
|
87
89
|
export default Breadcrumbs;
|
|
88
90
|
//# sourceMappingURL=Breadcrumbs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.js","sourceRoot":"","sources":["../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,QAAQ,EAIR,SAAS,EACT,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.js","sourceRoot":"","sources":["../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,QAAQ,EAIR,SAAS,EACT,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,O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AAK,KAAK,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC;oBAAE,OAAO,IAAI,CAAC;gBAE/D,OAAO,CACL,MAAC,QAAQ,eACN,IAAI,EACL,KAAC,IAAI,IAAC,IAAI,EAAE,SAAS,GAAG,EAAE,WAAI,KAFjB,EAAE,CAGN,CACZ,CAAC;YACJ,CAAC,CAAC,YACG,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {\n forwardRef,\n Fragment,\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n useEffect,\n useRef,\n useState\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { useElement, useConsolidatedRef, useDirection } from '../../hooks';\nimport { defaultThemeProp } from '../../theme';\nimport { BaseProps, ForwardProps, NoChildrenProp } from '../../types';\nimport { debounce } from '../../utils';\nimport Button from '../Button';\nimport Flex from '../Flex';\nimport Link from '../Link';\nimport Icon, { StyledIcon, registerIcon } from '../Icon';\nimport * as caretLeftIcon from '../Icon/icons/caret-left.icon';\nimport * as caretRightIcon from '../Icon/icons/caret-right.icon';\nimport MenuButton from '../MenuButton';\nimport Text from '../Text';\nimport { MenuItemProps } from '../Menu';\n\nregisterIcon(caretLeftIcon, caretRightIcon);\n\nexport interface BreadcrumbsProps extends BaseProps, NoChildrenProp {\n /** A set of actions representing the chronological hierarchy of pages or locations leading to the current view. */\n path: MenuItemProps[];\n /** Ref forwarded to the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledBreadcrumbs = styled.div<{ oneItemRemaining: boolean }>(\n ({ oneItemRemaining }) => css`\n white-space: nowrap;\n overflow: visible;\n visibility: hidden;\n\n ${StyledIcon} {\n width: 1em;\n height: 1em;\n flex-shrink: 0;\n }\n\n ${oneItemRemaining &&\n css`\n & > :last-child {\n text-overflow: ellipsis;\n overflow: hidden;\n }\n `}\n `\n);\n\nStyledBreadcrumbs.defaultProps = defaultThemeProp;\n\nconst Breadcrumbs: FunctionComponent<BreadcrumbsProps & ForwardProps> = forwardRef(\n ({ path, ...restProps }: PropsWithoutRef<BreadcrumbsProps>, ref: BreadcrumbsProps['ref']) => {\n const [breadcrumbsEl, setBreadcrumbsEl] = useElement<HTMLDivElement>();\n const [numMenuItems, setNumMenuItems] = useState(0);\n const minInlineWidth = useRef(0);\n\n const breadcrumbRef = useConsolidatedRef(setBreadcrumbsEl, ref);\n\n const debouncedResize = debounce((entries: ResizeObserverEntry[]) => {\n if (entries[0].contentRect.width > minInlineWidth.current) {\n setNumMenuItems(curr => {\n if (curr === 0) return curr;\n return curr - 1;\n });\n }\n }, 100);\n\n const resizeObserver = new ResizeObserver(debouncedResize);\n\n const intersectionObserver = new IntersectionObserver(\n entries => {\n if (entries[0].intersectionRatio < 1 && numMenuItems < path.length - 1) {\n if (entries[0].rootBounds) minInlineWidth.current = entries[0].rootBounds.width + 1;\n setNumMenuItems(curr => {\n if (curr === path.length - 1) return curr;\n return curr + 1;\n });\n } else if (breadcrumbsEl) breadcrumbsEl.style.visibility = 'visible';\n },\n { root: breadcrumbsEl, threshold: 1 }\n );\n\n useEffect(() => {\n if (breadcrumbsEl && breadcrumbsEl.lastChild) {\n intersectionObserver.observe(breadcrumbsEl.lastChild as Element);\n resizeObserver.observe(breadcrumbsEl);\n\n return () => {\n intersectionObserver.disconnect();\n resizeObserver.disconnect();\n };\n }\n }, [breadcrumbsEl, numMenuItems]);\n\n const { end } = useDirection();\n\n return (\n <Flex\n {...restProps}\n container={{ gap: 1, alignItems: 'center' }}\n as={StyledBreadcrumbs}\n oneItemRemaining={numMenuItems === path.length - 1}\n ref={breadcrumbRef}\n >\n {numMenuItems > 0 && (\n <>\n <MenuButton\n text='Links'\n iconOnly\n variant='link'\n icon='folder-hierarchy-solid'\n menu={{ items: path.slice(0, numMenuItems).reverse() }}\n />\n <Icon name={`caret-${end}`} />\n </>\n )}\n {path.slice(numMenuItems).map((crumb, index) => {\n const { id, primary, visual, ...restCrumbProps } = crumb;\n let Comp;\n if (crumb.href)\n Comp = (\n <Link key={id} href={crumb.href} {...restCrumbProps}>\n {visual} {primary}\n </Link>\n );\n else if (crumb.onClick)\n Comp = (\n <Button key={id} variant='link' {...restCrumbProps}>\n {visual} {primary}\n </Button>\n );\n else\n Comp = (\n <Text key={id} {...restCrumbProps}>\n {visual} {primary}\n </Text>\n );\n\n if (index === path.slice(numMenuItems).length - 1) return Comp;\n\n return (\n <Fragment key={id}>\n {Comp}\n <Icon name={`caret-${end}`} />\n </Fragment>\n );\n })}\n </Flex>\n );\n }\n);\n\nexport default Breadcrumbs;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BareButton.d.ts","sourceRoot":"","sources":["../../../src/components/Button/BareButton.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"BareButton.d.ts","sourceRoot":"","sources":["../../../src/components/Button/BareButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAMlB,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAItD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,sCAAsC;IACtC,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IAClC;;;OAGG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;IACnC,wFAAwF;IACxF,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B;;;OAGG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,6CAA6C;IAC7C,GAAG,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;CAC1B;AAED,eAAO,MAAM,gBAAgB,4GAU5B,CAAC;AAIF,QAAA,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,GAAG,YAAY,CA6CjE,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
2
|
+
import { forwardRef, useRef, useEffect } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { defaultThemeProp } from '../../theme';
|
|
5
|
+
import { useConsolidatedRef } from '../../hooks';
|
|
5
6
|
export const StyledBareButton = styled.button `
|
|
6
7
|
background: none;
|
|
7
8
|
border: none;
|
|
@@ -15,7 +16,25 @@ export const StyledBareButton = styled.button `
|
|
|
15
16
|
`;
|
|
16
17
|
StyledBareButton.defaultProps = defaultThemeProp;
|
|
17
18
|
const BareButton = forwardRef(({ type = 'button', disabled = false, href, ...restProps }, ref) => {
|
|
18
|
-
|
|
19
|
+
const mouseDownEvent = useRef();
|
|
20
|
+
const buttonRef = useConsolidatedRef(ref);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
return () => {
|
|
23
|
+
mouseDownEvent.current = undefined;
|
|
24
|
+
};
|
|
25
|
+
}, []);
|
|
26
|
+
return (_jsx(StyledBareButton, { ref: buttonRef, as: href ? 'a' : undefined, type: href ? undefined : type, disabled: disabled, ...restProps, href: href, onMouseDown: (e) => {
|
|
27
|
+
restProps.onMouseDown?.(e);
|
|
28
|
+
e.persist();
|
|
29
|
+
mouseDownEvent.current = e;
|
|
30
|
+
}, onMouseUp: (e) => {
|
|
31
|
+
const shouldFocus = mouseDownEvent.current && !mouseDownEvent.current.defaultPrevented;
|
|
32
|
+
mouseDownEvent.current = undefined;
|
|
33
|
+
if (shouldFocus && buttonRef.current !== document.activeElement) {
|
|
34
|
+
buttonRef.current?.focus();
|
|
35
|
+
}
|
|
36
|
+
return restProps.onMouseUp?.(e);
|
|
37
|
+
} }, void 0));
|
|
19
38
|
});
|
|
20
39
|
export default BareButton;
|
|
21
40
|
//# sourceMappingURL=BareButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BareButton.js","sourceRoot":"","sources":["../../../src/components/Button/BareButton.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"BareButton.js","sourceRoot":"","sources":["../../../src/components/Button/BareButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,MAAM,EAMN,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAuBjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAA;;;;;;;;2BAQlB,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO;;CAE3D,CAAC;AAEF,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEjD,MAAM,UAAU,GAAsD,UAAU,CAC9E,CACE,EACE,IAAI,GAAG,QAAQ,EACf,QAAQ,GAAG,KAAK,EAChB,IAAI,EACJ,GAAG,SAAS,EACoC,EAClD,GAA2B,EAC3B,EAAE;IACF,MAAM,cAAc,GAAG,MAAM,EAAc,CAAC;IAC5C,MAAM,SAAS,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAE1C,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,GAAG,EAAE;YACV,cAAc,CAAC,OAAO,GAAG,SAAS,CAAC;QACrC,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,KAAC,gBAAgB,IACf,GAAG,EAAE,SAAS,EACd,EAAE,EAAE,IAAI,CAAC,CAAC,CAAE,GAAW,CAAC,CAAC,CAAC,SAAS,EACnC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EAC7B,QAAQ,EAAE,QAAQ,KACd,SAAS,EACb,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,CAAC,CAAoD,EAAE,EAAE;YACnE,SAAS,CAAC,WAA6C,EAAE,CAAC,CAAC,CAAC,CAAC;YAC9D,CAAC,CAAC,OAAO,EAAE,CAAC;YACZ,cAAc,CAAC,OAAO,GAAG,CAAC,CAAC;QAC7B,CAAC,EACD,SAAS,EAAE,CAAC,CAAoD,EAAE,EAAE;YAClE,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,gBAAgB,CAAC;YACvF,cAAc,CAAC,OAAO,GAAG,SAAS,CAAC;YAEnC,IAAI,WAAW,IAAI,SAAS,CAAC,OAAO,KAAK,QAAQ,CAAC,aAAa,EAAE;gBAC/D,SAAS,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;aAC5B;YAED,OAAQ,SAAS,CAAC,SAA2C,EAAE,CAAC,CAAC,CAAC,CAAC;QACrE,CAAC,WACD,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import {\n forwardRef,\n useRef,\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n MouseEvent,\n MouseEventHandler,\n useEffect\n} from 'react';\nimport styled from 'styled-components';\n\nimport { BaseProps, ForwardProps } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport { useConsolidatedRef } from '../../hooks';\n\nimport { ButtonProps } from './Button';\n\nexport interface BareButtonProps extends BaseProps {\n /** Text or content for the Button. */\n children: ButtonProps['children'];\n /**\n * Determines if the Button will be disabled.\n * @default false\n */\n disabled?: ButtonProps['disabled'];\n /** A location to navigate to. Passing an href will render a Link styled as a Button. */\n href?: ButtonProps['href'];\n /**\n * Controls the behavior of a Button within a Form.\n * @default \"button\"\n */\n type?: ButtonProps['type'];\n /** Ref forwarded to the wrapping element. */\n ref?: ButtonProps['ref'];\n}\n\nexport const StyledBareButton = styled.button`\n background: none;\n border: none;\n outline: none;\n cursor: pointer;\n user-select: none;\n\n & + & {\n margin-inline-start: ${props => props.theme.base.spacing};\n }\n`;\n\nStyledBareButton.defaultProps = defaultThemeProp;\n\nconst BareButton: FunctionComponent<BareButtonProps & ForwardProps> = forwardRef(\n (\n {\n type = 'button',\n disabled = false,\n href,\n ...restProps\n }: PropsWithoutRef<BareButtonProps> & ForwardProps,\n ref: Ref<HTMLButtonElement>\n ) => {\n const mouseDownEvent = useRef<MouseEvent>();\n const buttonRef = useConsolidatedRef(ref);\n\n useEffect(() => {\n return () => {\n mouseDownEvent.current = undefined;\n };\n }, []);\n\n return (\n <StyledBareButton\n ref={buttonRef}\n as={href ? ('a' as any) : undefined}\n type={href ? undefined : type}\n disabled={disabled}\n {...restProps}\n href={href}\n onMouseDown={(e: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n (restProps.onMouseDown as MouseEventHandler | undefined)?.(e);\n e.persist();\n mouseDownEvent.current = e;\n }}\n onMouseUp={(e: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n const shouldFocus = mouseDownEvent.current && !mouseDownEvent.current.defaultPrevented;\n mouseDownEvent.current = undefined;\n\n if (shouldFocus && buttonRef.current !== document.activeElement) {\n buttonRef.current?.focus();\n }\n\n return (restProps.onMouseUp as MouseEventHandler | undefined)?.(e);\n }}\n />\n );\n }\n);\n\nexport default BareButton;\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Ref, MouseEvent, KeyboardEvent, ReactNode, FunctionComponent } from 'react';
|
|
2
|
+
import { BaseProps, ForwardProps } from '../../types';
|
|
3
|
+
export interface BareRoleButtonProps extends BaseProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
onClick?: (e: MouseEvent<HTMLDivElement>) => void;
|
|
6
|
+
onKeyDown?: (e: KeyboardEvent<HTMLDivElement>) => void;
|
|
7
|
+
ref?: Ref<HTMLDivElement>;
|
|
8
|
+
}
|
|
9
|
+
export declare const StyledBareRoleButton: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
10
|
+
declare const BareRoleButton: FunctionComponent<BareRoleButtonProps & ForwardProps>;
|
|
11
|
+
export default BareRoleButton;
|
|
12
|
+
//# sourceMappingURL=BareRoleButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BareRoleButton.d.ts","sourceRoot":"","sources":["../../../src/components/Button/BareRoleButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,GAAG,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGjG,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAClD,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IACvD,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,oBAAoB,yGAAe,CAAC;AAEjD,QAAA,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,GAAG,YAAY,CAiCzE,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
export const StyledBareRoleButton = styled.div ``;
|
|
5
|
+
const BareRoleButton = forwardRef(({ children, onClick, onKeyDown, ...restProps }, ref) => {
|
|
6
|
+
return (_jsx(StyledBareRoleButton, { ...restProps, tabIndex: 0, role: 'button', onKeyDown: (e) => {
|
|
7
|
+
if ((e.key === ' ' || e.key === 'Enter') && e.target === e.currentTarget) {
|
|
8
|
+
e.currentTarget.click();
|
|
9
|
+
}
|
|
10
|
+
return onKeyDown?.(e);
|
|
11
|
+
}, onClick: (e) => {
|
|
12
|
+
if (e.target instanceof Element &&
|
|
13
|
+
// Ignore clicks on other interactive elements within this element.
|
|
14
|
+
e.target.closest("button, a, [role='button'], [role='link']") !== e.currentTarget)
|
|
15
|
+
return;
|
|
16
|
+
return onClick?.(e);
|
|
17
|
+
}, ref: ref, children: children }, void 0));
|
|
18
|
+
});
|
|
19
|
+
export default BareRoleButton;
|
|
20
|
+
//# sourceMappingURL=BareRoleButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BareRoleButton.js","sourceRoot":"","sources":["../../../src/components/Button/BareRoleButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAgE,MAAM,OAAO,CAAC;AACjG,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAWvC,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAEjD,MAAM,cAAc,GAA0D,UAAU,CACtF,CACE,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,SAAS,EAAuB,EACnE,GAA+B,EAC/B,EAAE;IACF,OAAO,CACL,KAAC,oBAAoB,OACf,SAAS,EACb,QAAQ,EAAE,CAAC,EACX,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,CAAC,CAAgC,EAAE,EAAE;YAC9C,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,aAAa,EAAE;gBACvE,CAAC,CAAC,aAAgC,CAAC,KAAK,EAAE,CAAC;aAC7C;YAED,OAAO,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;QACxB,CAAC,EACD,OAAO,EAAE,CAAC,CAA6B,EAAE,EAAE;YACzC,IACE,CAAC,CAAC,MAAM,YAAY,OAAO;gBAC3B,mEAAmE;gBACnE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,2CAA2C,CAAC,KAAK,CAAC,CAAC,aAAa;gBAEjF,OAAO;YAET,OAAO,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC,EACD,GAAG,EAAE,GAAG,YAEP,QAAQ,WACY,CACxB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { forwardRef, Ref, MouseEvent, KeyboardEvent, ReactNode, FunctionComponent } from 'react';\nimport styled from 'styled-components';\n\nimport { BaseProps, ForwardProps } from '../../types';\n\nexport interface BareRoleButtonProps extends BaseProps {\n children: ReactNode;\n onClick?: (e: MouseEvent<HTMLDivElement>) => void;\n onKeyDown?: (e: KeyboardEvent<HTMLDivElement>) => void;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledBareRoleButton = styled.div``;\n\nconst BareRoleButton: FunctionComponent<BareRoleButtonProps & ForwardProps> = forwardRef(\n (\n { children, onClick, onKeyDown, ...restProps }: BareRoleButtonProps,\n ref: BareRoleButtonProps['ref']\n ) => {\n return (\n <StyledBareRoleButton\n {...restProps}\n tabIndex={0}\n role='button'\n onKeyDown={(e: KeyboardEvent<HTMLDivElement>) => {\n if ((e.key === ' ' || e.key === 'Enter') && e.target === e.currentTarget) {\n (e.currentTarget as HTMLDivElement).click();\n }\n\n return onKeyDown?.(e);\n }}\n onClick={(e: MouseEvent<HTMLDivElement>) => {\n if (\n e.target instanceof Element &&\n // Ignore clicks on other interactive elements within this element.\n e.target.closest(\"button, a, [role='button'], [role='link']\") !== e.currentTarget\n )\n return;\n\n return onClick?.(e);\n }}\n ref={ref}\n >\n {children}\n </StyledBareRoleButton>\n );\n }\n);\n\nexport default BareRoleButton;\n"]}
|
|
@@ -25,6 +25,11 @@ export interface ButtonProps extends BaseProps, AsProp {
|
|
|
25
25
|
* @default false
|
|
26
26
|
*/
|
|
27
27
|
icon?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Used for a smaller sized button.
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
compact?: boolean;
|
|
28
33
|
/**
|
|
29
34
|
* The label text will be used inside a Tooltip.
|
|
30
35
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EACjB,SAAS,EAET,GAAG,EAGJ,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAWjF,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,MAAM;IACpD,sCAAsC;IACtC,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2FAA2F;IAC3F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IAC/D;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IACrC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,6CAA6C;IAC7C,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAi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