@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.
Files changed (180) hide show
  1. package/README.md +14 -6
  2. package/dist/index.cjs.js +1311 -1482
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.esm.js +1311 -1483
  5. package/dist/index.esm.js.map +1 -1
  6. package/package.json +25 -13
  7. package/src/.DS_Store +0 -0
  8. package/src/components/.DS_Store +0 -0
  9. package/src/components/atoms/.DS_Store +0 -0
  10. package/src/components/atoms/alert/Alert.mdx +19 -0
  11. package/src/components/atoms/alert/Alert.stories.js +148 -26
  12. package/src/components/atoms/badge/Badge.js +2 -2
  13. package/src/components/atoms/badge/Badge.mdx +27 -0
  14. package/src/components/atoms/badge/Badge.stories.js +143 -29
  15. package/src/components/atoms/breadcrumb/Breadcrumb.mdx +21 -0
  16. package/src/components/atoms/breadcrumb/Breadcrumb.stories.js +38 -29
  17. package/src/components/atoms/button-with-action/ButtonWithAction.stories.js +108 -55
  18. package/src/components/atoms/button-with-link/ButtonWithLink.mdx +21 -0
  19. package/src/components/atoms/button-with-link/ButtonWithLink.stories.js +160 -31
  20. package/src/components/atoms/card/Card.mdx +41 -0
  21. package/src/components/atoms/card/Card.stories.js +351 -0
  22. package/src/components/atoms/card/CardText.js +6 -1
  23. package/src/components/atoms/checkbox/Checkbox.mdx +15 -0
  24. package/src/components/atoms/checkbox/Checkbox.oldstories.js +34 -0
  25. package/src/components/atoms/checkbox/Checkbox.stories.js +140 -25
  26. package/src/components/atoms/country-dropdown/CountryDropdown.mdx +36 -0
  27. package/src/components/atoms/country-dropdown/CountryDropdown.stories.js +61 -27
  28. package/src/components/atoms/detail/Detail.js +0 -26
  29. package/src/components/atoms/detail/Detail.mdx +32 -0
  30. package/src/components/atoms/detail/Detail.stories.js +156 -0
  31. package/src/components/atoms/display-box/DisplayBox.mdx +11 -0
  32. package/src/components/atoms/display-box/DisplayBox.stories.js +65 -21
  33. package/src/components/atoms/display-card/DisplayCard.mdx +13 -0
  34. package/src/components/atoms/display-card/DisplayCard.stories.js +163 -22
  35. package/src/components/atoms/dropdown/Dropdown.mdx +65 -0
  36. package/src/components/atoms/dropdown/Dropdown.stories.js +91 -10
  37. package/src/components/atoms/form-layouts/FormInput.mdx +38 -0
  38. package/src/components/atoms/form-layouts/FormInput.stories.js +212 -26
  39. package/src/components/atoms/form-select/FormSelect.mdx +42 -0
  40. package/src/components/atoms/form-select/FormSelect.stories.js +55 -29
  41. package/src/components/atoms/formatted-address/FormattedAddress.mdx +13 -0
  42. package/src/components/atoms/formatted-address/FormattedAddress.stories.js +133 -27
  43. package/src/components/atoms/formatted-bank-account/FormattedBankAccount.mdx +17 -0
  44. package/src/components/atoms/formatted-bank-account/FormattedBankAccount.stories.js +57 -0
  45. package/src/components/atoms/formatted-credit-card/FormattedCreditCard.mdx +40 -0
  46. package/src/components/atoms/formatted-credit-card/FormattedCreditCard.stories.js +74 -0
  47. package/src/components/atoms/icons/Icons.mdx +40 -0
  48. package/src/components/atoms/icons/Icons.stories.js +325 -0
  49. package/src/components/atoms/labeled-amount/LabeledAmount.mdx +23 -0
  50. package/src/components/atoms/labeled-amount/LabeledAmount.stories.js +110 -34
  51. package/src/components/atoms/line-item/LineItem.mdx +28 -0
  52. package/src/components/atoms/line-item/LineItem.stories.js +89 -22
  53. package/src/components/atoms/link/Link.mdx +19 -0
  54. package/src/components/atoms/link/Link.stories.js +155 -49
  55. package/src/components/atoms/loading/Loading.mdx +13 -0
  56. package/src/components/atoms/loading/Loading.stories.js +22 -0
  57. package/src/components/atoms/loading-line/LoadingLine.js +14 -10
  58. package/src/components/atoms/loading-line/LoadingLine.mdx +15 -0
  59. package/src/components/atoms/loading-line/LoadingLine.stories.js +132 -28
  60. package/src/components/atoms/nav-footer/.DS_Store +0 -0
  61. package/src/components/atoms/nav-footer/NavFooter.mdx +15 -0
  62. package/src/components/atoms/nav-footer/NavFooter.stories.js +235 -22
  63. package/src/components/atoms/nav-header/NavHeader.mdx +13 -0
  64. package/src/components/atoms/nav-header/NavHeader.stories.js +122 -21
  65. package/src/components/atoms/nav-tabs/NavTabs.mdx +30 -0
  66. package/src/components/atoms/nav-tabs/NavTabs.stories.js +49 -0
  67. package/src/components/atoms/password-requirements/PasswordRequirements.mdx +39 -0
  68. package/src/components/atoms/password-requirements/PasswordRequirements.stories.js +108 -44
  69. package/src/components/atoms/placeholder/Placeholder.mdx +19 -0
  70. package/src/components/atoms/placeholder/Placeholder.stories.js +164 -36
  71. package/src/components/atoms/searchable-select/SearchableSelect.mdx +44 -0
  72. package/src/components/atoms/searchable-select/SearchableSelect.stories.js +103 -28
  73. package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.mdx +36 -0
  74. package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.stories.js +65 -40
  75. package/src/components/atoms/table/Table.mdx +71 -0
  76. package/src/components/atoms/table/Table.oldstories.js +84 -0
  77. package/src/components/atoms/table/Table.stories.js +59 -75
  78. package/src/components/atoms/table/TableRow.js +1 -0
  79. package/src/components/atoms/title/Title.js +0 -23
  80. package/src/components/atoms/title/Title.mdx +26 -0
  81. package/src/components/atoms/title/Title.stories.js +144 -0
  82. package/src/components/atoms/toggle-switch/ToggleSwitch.mdx +17 -0
  83. package/src/components/atoms/toggle-switch/ToggleSwitch.stories.js +103 -20
  84. package/src/components/atoms/toggle-switch/ToggleSwitch.theme.js +8 -5
  85. package/src/components/atoms/typeahead-input/TypeaheadInput.mdx +13 -0
  86. package/src/components/atoms/typeahead-input/TypeaheadInput.stories.js +63 -0
  87. package/src/components/molecules/.DS_Store +0 -0
  88. package/src/components/molecules/address-form/AddressForm.mdx +18 -0
  89. package/src/components/molecules/address-form/AddressForm.stories.js +223 -20
  90. package/src/components/molecules/banner/Banner.mdx +23 -0
  91. package/src/components/molecules/banner/Banner.stories.js +122 -26
  92. package/src/components/molecules/change-password-form/ChangePasswordForm.mdx +15 -0
  93. package/src/components/molecules/change-password-form/ChangePasswordForm.stories.js +203 -19
  94. package/src/components/molecules/collapsible-section/CollapsibleSection.mdx +15 -0
  95. package/src/components/molecules/collapsible-section/CollapsibleSection.stories.js +210 -61
  96. package/src/components/molecules/edit-name-form/EditNameForm.mdx +13 -0
  97. package/src/components/molecules/edit-name-form/EditNameForm.stories.js +117 -0
  98. package/src/components/molecules/idle-modal/IdleModal.js +101 -0
  99. package/src/components/molecules/idle-modal/IdleModal.mdx +17 -0
  100. package/src/components/molecules/idle-modal/IdleModal.stories.js +180 -0
  101. package/src/components/molecules/idle-modal/index.d.ts +16 -0
  102. package/src/components/molecules/idle-modal/index.js +3 -0
  103. package/src/components/molecules/index.js +1 -0
  104. package/src/components/molecules/link-card/LinkCard.mdx +17 -0
  105. package/src/components/molecules/link-card/LinkCard.stories.js +287 -72
  106. package/src/components/molecules/login-form/LoginForm.mdx +16 -0
  107. package/src/components/molecules/login-form/LoginForm.stories.js +117 -21
  108. package/src/components/molecules/modal/Modal.mdx +17 -0
  109. package/src/components/molecules/modal/Modal.stories.js +342 -128
  110. package/src/components/molecules/module/Module.mdx +17 -0
  111. package/src/components/molecules/module/Module.stories.js +267 -25
  112. package/src/components/molecules/obligation/.DS_Store +0 -0
  113. package/src/components/molecules/obligation/Obligation.mdx +23 -0
  114. package/src/components/molecules/obligation/Obligation.stories.js +460 -0
  115. package/src/components/molecules/obligation/icons/PropertyPersonalIcon.js +1 -1
  116. package/src/components/molecules/pagination/Pagination.mdx +15 -0
  117. package/src/components/molecules/pagination/Pagination.stories.js +177 -28
  118. package/src/components/molecules/popover/Popover.mdx +15 -0
  119. package/src/components/molecules/popover/Popover.stories.js +220 -0
  120. package/src/components/molecules/tabs/Tabs.mdx +17 -0
  121. package/src/components/molecules/tabs/Tabs.stories.js +135 -227
  122. package/src/components/molecules/toast-notification/Toast.mdx +15 -0
  123. package/src/components/molecules/toast-notification/Toast.stories.js +183 -0
  124. package/src/util/idleTimerUtils.js +36 -0
  125. package/src/util/index.js +3 -1
  126. package/src/components/molecules/edit-name-form/EdidNameForm.stories.js +0 -24
  127. package/src/components/molecules/toast-notification/ToastNotification.stories.js +0 -105
  128. /package/src/components/atoms/add-obligation/{AddObligation.stories.js → AddObligation.oldstories.js} +0 -0
  129. /package/src/components/atoms/amount-callout/{AmountCallout.stories.js → AmountCallout.oldstories.js} +0 -0
  130. /package/src/components/atoms/checkbox-list/{CheckboxList.stories.js → CheckboxList.oldstories.js} +0 -0
  131. /package/src/components/atoms/form-layouts/{FormLayouts.stories.js → FormLayouts.oldstories.js} +0 -0
  132. /package/src/components/atoms/hamburger-button/{HamburgerButton.stories.js → HamburgerButton.oldstories.js} +0 -0
  133. /package/src/components/atoms/heading/{Heading.stories.js → Heading.oldstories.js} +0 -0
  134. /package/src/components/atoms/icons/{icons.stories.js → icons.oldstories.js} +0 -0
  135. /package/src/components/atoms/layouts/examples/box-example/{BoxExample.stories.js → BoxExample.oldstories.js} +0 -0
  136. /package/src/components/atoms/layouts/examples/center-example/{CenterExample.stories.js → CenterExample.oldstories.js} +0 -0
  137. /package/src/components/atoms/layouts/examples/cluster-example/{ClusterExample.stories.js → ClusterExample.oldstories.js} +0 -0
  138. /package/src/components/atoms/layouts/examples/cover-example/{CoverExample.stories.js → CoverExample.oldstories.js} +0 -0
  139. /package/src/components/atoms/layouts/examples/frame-example/{FrameExample.stories.js → FrameExample.oldstories.js} +0 -0
  140. /package/src/components/atoms/layouts/examples/grid-example/{GridExample.stories.js → GridExample.oldstories.js} +0 -0
  141. /package/src/components/atoms/layouts/examples/imposter-example/{ImposterExample.stories.js → ImposterExample.oldstories.js} +0 -0
  142. /package/src/components/atoms/layouts/examples/motion-example/{MotionExample.stories.js → MotionExample.oldstories.js} +0 -0
  143. /package/src/components/atoms/layouts/examples/reel-example/{ReelExample.stories.js → ReelExample.oldstories.js} +0 -0
  144. /package/src/components/atoms/layouts/examples/sidebar-example/{SidebarExample.stories.js → SidebarExample.oldstories.js} +0 -0
  145. /package/src/components/atoms/layouts/examples/stack-example/{StackExample.stories.js → StackExample.oldstories.js} +0 -0
  146. /package/src/components/atoms/layouts/examples/switcher-example/{SwitcherExample.stories.js → SwitcherExample.oldstories.js} +0 -0
  147. /package/src/components/atoms/paragraph/{Paragraph.stories.js → Paragraph.oldstories.js} +0 -0
  148. /package/src/components/atoms/processing-fee/{ProcessingFee.stories.js → ProcessingFee.oldstories.js} +0 -0
  149. /package/src/components/atoms/search/{Search.stories.js → Search.oldstories.js} +0 -0
  150. /package/src/components/atoms/solid-divider/{SolidDivider.stories.js → SolidDivider.oldstories.js} +0 -0
  151. /package/src/components/atoms/sortable-table-heading/{SortableTableHeading.stories.js → SortableTableHeading.oldstories.js} +0 -0
  152. /package/src/components/atoms/spinner/{Spinner.stories.js → Spinner.oldstories.js} +0 -0
  153. /package/src/components/atoms/tab/{Tab.stories.js → Tab.oldstories.js} +0 -0
  154. /package/src/components/atoms/text/{Text.stories.js → Text.oldstories.js} +0 -0
  155. /package/src/components/atoms/typeahead-input/{TypeaheadIinput.stories.js → TypeaheadIinput.oldstories.js} +0 -0
  156. /package/src/components/atoms/wallet-name/{WalletName.stories.js → WalletName.oldstories.js} +0 -0
  157. /package/src/components/molecules/account-and-routing-modal/{AccountAndRoutingModal.stories.js → AccountAndRoutingModal.oldstories.js} +0 -0
  158. /package/src/components/molecules/editable-list/{EditableList.stories.js → EditableList.oldstories.js} +0 -0
  159. /package/src/components/molecules/email-form/{EmailForm.stories.js → EmailForm.oldstories.js} +0 -0
  160. /package/src/components/molecules/forgot-password-form/{ForgotPasswordForm.stories.js → ForgotPasswordForm.oldstories.js} +0 -0
  161. /package/src/components/molecules/highlight-tab-row/{HighlightTabRow.stories.js → HighlightTabRow.oldstories.js} +0 -0
  162. /package/src/components/molecules/multiple-select-filter/{MultipleSelectFilter.stories.js → MultipleSelectFilter.oldstories.js} +0 -0
  163. /package/src/components/molecules/obligation/modules/{AmountModule.stories.js → AmountModule.oldstories.js} +0 -0
  164. /package/src/components/molecules/payment-button-bar/{PaymentButtonBar.stories.js → PaymentButtonBar.oldstories.js} +0 -0
  165. /package/src/components/molecules/payment-details/{PaymentDetails.stories.js → PaymentDetails.oldstories.js} +0 -0
  166. /package/src/components/molecules/payment-form-ach/{PaymentFormACH.stories.js → PaymentFormACH.oldstories.js} +0 -0
  167. /package/src/components/molecules/payment-form-card/{PaymentFormCard.stories.js → PaymentFormCard.oldstories.js} +0 -0
  168. /package/src/components/molecules/periscope-dashboard-iframe/{PeriscopeDashBoardIframe.stories.js → PeriscopeDashBoardIframe.oldstories.js} +0 -0
  169. /package/src/components/molecules/phone-form/{PhoneForm.stories.js → PhoneForm.oldstories.js} +0 -0
  170. /package/src/components/molecules/popup-menu/{PopupMenu.stories.js → PopupMenu.oldstories.js} +0 -0
  171. /package/src/components/molecules/radio-group/{RadioGroup.stories.js → RadioGroup.oldstories.js} +0 -0
  172. /package/src/components/molecules/radio-section/{RadioSection.stories.js → RadioSection.oldstories.js} +0 -0
  173. /package/src/components/molecules/registration-form/{RegistrationForm.stories.js → RegistrationForm.oldstories.js} +0 -0
  174. /package/src/components/molecules/reset-confirmation-form/{ResetConfirmationForm.stories.js → ResetConfirmationForm.oldstories.js} +0 -0
  175. /package/src/components/molecules/reset-password-form/{ResetPasswordForm.stories.js → ResetPasswordForm.oldstories.js} +0 -0
  176. /package/src/components/molecules/reset-password-success/{ResetPasswordSuccess.stories.js → ResetPasswordSuccess.oldstories.js} +0 -0
  177. /package/src/components/molecules/tab-sidebar/{TabSidebar.stories.js → TabSidebar.oldstories.js} +0 -0
  178. /package/src/components/molecules/terms-and-conditions/{TermsAndConditions.stories.js → TermsAndConditions.oldstories.js} +0 -0
  179. /package/src/components/molecules/terms-and-conditions-modal/{TermsAndConditionsModal.stories.js → TermsAndConditionsModal.oldstories.js} +0 -0
  180. /package/src/components/molecules/workflow-tile/{WorkflowTile.stories.js → WorkflowTile.oldstories.js} +0 -0
