@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,163 +1,57 @@
1
1
  import React from "react";
2
+ import { boolean, select, text, number } from "@storybook/addon-knobs";
3
+ import page from "../../../../.storybook/page";
2
4
  import InternalLink from "./InternalLink";
3
5
  import ExternalLink from "./ExternalLink";
6
+ import {
7
+ FONT_WEIGHT_BOLD,
8
+ FONT_WEIGHT_SEMIBOLD,
9
+ FONT_WEIGHT_REGULAR
10
+ } from "../../../constants/style_constants";
11
+ import * as colors from "../../../constants/colors";
4
12
 
5
- const meta = {
6
- title: "Atoms/Link",
7
- component: InternalLink,
8
- parameters: {
9
- layout: "centered"
10
- },
11
- tags: ["!autodocs"],
12
- args: {
13
- to: undefined,
14
- href: undefined,
15
- size: undefined,
16
- weight: undefined,
17
- color: undefined,
18
- lineHeight: undefined,
19
- active: undefined,
20
- fontWeight: undefined,
21
- fontSize: undefined,
22
- margin: undefined,
23
- tabIndex: undefined,
24
- extraStyles: undefined,
25
- dataQa: undefined,
26
- ref: undefined,
27
- ariaLabel: undefined,
28
- newTab: false,
29
- children: undefined
30
- },
31
- argTypes: {
32
- to: {
33
- description: "The destination for an InternalLink like /activities",
34
- table: {
35
- type: { summary: "string" },
36
- defaultValue: { summary: undefined }
37
- }
38
- },
39
- href: {
40
- description:
41
- "The destination for an ExternalLink like www.eunasolutions.com",
42
- table: {
43
- type: { summary: "string" },
44
- defaultValue: { summary: undefined }
45
- }
46
- },
47
- size: {
48
- description: "Font size for an ExternalLink",
49
- table: {
50
- type: { summary: "string" },
51
- defaultValue: { summary: undefined }
52
- }
53
- },
54
- weight: {
55
- description: "Font weight for an ExternalLink",
56
- table: {
57
- type: { summary: "string" },
58
- defaultValue: { summary: undefined }
59
- }
60
- },
61
- fontWeight: {
62
- description: "Font weight for an InternalLink",
63
- table: {
64
- type: { summary: "string" },
65
- defaultValue: { summary: undefined }
66
- }
67
- },
68
- fontSize: {
69
- description: "Font size for an InternalLink",
70
- table: {
71
- type: { summary: "string" },
72
- defaultValue: { summary: undefined }
73
- }
74
- },
75
- color: {
76
- description: "Color value to use for InternalLinks",
77
- table: {
78
- type: { summary: "string" },
79
- defaultValue: { summary: undefined }
80
- }
81
- },
82
- lineHeight: {
83
- description: "Line height for a link",
84
- table: {
85
- type: { summary: "string" },
86
- defaultValue: { summary: undefined }
87
- }
88
- },
89
- active: {
90
- description: "Whether an InternalLink should use active color styling",
91
- table: {
92
- type: { summary: "string" },
93
- defaultValue: { summary: undefined }
94
- }
95
- },
96
- margin: {
97
- description: "Margin to apply to InternalLink element",
98
- table: {
99
- type: { summary: "string" },
100
- defaultValue: { summary: undefined }
101
- }
102
- },
103
- tabIndex: {
104
- description: "Override for tab index value for link",
105
- table: {
106
- type: { summary: "string" },
107
- defaultValue: { summary: undefined }
108
- }
109
- },
110
- extraStyles: {
111
- description: "Optional extra css styles to apply to link",
112
- table: {
113
- type: { summary: "string" },
114
- defaultValue: { summary: undefined }
115
- }
116
- },
117
- dataQa: {
118
- description: "data-qa value to use for E2E testing libraries",
119
- table: {
120
- type: { summary: "string" },
121
- defaultValue: { summary: undefined }
122
- }
123
- },
124
- ariaLabel: {
125
- description: "aria-label value for an ExternalLink",
126
- table: {
127
- type: { summary: "string" },
128
- defaultValue: { summary: undefined }
129
- }
130
- },
131
- newTab: {
132
- description: "Whether an ExternalLink should open in a new browser tab",
133
- table: {
134
- type: { summary: "boolean" },
135
- defaultValue: { summary: false }
136
- }
137
- }
138
- }
13
+ const fontWeights = {
14
+ FONT_WEIGHT_BOLD,
15
+ FONT_WEIGHT_SEMIBOLD,
16
+ FONT_WEIGHT_REGULAR
139
17
  };
140
-
141
- export default meta;
142
-
143
- export const StandardInternalLink = {
144
- render: args => (
145
- <InternalLink {...args}>Cityville Activities Calendar</InternalLink>
146
- ),
147
- args: {
148
- active: false,
149
- to: "/activities-calendar"
150
- }
18
+ const variantsLabel = "variant";
19
+ const variants = {
20
+ primary: "primary",
21
+ secondary: "secondary"
151
22
  };
23
+ const defaultValue = "primary";
24
+ const groupId = "props";
152
25
 
153
- export const StandardExternalLink = {
154
- render: args => <ExternalLink {...args}>Austin City Hall</ExternalLink>
155
- };
26
+ export const internalLink = () => (
27
+ <InternalLink
28
+ variant={select(variantsLabel, variants, defaultValue, groupId)}
29
+ to={text("to", "https://google.com", "props")}
30
+ extraStyles={text("extraStyles", "text-align: center;", "props")}
31
+ margin={number("margin", 0, { min: 0, max: 99 }, "props")}
32
+ fontWeight={select("fontWeight", fontWeights, 400, "props")}
33
+ color={select("color", colors, "black", "props")}
34
+ >
35
+ Internal Link
36
+ </InternalLink>
37
+ );
156
38
 
157
- export const ActiveInternalLink = {
158
- render: args => <InternalLink {...args}>Transaction History</InternalLink>,
159
- args: {
160
- active: "true",
161
- to: "/transaction-history"
162
- }
163
- };
39
+ export const externalLink = () => (
40
+ <ExternalLink
41
+ variant={select(variantsLabel, variants, defaultValue, groupId)}
42
+ href={text("href", "https://google.com", "props")}
43
+ newTab={boolean("newTab", true, "props")}
44
+ extraStyles={text("extraStyles", "text-align: center;", "props")}
45
+ margin={number("margin", 0, { min: 0, max: 99 }, "props")}
46
+ weight={select("weight", fontWeights, 400, "props")}
47
+ color={select("color", colors, "black", "props")}
48
+ >
49
+ External Link
50
+ </ExternalLink>
51
+ );
52
+
53
+ const story = page({
54
+ title: "Components|Atoms/Link",
55
+ Component: InternalLink
56
+ });
57
+ export default story;
@@ -7,19 +7,15 @@ const LoadingLine = ({
7
7
  exactWidth = null,
8
8
  height = "16px",
9
9
  margin = "0px"
10
- }) => {
11
- const calculatedWidth = Math.floor(
12
- Math.random() * (parseInt(maxWidth) - parseInt(minWidth) + 1) +
13
- parseInt(minWidth)
14
- );
15
-
16
- return (
17
- <LoadingPill
18
- margin={margin}
19
- height={height}
20
- width={exactWidth || calculatedWidth}
21
- />
22
- );
23
- };
10
+ }) => (
11
+ <LoadingPill
12
+ margin={margin}
13
+ height={height}
14
+ width={
15
+ exactWidth ||
16
+ Math.floor(Math.random() * (maxWidth - minWidth + 1)) + minWidth
17
+ }
18
+ />
19
+ );
24
20
 
