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

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
package/package.json CHANGED
@@ -1,15 +1,14 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "10.12.3-beta.0",
3
+ "version": "10.12.3-beta.1",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
7
7
  "module": "dist/index.esm.js",
8
8
  "source": "src/index.js",
9
9
  "scripts": {
10
- "storybook": "storybook dev -p 6006",
11
- "build": "rollup -cm",
12
- "build-storybook": "storybook build"
10
+ "storybook": "start-storybook",
11
+ "build": "rollup -cm"
13
12
  },
14
13
  "repository": {
15
14
  "type": "git",
@@ -31,22 +30,15 @@
31
30
  "@babel/preset-env": "^7.6.0",
32
31
  "@babel/preset-react": "^7.0.0",
33
32
  "@babel/register": "^7.6.2",
34
- "@chromatic-com/storybook": "^1.4.0",
35
33
  "@rollup/plugin-json": "^4.0.3",
36
- "@storybook/addon-a11y": "7",
37
- "@storybook/addon-essentials": "^8.1.1",
38
- "@storybook/addon-interactions": "^8.1.1",
39
- "@storybook/addon-links": "^8.1.1",
40
- "@storybook/addon-mdx-gfm": "^8.1.1",
41
- "@storybook/addon-onboarding": "^8.1.1",
42
- "@storybook/addon-themes": "^8.1.3",
43
- "@storybook/blocks": "^8.1.1",
44
- "@storybook/react": "^8.1.1",
45
- "@storybook/react-vite": "^8.1.1",
46
- "@storybook/test": "^8.1.1",
47
- "@storybook/test-runner": "0.18.0",
48
- "@vitejs/plugin-react": "^4.2.1",
49
- "axe-playwright": "^2.0.2",
34
+ "@storybook/addon-a11y": "6.4.22",
35
+ "@storybook/addon-actions": "^6.4.22",
36
+ "@storybook/addon-console": "^1.2.3",
37
+ "@storybook/addon-docs": "^6.4.22",
38
+ "@storybook/addon-knobs": "^5.3.14",
39
+ "@storybook/addon-storysource": "^6.4.22",
40
+ "@storybook/addon-viewport": "^6.4.22",
41
+ "@storybook/react": "^6.4.22",
50
42
  "babel-core": "^6.26.3",
51
43
  "babel-loader": "^8.1.0",
52
44
  "babel-preset-env": "^1.7.0",
@@ -56,7 +48,6 @@
56
48
  "eslint-plugin-babel": "^5.3.0",
57
49
  "eslint-plugin-prettier": "^3.1.3",
58
50
  "eslint-plugin-react": "^7.20.0",
59
- "eslint-plugin-storybook": "^0.8.0",
60
51
  "history": "^5.0.0",
61
52
  "husky": "^4.2.3",
62
53
  "prettier": "^1.19.1",
@@ -72,12 +63,10 @@
72
63
  "rollup-plugin-node-resolve": "^5.1.0",
73
64
  "rollup-plugin-ts": "^3.0.2",
74
65
  "rollup-plugin-visualizer": "^4.0.4",
75
- "storybook": "^8.1.1",
76
- "storybook-addon-remix-react-router": "^3.0.0",
66
+ "storybook": "^6.4.22",
77
67
  "styled-components": "^5.3.5",
78
68
  "styled-theming": "^2.2.0",
79
- "typescript": "^4.8.2",
80
- "vite": "^5.2.11"
69
+ "typescript": "^4.8.2"
81
70
  },
82
71
  "peerDependencies": {
83
72
  "react": "^16.13.1",
@@ -93,7 +82,6 @@
93
82
  },
