@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
@@ -1,57 +1,163 @@
1
1
  import React from "react";
2
- import { boolean, select, text, number } from "@storybook/addon-knobs";
3
- import page from "../../../../.storybook/page";
4
2
  import InternalLink from "./InternalLink";
5
3
  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";
12
4
 
13
- const fontWeights = {
14
- FONT_WEIGHT_BOLD,
15
- FONT_WEIGHT_SEMIBOLD,
16
- FONT_WEIGHT_REGULAR
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
+ }
17
139
  };
18
- const variantsLabel = "variant";
19
- const variants = {
20
- primary: "primary",
21
- secondary: "secondary"
22
- };
23
- const defaultValue = "primary";
24
- const groupId = "props";
25
140
 
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
- );
141
+ export default meta;
38
142
 
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
- );
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
+ }
151
+ };
52
152
 
53
- const story = page({
54
- title: "Components|Atoms/Link",
55
- Component: InternalLink
56
- });
57
- export default story;
153
+ export const StandardExternalLink = {
154
+ render: args => <ExternalLink {...args}>Austin City Hall</ExternalLink>
155
+ };
156
+
157
+ export const ActiveInternalLink = {
158
+ render: args => <InternalLink {...args}>Transaction History</InternalLink>,
159
+ args: {
160
+ active: "true",
161
+ to: "/transaction-history"
162
+ }
163
+ };
@@ -0,0 +1,13 @@
1
+ import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
+
3
+ import * as LoadingStories from './Loading.stories.js';
4
+
5
+ <Meta of={LoadingStories} />
6
+
7
+ <Title />
8
+
9
+ The Loading component is a small spinner animation that can be used to signal a loading state to a user. The spinner has a fixed size of 100px, and it is themed using the theme values in FCS. For a customizable size version, use the Spinner atom directly.
10
+
11
+ <Story />
12
+
13
+ <Controls />
@@ -0,0 +1,22 @@
1
+ import Loading from "./Loading";
2
+ import { Box } from "../layouts";
3
+
4
+ const meta = {
5
+ title: "Atoms/Loading",
6
+ component: Loading,
7
+ parameters: {
8
+ layout: "centered",
9
+ controls: { expanded: true }
10
+ },
11
+ tags: ["!autodocs"]
12
+ };
13
+
14
+ export default meta;
15
+
16
+ export const Spinner = {
17
+ render: () => (
18
+ <Box>
19
+ <Loading />
20
+ </Box>
21
+ )
22
+ };
@@ -7,15 +7,19 @@ const LoadingLine = ({
7
7
  exactWidth = null,
8
8
  height = "16px",
9
9
  margin = "0px"
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
- );
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
+ };
20
24
 
21
25
  export default LoadingLine;
@@ -0,0 +1,15 @@
1
+ import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
+
3
+ import * as LoadingLineStories from './LoadingLine.stories.js';
4
+
5
+ <Meta of={LoadingLineStories} />
6
+
7
+ <Title />
8
+
9
+ The LoadingLine is a component with a gray ripple animation that can be used in place of an existing component as it renders. The LoadingLine can either be given an exact width and height using pixel strings, or it can be given an maximum and minimum width. If supplied with a maximum and minimum width, the component will have a random width within the range. Width values should be supplied as pixel values _without_ the "px" suffix. All supplied values will be applied as pixels in the component's style function.
10
+
11
+ Using the minimum and maximum width values can be useful to represent a series of items without a fixed width, like text content, list items, or table values.
12
+
13
+ <Story />
14
+
15
+ <Controls />
@@ -1,28 +1,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
+ 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
+ };
@@ -0,0 +1,15 @@
1
+ import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
2
+
3
+ import * as NavFooterStories from './NavFooter.stories.js';
4
+
5
+ <Meta of={NavFooterStories} />
6
+
7
+ <Title />
8
+
9
+ The NavFooter component is a wrapper designed to create a page footer. The component accepts children components for its left and right side and sizes itself to the width of the page. The component can take a maxWidth value that will center the footer within it, no matter the overall size of the screen.
10
+
11
+ The NavFooter can also be used to create a smaller subfooter by changing the minimum height value. Multiple footers can exist on one page, as long as they have proper key and aria-label values. The `largeSide` and `largeSideSize` props dictate which side of the footer is given more flex space.
12
+
13
+ <Controls />
14
+
15
+ <Story />