25
21
  export default LoadingLine;
@@ -1,132 +1,28 @@
1
- import LoadingLine from "./LoadingLine";
2
- import { Box, Cluster, Stack } from "../layouts";
3
-
4
- const meta = {
5
- title: "Atoms/LoadingLine",
6
- component: LoadingLine,
7
- parameters: {
8
- layout: "centered",
9
- controls: { expanded: true }
10
- },
11
- tags: ["!autodocs"],
12
- args: {
13
- minWidth: undefined,
14
- maxWidth: undefined,
15
- exactWidth: undefined,
16
- height: "16px",
17
- margin: "0px"
18
- },
19
- argTypes: {
20
- minWidth: {
21
- description:
22
- "The minimum width of the loading pill. Value will be appended with px in styles.",
23
- table: {
24
- type: { summary: "string or number" },
25
- defaultValue: { summary: undefined }
26
- }
27
- },
28
- maxWidth: {
29
- description:
30
- "The maximum width of the loading pill. Value will be appended with px in styles.",
31
- table: {
32
- type: { summary: "string or number" },
33
- defaultValue: { summary: undefined }
34
- }
35
- },
36
- exactWidth: {
37
- description:
38
- "Exact width value for the loading pill. Value will be appended with px in styles.",
39
- table: {
40
- type: { summary: "string or number" },
41
- defaultValue: { summary: undefined }
42
- }
43
- },
44
- height: {
45
- description: "Height of the loading pill",
46
- table: {
47
- type: { summary: "string" },
48
- defaultValue: { summary: "16px" }
49
- }
50
- },
51
- margin: {
52
- description: "Margin value around the pill",
53
- table: {
54
- type: { summary: "string" },
55
- defaultValue: { summary: "0px" }
56
- }
57
- }
58
- }
59
- };
60
-
61
- export default meta;
62
-
63
- export const BasicLoadingLine = {
64
- args: {
65
- minWidth: "350",
66
- maxWidth: "600",
67
- height: "20px"
68
- },
69
- render: args => (
70
- <Box minWidth="325px">
71
- <LoadingLine {...args} />
72
- </Box>
73
- )
74
- };
75
-
76
- export const LoadingLineAsShape = {
77
- args: {
78
- exactWidth: "375",
79
- height: "325px"
80
- },
81
- render: args => (
82
- <Box minWidth="375px">
83
- <LoadingLine {...args} />
84
- </Box>
85
- )
86
- };
87
-
88
- const minWidthFunc = () => Math.random() * 75 + 20;
89
-
90
- const firstLineLength = Array.from({ length: 12 }, minWidthFunc);
91
- const secondLineLength = Array.from({ length: 15 }, minWidthFunc);
92
- const thirdLineLength = Array.from({ length: 8 }, minWidthFunc);
93
- const fourthLineLength = Array.from({ length: 20 }, minWidthFunc);
94
-
95
- const firstLine = firstLineLength.map(item => (
96
- <LoadingLine key={`line-1-${item}`} minWidth={item} maxWidth="150" />
97
- ));
98
-
99
- const secondLine = secondLineLength.map(item => (
100
- <LoadingLine key={`line-2-${item}`} minWidth={item} maxWidth="150" />
101
- ));
102
- const thirdLine = thirdLineLength.map(item => (
103
- <LoadingLine key={`line-3-${item}`} minWidth={item} maxWidth="150" />
104
- ));
105
- const fourthLine = fourthLineLength.map(item => (
106
- <LoadingLine key={`line-4-${item}`} minWidth={item} maxWidth="150" />
107
- ));
108
-
109
- export const LoadingTextContent = {
110
- args: {
111
- height: "12px",
112
- margin: "0px"
113
- },
114
- render: args => (
115
- <Box minWidth="400px" maxWidth="700px" minHeight="500px">
116
- <Stack childGap="0.5rem">
117
- <Cluster childGap="1rem" justify="flex-start" align="center">
118
- {firstLine}
119
- </Cluster>
120
- <Cluster childGap="1rem" justify="flex-start" align="center">
121
- {secondLine}
122
- </Cluster>
123
- <Cluster childGap="1rem" justify="flex-start" align="center">
124
- {thirdLine}
125
- </Cluster>
126
- <Cluster childGap="1rem" justify="flex-start" align="center">
127
- {fourthLine}
128
- </Cluster>
129
- </Stack>
130
- </Box>
131
- )
132
- };
1
+ import React from "react";
2
+ import page from "../../../../.storybook/page";
3
+ import LoadingLine from "../../atoms/loading-line";
4
+
5
+ const numberOfRows = 10;
6
+ const rowWidths = [50, 100, 50, 100, 50];
7
+
8
+ export const loadingLine = () => (
9
+ <table>
10
+ {[...Array(numberOfRows)].map(r => (
11
+ <tr>
12
+ {rowWidths.map(rw => (
13
+ <td>
14
+ <LoadingLine exactWidth={rw} />
15
+ </td>
16
+ ))}
17
+ </tr>
18
+ ))}
19
+ </table>
20
+ );
21
+
22
+ loadingLine.storyName = "Loading Line";
23
+
24
+ const story = page({
25
+ title: "Components|Atoms/LoadingLine",
26
+ Component: LoadingLine
27
+ });
28
+ export default story;
@@ -1,244 +1,31 @@
1
- import NavFooter from "./NavFooter";
2
- import { Box, Cluster, Stack } from "../layouts";
3
- import ButtonWithAction from "../button-with-action";
4
1
  import React from "react";
