@dnanpm/styleguide 4.0.1 → 4.0.3
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/build/cjs/components/Button/Button.d.ts +2 -1
- package/build/cjs/components/Button/Button.js +22 -16
- package/build/cjs/components/ButtonArrow/ButtonArrow.js +1 -1
- package/build/cjs/components/ButtonCard/ButtonCard.js +11 -8
- package/build/cjs/components/ButtonIcon/ButtonIcon.js +2 -1
- package/build/cjs/components/ButtonPrimary/ButtonPrimary.js +6 -4
- package/build/cjs/components/ButtonSecondary/ButtonSecondary.js +6 -4
- package/build/cjs/components/Footer/Components/FooterComponents.js +1 -1
- package/build/cjs/components/Hero/Hero.js +25 -23
- package/build/cjs/components/MainHeaderNavigation/MainHeaderNavigation.js +2 -2
- package/build/cjs/components/Pill/Pill.js +3 -1
- package/build/cjs/themes/theme.d.ts +18 -0
- package/build/cjs/themes/theme.js +2 -0
- package/build/cjs/themes/themeComponents/layout.d.ts +43 -0
- package/build/cjs/themes/themeComponents/layout.js +47 -0
- package/build/cjs/themes/themeComponents/navigation.d.ts +0 -1
- package/build/es/components/Button/Button.d.ts +2 -1
- package/build/es/components/Button/Button.js +22 -16
- package/build/es/components/ButtonArrow/ButtonArrow.js +1 -1
- package/build/es/components/ButtonCard/ButtonCard.js +11 -8
- package/build/es/components/ButtonIcon/ButtonIcon.js +2 -1
- package/build/es/components/ButtonPrimary/ButtonPrimary.js +6 -4
- package/build/es/components/ButtonSecondary/ButtonSecondary.js +6 -4
- package/build/es/components/Footer/Components/FooterComponents.js +1 -1
- package/build/es/components/Hero/Hero.js +26 -24
- package/build/es/components/MainHeaderNavigation/MainHeaderNavigation.js +2 -2
- package/build/es/components/Pill/Pill.js +3 -1
- package/build/es/themes/theme.d.ts +18 -0
- package/build/es/themes/theme.js +2 -0
- package/build/es/themes/themeComponents/layout.d.ts +43 -0
- package/build/es/themes/themeComponents/layout.js +43 -0
- package/build/es/themes/themeComponents/navigation.d.ts +0 -1
- package/package.json +6 -6
|
@@ -60,7 +60,8 @@ export interface Props {
|
|
|
60
60
|
*/
|
|
61
61
|
fullWidth?: boolean;
|
|
62
62
|
/**
|
|
63
|
-
* Allows
|
|
63
|
+
* Allows disabling the component functionality.
|
|
64
|
+
* When `href` is defined, disables the link functionality.
|
|
64
65
|
*
|
|
65
66
|
* @default false
|
|
66
67
|
*/
|
|
@@ -31,6 +31,8 @@ const shade = {
|
|
|
31
31
|
},
|
|
32
32
|
};
|
|
33
33
|
const Element = styledComponents.styled.button `
|
|
34
|
+
text-align: center;
|
|
35
|
+
transition: all 0.2s ease-in-out;
|
|
34
36
|
display: inline-block;
|
|
35
37
|
font-family: ${theme.default.fontFamily.default};
|
|
36
38
|
font-weight: ${theme.default.fontWeight.bold};
|
|
@@ -51,7 +53,7 @@ const Element = styledComponents.styled.button `
|
|
|
51
53
|
display: inline-flex;
|
|
52
54
|
}
|
|
53
55
|
|
|
54
|
-
&:focus-visible {
|
|
56
|
+
&:focus-visible:not(:disabled):not([disabled]):not([aria-disabled='true']) {
|
|
55
57
|
color: ${({ $darkBg }) => ($darkBg ? theme.default.color.text.plum : theme.default.color.text.white)};
|
|
56
58
|
background-color: ${({ $darkBg }) => $darkBg ? theme.default.color.default.white : shade.plum.darker};
|
|
57
59
|
border: 2px solid
|
|
@@ -61,9 +63,10 @@ const Element = styledComponents.styled.button `
|
|
|
61
63
|
outline: none;
|
|
62
64
|
}
|
|
63
65
|
|
|
64
|
-
&:hover {
|
|
66
|
+
&:hover:not(:disabled):not([disabled]):not([aria-disabled='true']) {
|
|
65
67
|
color: ${({ $darkBg }) => ($darkBg ? theme.default.color.text.plum : theme.default.color.text.white)};
|
|
66
68
|
background-color: ${({ $darkBg }) => $darkBg ? theme.default.color.default.white : shade.plum.darker};
|
|
69
|
+
text-decoration: none;
|
|
67
70
|
|
|
68
71
|
&:focus-visible {
|
|
69
72
|
border: 2px solid
|
|
@@ -73,7 +76,7 @@ const Element = styledComponents.styled.button `
|
|
|
73
76
|
}
|
|
74
77
|
}
|
|
75
78
|
|
|
76
|
-
&:active {
|
|
79
|
+
&:active:not(:disabled):not([disabled]):not([aria-disabled='true']) {
|
|
77
80
|
color: ${({ $darkBg }) => ($darkBg ? theme.default.color.text.plum : theme.default.color.text.white)};
|
|
78
81
|
background-color: ${({ $darkBg }) => $darkBg
|
|
79
82
|
? theme.default.color.default.white + theme.default.color.transparency.T90
|
|
@@ -86,7 +89,8 @@ const Element = styledComponents.styled.button `
|
|
|
86
89
|
}
|
|
87
90
|
|
|
88
91
|
&:disabled,
|
|
89
|
-
&[disabled]
|
|
92
|
+
&[disabled],
|
|
93
|
+
&[aria-disabled='true'] {
|
|
90
94
|
color: ${({ $darkBg }) => $darkBg
|
|
91
95
|
? theme.default.color.text.white + theme.default.color.transparency.T70
|
|
92
96
|
: theme.default.color.text.gray};
|
|
@@ -94,19 +98,10 @@ const Element = styledComponents.styled.button `
|
|
|
94
98
|
${({ $darkBg }) => $darkBg
|
|
95
99
|
? theme.default.color.default.white + theme.default.color.transparency.T30
|
|
96
100
|
: theme.default.color.default.plum + theme.default.color.transparency.T30};
|
|
97
|
-
|
|
101
|
+
cursor: not-allowed;
|
|
102
|
+
outline: none;
|
|
98
103
|
}
|
|
99
104
|
|
|
100
|
-
${({ href }) => href &&
|
|
101
|
-
`
|
|
102
|
-
text-align: center;
|
|
103
|
-
|
|
104
|
-
&:hover {
|
|
105
|
-
text-decoration: none;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
`}
|
|
109
|
-
|
|
110
105
|
${({ $loading }) => $loading &&
|
|
111
106
|
`
|
|
112
107
|
pointer-events: none;
|
|
@@ -127,7 +122,18 @@ const Element = styledComponents.styled.button `
|
|
|
127
122
|
const Button = (_a) => {
|
|
128
123
|
var _b;
|
|
129
124
|
var { type = 'submit', 'data-testid': dataTestId, 'data-track-value': dataTrackValue, 'aria-label': ariaLabel } = _a, props = tslib.__rest(_a, ["type", 'data-testid', 'data-track-value', 'aria-label']);
|
|
130
|
-
|
|
125
|
+
const isDisabledAnchor = props.disabled && props.href;
|
|
126
|
+
const handleClick = (event) => {
|
|
127
|
+
if (isDisabledAnchor) {
|
|
128
|
+
event.preventDefault();
|
|
129
|
+
event.stopPropagation();
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (props.onClick) {
|
|
133
|
+
props.onClick(event);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
return (React__default.default.createElement(Element, Object.assign({ id: props.id, as: (_b = props.nextLink) !== null && _b !== void 0 ? _b : (props.href ? 'a' : undefined), type: props.href ? undefined : type, href: isDisabledAnchor ? undefined : props.href, target: props.href ? props.target : undefined, rel: props.target === '_blank' ? 'noopener noreferrer' : undefined, onClick: handleClick, onMouseDown: props.onMouseDown, "$small": props.small, "$darkBg": props.darkBg, "$fullWidth": props.fullWidth, "$loading": props.loading, tabIndex: props.loading || isDisabledAnchor ? -1 : 0, "data-loading": props.loading, className: props.className, "data-testid": dataTestId, "data-track-value": dataTrackValue, "aria-label": ariaLabel, "aria-disabled": isDisabledAnchor ? 'true' : undefined }, props.dataAttributes, (!props.href && {
|
|
131
137
|
name: props.name,
|
|
132
138
|
disabled: props.disabled,
|
|
133
139
|
})), props.loading ? (React__default.default.createElement(PixelLoader.default, { color: props.darkBg ? theme.default.color.default.white : theme.default.color.default.plum, label: props.loadingLabel })) : (React__default.default.createElement("span", { "data-testid": dataTestId && `${dataTestId}-text` }, props.children))));
|
|
@@ -44,6 +44,7 @@ const ButtonCardWrapper = styledComponents.styled.button `
|
|
|
44
44
|
`;
|
|
45
45
|
const StyledBox = styledComponents.styled(Box.default) `
|
|
46
46
|
display: flex;
|
|
47
|
+
text-align: left;
|
|
47
48
|
gap: ${({ size }) => (size === 'small' ? '0.313rem' : '1rem')};
|
|
48
49
|
border: 1px solid ${theme.default.color.line.L03};
|
|
49
50
|
padding: ${({ size }) => (size === 'small' ? '0.625rem' : '1rem')};
|
|
@@ -65,18 +66,17 @@ const TextContentWrapper = styledComponents.styled.div `
|
|
|
65
66
|
min-width: 0;
|
|
66
67
|
`;
|
|
67
68
|
const TextContent = styledComponents.styled.div `
|
|
68
|
-
|
|
69
|
-
align-items: flex-start;
|
|
70
|
-
flex-direction: column;
|
|
71
|
-
min-width: 0;
|
|
69
|
+
flex: 1 1 auto;
|
|
72
70
|
`;
|
|
73
71
|
const Title = styledComponents.styled.div `
|
|
74
72
|
font-size: ${theme.default.fontSize.default};
|
|
75
73
|
line-height: ${theme.default.lineHeight.default};
|
|
76
74
|
font-weight: ${theme.default.fontWeight.bold};
|
|
77
|
-
|
|
75
|
+
display: -webkit-box;
|
|
76
|
+
-webkit-box-orient: vertical;
|
|
77
|
+
-webkit-line-clamp: 2;
|
|
78
78
|
overflow: hidden;
|
|
79
|
-
|
|
79
|
+
word-break: break-word;
|
|
80
80
|
max-width: 100%;
|
|
81
81
|
|
|
82
82
|
${({ size }) => size === 'small' &&
|
|
@@ -84,6 +84,7 @@ const Title = styledComponents.styled.div `
|
|
|
84
84
|
font-size: ${theme.default.fontSize.s};
|
|
85
85
|
line-height: ${theme.default.lineHeight.s};
|
|
86
86
|
font-weight: ${theme.default.fontWeight.medium};
|
|
87
|
+
-webkit-line-clamp: 1;
|
|
87
88
|
`}
|
|
88
89
|
|
|
89
90
|
${({ size }) => size === 'large' &&
|
|
@@ -96,9 +97,11 @@ const Subtitle = styledComponents.styled.div `
|
|
|
96
97
|
font-size: ${theme.default.fontSize.s};
|
|
97
98
|
line-height: ${theme.default.lineHeight.s};
|
|
98
99
|
font-weight: ${theme.default.fontWeight.medium};
|
|
99
|
-
|
|
100
|
+
display: -webkit-box;
|
|
101
|
+
-webkit-box-orient: vertical;
|
|
102
|
+
-webkit-line-clamp: 2;
|
|
100
103
|
overflow: hidden;
|
|
101
|
-
|
|
104
|
+
word-break: break-word;
|
|
102
105
|
max-width: 100%;
|
|
103
106
|
|
|
104
107
|
${({ size }) => size === 'small' &&
|
|
@@ -13,25 +13,27 @@ const ButtonPrimary = styledComponents.styled(Button.default) `
|
|
|
13
13
|
background-color: ${theme.default.color.default.pink};
|
|
14
14
|
border: 2px solid ${theme.default.color.default.pink};
|
|
15
15
|
|
|
16
|
-
&:focus
|
|
16
|
+
&:focus:not(:disabled):not([disabled]):not([aria-disabled='true']),
|
|
17
|
+
&:focus-visible:not(:disabled):not([disabled]):not([aria-disabled='true']) {
|
|
17
18
|
color: ${theme.default.color.text.white};
|
|
18
19
|
background-color: ${theme.default.color.default.pink};
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
&:hover {
|
|
22
|
+
&:hover:not(:disabled):not([disabled]):not([aria-disabled='true']) {
|
|
22
23
|
color: ${theme.default.color.text.white};
|
|
23
24
|
background-color: ${Button.shade.pink.darker};
|
|
24
25
|
border: 2px solid ${Button.shade.pink.darker};
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
&:active {
|
|
28
|
+
&:active:not(:disabled):not([disabled]):not([aria-disabled='true']) {
|
|
28
29
|
color: ${theme.default.color.text.white};
|
|
29
30
|
background-color: ${Button.shade.pink.lighter};
|
|
30
31
|
border: 2px solid ${Button.shade.pink.lighter};
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
&:disabled,
|
|
34
|
-
&[disabled]
|
|
35
|
+
&[disabled],
|
|
36
|
+
&[aria-disabled='true'] {
|
|
35
37
|
background-color: ${theme.default.color.default.pink + theme.default.color.transparency.T30};
|
|
36
38
|
border: 2px solid ${theme.default.color.default.pink + theme.default.color.transparency.T30};
|
|
37
39
|
background-clip: padding-box;
|
|
@@ -13,25 +13,27 @@ const ButtonSecondary = styledComponents.styled(Button.default) `
|
|
|
13
13
|
background-color: ${theme.default.color.background.sand.E02};
|
|
14
14
|
border: 2px solid ${theme.default.color.line.L02};
|
|
15
15
|
|
|
16
|
-
&:focus
|
|
16
|
+
&:focus:not(:disabled):not([disabled]):not([aria-disabled='true']),
|
|
17
|
+
&:focus-visible:not(:disabled):not([disabled]):not([aria-disabled='true']) {
|
|
17
18
|
color: ${theme.default.color.text.plum};
|
|
18
19
|
background-color: ${theme.default.color.background.sand.E02};
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
&:hover {
|
|
22
|
+
&:hover:not(:disabled):not([disabled]):not([aria-disabled='true']) {
|
|
22
23
|
color: ${theme.default.color.text.plum};
|
|
23
24
|
background-color: ${Button.shade.sand.E02.darker};
|
|
24
25
|
border: 2px solid ${Button.shade.sand.E02.darker};
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
&:active {
|
|
28
|
+
&:active:not(:disabled):not([disabled]):not([aria-disabled='true']) {
|
|
28
29
|
color: ${theme.default.color.text.plum};
|
|
29
30
|
background-color: ${Button.shade.sand.E02.lighter};
|
|
30
31
|
border: 2px solid ${Button.shade.sand.E02.lighter};
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
&:disabled,
|
|
34
|
-
&[disabled]
|
|
35
|
+
&[disabled],
|
|
36
|
+
&[aria-disabled='true'] {
|
|
35
37
|
background-color: ${theme.default.color.background.sand.E02 + theme.default.color.transparency.T30};
|
|
36
38
|
border: 2px solid ${theme.default.color.line.L02 + theme.default.color.transparency.T30};
|
|
37
39
|
background-clip: padding-box;
|
|
@@ -37,7 +37,7 @@ const BaseContainer = styledComponents.styled.div `
|
|
|
37
37
|
padding: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 2)};
|
|
38
38
|
gap: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 3)};
|
|
39
39
|
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
40
|
-
max-width:
|
|
40
|
+
max-width: ${theme.default.layout.content.containerMaxWidth.wide}px;
|
|
41
41
|
margin-left: auto;
|
|
42
42
|
margin-right: auto;
|
|
43
43
|
|
|
@@ -17,18 +17,19 @@ const HERO_CONSTANTS = {
|
|
|
17
17
|
mobileHeight: 220,
|
|
18
18
|
desktopMinHeight: 460,
|
|
19
19
|
logoMaxWidth: 500,
|
|
20
|
+
contentMaxWidth: 650,
|
|
20
21
|
};
|
|
21
22
|
const HeroContainer = styledComponents.styled.div `
|
|
22
23
|
position: relative;
|
|
23
24
|
margin-bottom: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1.25)};
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
${({ $variant }) => styledUtils.media.md `
|
|
26
27
|
min-height: calc(
|
|
27
28
|
${HERO_CONSTANTS.desktopMinHeight}px + ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 4)}
|
|
28
29
|
);
|
|
29
30
|
display: flex;
|
|
30
|
-
justify-content: ${
|
|
31
|
-
}
|
|
31
|
+
justify-content: ${$variant === 'centered' || $variant === 'centered-text-left' ? 'center' : 'flex-start'};
|
|
32
|
+
`}
|
|
32
33
|
`;
|
|
33
34
|
const HeroImage = styledComponents.styled.div `
|
|
34
35
|
position: relative;
|
|
@@ -43,14 +44,14 @@ const HeroImage = styledComponents.styled.div `
|
|
|
43
44
|
background-position: bottom;
|
|
44
45
|
`}
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
${styledUtils.media.md `
|
|
47
48
|
height: auto;
|
|
48
49
|
position: absolute;
|
|
49
50
|
top: 0;
|
|
50
51
|
left: 0;
|
|
51
52
|
right: 0;
|
|
52
53
|
bottom: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 4)};
|
|
53
|
-
}
|
|
54
|
+
`}
|
|
54
55
|
|
|
55
56
|
img {
|
|
56
57
|
width: 100%;
|
|
@@ -85,31 +86,32 @@ const LogoImageContainer = styledComponents.styled.div `
|
|
|
85
86
|
object-fit: contain;
|
|
86
87
|
}
|
|
87
88
|
|
|
88
|
-
|
|
89
|
+
${styledUtils.media.md `
|
|
89
90
|
top: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1.25)};
|
|
90
91
|
bottom: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1.25)};
|
|
91
92
|
right: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1.25)};
|
|
92
93
|
left: 50%;
|
|
93
|
-
}
|
|
94
|
+
`}
|
|
94
95
|
|
|
95
|
-
|
|
96
|
-
left: calc(min(64%,
|
|
97
|
-
}
|
|
96
|
+
${styledUtils.media.lg `
|
|
97
|
+
left: calc(min(64%, ${HERO_CONSTANTS.contentMaxWidth + 100}px));
|
|
98
|
+
`}
|
|
98
99
|
`;
|
|
99
100
|
const ContentWrap = styledComponents.styled.div `
|
|
100
101
|
width: 100%;
|
|
102
|
+
max-width: ${theme.default.layout.content.containerMaxWidth.wide}px;
|
|
101
103
|
padding: 0 ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1.25)};
|
|
102
104
|
margin: -${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 4)} auto 0;
|
|
103
105
|
z-index: 1;
|
|
104
106
|
|
|
105
|
-
|
|
107
|
+
${({ $variant }) => styledUtils.media.md `
|
|
106
108
|
display: flex;
|
|
107
109
|
align-items: flex-end;
|
|
108
110
|
padding: ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 4)}
|
|
109
111
|
${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 4)} 0;
|
|
110
112
|
margin: 0 auto;
|
|
111
|
-
justify-content: ${
|
|
112
|
-
}
|
|
113
|
+
justify-content: ${$variant === 'centered' || $variant === 'centered-text-left' ? 'center' : 'flex-start'};
|
|
114
|
+
`}
|
|
113
115
|
`;
|
|
114
116
|
const Content = styledComponents.styled(Box.default).attrs({
|
|
115
117
|
elevation: 'extraHigh',
|
|
@@ -118,19 +120,19 @@ const Content = styledComponents.styled(Box.default).attrs({
|
|
|
118
120
|
position: relative;
|
|
119
121
|
text-align: ${({ $variant }) => ($variant === 'centered' ? 'center' : 'left')};
|
|
120
122
|
|
|
121
|
-
|
|
123
|
+
${styledUtils.media.md `
|
|
122
124
|
padding: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 3)};
|
|
123
125
|
width: 50%;
|
|
124
|
-
max-width:
|
|
125
|
-
}
|
|
126
|
+
max-width: ${HERO_CONSTANTS.contentMaxWidth}px;
|
|
127
|
+
`}
|
|
126
128
|
|
|
127
|
-
|
|
129
|
+
${({ $variant }) => styledUtils.media.lg `
|
|
128
130
|
padding: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 4)};
|
|
129
131
|
width: 60%;
|
|
130
|
-
margin-left: ${
|
|
132
|
+
margin-left: ${$variant === 'centered' || $variant === 'centered-text-left'
|
|
131
133
|
? '0'
|
|
132
134
|
: `${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 4)}`};
|
|
133
|
-
}
|
|
135
|
+
`}
|
|
134
136
|
`;
|
|
135
137
|
const LabelContainer = styledComponents.styled.div `
|
|
136
138
|
margin: 0 0 ${styledUtils.getMultipliedSize(theme.default.base.baseHeight, 1)};
|
|
@@ -161,14 +163,14 @@ const TextContent = styledComponents.styled.div `
|
|
|
161
163
|
const CtaArea = styledComponents.styled.div `
|
|
162
164
|
margin: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 3)} 0 0;
|
|
163
165
|
display: flex;
|
|
164
|
-
flex-direction:
|
|
166
|
+
flex-direction: row;
|
|
167
|
+
flex-wrap: wrap;
|
|
165
168
|
gap: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 1.5)};
|
|
166
169
|
justify-content: ${({ $variant }) => ($variant === 'centered' ? 'center' : 'flex-start')};
|
|
167
170
|
|
|
168
|
-
|
|
169
|
-
flex-direction: row;
|
|
171
|
+
${styledUtils.media.md `
|
|
170
172
|
margin: ${styledUtils.getMultipliedSize(theme.default.base.baseWidth, 4)} 0 0;
|
|
171
|
-
}
|
|
173
|
+
`}
|
|
172
174
|
`;
|
|
173
175
|
const renderImage = (ImageComponent, imageProps) => {
|
|
174
176
|
if (!imageProps)
|
|
@@ -100,7 +100,7 @@ const GlobalNavigationContainer = styledComponents.styled.header `
|
|
|
100
100
|
width: 100%;
|
|
101
101
|
background-color: ${theme.default.color.background.white.default};
|
|
102
102
|
color: ${theme.default.color.text.black};
|
|
103
|
-
max-width:
|
|
103
|
+
max-width: ${theme.default.layout.page.maxWidth}px;
|
|
104
104
|
margin: 0 auto;
|
|
105
105
|
> nav {
|
|
106
106
|
background-color: ${theme.default.color.background.plum.E02};
|
|
@@ -109,7 +109,7 @@ const GlobalNavigationContainer = styledComponents.styled.header `
|
|
|
109
109
|
const NavigationWrapper = styledComponents.styled.div `
|
|
110
110
|
display: flex;
|
|
111
111
|
width: 100%;
|
|
112
|
-
max-width: ${
|
|
112
|
+
max-width: ${theme.default.layout.page.maxWidth}px;
|
|
113
113
|
margin: 0 auto;
|
|
114
114
|
height: ${navigation.navMaxHeight};
|
|
115
115
|
position: relative;
|
|
@@ -118,13 +118,15 @@ const Input = styledComponents.styled.input `
|
|
|
118
118
|
&:focus-visible {
|
|
119
119
|
outline: 0 none;
|
|
120
120
|
}
|
|
121
|
+
|
|
122
|
+
${({ $isDisabled }) => `cursor: ${$isDisabled ? 'not-allowed' : 'pointer'};`}
|
|
121
123
|
`;
|
|
122
124
|
const Pill = (_a) => {
|
|
123
125
|
var { type = 'none', 'data-testid': dataTestId } = _a, props = tslib.__rest(_a, ["type", 'data-testid']);
|
|
124
126
|
const isDefaultType = type === 'none';
|
|
125
127
|
return (React__default.default.createElement(Label, { as: isDefaultType ? 'button' : 'label', id: isDefaultType ? props.id : undefined, htmlFor: !isDefaultType ? props.id : undefined, type: isDefaultType ? 'button' : undefined, "$position": props.position, "$isChecked": props.isChecked || props.isDefaultChecked, "$isDisabled": props.isDisabled, className: props.className, "data-testid": dataTestId, "$isDefaultButtonStyle": props.isDefaultButtonStyle, "aria-label": props.ariaLabel, disabled: isDefaultType ? props.isDisabled : undefined, onClick: isDefaultType && !props.isDisabled ? props.onClick : undefined },
|
|
126
128
|
props.children,
|
|
127
|
-
!isDefaultType && (React__default.default.createElement(Input, { id: props.id, name: props.name, type: type, defaultChecked: props.isDefaultChecked, checked: props.isChecked, value: props.value, onChange: props.onChange, disabled: props.isDisabled, readOnly: !props.onChange, "data-testid": dataTestId && `${dataTestId}-input`, "data-checked": props.isChecked }))));
|
|
129
|
+
!isDefaultType && (React__default.default.createElement(Input, { id: props.id, name: props.name, type: type, defaultChecked: props.isDefaultChecked, checked: props.isChecked, value: props.value, onChange: props.onChange, disabled: props.isDisabled, readOnly: !props.onChange, "data-testid": dataTestId && `${dataTestId}-input`, "data-checked": props.isChecked, "$isDisabled": props.isDisabled }))));
|
|
128
130
|
};
|
|
129
131
|
|
|
130
132
|
exports.default = Pill;
|
|
@@ -143,6 +143,24 @@ declare const theme: {
|
|
|
143
143
|
grid: {
|
|
144
144
|
gutter: string;
|
|
145
145
|
};
|
|
146
|
+
layout: {
|
|
147
|
+
readonly page: {
|
|
148
|
+
readonly minWidth: 320;
|
|
149
|
+
readonly maxWidth: 2560;
|
|
150
|
+
};
|
|
151
|
+
readonly content: {
|
|
152
|
+
readonly maxWidth: {
|
|
153
|
+
readonly wide: 1200;
|
|
154
|
+
readonly medium: 860;
|
|
155
|
+
readonly narrow: 640;
|
|
156
|
+
};
|
|
157
|
+
readonly containerMaxWidth: {
|
|
158
|
+
readonly wide: 1280;
|
|
159
|
+
readonly medium: 940;
|
|
160
|
+
readonly narrow: 720;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
};
|
|
146
164
|
lineHeight: {
|
|
147
165
|
default: string;
|
|
148
166
|
xl: string;
|
|
@@ -11,6 +11,7 @@ var fontFamily = require('./themeComponents/fontFamily.js');
|
|
|
11
11
|
var fontSize = require('./themeComponents/fontSize.js');
|
|
12
12
|
var fontWeight = require('./themeComponents/fontWeight.js');
|
|
13
13
|
var forms = require('./themeComponents/forms.js');
|
|
14
|
+
var layout = require('./themeComponents/layout.js');
|
|
14
15
|
var lineHeight = require('./themeComponents/lineHeight.js');
|
|
15
16
|
var radius = require('./themeComponents/radius.js');
|
|
16
17
|
|
|
@@ -23,6 +24,7 @@ const theme = {
|
|
|
23
24
|
fontWeight: fontWeight.default,
|
|
24
25
|
form: forms.default,
|
|
25
26
|
grid: gridTheme.default,
|
|
27
|
+
layout: layout.default,
|
|
26
28
|
lineHeight: lineHeight.default,
|
|
27
29
|
media: styledUtils.media,
|
|
28
30
|
radius: radius.default,
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Page layout constants for consistent sizing across the design system.
|
|
3
|
+
*
|
|
4
|
+
* All values are numbers in pixels. Add 'px' suffix when used in CSS.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* const Container = styled.div`
|
|
8
|
+
* max-width: ${theme.layout.content.maxWidth.wide}px; // 1200px
|
|
9
|
+
* margin: 0 auto;
|
|
10
|
+
* `;
|
|
11
|
+
*/
|
|
12
|
+
declare const layout: {
|
|
13
|
+
/** Page-level layout constraints */
|
|
14
|
+
readonly page: {
|
|
15
|
+
/** Minimum page width: 320px */
|
|
16
|
+
readonly minWidth: 320;
|
|
17
|
+
/** Maximum page width: 2560px */
|
|
18
|
+
readonly maxWidth: 2560;
|
|
19
|
+
};
|
|
20
|
+
/** Content area layout constraints */
|
|
21
|
+
readonly content: {
|
|
22
|
+
/** Content max-width values (pure content area without padding) */
|
|
23
|
+
readonly maxWidth: {
|
|
24
|
+
/** Wide/Normal content: 1200px */
|
|
25
|
+
readonly wide: 1200;
|
|
26
|
+
/** Medium content: 860px */
|
|
27
|
+
readonly medium: 860;
|
|
28
|
+
/** Narrow/Small content: 640px */
|
|
29
|
+
readonly narrow: 640;
|
|
30
|
+
};
|
|
31
|
+
/** Container max-width values (content + 80px padding on each side) */
|
|
32
|
+
readonly containerMaxWidth: {
|
|
33
|
+
/** Wide container: 1280px (1200 + 80) */
|
|
34
|
+
readonly wide: 1280;
|
|
35
|
+
/** Medium container: 940px (860 + 80) */
|
|
36
|
+
readonly medium: 940;
|
|
37
|
+
/** Narrow container: 720px (640 + 80) */
|
|
38
|
+
readonly narrow: 720;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export type LayoutTheme = typeof layout;
|
|
43
|
+
export default layout;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Page layout constants for consistent sizing across the design system.
|
|
7
|
+
*
|
|
8
|
+
* All values are numbers in pixels. Add 'px' suffix when used in CSS.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const Container = styled.div`
|
|
12
|
+
* max-width: ${theme.layout.content.maxWidth.wide}px; // 1200px
|
|
13
|
+
* margin: 0 auto;
|
|
14
|
+
* `;
|
|
15
|
+
*/
|
|
16
|
+
const layout = {
|
|
17
|
+
/** Page-level layout constraints */
|
|
18
|
+
page: {
|
|
19
|
+
/** Minimum page width: 320px */
|
|
20
|
+
minWidth: 320,
|
|
21
|
+
/** Maximum page width: 2560px */
|
|
22
|
+
maxWidth: 2560,
|
|
23
|
+
},
|
|
24
|
+
/** Content area layout constraints */
|
|
25
|
+
content: {
|
|
26
|
+
/** Content max-width values (pure content area without padding) */
|
|
27
|
+
maxWidth: {
|
|
28
|
+
/** Wide/Normal content: 1200px */
|
|
29
|
+
wide: 1200,
|
|
30
|
+
/** Medium content: 860px */
|
|
31
|
+
medium: 860,
|
|
32
|
+
/** Narrow/Small content: 640px */
|
|
33
|
+
narrow: 640,
|
|
34
|
+
},
|
|
35
|
+
/** Container max-width values (content + 80px padding on each side) */
|
|
36
|
+
containerMaxWidth: {
|
|
37
|
+
/** Wide container: 1280px (1200 + 80) */
|
|
38
|
+
wide: 1280,
|
|
39
|
+
/** Medium container: 940px (860 + 80) */
|
|
40
|
+
medium: 940,
|
|
41
|
+
/** Narrow container: 720px (640 + 80) */
|
|
42
|
+
narrow: 720,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
exports.default = layout;
|
|
@@ -11,7 +11,6 @@ export declare const mobileLogoSize = "3.75em";
|
|
|
11
11
|
export declare const desktopLogoSize = "5.25em";
|
|
12
12
|
export declare const menuItemMargin = "1rem";
|
|
13
13
|
export declare const ribbonHeight = "1.5625rem";
|
|
14
|
-
export declare const wideMenuBreakpoint = 1280;
|
|
15
14
|
export declare const IconContainerWidth = "3.75rem";
|
|
16
15
|
export declare const IconContainerMinWidth = "2.5rem";
|
|
17
16
|
export declare const navMaxHeight = "3.75rem";
|
|
@@ -60,7 +60,8 @@ export interface Props {
|
|
|
60
60
|
*/
|
|
61
61
|
fullWidth?: boolean;
|
|
62
62
|
/**
|
|
63
|
-
* Allows
|
|
63
|
+
* Allows disabling the component functionality.
|
|
64
|
+
* When `href` is defined, disables the link functionality.
|
|
64
65
|
*
|
|
65
66
|
* @default false
|
|
66
67
|
*/
|
|
@@ -23,6 +23,8 @@ const shade = {
|
|
|
23
23
|
},
|
|
24
24
|
};
|
|
25
25
|
const Element = styled.button `
|
|
26
|
+
text-align: center;
|
|
27
|
+
transition: all 0.2s ease-in-out;
|
|
26
28
|
display: inline-block;
|
|
27
29
|
font-family: ${theme.fontFamily.default};
|
|
28
30
|
font-weight: ${theme.fontWeight.bold};
|
|
@@ -43,7 +45,7 @@ const Element = styled.button `
|
|
|
43
45
|
display: inline-flex;
|
|
44
46
|
}
|
|
45
47
|
|
|
46
|
-
&:focus-visible {
|
|
48
|
+
&:focus-visible:not(:disabled):not([disabled]):not([aria-disabled='true']) {
|
|
47
49
|
color: ${({ $darkBg }) => ($darkBg ? theme.color.text.plum : theme.color.text.white)};
|
|
48
50
|
background-color: ${({ $darkBg }) => $darkBg ? theme.color.default.white : shade.plum.darker};
|
|
49
51
|
border: 2px solid
|
|
@@ -53,9 +55,10 @@ const Element = styled.button `
|
|
|
53
55
|
outline: none;
|
|
54
56
|
}
|
|
55
57
|
|
|
56
|
-
&:hover {
|
|
58
|
+
&:hover:not(:disabled):not([disabled]):not([aria-disabled='true']) {
|
|
57
59
|
color: ${({ $darkBg }) => ($darkBg ? theme.color.text.plum : theme.color.text.white)};
|
|
58
60
|
background-color: ${({ $darkBg }) => $darkBg ? theme.color.default.white : shade.plum.darker};
|
|
61
|
+
text-decoration: none;
|
|
59
62
|
|
|
60
63
|
&:focus-visible {
|
|
61
64
|
border: 2px solid
|
|
@@ -65,7 +68,7 @@ const Element = styled.button `
|
|
|
65
68
|
}
|
|
66
69
|
}
|
|
67
70
|
|
|
68
|
-
&:active {
|
|
71
|
+
&:active:not(:disabled):not([disabled]):not([aria-disabled='true']) {
|
|
69
72
|
color: ${({ $darkBg }) => ($darkBg ? theme.color.text.plum : theme.color.text.white)};
|
|
70
73
|
background-color: ${({ $darkBg }) => $darkBg
|
|
71
74
|
? theme.color.default.white + theme.color.transparency.T90
|
|
@@ -78,7 +81,8 @@ const Element = styled.button `
|
|
|
78
81
|
}
|
|
79
82
|
|
|
80
83
|
&:disabled,
|
|
81
|
-
&[disabled]
|
|
84
|
+
&[disabled],
|
|
85
|
+
&[aria-disabled='true'] {
|
|
82
86
|
color: ${({ $darkBg }) => $darkBg
|
|
83
87
|
? theme.color.text.white + theme.color.transparency.T70
|
|
84
88
|
: theme.color.text.gray};
|
|
@@ -86,19 +90,10 @@ const Element = styled.button `
|
|
|
86
90
|
${({ $darkBg }) => $darkBg
|
|
87
91
|
? theme.color.default.white + theme.color.transparency.T30
|
|
88
92
|
: theme.color.default.plum + theme.color.transparency.T30};
|
|
89
|
-
|
|
93
|
+
cursor: not-allowed;
|
|
94
|
+
outline: none;
|
|
90
95
|
}
|
|
91
96
|
|
|
92
|
-
${({ href }) => href &&
|
|
93
|
-
`
|
|
94
|
-
text-align: center;
|
|
95
|
-
|
|
96
|
-
&:hover {
|
|
97
|
-
text-decoration: none;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
`}
|
|
101
|
-
|
|
102
97
|
${({ $loading }) => $loading &&
|
|
103
98
|
`
|
|
104
99
|
pointer-events: none;
|
|
@@ -119,7 +114,18 @@ const Element = styled.button `
|
|
|
119
114
|
const Button = (_a) => {
|
|
120
115
|
var _b;
|
|
121
116
|
var { type = 'submit', 'data-testid': dataTestId, 'data-track-value': dataTrackValue, 'aria-label': ariaLabel } = _a, props = __rest(_a, ["type", 'data-testid', 'data-track-value', 'aria-label']);
|
|
122
|
-
|
|
117
|
+
const isDisabledAnchor = props.disabled && props.href;
|
|
118
|
+
const handleClick = (event) => {
|
|
119
|
+
if (isDisabledAnchor) {
|
|
120
|
+
event.preventDefault();
|
|
121
|
+
event.stopPropagation();
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (props.onClick) {
|
|
125
|
+
props.onClick(event);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
return (React__default.createElement(Element, Object.assign({ id: props.id, as: (_b = props.nextLink) !== null && _b !== void 0 ? _b : (props.href ? 'a' : undefined), type: props.href ? undefined : type, href: isDisabledAnchor ? undefined : props.href, target: props.href ? props.target : undefined, rel: props.target === '_blank' ? 'noopener noreferrer' : undefined, onClick: handleClick, onMouseDown: props.onMouseDown, "$small": props.small, "$darkBg": props.darkBg, "$fullWidth": props.fullWidth, "$loading": props.loading, tabIndex: props.loading || isDisabledAnchor ? -1 : 0, "data-loading": props.loading, className: props.className, "data-testid": dataTestId, "data-track-value": dataTrackValue, "aria-label": ariaLabel, "aria-disabled": isDisabledAnchor ? 'true' : undefined }, props.dataAttributes, (!props.href && {
|
|
123
129
|
name: props.name,
|
|
124
130
|
disabled: props.disabled,
|
|
125
131
|
})), props.loading ? (React__default.createElement(PixelLoader, { color: props.darkBg ? theme.color.default.white : theme.color.default.plum, label: props.loadingLabel })) : (React__default.createElement("span", { "data-testid": dataTestId && `${dataTestId}-text` }, props.children))));
|
|
@@ -36,6 +36,7 @@ const ButtonCardWrapper = styled.button `
|
|
|
36
36
|
`;
|
|
37
37
|
const StyledBox = styled(Box) `
|
|
38
38
|
display: flex;
|
|
39
|
+
text-align: left;
|
|
39
40
|
gap: ${({ size }) => (size === 'small' ? '0.313rem' : '1rem')};
|
|
40
41
|
border: 1px solid ${theme.color.line.L03};
|
|
41
42
|
padding: ${({ size }) => (size === 'small' ? '0.625rem' : '1rem')};
|
|
@@ -57,18 +58,17 @@ const TextContentWrapper = styled.div `
|
|
|
57
58
|
min-width: 0;
|
|
58
59
|
`;
|
|
59
60
|
const TextContent = styled.div `
|
|
60
|
-
|
|
61
|
-
align-items: flex-start;
|
|
62
|
-
flex-direction: column;
|
|
63
|
-
min-width: 0;
|
|
61
|
+
flex: 1 1 auto;
|
|
64
62
|
`;
|
|
65
63
|
const Title = styled.div `
|
|
66
64
|
font-size: ${theme.fontSize.default};
|
|
67
65
|
line-height: ${theme.lineHeight.default};
|
|
68
66
|
font-weight: ${theme.fontWeight.bold};
|
|
69
|
-
|
|
67
|
+
display: -webkit-box;
|
|
68
|
+
-webkit-box-orient: vertical;
|
|
69
|
+
-webkit-line-clamp: 2;
|
|
70
70
|
overflow: hidden;
|
|
71
|
-
|
|
71
|
+
word-break: break-word;
|
|
72
72
|
max-width: 100%;
|
|
73
73
|
|
|
74
74
|
${({ size }) => size === 'small' &&
|
|
@@ -76,6 +76,7 @@ const Title = styled.div `
|
|
|
76
76
|
font-size: ${theme.fontSize.s};
|
|
77
77
|
line-height: ${theme.lineHeight.s};
|
|
78
78
|
font-weight: ${theme.fontWeight.medium};
|
|
79
|
+
-webkit-line-clamp: 1;
|
|
79
80
|
`}
|
|
80
81
|
|
|
81
82
|
${({ size }) => size === 'large' &&
|
|
@@ -88,9 +89,11 @@ const Subtitle = styled.div `
|
|
|
88
89
|
font-size: ${theme.fontSize.s};
|
|
89
90
|
line-height: ${theme.lineHeight.s};
|
|
90
91
|
font-weight: ${theme.fontWeight.medium};
|
|
91
|
-
|
|
92
|
+
display: -webkit-box;
|
|
93
|
+
-webkit-box-orient: vertical;
|
|
94
|
+
-webkit-line-clamp: 2;
|
|
92
95
|
overflow: hidden;
|
|
93
|
-
|
|
96
|
+
word-break: break-word;
|
|
94
97
|
max-width: 100%;
|
|
95
98
|
|
|
96
99
|
${({ size }) => size === 'small' &&
|
|
@@ -9,25 +9,27 @@ const ButtonPrimary = styled(Button) `
|
|
|
9
9
|
background-color: ${theme.color.default.pink};
|
|
10
10
|
border: 2px solid ${theme.color.default.pink};
|
|
11
11
|
|
|
12
|
-
&:focus
|
|
12
|
+
&:focus:not(:disabled):not([disabled]):not([aria-disabled='true']),
|
|
13
|
+
&:focus-visible:not(:disabled):not([disabled]):not([aria-disabled='true']) {
|
|
13
14
|
color: ${theme.color.text.white};
|
|
14
15
|
background-color: ${theme.color.default.pink};
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
&:hover {
|
|
18
|
+
&:hover:not(:disabled):not([disabled]):not([aria-disabled='true']) {
|
|
18
19
|
color: ${theme.color.text.white};
|
|
19
20
|
background-color: ${shade.pink.darker};
|
|
20
21
|
border: 2px solid ${shade.pink.darker};
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
&:active {
|
|
24
|
+
&:active:not(:disabled):not([disabled]):not([aria-disabled='true']) {
|
|
24
25
|
color: ${theme.color.text.white};
|
|
25
26
|
background-color: ${shade.pink.lighter};
|
|
26
27
|
border: 2px solid ${shade.pink.lighter};
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
&:disabled,
|
|
30
|
-
&[disabled]
|
|
31
|
+
&[disabled],
|
|
32
|
+
&[aria-disabled='true'] {
|
|
31
33
|
background-color: ${theme.color.default.pink + theme.color.transparency.T30};
|
|
32
34
|
border: 2px solid ${theme.color.default.pink + theme.color.transparency.T30};
|
|
33
35
|
background-clip: padding-box;
|
|
@@ -9,25 +9,27 @@ const ButtonSecondary = styled(Button) `
|
|
|
9
9
|
background-color: ${theme.color.background.sand.E02};
|
|
10
10
|
border: 2px solid ${theme.color.line.L02};
|
|
11
11
|
|
|
12
|
-
&:focus
|
|
12
|
+
&:focus:not(:disabled):not([disabled]):not([aria-disabled='true']),
|
|
13
|
+
&:focus-visible:not(:disabled):not([disabled]):not([aria-disabled='true']) {
|
|
13
14
|
color: ${theme.color.text.plum};
|
|
14
15
|
background-color: ${theme.color.background.sand.E02};
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
&:hover {
|
|
18
|
+
&:hover:not(:disabled):not([disabled]):not([aria-disabled='true']) {
|
|
18
19
|
color: ${theme.color.text.plum};
|
|
19
20
|
background-color: ${shade.sand.E02.darker};
|
|
20
21
|
border: 2px solid ${shade.sand.E02.darker};
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
&:active {
|
|
24
|
+
&:active:not(:disabled):not([disabled]):not([aria-disabled='true']) {
|
|
24
25
|
color: ${theme.color.text.plum};
|
|
25
26
|
background-color: ${shade.sand.E02.lighter};
|
|
26
27
|
border: 2px solid ${shade.sand.E02.lighter};
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
&:disabled,
|
|
30
|
-
&[disabled]
|
|
31
|
+
&[disabled],
|
|
32
|
+
&[aria-disabled='true'] {
|
|
31
33
|
background-color: ${theme.color.background.sand.E02 + theme.color.transparency.T30};
|
|
32
34
|
border: 2px solid ${theme.color.line.L02 + theme.color.transparency.T30};
|
|
33
35
|
background-clip: padding-box;
|
|
@@ -31,7 +31,7 @@ const BaseContainer = styled.div `
|
|
|
31
31
|
padding: ${getMultipliedSize(theme.base.baseHeight, 2)};
|
|
32
32
|
gap: ${getMultipliedSize(theme.base.baseHeight, 3)};
|
|
33
33
|
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
34
|
-
max-width:
|
|
34
|
+
max-width: ${theme.layout.content.containerMaxWidth.wide}px;
|
|
35
35
|
margin-left: auto;
|
|
36
36
|
margin-right: auto;
|
|
37
37
|
|
|
@@ -2,25 +2,26 @@ import { __rest } from 'tslib';
|
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { styled } from 'styled-components';
|
|
4
4
|
import theme from '../../themes/theme.js';
|
|
5
|
-
import { getMultipliedSize } from '../../utils/styledUtils.js';
|
|
5
|
+
import { getMultipliedSize, media } from '../../utils/styledUtils.js';
|
|
6
6
|
import Box from '../Box/Box.js';
|
|
7
7
|
|
|
8
8
|
const HERO_CONSTANTS = {
|
|
9
9
|
mobileHeight: 220,
|
|
10
10
|
desktopMinHeight: 460,
|
|
11
11
|
logoMaxWidth: 500,
|
|
12
|
+
contentMaxWidth: 650,
|
|
12
13
|
};
|
|
13
14
|
const HeroContainer = styled.div `
|
|
14
15
|
position: relative;
|
|
15
16
|
margin-bottom: ${getMultipliedSize(theme.base.baseWidth, 1.25)};
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
${({ $variant }) => media.md `
|
|
18
19
|
min-height: calc(
|
|
19
20
|
${HERO_CONSTANTS.desktopMinHeight}px + ${getMultipliedSize(theme.base.baseHeight, 4)}
|
|
20
21
|
);
|
|
21
22
|
display: flex;
|
|
22
|
-
justify-content: ${
|
|
23
|
-
}
|
|
23
|
+
justify-content: ${$variant === 'centered' || $variant === 'centered-text-left' ? 'center' : 'flex-start'};
|
|
24
|
+
`}
|
|
24
25
|
`;
|
|
25
26
|
const HeroImage = styled.div `
|
|
26
27
|
position: relative;
|
|
@@ -35,14 +36,14 @@ const HeroImage = styled.div `
|
|
|
35
36
|
background-position: bottom;
|
|
36
37
|
`}
|
|
37
38
|
|
|
38
|
-
|
|
39
|
+
${media.md `
|
|
39
40
|
height: auto;
|
|
40
41
|
position: absolute;
|
|
41
42
|
top: 0;
|
|
42
43
|
left: 0;
|
|
43
44
|
right: 0;
|
|
44
45
|
bottom: ${getMultipliedSize(theme.base.baseHeight, 4)};
|
|
45
|
-
}
|
|
46
|
+
`}
|
|
46
47
|
|
|
47
48
|
img {
|
|
48
49
|
width: 100%;
|
|
@@ -77,31 +78,32 @@ const LogoImageContainer = styled.div `
|
|
|
77
78
|
object-fit: contain;
|
|
78
79
|
}
|
|
79
80
|
|
|
80
|
-
|
|
81
|
+
${media.md `
|
|
81
82
|
top: ${getMultipliedSize(theme.base.baseWidth, 1.25)};
|
|
82
83
|
bottom: ${getMultipliedSize(theme.base.baseWidth, 1.25)};
|
|
83
84
|
right: ${getMultipliedSize(theme.base.baseWidth, 1.25)};
|
|
84
85
|
left: 50%;
|
|
85
|
-
}
|
|
86
|
+
`}
|
|
86
87
|
|
|
87
|
-
|
|
88
|
-
left: calc(min(64%,
|
|
89
|
-
}
|
|
88
|
+
${media.lg `
|
|
89
|
+
left: calc(min(64%, ${HERO_CONSTANTS.contentMaxWidth + 100}px));
|
|
90
|
+
`}
|
|
90
91
|
`;
|
|
91
92
|
const ContentWrap = styled.div `
|
|
92
93
|
width: 100%;
|
|
94
|
+
max-width: ${theme.layout.content.containerMaxWidth.wide}px;
|
|
93
95
|
padding: 0 ${getMultipliedSize(theme.base.baseWidth, 1.25)};
|
|
94
96
|
margin: -${getMultipliedSize(theme.base.baseHeight, 4)} auto 0;
|
|
95
97
|
z-index: 1;
|
|
96
98
|
|
|
97
|
-
|
|
99
|
+
${({ $variant }) => media.md `
|
|
98
100
|
display: flex;
|
|
99
101
|
align-items: flex-end;
|
|
100
102
|
padding: ${getMultipliedSize(theme.base.baseHeight, 4)}
|
|
101
103
|
${getMultipliedSize(theme.base.baseWidth, 4)} 0;
|
|
102
104
|
margin: 0 auto;
|
|
103
|
-
justify-content: ${
|
|
104
|
-
}
|
|
105
|
+
justify-content: ${$variant === 'centered' || $variant === 'centered-text-left' ? 'center' : 'flex-start'};
|
|
106
|
+
`}
|
|
105
107
|
`;
|
|
106
108
|
const Content = styled(Box).attrs({
|
|
107
109
|
elevation: 'extraHigh',
|
|
@@ -110,19 +112,19 @@ const Content = styled(Box).attrs({
|
|
|
110
112
|
position: relative;
|
|
111
113
|
text-align: ${({ $variant }) => ($variant === 'centered' ? 'center' : 'left')};
|
|
112
114
|
|
|
113
|
-
|
|
115
|
+
${media.md `
|
|
114
116
|
padding: ${getMultipliedSize(theme.base.baseWidth, 3)};
|
|
115
117
|
width: 50%;
|
|
116
|
-
max-width:
|
|
117
|
-
}
|
|
118
|
+
max-width: ${HERO_CONSTANTS.contentMaxWidth}px;
|
|
119
|
+
`}
|
|
118
120
|
|
|
119
|
-
|
|
121
|
+
${({ $variant }) => media.lg `
|
|
120
122
|
padding: ${getMultipliedSize(theme.base.baseWidth, 4)};
|
|
121
123
|
width: 60%;
|
|
122
|
-
margin-left: ${
|
|
124
|
+
margin-left: ${$variant === 'centered' || $variant === 'centered-text-left'
|
|
123
125
|
? '0'
|
|
124
126
|
: `${getMultipliedSize(theme.base.baseWidth, 4)}`};
|
|
125
|
-
}
|
|
127
|
+
`}
|
|
126
128
|
`;
|
|
127
129
|
const LabelContainer = styled.div `
|
|
128
130
|
margin: 0 0 ${getMultipliedSize(theme.base.baseHeight, 1)};
|
|
@@ -153,14 +155,14 @@ const TextContent = styled.div `
|
|
|
153
155
|
const CtaArea = styled.div `
|
|
154
156
|
margin: ${getMultipliedSize(theme.base.baseWidth, 3)} 0 0;
|
|
155
157
|
display: flex;
|
|
156
|
-
flex-direction:
|
|
158
|
+
flex-direction: row;
|
|
159
|
+
flex-wrap: wrap;
|
|
157
160
|
gap: ${getMultipliedSize(theme.base.baseWidth, 1.5)};
|
|
158
161
|
justify-content: ${({ $variant }) => ($variant === 'centered' ? 'center' : 'flex-start')};
|
|
159
162
|
|
|
160
|
-
|
|
161
|
-
flex-direction: row;
|
|
163
|
+
${media.md `
|
|
162
164
|
margin: ${getMultipliedSize(theme.base.baseWidth, 4)} 0 0;
|
|
163
|
-
}
|
|
165
|
+
`}
|
|
164
166
|
`;
|
|
165
167
|
const renderImage = (ImageComponent, imageProps) => {
|
|
166
168
|
if (!imageProps)
|
|
@@ -92,7 +92,7 @@ const GlobalNavigationContainer = styled.header `
|
|
|
92
92
|
width: 100%;
|
|
93
93
|
background-color: ${theme.color.background.white.default};
|
|
94
94
|
color: ${theme.color.text.black};
|
|
95
|
-
max-width:
|
|
95
|
+
max-width: ${theme.layout.page.maxWidth}px;
|
|
96
96
|
margin: 0 auto;
|
|
97
97
|
> nav {
|
|
98
98
|
background-color: ${theme.color.background.plum.E02};
|
|
@@ -101,7 +101,7 @@ const GlobalNavigationContainer = styled.header `
|
|
|
101
101
|
const NavigationWrapper = styled.div `
|
|
102
102
|
display: flex;
|
|
103
103
|
width: 100%;
|
|
104
|
-
max-width: ${
|
|
104
|
+
max-width: ${theme.layout.page.maxWidth}px;
|
|
105
105
|
margin: 0 auto;
|
|
106
106
|
height: ${navMaxHeight};
|
|
107
107
|
position: relative;
|
|
@@ -110,13 +110,15 @@ const Input = styled.input `
|
|
|
110
110
|
&:focus-visible {
|
|
111
111
|
outline: 0 none;
|
|
112
112
|
}
|
|
113
|
+
|
|
114
|
+
${({ $isDisabled }) => `cursor: ${$isDisabled ? 'not-allowed' : 'pointer'};`}
|
|
113
115
|
`;
|
|
114
116
|
const Pill = (_a) => {
|
|
115
117
|
var { type = 'none', 'data-testid': dataTestId } = _a, props = __rest(_a, ["type", 'data-testid']);
|
|
116
118
|
const isDefaultType = type === 'none';
|
|
117
119
|
return (React__default.createElement(Label, { as: isDefaultType ? 'button' : 'label', id: isDefaultType ? props.id : undefined, htmlFor: !isDefaultType ? props.id : undefined, type: isDefaultType ? 'button' : undefined, "$position": props.position, "$isChecked": props.isChecked || props.isDefaultChecked, "$isDisabled": props.isDisabled, className: props.className, "data-testid": dataTestId, "$isDefaultButtonStyle": props.isDefaultButtonStyle, "aria-label": props.ariaLabel, disabled: isDefaultType ? props.isDisabled : undefined, onClick: isDefaultType && !props.isDisabled ? props.onClick : undefined },
|
|
118
120
|
props.children,
|
|
119
|
-
!isDefaultType && (React__default.createElement(Input, { id: props.id, name: props.name, type: type, defaultChecked: props.isDefaultChecked, checked: props.isChecked, value: props.value, onChange: props.onChange, disabled: props.isDisabled, readOnly: !props.onChange, "data-testid": dataTestId && `${dataTestId}-input`, "data-checked": props.isChecked }))));
|
|
121
|
+
!isDefaultType && (React__default.createElement(Input, { id: props.id, name: props.name, type: type, defaultChecked: props.isDefaultChecked, checked: props.isChecked, value: props.value, onChange: props.onChange, disabled: props.isDisabled, readOnly: !props.onChange, "data-testid": dataTestId && `${dataTestId}-input`, "data-checked": props.isChecked, "$isDisabled": props.isDisabled }))));
|
|
120
122
|
};
|
|
121
123
|
|
|
122
124
|
export { Pill as default };
|
|
@@ -143,6 +143,24 @@ declare const theme: {
|
|
|
143
143
|
grid: {
|
|
144
144
|
gutter: string;
|
|
145
145
|
};
|
|
146
|
+
layout: {
|
|
147
|
+
readonly page: {
|
|
148
|
+
readonly minWidth: 320;
|
|
149
|
+
readonly maxWidth: 2560;
|
|
150
|
+
};
|
|
151
|
+
readonly content: {
|
|
152
|
+
readonly maxWidth: {
|
|
153
|
+
readonly wide: 1200;
|
|
154
|
+
readonly medium: 860;
|
|
155
|
+
readonly narrow: 640;
|
|
156
|
+
};
|
|
157
|
+
readonly containerMaxWidth: {
|
|
158
|
+
readonly wide: 1280;
|
|
159
|
+
readonly medium: 940;
|
|
160
|
+
readonly narrow: 720;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
};
|
|
146
164
|
lineHeight: {
|
|
147
165
|
default: string;
|
|
148
166
|
xl: string;
|
package/build/es/themes/theme.js
CHANGED
|
@@ -7,6 +7,7 @@ import fontFamily from './themeComponents/fontFamily.js';
|
|
|
7
7
|
import fontSize from './themeComponents/fontSize.js';
|
|
8
8
|
import fontWeight from './themeComponents/fontWeight.js';
|
|
9
9
|
import forms from './themeComponents/forms.js';
|
|
10
|
+
import layout from './themeComponents/layout.js';
|
|
10
11
|
import lineHeight from './themeComponents/lineHeight.js';
|
|
11
12
|
import radius from './themeComponents/radius.js';
|
|
12
13
|
|
|
@@ -19,6 +20,7 @@ const theme = {
|
|
|
19
20
|
fontWeight,
|
|
20
21
|
form: forms,
|
|
21
22
|
grid: gridTheme,
|
|
23
|
+
layout,
|
|
22
24
|
lineHeight,
|
|
23
25
|
media,
|
|
24
26
|
radius,
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Page layout constants for consistent sizing across the design system.
|
|
3
|
+
*
|
|
4
|
+
* All values are numbers in pixels. Add 'px' suffix when used in CSS.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* const Container = styled.div`
|
|
8
|
+
* max-width: ${theme.layout.content.maxWidth.wide}px; // 1200px
|
|
9
|
+
* margin: 0 auto;
|
|
10
|
+
* `;
|
|
11
|
+
*/
|
|
12
|
+
declare const layout: {
|
|
13
|
+
/** Page-level layout constraints */
|
|
14
|
+
readonly page: {
|
|
15
|
+
/** Minimum page width: 320px */
|
|
16
|
+
readonly minWidth: 320;
|
|
17
|
+
/** Maximum page width: 2560px */
|
|
18
|
+
readonly maxWidth: 2560;
|
|
19
|
+
};
|
|
20
|
+
/** Content area layout constraints */
|
|
21
|
+
readonly content: {
|
|
22
|
+
/** Content max-width values (pure content area without padding) */
|
|
23
|
+
readonly maxWidth: {
|
|
24
|
+
/** Wide/Normal content: 1200px */
|
|
25
|
+
readonly wide: 1200;
|
|
26
|
+
/** Medium content: 860px */
|
|
27
|
+
readonly medium: 860;
|
|
28
|
+
/** Narrow/Small content: 640px */
|
|
29
|
+
readonly narrow: 640;
|
|
30
|
+
};
|
|
31
|
+
/** Container max-width values (content + 80px padding on each side) */
|
|
32
|
+
readonly containerMaxWidth: {
|
|
33
|
+
/** Wide container: 1280px (1200 + 80) */
|
|
34
|
+
readonly wide: 1280;
|
|
35
|
+
/** Medium container: 940px (860 + 80) */
|
|
36
|
+
readonly medium: 940;
|
|
37
|
+
/** Narrow container: 720px (640 + 80) */
|
|
38
|
+
readonly narrow: 720;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export type LayoutTheme = typeof layout;
|
|
43
|
+
export default layout;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Page layout constants for consistent sizing across the design system.
|
|
3
|
+
*
|
|
4
|
+
* All values are numbers in pixels. Add 'px' suffix when used in CSS.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* const Container = styled.div`
|
|
8
|
+
* max-width: ${theme.layout.content.maxWidth.wide}px; // 1200px
|
|
9
|
+
* margin: 0 auto;
|
|
10
|
+
* `;
|
|
11
|
+
*/
|
|
12
|
+
const layout = {
|
|
13
|
+
/** Page-level layout constraints */
|
|
14
|
+
page: {
|
|
15
|
+
/** Minimum page width: 320px */
|
|
16
|
+
minWidth: 320,
|
|
17
|
+
/** Maximum page width: 2560px */
|
|
18
|
+
maxWidth: 2560,
|
|
19
|
+
},
|
|
20
|
+
/** Content area layout constraints */
|
|
21
|
+
content: {
|
|
22
|
+
/** Content max-width values (pure content area without padding) */
|
|
23
|
+
maxWidth: {
|
|
24
|
+
/** Wide/Normal content: 1200px */
|
|
25
|
+
wide: 1200,
|
|
26
|
+
/** Medium content: 860px */
|
|
27
|
+
medium: 860,
|
|
28
|
+
/** Narrow/Small content: 640px */
|
|
29
|
+
narrow: 640,
|
|
30
|
+
},
|
|
31
|
+
/** Container max-width values (content + 80px padding on each side) */
|
|
32
|
+
containerMaxWidth: {
|
|
33
|
+
/** Wide container: 1280px (1200 + 80) */
|
|
34
|
+
wide: 1280,
|
|
35
|
+
/** Medium container: 940px (860 + 80) */
|
|
36
|
+
medium: 940,
|
|
37
|
+
/** Narrow container: 720px (640 + 80) */
|
|
38
|
+
narrow: 720,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { layout as default };
|
|
@@ -11,7 +11,6 @@ export declare const mobileLogoSize = "3.75em";
|
|
|
11
11
|
export declare const desktopLogoSize = "5.25em";
|
|
12
12
|
export declare const menuItemMargin = "1rem";
|
|
13
13
|
export declare const ribbonHeight = "1.5625rem";
|
|
14
|
-
export declare const wideMenuBreakpoint = 1280;
|
|
15
14
|
export declare const IconContainerWidth = "3.75rem";
|
|
16
15
|
export declare const IconContainerMinWidth = "2.5rem";
|
|
17
16
|
export declare const navMaxHeight = "3.75rem";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dnanpm/styleguide",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "v4.0.
|
|
4
|
+
"version": "v4.0.3",
|
|
5
5
|
"main": "build/cjs/index.js",
|
|
6
6
|
"module": "build/es/index.js",
|
|
7
7
|
"jsnext:main": "build/es/index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@babel/preset-react": "^7.26.3",
|
|
50
50
|
"@babel/preset-typescript": "^7.28.5",
|
|
51
51
|
"@dnanpm/icons": "^2.0.9",
|
|
52
|
-
"@eslint/eslintrc": "^3.3.
|
|
52
|
+
"@eslint/eslintrc": "^3.3.3",
|
|
53
53
|
"@eslint/js": "^9.39.1",
|
|
54
54
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
55
55
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
@@ -66,14 +66,14 @@
|
|
|
66
66
|
"@types/react-modal": "^3.13.1",
|
|
67
67
|
"@types/resize-observer-browser": "^0.1.8",
|
|
68
68
|
"@typescript-eslint/eslint-plugin": "^8.46.4",
|
|
69
|
-
"@typescript-eslint/parser": "^8.48.
|
|
69
|
+
"@typescript-eslint/parser": "^8.48.1",
|
|
70
70
|
"babel-loader": "^9.2.1",
|
|
71
71
|
"cross-env": "^10.0.0",
|
|
72
72
|
"css-loader": "^6.11.0",
|
|
73
73
|
"eslint": "^9.39.1",
|
|
74
74
|
"eslint-config-prettier": "^10.1.8",
|
|
75
75
|
"eslint-plugin-import": "^2.32.0",
|
|
76
|
-
"eslint-plugin-jsdoc": "^61.4.
|
|
76
|
+
"eslint-plugin-jsdoc": "^61.4.2",
|
|
77
77
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
78
78
|
"eslint-plugin-react": "^7.37.5",
|
|
79
79
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"rollup-plugin-import-css": "^4.1.2",
|
|
93
93
|
"style-loader": "^3.3.3",
|
|
94
94
|
"styled-components": "^6.1.19",
|
|
95
|
-
"ts-jest": "^29.
|
|
95
|
+
"ts-jest": "^29.4.6",
|
|
96
96
|
"ts-node": "^10.9.2",
|
|
97
97
|
"tslib": "^2.8.1",
|
|
98
98
|
"typescript": "^5.1.6",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
},
|
|
101
101
|
"dependencies": {
|
|
102
102
|
"ramda": "^0.32.0",
|
|
103
|
-
"react-datepicker": "8.
|
|
103
|
+
"react-datepicker": "8.10.0",
|
|
104
104
|
"react-modal": "^3.16.1",
|
|
105
105
|
"react-select": "^5.8.1",
|
|
106
106
|
"react-spring": "^8.0.27",
|