@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
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
.accordionContent {
|
|
2
|
-
padding-block:
|
|
3
|
-
padding-inline:
|
|
4
|
-
color:
|
|
5
|
-
font-size: var(--hscl-accordion-body-fontSize, 16px);
|
|
6
|
-
line-height: var(--hscl-accordion-body-lineHeight, 1.5);
|
|
2
|
+
padding-block: 16px;
|
|
3
|
+
padding-inline: 20px;
|
|
4
|
+
color: inherit;
|
|
7
5
|
|
|
8
6
|
:last-child {
|
|
9
7
|
margin-block-end: 0;
|
|
@@ -1,24 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VariantSelectionField } from '@hubspot/cms-components/fields';
|
|
2
2
|
import type { StyleFieldsProps } from './types.js';
|
|
3
3
|
|
|
4
4
|
const StyleFields = ({
|
|
5
|
-
variantLabel = '
|
|
6
|
-
variantName = '
|
|
7
|
-
variantDefault = '
|
|
5
|
+
variantLabel = 'Accordion variant',
|
|
6
|
+
variantName = 'accordionVariant',
|
|
7
|
+
variantDefault = { variant_name: 'card1' },
|
|
8
8
|
}: StyleFieldsProps) => {
|
|
9
9
|
return (
|
|
10
|
-
<
|
|
10
|
+
<VariantSelectionField
|
|
11
11
|
label={variantLabel}
|
|
12
12
|
name={variantName}
|
|
13
|
-
|
|
14
|
-
display="select"
|
|
15
|
-
choices={[
|
|
16
|
-
['variant1', 'Variant 1'],
|
|
17
|
-
['variant2', 'Variant 2'],
|
|
18
|
-
['variant3', 'Variant 3'],
|
|
19
|
-
['variant4', 'Variant 4'],
|
|
20
|
-
]}
|
|
21
|
-
required={false}
|
|
13
|
+
variantDefinitionName="card"
|
|
22
14
|
default={variantDefault}
|
|
23
15
|
/>
|
|
24
16
|
);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
.accordionItem {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
border
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
--hs-section-color: var(--hs-card-color);
|
|
3
|
+
|
|
4
|
+
border: var(--hs-card-borderWidth, 1px) solid
|
|
5
|
+
var(--hs-card-borderColor, #e0e0e0);
|
|
6
|
+
border-radius: var(--hs-card-borderRadius, 4px);
|
|
7
|
+
background-color: var(--hs-card-backgroundColor, transparent);
|
|
8
|
+
color: var(--hs-card-color, inherit);
|
|
7
9
|
overflow: hidden;
|
|
8
10
|
}
|
|
9
11
|
|
|
@@ -1,31 +1,22 @@
|
|
|
1
1
|
import styles from './index.module.scss';
|
|
2
2
|
import StyleFields from './StyleFields.js';
|
|
3
3
|
import cx from '../../utils/classname.js';
|
|
4
|
-
import { mapVariantToCssVars } from '../../utils/cssVars.js';
|
|
5
|
-
import { CSSVariables } from '../../utils/types.js';
|
|
6
4
|
import { AccordionItemProps } from './types.js';
|
|
7
5
|
|
|
8
6
|
const AccordionItemComponent = ({
|
|
9
|
-
variant = '
|
|
7
|
+
variant = 'card1',
|
|
10
8
|
className = '',
|
|
11
9
|
style = {},
|
|
12
10
|
children,
|
|
13
11
|
}: AccordionItemProps) => {
|
|
14
12
|
const combinedClasses = cx(styles.accordionItem, className);
|
|
15
13
|
|
|
16
|
-
const cssVariables: CSSVariables = variant
|
|
17
|
-
? mapVariantToCssVars('--hscl-accordion', variant, [
|
|
18
|
-
'borderColor',
|
|
19
|
-
'borderRadius',
|
|
20
|
-
'borderWidth',
|
|
21
|
-
'backgroundColor',
|
|
22
|
-
'color',
|
|
23
|
-
'icon-fill',
|
|
24
|
-
])
|
|
25
|
-
: {};
|
|
26
|
-
|
|
27
14
|
return (
|
|
28
|
-
<details
|
|
15
|
+
<details
|
|
16
|
+
className={combinedClasses}
|
|
17
|
+
style={style}
|
|
18
|
+
data-card-variant={variant}
|
|
19
|
+
>
|
|
29
20
|
{children}
|
|
30
21
|
</details>
|
|
31
22
|
);
|
|
@@ -3,10 +3,10 @@ import type { AccordionTitleProps } from '../AccordionTitle/types.js';
|
|
|
3
3
|
import type { AccordionContentProps } from '../AccordionContent/types.js';
|
|
4
4
|
|
|
5
5
|
export type AccordionVariant =
|
|
6
|
-
| '
|
|
7
|
-
| '
|
|
8
|
-
| '
|
|
9
|
-
| '
|
|
6
|
+
| 'card1'
|
|
7
|
+
| 'card2'
|
|
8
|
+
| 'card3'
|
|
9
|
+
| 'card4';
|
|
10
10
|
|
|
11
11
|
type AccordionItemChildren =
|
|
12
12
|
| ReactElement<AccordionTitleProps>
|
|
@@ -22,5 +22,5 @@ export type AccordionItemProps = {
|
|
|
22
22
|
export type StyleFieldsProps = {
|
|
23
23
|
variantLabel?: string;
|
|
24
24
|
variantName?: string;
|
|
25
|
-
variantDefault?:
|
|
25
|
+
variantDefault?: { variantName?: string; variant_name?: string };
|
|
26
26
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
.accordionTitle {
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
|
-
padding-block:
|
|
5
|
-
padding-inline:
|
|
6
|
-
background-color:
|
|
4
|
+
padding-block: 16px;
|
|
5
|
+
padding-inline: 20px;
|
|
6
|
+
background-color: transparent;
|
|
7
7
|
cursor: pointer;
|
|
8
8
|
list-style: none;
|
|
9
9
|
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.accordionTitleText {
|
|
16
|
-
font-size:
|
|
17
|
-
font-weight:
|
|
18
|
-
margin-inline-end:
|
|
16
|
+
font-size: 24px;
|
|
17
|
+
font-weight: 600;
|
|
18
|
+
margin-inline-end: 16px;
|
|
19
19
|
flex: 1;
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -89,7 +89,7 @@ Accordion/
|
|
|
89
89
|
**Props:**
|
|
90
90
|
```tsx
|
|
91
91
|
{
|
|
92
|
-
variant?: '
|
|
92
|
+
variant?: 'card1' | 'card2' | 'card3' | 'card4'; // Visual style variant (default: 'card1')
|
|
93
93
|
className?: string; // Additional CSS classes
|
|
94
94
|
style?: React.CSSProperties; // Inline styles
|
|
95
95
|
children: React.ReactNode; // Should contain AccordionTitle and AccordionContent
|
|
@@ -220,14 +220,14 @@ Configurable props for variant selection:
|
|
|
220
220
|
|
|
221
221
|
```tsx
|
|
222
222
|
<AccordionItem.StyleFields
|
|
223
|
-
variantName="
|
|
224
|
-
variantLabel="
|
|
225
|
-
variantDefault=
|
|
223
|
+
variantName="accordionVariant"
|
|
224
|
+
variantLabel="Accordion variant"
|
|
225
|
+
variantDefault={{ variant_name: 'card1' }}
|
|
226
226
|
/>
|
|
227
227
|
```
|
|
228
228
|
|
|
229
229
|
**Fields:**
|
|
230
|
-
- `
|
|
230
|
+
- `accordionVariant`: VariantSelectionField for selecting visual style using the card variant definition (card1, card2, card3, card4)
|
|
231
231
|
|
|
232
232
|
#### AccordionTitle.ContentFields
|
|
233
233
|
|
|
@@ -288,7 +288,7 @@ import { AccordionIconType } from '@hubspot/cms-component-library/Accordion/Acco
|
|
|
288
288
|
|
|
289
289
|
type FAQModuleProps = {
|
|
290
290
|
style?: {
|
|
291
|
-
|
|
291
|
+
accordionVariant?: { variantName: AccordionVariant };
|
|
292
292
|
icon?: AccordionIconType;
|
|
293
293
|
};
|
|
294
294
|
accordionItems?: Array<{
|
|
@@ -301,7 +301,7 @@ export const Component = ({
|
|
|
301
301
|
style,
|
|
302
302
|
accordionItems = [],
|
|
303
303
|
}: FAQModuleProps) => {
|
|
304
|
-
const variant = style?.
|
|
304
|
+
const variant = style?.accordionVariant?.variantName;
|
|
305
305
|
const icon = style?.icon;
|
|
306
306
|
|
|
307
307
|
return (
|
|
@@ -371,18 +371,18 @@ export const fields = (
|
|
|
371
371
|
|
|
372
372
|
### CSS Variables
|
|
373
373
|
|
|
374
|
-
The Accordion component uses CSS variables for theming and customization.
|
|
374
|
+
The Accordion component uses CSS variables for theming and customization. Variant styles are applied via `data-accordion-variant` data attribute selectors (following the same pattern as Card), using the card variant definition from `VariantSelectionField`.
|
|
375
375
|
|
|
376
|
-
**
|
|
376
|
+
**Base Variables (applied per variant via `[data-accordion-variant]` selectors):**
|
|
377
377
|
|
|
378
378
|
| Variable | Description | Default |
|
|
379
379
|
|----------|-------------|---------|
|
|
380
|
-
| `--hscl-accordion-
|
|
381
|
-
| `--hscl-accordion-
|
|
382
|
-
| `--hscl-accordion-
|
|
383
|
-
| `--hscl-accordion-
|
|
384
|
-
| `--hscl-accordion-
|
|
385
|
-
| `--hscl-accordion-
|
|
380
|
+
| `--hscl-accordion-borderColor` | Border color | `#e0e0e0` |
|
|
381
|
+
| `--hscl-accordion-borderRadius` | Border radius | `4px` |
|
|
382
|
+
| `--hscl-accordion-borderWidth` | Border width | `1px` |
|
|
383
|
+
| `--hscl-accordion-backgroundColor` | Background color | `transparent` |
|
|
384
|
+
| `--hscl-accordion-color` | Text color | `#33475b` |
|
|
385
|
+
| `--hscl-accordion-icon-fill` | Icon fill color | `#33475b` |
|
|
386
386
|
|
|
387
387
|
**Title-Specific Variables:**
|
|
388
388
|
|
|
@@ -153,7 +153,7 @@ export const Variants: Story = {
|
|
|
153
153
|
<SBContainer addBackground>
|
|
154
154
|
<h4>Variant 2</h4>
|
|
155
155
|
<Accordion>
|
|
156
|
-
<AccordionItem variant="
|
|
156
|
+
<AccordionItem variant="card2">
|
|
157
157
|
<AccordionTitle>Soft background styling</AccordionTitle>
|
|
158
158
|
<AccordionContent>
|
|
159
159
|
<p>
|
|
@@ -167,7 +167,7 @@ export const Variants: Story = {
|
|
|
167
167
|
<SBContainer addBackground>
|
|
168
168
|
<h4>Variant 3</h4>
|
|
169
169
|
<Accordion>
|
|
170
|
-
<AccordionItem variant="
|
|
170
|
+
<AccordionItem variant="card3">
|
|
171
171
|
<AccordionTitle>Bold accent styling</AccordionTitle>
|
|
172
172
|
<AccordionContent>
|
|
173
173
|
<p>Accent-colored border with sharp corners for emphasis.</p>
|
|
@@ -179,7 +179,7 @@ export const Variants: Story = {
|
|
|
179
179
|
<SBContainer addBackground>
|
|
180
180
|
<h4>Variant 4</h4>
|
|
181
181
|
<Accordion>
|
|
182
|
-
<AccordionItem variant="
|
|
182
|
+
<AccordionItem variant="card4">
|
|
183
183
|
<AccordionTitle>Rounded card styling</AccordionTitle>
|
|
184
184
|
<AccordionContent>
|
|
185
185
|
<p>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.accordionContainer {
|
|
2
|
+
/* Accordion Variant Styles */
|
|
3
|
+
:global([data-accordion-variant='card1']) {
|
|
4
|
+
--hscl-accordion-borderColor: #e0e0e0;
|
|
5
|
+
--hscl-accordion-borderRadius: 4px;
|
|
6
|
+
--hscl-accordion-borderWidth: 1px;
|
|
7
|
+
--hscl-accordion-backgroundColor: transparent;
|
|
8
|
+
--hscl-accordion-color: #33475b;
|
|
9
|
+
--hscl-accordion-icon-fill: #33475b;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
:global([data-accordion-variant='card2']) {
|
|
13
|
+
--hscl-accordion-borderColor: #cbd6e2;
|
|
14
|
+
--hscl-accordion-borderRadius: 8px;
|
|
15
|
+
--hscl-accordion-borderWidth: 1px;
|
|
16
|
+
--hscl-accordion-backgroundColor: #f5f8fa;
|
|
17
|
+
--hscl-accordion-color: #33475b;
|
|
18
|
+
--hscl-accordion-icon-fill: #516f90;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:global([data-accordion-variant='card3']) {
|
|
22
|
+
--hscl-accordion-borderColor: #ff7a59;
|
|
23
|
+
--hscl-accordion-borderRadius: 0;
|
|
24
|
+
--hscl-accordion-borderWidth: 2px;
|
|
25
|
+
--hscl-accordion-backgroundColor: transparent;
|
|
26
|
+
--hscl-accordion-color: #33475b;
|
|
27
|
+
--hscl-accordion-icon-fill: #ff7a59;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:global([data-accordion-variant='card4']) {
|
|
31
|
+
--hscl-accordion-borderColor: #33475b;
|
|
32
|
+
--hscl-accordion-borderRadius: 12px;
|
|
33
|
+
--hscl-accordion-borderWidth: 1px;
|
|
34
|
+
--hscl-accordion-backgroundColor: #eaf0f6;
|
|
35
|
+
--hscl-accordion-color: #33475b;
|
|
36
|
+
--hscl-accordion-icon-fill: #33475b;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -1,41 +1,13 @@
|
|
|
1
1
|
import type { Decorator } from '@storybook/react';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const defaultAccordionStyles: CSSVariables = {
|
|
5
|
-
'--hscl-listItem-color-primary': '#33475b',
|
|
6
|
-
'--hscl-listItem-color-secondary': '#516f90',
|
|
7
|
-
|
|
8
|
-
'--hscl-accordion-variant1-borderColor': '#e0e0e0',
|
|
9
|
-
'--hscl-accordion-variant1-borderRadius': '4px',
|
|
10
|
-
'--hscl-accordion-variant1-borderWidth': '1px',
|
|
11
|
-
'--hscl-accordion-variant1-backgroundColor': 'transparent',
|
|
12
|
-
'--hscl-accordion-variant1-color': '#33475b',
|
|
13
|
-
'--hscl-accordion-variant1-icon-fill': '#33475b',
|
|
14
|
-
|
|
15
|
-
'--hscl-accordion-variant2-borderColor': '#cbd6e2',
|
|
16
|
-
'--hscl-accordion-variant2-borderRadius': '8px',
|
|
17
|
-
'--hscl-accordion-variant2-borderWidth': '1px',
|
|
18
|
-
'--hscl-accordion-variant2-backgroundColor': '#f5f8fa',
|
|
19
|
-
'--hscl-accordion-variant2-color': '#33475b',
|
|
20
|
-
'--hscl-accordion-variant2-icon-fill': '#516f90',
|
|
21
|
-
|
|
22
|
-
'--hscl-accordion-variant3-borderColor': '#ff7a59',
|
|
23
|
-
'--hscl-accordion-variant3-borderRadius': '0',
|
|
24
|
-
'--hscl-accordion-variant3-borderWidth': '2px',
|
|
25
|
-
'--hscl-accordion-variant3-backgroundColor': 'transparent',
|
|
26
|
-
'--hscl-accordion-variant3-color': '#33475b',
|
|
27
|
-
'--hscl-accordion-variant3-icon-fill': '#ff7a59',
|
|
28
|
-
|
|
29
|
-
'--hscl-accordion-variant4-borderColor': '#33475b',
|
|
30
|
-
'--hscl-accordion-variant4-borderRadius': '12px',
|
|
31
|
-
'--hscl-accordion-variant4-borderWidth': '1px',
|
|
32
|
-
'--hscl-accordion-variant4-backgroundColor': '#eaf0f6',
|
|
33
|
-
'--hscl-accordion-variant4-color': '#33475b',
|
|
34
|
-
'--hscl-accordion-variant4-icon-fill': '#33475b',
|
|
35
|
-
};
|
|
2
|
+
import styles from './AccordionDecorator.module.scss';
|
|
36
3
|
|
|
37
4
|
export const withAccordionStyles: Decorator = Story => (
|
|
38
|
-
<div
|
|
5
|
+
<div className={styles.accordionContainer}>
|
|
39
6
|
<Story />
|
|
40
7
|
</div>
|
|
41
8
|
);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Export styles so stories can apply variant classes to AccordionItems
|
|
12
|
+
*/
|
|
13
|
+
export { styles as accordionStyles };
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
color: var(--hs-button-color);
|
|
10
10
|
padding: 12px 24px;
|
|
11
11
|
border-radius: var(--hs-button-borderRadius);
|
|
12
|
-
border: var(--hs-button-
|
|
12
|
+
border-style: var(--hs-button-borderStyle);
|
|
13
|
+
border-width: var(--hs-button-borderWidth);
|
|
14
|
+
border-color: var(--hs-button-borderColor);
|
|
13
15
|
font-size: var(--hs-button-fontSize);
|
|
14
16
|
font-family: var(--hs-button-fontFamily);
|
|
15
17
|
font-style: var(--hs-button-fontStyle);
|
|
@@ -25,13 +27,17 @@
|
|
|
25
27
|
&:hover {
|
|
26
28
|
background-color: var(--hs-button-backgroundColor-hover, var(--hs-button-backgroundColor));
|
|
27
29
|
color: var(--hs-button-color-hover, var(--hs-button-color));
|
|
28
|
-
border: var(--hs-button-
|
|
30
|
+
border-style: var(--hs-button-borderStyle-hover, var(--hs-button-borderStyle));
|
|
31
|
+
border-width: var(--hs-button-borderWidth-hover, var(--hs-button-borderWidth));
|
|
32
|
+
border-color: var(--hs-button-borderColor-hover, var(--hs-button-borderColor));
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
&:focus-visible {
|
|
32
36
|
background-color: var(--hs-button-backgroundColor-hover, var(--hs-button-backgroundColor));
|
|
33
37
|
color: var(--hs-button-color-hover, var(--hs-button-color));
|
|
34
|
-
border: var(--hs-button-
|
|
38
|
+
border-style: var(--hs-button-borderStyle-hover, var(--hs-button-borderStyle));
|
|
39
|
+
border-width: var(--hs-button-borderWidth-hover, var(--hs-button-borderWidth));
|
|
40
|
+
border-color: var(--hs-button-borderColor-hover, var(--hs-button-borderColor));
|
|
35
41
|
outline: 2px solid Highlight;
|
|
36
42
|
outline-offset: 2px;
|
|
37
43
|
}
|
|
@@ -39,7 +45,9 @@
|
|
|
39
45
|
&:active {
|
|
40
46
|
background-color: var(--hs-button-backgroundColor-active, var(--hs-button-backgroundColor));
|
|
41
47
|
color: var(--hs-button-color-active, var(--hs-button-color));
|
|
42
|
-
border: var(--hs-button-
|
|
48
|
+
border-style: var(--hs-button-borderStyle-active, var(--hs-button-borderStyle));
|
|
49
|
+
border-width: var(--hs-button-borderWidth-active, var(--hs-button-borderWidth));
|
|
50
|
+
border-color: var(--hs-button-borderColor-active, var(--hs-button-borderColor));
|
|
43
51
|
}
|
|
44
52
|
|
|
45
53
|
&:disabled {
|
|
@@ -284,7 +284,9 @@ The Button component is themed via `--hs-button-*` CSS variables, which are prov
|
|
|
284
284
|
- `--hs-button-backgroundColor`: Background color
|
|
285
285
|
- `--hs-button-color`: Text color
|
|
286
286
|
- `--hs-button-borderRadius`: Border radius
|
|
287
|
-
- `--hs-button-
|
|
287
|
+
- `--hs-button-borderStyle`: Border style
|
|
288
|
+
- `--hs-button-borderWidth`: Border width
|
|
289
|
+
- `--hs-button-borderColor`: Border color
|
|
288
290
|
- `--hs-button-fontSize`: Font size
|
|
289
291
|
- `--hs-button-fontFamily`: Font family
|
|
290
292
|
- `--hs-button-fontStyle`: Font style
|
|
@@ -294,17 +296,23 @@ The Button component is themed via `--hs-button-*` CSS variables, which are prov
|
|
|
294
296
|
**Hover States (from theme):**
|
|
295
297
|
- `--hs-button-backgroundColor-hover`: Hover background (falls back to base)
|
|
296
298
|
- `--hs-button-color-hover`: Hover text color (falls back to base)
|
|
297
|
-
- `--hs-button-
|
|
299
|
+
- `--hs-button-borderStyle-hover`: Hover border style (falls back to base)
|
|
300
|
+
- `--hs-button-borderWidth-hover`: Hover border width (falls back to base)
|
|
301
|
+
- `--hs-button-borderColor-hover`: Hover border color (falls back to base)
|
|
298
302
|
|
|
299
303
|
**Focus States (from theme):**
|
|
300
304
|
- `--hs-button-backgroundColor-focus`: Focus background (falls back to base)
|
|
301
305
|
- `--hs-button-color-focus`: Focus text color (falls back to base)
|
|
302
|
-
- `--hs-button-
|
|
306
|
+
- `--hs-button-borderStyle-focus`: Focus border style (falls back to base)
|
|
307
|
+
- `--hs-button-borderWidth-focus`: Focus border width (falls back to base)
|
|
308
|
+
- `--hs-button-borderColor-focus`: Focus border color (falls back to base)
|
|
303
309
|
|
|
304
310
|
**Active States (from theme):**
|
|
305
311
|
- `--hs-button-backgroundColor-active`: Active background (falls back to base)
|
|
306
312
|
- `--hs-button-color-active`: Active text color (falls back to base)
|
|
307
|
-
- `--hs-button-
|
|
313
|
+
- `--hs-button-borderStyle-active`: Active border style (falls back to base)
|
|
314
|
+
- `--hs-button-borderWidth-active`: Active border width (falls back to base)
|
|
315
|
+
- `--hs-button-borderColor-active`: Active border color (falls back to base)
|
|
308
316
|
|
|
309
317
|
### Hardcoded Layout Values
|
|
310
318
|
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
--hs-button-backgroundColor: #0066cc;
|
|
4
4
|
--hs-button-color: #ffffff;
|
|
5
5
|
--hs-button-borderRadius: 4px;
|
|
6
|
-
--hs-button-
|
|
6
|
+
--hs-button-borderStyle: solid;
|
|
7
|
+
--hs-button-borderWidth: 1px;
|
|
8
|
+
--hs-button-borderColor: transparent;
|
|
7
9
|
--hs-button-fontSize: 14px;
|
|
8
10
|
--hs-button-fontFamily: inherit;
|
|
9
11
|
--hs-button-fontStyle: normal;
|
|
@@ -11,11 +13,17 @@
|
|
|
11
13
|
--hs-button-textDecoration: none;
|
|
12
14
|
--hs-button-backgroundColor-hover: #0052a3;
|
|
13
15
|
--hs-button-color-hover: #ffffff;
|
|
14
|
-
--hs-button-
|
|
16
|
+
--hs-button-borderStyle-hover: solid;
|
|
17
|
+
--hs-button-borderWidth-hover: 1px;
|
|
18
|
+
--hs-button-borderColor-hover: transparent;
|
|
15
19
|
--hs-button-backgroundColor-focus: #0066cc;
|
|
16
20
|
--hs-button-color-focus: #ffffff;
|
|
17
|
-
--hs-button-
|
|
21
|
+
--hs-button-borderStyle-focus: solid;
|
|
22
|
+
--hs-button-borderWidth-focus: 1px;
|
|
23
|
+
--hs-button-borderColor-focus: transparent;
|
|
18
24
|
--hs-button-backgroundColor-active: #004080;
|
|
19
25
|
--hs-button-color-active: #ffffff;
|
|
20
|
-
--hs-button-
|
|
26
|
+
--hs-button-borderStyle-active: solid;
|
|
27
|
+
--hs-button-borderWidth-active: 1px;
|
|
28
|
+
--hs-button-borderColor-active: transparent;
|
|
21
29
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
.card {
|
|
2
|
+
--hs-section-color: var(--hs-card-color); // overrides card-based typography settings
|
|
3
|
+
|
|
2
4
|
display: flex;
|
|
3
5
|
flex-direction: column;
|
|
4
6
|
box-sizing: border-box;
|
|
@@ -6,9 +8,7 @@
|
|
|
6
8
|
border-radius: var(--hs-card-borderRadius, 8px);
|
|
7
9
|
background-color: var(--hs-card-backgroundColor, #ffffff);
|
|
8
10
|
color: var(--hs-card-color, inherit);
|
|
9
|
-
border: var(--hs-card-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
color: inherit;
|
|
13
|
-
}
|
|
11
|
+
border-style: var(--hs-card-borderStyle, none);
|
|
12
|
+
border-width: var(--hs-card-borderWidth, 0);
|
|
13
|
+
border-color: var(--hs-card-borderColor, transparent);
|
|
14
14
|
}
|
|
@@ -137,7 +137,9 @@ FeatureCardModule.fields = (
|
|
|
137
137
|
- `--hs-card-borderRadius`: Border radius
|
|
138
138
|
- `--hs-card-backgroundColor`: Background color
|
|
139
139
|
- `--hs-card-color`: Text color
|
|
140
|
-
- `--hs-card-
|
|
140
|
+
- `--hs-card-borderStyle`: Border style (e.g. `solid`, `none`)
|
|
141
|
+
- `--hs-card-borderWidth`: Border width (e.g. `1px`)
|
|
142
|
+
- `--hs-card-borderColor`: Border color
|
|
141
143
|
|
|
142
144
|
|
|
143
145
|
## Accessibility
|
|
@@ -4,27 +4,35 @@
|
|
|
4
4
|
--hs-card-borderRadius: 10px;
|
|
5
5
|
--hs-card-backgroundColor: rgb(255, 255, 255);
|
|
6
6
|
--hs-card-color: rgb(28, 28, 31);
|
|
7
|
-
--hs-card-
|
|
7
|
+
--hs-card-borderStyle: solid;
|
|
8
|
+
--hs-card-borderWidth: 1px;
|
|
9
|
+
--hs-card-borderColor: #e0e0e0;
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
:global([data-card-variant='card2']) {
|
|
11
13
|
--hs-card-borderRadius: 10px;
|
|
12
14
|
--hs-card-backgroundColor: rgb(249, 249, 249);
|
|
13
15
|
--hs-card-color: rgb(28, 28, 31);
|
|
14
|
-
--hs-card-
|
|
16
|
+
--hs-card-borderStyle: solid;
|
|
17
|
+
--hs-card-borderWidth: 1px;
|
|
18
|
+
--hs-card-borderColor: #e0e0e0;
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
:global([data-card-variant='card3']) {
|
|
18
22
|
--hs-card-borderRadius: 10px;
|
|
19
23
|
--hs-card-backgroundColor: rgb(28, 28, 31);
|
|
20
24
|
--hs-card-color: rgb(255,255,255);
|
|
21
|
-
--hs-card-
|
|
25
|
+
--hs-card-borderStyle: solid;
|
|
26
|
+
--hs-card-borderWidth: 1px;
|
|
27
|
+
--hs-card-borderColor: #e0e0e0;
|
|
22
28
|
}
|
|
23
29
|
|
|
24
30
|
:global([data-card-variant='card4']) {
|
|
25
31
|
--hs-card-borderRadius: 10px;
|
|
26
32
|
--hs-card-backgroundColor: rgb(36, 36, 36);
|
|
27
33
|
--hs-card-color: rgb(255,255,255);
|
|
28
|
-
--hs-card-
|
|
34
|
+
--hs-card-borderStyle: solid;
|
|
35
|
+
--hs-card-borderWidth: 1px;
|
|
36
|
+
--hs-card-borderColor: #e0e0e0;
|
|
29
37
|
}
|
|
30
38
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
.placeholderForm {
|
|
2
|
+
padding: 32px;
|
|
3
|
+
border-radius: var(--hs-form-borderRadius, 8px);
|
|
4
|
+
background-color: var(--hs-form-backgroundColor, rgba(255, 255, 255, 1));
|
|
5
|
+
border-style: var(--hs-form-borderStyle, solid);
|
|
6
|
+
border-width: var(--hs-form-borderWidth, 1px);
|
|
7
|
+
border-color: var(--hs-form-borderColor, #E0E0E0);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.field {
|
|
11
|
+
margin-block-end: 24px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.field:last-of-type {
|
|
15
|
+
margin-block-end: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.label {
|
|
19
|
+
display: block;
|
|
20
|
+
margin-block-end: 8px;
|
|
21
|
+
color: var(--hs-form-label-color, #141414);
|
|
22
|
+
font-size: var(--hs-form-label-fontSize, 16px);
|
|
23
|
+
font-family: var(--hs-form-label-fontFamily, inherit);
|
|
24
|
+
font-style: var(--hs-form-label-fontStyle, normal);
|
|
25
|
+
font-weight: var(--hs-form-label-fontWeight, 600);
|
|
26
|
+
text-decoration: var(--hs-form-label-textDecoration, none);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.input {
|
|
30
|
+
width: 100%;
|
|
31
|
+
padding-block: 12px;
|
|
32
|
+
padding-inline: 16px;
|
|
33
|
+
border-radius: var(--hs-form-field-borderRadius, 8px);
|
|
34
|
+
background-color: var(--hs-form-field-backgroundColor, rgba(249, 249, 249, 1));
|
|
35
|
+
border-style: var(--hs-form-field-borderStyle, solid);
|
|
36
|
+
border-width: var(--hs-form-field-borderWidth, 1px);
|
|
37
|
+
border-color: var(--hs-form-field-borderColor, #E0E0E0);
|
|
38
|
+
color: var(--hs-form-input-color, #141414);
|
|
39
|
+
font-size: var(--hs-form-input-fontSize, 16px);
|
|
40
|
+
font-family: var(--hs-form-input-fontFamily, inherit);
|
|
41
|
+
font-style: var(--hs-form-input-fontStyle, normal);
|
|
42
|
+
font-weight: var(--hs-form-input-fontWeight, 400);
|
|
43
|
+
text-decoration: var(--hs-form-input-textDecoration, none);
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.input::placeholder {
|
|
48
|
+
color: var(--hs-form-placeholder-color, rgba(113, 113, 113, 1));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.input:focus {
|
|
52
|
+
background-color: var(--hs-form-field-backgroundColor-focus, var(--hs-form-field-backgroundColor, rgba(249, 249, 249, 1)));
|
|
53
|
+
border-style: var(--hs-form-field-borderStyle-focus, var(--hs-form-field-borderStyle, solid));
|
|
54
|
+
border-width: var(--hs-form-field-borderWidth-focus, var(--hs-form-field-borderWidth, 1px));
|
|
55
|
+
border-color: var(--hs-form-field-borderColor-focus, var(--hs-form-field-borderColor, #E0E0E0));
|
|
56
|
+
outline: none;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.submitButton {
|
|
60
|
+
display: inline-block;
|
|
61
|
+
width: 100%;
|
|
62
|
+
margin-block-start: 24px;
|
|
63
|
+
padding-block: 12px;
|
|
64
|
+
padding-inline: 24px;
|
|
65
|
+
border-radius: var(--hs-form-borderRadius, 8px);
|
|
66
|
+
border: none;
|
|
67
|
+
background-color: var(--hs-form-input-color, #141414);
|
|
68
|
+
color: var(--hs-form-backgroundColor, #ffffff);
|
|
69
|
+
font-size: var(--hs-form-label-fontSize, 16px);
|
|
70
|
+
font-family: var(--hs-form-label-fontFamily, inherit);
|
|
71
|
+
font-weight: 600;
|
|
72
|
+
cursor: default;
|
|
73
|
+
text-align: center;
|
|
74
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import styles from './PlaceholderForm.module.css';
|
|
2
|
+
|
|
3
|
+
const PlaceholderForm = () => {
|
|
4
|
+
return (
|
|
5
|
+
<div className={styles.placeholderForm}>
|
|
6
|
+
<form>
|
|
7
|
+
<div className={styles.field}>
|
|
8
|
+
<label className={styles.label}>First name</label>
|
|
9
|
+
<div>
|
|
10
|
+
<input className={styles.input} type="text" disabled />
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
<div className={styles.field}>
|
|
14
|
+
<label className={styles.label}>Last name</label>
|
|
15
|
+
<div>
|
|
16
|
+
<input className={styles.input} type="text" disabled />
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
<div className={styles.field}>
|
|
20
|
+
<label className={styles.label}>Email</label>
|
|
21
|
+
<div>
|
|
22
|
+
<input className={styles.input} type="text" disabled />
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
<button type="button" disabled className={styles.submitButton}>Get free widget</button>
|
|
26
|
+
</form>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default PlaceholderForm;
|
|
@@ -4,7 +4,7 @@ import { StyleFieldsProps } from './types.js';
|
|
|
4
4
|
const StyleFields = ({
|
|
5
5
|
formVariantLabel = 'Form variant',
|
|
6
6
|
formVariantName = 'formVariant',
|
|
7
|
-
formVariantDefault = {
|
|
7
|
+
formVariantDefault = { variantName: 'form1' },
|
|
8
8
|
}: StyleFieldsProps) => {
|
|
9
9
|
return (
|
|
10
10
|
<VariantSelectionField
|
|
@@ -12,6 +12,7 @@ const StyleFields = ({
|
|
|
12
12
|
name={formVariantName}
|
|
13
13
|
variantDefinitionName="form"
|
|
14
14
|
default={formVariantDefault}
|
|
15
|
+
required={true}
|
|
15
16
|
/>
|
|
16
17
|
);
|
|
17
18
|
};
|