@guardian/stand 0.0.15 → 0.0.17

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 (130) 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/components/avatar/Avatar.cjs +2 -2
  5. package/dist/components/button/Button.cjs +1 -1
  6. package/dist/components/button/Button.js +1 -1
  7. package/dist/components/button/styles.cjs +7 -4
  8. package/dist/components/button/styles.js +7 -4
  9. package/dist/components/byline/Byline.cjs +15 -15
  10. package/dist/components/favicon/Favicon.cjs +2 -2
  11. package/dist/components/icon-button/IconButton.cjs +4 -4
  12. package/dist/components/icon-button/IconButton.js +1 -1
  13. package/dist/components/icon-link-button/IconLinkButton.cjs +4 -4
  14. package/dist/components/icon-link-button/IconLinkButton.js +1 -1
  15. package/dist/components/link-button/LinkButton.cjs +1 -1
  16. package/dist/components/link-button/LinkButton.js +1 -1
  17. package/dist/components/menu/Menu.cjs +204 -0
  18. package/dist/components/menu/Menu.js +77 -0
  19. package/dist/components/menu/styles.cjs +104 -0
  20. package/dist/components/menu/styles.js +89 -0
  21. package/dist/components/tag-picker/TagTable.cjs +11 -11
  22. package/dist/components/topbar/TopBar.cjs +101 -0
  23. package/dist/components/topbar/TopBar.js +63 -0
  24. package/dist/components/topbar/styles.cjs +30 -0
  25. package/dist/components/topbar/styles.js +25 -0
  26. package/dist/components/topbar/topBarItem/TopBarItem.cjs +28 -0
  27. package/dist/components/topbar/topBarItem/TopBarItem.js +10 -0
  28. package/dist/components/topbar/topBarItem/styles.cjs +20 -0
  29. package/dist/components/topbar/topBarItem/styles.js +17 -0
  30. package/dist/components/topbar/topBarNavigation/TopBarNavigation.cjs +70 -0
  31. package/dist/components/topbar/topBarNavigation/TopBarNavigation.js +23 -0
  32. package/dist/components/topbar/topBarNavigation/styles.cjs +68 -0
  33. package/dist/components/topbar/topBarNavigation/styles.js +61 -0
  34. package/dist/components/topbar/{toolName → topBarToolName}/TopBarToolName.cjs +3 -2
  35. package/dist/components/topbar/topBarToolName/TopBarToolName.js +13 -0
  36. package/dist/index.cjs +4 -0
  37. package/dist/index.js +2 -0
  38. package/dist/menu.cjs +13 -0
  39. package/dist/menu.js +2 -0
  40. package/dist/styleD/build/css/base/typography.css +3 -3
  41. package/dist/styleD/build/css/component/TopBar.css +55 -1
  42. package/dist/styleD/build/css/component/avatar.css +1 -1
  43. package/dist/styleD/build/css/component/button.css +177 -255
  44. package/dist/styleD/build/css/component/favicon.css +1 -1
  45. package/dist/styleD/build/css/component/menu.css +83 -0
  46. package/dist/styleD/build/css/component/tagAutocomplete.css +1 -1
  47. package/dist/styleD/build/css/component/tagTable.css +1 -1
  48. package/dist/styleD/build/css/component/topBarItem.css +7 -0
  49. package/dist/styleD/build/css/component/userMenu.css +6 -6
  50. package/dist/styleD/build/css/semantic/colors.css +45 -46
  51. package/dist/styleD/build/css/semantic/shadow.css +7 -0
  52. package/dist/styleD/build/css/semantic/sizing.css +1 -0
  53. package/dist/styleD/build/css/semantic/typography.css +30 -30
  54. package/dist/styleD/build/typescript/base/typography.cjs +3 -3
  55. package/dist/styleD/build/typescript/base/typography.js +3 -3
  56. package/dist/styleD/build/typescript/component/TopBar.cjs +94 -0
  57. package/dist/styleD/build/typescript/component/TopBar.js +94 -0
  58. package/dist/styleD/build/typescript/component/button.cjs +5 -130
  59. package/dist/styleD/build/typescript/component/button.js +5 -130
  60. package/dist/styleD/build/typescript/component/menu.cjs +141 -0
  61. package/dist/styleD/build/typescript/component/menu.js +139 -0
  62. package/dist/styleD/build/typescript/semantic/colors.cjs +47 -52
  63. package/dist/styleD/build/typescript/semantic/colors.js +47 -52
  64. package/dist/styleD/build/typescript/semantic/shadow.cjs +7 -0
  65. package/dist/styleD/build/typescript/semantic/shadow.js +5 -0
  66. package/dist/styleD/build/typescript/semantic/sizing.cjs +1 -0
  67. package/dist/styleD/build/typescript/semantic/sizing.js +1 -0
  68. package/dist/types/TopBar.d.ts +12 -3
  69. package/dist/types/avatar.d.ts +1 -1
  70. package/dist/types/button.d.ts +1 -1
  71. package/dist/types/byline.d.ts +1 -1
  72. package/dist/types/components/avatar/styles.d.ts +2 -1
  73. package/dist/types/components/button/sandbox.d.ts +4 -4
  74. package/dist/types/components/button/styles.d.ts +2 -1
  75. package/dist/types/components/button/types.d.ts +1 -1
  76. package/dist/types/components/favicon/styles.d.ts +2 -1
  77. package/dist/types/components/icon/styles.d.ts +2 -1
  78. package/dist/types/components/icon-button/sandbox.d.ts +4 -4
  79. package/dist/types/components/icon-button/styles.d.ts +5 -129
  80. package/dist/types/components/icon-button/types.d.ts +1 -1
  81. package/dist/types/components/icon-link-button/sandbox.d.ts +4 -4
  82. package/dist/types/components/icon-link-button/styles.d.ts +5 -129
  83. package/dist/types/components/icon-link-button/types.d.ts +1 -1
  84. package/dist/types/components/link-button/sandbox.d.ts +4 -4
  85. package/dist/types/components/link-button/styles.d.ts +5 -129
  86. package/dist/types/components/link-button/types.d.ts +1 -1
  87. package/dist/types/components/menu/Menu.d.ts +7 -0
  88. package/dist/types/components/menu/sandbox.d.ts +5 -0
  89. package/dist/types/components/menu/styles.d.ts +28 -0
  90. package/dist/types/components/menu/types.d.ts +63 -0
  91. package/dist/types/components/topbar/TopBar.d.ts +8 -0
  92. package/dist/types/components/topbar/sandbox.d.ts +5 -0
  93. package/dist/types/components/topbar/styles.d.ts +9 -0
  94. package/dist/types/components/topbar/topBarItem/TopBarItem.d.ts +2 -0
  95. package/dist/types/components/topbar/topBarItem/sandbox.d.ts +5 -0
  96. package/dist/types/components/topbar/topBarItem/styles.d.ts +8 -0
  97. package/dist/types/components/topbar/topBarItem/types.d.ts +14 -0
  98. package/dist/types/components/topbar/topBarNavigation/TopBarNavigation.d.ts +2 -0
  99. package/dist/types/components/topbar/topBarNavigation/sandbox.d.ts +5 -0
  100. package/dist/types/components/topbar/topBarNavigation/styles.d.ts +12 -0
  101. package/dist/types/components/topbar/topBarNavigation/types.d.ts +44 -0
  102. package/dist/types/components/topbar/{toolName → topBarToolName}/styles.d.ts +2 -1
  103. package/dist/types/components/topbar/types.d.ts +3 -0
  104. package/dist/types/components/typography/styles.d.ts +2 -1
  105. package/dist/types/favicon.d.ts +1 -1
  106. package/dist/types/icon-button.d.ts +1 -1
  107. package/dist/types/icon-link-button.d.ts +1 -1
  108. package/dist/types/icon.d.ts +1 -1
  109. package/dist/types/index.d.ts +4 -0
  110. package/dist/types/link-button.d.ts +1 -1
  111. package/dist/types/menu.d.ts +21 -0
  112. package/dist/types/styleD/build/typescript/base/typography.d.ts +3 -3
  113. package/dist/types/styleD/build/typescript/component/TopBar.d.ts +94 -0
  114. package/dist/types/styleD/build/typescript/component/button.d.ts +3 -128
  115. package/dist/types/styleD/build/typescript/component/menu.d.ts +141 -0
  116. package/dist/types/styleD/build/typescript/semantic/colors.d.ts +44 -49
  117. package/dist/types/styleD/build/typescript/semantic/shadow.d.ts +7 -0
  118. package/dist/types/styleD/build/typescript/semantic/sizing.d.ts +1 -0
  119. package/dist/types/styleD/stories/semantic/Shadow.d.ts +1 -0
  120. package/dist/types/typography.d.ts +1 -1
  121. package/dist/util/css/reset.css +10 -0
  122. package/dist/util/reset.css.cjs +1 -1
  123. package/dist/util/reset.css.js +1 -1
  124. package/package.json +30 -17
  125. package/dist/components/topbar/toolName/TopBarToolName.js +0 -12
  126. /package/dist/components/topbar/{toolName → topBarToolName}/styles.cjs +0 -0
  127. /package/dist/components/topbar/{toolName → topBarToolName}/styles.js +0 -0
  128. /package/dist/types/components/topbar/{toolName → topBarToolName}/TopBarToolName.d.ts +0 -0
  129. /package/dist/types/components/topbar/{toolName → topBarToolName}/sandbox.d.ts +0 -0
  130. /package/dist/types/components/topbar/{toolName → topBarToolName}/types.d.ts +0 -0
