@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,360 +0,0 @@
1
- import React from "react";
2
- import { MANATEE_GREY } from "../../../constants/colors";
3
- import { Box, Stack, Cluster } from "../layouts";
4
- import Card from "./Card";
5
- import ButtonWithAction from "../button-with-action/ButtonWithAction";
6
- import ButtonWithLink from "../button-with-link/ButtonWithLink";
7
- import Badge from "../badge/Badge";
8
- import AutopayOnIcon from "../icons/AutopayOnIcon";
9
- import FormattedCreditCard from "../formatted-credit-card/FormattedCreditCard";
10
- import FormattedAddress from "../formatted-address/FormattedAddress";
11
- import Detail from "../detail/Detail";
12
- import WalletBannerIcon from "../icons/WalletBannerIcon";
13
- import { fn } from "@storybook/test";
14
- import { noop } from "../../../util/general";
15
-
16
- const meta = {
17
- title: "Atoms/Card",
18
- component: Card,
19
- parameters: {
20
- layout: "centered"
21
- },
22
- tags: ["!autodocs"],
23
- args: {
24
- borderRadius: "4px",
25
- hasContentBackgroundColor: undefined,
26
- headerAs: "h2",
27
- headerText: "Register a Dog",
28
- headerVariant: "small",
29
- imgSrc: undefined,
30
- Image: undefined,
31
- imgHeight: "150px",
32
- imgObjectFit: "none",
33
- imgAltText: undefined,
34
- onQuitClick: fn(),
35
- padding: "24px",
36
- showQuitLink: undefined,
37
- text: undefined,
38
- titleAs: "h2",
39
- titleText: undefined,
40
- titleVariant: "small",
41
- width: "276px",
42
- extraStyles: undefined,
43
- children: undefined
44
- },
45
- argTypes: {
46
- borderRadius: {
47
- description: "The radius value for the Card's border",
48
- table: {
49
- type: { summary: "string" },
50
- defaultValue: { summary: "4px" }
51
- }
52
- },
53
- hasContentBackgroundColor: {
54
- description: "Whether or not the content should have a background color",
55
- table: {
56
- type: { summary: "boolean" },
57
- defaultValue: { summary: false }
58
- }
59
- },
60
- headerAs: {
61
- description: "The HTML element to use for the Card's header",
62
- table: {
63
- type: { summary: "string" },
64
- defaultValue: { summary: "h2" }
65
- }
66
- },
67
- headerText: {
68
- description: "The text used in the Card's header",
69
- table: {
70
- type: { summary: "string" },
71
- defaultValue: { summary: undefined }
72
- }
73
- },
74
- headerVariant: {
75
- description:
76
- "The variant used for the embedded <Title /> component. Independent of specified HTML element, sets font size and line height.",
77
- table: {
78
- type: { summary: "string" },
79
- defaultValue: { summary: "small" }
80
- }
81
- },
82
- imgSrc: {
83
- description: "URL to use for Card image",
84
- table: {
85
- type: { summary: "string" },
86
- defaultValue: { summary: undefined }
87
- }
88
- },
89
- Image: {
90
- description: "React Image component to use for Card's image",
91
- table: {
92
- type: { summary: "React Component" },
93
- defaultValue: { summary: undefined }
94
- }
95
- },
96
- imgObjectFit: {
97
- description: "CSS value for the object-fit property",
98
- table: {
99
- type: { summary: "string" },
100
- defaultValue: { summary: "none" }
101
- }
102
- },
103
- imgAltText: {
104
- description: "Alt text to include with image",
105
- table: {
106
- type: { summary: "string" },
107
- defaultValue: { summary: undefined }
108
- }
109
- },
110
- padding: {
111
- descripton: "Card's inner padding value",
112
- table: {
113
- type: { summary: "string" },
114
- defaultValue: { summary: "24px" }
115
- }
116
- },
117
- textAs: {
118
- description:
119
- "The HTML element to use for the Card's <Paragraph /> Component. This may need to be something other than 'p' when text is being rendered as children.",
120
- table: {
121
- type: { summary: "string" },
122
- defaultValue: { summary: "p" }
123
- }
124
- },
125
- text: {
126
- description: "Body text of the card",
127
- table: {
128
- type: { summary: "string" },
129
- defaultValue: { summary: undefined }
130
- }
131
- },
132
- titleText: {
133
- description: "Text for the title of the card",
134
- table: {
135
- type: { summary: "string" },
136
- defaultValue: { summary: undefined }
137
- }
138
- },
139
- titleAs: {
140
- description: "The HTML element to use for the Card's title",
141
- table: {
142
- type: { summary: "string" },
143
- defaultValue: { summary: "h2" }
144
- }
145
- },
146
- titleVariant: {
147
- description:
148
- "Variant for the <Title /> component used in the Card's title text",
149
- table: {
150
- type: { summary: "string" },
151
- defaultValue: { summary: "small" }
152
- }
153
- },
154
- width: {
155
- description: "The width of the Card in px",
156
- table: {
157
- type: { summary: "string" },
158
- defaultValue: { summary: "276px" }
159
- }
160
- },
161
- extraStyles: {
162
- description: "Supplemental CSS",
163
- table: {
164
- type: { summary: "string" },
165
- defaultValue: { summary: undefined }
166
- }
167
- },
168
- children: {
169
- description:
170
- "Custom react components to display below the Card's text like buttons, links, or tags",
171
- table: {
172
- type: { summary: "React Component" },
173
- defaultValue: { summary: undefined }
174
- }
175
- },
176
- onQuitClick: {
177
- description:
178
- "Function called when the quit/dismiss card button is used. The consuming application will handle the render logic based on this.",
179
- control: { type: "object" },
180
- table: {
181
- type: { summary: "function" },
182
- defaultValue: { summary: noop }
183
- }
184
- },
185
- showQuitLink: {
186
- description: "Whether or not the Card is dismissable",
187
- table: {
188
- type: { summary: "boolean" },
189
- defaultValue: { summary: false }
190
- }
191
- }
192
- }
193
- };
194
-
195
- export default meta;
196
-
197
- export const BasicCard = {
198
- args: {
199
- titleText: "Pay Dog Registration Fee",
200
- text:
201
- "Cityville requires new dog owners to register their pet with Cityville Animal Control. The fee for a new dog is $150, payable by credit or debit card.",
202
- extraStyles: `& { max-width: 450px }; & > div > div > div { flex-direction: column; margin: 0;};`
203
- }
204
- };
205
-
206
- export const BasicCardWithChildren = {
207
- args: {
208
- titleText: "Pay Dog Registration Fee",
209
- text:
210
- "Cityville requires new dog owners to register their pet with Cityville Animal Control. The fee for a new dog is $150, payable by credit or debit card.",
211
- children: (
212
- <Box
213
- padding="16px 24px 16px 16px"
214
- border={`1px solid ${MANATEE_GREY}`}
215
- borderWidthOverride="1px 0 0 0"
216
- >
217
- <Cluster justify="space-between" align="center">
218
- <ButtonWithAction text="Register" variant="secondary" />
219
- <Badge variant="info" label="Animal Control" id="basic-card-badge" />
220
- </Cluster>
221
- </Box>
222
- ),
223
- extraStyles: `& { max-width: 450px }; & > div > div > div { flex-direction: column; margin: 0;}; #basic-card-badge { align-self: unset; }`
224
- }
225
- };
226
-
227
- export const BasicImageCard = {
228
- args: {
229
- headerText: "Join Cityville Wallet",
230
- titleText: "Sign up for Cityville Wallet Today!",
231
- text:
232
- "Cityville Wallet makes it convenient to save your payment methods, billing addresses, and contact information. Use Cityville Wallet to enable one-click payment of all of your accounts today!",
233
- Image: () => <WalletBannerIcon />,
234
- imgAltText: "Cityville Wallet icon",
235
- padding: "16px",
236
- width: "800px",
237
- extraStyles: `& div { margin: 0;}; & { max-width: 800px; }`
238
- }
239
- };
240
-
241
- export const ImageCard = {
242
- args: {
243
- headerText: "Purchase Transit Card",
244
- imgSrc:
245
- "https://upload.wikimedia.org/wikipedia/commons/thumb/a/ad/Chicago_Transit_Authority_Logo.svg/300px-Chicago_Transit_Authority_Logo.svg.png",
246
- imgObjectFit: "contain",
247
- imgAltText: "Chicago Transit Authority Portal",
248
- padding: "16px",
249
- children: (
250
- <Box
251
- padding="16px 24px 16px 16px"
252
- border={`1px solid ${MANATEE_GREY}`}
253
- borderWidthOverride="1px 0 0 0"
254
- >
255
- <Cluster justify="space-between" align="center">
256
- <ButtonWithAction text="Buy Card" variant="secondary" />
257
- <Badge id="image-card-badge" variant="info" label="Transportation" />
258
- </Cluster>
259
- </Box>
260
- ),
261
- width: "375px",
262
- extraStyles: `& { max-width: 375px }; & > div > div > div { flex-direction: column; margin: 0;}; #image-card-badge { align-self: unset; }`
263
- }
264
- };
265
-
266
- const cardExpireMonth = new Date().getMonth() + 2;
267
- const cardExpireYear = new Date().getFullYear();
268
- const formattedMonth = cardExpireMonth === 13 ? 1 : cardExpireMonth;
269
- const formattedYear =
270
- cardExpireMonth === 13 ? cardExpireYear + 1 : cardExpireYear;
271
-
272
- export const CustomContentCard = {
273
- args: {
274
- headerText: undefined,
275
- children: (
276
- <Box padding="0">
277
- <Stack childGap="0">
278
- <Box
279
- padding="1rem"
280
- border={`1px solid ${MANATEE_GREY}`}
281
- borderWidthOverride="0 0 1px 0"
282
- >
283
- <Cluster justify="flext-start" align="center" childGap="1rem">
284
- <Badge
285
- variant="success"
286
- label="Autopay On"
287
- Icon={() => <AutopayOnIcon />}
288
- />
289
- <Badge variant="warn" label="Expiring Soon" />
290
- </Cluster>
291
- </Box>
292
- <Box
293
- padding="1rem"
294
- border={`1px solid ${MANATEE_GREY}`}
295
- borderWidthOverride="0 0 1px 0"
296
- >
297
- <Stack childGap="1rem">
298
- <Detail as="h3" weight="600">
299
- Payment Method:
300
- </Detail>
301
- <FormattedCreditCard
302
- expireDate={`${formattedMonth}/${formattedYear}`}
303
- expirationStatus="EXPIRING SOON"
304
- lastFour="9872"
305
- />
306
- </Stack>
307
- </Box>
308
- <Box padding="1rem">
309
- <Stack childGap="1rem">
310
- <Detail as="h3" weight="600">
311
- Billing Address:
312
- </Detail>
313
- <FormattedAddress
314
- street1="1600 Pensylvania Avenue NW"
315
- street2="Floor 2"
316
- city="Washington"
317
- stateProvince="D.C."
318
- zip="20500"
319
- />
320
- </Stack>
321
- </Box>
322
- </Stack>
323
- </Box>
324
- )
325
- }
326
- };
327
-
328
- export const DismissableCard = {
329
- args: {
330
- children: (
331
- <Box padding="0 24px 24px">
332
- <ButtonWithLink
333
- extraStyles="border-radius: 4px; margin: 0; flex-basis: 100%; flex-grow: 1;"
334
- url="your-destination-page"
335
- text="Start here by searching for your ambulance bill"
336
- newTab={true}
337
- />
338
- </Box>
339
- ),
340
- hasContentBackgroundColor: true,
341
- headerText: undefined,
342
- showQuitLink: true,
343
- titleAs: "h2",
344
- titleText: "Looking for your ambulance bill?",
345
- text: (
346
- <>
347
- <ol style={{ margin: 0, paddingLeft: 24 }}>
348
- <li>Click the button below</li>
349
- <li>
350
- Search using your ambulance run number and click “Link Account”
351
- </li>
352
- <li>
353
- Your ambulance bill will be displayed on your Active Accounts page
354
- </li>
355
- </ol>
356
- </>
357
- ),
358
- textAs: "div"
359
- }
360
- };
@@ -1,15 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as CheckboxStories from './Checkbox.stories.js';
4
-
5
- <Meta of={CheckboxStories} />
6
-
7
- <Title />
8
-
9
- The Checkbox component uses a visually hidden `input` element with the type `checkbox` to create a styleable and themeable checkbox that is still accessible. The visual checkbox, hidden checkbox, and optional text (set with the `title` prop) are wrapped in a `label` element to allow mouse and keyboard interaction on both the checkbox and the text.
10
-
11
- Checkbox is a "controlled" component, it's checked and error state should be handled by the consuming app and passed down to it via the `checked` and `error` props.
12
-
13
- When the `error` prop is set to `true`, the component will style the checkbox with the supplied theme's error styles, set `aria-invalid` on the hidden input to `true`, and set `aria-describedby` to `${props.name}-error-message`, allowing you to match the error state to a message in an element with matching `id`.
14
-
15
- Note: pressing the `enter` key when the component has focus currently triggers the `onChange` callback function. This does not match standard `<input type="checkbox" />` elements which are toggled with the `spacebar`.
@@ -1,30 +0,0 @@
1
- import React from "react";
2
- import { text, select, boolean } from "@storybook/addon-knobs";
3
- import Checkbox from "./Checkbox";
4
- import page from "../../../../.storybook/page";
5
-
6
- const variantsLabel = "variant";
7
- const variants = {
8
- default: "default"
9
- };
10
- const defaultValue = "default";
11
- const groupId = "props";
12
-
13
- export const checkbox = () => (
14
- <Checkbox
15
- variant={select(variantsLabel, variants, defaultValue, groupId)}
16
- title={text("title", "Checkbox", "props")}
17
- name={text("name", "Checkbox", "props")}
18
- checked={boolean("checked", false, "props")}
19
- error={boolean("error", false, "props")}
20
- disabled={boolean("disabled", false, "props")}
21
- focused={boolean("focused", false, "props")}
22
- labelledById={text("labelledById", undefined, "props")}
23
- />
24
- );
25
-
26
- const story = page({
27
- title: "Components|Atoms/Checkbox",
28
- Component: Checkbox
29
- });
30
- export default story;
@@ -1,36 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as CountryDropdownStories from './CountryDropdown.stories.js';
4
-
5
- <Meta of={CountryDropdownStories} />
6
-
7
- <Title />
8
-
9
- CountryDropdown is a wrapper for [FormSelect](?path=/docs/atoms-formselect--docs) that adds a pre-defined array of countries for options. The country list cannot be modified.
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,32 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as DetailStories from './Detail.stories.js';
4
-
5
- <Meta of={DetailStories} />
6
-
7
- <Title />
8
-
9
-
10
- Detail component is a responsive text component (Block level text elements which are smaller than [Title](?path=/docs/atoms-title--docs) elements).
11
-
12
- Size is decoupled from tag. Comes with four variants - `large`, `regular`, `small`, `extraSmall`:
13
-
14
- - Large variant results in text that is `1.125rem/1.1428rem` (`18px` desktop, `16px` mobile)
15
- - Regular variant results in text that is `1rem` (`16px` desktop, `14px` mobile)
16
- - Small variant reuslts in text that is `0.875rem/0.8571rem` (`14px` desktop, `12px` mobile)
17
- - ExtraSmall variant results in text that is `0.75rem/0.7142rem` (`12px` desktop, `10px` mobile)
18
-
19
- If you need a larger font size, use the [Title atom](?path=/docs/atoms-title--docs), which has larger variants
20
-
21
- 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.
22
-
23
- 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.
24
-
25
- Mobile breakpoint value is specified in `Detail.theme.js`
26
-
27
- If you want to disable mobile text scales (use the same rem scale for desktop/mobile), then use a theme in FCS to set all of the variants to use the same rem sizes. FCS themes override fallbacks defined in the .theme file
28
-
29
-
30
- <Story />
31
-
32
- <Controls />
@@ -1,156 +0,0 @@
1
- import Detail from "./Detail";
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/Detail",
8
- component: Detail,
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: "regular",
22
- as: "p",
23
- dataQa: undefined,
24
- children: "Detail 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` `regular` `small` `extraSmall`",
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
- <Detail {...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
- <Detail {...args} />
136
- </Box>
137
- )
138
- };
139
-
140
- export const LargeVariant = {
141
- args: {
142
- variant: "large"
143
- }
144
- };
145
-
146
- export const SmallVariant = {
147
- args: {
148
- variant: "small"
149
- }
150
- };
151
-
152
- export const ExtraSmallVariant = {
153
- args: {
154
- variant: "extraSmall"
155
- }
156
- };
@@ -1,11 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as DisplayBoxStories from './DisplayBox.stories.js';
4
-
5
- <Meta of={DisplayBoxStories} />
6
-
7
- <Title />
8
-
9
- The DisplayBox uses nested Box components with hardcoded padding and border radius values to create consistent and themeable "boxes" that wrap children with a box shadow. DisplayBox supports an "error" state with a red border via the `showErrors` prop.
10
-
11
- <Story />
@@ -1,13 +0,0 @@
1
- import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
-
3
- import * as DisplayCardStories from './DisplayCard.stories.js';
4
-
5
- <Meta of={DisplayCardStories} />
6
-
7
- <Title />
8
-
9
- The DisplayCard component offers a consistent box style for text content. A link, button, or "help" text is also supported, which will be displayed with the text in a flexbox with any extra space rendered in-between. DisplayCard also supports an optional tooltip with the Popover molecule, and a title.
10
-
11
- Note: DisplyCard is _not_ themeable or styleable except for the Popover box.
12
-
13
- <Story />