5
- import { fn } from "@storybook/test";
6
- import ImageBox from "../image-box/ImageBox";
7
- import {
8
- BRIGHT_GREY,
9
- DUSTY_GREY,
10
- ROYAL_BLUE_VIVID,
11
- WHITE
12
- } from "../../../constants/colors";
13
- import { FONT_WEIGHT_SEMIBOLD } from "../../../constants/style_constants";
14
- import ExternalLink from "../link/ExternalLink";
15
- import ExternalLinkIcon from "../icons/ExternalLinkIcon";
16
- import Text from "../text";
17
-
18
- const meta = {
19
- title: "Atoms/NavFooter",
20
- component: NavFooter,
21
- parameters: {
22
- layout: "centered",
23
- controls: { expanded: true }
24
- },
25
- tags: ["!autodocs"],
26
- args: {
27
- leftContent: undefined,
28
- rightContent: undefined,
29
- footerMinHeight: "104px",
30
- largeSide: "right",
31
- largeSideSize: "2",
32
- footerPadding: "1.5rem 1rem",
33
- isMobile: false,
34
- backgroundColor: undefined,
35
- footerWidth: undefined
36
- },
37
- argTypes: {
38
- leftContent: {
39
- description: "Content that appears on the left side of the footer",
40
- table: {
41
- type: { summary: "React Component" },
42
- defaultValue: { summary: undefined }
43
- }
44
- },
45
- rightContent: {
46
- description: "Content that appears on the right side of the footer",
47
- table: {
48
- type: { summary: "React Component" },
49
- defaultValue: { summary: undefined }
50
- }
51
- },
52
- footerMinHeight: {
53
- description: "Minimum height of the footer",
54
- table: {
55
- type: { summary: "string" },
56
- defaultValue: { summary: "105px" }
57
- }
58
- },
59
- isMobile: {
60
- description:
61
- "Whether the page is currently displaying on a mobile device",
62
- table: {
63
- type: { summary: "boolean" },
64
- defaultValue: { summary: false }
65
- }
66
- },
67
- backgroundColor: {
68
- description: "Background color of the footer",
69
- table: {
70
- type: { summary: "string" },
71
- defaultValue: { summary: undefined }
72
- }
73
- },
74
- footerWidth: {
75
- description:
76
- "Optional value for maximum width of inner container. Component uses 76.5rem or 1224px if not specified. If page is larger than max width, container will be centered within.",
77
- table: {
78
- type: { summary: "string" },
79
- defaultValue: { summary: undefined }
80
- }
81
- }
82
- }
83
- };
2
+ import { text, select, boolean } from "@storybook/addon-knobs";
84
3
 
