@pega/cosmos-react-core 4.0.0-dev.12.1 → 4.0.0-dev.14.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/README.md +2 -2
- package/lib/components/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js +2 -1
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +10 -12
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.types.d.ts +6 -6
- package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.types.js.map +1 -1
- package/lib/components/AppShell/AppShellContext.d.ts +1 -1
- package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellContext.js.map +1 -1
- package/lib/components/AppShell/AppShellList.styles.js +1 -1
- package/lib/components/AppShell/AppShellList.styles.js.map +1 -1
- package/lib/components/AppShell/NavigationList.d.ts.map +1 -1
- package/lib/components/AppShell/NavigationList.js +2 -2
- package/lib/components/AppShell/NavigationList.js.map +1 -1
- package/lib/components/Banner/Banner.d.ts.map +1 -1
- package/lib/components/Banner/Banner.js +3 -3
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Boolean/BooleanDisplay.js +2 -2
- package/lib/components/Boolean/BooleanDisplay.js.map +1 -1
- package/lib/components/Button/Button.d.ts +3 -1
- package/lib/components/Button/Button.d.ts.map +1 -1
- package/lib/components/Button/Button.js +168 -142
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.d.ts +2 -2
- package/lib/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.js +5 -3
- package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.test-ids.d.ts +2 -0
- package/lib/components/ColorPicker/ColorPicker.test-ids.d.ts.map +1 -0
- package/lib/components/ColorPicker/ColorPicker.test-ids.js +7 -0
- package/lib/components/ColorPicker/ColorPicker.test-ids.js.map +1 -0
- package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.js +7 -12
- package/lib/components/ComboBox/ComboBox.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.types.d.ts +2 -2
- 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/ComboxBox.test-ids.d.ts +2 -0
- package/lib/components/ComboBox/ComboxBox.test-ids.d.ts.map +1 -0
- package/lib/components/ComboBox/ComboxBox.test-ids.js +4 -0
- package/lib/components/ComboBox/ComboxBox.test-ids.js.map +1 -0
- package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.js +24 -13
- package/lib/components/CompositeInput/CompositeInput.js.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.test-ids.d.ts +2 -0
- package/lib/components/CompositeInput/CompositeInput.test-ids.d.ts.map +1 -0
- package/lib/components/CompositeInput/CompositeInput.test-ids.js +7 -0
- package/lib/components/CompositeInput/CompositeInput.test-ids.js.map +1 -0
- package/lib/components/CompositeInput/CompositeInput.types.d.ts +2 -2
- 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 +6 -0
- package/lib/components/Configuration/Configuration.d.ts.map +1 -1
- package/lib/components/Configuration/Configuration.js +8 -2
- package/lib/components/Configuration/Configuration.js.map +1 -1
- package/lib/components/Currency/Currency.test-ids.d.ts +2 -0
- package/lib/components/Currency/Currency.test-ids.d.ts.map +1 -0
- package/lib/components/Currency/Currency.test-ids.js +7 -0
- package/lib/components/Currency/Currency.test-ids.js.map +1 -0
- package/lib/components/Currency/CurrencyInput.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.js +6 -3
- package/lib/components/Currency/CurrencyInput.js.map +1 -1
- package/lib/components/Currency/CurrencyInput.types.d.ts +2 -2
- package/lib/components/Currency/CurrencyInput.types.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.types.js.map +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +25 -32
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.d.ts +1 -0
- package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.js +3 -0
- package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +20 -27
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.js +1 -9
- package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.js +11 -17
- package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.js +1 -1
- package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
- package/lib/components/DateTime/Picker/Weeks.js +1 -1
- package/lib/components/DateTime/Picker/Weeks.js.map +1 -1
- package/lib/components/DateTime/utils.d.ts.map +1 -1
- package/lib/components/DateTime/utils.js +69 -7
- package/lib/components/DateTime/utils.js.map +1 -1
- package/lib/components/Dialog/Dialog.d.ts.map +1 -1
- package/lib/components/Dialog/Dialog.js +2 -2
- package/lib/components/Dialog/Dialog.js.map +1 -1
- package/lib/components/Dialog/Dialog.styles.d.ts +3 -0
- package/lib/components/Dialog/Dialog.styles.d.ts.map +1 -1
- package/lib/components/Dialog/Dialog.styles.js +29 -2
- package/lib/components/Dialog/Dialog.styles.js.map +1 -1
- package/lib/components/Dialog/Dialog.types.d.ts +36 -14
- package/lib/components/Dialog/Dialog.types.d.ts.map +1 -1
- package/lib/components/Dialog/Dialog.types.js +0 -1
- package/lib/components/Dialog/Dialog.types.js.map +1 -1
- package/lib/components/Dialog/FormDialog.d.ts +4 -1
- package/lib/components/Dialog/FormDialog.d.ts.map +1 -1
- package/lib/components/Dialog/FormDialog.js +4 -5
- package/lib/components/Dialog/FormDialog.js.map +1 -1
- package/lib/components/Dialog/InfoDialog.d.ts +0 -1
- package/lib/components/Dialog/InfoDialog.d.ts.map +1 -1
- package/lib/components/Dialog/InfoDialog.js +15 -13
- package/lib/components/Dialog/InfoDialog.js.map +1 -1
- package/lib/components/Dialog/InfoDialog.styles.d.ts +6 -0
- package/lib/components/Dialog/InfoDialog.styles.d.ts.map +1 -0
- package/lib/components/Dialog/InfoDialog.styles.js +18 -0
- package/lib/components/Dialog/InfoDialog.styles.js.map +1 -0
- package/lib/components/EmojiPicker/EmojiPicker.styles.js +1 -1
- package/lib/components/EmojiPicker/EmojiPicker.styles.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.js +1 -1
- package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.d.ts +8 -6
- package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.js +11 -9
- package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.test-ids.d.ts +3 -0
- package/lib/components/FieldValueList/FieldValueList.test-ids.d.ts.map +1 -0
- package/lib/components/FieldValueList/FieldValueList.test-ids.js +7 -0
- package/lib/components/FieldValueList/FieldValueList.test-ids.js.map +1 -0
- package/lib/components/FieldValueList/index.d.ts +1 -1
- package/lib/components/FieldValueList/index.d.ts.map +1 -1
- package/lib/components/FieldValueList/index.js.map +1 -1
- package/lib/components/File/File.test-ids.d.ts +2 -0
- package/lib/components/File/File.test-ids.d.ts.map +1 -0
- package/lib/components/File/File.test-ids.js +8 -0
- package/lib/components/File/File.test-ids.js.map +1 -0
- package/lib/components/File/FileInput.d.ts +2 -2
- package/lib/components/File/FileInput.d.ts.map +1 -1
- package/lib/components/File/FileInput.js +15 -4
- package/lib/components/File/FileInput.js.map +1 -1
- package/lib/components/Flex/Flex.d.ts +7 -1
- package/lib/components/Flex/Flex.d.ts.map +1 -1
- package/lib/components/Flex/Flex.js +37 -10
- package/lib/components/Flex/Flex.js.map +1 -1
- package/lib/components/FormField/FormField.d.ts +3 -2
- package/lib/components/FormField/FormField.d.ts.map +1 -1
- package/lib/components/FormField/FormField.js +15 -10
- package/lib/components/FormField/FormField.js.map +1 -1
- package/lib/components/FormField/FormField.test-ids.d.ts +3 -0
- package/lib/components/FormField/FormField.test-ids.d.ts.map +1 -0
- package/lib/components/FormField/FormField.test-ids.js +10 -0
- package/lib/components/FormField/FormField.test-ids.js.map +1 -0
- package/lib/components/Icon/iconNames.d.ts +2 -2
- package/lib/components/Icon/iconNames.d.ts.map +1 -1
- package/lib/components/Icon/iconNames.js +2 -0
- package/lib/components/Icon/iconNames.js.map +1 -1
- package/lib/components/Icon/icons/phone-merge-solid.icon.d.ts +4 -0
- package/lib/components/Icon/icons/phone-merge-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/phone-merge-solid.icon.js +6 -0
- package/lib/components/Icon/icons/phone-merge-solid.icon.js.map +1 -0
- package/lib/components/Icon/icons/phone-merge.icon.d.ts +4 -0
- package/lib/components/Icon/icons/phone-merge.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/phone-merge.icon.js +6 -0
- package/lib/components/Icon/icons/phone-merge.icon.js.map +1 -0
- package/lib/components/IconPicker/IconPicker.js +2 -2
- package/lib/components/IconPicker/IconPicker.js.map +1 -1
- package/lib/components/Input/Input.d.ts +2 -2
- package/lib/components/Input/Input.d.ts.map +1 -1
- package/lib/components/Input/Input.js +6 -2
- package/lib/components/Input/Input.js.map +1 -1
- package/lib/components/Input/Input.test-ids.d.ts +2 -0
- package/lib/components/Input/Input.test-ids.d.ts.map +1 -0
- package/lib/components/Input/Input.test-ids.js +4 -0
- package/lib/components/Input/Input.test-ids.js.map +1 -0
- package/lib/components/List/List.d.ts.map +1 -1
- package/lib/components/List/List.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 +51 -19
- package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts +3 -1
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.js +2 -3
- package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts +2 -0
- package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts.map +1 -0
- package/lib/components/ListToolbar/ListToolbar.test-ids.js +7 -0
- package/lib/components/ListToolbar/ListToolbar.test-ids.js.map +1 -0
- package/lib/components/ListToolbar/ListToolbar.types.d.ts +31 -8
- 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/helpers.d.ts +10 -0
- package/lib/components/ListToolbar/helpers.d.ts.map +1 -0
- package/lib/components/ListToolbar/helpers.js +46 -0
- package/lib/components/ListToolbar/helpers.js.map +1 -0
- package/lib/components/ListToolbar/index.d.ts +1 -0
- package/lib/components/ListToolbar/index.d.ts.map +1 -1
- package/lib/components/ListToolbar/index.js +1 -0
- package/lib/components/ListToolbar/index.js.map +1 -1
- package/lib/components/LiveLog/LiveLog.d.ts.map +1 -1
- package/lib/components/LiveLog/LiveLog.js +17 -16
- package/lib/components/LiveLog/LiveLog.js.map +1 -1
- package/lib/components/Location/Location.test-ids.d.ts +2 -0
- package/lib/components/Location/Location.test-ids.d.ts.map +1 -0
- package/lib/components/Location/Location.test-ids.js +7 -0
- package/lib/components/Location/Location.test-ids.js.map +1 -0
- package/lib/components/Location/LocationInput.d.ts +2 -2
- package/lib/components/Location/LocationInput.d.ts.map +1 -1
- package/lib/components/Location/LocationInput.js +17 -4
- package/lib/components/Location/LocationInput.js.map +1 -1
- package/lib/components/Menu/Menu.d.ts.map +1 -1
- package/lib/components/Menu/Menu.js +7 -5
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/Menu.styles.d.ts +5 -1
- package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
- package/lib/components/Menu/Menu.styles.js +80 -88
- package/lib/components/Menu/Menu.styles.js.map +1 -1
- package/lib/components/Menu/Menu.test-ids.d.ts +3 -0
- package/lib/components/Menu/Menu.test-ids.d.ts.map +1 -0
- package/lib/components/Menu/Menu.test-ids.js +4 -0
- package/lib/components/Menu/Menu.test-ids.js.map +1 -0
- 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/MenuItem.d.ts.map +1 -1
- package/lib/components/Menu/MenuItem.js +70 -73
- package/lib/components/Menu/MenuItem.js.map +1 -1
- package/lib/components/Menu/MenuList.d.ts.map +1 -1
- package/lib/components/Menu/MenuList.js +3 -3
- package/lib/components/Menu/MenuList.js.map +1 -1
- package/lib/components/Menu/MenuListHeader.d.ts.map +1 -1
- package/lib/components/Menu/MenuListHeader.js +3 -4
- package/lib/components/Menu/MenuListHeader.js.map +1 -1
- package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
- package/lib/components/Menu/NavItemsList.js +2 -0
- package/lib/components/Menu/NavItemsList.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.d.ts +2 -2
- package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +6 -4
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.test-ids.d.ts +2 -0
- package/lib/components/MenuButton/MenuButton.test-ids.d.ts.map +1 -0
- package/lib/components/MenuButton/MenuButton.test-ids.js +3 -0
- package/lib/components/MenuButton/MenuButton.test-ids.js.map +1 -0
- 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 +5 -3
- package/lib/components/MetaList/MetaList.js.map +1 -1
- package/lib/components/MetaList/MetaList.test-ids.d.ts +2 -0
- package/lib/components/MetaList/MetaList.test-ids.d.ts.map +1 -0
- package/lib/components/MetaList/MetaList.test-ids.js +3 -0
- package/lib/components/MetaList/MetaList.test-ids.js.map +1 -0
- package/lib/components/Modal/Modal.styles.js +1 -1
- package/lib/components/Modal/Modal.styles.js.map +1 -1
- package/lib/components/Modal/ModalManager.d.ts.map +1 -1
- package/lib/components/Modal/ModalManager.js +5 -2
- package/lib/components/Modal/ModalManager.js.map +1 -1
- package/lib/components/Number/Number.test-ids.d.ts +3 -0
- package/lib/components/Number/Number.test-ids.d.ts.map +1 -0
- package/lib/components/Number/Number.test-ids.js +14 -0
- package/lib/components/Number/Number.test-ids.js.map +1 -0
- package/lib/components/Number/NumberInput.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.js +9 -6
- package/lib/components/Number/NumberInput.js.map +1 -1
- package/lib/components/Number/NumberInput.types.d.ts +2 -2
- package/lib/components/Number/NumberInput.types.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.types.js.map +1 -1
- package/lib/components/Number/NumberRangeInput.d.ts.map +1 -1
- package/lib/components/Number/NumberRangeInput.js +6 -4
- package/lib/components/Number/NumberRangeInput.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js +2 -2
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/Phone/Phone.test-ids.d.ts +2 -0
- package/lib/components/Phone/Phone.test-ids.d.ts.map +1 -0
- package/lib/components/Phone/Phone.test-ids.js +8 -0
- package/lib/components/Phone/Phone.test-ids.js.map +1 -0
- package/lib/components/Phone/PhoneInput.d.ts +2 -2
- package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
- package/lib/components/Phone/PhoneInput.js +6 -3
- package/lib/components/Phone/PhoneInput.js.map +1 -1
- package/lib/components/Popover/Popover.d.ts +1 -0
- package/lib/components/Popover/Popover.d.ts.map +1 -1
- package/lib/components/Popover/Popover.js +37 -40
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/PopoverManager.d.ts.map +1 -1
- package/lib/components/Popover/PopoverManager.js +11 -10
- package/lib/components/Popover/PopoverManager.js.map +1 -1
- package/lib/components/Popover/modifiers.d.ts +1 -0
- package/lib/components/Popover/modifiers.d.ts.map +1 -1
- package/lib/components/Popover/modifiers.js +97 -1
- package/lib/components/Popover/modifiers.js.map +1 -1
- package/lib/components/Progress/Progress.styles.d.ts.map +1 -1
- package/lib/components/Progress/Progress.styles.js +25 -20
- package/lib/components/Progress/Progress.styles.js.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.d.ts +2 -0
- package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.js +4 -4
- package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.js +1 -9
- package/lib/components/SearchInput/SearchInput.js.map +1 -1
- package/lib/components/Select/Select.d.ts +2 -2
- package/lib/components/Select/Select.d.ts.map +1 -1
- package/lib/components/Select/Select.js +7 -4
- package/lib/components/Select/Select.js.map +1 -1
- package/lib/components/Select/Select.test-ids.d.ts +2 -0
- package/lib/components/Select/Select.test-ids.d.ts.map +1 -0
- package/lib/components/Select/Select.test-ids.js +4 -0
- package/lib/components/Select/Select.test-ids.js.map +1 -0
- package/lib/components/Slider/Slider.d.ts.map +1 -1
- package/lib/components/Slider/Slider.js +7 -5
- package/lib/components/Slider/Slider.js.map +1 -1
- package/lib/components/Slider/Slider.styles.d.ts.map +1 -1
- package/lib/components/Slider/Slider.styles.js +114 -128
- package/lib/components/Slider/Slider.styles.js.map +1 -1
- package/lib/components/Slider/Slider.test-ids.d.ts +2 -0
- package/lib/components/Slider/Slider.test-ids.d.ts.map +1 -0
- package/lib/components/Slider/Slider.test-ids.js +4 -0
- package/lib/components/Slider/Slider.test-ids.js.map +1 -0
- 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/utils.d.ts.map +1 -1
- package/lib/components/Slider/utils.js +0 -1
- package/lib/components/Slider/utils.js.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.d.ts +2 -2
- package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.js +6 -3
- package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.test-ids.d.ts +2 -0
- package/lib/components/SummaryItem/SummaryItem.test-ids.d.ts.map +1 -0
- package/lib/components/SummaryItem/SummaryItem.test-ids.js +8 -0
- package/lib/components/SummaryItem/SummaryItem.test-ids.js.map +1 -0
- package/lib/components/Tabs/Tab.d.ts.map +1 -1
- package/lib/components/Tabs/Tab.js +21 -18
- package/lib/components/Tabs/Tab.js.map +1 -1
- package/lib/components/TextArea/TextArea.d.ts +2 -2
- package/lib/components/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.js +6 -2
- package/lib/components/TextArea/TextArea.js.map +1 -1
- package/lib/components/TextArea/TextArea.test-ids.d.ts +2 -0
- package/lib/components/TextArea/TextArea.test-ids.d.ts.map +1 -0
- package/lib/components/TextArea/TextArea.test-ids.js +4 -0
- package/lib/components/TextArea/TextArea.test-ids.js.map +1 -0
- package/lib/hooks/index.d.ts +2 -0
- package/lib/hooks/index.d.ts.map +1 -1
- package/lib/hooks/index.js +2 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useActiveDescendant.d.ts.map +1 -1
- package/lib/hooks/useActiveDescendant.js +3 -2
- package/lib/hooks/useActiveDescendant.js.map +1 -1
- package/lib/hooks/useBreakpoint.d.ts.map +1 -1
- package/lib/hooks/useBreakpoint.js +4 -1
- package/lib/hooks/useBreakpoint.js.map +1 -1
- package/lib/hooks/useChToPxConversionFactor.d.ts +3 -0
- package/lib/hooks/useChToPxConversionFactor.d.ts.map +1 -0
- package/lib/hooks/useChToPxConversionFactor.js +13 -0
- package/lib/hooks/useChToPxConversionFactor.js.map +1 -0
- package/lib/hooks/useElement.d.ts +1 -1
- package/lib/hooks/useElement.d.ts.map +1 -1
- package/lib/hooks/useI18n.d.ts +28 -9
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useScrollToggle.d.ts.map +1 -1
- package/lib/hooks/useScrollToggle.js +0 -1
- package/lib/hooks/useScrollToggle.js.map +1 -1
- package/lib/hooks/useTestIds.d.ts +10 -0
- package/lib/hooks/useTestIds.d.ts.map +1 -0
- package/lib/hooks/useTestIds.js +21 -0
- package/lib/hooks/useTestIds.js.map +1 -0
- package/lib/i18n/default.d.ts +28 -9
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +34 -14
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +28 -9
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/styles/gradients.d.ts.map +1 -1
- package/lib/styles/gradients.js.map +1 -1
- package/lib/theme/ThemeMachine.js.map +1 -1
- package/lib/theme/theme.d.ts +16 -16
- package/lib/types/types.d.ts +14 -0
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/types.js.map +1 -1
- package/lib/utils/createTestIds.d.ts +4 -0
- package/lib/utils/createTestIds.d.ts.map +1 -0
- package/lib/utils/createTestIds.js +8 -0
- package/lib/utils/createTestIds.js.map +1 -0
- package/lib/utils/debounce.d.ts +2 -2
- package/lib/utils/debounce.d.ts.map +1 -1
- package/lib/utils/debounce.js +9 -10
- package/lib/utils/debounce.js.map +1 -1
- package/lib/utils/getEdge.d.ts +7 -0
- package/lib/utils/getEdge.d.ts.map +1 -0
- package/lib/utils/getEdge.js +9 -0
- package/lib/utils/getEdge.js.map +1 -0
- package/lib/utils/index.d.ts +4 -0
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js +4 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/kebabToCamel.d.ts +7 -0
- package/lib/utils/kebabToCamel.d.ts.map +1 -0
- package/lib/utils/kebabToCamel.js +10 -0
- package/lib/utils/kebabToCamel.js.map +1 -0
- package/lib/utils/throttle.d.ts +4 -0
- package/lib/utils/throttle.d.ts.map +1 -0
- package/lib/utils/throttle.js +15 -0
- package/lib/utils/throttle.js.map +1 -0
- package/package.json +2 -2
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { FC, HTMLAttributes } from 'react';
|
|
2
2
|
import { OmitStrict } from '../../types';
|
|
3
3
|
import { FormDialogProps } from './Dialog.types';
|
|
4
|
-
export declare const StyledFormDialog: import("styled-components").StyledComponent<FC<import("./Dialog.types").
|
|
4
|
+
export declare const StyledFormDialog: import("styled-components").StyledComponent<FC<import("./Dialog.types").BaseDialogProps & {
|
|
5
|
+
labelledbyId?: string | undefined;
|
|
6
|
+
ariaLabel?: string | undefined;
|
|
7
|
+
} & HTMLAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
5
8
|
declare const FormDialog: FC<FormDialogProps & OmitStrict<HTMLAttributes<HTMLDivElement>, 'onSubmit'>>;
|
|
6
9
|
export default FormDialog;
|
|
7
10
|
//# sourceMappingURL=FormDialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormDialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/FormDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuC,EAAE,EAAa,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FormDialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/FormDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuC,EAAE,EAAa,cAAc,EAAE,MAAM,OAAO,CAAC;AAe3F,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AASzC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjD,eAAO,MAAM,gBAAgB;;;yFAAmB,CAAC;AAEjD,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,GAAG,UAAU,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CAmH1F,CAAC;AAEJ,eAAe,UAAU,CAAC"}
|
|
@@ -5,13 +5,12 @@ import { useConsolidatedRef, useEscape, useFocusTrap, useI18n, useOuterEvent, us
|
|
|
5
5
|
import { getFocusables } from '../../utils';
|
|
6
6
|
import Button from '../Button';
|
|
7
7
|
import Text from '../Text';
|
|
8
|
-
import { CardContent, CardFooter, CardHeader } from '../Card';
|
|
9
8
|
import Progress from '../Progress';
|
|
10
|
-
import
|
|
11
|
-
import { StyledChildrenWrap } from './Dialog.styles';
|
|
9
|
+
import Flex from '../Flex';
|
|
10
|
+
import { StyledChildrenWrap, StyledDialogContent, StyledDialogFooter, StyledDialogHeader } from './Dialog.styles';
|
|
12
11
|
import Dialog from './Dialog';
|
|
13
12
|
export const StyledFormDialog = styled(Dialog) ``;
|
|
14
|
-
const FormDialog = forwardRef(({ target, heading,
|
|
13
|
+
const FormDialog = forwardRef(({ arrow = true, target, heading, ariaLabel, children, progress, onDismiss, onCancel, onSubmit, ...restProps }, ref) => {
|
|
15
14
|
const t = useI18n();
|
|
16
15
|
const headingId = useUID();
|
|
17
16
|
const dialogRef = useConsolidatedRef(ref);
|
|
@@ -48,7 +47,7 @@ const FormDialog = forwardRef(({ target, heading, headingHidden = false, childre
|
|
|
48
47
|
}
|
|
49
48
|
};
|
|
50
49
|
}, []);
|
|
51
|
-
return (_jsxs(StyledFormDialog, { ...restProps,
|
|
50
|
+
return (_jsxs(StyledFormDialog, { ...restProps, ...(heading === undefined ? { ariaLabel } : { labelledbyId: headingId }), arrow: arrow, target: target, progress: progress, ref: dialogRef, children: [heading !== undefined && (_jsx(Flex, { container: { alignItems: 'center', justify: 'between', pad: 2 }, item: { shrink: 0 }, as: StyledDialogHeader, children: _jsx(Text, { id: headingId, variant: 'h2', children: heading }) })), _jsxs(Flex, { item: { grow: 1 }, as: StyledDialogContent, children: [children && _jsx(StyledChildrenWrap, { children: children }), _jsx(Progress, { visible: !!progress, focusOnVisible: true, placement: children ? 'local' : 'block', message: typeof progress === 'string' ? progress : undefined })] }), _jsxs(Flex, { container: { alignItems: 'center', justify: 'between', pad: 2 }, item: { shrink: 0 }, as: StyledDialogFooter, children: [_jsx(Button, { onClick: () => {
|
|
52
51
|
onCancelHandler();
|
|
53
52
|
}, disabled: typeof onCancel !== 'function' ? onCancel.disabled : undefined, ref: cancelButtonRef, children: typeof onCancel !== 'function' && onCancel.text ? onCancel.text : t('cancel') }), _jsx(Button, { variant: 'primary', onClick: () => {
|
|
54
53
|
(typeof onSubmit !== 'function' ? onSubmit.handler : onSubmit)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormDialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/FormDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,EAAM,SAAS,EAAkB,MAAM,OAAO,CAAC;AAC3F,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,YAAY,EACZ,OAAO,EACP,aAAa,EACb,MAAM,EACP,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAA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AAE;4BACZ,CAAC,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;wBACnE,CAAC,EACD,QAAQ,EAAE,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,YAEvE,OAAO,QAAQ,KAAK,UAAU,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GACvE,IACJ,IACU,CACpB,CAAC;AACJ,CAAC,CACF,CAAC;AAEJ,eAAe,UAAU,CAAC","sourcesContent":["import { forwardRef, PropsWithoutRef, useRef, FC, useEffect, HTMLAttributes } from 'react';\nimport styled from 'styled-components';\n\nimport {\n useConsolidatedRef,\n useEscape,\n useFocusTrap,\n useI18n,\n useOuterEvent,\n useUID\n} from '../../hooks';\nimport { getFocusables } from '../../utils';\nimport Button from '../Button';\nimport Text from '../Text';\nimport Progress from '../Progress';\nimport { OmitStrict } from '../../types';\nimport Flex from '../Flex';\n\nimport {\n StyledChildrenWrap,\n StyledDialogContent,\n StyledDialogFooter,\n StyledDialogHeader\n} from './Dialog.styles';\nimport { FormDialogProps } from './Dialog.types';\nimport Dialog from './Dialog';\n\nexport const StyledFormDialog = styled(Dialog)``;\n\nconst FormDialog: FC<FormDialogProps & OmitStrict<HTMLAttributes<HTMLDivElement>, 'onSubmit'>> =\n forwardRef(\n (\n {\n arrow = true,\n target,\n heading,\n ariaLabel,\n children,\n progress,\n onDismiss,\n onCancel,\n onSubmit,\n ...restProps\n }: PropsWithoutRef<FormDialogProps>,\n ref: FormDialogProps['ref']\n ) => {\n const t = useI18n();\n const headingId = useUID();\n const dialogRef = useConsolidatedRef(ref);\n const cancelButtonRef = useRef<HTMLButtonElement>(null);\n const onCancelHandler = typeof onCancel === 'function' ? onCancel : onCancel.handler;\n\n useEscape(() => {\n if (onDismiss) {\n onDismiss();\n } else {\n onCancelHandler();\n }\n });\n\n useOuterEvent('mousedown', [target, dialogRef], () => {\n if (onDismiss) {\n onDismiss();\n } else {\n onCancelHandler();\n }\n });\n\n useFocusTrap(dialogRef);\n\n useEffect(() => {\n if (!progress) {\n const focusables = getFocusables(dialogRef);\n if (focusables[0]) focusables[0].focus();\n }\n }, [progress]);\n\n useEffect(() => {\n return () => {\n if (document.contains(target)) {\n target.focus();\n }\n };\n }, []);\n\n return (\n <StyledFormDialog\n {...restProps}\n {...(heading === undefined ? { ariaLabel } : { labelledbyId: headingId })}\n arrow={arrow}\n target={target}\n progress={progress}\n ref={dialogRef}\n >\n {heading !== undefined && (\n <Flex\n container={{ alignItems: 'center', justify: 'between', pad: 2 }}\n item={{ shrink: 0 }}\n as={StyledDialogHeader}\n >\n <Text id={headingId} variant='h2'>\n {heading}\n </Text>\n </Flex>\n )}\n\n <Flex item={{ grow: 1 }} as={StyledDialogContent}>\n {children && <StyledChildrenWrap>{children}</StyledChildrenWrap>}\n <Progress\n visible={!!progress}\n focusOnVisible\n placement={children ? 'local' : 'block'}\n message={typeof progress === 'string' ? progress : undefined}\n />\n </Flex>\n\n <Flex\n container={{ alignItems: 'center', justify: 'between', pad: 2 }}\n item={{ shrink: 0 }}\n as={StyledDialogFooter}\n >\n <Button\n onClick={() => {\n onCancelHandler();\n }}\n disabled={typeof onCancel !== 'function' ? onCancel.disabled : undefined}\n ref={cancelButtonRef}\n >\n {typeof onCancel !== 'function' && onCancel.text ? onCancel.text : t('cancel')}\n </Button>\n\n <Button\n variant='primary'\n onClick={() => {\n (typeof onSubmit !== 'function' ? onSubmit.handler : onSubmit)();\n }}\n disabled={typeof onSubmit !== 'function' ? onSubmit.disabled : undefined}\n >\n {typeof onSubmit !== 'function' && onSubmit.text ? onSubmit.text : t('submit')}\n </Button>\n </Flex>\n </StyledFormDialog>\n );\n }\n );\n\nexport default FormDialog;\n"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FC, HTMLAttributes } from 'react';
|
|
2
2
|
import { InfoDialogProps } from './Dialog.types';
|
|
3
|
-
export declare const StyledInfoDialog: import("styled-components").StyledComponent<FC<import("./Dialog.types").DialogProps & HTMLAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
4
3
|
declare const InfoDialog: FC<InfoDialogProps & HTMLAttributes<HTMLDivElement>>;
|
|
5
4
|
export default InfoDialog;
|
|
6
5
|
//# sourceMappingURL=InfoDialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoDialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/InfoDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuC,EAAE,EAAa,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"InfoDialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/InfoDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuC,EAAE,EAAa,cAAc,EAAE,MAAM,OAAO,CAAC;AAiB3F,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjD,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,GAAG,cAAc,CAAC,cAAc,CAAC,CAgHpE,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useRef, useEffect } from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
3
|
import { useConsolidatedRef, useEscape, useFocusTrap, useI18n, useOuterEvent, useUID } from '../../hooks';
|
|
5
|
-
import Button from '../Button';
|
|
6
4
|
import Text from '../Text';
|
|
7
|
-
import { CardContent, CardHeader } from '../Card';
|
|
8
5
|
import Icon from '../Icon';
|
|
9
6
|
import Progress from '../Progress';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { StyledChildrenWrap } from './Dialog.styles';
|
|
13
|
-
|
|
14
|
-
const InfoDialog = forwardRef(({ target, heading
|
|
7
|
+
import Flex from '../Flex';
|
|
8
|
+
import SummaryItem from '../SummaryItem';
|
|
9
|
+
import { StyledChildrenWrap, StyledDialogContent, StyledDialogHeader } from './Dialog.styles';
|
|
10
|
+
import { StyledDismissButton, StyledInfoDialog } from './InfoDialog.styles';
|
|
11
|
+
const InfoDialog = forwardRef(({ target, heading: headingProp, children, progress: progressProp, onDismiss, ...restProps }, ref) => {
|
|
15
12
|
const t = useI18n();
|
|
16
13
|
const headingId = useUID();
|
|
17
14
|
const dialogRef = useConsolidatedRef(ref);
|
|
@@ -24,10 +21,10 @@ const InfoDialog = forwardRef(({ target, heading, headingHidden = false, childre
|
|
|
24
21
|
});
|
|
25
22
|
useFocusTrap(dialogRef);
|
|
26
23
|
useEffect(() => {
|
|
27
|
-
if (!
|
|
24
|
+
if (!progressProp) {
|
|
28
25
|
closeButtonRef.current?.focus();
|
|
29
26
|
}
|
|
30
|
-
}, [
|
|
27
|
+
}, [progressProp]);
|
|
31
28
|
useEffect(() => {
|
|
32
29
|
return () => {
|
|
33
30
|
if (document.contains(target)) {
|
|
@@ -35,9 +32,14 @@ const InfoDialog = forwardRef(({ target, heading, headingHidden = false, childre
|
|
|
35
32
|
}
|
|
36
33
|
};
|
|
37
34
|
}, []);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
const heading = headingProp ? (_jsx(Text, { id: headingId, variant: 'h2', children: typeof headingProp === 'string' ? headingProp : headingProp.primary })) : null;
|
|
36
|
+
const progress = (_jsx(Progress, { visible: !!progressProp, focusOnVisible: true, placement: children ? 'local' : 'block', message: typeof progressProp === 'string' ? progressProp : undefined }));
|
|
37
|
+
const dismissButton = (_jsx(StyledDismissButton, { icon: true, variant: 'simple', onClick: () => {
|
|
38
|
+
onDismiss();
|
|
39
|
+
}, label: t('close'), ref: closeButtonRef, children: _jsx(Icon, { name: 'times' }) }));
|
|
40
|
+
return (_jsxs(StyledInfoDialog, { ...restProps, ...(typeof headingProp === 'string'
|
|
41
|
+
? { labelledbyId: headingId }
|
|
42
|
+
: { ariaLabel: headingProp?.primary }), arrow: true, target: target, progress: progressProp, ref: dialogRef, children: [headingProp && heading && (_jsxs(Flex, { container: { alignItems: 'center', justify: 'between', pad: 2 }, item: { shrink: 0 }, as: StyledDialogHeader, children: [typeof headingProp === 'string' ? (heading) : (_jsx(SummaryItem, { primary: heading, secondary: headingProp.secondary ? (_jsx(Text, { variant: 'secondary', children: headingProp.secondary })) : undefined, visual: headingProp.visual })), dismissButton] })), _jsxs(Flex, { container: { direction: 'column' }, item: { grow: 1 }, as: StyledDialogContent, children: [!headingProp && dismissButton, children && _jsx(StyledChildrenWrap, { children: children }), progress] })] }));
|
|
41
43
|
});
|
|
42
44
|
export default InfoDialog;
|
|
43
45
|
//# sourceMappingURL=InfoDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoDialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/InfoDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,EAAM,SAAS,EAAkB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"InfoDialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/InfoDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,EAAM,SAAS,EAAkB,MAAM,OAAO,CAAC;AAE3F,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,YAAY,EACZ,OAAO,EACP,aAAa,EACb,MAAM,EACP,MAAM,aAAa,CAAC;AACrB,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,WAAW,MAAM,gBA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AW,KAAK,QAAQ,CAAC,CAAC,CAAC,CACjC,OAAO,CACR,CAAC,CAAC,CAAC,CACF,KAAC,WAAW,IACV,OAAO,EAAE,OAAO,EAChB,SAAS,EACP,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CACtB,KAAC,IAAI,IAAC,OAAO,EAAC,WAAW,YAAE,WAAW,CAAC,SAAS,GAAQ,CACzD,CAAC,CAAC,CAAC,SAAS,EAEf,MAAM,EAAE,WAAW,CAAC,MAAM,GAC1B,CACH,EACA,aAAa,IACT,CACR,EAED,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,mBAAmB,aACjF,CAAC,WAAW,IAAI,aAAa,EAC7B,QAAQ,IAAI,KAAC,kBAAkB,cAAE,QAAQ,GAAsB,EAC/D,QAAQ,IACJ,IACU,CACpB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { forwardRef, PropsWithoutRef, useRef, FC, useEffect, HTMLAttributes } from 'react';\n\nimport {\n useConsolidatedRef,\n useEscape,\n useFocusTrap,\n useI18n,\n useOuterEvent,\n useUID\n} from '../../hooks';\nimport Text from '../Text';\nimport Icon from '../Icon';\nimport Progress from '../Progress';\nimport Flex from '../Flex';\nimport SummaryItem from '../SummaryItem';\n\nimport { StyledChildrenWrap, StyledDialogContent, StyledDialogHeader } from './Dialog.styles';\nimport { InfoDialogProps } from './Dialog.types';\nimport { StyledDismissButton, StyledInfoDialog } from './InfoDialog.styles';\n\nconst InfoDialog: FC<InfoDialogProps & HTMLAttributes<HTMLDivElement>> = forwardRef(\n (\n {\n target,\n heading: headingProp,\n children,\n progress: progressProp,\n onDismiss,\n ...restProps\n }: PropsWithoutRef<InfoDialogProps>,\n ref: InfoDialogProps['ref']\n ) => {\n const t = useI18n();\n const headingId = useUID();\n const dialogRef = useConsolidatedRef(ref);\n const closeButtonRef = useRef<HTMLButtonElement>(null);\n\n useEscape(() => {\n onDismiss?.();\n });\n\n useOuterEvent('mousedown', [target, dialogRef], () => {\n onDismiss?.();\n });\n\n useFocusTrap(dialogRef);\n\n useEffect(() => {\n if (!progressProp) {\n closeButtonRef.current?.focus();\n }\n }, [progressProp]);\n\n useEffect(() => {\n return () => {\n if (document.contains(target)) {\n target.focus();\n }\n };\n }, []);\n\n const heading = headingProp ? (\n <Text id={headingId} variant='h2'>\n {typeof headingProp === 'string' ? headingProp : headingProp.primary}\n </Text>\n ) : null;\n\n const progress = (\n <Progress\n visible={!!progressProp}\n focusOnVisible\n placement={children ? 'local' : 'block'}\n message={typeof progressProp === 'string' ? progressProp : undefined}\n />\n );\n\n const dismissButton = (\n <StyledDismissButton\n icon\n variant='simple'\n onClick={() => {\n onDismiss();\n }}\n label={t('close')}\n ref={closeButtonRef}\n >\n <Icon name='times' />\n </StyledDismissButton>\n );\n\n return (\n <StyledInfoDialog\n {...restProps}\n {...(typeof headingProp === 'string'\n ? { labelledbyId: headingId }\n : { ariaLabel: headingProp?.primary })}\n arrow\n target={target}\n progress={progressProp}\n ref={dialogRef}\n >\n {headingProp && heading && (\n <Flex\n container={{ alignItems: 'center', justify: 'between', pad: 2 }}\n item={{ shrink: 0 }}\n as={StyledDialogHeader}\n >\n {typeof headingProp === 'string' ? (\n heading\n ) : (\n <SummaryItem\n primary={heading}\n secondary={\n headingProp.secondary ? (\n <Text variant='secondary'>{headingProp.secondary}</Text>\n ) : undefined\n }\n visual={headingProp.visual}\n />\n )}\n {dismissButton}\n </Flex>\n )}\n\n <Flex container={{ direction: 'column' }} item={{ grow: 1 }} as={StyledDialogContent}>\n {!headingProp && dismissButton}\n {children && <StyledChildrenWrap>{children}</StyledChildrenWrap>}\n {progress}\n </Flex>\n </StyledInfoDialog>\n );\n }\n);\n\nexport default InfoDialog;\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const StyledDismissButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Button").ButtonProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
2
|
+
export declare const StyledInfoDialog: import("styled-components").StyledComponent<import("react").FC<import("./Dialog.types").BaseDialogProps & {
|
|
3
|
+
labelledbyId?: string | undefined;
|
|
4
|
+
ariaLabel?: string | undefined;
|
|
5
|
+
} & import("react").HTMLAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
+
//# sourceMappingURL=InfoDialog.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoDialog.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/InfoDialog.styles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,mBAAmB,qMAAmB,CAAC;AAEpD,eAAO,MAAM,gBAAgB;;;yGAS3B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { defaultThemeProp } from '../../theme';
|
|
3
|
+
import Button from '../Button';
|
|
4
|
+
import Dialog from './Dialog';
|
|
5
|
+
import { StyledDialogContent } from './Dialog.styles';
|
|
6
|
+
export const StyledDismissButton = styled(Button) ``;
|
|
7
|
+
export const StyledInfoDialog = styled(Dialog)(({ theme }) => {
|
|
8
|
+
return css `
|
|
9
|
+
/* When a header is not rendered(e.g. progress state) the button must positioned atop. */
|
|
10
|
+
${StyledDialogContent} > ${StyledDismissButton} {
|
|
11
|
+
position: relative;
|
|
12
|
+
z-index: calc(${theme.base['z-index'].backdrop} + 1);
|
|
13
|
+
align-self: end;
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
});
|
|
17
|
+
StyledInfoDialog.defaultProps = defaultThemeProp;
|
|
18
|
+
//# sourceMappingURL=InfoDialog.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoDialog.styles.js","sourceRoot":"","sources":["../../../src/components/Dialog/InfoDialog.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA,EAAE,CAAC;AAEpD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3D,OAAO,GAAG,CAAA;;MAEN,mBAAmB,MAAM,mBAAmB;;sBAE5B,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ;;;GAGjD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport Button from '../Button';\n\nimport Dialog from './Dialog';\nimport { StyledDialogContent } from './Dialog.styles';\n\nexport const StyledDismissButton = styled(Button)``;\n\nexport const StyledInfoDialog = styled(Dialog)(({ theme }) => {\n return css`\n /* When a header is not rendered(e.g. progress state) the button must positioned atop. */\n ${StyledDialogContent} > ${StyledDismissButton} {\n position: relative;\n z-index: calc(${theme.base['z-index'].backdrop} + 1);\n align-self: end;\n }\n `;\n});\n\nStyledInfoDialog.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -230,7 +230,7 @@ const StyledEmojiPicker = styled.div(({ showFooter, theme: { base: { animation:
|
|
|
230
230
|
.emoji-mart-emoji-native {
|
|
231
231
|
/* stylelint-disable font-family-no-missing-generic-family-keyword */
|
|
232
232
|
font-family: 'Segoe UI Emoji', 'Segoe UI Symbol', 'Segoe UI', 'Apple Color Emoji',
|
|
233
|
-
'Twemoji Mozilla', 'Noto Color Emoji', 'Android Emoji'; /*
|
|
233
|
+
'Twemoji Mozilla', 'Noto Color Emoji', 'Android Emoji'; /* cspell:disable-line */
|
|
234
234
|
|
|
235
235
|
/* stylelint-enable font-family-no-missing-generic-family-keyword */
|
|
236
236
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmojiPicker.styles.js","sourceRoot":"","sources":["../../../src/components/EmojiPicker/EmojiPicker.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAClC,CAAC,EACC,UAAU,EACV,KAAK,EAAE,EACL,IAAI,EAAE,EACJ,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAC5B,WAAW,EAAE,QAAQ,EACrB,YAAY,EAAE,SAAS,EACvB,aAAa,EAAE,UAAU,EACzB,aAAa,EAAE,UAAU,EACzB,OAAO,EACP,MAAM,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,EAC9B,OAAO,EACP,eAAe,EAAE,YAAY,EAC7B,YAAY,EACb,EACD,UAAU,EAAE,EACV,cAAc,EAAE,EAAE,eAAe,EAAE,iBAAiB,EAAE,EACvD,EACF,EACF,EAAE,EAAE;IACH,MAAM,UAAU,GAAG,cAAc,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,UAAU,CAAC;IAC5E,MAAM,kBAAkB,GAAG,cAAc,CACvC,CAAC,GAAG,YAAY,CAAC,eAAe,CAAC,EACjC,OAAO,CAAC,kBAAkB,CAAC,C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;;;;;;;;;;KAwBjB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAElD,eAAe,iBAAiB,CAAC","sourcesContent":["import { hideVisually, transparentize } from 'polished';\nimport styled, { css } from 'styled-components';\n\nimport { getHoverColors, calculateFontSize } from '../../styles';\nimport { defaultThemeProp } from '../../theme';\n\nconst StyledEmojiPicker = styled.div<{ showFooter: boolean }>(\n ({\n showFooter,\n theme: {\n base: {\n animation: { speed, timing },\n 'font-size': fontSize,\n 'font-scale': fontScale,\n 'font-family': fontFamily,\n 'font-weight': fontWeight,\n palette,\n shadow: { focus: focusShadow },\n spacing,\n 'border-radius': borderRadius,\n transparency\n },\n components: {\n 'search-input': { 'border-radius': searchInputRadius }\n }\n }\n }) => {\n const hoverColor = getHoverColors(palette['primary-background']).background;\n const secondaryTextColor = transparentize(\n 1 - transparency['transparent-2'],\n palette['foreground-color']\n );\n\n const fontSizes = calculateFontSize(fontSize, fontScale);\n\n return css`\n border-radius: inherit;\n\n /* stylelint-disable no-descending-specificity */\n\n /* stylelint-disable no-duplicate-selectors */\n\n /* stylelint-disable selector-max-class */\n\n .emoji-mart,\n .emoji-mart * {\n box-sizing: border-box;\n line-height: 1.15;\n }\n\n .emoji-mart {\n font-family: ${fontFamily};\n font-size: ${fontSizes.l};\n display: inline-block;\n color: ${palette['foreground-color']};\n border: 0.0625rem solid ${palette['border-line']};\n border-radius: inherit;\n background: ${palette['primary-background']};\n }\n\n .emoji-mart .emoji-mart-emoji {\n padding: calc(0.75 * ${spacing});\n }\n\n .emoji-mart-bar {\n border: 0 solid ${palette['border-line']};\n }\n .emoji-mart-bar:first-child {\n border-bottom-width: 0.0625rem;\n border-top-left-radius: inherit;\n border-top-right-radius: inherit;\n }\n .emoji-mart-bar:last-child {\n border-top-width: 0.0625rem;\n border-bottom-left-radius: inherit;\n border-bottom-right-radius: inherit;\n ${!showFooter &&\n css`\n display: none;\n `}\n }\n\n .emoji-mart-anchors {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding: 0 calc(0.75 * ${spacing});\n line-height: 0;\n }\n\n .emoji-mart-anchor {\n position: relative;\n display: block;\n flex: 1 1 auto;\n color: ${secondaryTextColor};\n text-align: center;\n padding: calc(1.5 * ${spacing}) calc(0.5 * ${spacing});\n overflow: hidden;\n transition: color calc(0.4 * ${speed}) ${timing['ease-out']};\n margin: 0;\n box-shadow: none;\n background: none;\n border: none;\n }\n .emoji-mart-anchor:focus {\n outline: 0;\n }\n .emoji-mart-anchor:hover,\n .emoji-mart-anchor:focus,\n .emoji-mart-anchor-selected {\n color: ${palette.interactive};\n }\n\n .emoji-mart-anchor-selected .emoji-mart-anchor-bar {\n bottom: 0;\n }\n\n .emoji-mart-anchor-bar {\n position: absolute;\n bottom: calc(-0.375 * ${spacing});\n left: 0;\n width: 100%;\n height: calc(0.375 * ${spacing});\n background-color: ${palette.interactive};\n }\n\n .emoji-mart-anchors i {\n display: inline-block;\n width: 100%;\n max-width: calc(2.75 * ${spacing});\n }\n\n .emoji-mart-anchors svg,\n .emoji-mart-anchors img {\n fill: currentColor;\n height: calc(2.25 * ${spacing});\n width: calc(2.25 * ${spacing});\n }\n\n .emoji-mart-scroll {\n overflow-y: scroll;\n overflow-x: hidden;\n height: 16.875rem;\n padding: 0 calc(0.75 * ${spacing});\n will-change: transform; /* avoids \"repaints on scroll\" in mobile Chrome */\n }\n\n .emoji-mart-search {\n padding: ${spacing};\n position: relative;\n }\n\n .emoji-mart-search input {\n font-size: ${fontSizes.l};\n color: ${palette['foreground-color']};\n display: block;\n width: 100%;\n padding: calc(0.625 * ${spacing}) calc(3.125 * ${spacing}) calc(0.75 * ${spacing})\n calc(1.25 * ${spacing});\n border-radius: calc(${borderRadius} * ${searchInputRadius});\n border: 0.0625rem solid ${palette['border-line']};\n background-color: ${palette['primary-background']};\n outline: 0;\n }\n\n .emoji-mart-search input:hover {\n border-color: ${palette['foreground-color']};\n }\n\n .emoji-mart-search input,\n .emoji-mart-search input::-webkit-search-decoration,\n .emoji-mart-search input::-webkit-search-cancel-button,\n .emoji-mart-search input::-webkit-search-results-button,\n .emoji-mart-search input::-webkit-search-results-decoration {\n /*\n remove webkit/blink styles for <input type=\"search\">\n via https://stackoverflow.com/a/9422689\n */\n -webkit-appearance: none;\n }\n\n .emoji-mart-search-icon {\n position: absolute;\n top: calc(1.875 * ${spacing});\n right: calc(2.25 * ${spacing});\n z-index: 2;\n border: none;\n background: none;\n }\n\n .emoji-mart-search-icon svg {\n fill: ${secondaryTextColor};\n }\n\n .emoji-mart-category .emoji-mart-emoji span {\n z-index: 1;\n position: relative;\n text-align: center;\n cursor: default;\n }\n\n .emoji-mart-category .emoji-mart-emoji:hover::before {\n z-index: 0;\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: ${hoverColor};\n border-radius: 100%;\n }\n\n .emoji-mart-category-label {\n z-index: 2;\n top: 0;\n\n /* stylelint-disable declaration-block-no-duplicate-properties */\n position: relative;\n position: -webkit-sticky;\n position: sticky;\n\n /* stylelint-enable declaration-block-no-duplicate-properties */\n }\n\n .emoji-mart-category-label span {\n display: block;\n width: 100%;\n font-weight: ${fontWeight['semi-bold']};\n padding: ${spacing} calc(0.25 * ${spacing});\n background-color: ${transparentize(0.05, palette['primary-background'])};\n }\n\n .emoji-mart-category-list {\n margin: 0;\n padding: calc(0.375 * ${spacing}) 0;\n }\n\n .emoji-mart-category-list li {\n list-style: none;\n margin: 0;\n padding: 0;\n display: inline-block;\n }\n\n .emoji-mart-emoji {\n position: relative;\n display: inline-block;\n font-size: 0;\n margin: 0;\n padding: 0;\n border: none;\n background: none;\n box-shadow: none;\n }\n\n .emoji-mart-emoji-native {\n /* stylelint-disable font-family-no-missing-generic-family-keyword */\n font-family: 'Segoe UI Emoji', 'Segoe UI Symbol', 'Segoe UI', 'Apple Color Emoji',\n 'Twemoji Mozilla', 'Noto Color Emoji', 'Android Emoji'; /* cSpell:disable-line */\n\n /* stylelint-enable font-family-no-missing-generic-family-keyword */\n }\n\n .emoji-mart-category .emoji-mart-emoji:focus,\n .emoji-mart-category .emoji-mart-emoji-native:focus,\n .emoji-mart-skin:focus,\n .emoji-mart-search input:focus {\n outline: 0;\n border-color: transparent;\n box-shadow: ${focusShadow};\n }\n\n .emoji-mart-category .emoji-mart-emoji:focus,\n .emoji-mart-category .emoji-mart-emoji-native:focus {\n border-radius: 100%;\n }\n\n .emoji-mart-no-results {\n font-size: ${fontSizes.s};\n text-align: center;\n padding-top: 4.375rem;\n color: ${secondaryTextColor};\n }\n .emoji-mart-no-results-img {\n display: block;\n margin-left: auto;\n margin-right: auto;\n width: 50%;\n }\n .emoji-mart-no-results .emoji-mart-category-label {\n display: none;\n }\n .emoji-mart-no-results .emoji-mart-no-results-label {\n margin-top: 0.2em;\n }\n .emoji-mart-no-results .emoji-mart-emoji:hover::before {\n content: none;\n }\n\n .emoji-mart-preview {\n position: relative;\n min-height: 2.5rem;\n height: fit-content;\n display: flex;\n flex-direction: row;\n align-items: center;\n }\n\n .emoji-mart-preview-emoji {\n left: calc(1.5 * ${spacing});\n }\n\n .emoji-mart-preview-data {\n left: calc(8.5 * ${spacing});\n right: calc(1.5 * ${spacing});\n word-break: break-all;\n flex: 1;\n }\n\n .emoji-mart-preview-skins {\n position: absolute;\n right: calc(3.75 * ${spacing});\n text-align: right;\n }\n\n .emoji-mart-preview-skins.custom {\n right: calc(1.25 * ${spacing});\n text-align: right;\n }\n\n .emoji-mart-preview-name {\n font-size: ${fontSizes.s};\n }\n\n .emoji-mart-preview-shortname {\n font-size: ${fontSizes.xxs};\n color: ${secondaryTextColor};\n }\n .emoji-mart-preview-shortname + .emoji-mart-preview-shortname,\n .emoji-mart-preview-shortname + .emoji-mart-preview-emoticon,\n .emoji-mart-preview-emoticon + .emoji-mart-preview-emoticon {\n margin-left: 0.5em;\n }\n\n .emoji-mart-preview-emoticon {\n font-size: ${fontSizes.xxs};\n color: ${secondaryTextColor};\n }\n\n .emoji-mart-title span {\n display: inline-block;\n vertical-align: middle;\n }\n\n .emoji-mart-title .emoji-mart-emoji {\n padding: 0;\n }\n\n .emoji-mart-title-label {\n color: ${secondaryTextColor};\n font-size: ${fontSizes.xxl};\n font-weight: ${fontWeight.normal};\n }\n\n .emoji-mart-skin-swatches {\n font-size: 0;\n padding: calc(0.25 * ${spacing}) 0;\n border: 0.0625rem solid ${palette['border-line']};\n border-radius: calc(1.5 * ${spacing});\n background-color: ${palette['secondary-background']};\n }\n\n .emoji-mart-skin-swatches.custom {\n font-size: 0;\n border: none;\n background-color: ${palette['secondary-background']};\n }\n\n .emoji-mart-skin-swatches.opened .emoji-mart-skin-swatch {\n width: calc(2 * ${spacing});\n padding: 0 calc(0.25 * ${spacing});\n }\n\n .emoji-mart-skin-swatches.opened .emoji-mart-skin-swatch.selected::after {\n opacity: ${transparency['transparent-2']};\n }\n\n .emoji-mart-skin-swatch {\n display: inline-block;\n width: 0;\n vertical-align: middle;\n transition-property: width, padding;\n transition-duration: calc(0.5 * ${speed});\n transition-timing-function: ${timing['ease-out']};\n }\n\n .emoji-mart-skin-swatch:nth-child(1) {\n transition-delay: 0s;\n }\n .emoji-mart-skin-swatch:nth-child(2) {\n transition-delay: 0.03s;\n }\n .emoji-mart-skin-swatch:nth-child(3) {\n transition-delay: 0.06s;\n }\n .emoji-mart-skin-swatch:nth-child(4) {\n transition-delay: 0.09s;\n }\n .emoji-mart-skin-swatch:nth-child(5) {\n transition-delay: 0.12s;\n }\n .emoji-mart-skin-swatch:nth-child(6) {\n transition-delay: 0.15s;\n }\n\n .emoji-mart-skin-swatch.selected {\n position: relative;\n width: calc(2 * ${spacing});\n padding: 0 calc(0.25 * ${spacing});\n }\n\n .emoji-mart-skin-swatch.selected::after {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: calc(0.5 * ${spacing});\n height: calc(0.5 * ${spacing});\n margin: calc(-0.25 * ${spacing}) 0 0 calc(-0.25 * ${spacing});\n background-color: ${palette['primary-background']};\n border-radius: 100%;\n pointer-events: none;\n opacity: 0;\n transition: opacity ${speed} ${timing['ease-out']};\n }\n\n .emoji-mart-skin-swatch.custom {\n display: inline-block;\n width: 0;\n height: 2.375rem;\n overflow: hidden;\n vertical-align: middle;\n transition-property: width, height;\n transition-duration: calc(0.5 * ${speed});\n transition-timing-function: ${timing['ease-out']};\n cursor: default;\n }\n\n .emoji-mart-skin-swatch.custom.selected {\n position: relative;\n width: 2.25rem;\n height: 2.375rem;\n padding: 0 calc(0.25 * ${spacing}) 0 0;\n }\n\n .emoji-mart-skin-swatch.custom.selected::after {\n content: '';\n width: 0;\n height: 0;\n }\n\n .emoji-mart-skin-swatches.custom .emoji-mart-skin-swatch.custom:hover {\n background-color: ${palette['primary-background']};\n border-radius: 10%;\n }\n\n .emoji-mart-skin-swatches.custom.opened .emoji-mart-skin-swatch.custom {\n width: 2.25rem;\n height: 2.375rem;\n padding: 0 calc(0.25 * ${spacing}) 0 0;\n }\n\n .emoji-mart-skin-swatches.custom.opened .emoji-mart-skin-swatch.custom.selected::after {\n opacity: ${transparency['transparent-2']};\n }\n\n .emoji-mart-skin-text.opened {\n display: inline-block;\n vertical-align: middle;\n text-align: left;\n color: ${secondaryTextColor};\n font-size: ${fontSizes.xxs};\n padding: calc(0.625 * ${spacing}) calc(0.25 * ${spacing});\n width: 6rem;\n height: 2.5rem;\n border-radius: 10%;\n background-color: ${palette['primary-background']};\n }\n\n .emoji-mart-skin {\n display: inline-block;\n width: 100%;\n padding-top: 100%;\n max-width: calc(1.5 * ${spacing});\n border-radius: 100%;\n }\n\n .emoji-mart-skin-tone-1 {\n background-color: #ffc93a;\n }\n .emoji-mart-skin-tone-2 {\n background-color: #fadcbc;\n }\n .emoji-mart-skin-tone-3 {\n background-color: #e0bb95;\n }\n .emoji-mart-skin-tone-4 {\n background-color: #bf8f68;\n }\n .emoji-mart-skin-tone-5 {\n background-color: #9b643d;\n }\n .emoji-mart-skin-tone-6 {\n background-color: #594539;\n }\n\n /* For screen readers only */\n .emoji-mart-sr-only {\n ${hideVisually}\n }\n\n /*\n https://github.com/missive/emoji-mart/issues/319\n https://github.com/missive/emoji-mart/pull/442\n */\n .emoji-mart-emoji-native {\n height: var(--emoji-size);\n width: var(--emoji-size);\n position: relative;\n display: inline-block;\n box-sizing: content-box;\n vertical-align: bottom;\n }\n\n .emoji-mart-emoji-native > span {\n position: absolute !important;\n top: 50%;\n left: 50%;\n height: initial !important;\n width: initial !important;\n transform: translate(-50%, -50%);\n }\n `;\n }\n);\n\nStyledEmojiPicker.defaultProps = defaultThemeProp;\n\nexport default StyledEmojiPicker;\n"]}
|
|
1
|
+
{"version":3,"file":"EmojiPicker.styles.js","sourceRoot":"","sources":["../../../src/components/EmojiPicker/EmojiPicker.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAClC,CAAC,EACC,UAAU,EACV,KAAK,EAAE,EACL,IAAI,EAAE,EACJ,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAC5B,WAAW,EAAE,QAAQ,EACrB,YAAY,EAAE,SAAS,EACvB,aAAa,EAAE,UAAU,EACzB,aAAa,EAAE,UAAU,EACzB,OAAO,EACP,MAAM,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,EAC9B,OAAO,EACP,eAAe,EAAE,YAAY,EAC7B,YAAY,EACb,EACD,UAAU,EAAE,EACV,cAAc,EAAE,EAAE,eAAe,EAAE,iBAAiB,EAAE,EACvD,EACF,EACF,EAAE,EAAE;IACH,MAAM,UAAU,GAAG,cAAc,CAAC,OAAO,CAAC,oBA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gCACF,OAAO,iBAAiB,OAAO;;;;4BAInC,OAAO,CAAC,oBAAoB,CAAC;;;;;;;gCAOzB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;UAyB7B,YAAY;;;;;;;;;;;;;;;;;;;;;;;;KAwBjB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAElD,eAAe,iBAAiB,CAAC","sourcesContent":["import { hideVisually, transparentize } from 'polished';\nimport styled, { css } from 'styled-components';\n\nimport { getHoverColors, calculateFontSize } from '../../styles';\nimport { defaultThemeProp } from '../../theme';\n\nconst StyledEmojiPicker = styled.div<{ showFooter: boolean }>(\n ({\n showFooter,\n theme: {\n base: {\n animation: { speed, timing },\n 'font-size': fontSize,\n 'font-scale': fontScale,\n 'font-family': fontFamily,\n 'font-weight': fontWeight,\n palette,\n shadow: { focus: focusShadow },\n spacing,\n 'border-radius': borderRadius,\n transparency\n },\n components: {\n 'search-input': { 'border-radius': searchInputRadius }\n }\n }\n }) => {\n const hoverColor = getHoverColors(palette['primary-background']).background;\n const secondaryTextColor = transparentize(\n 1 - transparency['transparent-2'],\n palette['foreground-color']\n );\n\n const fontSizes = calculateFontSize(fontSize, fontScale);\n\n return css`\n border-radius: inherit;\n\n /* stylelint-disable no-descending-specificity */\n\n /* stylelint-disable no-duplicate-selectors */\n\n /* stylelint-disable selector-max-class */\n\n .emoji-mart,\n .emoji-mart * {\n box-sizing: border-box;\n line-height: 1.15;\n }\n\n .emoji-mart {\n font-family: ${fontFamily};\n font-size: ${fontSizes.l};\n display: inline-block;\n color: ${palette['foreground-color']};\n border: 0.0625rem solid ${palette['border-line']};\n border-radius: inherit;\n background: ${palette['primary-background']};\n }\n\n .emoji-mart .emoji-mart-emoji {\n padding: calc(0.75 * ${spacing});\n }\n\n .emoji-mart-bar {\n border: 0 solid ${palette['border-line']};\n }\n .emoji-mart-bar:first-child {\n border-bottom-width: 0.0625rem;\n border-top-left-radius: inherit;\n border-top-right-radius: inherit;\n }\n .emoji-mart-bar:last-child {\n border-top-width: 0.0625rem;\n border-bottom-left-radius: inherit;\n border-bottom-right-radius: inherit;\n ${!showFooter &&\n css`\n display: none;\n `}\n }\n\n .emoji-mart-anchors {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding: 0 calc(0.75 * ${spacing});\n line-height: 0;\n }\n\n .emoji-mart-anchor {\n position: relative;\n display: block;\n flex: 1 1 auto;\n color: ${secondaryTextColor};\n text-align: center;\n padding: calc(1.5 * ${spacing}) calc(0.5 * ${spacing});\n overflow: hidden;\n transition: color calc(0.4 * ${speed}) ${timing['ease-out']};\n margin: 0;\n box-shadow: none;\n background: none;\n border: none;\n }\n .emoji-mart-anchor:focus {\n outline: 0;\n }\n .emoji-mart-anchor:hover,\n .emoji-mart-anchor:focus,\n .emoji-mart-anchor-selected {\n color: ${palette.interactive};\n }\n\n .emoji-mart-anchor-selected .emoji-mart-anchor-bar {\n bottom: 0;\n }\n\n .emoji-mart-anchor-bar {\n position: absolute;\n bottom: calc(-0.375 * ${spacing});\n left: 0;\n width: 100%;\n height: calc(0.375 * ${spacing});\n background-color: ${palette.interactive};\n }\n\n .emoji-mart-anchors i {\n display: inline-block;\n width: 100%;\n max-width: calc(2.75 * ${spacing});\n }\n\n .emoji-mart-anchors svg,\n .emoji-mart-anchors img {\n fill: currentColor;\n height: calc(2.25 * ${spacing});\n width: calc(2.25 * ${spacing});\n }\n\n .emoji-mart-scroll {\n overflow-y: scroll;\n overflow-x: hidden;\n height: 16.875rem;\n padding: 0 calc(0.75 * ${spacing});\n will-change: transform; /* avoids \"repaints on scroll\" in mobile Chrome */\n }\n\n .emoji-mart-search {\n padding: ${spacing};\n position: relative;\n }\n\n .emoji-mart-search input {\n font-size: ${fontSizes.l};\n color: ${palette['foreground-color']};\n display: block;\n width: 100%;\n padding: calc(0.625 * ${spacing}) calc(3.125 * ${spacing}) calc(0.75 * ${spacing})\n calc(1.25 * ${spacing});\n border-radius: calc(${borderRadius} * ${searchInputRadius});\n border: 0.0625rem solid ${palette['border-line']};\n background-color: ${palette['primary-background']};\n outline: 0;\n }\n\n .emoji-mart-search input:hover {\n border-color: ${palette['foreground-color']};\n }\n\n .emoji-mart-search input,\n .emoji-mart-search input::-webkit-search-decoration,\n .emoji-mart-search input::-webkit-search-cancel-button,\n .emoji-mart-search input::-webkit-search-results-button,\n .emoji-mart-search input::-webkit-search-results-decoration {\n /*\n remove webkit/blink styles for <input type=\"search\">\n via https://stackoverflow.com/a/9422689\n */\n -webkit-appearance: none;\n }\n\n .emoji-mart-search-icon {\n position: absolute;\n top: calc(1.875 * ${spacing});\n right: calc(2.25 * ${spacing});\n z-index: 2;\n border: none;\n background: none;\n }\n\n .emoji-mart-search-icon svg {\n fill: ${secondaryTextColor};\n }\n\n .emoji-mart-category .emoji-mart-emoji span {\n z-index: 1;\n position: relative;\n text-align: center;\n cursor: default;\n }\n\n .emoji-mart-category .emoji-mart-emoji:hover::before {\n z-index: 0;\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: ${hoverColor};\n border-radius: 100%;\n }\n\n .emoji-mart-category-label {\n z-index: 2;\n top: 0;\n\n /* stylelint-disable declaration-block-no-duplicate-properties */\n position: relative;\n position: -webkit-sticky;\n position: sticky;\n\n /* stylelint-enable declaration-block-no-duplicate-properties */\n }\n\n .emoji-mart-category-label span {\n display: block;\n width: 100%;\n font-weight: ${fontWeight['semi-bold']};\n padding: ${spacing} calc(0.25 * ${spacing});\n background-color: ${transparentize(0.05, palette['primary-background'])};\n }\n\n .emoji-mart-category-list {\n margin: 0;\n padding: calc(0.375 * ${spacing}) 0;\n }\n\n .emoji-mart-category-list li {\n list-style: none;\n margin: 0;\n padding: 0;\n display: inline-block;\n }\n\n .emoji-mart-emoji {\n position: relative;\n display: inline-block;\n font-size: 0;\n margin: 0;\n padding: 0;\n border: none;\n background: none;\n box-shadow: none;\n }\n\n .emoji-mart-emoji-native {\n /* stylelint-disable font-family-no-missing-generic-family-keyword */\n font-family: 'Segoe UI Emoji', 'Segoe UI Symbol', 'Segoe UI', 'Apple Color Emoji',\n 'Twemoji Mozilla', 'Noto Color Emoji', 'Android Emoji'; /* cspell:disable-line */\n\n /* stylelint-enable font-family-no-missing-generic-family-keyword */\n }\n\n .emoji-mart-category .emoji-mart-emoji:focus,\n .emoji-mart-category .emoji-mart-emoji-native:focus,\n .emoji-mart-skin:focus,\n .emoji-mart-search input:focus {\n outline: 0;\n border-color: transparent;\n box-shadow: ${focusShadow};\n }\n\n .emoji-mart-category .emoji-mart-emoji:focus,\n .emoji-mart-category .emoji-mart-emoji-native:focus {\n border-radius: 100%;\n }\n\n .emoji-mart-no-results {\n font-size: ${fontSizes.s};\n text-align: center;\n padding-top: 4.375rem;\n color: ${secondaryTextColor};\n }\n .emoji-mart-no-results-img {\n display: block;\n margin-left: auto;\n margin-right: auto;\n width: 50%;\n }\n .emoji-mart-no-results .emoji-mart-category-label {\n display: none;\n }\n .emoji-mart-no-results .emoji-mart-no-results-label {\n margin-top: 0.2em;\n }\n .emoji-mart-no-results .emoji-mart-emoji:hover::before {\n content: none;\n }\n\n .emoji-mart-preview {\n position: relative;\n min-height: 2.5rem;\n height: fit-content;\n display: flex;\n flex-direction: row;\n align-items: center;\n }\n\n .emoji-mart-preview-emoji {\n left: calc(1.5 * ${spacing});\n }\n\n .emoji-mart-preview-data {\n left: calc(8.5 * ${spacing});\n right: calc(1.5 * ${spacing});\n word-break: break-all;\n flex: 1;\n }\n\n .emoji-mart-preview-skins {\n position: absolute;\n right: calc(3.75 * ${spacing});\n text-align: right;\n }\n\n .emoji-mart-preview-skins.custom {\n right: calc(1.25 * ${spacing});\n text-align: right;\n }\n\n .emoji-mart-preview-name {\n font-size: ${fontSizes.s};\n }\n\n .emoji-mart-preview-shortname {\n font-size: ${fontSizes.xxs};\n color: ${secondaryTextColor};\n }\n .emoji-mart-preview-shortname + .emoji-mart-preview-shortname,\n .emoji-mart-preview-shortname + .emoji-mart-preview-emoticon,\n .emoji-mart-preview-emoticon + .emoji-mart-preview-emoticon {\n margin-left: 0.5em;\n }\n\n .emoji-mart-preview-emoticon {\n font-size: ${fontSizes.xxs};\n color: ${secondaryTextColor};\n }\n\n .emoji-mart-title span {\n display: inline-block;\n vertical-align: middle;\n }\n\n .emoji-mart-title .emoji-mart-emoji {\n padding: 0;\n }\n\n .emoji-mart-title-label {\n color: ${secondaryTextColor};\n font-size: ${fontSizes.xxl};\n font-weight: ${fontWeight.normal};\n }\n\n .emoji-mart-skin-swatches {\n font-size: 0;\n padding: calc(0.25 * ${spacing}) 0;\n border: 0.0625rem solid ${palette['border-line']};\n border-radius: calc(1.5 * ${spacing});\n background-color: ${palette['secondary-background']};\n }\n\n .emoji-mart-skin-swatches.custom {\n font-size: 0;\n border: none;\n background-color: ${palette['secondary-background']};\n }\n\n .emoji-mart-skin-swatches.opened .emoji-mart-skin-swatch {\n width: calc(2 * ${spacing});\n padding: 0 calc(0.25 * ${spacing});\n }\n\n .emoji-mart-skin-swatches.opened .emoji-mart-skin-swatch.selected::after {\n opacity: ${transparency['transparent-2']};\n }\n\n .emoji-mart-skin-swatch {\n display: inline-block;\n width: 0;\n vertical-align: middle;\n transition-property: width, padding;\n transition-duration: calc(0.5 * ${speed});\n transition-timing-function: ${timing['ease-out']};\n }\n\n .emoji-mart-skin-swatch:nth-child(1) {\n transition-delay: 0s;\n }\n .emoji-mart-skin-swatch:nth-child(2) {\n transition-delay: 0.03s;\n }\n .emoji-mart-skin-swatch:nth-child(3) {\n transition-delay: 0.06s;\n }\n .emoji-mart-skin-swatch:nth-child(4) {\n transition-delay: 0.09s;\n }\n .emoji-mart-skin-swatch:nth-child(5) {\n transition-delay: 0.12s;\n }\n .emoji-mart-skin-swatch:nth-child(6) {\n transition-delay: 0.15s;\n }\n\n .emoji-mart-skin-swatch.selected {\n position: relative;\n width: calc(2 * ${spacing});\n padding: 0 calc(0.25 * ${spacing});\n }\n\n .emoji-mart-skin-swatch.selected::after {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: calc(0.5 * ${spacing});\n height: calc(0.5 * ${spacing});\n margin: calc(-0.25 * ${spacing}) 0 0 calc(-0.25 * ${spacing});\n background-color: ${palette['primary-background']};\n border-radius: 100%;\n pointer-events: none;\n opacity: 0;\n transition: opacity ${speed} ${timing['ease-out']};\n }\n\n .emoji-mart-skin-swatch.custom {\n display: inline-block;\n width: 0;\n height: 2.375rem;\n overflow: hidden;\n vertical-align: middle;\n transition-property: width, height;\n transition-duration: calc(0.5 * ${speed});\n transition-timing-function: ${timing['ease-out']};\n cursor: default;\n }\n\n .emoji-mart-skin-swatch.custom.selected {\n position: relative;\n width: 2.25rem;\n height: 2.375rem;\n padding: 0 calc(0.25 * ${spacing}) 0 0;\n }\n\n .emoji-mart-skin-swatch.custom.selected::after {\n content: '';\n width: 0;\n height: 0;\n }\n\n .emoji-mart-skin-swatches.custom .emoji-mart-skin-swatch.custom:hover {\n background-color: ${palette['primary-background']};\n border-radius: 10%;\n }\n\n .emoji-mart-skin-swatches.custom.opened .emoji-mart-skin-swatch.custom {\n width: 2.25rem;\n height: 2.375rem;\n padding: 0 calc(0.25 * ${spacing}) 0 0;\n }\n\n .emoji-mart-skin-swatches.custom.opened .emoji-mart-skin-swatch.custom.selected::after {\n opacity: ${transparency['transparent-2']};\n }\n\n .emoji-mart-skin-text.opened {\n display: inline-block;\n vertical-align: middle;\n text-align: left;\n color: ${secondaryTextColor};\n font-size: ${fontSizes.xxs};\n padding: calc(0.625 * ${spacing}) calc(0.25 * ${spacing});\n width: 6rem;\n height: 2.5rem;\n border-radius: 10%;\n background-color: ${palette['primary-background']};\n }\n\n .emoji-mart-skin {\n display: inline-block;\n width: 100%;\n padding-top: 100%;\n max-width: calc(1.5 * ${spacing});\n border-radius: 100%;\n }\n\n .emoji-mart-skin-tone-1 {\n background-color: #ffc93a;\n }\n .emoji-mart-skin-tone-2 {\n background-color: #fadcbc;\n }\n .emoji-mart-skin-tone-3 {\n background-color: #e0bb95;\n }\n .emoji-mart-skin-tone-4 {\n background-color: #bf8f68;\n }\n .emoji-mart-skin-tone-5 {\n background-color: #9b643d;\n }\n .emoji-mart-skin-tone-6 {\n background-color: #594539;\n }\n\n /* For screen readers only */\n .emoji-mart-sr-only {\n ${hideVisually}\n }\n\n /*\n https://github.com/missive/emoji-mart/issues/319\n https://github.com/missive/emoji-mart/pull/442\n */\n .emoji-mart-emoji-native {\n height: var(--emoji-size);\n width: var(--emoji-size);\n position: relative;\n display: inline-block;\n box-sizing: content-box;\n vertical-align: bottom;\n }\n\n .emoji-mart-emoji-native > span {\n position: absolute !important;\n top: 50%;\n left: 50%;\n height: initial !important;\n width: initial !important;\n transform: translate(-50%, -50%);\n }\n `;\n }\n);\n\nStyledEmojiPicker.defaultProps = defaultThemeProp;\n\nexport default StyledEmojiPicker;\n"]}
|
|
@@ -85,7 +85,7 @@ const FieldGroup = forwardRef(({ children, description, name, additionalInfo, ac
|
|
|
85
85
|
const [open, setOpen] = useState(!defaultCollapsed);
|
|
86
86
|
const t = useI18n();
|
|
87
87
|
const uid = useUID();
|
|
88
|
-
const descAndChildren = (_jsxs(Grid, { container: { gap: 3 }, children: [description && _jsx(HTML, { id: `${uid}-description`, as: 'p', content: description }), _jsx("div", { children: children })] }));
|
|
88
|
+
const descAndChildren = (_jsxs(Grid, { container: { cols: 'minmax(0, 1fr)', gap: 3 }, children: [description && _jsx(HTML, { id: `${uid}-description`, as: 'p', content: description }), _jsx("div", { children: children })] }));
|
|
89
89
|
return (_jsxs(StyledFieldGroup, { "aria-label": name, "aria-describedby": description ? `${uid}-description` : undefined, ...restProps, ref: ref, children: [name && (_jsx(FieldGroupLegend, { open: open, actions: actions, additionalInfo: additionalInfo, children: collapsible ? (_jsx(StyledExpandButton, { type: 'button', variant: 'text', onClick: () => {
|
|
90
90
|
setOpen(cur => !cur);
|
|
91
91
|
}, "aria-expanded": open ? 'true' : 'false', "aria-label": t(open ? 'collapse_noun' : 'expand_noun', [name]), children: _jsxs(Flex, { container: { direction: 'row', alignItems: 'center', gap: 0.5 }, forwardedAs: 'span', children: [_jsx(Icon, { name: 'caret-right' }), headingTag ? (_jsx(Text, { variant: headingTag, children: name })) : (_jsx(StyledFieldGroupName, { children: name }))] }) })) : (_jsx(_Fragment, { children: headingTag ? (_jsx(Text, { variant: headingTag, children: name })) : (_jsx(StyledFieldGroupName, { children: name })) })) })), collapsible ? (_jsx(ExpandCollapse, { collapsed: !open, children: descAndChildren })) : (descAndChildren)] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldGroup.js","sourceRoot":"","sources":["../../../src/components/FieldGroup/FieldGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAsD,MAAM,OAAO,CAAC;AACjG,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,cAAc,MAAM,gCAAgC,CAAC;AACjE,OAAO,OAAyB,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAY,SAAS,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,cAAuC,MAAM,mBAAmB,CAAC;AAExE,YAAY,CAAC,cAAc,CAAC,CAAC;AAyC7B,MAAM,kBAAkB,GAAG,MAAM,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M,CAAC,CAAC,CAAC,OAAO,gBAC1B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC,YAE7D,MAAC,IAAI,IACH,SAAS,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,EAC/D,WAAW,EAAC,MAAM,aAElB,KAAC,IAAI,IAAC,IAAI,EAAC,aAAa,GAAG,EAC1B,UAAU,CAAC,CAAC,CAAC,CACZ,KAAC,IAAI,IAAC,OAAO,EAAE,UAAU,YAAG,IAAI,GAAQ,CACzC,CAAC,CAAC,CAAC,CACF,KAAC,oBAAoB,cAAE,IAAI,GAAwB,CACpD,IACI,GACY,CACtB,CAAC,CAAC,CAAC,CACF,4BACG,UAAU,CAAC,CAAC,CAAC,CACZ,KAAC,IAAI,IAAC,OAAO,EAAE,UAAU,YAAG,IAAI,GAAQ,CACzC,CAAC,CAAC,CAAC,CACF,KAAC,oBAAoB,cAAE,IAAI,GAAwB,CACpD,GACA,CACJ,GACgB,CACpB,EACA,WAAW,CAAC,CAAC,CAAC,CACb,KAAC,cAAc,IAAC,SAAS,EAAE,CAAC,IAAI,YAAG,eAAe,GAAkB,CACrE,CAAC,CAAC,CAAC,CACF,eAAe,CAChB,IACgB,CACpB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { forwardRef, useState, FunctionComponent, PropsWithoutRef, Ref, ReactNode } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Text from '../Text';\nimport Button from '../Button';\nimport ExpandCollapse from '../ExpandCollapse';\nimport Flex from '../Flex';\nimport Grid from '../Grid';\nimport HTML from '../HTML';\nimport Icon, { StyledIcon, registerIcon } from '../Icon';\nimport * as caretRightIcon from '../Icon/icons/caret-right.icon';\nimport Actions, { ActionsProps } from '../Actions';\nimport { defaultThemeProp } from '../../theme';\nimport { BaseProps, ForwardProps } from '../../types';\nimport { useDirection, useI18n, useUID } from '../../hooks';\nimport { calculateFontSize, FontSize, omitProps } from '../../styles';\nimport AdditionalInfo, { AdditionalInfoProps } from '../AdditionalInfo';\n\nregisterIcon(caretRightIcon);\n\nexport interface FieldGroupProps extends BaseProps {\n /** The content of the Field Group. */\n children: ReactNode;\n /** A description of the field group to be displayed above the controls. */\n description?: string;\n /**\n * If true, the Field Group will be able to collapse the content of its children by clicking on the name.\n * @default false\n */\n collapsible?: boolean;\n /**\n * If true, the Field Group will be collapsed on the first render.\n * @default false\n */\n defaultCollapsed?: boolean;\n /**\n * Select the heading tag for header\n */\n headingTag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n /** The name associated with the Field Group. */\n name?: string;\n /** Provides additional info relevant to the field group. */\n additionalInfo?: {\n heading: AdditionalInfoProps['heading'];\n content: AdditionalInfoProps['children'];\n };\n /** An array of actions to add to the header. */\n actions?: ActionsProps['items'];\n /** A reference to the wrapping element. */\n ref?: Ref<HTMLFieldSetElement>;\n}\n\ninterface FieldGroupLegendProps {\n open: boolean;\n actions?: ActionsProps['items'];\n children?: ReactNode;\n additionalInfo?: FieldGroupProps['additionalInfo'];\n}\n\nconst StyledExpandButton = styled(Button)(\n ({\n theme: {\n base: { animation }\n }\n }) => {\n const { rtl } = useDirection();\n return css`\n ${StyledIcon} {\n transition: transform ${animation.speed} ${animation.timing.ease};\n }\n &[aria-expanded='true'] ${StyledIcon} {\n transform: rotate(90deg);\n }\n &[aria-expanded='false'] ${StyledIcon} {\n transform: rotate(${rtl ? 180 : 0}deg);\n }\n `;\n }\n);\n\nStyledExpandButton.defaultProps = defaultThemeProp;\n\nexport const StyledFieldGroupName = styled.span``;\n\nexport const StyledFieldGroupLegend = styled.legend.withConfig<{ open: boolean }>(\n omitProps('open')\n)(\n ({\n open,\n theme: {\n base: {\n spacing,\n animation,\n 'hit-area': { 'mouse-min': hitAreaMouse, 'finger-min': hitAreaFinger }\n }\n }\n }) => {\n return css`\n width: 100%;\n margin-bottom: 0;\n ${open &&\n css`\n margin-block-end: calc(1.5 * ${spacing});\n `}\n transition: margin-block-end ${animation.speed} ${animation.timing.ease};\n\n > ${StyledExpandButton} {\n min-height: ${hitAreaMouse};\n\n @media (pointer: 'coarse') {\n min-height: ${hitAreaFinger};\n }\n }\n `;\n }\n);\n\nStyledFieldGroupLegend.defaultProps = defaultThemeProp;\n\nexport const StyledFieldGroup = styled.fieldset(\n ({\n theme: {\n base: { 'font-size': fontSize, 'font-scale': fontScale },\n components: { text }\n }\n }) => {\n const fontSizes = calculateFontSize(fontSize, fontScale);\n\n return css`\n border: none;\n\n & ${StyledFieldGroupName} {\n font-size: ${fontSizes[text.h3['font-size'] as FontSize]};\n font-weight: ${text.h3['font-weight']};\n }\n\n & & ${StyledFieldGroupName} {\n font-size: ${fontSizes[text.h4['font-size'] as FontSize]};\n font-weight: ${text.h4['font-weight']};\n }\n\n & & & ${StyledFieldGroupName} {\n font-size: ${fontSizes[text.h5['font-size'] as FontSize]};\n font-weight: ${text.h5['font-weight']};\n }\n\n & & & & ${StyledFieldGroupName} {\n font-size: ${fontSizes[text.h6['font-size'] as FontSize]};\n font-weight: ${text.h6['font-weight']};\n }\n `;\n }\n);\n\nStyledFieldGroup.defaultProps = defaultThemeProp;\n\nconst FieldGroupLegend: FunctionComponent<FieldGroupLegendProps> = ({\n children,\n open,\n actions,\n additionalInfo,\n ...restProps\n}) => {\n return (\n <StyledFieldGroupLegend open={open} {...restProps}>\n <Flex container={{ alignItems: 'center', justify: 'between', gap: 0.5 }}>\n <Flex container={{ alignItems: 'center', gap: 0.5 }}>\n {children}\n {additionalInfo && (\n <AdditionalInfo heading={additionalInfo.heading}>\n {additionalInfo.content}\n </AdditionalInfo>\n )}\n </Flex>\n {actions && <Actions items={actions} />}\n </Flex>\n </StyledFieldGroupLegend>\n );\n};\n\nconst FieldGroup: FunctionComponent<FieldGroupProps & ForwardProps> = forwardRef(\n (\n {\n children,\n description,\n name,\n additionalInfo,\n actions,\n collapsible = false,\n defaultCollapsed = false,\n headingTag,\n ...restProps\n }: PropsWithoutRef<FieldGroupProps>,\n ref: FieldGroupProps['ref']\n ) => {\n const [open, setOpen] = useState(!defaultCollapsed);\n const t = useI18n();\n const uid = useUID();\n\n const descAndChildren = (\n <Grid container={{ gap: 3 }}>\n {description && <HTML id={`${uid}-description`} as='p' content={description} />}\n <div>{children}</div>\n </Grid>\n );\n\n return (\n <StyledFieldGroup\n aria-label={name}\n aria-describedby={description ? `${uid}-description` : undefined}\n {...restProps}\n ref={ref}\n >\n {name && (\n <FieldGroupLegend open={open} actions={actions} additionalInfo={additionalInfo}>\n {collapsible ? (\n <StyledExpandButton\n type='button'\n variant='text'\n onClick={() => {\n setOpen(cur => !cur);\n }}\n aria-expanded={open ? 'true' : 'false'}\n aria-label={t(open ? 'collapse_noun' : 'expand_noun', [name])}\n >\n <Flex\n container={{ direction: 'row', alignItems: 'center', gap: 0.5 }}\n forwardedAs='span'\n >\n <Icon name='caret-right' />\n {headingTag ? (\n <Text variant={headingTag}>{name}</Text>\n ) : (\n <StyledFieldGroupName>{name}</StyledFieldGroupName>\n )}\n </Flex>\n </StyledExpandButton>\n ) : (\n <>\n {headingTag ? (\n <Text variant={headingTag}>{name}</Text>\n ) : (\n <StyledFieldGroupName>{name}</StyledFieldGroupName>\n )}\n </>\n )}\n </FieldGroupLegend>\n )}\n {collapsible ? (\n <ExpandCollapse collapsed={!open}>{descAndChildren}</ExpandCollapse>\n ) : (\n descAndChildren\n )}\n </StyledFieldGroup>\n );\n }\n);\n\nexport default FieldGroup;\n"]}
|
|
1
|
+
{"version":3,"file":"FieldGroup.js","sourceRoot":"","sources":["../../../src/components/FieldGroup/FieldGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAsD,MAAM,OAAO,CAAC;AACjG,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,I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AC,CAAC,CACZ,KAAC,IAAI,IAAC,OAAO,EAAE,UAAU,YAAG,IAAI,GAAQ,CACzC,CAAC,CAAC,CAAC,CACF,KAAC,oBAAoB,cAAE,IAAI,GAAwB,CACpD,GACA,CACJ,GACgB,CACpB,EACA,WAAW,CAAC,CAAC,CAAC,CACb,KAAC,cAAc,IAAC,SAAS,EAAE,CAAC,IAAI,YAAG,eAAe,GAAkB,CACrE,CAAC,CAAC,CAAC,CACF,eAAe,CAChB,IACgB,CACpB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { forwardRef, useState, FunctionComponent, PropsWithoutRef, Ref, ReactNode } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Text from '../Text';\nimport Button from '../Button';\nimport ExpandCollapse from '../ExpandCollapse';\nimport Flex from '../Flex';\nimport Grid from '../Grid';\nimport HTML from '../HTML';\nimport Icon, { StyledIcon, registerIcon } from '../Icon';\nimport * as caretRightIcon from '../Icon/icons/caret-right.icon';\nimport Actions, { ActionsProps } from '../Actions';\nimport { defaultThemeProp } from '../../theme';\nimport { BaseProps, ForwardProps } from '../../types';\nimport { useDirection, useI18n, useUID } from '../../hooks';\nimport { calculateFontSize, FontSize, omitProps } from '../../styles';\nimport AdditionalInfo, { AdditionalInfoProps } from '../AdditionalInfo';\n\nregisterIcon(caretRightIcon);\n\nexport interface FieldGroupProps extends BaseProps {\n /** The content of the Field Group. */\n children: ReactNode;\n /** A description of the field group to be displayed above the controls. */\n description?: string;\n /**\n * If true, the Field Group will be able to collapse the content of its children by clicking on the name.\n * @default false\n */\n collapsible?: boolean;\n /**\n * If true, the Field Group will be collapsed on the first render.\n * @default false\n */\n defaultCollapsed?: boolean;\n /**\n * Select the heading tag for header\n */\n headingTag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n /** The name associated with the Field Group. */\n name?: string;\n /** Provides additional info relevant to the field group. */\n additionalInfo?: {\n heading: AdditionalInfoProps['heading'];\n content: AdditionalInfoProps['children'];\n };\n /** An array of actions to add to the header. */\n actions?: ActionsProps['items'];\n /** A reference to the wrapping element. */\n ref?: Ref<HTMLFieldSetElement>;\n}\n\ninterface FieldGroupLegendProps {\n open: boolean;\n actions?: ActionsProps['items'];\n children?: ReactNode;\n additionalInfo?: FieldGroupProps['additionalInfo'];\n}\n\nconst StyledExpandButton = styled(Button)(\n ({\n theme: {\n base: { animation }\n }\n }) => {\n const { rtl } = useDirection();\n return css`\n ${StyledIcon} {\n transition: transform ${animation.speed} ${animation.timing.ease};\n }\n &[aria-expanded='true'] ${StyledIcon} {\n transform: rotate(90deg);\n }\n &[aria-expanded='false'] ${StyledIcon} {\n transform: rotate(${rtl ? 180 : 0}deg);\n }\n `;\n }\n);\n\nStyledExpandButton.defaultProps = defaultThemeProp;\n\nexport const StyledFieldGroupName = styled.span``;\n\nexport const StyledFieldGroupLegend = styled.legend.withConfig<{ open: boolean }>(\n omitProps('open')\n)(\n ({\n open,\n theme: {\n base: {\n spacing,\n animation,\n 'hit-area': { 'mouse-min': hitAreaMouse, 'finger-min': hitAreaFinger }\n }\n }\n }) => {\n return css`\n width: 100%;\n margin-bottom: 0;\n ${open &&\n css`\n margin-block-end: calc(1.5 * ${spacing});\n `}\n transition: margin-block-end ${animation.speed} ${animation.timing.ease};\n\n > ${StyledExpandButton} {\n min-height: ${hitAreaMouse};\n\n @media (pointer: 'coarse') {\n min-height: ${hitAreaFinger};\n }\n }\n `;\n }\n);\n\nStyledFieldGroupLegend.defaultProps = defaultThemeProp;\n\nexport const StyledFieldGroup = styled.fieldset(\n ({\n theme: {\n base: { 'font-size': fontSize, 'font-scale': fontScale },\n components: { text }\n }\n }) => {\n const fontSizes = calculateFontSize(fontSize, fontScale);\n\n return css`\n border: none;\n\n & ${StyledFieldGroupName} {\n font-size: ${fontSizes[text.h3['font-size'] as FontSize]};\n font-weight: ${text.h3['font-weight']};\n }\n\n & & ${StyledFieldGroupName} {\n font-size: ${fontSizes[text.h4['font-size'] as FontSize]};\n font-weight: ${text.h4['font-weight']};\n }\n\n & & & ${StyledFieldGroupName} {\n font-size: ${fontSizes[text.h5['font-size'] as FontSize]};\n font-weight: ${text.h5['font-weight']};\n }\n\n & & & & ${StyledFieldGroupName} {\n font-size: ${fontSizes[text.h6['font-size'] as FontSize]};\n font-weight: ${text.h6['font-weight']};\n }\n `;\n }\n);\n\nStyledFieldGroup.defaultProps = defaultThemeProp;\n\nconst FieldGroupLegend: FunctionComponent<FieldGroupLegendProps> = ({\n children,\n open,\n actions,\n additionalInfo,\n ...restProps\n}) => {\n return (\n <StyledFieldGroupLegend open={open} {...restProps}>\n <Flex container={{ alignItems: 'center', justify: 'between', gap: 0.5 }}>\n <Flex container={{ alignItems: 'center', gap: 0.5 }}>\n {children}\n {additionalInfo && (\n <AdditionalInfo heading={additionalInfo.heading}>\n {additionalInfo.content}\n </AdditionalInfo>\n )}\n </Flex>\n {actions && <Actions items={actions} />}\n </Flex>\n </StyledFieldGroupLegend>\n );\n};\n\nconst FieldGroup: FunctionComponent<FieldGroupProps & ForwardProps> = forwardRef(\n (\n {\n children,\n description,\n name,\n additionalInfo,\n actions,\n collapsible = false,\n defaultCollapsed = false,\n headingTag,\n ...restProps\n }: PropsWithoutRef<FieldGroupProps>,\n ref: FieldGroupProps['ref']\n ) => {\n const [open, setOpen] = useState(!defaultCollapsed);\n const t = useI18n();\n const uid = useUID();\n\n const descAndChildren = (\n <Grid container={{ cols: 'minmax(0, 1fr)', gap: 3 }}>\n {description && <HTML id={`${uid}-description`} as='p' content={description} />}\n <div>{children}</div>\n </Grid>\n );\n\n return (\n <StyledFieldGroup\n aria-label={name}\n aria-describedby={description ? `${uid}-description` : undefined}\n {...restProps}\n ref={ref}\n >\n {name && (\n <FieldGroupLegend open={open} actions={actions} additionalInfo={additionalInfo}>\n {collapsible ? (\n <StyledExpandButton\n type='button'\n variant='text'\n onClick={() => {\n setOpen(cur => !cur);\n }}\n aria-expanded={open ? 'true' : 'false'}\n aria-label={t(open ? 'collapse_noun' : 'expand_noun', [name])}\n >\n <Flex\n container={{ direction: 'row', alignItems: 'center', gap: 0.5 }}\n forwardedAs='span'\n >\n <Icon name='caret-right' />\n {headingTag ? (\n <Text variant={headingTag}>{name}</Text>\n ) : (\n <StyledFieldGroupName>{name}</StyledFieldGroupName>\n )}\n </Flex>\n </StyledExpandButton>\n ) : (\n <>\n {headingTag ? (\n <Text variant={headingTag}>{name}</Text>\n ) : (\n <StyledFieldGroupName>{name}</StyledFieldGroupName>\n )}\n </>\n )}\n </FieldGroupLegend>\n )}\n {collapsible ? (\n <ExpandCollapse collapsed={!open}>{descAndChildren}</ExpandCollapse>\n ) : (\n descAndChildren\n )}\n </StyledFieldGroup>\n );\n }\n);\n\nexport default FieldGroup;\n"]}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { ReactNode, FunctionComponent } from 'react';
|
|
2
|
-
import { BaseProps, ForwardProps, NoChildrenProp } from '../../types';
|
|
2
|
+
import { BaseProps, ForwardProps, NoChildrenProp, TestIdProp } from '../../types';
|
|
3
3
|
export type FieldValueVariant = 'inline' | 'stacked';
|
|
4
|
-
export interface FieldValueListItemProps {
|
|
5
|
-
id?: string;
|
|
4
|
+
export interface FieldValueListItemProps extends TestIdProp {
|
|
6
5
|
name: string;
|
|
7
6
|
value?: ReactNode;
|
|
8
7
|
variant?: FieldValueVariant;
|
|
9
8
|
}
|
|
10
|
-
export interface
|
|
9
|
+
export interface FieldValueListItem extends FieldValueListItemProps {
|
|
10
|
+
id?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface FieldValueListProps extends BaseProps, NoChildrenProp, TestIdProp {
|
|
11
13
|
/** The set of field values to render in the list. */
|
|
12
|
-
fields:
|
|
14
|
+
fields: FieldValueListItem[];
|
|
13
15
|
/**
|
|
14
16
|
* Determines if the field and values should be displayed on the same line, or stacked with the field above the value.
|
|
15
17
|
* @default "inline"
|
|
@@ -21,7 +23,7 @@ export declare const StyledFieldValue: import("styled-components").StyledCompone
|
|
|
21
23
|
export type StyledFieldValueListProps = Pick<FieldValueListProps, 'variant'>;
|
|
22
24
|
export declare const StyledFieldValueList: import("styled-components").StyledComponent<"dl", import("styled-components").DefaultTheme, StyledFieldValueListProps, never>;
|
|
23
25
|
export declare const StyledStackedFieldValue: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
24
|
-
export declare const FieldValueItem: ({ name, value, variant }: FieldValueListItemProps) => JSX.Element;
|
|
26
|
+
export declare const FieldValueItem: ({ testId, name, value, variant }: FieldValueListItemProps) => JSX.Element;
|
|
25
27
|
declare const FieldValueList: FunctionComponent<FieldValueListProps & ForwardProps>;
|
|
26
28
|
export default FieldValueList;
|
|
27
29
|
//# sourceMappingURL=FieldValueList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldValueList.d.ts","sourceRoot":"","sources":["../../../src/components/FieldValueList/FieldValueList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"FieldValueList.d.ts","sourceRoot":"","sources":["../../../src/components/FieldValueList/FieldValueList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAmB,MAAM,OAAO,CAAC;AAGtE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AASlF,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,SAAS,CAAC;AAErD,MAAM,WAAW,uBAAwB,SAAQ,UAAU;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B;AAED,MAAM,WAAW,kBAAmB,SAAQ,uBAAuB;IACjE,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,mBAAoB,SAAQ,SAAS,EAAE,cAAc,EAAE,UAAU;IAChF,qDAAqD;IACrD,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,GAAG,kBAAkB,CAAC;CAClD;AAED,eAAO,MAAM,eAAe,wGAE3B,CAAC;AAEF,eAAO,MAAM,gBAAgB,wGAE5B,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;AAE7E,eAAO,MAAM,oBAAoB,+HAuB/B,CAAC;AAIH,eAAO,MAAM,uBAAuB,yGAAe,CAAC;AAEpD,eAAO,MAAM,cAAc,qCAKxB,uBAAuB,gBAsBzB,CAAC;AAEF,QAAA,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,GAAG,YAAY,CA+CzE,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
4
|
import Grid from '../Grid';
|
|
5
5
|
import { StyledLabel } from '../Label';
|
|
6
|
-
import { useBreakpoint, useConsolidatedRef } from '../../hooks';
|
|
6
|
+
import { useBreakpoint, useConsolidatedRef, useTestIds } from '../../hooks';
|
|
7
7
|
import { defaultThemeProp } from '../../theme';
|
|
8
8
|
import ShowMoreLess from '../ShowMoreLess';
|
|
9
|
+
import { getFieldValueListTestIds, getFieldValueItemTestIds } from './FieldValueList.test-ids';
|
|
9
10
|
export const StyledFieldName = styled.dt `
|
|
10
11
|
word-break: break-word;
|
|
11
12
|
`;
|
|
@@ -38,19 +39,20 @@ export const StyledFieldValueList = styled.dl(({ variant, theme }) => {
|
|
|
38
39
|
});
|
|
39
40
|
StyledFieldValueList.defaultProps = defaultThemeProp;
|
|
40
41
|
export const StyledStackedFieldValue = styled.div ``;
|
|
41
|
-
export const FieldValueItem = ({ name, value, variant = 'inline' }) => {
|
|
42
|
-
const
|
|
42
|
+
export const FieldValueItem = ({ testId, name, value, variant = 'inline' }) => {
|
|
43
|
+
const testIds = useTestIds(testId, getFieldValueItemTestIds);
|
|
43
44
|
const displayValue = typeof value === 'string' ? _jsx(ShowMoreLess, { lines: 3, children: value }) : value;
|
|
44
|
-
|
|
45
|
+
const labelAndValue = (_jsxs(_Fragment, { children: [_jsx(StyledLabel, { "data-testid": testIds.name, as: StyledFieldName, children: name }), _jsx(StyledFieldValue, { "data-testid": testIds.value, children: value ? displayValue : _jsx("span", { "aria-hidden": 'true', children: "\u2013\u2013" }) })] }));
|
|
46
|
+
return variant === 'stacked' ? (_jsx(StyledStackedFieldValue, { "data-testid": testIds.root, children: labelAndValue })) : (_jsx(_Fragment, { children: labelAndValue }));
|
|
45
47
|
};
|
|
46
|
-
const FieldValueList = forwardRef((
|
|
47
|
-
const
|
|
48
|
+
const FieldValueList = forwardRef(({ testId, fields, variant = 'inline', ...restProps }, ref) => {
|
|
49
|
+
const testIds = useTestIds(testId, getFieldValueListTestIds);
|
|
48
50
|
const fieldValueListRef = useConsolidatedRef(ref);
|
|
49
51
|
const isXSContentWidthOrAbove = useBreakpoint('xs', {
|
|
50
52
|
breakpointRef: fieldValueListRef,
|
|
51
53
|
themeProp: 'content-width'
|
|
52
54
|
});
|
|
53
|
-
return (_jsx(Grid, { ...restProps, ref: fieldValueListRef, container: {
|
|
55
|
+
return (_jsx(Grid, { "data-testid": testIds.root, ...restProps, ref: fieldValueListRef, container: {
|
|
54
56
|
cols: ['inline', 'value-comparison'].includes(variant) && isXSContentWidthOrAbove
|
|
55
57
|
? '16ch minmax(0, 1fr)'
|
|
56
58
|
: 'minmax(0, 1fr)',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldValueList.js","sourceRoot":"","sources":["../../../src/components/FieldValueList/FieldValueList.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"FieldValueList.js","sourceRoot":"","sources":["../../../src/components/FieldValueList/FieldValueList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqC,UAAU,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAwB/F,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,EAAE,CAAA;;CAEvC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,EAAE,CAAA;;CAExC,CAAC;AAIF,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,EAAE,CAA4B,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9F,OAAO,GAAG,CAAA;;;MAGN,OAAO,KAAK,kBAAkB;QAChC,GAAG,CAAA;;;;;;yCAMkC,KAAK,CAAC,IAAI,CAAC,OAAO;;QAEnD,WAAW;;;;;yCAKsB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;qCACrC,KAAK,CAAC,IAAI,CAAC,OAAO;;KAElD;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,oBAAoB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAErD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAEpD,MAAM,CA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SAAS,EACb,GAAG,EAAE,iBAAiB,EACtB,SAAS,EAAE;YACT,IAAI,EACF,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,uBAAuB;gBACzE,CAAC,CAAC,qBAAqB;gBACvB,CAAC,CAAC,gBAAgB;YACtB,MAAM,EAAE,OAAO,KAAK,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC9C,MAAM,EAAE,OAAO,KAAK,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;SACjD,EACD,EAAE,EAAE,oBAAoB,EACxB,OAAO,EAAE,OAAO,YAEf,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE;YACzD,OAAO,CACL,KAAC,cAAc,IACb,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,OAAO,EACL,CAAC,YAAY,IAAI,OAAO,CAAC,KAAK,SAAS,IAAI,CAAC,uBAAuB;oBACjE,CAAC,CAAC,SAAS;oBACX,CAAC,CAAC,QAAQ,IAET,EAAE,IAAI,IAAI,CACf,CACH,CAAC;QACJ,CAAC,CAAC,GACG,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { ReactNode, FunctionComponent, Ref, forwardRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { BaseProps, ForwardProps, NoChildrenProp, TestIdProp } from '../../types';\nimport Grid from '../Grid';\nimport { StyledLabel } from '../Label';\nimport { useBreakpoint, useConsolidatedRef, useTestIds } from '../../hooks';\nimport { defaultThemeProp } from '../../theme';\nimport ShowMoreLess from '../ShowMoreLess';\n\nimport { getFieldValueListTestIds, getFieldValueItemTestIds } from './FieldValueList.test-ids';\n\nexport type FieldValueVariant = 'inline' | 'stacked';\n\nexport interface FieldValueListItemProps extends TestIdProp {\n name: string;\n value?: ReactNode;\n variant?: FieldValueVariant;\n}\n\nexport interface FieldValueListItem extends FieldValueListItemProps {\n id?: string;\n}\n\nexport interface FieldValueListProps extends BaseProps, NoChildrenProp, TestIdProp {\n /** The set of field values to render in the list. */\n fields: FieldValueListItem[];\n /**\n * Determines if the field and values should be displayed on the same line, or stacked with the field above the value.\n * @default \"inline\"\n */\n variant?: FieldValueVariant | 'value-comparison';\n}\n\nexport const StyledFieldName = styled.dt`\n word-break: break-word;\n`;\n\nexport const StyledFieldValue = styled.dd`\n word-break: break-word;\n`;\n\nexport type StyledFieldValueListProps = Pick<FieldValueListProps, 'variant'>;\n\nexport const StyledFieldValueList = styled.dl<StyledFieldValueListProps>(({ variant, theme }) => {\n return css`\n width: 100%;\n\n ${variant === 'value-comparison' &&\n css`\n dt {\n width: 100%;\n }\n dd {\n text-align: end;\n padding-inline-start: calc(2 * ${theme.base.spacing});\n }\n ${StyledLabel} {\n max-width: unset;\n }\n dd:not(:last-of-type),\n dt:not(:last-of-type) {\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n padding-bottom: calc(0.5 * ${theme.base.spacing});\n }\n `}\n `;\n});\n\nStyledFieldValueList.defaultProps = defaultThemeProp;\n\nexport const StyledStackedFieldValue = styled.div``;\n\nexport const FieldValueItem = ({\n testId,\n name,\n value,\n variant = 'inline'\n}: FieldValueListItemProps) => {\n const testIds = useTestIds(testId, getFieldValueItemTestIds);\n\n const displayValue =\n typeof value === 'string' ? <ShowMoreLess lines={3}>{value}</ShowMoreLess> : value;\n\n const labelAndValue = (\n <>\n <StyledLabel data-testid={testIds.name} as={StyledFieldName}>\n {name}\n </StyledLabel>\n <StyledFieldValue data-testid={testIds.value}>\n {value ? displayValue : <span aria-hidden='true'>––</span>}\n </StyledFieldValue>\n </>\n );\n\n return variant === 'stacked' ? (\n <StyledStackedFieldValue data-testid={testIds.root}>{labelAndValue}</StyledStackedFieldValue>\n ) : (\n <>{labelAndValue}</>\n );\n};\n\nconst FieldValueList: FunctionComponent<FieldValueListProps & ForwardProps> = forwardRef(\n (\n { testId, fields, variant = 'inline', ...restProps }: FieldValueListProps,\n ref: Ref<HTMLDivElement>\n ) => {\n const testIds = useTestIds(testId, getFieldValueListTestIds);\n\n const fieldValueListRef = useConsolidatedRef<HTMLDivElement>(ref);\n\n const isXSContentWidthOrAbove = useBreakpoint('xs', {\n breakpointRef: fieldValueListRef,\n themeProp: 'content-width'\n });\n\n return (\n <Grid\n data-testid={testIds.root}\n {...restProps}\n ref={fieldValueListRef}\n container={{\n cols:\n ['inline', 'value-comparison'].includes(variant) && isXSContentWidthOrAbove\n ? '16ch minmax(0, 1fr)'\n : 'minmax(0, 1fr)',\n colGap: variant !== 'value-comparison' ? 2 : 0,\n rowGap: variant !== 'value-comparison' ? 1 : 0.5\n }}\n as={StyledFieldValueList}\n variant={variant}\n >\n {fields.map(({ id, name, value, variant: fieldVariant }) => {\n return (\n <FieldValueItem\n name={name}\n value={value}\n variant={\n (fieldVariant ?? variant) === 'stacked' || !isXSContentWidthOrAbove\n ? 'stacked'\n : 'inline'\n }\n key={id ?? name}\n />\n );\n })}\n </Grid>\n );\n }\n);\n\nexport default FieldValueList;\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const getFieldValueListTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly []>;
|
|
2
|
+
export declare const getFieldValueItemTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly ["name", "value"]>;
|
|
3
|
+
//# sourceMappingURL=FieldValueList.test-ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldValueList.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/FieldValueList/FieldValueList.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB,iFAAiD,CAAC;AAEvF,eAAO,MAAM,wBAAwB,gGAG1B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createTestIds } from '../../utils';
|
|
2
|
+
export const getFieldValueListTestIds = createTestIds('field-value-list', []);
|
|
3
|
+
export const getFieldValueItemTestIds = createTestIds('field-value-item', [
|
|
4
|
+
'name',
|
|
5
|
+
'value'
|
|
6
|
+
]);
|
|
7
|
+
//# sourceMappingURL=FieldValueList.test-ids.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldValueList.test-ids.js","sourceRoot":"","sources":["../../../src/components/FieldValueList/FieldValueList.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,CAAC,MAAM,wBAAwB,GAAG,aAAa,CAAC,kBAAkB,EAAE,EAAW,CAAC,CAAC;AAEvF,MAAM,CAAC,MAAM,wBAAwB,GAAG,aAAa,CAAC,kBAAkB,EAAE;IACxE,MAAM;IACN,OAAO;CACC,CAAC,CAAC","sourcesContent":["import { createTestIds } from '../../utils';\n\nexport const getFieldValueListTestIds = createTestIds('field-value-list', [] as const);\n\nexport const getFieldValueItemTestIds = createTestIds('field-value-item', [\n 'name',\n 'value'\n] as const);\n"]}
|