@guardian/stand 0.0.24 → 0.0.26
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/alert-banner.cjs +9 -0
- package/dist/alert-banner.js +2 -0
- package/dist/components/alert-banner/AlertBanner.cjs +64 -0
- package/dist/components/alert-banner/AlertBanner.js +29 -0
- package/dist/components/alert-banner/styles.cjs +35 -0
- package/dist/components/alert-banner/styles.js +31 -0
- package/dist/components/menu/styles.cjs +0 -1
- package/dist/components/menu/styles.js +0 -1
- package/dist/components/topbar/TopBar.cjs +23 -9
- package/dist/components/topbar/TopBar.js +11 -9
- package/dist/components/topbar/topBarToolName/styles.cjs +1 -0
- package/dist/components/topbar/topBarToolName/styles.js +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.js +1 -0
- package/dist/styleD/build/css/component/TopBar.css +1 -0
- package/dist/styleD/build/css/component/alertBanner.css +31 -0
- package/dist/styleD/build/css/component/radioGroup.css +1 -1
- package/dist/styleD/build/typescript/component/TopBar.cjs +1 -0
- package/dist/styleD/build/typescript/component/TopBar.js +1 -0
- package/dist/styleD/build/typescript/component/alertBanner.cjs +48 -0
- package/dist/styleD/build/typescript/component/alertBanner.js +46 -0
- package/dist/styleD/build/typescript/component/radioGroup.cjs +1 -1
- package/dist/styleD/build/typescript/component/radioGroup.js +1 -1
- package/dist/types/alert-banner.d.ts +19 -0
- package/dist/types/components/alert-banner/AlertBanner.d.ts +2 -0
- package/dist/types/components/alert-banner/sandbox.d.ts +5 -0
- package/dist/types/components/alert-banner/styles.d.ts +9 -0
- package/dist/types/components/alert-banner/types.d.ts +27 -0
- package/dist/types/components/avatar/styles.d.ts +1 -1
- package/dist/types/components/button/styles.d.ts +1 -1
- package/dist/types/components/byline/theme.d.ts +2 -2
- package/dist/types/components/checkbox/styles.d.ts +2 -2
- package/dist/types/components/favicon/styles.d.ts +1 -1
- package/dist/types/components/icon/styles.d.ts +1 -1
- package/dist/types/components/menu/styles.d.ts +5 -5
- package/dist/types/components/select/styles.d.ts +1 -1
- package/dist/types/components/topbar/TopBar.d.ts +5 -2
- package/dist/types/components/topbar/styles.d.ts +1 -1
- package/dist/types/components/topbar/topBarItem/styles.d.ts +1 -1
- package/dist/types/components/topbar/topBarNavigation/styles.d.ts +1 -1
- package/dist/types/components/topbar/topBarToolName/styles.d.ts +1 -1
- package/dist/types/components/typography/styles.d.ts +1 -1
- package/dist/types/components/user-menu/theme.d.ts +2 -2
- package/dist/types/index.d.ts +2 -0
- package/dist/types/styleD/build/typescript/component/TopBar.d.ts +1 -0
- package/dist/types/styleD/build/typescript/component/alertBanner.d.ts +48 -0
- package/dist/types/styleD/build/typescript/component/radioGroup.d.ts +1 -1
- package/package.json +12 -3
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var AlertBanner = require('./components/alert-banner/AlertBanner.cjs');
|
|
4
|
+
var alertBanner = require('./styleD/build/typescript/component/alertBanner.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.AlertBanner = AlertBanner.AlertBanner;
|
|
9
|
+
exports.componentAlertBanner = alertBanner.componentAlertBanner;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var mergeDeep = require('../../util/mergeDeep.cjs');
|
|
6
|
+
var styles = require('./styles.cjs');
|
|
7
|
+
var Icon = require('../icon/Icon.cjs');
|
|
8
|
+
var IconButton = require('../icon-button/IconButton.cjs');
|
|
9
|
+
|
|
10
|
+
function AlertBanner({
|
|
11
|
+
level,
|
|
12
|
+
showIcon = false,
|
|
13
|
+
icon,
|
|
14
|
+
closeButtonProps,
|
|
15
|
+
children,
|
|
16
|
+
theme = {},
|
|
17
|
+
cssOverrides,
|
|
18
|
+
className,
|
|
19
|
+
...props
|
|
20
|
+
}) {
|
|
21
|
+
const mergedTheme = mergeDeep.mergeDeep(styles.defaultAlertBannerTheme, theme);
|
|
22
|
+
const determinedIcon = React.useMemo(() => {
|
|
23
|
+
if (icon) {
|
|
24
|
+
return icon;
|
|
25
|
+
}
|
|
26
|
+
switch (level) {
|
|
27
|
+
case "error":
|
|
28
|
+
return "warning";
|
|
29
|
+
case "success":
|
|
30
|
+
return "sentiment_satisfied";
|
|
31
|
+
case "warning":
|
|
32
|
+
return "flag";
|
|
33
|
+
case "information":
|
|
34
|
+
default:
|
|
35
|
+
return "info";
|
|
36
|
+
}
|
|
37
|
+
}, [icon, level]);
|
|
38
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
css: [styles.alertBannerStyles(mergedTheme, { level }), cssOverrides],
|
|
42
|
+
className,
|
|
43
|
+
...props,
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { css: styles.alertBannerContentStyles(mergedTheme), children: [
|
|
46
|
+
showIcon && /* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { size: "md", fill: mergedTheme.shared.content.icon.color, children: determinedIcon }),
|
|
47
|
+
children
|
|
48
|
+
] }),
|
|
49
|
+
closeButtonProps && /* @__PURE__ */ jsxRuntime.jsx(
|
|
50
|
+
IconButton.IconButton,
|
|
51
|
+
{
|
|
52
|
+
variant: "tertiary",
|
|
53
|
+
size: "xs",
|
|
54
|
+
symbol: "close",
|
|
55
|
+
ariaLabel: "Close alert banner",
|
|
56
|
+
...closeButtonProps
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
exports.AlertBanner = AlertBanner;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
4
|
+
import { alertBannerContentStyles, alertBannerStyles, defaultAlertBannerTheme } from './styles.js';
|
|
5
|
+
import { Icon } from '../icon/Icon.js';
|
|
6
|
+
import { IconButton } from '../icon-button/IconButton.js';
|
|
7
|
+
|
|
8
|
+
function AlertBanner({ level, showIcon = false, icon, closeButtonProps, children, theme = {}, cssOverrides, className, ...props }) {
|
|
9
|
+
const mergedTheme = mergeDeep(defaultAlertBannerTheme, theme);
|
|
10
|
+
const determinedIcon = useMemo(() => {
|
|
11
|
+
if (icon) {
|
|
12
|
+
return icon;
|
|
13
|
+
}
|
|
14
|
+
switch (level) {
|
|
15
|
+
case "error":
|
|
16
|
+
return "warning";
|
|
17
|
+
case "success":
|
|
18
|
+
return "sentiment_satisfied";
|
|
19
|
+
case "warning":
|
|
20
|
+
return "flag";
|
|
21
|
+
case "information":
|
|
22
|
+
default:
|
|
23
|
+
return "info";
|
|
24
|
+
}
|
|
25
|
+
}, [icon, level]);
|
|
26
|
+
return jsxs("div", { css: [alertBannerStyles(mergedTheme, { level }), cssOverrides], className, ...props, children: [jsxs("div", { css: alertBannerContentStyles(mergedTheme), children: [showIcon && jsx(Icon, { size: "md", fill: mergedTheme.shared.content.icon.color, children: determinedIcon }), children] }), closeButtonProps && jsx(IconButton, { variant: "tertiary", size: "xs", symbol: "close", ariaLabel: "Close alert banner", ...closeButtonProps })] });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { AlertBanner };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('@emotion/react');
|
|
4
|
+
var alertBanner = require('../../styleD/build/typescript/component/alertBanner.cjs');
|
|
5
|
+
var typography = require('../../styleD/utils/semantic/typography.cjs');
|
|
6
|
+
|
|
7
|
+
const defaultAlertBannerTheme = alertBanner.componentAlertBanner;
|
|
8
|
+
const alertBannerStyles = (theme, { level }) => {
|
|
9
|
+
return react.css`
|
|
10
|
+
display: ${theme.shared.display};
|
|
11
|
+
align-items: ${theme.shared["align-items"]};
|
|
12
|
+
justify-content: ${theme.shared["justify-content"]};
|
|
13
|
+
width: ${theme.shared.width};
|
|
14
|
+
height: ${theme.shared.height};
|
|
15
|
+
padding: ${theme.shared.padding.top} ${theme.shared.padding.right}
|
|
16
|
+
${theme.shared.padding.bottom} ${theme.shared.padding.left};
|
|
17
|
+
background-color: ${theme[level]["background-color"]};
|
|
18
|
+
`;
|
|
19
|
+
};
|
|
20
|
+
const alertBannerContentStyles = (theme) => {
|
|
21
|
+
return react.css`
|
|
22
|
+
display: ${theme.shared.content.display};
|
|
23
|
+
justify-content: ${theme.shared.content["justify-content"]};
|
|
24
|
+
gap: ${theme.shared.content.gap};
|
|
25
|
+
height: ${theme.shared.content.height};
|
|
26
|
+
align-items: ${theme.shared.content["align-items"]};
|
|
27
|
+
flex: ${theme.shared.content.flex};
|
|
28
|
+
color: ${theme.shared.content.color};
|
|
29
|
+
${typography.convertTypographyToEmotionStringStyle(theme.shared.content.typography)}
|
|
30
|
+
`;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
exports.alertBannerContentStyles = alertBannerContentStyles;
|
|
34
|
+
exports.alertBannerStyles = alertBannerStyles;
|
|
35
|
+
exports.defaultAlertBannerTheme = defaultAlertBannerTheme;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
|
+
import { componentAlertBanner } from '../../styleD/build/typescript/component/alertBanner.js';
|
|
3
|
+
import { convertTypographyToEmotionStringStyle } from '../../styleD/utils/semantic/typography.js';
|
|
4
|
+
|
|
5
|
+
const defaultAlertBannerTheme = componentAlertBanner;
|
|
6
|
+
const alertBannerStyles = (theme, { level }) => {
|
|
7
|
+
return css`
|
|
8
|
+
display: ${theme.shared.display};
|
|
9
|
+
align-items: ${theme.shared["align-items"]};
|
|
10
|
+
justify-content: ${theme.shared["justify-content"]};
|
|
11
|
+
width: ${theme.shared.width};
|
|
12
|
+
height: ${theme.shared.height};
|
|
13
|
+
padding: ${theme.shared.padding.top} ${theme.shared.padding.right}
|
|
14
|
+
${theme.shared.padding.bottom} ${theme.shared.padding.left};
|
|
15
|
+
background-color: ${theme[level]["background-color"]};
|
|
16
|
+
`;
|
|
17
|
+
};
|
|
18
|
+
const alertBannerContentStyles = (theme) => {
|
|
19
|
+
return css`
|
|
20
|
+
display: ${theme.shared.content.display};
|
|
21
|
+
justify-content: ${theme.shared.content["justify-content"]};
|
|
22
|
+
gap: ${theme.shared.content.gap};
|
|
23
|
+
height: ${theme.shared.content.height};
|
|
24
|
+
align-items: ${theme.shared.content["align-items"]};
|
|
25
|
+
flex: ${theme.shared.content.flex};
|
|
26
|
+
color: ${theme.shared.content.color};
|
|
27
|
+
${convertTypographyToEmotionStringStyle(theme.shared.content.typography)}
|
|
28
|
+
`;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { alertBannerContentStyles, alertBannerStyles, defaultAlertBannerTheme };
|
|
@@ -74,7 +74,6 @@ const menuItemLabelStyles = (theme) => react.css`
|
|
|
74
74
|
grid-area: ${theme.shared.label["grid-area"]};
|
|
75
75
|
color: ${theme.shared.label.color};
|
|
76
76
|
${typography.convertTypographyToEmotionStringStyle(theme.shared.label.typography)}
|
|
77
|
-
)}
|
|
78
77
|
`;
|
|
79
78
|
const menuItemDescriptionStyles = (theme) => react.css`
|
|
80
79
|
grid-area: ${theme.shared.description["grid-area"]};
|
|
@@ -72,7 +72,6 @@ const menuItemLabelStyles = (theme) => css`
|
|
|
72
72
|
grid-area: ${theme.shared.label["grid-area"]};
|
|
73
73
|
color: ${theme.shared.label.color};
|
|
74
74
|
${convertTypographyToEmotionStringStyle(theme.shared.label.typography)}
|
|
75
|
-
)}
|
|
76
75
|
`;
|
|
77
76
|
const menuItemDescriptionStyles = (theme) => css`
|
|
78
77
|
grid-area: ${theme.shared.description["grid-area"]};
|
|
@@ -11,7 +11,8 @@ var TopBarToolName = require('./topBarToolName/TopBarToolName.cjs');
|
|
|
11
11
|
|
|
12
12
|
function TopBarSide({
|
|
13
13
|
children,
|
|
14
|
-
alignment
|
|
14
|
+
alignment,
|
|
15
|
+
theme
|
|
15
16
|
}) {
|
|
16
17
|
const items = [];
|
|
17
18
|
React.Children.forEach(children, (child, i) => {
|
|
@@ -22,6 +23,7 @@ function TopBarSide({
|
|
|
22
23
|
items.push(
|
|
23
24
|
React.cloneElement(child, {
|
|
24
25
|
key: `${child.key}-${i}`,
|
|
26
|
+
theme: theme?.Item,
|
|
25
27
|
alignment
|
|
26
28
|
})
|
|
27
29
|
);
|
|
@@ -30,6 +32,7 @@ function TopBarSide({
|
|
|
30
32
|
items.push(
|
|
31
33
|
React.cloneElement(child, {
|
|
32
34
|
key: `${child.key}-${i}`,
|
|
35
|
+
theme: theme?.Navigation,
|
|
33
36
|
alignment
|
|
34
37
|
})
|
|
35
38
|
);
|
|
@@ -38,14 +41,16 @@ function TopBarSide({
|
|
|
38
41
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: items });
|
|
39
42
|
}
|
|
40
43
|
function TopBarContainerRight({
|
|
41
|
-
children
|
|
44
|
+
children,
|
|
45
|
+
theme
|
|
42
46
|
}) {
|
|
43
|
-
return /* @__PURE__ */ jsxRuntime.jsx(TopBarSide, { alignment: "right", children });
|
|
47
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TopBarSide, { alignment: "right", theme, children });
|
|
44
48
|
}
|
|
45
49
|
function TopBarContainerLeft({
|
|
46
|
-
children
|
|
50
|
+
children,
|
|
51
|
+
theme
|
|
47
52
|
}) {
|
|
48
|
-
return /* @__PURE__ */ jsxRuntime.jsx(TopBarSide, { alignment: "left", children });
|
|
53
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TopBarSide, { alignment: "left", theme, children });
|
|
49
54
|
}
|
|
50
55
|
function TopBar({
|
|
51
56
|
children,
|
|
@@ -64,16 +69,25 @@ function TopBar({
|
|
|
64
69
|
return;
|
|
65
70
|
}
|
|
66
71
|
if (child.type === TopBarToolName.TopBarToolName) {
|
|
67
|
-
toolName ?? (toolName =
|
|
72
|
+
toolName ?? (toolName = React.cloneElement(
|
|
73
|
+
child,
|
|
74
|
+
{ theme: mergedTheme.ToolName }
|
|
75
|
+
));
|
|
68
76
|
}
|
|
69
77
|
if (child.type === Avatar.Avatar) {
|
|
70
|
-
avatar ?? (avatar = /* @__PURE__ */ jsxRuntime.jsx(TopBarItem.TopBarItem, { alignment: "right", children: child }));
|
|
78
|
+
avatar ?? (avatar = /* @__PURE__ */ jsxRuntime.jsx(TopBarItem.TopBarItem, { theme: mergedTheme.Item, alignment: "right", children: child }));
|
|
71
79
|
}
|
|
72
80
|
if (child.type === TopBarContainerLeft) {
|
|
73
|
-
leftSide ?? (leftSide =
|
|
81
|
+
leftSide ?? (leftSide = React.cloneElement(
|
|
82
|
+
child,
|
|
83
|
+
{ theme: mergedTheme }
|
|
84
|
+
));
|
|
74
85
|
}
|
|
75
86
|
if (child.type === TopBarContainerRight) {
|
|
76
|
-
rightSide ?? (rightSide =
|
|
87
|
+
rightSide ?? (rightSide = React.cloneElement(
|
|
88
|
+
child,
|
|
89
|
+
{ theme: mergedTheme }
|
|
90
|
+
));
|
|
77
91
|
}
|
|
78
92
|
});
|
|
79
93
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -7,7 +7,7 @@ import { TopBarItem } from './topBarItem/TopBarItem.js';
|
|
|
7
7
|
import { TopBarNavigation } from './topBarNavigation/TopBarNavigation.js';
|
|
8
8
|
import { TopBarToolName } from './topBarToolName/TopBarToolName.js';
|
|
9
9
|
|
|
10
|
-
function TopBarSide({ children, alignment }) {
|
|
10
|
+
function TopBarSide({ children, alignment, theme }) {
|
|
11
11
|
const items = [];
|
|
12
12
|
React.Children.forEach(children, (child, i) => {
|
|
13
13
|
if (!React.isValidElement(child)) {
|
|
@@ -16,23 +16,25 @@ function TopBarSide({ children, alignment }) {
|
|
|
16
16
|
if (child.type === TopBarItem) {
|
|
17
17
|
items.push(React.cloneElement(child, {
|
|
18
18
|
key: `${child.key}-${i}`,
|
|
19
|
+
theme: theme?.Item,
|
|
19
20
|
alignment
|
|
20
21
|
}));
|
|
21
22
|
}
|
|
22
23
|
if (child.type === TopBarNavigation) {
|
|
23
24
|
items.push(React.cloneElement(child, {
|
|
24
25
|
key: `${child.key}-${i}`,
|
|
26
|
+
theme: theme?.Navigation,
|
|
25
27
|
alignment
|
|
26
28
|
}));
|
|
27
29
|
}
|
|
28
30
|
});
|
|
29
31
|
return jsx(Fragment, { children: items });
|
|
30
32
|
}
|
|
31
|
-
function TopBarContainerRight({ children }) {
|
|
32
|
-
return jsx(TopBarSide, { alignment: "right", children });
|
|
33
|
+
function TopBarContainerRight({ children, theme }) {
|
|
34
|
+
return jsx(TopBarSide, { alignment: "right", theme, children });
|
|
33
35
|
}
|
|
34
|
-
function TopBarContainerLeft({ children }) {
|
|
35
|
-
return jsx(TopBarSide, { alignment: "left", children });
|
|
36
|
+
function TopBarContainerLeft({ children, theme }) {
|
|
37
|
+
return jsx(TopBarSide, { alignment: "left", theme, children });
|
|
36
38
|
}
|
|
37
39
|
function TopBar({ children, theme = {}, cssOverrides, className, ...props }) {
|
|
38
40
|
const mergedTheme = mergeDeep(defaultTopBarTheme, theme);
|
|
@@ -45,16 +47,16 @@ function TopBar({ children, theme = {}, cssOverrides, className, ...props }) {
|
|
|
45
47
|
return;
|
|
46
48
|
}
|
|
47
49
|
if (child.type === TopBarToolName) {
|
|
48
|
-
toolName ?? (toolName = child);
|
|
50
|
+
toolName ?? (toolName = React.cloneElement(child, { theme: mergedTheme.ToolName }));
|
|
49
51
|
}
|
|
50
52
|
if (child.type === Avatar) {
|
|
51
|
-
avatar ?? (avatar = jsx(TopBarItem, { alignment: "right", children: child }));
|
|
53
|
+
avatar ?? (avatar = jsx(TopBarItem, { theme: mergedTheme.Item, alignment: "right", children: child }));
|
|
52
54
|
}
|
|
53
55
|
if (child.type === TopBarContainerLeft) {
|
|
54
|
-
leftSide ?? (leftSide = child);
|
|
56
|
+
leftSide ?? (leftSide = React.cloneElement(child, { theme: mergedTheme }));
|
|
55
57
|
}
|
|
56
58
|
if (child.type === TopBarContainerRight) {
|
|
57
|
-
rightSide ?? (rightSide = child);
|
|
59
|
+
rightSide ?? (rightSide = React.cloneElement(child, { theme: mergedTheme }));
|
|
58
60
|
}
|
|
59
61
|
});
|
|
60
62
|
return jsxs("div", { css: [topBarStyles(mergedTheme), cssOverrides], className, ...props, children: [jsxs("div", { css: topBarContainerLeftStyles(mergedTheme), children: [toolName, leftSide] }), jsxs("div", { css: topBarContainerRightStyles(mergedTheme), children: [rightSide, avatar] })] });
|
package/dist/index.cjs
CHANGED
|
@@ -9,6 +9,7 @@ var button = require('./styleD/build/typescript/component/button.cjs');
|
|
|
9
9
|
var typography$1 = require('./styleD/build/typescript/component/typography.cjs');
|
|
10
10
|
var icon = require('./styleD/build/typescript/component/icon.cjs');
|
|
11
11
|
var favicon = require('./styleD/build/typescript/component/favicon.cjs');
|
|
12
|
+
var alertBanner = require('./styleD/build/typescript/component/alertBanner.cjs');
|
|
12
13
|
var radioGroup = require('./styleD/build/typescript/component/radioGroup.cjs');
|
|
13
14
|
var checkbox = require('./styleD/build/typescript/component/checkbox.cjs');
|
|
14
15
|
var textArea = require('./styleD/build/typescript/component/textArea.cjs');
|
|
@@ -39,6 +40,7 @@ exports.componentButton = button.componentButton;
|
|
|
39
40
|
exports.componentTypography = typography$1.componentTypography;
|
|
40
41
|
exports.componentIcon = icon.componentIcon;
|
|
41
42
|
exports.componentFavicon = favicon.componentFavicon;
|
|
43
|
+
exports.componentAlertBanner = alertBanner.componentAlertBanner;
|
|
42
44
|
exports.componentRadioGroup = radioGroup.componentRadioGroup;
|
|
43
45
|
exports.componentCheckbox = checkbox.componentCheckbox;
|
|
44
46
|
exports.componentTextArea = textArea.componentTextArea;
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export { componentButton } from './styleD/build/typescript/component/button.js';
|
|
|
7
7
|
export { componentTypography } from './styleD/build/typescript/component/typography.js';
|
|
8
8
|
export { componentIcon } from './styleD/build/typescript/component/icon.js';
|
|
9
9
|
export { componentFavicon } from './styleD/build/typescript/component/favicon.js';
|
|
10
|
+
export { componentAlertBanner } from './styleD/build/typescript/component/alertBanner.js';
|
|
10
11
|
export { componentRadioGroup } from './styleD/build/typescript/component/radioGroup.js';
|
|
11
12
|
export { componentCheckbox } from './styleD/build/typescript/component/checkbox.js';
|
|
12
13
|
export { componentTextArea } from './styleD/build/typescript/component/textArea.js';
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
--component-top-bar-navigation-sm-typography-letter-spacing: -0.0125rem;
|
|
59
59
|
--component-top-bar-navigation-sm-typography-font-width: 95;
|
|
60
60
|
--component-top-bar-tool-name-display: flex;
|
|
61
|
+
--component-top-bar-tool-name-color: #000000;
|
|
61
62
|
--component-top-bar-tool-name-align-items: center;
|
|
62
63
|
--component-top-bar-tool-name-gap: 8px;
|
|
63
64
|
--component-top-bar-tool-name-typography-font: normal 700 1.25rem/1.15
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
:root {
|
|
6
|
+
--component-alert-banner-shared-display: flex;
|
|
7
|
+
--component-alert-banner-shared-align-items: center;
|
|
8
|
+
--component-alert-banner-shared-justify-content: space-between;
|
|
9
|
+
--component-alert-banner-shared-padding-top: 0;
|
|
10
|
+
--component-alert-banner-shared-padding-right: 1rem;
|
|
11
|
+
--component-alert-banner-shared-padding-bottom: 0;
|
|
12
|
+
--component-alert-banner-shared-padding-left: 1rem;
|
|
13
|
+
--component-alert-banner-shared-width: 100%;
|
|
14
|
+
--component-alert-banner-shared-height: 2.5rem;
|
|
15
|
+
--component-alert-banner-shared-content-display: flex;
|
|
16
|
+
--component-alert-banner-shared-content-justify-content: center;
|
|
17
|
+
--component-alert-banner-shared-content-gap: 0.5rem;
|
|
18
|
+
--component-alert-banner-shared-content-flex: 1;
|
|
19
|
+
--component-alert-banner-shared-content-height: 100%;
|
|
20
|
+
--component-alert-banner-shared-content-align-items: center;
|
|
21
|
+
--component-alert-banner-shared-content-color: #000000;
|
|
22
|
+
--component-alert-banner-shared-content-typography-font: normal 460
|
|
23
|
+
0.875rem/1.3 'Open Sans';
|
|
24
|
+
--component-alert-banner-shared-content-typography-letter-spacing: 0;
|
|
25
|
+
--component-alert-banner-shared-content-typography-font-width: 95;
|
|
26
|
+
--component-alert-banner-shared-content-icon-color: #545454;
|
|
27
|
+
--component-alert-banner-information-background-color: #e8f0fb;
|
|
28
|
+
--component-alert-banner-success-background-color: #cde4c9;
|
|
29
|
+
--component-alert-banner-warning-background-color: #fbeebf;
|
|
30
|
+
--component-alert-banner-error-background-color: #f5c6c0;
|
|
31
|
+
}
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
--component-radio-group-shared-indicator-disabled-border: 0.0625rem solid
|
|
29
29
|
#dcdcdc;
|
|
30
30
|
--component-radio-group-shared-indicator-selected-after-background-color: #005d8b;
|
|
31
|
-
--component-radio-group-shared-indicator-selected-after-scale: 0.
|
|
31
|
+
--component-radio-group-shared-indicator-selected-after-scale: 0.6;
|
|
32
32
|
--component-radio-group-shared-indicator-selected-border: 0.125rem solid
|
|
33
33
|
#0072a9;
|
|
34
34
|
--component-radio-group-shared-indicator-selected-invalid-border: 0.125rem
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const componentAlertBanner = {
|
|
4
|
+
shared: {
|
|
5
|
+
display: "flex",
|
|
6
|
+
"align-items": "center",
|
|
7
|
+
"justify-content": "space-between",
|
|
8
|
+
padding: {
|
|
9
|
+
top: "0",
|
|
10
|
+
right: "1rem",
|
|
11
|
+
bottom: "0",
|
|
12
|
+
left: "1rem"
|
|
13
|
+
},
|
|
14
|
+
width: "100%",
|
|
15
|
+
height: "2.5rem",
|
|
16
|
+
content: {
|
|
17
|
+
display: "flex",
|
|
18
|
+
"justify-content": "center",
|
|
19
|
+
gap: "0.5rem",
|
|
20
|
+
flex: "1",
|
|
21
|
+
height: "100%",
|
|
22
|
+
"align-items": "center",
|
|
23
|
+
color: "#000000",
|
|
24
|
+
typography: {
|
|
25
|
+
font: "normal 460 0.875rem/1.3 Open Sans",
|
|
26
|
+
letterSpacing: "0rem",
|
|
27
|
+
fontWidth: 95
|
|
28
|
+
},
|
|
29
|
+
icon: {
|
|
30
|
+
color: "#545454"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
information: {
|
|
35
|
+
"background-color": "#e8f0fb"
|
|
36
|
+
},
|
|
37
|
+
success: {
|
|
38
|
+
"background-color": "#cde4c9"
|
|
39
|
+
},
|
|
40
|
+
warning: {
|
|
41
|
+
"background-color": "#fbeebf"
|
|
42
|
+
},
|
|
43
|
+
error: {
|
|
44
|
+
"background-color": "#f5c6c0"
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
exports.componentAlertBanner = componentAlertBanner;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const componentAlertBanner = {
|
|
2
|
+
shared: {
|
|
3
|
+
display: "flex",
|
|
4
|
+
"align-items": "center",
|
|
5
|
+
"justify-content": "space-between",
|
|
6
|
+
padding: {
|
|
7
|
+
top: "0",
|
|
8
|
+
right: "1rem",
|
|
9
|
+
bottom: "0",
|
|
10
|
+
left: "1rem"
|
|
11
|
+
},
|
|
12
|
+
width: "100%",
|
|
13
|
+
height: "2.5rem",
|
|
14
|
+
content: {
|
|
15
|
+
display: "flex",
|
|
16
|
+
"justify-content": "center",
|
|
17
|
+
gap: "0.5rem",
|
|
18
|
+
flex: "1",
|
|
19
|
+
height: "100%",
|
|
20
|
+
"align-items": "center",
|
|
21
|
+
color: "#000000",
|
|
22
|
+
typography: {
|
|
23
|
+
font: "normal 460 0.875rem/1.3 Open Sans",
|
|
24
|
+
letterSpacing: "0rem",
|
|
25
|
+
fontWidth: 95
|
|
26
|
+
},
|
|
27
|
+
icon: {
|
|
28
|
+
color: "#545454"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
information: {
|
|
33
|
+
"background-color": "#e8f0fb"
|
|
34
|
+
},
|
|
35
|
+
success: {
|
|
36
|
+
"background-color": "#cde4c9"
|
|
37
|
+
},
|
|
38
|
+
warning: {
|
|
39
|
+
"background-color": "#fbeebf"
|
|
40
|
+
},
|
|
41
|
+
error: {
|
|
42
|
+
"background-color": "#f5c6c0"
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export { componentAlertBanner };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AlertBanner component entry point
|
|
3
|
+
*
|
|
4
|
+
* Peer dependencies required to use these components:
|
|
5
|
+
* - `@emotion/react`
|
|
6
|
+
* - `react`
|
|
7
|
+
* - `react-dom`
|
|
8
|
+
* - `typescript`
|
|
9
|
+
*
|
|
10
|
+
* See the `peerDependencies` section of package.json for compatible versions.
|
|
11
|
+
*
|
|
12
|
+
* If you only need the built CSS (./component/alertBanner.css),
|
|
13
|
+
* you don't need to install these.
|
|
14
|
+
*/
|
|
15
|
+
export { AlertBanner } from './components/alert-banner/AlertBanner';
|
|
16
|
+
export type { AlertBannerProps } from './components/alert-banner/types';
|
|
17
|
+
export type { AlertBannerTheme } from './components/alert-banner/styles';
|
|
18
|
+
export { componentAlertBanner } from './styleD/build/typescript/component/alertBanner';
|
|
19
|
+
export type { ComponentAlertBanner } from './styleD/build/typescript/component/alertBanner';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const componentName = "AlertBanner";
|
|
2
|
+
export declare const componentTsx = "import { AlertBanner } from '@guardian/stand/alert-banner';\n\nexport const Component = () => (\n\t<>\n\t\t<AlertBanner level=\"information\">\n\t\t\tYou are working in the CODE Environment\n\t\t</AlertBanner>\n\t\t<AlertBanner level=\"success\" showIcon>\n\t\t\tYour changes have been published.\n\t\t</AlertBanner>\n\t\t<AlertBanner\n\t\t\tlevel=\"error\"\n\t\t\tshowIcon\n\t\t\tcloseButtonProps={{ onPress: () => alert('Dismissed') }}\n\t\t>\n\t\t\tUnable to save changes.\n\t\t</AlertBanner>\n\t</>\n);\n";
|
|
3
|
+
export declare const componentCss = "\n/* import the alertbanner styles */\n@import '@guardian/stand/component/alertBanner.css';\n\n.stand-alert-banner {\n\tdisplay: var(--component-alert-banner-shared-display);\n\talign-items: var(--component-alert-banner-shared-align-items);\n\tjustify-content: var(--component-alert-banner-shared-justify-content);\n\tpadding: var(--component-alert-banner-shared-padding-top)\n\t\tvar(--component-alert-banner-shared-padding-right)\n\t\tvar(--component-alert-banner-shared-padding-bottom)\n\t\tvar(--component-alert-banner-shared-padding-left);\n\twidth: var(--component-alert-banner-shared-width);\n\theight: var(--component-alert-banner-shared-height);\n}\n\n.stand-alert-banner-content {\n\tdisplay: var(--component-alert-banner-shared-content-display);\n\tjustify-content: var(--component-alert-banner-shared-content-justify-content);\n\tgap: var(--component-alert-banner-shared-content-gap);\n\tflex: var(--component-alert-banner-shared-content-flex);\n\theight: var(--component-alert-banner-shared-content-height);\n\talign-items: var(--component-alert-banner-shared-content-align-items);\n\tcolor: var(--component-alert-banner-shared-content-color);\n\tfont: var(--component-alert-banner-shared-content-typography-font);\n\tletter-spacing: var(--component-alert-banner-shared-content-typography-letter-spacing);\n\tfont-variation-settings: 'wdth'\n\t\tvar(--component-alert-banner-shared-content-typography-font-width);\n}\n\n.stand-alert-banner-content > .material-symbols {\n\tfont-size: 1rem;\n\tcolor: var(--component-alert-banner-shared-content-icon-color);\n}\n\n.stand-alert-banner-information {\n\tbackground-color: var(--component-alert-banner-information-background-color);\n}\n\n.stand-alert-banner-success {\n\tbackground-color: var(--component-alert-banner-success-background-color);\n}\n\n.stand-alert-banner-warning {\n\tbackground-color: var(--component-alert-banner-warning-background-color);\n}\n\n.stand-alert-banner-error {\n\tbackground-color: var(--component-alert-banner-error-background-color);\n}\n\n/* see IconButton for example of styling close button */\n.stand-alert-banner-close {\n\tborder: 0;\n\tbackground: transparent;\n\tcursor: pointer;\n\tpadding: 0.125rem;\n}\n";
|
|
4
|
+
export declare const componentHtml = "<div class=\"container flow-column\">\n\t<div class=\"stand-alert-banner stand-alert-banner-information\">\n\t\t<div class=\"stand-alert-banner-content\">\n\t\t\tYou are working in the CODE Environment\n\t\t</div>\n\t</div>\n\n\t<div class=\"stand-alert-banner stand-alert-banner-success\">\n\t\t<div class=\"stand-alert-banner-content\">\n\t\t\t<span class=\"material-symbols\">sentiment_satisfied</span>\n\t\t\tYour changes have been published.\n\t\t</div>\n\t</div>\n\n\t<div class=\"stand-alert-banner stand-alert-banner-error\">\n\t\t<div class=\"stand-alert-banner-content\">\n\t\t\t<span class=\"material-symbols\">warning</span>\n\t\t\tUnable to save changes.\n\t\t</div>\n\t\t<button class=\"stand-alert-banner-close\" aria-label=\"Close alert banner\">x</button>\n\t</div>\n</div>\n";
|
|
5
|
+
export declare const componentJs = "\nimport { componentAlertBanner } from \"@guardian/stand\";\n\nconst sheet = new CSSStyleSheet();\n\nsheet.replaceSync(`\n\t.js-stand-alert-banner {\n\t\tdisplay: ${componentAlertBanner.shared.display};\n\t\talign-items: ${componentAlertBanner.shared['align-items']};\n\t\tjustify-content: ${componentAlertBanner.shared['justify-content']};\n\t\tpadding: ${componentAlertBanner.shared.padding.top}\n\t\t\t${componentAlertBanner.shared.padding.right}\n\t\t\t${componentAlertBanner.shared.padding.bottom}\n\t\t\t${componentAlertBanner.shared.padding.left};\n\t\twidth: ${componentAlertBanner.shared.width};\n\t\theight: ${componentAlertBanner.shared.height};\n\t}\n\n\t.js-stand-alert-banner-content {\n\t\tdisplay: ${componentAlertBanner.shared.content.display};\n\t\tjustify-content: ${componentAlertBanner.shared.content['justify-content']};\n\t\tgap: ${componentAlertBanner.shared.content.gap};\n\t\tflex: ${componentAlertBanner.shared.content.flex};\n\t\theight: ${componentAlertBanner.shared.content.height};\n\t\talign-items: ${componentAlertBanner.shared.content['align-items']};\n\t\tcolor: ${componentAlertBanner.shared.content.color};\n\t\tfont: ${componentAlertBanner.shared.content.typography.font};\n\t\tletter-spacing: ${componentAlertBanner.shared.content.typography.letterSpacing};\n\t\tfont-variation-settings: 'wdth' ${componentAlertBanner.shared.content.typography.fontWidth};\n\t}\n\n\t.js-stand-alert-banner-content > .material-symbols {\n\t\tfont-size: 1rem;\n\t\tcolor: ${componentAlertBanner.shared.content.icon.color};\n\t}\n\n\t.js-stand-alert-banner-information {\n\t\tbackground-color: ${componentAlertBanner.information['background-color']};\n\t}\n\n\t.js-stand-alert-banner-success {\n\t\tbackground-color: ${componentAlertBanner.success['background-color']};\n\t}\n\n\t.js-stand-alert-banner-error {\n\t\tbackground-color: ${componentAlertBanner.error['background-color']};\n\t}\n\n\t/* see IconButton for example of styling close button */\n\t.js-stand-alert-banner-close {\n\t\tborder: 0;\n\t\tbackground: transparent;\n\t\tcursor: pointer;\n\t\tpadding: 0.125rem;\n\t}\n`);\n\ndocument.adoptedStyleSheets.push(sheet);\n\ndocument.getElementById(\"app\").innerHTML = `\n\t<div class=\"container flow-column\">\n\t\t<div class=\"js-stand-alert-banner js-stand-alert-banner-information\">\n\t\t\t<div class=\"js-stand-alert-banner-content\">\n\t\t\t\tYou are working in the CODE Environment\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"js-stand-alert-banner js-stand-alert-banner-success\">\n\t\t\t<div class=\"js-stand-alert-banner-content\">\n\t\t\t\t<span class=\"material-symbols\">sentiment_satisfied</span>\n\t\t\t\tYour changes have been published.\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"js-stand-alert-banner js-stand-alert-banner-error\">\n\t\t\t<div class=\"js-stand-alert-banner-content\">\n\t\t\t\t<span class=\"material-symbols\">warning</span>\n\t\t\t\tUnable to save changes.\n\t\t\t</div>\n\t\t\t<button class=\"js-stand-alert-banner-close\" aria-label=\"Close alert banner\">x</button>\n\t\t</div>\n\t</div>\n`;\n";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SerializedStyles } from '@emotion/react';
|
|
2
|
+
import type { ComponentAlertBanner } from '../../styleD/build/typescript/component/alertBanner';
|
|
3
|
+
import type { DeepPartial, Prettify } from '../../util/types';
|
|
4
|
+
import type { AlertBannerProps } from './types';
|
|
5
|
+
export type AlertBannerTheme = Prettify<ComponentAlertBanner>;
|
|
6
|
+
export type PartialAlertBannerTheme = Prettify<DeepPartial<AlertBannerTheme>>;
|
|
7
|
+
export declare const defaultAlertBannerTheme: AlertBannerTheme;
|
|
8
|
+
export declare const alertBannerStyles: (theme: AlertBannerTheme, { level }: Required<Pick<AlertBannerProps, 'level'>>) => SerializedStyles;
|
|
9
|
+
export declare const alertBannerContentStyles: (theme: AlertBannerTheme) => SerializedStyles;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { IconProps } from '../../icon';
|
|
2
|
+
import type { IconButtonProps } from '../../icon-button';
|
|
3
|
+
import type { DefaultPropsWithChildren, Prettify } from '../../util/types';
|
|
4
|
+
import type { AlertBannerTheme } from './styles';
|
|
5
|
+
export interface AlertBannerProps extends DefaultPropsWithChildren<AlertBannerTheme> {
|
|
6
|
+
/**
|
|
7
|
+
* The severity level of the AlertBanner, which determines its styling.
|
|
8
|
+
* This is a required prop.
|
|
9
|
+
* Levels: 'error', 'success', 'information', 'warning
|
|
10
|
+
*/
|
|
11
|
+
level: keyof Omit<AlertBannerTheme, 'shared'>;
|
|
12
|
+
/**
|
|
13
|
+
* Indicates whether the AlertBanner has an icon.
|
|
14
|
+
* Icon is based on the level of the AlertBanner
|
|
15
|
+
*/
|
|
16
|
+
showIcon?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Override the default icon for the message by providing a custom icon, for example when not using material symbols.
|
|
19
|
+
* This can be either a string (for material symbols) or an SVG element.
|
|
20
|
+
* Passed to the Icon component, so can be either a string (for material symbols) or an SVG element.
|
|
21
|
+
*/
|
|
22
|
+
icon?: IconProps['symbol'] | Exclude<IconProps['children'], string>;
|
|
23
|
+
/**
|
|
24
|
+
* Optional props for the close button. If provided, a close button will be rendered in the AlertBanner, and these props will be passed to the IconButton component.
|
|
25
|
+
*/
|
|
26
|
+
closeButtonProps?: Prettify<Partial<IconButtonProps>>;
|
|
27
|
+
}
|
|
@@ -3,7 +3,7 @@ import type { ComponentAvatar } from '../../styleD/build/typescript/component/av
|
|
|
3
3
|
import type { DeepPartial, Prettify } from '../../util/types';
|
|
4
4
|
import type { AvatarProps } from './types';
|
|
5
5
|
export type AvatarTheme = Prettify<ComponentAvatar>;
|
|
6
|
-
export type PartialAvatarTheme = DeepPartial<AvatarTheme
|
|
6
|
+
export type PartialAvatarTheme = Prettify<DeepPartial<AvatarTheme>>;
|
|
7
7
|
export declare const defaultAvatarTheme: AvatarTheme;
|
|
8
8
|
export declare const avatarImageStyles: SerializedStyles;
|
|
9
9
|
export declare const avatarStyles: (theme: AvatarTheme, { size, color }: Required<Pick<AvatarProps, 'size' | 'color'>>) => SerializedStyles;
|
|
@@ -3,6 +3,6 @@ import type { ComponentButton } from '../../styleD/build/typescript/component/bu
|
|
|
3
3
|
import type { DeepPartial, Prettify } from '../../util/types';
|
|
4
4
|
import type { ButtonProps } from './types';
|
|
5
5
|
export type ButtonTheme = Prettify<ComponentButton>;
|
|
6
|
-
export type PartialButtonTheme = DeepPartial<ButtonTheme
|
|
6
|
+
export type PartialButtonTheme = Prettify<DeepPartial<ButtonTheme>>;
|
|
7
7
|
export declare const defaultButtonTheme: ButtonTheme;
|
|
8
8
|
export declare const buttonStyles: (theme: ButtonTheme, { size, variant }: Required<Pick<ButtonProps, 'size' | 'variant'>>, hasIcon?: boolean, isIconButton?: boolean) => SerializedStyles;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ComponentByline } from '../../styleD/build/typescript/component/byline';
|
|
2
|
-
import type { DeepPartial } from '../../util/types';
|
|
3
|
-
export type PartialBylineTheme = DeepPartial<ComponentByline
|
|
2
|
+
import type { DeepPartial, Prettify } from '../../util/types';
|
|
3
|
+
export type PartialBylineTheme = Prettify<DeepPartial<ComponentByline>>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { SerializedStyles } from '@emotion/react';
|
|
2
2
|
import type { ComponentCheckbox } from '../../styleD/build/typescript/component/checkbox';
|
|
3
|
-
import type { Prettify } from '../../util/types';
|
|
3
|
+
import type { DeepPartial, Prettify } from '../../util/types';
|
|
4
4
|
import type { CheckboxGroupProps, CheckboxProps } from './types';
|
|
5
5
|
export type CheckboxTheme = Prettify<ComponentCheckbox>;
|
|
6
|
-
export type PartialCheckboxTheme = Prettify<
|
|
6
|
+
export type PartialCheckboxTheme = Prettify<DeepPartial<CheckboxTheme>>;
|
|
7
7
|
export declare const defaultCheckboxTheme: CheckboxTheme;
|
|
8
8
|
export declare const checkboxStyles: (theme: CheckboxTheme, { size, isIndeterminate, }: Required<Pick<CheckboxProps, 'size' | 'isIndeterminate'>>) => SerializedStyles;
|
|
9
9
|
export declare const checkboxLabelStyles: (theme: CheckboxTheme) => SerializedStyles;
|
|
@@ -2,7 +2,7 @@ import type { SerializedStyles } from '@emotion/react';
|
|
|
2
2
|
import { type ComponentFavicon } from '../../styleD/build/typescript/component/favicon';
|
|
3
3
|
import type { DeepPartial, Prettify } from '../../util/types';
|
|
4
4
|
export type FaviconTheme = Prettify<ComponentFavicon>;
|
|
5
|
-
export type PartialFaviconTheme = DeepPartial<FaviconTheme
|
|
5
|
+
export type PartialFaviconTheme = Prettify<DeepPartial<FaviconTheme>>;
|
|
6
6
|
export declare const defaultFaviconTheme: FaviconTheme;
|
|
7
7
|
export declare const faviconStyles: (theme: FaviconTheme) => SerializedStyles;
|
|
8
8
|
export declare const faviconTypographyStyles: (theme: FaviconTheme) => SerializedStyles;
|
|
@@ -2,7 +2,7 @@ import type { ComponentIcon } from '../../styleD/build/typescript/component/icon
|
|
|
2
2
|
import type { DeepPartial, Prettify } from '../../util/types';
|
|
3
3
|
import type { IconProps } from './types';
|
|
4
4
|
export type IconTheme = Prettify<ComponentIcon>;
|
|
5
|
-
export type PartialIconTheme = DeepPartial<IconTheme
|
|
5
|
+
export type PartialIconTheme = Prettify<DeepPartial<IconTheme>>;
|
|
6
6
|
export declare const defaultIconTheme: IconTheme;
|
|
7
7
|
export declare const iconStyles: (theme: IconTheme, { size, fill, mode, }: Required<Pick<IconProps, "size">> & Pick<IconProps, "fill"> & {
|
|
8
8
|
mode: 'text' | 'svg';
|
|
@@ -3,15 +3,15 @@ import type { ComponentMenu } from '../../styleD/build/typescript/component/menu
|
|
|
3
3
|
import type { DeepPartial, Prettify } from '../../util/types';
|
|
4
4
|
import type { MenuItemProps, MenuPopoverProps, MenuSectionProps } from './types';
|
|
5
5
|
export type MenuTheme = Prettify<ComponentMenu['menu']>;
|
|
6
|
-
export type PartialMenuTheme = DeepPartial<MenuTheme
|
|
6
|
+
export type PartialMenuTheme = Prettify<DeepPartial<MenuTheme>>;
|
|
7
7
|
export declare const defaultMenuTheme: MenuTheme;
|
|
8
8
|
export declare const menuStyles: (theme: MenuTheme) => SerializedStyles;
|
|
9
9
|
export type MenuSectionTheme = Prettify<ComponentMenu['menuSection']>;
|
|
10
|
-
export type PartialMenuSectionTheme = DeepPartial<MenuSectionTheme
|
|
10
|
+
export type PartialMenuSectionTheme = Prettify<DeepPartial<MenuSectionTheme>>;
|
|
11
11
|
export declare const defaultMenuSectionTheme: MenuSectionTheme;
|
|
12
12
|
export declare const menuSectionHeaderStyles: (theme: MenuSectionTheme, { size }: Required<Pick<MenuSectionProps, 'size'>>) => SerializedStyles;
|
|
13
13
|
export type MenuItemTheme = Prettify<ComponentMenu['menuItem']>;
|
|
14
|
-
export type PartialMenuItemTheme = DeepPartial<MenuItemTheme
|
|
14
|
+
export type PartialMenuItemTheme = Prettify<DeepPartial<MenuItemTheme>>;
|
|
15
15
|
export declare const defaultMenuItemTheme: MenuItemTheme;
|
|
16
16
|
export declare const menuItemStyles: (theme: MenuItemTheme, { description }: Pick<MenuItemProps, 'description'>) => SerializedStyles;
|
|
17
17
|
export declare const menuItemIconStyles: (theme: MenuItemTheme, { size }: Required<Pick<MenuItemProps, 'size'>>) => SerializedStyles;
|
|
@@ -19,10 +19,10 @@ export declare const menuItemLabelStyles: (theme: MenuItemTheme) => SerializedSt
|
|
|
19
19
|
export declare const menuItemDescriptionStyles: (theme: MenuItemTheme) => SerializedStyles;
|
|
20
20
|
export declare const menuItemAsideStyles: (theme: MenuItemTheme) => SerializedStyles;
|
|
21
21
|
export type MenuSeparatorTheme = Prettify<ComponentMenu['menuSeparator']>;
|
|
22
|
-
export type PartialMenuSeparatorTheme = DeepPartial<MenuSeparatorTheme
|
|
22
|
+
export type PartialMenuSeparatorTheme = Prettify<DeepPartial<MenuSeparatorTheme>>;
|
|
23
23
|
export declare const defaultMenuSeparatorTheme: MenuSeparatorTheme;
|
|
24
24
|
export declare const menuSeparatorStyles: (theme: MenuSeparatorTheme) => SerializedStyles;
|
|
25
25
|
export type MenuPopoverTheme = Prettify<ComponentMenu['menuPopover']>;
|
|
26
|
-
export type PartialMenuPopoverTheme = DeepPartial<MenuPopoverTheme
|
|
26
|
+
export type PartialMenuPopoverTheme = Prettify<DeepPartial<MenuPopoverTheme>>;
|
|
27
27
|
export declare const defaultMenuPopoverTheme: MenuPopoverTheme;
|
|
28
28
|
export declare const menuPopoverStyles: (theme: MenuPopoverTheme, { size }: Required<Pick<MenuPopoverProps, 'size'>>) => SerializedStyles;
|
|
@@ -2,7 +2,7 @@ import type { SerializedStyles } from '@emotion/react';
|
|
|
2
2
|
import type { ComponentSelect } from '../../styleD/build/typescript/component/select';
|
|
3
3
|
import type { DeepPartial, Prettify } from '../../util/types';
|
|
4
4
|
export type SelectTheme = Prettify<ComponentSelect>;
|
|
5
|
-
export type PartialSelectTheme = DeepPartial<SelectTheme
|
|
5
|
+
export type PartialSelectTheme = Prettify<DeepPartial<SelectTheme>>;
|
|
6
6
|
export declare const defaultSelectTheme: SelectTheme;
|
|
7
7
|
export declare const popoverStyles: (theme: SelectTheme) => SerializedStyles;
|
|
8
8
|
export declare const listBoxItemStyles: (theme: SelectTheme) => SerializedStyles;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import type { TopBarTheme } from './styles';
|
|
1
2
|
import type { TopBarProps } from './types';
|
|
2
|
-
export declare function TopBarContainerRight({ children, }: {
|
|
3
|
+
export declare function TopBarContainerRight({ children, theme, }: {
|
|
3
4
|
children: TopBarProps['children'];
|
|
5
|
+
theme?: TopBarTheme;
|
|
4
6
|
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
5
|
-
export declare function TopBarContainerLeft({ children, }: {
|
|
7
|
+
export declare function TopBarContainerLeft({ children, theme, }: {
|
|
6
8
|
children: TopBarProps['children'];
|
|
9
|
+
theme?: TopBarTheme;
|
|
7
10
|
}): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
11
|
export declare function TopBar({ children, theme, cssOverrides, className, ...props }: TopBarProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import type { SerializedStyles } from '@emotion/react';
|
|
|
2
2
|
import type { ComponentTopBar } from '../../styleD/build/typescript/component/TopBar';
|
|
3
3
|
import type { DeepPartial, Prettify } from '../../util/types';
|
|
4
4
|
export type TopBarTheme = Prettify<ComponentTopBar>;
|
|
5
|
-
export type PartialTopBarTheme = DeepPartial<TopBarTheme
|
|
5
|
+
export type PartialTopBarTheme = Prettify<DeepPartial<TopBarTheme>>;
|
|
6
6
|
export declare const defaultTopBarTheme: TopBarTheme;
|
|
7
7
|
export declare const topBarStyles: (theme: TopBarTheme) => SerializedStyles;
|
|
8
8
|
export declare const topBarContainerLeftStyles: (theme: TopBarTheme) => SerializedStyles;
|
|
@@ -3,6 +3,6 @@ import type { ComponentTopBar } from '../../../styleD/build/typescript/component
|
|
|
3
3
|
import type { DeepPartial, Prettify } from '../../../util/types';
|
|
4
4
|
import type { TopBarItemProps } from './types';
|
|
5
5
|
export type TopBarItemTheme = Prettify<ComponentTopBar['Item']>;
|
|
6
|
-
export type PartialTopBarItemTheme = DeepPartial<TopBarItemTheme
|
|
6
|
+
export type PartialTopBarItemTheme = Prettify<DeepPartial<TopBarItemTheme>>;
|
|
7
7
|
export declare const defaultTopBarItemTheme: TopBarItemTheme;
|
|
8
8
|
export declare const topBarItemStyles: (theme: TopBarItemTheme, alignment: 'left' | 'right', { size }: Required<Pick<TopBarItemProps, 'size'>>) => SerializedStyles;
|
|
@@ -3,7 +3,7 @@ import type { ComponentTopBar } from '../../../styleD/build/typescript/component
|
|
|
3
3
|
import type { DeepPartial, Prettify } from '../../../util/types';
|
|
4
4
|
import type { TopBarNavigationProps } from './types';
|
|
5
5
|
export type TopBarNavigationTheme = Prettify<ComponentTopBar['Navigation']>;
|
|
6
|
-
export type PartialTopBarNavigationTheme = DeepPartial<TopBarNavigationTheme
|
|
6
|
+
export type PartialTopBarNavigationTheme = Prettify<DeepPartial<TopBarNavigationTheme>>;
|
|
7
7
|
export declare const defaultTopBarNavigationTheme: TopBarNavigationTheme;
|
|
8
8
|
export declare const topBarNavigationStyles: (theme: TopBarNavigationTheme, selected: boolean) => SerializedStyles;
|
|
9
9
|
export declare const topBarNavigationDividerStyles: (theme: TopBarNavigationTheme, { alignment }: Required<Pick<TopBarNavigationProps, 'alignment'>>) => SerializedStyles;
|
|
@@ -2,7 +2,7 @@ import type { SerializedStyles } from '@emotion/react';
|
|
|
2
2
|
import { type ComponentTopBar } from '../../..//styleD/build/typescript/component/TopBar';
|
|
3
3
|
import type { DeepPartial, Prettify } from '../../../util/types';
|
|
4
4
|
export type TopBarToolNameTheme = Prettify<ComponentTopBar['ToolName']>;
|
|
5
|
-
export type PartialTopBarToolNameTheme = DeepPartial<TopBarToolNameTheme
|
|
5
|
+
export type PartialTopBarToolNameTheme = Prettify<DeepPartial<TopBarToolNameTheme>>;
|
|
6
6
|
export declare const defaultToolNameTheme: TopBarToolNameTheme;
|
|
7
7
|
export declare const toolNameHoverLinkStyles: (theme: TopBarToolNameTheme) => SerializedStyles;
|
|
8
8
|
export declare const toolNameLinkStyles: (theme: TopBarToolNameTheme) => SerializedStyles;
|
|
@@ -3,6 +3,6 @@ import { type ComponentTypography } from '../../styleD/build/typescript/componen
|
|
|
3
3
|
import type { DeepPartial, Prettify } from '../../util/types';
|
|
4
4
|
import type { TypographyProps } from './types';
|
|
5
5
|
export type TypographyTheme = Prettify<ComponentTypography>;
|
|
6
|
-
export type PartialTypographyTheme = DeepPartial<TypographyTheme
|
|
6
|
+
export type PartialTypographyTheme = Prettify<DeepPartial<TypographyTheme>>;
|
|
7
7
|
export declare const defaultTypographyTheme: TypographyTheme;
|
|
8
8
|
export declare const typographyStyles: (theme: TypographyTheme, { variant }: Required<Pick<TypographyProps, 'variant'>>) => SerializedStyles;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ComponentUserMenu } from '../../styleD/build/typescript/component/userMenu';
|
|
2
|
-
import type { DeepPartial } from '../../util/types';
|
|
3
|
-
export type PartialUserMenuTheme = DeepPartial<ComponentUserMenu
|
|
2
|
+
import type { DeepPartial, Prettify } from '../../util/types';
|
|
3
|
+
export type PartialUserMenuTheme = Prettify<DeepPartial<ComponentUserMenu>>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export { componentIcon } from './styleD/build/typescript/component/icon';
|
|
|
26
26
|
export type { ComponentIcon } from './styleD/build/typescript/component/icon';
|
|
27
27
|
export { componentFavicon } from './styleD/build/typescript/component/favicon';
|
|
28
28
|
export type { ComponentFavicon } from './styleD/build/typescript/component/favicon';
|
|
29
|
+
export { componentAlertBanner } from './styleD/build/typescript/component/alertBanner';
|
|
30
|
+
export type { ComponentAlertBanner } from './styleD/build/typescript/component/alertBanner';
|
|
29
31
|
export { componentRadioGroup } from './styleD/build/typescript/component/radioGroup';
|
|
30
32
|
export type { ComponentRadioGroup } from './styleD/build/typescript/component/radioGroup';
|
|
31
33
|
export { componentCheckbox } from './styleD/build/typescript/component/checkbox';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
export declare const componentAlertBanner: {
|
|
5
|
+
shared: {
|
|
6
|
+
display: string;
|
|
7
|
+
'align-items': string;
|
|
8
|
+
'justify-content': string;
|
|
9
|
+
padding: {
|
|
10
|
+
top: string;
|
|
11
|
+
right: string;
|
|
12
|
+
bottom: string;
|
|
13
|
+
left: string;
|
|
14
|
+
};
|
|
15
|
+
width: string;
|
|
16
|
+
height: string;
|
|
17
|
+
content: {
|
|
18
|
+
display: string;
|
|
19
|
+
'justify-content': string;
|
|
20
|
+
gap: string;
|
|
21
|
+
flex: string;
|
|
22
|
+
height: string;
|
|
23
|
+
'align-items': string;
|
|
24
|
+
color: string;
|
|
25
|
+
typography: {
|
|
26
|
+
font: string;
|
|
27
|
+
letterSpacing: string;
|
|
28
|
+
fontWidth: number;
|
|
29
|
+
};
|
|
30
|
+
icon: {
|
|
31
|
+
color: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
information: {
|
|
36
|
+
'background-color': string;
|
|
37
|
+
};
|
|
38
|
+
success: {
|
|
39
|
+
'background-color': string;
|
|
40
|
+
};
|
|
41
|
+
warning: {
|
|
42
|
+
'background-color': string;
|
|
43
|
+
};
|
|
44
|
+
error: {
|
|
45
|
+
'background-color': string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export type ComponentAlertBanner = typeof componentAlertBanner;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guardian/stand",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.26",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"//exports": "Each component has its own entry point for optimal tree-shaking. Main entry point only includes design tokens and utilities. New components/foundations should follow the same pattern.",
|
|
6
6
|
"exports": {
|
|
@@ -104,6 +104,11 @@
|
|
|
104
104
|
"import": "./dist/text-area.js",
|
|
105
105
|
"require": "./dist/text-area.cjs"
|
|
106
106
|
},
|
|
107
|
+
"./alert-banner": {
|
|
108
|
+
"types": "./dist/types/alert-banner.d.ts",
|
|
109
|
+
"import": "./dist/alert-banner.js",
|
|
110
|
+
"require": "./dist/alert-banner.cjs"
|
|
111
|
+
},
|
|
107
112
|
"./byline": {
|
|
108
113
|
"types": "./dist/types/byline.d.ts",
|
|
109
114
|
"import": "./dist/byline.js",
|
|
@@ -155,7 +160,8 @@
|
|
|
155
160
|
"./component/textInput.css": "./dist/styleD/build/css/component/textInput.css",
|
|
156
161
|
"./component/radioGroup.css": "./dist/styleD/build/css/component/radioGroup.css",
|
|
157
162
|
"./component/checkbox.css": "./dist/styleD/build/css/component/checkbox.css",
|
|
158
|
-
"./component/textArea.css": "./dist/styleD/build/css/component/textArea.css"
|
|
163
|
+
"./component/textArea.css": "./dist/styleD/build/css/component/textArea.css",
|
|
164
|
+
"./component/alertBanner.css": "./dist/styleD/build/css/component/alertBanner.css"
|
|
159
165
|
},
|
|
160
166
|
"//typesVersions": "Provides backward compatibility for TypeScript moduleResolution: node - maps subpath imports to correct type definition files. When adding new components with their own entry points, ensure to add them here.",
|
|
161
167
|
"typesVersions": {
|
|
@@ -228,6 +234,9 @@
|
|
|
228
234
|
],
|
|
229
235
|
"text-area": [
|
|
230
236
|
"./dist/types/text-area.d.ts"
|
|
237
|
+
],
|
|
238
|
+
"alert-banner": [
|
|
239
|
+
"./dist/types/alert-banner.d.ts"
|
|
231
240
|
]
|
|
232
241
|
}
|
|
233
242
|
},
|
|
@@ -304,7 +313,7 @@
|
|
|
304
313
|
"prosemirror-state": "1.4.3",
|
|
305
314
|
"prosemirror-view": "1.37.2",
|
|
306
315
|
"react": "^17.0.2 || ^18.0.0 || ^19.0.0",
|
|
307
|
-
"react-aria-components": ">= 1.13.0 <= 1.
|
|
316
|
+
"react-aria-components": ">= 1.13.0 <= 1.17.0",
|
|
308
317
|
"react-dom": "^17.0.2 || ^18.0.0 || ^19.0.0",
|
|
309
318
|
"typescript": ">=5.0.0 <=5.9.3"
|
|
310
319
|
},
|