@thecb/components 10.12.2-beta.0 → 10.12.3-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/README.md +4 -0
  2. package/dist/index.cjs.js +1476 -2489
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.d.ts +8 -6
  5. package/dist/index.esm.js +1476 -2488
  6. package/dist/index.esm.js.map +1 -1
  7. package/package.json +25 -13
  8. package/src/components/atoms/.DS_Store +0 -0
  9. package/src/components/atoms/alert/Alert.mdx +19 -0
  10. package/src/components/atoms/alert/Alert.stories.js +148 -26
  11. package/src/components/atoms/badge/Badge.js +2 -2
  12. package/src/components/atoms/badge/Badge.mdx +27 -0
  13. package/src/components/atoms/badge/Badge.stories.js +143 -29
  14. package/src/components/atoms/breadcrumb/Breadcrumb.mdx +21 -0
  15. package/src/components/atoms/breadcrumb/Breadcrumb.stories.js +38 -29
  16. package/src/components/atoms/button-with-action/ButtonWithAction.stories.js +108 -55
  17. package/src/components/atoms/button-with-link/ButtonWithLink.mdx +21 -0
  18. package/src/components/atoms/button-with-link/ButtonWithLink.stories.js +160 -31
  19. package/src/components/atoms/card/Card.js +13 -1
  20. package/src/components/atoms/card/Card.mdx +41 -0
  21. package/src/components/atoms/card/Card.stories.js +360 -0
  22. package/src/components/atoms/card/Card.theme.js +2 -0
  23. package/src/components/atoms/card/index.d.ts +1 -0
  24. package/src/components/atoms/checkbox/Checkbox.js +8 -14
  25. package/src/components/atoms/checkbox/Checkbox.mdx +15 -0
  26. package/src/components/atoms/checkbox/Checkbox.oldstories.js +30 -0
  27. package/src/components/atoms/checkbox/Checkbox.stories.js +148 -29
  28. package/src/components/atoms/country-dropdown/CountryDropdown.mdx +36 -0
  29. package/src/components/atoms/country-dropdown/CountryDropdown.stories.js +61 -27
  30. package/src/components/atoms/detail/Detail.js +0 -26
  31. package/src/components/atoms/detail/Detail.mdx +32 -0
  32. package/src/components/atoms/detail/Detail.stories.js +156 -0
  33. package/src/components/atoms/display-box/DisplayBox.mdx +11 -0
  34. package/src/components/atoms/display-box/DisplayBox.stories.js +65 -21
  35. package/src/components/atoms/display-card/DisplayCard.mdx +13 -0
  36. package/src/components/atoms/display-card/DisplayCard.stories.js +163 -22
  37. package/src/components/atoms/dropdown/Dropdown.mdx +65 -0
  38. package/src/components/atoms/dropdown/Dropdown.stories.js +91 -10
  39. package/src/components/atoms/form-layouts/FormInput.mdx +38 -0
  40. package/src/components/atoms/form-layouts/FormInput.stories.js +212 -26
  41. package/src/components/atoms/form-select/FormSelect.mdx +42 -0
  42. package/src/components/atoms/form-select/FormSelect.stories.js +55 -29
  43. package/src/components/atoms/formatted-address/FormattedAddress.mdx +13 -0
  44. package/src/components/atoms/formatted-address/FormattedAddress.stories.js +133 -27
  45. package/src/components/atoms/formatted-bank-account/FormattedBankAccount.mdx +17 -0
  46. package/src/components/atoms/formatted-bank-account/FormattedBankAccount.stories.js +57 -0
  47. package/src/components/atoms/formatted-credit-card/FormattedCreditCard.mdx +40 -0
  48. package/src/components/atoms/formatted-credit-card/FormattedCreditCard.stories.js +74 -0
  49. package/src/components/atoms/icons/Icons.mdx +40 -0
  50. package/src/components/atoms/icons/Icons.stories.js +325 -0
  51. package/src/components/atoms/icons/index.js +1 -5
  52. package/src/components/atoms/labeled-amount/LabeledAmount.mdx +23 -0
  53. package/src/components/atoms/labeled-amount/LabeledAmount.stories.js +110 -34
  54. package/src/components/atoms/line-item/LineItem.mdx +28 -0
  55. package/src/components/atoms/line-item/LineItem.stories.js +89 -22
  56. package/src/components/atoms/link/Link.mdx +19 -0
  57. package/src/components/atoms/link/Link.stories.js +155 -49
  58. package/src/components/atoms/loading/Loading.mdx +13 -0
  59. package/src/components/atoms/loading/Loading.stories.js +22 -0
  60. package/src/components/atoms/loading-line/LoadingLine.js +14 -10
  61. package/src/components/atoms/loading-line/LoadingLine.mdx +15 -0
  62. package/src/components/atoms/loading-line/LoadingLine.stories.js +132 -28
  63. package/src/components/atoms/nav-footer/NavFooter.mdx +15 -0
  64. package/src/components/atoms/nav-footer/NavFooter.stories.js +235 -22
  65. package/src/components/atoms/nav-header/NavHeader.mdx +13 -0
  66. package/src/components/atoms/nav-header/NavHeader.stories.js +122 -21
  67. package/src/components/atoms/nav-tabs/NavTabs.mdx +30 -0
  68. package/src/components/atoms/nav-tabs/NavTabs.stories.js +49 -0
  69. package/src/components/atoms/password-requirements/PasswordRequirements.mdx +39 -0
  70. package/src/components/atoms/password-requirements/PasswordRequirements.stories.js +108 -44
  71. package/src/components/atoms/placeholder/Placeholder.mdx +19 -0
  72. package/src/components/atoms/placeholder/Placeholder.stories.js +164 -36
  73. package/src/components/atoms/searchable-select/SearchableSelect.mdx +44 -0
  74. package/src/components/atoms/searchable-select/SearchableSelect.stories.js +103 -28
  75. package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.mdx +36 -0
  76. package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.stories.js +65 -40
  77. package/src/components/atoms/table/Table.mdx +71 -0
  78. package/src/components/atoms/table/Table.oldstories.js +84 -0
  79. package/src/components/atoms/table/Table.stories.js +59 -75
  80. package/src/components/atoms/table/TableRow.js +1 -0
  81. package/src/components/atoms/title/Title.js +0 -23
  82. package/src/components/atoms/title/Title.mdx +26 -0
  83. package/src/components/atoms/title/Title.stories.js +144 -0
  84. package/src/components/atoms/toggle-switch/ToggleSwitch.mdx +17 -0
  85. package/src/components/atoms/toggle-switch/ToggleSwitch.stories.js +103 -20
  86. package/src/components/atoms/toggle-switch/ToggleSwitch.theme.js +8 -5
  87. package/src/components/atoms/typeahead-input/TypeaheadInput.mdx +13 -0
  88. package/src/components/atoms/typeahead-input/TypeaheadInput.stories.js +63 -0
  89. package/src/components/molecules/address-form/AddressForm.mdx +18 -0
  90. package/src/components/molecules/address-form/AddressForm.stories.js +223 -20
  91. package/src/components/molecules/banner/Banner.mdx +23 -0
  92. package/src/components/molecules/banner/Banner.stories.js +122 -26
  93. package/src/components/molecules/change-password-form/ChangePasswordForm.mdx +15 -0
  94. package/src/components/molecules/change-password-form/ChangePasswordForm.stories.js +203 -19
  95. package/src/components/molecules/collapsible-section/CollapsibleSection.mdx +15 -0
  96. package/src/components/molecules/collapsible-section/CollapsibleSection.stories.js +210 -61
  97. package/src/components/molecules/edit-name-form/EditNameForm.mdx +13 -0
  98. package/src/components/molecules/edit-name-form/EditNameForm.stories.js +117 -0
  99. package/src/components/molecules/idle-modal/IdleModal.js +101 -0
  100. package/src/components/molecules/idle-modal/IdleModal.mdx +17 -0
  101. package/src/components/molecules/idle-modal/IdleModal.stories.js +180 -0
  102. package/src/components/molecules/idle-modal/index.d.ts +16 -0
  103. package/src/components/molecules/idle-modal/index.js +3 -0
  104. package/src/components/molecules/index.js +1 -0
  105. package/src/components/molecules/link-card/LinkCard.mdx +17 -0
  106. package/src/components/molecules/link-card/LinkCard.stories.js +287 -72
  107. package/src/components/molecules/login-form/LoginForm.mdx +16 -0
  108. package/src/components/molecules/login-form/LoginForm.stories.js +117 -21
  109. package/src/components/molecules/modal/Modal.mdx +17 -0
  110. package/src/components/molecules/modal/Modal.stories.js +342 -128
  111. package/src/components/molecules/module/Module.mdx +17 -0
  112. package/src/components/molecules/module/Module.stories.js +267 -25
  113. package/src/components/molecules/multiple-select-filter/MultipleSelectFilter.js +309 -77
  114. package/src/components/molecules/multiple-select-filter/{MultipleSelectFilter.stories.js → MultipleSelectFilter.oldstories.js} +4 -2
  115. package/src/components/molecules/multiple-select-filter/MultipleSelectFilter.styled.js +6 -6
  116. package/src/components/molecules/multiple-select-filter/index.d.ts +2 -2
  117. package/src/components/molecules/obligation/Obligation.mdx +23 -0
  118. package/src/components/molecules/obligation/Obligation.stories.js +460 -0
  119. package/src/components/molecules/obligation/icons/PropertyPersonalIcon.js +1 -1
  120. package/src/components/molecules/pagination/Pagination.mdx +15 -0
  121. package/src/components/molecules/pagination/Pagination.stories.js +177 -28
  122. package/src/components/molecules/popover/Popover.mdx +15 -0
  123. package/src/components/molecules/popover/Popover.stories.js +220 -0
  124. package/src/components/molecules/tabs/Tabs.mdx +17 -0
  125. package/src/components/molecules/tabs/Tabs.stories.js +135 -227
  126. package/src/components/molecules/toast-notification/Toast.mdx +15 -0
  127. package/src/components/molecules/toast-notification/Toast.stories.js +183 -0
  128. package/src/hooks/use-outside-click/index.js +5 -4
  129. package/src/stories/Button.stories.ts +53 -0
  130. package/src/stories/Button.tsx +48 -0
  131. package/src/stories/Configure.mdx +364 -0
  132. package/src/stories/Header.stories.ts +33 -0
  133. package/src/stories/Header.tsx +56 -0
  134. package/src/stories/Page.stories.ts +32 -0
  135. package/src/stories/Page.tsx +73 -0
  136. package/src/stories/assets/accessibility.png +0 -0
  137. package/src/stories/assets/accessibility.svg +5 -0
  138. package/src/stories/assets/addon-library.png +0 -0
  139. package/src/stories/assets/assets.png +0 -0
  140. package/src/stories/assets/avif-test-image.avif +0 -0
  141. package/src/stories/assets/context.png +0 -0
  142. package/src/stories/assets/discord.svg +15 -0
  143. package/src/stories/assets/docs.png +0 -0
  144. package/src/stories/assets/figma-plugin.png +0 -0
  145. package/src/stories/assets/github.svg +3 -0
  146. package/src/stories/assets/share.png +0 -0
  147. package/src/stories/assets/styling.png +0 -0
  148. package/src/stories/assets/testing.png +0 -0
  149. package/src/stories/assets/theming.png +0 -0
  150. package/src/stories/assets/tutorials.svg +12 -0
  151. package/src/stories/assets/youtube.svg +4 -0
  152. package/src/stories/button.css +30 -0
  153. package/src/stories/header.css +32 -0
  154. package/src/stories/page.css +69 -0
  155. package/src/util/idleTimerUtils.js +36 -0
  156. package/src/util/index.js +3 -1
  157. package/src/components/atoms/icons/CheckboxCheckmarkIcon.js +0 -45
  158. package/src/components/atoms/icons/PaymentStatusIcon.d.ts +0 -1
  159. package/src/components/atoms/icons/PaymentStatusIcon.js +0 -28
  160. package/src/components/atoms/icons/PersonIcon.d.ts +0 -1
  161. package/src/components/atoms/icons/PersonIcon.js +0 -28
  162. package/src/components/atoms/icons/icons.stories.js +0 -120
  163. package/src/components/molecules/edit-name-form/EdidNameForm.stories.js +0 -24
  164. package/src/components/molecules/multiple-select-filter/__private__/ActionLinkButton.js +0 -27
  165. package/src/components/molecules/multiple-select-filter/__private__/FilterButton.js +0 -89
  166. package/src/components/molecules/multiple-select-filter/__private__/FilterDropdown.js +0 -27
  167. package/src/components/molecules/multiple-select-filter/__private__/FilterableList.js +0 -146
  168. package/src/components/molecules/multiple-select-filter/__private__/FilterableListItem.js +0 -79
  169. package/src/components/molecules/multiple-select-filter/__private__/SearchBox.js +0 -41
  170. package/src/components/molecules/multiple-select-filter/__private__/useKeyboardNavigation.js +0 -84
  171. package/src/components/molecules/multiple-select-filter/__private__/util.js +0 -31
  172. package/src/components/molecules/toast-notification/ToastNotification.stories.js +0 -105
  173. /package/src/components/atoms/add-obligation/{AddObligation.stories.js → AddObligation.oldstories.js} +0 -0
  174. /package/src/components/atoms/amount-callout/{AmountCallout.stories.js → AmountCallout.oldstories.js} +0 -0
  175. /package/src/components/atoms/checkbox-list/{CheckboxList.stories.js → CheckboxList.oldstories.js} +0 -0
  176. /package/src/components/atoms/form-layouts/{FormLayouts.stories.js → FormLayouts.oldstories.js} +0 -0
  177. /package/src/components/atoms/hamburger-button/{HamburgerButton.stories.js → HamburgerButton.oldstories.js} +0 -0
  178. /package/src/components/atoms/heading/{Heading.stories.js → Heading.oldstories.js} +0 -0
  179. /package/src/components/atoms/layouts/examples/box-example/{BoxExample.stories.js → BoxExample.oldstories.js} +0 -0
  180. /package/src/components/atoms/layouts/examples/center-example/{CenterExample.stories.js → CenterExample.oldstories.js} +0 -0
  181. /package/src/components/atoms/layouts/examples/cluster-example/{ClusterExample.stories.js → ClusterExample.oldstories.js} +0 -0
  182. /package/src/components/atoms/layouts/examples/cover-example/{CoverExample.stories.js → CoverExample.oldstories.js} +0 -0
  183. /package/src/components/atoms/layouts/examples/frame-example/{FrameExample.stories.js → FrameExample.oldstories.js} +0 -0
  184. /package/src/components/atoms/layouts/examples/grid-example/{GridExample.stories.js → GridExample.oldstories.js} +0 -0
  185. /package/src/components/atoms/layouts/examples/imposter-example/{ImposterExample.stories.js → ImposterExample.oldstories.js} +0 -0
  186. /package/src/components/atoms/layouts/examples/motion-example/{MotionExample.stories.js → MotionExample.oldstories.js} +0 -0
  187. /package/src/components/atoms/layouts/examples/reel-example/{ReelExample.stories.js → ReelExample.oldstories.js} +0 -0
  188. /package/src/components/atoms/layouts/examples/sidebar-example/{SidebarExample.stories.js → SidebarExample.oldstories.js} +0 -0
  189. /package/src/components/atoms/layouts/examples/stack-example/{StackExample.stories.js → StackExample.oldstories.js} +0 -0
  190. /package/src/components/atoms/layouts/examples/switcher-example/{SwitcherExample.stories.js → SwitcherExample.oldstories.js} +0 -0
  191. /package/src/components/atoms/paragraph/{Paragraph.stories.js → Paragraph.oldstories.js} +0 -0
  192. /package/src/components/atoms/processing-fee/{ProcessingFee.stories.js → ProcessingFee.oldstories.js} +0 -0
  193. /package/src/components/atoms/search/{Search.stories.js → Search.oldstories.js} +0 -0
  194. /package/src/components/atoms/solid-divider/{SolidDivider.stories.js → SolidDivider.oldstories.js} +0 -0
  195. /package/src/components/atoms/sortable-table-heading/{SortableTableHeading.stories.js → SortableTableHeading.oldstories.js} +0 -0
  196. /package/src/components/atoms/spinner/{Spinner.stories.js → Spinner.oldstories.js} +0 -0
  197. /package/src/components/atoms/tab/{Tab.stories.js → Tab.oldstories.js} +0 -0
  198. /package/src/components/atoms/text/{Text.stories.js → Text.oldstories.js} +0 -0
  199. /package/src/components/atoms/typeahead-input/{TypeaheadIinput.stories.js → TypeaheadIinput.oldstories.js} +0 -0
  200. /package/src/components/atoms/wallet-name/{WalletName.stories.js → WalletName.oldstories.js} +0 -0
  201. /package/src/components/molecules/account-and-routing-modal/{AccountAndRoutingModal.stories.js → AccountAndRoutingModal.oldstories.js} +0 -0
  202. /package/src/components/molecules/editable-list/{EditableList.stories.js → EditableList.oldstories.js} +0 -0
  203. /package/src/components/molecules/email-form/{EmailForm.stories.js → EmailForm.oldstories.js} +0 -0
  204. /package/src/components/molecules/forgot-password-form/{ForgotPasswordForm.stories.js → ForgotPasswordForm.oldstories.js} +0 -0
  205. /package/src/components/molecules/highlight-tab-row/{HighlightTabRow.stories.js → HighlightTabRow.oldstories.js} +0 -0
  206. /package/src/components/molecules/obligation/modules/{AmountModule.stories.js → AmountModule.oldstories.js} +0 -0
  207. /package/src/components/molecules/payment-button-bar/{PaymentButtonBar.stories.js → PaymentButtonBar.oldstories.js} +0 -0
  208. /package/src/components/molecules/payment-details/{PaymentDetails.stories.js → PaymentDetails.oldstories.js} +0 -0
  209. /package/src/components/molecules/payment-form-ach/{PaymentFormACH.stories.js → PaymentFormACH.oldstories.js} +0 -0
  210. /package/src/components/molecules/payment-form-card/{PaymentFormCard.stories.js → PaymentFormCard.oldstories.js} +0 -0
  211. /package/src/components/molecules/periscope-dashboard-iframe/{PeriscopeDashBoardIframe.stories.js → PeriscopeDashBoardIframe.oldstories.js} +0 -0
  212. /package/src/components/molecules/phone-form/{PhoneForm.stories.js → PhoneForm.oldstories.js} +0 -0
  213. /package/src/components/molecules/popup-menu/{PopupMenu.stories.js → PopupMenu.oldstories.js} +0 -0
  214. /package/src/components/molecules/radio-group/{RadioGroup.stories.js → RadioGroup.oldstories.js} +0 -0
  215. /package/src/components/molecules/radio-section/{RadioSection.stories.js → RadioSection.oldstories.js} +0 -0
  216. /package/src/components/molecules/registration-form/{RegistrationForm.stories.js → RegistrationForm.oldstories.js} +0 -0
  217. /package/src/components/molecules/reset-confirmation-form/{ResetConfirmationForm.stories.js → ResetConfirmationForm.oldstories.js} +0 -0
  218. /package/src/components/molecules/reset-password-form/{ResetPasswordForm.stories.js → ResetPasswordForm.oldstories.js} +0 -0
  219. /package/src/components/molecules/reset-password-success/{ResetPasswordSuccess.stories.js → ResetPasswordSuccess.oldstories.js} +0 -0
  220. /package/src/components/molecules/tab-sidebar/{TabSidebar.stories.js → TabSidebar.oldstories.js} +0 -0
  221. /package/src/components/molecules/terms-and-conditions/{TermsAndConditions.stories.js → TermsAndConditions.oldstories.js} +0 -0
  222. /package/src/components/molecules/terms-and-conditions-modal/{TermsAndConditionsModal.stories.js → TermsAndConditionsModal.oldstories.js} +0 -0
  223. /package/src/components/molecules/workflow-tile/{WorkflowTile.stories.js → WorkflowTile.oldstories.js} +0 -0
