@thecb/components 10.12.3-beta.0 → 10.12.3

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 (211) hide show
  1. package/README.md +0 -4
  2. package/dist/index.cjs.js +2526 -1617
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.d.ts +4 -5
  5. package/dist/index.esm.js +2527 -1617
  6. package/dist/index.esm.js.map +1 -1
  7. package/package.json +13 -25
  8. package/src/components/atoms/alert/Alert.stories.js +26 -148
  9. package/src/components/atoms/badge/Badge.js +2 -2
  10. package/src/components/atoms/badge/Badge.stories.js +29 -143
  11. package/src/components/atoms/breadcrumb/Breadcrumb.stories.js +29 -38
  12. package/src/components/atoms/button-with-action/ButtonWithAction.stories.js +55 -108
  13. package/src/components/atoms/button-with-link/ButtonWithLink.stories.js +31 -160
  14. package/src/components/atoms/checkbox/Checkbox.stories.js +29 -148
  15. package/src/components/atoms/country-dropdown/CountryDropdown.stories.js +27 -61
  16. package/src/components/atoms/detail/Detail.js +26 -0
  17. package/src/components/atoms/display-box/DisplayBox.stories.js +21 -65
  18. package/src/components/atoms/display-card/DisplayCard.stories.js +22 -163
  19. package/src/components/atoms/dropdown/Dropdown.stories.js +10 -91
  20. package/src/components/atoms/form-layouts/FormInput.stories.js +26 -212
  21. package/src/components/atoms/form-select/FormSelect.stories.js +29 -55
  22. package/src/components/atoms/formatted-address/FormattedAddress.stories.js +27 -133
  23. package/src/components/atoms/icons/icons.stories.js +116 -0
  24. package/src/components/atoms/labeled-amount/LabeledAmount.stories.js +34 -110
  25. package/src/components/atoms/line-item/LineItem.stories.js +22 -89
  26. package/src/components/atoms/link/Link.stories.js +49 -155
  27. package/src/components/atoms/loading-line/LoadingLine.js +10 -14
  28. package/src/components/atoms/loading-line/LoadingLine.stories.js +28 -132
  29. package/src/components/atoms/nav-footer/NavFooter.stories.js +22 -235
  30. package/src/components/atoms/nav-header/NavHeader.stories.js +21 -122
  31. package/src/components/atoms/password-requirements/PasswordRequirements.stories.js +44 -108
  32. package/src/components/atoms/placeholder/Placeholder.stories.js +36 -164
  33. package/src/components/atoms/searchable-select/SearchableSelect.stories.js +28 -103
  34. package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.stories.js +40 -65
  35. package/src/components/atoms/table/Table.stories.js +75 -59
  36. package/src/components/atoms/table/TableRow.js +0 -1
  37. package/src/components/atoms/title/Title.js +23 -0
  38. package/src/components/atoms/toggle-switch/ToggleSwitch.stories.js +20 -103
  39. package/src/components/atoms/toggle-switch/ToggleSwitch.theme.js +5 -8
  40. package/src/components/molecules/address-form/AddressForm.stories.js +20 -223
  41. package/src/components/molecules/banner/Banner.stories.js +26 -122
  42. package/src/components/molecules/change-password-form/ChangePasswordForm.stories.js +19 -203
  43. package/src/components/molecules/collapsible-section/CollapsibleSection.stories.js +61 -210
  44. package/src/components/molecules/edit-name-form/EdidNameForm.stories.js +24 -0
  45. package/src/components/molecules/index.js +0 -1
  46. package/src/components/molecules/link-card/LinkCard.stories.js +72 -287
  47. package/src/components/molecules/login-form/LoginForm.stories.js +21 -117
  48. package/src/components/molecules/modal/Modal.stories.js +128 -342
  49. package/src/components/molecules/module/Module.stories.js +25 -267
  50. package/src/components/molecules/multiple-select-filter/MultipleSelectFilter.js +61 -295
  51. package/src/components/molecules/multiple-select-filter/{MultipleSelectFilter.oldstories.js → MultipleSelectFilter.stories.js} +1 -1
  52. package/src/components/molecules/multiple-select-filter/MultipleSelectFilter.styled.js +4 -4
  53. package/src/components/molecules/multiple-select-filter/__private__/ActionLinkButton.js +24 -0
  54. package/src/components/molecules/multiple-select-filter/__private__/FilterButton.js +85 -0
  55. package/src/components/molecules/multiple-select-filter/__private__/FilterDropdown.js +23 -0
  56. package/src/components/molecules/multiple-select-filter/__private__/FilterableList.js +144 -0
  57. package/src/components/molecules/multiple-select-filter/__private__/FilterableListItem.js +67 -0
  58. package/src/components/molecules/multiple-select-filter/__private__/SearchBox.js +38 -0
  59. package/src/components/molecules/multiple-select-filter/__private__/useKeyboardNavigation.js +84 -0
  60. package/src/components/molecules/multiple-select-filter/__private__/util.js +31 -0
  61. package/src/components/molecules/obligation/icons/PropertyPersonalIcon.js +1 -1
  62. package/src/components/molecules/pagination/Pagination.stories.js +28 -177
  63. package/src/components/molecules/tabs/Tabs.stories.js +227 -135
  64. package/src/components/molecules/toast-notification/ToastNotification.stories.js +105 -0
  65. package/src/hooks/use-outside-click/index.js +4 -5
  66. package/src/util/index.js +1 -3
  67. package/src/components/atoms/alert/Alert.mdx +0 -19
  68. package/src/components/atoms/badge/Badge.mdx +0 -27
  69. package/src/components/atoms/breadcrumb/Breadcrumb.mdx +0 -21
  70. package/src/components/atoms/button-with-link/ButtonWithLink.mdx +0 -21
  71. package/src/components/atoms/card/Card.mdx +0 -41
  72. package/src/components/atoms/card/Card.stories.js +0 -360
  73. package/src/components/atoms/checkbox/Checkbox.mdx +0 -15
  74. package/src/components/atoms/checkbox/Checkbox.oldstories.js +0 -30
  75. package/src/components/atoms/country-dropdown/CountryDropdown.mdx +0 -36
  76. package/src/components/atoms/detail/Detail.mdx +0 -32
  77. package/src/components/atoms/detail/Detail.stories.js +0 -156
  78. package/src/components/atoms/display-box/DisplayBox.mdx +0 -11
  79. package/src/components/atoms/display-card/DisplayCard.mdx +0 -13
  80. package/src/components/atoms/dropdown/Dropdown.mdx +0 -65
  81. package/src/components/atoms/form-layouts/FormInput.mdx +0 -38
  82. package/src/components/atoms/form-select/FormSelect.mdx +0 -42
  83. package/src/components/atoms/formatted-address/FormattedAddress.mdx +0 -13
  84. package/src/components/atoms/formatted-bank-account/FormattedBankAccount.mdx +0 -17
  85. package/src/components/atoms/formatted-bank-account/FormattedBankAccount.stories.js +0 -57
  86. package/src/components/atoms/formatted-credit-card/FormattedCreditCard.mdx +0 -40
  87. package/src/components/atoms/formatted-credit-card/FormattedCreditCard.stories.js +0 -74
  88. package/src/components/atoms/icons/Icons.mdx +0 -40
  89. package/src/components/atoms/icons/Icons.stories.js +0 -325
  90. package/src/components/atoms/labeled-amount/LabeledAmount.mdx +0 -23
  91. package/src/components/atoms/line-item/LineItem.mdx +0 -28
  92. package/src/components/atoms/link/Link.mdx +0 -19
  93. package/src/components/atoms/loading/Loading.mdx +0 -13
  94. package/src/components/atoms/loading/Loading.stories.js +0 -22
  95. package/src/components/atoms/loading-line/LoadingLine.mdx +0 -15
  96. package/src/components/atoms/nav-footer/NavFooter.mdx +0 -15
  97. package/src/components/atoms/nav-header/NavHeader.mdx +0 -13
  98. package/src/components/atoms/nav-tabs/NavTabs.mdx +0 -30
  99. package/src/components/atoms/nav-tabs/NavTabs.stories.js +0 -49
  100. package/src/components/atoms/password-requirements/PasswordRequirements.mdx +0 -39
  101. package/src/components/atoms/placeholder/Placeholder.mdx +0 -19
  102. package/src/components/atoms/searchable-select/SearchableSelect.mdx +0 -44
  103. package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.mdx +0 -36
  104. package/src/components/atoms/table/Table.mdx +0 -71
  105. package/src/components/atoms/table/Table.oldstories.js +0 -84
  106. package/src/components/atoms/title/Title.mdx +0 -26
  107. package/src/components/atoms/title/Title.stories.js +0 -144
  108. package/src/components/atoms/toggle-switch/ToggleSwitch.mdx +0 -17
  109. package/src/components/atoms/typeahead-input/TypeaheadInput.mdx +0 -13
  110. package/src/components/atoms/typeahead-input/TypeaheadInput.stories.js +0 -63
  111. package/src/components/molecules/address-form/AddressForm.mdx +0 -18
  112. package/src/components/molecules/banner/Banner.mdx +0 -23
  113. package/src/components/molecules/change-password-form/ChangePasswordForm.mdx +0 -15
  114. package/src/components/molecules/collapsible-section/CollapsibleSection.mdx +0 -15
  115. package/src/components/molecules/edit-name-form/EditNameForm.mdx +0 -13
  116. package/src/components/molecules/edit-name-form/EditNameForm.stories.js +0 -117
  117. package/src/components/molecules/idle-modal/IdleModal.js +0 -101
  118. package/src/components/molecules/idle-modal/IdleModal.mdx +0 -17
  119. package/src/components/molecules/idle-modal/IdleModal.stories.js +0 -180
  120. package/src/components/molecules/idle-modal/index.d.ts +0 -16
  121. package/src/components/molecules/idle-modal/index.js +0 -3
  122. package/src/components/molecules/link-card/LinkCard.mdx +0 -17
  123. package/src/components/molecules/login-form/LoginForm.mdx +0 -16
  124. package/src/components/molecules/modal/Modal.mdx +0 -17
  125. package/src/components/molecules/module/Module.mdx +0 -17
  126. package/src/components/molecules/obligation/Obligation.mdx +0 -23
  127. package/src/components/molecules/obligation/Obligation.stories.js +0 -460
  128. package/src/components/molecules/pagination/Pagination.mdx +0 -15
  129. package/src/components/molecules/popover/Popover.mdx +0 -15
  130. package/src/components/molecules/popover/Popover.stories.js +0 -220
  131. package/src/components/molecules/tabs/Tabs.mdx +0 -17
  132. package/src/components/molecules/toast-notification/Toast.mdx +0 -15
  133. package/src/components/molecules/toast-notification/Toast.stories.js +0 -183
  134. package/src/stories/Button.stories.ts +0 -53
  135. package/src/stories/Button.tsx +0 -48
  136. package/src/stories/Configure.mdx +0 -364
  137. package/src/stories/Header.stories.ts +0 -33
  138. package/src/stories/Header.tsx +0 -56
  139. package/src/stories/Page.stories.ts +0 -32
  140. package/src/stories/Page.tsx +0 -73
  141. package/src/stories/assets/accessibility.png +0 -0
  142. package/src/stories/assets/accessibility.svg +0 -5
  143. package/src/stories/assets/addon-library.png +0 -0
  144. package/src/stories/assets/assets.png +0 -0
  145. package/src/stories/assets/avif-test-image.avif +0 -0
  146. package/src/stories/assets/context.png +0 -0
  147. package/src/stories/assets/discord.svg +0 -15
  148. package/src/stories/assets/docs.png +0 -0
  149. package/src/stories/assets/figma-plugin.png +0 -0
  150. package/src/stories/assets/github.svg +0 -3
  151. package/src/stories/assets/share.png +0 -0
  152. package/src/stories/assets/styling.png +0 -0
  153. package/src/stories/assets/testing.png +0 -0
  154. package/src/stories/assets/theming.png +0 -0
  155. package/src/stories/assets/tutorials.svg +0 -12
  156. package/src/stories/assets/youtube.svg +0 -4
  157. package/src/stories/button.css +0 -30
  158. package/src/stories/header.css +0 -32
  159. package/src/stories/page.css +0 -69
  160. package/src/util/idleTimerUtils.js +0 -36
  161. /package/src/components/atoms/add-obligation/{AddObligation.oldstories.js → AddObligation.stories.js} +0 -0
  162. /package/src/components/atoms/amount-callout/{AmountCallout.oldstories.js → AmountCallout.stories.js} +0 -0
  163. /package/src/components/atoms/checkbox-list/{CheckboxList.oldstories.js → CheckboxList.stories.js} +0 -0
  164. /package/src/components/atoms/form-layouts/{FormLayouts.oldstories.js → FormLayouts.stories.js} +0 -0
  165. /package/src/components/atoms/hamburger-button/{HamburgerButton.oldstories.js → HamburgerButton.stories.js} +0 -0
  166. /package/src/components/atoms/heading/{Heading.oldstories.js → Heading.stories.js} +0 -0
  167. /package/src/components/atoms/layouts/examples/box-example/{BoxExample.oldstories.js → BoxExample.stories.js} +0 -0
  168. /package/src/components/atoms/layouts/examples/center-example/{CenterExample.oldstories.js → CenterExample.stories.js} +0 -0
  169. /package/src/components/atoms/layouts/examples/cluster-example/{ClusterExample.oldstories.js → ClusterExample.stories.js} +0 -0
  170. /package/src/components/atoms/layouts/examples/cover-example/{CoverExample.oldstories.js → CoverExample.stories.js} +0 -0
  171. /package/src/components/atoms/layouts/examples/frame-example/{FrameExample.oldstories.js → FrameExample.stories.js} +0 -0
  172. /package/src/components/atoms/layouts/examples/grid-example/{GridExample.oldstories.js → GridExample.stories.js} +0 -0
  173. /package/src/components/atoms/layouts/examples/imposter-example/{ImposterExample.oldstories.js → ImposterExample.stories.js} +0 -0
  174. /package/src/components/atoms/layouts/examples/motion-example/{MotionExample.oldstories.js → MotionExample.stories.js} +0 -0
  175. /package/src/components/atoms/layouts/examples/reel-example/{ReelExample.oldstories.js → ReelExample.stories.js} +0 -0
  176. /package/src/components/atoms/layouts/examples/sidebar-example/{SidebarExample.oldstories.js → SidebarExample.stories.js} +0 -0
  177. /package/src/components/atoms/layouts/examples/stack-example/{StackExample.oldstories.js → StackExample.stories.js} +0 -0
  178. /package/src/components/atoms/layouts/examples/switcher-example/{SwitcherExample.oldstories.js → SwitcherExample.stories.js} +0 -0
  179. /package/src/components/atoms/paragraph/{Paragraph.oldstories.js → Paragraph.stories.js} +0 -0
  180. /package/src/components/atoms/processing-fee/{ProcessingFee.oldstories.js → ProcessingFee.stories.js} +0 -0
  181. /package/src/components/atoms/search/{Search.oldstories.js → Search.stories.js} +0 -0
  182. /package/src/components/atoms/solid-divider/{SolidDivider.oldstories.js → SolidDivider.stories.js} +0 -0
  183. /package/src/components/atoms/sortable-table-heading/{SortableTableHeading.oldstories.js → SortableTableHeading.stories.js} +0 -0
  184. /package/src/components/atoms/spinner/{Spinner.oldstories.js → Spinner.stories.js} +0 -0
  185. /package/src/components/atoms/tab/{Tab.oldstories.js → Tab.stories.js} +0 -0
  186. /package/src/components/atoms/text/{Text.oldstories.js → Text.stories.js} +0 -0
  187. /package/src/components/atoms/typeahead-input/{TypeaheadIinput.oldstories.js → TypeaheadIinput.stories.js} +0 -0
  188. /package/src/components/atoms/wallet-name/{WalletName.oldstories.js → WalletName.stories.js} +0 -0
  189. /package/src/components/molecules/account-and-routing-modal/{AccountAndRoutingModal.oldstories.js → AccountAndRoutingModal.stories.js} +0 -0
  190. /package/src/components/molecules/editable-list/{EditableList.oldstories.js → EditableList.stories.js} +0 -0
  191. /package/src/components/molecules/email-form/{EmailForm.oldstories.js → EmailForm.stories.js} +0 -0
  192. /package/src/components/molecules/forgot-password-form/{ForgotPasswordForm.oldstories.js → ForgotPasswordForm.stories.js} +0 -0
  193. /package/src/components/molecules/highlight-tab-row/{HighlightTabRow.oldstories.js → HighlightTabRow.stories.js} +0 -0
  194. /package/src/components/molecules/obligation/modules/{AmountModule.oldstories.js → AmountModule.stories.js} +0 -0
  195. /package/src/components/molecules/payment-button-bar/{PaymentButtonBar.oldstories.js → PaymentButtonBar.stories.js} +0 -0
  196. /package/src/components/molecules/payment-details/{PaymentDetails.oldstories.js → PaymentDetails.stories.js} +0 -0
  197. /package/src/components/molecules/payment-form-ach/{PaymentFormACH.oldstories.js → PaymentFormACH.stories.js} +0 -0
  198. /package/src/components/molecules/payment-form-card/{PaymentFormCard.oldstories.js → PaymentFormCard.stories.js} +0 -0
  199. /package/src/components/molecules/periscope-dashboard-iframe/{PeriscopeDashBoardIframe.oldstories.js → PeriscopeDashBoardIframe.stories.js} +0 -0
  200. /package/src/components/molecules/phone-form/{PhoneForm.oldstories.js → PhoneForm.stories.js} +0 -0
  201. /package/src/components/molecules/popup-menu/{PopupMenu.oldstories.js → PopupMenu.stories.js} +0 -0
  202. /package/src/components/molecules/radio-group/{RadioGroup.oldstories.js → RadioGroup.stories.js} +0 -0
  203. /package/src/components/molecules/radio-section/{RadioSection.oldstories.js → RadioSection.stories.js} +0 -0
  204. /package/src/components/molecules/registration-form/{RegistrationForm.oldstories.js → RegistrationForm.stories.js} +0 -0
  205. /package/src/components/molecules/reset-confirmation-form/{ResetConfirmationForm.oldstories.js → ResetConfirmationForm.stories.js} +0 -0
  206. /package/src/components/molecules/reset-password-form/{ResetPasswordForm.oldstories.js → ResetPasswordForm.stories.js} +0 -0
  207. /package/src/components/molecules/reset-password-success/{ResetPasswordSuccess.oldstories.js → ResetPasswordSuccess.stories.js} +0 -0
  208. /package/src/components/molecules/tab-sidebar/{TabSidebar.oldstories.js → TabSidebar.stories.js} +0 -0
  209. /package/src/components/molecules/terms-and-conditions/{TermsAndConditions.oldstories.js → TermsAndConditions.stories.js} +0 -0
  210. /package/src/components/molecules/terms-and-conditions-modal/{TermsAndConditionsModal.oldstories.js → TermsAndConditionsModal.stories.js} +0 -0
  211. /package/src/components/molecules/workflow-tile/{WorkflowTile.oldstories.js → WorkflowTile.stories.js} +0 -0
