@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,149 +1,241 @@
1
1
  import React from "react";
2
- import { Box, Center, Cover } from "../../atoms/layouts";
3
- import Tabs from "./Tabs";
4
- import { fn } from "@storybook/test";
5
- import PaymentFormCard from "../payment-form-card";
6
- import * as PaymentFormCardState from "../payment-form-card/PaymentFormCard.state";
7
- import { connect, Provider } from "react-redux";
8
2
  import { createStore } from "redux";
3
+ import Tabs from "./Tabs";
9
4
 
10
- const store = createStore(
11
- PaymentFormCardState.reducer,
12
- window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
5
+ import page from "../../../../.storybook/page";
6
+ import Text from "../../atoms/text";
7
+
8
+ import { createFormState, onlyIntegers, required } from "redux-freeform";
9
+ import DisplayBox from "../../atoms/display-box";
10
+ import { Box } from "../../atoms/layouts";
11
+
12
+ // Including commented out configs as a preliminary work for
13
+ // https://citybase.atlassian.net/browse/KCORE-2973
14
+ // https://citybase.atlassian.net/browse/KCORE-2974
15
+ // https://citybase.atlassian.net/browse/KCORE-2975
16
+
17
+ const ButtonTest = () => (
18
+ <DisplayBox>
19
+ <Text>Test Button Clicks</Text>
20
+ <Box>
21
+ <button onClick={() => console.log("BUTTON TEST;")}>Click me</button>
22
+ </Box>
23
+ </DisplayBox>
13
24
  );
14
25
 
15
- const ConnectedPaymentFormCard = connect(
16
- PaymentFormCardState.mapStateToProps,
17
- PaymentFormCardState.mapDispatchToProps
18
- )(PaymentFormCard);
26
+ //const creditCardFormConfig = {
27
+ // amount: {
28
+ // defaultValue: "100.00",
29
+ // validators: [required()]
30
+ // }
31
+ //};
19
32
 
20
- const meta = {
21
- title: "Molecules/Tabs",
22
- component: Tabs,
23
- parameters: {
24
- layout: "centered"
33
+ const checkFormConfig = {
34
+ amount: {
35
+ defaultValue: "100.00",
36
+ validators: [required()]
25
37
  },
26
- tags: ["!autodocs"],
27
- args: {
28
- tabsConfig: undefined,
29
- tabsDisplayMode: undefined
38
+ name: {
39
+ validators: [required()]
30
40
  },
31
- argTypes: {
32
- tabsConfig: {
33
- description:
34
- "Object containing an array of tabs to show, along with their label, active state, and associated content",
35
- table: {
36
- type: { summary: "object" },
37
- defaultValue: { summary: undefined }
38
- }
39
- },
40
- tabsDisplayMode: {
41
- description:
42
- "Whether to display tabs in horizontal or vertical configuration. Use 'horizontal' for horitzontal config. All other values will result in vertical configuration.",
43
- table: {
44
- type: { summary: "string" },
45
- defaultValue: { summary: undefined }
46
- }
47
- }
41
+ accountNumber: {
42
+ validators: [onlyIntegers()]
48
43
  },
49
- decorators: [
50
- Story => (
51
- <Provider store={store}>
52
- <Story />
53
- </Provider>
54
- )
55
- ]
56
- };
57
-
58
- export default meta;
59
-
60
- export const HoriztonalTabs = {
61
- args: {
62
- tabsConfig: {
63
- tabs: [
64
- {
65
- label: "Credit Card",
66
- active: true,
67
- content: (
68
- <ConnectedPaymentFormCard
69
- variant="checkout"
70
- hideTitle
71
- hideZipCode
72
- fields={{
73
- ...PaymentFormCardState.mapStateToProps(store.getState())
74
- }}
75
- {...PaymentFormCardState.mapDispatchToProps(store.dispatch)}
76
- fees={{
77
- label: "Service Fee",
78
- type: "FLAT",
79
- value: 0
80
- }}
81
- showWalletCheckbox
82
- saveToWallet={fn()}
83
- walletCheckboxMarked
84
- termsContent={"terms"}
85
- termsTitle={"Terms and Conditions"}
86
- />
87
- )
88
- },
89
- {
90
- label: "ACH Payment",
91
- active: true,
92
- content: (
93
- <Box minWidth="500px" minHeight="400px">
94
- <Center>
95
- <Cover singleChild>ACH Payment Form</Cover>
96
- </Center>
97
- </Box>
98
- )
99
- }
100
- ]
101
- },
102
- tabsDisplayMode: "horizontal"
44
+ routingNumber: {
45
+ validators: [onlyIntegers()]
46
+ },
47
+ checkType: {
48
+ defaultValue: "Personal"
103
49
  }
104
50
  };
105
51
 
106
- export const VerticalTabs = {
107
- args: {
108
- tabsConfig: {
109
- tabs: [
110
- {
111
- label: "Credit Card",
112
- active: true,
113
- content: (
114
- <ConnectedPaymentFormCard
115
- variant="checkout"
116
- hideTitle
117
- hideZipCode
118
- fields={{
119
- ...PaymentFormCardState.mapStateToProps(store.getState())
120
- }}
121
- {...PaymentFormCardState.mapDispatchToProps(store.dispatch)}
122
- fees={{
123
- label: "Service Fee",
124
- type: "FLAT",
125
- value: 0
126
- }}
127
- showWalletCheckbox
128
- saveToWallet={fn()}
129
- walletCheckboxMarked
130
- termsContent={"terms"}
131
- termsTitle={"Terms and Conditions"}
132
- />
133
- )
134
- },
135
- {
136
- label: "ACH Payment",
137
- active: true,
138
- content: (
139
- <Box minWidth="500px" minHeight="400px">
140
- <Center>
141
- <Cover singleChild>ACH Payment Form</Cover>
142
- </Center>
143
- </Box>
144
- )
145
- }
146
- ]
52
+ //const cashFormConfig = {
53
+ // amount: {
54
+ // defaultValue: "100.00",
55
+ // validators: [required()]
56
+ // }
57
+ //};
58
+ //
59
+ //const MyCreditCardForm = ({ actions, fields }) => {
60
+ // return (
61
+ // <div>
62
+ // {fields.amount.hasErrors && fields.amount.errors.includes(required.error)
63
+ // ? "Amount"
64
+ // : "Amount"}
65
+ // <input
66
+ // value={fields.amount.rawValue}
67
+ // onChange={evt => actions.fields.amount.set(evt.target.value)}
68
+ // type="text"
69
+ // />
70
+ // </div>
71
+ // );
72
+ //};
73
+
74
+ const MyCheckForm = ({ actions, fields }) => (
75
+ <div>
76
+ {fields.amount.hasErrors && fields.amount.errors.includes(required.error)
77
+ ? "AmountError"
78
+ : "Amount"}
79
+ <input
80
+ value={fields.amount.rawValue}
81
+ onChange={evt => actions.fields.amount.set(evt.target.value)}
82
+ type="text"
83
+ />
84
+ {fields.name.hasErrors && fields.name.errors.includes(required.error)
85
+ ? "Name Error"
86
+ : "Name"}
87
+ <input
88
+ value={fields.name.rawValue}
89
+ onChange={evt => actions.fields.name.set(evt.target.value)}
90
+ type="text"
91
+ />
92
+ {fields.accountNumber.hasErrors &&
93
+ fields.accountNumber.errors.includes(required.error)
94
+ ? "Account Number Error"
95
+ : "Account Number"}
96
+ <input
97
+ value={fields.accountNumber.rawValue}
98
+ onChange={evt => actions.fields.accountNumber.set(evt.target.value)}
99
+ type="text"
100
+ />
101
+ {fields.routingNumber.hasErrors &&
102
+ fields.routingNumber.errors.includes(required.error)
103
+ ? "Routing Number Error"
104
+ : "Routing Number"}
105
+ <input
106
+ value={fields.routingNumber.rawValue}
107
+ onChange={evt => actions.fields.routingNumber.set(evt.target.value)}
108
+ type="text"
109
+ />
110
+ {fields.checkType.hasErrors &&
111
+ fields.checkType.errors.includes(required.error)
112
+ ? "Check Type Error"
113
+ : "Check Type"}
114
+ <input
115
+ value={fields.checkType.rawValue}
116
+ onChange={evt => actions.fields.checkType.set(evt.target.value)}
117
+ type="text"
118
+ />
119
+ </div>
120
+ );
121
+
122
+ //const MyCashForm = ({ actions, fields }) => (
123
+ // <div>
124
+ // {fields.amount.hasErrors && fields.amount.errors.includes(required.error)
125
+ // ? "Amount Error"
126
+ // : "Amount"}
127
+ // <input
128
+ // value={fields.amount.rawValue}
129
+ // onChange={evt => actions.fields.amount.set(evt.target.value)}
130
+ // type="text"
131
+ // />
132
+ // </div>
133
+ //);
134
+
135
+ //const {
136
+ // reducer: cardReducer,
137
+ // mapStateToProps: cardMapStateToProps,
138
+ // mapDispatchToProps: cardMapDispatchToProps
139
+ //} = createFormState(creditCardFormConfig);
140
+
141
+ const {
142
+ reducer: checkReducer,
143
+ mapStateToProps: checkMapStateToProps,
144
+ mapDispatchToProps: checkMapDispatchToProps
145
+ } = createFormState(checkFormConfig);
146
+
147
+ //const {
148
+ // reducer: cashReducer,
149
+ // mapStateToProps: cashMapStateToProps,
150
+ // mapDispatchToProps: cashMapDispatchToProps
151
+ //} = createFormState(cashFormConfig);
152
+
153
+ //const cardStore = createStore(
154
+ // cardReducer,
155
+ // window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
156
+ //);
157
+
158
+ const checkStore = createStore(
159
+ checkReducer,
160
+ window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
161
+ );
162
+
163
+ //const cashStore = createStore(
164
+ // cashReducer,
165
+ // window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
166
+ //);
167
+
168
+ //const tabsConfig = {
169
+ // tabs: [
170
+ // {
171
+ // label: 'Credit Card',
172
+ // active: true,
173
+ // content: MyCreditCardForm(
174
+ // {...cardMapStateToProps(cardStore.getState())},
175
+ // {...cardMapDispatchToProps(cardStore.dispatch)}
176
+ // )
177
+ // },
178
+ // {
179
+ // label: 'Check',
180
+ // active: true,
181
+ // content: MyCheckForm(
182
+ // {...checkMapStateToProps(checkStore.getState())},
183
+ // {...checkMapDispatchToProps(checkStore.dispatch)}
184
+ // )
185
+ // },
186
+ // {
187
+ // true: 'Cash',
188
+ // active: true,
189
+ // content: MyCashForm(
190
+ // {...cashMapStateToProps(cashStore.getState())},
191
+ // {...cashMapDispatchToProps(cashStore.dispatch)}
192
+ // )
193
+ // }
194
+ // ]
195
+ //};
196
+
197
+ const LOREM = `
198
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit,
199
+ sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
200
+ Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
201
+ nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
202
+ reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
203
+ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
204
+ deserunt mollit anim id est laborum.
205
+ `;
206
+
207
+ const tabsConfig = {
208
+ tabs: [
209
+ {
210
+ label: "Credit Card",
211
+ active: true,
212
+ content: <Text>{LOREM}</Text>
213
+ },
214
+ {
215
+ label: "Check",
216
+ active: true,
217
+ content: MyCheckForm(
218
+ { ...checkMapStateToProps(checkStore.getState()) },
219
+ { ...checkMapDispatchToProps(checkStore.dispatch) }
220
+ )
221
+ },
222
+ {
223
+ label: "Cash",
224
+ active: true,
225
+ content: <ButtonTest></ButtonTest>
147
226
  }
148
- }
227
+ ]
149
228
  };
229
+
230
+ const HORIZONTAL = "horizontal";
231
+
232
+ export const tabs = () => (
233
+ <Tabs tabsConfig={tabsConfig} tabsDisplayMode={HORIZONTAL} />
234
+ );
235
+
236
+ const story = page({
237
+ title: "Components|Molecules/Tabs",
238
+ Component: Tabs
239
+ });
240
+
241
+ export default story;
@@ -0,0 +1,105 @@
1
+ import React, { useEffect } from "react";
2
+ import ToastNotification from "./ToastNotification";
3
+ import page from "../../../../.storybook/page";
4
+ import { useToastNotification } from "../../../hooks";
5
+ import { ToastVariants } from "../../../types/common";
6
+ import { text } from "@storybook/addon-knobs";
7
+
8
+ const groupId = "props";
9
+
10
+ export const toastNotificationSuccess = () => {
11
+ const {
12
+ isToastOpen,
13
+ toastVariant,
14
+ toastMessage,
15
+ showToast,
16
+ hideToast
17
+ } = useToastNotification();
18
+
19
+ useEffect(() => {
20
+ showToast({
21
+ message: "Success!",
22
+ variant: ToastVariants.SUCCESS
23
+ });
24
+ }, []);
25
+
26
+ return (
27
+ <ToastNotification
28
+ variant={toastVariant}
29
+ message={toastMessage}
30
+ toastOpen={isToastOpen}
31
+ closeToastNotification={() => hideToast()}
32
+ role={text("role", "alert", groupId)}
33
+ minWidth={text("minWidth", null, groupId)}
34
+ maxWidth={text("maxWidth", null, groupId)}
35
+ />
36
+ );
37
+ };
38
+
39
+ toastNotificationSuccess.storyName = "Success Toast";
40
+
41
+ export const toastNotificationError = () => {
42
+ const {
43
+ isToastOpen,
44
+ toastVariant,
45
+ toastMessage,
46
+ showToast,
47
+ hideToast
48
+ } = useToastNotification();
49
+
50
+ useEffect(() => {
51
+ showToast({
52
+ message: "An error occurred",
53
+ variant: ToastVariants.ERROR
54
+ });
55
+ }, []);
56
+
57
+ return (
58
+ <ToastNotification
59
+ variant={toastVariant}
60
+ message={toastMessage}
61
+ toastOpen={isToastOpen}
62
+ closeToastNotification={() => hideToast()}
63
+ role={text("role", "alert", groupId)}
64
+ minWidth={text("minWidth", null, groupId)}
65
+ maxWidth={text("maxWidth", null, groupId)}
66
+ />
67
+ );
68
+ };
69
+ toastNotificationError.storyName = "Error Toast";
70
+
71
+ export const toastNotificationNoAutoHide = () => {
72
+ const {
73
+ isToastOpen,
74
+ toastMessage,
75
+ showToast,
76
+ hideToast
77
+ } = useToastNotification({ timeout: 0 });
78
+
79
+ useEffect(() => {
80
+ showToast({
81
+ message: "Success!",
82
+ variant: ToastVariants.SUCCESS
83
+ });
84
+ }, []);
85
+
86
+ return (
87
+ <ToastNotification
88
+ message={toastMessage}
89
+ toastOpen={isToastOpen}
90
+ closeToastNotification={() => hideToast()}
91
+ role={text("role", "alert", groupId)}
92
+ minWidth={text("minWidth", null, groupId)}
93
+ maxWidth={text("maxWidth", null, groupId)}
94
+ />
95
+ );
96
+ };
97
+
98
+ toastNotificationNoAutoHide.storyName = "No auto-hide";
99
+
100
+ const story = page({
101
+ title: "Components|Molecules/ToastNotification",
102
+ Component: ToastNotification
103
+ });
104
+
105
+ export default story;
@@ -18,12 +18,11 @@ const useOutsideClickHook = handler => {
18
18
  if (ref.current && !ref.current.contains(e.target)) {
19
19
  handler();
20
20
  }
21
+ };
21
22
 
22
- document.addEventListener("click", handleOutsideClick, true);
23
-
24
- return () => {
25
- document.removeEventListener("click", handleOutsideClick, true);
26
- };
23
+ document.addEventListener("click", handleOutsideClick, true);
24
+ return () => {
25
+ document.removeEventListener("click", handleOutsideClick, true);
27
26
  };
28
27
  }, [ref]);
29
28
 
package/src/util/index.js CHANGED
@@ -4,7 +4,6 @@ import * as theme from "./themeUtils";
4
4
  import useFocusInvalidInput from "./focusFirstInvalidInputHook";
5
5
  import useOutsideClick from "../hooks/use-outside-click";
6
6
  import useToastNotification from "../hooks/use-toast-notification";
7
- import useLogoutTimers from "./idleTimerUtils";
8
7
 
9
8
  export {
10
9
  formats,
@@ -12,6 +11,5 @@ export {
12
11
  theme,
13
12
  useFocusInvalidInput,
14
13
  useOutsideClick,
15
- useToastNotification,
16
- useLogoutTimers
14
+ useToastNotification
17
15
  };
@@ -1,19 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as AlertStories from './Alert.stories.js';
4
-
5
- <Meta of={AlertStories} />
6
-
7
- <Title />
8
-
9
- The Alert component is a fully accesible element to provide notifications to a user. Its features include:
10
-
11
- - Multiple types: info, warn, error, success
12
- - Ability to allow user to dismiss the alert
13
- - Default support of heading text, body text, and customizable children elements
14
- - Highly customizable content via textOverride
15
- - Accessibility props for aria-role, aria-atomic, and aria-live
16
-
17
- <div style={{ marginBottom: "2em"}}>
18
- <Story />
19
- </div>
@@ -1,27 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as BadgeStories from './Badge.stories.js';
4
-
5
- <Meta of={BadgeStories} />
6
-
7
- <Title />
8
-
9
- The Badge component is a small component used to provide information in the form of an icon and text string to users at a glance. Badges can be used in tables, as tags, in UI controls, or anywhere display of bite-sized information is needed.
10
-
11
- All themes use the same badge variants (and colors) as displayed here, but custom badges can be added to theme patterns in FCS if desired.
12
-
13
- Badges have these properties:
14
-
15
- - label (required)
16
- - Icon (optional)
17
- - variant (optional, default is "success")
18
- - iconOnLeft (optional, default is "true")
19
-
20
- Badge theme variants control *only* the background color of the badge and the color of its text. Icon color is either passed in as a prop to the Icon component (ideal), or controlled by the Icon themeing.
21
-
22
- Note: if using the second approach, it is possible for the color of badge text and icon to diverge, possibly in undersible ways, unless special variants are added to the Icon themes in the FCS theme patterns. See the "Payment History" badge - try changing the theme in storybook - for an example of this.
23
-
24
-
25
- <div style={{ marginBottom: "2em"}}>
26
- <Story />
27
- </div>
@@ -1,21 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as BreadcrumbStories from './Breadcrumb.stories.js';
4
-
5
- <Meta of={BreadcrumbStories} />
6
-
7
- <Title />
8
-
9
- Breadcrumb is a themeable component that generates a horizontal navigation with links separated by chevron icons.
10
-
11
- The component only takes on prop: `breadcrumbsList`, which must be an array of objects with the following properties:
12
-
13
- - `linkText`: string for the link's text
14
- - `linkDestination`: string or react-router path for the link's URL
15
- - `isActive`: boolean, changes the style and cursor of the link to represent the current page
16
-
17
- Breadcrumb uses the InternalLink component for each crumb, which uses the Link component from react-router-dom.
18
-
19
- <Story />
20
-
21
- <Controls />
@@ -1,21 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as ButtonWithLinkStories from './ButtonWithLink.stories.js';
4
-
5
- <Meta of={ButtonWithLinkStories} />
6
-
7
- <Title />
8
-
9
- `ButtonWithLink` wraps a [ButtonWithAction](?path=/docs/atoms-buttonwithaction--docs) component with either a `ExternalLink` or `InternalLink` component, unless the `disabled` prop is `true`, then it returns just the disabled `ButtonWithAction`.
10
-
11
- Any additional props not specified in the component params will be passed down to the underlying `ButtonWithAction` component, including the `text` prop, which will be used as the text for the button.
12
-
13
- The underlying `ButtonWithAction` component is themeable, and the variant can be changed by passing a valid `variant` value to `ButtonWithLink`.
14
-
15
- `extraStyles` will be passed down to the `ButtonWithAction`, while `linkExtraStyles` are passed to the `ExternalLink` or `InternalLink` component.
16
-
17
- `fileLink` forces the use of the `ExternalLink` component, even if the value of `url` is not an full external link with a valid URL prefix like `http://`.
18
-
19
- <Story />
20
-
21
- <Controls />
@@ -1,41 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as CardStories from './Card.stories.js';
4
-
5
- <Meta of={CardStories} />
6
-
7
- <Title />
8
-
9
- The Card component is a generic wrapper to create "cards" of information. A Card can contain a header, title, body text, images, and custom controls. Providing strings for header/title/body text as props results in default styling, but the component is very flexible and can be customized to display virtually any information.
10
-
11
- Cards can take these properties to display content:
12
-
13
- - headerText (optional)
14
- - titleText (optional)
15
- - text (optional)
16
- - imgSrc (optional)
17
- - Image (optional)
18
- - children
19
-
20
- In addition to the content props, Cards also offer certain props for controlling the style and display of provided information:
21
-
22
- - headerAs (optional, default "h2")
23
- - headerVariant (optional, default "small")
24
- - imgHeight (optional, default "150px")
25
- - imgObjectFit (optional, default "none")
26
- - imgAltText (required for proper accessibility)
27
- - titleVariant (optional, default "small")
28
- - padding (optioonal, default "24px")
29
- - width (optional min-width, default "276px")
30
-
31
- By default, the width prop is the Card's _minimum_ width. The card will scale to match its width to the width of its parent container. If you wish to cap the Card's with, use the extraStyles prop like so:
32
-
33
- ```
34
- <Card extraStyles={`& { max-width: 450px };`} />
35
- ```
36
-
37
- When using a Card to display an image there are two options. Either provide a URL string using the imgSrc prop, or provide a React Component using the Image prop. These are mutually exclusive options -- an image provided using the Image prop will only be displayed if imgSrc is undefined.
38
-
39
- <div style={{ marginBottom: "2em"}}>
40
- <Story />
41
- </div>