@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.
Files changed (141) hide show
  1. package/README.md +1 -0
  2. package/dist/TopBar.cjs +9 -3
  3. package/dist/TopBar.js +4 -1
  4. package/dist/avatarButton.cjs +7 -0
  5. package/dist/avatarButton.js +1 -0
  6. package/dist/avatarLink.cjs +7 -0
  7. package/dist/avatarLink.js +1 -0
  8. package/dist/components/avatar/styles.cjs +24 -0
  9. package/dist/components/avatar/styles.js +24 -0
  10. package/dist/components/avatar-button/AvatarButton.cjs +14 -0
  11. package/dist/components/avatar-button/AvatarButton.js +12 -0
  12. package/dist/components/avatar-button/styles.cjs +29 -0
  13. package/dist/components/avatar-button/styles.js +26 -0
  14. package/dist/components/avatar-link/AvatarLink.cjs +14 -0
  15. package/dist/components/avatar-link/AvatarLink.js +12 -0
  16. package/dist/components/avatar-link/styles.cjs +24 -0
  17. package/dist/components/avatar-link/styles.js +21 -0
  18. package/dist/components/button/Button.cjs +1 -1
  19. package/dist/components/button/Button.js +1 -1
  20. package/dist/components/icon-button/IconButton.cjs +1 -1
  21. package/dist/components/icon-button/IconButton.js +1 -1
  22. package/dist/components/icon-link-button/IconLinkButton.cjs +1 -1
  23. package/dist/components/icon-link-button/IconLinkButton.js +1 -1
  24. package/dist/components/inline-message/InlineMessage.cjs +56 -0
  25. package/dist/components/inline-message/InlineMessage.js +27 -0
  26. package/dist/components/inline-message/styles.cjs +17 -0
  27. package/dist/components/inline-message/styles.js +14 -0
  28. package/dist/components/link-button/LinkButton.cjs +1 -1
  29. package/dist/components/link-button/LinkButton.js +1 -1
  30. package/dist/components/menu/styles.cjs +1 -0
  31. package/dist/components/menu/styles.js +1 -0
  32. package/dist/components/topbar/TopBar.cjs +101 -0
  33. package/dist/components/topbar/TopBar.js +63 -0
  34. package/dist/components/topbar/styles.cjs +30 -0
  35. package/dist/components/topbar/styles.js +25 -0
  36. package/dist/components/topbar/topBarItem/TopBarItem.cjs +28 -0
  37. package/dist/components/topbar/topBarItem/TopBarItem.js +10 -0
  38. package/dist/components/topbar/topBarItem/styles.cjs +20 -0
  39. package/dist/components/topbar/topBarItem/styles.js +17 -0
  40. package/dist/components/topbar/topBarNavigation/TopBarNavigation.cjs +70 -0
  41. package/dist/components/topbar/topBarNavigation/TopBarNavigation.js +23 -0
  42. package/dist/components/topbar/topBarNavigation/styles.cjs +68 -0
  43. package/dist/components/topbar/topBarNavigation/styles.js +61 -0
  44. package/dist/components/topbar/{toolName → topBarToolName}/TopBarToolName.cjs +3 -2
  45. package/dist/components/topbar/topBarToolName/TopBarToolName.js +13 -0
  46. package/dist/index.cjs +2 -0
  47. package/dist/index.js +1 -0
  48. package/dist/inline-message.cjs +9 -0
  49. package/dist/inline-message.js +2 -0
  50. package/dist/styleD/build/css/base/typography.css +3 -3
  51. package/dist/styleD/build/css/component/TopBar.css +55 -1
  52. package/dist/styleD/build/css/component/avatar.css +32 -1
  53. package/dist/styleD/build/css/component/button.css +177 -255
  54. package/dist/styleD/build/css/component/favicon.css +1 -1
  55. package/dist/styleD/build/css/component/inlineMessage.css +17 -0
  56. package/dist/styleD/build/css/component/menu.css +5 -4
  57. package/dist/styleD/build/css/component/tagAutocomplete.css +1 -1
  58. package/dist/styleD/build/css/component/tagTable.css +1 -1
  59. package/dist/styleD/build/css/component/topBarItem.css +7 -0
  60. package/dist/styleD/build/css/component/userMenu.css +6 -6
  61. package/dist/styleD/build/css/semantic/colors.css +45 -46
  62. package/dist/styleD/build/css/semantic/sizing.css +1 -0
  63. package/dist/styleD/build/css/semantic/typography.css +68 -30
  64. package/dist/styleD/build/typescript/base/typography.cjs +3 -3
  65. package/dist/styleD/build/typescript/base/typography.js +3 -3
  66. package/dist/styleD/build/typescript/component/TopBar.cjs +94 -0
  67. package/dist/styleD/build/typescript/component/TopBar.js +94 -0
  68. package/dist/styleD/build/typescript/component/avatar.cjs +95 -12
  69. package/dist/styleD/build/typescript/component/avatar.js +95 -12
  70. package/dist/styleD/build/typescript/component/button.cjs +5 -130
  71. package/dist/styleD/build/typescript/component/button.js +5 -130
  72. package/dist/styleD/build/typescript/component/inlineMessage.cjs +28 -0
  73. package/dist/styleD/build/typescript/component/inlineMessage.js +26 -0
  74. package/dist/styleD/build/typescript/component/menu.cjs +2 -1
  75. package/dist/styleD/build/typescript/component/menu.js +2 -1
  76. package/dist/styleD/build/typescript/semantic/colors.cjs +47 -52
  77. package/dist/styleD/build/typescript/semantic/colors.js +47 -52
  78. package/dist/styleD/build/typescript/semantic/sizing.cjs +1 -0
  79. package/dist/styleD/build/typescript/semantic/sizing.js +1 -0
  80. package/dist/styleD/build/typescript/semantic/typography.cjs +50 -0
  81. package/dist/styleD/build/typescript/semantic/typography.js +50 -0
  82. package/dist/types/TopBar.d.ts +12 -3
  83. package/dist/types/avatar-button.d.ts +18 -0
  84. package/dist/types/avatar-link.d.ts +18 -0
  85. package/dist/types/components/avatar-button/AvatarButton.d.ts +2 -0
  86. package/dist/types/components/avatar-button/sandbox.d.ts +5 -0
  87. package/dist/types/components/avatar-button/styles.d.ts +6 -0
  88. package/dist/types/components/avatar-button/types.d.ts +3 -0
  89. package/dist/types/components/avatar-link/AvatarLink.d.ts +2 -0
  90. package/dist/types/components/avatar-link/sandbox.d.ts +5 -0
  91. package/dist/types/components/avatar-link/styles.d.ts +6 -0
  92. package/dist/types/components/avatar-link/types.d.ts +3 -0
  93. package/dist/types/components/button/sandbox.d.ts +4 -4
  94. package/dist/types/components/button/types.d.ts +1 -1
  95. package/dist/types/components/icon-button/sandbox.d.ts +4 -4
  96. package/dist/types/components/icon-button/styles.d.ts +3 -128
  97. package/dist/types/components/icon-button/types.d.ts +1 -1
  98. package/dist/types/components/icon-link-button/sandbox.d.ts +4 -4
  99. package/dist/types/components/icon-link-button/styles.d.ts +3 -128
  100. package/dist/types/components/icon-link-button/types.d.ts +1 -1
  101. package/dist/types/components/inline-message/InlineMessage.d.ts +2 -0
  102. package/dist/types/components/inline-message/sandbox.d.ts +5 -0
  103. package/dist/types/components/inline-message/styles.d.ts +8 -0
  104. package/dist/types/components/inline-message/types.d.ts +21 -0
  105. package/dist/types/components/link-button/sandbox.d.ts +4 -4
  106. package/dist/types/components/link-button/styles.d.ts +3 -128
  107. package/dist/types/components/link-button/types.d.ts +1 -1
  108. package/dist/types/components/topbar/TopBar.d.ts +8 -0
  109. package/dist/types/components/topbar/sandbox.d.ts +5 -0
  110. package/dist/types/components/topbar/styles.d.ts +9 -0
  111. package/dist/types/components/topbar/topBarItem/TopBarItem.d.ts +2 -0
  112. package/dist/types/components/topbar/topBarItem/sandbox.d.ts +5 -0
  113. package/dist/types/components/topbar/topBarItem/styles.d.ts +8 -0
  114. package/dist/types/components/topbar/topBarItem/types.d.ts +14 -0
  115. package/dist/types/components/topbar/topBarNavigation/TopBarNavigation.d.ts +2 -0
  116. package/dist/types/components/topbar/topBarNavigation/sandbox.d.ts +5 -0
  117. package/dist/types/components/topbar/topBarNavigation/styles.d.ts +12 -0
  118. package/dist/types/components/topbar/topBarNavigation/types.d.ts +44 -0
  119. package/dist/types/components/topbar/types.d.ts +3 -0
  120. package/dist/types/index.d.ts +2 -0
  121. package/dist/types/inline-message.d.ts +19 -0
  122. package/dist/types/styleD/build/typescript/base/typography.d.ts +3 -3
  123. package/dist/types/styleD/build/typescript/component/TopBar.d.ts +94 -0
  124. package/dist/types/styleD/build/typescript/component/avatar.d.ts +83 -0
  125. package/dist/types/styleD/build/typescript/component/button.d.ts +3 -128
  126. package/dist/types/styleD/build/typescript/component/inlineMessage.d.ts +28 -0
  127. package/dist/types/styleD/build/typescript/component/menu.d.ts +1 -0
  128. package/dist/types/styleD/build/typescript/semantic/colors.d.ts +44 -49
  129. package/dist/types/styleD/build/typescript/semantic/sizing.d.ts +1 -0
  130. package/dist/types/styleD/build/typescript/semantic/typography.d.ts +50 -0
  131. package/dist/util/css/reset.css +10 -0
  132. package/dist/util/reset.css.cjs +1 -1
  133. package/dist/util/reset.css.js +1 -1
  134. package/package.json +35 -18
  135. package/dist/components/topbar/toolName/TopBarToolName.js +0 -12
  136. /package/dist/components/topbar/{toolName → topBarToolName}/styles.cjs +0 -0
  137. /package/dist/components/topbar/{toolName → topBarToolName}/styles.js +0 -0
  138. /package/dist/types/components/topbar/{toolName → topBarToolName}/TopBarToolName.d.ts +0 -0
  139. /package/dist/types/components/topbar/{toolName → topBarToolName}/sandbox.d.ts +0 -0
  140. /package/dist/types/components/topbar/{toolName → topBarToolName}/styles.d.ts +0 -0
  141. /package/dist/types/components/topbar/{toolName → topBarToolName}/types.d.ts +0 -0
