@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Lightbox.d.ts","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EASlB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAqB3C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,QAAA,MAAM,QAAQ,EAAE,iBAAiB,CAAC,aAAa,GAAG,YAAY,CAyP7D,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState, forwardRef } from 'react';
|
|
3
|
+
import { cap, getFocusables } from '../../utils';
|
|
4
|
+
import Flex from '../Flex';
|
|
5
|
+
import MetaList from '../MetaList';
|
|
6
|
+
import Icon from '../Icon';
|
|
7
|
+
import Text from '../Text';
|
|
8
|
+
import { useConsolidatedRef, useDirection, useI18n, useScrollToggle } from '../../hooks';
|
|
9
|
+
import ErrorState from '../ErrorState';
|
|
10
|
+
import { StyledHeader, StyledCountTracker, StyledInfo, StyledActionButton, StyledPreviewRegion, StyledNavButton, StyledImageContainer, StyledImage, StyledLiveRegion, StyledLightbox } from './Lightbox.styles';
|
|
11
|
+
const Lightbox = forwardRef(({ items, defaultIndex = 0, cycle, onItemLoad, onItemError, onNavigate, onItemDownload, onAfterClose, ...restProps }, refArg) => {
|
|
12
|
+
const t = useI18n();
|
|
13
|
+
const { start, end } = useDirection();
|
|
14
|
+
const [currentIndex, setCurrentIndex] = useState(defaultIndex);
|
|
15
|
+
const currentItem = items[currentIndex];
|
|
16
|
+
const { disableScroll, enableScroll } = useScrollToggle();
|
|
17
|
+
const lightboxRef = useConsolidatedRef(refArg);
|
|
18
|
+
const headerRef = useRef(null);
|
|
19
|
+
const closeButtonRef = useRef(null);
|
|
20
|
+
const prevButtonRef = useRef(null);
|
|
21
|
+
const nextButtonRef = useRef(null);
|
|
22
|
+
const [open, setOpen] = useState(true);
|
|
23
|
+
const imageRef = useConsolidatedRef(currentItem.ref);
|
|
24
|
+
const [error, setError] = useState(false);
|
|
25
|
+
const [liveText, setLiveText] = useState('');
|
|
26
|
+
const countTrackerText = items.length > 1 ? t('x_of_y', [currentIndex + 1, items.length]) : '';
|
|
27
|
+
const close = () => {
|
|
28
|
+
setOpen(false);
|
|
29
|
+
};
|
|
30
|
+
const navigate = (direction) => {
|
|
31
|
+
if (direction === 1) {
|
|
32
|
+
if (currentIndex < items.length - 1) {
|
|
33
|
+
setCurrentIndex(cur => cur + 1);
|
|
34
|
+
setError(false);
|
|
35
|
+
}
|
|
36
|
+
else if (cycle) {
|
|
37
|
+
setCurrentIndex(0);
|
|
38
|
+
setError(false);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else if (currentIndex > 0) {
|
|
42
|
+
setCurrentIndex(cur => cur - 1);
|
|
43
|
+
setError(false);
|
|
44
|
+
}
|
|
45
|
+
else if (cycle) {
|
|
46
|
+
setCurrentIndex(items.length - 1);
|
|
47
|
+
setError(false);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const onKeydown = (e) => {
|
|
51
|
+
if (e.repeat)
|
|
52
|
+
return;
|
|
53
|
+
if (e.key === 'Escape') {
|
|
54
|
+
close();
|
|
55
|
+
}
|
|
56
|
+
else if (e.key === `Arrow${cap(end)}`) {
|
|
57
|
+
navigate(1);
|
|
58
|
+
}
|
|
59
|
+
else if (e.key === `Arrow${cap(start)}`) {
|
|
60
|
+
navigate(-1);
|
|
61
|
+
}
|
|
62
|
+
if (e.key === 'Tab') {
|
|
63
|
+
const focusables = getFocusables(lightboxRef);
|
|
64
|
+
if (!focusables || focusables.length < 2)
|
|
65
|
+
return;
|
|
66
|
+
const firstFocusable = focusables[0];
|
|
67
|
+
const lastFocusable = focusables[focusables.length - 1];
|
|
68
|
+
if (!e.shiftKey &&
|
|
69
|
+
(document.activeElement === lightboxRef.current ||
|
|
70
|
+
document.activeElement === lastFocusable)) {
|
|
71
|
+
firstFocusable?.focus();
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
}
|
|
74
|
+
else if (e.shiftKey &&
|
|
75
|
+
(document.activeElement === lightboxRef.current ||
|
|
76
|
+
document.activeElement === firstFocusable)) {
|
|
77
|
+
lastFocusable?.focus();
|
|
78
|
+
e.preventDefault();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
document.addEventListener('keydown', onKeydown);
|
|
84
|
+
return () => {
|
|
85
|
+
document.removeEventListener('keydown', onKeydown);
|
|
86
|
+
};
|
|
87
|
+
}, [onKeydown]);
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
setLiveText(`${currentItem.name}. ${countTrackerText ? `${countTrackerText}.` : ''} ${currentItem.description}.`);
|
|
90
|
+
}, [currentItem.name, countTrackerText, currentItem.description]);
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
lightboxRef.current?.focus();
|
|
93
|
+
}, []);
|
|
94
|
+
return (_jsxs(StyledLightbox, { ...restProps, tabIndex: -1, ref: lightboxRef, open: open, role: 'dialog', "aria-modal": 'true', container: { alignItems: 'start', justify: 'start', direction: 'column' }, alpha: 0.9, variant: 'dark', transitionSpeed: 'slow', onBeforeTransitionIn: disableScroll, onAfterTransitionOut: () => {
|
|
95
|
+
enableScroll();
|
|
96
|
+
onAfterClose?.();
|
|
97
|
+
}, children: [_jsxs(Flex, { as: StyledHeader, ref: headerRef, container: {
|
|
98
|
+
justify: 'between',
|
|
99
|
+
alignItems: 'center',
|
|
100
|
+
gap: 2
|
|
101
|
+
}, onMouseDown: (e) => {
|
|
102
|
+
if (e.button !== 0)
|
|
103
|
+
return;
|
|
104
|
+
if (e.target === e.currentTarget)
|
|
105
|
+
close();
|
|
106
|
+
}, children: [_jsx(StyledCountTracker, { "aria-hidden": 'true', children: countTrackerText }, void 0), _jsxs(Flex, { as: StyledInfo, container: {
|
|
107
|
+
wrap: 'wrap',
|
|
108
|
+
alignItems: 'center',
|
|
109
|
+
justify: 'center',
|
|
110
|
+
colGap: 2,
|
|
111
|
+
rowGap: 0.5
|
|
112
|
+
}, children: [_jsx(Text, { variant: 'primary', as: 'h2', children: currentItem.name }, void 0), currentItem.metadata && _jsx(MetaList, { items: currentItem.metadata }, void 0)] }, void 0), _jsxs(Flex, { container: true, children: [onItemDownload && (_jsx(StyledActionButton, { variant: 'simple', "aria-label": t('download'), icon: true, onClick: () => onItemDownload(currentItem.id), children: _jsx(Icon, { name: 'download' }, void 0) }, void 0)), _jsx(StyledActionButton, { variant: 'simple', ref: closeButtonRef, "aria-label": t('close'), icon: true, onClick: close, children: _jsx(Icon, { name: 'times' }, void 0) }, void 0)] }, void 0)] }, void 0), _jsxs(Flex, { container: { justify: 'between' }, as: StyledPreviewRegion, item: { grow: 1, shrink: 0 }, children: [items.length > 1 && (_jsx(StyledNavButton, { ref: prevButtonRef, variant: 'simple', "aria-label": t('pagination_prev'), hidden: !cycle && currentIndex === 0, icon: true, onClick: () => {
|
|
113
|
+
navigate(-1);
|
|
114
|
+
}, children: _jsx("span", { children: _jsx(Icon, { name: 'caret-left' }, void 0) }, void 0) }, void 0)), _jsx(Flex, { item: { grow: 1 }, as: StyledImageContainer, children: _jsx(Flex, { container: { alignItems: 'center' }, onMouseDown: (e) => {
|
|
115
|
+
if (e.button !== 0)
|
|
116
|
+
return;
|
|
117
|
+
if (e.target === e.currentTarget)
|
|
118
|
+
close();
|
|
119
|
+
}, children: error ? (_jsx(ErrorState, { message: t('image_load_error') }, void 0)) : (_jsx(StyledImage, { ref: imageRef, src: currentItem.src, alt: currentItem.description, onLoad: (e) => {
|
|
120
|
+
onItemLoad?.(currentItem.id, e);
|
|
121
|
+
}, onError: (e) => {
|
|
122
|
+
onItemError?.(currentItem.id, e);
|
|
123
|
+
setError(true);
|
|
124
|
+
} }, void 0)) }, void 0) }, void 0), items.length > 1 && (_jsx(StyledNavButton, { ref: nextButtonRef, variant: 'simple', "aria-label": t('pagination_next'), hidden: !cycle && currentIndex === items.length - 1, icon: true, onClick: () => {
|
|
125
|
+
navigate(1);
|
|
126
|
+
}, children: _jsx("span", { children: _jsx(Icon, { name: 'caret-right' }, void 0) }, void 0) }, void 0))] }, void 0), _jsx(StyledLiveRegion, { "aria-live": 'polite', "aria-label": liveText }, void 0)] }, void 0));
|
|
127
|
+
});
|
|
128
|
+
export default Lightbox;
|
|
129
|
+
//# sourceMappingURL=Lightbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Lightbox.js","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,SAAS,EACT,MAAM,EAEN,QAAQ,EACR,UAAU,EAGX,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACzF,OAAO,UAAU,MAAM,eAAe,CAAC;A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AAC,MAAM,GAAG,CAAC,EACnD,IAAI,QACJ,OAAO,EAAE,GAAG,EAAE;4BACZ,QAAQ,CAAC,CAAC,CAAC,CAAC;wBACd,CAAC,YAED,yBACE,KAAC,IAAI,IAAC,IAAI,EAAC,aAAa,WAAG,WACtB,WACS,CACnB,YACI,EACP,KAAC,gBAAgB,iBAAW,QAAQ,gBAAa,QAAQ,WAAI,YAC9C,CAClB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import {\n FunctionComponent,\n PropsWithoutRef,\n useEffect,\n useRef,\n Ref,\n useState,\n forwardRef,\n MouseEvent,\n SyntheticEvent\n} from 'react';\n\nimport { ForwardProps } from '../../types';\nimport { cap, getFocusables } from '../../utils';\nimport Flex from '../Flex';\nimport MetaList from '../MetaList';\nimport Icon from '../Icon';\nimport Text from '../Text';\nimport { useConsolidatedRef, useDirection, useI18n, useScrollToggle } from '../../hooks';\nimport ErrorState from '../ErrorState';\n\nimport {\n StyledHeader,\n StyledCountTracker,\n StyledInfo,\n StyledActionButton,\n StyledPreviewRegion,\n StyledNavButton,\n StyledImageContainer,\n StyledImage,\n StyledLiveRegion,\n StyledLightbox\n} from './Lightbox.styles';\nimport { LightboxProps } from './Lightbox.types';\n\nconst Lightbox: FunctionComponent<LightboxProps & ForwardProps> = forwardRef(\n (\n {\n items,\n defaultIndex = 0,\n cycle,\n onItemLoad,\n onItemError,\n onNavigate,\n onItemDownload,\n onAfterClose,\n ...restProps\n }: PropsWithoutRef<LightboxProps>,\n refArg: Ref<HTMLDivElement>\n ) => {\n const t = useI18n();\n const { start, end } = useDirection();\n const [currentIndex, setCurrentIndex] = useState(defaultIndex);\n const currentItem = items[currentIndex];\n const { disableScroll, enableScroll } = useScrollToggle();\n const lightboxRef = useConsolidatedRef(refArg);\n const headerRef = useRef<HTMLDivElement>(null);\n const closeButtonRef = useRef<HTMLButtonElement>(null);\n const prevButtonRef = useRef<HTMLButtonElement>(null);\n const nextButtonRef = useRef<HTMLButtonElement>(null);\n const [open, setOpen] = useState(true);\n const imageRef = useConsolidatedRef(currentItem.ref);\n const [error, setError] = useState(false);\n const [liveText, setLiveText] = useState('');\n const countTrackerText = items.length > 1 ? t('x_of_y', [currentIndex + 1, items.length]) : '';\n\n const close = () => {\n setOpen(false);\n };\n\n const navigate = (direction: 1 | -1) => {\n if (direction === 1) {\n if (currentIndex < items.length - 1) {\n setCurrentIndex(cur => cur + 1);\n setError(false);\n } else if (cycle) {\n setCurrentIndex(0);\n setError(false);\n }\n } else if (currentIndex > 0) {\n setCurrentIndex(cur => cur - 1);\n setError(false);\n } else if (cycle) {\n setCurrentIndex(items.length - 1);\n setError(false);\n }\n };\n\n const onKeydown = (e: KeyboardEvent) => {\n if (e.repeat) return;\n\n if (e.key === 'Escape') {\n close();\n } else if (e.key === `Arrow${cap(end)}`) {\n navigate(1);\n } else if (e.key === `Arrow${cap(start)}`) {\n navigate(-1);\n }\n\n if (e.key === 'Tab') {\n const focusables = getFocusables(lightboxRef);\n if (!focusables || focusables.length < 2) return;\n const firstFocusable = focusables[0];\n const lastFocusable = focusables[focusables.length - 1];\n\n if (\n !e.shiftKey &&\n (document.activeElement === lightboxRef.current ||\n document.activeElement === lastFocusable)\n ) {\n firstFocusable?.focus();\n e.preventDefault();\n } else if (\n e.shiftKey &&\n (document.activeElement === lightboxRef.current ||\n document.activeElement === firstFocusable)\n ) {\n lastFocusable?.focus();\n e.preventDefault();\n }\n }\n };\n\n useEffect(() => {\n document.addEventListener('keydown', onKeydown);\n return () => {\n document.removeEventListener('keydown', onKeydown);\n };\n }, [onKeydown]);\n\n useEffect(() => {\n setLiveText(\n `${currentItem.name}. ${countTrackerText ? `${countTrackerText}.` : ''} ${\n currentItem.description\n }.`\n );\n }, [currentItem.name, countTrackerText, currentItem.description]);\n\n useEffect(() => {\n lightboxRef.current?.focus();\n }, []);\n\n return (\n <StyledLightbox\n {...restProps}\n tabIndex={-1}\n ref={lightboxRef}\n open={open}\n role='dialog'\n aria-modal='true'\n container={{ alignItems: 'start', justify: 'start', direction: 'column' }}\n alpha={0.9}\n variant='dark'\n transitionSpeed='slow'\n onBeforeTransitionIn={disableScroll}\n onAfterTransitionOut={() => {\n enableScroll();\n onAfterClose?.();\n }}\n >\n <Flex\n as={StyledHeader}\n ref={headerRef}\n container={{\n justify: 'between',\n alignItems: 'center',\n gap: 2\n }}\n onMouseDown={(e: MouseEvent<HTMLDivElement>) => {\n if (e.button !== 0) return;\n if (e.target === e.currentTarget) close();\n }}\n >\n <StyledCountTracker aria-hidden='true'>{countTrackerText}</StyledCountTracker>\n\n <Flex\n as={StyledInfo}\n container={{\n wrap: 'wrap',\n alignItems: 'center',\n justify: 'center',\n colGap: 2,\n rowGap: 0.5\n }}\n >\n <Text variant='primary' as='h2'>\n {currentItem.name}\n </Text>\n {currentItem.metadata && <MetaList items={currentItem.metadata} />}\n </Flex>\n\n <Flex container>\n {onItemDownload && (\n <StyledActionButton\n variant='simple'\n aria-label={t('download')}\n icon\n onClick={() => onItemDownload(currentItem.id)}\n >\n <Icon name='download' />\n </StyledActionButton>\n )}\n <StyledActionButton\n variant='simple'\n ref={closeButtonRef}\n aria-label={t('close')}\n icon\n onClick={close}\n >\n <Icon name='times' />\n </StyledActionButton>\n </Flex>\n </Flex>\n\n <Flex\n container={{ justify: 'between' }}\n as={StyledPreviewRegion}\n item={{ grow: 1, shrink: 0 }}\n >\n {items.length > 1 && (\n <StyledNavButton\n ref={prevButtonRef}\n variant='simple'\n aria-label={t('pagination_prev')}\n hidden={!cycle && currentIndex === 0}\n icon\n onClick={() => {\n navigate(-1);\n }}\n >\n <span>\n <Icon name='caret-left' />\n </span>\n </StyledNavButton>\n )}\n\n <Flex item={{ grow: 1 }} as={StyledImageContainer}>\n <Flex\n container={{ alignItems: 'center' }}\n onMouseDown={(e: MouseEvent<HTMLDivElement>) => {\n if (e.button !== 0) return;\n if (e.target === e.currentTarget) close();\n }}\n >\n {error ? (\n <ErrorState message={t('image_load_error')} />\n ) : (\n <StyledImage\n ref={imageRef}\n src={currentItem.src}\n alt={currentItem.description}\n onLoad={(e: SyntheticEvent<HTMLImageElement>) => {\n onItemLoad?.(currentItem.id, e);\n }}\n onError={(e: SyntheticEvent<HTMLImageElement>) => {\n onItemError?.(currentItem.id, e);\n setError(true);\n }}\n />\n )}\n </Flex>\n </Flex>\n\n {items.length > 1 && (\n <StyledNavButton\n ref={nextButtonRef}\n variant='simple'\n aria-label={t('pagination_next')}\n hidden={!cycle && currentIndex === items.length - 1}\n icon\n onClick={() => {\n navigate(1);\n }}\n >\n <span>\n <Icon name='caret-right' />\n </span>\n </StyledNavButton>\n )}\n </Flex>\n <StyledLiveRegion aria-live='polite' aria-label={liveText} />\n </StyledLightbox>\n );\n }\n);\n\nexport default Lightbox;\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const StyledHeader: import("styled-components").StyledComponent<"header", import("styled-components").DefaultTheme, {}, never>;
|
|
2
|
+
export declare const StyledCountTracker: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
+
export declare const StyledInfo: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
+
export declare const StyledNavButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Button/BareButton").BareButtonProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
+
export declare const StyledActionButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Button").ButtonProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
+
export declare const StyledImageContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
7
|
+
export declare const StyledPreviewRegion: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
8
|
+
export declare const StyledImage: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Image").ImageProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
9
|
+
export declare const StyledLiveRegion: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
10
|
+
export declare const StyledLightbox: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Backdrop/Backdrop").BackdropProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
11
|
+
//# sourceMappingURL=Lightbox.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Lightbox.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.styles.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,YAAY,4GAkBvB,CAAC;AAIH,eAAO,MAAM,kBAAkB,yGAY7B,CAAC;AAIH,eAAO,MAAM,UAAU,yGAKrB,CAAC;AAIH,eAAO,MAAM,eAAe,oNAgE1B,CAAC;AAIH,eAAO,MAAM,kBAAkB,qMAS7B,CAAC;AAIH,eAAO,MAAM,oBAAoB,yGAkB/B,CAAC;AAIH,eAAO,MAAM,mBAAmB,yGAG/B,CAAC;AAEF,eAAO,MAAM,WAAW,mMAKvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,yGAE5B,CAAC;AAEF,eAAO,MAAM,cAAc,kNAI1B,CAAC"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { hideVisually, rgba } from 'polished';
|
|
3
|
+
import { defaultThemeProp } from '../../theme';
|
|
4
|
+
import { tryCatch } from '../../utils';
|
|
5
|
+
import { calculateFontSize } from '../../styles';
|
|
6
|
+
import Image from '../Image';
|
|
7
|
+
import Button from '../Button';
|
|
8
|
+
import BareButton from '../Button/BareButton';
|
|
9
|
+
import { StyledIcon } from '../Icon';
|
|
10
|
+
import { StyledMetaList } from '../MetaList/MetaList';
|
|
11
|
+
import { StyledErrorState } from '../ErrorState';
|
|
12
|
+
import { StyledText } from '../Text';
|
|
13
|
+
import { useDirection } from '../../hooks';
|
|
14
|
+
import Backdrop from '../Backdrop';
|
|
15
|
+
export const StyledHeader = styled.header(({ theme }) => {
|
|
16
|
+
const color = tryCatch(() => rgba(theme.base.palette.light, theme.base.transparency['transparent-2']));
|
|
17
|
+
return css `
|
|
18
|
+
position: relative;
|
|
19
|
+
width: 100%;
|
|
20
|
+
padding: ${theme.base.spacing};
|
|
21
|
+
color: ${color};
|
|
22
|
+
|
|
23
|
+
${StyledMetaList} {
|
|
24
|
+
justify-content: center;
|
|
25
|
+
li {
|
|
26
|
+
color: ${color};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
});
|
|
31
|
+
StyledHeader.defaultProps = defaultThemeProp;
|
|
32
|
+
export const StyledCountTracker = styled.div(({ theme }) => {
|
|
33
|
+
const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
|
|
34
|
+
return css `
|
|
35
|
+
font-size: ${fontSize.xs};
|
|
36
|
+
text-align: center;
|
|
37
|
+
min-width: calc(2 * ${theme.base['hit-area']['mouse-min']});
|
|
38
|
+
|
|
39
|
+
@media (pointer: coarse) {
|
|
40
|
+
min-width: calc(2 * ${theme.base['hit-area']['finger-min']});
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
});
|
|
44
|
+
StyledCountTracker.defaultProps = defaultThemeProp;
|
|
45
|
+
export const StyledInfo = styled.div(({ theme }) => {
|
|
46
|
+
return css `
|
|
47
|
+
color: ${theme.base.palette.light};
|
|
48
|
+
font-weight: ${theme.base['font-weight']['semi-bold']};
|
|
49
|
+
`;
|
|
50
|
+
});
|
|
51
|
+
StyledInfo.defaultProps = defaultThemeProp;
|
|
52
|
+
export const StyledNavButton = styled(BareButton)(({ theme }) => {
|
|
53
|
+
const bg = tryCatch(() => rgba(theme.base.colors.gray.medium, 0.5));
|
|
54
|
+
const hoverBg = tryCatch(() => rgba(theme.base.colors.gray.medium, 0.7));
|
|
55
|
+
const { rtl } = useDirection();
|
|
56
|
+
return css `
|
|
57
|
+
position: absolute;
|
|
58
|
+
z-index: 1;
|
|
59
|
+
inset-block: 0;
|
|
60
|
+
min-width: ${theme.base['hit-area']['mouse-min']};
|
|
61
|
+
color: ${theme.base.palette['foreground-color']};
|
|
62
|
+
box-shadow: none;
|
|
63
|
+
border-radius: 0;
|
|
64
|
+
|
|
65
|
+
@media (pointer: coarse) {
|
|
66
|
+
min-width: ${theme.base['hit-area']['finger-min']};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&[hidden] {
|
|
70
|
+
display: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
& > span {
|
|
74
|
+
display: inline-block;
|
|
75
|
+
background-color: ${bg};
|
|
76
|
+
|
|
77
|
+
${StyledIcon} {
|
|
78
|
+
color: ${theme.base.palette.light};
|
|
79
|
+
width: 2rem;
|
|
80
|
+
height: 3rem;
|
|
81
|
+
|
|
82
|
+
${rtl &&
|
|
83
|
+
css `
|
|
84
|
+
transform: rotateZ(180deg);
|
|
85
|
+
`}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&:nth-of-type(1) {
|
|
90
|
+
inset-inline-start: 0;
|
|
91
|
+
text-align: start;
|
|
92
|
+
& > span {
|
|
93
|
+
border-start-end-radius: calc(${theme.base['border-radius']} / 2);
|
|
94
|
+
border-end-end-radius: calc(${theme.base['border-radius']} / 2);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&:nth-of-type(2) {
|
|
99
|
+
inset-inline-end: 0;
|
|
100
|
+
text-align: end;
|
|
101
|
+
& > span {
|
|
102
|
+
border-start-start-radius: calc(${theme.base['border-radius']} / 2);
|
|
103
|
+
border-end-start-radius: calc(${theme.base['border-radius']} / 2);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&:hover > span {
|
|
108
|
+
background-color: ${hoverBg};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&:focus > span {
|
|
112
|
+
box-shadow: ${theme.base.shadow['focus-inverted']};
|
|
113
|
+
}
|
|
114
|
+
`;
|
|
115
|
+
});
|
|
116
|
+
StyledNavButton.defaultProps = defaultThemeProp;
|
|
117
|
+
export const StyledActionButton = styled(Button)(({ theme }) => {
|
|
118
|
+
return css `
|
|
119
|
+
padding: ${theme.base.spacing};
|
|
120
|
+
color: ${theme.base.palette.light};
|
|
121
|
+
|
|
122
|
+
&:focus:enabled {
|
|
123
|
+
box-shadow: ${theme.base.shadow['focus-inverted']};
|
|
124
|
+
}
|
|
125
|
+
`;
|
|
126
|
+
});
|
|
127
|
+
StyledActionButton.defaultProps = defaultThemeProp;
|
|
128
|
+
export const StyledImageContainer = styled.div(({ theme }) => {
|
|
129
|
+
return css `
|
|
130
|
+
position: relative;
|
|
131
|
+
|
|
132
|
+
& > div {
|
|
133
|
+
position: absolute;
|
|
134
|
+
inset-block-start: 0;
|
|
135
|
+
inset-block-end: calc(2 * ${theme.base.spacing});
|
|
136
|
+
inset-inline: 0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
${StyledErrorState} {
|
|
140
|
+
margin: auto;
|
|
141
|
+
& > ${StyledText} {
|
|
142
|
+
color: ${theme.base.palette.light};
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
`;
|
|
146
|
+
});
|
|
147
|
+
StyledImageContainer.defaultProps = defaultThemeProp;
|
|
148
|
+
export const StyledPreviewRegion = styled.div `
|
|
149
|
+
position: relative;
|
|
150
|
+
width: 100%;
|
|
151
|
+
`;
|
|
152
|
+
export const StyledImage = styled(Image) `
|
|
153
|
+
display: block;
|
|
154
|
+
max-width: 100%;
|
|
155
|
+
max-height: 100%;
|
|
156
|
+
margin: auto;
|
|
157
|
+
`;
|
|
158
|
+
export const StyledLiveRegion = styled.div `
|
|
159
|
+
${hideVisually}
|
|
160
|
+
`;
|
|
161
|
+
export const StyledLightbox = styled(Backdrop) `
|
|
162
|
+
&:focus {
|
|
163
|
+
outline: none;
|
|
164
|
+
}
|
|
165
|
+
`;
|
|
166
|
+
//# sourceMappingURL=Lightbox.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Lightbox.styles.js","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACtD,MAAM,KAAK,GAAuB,QAAQ,CAAC,GAAG,EAAE,CAC9C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,CACzE,CAAC;IAEF,OAAO,GAAG,CAAA;;;eAGG,KAAK,CAAC,IAAI,CAAC,OAAO;aACpB,KAAK;;MAEZ,cAAc;;;iBAGH,KAAK;;;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AG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3D,OAAO,GAAG,CAAA;;;;;;kCAMsB,KAAK,CAAC,IAAI,CAAC,OAAO;;;;MAI9C,gBAAgB;;YAEV,UAAU;iBACL,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK;;;GAGtC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,oBAAoB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAErD,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAG5C,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;;;;;CAKvC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;IACtC,YAAY;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;;;;CAI7C,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { hideVisually, rgba } from 'polished';\n\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils';\nimport { calculateFontSize } from '../../styles';\nimport Image from '../Image';\nimport Button from '../Button';\nimport BareButton from '../Button/BareButton';\nimport { StyledIcon } from '../Icon';\nimport { StyledMetaList } from '../MetaList/MetaList';\nimport { StyledErrorState } from '../ErrorState';\nimport { StyledText } from '../Text';\nimport { useDirection } from '../../hooks';\nimport Backdrop from '../Backdrop';\n\nexport const StyledHeader = styled.header(({ theme }) => {\n const color: string | undefined = tryCatch(() =>\n rgba(theme.base.palette.light, theme.base.transparency['transparent-2'])\n );\n\n return css`\n position: relative;\n width: 100%;\n padding: ${theme.base.spacing};\n color: ${color};\n\n ${StyledMetaList} {\n justify-content: center;\n li {\n color: ${color};\n }\n }\n `;\n});\n\nStyledHeader.defaultProps = defaultThemeProp;\n\nexport const StyledCountTracker = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n font-size: ${fontSize.xs};\n text-align: center;\n min-width: calc(2 * ${theme.base['hit-area']['mouse-min']});\n\n @media (pointer: coarse) {\n min-width: calc(2 * ${theme.base['hit-area']['finger-min']});\n }\n `;\n});\n\nStyledCountTracker.defaultProps = defaultThemeProp;\n\nexport const StyledInfo = styled.div(({ theme }) => {\n return css`\n color: ${theme.base.palette.light};\n font-weight: ${theme.base['font-weight']['semi-bold']};\n `;\n});\n\nStyledInfo.defaultProps = defaultThemeProp;\n\nexport const StyledNavButton = styled(BareButton)(({ theme }) => {\n const bg = tryCatch(() => rgba(theme.base.colors.gray.medium, 0.5));\n const hoverBg = tryCatch(() => rgba(theme.base.colors.gray.medium, 0.7));\n const { rtl } = useDirection();\n\n return css`\n position: absolute;\n z-index: 1;\n inset-block: 0;\n min-width: ${theme.base['hit-area']['mouse-min']};\n color: ${theme.base.palette['foreground-color']};\n box-shadow: none;\n border-radius: 0;\n\n @media (pointer: coarse) {\n min-width: ${theme.base['hit-area']['finger-min']};\n }\n\n &[hidden] {\n display: none;\n }\n\n & > span {\n display: inline-block;\n background-color: ${bg};\n\n ${StyledIcon} {\n color: ${theme.base.palette.light};\n width: 2rem;\n height: 3rem;\n\n ${rtl &&\n css`\n transform: rotateZ(180deg);\n `}\n }\n }\n\n &:nth-of-type(1) {\n inset-inline-start: 0;\n text-align: start;\n & > span {\n border-start-end-radius: calc(${theme.base['border-radius']} / 2);\n border-end-end-radius: calc(${theme.base['border-radius']} / 2);\n }\n }\n\n &:nth-of-type(2) {\n inset-inline-end: 0;\n text-align: end;\n & > span {\n border-start-start-radius: calc(${theme.base['border-radius']} / 2);\n border-end-start-radius: calc(${theme.base['border-radius']} / 2);\n }\n }\n\n &:hover > span {\n background-color: ${hoverBg};\n }\n\n &:focus > span {\n box-shadow: ${theme.base.shadow['focus-inverted']};\n }\n `;\n});\n\nStyledNavButton.defaultProps = defaultThemeProp;\n\nexport const StyledActionButton = styled(Button)(({ theme }) => {\n return css`\n padding: ${theme.base.spacing};\n color: ${theme.base.palette.light};\n\n &:focus:enabled {\n box-shadow: ${theme.base.shadow['focus-inverted']};\n }\n `;\n});\n\nStyledActionButton.defaultProps = defaultThemeProp;\n\nexport const StyledImageContainer = styled.div(({ theme }) => {\n return css`\n position: relative;\n\n & > div {\n position: absolute;\n inset-block-start: 0;\n inset-block-end: calc(2 * ${theme.base.spacing});\n inset-inline: 0;\n }\n\n ${StyledErrorState} {\n margin: auto;\n & > ${StyledText} {\n color: ${theme.base.palette.light};\n }\n }\n `;\n});\n\nStyledImageContainer.defaultProps = defaultThemeProp;\n\nexport const StyledPreviewRegion = styled.div`\n position: relative;\n width: 100%;\n`;\n\nexport const StyledImage = styled(Image)`\n display: block;\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n`;\n\nexport const StyledLiveRegion = styled.div`\n ${hideVisually}\n`;\n\nexport const StyledLightbox = styled(Backdrop)`\n &:focus {\n outline: none;\n }\n`;\n"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ReactNode, SyntheticEvent } from 'react';
|
|
2
|
+
import { NoChildrenProp, BaseProps } from '../../types';
|
|
3
|
+
import { BackdropProps } from '../Backdrop/Backdrop';
|
|
4
|
+
import { ImageProps } from '../Image';
|
|
5
|
+
export interface LightboxProps extends NoChildrenProp, BaseProps {
|
|
6
|
+
/** A list of compatible content to present in the lightbox. */
|
|
7
|
+
items: LightboxItem[];
|
|
8
|
+
/**
|
|
9
|
+
* The index of the item to present on mount.
|
|
10
|
+
* @default 0
|
|
11
|
+
* */
|
|
12
|
+
defaultIndex?: number;
|
|
13
|
+
/** Allow cycling through the items in either direction. */
|
|
14
|
+
cycle?: true;
|
|
15
|
+
/** Called when an item's file is loaded. */
|
|
16
|
+
onItemLoad?: (id: LightboxItem['id'], e: SyntheticEvent<HTMLImageElement>) => void;
|
|
17
|
+
/** Called when an item's file encounters an error while loading. */
|
|
18
|
+
onItemError?: (id: LightboxItem['id'], e: SyntheticEvent<HTMLImageElement>) => void;
|
|
19
|
+
/** Called when the user navigates between items. */
|
|
20
|
+
onNavigate?: (id: LightboxItem['id']) => void;
|
|
21
|
+
/** Called when a download action is triggered for an item's file. */
|
|
22
|
+
onItemDownload?: (id: LightboxItem['id']) => void;
|
|
23
|
+
/** Called after the lightbox has transitioned out. */
|
|
24
|
+
onAfterClose?: BackdropProps['onAfterTransitionOut'];
|
|
25
|
+
/** A ref to the underlying root element of the lightbox. */
|
|
26
|
+
ref?: BackdropProps['ref'];
|
|
27
|
+
}
|
|
28
|
+
export interface LightboxItem {
|
|
29
|
+
/** A unique identifier for the item. */
|
|
30
|
+
id: string;
|
|
31
|
+
/** The item's name e.g. filename. */
|
|
32
|
+
name: string;
|
|
33
|
+
/** Text to describe the item. */
|
|
34
|
+
description: ImageProps['alt'];
|
|
35
|
+
/** URL for the item's binary file. */
|
|
36
|
+
src: string;
|
|
37
|
+
/** Additional info about the item. */
|
|
38
|
+
metadata?: ReactNode[];
|
|
39
|
+
/** A ref to the item's underlying element. */
|
|
40
|
+
ref?: ImageProps['ref'];
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=Lightbox.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Lightbox.types.d.ts","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,WAAW,aAAc,SAAQ,cAAc,EAAE,SAAS;IAC9D,+DAA+D;IAC/D,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB;;;SAGK;IACL,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,4CAA4C;IAC5C,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACnF,oEAAoE;IACpE,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACpF,oDAAoD;IACpD,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAC9C,qEAAqE;IACrE,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAClD,sDAAsD;IACtD,YAAY,CAAC,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAC;IACrD,4DAA4D;IAC5D,GAAG,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;CAC5B;AAED,MAAM,WAAW,YAAY;IAC3B,wCAAwC;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,WAAW,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IAC/B,sCAAsC;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,sCAAsC;IACtC,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC;IACvB,8CAA8C;IAC9C,GAAG,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Lightbox.types.js","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactNode, SyntheticEvent } from 'react';\n\nimport { NoChildrenProp, BaseProps } from '../../types';\nimport { BackdropProps } from '../Backdrop/Backdrop';\nimport { ImageProps } from '../Image';\n\nexport interface LightboxProps extends NoChildrenProp, BaseProps {\n /** A list of compatible content to present in the lightbox. */\n items: LightboxItem[];\n /**\n * The index of the item to present on mount.\n * @default 0\n * */\n defaultIndex?: number;\n /** Allow cycling through the items in either direction. */\n cycle?: true;\n /** Called when an item's file is loaded. */\n onItemLoad?: (id: LightboxItem['id'], e: SyntheticEvent<HTMLImageElement>) => void;\n /** Called when an item's file encounters an error while loading. */\n onItemError?: (id: LightboxItem['id'], e: SyntheticEvent<HTMLImageElement>) => void;\n /** Called when the user navigates between items. */\n onNavigate?: (id: LightboxItem['id']) => void;\n /** Called when a download action is triggered for an item's file. */\n onItemDownload?: (id: LightboxItem['id']) => void;\n /** Called after the lightbox has transitioned out. */\n onAfterClose?: BackdropProps['onAfterTransitionOut'];\n /** A ref to the underlying root element of the lightbox. */\n ref?: BackdropProps['ref'];\n}\n\nexport interface LightboxItem {\n /** A unique identifier for the item. */\n id: string;\n /** The item's name e.g. filename. */\n name: string;\n /** Text to describe the item. */\n description: ImageProps['alt'];\n /** URL for the item's binary file. */\n src: string;\n /** Additional info about the item. */\n metadata?: ReactNode[];\n /** A ref to the item's underlying element. */\n ref?: ImageProps['ref'];\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Lightbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Lightbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { default } from './Lightbox';\nexport { LightboxProps, LightboxItem } from './Lightbox.types';\n"]}
|
|
@@ -78,19 +78,18 @@ const Link = forwardRef(({ href, variant = 'link', previewable, onPreview, ...re
|
|
|
78
78
|
setPopover(false);
|
|
79
79
|
};
|
|
80
80
|
const onKeyUp = (event) => {
|
|
81
|
-
var _a, _b, _c;
|
|
82
81
|
if (event.keyCode === 27) {
|
|
83
82
|
closePopover();
|
|
84
83
|
}
|
|
85
84
|
if (event.keyCode === 38 || event.keyCode === 40) {
|
|
86
|
-
|
|
85
|
+
previewBtnRef?.current?.focus();
|
|
87
86
|
}
|
|
88
87
|
if (event.keyCode === 37 || event.keyCode === 39) {
|
|
89
88
|
if (previewBtnRef.current === document.activeElement) {
|
|
90
|
-
|
|
89
|
+
openInTabBtnRef?.current?.focus();
|
|
91
90
|
}
|
|
92
91
|
else {
|
|
93
|
-
|
|
92
|
+
previewBtnRef?.current?.focus();
|
|
94
93
|
}
|
|
95
94
|
}
|
|
96
95
|
};
|
|
@@ -99,11 +98,9 @@ const Link = forwardRef(({ href, variant = 'link', previewable, onPreview, ...re
|
|
|
99
98
|
openPopover();
|
|
100
99
|
};
|
|
101
100
|
const onPreviewClick = () => {
|
|
102
|
-
onPreview
|
|
101
|
+
onPreview?.({ href });
|
|
103
102
|
};
|
|
104
|
-
return (_jsxs(_Fragment, { children: [_jsx(StyledLink,
|
|
105
|
-
_jsxs(Popover, Object.assign({ show: popover, groupId: 'link_preview', showDelay: 'short', hideDelay: 'short', placement: 'bottom', target: linkRef.current, onMouseEnter: openPopover, onMouseLeave: closePopover, as: StyledLinkPopover, arrow: true }, { children: [_jsx(StyledLinkPopoverBtn, Object.assign({ preview: true, type: 'button', ref: previewBtnRef, onClick: onPreviewClick, tabIndex: 0, onFocus: openPopover, onKeyUp: onKeyUp }, { children: t('link_preview') }), void 0),
|
|
106
|
-
_jsx(StyledLinkPopoverBtn, Object.assign({ forwardedAs: 'a', href: href, ref: openInTabBtnRef, target: '_blank', rel: 'noreferrer', onBlur: closePopover, onKeyUp: onKeyUp }, { children: t('link_open_in_tab') }), void 0)] }), void 0)] }, void 0));
|
|
103
|
+
return (_jsxs(_Fragment, { children: [_jsx(StyledLink, { href: href, variant: variant, ref: linkRef, ...restProps, onMouseEnter: onEnterLink, onMouseLeave: closePopover, onFocus: onEnterLink, onKeyUp: onKeyUp, onBlur: closePopover }, void 0), _jsxs(Popover, { show: popover, groupId: 'link_preview', showDelay: 'short', hideDelay: 'short', placement: 'bottom', target: linkRef.current, onMouseEnter: openPopover, onMouseLeave: closePopover, as: StyledLinkPopover, arrow: true, children: [_jsx(StyledLinkPopoverBtn, { preview: true, type: 'button', ref: previewBtnRef, onClick: onPreviewClick, tabIndex: 0, onFocus: openPopover, onKeyUp: onKeyUp, children: t('preview') }, void 0), _jsx(StyledLinkPopoverBtn, { forwardedAs: 'a', href: href, ref: openInTabBtnRef, target: '_blank', rel: 'noreferrer', onBlur: closePopover, onKeyUp: onKeyUp, children: t('link_open_in_tab_text') }, void 0)] }, void 0)] }, void 0));
|
|
107
104
|
});
|
|
108
105
|
export default Link;
|
|
109
106
|
//# sourceMappingURL=Link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.js","sourceRoot":"","sources":["../../../src/components/Link/Link.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAKV,QAAQ,EACR,MAAM,EAEP,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,MAAuB,MAAM,WAAW,CAAC;AAChD,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC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,CAAC;IAEF,MAAM,cAAc,GAAG,GAAG,EAAE;QAC1B,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IACxB,CAAC,CAAC;IAEF,OAAO,CACL,8BACE,KAAC,UAAU,IACT,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,OAAc,KACf,SAAS,EACb,YAAY,EAAE,WAAW,EACzB,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,YAAY,WACpB,EAEF,MAAC,OAAO,IACN,IAAI,EAAE,OAAO,EACb,OAAO,EAAC,cAAc,EACtB,SAAS,EAAC,OAAO,EACjB,SAAS,EAAC,OAAO,EACjB,SAAS,EAAC,QAAQ,EAClB,MAAM,EAAE,OAAO,CAAC,OAAO,EACvB,YAAY,EAAE,WAAW,EACzB,YAAY,EAAE,YAAY,EAC1B,EAAE,EAAE,iBAAiB,EACrB,KAAK,mBAEL,KAAC,oBAAoB,IACnB,OAAO,QACP,IAAI,EAAC,QAAQ,EACb,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,cAAc,EACvB,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,OAAO,YAEf,CAAC,CAAC,SAAS,CAAC,WACQ,EACvB,KAAC,oBAAoB,IACnB,WAAW,EAAC,GAAG,EACf,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,eAAe,EACpB,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,YAAY,EAChB,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,YAEf,CAAC,CAAC,uBAAuB,CAAC,WACN,YACf,YACT,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import {\n forwardRef,\n ReactNode,\n FunctionComponent,\n Ref,\n PropsWithoutRef,\n useState,\n useRef,\n KeyboardEvent\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport Button, { ButtonProps } from '../Button';\nimport Popover from '../Popover';\nimport BareButton from '../Button/BareButton';\nimport { BaseProps, ForwardProps } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport { useBreakpoint, useConsolidatedRef, useI18n } from '../../hooks';\nimport { tryCatch } from '../../utils';\nimport { calculateFontSize } from '../../styles';\n\nexport interface LinkProps extends BaseProps {\n /** Text or content for the Link. */\n children: ReactNode;\n /** URL or DOM id to navigate to. */\n href: string;\n /**\n * Controls the styling of the Link.\n * @default \"link\"\n */\n variant?: ButtonProps['variant'];\n /**\n * Set the Icon prop to `true` if you're using just an Icon in your Link. Make sure to pass an Icon as children if `true`.\n * @default false\n */\n icon?: ButtonProps['icon'];\n /** Determines if the Link should render a popover when focused or hovered over. */\n previewable?: boolean;\n /** Callback function that is run when the preview popover is interacted with. */\n onPreview?: (e: { href: string }) => void;\n /** Specifies where to open the link href. */\n target?: string;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLAnchorElement>;\n}\n\nexport const StyledLinkPopover = styled.div`\n background-color: ${props => props.theme.components.tooltip['background-color']};\n`;\n\nStyledLinkPopover.defaultProps = defaultThemeProp;\n\nexport const StyledLinkPopoverBtn = styled(BareButton)(({ theme }) => {\n const contrastColor = tryCatch(() => readableColor(theme.base.palette.interactive));\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n position: relative;\n display: inline-flex;\n align-items: center;\n z-index: 1;\n padding: 0 ${theme.base.spacing};\n min-height: 1.5rem;\n line-height: 1;\n color: ${contrastColor};\n font-size: ${fontSize.xs};\n text-decoration: none;\n\n /* FIXME: Button selector specificity... */\n & + & {\n margin: 0;\n }\n\n &:nth-child(2)::after {\n content: '';\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n width: 1px; /* stylelint-disable-line unit-allowed-list */\n background-color: ${contrastColor};\n opacity: ${theme.base.transparency['transparent-3']};\n }\n\n &:nth-child(2) {\n /* stylelint-disable-next-line unit-allowed-list */\n margin-inline-start: -1px;\n }\n\n &:hover,\n &:active {\n text-decoration: underline;\n }\n\n &:focus {\n box-shadow: inset 0 0 0 0.0625rem ${theme.base.palette.light},\n 0 0 0.125rem 0.0625rem ${theme.base.palette.interactive};\n }\n `;\n});\n\nStyledLinkPopoverBtn.defaultProps = defaultThemeProp;\n\nexport const StyledLink = styled(Button)``;\n\nStyledLink.defaultProps = defaultThemeProp;\n\nconst Link: FunctionComponent<LinkProps & ForwardProps> = forwardRef(\n (\n { href, variant = 'link', previewable, onPreview, ...restProps }: PropsWithoutRef<LinkProps>,\n ref: LinkProps['ref']\n ) => {\n const linkRef = useConsolidatedRef(ref);\n const [popover, setPopover] = useState(false);\n const previewBtnRef = useRef<HTMLButtonElement>(null);\n const openInTabBtnRef = useRef<HTMLAnchorElement>(null);\n const isSmallOrAbove = useBreakpoint('sm');\n const t = useI18n();\n\n const openPopover = () => {\n if (isSmallOrAbove) setPopover(true);\n };\n\n const closePopover = () => {\n setPopover(false);\n };\n\n const onKeyUp = (event: KeyboardEvent) => {\n if (event.keyCode === 27) {\n closePopover();\n }\n\n if (event.keyCode === 38 || event.keyCode === 40) {\n previewBtnRef?.current?.focus();\n }\n\n if (event.keyCode === 37 || event.keyCode === 39) {\n if (previewBtnRef.current === document.activeElement) {\n openInTabBtnRef?.current?.focus();\n } else {\n previewBtnRef?.current?.focus();\n }\n }\n };\n\n const onEnterLink = () => {\n if (previewable) openPopover();\n };\n\n const onPreviewClick = () => {\n onPreview?.({ href });\n };\n\n return (\n <>\n <StyledLink\n href={href}\n variant={variant}\n ref={linkRef as any}\n {...restProps}\n onMouseEnter={onEnterLink}\n onMouseLeave={closePopover}\n onFocus={onEnterLink}\n onKeyUp={onKeyUp}\n onBlur={closePopover}\n />\n\n <Popover\n show={popover}\n groupId='link_preview'\n showDelay='short'\n hideDelay='short'\n placement='bottom'\n target={linkRef.current}\n onMouseEnter={openPopover}\n onMouseLeave={closePopover}\n as={StyledLinkPopover}\n arrow\n >\n <StyledLinkPopoverBtn\n preview\n type='button'\n ref={previewBtnRef}\n onClick={onPreviewClick}\n tabIndex={0}\n onFocus={openPopover}\n onKeyUp={onKeyUp}\n >\n {t('preview')}\n </StyledLinkPopoverBtn>\n <StyledLinkPopoverBtn\n forwardedAs='a'\n href={href}\n ref={openInTabBtnRef}\n target='_blank'\n rel='noreferrer'\n onBlur={closePopover}\n onKeyUp={onKeyUp}\n >\n {t('link_open_in_tab_text')}\n </StyledLinkPopoverBtn>\n </Popover>\n </>\n );\n }\n);\n\nexport default Link;\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FunctionComponent, ReactNode, Ref } from 'react';
|
|
2
|
+
import { BaseProps, ForwardProps } from '../../types';
|
|
3
|
+
export interface CommaSeparatedListProps extends BaseProps {
|
|
4
|
+
/** List content. */
|
|
5
|
+
items: ReactNode[];
|
|
6
|
+
/** List Heading. */
|
|
7
|
+
heading?: string;
|
|
8
|
+
/** Ref forwarded to the wrapping element. */
|
|
9
|
+
ref?: Ref<HTMLDivElement>;
|
|
10
|
+
}
|
|
11
|
+
export declare const StyledCommaSeparatedList: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
12
|
+
export declare const StyledCommaSeparatedListItem: import("styled-components").StyledComponent<"li", import("styled-components").DefaultTheme, {}, never>;
|
|
13
|
+
declare const CommaSeparatedList: FunctionComponent<CommaSeparatedListProps & ForwardProps>;
|
|
14
|
+
export default CommaSeparatedList;
|
|
15
|
+
//# sourceMappingURL=CommaSeparatedList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommaSeparatedList.d.ts","sourceRoot":"","sources":["../../../src/components/List/CommaSeparatedList.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,SAAS,EAIT,GAAG,EAIJ,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAQtD,MAAM,WAAW,uBAAwB,SAAQ,SAAS;IACxD,oBAAoB;IACpB,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,wBAAwB,yGAOnC,CAAC;AAIH,eAAO,MAAM,4BAA4B,wGAMxC,CAAC;AAyDF,QAAA,MAAM,kBAAkB,EAAE,iBAAiB,CAAC,uBAAuB,GAAG,YAAY,CAmBjF,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useState, useLayoutEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
import { defaultThemeProp } from '../../theme';
|
|
5
|
+
import { useI18n } from '../../hooks';
|
|
6
|
+
import Button from '../Button';
|
|
7
|
+
import Text from '../Text';
|
|
8
|
+
import ExpandCollapse from '../ExpandCollapse';
|
|
9
|
+
import { windowIsAvailable } from '../../utils';
|
|
10
|
+
export const StyledCommaSeparatedList = styled.div(({ theme }) => {
|
|
11
|
+
return css `
|
|
12
|
+
padding: ${theme.base.spacing};
|
|
13
|
+
h3 {
|
|
14
|
+
padding-block-end: calc(2 * ${theme.base.spacing});
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
});
|
|
18
|
+
StyledCommaSeparatedList.defaultProps = defaultThemeProp;
|
|
19
|
+
export const StyledCommaSeparatedListItem = styled.li `
|
|
20
|
+
display: inline;
|
|
21
|
+
|
|
22
|
+
&:not(:last-child)::after {
|
|
23
|
+
content: ', ';
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
const DynamicHeightValue = ({ children }) => {
|
|
27
|
+
const [collapsed, setCollapsed] = useState(true);
|
|
28
|
+
const [exceedsMaxHeight, setExceedsMaxHeight] = useState(false);
|
|
29
|
+
const textRef = useRef(null);
|
|
30
|
+
const t = useI18n();
|
|
31
|
+
const maxTextHeight = useMemo(() => {
|
|
32
|
+
if (!windowIsAvailable)
|
|
33
|
+
return Infinity;
|
|
34
|
+
const computedLineHeight = Number.parseInt(window.getComputedStyle(document.documentElement).getPropertyValue('font-size'), 10) * 1.25;
|
|
35
|
+
return 3 * computedLineHeight;
|
|
36
|
+
}, []);
|
|
37
|
+
useLayoutEffect(() => {
|
|
38
|
+
if (!textRef.current)
|
|
39
|
+
return;
|
|
40
|
+
const observer = new ResizeObserver(entries => {
|
|
41
|
+
const exceedsHeight = entries.some(({ target, contentRect }) => {
|
|
42
|
+
if (target !== textRef.current)
|
|
43
|
+
return;
|
|
44
|
+
return contentRect.height > maxTextHeight;
|
|
45
|
+
});
|
|
46
|
+
setExceedsMaxHeight(exceedsHeight);
|
|
47
|
+
});
|
|
48
|
+
observer.observe(textRef.current);
|
|
49
|
+
return () => {
|
|
50
|
+
observer.disconnect();
|
|
51
|
+
};
|
|
52
|
+
}, [textRef.current, maxTextHeight]);
|
|
53
|
+
return (_jsxs(_Fragment, { children: [_jsx(ExpandCollapse, { collapsed: collapsed, min: exceedsMaxHeight ? `${maxTextHeight}px` : 'max-content', children: _jsx("div", { ref: textRef, children: children }, void 0) }, void 0), exceedsMaxHeight && (_jsx(Button, { variant: 'link', onClick: () => setCollapsed(current => !current), children: collapsed ? t('show_more') : t('show_less') }, void 0))] }, void 0));
|
|
54
|
+
};
|
|
55
|
+
const CommaSeparatedList = forwardRef(({ items, heading }, ref) => {
|
|
56
|
+
return (_jsxs(StyledCommaSeparatedList, { ref: ref, children: [heading && _jsx(Text, { variant: 'h3', children: heading }, void 0), _jsx(DynamicHeightValue, { children: _jsx("ul", { style: { listStyle: 'none' }, children: items.map((value, i) => (
|
|
57
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
58
|
+
_jsx(StyledCommaSeparatedListItem, { children: value }, i))) }, void 0) }, void 0)] }, void 0));
|
|
59
|
+
});
|
|
60
|
+
export default CommaSeparatedList;
|
|
61
|
+
//# sourceMappingURL=CommaSeparatedList.js.map
|