@@ -0,0 +1,460 @@
1
+ import React from "react";
2
+ import Obligation from "./Obligation";
3
+ import { fn } from "@storybook/test";
4
+ import { Box } from "../../atoms/layouts";
5
+
6
+ const meta = {
7
+ title: "Molecules/Obligation",
8
+ component: Obligation,
9
+ parameters: {
10
+ layout: "centered"
11
+ },
12
+ tags: ["!autodocs"],
13
+ args: {
14
+ config: undefined,
15
+ obligations: undefined,
16
+ actions: undefined,
17
+ autoPayEnabled: false,
18
+ autoPayAvailable: false,
19
+ handleAutopayAction: fn(),
20
+ deactivatePaymentSchedule: fn(),
21
+ autoPaySchedule: undefined,
22
+ paymentPlanSchedule: undefined,
23
+ navigateToSettings: fn(),
24
+ isPaymentPlan: false,
25
+ nextAutopayDate: undefined,
26
+ obligationAssocID: undefined,
27
+ dueDate: undefined,
28
+ agencyName: undefined,
29
+ inactive: false,
30
+ inactiveLookupTitle: "",
31
+ inactiveLookupInput: "Account",
32
+ inactiveLookupValue: "",
33
+ isInCustomerManagement: false
34
+ },
35
+ argTypes: {
36
+ config: {
37
+ description:
38
+ "Config object that helps set icons and description/subdescription for obligation. Retrieved from FCS.",
39
+ table: {
40
+ type: { summary: "object" },
41
+ defaultValue: { summary: undefined }
42
+ }
43
+ },
44
+ obligations: {
45
+ description: "Array of obligation objects",
46
+ table: {
47
+ type: { summary: "array" },
48
+ defaultValue: { summary: undefined }
49
+ }
50
+ },
51
+ actions: {
52
+ description:
53
+ "Collection of profile-specific Redux actions that are used by the PaymentDetails submodule",
54
+ table: {
55
+ type: { summary: "object" },
56
+ defaultValue: { summary: undefined }
57
+ }
58
+ },
59
+ autoPayEnabled: {
60
+ description: "Whether the obligation is currently set up for autopay",
61
+ table: {
62
+ type: { summary: "boolean" },
63
+ defaultValue: { summary: false }
64
+ }
65
+ },
66
+ autoPayAvailable: {
67
+ description: "Whether the obligation supports autopay",
68
+ table: {
69
+ type: { summary: "boolean" },
70
+ defaultValue: { summary: false }
71
+ }
72
+ },
73
+ handleAutopayAction: {
74
+ description: "Function run when user toggles autoapy button",
75
+ table: {
76
+ type: { summary: "function" },
77
+ defaultValue: { summary: undefined }
78
+ }
79
+ },
80
+ deactivatePaymentSchedule: {
81
+ description: "Function run when user disabled autopay",
82
+ table: {
83
+ type: { summary: "function" },
84
+ defaultValue: { summary: undefined }
85
+ }
86
+ },
87
+ autoPaySchedule: {
88
+ description: "Schedule object for autopay",
89
+ table: {
90
+ type: { summary: "object" },
91
+ defaultValue: { summary: undefined }
92
+ }
93
+ },
94
+ paymentPlanSchedule: {
95
+ description: "Schedule object for payment plan. Currently unused.",
96
+ table: {
97
+ type: { summary: "object" },
98
+ defaultValue: { summary: undefined }
99
+ }
100
+ },
101
+ navigateToSettings: {
102
+ description:
103
+ "Function that navigates a user to the settings page on the profile",
104
+ table: {
105
+ type: { summary: "function" },
106
+ defaultValue: { summary: undefined }
107
+ }
108
+ },
109
+ isPaymentPlan: {
110
+ description:
111
+ "Whether the obligation is a payment plan type. Currently unused.",
112
+ table: {
113
+ type: { summary: "boolean" },
114
+ defaultValue: { summary: false }
115
+ }
116
+ },
117
+ nextAutopayDate: {
118
+ description: "The date the next autopay will run",
119
+ table: {
120
+ type: { summary: "string" },
121
+ defaultValue: { summary: undefined }
122
+ }
123
+ },
124
+ obligationAssocID: {
125
+ description:
126
+ "The ID of the payment schedule associated with this obligation",
127
+ table: {
128
+ type: { summary: "string" },
129
+ defaultValue: { summary: undefined }
130
+ }
131
+ },
132
+ agencyName: {
133
+ description:
134
+ "The name of the agency for this obligation. Used to populate inactive obligation descriptions.",
135
+ table: {
136
+ type: { summary: "string" },
137
+ defaultValue: { summary: undefined }
138
+ }
139
+ },
140
+ inactive: {
141
+ description: "Whether the obligation is in an inactive state.",
142
+ table: {
143
+ type: { summary: "boolean" },
144
+ defaultValue: { summary: false }
145
+ }
146
+ },
147
+ inactiveLookupTitle: {
148
+ description: "String used in the description of an inactive obligation",
149
+ table: {
150
+ type: { summary: "string" },
151
+ defaultValue: { summary: "" }
152
+ }
153
+ },
154
+ inactiveLookupInput: {
155
+ description: "Type of obligation, used for inactive obligations",
156
+ table: {
157
+ type: { summary: "string" },
158
+ defaultValue: { summary: "Account" }
159
+ }
160
+ },
161
+ inactiveLookupValue: {
162
+ description:
163
+ "Account number or other information returned from lookup for inactive obligations",
164
+ table: {
165
+ type: { summary: "string" },
166
+ defaultValue: { summary: undefined }
167
+ }
168
+ },
169
+ isInCustomerManagement: {
170
+ description:
171
+ "Whether the user is a customer management user impersonating a profile. If true, certain controls are disabled.",
172
+ table: {
173
+ type: { summary: "boolean" },
174
+ defaultValue: { summary: false }
175
+ }
176
+ }
177
+ }
178
+ };
179
+
180
+ export default meta;
181
+
182
+ const obligationConfig = {
183
+ amountValue: "amountDue",
184
+ collection: true,
185
+ description: "Cityville Water Management",
186
+ details: {
187
+ collectionDetails: {
188
+ City: "city",
189
+ State: "state",
190
+ "Street Address": "street_address_line_1",
191
+ "Zip Code": "zip_code"
192
+ },
193
+ collectionDetailsList: [
194
+ {
195
+ attribute: "name",
196
+ label: "Name"
197
+ },
198
+ {
199
+ attribute: "street_address_line_1",
200
+ label: "Street Address"
201
+ },
202
+ {
203
+ attribute: "city",
204
+ label: "City"
205
+ },
206
+ {
207
+ attribute: "state",
208
+ label: "State"
209
+ },
210
+ {
211
+ attribute: "zip_code",
212
+ label: "Zip Code"
213
+ }
214
+ ],
215
+ description: "Cityville Water Management",
216
+ obligationDetails: {
217
+ Account: "account_number",
218
+ Owner: "account_owner",
219
+ Status: "status",
220
+ "Utility Type": "utility_type"
221
+ },
222
+ subDescription: ["Account", "%account_number%"]
223
+ },
224
+ displayName: "Office of Water Management",
225
+ hasPaperlessBilling: true,
226
+ icon: [
227
+ "ACCOUNTS_UTILITY_ELECTRIC",
228
+ "ACCOUNTS_UTILITY_GAS",
229
+ "ACCOUNTS_UTILITY_GARBAGE",
230
+ "ACCOUNTS_UTILITY_WATER"
231
+ ],
232
+ iconDefault: "ACCOUNTS_UTILITY_WATER",
233
+ iconMap: {
234
+ Water: "ACCOUNTS_UTILITY_WATER"
235
+ },
236
+ iconValue: "utility_type",
237
+ obligationSlug: "cityville-water",
238
+ paperlessBilling: {
239
+ confirmationContent: "",
240
+ infoContent: ""
241
+ },
242
+ paymentAttributes: {
243
+ accountId: "account_number",
244
+ amount: "amountDue",
245
+ customAttributes: {
246
+ account_city: "account_city",
247
+ account_number: "account_number",
248
+ account_owner: "account_owner",
249
+ account_street_address: "account_street_address",
250
+ account_zip_code: "account_zip_code",
251
+ utility_type: "utility_type"
252
+ },
253
+ description: ["Account", "%account_number%"],
254
+ subDescription: ["%account_owner%"]
255
+ },
256
+ subDescription: ["Account", "%account_number%"],
257
+ type: "ACCOUNT"
258
+ };
259
+
260
+ export const ActiveObligation = {
261
+ args: {
262
+ config: obligationConfig,
263
+ obligations: [
264
+ {
265
+ allowedPaymentInstruments: ["CASH", "CREDIT_CARD", "BANK_ACCOUNT"],
266
+ amountDue: 5438,
267
+ customAttributes: {
268
+ account_number: "1006",
269
+ city: "Cityville",
270
+ client_slug: "Cityville",
271
+ customer_name: "Shadout Mapes",
272
+ due_date: "2024-09-01T12:00:00",
273
+ invoice_number: "101006.0",
274
+ line_item_description: "Shadout Mapes",
275
+ line_item_sub_description: "1006",
276
+ name: "Shadout Mapes",
277
+ service_type: "water",
278
+ state: "North Carolina",
279
+ street_address_line_1: "23145 O'Hara Wells",
280
+ sub_client_slug: "cityville-water",
281
+ total_due_amount: "5438.0",
282
+ utility_type: "water",
283
+ zip_code: "79221"
284
+ },
285
+ id: "1006",
286
+ kind: "FEE",
287
+ description: "Cityville Water Management",
288
+ subDescription: "Account: 1006",
289
+ amountValue: 5438,
290
+ details: {
291
+ description: "Cityville Water Management",
292
+ subDescription: "Account: 1006"
293
+ },
294
+ paymentAttributes: {
295
+ description: "Account: 1006",
296
+ subDescription: "",
297
+ amount: 5438
298
+ }
299
+ }
300
+ ],
301
+ actions: {
302
+ createPaymentFromProfile: fn(),
303
+ setDetailedObligation: fn(),
304
+ navigateToDetailedObligation: fn(),
305
+ deleteObligationAssoc: fn()
306
+ },
307
+ autoPayEnabled: true,
308
+ autoPayAvailable: true,
309
+ handleAutopayAction: fn(),
310
+ navigateToSettings: fn(),
311
+ deactivatePaymentSchedule: fn(),
312
+ isMobile: false,
313
+ nextAutopayDate: "On",
314
+ obligationAssocID: "046d66b9-5cea-4ccf-895a-97f21f314b72",
315
+ dueDate: "2024-09-01",
316
+ agencyName: "Water",
317
+ isInCustomerManagement: false
318
+ },
319
+ render: args => (
320
+ <Box minWidth="800px">
321
+ <Obligation {...args} />
322
+ </Box>
323
+ )
324
+ };
325
+
326
+ export const InactiveObligation = {
327
+ args: {
328
+ config: { ...obligationConfig, icon: "ACCOUNTS_HEALTH" },
329
+ obligations: [
330
+ {
331
+ allowedPaymentInstruments: ["CASH", "CREDIT_CARD", "BANK_ACCOUNT"],
332
+ amountDue: 5438,
333
+ customAttributes: {
334
+ account_number: "1006",
335
+ city: "Cityville",
336
+ client_slug: "Cityville",
337
+ customer_name: "Shadout Mapes",
338
+ due_date: "2024-09-01T12:00:00",
339
+ invoice_number: "101006.0",
340
+ line_item_description: "Shadout Mapes",
341
+ line_item_sub_description: "1006",
342
+ name: "Shadout Mapes",
343
+ service_type: "water",
344
+ state: "North Carolina",
345
+ street_address_line_1: "23145 O'Hara Wells",
346
+ sub_client_slug: "cityville-water",
347
+ total_due_amount: "5438.0",
348
+ utility_type: "water",
349
+ zip_code: "79221"
350
+ },
351
+ id: "1006",
352
+ kind: "FEE",
353
+ description: "Cityville Water Management",
354
+ subDescription: "Account: 1006",
355
+ amountValue: 5438,
356
+ details: {
357
+ description: "Cityville Water Management",
358
+ subDescription: "Account: 1006"
359
+ },
360
+ paymentAttributes: {
361
+ description: "Account: 1006",
362
+ subDescription: "",
363
+ amount: 5438
364
+ }
365
+ }
366
+ ],
367
+ actions: {
368
+ createPaymentFromProfile: fn(),
369
+ setDetailedObligation: fn(),
370
+ navigateToDetailedObligation: fn(),
371
+ deleteObligationAssoc: fn()
372
+ },
373
+ autoPayEnabled: false,
374
+ autoPayAvailable: true,
375
+ handleAutopayAction: fn(),
376
+ navigateToSettings: fn(),
377
+ deactivatePaymentSchedule: fn(),
378
+ isMobile: false,
379
+ nextAutopayDate: "",
380
+ obligationAssocID: "046d66b9-5cea-4ccf-895a-97f21f314b72",
381
+ dueDate: "2024-09-01",
382
+ agencyName: "Health Service System",
383
+ isInCustomerManagement: false,
384
+ inactive: true,
385
+ inactiveLookupInput: undefined,
386
+ inactiveLookupTitle: "Health Service System",
387
+ inactiveLookupValue: "012856"
388
+ },
389
+ render: args => (
390
+ <Box minWidth="800px">
391
+ <Obligation {...args} />
392
+ </Box>
393
+ )
394
+ };
395
+
396
+ export const CustomerManagementObligation = {
397
+ args: {
398
+ config: obligationConfig,
399
+ obligations: [
400
+ {
401
+ allowedPaymentInstruments: ["CASH", "CREDIT_CARD", "BANK_ACCOUNT"],
402
+ amountDue: 5438,
403
+ customAttributes: {
404
+ account_number: "1006",
405
+ city: "Cityville",
406
+ client_slug: "Cityville",
407
+ customer_name: "Shadout Mapes",
408
+ due_date: "2024-09-01T12:00:00",
409
+ invoice_number: "101006.0",
410
+ line_item_description: "Shadout Mapes",
411
+ line_item_sub_description: "1006",
412
+ name: "Shadout Mapes",
413
+ service_type: "water",
414
+ state: "North Carolina",
415
+ street_address_line_1: "23145 O'Hara Wells",
416
+ sub_client_slug: "cityville-water",
417
+ total_due_amount: "5438.0",
418
+ utility_type: "water",
419
+ zip_code: "79221"
420
+ },
421
+ id: "1006",
422
+ kind: "FEE",
423
+ description: "Cityville Water Management",
424
+ subDescription: "Account: 1006",
425
+ amountValue: 5438,
426
+ details: {
427
+ description: "Cityville Water Management",
428
+ subDescription: "Account: 1006"
429
+ },
430
+ paymentAttributes: {
431
+ description: "Account: 1006",
432
+ subDescription: "",
433
+ amount: 5438
434
+ }
435
+ }
436
+ ],
437
+ actions: {
438
+ createPaymentFromProfile: fn(),
439
+ setDetailedObligation: fn(),
440
+ navigateToDetailedObligation: fn(),
441
+ deleteObligationAssoc: fn()
442
+ },
443
+ autoPayEnabled: false,
444
+ autoPayAvailable: true,
445
+ handleAutopayAction: fn(),
446
+ navigateToSettings: fn(),
447
+ deactivatePaymentSchedule: fn(),
448
+ isMobile: false,
449
+ nextAutopayDate: "",
450
+ obligationAssocID: "046d66b9-5cea-4ccf-895a-97f21f314b72",
451
+ dueDate: "2024-09-01",
452
+ agencyName: "Water",
453
+ isInCustomerManagement: true
454
+ },
455
+ render: args => (
456
+ <Box minWidth="800px">
457
+ <Obligation {...args} />
458
+ </Box>
459
+ )
460
+ };
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
 
