@canonical/react-components 1.2.4 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/package.json +9 -6
- package/dist/components/Accordion/Accordion.d.ts +0 -46
- package/dist/components/Accordion/Accordion.stories.d.ts +0 -18
- package/dist/components/Accordion/Accordion.stories.js +0 -117
- package/dist/components/Accordion/AccordionSection/AccordionSection.d.ts +0 -34
- package/dist/components/Accordion/AccordionSection/index.d.ts +0 -2
- package/dist/components/Accordion/index.d.ts +0 -2
- package/dist/components/ActionButton/ActionButton.d.ts +0 -48
- package/dist/components/ActionButton/ActionButton.stories.d.ts +0 -7
- package/dist/components/ActionButton/ActionButton.stories.js +0 -36
- package/dist/components/ActionButton/index.d.ts +0 -2
- package/dist/components/ApplicationLayout/AppAside/AppAside.d.ts +0 -33
- package/dist/components/ApplicationLayout/AppAside/AppAside.stories.d.ts +0 -13
- package/dist/components/ApplicationLayout/AppAside/AppAside.stories.js +0 -116
- package/dist/components/ApplicationLayout/AppAside/index.d.ts +0 -2
- package/dist/components/ApplicationLayout/AppMain/AppMain.d.ts +0 -14
- package/dist/components/ApplicationLayout/AppMain/AppMain.stories.d.ts +0 -14
- package/dist/components/ApplicationLayout/AppMain/AppMain.stories.js +0 -45
- package/dist/components/ApplicationLayout/AppMain/index.d.ts +0 -2
- package/dist/components/ApplicationLayout/AppNavigation/AppNavigation.d.ts +0 -26
- package/dist/components/ApplicationLayout/AppNavigation/AppNavigation.stories.d.ts +0 -12
- package/dist/components/ApplicationLayout/AppNavigation/AppNavigation.stories.js +0 -104
- package/dist/components/ApplicationLayout/AppNavigation/index.d.ts +0 -2
- package/dist/components/ApplicationLayout/AppNavigationBar/AppNavigationBar.d.ts +0 -18
- package/dist/components/ApplicationLayout/AppNavigationBar/AppNavigationBar.stories.d.ts +0 -15
- package/dist/components/ApplicationLayout/AppNavigationBar/AppNavigationBar.stories.js +0 -52
- package/dist/components/ApplicationLayout/AppNavigationBar/index.d.ts +0 -2
- package/dist/components/ApplicationLayout/AppStatus/AppStatus.d.ts +0 -14
- package/dist/components/ApplicationLayout/AppStatus/AppStatus.stories.d.ts +0 -13
- package/dist/components/ApplicationLayout/AppStatus/AppStatus.stories.js +0 -41
- package/dist/components/ApplicationLayout/AppStatus/index.d.ts +0 -2
- package/dist/components/ApplicationLayout/Application/Application.d.ts +0 -15
- package/dist/components/ApplicationLayout/Application/Application.stories.d.ts +0 -6
- package/dist/components/ApplicationLayout/Application/Application.stories.js +0 -16
- package/dist/components/ApplicationLayout/Application/index.d.ts +0 -2
- package/dist/components/ApplicationLayout/ApplicationLayout.d.ts +0 -89
- package/dist/components/ApplicationLayout/ApplicationLayout.stories.d.ts +0 -24
- package/dist/components/ApplicationLayout/ApplicationLayout.stories.js +0 -232
- package/dist/components/ApplicationLayout/index.d.ts +0 -7
- package/dist/components/ArticlePagination/ArticlePagination.d.ts +0 -31
- package/dist/components/ArticlePagination/ArticlePagination.stories.d.ts +0 -6
- package/dist/components/ArticlePagination/ArticlePagination.stories.js +0 -22
- package/dist/components/ArticlePagination/index.d.ts +0 -2
- package/dist/components/Badge/Badge.d.ts +0 -34
- package/dist/components/Badge/Badge.stories.d.ts +0 -15
- package/dist/components/Badge/Badge.stories.js +0 -62
- package/dist/components/Badge/index.d.ts +0 -2
- package/dist/components/Button/Button.d.ts +0 -64
- package/dist/components/Button/Button.stories.d.ts +0 -32
- package/dist/components/Button/Button.stories.js +0 -180
- package/dist/components/Button/index.d.ts +0 -2
- package/dist/components/Card/Card.d.ts +0 -35
- package/dist/components/Card/Card.stories.d.ts +0 -33
- package/dist/components/Card/Card.stories.js +0 -51
- package/dist/components/Card/index.d.ts +0 -2
- package/dist/components/CheckboxInput/CheckableInput/CheckableInput.d.ts +0 -27
- package/dist/components/CheckboxInput/CheckableInput/index.d.ts +0 -2
- package/dist/components/CheckboxInput/CheckboxInput.d.ts +0 -9
- package/dist/components/CheckboxInput/CheckboxInput.stories.d.ts +0 -11
- package/dist/components/CheckboxInput/CheckboxInput.stories.js +0 -84
- package/dist/components/CheckboxInput/index.d.ts +0 -2
- package/dist/components/Chip/Chip.d.ts +0 -56
- package/dist/components/Chip/Chip.stories.d.ts +0 -9
- package/dist/components/Chip/Chip.stories.js +0 -45
- package/dist/components/Chip/index.d.ts +0 -2
- package/dist/components/Code/Code.d.ts +0 -13
- package/dist/components/Code/index.d.ts +0 -2
- package/dist/components/CodeSnippet/CodeSnippet.d.ts +0 -21
- package/dist/components/CodeSnippet/CodeSnippet.stories.d.ts +0 -45
- package/dist/components/CodeSnippet/CodeSnippet.stories.js +0 -279
- package/dist/components/CodeSnippet/CodeSnippetBlock.d.ts +0 -40
- package/dist/components/CodeSnippet/CodeSnippetDropdown.d.ts +0 -18
- package/dist/components/CodeSnippet/index.d.ts +0 -5
- package/dist/components/Col/Col.d.ts +0 -53
- package/dist/components/Col/Col.stories.d.ts +0 -11
- package/dist/components/Col/Col.stories.js +0 -154
- package/dist/components/Col/index.d.ts +0 -2
- package/dist/components/ConfirmationButton/ConfirmationButton.d.ts +0 -28
- package/dist/components/ConfirmationButton/ConfirmationButton.stories.d.ts +0 -9
- package/dist/components/ConfirmationButton/ConfirmationButton.stories.js +0 -108
- package/dist/components/ConfirmationButton/index.d.ts +0 -2
- package/dist/components/ConfirmationModal/ConfirmationModal.d.ts +0 -53
- package/dist/components/ConfirmationModal/ConfirmationModal.stories.d.ts +0 -18
- package/dist/components/ConfirmationModal/ConfirmationModal.stories.js +0 -135
- package/dist/components/ConfirmationModal/index.d.ts +0 -2
- package/dist/components/ContextualMenu/ContextualMenu.d.ts +0 -110
- package/dist/components/ContextualMenu/ContextualMenu.stories.d.ts +0 -13
- package/dist/components/ContextualMenu/ContextualMenu.stories.js +0 -107
- package/dist/components/ContextualMenu/ContextualMenuDropdown/ContextualMenuDropdown.d.ts +0 -43
- package/dist/components/ContextualMenu/ContextualMenuDropdown/index.d.ts +0 -2
- package/dist/components/ContextualMenu/index.d.ts +0 -3
- package/dist/components/EmptyState/EmptyState.d.ts +0 -25
- package/dist/components/EmptyState/EmptyState.stories.d.ts +0 -7
- package/dist/components/EmptyState/EmptyState.stories.js +0 -49
- package/dist/components/EmptyState/index.d.ts +0 -2
- package/dist/components/Field/Field.d.ts +0 -77
- package/dist/components/Field/index.d.ts +0 -2
- package/dist/components/Form/Form.d.ts +0 -21
- package/dist/components/Form/Form.stories.d.ts +0 -12
- package/dist/components/Form/Form.stories.js +0 -179
- package/dist/components/Form/index.d.ts +0 -2
- package/dist/components/FormikField/FormikField.d.ts +0 -25
- package/dist/components/FormikField/FormikField.stories.d.ts +0 -8
- package/dist/components/FormikField/FormikField.stories.js +0 -85
- package/dist/components/FormikField/index.d.ts +0 -1
- package/dist/components/Icon/Icon.d.ts +0 -59
- package/dist/components/Icon/Icon.stories.d.ts +0 -16
- package/dist/components/Icon/Icon.stories.js +0 -49
- package/dist/components/Icon/index.d.ts +0 -2
- package/dist/components/Input/Input.d.ts +0 -70
- package/dist/components/Input/Input.stories.d.ts +0 -14
- package/dist/components/Input/Input.stories.js +0 -148
- package/dist/components/Input/index.d.ts +0 -2
- package/dist/components/Label/Label.d.ts +0 -25
- package/dist/components/Label/index.d.ts +0 -2
- package/dist/components/Link/Link.d.ts +0 -31
- package/dist/components/Link/Link.stories.d.ts +0 -9
- package/dist/components/Link/Link.stories.js +0 -48
- package/dist/components/Link/index.d.ts +0 -2
- package/dist/components/List/List.d.ts +0 -36
- package/dist/components/List/List.stories.d.ts +0 -15
- package/dist/components/List/List.stories.js +0 -122
- package/dist/components/List/index.d.ts +0 -2
- package/dist/components/Loader/Loader.d.ts +0 -6
- package/dist/components/Loader/index.d.ts +0 -1
- package/dist/components/LoginPageLayout/LoginPageLayout.d.ts +0 -17
- package/dist/components/LoginPageLayout/LoginPageLayout.stories.d.ts +0 -9
- package/dist/components/LoginPageLayout/LoginPageLayout.stories.js +0 -58
- package/dist/components/LoginPageLayout/index.d.ts +0 -2
- package/dist/components/MainTable/MainTable.d.ts +0 -102
- package/dist/components/MainTable/MainTable.stories.d.ts +0 -15
- package/dist/components/MainTable/MainTable.stories.js +0 -553
- package/dist/components/MainTable/index.d.ts +0 -2
- package/dist/components/Modal/Modal.d.ts +0 -36
- package/dist/components/Modal/Modal.stories.d.ts +0 -6
- package/dist/components/Modal/Modal.stories.js +0 -57
- package/dist/components/Modal/index.d.ts +0 -2
- package/dist/components/ModularTable/ModularTable.d.ts +0 -105
- package/dist/components/ModularTable/ModularTable.stories.d.ts +0 -27
- package/dist/components/ModularTable/ModularTable.stories.js +0 -343
- package/dist/components/ModularTable/index.d.ts +0 -2
- package/dist/components/MultiSelect/FadeInDown/FadeInDown.d.ts +0 -10
- package/dist/components/MultiSelect/FadeInDown/index.d.ts +0 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +0 -57
- package/dist/components/MultiSelect/MultiSelect.stories.d.ts +0 -8
- package/dist/components/MultiSelect/MultiSelect.stories.js +0 -70
- package/dist/components/MultiSelect/index.d.ts +0 -1
- package/dist/components/Navigation/Navigation.d.ts +0 -66
- package/dist/components/Navigation/Navigation.stories.d.ts +0 -43
- package/dist/components/Navigation/Navigation.stories.js +0 -232
- package/dist/components/Navigation/NavigationLink/NavigationLink.d.ts +0 -10
- package/dist/components/Navigation/NavigationLink/index.d.ts +0 -1
- package/dist/components/Navigation/NavigationMenu/NavigationMenu.d.ts +0 -11
- package/dist/components/Navigation/NavigationMenu/index.d.ts +0 -1
- package/dist/components/Navigation/index.d.ts +0 -3
- package/dist/components/Navigation/types.d.ts +0 -64
- package/dist/components/Notification/Notification.d.ts +0 -110
- package/dist/components/Notification/Notification.stories.d.ts +0 -45
- package/dist/components/Notification/Notification.stories.js +0 -201
- package/dist/components/Notification/index.d.ts +0 -2
- package/dist/components/NotificationProvider/NotificationProvider.d.ts +0 -5
- package/dist/components/NotificationProvider/index.d.ts +0 -3
- package/dist/components/NotificationProvider/messageBuilder.d.ts +0 -6
- package/dist/components/NotificationProvider/types.d.ts +0 -35
- package/dist/components/Pagination/Pagination.d.ts +0 -102
- package/dist/components/Pagination/Pagination.stories.d.ts +0 -14
- package/dist/components/Pagination/Pagination.stories.js +0 -94
- package/dist/components/Pagination/PaginationButton/PaginationButton.d.ts +0 -30
- package/dist/components/Pagination/PaginationButton/index.d.ts +0 -2
- package/dist/components/Pagination/PaginationItem/PaginationItem.d.ts +0 -17
- package/dist/components/Pagination/PaginationItem/index.d.ts +0 -2
- package/dist/components/Pagination/index.d.ts +0 -2
- package/dist/components/Panel/Panel.d.ts +0 -123
- package/dist/components/Panel/Panel.stories.d.ts +0 -17
- package/dist/components/Panel/Panel.stories.js +0 -60
- package/dist/components/Panel/index.d.ts +0 -1
- package/dist/components/PasswordToggle/PasswordToggle.d.ts +0 -108
- package/dist/components/PasswordToggle/PasswordToggle.stories.d.ts +0 -12
- package/dist/components/PasswordToggle/PasswordToggle.stories.js +0 -74
- package/dist/components/PasswordToggle/index.d.ts +0 -2
- package/dist/components/RadioInput/RadioInput.d.ts +0 -9
- package/dist/components/RadioInput/RadioInput.stories.d.ts +0 -10
- package/dist/components/RadioInput/RadioInput.stories.js +0 -83
- package/dist/components/RadioInput/index.d.ts +0 -2
- package/dist/components/Row/Row.d.ts +0 -19
- package/dist/components/Row/Row.stories.d.ts +0 -9
- package/dist/components/Row/Row.stories.js +0 -29
- package/dist/components/Row/index.d.ts +0 -2
- package/dist/components/SearchAndFilter/FilterPanelSection/FilterPanelSection.d.ts +0 -25
- package/dist/components/SearchAndFilter/FilterPanelSection/index.d.ts +0 -1
- package/dist/components/SearchAndFilter/SearchAndFilter.d.ts +0 -33
- package/dist/components/SearchAndFilter/SearchAndFilter.stories.d.ts +0 -8
- package/dist/components/SearchAndFilter/SearchAndFilter.stories.js +0 -218
- package/dist/components/SearchAndFilter/index.d.ts +0 -2
- package/dist/components/SearchAndFilter/types.d.ts +0 -11
- package/dist/components/SearchAndFilter/utils.d.ts +0 -13
- package/dist/components/SearchBox/SearchBox.d.ts +0 -63
- package/dist/components/SearchBox/SearchBox.stories.d.ts +0 -14
- package/dist/components/SearchBox/SearchBox.stories.js +0 -106
- package/dist/components/SearchBox/index.d.ts +0 -2
- package/dist/components/Select/Select.d.ts +0 -71
- package/dist/components/Select/Select.stories.d.ts +0 -7
- package/dist/components/Select/Select.stories.js +0 -97
- package/dist/components/Select/index.d.ts +0 -2
- package/dist/components/SideNavigation/SideNavigation.d.ts +0 -50
- package/dist/components/SideNavigation/SideNavigation.stories.d.ts +0 -14
- package/dist/components/SideNavigation/SideNavigation.stories.js +0 -62
- package/dist/components/SideNavigation/SideNavigationBase/SideNavigationBase.d.ts +0 -31
- package/dist/components/SideNavigation/SideNavigationBase/index.d.ts +0 -1
- package/dist/components/SideNavigation/SideNavigationItem/SideNavigationItem.d.ts +0 -20
- package/dist/components/SideNavigation/SideNavigationItem/SideNavigationItem.stories.d.ts +0 -22
- package/dist/components/SideNavigation/SideNavigationItem/SideNavigationItem.stories.js +0 -70
- package/dist/components/SideNavigation/SideNavigationItem/index.d.ts +0 -1
- package/dist/components/SideNavigation/SideNavigationLink/SideNavigationLink.d.ts +0 -21
- package/dist/components/SideNavigation/SideNavigationLink/SideNavigationLink.stories.d.ts +0 -7
- package/dist/components/SideNavigation/SideNavigationLink/SideNavigationLink.stories.js +0 -32
- package/dist/components/SideNavigation/SideNavigationLink/index.d.ts +0 -1
- package/dist/components/SideNavigation/SideNavigationText/SideNavigationText.d.ts +0 -7
- package/dist/components/SideNavigation/SideNavigationText/SideNavigationText.stories.d.ts +0 -6
- package/dist/components/SideNavigation/SideNavigationText/SideNavigationText.stories.js +0 -25
- package/dist/components/SideNavigation/SideNavigationText/index.d.ts +0 -1
- package/dist/components/SideNavigation/index.d.ts +0 -5
- package/dist/components/Slider/Slider.d.ts +0 -62
- package/dist/components/Slider/Slider.stories.d.ts +0 -10
- package/dist/components/Slider/Slider.stories.js +0 -74
- package/dist/components/Slider/index.d.ts +0 -2
- package/dist/components/Spinner/Spinner.d.ts +0 -29
- package/dist/components/Spinner/Spinner.stories.d.ts +0 -8
- package/dist/components/Spinner/Spinner.stories.js +0 -28
- package/dist/components/Spinner/index.d.ts +0 -2
- package/dist/components/StatusLabel/StatusLabel.d.ts +0 -33
- package/dist/components/StatusLabel/StatusLabel.stories.d.ts +0 -10
- package/dist/components/StatusLabel/StatusLabel.stories.js +0 -61
- package/dist/components/StatusLabel/index.d.ts +0 -2
- package/dist/components/Strip/Strip.d.ts +0 -64
- package/dist/components/Strip/Strip.stories.d.ts +0 -12
- package/dist/components/Strip/Strip.stories.js +0 -130
- package/dist/components/Strip/index.d.ts +0 -2
- package/dist/components/SummaryButton/SummaryButton.d.ts +0 -29
- package/dist/components/SummaryButton/SummaryButton.stories.d.ts +0 -18
- package/dist/components/SummaryButton/SummaryButton.stories.js +0 -59
- package/dist/components/SummaryButton/index.d.ts +0 -2
- package/dist/components/Switch/Switch.d.ts +0 -17
- package/dist/components/Switch/Switch.stories.d.ts +0 -7
- package/dist/components/Switch/Switch.stories.js +0 -26
- package/dist/components/Switch/index.d.ts +0 -2
- package/dist/components/Table/Table.d.ts +0 -22
- package/dist/components/Table/index.d.ts +0 -2
- package/dist/components/TableCell/TableCell.d.ts +0 -26
- package/dist/components/TableCell/index.d.ts +0 -2
- package/dist/components/TableHeader/TableHeader.d.ts +0 -14
- package/dist/components/TableHeader/index.d.ts +0 -2
- package/dist/components/TablePagination/TablePagination.d.ts +0 -98
- package/dist/components/TablePagination/TablePagination.stories.d.ts +0 -14
- package/dist/components/TablePagination/TablePagination.stories.js +0 -330
- package/dist/components/TablePagination/TablePaginationControls/TablePaginationControls.d.ts +0 -24
- package/dist/components/TablePagination/TablePaginationControls/index.d.ts +0 -2
- package/dist/components/TablePagination/index.d.ts +0 -2
- package/dist/components/TablePagination/utils.d.ts +0 -27
- package/dist/components/TableRow/TableRow.d.ts +0 -10
- package/dist/components/TableRow/index.d.ts +0 -2
- package/dist/components/Tabs/Tabs.d.ts +0 -45
- package/dist/components/Tabs/Tabs.stories.d.ts +0 -11
- package/dist/components/Tabs/Tabs.stories.js +0 -56
- package/dist/components/Tabs/index.d.ts +0 -2
- package/dist/components/Textarea/Textarea.d.ts +0 -70
- package/dist/components/Textarea/Textarea.stories.d.ts +0 -7
- package/dist/components/Textarea/Textarea.stories.js +0 -62
- package/dist/components/Textarea/index.d.ts +0 -2
- package/dist/components/Tooltip/Tooltip.d.ts +0 -75
- package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -12
- package/dist/components/Tooltip/Tooltip.stories.js +0 -71
- package/dist/components/Tooltip/index.d.ts +0 -2
- package/dist/enums.d.ts +0 -13
- package/dist/hooks/index.d.ts +0 -9
- package/dist/hooks/useId.d.ts +0 -4
- package/dist/hooks/useListener.d.ts +0 -11
- package/dist/hooks/useOnClickOutside.d.ts +0 -12
- package/dist/hooks/useOnEscapePressed.d.ts +0 -6
- package/dist/hooks/usePagination.d.ts +0 -19
- package/dist/hooks/usePrevious.d.ts +0 -7
- package/dist/hooks/useThrottle.d.ts +0 -9
- package/dist/hooks/useWindowFitment.d.ts +0 -54
- package/dist/index.d.ts +0 -132
- package/dist/types/index.d.ts +0 -38
- package/dist/utils.d.ts +0 -27
package/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# React components for Vanilla Framework
|
|
2
2
|

