@hubspot/cms-component-library 0.3.11 → 0.3.13
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/components/componentLibrary/Accordion/AccordionContent/index.module.scss +3 -5
- package/components/componentLibrary/Accordion/AccordionItem/StyleFields.tsx +6 -14
- package/components/componentLibrary/Accordion/AccordionItem/index.module.scss +7 -5
- package/components/componentLibrary/Accordion/AccordionItem/index.tsx +6 -15
- package/components/componentLibrary/Accordion/AccordionItem/types.ts +5 -5
- package/components/componentLibrary/Accordion/AccordionTitle/StyleFields.tsx +1 -1
- package/components/componentLibrary/Accordion/AccordionTitle/index.module.scss +6 -6
- package/components/componentLibrary/Accordion/llm.txt +15 -15
- package/components/componentLibrary/Accordion/stories/Accordion.stories.tsx +3 -3
- package/components/componentLibrary/Accordion/stories/AccordionDecorator.module.scss +38 -0
- package/components/componentLibrary/Accordion/stories/AccordionDecorator.tsx +7 -35
- package/components/componentLibrary/Button/index.module.scss +12 -4
- package/components/componentLibrary/Button/llm.txt +12 -4
- package/components/componentLibrary/Button/stories/ButtonDecorator.module.scss +12 -4
- package/components/componentLibrary/Card/index.module.scss +5 -5
- package/components/componentLibrary/Card/llm.txt +3 -1
- package/components/componentLibrary/Card/stories/CardDecorator.module.scss +12 -4
- package/components/componentLibrary/Form/PlaceholderForm.module.css +74 -0
- package/components/componentLibrary/Form/PlaceholderForm.tsx +31 -0
- package/components/componentLibrary/Form/StyleFields.tsx +2 -1
- package/components/componentLibrary/Form/index.tsx +24 -2
- package/components/componentLibrary/Form/islands/FormIsland.tsx +3 -1
- package/components/componentLibrary/Form/islands/LegacyFormIsland.tsx +10 -3
- package/components/componentLibrary/Form/islands/legacyForm.module.scss +270 -0
- package/components/componentLibrary/Form/islands/v4Form.module.css +59 -57
- package/components/componentLibrary/Form/types.ts +7 -2
- package/components/componentLibrary/Image/index.module.scss +3 -1
- package/components/componentLibrary/Image/llm.txt +3 -1
- package/components/componentLibrary/Image/stories/ImageDecorator.module.scss +3 -1
- package/components/componentLibrary/Text/ContentFields.tsx +1 -0
- package/components/componentLibrary/Text/index.module.scss +40 -1
- package/components/componentLibrary/Text/llm.txt +4 -2
- package/components/componentLibrary/Video/ContentFields.tsx +1 -0
- package/components/componentLibrary/Video/StyleFields.tsx +42 -0
- package/components/componentLibrary/Video/TrackHSVideoAnalytics.tsx +445 -0
- package/components/componentLibrary/Video/hooks/usePageMeta.tsx +25 -0
- package/components/componentLibrary/Video/hooks/useQueryParam.tsx +12 -0
- package/components/componentLibrary/Video/hooks/useUserToken.tsx +56 -0
- package/components/componentLibrary/Video/index.tsx +11 -2
- package/components/componentLibrary/Video/islands/EmbedVideoIsland.tsx +239 -0
- package/components/componentLibrary/Video/islands/HSVideoIsland.tsx +4 -0
- package/components/componentLibrary/Video/islands/index.module.scss +94 -0
- package/components/componentLibrary/Video/types.ts +22 -0
- package/components/componentLibrary/Video/utils/videoAnalytics.ts +146 -0
- package/package.json +1 -1
- package/components/componentLibrary/Form/islands/legacyForm.module.css +0 -251
|
@@ -3,14 +3,16 @@ import FormIsland from './islands/FormIsland.js?island';
|
|
|
3
3
|
// @ts-expect-error -- ?island not typed
|
|
4
4
|
import LegacyFormIsland from './islands/LegacyFormIsland.js?island';
|
|
5
5
|
import { FormProps } from './types.js';
|
|
6
|
-
import { Island } from '@hubspot/cms-components';
|
|
6
|
+
import { Island, useEditorVariableChecks } from '@hubspot/cms-components';
|
|
7
7
|
import ContentFields from './ContentFields.js';
|
|
8
8
|
import StyleFields from './StyleFields.js';
|
|
9
|
+
import PlaceholderForm from './PlaceholderForm.js';
|
|
9
10
|
|
|
10
11
|
const FormComponent = ({
|
|
11
12
|
formField,
|
|
12
13
|
formId,
|
|
13
14
|
formVersion,
|
|
15
|
+
variant = 'form1',
|
|
14
16
|
...rest
|
|
15
17
|
}: FormProps) => {
|
|
16
18
|
const resolvedFormId = formField != null ? formField.form_id : formId;
|
|
@@ -18,8 +20,28 @@ const FormComponent = ({
|
|
|
18
20
|
formField != null ? formField.embed_version : formVersion;
|
|
19
21
|
const isV4 = resolvedVersion === 'v4';
|
|
20
22
|
const FormModule = isV4 ? FormIsland : LegacyFormIsland;
|
|
23
|
+
const editorChecks = useEditorVariableChecks();
|
|
24
|
+
const hasFormData = !!resolvedFormId;
|
|
21
25
|
|
|
22
|
-
|
|
26
|
+
if (!hasFormData && !editorChecks.is_in_editor) return null;
|
|
27
|
+
|
|
28
|
+
if (!hasFormData) {
|
|
29
|
+
return (
|
|
30
|
+
<div data-form-variant={variant} data-button-variant="primaryButton">
|
|
31
|
+
<PlaceholderForm />
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Island
|
|
38
|
+
module={FormModule}
|
|
39
|
+
data-form-variant={variant}
|
|
40
|
+
formId={resolvedFormId}
|
|
41
|
+
variant={variant}
|
|
42
|
+
{...rest}
|
|
43
|
+
/>
|
|
44
|
+
);
|
|
23
45
|
};
|
|
24
46
|
|
|
25
47
|
type FormComponentType = typeof FormComponent & {
|
|
@@ -9,7 +9,7 @@ const getScriptSrc = (portalId: number, env: string) => {
|
|
|
9
9
|
return `https://${host}/forms/embed/developer/${portalId}.js`;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
const FormIsland = ({ formId }: FormProps) => {
|
|
12
|
+
const FormIsland = ({ formId, variant }: FormProps) => {
|
|
13
13
|
const portalId = getHubID();
|
|
14
14
|
const resolvedEnv = getHSEnv();
|
|
15
15
|
|
|
@@ -49,6 +49,8 @@ const FormIsland = ({ formId }: FormProps) => {
|
|
|
49
49
|
data-form-id={formId}
|
|
50
50
|
data-portal-id={portalId}
|
|
51
51
|
data-env={resolvedEnv}
|
|
52
|
+
data-form-variant={variant}
|
|
53
|
+
data-button-variant="primaryButton"
|
|
52
54
|
/>
|
|
53
55
|
);
|
|
54
56
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useId } from 'react';
|
|
2
2
|
import { FormProps } from '../types.js';
|
|
3
3
|
import { getHubID, getHSEnv } from '@hubspot/cms-components';
|
|
4
|
-
import styles from './legacyForm.module.
|
|
4
|
+
import styles from './legacyForm.module.scss';
|
|
5
5
|
|
|
6
6
|
declare global {
|
|
7
7
|
interface Window {
|
|
@@ -23,7 +23,7 @@ const getScriptSrc = (env: string) => {
|
|
|
23
23
|
return `//${host}/forms/embed/v2.js`;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
const LegacyFormIsland = ({ formId }: FormProps) => {
|
|
26
|
+
const LegacyFormIsland = ({ formId, variant }: FormProps) => {
|
|
27
27
|
const portalId = getHubID();
|
|
28
28
|
const resolvedEnv = getHSEnv();
|
|
29
29
|
const rawId = useId();
|
|
@@ -72,7 +72,14 @@ const LegacyFormIsland = ({ formId }: FormProps) => {
|
|
|
72
72
|
return null;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
return
|
|
75
|
+
return (
|
|
76
|
+
<div
|
|
77
|
+
id={containerId}
|
|
78
|
+
className={styles.legacyFormStyles}
|
|
79
|
+
data-form-variant={variant}
|
|
80
|
+
data-button-variant="primaryButton"
|
|
81
|
+
/>
|
|
82
|
+
);
|
|
76
83
|
};
|
|
77
84
|
|
|
78
85
|
export default LegacyFormIsland;
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
.legacyFormStyles {
|
|
2
|
+
&#{&} {
|
|
3
|
+
/* Form container */
|
|
4
|
+
:global(.hs-form) {
|
|
5
|
+
padding: 32px;
|
|
6
|
+
border-color: var(--hs-form-borderColor, #e0e0e0);
|
|
7
|
+
border-radius: var(--hs-form-borderRadius, 8px);
|
|
8
|
+
border-style: var(--hs-form-borderStyle, solid);
|
|
9
|
+
border-width: var(--hs-form-borderWidth, 1px);
|
|
10
|
+
background: var(--hs-form-backgroundColor, transparent);
|
|
11
|
+
|
|
12
|
+
/* Form field spacing */
|
|
13
|
+
:global(.hs-form-field) {
|
|
14
|
+
margin-block-end: 24px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* Textarea */
|
|
18
|
+
:global(textarea) {
|
|
19
|
+
position: relative;
|
|
20
|
+
height: 160px;
|
|
21
|
+
border-radius: 3px;
|
|
22
|
+
|
|
23
|
+
&::-webkit-resizer {
|
|
24
|
+
display: none;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Textarea drag icon */
|
|
29
|
+
:global(.hs_multi_line_field .input) {
|
|
30
|
+
position: relative;
|
|
31
|
+
|
|
32
|
+
&::after {
|
|
33
|
+
position: absolute;
|
|
34
|
+
right: 8px;
|
|
35
|
+
bottom: 8px;
|
|
36
|
+
content: url("data:image/svg+xml,%3Csvg width='11' height='12' viewBox='0 0 22 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cline y1='-1' x2='29.5206' y2='-1' transform='matrix(-0.666795 0.745241 -0.806754 -0.590888 19.6843 0)' stroke='%23303F59' stroke-width='2'/%3E%3Cpath d='M21.0005 9.99756L10.5005 21.9976' stroke='%23303F59' stroke-width='2'/%3E%3C/svg%3E%0A");
|
|
37
|
+
pointer-events: none;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Select dropdown - remove native appearance */
|
|
42
|
+
:global(select) {
|
|
43
|
+
-webkit-appearance: none;
|
|
44
|
+
-moz-appearance: none;
|
|
45
|
+
appearance: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Select dropdown icon */
|
|
49
|
+
:global(.hs-fieldtype-select .input) {
|
|
50
|
+
position: relative;
|
|
51
|
+
|
|
52
|
+
&::after {
|
|
53
|
+
position: absolute;
|
|
54
|
+
top: 50%;
|
|
55
|
+
right: 16px;
|
|
56
|
+
content: url("data:image/svg+xml,%3Csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.9407 19.5595C11.5267 20.1454 12.4782 20.1454 13.0642 19.5595L22.0642 10.5595C22.6501 9.97354 22.6501 9.02197 22.0642 8.43604C21.4782 7.8501 20.5267 7.8501 19.9407 8.43604L12.0001 16.3767L4.05947 8.44072C3.47354 7.85478 2.52197 7.85478 1.93604 8.44072C1.3501 9.02666 1.3501 9.97822 1.93604 10.5642L10.936 19.5642L10.9407 19.5595Z' fill='%2309152B'/%3E%3C/svg%3E%0A");
|
|
57
|
+
pointer-events: none;
|
|
58
|
+
transform: translateY(-50%);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* Datepicker icon */
|
|
63
|
+
:global(.hs-dateinput) {
|
|
64
|
+
position: relative;
|
|
65
|
+
|
|
66
|
+
&::before {
|
|
67
|
+
position: absolute;
|
|
68
|
+
top: 50%;
|
|
69
|
+
right: 16px;
|
|
70
|
+
content: url("data:image/svg+xml,%3Csvg width='24' height='29' viewBox='0 0 24 29' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_3812_12272)'%3E%3Cpath d='M8.14286 2.07136C8.14286 1.35886 7.56964 0.785645 6.85714 0.785645C6.14464 0.785645 5.57143 1.35886 5.57143 2.07136V4.21422H3.42857C1.5375 4.21422 0 5.75172 0 7.64279V8.49993V11.0714V24.7856C0 26.6767 1.5375 28.2142 3.42857 28.2142H20.5714C22.4625 28.2142 24 26.6767 24 24.7856V11.0714V8.49993V7.64279C24 5.75172 22.4625 4.21422 20.5714 4.21422H18.4286V2.07136C18.4286 1.35886 17.8554 0.785645 17.1429 0.785645C16.4304 0.785645 15.8571 1.35886 15.8571 2.07136V4.21422H8.14286V2.07136ZM2.57143 11.0714H21.4286V24.7856C21.4286 25.2571 21.0429 25.6428 20.5714 25.6428H3.42857C2.95714 25.6428 2.57143 25.2571 2.57143 24.7856V11.0714Z' fill='%2309152B'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_3812_12272'%3E%3Crect width='24' height='27.4286' fill='white' transform='translate(0 0.785645)'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A");
|
|
71
|
+
pointer-events: none;
|
|
72
|
+
transform: translateY(-50%);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* Placeholder text color */
|
|
77
|
+
:global(::-moz-placeholder) {
|
|
78
|
+
color: var(--hs-form-placeholder-color, #717171);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:global(::placeholder) {
|
|
82
|
+
color: var(--hs-form-placeholder-color, #717171);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Checkbox and radio list reset */
|
|
86
|
+
:global(.inputs-list) {
|
|
87
|
+
padding: 0;
|
|
88
|
+
margin: 0;
|
|
89
|
+
list-style: none;
|
|
90
|
+
|
|
91
|
+
:global(li) {
|
|
92
|
+
display: block;
|
|
93
|
+
margin-block-end: 16px;
|
|
94
|
+
|
|
95
|
+
&:last-of-type {
|
|
96
|
+
margin-block-end: 0;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:global(:is(input, span)) {
|
|
101
|
+
vertical-align: middle;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* Help text / legend */
|
|
106
|
+
:global(legend) {
|
|
107
|
+
color: var(--hs-form-label-color, inherit);
|
|
108
|
+
margin-block-end: 8px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* Rich text within form */
|
|
112
|
+
:global(.hs-richtext) {
|
|
113
|
+
color: var(--hs-form-label-color, inherit);
|
|
114
|
+
|
|
115
|
+
:global(img) {
|
|
116
|
+
height: auto;
|
|
117
|
+
max-width: 100% !important;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* Error state - input border */
|
|
122
|
+
:global(.hs-input.error) {
|
|
123
|
+
border-color: #ff0000;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* Error messages */
|
|
127
|
+
:global(.hs-error-msg),
|
|
128
|
+
:global(.hs-error-msgs) {
|
|
129
|
+
color: #ff0000;
|
|
130
|
+
margin-block-start: 4px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* File upload and fieldset max width */
|
|
134
|
+
:global(.hs-form-field.hs-fieldtype-file .hs-input),
|
|
135
|
+
:global(fieldset) {
|
|
136
|
+
max-width: 100% !important;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
:global(:is(.legal-consent-container )) {
|
|
141
|
+
font-size: 14px;
|
|
142
|
+
color: var(--hs-form-label-color, inherit);
|
|
143
|
+
|
|
144
|
+
:global(label){
|
|
145
|
+
font-size: 14px;
|
|
146
|
+
color: var(--hs-form-label-color, inherit);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/* Labels - targets both form types */
|
|
151
|
+
:global(:is(.hs-form, .hs-elevate-system-form)) :global(label) {
|
|
152
|
+
display: block;
|
|
153
|
+
color: var(--hs-form-label-color, inherit);
|
|
154
|
+
font-family: var(--hs-form-label-fontFamily, inherit);
|
|
155
|
+
font-size: var(--hs-form-label-fontSize, 0.875rem);
|
|
156
|
+
font-style: var(--hs-form-label-fontStyle, normal);
|
|
157
|
+
font-weight: var(--hs-form-label-fontWeight, 600);
|
|
158
|
+
text-decoration: var(--hs-form-label-textDecoration, none);
|
|
159
|
+
margin-block-end: 8px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* Text inputs, selects, textareas - targets both form types */
|
|
163
|
+
:global(:is(.hs-form, .hs-elevate-system-form)) :global(input[type='text']),
|
|
164
|
+
:global(:is(.hs-form, .hs-elevate-system-form)) :global(input[type='email']),
|
|
165
|
+
:global(:is(.hs-form, .hs-elevate-system-form)) :global(input[type='password']),
|
|
166
|
+
:global(:is(.hs-form, .hs-elevate-system-form)) :global(input[type='tel']),
|
|
167
|
+
:global(:is(.hs-form, .hs-elevate-system-form)) :global(input[type='number']),
|
|
168
|
+
:global(:is(.hs-form, .hs-elevate-system-form)) :global(input[type='search']),
|
|
169
|
+
:global(:is(.hs-form, .hs-elevate-system-form)) :global(select),
|
|
170
|
+
:global(:is(.hs-form, .hs-elevate-system-form)) :global(textarea) {
|
|
171
|
+
width: 100% !important;
|
|
172
|
+
border-radius: var(--hs-form-field-borderRadius, 8px);
|
|
173
|
+
border: var(--hs-form-field-borderWidth, 1px) var(--hs-form-field-borderStyle, solid) var(--hs-form-field-borderColor, #e0e0e0);
|
|
174
|
+
background-color: var(--hs-form-field-backgroundColor, #fff);
|
|
175
|
+
color: var(--hs-form-input-color, inherit);
|
|
176
|
+
font-family: var(--hs-form-input-fontFamily, inherit);
|
|
177
|
+
font-size: var(--hs-form-input-fontSize, inherit);
|
|
178
|
+
font-style: var(--hs-form-input-fontStyle, normal);
|
|
179
|
+
font-weight: var(--hs-form-input-fontWeight, normal);
|
|
180
|
+
text-decoration: var(--hs-form-input-textDecoration, none);
|
|
181
|
+
padding-block: 12px;
|
|
182
|
+
padding-inline: 16px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* Checkbox and radio sizing + fill - targets both form types */
|
|
186
|
+
:global(:is(.hs-form, .hs-elevate-system-form)) :global(input[type='checkbox']),
|
|
187
|
+
:global(:is(.hs-form, .hs-elevate-system-form)) :global(input[type='radio']) {
|
|
188
|
+
height: 24px;
|
|
189
|
+
width: 24px !important;
|
|
190
|
+
accent-color: var(--hs-form-input-color, inherit);
|
|
191
|
+
cursor: pointer;
|
|
192
|
+
margin-inline-end: 12px;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* Submit button - targets both form types */
|
|
196
|
+
:global(:is(.hs-form, .hs-elevate-system-form)) :global(:is(.hs-button, input[type='submit'])) {
|
|
197
|
+
display: inline-block;
|
|
198
|
+
width: 100%;
|
|
199
|
+
border-color: var(--hs-button-borderColor, transparent);
|
|
200
|
+
border-radius: var(--hs-button-borderRadius, 8px);
|
|
201
|
+
border-style: var(--hs-button-borderStyle, solid);
|
|
202
|
+
border-width: var(--hs-button-borderWidth, 0);
|
|
203
|
+
background-color: var(--hs-button-backgroundColor, var(--hs-primary-color, #0f4490));
|
|
204
|
+
color: var(--hs-button-color, #ffffff);
|
|
205
|
+
cursor: pointer;
|
|
206
|
+
font-family: var(--hs-button-fontFamily, inherit);
|
|
207
|
+
font-size: var(--hs-button-fontSize, 1rem);
|
|
208
|
+
font-style: var(--hs-button-fontStyle, normal);
|
|
209
|
+
font-weight: var(--hs-button-fontWeight, 700);
|
|
210
|
+
text-decoration: var(--hs-button-textDecoration, none);
|
|
211
|
+
padding-block: 12px;
|
|
212
|
+
padding-inline: 24px;
|
|
213
|
+
text-align: center;
|
|
214
|
+
transition: all 0.15s linear;
|
|
215
|
+
white-space: normal !important;
|
|
216
|
+
|
|
217
|
+
&:hover,
|
|
218
|
+
&:focus {
|
|
219
|
+
border-color: var(--hs-button-borderColor-hover, transparent);
|
|
220
|
+
border-style: var(--hs-button-borderStyle-hover, solid);
|
|
221
|
+
border-width: var(--hs-button-borderWidth-hover, 0);
|
|
222
|
+
background-color: var(--hs-button-backgroundColor-hover, var(--hs-primary-color, #0f4490));
|
|
223
|
+
color: var(--hs-button-color-hover, #ffffff);
|
|
224
|
+
text-decoration: none;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/* International phone field layout */
|
|
229
|
+
:global(.hs-input.hs-fieldtype-intl-phone) {
|
|
230
|
+
display: flex;
|
|
231
|
+
width: 100% !important;
|
|
232
|
+
flex-direction: row;
|
|
233
|
+
flex-wrap: wrap;
|
|
234
|
+
align-items: center;
|
|
235
|
+
justify-content: flex-start;
|
|
236
|
+
gap: 8px;
|
|
237
|
+
|
|
238
|
+
> :global(input) {
|
|
239
|
+
flex: 1 0 calc(70% - 8px) !important;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
> :global(select) {
|
|
243
|
+
flex: 1 0 30% !important;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
@media (width <= 600px) {
|
|
247
|
+
display: flex;
|
|
248
|
+
width: 100%;
|
|
249
|
+
flex-direction: column;
|
|
250
|
+
gap: 8px;
|
|
251
|
+
|
|
252
|
+
> :global(select),
|
|
253
|
+
> :global(input) {
|
|
254
|
+
min-width: 100%;
|
|
255
|
+
flex: 1 1 100%;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
> :global(select) {
|
|
259
|
+
padding-inline: 16px;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
:global(.grecaptcha-badge) {
|
|
266
|
+
margin-block: 0 !important;
|
|
267
|
+
margin-inline: auto !important;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
@@ -1,95 +1,97 @@
|
|
|
1
1
|
.v4FormStyles {
|
|
2
|
-
--hsf-global__font-size: 16px;
|
|
3
|
-
--hsf-global__color:
|
|
2
|
+
--hsf-global__font-size: var(--hs-form-input-fontSize, 16px);
|
|
3
|
+
--hsf-global__color: var(--hs-form-input-color, inherit);
|
|
4
4
|
--hsf-global-error__color: #ff0000;
|
|
5
5
|
|
|
6
|
-
--hsf-background__background-color:
|
|
6
|
+
--hsf-background__background-color: var(--hs-form-backgroundColor, transparent);
|
|
7
7
|
--hsf-background__padding: 32px;
|
|
8
|
-
--hsf-background__border-style: solid;
|
|
9
|
-
--hsf-background__border-color: #
|
|
10
|
-
--hsf-background__border-radius: 8px;
|
|
11
|
-
--hsf-background__border-width:
|
|
8
|
+
--hsf-background__border-style: var(--hs-form-borderStyle, solid);
|
|
9
|
+
--hsf-background__border-color: var(--hs-form-borderColor, #e0e0e0);
|
|
10
|
+
--hsf-background__border-radius: var(--hs-form-borderRadius, 8px);
|
|
11
|
+
--hsf-background__border-width: var(--hs-form-borderWidth, 1px);
|
|
12
12
|
|
|
13
13
|
--hsf-heading__font-family: inherit;
|
|
14
|
-
--hsf-heading__color:
|
|
15
|
-
--hsf-heading__text-shadow:
|
|
14
|
+
--hsf-heading__color: inherit;
|
|
15
|
+
--hsf-heading__text-shadow: none;
|
|
16
16
|
--hsf-richtext__font-family: inherit;
|
|
17
17
|
--hsf-richtext__font-size: 14px;
|
|
18
|
-
--hsf-richtext__color:
|
|
18
|
+
--hsf-richtext__color: inherit;
|
|
19
19
|
|
|
20
|
-
--hsf-field-label__font-family: inherit;
|
|
21
|
-
--hsf-field-label__font-size: 0.875rem;
|
|
22
|
-
--hsf-field-label__color:
|
|
20
|
+
--hsf-field-label__font-family: var(--hs-form-label-fontFamily, inherit);
|
|
21
|
+
--hsf-field-label__font-size: var(--hs-form-label-fontSize, 0.875rem);
|
|
22
|
+
--hsf-field-label__color: var(--hs-form-label-color, inherit);
|
|
23
23
|
--hsf-field-label-requiredindicator__color: #ff0000;
|
|
24
24
|
--hsf-field-description__font-family: inherit;
|
|
25
|
-
--hsf-field-description__color:
|
|
25
|
+
--hsf-field-description__color: inherit;
|
|
26
26
|
--hsf-field-footer__font-family: inherit;
|
|
27
|
-
--hsf-field-footer__color:
|
|
27
|
+
--hsf-field-footer__color: inherit;
|
|
28
28
|
--hsf-erroralert__font-family: inherit;
|
|
29
29
|
--hsf-erroralert__color: #ff0000;
|
|
30
30
|
|
|
31
|
-
--hsf-field-input__font-family: inherit;
|
|
32
|
-
--hsf-field-input__background-color: #
|
|
33
|
-
--hsf-field-input__placeholder-color: #
|
|
34
|
-
--hsf-field-input__border-color: #
|
|
35
|
-
--hsf-field-input__border-width:
|
|
36
|
-
--hsf-field-input__border-style: solid;
|
|
37
|
-
--hsf-field-input__border-radius:
|
|
31
|
+
--hsf-field-input__font-family: var(--hs-form-input-fontFamily, inherit);
|
|
32
|
+
--hsf-field-input__background-color: var(--hs-form-field-backgroundColor, #fff);
|
|
33
|
+
--hsf-field-input__placeholder-color: var(--hs-form-placeholder-color, #717171);
|
|
34
|
+
--hsf-field-input__border-color: var(--hs-form-field-borderColor, #e0e0e0);
|
|
35
|
+
--hsf-field-input__border-width: var(--hs-form-field-borderWidth, 1px);
|
|
36
|
+
--hsf-field-input__border-style: var(--hs-form-field-borderStyle, solid);
|
|
37
|
+
--hsf-field-input__border-radius: var(--hs-form-field-borderRadius, 8px);
|
|
38
38
|
--hsf-field-input__padding: 12px 16px;
|
|
39
|
-
--hsf-field-input__color:
|
|
39
|
+
--hsf-field-input__color: var(--hs-form-input-color, inherit);
|
|
40
40
|
|
|
41
|
-
--hsf-field-textarea__font-family: inherit;
|
|
42
|
-
--hsf-field-textarea__color:
|
|
43
|
-
--hsf-field-textarea__background-color: #
|
|
44
|
-
--hsf-field-textarea__border-color: #
|
|
45
|
-
--hsf-field-textarea__border-style: solid;
|
|
46
|
-
--hsf-field-textarea__border-radius:
|
|
41
|
+
--hsf-field-textarea__font-family: var(--hs-form-input-fontFamily, inherit);
|
|
42
|
+
--hsf-field-textarea__color: var(--hs-form-input-color, inherit);
|
|
43
|
+
--hsf-field-textarea__background-color: var(--hs-form-field-backgroundColor, #fff);
|
|
44
|
+
--hsf-field-textarea__border-color: var(--hs-form-field-borderColor, #e0e0e0);
|
|
45
|
+
--hsf-field-textarea__border-style: var(--hs-form-field-borderStyle, solid);
|
|
46
|
+
--hsf-field-textarea__border-radius: var(--hs-form-field-borderRadius, 8px);
|
|
47
47
|
--hsf-field-textarea__padding: 12px 16px;
|
|
48
48
|
|
|
49
49
|
--hsf-field-checkbox__padding: 12px;
|
|
50
50
|
--hsf-field-checkbox__background-color: #ffffff;
|
|
51
|
-
--hsf-field-checkbox__color:
|
|
52
|
-
--hsf-field-checkbox__border-color: #
|
|
53
|
-
--hsf-field-checkbox__border-width:
|
|
54
|
-
--hsf-field-checkbox__border-style: solid;
|
|
51
|
+
--hsf-field-checkbox__color: var(--hs-form-input-color, inherit);
|
|
52
|
+
--hsf-field-checkbox__border-color: var(--hs-form-field-borderColor, #e0e0e0);
|
|
53
|
+
--hsf-field-checkbox__border-width: var(--hs-form-field-borderWidth, 1px);
|
|
54
|
+
--hsf-field-checkbox__border-style: var(--hs-form-field-borderStyle, solid);
|
|
55
55
|
|
|
56
56
|
--hsf-field-radio__padding: 12px;
|
|
57
57
|
--hsf-field-radio__background-color: #ffffff;
|
|
58
|
-
--hsf-field-radio__color:
|
|
59
|
-
--hsf-field-radio__border-color: #
|
|
60
|
-
--hsf-field-radio__border-width:
|
|
61
|
-
--hsf-field-radio__border-style: solid;
|
|
58
|
+
--hsf-field-radio__color: var(--hs-form-input-color, inherit);
|
|
59
|
+
--hsf-field-radio__border-color: var(--hs-form-field-borderColor, #e0e0e0);
|
|
60
|
+
--hsf-field-radio__border-width: var(--hs-form-field-borderWidth, 1px);
|
|
61
|
+
--hsf-field-radio__border-style: var(--hs-form-field-borderStyle, solid);
|
|
62
62
|
|
|
63
63
|
--hsf-row__vertical-spacing: 24px;
|
|
64
64
|
--hsf-row__horizontal-spacing: 16px;
|
|
65
65
|
--hsf-module__vertical-spacing: 16px;
|
|
66
66
|
|
|
67
67
|
--hsf-button__width: 100%;
|
|
68
|
-
--hsf-button__font-family: inherit;
|
|
69
|
-
--hsf-button__font-size: 1rem;
|
|
70
|
-
--hsf-button__font-weight: 700;
|
|
71
|
-
--hsf-
|
|
72
|
-
--hsf-
|
|
68
|
+
--hsf-button__font-family: var(--hs-button-fontFamily, inherit);
|
|
69
|
+
--hsf-button__font-size: var(--hs-button-fontSize, 1rem);
|
|
70
|
+
--hsf-button__font-weight: var(--hs-button-fontWeight, 700);
|
|
71
|
+
--hsf-button__font-style: var(--hs-button-fontStyle, normal);
|
|
72
|
+
--hsf-button__text-decoration: var(--hs-button-textDecoration, none);
|
|
73
|
+
--hsf-button__color: var(--hs-button-color, #ffffff);
|
|
74
|
+
--hsf-button__background-color: var(--hs-button-backgroundColor, var(--hs-primary-color, #0f4490));
|
|
73
75
|
--hsf-button__background-image: none;
|
|
74
|
-
--hsf-button__border-radius:
|
|
75
|
-
--hsf-button__border-width:
|
|
76
|
-
--hsf-button__border-style: solid;
|
|
77
|
-
--hsf-button__border-color:
|
|
76
|
+
--hsf-button__border-radius: var(--hs-button-borderRadius, 8px);
|
|
77
|
+
--hsf-button__border-width: var(--hs-button-borderWidth, 0);
|
|
78
|
+
--hsf-button__border-style: var(--hs-button-borderStyle, solid);
|
|
79
|
+
--hsf-button__border-color: var(--hs-button-borderColor, transparent);
|
|
78
80
|
--hsf-button__padding: 12px 24px;
|
|
79
|
-
--hsf-button__box-shadow:
|
|
80
|
-
--hsf-button--hover__color: #ffffff;
|
|
81
|
-
--hsf-button--hover__background-color: #
|
|
82
|
-
--hsf-button--hover__border-color:
|
|
83
|
-
--hsf-button--focus__color: #ffffff;
|
|
84
|
-
--hsf-button--focus__background-color: #
|
|
85
|
-
--hsf-button--focus__border-color:
|
|
81
|
+
--hsf-button__box-shadow: none;
|
|
82
|
+
--hsf-button--hover__color: var(--hs-button-color-hover, #ffffff);
|
|
83
|
+
--hsf-button--hover__background-color: var(--hs-button-backgroundColor-hover, var(--hs-primary-color, #0f4490));
|
|
84
|
+
--hsf-button--hover__border-color: var(--hs-button-borderColor-hover, transparent);
|
|
85
|
+
--hsf-button--focus__color: var(--hs-button-color-hover, #ffffff);
|
|
86
|
+
--hsf-button--focus__background-color: var(--hs-button-backgroundColor-hover, var(--hs-primary-color, #0f4490));
|
|
87
|
+
--hsf-button--focus__border-color: var(--hs-button-borderColor-hover, transparent);
|
|
86
88
|
|
|
87
89
|
--hsf-progressbar__font-family: inherit;
|
|
88
90
|
--hsf-progressbar__font-size: 14px;
|
|
89
91
|
--hsf-progressbar__color: #ffffff;
|
|
90
|
-
--hsf-progressbar__background-color: #
|
|
91
|
-
--hsf-progressbar__background:
|
|
92
|
-
--hsf-progressbar__border-color:
|
|
92
|
+
--hsf-progressbar__background-color: var(--hs-primary-color, #0f4490);
|
|
93
|
+
--hsf-progressbar__background: var(--hs-primary-color, #0f4490);
|
|
94
|
+
--hsf-progressbar__border-color: transparent;
|
|
93
95
|
--hsf-progressbar__border-style: solid;
|
|
94
|
-
--hsf-progressbar__border-width:
|
|
96
|
+
--hsf-progressbar__border-width: 0;
|
|
95
97
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { FormFieldDefaults } from '@hubspot/cms-components/fields';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
export type FormBaseProps = {
|
|
5
|
+
variant?: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export type FormProps = (FormPropsWithField | FormPropsWithoutField) & FormBaseProps;
|
|
4
9
|
|
|
5
10
|
export type FormPropsWithoutField = {
|
|
6
11
|
formField?: never;
|
|
@@ -23,5 +28,5 @@ export type ContentFieldsProps = {
|
|
|
23
28
|
export type StyleFieldsProps = {
|
|
24
29
|
formVariantLabel?: string;
|
|
25
30
|
formVariantName?: string;
|
|
26
|
-
formVariantDefault?: { variant_name: string
|
|
31
|
+
formVariantDefault?: { variantName: string, variant_name: string};
|
|
27
32
|
};
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
max-inline-size: max-content;
|
|
4
4
|
max-block-size: max-content;
|
|
5
5
|
border-radius: var(--hscl-image-borderRadius, 0);
|
|
6
|
-
border: var(--hscl-image-
|
|
6
|
+
border-style: var(--hscl-image-borderStyle);
|
|
7
|
+
border-width: var(--hscl-image-borderWidth);
|
|
8
|
+
border-color: var(--hscl-image-borderColor);
|
|
7
9
|
box-shadow: var(--hscl-image-boxShadow);
|
|
8
10
|
}
|
|
9
11
|
|
|
@@ -174,7 +174,9 @@ The Image component uses CSS variables for theming and customization:
|
|
|
174
174
|
**Base Styles:**
|
|
175
175
|
- `--hscl-image-display`: Display property (default: inline-block)
|
|
176
176
|
- `--hscl-image-borderRadius`: Border radius (default: 0)
|
|
177
|
-
- `--hscl-image-
|
|
177
|
+
- `--hscl-image-borderStyle`: Border style (no default)
|
|
178
|
+
- `--hscl-image-borderWidth`: Border width (no default)
|
|
179
|
+
- `--hscl-image-borderColor`: Border color (no default)
|
|
178
180
|
- `--hscl-image-boxShadow`: Box shadow (no default)
|
|
179
181
|
|
|
180
182
|
### Responsive Behavior
|
|
@@ -7,6 +7,7 @@ import type { ContentFieldsProps } from './types.js';
|
|
|
7
7
|
// To do: These are placeholders - we can refine and add more after some UX feedback and further discussion
|
|
8
8
|
|
|
9
9
|
const headingEnabledFeatures: RichTextFieldType['enabledFeatures'] = [
|
|
10
|
+
'heading',
|
|
10
11
|
'alignment',
|
|
11
12
|
'standard_emphasis',
|
|
12
13
|
'link',
|
|
@@ -1,3 +1,42 @@
|
|
|
1
1
|
.text {
|
|
2
|
-
color: var(--
|
|
2
|
+
color: var(--hs-section-color, currentColor);
|
|
3
|
+
|
|
4
|
+
p,
|
|
5
|
+
h1,
|
|
6
|
+
h2,
|
|
7
|
+
h3,
|
|
8
|
+
h4,
|
|
9
|
+
h5,
|
|
10
|
+
h6,
|
|
11
|
+
ul,
|
|
12
|
+
ol,
|
|
13
|
+
blockquote {
|
|
14
|
+
margin-block: 0 2rem;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
*:last-child {
|
|
18
|
+
margin-block-end: 0
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
a {
|
|
22
|
+
color: var(--hs-section-link-color);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
a:hover {
|
|
26
|
+
color: var(--hs-section-link-color-hover);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
a:focus-visible {
|
|
30
|
+
color: var(--hs-section-link-color-hover);
|
|
31
|
+
outline: 2px solid Highlight;
|
|
32
|
+
outline-offset: 2px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
blockquote {
|
|
36
|
+
padding: 24px;
|
|
37
|
+
border-radius: 4px;
|
|
38
|
+
border-left: 3px solid var(--hs-section-blockquote-accentColor);
|
|
39
|
+
background-color: var(--hs-section-blockquote-backgroundColor);
|
|
40
|
+
color: var(--hs-section-blockquote-color);
|
|
41
|
+
}
|
|
3
42
|
}
|
|
@@ -147,8 +147,10 @@ export default function ArticleModule() {
|
|
|
147
147
|
|
|
148
148
|
### CSS Variables
|
|
149
149
|
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
By default, the Text component inherits styles from the HubSpot theme's section settings (e.g. `--hs-section-color`, `--hs-section-link-color`). The `--hscl-` variables below are overrides — use them when the component is placed in a context (like a Card) that requires different styling than the section defaults.
|
|
151
|
+
|
|
152
|
+
**Overrides:**
|
|
153
|
+
- `--hscl-text-color`: Text color (falls back to `--hs-section-color`, then `currentColor`)
|
|
152
154
|
|
|
153
155
|
## Accessibility
|
|
154
156
|
|