@@ -0,0 +1,104 @@
1
+ 'use strict';
2
+
3
+ var react = require('@emotion/react');
4
+ var menu = require('../../styleD/build/typescript/component/menu.cjs');
5
+ var typography = require('../../styleD/utils/semantic/typography.cjs');
6
+
7
+ const defaultMenuTheme = menu.componentMenu.menu;
8
+ const menuStyles = (theme) => react.css`
9
+ display: ${theme.shared.display};
10
+ flex-direction: ${theme.shared["flex-direction"]};
11
+ border: ${theme.shared.border};
12
+ background: ${theme.shared["background-color"]};
13
+ `;
14
+ const defaultMenuSectionTheme = menu.componentMenu.menuSection;
15
+ const menuSectionHeaderStyles = (theme, { size }) => react.css`
16
+ display: ${theme.header.shared.display};
17
+ align-items: ${theme.header.shared["align-items"]};
18
+ padding: ${theme.header.shared.padding.top}
19
+ ${theme.header.shared.padding.right} ${theme.header.shared.padding.bottom}
20
+ ${theme.header.shared.padding.left};
21
+ height: ${theme.header[size].height};
22
+ background: ${theme.header.shared["background-color"]};
23
+ color: ${theme.header.shared.color};
24
+ ${typography.convertTypographyToEmotionStringStyle(theme.header[size].typography)}
25
+ `;
26
+ const defaultMenuItemTheme = menu.componentMenu.menuItem;
27
+ const menuItemStyles = (theme, { description }, isFocusVisible = false) => react.css`
28
+ display: ${theme.shared.display};
29
+ grid-template-columns: ${theme.shared["grid-template-columns"]};
30
+ grid-template-areas: ${description ? theme.shared["grid-template-areas-with-description"] : theme.shared["grid-template-areas"]};
31
+ gap: ${theme.shared.gap};
32
+ align-items: ${theme.shared["align-items"]};
33
+ padding: ${theme.shared.padding.top} ${theme.shared.padding.right}
34
+ ${theme.shared.padding.bottom} ${theme.shared.padding.left};
35
+ border-bottom: ${theme.shared["border-bottom"]};
36
+ background: ${theme.shared["background-color"]};
37
+ &:last-child {
38
+ border-bottom: ${theme.shared[":last-child"]["border-bottom"]};
39
+ }
40
+ &[data-hovered],
41
+ &:hover {
42
+ background: ${theme.shared[":hover"]["background-color"]};
43
+ }
44
+ ${isFocusVisible ? react.css`
45
+ outline: ${theme.shared[":focus-visible"]["outline"]};
46
+ outline-offset: ${theme.shared[":focus-visible"]["outline-offset"]};
47
+ background: ${theme.shared[":hover"]["background-color"]};
48
+ ` : react.css`
49
+ outline: none;
50
+ `}
51
+ `;
52
+ const menuItemIconStyles = (theme, { size }) => react.css`
53
+ grid-area: ${theme.shared.icon["grid-area"]};
54
+ align-self: ${theme.shared.icon["align-self"]};
55
+ color: ${theme.shared.icon.color};
56
+ /* Ensure the line-height matches the font line-height of the label for alignment */
57
+ line-height: ${theme[size].icon["line-height"]};
58
+ `;
59
+ const menuItemLabelStyles = (theme) => react.css`
60
+ grid-area: ${theme.shared.label["grid-area"]};
61
+ color: ${theme.shared.label.color};
62
+ ${typography.convertTypographyToEmotionStringStyle(theme.shared.label.typography)}
63
+ )}
64
+ `;
65
+ const menuItemDescriptionStyles = (theme) => react.css`
66
+ grid-area: ${theme.shared.description["grid-area"]};
67
+ color: ${theme.shared.description.color};
68
+ ${typography.convertTypographyToEmotionStringStyle(theme.shared.description.typography)}
69
+ `;
70
+ const menuItemAsideStyles = (theme) => react.css`
71
+ grid-area: ${theme.shared.aside["grid-area"]};
72
+ justify-self: ${theme.shared.aside["justify-self"]};
73
+ align-self: ${theme.shared.aside["align-self"]};
74
+ color: ${theme.shared.aside.color};
75
+ ${typography.convertTypographyToEmotionStringStyle(theme.shared.aside.typography)}
76
+ `;
77
+ const defaultMenuSeparatorTheme = menu.componentMenu.menuSeparator;
78
+ const menuSeparatorStyles = (theme) => react.css`
79
+ background-color: ${theme.shared["background-color"]};
80
+ height: ${theme.shared.height};
81
+ width: ${theme.shared.width};
82
+ `;
83
+ const defaultMenuPopoverTheme = menu.componentMenu.menuPopover;
84
+ const menuPopoverStyles = (theme, { size }) => react.css`
85
+ overflow: ${theme.shared.overflow};
86
+ max-width: ${theme[size]["max-width"]};
87
+ width: ${theme[size].width};
88
+ box-shadow: ${theme.shared.shadow};
89
+ `;
90
+
91
+ exports.defaultMenuItemTheme = defaultMenuItemTheme;
92
+ exports.defaultMenuPopoverTheme = defaultMenuPopoverTheme;
93
+ exports.defaultMenuSectionTheme = defaultMenuSectionTheme;
94
+ exports.defaultMenuSeparatorTheme = defaultMenuSeparatorTheme;
95
+ exports.defaultMenuTheme = defaultMenuTheme;
96
+ exports.menuItemAsideStyles = menuItemAsideStyles;
97
+ exports.menuItemDescriptionStyles = menuItemDescriptionStyles;
98
+ exports.menuItemIconStyles = menuItemIconStyles;
99
+ exports.menuItemLabelStyles = menuItemLabelStyles;
100
+ exports.menuItemStyles = menuItemStyles;
101
+ exports.menuPopoverStyles = menuPopoverStyles;
102
+ exports.menuSectionHeaderStyles = menuSectionHeaderStyles;
103
+ exports.menuSeparatorStyles = menuSeparatorStyles;
104
+ exports.menuStyles = menuStyles;
@@ -0,0 +1,89 @@
1
+ import { css } from '@emotion/react';
2
+ import { componentMenu } from '../../styleD/build/typescript/component/menu.js';
3
+ import { convertTypographyToEmotionStringStyle } from '../../styleD/utils/semantic/typography.js';
4
+
5
+ const defaultMenuTheme = componentMenu.menu;
6
+ const menuStyles = (theme) => css`
7
+ display: ${theme.shared.display};
8
+ flex-direction: ${theme.shared["flex-direction"]};
9
+ border: ${theme.shared.border};
10
+ background: ${theme.shared["background-color"]};
11
+ `;
12
+ const defaultMenuSectionTheme = componentMenu.menuSection;
13
+ const menuSectionHeaderStyles = (theme, { size }) => css`
14
+ display: ${theme.header.shared.display};
15
+ align-items: ${theme.header.shared["align-items"]};
16
+ padding: ${theme.header.shared.padding.top}
17
+ ${theme.header.shared.padding.right} ${theme.header.shared.padding.bottom}
18
+ ${theme.header.shared.padding.left};
19
+ height: ${theme.header[size].height};
20
+ background: ${theme.header.shared["background-color"]};
21
+ color: ${theme.header.shared.color};
22
+ ${convertTypographyToEmotionStringStyle(theme.header[size].typography)}
23
+ `;
24
+ const defaultMenuItemTheme = componentMenu.menuItem;
25
+ const menuItemStyles = (theme, { description }, isFocusVisible = false) => css`
26
+ display: ${theme.shared.display};
27
+ grid-template-columns: ${theme.shared["grid-template-columns"]};
28
+ grid-template-areas: ${description ? theme.shared["grid-template-areas-with-description"] : theme.shared["grid-template-areas"]};
29
+ gap: ${theme.shared.gap};
30
+ align-items: ${theme.shared["align-items"]};
31
+ padding: ${theme.shared.padding.top} ${theme.shared.padding.right}
32
+ ${theme.shared.padding.bottom} ${theme.shared.padding.left};
33
+ border-bottom: ${theme.shared["border-bottom"]};
34
+ background: ${theme.shared["background-color"]};
35
+ &:last-child {
36
+ border-bottom: ${theme.shared[":last-child"]["border-bottom"]};
37
+ }
38
+ &[data-hovered],
39
+ &:hover {
40
+ background: ${theme.shared[":hover"]["background-color"]};
41
+ }
42
+ ${isFocusVisible ? css`
43
+ outline: ${theme.shared[":focus-visible"]["outline"]};
44
+ outline-offset: ${theme.shared[":focus-visible"]["outline-offset"]};
45
+ background: ${theme.shared[":hover"]["background-color"]};
46
+ ` : css`
47
+ outline: none;
48
+ `}
49
+ `;
50
+ const menuItemIconStyles = (theme, { size }) => css`
51
+ grid-area: ${theme.shared.icon["grid-area"]};
52
+ align-self: ${theme.shared.icon["align-self"]};
53
+ color: ${theme.shared.icon.color};
54
+ /* Ensure the line-height matches the font line-height of the label for alignment */
55
+ line-height: ${theme[size].icon["line-height"]};
56
+ `;
57
+ const menuItemLabelStyles = (theme) => css`
58
+ grid-area: ${theme.shared.label["grid-area"]};
59
+ color: ${theme.shared.label.color};
60
+ ${convertTypographyToEmotionStringStyle(theme.shared.label.typography)}
61
+ )}
62
+ `;
63
+ const menuItemDescriptionStyles = (theme) => css`
64
+ grid-area: ${theme.shared.description["grid-area"]};
65
+ color: ${theme.shared.description.color};
66
+ ${convertTypographyToEmotionStringStyle(theme.shared.description.typography)}
67
+ `;
68
+ const menuItemAsideStyles = (theme) => css`
69
+ grid-area: ${theme.shared.aside["grid-area"]};
70
+ justify-self: ${theme.shared.aside["justify-self"]};
71
+ align-self: ${theme.shared.aside["align-self"]};
72
+ color: ${theme.shared.aside.color};
73
+ ${convertTypographyToEmotionStringStyle(theme.shared.aside.typography)}
74
+ `;
75
+ const defaultMenuSeparatorTheme = componentMenu.menuSeparator;
76
+ const menuSeparatorStyles = (theme) => css`
77
+ background-color: ${theme.shared["background-color"]};
78
+ height: ${theme.shared.height};
79
+ width: ${theme.shared.width};
80
+ `;
81
+ const defaultMenuPopoverTheme = componentMenu.menuPopover;
82
+ const menuPopoverStyles = (theme, { size }) => css`
83
+ overflow: ${theme.shared.overflow};
84
+ max-width: ${theme[size]["max-width"]};
85
+ width: ${theme[size].width};
86
+ box-shadow: ${theme.shared.shadow};
87
+ `;
88
+
89
+ export { defaultMenuItemTheme, defaultMenuPopoverTheme, defaultMenuSectionTheme, defaultMenuSeparatorTheme, defaultMenuTheme, menuItemAsideStyles, menuItemDescriptionStyles, menuItemIconStyles, menuItemLabelStyles, menuItemStyles, menuPopoverStyles, menuSectionHeaderStyles, menuSeparatorStyles, menuStyles };
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('@emotion/react/jsx-runtime');
4
- var react$1 = require('@emotion/react');
5
- var react = require('react');
4
+ var react = require('@emotion/react');
5
+ var React = require('react');
6
6
  var reactAriaComponents = require('react-aria-components');
