@guardian/stand 0.0.26 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/form/Form.cjs +1 -1
- package/dist/components/form/Form.js +1 -1
- package/dist/components/form/styles.cjs +1 -4
- package/dist/components/form/styles.js +1 -2
- package/dist/components/select/Select.js +3 -3
- package/dist/components/select/styles.cjs +0 -2
- package/dist/components/select/styles.js +0 -2
- package/dist/components/topbar/TopBar.cjs +120 -14
- package/dist/components/topbar/TopBar.js +55 -9
- package/dist/components/topbar/styles.cjs +49 -5
- package/dist/components/topbar/styles.js +43 -4
- package/dist/components/topbar/topBarItem/TopBarItem.cjs +5 -1
- package/dist/components/topbar/topBarItem/TopBarItem.js +5 -2
- package/dist/components/topbar/topBarItem/styles.cjs +10 -3
- package/dist/components/topbar/topBarItem/styles.js +10 -3
- package/dist/components/topbar/topBarNavigation/TopBarNavigation.cjs +54 -38
- package/dist/components/topbar/topBarNavigation/TopBarNavigation.js +6 -4
- package/dist/components/topbar/topBarNavigation/styles.cjs +45 -8
- package/dist/components/topbar/topBarNavigation/styles.js +45 -8
- package/dist/components/topbar/topBarToolName/TopBarToolName.cjs +50 -9
- package/dist/components/topbar/topBarToolName/TopBarToolName.js +16 -8
- package/dist/components/topbar/topBarToolName/styles.cjs +42 -4
- package/dist/components/topbar/topBarToolName/styles.js +37 -5
- package/dist/index.cjs +2 -0
- package/dist/index.js +1 -0
- package/dist/select.cjs +1 -0
- package/dist/select.js +1 -1
- package/dist/styleD/build/css/component/TopBar.css +19 -1
- package/dist/styleD/build/css/component/form.css +0 -2
- package/dist/styleD/build/css/component/select.css +0 -1
- package/dist/styleD/build/css/semantic/breakpoints.css +18 -0
- package/dist/styleD/build/css/semantic/colors.css +4 -0
- package/dist/styleD/build/typescript/component/TopBar.cjs +38 -2
- package/dist/styleD/build/typescript/component/TopBar.js +38 -2
- package/dist/styleD/build/typescript/component/form.cjs +0 -6
- package/dist/styleD/build/typescript/component/form.js +0 -6
- package/dist/styleD/build/typescript/component/select.cjs +0 -1
- package/dist/styleD/build/typescript/component/select.js +0 -1
- package/dist/styleD/build/typescript/semantic/breakpoints.cjs +30 -0
- package/dist/styleD/build/typescript/semantic/breakpoints.js +28 -0
- package/dist/styleD/build/typescript/semantic/colors.cjs +4 -0
- package/dist/styleD/build/typescript/semantic/colors.js +4 -0
- package/dist/styleD/utils/semantic/mq.cjs +38 -0
- package/dist/styleD/utils/semantic/mq.js +26 -0
- package/dist/types/components/checkbox/CheckboxGroupSandbox.d.ts +2 -2
- package/dist/types/components/form/styles.d.ts +1 -3
- package/dist/types/components/select/sandbox.d.ts +3 -3
- package/dist/types/components/text-area/sandbox.d.ts +2 -2
- package/dist/types/components/text-input/sandbox.d.ts +2 -2
- package/dist/types/components/topbar/TopBar.d.ts +1 -1
- package/dist/types/components/topbar/styles.d.ts +8 -2
- package/dist/types/components/topbar/topBarItem/TopBarItem.d.ts +1 -1
- package/dist/types/components/topbar/topBarItem/styles.d.ts +1 -1
- package/dist/types/components/topbar/topBarItem/types.d.ts +6 -1
- package/dist/types/components/topbar/topBarNavigation/TopBarNavigation.d.ts +1 -1
- package/dist/types/components/topbar/topBarNavigation/styles.d.ts +2 -2
- package/dist/types/components/topbar/topBarNavigation/types.d.ts +5 -0
- package/dist/types/components/topbar/topBarToolName/TopBarToolName.d.ts +1 -1
- package/dist/types/components/topbar/topBarToolName/styles.d.ts +7 -4
- package/dist/types/components/topbar/topBarToolName/types.d.ts +12 -0
- package/dist/types/components/topbar/types.d.ts +10 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/select.d.ts +2 -2
- package/dist/types/styleD/build/typescript/component/TopBar.d.ts +36 -0
- package/dist/types/styleD/build/typescript/component/form.d.ts +0 -6
- package/dist/types/styleD/build/typescript/component/select.d.ts +0 -1
- package/dist/types/styleD/build/typescript/semantic/breakpoints.d.ts +30 -0
- package/dist/types/styleD/build/typescript/semantic/colors.d.ts +4 -0
- package/dist/types/styleD/stories/semantic/Breakpoints.d.ts +15 -0
- package/dist/types/styleD/utils/semantic/mq.d.ts +61 -0
- package/dist/types/styleD/utils/semantic/mq.test.d.ts +1 -0
- package/dist/types/util/useResize.d.ts +1 -0
- package/dist/types/utils.d.ts +1 -0
- package/dist/util/useResize.cjs +34 -0
- package/dist/util/useResize.js +32 -0
- package/dist/utils.cjs +4 -0
- package/dist/utils.js +1 -0
- package/package.json +1 -1
|
@@ -6,8 +6,20 @@
|
|
|
6
6
|
--component-top-bar-background-color: #f6f6f6;
|
|
7
7
|
--component-top-bar-display: flex;
|
|
8
8
|
--component-top-bar-height: 4rem;
|
|
9
|
-
--component-top-bar-justify-content:
|
|
9
|
+
--component-top-bar-justify-content: flex-start;
|
|
10
10
|
--component-top-bar-border: 0.0625rem solid #cccccc;
|
|
11
|
+
--component-top-bar-spacer-margin-left: auto;
|
|
12
|
+
--component-top-bar-collapsed-nav-menu-button-margin: 0;
|
|
13
|
+
--component-top-bar-collapsed-nav-menu-button-padding: 0;
|
|
14
|
+
--component-top-bar-collapsed-nav-menu-button-background: none;
|
|
15
|
+
--component-top-bar-collapsed-nav-menu-button-border: none;
|
|
16
|
+
--component-top-bar-collapsed-nav-menu-button-cursor: pointer;
|
|
17
|
+
--component-top-bar-collapsed-nav-menu-button-hovered-background-color: #ededed;
|
|
18
|
+
--component-top-bar-collapsed-nav-menu-button-active-background-color: #ededed;
|
|
19
|
+
--component-top-bar-collapsed-nav-menu-popover-left: auto !important;
|
|
20
|
+
--component-top-bar-collapsed-nav-menu-popover-top: auto !important;
|
|
21
|
+
--component-top-bar-collapsed-nav-menu-popover-background-color: #f6f6f6;
|
|
22
|
+
--component-top-bar-collapsed-nav-menu-popover-border: 0.0625rem solid #cccccc;
|
|
11
23
|
--component-top-bar-item-display: flex;
|
|
12
24
|
--component-top-bar-item-align-items: center;
|
|
13
25
|
--component-top-bar-item-height: 100%;
|
|
@@ -41,6 +53,9 @@
|
|
|
41
53
|
--component-top-bar-navigation-shared-focus-visible-outline-offset: -0.0625rem;
|
|
42
54
|
--component-top-bar-navigation-shared-border-top: 0.5rem solid transparent;
|
|
43
55
|
--component-top-bar-navigation-shared-divider: 0.0625rem solid #cccccc;
|
|
56
|
+
--component-top-bar-navigation-shared-menu-open-width: 100%;
|
|
57
|
+
--component-top-bar-navigation-shared-menu-open-height: 64px;
|
|
58
|
+
--component-top-bar-navigation-shared-menu-open-selected-background-color: #ededed;
|
|
44
59
|
--component-top-bar-navigation-text-margin-left: 0.375rem;
|
|
45
60
|
--component-top-bar-navigation-menu-indicator-margin-top: 0.375rem;
|
|
46
61
|
--component-top-bar-navigation-menu-indicator-margin-left: 0.125rem;
|
|
@@ -94,4 +109,7 @@
|
|
|
94
109
|
--component-top-bar-tool-name-hover-link-focused-outline: 0.125rem solid
|
|
95
110
|
#0072a9;
|
|
96
111
|
--component-top-bar-tool-name-hover-link-focused-outline-offset: -0.125rem;
|
|
112
|
+
--component-top-bar-tool-name-hover-link-collapsed-padding-left: 0.25rem;
|
|
113
|
+
--component-top-bar-tool-name-hover-link-collapsed-padding-right: 0.25rem;
|
|
114
|
+
--component-top-bar-tool-name-hover-link-collapsed-justify-content: center;
|
|
97
115
|
}
|
|
@@ -15,12 +15,10 @@
|
|
|
15
15
|
--component-form-input-shared-description-typography-letter-spacing: 0;
|
|
16
16
|
--component-form-input-shared-description-typography-font-width: 95;
|
|
17
17
|
--component-form-input-shared-description-disabled-color: #999999;
|
|
18
|
-
--component-form-input-sm-container-max-width: 200px;
|
|
19
18
|
--component-form-input-sm-label-typography-font: normal 700 0.875rem/1.15
|
|
20
19
|
'Open Sans';
|
|
21
20
|
--component-form-input-sm-label-typography-letter-spacing: -0.0125rem;
|
|
22
21
|
--component-form-input-sm-label-typography-font-width: 95;
|
|
23
|
-
--component-form-input-md-container-max-width: 320px;
|
|
24
22
|
--component-form-input-md-label-typography-font: normal 700 1rem/1.15
|
|
25
23
|
'Open Sans';
|
|
26
24
|
--component-form-input-md-label-typography-letter-spacing: -0.03125rem;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
:root {
|
|
6
|
+
--semantic-breakpoints-sm-min: 0;
|
|
7
|
+
--semantic-breakpoints-sm-max: 671px;
|
|
8
|
+
--semantic-breakpoints-md-min: 672px;
|
|
9
|
+
--semantic-breakpoints-md-max: 1055px;
|
|
10
|
+
--semantic-breakpoints-lg-min: 1056px;
|
|
11
|
+
--semantic-breakpoints-lg-max: 1311px;
|
|
12
|
+
--semantic-breakpoints-xl-min: 1312px;
|
|
13
|
+
--semantic-breakpoints-xl-max: 1583px;
|
|
14
|
+
--semantic-breakpoints-max-min: 1584px;
|
|
15
|
+
--semantic-breakpoints-max-max: 1783px;
|
|
16
|
+
--semantic-breakpoints-maxplus-min: 1784px;
|
|
17
|
+
--semantic-breakpoints-maxplus-max: initial;
|
|
18
|
+
}
|
|
@@ -48,6 +48,10 @@
|
|
|
48
48
|
--semantic-colors-fill-weak-hover: #f6f6f6;
|
|
49
49
|
--semantic-colors-fill-weak-pressed: #ededed;
|
|
50
50
|
--semantic-colors-fill-disabled: #dcdcdc;
|
|
51
|
+
--semantic-colors-fill-disabled-inverse: #666666;
|
|
52
|
+
--semantic-colors-fill-link: #00496c;
|
|
53
|
+
--semantic-colors-fill-link-hover: #00344e;
|
|
54
|
+
--semantic-colors-fill-link-pressed: #00202f;
|
|
51
55
|
--semantic-colors-fill-green-weak: #cde4c9;
|
|
52
56
|
--semantic-colors-fill-blue-weak: #c5d9f4;
|
|
53
57
|
--semantic-colors-fill-red-weak: #f5c6c0;
|
|
@@ -4,8 +4,32 @@ const componentTopBar = {
|
|
|
4
4
|
"background-color": "#f6f6f6",
|
|
5
5
|
display: "flex",
|
|
6
6
|
height: "4rem",
|
|
7
|
-
"justify-content": "
|
|
7
|
+
"justify-content": "flex-start",
|
|
8
8
|
border: "0.0625rem solid #cccccc",
|
|
9
|
+
spacer: {
|
|
10
|
+
"margin-left": "auto"
|
|
11
|
+
},
|
|
12
|
+
collapsedNavMenu: {
|
|
13
|
+
button: {
|
|
14
|
+
margin: "0",
|
|
15
|
+
padding: "0",
|
|
16
|
+
background: "none",
|
|
17
|
+
border: "none",
|
|
18
|
+
cursor: "pointer",
|
|
19
|
+
hovered: {
|
|
20
|
+
"background-color": "#ededed"
|
|
21
|
+
},
|
|
22
|
+
active: {
|
|
23
|
+
"background-color": "#ededed"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
popover: {
|
|
27
|
+
left: "auto !important",
|
|
28
|
+
top: "auto !important",
|
|
29
|
+
"background-color": "#f6f6f6",
|
|
30
|
+
border: "0.0625rem solid #cccccc"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
9
33
|
Item: {
|
|
10
34
|
display: "flex",
|
|
11
35
|
"align-items": "center",
|
|
@@ -59,7 +83,14 @@ const componentTopBar = {
|
|
|
59
83
|
"outline-offset": "-0.0625rem"
|
|
60
84
|
},
|
|
61
85
|
"border-top": "0.5rem solid transparent",
|
|
62
|
-
divider: "0.0625rem solid #cccccc"
|
|
86
|
+
divider: "0.0625rem solid #cccccc",
|
|
87
|
+
_menuOpen: {
|
|
88
|
+
width: "100%",
|
|
89
|
+
height: "64px",
|
|
90
|
+
selected: {
|
|
91
|
+
"background-color": "#ededed"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
63
94
|
},
|
|
64
95
|
text: {
|
|
65
96
|
margin: {
|
|
@@ -147,6 +178,11 @@ const componentTopBar = {
|
|
|
147
178
|
focused: {
|
|
148
179
|
outline: "0.125rem solid #0072a9",
|
|
149
180
|
"outline-offset": "-0.125rem"
|
|
181
|
+
},
|
|
182
|
+
collapsed: {
|
|
183
|
+
paddingLeft: "0.25rem",
|
|
184
|
+
paddingRight: "0.25rem",
|
|
185
|
+
"justify-content": "center"
|
|
150
186
|
}
|
|
151
187
|
}
|
|
152
188
|
}
|
|
@@ -2,8 +2,32 @@ const componentTopBar = {
|
|
|
2
2
|
"background-color": "#f6f6f6",
|
|
3
3
|
display: "flex",
|
|
4
4
|
height: "4rem",
|
|
5
|
-
"justify-content": "
|
|
5
|
+
"justify-content": "flex-start",
|
|
6
6
|
border: "0.0625rem solid #cccccc",
|
|
7
|
+
spacer: {
|
|
8
|
+
"margin-left": "auto"
|
|
9
|
+
},
|
|
10
|
+
collapsedNavMenu: {
|
|
11
|
+
button: {
|
|
12
|
+
margin: "0",
|
|
13
|
+
padding: "0",
|
|
14
|
+
background: "none",
|
|
15
|
+
border: "none",
|
|
16
|
+
cursor: "pointer",
|
|
17
|
+
hovered: {
|
|
18
|
+
"background-color": "#ededed"
|
|
19
|
+
},
|
|
20
|
+
active: {
|
|
21
|
+
"background-color": "#ededed"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
popover: {
|
|
25
|
+
left: "auto !important",
|
|
26
|
+
top: "auto !important",
|
|
27
|
+
"background-color": "#f6f6f6",
|
|
28
|
+
border: "0.0625rem solid #cccccc"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
7
31
|
Item: {
|
|
8
32
|
display: "flex",
|
|
9
33
|
"align-items": "center",
|
|
@@ -57,7 +81,14 @@ const componentTopBar = {
|
|
|
57
81
|
"outline-offset": "-0.0625rem"
|
|
58
82
|
},
|
|
59
83
|
"border-top": "0.5rem solid transparent",
|
|
60
|
-
divider: "0.0625rem solid #cccccc"
|
|
84
|
+
divider: "0.0625rem solid #cccccc",
|
|
85
|
+
_menuOpen: {
|
|
86
|
+
width: "100%",
|
|
87
|
+
height: "64px",
|
|
88
|
+
selected: {
|
|
89
|
+
"background-color": "#ededed"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
61
92
|
},
|
|
62
93
|
text: {
|
|
63
94
|
margin: {
|
|
@@ -145,6 +176,11 @@ const componentTopBar = {
|
|
|
145
176
|
focused: {
|
|
146
177
|
outline: "0.125rem solid #0072a9",
|
|
147
178
|
"outline-offset": "-0.125rem"
|
|
179
|
+
},
|
|
180
|
+
collapsed: {
|
|
181
|
+
paddingLeft: "0.25rem",
|
|
182
|
+
paddingRight: "0.25rem",
|
|
183
|
+
"justify-content": "center"
|
|
148
184
|
}
|
|
149
185
|
}
|
|
150
186
|
}
|
|
@@ -28,9 +28,6 @@ const componentForm = {
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
sm: {
|
|
31
|
-
container: {
|
|
32
|
-
"max-width": "200px"
|
|
33
|
-
},
|
|
34
31
|
label: {
|
|
35
32
|
typography: {
|
|
36
33
|
font: "normal 700 0.875rem/1.15 Open Sans",
|
|
@@ -40,9 +37,6 @@ const componentForm = {
|
|
|
40
37
|
}
|
|
41
38
|
},
|
|
42
39
|
md: {
|
|
43
|
-
container: {
|
|
44
|
-
"max-width": "320px"
|
|
45
|
-
},
|
|
46
40
|
label: {
|
|
47
41
|
typography: {
|
|
48
42
|
font: "normal 700 1rem/1.15 Open Sans",
|
|
@@ -26,9 +26,6 @@ const componentForm = {
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
sm: {
|
|
29
|
-
container: {
|
|
30
|
-
"max-width": "200px"
|
|
31
|
-
},
|
|
32
29
|
label: {
|
|
33
30
|
typography: {
|
|
34
31
|
font: "normal 700 0.875rem/1.15 Open Sans",
|
|
@@ -38,9 +35,6 @@ const componentForm = {
|
|
|
38
35
|
}
|
|
39
36
|
},
|
|
40
37
|
md: {
|
|
41
|
-
container: {
|
|
42
|
-
"max-width": "320px"
|
|
43
|
-
},
|
|
44
38
|
label: {
|
|
45
39
|
typography: {
|
|
46
40
|
font: "normal 700 1rem/1.15 Open Sans",
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const semanticBreakpoints = {
|
|
4
|
+
sm: {
|
|
5
|
+
min: "0",
|
|
6
|
+
max: "671px"
|
|
7
|
+
},
|
|
8
|
+
md: {
|
|
9
|
+
min: "672px",
|
|
10
|
+
max: "1055px"
|
|
11
|
+
},
|
|
12
|
+
lg: {
|
|
13
|
+
min: "1056px",
|
|
14
|
+
max: "1311px"
|
|
15
|
+
},
|
|
16
|
+
xl: {
|
|
17
|
+
min: "1312px",
|
|
18
|
+
max: "1583px"
|
|
19
|
+
},
|
|
20
|
+
max: {
|
|
21
|
+
min: "1584px",
|
|
22
|
+
max: "1783px"
|
|
23
|
+
},
|
|
24
|
+
maxplus: {
|
|
25
|
+
min: "1784px",
|
|
26
|
+
max: "initial"
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.semanticBreakpoints = semanticBreakpoints;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const semanticBreakpoints = {
|
|
2
|
+
sm: {
|
|
3
|
+
min: "0",
|
|
4
|
+
max: "671px"
|
|
5
|
+
},
|
|
6
|
+
md: {
|
|
7
|
+
min: "672px",
|
|
8
|
+
max: "1055px"
|
|
9
|
+
},
|
|
10
|
+
lg: {
|
|
11
|
+
min: "1056px",
|
|
12
|
+
max: "1311px"
|
|
13
|
+
},
|
|
14
|
+
xl: {
|
|
15
|
+
min: "1312px",
|
|
16
|
+
max: "1583px"
|
|
17
|
+
},
|
|
18
|
+
max: {
|
|
19
|
+
min: "1584px",
|
|
20
|
+
max: "1783px"
|
|
21
|
+
},
|
|
22
|
+
maxplus: {
|
|
23
|
+
min: "1784px",
|
|
24
|
+
max: "initial"
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { semanticBreakpoints };
|
|
@@ -53,6 +53,10 @@ const semanticColors = {
|
|
|
53
53
|
"weak-hover": "#f6f6f6",
|
|
54
54
|
"weak-pressed": "#ededed",
|
|
55
55
|
disabled: "#dcdcdc",
|
|
56
|
+
"disabled-inverse": "#666666",
|
|
57
|
+
link: "#00496c",
|
|
58
|
+
"link-hover": "#00344e",
|
|
59
|
+
"link-pressed": "#00202f",
|
|
56
60
|
"green-weak": "#cde4c9",
|
|
57
61
|
"blue-weak": "#c5d9f4",
|
|
58
62
|
"red-weak": "#f5c6c0",
|
|
@@ -51,6 +51,10 @@ const semanticColors = {
|
|
|
51
51
|
"weak-hover": "#f6f6f6",
|
|
52
52
|
"weak-pressed": "#ededed",
|
|
53
53
|
disabled: "#dcdcdc",
|
|
54
|
+
"disabled-inverse": "#666666",
|
|
55
|
+
link: "#00496c",
|
|
56
|
+
"link-hover": "#00344e",
|
|
57
|
+
"link-pressed": "#00202f",
|
|
54
58
|
"green-weak": "#cde4c9",
|
|
55
59
|
"blue-weak": "#c5d9f4",
|
|
56
60
|
"red-weak": "#f5c6c0",
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var breakpoints = require('../../build/typescript/semantic/breakpoints.cjs');
|
|
4
|
+
|
|
5
|
+
const smidgen = 0.1;
|
|
6
|
+
const parseMinPx = (value) => value === "0" ? 0 : parseFloat(value);
|
|
7
|
+
const minWidthQuery = (px) => `@media (min-width: ${px}px)`;
|
|
8
|
+
const maxWidthQuery = (px) => `@media (max-width: ${px - smidgen}px)`;
|
|
9
|
+
const minMaxWidthQuery = (minPx, maxPx) => `@media (min-width: ${minPx}px) and (max-width: ${maxPx - smidgen}px)`;
|
|
10
|
+
const from = Object.fromEntries(
|
|
11
|
+
Object.entries(breakpoints.semanticBreakpoints).map(([name, { min }]) => [
|
|
12
|
+
name,
|
|
13
|
+
minWidthQuery(parseMinPx(min))
|
|
14
|
+
])
|
|
15
|
+
);
|
|
16
|
+
const until = Object.fromEntries(
|
|
17
|
+
Object.entries(breakpoints.semanticBreakpoints).map(([name, { min }]) => [
|
|
18
|
+
name,
|
|
19
|
+
maxWidthQuery(parseMinPx(min))
|
|
20
|
+
])
|
|
21
|
+
);
|
|
22
|
+
const between = Object.fromEntries(
|
|
23
|
+
Object.entries(breakpoints.semanticBreakpoints).map(([fromName, { min: fromMin }]) => [
|
|
24
|
+
fromName,
|
|
25
|
+
{
|
|
26
|
+
and: Object.fromEntries(
|
|
27
|
+
Object.entries(breakpoints.semanticBreakpoints).filter(([toName]) => toName !== fromName).map(([toName, { min: toMin }]) => [
|
|
28
|
+
toName,
|
|
29
|
+
minMaxWidthQuery(parseMinPx(fromMin), parseMinPx(toMin))
|
|
30
|
+
])
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
])
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
exports.between = between;
|
|
37
|
+
exports.from = from;
|
|
38
|
+
exports.until = until;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { semanticBreakpoints } from '../../build/typescript/semantic/breakpoints.js';
|
|
2
|
+
|
|
3
|
+
const smidgen = 0.1;
|
|
4
|
+
const parseMinPx = (value) => value === "0" ? 0 : parseFloat(value);
|
|
5
|
+
const minWidthQuery = (px) => `@media (min-width: ${px}px)`;
|
|
6
|
+
const maxWidthQuery = (px) => `@media (max-width: ${px - smidgen}px)`;
|
|
7
|
+
const minMaxWidthQuery = (minPx, maxPx) => `@media (min-width: ${minPx}px) and (max-width: ${maxPx - smidgen}px)`;
|
|
8
|
+
const from = Object.fromEntries(Object.entries(semanticBreakpoints).map(([name, { min }]) => [
|
|
9
|
+
name,
|
|
10
|
+
minWidthQuery(parseMinPx(min))
|
|
11
|
+
]));
|
|
12
|
+
const until = Object.fromEntries(Object.entries(semanticBreakpoints).map(([name, { min }]) => [
|
|
13
|
+
name,
|
|
14
|
+
maxWidthQuery(parseMinPx(min))
|
|
15
|
+
]));
|
|
16
|
+
const between = Object.fromEntries(Object.entries(semanticBreakpoints).map(([fromName, { min: fromMin }]) => [
|
|
17
|
+
fromName,
|
|
18
|
+
{
|
|
19
|
+
and: Object.fromEntries(Object.entries(semanticBreakpoints).filter(([toName]) => toName !== fromName).map(([toName, { min: toMin }]) => [
|
|
20
|
+
toName,
|
|
21
|
+
minMaxWidthQuery(parseMinPx(fromMin), parseMinPx(toMin))
|
|
22
|
+
]))
|
|
23
|
+
}
|
|
24
|
+
]));
|
|
25
|
+
|
|
26
|
+
export { between, from, until };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const componentName = "CheckboxGroup";
|
|
2
2
|
export declare const componentTsx = "import { Checkbox, CheckboxGroup } from '@guardian/stand/checkbox';\n\nexport const Component = () => (\n\t<>\n\t\t<CheckboxGroup label=\"Notifications\" description=\"Choose what to receive.\">\n\t\t\t<Checkbox value=\"email\">Email</Checkbox>\n\t\t\t<Checkbox value=\"sms\">SMS</Checkbox>\n\t\t\t<Checkbox value=\"push\">Push notification</Checkbox>\n\t\t</CheckboxGroup>\n\n\t\t<CheckboxGroup\n\t\t\tlabel=\"Preferences\"\n\t\t\tsize=\"sm\"\n\t\t\tisInvalid\n\t\t\terror=\"Please select at least one option.\"\n\t\t>\n\t\t\t<Checkbox value=\"news\">News</Checkbox>\n\t\t\t<Checkbox value=\"offers\">Offers</Checkbox>\n\t\t</CheckboxGroup>\n\t</>\n);\n";
|
|
3
|
-
export declare const componentCss = "\n/* import the checkbox, form, inline message styles */\n@import '@guardian/stand/component/inlineMessage.css';\n@import '@guardian/stand/component/form.css';\n@import '@guardian/stand/component/checkbox.css';\n\n/* inline message styles - error */\n.stand-inline-message {\n display: var(--component-inline-message-shared-display);\n align-items: var(--component-inline-message-shared-align-items);\n gap: var(--component-inline-message-shared-gap);\n font: var(--component-inline-message-shared-typography-font);\n letter-spacing: var(\n --component-inline-message-shared-typography-letter-spacing\n );\n font-variation-settings: \"wdth\"\n var(--component-inline-message-shared-typography-font-width);\n}\n\n.stand-inline-message > .material-symbols {\n font-size: var(--component-inline-message-shared-icon-size);\n}\n\n.stand-inline-message > svg {\n width: var(--component-inline-message-shared-icon-size);\n height: var(--component-inline-message-shared-icon-size);\n}\n\n.stand-inline-message-error {\n color: var(--component-inline-message-error-color);\n fill: var(--component-inline-message-error-color);\n}\n\n/* form input container styles */\n\n.stand-form-input-container {\n\tdisplay: var(--component-form-input-shared-container-display);\n\tflex-direction: var(--component-form-input-shared-container-flex-direction);\n\tgap: var(--component-form-input-shared-container-gap);\n\twidth: var(--component-form-input-shared-container-width);\n}\n\n.stand-form-input-container
|
|
3
|
+
export declare const componentCss = "\n/* import the checkbox, form, inline message styles */\n@import '@guardian/stand/component/inlineMessage.css';\n@import '@guardian/stand/component/form.css';\n@import '@guardian/stand/component/checkbox.css';\n\n/* inline message styles - error */\n.stand-inline-message {\n display: var(--component-inline-message-shared-display);\n align-items: var(--component-inline-message-shared-align-items);\n gap: var(--component-inline-message-shared-gap);\n font: var(--component-inline-message-shared-typography-font);\n letter-spacing: var(\n --component-inline-message-shared-typography-letter-spacing\n );\n font-variation-settings: \"wdth\"\n var(--component-inline-message-shared-typography-font-width);\n}\n\n.stand-inline-message > .material-symbols {\n font-size: var(--component-inline-message-shared-icon-size);\n}\n\n.stand-inline-message > svg {\n width: var(--component-inline-message-shared-icon-size);\n height: var(--component-inline-message-shared-icon-size);\n}\n\n.stand-inline-message-error {\n color: var(--component-inline-message-error-color);\n fill: var(--component-inline-message-error-color);\n}\n\n/* form input container styles */\n\n.stand-form-input-container {\n\tdisplay: var(--component-form-input-shared-container-display);\n\tflex-direction: var(--component-form-input-shared-container-flex-direction);\n\tgap: var(--component-form-input-shared-container-gap);\n\twidth: var(--component-form-input-shared-container-width);\n}\n\n.stand-form-input-container > label {\n\tcolor: var(--component-form-input-shared-label-color);\n\tfont: var(--component-form-input-md-label-typography-font);\n\tletter-spacing: var(--component-form-input-md-label-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-form-input-md-label-typography-font-width);\n}\n\n.stand-form-input-container[data-disabled] > label {\n\tcolor: var(--component-form-input-shared-label-disabled-color);\n}\n\n.stand-form-input-container > span.description {\n\tcolor: var(--component-form-input-shared-description-color);\n\tfont: var(--component-form-input-shared-description-typography-font);\n\tletter-spacing: var(--component-form-input-shared-description-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-form-input-shared-description-typography-font-width);\n}\n\n.stand-form-input-container[data-disabled] > span.description {\n\tcolor: var(--component-form-input-shared-description-disabled-color);\n}\n\n/* checkbox styles */\n\n.stand-checkbox {\n display: var(--component-checkbox-input-shared-display);\n position: var(--component-checkbox-input-shared-position);\n align-items: var(--component-checkbox-input-shared-align-items);\n gap: var(--component-checkbox-input-shared-gap);\n cursor: var(--component-checkbox-input-shared-cursor);\n color: var(--component-checkbox-input-shared-color);\n}\n\n.stand-checkbox.md {\n font: var(--component-checkbox-input-md-typography-font);\n letter-spacing: var(--component-checkbox-input-md-typography-letter-spacing);\n font-variation-settings: \"wdth\"\n var(--component-checkbox-input-md-typography-font-width);\n}\n\n.stand-checkbox.sm {\n font: var(--component-checkbox-input-sm-typography-font);\n letter-spacing: var(--component-checkbox-input-sm-typography-letter-spacing);\n font-variation-settings: \"wdth\"\n\tvar(--component-checkbox-input-sm-typography-font-width);\n}\n\n.stand-checkbox > label {\n cursor: var(--component-checkbox-input-shared-cursor);\n}\n\n.stand-checkbox-indicator {\n /* Reset browser default styles for checkboxes */\n margin: 0;\n background-color: transparent;\n outline: none;\n\n /* component styles */\n cursor: var(--component-checkbox-input-shared-cursor);\n border: var(--component-checkbox-input-shared-indicator-border);\n border-radius: var(--component-checkbox-input-shared-indicator-border-radius);\n accent-color: var(\n --component-checkbox-input-shared-indicator-selected-background-color\n );\n}\n\n.stand-checkbox.md > .stand-checkbox-indicator {\n width: var(--component-checkbox-input-md-indicator-size);\n height: var(--component-checkbox-input-md-indicator-size);\n}\n\n.stand-checkbox.sm > .stand-checkbox-indicator {\n width: var(--component-checkbox-input-sm-indicator-size);\n height: var(--component-checkbox-input-sm-indicator-size);\n}\n\n/* CheckboxGroup styles */\n\n.stand-checkbox-group {\n\tdisplay: var(--component-checkbox-group-shared-display);\n\tflex-direction: var(--component-checkbox-group-shared-flex-direction);\n}\n\n.stand-checkbox-group.sm {\n\tgap: var(--component-checkbox-group-sm-gap);\n\tmargin-top: var(--component-checkbox-group-sm-margin-top);\n}\n\n.stand-checkbox-group.md {\n\tgap: var(--component-checkbox-group-md-gap);\n\tmargin-top: var(--component-checkbox-group-md-margin-top);\n}\n";
|
|
4
4
|
export declare const componentHtml = "<div class=\"container flow-column\">\n\t<div>\n\t\tCheckboxes can be built with the input HTML element, but this can be difficult to style. These examples only show basic size and color customisation.\n\t</div>\n\t<div class=\"stand-form-input-container md\">\n\t\t<label>Notifications</label>\n\t\t<span class=\"description\">Choose what to receive.</span>\n\t\t<div class=\"stand-checkbox-group md\">\n\t\t\t<div class=\"stand-checkbox md\">\n\t\t\t\t<input class=\"stand-checkbox-indicator\" type=\"checkbox\" id=\"email\" name=\"email\" />\n\t\t\t\t<label for=\"email\">Email</label>\n\t\t\t</div>\n\t\t\t<div class=\"stand-checkbox md\">\n\t\t\t\t<input class=\"stand-checkbox-indicator\" type=\"checkbox\" id=\"sms\" name=\"sms\" />\n\t\t\t\t<label for=\"sms\">SMS</label>\n\t\t\t</div>\n\t\t\t<div class=\"stand-checkbox md\">\n\t\t\t\t<input class=\"stand-checkbox-indicator\" type=\"checkbox\" id=\"push\" name=\"push\" />\n\t\t\t\t<label for=\"push\">Push notification</label>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div class=\"stand-form-input-container sm\" data-invalid>\n\t\t<label>Preferences</label>\n\t\t<span class=\"description\">Please select at least one option.</span>\n\t\t<div class=\"stand-checkbox-group sm\">\n\t\t\t<div class=\"stand-checkbox sm\">\n\t\t\t\t<input class=\"stand-checkbox-indicator\" type=\"checkbox\" id=\"news\" name=\"news\" />\n\t\t\t\t<label for=\"news\">News</label>\n\t\t\t</div>\n\t\t\t<div class=\"stand-checkbox sm\">\n\t\t\t\t<input class=\"stand-checkbox-indicator\" type=\"checkbox\" id=\"offers\" name=\"offers\" />\n\t\t\t\t<label for=\"offers\">Offers</label>\n\t\t\t</div>\n\t\t</div>\n\t\t<span class=\"stand-inline-message stand-inline-message-error\"><span class=\"material-symbols\">warning</span> Username is already taken</span>\n\t</div>\n</div>\n";
|
|
5
|
-
export declare const componentJs = "\nimport { componentCheckbox, componentForm, componentInlineMessage } from \"@guardian/stand\";\n\n// example of creating a stylesheet in js\nconst sheet = new CSSStyleSheet();\n\n// apply the rules to the sheet\nsheet.replaceSync(`\n/* inline message styles - error */\n.js-stand-inline-message {\n display: ${componentInlineMessage.shared.display};\n align-items: ${componentInlineMessage.shared['align-items']};\n gap: ${componentInlineMessage.shared.gap};\n font: ${componentInlineMessage.shared.typography.font};\n letter-spacing: ${componentInlineMessage.shared.typography.letterSpacing};\n font-variation-settings: \"wdth\" ${componentInlineMessage.shared.typography.fontWidth};\n}\n\n.js-stand-inline-message > .material-symbols {\n font-size: ${componentInlineMessage.shared.icon.size};\n}\n\n.js-stand-inline-message > svg {\n width: ${componentInlineMessage.shared.icon.size};\n height: ${componentInlineMessage.shared.icon.size};\n}\n\n.js-stand-inline-message-error {\n color: ${componentInlineMessage.error.color};\n fill: ${componentInlineMessage.error.color};\n}\n\n/* form input container styles */\n\n.js-stand-form-input-container {\n\tdisplay: ${componentForm.input.shared.container.display};\n\tflex-direction: ${componentForm.input.shared.container[\"flex-direction\"]};\n\tgap: ${componentForm.input.shared.container.gap};\n\twidth: ${componentForm.input.shared.container.width};\n}\n\n.js-stand-form-input-container
|
|
5
|
+
export declare const componentJs = "\nimport { componentCheckbox, componentForm, componentInlineMessage } from \"@guardian/stand\";\n\n// example of creating a stylesheet in js\nconst sheet = new CSSStyleSheet();\n\n// apply the rules to the sheet\nsheet.replaceSync(`\n/* inline message styles - error */\n.js-stand-inline-message {\n display: ${componentInlineMessage.shared.display};\n align-items: ${componentInlineMessage.shared['align-items']};\n gap: ${componentInlineMessage.shared.gap};\n font: ${componentInlineMessage.shared.typography.font};\n letter-spacing: ${componentInlineMessage.shared.typography.letterSpacing};\n font-variation-settings: \"wdth\" ${componentInlineMessage.shared.typography.fontWidth};\n}\n\n.js-stand-inline-message > .material-symbols {\n font-size: ${componentInlineMessage.shared.icon.size};\n}\n\n.js-stand-inline-message > svg {\n width: ${componentInlineMessage.shared.icon.size};\n height: ${componentInlineMessage.shared.icon.size};\n}\n\n.js-stand-inline-message-error {\n color: ${componentInlineMessage.error.color};\n fill: ${componentInlineMessage.error.color};\n}\n\n/* form input container styles */\n\n.js-stand-form-input-container {\n\tdisplay: ${componentForm.input.shared.container.display};\n\tflex-direction: ${componentForm.input.shared.container[\"flex-direction\"]};\n\tgap: ${componentForm.input.shared.container.gap};\n\twidth: ${componentForm.input.shared.container.width};\n}\n\n.js-stand-form-input-container > label {\n\tcolor: ${componentForm.input.shared.label.color};\n\tfont: ${componentForm.input.md.label.typography.font};\n\tletter-spacing: ${componentForm.input.md.label.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentForm.input.md.label.typography.fontWidth};\n}\n\n.js-stand-form-input-container[data-disabled] > label {\n\tcolor: ${componentForm.input.shared.label.disabledColor};\n}\n\n.js-stand-form-input-container > span.description {\n\tcolor: ${componentForm.input.shared.description.color};\n\tfont: ${componentForm.input.shared.description.typography.font};\n\tletter-spacing: ${componentForm.input.shared.description.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentForm.input.shared.description.typography.fontWidth};\n}\n\n.js-stand-form-input-container[data-disabled] > span.description {\n\tcolor: ${componentForm.input.shared.description.disabledColor};\n}\n\n/* checkbox styles */\n\n.js-stand-checkbox {\n display: ${componentCheckbox.input.shared.display};\n position: ${componentCheckbox.input.shared.position};\n align-items: ${componentCheckbox.input.shared['align-items']};\n gap: ${componentCheckbox.input.shared.gap};\n cursor: ${componentCheckbox.input.shared.cursor};\n color: ${componentCheckbox.input.shared.color};\n font: ${componentCheckbox.input.md.typography.font};\n letter-spacing: ${componentCheckbox.input.md.typography.letterSpacing};\n font-variation-settings: \"wdth\" ${componentCheckbox.input.md.typography.fontWidth};\n}\n\n.js-stand-checkbox.sm {\n font: ${componentCheckbox.input.sm.typography.font};\n letter-spacing: ${componentCheckbox.input.sm.typography.letterSpacing};\n font-variation-settings: \"wdth\"\n\t${componentCheckbox.input.sm.typography.fontWidth};\n}\n\n.js-stand-checkbox > label {\n cursor: ${componentCheckbox.input.shared.cursor};\n}\n\n.js-stand-checkbox-indicator {\n /* Reset browser default styles for checkboxes */\n margin: 0;\n background-color: transparent;\n outline: none;\n\n /* component styles */\n cursor: ${componentCheckbox.input.shared.cursor};\n border: ${componentCheckbox.input.shared.indicator.border};\n border-radius: ${componentCheckbox.input.shared.indicator['border-radius']};\n accent-color: ${componentCheckbox.input.shared.indicator.selected['background-color']};\n}\n\n.js-stand-checkbox.md > .js-stand-checkbox-indicator {\n width: ${componentCheckbox.input.md.indicator.size};\n height: ${componentCheckbox.input.md.indicator.size};\n}\n\n.js-stand-checkbox.sm > .js-stand-checkbox-indicator {\n width: ${componentCheckbox.input.sm.indicator.size};\n height: ${componentCheckbox.input.sm.indicator.size};\n}\n\n/* CheckboxGroup styles */\n\n.js-stand-checkbox-group {\n\tdisplay: ${componentCheckbox.group.shared.display};\n\tflex-direction: ${componentCheckbox.group.shared[\"flex-direction\"]};\n}\n\n.js-stand-checkbox-group.sm {\n\tgap: ${componentCheckbox.group.sm.gap};\n\tmargin-top: ${componentCheckbox.group.sm.marginTop};\n}\n\n.js-stand-checkbox-group.md {\n\tgap: ${componentCheckbox.group.md.gap};\n\tmargin-top: ${componentCheckbox.group.md.marginTop};\n}\n`);\n\n// update the document with the sheet\ndocument.adoptedStyleSheets.push(sheet);\n\n// modify the dom with the button components using the generated stylesheet\ndocument.getElementById(\"app\").innerHTML = `\n<div class=\"container flow-column\">\n\t<div>\n\t\tCheckboxes can be built with the input HTML element, but this can be difficult to style. These examples only show basic size and color customisation.\n\t</div>\n\t<div class=\"js-stand-form-input-container md\">\n\t\t<label>Notifications</label>\n\t\t<span class=\"description\">Choose what to receive.</span>\n\t\t<div class=\"js-stand-checkbox-group md\">\n\t\t\t<div class=\"js-stand-checkbox md\">\n\t\t\t\t<input class=\"js-stand-checkbox-indicator\" type=\"checkbox\" id=\"email\" name=\"email\" />\n\t\t\t\t<label for=\"email\">Email</label>\n\t\t\t</div>\n\t\t\t<div class=\"js-stand-checkbox md\">\n\t\t\t\t<input class=\"js-stand-checkbox-indicator\" type=\"checkbox\" id=\"sms\" name=\"sms\" />\n\t\t\t\t<label for=\"sms\">SMS</label>\n\t\t\t</div>\n\t\t\t<div class=\"js-stand-checkbox md\">\n\t\t\t\t<input class=\"js-stand-checkbox-indicator\" type=\"checkbox\" id=\"push\" name=\"push\" />\n\t\t\t\t<label for=\"push\">Push notification</label>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div class=\"js-stand-form-input-container sm\" data-invalid>\n\t\t<label>Preferences</label>\n\t\t<span class=\"description\">Please select at least one option.</span>\n\t\t<div class=\"js-stand-checkbox-group sm\">\n\t\t\t<div class=\"js-stand-checkbox sm\">\n\t\t\t\t<input class=\"js-stand-checkbox-indicator\" type=\"checkbox\" id=\"news\" name=\"news\" />\n\t\t\t\t<label for=\"news\">News</label>\n\t\t\t</div>\n\t\t\t<div class=\"js-stand-checkbox sm\">\n\t\t\t\t<input class=\"js-stand-checkbox-indicator\" type=\"checkbox\" id=\"offers\" name=\"offers\" />\n\t\t\t\t<label for=\"offers\">Offers</label>\n\t\t\t</div>\n\t\t</div>\n\t\t<span class=\"js-stand-inline-message js-stand-inline-message-error\"><span class=\"material-symbols\">warning</span> Username is already taken</span>\n\t</div>\n</div>\n`;\n\n";
|
|
@@ -3,9 +3,7 @@ import type { ComponentForm } from '../../styleD/build/typescript/component/form
|
|
|
3
3
|
import type { Prettify } from '../../util/types';
|
|
4
4
|
export type FormInputContainerTheme = Prettify<ComponentForm['input']>;
|
|
5
5
|
export declare const defaultFormInputContainerTheme: FormInputContainerTheme;
|
|
6
|
-
export declare const formInputContainerStyles: (theme: FormInputContainerTheme
|
|
7
|
-
size: keyof Omit<FormInputContainerTheme, 'shared'>;
|
|
8
|
-
}) => SerializedStyles;
|
|
6
|
+
export declare const formInputContainerStyles: (theme: FormInputContainerTheme) => SerializedStyles;
|
|
9
7
|
export declare const formInputLabelStyles: (theme: FormInputContainerTheme, { isDisabled, size, }: {
|
|
10
8
|
size: keyof Omit<FormInputContainerTheme, 'shared'>;
|
|
11
9
|
isDisabled?: boolean | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const componentName = "Select";
|
|
2
|
-
export declare const componentTsx = "import { Select } from '@guardian/stand/select';\n\nexport const Component = () => (\n\t<Select label=\"Select\">\n\t\t<Option>Option 1</Option>\n\t\t<Option>Option 2</Option>\n\t</Select>\n);\n";
|
|
3
|
-
export declare const componentCss = "\n/* import the select styles */\n@import '@guardian/stand/component/select.css';\n\n.stand-select-container {\n\tdisplay: var(--component-
|
|
2
|
+
export declare const componentTsx = "import { Option, Select } from '@guardian/stand/select';\n\nexport const Component = () => (\n\t<Select label=\"Select\">\n\t\t<Option>Option 1</Option>\n\t\t<Option>Option 2</Option>\n\t</Select>\n);\n";
|
|
3
|
+
export declare const componentCss = "\n/* import the select styles */\n@import '@guardian/stand/component/select.css';\n@import '@guardian/stand/component/form.css';\n\n.stand-select-container {\n\tdisplay: var(--component-form-input-shared-container-display);\n\tflex-direction: var(--component-form-input-shared-container-flex-direction);\n\tgap: var(--component-form-input-shared-container-gap);\n\twidth: var(--component-form-input-shared-container-width);\n}\n\n.stand-select-container > label {\n\tcolor: var(--component-form-input-shared-label-color);\n\tfont: var(--component-form-input-md-label-typography-font);\n\tletter-spacing: var(--component-form-input-md-label-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-form-input-md-label-typography-font-width);\n}\n\n.stand-select-container > span.description {\n\tcolor: var(--component-form-input-shared-description-color);\n\tfont: var(--component-form-input-shared-description-typography-font);\n\tletter-spacing: var(--component-form-input-shared-description-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-form-input-shared-description-typography-font-width);\n}\n\n.stand-select {\n\t\tdisplay: var(--component-select-shared-button-display);\n\t\tjustify-content: var(--component-select-shared-button-justify-content);\n\t\talign-items: var(--component-select-shared-button-align-items);\n\t\tbackground-color: var(--component-select-shared-button-background-color);\n\t\tborder: var(--component-select-shared-button-border);\n\t\tborder-radius: var(--component-select-shared-button-border-radius);\n\t\theight: var(--component-select-shared-button-height);\n\t\tpadding-left: var(--component-select-shared-button-padding-left);\n\t\tpadding-right: var(--component-select-shared-button-padding-right);\n\t\tmargin-top: var(--component-select-shared-button-margin-top);\n\t\tcolor: var(--component-select-shared-button-color);\n\n\t\tfont: var(--component-select-shared-button-body-md-typography-font);\n\t\tletter-spacing: var(--component-select-shared-button-body-md-typography-letter-spacing);\n\t\tfont-variation-settings: \"wdth\" var(--component-select-shared-button-body-md-typography-font-width);\n\n\n\t\t&:hover {\n\t\t\tbackground: var(--component-select-shared-hover-background-color);\n\t\t}\n\n\t\t&:active {\n\t\t\tbackground: var(--component-select-shared-active-background-color);\n\t\t}\n\n\t\t&:focus-visible {\n\t\t\toutline: var(--component-select-button-focused-outline);\n\t\t\toutline-offset: var(--component-select-button-focused-outline-offset);\n\t\t}\n\n\t\t&:disabled {\n\t\t\tcursor: var(--component-select-button-disabled-cursor);\n\t\t\tbackground-color: var(--component-select-button-disabled-background-color);\n\t\t\tcolor: var(--component-select-button-disabled-color);\n\t\t\tborder: var(--component-select-button-disabled-border);\n\t\t}\n}\n";
|
|
4
4
|
export declare const componentHtml = "<div class=\"container\">\n\t<div class=\"stand-select-container\">\n\t\t<label>Select</label>\n\t\t<select class=\"stand-select\">\n\t\t\t<option>Option 1</option>\n\t\t\t<option>Option 2</option>\n\t\t</select>\n\t</div>\n</div>\n";
|
|
5
|
-
export declare const componentJs = "\nimport { componentSelect } from \"@guardian/stand\";\n\n// example of creating a stylesheet in js\nconst sheet = new CSSStyleSheet();\n\n// apply the rules to the sheet\nsheet.replaceSync(`\n\n.js-stand-select-container {\n\tdisplay: ${
|
|
5
|
+
export declare const componentJs = "\nimport { componentForm, componentSelect } from \"@guardian/stand\";\n\n// example of creating a stylesheet in js\nconst sheet = new CSSStyleSheet();\n\n// apply the rules to the sheet\nsheet.replaceSync(`\n\n.js-stand-select-container {\n\tdisplay: ${componentForm.input.shared.container.display};\n\tflex-direction: ${componentForm.input.shared.container['flex-direction']};\n\tgap: ${componentForm.input.shared.container.gap};\n\twidth: ${componentForm.input.shared.container.width};\n}\n\n.js-stand-select-container > label {\n\tcolor: ${componentForm.input.shared.label.color};\n\tfont: ${componentForm.input.md.label.typography.font};\n\tletter-spacing: ${componentForm.input.md.label.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentForm.input.md.label.typography.fontWidth};\n}\n\n.js-stand-select-container > span.description {\n\tcolor: ${componentForm.input.shared.description.color};\n\tfont: ${componentForm.input.shared.description.font};\n\tletter-spacing: ${componentForm.input.shared.description.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentForm.input.shared.description.fontWidth};\n}\n\n.js-stand-select {\n\tdisplay: ${componentSelect.shared.button.display};\n\tjustify-content: ${componentSelect.shared.button.justifyContent};\n\talign-items: ${componentSelect.shared.button.alignItems};\n\tbackground-color: ${componentSelect.shared.button.backgroundColor};\n\tborder: ${componentSelect.shared.button.border};\n\tborder-radius: ${componentSelect.shared.button.borderRadius};\n\theight: ${componentSelect.shared.button.height};\n\tpadding-left: ${componentSelect.shared.button.paddingLeft};\n\tpadding-right: ${componentSelect.shared.button.paddingRight};\n\tmargin-top: ${componentSelect.shared.button.marginTop};\n\tcolor: ${componentSelect.shared.button.color};\n\n\tfont: ${componentSelect.shared.button.typography.font};\n\tletter-spacing: ${componentSelect.shared.button.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentSelect.shared.button.typography.fontWidth};\n\n\t&:hover {\n\t\tbackground: ${componentSelect.shared.hover.backgroundColor};\n\t}\n\n\t&:active {\n\t\tbackground: ${componentSelect.shared.pressed.backgroundColor};\n\t}\n\n\t&:focus-visible {\n\t\toutline: ${componentSelect.shared.button.focused.outline};\n\t\toutline-offset: ${componentSelect.shared.button.focused['outline-offset']};\n\t}\n\n\t&:disabled {\n\t\tcursor: ${componentSelect.shared.button.disabled.cursor};\n\t\tbackground-color: ${componentSelect.shared.button.disabled.backgroundColor};\n\t\tcolor: ${componentSelect.shared.button.disabled.color};\n\t\tborder: ${componentSelect.shared.button.disabled.border};\n\t}\n}\n`);\n\n// update the document with the sheet\ndocument.adoptedStyleSheets.push(sheet);\n\ndocument.getElementById(\"app\").innerHTML = `\n\t<div class=\"js-stand-select-container\">\n\t\t<label>Select</label>\n\t\t<select class=\"js-stand-select\">\n\t\t\t<option>Option 1</option>\n\t\t\t<option>Option 2</option>\n\t\t</select>\n\t</div>\n`;\n";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const componentName = "TextArea";
|
|
2
2
|
export declare const componentTsx = "import { TextArea } from '@guardian/stand/text-area';\n\nexport const Component = () => (\n\t<TextArea\n\t\t\tlabel=\"Description\"\n\t\t\tdescription=\"This is a description for the text area.\"\n\t\t/>\n);\n";
|
|
3
|
-
export declare const componentCss = "\n/* import the textarea, form and inline message styles */\n@import '@guardian/stand/component/inlineMessage.css';\n@import '@guardian/stand/component/form.css';\n@import '@guardian/stand/component/textArea.css';\n\n/* inline message styles - error */\n.stand-inline-message {\n display: var(--component-inline-message-shared-display);\n align-items: var(--component-inline-message-shared-align-items);\n gap: var(--component-inline-message-shared-gap);\n font: var(--component-inline-message-shared-typography-font);\n letter-spacing: var(\n --component-inline-message-shared-typography-letter-spacing\n );\n font-variation-settings: \"wdth\"\n var(--component-inline-message-shared-typography-font-width);\n}\n\n.stand-inline-message > .material-symbols {\n font-size: var(--component-inline-message-shared-icon-size);\n}\n\n.stand-inline-message > svg {\n width: var(--component-inline-message-shared-icon-size);\n height: var(--component-inline-message-shared-icon-size);\n}\n\n.stand-inline-message-error {\n color: var(--component-inline-message-error-color);\n fill: var(--component-inline-message-error-color);\n}\n\n.stand-text-area {\n\tdisplay: var(--component-textArea-shared-display);\n}\n\n/* form input container styles */\n\n.stand-form-input-container {\n\tdisplay: var(--component-form-input-shared-container-display);\n\tflex-direction: var(--component-form-input-shared-container-flex-direction);\n\tgap: var(--component-form-input-shared-container-gap);\n\twidth: var(--component-form-input-shared-container-width);\n}\n\n.stand-form-input-container
|
|
3
|
+
export declare const componentCss = "\n/* import the textarea, form and inline message styles */\n@import '@guardian/stand/component/inlineMessage.css';\n@import '@guardian/stand/component/form.css';\n@import '@guardian/stand/component/textArea.css';\n\n/* inline message styles - error */\n.stand-inline-message {\n display: var(--component-inline-message-shared-display);\n align-items: var(--component-inline-message-shared-align-items);\n gap: var(--component-inline-message-shared-gap);\n font: var(--component-inline-message-shared-typography-font);\n letter-spacing: var(\n --component-inline-message-shared-typography-letter-spacing\n );\n font-variation-settings: \"wdth\"\n var(--component-inline-message-shared-typography-font-width);\n}\n\n.stand-inline-message > .material-symbols {\n font-size: var(--component-inline-message-shared-icon-size);\n}\n\n.stand-inline-message > svg {\n width: var(--component-inline-message-shared-icon-size);\n height: var(--component-inline-message-shared-icon-size);\n}\n\n.stand-inline-message-error {\n color: var(--component-inline-message-error-color);\n fill: var(--component-inline-message-error-color);\n}\n\n.stand-text-area {\n\tdisplay: var(--component-textArea-shared-display);\n}\n\n/* form input container styles */\n\n.stand-form-input-container {\n\tdisplay: var(--component-form-input-shared-container-display);\n\tflex-direction: var(--component-form-input-shared-container-flex-direction);\n\tgap: var(--component-form-input-shared-container-gap);\n\twidth: var(--component-form-input-shared-container-width);\n}\n\n.stand-form-input-container > label {\n\tcolor: var(--component-form-input-shared-label-color);\n\tfont: var(--component-form-input-md-label-typography-font);\n\tletter-spacing: var(--component-form-input-md-label-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-form-input-md-label-typography-font-width);\n}\n\n.stand-form-input-container[data-disabled] > label {\n\tcolor: var(--component-form-input-shared-label-disabled-color);\n}\n\n.stand-form-input-container > span.description {\n\tcolor: var(--component-form-input-shared-description-color);\n\tfont: var(--component-form-input-shared-description-typography-font);\n\tletter-spacing: var(--component-form-input-shared-description-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-form-input-shared-description-typography-font-width);\n}\n\n.stand-form-input-container[data-disabled] > span.description {\n\tcolor: var(--component-form-input-shared-description-disabled-color);\n}\n\n/* text area styles */\n\n.stand-text-area {\n\tbackground-color: var(--component-text-area-shared-background-color);\n\tborder-radius: var(--component-text-area-shared-border-radius);\n\tborder: var(--component-text-area-shared-border);\n\tcolor: var(--component-text-area-shared-color);\n\tcursor: var(--component-text-area-shared-cursor);\n\tmargin-top: var(--component-text-area-shared-margin-top);\n\tpadding-top: var(--component-text-area-shared-padding-top);\n\tpadding-right: var(--component-text-area-shared-padding-right);\n\tpadding-bottom: var(--component-text-area-shared-padding-bottom);\n\tpadding-left: var(--component-text-area-shared-padding-left);\n}\n\n.stand-text-area[disabled] {\n\tbackground-color: var(--component-text-area-shared-disabled-background-color);\n\tborder: var(--component-text-area-shared-disabled-border);\n\tcolor: var(--component-text-area-shared-disabled-color);\n\tcursor: var(--component-text-area-shared-disabled-cursor);\n}\n\n.stand-text-area[data-invalid] {\n\tborder: var(--component-text-area-shared-error-border);\n}\n\n.stand-text-area.md {\n\theight: var(--component-text-area-shared-height);\n\tfont: var(--component-text-area-md-typography-font);\n\tletter-spacing: var(--component-text-area-md-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-text-area-md-typography-font-width);\n}\n\n.stand-text-area.sm {\n\theight: var(--component-text-area-shared-height);\n\tfont: var(--component-text-area-sm-typography-font);\n\tletter-spacing: var(--component-text-area-sm-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-text-area-sm-typography-font-width);\n}\n";
|
|
4
4
|
export declare const componentHtml = "<div class=\"container\">\n\t<div class=\"stand-form-input-container md\">\n\t\t<label for=\"name\">Name</label>\n\t\t<span class=\"description\">This is a description for the text area.</span>\n\t\t<textarea id=\"name\" class=\"stand-text-area md\" type=\"text\"></textarea>\n\t</div>\n\t<div class=\"stand-form-input-container sm\">\n\t\t<label for=\"story\">Tell us a story</label>\n\t\t<textarea\n\t\t\tid=\"story\"\n\t\t\tclass=\"stand-text-area sm\"\n\t\t\ttype=\"text\"\n\t\t\tdata-invalid\n\t\t>It was a dark and stormy night...</textarea>\n\t\t<span class=\"stand-inline-message stand-inline-message-error\"><span class=\"material-symbols\">warning</span> Story is below character count</span>\n\t</div>\n\t<div class=\"stand-form-input-container md\" data-disabled>\n\t\t<label for=\"notes\">Notes</label>\n\t\t<textarea\n\t\t\tid=\"notes\"\n\t\t\tclass=\"stand-text-area md\"\n\t\t\ttype=\"text\"\n\t\t\tdisabled\n\t\t></textarea>\n\t</div>\n</div>\n";
|
|
5
|
-
export declare const componentJs = "\nimport { componentTextArea, componentForm, componentInlineMessage } from \"@guardian/stand\";\n\n// example of creating a stylesheet in js\nconst sheet = new CSSStyleSheet();\n\n// apply the rules to the sheet\nsheet.replaceSync(`\n/* inline message styles - error */\n.js-stand-inline-message {\n display: ${componentInlineMessage.shared.display};\n align-items: ${componentInlineMessage.shared['align-items']};\n gap: ${componentInlineMessage.shared.gap};\n font: ${componentInlineMessage.shared.typography.font};\n letter-spacing: ${componentInlineMessage.shared.typography.letterSpacing};\n font-variation-settings: \"wdth\" ${componentInlineMessage.shared.typography.fontWidth};\n}\n\n.js-stand-inline-message > .material-symbols {\n font-size: ${componentInlineMessage.shared.icon.size};\n}\n\n.js-stand-inline-message > svg {\n width: ${componentInlineMessage.shared.icon.size};\n height: ${componentInlineMessage.shared.icon.size};\n}\n\n.js-stand-inline-message-error {\n color: ${componentInlineMessage.error.color};\n fill: ${componentInlineMessage.error.color};\n}\n\n/* form input container styles */\n\n.js-stand-form-input-container {\n\tdisplay: ${componentForm.input.shared.container.display};\n\tflex-direction: ${componentForm.input.shared.container['flex-direction']};\n\tgap: ${componentForm.input.shared.container.gap};\n\twidth: ${componentForm.input.shared.container.width};\n}\n\n.js-stand-form-input-container
|
|
5
|
+
export declare const componentJs = "\nimport { componentTextArea, componentForm, componentInlineMessage } from \"@guardian/stand\";\n\n// example of creating a stylesheet in js\nconst sheet = new CSSStyleSheet();\n\n// apply the rules to the sheet\nsheet.replaceSync(`\n/* inline message styles - error */\n.js-stand-inline-message {\n display: ${componentInlineMessage.shared.display};\n align-items: ${componentInlineMessage.shared['align-items']};\n gap: ${componentInlineMessage.shared.gap};\n font: ${componentInlineMessage.shared.typography.font};\n letter-spacing: ${componentInlineMessage.shared.typography.letterSpacing};\n font-variation-settings: \"wdth\" ${componentInlineMessage.shared.typography.fontWidth};\n}\n\n.js-stand-inline-message > .material-symbols {\n font-size: ${componentInlineMessage.shared.icon.size};\n}\n\n.js-stand-inline-message > svg {\n width: ${componentInlineMessage.shared.icon.size};\n height: ${componentInlineMessage.shared.icon.size};\n}\n\n.js-stand-inline-message-error {\n color: ${componentInlineMessage.error.color};\n fill: ${componentInlineMessage.error.color};\n}\n\n/* form input container styles */\n\n.js-stand-form-input-container {\n\tdisplay: ${componentForm.input.shared.container.display};\n\tflex-direction: ${componentForm.input.shared.container['flex-direction']};\n\tgap: ${componentForm.input.shared.container.gap};\n\twidth: ${componentForm.input.shared.container.width};\n}\n\n.js-stand-form-input-container > label {\n\tcolor: ${componentForm.input.shared.label.color};\n\tfont: ${componentForm.input.md.label.typography.font};\n\tletter-spacing: ${componentForm.input.md.label.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentForm.input.md.label.typography.fontWidth};\n}\n\n.js-stand-form-input-container[data-disabled] > label {\n\tcolor: ${componentForm.input.shared.label.disabled.color};\n}\n\n.js-stand-form-input-container > span.description {\n\tcolor: ${componentForm.input.shared.description.color};\n\tfont: ${componentForm.input.shared.description.typography.font};\n\tletter-spacing: ${componentForm.input.shared.description.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentForm.input.shared.description.typography.fontWidth};\n}\n\n.js-stand-form-input-container[data-disabled] > span.description {\n\tcolor: ${componentForm.input.shared.description.disabled.color};\n}\n\n/* text area styles */\n\n.js-stand-text-area {\n\tbackground-color: ${componentTextArea.shared['background-color']};\n\tborder-radius: ${componentTextArea.shared['border-radius']};\n\tborder: ${componentTextArea.shared.border};\n\tcolor: ${componentTextArea.shared.color};\n\tcursor: ${componentTextArea.shared.cursor};\n\tmargin-top: ${componentTextArea.shared['margin-top']};\n\tpadding-top: ${componentTextArea.shared.padding.top};\n\tpadding-right: ${componentTextArea.shared.padding.right};\n\tpadding-bottom: ${componentTextArea.shared.padding.bottom};\n\tpadding-left: ${componentTextArea.shared.padding.left};\n}\n\n.js-stand-text-area[disabled] {\n\tbackground-color: ${componentTextArea.shared.disabled.backgroundColor};\n\tborder: ${componentTextArea.shared.disabled.border};\n\tcolor: ${componentTextArea.shared.disabled.color};\n\tcursor: ${componentTextArea.shared.disabled.cursor};\n}\n\n.js-stand-text-area[data-invalid] {\n\tborder: ${componentTextArea.shared.errorBorder};\n}\n\n.js-stand-text-area.md {\n\theight: ${componentTextArea.shared.height};\n\tfont: ${componentTextArea.md.typography.font};\n\tletter-spacing: ${componentTextArea.md.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentTextArea.md.typography.fontWidth};\n}\n\n.js-stand-text-area.sm {\n\theight: ${componentTextArea.shared.height};\n\tfont: ${componentTextArea.sm.typography.font};\n\tletter-spacing: ${componentTextArea.sm.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentTextArea.sm.typography.fontWidth};\n}\n`);\n\n// update the document with the sheet\ndocument.adoptedStyleSheets.push(sheet);\n\n// modify the dom with the button components using the generated stylesheet\ndocument.getElementById(\"app\").innerHTML = `\n<div class=\"container flow-column\">\n\t<div class=\"js-stand-form-input-container md\">\n\t\t<label for=\"name\">Name</label>\n\t\t<span class=\"description\">This is a description for the text input.</span>\n\t\t<textarea id=\"name\" class=\"js-stand-text-area md\"></textarea>\n\t</div>\n\t<div class=\"js-stand-form-input-container sm\">\n\t\t<label for=\"story\">Story</label>\n\t\t<textarea\n\t\t\tid=\"story\"\n\t\t\tclass=\"js-stand-text-area sm\"\n\t\t>It was a dark and stormy night...</textarea>\n\t\t<span class=\"js-stand-inline-message js-stand-inline-message-error\"><span class=\"material-symbols\">warning</span> Username is already taken</span>\n\t</div>\n\t<div class=\"js-stand-form-input-container md\" data-disabled>\n\t\t<label for=\"notes\">Notes</label>\n\t\t<textarea\n\t\t\tid=\"notes\"\n\t\t\tclass=\"js-stand-text-area md\"\n\t\t\ttype=\"text\"\n\t\t\tdisabled\n\t\t </textarea>\n\t</div>\n</div>\n`;\n";
|