@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
|
@@ -1,32 +1,138 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { select, text } from "@storybook/addon-knobs";
|
|
3
1
|
import FormattedAddress from "./FormattedAddress";
|
|
4
|
-
import
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Atoms/FormattedAddress",
|
|
6
|
+
component: FormattedAddress,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "centered",
|
|
9
|
+
controls: { expanded: true }
|
|
10
|
+
},
|
|
11
|
+
tags: ["!autodocs"],
|
|
12
|
+
args: {
|
|
13
|
+
street1: undefined,
|
|
14
|
+
city: undefined,
|
|
15
|
+
stateProvince: undefined,
|
|
16
|
+
country: undefined,
|
|
17
|
+
zip: undefined,
|
|
18
|
+
street2: null,
|
|
19
|
+
name: null,
|
|
20
|
+
themeValues: undefined,
|
|
21
|
+
qaPrefix: "address"
|
|
22
|
+
},
|
|
23
|
+
argTypes: {
|
|
24
|
+
street1: {
|
|
25
|
+
control: { type: "text" },
|
|
26
|
+
table: {
|
|
27
|
+
type: { summary: "string" },
|
|
28
|
+
defaultValue: { summary: undefined }
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
street2: {
|
|
32
|
+
description: "Optional",
|
|
33
|
+
control: { type: "text" },
|
|
34
|
+
table: {
|
|
35
|
+
type: { summary: "string" },
|
|
36
|
+
defaultValue: { summary: null }
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
city: {
|
|
40
|
+
control: { type: "text" },
|
|
41
|
+
table: {
|
|
42
|
+
type: { summary: "string" },
|
|
43
|
+
defaultValue: { summary: undefined }
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
stateProvince: {
|
|
47
|
+
control: { type: "text" },
|
|
48
|
+
table: {
|
|
49
|
+
type: { summary: "string" },
|
|
50
|
+
defaultValue: { summary: undefined }
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
country: {
|
|
54
|
+
description: "Optional",
|
|
55
|
+
control: { type: "text" },
|
|
56
|
+
table: {
|
|
57
|
+
type: { summary: "string" },
|
|
58
|
+
defaultValue: { summary: undefined }
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
zip: {
|
|
62
|
+
control: { type: "text" },
|
|
63
|
+
table: {
|
|
64
|
+
type: { summary: "string" },
|
|
65
|
+
defaultValue: { summary: undefined }
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
name: {
|
|
69
|
+
description: "Optional",
|
|
70
|
+
control: { type: "text" },
|
|
71
|
+
table: {
|
|
72
|
+
type: { summary: "string" },
|
|
73
|
+
defaultValue: { summary: null }
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
qaPrefix: {
|
|
77
|
+
control: { type: "text" },
|
|
78
|
+
table: {
|
|
79
|
+
type: { summary: "string" },
|
|
80
|
+
defaultValue: { summary: "address" }
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export default meta;
|
|
5
87
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
88
|
+
export const Basic = {
|
|
89
|
+
args: {
|
|
90
|
+
street1: "363 W. Erie St.",
|
|
91
|
+
city: "Chicago",
|
|
92
|
+
stateProvince: "IL",
|
|
93
|
+
zip: "60654"
|
|
94
|
+
}
|
|
11
95
|
};
|
|
12
|
-
const defaultValue = "default";
|
|
13
|
-
const groupId = "props";
|
|
14
96
|
|
|
15
|
-
export const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
name={text("name", "Citybase", groupId)}
|
|
25
|
-
/>
|
|
26
|
-
);
|
|
97
|
+
export const WithName = {
|
|
98
|
+
args: {
|
|
99
|
+
street1: "363 W. Erie St.",
|
|
100
|
+
city: "Chicago",
|
|
101
|
+
stateProvince: "IL",
|
|
102
|
+
zip: "60654",
|
|
103
|
+
name: "John Doe"
|
|
104
|
+
}
|
|
105
|
+
};
|
|
27
106
|
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
107
|
+
export const WithStreet2 = {
|
|
108
|
+
args: {
|
|
109
|
+
street1: "363 W. Erie St.",
|
|
110
|
+
city: "Chicago",
|
|
111
|
+
stateProvince: "IL",
|
|
112
|
+
zip: "60654",
|
|
113
|
+
street2: "Floor 7"
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export const WithCountry = {
|
|
118
|
+
args: {
|
|
119
|
+
street1: "363 W. Erie St.",
|
|
120
|
+
city: "Chicago",
|
|
121
|
+
stateProvince: "IL",
|
|
122
|
+
zip: "60654",
|
|
123
|
+
country: "USA"
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export const WithAllProps = {
|
|
128
|
+
args: {
|
|
129
|
+
name: "John Doe",
|
|
130
|
+
street1: "363 W. Erie St.",
|
|
131
|
+
street2: "Floor 7",
|
|
132
|
+
city: "Chicago",
|
|
133
|
+
stateProvince: "IL",
|
|
134
|
+
zip: "60654",
|
|
135
|
+
country: "USA",
|
|
136
|
+
qaPrefix: "all-props"
|
|
137
|
+
}
|
|
138
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as FormattedBankAccountStories from './FormattedBankAccount.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={FormattedBankAccountStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
The FormattedBankAccount is a simple component that takes bank account information and presents it in a standard way that can be reused throughout applications. The component requires:
|
|
10
|
+
|
|
11
|
+
- lastFour (last four of the account number),
|
|
12
|
+
- accountType (one of CHECKING or SAVINGS),
|
|
13
|
+
- autoPay (boolean, whether an autopay is associated with the account)
|
|
14
|
+
|
|
15
|
+
<div style={{ marginBottom: "2em"}}>
|
|
16
|
+
<Story />
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import FormattedBankAccount from "./FormattedBankAccount";
|
|
2
|
+
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "Atoms/FormattedBankAccount",
|
|
5
|
+
component: FormattedBankAccount,
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: "centered"
|
|
8
|
+
},
|
|
9
|
+
tags: ["!autodocs"],
|
|
10
|
+
args: {
|
|
11
|
+
lastFour: "9456",
|
|
12
|
+
accountType: "CHECKING",
|
|
13
|
+
autoPay: false
|
|
14
|
+
},
|
|
15
|
+
argTypes: {
|
|
16
|
+
lastFour: {
|
|
17
|
+
description: "The last four digits of the bank account number",
|
|
18
|
+
table: {
|
|
19
|
+
type: { summary: "string" },
|
|
20
|
+
defaultValue: { summary: undefined }
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
accountType: {
|
|
24
|
+
description: "The type of bank account - either CHECKING or SAVINGS",
|
|
25
|
+
table: {
|
|
26
|
+
type: { summary: "string" },
|
|
27
|
+
defaultValue: { summary: undefined }
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
autoPay: {
|
|
31
|
+
description: "Whether the bank account is being used for autopay",
|
|
32
|
+
table: {
|
|
33
|
+
type: { summary: "boolean" },
|
|
34
|
+
defaultValue: { summary: undefined }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default meta;
|
|
41
|
+
|
|
42
|
+
export const FormattedCheckingAccount = {};
|
|
43
|
+
|
|
44
|
+
export const FormattedSavingsAccount = {
|
|
45
|
+
args: {
|
|
46
|
+
lastFour: "5139",
|
|
47
|
+
accountType: "SAVINGS"
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const AccountWithAutopay = {
|
|
52
|
+
args: {
|
|
53
|
+
lastFour: "7291",
|
|
54
|
+
accountType: "CHECKING",
|
|
55
|
+
autoPay: true
|
|
56
|
+
}
|
|
57
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as FormattedCreditCardStories from './FormattedCreditCard.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={FormattedCreditCardStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
The FormattedCreditCard is a simple component that takes credit card information and presents it in a standard way that can be reused throughout applications. The component requires:
|
|
10
|
+
|
|
11
|
+
- lastFour (last four of the account number),
|
|
12
|
+
- autoPay (boolean, whether an autopay is associated with the account)
|
|
13
|
+
- expirationStatus (one of ACTIVE, EXPIRING_SOON, EXPIRED)
|
|
14
|
+
- expireDate (date of card expiration in MM/YY)
|
|
15
|
+
|
|
16
|
+
The expirationStatus of a card is typically managed by the application consuming this component. That status can either be received from an API call, or generated using logic in a utility function. Navigate uses the following utility function to attach a status to credit cards:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
export const getCardExpirationStatus = card => {
|
|
20
|
+
const ACTIVE = "ACTIVE";
|
|
21
|
+
const EXPIRING_SOON = "EXPIRING_SOON";
|
|
22
|
+
const EXPIRED = "EXPIRED";
|
|
23
|
+
|
|
24
|
+
const { expiryMonth, expiryYear } = card;
|
|
25
|
+
const today = dayjs();
|
|
26
|
+
const expiration = dayjs(`20${expiryYear}-${expiryMonth}`);
|
|
27
|
+
const cardExpirationStatus = expiration.diff(today, "months");
|
|
28
|
+
|
|
29
|
+
return cardExpirationStatus >= 1
|
|
30
|
+
? ACTIVE
|
|
31
|
+
: cardExpirationStatus === 0
|
|
32
|
+
? EXPIRING_SOON
|
|
33
|
+
: EXPIRED;
|
|
34
|
+
};
|
|
35
|
+
```
|
|
36
|
+
The text for a card's expiration status and date is generated by the `renderCardStatus` function in the formats.js file of this library.
|
|
37
|
+
|
|
38
|
+
<div style={{ marginBottom: "2em"}}>
|
|
39
|
+
<Story />
|
|
40
|
+
</div>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import FormattedCreditCard from "./FormattedCreditCard";
|
|
2
|
+
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "Atoms/FormattedCreditCard",
|
|
5
|
+
component: FormattedCreditCard,
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: "centered"
|
|
8
|
+
},
|
|
9
|
+
tags: ["!autodocs"],
|
|
10
|
+
args: {
|
|
11
|
+
lastFour: "1003",
|
|
12
|
+
autoPay: false,
|
|
13
|
+
expirationDate: undefined,
|
|
14
|
+
expirationStatus: undefined
|
|
15
|
+
},
|
|
16
|
+
argTypes: {
|
|
17
|
+
lastFour: {
|
|
18
|
+
description: "The last four digits of the credit card number",
|
|
19
|
+
table: {
|
|
20
|
+
type: { summary: "string" },
|
|
21
|
+
defaultValue: { summary: undefined }
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
autoPay: {
|
|
25
|
+
description: "Whether the bank account is being used for autopay",
|
|
26
|
+
table: {
|
|
27
|
+
type: { summary: "boolean" },
|
|
28
|
+
defaultValue: { summary: undefined }
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
expirationDate: {
|
|
32
|
+
description: "The expiration date of the credit card",
|
|
33
|
+
table: {
|
|
34
|
+
type: { summary: "string" },
|
|
35
|
+
defaultValue: { summary: undefined }
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
expirationStatus: {
|
|
39
|
+
description:
|
|
40
|
+
"Whether a card will expire soon, one of ACTIVE, EXPIRING_SOON, or EXPIRED",
|
|
41
|
+
table: {
|
|
42
|
+
type: { summary: "string" },
|
|
43
|
+
defaultValue: { summary: undefined }
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default meta;
|
|
50
|
+
|
|
51
|
+
export const ActiveCreditCard = {
|
|
52
|
+
args: {
|
|
53
|
+
autoPay: true,
|
|
54
|
+
expireDate: "10/29",
|
|
55
|
+
expirationStatus: "ACTIVE"
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const ExpiringSoonCreditCard = {
|
|
60
|
+
args: {
|
|
61
|
+
lastFour: "2613",
|
|
62
|
+
expireDate: "12/24",
|
|
63
|
+
expirationStatus: "EXPIRING_SOON",
|
|
64
|
+
autoPay: true
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const ExpiredCreditCard = {
|
|
69
|
+
args: {
|
|
70
|
+
lastFour: "8054",
|
|
71
|
+
expireDate: "01/24",
|
|
72
|
+
expirationStatus: "EXPIRED"
|
|
73
|
+
}
|
|
74
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as IconsStories from './Icons.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={IconsStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
The icons folder contains a variety of components which render SVGs, ranging from simple icons to large graphics.
|
|
10
|
+
|
|
11
|
+
## Theming
|
|
12
|
+
|
|
13
|
+
Some of the icon components are themeable through the `themeValues` object prop. The properties used from the `themeValues` vary between components.
|
|
14
|
+
|
|
15
|
+
### Variants
|
|
16
|
+
|
|
17
|
+
Some icons support variants from themes, including `info`, `success`, and `error`.
|
|
18
|
+
|
|
19
|
+
## Props
|
|
20
|
+
|
|
21
|
+
Many icon components make use of additional props:
|
|
22
|
+
|
|
23
|
+
<Controls />
|
|
24
|
+
|
|
25
|
+
## Additional Props
|
|
26
|
+
|
|
27
|
+
The following components will pass along _all_ other props to their wrapping elements via the spread operator: `EmptyCartIconV2`, `CloseIcon`, `MultiCartIcon`.
|
|
28
|
+
|
|
29
|
+
## IconAdd Styling
|
|
30
|
+
|
|
31
|
+
`IconAdd` needs color values set in CSS in order to display:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
.fill { fill: #000 }
|
|
35
|
+
.stroke { stroke: #000 }
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## ExternalLinkIcon
|
|
39
|
+
|
|
40
|
+
`ExternalLinkIcon` must be passed a value for `linkColor` in order to be visible.
|