@thecb/components 10.12.6-beta.0 → 11.0.0-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 +14 -6
- package/dist/index.cjs.js +1311 -1482
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1311 -1483
- package/dist/index.esm.js.map +1 -1
- package/package.json +25 -13
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- 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.mdx +41 -0
- package/src/components/atoms/card/Card.stories.js +351 -0
- package/src/components/atoms/card/CardText.js +6 -1
- package/src/components/atoms/checkbox/Checkbox.mdx +15 -0
- package/src/components/atoms/checkbox/Checkbox.oldstories.js +34 -0
- package/src/components/atoms/checkbox/Checkbox.stories.js +140 -25
- 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/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/.DS_Store +0 -0
- 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/.DS_Store +0 -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/obligation/.DS_Store +0 -0
- 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/util/idleTimerUtils.js +36 -0
- package/src/util/index.js +3 -1
- package/src/components/molecules/edit-name-form/EdidNameForm.stories.js +0 -24
- 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/icons/{icons.stories.js → icons.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/multiple-select-filter/{MultipleSelectFilter.stories.js → MultipleSelectFilter.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,87 +1,302 @@
|
|
|
1
|
-
import page from "../../../../.storybook/page";
|
|
2
|
-
import { boolean, text } from "@storybook/addon-knobs";
|
|
3
1
|
import React from "react";
|
|
4
|
-
import LinkCard from "./LinkCard";
|
|
5
|
-
import Box from "../../atoms/layouts/Box";
|
|
6
|
-
import Stack from "../../atoms/layouts/Stack";
|
|
7
|
-
import Text from "../../atoms/text/Text";
|
|
8
|
-
import Badge from "../../atoms/badge/Badge";
|
|
9
|
-
import PlusCircleIcon from "../../atoms/icons/PlusCircleIcon";
|
|
10
|
-
import AutopayIcon from "../../atoms/icons/AutopayIcon";
|
|
11
2
|
import {
|
|
12
|
-
|
|
13
|
-
ROYAL_BLUE_VIVID,
|
|
14
|
-
LINK_WATER,
|
|
15
|
-
WHITE,
|
|
3
|
+
COOL_GREY_05,
|
|
16
4
|
MANATEE_GREY,
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
ROYAL_BLUE_VIVID,
|
|
6
|
+
SEA_GREEN
|
|
19
7
|
} from "../../../constants/colors";
|
|
8
|
+
import { Box } from "../../atoms/layouts";
|
|
9
|
+
import LinkCard from "./LinkCard";
|
|
10
|
+
import Badge from "../../atoms/badge/Badge";
|
|
11
|
+
import { fn } from "@storybook/test";
|
|
12
|
+
import AutopayIcon from "../../atoms/icons/AutopayIcon";
|
|
13
|
+
import ArrowRightIcon from "../../atoms/icons/ArrowRightIcon";
|
|
14
|
+
import PlusCircleIcon from "../../atoms/icons/PlusCircleIcon";
|
|
15
|
+
import Text from "../../atoms/text";
|
|
20
16
|
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
const meta = {
|
|
18
|
+
title: "Molecules/LinkCard",
|
|
19
|
+
component: LinkCard,
|
|
20
|
+
parameters: {
|
|
21
|
+
layout: "centered"
|
|
22
|
+
},
|
|
23
|
+
tags: ["!autodocs"],
|
|
24
|
+
args: {
|
|
25
|
+
title: "Test Workflow",
|
|
26
|
+
subtitle: "Link your benefit plan",
|
|
27
|
+
showLeft: undefined,
|
|
28
|
+
leftContent: undefined,
|
|
29
|
+
showRight: undefined,
|
|
30
|
+
rightContent: undefined,
|
|
31
|
+
onClick: fn(),
|
|
32
|
+
extraStyles: "",
|
|
33
|
+
extraActiveStyles: "",
|
|
34
|
+
extraHoverStyles: "",
|
|
35
|
+
titleVariant: "h3",
|
|
36
|
+
disabled: false
|
|
37
|
+
},
|
|
38
|
+
argTypes: {
|
|
39
|
+
title: {
|
|
40
|
+
description: "Text to display in the LinkCard's title area",
|
|
41
|
+
table: {
|
|
42
|
+
type: { summary: "string" },
|
|
43
|
+
defaultValue: { summary: "Test Workflow" }
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
subtitle: {
|
|
47
|
+
description: "Text to display in the LinkCard's body area",
|
|
48
|
+
table: {
|
|
49
|
+
type: { summary: "string" },
|
|
50
|
+
defaultValue: { summary: "Link your benefit plan" }
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
showLeft: {
|
|
54
|
+
description: "Whether to show the LinkCard's left content",
|
|
55
|
+
table: {
|
|
56
|
+
type: { summary: "boolean" },
|
|
57
|
+
defaultValue: { summary: undefined }
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
leftContent: {
|
|
61
|
+
description: "Component to render on LinkCard's left side",
|
|
62
|
+
table: {
|
|
63
|
+
type: { summary: "React Component" },
|
|
64
|
+
defaultValue: { summary: undefined }
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
showRight: {
|
|
68
|
+
description: "Whether to show LinkCard's right content",
|
|
69
|
+
table: {
|
|
70
|
+
type: { summary: "boolean" },
|
|
71
|
+
defaultValue: { summary: undefined }
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
rightContent: {
|
|
75
|
+
description: "Component to render on LinkCard's right side",
|
|
76
|
+
table: {
|
|
77
|
+
type: { summary: "React Component" },
|
|
78
|
+
defaultValue: { summary: undefined }
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
onClick: {
|
|
82
|
+
description: "Function to execute on click of LinkCard",
|
|
83
|
+
table: {
|
|
84
|
+
type: { summary: "function" },
|
|
85
|
+
defaultValue: { summary: undefined }
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
extraStyles: {
|
|
89
|
+
description: "Extra styles to apply to the LinkCard",
|
|
90
|
+
table: {
|
|
91
|
+
type: { summary: "string" },
|
|
92
|
+
defaultValue: { summary: undefined }
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
extraActiveStyles: {
|
|
96
|
+
descripton:
|
|
97
|
+
"Extra styles to apply to the LinkCard when it is in an active state",
|
|
98
|
+
table: {
|
|
99
|
+
type: { summary: "string" },
|
|
100
|
+
defaultValue: { summary: undefined }
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
extraHoverStyles: {
|
|
104
|
+
description:
|
|
105
|
+
"Extra styles to apply to the LinkCard when it is being hovered",
|
|
106
|
+
table: {
|
|
107
|
+
type: { summary: "string" },
|
|
108
|
+
defaultValue: { summary: undefined }
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
titleVariant: {
|
|
112
|
+
description: "HTML element to use for title element, default is h3",
|
|
113
|
+
table: {
|
|
114
|
+
type: { summary: "string" },
|
|
115
|
+
defaultValue: { summary: "h3" }
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
disabled: {
|
|
119
|
+
description: "Whether the card is disabled",
|
|
120
|
+
table: {
|
|
121
|
+
type: { summary: "boolean" },
|
|
122
|
+
defaultValue: { summary: false }
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
29
126
|
};
|
|
30
127
|
|
|
31
|
-
|
|
32
|
-
const disabled = false;
|
|
33
|
-
const showLeft = true;
|
|
128
|
+
export default meta;
|
|
34
129
|
|
|
35
|
-
export const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
130
|
+
export const BasicLinkCard = {
|
|
131
|
+
args: {
|
|
132
|
+
title: "Construction Permits",
|
|
133
|
+
subtitle: "Cityville Department of Building Inspection"
|
|
134
|
+
},
|
|
135
|
+
render: args => {
|
|
136
|
+
return (
|
|
137
|
+
<LinkCard
|
|
138
|
+
{...args}
|
|
139
|
+
key="link-card-basic"
|
|
140
|
+
extraStyles={`transition: all .2s ease-in-out;`}
|
|
141
|
+
extraHoverStyles={`.show-on-hover {opacity: 1}`}
|
|
142
|
+
showLeft={false}
|
|
143
|
+
leftContent={
|
|
47
144
|
<Badge
|
|
48
145
|
label="Autopay Available"
|
|
49
|
-
|
|
50
|
-
|
|
146
|
+
variant={"success"}
|
|
147
|
+
Icon={() =>
|
|
148
|
+
AutopayIcon({
|
|
149
|
+
fill: SEA_GREEN
|
|
150
|
+
})
|
|
151
|
+
}
|
|
51
152
|
/>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
153
|
+
}
|
|
154
|
+
showRight={true}
|
|
155
|
+
rightContent={
|
|
156
|
+
<Box
|
|
157
|
+
data-qa={`find-or-pay`}
|
|
158
|
+
extraStyles={`
|
|
159
|
+
display: flex;
|
|
160
|
+
gap: 6px;
|
|
161
|
+
justify-content: space-between;
|
|
162
|
+
align-items: center;
|
|
163
|
+
`}
|
|
164
|
+
padding="0"
|
|
165
|
+
hoverStyles=".show-on-hover {opacity: 1;}"
|
|
64
166
|
>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
167
|
+
<Text
|
|
168
|
+
variant="pS"
|
|
169
|
+
className="show-on-hover"
|
|
170
|
+
color={ROYAL_BLUE_VIVID}
|
|
171
|
+
id={`workflow`}
|
|
172
|
+
extraStyles={`
|
|
173
|
+
transition: opacity .2s ease-in-out;
|
|
174
|
+
opacity: 0
|
|
175
|
+
`}
|
|
176
|
+
>
|
|
177
|
+
{"Pay"}
|
|
178
|
+
</Text>
|
|
179
|
+
<ArrowRightIcon labelledBy={`workflow`} color={ROYAL_BLUE_VIVID} />
|
|
180
|
+
</Box>
|
|
181
|
+
}
|
|
182
|
+
/>
|
|
183
|
+
);
|
|
184
|
+
}
|
|
80
185
|
};
|
|
81
186
|
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
187
|
+
export const CompleteLinkCard = {
|
|
188
|
+
args: {
|
|
189
|
+
title: "Water Bills - Autopay",
|
|
190
|
+
subittle: "Cityville Water Management"
|
|
191
|
+
},
|
|
192
|
+
render: args => {
|
|
193
|
+
return (
|
|
194
|
+
<LinkCard
|
|
195
|
+
{...args}
|
|
196
|
+
extraStyles={`transition: all .2s ease-in-out;`}
|
|
197
|
+
extraHoverStyles={`.show-on-hover {opacity: 1}`}
|
|
198
|
+
showLeft={true}
|
|
199
|
+
leftContent={
|
|
200
|
+
<Badge
|
|
201
|
+
label="Autopay Available"
|
|
202
|
+
variant={"success"}
|
|
203
|
+
Icon={() =>
|
|
204
|
+
AutopayIcon({
|
|
205
|
+
fill: SEA_GREEN
|
|
206
|
+
})
|
|
207
|
+
}
|
|
208
|
+
/>
|
|
209
|
+
}
|
|
210
|
+
showRight={true}
|
|
211
|
+
rightContent={
|
|
212
|
+
<Box
|
|
213
|
+
extraStyles={`
|
|
214
|
+
display: flex;
|
|
215
|
+
gap: 6px;
|
|
216
|
+
justify-content: space-between;
|
|
217
|
+
align-items: center;
|
|
218
|
+
`}
|
|
219
|
+
padding="0"
|
|
220
|
+
hoverStyles=".show-on-hover {opacity: 1;}"
|
|
221
|
+
>
|
|
222
|
+
<Text
|
|
223
|
+
variant="pS"
|
|
224
|
+
className="show-on-hover"
|
|
225
|
+
color={ROYAL_BLUE_VIVID}
|
|
226
|
+
id={`workflow-two`}
|
|
227
|
+
extraStyles={`
|
|
228
|
+
transition: opacity .2s ease-in-out;
|
|
229
|
+
opacity: 0
|
|
230
|
+
`}
|
|
231
|
+
>
|
|
232
|
+
{"Find"}
|
|
233
|
+
</Text>
|
|
234
|
+
<PlusCircleIcon
|
|
235
|
+
labelledBy={`workflow-two`}
|
|
236
|
+
color={ROYAL_BLUE_VIVID}
|
|
237
|
+
/>
|
|
238
|
+
</Box>
|
|
239
|
+
}
|
|
240
|
+
/>
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
};
|
|
86
244
|
|
|
87
|
-
export
|
|
245
|
+
export const DisabledLinkCard = {
|
|
246
|
+
args: {
|
|
247
|
+
title: "Property Tax - Autopay",
|
|
248
|
+
subtitle: ""
|
|
249
|
+
},
|
|
250
|
+
render: args => {
|
|
251
|
+
return (
|
|
252
|
+
<LinkCard
|
|
253
|
+
{...args}
|
|
254
|
+
extraHoverStyles={`box-shadow: none; cursor: default; .show-on-hover {opacity: 0}`}
|
|
255
|
+
disabled={true}
|
|
256
|
+
showLeft={true}
|
|
257
|
+
leftContent={
|
|
258
|
+
<Badge
|
|
259
|
+
label="Autopay Available"
|
|
260
|
+
variant={"disabled"}
|
|
261
|
+
Icon={() =>
|
|
262
|
+
AutopayIcon({
|
|
263
|
+
fill: MANATEE_GREY
|
|
264
|
+
})
|
|
265
|
+
}
|
|
266
|
+
/>
|
|
267
|
+
}
|
|
268
|
+
showRight={true}
|
|
269
|
+
rightContent={
|
|
270
|
+
<Box
|
|
271
|
+
data-qa={`find-or-pay-disabled`}
|
|
272
|
+
extraStyles={`
|
|
273
|
+
display: flex;
|
|
274
|
+
gap: 6px;
|
|
275
|
+
justify-content: space-between;
|
|
276
|
+
align-items: center;
|
|
277
|
+
`}
|
|
278
|
+
padding="0"
|
|
279
|
+
hoverStyles=".show-on-hover {opacity: 1;}"
|
|
280
|
+
>
|
|
281
|
+
<Text
|
|
282
|
+
variant="pS"
|
|
283
|
+
className="show-on-hover"
|
|
284
|
+
color={COOL_GREY_05}
|
|
285
|
+
id={`workflow-disabled`}
|
|
286
|
+
extraStyles={`
|
|
287
|
+
transition: opacity .2s ease-in-out;
|
|
288
|
+
opacity: 0
|
|
289
|
+
`}
|
|
290
|
+
>
|
|
291
|
+
{"Find"}
|
|
292
|
+
</Text>
|
|
293
|
+
<PlusCircleIcon
|
|
294
|
+
labelledBy={`workflow-disabled`}
|
|
295
|
+
color={COOL_GREY_05}
|
|
296
|
+
/>
|
|
297
|
+
</Box>
|
|
298
|
+
}
|
|
299
|
+
/>
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as LoginFormStories from './LoginForm.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={LoginFormStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
Renders a form for users to login to the NFE User Profile. Built with [FormInput](?path=/docs/atoms-form-layouts-forminput--docs).
|
|
10
|
+
|
|
11
|
+
The user is required to submit an email and password. Both inputs are validated as required inputs, while the email is also checked against the `isProbablyEmail` validator.
|
|
12
|
+
|
|
13
|
+
<Controls />
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
<Story />
|
|
@@ -1,24 +1,120 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { connect } from "react-redux";
|
|
3
|
-
import { boolean } from "@storybook/addon-knobs";
|
|
4
|
-
|
|
5
2
|
import LoginForm from "./LoginForm";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
3
|
+
import { Box } from "../../atoms/layouts";
|
|
4
|
+
import { connect, Provider } from "react-redux";
|
|
5
|
+
import { createStore } from "redux";
|
|
6
|
+
import {
|
|
7
|
+
createFormState,
|
|
8
|
+
required,
|
|
9
|
+
hasLength,
|
|
10
|
+
isProbablyEmail
|
|
11
|
+
} from "redux-freeform";
|
|
12
|
+
import { noop } from "../../../util/general";
|
|
13
|
+
import { fn } from "@storybook/test";
|
|
14
|
+
|
|
15
|
+
const formConfig = {
|
|
16
|
+
email: {
|
|
17
|
+
validators: [required(), isProbablyEmail()]
|
|
18
|
+
},
|
|
19
|
+
password: {
|
|
20
|
+
validators: [required()]
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const { mapStateToProps, mapDispatchToProps, reducer } = createFormState(
|
|
25
|
+
formConfig
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const store = createStore(
|
|
29
|
+
reducer,
|
|
30
|
+
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const FormWrapper = props => (
|
|
34
|
+
<Box minWidth="600px">
|
|
35
|
+
<LoginForm {...props} />
|
|
36
|
+
</Box>
|
|
24
37
|
);
|
|
38
|
+
|
|
39
|
+
const ConnectedLoginForm = connect(
|
|
40
|
+
mapStateToProps,
|
|
41
|
+
mapDispatchToProps
|
|
42
|
+
)(FormWrapper);
|
|
43
|
+
|
|
44
|
+
export default {
|
|
45
|
+
title: "Molecules/LoginForm",
|
|
46
|
+
component: ConnectedLoginForm,
|
|
47
|
+
tags: ["!autodocs"],
|
|
48
|
+
parameters: {
|
|
49
|
+
layout: "centered",
|
|
50
|
+
controls: { expanded: true }
|
|
51
|
+
},
|
|
52
|
+
args: {
|
|
53
|
+
clearOnDismount: undefined,
|
|
54
|
+
fields: undefined,
|
|
55
|
+
actions: undefined,
|
|
56
|
+
handleSubmit: noop,
|
|
57
|
+
showErrors: undefined
|
|
58
|
+
},
|
|
59
|
+
argTypes: {
|
|
60
|
+
actions: {
|
|
61
|
+
description:
|
|
62
|
+
"Field actions, usually generated with [redux-freeform](https://github.com/CityBaseInc/redux-freeform).",
|
|
63
|
+
control: { type: "object" },
|
|
64
|
+
table: {
|
|
65
|
+
type: { summary: "object" },
|
|
66
|
+
defaultValue: { summary: undefined }
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
fields: {
|
|
70
|
+
description:
|
|
71
|
+
"Field data, usually generated with [redux-freeform](https://github.com/CityBaseInc/redux-freeform).",
|
|
72
|
+
control: { type: "object" },
|
|
73
|
+
table: {
|
|
74
|
+
type: { summary: "object" },
|
|
75
|
+
defaultValue: { summary: undefined }
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
clearOnDismount: {
|
|
79
|
+
description:
|
|
80
|
+
"If `true`, `actions.form.clear()` will be called when the component unmounts.",
|
|
81
|
+
control: { type: "boolean" },
|
|
82
|
+
table: {
|
|
83
|
+
type: { summary: "boolean" },
|
|
84
|
+
defaultValue: { summary: undefined }
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
handleSubmit: {
|
|
88
|
+
description:
|
|
89
|
+
"Function called when the `Enter` key is pressed on any of the text inputs (`onKeyDown`). The React event form the will be passed as a parameter.",
|
|
90
|
+
control: { type: "object" },
|
|
91
|
+
table: {
|
|
92
|
+
type: { summary: "function" },
|
|
93
|
+
defaultValue: { summary: undefined }
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
decorators: [
|
|
98
|
+
Story => (
|
|
99
|
+
<Provider store={store}>
|
|
100
|
+
<Story />
|
|
101
|
+
</Provider>
|
|
102
|
+
)
|
|
103
|
+
]
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const Basic = args => <ConnectedLoginForm {...args} />;
|
|
107
|
+
|
|
108
|
+
export const ShowErrors = {
|
|
109
|
+
args: {
|
|
110
|
+
showErrors: true
|
|
111
|
+
},
|
|
112
|
+
render: args => <ConnectedLoginForm {...args} />
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export const HandleSubmit = {
|
|
116
|
+
args: {
|
|
117
|
+
handleSubmit: fn()
|
|
118
|
+
},
|
|
119
|
+
render: args => <ConnectedLoginForm {...args} />
|
|
120
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as ModalStories from './Modal.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={ModalStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
The Modal component is used to display modal popups to users. It uses the react-aria-modal package under the hood to ensure proper accessibility.
|
|
10
|
+
|
|
11
|
+
The modal comes in two versions: v1 and v2. Version 1 is currently the most used version of the modal across our applications. In 2024, a refactored and redesigned version of the modal was built. This version, in addition to changing the design of the modal, fixed some longstanding issues with focus trapping and modals without buttons. All new implementations of modals should use v2, and the plan is to eventually transition all existing implementations of v1 modals to v2 modals.
|
|
12
|
+
|
|
13
|
+
<Controls />
|
|
14
|
+
|
|
15
|
+
<div style={{ marginBottom: "2em"}}>
|
|
16
|
+
<Story />
|
|
17
|
+
</div>
|