|
|
3
3
|
|
|
4
|
-
This is a collection of components designed to be the way to consume [Vanilla Framework](http://vanillaframework.io) when using React.
|
|
4
|
+
This is a collection of components designed to be the way to consume [Vanilla Framework](http://vanillaframework.io) when using React. The library exposes both a CJS and an ESM build.
|
|
5
5
|
|
|
6
6
|
**[Storybook](https://canonical.github.io/react-components/)** contains component docs with usage instructions.
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
## Requirements
|
|
10
10
|
|
|
11
|
-
Canonical react components currently require that your build is configured with [sass-loader](https://github.com/webpack-contrib/sass-loader) (or equivalent), to compile
|
|
11
|
+
Canonical react components currently require that your build is configured with [sass-loader](https://github.com/webpack-contrib/sass-loader) (or equivalent), to compile Sass.
|
|
12
12
|
|
|
13
13
|
## Install
|
|
14
14
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonical/react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
|
-
"module": "dist/index.js",
|
|
5
|
+
"module": "dist-esm/index.js",
|
|
6
|
+
"types": "dist-types/index.d.ts",
|
|
6
7
|
"author": {
|
|
7
8
|
"email": "webteam@canonical.com",
|
|
8
9
|
"name": "Canonical Webteam"
|
|
@@ -126,10 +127,12 @@
|
|
|
126
127
|
"vanilla-framework": "^3.15.1 || ^4.0.0"
|
|
127
128
|
},
|
|
128
129
|
"scripts": {
|
|
129
|
-
"build": "
|
|
130
|
-
"build-
|
|
131
|
-
"build-
|
|
132
|
-
"build-
|
|
130
|
+
"build": "yarn build-cjs && yarn build-declaration && yarn build-esm",
|
|
131
|
+
"build-base": "rm -rf $OUT_DIR && NODE_ENV=production BABEL_ENV=$BABEL_ENV babel src --out-dir $OUT_DIR --copy-files --no-copy-ignored --extensions '.js,.jsx,.ts,.tsx,.snap' --ignore '**/*.test.ts','**/*.test.tsx','**/*.stories.tsx','**/__snapshots__','src/setupTests.js','src/testing'",
|
|
132
|
+
"build-cjs": "OUT_DIR=dist BABEL_ENV=cjs yarn run build-base",
|
|
133
|
+
"build-esm": "OUT_DIR=dist-esm BABEL_ENV=esm yarn run build-base",
|
|
134
|
+
"build-declaration": "rm -rf dist-types && tsc --project tsconfig.build.json --outDir dist-types && tsc-alias -p tsconfig.build.json --outDir dist-types",
|
|
135
|
+
"build-watch": "yarn run build-cjs --watch",
|
|
133
136
|
"build-docs": "storybook build -c .storybook -o docs",
|
|
134
137
|
"clean": "rm -rf node_modules dist .out",
|
|
135
138
|
"docs": "storybook dev -p ${PORT:-9009} --no-open",
|
|
@@ -1,46 +0,0 @@
|
|
|
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;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import Accordion from "./Accordion";
|
|
3
|
-
declare const meta: Meta<typeof Accordion>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof Accordion>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
/**
|
|
8
|
-
* The expanded accordion section can be controlled by external state.
|
|
9
|
-
*/
|
|
10
|
-
export declare const ExternalState: Story;
|
|
11
|
-
/**
|
|
12
|
-
* `titleElement` prop can be used to define heading element for section titles.
|
|
13
|
-
*/
|
|
14
|
-
export declare const Headings: Story;
|
|
15
|
-
/**
|
|
16
|
-
* The `title` prop can be a `ReactNode`, allowing a higher degree of customisation of the section titles.
|
|
17
|
-
*/
|
|
18
|
-
export declare const CustomHeadings: Story;
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.Headings = exports.ExternalState = exports.Default = exports.CustomHeadings = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _Accordion = _interopRequireDefault(require("./Accordion"));
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
-
const meta = {
|
|
13
|
-
component: _Accordion.default,
|
|
14
|
-
tags: ["autodocs"],
|
|
15
|
-
argTypes: {
|
|
16
|
-
sections: {
|
|
17
|
-
control: {
|
|
18
|
-
disable: true
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
externallyControlled: {
|
|
22
|
-
control: {
|
|
23
|
-
disable: true
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
var _default = exports.default = meta;
|
|
29
|
-
const Default = exports.Default = {
|
|
30
|
-
name: "Default",
|
|
31
|
-
args: {
|
|
32
|
-
sections: [{
|
|
33
|
-
title: "Advanced topics",
|
|
34
|
-
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Charm bundles"), /*#__PURE__*/_react.default.createElement("p", null, "Machine authentication"), /*#__PURE__*/_react.default.createElement("p", null, "Migrating models"), /*#__PURE__*/_react.default.createElement("p", null, "Using storage"), /*#__PURE__*/_react.default.createElement("p", null, "Working with actions"), /*#__PURE__*/_react.default.createElement("p", null, "Working with resources"), /*#__PURE__*/_react.default.createElement("p", null, "Cloud image metadata"), /*#__PURE__*/_react.default.createElement("p", null, "Tools"))
|
|
35
|
-
}, {
|
|
36
|
-
title: "Networking",
|
|
37
|
-
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Working offline"), /*#__PURE__*/_react.default.createElement("p", null, "Fan container networking"), /*#__PURE__*/_react.default.createElement("p", null, "Network spaces"))
|
|
38
|
-
}, {
|
|
39
|
-
title: "Miscellaneous",
|
|
40
|
-
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Juju GUI"), /*#__PURE__*/_react.default.createElement("p", null, "CentOS support"), /*#__PURE__*/_react.default.createElement("p", null, "Collecting Juju metrics"))
|
|
41
|
-
}]
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* The expanded accordion section can be controlled by external state.
|
|
47
|
-
*/
|
|
48
|
-
const ExternalState = exports.ExternalState = {
|
|
49
|
-
render: () => {
|
|
50
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
51
|
-
const [expandedSection, setExpandedSection] = (0, _react.useState)();
|
|
52
|
-
return /*#__PURE__*/_react.default.createElement(_Accordion.default, {
|
|
53
|
-
expanded: expandedSection,
|
|
54
|
-
externallyControlled: true,
|
|
55
|
-
onExpandedChange: setExpandedSection,
|
|
56
|
-
sections: [{
|
|
57
|
-
title: "Advanced topics",
|
|
58
|
-
key: "advanced-topics",
|
|
59
|
-
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Charm bundles"), /*#__PURE__*/_react.default.createElement("p", null, "Machine authentication"), /*#__PURE__*/_react.default.createElement("p", null, "Migrating models"), /*#__PURE__*/_react.default.createElement("p", null, "Using storage"), /*#__PURE__*/_react.default.createElement("p", null, "Working with actions"), /*#__PURE__*/_react.default.createElement("p", null, "Working with resources"), /*#__PURE__*/_react.default.createElement("p", null, "Cloud image metadata"), /*#__PURE__*/_react.default.createElement("p", null, "Tools"))
|
|
60
|
-
}, {
|
|
61
|
-
title: "Networking",
|
|
62
|
-
key: "networking",
|
|
63
|
-
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Working offline"), /*#__PURE__*/_react.default.createElement("p", null, "Fan container networking"), /*#__PURE__*/_react.default.createElement("p", null, "Network spaces"))
|
|
64
|
-
}, {
|
|
65
|
-
title: "Miscellaneous",
|
|
66
|
-
key: "miscellaneous",
|
|
67
|
-
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Juju GUI"), /*#__PURE__*/_react.default.createElement("p", null, "CentOS support"), /*#__PURE__*/_react.default.createElement("p", null, "Collecting Juju metrics"))
|
|
68
|
-
}]
|
|
69
|
-
});
|
|
70
|
-
},
|
|
71
|
-
name: "External state"
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* `titleElement` prop can be used to define heading element for section titles.
|
|
76
|
-
*/
|
|
77
|
-
const Headings = exports.Headings = {
|
|
78
|
-
name: "Headings",
|
|
79
|
-
args: {
|
|
80
|
-
sections: [{
|
|
81
|
-
title: "Advanced topics",
|
|
82
|
-
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Charm bundles"), /*#__PURE__*/_react.default.createElement("p", null, "Machine authentication"), /*#__PURE__*/_react.default.createElement("p", null, "Migrating models"), /*#__PURE__*/_react.default.createElement("p", null, "Using storage"), /*#__PURE__*/_react.default.createElement("p", null, "Working with actions"), /*#__PURE__*/_react.default.createElement("p", null, "Working with resources"), /*#__PURE__*/_react.default.createElement("p", null, "Cloud image metadata"), /*#__PURE__*/_react.default.createElement("p", null, "Tools"))
|
|
83
|
-
}, {
|
|
84
|
-
title: "Networking",
|
|
85
|
-
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Working offline"), /*#__PURE__*/_react.default.createElement("p", null, "Fan container networking"), /*#__PURE__*/_react.default.createElement("p", null, "Network spaces"))
|
|
86
|
-
}, {
|
|
87
|
-
title: "Miscellaneous",
|
|
88
|
-
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Juju GUI"), /*#__PURE__*/_react.default.createElement("p", null, "CentOS support"), /*#__PURE__*/_react.default.createElement("p", null, "Collecting Juju metrics"))
|
|
89
|
-
}],
|
|
90
|
-
titleElement: "h3"
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* The `title` prop can be a `ReactNode`, allowing a higher degree of customisation of the section titles.
|
|
96
|
-
*/
|
|
97
|
-
const CustomHeadings = exports.CustomHeadings = {
|
|
98
|
-
args: {
|
|
99
|
-
sections: [{
|
|
100
|
-
title: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Advanced topics", " ", /*#__PURE__*/_react.default.createElement("span", {
|
|
101
|
-
className: "u-text--muted p-text--small"
|
|
102
|
-
}, "optional")),
|
|
103
|
-
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Charm bundles"), /*#__PURE__*/_react.default.createElement("p", null, "Machine authentication"), /*#__PURE__*/_react.default.createElement("p", null, "Migrating models"), /*#__PURE__*/_react.default.createElement("p", null, "Using storage"), /*#__PURE__*/_react.default.createElement("p", null, "Working with actions"), /*#__PURE__*/_react.default.createElement("p", null, "Working with resources"), /*#__PURE__*/_react.default.createElement("p", null, "Cloud image metadata"), /*#__PURE__*/_react.default.createElement("p", null, "Tools"))
|
|
104
|
-
}, {
|
|
105
|
-
title: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Networking", " ", /*#__PURE__*/_react.default.createElement("span", {
|
|
106
|
-
className: "u-text--muted p-text--small"
|
|
107
|
-
}, "optional")),
|
|
108
|
-
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Working offline"), /*#__PURE__*/_react.default.createElement("p", null, "Fan container networking"), /*#__PURE__*/_react.default.createElement("p", null, "Network spaces"))
|
|
109
|
-
}, {
|
|
110
|
-
title: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Miscellaneous", " ", /*#__PURE__*/_react.default.createElement("span", {
|
|
111
|
-
className: "u-text--muted p-text--small"
|
|
112
|
-
}, "optional")),
|
|
113
|
-
content: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, "Juju GUI"), /*#__PURE__*/_react.default.createElement("p", null, "CentOS support"), /*#__PURE__*/_react.default.createElement("p", null, "Collecting Juju metrics"))
|
|
114
|
-
}],
|
|
115
|
-
titleElement: "h3"
|
|
116
|
-
}
|
|
117
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
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;
|
|
@@ -1,48 +0,0 @@
|
|
|
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;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import ActionButton from "./ActionButton";
|
|
3
|
-
declare const meta: Meta<typeof ActionButton>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof ActionButton>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const Loading: Story;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.Loading = exports.Default = void 0;
|
|
7
|
-
var _ActionButton = _interopRequireDefault(require("./ActionButton"));
|
|
8
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
const meta = {
|
|
10
|
-
component: _ActionButton.default,
|
|
11
|
-
tags: ["autodocs"],
|
|
12
|
-
argTypes: {
|
|
13
|
-
children: {
|
|
14
|
-
control: {
|
|
15
|
-
type: "text"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
var _default = exports.default = meta;
|
|
21
|
-
const Default = exports.Default = {
|
|
22
|
-
name: "Default",
|
|
23
|
-
args: {
|
|
24
|
-
appearance: "positive",
|
|
25
|
-
children: "Click me!"
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const Loading = exports.Loading = {
|
|
29
|
-
name: "Loading",
|
|
30
|
-
args: {
|
|
31
|
-
appearance: "positive",
|
|
32
|
-
loading: true,
|
|
33
|
-
disabled: true,
|
|
34
|
-
children: "Click me!"
|
|
35
|
-
}
|
|
36
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
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;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import AppAside from "./AppAside";
|
|
3
|
-
declare const meta: Meta<typeof AppAside>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof AppAside>;
|
|
6
|
-
/**
|
|
7
|
-
* In most common cases an `AppAside` should contain a `<Panel>` to display the
|
|
8
|
-
* content as intended in the application layout.
|
|
9
|
-
*
|
|
10
|
-
* `AppAside` should be a direct child of an `<Application>` or passed to the
|
|
11
|
-
* application layout `<ApplicationLayout aside={<AppAside .../>}>`.
|
|
12
|
-
*/
|
|
13
|
-
export declare const Default: Story;
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.Default = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _Application = _interopRequireDefault(require("../Application"));
|
|
9
|
-
var _AppMain = _interopRequireDefault(require("../AppMain"));
|
|
10
|
-
var _Button = _interopRequireDefault(require("../../Button"));
|
|
11
|
-
var _Col = _interopRequireDefault(require("../../Col"));
|
|
12
|
-
var _Form = _interopRequireDefault(require("../../Form"));
|
|
13
|
-
var _Icon = _interopRequireDefault(require("../../Icon"));
|
|
14
|
-
var _Input = _interopRequireDefault(require("../../Input"));
|
|
15
|
-
var _Panel = _interopRequireDefault(require("../../Panel"));
|
|
16
|
-
var _Row = _interopRequireDefault(require("../../Row"));
|
|
17
|
-
var _AppAside = _interopRequireDefault(require("./AppAside"));
|
|
18
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
20
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /* eslint-disable react-hooks/rules-of-hooks */
|
|
22
|
-
const meta = {
|
|
23
|
-
component: _AppAside.default,
|
|
24
|
-
tags: ["autodocs"],
|
|
25
|
-
argTypes: {
|
|
26
|
-
children: {
|
|
27
|
-
control: false
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
var _default = exports.default = meta;
|
|
32
|
-
/**
|
|
33
|
-
* In most common cases an `AppAside` should contain a `<Panel>` to display the
|
|
34
|
-
* content as intended in the application layout.
|
|
35
|
-
*
|
|
36
|
-
* `AppAside` should be a direct child of an `<Application>` or passed to the
|
|
37
|
-
* application layout `<ApplicationLayout aside={<AppAside .../>}>`.
|
|
38
|
-
*/
|
|
39
|
-
const Default = exports.Default = {
|
|
40
|
-
render: args => {
|
|
41
|
-
const [pinned, setPinned] = (0, _react.useState)(false);
|
|
42
|
-
const [width, setWidth] = (0, _react.useState)(null);
|
|
43
|
-
const [collapsed, setCollapsed] = (0, _react.useState)(false);
|
|
44
|
-
return /*#__PURE__*/_react.default.createElement(_Application.default, null, /*#__PURE__*/_react.default.createElement(_AppMain.default, null, /*#__PURE__*/_react.default.createElement("p", null, "Scroll to the right to see the panel."), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
45
|
-
onClick: () => setCollapsed(false)
|
|
46
|
-
}, "Open"), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
47
|
-
onClick: () => setWidth("narrow")
|
|
48
|
-
}, "Narrow"), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
49
|
-
onClick: () => setWidth(null)
|
|
50
|
-
}, "Default"), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
51
|
-
onClick: () => setWidth("wide")
|
|
52
|
-
}, "Wide")), /*#__PURE__*/_react.default.createElement(_AppAside.default, _extends({}, args, {
|
|
53
|
-
pinned: pinned,
|
|
54
|
-
wide: width === "wide",
|
|
55
|
-
narrow: width === "narrow",
|
|
56
|
-
collapsed: collapsed
|
|
57
|
-
}), /*#__PURE__*/_react.default.createElement(_Panel.default, {
|
|
58
|
-
controls: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
59
|
-
onClick: () => setPinned(!pinned),
|
|
60
|
-
dense: true,
|
|
61
|
-
className: "u-no-margin--bottom"
|
|
62
|
-
}, "Pin"), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
63
|
-
appearance: "base",
|
|
64
|
-
className: "u-no-margin--bottom",
|
|
65
|
-
hasIcon: true,
|
|
66
|
-
onClick: () => setCollapsed(!collapsed)
|
|
67
|
-
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
68
|
-
name: "close"
|
|
69
|
-
}, "Close"))),
|
|
70
|
-
title: "App aside"
|
|
71
|
-
}, /*#__PURE__*/_react.default.createElement(_Form.default, {
|
|
72
|
-
stacked: true
|
|
73
|
-
}, /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
74
|
-
label: "Full name",
|
|
75
|
-
type: "text",
|
|
76
|
-
name: "fullName",
|
|
77
|
-
autoComplete: "name",
|
|
78
|
-
stacked: true
|
|
79
|
-
}), /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
80
|
-
label: "Username",
|
|
81
|
-
type: "text",
|
|
82
|
-
name: "username-stacked",
|
|
83
|
-
autoComplete: "username",
|
|
84
|
-
"aria-describedby": "exampleHelpTextMessage",
|
|
85
|
-
stacked: true,
|
|
86
|
-
help: "30 characters or fewer."
|
|
87
|
-
}), /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
88
|
-
type: "text",
|
|
89
|
-
label: "Email address",
|
|
90
|
-
"aria-invalid": "true",
|
|
91
|
-
name: "username-stackederror",
|
|
92
|
-
autoComplete: "email",
|
|
93
|
-
required: true,
|
|
94
|
-
error: "This field is required.",
|
|
95
|
-
stacked: true
|
|
96
|
-
}), /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
97
|
-
label: "Address line 1",
|
|
98
|
-
type: "text",
|
|
99
|
-
name: "address-optional-stacked",
|
|
100
|
-
autoComplete: "address-line1",
|
|
101
|
-
stacked: true
|
|
102
|
-
}), /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
103
|
-
label: "Address line 2",
|
|
104
|
-
type: "text",
|
|
105
|
-
name: "address-optional-stacked",
|
|
106
|
-
autoComplete: "address-line3",
|
|
107
|
-
stacked: true
|
|
108
|
-
}), /*#__PURE__*/_react.default.createElement(_Row.default, null, /*#__PURE__*/_react.default.createElement(_Col.default, {
|
|
109
|
-
size: 12
|
|
110
|
-
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
111
|
-
appearance: "positive",
|
|
112
|
-
className: "u-float-right",
|
|
113
|
-
name: "add-details"
|
|
114
|
-
}, "Add details")))))));
|
|
115
|
-
}
|
|
116
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
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;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import AppMain from "./AppMain";
|
|
3
|
-
declare const meta: Meta<typeof AppMain>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof AppMain>;
|
|
6
|
-
/**
|
|
7
|
-
* In most common cases an `AppMain` should contain a `<Panel>` to display the
|
|
8
|
-
* content as intended in the application layout.
|
|
9
|
-
*
|
|
10
|
-
* `AppMain` should be a direct child of an `<Application>` or when using `ApplicationLayout`
|
|
11
|
-
* it will automatically wrap the component's children.
|
|
12
|
-
*/
|
|
13
|
-
export declare const Default: Story;
|
|
14
|
-
export declare const Content: Story;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.Default = exports.Content = void 0;
|
|
7
|
-
var _Application = _interopRequireDefault(require("../Application"));
|
|
8
|
-
var _Button = _interopRequireDefault(require("../../Button"));
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _Panel = _interopRequireDefault(require("../../Panel"));
|
|
11
|
-
var _AppMain = _interopRequireDefault(require("./AppMain"));
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
const meta = {
|
|
14
|
-
component: _AppMain.default,
|
|
15
|
-
tags: ["autodocs"]
|
|
16
|
-
};
|
|
17
|
-
var _default = exports.default = meta;
|
|
18
|
-
/**
|
|
19
|
-
* In most common cases an `AppMain` should contain a `<Panel>` to display the
|
|
20
|
-
* content as intended in the application layout.
|
|
21
|
-
*
|
|
22
|
-
* `AppMain` should be a direct child of an `<Application>` or when using `ApplicationLayout`
|
|
23
|
-
* it will automatically wrap the component's children.
|
|
24
|
-
*/
|
|
25
|
-
const Default = exports.Default = {
|
|
26
|
-
args: {
|
|
27
|
-
children: "AppMain"
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
const Content = exports.Content = {
|
|
31
|
-
render: args => {
|
|
32
|
-
return /*#__PURE__*/_react.default.createElement(_Application.default, null, /*#__PURE__*/_react.default.createElement(_AppMain.default, args, /*#__PURE__*/_react.default.createElement(_Panel.default, {
|
|
33
|
-
controls: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
34
|
-
appearance: "positive",
|
|
35
|
-
onClick: () => {},
|
|
36
|
-
className: "u-no-margin--bottom"
|
|
37
|
-
}, "Add"), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
38
|
-
appearance: "negative",
|
|
39
|
-
onClick: () => {},
|
|
40
|
-
className: "u-no-margin--bottom"
|
|
41
|
-
}, "Delete")),
|
|
42
|
-
title: "App main"
|
|
43
|
-
}, /*#__PURE__*/_react.default.createElement("p", null, "App main content."), /*#__PURE__*/_react.default.createElement("p", null, "Scroll to the right to see the controls."))));
|
|
44
|
-
}
|
|
45
|
-
};
|