@canonical/react-components 1.3.0 → 1.3.1
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/dist-esm/components/Accordion/Accordion.js +52 -0
- package/dist-esm/components/Accordion/AccordionSection/AccordionSection.js +47 -0
- package/dist-esm/components/Accordion/AccordionSection/index.js +1 -0
- package/dist-esm/components/Accordion/index.js +1 -0
- package/dist-esm/components/ActionButton/ActionButton.js +106 -0
- package/dist-esm/components/ActionButton/index.js +1 -0
- package/dist-esm/components/ApplicationLayout/AppAside/AppAside.js +29 -0
- package/dist-esm/components/ApplicationLayout/AppAside/index.js +1 -0
- package/dist-esm/components/ApplicationLayout/AppMain/AppMain.js +21 -0
- package/dist-esm/components/ApplicationLayout/AppMain/index.js +1 -0
- package/dist-esm/components/ApplicationLayout/AppNavigation/AppNavigation.js +31 -0
- package/dist-esm/components/ApplicationLayout/AppNavigation/index.js +1 -0
- package/dist-esm/components/ApplicationLayout/AppNavigationBar/AppNavigationBar.js +24 -0
- package/dist-esm/components/ApplicationLayout/AppNavigationBar/index.js +1 -0
- package/dist-esm/components/ApplicationLayout/AppStatus/AppStatus.js +21 -0
- package/dist-esm/components/ApplicationLayout/AppStatus/index.js +1 -0
- package/dist-esm/components/ApplicationLayout/Application/Application.js +22 -0
- package/dist-esm/components/ApplicationLayout/Application/index.js +1 -0
- package/dist-esm/components/ApplicationLayout/ApplicationLayout.js +113 -0
- package/dist-esm/components/ApplicationLayout/index.js +7 -0
- package/dist-esm/components/ArticlePagination/ArticlePagination.js +39 -0
- package/dist-esm/components/ArticlePagination/index.js +1 -0
- package/dist-esm/components/Badge/Badge.js +64 -0
- package/dist-esm/components/Badge/index.js +1 -0
- package/dist-esm/components/Button/Button.js +55 -0
- package/dist-esm/components/Button/index.js +1 -0
- package/dist-esm/components/Card/Card.js +45 -0
- package/dist-esm/components/Card/index.js +1 -0
- package/dist-esm/components/CheckboxInput/CheckableInput/CheckableInput.js +35 -0
- package/dist-esm/components/CheckboxInput/CheckableInput/index.js +1 -0
- package/dist-esm/components/CheckboxInput/CheckboxInput.js +24 -0
- package/dist-esm/components/CheckboxInput/index.js +1 -0
- package/dist-esm/components/Chip/Chip.js +81 -0
- package/dist-esm/components/Chip/index.js +1 -0
- package/dist-esm/components/Code/Code.js +49 -0
- package/dist-esm/components/Code/index.js +1 -0
- package/dist-esm/components/CodeSnippet/CodeSnippet.js +28 -0
- package/dist-esm/components/CodeSnippet/CodeSnippetBlock.js +64 -0
- package/dist-esm/components/CodeSnippet/CodeSnippetDropdown.js +27 -0
- package/dist-esm/components/CodeSnippet/index.js +2 -0
- package/dist-esm/components/Col/Col.js +38 -0
- package/dist-esm/components/Col/index.js +1 -0
- package/dist-esm/components/ConfirmationButton/ConfirmationButton.js +63 -0
- package/dist-esm/components/ConfirmationButton/index.js +1 -0
- package/dist-esm/components/ConfirmationModal/ConfirmationModal.js +47 -0
- package/dist-esm/components/ConfirmationModal/index.js +1 -0
- package/dist-esm/components/ContextualMenu/ContextualMenu.js +215 -0
- package/dist-esm/components/ContextualMenu/ContextualMenuDropdown/ContextualMenuDropdown.js +249 -0
- package/dist-esm/components/ContextualMenu/ContextualMenuDropdown/index.js +1 -0
- package/dist-esm/components/ContextualMenu/index.js +1 -0
- package/dist-esm/components/EmptyState/EmptyState.js +28 -0
- package/dist-esm/components/EmptyState/index.js +1 -0
- package/dist-esm/components/Field/Field.js +126 -0
- package/dist-esm/components/Field/index.js +1 -0
- package/dist-esm/components/Form/Form.js +28 -0
- package/dist-esm/components/Form/index.js +1 -0
- package/dist-esm/components/FormikField/FormikField.js +33 -0
- package/dist-esm/components/FormikField/index.js +1 -0
- package/dist-esm/components/Icon/Icon.js +61 -0
- package/dist-esm/components/Icon/index.js +1 -0
- package/dist-esm/components/Input/Input.js +103 -0
- package/dist-esm/components/Input/index.js +1 -0
- package/dist-esm/components/Label/Label.js +27 -0
- package/dist-esm/components/Label/index.js +1 -0
- package/dist-esm/components/Link/Link.js +37 -0
- package/dist-esm/components/Link/index.js +1 -0
- package/dist-esm/components/List/List.js +110 -0
- package/dist-esm/components/List/index.js +1 -0
- package/dist-esm/components/Loader/Loader.js +14 -0
- package/dist-esm/components/Loader/index.js +1 -0
- package/dist-esm/components/LoginPageLayout/LoginPageLayout.js +63 -0
- package/dist-esm/components/LoginPageLayout/index.js +1 -0
- package/dist-esm/components/MainTable/MainTable.js +211 -0
- package/dist-esm/components/MainTable/index.js +1 -0
- package/dist-esm/components/Modal/Modal.js +135 -0
- package/dist-esm/components/Modal/index.js +1 -0
- package/dist-esm/components/ModularTable/ModularTable.js +166 -0
- package/dist-esm/components/ModularTable/index.js +1 -0
- package/dist-esm/components/MultiSelect/FadeInDown/FadeInDown.js +25 -0
- package/dist-esm/components/MultiSelect/FadeInDown/index.js +1 -0
- package/dist-esm/components/MultiSelect/MultiSelect.js +308 -0
- package/dist-esm/components/MultiSelect/index.js +1 -0
- package/dist-esm/components/Navigation/Navigation.js +215 -0
- package/dist-esm/components/Navigation/NavigationLink/NavigationLink.js +58 -0
- package/dist-esm/components/Navigation/NavigationLink/index.js +1 -0
- package/dist-esm/components/Navigation/NavigationMenu/NavigationMenu.js +57 -0
- package/dist-esm/components/Navigation/NavigationMenu/index.js +1 -0
- package/dist-esm/components/Navigation/index.js +1 -0
- package/dist-esm/components/Navigation/types.js +1 -0
- package/dist-esm/components/Notification/Notification.js +119 -0
- package/dist-esm/components/Notification/index.js +1 -0
- package/dist-esm/components/NotificationProvider/NotificationProvider.js +83 -0
- package/dist-esm/components/NotificationProvider/index.js +2 -0
- package/dist-esm/components/NotificationProvider/messageBuilder.js +31 -0
- package/dist-esm/components/NotificationProvider/types.js +1 -0
- package/dist-esm/components/Pagination/Pagination.js +173 -0
- package/dist-esm/components/Pagination/PaginationButton/PaginationButton.js +31 -0
- package/dist-esm/components/Pagination/PaginationButton/index.js +1 -0
- package/dist-esm/components/Pagination/PaginationItem/PaginationItem.js +20 -0
- package/dist-esm/components/Pagination/PaginationItem/index.js +1 -0
- package/dist-esm/components/Pagination/index.js +1 -0
- package/dist-esm/components/Panel/Panel.js +89 -0
- package/dist-esm/components/Panel/index.js +1 -0
- package/dist-esm/components/PasswordToggle/PasswordToggle.js +90 -0
- package/dist-esm/components/PasswordToggle/index.js +1 -0
- package/dist-esm/components/RadioInput/RadioInput.js +22 -0
- package/dist-esm/components/RadioInput/index.js +1 -0
- package/dist-esm/components/Row/Row.js +22 -0
- package/dist-esm/components/Row/index.js +1 -0
- package/dist-esm/components/SearchAndFilter/FilterPanelSection/FilterPanelSection.js +107 -0
- package/dist-esm/components/SearchAndFilter/FilterPanelSection/index.js +1 -0
- package/dist-esm/components/SearchAndFilter/SearchAndFilter.js +286 -0
- package/dist-esm/components/SearchAndFilter/index.js +1 -0
- package/dist-esm/components/SearchAndFilter/types.js +1 -0
- package/dist-esm/components/SearchAndFilter/utils.js +22 -0
- package/dist-esm/components/SearchBox/SearchBox.js +95 -0
- package/dist-esm/components/SearchBox/index.js +1 -0
- package/dist-esm/components/Select/Select.js +84 -0
- package/dist-esm/components/Select/index.js +1 -0
- package/dist-esm/components/SideNavigation/SideNavigation.js +89 -0
- package/dist-esm/components/SideNavigation/SideNavigationBase/SideNavigationBase.js +31 -0
- package/dist-esm/components/SideNavigation/SideNavigationBase/index.js +1 -0
- package/dist-esm/components/SideNavigation/SideNavigationItem/SideNavigationItem.js +32 -0
- package/dist-esm/components/SideNavigation/SideNavigationItem/index.js +1 -0
- package/dist-esm/components/SideNavigation/SideNavigationLink/SideNavigationLink.js +25 -0
- package/dist-esm/components/SideNavigation/SideNavigationLink/index.js +1 -0
- package/dist-esm/components/SideNavigation/SideNavigationText/SideNavigationText.js +20 -0
- package/dist-esm/components/SideNavigation/SideNavigationText/index.js +1 -0
- package/dist-esm/components/SideNavigation/index.js +4 -0
- package/dist-esm/components/Slider/Slider.js +83 -0
- package/dist-esm/components/Slider/index.js +1 -0
- package/dist-esm/components/Spinner/Spinner.js +36 -0
- package/dist-esm/components/Spinner/index.js +1 -0
- package/dist-esm/components/StatusLabel/StatusLabel.js +36 -0
- package/dist-esm/components/StatusLabel/index.js +1 -0
- package/dist-esm/components/Strip/Strip.js +50 -0
- package/dist-esm/components/Strip/index.js +1 -0
- package/dist-esm/components/SummaryButton/SummaryButton.js +28 -0
- package/dist-esm/components/SummaryButton/index.js +1 -0
- package/dist-esm/components/Switch/Switch.js +28 -0
- package/dist-esm/components/Switch/index.js +1 -0
- package/dist-esm/components/Table/Table.js +23 -0
- package/dist-esm/components/Table/index.js +1 -0
- package/dist-esm/components/TableCell/TableCell.js +26 -0
- package/dist-esm/components/TableCell/index.js +1 -0
- package/dist-esm/components/TableHeader/TableHeader.js +17 -0
- package/dist-esm/components/TableHeader/index.js +1 -0
- package/dist-esm/components/TablePagination/TablePagination.js +104 -0
- package/dist-esm/components/TablePagination/TablePaginationControls/TablePaginationControls.js +120 -0
- package/dist-esm/components/TablePagination/TablePaginationControls/index.js +1 -0
- package/dist-esm/components/TablePagination/index.js +1 -0
- package/dist-esm/components/TablePagination/utils.js +67 -0
- package/dist-esm/components/TableRow/TableRow.js +15 -0
- package/dist-esm/components/TableRow/index.js +1 -0
- package/dist-esm/components/Tabs/Tabs.js +42 -0
- package/dist-esm/components/Tabs/index.js +1 -0
- package/dist-esm/components/Textarea/Textarea.js +115 -0
- package/dist-esm/components/Textarea/index.js +1 -0
- package/dist-esm/components/Tooltip/Tooltip.js +245 -0
- package/dist-esm/components/Tooltip/index.js +1 -0
- package/dist-esm/enums.js +8 -0
- package/dist-esm/hooks/index.js +8 -0
- package/dist-esm/hooks/useId.js +13 -0
- package/dist-esm/hooks/useListener.js +51 -0
- package/dist-esm/hooks/useOnClickOutside.js +38 -0
- package/dist-esm/hooks/useOnEscapePressed.js +25 -0
- package/dist-esm/hooks/usePagination.js +45 -0
- package/dist-esm/hooks/usePrevious.js +16 -0
- package/dist-esm/hooks/useThrottle.js +49 -0
- package/dist-esm/hooks/useWindowFitment.js +109 -0
- package/dist-esm/index.js +69 -0
- package/dist-esm/types/index.js +1 -0
- package/dist-esm/types/react-table-config.d.js +1 -0
- package/dist-esm/utils.js +41 -0
- package/dist-types/components/Accordion/Accordion.d.ts +46 -0
- package/dist-types/components/Accordion/AccordionSection/AccordionSection.d.ts +34 -0
- package/dist-types/components/Accordion/AccordionSection/index.d.ts +2 -0
- package/dist-types/components/Accordion/index.d.ts +2 -0
- package/dist-types/components/ActionButton/ActionButton.d.ts +48 -0
- package/dist-types/components/ActionButton/index.d.ts +2 -0
- package/dist-types/components/ApplicationLayout/AppAside/AppAside.d.ts +33 -0
- package/dist-types/components/ApplicationLayout/AppAside/index.d.ts +2 -0
- package/dist-types/components/ApplicationLayout/AppMain/AppMain.d.ts +14 -0
- package/dist-types/components/ApplicationLayout/AppMain/index.d.ts +2 -0
- package/dist-types/components/ApplicationLayout/AppNavigation/AppNavigation.d.ts +26 -0
- package/dist-types/components/ApplicationLayout/AppNavigation/index.d.ts +2 -0
- package/dist-types/components/ApplicationLayout/AppNavigationBar/AppNavigationBar.d.ts +18 -0
- package/dist-types/components/ApplicationLayout/AppNavigationBar/index.d.ts +2 -0
- package/dist-types/components/ApplicationLayout/AppStatus/AppStatus.d.ts +14 -0
- package/dist-types/components/ApplicationLayout/AppStatus/index.d.ts +2 -0
- package/dist-types/components/ApplicationLayout/Application/Application.d.ts +15 -0
- package/dist-types/components/ApplicationLayout/Application/index.d.ts +2 -0
- package/dist-types/components/ApplicationLayout/ApplicationLayout.d.ts +89 -0
- package/dist-types/components/ApplicationLayout/index.d.ts +7 -0
- package/dist-types/components/ArticlePagination/ArticlePagination.d.ts +31 -0
- package/dist-types/components/ArticlePagination/index.d.ts +2 -0
- package/dist-types/components/Badge/Badge.d.ts +34 -0
- package/dist-types/components/Badge/index.d.ts +2 -0
- package/dist-types/components/Button/Button.d.ts +64 -0
- package/dist-types/components/Button/index.d.ts +2 -0
- package/dist-types/components/Card/Card.d.ts +35 -0
- package/dist-types/components/Card/index.d.ts +2 -0
- package/dist-types/components/CheckboxInput/CheckableInput/CheckableInput.d.ts +27 -0
- package/dist-types/components/CheckboxInput/CheckableInput/index.d.ts +2 -0
- package/dist-types/components/CheckboxInput/CheckboxInput.d.ts +9 -0
- package/dist-types/components/CheckboxInput/index.d.ts +2 -0
- package/dist-types/components/Chip/Chip.d.ts +56 -0
- package/dist-types/components/Chip/index.d.ts +2 -0
- package/dist-types/components/Code/Code.d.ts +13 -0
- package/dist-types/components/Code/index.d.ts +2 -0
- package/dist-types/components/CodeSnippet/CodeSnippet.d.ts +21 -0
- package/dist-types/components/CodeSnippet/CodeSnippetBlock.d.ts +40 -0
- package/dist-types/components/CodeSnippet/CodeSnippetDropdown.d.ts +18 -0
- package/dist-types/components/CodeSnippet/index.d.ts +5 -0
- package/dist-types/components/Col/Col.d.ts +53 -0
- package/dist-types/components/Col/index.d.ts +2 -0
- package/dist-types/components/ConfirmationButton/ConfirmationButton.d.ts +28 -0
- package/dist-types/components/ConfirmationButton/index.d.ts +2 -0
- package/dist-types/components/ConfirmationModal/ConfirmationModal.d.ts +53 -0
- package/dist-types/components/ConfirmationModal/index.d.ts +2 -0
- package/dist-types/components/ContextualMenu/ContextualMenu.d.ts +110 -0
- package/dist-types/components/ContextualMenu/ContextualMenuDropdown/ContextualMenuDropdown.d.ts +43 -0
- package/dist-types/components/ContextualMenu/ContextualMenuDropdown/index.d.ts +2 -0
- package/dist-types/components/ContextualMenu/index.d.ts +3 -0
- package/dist-types/components/EmptyState/EmptyState.d.ts +25 -0
- package/dist-types/components/EmptyState/index.d.ts +2 -0
- package/dist-types/components/Field/Field.d.ts +77 -0
- package/dist-types/components/Field/index.d.ts +2 -0
- package/dist-types/components/Form/Form.d.ts +21 -0
- package/dist-types/components/Form/index.d.ts +2 -0
- package/dist-types/components/FormikField/FormikField.d.ts +25 -0
- package/dist-types/components/FormikField/index.d.ts +1 -0
- package/dist-types/components/Icon/Icon.d.ts +59 -0
- package/dist-types/components/Icon/index.d.ts +2 -0
- package/dist-types/components/Input/Input.d.ts +70 -0
- package/dist-types/components/Input/index.d.ts +2 -0
- package/dist-types/components/Label/Label.d.ts +25 -0
- package/dist-types/components/Label/index.d.ts +2 -0
- package/dist-types/components/Link/Link.d.ts +31 -0
- package/dist-types/components/Link/index.d.ts +2 -0
- package/dist-types/components/List/List.d.ts +36 -0
- package/dist-types/components/List/index.d.ts +2 -0
- package/dist-types/components/Loader/Loader.d.ts +6 -0
- package/dist-types/components/Loader/index.d.ts +1 -0
- package/dist-types/components/LoginPageLayout/LoginPageLayout.d.ts +17 -0
- package/dist-types/components/LoginPageLayout/index.d.ts +2 -0
- package/dist-types/components/MainTable/MainTable.d.ts +102 -0
- package/dist-types/components/MainTable/index.d.ts +2 -0
- package/dist-types/components/Modal/Modal.d.ts +36 -0
- package/dist-types/components/Modal/index.d.ts +2 -0
- package/dist-types/components/ModularTable/ModularTable.d.ts +105 -0
- package/dist-types/components/ModularTable/index.d.ts +2 -0
- package/dist-types/components/MultiSelect/FadeInDown/FadeInDown.d.ts +10 -0
- package/dist-types/components/MultiSelect/FadeInDown/index.d.ts +1 -0
- package/dist-types/components/MultiSelect/MultiSelect.d.ts +57 -0
- package/dist-types/components/MultiSelect/index.d.ts +1 -0
- package/dist-types/components/Navigation/Navigation.d.ts +66 -0
- package/dist-types/components/Navigation/NavigationLink/NavigationLink.d.ts +10 -0
- package/dist-types/components/Navigation/NavigationLink/index.d.ts +1 -0
- package/dist-types/components/Navigation/NavigationMenu/NavigationMenu.d.ts +11 -0
- package/dist-types/components/Navigation/NavigationMenu/index.d.ts +1 -0
- package/dist-types/components/Navigation/index.d.ts +3 -0
- package/dist-types/components/Navigation/types.d.ts +64 -0
- package/dist-types/components/Notification/Notification.d.ts +110 -0
- package/dist-types/components/Notification/index.d.ts +2 -0
- package/dist-types/components/NotificationProvider/NotificationProvider.d.ts +5 -0
- package/dist-types/components/NotificationProvider/index.d.ts +3 -0
- package/dist-types/components/NotificationProvider/messageBuilder.d.ts +6 -0
- package/dist-types/components/NotificationProvider/types.d.ts +35 -0
- package/dist-types/components/Pagination/Pagination.d.ts +102 -0
- package/dist-types/components/Pagination/PaginationButton/PaginationButton.d.ts +30 -0
- package/dist-types/components/Pagination/PaginationButton/index.d.ts +2 -0
- package/dist-types/components/Pagination/PaginationItem/PaginationItem.d.ts +17 -0
- package/dist-types/components/Pagination/PaginationItem/index.d.ts +2 -0
- package/dist-types/components/Pagination/index.d.ts +2 -0
- package/dist-types/components/Panel/Panel.d.ts +123 -0
- package/dist-types/components/Panel/index.d.ts +1 -0
- package/dist-types/components/PasswordToggle/PasswordToggle.d.ts +108 -0
- package/dist-types/components/PasswordToggle/index.d.ts +2 -0
- package/dist-types/components/RadioInput/RadioInput.d.ts +9 -0
- package/dist-types/components/RadioInput/index.d.ts +2 -0
- package/dist-types/components/Row/Row.d.ts +19 -0
- package/dist-types/components/Row/index.d.ts +2 -0
- package/dist-types/components/SearchAndFilter/FilterPanelSection/FilterPanelSection.d.ts +25 -0
- package/dist-types/components/SearchAndFilter/FilterPanelSection/index.d.ts +1 -0
- package/dist-types/components/SearchAndFilter/SearchAndFilter.d.ts +33 -0
- package/dist-types/components/SearchAndFilter/index.d.ts +2 -0
- package/dist-types/components/SearchAndFilter/types.d.ts +11 -0
- package/dist-types/components/SearchAndFilter/utils.d.ts +13 -0
- package/dist-types/components/SearchBox/SearchBox.d.ts +63 -0
- package/dist-types/components/SearchBox/index.d.ts +2 -0
- package/dist-types/components/Select/Select.d.ts +71 -0
- package/dist-types/components/Select/index.d.ts +2 -0
- package/dist-types/components/SideNavigation/SideNavigation.d.ts +50 -0
- package/dist-types/components/SideNavigation/SideNavigationBase/SideNavigationBase.d.ts +31 -0
- package/dist-types/components/SideNavigation/SideNavigationBase/index.d.ts +1 -0
- package/dist-types/components/SideNavigation/SideNavigationItem/SideNavigationItem.d.ts +20 -0
- package/dist-types/components/SideNavigation/SideNavigationItem/index.d.ts +1 -0
- package/dist-types/components/SideNavigation/SideNavigationLink/SideNavigationLink.d.ts +18 -0
- package/dist-types/components/SideNavigation/SideNavigationLink/index.d.ts +1 -0
- package/dist-types/components/SideNavigation/SideNavigationText/SideNavigationText.d.ts +7 -0
- package/dist-types/components/SideNavigation/SideNavigationText/index.d.ts +1 -0
- package/dist-types/components/SideNavigation/index.d.ts +5 -0
- package/dist-types/components/Slider/Slider.d.ts +62 -0
- package/dist-types/components/Slider/index.d.ts +2 -0
- package/dist-types/components/Spinner/Spinner.d.ts +29 -0
- package/dist-types/components/Spinner/index.d.ts +2 -0
- package/dist-types/components/StatusLabel/StatusLabel.d.ts +33 -0
- package/dist-types/components/StatusLabel/index.d.ts +2 -0
- package/dist-types/components/Strip/Strip.d.ts +64 -0
- package/dist-types/components/Strip/index.d.ts +2 -0
- package/dist-types/components/SummaryButton/SummaryButton.d.ts +29 -0
- package/dist-types/components/SummaryButton/index.d.ts +2 -0
- package/dist-types/components/Switch/Switch.d.ts +17 -0
- package/dist-types/components/Switch/index.d.ts +2 -0
- package/dist-types/components/Table/Table.d.ts +22 -0
- package/dist-types/components/Table/index.d.ts +2 -0
- package/dist-types/components/TableCell/TableCell.d.ts +26 -0
- package/dist-types/components/TableCell/index.d.ts +2 -0
- package/dist-types/components/TableHeader/TableHeader.d.ts +14 -0
- package/dist-types/components/TableHeader/index.d.ts +2 -0
- package/dist-types/components/TablePagination/TablePagination.d.ts +98 -0
- package/dist-types/components/TablePagination/TablePaginationControls/TablePaginationControls.d.ts +24 -0
- package/dist-types/components/TablePagination/TablePaginationControls/index.d.ts +2 -0
- package/dist-types/components/TablePagination/index.d.ts +2 -0
- package/dist-types/components/TablePagination/utils.d.ts +27 -0
- package/dist-types/components/TableRow/TableRow.d.ts +10 -0
- package/dist-types/components/TableRow/index.d.ts +2 -0
- package/dist-types/components/Tabs/Tabs.d.ts +45 -0
- package/dist-types/components/Tabs/index.d.ts +2 -0
- package/dist-types/components/Textarea/Textarea.d.ts +70 -0
- package/dist-types/components/Textarea/index.d.ts +2 -0
- package/dist-types/components/Tooltip/Tooltip.d.ts +75 -0
- package/dist-types/components/Tooltip/index.d.ts +2 -0
- package/dist-types/enums.d.ts +13 -0
- package/dist-types/hooks/index.d.ts +9 -0
- package/dist-types/hooks/useId.d.ts +4 -0
- package/dist-types/hooks/useListener.d.ts +11 -0
- package/dist-types/hooks/useOnClickOutside.d.ts +12 -0
- package/dist-types/hooks/useOnEscapePressed.d.ts +6 -0
- package/dist-types/hooks/usePagination.d.ts +19 -0
- package/dist-types/hooks/usePrevious.d.ts +7 -0
- package/dist-types/hooks/useThrottle.d.ts +9 -0
- package/dist-types/hooks/useWindowFitment.d.ts +54 -0
- package/dist-types/index.d.ts +132 -0
- package/dist-types/types/index.d.ts +38 -0
- package/dist-types/utils.d.ts +27 -0
- package/package.json +3 -1
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { PropsWithSpread } from "../../types";
|
|
3
|
+
import type { ComponentType, ElementType, HTMLProps, PropsWithChildren, ReactNode } from "react";
|
|
4
|
+
import type { ExclusiveProps } from "../../types";
|
|
5
|
+
export type LogoDefaultElement = HTMLProps<HTMLAnchorElement>;
|
|
6
|
+
type PanelLogo<L = LogoDefaultElement> = ReactNode | PropsWithSpread<{
|
|
7
|
+
/**
|
|
8
|
+
* The url of the icon image.
|
|
9
|
+
*/
|
|
10
|
+
icon: string;
|
|
11
|
+
/**
|
|
12
|
+
* The alt text for the icon image.
|
|
13
|
+
*/
|
|
14
|
+
iconAlt?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The url of the name image.
|
|
17
|
+
*/
|
|
18
|
+
name: string;
|
|
19
|
+
/**
|
|
20
|
+
* The alt text for the name image.
|
|
21
|
+
*/
|
|
22
|
+
nameAlt?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The element or component to use for displaying the logo e.g. `a` or `NavLink`.
|
|
25
|
+
* @default a
|
|
26
|
+
*/
|
|
27
|
+
component?: ElementType | ComponentType<L>;
|
|
28
|
+
}, L>;
|
|
29
|
+
type PanelToggle = {
|
|
30
|
+
/**
|
|
31
|
+
* The panel toggle label.
|
|
32
|
+
*/
|
|
33
|
+
label: string;
|
|
34
|
+
/**
|
|
35
|
+
* The function to call when clicking the panel toggle.
|
|
36
|
+
*/
|
|
37
|
+
onClick: () => void;
|
|
38
|
+
};
|
|
39
|
+
type LogoProps<L = LogoDefaultElement> = {
|
|
40
|
+
/**
|
|
41
|
+
* The panel logo content or attributes.
|
|
42
|
+
*/
|
|
43
|
+
logo?: PanelLogo<L>;
|
|
44
|
+
};
|
|
45
|
+
type TitleProps = {
|
|
46
|
+
/**
|
|
47
|
+
* The panel title.
|
|
48
|
+
*/
|
|
49
|
+
title: ReactNode;
|
|
50
|
+
/**
|
|
51
|
+
* Classes to apply to the title element.
|
|
52
|
+
*/
|
|
53
|
+
titleClassName?: string;
|
|
54
|
+
/**
|
|
55
|
+
* The element to use for the panel title e.g. `h1`.
|
|
56
|
+
* @default h4
|
|
57
|
+
*/
|
|
58
|
+
titleComponent?: ElementType;
|
|
59
|
+
/**
|
|
60
|
+
* An ID for the title element.
|
|
61
|
+
*/
|
|
62
|
+
titleId?: string;
|
|
63
|
+
};
|
|
64
|
+
type HeaderProps<L = LogoDefaultElement> = ExclusiveProps<{
|
|
65
|
+
/**
|
|
66
|
+
* This prop can be used to replace the header area of the panel when the default implementation is not sufficient.
|
|
67
|
+
*/
|
|
68
|
+
header: ReactNode;
|
|
69
|
+
}, {
|
|
70
|
+
/**
|
|
71
|
+
* Content that will be displayed in the controls area.
|
|
72
|
+
*/
|
|
73
|
+
controls?: ReactNode;
|
|
74
|
+
/**
|
|
75
|
+
* Classes that will be applied to the controls element.
|
|
76
|
+
*/
|
|
77
|
+
controlsClassName?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Whether the header should be sticky.
|
|
80
|
+
*/
|
|
81
|
+
stickyHeader?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* The panel toggle attributes.
|
|
84
|
+
*/
|
|
85
|
+
toggle?: PanelToggle;
|
|
86
|
+
} & ExclusiveProps<LogoProps<L>, TitleProps>>;
|
|
87
|
+
export type Props<L = LogoDefaultElement> = {
|
|
88
|
+
/**
|
|
89
|
+
* The panel content.
|
|
90
|
+
*/
|
|
91
|
+
children?: PropsWithChildren["children"];
|
|
92
|
+
/**
|
|
93
|
+
* Classes that are applied to the content container (when using `wrapContent`).
|
|
94
|
+
*/
|
|
95
|
+
contentClassName?: string | null;
|
|
96
|
+
/**
|
|
97
|
+
* Classes that are applied to the top level panel element.
|
|
98
|
+
*/
|
|
99
|
+
className?: string | null;
|
|
100
|
+
/**
|
|
101
|
+
* Whether to use the dark theme.
|
|
102
|
+
*/
|
|
103
|
+
dark?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Whether the panel should wrap the content in the `p-panel__content` element.
|
|
106
|
+
* @default true
|
|
107
|
+
*/
|
|
108
|
+
wrapContent?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* A ref to pass to the top level panel element.
|
|
111
|
+
*/
|
|
112
|
+
forwardRef?: React.Ref<HTMLDivElement> | null;
|
|
113
|
+
} & HeaderProps<L>;
|
|
114
|
+
/**
|
|
115
|
+
* This is a [React](https://reactjs.org/) component for panels in the
|
|
116
|
+
* [Vanilla](https://vanillaframework.io/docs/) layouts.
|
|
117
|
+
*
|
|
118
|
+
* The Panel component can be used in many areas of the application layout. It
|
|
119
|
+
* can be the child element of `AppAside`, `AppMain`, `AppNavigation`, `AppNavigationBar`
|
|
120
|
+
* and `AppStatus`.
|
|
121
|
+
*/
|
|
122
|
+
declare const Panel: <L = LogoDefaultElement>({ forwardRef, children, className, contentClassName, controlsClassName, controls, dark, header, logo, stickyHeader, title, titleClassName, titleComponent: TitleComponent, titleId, toggle, wrapContent, ...props }: Props<L>) => React.JSX.Element;
|
|
123
|
+
export default Panel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, type Props as PanelProps, type LogoDefaultElement as PanelLogoDefaultElement, } from "./Panel";
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { InputHTMLAttributes, ReactNode } from "react";
|
|
3
|
+
import type { ClassName, PropsWithSpread } from "../../types";
|
|
4
|
+
export declare enum Label {
|
|
5
|
+
Hide = "Hide",
|
|
6
|
+
Show = "Show"
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The props for the Password Toggle component.
|
|
10
|
+
*/
|
|
11
|
+
export type Props = PropsWithSpread<{
|
|
12
|
+
/**
|
|
13
|
+
* The content for caution validation.
|
|
14
|
+
*/
|
|
15
|
+
caution?: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Optional class(es) to pass to the input element.
|
|
18
|
+
*/
|
|
19
|
+
className?: ClassName;
|
|
20
|
+
/**
|
|
21
|
+
* The content for error validation.
|
|
22
|
+
*/
|
|
23
|
+
error?: ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Help text to show below the field.
|
|
26
|
+
*/
|
|
27
|
+
help?: ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* The id of the input.
|
|
30
|
+
*/
|
|
31
|
+
id: string;
|
|
32
|
+
/**
|
|
33
|
+
* The label for the field.
|
|
34
|
+
*/
|
|
35
|
+
label?: ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the field is read only.
|
|
38
|
+
*/
|
|
39
|
+
readOnly?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the field is required.
|
|
42
|
+
*/
|
|
43
|
+
required?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* The content for success validation.
|
|
46
|
+
*/
|
|
47
|
+
success?: ReactNode;
|
|
48
|
+
/**
|
|
49
|
+
* The content for success validation.
|
|
50
|
+
*/
|
|
51
|
+
type?: "submit" | "reset" | "button";
|
|
52
|
+
/**
|
|
53
|
+
* Optional class(es) to pass to the wrapping Field component
|
|
54
|
+
*/
|
|
55
|
+
wrapperClassName?: string;
|
|
56
|
+
}, InputHTMLAttributes<HTMLInputElement>>;
|
|
57
|
+
/**
|
|
58
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Password Toggle](https://docs.vanillaframework.io/base/forms/#password-toggle).
|
|
59
|
+
*
|
|
60
|
+
* It can be used when an input needs to obscure its value, whilst giving the user a way to reveal it if needed.
|
|
61
|
+
*/
|
|
62
|
+
declare const PasswordToggle: React.ForwardRefExoticComponent<{
|
|
63
|
+
/**
|
|
64
|
+
* The content for caution validation.
|
|
65
|
+
*/
|
|
66
|
+
caution?: ReactNode;
|
|
67
|
+
/**
|
|
68
|
+
* Optional class(es) to pass to the input element.
|
|
69
|
+
*/
|
|
70
|
+
className?: ClassName;
|
|
71
|
+
/**
|
|
72
|
+
* The content for error validation.
|
|
73
|
+
*/
|
|
74
|
+
error?: ReactNode;
|
|
75
|
+
/**
|
|
76
|
+
* Help text to show below the field.
|
|
77
|
+
*/
|
|
78
|
+
help?: ReactNode;
|
|
79
|
+
/**
|
|
80
|
+
* The id of the input.
|
|
81
|
+
*/
|
|
82
|
+
id: string;
|
|
83
|
+
/**
|
|
84
|
+
* The label for the field.
|
|
85
|
+
*/
|
|
86
|
+
label?: ReactNode;
|
|
87
|
+
/**
|
|
88
|
+
* Whether the field is read only.
|
|
89
|
+
*/
|
|
90
|
+
readOnly?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Whether the field is required.
|
|
93
|
+
*/
|
|
94
|
+
required?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* The content for success validation.
|
|
97
|
+
*/
|
|
98
|
+
success?: ReactNode;
|
|
99
|
+
/**
|
|
100
|
+
* The content for success validation.
|
|
101
|
+
*/
|
|
102
|
+
type?: "submit" | "reset" | "button";
|
|
103
|
+
/**
|
|
104
|
+
* Optional class(es) to pass to the wrapping Field component
|
|
105
|
+
*/
|
|
106
|
+
wrapperClassName?: string;
|
|
107
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "className" | "error" | "label" | "id" | "type" | "readOnly" | "required" | "help" | "success" | "caution" | "wrapperClassName"> & React.RefAttributes<HTMLInputElement>>;
|
|
108
|
+
export default PasswordToggle;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CheckableInputProps } from "../CheckboxInput/CheckableInput";
|
|
2
|
+
export type Props = Omit<CheckableInputProps, "inputType">;
|
|
3
|
+
/**
|
|
4
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Radio input](https://docs.vanillaframework.io/base/forms#radio-button).
|
|
5
|
+
*
|
|
6
|
+
* Use radio buttons to select one of the given set of options.
|
|
7
|
+
*/
|
|
8
|
+
declare const RadioInput: ({ label, ...radioProps }: Props) => JSX.Element;
|
|
9
|
+
export default RadioInput;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { HTMLProps, ReactNode } from "react";
|
|
2
|
+
import type { ClassName, PropsWithSpread } from "../../types";
|
|
3
|
+
export type Props = PropsWithSpread<{
|
|
4
|
+
/**
|
|
5
|
+
* The content of the row.
|
|
6
|
+
*/
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Optional class(es) to pass to the wrapping div element.
|
|
10
|
+
*/
|
|
11
|
+
className?: ClassName;
|
|
12
|
+
}, HTMLProps<HTMLDivElement>>;
|
|
13
|
+
/**
|
|
14
|
+
* This is a [React](https://reactjs.org/) component for use within the Vanilla [Grid](https://docs.vanillaframework.io/patterns/grid/).
|
|
15
|
+
*
|
|
16
|
+
* Vanilla has a responsive grid using a combination of rows and columns.
|
|
17
|
+
*/
|
|
18
|
+
declare const Row: ({ children, className, ...props }: Props) => JSX.Element;
|
|
19
|
+
export default Row;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { SearchAndFilterChip, SearchAndFilterData } from "../types";
|
|
2
|
+
export type Props = {
|
|
3
|
+
/**
|
|
4
|
+
* The chip data to display in the panel.
|
|
5
|
+
*/
|
|
6
|
+
data: SearchAndFilterData;
|
|
7
|
+
/**
|
|
8
|
+
* The current search chips.
|
|
9
|
+
*/
|
|
10
|
+
searchData: SearchAndFilterChip[];
|
|
11
|
+
/**
|
|
12
|
+
* A search string.
|
|
13
|
+
*/
|
|
14
|
+
searchTerm: string;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the chips should be hidden.
|
|
17
|
+
*/
|
|
18
|
+
sectionHidden?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* A function to toggle whether a chip is selected.
|
|
21
|
+
*/
|
|
22
|
+
toggleSelected: (chip: SearchAndFilterChip) => void;
|
|
23
|
+
};
|
|
24
|
+
declare const FilterPanelSection: ({ data, searchData, searchTerm, sectionHidden, toggleSelected, }: Props) => JSX.Element;
|
|
25
|
+
export default FilterPanelSection;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./FilterPanelSection";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { SearchAndFilterChip, SearchAndFilterData } from "./types";
|
|
2
|
+
export declare enum Label {
|
|
3
|
+
AddFilter = "Add filter",
|
|
4
|
+
Clear = "Clear input",
|
|
5
|
+
SearchAndFilter = "Search and filter"
|
|
6
|
+
}
|
|
7
|
+
export type Props = {
|
|
8
|
+
/**
|
|
9
|
+
* A list of chips to initialise inside the input.
|
|
10
|
+
*/
|
|
11
|
+
existingSearchData?: SearchAndFilterChip[];
|
|
12
|
+
/**
|
|
13
|
+
* The data for the filter panel.
|
|
14
|
+
*/
|
|
15
|
+
filterPanelData: SearchAndFilterData[];
|
|
16
|
+
/**
|
|
17
|
+
* A function that is called when the search data changes.
|
|
18
|
+
*/
|
|
19
|
+
returnSearchData: (searchData: SearchAndFilterChip[]) => void;
|
|
20
|
+
/**
|
|
21
|
+
* A function that is called when the filter panel is shown/hidden.
|
|
22
|
+
*/
|
|
23
|
+
onPanelToggle?: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* A function that is called when the height of the search container changes.
|
|
26
|
+
*/
|
|
27
|
+
onExpandChange?: () => void;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* This component allows searching and filtering of large datasets.
|
|
31
|
+
*/
|
|
32
|
+
declare const SearchAndFilter: ({ existingSearchData, filterPanelData, returnSearchData, onPanelToggle, onExpandChange, ...props }: Props) => JSX.Element;
|
|
33
|
+
export default SearchAndFilter;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return number of overflowing chips given a row threshold
|
|
3
|
+
* @param {array} chips - An array of chips
|
|
4
|
+
* @param {Integer} overflowRowLimit - Number of rows to show before counting
|
|
5
|
+
* overflow
|
|
6
|
+
*/
|
|
7
|
+
export declare const overflowingChipsCount: (chips: any, overflowRowLimit: any) => number;
|
|
8
|
+
/**
|
|
9
|
+
* Check if supplied chip object already exists in searchData prop
|
|
10
|
+
* @param {Object} chip - A chip object {lead: 'foo', value: 'bar'}
|
|
11
|
+
* @param {Array} existingArr - An array of chip objects
|
|
12
|
+
*/
|
|
13
|
+
export declare const isChipInArray: (chip: any, existingArr: any) => any;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React, { HTMLProps } from "react";
|
|
2
|
+
import type { ClassName, PropsWithSpread } from "../../types";
|
|
3
|
+
export declare enum Label {
|
|
4
|
+
Clear = "Clear search field",
|
|
5
|
+
Search = "Search"
|
|
6
|
+
}
|
|
7
|
+
export type Props = PropsWithSpread<{
|
|
8
|
+
/**
|
|
9
|
+
* Whether autocomplete should be enabled for the search input.
|
|
10
|
+
*/
|
|
11
|
+
autocomplete?: "on" | "off";
|
|
12
|
+
/**
|
|
13
|
+
* Optional classes to pass to the form element.
|
|
14
|
+
*/
|
|
15
|
+
className?: ClassName;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the input and buttons should be disabled.
|
|
18
|
+
*/
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the input value will be controlled via external state.
|
|
22
|
+
*/
|
|
23
|
+
externallyControlled?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* A function that will be called when the input value changes.
|
|
26
|
+
*/
|
|
27
|
+
onChange?: (inputValue: string) => void;
|
|
28
|
+
/**
|
|
29
|
+
* A function that is called when the user clicks the search icon or presses enter
|
|
30
|
+
*/
|
|
31
|
+
onSearch?: (inputValue: string) => void;
|
|
32
|
+
/**
|
|
33
|
+
* A function that is called when the user clicks the reset icon
|
|
34
|
+
*/
|
|
35
|
+
onClear?: () => void;
|
|
36
|
+
/**
|
|
37
|
+
* A search input placeholder message.
|
|
38
|
+
*/
|
|
39
|
+
placeholder?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the search input should lose focus when searching.
|
|
42
|
+
*/
|
|
43
|
+
shouldBlurOnSearch?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Whether the search input should receive focus after pressing the reset button
|
|
46
|
+
*/
|
|
47
|
+
shouldRefocusAfterReset?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* A ref that is passed to the input element.
|
|
50
|
+
*/
|
|
51
|
+
ref?: string;
|
|
52
|
+
/**
|
|
53
|
+
* The value of the search input when the state is externally controlled.
|
|
54
|
+
*/
|
|
55
|
+
value?: string;
|
|
56
|
+
}, HTMLProps<HTMLInputElement>>;
|
|
57
|
+
/**
|
|
58
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [SearchBox](https://docs.vanillaframework.io/patterns/search-box/).
|
|
59
|
+
*
|
|
60
|
+
* Search boxes enable search functionality on a page and are typically used in a navigation bar. SearchBox elements should be wrapped within a form element that handles its own submit action.
|
|
61
|
+
*/
|
|
62
|
+
declare const SearchBox: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
63
|
+
export default SearchBox;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { ChangeEventHandler, ReactNode, OptionHTMLAttributes, SelectHTMLAttributes } from "react";
|
|
2
|
+
import type { ClassName, PropsWithSpread } from "../../types";
|
|
3
|
+
type Option = OptionHTMLAttributes<HTMLOptionElement>;
|
|
4
|
+
/**
|
|
5
|
+
* The props for the Select component.
|
|
6
|
+
*/
|
|
7
|
+
export type Props = PropsWithSpread<{
|
|
8
|
+
/**
|
|
9
|
+
* The content for caution validation.
|
|
10
|
+
*/
|
|
11
|
+
caution?: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Optional class(es) to pass to the input element.
|
|
14
|
+
*/
|
|
15
|
+
className?: ClassName;
|
|
16
|
+
/**
|
|
17
|
+
* The content for error validation.
|
|
18
|
+
*/
|
|
19
|
+
error?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Help text to show below the field.
|
|
22
|
+
*/
|
|
23
|
+
help?: ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* The id of the input.
|
|
26
|
+
*/
|
|
27
|
+
id?: string | null;
|
|
28
|
+
/**
|
|
29
|
+
* The label for the field.
|
|
30
|
+
*/
|
|
31
|
+
label?: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Optional class(es) to pass to the label component.
|
|
34
|
+
*/
|
|
35
|
+
labelClassName?: string | null;
|
|
36
|
+
/**
|
|
37
|
+
* Function to run when select value changes.
|
|
38
|
+
*/
|
|
39
|
+
onChange?: ChangeEventHandler<HTMLSelectElement> | null;
|
|
40
|
+
/**
|
|
41
|
+
* Array of options that the select can choose from.
|
|
42
|
+
*/
|
|
43
|
+
options?: Option[] | null;
|
|
44
|
+
/**
|
|
45
|
+
* Whether the field is required.
|
|
46
|
+
*/
|
|
47
|
+
required?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Whether the form field should have a stacked appearance.
|
|
50
|
+
*/
|
|
51
|
+
stacked?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* The content for success validation.
|
|
54
|
+
*/
|
|
55
|
+
success?: ReactNode;
|
|
56
|
+
/**
|
|
57
|
+
* Whether to focus on the input on initial render.
|
|
58
|
+
*/
|
|
59
|
+
takeFocus?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Optional class(es) to pass to the wrapping Field component
|
|
62
|
+
*/
|
|
63
|
+
wrapperClassName?: ClassName;
|
|
64
|
+
}, SelectHTMLAttributes<HTMLSelectElement>>;
|
|
65
|
+
/**
|
|
66
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Select](https://docs.vanillaframework.io/base/forms/#select).
|
|
67
|
+
*
|
|
68
|
+
* Use the Select component to create a drop-down list.
|
|
69
|
+
*/
|
|
70
|
+
declare const Select: ({ caution, className, error, help, id, label, labelClassName, onChange, options, required, stacked, success, takeFocus, wrapperClassName, ...selectProps }: Props) => JSX.Element;
|
|
71
|
+
export default Select;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React, { PropsWithChildren, ReactNode } from "react";
|
|
2
|
+
import type { PropsWithSpread } from "../../types";
|
|
3
|
+
import { type HTMLProps } from "react";
|
|
4
|
+
import type { SideNavigationItemProps } from "./SideNavigationItem";
|
|
5
|
+
import type { SideNavigationLinkDefaultElement, SideNavigationLinkProps } from "./SideNavigationLink";
|
|
6
|
+
export type NavItem<L = SideNavigationLinkDefaultElement> = SideNavigationItemProps<L> | ReactNode | null;
|
|
7
|
+
export type NavItemGroup<L = SideNavigationLinkDefaultElement> = NavItem<L>[];
|
|
8
|
+
export type NavGroup<L = SideNavigationLinkDefaultElement> = PropsWithSpread<{
|
|
9
|
+
/**
|
|
10
|
+
* The navigation items.
|
|
11
|
+
*/
|
|
12
|
+
items: NavItemGroup<L>;
|
|
13
|
+
}, HTMLProps<HTMLUListElement>>;
|
|
14
|
+
export type Props<L = SideNavigationLinkDefaultElement> = PropsWithSpread<{
|
|
15
|
+
/**
|
|
16
|
+
* The navigation content. This can be used instead of supplying `items`.
|
|
17
|
+
*/
|
|
18
|
+
children?: PropsWithChildren["children"];
|
|
19
|
+
/**
|
|
20
|
+
* Whether to use the dark theme.
|
|
21
|
+
*/
|
|
22
|
+
dark?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the navigation items contain icons.
|
|
25
|
+
*/
|
|
26
|
+
hasIcons?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* The navigation items.
|
|
29
|
+
*/
|
|
30
|
+
items?: (NavGroup<L> | null)[];
|
|
31
|
+
/**
|
|
32
|
+
* The component or element to use for the link elements e.g. `a` or `NavLink`.
|
|
33
|
+
* @default a
|
|
34
|
+
*/
|
|
35
|
+
linkComponent?: SideNavigationLinkProps["component"];
|
|
36
|
+
/**
|
|
37
|
+
* Classes to apply to the navigation list(s).
|
|
38
|
+
*/
|
|
39
|
+
listClassName?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Classes to apply to the nav element.
|
|
42
|
+
*/
|
|
43
|
+
navClassName?: string;
|
|
44
|
+
}, HTMLProps<HTMLDivElement>>;
|
|
45
|
+
/**
|
|
46
|
+
* This is a [React](https://reactjs.org/) component for side navigation, used
|
|
47
|
+
* in the [Vanilla](https://vanillaframework.io/docs/) layouts.
|
|
48
|
+
*/
|
|
49
|
+
declare const SideNavigation: <L = SideNavigationLinkDefaultElement>({ children, className, dark, hasIcons, items, linkComponent, listClassName, navClassName, ...props }: Props<L>) => React.JSX.Element;
|
|
50
|
+
export default SideNavigation;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { PropsWithSpread } from "../../../types";
|
|
3
|
+
import type { ComponentType, ElementType, ReactNode } from "react";
|
|
4
|
+
export type Props<C> = PropsWithSpread<{
|
|
5
|
+
/**
|
|
6
|
+
* The component or element to use for the element e.g. `span` or `NavLink`.
|
|
7
|
+
*/
|
|
8
|
+
component: ElementType | ComponentType<C>;
|
|
9
|
+
/**
|
|
10
|
+
* Whether to use the dark theme.
|
|
11
|
+
*/
|
|
12
|
+
dark?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* The navigation item's icon.
|
|
15
|
+
*/
|
|
16
|
+
icon?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The navigation item's label.
|
|
19
|
+
*/
|
|
20
|
+
label: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* The navigation item's status.
|
|
23
|
+
*/
|
|
24
|
+
status?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* A ref to pass to the element.
|
|
27
|
+
*/
|
|
28
|
+
forwardRef?: React.Ref<C> | null;
|
|
29
|
+
}, C>;
|
|
30
|
+
declare const SideNavigationBase: <C>({ component: Component, dark, icon, label, status, forwardRef, ...props }: Props<C>) => React.JSX.Element;
|
|
31
|
+
export default SideNavigationBase;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, type Props as SideNavigationBaseProps, } from "./SideNavigationBase";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { HTMLProps, PropsWithChildren } from "react";
|
|
3
|
+
import type { SideNavigationLinkProps } from "../SideNavigationLink";
|
|
4
|
+
import type { SideNavigationLinkDefaultElement } from "../SideNavigationLink";
|
|
5
|
+
import { SideNavigationTextProps } from "../SideNavigationText";
|
|
6
|
+
type ItemProps = {
|
|
7
|
+
/**
|
|
8
|
+
* The item content.
|
|
9
|
+
*/
|
|
10
|
+
children: NonNullable<PropsWithChildren["children"]>;
|
|
11
|
+
} & HTMLProps<HTMLLIElement>;
|
|
12
|
+
type ContentProps<L = SideNavigationLinkDefaultElement> = SideNavigationLinkProps<L> | (SideNavigationTextProps & {
|
|
13
|
+
/**
|
|
14
|
+
* Whether this should be a content-only item.
|
|
15
|
+
*/
|
|
16
|
+
nonInteractive: true;
|
|
17
|
+
});
|
|
18
|
+
export type Props<L = SideNavigationLinkDefaultElement> = ItemProps | ContentProps<L>;
|
|
19
|
+
declare const SideNavigationItem: <L = SideNavigationLinkDefaultElement>(props: Props<L>) => React.JSX.Element;
|
|
20
|
+
export default SideNavigationItem;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, type Props as SideNavigationItemProps, } from "./SideNavigationItem";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { HTMLProps } from "react";
|
|
3
|
+
import type { SideNavigationBaseProps } from "../SideNavigationBase";
|
|
4
|
+
import { PropsWithSpread } from "../../../types";
|
|
5
|
+
export type LinkDefaultElement = HTMLProps<HTMLAnchorElement>;
|
|
6
|
+
export type Props<L = LinkDefaultElement, E = HTMLAnchorElement> = PropsWithSpread<{
|
|
7
|
+
/**
|
|
8
|
+
* The component or element to use for the link element e.g. `a` or `NavLink`.
|
|
9
|
+
* @default a
|
|
10
|
+
*/
|
|
11
|
+
component?: SideNavigationBaseProps<L>["component"];
|
|
12
|
+
/**
|
|
13
|
+
* A ref to pass to the link element.
|
|
14
|
+
*/
|
|
15
|
+
forwardRef?: React.Ref<E> | null;
|
|
16
|
+
}, Omit<SideNavigationBaseProps<L>, "component">>;
|
|
17
|
+
declare const SideNavigationLink: <L = LinkDefaultElement, E = HTMLAnchorElement>({ component, forwardRef, ...props }: Props<L, E>) => React.JSX.Element;
|
|
18
|
+
export default SideNavigationLink;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, type LinkDefaultElement as SideNavigationLinkDefaultElement, type Props as SideNavigationLinkProps, } from "./SideNavigationLink";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { HTMLProps } from "react";
|
|
3
|
+
import type { SideNavigationBaseProps } from "../SideNavigationBase";
|
|
4
|
+
export type TextDefaultElement = HTMLProps<HTMLSpanElement>;
|
|
5
|
+
export type Props = Omit<SideNavigationBaseProps<TextDefaultElement>, "component" | "label">;
|
|
6
|
+
declare const SideNavigationText: ({ children, className, ...props }: Props) => React.JSX.Element;
|
|
7
|
+
export default SideNavigationText;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, type Props as SideNavigationTextProps, } from "./SideNavigationText";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default } from "./SideNavigation";
|
|
2
|
+
export type { Props as SideNavigationProps } from "./SideNavigation";
|
|
3
|
+
export { default as SideNavigationItem } from "./SideNavigationItem";
|
|
4
|
+
export { default as SideNavigationText } from "./SideNavigationText";
|
|
5
|
+
export { default as SideNavigationLink, type SideNavigationLinkDefaultElement, } from "./SideNavigationLink";
|