@@ -0,0 +1,325 @@
1
+ import * as icons from "./index";
2
+ import styled from "styled-components";
3
+ import { MANATEE_GREY } from "../../../constants/colors";
4
+
5
+ const meta = {
6
+ title: "Atoms/Icons",
7
+ component: icons.AccountsIcon,
8
+ parameters: {
9
+ layout: "centered"
10
+ },
11
+ tags: ["!autodocs"],
12
+ args: {
13
+ ariaLabel: undefined,
14
+ color: undefined,
15
+ colorOverride: undefined,
16
+ fill: undefined,
17
+ height: undefined,
18
+ iconFill: undefined,
19
+ iconHeight: undefined,
20
+ iconIndex: undefined,
21
+ iconWidth: undefined,
22
+ labelledBy: undefined,
23
+ linkColor: undefined,
24
+ strokeWidth: undefined,
25
+ text: undefined,
26
+ title: undefined,
27
+ titleID: undefined
28
+ },
29
+ argTypes: {
30
+ ariaLabel: {
31
+ description: "Sets the `aria-label` value on the `PencilIcon` icon",
32
+ table: {
33
+ type: { summary: "string" },
34
+ defaultValue: { summary: "Edit" }
35
+ }
36
+ },
37
+ color: {
38
+ description:
39
+ "Sets a color (usually for a `fill` attribute) on one or many elements within a component. The default value for this prop varies by component. Used in the following componenets: `ArrowDownCircleIconSmall`, `ArrowLeftCircleIconMedium`, `ArrowLeftCircleIconSmall`, `ArrowRightCircleIconSmall`, `ArrowUpCircleIconSmall`, `AutopayOnIcon`, `ChargebackIconMedium`, `ChargebackIconSmall`, `ChargebackReversalIconMedium`, `ChargebackReversalIconSmall`, `RefundIconMedium`, `RefundIconSmall`, `XCircleIconMedium`, `XCircleIconSmall`, `AutopayIcon`, `ArrowRightIcon`, `PlusCircleIcon`, `WarningIconXS`, `EmptyCartIconV2`",
40
+ table: {
41
+ type: { summary: "string" },
42
+ defaultValue: { summary: `varies` }
43
+ }
44
+ },
45
+ colorOverride: {
46
+ description:
47
+ "Overrides the theme values for some element's fill attribute in the `WalletIconSmall` component",
48
+ table: {
49
+ type: { summary: "string" },
50
+ defaultValue: { summary: undefined }
51
+ }
52
+ },
53
+ fill: {
54
+ description:
55
+ "Sets the fill attribute in the following components: `AutopayIcon`, `IconQuitLarge`, `PendingIcon`",
56
+ table: {
57
+ type: { summary: "string" },
58
+ defaultValue: { summary: `varies` }
59
+ }
60
+ },
61
+ height: {
62
+ description:
63
+ "Sets the `height` value in the `style` attribute for the `EmptyCartIconV2` component",
64
+ table: {
65
+ type: { summary: "string" },
66
+ defaultValue: { summary: "auto" }
67
+ }
68
+ },
69
+ iconFill: {
70
+ description:
71
+ "Sets the fill attribute in the following components: `ChevronIcon`, `TrashIcon`, `TrashIconV2`, `CloseIcon`, `MultiCartIcon`",
72
+ table: {
73
+ type: { summary: "string" },
74
+ defaultValue: { summary: `varies` }
75
+ }
76
+ },
77
+ iconHeight: {
78
+ description:
79
+ "Sets the height of the `CloseIcon` and `MultiCartIcon` icons",
80
+ table: {
81
+ type: { summary: "string" },
82
+ defaultValue: { summary: `varies` }
83
+ }
84
+ },
85
+ iconIndex: {
86
+ description:
87
+ "Used to create a unique id for a variety of elements in the following components: `BankIconLarge`, `SuccessfulIconMedium`, `SuccessfulIconSmall`, `WarningIconXS`, `XCircleIconSmall`, `XCircleIconMedium`, `RefundIconSmall`, `RefundIconMedium`, `ChargebackReversalIconSmall`, `ChargebackReversalIconMedium`, `ChargebackIconSmall`, `ChargebackIconMedium`, `AutopayOnIcon`, `ArrowUpCircleIconSmall`, `ArrowRightCircleIconSmall`, `ArrowLeftCircleIconSmall`, `ArrowLeftCircleIconMedium`, `ArrowDownCircleIconSmall`, `WalletIconSmall`, `FindIconSmall`",
88
+ table: {
89
+ type: { summary: "string | number" },
90
+ defaultValue: { summary: 0 }
91
+ }
92
+ },
93
+ iconWidth: {
94
+ description:
95
+ "Sets the width of the `CloseIcon` and `MultiCartIcon` icons",
96
+ table: {
97
+ type: { summary: "string | number" },
98
+ defaultValue: { summary: `varies` }
99
+ }
100
+ },
101
+ labelledBy: {
102
+ description:
103
+ "Sets the `aria-labelledby` value in the following components: `ArrowRightIcon`, `PlusCircleIcon`",
104
+ table: {
105
+ type: { summary: "string" },
106
+ defaultValue: { summary: "" }
107
+ }
108
+ },
109
+ linkColor: {
110
+ description:
111
+ "Sets the fill attribute on multiple elements in the `ExternalLinkIcon` component",
112
+ table: {
113
+ type: { summary: "string" },
114
+ defaultValue: { summary: undefined }
115
+ }
116
+ },
117
+ strokeWidth: {
118
+ description: "Set the stroke width on the circle in `IconAdd`",
119
+ table: {
120
+ type: { summary: "string | number" },
121
+ defaultValue: { summary: 1 }
122
+ }
123
+ },
124
+ text: {
125
+ description:
126
+ "Used to create a unique id for a `<mask />` element in `ExternalLinkIcon`",
127
+ table: {
128
+ type: { summary: "string" },
129
+ defaultValue: { summary: undefined }
130
+ }
131
+ },
132
+ title: {
133
+ description:
134
+ "Sets the text of the `<title />` element in the `WarningIconXS` component",
135
+ table: {
136
+ type: { summary: "string" },
137
+ defaultValue: { summary: undefined }
138
+ }
139
+ },
140
+ titleID: {
141
+ description:
142
+ "Used to build a unique id for the `<title />` element in the `WarningIconXS` component, which is matched with the `aria-labelledby` value",
143
+ table: {
144
+ type: { summary: "string" },
145
+ defaultValue: { summary: "warning-icon-title" }
146
+ }
147
+ }
148
+ }
149
+ };
150
+
151
+ const StyledIconLIst = styled.ul`
152
+ align-items: center;
153
+ display: flex;
154
+ flex-direction: column;
155
+ gap: 2em;
156
+ list-style: none;
157
+
158
+ li {
159
+ padding-bottom: 2em;
160
+ text-align: center;
161
+ width: 100%;
162
+
163
+ &:not(:last-child) {
164
+ border-bottom: 1px solid ${MANATEE_GREY};
165
+ }
166
+ }
167
+
168
+ .icon-name {
169
+ margin-top: 1em;
170
+ font-family: monospace
171
+ font-size: 2em;
172
+ }
173
+
174
+ // for the IconAdd component
175
+ .fill { fill: ${MANATEE_GREY} }
176
+ .stroke { stroke: ${MANATEE_GREY} }
177
+ `;
178
+
179
+ const IconList = ({ iconNames }) => (
180
+ <StyledIconLIst>
181
+ {iconNames.map(icon => (
182
+ <li key={icon} style={{ textAlign: "center", paddingBottom: "2em" }}>
183
+ {icons[icon]({ linkColor: MANATEE_GREY })}
184
+ <div className="icon-name">{icon}</div>
185
+ </li>
186
+ ))}
187
+ </StyledIconLIst>
188
+ );
189
+
190
+ const genericIcons = [
191
+ "DuplicateIcon",
192
+ "CalendarIcon",
193
+ "PendingIcon",
194
+ "StatusUnknownIcon",
195
+ "FailedIcon",
196
+ "ErroredIcon",
197
+ "SuccessfulIcon",
198
+ "SuccessfulIconMedium",
199
+ "SuccessfulIconSmall",
200
+ "VoidedIcon",
201
+ "XCircleIconMedium",
202
+ "XCircleIconSmall",
203
+ "ProfileIconSmall",
204
+ "SearchIcon",
205
+ "FindIconSmall",
206
+ "PencilIcon",
207
+ "AccountsIconSmall",
208
+ "TrashIcon",
209
+ "TrashIconV2",
210
+ "SettingsIconSmall",
211
+ "ShoppingCartIcon",
212
+ "PlusCircleIcon",
213
+ "IconAdd",
214
+ "ExternalLinkIcon",
215
+ "AutopayIcon",
216
+ "AutopayOnIcon",
217
+ "CloseIcon",
218
+ "IconQuitLarge",
219
+ "WarningIconXS",
220
+ "KebabMenuIcon",
221
+ "MultiCartIcon",
222
+ "EmptyCartIconV2",
223
+ "CheckmarkIcon"
224
+ ];
225
+
226
+ const arrowIcons = [
227
+ "AchReturnIcon",
228
+ "RejectedIcon",
229
+ "RejectedVelocityIcon",
230
+ "ArrowDownCircleIconSmall",
231
+ "ArrowLeftCircleIconMedium",
232
+ "ArrowLeftCircleIconSmall",
233
+ "ArrowRightCircleIconSmall",
234
+ "ArrowUpCircleIconSmall",
235
+ "ArrowRightIcon",
236
+ "ChevronIcon",
237
+ "CarrotIcon"
238
+ ];
239
+
240
+ const paymentIcons = [
241
+ "BankIcon",
242
+ "BankIconLarge",
243
+ "CashIcon",
244
+ "ChargebackIcon",
245
+ "ChargebackIconMedium",
246
+ "ChargebackIconSmall",
247
+ "ChargebackReversalIcon",
248
+ "ChargebackReversalIconMedium",
249
+ "ChargebackReversalIconSmall",
250
+ "CheckIcon",
251
+ "GenericCard",
252
+ "GenericCardLarge",
253
+ "PaymentMethodAddIcon",
254
+ "PaymentMethodIcon",
255
+ "PaymentsIconSmall",
256
+ "RefundIcon",
257
+ "RefundIconMedium",
258
+ "RefundIconSmall"
259
+ ];
260
+
261
+ const checkIcons = ["RoutingNumberImage", "AccountNumberImage"];
262
+
263
+ const accountIcons = [
264
+ "AccountsAddIcon",
265
+ "AccountsIcon",
266
+ "DisabledAccountsAddIcon",
267
+ "DisabledPaymentMethodsAddIcon",
268
+ "ForgotPasswordIcon",
269
+ "GoToEmailIcon",
270
+ "ResetPasswordIcon",
271
+ "VerifiedEmailIcon"
272
+ ];
273
+
274
+ const mascotIcons = [
275
+ "CustomerSearchIcon",
276
+ "EmptyCartIcon",
277
+ "GenericErrorIcon",
278
+ "NoCustomerResultsIcon",
279
+ "NoPaymentResultsIcon",
280
+ "NotFoundIcon",
281
+ "PaymentSearchIcon",
282
+ "PeriscopeFailedIcon",
283
+ "ProfileIcon",
284
+ "TimeoutImage",
285
+ "WalletIcon",
286
+ "GuidedCheckoutImage",
287
+ "KioskImage",
288
+ "PointOfSaleImage",
289
+ "RevenueManagementImage",
290
+ "ProfileImage",
291
+ "StandardCheckoutImage",
292
+ "WalletBannerIcon"
293
+ ];
294
+
295
+ export const GenericIcons = () => <IconList iconNames={genericIcons} />;
296
+
297
+ export const ArrowIcons = () => <IconList iconNames={arrowIcons} />;
298
+
299
+ export const PaymentIcons = () => <IconList iconNames={paymentIcons} />;
300
+
301
+ export const CheckIcons = () => <IconList iconNames={checkIcons} />;
302
+
303
+ export const AccountIcons = () => <IconList iconNames={accountIcons} />;
304
+
305
+ export const MascotIcons = () => <IconList iconNames={mascotIcons} />;
306
+
307
+ export const OtherIcons = {
308
+ render: () => {
309
+ const groupedIcons = [
310
+ ...checkIcons,
311
+ ...mascotIcons,
312
+ ...arrowIcons,
313
+ ...genericIcons,
314
+ ...accountIcons,
315
+ ...paymentIcons
316
+ ];
317
+ const otherIcons = Object.keys(icons).filter(
318
+ icon => !groupedIcons.includes(icon)
319
+ );
320
+
321
+ return <IconList iconNames={otherIcons} />;
322
+ }
323
+ };
324
+
325
+ export default meta;
@@ -0,0 +1,23 @@
1
+ import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
+
3
+ import * as LabeledAmountStories from './LabeledAmount.stories.js';
4
+
5
+ <Meta of={LabeledAmountStories} />
6
+
7
+ <Title />
8
+
9
+ The LabeledAmount component is a component that combines a text label with a formatted money string, for use in checkout experiences (payment details, receipts, etc). The wrapping container for the text elements is styled using flexbox, by default using the `space-between` value for the `justify-content` property. This can be changed by passing an override using the `extraStyles` prop like so:
10
+
11
+ ```
12
+ <LabeledAmount extraStyles={`justify-content: space-around`} />
13
+ ```
14
+
15
+ Currently, there are two versions of this component: LabeledAmountV1 and LabeledAmountV2. While both versions are in active use in the codebase, LabeledAmountV1 is deprecated and should not be used in new code. The difference between the two is that LabeledAmountV2 has been updated to decouple the component's rendered HTML element from its theme size variant. This allows for arbitrary HTML elements (any heading size, paragraph, span) to be used as the underlying element regardless of the component size specified in the design, preserving proper HTML semantics and accessibility.
16
+
17
+ LabeledAmountV2 takes the following props:
18
+
19
+ <Controls />
20
+
21
+ <div style={{ marginBottom: "2em"}}>
22
+ <Story />
23
+ </div>
@@ -1,42 +1,118 @@
1
- import React from "react";
2
- import { text, select } from "@storybook/addon-knobs";
3
1
  import LabeledAmount from "./LabeledAmount";
