@guardian/stand 0.0.9 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1122 -1
- package/dist/avatar.cjs +9 -0
- package/dist/avatar.js +2 -0
- package/dist/button.cjs +9 -0
- package/dist/button.js +2 -0
- package/dist/components/TitleText.cjs +28 -0
- package/dist/components/TitleText.js +22 -0
- package/dist/components/avatar/Avatar.cjs +57 -0
- package/dist/components/avatar/Avatar.js +27 -0
- package/dist/components/avatar/styles.cjs +33 -0
- package/dist/components/avatar/styles.js +29 -0
- package/dist/components/avatar/types.cjs +16 -0
- package/dist/components/avatar/types.js +14 -0
- package/dist/components/button/Button.cjs +38 -0
- package/dist/components/button/Button.js +19 -0
- package/dist/components/button/styles.cjs +68 -0
- package/dist/components/button/styles.js +63 -0
- package/dist/components/icon/Icon.cjs +46 -0
- package/dist/components/icon/Icon.js +19 -0
- package/dist/components/icon/styles.cjs +27 -0
- package/dist/components/icon/styles.js +20 -0
- package/dist/components/icon-button/IconButton.cjs +45 -0
- package/dist/components/icon-button/IconButton.js +26 -0
- package/dist/components/icon-button/styles.cjs +9 -0
- package/dist/components/icon-button/styles.js +6 -0
- package/dist/components/icon-link-button/IconLinkButton.cjs +47 -0
- package/dist/components/icon-link-button/IconLinkButton.js +23 -0
- package/dist/components/icon-link-button/styles.cjs +9 -0
- package/dist/components/icon-link-button/styles.js +6 -0
- package/dist/components/link-button/LinkButton.cjs +35 -0
- package/dist/components/link-button/LinkButton.js +16 -0
- package/dist/components/link-button/styles.cjs +9 -0
- package/dist/components/link-button/styles.js +6 -0
- package/dist/components/typography/Typography.cjs +26 -0
- package/dist/components/typography/Typography.js +13 -0
- package/dist/components/typography/styles.cjs +15 -0
- package/dist/components/typography/styles.js +12 -0
- package/dist/components/user-menu/PreferenceRadioGroup.cjs +53 -0
- package/dist/components/user-menu/PreferenceRadioGroup.js +19 -0
- package/dist/components/user-menu/UserMenu.cjs +67 -0
- package/dist/components/user-menu/UserMenu.js +11 -0
- package/dist/components/user-menu/default-options.cjs +109 -0
- package/dist/components/user-menu/default-options.js +105 -0
- package/dist/components/user-menu/styles.cjs +90 -0
- package/dist/components/user-menu/styles.js +83 -0
- package/dist/fonts/MaterialSymbolsOutlined.css +23 -0
- package/dist/fonts/MaterialSymbolsRound.css +23 -0
- package/dist/fonts/MaterialSymbolsSharp.css +23 -0
- package/dist/fonts/material-symbols-types.ts +3825 -0
- package/dist/icon-button.cjs +7 -0
- package/dist/icon-button.js +1 -0
- package/dist/icon-link-button.cjs +7 -0
- package/dist/icon-link-button.js +1 -0
- package/dist/icon.cjs +9 -0
- package/dist/icon.js +2 -0
- package/dist/index.cjs +16 -4
- package/dist/index.js +6 -0
- package/dist/link-button.cjs +7 -0
- package/dist/link-button.js +1 -0
- package/dist/styleD/build/css/base/colors.css +1 -1
- package/dist/styleD/build/css/base/sizing.css +2 -0
- package/dist/styleD/build/css/component/avatar.css +54 -0
- package/dist/styleD/build/css/component/button.css +282 -0
- package/dist/styleD/build/css/component/byline.css +1 -1
- package/dist/styleD/build/css/component/icon.css +11 -0
- package/dist/styleD/build/css/component/typography.css +7 -0
- package/dist/styleD/build/css/component/userMenu.css +29 -0
- package/dist/styleD/build/css/semantic/colors.css +12 -8
- package/dist/styleD/build/css/semantic/sizing.css +1 -0
- package/dist/styleD/build/css/semantic/typography.css +3 -0
- package/dist/styleD/build/typescript/base/colors.cjs +1 -1
- package/dist/styleD/build/typescript/base/colors.js +1 -1
- package/dist/styleD/build/typescript/base/sizing.cjs +2 -0
- package/dist/styleD/build/typescript/base/sizing.js +2 -0
- package/dist/styleD/build/typescript/component/avatar.cjs +88 -0
- package/dist/styleD/build/typescript/component/avatar.js +86 -0
- package/dist/styleD/build/typescript/component/button.cjs +523 -0
- package/dist/styleD/build/typescript/component/button.js +521 -0
- package/dist/styleD/build/typescript/component/byline.cjs +1 -1
- package/dist/styleD/build/typescript/component/byline.js +1 -1
- package/dist/styleD/build/typescript/component/icon.cjs +19 -0
- package/dist/styleD/build/typescript/component/icon.js +17 -0
- package/dist/styleD/build/typescript/component/typography.cjs +7 -0
- package/dist/styleD/build/typescript/component/typography.js +5 -0
- package/dist/styleD/build/typescript/component/userMenu.cjs +37 -0
- package/dist/styleD/build/typescript/component/userMenu.js +35 -0
- package/dist/styleD/build/typescript/semantic/colors.cjs +14 -10
- package/dist/styleD/build/typescript/semantic/colors.js +14 -10
- package/dist/styleD/build/typescript/semantic/sizing.cjs +2 -1
- package/dist/styleD/build/typescript/semantic/sizing.js +2 -1
- package/dist/styleD/build/typescript/semantic/typography.cjs +5 -0
- package/dist/styleD/build/typescript/semantic/typography.js +5 -0
- package/dist/types/avatar.d.ts +19 -0
- package/dist/types/button.d.ts +20 -0
- package/dist/types/components/TitleText.d.ts +6 -0
- package/dist/types/components/avatar/Avatar.d.ts +2 -0
- package/dist/types/components/avatar/styles.d.ts +8 -0
- package/dist/types/components/avatar/types.d.ts +45 -0
- package/dist/types/components/button/Button.d.ts +2 -0
- package/dist/types/components/button/styles.d.ts +7 -0
- package/dist/types/components/button/types.d.ts +18 -0
- package/dist/types/components/byline/schema.d.ts +1 -1
- package/dist/types/components/icon/Icon.d.ts +2 -0
- package/dist/types/components/icon/styles.d.ts +8 -0
- package/dist/types/components/icon/types.d.ts +28 -0
- package/dist/types/components/icon-button/IconButton.d.ts +2 -0
- package/dist/types/components/icon-button/styles.d.ts +522 -0
- package/dist/types/components/icon-button/types.d.ts +26 -0
- package/dist/types/components/icon-link-button/IconLinkButton.d.ts +2 -0
- package/dist/types/components/icon-link-button/styles.d.ts +522 -0
- package/dist/types/components/icon-link-button/types.d.ts +26 -0
- package/dist/types/components/link-button/LinkButton.d.ts +2 -0
- package/dist/types/components/link-button/styles.d.ts +522 -0
- package/dist/types/components/link-button/types.d.ts +18 -0
- package/dist/types/components/typography/Typography.d.ts +6 -0
- package/dist/types/components/typography/styles.d.ts +7 -0
- package/dist/types/components/typography/types.d.ts +13 -0
- package/dist/types/components/user-menu/PreferenceRadioGroup.d.ts +15 -0
- package/dist/types/components/user-menu/UserMenu.d.ts +17 -0
- package/dist/types/components/user-menu/default-options.d.ts +5 -0
- package/dist/types/components/user-menu/model.d.ts +9 -0
- package/dist/types/components/user-menu/styles.d.ts +9 -0
- package/dist/types/components/user-menu/theme.d.ts +3 -0
- package/dist/types/components/user-menu/types.d.ts +5 -0
- package/dist/types/fonts/material-symbols-types.d.ts +3822 -0
- package/dist/types/icon-button.d.ts +20 -0
- package/dist/types/icon-link-button.d.ts +20 -0
- package/dist/types/icon.d.ts +27 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/link-button.d.ts +20 -0
- package/dist/types/styleD/build/typescript/base/colors.d.ts +1 -1
- package/dist/types/styleD/build/typescript/base/sizing.d.ts +2 -0
- package/dist/types/styleD/build/typescript/component/avatar.d.ts +88 -0
- package/dist/types/styleD/build/typescript/component/button.d.ts +523 -0
- package/dist/types/styleD/build/typescript/component/icon.d.ts +19 -0
- package/dist/types/styleD/build/typescript/component/typography.d.ts +7 -0
- package/dist/types/styleD/build/typescript/component/userMenu.d.ts +37 -0
- package/dist/types/styleD/build/typescript/semantic/colors.d.ts +7 -3
- package/dist/types/styleD/build/typescript/semantic/sizing.d.ts +1 -0
- package/dist/types/styleD/build/typescript/semantic/typography.d.ts +5 -0
- package/dist/types/typography.d.ts +19 -0
- package/dist/types/user-menu.d.ts +18 -0
- package/dist/types/util/reset.d.ts +1 -0
- package/dist/types/util/storybookStyles.d.ts +1 -0
- package/dist/types/util/types.d.ts +28 -0
- package/dist/types/utils.d.ts +1 -0
- package/dist/typography.cjs +9 -0
- package/dist/typography.js +2 -0
- package/dist/user-menu.cjs +9 -0
- package/dist/user-menu.js +2 -0
- package/dist/util/css/reset.css +124 -0
- package/dist/util/reset.cjs +10 -0
- package/dist/util/reset.css.cjs +5 -0
- package/dist/util/reset.css.js +3 -0
- package/dist/util/reset.js +8 -0
- package/dist/utils.cjs +2 -0
- package/dist/utils.js +1 -0
- package/package.json +81 -3
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('@emotion/react');
|
|
4
|
+
var userMenu = require('../../styleD/build/typescript/component/userMenu.cjs');
|
|
5
|
+
var mergeDeep = require('../../util/mergeDeep.cjs');
|
|
6
|
+
|
|
7
|
+
const userMenuStyles = (partialTheme = {}) => {
|
|
8
|
+
const { container } = mergeDeep.mergeDeep(userMenu.componentUserMenu, partialTheme);
|
|
9
|
+
return react.css`
|
|
10
|
+
background-color: ${container.backgroundColor};
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
width: ${container.width};
|
|
14
|
+
padding-left: ${container.paddingX};
|
|
15
|
+
padding-right: ${container.paddingX};
|
|
16
|
+
padding-top: ${container.paddingY};
|
|
17
|
+
padding-bottom: ${container.paddingY};
|
|
18
|
+
`;
|
|
19
|
+
};
|
|
20
|
+
const userMenuHeadingStyles = (partialTheme = {}) => {
|
|
21
|
+
const { heading } = mergeDeep.mergeDeep(userMenu.componentUserMenu, partialTheme);
|
|
22
|
+
return react.css`
|
|
23
|
+
font-weight: ${heading.fontWeight};
|
|
24
|
+
font-size: ${heading.fontSize};
|
|
25
|
+
text-align: ${heading.textAlign};
|
|
26
|
+
padding-left: ${heading.paddingLeft};
|
|
27
|
+
padding-right: ${heading.paddingRight};
|
|
28
|
+
padding-top: ${heading.paddingTop};
|
|
29
|
+
padding-bottom: ${heading.paddingBottom};
|
|
30
|
+
`;
|
|
31
|
+
};
|
|
32
|
+
const toggleButtonStackedGroupStyles = (partialTheme = {}) => {
|
|
33
|
+
const { toggleButton } = mergeDeep.mergeDeep(userMenu.componentUserMenu, partialTheme);
|
|
34
|
+
return react.css`
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
gap: ${toggleButton.gap};
|
|
38
|
+
`;
|
|
39
|
+
};
|
|
40
|
+
const radioGroupLabelStyles = (partialTheme = {}) => {
|
|
41
|
+
const { label } = mergeDeep.mergeDeep(userMenu.componentUserMenu, partialTheme);
|
|
42
|
+
return react.css`
|
|
43
|
+
font-weight: ${label.fontWeight};
|
|
44
|
+
font-size: ${label.fontSize};
|
|
45
|
+
text-align: ${label.textAlign};
|
|
46
|
+
padding-left: ${label.paddingLeft};
|
|
47
|
+
padding-right: ${label.paddingRight};
|
|
48
|
+
padding-top: ${label.paddingTop};
|
|
49
|
+
padding-bottom: ${label.paddingBottom};
|
|
50
|
+
`;
|
|
51
|
+
};
|
|
52
|
+
const toggleButtonRowsGroupStyles = (partialTheme = {}) => {
|
|
53
|
+
const { toggleButton } = mergeDeep.mergeDeep(userMenu.componentUserMenu, partialTheme);
|
|
54
|
+
return react.css`
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: row;
|
|
57
|
+
justify-content: space-between;
|
|
58
|
+
flex-wrap: wrap;
|
|
59
|
+
gap: ${toggleButton.gap};
|
|
60
|
+
`;
|
|
61
|
+
};
|
|
62
|
+
const toggleButtonStyles = (partialTheme = {}) => {
|
|
63
|
+
const { toggleButton } = mergeDeep.mergeDeep(userMenu.componentUserMenu, partialTheme);
|
|
64
|
+
return react.css`
|
|
65
|
+
border-radius: 0;
|
|
66
|
+
border-style: solid;
|
|
67
|
+
border-color: ${toggleButton.baseBorderColor};
|
|
68
|
+
background-color: ${toggleButton.baseBackgroundColor};
|
|
69
|
+
|
|
70
|
+
&[data-disabled] {
|
|
71
|
+
background-color: ${toggleButton.disabledBackgroundColor};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&[data-focus-visible] {
|
|
75
|
+
outline-offset: 1px;
|
|
76
|
+
outline: 2px solid blue;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&[data-selected] {
|
|
80
|
+
border-color: ${toggleButton.selectedBorderColor};
|
|
81
|
+
}
|
|
82
|
+
`;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
exports.radioGroupLabelStyles = radioGroupLabelStyles;
|
|
86
|
+
exports.toggleButtonRowsGroupStyles = toggleButtonRowsGroupStyles;
|
|
87
|
+
exports.toggleButtonStackedGroupStyles = toggleButtonStackedGroupStyles;
|
|
88
|
+
exports.toggleButtonStyles = toggleButtonStyles;
|
|
89
|
+
exports.userMenuHeadingStyles = userMenuHeadingStyles;
|
|
90
|
+
exports.userMenuStyles = userMenuStyles;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
|
+
import { componentUserMenu } from '../../styleD/build/typescript/component/userMenu.js';
|
|
3
|
+
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
4
|
+
|
|
5
|
+
const userMenuStyles = (partialTheme = {}) => {
|
|
6
|
+
const { container } = mergeDeep(componentUserMenu, partialTheme);
|
|
7
|
+
return css`
|
|
8
|
+
background-color: ${container.backgroundColor};
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
width: ${container.width};
|
|
12
|
+
padding-left: ${container.paddingX};
|
|
13
|
+
padding-right: ${container.paddingX};
|
|
14
|
+
padding-top: ${container.paddingY};
|
|
15
|
+
padding-bottom: ${container.paddingY};
|
|
16
|
+
`;
|
|
17
|
+
};
|
|
18
|
+
const userMenuHeadingStyles = (partialTheme = {}) => {
|
|
19
|
+
const { heading } = mergeDeep(componentUserMenu, partialTheme);
|
|
20
|
+
return css`
|
|
21
|
+
font-weight: ${heading.fontWeight};
|
|
22
|
+
font-size: ${heading.fontSize};
|
|
23
|
+
text-align: ${heading.textAlign};
|
|
24
|
+
padding-left: ${heading.paddingLeft};
|
|
25
|
+
padding-right: ${heading.paddingRight};
|
|
26
|
+
padding-top: ${heading.paddingTop};
|
|
27
|
+
padding-bottom: ${heading.paddingBottom};
|
|
28
|
+
`;
|
|
29
|
+
};
|
|
30
|
+
const toggleButtonStackedGroupStyles = (partialTheme = {}) => {
|
|
31
|
+
const { toggleButton } = mergeDeep(componentUserMenu, partialTheme);
|
|
32
|
+
return css`
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
gap: ${toggleButton.gap};
|
|
36
|
+
`;
|
|
37
|
+
};
|
|
38
|
+
const radioGroupLabelStyles = (partialTheme = {}) => {
|
|
39
|
+
const { label } = mergeDeep(componentUserMenu, partialTheme);
|
|
40
|
+
return css`
|
|
41
|
+
font-weight: ${label.fontWeight};
|
|
42
|
+
font-size: ${label.fontSize};
|
|
43
|
+
text-align: ${label.textAlign};
|
|
44
|
+
padding-left: ${label.paddingLeft};
|
|
45
|
+
padding-right: ${label.paddingRight};
|
|
46
|
+
padding-top: ${label.paddingTop};
|
|
47
|
+
padding-bottom: ${label.paddingBottom};
|
|
48
|
+
`;
|
|
49
|
+
};
|
|
50
|
+
const toggleButtonRowsGroupStyles = (partialTheme = {}) => {
|
|
51
|
+
const { toggleButton } = mergeDeep(componentUserMenu, partialTheme);
|
|
52
|
+
return css`
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: row;
|
|
55
|
+
justify-content: space-between;
|
|
56
|
+
flex-wrap: wrap;
|
|
57
|
+
gap: ${toggleButton.gap};
|
|
58
|
+
`;
|
|
59
|
+
};
|
|
60
|
+
const toggleButtonStyles = (partialTheme = {}) => {
|
|
61
|
+
const { toggleButton } = mergeDeep(componentUserMenu, partialTheme);
|
|
62
|
+
return css`
|
|
63
|
+
border-radius: 0;
|
|
64
|
+
border-style: solid;
|
|
65
|
+
border-color: ${toggleButton.baseBorderColor};
|
|
66
|
+
background-color: ${toggleButton.baseBackgroundColor};
|
|
67
|
+
|
|
68
|
+
&[data-disabled] {
|
|
69
|
+
background-color: ${toggleButton.disabledBackgroundColor};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&[data-focus-visible] {
|
|
73
|
+
outline-offset: 1px;
|
|
74
|
+
outline: 2px solid blue;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&[data-selected] {
|
|
78
|
+
border-color: ${toggleButton.selectedBorderColor};
|
|
79
|
+
}
|
|
80
|
+
`;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export { radioGroupLabelStyles, toggleButtonRowsGroupStyles, toggleButtonStackedGroupStyles, toggleButtonStyles, userMenuHeadingStyles, userMenuStyles };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: 'Material Symbols Outlined';
|
|
3
|
+
font-style: normal;
|
|
4
|
+
font-weight: 400;
|
|
5
|
+
src: url(https://assets.guim.co.uk/fonts/material-symbols/material-symbols-outlined-20260218.woff2)
|
|
6
|
+
format('woff2');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.material-symbols {
|
|
10
|
+
font-family: 'Material Symbols Outlined';
|
|
11
|
+
font-weight: normal;
|
|
12
|
+
font-style: normal;
|
|
13
|
+
font-size: 24px;
|
|
14
|
+
line-height: 1;
|
|
15
|
+
letter-spacing: normal;
|
|
16
|
+
text-transform: none;
|
|
17
|
+
display: inline-block;
|
|
18
|
+
white-space: nowrap;
|
|
19
|
+
word-wrap: normal;
|
|
20
|
+
direction: ltr;
|
|
21
|
+
-webkit-font-feature-settings: 'liga';
|
|
22
|
+
-webkit-font-smoothing: antialiased;
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: 'Material Symbols Round';
|
|
3
|
+
font-style: normal;
|
|
4
|
+
font-weight: 400;
|
|
5
|
+
src: url(https://assets.guim.co.uk/fonts/material-symbols/material-symbols-round-20260218.woff2)
|
|
6
|
+
format('woff2');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.material-symbols {
|
|
10
|
+
font-family: 'Material Symbols Round';
|
|
11
|
+
font-weight: normal;
|
|
12
|
+
font-style: normal;
|
|
13
|
+
font-size: 24px;
|
|
14
|
+
line-height: 1;
|
|
15
|
+
letter-spacing: normal;
|
|
16
|
+
text-transform: none;
|
|
17
|
+
display: inline-block;
|
|
18
|
+
white-space: nowrap;
|
|
19
|
+
word-wrap: normal;
|
|
20
|
+
direction: ltr;
|
|
21
|
+
-webkit-font-feature-settings: 'liga';
|
|
22
|
+
-webkit-font-smoothing: antialiased;
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: 'Material Symbols Sharp';
|
|
3
|
+
font-style: normal;
|
|
4
|
+
font-weight: 400;
|
|
5
|
+
src: url(https://assets.guim.co.uk/fonts/material-symbols/material-symbols-sharp-20260218.woff2)
|
|
6
|
+
format('woff2');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.material-symbols {
|
|
10
|
+
font-family: 'Material Symbols Sharp';
|
|
11
|
+
font-weight: normal;
|
|
12
|
+
font-style: normal;
|
|
13
|
+
font-size: 24px;
|
|
14
|
+
line-height: 1;
|
|
15
|
+
letter-spacing: normal;
|
|
16
|
+
text-transform: none;
|
|
17
|
+
display: inline-block;
|
|
18
|
+
white-space: nowrap;
|
|
19
|
+
word-wrap: normal;
|
|
20
|
+
direction: ltr;
|
|
21
|
+
-webkit-font-feature-settings: 'liga';
|
|
22
|
+
-webkit-font-smoothing: antialiased;
|
|
23
|
+
}
|