@guardian/stand 0.0.20 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/menu/Menu.cjs +1 -7
- package/dist/components/menu/Menu.js +1 -9
- package/dist/components/menu/styles.cjs +25 -11
- package/dist/components/menu/styles.js +25 -11
- package/dist/components/text-input/TextInput.cjs +28 -0
- package/dist/components/text-input/TextInput.js +12 -0
- package/dist/components/text-input/styles.cjs +35 -0
- package/dist/components/text-input/styles.js +32 -0
- package/dist/components/topbar/topBarToolName/TopBarToolName.cjs +21 -2
- package/dist/components/topbar/topBarToolName/TopBarToolName.js +11 -3
- package/dist/components/topbar/topBarToolName/styles.cjs +39 -0
- package/dist/components/topbar/topBarToolName/styles.js +38 -1
- package/dist/index.cjs +2 -0
- package/dist/index.js +1 -0
- package/dist/styleD/build/css/component/TopBar.css +22 -0
- package/dist/styleD/build/css/component/menu.css +2 -0
- package/dist/styleD/build/css/component/textInput.css +29 -0
- package/dist/styleD/build/css/semantic/typography.css +88 -0
- package/dist/styleD/build/typescript/component/TopBar.cjs +32 -0
- package/dist/styleD/build/typescript/component/TopBar.js +32 -0
- package/dist/styleD/build/typescript/component/menu.cjs +5 -1
- package/dist/styleD/build/typescript/component/menu.js +5 -1
- package/dist/styleD/build/typescript/component/textInput.cjs +45 -0
- package/dist/styleD/build/typescript/component/textInput.js +43 -0
- package/dist/styleD/build/typescript/semantic/typography.cjs +120 -0
- package/dist/styleD/build/typescript/semantic/typography.js +120 -0
- package/dist/text-input.cjs +9 -0
- package/dist/text-input.js +2 -0
- package/dist/types/TopBar.d.ts +1 -0
- package/dist/types/components/menu/styles.d.ts +1 -1
- package/dist/types/components/text-input/TextInput.d.ts +2 -0
- package/dist/types/components/text-input/sandbox.d.ts +5 -0
- package/dist/types/components/text-input/styles.d.ts +7 -0
- package/dist/types/components/text-input/types.d.ts +4 -0
- package/dist/types/components/topbar/topBarToolName/TopBarToolName.d.ts +1 -1
- package/dist/types/components/topbar/topBarToolName/styles.d.ts +2 -0
- package/dist/types/components/topbar/topBarToolName/types.d.ts +7 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/menu.d.ts +0 -1
- package/dist/types/styleD/build/typescript/component/TopBar.d.ts +32 -0
- package/dist/types/styleD/build/typescript/component/menu.d.ts +4 -0
- package/dist/types/styleD/build/typescript/component/textInput.d.ts +45 -0
- package/dist/types/styleD/build/typescript/semantic/typography.d.ts +120 -0
- package/dist/types/text-input.d.ts +20 -0
- package/package.json +11 -7
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
4
|
-
var focus = require('@react-aria/focus');
|
|
5
4
|
var React = require('react');
|
|
6
5
|
var reactAriaComponents = require('react-aria-components');
|
|
7
6
|
var mergeDeep = require('../../util/mergeDeep.cjs');
|
|
@@ -83,15 +82,10 @@ function MenuItem({
|
|
|
83
82
|
}) {
|
|
84
83
|
const mergedTheme = mergeDeep.mergeDeep(styles.defaultMenuItemTheme, theme);
|
|
85
84
|
const textValue = props.textValue ?? (typeof label === "string" ? label : void 0);
|
|
86
|
-
const { isFocusVisible, focusProps } = focus.useFocusRing();
|
|
87
85
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
88
86
|
reactAriaComponents.MenuItem,
|
|
89
87
|
{
|
|
90
|
-
|
|
91
|
-
css: [
|
|
92
|
-
styles.menuItemStyles(mergedTheme, { description }, isFocusVisible),
|
|
93
|
-
cssOverrides
|
|
94
|
-
],
|
|
88
|
+
css: [styles.menuItemStyles(mergedTheme, { description }), cssOverrides],
|
|
95
89
|
...props,
|
|
96
90
|
textValue,
|
|
97
91
|
children: ({ isSelected, selectionMode }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from '@emotion/react/jsx-runtime';
|
|
2
|
-
import { useFocusRing } from '@react-aria/focus';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import { MenuTrigger, Menu as Menu$1, MenuItem as MenuItem$1, MenuSection as MenuSection$1, Header, Separator, Popover as Popover$1 } from 'react-aria-components';
|
|
5
4
|
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
@@ -36,14 +35,7 @@ function MenuSection({ name, size = "md", theme = {}, cssOverrides, children, ..
|
|
|
36
35
|
function MenuItem({ label, description, aside, icon, size = "md", theme = {}, cssOverrides, ...props }) {
|
|
37
36
|
const mergedTheme = mergeDeep(defaultMenuItemTheme, theme);
|
|
38
37
|
const textValue = props.textValue ?? (typeof label === "string" ? label : void 0);
|
|
39
|
-
|
|
40
|
-
return jsx(
|
|
41
|
-
MenuItem$1,
|
|
42
|
-
{ ...focusProps, css: [
|
|
43
|
-
menuItemStyles(mergedTheme, { description }, isFocusVisible),
|
|
44
|
-
cssOverrides
|
|
45
|
-
], ...props, textValue, children: ({ isSelected, selectionMode }) => jsxs(Fragment, { children: [icon && selectionMode === "none" ? jsx(Icon, { size, cssOverrides: menuItemIconStyles(mergedTheme, { size }), children: icon }) : null, isSelected && selectionMode === "multiple" ? jsx(Icon, { size, symbol: "check_box", cssOverrides: menuItemIconStyles(mergedTheme, { size }) }) : null, !isSelected && selectionMode === "multiple" ? jsx(Icon, { size, symbol: "check_box_outline_blank", cssOverrides: menuItemIconStyles(mergedTheme, { size }) }) : null, isSelected && selectionMode === "single" ? jsx(Icon, { size, symbol: "radio_button_checked", cssOverrides: menuItemIconStyles(mergedTheme, { size }) }) : null, !isSelected && selectionMode === "single" ? jsx(Icon, { size, symbol: "radio_button_unchecked", cssOverrides: menuItemIconStyles(mergedTheme, { size }) }) : null, jsx("div", { css: menuItemLabelStyles(mergedTheme), children: label }), description && jsx("div", { css: menuItemDescriptionStyles(mergedTheme), children: description }), aside && jsx("div", { css: menuItemAsideStyles(mergedTheme), children: aside })] }) }
|
|
46
|
-
);
|
|
38
|
+
return jsx(MenuItem$1, { css: [menuItemStyles(mergedTheme, { description }), cssOverrides], ...props, textValue, children: ({ isSelected, selectionMode }) => jsxs(Fragment, { children: [icon && selectionMode === "none" ? jsx(Icon, { size, cssOverrides: menuItemIconStyles(mergedTheme, { size }), children: icon }) : null, isSelected && selectionMode === "multiple" ? jsx(Icon, { size, symbol: "check_box", cssOverrides: menuItemIconStyles(mergedTheme, { size }) }) : null, !isSelected && selectionMode === "multiple" ? jsx(Icon, { size, symbol: "check_box_outline_blank", cssOverrides: menuItemIconStyles(mergedTheme, { size }) }) : null, isSelected && selectionMode === "single" ? jsx(Icon, { size, symbol: "radio_button_checked", cssOverrides: menuItemIconStyles(mergedTheme, { size }) }) : null, !isSelected && selectionMode === "single" ? jsx(Icon, { size, symbol: "radio_button_unchecked", cssOverrides: menuItemIconStyles(mergedTheme, { size }) }) : null, jsx("div", { css: menuItemLabelStyles(mergedTheme), children: label }), description && jsx("div", { css: menuItemDescriptionStyles(mergedTheme), children: description }), aside && jsx("div", { css: menuItemAsideStyles(mergedTheme), children: aside })] }) });
|
|
47
39
|
}
|
|
48
40
|
function Menu({ theme = {}, size = "md", popoverProps, menuTriggerProps, children, cssOverrides, ...props }) {
|
|
49
41
|
const mergedTheme = mergeDeep(defaultMenuTheme, theme);
|
|
@@ -24,7 +24,7 @@ const menuSectionHeaderStyles = (theme, { size }) => react.css`
|
|
|
24
24
|
${typography.convertTypographyToEmotionStringStyle(theme.header[size].typography)}
|
|
25
25
|
`;
|
|
26
26
|
const defaultMenuItemTheme = menu.componentMenu.menuItem;
|
|
27
|
-
const menuItemStyles = (theme, { description }
|
|
27
|
+
const menuItemStyles = (theme, { description }) => react.css`
|
|
28
28
|
display: ${theme.shared.display};
|
|
29
29
|
grid-template-columns: ${theme.shared["grid-template-columns"]};
|
|
30
30
|
grid-template-areas: ${description ? theme.shared["grid-template-areas-with-description"] : theme.shared["grid-template-areas"]};
|
|
@@ -37,17 +37,31 @@ const menuItemStyles = (theme, { description }, isFocusVisible = false) => react
|
|
|
37
37
|
&:last-child {
|
|
38
38
|
border-bottom: ${theme.shared[":last-child"]["border-bottom"]};
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
|
|
41
|
+
/* Hovering adds data-focused and the item stays focused after hovering away */
|
|
42
|
+
&[data-focused] {
|
|
43
|
+
background-color: ${theme.shared[":hover"]["background-color"]};
|
|
44
|
+
}
|
|
45
|
+
&[data-hovered] {
|
|
46
|
+
outline: ${theme.shared[":hover"].outline};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* Override default browser focus behaviour */
|
|
50
|
+
:focus-visible {
|
|
51
|
+
outline: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* focus visible used for keyboard focus */
|
|
55
|
+
&[data-focus-visible] {
|
|
56
|
+
outline: ${theme.shared[":focus-visible"]["outline"]};
|
|
57
|
+
outline-offset: ${theme.shared[":focus-visible"]["outline-offset"]};
|
|
58
|
+
background-color: ${theme.shared[":hover"]["background-color"]};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Must be last to take precedence */
|
|
62
|
+
&[data-pressed] {
|
|
63
|
+
background-color: ${theme.shared[":pressed"]["background-color"]};
|
|
43
64
|
}
|
|
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
65
|
`;
|
|
52
66
|
const menuItemIconStyles = (theme, { size }) => react.css`
|
|
53
67
|
grid-area: ${theme.shared.icon["grid-area"]};
|
|
@@ -22,7 +22,7 @@ const menuSectionHeaderStyles = (theme, { size }) => css`
|
|
|
22
22
|
${convertTypographyToEmotionStringStyle(theme.header[size].typography)}
|
|
23
23
|
`;
|
|
24
24
|
const defaultMenuItemTheme = componentMenu.menuItem;
|
|
25
|
-
const menuItemStyles = (theme, { description }
|
|
25
|
+
const menuItemStyles = (theme, { description }) => css`
|
|
26
26
|
display: ${theme.shared.display};
|
|
27
27
|
grid-template-columns: ${theme.shared["grid-template-columns"]};
|
|
28
28
|
grid-template-areas: ${description ? theme.shared["grid-template-areas-with-description"] : theme.shared["grid-template-areas"]};
|
|
@@ -35,17 +35,31 @@ const menuItemStyles = (theme, { description }, isFocusVisible = false) => css`
|
|
|
35
35
|
&:last-child {
|
|
36
36
|
border-bottom: ${theme.shared[":last-child"]["border-bottom"]};
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
|
|
39
|
+
/* Hovering adds data-focused and the item stays focused after hovering away */
|
|
40
|
+
&[data-focused] {
|
|
41
|
+
background-color: ${theme.shared[":hover"]["background-color"]};
|
|
42
|
+
}
|
|
43
|
+
&[data-hovered] {
|
|
44
|
+
outline: ${theme.shared[":hover"].outline};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Override default browser focus behaviour */
|
|
48
|
+
:focus-visible {
|
|
49
|
+
outline: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* focus visible used for keyboard focus */
|
|
53
|
+
&[data-focus-visible] {
|
|
54
|
+
outline: ${theme.shared[":focus-visible"]["outline"]};
|
|
55
|
+
outline-offset: ${theme.shared[":focus-visible"]["outline-offset"]};
|
|
56
|
+
background-color: ${theme.shared[":hover"]["background-color"]};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* Must be last to take precedence */
|
|
60
|
+
&[data-pressed] {
|
|
61
|
+
background-color: ${theme.shared[":pressed"]["background-color"]};
|
|
41
62
|
}
|
|
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
63
|
`;
|
|
50
64
|
const menuItemIconStyles = (theme, { size }) => css`
|
|
51
65
|
grid-area: ${theme.shared.icon["grid-area"]};
|
|
@@ -0,0 +1,28 @@
|
|
|
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 Form = require('../form/Form.cjs');
|
|
7
|
+
var styles = require('./styles.cjs');
|
|
8
|
+
|
|
9
|
+
function TextInput({
|
|
10
|
+
size = "md",
|
|
11
|
+
isInvalid = false,
|
|
12
|
+
theme = {},
|
|
13
|
+
...props
|
|
14
|
+
}) {
|
|
15
|
+
const mergedTheme = mergeDeep.mergeDeep(styles.defaultTextInputTheme, theme);
|
|
16
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17
|
+
Form.FormInputContainer,
|
|
18
|
+
{
|
|
19
|
+
as: reactAriaComponents.TextField,
|
|
20
|
+
size,
|
|
21
|
+
isInvalid,
|
|
22
|
+
...props,
|
|
23
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Input, { css: styles.textInputStyles(mergedTheme, { size, isInvalid }) })
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
exports.TextInput = TextInput;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { TextField, Input } from 'react-aria-components';
|
|
3
|
+
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
4
|
+
import { FormInputContainer } from '../form/Form.js';
|
|
5
|
+
import { textInputStyles, defaultTextInputTheme } from './styles.js';
|
|
6
|
+
|
|
7
|
+
function TextInput({ size = "md", isInvalid = false, theme = {}, ...props }) {
|
|
8
|
+
const mergedTheme = mergeDeep(defaultTextInputTheme, theme);
|
|
9
|
+
return jsx(FormInputContainer, { as: TextField, size, isInvalid, ...props, children: jsx(Input, { css: textInputStyles(mergedTheme, { size, isInvalid }) }) });
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { TextInput };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('@emotion/react');
|
|
4
|
+
var textInput = require('../../styleD/build/typescript/component/textInput.cjs');
|
|
5
|
+
var typography = require('../../styleD/utils/semantic/typography.cjs');
|
|
6
|
+
|
|
7
|
+
const defaultTextInputTheme = textInput.componentTextInput;
|
|
8
|
+
const textInputStyles = (theme, { size, isInvalid }) => {
|
|
9
|
+
return react.css`
|
|
10
|
+
${typography.convertTypographyToEmotionStringStyle(theme[size].typography)}
|
|
11
|
+
background-color: ${theme.shared["background-color"]};
|
|
12
|
+
border-radius: ${theme.shared["border-radius"]};
|
|
13
|
+
border: ${theme.shared.border};
|
|
14
|
+
color: ${theme.shared.color};
|
|
15
|
+
cursor: ${theme.shared.cursor};
|
|
16
|
+
height: ${theme[size].height};
|
|
17
|
+
margin-top: ${theme.shared["margin-top"]};
|
|
18
|
+
padding: ${theme.shared.padding.top} ${theme.shared.padding.right}
|
|
19
|
+
${theme.shared.padding.bottom} ${theme.shared.padding.left};
|
|
20
|
+
|
|
21
|
+
&[data-disabled] {
|
|
22
|
+
background-color: ${theme.shared.disabled.backgroundColor};
|
|
23
|
+
border: ${theme.shared.disabled.border};
|
|
24
|
+
color: ${theme.shared.disabled.color};
|
|
25
|
+
cursor: ${theme.shared.disabled.cursor};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
${isInvalid && react.css`
|
|
29
|
+
border: ${theme.shared.error.border};
|
|
30
|
+
`}
|
|
31
|
+
`;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
exports.defaultTextInputTheme = defaultTextInputTheme;
|
|
35
|
+
exports.textInputStyles = textInputStyles;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
|
+
import { componentTextInput } from '../../styleD/build/typescript/component/textInput.js';
|
|
3
|
+
import { convertTypographyToEmotionStringStyle } from '../../styleD/utils/semantic/typography.js';
|
|
4
|
+
|
|
5
|
+
const defaultTextInputTheme = componentTextInput;
|
|
6
|
+
const textInputStyles = (theme, { size, isInvalid }) => {
|
|
7
|
+
return css`
|
|
8
|
+
${convertTypographyToEmotionStringStyle(theme[size].typography)}
|
|
9
|
+
background-color: ${theme.shared["background-color"]};
|
|
10
|
+
border-radius: ${theme.shared["border-radius"]};
|
|
11
|
+
border: ${theme.shared.border};
|
|
12
|
+
color: ${theme.shared.color};
|
|
13
|
+
cursor: ${theme.shared.cursor};
|
|
14
|
+
height: ${theme[size].height};
|
|
15
|
+
margin-top: ${theme.shared["margin-top"]};
|
|
16
|
+
padding: ${theme.shared.padding.top} ${theme.shared.padding.right}
|
|
17
|
+
${theme.shared.padding.bottom} ${theme.shared.padding.left};
|
|
18
|
+
|
|
19
|
+
&[data-disabled] {
|
|
20
|
+
background-color: ${theme.shared.disabled.backgroundColor};
|
|
21
|
+
border: ${theme.shared.disabled.border};
|
|
22
|
+
color: ${theme.shared.disabled.color};
|
|
23
|
+
cursor: ${theme.shared.disabled.cursor};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
${isInvalid && css`
|
|
27
|
+
border: ${theme.shared.error.border};
|
|
28
|
+
`}
|
|
29
|
+
`;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { defaultTextInputTheme, textInputStyles };
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
4
|
+
var reactAriaComponents = require('react-aria-components');
|
|
4
5
|
var mergeDeep = require('../../../util/mergeDeep.cjs');
|
|
5
6
|
var Favicon = require('../../favicon/Favicon.cjs');
|
|
6
7
|
var Icon = require('../../icon/Icon.cjs');
|
|
7
8
|
var TopBarItem = require('../topBarItem/TopBarItem.cjs');
|
|
8
9
|
var styles = require('./styles.cjs');
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
function ToolName({
|
|
11
12
|
name,
|
|
12
13
|
favicon,
|
|
13
14
|
subsection,
|
|
14
15
|
subsectionIcon,
|
|
15
16
|
theme = {},
|
|
16
17
|
cssOverrides
|
|
17
|
-
})
|
|
18
|
+
}) {
|
|
18
19
|
const mergedTheme = mergeDeep.mergeDeep(styles.defaultToolNameTheme, theme);
|
|
19
20
|
return /* @__PURE__ */ jsxRuntime.jsx(TopBarItem.TopBarItem, { alignment: "left", size: "sm", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { css: [styles.toolNameStyles(mergedTheme), cssOverrides], children: [
|
|
20
21
|
/* @__PURE__ */ jsxRuntime.jsx(Favicon.Favicon, { ...favicon }),
|
|
@@ -27,6 +28,24 @@ const TopBarToolName = ({
|
|
|
27
28
|
] })
|
|
28
29
|
] })
|
|
29
30
|
] }) });
|
|
31
|
+
}
|
|
32
|
+
const TopBarToolName = (props) => {
|
|
33
|
+
const mergedTheme = mergeDeep.mergeDeep(styles.defaultToolNameTheme, props.theme ?? {});
|
|
34
|
+
if (("href" in props || "onPress" in props) && "hoverText" in props) {
|
|
35
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
36
|
+
reactAriaComponents.Link,
|
|
37
|
+
{
|
|
38
|
+
css: styles.toolNameLinkStyles(mergedTheme),
|
|
39
|
+
href: props.href,
|
|
40
|
+
onPress: props.onPress,
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { css: [styles.toolNameHoverLinkStyles(mergedTheme)], children: props.hoverText }),
|
|
43
|
+
/* @__PURE__ */ jsxRuntime.jsx(ToolName, { ...props })
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ToolName, { ...props });
|
|
30
49
|
};
|
|
31
50
|
|
|
32
51
|
exports.TopBarToolName = TopBarToolName;
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx, Fragment } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { Link } from 'react-aria-components';
|
|
2
3
|
import { mergeDeep } from '../../../util/mergeDeep.js';
|
|
3
4
|
import { Favicon } from '../../favicon/Favicon.js';
|
|
4
5
|
import { Icon } from '../../icon/Icon.js';
|
|
5
6
|
import { TopBarItem } from '../topBarItem/TopBarItem.js';
|
|
6
|
-
import { toolNameTypography, dividerStyles, subsectionTypography, subsectionStyles, toolNameStyles
|
|
7
|
+
import { defaultToolNameTheme, toolNameHoverLinkStyles, toolNameLinkStyles, toolNameTypography, dividerStyles, subsectionTypography, subsectionStyles, toolNameStyles } from './styles.js';
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
function ToolName({ name, favicon, subsection, subsectionIcon, theme = {}, cssOverrides }) {
|
|
9
10
|
const mergedTheme = mergeDeep(defaultToolNameTheme, theme);
|
|
10
11
|
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 })] })] })] }) });
|
|
12
|
+
}
|
|
13
|
+
const TopBarToolName = (props) => {
|
|
14
|
+
const mergedTheme = mergeDeep(defaultToolNameTheme, props.theme ?? {});
|
|
15
|
+
if (("href" in props || "onPress" in props) && "hoverText" in props) {
|
|
16
|
+
return jsxs(Link, { css: toolNameLinkStyles(mergedTheme), href: props.href, onPress: props.onPress, children: [jsx("div", { css: [toolNameHoverLinkStyles(mergedTheme)], children: props.hoverText }), jsx(ToolName, { ...props })] });
|
|
17
|
+
}
|
|
18
|
+
return jsx(ToolName, { ...props });
|
|
11
19
|
};
|
|
12
20
|
|
|
13
21
|
export { TopBarToolName };
|
|
@@ -5,6 +5,43 @@ var TopBar = require('../../../styleD/build/typescript/component/TopBar.cjs');
|
|
|
5
5
|
var typography = require('../../../styleD/utils/semantic/typography.cjs');
|
|
6
6
|
|
|
7
7
|
const defaultToolNameTheme = TopBar.componentTopBar.ToolName;
|
|
8
|
+
const toolNameHoverLinkStyles = (theme) => {
|
|
9
|
+
return react.css`
|
|
10
|
+
${typography.convertTypographyToEmotionStringStyle(theme.hoverLink.typography)}
|
|
11
|
+
background-color: ${theme.hoverLink.backgroundColor};
|
|
12
|
+
color: ${theme.hoverLink.color};
|
|
13
|
+
align-items: ${theme["align-items"]};
|
|
14
|
+
padding-left: ${theme.hoverLink.paddingLeft};
|
|
15
|
+
padding-right: ${theme.hoverLink.paddingRight};
|
|
16
|
+
display: ${theme.display};
|
|
17
|
+
opacity: ${theme.hoverLink.opacity};
|
|
18
|
+
|
|
19
|
+
position: ${theme.hoverLink.position};
|
|
20
|
+
width: ${theme.hoverLink.width};
|
|
21
|
+
height: ${theme.hoverLink.height};
|
|
22
|
+
`;
|
|
23
|
+
};
|
|
24
|
+
const toolNameLinkStyles = (theme) => {
|
|
25
|
+
return react.css`
|
|
26
|
+
text-decoration: ${theme.link.textDecoration};
|
|
27
|
+
color: ${theme.link.color};
|
|
28
|
+
position: ${theme.link.position};
|
|
29
|
+
|
|
30
|
+
/* Show the first element - the hover text */
|
|
31
|
+
&[data-hovered] :first-of-type {
|
|
32
|
+
opacity: ${theme.hoverLink.hover.opacity};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&[data-pressed] :first-of-type {
|
|
36
|
+
background-color: ${theme.hoverLink.pressed.backgroundColor};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&[data-focus-visible] {
|
|
40
|
+
outline: ${theme.hoverLink.focused.outline};
|
|
41
|
+
outline-offset: ${theme.hoverLink.focused["outline-offset"]};
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
};
|
|
8
45
|
const toolNameStyles = (theme) => {
|
|
9
46
|
return react.css`
|
|
10
47
|
display: ${theme.display};
|
|
@@ -40,5 +77,7 @@ exports.defaultToolNameTheme = defaultToolNameTheme;
|
|
|
40
77
|
exports.dividerStyles = dividerStyles;
|
|
41
78
|
exports.subsectionStyles = subsectionStyles;
|
|
42
79
|
exports.subsectionTypography = subsectionTypography;
|
|
80
|
+
exports.toolNameHoverLinkStyles = toolNameHoverLinkStyles;
|
|
81
|
+
exports.toolNameLinkStyles = toolNameLinkStyles;
|
|
43
82
|
exports.toolNameStyles = toolNameStyles;
|
|
44
83
|
exports.toolNameTypography = toolNameTypography;
|
|
@@ -3,6 +3,43 @@ import { componentTopBar } from '../../../styleD/build/typescript/component/TopB
|
|
|
3
3
|
import { convertTypographyToEmotionStringStyle } from '../../../styleD/utils/semantic/typography.js';
|
|
4
4
|
|
|
5
5
|
const defaultToolNameTheme = componentTopBar.ToolName;
|
|
6
|
+
const toolNameHoverLinkStyles = (theme) => {
|
|
7
|
+
return css`
|
|
8
|
+
${convertTypographyToEmotionStringStyle(theme.hoverLink.typography)}
|
|
9
|
+
background-color: ${theme.hoverLink.backgroundColor};
|
|
10
|
+
color: ${theme.hoverLink.color};
|
|
11
|
+
align-items: ${theme["align-items"]};
|
|
12
|
+
padding-left: ${theme.hoverLink.paddingLeft};
|
|
13
|
+
padding-right: ${theme.hoverLink.paddingRight};
|
|
14
|
+
display: ${theme.display};
|
|
15
|
+
opacity: ${theme.hoverLink.opacity};
|
|
16
|
+
|
|
17
|
+
position: ${theme.hoverLink.position};
|
|
18
|
+
width: ${theme.hoverLink.width};
|
|
19
|
+
height: ${theme.hoverLink.height};
|
|
20
|
+
`;
|
|
21
|
+
};
|
|
22
|
+
const toolNameLinkStyles = (theme) => {
|
|
23
|
+
return css`
|
|
24
|
+
text-decoration: ${theme.link.textDecoration};
|
|
25
|
+
color: ${theme.link.color};
|
|
26
|
+
position: ${theme.link.position};
|
|
27
|
+
|
|
28
|
+
/* Show the first element - the hover text */
|
|
29
|
+
&[data-hovered] :first-of-type {
|
|
30
|
+
opacity: ${theme.hoverLink.hover.opacity};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&[data-pressed] :first-of-type {
|
|
34
|
+
background-color: ${theme.hoverLink.pressed.backgroundColor};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&[data-focus-visible] {
|
|
38
|
+
outline: ${theme.hoverLink.focused.outline};
|
|
39
|
+
outline-offset: ${theme.hoverLink.focused["outline-offset"]};
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
42
|
+
};
|
|
6
43
|
const toolNameStyles = (theme) => {
|
|
7
44
|
return css`
|
|
8
45
|
display: ${theme.display};
|
|
@@ -34,4 +71,4 @@ const subsectionTypography = (theme) => {
|
|
|
34
71
|
`;
|
|
35
72
|
};
|
|
36
73
|
|
|
37
|
-
export { defaultToolNameTheme, dividerStyles, subsectionStyles, subsectionTypography, toolNameStyles, toolNameTypography };
|
|
74
|
+
export { defaultToolNameTheme, dividerStyles, subsectionStyles, subsectionTypography, toolNameHoverLinkStyles, toolNameLinkStyles, toolNameStyles, toolNameTypography };
|
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 textInput = require('./styleD/build/typescript/component/textInput.cjs');
|
|
12
13
|
var inlineMessage = require('./styleD/build/typescript/component/inlineMessage.cjs');
|
|
13
14
|
var select = require('./styleD/build/typescript/component/select.cjs');
|
|
14
15
|
var menu = require('./styleD/build/typescript/component/menu.cjs');
|
|
@@ -35,6 +36,7 @@ exports.componentButton = button.componentButton;
|
|
|
35
36
|
exports.componentTypography = typography$1.componentTypography;
|
|
36
37
|
exports.componentIcon = icon.componentIcon;
|
|
37
38
|
exports.componentFavicon = favicon.componentFavicon;
|
|
39
|
+
exports.componentTextInput = textInput.componentTextInput;
|
|
38
40
|
exports.componentInlineMessage = inlineMessage.componentInlineMessage;
|
|
39
41
|
exports.componentSelect = select.componentSelect;
|
|
40
42
|
exports.componentMenu = menu.componentMenu;
|
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 { componentTextInput } from './styleD/build/typescript/component/textInput.js';
|
|
10
11
|
export { componentInlineMessage } from './styleD/build/typescript/component/inlineMessage.js';
|
|
11
12
|
export { componentSelect } from './styleD/build/typescript/component/select.js';
|
|
12
13
|
export { componentMenu } from './styleD/build/typescript/component/menu.js';
|
|
@@ -71,4 +71,26 @@
|
|
|
71
71
|
'Open Sans';
|
|
72
72
|
--component-top-bar-tool-name-subsection-typography-letter-spacing: -0.0125rem;
|
|
73
73
|
--component-top-bar-tool-name-subsection-typography-font-width: 88;
|
|
74
|
+
--component-top-bar-tool-name-link-text-decoration: none;
|
|
75
|
+
--component-top-bar-tool-name-link-color: unset;
|
|
76
|
+
--component-top-bar-tool-name-link-position: relative;
|
|
77
|
+
--component-top-bar-tool-name-link-width: 100%;
|
|
78
|
+
--component-top-bar-tool-name-link-height: 100%;
|
|
79
|
+
--component-top-bar-tool-name-hover-link-color: #ffffff;
|
|
80
|
+
--component-top-bar-tool-name-hover-link-padding-left: 1.25rem;
|
|
81
|
+
--component-top-bar-tool-name-hover-link-padding-right: 1.25rem;
|
|
82
|
+
--component-top-bar-tool-name-hover-link-background-color: #092f62;
|
|
83
|
+
--component-top-bar-tool-name-hover-link-opacity: 0;
|
|
84
|
+
--component-top-bar-tool-name-hover-link-typography-font: normal 700
|
|
85
|
+
0.875rem/1.3 'Open Sans';
|
|
86
|
+
--component-top-bar-tool-name-hover-link-typography-letter-spacing: 0;
|
|
87
|
+
--component-top-bar-tool-name-hover-link-typography-font-width: 95;
|
|
88
|
+
--component-top-bar-tool-name-hover-link-position: absolute;
|
|
89
|
+
--component-top-bar-tool-name-hover-link-width: 100%;
|
|
90
|
+
--component-top-bar-tool-name-hover-link-height: 100%;
|
|
91
|
+
--component-top-bar-tool-name-hover-link-hover-opacity: 1;
|
|
92
|
+
--component-top-bar-tool-name-hover-link-pressed-background-color: #061d3c;
|
|
93
|
+
--component-top-bar-tool-name-hover-link-focused-outline: 0.125rem solid
|
|
94
|
+
#0072a9;
|
|
95
|
+
--component-top-bar-tool-name-hover-link-focused-outline-offset: -0.125rem;
|
|
74
96
|
}
|
|
@@ -63,9 +63,11 @@
|
|
|
63
63
|
--component-menu-menu-item-shared-aside-typography-font-width: 95;
|
|
64
64
|
--component-menu-menu-item-shared-last-child-border-bottom: none;
|
|
65
65
|
--component-menu-menu-item-shared-hover-background-color: #f6f6f6;
|
|
66
|
+
--component-menu-menu-item-shared-hover-outline: none; /** Override outline focus styles on hover */
|
|
66
67
|
--component-menu-menu-item-shared-focus-visible-outline: 0.125rem solid
|
|
67
68
|
#0072a9;
|
|
68
69
|
--component-menu-menu-item-shared-focus-visible-outline-offset: -0.125rem;
|
|
70
|
+
--component-menu-menu-item-shared-pressed-background-color: #ededed;
|
|
69
71
|
--component-menu-menu-item-sm-icon-size: 1.125rem;
|
|
70
72
|
--component-menu-menu-item-sm-icon-line-height: 1.3;
|
|
71
73
|
--component-menu-menu-item-md-icon-size: 1.25rem;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
:root {
|
|
6
|
+
--component-text-input-shared-color: #000000;
|
|
7
|
+
--component-text-input-shared-cursor: text;
|
|
8
|
+
--component-text-input-shared-padding-top: 0;
|
|
9
|
+
--component-text-input-shared-padding-right: 0.75rem;
|
|
10
|
+
--component-text-input-shared-padding-bottom: 0;
|
|
11
|
+
--component-text-input-shared-padding-left: 0.75rem;
|
|
12
|
+
--component-text-input-shared-margin-top: 0.5rem; /** spacing between the input itself and the previous element (label or description) minus the flex gap (default 4px), e.g. if the spacing between label and input should be 12px, then margin-top should be 8px */
|
|
13
|
+
--component-text-input-shared-border-radius: 0.25rem;
|
|
14
|
+
--component-text-input-shared-border: 0.0625rem solid #545454;
|
|
15
|
+
--component-text-input-shared-background-color: #ffffff;
|
|
16
|
+
--component-text-input-shared-disabled-background-color: #ffffff;
|
|
17
|
+
--component-text-input-shared-disabled-cursor: not-allowed;
|
|
18
|
+
--component-text-input-shared-disabled-color: #999999;
|
|
19
|
+
--component-text-input-shared-disabled-border: 0.0625rem solid #dcdcdc;
|
|
20
|
+
--component-text-input-shared-error-border: 0.0625rem solid #b42a19;
|
|
21
|
+
--component-text-input-sm-height: 2rem;
|
|
22
|
+
--component-text-input-sm-typography-font: normal 460 0.875rem/1.3 'Open Sans';
|
|
23
|
+
--component-text-input-sm-typography-letter-spacing: 0;
|
|
24
|
+
--component-text-input-sm-typography-font-width: 95;
|
|
25
|
+
--component-text-input-md-height: 2.5rem;
|
|
26
|
+
--component-text-input-md-typography-font: normal 460 1rem/1.3 'Open Sans';
|
|
27
|
+
--component-text-input-md-typography-letter-spacing: 0;
|
|
28
|
+
--component-text-input-md-typography-font-width: 95;
|
|
29
|
+
}
|