@thecb/components 9.2.0-beta.9 → 9.2.1-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 (46) hide show
  1. package/dist/index.cjs.js +835 -1831
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.d.ts +60 -6
  4. package/dist/index.esm.js +834 -1831
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/src/apps/checkout/pages/payment/sub-pages/payment-amount/PaymentAmount_old.js +49322 -0
  7. package/package.json +1 -1
  8. package/src/.DS_Store +0 -0
  9. package/src/components/.DS_Store +0 -0
  10. package/src/components/atoms/.DS_Store +0 -0
  11. package/src/components/atoms/checkbox/Checkbox.js +3 -1
  12. package/src/components/atoms/checkbox/Checkbox.stories.js +3 -2
  13. package/src/components/atoms/country-dropdown/CountryDropdown.js +3 -1
  14. package/src/components/atoms/country-dropdown/CountryDropdown.stories.js +1 -0
  15. package/src/components/atoms/dropdown/Dropdown.js +77 -39
  16. package/src/components/atoms/dropdown/Dropdown.theme.js +8 -2
  17. package/src/components/atoms/form-layouts/FormInput.js +3 -0
  18. package/src/components/atoms/form-select/FormSelect.js +22 -9
  19. package/src/components/atoms/form-select/FormSelect.stories.js +2 -2
  20. package/src/components/atoms/icons/.DS_Store +0 -0
  21. package/src/components/atoms/radio-button-with-label/RadioButtonWithLabel.js +9 -6
  22. package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.js +4 -1
  23. package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.stories.js +1 -0
  24. package/src/components/molecules/address-form/AddressForm.js +6 -0
  25. package/src/components/molecules/payment-form-ach/PaymentFormACH.js +6 -0
  26. package/src/components/molecules/payment-form-card/PaymentFormCard.js +6 -0
  27. package/src/components/molecules/popover/Popover.js +1 -1
  28. package/src/components/molecules/radio-group/RadioGroup.js +1 -1
  29. package/src/components/molecules/radio-section/RadioSection.js +1 -0
  30. package/src/components/molecules/radio-section/RadioSection.stories.js +3 -2
  31. package/src/components/molecules/radio-section/radio-button/RadioButton.js +11 -6
  32. package/src/components/molecules/radio-section/radio-button/RadioButton.theme.js +2 -2
  33. package/src/components/molecules/terms-and-conditions/TermsAndConditionsControlV2.js +1 -1
  34. package/src/components/molecules/toast-notification/ToastNotification.js +5 -6
  35. package/src/components/molecules/toast-notification/ToastNotification.stories.js +4 -4
  36. package/src/constants/colors.js +2 -0
  37. package/src/hooks/index.js +3 -0
  38. package/src/{util/hooks → hooks}/use-toast-notification/index.d.ts +6 -6
  39. package/src/index.d.ts +1 -1
  40. package/src/index.js +2 -1
  41. package/src/types/common/ToastVariants.ts +1 -1
  42. package/src/util/index.js +2 -2
  43. package/src/util/hooks/index.js +0 -1
  44. /package/src/{util/useOutsideClick.js → hooks/use-outside-click/index.js} +0 -0
  45. /package/src/{util/useScrollTo.js → hooks/use-scroll-to/index.js} +0 -0
  46. /package/src/{util/hooks → hooks}/use-toast-notification/index.js +0 -0
