@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,36 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as StateProvinceDropdownStories from './StateProvinceDropdown.stories.js';
4
-
5
- <Meta of={StateProvinceDropdownStories} />
6
-
7
- <Title />
8
-
9
- StateProvinceDropdown is a wrapper for [FormSelect](?path=/docs/atoms-formselect--docs) that adds a pre-defined array of states or provinces for options. The state/provinces loaded are determined by the `countryCode` prop. These options cannot be modified. A "placeholder" option is added to the top of the list with a value of "". The display name of the placeholder is determined by the country code.
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 CountryDropdown 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.
@@ -1,71 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as TableStories from './Table.stories.js';
4
-
5
- <Meta of={TableStories} />
6
-
7
- <Title />
8
-
9
- The Table component is styled `<table />` element that can be paired with other related table compoments to compose consistent and themeable tables. These components can be mixed with raw HTML.
10
-
11
- ## Components
12
-
13
- - [Table](#table)
14
- - [TableBody](#tablebody)
15
- - [TableCell](#tablecell)
16
- - [TableHead](#tablehead)
17
- - [TableHeading](#tableheading)
18
- - [TableRow](#tablerow)
19
-
20
- ## Table
21
- `<table />` element with a small set of default styles.
22
-
23
- ### Props
24
- - `extraStyles`
25
-
26
- ## TableBody
27
- `<tbody />` element.
28
-
29
- ### Props
30
- - `extraStyles`
31
-
32
- ## TableCell
33
- `<td />` element with a small set of default styles. Last child will default to `text-align: right`.
34
-
35
- ### Props
36
- - `extraStyles`
37
- - `padding`, default value `24px`
38
- - `fontSize`, default value `0.875rem`
39
- - `maxWidth`, default value `250px`
40
-
41
- ## TableHead
42
- `<thead />` element. Automatically wraps children `TableRow` component.
43
-
44
- ### Props
45
- - `children`
46
- - `themeValues.backgroundColor`
47
- - `themeValues.borderColor`
48
- - `extraStyles`, passed to the `<TableRow />`
49
-
50
- ## TableHeading
51
- `<th />` element with a small set of default styles. Last child will default to `text-align: right`.
52
-
53
- ### Props
54
- - `extraStyles`
55
- - `padding`, default value `24px`
56
- - `minWidth`, default value `initial`
57
-
58
- ## TableRow
59
- `<tr />` element.
60
-
61
- ### Props
62
- - `extraStyles`
63
- - `children`
64
- - `onClick`, function handler for `onClick` on the `<tr />` element
65
- - `borderColor`, color of the bottom border of the row if it is not the last row
66
- - `hoverEffect`, set to `true` to add CSS `:hover` styles to the row
67
- - `hoverCursor`, adds `cursor: pointer` if `hoverEffect` is true
68
- - `hoverBackgroundColor`, sets background color on `:hover`
69
- - all other props passed to the `<tr />` element
70
-
71
- <Story />
@@ -1,84 +0,0 @@
1
- /*
2
- Changes were made to the Table stories while the TOOl-597 feature branch was pending, this file has been kept to memorialize those changes so that the v8 story can be updated to match
3
- */
4
- import React, { useState } from "react";
5
- import { Table, TableHead, TableBody, TableRow, TableCell } from "./";
6
- import page from "../../../../.storybook/page";
7
- import SortableTableHeading from "../sortable-table-heading";
8
-
9
- const data = [
10
- { name: "Alice", occupation: "Engineer", location: "New York" },
11
- { name: "Bob", occupation: "Designer", location: "Los Angeles" },
12
- { name: "Charlie", occupation: "Doctor", location: "Chicago" }
13
- ];
14
-
15
- const headings = [
16
- { displayName: "Name", sortKey: "name" },
17
- { displayName: "Occupation", sortKey: "occupation" },
18
- { displayName: "Location", sortKey: "location" }
19
- ];
20
-
21
- const ComposedSortableTable = () => {
22
- const [sortState, setSortState] = useState({
23
- column: "name",
24
- order: "asc"
25
- });
26
- const [sortedData, setSortedData] = useState(data);
27
- const handleSortChange = column => {
28
- // Determine the new sort order for SortableTableHeading components
29
- const newOrder =
30
- sortState.column === column && sortState.order === "asc" ? "desc" : "asc";
31
-
32
- setSortState({
33
- column,
34
- order: newOrder
35
- });
36
-
37
- // Perform sort and update sortedData state
38
- const sorted = [...data].sort((a, b) => {
39
- const valueA = a[column];
40
- const valueB = b[column];
41
- if (newOrder === "asc") {
42
- return valueA > valueB ? 1 : -1;
43
- } else {
44
- return valueA < valueB ? 1 : -1;
45
- }
46
- });
47
-
48
- setSortedData(sorted);
49
- };
50
- return (
51
- <Table id="users-table">
52
- <TableHead>
53
- {headings.map(heading => (
54
- <SortableTableHeading
55
- ariaControlsId="users-table"
56
- displayName={heading.displayName}
57
- key={heading.sortKey}
58
- onSortChange={() => handleSortChange(heading.sortKey)}
59
- sortOrder={
60
- sortState.column === heading.sortKey ? sortState.order : null
61
- }
62
- />
63
- ))}
64
- </TableHead>
65
- <TableBody>
66
- {sortedData.map((item, idx) => (
67
- <TableRow key={idx}>
68
- <TableCell>{item.name}</TableCell>
69
- <TableCell>{item.occupation}</TableCell>
70
- <TableCell>{item.location}</TableCell>
71
- </TableRow>
72
- ))}
73
- </TableBody>
74
- </Table>
75
- );
76
- };
77
-
78
- export const table = () => <ComposedSortableTable />;
79
- const story = page({
80
- title: "Components|Atoms/Table",
81
- Component: Table
82
- });
83
-
84
- export default story;
@@ -1,26 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as TitleStories from './Title.stories.js';
4
-
5
- <Meta of={TitleStories} />
6
-
7
- <Title />
8
-
9
- Title is a responsive text component for heading elements where the font size is decoupled from tag. It comes with two variants - "large" and "small":
10
-
11
- - Large variant results in text that is `1.5rem` (`24px` desktop, `21px` mobile)
12
- - Small variant results in text that is `1.25rem/1.2142rem` (`20px` desktop, `17px` mobile)
13
-
14
- If you need a smaller text size, use the `<Detail />` atom, which has smaller variants.
15
-
16
- Use the "as" prop to specify element type, can use any of: `h1/h2/h3/h4/h5/h6/p`. If you need an inline text element (span), use the `<Text />` atom. The "as" value should be dictated by the structure of your page, not what font-size you want.
17
-
18
- Title / Detail both use slightly different desktop/mobile scales (Mobile scale is different to allow for design-friendly px values). Both atoms detect the presence of a mobile device on their own and apply the corresponding scale.
19
-
20
- Mobile breakpoint value is specified in `Title.theme.js`.
21
-
22
- If you want to disable mobile text scales (use the same rem scale for desktop/mobile), then use a theme in FCS to set both the "large" and "small" variants to use the same rem sizes. FCS themes override fallbacks defined in the .theme file.
23
-
24
- <Story />
25
-
26
- <Controls />
@@ -1,144 +0,0 @@
1
- import Title from "./Title";
2
- import { FONT_WEIGHT_REGULAR } from "../../../constants/style_constants";
3
- import { FIREFLY_GREY } from "../../../constants/colors";
4
- import { Box } from "../layouts";
5
-
6
- const meta = {
7
- title: "Atoms/Title",
8
- component: Title,
9
- parameters: {
10
- layout: "centered",
11
- controls: { expanded: true }
12
- },
13
- tags: ["!autodocs"],
14
- args: {
15
- weight: FONT_WEIGHT_REGULAR,
16
- color: FIREFLY_GREY,
17
- margin: 0,
18
- textAlign: undefined,
19
- extraStyles: "",
20
- className: undefined,
21
- variant: "large",
22
- as: "h1",
23
- dataQa: undefined,
24
- children: "Title Component!"
25
- },
26
- argTypes: {
27
- weight: {
28
- control: { type: "text" },
29
- table: {
30
- type: { summary: "string" },
31
- defaultValue: { summary: FONT_WEIGHT_REGULAR }
32
- }
33
- },
34
- color: {
35
- control: { type: "text" },
36
- table: {
37
- type: { summary: "string" },
38
- defaultValue: { summary: FIREFLY_GREY }
39
- }
40
- },
41
- margin: {
42
- control: { type: "text" },
43
- table: {
44
- type: { summary: "number | string" },
45
- defaultValue: { summary: 0 }
46
- }
47
- },
48
- textAlign: {
49
- control: { type: "text" },
50
- table: {
51
- type: { summary: "string" },
52
- defaultValue: { summary: undefined }
53
- }
54
- },
55
- extraStyles: {
56
- control: { type: "text" },
57
- table: {
58
- type: { summary: "string" },
59
- defaultValue: { summary: undefined }
60
- }
61
- },
62
- className: {
63
- control: { type: "text" },
64
- table: {
65
- type: { summary: "string" },
66
- defaultValue: { summary: undefined }
67
- }
68
- },
69
- variant: {
70
- description: "`large` `small`",
71
- control: { type: "text" },
72
- table: {
73
- type: { summary: "string" },
74
- defaultValue: { summary: "large" }
75
- }
76
- },
77
- as: {
78
- description: "`h1` `h2` `h3` `h4` `h5` `h6` `p`",
79
- control: { type: "text" },
80
- table: {
81
- type: { summary: "string" },
82
- defaultValue: { summary: "h1" }
83
- }
84
- },
85
- dataQa: {
86
- control: { type: "text" },
87
- table: {
88
- type: { summary: "string" },
89
- defaultValue: { summary: undefined }
90
- }
91
- },
92
- children: {
93
- control: { type: "text" },
94
- table: {
95
- type: { summary: "string | element | array" },
96
- defaultValue: { summary: undefined }
97
- }
98
- }
99
- }
100
- };
101
-
102
- export default meta;
103
-
104
- export const Basic = {};
105
-
106
- export const CustomWeight = {
107
- args: {
108
- weight: "700"
109
- }
110
- };
111
-
112
- export const CustomColor = {
113
- args: {
114
- color: "green"
115
- }
116
- };
117
-
118
- export const CustomMargin = {
119
- args: {
120
- margin: "2rem"
121
- },
122
- render: args => (
123
- <Box border={`1px dotted ${FIREFLY_GREY}`} padding="0">
124
- <Title {...args} />
125
- </Box>
126
- )
127
- };
128
-
129
- export const TextAlign = {
130
- args: {
131
- textAlign: "right"
132
- },
133
- render: args => (
134
- <Box border={`1px dotted ${FIREFLY_GREY}`} padding="0" minWidth="400px">
135
- <Title {...args} />
136
- </Box>
137
- )
138
- };
139
-
140
- export const SmallVariant = {
141
- args: {
142
- variant: "small"
143
- }
144
- };
@@ -1,17 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as ToggleSwitchStories from './ToggleSwitch.stories.js';
4
-
5
- <Meta of={ToggleSwitchStories} />
6
-
7
- <Title />
8
-
9
- The ToggleSwitch is a small button with an on/off state. Use the ToggleSwitch for interactions with binary values, like whether a user's payment method is used as the default, or whether a particular account has automatic payments enabled.
10
-
11
- The ToggleSwitch is a dumb component and requires its parent component to provide both its curent state as well as the action that occurs when a user interacts with the switch. The Basic Toggle Switch story demonstrates manually providing the `isOn` value via the story controls, while the other stories feature use of the `useState` hook to setup basic state control.
12
-
13
- <Controls />
14
-
15
- <div style={{ marginBottom: "2em"}}>
16
- <Story />
17
- </div>
@@ -1,13 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as TypeaheadInputStories from './TypeaheadInput.stories.js';
4
-
5
- <Meta of={TypeaheadInputStories} />
6
-
7
- <Title />
8
-
9
- TypeaheadInput is a wrapper for an uncontrolled input element that includes a visually hidden label and search icon.
10
-
11
- <Story />
12
-
13
- <Controls />
@@ -1,63 +0,0 @@
1
- import TypeaheadInput from "./TypeaheadInput";
2
- import { fn } from "@storybook/test";
3
-
4
- const meta = {
5
- title: "Atoms/TypeaheadInput",
6
- component: TypeaheadInput,
7
- parameters: {
8
- layout: "centered",
9
- controls: { expanded: true }
10
- },
11
- tags: ["!autodocs"],
12
- args: {
13
- handleChange: undefined,
14
- placeholder: undefined,
15
- id: undefined,
16
- labelText: undefined
17
- },
18
- argTypes: {
19
- id: {
20
- description: "Used to link `labelText` to the input element",
21
- control: { type: "text" },
22
- table: {
23
- type: { summary: "string" },
24
- defaultValue: { summary: undefined }
25
- }
26
- },
27
- placeholder: {
28
- description: "Placeholder text for the input element",
29
- control: { type: "text" },
30
- table: {
31
- type: { summary: "string" },
32
- defaultValue: { summary: undefined }
33
- }
34
- },
35
- labelText: {
36
- description: "Visually hidden label for the input",
37
- control: { type: "text" },
38
- table: {
39
- type: { summary: "string" },
40
- defaultValue: { summary: undefined }
41
- }
42
- },
43
- handleChange: {
44
- description: "Callback function called when input value changes",
45
- control: { type: "object" },
46
- table: {
47
- type: { summary: "function" },
48
- defaultValue: { summary: undefined }
49
- }
50
- }
51
- }
52
- };
53
-
54
- export default meta;
55
-
56
- export const Basic = {
57
- args: {
58
- handleChange: fn(),
59
- placeholder: "Name…",
60
- id: "search-input",
61
- labelText: "Search"
62
- }
63
- };
@@ -1,18 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as AddressFormStories from './AddressForm.stories.js';
4
-
5
- <Meta of={AddressFormStories} />
6
-
7
- <Title />
8
-
9
- Renders all the fields needed to collect a full address.
10
-
11
- - Uses the [StateProvinceDropdown](?path=/docs/atoms-stateprovincedropdown--docs) component connected with the value from [CountryDropdown](?path=/docs/atoms-countrydropdown--docs) to filter states/provinces.
12
- - Zip codes automatically formatted via [FormInput](?path=/docs/atoms-form-layouts-forminput--docs) `formatter` prop.
13
- - Optional "Save address to wallet" [Checkbox](?path=/docs/atoms-checkbox--docs) via the `showWalletCheckbox` prop.
14
- - Expands to fit the width of it's containing element
15
-
16
- <Story />
17
-
18
- <Controls />
@@ -1,23 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as BannerStories from './Banner.stories.js';
4
-
5
- <Meta of={BannerStories} />
6
-
7
- <Title />
8
-
9
- Banner is a themeable component that renders a heading and sub-heading alongside an image. It supports custom padding and content spacing for both mobile and desktop, as well as minimum width and height values.
10
-
11
- ## The `Image` Prop
12
-
13
- The `image` prop is required, and must be valid a React component, typically a component that renders an SVG.
14
-
15
- The Banner component forces a width of `176px` for SVG elements on mobile screens.
16
-
17
- ---
18
-
19
- <div style={{ margin: "2em 0"}}>
20
- <Story />
21
- </div>
22
-
23
- <Controls />
@@ -1,15 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as ChangePasswordFormStories from './ChangePasswordForm.stories.js';
4
-
5
- <Meta of={ChangePasswordFormStories} />
6
-
7
- <Title />
8
-
9
- Renders a form for users to update their password. Built with [FormInput](?path=/docs/atoms-form-layouts-forminput--docs), and [PasswordRequirements](?path=/docs/atoms-passwordrequirements--docs).
10
-
11
- When the [`revenueManagement`](?path=/story/molecules-changepasswordform--revenue-management) prop is set to `true`, the form will include a user block with their full name & initials, and "Save" & "Cancel" buttons.
12
-
13
- <Story />
14
-
15
- <Controls />
@@ -1,15 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as CollapsibleSectionStories from './CollapsibleSection.stories.js';
4
-
5
- <Meta of={CollapsibleSectionStories} />
6
-
7
- <Title />
8
-
9
- The CollapsibleSection component behaves like a typical accordion, expanding and collapsing respectively when triggered by user interaction. It also includes [accessibility attributes for accordions](https://www.w3.org/WAI/ARIA/apg/patterns/accordion/).
10
-
11
- <Controls />
12
-
13
- <div style={{ marginBottom: "2em"}}>
14
- <Story />
15
- </div>
@@ -1,13 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as EditNameFormStories from './EditNameForm.stories.js';
4
-
5
- <Meta of={EditNameFormStories} />
6
-
7
- <Title />
8
-
9
- Renders input fields to collect a person's first name and last name.
10
-
11
- <Story />
12
-
13
- <Controls />
@@ -1,117 +0,0 @@
1
- import React from "react";
2
- import EditNameForm from "./EditNameForm";
3
- import { connect, Provider } from "react-redux";
4
- import { createStore } from "redux";
5
- import { createFormState, required } from "redux-freeform";
6
- import { noop } from "../../../util/general";
7
- import { fn } from "@storybook/test";
8
-
9
- const formConfig = {
10
- firstName: {
11
- validators: [required()]
12
- },
13
- lastName: {
14
- validators: [required()]
15
- }
16
- };
17
-
18
- const { mapStateToProps, mapDispatchToProps, reducer } = createFormState(
19
- formConfig
20
- );
21
-
22
- const store = createStore(
23
- reducer,
24
- window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
25
- );
26
-
27
- const FormWrapper = props => <EditNameForm {...props} />;
28
-
29
- const ConnectedEditNameForm = connect(
30
- mapStateToProps,
31
- mapDispatchToProps
32
- )(FormWrapper);
33
-
34
- export default {
35
- title: "Molecules/EditNameForm",
36
- component: ConnectedEditNameForm,
37
- tags: ["!autodocs"],
38
- parameters: {
39
- layout: "centered"
40
- },
41
- args: {
42
- fields: undefined,
43
- actions: undefined,
44
- clearOnDismount: undefined,
45
- showErrors: undefined,
46
- handleSubmit: noop
47
- },
48
- argTypes: {
49
- fields: {
50
- description:
51
- "Field data, usually generated with [redux-freeform](https://github.com/CityBaseInc/redux-freeform).",
52
- control: { type: "object" },
53
- table: {
54
- type: { summary: "object" },
55
- defaultValue: { summary: undefined }
56
- }
57
- },
58
- actions: {
59
- description:
60
- "Field actions, usually generated with [redux-freeform](https://github.com/CityBaseInc/redux-freeform).",
61
- control: { type: "object" },
62
- table: {
63
- type: { summary: "object" },
64
- defaultValue: { summary: undefined }
65
- }
66
- },
67
- clearOnDismount: {
68
- description:
69
- "If `true`, `actions.form.clear()` will be called when the component unmounts.",
70
- control: { type: "boolean" },
71
- table: {
72
- type: { summary: "boolean" },
73
- defaultValue: { summary: undefined }
74
- }
75
- },
76
- showErrors: {
77
- description: "Show form field errors.",
78
- control: { type: "boolean" },
79
- table: {
80
- type: { summary: "boolean" },
81
- defaultValue: { summary: undefined }
82
- }
83
- },
84
- handleSubmit: {
85
- description:
86
- "Function called when the `Enter` key is pressed on any of the text inputs (via `onKeyDown` prop passed to `FormInput` component).",
87
- control: { type: "object" },
88
- table: {
89
- type: { summary: "function" },
90
- defaultValue: { summary: noop }
91
- }
92
- }
93
- },
94
- decorators: [
95
- Story => (
96
- <Provider store={store}>
97
- <Story />
98
- </Provider>
99
- )
100
- ]
101
- };
102
-
103
- export const Basic = args => <ConnectedEditNameForm {...args} />;
104
-
105
- export const ShowErrors = {
106
- args: {
107
- showErrors: true
108
- },
109
- render: args => <ConnectedEditNameForm {...args} />
110
- };
111
-
112
- export const HandleSubmit = {
113
- args: {
114
- handleSubmit: fn()
115
- },
116
- render: args => <ConnectedEditNameForm {...args} />
117
- };