@thecb/components 11.10.4 → 11.10.5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "11.10.4",
3
+ "version": "11.10.5",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -54,7 +54,7 @@ const TermsAndConditionsModal = ({
54
54
  weight={themeValues.fontWeight}
55
55
  hoverStyles={themeValues.modalLinkHoverFocus}
56
56
  textDecoration={themeValues.modalLinkTextDecoration}
57
- extraStyles={`display: inline-block; width: fit-content; cursor: pointer`}
57
+ extraStyles={`display: inline-block; width: fit-content; cursor: pointer; min-height: 24px; line-height: 24px;`}
58
58
  role="button" // This should always be a "button" since it opens a modal
59
59
  className="modal-trigger"
60
60
  >
@@ -0,0 +1,110 @@
1
+ import React from "react";
2
+ import TermsAndConditionsModal from "./TermsAndConditionsModal";
3
+
4
+ const TermsContent = () => (
5
+ <p>
6
+ By enrolling, you agree to the automatic payment terms. Payments will be
7
+ processed on the first of each month using your selected payment method. You
8
+ may cancel at any time by contacting support. See our{" "}
9
+ <a href="#">Privacy Policy</a> for more details.
10
+ </p>
11
+ );
12
+
13
+ const meta = {
14
+ title: "Molecules/TermsAndConditionsModal",
15
+ component: TermsAndConditionsModal,
16
+ parameters: {
17
+ layout: "centered"
18
+ },
19
+ tags: ["!autodocs"],
20
+ args: {
21
+ link: "Terms and Conditions",
22
+ title: "Terms and Conditions",
23
+ terms: <TermsContent />,
24
+ isOpen: false,
25
+ linkVariant: "p",
26
+ initialFocusSelector: "[name='Cancel']"
27
+ },
28
+ argTypes: {
29
+ link: {
30
+ description: "Text displayed for the modal trigger link",
31
+ table: {
32
+ type: { summary: "string" },
33
+ defaultValue: { summary: "Terms and Conditions" }
34
+ }
35
+ },
36
+ title: {
37
+ description: "Title displayed in the modal header",
38
+ table: {
39
+ type: { summary: "string" },
40
+ defaultValue: { summary: "Terms & Conditions" }
41
+ }
42
+ },
43
+ isOpen: {
44
+ description: "Whether the modal is currently open",
45
+ table: {
46
+ type: { summary: "boolean" },
47
+ defaultValue: { summary: false }
48
+ }
49
+ },
50
+ acceptText: {
51
+ description:
52
+ "Text for the accept button. If omitted, only a close button is shown.",
53
+ table: {
54
+ type: { summary: "string" },
55
+ defaultValue: { summary: undefined }
56
+ }
57
+ },
58
+ linkVariant: {
59
+ description: "Text size variant for the trigger link",
60
+ control: "select",
61
+ options: ["p", "pL", "pS", "pXS", "pXXS", "pXL"],
62
+ table: {
63
+ type: { summary: "string" },
64
+ defaultValue: { summary: "p" }
65
+ }
66
+ },
67
+ initialFocusSelector: {
68
+ description: "CSS selector for the element that receives initial focus",
69
+ table: {
70
+ type: { summary: "string" },
71
+ defaultValue: { summary: "" }
72
+ }
73
+ }
74
+ }
75
+ };
76
+
77
+ export default meta;
78
+
79
+ export const Default = {};
80
+
81
+ export const SmallVariant = {
82
+ args: {
83
+ linkVariant: "pS"
84
+ }
85
+ };
86
+
87
+ export const ExtraSmallVariant = {
88
+ args: {
89
+ linkVariant: "pXS"
90
+ }
91
+ };
92
+
93
+ export const LargeVariant = {
94
+ args: {
95
+ linkVariant: "pL"
96
+ }
97
+ };
98
+
99
+ export const WithAcceptButton = {
100
+ args: {
101
+ acceptText: "I Accept"
102
+ }
103
+ };
104
+
105
+ export const CustomLinkText = {
106
+ args: {
107
+ link: "Learn More",
108
+ linkVariant: "pS"
109
+ }
110
+ };