@@ -19,24 +19,27 @@ const RadioButton = ({
19
19
  ariaDescribedBy = "",
20
20
  themeValues,
21
21
  ariaLabelledBy = "",
22
- ariaLabel = null
22
+ ariaLabel = null,
23
+ required = false
23
24
  }) => {
24
25
  const buttonBorder = {
25
26
  onFocused: {
26
27
  borderColor: themeValues.activeColor,
27
- boxShadow: `0px 0px 4px 0px ${themeValues.activeColor}`
28
+ outline: `3px solid ${themeValues.activeColor}`,
29
+ outlineOffset: "2px"
28
30
  },
29
31
  offFocused: {
30
32
  borderColor: themeValues.activeColor,
31
- boxShadow: `0px 0px 4px 0px ${themeValues.activeColor}`
33
+ outline: `3px solid ${themeValues.activeColor}`,
34
+ outlineOffset: "2px"
32
35
  },
33
36
  on: {
34
37
  borderColor: themeValues.activeColor,
35
- boxShadow: "0px 0px 0px 0px #FFFFFF"
38
+ outline: "0"
36
39
  },
37
40
  off: {
38
41
  borderColor: themeValues.inactiveColor,
39
- boxShadow: "0px 0px 0px 0px #FFFFFF"
42
+ outline: "0"
40
43
  }
41
44
  };
42
45
 
@@ -88,6 +91,8 @@ const RadioButton = ({
88
91
  type="radio"
89
92
  id={`radio-${name}`}
90
93
  disabled={disabled}
94
+ required={required}
95
+ aria-required={required}
91
96
  onClick={toggleRadio}
92
97
  aria-describedby={ariaDescribedBy}
93
98
  tabIndex="-1"
@@ -97,7 +102,7 @@ const RadioButton = ({
97
102
  borderWidth="1px"
98
103
  borderStyle="solid"
99
104
  borderRadius="12px"
100
- margin="4px 14px 4px 4px"
105
+ margin="6px 14px 6px 6px"
101
106
  height="24px"
102
107
  width="24px"
103
108
  variants={buttonBorder}
@@ -1,7 +1,7 @@
1
- import { MATISSE_BLUE, GREY_CHATEAU } from "../../../../constants/colors";
1
+ import { MATISSE_BLUE, STORM_GREY } from "../../../../constants/colors";
2
2
 
3
3
  const activeColor = `${MATISSE_BLUE}`;
4
- const inactiveColor = `${GREY_CHATEAU}`;
4
+ const inactiveColor = `${STORM_GREY}`;
5
5
 
6
6
  export const fallbackValues = {
7
7
  activeColor,
@@ -9,7 +9,7 @@ import {
9
9
  ERROR_COLOR
10
10
  } from "../../../constants/colors";
11
11
  import { generateShadows } from "../../../util/generateShadows";
12
- import useScrollTo from "../../../util/useScrollTo";
12
+ import { useScrollTo } from "../../../hooks";
13
13
 
14
14
  const TermsAndConditionsControlV2 = ({
15
15
  showCheckbox = true,
@@ -12,6 +12,7 @@ import {
12
12
  WHITE
13
13
  } from "../../../constants/colors";
14
14
  import { FONT_WEIGHT_SEMIBOLD } from "../../../constants/style_constants";
15
+ import { generateShadows } from "../../../util/generateShadows";
15
16
 
16
17
  const VARIANTS = {
17
18
  SUCCESS: "success",
@@ -37,7 +38,7 @@ const ToastNotification = ({
37
38
  ? backgroundColor
38
39
  : variant === VARIANTS.SUCCESS
39
40
  ? HINT_GREEN
40
- : variant === "error"
41
+ : variant === VARIANTS.ERROR
41
42
  ? ERROR_BACKGROUND_COLOR
42
43
  : WHITE
43
44
  }
@@ -47,9 +48,7 @@ const ToastNotification = ({
47
48
  tabIndex={toastOpen ? "-1" : "0"}
48
49
  padding="0rem 1rem"
49
50
  borderRadius="4px"
50
- boxShadow="0px 4px 4px rgba(41, 42, 51, 0.15),
51
- 0px 1px 7px rgba(41, 42, 51, 0.2),
52
- 0px 7px 12px rgba(41, 42, 51, 0.15)"
51
+ boxShadow={generateShadows().standard.base}
53
52
  extraStyles={`
54
53
  display: ${toastOpen ? "block" : "none"};
55
54
  position: fixed; bottom: 4rem; left: 4rem;
@@ -58,8 +57,8 @@ const ToastNotification = ({
58
57
  `}
59
58
  >
60
59
  <Cluster align="center" childGap={childGap}>
61
- {variant === "success" && <SuccessfulIconMedium />}
62
- {variant === "error" && <ErroredIcon />}
60
+ {variant === VARIANTS.SUCCESS && <SuccessfulIconMedium />}
61
+ {variant === VARIANTS.ERROR && <ErroredIcon />}
63
62
  <Box padding="1rem 0" maxWidth={maxWidth}>
64
63
  <Paragraph
65
64
  weight={FONT_WEIGHT_SEMIBOLD}
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect } from "react";
2
2
  import ToastNotification from "./ToastNotification";
3
3
  import page from "../../../../.storybook/page";
4
- import { useToastNotification } from "../../../util";
4
+ import { useToastNotification } from "../../../hooks";
5
5
  import { ToastVariants } from "../../../types/common";
6
6
 
7
7
  export const toastNotificationSuccess = () => {
@@ -38,13 +38,13 @@ export const toastNotificationError = () => {
38
38
  toastVariant,
39
39
  toastMessage,
40
40
  showToast,
41
- hideToast,
41
+ hideToast
42
42
  } = useToastNotification();
43
43
 
44
44
  useEffect(() => {
45
45
  showToast({
46
46
  message: "An error occurred",
47
- variant: ToastVariants.ERROR,
47
+ variant: ToastVariants.ERROR
48
48
  });
49
49
  }, []);
50
50
 
@@ -61,7 +61,7 @@ toastNotificationError.storyName = "Error Toast";
61
61
 
62
62
  const story = page({
63
63
  title: "Components|Molecules/ToastNotification",
64
- Component: ToastNotification,
64
+ Component: ToastNotification
65
65
  });
66
66
 
67
67
  export default story;
@@ -56,6 +56,7 @@ const INFO_BLUE = "#E4F4FD";
56
56
  const CORNFLOWER_BLUE = "#EBEFFB";
57
57
  const HOVER_LIGHT_BLUE = "#EFFAFF";
58
58
  const MATISSE_BLUE = "#15749D";
59
+ const MATISSE_BLUE_DARK = "#105C7D";
59
60
  const ROYAL_BLUE = "#3181E3";
60
61
  const ROYAL_BLUE_VIVID = "#3B5BDB";
61
62
  const ASTRAL_BLUE = "#3176AA";
@@ -193,6 +194,7 @@ export {
193
194
  BOSTON_BLUE,
194
195
  HOVER_LIGHT_BLUE,
195
196
  MATISSE_BLUE,
197
+ MATISSE_BLUE_DARK,
196
198
  ROYAL_BLUE,
197
199
  ROYAL_BLUE_VIVID,
198
200
  ASTRAL_BLUE,
@@ -0,0 +1,3 @@
1
+ export { default as useOutsideClick } from "./use-outside-click";
2
+ export { default as useScrollTo } from "./use-scroll-to";
3
+ export { default as useToastNotification } from "./use-toast-notification";
@@ -1,23 +1,23 @@
1
- import { ToastVariants } from "../../../types/common";
1
+ import { ToastVariants } from "../../types/common";
2
2
 
3
- export interface UseToastProps {
3
+ export interface UseToastOptions {
4
4
  timeout?: number;
5
5
  }
6
6
 
7
7
  export interface UseToastResult {
8
8
  isToastOpen: boolean;
9
- toastVariant: "" | ToastVariants;
9
+ toastVariant: string | ToastVariants;
10
10
  toastMessage: string;
11
11
  showToast: ({
12
12
  message,
13
- variant,
13
+ variant
14
14
  }: {
15
15
  message: string;
16
- variant: ToastVariants;
16
+ variant: string | ToastVariants;
17
17
  }) => void;
18
18
  hideToast: () => void;
19
19
  }
20
20
 
21
21
  export default function useToastNotification(
22
- props: UseToastProps
22
+ options?: UseToastOptions
23
23
  ): UseToastResult;
package/src/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as constants from "./constants";
2
- import * as hooks from "./util/hooks";
2
+ import * as hooks from "./hooks";
3
3
  export * from "./components";
4
4
  export * from "./types/common";
5
5
  export { constants, hooks };
package/src/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./components";
2
2
  import * as constants from "./constants";
3
3
  import * as util from "./util";
4
- export { constants, util };
4
+ import * as hooks from "./hooks";
5
+ export { constants, util, hooks };
@@ -1,6 +1,6 @@
1
1
  enum ToastVariants {
2
2
  ERROR = "error",
3
- SUCCESS = "success",
3
+ SUCCESS = "success"
4
4
  }
5
5
 
6
6
  export default ToastVariants;
package/src/util/index.js CHANGED
@@ -2,8 +2,8 @@ import * as formats from "./formats";
2
2
  import * as general from "./general";
3
3
  import * as theme from "./themeUtils";
4
4
  import useFocusInvalidInput from "./focusFirstInvalidInputHook";
5
- import useOutsideClick from "./useOutsideClick";
6
- import useToastNotification from "./hooks/use-toast-notification";
5
+ import useOutsideClick from "../hooks/use-outside-click";
6
+ import useToastNotification from "../hooks/use-toast-notification";
7
7
 
8
8
  export {
9
9
  formats,
@@ -1 +0,0 @@
1
- export { default as useToastNotification } from "./use-toast-notification";