@thecb/components 11.8.0-beta.1 → 11.8.0-beta.11
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/dist/index.cjs.js +607 -695
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +607 -694
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/components/atoms/alert/Alert.theme.js +5 -5
- package/src/components/atoms/index.js +0 -1
- package/src/components/atoms/password-requirements/PasswordRequirements.js +3 -3
- package/src/components/molecules/payment-button-bar/PaymentButtonBar.js +9 -4
- package/src/components/molecules/popover/Popover.js +1 -15
- package/src/components/molecules/tooltip/Tooltip.js +136 -77
- package/src/components/molecules/tooltip/Tooltip.mdx +1 -1
- package/src/components/molecules/tooltip/Tooltip.stories.js +143 -110
- package/src/components/molecules/tooltip/index.d.ts +20 -17
- package/src/components/templates/sidebar-stack-content/SidebarStackContent.js +1 -1
- package/src/deprecated/icons/AlertInfoIcon.js +1 -1
- package/src/util/general.js +14 -0
- package/src/components/atoms/display-card/DisplayCard.js +0 -118
- package/src/components/atoms/display-card/DisplayCard.mdx +0 -13
- package/src/components/atoms/display-card/DisplayCard.stories.js +0 -240
- package/src/components/atoms/display-card/index.js +0 -3
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
import DisplayCard from "./DisplayCard";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { fn } from "@storybook/test";
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: "Atoms/DisplayCard",
|
|
7
|
-
component: DisplayCard,
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: "centered",
|
|
10
|
-
controls: { expanded: true }
|
|
11
|
-
},
|
|
12
|
-
tags: ["!autodocs"],
|
|
13
|
-
args: {
|
|
14
|
-
title: "Display Card",
|
|
15
|
-
item: "Item text",
|
|
16
|
-
buttonText: undefined,
|
|
17
|
-
buttonAction: undefined,
|
|
18
|
-
url: undefined,
|
|
19
|
-
link: false,
|
|
20
|
-
helpText: undefined,
|
|
21
|
-
hasTooltip: false,
|
|
22
|
-
tooltipTriggerText: "",
|
|
23
|
-
tooltipContent: "",
|
|
24
|
-
tooltipPosition: undefined,
|
|
25
|
-
tooltipArrowPosition: undefined,
|
|
26
|
-
tooltipArrowDirection: undefined,
|
|
27
|
-
tooltipExtraStyles: undefined,
|
|
28
|
-
tooltipTextExtraStyles: undefined,
|
|
29
|
-
hasPopover: false,
|
|
30
|
-
popoverTriggerText: "",
|
|
31
|
-
popoverContent: "",
|
|
32
|
-
popoverExtraStyles: undefined,
|
|
33
|
-
popoverTextExtraStyles: undefined
|
|
34
|
-
},
|
|
35
|
-
argTypes: {
|
|
36
|
-
title: {
|
|
37
|
-
description: "Text that appears above the box",
|
|
38
|
-
table: {
|
|
39
|
-
type: { summary: "string" },
|
|
40
|
-
defaultValue: { summary: undefined }
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
item: {
|
|
44
|
-
description: "Text that appears in the box",
|
|
45
|
-
table: {
|
|
46
|
-
type: { summary: "string" },
|
|
47
|
-
defaultValue: { summary: undefined }
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
buttonText: {
|
|
51
|
-
description: "Text for the button or link",
|
|
52
|
-
table: {
|
|
53
|
-
type: { summary: "string" },
|
|
54
|
-
defaultValue: { summary: undefined }
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
buttonAction: {
|
|
58
|
-
description: "Callback function for the button",
|
|
59
|
-
table: {
|
|
60
|
-
type: { summary: "function" },
|
|
61
|
-
defaultValue: { summary: undefined }
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
url: {
|
|
65
|
-
description: "URL for the link",
|
|
66
|
-
table: {
|
|
67
|
-
type: { summary: "string" },
|
|
68
|
-
defaultValue: { summary: undefined }
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
link: {
|
|
72
|
-
description:
|
|
73
|
-
"Whether or not to display a link, uses the `url` and `buttonText` props",
|
|
74
|
-
table: {
|
|
75
|
-
type: { summary: "boolean" },
|
|
76
|
-
defaultValue: { summary: false }
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
helpText: {
|
|
80
|
-
description:
|
|
81
|
-
"Text rendered to the right of the `item` text and styled as italic.",
|
|
82
|
-
table: {
|
|
83
|
-
type: { summary: "string" },
|
|
84
|
-
defaultValue: { summary: undefined }
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
hasTooltip: {
|
|
88
|
-
description: "Whether or not to render Tooltip component",
|
|
89
|
-
table: {
|
|
90
|
-
type: { summary: "boolean" },
|
|
91
|
-
defaultValue: { summary: false }
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
tooltipTriggerText: {
|
|
95
|
-
description: "Text that triggers the tooltip",
|
|
96
|
-
table: {
|
|
97
|
-
type: { summary: "string" },
|
|
98
|
-
defaultValue: { summary: "" }
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
tooltipContent: {
|
|
102
|
-
description: "Content displayed inside the tooltip",
|
|
103
|
-
table: {
|
|
104
|
-
type: { summary: "string" },
|
|
105
|
-
defaultValue: { summary: "" }
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
tooltipPosition: {
|
|
109
|
-
description:
|
|
110
|
-
"Object with top/right/bottom/left values for tooltip position relative to trigger",
|
|
111
|
-
table: {
|
|
112
|
-
type: { summary: "Object" },
|
|
113
|
-
defaultValue: { summary: undefined }
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
tooltipArrowPosition: {
|
|
117
|
-
description:
|
|
118
|
-
"Object with arrowTop/arrowRight/arrowBottom/arrowLeft values for the tooltip arrow",
|
|
119
|
-
table: {
|
|
120
|
-
type: { summary: "Object" },
|
|
121
|
-
defaultValue: { summary: undefined }
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
tooltipArrowDirection: {
|
|
125
|
-
description: "Direction the tooltip arrow points",
|
|
126
|
-
table: {
|
|
127
|
-
type: { summary: "string" },
|
|
128
|
-
defaultValue: { summary: undefined }
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
tooltipExtraStyles: {
|
|
132
|
-
description: "Extra CSS styles to apply to the tooltip",
|
|
133
|
-
table: {
|
|
134
|
-
type: { summary: "string" },
|
|
135
|
-
defaultValue: { summary: undefined }
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
tooltipTextExtraStyles: {
|
|
139
|
-
description: "Extra CSS styles for the tooltip trigger text",
|
|
140
|
-
table: {
|
|
141
|
-
type: { summary: "string" },
|
|
142
|
-
defaultValue: { summary: "max-width: 300px;" }
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
hasPopover: {
|
|
146
|
-
description: "Whether or not to render Popover component",
|
|
147
|
-
table: {
|
|
148
|
-
type: { summary: "boolean" },
|
|
149
|
-
defaultValue: { summary: false }
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
popoverTriggerText: {
|
|
153
|
-
table: {
|
|
154
|
-
type: { summary: "string" },
|
|
155
|
-
defaultValue: { summary: "" }
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
popoverContent: {
|
|
159
|
-
table: {
|
|
160
|
-
type: { summary: "string" },
|
|
161
|
-
defaultValue: { summary: "" }
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
popoverExtraStyles: {
|
|
165
|
-
description: "Styles for the Box that wraps the Popover content.",
|
|
166
|
-
table: {
|
|
167
|
-
type: { summary: "string" },
|
|
168
|
-
defaultValue: { summary: undefined }
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
popoverTextExtraStyles: {
|
|
172
|
-
description: "Prop passed to the Popover component, but is not used.",
|
|
173
|
-
table: {
|
|
174
|
-
type: { summary: "string" },
|
|
175
|
-
defaultValue: { summary: undefined }
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
export default meta;
|
|
182
|
-
|
|
183
|
-
export const Basic = {
|
|
184
|
-
render: args => <DisplayCard {...args} />
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
export const WithLink = {
|
|
188
|
-
args: {
|
|
189
|
-
buttonText: "Link",
|
|
190
|
-
url: "https://example.com",
|
|
191
|
-
link: true
|
|
192
|
-
},
|
|
193
|
-
render: args => <DisplayCard {...args} />
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
export const WithButtonAction = {
|
|
197
|
-
args: {
|
|
198
|
-
buttonText: "Button",
|
|
199
|
-
buttonAction: fn()
|
|
200
|
-
},
|
|
201
|
-
render: args => <DisplayCard {...args} />
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
export const WithHelpText = {
|
|
205
|
-
parameters: {
|
|
206
|
-
layout: "padded"
|
|
207
|
-
},
|
|
208
|
-
args: {
|
|
209
|
-
helpText: "Help!"
|
|
210
|
-
},
|
|
211
|
-
render: args => <DisplayCard {...args} />
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
export const WithPopover = {
|
|
215
|
-
args: {
|
|
216
|
-
hasPopover: true,
|
|
217
|
-
popoverTriggerText: "Popover",
|
|
218
|
-
popoverContent: "This is example popover content!"
|
|
219
|
-
},
|
|
220
|
-
render: args => <DisplayCard {...args} />
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
export const WithTooltip = {
|
|
224
|
-
args: {
|
|
225
|
-
hasTooltip: true,
|
|
226
|
-
tooltipTriggerText: "What's this?",
|
|
227
|
-
tooltipContent: "This is example tooltip content!"
|
|
228
|
-
},
|
|
229
|
-
render: args => <DisplayCard {...args} />
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
export const WithPopoverAndExtraStyles = {
|
|
233
|
-
args: {
|
|
234
|
-
hasPopover: true,
|
|
235
|
-
popoverTriggerText: "Popover",
|
|
236
|
-
popoverContent: "This is example popover content!",
|
|
237
|
-
popoverExtraStyles: "padding: 4px 8px"
|
|
238
|
-
},
|
|
239
|
-
render: args => <DisplayCard {...args} />
|
|
240
|
-
};
|