@canonical/react-components 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion/Accordion.d.ts +46 -0
- package/dist/components/Accordion/AccordionSection/AccordionSection.d.ts +34 -0
- package/dist/components/Accordion/AccordionSection/index.d.ts +2 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/ActionButton/ActionButton.d.ts +48 -0
- package/dist/components/ActionButton/index.d.ts +2 -0
- package/dist/components/ApplicationLayout/AppAside/AppAside.d.ts +33 -0
- package/dist/components/ApplicationLayout/AppAside/index.d.ts +2 -0
- package/dist/components/ApplicationLayout/AppMain/AppMain.d.ts +14 -0
- package/dist/components/ApplicationLayout/AppMain/index.d.ts +2 -0
- package/dist/components/ApplicationLayout/AppNavigation/AppNavigation.d.ts +26 -0
- package/dist/components/ApplicationLayout/AppNavigation/index.d.ts +2 -0
- package/dist/components/ApplicationLayout/AppNavigationBar/AppNavigationBar.d.ts +18 -0
- package/dist/components/ApplicationLayout/AppNavigationBar/index.d.ts +2 -0
- package/dist/components/ApplicationLayout/AppStatus/AppStatus.d.ts +14 -0
- package/dist/components/ApplicationLayout/AppStatus/index.d.ts +2 -0
- package/dist/components/ApplicationLayout/Application/Application.d.ts +15 -0
- package/dist/components/ApplicationLayout/Application/index.d.ts +2 -0
- package/dist/components/ApplicationLayout/ApplicationLayout.d.ts +89 -0
- package/dist/components/ApplicationLayout/index.d.ts +7 -0
- package/dist/components/ArticlePagination/ArticlePagination.d.ts +31 -0
- package/dist/components/ArticlePagination/index.d.ts +2 -0
- package/dist/components/Badge/Badge.d.ts +34 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +64 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Card/Card.d.ts +35 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/CheckboxInput/CheckableInput/CheckableInput.d.ts +27 -0
- package/dist/components/CheckboxInput/CheckableInput/index.d.ts +2 -0
- package/dist/components/CheckboxInput/CheckboxInput.d.ts +9 -0
- package/dist/components/CheckboxInput/index.d.ts +2 -0
- package/dist/components/Chip/Chip.d.ts +56 -0
- package/dist/components/Chip/index.d.ts +2 -0
- package/dist/components/Code/Code.d.ts +13 -0
- package/dist/components/Code/index.d.ts +2 -0
- package/dist/components/CodeSnippet/CodeSnippet.d.ts +21 -0
- package/dist/components/CodeSnippet/CodeSnippetBlock.d.ts +40 -0
- package/dist/components/CodeSnippet/CodeSnippetDropdown.d.ts +18 -0
- package/dist/components/CodeSnippet/index.d.ts +5 -0
- package/dist/components/Col/Col.d.ts +53 -0
- package/dist/components/Col/index.d.ts +2 -0
- package/dist/components/ConfirmationButton/ConfirmationButton.d.ts +28 -0
- package/dist/components/ConfirmationButton/index.d.ts +2 -0
- package/dist/components/ConfirmationModal/ConfirmationModal.d.ts +53 -0
- package/dist/components/ConfirmationModal/index.d.ts +2 -0
- package/dist/components/ContextualMenu/ContextualMenu.d.ts +110 -0
- package/dist/components/ContextualMenu/ContextualMenuDropdown/ContextualMenuDropdown.d.ts +43 -0
- package/dist/components/ContextualMenu/ContextualMenuDropdown/index.d.ts +2 -0
- package/dist/components/ContextualMenu/index.d.ts +3 -0
- package/dist/components/EmptyState/EmptyState.d.ts +25 -0
- package/dist/components/EmptyState/index.d.ts +2 -0
- package/dist/components/Field/Field.d.ts +77 -0
- package/dist/components/Field/index.d.ts +2 -0
- package/dist/components/Form/Form.d.ts +21 -0
- package/dist/components/Form/index.d.ts +2 -0
- package/dist/components/FormikField/FormikField.d.ts +25 -0
- package/dist/components/FormikField/index.d.ts +1 -0
- package/dist/components/Icon/Icon.d.ts +59 -0
- package/dist/components/Icon/index.d.ts +2 -0
- package/dist/components/Input/Input.d.ts +70 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Label/Label.d.ts +25 -0
- package/dist/components/Label/index.d.ts +2 -0
- package/dist/components/Link/Link.d.ts +31 -0
- package/dist/components/Link/index.d.ts +2 -0
- package/dist/components/List/List.d.ts +36 -0
- package/dist/components/List/index.d.ts +2 -0
- package/dist/components/Loader/Loader.d.ts +6 -0
- package/dist/components/Loader/index.d.ts +1 -0
- package/dist/components/LoginPageLayout/LoginPageLayout.d.ts +17 -0
- package/dist/components/LoginPageLayout/index.d.ts +2 -0
- package/dist/components/MainTable/MainTable.d.ts +102 -0
- package/dist/components/MainTable/index.d.ts +2 -0
- package/dist/components/Modal/Modal.d.ts +36 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/ModularTable/ModularTable.d.ts +105 -0
- package/dist/components/ModularTable/index.d.ts +2 -0
- package/dist/components/MultiSelect/FadeInDown/FadeInDown.d.ts +10 -0
- package/dist/components/MultiSelect/FadeInDown/index.d.ts +1 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +57 -0
- package/dist/components/MultiSelect/index.d.ts +1 -0
- package/dist/components/Navigation/Navigation.d.ts +66 -0
- package/dist/components/Navigation/NavigationLink/NavigationLink.d.ts +10 -0
- package/dist/components/Navigation/NavigationLink/index.d.ts +1 -0
- package/dist/components/Navigation/NavigationMenu/NavigationMenu.d.ts +11 -0
- package/dist/components/Navigation/NavigationMenu/index.d.ts +1 -0
- package/dist/components/Navigation/index.d.ts +3 -0
- package/dist/components/Navigation/types.d.ts +64 -0
- package/dist/components/Notification/Notification.d.ts +110 -0
- package/dist/components/Notification/index.d.ts +2 -0
- package/dist/components/NotificationProvider/NotificationProvider.d.ts +5 -0
- package/dist/components/NotificationProvider/index.d.ts +3 -0
- package/dist/components/NotificationProvider/messageBuilder.d.ts +6 -0
- package/dist/components/NotificationProvider/types.d.ts +35 -0
- package/dist/components/Pagination/Pagination.d.ts +102 -0
- package/dist/components/Pagination/PaginationButton/PaginationButton.d.ts +30 -0
- package/dist/components/Pagination/PaginationButton/index.d.ts +2 -0
- package/dist/components/Pagination/PaginationItem/PaginationItem.d.ts +17 -0
- package/dist/components/Pagination/PaginationItem/index.d.ts +2 -0
- package/dist/components/Pagination/index.d.ts +2 -0
- package/dist/components/Panel/Panel.d.ts +123 -0
- package/dist/components/Panel/index.d.ts +1 -0
- package/dist/components/PasswordToggle/PasswordToggle.d.ts +108 -0
- package/dist/components/PasswordToggle/index.d.ts +2 -0
- package/dist/components/RadioInput/RadioInput.d.ts +9 -0
- package/dist/components/RadioInput/index.d.ts +2 -0
- package/dist/components/Row/Row.d.ts +19 -0
- package/dist/components/Row/index.d.ts +2 -0
- package/dist/components/SearchAndFilter/FilterPanelSection/FilterPanelSection.d.ts +25 -0
- package/dist/components/SearchAndFilter/FilterPanelSection/index.d.ts +1 -0
- package/dist/components/SearchAndFilter/SearchAndFilter.d.ts +33 -0
- package/dist/components/SearchAndFilter/index.d.ts +2 -0
- package/dist/components/SearchAndFilter/types.d.ts +11 -0
- package/dist/components/SearchAndFilter/utils.d.ts +13 -0
- package/dist/components/SearchBox/SearchBox.d.ts +63 -0
- package/dist/components/SearchBox/index.d.ts +2 -0
- package/dist/components/Select/Select.d.ts +71 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/SideNavigation/SideNavigation.d.ts +50 -0
- package/dist/components/SideNavigation/SideNavigationBase/SideNavigationBase.d.ts +31 -0
- package/dist/components/SideNavigation/SideNavigationBase/index.d.ts +1 -0
- package/dist/components/SideNavigation/SideNavigationItem/SideNavigationItem.d.ts +20 -0
- package/dist/components/SideNavigation/SideNavigationItem/index.d.ts +1 -0
- package/dist/components/SideNavigation/SideNavigationLink/SideNavigationLink.d.ts +18 -0
- package/dist/components/SideNavigation/SideNavigationLink/index.d.ts +1 -0
- package/dist/components/SideNavigation/SideNavigationText/SideNavigationText.d.ts +7 -0
- package/dist/components/SideNavigation/SideNavigationText/index.d.ts +1 -0
- package/dist/components/SideNavigation/index.d.ts +5 -0
- package/dist/components/Slider/Slider.d.ts +62 -0
- package/dist/components/Slider/index.d.ts +2 -0
- package/dist/components/Spinner/Spinner.d.ts +29 -0
- package/dist/components/Spinner/index.d.ts +2 -0
- package/dist/components/StatusLabel/StatusLabel.d.ts +33 -0
- package/dist/components/StatusLabel/index.d.ts +2 -0
- package/dist/components/Strip/Strip.d.ts +64 -0
- package/dist/components/Strip/index.d.ts +2 -0
- package/dist/components/SummaryButton/SummaryButton.d.ts +29 -0
- package/dist/components/SummaryButton/index.d.ts +2 -0
- package/dist/components/Switch/Switch.d.ts +17 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Table/Table.d.ts +22 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/TableCell/TableCell.d.ts +26 -0
- package/dist/components/TableCell/index.d.ts +2 -0
- package/dist/components/TableHeader/TableHeader.d.ts +14 -0
- package/dist/components/TableHeader/index.d.ts +2 -0
- package/dist/components/TablePagination/TablePagination.d.ts +98 -0
- package/dist/components/TablePagination/TablePaginationControls/TablePaginationControls.d.ts +24 -0
- package/dist/components/TablePagination/TablePaginationControls/index.d.ts +2 -0
- package/dist/components/TablePagination/index.d.ts +2 -0
- package/dist/components/TablePagination/utils.d.ts +27 -0
- package/dist/components/TableRow/TableRow.d.ts +10 -0
- package/dist/components/TableRow/index.d.ts +2 -0
- package/dist/components/Tabs/Tabs.d.ts +45 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Textarea/Textarea.d.ts +70 -0
- package/dist/components/Textarea/index.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.d.ts +75 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/enums.d.ts +13 -0
- package/dist/hooks/index.d.ts +9 -0
- package/dist/hooks/useId.d.ts +4 -0
- package/dist/hooks/useListener.d.ts +11 -0
- package/dist/hooks/useOnClickOutside.d.ts +12 -0
- package/dist/hooks/useOnEscapePressed.d.ts +6 -0
- package/dist/hooks/usePagination.d.ts +19 -0
- package/dist/hooks/usePrevious.d.ts +7 -0
- package/dist/hooks/useThrottle.d.ts +9 -0
- package/dist/hooks/useWindowFitment.d.ts +54 -0
- package/dist/index.d.ts +132 -0
- package/dist/types/index.d.ts +38 -0
- package/dist/utils.d.ts +27 -0
- package/package.json +9 -10
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { HTMLProps } from "react";
|
|
2
|
+
import type { AccordionHeadings, AccordionSectionProps } from "./AccordionSection";
|
|
3
|
+
import type { ClassName, PropsWithSpread } from "../../types";
|
|
4
|
+
export type Section = AccordionSectionProps & {
|
|
5
|
+
/**
|
|
6
|
+
* An optional key for the section component. It will also be
|
|
7
|
+
* used to track which section is selected.
|
|
8
|
+
*/
|
|
9
|
+
key?: string | number;
|
|
10
|
+
};
|
|
11
|
+
export type Props = PropsWithSpread<{
|
|
12
|
+
/**
|
|
13
|
+
* Optional classes applied to the parent element.
|
|
14
|
+
*/
|
|
15
|
+
className?: ClassName;
|
|
16
|
+
/**
|
|
17
|
+
* An optional value to set the expanded section. The value must match a
|
|
18
|
+
* section key. This value will only set the expanded section on first render
|
|
19
|
+
* if externallyControlled is not set to `true`.
|
|
20
|
+
*/
|
|
21
|
+
expanded?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the expanded section will be controlled via external state.
|
|
24
|
+
*/
|
|
25
|
+
externallyControlled?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Optional function that is called when the expanded section is changed.
|
|
28
|
+
* The function is provided the section title or null.
|
|
29
|
+
*/
|
|
30
|
+
onExpandedChange?: (id: string, title: string) => void;
|
|
31
|
+
/**
|
|
32
|
+
* An array of sections and content.
|
|
33
|
+
*/
|
|
34
|
+
sections: Section[];
|
|
35
|
+
/**
|
|
36
|
+
* Optional string describing heading element that should be used for the section titles.
|
|
37
|
+
*/
|
|
38
|
+
titleElement?: AccordionHeadings;
|
|
39
|
+
}, HTMLProps<HTMLElement>>;
|
|
40
|
+
/**
|
|
41
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Accordion](https://docs.vanillaframework.io/patterns/accordion/).
|
|
42
|
+
*
|
|
43
|
+
* The sidebar accordion, used in listing pages or as navigation, can hold multiple navigation items or to be used as a filter for content.
|
|
44
|
+
*/
|
|
45
|
+
declare const Accordion: ({ className, expanded, externallyControlled, onExpandedChange, sections, titleElement, ...asideProps }: Props) => JSX.Element;
|
|
46
|
+
export default Accordion;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { Headings } from "../../../types";
|
|
3
|
+
export type AccordionHeadings = Exclude<Headings, "h1">;
|
|
4
|
+
export type Props = {
|
|
5
|
+
/**
|
|
6
|
+
* The content of the section.
|
|
7
|
+
*/
|
|
8
|
+
content?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* An optional value to set the expanded section. The value must match a
|
|
11
|
+
* section key.
|
|
12
|
+
*/
|
|
13
|
+
expanded?: string | null;
|
|
14
|
+
headingLevel?: number;
|
|
15
|
+
/**
|
|
16
|
+
* An optional click event when the title is clicked.
|
|
17
|
+
*/
|
|
18
|
+
onTitleClick?: (expanded: boolean, key: string) => void;
|
|
19
|
+
/**
|
|
20
|
+
* An optional key to be used to track which section is selected.
|
|
21
|
+
*/
|
|
22
|
+
sectionKey?: string;
|
|
23
|
+
setExpanded?: (key: string | null, title: ReactNode | null) => void;
|
|
24
|
+
/**
|
|
25
|
+
* The title of the section.
|
|
26
|
+
*/
|
|
27
|
+
title?: ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Optional string describing heading element that should be used for the section titles.
|
|
30
|
+
*/
|
|
31
|
+
titleElement?: AccordionHeadings;
|
|
32
|
+
};
|
|
33
|
+
declare const AccordionSection: ({ content, expanded, onTitleClick, sectionKey, setExpanded, title, titleElement, headingLevel, }: Props) => JSX.Element;
|
|
34
|
+
export default AccordionSection;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import type { ButtonProps } from "../Button";
|
|
3
|
+
import type { ClassName, PropsWithSpread } from "../../types";
|
|
4
|
+
export declare const LOADER_MIN_DURATION = 400;
|
|
5
|
+
export declare const SUCCESS_DURATION = 2000;
|
|
6
|
+
export declare enum Label {
|
|
7
|
+
WAITING = "Waiting for action to complete",
|
|
8
|
+
SUCCESS = "Action completed"
|
|
9
|
+
}
|
|
10
|
+
export type Props = PropsWithSpread<{
|
|
11
|
+
/**
|
|
12
|
+
* The appearance of the button.
|
|
13
|
+
*/
|
|
14
|
+
appearance?: ButtonProps["appearance"];
|
|
15
|
+
/**
|
|
16
|
+
* The content of the button.
|
|
17
|
+
*/
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Optional class(es) to pass to the button element.
|
|
21
|
+
*/
|
|
22
|
+
className?: ClassName;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the button should be disabled.
|
|
25
|
+
*/
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the button should display inline.
|
|
29
|
+
*/
|
|
30
|
+
inline?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the button should be in the loading state.
|
|
33
|
+
*/
|
|
34
|
+
loading?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Whether the button should be in the success state.
|
|
37
|
+
*/
|
|
38
|
+
success?: boolean;
|
|
39
|
+
}, ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
40
|
+
/**
|
|
41
|
+
* This is a not an existing Vanilla component. It can be used to display submitting states for forms or other actions.
|
|
42
|
+
*
|
|
43
|
+
* ActionButton accepts the props from
|
|
44
|
+
* [Button](?path=/docs/components-button--docs) in addition to those in the
|
|
45
|
+
* props table:
|
|
46
|
+
*/
|
|
47
|
+
declare const ActionButton: ({ appearance, children, className, disabled, inline, loading, success, ...buttonProps }: Props) => JSX.Element;
|
|
48
|
+
export default ActionButton;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { PropsWithSpread } from "../../../types";
|
|
3
|
+
import { type HTMLProps, type PropsWithChildren } from "react";
|
|
4
|
+
export type Props = PropsWithSpread<{
|
|
5
|
+
/**
|
|
6
|
+
* Whether the aside panel should be collapsed. Toggling this state will animate
|
|
7
|
+
* the panel open or closed.
|
|
8
|
+
*/
|
|
9
|
+
collapsed?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The panel content.
|
|
12
|
+
*/
|
|
13
|
+
children?: PropsWithChildren["children"];
|
|
14
|
+
/**
|
|
15
|
+
* A ref that will be passed to the wrapping `<aside>` element.
|
|
16
|
+
*/
|
|
17
|
+
forwardRef?: React.Ref<HTMLElement> | null;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the aside panel should be narrow.
|
|
20
|
+
*/
|
|
21
|
+
narrow?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the aside panel should be pinned. When pinned the panel will appear
|
|
24
|
+
* beside the main content, instead of above it.
|
|
25
|
+
*/
|
|
26
|
+
pinned?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the aside panel should be wide.
|
|
29
|
+
*/
|
|
30
|
+
wide?: boolean;
|
|
31
|
+
}, HTMLProps<HTMLElement>>;
|
|
32
|
+
declare const AppAside: ({ children, className, collapsed, narrow, forwardRef, pinned, wide, ...props }: Props) => React.JSX.Element;
|
|
33
|
+
export default AppAside;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { HTMLProps, PropsWithChildren } from "react";
|
|
3
|
+
export type Props = {
|
|
4
|
+
/**
|
|
5
|
+
* The main content.
|
|
6
|
+
*/
|
|
7
|
+
children?: PropsWithChildren["children"];
|
|
8
|
+
} & HTMLProps<HTMLDivElement>;
|
|
9
|
+
/**
|
|
10
|
+
* This is a [React](https://reactjs.org/) component for main content area in the Vanilla
|
|
11
|
+
* [Application Layout](https://vanillaframework.io/docs/layouts/application).
|
|
12
|
+
*/
|
|
13
|
+
declare const AppMain: ({ children, className, ...props }: Props) => React.JSX.Element;
|
|
14
|
+
export default AppMain;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { PropsWithSpread } from "../../../types";
|
|
3
|
+
import type { HTMLProps, PropsWithChildren } from "react";
|
|
4
|
+
export type Props = PropsWithSpread<{
|
|
5
|
+
/**
|
|
6
|
+
* Whether the navigation panel should be collapsed.
|
|
7
|
+
*/
|
|
8
|
+
collapsed?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* The navigation drawer content.
|
|
11
|
+
*/
|
|
12
|
+
children?: PropsWithChildren["children"];
|
|
13
|
+
/**
|
|
14
|
+
* Whether the navigation panel should be pinned.
|
|
15
|
+
*/
|
|
16
|
+
pinned?: boolean;
|
|
17
|
+
}, HTMLProps<HTMLDivElement>>;
|
|
18
|
+
/**
|
|
19
|
+
* This is a [React](https://reactjs.org/) component for the navigation panel in the Vanilla
|
|
20
|
+
* [Application Layout](https://vanillaframework.io/docs/layouts/application).
|
|
21
|
+
*
|
|
22
|
+
* This component is used to display the left navigation panel. It should be
|
|
23
|
+
* used alongside [`AppNavigationBar`](/docs/components-applicationlayout-appnavigationbar--docs).
|
|
24
|
+
*/
|
|
25
|
+
declare const AppNavigation: ({ children, className, collapsed, pinned, ...props }: Props) => React.JSX.Element;
|
|
26
|
+
export default AppNavigation;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { PropsWithSpread } from "../../../types";
|
|
3
|
+
import type { HTMLProps, PropsWithChildren } from "react";
|
|
4
|
+
export type Props = PropsWithSpread<{
|
|
5
|
+
/**
|
|
6
|
+
* The navigation content.
|
|
7
|
+
*/
|
|
8
|
+
children?: PropsWithChildren["children"];
|
|
9
|
+
}, HTMLProps<HTMLElement>>;
|
|
10
|
+
/**
|
|
11
|
+
* This is a [React](https://reactjs.org/) component for navigation bar in the Vanilla
|
|
12
|
+
* [Application Layout](https://vanillaframework.io/docs/layouts/application).
|
|
13
|
+
*
|
|
14
|
+
* This component is used to display the navigation panel on mobile or small
|
|
15
|
+
* screens. It should be used alongside [`AppNavigation`](/docs/components-applicationlayout-appnavigation--docs).
|
|
16
|
+
*/
|
|
17
|
+
declare const AppNavigationBar: ({ children, className, ...props }: Props) => React.JSX.Element;
|
|
18
|
+
export default AppNavigationBar;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { HTMLProps, PropsWithChildren } from "react";
|
|
3
|
+
export type Props = {
|
|
4
|
+
/**
|
|
5
|
+
* The status content.
|
|
6
|
+
*/
|
|
7
|
+
children?: PropsWithChildren["children"];
|
|
8
|
+
} & HTMLProps<HTMLDivElement>;
|
|
9
|
+
/**
|
|
10
|
+
* This is a [React](https://reactjs.org/) component for status area in the Vanilla
|
|
11
|
+
* [Application Layout](https://vanillaframework.io/docs/layouts/application).
|
|
12
|
+
*/
|
|
13
|
+
declare const AppStatus: ({ children, className, ...props }: Props) => React.JSX.Element;
|
|
14
|
+
export default AppStatus;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { PropsWithSpread } from "../../../types";
|
|
3
|
+
import type { HTMLProps, PropsWithChildren } from "react";
|
|
4
|
+
export type Props = PropsWithSpread<{
|
|
5
|
+
/**
|
|
6
|
+
* The application content.
|
|
7
|
+
*/
|
|
8
|
+
children?: PropsWithChildren["children"];
|
|
9
|
+
}, HTMLProps<HTMLDivElement>>;
|
|
10
|
+
/**
|
|
11
|
+
* This is a [React](https://reactjs.org/) component for the application wrapper in the Vanilla
|
|
12
|
+
* [Application Layout](https://vanillaframework.io/docs/layouts/application).
|
|
13
|
+
*/
|
|
14
|
+
declare const Application: ({ children, className, ...props }: Props) => React.JSX.Element;
|
|
15
|
+
export default Application;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { PropsWithSpread } from "../../types";
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
import { type HTMLProps, type PropsWithChildren } from "react";
|
|
5
|
+
import type { PanelProps } from "../Panel";
|
|
6
|
+
import type { PanelLogoDefaultElement } from "../Panel";
|
|
7
|
+
import type { ExclusiveProps } from "../../types";
|
|
8
|
+
import type { SideNavigationProps } from "../SideNavigation";
|
|
9
|
+
import type { SideNavigationLinkDefaultElement } from "../SideNavigation/SideNavigationLink/index";
|
|
10
|
+
export type BaseProps<NI = SideNavigationLinkDefaultElement, PL = PanelLogoDefaultElement> = PropsWithSpread<{
|
|
11
|
+
/**
|
|
12
|
+
* The aside panel. This prop puts the panel in the correct position inside the
|
|
13
|
+
* application layout DOM structure, but does not wrap the content in an aside,
|
|
14
|
+
* so the content provided to this prop should include an `<AppAside>` or equivalent.
|
|
15
|
+
*/
|
|
16
|
+
aside?: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* The content for the main area.
|
|
19
|
+
*/
|
|
20
|
+
children?: PropsWithChildren["children"];
|
|
21
|
+
/**
|
|
22
|
+
* Whether to use the dark theme.
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
dark?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The logo to appear in the navigation panels.
|
|
28
|
+
*/
|
|
29
|
+
logo?: PanelProps<PL>["logo"];
|
|
30
|
+
/**
|
|
31
|
+
* The component to use to render links inside the navigation e.g. when
|
|
32
|
+
* using react-router you'd pass `Link` to this prop.
|
|
33
|
+
*/
|
|
34
|
+
navLinkComponent?: SideNavigationProps<NI>["linkComponent"];
|
|
35
|
+
/**
|
|
36
|
+
* Whether the navigation menu should be collapsed.
|
|
37
|
+
*/
|
|
38
|
+
menuCollapsed?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Whether the navigation menu should be pinned.
|
|
41
|
+
*/
|
|
42
|
+
menuPinned?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* A function that is called to collapse the navigation menu.
|
|
45
|
+
*/
|
|
46
|
+
onCollapseMenu?: (menuCollapsed: boolean) => void;
|
|
47
|
+
/**
|
|
48
|
+
* A function that is called to pin the navigation menu.
|
|
49
|
+
*/
|
|
50
|
+
onPinMenu?: (menuPinned: boolean) => void;
|
|
51
|
+
/**
|
|
52
|
+
* The content to appear inside the status area.
|
|
53
|
+
*/
|
|
54
|
+
status?: ReactNode;
|
|
55
|
+
/**
|
|
56
|
+
* Classes to apply to the navigation bar.
|
|
57
|
+
*/
|
|
58
|
+
navigationBarClassName?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Classes to apply to the navigation menu.
|
|
61
|
+
*/
|
|
62
|
+
navigationClassName?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Classes to apply to the main area.
|
|
65
|
+
*/
|
|
66
|
+
mainClassName?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Classes to apply to the status area.
|
|
69
|
+
*/
|
|
70
|
+
statusClassName?: string;
|
|
71
|
+
}, HTMLProps<HTMLDivElement>>;
|
|
72
|
+
export type Props<NI = SideNavigationLinkDefaultElement, PL = PanelLogoDefaultElement> = BaseProps<NI, PL> & ExclusiveProps<{
|
|
73
|
+
navItems?: SideNavigationProps<NI>["items"];
|
|
74
|
+
}, {
|
|
75
|
+
sideNavigation?: ReactNode;
|
|
76
|
+
}>;
|
|
77
|
+
/**
|
|
78
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla
|
|
79
|
+
* [Application Layout](https://vanillaframework.io/docs/layouts/application).
|
|
80
|
+
*
|
|
81
|
+
* This component combines the various sub-components that make up the
|
|
82
|
+
* Application Layout to make it easier to consume. For some applications this
|
|
83
|
+
* component maybe not be flexible enough, in which case you may choose to use
|
|
84
|
+
* the sub-components directly. Be aware that the application layout requires a
|
|
85
|
+
* specific structure and states to function correctly so there will be a
|
|
86
|
+
* trade-off when using the sub-components directly.
|
|
87
|
+
*/
|
|
88
|
+
declare const ApplicationLayout: <NI = SideNavigationLinkDefaultElement, PL = PanelLogoDefaultElement>({ aside, children, dark, logo, mainClassName, menuCollapsed, menuPinned, navigationBarClassName, navigationClassName, navItems, navLinkComponent, onCollapseMenu, onPinMenu, sideNavigation, status, statusClassName, ...props }: Props<NI, PL>) => React.JSX.Element;
|
|
89
|
+
export default ApplicationLayout;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default, type Props as ApplicationLayoutProps, } from "./ApplicationLayout";
|
|
2
|
+
export { default as AppAside, type AppAsideProps } from "./AppAside";
|
|
3
|
+
export { default as Application, type ApplicationProps } from "./Application";
|
|
4
|
+
export { default as AppMain, type AppMainProps } from "./AppMain";
|
|
5
|
+
export { default as AppNavigation, type AppNavigationProps, } from "./AppNavigation";
|
|
6
|
+
export { default as AppNavigationBar, type AppNavigationBarProps, } from "./AppNavigationBar";
|
|
7
|
+
export { default as AppStatus, type AppStatusProps } from "./AppStatus";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { HTMLProps } from "react";
|
|
2
|
+
import type { ClassName, PropsWithSpread } from "../../types";
|
|
3
|
+
export type Props = PropsWithSpread<{
|
|
4
|
+
/**
|
|
5
|
+
* Optional classes to add to the wrapping element.
|
|
6
|
+
*/
|
|
7
|
+
className?: ClassName;
|
|
8
|
+
/**
|
|
9
|
+
* The URL for the next link.
|
|
10
|
+
*/
|
|
11
|
+
nextURL?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The label for the next link.
|
|
14
|
+
*/
|
|
15
|
+
nextLabel?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The URL for the previous link.
|
|
18
|
+
*/
|
|
19
|
+
previousURL?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The label for the previous link.
|
|
22
|
+
*/
|
|
23
|
+
previousLabel?: string;
|
|
24
|
+
}, HTMLProps<HTMLElement>>;
|
|
25
|
+
/**
|
|
26
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Article pagination](https://docs.vanillaframework.io/patterns/article-pagination/).
|
|
27
|
+
*
|
|
28
|
+
* The article pagination component should be used to navigate from one article to the next, or previous, in chronological order.
|
|
29
|
+
*/
|
|
30
|
+
declare const ArticlePagination: ({ className, nextURL, nextLabel, previousURL, previousLabel, ...props }: Props) => JSX.Element;
|
|
31
|
+
export default ArticlePagination;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { HTMLProps } from "react";
|
|
2
|
+
import type { ClassName, PropsWithSpread, ValueOf } from "../../types";
|
|
3
|
+
export declare const BadgeType: {
|
|
4
|
+
readonly ROUNDED_LARGE_NUMBER: "ROUNDED_LARGE_NUMBER";
|
|
5
|
+
readonly UNDEFINED_LARGE_NUMBER: "UNDEFINED_LARGE_NUMBER";
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The props for the Badge component.
|
|
9
|
+
*/
|
|
10
|
+
export type Props = PropsWithSpread<{
|
|
11
|
+
/**
|
|
12
|
+
* Numeric value to be displayed.
|
|
13
|
+
*/
|
|
14
|
+
value: number;
|
|
15
|
+
/**
|
|
16
|
+
* The type of the badge component.
|
|
17
|
+
*/
|
|
18
|
+
badgeType?: ValueOf<typeof BadgeType>;
|
|
19
|
+
/**
|
|
20
|
+
* The appearance of the badge.
|
|
21
|
+
*/
|
|
22
|
+
isNegative?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Optional class(es) to give to the badge.
|
|
25
|
+
*/
|
|
26
|
+
className?: ClassName;
|
|
27
|
+
}, HTMLProps<HTMLSpanElement>>;
|
|
28
|
+
/**
|
|
29
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Badge](https://vanillaframework.io/docs/patterns/badge).
|
|
30
|
+
*
|
|
31
|
+
* It can be used to display a numeric values.
|
|
32
|
+
*/
|
|
33
|
+
declare const Badge: ({ value, badgeType, className, isNegative, ...spanProps }: Props) => JSX.Element;
|
|
34
|
+
export default Badge;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, ComponentType, ElementType, MouseEventHandler, ReactNode } from "react";
|
|
2
|
+
import type { ClassName, ValueOf } from "../../types";
|
|
3
|
+
export declare const ButtonAppearance: {
|
|
4
|
+
readonly BASE: "base";
|
|
5
|
+
readonly BRAND: "brand";
|
|
6
|
+
readonly DEFAULT: "";
|
|
7
|
+
readonly LINK: "link";
|
|
8
|
+
readonly NEGATIVE: "negative";
|
|
9
|
+
readonly POSITIVE: "positive";
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The type of the Button props.
|
|
13
|
+
* @template P - The type of the props if providing a component to `element`
|
|
14
|
+
*/
|
|
15
|
+
export type Props<P = null> = {
|
|
16
|
+
/**
|
|
17
|
+
* The appearance of the button.
|
|
18
|
+
*/
|
|
19
|
+
appearance?: ValueOf<typeof ButtonAppearance> | string;
|
|
20
|
+
/**
|
|
21
|
+
* The content of the button.
|
|
22
|
+
*/
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Optional class(es) to pass to the button element.
|
|
26
|
+
*/
|
|
27
|
+
className?: ClassName;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the button should have dense padding.
|
|
30
|
+
*/
|
|
31
|
+
dense?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the button should be disabled.
|
|
34
|
+
*/
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Optional element or component to use instead of `button`.
|
|
38
|
+
*/
|
|
39
|
+
element?: ElementType | ComponentType<P>;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the button has an icon in the content.
|
|
42
|
+
*/
|
|
43
|
+
hasIcon?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Whether the button should display inline.
|
|
46
|
+
*/
|
|
47
|
+
inline?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Function for handling button click event.
|
|
50
|
+
*/
|
|
51
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the button should be small.
|
|
54
|
+
*/
|
|
55
|
+
small?: boolean;
|
|
56
|
+
} & (Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onClick"> | P);
|
|
57
|
+
/**
|
|
58
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Button](https://docs.vanillaframework.io/patterns/buttons/).
|
|
59
|
+
*
|
|
60
|
+
* Buttons are clickable elements used to perform an action, they can be used for buttons and link elements.
|
|
61
|
+
* @template P - The type of the props if providing a component to `element`
|
|
62
|
+
*/
|
|
63
|
+
declare const Button: <P>({ appearance, children, className, dense, disabled, element: Component, hasIcon, inline, onClick, small, ...buttonProps }: Props<P>) => JSX.Element;
|
|
64
|
+
export default Button;
|
|
@@ -0,0 +1,35 @@
|
|
|
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 card.
|
|
6
|
+
*/
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Optional class(es) to pass to the wrapping div element.
|
|
10
|
+
*/
|
|
11
|
+
className?: ClassName;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the card should have highlighted styling.
|
|
14
|
+
*/
|
|
15
|
+
highlighted?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the card should have overlay styling.
|
|
18
|
+
*/
|
|
19
|
+
overlay?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The path to a thumbnail image.
|
|
22
|
+
*/
|
|
23
|
+
thumbnail?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The title of the card.
|
|
26
|
+
*/
|
|
27
|
+
title?: ReactNode;
|
|
28
|
+
}, HTMLProps<HTMLDivElement>>;
|
|
29
|
+
/**
|
|
30
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Card](https://docs.vanillaframework.io/patterns/card/).
|
|
31
|
+
*
|
|
32
|
+
* There are four card styles available to use in Vanilla: default, header, highlighted and overlay. Our card component will expand to fill the full width of its parent container.
|
|
33
|
+
*/
|
|
34
|
+
declare const Card: ({ children, className, highlighted, overlay, thumbnail, title, ...props }: Props) => JSX.Element;
|
|
35
|
+
export default Card;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { HTMLProps } from "react";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import type { PropsWithSpread } from "../../../types";
|
|
4
|
+
export type Props = PropsWithSpread<{
|
|
5
|
+
/**
|
|
6
|
+
* The type of the input element.
|
|
7
|
+
*/
|
|
8
|
+
inputType: "radio" | "checkbox";
|
|
9
|
+
/**
|
|
10
|
+
* The label for the input element.
|
|
11
|
+
*/
|
|
12
|
+
label: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Optional class(es) to pass to the label element.
|
|
15
|
+
*/
|
|
16
|
+
labelClassName?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the input element should display in indeterminate state.
|
|
19
|
+
*/
|
|
20
|
+
indeterminate?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Ensures the input and the label text are properly aligned with other inline text.
|
|
23
|
+
*/
|
|
24
|
+
inline?: boolean;
|
|
25
|
+
}, Omit<HTMLProps<HTMLInputElement>, "type">>;
|
|
26
|
+
declare const CheckableInput: ({ inputType, label, labelClassName, indeterminate, inline, ...checkboxProps }: Props) => JSX.Element;
|
|
27
|
+
export default CheckableInput;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CheckableInputProps } from "./CheckableInput";
|
|
2
|
+
export type Props = Omit<CheckableInputProps, "inputType">;
|
|
3
|
+
/**
|
|
4
|
+
* This is a [React](https://reactjs.org/) component for the Vanilla [Checkbox input](https://docs.vanillaframework.io/base/forms#checkbox).
|
|
5
|
+
*
|
|
6
|
+
* Use the checkbox component to select one or more options.
|
|
7
|
+
*/
|
|
8
|
+
declare const CheckboxInput: ({ label, indeterminate, ...checkboxProps }: Props) => JSX.Element;
|
|
9
|
+
export default CheckboxInput;
|