@thecb/components 10.12.2-beta.0 → 10.12.3-beta.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 +4 -0
- package/dist/index.cjs.js +1476 -2489
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.esm.js +1476 -2488
- package/dist/index.esm.js.map +1 -1
- package/package.json +25 -13
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/alert/Alert.mdx +19 -0
- package/src/components/atoms/alert/Alert.stories.js +148 -26
- package/src/components/atoms/badge/Badge.js +2 -2
- package/src/components/atoms/badge/Badge.mdx +27 -0
- package/src/components/atoms/badge/Badge.stories.js +143 -29
- package/src/components/atoms/breadcrumb/Breadcrumb.mdx +21 -0
- package/src/components/atoms/breadcrumb/Breadcrumb.stories.js +38 -29
- package/src/components/atoms/button-with-action/ButtonWithAction.stories.js +108 -55
- package/src/components/atoms/button-with-link/ButtonWithLink.mdx +21 -0
- package/src/components/atoms/button-with-link/ButtonWithLink.stories.js +160 -31
- package/src/components/atoms/card/Card.js +13 -1
- package/src/components/atoms/card/Card.mdx +41 -0
- package/src/components/atoms/card/Card.stories.js +360 -0
- package/src/components/atoms/card/Card.theme.js +2 -0
- package/src/components/atoms/card/index.d.ts +1 -0
- package/src/components/atoms/checkbox/Checkbox.js +8 -14
- package/src/components/atoms/checkbox/Checkbox.mdx +15 -0
- package/src/components/atoms/checkbox/Checkbox.oldstories.js +30 -0
- package/src/components/atoms/checkbox/Checkbox.stories.js +148 -29
- package/src/components/atoms/country-dropdown/CountryDropdown.mdx +36 -0
- package/src/components/atoms/country-dropdown/CountryDropdown.stories.js +61 -27
- package/src/components/atoms/detail/Detail.js +0 -26
- package/src/components/atoms/detail/Detail.mdx +32 -0
- package/src/components/atoms/detail/Detail.stories.js +156 -0
- package/src/components/atoms/display-box/DisplayBox.mdx +11 -0
- package/src/components/atoms/display-box/DisplayBox.stories.js +65 -21
- package/src/components/atoms/display-card/DisplayCard.mdx +13 -0
- package/src/components/atoms/display-card/DisplayCard.stories.js +163 -22
- package/src/components/atoms/dropdown/Dropdown.mdx +65 -0
- package/src/components/atoms/dropdown/Dropdown.stories.js +91 -10
- package/src/components/atoms/form-layouts/FormInput.mdx +38 -0
- package/src/components/atoms/form-layouts/FormInput.stories.js +212 -26
- package/src/components/atoms/form-select/FormSelect.mdx +42 -0
- package/src/components/atoms/form-select/FormSelect.stories.js +55 -29
- package/src/components/atoms/formatted-address/FormattedAddress.mdx +13 -0
- package/src/components/atoms/formatted-address/FormattedAddress.stories.js +133 -27
- package/src/components/atoms/formatted-bank-account/FormattedBankAccount.mdx +17 -0
- package/src/components/atoms/formatted-bank-account/FormattedBankAccount.stories.js +57 -0
- package/src/components/atoms/formatted-credit-card/FormattedCreditCard.mdx +40 -0
- package/src/components/atoms/formatted-credit-card/FormattedCreditCard.stories.js +74 -0
- package/src/components/atoms/icons/Icons.mdx +40 -0
- package/src/components/atoms/icons/Icons.stories.js +325 -0
- package/src/components/atoms/icons/index.js +1 -5
- package/src/components/atoms/labeled-amount/LabeledAmount.mdx +23 -0
- package/src/components/atoms/labeled-amount/LabeledAmount.stories.js +110 -34
- package/src/components/atoms/line-item/LineItem.mdx +28 -0
- package/src/components/atoms/line-item/LineItem.stories.js +89 -22
- package/src/components/atoms/link/Link.mdx +19 -0
- package/src/components/atoms/link/Link.stories.js +155 -49
- package/src/components/atoms/loading/Loading.mdx +13 -0
- package/src/components/atoms/loading/Loading.stories.js +22 -0
- package/src/components/atoms/loading-line/LoadingLine.js +14 -10
- package/src/components/atoms/loading-line/LoadingLine.mdx +15 -0
- package/src/components/atoms/loading-line/LoadingLine.stories.js +132 -28
- package/src/components/atoms/nav-footer/NavFooter.mdx +15 -0
- package/src/components/atoms/nav-footer/NavFooter.stories.js +235 -22
- package/src/components/atoms/nav-header/NavHeader.mdx +13 -0
- package/src/components/atoms/nav-header/NavHeader.stories.js +122 -21
- package/src/components/atoms/nav-tabs/NavTabs.mdx +30 -0
- package/src/components/atoms/nav-tabs/NavTabs.stories.js +49 -0
- package/src/components/atoms/password-requirements/PasswordRequirements.mdx +39 -0
- package/src/components/atoms/password-requirements/PasswordRequirements.stories.js +108 -44
- package/src/components/atoms/placeholder/Placeholder.mdx +19 -0
- package/src/components/atoms/placeholder/Placeholder.stories.js +164 -36
- package/src/components/atoms/searchable-select/SearchableSelect.mdx +44 -0
- package/src/components/atoms/searchable-select/SearchableSelect.stories.js +103 -28
- package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.mdx +36 -0
- package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.stories.js +65 -40
- package/src/components/atoms/table/Table.mdx +71 -0
- package/src/components/atoms/table/Table.oldstories.js +84 -0
- package/src/components/atoms/table/Table.stories.js +59 -75
- package/src/components/atoms/table/TableRow.js +1 -0
- package/src/components/atoms/title/Title.js +0 -23
- package/src/components/atoms/title/Title.mdx +26 -0
- package/src/components/atoms/title/Title.stories.js +144 -0
- package/src/components/atoms/toggle-switch/ToggleSwitch.mdx +17 -0
- package/src/components/atoms/toggle-switch/ToggleSwitch.stories.js +103 -20
- package/src/components/atoms/toggle-switch/ToggleSwitch.theme.js +8 -5
- package/src/components/atoms/typeahead-input/TypeaheadInput.mdx +13 -0
- package/src/components/atoms/typeahead-input/TypeaheadInput.stories.js +63 -0
- package/src/components/molecules/address-form/AddressForm.mdx +18 -0
- package/src/components/molecules/address-form/AddressForm.stories.js +223 -20
- package/src/components/molecules/banner/Banner.mdx +23 -0
- package/src/components/molecules/banner/Banner.stories.js +122 -26
- package/src/components/molecules/change-password-form/ChangePasswordForm.mdx +15 -0
- package/src/components/molecules/change-password-form/ChangePasswordForm.stories.js +203 -19
- package/src/components/molecules/collapsible-section/CollapsibleSection.mdx +15 -0
- package/src/components/molecules/collapsible-section/CollapsibleSection.stories.js +210 -61
- package/src/components/molecules/edit-name-form/EditNameForm.mdx +13 -0
- package/src/components/molecules/edit-name-form/EditNameForm.stories.js +117 -0
- package/src/components/molecules/idle-modal/IdleModal.js +101 -0
- package/src/components/molecules/idle-modal/IdleModal.mdx +17 -0
- package/src/components/molecules/idle-modal/IdleModal.stories.js +180 -0
- package/src/components/molecules/idle-modal/index.d.ts +16 -0
- package/src/components/molecules/idle-modal/index.js +3 -0
- package/src/components/molecules/index.js +1 -0
- package/src/components/molecules/link-card/LinkCard.mdx +17 -0
- package/src/components/molecules/link-card/LinkCard.stories.js +287 -72
- package/src/components/molecules/login-form/LoginForm.mdx +16 -0
- package/src/components/molecules/login-form/LoginForm.stories.js +117 -21
- package/src/components/molecules/modal/Modal.mdx +17 -0
- package/src/components/molecules/modal/Modal.stories.js +342 -128
- package/src/components/molecules/module/Module.mdx +17 -0
- package/src/components/molecules/module/Module.stories.js +267 -25
- package/src/components/molecules/multiple-select-filter/MultipleSelectFilter.js +309 -77
- package/src/components/molecules/multiple-select-filter/{MultipleSelectFilter.stories.js → MultipleSelectFilter.oldstories.js} +4 -2
- package/src/components/molecules/multiple-select-filter/MultipleSelectFilter.styled.js +6 -6
- package/src/components/molecules/multiple-select-filter/index.d.ts +2 -2
- package/src/components/molecules/obligation/Obligation.mdx +23 -0
- package/src/components/molecules/obligation/Obligation.stories.js +460 -0
- package/src/components/molecules/obligation/icons/PropertyPersonalIcon.js +1 -1
- package/src/components/molecules/pagination/Pagination.mdx +15 -0
- package/src/components/molecules/pagination/Pagination.stories.js +177 -28
- package/src/components/molecules/popover/Popover.mdx +15 -0
- package/src/components/molecules/popover/Popover.stories.js +220 -0
- package/src/components/molecules/tabs/Tabs.mdx +17 -0
- package/src/components/molecules/tabs/Tabs.stories.js +135 -227
- package/src/components/molecules/toast-notification/Toast.mdx +15 -0
- package/src/components/molecules/toast-notification/Toast.stories.js +183 -0
- package/src/hooks/use-outside-click/index.js +5 -4
- package/src/stories/Button.stories.ts +53 -0
- package/src/stories/Button.tsx +48 -0
- package/src/stories/Configure.mdx +364 -0
- package/src/stories/Header.stories.ts +33 -0
- package/src/stories/Header.tsx +56 -0
- package/src/stories/Page.stories.ts +32 -0
- package/src/stories/Page.tsx +73 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +5 -0
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +15 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +3 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +12 -0
- package/src/stories/assets/youtube.svg +4 -0
- package/src/stories/button.css +30 -0
- package/src/stories/header.css +32 -0
- package/src/stories/page.css +69 -0
- package/src/util/idleTimerUtils.js +36 -0
- package/src/util/index.js +3 -1
- package/src/components/atoms/icons/CheckboxCheckmarkIcon.js +0 -45
- package/src/components/atoms/icons/PaymentStatusIcon.d.ts +0 -1
- package/src/components/atoms/icons/PaymentStatusIcon.js +0 -28
- package/src/components/atoms/icons/PersonIcon.d.ts +0 -1
- package/src/components/atoms/icons/PersonIcon.js +0 -28
- package/src/components/atoms/icons/icons.stories.js +0 -120
- package/src/components/molecules/edit-name-form/EdidNameForm.stories.js +0 -24
- package/src/components/molecules/multiple-select-filter/__private__/ActionLinkButton.js +0 -27
- package/src/components/molecules/multiple-select-filter/__private__/FilterButton.js +0 -89
- package/src/components/molecules/multiple-select-filter/__private__/FilterDropdown.js +0 -27
- package/src/components/molecules/multiple-select-filter/__private__/FilterableList.js +0 -146
- package/src/components/molecules/multiple-select-filter/__private__/FilterableListItem.js +0 -79
- package/src/components/molecules/multiple-select-filter/__private__/SearchBox.js +0 -41
- package/src/components/molecules/multiple-select-filter/__private__/useKeyboardNavigation.js +0 -84
- package/src/components/molecules/multiple-select-filter/__private__/util.js +0 -31
- package/src/components/molecules/toast-notification/ToastNotification.stories.js +0 -105
- /package/src/components/atoms/add-obligation/{AddObligation.stories.js → AddObligation.oldstories.js} +0 -0
- /package/src/components/atoms/amount-callout/{AmountCallout.stories.js → AmountCallout.oldstories.js} +0 -0
- /package/src/components/atoms/checkbox-list/{CheckboxList.stories.js → CheckboxList.oldstories.js} +0 -0
- /package/src/components/atoms/form-layouts/{FormLayouts.stories.js → FormLayouts.oldstories.js} +0 -0
- /package/src/components/atoms/hamburger-button/{HamburgerButton.stories.js → HamburgerButton.oldstories.js} +0 -0
- /package/src/components/atoms/heading/{Heading.stories.js → Heading.oldstories.js} +0 -0
- /package/src/components/atoms/layouts/examples/box-example/{BoxExample.stories.js → BoxExample.oldstories.js} +0 -0
- /package/src/components/atoms/layouts/examples/center-example/{CenterExample.stories.js → CenterExample.oldstories.js} +0 -0
- /package/src/components/atoms/layouts/examples/cluster-example/{ClusterExample.stories.js → ClusterExample.oldstories.js} +0 -0
- /package/src/components/atoms/layouts/examples/cover-example/{CoverExample.stories.js → CoverExample.oldstories.js} +0 -0
- /package/src/components/atoms/layouts/examples/frame-example/{FrameExample.stories.js → FrameExample.oldstories.js} +0 -0
- /package/src/components/atoms/layouts/examples/grid-example/{GridExample.stories.js → GridExample.oldstories.js} +0 -0
- /package/src/components/atoms/layouts/examples/imposter-example/{ImposterExample.stories.js → ImposterExample.oldstories.js} +0 -0
- /package/src/components/atoms/layouts/examples/motion-example/{MotionExample.stories.js → MotionExample.oldstories.js} +0 -0
- /package/src/components/atoms/layouts/examples/reel-example/{ReelExample.stories.js → ReelExample.oldstories.js} +0 -0
- /package/src/components/atoms/layouts/examples/sidebar-example/{SidebarExample.stories.js → SidebarExample.oldstories.js} +0 -0
- /package/src/components/atoms/layouts/examples/stack-example/{StackExample.stories.js → StackExample.oldstories.js} +0 -0
- /package/src/components/atoms/layouts/examples/switcher-example/{SwitcherExample.stories.js → SwitcherExample.oldstories.js} +0 -0
- /package/src/components/atoms/paragraph/{Paragraph.stories.js → Paragraph.oldstories.js} +0 -0
- /package/src/components/atoms/processing-fee/{ProcessingFee.stories.js → ProcessingFee.oldstories.js} +0 -0
- /package/src/components/atoms/search/{Search.stories.js → Search.oldstories.js} +0 -0
- /package/src/components/atoms/solid-divider/{SolidDivider.stories.js → SolidDivider.oldstories.js} +0 -0
- /package/src/components/atoms/sortable-table-heading/{SortableTableHeading.stories.js → SortableTableHeading.oldstories.js} +0 -0
- /package/src/components/atoms/spinner/{Spinner.stories.js → Spinner.oldstories.js} +0 -0
- /package/src/components/atoms/tab/{Tab.stories.js → Tab.oldstories.js} +0 -0
- /package/src/components/atoms/text/{Text.stories.js → Text.oldstories.js} +0 -0
- /package/src/components/atoms/typeahead-input/{TypeaheadIinput.stories.js → TypeaheadIinput.oldstories.js} +0 -0
- /package/src/components/atoms/wallet-name/{WalletName.stories.js → WalletName.oldstories.js} +0 -0
- /package/src/components/molecules/account-and-routing-modal/{AccountAndRoutingModal.stories.js → AccountAndRoutingModal.oldstories.js} +0 -0
- /package/src/components/molecules/editable-list/{EditableList.stories.js → EditableList.oldstories.js} +0 -0
- /package/src/components/molecules/email-form/{EmailForm.stories.js → EmailForm.oldstories.js} +0 -0
- /package/src/components/molecules/forgot-password-form/{ForgotPasswordForm.stories.js → ForgotPasswordForm.oldstories.js} +0 -0
- /package/src/components/molecules/highlight-tab-row/{HighlightTabRow.stories.js → HighlightTabRow.oldstories.js} +0 -0
- /package/src/components/molecules/obligation/modules/{AmountModule.stories.js → AmountModule.oldstories.js} +0 -0
- /package/src/components/molecules/payment-button-bar/{PaymentButtonBar.stories.js → PaymentButtonBar.oldstories.js} +0 -0
- /package/src/components/molecules/payment-details/{PaymentDetails.stories.js → PaymentDetails.oldstories.js} +0 -0
- /package/src/components/molecules/payment-form-ach/{PaymentFormACH.stories.js → PaymentFormACH.oldstories.js} +0 -0
- /package/src/components/molecules/payment-form-card/{PaymentFormCard.stories.js → PaymentFormCard.oldstories.js} +0 -0
- /package/src/components/molecules/periscope-dashboard-iframe/{PeriscopeDashBoardIframe.stories.js → PeriscopeDashBoardIframe.oldstories.js} +0 -0
- /package/src/components/molecules/phone-form/{PhoneForm.stories.js → PhoneForm.oldstories.js} +0 -0
- /package/src/components/molecules/popup-menu/{PopupMenu.stories.js → PopupMenu.oldstories.js} +0 -0
- /package/src/components/molecules/radio-group/{RadioGroup.stories.js → RadioGroup.oldstories.js} +0 -0
- /package/src/components/molecules/radio-section/{RadioSection.stories.js → RadioSection.oldstories.js} +0 -0
- /package/src/components/molecules/registration-form/{RegistrationForm.stories.js → RegistrationForm.oldstories.js} +0 -0
- /package/src/components/molecules/reset-confirmation-form/{ResetConfirmationForm.stories.js → ResetConfirmationForm.oldstories.js} +0 -0
- /package/src/components/molecules/reset-password-form/{ResetPasswordForm.stories.js → ResetPasswordForm.oldstories.js} +0 -0
- /package/src/components/molecules/reset-password-success/{ResetPasswordSuccess.stories.js → ResetPasswordSuccess.oldstories.js} +0 -0
- /package/src/components/molecules/tab-sidebar/{TabSidebar.stories.js → TabSidebar.oldstories.js} +0 -0
- /package/src/components/molecules/terms-and-conditions/{TermsAndConditions.stories.js → TermsAndConditions.oldstories.js} +0 -0
- /package/src/components/molecules/terms-and-conditions-modal/{TermsAndConditionsModal.stories.js → TermsAndConditionsModal.oldstories.js} +0 -0
- /package/src/components/molecules/workflow-tile/{WorkflowTile.stories.js → WorkflowTile.oldstories.js} +0 -0
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thecb/components",
|
|
3
|
-
"version": "10.12.
|
|
3
|
+
"version": "10.12.3-beta.0",
|
|
4
4
|
"description": "Common lib for CityBase react components",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"module": "dist/index.esm.js",
|
|
8
8
|
"source": "src/index.js",
|
|
9
9
|
"scripts": {
|
|
10
|
-
"storybook": "
|
|
11
|
-
"build": "rollup -cm"
|
|
10
|
+
"storybook": "storybook dev -p 6006",
|
|
11
|
+
"build": "rollup -cm",
|
|
12
|
+
"build-storybook": "storybook build"
|
|
12
13
|
},
|
|
13
14
|
"repository": {
|
|
14
15
|
"type": "git",
|
|
@@ -30,15 +31,22 @@
|
|
|
30
31
|
"@babel/preset-env": "^7.6.0",
|
|
31
32
|
"@babel/preset-react": "^7.0.0",
|
|
32
33
|
"@babel/register": "^7.6.2",
|
|
34
|
+
"@chromatic-com/storybook": "^1.4.0",
|
|
33
35
|
"@rollup/plugin-json": "^4.0.3",
|
|
34
|
-
"@storybook/addon-a11y": "
|
|
35
|
-
"@storybook/addon-
|
|
36
|
-
"@storybook/addon-
|
|
37
|
-
"@storybook/addon-
|
|
38
|
-
"@storybook/addon-
|
|
39
|
-
"@storybook/addon-
|
|
40
|
-
"@storybook/addon-
|
|
41
|
-
"@storybook/
|
|
36
|
+
"@storybook/addon-a11y": "7",
|
|
37
|
+
"@storybook/addon-essentials": "^8.1.1",
|
|
38
|
+
"@storybook/addon-interactions": "^8.1.1",
|
|
39
|
+
"@storybook/addon-links": "^8.1.1",
|
|
40
|
+
"@storybook/addon-mdx-gfm": "^8.1.1",
|
|
41
|
+
"@storybook/addon-onboarding": "^8.1.1",
|
|
42
|
+
"@storybook/addon-themes": "^8.1.3",
|
|
43
|
+
"@storybook/blocks": "^8.1.1",
|
|
44
|
+
"@storybook/react": "^8.1.1",
|
|
45
|
+
"@storybook/react-vite": "^8.1.1",
|
|
46
|
+
"@storybook/test": "^8.1.1",
|
|
47
|
+
"@storybook/test-runner": "0.18.0",
|
|
48
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
49
|
+
"axe-playwright": "^2.0.2",
|
|
42
50
|
"babel-core": "^6.26.3",
|
|
43
51
|
"babel-loader": "^8.1.0",
|
|
44
52
|
"babel-preset-env": "^1.7.0",
|
|
@@ -48,6 +56,7 @@
|
|
|
48
56
|
"eslint-plugin-babel": "^5.3.0",
|
|
49
57
|
"eslint-plugin-prettier": "^3.1.3",
|
|
50
58
|
"eslint-plugin-react": "^7.20.0",
|
|
59
|
+
"eslint-plugin-storybook": "^0.8.0",
|
|
51
60
|
"history": "^5.0.0",
|
|
52
61
|
"husky": "^4.2.3",
|
|
53
62
|
"prettier": "^1.19.1",
|
|
@@ -63,10 +72,12 @@
|
|
|
63
72
|
"rollup-plugin-node-resolve": "^5.1.0",
|
|
64
73
|
"rollup-plugin-ts": "^3.0.2",
|
|
65
74
|
"rollup-plugin-visualizer": "^4.0.4",
|
|
66
|
-
"storybook": "^
|
|
75
|
+
"storybook": "^8.1.1",
|
|
76
|
+
"storybook-addon-remix-react-router": "^3.0.0",
|
|
67
77
|
"styled-components": "^5.3.5",
|
|
68
78
|
"styled-theming": "^2.2.0",
|
|
69
|
-
"typescript": "^4.8.2"
|
|
79
|
+
"typescript": "^4.8.2",
|
|
80
|
+
"vite": "^5.2.11"
|
|
70
81
|
},
|
|
71
82
|
"peerDependencies": {
|
|
72
83
|
"react": "^16.13.1",
|
|
@@ -82,6 +93,7 @@
|
|
|
82
93
|
},
|
|
83
94
|
"dependencies": {
|
|
84
95
|
"@babel/runtime": "^7.15.4",
|
|
96
|
+
"@types/styled-components": "^5.1.34",
|
|
85
97
|
"core-js": "^3.22.5",
|
|
86
98
|
"formatted-input": "^1.0.0",
|
|
87
99
|
"framer-motion": "^1.11.0",
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as AlertStories from './Alert.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={AlertStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
The Alert component is a fully accesible element to provide notifications to a user. Its features include:
|
|
10
|
+
|
|
11
|
+
- Multiple types: info, warn, error, success
|
|
12
|
+
- Ability to allow user to dismiss the alert
|
|
13
|
+
- Default support of heading text, body text, and customizable children elements
|
|
14
|
+
- Highly customizable content via textOverride
|
|
15
|
+
- Accessibility props for aria-role, aria-atomic, and aria-live
|
|
16
|
+
|
|
17
|
+
<div style={{ marginBottom: "2em"}}>
|
|
18
|
+
<Story />
|
|
19
|
+
</div>
|
|
@@ -1,28 +1,150 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { CLOUDBURST_BLUE } from "../../../constants/colors";
|
|
3
|
+
import Badge from "../badge/Badge";
|
|
4
|
+
import ToggleSwitch from "../toggle-switch/ToggleSwitch";
|
|
5
|
+
import { Cluster, Box, Stack } from "../layouts";
|
|
6
|
+
import Text from "../text/Text";
|
|
3
7
|
import Alert from "./Alert";
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import { fn } from "@storybook/test";
|
|
9
|
+
|
|
10
|
+
const meta = {
|
|
11
|
+
title: "Atoms/Alert",
|
|
12
|
+
component: Alert,
|
|
13
|
+
parameters: {
|
|
14
|
+
layout: "centered"
|
|
15
|
+
},
|
|
16
|
+
tags: ["!autodocs"],
|
|
17
|
+
args: {
|
|
18
|
+
heading: "This is an alert!",
|
|
19
|
+
text:
|
|
20
|
+
"We display this message when we want to alert the user to some sort of event or error, such as when an API request has completed or failed.",
|
|
21
|
+
textOverride: null,
|
|
22
|
+
variant: "info",
|
|
23
|
+
children: null,
|
|
24
|
+
height: null,
|
|
25
|
+
onLinkClick: fn(),
|
|
26
|
+
padding: "0.5rem",
|
|
27
|
+
showQuitLink: true,
|
|
28
|
+
extraStyles: null,
|
|
29
|
+
maxContentWidth: null,
|
|
30
|
+
noBorder: false,
|
|
31
|
+
enableBoxShadow: false,
|
|
32
|
+
enableSmallText: false,
|
|
33
|
+
innerContentPadding: "1rem",
|
|
34
|
+
iconPadding: "0 0 0 1rem",
|
|
35
|
+
contentFullHeight: false,
|
|
36
|
+
ariaRole: null,
|
|
37
|
+
ariaAtomic: true,
|
|
38
|
+
ariaLive: "polite"
|
|
39
|
+
},
|
|
40
|
+
argTypes: {
|
|
41
|
+
heading: {
|
|
42
|
+
description: "Text that appears in the alert heading",
|
|
43
|
+
table: {
|
|
44
|
+
type: { summary: "string" },
|
|
45
|
+
defaultValue: { summary: undefined }
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
text: {
|
|
49
|
+
description: "Text that appears in the alert body",
|
|
50
|
+
table: {
|
|
51
|
+
type: { summary: "string" },
|
|
52
|
+
defaultValue: { summary: undefined }
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
textOverride: {
|
|
56
|
+
description:
|
|
57
|
+
"A JSX component that replaces the content otherwise specified with the Heading, Text, and Children props.",
|
|
58
|
+
table: {
|
|
59
|
+
type: { summary: "React Component" },
|
|
60
|
+
defaultValue: { summary: undefined }
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
variant: {
|
|
64
|
+
description: "The type of the alert",
|
|
65
|
+
table: {
|
|
66
|
+
type: { summary: "string" },
|
|
67
|
+
defaultValue: { summary: "info" }
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
children: {
|
|
71
|
+
description: "A react component to display below the body text",
|
|
72
|
+
table: {
|
|
73
|
+
type: { summary: "React Component" },
|
|
74
|
+
defaultValue: { summary: undefined }
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
showQuitLink: {
|
|
78
|
+
description: "Whether or not the alert is dismissable",
|
|
79
|
+
table: {
|
|
80
|
+
type: { summary: "boolean" },
|
|
81
|
+
defaultValue: { summary: true }
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export default meta;
|
|
88
|
+
|
|
89
|
+
export const Info = {
|
|
90
|
+
args: {
|
|
91
|
+
heading: "This is an info alert!"
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const Warn = {
|
|
96
|
+
args: {
|
|
97
|
+
variant: "warn",
|
|
98
|
+
heading: "This is a warning alert!"
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const Error = {
|
|
103
|
+
args: {
|
|
104
|
+
variant: "error",
|
|
105
|
+
heading: "This is an error alert!"
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export const Success = {
|
|
110
|
+
args: {
|
|
111
|
+
variant: "success",
|
|
112
|
+
heading: "This is a success alert!"
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const FancyAlert = props => {
|
|
117
|
+
const [toggleOn, setToggleOn] = useState(true);
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<Alert
|
|
121
|
+
{...props}
|
|
122
|
+
textOverride={
|
|
123
|
+
<Box padding="1rem" border={`1px dotted ${CLOUDBURST_BLUE}`}>
|
|
124
|
+
<Stack childGap="1.5rem" fullHeight>
|
|
125
|
+
<Text variant="pL" weight="600">
|
|
126
|
+
{`Alerts can be very fancy if you want!`}
|
|
127
|
+
</Text>
|
|
128
|
+
<Text variant="p" weight="400">
|
|
129
|
+
{`This particular alert uses the textOverride prop to supply a custom content component with unique text elements and a toggle switch. It also has a box shadow and the quit option to dismiss the alert has been disabled.`}
|
|
130
|
+
</Text>
|
|
131
|
+
<Cluster justify="space-between" align="center">
|
|
132
|
+
<ToggleSwitch
|
|
133
|
+
label="toggle!"
|
|
134
|
+
isOn={toggleOn}
|
|
135
|
+
onToggle={() => setToggleOn(!toggleOn)}
|
|
136
|
+
></ToggleSwitch>
|
|
137
|
+
<Badge variant="warn" label="Oh No!"></Badge>
|
|
138
|
+
</Cluster>
|
|
139
|
+
</Stack>
|
|
140
|
+
</Box>
|
|
141
|
+
}
|
|
142
|
+
enableBoxShadow={true}
|
|
143
|
+
showQuitLink={false}
|
|
144
|
+
/>
|
|
145
|
+
);
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export const CustomAlert = {
|
|
149
|
+
render: args => <FancyAlert {...args} />
|
|
12
150
|
};
|
|
13
|
-
const defaultValue = "info";
|
|
14
|
-
const groupId = "props";
|
|
15
|
-
|
|
16
|
-
export const alert = () => (
|
|
17
|
-
<Alert
|
|
18
|
-
variant={select(variantsLabel, variants, defaultValue, groupId)}
|
|
19
|
-
text={text("text", "Alert Bar", "props")}
|
|
20
|
-
showQuitLink={boolean("showQuitLink", true, "props")}
|
|
21
|
-
/>
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
const story = page({
|
|
25
|
-
title: "Components|Atoms/Alert",
|
|
26
|
-
Component: Alert
|
|
27
|
-
});
|
|
28
|
-
export default story;
|
|
@@ -30,8 +30,8 @@ const StyledBadge = styled(Text)`
|
|
|
30
30
|
}
|
|
31
31
|
`;
|
|
32
32
|
|
|
33
|
-
const Badge = ({ label, Icon, themeValues, iconOnLeft = true }) => (
|
|
34
|
-
<StyledBadgeContainer background={themeValues.background}>
|
|
33
|
+
const Badge = ({ label, Icon, themeValues, iconOnLeft = true, id }) => (
|
|
34
|
+
<StyledBadgeContainer background={themeValues.background} id={id}>
|
|
35
35
|
{iconOnLeft && Icon && (
|
|
36
36
|
<Icon color={themeValues.color} fill={themeValues.color} />
|
|
37
37
|
)}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as BadgeStories from './Badge.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={BadgeStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
The Badge component is a small component used to provide information in the form of an icon and text string to users at a glance. Badges can be used in tables, as tags, in UI controls, or anywhere display of bite-sized information is needed.
|
|
10
|
+
|
|
11
|
+
All themes use the same badge variants (and colors) as displayed here, but custom badges can be added to theme patterns in FCS if desired.
|
|
12
|
+
|
|
13
|
+
Badges have these properties:
|
|
14
|
+
|
|
15
|
+
- label (required)
|
|
16
|
+
- Icon (optional)
|
|
17
|
+
- variant (optional, default is "success")
|
|
18
|
+
- iconOnLeft (optional, default is "true")
|
|
19
|
+
|
|
20
|
+
Badge theme variants control *only* the background color of the badge and the color of its text. Icon color is either passed in as a prop to the Icon component (ideal), or controlled by the Icon themeing.
|
|
21
|
+
|
|
22
|
+
Note: if using the second approach, it is possible for the color of badge text and icon to diverge, possibly in undersible ways, unless special variants are added to the Icon themes in the FCS theme patterns. See the "Payment History" badge - try changing the theme in storybook - for an example of this.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
<div style={{ marginBottom: "2em"}}>
|
|
26
|
+
<Story />
|
|
27
|
+
</div>
|
|
@@ -1,33 +1,147 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
MANATEE_GREY,
|
|
4
|
+
MATISSE_BLUE,
|
|
5
|
+
ROYAL_BLUE_VIVID,
|
|
6
|
+
ZEST_ORANGE
|
|
7
|
+
} from "../../../constants/colors";
|
|
3
8
|
import Badge from "./Badge";
|
|
4
|
-
import
|
|
9
|
+
import { Box, Stack, Cluster } from "../layouts";
|
|
5
10
|
import AutopayIcon from "../icons/AutopayIcon";
|
|
11
|
+
import MultiCartIcon from "../icons/MultiCartIcon";
|
|
12
|
+
import RefundIconSmall from "../icons/RefundIconSmall";
|
|
13
|
+
import TrashIconV2 from "../icons/TrashIconV2";
|
|
14
|
+
import HistoryIconSmall from "../icons/HistoryIconSmall";
|
|
6
15
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
16
|
+
const meta = {
|
|
17
|
+
title: "Atoms/Badge",
|
|
18
|
+
component: Badge,
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: "centered"
|
|
21
|
+
},
|
|
22
|
+
tags: ["!autodocs"],
|
|
23
|
+
args: {
|
|
24
|
+
label: undefined,
|
|
25
|
+
Icon: undefined,
|
|
26
|
+
iconOnLeft: true,
|
|
27
|
+
variant: "success"
|
|
28
|
+
},
|
|
29
|
+
argTypes: {
|
|
30
|
+
label: {
|
|
31
|
+
description: "The text displayed inside the badge",
|
|
32
|
+
table: {
|
|
33
|
+
type: { summary: "string" },
|
|
34
|
+
defaultValue: { summary: undefined }
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
Icon: {
|
|
38
|
+
description: "An icon component to display on the badge",
|
|
39
|
+
table: {
|
|
40
|
+
type: { summary: "React Component" },
|
|
41
|
+
defaultValue: { summary: undefined }
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
iconOnLeft: {
|
|
45
|
+
description: "Position of the icon on the badge",
|
|
46
|
+
table: {
|
|
47
|
+
type: { summary: "boolean" },
|
|
48
|
+
defaultValue: { summary: true }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
variant: {
|
|
52
|
+
description: "The style of the badge",
|
|
53
|
+
table: {
|
|
54
|
+
type: { summary: "string" },
|
|
55
|
+
defaultValue: { summary: "success" }
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export default meta;
|
|
62
|
+
|
|
63
|
+
const SuccessBadge = props => {
|
|
64
|
+
return <Badge {...props} label={"Autopay On"} Icon={AutopayIcon} />;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const DisabledBadge = props => {
|
|
68
|
+
return (
|
|
69
|
+
<Badge
|
|
70
|
+
{...props}
|
|
71
|
+
label={"Enable Autopay"}
|
|
72
|
+
Icon={() => AutopayIcon({ fill: MANATEE_GREY })}
|
|
73
|
+
variant="disabled"
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const PrimaryBadge = props => {
|
|
79
|
+
return (
|
|
80
|
+
<Badge
|
|
81
|
+
{...props}
|
|
82
|
+
label={"Item in Cart"}
|
|
83
|
+
Icon={() => MultiCartIcon({ color: ROYAL_BLUE_VIVID })}
|
|
84
|
+
variant="primary"
|
|
85
|
+
/>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const InfoBadge = props => {
|
|
90
|
+
return (
|
|
91
|
+
<Badge
|
|
92
|
+
{...props}
|
|
93
|
+
label={"Payment History"}
|
|
94
|
+
Icon={() => HistoryIconSmall({ color: MATISSE_BLUE })}
|
|
95
|
+
variant="info"
|
|
96
|
+
/>
|
|
97
|
+
);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const WarnBadge = props => {
|
|
101
|
+
return (
|
|
102
|
+
<Badge
|
|
103
|
+
{...props}
|
|
104
|
+
label={"Refund Payment"}
|
|
105
|
+
Icon={() => RefundIconSmall({ color: ZEST_ORANGE })}
|
|
106
|
+
variant="warn"
|
|
107
|
+
/>
|
|
108
|
+
);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const RightIconBadge = props => {
|
|
112
|
+
return (
|
|
113
|
+
<Badge
|
|
114
|
+
{...props}
|
|
115
|
+
label={"Delete Record"}
|
|
116
|
+
Icon={() => TrashIconV2({ iconFill: ZEST_ORANGE })}
|
|
117
|
+
variant="warn"
|
|
118
|
+
iconOnLeft={false}
|
|
119
|
+
/>
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const NoIconBadge = props => {
|
|
124
|
+
return <Badge {...props} label={"Paid Off"} variant="success" />;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export const Badges = {
|
|
128
|
+
render: args => {
|
|
129
|
+
return (
|
|
130
|
+
<Box padding="1rem">
|
|
131
|
+
<Stack childGap="2rem">
|
|
132
|
+
<Cluster justify="flex-start" align="center" childGap="1.5rem">
|
|
133
|
+
<SuccessBadge {...args} />
|
|
134
|
+
<DisabledBadge {...args} />
|
|
135
|
+
<PrimaryBadge {...args} />
|
|
136
|
+
<WarnBadge {...args} />
|
|
137
|
+
</Cluster>
|
|
138
|
+
<Cluster justify="flex-start" align="center" childGap="1.5rem">
|
|
139
|
+
<InfoBadge {...args} />
|
|
140
|
+
<RightIconBadge {...args} />
|
|
141
|
+
<NoIconBadge {...args} />
|
|
142
|
+
</Cluster>
|
|
143
|
+
</Stack>
|
|
144
|
+
</Box>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as BreadcrumbStories from './Breadcrumb.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={BreadcrumbStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
Breadcrumb is a themeable component that generates a horizontal navigation with links separated by chevron icons.
|
|
10
|
+
|
|
11
|
+
The component only takes on prop: `breadcrumbsList`, which must be an array of objects with the following properties:
|
|
12
|
+
|
|
13
|
+
- `linkText`: string for the link's text
|
|
14
|
+
- `linkDestination`: string or react-router path for the link's URL
|
|
15
|
+
- `isActive`: boolean, changes the style and cursor of the link to represent the current page
|
|
16
|
+
|
|
17
|
+
Breadcrumb uses the InternalLink component for each crumb, which uses the Link component from react-router-dom.
|
|
18
|
+
|
|
19
|
+
<Story />
|
|
20
|
+
|
|
21
|
+
<Controls />
|
|
@@ -1,38 +1,47 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { object } from "@storybook/addon-knobs";
|
|
3
1
|
import Breadcrumb from "./Breadcrumb";
|
|
4
|
-
import page from "../../../../.storybook/page";
|
|
5
2
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "Atoms/Breadcrumb",
|
|
5
|
+
component: Breadcrumb,
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: "centered",
|
|
8
|
+
controls: { expanded: true }
|
|
9
|
+
},
|
|
10
|
+
tags: ["!autodocs"],
|
|
11
|
+
args: {
|
|
12
|
+
breadcrumbsList: []
|
|
13
|
+
},
|
|
14
|
+
argTypes: {
|
|
15
|
+
breadcrumbsList: {
|
|
16
|
+
control: { type: "array" },
|
|
17
|
+
table: {
|
|
18
|
+
type: { summary: "array" },
|
|
19
|
+
defaultValue: { summary: [] }
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
11
23
|
};
|
|
12
24
|
|
|
13
|
-
|
|
14
|
-
const defaultActiveValue = {
|
|
15
|
-
linkText: "Page",
|
|
16
|
-
linkDestination: location.pathname,
|
|
17
|
-
isActive: true
|
|
18
|
-
};
|
|
19
|
-
const groupId = "props";
|
|
25
|
+
export default meta;
|
|
20
26
|
|
|
21
|
-
export const
|
|
22
|
-
|
|
23
|
-
breadcrumbsList
|
|
27
|
+
export const Basic = {
|
|
28
|
+
args: {
|
|
29
|
+
breadcrumbsList: [
|
|
30
|
+
{
|
|
31
|
+
linkText: "Home",
|
|
32
|
+
linkDestination: "/",
|
|
33
|
+
isActive: false
|
|
34
|
+
},
|
|
24
35
|
{
|
|
25
|
-
|
|
36
|
+
linkText: "Page",
|
|
37
|
+
linkDestination: "/page",
|
|
38
|
+
isActive: false
|
|
26
39
|
},
|
|
27
40
|
{
|
|
28
|
-
|
|
41
|
+
linkText: "Another Page",
|
|
42
|
+
linkDestination: "/another-page",
|
|
43
|
+
isActive: true
|
|
29
44
|
}
|
|
30
|
-
]
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const story = page({
|
|
35
|
-
title: "Components|Atoms/Breadcrumb",
|
|
36
|
-
Component: Breadcrumb
|
|
37
|
-
});
|
|
38
|
-
export default story;
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
};
|