@guardian/stand 0.0.9 → 0.0.10

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.
Files changed (138) hide show
  1. package/README.md +1122 -1
  2. package/dist/avatar.cjs +9 -0
  3. package/dist/avatar.js +2 -0
  4. package/dist/button.cjs +9 -0
  5. package/dist/button.js +2 -0
  6. package/dist/components/TitleText.cjs +28 -0
  7. package/dist/components/TitleText.js +22 -0
  8. package/dist/components/avatar/Avatar.cjs +57 -0
  9. package/dist/components/avatar/Avatar.js +27 -0
  10. package/dist/components/avatar/styles.cjs +33 -0
  11. package/dist/components/avatar/styles.js +29 -0
  12. package/dist/components/avatar/types.cjs +16 -0
  13. package/dist/components/avatar/types.js +14 -0
  14. package/dist/components/button/Button.cjs +29 -0
  15. package/dist/components/button/Button.js +14 -0
  16. package/dist/components/button/styles.cjs +58 -0
  17. package/dist/components/button/styles.js +53 -0
  18. package/dist/components/icon/Icon.cjs +46 -0
  19. package/dist/components/icon/Icon.js +19 -0
  20. package/dist/components/icon/styles.cjs +27 -0
  21. package/dist/components/icon/styles.js +20 -0
  22. package/dist/components/link-button/LinkButton.cjs +29 -0
  23. package/dist/components/link-button/LinkButton.js +14 -0
  24. package/dist/components/link-button/styles.cjs +9 -0
  25. package/dist/components/link-button/styles.js +6 -0
  26. package/dist/components/typography/Typography.cjs +26 -0
  27. package/dist/components/typography/Typography.js +13 -0
  28. package/dist/components/typography/styles.cjs +15 -0
  29. package/dist/components/typography/styles.js +12 -0
  30. package/dist/components/user-menu/PreferenceRadioGroup.cjs +53 -0
  31. package/dist/components/user-menu/PreferenceRadioGroup.js +19 -0
  32. package/dist/components/user-menu/UserMenu.cjs +67 -0
  33. package/dist/components/user-menu/UserMenu.js +11 -0
  34. package/dist/components/user-menu/default-options.cjs +109 -0
  35. package/dist/components/user-menu/default-options.js +105 -0
  36. package/dist/components/user-menu/styles.cjs +90 -0
  37. package/dist/components/user-menu/styles.js +83 -0
  38. package/dist/fonts/MaterialSymbolsOutlined.css +23 -0
  39. package/dist/fonts/MaterialSymbolsRound.css +23 -0
  40. package/dist/fonts/MaterialSymbolsSharp.css +23 -0
  41. package/dist/fonts/material-symbols-types.ts +3825 -0
  42. package/dist/icon.cjs +9 -0
  43. package/dist/icon.js +2 -0
  44. package/dist/index.cjs +16 -4
  45. package/dist/index.js +6 -0
  46. package/dist/link-button.cjs +7 -0
  47. package/dist/link-button.js +1 -0
  48. package/dist/styleD/build/css/base/colors.css +1 -1
  49. package/dist/styleD/build/css/base/sizing.css +2 -0
  50. package/dist/styleD/build/css/component/avatar.css +54 -0
  51. package/dist/styleD/build/css/component/button.css +218 -0
  52. package/dist/styleD/build/css/component/byline.css +1 -1
  53. package/dist/styleD/build/css/component/icon.css +11 -0
  54. package/dist/styleD/build/css/component/typography.css +7 -0
  55. package/dist/styleD/build/css/component/userMenu.css +29 -0
  56. package/dist/styleD/build/css/semantic/colors.css +12 -8
  57. package/dist/styleD/build/css/semantic/sizing.css +1 -0
  58. package/dist/styleD/build/css/semantic/typography.css +3 -0
  59. package/dist/styleD/build/typescript/base/colors.cjs +1 -1
  60. package/dist/styleD/build/typescript/base/colors.js +1 -1
  61. package/dist/styleD/build/typescript/base/sizing.cjs +2 -0
  62. package/dist/styleD/build/typescript/base/sizing.js +2 -0
  63. package/dist/styleD/build/typescript/component/avatar.cjs +88 -0
  64. package/dist/styleD/build/typescript/component/avatar.js +86 -0
  65. package/dist/styleD/build/typescript/component/button.cjs +331 -0
  66. package/dist/styleD/build/typescript/component/button.js +329 -0
  67. package/dist/styleD/build/typescript/component/byline.cjs +1 -1
  68. package/dist/styleD/build/typescript/component/byline.js +1 -1
  69. package/dist/styleD/build/typescript/component/icon.cjs +19 -0
  70. package/dist/styleD/build/typescript/component/icon.js +17 -0
  71. package/dist/styleD/build/typescript/component/typography.cjs +7 -0
  72. package/dist/styleD/build/typescript/component/typography.js +5 -0
  73. package/dist/styleD/build/typescript/component/userMenu.cjs +37 -0
  74. package/dist/styleD/build/typescript/component/userMenu.js +35 -0
  75. package/dist/styleD/build/typescript/semantic/colors.cjs +14 -10
  76. package/dist/styleD/build/typescript/semantic/colors.js +14 -10
  77. package/dist/styleD/build/typescript/semantic/sizing.cjs +2 -1
  78. package/dist/styleD/build/typescript/semantic/sizing.js +2 -1
  79. package/dist/styleD/build/typescript/semantic/typography.cjs +5 -0
  80. package/dist/styleD/build/typescript/semantic/typography.js +5 -0
  81. package/dist/types/avatar.d.ts +19 -0
  82. package/dist/types/button.d.ts +20 -0
  83. package/dist/types/components/TitleText.d.ts +6 -0
  84. package/dist/types/components/avatar/Avatar.d.ts +2 -0
  85. package/dist/types/components/avatar/styles.d.ts +8 -0
  86. package/dist/types/components/avatar/types.d.ts +45 -0
  87. package/dist/types/components/button/Button.d.ts +2 -0
  88. package/dist/types/components/button/styles.d.ts +7 -0
  89. package/dist/types/components/button/types.d.ts +13 -0
  90. package/dist/types/components/byline/schema.d.ts +1 -1
  91. package/dist/types/components/icon/Icon.d.ts +2 -0
  92. package/dist/types/components/icon/styles.d.ts +8 -0
  93. package/dist/types/components/icon/types.d.ts +28 -0
  94. package/dist/types/components/link-button/LinkButton.d.ts +2 -0
  95. package/dist/types/components/link-button/styles.d.ts +330 -0
  96. package/dist/types/components/link-button/types.d.ts +13 -0
  97. package/dist/types/components/typography/Typography.d.ts +6 -0
  98. package/dist/types/components/typography/styles.d.ts +7 -0
  99. package/dist/types/components/typography/types.d.ts +13 -0
  100. package/dist/types/components/user-menu/PreferenceRadioGroup.d.ts +15 -0
  101. package/dist/types/components/user-menu/UserMenu.d.ts +17 -0
  102. package/dist/types/components/user-menu/default-options.d.ts +5 -0
  103. package/dist/types/components/user-menu/model.d.ts +9 -0
  104. package/dist/types/components/user-menu/styles.d.ts +9 -0
  105. package/dist/types/components/user-menu/theme.d.ts +3 -0
  106. package/dist/types/components/user-menu/types.d.ts +5 -0
  107. package/dist/types/fonts/material-symbols-types.d.ts +3822 -0
  108. package/dist/types/icon.d.ts +27 -0
  109. package/dist/types/index.d.ts +17 -0
  110. package/dist/types/link-button.d.ts +20 -0
  111. package/dist/types/styleD/build/typescript/base/colors.d.ts +1 -1
  112. package/dist/types/styleD/build/typescript/base/sizing.d.ts +2 -0
  113. package/dist/types/styleD/build/typescript/component/avatar.d.ts +88 -0
  114. package/dist/types/styleD/build/typescript/component/button.d.ts +331 -0
  115. package/dist/types/styleD/build/typescript/component/icon.d.ts +19 -0
  116. package/dist/types/styleD/build/typescript/component/typography.d.ts +7 -0
  117. package/dist/types/styleD/build/typescript/component/userMenu.d.ts +37 -0
  118. package/dist/types/styleD/build/typescript/semantic/colors.d.ts +7 -3
  119. package/dist/types/styleD/build/typescript/semantic/sizing.d.ts +1 -0
  120. package/dist/types/styleD/build/typescript/semantic/typography.d.ts +5 -0
  121. package/dist/types/typography.d.ts +19 -0
  122. package/dist/types/user-menu.d.ts +18 -0
  123. package/dist/types/util/reset.d.ts +1 -0
  124. package/dist/types/util/storybookStyles.d.ts +1 -0
  125. package/dist/types/util/types.d.ts +28 -0
  126. package/dist/types/utils.d.ts +1 -0
  127. package/dist/typography.cjs +9 -0
  128. package/dist/typography.js +2 -0
  129. package/dist/user-menu.cjs +9 -0
  130. package/dist/user-menu.js +2 -0
  131. package/dist/util/css/reset.css +124 -0
  132. package/dist/util/reset.cjs +10 -0
  133. package/dist/util/reset.css.cjs +5 -0
  134. package/dist/util/reset.css.js +3 -0
  135. package/dist/util/reset.js +8 -0
  136. package/dist/utils.cjs +2 -0
  137. package/dist/utils.js +1 -0
  138. package/package.json +65 -3
