@guardian/stand 0.0.16 → 0.0.18
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 +1 -0
- package/dist/TopBar.cjs +9 -3
- package/dist/TopBar.js +4 -1
- package/dist/avatarButton.cjs +7 -0
- package/dist/avatarButton.js +1 -0
- package/dist/avatarLink.cjs +7 -0
- package/dist/avatarLink.js +1 -0
- package/dist/components/avatar/styles.cjs +24 -0
- package/dist/components/avatar/styles.js +24 -0
- package/dist/components/avatar-button/AvatarButton.cjs +14 -0
- package/dist/components/avatar-button/AvatarButton.js +12 -0
- package/dist/components/avatar-button/styles.cjs +29 -0
- package/dist/components/avatar-button/styles.js +26 -0
- package/dist/components/avatar-link/AvatarLink.cjs +14 -0
- package/dist/components/avatar-link/AvatarLink.js +12 -0
- package/dist/components/avatar-link/styles.cjs +24 -0
- package/dist/components/avatar-link/styles.js +21 -0
- package/dist/components/button/Button.cjs +1 -1
- package/dist/components/button/Button.js +1 -1
- package/dist/components/icon-button/IconButton.cjs +1 -1
- package/dist/components/icon-button/IconButton.js +1 -1
- package/dist/components/icon-link-button/IconLinkButton.cjs +1 -1
- package/dist/components/icon-link-button/IconLinkButton.js +1 -1
- package/dist/components/inline-message/InlineMessage.cjs +56 -0
- package/dist/components/inline-message/InlineMessage.js +27 -0
- package/dist/components/inline-message/styles.cjs +17 -0
- package/dist/components/inline-message/styles.js +14 -0
- package/dist/components/link-button/LinkButton.cjs +1 -1
- package/dist/components/link-button/LinkButton.js +1 -1
- package/dist/components/menu/styles.cjs +1 -0
- package/dist/components/menu/styles.js +1 -0
- package/dist/components/topbar/TopBar.cjs +101 -0
- package/dist/components/topbar/TopBar.js +63 -0
- package/dist/components/topbar/styles.cjs +30 -0
- package/dist/components/topbar/styles.js +25 -0
- package/dist/components/topbar/topBarItem/TopBarItem.cjs +28 -0
- package/dist/components/topbar/topBarItem/TopBarItem.js +10 -0
- package/dist/components/topbar/topBarItem/styles.cjs +20 -0
- package/dist/components/topbar/topBarItem/styles.js +17 -0
- package/dist/components/topbar/topBarNavigation/TopBarNavigation.cjs +70 -0
- package/dist/components/topbar/topBarNavigation/TopBarNavigation.js +23 -0
- package/dist/components/topbar/topBarNavigation/styles.cjs +68 -0
- package/dist/components/topbar/topBarNavigation/styles.js +61 -0
- package/dist/components/topbar/{toolName → topBarToolName}/TopBarToolName.cjs +3 -2
- package/dist/components/topbar/topBarToolName/TopBarToolName.js +13 -0
- package/dist/index.cjs +2 -0
- package/dist/index.js +1 -0
- package/dist/inline-message.cjs +9 -0
- package/dist/inline-message.js +2 -0
- package/dist/styleD/build/css/base/typography.css +3 -3
- package/dist/styleD/build/css/component/TopBar.css +55 -1
- package/dist/styleD/build/css/component/avatar.css +32 -1
- package/dist/styleD/build/css/component/button.css +177 -255
- package/dist/styleD/build/css/component/favicon.css +1 -1
- package/dist/styleD/build/css/component/inlineMessage.css +17 -0
- package/dist/styleD/build/css/component/menu.css +5 -4
- package/dist/styleD/build/css/component/tagAutocomplete.css +1 -1
- package/dist/styleD/build/css/component/tagTable.css +1 -1
- package/dist/styleD/build/css/component/topBarItem.css +7 -0
- package/dist/styleD/build/css/component/userMenu.css +6 -6
- package/dist/styleD/build/css/semantic/colors.css +45 -46
- package/dist/styleD/build/css/semantic/sizing.css +1 -0
- package/dist/styleD/build/css/semantic/typography.css +68 -30
- package/dist/styleD/build/typescript/base/typography.cjs +3 -3
- package/dist/styleD/build/typescript/base/typography.js +3 -3
- package/dist/styleD/build/typescript/component/TopBar.cjs +94 -0
- package/dist/styleD/build/typescript/component/TopBar.js +94 -0
- package/dist/styleD/build/typescript/component/avatar.cjs +95 -12
- package/dist/styleD/build/typescript/component/avatar.js +95 -12
- package/dist/styleD/build/typescript/component/button.cjs +5 -130
- package/dist/styleD/build/typescript/component/button.js +5 -130
- package/dist/styleD/build/typescript/component/inlineMessage.cjs +28 -0
- package/dist/styleD/build/typescript/component/inlineMessage.js +26 -0
- package/dist/styleD/build/typescript/component/menu.cjs +2 -1
- package/dist/styleD/build/typescript/component/menu.js +2 -1
- package/dist/styleD/build/typescript/semantic/colors.cjs +47 -52
- package/dist/styleD/build/typescript/semantic/colors.js +47 -52
- package/dist/styleD/build/typescript/semantic/sizing.cjs +1 -0
- package/dist/styleD/build/typescript/semantic/sizing.js +1 -0
- package/dist/styleD/build/typescript/semantic/typography.cjs +50 -0
- package/dist/styleD/build/typescript/semantic/typography.js +50 -0
- package/dist/types/TopBar.d.ts +12 -3
- package/dist/types/avatar-button.d.ts +18 -0
- package/dist/types/avatar-link.d.ts +18 -0
- package/dist/types/components/avatar-button/AvatarButton.d.ts +2 -0
- package/dist/types/components/avatar-button/sandbox.d.ts +5 -0
- package/dist/types/components/avatar-button/styles.d.ts +6 -0
- package/dist/types/components/avatar-button/types.d.ts +3 -0
- package/dist/types/components/avatar-link/AvatarLink.d.ts +2 -0
- package/dist/types/components/avatar-link/sandbox.d.ts +5 -0
- package/dist/types/components/avatar-link/styles.d.ts +6 -0
- package/dist/types/components/avatar-link/types.d.ts +3 -0
- package/dist/types/components/button/sandbox.d.ts +4 -4
- package/dist/types/components/button/types.d.ts +1 -1
- package/dist/types/components/icon-button/sandbox.d.ts +4 -4
- package/dist/types/components/icon-button/styles.d.ts +3 -128
- package/dist/types/components/icon-button/types.d.ts +1 -1
- package/dist/types/components/icon-link-button/sandbox.d.ts +4 -4
- package/dist/types/components/icon-link-button/styles.d.ts +3 -128
- package/dist/types/components/icon-link-button/types.d.ts +1 -1
- package/dist/types/components/inline-message/InlineMessage.d.ts +2 -0
- package/dist/types/components/inline-message/sandbox.d.ts +5 -0
- package/dist/types/components/inline-message/styles.d.ts +8 -0
- package/dist/types/components/inline-message/types.d.ts +21 -0
- package/dist/types/components/link-button/sandbox.d.ts +4 -4
- package/dist/types/components/link-button/styles.d.ts +3 -128
- package/dist/types/components/link-button/types.d.ts +1 -1
- package/dist/types/components/topbar/TopBar.d.ts +8 -0
- package/dist/types/components/topbar/sandbox.d.ts +5 -0
- package/dist/types/components/topbar/styles.d.ts +9 -0
- package/dist/types/components/topbar/topBarItem/TopBarItem.d.ts +2 -0
- package/dist/types/components/topbar/topBarItem/sandbox.d.ts +5 -0
- package/dist/types/components/topbar/topBarItem/styles.d.ts +8 -0
- package/dist/types/components/topbar/topBarItem/types.d.ts +14 -0
- package/dist/types/components/topbar/topBarNavigation/TopBarNavigation.d.ts +2 -0
- package/dist/types/components/topbar/topBarNavigation/sandbox.d.ts +5 -0
- package/dist/types/components/topbar/topBarNavigation/styles.d.ts +12 -0
- package/dist/types/components/topbar/topBarNavigation/types.d.ts +44 -0
- package/dist/types/components/topbar/types.d.ts +3 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/inline-message.d.ts +19 -0
- package/dist/types/styleD/build/typescript/base/typography.d.ts +3 -3
- package/dist/types/styleD/build/typescript/component/TopBar.d.ts +94 -0
- package/dist/types/styleD/build/typescript/component/avatar.d.ts +83 -0
- package/dist/types/styleD/build/typescript/component/button.d.ts +3 -128
- package/dist/types/styleD/build/typescript/component/inlineMessage.d.ts +28 -0
- package/dist/types/styleD/build/typescript/component/menu.d.ts +1 -0
- package/dist/types/styleD/build/typescript/semantic/colors.d.ts +44 -49
- package/dist/types/styleD/build/typescript/semantic/sizing.d.ts +1 -0
- package/dist/types/styleD/build/typescript/semantic/typography.d.ts +50 -0
- package/dist/util/css/reset.css +10 -0
- package/dist/util/reset.css.cjs +1 -1
- package/dist/util/reset.css.js +1 -1
- package/package.json +35 -18
- package/dist/components/topbar/toolName/TopBarToolName.js +0 -12
- /package/dist/components/topbar/{toolName → topBarToolName}/styles.cjs +0 -0
- /package/dist/components/topbar/{toolName → topBarToolName}/styles.js +0 -0
- /package/dist/types/components/topbar/{toolName → topBarToolName}/TopBarToolName.d.ts +0 -0
- /package/dist/types/components/topbar/{toolName → topBarToolName}/sandbox.d.ts +0 -0
- /package/dist/types/components/topbar/{toolName → topBarToolName}/styles.d.ts +0 -0
- /package/dist/types/components/topbar/{toolName → topBarToolName}/types.d.ts +0 -0
package/README.md
CHANGED
|
@@ -181,3 +181,4 @@ Matrix generation in CI uses the same JSON file in the workflow `../.github/work
|
|
|
181
181
|
- [Style Dictionary](https://guardian.github.io/stand/?path=/docs/style-dictionary--docs)
|
|
182
182
|
- [Architecture Decision Records](https://guardian.github.io/stand/?path=/docs/architecture-decision-records--docs)
|
|
183
183
|
- [Changelog](https://guardian.github.io/stand/?path=/docs/changelog--docs)
|
|
184
|
+
- [Vision](https://guardian.github.io/stand/?path=/docs/vision--docs)
|
package/dist/TopBar.cjs
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var TopBar$1 = require('./styleD/build/typescript/component/TopBar.cjs');
|
|
4
|
+
var TopBarToolName = require('./components/topbar/topBarToolName/TopBarToolName.cjs');
|
|
5
|
+
var TopBarNavigation = require('./components/topbar/topBarNavigation/TopBarNavigation.cjs');
|
|
6
|
+
var TopBarItem = require('./components/topbar/topBarItem/TopBarItem.cjs');
|
|
7
|
+
var TopBar = require('./components/topbar/TopBar.cjs');
|
|
5
8
|
|
|
6
9
|
|
|
7
10
|
|
|
11
|
+
exports.componentTopBar = TopBar$1.componentTopBar;
|
|
8
12
|
exports.TopBarToolName = TopBarToolName.TopBarToolName;
|
|
9
|
-
exports.
|
|
13
|
+
exports.TopBarNavigation = TopBarNavigation.TopBarNavigation;
|
|
14
|
+
exports.TopBarItem = TopBarItem.TopBarItem;
|
|
15
|
+
exports.TopBar = TopBar.TopBar;
|
package/dist/TopBar.js
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
export { TopBarToolName } from './components/topbar/toolName/TopBarToolName.js';
|
|
2
1
|
export { componentTopBar } from './styleD/build/typescript/component/TopBar.js';
|
|
2
|
+
export { TopBarToolName } from './components/topbar/topBarToolName/TopBarToolName.js';
|
|
3
|
+
export { TopBarNavigation } from './components/topbar/topBarNavigation/TopBarNavigation.js';
|
|
4
|
+
export { TopBarItem } from './components/topbar/topBarItem/TopBarItem.js';
|
|
5
|
+
export { TopBar } from './components/topbar/TopBar.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AvatarButton } from './components/avatar-button/AvatarButton.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AvatarLink } from './components/avatar-link/AvatarLink.js';
|
|
@@ -25,6 +25,30 @@ const avatarStyles = (theme, { size, color }) => {
|
|
|
25
25
|
user-select: ${theme.shared["user-select"]};
|
|
26
26
|
color: ${theme.shared.color[color].text};
|
|
27
27
|
${typography.convertTypographyToEmotionStringStyle(theme[size].typography)}
|
|
28
|
+
|
|
29
|
+
&[data-avatar-context='interactive']:hover {
|
|
30
|
+
background-color: ${theme.shared.color[color][":hover"].background};
|
|
31
|
+
|
|
32
|
+
:has(> img) {
|
|
33
|
+
background-color: black;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
img {
|
|
37
|
+
mask-image: linear-gradient(rgb(0 0 0 / 70%), rgb(0 0 0 / 70%));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&[data-avatar-context='interactive']:active {
|
|
42
|
+
background-color: ${theme.shared.color[color][":active"].background};
|
|
43
|
+
|
|
44
|
+
:has(> img) {
|
|
45
|
+
background-color: black;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
img {
|
|
49
|
+
mask-image: linear-gradient(rgb(0 0 0 / 60%), rgb(0 0 0 / 60%));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
28
52
|
`;
|
|
29
53
|
};
|
|
30
54
|
|
|
@@ -23,6 +23,30 @@ const avatarStyles = (theme, { size, color }) => {
|
|
|
23
23
|
user-select: ${theme.shared["user-select"]};
|
|
24
24
|
color: ${theme.shared.color[color].text};
|
|
25
25
|
${convertTypographyToEmotionStringStyle(theme[size].typography)}
|
|
26
|
+
|
|
27
|
+
&[data-avatar-context='interactive']:hover {
|
|
28
|
+
background-color: ${theme.shared.color[color][":hover"].background};
|
|
29
|
+
|
|
30
|
+
:has(> img) {
|
|
31
|
+
background-color: black;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
img {
|
|
35
|
+
mask-image: linear-gradient(rgb(0 0 0 / 70%), rgb(0 0 0 / 70%));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&[data-avatar-context='interactive']:active {
|
|
40
|
+
background-color: ${theme.shared.color[color][":active"].background};
|
|
41
|
+
|
|
42
|
+
:has(> img) {
|
|
43
|
+
background-color: black;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
img {
|
|
47
|
+
mask-image: linear-gradient(rgb(0 0 0 / 60%), rgb(0 0 0 / 60%));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
26
50
|
`;
|
|
27
51
|
};
|
|
28
52
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
4
|
+
var reactAriaComponents = require('react-aria-components');
|
|
5
|
+
var mergeDeep = require('../../util/mergeDeep.cjs');
|
|
6
|
+
var Avatar = require('../avatar/Avatar.cjs');
|
|
7
|
+
var styles = require('./styles.cjs');
|
|
8
|
+
|
|
9
|
+
function AvatarButton(props) {
|
|
10
|
+
const mergedTheme = mergeDeep.mergeDeep(styles.defaultAvatarButtonTheme, props.theme ?? {});
|
|
11
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Button, { css: styles.avatarButtonStyles(mergedTheme), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(Avatar.Avatar, { ...props, "data-avatar-context": "interactive" }) });
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
exports.AvatarButton = AvatarButton;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { Button } from 'react-aria-components';
|
|
3
|
+
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
4
|
+
import { Avatar } from '../avatar/Avatar.js';
|
|
5
|
+
import { defaultAvatarButtonTheme, avatarButtonStyles } from './styles.js';
|
|
6
|
+
|
|
7
|
+
function AvatarButton(props) {
|
|
8
|
+
const mergedTheme = mergeDeep(defaultAvatarButtonTheme, props.theme ?? {});
|
|
9
|
+
return jsx(Button, { css: avatarButtonStyles(mergedTheme), ...props, children: jsx(Avatar, { ...props, "data-avatar-context": "interactive" }) });
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { AvatarButton };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('@emotion/react');
|
|
4
|
+
var styles = require('../avatar/styles.cjs');
|
|
5
|
+
|
|
6
|
+
const defaultAvatarButtonTheme = styles.defaultAvatarTheme;
|
|
7
|
+
const avatarButtonStyles = (theme) => {
|
|
8
|
+
return react.css`
|
|
9
|
+
display: ${theme.shared.display};
|
|
10
|
+
width: ${theme.shared.link.width};
|
|
11
|
+
background: ${theme.shared.button.background};
|
|
12
|
+
border: ${theme.shared.button.border};
|
|
13
|
+
padding: ${theme.shared.button.padding};
|
|
14
|
+
cursor: ${theme.shared.button.cursor};
|
|
15
|
+
&[data-focus-visible],
|
|
16
|
+
&:focus-visible {
|
|
17
|
+
outline: ${theme.shared.link[":focus-visible"].outline};
|
|
18
|
+
outline-offset: ${theme.shared.link[":focus-visible"]["outline-offset"]};
|
|
19
|
+
border-radius: ${theme.shared["border-radius"]};
|
|
20
|
+
}
|
|
21
|
+
&[data-disabled],
|
|
22
|
+
&:disabled {
|
|
23
|
+
cursor: ${theme.shared.button[":disabled"].cursor};
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
exports.avatarButtonStyles = avatarButtonStyles;
|
|
29
|
+
exports.defaultAvatarButtonTheme = defaultAvatarButtonTheme;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
|
+
import { defaultAvatarTheme } from '../avatar/styles.js';
|
|
3
|
+
|
|
4
|
+
const defaultAvatarButtonTheme = defaultAvatarTheme;
|
|
5
|
+
const avatarButtonStyles = (theme) => {
|
|
6
|
+
return css`
|
|
7
|
+
display: ${theme.shared.display};
|
|
8
|
+
width: ${theme.shared.link.width};
|
|
9
|
+
background: ${theme.shared.button.background};
|
|
10
|
+
border: ${theme.shared.button.border};
|
|
11
|
+
padding: ${theme.shared.button.padding};
|
|
12
|
+
cursor: ${theme.shared.button.cursor};
|
|
13
|
+
&[data-focus-visible],
|
|
14
|
+
&:focus-visible {
|
|
15
|
+
outline: ${theme.shared.link[":focus-visible"].outline};
|
|
16
|
+
outline-offset: ${theme.shared.link[":focus-visible"]["outline-offset"]};
|
|
17
|
+
border-radius: ${theme.shared["border-radius"]};
|
|
18
|
+
}
|
|
19
|
+
&[data-disabled],
|
|
20
|
+
&:disabled {
|
|
21
|
+
cursor: ${theme.shared.button[":disabled"].cursor};
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { avatarButtonStyles, defaultAvatarButtonTheme };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
4
|
+
var reactAriaComponents = require('react-aria-components');
|
|
5
|
+
var mergeDeep = require('../../util/mergeDeep.cjs');
|
|
6
|
+
var Avatar = require('../avatar/Avatar.cjs');
|
|
7
|
+
var styles = require('./styles.cjs');
|
|
8
|
+
|
|
9
|
+
function AvatarLink(props) {
|
|
10
|
+
const mergedTheme = mergeDeep.mergeDeep(styles.defaultAvatarLinkTheme, props.theme ?? {});
|
|
11
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Link, { css: styles.avatarLinkStyles(mergedTheme), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(Avatar.Avatar, { ...props, "data-avatar-context": "interactive" }) });
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
exports.AvatarLink = AvatarLink;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { Link } from 'react-aria-components';
|
|
3
|
+
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
4
|
+
import { Avatar } from '../avatar/Avatar.js';
|
|
5
|
+
import { defaultAvatarLinkTheme, avatarLinkStyles } from './styles.js';
|
|
6
|
+
|
|
7
|
+
function AvatarLink(props) {
|
|
8
|
+
const mergedTheme = mergeDeep(defaultAvatarLinkTheme, props.theme ?? {});
|
|
9
|
+
return jsx(Link, { css: avatarLinkStyles(mergedTheme), ...props, children: jsx(Avatar, { ...props, "data-avatar-context": "interactive" }) });
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { AvatarLink };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('@emotion/react');
|
|
4
|
+
var styles = require('../avatar/styles.cjs');
|
|
5
|
+
|
|
6
|
+
const defaultAvatarLinkTheme = styles.defaultAvatarTheme;
|
|
7
|
+
const avatarLinkStyles = (theme) => {
|
|
8
|
+
return react.css`
|
|
9
|
+
display: ${theme.shared.display};
|
|
10
|
+
width: ${theme.shared.link.width};
|
|
11
|
+
|
|
12
|
+
&[data-focus-visible],
|
|
13
|
+
&:focus-visible {
|
|
14
|
+
outline: ${theme.shared.link[":focus-visible"].outline};
|
|
15
|
+
outline-offset: ${theme.shared.link[":focus-visible"]["outline-offset"]};
|
|
16
|
+
border-radius: ${theme.shared["border-radius"]};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
text-decoration: ${theme.shared.link["text-decoration"]};
|
|
20
|
+
`;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
exports.avatarLinkStyles = avatarLinkStyles;
|
|
24
|
+
exports.defaultAvatarLinkTheme = defaultAvatarLinkTheme;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
|
+
import { defaultAvatarTheme } from '../avatar/styles.js';
|
|
3
|
+
|
|
4
|
+
const defaultAvatarLinkTheme = defaultAvatarTheme;
|
|
5
|
+
const avatarLinkStyles = (theme) => {
|
|
6
|
+
return css`
|
|
7
|
+
display: ${theme.shared.display};
|
|
8
|
+
width: ${theme.shared.link.width};
|
|
9
|
+
|
|
10
|
+
&[data-focus-visible],
|
|
11
|
+
&:focus-visible {
|
|
12
|
+
outline: ${theme.shared.link[":focus-visible"].outline};
|
|
13
|
+
outline-offset: ${theme.shared.link[":focus-visible"]["outline-offset"]};
|
|
14
|
+
border-radius: ${theme.shared["border-radius"]};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
text-decoration: ${theme.shared.link["text-decoration"]};
|
|
18
|
+
`;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { avatarLinkStyles, defaultAvatarLinkTheme };
|
|
@@ -4,7 +4,7 @@ import { mergeDeep } from '../../util/mergeDeep.js';
|
|
|
4
4
|
import { Icon } from '../icon/Icon.js';
|
|
5
5
|
import { buttonStyles, defaultButtonTheme } from './styles.js';
|
|
6
6
|
|
|
7
|
-
function Button({ variant = "
|
|
7
|
+
function Button({ variant = "primary", size = "md", theme = {}, cssOverrides, icon, ...props }) {
|
|
8
8
|
const mergedTheme = mergeDeep(defaultButtonTheme, theme);
|
|
9
9
|
const iconSize = size === "xs" ? "sm" : size;
|
|
10
10
|
return jsx(Button$1, { ...props, css: [buttonStyles(mergedTheme, { variant, size }, !!icon), cssOverrides], children: composeRenderProps(props.children, (children) => (
|
|
@@ -5,7 +5,7 @@ import { mergeDeep } from '../../util/mergeDeep.js';
|
|
|
5
5
|
import { Icon } from '../icon/Icon.js';
|
|
6
6
|
import { iconButtonStyles, defaultIconButtonTheme } from './styles.js';
|
|
7
7
|
|
|
8
|
-
function IconButton({ variant = "
|
|
8
|
+
function IconButton({ variant = "primary", size = "md", symbol, ariaLabel, theme = {}, cssOverrides, ...props }) {
|
|
9
9
|
const mergedTheme = mergeDeep(defaultIconButtonTheme, theme);
|
|
10
10
|
const buttonRef = useRef(null);
|
|
11
11
|
useEffect(() => {
|
|
@@ -5,7 +5,7 @@ import { mergeDeep } from '../../util/mergeDeep.js';
|
|
|
5
5
|
import { Icon } from '../icon/Icon.js';
|
|
6
6
|
import { iconLinkButtonStyles, defaultIconLinkButtonTheme } from './styles.js';
|
|
7
7
|
|
|
8
|
-
function IconLinkButton({ variant = "
|
|
8
|
+
function IconLinkButton({ variant = "primary", size = "md", symbol, ariaLabel, theme = {}, cssOverrides, ...props }) {
|
|
9
9
|
const mergedTheme = mergeDeep(defaultIconLinkButtonTheme, theme);
|
|
10
10
|
const linkRef = useRef(null);
|
|
11
11
|
useEffect(() => {
|
|
@@ -0,0 +1,56 @@
|
|
|
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 Icon = require('../icon/Icon.cjs');
|
|
7
|
+
var Typography = require('../typography/Typography.cjs');
|
|
8
|
+
var styles = require('./styles.cjs');
|
|
9
|
+
|
|
10
|
+
function InlineMessage({
|
|
11
|
+
children,
|
|
12
|
+
level,
|
|
13
|
+
hideIcon = false,
|
|
14
|
+
icon,
|
|
15
|
+
theme = {},
|
|
16
|
+
cssOverrides,
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
19
|
+
}) {
|
|
20
|
+
const mergedTheme = mergeDeep.mergeDeep(styles.defaultInlineMessageTheme, theme);
|
|
21
|
+
const determinedIcon = React.useMemo(() => {
|
|
22
|
+
if (icon) {
|
|
23
|
+
return icon;
|
|
24
|
+
}
|
|
25
|
+
switch (level) {
|
|
26
|
+
case "error":
|
|
27
|
+
return "warning";
|
|
28
|
+
case "success":
|
|
29
|
+
return "check_circle";
|
|
30
|
+
case "information":
|
|
31
|
+
default:
|
|
32
|
+
return "info";
|
|
33
|
+
}
|
|
34
|
+
}, [icon, level]);
|
|
35
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
css: [styles.inlineMessageStyles(mergedTheme, { level }), cssOverrides],
|
|
39
|
+
className,
|
|
40
|
+
...props,
|
|
41
|
+
children: [
|
|
42
|
+
!hideIcon && /* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { fill: mergedTheme[level].color, size: "md", children: determinedIcon }),
|
|
43
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
44
|
+
Typography.Typography,
|
|
45
|
+
{
|
|
46
|
+
variant: "help-text-form-md",
|
|
47
|
+
theme: { color: mergedTheme[level].color },
|
|
48
|
+
children
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
exports.InlineMessage = InlineMessage;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
4
|
+
import { Icon } from '../icon/Icon.js';
|
|
5
|
+
import { Typography } from '../typography/Typography.js';
|
|
6
|
+
import { inlineMessageStyles, defaultInlineMessageTheme } from './styles.js';
|
|
7
|
+
|
|
8
|
+
function InlineMessage({ children, level, hideIcon = false, icon, theme = {}, cssOverrides, className, ...props }) {
|
|
9
|
+
const mergedTheme = mergeDeep(defaultInlineMessageTheme, 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 "check_circle";
|
|
19
|
+
case "information":
|
|
20
|
+
default:
|
|
21
|
+
return "info";
|
|
22
|
+
}
|
|
23
|
+
}, [icon, level]);
|
|
24
|
+
return jsxs("div", { css: [inlineMessageStyles(mergedTheme, { level }), cssOverrides], className, ...props, children: [!hideIcon && jsx(Icon, { fill: mergedTheme[level].color, size: "md", children: determinedIcon }), jsx(Typography, { variant: "help-text-form-md", theme: { color: mergedTheme[level].color }, children })] });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { InlineMessage };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('@emotion/react');
|
|
4
|
+
var inlineMessage = require('../../styleD/build/typescript/component/inlineMessage.cjs');
|
|
5
|
+
|
|
6
|
+
const defaultInlineMessageTheme = inlineMessage.componentInlineMessage;
|
|
7
|
+
const inlineMessageStyles = (theme, { level }) => {
|
|
8
|
+
return react.css`
|
|
9
|
+
display: ${theme.shared.display};
|
|
10
|
+
align-items: ${theme.shared["align-items"]};
|
|
11
|
+
gap: ${theme.shared.gap};
|
|
12
|
+
color: ${theme[level].color};
|
|
13
|
+
`;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.defaultInlineMessageTheme = defaultInlineMessageTheme;
|
|
17
|
+
exports.inlineMessageStyles = inlineMessageStyles;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
|
+
import { componentInlineMessage } from '../../styleD/build/typescript/component/inlineMessage.js';
|
|
3
|
+
|
|
4
|
+
const defaultInlineMessageTheme = componentInlineMessage;
|
|
5
|
+
const inlineMessageStyles = (theme, { level }) => {
|
|
6
|
+
return css`
|
|
7
|
+
display: ${theme.shared.display};
|
|
8
|
+
align-items: ${theme.shared["align-items"]};
|
|
9
|
+
gap: ${theme.shared.gap};
|
|
10
|
+
color: ${theme[level].color};
|
|
11
|
+
`;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { defaultInlineMessageTheme, inlineMessageStyles };
|
|
@@ -4,7 +4,7 @@ import { mergeDeep } from '../../util/mergeDeep.js';
|
|
|
4
4
|
import { Icon } from '../icon/Icon.js';
|
|
5
5
|
import { linkButtonStyles, defaultLinkButtonTheme } from './styles.js';
|
|
6
6
|
|
|
7
|
-
function LinkButton({ variant = "
|
|
7
|
+
function LinkButton({ variant = "primary", size = "md", theme = {}, cssOverrides, icon, ...props }) {
|
|
8
8
|
const mergedTheme = mergeDeep(defaultLinkButtonTheme, theme);
|
|
9
9
|
const iconSize = size === "xs" ? "sm" : size;
|
|
10
10
|
return jsx(Link, { ...props, css: [
|
|
@@ -33,6 +33,7 @@ const menuItemStyles = (theme, { description }, isFocusVisible = false) => react
|
|
|
33
33
|
padding: ${theme.shared.padding.top} ${theme.shared.padding.right}
|
|
34
34
|
${theme.shared.padding.bottom} ${theme.shared.padding.left};
|
|
35
35
|
border-bottom: ${theme.shared["border-bottom"]};
|
|
36
|
+
background: ${theme.shared["background-color"]};
|
|
36
37
|
&:last-child {
|
|
37
38
|
border-bottom: ${theme.shared[":last-child"]["border-bottom"]};
|
|
38
39
|
}
|
|
@@ -31,6 +31,7 @@ const menuItemStyles = (theme, { description }, isFocusVisible = false) => css`
|
|
|
31
31
|
padding: ${theme.shared.padding.top} ${theme.shared.padding.right}
|
|
32
32
|
${theme.shared.padding.bottom} ${theme.shared.padding.left};
|
|
33
33
|
border-bottom: ${theme.shared["border-bottom"]};
|
|
34
|
+
background: ${theme.shared["background-color"]};
|
|
34
35
|
&:last-child {
|
|
35
36
|
border-bottom: ${theme.shared[":last-child"]["border-bottom"]};
|
|
36
37
|
}
|
|
@@ -0,0 +1,101 @@
|
|
|
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 Avatar = require('../avatar/Avatar.cjs');
|
|
7
|
+
var styles = require('./styles.cjs');
|
|
8
|
+
var TopBarItem = require('./topBarItem/TopBarItem.cjs');
|
|
9
|
+
var TopBarNavigation = require('./topBarNavigation/TopBarNavigation.cjs');
|
|
10
|
+
var TopBarToolName = require('./topBarToolName/TopBarToolName.cjs');
|
|
11
|
+
|
|
12
|
+
function TopBarSide({
|
|
13
|
+
children,
|
|
14
|
+
alignment
|
|
15
|
+
}) {
|
|
16
|
+
const items = [];
|
|
17
|
+
React.Children.forEach(children, (child, i) => {
|
|
18
|
+
if (!React.isValidElement(child)) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (child.type === TopBarItem.TopBarItem) {
|
|
22
|
+
items.push(
|
|
23
|
+
React.cloneElement(child, {
|
|
24
|
+
key: `${child.key}-${i}`,
|
|
25
|
+
alignment
|
|
26
|
+
})
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
if (child.type === TopBarNavigation.TopBarNavigation) {
|
|
30
|
+
items.push(
|
|
31
|
+
React.cloneElement(child, {
|
|
32
|
+
key: `${child.key}-${i}`,
|
|
33
|
+
alignment
|
|
34
|
+
})
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: items });
|
|
39
|
+
}
|
|
40
|
+
function TopBarContainerRight({
|
|
41
|
+
children
|
|
42
|
+
}) {
|
|
43
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TopBarSide, { alignment: "right", children });
|
|
44
|
+
}
|
|
45
|
+
function TopBarContainerLeft({
|
|
46
|
+
children
|
|
47
|
+
}) {
|
|
48
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TopBarSide, { alignment: "left", children });
|
|
49
|
+
}
|
|
50
|
+
function TopBar({
|
|
51
|
+
children,
|
|
52
|
+
theme = {},
|
|
53
|
+
cssOverrides,
|
|
54
|
+
className,
|
|
55
|
+
...props
|
|
56
|
+
}) {
|
|
57
|
+
const mergedTheme = mergeDeep.mergeDeep(styles.defaultTopBarTheme, theme);
|
|
58
|
+
let leftSide = null;
|
|
59
|
+
let rightSide = null;
|
|
60
|
+
let toolName = null;
|
|
61
|
+
let avatar = null;
|
|
62
|
+
React.Children.forEach(children, (child) => {
|
|
63
|
+
if (!React.isValidElement(child)) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (child.type === TopBarToolName.TopBarToolName) {
|
|
67
|
+
toolName ?? (toolName = child);
|
|
68
|
+
}
|
|
69
|
+
if (child.type === Avatar.Avatar) {
|
|
70
|
+
avatar ?? (avatar = /* @__PURE__ */ jsxRuntime.jsx(TopBarItem.TopBarItem, { alignment: "right", children: child }));
|
|
71
|
+
}
|
|
72
|
+
if (child.type === TopBarContainerLeft) {
|
|
73
|
+
leftSide ?? (leftSide = child);
|
|
74
|
+
}
|
|
75
|
+
if (child.type === TopBarContainerRight) {
|
|
76
|
+
rightSide ?? (rightSide = child);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
80
|
+
"div",
|
|
81
|
+
{
|
|
82
|
+
css: [styles.topBarStyles(mergedTheme), cssOverrides],
|
|
83
|
+
className,
|
|
84
|
+
...props,
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { css: styles.topBarContainerLeftStyles(mergedTheme), children: [
|
|
87
|
+
toolName,
|
|
88
|
+
leftSide
|
|
89
|
+
] }),
|
|
90
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { css: styles.topBarContainerRightStyles(mergedTheme), children: [
|
|
91
|
+
rightSide,
|
|
92
|
+
avatar
|
|
93
|
+
] })
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
exports.TopBar = TopBar;
|
|
100
|
+
exports.TopBarContainerLeft = TopBarContainerLeft;
|
|
101
|
+
exports.TopBarContainerRight = TopBarContainerRight;
|