94
83
  "dependencies": {
95
84
  "@babel/runtime": "^7.15.4",
96
- "@types/styled-components": "^5.1.34",
97
85
  "core-js": "^3.22.5",
98
86
  "formatted-input": "^1.0.0",
99
87
  "framer-motion": "^1.11.0",
@@ -1,150 +1,28 @@
1
- import React, { useState } from "react";
2
- import { CLOUDBURST_BLUE } from "../../../constants/colors";
3
- import Badge from "../badge/Badge";
4
- import ToggleSwitch from "../toggle-switch/ToggleSwitch";
5
- import { Cluster, Box, Stack } from "../layouts";
6
- import Text from "../text/Text";
1
+ import React from "react";
2
+ import { text, select, boolean } from "@storybook/addon-knobs";
7
3
  import Alert from "./Alert";
8
- import { fn } from "@storybook/test";
9
-
10
- const meta = {
11
- title: "Atoms/Alert",
12
- component: Alert,
13
- parameters: {
14
- layout: "centered"
15
- },
16
- tags: ["!autodocs"],
17
- args: {
18
- heading: "This is an alert!",
19
- text:
20
- "We display this message when we want to alert the user to some sort of event or error, such as when an API request has completed or failed.",
21
- textOverride: null,
22
- variant: "info",
23
- children: null,
24
- height: null,
25
- onLinkClick: fn(),
26
- padding: "0.5rem",
27
- showQuitLink: true,
28
- extraStyles: null,
29
- maxContentWidth: null,
30
- noBorder: false,
31
- enableBoxShadow: false,
32
- enableSmallText: false,
33
- innerContentPadding: "1rem",
34
- iconPadding: "0 0 0 1rem",
35
- contentFullHeight: false,
36
- ariaRole: null,
37
- ariaAtomic: true,
38
- ariaLive: "polite"
39
- },
40
- argTypes: {
41
- heading: {
42
- description: "Text that appears in the alert heading",
43
- table: {
44
- type: { summary: "string" },
45
- defaultValue: { summary: undefined }
46
- }
47
- },
48
- text: {
49
- description: "Text that appears in the alert body",
50
- table: {
51
- type: { summary: "string" },
52
- defaultValue: { summary: undefined }
53
- }
54
- },
55
- textOverride: {
56
- description:
57
- "A JSX component that replaces the content otherwise specified with the Heading, Text, and Children props.",
58
- table: {
59
- type: { summary: "React Component" },
60
- defaultValue: { summary: undefined }
61
- }
62
- },
63
- variant: {
64
- description: "The type of the alert",
65
- table: {
66
- type: { summary: "string" },
67
- defaultValue: { summary: "info" }
68
- }
69
- },
70
- children: {
71
- description: "A react component to display below the body text",
72
- table: {
73
- type: { summary: "React Component" },
74
- defaultValue: { summary: undefined }
75
- }
76
- },
77
- showQuitLink: {
78
- description: "Whether or not the alert is dismissable",
79
- table: {
80
- type: { summary: "boolean" },
81
- defaultValue: { summary: true }
82
- }
83
- }
84
- }
85
- };
86
-
87
- export default meta;
88
-
89
- export const Info = {
90
- args: {
91
- heading: "This is an info alert!"
92
- }
93
- };
94
-
95
- export const Warn = {
96
- args: {
97
- variant: "warn",
98
- heading: "This is a warning alert!"
99
- }
100
- };
101
-
102
- export const Error = {
103
- args: {
104
- variant: "error",
105
- heading: "This is an error alert!"
106
- }
107
- };
108
-
109
- export const Success = {
110
- args: {
111
- variant: "success",
112
- heading: "This is a success alert!"
113
- }
114
- };
115
-
116
- const FancyAlert = props => {
117
- const [toggleOn, setToggleOn] = useState(true);
118
-
119
- return (
120
- <Alert
121
- {...props}
122
- textOverride={
123
- <Box padding="1rem" border={`1px dotted ${CLOUDBURST_BLUE}`}>
124
- <Stack childGap="1.5rem" fullHeight>
125
- <Text variant="pL" weight="600">
126
- {`Alerts can be very fancy if you want!`}
127
- </Text>
128
- <Text variant="p" weight="400">
129
- {`This particular alert uses the textOverride prop to supply a custom content component with unique text elements and a toggle switch. It also has a box shadow and the quit option to dismiss the alert has been disabled.`}
130
- </Text>
131
- <Cluster justify="space-between" align="center">
132
- <ToggleSwitch
133
- label="toggle!"
134
- isOn={toggleOn}
135
- onToggle={() => setToggleOn(!toggleOn)}
136
- ></ToggleSwitch>
137
- <Badge variant="warn" label="Oh No!"></Badge>
138
- </Cluster>
139
- </Stack>
140
- </Box>
141
- }
142
- enableBoxShadow={true}
143
- showQuitLink={false}
144
- />
145
- );
146
- };
147
-
148
- export const CustomAlert = {
149
- render: args => <FancyAlert {...args} />
4
+ import page from "../../../../.storybook/page";
5
+
6
+ const variantsLabel = "variant";
7
+ const variants = {
8
+ info: "info",
9
+ warn: "warn",
10
+ error: "error",
11
+ success: "success"
150
12
  };
13
+ const defaultValue = "info";
14
+ const groupId = "props";
15
+
16
+ export const alert = () => (
17
+ <Alert
18
+ variant={select(variantsLabel, variants, defaultValue, groupId)}
19
+ text={text("text", "Alert Bar", "props")}
20
+ showQuitLink={boolean("showQuitLink", true, "props")}
21
+ />
22
+ );
23
+
24
+ const story = page({
25
+ title: "Components|Atoms/Alert",
26
+ Component: Alert
27
+ });
28
+ export default story;
@@ -30,8 +30,8 @@ const StyledBadge = styled(Text)`
30
30
  }
31
31
  `;
32
32
 
33
- const Badge = ({ label, Icon, themeValues, iconOnLeft = true, id }) => (
34
- <StyledBadgeContainer background={themeValues.background} id={id}>
33
+ const Badge = ({ label, Icon, themeValues, iconOnLeft = true }) => (
34
+ <StyledBadgeContainer background={themeValues.background}>
35
35
  {iconOnLeft && Icon && (
36
36
  <Icon color={themeValues.color} fill={themeValues.color} />
37
37
  )}
@@ -1,147 +1,33 @@
1
1
  import React from "react";
2
- import {
3
- MANATEE_GREY,
4
- MATISSE_BLUE,
5
- ROYAL_BLUE_VIVID,
6
- ZEST_ORANGE
7
- } from "../../../constants/colors";
2
+ import { text, select } from "@storybook/addon-knobs";
8
3
  import Badge from "./Badge";
9
- import { Box, Stack, Cluster } from "../layouts";
4
+ import page from "../../../../.storybook/page";
10
5
  import AutopayIcon from "../icons/AutopayIcon";
11
- import MultiCartIcon from "../icons/MultiCartIcon";
12
- import RefundIconSmall from "../icons/RefundIconSmall";
13
- import TrashIconV2 from "../icons/TrashIconV2";
14
- import HistoryIconSmall from "../icons/HistoryIconSmall";
15
6
 
16
- const meta = {
17
- title: "Atoms/Badge",
18
- component: Badge,
19
- parameters: {
20
- layout: "centered"
21
- },
22
- tags: ["!autodocs"],
23
- args: {
24
- label: undefined,
25
- Icon: undefined,
26
- iconOnLeft: true,
27
- variant: "success"
28
- },
29
- argTypes: {
30
- label: {
31
- description: "The text displayed inside the badge",
32
- table: {
33
- type: { summary: "string" },
34
- defaultValue: { summary: undefined }
35
- }
36
- },
37
- Icon: {
38
- description: "An icon component to display on the badge",
39
- table: {
40
- type: { summary: "React Component" },
41
- defaultValue: { summary: undefined }
42
- }
43
- },
44
- iconOnLeft: {
45
- description: "Position of the icon on the badge",
46
- table: {
47
- type: { summary: "boolean" },
48
- defaultValue: { summary: true }
49
- }
50
- },
51
- variant: {
52
- description: "The style of the badge",
53
- table: {
54
- type: { summary: "string" },
55
- defaultValue: { summary: "success" }
56
- }
57
- }
58
- }
59
- };
60
-
61
- export default meta;
62
-
63
- const SuccessBadge = props => {
64
- return <Badge {...props} label={"Autopay On"} Icon={AutopayIcon} />;
65
- };
66
-
67
- const DisabledBadge = props => {
68
- return (
69
- <Badge
70
- {...props}
71
- label={"Enable Autopay"}
72
- Icon={() => AutopayIcon({ fill: MANATEE_GREY })}
73
- variant="disabled"
74
- />
75
- );
76
- };
77
-
78
- const PrimaryBadge = props => {
79
- return (
80
- <Badge
81
- {...props}
82
- label={"Item in Cart"}
83
- Icon={() => MultiCartIcon({ color: ROYAL_BLUE_VIVID })}
84
- variant="primary"
85
- />
86
- );
87
- };
88
-
89
- const InfoBadge = props => {
90
- return (
91
- <Badge
92
- {...props}
93
- label={"Payment History"}
94
- Icon={() => HistoryIconSmall({ color: MATISSE_BLUE })}
95
- variant="info"
96
- />
97
- );
98
- };
99
-
100
- const WarnBadge = props => {
101
- return (
102
- <Badge
103
- {...props}
104
- label={"Refund Payment"}
105
- Icon={() => RefundIconSmall({ color: ZEST_ORANGE })}
106
- variant="warn"
107
- />
108
- );
109
- };
110
-
111
- const RightIconBadge = props => {
112
- return (
113
- <Badge
114
- {...props}
115
- label={"Delete Record"}
116
- Icon={() => TrashIconV2({ iconFill: ZEST_ORANGE })}
117
- variant="warn"
118
- iconOnLeft={false}
119
- />
120
- );
121
- };
122
-
123
- const NoIconBadge = props => {
124
- return <Badge {...props} label={"Paid Off"} variant="success" />;
125
- };
126
-
127
- export const Badges = {
128
- render: args => {
129
- return (
130
- <Box padding="1rem">
131
- <Stack childGap="2rem">
132
- <Cluster justify="flex-start" align="center" childGap="1.5rem">
133
- <SuccessBadge {...args} />
134
- <DisabledBadge {...args} />
135
- <PrimaryBadge {...args} />
136
- <WarnBadge {...args} />
137
- </Cluster>
138
- <Cluster justify="flex-start" align="center" childGap="1.5rem">
139
- <InfoBadge {...args} />
140
- <RightIconBadge {...args} />
141
- <NoIconBadge {...args} />
142
- </Cluster>
143
- </Stack>
144
- </Box>
145
- );
146
- }
147
- };
7
+ const variantsLabel = "variants";
8
+ const variants = {
9
+ info: "info",
10
+ warn: "warn",
11
+ primary: "primary",
12
+ success: "success",
13
+ disabled: "disabled"
14
+ };
15
+
16
+ const defaultValue = "success";
17
+ const groupId = "props";
18
+ const labelLabel = "label";
19
+ const iconLabel = "Icon";
20
+
21
+ export const badge = () => (
22
+ <Badge
23
+ variant={select(variantsLabel, variants, defaultValue, groupId)}
24
+ label={text(labelLabel, "Autopay Available", groupId)}
25
+ Icon={text(iconLabel, AutopayIcon, groupId)}
26
+ />
27
+ );
28
+
29
+ const story = page({
30
+ title: "Components|Atoms/Badge",
31
+ Component: Badge
32
+ });
33
+ export default story;
@@ -1,47 +1,38 @@
1
+ import React from "react";
2
+ import { object } from "@storybook/addon-knobs";
1
3
  import Breadcrumb from "./Breadcrumb";
4
+ import page from "../../../../.storybook/page";
2
5
 
3
- const meta = {
4
- title: "Atoms/Breadcrumb",
5
- component: Breadcrumb,
6
- parameters: {
7
- layout: "centered",
8
- controls: { expanded: true }
9
- },
10
- tags: ["!autodocs"],
11
- args: {
12
- breadcrumbsList: []
13
- },
14
- argTypes: {
15
- breadcrumbsList: {
16
- control: { type: "array" },
17
- table: {
18
- type: { summary: "array" },
19
- defaultValue: { summary: [] }
20
- }
21
- }
22
- }
6
+ const labelInactive = "Inactive Breadcrumb";
7
+ const defaultInactiveValue = {
8
+ linkText: "Home",
9
+ linkDestination: location.pathname,
10
+ isActive: false
23
11
  };
24
12
 
25
- export default meta;
13
+ const labelActive = "Active Breadcrumb";
14
+ const defaultActiveValue = {
15
+ linkText: "Page",
16
+ linkDestination: location.pathname,
17
+ isActive: true
18
+ };
19
+ const groupId = "props";
26
20
 
27
- export const Basic = {
28
- args: {
29
- breadcrumbsList: [
30
- {
31
- linkText: "Home",
32
- linkDestination: "/",
33
- isActive: false
34
- },
21
+ export const breadcrumb = () => (
22
+ <Breadcrumb
23
+ breadcrumbsList={[
35
24
  {
36
- linkText: "Page",
37
- linkDestination: "/page",
38
- isActive: false
25
+ ...object(labelInactive, defaultInactiveValue, groupId)
39
26
  },
40
27
  {
41
- linkText: "Another Page",
42
- linkDestination: "/another-page",
43
- isActive: true
28
+ ...object(labelActive, defaultActiveValue, groupId)
44
29
  }
45
- ]
46
- }
47
- };
30
+ ]}
31
+ />
32
+ );
33
+
34
+ const story = page({
35
+ title: "Components|Atoms/Breadcrumb",
36
+ Component: Breadcrumb
37
+ });
38
+ export default story;
@@ -1,109 +1,56 @@
1
+ import React, { Fragment, useState } from "react";
2
+ import { text, select, boolean } from "@storybook/addon-knobs";
3
+ import { Box } from "../layouts";
1
4
  import ButtonWithAction from "./ButtonWithAction";
2
- import { fn } from "@storybook/test";
3
-
4
- const meta = {
5
- title: "Atoms/ButtonWithAction",
6
- component: ButtonWithAction,
7
- parameters: {
8
- layout: "centered"
9
- },
10
- tags: ["autodocs"],
11
- args: {
12
- action: fn(),
13
- dataQa: null,
14
- textExtraStyles: "",
15
- extraStyles: "",
16
- extraDisabledStyles: ""
17
- }
18
- };
19
-
20
- export default meta;
21
-
22
- export const Primary = {
23
- args: {
24
- variant: "primary",
25
- text: "Pay Now"
26
- }
27
- };
28
-
29
- export const Secondary = {
30
- args: {
31
- ...Primary.args,
32
- variant: "secondary"
33
- }
34
- };
35
-
36
- export const Tertiary = {
37
- args: {
38
- ...Primary.args,
39
- variant: "tertiary"
40
- }
41
- };
42
-
43
- export const Back = {
44
- args: {
45
- ...Primary.args,
46
- variant: "back"
47
- }
48
- };
49
-
50
- export const Danger = {
51
- args: {
52
- ...Primary.args,
53
- variant: "danger"
54
- }
55
- };
56
-
57
- export const Ghost = {
58
- args: {
59
- ...Primary.args,
60
- variant: "ghost"
61
- }
62
- };
63
-
64
- export const LoadingPrimary = {
65
- args: {
66
- ...Primary.args,
67
- isLoading: true
68
- }
69
- };
70
-
71
- export const DisabledPrimary = {
72
- args: {
73
- ...Primary.args,
74
- disabled: true
75
- }
76
- };
77
-
78
- export const SmallGhost = {
79
- args: {
80
- ...Primary.args,
81
- variant: "smallGhost"
82
- }
83
- };
84
-
85
- export const SmallPrimary = {
86
- args: {
87
- ...Primary.args,
88
- variant: "smallPrimary"
89
- }
90
- };
91
-
92
- export const SmallSecondary = {
93
- args: {
94
- ...Primary.args,
95
- variant: "smallSecondary"
96
- }
97
- };
98
-
99
- export const WhitePrimary = {
100
- args: {
101
- ...Primary.args,
102
- variant: "whitePrimary"
103
- }
104
- };
105
-
106
- export const WhiteSecondary = {
107
- ...Primary.args,
108
- variant: "whiteSecondary"
109
- };
5
+ import page from "../../../../.storybook/page";
6
+
7
+ const variantsLabel = "variant";
8
+ const variants = {
9
+ primary: "primary",
10
+ secondary: "secondary",
11
+ back: "back",
12
+ smallPrimary: "smallPrimary",
13
+ smallSecondary: "smallSecondary",
14
+ ghost: "ghost",
15
+ smallGhost: "smallGhost",
16
+ tertiary: "tertiary",
17
+ danger: "danger",
18
+ dangerSecondary: "dangerSecondary",
19
+ whiteSecondary: "whiteSecondary",
20
+ whitePrimary: "whitePrimary",
21
+ None: undefined
22
+ };
23
+ const defaultValue = "primary";
24
+ const groupId = "props";
25
+
26
+ const buttonHandler = () => window.alert("Button click!");
27
+
28
+ export const buttonWithAction = () => (
29
+ <Fragment>
30
+ {/* Uncomment to view buttons on a dark background */}
31
+ {/* <Box extraStyles="background-color: #000;">
32
+ <ButtonWithAction
33
+ variant={select(variantsLabel, variants, defaultValue, groupId)}
34
+ disabled={boolean("disabled", false, "props")}
35
+ text={text("text", "button", "props")}
36
+ isLoading={boolean("isLoading", false, "props")}
37
+ action={text("action", buttonHandler, "props")}
38
+ />
39
+ </Box> */}
40
+ <Box extraStyles="background-color: #fff;">
41
+ <ButtonWithAction
42
+ variant={select(variantsLabel, variants, defaultValue, groupId)}
43
+ disabled={boolean("disabled", false, "props")}
44
+ text={text("text", "button", "props")}
45
+ isLoading={boolean("isLoading", false, "props")}
46
+ action={text("action", buttonHandler, "props")}
47
+ />
48
+ </Box>
49
+ </Fragment>
50
+ );
51
+
52
+ const story = page({
53
+ title: "Components|Atoms/ButtonWithAction",
54
+ Component: ButtonWithAction
55
+ });
56
+ export default story;