@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,161 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { text, select, boolean } from "@storybook/addon-knobs";
|
|
1
3
|
import ButtonWithLink from "./ButtonWithLink";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
text
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
disabled: {
|
|
32
|
-
description: "Whether or not the button is disabled",
|
|
33
|
-
control: { type: "boolean" },
|
|
34
|
-
table: {
|
|
35
|
-
type: { summary: "boolean" },
|
|
36
|
-
defaultValue: { summary: false }
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
fileLink: {
|
|
40
|
-
description:
|
|
41
|
-
"Forces `ExternalLink` to be used even if `url` is an internal value",
|
|
42
|
-
control: { type: "boolean" },
|
|
43
|
-
table: {
|
|
44
|
-
type: { summary: "boolean" },
|
|
45
|
-
defaultValue: { summary: false }
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
extraStyles: {
|
|
49
|
-
description: "Styles for the underlying `ButtonWithAction` component",
|
|
50
|
-
control: { type: "text" },
|
|
51
|
-
table: {
|
|
52
|
-
type: { summary: "string" },
|
|
53
|
-
defaultValue: { summary: "" }
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
linkExtraStyles: {
|
|
57
|
-
description:
|
|
58
|
-
"Styles for the underlying `ExternalLink` or `InternalLink` component",
|
|
59
|
-
control: { type: "text" },
|
|
60
|
-
table: {
|
|
61
|
-
type: { summary: "string" },
|
|
62
|
-
defaultValue: { summary: "" }
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
newTab: {
|
|
66
|
-
description: "Whether or not the link will open in a new tab/window",
|
|
67
|
-
control: { type: "boolean" },
|
|
68
|
-
table: {
|
|
69
|
-
type: { summary: "boolean" },
|
|
70
|
-
defaultValue: { summary: false }
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
dataQa: {
|
|
74
|
-
description: "`data-qa` value for the underlying link",
|
|
75
|
-
control: { type: "text" },
|
|
76
|
-
table: {
|
|
77
|
-
type: { summary: "string" },
|
|
78
|
-
defaultValue: { summary: undefined }
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
text: {
|
|
82
|
-
description: "The button's text",
|
|
83
|
-
control: { type: "text" },
|
|
84
|
-
table: {
|
|
85
|
-
type: { summary: "string" },
|
|
86
|
-
defaultValue: { summary: undefined }
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
variant: {
|
|
90
|
-
description: "The button's style variant",
|
|
91
|
-
control: { type: "text" },
|
|
92
|
-
table: {
|
|
93
|
-
type: { summary: "string" },
|
|
94
|
-
defaultValue: { summary: undefined }
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export default meta;
|
|
101
|
-
|
|
102
|
-
export const Basic = {
|
|
103
|
-
args: {
|
|
104
|
-
url: "http://example.com"
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
export const SecondaryVariant = {
|
|
109
|
-
args: {
|
|
110
|
-
url: "http://example.com",
|
|
111
|
-
variant: "secondary"
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
export const Disabled = {
|
|
116
|
-
args: {
|
|
117
|
-
url: "http://example.com",
|
|
118
|
-
disabled: true
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
export const ExtraStyles = {
|
|
123
|
-
args: {
|
|
124
|
-
url: "http://example.com",
|
|
125
|
-
extraStyles: "border-radius: 50%"
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
export const LinkExtraStyles = {
|
|
130
|
-
args: {
|
|
131
|
-
url: "http://example.com",
|
|
132
|
-
linkExtraStyles: "opacity: 50%;"
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
export const FileLink = {
|
|
137
|
-
args: {
|
|
138
|
-
url: "test.pdf",
|
|
139
|
-
fileLink: true
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
export const NewTab = {
|
|
144
|
-
args: {
|
|
145
|
-
url: "http://example.com",
|
|
146
|
-
newTab: true
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
export const DataQA = {
|
|
151
|
-
args: {
|
|
152
|
-
url: "http://example.com",
|
|
153
|
-
dataQa: "important-link"
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
export const InternalLink = {
|
|
158
|
-
args: {
|
|
159
|
-
url: "/example"
|
|
160
|
-
}
|
|
161
|
-
};
|
|
4
|
+
import page from "../../../../.storybook/page";
|
|
5
|
+
|
|
6
|
+
const variants = {
|
|
7
|
+
primary: "primary",
|
|
8
|
+
secondary: "secondary",
|
|
9
|
+
back: "back",
|
|
10
|
+
smallPrimary: "smallPrimary",
|
|
11
|
+
smallSecondary: "smallSecondary",
|
|
12
|
+
ghost: "ghost",
|
|
13
|
+
smallGhost: "smallGhost",
|
|
14
|
+
danger: "danger",
|
|
15
|
+
None: undefined
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const buttonWithLink = () => (
|
|
19
|
+
<ButtonWithLink
|
|
20
|
+
variant={select("variant", variants, "primary", "props")}
|
|
21
|
+
url={text("url", "/login", "props")}
|
|
22
|
+
disabled={boolean("disabled", false, "props")}
|
|
23
|
+
extraStyles={text("extraStyles", "", "props")}
|
|
24
|
+
text={text("text", "Lorem", "props")}
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const story = page({
|
|
29
|
+
title: "Components|Atoms/ButtonWithLink",
|
|
30
|
+
Component: ButtonWithLink
|
|
31
|
+
});
|
|
32
|
+
export default story;
|
|
@@ -1,149 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { text, select, boolean } from "@storybook/addon-knobs";
|
|
1
3
|
import Checkbox from "./Checkbox";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
description: "Sets margin value on the components wrapping div",
|
|
30
|
-
type: { summary: "string" },
|
|
31
|
-
defaultValue: { summary: "0 16px 0 0" }
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
textExtraStyles: {
|
|
35
|
-
table: {
|
|
36
|
-
description: "Styles for the text defined in the `title` prop",
|
|
37
|
-
type: { summary: "string" }
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
onChange: {
|
|
41
|
-
table: {
|
|
42
|
-
type: { summary: "function" }
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
dataQa: {
|
|
46
|
-
table: {
|
|
47
|
-
type: { summary: "string" }
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
labelledById: {
|
|
51
|
-
table: {
|
|
52
|
-
type: { summary: "string" }
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
extraStyles: {
|
|
56
|
-
table: {
|
|
57
|
-
type: { summary: "string" }
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
error: {
|
|
61
|
-
table: {
|
|
62
|
-
type: { summary: "boolean" }
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
title: {
|
|
66
|
-
table: {
|
|
67
|
-
type: { summary: "string" }
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
name: {
|
|
71
|
-
table: {
|
|
72
|
-
type: { summary: "string" }
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
const CheckboxWithHooks = props => {
|
|
79
|
-
const [checked, setChecked] = useState(false);
|
|
80
|
-
|
|
81
|
-
const onChange = () => setChecked(!checked);
|
|
82
|
-
|
|
83
|
-
return <Checkbox {...props} onChange={onChange} checked={checked} />;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
const RequiredCheckbox = props => {
|
|
87
|
-
const [checked, setChecked] = useState(false);
|
|
88
|
-
|
|
89
|
-
const onChange = () => setChecked(!checked);
|
|
90
|
-
|
|
91
|
-
return (
|
|
92
|
-
<div>
|
|
93
|
-
<Checkbox
|
|
94
|
-
{...props}
|
|
95
|
-
onChange={onChange}
|
|
96
|
-
checked={checked}
|
|
97
|
-
error={!checked}
|
|
98
|
-
/>
|
|
99
|
-
{!checked && (
|
|
100
|
-
<div id={`${props.name}-error-message`}>You must check this!</div>
|
|
101
|
-
)}
|
|
102
|
-
</div>
|
|
103
|
-
);
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
export default meta;
|
|
107
|
-
|
|
108
|
-
export const Basic = args => <CheckboxWithHooks {...args} />;
|
|
109
|
-
|
|
110
|
-
export const Title = {
|
|
111
|
-
args: {
|
|
112
|
-
title: "My Checkbox"
|
|
113
|
-
},
|
|
114
|
-
render: args => <CheckboxWithHooks {...args} />
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
export const ExtraStyles = {
|
|
118
|
-
args: {
|
|
119
|
-
title: "My Stylish Checkbox",
|
|
120
|
-
textExtraStyles: `outline: 2px dashed red;`
|
|
121
|
-
},
|
|
122
|
-
render: args => <CheckboxWithHooks {...args} />
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
export const Disabled = {
|
|
126
|
-
args: {
|
|
127
|
-
disabled: true
|
|
128
|
-
},
|
|
129
|
-
render: args => <CheckboxWithHooks {...args} />
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
export const CheckboxMargin = {
|
|
133
|
-
args: {
|
|
134
|
-
checkboxMargin: "0",
|
|
135
|
-
title: "Custom Margin"
|
|
136
|
-
},
|
|
137
|
-
render: args => <CheckboxWithHooks {...args} />
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
export const Required = {
|
|
141
|
-
render: args => <RequiredCheckbox {...args} />
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
export const Hidden = {
|
|
145
|
-
args: {
|
|
146
|
-
hidden: true
|
|
147
|
-
},
|
|
148
|
-
render: args => <CheckboxWithHooks {...args} />
|
|
149
|
-
};
|
|
4
|
+
import page from "../../../../.storybook/page";
|
|
5
|
+
|
|
6
|
+
const variantsLabel = "variant";
|
|
7
|
+
const variants = {
|
|
8
|
+
default: "default"
|
|
9
|
+
};
|
|
10
|
+
const defaultValue = "default";
|
|
11
|
+
const groupId = "props";
|
|
12
|
+
|
|
13
|
+
export const checkbox = () => (
|
|
14
|
+
<Checkbox
|
|
15
|
+
variant={select(variantsLabel, variants, defaultValue, groupId)}
|
|
16
|
+
title={text("title", "Checkbox", "props")}
|
|
17
|
+
name={text("name", "Checkbox", "props")}
|
|
18
|
+
checked={boolean("checked", false, "props")}
|
|
19
|
+
error={boolean("error", false, "props")}
|
|
20
|
+
disabled={boolean("disabled", false, "props")}
|
|
21
|
+
focused={boolean("focused", false, "props")}
|
|
22
|
+
labelledById={text("labelledById", undefined, "props")}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
const story = page({
|
|
27
|
+
title: "Components|Atoms/Checkbox",
|
|
28
|
+
Component: Checkbox
|
|
29
|
+
});
|
|
30
|
+
export default story;
|
|
@@ -1,76 +1,42 @@
|
|
|
1
|
-
import CountryDropdown from "./CountryDropdown";
|
|
2
|
-
import { connect, Provider } from "react-redux";
|
|
3
|
-
import { createStore } from "redux";
|
|
4
|
-
import { createFormState, required } from "redux-freeform";
|
|
5
1
|
import React from "react";
|
|
2
|
+
import { connect } from "react-redux";
|
|
3
|
+
import { createFormState, required } from "redux-freeform";
|
|
4
|
+
import { Box } from "../../atoms/layouts";
|
|
5
|
+
import CountryDropdown from "./CountryDropdown";
|
|
6
|
+
import { options } from "./options";
|
|
7
|
+
import page from "../../../../.storybook/page";
|
|
6
8
|
|
|
7
9
|
const { mapStateToProps, mapDispatchToProps, reducer } = createFormState({
|
|
8
10
|
country: {
|
|
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
15
|
[required.error]: "country is required"
|
|
20
16
|
};
|
|
21
17
|
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
fieldActions={props.actions.fields.country}
|
|
27
|
-
/>
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
const ConnectedCountryDropdown = connect(
|
|
18
|
+
const story = page({
|
|
19
|
+
title: "Components|Atoms/CountryDropdown",
|
|
20
|
+
Component: CountryDropdown,
|
|
21
|
+
reducer,
|
|
31
22
|
mapStateToProps,
|
|
32
23
|
mapDispatchToProps
|
|
33
|
-
)
|
|
24
|
+
});
|
|
34
25
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
onChange: null,
|
|
46
|
-
labelTextWhenNoError: "Country",
|
|
47
|
-
isRequired: false,
|
|
48
|
-
dataQa: null
|
|
49
|
-
},
|
|
50
|
-
argTypes: {
|
|
51
|
-
fieldActions: { type: "object" },
|
|
52
|
-
field: { type: "object" },
|
|
53
|
-
dataQa: {
|
|
54
|
-
type: "string",
|
|
55
|
-
table: {
|
|
56
|
-
type: { summary: "string" },
|
|
57
|
-
defaultValue: { summary: "CountryDropdown" }
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
showErrors: {
|
|
61
|
-
table: {
|
|
62
|
-
type: { summary: "boolean" },
|
|
63
|
-
defaultValue: { summary: undefined }
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
decorators: [
|
|
68
|
-
Story => (
|
|
69
|
-
<Provider store={store}>
|
|
70
|
-
<Story />
|
|
71
|
-
</Provider>
|
|
72
|
-
)
|
|
73
|
-
]
|
|
74
|
-
};
|
|
26
|
+
const CountryFormWrapper = ({ fields, actions }) => (
|
|
27
|
+
<Box minHeight="300px">
|
|
28
|
+
<CountryDropdown
|
|
29
|
+
errorMessages={errorMessages}
|
|
30
|
+
options={options}
|
|
31
|
+
field={fields.country}
|
|
32
|
+
fieldActions={actions.fields.country}
|
|
33
|
+
/>
|
|
34
|
+
</Box>
|
|
35
|
+
);
|
|
75
36
|
|
|
76
|
-
export
|
|
37
|
+
export default story;
|
|
38
|
+
const ConnectedForm = connect(
|
|
39
|
+
mapStateToProps,
|
|
40
|
+
mapDispatchToProps
|
|
41
|
+
)(CountryFormWrapper);
|
|
42
|
+
export const countryDropdown = () => <ConnectedForm />;
|
|
@@ -10,6 +10,32 @@ import {
|
|
|
10
10
|
} from "./Detail.theme";
|
|
11
11
|
import { themeComponent } from "../../../util/themeUtils";
|
|
12
12
|
|
|
13
|
+
/*
|
|
14
|
+
New responsive text component for Detail elements
|
|
15
|
+
(Block level text elements which are smaller than "Title" elements)
|
|
16
|
+
Size is decoupled from tag
|
|
17
|
+
Comes with four variants - "large", "regular", "small", "extraSmall"
|
|
18
|
+
Large variant results in text that is 1.125rem/1.1428rem (18px desktop, 16px mobile)
|
|
19
|
+
Regular variant results in text that is 1rem (16px desktop, 14px mobile)
|
|
20
|
+
Small variant reuslts in text that is 0.875rem/0.8571rem (14px desktop, 12px mobile)
|
|
21
|
+
ExtraSmall variant results in text that is 0.75rem/0.7142rem (12px desktop, 10px mobile)
|
|
22
|
+
|
|
23
|
+
If you need a larger font size, use the <Title /> atom, which has larger variants
|
|
24
|
+
|
|
25
|
+
Use the "as" prop to specify element type, can use any of: h1/h2/h3/h4/h5/h6/p
|
|
26
|
+
If you need an inline text element (span), use the <Text /> atom
|
|
27
|
+
The "as" value should be dictated by the structure of your page, not what font-size you want
|
|
28
|
+
|
|
29
|
+
Title / Detail both use slightly different desktop/mobile scales
|
|
30
|
+
(Mobile scale is different to allow for design-friendly px values)
|
|
31
|
+
Both atoms detect the presence of a mobile device on their own
|
|
32
|
+
and apply the corresponding scale
|
|
33
|
+
|
|
34
|
+
Mobile breakpoint value is specified in Detail.theme.js
|
|
35
|
+
|
|
36
|
+
If you want to disable mobile text scales (use the same rem scale for desktop/mobile), then use a theme in FCS to set all of the variants to use the same rem sizes. FCS themes override fallbacks defined in the .theme file
|
|
37
|
+
*/
|
|
38
|
+
|
|
13
39
|
const isBelowBreakpoint = window.innerWidth < MOBILE_BREAKPOINT;
|
|
14
40
|
const isTouchDevice = "ontouchstart" in window || navigator.maxTouchPoints > 1;
|
|
15
41
|
const mobileDeviceDetected = isBelowBreakpoint && isTouchDevice;
|
|
@@ -1,69 +1,25 @@
|
|
|
1
|
-
import DisplayBox from "./DisplayBox";
|
|
2
1
|
import React from "react";
|
|
2
|
+
import { boolean } from "@storybook/addon-knobs";
|
|
3
|
+
import DisplayBox from "./DisplayBox";
|
|
3
4
|
import FormattedAddress from "../formatted-address";
|
|
5
|
+
import page from "../../../../.storybook/page";
|
|
4
6
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
dataQa: {
|
|
19
|
-
control: { type: "text" },
|
|
20
|
-
table: {
|
|
21
|
-
type: { summary: "string" },
|
|
22
|
-
defaultValue: { summary: null }
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
showError: {
|
|
26
|
-
control: { type: "boolean" },
|
|
27
|
-
table: {
|
|
28
|
-
type: { summary: "boolean" },
|
|
29
|
-
defaultValue: { summary: undefined }
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
children: {
|
|
33
|
-
table: {
|
|
34
|
-
type: { summary: "string/component" },
|
|
35
|
-
defaultValue: { summary: undefined }
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export default meta;
|
|
42
|
-
|
|
43
|
-
export const Basic = {
|
|
44
|
-
render: args => <DisplayBox {...args} />
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const Error = {
|
|
48
|
-
args: {
|
|
49
|
-
showError: true
|
|
50
|
-
},
|
|
51
|
-
render: args => <DisplayBox {...args} />
|
|
52
|
-
};
|
|
7
|
+
export const displayBox = () => (
|
|
8
|
+
<DisplayBox showError={boolean("showError", false, "props")}>
|
|
9
|
+
<FormattedAddress
|
|
10
|
+
qaPrefix="billing-info"
|
|
11
|
+
name="Citybase"
|
|
12
|
+
street1="30 North Lasalle"
|
|
13
|
+
city="Chicago"
|
|
14
|
+
country="USA"
|
|
15
|
+
stateProvince="Illinois"
|
|
16
|
+
zip="60606"
|
|
17
|
+
/>
|
|
18
|
+
</DisplayBox>
|
|
19
|
+
);
|
|
53
20
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
name="Citybase"
|
|
60
|
-
street1="30 North Lasalle"
|
|
61
|
-
city="Chicago"
|
|
62
|
-
country="USA"
|
|
63
|
-
stateProvince="Illinois"
|
|
64
|
-
zip="60606"
|
|
65
|
-
/>
|
|
66
|
-
)
|
|
67
|
-
},
|
|
68
|
-
render: args => <DisplayBox {...args} />
|
|
69
|
-
};
|
|
21
|
+
const story = page({
|
|
22
|
+
title: "Components|Atoms/DisplayBox",
|
|
23
|
+
Component: DisplayBox
|
|
24
|
+
});
|
|
25
|
+
export default story;
|