@thecb/components 10.12.3-beta.0 → 10.12.3-beta.1
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 +0 -4
- package/dist/index.cjs.js +2526 -1617
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +4 -5
- package/dist/index.esm.js +2527 -1617
- package/dist/index.esm.js.map +1 -1
- package/package.json +13 -25
- package/src/components/atoms/alert/Alert.stories.js +26 -148
- package/src/components/atoms/badge/Badge.js +2 -2
- package/src/components/atoms/badge/Badge.stories.js +29 -143
- package/src/components/atoms/breadcrumb/Breadcrumb.stories.js +29 -38
- package/src/components/atoms/button-with-action/ButtonWithAction.stories.js +55 -108
- package/src/components/atoms/button-with-link/ButtonWithLink.stories.js +31 -160
- package/src/components/atoms/checkbox/Checkbox.stories.js +29 -148
- package/src/components/atoms/country-dropdown/CountryDropdown.stories.js +27 -61
- package/src/components/atoms/detail/Detail.js +26 -0
- package/src/components/atoms/display-box/DisplayBox.stories.js +21 -65
- package/src/components/atoms/display-card/DisplayCard.stories.js +22 -163
- package/src/components/atoms/dropdown/Dropdown.stories.js +10 -91
- package/src/components/atoms/form-layouts/FormInput.stories.js +26 -212
- package/src/components/atoms/form-select/FormSelect.stories.js +29 -55
- package/src/components/atoms/formatted-address/FormattedAddress.stories.js +27 -133
- package/src/components/atoms/icons/icons.stories.js +116 -0
- package/src/components/atoms/labeled-amount/LabeledAmount.stories.js +34 -110
- package/src/components/atoms/line-item/LineItem.stories.js +22 -89
- package/src/components/atoms/link/Link.stories.js +49 -155
- package/src/components/atoms/loading-line/LoadingLine.js +10 -14
- package/src/components/atoms/loading-line/LoadingLine.stories.js +28 -132
- package/src/components/atoms/nav-footer/NavFooter.stories.js +22 -235
- package/src/components/atoms/nav-header/NavHeader.stories.js +21 -122
- package/src/components/atoms/password-requirements/PasswordRequirements.stories.js +44 -108
- package/src/components/atoms/placeholder/Placeholder.stories.js +36 -164
- package/src/components/atoms/searchable-select/SearchableSelect.stories.js +28 -103
- package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.stories.js +40 -65
- package/src/components/atoms/table/Table.stories.js +75 -59
- package/src/components/atoms/table/TableRow.js +0 -1
- package/src/components/atoms/title/Title.js +23 -0
- package/src/components/atoms/toggle-switch/ToggleSwitch.stories.js +20 -103
- package/src/components/atoms/toggle-switch/ToggleSwitch.theme.js +5 -8
- package/src/components/molecules/address-form/AddressForm.stories.js +20 -223
- package/src/components/molecules/banner/Banner.stories.js +26 -122
- package/src/components/molecules/change-password-form/ChangePasswordForm.stories.js +19 -203
- package/src/components/molecules/collapsible-section/CollapsibleSection.stories.js +61 -210
- package/src/components/molecules/edit-name-form/EdidNameForm.stories.js +24 -0
- package/src/components/molecules/index.js +0 -1
- package/src/components/molecules/link-card/LinkCard.stories.js +72 -287
- package/src/components/molecules/login-form/LoginForm.stories.js +21 -117
- package/src/components/molecules/modal/Modal.stories.js +128 -342
- package/src/components/molecules/module/Module.stories.js +25 -267
- package/src/components/molecules/multiple-select-filter/MultipleSelectFilter.js +61 -295
- package/src/components/molecules/multiple-select-filter/{MultipleSelectFilter.oldstories.js → MultipleSelectFilter.stories.js} +1 -1
- package/src/components/molecules/multiple-select-filter/MultipleSelectFilter.styled.js +4 -4
- package/src/components/molecules/multiple-select-filter/__private__/ActionLinkButton.js +24 -0
- package/src/components/molecules/multiple-select-filter/__private__/FilterButton.js +85 -0
- package/src/components/molecules/multiple-select-filter/__private__/FilterDropdown.js +23 -0
- package/src/components/molecules/multiple-select-filter/__private__/FilterableList.js +144 -0
- package/src/components/molecules/multiple-select-filter/__private__/FilterableListItem.js +67 -0
- package/src/components/molecules/multiple-select-filter/__private__/SearchBox.js +38 -0
- package/src/components/molecules/multiple-select-filter/__private__/useKeyboardNavigation.js +84 -0
- package/src/components/molecules/multiple-select-filter/__private__/util.js +31 -0
- package/src/components/molecules/obligation/icons/PropertyPersonalIcon.js +1 -1
- package/src/components/molecules/pagination/Pagination.stories.js +28 -177
- package/src/components/molecules/tabs/Tabs.stories.js +227 -135
- package/src/components/molecules/toast-notification/ToastNotification.stories.js +105 -0
- package/src/hooks/use-outside-click/index.js +4 -5
- package/src/util/index.js +1 -3
- package/src/components/atoms/alert/Alert.mdx +0 -19
- package/src/components/atoms/badge/Badge.mdx +0 -27
- package/src/components/atoms/breadcrumb/Breadcrumb.mdx +0 -21
- package/src/components/atoms/button-with-link/ButtonWithLink.mdx +0 -21
- package/src/components/atoms/card/Card.mdx +0 -41
- package/src/components/atoms/card/Card.stories.js +0 -360
- package/src/components/atoms/checkbox/Checkbox.mdx +0 -15
- package/src/components/atoms/checkbox/Checkbox.oldstories.js +0 -30
- package/src/components/atoms/country-dropdown/CountryDropdown.mdx +0 -36
- package/src/components/atoms/detail/Detail.mdx +0 -32
- package/src/components/atoms/detail/Detail.stories.js +0 -156
- package/src/components/atoms/display-box/DisplayBox.mdx +0 -11
- package/src/components/atoms/display-card/DisplayCard.mdx +0 -13
- package/src/components/atoms/dropdown/Dropdown.mdx +0 -65
- package/src/components/atoms/form-layouts/FormInput.mdx +0 -38
- package/src/components/atoms/form-select/FormSelect.mdx +0 -42
- package/src/components/atoms/formatted-address/FormattedAddress.mdx +0 -13
- package/src/components/atoms/formatted-bank-account/FormattedBankAccount.mdx +0 -17
- package/src/components/atoms/formatted-bank-account/FormattedBankAccount.stories.js +0 -57
- package/src/components/atoms/formatted-credit-card/FormattedCreditCard.mdx +0 -40
- package/src/components/atoms/formatted-credit-card/FormattedCreditCard.stories.js +0 -74
- package/src/components/atoms/icons/Icons.mdx +0 -40
- package/src/components/atoms/icons/Icons.stories.js +0 -325
- package/src/components/atoms/labeled-amount/LabeledAmount.mdx +0 -23
- package/src/components/atoms/line-item/LineItem.mdx +0 -28
- package/src/components/atoms/link/Link.mdx +0 -19
- package/src/components/atoms/loading/Loading.mdx +0 -13
- package/src/components/atoms/loading/Loading.stories.js +0 -22
- package/src/components/atoms/loading-line/LoadingLine.mdx +0 -15
- package/src/components/atoms/nav-footer/NavFooter.mdx +0 -15
- package/src/components/atoms/nav-header/NavHeader.mdx +0 -13
- package/src/components/atoms/nav-tabs/NavTabs.mdx +0 -30
- package/src/components/atoms/nav-tabs/NavTabs.stories.js +0 -49
- package/src/components/atoms/password-requirements/PasswordRequirements.mdx +0 -39
- package/src/components/atoms/placeholder/Placeholder.mdx +0 -19
- package/src/components/atoms/searchable-select/SearchableSelect.mdx +0 -44
- package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.mdx +0 -36
- package/src/components/atoms/table/Table.mdx +0 -71
- package/src/components/atoms/table/Table.oldstories.js +0 -84
- package/src/components/atoms/title/Title.mdx +0 -26
- package/src/components/atoms/title/Title.stories.js +0 -144
- package/src/components/atoms/toggle-switch/ToggleSwitch.mdx +0 -17
- package/src/components/atoms/typeahead-input/TypeaheadInput.mdx +0 -13
- package/src/components/atoms/typeahead-input/TypeaheadInput.stories.js +0 -63
- package/src/components/molecules/address-form/AddressForm.mdx +0 -18
- package/src/components/molecules/banner/Banner.mdx +0 -23
- package/src/components/molecules/change-password-form/ChangePasswordForm.mdx +0 -15
- package/src/components/molecules/collapsible-section/CollapsibleSection.mdx +0 -15
- package/src/components/molecules/edit-name-form/EditNameForm.mdx +0 -13
- package/src/components/molecules/edit-name-form/EditNameForm.stories.js +0 -117
- package/src/components/molecules/idle-modal/IdleModal.js +0 -101
- package/src/components/molecules/idle-modal/IdleModal.mdx +0 -17
- package/src/components/molecules/idle-modal/IdleModal.stories.js +0 -180
- package/src/components/molecules/idle-modal/index.d.ts +0 -16
- package/src/components/molecules/idle-modal/index.js +0 -3
- package/src/components/molecules/link-card/LinkCard.mdx +0 -17
- package/src/components/molecules/login-form/LoginForm.mdx +0 -16
- package/src/components/molecules/modal/Modal.mdx +0 -17
- package/src/components/molecules/module/Module.mdx +0 -17
- package/src/components/molecules/obligation/Obligation.mdx +0 -23
- package/src/components/molecules/obligation/Obligation.stories.js +0 -460
- package/src/components/molecules/pagination/Pagination.mdx +0 -15
- package/src/components/molecules/popover/Popover.mdx +0 -15
- package/src/components/molecules/popover/Popover.stories.js +0 -220
- package/src/components/molecules/tabs/Tabs.mdx +0 -17
- package/src/components/molecules/toast-notification/Toast.mdx +0 -15
- package/src/components/molecules/toast-notification/Toast.stories.js +0 -183
- package/src/stories/Button.stories.ts +0 -53
- package/src/stories/Button.tsx +0 -48
- package/src/stories/Configure.mdx +0 -364
- package/src/stories/Header.stories.ts +0 -33
- package/src/stories/Header.tsx +0 -56
- package/src/stories/Page.stories.ts +0 -32
- package/src/stories/Page.tsx +0 -73
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +0 -5
- 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 +0 -15
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +0 -3
- 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 +0 -12
- package/src/stories/assets/youtube.svg +0 -4
- package/src/stories/button.css +0 -30
- package/src/stories/header.css +0 -32
- package/src/stories/page.css +0 -69
- package/src/util/idleTimerUtils.js +0 -36
- /package/src/components/atoms/add-obligation/{AddObligation.oldstories.js → AddObligation.stories.js} +0 -0
- /package/src/components/atoms/amount-callout/{AmountCallout.oldstories.js → AmountCallout.stories.js} +0 -0
- /package/src/components/atoms/checkbox-list/{CheckboxList.oldstories.js → CheckboxList.stories.js} +0 -0
- /package/src/components/atoms/form-layouts/{FormLayouts.oldstories.js → FormLayouts.stories.js} +0 -0
- /package/src/components/atoms/hamburger-button/{HamburgerButton.oldstories.js → HamburgerButton.stories.js} +0 -0
- /package/src/components/atoms/heading/{Heading.oldstories.js → Heading.stories.js} +0 -0
- /package/src/components/atoms/layouts/examples/box-example/{BoxExample.oldstories.js → BoxExample.stories.js} +0 -0
- /package/src/components/atoms/layouts/examples/center-example/{CenterExample.oldstories.js → CenterExample.stories.js} +0 -0
- /package/src/components/atoms/layouts/examples/cluster-example/{ClusterExample.oldstories.js → ClusterExample.stories.js} +0 -0
- /package/src/components/atoms/layouts/examples/cover-example/{CoverExample.oldstories.js → CoverExample.stories.js} +0 -0
- /package/src/components/atoms/layouts/examples/frame-example/{FrameExample.oldstories.js → FrameExample.stories.js} +0 -0
- /package/src/components/atoms/layouts/examples/grid-example/{GridExample.oldstories.js → GridExample.stories.js} +0 -0
- /package/src/components/atoms/layouts/examples/imposter-example/{ImposterExample.oldstories.js → ImposterExample.stories.js} +0 -0
- /package/src/components/atoms/layouts/examples/motion-example/{MotionExample.oldstories.js → MotionExample.stories.js} +0 -0
- /package/src/components/atoms/layouts/examples/reel-example/{ReelExample.oldstories.js → ReelExample.stories.js} +0 -0
- /package/src/components/atoms/layouts/examples/sidebar-example/{SidebarExample.oldstories.js → SidebarExample.stories.js} +0 -0
- /package/src/components/atoms/layouts/examples/stack-example/{StackExample.oldstories.js → StackExample.stories.js} +0 -0
- /package/src/components/atoms/layouts/examples/switcher-example/{SwitcherExample.oldstories.js → SwitcherExample.stories.js} +0 -0
- /package/src/components/atoms/paragraph/{Paragraph.oldstories.js → Paragraph.stories.js} +0 -0
- /package/src/components/atoms/processing-fee/{ProcessingFee.oldstories.js → ProcessingFee.stories.js} +0 -0
- /package/src/components/atoms/search/{Search.oldstories.js → Search.stories.js} +0 -0
- /package/src/components/atoms/solid-divider/{SolidDivider.oldstories.js → SolidDivider.stories.js} +0 -0
- /package/src/components/atoms/sortable-table-heading/{SortableTableHeading.oldstories.js → SortableTableHeading.stories.js} +0 -0
- /package/src/components/atoms/spinner/{Spinner.oldstories.js → Spinner.stories.js} +0 -0
- /package/src/components/atoms/tab/{Tab.oldstories.js → Tab.stories.js} +0 -0
- /package/src/components/atoms/text/{Text.oldstories.js → Text.stories.js} +0 -0
- /package/src/components/atoms/typeahead-input/{TypeaheadIinput.oldstories.js → TypeaheadIinput.stories.js} +0 -0
- /package/src/components/atoms/wallet-name/{WalletName.oldstories.js → WalletName.stories.js} +0 -0
- /package/src/components/molecules/account-and-routing-modal/{AccountAndRoutingModal.oldstories.js → AccountAndRoutingModal.stories.js} +0 -0
- /package/src/components/molecules/editable-list/{EditableList.oldstories.js → EditableList.stories.js} +0 -0
- /package/src/components/molecules/email-form/{EmailForm.oldstories.js → EmailForm.stories.js} +0 -0
- /package/src/components/molecules/forgot-password-form/{ForgotPasswordForm.oldstories.js → ForgotPasswordForm.stories.js} +0 -0
- /package/src/components/molecules/highlight-tab-row/{HighlightTabRow.oldstories.js → HighlightTabRow.stories.js} +0 -0
- /package/src/components/molecules/obligation/modules/{AmountModule.oldstories.js → AmountModule.stories.js} +0 -0
- /package/src/components/molecules/payment-button-bar/{PaymentButtonBar.oldstories.js → PaymentButtonBar.stories.js} +0 -0
- /package/src/components/molecules/payment-details/{PaymentDetails.oldstories.js → PaymentDetails.stories.js} +0 -0
- /package/src/components/molecules/payment-form-ach/{PaymentFormACH.oldstories.js → PaymentFormACH.stories.js} +0 -0
- /package/src/components/molecules/payment-form-card/{PaymentFormCard.oldstories.js → PaymentFormCard.stories.js} +0 -0
- /package/src/components/molecules/periscope-dashboard-iframe/{PeriscopeDashBoardIframe.oldstories.js → PeriscopeDashBoardIframe.stories.js} +0 -0
- /package/src/components/molecules/phone-form/{PhoneForm.oldstories.js → PhoneForm.stories.js} +0 -0
- /package/src/components/molecules/popup-menu/{PopupMenu.oldstories.js → PopupMenu.stories.js} +0 -0
- /package/src/components/molecules/radio-group/{RadioGroup.oldstories.js → RadioGroup.stories.js} +0 -0
- /package/src/components/molecules/radio-section/{RadioSection.oldstories.js → RadioSection.stories.js} +0 -0
- /package/src/components/molecules/registration-form/{RegistrationForm.oldstories.js → RegistrationForm.stories.js} +0 -0
- /package/src/components/molecules/reset-confirmation-form/{ResetConfirmationForm.oldstories.js → ResetConfirmationForm.stories.js} +0 -0
- /package/src/components/molecules/reset-password-form/{ResetPasswordForm.oldstories.js → ResetPasswordForm.stories.js} +0 -0
- /package/src/components/molecules/reset-password-success/{ResetPasswordSuccess.oldstories.js → ResetPasswordSuccess.stories.js} +0 -0
- /package/src/components/molecules/tab-sidebar/{TabSidebar.oldstories.js → TabSidebar.stories.js} +0 -0
- /package/src/components/molecules/terms-and-conditions/{TermsAndConditions.oldstories.js → TermsAndConditions.stories.js} +0 -0
- /package/src/components/molecules/terms-and-conditions-modal/{TermsAndConditionsModal.oldstories.js → TermsAndConditionsModal.stories.js} +0 -0
- /package/src/components/molecules/workflow-tile/{WorkflowTile.oldstories.js → WorkflowTile.stories.js} +0 -0
|
@@ -1,165 +1,24 @@
|
|
|
1
|
-
import DisplayCard from "./DisplayCard";
|
|
2
1
|
import React from "react";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: "Atoms/DisplayCard",
|
|
7
|
-
component: DisplayCard,
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: "centered",
|
|
10
|
-
controls: { expanded: true }
|
|
11
|
-
},
|
|
12
|
-
tags: ["!autodocs"],
|
|
13
|
-
args: {
|
|
14
|
-
title: "Display Card",
|
|
15
|
-
item: "Item text",
|
|
16
|
-
buttonText: undefined,
|
|
17
|
-
buttonAction: undefined,
|
|
18
|
-
url: undefined,
|
|
19
|
-
link: false,
|
|
20
|
-
helpText: undefined,
|
|
21
|
-
hasPopover: false,
|
|
22
|
-
popoverTriggerText: "",
|
|
23
|
-
popoverContent: "",
|
|
24
|
-
popoverExtraStyles: undefined,
|
|
25
|
-
popoverTextExtraStyles: undefined
|
|
26
|
-
},
|
|
27
|
-
argTypes: {
|
|
28
|
-
title: {
|
|
29
|
-
description: "Text that appears above the box",
|
|
30
|
-
table: {
|
|
31
|
-
type: { summary: "string" },
|
|
32
|
-
defaultValue: { summary: undefined }
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
item: {
|
|
36
|
-
description: "Text that appears in the box",
|
|
37
|
-
table: {
|
|
38
|
-
type: { summary: "string" },
|
|
39
|
-
defaultValue: { summary: undefined }
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
buttonText: {
|
|
43
|
-
description: "Text for the button or link",
|
|
44
|
-
table: {
|
|
45
|
-
type: { summary: "string" },
|
|
46
|
-
defaultValue: { summary: undefined }
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
buttonAction: {
|
|
50
|
-
description: "Callback function for the button",
|
|
51
|
-
table: {
|
|
52
|
-
type: { summary: "function" },
|
|
53
|
-
defaultValue: { summary: undefined }
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
url: {
|
|
57
|
-
description: "URL for the link",
|
|
58
|
-
table: {
|
|
59
|
-
type: { summary: "string" },
|
|
60
|
-
defaultValue: { summary: undefined }
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
link: {
|
|
64
|
-
description:
|
|
65
|
-
"Whether or not to display a link, uses the `url` and `buttonText` props",
|
|
66
|
-
table: {
|
|
67
|
-
type: { summary: "boolean" },
|
|
68
|
-
defaultValue: { summary: false }
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
helpText: {
|
|
72
|
-
description:
|
|
73
|
-
"Text rendered to the right of the `item` text and styled as italic.",
|
|
74
|
-
table: {
|
|
75
|
-
type: { summary: "string" },
|
|
76
|
-
defaultValue: { summary: undefined }
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
hasPopover: {
|
|
80
|
-
description: "Whether or not to render Popover component",
|
|
81
|
-
table: {
|
|
82
|
-
type: { summary: "boolean" },
|
|
83
|
-
defaultValue: { summary: false }
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
popoverTriggerText: {
|
|
87
|
-
table: {
|
|
88
|
-
type: { summary: "string" },
|
|
89
|
-
defaultValue: { summary: "" }
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
popoverContent: {
|
|
93
|
-
table: {
|
|
94
|
-
type: { summary: "string" },
|
|
95
|
-
defaultValue: { summary: "" }
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
popoverExtraStyles: {
|
|
99
|
-
description: "Styles for the Box that wraps the Popover content.",
|
|
100
|
-
table: {
|
|
101
|
-
type: { summary: "string" },
|
|
102
|
-
defaultValue: { summary: undefined }
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
popoverTextExtraStyles: {
|
|
106
|
-
description: "Prop passed to the Popover component, but is not used.",
|
|
107
|
-
table: {
|
|
108
|
-
type: { summary: "string" },
|
|
109
|
-
defaultValue: { summary: undefined }
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
export default meta;
|
|
116
|
-
|
|
117
|
-
export const Basic = {
|
|
118
|
-
render: args => <DisplayCard {...args} />
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
export const WithLink = {
|
|
122
|
-
args: {
|
|
123
|
-
buttonText: "Link",
|
|
124
|
-
url: "https://example.com",
|
|
125
|
-
link: true
|
|
126
|
-
},
|
|
127
|
-
render: args => <DisplayCard {...args} />
|
|
128
|
-
};
|
|
2
|
+
import { text, boolean } from "@storybook/addon-knobs";
|
|
129
3
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
popoverTriggerText: "Popover",
|
|
152
|
-
popoverContent: "This is example popover content!"
|
|
153
|
-
},
|
|
154
|
-
render: args => <DisplayCard {...args} />
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
export const WithPopoverAndExtraStyles = {
|
|
158
|
-
args: {
|
|
159
|
-
hasPopover: true,
|
|
160
|
-
popoverTriggerText: "Popover",
|
|
161
|
-
popoverContent: "This is example popover content!",
|
|
162
|
-
popoverExtraStyles: "padding: 4px 8px"
|
|
163
|
-
},
|
|
164
|
-
render: args => <DisplayCard {...args} />
|
|
165
|
-
};
|
|
4
|
+
import DisplayCard from "./DisplayCard";
|
|
5
|
+
import page from "../../../../.storybook/page";
|
|
6
|
+
|
|
7
|
+
const story = page({
|
|
8
|
+
title: "Components|Atoms/DisplayCard",
|
|
9
|
+
Component: DisplayCard
|
|
10
|
+
});
|
|
11
|
+
export default story;
|
|
12
|
+
|
|
13
|
+
export const displayCard = () => (
|
|
14
|
+
<DisplayCard
|
|
15
|
+
title={text("title", "Title", "props")}
|
|
16
|
+
buttonText={text("buttonText", "Lorem", "props")}
|
|
17
|
+
url={text("url", "http://google.com", "props")}
|
|
18
|
+
link={boolean("link", false, "props")}
|
|
19
|
+
buttonAction={text("buttonAction", () => {}, "props")}
|
|
20
|
+
item={text("item", "Foo", "props")}
|
|
21
|
+
>
|
|
22
|
+
{text("children", "Lorem Ipsum", "props")}
|
|
23
|
+
</DisplayCard>
|
|
24
|
+
);
|
|
@@ -1,82 +1,6 @@
|
|
|
1
|
-
import { useState, useEffect } from "react";
|
|
1
|
+
import React, { useState, useEffect } from "react";
|
|
2
2
|
import Dropdown from "./Dropdown";
|
|
3
|
-
import
|
|
4
|
-
import React from "react";
|
|
5
|
-
|
|
6
|
-
const meta = {
|
|
7
|
-
title: "Atoms/Dropdown",
|
|
8
|
-
component: Dropdown,
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: "centered",
|
|
11
|
-
controls: { expanded: true }
|
|
12
|
-
},
|
|
13
|
-
tags: ["!autodocs"],
|
|
14
|
-
args: {
|
|
15
|
-
placeholder: "Placeholder",
|
|
16
|
-
options: [],
|
|
17
|
-
value: "",
|
|
18
|
-
isOpen: false,
|
|
19
|
-
isError: false,
|
|
20
|
-
onSelect: fn(),
|
|
21
|
-
disabledValues: [],
|
|
22
|
-
onClick: fn(),
|
|
23
|
-
themeValues: {},
|
|
24
|
-
maxHeight: "400px",
|
|
25
|
-
widthFitOptions: false,
|
|
26
|
-
disabled: false,
|
|
27
|
-
hasTitles: false,
|
|
28
|
-
autoEraseTypeAhead: true,
|
|
29
|
-
ariaLabelledby: "label-id",
|
|
30
|
-
ariaDescribedby: "desc-id",
|
|
31
|
-
autocompleteValue: "",
|
|
32
|
-
smoothScroll: true,
|
|
33
|
-
ariaInvalid: false,
|
|
34
|
-
isRequired: false
|
|
35
|
-
},
|
|
36
|
-
argTypes: {
|
|
37
|
-
autoEraseTypeAhead: {
|
|
38
|
-
description: "Clears type ahead inputs after 20s",
|
|
39
|
-
table: {
|
|
40
|
-
type: { summary: "boolean" },
|
|
41
|
-
defaultValue: { summary: true }
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
autocompleteValue: {
|
|
45
|
-
description:
|
|
46
|
-
"Sets the autoComplete attribute and name attribute on the underlying input element",
|
|
47
|
-
table: {
|
|
48
|
-
type: { summary: "string" },
|
|
49
|
-
defaultValue: { summary: undefined }
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
hasTitles: {
|
|
53
|
-
description:
|
|
54
|
-
"Adds the selected value and option values as HTML `title` attributes to their respective elements",
|
|
55
|
-
table: {
|
|
56
|
-
type: { summary: "boolean" },
|
|
57
|
-
defaultValue: { summary: false }
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
smoothScroll: {
|
|
61
|
-
description:
|
|
62
|
-
"Smoothly animate to the selected option when the menu is opened by a mouse click",
|
|
63
|
-
table: {
|
|
64
|
-
type: { summary: "boolean" },
|
|
65
|
-
defaultValue: { summary: true }
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
widthFitOptions: {
|
|
69
|
-
description:
|
|
70
|
-
"Sets the width of the wrapping element to fit-content instead of 100%",
|
|
71
|
-
table: {
|
|
72
|
-
type: { summary: "boolean" },
|
|
73
|
-
defaultValue: { summary: false }
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export default meta;
|
|
3
|
+
import page from "../../../../.storybook/page";
|
|
80
4
|
|
|
81
5
|
const options = [
|
|
82
6
|
{ text: "Please select an option", value: "" },
|
|
@@ -87,7 +11,7 @@ const options = [
|
|
|
87
11
|
|
|
88
12
|
const disabledValues = ["DISABLED_OPTION"];
|
|
89
13
|
|
|
90
|
-
const
|
|
14
|
+
export const dropdown = () => {
|
|
91
15
|
const [isOpen, setOpen] = useState(false);
|
|
92
16
|
const [value, setValue] = useState(null);
|
|
93
17
|
const [isError, setError] = useState(false);
|
|
@@ -102,7 +26,6 @@ const DropdownWithHooks = props => {
|
|
|
102
26
|
|
|
103
27
|
return (
|
|
104
28
|
<Dropdown
|
|
105
|
-
{...props}
|
|
106
29
|
placeholder={options[0].text}
|
|
107
30
|
options={options}
|
|
108
31
|
disabledValues={disabledValues}
|
|
@@ -110,19 +33,15 @@ const DropdownWithHooks = props => {
|
|
|
110
33
|
isOpen={isOpen}
|
|
111
34
|
isError={isError}
|
|
112
35
|
onSelect={setValue}
|
|
113
|
-
onClick={() =>
|
|
114
|
-
disabled={props.disabled}
|
|
36
|
+
onClick={() => setOpen(!isOpen)}
|
|
115
37
|
/>
|
|
116
38
|
);
|
|
117
39
|
};
|
|
118
40
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
41
|
+
const story = page({
|
|
42
|
+
title: "Components|Atoms/Dropdown",
|
|
43
|
+
Component: Dropdown,
|
|
44
|
+
height: "500px"
|
|
45
|
+
});
|
|
122
46
|
|
|
123
|
-
export
|
|
124
|
-
args: {
|
|
125
|
-
disabled: true
|
|
126
|
-
},
|
|
127
|
-
render: args => <DropdownWithHooks {...args} />
|
|
128
|
-
};
|
|
47
|
+
export default story;
|
|
@@ -1,219 +1,33 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { text } from "@storybook/addon-knobs";
|
|
2
3
|
import FormInput from "./FormInput";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const { mapStateToProps, mapDispatchToProps, reducer } = createFormState({
|
|
10
|
-
example: {
|
|
11
|
-
validators: [required()]
|
|
4
|
+
import { Box } from "../layouts";
|
|
5
|
+
import page from "../../../../.storybook/page";
|
|
6
|
+
const data = {
|
|
7
|
+
fieldOne: {
|
|
8
|
+
rawValue: "Form Input One"
|
|
12
9
|
}
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
const store = createStore(
|
|
16
|
-
reducer,
|
|
17
|
-
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
const errorMessages = {
|
|
21
|
-
[required.error]: "This is required!"
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const FormWrapper = props => (
|
|
25
|
-
<FormInput
|
|
26
|
-
{...props}
|
|
27
|
-
field={props.fields.example}
|
|
28
|
-
fieldActions={props.actions.fields.example}
|
|
29
|
-
/>
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
const ConnectedFormInput = connect(
|
|
33
|
-
mapStateToProps,
|
|
34
|
-
mapDispatchToProps
|
|
35
|
-
)(FormWrapper);
|
|
36
|
-
|
|
37
|
-
export default {
|
|
38
|
-
title: "Atoms/form-layouts/FormInput",
|
|
39
|
-
component: ConnectedFormInput,
|
|
40
|
-
tags: ["!autodocs"],
|
|
41
|
-
parameters: {
|
|
42
|
-
layout: "centered",
|
|
43
|
-
controls: { expanded: true }
|
|
44
|
-
},
|
|
45
|
-
args: {
|
|
46
|
-
type: "text",
|
|
47
|
-
labelTextWhenNoError: "",
|
|
48
|
-
errorMessages: errorMessages,
|
|
49
|
-
isNum: false,
|
|
50
|
-
isEmail: false,
|
|
51
|
-
helperModal: undefined,
|
|
52
|
-
showErrors: undefined,
|
|
53
|
-
formatter: null,
|
|
54
|
-
decorator: undefined,
|
|
55
|
-
themeValues: {},
|
|
56
|
-
background: undefined,
|
|
57
|
-
customHeight: undefined,
|
|
58
|
-
autocompleteValue: "",
|
|
59
|
-
extraStyles: undefined,
|
|
60
|
-
removeFromValue: undefined,
|
|
61
|
-
dataQa: "form-input-qa",
|
|
62
|
-
isRequired: false
|
|
63
|
-
},
|
|
64
|
-
argTypes: {
|
|
65
|
-
extraStyles: { type: "string" },
|
|
66
|
-
fieldActions: { type: "object" },
|
|
67
|
-
field: { type: "object" },
|
|
68
|
-
background: {
|
|
69
|
-
description:
|
|
70
|
-
"sets the value for `background: url(${background})` _only_ if the `formatter` prop is _not_ set",
|
|
71
|
-
table: {
|
|
72
|
-
type: { summary: "string" },
|
|
73
|
-
defaultValue: { summary: undefined }
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
isNum: {
|
|
77
|
-
description: "sets the input's inputMode attribute to `numeric`",
|
|
78
|
-
table: {
|
|
79
|
-
type: { summary: "boolean" },
|
|
80
|
-
defaultValue: { summary: false }
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
isEmail: {
|
|
84
|
-
description: "sets the input's inputMode attribute to `email`",
|
|
85
|
-
table: {
|
|
86
|
-
type: { summary: "boolean" },
|
|
87
|
-
defaultValue: { summary: false }
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
isRequired: {
|
|
91
|
-
description: "adds the `required` attribute to the input element",
|
|
92
|
-
table: {
|
|
93
|
-
type: { summary: "boolean" },
|
|
94
|
-
defaultValue: { summary: false }
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
customHeight: {
|
|
98
|
-
description: "sets a height to the input",
|
|
99
|
-
table: {
|
|
100
|
-
type: { summary: "string" },
|
|
101
|
-
defaultValue: { summary: "48px" }
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
helperModal: {
|
|
105
|
-
description: "a function that returns a modal",
|
|
106
|
-
table: {
|
|
107
|
-
type: { summary: "object" },
|
|
108
|
-
defaultValue: { summary: undefined }
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
removeFromValue: {
|
|
112
|
-
description:
|
|
113
|
-
"regex pattern for characters to in the user inputted value before passing it to `fieldActions.set()`",
|
|
114
|
-
table: {
|
|
115
|
-
type: { summary: "string" },
|
|
116
|
-
defaultValue: { summary: undefined }
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
extraStyles: {
|
|
120
|
-
description: "styles applied to the underlying input element",
|
|
121
|
-
table: {
|
|
122
|
-
type: { summary: "string" },
|
|
123
|
-
defaultValue: { summary: undefined }
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
decorators: [
|
|
128
|
-
Story => (
|
|
129
|
-
<Provider store={store}>
|
|
130
|
-
<Story />
|
|
131
|
-
</Provider>
|
|
132
|
-
)
|
|
133
|
-
]
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
export const Basic = args => <ConnectedFormInput {...args} />;
|
|
137
|
-
|
|
138
|
-
export const WithDecorator = {
|
|
139
|
-
args: {
|
|
140
|
-
decorator: "Decorator!"
|
|
141
|
-
},
|
|
142
|
-
render: args => <ConnectedFormInput {...args} />
|
|
143
10
|
};
|
|
144
|
-
|
|
145
|
-
export const IsEmail = {
|
|
146
|
-
args: {
|
|
147
|
-
isEmail: true
|
|
148
|
-
},
|
|
149
|
-
render: args => <ConnectedFormInput {...args} />
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
export const IsNum = {
|
|
153
|
-
args: {
|
|
154
|
-
isNum: true
|
|
155
|
-
},
|
|
156
|
-
render: args => <ConnectedFormInput {...args} />
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
export const WithLabel = {
|
|
160
|
-
args: {
|
|
161
|
-
labelTextWhenNoError: "Label"
|
|
162
|
-
},
|
|
163
|
-
render: args => <ConnectedFormInput {...args} />
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
export const WithCustomHeight = {
|
|
167
|
-
args: {
|
|
168
|
-
customHeight: "100px"
|
|
169
|
-
},
|
|
170
|
-
render: args => <ConnectedFormInput {...args} />
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
export const Required = {
|
|
174
|
-
args: {
|
|
175
|
-
isRequired: true
|
|
176
|
-
},
|
|
177
|
-
render: args => <ConnectedFormInput {...args} />
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
export const WithFormatter = {
|
|
181
|
-
args: {
|
|
182
|
-
labelTextWhenNoError: "Price",
|
|
183
|
-
formatter: moneyFormat
|
|
184
|
-
},
|
|
185
|
-
render: args => <ConnectedFormInput {...args} />
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
const InputWithModal = props => {
|
|
189
|
-
const [isOpen, toggleOpen] = useState(false);
|
|
190
|
-
|
|
11
|
+
export const formInputs = () => {
|
|
191
12
|
return (
|
|
192
|
-
<
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
<div onClick={() => toggleOpen(true)} role="button">
|
|
206
|
-
Help!
|
|
207
|
-
</div>
|
|
208
|
-
</Modal>
|
|
209
|
-
)}
|
|
210
|
-
/>
|
|
13
|
+
<Box padding="1rem">
|
|
14
|
+
<FormInput
|
|
15
|
+
labelTextWhenNoError={text(
|
|
16
|
+
"labelTextWhenNoError",
|
|
17
|
+
"Label Text When No Error",
|
|
18
|
+
"props"
|
|
19
|
+
)}
|
|
20
|
+
type="text"
|
|
21
|
+
labelTextVariant={text("labelTextVariant", "pS", "props")}
|
|
22
|
+
errorLabelTextVariant={text("errorLabelTextVariant", "pS", "props")}
|
|
23
|
+
field={data.fieldOne}
|
|
24
|
+
/>
|
|
25
|
+
</Box>
|
|
211
26
|
);
|
|
212
27
|
};
|
|
213
28
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
};
|
|
29
|
+
const story = page({
|
|
30
|
+
title: "Components|Atoms/FormInput",
|
|
31
|
+
Component: FormInput
|
|
32
|
+
});
|
|
33
|
+
export default story;
|
|
@@ -1,76 +1,50 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { createStore } from "redux";
|
|
2
|
+
import { connect } from "react-redux";
|
|
3
|
+
import { text } from "@storybook/addon-knobs";
|
|
5
4
|
import { createFormState, required } from "redux-freeform";
|
|
6
5
|
|
|
6
|
+
import FormSelect from "./FormSelect";
|
|
7
|
+
import page from "../../../../.storybook/page";
|
|
8
|
+
|
|
7
9
|
const { mapStateToProps, mapDispatchToProps, reducer } = createFormState({
|
|
8
|
-
|
|
10
|
+
thing: {
|
|
9
11
|
validators: [required()]
|
|
10
12
|
}
|
|
11
13
|
});
|
|
12
|
-
|
|
13
|
-
const store = createStore(
|
|
14
|
-
reducer,
|
|
15
|
-
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
|
|
16
|
-
);
|
|
17
|
-
|
|
18
14
|
const errorMessages = {
|
|
19
|
-
[required.error]: "
|
|
15
|
+
[required.error]: "thing is required"
|
|
20
16
|
};
|
|
21
|
-
|
|
22
17
|
const options = [
|
|
23
|
-
{ value: "", text: "
|
|
18
|
+
{ value: "", text: "choose name" },
|
|
24
19
|
{ value: "foo", text: "foo" },
|
|
25
20
|
{ value: "bar", text: "bar" },
|
|
26
21
|
{ value: "baz", text: "baz" },
|
|
27
22
|
{ value: "disabled", text: "disabled" }
|
|
28
23
|
];
|
|
29
24
|
|
|
25
|
+
const story = page({
|
|
26
|
+
title: "Components|Atoms/FormSelect",
|
|
27
|
+
Component: FormSelect,
|
|
28
|
+
reducer,
|
|
29
|
+
mapStateToProps,
|
|
30
|
+
mapDispatchToProps,
|
|
31
|
+
height: "500px"
|
|
32
|
+
});
|
|
33
|
+
|
|
30
34
|
const FormWrapper = props => (
|
|
31
35
|
<FormSelect
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
autocompleteValue={props.autocompleteValue}
|
|
37
|
+
labelTextWhenNoError="Form Select"
|
|
38
|
+
errorMessages={errorMessages}
|
|
39
|
+
options={options}
|
|
40
|
+
field={props.fields.thing}
|
|
41
|
+
fieldActions={props.actions.fields.thing}
|
|
42
|
+
disabledValues={["disabled"]}
|
|
35
43
|
/>
|
|
36
44
|
);
|
|
37
45
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
export default {
|
|
44
|
-
title: "Atoms/FormSelect",
|
|
45
|
-
component: ConnectedFormSelect,
|
|
46
|
-
tags: ["!autodocs"],
|
|
47
|
-
args: {
|
|
48
|
-
labelTextWhenNoError: "Form Select Example",
|
|
49
|
-
errorMessages: errorMessages,
|
|
50
|
-
options: options,
|
|
51
|
-
showErrors: false,
|
|
52
|
-
onChange: null,
|
|
53
|
-
dropdownMaxHeight: "600px",
|
|
54
|
-
disabledValues: ["disabled"],
|
|
55
|
-
disabled: false,
|
|
56
|
-
hasTitles: false,
|
|
57
|
-
autocompleteValue: "",
|
|
58
|
-
smoothScroll: true,
|
|
59
|
-
dataQa: "form-select-qa",
|
|
60
|
-
widthFitOptions: false,
|
|
61
|
-
isRequired: false
|
|
62
|
-
},
|
|
63
|
-
argTypes: {
|
|
64
|
-
fieldActions: { type: "object" },
|
|
65
|
-
field: { type: "object" }
|
|
66
|
-
},
|
|
67
|
-
decorators: [
|
|
68
|
-
Story => (
|
|
69
|
-
<Provider store={store}>
|
|
70
|
-
<Story />
|
|
71
|
-
</Provider>
|
|
72
|
-
)
|
|
73
|
-
]
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export const Basic = args => <ConnectedFormSelect {...args} />;
|
|
46
|
+
export default story;
|
|
47
|
+
const ConnectedForm = connect(mapStateToProps, mapDispatchToProps)(FormWrapper);
|
|
48
|
+
export const formSelect = () => (
|
|
49
|
+
<ConnectedForm autocompleteValue={text("autocompleteValue", null, "props")} />
|
|
50
|
+
);
|