85
- export default meta;
4
+ import NavFooter from "./NavFooter";
5
+ import page from "../../../../.storybook/page";
6
+ import * as colors from "../../../constants/colors";
86
7
 
87
- const logo = (
88
- <ImageBox
89
- maxWidth="150px"
90
- minHeight="50px"
91
- image={{
92
- url:
93
- "https://cb-public-assets.s3-us-west-2.amazonaws.com/cityville/logo-footer-white.svg",
94
- altText: "Cityville Payment Portal Logo"
95
- }}
96
- />
97
- );
8
+ const story = page({
9
+ title: "Components|Atoms/NavFooter",
10
+ Component: NavFooter
11
+ });
12
+ export default story;
98
13
 
99
- const copyright = (
100
- <Box padding="0.5rem">
101
- <Text variant="pXS" color={WHITE}>
102
- © 2024 City of Cityville
103
- </Text>
104
- </Box>
14
+ const Left = () => (
15
+ <div style={{ border: "2px solid black", width: "50px" }}>Left Content</div>
105
16
  );
106
17
 
107
- const logoutButton = (
108
- <Box padding="0">
109
- <ButtonWithAction
110
- action={() => fn()}
111
- variant="whitePrimary"
112
- text="Log Out"
113
- extraStyles={`
114
- padding: 0.75rem 2rem;
115
- border: 2px solid ${WHITE};
116
- color: ${WHITE};
117
- &:hover {
118
- background-color: rgba(255, 255, 255, 0.1);
119
- > * > span {
120
- color: ${WHITE};
121
- background-color: transparent;
122
- }
123
- }
124
- &:active {
125
- border: 2px solid ${WHITE};
126
- background-color: rgba(255, 255, 255, 0.25);
127
- > * > span {
128
- color: ${WHITE};
129
- background-color: transparent;
130
- }
131
- };
132
- &:focus {
133
- outline: 3px solid ${WHITE};
134
- outline-offset: 2px;
135
- }
136
- > * > span {
137
- color: ${WHITE};
138
- }`}
139
- />
140
- </Box>
18
+ const Right = () => (
19
+ <div style={{ border: "2px solid black", width: "50px" }}>Right Content</div>
141
20
  );
142
21
 
143
- const subfooterLinkList = [
144
- {
145
- text: "Demo Home",
146
- link: "/"
147
- },
148
- {
149
- text: "Privacy Policy",
150
- link: "/"
151
- },
152
- {
153
- text: "Join Cityville Utilities",
154
- link: "/"
155
- },
156
- {
157
- text: "Utility Blog",
158
- link: "/"
159
- },
160
- {
161
- text: "Report an Outage",
162
- link: "/"
163
- }
164
- ];
165
-
166
- const subfooterLinks = subfooterLinkList.map((item, index) => (
167
- <Box
168
- padding="0"
169
- key={`link-${item.text}`}
170
- extraStyles={`max-height: 1.25rem;`}
171
- >
172
- <ExternalLink
173
- newTab
174
- href={item.link}
175
- color={WHITE}
176
- hoverColor={WHITE}
177
- extraStyles={`text-decoration: none;
178
- &:focus {
179
- outline: 3px solid ${WHITE};
180
- outline-offset: 2px;
181
- }`}
182
- size="0.875rem"
183
- lineHeight="1.25rem"
184
- weight={FONT_WEIGHT_SEMIBOLD}
185
- ariaLabel={`Link to ${item.text} (opens in a new window)`}
186
- >
187
- <Cluster childGap="0.5rem" justify="center" align="center">
188
- <Text
189
- variant="pXS"
190
- color={WHITE}
191
- weight={FONT_WEIGHT_SEMIBOLD}
192
- extraStyles={`cursor: pointer;
193
- &:focus {
194
- outline: 3px solid ${WHITE};
195
- outline-offset: 2px;
196
- }`}
197
- >
198
- {item.text}
199
- </Text>
200
- <ExternalLinkIcon linkColor={WHITE} text={`link-icon-${index}`} />
201
- </Cluster>
202
- </ExternalLink>
203
- </Box>
204
- ));
205
-
206
- const subfooterLeftContent = (
207
- <Cluster justify="flex-start" align="center" key="subfooter-left">
208
- <Box padding={"0.5rem"} minWidth="100%">
209
- <Stack direction={"row"} childGap={"2rem"}>
210
- {[...subfooterLinks]}
211
- </Stack>
212
- </Box>
213
- </Cluster>
22
+ export const navFooter = () => (
23
+ <NavFooter
24
+ leftContent={<Left />}
25
+ rightContent={<Right />}
26
+ $headerHeight={text("headerHeight", "105px", "props")}
27
+ backgroundColor={select("activeColor", colors, "white", "props")}
28
+ footerPadding={text("footerPadding", "1.5rem 1rem", "props")}
29
+ isMobile={boolean("isMobile", false, "props")}
30
+ />
214
31
  );
215
-
216
- export const BasicFooter = {
217
- render: args => (
218
- <Box minWidth="1200px">
219
- <NavFooter
220
- {...args}
221
- leftContent={logo}
222
- rightContent={logoutButton}
223
- backgroundColor={ROYAL_BLUE_VIVID}
224
- />
225
- </Box>
226
- )
227
- };
228
-
229
- export const BasicSubfooter = {
230
- render: args => (
231
- <Box minWidth="1200px" backgroundColor={DUSTY_GREY}>
232
- <NavFooter
233
- {...args}
234
- leftContent={subfooterLeftContent}
235
- rightContent={copyright}
236
- backgroundColor={BRIGHT_GREY}
237
- footerMinHeight="45px"
238
- largeSide="left"
239
- largeSideSize="4"
240
- footerPadding="0 1rem"
241
- />
242
- </Box>
243
- )
244
- };