4
- import page from "../../../../.storybook/page";
2
+ import { Box } from "../layouts";
5
3
 
6
- const variantsLabel = "variant";
7
- const variants = {
8
- default: "default",
9
- p: "p",
10
- pL: "pL",
11
- h6: "h6",
12
- small: "small",
13
- regular: "regular",
14
- large: "large",
15
- None: undefined
4
+ const meta = {
5
+ title: "Atoms/LabeledAmount",
6
+ component: LabeledAmount,
7
+ parameters: {
8
+ layout: "centered"
9
+ },
10
+ tags: ["!autodocs"],
11
+ args: {
12
+ version: "v2",
13
+ variant: "regular",
14
+ label: "Subtotal:",
15
+ amount: "$102.55",
16
+ as: "h3",
17
+ extraStyles: undefined
18
+ },
19
+ argTypes: {
20
+ version: {
21
+ description:
22
+ "The verison (v1 or v2) of the LabeledAmount component to use",
23
+ table: {
24
+ type: { summary: "string" },
25
+ defaultValue: { summary: "v1" }
26
+ }
27
+ },
28
+ variant: {
29
+ description:
30
+ "The variant (regular, extraSmall, small, large) of the LabeledAmount component to use",
31
+ table: {
32
+ type: { summary: "string" },
33
+ defaultValue: { summary: "regular" }
34
+ }
35
+ },
36
+ label: {
37
+ description: "The label to place before the amount",
38
+ table: {
39
+ type: { summary: "string" },
40
+ defaultValue: { summary: undefined }
41
+ }
42
+ },
43
+ amount: {
44
+ description: "The formatted amount value to display, as a money string",
45
+ table: {
46
+ type: { summary: "string" },
47
+ defaultValue: { summary: undefined }
48
+ }
49
+ },
50
+ as: {
51
+ description:
52
+ "The HTML element to render the component as, generally h or p element",
53
+ table: {
54
+ type: { summary: "string" },
55
+ defaultValue: { summary: "p" }
56
+ }
57
+ },
58
+ extraStyles: {
59
+ description: "Extra styles used for wrapping container",
60
+ table: {
61
+ type: { summary: "string" },
62
+ defaultvalue: { summary: undefined }
63
+ }
64
+ }
65
+ }
16
66
  };
17
- const defaultValue = "default";
18
67
 
19
- const versionsLabel = "version";
20
- const versions = {
21
- v1: "v1",
22
- v2: "v2"
68
+ export default meta;
69
+
70
+ export const LabeledAmountDefault = {
71
+ render: args => (
72
+ <Box minWidth="300px" padding="0">
73
+ <LabeledAmount {...args} />
74
+ </Box>
75
+ )
23
76
  };
24
- const defaultVersion = "v1";
25
77
 
26
- const groupId = "props";
78
+ export const LabeledAmountHeading = {
79
+ render: args => (
80
+ <Box minWidth="450px" padding="0">
81
+ <LabeledAmount {...args} />
82
+ </Box>
83
+ ),
84
+ args: {
85
+ as: "h3",
86
+ label: "Total paid:",
87
+ amount: "$626.93",
88
+ variant: "large"
89
+ }
90
+ };
27
91
 
28
- export const labeledAmount = () => (
29
- <LabeledAmount
30
- variant={select(variantsLabel, variants, defaultValue, groupId)}
31
- as={text("as", "p", groupId)}
32
- label={text("label", "Amount", groupId)}
33
- amount={text("amount", "$1.23", groupId)}
34
- version={select(versionsLabel, versions, defaultVersion, groupId)}
35
- />
36
- );
92
+ export const ExtraSmallLabeledAmount = {
93
+ render: args => (
94
+ <Box minWidth="150px" padding="0">
95
+ <LabeledAmount {...args} />
96
+ </Box>
97
+ ),
98
+ args: {
99
+ as: "h6",
100
+ label: "Fees:",
101
+ amount: "$2.50",
102
+ variant: "extraSmall"
103
+ }
104
+ };
37
105
 
38
- const story = page({
39
- title: "Components|Atoms/LabeledAmount",
40
- Component: LabeledAmount
41
- });
42
- export default story;
106
+ export const SmallLabeledAmount = {
107
+ render: args => (
108
+ <Box minWidth="150px" padding="0">
109
+ <LabeledAmount {...args} />
110
+ </Box>
111
+ ),
112
+ args: {
113
+ as: "h4",
114
+ label: "Tax:",
115
+ amount: "$20.75",
116
+ variant: "small"
117
+ }
118
+ };
@@ -0,0 +1,28 @@
1
+ import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
+
3
+ import * as LineItemStories from './LineItem.stories.js';
4
+
5
+ <Meta of={LineItemStories} />
6
+
7
+ <Title />
8
+
9
+ The LineItem component is small component that formats the description, subDescription, amount, and optionally quantity of a line item. LineItems are typically used in checkout flows and as a part of transaction details.
10
+
11
+ The default styling of the LineItem uses flexbox. The description and subDescription are left-justified, while the formatted amount string is right-justified. An item's quantity, if displayed, sits evenly between the description and amount string. By default, elements of the LineItem have no gap between them. As shown below, the LineItem sizes itself to the width of its parent container, so gaps between items can be controlled by the size of the LineItem's parent.
12
+
13
+ LineItems are typically rendered inside of other display components, like a DisplayBox or Card, as seen in the Line Item With Quantity story.
14
+
15
+ The LineItem component can take the following props:
16
+
17
+ - description (required, main description of the lineItem),
18
+ - subDescription (optional, but should not be `null`),
19
+ - amount (required, pre-formatted money string),
20
+ - displayQuantity (optional, quantity of the item, if its display is desired)
21
+ - customAttributes (optional, array of item's custom attributes, used in conjunction with visibleFields)
22
+ - visibleFields (optional, an array that is a subset of customAttributes to display below the subDescription)
23
+
24
+ NOTE: The LineItem currently supports unused functionality that can display a subset of an item's custom attributes as "visible fields". If this functionality is used in the future, a new story should be added to demonstrate it.
25
+
26
+ <div style={{ marginBottom: "2em"}}>
27
+ <Story />
28
+ </div>
@@ -1,28 +1,95 @@
1
1
  import React from "react";
2
- import { text } from "@storybook/addon-knobs";
3
-
4
2
  import LineItem from "./LineItem";
5
- import page from "../../../../.storybook/page";
3
+ import DisplayBox from "../display-box/DisplayBox";
4
+ import { Box } from "../layouts";
6
5
 
7
- const story = page({
8
- title: "Components|Atoms/LineItem",
9
- Component: LineItem
10
- });
11
- export default story;
6
+ const meta = {
7
+ title: "Atoms/LineItem",
8
+ component: LineItem,
9
+ parameters: {
10
+ layout: "centered"
11
+ },
12
+ tags: ["!autodocs"],
13
+ args: {
14
+ description: "",
15
+ subDescription: "",
16
+ amount: "",
17
+ customAttributes: undefined,
18
+ visibleFields: [],
19
+ displayQuantity: null
20
+ },
21
+ argTypes: {
22
+ description: {
23
+ description: "The main description of the lineItem",
24
+ table: {
25
+ type: { summary: "string" },
26
+ defaultValue: { summary: undefined }
27
+ }
28
+ },
29
+ subDescription: {
30
+ description: "Secondary description of the lineItem",
31
+ table: {
32
+ type: { summary: "string" },
33
+ defaultValue: { summary: undefined }
34
+ }
35
+ },
36
+ amount: {
37
+ description: "The amount in a formatted string of the lineItem",
38
+ table: {
39
+ type: { summary: "string" },
40
+ defaultValue: { summary: undefined }
41
+ }
42
+ },
43
+ customAttributes: {
44
+ description:
45
+ "A lineItem's custom attributes, currently unused functionality",
46
+ table: {
47
+ type: { summary: "array" },
48
+ defaultValue: { summary: undefined }
49
+ }
50
+ },
51
+ visibleFields: {
52
+ description:
53
+ "An array of customAttributes to display below the subDescription, currently unused",
54
+ table: {
55
+ type: { summary: "array" },
56
+ defaultValue: { summary: [] }
57
+ }
58
+ },
59
+ displayQuantity: {
60
+ description:
61
+ "The quantity of the lineItem. Will only display if provided.",
62
+ table: {
63
+ type: { summary: "number" },
64
+ defaultValue: { summary: undefined }
65
+ }
66
+ }
67
+ }
68
+ };
12
69
 
13
- export const lineItem = () => (
14
- <LineItem
15
- description={text("description", "Foo", "props")}
16
- subDescription={text("subDescription", "Bar", "props")}
17
- amount={text("amount", "$4.00", "props")}
18
- />
19
- );
70
+ export default meta;
20
71
 
21
- export const lineItemWithQuantity = () => (
22
- <LineItem
23
- description={text("description", "Foo", "props")}
24
- subDescription={text("subDescription", "Bar", "props")}
25
- amount={text("amount", "$4.00", "props")}
26
- displayQuantity={2}
27
- />
72
+ export const BasicLineItem = {
73
+ args: {
74
+ description: "Dog Registration Permit",
75
+ subDescription: "Small dogs under 50lbs (valid until 2026)",
76
+ amount: "$75.00"
77
+ }
78
+ };
79
+
80
+ const FancyLineItem = props => (
81
+ <DisplayBox>
82
+ <Box minWidth="400px" padding="0">
83
+ <LineItem
84
+ description="Masked Ball Permits"
85
+ subDescription="One permit per 10 attendees"
86
+ amount="$625.00"
87
+ displayQuantity={25}
88
+ />
89
+ </Box>
90
+ </DisplayBox>
28
91
  );
92
+
93
+ export const LineItemWithQuantity = {
94
+ render: args => <FancyLineItem {...args} />
95
+ };
@@ -0,0 +1,19 @@
1
+ import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
+
3
+ import * as LinkStories from './Link.stories.js';
4
+
5
+ <Meta of={LinkStories} />
6
+
7
+ <Title />
8
+
9
+ The Link component comes in two varieties: InternalLink and ExternalLink. We have two components because most of our frontend applications rely on some version of react-router for internal routing. The InternalLink component is a wrapper that applies react-router-dom's `<Link />` component, while ExternalLink uses a plain `<a />` tag. Either link component can be used as a wrapper around arbitrary children.
10
+
11
+ Due to the components being written at different times, they have similar, but not identical, props. The props table identifies which props apply to InternalLinks and which apply to ExternalLinks.
12
+
13
+ Currently, the InternalLink has a minor bug where it will not apply a theme color for a non-active, non-hover state. At the moment, the only way to get InternalLinks to apply the correct color is to pass the theme color in to the component using the `color` prop.
14
+
15
+ <Controls />
16
+
17
+ <div style={{ marginBottom: "2em"}}>
18
+ <Story />
19
+ </div>