@@ -0,0 +1,12 @@
1
+ import { css } from '@emotion/react';
2
+ import { componentTypography } from '../../styleD/build/typescript/component/typography.js';
3
+ import { convertTypographyToEmotionStringStyle } from '../../styleD/utils/semantic/typography.js';
4
+ import { semanticTypography } from '../../styleD/build/typescript/semantic/typography.js';
5
+
6
+ const defaultTypographyTheme = componentTypography;
7
+ const typographyStyles = (theme, { variant }) => css`
8
+ ${convertTypographyToEmotionStringStyle(semanticTypography[variant])}
9
+ color: ${theme.color};
10
+ `;
11
+
12
+ export { defaultTypographyTheme, typographyStyles };
@@ -0,0 +1,53 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('@emotion/react/jsx-runtime');
4
+ var react = require('@emotion/react');
5
+ var reactAriaComponents = require('react-aria-components');
6
+ var styles = require('./styles.cjs');
7
+
8
+ function PreferenceRadioGroup({
9
+ name,
10
+ options,
11
+ currentValue,
12
+ changeValue,
13
+ theme,
14
+ format = "stack"
15
+ }) {
16
+ const groupCss = format === "stack" ? styles.toggleButtonStackedGroupStyles(theme) : styles.toggleButtonRowsGroupStyles(theme);
17
+ const buttonStyle = format === "stack" ? styles.toggleButtonStyles(theme) : [styles.toggleButtonStyles(theme), react.css({ flexBasis: "30%" })];
18
+ const defaultOptionId = options.find((option) => option.isDefault)?.id;
19
+ const selectedKeys = currentValue ? [currentValue] : defaultOptionId ? [defaultOptionId] : [];
20
+ return /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
21
+ /* @__PURE__ */ jsxRuntime.jsx("div", { css: styles.radioGroupLabelStyles(theme), children: name }),
22
+ /* @__PURE__ */ jsxRuntime.jsx(
23
+ reactAriaComponents.ToggleButtonGroup,
24
+ {
25
+ css: groupCss,
26
+ selectionMode: "single",
27
+ orientation: format === "stack" ? "vertical" : "horizontal",
28
+ selectedKeys,
29
+ onSelectionChange: (e) => {
30
+ const newValue = Array.from(e).pop() ?? currentValue;
31
+ if (typeof newValue === "string") {
32
+ changeValue(newValue);
33
+ }
34
+ },
35
+ children: options.map((option, index) => /* @__PURE__ */ jsxRuntime.jsxs(
36
+ reactAriaComponents.ToggleButton,
37
+ {
38
+ id: option.id,
39
+ css: buttonStyle,
40
+ style: option.buttonStyle,
41
+ children: [
42
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: option.labelStyle, children: option.label ?? option.id }),
43
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: option.description })
44
+ ]
45
+ },
46
+ index
47
+ ))
48
+ }
49
+ )
50
+ ] });
51
+ }
52
+
53
+ exports.PreferenceRadioGroup = PreferenceRadioGroup;
@@ -0,0 +1,19 @@
1
+ import { jsxs, jsx } from '@emotion/react/jsx-runtime';
2
+ import { css } from '@emotion/react';
3
+ import { ToggleButtonGroup, ToggleButton } from 'react-aria-components';
4
+ import { toggleButtonStackedGroupStyles, toggleButtonRowsGroupStyles, toggleButtonStyles, radioGroupLabelStyles } from './styles.js';
5
+
6
+ function PreferenceRadioGroup({ name, options, currentValue, changeValue, theme, format = "stack" }) {
7
+ const groupCss = format === "stack" ? toggleButtonStackedGroupStyles(theme) : toggleButtonRowsGroupStyles(theme);
8
+ const buttonStyle = format === "stack" ? toggleButtonStyles(theme) : [toggleButtonStyles(theme), css({ flexBasis: "30%" })];
9
+ const defaultOptionId = options.find((option) => option.isDefault)?.id;
10
+ const selectedKeys = currentValue ? [currentValue] : defaultOptionId ? [defaultOptionId] : [];
11
+ return jsxs("label", { children: [jsx("div", { css: radioGroupLabelStyles(theme), children: name }), jsx(ToggleButtonGroup, { css: groupCss, selectionMode: "single", orientation: format === "stack" ? "vertical" : "horizontal", selectedKeys, onSelectionChange: (e) => {
12
+ const newValue = Array.from(e).pop() ?? currentValue;
13
+ if (typeof newValue === "string") {
14
+ changeValue(newValue);
15
+ }
16
+ }, children: options.map((option, index) => jsxs(ToggleButton, { id: option.id, css: buttonStyle, style: option.buttonStyle, children: [jsx("div", { style: option.labelStyle, children: option.label ?? option.id }), jsx("div", { children: option.description })] }, index)) })] });
17
+ }
18
+
19
+ export { PreferenceRadioGroup };
@@ -0,0 +1,67 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('@emotion/react/jsx-runtime');
4
+ var TitleText = require('../TitleText.cjs');
5
+ var defaultOptions = require('./default-options.cjs');
6
+ var PreferenceRadioGroup = require('./PreferenceRadioGroup.cjs');
7
+ var styles = require('./styles.cjs');
8
+
9
+ function UserMenu({
10
+ theme,
11
+ feedBacklink,
12
+ preferences,
13
+ updatePreferences,
14
+ textSizeOptions,
15
+ fontFamilyOptions,
16
+ colorSchemeOptions,
17
+ headingLevel
18
+ }) {
19
+ return /* @__PURE__ */ jsxRuntime.jsxs("aside", { css: styles.userMenuStyles(theme), children: [
20
+ /* @__PURE__ */ jsxRuntime.jsx(
21
+ TitleText.TitleText,
22
+ {
23
+ headingLevel,
24
+ css: styles.userMenuHeadingStyles(theme),
25
+ children: "Accessibility Settings"
26
+ }
27
+ ),
28
+ /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
29
+ "Customise your reading & writing experience.",
30
+ " ",
31
+ feedBacklink && /* @__PURE__ */ jsxRuntime.jsx("a", { href: feedBacklink, target: "_blank", rel: "noreferrer", children: "Send feedback" })
32
+ ] }) }),
33
+ (!textSizeOptions || textSizeOptions.length > 0) && /* @__PURE__ */ jsxRuntime.jsx(
34
+ PreferenceRadioGroup.PreferenceRadioGroup,
35
+ {
36
+ theme,
37
+ options: textSizeOptions ?? defaultOptions.textSizes,
38
+ name: "Text Size",
39
+ currentValue: preferences.fontpreferences,
40
+ changeValue: (fontpreferences) => updatePreferences({ fontpreferences })
41
+ }
42
+ ),
43
+ (!fontFamilyOptions || fontFamilyOptions.length > 0) && /* @__PURE__ */ jsxRuntime.jsx(
44
+ PreferenceRadioGroup.PreferenceRadioGroup,
45
+ {
46
+ theme,
47
+ options: fontFamilyOptions ?? defaultOptions.fontFamilies,
48
+ name: "Font Family",
49
+ currentValue: preferences.fontType,
50
+ changeValue: (fontType) => updatePreferences({ fontType })
51
+ }
52
+ ),
53
+ (!colorSchemeOptions || colorSchemeOptions.length > 0) && /* @__PURE__ */ jsxRuntime.jsx(
54
+ PreferenceRadioGroup.PreferenceRadioGroup,
55
+ {
56
+ theme,
57
+ format: "rows",
58
+ options: colorSchemeOptions ?? defaultOptions.colorSchemes,
59
+ name: "Color scheme",
60
+ currentValue: preferences.colorScheme,
61
+ changeValue: (colorScheme) => updatePreferences({ colorScheme })
62
+ }
63
+ )
64
+ ] });
65
+ }
66
+
67
+ exports.UserMenu = UserMenu;
@@ -0,0 +1,11 @@
1
+ import { jsxs, jsx } from '@emotion/react/jsx-runtime';
2
+ import { TitleText } from '../TitleText.js';
3
+ import { textSizes, fontFamilies, colorSchemes } from './default-options.js';
4
+ import { PreferenceRadioGroup } from './PreferenceRadioGroup.js';
5
+ import { userMenuStyles, userMenuHeadingStyles } from './styles.js';
6
+
7
+ function UserMenu({ theme, feedBacklink, preferences, updatePreferences, textSizeOptions, fontFamilyOptions, colorSchemeOptions, headingLevel }) {
8
+ return jsxs("aside", { css: userMenuStyles(theme), children: [jsx(TitleText, { headingLevel, css: userMenuHeadingStyles(theme), children: "Accessibility Settings" }), jsx("div", { children: jsxs("p", { children: ["Customise your reading & writing experience.", " ", feedBacklink && jsx("a", { href: feedBacklink, target: "_blank", rel: "noreferrer", children: "Send feedback" })] }) }), (!textSizeOptions || textSizeOptions.length > 0) && jsx(PreferenceRadioGroup, { theme, options: textSizeOptions ?? textSizes, name: "Text Size", currentValue: preferences.fontpreferences, changeValue: (fontpreferences) => updatePreferences({ fontpreferences }) }), (!fontFamilyOptions || fontFamilyOptions.length > 0) && jsx(PreferenceRadioGroup, { theme, options: fontFamilyOptions ?? fontFamilies, name: "Font Family", currentValue: preferences.fontType, changeValue: (fontType) => updatePreferences({ fontType }) }), (!colorSchemeOptions || colorSchemeOptions.length > 0) && jsx(PreferenceRadioGroup, { theme, format: "rows", options: colorSchemeOptions ?? colorSchemes, name: "Color scheme", currentValue: preferences.colorScheme, changeValue: (colorScheme) => updatePreferences({ colorScheme }) })] });
9
+ }
10
+
11
+ export { UserMenu };
@@ -0,0 +1,109 @@
1
+ 'use strict';
2
+
3
+ var spacing = require('../../styleD/build/typescript/base/spacing.cjs');
4
+ var typography = require('../../styleD/build/typescript/base/typography.cjs');
5
+
6
+ const textSizes = [
7
+ {
8
+ id: "font-preference-small",
9
+ label: "Small",
10
+ description: "Compact reading",
11
+ labelStyle: {
12
+ fontSize: typography.baseTypography.size["12-px"]
13
+ }
14
+ },
15
+ {
16
+ id: "font-preference-medium",
17
+ label: "Medium",
18
+ description: "Standard reading",
19
+ labelStyle: {
20
+ fontSize: typography.baseTypography.size["16-px"]
21
+ }
22
+ },
23
+ {
24
+ id: "font-preference-large",
25
+ label: "Large",
26
+ description: "Comfortable reading",
27
+ labelStyle: {
28
+ fontSize: typography.baseTypography.size["20-px"]
29
+ }
30
+ }
31
+ ];
32
+ const fontFamilies = [
33
+ {
34
+ id: "font-serif",
35
+ label: "Guardian Text Egyptian",
36
+ description: "Classic Guardian Serif",
37
+ labelStyle: {
38
+ fontFamily: typography.baseTypography.family["Guardian Text Egyptian"],
39
+ fontSize: typography.baseTypography.size["20-px"]
40
+ }
41
+ },
42
+ {
43
+ id: "open-sans-compact",
44
+ label: "Open Sans Compact",
45
+ description: "compact sans-Serif",
46
+ labelStyle: {
47
+ fontFamily: typography.baseTypography.family["Open Sans Compact"],
48
+ fontSize: typography.baseTypography.size["20-px"]
49
+ }
50
+ },
51
+ {
52
+ id: "open-sans",
53
+ label: "Open Sans",
54
+ description: "Sans-Serif",
55
+ labelStyle: {
56
+ fontFamily: typography.baseTypography.family["Open Sans"],
57
+ fontSize: typography.baseTypography.size["20-px"]
58
+ }
59
+ }
60
+ ];
61
+ const colorSchemes = [
62
+ {
63
+ id: "white",
64
+ buttonStyle: {
65
+ backgroundColor: "white",
66
+ padding: spacing.baseSpacing["10-rem"]
67
+ },
68
+ isDefault: true
69
+ },
70
+ {
71
+ id: "cream",
72
+ buttonStyle: {
73
+ backgroundColor: "antiquewhite",
74
+ padding: spacing.baseSpacing["10-rem"]
75
+ }
76
+ },
77
+ {
78
+ id: "green",
79
+ buttonStyle: {
80
+ backgroundColor: "lightgreen",
81
+ padding: spacing.baseSpacing["10-rem"]
82
+ }
83
+ },
84
+ {
85
+ id: "pink",
86
+ buttonStyle: {
87
+ backgroundColor: "pink",
88
+ padding: spacing.baseSpacing["10-rem"]
89
+ }
90
+ },
91
+ {
92
+ id: "blue",
93
+ buttonStyle: {
94
+ backgroundColor: "skyblue",
95
+ padding: spacing.baseSpacing["10-rem"]
96
+ }
97
+ },
98
+ {
99
+ id: "orange",
100
+ buttonStyle: {
101
+ backgroundColor: "orange",
102
+ padding: spacing.baseSpacing["10-rem"]
103
+ }
104
+ }
105
+ ];
106
+
107
+ exports.colorSchemes = colorSchemes;
108
+ exports.fontFamilies = fontFamilies;
109
+ exports.textSizes = textSizes;
@@ -0,0 +1,105 @@
1
+ import { baseSpacing } from '../../styleD/build/typescript/base/spacing.js';
2
+ import { baseTypography } from '../../styleD/build/typescript/base/typography.js';
3
+
4
+ const textSizes = [
5
+ {
6
+ id: "font-preference-small",
7
+ label: "Small",
8
+ description: "Compact reading",
9
+ labelStyle: {
10
+ fontSize: baseTypography.size["12-px"]
11
+ }
12
+ },
13
+ {
14
+ id: "font-preference-medium",
15
+ label: "Medium",
16
+ description: "Standard reading",
17
+ labelStyle: {
18
+ fontSize: baseTypography.size["16-px"]
19
+ }
20
+ },
21
+ {
22
+ id: "font-preference-large",
23
+ label: "Large",
24
+ description: "Comfortable reading",
25
+ labelStyle: {
26
+ fontSize: baseTypography.size["20-px"]
27
+ }
28
+ }
29
+ ];
30
+ const fontFamilies = [
31
+ {
32
+ id: "font-serif",
33
+ label: "Guardian Text Egyptian",
34
+ description: "Classic Guardian Serif",
35
+ labelStyle: {
36
+ fontFamily: baseTypography.family["Guardian Text Egyptian"],
37
+ fontSize: baseTypography.size["20-px"]
38
+ }
39
+ },
40
+ {
41
+ id: "open-sans-compact",
42
+ label: "Open Sans Compact",
43
+ description: "compact sans-Serif",
44
+ labelStyle: {
45
+ fontFamily: baseTypography.family["Open Sans Compact"],
46
+ fontSize: baseTypography.size["20-px"]
47
+ }
48
+ },
49
+ {
50
+ id: "open-sans",
51
+ label: "Open Sans",
52
+ description: "Sans-Serif",
53
+ labelStyle: {
54
+ fontFamily: baseTypography.family["Open Sans"],
55
+ fontSize: baseTypography.size["20-px"]
56
+ }
57
+ }
58
+ ];
59
+ const colorSchemes = [
60
+ {
61
+ id: "white",
62
+ buttonStyle: {
63
+ backgroundColor: "white",
64
+ padding: baseSpacing["10-rem"]
65
+ },
66
+ isDefault: true
67
+ },
68
+ {
69
+ id: "cream",
70
+ buttonStyle: {
71
+ backgroundColor: "antiquewhite",
72
+ padding: baseSpacing["10-rem"]
73
+ }
74
+ },
75
+ {
76
+ id: "green",
77
+ buttonStyle: {
78
+ backgroundColor: "lightgreen",
79
+ padding: baseSpacing["10-rem"]
80
+ }
81
+ },
82
+ {
83
+ id: "pink",
84
+ buttonStyle: {
85
+ backgroundColor: "pink",
86
+ padding: baseSpacing["10-rem"]
87
+ }
88
+ },
89
+ {
90
+ id: "blue",
91
+ buttonStyle: {
92
+ backgroundColor: "skyblue",
93
+ padding: baseSpacing["10-rem"]
94
+ }
95
+ },
96
+ {
97
+ id: "orange",
98
+ buttonStyle: {
99
+ backgroundColor: "orange",
100
+ padding: baseSpacing["10-rem"]
101
+ }
102
+ }
103
+ ];
104
+
105
+ export { colorSchemes, fontFamilies, textSizes };
@@ -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
+ }