@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":"QRCode.js","sourceRoot":"","sources":["../../../src/components/QRCode/QRCode.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"QRCode.js","sourceRoot":"","sources":["../../../src/components/QRCode/QRCode.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,KAAK,SAAS,MAAM,QAAQ,CAAC;AACpC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,a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UAAU,CAAC,OAAO,CAAC,CAAC;QAC3C,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,EAAE;YACV,UAAU,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;IACP,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,OAAO,CAAC,CAAC,CAAC,CACf,KAAC,KAAK,OAAK,SAAS,EAAE,GAAG,EAAE,GAA4B,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,GAAI,CACtF,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,OACC,SAAS,EACb,GAAG,EAAE,GAAG,EACR,SAAS,EAAE;YACT,SAAS,EAAE,QAAQ;YACnB,UAAU,EAAE,QAAQ;YACpB,OAAO,EAAE,QAAQ;YACjB,GAAG,EAAE,CAAC;YACN,GAAG,EAAE,CAAC;SACP,EACD,EAAE,EAAE,oBAAoB,YAExB,KAAC,UAAU,IAAC,OAAO,EAAE,CAAC,CAAC,uBAAuB,CAAC,GAAI,GAC9C,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC","sourcesContent":["import { forwardRef, useEffect, useRef, useState } from 'react';\nimport type { FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport * as QRCodeLib from 'qrcode';\nimport styled, { css } from 'styled-components';\n\nimport type { BaseProps, ForwardProps } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Flex from '../Flex';\nimport Image from '../Image';\nimport { useI18n } from '../../hooks';\nimport EmptyState from '../EmptyState';\n\nexport const StyledEmptyQRWrapper = styled.div(({ theme }) => {\n return css`\n height: ${theme.base['content-width'].xs};\n width: ${theme.base['content-width'].xs};\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n border-radius: calc(${theme.base['border-radius']} / 2);\n text-align: center;\n `;\n});\n\nStyledEmptyQRWrapper.defaultProps = defaultThemeProp;\n\nexport interface QRCodeProps extends BaseProps {\n /** Text that need to be encoded into QR code. */\n value: string;\n /** The HTML alt attribute for the image. */\n label?: string;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLImageElement | HTMLDivElement>;\n}\n\nconst QRCode: FunctionComponent<QRCodeProps & ForwardProps> = forwardRef(function QRCode(\n { value, label = value, ...restProps }: PropsWithoutRef<QRCodeProps>,\n ref: QRCodeProps['ref']\n) {\n const [dataURL, setDataURL] = useState('');\n const t = useI18n();\n\n const mounted = useRef(false);\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n };\n }, []);\n\n useEffect(() => {\n QRCodeLib.toDataURL(value)\n .then(results => {\n if (mounted.current) setDataURL(results);\n })\n .catch(() => {\n setDataURL('');\n });\n }, [value]);\n\n return dataURL ? (\n <Image {...restProps} ref={ref as Ref<HTMLImageElement>} src={dataURL} alt={label} />\n ) : (\n <Flex\n {...restProps}\n ref={ref}\n container={{\n direction: 'column',\n alignItems: 'center',\n justify: 'center',\n gap: 1,\n pad: 2\n }}\n as={StyledEmptyQRWrapper}\n >\n <EmptyState message={t('qr_code_not_available')} />\n </Flex>\n );\n});\n\nexport default QRCode;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ChangeEvent, FC } from 'react';
|
|
2
|
-
import { FormControlProps } from '../FormControl';
|
|
3
|
-
import { RadioCheckProps } from '../RadioCheck';
|
|
1
|
+
import type { ChangeEvent, FC } from 'react';
|
|
2
|
+
import type { FormControlProps } from '../FormControl';
|
|
3
|
+
import type { RadioCheckProps } from '../RadioCheck';
|
|
4
4
|
import type { ForwardProps, NoChildrenProp } from '../../types';
|
|
5
5
|
export interface RadioButtonProps extends NoChildrenProp {
|
|
6
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioButton.d.ts","sourceRoot":"","sources":["../../../src/components/RadioButton/RadioButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RadioButton.d.ts","sourceRoot":"","sources":["../../../src/components/RadioButton/RadioButton.tsx"],"names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ton/RadioButton.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"RadioButton.js","sourceRoot":"","sources":["../../../src/components/RadioButton/RadioButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAInC,OAAO,UAAU,MAAM,eAAe,CAAC;AAiCvC,6FAA6F;AAC7F,MAAM,EAAE,GAAwC,UAAU,CAAC,SAAS,EAAE,CACpE,KAAuB,EACvB,GAA0B;IAE1B,OAAO,KAAC,UAAU,OAAK,KAAK,EAAE,IAAI,EAAC,OAAO,EAAC,GAAG,EAAE,GAAG,GAAI,CAAC;AAC1D,CAAC,CAAC,CAAC;AAEH,oCAAoC;AACpC,EAAE,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;AAE1C,eAAe,EAAE,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { ChangeEvent, FC, Ref } from 'react';\n\nimport type { FormControlProps } from '../FormControl';\nimport RadioCheck from '../RadioCheck';\nimport type { RadioCheckProps } from '../RadioCheck';\nimport type { ForwardProps, NoChildrenProp } from '../../types';\n\nexport interface RadioButtonProps extends NoChildrenProp {\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /** Sets checked prop via onChange when using as controlled component. */\n checked?: RadioCheckProps['checked'];\n /** Initialize checked prop when using as uncontrolled component. */\n defaultChecked?: RadioCheckProps['defaultChecked'];\n /**\n * Sets Radio Button to an an [indeterminate state](https://css-tricks.com/almanac/selectors/i/indeterminate/#indeterminate-radio-buttons).\n * @default false\n */\n indeterminate?: RadioCheckProps['indeterminate'];\n /** Callback invoked when this particular radio button is selected. */\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n}\n\n// Odd issue with SB doc prop table not being generated when called RadioButton...so using RB\nconst RB: FC<RadioButtonProps & ForwardProps> = forwardRef(function RB(\n props: RadioButtonProps,\n ref: Ref<HTMLInputElement>\n) {\n return <RadioCheck {...props} type='radio' ref={ref} />;\n});\n\n// Adding here for doc purposes only\nRB.defaultProps = RadioCheck.defaultProps;\n\nexport default RB;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FC, Ref, MouseEventHandler, KeyboardEventHandler } from 'react';
|
|
2
|
-
import { FormControlProps } from '../FormControl';
|
|
3
|
-
import { BaseProps, ForwardProps, NoChildrenProp } from '../../types';
|
|
1
|
+
import type { FC, Ref, MouseEventHandler, KeyboardEventHandler } from 'react';
|
|
2
|
+
import type { FormControlProps } from '../FormControl';
|
|
3
|
+
import type { BaseProps, ForwardProps, NoChildrenProp } from '../../types';
|
|
4
4
|
export interface RadioCheckProps extends BaseProps, NoChildrenProp {
|
|
5
5
|
/**
|
|
6
6
|
* Sets DOM id for the control and associates label element via 'for' attribute.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioCheck.d.ts","sourceRoot":"","sources":["../../../src/components/RadioCheck/RadioCheck.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RadioCheck.d.ts","sourceRoot":"","sources":["../../../src/components/RadioCheck/RadioCheck.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,EAAE,EACF,GAAG,EAIH,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAM3E,MAAM,WAAW,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AK,UAAU,IAAI,QAAQ,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,EAAE;oBACpD,CAAC,CAAC,cAAc,EAAE,CAAC;iBACpB;gBACD,IAAI,IAAI,KAAK,OAAO,IAAI,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;oBAC3D,CAAC,CAAC,cAAc,EAAE,CAAC;iBACpB;gBAED,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;YACjB,CAAC,EACD,GAAG,EAAE,MAAM,GACX,GACQ,CACb,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,UAAU,CAAC","sourcesContent":["import {\n forwardRef,\n FC,\n Ref,\n useEffect,\n MouseEvent,\n KeyboardEvent,\n PropsWithoutRef,\n MouseEventHandler,\n KeyboardEventHandler\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor, hideVisually, mix } from 'polished';\n\nimport FormField, { StyledFormFieldInfo } from '../FormField';\nimport { FormControlProps, StyledFormControl } from '../FormControl';\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils';\nimport { BaseProps, ForwardProps, NoChildrenProp } from '../../types';\nimport { useConsolidatedRef, useDirection, useI18n, useUID } from '../../hooks';\nimport { StyledLabel } from '../Label';\nimport { calculateFontSize } from '../../styles';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\n\nexport interface RadioCheckProps extends BaseProps, NoChildrenProp {\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Makes the input non editable and non clickable. The browser defaults to false. */\n readOnly?: FormControlProps['readOnly'];\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /** Sets the type of input. */\n type: 'radio' | 'checkbox';\n /** Sets checked prop via onChange when using as controlled component. */\n checked?: boolean;\n /** Initialize checked prop when using as uncontrolled component. */\n defaultChecked?: boolean;\n /**\n * Sets control to an an indeterminate state.\n * @default false\n */\n indeterminate?: boolean;\n /**\n * Controls the styling of the RadioCheck.\n * @default 'simple'\n */\n variant?: 'simple' | 'card';\n /** Callback function for onClick events. */\n onClick?: MouseEventHandler<HTMLInputElement>;\n /** Callback function for onKeyDown events. */\n onKeyDown?: KeyboardEventHandler<HTMLInputElement>;\n /** Pass a heading and content to show additional information on the field. */\n additionalInfo?: FormControlProps['additionalInfo'];\n /** info like error, success, warning messages */\n info?: FormControlProps['info'];\n /** Ref forwarded to the underlying input. */\n ref?: Ref<HTMLInputElement>;\n}\n\nexport const StyledPseudoRadioCheck = styled.div<Pick<RadioCheckProps, 'readOnly' | 'status'>>(\n props => {\n const {\n theme: {\n base: {\n spacing,\n palette: { 'primary-background': primaryBackground }\n },\n components: {\n 'form-field': formField,\n 'radio-check': {\n size,\n 'touch-size': touchSize,\n 'background-color': backgroundColor,\n 'border-color': borderColor,\n 'border-width': borderWidth\n }\n }\n },\n status\n } = props;\n\n const useBorderColor = status === 'error' ? formField.error['status-color'] : borderColor;\n const useBackgroundColor =\n status && formField[status]\n ? tryCatch(() => mix(0.8, primaryBackground, formField[status]['status-color']))\n : backgroundColor;\n\n return css`\n display: flex;\n flex-shrink: 0;\n position: relative;\n width: ${size};\n height: ${size};\n margin-inline-end: ${spacing};\n border: ${borderWidth} solid ${useBorderColor};\n background-color: ${useBackgroundColor};\n\n @media (pointer: coarse) {\n width: ${touchSize};\n height: ${touchSize};\n }\n\n &::after {\n content: '';\n display: none;\n }\n `;\n }\n);\n\nStyledPseudoRadioCheck.defaultProps = defaultThemeProp;\n\nexport const StyledRadioCheckInput = styled.input(props => {\n const {\n disabled,\n theme: {\n base: { 'border-radius': baseBorderRadius },\n components: {\n 'form-control': {\n ':focus': { 'box-shadow': shadow, 'border-color': focusBorderColor },\n ':read-only': { 'background-color': readOnlyBackgroundColor }\n },\n 'radio-check': {\n size,\n ':checked': {\n 'background-color': checkedBackgroundColor,\n 'border-color': checkedBorderColor\n }\n },\n checkbox: { 'border-radius': checkRadius },\n 'radio-button': { 'border-radius': radioRadius }\n }\n }\n } = props;\n\n const backgroundColor = props.readOnly ? readOnlyBackgroundColor : checkedBackgroundColor;\n const foreground = tryCatch(() => readableColor(backgroundColor));\n\n const prcSelector = `+ ${StyledLabel} ${StyledPseudoRadioCheck}`;\n const { ltr } = useDirection();\n\n return css`\n ${hideVisually}\n margin: 0;\n\n /* Sets rect size for JAWS focus outline */\n width: ${size};\n height: ${size};\n\n ${!disabled &&\n css`\n &:focus ${prcSelector} {\n box-shadow: ${shadow};\n border-color: ${focusBorderColor};\n }\n `}\n\n &:checked\n ${prcSelector},\n &:checked:disabled\n ${prcSelector},\n &[type='checkbox']:indeterminate\n ${prcSelector},\n &[type='checkbox']:indeterminate:disabled\n ${prcSelector} {\n border-color: ${props.readOnly ? 'inherit' : checkedBorderColor};\n background-color: ${backgroundColor};\n\n &::after {\n display: block;\n }\n }\n\n &[type='radio'] ${prcSelector}, &[type='radio'] ${prcSelector}::after {\n border-radius: ${radioRadius};\n }\n\n &[type='radio'] ${prcSelector}::after {\n margin: auto;\n width: 100%;\n height: 100%;\n background-color: ${foreground};\n transform: scale(0.4);\n }\n\n &[type='checkbox'] ${prcSelector} {\n border-radius: min(calc(${baseBorderRadius} * ${checkRadius}), 0.25rem);\n }\n\n &[type='checkbox']:not(:indeterminate) ${prcSelector} {\n &::after {\n width: 40%;\n height: 75%;\n ${ltr\n ? css`\n transform: rotate(45deg) translate(50%, -30%);\n `\n : css`\n transform: rotate(45deg) translate(-50%, 30%);\n `}\n border-right: 0.15em solid ${foreground};\n border-bottom: 0.15em solid ${foreground};\n }\n }\n\n &[type='checkbox']:indeterminate ${prcSelector} {\n display: flex;\n &::after {\n width: 90%;\n height: 0.15em;\n margin: auto;\n background-color: ${foreground};\n }\n }\n `;\n});\n\nStyledRadioCheckInput.defaultProps = defaultThemeProp;\n\nexport const StyledRadioCheck = styled.div<Pick<RadioCheckProps, 'disabled' | 'readOnly'>>(\n props => {\n const {\n disabled,\n readOnly,\n theme: {\n base,\n components: {\n 'radio-check': {\n label: { color: labelColor, 'font-weight': labelFontWeight }\n },\n 'form-control': {\n ':hover': { 'border-color': hoverBorderColor }\n }\n }\n }\n } = props;\n\n const fontSize = calculateFontSize(base['font-size'], base['font-scale']);\n\n return css`\n > ${StyledLabel} {\n cursor: pointer;\n display: flex;\n align-items: center;\n font-weight: ${labelFontWeight};\n word-break: break-word;\n font-size: ${fontSize.s};\n color: ${labelColor};\n margin: 0;\n min-height: ${base['hit-area']['mouse-min']};\n\n @media (pointer: coarse) {\n min-height: ${base['hit-area']['finger-min']};\n }\n }\n\n > ${StyledFormFieldInfo} {\n margin: 0;\n padding-inline-start: calc(${base.spacing} / 4);\n }\n\n ${!(disabled || readOnly) &&\n css`\n &:not(:focus-within) > ${StyledLabel}:hover ${StyledPseudoRadioCheck} {\n border-color: ${hoverBorderColor};\n }\n `}\n `;\n }\n);\n\nStyledRadioCheck.defaultProps = defaultThemeProp;\n\nexport const StyledRadioCheckCard = styled.label<\n Pick<RadioCheckProps, 'disabled' | 'readOnly' | 'status'>\n>(\n ({\n disabled,\n readOnly,\n status,\n theme: {\n base: { palette, shadow, spacing },\n components: {\n card,\n 'form-field': formField,\n 'radio-check': { label },\n 'form-control': {\n ':hover': { 'border-color': hoverBorderColor }\n }\n }\n }\n }) => {\n const useBorderColor =\n status === 'error' ? formField.error['status-color'] : palette['border-line'];\n\n return css`\n min-width: min-content;\n cursor: pointer;\n background-color: ${card.background};\n border-radius: ${card['border-radius']};\n border: 0.0625rem solid ${useBorderColor};\n padding: ${spacing};\n\n ${disabled &&\n css`\n cursor: not-allowed;\n `}\n\n ${!(disabled || readOnly) &&\n css`\n :hover:not(:focus-within) {\n border-color: ${hoverBorderColor};\n ${StyledLabel} ${StyledPseudoRadioCheck} {\n border-color: ${hoverBorderColor};\n }\n }\n\n :focus-within {\n box-shadow: ${shadow.focus};\n border-color: transparent;\n }\n `}\n\n > ${StyledLabel} {\n display: flex;\n align-items: center;\n color: ${label.color};\n font-weight: ${label['font-weight']};\n margin: 0;\n }\n\n > ${StyledFormFieldInfo} {\n margin: 0;\n padding-inline-start: calc(${spacing} / 4);\n }\n `;\n }\n);\n\nStyledRadioCheckCard.defaultProps = defaultThemeProp;\n\nconst RadioCheck: FC<RadioCheckProps & ForwardProps> = forwardRef(function RadioCheck(\n props: PropsWithoutRef<RadioCheckProps>,\n ref: RadioCheckProps['ref']\n) {\n const uid = useUID();\n const t = useI18n();\n\n const {\n type,\n id = uid,\n label,\n required = false,\n disabled = false,\n indeterminate = false,\n readOnly = false,\n variant = 'simple',\n onClick,\n onKeyDown,\n status,\n info,\n additionalInfo,\n ...restProps\n } = props;\n\n const isRadio = type === 'radio';\n const card = variant === 'card';\n const newRef = useConsolidatedRef(ref);\n\n useEffect(() => {\n if (!isRadio && newRef.current) {\n newRef.current.indeterminate = !!indeterminate;\n }\n }, [newRef, indeterminate, isRadio]);\n\n return (\n <FormField\n as={card ? StyledRadioCheckCard : StyledRadioCheck}\n label={\n <>\n <StyledPseudoRadioCheck\n status={status}\n isRadio={isRadio}\n as={StyledFormControl}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n />\n <>\n {label}\n {readOnly && <VisuallyHiddenText>{` ${t('read_only')}`}</VisuallyHiddenText>}\n </>\n </>\n }\n labelAs={card ? 'div' : undefined}\n id={id}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n status={status}\n info={info}\n isRadioCheck\n inline\n labelAfter\n additionalInfo={additionalInfo}\n >\n <StyledRadioCheckInput\n {...restProps}\n id={id}\n type={type}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n onClick={(e: MouseEvent<HTMLInputElement>) => {\n if (readOnly) e.preventDefault();\n\n onClick?.(e);\n }}\n onKeyDown={(e: KeyboardEvent<HTMLInputElement>) => {\n if (type === 'checkbox' && readOnly && e.key === ' ') {\n e.preventDefault();\n }\n if (type === 'radio' && readOnly && e.key.includes('Arrow')) {\n e.preventDefault();\n }\n\n onKeyDown?.(e);\n }}\n ref={newRef}\n />\n </FormField>\n );\n});\n\nexport default RadioCheck;\n"]}
|
|
1
|
+
{"version":3,"file":"RadioCheck.js","sourceRoot":"","sources":["../../../src/components/RadioCheck/RadioCheck.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAU9C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE5D,OAAO,SAAS,EAAE,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AAgDvD,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAC9C,KAAK,CAAC,EAAE;IACN,MAAM,EACJ,KAAK,EAAE,EACL,IAAI,EAAE,EACJ,OAAO,EACP,OAAO,EAAE,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,EACrD,EACD,UAAU,EAAE,EACV,YAAY,EAAE,SAAS,E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AI,IAAI,KAAK,UAAU,IAAI,QAAQ,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,EAAE;oBACpD,CAAC,CAAC,cAAc,EAAE,CAAC;iBACpB;gBACD,IAAI,IAAI,KAAK,OAAO,IAAI,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;oBAC3D,CAAC,CAAC,cAAc,EAAE,CAAC;iBACpB;gBAED,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;YACjB,CAAC,EACD,GAAG,EAAE,MAAM,GACX,GACQ,CACb,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,UAAU,CAAC","sourcesContent":["import { forwardRef, useEffect } from 'react';\nimport type {\n FC,\n Ref,\n MouseEvent,\n KeyboardEvent,\n PropsWithoutRef,\n MouseEventHandler,\n KeyboardEventHandler\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor, hideVisually, mix } from 'polished';\n\nimport FormField, { StyledFormFieldInfo } from '../FormField';\nimport { StyledFormControl } from '../FormControl';\nimport type { FormControlProps } from '../FormControl';\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils';\nimport type { BaseProps, ForwardProps, NoChildrenProp } from '../../types';\nimport { useConsolidatedRef, useDirection, useI18n, useUID } from '../../hooks';\nimport { StyledLabel } from '../Label';\nimport { calculateFontSize } from '../../styles';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\n\nexport interface RadioCheckProps extends BaseProps, NoChildrenProp {\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Makes the input non editable and non clickable. The browser defaults to false. */\n readOnly?: FormControlProps['readOnly'];\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /** Sets the type of input. */\n type: 'radio' | 'checkbox';\n /** Sets checked prop via onChange when using as controlled component. */\n checked?: boolean;\n /** Initialize checked prop when using as uncontrolled component. */\n defaultChecked?: boolean;\n /**\n * Sets control to an an indeterminate state.\n * @default false\n */\n indeterminate?: boolean;\n /**\n * Controls the styling of the RadioCheck.\n * @default 'simple'\n */\n variant?: 'simple' | 'card';\n /** Callback function for onClick events. */\n onClick?: MouseEventHandler<HTMLInputElement>;\n /** Callback function for onKeyDown events. */\n onKeyDown?: KeyboardEventHandler<HTMLInputElement>;\n /** Pass a heading and content to show additional information on the field. */\n additionalInfo?: FormControlProps['additionalInfo'];\n /** info like error, success, warning messages */\n info?: FormControlProps['info'];\n /** Ref forwarded to the underlying input. */\n ref?: Ref<HTMLInputElement>;\n}\n\nexport const StyledPseudoRadioCheck = styled.div<Pick<RadioCheckProps, 'readOnly' | 'status'>>(\n props => {\n const {\n theme: {\n base: {\n spacing,\n palette: { 'primary-background': primaryBackground }\n },\n components: {\n 'form-field': formField,\n 'radio-check': {\n size,\n 'touch-size': touchSize,\n 'background-color': backgroundColor,\n 'border-color': borderColor,\n 'border-width': borderWidth\n }\n }\n },\n status\n } = props;\n\n const useBorderColor = status === 'error' ? formField.error['status-color'] : borderColor;\n const useBackgroundColor =\n status && formField[status]\n ? tryCatch(() => mix(0.8, primaryBackground, formField[status]['status-color']))\n : backgroundColor;\n\n return css`\n display: flex;\n flex-shrink: 0;\n position: relative;\n width: ${size};\n height: ${size};\n margin-inline-end: ${spacing};\n border: ${borderWidth} solid ${useBorderColor};\n background-color: ${useBackgroundColor};\n\n @media (pointer: coarse) {\n width: ${touchSize};\n height: ${touchSize};\n }\n\n &::after {\n content: '';\n display: none;\n }\n `;\n }\n);\n\nStyledPseudoRadioCheck.defaultProps = defaultThemeProp;\n\nexport const StyledRadioCheckInput = styled.input(props => {\n const {\n disabled,\n theme: {\n base: { 'border-radius': baseBorderRadius },\n components: {\n 'form-control': {\n ':focus': { 'box-shadow': shadow, 'border-color': focusBorderColor },\n ':read-only': { 'background-color': readOnlyBackgroundColor }\n },\n 'radio-check': {\n size,\n ':checked': {\n 'background-color': checkedBackgroundColor,\n 'border-color': checkedBorderColor\n }\n },\n checkbox: { 'border-radius': checkRadius },\n 'radio-button': { 'border-radius': radioRadius }\n }\n }\n } = props;\n\n const backgroundColor = props.readOnly ? readOnlyBackgroundColor : checkedBackgroundColor;\n const foreground = tryCatch(() => readableColor(backgroundColor));\n\n const prcSelector = `+ ${StyledLabel} ${StyledPseudoRadioCheck}`;\n const { ltr } = useDirection();\n\n return css`\n ${hideVisually}\n margin: 0;\n\n /* Sets rect size for JAWS focus outline */\n width: ${size};\n height: ${size};\n\n ${!disabled &&\n css`\n &:focus ${prcSelector} {\n box-shadow: ${shadow};\n border-color: ${focusBorderColor};\n }\n `}\n\n &:checked\n ${prcSelector},\n &:checked:disabled\n ${prcSelector},\n &[type='checkbox']:indeterminate\n ${prcSelector},\n &[type='checkbox']:indeterminate:disabled\n ${prcSelector} {\n border-color: ${props.readOnly ? 'inherit' : checkedBorderColor};\n background-color: ${backgroundColor};\n\n &::after {\n display: block;\n }\n }\n\n &[type='radio'] ${prcSelector}, &[type='radio'] ${prcSelector}::after {\n border-radius: ${radioRadius};\n }\n\n &[type='radio'] ${prcSelector}::after {\n margin: auto;\n width: 100%;\n height: 100%;\n background-color: ${foreground};\n transform: scale(0.4);\n }\n\n &[type='checkbox'] ${prcSelector} {\n border-radius: min(calc(${baseBorderRadius} * ${checkRadius}), 0.25rem);\n }\n\n &[type='checkbox']:not(:indeterminate) ${prcSelector} {\n &::after {\n width: 40%;\n height: 75%;\n ${ltr\n ? css`\n transform: rotate(45deg) translate(50%, -30%);\n `\n : css`\n transform: rotate(45deg) translate(-50%, 30%);\n `}\n border-right: 0.15em solid ${foreground};\n border-bottom: 0.15em solid ${foreground};\n }\n }\n\n &[type='checkbox']:indeterminate ${prcSelector} {\n display: flex;\n &::after {\n width: 90%;\n height: 0.15em;\n margin: auto;\n background-color: ${foreground};\n }\n }\n `;\n});\n\nStyledRadioCheckInput.defaultProps = defaultThemeProp;\n\nexport const StyledRadioCheck = styled.div<Pick<RadioCheckProps, 'disabled' | 'readOnly'>>(\n props => {\n const {\n disabled,\n readOnly,\n theme: {\n base,\n components: {\n 'radio-check': {\n label: { color: labelColor, 'font-weight': labelFontWeight }\n },\n 'form-control': {\n ':hover': { 'border-color': hoverBorderColor }\n }\n }\n }\n } = props;\n\n const fontSize = calculateFontSize(base['font-size'], base['font-scale']);\n\n return css`\n > ${StyledLabel} {\n cursor: pointer;\n display: flex;\n align-items: center;\n font-weight: ${labelFontWeight};\n word-break: break-word;\n font-size: ${fontSize.s};\n color: ${labelColor};\n margin: 0;\n min-height: ${base['hit-area']['mouse-min']};\n\n @media (pointer: coarse) {\n min-height: ${base['hit-area']['finger-min']};\n }\n }\n\n > ${StyledFormFieldInfo} {\n margin: 0;\n padding-inline-start: calc(${base.spacing} / 4);\n }\n\n ${!(disabled || readOnly) &&\n css`\n &:not(:focus-within) > ${StyledLabel}:hover ${StyledPseudoRadioCheck} {\n border-color: ${hoverBorderColor};\n }\n `}\n `;\n }\n);\n\nStyledRadioCheck.defaultProps = defaultThemeProp;\n\nexport const StyledRadioCheckCard = styled.label<\n Pick<RadioCheckProps, 'disabled' | 'readOnly' | 'status'>\n>(\n ({\n disabled,\n readOnly,\n status,\n theme: {\n base: { palette, shadow, spacing },\n components: {\n card,\n 'form-field': formField,\n 'radio-check': { label },\n 'form-control': {\n ':hover': { 'border-color': hoverBorderColor }\n }\n }\n }\n }) => {\n const useBorderColor =\n status === 'error' ? formField.error['status-color'] : palette['border-line'];\n\n return css`\n min-width: min-content;\n cursor: pointer;\n background-color: ${card.background};\n border-radius: ${card['border-radius']};\n border: 0.0625rem solid ${useBorderColor};\n padding: ${spacing};\n\n ${disabled &&\n css`\n cursor: not-allowed;\n `}\n\n ${!(disabled || readOnly) &&\n css`\n :hover:not(:focus-within) {\n border-color: ${hoverBorderColor};\n ${StyledLabel} ${StyledPseudoRadioCheck} {\n border-color: ${hoverBorderColor};\n }\n }\n\n :focus-within {\n box-shadow: ${shadow.focus};\n border-color: transparent;\n }\n `}\n\n > ${StyledLabel} {\n display: flex;\n align-items: center;\n color: ${label.color};\n font-weight: ${label['font-weight']};\n margin: 0;\n }\n\n > ${StyledFormFieldInfo} {\n margin: 0;\n padding-inline-start: calc(${spacing} / 4);\n }\n `;\n }\n);\n\nStyledRadioCheckCard.defaultProps = defaultThemeProp;\n\nconst RadioCheck: FC<RadioCheckProps & ForwardProps> = forwardRef(function RadioCheck(\n props: PropsWithoutRef<RadioCheckProps>,\n ref: RadioCheckProps['ref']\n) {\n const uid = useUID();\n const t = useI18n();\n\n const {\n type,\n id = uid,\n label,\n required = false,\n disabled = false,\n indeterminate = false,\n readOnly = false,\n variant = 'simple',\n onClick,\n onKeyDown,\n status,\n info,\n additionalInfo,\n ...restProps\n } = props;\n\n const isRadio = type === 'radio';\n const card = variant === 'card';\n const newRef = useConsolidatedRef(ref);\n\n useEffect(() => {\n if (!isRadio && newRef.current) {\n newRef.current.indeterminate = !!indeterminate;\n }\n }, [newRef, indeterminate, isRadio]);\n\n return (\n <FormField\n as={card ? StyledRadioCheckCard : StyledRadioCheck}\n label={\n <>\n <StyledPseudoRadioCheck\n status={status}\n isRadio={isRadio}\n as={StyledFormControl}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n />\n <>\n {label}\n {readOnly && <VisuallyHiddenText>{` ${t('read_only')}`}</VisuallyHiddenText>}\n </>\n </>\n }\n labelAs={card ? 'div' : undefined}\n id={id}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n status={status}\n info={info}\n isRadioCheck\n inline\n labelAfter\n additionalInfo={additionalInfo}\n >\n <StyledRadioCheckInput\n {...restProps}\n id={id}\n type={type}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n onClick={(e: MouseEvent<HTMLInputElement>) => {\n if (readOnly) e.preventDefault();\n\n onClick?.(e);\n }}\n onKeyDown={(e: KeyboardEvent<HTMLInputElement>) => {\n if (type === 'checkbox' && readOnly && e.key === ' ') {\n e.preventDefault();\n }\n if (type === 'radio' && readOnly && e.key.includes('Arrow')) {\n e.preventDefault();\n }\n\n onKeyDown?.(e);\n }}\n ref={newRef}\n />\n </FormField>\n );\n});\n\nexport default RadioCheck;\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FC, Ref, ReactElement, ChangeEvent } from 'react';
|
|
2
|
-
import { ForwardProps } from '../../types';
|
|
3
|
-
import { FormFieldProps } from '../FormField';
|
|
4
|
-
import { FormControlProps } from '../FormControl';
|
|
5
|
-
import { RadioCheckProps } from '../RadioCheck';
|
|
1
|
+
import type { FC, Ref, ReactElement, ChangeEvent } from 'react';
|
|
2
|
+
import type { ForwardProps } from '../../types';
|
|
3
|
+
import type { FormFieldProps } from '../FormField';
|
|
4
|
+
import type { FormControlProps } from '../FormControl';
|
|
5
|
+
import type { RadioCheckProps } from '../RadioCheck';
|
|
6
6
|
export interface RadioCheckGroupProps {
|
|
7
7
|
/** Accepts Checkboxes or RadioButtons as children. */
|
|
8
8
|
children: ReactElement | ReactElement[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioCheckGroup.d.ts","sourceRoot":"","sources":["../../../src/components/RadioCheckGroup/RadioCheckGroup.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RadioCheckGroup.d.ts","sourceRoot":"","sources":["../../../src/components/RadioCheckGroup/RadioCheckGroup.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,GAAG,EAAmB,YAAY,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAGjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,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,eAAO,MAAM,qBAAqB,8GAMjC,CAAC;AAEF,QAAA,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,GAAG,YAAY,CA4F5D,CAAC;AAIF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioCheckGroup.js","sourceRoot":"","sources":["../../../src/components/RadioCheckGroup/RadioCheckGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"RadioCheckGroup.js","sourceRoot":"","sources":["../../../src/components/RadioCheckGroup/RadioCheckGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAExF,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAGzD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA+CjD,MAAM,YAAY,GAAG;IACnB,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,KAAK;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,QAAQ,CAAA;;QAE5C,eAAe;;;;CAItB,CAAC;AAEF,MAAM,eAAe,GAA4C,UAAU,CACzE,SAAS,eAAe,CACtB,KAA4C,EAC5C,GAAgC;IAEhC,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IACrB,MAAM,EACJ,QAAQ,EACR,IAAI,GAAG,GAAG,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,MAAM,GAAG,KAAK,EACd,SAAS,GAAG,IAAI,EAChB,OAAO,GAAG,QAAQ,EAClB,GAAG,SAAS,EACb,GAAG,KAAK,CAAC;IAEV,MAAM,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,CACH,GACI,GACG,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,CAAC,YAAY,GAAG,YAAY,CAAC;AAE5C,eAAe,eAAe,CAAC","sourcesContent":["import { forwardRef, Children, cloneElement, useState, useEffect, useRef } from 'react';\nimport type { FC, Ref, PropsWithoutRef, ReactElement, ChangeEvent } from 'react';\nimport styled from 'styled-components';\n\nimport type { ForwardProps } from '../../types';\nimport FormField from '../FormField';\nimport type { FormFieldProps } from '../FormField';\nimport { StyledFormField } from '../FormField/FormField';\nimport type { FormControlProps } from '../FormControl';\nimport type { RadioCheckProps } from '../RadioCheck';\nimport Flex from '../Flex';\nimport { useElement, useUID } from '../../hooks';\n\nexport interface RadioCheckGroupProps {\n /** Accepts Checkboxes or RadioButtons as children. */\n children: ReactElement | ReactElement[];\n /**\n * Conveniently pass an onChange handler to the group to be notified when any of the inputs change.\n * Additionally, onChange can be passed to individual children.\n * Both handlers will be called, child followed by group.\n */\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /** Visually hides the label region. */\n labelHidden?: FormControlProps['labelHidden'];\n /** It is recommended to pass a simple string to offer guidance. Text will be styled based on status prop. */\n info?: FormControlProps['info'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Makes the input non editable and non clickable. The browser defaults to false. */\n readOnly?: FormControlProps['readOnly'];\n /**\n * Layout field elements inline in a row.\n * @default false\n */\n inline?: FormFieldProps['inline'];\n /** Used to toggle the auto stacking feature of an inlined group.\n * @default true\n */\n autoStack?: boolean;\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /**\n * Controls the styling of the child RadioChecks.\n * @default 'simple'\n */\n variant?: RadioCheckProps['variant'];\n /** Pass a heading and content to show additional information on the field. */\n additionalInfo?: FormControlProps['additionalInfo'];\n /** Ref forwarded to the wrapping element. */\n ref?: Ref<HTMLElement>;\n}\n\nconst defaultProps = {\n required: false,\n disabled: false\n};\n\nexport const StyledRadioCheckGroup = styled.fieldset`\n &[disabled] {\n > ${StyledFormField} {\n opacity: unset;\n }\n }\n`;\n\nconst RadioCheckGroup: FC<RadioCheckGroupProps & ForwardProps> = forwardRef(\n function RadioCheckGroup(\n props: PropsWithoutRef<RadioCheckGroupProps>,\n ref: RadioCheckGroupProps['ref']\n ) {\n const uid = useUID();\n const {\n children,\n name = uid,\n disabled,\n onChange,\n readOnly,\n inline = false,\n autoStack = true,\n variant = 'simple',\n ...restProps\n } = props;\n\n const [optionsEl, setOptionsEl] = useElement<HTMLDivElement>();\n const [renderInline, setRenderInline] = useState(inline);\n const renderInlineRef = useRef(inline);\n const minInlineWidth = useRef(0);\n\n useEffect(() => {\n setRenderInline(inline);\n if (inline && optionsEl && optionsEl.lastChild && autoStack) {\n const intersectionObserver = new IntersectionObserver(\n entries => {\n if (entries[0].intersectionRatio < 1) {\n if (entries[0].rootBounds) minInlineWidth.current = entries[0].rootBounds.width + 1;\n renderInlineRef.current = false;\n setRenderInline(false);\n }\n },\n { root: optionsEl, threshold: 1 }\n );\n\n const resizeObserver = new ResizeObserver(entries => {\n if (!renderInlineRef.current && entries[0].contentRect.width > minInlineWidth.current) {\n renderInlineRef.current = true;\n setRenderInline(true);\n }\n });\n\n intersectionObserver.observe(optionsEl.lastChild as Element);\n resizeObserver.observe(optionsEl);\n\n return () => {\n intersectionObserver.disconnect();\n resizeObserver.disconnect();\n };\n }\n }, [optionsEl, inline, autoStack]);\n\n return (\n <FormField\n as={StyledRadioCheckGroup}\n labelAs='legend'\n ref={ref}\n name={name}\n disabled={disabled}\n {...restProps}\n >\n <Flex\n ref={setOptionsEl}\n container={{\n direction: renderInline ? 'row' : 'column',\n colGap: 2,\n rowGap: variant === 'card' ? 1 : 0,\n wrap: 'wrap'\n }}\n >\n {Children.map(children, child =>\n cloneElement(child, {\n name,\n disabled: disabled || child.props.disabled,\n readOnly: readOnly || child.props.readOnly,\n variant,\n onChange: onChange\n ? (e: ChangeEvent<HTMLInputElement>) => {\n if (!(readOnly || child.props.readOnly)) {\n child.props.onChange?.(e);\n onChange(e);\n }\n }\n : child.props.onChange\n })\n )}\n </Flex>\n </FormField>\n );\n }\n);\n\nRadioCheckGroup.defaultProps = defaultProps;\n\nexport default RadioCheckGroup;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rating.d.ts","sourceRoot":"","sources":["../../../src/components/Rating/Rating.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Rating.d.ts","sourceRoot":"","sources":["../../../src/components/Rating/Rating.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG/C,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAS3E,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,cAAc;IAC5D;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AA2BD,UAAU,wBAAwB;IAChC,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,mBAAmB,+HAU9B,CAAC;AAkCH,QAAA,MAAM,MAAM,EAAE,iBAAiB,CAAC,WAAW,GAAG,YAAY,CA6BzD,CAAC;AAIF,eAAe,MAAM,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AAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3E,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IACnC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAEnC,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC;IACnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC,IAAI,CAAC,EAAE;QACtC,IAAI,SAAS,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnC,IAAI,cAAc,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YAC5C,SAAS,GAAG,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACvC;QACD,YAAY,CAAC,IAAI,CAAC,KAAC,UAAU,IAAmB,IAAI,EAAE,SAAS,IAA5B,QAAQ,CAAC,EAAE,CAAqB,CAAC,CAAC;KACtE;IAED,OAAO,CACL,MAAC,IAAI,IACH,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,gBACvB,SAAS,EACrB,QAAQ,EAAE,QAAQ,KACd,SAAS,aAEb,KAAC,0BAA0B,cAAE,YAAY,GAA8B,EACtE,QAAQ,IAAI,MAAC,oBAAoB,oBAAG,QAAQ,SAAyB,EAAE,GAAG,IACtE,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;AAEnC,eAAe,MAAM,CAAC","sourcesContent":["import { FunctionComponent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport type { BaseProps, ForwardProps, NoChildrenProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Icon, { registerIcon } from '../Icon';\nimport * as starIcon from '../Icon/icons/star.icon';\nimport * as starSolidIcon from '../Icon/icons/star-solid.icon';\nimport Flex from '../Flex';\n\nregisterIcon(starIcon, starSolidIcon);\n\nexport interface RatingProps extends BaseProps, NoChildrenProp {\n /**\n * Sets the rating to read only.\n * @default false\n */\n readOnly?: boolean;\n /**\n * The maximum rating allowed. Must be an integer greater than 1.\n * @default 5\n */\n maxRating?: number;\n /** The value of the Rating. Could be a decimal or integer. */\n value: number;\n /** Text that is displayed in parentheses inline with the Rating stars. */\n metaInfo?: string;\n /** Aria label for screen readers. */\n 'aria-label'?: string;\n /**\n * The tabIndex to control focus.\n * @default 0\n */\n tabIndex?: number;\n}\n\nconst DEFAULT_MAX_RATING = 5;\n\nconst defaultProps: Partial<RatingProps> = {\n readOnly: false,\n maxRating: DEFAULT_MAX_RATING,\n tabIndex: 0\n};\n\nconst StyledRatingItemsContainer = styled.div(props => {\n const { theme } = props;\n return css`\n color: ${theme.components.rating.color};\n line-height: 1;\n vertical-align: middle;\n display: inline-block;\n `;\n});\n\nStyledRatingItemsContainer.defaultProps = defaultThemeProp;\n\nconst StyledPartialRatingContainer = styled.div`\n position: relative;\n display: inline-block;\n`;\n\ninterface StyledPartialRatingProps {\n ratingPercentage: number;\n}\n\nexport const StyledPartialRating = styled.div<StyledPartialRatingProps>(props => {\n const { ratingPercentage } = props;\n return css`\n display: inline-block;\n position: absolute;\n inset-inline-start: 0;\n width: ${ratingPercentage}%;\n overflow: hidden;\n white-space: nowrap;\n `;\n});\n\nconst StyledRatingMetaInfo = styled.div(props => {\n const { theme } = props;\n return css`\n margin-inline-start: ${theme.base.spacing};\n `;\n});\n\nStyledRatingMetaInfo.defaultProps = defaultThemeProp;\n\ninterface RatingItemProps {\n fill: number;\n}\n\nconst RatingItem: FunctionComponent<RatingItemProps> = (props: RatingItemProps) => {\n const { fill, ...restProps } = props;\n const fillPercentage = Math.round((100 / 1) * fill);\n return (\n <>\n {fillPercentage === 0 && <Icon {...restProps} name='star' />}\n {fillPercentage === 100 && <Icon {...restProps} name='star-solid' />}\n {fillPercentage > 0 && fillPercentage < 100 && (\n <StyledPartialRatingContainer>\n <Icon {...restProps} name='star' />\n <StyledPartialRating ratingPercentage={fillPercentage}>\n <Icon {...restProps} name='star-solid' />\n </StyledPartialRating>\n </StyledPartialRatingContainer>\n )}\n </>\n );\n};\n\nconst Rating: FunctionComponent<RatingProps & ForwardProps> = (props: RatingProps) => {\n const starsOutline = [];\n const { 'aria-label': ariaLabel, metaInfo, tabIndex, readOnly, ...restProps } = props;\n\n let { maxRating, value } = props;\n maxRating = typeof maxRating !== 'number' ? DEFAULT_MAX_RATING : maxRating;\n maxRating = Math.max(1, maxRating);\n value = Math.min(maxRating, value);\n\n const isDecimalValue = Math.round(value) !== value;\n for (let i = 1; i <= maxRating; i += 1) {\n let fillValue = i <= value ? 1 : 0;\n if (isDecimalValue && Math.ceil(value) === i) {\n fillValue = value - Math.floor(value);\n }\n starsOutline.push(<RatingItem key={`star-${i}`} fill={fillValue} />);\n }\n\n return (\n <Flex\n container={{ alignItems: 'center' }}\n aria-label={ariaLabel}\n tabIndex={tabIndex}\n {...restProps}\n >\n <StyledRatingItemsContainer>{starsOutline}</StyledRatingItemsContainer>\n {metaInfo && <StyledRatingMetaInfo>({metaInfo})</StyledRatingMetaInfo>}{' '}\n </Flex>\n );\n};\n\nRating.defaultProps = defaultProps;\n\nexport default Rating;\n"]}
|
|
1
|
+
{"version":3,"file":"Rating.js","sourceRoot":"","sources":["../../../src/components/Rating/Rating.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,aAAa,MAAM,+BAA+B,CAAC;AAC/D,OAAO,IAAI,MA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AAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnC,IAAI,cAAc,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YAC5C,SAAS,GAAG,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACvC;QACD,YAAY,CAAC,IAAI,CAAC,KAAC,UAAU,IAAmB,IAAI,EAAE,SAAS,IAA5B,QAAQ,CAAC,EAAE,CAAqB,CAAC,CAAC;KACtE;IAED,OAAO,CACL,MAAC,IAAI,IACH,SAAS,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,gBACvB,SAAS,EACrB,QAAQ,EAAE,QAAQ,KACd,SAAS,aAEb,KAAC,0BAA0B,cAAE,YAAY,GAA8B,EACtE,QAAQ,IAAI,MAAC,oBAAoB,oBAAG,QAAQ,SAAyB,EAAE,GAAG,IACtE,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;AAEnC,eAAe,MAAM,CAAC","sourcesContent":["import type { FunctionComponent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport type { BaseProps, ForwardProps, NoChildrenProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Icon, { registerIcon } from '../Icon';\nimport * as starIcon from '../Icon/icons/star.icon';\nimport * as starSolidIcon from '../Icon/icons/star-solid.icon';\nimport Flex from '../Flex';\n\nregisterIcon(starIcon, starSolidIcon);\n\nexport interface RatingProps extends BaseProps, NoChildrenProp {\n /**\n * Sets the rating to read only.\n * @default false\n */\n readOnly?: boolean;\n /**\n * The maximum rating allowed. Must be an integer greater than 1.\n * @default 5\n */\n maxRating?: number;\n /** The value of the Rating. Could be a decimal or integer. */\n value: number;\n /** Text that is displayed in parentheses inline with the Rating stars. */\n metaInfo?: string;\n /** Aria label for screen readers. */\n 'aria-label'?: string;\n /**\n * The tabIndex to control focus.\n * @default 0\n */\n tabIndex?: number;\n}\n\nconst DEFAULT_MAX_RATING = 5;\n\nconst defaultProps: Partial<RatingProps> = {\n readOnly: false,\n maxRating: DEFAULT_MAX_RATING,\n tabIndex: 0\n};\n\nconst StyledRatingItemsContainer = styled.div(props => {\n const { theme } = props;\n return css`\n color: ${theme.components.rating.color};\n line-height: 1;\n vertical-align: middle;\n display: inline-block;\n `;\n});\n\nStyledRatingItemsContainer.defaultProps = defaultThemeProp;\n\nconst StyledPartialRatingContainer = styled.div`\n position: relative;\n display: inline-block;\n`;\n\ninterface StyledPartialRatingProps {\n ratingPercentage: number;\n}\n\nexport const StyledPartialRating = styled.div<StyledPartialRatingProps>(props => {\n const { ratingPercentage } = props;\n return css`\n display: inline-block;\n position: absolute;\n inset-inline-start: 0;\n width: ${ratingPercentage}%;\n overflow: hidden;\n white-space: nowrap;\n `;\n});\n\nconst StyledRatingMetaInfo = styled.div(props => {\n const { theme } = props;\n return css`\n margin-inline-start: ${theme.base.spacing};\n `;\n});\n\nStyledRatingMetaInfo.defaultProps = defaultThemeProp;\n\ninterface RatingItemProps {\n fill: number;\n}\n\nconst RatingItem: FunctionComponent<RatingItemProps> = (props: RatingItemProps) => {\n const { fill, ...restProps } = props;\n const fillPercentage = Math.round((100 / 1) * fill);\n return (\n <>\n {fillPercentage === 0 && <Icon {...restProps} name='star' />}\n {fillPercentage === 100 && <Icon {...restProps} name='star-solid' />}\n {fillPercentage > 0 && fillPercentage < 100 && (\n <StyledPartialRatingContainer>\n <Icon {...restProps} name='star' />\n <StyledPartialRating ratingPercentage={fillPercentage}>\n <Icon {...restProps} name='star-solid' />\n </StyledPartialRating>\n </StyledPartialRatingContainer>\n )}\n </>\n );\n};\n\nconst Rating: FunctionComponent<RatingProps & ForwardProps> = (props: RatingProps) => {\n const starsOutline = [];\n const { 'aria-label': ariaLabel, metaInfo, tabIndex, readOnly, ...restProps } = props;\n\n let { maxRating, value } = props;\n maxRating = typeof maxRating !== 'number' ? DEFAULT_MAX_RATING : maxRating;\n maxRating = Math.max(1, maxRating);\n value = Math.min(maxRating, value);\n\n const isDecimalValue = Math.round(value) !== value;\n for (let i = 1; i <= maxRating; i += 1) {\n let fillValue = i <= value ? 1 : 0;\n if (isDecimalValue && Math.ceil(value) === i) {\n fillValue = value - Math.floor(value);\n }\n starsOutline.push(<RatingItem key={`star-${i}`} fill={fillValue} />);\n }\n\n return (\n <Flex\n container={{ alignItems: 'center' }}\n aria-label={ariaLabel}\n tabIndex={tabIndex}\n {...restProps}\n >\n <StyledRatingItemsContainer>{starsOutline}</StyledRatingItemsContainer>\n {metaInfo && <StyledRatingMetaInfo>({metaInfo})</StyledRatingMetaInfo>}{' '}\n </Flex>\n );\n};\n\nRating.defaultProps = defaultProps;\n\nexport default Rating;\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
1
|
+
import type { FunctionComponent } from 'react';
|
|
2
2
|
import type { ForwardProps, NoChildrenProp, OmitStrict } from '../../types';
|
|
3
3
|
import type { FormControlProps } from '../FormControl';
|
|
4
|
-
import { MenuItemProps } from '../Menu';
|
|
5
|
-
import { LinkProps } from '../Link';
|
|
4
|
+
import type { MenuItemProps } from '../Menu';
|
|
5
|
+
import type { LinkProps } from '../Link';
|
|
6
6
|
export type SearchResult = Pick<MenuItemProps, 'id' | 'primary' | 'secondary' | 'href' | 'onClick'>;
|
|
7
7
|
export type RecentSearch = Pick<MenuItemProps, 'id' | 'primary' | 'href' | 'onClick'>;
|
|
8
8
|
export interface SearchInputProps extends NoChildrenProp {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchInput.d.ts","sourceRoot":"","sources":["../../../src/components/SearchInput/SearchInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchInput.d.ts","sourceRoot":"","sources":["../../../src/components/SearchInput/SearchInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK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,CAAC,CAAC;IACvD,2DAA2D;IAC3D,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,QAAA,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,GAAG,YAAY,CAwSnE,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchInput.js","sourceRoot":"","sources":["../../../src/components/SearchInput/SearchInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAIL,UAAU,EACV,QAAQ,EAER,WAAW,EAEX,SAAS,EACT,MAAM,EAGP,MAAM,OAAO,CAAC;AAGf,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AAExD,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,OAAO,EACP,aAAa,EACb,UAAU,EACV,MAAM,EACN,cAAc,EACf,MAAM,aAAa,CAAC;AACrB,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,IAAuB,MAAM,SAAS,CAAC;AAC9C,OAAO,IAAmB,MAAM,SAAS,CAAC;AAC1C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,4BAA4B,EAC5B,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,CAAC,UAAU,CAAC,CAAC;AA+CzB,MAAM,WAAW,GAAuD,UAAU,CAChF,S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BAAgB,YAEpB,UAAU,GACH,CACX,EAEA,CAAC,cAAc,IAAI,cAAc,IAAI,CACpC,KAAC,4BAA4B,cAAE,UAAU,GAAgC,CAC1E,EAEA,iBAAiB,IAAI,CACpB,KAAC,kBAAkB,IAAC,EAAE,EAAE,iBAAiB,YACtC,GAAG,CAAC,CAAC,qBAAqB,CAAC,GAAG,GACZ,CACtB,IACA,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n forwardRef,\n useState,\n ChangeEvent,\n useCallback,\n KeyboardEvent as ReactKeyboardEvent,\n useEffect,\n useRef,\n MutableRefObject,\n MouseEvent\n} from 'react';\n\nimport type { ForwardProps, NoChildrenProp, OmitStrict } from '../../types';\nimport Icon, { registerIcon } from '../Icon';\nimport * as searchIcon from '../Icon/icons/search.icon';\nimport type { FormControlProps } from '../FormControl';\nimport {\n useConsolidatedRef,\n useEscape,\n useI18n,\n useOuterEvent,\n useLiveLog,\n useUID,\n useFocusWithin\n} from '../../hooks';\nimport Flex from '../Flex';\nimport Popover from '../Popover';\nimport { sameWidth } from '../Popover/modifiers';\nimport Menu, { MenuItemProps } from '../Menu';\nimport Link, { LinkProps } from '../Link';\nimport Text from '../Text';\nimport { createStringMatcher, getFocusables } from '../../utils';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\n\nimport {\n StyledCancelButton,\n StyledResultsPopover,\n StyledSearchButton,\n StyledSearchInput,\n StyledSearchMenu,\n StyledSearchResultsContainer,\n StyledSearchTextInput,\n StyledMenuButton\n} from './SearchInput.styles';\n\nregisterIcon(searchIcon);\n\nexport type SearchResult = Pick<MenuItemProps, 'id' | 'primary' | 'secondary' | 'href' | 'onClick'>;\n\nexport type RecentSearch = Pick<MenuItemProps, 'id' | 'primary' | 'href' | 'onClick'>;\n\nexport interface SearchInputProps extends NoChildrenProp {\n /**\n * Placeholder text. The default value is a locale translation of 'Search…'\n * @default 'Search…'\n */\n placeholder?: FormControlProps['placeholder'];\n /**\n * Creates a controlled input and sets the value. Requires an onChange handler to update value.\n * value + onChange is the recommended method per React team.\n */\n value?: FormControlProps['value'];\n /** Called when the SearchInput value changes. */\n onSearchChange?: (value: string) => void;\n /**\n * Called when the SearchButton is clicked or when the Enter key is pressed while SearchInput is in focus.\n * NOTE: this does not trigger an actual form submit event. It simply represents an explicit action by the user to search as opposed to onSearchChange.\n */\n onSearchSubmit?: (value: string) => void;\n /** A list of user selectable scopes to filter search with. */\n filters?: string[];\n /** The selected scope filter on initial render. */\n defaultFilter?: string;\n /** Called when user changes scope filter. */\n onFilterChange?: (value: string) => void;\n /** A list of matching results presented in the input's dropdown menu. */\n searchResults?: SearchResult[];\n /** A list of recent searches presented in the input's dropdown menu. */\n recentSearches?: RecentSearch[];\n /** Places the menu into an indeterminate loading state. */\n loading?: boolean;\n /** Prop passed to the advanced search page link. */\n advancedSearchLink?: OmitStrict<LinkProps, 'children'>;\n /** Aria label for search input, used by screen readers. */\n searchInputAriaLabel?: string;\n /**\n * Boolean for determining for whether the search results will render in a popover.\n * @default true\n */\n resultsPopover?: boolean;\n}\n\nconst SearchInput: FunctionComponent<SearchInputProps & ForwardProps> = forwardRef(\n function SearchInput(props: PropsWithoutRef<SearchInputProps>, ref: Ref<HTMLInputElement>) {\n const t = useI18n();\n\n const {\n value = '',\n defaultFilter,\n filters,\n onFilterChange,\n searchResults,\n recentSearches,\n loading: loadingProp,\n advancedSearchLink,\n placeholder = t('search_placeholder_default'),\n onSearchChange,\n onSearchSubmit,\n searchInputAriaLabel,\n resultsPopover = true,\n ...restProps\n } = props;\n const instructionTextId = useUID();\n const { announcePolite } = useLiveLog();\n const bodyRef = useRef<Element>(document.body);\n const inputRef = useConsolidatedRef(ref);\n const filtersRef = useRef<HTMLDivElement>(null);\n const searchResultsRef = useRef<HTMLDivElement>(null);\n\n const [searchMenuOpen, setSearchMenuOpen] = useState(false);\n const [searchResultItems, setSearchResultItems] = useState<MenuItemProps[] | undefined>(\n undefined\n );\n const [selectedFilter, setSelectedFilter] = useState(defaultFilter ?? t('all'));\n const [downPressed, setDownPressed] = useState(false);\n\n const completeFilters = [t('all'), ...(filters ?? [])];\n const hasFilters = completeFilters.length > 1;\n const hasSearchResults = !!(searchResults && searchResults.length);\n const hasRecentSearches = !!(recentSearches && recentSearches.length);\n const showSearchMenu = (value || recentSearches?.length) && (searchResultItems || loadingProp);\n const useRecents = hasRecentSearches && !value;\n const loading = useRecents ? false : !!loadingProp;\n const searchMenuVisible =\n (resultsPopover && showSearchMenu && searchMenuOpen) || (!resultsPopover && showSearchMenu);\n\n const handleEscape = useCallback(\n (e: KeyboardEvent) => {\n if (searchMenuOpen) {\n e.preventDefault();\n e.stopPropagation();\n setSearchMenuOpen(false);\n setDownPressed(false);\n }\n },\n [searchMenuOpen]\n );\n\n useEscape(handleEscape, inputRef, [handleEscape]);\n\n const onKeyDown = useCallback(\n (e: ReactKeyboardEvent<HTMLInputElement>) => {\n switch (e.key) {\n case 'Enter':\n if (!downPressed) {\n onSearchSubmit?.(value);\n }\n break;\n case 'ArrowDown':\n setDownPressed(true);\n setSearchMenuOpen(true);\n break;\n case 'Tab': {\n const forward = !e.shiftKey;\n\n if (forward) {\n const popoverFocusables = getFocusables(searchResultsRef);\n\n if (popoverFocusables.length) {\n e.preventDefault();\n popoverFocusables[0].focus();\n }\n }\n break;\n }\n default:\n break;\n }\n },\n [onSearchSubmit, downPressed, value]\n );\n\n useOuterEvent('click', [searchResultsRef, inputRef, filtersRef], () => {\n setSearchMenuOpen(false);\n });\n\n useEffect(() => {\n setDownPressed(false);\n }, [value]);\n\n useEffect(() => {\n let items: MenuItemProps[] | undefined = [];\n if (hasSearchResults && value) {\n items = searchResults;\n } else if (useRecents) {\n items = recentSearches;\n } else if (!searchResults && (!recentSearches || recentSearches.length === 0)) {\n items = undefined;\n }\n setSearchResultItems(items);\n }, [searchResults, recentSearches, searchMenuOpen, hasSearchResults, hasRecentSearches, value]);\n\n // Announce results\n useEffect(() => {\n if (!searchMenuVisible || loading) return;\n\n const timeout = setTimeout(() => {\n announcePolite({\n message: t(\n useRecents ? 'recent_results_count' : 'results_count',\n [searchResultItems?.length ?? 0],\n {\n count: searchResultItems?.length ?? 0\n }\n ),\n type: 'status'\n });\n }, 1000);\n\n return () => {\n clearTimeout(timeout);\n };\n }, [loading, searchMenuVisible, searchResultItems]);\n\n const searchMenu = (\n <Menu\n as={StyledSearchMenu}\n header={\n recentSearches && !value ? (\n <Text variant='secondary'>{t('recent_searches')}</Text>\n ) : undefined\n }\n mode='action'\n items={searchResultItems ?? []}\n loading={loading}\n footer={\n advancedSearchLink ? (\n <Link {...advancedSearchLink}>{t('advanced_search')}</Link>\n ) : undefined\n }\n accent={hasSearchResults ? createStringMatcher(value, undefined, 'gi') : undefined}\n focusControlEl={inputRef.current || undefined}\n pauseDescendantEvaluation={!downPressed}\n aria-label={searchInputAriaLabel || t('search')}\n />\n );\n\n const focus = useFocusWithin([inputRef, searchResultsRef], focused => {\n if (!focused) {\n setDownPressed(false);\n setSearchMenuOpen(false);\n }\n });\n\n useEffect(() => {\n if (focus) {\n setSearchMenuOpen(true);\n }\n }, [focus]);\n\n return (\n <>\n <Flex container as={StyledSearchInput} hasFilters={hasFilters}>\n {hasFilters ? (\n <StyledMenuButton\n text={selectedFilter}\n variant='text'\n icon='search'\n aria-label={\n selectedFilter === 'All'\n ? t('select_search_filter')\n : t('selected_search_filter', [selectedFilter])\n }\n menu={{\n mode: 'single-select',\n items: completeFilters.map(filter => ({\n primary: filter,\n id: filter,\n selected: selectedFilter === filter,\n onClick: () => {\n setSelectedFilter(filter);\n onFilterChange?.(filter);\n inputRef.current?.focus();\n }\n }))\n }}\n />\n ) : (\n <Flex\n as={StyledSearchButton}\n onClick={(e: MouseEvent<HTMLButtonElement>) => {\n e.preventDefault();\n inputRef.current?.focus();\n }}\n forwardedAs='div'\n container={{\n alignItems: 'center'\n }}\n >\n <Icon name='search' />\n </Flex>\n )}\n\n <StyledSearchTextInput\n ref={inputRef}\n type='search'\n aria-label={searchInputAriaLabel}\n placeholder={placeholder}\n {...restProps}\n aria-describedby={searchMenuVisible ? instructionTextId : undefined}\n value={value}\n onChange={(e: ChangeEvent<HTMLInputElement>) => {\n onSearchChange?.(e.target.value);\n if (e.target.value) setSearchMenuOpen(true);\n }}\n onKeyDown={onKeyDown}\n decoupled={hasFilters}\n autoComplete='off'\n />\n\n {value && (\n <StyledCancelButton\n icon\n onClick={() => {\n onSearchChange?.('');\n inputRef.current?.focus();\n }}\n variant='simple'\n compact\n label={t('clear')}\n >\n <Icon name='times' />\n </StyledCancelButton>\n )}\n </Flex>\n\n {showSearchMenu && resultsPopover && (\n <Popover\n as={StyledResultsPopover}\n target={inputRef.current}\n show={searchMenuOpen}\n placement='bottom-start'\n modifiers={[sameWidth]}\n onKeyDown={(e: KeyboardEvent) => {\n if (!inputRef.current) return;\n\n if (e.key === 'Tab') {\n const popoverFocusables = getFocusables(searchResultsRef);\n const currentIndex = popoverFocusables.indexOf(e.target as HTMLElement);\n const forward = !e.shiftKey;\n const isLast = currentIndex === popoverFocusables.length - 1;\n\n if (forward && isLast) {\n e.preventDefault();\n const allFocusable = getFocusables(bodyRef as MutableRefObject<HTMLElement>);\n const nextIndex = allFocusable.indexOf(inputRef.current) + 1;\n\n allFocusable[nextIndex]?.focus();\n setDownPressed(false);\n setSearchMenuOpen(false);\n } else if (!forward && currentIndex === 0) {\n e.preventDefault();\n inputRef.current.focus();\n }\n }\n if (e.key === 'Escape') {\n handleEscape(e);\n inputRef.current.focus();\n }\n }}\n ref={searchResultsRef}\n >\n {searchMenu}\n </Popover>\n )}\n\n {!resultsPopover && showSearchMenu && (\n <StyledSearchResultsContainer>{searchMenu}</StyledSearchResultsContainer>\n )}\n\n {searchMenuVisible && (\n <VisuallyHiddenText id={instructionTextId}>\n {`${t('search_instructions')} `}\n </VisuallyHiddenText>\n )}\n </>\n );\n }\n);\n\nexport default SearchInput;\n"]}
|
|
1
|
+
{"version":3,"file":"SearchInput.js","sourceRoot":"","sources":["../../../src/components/SearchInput/SearchInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAY7E,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AAExD,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,OAAO,EACP,aAAa,EACb,UAAU,EACV,MAAM,EACN,cAAc,EACf,MAAM,aAAa,CAAC;AACrB,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,4BAA4B,EAC5B,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,CAAC,UAAU,CAAC,CAAC;AA+CzB,MAAM,WAAW,GAAuD,UAAU,CAChF,SAAS,WAAW,CAAC,KAAwC,EAAE,GAA0B;IACvF,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,MAAM,EACJ,KAAK,GAAG,EAAE,EACV,aAAa,EACb,OAAO,EACP,cAAc,EACd,aAAa,EACb,cAAc,EACd,OAAO,EAAE,WAAW,EACpB,kBAAkB,EAClB,WAAW,GAAG,CAAC,CAAC,4BAA4B,CAAC,EAC7C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,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { forwardRef, useState, useCallback, useEffect, useRef } from 'react';\nimport type {\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n ChangeEvent,\n KeyboardEvent as ReactKeyboardEvent,\n MouseEvent,\n MutableRefObject\n} from 'react';\n\nimport type { ForwardProps, NoChildrenProp, OmitStrict } from '../../types';\nimport Icon, { registerIcon } from '../Icon';\nimport * as searchIcon from '../Icon/icons/search.icon';\nimport type { FormControlProps } from '../FormControl';\nimport {\n useConsolidatedRef,\n useEscape,\n useI18n,\n useOuterEvent,\n useLiveLog,\n useUID,\n useFocusWithin\n} from '../../hooks';\nimport Flex from '../Flex';\nimport Popover from '../Popover';\nimport { sameWidth } from '../Popover/modifiers';\nimport Menu from '../Menu';\nimport type { MenuItemProps } from '../Menu';\nimport Link from '../Link';\nimport type { LinkProps } from '../Link';\nimport Text from '../Text';\nimport { createStringMatcher, getFocusables } from '../../utils';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\n\nimport {\n StyledCancelButton,\n StyledResultsPopover,\n StyledSearchButton,\n StyledSearchInput,\n StyledSearchMenu,\n StyledSearchResultsContainer,\n StyledSearchTextInput,\n StyledMenuButton\n} from './SearchInput.styles';\n\nregisterIcon(searchIcon);\n\nexport type SearchResult = Pick<MenuItemProps, 'id' | 'primary' | 'secondary' | 'href' | 'onClick'>;\n\nexport type RecentSearch = Pick<MenuItemProps, 'id' | 'primary' | 'href' | 'onClick'>;\n\nexport interface SearchInputProps extends NoChildrenProp {\n /**\n * Placeholder text. The default value is a locale translation of 'Search…'\n * @default 'Search…'\n */\n placeholder?: FormControlProps['placeholder'];\n /**\n * Creates a controlled input and sets the value. Requires an onChange handler to update value.\n * value + onChange is the recommended method per React team.\n */\n value?: FormControlProps['value'];\n /** Called when the SearchInput value changes. */\n onSearchChange?: (value: string) => void;\n /**\n * Called when the SearchButton is clicked or when the Enter key is pressed while SearchInput is in focus.\n * NOTE: this does not trigger an actual form submit event. It simply represents an explicit action by the user to search as opposed to onSearchChange.\n */\n onSearchSubmit?: (value: string) => void;\n /** A list of user selectable scopes to filter search with. */\n filters?: string[];\n /** The selected scope filter on initial render. */\n defaultFilter?: string;\n /** Called when user changes scope filter. */\n onFilterChange?: (value: string) => void;\n /** A list of matching results presented in the input's dropdown menu. */\n searchResults?: SearchResult[];\n /** A list of recent searches presented in the input's dropdown menu. */\n recentSearches?: RecentSearch[];\n /** Places the menu into an indeterminate loading state. */\n loading?: boolean;\n /** Prop passed to the advanced search page link. */\n advancedSearchLink?: OmitStrict<LinkProps, 'children'>;\n /** Aria label for search input, used by screen readers. */\n searchInputAriaLabel?: string;\n /**\n * Boolean for determining for whether the search results will render in a popover.\n * @default true\n */\n resultsPopover?: boolean;\n}\n\nconst SearchInput: FunctionComponent<SearchInputProps & ForwardProps> = forwardRef(\n function SearchInput(props: PropsWithoutRef<SearchInputProps>, ref: Ref<HTMLInputElement>) {\n const t = useI18n();\n\n const {\n value = '',\n defaultFilter,\n filters,\n onFilterChange,\n searchResults,\n recentSearches,\n loading: loadingProp,\n advancedSearchLink,\n placeholder = t('search_placeholder_default'),\n onSearchChange,\n onSearchSubmit,\n searchInputAriaLabel,\n resultsPopover = true,\n ...restProps\n } = props;\n const instructionTextId = useUID();\n const { announcePolite } = useLiveLog();\n const bodyRef = useRef<Element>(document.body);\n const inputRef = useConsolidatedRef(ref);\n const filtersRef = useRef<HTMLDivElement>(null);\n const searchResultsRef = useRef<HTMLDivElement>(null);\n\n const [searchMenuOpen, setSearchMenuOpen] = useState(false);\n const [searchResultItems, setSearchResultItems] = useState<MenuItemProps[] | undefined>(\n undefined\n );\n const [selectedFilter, setSelectedFilter] = useState(defaultFilter ?? t('all'));\n const [downPressed, setDownPressed] = useState(false);\n\n const completeFilters = [t('all'), ...(filters ?? [])];\n const hasFilters = completeFilters.length > 1;\n const hasSearchResults = !!(searchResults && searchResults.length);\n const hasRecentSearches = !!(recentSearches && recentSearches.length);\n const showSearchMenu = (value || recentSearches?.length) && (searchResultItems || loadingProp);\n const useRecents = hasRecentSearches && !value;\n const loading = useRecents ? false : !!loadingProp;\n const searchMenuVisible =\n (resultsPopover && showSearchMenu && searchMenuOpen) || (!resultsPopover && showSearchMenu);\n\n const handleEscape = useCallback(\n (e: KeyboardEvent) => {\n if (searchMenuOpen) {\n e.preventDefault();\n e.stopPropagation();\n setSearchMenuOpen(false);\n setDownPressed(false);\n }\n },\n [searchMenuOpen]\n );\n\n useEscape(handleEscape, inputRef, [handleEscape]);\n\n const onKeyDown = useCallback(\n (e: ReactKeyboardEvent<HTMLInputElement>) => {\n switch (e.key) {\n case 'Enter':\n if (!downPressed) {\n onSearchSubmit?.(value);\n }\n break;\n case 'ArrowDown':\n setDownPressed(true);\n setSearchMenuOpen(true);\n break;\n case 'Tab': {\n const forward = !e.shiftKey;\n\n if (forward) {\n const popoverFocusables = getFocusables(searchResultsRef);\n\n if (popoverFocusables.length) {\n e.preventDefault();\n popoverFocusables[0].focus();\n }\n }\n break;\n }\n default:\n break;\n }\n },\n [onSearchSubmit, downPressed, value]\n );\n\n useOuterEvent('click', [searchResultsRef, inputRef, filtersRef], () => {\n setSearchMenuOpen(false);\n });\n\n useEffect(() => {\n setDownPressed(false);\n }, [value]);\n\n useEffect(() => {\n let items: MenuItemProps[] | undefined = [];\n if (hasSearchResults && value) {\n items = searchResults;\n } else if (useRecents) {\n items = recentSearches;\n } else if (!searchResults && (!recentSearches || recentSearches.length === 0)) {\n items = undefined;\n }\n setSearchResultItems(items);\n }, [searchResults, recentSearches, searchMenuOpen, hasSearchResults, hasRecentSearches, value]);\n\n // Announce results\n useEffect(() => {\n if (!searchMenuVisible || loading) return;\n\n const timeout = setTimeout(() => {\n announcePolite({\n message: t(\n useRecents ? 'recent_results_count' : 'results_count',\n [searchResultItems?.length ?? 0],\n {\n count: searchResultItems?.length ?? 0\n }\n ),\n type: 'status'\n });\n }, 1000);\n\n return () => {\n clearTimeout(timeout);\n };\n }, [loading, searchMenuVisible, searchResultItems]);\n\n const searchMenu = (\n <Menu\n as={StyledSearchMenu}\n header={\n recentSearches && !value ? (\n <Text variant='secondary'>{t('recent_searches')}</Text>\n ) : undefined\n }\n mode='action'\n items={searchResultItems ?? []}\n loading={loading}\n footer={\n advancedSearchLink ? (\n <Link {...advancedSearchLink}>{t('advanced_search')}</Link>\n ) : undefined\n }\n accent={hasSearchResults ? createStringMatcher(value, undefined, 'gi') : undefined}\n focusControlEl={inputRef.current || undefined}\n pauseDescendantEvaluation={!downPressed}\n aria-label={searchInputAriaLabel || t('search')}\n />\n );\n\n const focus = useFocusWithin([inputRef, searchResultsRef], focused => {\n if (!focused) {\n setDownPressed(false);\n setSearchMenuOpen(false);\n }\n });\n\n useEffect(() => {\n if (focus) {\n setSearchMenuOpen(true);\n }\n }, [focus]);\n\n return (\n <>\n <Flex container as={StyledSearchInput} hasFilters={hasFilters}>\n {hasFilters ? (\n <StyledMenuButton\n text={selectedFilter}\n variant='text'\n icon='search'\n aria-label={\n selectedFilter === 'All'\n ? t('select_search_filter')\n : t('selected_search_filter', [selectedFilter])\n }\n menu={{\n mode: 'single-select',\n items: completeFilters.map(filter => ({\n primary: filter,\n id: filter,\n selected: selectedFilter === filter,\n onClick: () => {\n setSelectedFilter(filter);\n onFilterChange?.(filter);\n inputRef.current?.focus();\n }\n }))\n }}\n />\n ) : (\n <Flex\n as={StyledSearchButton}\n onClick={(e: MouseEvent<HTMLButtonElement>) => {\n e.preventDefault();\n inputRef.current?.focus();\n }}\n forwardedAs='div'\n container={{\n alignItems: 'center'\n }}\n >\n <Icon name='search' />\n </Flex>\n )}\n\n <StyledSearchTextInput\n ref={inputRef}\n type='search'\n aria-label={searchInputAriaLabel}\n placeholder={placeholder}\n {...restProps}\n aria-describedby={searchMenuVisible ? instructionTextId : undefined}\n value={value}\n onChange={(e: ChangeEvent<HTMLInputElement>) => {\n onSearchChange?.(e.target.value);\n if (e.target.value) setSearchMenuOpen(true);\n }}\n onKeyDown={onKeyDown}\n decoupled={hasFilters}\n autoComplete='off'\n />\n\n {value && (\n <StyledCancelButton\n icon\n onClick={() => {\n onSearchChange?.('');\n inputRef.current?.focus();\n }}\n variant='simple'\n compact\n label={t('clear')}\n >\n <Icon name='times' />\n </StyledCancelButton>\n )}\n </Flex>\n\n {showSearchMenu && resultsPopover && (\n <Popover\n as={StyledResultsPopover}\n target={inputRef.current}\n show={searchMenuOpen}\n placement='bottom-start'\n modifiers={[sameWidth]}\n onKeyDown={(e: KeyboardEvent) => {\n if (!inputRef.current) return;\n\n if (e.key === 'Tab') {\n const popoverFocusables = getFocusables(searchResultsRef);\n const currentIndex = popoverFocusables.indexOf(e.target as HTMLElement);\n const forward = !e.shiftKey;\n const isLast = currentIndex === popoverFocusables.length - 1;\n\n if (forward && isLast) {\n e.preventDefault();\n const allFocusable = getFocusables(bodyRef as MutableRefObject<HTMLElement>);\n const nextIndex = allFocusable.indexOf(inputRef.current) + 1;\n\n allFocusable[nextIndex]?.focus();\n setDownPressed(false);\n setSearchMenuOpen(false);\n } else if (!forward && currentIndex === 0) {\n e.preventDefault();\n inputRef.current.focus();\n }\n }\n if (e.key === 'Escape') {\n handleEscape(e);\n inputRef.current.focus();\n }\n }}\n ref={searchResultsRef}\n >\n {searchMenu}\n </Popover>\n )}\n\n {!resultsPopover && showSearchMenu && (\n <StyledSearchResultsContainer>{searchMenu}</StyledSearchResultsContainer>\n )}\n\n {searchMenuVisible && (\n <VisuallyHiddenText id={instructionTextId}>\n {`${t('search_instructions')} `}\n </VisuallyHiddenText>\n )}\n </>\n );\n }\n);\n\nexport default SearchInput;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import { BaseProps, ForwardProps } from '../../types';
|
|
1
|
+
import type { FunctionComponent } from 'react';
|
|
2
|
+
import type { BaseProps, ForwardProps } from '../../types';
|
|
3
3
|
export interface OptionProps extends BaseProps {
|
|
4
4
|
/** Text content for the Option. */
|
|
5
5
|
children: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Option.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Option.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Option.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Option.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3D,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,8FAA8F;IAC9F,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAID,QAAA,MAAM,MAAM,EAAE,iBAAiB,CAAC,WAAW,GAAG,YAAY,CAGzD,CAAC;AAIF,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Option.js","sourceRoot":"","sources":["../../../src/components/Select/Option.tsx"],"names":[],"mappings":";AAWA,MAAM,YAAY,GAAyB,EAAE,CAAC;AAE9C,MAAM,MAAM,GAAkD,CAAC,KAAkB,EAAE,EAAE;IACnF,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACzC,OAAO,oBAAY,SAAS,YAAG,QAAQ,GAAU,CAAC;AACpD,CAAC,CAAC;AAEF,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;AAEnC,eAAe,MAAM,CAAC","sourcesContent":["import { FunctionComponent } from 'react';\n\nimport { BaseProps, ForwardProps } from '../../types';\n\nexport interface OptionProps extends BaseProps {\n /** Text content for the Option. */\n children: string;\n /** Value associated with the Option. This value is passed to the Select onChange function. */\n value?: string;\n}\n\nconst defaultProps: Partial<OptionProps> = {};\n\nconst Option: FunctionComponent<OptionProps & ForwardProps> = (props: OptionProps) => {\n const { children, ...restProps } = props;\n return <option {...restProps}>{children}</option>;\n};\n\nOption.defaultProps = defaultProps;\n\nexport default Option;\n"]}
|
|
1
|
+
{"version":3,"file":"Option.js","sourceRoot":"","sources":["../../../src/components/Select/Option.tsx"],"names":[],"mappings":";AAWA,MAAM,YAAY,GAAyB,EAAE,CAAC;AAE9C,MAAM,MAAM,GAAkD,CAAC,KAAkB,EAAE,EAAE;IACnF,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACzC,OAAO,oBAAY,SAAS,YAAG,QAAQ,GAAU,CAAC;AACpD,CAAC,CAAC;AAEF,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;AAEnC,eAAe,MAAM,CAAC","sourcesContent":["import type { FunctionComponent } from 'react';\n\nimport type { BaseProps, ForwardProps } from '../../types';\n\nexport interface OptionProps extends BaseProps {\n /** Text content for the Option. */\n children: string;\n /** Value associated with the Option. This value is passed to the Select onChange function. */\n value?: string;\n}\n\nconst defaultProps: Partial<OptionProps> = {};\n\nconst Option: FunctionComponent<OptionProps & ForwardProps> = (props: OptionProps) => {\n const { children, ...restProps } = props;\n return <option {...restProps}>{children}</option>;\n};\n\nOption.defaultProps = defaultProps;\n\nexport default Option;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FunctionComponent, Ref, ReactNode, ChangeEventHandler } from 'react';
|
|
2
|
-
import { Action, BaseProps, ForwardProps, TestIdProp } from '../../types';
|
|
3
|
-
import { FormControlProps } from '../FormControl';
|
|
1
|
+
import type { FunctionComponent, Ref, ReactNode, ChangeEventHandler } from 'react';
|
|
2
|
+
import type { Action, BaseProps, ForwardProps, TestIdProp } from '../../types';
|
|
3
|
+
import type { FormControlProps } from '../FormControl';
|
|
4
4
|
export interface SelectProps extends BaseProps, TestIdProp {
|
|
5
5
|
/** Pass Options components as children to render the options of the Select list. */
|
|
6
6
|
children: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EAEjB,GAAG,EACH,SAAS,EACT,kBAAkB,EAEnB,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAOvD,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,UAAU;IACxD,oFAAoF;IACpF,QAAQ,EAAE,SAAS,CAAC;IACpB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;IACjD,6DAA6D;IAC7D,mBAAmB,CAAC,EAAE,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;IAC9D;;;OAGG;IACH,EAAE,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC5B,oDAAoD;IACpD,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACpC,2DAA2D;IAC3D,KAAK,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAClC,uCAAuC;IACvC,WAAW,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;IAC9C,6GAA6G;IAC7G,IAAI,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAChC,wEAAwE;IACxE,QAAQ,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACxC;;;OAGG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAClC,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAC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O,EAChB,mBAAmB,EAAE,mBAAmB,EACxC,cAAc,EAAE,cAAc,YAE7B,IAAI,GACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n ReactNode,\n ChangeEventHandler,\n MouseEvent\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport { Action, BaseProps, ForwardProps, TestIdProp } from '../../types';\nimport FormField from '../FormField';\nimport { StyledFormControl, FormControlProps } from '../FormControl';\nimport { useDirection, useI18n, useTestIds, useUID } from '../../hooks';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\nimport { withTestIds } from '../../utils';\n\nimport { getSelectTestIds } from './Select.test-ids';\n\nexport interface SelectProps extends BaseProps, TestIdProp {\n /** Pass Options components as children to render the options of the Select list. */\n children: ReactNode;\n /** Called when an Option is chosen within the list. */\n onChange?: ChangeEventHandler<HTMLSelectElement>;\n /** Callback fired when AI suggestion is accepted/rejected */\n onResolveSuggestion?: FormControlProps['onResolveSuggestion'];\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /** Visually hides the label region. */\n labelHidden?: FormControlProps['labelHidden'];\n /** It is recommended to pass a simple string to offer guidance. Text will be styled based on status prop. */\n info?: FormControlProps['info'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /**\n * Creates a controlled input and sets the value. Requires an onChange handler to update value.\n * value + onChange is the recommended method per React team.\n */\n value?: FormControlProps['value'];\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Makes the input non editable and non clickable. The browser defaults to false. */\n readOnly?: FormControlProps['readOnly'];\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /** Pass an array of Action objects to append button(s) inline with the Select. */\n actions?: Action[];\n /** Pass a heading and content to show additional information on the field. */\n additionalInfo?: FormControlProps['additionalInfo'];\n /** A ref to the select element. */\n ref?: Ref<HTMLSelectElement>;\n}\n\nexport const StyledSelect = styled.select<{ status: boolean; readOnly: boolean }>(props => {\n const { readOnly } = props;\n const {\n base,\n components: {\n 'form-control': { 'foreground-color': fg },\n select\n }\n } = props.theme;\n const foreground = encodeURIComponent(fg);\n const { rtl } = useDirection();\n\n return css`\n appearance: none;\n -webkit-appearance: none;\n overflow-x: hidden;\n text-overflow: ellipsis;\n width: 100%;\n height: ${select.height};\n min-height: ${base['hit-area']['mouse-min']};\n padding-inline-start: ${select.padding};\n padding-inline-end: calc(4 * ${base.spacing});\n\n /* cspell:disable-next-line */\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 25 25' fill='${foreground}'%3E%3Cpath d='M12.1476563,16.5726562 C12.1476563,16.5726562 3.2875,9.72421875 3.2875,9.72421875 C3.2875,9.72421875 3.14375,9.58046875 3.14375,9.58046875 C3.04765625,9.3890625 3,9.19765625 3,9.00546875 C3,9.00546875 3,9.00546875 3,9.00546875 C3,8.33515625 3.33515625,8 3.9578125,8 C3.9578125,8 3.9578125,8 3.9578125,8 C4.1015625,8 4.29296875,8.09609375 4.628125,8.2390625 C4.628125,8.2390625 4.628125,8.2390625 4.628125,8.2390625 C4.628125,8.2390625 12.8179688,14.2257813 12.8179688,14.2257813 C12.8179688,14.2257813 21.103125,8.19140625 21.103125,8.19140625 C21.3421875,8.04765625 21.534375,8 21.678125,8 C21.678125,8 21.678125,8 21.678125,8 C22.3007813,8 22.6359375,8.33515625 22.6359375,9.00546875 C22.6359375,9.00546875 22.6359375,9.00546875 22.6359375,9.00546875 C22.6359375,9.196875 22.5882813,9.38828125 22.4921875,9.58046875 C22.4921875,9.58046875 22.4921875,9.58046875 22.4921875,9.58046875 C22.4921875,9.58046875 22.3484375,9.72421875 22.3484375,9.72421875 C22.3484375,9.72421875 13.4882812,16.525 13.4882812,16.525 C13.296875,16.7164063 13.0570312,16.8125 12.8179688,16.8125 C12.8179688,16.8125 12.8179688,16.8125 12.8179688,16.8125 C12.5789062,16.8125 12.3867188,16.7164062 12.1476563,16.5734375 C12.1476563,16.5734375 12.1476563,16.5734375 12.1476563,16.5734375 L12.1476563,16.5726562 Z'/%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-size: calc(2 * ${base.spacing}) auto;\n background-position: ${rtl ? base.spacing : `calc(100% - ${base.spacing}) `} 60%;\n border-width: ${select['border-width']};\n border-radius: calc(${base['border-radius']} * ${select['border-radius']});\n\n ${readOnly &&\n css`\n background-image: none;\n `}\n\n ${!props.status &&\n css`\n border-color: ${select['border-color']};\n `}\n\n &::-ms-expand {\n display: none;\n }\n\n @media (pointer: coarse) {\n min-height: ${base['hit-area']['finger-min']};\n }\n `;\n});\n\nStyledSelect.defaultProps = defaultThemeProp;\n\nconst Select: FunctionComponent<SelectProps & ForwardProps> = forwardRef(function Select(\n props: PropsWithoutRef<SelectProps>,\n ref: SelectProps['ref']\n) {\n const uid = useUID();\n const t = useI18n();\n\n const {\n testId,\n additionalInfo,\n children,\n id = uid,\n label,\n labelHidden,\n info,\n status,\n required = false,\n disabled = false,\n readOnly = false,\n actions,\n onResolveSuggestion,\n ...restProps\n } = props;\n\n const testIds = useTestIds(testId, getSelectTestIds);\n\n const Comp = (\n <StyledFormControl\n data-testid={testIds.control}\n {...restProps}\n as={StyledSelect}\n hasSuggestion={status === 'pending' && !!onResolveSuggestion}\n id={id}\n status={status}\n required={required}\n disabled={disabled}\n label={label}\n readOnly={readOnly}\n ref={ref}\n onMouseDown={\n readOnly\n ? (e: MouseEvent<HTMLSelectElement>) => {\n e.preventDefault();\n }\n : undefined\n }\n onKeyDown={\n readOnly\n ? (e: KeyboardEvent) => {\n // TODO: Consideration is needed for key modifiers, e.g. \"ctrl p\"\n if (!['Escape', 'Tab', 'Space'].includes(e.key)) e.preventDefault();\n }\n : undefined\n }\n >\n {children}\n </StyledFormControl>\n );\n\n return label ? (\n <FormField\n testId={testIds}\n label={\n <>\n {label}\n {readOnly && <VisuallyHiddenText>{` ${t('read_only')}`}</VisuallyHiddenText>}\n </>\n }\n labelHidden={labelHidden}\n id={id}\n info={info}\n status={status}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n actions={actions}\n onResolveSuggestion={onResolveSuggestion}\n additionalInfo={additionalInfo}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n});\n\nexport default withTestIds(Select, getSelectTestIds);\n"]}
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/Select/Select.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AASnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AA2CrD,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAyC,KAAK,CAAC,EAAE;IACxF,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC3B,MAAM,EACJ,IAAI,EACJ,UAAU,EAAE,EACV,cAAc,EAAE,EAAE,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B,OAAO,EAAE,OAAO,EAChB,mBAAmB,EAAE,mBAAmB,EACxC,cAAc,EAAE,cAAc,YAE7B,IAAI,GACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type {\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n ReactNode,\n ChangeEventHandler,\n MouseEvent\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport type { Action, BaseProps, ForwardProps, TestIdProp } from '../../types';\nimport FormField from '../FormField';\nimport { StyledFormControl } from '../FormControl';\nimport type { FormControlProps } from '../FormControl';\nimport { useDirection, useI18n, useTestIds, useUID } from '../../hooks';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\nimport { withTestIds } from '../../utils';\n\nimport { getSelectTestIds } from './Select.test-ids';\n\nexport interface SelectProps extends BaseProps, TestIdProp {\n /** Pass Options components as children to render the options of the Select list. */\n children: ReactNode;\n /** Called when an Option is chosen within the list. */\n onChange?: ChangeEventHandler<HTMLSelectElement>;\n /** Callback fired when AI suggestion is accepted/rejected */\n onResolveSuggestion?: FormControlProps['onResolveSuggestion'];\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /** Visually hides the label region. */\n labelHidden?: FormControlProps['labelHidden'];\n /** It is recommended to pass a simple string to offer guidance. Text will be styled based on status prop. */\n info?: FormControlProps['info'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /**\n * Creates a controlled input and sets the value. Requires an onChange handler to update value.\n * value + onChange is the recommended method per React team.\n */\n value?: FormControlProps['value'];\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Makes the input non editable and non clickable. The browser defaults to false. */\n readOnly?: FormControlProps['readOnly'];\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /** Pass an array of Action objects to append button(s) inline with the Select. */\n actions?: Action[];\n /** Pass a heading and content to show additional information on the field. */\n additionalInfo?: FormControlProps['additionalInfo'];\n /** A ref to the select element. */\n ref?: Ref<HTMLSelectElement>;\n}\n\nexport const StyledSelect = styled.select<{ status: boolean; readOnly: boolean }>(props => {\n const { readOnly } = props;\n const {\n base,\n components: {\n 'form-control': { 'foreground-color': fg },\n select\n }\n } = props.theme;\n const foreground = encodeURIComponent(fg);\n const { rtl } = useDirection();\n\n return css`\n appearance: none;\n -webkit-appearance: none;\n overflow-x: hidden;\n text-overflow: ellipsis;\n width: 100%;\n height: ${select.height};\n min-height: ${base['hit-area']['mouse-min']};\n padding-inline-start: ${select.padding};\n padding-inline-end: calc(4 * ${base.spacing});\n\n /* cspell:disable-next-line */\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 25 25' fill='${foreground}'%3E%3Cpath d='M12.1476563,16.5726562 C12.1476563,16.5726562 3.2875,9.72421875 3.2875,9.72421875 C3.2875,9.72421875 3.14375,9.58046875 3.14375,9.58046875 C3.04765625,9.3890625 3,9.19765625 3,9.00546875 C3,9.00546875 3,9.00546875 3,9.00546875 C3,8.33515625 3.33515625,8 3.9578125,8 C3.9578125,8 3.9578125,8 3.9578125,8 C4.1015625,8 4.29296875,8.09609375 4.628125,8.2390625 C4.628125,8.2390625 4.628125,8.2390625 4.628125,8.2390625 C4.628125,8.2390625 12.8179688,14.2257813 12.8179688,14.2257813 C12.8179688,14.2257813 21.103125,8.19140625 21.103125,8.19140625 C21.3421875,8.04765625 21.534375,8 21.678125,8 C21.678125,8 21.678125,8 21.678125,8 C22.3007813,8 22.6359375,8.33515625 22.6359375,9.00546875 C22.6359375,9.00546875 22.6359375,9.00546875 22.6359375,9.00546875 C22.6359375,9.196875 22.5882813,9.38828125 22.4921875,9.58046875 C22.4921875,9.58046875 22.4921875,9.58046875 22.4921875,9.58046875 C22.4921875,9.58046875 22.3484375,9.72421875 22.3484375,9.72421875 C22.3484375,9.72421875 13.4882812,16.525 13.4882812,16.525 C13.296875,16.7164063 13.0570312,16.8125 12.8179688,16.8125 C12.8179688,16.8125 12.8179688,16.8125 12.8179688,16.8125 C12.5789062,16.8125 12.3867188,16.7164062 12.1476563,16.5734375 C12.1476563,16.5734375 12.1476563,16.5734375 12.1476563,16.5734375 L12.1476563,16.5726562 Z'/%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-size: calc(2 * ${base.spacing}) auto;\n background-position: ${rtl ? base.spacing : `calc(100% - ${base.spacing}) `} 60%;\n border-width: ${select['border-width']};\n border-radius: calc(${base['border-radius']} * ${select['border-radius']});\n\n ${readOnly &&\n css`\n background-image: none;\n `}\n\n ${!props.status &&\n css`\n border-color: ${select['border-color']};\n `}\n\n &::-ms-expand {\n display: none;\n }\n\n @media (pointer: coarse) {\n min-height: ${base['hit-area']['finger-min']};\n }\n `;\n});\n\nStyledSelect.defaultProps = defaultThemeProp;\n\nconst Select: FunctionComponent<SelectProps & ForwardProps> = forwardRef(function Select(\n props: PropsWithoutRef<SelectProps>,\n ref: SelectProps['ref']\n) {\n const uid = useUID();\n const t = useI18n();\n\n const {\n testId,\n additionalInfo,\n children,\n id = uid,\n label,\n labelHidden,\n info,\n status,\n required = false,\n disabled = false,\n readOnly = false,\n actions,\n onResolveSuggestion,\n ...restProps\n } = props;\n\n const testIds = useTestIds(testId, getSelectTestIds);\n\n const Comp = (\n <StyledFormControl\n data-testid={testIds.control}\n {...restProps}\n as={StyledSelect}\n hasSuggestion={status === 'pending' && !!onResolveSuggestion}\n id={id}\n status={status}\n required={required}\n disabled={disabled}\n label={label}\n readOnly={readOnly}\n ref={ref}\n onMouseDown={\n readOnly\n ? (e: MouseEvent<HTMLSelectElement>) => {\n e.preventDefault();\n }\n : undefined\n }\n onKeyDown={\n readOnly\n ? (e: KeyboardEvent) => {\n // TODO: Consideration is needed for key modifiers, e.g. \"ctrl p\"\n if (!['Escape', 'Tab', 'Space'].includes(e.key)) e.preventDefault();\n }\n : undefined\n }\n >\n {children}\n </StyledFormControl>\n );\n\n return label ? (\n <FormField\n testId={testIds}\n label={\n <>\n {label}\n {readOnly && <VisuallyHiddenText>{` ${t('read_only')}`}</VisuallyHiddenText>}\n </>\n }\n labelHidden={labelHidden}\n id={id}\n info={info}\n status={status}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n actions={actions}\n onResolveSuggestion={onResolveSuggestion}\n additionalInfo={additionalInfo}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n});\n\nexport default withTestIds(Select, getSelectTestIds);\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FunctionComponent, Ref } from 'react';
|
|
2
|
-
import { BaseProps, ForwardProps, NoChildrenProp } from '../../types';
|
|
1
|
+
import type { FunctionComponent, Ref } from 'react';
|
|
2
|
+
import type { BaseProps, ForwardProps, NoChildrenProp } from '../../types';
|
|
3
3
|
export interface SentimentProps extends BaseProps, NoChildrenProp {
|
|
4
4
|
/** Ref to the element */
|
|
5
5
|
ref?: Ref<HTMLDivElement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sentiment.d.ts","sourceRoot":"","sources":["../../../src/components/Sentiment/Sentiment.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sentiment.d.ts","sourceRoot":"","sources":["../../../src/components/Sentiment/Sentiment.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAMrE,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG3E,MAAM,WAAW,cAAe,SAAQ,SAAS,EAAE,cAAc;IAC/D,yBAAyB;IACzB,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,+BAA+B;IAC/B,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;IAC7C;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4FAA4F;IAC5F,MAAM,CAAC,EAAE;SACN,OAAO,IAAI,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM;KAChD,CAAC;IACF,0FAA0F;IAC1F,KAAK,CAAC,EAAE;SACL,OAAO,IAAI,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM;KAChD,CAAC;IACF,qCAAqC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAQD,eAAO,MAAM,eAAe,qHAO1B,CAAC;AAIH,QAAA,MAAM,SAAS,EAAE,iBAAiB,CAAC,cAAc,GAAG,YAAY,CAmC9D,CAAC;AAEH,eAAe,SAAS,CAAC"}
|