@pega/cosmos-react-core 5.0.0-dev.5.0 → 5.0.0-dev.6.0
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/lib/components/AIButton/AIButton.d.ts.map +1 -1
- package/lib/components/AIButton/AIButton.js.map +1 -1
- package/lib/components/Actions/Actions.d.ts +5 -2
- package/lib/components/Actions/Actions.d.ts.map +1 -1
- package/lib/components/Actions/Actions.js +3 -3
- package/lib/components/Actions/Actions.js.map +1 -1
- package/lib/components/AdditionalInfo/AdditionalInfo.d.ts +3 -3
- package/lib/components/AdditionalInfo/AdditionalInfo.d.ts.map +1 -1
- package/lib/components/AdditionalInfo/AdditionalInfo.js.map +1 -1
- package/lib/components/AppShell/AppHeader.d.ts +3 -3
- package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.js.map +1 -1
- package/lib/components/AppShell/AppHeader.styles.d.ts +1 -1
- package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.d.ts +2 -2
- package/lib/components/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShellContext.d.ts +3 -3
- package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellContext.js.map +1 -1
- package/lib/components/AppShell/AppShellList.d.ts +2 -2
- package/lib/components/AppShell/AppShellList.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellList.js.map +1 -1
- package/lib/components/AppShell/AppShellSearch.d.ts +2 -2
- package/lib/components/AppShell/AppShellSearch.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellSearch.js.map +1 -1
- package/lib/components/AppShell/ContextSwitcher.d.ts +3 -3
- package/lib/components/AppShell/ContextSwitcher.d.ts.map +1 -1
- package/lib/components/AppShell/ContextSwitcher.js.map +1 -1
- package/lib/components/AppShell/Drawer.d.ts +1 -1
- package/lib/components/AppShell/Drawer.d.ts.map +1 -1
- package/lib/components/AppShell/Drawer.js.map +1 -1
- package/lib/components/AppShell/Drawer.styles.d.ts +1 -1
- package/lib/components/AppShell/Drawer.styles.d.ts.map +1 -1
- package/lib/components/AppShell/Drawer.styles.js.map +1 -1
- package/lib/components/AppShell/NavigationList.d.ts +2 -2
- package/lib/components/AppShell/NavigationList.d.ts.map +1 -1
- package/lib/components/AppShell/NavigationList.js.map +1 -1
- package/lib/components/AppShell/NavigationListItemWrapper.d.ts +2 -2
- package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -1
- package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -1
- package/lib/components/AppShell/Operator.d.ts +1 -1
- package/lib/components/AppShell/Operator.d.ts.map +1 -1
- package/lib/components/AppShell/Operator.js.map +1 -1
- package/lib/components/AppShell/style-utils.d.ts +1 -1
- package/lib/components/AppShell/style-utils.d.ts.map +1 -1
- package/lib/components/AppShell/style-utils.js.map +1 -1
- package/lib/components/Avatar/Avatar.d.ts +2 -2
- package/lib/components/Avatar/Avatar.d.ts.map +1 -1
- package/lib/components/Avatar/Avatar.js.map +1 -1
- package/lib/components/Backdrop/Backdrop.d.ts +2 -2
- package/lib/components/Backdrop/Backdrop.d.ts.map +1 -1
- package/lib/components/Backdrop/Backdrop.js.map +1 -1
- package/lib/components/Badges/Alert.d.ts +1 -1
- package/lib/components/Badges/Alert.d.ts.map +1 -1
- package/lib/components/Badges/Alert.js.map +1 -1
- package/lib/components/Badges/Count.d.ts +1 -1
- package/lib/components/Badges/Count.d.ts.map +1 -1
- package/lib/components/Badges/Count.js.map +1 -1
- package/lib/components/Badges/Keyboard.d.ts +1 -1
- package/lib/components/Badges/Keyboard.d.ts.map +1 -1
- package/lib/components/Badges/Keyboard.js.map +1 -1
- package/lib/components/Badges/Selection.d.ts +2 -2
- package/lib/components/Badges/Selection.d.ts.map +1 -1
- 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.map +1 -1
- package/lib/components/Badges/Tag.d.ts +2 -2
- package/lib/components/Badges/Tag.d.ts.map +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.map +1 -1
- package/lib/components/Boolean/BooleanDisplay.d.ts +1 -1
- package/lib/components/Boolean/BooleanDisplay.d.ts.map +1 -1
- package/lib/components/Boolean/BooleanDisplay.js.map +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +4 -4
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/lib/components/Button/BareButton.d.ts +3 -3
- package/lib/components/Button/BareButton.d.ts.map +1 -1
- package/lib/components/Button/BareButton.js.map +1 -1
- package/lib/components/Button/BareRoleButton.d.ts +2 -2
- package/lib/components/Button/BareRoleButton.d.ts.map +1 -1
- package/lib/components/Button/BareRoleButton.js.map +1 -1
- package/lib/components/Button/Button.d.ts +3 -3
- package/lib/components/Button/Button.d.ts.map +1 -1
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Card/Card.d.ts +2 -2
- package/lib/components/Card/Card.d.ts.map +1 -1
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/Card/CardContent.d.ts +3 -3
- package/lib/components/Card/CardContent.d.ts.map +1 -1
- package/lib/components/Card/CardContent.js.map +1 -1
- package/lib/components/Card/CardFooter.d.ts +3 -3
- package/lib/components/Card/CardFooter.d.ts.map +1 -1
- package/lib/components/Card/CardFooter.js.map +1 -1
- package/lib/components/Card/CardHeader.d.ts +2 -2
- package/lib/components/Card/CardHeader.d.ts.map +1 -1
- package/lib/components/Card/CardHeader.js.map +1 -1
- package/lib/components/Card/CardMedia.d.ts +2 -2
- package/lib/components/Card/CardMedia.d.ts.map +1 -1
- package/lib/components/Card/CardMedia.js.map +1 -1
- package/lib/components/Card/CollapsibleCard.d.ts +2 -2
- package/lib/components/Card/CollapsibleCard.d.ts.map +1 -1
- package/lib/components/Card/CollapsibleCard.js.map +1 -1
- package/lib/components/Checkbox/Checkbox.d.ts +4 -4
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.d.ts +4 -4
- package/lib/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- 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.map +1 -1
- package/lib/components/ComboBox/ComboBox.types.d.ts +3 -3
- 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.d.ts +5 -4
- package/lib/components/ComboBox/ComboBoxInput.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBoxInput.js.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts +3 -3
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +1 -0
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.d.ts +4 -4
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.d.ts.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.js.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts +3 -3
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.d.ts +4 -3
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.d.ts.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.js.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.d.ts +2 -2
- package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.js.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.types.d.ts +3 -3
- package/lib/components/CompositeInput/CompositeInput.types.d.ts.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.types.js.map +1 -1
- package/lib/components/Configuration/Configuration.d.ts +3 -3
- package/lib/components/Configuration/Configuration.d.ts.map +1 -1
- package/lib/components/Configuration/Configuration.js.map +1 -1
- package/lib/components/CreditCard/CreditCard.types.d.ts +3 -3
- package/lib/components/CreditCard/CreditCard.types.d.ts.map +1 -1
- package/lib/components/CreditCard/CreditCard.types.js.map +1 -1
- package/lib/components/CreditCard/CreditCardDisplay.d.ts +3 -3
- package/lib/components/CreditCard/CreditCardDisplay.d.ts.map +1 -1
- package/lib/components/CreditCard/CreditCardDisplay.js.map +1 -1
- package/lib/components/CreditCard/CreditCardInput.d.ts +3 -3
- package/lib/components/CreditCard/CreditCardInput.d.ts.map +1 -1
- package/lib/components/CreditCard/CreditCardInput.js.map +1 -1
- package/lib/components/Currency/CurrencyDisplay.d.ts +2 -2
- package/lib/components/Currency/CurrencyDisplay.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyDisplay.js.map +1 -1
- package/lib/components/Currency/CurrencyInput.d.ts +3 -3
- package/lib/components/Currency/CurrencyInput.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.js.map +1 -1
- package/lib/components/Currency/CurrencyInput.types.d.ts +1 -1
- package/lib/components/Currency/CurrencyInput.types.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.types.js.map +1 -1
- package/lib/components/DangerButton/DangerButton.d.ts.map +1 -1
- package/lib/components/DangerButton/DangerButton.js.map +1 -1
- package/lib/components/DateTime/DateTime.types.d.ts +3 -3
- 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 +4 -4
- package/lib/components/DateTime/DateTimeDisplay.d.ts.map +1 -1
- package/lib/components/DateTime/DateTimeDisplay.js.map +1 -1
- package/lib/components/DateTime/DurationDisplay.d.ts +2 -2
- package/lib/components/DateTime/DurationDisplay.d.ts.map +1 -1
- package/lib/components/DateTime/DurationDisplay.js.map +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts +4 -4
- package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.d.ts +4 -4
- package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts +6 -6
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +1 -0
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DayOfWeekInput.d.ts +3 -3
- package/lib/components/DateTime/Input/DayOfWeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DayOfWeekInput.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.d.ts +3 -3
- package/lib/components/DateTime/Input/Duration/DurationInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.types.d.ts +2 -2
- package/lib/components/DateTime/Input/Duration/DurationInput.types.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.types.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/NumberUnit.d.ts +3 -3
- package/lib/components/DateTime/Input/Duration/NumberUnit.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/NumberUnit.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/Time.d.ts +3 -3
- package/lib/components/DateTime/Input/Duration/Time.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/Time.js.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.d.ts +4 -4
- package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
- package/lib/components/DateTime/Input/PartInput.d.ts +3 -3
- package/lib/components/DateTime/Input/PartInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/PartInput.js.map +1 -1
- package/lib/components/DateTime/Input/QuarterInput.d.ts +4 -4
- package/lib/components/DateTime/Input/QuarterInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/QuarterInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.d.ts +5 -5
- package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts +7 -6
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.d.ts +4 -4
- package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
- package/lib/components/DateTime/Input/useAutoFocusNextInput.d.ts +1 -1
- package/lib/components/DateTime/Input/useAutoFocusNextInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/useAutoFocusNextInput.js.map +1 -1
- package/lib/components/DateTime/Input/usePickerButton.d.ts +1 -1
- package/lib/components/DateTime/Input/usePickerButton.d.ts.map +1 -1
- package/lib/components/DateTime/Input/usePickerButton.js.map +1 -1
- package/lib/components/DateTime/Input/utils.d.ts +1 -1
- package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Input/utils.js.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.d.ts +3 -3
- package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.d.ts +2 -2
- package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.types.d.ts +2 -2
- package/lib/components/DateTime/Picker/DatePicker.types.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.types.js.map +1 -1
- package/lib/components/DateTime/Picker/DateRangePicker.d.ts +2 -2
- package/lib/components/DateTime/Picker/DateRangePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.d.ts +3 -3
- package/lib/components/DateTime/Picker/TimePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/Weeks.d.ts +3 -3
- package/lib/components/DateTime/Picker/Weeks.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Weeks.js.map +1 -1
- package/lib/components/DateTime/utils.d.ts +4 -4
- package/lib/components/DateTime/utils.d.ts.map +1 -1
- package/lib/components/DateTime/utils.js.map +1 -1
- package/lib/components/Dialog/Dialog.d.ts +2 -2
- package/lib/components/Dialog/Dialog.d.ts.map +1 -1
- package/lib/components/Dialog/Dialog.js.map +1 -1
- package/lib/components/Dialog/Dialog.types.d.ts +4 -4
- package/lib/components/Dialog/Dialog.types.d.ts.map +1 -1
- package/lib/components/Dialog/Dialog.types.js.map +1 -1
- package/lib/components/Dialog/FormDialog.d.ts +3 -3
- package/lib/components/Dialog/FormDialog.d.ts.map +1 -1
- package/lib/components/Dialog/FormDialog.js.map +1 -1
- package/lib/components/Dialog/InfoDialog.d.ts +2 -2
- package/lib/components/Dialog/InfoDialog.d.ts.map +1 -1
- package/lib/components/Dialog/InfoDialog.js.map +1 -1
- package/lib/components/Drawer/Drawer.d.ts +2 -2
- package/lib/components/Drawer/Drawer.d.ts.map +1 -1
- 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.map +1 -1
- package/lib/components/EmojiPicker/EmojiDisplay.d.ts +2 -2
- package/lib/components/EmojiPicker/EmojiDisplay.d.ts.map +1 -1
- package/lib/components/EmojiPicker/EmojiDisplay.js.map +1 -1
- package/lib/components/EmojiPicker/EmojiPicker.d.ts +4 -4
- package/lib/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/lib/components/EmojiPicker/EmojiPicker.js +28 -21
- package/lib/components/EmojiPicker/EmojiPicker.js.map +1 -1
- package/lib/components/EmptyState/EmptyState.d.ts +2 -2
- package/lib/components/EmptyState/EmptyState.d.ts.map +1 -1
- package/lib/components/EmptyState/EmptyState.js.map +1 -1
- package/lib/components/ErrorState/ErrorState.d.ts +2 -2
- package/lib/components/ErrorState/ErrorState.d.ts.map +1 -1
- package/lib/components/ErrorState/ErrorState.js.map +1 -1
- package/lib/components/ExpandCollapse/ExpandCollapse.d.ts +2 -2
- package/lib/components/ExpandCollapse/ExpandCollapse.d.ts.map +1 -1
- package/lib/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.d.ts +4 -4
- package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.d.ts +3 -3
- package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
- 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.map +1 -1
- package/lib/components/File/FileDisplay.d.ts +3 -3
- package/lib/components/File/FileDisplay.d.ts.map +1 -1
- package/lib/components/File/FileDisplay.js.map +1 -1
- package/lib/components/File/FileInput.d.ts +4 -4
- package/lib/components/File/FileInput.d.ts.map +1 -1
- package/lib/components/File/FileInput.js +1 -1
- package/lib/components/File/FileInput.js.map +1 -1
- package/lib/components/File/FileItem.d.ts +3 -3
- package/lib/components/File/FileItem.d.ts.map +1 -1
- package/lib/components/File/FileItem.js +3 -2
- 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 +15 -6
- package/lib/components/File/FileUploadItem.js.map +1 -1
- package/lib/components/File/FileVisual.d.ts +4 -4
- package/lib/components/File/FileVisual.d.ts.map +1 -1
- package/lib/components/File/FileVisual.js.map +1 -1
- package/lib/components/Flex/Flex.d.ts +2 -2
- package/lib/components/Flex/Flex.d.ts.map +1 -1
- package/lib/components/Flex/Flex.js.map +1 -1
- package/lib/components/Form/Form.d.ts +3 -3
- package/lib/components/Form/Form.d.ts.map +1 -1
- package/lib/components/Form/Form.js.map +1 -1
- package/lib/components/FormControl/FormControl.d.ts +3 -3
- package/lib/components/FormControl/FormControl.d.ts.map +1 -1
- package/lib/components/FormControl/FormControl.js.map +1 -1
- package/lib/components/FormField/FormField.d.ts +6 -6
- package/lib/components/FormField/FormField.d.ts.map +1 -1
- package/lib/components/FormField/FormField.js.map +1 -1
- package/lib/components/Grid/Grid.d.ts +3 -3
- package/lib/components/Grid/Grid.d.ts.map +1 -1
- package/lib/components/Grid/Grid.js.map +1 -1
- package/lib/components/Grid/Grid.types.d.ts +3 -3
- package/lib/components/Grid/Grid.types.d.ts.map +1 -1
- package/lib/components/Grid/Grid.types.js.map +1 -1
- package/lib/components/HTML/HTML.d.ts +3 -3
- package/lib/components/HTML/HTML.d.ts.map +1 -1
- package/lib/components/HTML/HTML.js.map +1 -1
- package/lib/components/Icon/Icon.d.ts +2 -2
- package/lib/components/Icon/Icon.d.ts.map +1 -1
- package/lib/components/Icon/Icon.js +10 -2
- package/lib/components/Icon/Icon.js.map +1 -1
- package/lib/components/IconPicker/IconPicker.d.ts +4 -4
- package/lib/components/IconPicker/IconPicker.d.ts.map +1 -1
- package/lib/components/IconPicker/IconPicker.js.map +1 -1
- package/lib/components/Image/Image.d.ts +2 -2
- package/lib/components/Image/Image.d.ts.map +1 -1
- package/lib/components/Image/Image.js.map +1 -1
- package/lib/components/Input/Input.d.ts +3 -3
- package/lib/components/Input/Input.d.ts.map +1 -1
- package/lib/components/Input/Input.js.map +1 -1
- package/lib/components/Label/Label.d.ts +2 -2
- package/lib/components/Label/Label.d.ts.map +1 -1
- package/lib/components/Label/Label.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.d.ts +3 -3
- package/lib/components/Lightbox/Lightbox.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.types.d.ts +4 -4
- package/lib/components/Lightbox/Lightbox.types.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.types.js.map +1 -1
- package/lib/components/Link/Link.d.ts +3 -3
- package/lib/components/Link/Link.d.ts.map +1 -1
- package/lib/components/Link/Link.js.map +1 -1
- package/lib/components/List/CommaSeparatedList.d.ts +2 -2
- package/lib/components/List/CommaSeparatedList.d.ts.map +1 -1
- package/lib/components/List/CommaSeparatedList.js.map +1 -1
- package/lib/components/List/List.d.ts +2 -2
- package/lib/components/List/List.d.ts.map +1 -1
- package/lib/components/List/List.js.map +1 -1
- package/lib/components/List/OrderedList.d.ts +3 -3
- package/lib/components/List/OrderedList.d.ts.map +1 -1
- package/lib/components/List/OrderedList.js.map +1 -1
- package/lib/components/List/UnorderedList.d.ts +3 -3
- package/lib/components/List/UnorderedList.d.ts.map +1 -1
- package/lib/components/List/UnorderedList.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.d.ts +1 -1
- package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.d.ts +6 -6
- package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
- package/lib/components/ListToolbar/PresetMenuPopover.d.ts +1 -1
- package/lib/components/ListToolbar/PresetMenuPopover.d.ts.map +1 -1
- package/lib/components/ListToolbar/PresetMenuPopover.js.map +1 -1
- package/lib/components/ListToolbar/helpers.d.ts +1 -1
- package/lib/components/ListToolbar/helpers.d.ts.map +1 -1
- package/lib/components/ListToolbar/helpers.js.map +1 -1
- package/lib/components/LiveLog/LiveLog.d.ts +1 -1
- package/lib/components/LiveLog/LiveLog.d.ts.map +1 -1
- package/lib/components/LiveLog/LiveLog.js.map +1 -1
- package/lib/components/LiveLog/LiveLog.types.d.ts +1 -1
- package/lib/components/LiveLog/LiveLog.types.d.ts.map +1 -1
- package/lib/components/LiveLog/LiveLog.types.js.map +1 -1
- package/lib/components/Location/CurrentLocationButton.d.ts +1 -1
- package/lib/components/Location/CurrentLocationButton.d.ts.map +1 -1
- package/lib/components/Location/CurrentLocationButton.js.map +1 -1
- package/lib/components/Location/Location.types.d.ts +2 -2
- 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.d.ts +3 -3
- package/lib/components/Location/LocationDisplay.d.ts.map +1 -1
- package/lib/components/Location/LocationDisplay.js.map +1 -1
- package/lib/components/Location/LocationInput.d.ts +6 -6
- package/lib/components/Location/LocationInput.d.ts.map +1 -1
- package/lib/components/Location/LocationInput.js.map +1 -1
- package/lib/components/Location/LocationView.d.ts +4 -4
- package/lib/components/Location/LocationView.d.ts.map +1 -1
- package/lib/components/Location/LocationView.js.map +1 -1
- package/lib/components/Location/utils.d.ts +1 -1
- package/lib/components/Location/utils.d.ts.map +1 -1
- package/lib/components/Location/utils.js.map +1 -1
- package/lib/components/Mark/Mark.d.ts +2 -2
- package/lib/components/Mark/Mark.d.ts.map +1 -1
- package/lib/components/Mark/Mark.js.map +1 -1
- package/lib/components/Menu/FlyoutMenuList.d.ts +3 -3
- package/lib/components/Menu/FlyoutMenuList.d.ts.map +1 -1
- package/lib/components/Menu/FlyoutMenuList.js.map +1 -1
- package/lib/components/Menu/Menu.context.d.ts +1 -1
- package/lib/components/Menu/Menu.context.d.ts.map +1 -1
- package/lib/components/Menu/Menu.context.js.map +1 -1
- package/lib/components/Menu/Menu.d.ts +3 -3
- package/lib/components/Menu/Menu.d.ts.map +1 -1
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/Menu.styles.d.ts +1 -1
- package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
- package/lib/components/Menu/Menu.styles.js.map +1 -1
- package/lib/components/Menu/Menu.types.d.ts +3 -3
- 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 +1 -1
- package/lib/components/Menu/MenuGroup.d.ts.map +1 -1
- package/lib/components/Menu/MenuGroup.js.map +1 -1
- package/lib/components/Menu/MenuItem.d.ts +3 -3
- package/lib/components/Menu/MenuItem.d.ts.map +1 -1
- package/lib/components/Menu/MenuItem.js.map +1 -1
- package/lib/components/Menu/MenuList.d.ts +2 -2
- package/lib/components/Menu/MenuList.d.ts.map +1 -1
- package/lib/components/Menu/MenuList.js.map +1 -1
- package/lib/components/Menu/MenuListHeader.d.ts +3 -3
- package/lib/components/Menu/MenuListHeader.d.ts.map +1 -1
- package/lib/components/Menu/MenuListHeader.js.map +1 -1
- package/lib/components/Menu/helpers.d.ts +1 -1
- package/lib/components/Menu/helpers.d.ts.map +1 -1
- package/lib/components/Menu/helpers.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.d.ts +3 -3
- package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MetaList/MetaList.d.ts +2 -2
- package/lib/components/MetaList/MetaList.d.ts.map +1 -1
- package/lib/components/MetaList/MetaList.js.map +1 -1
- package/lib/components/Modal/Contexts.d.ts +1 -1
- package/lib/components/Modal/Contexts.d.ts.map +1 -1
- package/lib/components/Modal/Contexts.js.map +1 -1
- package/lib/components/Modal/DockedModals.d.ts +2 -2
- package/lib/components/Modal/DockedModals.d.ts.map +1 -1
- package/lib/components/Modal/DockedModals.js.map +1 -1
- package/lib/components/Modal/MinimizedModal.d.ts +3 -3
- package/lib/components/Modal/MinimizedModal.d.ts.map +1 -1
- package/lib/components/Modal/MinimizedModal.js.map +1 -1
- package/lib/components/Modal/Modal.d.ts +2 -2
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/Modal/Modal.styles.d.ts +1 -1
- package/lib/components/Modal/Modal.styles.d.ts.map +1 -1
- package/lib/components/Modal/Modal.styles.js.map +1 -1
- package/lib/components/Modal/ModalManager.d.ts +2 -2
- package/lib/components/Modal/ModalManager.d.ts.map +1 -1
- package/lib/components/Modal/ModalManager.js.map +1 -1
- package/lib/components/MultiStepForm/FormProgress.styles.d.ts +1 -1
- package/lib/components/MultiStepForm/FormProgress.styles.d.ts.map +1 -1
- package/lib/components/MultiStepForm/FormProgress.styles.js.map +1 -1
- package/lib/components/MultiStepForm/HorizontalFormProgress.d.ts +2 -2
- package/lib/components/MultiStepForm/HorizontalFormProgress.d.ts.map +1 -1
- package/lib/components/MultiStepForm/HorizontalFormProgress.js.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.d.ts +3 -3
- package/lib/components/MultiStepForm/MultiStepForm.d.ts.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.js.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.types.d.ts +3 -3
- package/lib/components/MultiStepForm/MultiStepForm.types.d.ts.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.types.js.map +1 -1
- package/lib/components/MultiStepForm/VerticalFormProgress.d.ts +2 -2
- package/lib/components/MultiStepForm/VerticalFormProgress.d.ts.map +1 -1
- package/lib/components/MultiStepForm/VerticalFormProgress.js.map +1 -1
- package/lib/components/Number/NumberDisplay.d.ts +1 -1
- package/lib/components/Number/NumberDisplay.d.ts.map +1 -1
- package/lib/components/Number/NumberDisplay.js.map +1 -1
- package/lib/components/Number/NumberInput.d.ts +3 -3
- package/lib/components/Number/NumberInput.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.js.map +1 -1
- package/lib/components/Number/NumberInput.types.d.ts +3 -3
- 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/NumberRangeInput.d.ts +1 -1
- package/lib/components/Number/NumberRangeInput.d.ts.map +1 -1
- package/lib/components/Number/NumberRangeInput.js.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.d.ts +3 -3
- package/lib/components/PageTemplates/CategorySubPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.js.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.styles.d.ts.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.styles.js.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.d.ts +3 -3
- package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.d.ts +5 -4
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/Pagination/Pagination.d.ts +1 -1
- package/lib/components/Pagination/Pagination.d.ts.map +1 -1
- package/lib/components/Pagination/Pagination.js.map +1 -1
- package/lib/components/Paragraph/ParagraphDisplay.d.ts +2 -2
- package/lib/components/Paragraph/ParagraphDisplay.d.ts.map +1 -1
- package/lib/components/Paragraph/ParagraphDisplay.js.map +1 -1
- package/lib/components/Phone/PhoneDisplay.d.ts +1 -1
- package/lib/components/Phone/PhoneDisplay.d.ts.map +1 -1
- package/lib/components/Phone/PhoneDisplay.js.map +1 -1
- package/lib/components/Phone/PhoneInput.d.ts +3 -3
- package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
- package/lib/components/Phone/PhoneInput.js.map +1 -1
- package/lib/components/Popover/Popover.d.ts +5 -5
- package/lib/components/Popover/Popover.d.ts.map +1 -1
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/PopoverManager.d.ts +1 -1
- package/lib/components/Popover/PopoverManager.d.ts.map +1 -1
- package/lib/components/Popover/PopoverManager.js.map +1 -1
- package/lib/components/Popover/modifiers.d.ts +1 -1
- package/lib/components/Popover/modifiers.d.ts.map +1 -1
- package/lib/components/Popover/modifiers.js.map +1 -1
- package/lib/components/Progress/Bar.d.ts +3 -3
- package/lib/components/Progress/Bar.d.ts.map +1 -1
- package/lib/components/Progress/Bar.js.map +1 -1
- package/lib/components/Progress/Ellipsis.d.ts +3 -3
- package/lib/components/Progress/Ellipsis.d.ts.map +1 -1
- package/lib/components/Progress/Ellipsis.js.map +1 -1
- package/lib/components/Progress/Progress.d.ts +3 -3
- package/lib/components/Progress/Progress.d.ts.map +1 -1
- package/lib/components/Progress/Progress.js.map +1 -1
- package/lib/components/Progress/Progress.styles.d.ts +1 -1
- package/lib/components/Progress/Progress.styles.d.ts.map +1 -1
- package/lib/components/Progress/Progress.styles.js.map +1 -1
- package/lib/components/Progress/Progress.types.d.ts +3 -3
- 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 +3 -3
- package/lib/components/Progress/Ring.d.ts.map +1 -1
- package/lib/components/Progress/Ring.js.map +1 -1
- package/lib/components/QRCode/QRCode.d.ts +2 -2
- package/lib/components/QRCode/QRCode.d.ts.map +1 -1
- package/lib/components/QRCode/QRCode.js.map +1 -1
- package/lib/components/RadioButton/RadioButton.d.ts +3 -3
- package/lib/components/RadioButton/RadioButton.d.ts.map +1 -1
- package/lib/components/RadioButton/RadioButton.js.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.d.ts +3 -3
- package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts +5 -5
- package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts.map +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
- package/lib/components/Rating/Rating.d.ts +1 -1
- package/lib/components/Rating/Rating.d.ts.map +1 -1
- package/lib/components/Rating/Rating.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts +3 -3
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.js.map +1 -1
- package/lib/components/Select/Option.d.ts +2 -2
- package/lib/components/Select/Option.d.ts.map +1 -1
- package/lib/components/Select/Option.js.map +1 -1
- package/lib/components/Select/Select.d.ts +3 -3
- package/lib/components/Select/Select.d.ts.map +1 -1
- 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.map +1 -1
- package/lib/components/ShortcutManager/ShortcutManager.d.ts +1 -1
- package/lib/components/ShortcutManager/ShortcutManager.d.ts.map +1 -1
- package/lib/components/ShortcutManager/ShortcutManager.js.map +1 -1
- package/lib/components/ShortcutManager/ShortcutManager.types.d.ts +1 -1
- package/lib/components/ShortcutManager/ShortcutManager.types.d.ts.map +1 -1
- package/lib/components/ShortcutManager/ShortcutManager.types.js.map +1 -1
- package/lib/components/ShowMoreLess/ShowMoreLess.d.ts +1 -1
- package/lib/components/ShowMoreLess/ShowMoreLess.d.ts.map +1 -1
- package/lib/components/ShowMoreLess/ShowMoreLess.js.map +1 -1
- package/lib/components/Skeleton/LineSkeleton.d.ts +2 -2
- package/lib/components/Skeleton/LineSkeleton.d.ts.map +1 -1
- package/lib/components/Skeleton/LineSkeleton.js.map +1 -1
- package/lib/components/Skeleton/ParagraphSkeleton.d.ts +2 -2
- package/lib/components/Skeleton/ParagraphSkeleton.d.ts.map +1 -1
- package/lib/components/Skeleton/ParagraphSkeleton.js.map +1 -1
- package/lib/components/Skeleton/RectangleSkeleton.d.ts +2 -2
- package/lib/components/Skeleton/RectangleSkeleton.d.ts.map +1 -1
- package/lib/components/Skeleton/RectangleSkeleton.js.map +1 -1
- package/lib/components/SkipLinks/SkipLinks.d.ts +1 -1
- package/lib/components/SkipLinks/SkipLinks.d.ts.map +1 -1
- package/lib/components/SkipLinks/SkipLinks.js.map +1 -1
- package/lib/components/Slider/Slider.d.ts +3 -3
- package/lib/components/Slider/Slider.d.ts.map +1 -1
- package/lib/components/Slider/Slider.js.map +1 -1
- package/lib/components/Slider/Slider.styles.d.ts +3 -3
- package/lib/components/Slider/Slider.styles.d.ts.map +1 -1
- 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 +2 -2
- package/lib/components/Slider/SliderTicks.d.ts.map +1 -1
- package/lib/components/Slider/SliderTicks.js.map +1 -1
- package/lib/components/Slider/utils.d.ts +2 -1
- package/lib/components/Slider/utils.d.ts.map +1 -1
- package/lib/components/Slider/utils.js.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.d.ts +3 -3
- package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
- package/lib/components/SummaryList/SummaryList.d.ts +6 -5
- package/lib/components/SummaryList/SummaryList.d.ts.map +1 -1
- package/lib/components/SummaryList/SummaryList.js.map +1 -1
- package/lib/components/SummaryList/ViewAll.d.ts +3 -3
- package/lib/components/SummaryList/ViewAll.d.ts.map +1 -1
- 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.map +1 -1
- package/lib/components/Table/Table.d.ts +1 -1
- package/lib/components/Table/Table.d.ts.map +1 -1
- package/lib/components/Table/Table.js.map +1 -1
- package/lib/components/Tabs/Tab.d.ts +3 -3
- package/lib/components/Tabs/Tab.d.ts.map +1 -1
- package/lib/components/Tabs/Tab.js.map +1 -1
- package/lib/components/Tabs/TabPanel.d.ts +2 -2
- package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
- package/lib/components/Tabs/TabPanel.js.map +1 -1
- package/lib/components/Tabs/Tabs.d.ts +3 -3
- package/lib/components/Tabs/Tabs.d.ts.map +1 -1
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/components/Tabs/Tabs.types.d.ts +1 -1
- 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 +2 -2
- package/lib/components/Text/Text.d.ts.map +1 -1
- package/lib/components/Text/Text.js.map +1 -1
- package/lib/components/TextArea/TextArea.d.ts +3 -3
- package/lib/components/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.js.map +1 -1
- package/lib/components/Toaster/Context.d.ts +1 -1
- package/lib/components/Toaster/Context.d.ts.map +1 -1
- package/lib/components/Toaster/Context.js.map +1 -1
- package/lib/components/Toaster/Toaster.d.ts +3 -3
- package/lib/components/Toaster/Toaster.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.js.map +1 -1
- package/lib/components/Toaster/Toaster.types.d.ts +2 -2
- package/lib/components/Toaster/Toaster.types.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.types.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.d.ts +3 -3
- package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/components/Tree/StandardTree.d.ts.map +1 -1
- package/lib/components/Tree/StandardTree.js.map +1 -1
- package/lib/components/Tree/StandardTree.styles.d.ts +1 -1
- package/lib/components/Tree/StandardTree.styles.d.ts.map +1 -1
- package/lib/components/Tree/StandardTree.styles.js.map +1 -1
- package/lib/components/Tree/Tree.d.ts +2 -2
- package/lib/components/Tree/Tree.d.ts.map +1 -1
- package/lib/components/Tree/Tree.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.map +1 -1
- package/lib/components/VisuallyHiddenText/VisuallyHiddenText.d.ts +2 -2
- package/lib/components/VisuallyHiddenText/VisuallyHiddenText.d.ts.map +1 -1
- package/lib/components/VisuallyHiddenText/VisuallyHiddenText.js.map +1 -1
- package/lib/hooks/index.d.ts +2 -1
- package/lib/hooks/index.d.ts.map +1 -1
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useActiveDescendant.d.ts +2 -2
- package/lib/hooks/useActiveDescendant.d.ts.map +1 -1
- package/lib/hooks/useActiveDescendant.js.map +1 -1
- package/lib/hooks/useAfterInitialEffect.d.ts +1 -1
- package/lib/hooks/useAfterInitialEffect.d.ts.map +1 -1
- package/lib/hooks/useAfterInitialEffect.js.map +1 -1
- package/lib/hooks/useArrows.d.ts +1 -1
- package/lib/hooks/useArrows.d.ts.map +1 -1
- package/lib/hooks/useArrows.js.map +1 -1
- package/lib/hooks/useAutoResize.d.ts +1 -1
- package/lib/hooks/useAutoResize.d.ts.map +1 -1
- package/lib/hooks/useAutoResize.js.map +1 -1
- package/lib/hooks/useBreakpoint.d.ts +1 -1
- package/lib/hooks/useBreakpoint.d.ts.map +1 -1
- package/lib/hooks/useBreakpoint.js.map +1 -1
- package/lib/hooks/useConsolidatedRef.d.ts +1 -1
- package/lib/hooks/useConsolidatedRef.d.ts.map +1 -1
- package/lib/hooks/useConsolidatedRef.js.map +1 -1
- package/lib/hooks/useDraggable.d.ts +1 -1
- package/lib/hooks/useDraggable.d.ts.map +1 -1
- package/lib/hooks/useDraggable.js.map +1 -1
- package/lib/hooks/useElement.d.ts +1 -1
- package/lib/hooks/useElement.d.ts.map +1 -1
- package/lib/hooks/useElement.js.map +1 -1
- package/lib/hooks/useEscape.d.ts +1 -1
- package/lib/hooks/useEscape.d.ts.map +1 -1
- package/lib/hooks/useEscape.js.map +1 -1
- package/lib/hooks/useEvent.d.ts +1 -1
- package/lib/hooks/useEvent.d.ts.map +1 -1
- package/lib/hooks/useEvent.js.map +1 -1
- package/lib/hooks/useFocusTrap.d.ts +1 -1
- package/lib/hooks/useFocusTrap.d.ts.map +1 -1
- package/lib/hooks/useFocusTrap.js.map +1 -1
- package/lib/hooks/useFocusWithin.d.ts +1 -1
- package/lib/hooks/useFocusWithin.d.ts.map +1 -1
- package/lib/hooks/useFocusWithin.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +4 -0
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useInputFormatter.d.ts +1 -1
- package/lib/hooks/useInputFormatter.d.ts.map +1 -1
- package/lib/hooks/useInputFormatter.js.map +1 -1
- package/lib/hooks/useItemIntersection.d.ts +1 -1
- package/lib/hooks/useItemIntersection.d.ts.map +1 -1
- package/lib/hooks/useItemIntersection.js.map +1 -1
- package/lib/hooks/useOuterEvent.d.ts +1 -1
- package/lib/hooks/useOuterEvent.d.ts.map +1 -1
- package/lib/hooks/useOuterEvent.js.map +1 -1
- package/lib/hooks/useTestIds.d.ts +1 -1
- package/lib/hooks/useTestIds.d.ts.map +1 -1
- package/lib/hooks/useTestIds.js.map +1 -1
- package/lib/hooks/useTheme.d.ts +1 -1
- package/lib/hooks/useTheme.d.ts.map +1 -1
- package/lib/hooks/useTheme.js.map +1 -1
- package/lib/hooks/useTransitionState.d.ts +1 -1
- package/lib/hooks/useTransitionState.d.ts.map +1 -1
- package/lib/hooks/useTransitionState.js.map +1 -1
- package/lib/i18n/default.d.ts +4 -0
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +4 -0
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +4 -0
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/i18n/translate.js.map +1 -1
- package/lib/styles/GlobalStyle.d.ts +1 -1
- package/lib/styles/GlobalStyle.d.ts.map +1 -1
- package/lib/styles/GlobalStyle.js.map +1 -1
- package/lib/styles/utils.d.ts +2 -2
- package/lib/styles/utils.d.ts.map +1 -1
- package/lib/styles/utils.js.map +1 -1
- package/lib/theme/ThemeMachine.d.ts +1 -1
- package/lib/theme/ThemeMachine.d.ts.map +1 -1
- package/lib/theme/ThemeMachine.js.map +1 -1
- package/lib/theme/theme.d.ts +2 -1
- package/lib/theme/theme.d.ts.map +1 -1
- package/lib/theme/theme.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HTML.js","sourceRoot":"","sources":["../../../src/components/HTML/HTML.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAIV,QAAQ,EACR,SAAS,EACT,OAAO,EACR,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAgB,MAAM,mBAAmB,CAAC;AAC9D,OAAO,eAAe,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAY,MAAM,cAAc,CAAC;AAE3D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AAE,GAAG,SAAS,EAA8B,EACzE,GAAqB;IAErB,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,EAAE;QACjC,6CAA6C;QAC7C,OAAO,OAAO,IAAI,SAAS,CAAC,WAAW;YACrC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE;gBAC1B,WAAW,EAAE,CAAC,OAAO,CAAC;gBACtB,uBAAuB,EAAE;oBACvB,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI;iBAC1E;aACF,CAAC;YACJ,CAAC,CAAC,EAAE,CAAC;IACT,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;IACnC,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAEnD,SAAS,CAAC,GAAG,EAAE;QACb,UAAU,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,KAAC,UAAU,mBACI,OAAO,CAAC,IAAI,KACrB,SAAS,EACb,uBAAuB,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,EAClD,GAAG,EAAE,GAAG,GACR,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n useState,\n useEffect,\n useMemo\n} from 'react';\nimport styled, { css, DefaultTheme } from 'styled-components';\nimport createDOMPurify from 'dompurify';\n\nimport { StyledPopover } from '../Popover';\nimport { defaultThemeProp } from '../../theme';\nimport { calculateFontSize, FontSize } from '../../styles';\nimport { BaseProps, ForwardProps, NoChildrenProp, TestIdProp } from '../../types';\nimport { sameOrigin, withTestIds } from '../../utils';\nimport { useTestIds } from '../../hooks';\n\nimport { getHTMLTestIds } from './HTML.test-ids';\n\nconst DOMPurify = createDOMPurify();\n\nexport interface HTMLProps extends BaseProps, NoChildrenProp, TestIdProp {\n content: string;\n customTags?: string[];\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const listStyles = css`\n ul,\n ol {\n padding-inline-start: 2.5rem;\n }\n\n li {\n margin: 0.5rem 0;\n }\n\n ul li {\n ul {\n margin-inline-start: 1rem;\n list-style-type: circle;\n }\n\n ul ul {\n margin-inline-start: 2rem;\n list-style-type: square;\n }\n\n ul ul ul {\n margin-inline-start: 3rem;\n list-style-type: disc;\n }\n }\n\n ol li {\n ol {\n margin-inline-start: 1rem;\n list-style-type: lower-alpha;\n }\n\n ol ol {\n margin-inline-start: 2rem;\n list-style-type: lower-roman;\n }\n\n ol ol ol {\n margin-inline-start: 3rem;\n list-style-type: decimal;\n }\n }\n`;\n\nexport const getTableStyles = (theme: DefaultTheme) => css`\n border-collapse: collapse;\n\n td {\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n min-width: 6.25rem;\n }\n\n tr:first-child {\n td:first-child {\n border-top-left-radius: 0.125rem;\n }\n\n td:last-child {\n border-top-right-radius: 0.125rem;\n }\n }\n\n tr:last-child {\n td:first-child {\n border-bottom-left-radius: 0.125rem;\n }\n\n td:last-child {\n border-bottom-right-radius: 0.125rem;\n }\n }\n`;\n\nexport const getHtmlStyles = (theme: DefaultTheme) => {\n const {\n base: { 'font-size': baseFontSize, 'font-scale': baseFontScale, palette },\n components: { text }\n } = theme;\n const fontSize = calculateFontSize(baseFontSize, baseFontScale);\n return `\n ${listStyles}\n table {\n ${getTableStyles(theme)}\n }\n img {\n max-width: 100%;\n height: auto;\n border-radius: 0.25rem;\n }\n a {\n color: ${palette.interactive};\n }\n pre {\n white-space: break-spaces;\n }\n p {\n min-height: ${fontSize[text.primary['font-size'] as FontSize]};\n }\n h1 {\n font-size: ${fontSize[text.h1['font-size'] as FontSize]};\n font-weight: ${text.h1['font-weight']};\n min-height: ${fontSize[text.h1['font-size'] as FontSize]};\n }\n h2 {\n font-size: ${fontSize[text.h2['font-size'] as FontSize]};\n font-weight: ${text.h2['font-weight']};\n min-height: ${fontSize[text.h2['font-size'] as FontSize]};\n }\n h3 {\n font-size: ${fontSize[text.h3['font-size'] as FontSize]};\n font-weight: ${text.h3['font-weight']};\n min-height: ${fontSize[text.h3['font-size'] as FontSize]};\n }\n h4 {\n font-size: ${fontSize[text.h4['font-size'] as FontSize]};\n font-weight: ${text.h4['font-weight']};\n min-height: ${fontSize[text.h4['font-size'] as FontSize]};\n }\n h5 {\n font-size: ${fontSize[text.h5['font-size'] as FontSize]};\n font-weight: ${text.h5['font-weight']};\n min-height: ${fontSize[text.h5['font-size'] as FontSize]};\n }\n h6 {\n font-size: ${fontSize[text.h6['font-size'] as FontSize]};\n font-weight: ${text.h6['font-weight']};\n min-height: ${fontSize[text.h6['font-size'] as FontSize]};\n }\n `;\n};\n\nexport const StyledHTML = styled.div(({ theme }) => {\n return css`\n width: 100%;\n overflow-x: auto;\n overflow-wrap: break-word;\n contain: paint;\n ${getHtmlStyles(theme)}\n\n ${StyledPopover} ul {\n ul {\n padding-inline-start: 0;\n }\n ol {\n padding-inline-start: 0;\n }\n }\n\n ${StyledPopover} li {\n margin: 0;\n }\n `;\n});\n\nStyledHTML.defaultProps = defaultThemeProp;\n\nif (DOMPurify.isSupported) {\n const targetBlankSet = new WeakSet<HTMLAnchorElement>();\n\n DOMPurify.addHook('beforeSanitizeAttributes', node => {\n // Can be passed text nodes\n if (!(node instanceof HTMLElement || node instanceof SVGElement)) return;\n\n node.removeAttribute('class');\n\n if (\n node.tagName === 'A' &&\n node.hasAttribute('href') &&\n node.getAttribute('target') === '_blank'\n ) {\n targetBlankSet.add(node as HTMLAnchorElement);\n }\n });\n\n DOMPurify.addHook('afterSanitizeAttributes', node => {\n if (node.tagName === 'A' && node.hasAttribute('href')) {\n const href = node.getAttribute('href')!;\n\n let fullURL: URL;\n try {\n fullURL = new URL(href, window.location.href);\n } catch (e) {\n return;\n }\n\n if (!sameOrigin(window.location, fullURL)) {\n node.setAttribute('target', '_blank');\n node.setAttribute('rel', 'noopener');\n } else if (targetBlankSet.has(node as HTMLAnchorElement)) {\n node.setAttribute('target', '_blank');\n targetBlankSet.delete(node as HTMLAnchorElement);\n }\n }\n });\n}\n\nconst HTML: FunctionComponent<HTMLProps & ForwardProps> = forwardRef(function HTML(\n { testId, content, customTags, ...restProps }: PropsWithoutRef<HTMLProps>,\n ref: HTMLProps['ref']\n) {\n const [mounted, setMounted] = useState(false);\n const sanitizedHtml = useMemo(() => {\n // Don't render content on the server at all.\n return mounted && DOMPurify.isSupported\n ? DOMPurify.sanitize(content, {\n FORBID_TAGS: ['style'],\n CUSTOM_ELEMENT_HANDLING: {\n tagNameCheck: customTags ? tagName => customTags.includes(tagName) : null\n }\n })\n : '';\n }, [content, customTags, mounted]);\n const testIds = useTestIds(testId, getHTMLTestIds);\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n return (\n <StyledHTML\n data-testid={testIds.root}\n {...restProps}\n dangerouslySetInnerHTML={{ __html: sanitizedHtml }}\n ref={ref}\n />\n );\n});\n\nexport default withTestIds(HTML, getHTMLTestIds);\n"]}
|
|
1
|
+
{"version":3,"file":"HTML.js","sourceRoot":"","sources":["../../../src/components/HTML/HTML.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,eAAe,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAA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,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,SAAS,EAA8B,EACzE,GAAqB;IAErB,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,EAAE;QACjC,6CAA6C;QAC7C,OAAO,OAAO,IAAI,SAAS,CAAC,WAAW;YACrC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE;gBAC1B,WAAW,EAAE,CAAC,OAAO,CAAC;gBACtB,uBAAuB,EAAE;oBACvB,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI;iBAC1E;aACF,CAAC;YACJ,CAAC,CAAC,EAAE,CAAC;IACT,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;IACnC,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAEnD,SAAS,CAAC,GAAG,EAAE;QACb,UAAU,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,KAAC,UAAU,mBACI,OAAO,CAAC,IAAI,KACrB,SAAS,EACb,uBAAuB,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,EAClD,GAAG,EAAE,GAAG,GACR,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import { forwardRef, useState, useEffect, useMemo } from 'react';\nimport type { FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\nimport createDOMPurify from 'dompurify';\n\nimport { StyledPopover } from '../Popover';\nimport { defaultThemeProp } from '../../theme';\nimport { calculateFontSize } from '../../styles';\nimport type { FontSize } from '../../styles';\nimport type { BaseProps, ForwardProps, NoChildrenProp, TestIdProp } from '../../types';\nimport { sameOrigin, withTestIds } from '../../utils';\nimport { useTestIds } from '../../hooks';\n\nimport { getHTMLTestIds } from './HTML.test-ids';\n\nconst DOMPurify = createDOMPurify();\n\nexport interface HTMLProps extends BaseProps, NoChildrenProp, TestIdProp {\n content: string;\n customTags?: string[];\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const listStyles = css`\n ul,\n ol {\n padding-inline-start: 2.5rem;\n }\n\n li {\n margin: 0.5rem 0;\n }\n\n ul li {\n ul {\n margin-inline-start: 1rem;\n list-style-type: circle;\n }\n\n ul ul {\n margin-inline-start: 2rem;\n list-style-type: square;\n }\n\n ul ul ul {\n margin-inline-start: 3rem;\n list-style-type: disc;\n }\n }\n\n ol li {\n ol {\n margin-inline-start: 1rem;\n list-style-type: lower-alpha;\n }\n\n ol ol {\n margin-inline-start: 2rem;\n list-style-type: lower-roman;\n }\n\n ol ol ol {\n margin-inline-start: 3rem;\n list-style-type: decimal;\n }\n }\n`;\n\nexport const getTableStyles = (theme: DefaultTheme) => css`\n border-collapse: collapse;\n\n td {\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n min-width: 6.25rem;\n }\n\n tr:first-child {\n td:first-child {\n border-top-left-radius: 0.125rem;\n }\n\n td:last-child {\n border-top-right-radius: 0.125rem;\n }\n }\n\n tr:last-child {\n td:first-child {\n border-bottom-left-radius: 0.125rem;\n }\n\n td:last-child {\n border-bottom-right-radius: 0.125rem;\n }\n }\n`;\n\nexport const getHtmlStyles = (theme: DefaultTheme) => {\n const {\n base: { 'font-size': baseFontSize, 'font-scale': baseFontScale, palette },\n components: { text }\n } = theme;\n const fontSize = calculateFontSize(baseFontSize, baseFontScale);\n return `\n ${listStyles}\n table {\n ${getTableStyles(theme)}\n }\n img {\n max-width: 100%;\n height: auto;\n border-radius: 0.25rem;\n }\n a {\n color: ${palette.interactive};\n }\n pre {\n white-space: break-spaces;\n }\n p {\n min-height: ${fontSize[text.primary['font-size'] as FontSize]};\n }\n h1 {\n font-size: ${fontSize[text.h1['font-size'] as FontSize]};\n font-weight: ${text.h1['font-weight']};\n min-height: ${fontSize[text.h1['font-size'] as FontSize]};\n }\n h2 {\n font-size: ${fontSize[text.h2['font-size'] as FontSize]};\n font-weight: ${text.h2['font-weight']};\n min-height: ${fontSize[text.h2['font-size'] as FontSize]};\n }\n h3 {\n font-size: ${fontSize[text.h3['font-size'] as FontSize]};\n font-weight: ${text.h3['font-weight']};\n min-height: ${fontSize[text.h3['font-size'] as FontSize]};\n }\n h4 {\n font-size: ${fontSize[text.h4['font-size'] as FontSize]};\n font-weight: ${text.h4['font-weight']};\n min-height: ${fontSize[text.h4['font-size'] as FontSize]};\n }\n h5 {\n font-size: ${fontSize[text.h5['font-size'] as FontSize]};\n font-weight: ${text.h5['font-weight']};\n min-height: ${fontSize[text.h5['font-size'] as FontSize]};\n }\n h6 {\n font-size: ${fontSize[text.h6['font-size'] as FontSize]};\n font-weight: ${text.h6['font-weight']};\n min-height: ${fontSize[text.h6['font-size'] as FontSize]};\n }\n `;\n};\n\nexport const StyledHTML = styled.div(({ theme }) => {\n return css`\n width: 100%;\n overflow-x: auto;\n overflow-wrap: break-word;\n contain: paint;\n ${getHtmlStyles(theme)}\n\n ${StyledPopover} ul {\n ul {\n padding-inline-start: 0;\n }\n ol {\n padding-inline-start: 0;\n }\n }\n\n ${StyledPopover} li {\n margin: 0;\n }\n `;\n});\n\nStyledHTML.defaultProps = defaultThemeProp;\n\nif (DOMPurify.isSupported) {\n const targetBlankSet = new WeakSet<HTMLAnchorElement>();\n\n DOMPurify.addHook('beforeSanitizeAttributes', node => {\n // Can be passed text nodes\n if (!(node instanceof HTMLElement || node instanceof SVGElement)) return;\n\n node.removeAttribute('class');\n\n if (\n node.tagName === 'A' &&\n node.hasAttribute('href') &&\n node.getAttribute('target') === '_blank'\n ) {\n targetBlankSet.add(node as HTMLAnchorElement);\n }\n });\n\n DOMPurify.addHook('afterSanitizeAttributes', node => {\n if (node.tagName === 'A' && node.hasAttribute('href')) {\n const href = node.getAttribute('href')!;\n\n let fullURL: URL;\n try {\n fullURL = new URL(href, window.location.href);\n } catch (e) {\n return;\n }\n\n if (!sameOrigin(window.location, fullURL)) {\n node.setAttribute('target', '_blank');\n node.setAttribute('rel', 'noopener');\n } else if (targetBlankSet.has(node as HTMLAnchorElement)) {\n node.setAttribute('target', '_blank');\n targetBlankSet.delete(node as HTMLAnchorElement);\n }\n }\n });\n}\n\nconst HTML: FunctionComponent<HTMLProps & ForwardProps> = forwardRef(function HTML(\n { testId, content, customTags, ...restProps }: PropsWithoutRef<HTMLProps>,\n ref: HTMLProps['ref']\n) {\n const [mounted, setMounted] = useState(false);\n const sanitizedHtml = useMemo(() => {\n // Don't render content on the server at all.\n return mounted && DOMPurify.isSupported\n ? DOMPurify.sanitize(content, {\n FORBID_TAGS: ['style'],\n CUSTOM_ELEMENT_HANDLING: {\n tagNameCheck: customTags ? tagName => customTags.includes(tagName) : null\n }\n })\n : '';\n }, [content, customTags, mounted]);\n const testIds = useTestIds(testId, getHTMLTestIds);\n\n useEffect(() => {\n setMounted(true);\n }, []);\n\n return (\n <StyledHTML\n data-testid={testIds.root}\n {...restProps}\n dangerouslySetInnerHTML={{ __html: sanitizedHtml }}\n ref={ref}\n />\n );\n});\n\nexport default withTestIds(HTML, getHTMLTestIds);\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentType, ForwardRefExoticComponent } from 'react';
|
|
2
|
-
import { NoChildrenProp, WithAttributes } from '../../types';
|
|
1
|
+
import type { ComponentType, ForwardRefExoticComponent } from 'react';
|
|
2
|
+
import type { NoChildrenProp, WithAttributes } from '../../types';
|
|
3
3
|
type BaseIconProps = NoChildrenProp & {
|
|
4
4
|
/**
|
|
5
5
|
* The name of the icon set.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAwB,aAAa,EAAE,yBAAyB,EAAE,MAAM,OAAO,CAAC;AAK5F,OAAO,KAAK,EAAE,cAAc,EAAc,cAAc,EAAE,MAAM,aAAa,CAAC;AAG9E,KAAK,aAAa,GAAG,cAAc,GAAG;IACpC;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gGAAgG;IAChG,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,WAAW,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,SAAS,GACjB,cAAc,CACZ,KAAK,EACL,aAAa,GAAG;IACd,wBAAwB;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC7B,CACF,GACD,cAAc,CACZ,KAAK,EACL,aAAa,GAAG;IACd,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CACF,CAAC;AAEN,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,aAAa,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,UAAW,SAAQ,cAAc;IAChD,GAAG,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;IACvB,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;CACzB;AAID,eAAO,MAAM,YAAY,aAAc,UAAU,EAAE,SAUlD,CAAC;AAEF,eAAO,MAAM,iBAAiB,aAAc,UAAU,EAAE,SAUvD,CAAC;AAEF,eAAO,MAAM,UAAU;WAAuB,SAAS,CAAC,MAAM,CAAC;SA0C7D,CAAC;AAIH,eAAO,MAAM,eAAe;gBACd,YAAY,SAAS,CAAC,YAAY,CAAC,CAAC;iBACnC,SAAS,CAAC,YAAY,CAAC;WAC7B,SAAS,CAAC,MAAM,CAAC;YAChB,SAAS,CAAC,OAAO,CAAC;SAgE1B,CAAC;AAMH,QAAA,MAAM,IAAI,sCAoFgC,CAAC;AAE3C,eAAe,IAAI,CAAC"}
|
|
@@ -134,17 +134,25 @@ const Icon = forwardRef(function Icon({ set: setProp, name, size, ...restProps }
|
|
|
134
134
|
(async () => {
|
|
135
135
|
try {
|
|
136
136
|
const encodedName = encodeURIComponent(name);
|
|
137
|
+
let iconSet;
|
|
137
138
|
let module;
|
|
138
139
|
switch (set) {
|
|
139
140
|
case 'streamline':
|
|
140
|
-
|
|
141
|
+
iconSet = 'streamline-icons';
|
|
141
142
|
break;
|
|
142
143
|
case 'budicon':
|
|
143
|
-
|
|
144
|
+
iconSet = 'icons';
|
|
144
145
|
break;
|
|
145
146
|
default:
|
|
146
147
|
throw new Error('Unknown icon');
|
|
147
148
|
}
|
|
149
|
+
// The following expression is required for Storybook Vite Builder
|
|
150
|
+
try {
|
|
151
|
+
module = await import(`./${iconSet}/${encodedName}.icon`);
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
module = await import(`./${iconSet}/${encodedName}.icon.tsx`);
|
|
155
|
+
}
|
|
148
156
|
if (module.name !== name || !module.Component)
|
|
149
157
|
throw new Error('Malformed icon definition');
|
|
150
158
|
registerIcon(module);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EAKV,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CA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,OAAO,SAAS,CAAC,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,CAChD,KAAC,eAAe,IACd,IAAI,EAAC,cAAc,KACf,SAAS,EACb,UAAU,EAAE,SAAS,CAAC,UAAU,EAChC,UAAU,EAAE,SAAS,CAAC,UAAU,EAChC,KAAK,EAAE,SAAS,CAAC,KAAK,EACtB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,GAA0B,YAE/B,KAAC,UAAU,IAAC,OAAO,EAAE,OAAO,CAAC,OAAO,YAClC,KAAC,OAAO,CAAC,SAAS,KAAG,GACV,GACG,CACnB,CAAC,CAAC,CAAC,CACF,KAAC,UAAU,IACT,IAAI,EAAC,cAAc,KACf,SAAS,EACb,OAAO,EAAE,OAAO,CAAC,OAAO,EACxB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,GAAyB,YAE9B,KAAC,OAAO,CAAC,SAAS,KAAG,GACV,CACd,CAAC;AACJ,CAAC,CAAyC,CAAC;AAE3C,eAAe,IAAI,CAAC","sourcesContent":["import {\n forwardRef,\n useState,\n useEffect,\n Ref,\n PropsWithoutRef,\n ComponentType,\n ForwardRefExoticComponent\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport { useTheme } from '../../hooks';\nimport { NoChildrenProp, RefElement, WithAttributes } from '../../types';\nimport { defaultThemeProp } from '../../theme';\n\ntype BaseIconProps = NoChildrenProp & {\n /**\n * The name of the icon set.\n * @default theme.base['icon-set']\n */\n set?: string;\n /** The name indicating the Cosmos Icon. Reference the catalog above for the available names. */\n name: string;\n /**\n * Background & svg size.\n * @default \"s\" without background, \"m\" with background.\n */\n size?: 's' | 'm' | 'l' | 'font-size';\n};\n\nexport type IconProps =\n | WithAttributes<\n 'div',\n BaseIconProps & {\n /** Background color. */\n background: string;\n /**\n * Foreground color (svg fill).\n * Applies readable color off background if undefined.\n */\n foreground?: string;\n /**\n * Shape of the background.\n * @default 'square'\n */\n shape?: 'square' | 'circle';\n }\n >\n | WithAttributes<\n 'svg',\n BaseIconProps & {\n background?: never;\n foreground?: never;\n shape?: never;\n }\n >;\n\nexport interface IconDefinition {\n Component: ComponentType;\n viewBox?: string;\n}\n\nexport interface IconModule extends IconDefinition {\n set?: IconProps['set'];\n name: IconProps['name'];\n}\n\nconst iconRegistry = new Map<string, Map<string, IconDefinition>>([]);\n\nexport const registerIcon = (...icons: IconModule[]) => {\n icons.forEach(({ set: modSet, name, ...iconDef }) => {\n const set = modSet ?? 'budicon';\n\n if (!iconRegistry.has(set)) {\n iconRegistry.set(set, new Map([[name, iconDef]]));\n } else if (!iconRegistry.get(set)!.has(name)) {\n iconRegistry.get(set)!.set(name, iconDef);\n }\n });\n};\n\nexport const forceRegisterIcon = (...icons: IconModule[]) => {\n icons.forEach(({ set: modSet, name, ...iconDef }) => {\n const set = modSet ?? 'budicon';\n\n if (!iconRegistry.has(set)) {\n iconRegistry.set(set, new Map([[name, iconDef]]));\n } else {\n iconRegistry.get(set)!.set(name, iconDef);\n }\n });\n};\n\nexport const StyledIcon = styled.svg<{ size?: IconProps['size'] }>(({ theme, size = 's' }) => {\n const {\n components: {\n icon: {\n size: { s, m, l }\n }\n }\n } = theme;\n return css`\n display: inline-block;\n fill: currentColor;\n vertical-align: middle;\n flex-shrink: 0;\n /* stylelint-disable unit-allowed-list */\n min-width: 14px;\n min-height: 14px;\n /* stylelint-enable unit-allowed-list */\n\n ${size === 's' &&\n css`\n width: ${s};\n height: ${s};\n `}\n\n ${size === 'm' &&\n css`\n width: ${m};\n height: ${m};\n `}\n\n ${size === 'l' &&\n css`\n width: ${l};\n height: ${l};\n `}\n\n ${size === 'font-size' &&\n css`\n width: 1em;\n height: 1em;\n `}\n `;\n});\n\nStyledIcon.defaultProps = defaultThemeProp;\n\nexport const StyledIconShape = styled.div<{\n background: NonNullable<IconProps['background']>;\n foreground?: IconProps['foreground'];\n size?: IconProps['size'];\n shape?: IconProps['shape'];\n}>(({ theme, background, foreground, size = 'm', shape = 'square' }) => {\n const readableFg = readableColor(background);\n\n const {\n base: { 'border-radius': baseRadius },\n components: {\n icon: {\n size: { s, m, l },\n 'border-radius-multiplier': borderRadiusMultiplier\n }\n }\n } = theme;\n\n return css`\n color: ${foreground ?? readableFg};\n background-color: ${background};\n display: flex;\n justify-content: center;\n align-items: center;\n\n ${size === 's' &&\n css`\n width: ${s};\n height: ${s};\n `}\n\n ${size === 'm' &&\n css`\n width: ${m};\n height: ${m};\n `}\n\n ${size === 'l' &&\n css`\n width: ${l};\n height: ${l};\n `}\n\n ${size === 'font-size' &&\n css`\n width: 1em;\n height: 1em;\n `}\n\n ${shape === 'square' &&\n css`\n border-radius: calc(${borderRadiusMultiplier} * ${baseRadius});\n `}\n\n ${shape === 'circle' &&\n css`\n border-radius: 50%;\n `}\n\n ${StyledIcon} {\n width: 50%;\n height: 50%;\n /* stylelint-disable unit-allowed-list */\n min-width: min(14px, 90%);\n min-height: min(14px, 90%);\n /* stylelint-enable unit-allowed-list */\n }\n `;\n});\n\nStyledIconShape.defaultProps = defaultThemeProp;\n\nconst emptyIconDefinition: Readonly<IconDefinition> = Object.freeze({ Component: () => null });\n\nconst Icon = forwardRef<RefElement<IconProps>, PropsWithoutRef<IconProps>>(function Icon(\n { set: setProp, name, size, ...restProps }: PropsWithoutRef<IconProps>,\n ref\n) {\n const {\n base: { 'icon-set': setTheme }\n } = useTheme();\n\n const set = setProp ?? setTheme ?? 'budicon';\n\n const [iconDef, setIconDef] = useState(iconRegistry.get(set)?.get(name) ?? emptyIconDefinition);\n\n useEffect(() => {\n if (iconRegistry.get(set)?.has(name)) {\n setIconDef(iconRegistry.get(set)!.get(name)!);\n return;\n }\n\n const controller = new AbortController();\n\n (async () => {\n try {\n const encodedName = encodeURIComponent(name);\n\n let module: IconModule;\n\n switch (set) {\n case 'streamline':\n module = await import(`./streamline-icons/${encodedName}.icon`);\n break;\n case 'budicon':\n module = await import(`./icons/${encodedName}.icon`);\n break;\n default:\n throw new Error('Unknown icon');\n }\n\n if (module.name !== name || !module.Component) throw new Error('Malformed icon definition');\n\n registerIcon(module);\n } catch {\n registerIcon({ set, name, ...emptyIconDefinition });\n }\n\n if (!controller.signal.aborted) {\n setIconDef(iconRegistry.get(set)!.get(name) ?? emptyIconDefinition);\n }\n })();\n\n return () => controller.abort();\n }, [name, set]);\n\n return typeof restProps.background === 'string' ? (\n <StyledIconShape\n role='presentation'\n {...restProps}\n background={restProps.background}\n foreground={restProps.foreground}\n shape={restProps.shape}\n size={size}\n ref={ref as Ref<HTMLDivElement>}\n >\n <StyledIcon viewBox={iconDef.viewBox}>\n <iconDef.Component />\n </StyledIcon>\n </StyledIconShape>\n ) : (\n <StyledIcon\n role='presentation'\n {...restProps}\n viewBox={iconDef.viewBox}\n size={size}\n ref={ref as Ref<SVGSVGElement>}\n >\n <iconDef.Component />\n </StyledIcon>\n );\n}) as ForwardRefExoticComponent<IconProps>;\n\nexport default Icon;\n"]}
|
|
1
|
+
{"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAsD/C,MAAM,YAAY,GAAG,IAAI,GAAG,CAAsC,EAAE,CAAC,CAAC;AAEtE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAAG,KAAmB,EAAE,EAAE;IACrD,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,EAAE;QAClD,MAAM,GAAG,GAAG,MAAM,IAAI,SAAS,CAAC;QAEhC,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,IAAC,OAAO,EAAE,OAAO,CAAC,OAAO,YAClC,KAAC,OAAO,CAAC,SAAS,KAAG,GACV,GACG,CACnB,CAAC,CAAC,CAAC,CACF,KAAC,UAAU,IACT,IAAI,EAAC,cAAc,KACf,SAAS,EACb,OAAO,EAAE,OAAO,CAAC,OAAO,EACxB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,GAAyB,YAE9B,KAAC,OAAO,CAAC,SAAS,KAAG,GACV,CACd,CAAC;AACJ,CAAC,CAAyC,CAAC;AAE3C,eAAe,IAAI,CAAC","sourcesContent":["import { forwardRef, useState, useEffect } from 'react';\nimport type { Ref, PropsWithoutRef, ComponentType, ForwardRefExoticComponent } from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport { useTheme } from '../../hooks';\nimport type { NoChildrenProp, RefElement, WithAttributes } from '../../types';\nimport { defaultThemeProp } from '../../theme';\n\ntype BaseIconProps = NoChildrenProp & {\n /**\n * The name of the icon set.\n * @default theme.base['icon-set']\n */\n set?: string;\n /** The name indicating the Cosmos Icon. Reference the catalog above for the available names. */\n name: string;\n /**\n * Background & svg size.\n * @default \"s\" without background, \"m\" with background.\n */\n size?: 's' | 'm' | 'l' | 'font-size';\n};\n\nexport type IconProps =\n | WithAttributes<\n 'div',\n BaseIconProps & {\n /** Background color. */\n background: string;\n /**\n * Foreground color (svg fill).\n * Applies readable color off background if undefined.\n */\n foreground?: string;\n /**\n * Shape of the background.\n * @default 'square'\n */\n shape?: 'square' | 'circle';\n }\n >\n | WithAttributes<\n 'svg',\n BaseIconProps & {\n background?: never;\n foreground?: never;\n shape?: never;\n }\n >;\n\nexport interface IconDefinition {\n Component: ComponentType;\n viewBox?: string;\n}\n\nexport interface IconModule extends IconDefinition {\n set?: IconProps['set'];\n name: IconProps['name'];\n}\n\nconst iconRegistry = new Map<string, Map<string, IconDefinition>>([]);\n\nexport const registerIcon = (...icons: IconModule[]) => {\n icons.forEach(({ set: modSet, name, ...iconDef }) => {\n const set = modSet ?? 'budicon';\n\n if (!iconRegistry.has(set)) {\n iconRegistry.set(set, new Map([[name, iconDef]]));\n } else if (!iconRegistry.get(set)!.has(name)) {\n iconRegistry.get(set)!.set(name, iconDef);\n }\n });\n};\n\nexport const forceRegisterIcon = (...icons: IconModule[]) => {\n icons.forEach(({ set: modSet, name, ...iconDef }) => {\n const set = modSet ?? 'budicon';\n\n if (!iconRegistry.has(set)) {\n iconRegistry.set(set, new Map([[name, iconDef]]));\n } else {\n iconRegistry.get(set)!.set(name, iconDef);\n }\n });\n};\n\nexport const StyledIcon = styled.svg<{ size?: IconProps['size'] }>(({ theme, size = 's' }) => {\n const {\n components: {\n icon: {\n size: { s, m, l }\n }\n }\n } = theme;\n return css`\n display: inline-block;\n fill: currentColor;\n vertical-align: middle;\n flex-shrink: 0;\n /* stylelint-disable unit-allowed-list */\n min-width: 14px;\n min-height: 14px;\n /* stylelint-enable unit-allowed-list */\n\n ${size === 's' &&\n css`\n width: ${s};\n height: ${s};\n `}\n\n ${size === 'm' &&\n css`\n width: ${m};\n height: ${m};\n `}\n\n ${size === 'l' &&\n css`\n width: ${l};\n height: ${l};\n `}\n\n ${size === 'font-size' &&\n css`\n width: 1em;\n height: 1em;\n `}\n `;\n});\n\nStyledIcon.defaultProps = defaultThemeProp;\n\nexport const StyledIconShape = styled.div<{\n background: NonNullable<IconProps['background']>;\n foreground?: IconProps['foreground'];\n size?: IconProps['size'];\n shape?: IconProps['shape'];\n}>(({ theme, background, foreground, size = 'm', shape = 'square' }) => {\n const readableFg = readableColor(background);\n\n const {\n base: { 'border-radius': baseRadius },\n components: {\n icon: {\n size: { s, m, l },\n 'border-radius-multiplier': borderRadiusMultiplier\n }\n }\n } = theme;\n\n return css`\n color: ${foreground ?? readableFg};\n background-color: ${background};\n display: flex;\n justify-content: center;\n align-items: center;\n\n ${size === 's' &&\n css`\n width: ${s};\n height: ${s};\n `}\n\n ${size === 'm' &&\n css`\n width: ${m};\n height: ${m};\n `}\n\n ${size === 'l' &&\n css`\n width: ${l};\n height: ${l};\n `}\n\n ${size === 'font-size' &&\n css`\n width: 1em;\n height: 1em;\n `}\n\n ${shape === 'square' &&\n css`\n border-radius: calc(${borderRadiusMultiplier} * ${baseRadius});\n `}\n\n ${shape === 'circle' &&\n css`\n border-radius: 50%;\n `}\n\n ${StyledIcon} {\n width: 50%;\n height: 50%;\n /* stylelint-disable unit-allowed-list */\n min-width: min(14px, 90%);\n min-height: min(14px, 90%);\n /* stylelint-enable unit-allowed-list */\n }\n `;\n});\n\nStyledIconShape.defaultProps = defaultThemeProp;\n\nconst emptyIconDefinition: Readonly<IconDefinition> = Object.freeze({ Component: () => null });\n\nconst Icon = forwardRef<RefElement<IconProps>, PropsWithoutRef<IconProps>>(function Icon(\n { set: setProp, name, size, ...restProps }: PropsWithoutRef<IconProps>,\n ref\n) {\n const {\n base: { 'icon-set': setTheme }\n } = useTheme();\n\n const set = setProp ?? setTheme ?? 'budicon';\n\n const [iconDef, setIconDef] = useState(iconRegistry.get(set)?.get(name) ?? emptyIconDefinition);\n\n useEffect(() => {\n if (iconRegistry.get(set)?.has(name)) {\n setIconDef(iconRegistry.get(set)!.get(name)!);\n return;\n }\n\n const controller = new AbortController();\n\n (async () => {\n try {\n const encodedName = encodeURIComponent(name);\n let iconSet: string;\n let module: IconModule;\n\n switch (set) {\n case 'streamline':\n iconSet = 'streamline-icons';\n break;\n case 'budicon':\n iconSet = 'icons';\n break;\n default:\n throw new Error('Unknown icon');\n }\n\n // The following expression is required for Storybook Vite Builder\n try {\n module = await import(`./${iconSet}/${encodedName}.icon`);\n } catch {\n module = await import(`./${iconSet}/${encodedName}.icon.tsx`);\n }\n\n if (module.name !== name || !module.Component) throw new Error('Malformed icon definition');\n\n registerIcon(module);\n } catch {\n registerIcon({ set, name, ...emptyIconDefinition });\n }\n\n if (!controller.signal.aborted) {\n setIconDef(iconRegistry.get(set)!.get(name) ?? emptyIconDefinition);\n }\n })();\n\n return () => controller.abort();\n }, [name, set]);\n\n return typeof restProps.background === 'string' ? (\n <StyledIconShape\n role='presentation'\n {...restProps}\n background={restProps.background}\n foreground={restProps.foreground}\n shape={restProps.shape}\n size={size}\n ref={ref as Ref<HTMLDivElement>}\n >\n <StyledIcon viewBox={iconDef.viewBox}>\n <iconDef.Component />\n </StyledIcon>\n </StyledIconShape>\n ) : (\n <StyledIcon\n role='presentation'\n {...restProps}\n viewBox={iconDef.viewBox}\n size={size}\n ref={ref as Ref<SVGSVGElement>}\n >\n <iconDef.Component />\n </StyledIcon>\n );\n}) as ForwardRefExoticComponent<IconProps>;\n\nexport default Icon;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import { ForwardProps } from '../../types';
|
|
3
|
-
import { ComboBoxProps } from '../ComboBox';
|
|
4
|
-
import { MenuProps } from '../Menu';
|
|
1
|
+
import type { FunctionComponent } from 'react';
|
|
2
|
+
import type { ForwardProps } from '../../types';
|
|
3
|
+
import type { ComboBoxProps } from '../ComboBox';
|
|
4
|
+
import type { MenuProps } from '../Menu';
|
|
5
5
|
export interface IconPickerProps extends Pick<ComboBoxProps, 'id' | 'label' | 'labelHidden' | 'required' | 'disabled' | 'readOnly' | 'name' | 'status' | 'info' | 'placeholder' | 'autoFocus'>, Pick<MenuProps, 'scrollAt'> {
|
|
6
6
|
/** Default selection for the input. */
|
|
7
7
|
defaultSelection: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconPicker.d.ts","sourceRoot":"","sources":["../../../src/components/IconPicker/IconPicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconPicker.d.ts","sourceRoot":"","sources":["../../../src/components/IconPicker/IconPicker.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAqC,MAAM,OAAO,CAAC;AAElF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,OAAO,KAAK,EAAE,SAAS,EAAiB,MAAM,SAAS,CAAC;AAIxD,MAAM,WAAW,eACf,SAAQ,IAAI,CACR,aAAa,EACX,IAAI,GACJ,OAAO,GACP,aAAa,GACb,UAAU,GACV,UAAU,GACV,UAAU,GACV,MAAM,GACN,QAAQ,GACR,MAAM,GACN,aAAa,GACb,WAAW,CACd,EACD,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC7B,uCAAuC;IACvC,gBAAgB,EAAE,MAAM,CAAC;IACzB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAoBD,QAAA,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,GAAG,YAAY,CAkHjE,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconPicker.js","sourceRoot":"","sources":["../../../src/components/IconPicker/IconPicker.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"IconPicker.js","sourceRoot":"","sources":["../../../src/components/IconPicker/IconPicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI7E,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,OAAO,KAAK,MAAM,mBAAmB,CAAC;AACtC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAwBlD,MAAM,gBAAgB,GAAG,CAAC,QAAyB,EAAE,WAAmB,EAAE,EAAE;IAC1E,IAAI,CAAC,WAAW;QAAE,OAAO,QAAQ,CAAC;IA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,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK;gBAAE,cAAc,EAAE,CAAC;YACtC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC,EACD,MAAM,EAAE,GAAG,EAAE;YACX,UAAU,EAAE,CAAC;YACb,cAAc,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC,EACD,IAAI,EAAE;YACJ,KAAK;YACL,WAAW,EAAE,UAAU;YACvB,QAAQ;YACR,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS;YAClE,SAAS,EAAE,CAAC,CAAC,UAAU,CAAC;YACxB,OAAO,EAAE,SAAS;YAClB,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;SACzC,EACD,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,IAAI,EAAE,YAAY,GAAI,CAAC,CAAC,CAAC,SAAS,GAC/D,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { forwardRef, useState, useCallback, useRef, useEffect } from 'react';\nimport type { FunctionComponent, ChangeEvent, PropsWithoutRef, Ref } from 'react';\n\nimport type { ForwardProps } from '../../types';\nimport ComboBox from '../ComboBox';\nimport type { ComboBoxProps } from '../ComboBox';\nimport icons from '../Icon/iconNames';\nimport Icon from '../Icon';\nimport { menuHelpers } from '../Menu';\nimport type { MenuProps, MenuItemProps } from '../Menu';\nimport { useI18n } from '../../hooks';\nimport { createStringMatcher } from '../../utils';\n\nexport interface IconPickerProps\n extends Pick<\n ComboBoxProps,\n | 'id'\n | 'label'\n | 'labelHidden'\n | 'required'\n | 'disabled'\n | 'readOnly'\n | 'name'\n | 'status'\n | 'info'\n | 'placeholder'\n | 'autoFocus'\n >,\n Pick<MenuProps, 'scrollAt'> {\n /** Default selection for the input. */\n defaultSelection: string;\n /** Callback fired when user chooses icon from the list of icons. */\n onSelect?: (iconName: string) => void;\n}\n\nconst getFilteredItems = (iconList: MenuItemProps[], filterValue: string) => {\n if (!filterValue) return iconList;\n\n const regExp = createStringMatcher(filterValue);\n return iconList.filter(({ primary }) => regExp.test(primary));\n};\n\nconst iconList: MenuItemProps[] = icons.map(icon => {\n return {\n id: icon,\n primary: icon,\n visual: <Icon name={icon} />,\n selected: false\n };\n});\n\nconst pageSize = 20;\n\nconst IconPicker: FunctionComponent<IconPickerProps & ForwardProps> = forwardRef(\n function IconPicker(props: PropsWithoutRef<IconPickerProps>, ref: Ref<HTMLInputElement>) {\n const { defaultSelection, scrollAt, onSelect, ...restProps } = props;\n\n const [items, setItems] = useState<MenuProps['items']>(() => iconList.slice(0, pageSize));\n\n const [isLoading, setIsLoading] = useState(false);\n const [hasMore, setHasMore] = useState(true);\n const [selectedIcon, setSelectedIcon] = useState(defaultSelection ?? '');\n const [filterValue, setFilterValue] = useState('');\n const t = useI18n();\n const loadMoreTimeoutId = useRef<ReturnType<typeof setTimeout>>();\n\n const resetItems = useCallback(() => {\n const filteredItems = getFilteredItems(iconList, filterValue);\n setItems(\n menuHelpers.selectItem(filteredItems.slice(0, pageSize), selectedIcon, 'single-select')\n );\n setHasMore(filteredItems.length > pageSize);\n }, [filterValue, selectedIcon]);\n\n useEffect(() => {\n resetItems();\n }, [filterValue, selectedIcon]);\n\n useEffect(() => {\n return () => {\n if (loadMoreTimeoutId.current) clearTimeout(loadMoreTimeoutId.current);\n };\n }, []);\n\n const loadMore = useCallback(() => {\n if (!isLoading) {\n setIsLoading(true);\n if (loadMoreTimeoutId.current) clearTimeout(loadMoreTimeoutId.current);\n loadMoreTimeoutId.current = setTimeout(() => {\n setIsLoading(false);\n setItems(prevItems => {\n const newItems = menuHelpers.mapTree(\n getFilteredItems(iconList, filterValue).slice(\n prevItems.length,\n prevItems.length + pageSize\n ),\n item => ({\n ...item,\n selected: item.items ? undefined : selectedIcon === item.id\n })\n );\n\n if (newItems.length === 0) setHasMore(false);\n\n return menuHelpers.appendTo(prevItems, newItems);\n });\n }, 500);\n }\n }, [filterValue, isLoading]);\n\n const selectItem = useCallback(\n (iconName: string) => {\n setSelectedIcon(iconName);\n setFilterValue('');\n onSelect?.(iconName);\n },\n [onSelect]\n );\n\n const clearSelection = useCallback(() => {\n setSelectedIcon('');\n setItems(cur =>\n menuHelpers.mapTree(cur, item => {\n return {\n ...item,\n selected: false\n };\n })\n );\n }, []);\n\n return (\n <ComboBox\n {...restProps}\n ref={ref}\n selected={\n selectedIcon\n ? {\n items: {\n id: selectedIcon,\n text: selectedIcon\n }\n }\n : undefined\n }\n value={filterValue}\n onChange={(e: ChangeEvent<HTMLInputElement>) => {\n if (!e.target.value) clearSelection();\n setFilterValue(e.target.value);\n }}\n onBlur={() => {\n resetItems();\n setFilterValue('');\n }}\n menu={{\n items,\n onItemClick: selectItem,\n scrollAt,\n accent: filterValue ? createStringMatcher(filterValue) : undefined,\n emptyText: t('no_items'),\n loading: isLoading,\n loadMore: hasMore ? loadMore : undefined\n }}\n visual={selectedIcon ? <Icon name={selectedIcon} /> : undefined}\n />\n );\n }\n);\n\nexport default IconPicker;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FunctionComponent, ImgHTMLAttributes, Ref } from 'react';
|
|
2
|
-
import { ForwardProps } from '../../types';
|
|
1
|
+
import type { FunctionComponent, ImgHTMLAttributes, Ref } from 'react';
|
|
2
|
+
import type { ForwardProps } from '../../types';
|
|
3
3
|
export interface ImageProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
4
4
|
/** The HTML alt attribute for the image. */
|
|
5
5
|
alt: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../src/components/Image/Image.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../src/components/Image/Image.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,GAAG,EAAmB,MAAM,OAAO,CAAC;AAGxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,WAAW,UAAW,SAAQ,iBAAiB,CAAC,gBAAgB,CAAC;IACrE,4CAA4C;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC7B;AAED,eAAO,MAAM,WAAW,yGAEvB,CAAC;AAEF,QAAA,MAAM,KAAK,EAAE,iBAAiB,CAAC,UAAU,GAAG,YAAY,CAMtD,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.js","sourceRoot":"","sources":["../../../src/components/Image/Image.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"Image.js","sourceRoot":"","sources":["../../../src/components/Image/Image.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAWvC,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEpC,CAAC;AAEF,MAAM,KAAK,GAAiD,UAAU,CAAC,SAAS,KAAK,CACnF,KAAkC,EAClC,GAA0B;IAE1B,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACpC,OAAO,KAAC,WAAW,OAAK,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC;AAC5D,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { FunctionComponent, ImgHTMLAttributes, Ref, PropsWithoutRef } from 'react';\nimport styled from 'styled-components';\n\nimport type { ForwardProps } from '../../types';\n\nexport interface ImageProps extends ImgHTMLAttributes<HTMLImageElement> {\n /** The HTML alt attribute for the image. */\n alt: string;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLImageElement>;\n}\n\nexport const StyledImage = styled.img`\n max-width: 100%;\n`;\n\nconst Image: FunctionComponent<ImageProps & ForwardProps> = forwardRef(function Image(\n props: PropsWithoutRef<ImageProps>,\n ref: Ref<HTMLImageElement>\n) {\n const { alt, ...restProps } = props;\n return <StyledImage {...restProps} alt={alt} ref={ref} />;\n});\n\nexport default Image;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { Action, BaseProps, ForwardProps, NoChildrenProp, TestIdProp } from '../../types';
|
|
3
|
-
import { FormControlProps } from '../FormControl';
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { Action, BaseProps, ForwardProps, NoChildrenProp, TestIdProp } from '../../types';
|
|
3
|
+
import type { FormControlProps } from '../FormControl';
|
|
4
4
|
export interface InputProps extends FormControlProps, BaseProps, NoChildrenProp, TestIdProp {
|
|
5
5
|
/**
|
|
6
6
|
* Specifies the type of input to be used.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAwB,MAAM,OAAO,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG/F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAOvD,MAAM,WAAW,UAAW,SAAQ,gBAAgB,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU;IACzF;;;OAGG;IACH,IAAI,CAAC,EACD,MAAM,GACN,UAAU,GACV,QAAQ,GACR,OAAO,GACP,KAAK,GACL,QAAQ,GACR,KAAK,GACL,MAAM,GACN,gBAAgB,GAChB,MAAM,GACN,MAAM,GACN,OAAO,GACP,QAAQ,GACR,OAAO,CAAC;IACZ,iFAAiF;IACjF,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;CACzC;;;;AA8ED,wBAAmD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAInC,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AA4BnD,MAAM,KAAK,GAAkC,UAAU,CAAC,SAAS,KAAK,CACpE,KAAkC,EAClC,GAA0B;IAE1B,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IAErB,MAAM,EACJ,MAAM,EACN,EAAE,GAAG,GAAG,EACR,KAAK,EACL,YAAY,EACZ,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,cAAc,EACd,WAAW,EACX,IAAI,EACJ,MAAM,EACN,OAAO,EACP,mBAAmB,EACnB,GA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 'react';\nimport type { FC, Ref, PropsWithoutRef } from 'react';\n\nimport type { Action, BaseProps, ForwardProps, NoChildrenProp, TestIdProp } from '../../types';\nimport FormField from '../FormField';\nimport { StyledFormControl } from '../FormControl';\nimport type { FormControlProps } from '../FormControl';\nimport { hasProp, withTestIds } from '../../utils';\nimport { useTestIds, useUID } from '../../hooks';\n\nimport StyledInput from './Input.styles';\nimport { getInputTestIds } from './Input.test-ids';\n\nexport interface InputProps extends FormControlProps, BaseProps, NoChildrenProp, TestIdProp {\n /**\n * Specifies the type of input to be used.\n * @default 'text'\n */\n type?:\n | 'text'\n | 'password'\n | 'number'\n | 'email'\n | 'url'\n | 'search'\n | 'tel'\n | 'date'\n | 'datetime-local'\n | 'time'\n | 'week'\n | 'month'\n | 'hidden'\n | 'color';\n /** Pass an array of Action objects to append button(s) inline with the Input. */\n actions?: Action[];\n /** Enables read only mode */\n readOnly?: FormControlProps['readOnly'];\n}\n\nconst Input: FC<InputProps & ForwardProps> = forwardRef(function Input(\n props: PropsWithoutRef<InputProps>,\n ref: Ref<HTMLInputElement>\n) {\n const uid = useUID();\n\n const {\n testId,\n id = uid,\n value,\n defaultValue,\n required = false,\n disabled = false,\n readOnly = false,\n label,\n additionalInfo,\n labelHidden,\n info,\n status,\n actions,\n onResolveSuggestion,\n ...restProps\n } = props;\n\n const testIds = useTestIds(testId, getInputTestIds);\n\n const controlProp: {\n value?: string;\n defaultValue?: string;\n } = {};\n\n // Conditionally render component as controlled/uncontrolled\n if (hasProp(props, 'value')) {\n controlProp.value = value ?? '';\n } else if (hasProp(props, 'defaultValue')) {\n controlProp.defaultValue = defaultValue ?? '';\n }\n\n const Comp = (\n <StyledFormControl\n data-testid={testIds.control}\n ref={ref}\n id={id}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n status={status}\n hasSuggestion={!!onResolveSuggestion && status === 'pending'}\n {...controlProp}\n {...restProps}\n as={StyledInput}\n />\n );\n\n return label ? (\n <FormField\n testId={testIds}\n additionalInfo={additionalInfo}\n label={label}\n labelHidden={labelHidden}\n id={id}\n info={info}\n readOnly={readOnly}\n status={status}\n required={required}\n disabled={disabled}\n actions={actions}\n onResolveSuggestion={onResolveSuggestion}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n});\n\nexport default withTestIds(Input, getInputTestIds);\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FunctionComponent, ReactNode, Ref } from 'react';
|
|
2
|
-
import { BaseProps, ForwardProps } from '../../types';
|
|
1
|
+
import type { FunctionComponent, ReactNode, Ref } from 'react';
|
|
2
|
+
import type { BaseProps, ForwardProps } from '../../types';
|
|
3
3
|
export interface LabelProps extends BaseProps {
|
|
4
4
|
/**
|
|
5
5
|
* Id for the label.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../src/components/Label/Label.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../src/components/Label/Label.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAmB,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAIhF,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAM3D,MAAM,WAAW,UAAW,SAAQ,SAAS;IAC3C;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,EAAE,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IACzC,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kCAAkC;IAClC,QAAQ,EAAE,SAAS,CAAC;IACpB,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,GAAG,iBAAiB,GAAG,cAAc,GAAG,eAAe,CAAC,CAAC;CACpF;AAED,eAAO,MAAM,WAAW,oJAoBvB,CAAC;AAIF,QAAA,MAAM,KAAK,EAAE,iBAAiB,CAAC,UAAU,GAAG,YAAY,CActD,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Label.js","sourceRoot":"","sources":["../../../src/components/Label/Label.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"Label.js","sourceRoot":"","sources":["../../../src/components/Label/Label.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAG7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AA2BjD,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CACrC,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE;IACzB,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE;QAC1B,OAAO,IAAI,CACT,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,EACvD,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CACzC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAEtF,OAAO,WAAW;QAChB,CAAC,CAAC,YAAY;QACd,CAAC,CAAC,GAAG,CAAA;;uBAEY,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,WAAW,CAAa,CAAC;yBACvD,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC;mBAC5C,KAAK;SACf,CAAC;AACR,CAAC,CACF,CAAC;AAEF,WAAW,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE5C,MAAM,KAAK,GAAiD,UAAU,CAAC,SAAS,KAAK,CACnF,EAAE,QAAQ,EAAE,WAAW,GAAG,KAAK,EAAE,OAAO,EAAE,GAAG,SAAS,EAA+B,EACrF,GAAsB;IAEtB,OAAO,CACL,KAAC,WAAW,IACV,GAAG,EAAE,GAA4B,EACjC,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,KACzC,SAAS,YAEZ,QAAQ,GACG,CACf,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { FunctionComponent, PropsWithoutRef, ReactNode, Ref } from 'react';\nimport styled, { css } from 'styled-components';\nimport { hideVisually, readableColor, rgba } from 'polished';\n\nimport type { BaseProps, ForwardProps } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils';\nimport { calculateFontSize } from '../../styles';\nimport type { FontSize } from '../../styles';\n\nexport interface LabelProps extends BaseProps {\n /**\n * Id for the label.\n * @default undefined\n */\n id?: string;\n /**\n * HTML tag to render the label as.\n * @default 'label'\n */\n as?: 'label' | 'legend' | 'div' | 'span';\n /** Use to associate with a form-element's id. */\n htmlFor?: string;\n /**\n * Visually hides the label.\n * @default false\n */\n labelHidden?: boolean;\n /** Content/text for the label. */\n children: ReactNode;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLLabelElement | HTMLLegendElement | HTMLDivElement | HTMLSpanElement>;\n}\n\nexport const StyledLabel = styled.label<Pick<LabelProps, 'labelHidden' | 'htmlFor'>>(\n ({ theme, labelHidden }) => {\n const color = tryCatch(() => {\n return rgba(\n readableColor(theme.base.palette['primary-background']),\n theme.base.transparency['transparent-3']\n );\n });\n\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return labelHidden\n ? hideVisually\n : css`\n max-width: max-content;\n font-size: ${fontSize[theme.components.label['font-size'] as FontSize]};\n font-weight: ${theme.base['font-weight']['semi-bold']};\n color: ${color};\n `;\n }\n);\n\nStyledLabel.defaultProps = defaultThemeProp;\n\nconst Label: FunctionComponent<LabelProps & ForwardProps> = forwardRef(function Label(\n { children, labelHidden = false, htmlFor, ...restProps }: PropsWithoutRef<LabelProps>,\n ref: LabelProps['ref']\n) {\n return (\n <StyledLabel\n ref={ref as Ref<HTMLLabelElement>}\n labelHidden={labelHidden}\n htmlFor={htmlFor === '' ? undefined : htmlFor}\n {...restProps}\n >\n {children}\n </StyledLabel>\n );\n});\n\nexport default Label;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import { ForwardProps } from '../../types';
|
|
3
|
-
import { LightboxProps } from './Lightbox.types';
|
|
1
|
+
import type { FunctionComponent } from 'react';
|
|
2
|
+
import type { ForwardProps } from '../../types';
|
|
3
|
+
import type { LightboxProps } from './Lightbox.types';
|
|
4
4
|
declare const _default: FunctionComponent<LightboxProps & ForwardProps> & {
|
|
5
5
|
getTestIds: (testIdProp?: string | undefined) => import("../../types").TestIdsRecord<readonly ["content", "name", "metadata", "download", "close", "prev", "next", "pagination"]>;
|
|
6
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lightbox.d.ts","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Lightbox.d.ts","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE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WAAW,EAC5B,MAAM,EAAE,CAAC,CAAmC,EAAE,EAAE;4CAC9C,UAAU,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;wCAClC,CAAC,EACD,OAAO,EAAE,CAAC,CAAmC,EAAE,EAAE;4CAC/C,WAAW,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;4CACjC,QAAQ,CAAC,IAAI,CAAC,CAAC;wCACjB,CAAC,GACD,CACH,CAAC,CAAC,CAAC,CACF,KAAC,QAAQ,IAAC,SAAS,EAAC,OAAO,EAAC,KAAK,SAAG,CACrC,CAAC,IACC,GACF,EAEN,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CACnB,KAAC,eAAe,mBACD,OAAO,CAAC,IAAI,EACzB,GAAG,EAAE,aAAa,EAClB,OAAO,EAAC,QAAQ,gBACJ,CAAC,CAAC,iBAAiB,CAAC,EAChC,MAAM,EAAE,CAAC,KAAK,IAAI,YAAY,KAAK,KAAK,CAAC,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,GAAG,GACtB,GACS,CACnB,IACI,EACP,KAAC,gBAAgB,iBAAW,QAAQ,gBAAa,QAAQ,GAAI,IAC9C,CAClB,CAAC;IAEF,OAAO,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AACtE,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import {\n FunctionComponent,\n PropsWithoutRef,\n useEffect,\n useRef,\n Ref,\n useState,\n forwardRef,\n MouseEvent,\n SyntheticEvent\n} from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { ForwardProps } from '../../types';\nimport { cap, withTestIds } from '../../utils';\nimport Flex from '../Flex';\nimport MetaList from '../MetaList';\nimport Icon from '../Icon';\nimport Text from '../Text';\nimport {\n useConfiguration,\n useConsolidatedRef,\n useDirection,\n useEvent,\n useFocusTrap,\n useI18n,\n useScrollToggle,\n useTestIds\n} from '../../hooks';\nimport ErrorState from '../ErrorState';\nimport Progress from '../Progress';\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';\nimport { getLightboxTestIds } from './Lightbox.test-ids';\n\nconst Lightbox: FunctionComponent<LightboxProps & ForwardProps> = forwardRef(function Lightbox(\n {\n testId,\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 { portalTarget } = useConfiguration();\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 const testIds = useTestIds(testId, getLightboxTestIds);\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 const keyDownHandler = (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\n useEvent('keydown', keyDownHandler);\n useFocusTrap(lightboxRef);\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 onNavigate?.(currentItem.id, currentIndex);\n }, [currentIndex]);\n\n useEffect(() => {\n lightboxRef.current?.focus();\n }, []);\n\n const content = (\n <StyledLightbox\n data-testid={testIds.root}\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 data-testid={testIds.pagination} aria-hidden='true'>\n {countTrackerText}\n </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 data-testid={testIds.name} variant='primary' as='h2'>\n {currentItem.name}\n </Text>\n {currentItem.metadata && (\n <MetaList data-testid={testIds.metadata} items={currentItem.metadata} />\n )}\n </Flex>\n\n <Flex container>\n {onItemDownload && (\n <StyledActionButton\n data-testid={testIds.download}\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 data-testid={testIds.close}\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 data-testid={testIds.prev}\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 && <ErrorState message={t('image_load_error')} />}\n\n {!error &&\n (currentItem.src ? (\n <StyledImage\n data-testid={testIds.content}\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 <Progress placement='block' delay />\n ))}\n </Flex>\n </Flex>\n\n {items.length > 1 && (\n <StyledNavButton\n data-testid={testIds.next}\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 return portalTarget ? createPortal(content, portalTarget) : content;\n});\n\nexport default withTestIds(Lightbox, getLightboxTestIds);\n"]}
|
|
1
|
+
{"version":3,"file":"Lightbox.js","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,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,EACL,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,eAAe,EACf,UAAU,EACX,MAAM,aAAa,CAAC;AACrB,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,WAAW,EACX,gBAAgB,EAChB,cAAc,EACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,QAAQ,GAAoD,UAAU,CAAC,SAAS,QAAQ,CAC5F,EACE,MAAM,EACN,KAAK,EACL,YAAY,GAAG,CAAC,EAChB,KAAK,EACL,UAAU,EACV,WAAW,EACX,UAAU,EACV,cAAc,EACd,YAAY,EACZ,GAAG,SAAS,EACmB,EACjC,MAA2B;IAE3B,MAAM,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E,EAAE;4CAC9C,UAAU,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;wCAClC,CAAC,EACD,OAAO,EAAE,CAAC,CAAmC,EAAE,EAAE;4CAC/C,WAAW,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;4CACjC,QAAQ,CAAC,IAAI,CAAC,CAAC;wCACjB,CAAC,GACD,CACH,CAAC,CAAC,CAAC,CACF,KAAC,QAAQ,IAAC,SAAS,EAAC,OAAO,EAAC,KAAK,SAAG,CACrC,CAAC,IACC,GACF,EAEN,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CACnB,KAAC,eAAe,mBACD,OAAO,CAAC,IAAI,EACzB,GAAG,EAAE,aAAa,EAClB,OAAO,EAAC,QAAQ,gBACJ,CAAC,CAAC,iBAAiB,CAAC,EAChC,MAAM,EAAE,CAAC,KAAK,IAAI,YAAY,KAAK,KAAK,CAAC,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,GAAG,GACtB,GACS,CACnB,IACI,EACP,KAAC,gBAAgB,iBAAW,QAAQ,gBAAa,QAAQ,GAAI,IAC9C,CAClB,CAAC;IAEF,OAAO,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AACtE,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { useEffect, useRef, useState, forwardRef } from 'react';\nimport type { FunctionComponent, PropsWithoutRef, Ref, MouseEvent, SyntheticEvent } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport type { ForwardProps } from '../../types';\nimport { cap, withTestIds } from '../../utils';\nimport Flex from '../Flex';\nimport MetaList from '../MetaList';\nimport Icon from '../Icon';\nimport Text from '../Text';\nimport {\n useConfiguration,\n useConsolidatedRef,\n useDirection,\n useEvent,\n useFocusTrap,\n useI18n,\n useScrollToggle,\n useTestIds\n} from '../../hooks';\nimport ErrorState from '../ErrorState';\nimport Progress from '../Progress';\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 type { LightboxProps } from './Lightbox.types';\nimport { getLightboxTestIds } from './Lightbox.test-ids';\n\nconst Lightbox: FunctionComponent<LightboxProps & ForwardProps> = forwardRef(function Lightbox(\n {\n testId,\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 { portalTarget } = useConfiguration();\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 const testIds = useTestIds(testId, getLightboxTestIds);\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 const keyDownHandler = (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\n useEvent('keydown', keyDownHandler);\n useFocusTrap(lightboxRef);\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 onNavigate?.(currentItem.id, currentIndex);\n }, [currentIndex]);\n\n useEffect(() => {\n lightboxRef.current?.focus();\n }, []);\n\n const content = (\n <StyledLightbox\n data-testid={testIds.root}\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 data-testid={testIds.pagination} aria-hidden='true'>\n {countTrackerText}\n </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 data-testid={testIds.name} variant='primary' as='h2'>\n {currentItem.name}\n </Text>\n {currentItem.metadata && (\n <MetaList data-testid={testIds.metadata} items={currentItem.metadata} />\n )}\n </Flex>\n\n <Flex container>\n {onItemDownload && (\n <StyledActionButton\n data-testid={testIds.download}\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 data-testid={testIds.close}\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 data-testid={testIds.prev}\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 && <ErrorState message={t('image_load_error')} />}\n\n {!error &&\n (currentItem.src ? (\n <StyledImage\n data-testid={testIds.content}\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 <Progress placement='block' delay />\n ))}\n </Flex>\n </Flex>\n\n {items.length > 1 && (\n <StyledNavButton\n data-testid={testIds.next}\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 return portalTarget ? createPortal(content, portalTarget) : content;\n});\n\nexport default withTestIds(Lightbox, getLightboxTestIds);\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ReactNode, SyntheticEvent } from 'react';
|
|
2
|
-
import { NoChildrenProp, BaseProps, TestIdProp } from '../../types';
|
|
3
|
-
import { BackdropProps } from '../Backdrop/Backdrop';
|
|
4
|
-
import { ImageProps } from '../Image';
|
|
1
|
+
import type { ReactNode, SyntheticEvent } from 'react';
|
|
2
|
+
import type { NoChildrenProp, BaseProps, TestIdProp } from '../../types';
|
|
3
|
+
import type { BackdropProps } from '../Backdrop/Backdrop';
|
|
4
|
+
import type { ImageProps } from '../Image';
|
|
5
5
|
export interface LightboxProps extends NoChildrenProp, BaseProps, TestIdProp {
|
|
6
6
|
/** A list of compatible content to present in the lightbox. */
|
|
7
7
|
items: LightboxItem[];
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"Lightbox.types.d.ts","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,WAAW,aAAc,SAAQ,cAAc,EAAE,SAAS,EAAE,UAAU;IAC1E,+DAA+D;IAC/D,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB;;;OAGG;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esContent":["import { ReactNode, SyntheticEvent } from 'react';\n\nimport { NoChildrenProp, BaseProps, TestIdProp } from '../../types';\nimport { BackdropProps } from '../Backdrop/Backdrop';\nimport { ImageProps } from '../Image';\n\nexport interface LightboxProps extends NoChildrenProp, BaseProps, TestIdProp {\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'], index: number) => 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. Pass null for when src is not yet available. */\n src: string | null;\n /** Additional info about the item. */\n metadata?: ReactNode[];\n /** A ref to the item's underlying element. */\n ref?: ImageProps['ref'];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Lightbox.types.js","sourceRoot":"","sources":["../../../src/components/Lightbox/Lightbox.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode, SyntheticEvent } from 'react';\n\nimport type { NoChildrenProp, BaseProps, TestIdProp } from '../../types';\nimport type { BackdropProps } from '../Backdrop/Backdrop';\nimport type { ImageProps } from '../Image';\n\nexport interface LightboxProps extends NoChildrenProp, BaseProps, TestIdProp {\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'], index: number) => 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. Pass null for when src is not yet available. */\n src: string | null;\n /** Additional info about the item. */\n metadata?: ReactNode[];\n /** A ref to the item's underlying element. */\n ref?: ImageProps['ref'];\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReactNode, FunctionComponent, Ref } from 'react';
|
|
2
|
-
import { ButtonProps } from '../Button';
|
|
3
|
-
import { BaseProps, ForwardProps, TestIdProp } from '../../types';
|
|
1
|
+
import type { ReactNode, FunctionComponent, Ref } from 'react';
|
|
2
|
+
import type { ButtonProps } from '../Button';
|
|
3
|
+
import type { BaseProps, ForwardProps, TestIdProp } from '../../types';
|
|
4
4
|
export interface LinkProps extends BaseProps, TestIdProp {
|
|
5
5
|
/** Text or content for the Link. */
|
|
6
6
|
children: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/components/Link/Link.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/components/Link/Link.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,GAAG,EAAkC,MAAM,OAAO,CAAC;AAK/F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAI7C,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAwBvE,MAAM,WAAW,SAAU,SAAQ,SAAS,EAAE,UAAU;IACtD,oCAAoC;IACpC,QAAQ,EAAE,SAAS,CAAC;IACpB,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACjC;;;OAGG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,mFAAmF;IACnF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iFAAiF;IACjF,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC1C,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;CAC9B;AAED,eAAO,MAAM,iBAAiB;aAAyB,OAAO;SAU7D,CAAC;AAIF,eAAO,MAAM,oBAAoB,oLAyC/B,CAAC;AAIH,eAAO,MAAM,2BAA2B,oLA+BtC,CAAC;AAIH,eAAO,MAAM,UAAU,iJAAmB,CAAC;;;;AAoM3C,wBAAiD"}
|