3
- const PropertyBusinessIcon = () => (
3
+ const PropertyPersonalIcon = () => (
4
4
  <svg
5
5
  width="48"
6
6
  height="48"
@@ -0,0 +1,15 @@
1
+ import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
+
3
+ import * as PaginationStories from './Pagination.stories.js';
4
+
5
+ <Meta of={PaginationStories} />
6
+
7
+ <Title />
8
+
9
+ Pagination renders a control panel that can be used to interact with paginated tables of data. The component takes some props to customize the look of the controls, as well as callback functions to run when a user interacts with the previous, next, and numerical page buttons. The Pagination component should also be supplied with a number to indicate the current page the user is on as well as the total number of pages.
10
+
11
+ <Controls />
12
+
13
+ <div style={{ marginBottom: "2em"}}>
14
+ <Story />
15
+ </div>
@@ -1,32 +1,181 @@
1
- import React from "react";
2
- import { number, text } from "@storybook/addon-knobs";
1
+ import React, { useState } from "react";
2
+ import { WHITE, GHOST_GREY } from "../../../constants/colors";
3
+ import { Box } from "../../atoms/layouts";
3
4
  import Pagination from "./Pagination";
4
- import page from "../../../../.storybook/page";
5
+ import { fn } from "@storybook/test";
6
+ import { FONT_WEIGHT_SEMIBOLD } from "../../../constants/style_constants";
5
7
 
6
- export const pagination = () => (
7
- <Pagination
8
- activeBorderWidth={text("activeBorderWidth", "3px", "props")}
9
- ariaLabel={text("ariaLabel", "Aria Label", "props")}
10
- arrowColor={text("arrowColor", "#FFFFFF", "props")}
11
- borderRadius={text("borderRadius", "3px", "props")}
12
- buttonHeight={text("buttonHeight", "44px", "props")}
13
- buttonWidth={text("buttonWidth", "44px", "props")}
14
- childGap={text("childGap", "24px", "props")}
15
- currentPage={number("currentPage", 2)}
16
- fontSize={text("fontSize", "17px", "props")}
17
- fontWeight={text("fontWeight", "900", "props")}
18
- numberColor={text("numberColor", "#15749D", "props")}
19
- pageCount={number("pageCount", 3)}
20
- pageNext={() => {}}
21
- pagePrevious={() => {}}
22
- setCurrentPage={() => {}}
23
- // themeValues
24
- />
25
- );
8
+ const meta = {
9
+ title: "Molecules/Pagination",
10
+ component: Pagination,
11
+ parameters: {
12
+ layout: "centered"
13
+ },
14
+ tags: ["!autodocs"],
15
+ args: {
16
+ activeBorderWidth: "3px",
17
+ ariaLabel: undefined,
18
+ arrowColor: undefined,
19
+ borderRadius: "3px",
20
+ buttonHeight: "44px",
21
+ buttonWidth: "44px",
22
+ childGap: "24px",
23
+ currentPage: undefined,
24
+ fontSize: "17px",
25
+ fontWeight: "900",
26
+ numberColor: undefined,
27
+ pageCount: undefined,
28
+ pageNext: fn(),
29
+ pagePrevious: fn(),
30
+ setCurrentPage: fn()
31
+ },
32
+ argTypes: {
33
+ activeBorderWidth: {
34
+ description: "The width of the border around the active page number",
35
+ table: {
36
+ type: { summary: "string" },
37
+ defaultValue: { summary: "3px" }
38
+ }
39
+ },
40
+ ariaLabel: {
41
+ description: "aria-label value for pagination container",
42
+ table: {
43
+ type: { summary: "string" },
44
+ defaultValue: { summary: undefined }
45
+ }
46
+ },
47
+ arrowColor: {
48
+ description:
49
+ "Override for arrow color, if undefined component uses themed values",
50
+ table: {
51
+ type: { summary: "string" },
52
+ defaultValue: { summary: undefined }
53
+ }
54
+ },
55
+ borderRadius: {
56
+ description: "Border radius of the border around pagination controls",
57
+ table: {
58
+ type: { summary: "string" },
59
+ defaultValue: { summary: "3px" }
60
+ }
61
+ },
62
+ buttonHeight: {
63
+ description: "Height of pagination buttons",
64
+ table: {
65
+ type: { summary: "string" },
66
+ defaultValue: { summary: "44px" }
67
+ }
68
+ },
69
+ buttonWidth: {
70
+ description: "Width of pagination buttons",
71
+ table: {
72
+ type: { summary: "string" },
73
+ defaultValue: { summary: "44px" }
74
+ }
75
+ },
76
+ childGap: {
77
+ description: "Gap between pagination buttons",
78
+ table: {
79
+ type: { summary: "string" },
80
+ defaultValue: { summary: "24px" }
81
+ }
82
+ },
83
+ currentPage: {
84
+ description: "Current active page",
85
+ table: {
86
+ type: { summary: "number" },
87
+ defaultValue: { summary: undefined }
88
+ }
89
+ },
90
+ fontSize: {
91
+ descripton: "Font size of page buttons",
92
+ table: {
93
+ type: { summary: "string" },
94
+ defaultValue: { summary: "17px" }
95
+ }
96
+ },
97
+ fontWeight: {
98
+ description: "Font weight of page buttons",
99
+ table: {
100
+ type: { summary: "string" },
101
+ defaultValue: { summary: "900" }
102
+ }
103
+ },
104
+ numberColor: {
105
+ description:
106
+ "Override for color of pagination number buttons, if undefined will use themed values",
107
+ table: {
108
+ type: { summary: "string" },
109
+ defaultValue: { summary: undefined }
110
+ }
111
+ },
112
+ pageCount: {
113
+ description: "Total number of pages",
114
+ table: {
115
+ type: { summary: "number" },
116
+ defaultValue: { summary: undefined }
117
+ }
118
+ },
119
+ pageNext: {
120
+ description: "Function to call when next button is clicked",
121
+ table: {
122
+ type: { summary: "function" },
123
+ defaultValue: { summary: undefined }
124
+ }
125
+ },
126
+ pagePrevious: {
127
+ description: "Function to call when previous button is clicked",
128
+ table: {
129
+ type: { summary: "function" },
130
+ defaultValue: { summary: undefined }
131
+ }
132
+ },
133
+ setCurrentPage: {
134
+ description: "Function to call when user selects a numerical page button",
135
+ table: {
136
+ type: { summary: "function" },
137
+ defaultValue: { summary: undefined }
138
+ }
139
+ }
140
+ }
141
+ };
26
142
 
27
- const story = page({
28
- title: "Components|Molecules/Pagination",
29
- Component: Pagination
30
- });
143
+ export default meta;
31
144
 
32
- export default story;
145
+ export const BasicPagination = {
146
+ args: {
147
+ activeBorderWidth: "3px",
148
+ childGap: "24px",
149
+ borderRadius: "4px",
150
+ fontSize: "14px",
151
+ buttonHeight: "44px",
152
+ buttonWidth: "44px",
153
+ fontWeight: FONT_WEIGHT_SEMIBOLD,
154
+ pageCount: 12,
155
+ ariaLabel: "Pagination"
156
+ },
157
+ render: args => {
158
+ const [currentPage, setCurrentPage] = useState(5);
159
+
160
+ return (
161
+ <Box
162
+ background={WHITE}
163
+ borderRadius="4px"
164
+ boxShadow={`0px 0px 5px 0px ${GHOST_GREY}`}
165
+ padding={"24px"}
166
+ >
167
+ <Pagination
168
+ {...args}
169
+ currentPage={currentPage}
170
+ pageNext={() =>
171
+ currentPage < 12 ? setCurrentPage(currentPage + 1) : fn()
172
+ }
173
+ pagePrevious={() =>
174
+ currentPage > 1 ? setCurrentPage(currentPage - 1) : fn()
175
+ }
176
+ setCurrentPage={page => setCurrentPage(page.pageNumber)}
177
+ />
178
+ </Box>
179
+ );
180
+ }
181
+ };