@pega/cosmos-react-core 2.0.0-dev.11.0 → 2.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 +3 -3
- package/lib/components/Actions/Actions.js +1 -1
- package/lib/components/Actions/Actions.js.map +1 -1
- package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.js +1 -6
- package/lib/components/AppShell/AppHeader.js.map +1 -1
- package/lib/components/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js +14 -32
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts +3 -2
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +36 -24
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/AppShellList.js +10 -13
- package/lib/components/AppShell/AppShellList.js.map +1 -1
- package/lib/components/AppShell/Drawer.js +3 -6
- package/lib/components/AppShell/Drawer.js.map +1 -1
- package/lib/components/AppShell/Operator.js +1 -3
- package/lib/components/AppShell/Operator.js.map +1 -1
- package/lib/components/AppShell/SkipNavigation.js +2 -2
- package/lib/components/AppShell/SkipNavigation.js.map +1 -1
- package/lib/components/Avatar/Avatar.js +3 -4
- package/lib/components/Avatar/Avatar.js.map +1 -1
- package/lib/components/Backdrop/Backdrop.d.ts +1 -1
- package/lib/components/Backdrop/Backdrop.d.ts.map +1 -1
- package/lib/components/Backdrop/Backdrop.js +6 -5
- package/lib/components/Backdrop/Backdrop.js.map +1 -1
- package/lib/components/Badges/Selection.js +7 -8
- package/lib/components/Badges/Selection.js.map +1 -1
- package/lib/components/Banner/Banner.js +2 -6
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Boolean/BooleanDisplay.js +1 -2
- package/lib/components/Boolean/BooleanDisplay.js.map +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.js +2 -5
- package/lib/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/lib/components/Button/Button.d.ts +5 -0
- package/lib/components/Button/Button.d.ts.map +1 -1
- package/lib/components/Button/Button.js +16 -9
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Card/Card.d.ts.map +1 -1
- package/lib/components/Card/Card.js +2 -1
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/Card/CardContent.d.ts.map +1 -1
- package/lib/components/Card/CardContent.js +4 -3
- package/lib/components/Card/CardContent.js.map +1 -1
- package/lib/components/Card/CardFooter.d.ts.map +1 -1
- package/lib/components/Card/CardFooter.js +3 -2
- package/lib/components/Card/CardFooter.js.map +1 -1
- package/lib/components/Card/CardHeader.d.ts.map +1 -1
- package/lib/components/Card/CardHeader.js +5 -5
- package/lib/components/Card/CardHeader.js.map +1 -1
- package/lib/components/Card/CollapsibleCard.js +2 -6
- package/lib/components/Card/CollapsibleCard.js.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.js +6 -9
- package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.js +14 -20
- package/lib/components/ComboBox/ComboBox.js.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +11 -19
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js +3 -3
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js.map +1 -1
- package/lib/components/Configuration/Configuration.js +8 -10
- package/lib/components/Configuration/Configuration.js.map +1 -1
- package/lib/components/Currency/CurrencyInput.js +2 -2
- package/lib/components/Currency/CurrencyInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +18 -23
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.js +10 -16
- package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +27 -37
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DayOfWeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DayOfWeekInput.js +6 -4
- package/lib/components/DateTime/Input/DayOfWeekInput.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.js +2 -2
- package/lib/components/DateTime/Input/Duration/DurationInput.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/NumberUnit.js +3 -4
- package/lib/components/DateTime/Input/Duration/NumberUnit.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/Time.js +7 -10
- package/lib/components/DateTime/Input/Duration/Time.js.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.js +9 -13
- package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
- package/lib/components/DateTime/Input/PartInput.js +2 -3
- package/lib/components/DateTime/Input/PartInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.js +16 -23
- 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 +16 -20
- package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
- package/lib/components/DateTime/Input/useAutoFocusNextInput.js +4 -7
- package/lib/components/DateTime/Input/useAutoFocusNextInput.js.map +1 -1
- package/lib/components/DateTime/Input/usePickerButton.js +4 -4
- package/lib/components/DateTime/Input/usePickerButton.js.map +1 -1
- package/lib/components/DateTime/Input/utils.d.ts +2 -0
- package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Input/utils.js +38 -10
- package/lib/components/DateTime/Input/utils.js.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.js +24 -30
- package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.styles.d.ts +2 -2
- package/lib/components/DateTime/Picker/Calendar.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.styles.js +2 -2
- package/lib/components/DateTime/Picker/Calendar.styles.js.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.js +5 -10
- package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/DateRangePicker.js +5 -10
- package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.js +5 -6
- package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/Weeks.js +7 -9
- package/lib/components/DateTime/Picker/Weeks.js.map +1 -1
- package/lib/components/Drawer/Drawer.js +5 -5
- package/lib/components/Drawer/Drawer.js.map +1 -1
- package/lib/components/EmojiPicker/EmojiDisplay.d.ts.map +1 -1
- package/lib/components/EmojiPicker/EmojiDisplay.js +1 -1
- package/lib/components/EmojiPicker/EmojiDisplay.js.map +1 -1
- package/lib/components/EmojiPicker/EmojiPicker.js +2 -3
- package/lib/components/EmojiPicker/EmojiPicker.js.map +1 -1
- package/lib/components/EmptyState/EmptyState.d.ts +14 -0
- package/lib/components/EmptyState/EmptyState.d.ts.map +1 -0
- package/lib/components/{NoItems/NoItems.js → EmptyState/EmptyState.js} +6 -7
- package/lib/components/EmptyState/EmptyState.js.map +1 -0
- package/lib/components/EmptyState/index.d.ts +4 -0
- package/lib/components/EmptyState/index.d.ts.map +1 -0
- package/lib/components/EmptyState/index.js +3 -0
- package/lib/components/EmptyState/index.js.map +1 -0
- package/lib/components/ErrorState/ErrorState.d.ts +2 -0
- package/lib/components/ErrorState/ErrorState.d.ts.map +1 -1
- package/lib/components/ErrorState/ErrorState.js +3 -3
- package/lib/components/ErrorState/ErrorState.js.map +1 -1
- package/lib/components/ExpandCollapse/ExpandCollapse.js +4 -4
- package/lib/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.js +2 -5
- package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.js +1 -2
- package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.js +2 -4
- package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/File/FileDisplay.d.ts +4 -1
- package/lib/components/File/FileDisplay.d.ts.map +1 -1
- package/lib/components/File/FileDisplay.js.map +1 -1
- package/lib/components/File/FileInput.d.ts +1 -1
- package/lib/components/File/FileInput.d.ts.map +1 -1
- package/lib/components/File/FileInput.js +7 -12
- package/lib/components/File/FileInput.js.map +1 -1
- package/lib/components/File/FileItem.js +2 -3
- package/lib/components/File/FileItem.js.map +1 -1
- package/lib/components/File/FileUploadItem.js +3 -3
- package/lib/components/File/FileUploadItem.js.map +1 -1
- package/lib/components/File/FileVisual.js +2 -4
- package/lib/components/File/FileVisual.js.map +1 -1
- package/lib/components/File/utils.js +1 -2
- package/lib/components/File/utils.js.map +1 -1
- package/lib/components/Flex/Flex.d.ts +2 -2
- package/lib/components/Flex/Flex.d.ts.map +1 -1
- package/lib/components/Flex/Flex.js.map +1 -1
- package/lib/components/Form/Form.js +1 -3
- package/lib/components/Form/Form.js.map +1 -1
- package/lib/components/FormControl/FormControl.d.ts +1 -1
- package/lib/components/FormControl/FormControl.d.ts.map +1 -1
- package/lib/components/FormField/FormField.js +5 -10
- package/lib/components/FormField/FormField.js.map +1 -1
- package/lib/components/Grid/Grid.d.ts +1 -1
- package/lib/components/Grid/Grid.d.ts.map +1 -1
- package/lib/components/Grid/Grid.js +5 -8
- package/lib/components/Grid/Grid.js.map +1 -1
- package/lib/components/Icon/Icon.js +2 -4
- package/lib/components/Icon/Icon.js.map +1 -1
- package/lib/components/Icon/icons/compass-solid.icon.js +1 -2
- package/lib/components/Icon/icons/compass-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/dataviz-table-with-bars.icon.js +1 -4
- package/lib/components/Icon/icons/dataviz-table-with-bars.icon.js.map +1 -1
- package/lib/components/Icon/icons/dataviz-table-with-cross.icon.js +1 -2
- package/lib/components/Icon/icons/dataviz-table-with-cross.icon.js.map +1 -1
- package/lib/components/Icon/icons/dataviz-waterfall.icon.js +1 -5
- package/lib/components/Icon/icons/dataviz-waterfall.icon.js.map +1 -1
- package/lib/components/Icon/icons/filetype-text.icon.js +1 -4
- package/lib/components/Icon/icons/filetype-text.icon.js.map +1 -1
- package/lib/components/Icon/icons/folder-dollar.icon.js +1 -2
- package/lib/components/Icon/icons/folder-dollar.icon.js.map +1 -1
- package/lib/components/Icon/icons/freeze-column.icon.js +1 -2
- package/lib/components/Icon/icons/freeze-column.icon.js.map +1 -1
- package/lib/components/Icon/icons/galaxy.icon.js +1 -3
- package/lib/components/Icon/icons/galaxy.icon.js.map +1 -1
- package/lib/components/Icon/icons/grad-solid.icon.js +1 -2
- package/lib/components/Icon/icons/grad-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/grad.icon.js +1 -5
- package/lib/components/Icon/icons/grad.icon.js.map +1 -1
- package/lib/components/Icon/icons/list-number.icon.js +1 -6
- package/lib/components/Icon/icons/list-number.icon.js.map +1 -1
- package/lib/components/Icon/icons/list.icon.js +1 -6
- package/lib/components/Icon/icons/list.icon.js.map +1 -1
- package/lib/components/Icon/icons/pin.icon.js +1 -2
- package/lib/components/Icon/icons/pin.icon.js.map +1 -1
- package/lib/components/Icon/icons/search-solid.icon.js +1 -2
- package/lib/components/Icon/icons/search-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/tracer.icon.js +1 -2
- package/lib/components/Icon/icons/tracer.icon.js.map +1 -1
- package/lib/components/Icon/icons/tribox-solid.icon.js +1 -3
- package/lib/components/Icon/icons/tribox-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/tribox.icon.js +1 -3
- package/lib/components/Icon/icons/tribox.icon.js.map +1 -1
- package/lib/components/Input/Input.js +2 -2
- package/lib/components/Input/Input.js.map +1 -1
- package/lib/components/Input/Input.styles.js +2 -2
- package/lib/components/Input/Input.styles.js.map +1 -1
- package/lib/components/Link/Link.js +5 -8
- package/lib/components/Link/Link.js.map +1 -1
- package/lib/components/Location/CurrentLocationButton.js +4 -6
- package/lib/components/Location/CurrentLocationButton.js.map +1 -1
- package/lib/components/Location/LocationDisplay.js +2 -3
- package/lib/components/Location/LocationDisplay.js.map +1 -1
- package/lib/components/Location/LocationInput.js +8 -9
- package/lib/components/Location/LocationInput.js.map +1 -1
- package/lib/components/Location/LocationView.js +8 -13
- package/lib/components/Location/LocationView.js.map +1 -1
- package/lib/components/Location/utils.js +11 -15
- package/lib/components/Location/utils.js.map +1 -1
- package/lib/components/Menu/FlyoutMenuList.d.ts.map +1 -1
- package/lib/components/Menu/FlyoutMenuList.js +11 -14
- package/lib/components/Menu/FlyoutMenuList.js.map +1 -1
- package/lib/components/Menu/Menu.js +18 -20
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/Menu.styles.d.ts +10 -0
- package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
- package/lib/components/Menu/Menu.styles.js +198 -3
- package/lib/components/Menu/Menu.styles.js.map +1 -1
- package/lib/components/Menu/Menu.types.d.ts +17 -8
- package/lib/components/Menu/Menu.types.d.ts.map +1 -1
- package/lib/components/Menu/Menu.types.js.map +1 -1
- package/lib/components/Menu/MenuGroup.d.ts +6 -0
- package/lib/components/Menu/MenuGroup.d.ts.map +1 -0
- package/lib/components/Menu/MenuGroup.js +17 -0
- package/lib/components/Menu/MenuGroup.js.map +1 -0
- package/lib/components/Menu/MenuItem.d.ts +0 -3
- package/lib/components/Menu/MenuItem.d.ts.map +1 -1
- package/lib/components/Menu/MenuItem.js +35 -151
- 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 +19 -23
- package/lib/components/Menu/MenuList.js.map +1 -1
- package/lib/components/Menu/MenuListHeader.d.ts +0 -1
- package/lib/components/Menu/MenuListHeader.d.ts.map +1 -1
- package/lib/components/Menu/MenuListHeader.js +5 -55
- package/lib/components/Menu/MenuListHeader.js.map +1 -1
- package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
- package/lib/components/Menu/NavItemsList.js +2 -3
- package/lib/components/Menu/NavItemsList.js.map +1 -1
- package/lib/components/Menu/helpers.d.ts +13 -12
- package/lib/components/Menu/helpers.d.ts.map +1 -1
- package/lib/components/Menu/helpers.js +40 -36
- package/lib/components/Menu/helpers.js.map +1 -1
- package/lib/components/Menu/index.d.ts +2 -3
- package/lib/components/Menu/index.d.ts.map +1 -1
- package/lib/components/Menu/index.js +1 -2
- package/lib/components/Menu/index.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +6 -10
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/Modal/MinimizedModal.js +10 -13
- package/lib/components/Modal/MinimizedModal.js.map +1 -1
- package/lib/components/Modal/Modal.d.ts +1 -6
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Modal/Modal.js +40 -137
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/Modal/Modal.styles.d.ts +9 -0
- package/lib/components/Modal/Modal.styles.d.ts.map +1 -0
- package/lib/components/Modal/Modal.styles.js +133 -0
- package/lib/components/Modal/Modal.styles.js.map +1 -0
- package/lib/components/Modal/Modal.types.d.ts +19 -4
- package/lib/components/Modal/Modal.types.d.ts.map +1 -1
- package/lib/components/Modal/Modal.types.js.map +1 -1
- package/lib/components/Modal/ModalManager.js +12 -21
- package/lib/components/Modal/ModalManager.js.map +1 -1
- package/lib/components/MultiStep/MultiStep.js +3 -6
- package/lib/components/MultiStep/MultiStep.js.map +1 -1
- package/lib/components/MultiStep/MultiStep.styles.js +1 -1
- package/lib/components/MultiStep/MultiStep.styles.js.map +1 -1
- package/lib/components/Number/NumberInput.js +13 -19
- package/lib/components/Number/NumberInput.js.map +1 -1
- package/lib/components/Number/NumberInput.styles.d.ts +2 -2
- package/lib/components/Number/NumberInput.styles.d.ts.map +1 -1
- package/lib/components/Number/utils.js +2 -3
- package/lib/components/Number/utils.js.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.d.ts +1 -1
- package/lib/components/PageTemplates/CategorySubPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.js +6 -16
- package/lib/components/PageTemplates/CategorySubPage.js.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.js +3 -8
- package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.d.ts +2 -0
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js +22 -32
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/Pagination/Pagination.js +2 -4
- package/lib/components/Pagination/Pagination.js.map +1 -1
- package/lib/components/Phone/PhoneDisplay.js +1 -2
- package/lib/components/Phone/PhoneDisplay.js.map +1 -1
- package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
- package/lib/components/Phone/PhoneInput.js +12 -10
- package/lib/components/Phone/PhoneInput.js.map +1 -1
- package/lib/components/Phone/utils.js +2 -3
- package/lib/components/Phone/utils.js.map +1 -1
- package/lib/components/Popover/Popover.js +4 -7
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Progress/Bar.js +1 -1
- package/lib/components/Progress/Bar.js.map +1 -1
- package/lib/components/Progress/Ellipsis.js +1 -3
- package/lib/components/Progress/Ellipsis.js.map +1 -1
- package/lib/components/Progress/Progress.js +2 -3
- package/lib/components/Progress/Progress.js.map +1 -1
- package/lib/components/Progress/Ring.js +2 -3
- package/lib/components/Progress/Ring.js.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.js +6 -7
- package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.js +7 -6
- package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
- package/lib/components/Rating/Rating.js +2 -6
- package/lib/components/Rating/Rating.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.js +10 -12
- package/lib/components/SearchInput/SearchInput.js.map +1 -1
- package/lib/components/Select/Select.js +2 -2
- package/lib/components/Select/Select.js.map +1 -1
- package/lib/components/Sentiment/Sentiment.js +1 -2
- package/lib/components/Sentiment/Sentiment.js.map +1 -1
- package/lib/components/Slider/Slider.js +7 -13
- package/lib/components/Slider/Slider.js.map +1 -1
- package/lib/components/Slider/Slider.styles.d.ts +1 -1
- package/lib/components/Slider/Slider.styles.js +1 -1
- package/lib/components/Slider/Slider.styles.js.map +1 -1
- package/lib/components/Slider/SliderTicks.js +1 -2
- package/lib/components/Slider/SliderTicks.js.map +1 -1
- package/lib/components/Slider/utils.d.ts +0 -10
- package/lib/components/Slider/utils.d.ts.map +1 -1
- package/lib/components/Slider/utils.js +3 -15
- package/lib/components/Slider/utils.js.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.js +1 -4
- package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
- package/lib/components/SummaryList/SummaryList.d.ts +8 -2
- package/lib/components/SummaryList/SummaryList.d.ts.map +1 -1
- package/lib/components/SummaryList/SummaryList.js +9 -10
- package/lib/components/SummaryList/SummaryList.js.map +1 -1
- package/lib/components/SummaryList/ViewAll.d.ts +1 -1
- package/lib/components/SummaryList/ViewAll.d.ts.map +1 -1
- package/lib/components/SummaryList/ViewAll.js +7 -10
- package/lib/components/SummaryList/ViewAll.js.map +1 -1
- package/lib/components/Switch/Switch.d.ts.map +1 -1
- package/lib/components/Switch/Switch.js +39 -30
- package/lib/components/Switch/Switch.js.map +1 -1
- package/lib/components/Table/Table.js +3 -7
- package/lib/components/Table/Table.js.map +1 -1
- package/lib/components/Tabs/Tab.js +3 -6
- package/lib/components/Tabs/Tab.js.map +1 -1
- package/lib/components/Tabs/TabPanel.d.ts +10 -2
- package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
- package/lib/components/Tabs/TabPanel.js +21 -8
- package/lib/components/Tabs/TabPanel.js.map +1 -1
- package/lib/components/Tabs/Tabs.js +7 -8
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/components/Text/Text.d.ts +1 -1
- package/lib/components/Text/Text.d.ts.map +1 -1
- package/lib/components/Text/Text.js +1 -1
- package/lib/components/Text/Text.js.map +1 -1
- package/lib/components/TextArea/TextArea.js +3 -3
- package/lib/components/TextArea/TextArea.js.map +1 -1
- package/lib/components/Toaster/Toaster.js +6 -10
- package/lib/components/Toaster/Toaster.js.map +1 -1
- package/lib/components/Tree/StandardTree.d.ts.map +1 -1
- package/lib/components/Tree/StandardTree.js +10 -17
- package/lib/components/Tree/StandardTree.js.map +1 -1
- package/lib/components/Tree/StandardTree.styles.d.ts +1 -1
- package/lib/components/Tree/StandardTree.styles.d.ts.map +1 -1
- package/lib/components/Tree/StandardTree.styles.js +16 -11
- package/lib/components/Tree/StandardTree.styles.js.map +1 -1
- package/lib/components/Tree/Tree.d.ts +6 -0
- package/lib/components/Tree/Tree.d.ts.map +1 -1
- package/lib/components/Tree/Tree.js +3 -3
- package/lib/components/Tree/Tree.js.map +1 -1
- package/lib/components/Tree/helpers.js +4 -7
- package/lib/components/Tree/helpers.js.map +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.d.ts.map +1 -1
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useActiveDescendant.d.ts.map +1 -1
- package/lib/hooks/useActiveDescendant.js +28 -32
- package/lib/hooks/useActiveDescendant.js.map +1 -1
- package/lib/hooks/useBreakpoint.js +2 -4
- package/lib/hooks/useBreakpoint.js.map +1 -1
- package/lib/hooks/useFocusWithin.js +9 -9
- package/lib/hooks/useFocusWithin.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +57 -1
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useLongPress.d.ts +16 -0
- package/lib/hooks/useLongPress.d.ts.map +1 -0
- package/lib/hooks/useLongPress.js +57 -0
- package/lib/hooks/useLongPress.js.map +1 -0
- package/lib/hooks/useOuterEvent.js +1 -1
- package/lib/hooks/useOuterEvent.js.map +1 -1
- package/lib/hooks/useOverride.js +1 -1
- package/lib/hooks/useOverride.js.map +1 -1
- package/lib/hooks/useScrollStick.js +14 -3
- package/lib/hooks/useScrollStick.js.map +1 -1
- package/lib/i18n/default.json +59 -3
- package/lib/i18n/i18n.d.ts +114 -2
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/i18n/index.d.ts +1 -0
- package/lib/i18n/index.d.ts.map +1 -1
- package/lib/i18n/index.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/styles/GlobalStyle.d.ts.map +1 -1
- package/lib/styles/GlobalStyle.js +2 -26
- package/lib/styles/GlobalStyle.js.map +1 -1
- package/lib/theme/ThemeMachine.js +7 -1
- package/lib/theme/ThemeMachine.js.map +1 -1
- package/lib/theme/index.d.ts +1 -0
- package/lib/theme/index.d.ts.map +1 -1
- package/lib/theme/index.js +1 -0
- package/lib/theme/index.js.map +1 -1
- package/lib/theme/theme.d.ts +75 -45
- package/lib/theme/theme.d.ts.map +1 -1
- package/lib/theme/themeDefinition.json +50 -30
- package/lib/theme/themeOverrides.schema.json +15 -3
- package/lib/theme/themes/buildTheme.json +2 -39
- package/lib/theme/themes/legacyBuildTheme.json +50 -0
- package/lib/types/types.d.ts +4 -1
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/types.js.map +1 -1
- package/lib/utils/utils.d.ts +24 -0
- package/lib/utils/utils.d.ts.map +1 -1
- package/lib/utils/utils.js +36 -1
- package/lib/utils/utils.js.map +1 -1
- package/package.json +10 -10
- package/lib/components/DateTime/Input/useButtonAriaLabel.d.ts +0 -3
- package/lib/components/DateTime/Input/useButtonAriaLabel.d.ts.map +0 -1
- package/lib/components/DateTime/Input/useButtonAriaLabel.js +0 -33
- package/lib/components/DateTime/Input/useButtonAriaLabel.js.map +0 -1
- package/lib/components/NoItems/NoItems.d.ts +0 -14
- package/lib/components/NoItems/NoItems.d.ts.map +0 -1
- package/lib/components/NoItems/NoItems.js.map +0 -1
- package/lib/components/NoItems/index.d.ts +0 -4
- package/lib/components/NoItems/index.d.ts.map +0 -1
- package/lib/components/NoItems/index.js +0 -3
- package/lib/components/NoItems/index.js.map +0 -1
|
@@ -1,50 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"base": {
|
|
3
|
-
"
|
|
4
|
-
"brand-primary": "#295ED9",
|
|
5
|
-
"border-line": "#cfcfcf"
|
|
6
|
-
},
|
|
7
|
-
"shadow": {
|
|
8
|
-
"focus": "0 0 0 0.0625rem #295ED9",
|
|
9
|
-
"focus-inverted": "0 0 0 0.0625rem #ffffff",
|
|
10
|
-
"focus-filter": "drop-shadow(0.0625rem 0px 0px #295ED9) drop-shadow(-0.0625rem 0px 0px #295ED9) drop-shadow(0px 0.0625rem 0px #295ED9) drop-shadow(0px -0.0625rem 0px #295ED9)",
|
|
11
|
-
"focus-inverted-filter": "drop-shadow(0.0625rem 0px 0px #ffffff) drop-shadow(-0.0625rem 0px 0px #ffffff) drop-shadow(0px 0.0625rem 0px #ffffff) drop-shadow(0px -0.0625rem 0px #ffffff)"
|
|
12
|
-
}
|
|
3
|
+
"font-scale": "minorThird"
|
|
13
4
|
},
|
|
14
5
|
"components": {
|
|
15
|
-
"card": {
|
|
16
|
-
"border-radius": "0.25rem"
|
|
17
|
-
},
|
|
18
6
|
"button": {
|
|
19
7
|
"border-radius": 0.5
|
|
20
8
|
},
|
|
21
|
-
"form-control": {
|
|
22
|
-
"border-radius": 0,
|
|
23
|
-
":focus": {
|
|
24
|
-
"border-color": "#295ED9"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
9
|
"search-input": {
|
|
28
|
-
"border-radius": 0
|
|
29
|
-
},
|
|
30
|
-
"text": {
|
|
31
|
-
"h4": {
|
|
32
|
-
"font-weight": "bold"
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
"table": {
|
|
36
|
-
"header": {
|
|
37
|
-
"background-color": "#ffffff",
|
|
38
|
-
"border-width": "0.125rem"
|
|
39
|
-
},
|
|
40
|
-
"border": {
|
|
41
|
-
"horizontal-outer": false,
|
|
42
|
-
"vertical-inner": false,
|
|
43
|
-
"vertical-outer": false
|
|
44
|
-
},
|
|
45
|
-
"spacing": {
|
|
46
|
-
"horizontal-outer": false
|
|
47
|
-
}
|
|
10
|
+
"border-radius": 0.5
|
|
48
11
|
}
|
|
49
12
|
}
|
|
50
13
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"base": {
|
|
3
|
+
"palette": {
|
|
4
|
+
"brand-primary": "#295ED9",
|
|
5
|
+
"border-line": "#cfcfcf"
|
|
6
|
+
},
|
|
7
|
+
"shadow": {
|
|
8
|
+
"focus": "0 0 0 0.0625rem #295ED9",
|
|
9
|
+
"focus-inverted": "0 0 0 0.0625rem #ffffff",
|
|
10
|
+
"focus-filter": "drop-shadow(0.0625rem 0px 0px #295ED9) drop-shadow(-0.0625rem 0px 0px #295ED9) drop-shadow(0px 0.0625rem 0px #295ED9) drop-shadow(0px -0.0625rem 0px #295ED9)",
|
|
11
|
+
"focus-inverted-filter": "drop-shadow(0.0625rem 0px 0px #ffffff) drop-shadow(-0.0625rem 0px 0px #ffffff) drop-shadow(0px 0.0625rem 0px #ffffff) drop-shadow(0px -0.0625rem 0px #ffffff)"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"components": {
|
|
15
|
+
"card": {
|
|
16
|
+
"border-radius": "0.25rem"
|
|
17
|
+
},
|
|
18
|
+
"button": {
|
|
19
|
+
"border-radius": 0.5
|
|
20
|
+
},
|
|
21
|
+
"form-control": {
|
|
22
|
+
"border-radius": 0,
|
|
23
|
+
":focus": {
|
|
24
|
+
"border-color": "#295ED9"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"search-input": {
|
|
28
|
+
"border-radius": 0
|
|
29
|
+
},
|
|
30
|
+
"text": {
|
|
31
|
+
"h4": {
|
|
32
|
+
"font-weight": "bold"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"table": {
|
|
36
|
+
"header": {
|
|
37
|
+
"background-color": "#ffffff",
|
|
38
|
+
"border-width": "0.125rem"
|
|
39
|
+
},
|
|
40
|
+
"border": {
|
|
41
|
+
"horizontal-outer": false,
|
|
42
|
+
"vertical-inner": false,
|
|
43
|
+
"vertical-outer": false
|
|
44
|
+
},
|
|
45
|
+
"spacing": {
|
|
46
|
+
"horizontal-outer": false
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
package/lib/types/types.d.ts
CHANGED
|
@@ -37,7 +37,10 @@ export declare type DeepPartial<T> = T extends (infer U)[] ? DeepPartial<U>[] :
|
|
|
37
37
|
export declare type DeepRequired<T> = T extends (infer U)[] ? DeepRequired<U>[] : T extends Function ? T : T extends object ? {
|
|
38
38
|
[K in keyof T]-?: DeepRequired<T[K]>;
|
|
39
39
|
} : T;
|
|
40
|
-
export declare type
|
|
40
|
+
export declare type DeferInfer<T> = T & {
|
|
41
|
+
[K in keyof T]: T[K];
|
|
42
|
+
};
|
|
43
|
+
export declare type PropsWithDefaults<Props extends object = {}, Defaults extends keyof Props = never> = OmitStrict<Props, Defaults> & Required<Pick<Props, Defaults>>;
|
|
41
44
|
export declare type PrettyPrint<T> = T extends object ? {
|
|
42
45
|
[K in keyof T]: T[K];
|
|
43
46
|
} : T;
|
package/lib/types/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEhD,MAAM,WAAW,SAAS;IACxB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB;AAED,oBAAY,OAAO,GAAG,MAAM,GAAG,CAAC,iBAAiB,CAAC;AAClD,MAAM,WAAW,MAAM;IACrB,8DAA8D;IAC9D,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB;AAED,MAAM,WAAW,MAAO,SAAQ,YAAY;IAC1C,4EAA4E;IAC5E,EAAE,EAAE,MAAM,CAAC;IACX,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wFAAwF;IACxF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,OAAO,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEhD,MAAM,WAAW,SAAS;IACxB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB;AA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AG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACtC,CAAC,CAAC;AAEN,oBAAY,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAC/C,YAAY,CAAC,CAAC,CAAC,EAAE,GACjB,CAAC,SAAS,QAAQ,GAClB,CAAC,GACD,CAAC,SAAS,MAAM,GAChB;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACxC,CAAC,CAAC;AAIN,oBAAY,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAGzD,oBAAY,iBAAiB,CAC3B,KAAK,SAAS,MAAM,GAAG,EAAE,EACzB,QAAQ,SAAS,MAAM,KAAK,GAAG,KAAK,IAClC,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AAGlE,oBAAY,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GACzC;KACG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrB,GACD,CAAC,CAAC"}
|
package/lib/types/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ElementType, MouseEvent } from 'react';\n\nexport interface BaseProps {\n /** Additional CSS classes. */\n className?: string;\n}\n\nexport interface ForwardProps {\n [prop: string]: unknown;\n}\n\nexport interface NoChildrenProp {\n children?: never;\n}\n\nexport type HTMLTag = keyof JSX.IntrinsicElements;\nexport interface AsProp {\n /** HTML tag or React Component to render the component as. */\n as?: ElementType;\n}\n\nexport interface Action extends ForwardProps {\n /** A string to uniquely identify this Action within the onClick handler. */\n id: string;\n /** The text content of the Action. */\n text: string;\n /** The name of the Cosmos Icon to render, if any. */\n icon?: string;\n /** A location to navigate to. Passing an href will render a Link styled as a Button. */\n href?: string;\n /** Called when the Action is clicked. */\n onClick?: (id: string
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ElementType, MouseEvent } from 'react';\n\nexport interface BaseProps {\n /** Additional CSS classes. */\n className?: string;\n}\n\nexport interface ForwardProps {\n [prop: string]: unknown;\n}\n\nexport interface NoChildrenProp {\n children?: never;\n}\n\nexport type HTMLTag = keyof JSX.IntrinsicElements;\nexport interface AsProp {\n /** HTML tag or React Component to render the component as. */\n as?: ElementType;\n}\n\nexport interface Action extends ForwardProps {\n /** A string to uniquely identify this Action within the onClick handler. */\n id: string;\n /** The text content of the Action. */\n text: string;\n /** The name of the Cosmos Icon to render, if any. */\n icon?: string;\n /** A location to navigate to. Passing an href will render a Link styled as a Button. */\n href?: string;\n /** Called when the Action is clicked. */\n onClick?: (\n id: string,\n e: MouseEvent<HTMLButtonElement | HTMLAnchorElement | HTMLInputElement>\n ) => void;\n /** Determines if the Action will be disabled. */\n disabled?: boolean;\n}\n\n// https://github.com/microsoft/TypeScript/issues/30825\nexport type OmitStrict<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;\nexport type PartialByKey<T extends object, K extends keyof T> = OmitStrict<T, K> &\n Partial<Pick<T, K>>;\nexport type RequiredByKey<T extends object, K extends keyof T> = OmitStrict<T, K> &\n Required<Pick<T, K>>;\n\nexport type DeepPartial<T> = T extends (infer U)[]\n ? DeepPartial<U>[]\n : T extends object\n ? { [K in keyof T]?: DeepPartial<T[K]> }\n : T;\n\nexport type DeepRequired<T> = T extends (infer U)[]\n ? DeepRequired<U>[]\n : T extends Function\n ? T\n : T extends object\n ? { [K in keyof T]-?: DeepRequired<T[K]> }\n : T;\n\n// Lowers type inference precedence without changing the type.\n// https://github.com/Microsoft/TypeScript/issues/14829#issue-216577598\nexport type DeferInfer<T> = T & { [K in keyof T]: T[K] };\n\n/* eslint-disable @typescript-eslint/ban-types */\nexport type PropsWithDefaults<\n Props extends object = {},\n Defaults extends keyof Props = never\n> = OmitStrict<Props, Defaults> & Required<Pick<Props, Defaults>>;\n/* eslint-enable @typescript-eslint/ban-types */\n\nexport type PrettyPrint<T> = T extends object\n ? {\n [K in keyof T]: T[K];\n }\n : T;\n"]}
|
package/lib/utils/utils.d.ts
CHANGED
|
@@ -42,4 +42,28 @@ export declare const normalizeElements: <T extends Element = Element>(els: (T |
|
|
|
42
42
|
* @returns a list of valid focusable elements within the given ref.
|
|
43
43
|
*/
|
|
44
44
|
export declare const getFocusables: (focusablesRef: RefObject<HTMLElement>) => HTMLElement[];
|
|
45
|
+
/**
|
|
46
|
+
* Generator that returns triple of subsequent values in the given array.
|
|
47
|
+
* @param array source array
|
|
48
|
+
* @returns triple of previous, current and next value on every call
|
|
49
|
+
*/
|
|
50
|
+
export declare function triple<T>(array: T[]): Generator<{
|
|
51
|
+
prev?: T;
|
|
52
|
+
current: T;
|
|
53
|
+
next?: T;
|
|
54
|
+
}, undefined, unknown>;
|
|
55
|
+
/**
|
|
56
|
+
* Escape special characters in order to pass a string to the RegExp constructor.
|
|
57
|
+
* @param s a string.
|
|
58
|
+
* @returns a string with special characters escaped.
|
|
59
|
+
*/
|
|
60
|
+
export declare const escapeRegExp: (s: string) => string;
|
|
61
|
+
/**
|
|
62
|
+
* Generate a RegExp with a string parameter.
|
|
63
|
+
* @param s The string to match.
|
|
64
|
+
* @param type How to match.
|
|
65
|
+
* @param flags Standard RegExp flags.
|
|
66
|
+
* @returns A RegExp with the match pattern.
|
|
67
|
+
*/
|
|
68
|
+
export declare const createStringMatcher: (s: string, type?: 'contains' | 'start' | 'boundary', flags?: string) => RegExp;
|
|
45
69
|
//# sourceMappingURL=utils.d.ts.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C,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACpF,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAC9B,KAAK,EAAE,MAAM,CAAC,EACd,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE,OAAO,KAAK,CAAC,CAAC,GAAG,SAAS,EAC1C,SAAS,EAAE,MAAM,CAAC,GACjB,CAAC,CAAC;AAgBL;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,wFAO7B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,kBAAmB,UAAU,WAAW,CAAC,kBAQlE,CAAC;AAEF;;;;GAIG;AACH,wBAAiB,MAAM,CAAC,CAAC,EACvB,KAAK,EAAE,CAAC,EAAE,GACT,SAAS,CAAC;IAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAAC,OAAO,EAAE,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,CAAA;CAAE,EAAE,SAAS,EAAE,OAAO,CAAC,CAKnE;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,MAAO,MAAM,KAAG,MAA0D,CAAC;AAEpG;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,MAC3B,MAAM,SACH,UAAU,GAAG,OAAO,GAAG,UAAU,UAChC,MAAM,KACZ,MAWF,CAAC"}
|
package/lib/utils/utils.js
CHANGED
|
@@ -89,7 +89,7 @@ export function testElForOverflow(el) {
|
|
|
89
89
|
}
|
|
90
90
|
/** Used mostly to trigger css transition after DOM append */
|
|
91
91
|
export function reflow(node) {
|
|
92
|
-
node = node
|
|
92
|
+
node = node ?? document.body;
|
|
93
93
|
return node.offsetWidth;
|
|
94
94
|
}
|
|
95
95
|
export function loadScript(src, onLoad, onError) {
|
|
@@ -197,4 +197,39 @@ export const getFocusables = (focusablesRef) => {
|
|
|
197
197
|
const selector = 'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])';
|
|
198
198
|
return [...focusablesRef.current.querySelectorAll(selector)].filter(el => el instanceof HTMLElement && !el.hasAttribute('disabled'));
|
|
199
199
|
};
|
|
200
|
+
/**
|
|
201
|
+
* Generator that returns triple of subsequent values in the given array.
|
|
202
|
+
* @param array source array
|
|
203
|
+
* @returns triple of previous, current and next value on every call
|
|
204
|
+
*/
|
|
205
|
+
export function* triple(array) {
|
|
206
|
+
for (let i = 0; i < array.length; i += 1) {
|
|
207
|
+
yield { prev: array[i - 1], current: array[i], next: array[i + 1] };
|
|
208
|
+
}
|
|
209
|
+
return undefined;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Escape special characters in order to pass a string to the RegExp constructor.
|
|
213
|
+
* @param s a string.
|
|
214
|
+
* @returns a string with special characters escaped.
|
|
215
|
+
*/
|
|
216
|
+
export const escapeRegExp = (s) => String(s).replace(/[\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
217
|
+
/**
|
|
218
|
+
* Generate a RegExp with a string parameter.
|
|
219
|
+
* @param s The string to match.
|
|
220
|
+
* @param type How to match.
|
|
221
|
+
* @param flags Standard RegExp flags.
|
|
222
|
+
* @returns A RegExp with the match pattern.
|
|
223
|
+
*/
|
|
224
|
+
export const createStringMatcher = (s, type = 'contains', flags = 'i') => {
|
|
225
|
+
const escaped = escapeRegExp(s);
|
|
226
|
+
let pattern = escaped;
|
|
227
|
+
if (type === 'start') {
|
|
228
|
+
pattern = `^${escaped}`;
|
|
229
|
+
}
|
|
230
|
+
else if (type === 'boundary') {
|
|
231
|
+
pattern = `(?:^|\\s)${escaped}`;
|
|
232
|
+
}
|
|
233
|
+
return new RegExp(pattern, flags);
|
|
234
|
+
};
|
|
200
235
|
//# sourceMappingURL=utils.js.map
|
package/lib/utils/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils/utils.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,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AAmB,CAAC,MAAM,CACpF,EAAE,CAAC,EAAE,CAAC,EAAE,YAAY,WAAW,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,CAChE,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Fragment, RefObject } from 'react';\n\n/** @returns Debounced function that can be called only once in given timeout */\nexport function debounce<F extends (...args: any[]) => any>(\n this: any,\n func: F,\n waitTime: number\n): (...args: Parameters<F>) => void {\n let timeout: any;\n return (...args) => {\n const waitFunc = () => {\n timeout = null;\n func.apply(this, args);\n };\n clearTimeout(timeout);\n timeout = setTimeout(waitFunc, waitTime);\n };\n}\n\n/** Check for an existence of prop */\nexport function hasProp<T extends object, P extends PropertyKey>(\n obj: T,\n prop: P\n): obj is T & { [key in P]: unknown } {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\n// Add some context...\nexport function bindAll<T extends object, K extends keyof T>(obj: T, names: K[]): void {\n names.forEach(fn => {\n obj[fn] = (obj[fn] as unknown as Function).bind(obj);\n });\n}\n\n// Capitalize\nexport function cap(s: string): string {\n return s.charAt(0).toUpperCase() + s.slice(1);\n}\n\n/** Generate unique id for elements */\nexport function createUID(): string {\n return `_${Math.random().toString(36).substr(2, 9)}`;\n}\n\n/** Returns array with numbers from given range */\nexport function range(start: number, end: number): number[] {\n return Array(end - start + 1)\n .fill(0)\n .map((_: any, idx: number) => start + idx);\n}\n\n/** Return an array of strings and regex replaced components */\nexport function replaceMatchWithElement(\n str: string,\n re: RegExp,\n render: (match: string) => JSX.Element\n) {\n const arr: (string | JSX.Element)[] = [];\n\n // Only loop for stateful regexes.\n if (re.global || re.sticky) {\n let currIdx = 0;\n let match: RegExpExecArray | null;\n\n // eslint-disable-next-line no-cond-assign\n while ((match = re.exec(str))) {\n arr.push(str.slice(currIdx, match.index), render(match[0]));\n\n currIdx = match.index + match[0].length;\n }\n\n arr.push(str.slice(currIdx));\n } else {\n const match = re.exec(str);\n if (!match) arr.push(str);\n else {\n arr.push(\n str.slice(0, match.index),\n render(match[0]),\n str.slice(match.index + match[0].length)\n );\n }\n }\n\n return arr.flatMap((item, idx) => {\n if (!item) return [];\n\n return <Fragment key={idx}>{item}</Fragment>;\n });\n}\n\n/** Get scrollbar width */\nexport function getScrollbarWidth(): number {\n const scrollDiv = document.createElement('div');\n const divSize = '50px';\n let size = 0;\n\n scrollDiv.style.position = 'absolute';\n scrollDiv.style.top = `-${divSize}`;\n scrollDiv.style.width = divSize;\n scrollDiv.style.height = divSize;\n scrollDiv.style.overflow = 'scroll';\n\n document.body.appendChild(scrollDiv);\n size = scrollDiv.offsetWidth - scrollDiv.clientWidth;\n document.body.removeChild(scrollDiv);\n\n return size;\n}\n\n/** Test element for overflow */\nexport function testElForOverflow(el: Element): boolean {\n if (typeof window === 'undefined') return false;\n\n return el === document.body\n ? el.clientWidth < window.innerWidth\n : el.scrollHeight > el.clientHeight;\n}\n\n/** Used mostly to trigger css transition after DOM append */\nexport function reflow(node?: HTMLElement | null): number {\n node = node ?? document.body;\n return node.offsetWidth;\n}\n\nexport function loadScript(\n src: string,\n onLoad: (this: HTMLScriptElement, ev: Event) => any,\n onError: (this: HTMLScriptElement, ev: ErrorEvent) => any\n) {\n const scriptElem = document.createElement('script');\n scriptElem.src = src;\n\n scriptElem.addEventListener('load', onLoad);\n scriptElem.addEventListener('error', onError);\n document.head.appendChild(scriptElem);\n}\n\nexport function deepGet(obj: object, keys: PropertyKey[]): any {\n let rtn: any = obj;\n\n const found = keys.every(key => {\n if (typeof rtn === 'object' && rtn) {\n rtn = rtn[key];\n return true;\n }\n return false;\n });\n\n if (found) return rtn;\n\n return undefined;\n}\n\n/** Compares two objects by comparing each key value regardless of order. */\nexport function deepObjectComparison(valueA: any, valueB: any): boolean {\n // If the values are strictly equal, return true\n if (valueA === valueB) return true;\n\n // If the values are not objects and are not equal, return false\n if (\n typeof valueA !== 'object' ||\n typeof valueB !== 'object' ||\n valueA === null ||\n valueB === null\n )\n return false;\n\n const keysA = Object.keys(valueA);\n const keysB = Object.keys(valueB);\n\n // If the objects have different numbers of keys, return false\n if (keysA.length !== keysB.length) return false;\n\n for (let i = 0; i < keysA.length; i += 1) {\n const key = keysA[i];\n // If there is not a 1:1 mapping of keys between the objects, return false\n if (!keysB.includes(key)) return false;\n\n if (typeof valueA[key] === 'function' || typeof valueB[key] === 'function') {\n // If the value of a given key is a function, and the functions are not equivalent between the objects, return false\n if (valueA[key].toString() !== valueB[key].toString()) return false;\n // If all checks have passed thus far, compare the next set of nested values\n } else if (!deepObjectComparison(valueA[key], valueB[key])) return false;\n }\n\n // If all checks have passed, the objects are deeply equal\n return true;\n}\n\nexport function defineSmartGetter(\n obj: Record<string, any>,\n key: string,\n valueFn: (...args: any[]) => any\n) {\n Object.defineProperty(obj, key, {\n get: () => {\n delete obj[key];\n obj[key] = valueFn();\n return obj[key];\n },\n enumerable: true,\n configurable: true\n });\n\n return obj;\n}\n\nexport const windowIsAvailable = typeof window !== 'undefined';\n\nexport const navigatorIsAvailable = typeof navigator !== 'undefined';\n\nexport const documentIsAvailable = typeof document !== 'undefined';\n\nexport function tryCatch<T>(tryFn: () => T): T | undefined;\nexport function tryCatch<T, C>(tryFn: () => T, catchFn: (err: unknown) => C): T | C;\nexport function tryCatch<T, C, F>(\n tryFn: () => T,\n catchFn: ((err: unknown) => C) | undefined,\n finallyFn: () => F\n): F;\nexport function tryCatch<T, C, F>(\n tryFn: () => T,\n catchFn?: (err: unknown) => C,\n finallyFn?: () => F\n): T | C | F | undefined {\n try {\n return tryFn();\n } catch (err: unknown) {\n if (catchFn) return catchFn(err);\n } finally {\n // eslint-disable-next-line no-unsafe-finally\n if (finallyFn) return finallyFn();\n }\n}\n\n/**\n * Returns normalized list of elements, ie. it de-reference the element from the Ref if needed.\n * @param els a list of elements or refs to normalize.\n * @returns a new list of the same length with the de-referenced elements.\n */\nexport const normalizeElements = <T extends Element = Element>(\n els: (T | null | RefObject<T | null>)[]\n) => {\n return els.map((el: T | null | RefObject<T | null>) => {\n if (!el) return null;\n return el instanceof Element ? el : el.current;\n });\n};\n\n/**\n * Returns all valid focusable elements within a given ref.\n * @param focusablesRef The ref containing the element to search for focusable elements within.\n * @returns a list of valid focusable elements within the given ref.\n */\nexport const getFocusables = (focusablesRef: RefObject<HTMLElement>) => {\n if (!focusablesRef.current) return [];\n\n const selector = 'a, button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])';\n\n return ([...focusablesRef.current.querySelectorAll(selector)] as HTMLElement[]).filter(\n el => el instanceof HTMLElement && !el.hasAttribute('disabled')\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils/utils.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,OAAO,CAAC;AAE5C,gFAAgF;AAChF,MAAM,UAAU,QAAQ,CAEtB,IAAO,EACP,QAAgB;IAEhB,IAAI,OAAY,CAAC;IACjB,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE;QACjB,MAAM,QAAQ,GAAG,GAAG,EAAE;YACpB,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;QACF,YAAY,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,GAAG,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC3C,CAAC,CAAC;AACJ,CAAC;AAED,qCAAqC;AACrC,MAAM,UAAU,OAAO,CACrB,GAAM,EACN,IAAO;IAEP,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AACzD,CAAC;AAED,sBAAsB;AACtB,MAAM,UAAU,OAAO,CAAsC,GAAM,EAAE,KAAU;IAC7E,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;QACjB,GAAG,CAAC,EAAE,CAAC,GAAI,GAAG,CAAC,EAAE,CAAyB,CAAC,IAAI,CAAC,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,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;IAChC,IAAI,OAAO,GAAW,OAAO,CAAC;IAE9B,IAAI,IAAI,KAAK,OAAO,EAAE;QACpB,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;KACzB;SAAM,IAAI,IAAI,KAAK,UAAU,EAAE;QAC9B,OAAO,GAAG,YAAY,OAAO,EAAE,CAAC;KACjC;IAED,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACpC,CAAC,CAAC","sourcesContent":["import { Fragment, RefObject } from 'react';\n\n/** @returns Debounced function that can be called only once in given timeout */\nexport function debounce<F extends (...args: any[]) => any>(\n this: any,\n func: F,\n waitTime: number\n): (...args: Parameters<F>) => void {\n let timeout: any;\n return (...args) => {\n const waitFunc = () => {\n timeout = null;\n func.apply(this, args);\n };\n clearTimeout(timeout);\n timeout = setTimeout(waitFunc, waitTime);\n };\n}\n\n/** Check for an existence of prop */\nexport function hasProp<T extends object, P extends PropertyKey>(\n obj: T,\n prop: P\n): obj is T & { [key in P]: unknown } {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\n// Add some context...\nexport function bindAll<T extends object, K extends keyof T>(obj: T, names: K[]): void {\n names.forEach(fn => {\n obj[fn] = (obj[fn] as unknown as Function).bind(obj);\n });\n}\n\n// Capitalize\nexport function cap(s: string): string {\n return s.charAt(0).toUpperCase() + s.slice(1);\n}\n\n/** Generate unique id for elements */\nexport function createUID(): string {\n return `_${Math.random().toString(36).substr(2, 9)}`;\n}\n\n/** Returns array with numbers from given range */\nexport function range(start: number, end: number): number[] {\n return Array(end - start + 1)\n .fill(0)\n .map((_: any, idx: number) => start + idx);\n}\n\n/** Return an array of strings and regex replaced components */\nexport function replaceMatchWithElement(\n str: string,\n re: RegExp,\n render: (match: string) => JSX.Element\n) {\n const arr: (string | JSX.Element)[] = [];\n\n // Only loop for stateful regexes.\n if (re.global || re.sticky) {\n let currIdx = 0;\n let match: RegExpExecArray | null;\n\n // eslint-disable-next-line no-cond-assign\n while ((match = re.exec(str))) {\n arr.push(str.slice(currIdx, match.index), render(match[0]));\n\n currIdx = match.index + match[0].length;\n }\n\n arr.push(str.slice(currIdx));\n } else {\n const match = re.exec(str);\n if (!match) arr.push(str);\n else {\n arr.push(\n str.slice(0, match.index),\n render(match[0]),\n str.slice(match.index + match[0].length)\n );\n }\n }\n\n return arr.flatMap((item, idx) => {\n if (!item) return [];\n\n return <Fragment key={idx}>{item}</Fragment>;\n });\n}\n\n/** Get scrollbar width */\nexport function getScrollbarWidth(): number {\n const scrollDiv = document.createElement('div');\n const divSize = '50px';\n let size = 0;\n\n scrollDiv.style.position = 'absolute';\n scrollDiv.style.top = `-${divSize}`;\n scrollDiv.style.width = divSize;\n scrollDiv.style.height = divSize;\n scrollDiv.style.overflow = 'scroll';\n\n document.body.appendChild(scrollDiv);\n size = scrollDiv.offsetWidth - scrollDiv.clientWidth;\n document.body.removeChild(scrollDiv);\n\n return size;\n}\n\n/** Test element for overflow */\nexport function testElForOverflow(el: Element): boolean {\n if (typeof window === 'undefined') return false;\n\n return el === document.body\n ? el.clientWidth < window.innerWidth\n : el.scrollHeight > el.clientHeight;\n}\n\n/** Used mostly to trigger css transition after DOM append */\nexport function reflow(node?: HTMLElement | null): number {\n node = node ?? document.body;\n return node.offsetWidth;\n}\n\nexport function loadScript(\n src: string,\n onLoad: (this: HTMLScriptElement, ev: Event) => any,\n onError: (this: HTMLScriptElement, ev: ErrorEvent) => any\n) {\n const scriptElem = document.createElement('script');\n scriptElem.src = src;\n\n scriptElem.addEventListener('load', onLoad);\n scriptElem.addEventListener('error', onError);\n document.head.appendChild(scriptElem);\n}\n\nexport function deepGet(obj: object, keys: PropertyKey[]): any {\n let rtn: any = obj;\n\n const found = keys.every(key => {\n if (typeof rtn === 'object' && rtn) {\n rtn = rtn[key];\n return true;\n }\n return false;\n });\n\n if (found) return rtn;\n\n return undefined;\n}\n\n/** Compares two objects by comparing each key value regardless of order. */\nexport function deepObjectComparison(valueA: any, valueB: any): boolean {\n // If the values are strictly equal, return true\n if (valueA === valueB) return true;\n\n // If the values are not objects and are not equal, return false\n if (\n typeof valueA !== 'object' ||\n typeof valueB !== 'object' ||\n valueA === null ||\n valueB === null\n )\n return false;\n\n const keysA = Object.keys(valueA);\n const keysB = Object.keys(valueB);\n\n // If the objects have different numbers of keys, return false\n if (keysA.length !== keysB.length) return false;\n\n for (let i = 0; i < keysA.length; i += 1) {\n const key = keysA[i];\n // If there is not a 1:1 mapping of keys between the objects, return false\n if (!keysB.includes(key)) return false;\n\n if (typeof valueA[key] === 'function' || typeof valueB[key] === 'function') {\n // If the value of a given key is a function, and the functions are not equivalent between the objects, return false\n if (valueA[key].toString() !== valueB[key].toString()) return false;\n // If all checks have passed thus far, compare the next set of nested values\n } else if (!deepObjectComparison(valueA[key], valueB[key])) return false;\n }\n\n // If all checks have passed, the objects are deeply equal\n return true;\n}\n\nexport function defineSmartGetter(\n obj: Record<string, any>,\n key: string,\n valueFn: (...args: any[]) => any\n) {\n Object.defineProperty(obj, key, {\n get: () => {\n delete obj[key];\n obj[key] = valueFn();\n return obj[key];\n },\n enumerable: true,\n configurable: true\n });\n\n return obj;\n}\n\nexport const windowIsAvailable = typeof window !== 'undefined';\n\nexport const navigatorIsAvailable = typeof navigator !== 'undefined';\n\nexport const documentIsAvailable = typeof document !== 'undefined';\n\nexport function tryCatch<T>(tryFn: () => T): T | undefined;\nexport function tryCatch<T, C>(tryFn: () => T, catchFn: (err: unknown) => C): T | C;\nexport function tryCatch<T, C, F>(\n tryFn: () => T,\n catchFn: ((err: unknown) => C) | undefined,\n finallyFn: () => F\n): F;\nexport function tryCatch<T, C, F>(\n tryFn: () => T,\n catchFn?: (err: unknown) => C,\n finallyFn?: () => F\n): T | C | F | undefined {\n try {\n return tryFn();\n } catch (err: unknown) {\n if (catchFn) return catchFn(err);\n } finally {\n // eslint-disable-next-line no-unsafe-finally\n if (finallyFn) return finallyFn();\n }\n}\n\n/**\n * Returns normalized list of elements, ie. it de-reference the element from the Ref if needed.\n * @param els a list of elements or refs to normalize.\n * @returns a new list of the same length with the de-referenced elements.\n */\nexport const normalizeElements = <T extends Element = Element>(\n els: (T | null | RefObject<T | null>)[]\n) => {\n return els.map((el: T | null | RefObject<T | null>) => {\n if (!el) return null;\n return el instanceof Element ? el : el.current;\n });\n};\n\n/**\n * Returns all valid focusable elements within a given ref.\n * @param focusablesRef The ref containing the element to search for focusable elements within.\n * @returns a list of valid focusable elements within the given ref.\n */\nexport const getFocusables = (focusablesRef: RefObject<HTMLElement>) => {\n if (!focusablesRef.current) return [];\n\n const selector = 'a, button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])';\n\n return ([...focusablesRef.current.querySelectorAll(selector)] as HTMLElement[]).filter(\n el => el instanceof HTMLElement && !el.hasAttribute('disabled')\n );\n};\n\n/**\n * Generator that returns triple of subsequent values in the given array.\n * @param array source array\n * @returns triple of previous, current and next value on every call\n */\nexport function* triple<T>(\n array: T[]\n): Generator<{ prev?: T; current: T; next?: T }, undefined, unknown> {\n for (let i = 0; i < array.length; i += 1) {\n yield { prev: array[i - 1], current: array[i], next: array[i + 1] };\n }\n return undefined;\n}\n\n/**\n * Escape special characters in order to pass a string to the RegExp constructor.\n * @param s a string.\n * @returns a string with special characters escaped.\n */\nexport const escapeRegExp = (s: string): string => String(s).replace(/[\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n\n/**\n * Generate a RegExp with a string parameter.\n * @param s The string to match.\n * @param type How to match.\n * @param flags Standard RegExp flags.\n * @returns A RegExp with the match pattern.\n */\nexport const createStringMatcher = (\n s: string,\n type: 'contains' | 'start' | 'boundary' = 'contains',\n flags: string = 'i'\n): RegExp => {\n const escaped = escapeRegExp(s);\n let pattern: string = escaped;\n\n if (type === 'start') {\n pattern = `^${escaped}`;\n } else if (type === 'boundary') {\n pattern = `(?:^|\\\\s)${escaped}`;\n }\n\n return new RegExp(pattern, flags);\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-core",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.14.0",
|
|
4
4
|
"description": "Cosmos is a visual design system and UI component collection. Its goal is to empower application developers in their pursuit to create engaging and rewarding user experiences.",
|
|
5
5
|
"author": "Pegasystems",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
"styled-components": "^5.2.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@storybook/addon-a11y": "^6.3.
|
|
37
|
-
"@storybook/addon-actions": "^6.3.
|
|
38
|
-
"@storybook/addon-knobs": "^6.3.
|
|
39
|
-
"@storybook/addon-storysource": "^6.3.
|
|
40
|
-
"@storybook/addon-toolbars": "^6.3.
|
|
41
|
-
"@storybook/addons": "^6.3.
|
|
42
|
-
"@storybook/react": "^6.3.
|
|
36
|
+
"@storybook/addon-a11y": "^6.3.8",
|
|
37
|
+
"@storybook/addon-actions": "^6.3.8",
|
|
38
|
+
"@storybook/addon-knobs": "^6.3.1",
|
|
39
|
+
"@storybook/addon-storysource": "^6.3.8",
|
|
40
|
+
"@storybook/addon-toolbars": "^6.3.8",
|
|
41
|
+
"@storybook/addons": "^6.3.8",
|
|
42
|
+
"@storybook/react": "^6.3.8",
|
|
43
43
|
"@storybook/testing-react": "0.0.18",
|
|
44
|
-
"@storybook/theming": "^6.3.
|
|
44
|
+
"@storybook/theming": "^6.3.8",
|
|
45
45
|
"enzyme": "^3.11.0",
|
|
46
46
|
"enzyme-adapter-react-16": "^1.15.5",
|
|
47
|
-
"typescript": "~4.
|
|
47
|
+
"typescript": "~4.4.2"
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useButtonAriaLabel.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/useButtonAriaLabel.ts"],"names":[],"mappings":"iCAMU,MAAM,QACR,IAAI,GAAG,SAAS,QAChB,MAAM,GAAG,UAAU,GAAG,MAAM,QAC5B,OAAO,kCAEZ,MAAM;AANT,wBA0CE"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { useI18n } from '../../../hooks';
|
|
2
|
-
import { CALENDAR_TYPES } from './local';
|
|
3
|
-
import { getWeek, toUTCDateString } from './utils';
|
|
4
|
-
export default (locale, date, type, open, is12h) => {
|
|
5
|
-
const t = useI18n();
|
|
6
|
-
const ariaDateTimeOpts = {
|
|
7
|
-
hour12: is12h,
|
|
8
|
-
weekday: 'long',
|
|
9
|
-
day: 'numeric',
|
|
10
|
-
month: 'long',
|
|
11
|
-
year: 'numeric',
|
|
12
|
-
hour: '2-digit',
|
|
13
|
-
minute: '2-digit'
|
|
14
|
-
};
|
|
15
|
-
const ariaDateOpts = {
|
|
16
|
-
weekday: 'long',
|
|
17
|
-
day: 'numeric',
|
|
18
|
-
month: 'long',
|
|
19
|
-
year: 'numeric'
|
|
20
|
-
};
|
|
21
|
-
let datePart = '';
|
|
22
|
-
if (type === 'week') {
|
|
23
|
-
datePart = date
|
|
24
|
-
? `${t('selected_week_a11y')} ${getWeek(date, CALENDAR_TYPES.ISO_8601)} ${date.getUTCFullYear()}, `
|
|
25
|
-
: '';
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
const ariaFormat = Intl.DateTimeFormat(locale, type === 'date' ? ariaDateOpts : ariaDateTimeOpts);
|
|
29
|
-
datePart = date ? `${t('selected_date_a11y')} ${toUTCDateString(date, ariaFormat)}, ` : '';
|
|
30
|
-
}
|
|
31
|
-
return `${datePart}${t(open ? 'close_calendar_button_a11y' : 'open_calendar_button_a11y')}`;
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=useButtonAriaLabel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useButtonAriaLabel.js","sourceRoot":"","sources":["../../../../src/components/DateTime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AO,GAAG,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,2BAA2B,CAAC,EAAE,CAAC;AAC9F,CAAC,CAAC","sourcesContent":["import { useI18n } from '../../../hooks';\n\nimport { CALENDAR_TYPES } from './local';\nimport { getWeek, toUTCDateString } from './utils';\n\nexport default (\n locale: string,\n date: Date | undefined,\n type: 'date' | 'datetime' | 'week',\n open: boolean,\n is12h?: boolean\n): string => {\n const t = useI18n();\n const ariaDateTimeOpts = {\n hour12: is12h,\n weekday: 'long',\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit'\n } as const;\n const ariaDateOpts = {\n weekday: 'long',\n day: 'numeric',\n month: 'long',\n year: 'numeric'\n } as const;\n\n let datePart = '';\n if (type === 'week') {\n datePart = date\n ? `${t('selected_week_a11y')} ${getWeek(\n date,\n CALENDAR_TYPES.ISO_8601\n )} ${date.getUTCFullYear()}, `\n : '';\n } else {\n const ariaFormat = Intl.DateTimeFormat(\n locale,\n type === 'date' ? ariaDateOpts : ariaDateTimeOpts\n );\n\n datePart = date ? `${t('selected_date_a11y')} ${toUTCDateString(date, ariaFormat)}, ` : '';\n }\n\n return `${datePart}${t(open ? 'close_calendar_button_a11y' : 'open_calendar_button_a11y')}`;\n};\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent, Ref } from 'react';
|
|
2
|
-
import { BaseProps, NoChildrenProp, ForwardProps } from '../../types';
|
|
3
|
-
export interface NoItemsProps extends BaseProps, NoChildrenProp {
|
|
4
|
-
/**
|
|
5
|
-
* Message to display below the icon.
|
|
6
|
-
* @default 'No items'
|
|
7
|
-
*/
|
|
8
|
-
message?: string;
|
|
9
|
-
ref?: Ref<HTMLDivElement>;
|
|
10
|
-
}
|
|
11
|
-
export declare const StyledNoItems: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
12
|
-
declare const NoItems: FunctionComponent<NoItemsProps & ForwardProps>;
|
|
13
|
-
export default NoItems;
|
|
14
|
-
//# sourceMappingURL=NoItems.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NoItems.d.ts","sourceRoot":"","sources":["../../../src/components/NoItems/NoItems.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAS5E,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGtE,MAAM,WAAW,YAAa,SAAQ,SAAS,EAAE,cAAc;IAC7D;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,aAAa,yGAcxB,CAAC;AAIH,QAAA,MAAM,OAAO,EAAE,iBAAiB,CAAC,YAAY,GAAG,YAAY,CAiB3D,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NoItems.js","sourceRoot":"","sources":["../../../src/components/NoItems/NoItems.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA2C,MAAM,OAAO,CAAC;AAC5E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAW/C,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACpD,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,CAC1B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,CACvF,CAAC;IACF,OAAO,GAAG,CAAA;;;MAGN,UAAU;;;;eAID,KAAK;;GAEjB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,aAAa,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE9C,MAAM,OAAO,GAAmD,UAAU,CACxE,CAAC,KAAoC,EAAE,GAAwB,EAAE,EAAE;IACjE,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,EAAE,OAAO,GAAG,CAAC,CAAC,UAAU,CAAC,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAExD,OAAO,CACL,MAAC,IAAI,oBACC,SAAS,IACb,EAAE,EAAE,aAAa,EACjB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,iBAEnF,KAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,WAAG;YACtB,KAAC,IAAI,kBAAC,OAAO,EAAC,WAAW,gBAAE,OAAO,YAAQ,aACrC,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\nimport { rgba } from 'polished';\n\nimport Flex from '../Flex';\nimport Icon, { StyledIcon } from '../Icon';\nimport Text from '../Text';\nimport { tryCatch } from '../../utils';\nimport { useI18n } from '../../hooks';\nimport { BaseProps, NoChildrenProp, ForwardProps } from '../../types';\nimport { defaultThemeProp } from '../../theme';\n\nexport interface NoItemsProps extends BaseProps, NoChildrenProp {\n /**\n * Message to display below the icon.\n * @default 'No items'\n */\n message?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledNoItems = styled.div(({ theme }) => {\n const color = tryCatch(() =>\n rgba(theme.base.palette['foreground-color'], theme.base.transparency['transparent-2'])\n );\n return css`\n height: 100%;\n\n ${StyledIcon} {\n font-size: 1.5rem;\n height: 1.5rem;\n width: 1.5rem;\n color: ${color};\n }\n `;\n});\n\nStyledNoItems.defaultProps = defaultThemeProp;\n\nconst NoItems: FunctionComponent<NoItemsProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<NoItemsProps>, ref: NoItemsProps['ref']) => {\n const t = useI18n();\n const { message = t('no_items'), ...restProps } = props;\n\n return (\n <Flex\n {...restProps}\n as={StyledNoItems}\n ref={ref}\n container={{ direction: 'column', alignItems: 'center', justify: 'center', gap: 1 }}\n >\n <Icon name='galaxy' />\n <Text variant='secondary'>{message}</Text>\n </Flex>\n );\n }\n);\n\nexport default NoItems;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/NoItems/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/NoItems/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export { default } from './NoItems';\nexport { NoItemsProps } from './NoItems';\nexport { StyledNoItems } from './NoItems';\n"]}
|