7
7
  var styles = require('./styles.cjs');
8
8
 
@@ -28,10 +28,10 @@ function TagTable({
28
28
  cssOverrides
29
29
  }) {
30
30
  const canDrag = !!onReorder;
31
- const [localRows, setLocalRows] = react.useState(() => [...rows]);
32
- const localRowsRef = react.useRef(localRows);
31
+ const [localRows, setLocalRows] = React.useState(() => [...rows]);
32
+ const localRowsRef = React.useRef(localRows);
33
33
  localRowsRef.current = localRows;
34
- react.useEffect(() => {
34
+ React.useEffect(() => {
35
35
  setLocalRows([...rows]);
36
36
  }, [rows]);
37
37
  const filtered = localRows.filter(filterRows);
@@ -99,7 +99,7 @@ function TagTable({
99
99
  reactAriaComponents.Cell,
100
100
  {
101
101
  css: [
102
- react$1.css`
102
+ react.css`
103
103
  width: 1%;
104
104
  `
105
105
  ],
@@ -111,7 +111,7 @@ function TagTable({
111
111
  {
112
112
  css: [
113
113
  styles.tagTableCellStyles(theme),
114
- react$1.css`
114
+ react.css`
115
115
  position: relative;
116
116
  width: 15%;
117
117
  `
@@ -124,7 +124,7 @@ function TagTable({
124
124
  {
125
125
  css: [
126
126
  styles.tagTableCellStyles(theme),
127
- react$1.css`
127
+ react.css`
128
128
  width: 50%;
129
129
  `
130
130
  ],
@@ -137,7 +137,7 @@ function TagTable({
137
137
  {
138
138
  css: [
139
139
  styles.tagTableCellStyles(theme),
140
- react$1.css`
140
+ react.css`
141
141
  width: 20%;
142
142
  `
143
143
  ],
@@ -149,7 +149,7 @@ function TagTable({
149
149
  {
150
150
  css: [
151
151
  styles.tagTableCellStyles(theme),
152
- react$1.css`
152
+ react.css`
153
153
  text-align: center;
154
154
  width: 10%;
155
155
  `
@@ -172,7 +172,7 @@ function TagTable({
172
172
  {
173
173
  css: [
174
174
  styles.tagTableCellStyles(theme),
175
- react$1.css`
175
+ react.css`
176
176
  text-align: center;
177
177
  width: 10%;
178
178
  `
@@ -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;
@@ -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 };