@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,62 @@
|
|
|
1
|
+
import type { ChangeEventHandler, HTMLProps, ReactNode } from "react";
|
|
2
|
+
import type { PropsWithSpread } from "../../types";
|
|
3
|
+
export declare const FILLED_COLOR = "#0066CC";
|
|
4
|
+
export declare const EMPTY_COLOR = "#D9D9D9";
|
|
5
|
+
export type Props = PropsWithSpread<{
|
|
6
|
+
/**
|
|
7
|
+
* Field caution message.
|
|
8
|
+
*/
|
|
9
|
+
caution?: ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Whether to disable the slider and input (if showInput is true).
|
|
12
|
+
*/
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Field error message.
|
|
16
|
+
*/
|
|
17
|
+
error?: ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Field help message.
|
|
20
|
+
*/
|
|
21
|
+
help?: ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Field id. Only passed to range input, not to number input.
|
|
24
|
+
*/
|
|
25
|
+
id?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Whether to disable only the input, but not the slider.
|
|
28
|
+
*/
|
|
29
|
+
inputDisabled?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Field label.
|
|
32
|
+
*/
|
|
33
|
+
label?: ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* Maximum value of the slider.
|
|
36
|
+
*/
|
|
37
|
+
max: number;
|
|
38
|
+
/**
|
|
39
|
+
* Minimum value of the slider.
|
|
40
|
+
*/
|
|
41
|
+
min: number;
|
|
42
|
+
/**
|
|
43
|
+
* Change event handler.
|
|
44
|
+
*/
|
|
45
|
+
onChange: ChangeEventHandler<HTMLInputElement>;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the field is required for the form to submit.
|
|
48
|
+
*/
|
|
49
|
+
required?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Whether to show a number input with the numerical value next to the slider.
|
|
52
|
+
*/
|
|
53
|
+
showInput?: boolean;
|
|
54
|
+
}, HTMLProps<HTMLInputElement>>;
|
|
55
|
+
/**
|
|
56
|
+
* This is the [React](https://reactjs.org/) component for the Vanilla [Slider](https://vanillaframework.io/docs/patterns/slider).
|
|
57
|
+
*
|
|
58
|
+
* Sliders should be used to let a user specify a numeric value between a defined
|
|
59
|
+
minimum and maximum value, however the precise value is not especially important.
|
|
60
|
+
*/
|
|
61
|
+
export declare const Slider: ({ caution, disabled, error, help, id, inputDisabled, label, max, min, onChange, required, showInput, ...inputProps }: Props) => JSX.Element;
|
|
62
|
+
export default Slider;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { HTMLProps } from "react";
|
|
2
|
+
import type { ClassName } from "../../types";
|
|
3
|
+
export type Props = {
|
|
4
|
+
/**
|
|
5
|
+
* Optional class(es) to pass to the wrapping span element.
|
|
6
|
+
*/
|
|
7
|
+
className?: ClassName;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the spinner should have a light appearance.
|
|
10
|
+
*/
|
|
11
|
+
isLight?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Text to display next to the spinner.
|
|
14
|
+
*/
|
|
15
|
+
text?: string;
|
|
16
|
+
/**
|
|
17
|
+
* What the role of the spinner should be.
|
|
18
|
+
*/
|
|
19
|
+
role?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The politeness setting of the spinner alert.
|
|
22
|
+
*/
|
|
23
|
+
ariaLive?: "assertive" | "off" | "polite";
|
|
24
|
+
} & HTMLProps<HTMLSpanElement>;
|
|
25
|
+
/**
|
|
26
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Spin](https://docs.vanillaframework.io/settings/animation-settings/#spin) animation.
|
|
27
|
+
*/
|
|
28
|
+
declare const Spinner: ({ className, text, isLight, ariaLive, role, ...props }: Props) => JSX.Element;
|
|
29
|
+
export default Spinner;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { HTMLProps, ReactNode } from "react";
|
|
2
|
+
import { ClassName, PropsWithSpread, ValueOf } from "../../types";
|
|
3
|
+
export declare const StatusLabelAppearance: {
|
|
4
|
+
readonly CAUTION: "caution";
|
|
5
|
+
readonly DEFAULT: "";
|
|
6
|
+
readonly INFORMATION: "information";
|
|
7
|
+
readonly NEGATIVE: "negative";
|
|
8
|
+
readonly POSITIVE: "positive";
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The type of the StatusLabel props.
|
|
12
|
+
*/
|
|
13
|
+
export type Props = PropsWithSpread<{
|
|
14
|
+
/**
|
|
15
|
+
* The appearance of the label.
|
|
16
|
+
*/
|
|
17
|
+
appearance?: ValueOf<typeof StatusLabelAppearance> | string;
|
|
18
|
+
/**
|
|
19
|
+
* The content of the label.
|
|
20
|
+
*/
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Optional class(es) to pass to the wrapping element.
|
|
24
|
+
*/
|
|
25
|
+
className?: ClassName;
|
|
26
|
+
}, HTMLProps<HTMLDivElement>>;
|
|
27
|
+
/**
|
|
28
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Label](https://vanillaframework.io/docs/patterns/labels).
|
|
29
|
+
*
|
|
30
|
+
* Labels are static elements which you can apply to signify status, tags or any other information you find useful.
|
|
31
|
+
*/
|
|
32
|
+
declare const StatusLabel: ({ appearance, children, className, ...labelProps }: Props) => JSX.Element;
|
|
33
|
+
export default StatusLabel;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { ElementType, HTMLProps, ReactNode } from "react";
|
|
2
|
+
import type { ColSize } from "../Col/Col";
|
|
3
|
+
import type { ClassName, PropsWithSpread } from "../../types";
|
|
4
|
+
export type Props = PropsWithSpread<{
|
|
5
|
+
/**
|
|
6
|
+
* The content of the strip.
|
|
7
|
+
*/
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* A background images for the strip.
|
|
11
|
+
*/
|
|
12
|
+
background?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the strip should display borders.
|
|
15
|
+
*/
|
|
16
|
+
bordered?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Optional classes for the strip.
|
|
19
|
+
*/
|
|
20
|
+
className?: ClassName;
|
|
21
|
+
/**
|
|
22
|
+
* The width of the column if `includeCol` has been set.
|
|
23
|
+
*/
|
|
24
|
+
colSize?: ColSize;
|
|
25
|
+
/**
|
|
26
|
+
* Whether the strip should be dark.
|
|
27
|
+
*/
|
|
28
|
+
dark?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Whether the strip should be deep.
|
|
31
|
+
*/
|
|
32
|
+
deep?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The base HTML element of the strip.
|
|
35
|
+
*/
|
|
36
|
+
element?: ElementType;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the strip should wrap the content in a column.
|
|
39
|
+
*/
|
|
40
|
+
includeCol?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Whether the strip should be light.
|
|
43
|
+
*/
|
|
44
|
+
light?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Optional classes to apply to the row.
|
|
47
|
+
*/
|
|
48
|
+
rowClassName?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Whether the strip should be shallow.
|
|
51
|
+
*/
|
|
52
|
+
shallow?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* The type of the strip (e.g. "accent" or "image").
|
|
55
|
+
*/
|
|
56
|
+
type?: string;
|
|
57
|
+
}, HTMLProps<HTMLElement>>;
|
|
58
|
+
/**
|
|
59
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Strip](https://docs.vanillaframework.io/patterns/strip/).
|
|
60
|
+
*
|
|
61
|
+
* The strip pattern provides a full width strip container in which to wrap a row.
|
|
62
|
+
*/
|
|
63
|
+
declare const Strip: ({ background, bordered, children, className, colSize, dark, deep, includeCol, element: Component, light, rowClassName, shallow, type, ...props }: Props) => JSX.Element;
|
|
64
|
+
export default Strip;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { MouseEventHandler } from "react";
|
|
2
|
+
import type { ClassName } from "../../types";
|
|
3
|
+
export type Props = {
|
|
4
|
+
/**
|
|
5
|
+
* Optional class(es) to pass to the wrapping element.
|
|
6
|
+
*/
|
|
7
|
+
className?: ClassName;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the summary button is loading.
|
|
10
|
+
*/
|
|
11
|
+
isLoading?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The label of the summary button.
|
|
14
|
+
*/
|
|
15
|
+
label: string;
|
|
16
|
+
/**
|
|
17
|
+
* Function to handle clicking the summary button.
|
|
18
|
+
*/
|
|
19
|
+
onClick: MouseEventHandler<HTMLButtonElement>;
|
|
20
|
+
/**
|
|
21
|
+
* The summary content.
|
|
22
|
+
*/
|
|
23
|
+
summary?: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* `SummaryButton` is a component to render a short summary with an action button. It's initial use case is a summary of table contents with action to load more items.
|
|
27
|
+
*/
|
|
28
|
+
declare const SummaryButton: ({ className, isLoading, summary, label, onClick, }: Props) => JSX.Element;
|
|
29
|
+
export default SummaryButton;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HTMLProps, ReactNode } from "react";
|
|
2
|
+
import type { PropsWithSpread } from "../../types";
|
|
3
|
+
export type Props = PropsWithSpread<{
|
|
4
|
+
/**
|
|
5
|
+
* The label name for the switch
|
|
6
|
+
*/
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the switch is disabled or not
|
|
10
|
+
*/
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}, HTMLProps<HTMLInputElement>>;
|
|
13
|
+
/**
|
|
14
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Switch](https://vanillaframework.io/docs/patterns/switch) component.
|
|
15
|
+
*/
|
|
16
|
+
export declare const Switch: ({ label, disabled, ...inputProps }: Props) => JSX.Element;
|
|
17
|
+
export default Switch;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { HTMLProps, ReactNode } from "react";
|
|
2
|
+
import type { ClassName, PropsWithSpread } from "../../types";
|
|
3
|
+
export type Props = PropsWithSpread<{
|
|
4
|
+
/**
|
|
5
|
+
* The content of the table.
|
|
6
|
+
*/
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Optional class(es) to pass to the wrapping table element.
|
|
10
|
+
*/
|
|
11
|
+
className?: ClassName;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the table can expand hidden cells.
|
|
14
|
+
*/
|
|
15
|
+
expanding?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the table should show card styling on smaller screens.
|
|
18
|
+
*/
|
|
19
|
+
responsive?: boolean;
|
|
20
|
+
}, HTMLProps<HTMLTableElement>>;
|
|
21
|
+
declare const Table: ({ children, className, expanding, responsive, ...props }: Props) => JSX.Element;
|
|
22
|
+
export default Table;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { HTMLProps, ReactNode } from "react";
|
|
2
|
+
import type { ClassName, PropsWithSpread } from "../../types";
|
|
3
|
+
export type Props = PropsWithSpread<{
|
|
4
|
+
/**
|
|
5
|
+
* The content of the table cell.
|
|
6
|
+
*/
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Optional class(es) to pass to the wrapping td element.
|
|
10
|
+
*/
|
|
11
|
+
className?: ClassName;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the cell is an expanded cell.
|
|
14
|
+
*/
|
|
15
|
+
expanding?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether content of the cell should be able to overflow, e.g. a dropdown.
|
|
18
|
+
*/
|
|
19
|
+
hasOverflow?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the cell is currently hidden.
|
|
22
|
+
*/
|
|
23
|
+
hidden?: boolean;
|
|
24
|
+
}, HTMLProps<HTMLTableCellElement>>;
|
|
25
|
+
declare const TableCell: ({ children, className, hasOverflow, expanding, hidden, role, ...props }: Props) => JSX.Element;
|
|
26
|
+
export default TableCell;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HTMLProps, ReactNode } from "react";
|
|
2
|
+
import { PropsWithSpread, SortDirection } from "../../types";
|
|
3
|
+
export type Props = PropsWithSpread<{
|
|
4
|
+
/**
|
|
5
|
+
* The content of the table header.
|
|
6
|
+
*/
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* The direction of sorting, if applicable.
|
|
10
|
+
*/
|
|
11
|
+
sort?: SortDirection;
|
|
12
|
+
}, HTMLProps<HTMLTableHeaderCellElement>>;
|
|
13
|
+
declare const TableHeader: ({ children, sort, ...props }: Props) => JSX.Element;
|
|
14
|
+
export default TableHeader;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import React, { HTMLAttributes, PropsWithChildren, ReactNode } from "react";
|
|
2
|
+
import "./TablePagination.scss";
|
|
3
|
+
export type BasePaginationProps = {
|
|
4
|
+
/**
|
|
5
|
+
* list of data elements to be paginated. This component is un-opinionated about
|
|
6
|
+
* the structure of the data but it should be identical to the data structure
|
|
7
|
+
* required by the child table component
|
|
8
|
+
*/
|
|
9
|
+
data: unknown[];
|
|
10
|
+
/**
|
|
11
|
+
* prop name of the child table component that receives paginated data.
|
|
12
|
+
* default value is set to `rows`, which is the data prop for the `MainTable` component
|
|
13
|
+
*/
|
|
14
|
+
dataForwardProp?: string;
|
|
15
|
+
/**
|
|
16
|
+
* the name of the item associated to each row within the table.
|
|
17
|
+
*/
|
|
18
|
+
itemName?: string;
|
|
19
|
+
/**
|
|
20
|
+
* custom styling for the pagination container
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
23
|
+
/**
|
|
24
|
+
* custom description to be displayed by the pagination
|
|
25
|
+
*/
|
|
26
|
+
description?: ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* custom per page limits express as an array of numbers.
|
|
29
|
+
*/
|
|
30
|
+
pageLimits?: number[];
|
|
31
|
+
/**
|
|
32
|
+
* place the pagination component above or below the table?
|
|
33
|
+
*/
|
|
34
|
+
position?: "above" | "below";
|
|
35
|
+
};
|
|
36
|
+
export type ExternalControlProps = BasePaginationProps & {
|
|
37
|
+
/**
|
|
38
|
+
* Whether the component will be controlled via external state.
|
|
39
|
+
*/
|
|
40
|
+
externallyControlled?: true;
|
|
41
|
+
/**
|
|
42
|
+
* the total number of items available within the data. This prop is only relevant
|
|
43
|
+
* and will be required if `externallyControlled` is set to `true`.
|
|
44
|
+
*/
|
|
45
|
+
totalItems: number;
|
|
46
|
+
/**
|
|
47
|
+
* the current page that's showing. This prop is only relevant and will be required
|
|
48
|
+
* if `externallyControlled` is set to `true`.
|
|
49
|
+
*/
|
|
50
|
+
currentPage: number;
|
|
51
|
+
/**
|
|
52
|
+
* size per page. This prop is only relevant and will be required if
|
|
53
|
+
* `externallyControlled` is set to `true`.
|
|
54
|
+
*/
|
|
55
|
+
pageSize: number;
|
|
56
|
+
/**
|
|
57
|
+
* callback indicating a page change event to the parent component.
|
|
58
|
+
* This prop is only relevant and will be required if `externallyControlled` is set
|
|
59
|
+
* to `true`.
|
|
60
|
+
*/
|
|
61
|
+
onPageChange: (page: number) => void;
|
|
62
|
+
/**
|
|
63
|
+
* callback indicating a page size change event to the parent component.
|
|
64
|
+
* This prop is only relevant and will be required if `externallyControlled` is set
|
|
65
|
+
* to `true`.
|
|
66
|
+
*/
|
|
67
|
+
onPageSizeChange: (pageSize: number) => void;
|
|
68
|
+
};
|
|
69
|
+
export type InternalControlProps = BasePaginationProps & {
|
|
70
|
+
/**
|
|
71
|
+
* Whether the component will be controlled via external state.
|
|
72
|
+
*/
|
|
73
|
+
externallyControlled?: false;
|
|
74
|
+
};
|
|
75
|
+
export type Props = PropsWithChildren<ExternalControlProps | InternalControlProps> & HTMLAttributes<HTMLDivElement>;
|
|
76
|
+
/**
|
|
77
|
+
This is an HOC [React](https://reactjs.org/) component for applying pagination to direct children components. This component is un-opinionated about
|
|
78
|
+
the structure of the input data and can be used with any child component that displays a list of data. However, the styling and behaviour of this component were designed
|
|
79
|
+
to work nicely with the `MainTable` component. To use this component, simply wrap a child component with it and provide the data that you want
|
|
80
|
+
to paginate to the `data` prop. This component will then pass the paged data to all <b>direct</b> child components via a child prop specified by `dataForwardProp`.
|
|
81
|
+
The component may be externally controlled, see following sections for detailed explanation.
|
|
82
|
+
|
|
83
|
+
#### Externally controlled pagination
|
|
84
|
+
|
|
85
|
+
For externally controlled mode, you will be responsible for the pagination logic and therefore the component will be purely presentational.
|
|
86
|
+
The pagination behaviour is controlled outside of this component. Note the data injection to child components is essentially a passthrough in this case.
|
|
87
|
+
To enable externally controlled mode for this component, set the `externallyControlled` prop to `true`. From there, it is your responsibility
|
|
88
|
+
to ensure that the following props `totalItems`, `currentPage`, `pageSize`, `onPageChange` and `onPageSizeChange` are set properly.
|
|
89
|
+
You can refer to the props table below on how to set these props.
|
|
90
|
+
|
|
91
|
+
#### Un-controlled pagination
|
|
92
|
+
|
|
93
|
+
In this mode, the component assumes that the input data is not paginated. The component will implement the pagination logic and apply it to the input data
|
|
94
|
+
then inject the paged data into direct child components. This is the default mode of operations for the component where `externallyControlled` prop is set
|
|
95
|
+
to `false`.
|
|
96
|
+
*/
|
|
97
|
+
declare const TablePagination: (props: Props) => React.JSX.Element;
|
|
98
|
+
export default TablePagination;
|
package/dist-types/components/TablePagination/TablePaginationControls/TablePaginationControls.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ButtonProps } from "../../Button";
|
|
2
|
+
import { HTMLAttributes } from "react";
|
|
3
|
+
import { BasePaginationProps, ExternalControlProps, InternalControlProps } from "../TablePagination";
|
|
4
|
+
export declare enum Label {
|
|
5
|
+
NEXT_PAGE = "Next page",
|
|
6
|
+
PREVIOUS_PAGE = "Previous page",
|
|
7
|
+
PAGE_NUMBER = "Page number"
|
|
8
|
+
}
|
|
9
|
+
export type AllProps = BasePaginationProps & InternalControlProps & ExternalControlProps;
|
|
10
|
+
export type Props = Omit<AllProps, "currentPage" | "data" | "dataForwardProp" | "externallyControlled" | "onPageChange" | "position" | "totalItems"> & {
|
|
11
|
+
currentPage?: AllProps["currentPage"];
|
|
12
|
+
displayDescription?: boolean;
|
|
13
|
+
onInputPageChange?: (page: number) => void;
|
|
14
|
+
nextButtonProps?: Partial<ButtonProps>;
|
|
15
|
+
onNextPage?: (page: number) => void;
|
|
16
|
+
onPageChange?: AllProps["onPageChange"];
|
|
17
|
+
onPreviousPage?: (page: number) => void;
|
|
18
|
+
previousButtonProps?: Partial<ButtonProps>;
|
|
19
|
+
totalItems?: AllProps["totalItems"];
|
|
20
|
+
visibleCount?: number;
|
|
21
|
+
showPageInput?: boolean;
|
|
22
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
23
|
+
declare const TablePaginationControls: ({ className, currentPage, description, displayDescription, onInputPageChange, itemName, nextButtonProps, onNextPage, onPageChange, onPageSizeChange, onPreviousPage, pageLimits, pageSize, previousButtonProps, showPageInput, totalItems, visibleCount, ...divProps }: Props) => JSX.Element;
|
|
24
|
+
export default TablePaginationControls;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Determine if we are working with a small screen.
|
|
4
|
+
* 'small screen' in this case is relative to the width of the description div
|
|
5
|
+
*/
|
|
6
|
+
export declare const figureSmallScreen: () => boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Iterate direct react child components and override the value of the prop specified by @param dataForwardProp
|
|
9
|
+
* for those child components.
|
|
10
|
+
* @param children - react node children to iterate
|
|
11
|
+
* @param dataForwardProp - the name of the prop from the children components to override
|
|
12
|
+
* @param data - actual data to be passed to the prop specified by @param dataForwardProp
|
|
13
|
+
*/
|
|
14
|
+
export declare const renderChildren: (children: ReactNode, dataForwardProp: string, data: unknown[]) => ReactElement<any, string | import("react").JSXElementConstructor<any>>[];
|
|
15
|
+
export declare const DEFAULT_PAGE_LIMITS: number[];
|
|
16
|
+
export declare const generatePagingOptions: (pageLimits: number[]) => {
|
|
17
|
+
value: number;
|
|
18
|
+
label: string;
|
|
19
|
+
}[];
|
|
20
|
+
export declare const getDescription: ({ description, isSmallScreen, totalItems, itemName, visibleCount, }: {
|
|
21
|
+
description: ReactNode;
|
|
22
|
+
isSmallScreen: boolean;
|
|
23
|
+
totalItems: number;
|
|
24
|
+
itemName: string;
|
|
25
|
+
visibleCount: number;
|
|
26
|
+
}) => string | number | true | ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode>;
|
|
27
|
+
export declare const useFigureSmallScreen: () => boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLProps, ReactNode } from "react";
|
|
2
|
+
import type { PropsWithSpread } from "../../types";
|
|
3
|
+
export type Props = PropsWithSpread<{
|
|
4
|
+
/**
|
|
5
|
+
* The content of the table row.
|
|
6
|
+
*/
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}, HTMLProps<HTMLTableRowElement>>;
|
|
9
|
+
declare const TableRow: ({ children, ...trProps }: Props) => JSX.Element;
|
|
10
|
+
export default TableRow;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { HTMLProps, ElementType, ReactNode, ComponentType } from "react";
|
|
2
|
+
import type { ClassName } from "../../types";
|
|
3
|
+
export type TabLink<P = null> = {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the tab link should have active styling.
|
|
6
|
+
*/
|
|
7
|
+
active?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Optional classes applied to the link element.
|
|
10
|
+
*/
|
|
11
|
+
className?: ClassName;
|
|
12
|
+
/**
|
|
13
|
+
* Optional component to be used instead of the default "a" element.
|
|
14
|
+
*/
|
|
15
|
+
component?: ElementType | ComponentType<P>;
|
|
16
|
+
/**
|
|
17
|
+
* Label to be displayed inside the tab link.
|
|
18
|
+
*/
|
|
19
|
+
label: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Optional classes applied to the "li" element.
|
|
22
|
+
*/
|
|
23
|
+
listItemClassName?: string;
|
|
24
|
+
} & (HTMLProps<HTMLElement> | P);
|
|
25
|
+
export type Props<P = null> = {
|
|
26
|
+
/**
|
|
27
|
+
* Optional classes applied to the parent "nav" element.
|
|
28
|
+
*/
|
|
29
|
+
className?: ClassName;
|
|
30
|
+
/**
|
|
31
|
+
* An array of tab link objects.
|
|
32
|
+
*/
|
|
33
|
+
links: TabLink<P>[];
|
|
34
|
+
/**
|
|
35
|
+
* Optional classes applied to the "ul" element.
|
|
36
|
+
*/
|
|
37
|
+
listClassName?: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* This is the [React](https://reactjs.org/) component for Vanilla [Tabs](https://vanillaframework.io/docs/patterns/tabs).
|
|
41
|
+
Tabs organise and allow navigation between groups of content that are related and at the same level
|
|
42
|
+
of hierarchy.
|
|
43
|
+
*/
|
|
44
|
+
declare const Tabs: <P>({ className, links, listClassName, }: Props<P>) => JSX.Element;
|
|
45
|
+
export default Tabs;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { TextareaHTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import type { ClassName, PropsWithSpread } from "../../types";
|
|
3
|
+
/**
|
|
4
|
+
* The props for the Textarea component.
|
|
5
|
+
*/
|
|
6
|
+
export type Props = PropsWithSpread<{
|
|
7
|
+
/**
|
|
8
|
+
* The content for caution validation.
|
|
9
|
+
*/
|
|
10
|
+
caution?: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Optional class(es) to pass to the textarea element.
|
|
13
|
+
*/
|
|
14
|
+
className?: ClassName;
|
|
15
|
+
/**
|
|
16
|
+
* The content for error validation.
|
|
17
|
+
*/
|
|
18
|
+
error?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the textarea should grow to fit the content automatically.
|
|
21
|
+
*/
|
|
22
|
+
grow?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Help text to show below the field.
|
|
25
|
+
*/
|
|
26
|
+
help?: ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* The id of the textarea.
|
|
29
|
+
*/
|
|
30
|
+
id?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The label for the field.
|
|
33
|
+
*/
|
|
34
|
+
label?: ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Optional class(es) to pass to the label component.
|
|
37
|
+
*/
|
|
38
|
+
labelClassName?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Whether the field is required.
|
|
41
|
+
*/
|
|
42
|
+
required?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Whether the form field should have a stacked appearance.
|
|
45
|
+
*/
|
|
46
|
+
stacked?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* The content for success validation.
|
|
49
|
+
*/
|
|
50
|
+
success?: ReactNode;
|
|
51
|
+
/**
|
|
52
|
+
* Whether to focus on the input on initial render.
|
|
53
|
+
*/
|
|
54
|
+
takeFocus?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Optional class(es) to pass to the wrapping Field component
|
|
57
|
+
*/
|
|
58
|
+
wrapperClassName?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Function to occur on keyboard event, 'CTRL + Enter'
|
|
61
|
+
*/
|
|
62
|
+
onControlEnter?: () => void;
|
|
63
|
+
}, TextareaHTMLAttributes<HTMLTextAreaElement>>;
|
|
64
|
+
/**
|
|
65
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Textarea](https://docs.vanillaframework.io/base/forms/#textarea).
|
|
66
|
+
*
|
|
67
|
+
* The Textarea component defines a multi-line text input control.
|
|
68
|
+
*/
|
|
69
|
+
declare const Textarea: ({ caution, className, error, grow, help, id, label, labelClassName, onKeyUp, onControlEnter, required, stacked, style, success, takeFocus, wrapperClassName, ...props }: Props) => JSX.Element;
|
|
70
|
+
export default Textarea;
|