@canonical/react-components 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -10
- package/dist-esm/components/Accordion/Accordion.js +0 -52
- package/dist-esm/components/Accordion/AccordionSection/AccordionSection.js +0 -47
- package/dist-esm/components/Accordion/AccordionSection/index.js +0 -1
- package/dist-esm/components/Accordion/index.js +0 -1
- package/dist-esm/components/ActionButton/ActionButton.js +0 -106
- package/dist-esm/components/ActionButton/index.js +0 -1
- package/dist-esm/components/ApplicationLayout/AppAside/AppAside.js +0 -29
- package/dist-esm/components/ApplicationLayout/AppAside/index.js +0 -1
- package/dist-esm/components/ApplicationLayout/AppMain/AppMain.js +0 -21
- package/dist-esm/components/ApplicationLayout/AppMain/index.js +0 -1
- package/dist-esm/components/ApplicationLayout/AppNavigation/AppNavigation.js +0 -31
- package/dist-esm/components/ApplicationLayout/AppNavigation/index.js +0 -1
- package/dist-esm/components/ApplicationLayout/AppNavigationBar/AppNavigationBar.js +0 -24
- package/dist-esm/components/ApplicationLayout/AppNavigationBar/index.js +0 -1
- package/dist-esm/components/ApplicationLayout/AppStatus/AppStatus.js +0 -21
- package/dist-esm/components/ApplicationLayout/AppStatus/index.js +0 -1
- package/dist-esm/components/ApplicationLayout/Application/Application.js +0 -22
- package/dist-esm/components/ApplicationLayout/Application/index.js +0 -1
- package/dist-esm/components/ApplicationLayout/ApplicationLayout.js +0 -113
- package/dist-esm/components/ApplicationLayout/index.js +0 -7
- package/dist-esm/components/ArticlePagination/ArticlePagination.js +0 -39
- package/dist-esm/components/ArticlePagination/index.js +0 -1
- package/dist-esm/components/Badge/Badge.js +0 -64
- package/dist-esm/components/Badge/index.js +0 -1
- package/dist-esm/components/Button/Button.js +0 -55
- package/dist-esm/components/Button/index.js +0 -1
- package/dist-esm/components/Card/Card.js +0 -45
- package/dist-esm/components/Card/index.js +0 -1
- package/dist-esm/components/CheckboxInput/CheckableInput/CheckableInput.js +0 -35
- package/dist-esm/components/CheckboxInput/CheckableInput/index.js +0 -1
- package/dist-esm/components/CheckboxInput/CheckboxInput.js +0 -24
- package/dist-esm/components/CheckboxInput/index.js +0 -1
- package/dist-esm/components/Chip/Chip.js +0 -81
- package/dist-esm/components/Chip/index.js +0 -1
- package/dist-esm/components/Code/Code.js +0 -49
- package/dist-esm/components/Code/index.js +0 -1
- package/dist-esm/components/CodeSnippet/CodeSnippet.js +0 -28
- package/dist-esm/components/CodeSnippet/CodeSnippetBlock.js +0 -64
- package/dist-esm/components/CodeSnippet/CodeSnippetDropdown.js +0 -27
- package/dist-esm/components/CodeSnippet/index.js +0 -2
- package/dist-esm/components/Col/Col.js +0 -38
- package/dist-esm/components/Col/index.js +0 -1
- package/dist-esm/components/ConfirmationButton/ConfirmationButton.js +0 -63
- package/dist-esm/components/ConfirmationButton/index.js +0 -1
- package/dist-esm/components/ConfirmationModal/ConfirmationModal.js +0 -47
- package/dist-esm/components/ConfirmationModal/index.js +0 -1
- package/dist-esm/components/ContextualMenu/ContextualMenu.js +0 -215
- package/dist-esm/components/ContextualMenu/ContextualMenuDropdown/ContextualMenuDropdown.js +0 -249
- package/dist-esm/components/ContextualMenu/ContextualMenuDropdown/index.js +0 -1
- package/dist-esm/components/ContextualMenu/index.js +0 -1
- package/dist-esm/components/EmptyState/EmptyState.js +0 -28
- package/dist-esm/components/EmptyState/index.js +0 -1
- package/dist-esm/components/Field/Field.js +0 -126
- package/dist-esm/components/Field/index.js +0 -1
- package/dist-esm/components/Form/Form.js +0 -28
- package/dist-esm/components/Form/index.js +0 -1
- package/dist-esm/components/FormikField/FormikField.js +0 -33
- package/dist-esm/components/FormikField/index.js +0 -1
- package/dist-esm/components/Icon/Icon.js +0 -61
- package/dist-esm/components/Icon/index.js +0 -1
- package/dist-esm/components/Input/Input.js +0 -103
- package/dist-esm/components/Input/index.js +0 -1
- package/dist-esm/components/Label/Label.js +0 -27
- package/dist-esm/components/Label/index.js +0 -1
- package/dist-esm/components/Link/Link.js +0 -37
- package/dist-esm/components/Link/index.js +0 -1
- package/dist-esm/components/List/List.js +0 -110
- package/dist-esm/components/List/index.js +0 -1
- package/dist-esm/components/Loader/Loader.js +0 -14
- package/dist-esm/components/Loader/index.js +0 -1
- package/dist-esm/components/LoginPageLayout/LoginPageLayout.js +0 -63
- package/dist-esm/components/LoginPageLayout/index.js +0 -1
- package/dist-esm/components/MainTable/MainTable.js +0 -211
- package/dist-esm/components/MainTable/index.js +0 -1
- package/dist-esm/components/Modal/Modal.js +0 -135
- package/dist-esm/components/Modal/index.js +0 -1
- package/dist-esm/components/ModularTable/ModularTable.js +0 -166
- package/dist-esm/components/ModularTable/index.js +0 -1
- package/dist-esm/components/MultiSelect/FadeInDown/FadeInDown.js +0 -25
- package/dist-esm/components/MultiSelect/FadeInDown/index.js +0 -1
- package/dist-esm/components/MultiSelect/MultiSelect.js +0 -308
- package/dist-esm/components/MultiSelect/index.js +0 -1
- package/dist-esm/components/Navigation/Navigation.js +0 -215
- package/dist-esm/components/Navigation/NavigationLink/NavigationLink.js +0 -58
- package/dist-esm/components/Navigation/NavigationLink/index.js +0 -1
- package/dist-esm/components/Navigation/NavigationMenu/NavigationMenu.js +0 -57
- package/dist-esm/components/Navigation/NavigationMenu/index.js +0 -1
- package/dist-esm/components/Navigation/index.js +0 -1
- package/dist-esm/components/Navigation/types.js +0 -1
- package/dist-esm/components/Notification/Notification.js +0 -119
- package/dist-esm/components/Notification/index.js +0 -1
- package/dist-esm/components/NotificationProvider/NotificationProvider.js +0 -83
- package/dist-esm/components/NotificationProvider/index.js +0 -2
- package/dist-esm/components/NotificationProvider/messageBuilder.js +0 -31
- package/dist-esm/components/NotificationProvider/types.js +0 -1
- package/dist-esm/components/Pagination/Pagination.js +0 -173
- package/dist-esm/components/Pagination/PaginationButton/PaginationButton.js +0 -31
- package/dist-esm/components/Pagination/PaginationButton/index.js +0 -1
- package/dist-esm/components/Pagination/PaginationItem/PaginationItem.js +0 -20
- package/dist-esm/components/Pagination/PaginationItem/index.js +0 -1
- package/dist-esm/components/Pagination/index.js +0 -1
- package/dist-esm/components/Panel/Panel.js +0 -89
- package/dist-esm/components/Panel/index.js +0 -1
- package/dist-esm/components/PasswordToggle/PasswordToggle.js +0 -90
- package/dist-esm/components/PasswordToggle/index.js +0 -1
- package/dist-esm/components/RadioInput/RadioInput.js +0 -22
- package/dist-esm/components/RadioInput/index.js +0 -1
- package/dist-esm/components/Row/Row.js +0 -22
- package/dist-esm/components/Row/index.js +0 -1
- package/dist-esm/components/SearchAndFilter/FilterPanelSection/FilterPanelSection.js +0 -107
- package/dist-esm/components/SearchAndFilter/FilterPanelSection/index.js +0 -1
- package/dist-esm/components/SearchAndFilter/SearchAndFilter.js +0 -286
- package/dist-esm/components/SearchAndFilter/index.js +0 -1
- package/dist-esm/components/SearchAndFilter/types.js +0 -1
- package/dist-esm/components/SearchAndFilter/utils.js +0 -22
- package/dist-esm/components/SearchBox/SearchBox.js +0 -95
- package/dist-esm/components/SearchBox/index.js +0 -1
- package/dist-esm/components/Select/Select.js +0 -84
- package/dist-esm/components/Select/index.js +0 -1
- package/dist-esm/components/SideNavigation/SideNavigation.js +0 -89
- package/dist-esm/components/SideNavigation/SideNavigationBase/SideNavigationBase.js +0 -31
- package/dist-esm/components/SideNavigation/SideNavigationBase/index.js +0 -1
- package/dist-esm/components/SideNavigation/SideNavigationItem/SideNavigationItem.js +0 -32
- package/dist-esm/components/SideNavigation/SideNavigationItem/index.js +0 -1
- package/dist-esm/components/SideNavigation/SideNavigationLink/SideNavigationLink.js +0 -25
- package/dist-esm/components/SideNavigation/SideNavigationLink/index.js +0 -1
- package/dist-esm/components/SideNavigation/SideNavigationText/SideNavigationText.js +0 -20
- package/dist-esm/components/SideNavigation/SideNavigationText/index.js +0 -1
- package/dist-esm/components/SideNavigation/index.js +0 -4
- package/dist-esm/components/Slider/Slider.js +0 -83
- package/dist-esm/components/Slider/index.js +0 -1
- package/dist-esm/components/Spinner/Spinner.js +0 -36
- package/dist-esm/components/Spinner/index.js +0 -1
- package/dist-esm/components/StatusLabel/StatusLabel.js +0 -36
- package/dist-esm/components/StatusLabel/index.js +0 -1
- package/dist-esm/components/Strip/Strip.js +0 -50
- package/dist-esm/components/Strip/index.js +0 -1
- package/dist-esm/components/SummaryButton/SummaryButton.js +0 -28
- package/dist-esm/components/SummaryButton/index.js +0 -1
- package/dist-esm/components/Switch/Switch.js +0 -28
- package/dist-esm/components/Switch/index.js +0 -1
- package/dist-esm/components/Table/Table.js +0 -23
- package/dist-esm/components/Table/index.js +0 -1
- package/dist-esm/components/TableCell/TableCell.js +0 -26
- package/dist-esm/components/TableCell/index.js +0 -1
- package/dist-esm/components/TableHeader/TableHeader.js +0 -17
- package/dist-esm/components/TableHeader/index.js +0 -1
- package/dist-esm/components/TablePagination/TablePagination.js +0 -104
- package/dist-esm/components/TablePagination/TablePaginationControls/TablePaginationControls.js +0 -120
- package/dist-esm/components/TablePagination/TablePaginationControls/index.js +0 -1
- package/dist-esm/components/TablePagination/index.js +0 -1
- package/dist-esm/components/TablePagination/utils.js +0 -67
- package/dist-esm/components/TableRow/TableRow.js +0 -15
- package/dist-esm/components/TableRow/index.js +0 -1
- package/dist-esm/components/Tabs/Tabs.js +0 -42
- package/dist-esm/components/Tabs/index.js +0 -1
- package/dist-esm/components/Textarea/Textarea.js +0 -115
- package/dist-esm/components/Textarea/index.js +0 -1
- package/dist-esm/components/Tooltip/Tooltip.js +0 -245
- package/dist-esm/components/Tooltip/index.js +0 -1
- package/dist-esm/enums.js +0 -8
- package/dist-esm/hooks/index.js +0 -8
- package/dist-esm/hooks/useId.js +0 -13
- package/dist-esm/hooks/useListener.js +0 -51
- package/dist-esm/hooks/useOnClickOutside.js +0 -38
- package/dist-esm/hooks/useOnEscapePressed.js +0 -25
- package/dist-esm/hooks/usePagination.js +0 -45
- package/dist-esm/hooks/usePrevious.js +0 -16
- package/dist-esm/hooks/useThrottle.js +0 -49
- package/dist-esm/hooks/useWindowFitment.js +0 -109
- package/dist-esm/index.js +0 -69
- package/dist-esm/types/index.js +0 -1
- package/dist-esm/types/react-table-config.d.js +0 -1
- package/dist-esm/utils.js +0 -41
- /package/{dist-types → dist}/components/Accordion/Accordion.d.ts +0 -0
- /package/{dist-types → dist}/components/Accordion/AccordionSection/AccordionSection.d.ts +0 -0
- /package/{dist-types → dist}/components/Accordion/AccordionSection/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Accordion/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ActionButton/ActionButton.d.ts +0 -0
- /package/{dist-types → dist}/components/ActionButton/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/AppAside/AppAside.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/AppAside/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/AppMain/AppMain.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/AppMain/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/AppNavigation/AppNavigation.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/AppNavigation/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/AppNavigationBar/AppNavigationBar.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/AppNavigationBar/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/AppStatus/AppStatus.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/AppStatus/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/Application/Application.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/Application/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/ApplicationLayout.d.ts +0 -0
- /package/{dist-types → dist}/components/ApplicationLayout/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ArticlePagination/ArticlePagination.d.ts +0 -0
- /package/{dist-types → dist}/components/ArticlePagination/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Badge/Badge.d.ts +0 -0
- /package/{dist-types → dist}/components/Badge/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Button/Button.d.ts +0 -0
- /package/{dist-types → dist}/components/Button/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Card/Card.d.ts +0 -0
- /package/{dist-types → dist}/components/Card/index.d.ts +0 -0
- /package/{dist-types → dist}/components/CheckboxInput/CheckableInput/CheckableInput.d.ts +0 -0
- /package/{dist-types → dist}/components/CheckboxInput/CheckableInput/index.d.ts +0 -0
- /package/{dist-types → dist}/components/CheckboxInput/CheckboxInput.d.ts +0 -0
- /package/{dist-types → dist}/components/CheckboxInput/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Chip/Chip.d.ts +0 -0
- /package/{dist-types → dist}/components/Chip/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Code/Code.d.ts +0 -0
- /package/{dist-types → dist}/components/Code/index.d.ts +0 -0
- /package/{dist-types → dist}/components/CodeSnippet/CodeSnippet.d.ts +0 -0
- /package/{dist-types → dist}/components/CodeSnippet/CodeSnippetBlock.d.ts +0 -0
- /package/{dist-types → dist}/components/CodeSnippet/CodeSnippetDropdown.d.ts +0 -0
- /package/{dist-types → dist}/components/CodeSnippet/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Col/Col.d.ts +0 -0
- /package/{dist-types → dist}/components/Col/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ConfirmationButton/ConfirmationButton.d.ts +0 -0
- /package/{dist-types → dist}/components/ConfirmationButton/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ConfirmationModal/ConfirmationModal.d.ts +0 -0
- /package/{dist-types → dist}/components/ConfirmationModal/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ContextualMenu/ContextualMenu.d.ts +0 -0
- /package/{dist-types → dist}/components/ContextualMenu/ContextualMenuDropdown/ContextualMenuDropdown.d.ts +0 -0
- /package/{dist-types → dist}/components/ContextualMenu/ContextualMenuDropdown/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ContextualMenu/index.d.ts +0 -0
- /package/{dist-types → dist}/components/EmptyState/EmptyState.d.ts +0 -0
- /package/{dist-types → dist}/components/EmptyState/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Field/Field.d.ts +0 -0
- /package/{dist-types → dist}/components/Field/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Form/Form.d.ts +0 -0
- /package/{dist-types → dist}/components/Form/index.d.ts +0 -0
- /package/{dist-types → dist}/components/FormikField/FormikField.d.ts +0 -0
- /package/{dist-types → dist}/components/FormikField/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Icon/Icon.d.ts +0 -0
- /package/{dist-types → dist}/components/Icon/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Input/Input.d.ts +0 -0
- /package/{dist-types → dist}/components/Input/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Label/Label.d.ts +0 -0
- /package/{dist-types → dist}/components/Label/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Link/Link.d.ts +0 -0
- /package/{dist-types → dist}/components/Link/index.d.ts +0 -0
- /package/{dist-types → dist}/components/List/List.d.ts +0 -0
- /package/{dist-types → dist}/components/List/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Loader/Loader.d.ts +0 -0
- /package/{dist-types → dist}/components/Loader/index.d.ts +0 -0
- /package/{dist-types → dist}/components/LoginPageLayout/LoginPageLayout.d.ts +0 -0
- /package/{dist-types → dist}/components/LoginPageLayout/index.d.ts +0 -0
- /package/{dist-types → dist}/components/MainTable/MainTable.d.ts +0 -0
- /package/{dist-types → dist}/components/MainTable/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Modal/Modal.d.ts +0 -0
- /package/{dist-types → dist}/components/Modal/index.d.ts +0 -0
- /package/{dist-types → dist}/components/ModularTable/ModularTable.d.ts +0 -0
- /package/{dist-types → dist}/components/ModularTable/index.d.ts +0 -0
- /package/{dist-types → dist}/components/MultiSelect/FadeInDown/FadeInDown.d.ts +0 -0
- /package/{dist-types → dist}/components/MultiSelect/FadeInDown/index.d.ts +0 -0
- /package/{dist-types → dist}/components/MultiSelect/MultiSelect.d.ts +0 -0
- /package/{dist-types → dist}/components/MultiSelect/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Navigation/Navigation.d.ts +0 -0
- /package/{dist-types → dist}/components/Navigation/NavigationLink/NavigationLink.d.ts +0 -0
- /package/{dist-types → dist}/components/Navigation/NavigationLink/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Navigation/NavigationMenu/NavigationMenu.d.ts +0 -0
- /package/{dist-types → dist}/components/Navigation/NavigationMenu/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Navigation/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Navigation/types.d.ts +0 -0
- /package/{dist-types → dist}/components/Notification/Notification.d.ts +0 -0
- /package/{dist-types → dist}/components/Notification/index.d.ts +0 -0
- /package/{dist-types → dist}/components/NotificationProvider/NotificationProvider.d.ts +0 -0
- /package/{dist-types → dist}/components/NotificationProvider/index.d.ts +0 -0
- /package/{dist-types → dist}/components/NotificationProvider/messageBuilder.d.ts +0 -0
- /package/{dist-types → dist}/components/NotificationProvider/types.d.ts +0 -0
- /package/{dist-types → dist}/components/Pagination/Pagination.d.ts +0 -0
- /package/{dist-types → dist}/components/Pagination/PaginationButton/PaginationButton.d.ts +0 -0
- /package/{dist-types → dist}/components/Pagination/PaginationButton/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Pagination/PaginationItem/PaginationItem.d.ts +0 -0
- /package/{dist-types → dist}/components/Pagination/PaginationItem/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Pagination/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Panel/Panel.d.ts +0 -0
- /package/{dist-types → dist}/components/Panel/index.d.ts +0 -0
- /package/{dist-types → dist}/components/PasswordToggle/PasswordToggle.d.ts +0 -0
- /package/{dist-types → dist}/components/PasswordToggle/index.d.ts +0 -0
- /package/{dist-types → dist}/components/RadioInput/RadioInput.d.ts +0 -0
- /package/{dist-types → dist}/components/RadioInput/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Row/Row.d.ts +0 -0
- /package/{dist-types → dist}/components/Row/index.d.ts +0 -0
- /package/{dist-types → dist}/components/SearchAndFilter/FilterPanelSection/FilterPanelSection.d.ts +0 -0
- /package/{dist-types → dist}/components/SearchAndFilter/FilterPanelSection/index.d.ts +0 -0
- /package/{dist-types → dist}/components/SearchAndFilter/SearchAndFilter.d.ts +0 -0
- /package/{dist-types → dist}/components/SearchAndFilter/index.d.ts +0 -0
- /package/{dist-types → dist}/components/SearchAndFilter/types.d.ts +0 -0
- /package/{dist-types → dist}/components/SearchAndFilter/utils.d.ts +0 -0
- /package/{dist-types → dist}/components/SearchBox/SearchBox.d.ts +0 -0
- /package/{dist-types → dist}/components/SearchBox/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Select/Select.d.ts +0 -0
- /package/{dist-types → dist}/components/Select/index.d.ts +0 -0
- /package/{dist-types → dist}/components/SideNavigation/SideNavigation.d.ts +0 -0
- /package/{dist-types → dist}/components/SideNavigation/SideNavigationBase/SideNavigationBase.d.ts +0 -0
- /package/{dist-types → dist}/components/SideNavigation/SideNavigationBase/index.d.ts +0 -0
- /package/{dist-types → dist}/components/SideNavigation/SideNavigationItem/SideNavigationItem.d.ts +0 -0
- /package/{dist-types → dist}/components/SideNavigation/SideNavigationItem/index.d.ts +0 -0
- /package/{dist-types → dist}/components/SideNavigation/SideNavigationLink/SideNavigationLink.d.ts +0 -0
- /package/{dist-types → dist}/components/SideNavigation/SideNavigationLink/index.d.ts +0 -0
- /package/{dist-types → dist}/components/SideNavigation/SideNavigationText/SideNavigationText.d.ts +0 -0
- /package/{dist-types → dist}/components/SideNavigation/SideNavigationText/index.d.ts +0 -0
- /package/{dist-types → dist}/components/SideNavigation/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Slider/Slider.d.ts +0 -0
- /package/{dist-types → dist}/components/Slider/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Spinner/Spinner.d.ts +0 -0
- /package/{dist-types → dist}/components/Spinner/index.d.ts +0 -0
- /package/{dist-types → dist}/components/StatusLabel/StatusLabel.d.ts +0 -0
- /package/{dist-types → dist}/components/StatusLabel/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Strip/Strip.d.ts +0 -0
- /package/{dist-types → dist}/components/Strip/index.d.ts +0 -0
- /package/{dist-types → dist}/components/SummaryButton/SummaryButton.d.ts +0 -0
- /package/{dist-types → dist}/components/SummaryButton/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Switch/Switch.d.ts +0 -0
- /package/{dist-types → dist}/components/Switch/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Table/Table.d.ts +0 -0
- /package/{dist-types → dist}/components/Table/index.d.ts +0 -0
- /package/{dist-types → dist}/components/TableCell/TableCell.d.ts +0 -0
- /package/{dist-types → dist}/components/TableCell/index.d.ts +0 -0
- /package/{dist-types → dist}/components/TableHeader/TableHeader.d.ts +0 -0
- /package/{dist-types → dist}/components/TableHeader/index.d.ts +0 -0
- /package/{dist-types → dist}/components/TablePagination/TablePagination.d.ts +0 -0
- /package/{dist-types → dist}/components/TablePagination/TablePaginationControls/TablePaginationControls.d.ts +0 -0
- /package/{dist-types → dist}/components/TablePagination/TablePaginationControls/index.d.ts +0 -0
- /package/{dist-types → dist}/components/TablePagination/index.d.ts +0 -0
- /package/{dist-types → dist}/components/TablePagination/utils.d.ts +0 -0
- /package/{dist-types → dist}/components/TableRow/TableRow.d.ts +0 -0
- /package/{dist-types → dist}/components/TableRow/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Tabs/Tabs.d.ts +0 -0
- /package/{dist-types → dist}/components/Tabs/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Textarea/Textarea.d.ts +0 -0
- /package/{dist-types → dist}/components/Textarea/index.d.ts +0 -0
- /package/{dist-types → dist}/components/Tooltip/Tooltip.d.ts +0 -0
- /package/{dist-types → dist}/components/Tooltip/index.d.ts +0 -0
- /package/{dist-types → dist}/enums.d.ts +0 -0
- /package/{dist-types → dist}/hooks/index.d.ts +0 -0
- /package/{dist-types → dist}/hooks/useId.d.ts +0 -0
- /package/{dist-types → dist}/hooks/useListener.d.ts +0 -0
- /package/{dist-types → dist}/hooks/useOnClickOutside.d.ts +0 -0
- /package/{dist-types → dist}/hooks/useOnEscapePressed.d.ts +0 -0
- /package/{dist-types → dist}/hooks/usePagination.d.ts +0 -0
- /package/{dist-types → dist}/hooks/usePrevious.d.ts +0 -0
- /package/{dist-types → dist}/hooks/useThrottle.d.ts +0 -0
- /package/{dist-types → dist}/hooks/useWindowFitment.d.ts +0 -0
- /package/{dist-types → dist}/index.d.ts +0 -0
- /package/{dist-types → dist}/types/index.d.ts +0 -0
- /package/{dist-types → dist}/utils.d.ts +0 -0
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
var _excluded = ["value", "badgeType", "className", "isNegative"];
|
|
2
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
5
|
-
import classNames from "classnames";
|
|
6
|
-
import React from "react";
|
|
7
|
-
export var BadgeType = {
|
|
8
|
-
ROUNDED_LARGE_NUMBER: "ROUNDED_LARGE_NUMBER",
|
|
9
|
-
UNDEFINED_LARGE_NUMBER: "UNDEFINED_LARGE_NUMBER"
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* The props for the Badge component.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
var MAX_VAL = 999;
|
|
17
|
-
var units = ["", "k", "M", "B", "T"];
|
|
18
|
-
var round = function round(value) {
|
|
19
|
-
var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
20
|
-
if (value < 1000) {
|
|
21
|
-
var truncatedValue = Number(value.toString().slice(0, 3));
|
|
22
|
-
return "".concat(truncatedValue).concat(units[unit]);
|
|
23
|
-
}
|
|
24
|
-
if (unit >= units.length - 1) {
|
|
25
|
-
return "999T";
|
|
26
|
-
}
|
|
27
|
-
var newValue = value / 1000;
|
|
28
|
-
return round(newValue, unit + 1);
|
|
29
|
-
};
|
|
30
|
-
var clamp = value => {
|
|
31
|
-
if (value > MAX_VAL) {
|
|
32
|
-
return "".concat(MAX_VAL, "+");
|
|
33
|
-
}
|
|
34
|
-
return value;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* This is a [React](https://reactjs.org/) component for the Vanilla [Badge](https://vanillaframework.io/docs/patterns/badge).
|
|
39
|
-
*
|
|
40
|
-
* It can be used to display a numeric values.
|
|
41
|
-
*/
|
|
42
|
-
var Badge = _ref => {
|
|
43
|
-
var {
|
|
44
|
-
value,
|
|
45
|
-
badgeType = BadgeType.UNDEFINED_LARGE_NUMBER,
|
|
46
|
-
className,
|
|
47
|
-
isNegative
|
|
48
|
-
} = _ref,
|
|
49
|
-
spanProps = _objectWithoutProperties(_ref, _excluded);
|
|
50
|
-
var badgeClassName = classNames({
|
|
51
|
-
["p-badge--negative"]: !!isNegative,
|
|
52
|
-
"p-badge": !isNegative
|
|
53
|
-
}, className);
|
|
54
|
-
var safeValue = Math.round(value);
|
|
55
|
-
if (value < 0) {
|
|
56
|
-
console.error("The value used in the badge should be positive");
|
|
57
|
-
safeValue = 0;
|
|
58
|
-
}
|
|
59
|
-
var formattedValue = badgeType === BadgeType.ROUNDED_LARGE_NUMBER ? round(safeValue) : clamp(safeValue);
|
|
60
|
-
return /*#__PURE__*/React.createElement("span", _extends({}, spanProps, {
|
|
61
|
-
className: badgeClassName
|
|
62
|
-
}), formattedValue);
|
|
63
|
-
};
|
|
64
|
-
export default Badge;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Badge";
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
var _excluded = ["appearance", "children", "className", "dense", "disabled", "element", "hasIcon", "inline", "onClick", "small"];
|
|
2
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
5
|
-
import classNames from "classnames";
|
|
6
|
-
import React from "react";
|
|
7
|
-
export var ButtonAppearance = {
|
|
8
|
-
BASE: "base",
|
|
9
|
-
BRAND: "brand",
|
|
10
|
-
DEFAULT: "",
|
|
11
|
-
LINK: "link",
|
|
12
|
-
NEGATIVE: "negative",
|
|
13
|
-
POSITIVE: "positive"
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* The type of the Button props.
|
|
18
|
-
* @template P - The type of the props if providing a component to `element`
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* This is a [React](https://reactjs.org/) component for the Vanilla [Button](https://docs.vanillaframework.io/patterns/buttons/).
|
|
23
|
-
*
|
|
24
|
-
* Buttons are clickable elements used to perform an action, they can be used for buttons and link elements.
|
|
25
|
-
* @template P - The type of the props if providing a component to `element`
|
|
26
|
-
*/
|
|
27
|
-
var Button = _ref => {
|
|
28
|
-
var {
|
|
29
|
-
appearance,
|
|
30
|
-
children,
|
|
31
|
-
className,
|
|
32
|
-
dense,
|
|
33
|
-
disabled,
|
|
34
|
-
element: Component = "button",
|
|
35
|
-
hasIcon,
|
|
36
|
-
inline,
|
|
37
|
-
onClick,
|
|
38
|
-
small
|
|
39
|
-
} = _ref,
|
|
40
|
-
buttonProps = _objectWithoutProperties(_ref, _excluded);
|
|
41
|
-
var classes = classNames(appearance ? "p-button--".concat(appearance) : "p-button", {
|
|
42
|
-
"has-icon": hasIcon,
|
|
43
|
-
"is-dense": dense,
|
|
44
|
-
"is-disabled": disabled,
|
|
45
|
-
"is-inline": inline,
|
|
46
|
-
"is-small": small
|
|
47
|
-
}, className);
|
|
48
|
-
var onClickDisabled = e => e.preventDefault();
|
|
49
|
-
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
50
|
-
className: classes,
|
|
51
|
-
onClick: disabled ? onClickDisabled : onClick,
|
|
52
|
-
"aria-disabled": disabled || undefined
|
|
53
|
-
}, buttonProps), children);
|
|
54
|
-
};
|
|
55
|
-
export default Button;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default, ButtonAppearance } from "./Button";
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
var _excluded = ["children", "className", "highlighted", "overlay", "thumbnail", "title"];
|
|
2
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
5
|
-
import classNames from "classnames";
|
|
6
|
-
import React, { useId } from "react";
|
|
7
|
-
/**
|
|
8
|
-
* This is a [React](https://reactjs.org/) component for the Vanilla [Card](https://docs.vanillaframework.io/patterns/card/).
|
|
9
|
-
*
|
|
10
|
-
* There are four card styles available to use in Vanilla: default, header, highlighted and overlay. Our card component will expand to fill the full width of its parent container.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
var Card = _ref => {
|
|
14
|
-
var {
|
|
15
|
-
children,
|
|
16
|
-
className,
|
|
17
|
-
highlighted,
|
|
18
|
-
overlay,
|
|
19
|
-
thumbnail,
|
|
20
|
-
title
|
|
21
|
-
} = _ref,
|
|
22
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
-
var titleId = useId();
|
|
24
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
25
|
-
"aria-labelledby": title ? titleId : undefined,
|
|
26
|
-
className: classNames(className, {
|
|
27
|
-
"p-card": !highlighted && !overlay,
|
|
28
|
-
"p-card--highlighted": highlighted,
|
|
29
|
-
"p-card--overlay": overlay
|
|
30
|
-
}),
|
|
31
|
-
role: "group"
|
|
32
|
-
}, props), thumbnail && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("img", {
|
|
33
|
-
className: "p-card__thumbnail",
|
|
34
|
-
src: thumbnail,
|
|
35
|
-
alt: ""
|
|
36
|
-
}), /*#__PURE__*/React.createElement("hr", {
|
|
37
|
-
className: "u-sv1"
|
|
38
|
-
})), title && /*#__PURE__*/React.createElement("h3", {
|
|
39
|
-
className: "p-card__title",
|
|
40
|
-
id: titleId
|
|
41
|
-
}, title), /*#__PURE__*/React.createElement("div", {
|
|
42
|
-
className: "p-card__content"
|
|
43
|
-
}, children));
|
|
44
|
-
};
|
|
45
|
-
export default Card;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Card";
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
var _excluded = ["inputType", "label", "labelClassName", "indeterminate", "inline"];
|
|
2
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
5
|
-
import classNames from "classnames";
|
|
6
|
-
import React, { useEffect, useRef, useId } from "react";
|
|
7
|
-
var CheckableInput = _ref => {
|
|
8
|
-
var {
|
|
9
|
-
inputType,
|
|
10
|
-
label,
|
|
11
|
-
labelClassName,
|
|
12
|
-
indeterminate = false,
|
|
13
|
-
inline
|
|
14
|
-
} = _ref,
|
|
15
|
-
checkboxProps = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
-
var inputId = useId();
|
|
17
|
-
var inputRef = useRef(null);
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
inputRef.current.indeterminate = indeterminate;
|
|
20
|
-
}, [indeterminate]);
|
|
21
|
-
return /*#__PURE__*/React.createElement("label", {
|
|
22
|
-
className: classNames(labelClassName, "p-".concat(inputType).concat(inline ? "--inline" : ""), {
|
|
23
|
-
"is-required": checkboxProps.required
|
|
24
|
-
})
|
|
25
|
-
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
26
|
-
"aria-labelledby": inputId,
|
|
27
|
-
className: "p-".concat(inputType, "__input"),
|
|
28
|
-
ref: inputRef,
|
|
29
|
-
type: inputType
|
|
30
|
-
}, checkboxProps)), /*#__PURE__*/React.createElement("span", {
|
|
31
|
-
className: "p-".concat(inputType, "__label"),
|
|
32
|
-
id: inputId
|
|
33
|
-
}, label));
|
|
34
|
-
};
|
|
35
|
-
export default CheckableInput;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./CheckableInput";
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
var _excluded = ["label", "indeterminate"];
|
|
2
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
5
|
-
import React from "react";
|
|
6
|
-
import CheckableInput from "./CheckableInput";
|
|
7
|
-
/**
|
|
8
|
-
* This is a [React](https://reactjs.org/) component for the Vanilla [Checkbox input](https://docs.vanillaframework.io/base/forms#checkbox).
|
|
9
|
-
*
|
|
10
|
-
* Use the checkbox component to select one or more options.
|
|
11
|
-
*/
|
|
12
|
-
var CheckboxInput = _ref => {
|
|
13
|
-
var {
|
|
14
|
-
label,
|
|
15
|
-
indeterminate = false
|
|
16
|
-
} = _ref,
|
|
17
|
-
checkboxProps = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
-
return /*#__PURE__*/React.createElement(CheckableInput, _extends({
|
|
19
|
-
label: label,
|
|
20
|
-
inputType: "checkbox",
|
|
21
|
-
indeterminate: indeterminate
|
|
22
|
-
}, checkboxProps));
|
|
23
|
-
};
|
|
24
|
-
export default CheckboxInput;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./CheckboxInput";
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
var _excluded = ["appearance", "lead", "onClick", "onDismiss", "quoteValue", "selected", "subString", "value"];
|
|
2
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
5
|
-
import React from "react";
|
|
6
|
-
import { highlightSubString } from "../../utils";
|
|
7
|
-
import classNames from "classnames";
|
|
8
|
-
export var Label = /*#__PURE__*/function (Label) {
|
|
9
|
-
Label["Dismiss"] = "Dismiss";
|
|
10
|
-
return Label;
|
|
11
|
-
}({});
|
|
12
|
-
export var ChipType = {
|
|
13
|
-
CAUTION: "caution",
|
|
14
|
-
INFORMATION: "information",
|
|
15
|
-
NEGATIVE: "negative",
|
|
16
|
-
POSITIVE: "positive"
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* This is a [React](https://reactjs.org/) component for the Vanilla [Chip](https://vanillaframework.io/docs/patterns/chip).
|
|
20
|
-
*
|
|
21
|
-
* It can be used to display a small value attached to a component.
|
|
22
|
-
*/
|
|
23
|
-
var Chip = _ref => {
|
|
24
|
-
var {
|
|
25
|
-
appearance,
|
|
26
|
-
lead = "",
|
|
27
|
-
onClick,
|
|
28
|
-
onDismiss,
|
|
29
|
-
quoteValue,
|
|
30
|
-
selected,
|
|
31
|
-
subString = "",
|
|
32
|
-
value
|
|
33
|
-
} = _ref,
|
|
34
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
35
|
-
// When user tabs over chip and presses Enter or Space key, chip will trigger
|
|
36
|
-
// click functionality
|
|
37
|
-
var _onKeyDown = e => {
|
|
38
|
-
// The " " value is what is returned for the spacebar
|
|
39
|
-
if (e.key === " " || e.key === "Enter") {
|
|
40
|
-
if (typeof onClick === "function") {
|
|
41
|
-
onClick({
|
|
42
|
-
lead: lead,
|
|
43
|
-
value: value
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
var chipValue = highlightSubString(value, subString).text;
|
|
49
|
-
var chipContent = /*#__PURE__*/React.createElement(React.Fragment, null, lead && /*#__PURE__*/React.createElement("span", {
|
|
50
|
-
className: "p-chip__lead"
|
|
51
|
-
}, lead.toUpperCase()), /*#__PURE__*/React.createElement("span", {
|
|
52
|
-
className: "p-chip__value",
|
|
53
|
-
dangerouslySetInnerHTML: {
|
|
54
|
-
__html: quoteValue ? "'".concat(chipValue, "'") : chipValue
|
|
55
|
-
}
|
|
56
|
-
}));
|
|
57
|
-
var chipClassName = classNames({
|
|
58
|
-
["p-chip--".concat(appearance)]: !!appearance,
|
|
59
|
-
"p-chip": !appearance
|
|
60
|
-
}, props.className);
|
|
61
|
-
if (onDismiss) {
|
|
62
|
-
return /*#__PURE__*/React.createElement("span", _extends({}, props, {
|
|
63
|
-
className: chipClassName
|
|
64
|
-
}), chipContent, /*#__PURE__*/React.createElement("button", {
|
|
65
|
-
className: "p-chip__dismiss",
|
|
66
|
-
onClick: onDismiss,
|
|
67
|
-
type: "button"
|
|
68
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
69
|
-
className: "p-icon--close"
|
|
70
|
-
}, Label.Dismiss)));
|
|
71
|
-
} else {
|
|
72
|
-
return /*#__PURE__*/React.createElement("button", _extends({}, props, {
|
|
73
|
-
"aria-pressed": selected,
|
|
74
|
-
className: chipClassName,
|
|
75
|
-
onClick: onClick,
|
|
76
|
-
onKeyDown: e => _onKeyDown(e),
|
|
77
|
-
type: "button"
|
|
78
|
-
}), chipContent);
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
export default Chip;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Chip";
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import _pt from "prop-types";
|
|
2
|
-
var _excluded = ["children", "className", "inline", "copyable", "numbered"];
|
|
3
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
5
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
6
|
-
import React from "react";
|
|
7
|
-
import CodeSnippet, { CodeSnippetBlockAppearance } from "../CodeSnippet";
|
|
8
|
-
import { IS_DEV } from "../../utils";
|
|
9
|
-
/**
|
|
10
|
-
* @deprecated Code component is deprecated. Use CodeSnippet component or inline `<code>` instead.
|
|
11
|
-
*/
|
|
12
|
-
var Code = _ref => {
|
|
13
|
-
var {
|
|
14
|
-
children,
|
|
15
|
-
className,
|
|
16
|
-
inline,
|
|
17
|
-
copyable,
|
|
18
|
-
numbered
|
|
19
|
-
} = _ref,
|
|
20
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
-
if (IS_DEV) {
|
|
22
|
-
console.warn("Code component is deprecated. Use CodeSnippet component or inline `<code>` instead.");
|
|
23
|
-
}
|
|
24
|
-
if (inline) {
|
|
25
|
-
return /*#__PURE__*/React.createElement("code", _extends({
|
|
26
|
-
className: className
|
|
27
|
-
}, props), children);
|
|
28
|
-
} else {
|
|
29
|
-
var appearance = null;
|
|
30
|
-
if (numbered) {
|
|
31
|
-
appearance = CodeSnippetBlockAppearance.NUMBERED;
|
|
32
|
-
} else if (copyable) {
|
|
33
|
-
appearance = CodeSnippetBlockAppearance.LINUX_PROMPT;
|
|
34
|
-
}
|
|
35
|
-
return /*#__PURE__*/React.createElement(CodeSnippet, {
|
|
36
|
-
blocks: [{
|
|
37
|
-
appearance,
|
|
38
|
-
code: children
|
|
39
|
-
}]
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
Code.propTypes = {
|
|
44
|
-
children: _pt.string.isRequired,
|
|
45
|
-
inline: _pt.bool,
|
|
46
|
-
copyable: _pt.bool,
|
|
47
|
-
numbered: _pt.bool
|
|
48
|
-
};
|
|
49
|
-
export default Code;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./Code";
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
var _excluded = ["className", "blocks"];
|
|
2
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
5
|
-
import classNames from "classnames";
|
|
6
|
-
import React from "react";
|
|
7
|
-
import CodeSnippetBlock from "./CodeSnippetBlock";
|
|
8
|
-
/**
|
|
9
|
-
* This is a [React](https://reactjs.org/) component for the Vanilla [Code snippet](https://docs.vanillaframework.io/base/code#code-snippet).
|
|
10
|
-
*
|
|
11
|
-
* #### Blocks
|
|
12
|
-
*
|
|
13
|
-
* A single `CodeSnippet` component can render multiple separate code blocks. Blocks are provided as an array via the `blocks` prop. Each block object defines values of props for each code block of the snippet.
|
|
14
|
-
*/
|
|
15
|
-
export default function CodeSnippet(_ref) {
|
|
16
|
-
var {
|
|
17
|
-
className,
|
|
18
|
-
blocks
|
|
19
|
-
} = _ref,
|
|
20
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
22
|
-
className: classNames("p-code-snippet", {
|
|
23
|
-
"is-bordered": blocks.some(block => block.content)
|
|
24
|
-
}, className)
|
|
25
|
-
}, props), blocks.map((blockProps, i) => /*#__PURE__*/React.createElement(CodeSnippetBlock, _extends({
|
|
26
|
-
key: "code-snippet-block-".concat(i)
|
|
27
|
-
}, blockProps))));
|
|
28
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import classNames from "classnames";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import CodeSnippetDropdown from "./CodeSnippetDropdown";
|
|
5
|
-
export var CodeSnippetBlockAppearance = {
|
|
6
|
-
LINUX_PROMPT: "linuxPrompt",
|
|
7
|
-
NUMBERED: "numbered",
|
|
8
|
-
URL: "url",
|
|
9
|
-
WINDOWS_PROMPT: "windowsPrompt"
|
|
10
|
-
};
|
|
11
|
-
export default function CodeSnippetBlock(_ref) {
|
|
12
|
-
var {
|
|
13
|
-
appearance,
|
|
14
|
-
code,
|
|
15
|
-
content,
|
|
16
|
-
dropdowns,
|
|
17
|
-
stacked = false,
|
|
18
|
-
title,
|
|
19
|
-
wrapLines = false
|
|
20
|
-
} = _ref;
|
|
21
|
-
var className = "p-code-snippet__block";
|
|
22
|
-
var isNumbered = appearance === CodeSnippetBlockAppearance.NUMBERED;
|
|
23
|
-
var hasIcon = appearance === CodeSnippetBlockAppearance.LINUX_PROMPT || appearance === CodeSnippetBlockAppearance.WINDOWS_PROMPT || appearance === CodeSnippetBlockAppearance.URL;
|
|
24
|
-
var numberedCode;
|
|
25
|
-
if (isNumbered) {
|
|
26
|
-
className += "--numbered";
|
|
27
|
-
|
|
28
|
-
// wrap code lines in spans (and preserve the whitespace)
|
|
29
|
-
var lines;
|
|
30
|
-
if (Array.isArray(code)) {
|
|
31
|
-
lines = code;
|
|
32
|
-
} else if (typeof code === "string") {
|
|
33
|
-
lines = code.split(/\r?\n/);
|
|
34
|
-
} else {
|
|
35
|
-
// If the code is not able to be split over multiple lines, then display
|
|
36
|
-
// a single line number.
|
|
37
|
-
lines = [code];
|
|
38
|
-
}
|
|
39
|
-
numberedCode = lines.map((line, i) => /*#__PURE__*/React.createElement(React.Fragment, {
|
|
40
|
-
key: "p-code-snippet__line-".concat(i)
|
|
41
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
42
|
-
className: "p-code-snippet__line"
|
|
43
|
-
}, line), "\n"));
|
|
44
|
-
} else if (hasIcon) {
|
|
45
|
-
className += "--icon";
|
|
46
|
-
}
|
|
47
|
-
className = classNames(className, {
|
|
48
|
-
"is-windows-prompt": appearance === CodeSnippetBlockAppearance.WINDOWS_PROMPT,
|
|
49
|
-
"is-url": appearance === CodeSnippetBlockAppearance.URL,
|
|
50
|
-
"is-wrapped": wrapLines
|
|
51
|
-
});
|
|
52
|
-
var hasDropdowns = dropdowns && dropdowns.length;
|
|
53
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, (title || hasDropdowns) && /*#__PURE__*/React.createElement("div", {
|
|
54
|
-
className: "p-code-snippet__header ".concat(stacked ? "is-stacked" : "")
|
|
55
|
-
}, /*#__PURE__*/React.createElement("h5", {
|
|
56
|
-
className: "p-code-snippet__title"
|
|
57
|
-
}, title), hasDropdowns && /*#__PURE__*/React.createElement("div", {
|
|
58
|
-
className: "p-code-snippet__dropdowns"
|
|
59
|
-
}, dropdowns.map((dropdown, i) => /*#__PURE__*/React.createElement(CodeSnippetDropdown, _extends({}, dropdown, {
|
|
60
|
-
key: "code-snippet-dropdown-".concat(i)
|
|
61
|
-
}))))), /*#__PURE__*/React.createElement("pre", {
|
|
62
|
-
className: className
|
|
63
|
-
}, /*#__PURE__*/React.createElement("code", null, isNumbered ? numberedCode : code)), content);
|
|
64
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
var _excluded = ["options", "onChange"],
|
|
2
|
-
_excluded2 = ["label", "value"];
|
|
3
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
5
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
6
|
-
import React from "react";
|
|
7
|
-
export default function CodeSnippetDropdown(_ref) {
|
|
8
|
-
var {
|
|
9
|
-
options,
|
|
10
|
-
onChange
|
|
11
|
-
} = _ref,
|
|
12
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
13
|
-
return /*#__PURE__*/React.createElement("select", _extends({
|
|
14
|
-
className: "p-code-snippet__dropdown",
|
|
15
|
-
onChange: onChange
|
|
16
|
-
}, props), options.map(_ref2 => {
|
|
17
|
-
var {
|
|
18
|
-
label,
|
|
19
|
-
value
|
|
20
|
-
} = _ref2,
|
|
21
|
-
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
22
|
-
return /*#__PURE__*/React.createElement("option", _extends({
|
|
23
|
-
value: value,
|
|
24
|
-
key: value + "" || label
|
|
25
|
-
}, props), label);
|
|
26
|
-
}));
|
|
27
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
var _excluded = ["children", "className", "element", "emptyLarge", "emptyMedium", "emptySmall", "large", "medium", "size", "small"];
|
|
2
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
5
|
-
import classNames from "classnames";
|
|
6
|
-
import React from "react";
|
|
7
|
-
export var colSizes = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
8
|
-
/**
|
|
9
|
-
* This is a [React](https://reactjs.org/) component for use within the Vanilla [Grid](https://docs.vanillaframework.io/patterns/grid/).
|
|
10
|
-
*
|
|
11
|
-
* Vanilla has a responsive grid using a combination of rows and columns.
|
|
12
|
-
*/
|
|
13
|
-
var Col = _ref => {
|
|
14
|
-
var {
|
|
15
|
-
children,
|
|
16
|
-
className,
|
|
17
|
-
element: Component = "div",
|
|
18
|
-
emptyLarge,
|
|
19
|
-
emptyMedium,
|
|
20
|
-
emptySmall,
|
|
21
|
-
large,
|
|
22
|
-
medium,
|
|
23
|
-
size,
|
|
24
|
-
small
|
|
25
|
-
} = _ref,
|
|
26
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
27
|
-
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
28
|
-
className: classNames(className, "col-".concat(size), {
|
|
29
|
-
["col-small-".concat(small)]: !!small,
|
|
30
|
-
["col-medium-".concat(medium)]: !!medium,
|
|
31
|
-
["col-large-".concat(large)]: !!large,
|
|
32
|
-
["col-start-small-".concat(emptySmall)]: !!emptySmall,
|
|
33
|
-
["col-start-medium-".concat(emptyMedium)]: !!emptyMedium,
|
|
34
|
-
["col-start-large-".concat(emptyLarge)]: !!emptyLarge
|
|
35
|
-
})
|
|
36
|
-
}, props), children);
|
|
37
|
-
};
|
|
38
|
-
export default Col;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default, colSizes } from "./Col";
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
var _excluded = ["confirmationModalProps", "onHoverText", "shiftClickEnabled", "showShiftClickHint"];
|
|
2
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
5
|
-
import React from "react";
|
|
6
|
-
import ActionButton from "../ActionButton";
|
|
7
|
-
import ConfirmationModal from "../ConfirmationModal";
|
|
8
|
-
import usePortal from "react-useportal";
|
|
9
|
-
var generateTitle = title => {
|
|
10
|
-
if (typeof title === "string") {
|
|
11
|
-
return title;
|
|
12
|
-
}
|
|
13
|
-
if (typeof title === "number") {
|
|
14
|
-
return title.toString();
|
|
15
|
-
}
|
|
16
|
-
return null;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* `ConfirmationButton` is a specialised version of the [ActionButton](?path=/docs/actionbutton--default-story) component that uses a [ConfirmationModal](?path=/docs/confirmationmodal--default-story) to prompt a confirmation from the user before executing an action.
|
|
20
|
-
*/
|
|
21
|
-
export var ConfirmationButton = _ref => {
|
|
22
|
-
var {
|
|
23
|
-
confirmationModalProps,
|
|
24
|
-
onHoverText,
|
|
25
|
-
shiftClickEnabled = false,
|
|
26
|
-
showShiftClickHint = false
|
|
27
|
-
} = _ref,
|
|
28
|
-
actionButtonProps = _objectWithoutProperties(_ref, _excluded);
|
|
29
|
-
var {
|
|
30
|
-
openPortal,
|
|
31
|
-
closePortal,
|
|
32
|
-
isOpen,
|
|
33
|
-
Portal
|
|
34
|
-
} = usePortal();
|
|
35
|
-
var handleCancelModal = () => {
|
|
36
|
-
closePortal();
|
|
37
|
-
if (confirmationModalProps.close) {
|
|
38
|
-
confirmationModalProps.close();
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var handleConfirmModal = e => {
|
|
42
|
-
closePortal();
|
|
43
|
-
confirmationModalProps.onConfirm(e);
|
|
44
|
-
};
|
|
45
|
-
var handleShiftClick = e => {
|
|
46
|
-
if (e.shiftKey) {
|
|
47
|
-
confirmationModalProps.onConfirm(e);
|
|
48
|
-
} else {
|
|
49
|
-
openPortal(e);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, isOpen && /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(ConfirmationModal, _extends({}, confirmationModalProps, {
|
|
53
|
-
close: handleCancelModal,
|
|
54
|
-
confirmButtonLabel: confirmationModalProps.confirmButtonLabel,
|
|
55
|
-
onConfirm: handleConfirmModal
|
|
56
|
-
}), confirmationModalProps.children, showShiftClickHint && /*#__PURE__*/React.createElement("p", {
|
|
57
|
-
className: "p-text--small u-text--muted u-hide--small"
|
|
58
|
-
}, "Next time, you can skip this confirmation by holding", " ", /*#__PURE__*/React.createElement("code", null, "SHIFT"), " and clicking the action."))), /*#__PURE__*/React.createElement(ActionButton, _extends({}, actionButtonProps, {
|
|
59
|
-
onClick: shiftClickEnabled ? handleShiftClick : openPortal,
|
|
60
|
-
title: generateTitle(onHoverText !== null && onHoverText !== void 0 ? onHoverText : confirmationModalProps.confirmButtonLabel)
|
|
61
|
-
}), actionButtonProps.children));
|
|
62
|
-
};
|
|
63
|
-
export default ConfirmationButton;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./ConfirmationButton";
|