@@ -1,65 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as DropdownStories from './Dropdown.stories.js';
4
-
5
- <Meta of={DropdownStories} />
6
-
7
- <Title />
8
-
9
- The Dropdown component is a fully accesible (keyboard & screenreader) replacement for standard `<select/>` elements, which provides addtional features such as:
10
-
11
- - More styling options than a `<select />`
12
- - Theming
13
- - Error message display
14
- - Width & height settings
15
- - Disabled options (via the `disabledValues` prop)
16
- - Animated scrolling to the selected option when open
17
- - Type ahead
18
-
19
- Under the hood the Dropdown uses an `<input />` element to allow users to filter the available options via keyboard (TypeAhead).
20
-
21
- <div style={{ marginBottom: "2em"}}>
22
- <Story />
23
- </div>
24
-
25
- ## Controlling a Dropdown
26
-
27
- The Dropdown component does not handle opening and closing it's own options menu, nor does it track the selected value. Both of these things are left to the app implementing the component.
28
-
29
- ### Disabled State
30
-
31
- While the `<Dropdown />` component takes a `disabled` prop, it should be noted that this prop only effects the styles of the component.
32
-
33
- The code below shows how a Dropdown can be controlled via hooks to manage the open state, value, and to not allow the menu to be opened when the component should be disabled.
34
-
35
- <Story of={DropdownStories.Disabled} />
36
-
37
- ```
38
- const DropdownWithHooks = ({ disabled = false }) => {
39
- const [isOpen, setOpen] = useState(false);
40
- const [value, setValue] = useState(null);
41
- const [isError, setError] = useState(false);
42
-
43
- useEffect(() => {
44
- if (value === options[0].value) {
45
- setError(true);
46
- } else {
47
- setError(false);
48
- }
49
- }, [value]);
50
-
51
- return (
52
- <Dropdown
53
- placeholder={options[0].text}
54
- options={options}
55
- disabledValues={disabledValues}
56
- value={value}
57
- isOpen={isOpen}
58
- isError={isError}
59
- onSelect={setValue}
60
- onClick={() => !disabled && setOpen(!isOpen)}
61
- disabled={disabled}
62
- />
63
- );
64
- };
65
- ```
@@ -1,38 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as FormInputStories from './FormInput.stories.js';
4
-
5
- <Meta of={FormInputStories} />
6
-
7
- <Title />
8
-
9
- FormInput is a wrapper for `<input/>` elements that adds extra functionality. It is meant to be used in forms. The underlying component is an `input` element, unless the formatter prop is set, then it will be a [formatted-input](https://www.npmjs.com/package/formatted-input) component. Additional props are passed down to the underlying element.
10
-
11
- ## Form Integration
12
-
13
- FormInput requires a `field` and `fieldActions` prop. Both are objects that _can_ be generated with [redux-freeform](https://github.com/CityBaseInc/redux-freeform). Below are example values for each prop with the minimum properties needed for a FormInput component.
14
-
15
- ### field
16
-
17
- ```
18
- {
19
- "dirty": false,
20
- "rawValue": "",
21
- "errors": [
22
- "error/REQUIRED"
23
- ],
24
- "hasErrors": true
25
- }
26
- ```
27
-
28
- ### fieldActions
29
-
30
- ```
31
- {
32
- set: (value) => {...}
33
- }
34
- ```
35
-
36
- `fieldActions.set()` is called when an option is selected in the underlying Dropdown component, unless a function is defined for the `onChange` prop.
37
-
38
- <Controls />
@@ -1,42 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as FormSelectStories from './FormSelect.stories.js';
4
-
5
- <Meta of={FormSelectStories} />
6
-
7
- <Title />
8
-
9
- FormSelect is a wrapper for the [Dropdown component](?path=/docs/atoms-dropdown--docs) meant to be used in forms.
10
-
11
- It controls the open state of the menu (including closing on mouse clicks outside of the component). It also renders an accesible label and error messages.
12
-
13
- FormSelect can be used with [redux-freeform](https://github.com/CityBaseInc/redux-freeform) to connect the form to Redux state.
14
-
15
- <Story />
16
-
17
- ## Form Integration
18
-
19
- FormSelect requires a `field` and `fieldActions` prop. Both are objects that _can_ be generated with [redux-freeform](https://github.com/CityBaseInc/redux-freeform). Below are example values for each prop with the minimum properties needed for a FormSelect component.
20
-
21
- ### field
22
-
23
- ```
24
- {
25
- "dirty": false,
26
- "rawValue": "",
27
- "errors": [
28
- "error/REQUIRED"
29
- ],
30
- "hasErrors": true
31
- }
32
- ```
33
-
34
- ### fieldActions
35
-
36
- ```
37
- {
38
- set: (value) => {...}
39
- }
40
- ```
41
-
42
- `fieldActions.set()` is called when an option is selected in the underlying Dropdown component, unless a function is defined for the `onChange` prop.
@@ -1,13 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as FormattedAddressStories from './FormattedAddress.stories.js';
4
-
5
- <Meta of={FormattedAddressStories} />
6
-
7
- <Title />
8
-
9
- FormattedAddress is a composition of Box and Text components to help create consistent formatting of addresses. The outer padding and text color are themeable.
10
-
11
- <Story />
12
-
13
- <Controls />
@@ -1,17 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as FormattedBankAccountStories from './FormattedBankAccount.stories.js';
4
-
5
- <Meta of={FormattedBankAccountStories} />
6
-
7
- <Title />
8
-
9
- The FormattedBankAccount is a simple component that takes bank account information and presents it in a standard way that can be reused throughout applications. The component requires:
10
-
11
- - lastFour (last four of the account number),
12
- - accountType (one of CHECKING or SAVINGS),
13
- - autoPay (boolean, whether an autopay is associated with the account)
14
-
15
- <div style={{ marginBottom: "2em"}}>
16
- <Story />
17
- </div>
@@ -1,57 +0,0 @@
1
- import FormattedBankAccount from "./FormattedBankAccount";
2
-
3
- const meta = {
4
- title: "Atoms/FormattedBankAccount",
5
- component: FormattedBankAccount,
6
- parameters: {
7
- layout: "centered"
8
- },
9
- tags: ["!autodocs"],
10
- args: {
11
- lastFour: "9456",
12
- accountType: "CHECKING",
13
- autoPay: false
14
- },
15
- argTypes: {
16
- lastFour: {
17
- description: "The last four digits of the bank account number",
18
- table: {
19
- type: { summary: "string" },
20
- defaultValue: { summary: undefined }
21
- }
22
- },
23
- accountType: {
24
- description: "The type of bank account - either CHECKING or SAVINGS",
25
- table: {
26
- type: { summary: "string" },
27
- defaultValue: { summary: undefined }
28
- }
29
- },
30
- autoPay: {
31
- description: "Whether the bank account is being used for autopay",
32
- table: {
33
- type: { summary: "boolean" },
34
- defaultValue: { summary: undefined }
35
- }
36
- }
37
- }
38
- };
39
-
40
- export default meta;
41
-
42
- export const FormattedCheckingAccount = {};
43
-
44
- export const FormattedSavingsAccount = {
45
- args: {
46
- lastFour: "5139",
47
- accountType: "SAVINGS"
48
- }
49
- };
50
-
51
- export const AccountWithAutopay = {
52
- args: {
53
- lastFour: "7291",
54
- accountType: "CHECKING",
55
- autoPay: true
56
- }
57
- };
@@ -1,40 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as FormattedCreditCardStories from './FormattedCreditCard.stories.js';
4
-
5
- <Meta of={FormattedCreditCardStories} />
6
-
7
- <Title />
8
-
9
- The FormattedCreditCard is a simple component that takes credit card information and presents it in a standard way that can be reused throughout applications. The component requires:
10
-
11
- - lastFour (last four of the account number),
12
- - autoPay (boolean, whether an autopay is associated with the account)
13
- - expirationStatus (one of ACTIVE, EXPIRING_SOON, EXPIRED)
14
- - expireDate (date of card expiration in MM/YY)
15
-
16
- The expirationStatus of a card is typically managed by the application consuming this component. That status can either be received from an API call, or generated using logic in a utility function. Navigate uses the following utility function to attach a status to credit cards:
17
-
18
- ```
19
- export const getCardExpirationStatus = card => {
20
- const ACTIVE = "ACTIVE";
21
- const EXPIRING_SOON = "EXPIRING_SOON";
22
- const EXPIRED = "EXPIRED";
23
-
24
- const { expiryMonth, expiryYear } = card;
25
- const today = dayjs();
26
- const expiration = dayjs(`20${expiryYear}-${expiryMonth}`);
27
- const cardExpirationStatus = expiration.diff(today, "months");
28
-
29
- return cardExpirationStatus >= 1
30
- ? ACTIVE
31
- : cardExpirationStatus === 0
32
- ? EXPIRING_SOON
33
- : EXPIRED;
34
- };
35
- ```
36
- The text for a card's expiration status and date is generated by the `renderCardStatus` function in the formats.js file of this library.
37
-
38
- <div style={{ marginBottom: "2em"}}>
39
- <Story />
40
- </div>
@@ -1,74 +0,0 @@
1
- import FormattedCreditCard from "./FormattedCreditCard";
2
-
3
- const meta = {
4
- title: "Atoms/FormattedCreditCard",
5
- component: FormattedCreditCard,
6
- parameters: {
7
- layout: "centered"
8
- },
9
- tags: ["!autodocs"],
10
- args: {
11
- lastFour: "1003",
12
- autoPay: false,
13
- expirationDate: undefined,
14
- expirationStatus: undefined
15
- },
16
- argTypes: {
17
- lastFour: {
18
- description: "The last four digits of the credit card number",
19
- table: {
20
- type: { summary: "string" },
21
- defaultValue: { summary: undefined }
22
- }
23
- },
24
- autoPay: {
25
- description: "Whether the bank account is being used for autopay",
26
- table: {
27
- type: { summary: "boolean" },
28
- defaultValue: { summary: undefined }
29
- }
30
- },
31
- expirationDate: {
32
- description: "The expiration date of the credit card",
33
- table: {
34
- type: { summary: "string" },
35
- defaultValue: { summary: undefined }
36
- }
37
- },
38
- expirationStatus: {
39
- description:
40
- "Whether a card will expire soon, one of ACTIVE, EXPIRING_SOON, or EXPIRED",
41
- table: {
42
- type: { summary: "string" },
43
- defaultValue: { summary: undefined }
44
- }
45
- }
46
- }
47
- };
48
-
49
- export default meta;
50
-
51
- export const ActiveCreditCard = {
52
- args: {
53
- autoPay: true,
54
- expireDate: "10/29",
55
- expirationStatus: "ACTIVE"
56
- }
57
- };
58
-
59
- export const ExpiringSoonCreditCard = {
60
- args: {
61
- lastFour: "2613",
62
- expireDate: "12/24",
63
- expirationStatus: "EXPIRING_SOON",
64
- autoPay: true
65
- }
66
- };
67
-
68
- export const ExpiredCreditCard = {
69
- args: {
70
- lastFour: "8054",
71
- expireDate: "01/24",
72
- expirationStatus: "EXPIRED"
73
- }
74
- };
@@ -1,40 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as IconsStories from './Icons.stories.js';
4
-
5
- <Meta of={IconsStories} />
6
-
7
- <Title />
8
-
9
- The icons folder contains a variety of components which render SVGs, ranging from simple icons to large graphics.
10
-
11
- ## Theming
12
-
13
- Some of the icon components are themeable through the `themeValues` object prop. The properties used from the `themeValues` vary between components.
14
-
15
- ### Variants
16
-
17
- Some icons support variants from themes, including `info`, `success`, and `error`.
18
-
19
- ## Props
20
-
21
- Many icon components make use of additional props:
22
-
23
- <Controls />
24
-
25
- ## Additional Props
26
-
27
- The following components will pass along _all_ other props to their wrapping elements via the spread operator: `EmptyCartIconV2`, `CloseIcon`, `MultiCartIcon`.
28
-
29
- ## IconAdd Styling
30
-
31
- `IconAdd` needs color values set in CSS in order to display:
32
-
33
- ```
34
- .fill { fill: #000 }
35
- .stroke { stroke: #000 }
36
- ```
37
-
38
- ## ExternalLinkIcon
39
-
40
- `ExternalLinkIcon` must be passed a value for `linkColor` in order to be visible.