@@ -0,0 +1,63 @@
1
+ import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
2
+ import React from 'react';
3
+ import { mergeDeep } from '../../util/mergeDeep.js';
4
+ import { Avatar } from '../avatar/Avatar.js';
5
+ import { topBarContainerLeftStyles, topBarContainerRightStyles, topBarStyles, defaultTopBarTheme } from './styles.js';
6
+ import { TopBarItem } from './topBarItem/TopBarItem.js';
7
+ import { TopBarNavigation } from './topBarNavigation/TopBarNavigation.js';
8
+ import { TopBarToolName } from './topBarToolName/TopBarToolName.js';
9
+
10
+ function TopBarSide({ children, alignment }) {
11
+ const items = [];
12
+ React.Children.forEach(children, (child, i) => {
13
+ if (!React.isValidElement(child)) {
14
+ return;
15
+ }
16
+ if (child.type === TopBarItem) {
17
+ items.push(React.cloneElement(child, {
18
+ key: `${child.key}-${i}`,
19
+ alignment
20
+ }));
21
+ }
22
+ if (child.type === TopBarNavigation) {
23
+ items.push(React.cloneElement(child, {
24
+ key: `${child.key}-${i}`,
25
+ alignment
26
+ }));
27
+ }
28
+ });
29
+ return jsx(Fragment, { children: items });
30
+ }
31
+ function TopBarContainerRight({ children }) {
32
+ return jsx(TopBarSide, { alignment: "right", children });
33
+ }
34
+ function TopBarContainerLeft({ children }) {
35
+ return jsx(TopBarSide, { alignment: "left", children });
36
+ }
37
+ function TopBar({ children, theme = {}, cssOverrides, className, ...props }) {
38
+ const mergedTheme = mergeDeep(defaultTopBarTheme, theme);
39
+ let leftSide = null;
40
+ let rightSide = null;
41
+ let toolName = null;
42
+ let avatar = null;
43
+ React.Children.forEach(children, (child) => {
44
+ if (!React.isValidElement(child)) {
45
+ return;
46
+ }
47
+ if (child.type === TopBarToolName) {
48
+ toolName ?? (toolName = child);
49
+ }
50
+ if (child.type === Avatar) {
51
+ avatar ?? (avatar = jsx(TopBarItem, { alignment: "right", children: child }));
52
+ }
53
+ if (child.type === TopBarContainerLeft) {
54
+ leftSide ?? (leftSide = child);
55
+ }
56
+ if (child.type === TopBarContainerRight) {
57
+ rightSide ?? (rightSide = child);
58
+ }
59
+ });
60
+ 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] })] });
61
+ }
62
+
63
+ export { TopBar, TopBarContainerLeft, TopBarContainerRight };
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+ var react = require('@emotion/react');
4
+ var TopBar = require('../../styleD/build/typescript/component/TopBar.cjs');
5
+
6
+ const defaultTopBarTheme = TopBar.componentTopBar;
7
+ const topBarStyles = (theme) => {
8
+ return react.css`
9
+ background-color: ${theme["background-color"]};
10
+ height: ${theme.height};
11
+ border: ${theme.border};
12
+ display: ${theme.display};
13
+ justify-content: ${theme["justify-content"]};
14
+ `;
15
+ };
16
+ const topBarContainerLeftStyles = (theme) => {
17
+ return react.css`
18
+ display: ${theme.display};
19
+ `;
20
+ };
21
+ const topBarContainerRightStyles = (theme) => {
22
+ return react.css`
23
+ display: ${theme.display};
24
+ `;
25
+ };
26
+
27
+ exports.defaultTopBarTheme = defaultTopBarTheme;
28
+ exports.topBarContainerLeftStyles = topBarContainerLeftStyles;
29
+ exports.topBarContainerRightStyles = topBarContainerRightStyles;
30
+ exports.topBarStyles = topBarStyles;
@@ -0,0 +1,25 @@
1
+ import { css } from '@emotion/react';
2
+ import { componentTopBar } from '../../styleD/build/typescript/component/TopBar.js';
3
+
4
+ const defaultTopBarTheme = componentTopBar;
5
+ const topBarStyles = (theme) => {
6
+ return css`
7
+ background-color: ${theme["background-color"]};
8
+ height: ${theme.height};
9
+ border: ${theme.border};
10
+ display: ${theme.display};
11
+ justify-content: ${theme["justify-content"]};
12
+ `;
13
+ };
14
+ const topBarContainerLeftStyles = (theme) => {
15
+ return css`
16
+ display: ${theme.display};
17
+ `;
18
+ };
19
+ const topBarContainerRightStyles = (theme) => {
20
+ return css`
21
+ display: ${theme.display};
22
+ `;
23
+ };
24
+
25
+ export { defaultTopBarTheme, topBarContainerLeftStyles, topBarContainerRightStyles, topBarStyles };
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('@emotion/react/jsx-runtime');
4
+ var mergeDeep = require('../../../util/mergeDeep.cjs');
5
+ var styles = require('./styles.cjs');
6
+
7
+ function TopBarItem({
8
+ children,
9
+ alignment = "left",
10
+ theme = {},
11
+ cssOverrides,
12
+ className,
13
+ size = "md",
14
+ ...props
15
+ }) {
16
+ const mergedTheme = mergeDeep.mergeDeep(styles.defaultTopBarItemTheme, theme);
17
+ return /* @__PURE__ */ jsxRuntime.jsx(
18
+ "div",
19
+ {
20
+ css: [styles.topBarItemStyles(mergedTheme, alignment, { size }), cssOverrides],
21
+ className,
22
+ ...props,
23
+ children
24
+ }
25
+ );
26
+ }
27
+
28
+ exports.TopBarItem = TopBarItem;
@@ -0,0 +1,10 @@
1
+ import { jsx } from '@emotion/react/jsx-runtime';
2
+ import { mergeDeep } from '../../../util/mergeDeep.js';
3
+ import { topBarItemStyles, defaultTopBarItemTheme } from './styles.js';
4
+
5
+ function TopBarItem({ children, alignment = "left", theme = {}, cssOverrides, className, size = "md", ...props }) {
6
+ const mergedTheme = mergeDeep(defaultTopBarItemTheme, theme);
7
+ return jsx("div", { css: [topBarItemStyles(mergedTheme, alignment, { size }), cssOverrides], className, ...props, children });
8
+ }
9
+
10
+ export { TopBarItem };
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ var react = require('@emotion/react');
4
+ var TopBar = require('../../../styleD/build/typescript/component/TopBar.cjs');
5
+
6
+ const defaultTopBarItemTheme = TopBar.componentTopBar.Item;
7
+ const topBarItemStyles = (theme, alignment, { size }) => {
8
+ return react.css`
9
+ display: ${theme.display};
10
+ align-items: ${theme["align-items"]};
11
+ height: ${theme.height};
12
+ padding: ${theme[size].padding.top} ${theme[size].padding.right}
13
+ ${theme[size].padding.bottom} ${theme[size].padding.left};
14
+ ${alignment === "left" ? "border-right" : "border-left"}: ${theme.border};
15
+ ${alignment === "right" && "margin-left: auto"};
16
+ `;
17
+ };
18
+
19
+ exports.defaultTopBarItemTheme = defaultTopBarItemTheme;
20
+ exports.topBarItemStyles = topBarItemStyles;
@@ -0,0 +1,17 @@
1
+ import { css } from '@emotion/react';
2
+ import { componentTopBar } from '../../../styleD/build/typescript/component/TopBar.js';
3
+
4
+ const defaultTopBarItemTheme = componentTopBar.Item;
5
+ const topBarItemStyles = (theme, alignment, { size }) => {
6
+ return css`
7
+ display: ${theme.display};
8
+ align-items: ${theme["align-items"]};
9
+ height: ${theme.height};
10
+ padding: ${theme[size].padding.top} ${theme[size].padding.right}
11
+ ${theme[size].padding.bottom} ${theme[size].padding.left};
12
+ ${alignment === "left" ? "border-right" : "border-left"}: ${theme.border};
13
+ ${alignment === "right" && "margin-left: auto"};
14
+ `;
15
+ };
16
+
17
+ export { defaultTopBarItemTheme, topBarItemStyles };
@@ -0,0 +1,70 @@
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 Icon = require('../../icon/Icon.cjs');
7
+ var Menu = require('../../menu/Menu.cjs');
8
+ var styles = require('./styles.cjs');
9
+
10
+ const menuIndicator = "keyboard_arrow_down";
11
+ function TopBarNavigation({
12
+ text,
13
+ size = "md",
14
+ isSelected = false,
15
+ icon,
16
+ menuChildren,
17
+ href,
18
+ onPress,
19
+ isDisabled,
20
+ alignment = "left",
21
+ theme = {},
22
+ cssOverrides,
23
+ className,
24
+ ...props
25
+ }) {
26
+ const mergedTheme = mergeDeep.mergeDeep(styles.defaultTopBarNavigationTheme, theme);
27
+ const iconSize = size === "md" ? "lg" : "sm";
28
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { css: styles.topBarNavigationDividerStyles(mergedTheme, { alignment }), children: menuChildren ? /* @__PURE__ */ jsxRuntime.jsxs(Menu.Menu, { children: [
29
+ /* @__PURE__ */ jsxRuntime.jsx(Menu.MenuToggle, { children: /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Pressable, { isDisabled, children: /* @__PURE__ */ jsxRuntime.jsxs(
30
+ "span",
31
+ {
32
+ role: "button",
33
+ "data-disabled": isDisabled ? true : void 0,
34
+ css: [
35
+ styles.topBarNavigationStyles(mergedTheme, isSelected),
36
+ styles.topBarNavigationTypographyStyles(mergedTheme, size),
37
+ cssOverrides
38
+ ],
39
+ className,
40
+ ...props,
41
+ children: [
42
+ /* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { size: iconSize, children: icon }),
43
+ /* @__PURE__ */ jsxRuntime.jsx("span", { css: styles.topBarNavigationTextStyles(mergedTheme), children: text }),
44
+ /* @__PURE__ */ jsxRuntime.jsx("div", { css: styles.topBarMenuIndicatorStyles(mergedTheme), children: /* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { size: iconSize, children: menuIndicator }) })
45
+ ]
46
+ }
47
+ ) }) }),
48
+ menuChildren
49
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(
50
+ reactAriaComponents.Link,
51
+ {
52
+ css: [
53
+ styles.topBarNavigationStyles(mergedTheme, isSelected),
54
+ styles.topBarNavigationTypographyStyles(mergedTheme, size),
55
+ cssOverrides
56
+ ],
57
+ href,
58
+ onPress,
59
+ className,
60
+ isDisabled,
61
+ ...props,
62
+ children: [
63
+ /* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { size: iconSize, children: icon }),
64
+ /* @__PURE__ */ jsxRuntime.jsx("span", { css: styles.topBarNavigationTextStyles(mergedTheme), children: text })
65
+ ]
66
+ }
67
+ ) });
68
+ }
69
+
70
+ exports.TopBarNavigation = TopBarNavigation;
@@ -0,0 +1,23 @@
1
+ import { jsx, jsxs } from '@emotion/react/jsx-runtime';
2
+ import { Pressable, Link } from 'react-aria-components';
3
+ import { mergeDeep } from '../../../util/mergeDeep.js';
4
+ import { Icon } from '../../icon/Icon.js';
5
+ import { Menu, MenuToggle } from '../../menu/Menu.js';
6
+ import { topBarNavigationTextStyles, topBarMenuIndicatorStyles, topBarNavigationStyles, topBarNavigationTypographyStyles, topBarNavigationDividerStyles, defaultTopBarNavigationTheme } from './styles.js';
7
+
8
+ const menuIndicator = "keyboard_arrow_down";
9
+ function TopBarNavigation({ text, size = "md", isSelected = false, icon, menuChildren, href, onPress, isDisabled, alignment = "left", theme = {}, cssOverrides, className, ...props }) {
10
+ const mergedTheme = mergeDeep(defaultTopBarNavigationTheme, theme);
11
+ const iconSize = size === "md" ? "lg" : "sm";
12
+ return jsx("div", { css: topBarNavigationDividerStyles(mergedTheme, { alignment }), children: menuChildren ? jsxs(Menu, { children: [jsx(MenuToggle, { children: jsx(Pressable, { isDisabled, children: jsxs("span", { role: "button", "data-disabled": isDisabled ? true : void 0, css: [
13
+ topBarNavigationStyles(mergedTheme, isSelected),
14
+ topBarNavigationTypographyStyles(mergedTheme, size),
15
+ cssOverrides
16
+ ], className, ...props, children: [jsx(Icon, { size: iconSize, children: icon }), jsx("span", { css: topBarNavigationTextStyles(mergedTheme), children: text }), jsx("div", { css: topBarMenuIndicatorStyles(mergedTheme), children: jsx(Icon, { size: iconSize, children: menuIndicator }) })] }) }) }), menuChildren] }) : jsxs(Link, { css: [
17
+ topBarNavigationStyles(mergedTheme, isSelected),
18
+ topBarNavigationTypographyStyles(mergedTheme, size),
19
+ cssOverrides
20
+ ], href, onPress, className, isDisabled, ...props, children: [jsx(Icon, { size: iconSize, children: icon }), jsx("span", { css: topBarNavigationTextStyles(mergedTheme), children: text })] }) });
21
+ }
22
+
23
+ export { TopBarNavigation };
@@ -0,0 +1,68 @@
1
+ 'use strict';
2
+
3
+ var react = require('@emotion/react');
4
+ var TopBar = require('../../../styleD/build/typescript/component/TopBar.cjs');
5
+ var typography = require('../../../styleD/utils/semantic/typography.cjs');
6
+
7
+ const defaultTopBarNavigationTheme = TopBar.componentTopBar.Navigation;
8
+ const topBarNavigationStyles = (theme, selected) => {
9
+ return react.css`
10
+ display: ${theme.shared.display};
11
+ position: ${theme.shared.position};
12
+ align-items: ${theme.shared["align-items"]};
13
+ height: ${theme.shared.height};
14
+ padding: ${theme.shared.padding.top} ${theme.shared.padding.right}
15
+ ${theme.shared.padding.bottom} ${theme.shared.padding.left};
16
+ color: ${selected ? `${theme.selected.color}` : `${theme.unselected.color}`};
17
+ border-top: ${theme.shared["border-top"]};
18
+ border-bottom: ${theme.unselected["border-bottom"]};
19
+
20
+ &[data-hovered],
21
+ &:hover {
22
+ border-bottom: ${theme.selected["border-bottom"]};
23
+ cursor: ${theme.shared.cursor};
24
+ }
25
+
26
+ &[data-focus-visible],
27
+ &:focus-visible {
28
+ outline: ${theme.shared[":focus-visible"].outline};
29
+ border-bottom: ${theme.selected["border-bottom"]};
30
+ outline-offset: ${theme.shared[":focus-visible"]["outline-offset"]};
31
+ }
32
+
33
+ &[data-disabled] {
34
+ cursor: ${theme.shared[":disabled"].cursor};
35
+ color: ${theme.shared[":disabled"].color};
36
+ }
37
+
38
+ ${selected && `border-bottom: ${theme.selected["border-bottom"]};`}
39
+
40
+ text-decoration: ${theme.shared["text-decoration"]};
41
+ `;
42
+ };
43
+ const topBarNavigationDividerStyles = (theme, { alignment }) => react.css`
44
+ ${alignment === "left" ? "border-right" : "border-left"}: ${theme.shared.divider};
45
+ `;
46
+ const topBarNavigationTextStyles = (theme) => react.css`
47
+ margin-left: ${theme.text.margin.left};
48
+ `;
49
+ const topBarNavigationTypographyStyles = (theme, size) => {
50
+ return size == "md" ? react.css`
51
+ ${typography.convertTypographyToEmotionStringStyle(theme.md.typography)}
52
+ ` : react.css`
53
+ ${typography.convertTypographyToEmotionStringStyle(theme.sm.typography)}
54
+ `;
55
+ };
56
+ const topBarMenuIndicatorStyles = (theme) => {
57
+ return react.css`
58
+ margin-top: ${theme.menuIndicator.margin.top};
59
+ margin-left: ${theme.menuIndicator.margin.left};
60
+ `;
61
+ };
62
+
63
+ exports.defaultTopBarNavigationTheme = defaultTopBarNavigationTheme;
64
+ exports.topBarMenuIndicatorStyles = topBarMenuIndicatorStyles;
65
+ exports.topBarNavigationDividerStyles = topBarNavigationDividerStyles;
66
+ exports.topBarNavigationStyles = topBarNavigationStyles;
67
+ exports.topBarNavigationTextStyles = topBarNavigationTextStyles;
68
+ exports.topBarNavigationTypographyStyles = topBarNavigationTypographyStyles;
@@ -0,0 +1,61 @@
1
+ import { css } from '@emotion/react';
2
+ import { componentTopBar } from '../../../styleD/build/typescript/component/TopBar.js';
3
+ import { convertTypographyToEmotionStringStyle } from '../../../styleD/utils/semantic/typography.js';
4
+
5
+ const defaultTopBarNavigationTheme = componentTopBar.Navigation;
6
+ const topBarNavigationStyles = (theme, selected) => {
7
+ return css`
8
+ display: ${theme.shared.display};
9
+ position: ${theme.shared.position};
10
+ align-items: ${theme.shared["align-items"]};
11
+ height: ${theme.shared.height};
12
+ padding: ${theme.shared.padding.top} ${theme.shared.padding.right}
13
+ ${theme.shared.padding.bottom} ${theme.shared.padding.left};
14
+ color: ${selected ? `${theme.selected.color}` : `${theme.unselected.color}`};
15
+ border-top: ${theme.shared["border-top"]};
16
+ border-bottom: ${theme.unselected["border-bottom"]};
17
+
18
+ &[data-hovered],
19
+ &:hover {
20
+ border-bottom: ${theme.selected["border-bottom"]};
21
+ cursor: ${theme.shared.cursor};
22
+ }
23
+
24
+ &[data-focus-visible],
25
+ &:focus-visible {
26
+ outline: ${theme.shared[":focus-visible"].outline};
27
+ border-bottom: ${theme.selected["border-bottom"]};
28
+ outline-offset: ${theme.shared[":focus-visible"]["outline-offset"]};
29
+ }
30
+
31
+ &[data-disabled] {
32
+ cursor: ${theme.shared[":disabled"].cursor};
33
+ color: ${theme.shared[":disabled"].color};
34
+ }
35
+
36
+ ${selected && `border-bottom: ${theme.selected["border-bottom"]};`}
37
+
38
+ text-decoration: ${theme.shared["text-decoration"]};
39
+ `;
40
+ };
41
+ const topBarNavigationDividerStyles = (theme, { alignment }) => css`
42
+ ${alignment === "left" ? "border-right" : "border-left"}: ${theme.shared.divider};
43
+ `;
44
+ const topBarNavigationTextStyles = (theme) => css`
45
+ margin-left: ${theme.text.margin.left};
46
+ `;
47
+ const topBarNavigationTypographyStyles = (theme, size) => {
48
+ return size == "md" ? css`
49
+ ${convertTypographyToEmotionStringStyle(theme.md.typography)}
50
+ ` : css`
51
+ ${convertTypographyToEmotionStringStyle(theme.sm.typography)}
52
+ `;
53
+ };
54
+ const topBarMenuIndicatorStyles = (theme) => {
55
+ return css`
56
+ margin-top: ${theme.menuIndicator.margin.top};
57
+ margin-left: ${theme.menuIndicator.margin.left};
58
+ `;
59
+ };
60
+
61
+ export { defaultTopBarNavigationTheme, topBarMenuIndicatorStyles, topBarNavigationDividerStyles, topBarNavigationStyles, topBarNavigationTextStyles, topBarNavigationTypographyStyles };
@@ -4,6 +4,7 @@ var jsxRuntime = require('@emotion/react/jsx-runtime');
4
4
  var mergeDeep = require('../../../util/mergeDeep.cjs');
5
5
  var Favicon = require('../../favicon/Favicon.cjs');
6
6
  var Icon = require('../../icon/Icon.cjs');
7
+ var TopBarItem = require('../topBarItem/TopBarItem.cjs');
7
8
  var styles = require('./styles.cjs');
8
9
 
9
10
  const TopBarToolName = ({
@@ -15,7 +16,7 @@ const TopBarToolName = ({
15
16
  cssOverrides
16
17
  }) => {
17
18
  const mergedTheme = mergeDeep.mergeDeep(styles.defaultToolNameTheme, theme);
18
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { css: [styles.toolNameStyles(mergedTheme), cssOverrides], children: [
19
+ return /* @__PURE__ */ jsxRuntime.jsx(TopBarItem.TopBarItem, { alignment: "left", size: "sm", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { css: [styles.toolNameStyles(mergedTheme), cssOverrides], children: [
19
20
  /* @__PURE__ */ jsxRuntime.jsx(Favicon.Favicon, { ...favicon }),
20
21
  /* @__PURE__ */ jsxRuntime.jsx("div", { css: [styles.toolNameTypography(mergedTheme)], children: name }),
21
22
  subsection && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -25,7 +26,7 @@ const TopBarToolName = ({
25
26
  /* @__PURE__ */ jsxRuntime.jsx("div", { css: styles.subsectionTypography(mergedTheme), children: subsection })
26
27
  ] })
27
28
  ] })
28
- ] });
29
+ ] }) });
29
30
  };
30
31
 
31
32
  exports.TopBarToolName = TopBarToolName;
@@ -0,0 +1,13 @@
1
+ import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
2
+ import { mergeDeep } from '../../../util/mergeDeep.js';
3
+ import { Favicon } from '../../favicon/Favicon.js';
4
+ import { Icon } from '../../icon/Icon.js';
5
+ import { TopBarItem } from '../topBarItem/TopBarItem.js';
6
+ import { toolNameTypography, dividerStyles, subsectionTypography, subsectionStyles, toolNameStyles, defaultToolNameTheme } from './styles.js';
7
+
8
+ const TopBarToolName = ({ name, favicon, subsection, subsectionIcon, theme = {}, cssOverrides }) => {
9
+ const mergedTheme = mergeDeep(defaultToolNameTheme, theme);
10
+ return jsx(TopBarItem, { alignment: "left", size: "sm", children: jsxs("div", { css: [toolNameStyles(mergedTheme), cssOverrides], children: [jsx(Favicon, { ...favicon }), jsx("div", { css: [toolNameTypography(mergedTheme)], children: name }), subsection && jsxs(Fragment, { children: [jsx("div", { css: dividerStyles(mergedTheme), children: "\xA0" }), jsxs("div", { css: subsectionStyles(mergedTheme), children: [subsectionIcon && jsx(Icon, { size: "sm", children: subsectionIcon }), jsx("div", { css: subsectionTypography(mergedTheme), children: subsection })] })] })] }) });
11
+ };
12
+
13
+ export { TopBarToolName };
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 inlineMessage = require('./styleD/build/typescript/component/inlineMessage.cjs');
12
13
  var menu = require('./styleD/build/typescript/component/menu.cjs');
13
14
  var TopBar = require('./styleD/build/typescript/component/TopBar.cjs');
14
15
  var colors = require('./styleD/build/typescript/base/colors.cjs');
@@ -32,6 +33,7 @@ exports.componentButton = button.componentButton;
32
33
  exports.componentTypography = typography$1.componentTypography;
33
34
  exports.componentIcon = icon.componentIcon;
34
35
  exports.componentFavicon = favicon.componentFavicon;
36
+ exports.componentInlineMessage = inlineMessage.componentInlineMessage;
35
37
  exports.componentMenu = menu.componentMenu;
36
38
  exports.componentTopBar = TopBar.componentTopBar;
37
39
  exports.baseColors = colors.baseColors;
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 { componentInlineMessage } from './styleD/build/typescript/component/inlineMessage.js';
10
11
  export { componentMenu } from './styleD/build/typescript/component/menu.js';
11
12
  export { componentTopBar } from './styleD/build/typescript/component/TopBar.js';
12
13
  export { baseColors } from './styleD/build/typescript/base/colors.js';
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var InlineMessage = require('./components/inline-message/InlineMessage.cjs');
4
+ var inlineMessage = require('./styleD/build/typescript/component/inlineMessage.cjs');
5
+
6
+
7
+
8
+ exports.InlineMessage = InlineMessage.InlineMessage;
9
+ exports.componentInlineMessage = inlineMessage.componentInlineMessage;
@@ -0,0 +1,2 @@
1
+ export { InlineMessage } from './components/inline-message/InlineMessage.js';
2
+ export { componentInlineMessage } from './styleD/build/typescript/component/inlineMessage.js';
@@ -29,9 +29,9 @@
29
29
  --base-typography-size-36-rem: 2.25rem;
30
30
  --base-typography-size-42-rem: 2.625rem;
31
31
  --base-typography-size-48-rem: 3rem;
32
- --base-typography-weight-guardian-headline-bold: 700;
33
32
  --base-typography-weight-guardian-text-egyptian-normal: 400;
34
33
  --base-typography-weight-guardian-text-egyptian-bold: 700;
34
+ --base-typography-weight-guardian-headline-bold: 700;
35
35
  --base-typography-weight-open-sans-light: 340;
36
36
  --base-typography-weight-open-sans-normal: 460;
37
37
  --base-typography-weight-open-sans-semi-bold: 600;
@@ -51,9 +51,9 @@
51
51
  --base-typography-letter-spacing-densest-px: -1px;
52
52
  --base-typography-letter-spacing-denser-px: -0.5px;
53
53
  --base-typography-letter-spacing-dense-px: -0.2px;
54
- --base-typography-letter-spacing-default-px: 0px;
54
+ --base-typography-letter-spacing-default-px: 0;
55
55
  --base-typography-letter-spacing-densest-rem: -0.0625rem;
56
56
  --base-typography-letter-spacing-denser-rem: -0.03125rem;
57
57
  --base-typography-letter-spacing-dense-rem: -0.0125rem;
58
- --base-typography-letter-spacing-default-rem: 0rem;
58
+ --base-typography-letter-spacing-default-rem: 0;
59
59
  }
@@ -3,12 +3,66 @@
3
3
  */
4
4
 
5
5
  :root {
6
+ --component-top-bar-background-color: #f6f6f6;
7
+ --component-top-bar-display: flex;
8
+ --component-top-bar-height: 4rem;
9
+ --component-top-bar-justify-content: space-between;
10
+ --component-top-bar-border: 0.0625rem solid #cccccc;
11
+ --component-top-bar-item-display: flex;
12
+ --component-top-bar-item-align-items: center;
13
+ --component-top-bar-item-height: 100%;
14
+ --component-top-bar-item-sm-padding-top: 0;
15
+ --component-top-bar-item-sm-padding-right: 0.75rem;
16
+ --component-top-bar-item-sm-padding-bottom: 0;
17
+ --component-top-bar-item-sm-padding-left: 0.75rem;
18
+ --component-top-bar-item-md-padding-top: 0;
19
+ --component-top-bar-item-md-padding-right: 1rem;
20
+ --component-top-bar-item-md-padding-bottom: 0;
21
+ --component-top-bar-item-md-padding-left: 1rem;
22
+ --component-top-bar-item-lg-padding-top: 0;
23
+ --component-top-bar-item-lg-padding-right: 1.5rem;
24
+ --component-top-bar-item-lg-padding-bottom: 0;
25
+ --component-top-bar-item-lg-padding-left: 1.5rem;
26
+ --component-top-bar-item-border: 0.0625rem solid #cccccc;
27
+ --component-top-bar-navigation-shared-display: inline-flex;
28
+ --component-top-bar-navigation-shared-position: relative;
29
+ --component-top-bar-navigation-shared-align-items: center;
30
+ --component-top-bar-navigation-shared-cursor: pointer;
31
+ --component-top-bar-navigation-shared-text-decoration: none;
32
+ --component-top-bar-navigation-shared-height: 100%;
33
+ --component-top-bar-navigation-shared-disabled-cursor: not-allowed;
34
+ --component-top-bar-navigation-shared-disabled-color: #999999;
35
+ --component-top-bar-navigation-shared-padding-top: 0;
36
+ --component-top-bar-navigation-shared-padding-right: 1rem;
37
+ --component-top-bar-navigation-shared-padding-bottom: 0;
38
+ --component-top-bar-navigation-shared-padding-left: 1rem;
39
+ --component-top-bar-navigation-shared-focus-visible-outline: 0.125rem solid
40
+ #0072a9;
41
+ --component-top-bar-navigation-shared-focus-visible-outline-offset: -0.0625rem;
42
+ --component-top-bar-navigation-shared-border-top: 0.5rem solid transparent;
43
+ --component-top-bar-navigation-shared-divider: 0.0625rem solid #cccccc;
44
+ --component-top-bar-navigation-text-margin-left: 0.375rem;
45
+ --component-top-bar-navigation-menu-indicator-margin-top: 0.375rem;
46
+ --component-top-bar-navigation-menu-indicator-margin-left: 0.125rem;
47
+ --component-top-bar-navigation-selected-color: #000000;
48
+ --component-top-bar-navigation-selected-border-bottom: 0.5rem solid #0072a9;
49
+ --component-top-bar-navigation-unselected-color: #545454;
50
+ --component-top-bar-navigation-unselected-border-bottom: 0.5rem solid
51
+ transparent;
52
+ --component-top-bar-navigation-md-typography-font: normal 700 1rem/1.15
53
+ 'Open Sans';
54
+ --component-top-bar-navigation-md-typography-letter-spacing: -0.03125rem;
55
+ --component-top-bar-navigation-md-typography-font-width: 95;
56
+ --component-top-bar-navigation-sm-typography-font: normal 700 0.875rem/1.15
57
+ 'Open Sans';
58
+ --component-top-bar-navigation-sm-typography-letter-spacing: -0.0125rem;
59
+ --component-top-bar-navigation-sm-typography-font-width: 95;
6
60
  --component-top-bar-tool-name-display: flex;
7
61
  --component-top-bar-tool-name-align-items: center;
8
62
  --component-top-bar-tool-name-gap: 8px;
9
63
  --component-top-bar-tool-name-typography-font: normal 700 1.25rem/1.15
10
64
  'GH Guardian Headline';
11
- --component-top-bar-tool-name-typography-letter-spacing: 0rem;
65
+ --component-top-bar-tool-name-typography-letter-spacing: 0;
12
66
  --component-top-bar-tool-name-typography-font-width: 100;
13
67
  --component-top-bar-tool-name-divider-border: 0.0625rem solid #cccccc;
14
68
  --component-top-bar-tool-name-divider-height: 2rem;