@guardian/stand 0.0.18 → 0.0.20
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/TopBar.cjs +2 -0
- package/dist/TopBar.js +1 -1
- package/dist/components/form/Form.cjs +47 -0
- package/dist/components/form/Form.js +17 -0
- package/dist/components/form/styles.cjs +49 -0
- package/dist/components/form/styles.js +35 -0
- package/dist/components/form/types.cjs +7 -0
- package/dist/components/form/types.js +5 -0
- package/dist/components/select/Select.cjs +58 -0
- package/dist/components/select/Select.js +33 -0
- package/dist/components/select/styles.cjs +101 -0
- package/dist/components/select/styles.js +95 -0
- package/dist/form.cjs +7 -0
- package/dist/form.js +1 -0
- package/dist/index.cjs +4 -0
- package/dist/index.js +2 -0
- package/dist/select.cjs +9 -0
- package/dist/select.js +2 -0
- package/dist/styleD/build/css/component/form.css +28 -0
- package/dist/styleD/build/css/component/select.css +48 -0
- package/dist/styleD/build/typescript/component/form.cjs +57 -0
- package/dist/styleD/build/typescript/component/form.js +55 -0
- package/dist/styleD/build/typescript/component/select.cjs +69 -0
- package/dist/styleD/build/typescript/component/select.js +67 -0
- package/dist/types/TopBar.d.ts +1 -1
- package/dist/types/components/form/Form.d.ts +5 -0
- package/dist/types/components/form/styles.d.ts +15 -0
- package/dist/types/components/form/types.d.ts +40 -0
- package/dist/types/components/select/Select.d.ts +3 -0
- package/dist/types/components/select/sandbox.d.ts +5 -0
- package/dist/types/components/select/styles.d.ts +10 -0
- package/dist/types/components/select/types.d.ts +9 -0
- package/dist/types/form.d.ts +8 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/select.d.ts +20 -0
- package/dist/types/styleD/build/typescript/component/form.d.ts +57 -0
- package/dist/types/styleD/build/typescript/component/select.d.ts +69 -0
- package/package.json +44 -20
package/dist/TopBar.cjs
CHANGED
|
@@ -13,3 +13,5 @@ exports.TopBarToolName = TopBarToolName.TopBarToolName;
|
|
|
13
13
|
exports.TopBarNavigation = TopBarNavigation.TopBarNavigation;
|
|
14
14
|
exports.TopBarItem = TopBarItem.TopBarItem;
|
|
15
15
|
exports.TopBar = TopBar.TopBar;
|
|
16
|
+
exports.TopBarContainerLeft = TopBar.TopBarContainerLeft;
|
|
17
|
+
exports.TopBarContainerRight = TopBar.TopBarContainerRight;
|
package/dist/TopBar.js
CHANGED
|
@@ -2,4 +2,4 @@ export { componentTopBar } from './styleD/build/typescript/component/TopBar.js';
|
|
|
2
2
|
export { TopBarToolName } from './components/topbar/topBarToolName/TopBarToolName.js';
|
|
3
3
|
export { TopBarNavigation } from './components/topbar/topBarNavigation/TopBarNavigation.js';
|
|
4
4
|
export { TopBarItem } from './components/topbar/topBarItem/TopBarItem.js';
|
|
5
|
-
export { TopBar } from './components/topbar/TopBar.js';
|
|
5
|
+
export { TopBar, TopBarContainerLeft, TopBarContainerRight } from './components/topbar/TopBar.js';
|
|
@@ -0,0 +1,47 @@
|
|
|
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 styles = require('./styles.cjs');
|
|
7
|
+
var types = require('./types.cjs');
|
|
8
|
+
var InlineMessage = require('../inline-message/InlineMessage.cjs');
|
|
9
|
+
|
|
10
|
+
function FormInputContainer({
|
|
11
|
+
as: Component,
|
|
12
|
+
size = "md",
|
|
13
|
+
label,
|
|
14
|
+
description,
|
|
15
|
+
error,
|
|
16
|
+
isDisabled = false,
|
|
17
|
+
theme = {},
|
|
18
|
+
formInputContainerTheme,
|
|
19
|
+
cssOverrides,
|
|
20
|
+
children,
|
|
21
|
+
...props
|
|
22
|
+
}) {
|
|
23
|
+
if (!types.ALLOWED_FORM_CONTAINERS.includes(Component)) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
const mergedTheme = mergeDeep.mergeDeep(
|
|
27
|
+
mergeDeep.mergeDeep(styles.defaultFormInputContainerTheme, theme),
|
|
28
|
+
formInputContainerTheme ?? {}
|
|
29
|
+
);
|
|
30
|
+
const Tag = Component;
|
|
31
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
32
|
+
Tag,
|
|
33
|
+
{
|
|
34
|
+
css: [styles.formInputContainerStyles(mergedTheme, { size }), cssOverrides],
|
|
35
|
+
isDisabled,
|
|
36
|
+
...props,
|
|
37
|
+
children: [
|
|
38
|
+
label && /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Label, { css: styles.formInputLabelStyles(mergedTheme, { size, isDisabled }), children: label }),
|
|
39
|
+
description && /* @__PURE__ */ jsxRuntime.jsx("div", { css: styles.formInputDescriptionStyles(mergedTheme, { isDisabled }), children: description }),
|
|
40
|
+
children,
|
|
41
|
+
error && /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.FieldError, { children: /* @__PURE__ */ jsxRuntime.jsx(InlineMessage.InlineMessage, { level: "error", children: error }) })
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
exports.FormInputContainer = FormInputContainer;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { Label, FieldError } from 'react-aria-components';
|
|
3
|
+
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
4
|
+
import { defaultFormInputContainerTheme, formInputLabelStyles, formInputDescriptionStyles, formInputContainerStyles } from './styles.js';
|
|
5
|
+
import { ALLOWED_FORM_CONTAINERS } from './types.js';
|
|
6
|
+
import { InlineMessage } from '../inline-message/InlineMessage.js';
|
|
7
|
+
|
|
8
|
+
function FormInputContainer({ as: Component, size = "md", label, description, error, isDisabled = false, theme = {}, formInputContainerTheme, cssOverrides, children, ...props }) {
|
|
9
|
+
if (!ALLOWED_FORM_CONTAINERS.includes(Component)) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
const mergedTheme = mergeDeep(mergeDeep(defaultFormInputContainerTheme, theme), formInputContainerTheme ?? {});
|
|
13
|
+
const Tag = Component;
|
|
14
|
+
return jsxs(Tag, { css: [formInputContainerStyles(mergedTheme, { size }), cssOverrides], isDisabled, ...props, children: [label && jsx(Label, { css: formInputLabelStyles(mergedTheme, { size, isDisabled }), children: label }), description && jsx("div", { css: formInputDescriptionStyles(mergedTheme, { isDisabled }), children: description }), children, error && jsx(FieldError, { children: jsx(InlineMessage, { level: "error", children: error }) })] });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { FormInputContainer };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('@emotion/react');
|
|
4
|
+
var form = require('../../styleD/build/typescript/component/form.cjs');
|
|
5
|
+
var typography = require('../../styleD/utils/semantic/typography.cjs');
|
|
6
|
+
|
|
7
|
+
const defaultFormInputContainerTheme = form.componentForm.input;
|
|
8
|
+
const formInputContainerStyles = (theme, {
|
|
9
|
+
size
|
|
10
|
+
}) => {
|
|
11
|
+
return react.css`
|
|
12
|
+
display: ${theme.shared.container.display};
|
|
13
|
+
flex-direction: ${theme.shared.container["flex-direction"]};
|
|
14
|
+
gap: ${theme.shared.container.gap};
|
|
15
|
+
width: ${theme.shared.container.width};
|
|
16
|
+
max-width: ${theme[size].container["max-width"]};
|
|
17
|
+
`;
|
|
18
|
+
};
|
|
19
|
+
const formInputLabelStyles = (theme, {
|
|
20
|
+
isDisabled,
|
|
21
|
+
size
|
|
22
|
+
}) => {
|
|
23
|
+
return react.css`
|
|
24
|
+
color: ${theme.shared.label.color};
|
|
25
|
+
${typography.convertTypographyToEmotionStringStyle(theme[size].label.typography)}
|
|
26
|
+
|
|
27
|
+
${isDisabled && react.css`
|
|
28
|
+
color: ${theme.shared.label.disabled.color};
|
|
29
|
+
`}
|
|
30
|
+
`;
|
|
31
|
+
};
|
|
32
|
+
const formInputDescriptionStyles = (theme, {
|
|
33
|
+
isDisabled
|
|
34
|
+
}) => {
|
|
35
|
+
return react.css`
|
|
36
|
+
color: ${theme.shared.description.color};
|
|
37
|
+
${typography.convertTypographyToEmotionStringStyle(
|
|
38
|
+
theme.shared.description.typography
|
|
39
|
+
)}
|
|
40
|
+
${isDisabled && react.css`
|
|
41
|
+
color: ${theme.shared.description.disabled.color};
|
|
42
|
+
`}
|
|
43
|
+
`;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
exports.defaultFormInputContainerTheme = defaultFormInputContainerTheme;
|
|
47
|
+
exports.formInputContainerStyles = formInputContainerStyles;
|
|
48
|
+
exports.formInputDescriptionStyles = formInputDescriptionStyles;
|
|
49
|
+
exports.formInputLabelStyles = formInputLabelStyles;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
|
+
import { componentForm } from '../../styleD/build/typescript/component/form.js';
|
|
3
|
+
import { convertTypographyToEmotionStringStyle } from '../../styleD/utils/semantic/typography.js';
|
|
4
|
+
|
|
5
|
+
const defaultFormInputContainerTheme = componentForm.input;
|
|
6
|
+
const formInputContainerStyles = (theme, { size }) => {
|
|
7
|
+
return css`
|
|
8
|
+
display: ${theme.shared.container.display};
|
|
9
|
+
flex-direction: ${theme.shared.container["flex-direction"]};
|
|
10
|
+
gap: ${theme.shared.container.gap};
|
|
11
|
+
width: ${theme.shared.container.width};
|
|
12
|
+
max-width: ${theme[size].container["max-width"]};
|
|
13
|
+
`;
|
|
14
|
+
};
|
|
15
|
+
const formInputLabelStyles = (theme, { isDisabled, size }) => {
|
|
16
|
+
return css`
|
|
17
|
+
color: ${theme.shared.label.color};
|
|
18
|
+
${convertTypographyToEmotionStringStyle(theme[size].label.typography)}
|
|
19
|
+
|
|
20
|
+
${isDisabled && css`
|
|
21
|
+
color: ${theme.shared.label.disabled.color};
|
|
22
|
+
`}
|
|
23
|
+
`;
|
|
24
|
+
};
|
|
25
|
+
const formInputDescriptionStyles = (theme, { isDisabled }) => {
|
|
26
|
+
return css`
|
|
27
|
+
color: ${theme.shared.description.color};
|
|
28
|
+
${convertTypographyToEmotionStringStyle(theme.shared.description.typography)}
|
|
29
|
+
${isDisabled && css`
|
|
30
|
+
color: ${theme.shared.description.disabled.color};
|
|
31
|
+
`}
|
|
32
|
+
`;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export { defaultFormInputContainerTheme, formInputContainerStyles, formInputDescriptionStyles, formInputLabelStyles };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var reactAriaComponents = require('react-aria-components');
|
|
6
|
+
var mergeDeep = require('../../util/mergeDeep.cjs');
|
|
7
|
+
var Form = require('../form/Form.cjs');
|
|
8
|
+
var Icon = require('../icon/Icon.cjs');
|
|
9
|
+
var styles = require('./styles.cjs');
|
|
10
|
+
|
|
11
|
+
function Option({ children, theme = {} }) {
|
|
12
|
+
const mergedTheme = mergeDeep.mergeDeep(styles.defaultSelectTheme, theme);
|
|
13
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.ListBoxItem, { css: styles.listBoxItemStyles(mergedTheme), children });
|
|
14
|
+
}
|
|
15
|
+
function ListBox({ children, theme = {} }) {
|
|
16
|
+
const mergedTheme = mergeDeep.mergeDeep(styles.defaultSelectTheme, theme);
|
|
17
|
+
const items = [];
|
|
18
|
+
React.Children.forEach(children, (child, i) => {
|
|
19
|
+
if (!React.isValidElement(child)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (child.type === Option) {
|
|
23
|
+
items.push(
|
|
24
|
+
React.cloneElement(child, {
|
|
25
|
+
key: `${child.key}-${i}`
|
|
26
|
+
})
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.ListBox, { css: styles.listBoxStyles(mergedTheme), children: items });
|
|
31
|
+
}
|
|
32
|
+
function Select({
|
|
33
|
+
isInvalid,
|
|
34
|
+
theme = {},
|
|
35
|
+
children,
|
|
36
|
+
...props
|
|
37
|
+
}) {
|
|
38
|
+
const mergedTheme = mergeDeep.mergeDeep(styles.defaultSelectTheme, theme);
|
|
39
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
40
|
+
Form.FormInputContainer,
|
|
41
|
+
{
|
|
42
|
+
as: reactAriaComponents.Select,
|
|
43
|
+
size: "md",
|
|
44
|
+
isInvalid,
|
|
45
|
+
...props,
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactAriaComponents.Button, { css: styles.buttonStyles(mergedTheme, isInvalid), children: [
|
|
48
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.SelectValue, {}),
|
|
49
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { symbol: "keyboard_arrow_down", size: "lg" })
|
|
50
|
+
] }),
|
|
51
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Popover, { css: styles.popoverStyles(mergedTheme), children: /* @__PURE__ */ jsxRuntime.jsx(ListBox, { children }) })
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
exports.Option = Option;
|
|
58
|
+
exports.Select = Select;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Select as Select$1, Button, SelectValue, Popover, ListBox as ListBox$1, ListBoxItem } from 'react-aria-components';
|
|
4
|
+
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
5
|
+
import { FormInputContainer } from '../form/Form.js';
|
|
6
|
+
import { Icon } from '../icon/Icon.js';
|
|
7
|
+
import { buttonStyles, popoverStyles, defaultSelectTheme, listBoxStyles, listBoxItemStyles } from './styles.js';
|
|
8
|
+
|
|
9
|
+
function Option({ children, theme = {} }) {
|
|
10
|
+
const mergedTheme = mergeDeep(defaultSelectTheme, theme);
|
|
11
|
+
return jsx(ListBoxItem, { css: listBoxItemStyles(mergedTheme), children });
|
|
12
|
+
}
|
|
13
|
+
function ListBox({ children, theme = {} }) {
|
|
14
|
+
const mergedTheme = mergeDeep(defaultSelectTheme, theme);
|
|
15
|
+
const items = [];
|
|
16
|
+
React.Children.forEach(children, (child, i) => {
|
|
17
|
+
if (!React.isValidElement(child)) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (child.type === Option) {
|
|
21
|
+
items.push(React.cloneElement(child, {
|
|
22
|
+
key: `${child.key}-${i}`
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return jsx(ListBox$1, { css: listBoxStyles(mergedTheme), children: items });
|
|
27
|
+
}
|
|
28
|
+
function Select({ isInvalid, theme = {}, children, ...props }) {
|
|
29
|
+
const mergedTheme = mergeDeep(defaultSelectTheme, theme);
|
|
30
|
+
return jsxs(FormInputContainer, { as: Select$1, size: "md", isInvalid, ...props, children: [jsxs(Button, { css: buttonStyles(mergedTheme, isInvalid), children: [jsx(SelectValue, {}), jsx(Icon, { symbol: "keyboard_arrow_down", size: "lg" })] }), jsx(Popover, { css: popoverStyles(mergedTheme), children: jsx(ListBox, { children }) })] });
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { Option, Select };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('@emotion/react');
|
|
4
|
+
var select = require('../../styleD/build/typescript/component/select.cjs');
|
|
5
|
+
var typography = require('../../styleD/utils/semantic/typography.cjs');
|
|
6
|
+
|
|
7
|
+
const defaultSelectTheme = select.componentSelect;
|
|
8
|
+
const popoverStyles = (theme) => {
|
|
9
|
+
return react.css`
|
|
10
|
+
max-width: ${theme.shared.maxWidth};
|
|
11
|
+
width: ${theme.shared.width};
|
|
12
|
+
`;
|
|
13
|
+
};
|
|
14
|
+
const listBoxItemStyles = (theme) => {
|
|
15
|
+
return react.css`
|
|
16
|
+
padding-left: ${theme.shared.option.paddingLeft};
|
|
17
|
+
padding-right: ${theme.shared.option.paddingRight};
|
|
18
|
+
padding-top: ${theme.shared.option.paddingTop};
|
|
19
|
+
padding-bottom: ${theme.shared.option.paddingBottom};
|
|
20
|
+
|
|
21
|
+
&[data-hovered] {
|
|
22
|
+
outline: ${theme.shared.hover.outline};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* Hovering adds data-focused and the item stays focused after hovering away */
|
|
26
|
+
&[data-focused] {
|
|
27
|
+
background-color: ${theme.shared.hover.backgroundColor};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Override default browser focus behaviour */
|
|
31
|
+
:focus-visible {
|
|
32
|
+
outline: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&[data-focus-visible] {
|
|
36
|
+
outline: ${theme.shared.option.focused.outline};
|
|
37
|
+
outline-offset: ${theme.shared.option.focused["outline-offset"]};
|
|
38
|
+
background-color: ${theme.shared.option.focused.backgroundColor};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Must be last to take precedence */
|
|
42
|
+
&[data-pressed] {
|
|
43
|
+
background-color: ${theme.shared.pressed.backgroundColor};
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
};
|
|
47
|
+
const listBoxStyles = (theme) => {
|
|
48
|
+
return react.css`
|
|
49
|
+
${typography.convertTypographyToEmotionStringStyle(theme.shared.listBox.typography)}
|
|
50
|
+
background-color: ${theme.shared.listBox.backgroundColor};
|
|
51
|
+
border: ${theme.shared.listBox.border};
|
|
52
|
+
box-shadow: ${theme.shared.listBox.shadow};
|
|
53
|
+
max-width: ${theme.shared.maxWidth};
|
|
54
|
+
width: ${theme.shared.width};
|
|
55
|
+
outline: none;
|
|
56
|
+
`;
|
|
57
|
+
};
|
|
58
|
+
const buttonStyles = (theme, isInvalid) => {
|
|
59
|
+
return react.css`
|
|
60
|
+
display: ${theme.shared.button.display};
|
|
61
|
+
justify-content: ${theme.shared.button.justifyContent};
|
|
62
|
+
align-items: ${theme.shared.button.alignItems};
|
|
63
|
+
background-color: ${theme.shared.button.backgroundColor};
|
|
64
|
+
border: ${theme.shared.button.border};
|
|
65
|
+
border-radius: ${theme.shared.button.borderRadius};
|
|
66
|
+
height: ${theme.shared.button.height};
|
|
67
|
+
padding-left: ${theme.shared.button.paddingLeft};
|
|
68
|
+
padding-right: ${theme.shared.button.paddingRight};
|
|
69
|
+
margin-top: ${theme.shared.button.marginTop};
|
|
70
|
+
${typography.convertTypographyToEmotionStringStyle(theme.shared.button.typography)}
|
|
71
|
+
color: ${theme.shared.button.color};
|
|
72
|
+
|
|
73
|
+
&[data-hovered] {
|
|
74
|
+
background-color: ${theme.shared.hover.backgroundColor};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&[data-pressed] {
|
|
78
|
+
background-color: ${theme.shared.pressed.backgroundColor};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&[data-focus-visible] {
|
|
82
|
+
outline: ${theme.shared.button.focused.outline};
|
|
83
|
+
outline-offset: ${theme.shared.button.focused["outline-offset"]};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&[data-disabled] {
|
|
87
|
+
cursor: ${theme.shared.button.disabled.cursor};
|
|
88
|
+
background-color: ${theme.shared.button.disabled.backgroundColor};
|
|
89
|
+
color: ${theme.shared.button.disabled.color};
|
|
90
|
+
border: ${theme.shared.button.disabled.border};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
${isInvalid ? `border: ${theme.shared.button.error.border};` : ``}
|
|
94
|
+
`;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
exports.buttonStyles = buttonStyles;
|
|
98
|
+
exports.defaultSelectTheme = defaultSelectTheme;
|
|
99
|
+
exports.listBoxItemStyles = listBoxItemStyles;
|
|
100
|
+
exports.listBoxStyles = listBoxStyles;
|
|
101
|
+
exports.popoverStyles = popoverStyles;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
|
+
import { componentSelect } from '../../styleD/build/typescript/component/select.js';
|
|
3
|
+
import { convertTypographyToEmotionStringStyle } from '../../styleD/utils/semantic/typography.js';
|
|
4
|
+
|
|
5
|
+
const defaultSelectTheme = componentSelect;
|
|
6
|
+
const popoverStyles = (theme) => {
|
|
7
|
+
return css`
|
|
8
|
+
max-width: ${theme.shared.maxWidth};
|
|
9
|
+
width: ${theme.shared.width};
|
|
10
|
+
`;
|
|
11
|
+
};
|
|
12
|
+
const listBoxItemStyles = (theme) => {
|
|
13
|
+
return css`
|
|
14
|
+
padding-left: ${theme.shared.option.paddingLeft};
|
|
15
|
+
padding-right: ${theme.shared.option.paddingRight};
|
|
16
|
+
padding-top: ${theme.shared.option.paddingTop};
|
|
17
|
+
padding-bottom: ${theme.shared.option.paddingBottom};
|
|
18
|
+
|
|
19
|
+
&[data-hovered] {
|
|
20
|
+
outline: ${theme.shared.hover.outline};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* Hovering adds data-focused and the item stays focused after hovering away */
|
|
24
|
+
&[data-focused] {
|
|
25
|
+
background-color: ${theme.shared.hover.backgroundColor};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Override default browser focus behaviour */
|
|
29
|
+
:focus-visible {
|
|
30
|
+
outline: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&[data-focus-visible] {
|
|
34
|
+
outline: ${theme.shared.option.focused.outline};
|
|
35
|
+
outline-offset: ${theme.shared.option.focused["outline-offset"]};
|
|
36
|
+
background-color: ${theme.shared.option.focused.backgroundColor};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* Must be last to take precedence */
|
|
40
|
+
&[data-pressed] {
|
|
41
|
+
background-color: ${theme.shared.pressed.backgroundColor};
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
};
|
|
45
|
+
const listBoxStyles = (theme) => {
|
|
46
|
+
return css`
|
|
47
|
+
${convertTypographyToEmotionStringStyle(theme.shared.listBox.typography)}
|
|
48
|
+
background-color: ${theme.shared.listBox.backgroundColor};
|
|
49
|
+
border: ${theme.shared.listBox.border};
|
|
50
|
+
box-shadow: ${theme.shared.listBox.shadow};
|
|
51
|
+
max-width: ${theme.shared.maxWidth};
|
|
52
|
+
width: ${theme.shared.width};
|
|
53
|
+
outline: none;
|
|
54
|
+
`;
|
|
55
|
+
};
|
|
56
|
+
const buttonStyles = (theme, isInvalid) => {
|
|
57
|
+
return css`
|
|
58
|
+
display: ${theme.shared.button.display};
|
|
59
|
+
justify-content: ${theme.shared.button.justifyContent};
|
|
60
|
+
align-items: ${theme.shared.button.alignItems};
|
|
61
|
+
background-color: ${theme.shared.button.backgroundColor};
|
|
62
|
+
border: ${theme.shared.button.border};
|
|
63
|
+
border-radius: ${theme.shared.button.borderRadius};
|
|
64
|
+
height: ${theme.shared.button.height};
|
|
65
|
+
padding-left: ${theme.shared.button.paddingLeft};
|
|
66
|
+
padding-right: ${theme.shared.button.paddingRight};
|
|
67
|
+
margin-top: ${theme.shared.button.marginTop};
|
|
68
|
+
${convertTypographyToEmotionStringStyle(theme.shared.button.typography)}
|
|
69
|
+
color: ${theme.shared.button.color};
|
|
70
|
+
|
|
71
|
+
&[data-hovered] {
|
|
72
|
+
background-color: ${theme.shared.hover.backgroundColor};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&[data-pressed] {
|
|
76
|
+
background-color: ${theme.shared.pressed.backgroundColor};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&[data-focus-visible] {
|
|
80
|
+
outline: ${theme.shared.button.focused.outline};
|
|
81
|
+
outline-offset: ${theme.shared.button.focused["outline-offset"]};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&[data-disabled] {
|
|
85
|
+
cursor: ${theme.shared.button.disabled.cursor};
|
|
86
|
+
background-color: ${theme.shared.button.disabled.backgroundColor};
|
|
87
|
+
color: ${theme.shared.button.disabled.color};
|
|
88
|
+
border: ${theme.shared.button.disabled.border};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
${isInvalid ? `border: ${theme.shared.button.error.border};` : ``}
|
|
92
|
+
`;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export { buttonStyles, defaultSelectTheme, listBoxItemStyles, listBoxStyles, popoverStyles };
|
package/dist/form.cjs
ADDED
package/dist/form.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { componentForm } from './styleD/build/typescript/component/form.js';
|
package/dist/index.cjs
CHANGED
|
@@ -10,8 +10,10 @@ 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
12
|
var inlineMessage = require('./styleD/build/typescript/component/inlineMessage.cjs');
|
|
13
|
+
var select = require('./styleD/build/typescript/component/select.cjs');
|
|
13
14
|
var menu = require('./styleD/build/typescript/component/menu.cjs');
|
|
14
15
|
var TopBar = require('./styleD/build/typescript/component/TopBar.cjs');
|
|
16
|
+
var form = require('./styleD/build/typescript/component/form.cjs');
|
|
15
17
|
var colors = require('./styleD/build/typescript/base/colors.cjs');
|
|
16
18
|
var typography = require('./styleD/build/typescript/base/typography.cjs');
|
|
17
19
|
var spacing = require('./styleD/build/typescript/base/spacing.cjs');
|
|
@@ -34,8 +36,10 @@ exports.componentTypography = typography$1.componentTypography;
|
|
|
34
36
|
exports.componentIcon = icon.componentIcon;
|
|
35
37
|
exports.componentFavicon = favicon.componentFavicon;
|
|
36
38
|
exports.componentInlineMessage = inlineMessage.componentInlineMessage;
|
|
39
|
+
exports.componentSelect = select.componentSelect;
|
|
37
40
|
exports.componentMenu = menu.componentMenu;
|
|
38
41
|
exports.componentTopBar = TopBar.componentTopBar;
|
|
42
|
+
exports.componentForm = form.componentForm;
|
|
39
43
|
exports.baseColors = colors.baseColors;
|
|
40
44
|
exports.baseTypography = typography.baseTypography;
|
|
41
45
|
exports.baseSpacing = spacing.baseSpacing;
|
package/dist/index.js
CHANGED
|
@@ -8,8 +8,10 @@ export { componentTypography } from './styleD/build/typescript/component/typogra
|
|
|
8
8
|
export { componentIcon } from './styleD/build/typescript/component/icon.js';
|
|
9
9
|
export { componentFavicon } from './styleD/build/typescript/component/favicon.js';
|
|
10
10
|
export { componentInlineMessage } from './styleD/build/typescript/component/inlineMessage.js';
|
|
11
|
+
export { componentSelect } from './styleD/build/typescript/component/select.js';
|
|
11
12
|
export { componentMenu } from './styleD/build/typescript/component/menu.js';
|
|
12
13
|
export { componentTopBar } from './styleD/build/typescript/component/TopBar.js';
|
|
14
|
+
export { componentForm } from './styleD/build/typescript/component/form.js';
|
|
13
15
|
export { baseColors } from './styleD/build/typescript/base/colors.js';
|
|
14
16
|
export { baseTypography } from './styleD/build/typescript/base/typography.js';
|
|
15
17
|
export { baseSpacing } from './styleD/build/typescript/base/spacing.js';
|
package/dist/select.cjs
ADDED
package/dist/select.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
:root {
|
|
6
|
+
--component-form-input-shared-container-display: flex;
|
|
7
|
+
--component-form-input-shared-container-flex-direction: column;
|
|
8
|
+
--component-form-input-shared-container-gap: 0.25rem;
|
|
9
|
+
--component-form-input-shared-container-width: 100%;
|
|
10
|
+
--component-form-input-shared-label-color: #000000;
|
|
11
|
+
--component-form-input-shared-label-disabled-color: #999999;
|
|
12
|
+
--component-form-input-shared-description-color: #545454;
|
|
13
|
+
--component-form-input-shared-description-typography-font: normal 460
|
|
14
|
+
0.875rem/1.3 'Open Sans';
|
|
15
|
+
--component-form-input-shared-description-typography-letter-spacing: 0;
|
|
16
|
+
--component-form-input-shared-description-typography-font-width: 95;
|
|
17
|
+
--component-form-input-shared-description-disabled-color: #999999;
|
|
18
|
+
--component-form-input-sm-container-max-width: 200px;
|
|
19
|
+
--component-form-input-sm-label-typography-font: normal 700 0.875rem/1.15
|
|
20
|
+
'Open Sans';
|
|
21
|
+
--component-form-input-sm-label-typography-letter-spacing: -0.0125rem;
|
|
22
|
+
--component-form-input-sm-label-typography-font-width: 95;
|
|
23
|
+
--component-form-input-md-container-max-width: 320px;
|
|
24
|
+
--component-form-input-md-label-typography-font: normal 700 1rem/1.15
|
|
25
|
+
'Open Sans';
|
|
26
|
+
--component-form-input-md-label-typography-letter-spacing: -0.03125rem;
|
|
27
|
+
--component-form-input-md-label-typography-font-width: 95;
|
|
28
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
:root {
|
|
6
|
+
--component-select-shared-max-width: 320px;
|
|
7
|
+
--component-select-shared-width: 100%;
|
|
8
|
+
--component-select-shared-hover-background-color: #f6f6f6;
|
|
9
|
+
--component-select-shared-hover-outline: none; /** Override outline focus styles on hover */
|
|
10
|
+
--component-select-shared-pressed-background-color: #ededed;
|
|
11
|
+
--component-select-shared-button-display: flex;
|
|
12
|
+
--component-select-shared-button-justify-content: space-between;
|
|
13
|
+
--component-select-shared-button-align-items: center;
|
|
14
|
+
--component-select-shared-button-margin-top: 0.25rem;
|
|
15
|
+
--component-select-shared-button-background-color: #ffffff;
|
|
16
|
+
--component-select-shared-button-border: 0.0625rem solid #545454;
|
|
17
|
+
--component-select-shared-button-border-radius: 0.25rem;
|
|
18
|
+
--component-select-shared-button-height: 2.5rem;
|
|
19
|
+
--component-select-shared-button-padding-left: 0.75rem;
|
|
20
|
+
--component-select-shared-button-padding-right: 0.25rem;
|
|
21
|
+
--component-select-shared-button-color: #545454;
|
|
22
|
+
--component-select-shared-button-typography-font: normal 460 1rem/1.3
|
|
23
|
+
'Open Sans';
|
|
24
|
+
--component-select-shared-button-typography-letter-spacing: 0;
|
|
25
|
+
--component-select-shared-button-typography-font-width: 95;
|
|
26
|
+
--component-select-shared-button-focused-outline: 0.125rem solid #0072a9;
|
|
27
|
+
--component-select-shared-button-focused-outline-offset: 0.125rem;
|
|
28
|
+
--component-select-shared-button-disabled-background-color: #ffffff;
|
|
29
|
+
--component-select-shared-button-disabled-cursor: not-allowed;
|
|
30
|
+
--component-select-shared-button-disabled-color: #999999;
|
|
31
|
+
--component-select-shared-button-disabled-border: 0.0625rem solid #dcdcdc;
|
|
32
|
+
--component-select-shared-button-error-border: 0.0625rem solid #b42a19;
|
|
33
|
+
--component-select-shared-option-padding-left: 1rem;
|
|
34
|
+
--component-select-shared-option-padding-right: 1rem;
|
|
35
|
+
--component-select-shared-option-padding-top: 0.75rem;
|
|
36
|
+
--component-select-shared-option-padding-bottom: 0.75rem;
|
|
37
|
+
--component-select-shared-option-focused-outline: 0.125rem solid #0072a9;
|
|
38
|
+
--component-select-shared-option-focused-outline-offset: 0;
|
|
39
|
+
--component-select-shared-option-focused-background-color: inherit;
|
|
40
|
+
--component-select-shared-list-box-typography-font: normal 460 1rem/1.3
|
|
41
|
+
'Open Sans';
|
|
42
|
+
--component-select-shared-list-box-typography-letter-spacing: 0;
|
|
43
|
+
--component-select-shared-list-box-typography-font-width: 95;
|
|
44
|
+
--component-select-shared-list-box-border: 0.0625rem solid #cccccc;
|
|
45
|
+
--component-select-shared-list-box-background-color: #ffffff;
|
|
46
|
+
--component-select-shared-list-box-shadow: 0 0.125rem 0.375rem 0
|
|
47
|
+
rgb(0% 0% 0% / 0.3);
|
|
48
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const componentForm = {
|
|
4
|
+
input: {
|
|
5
|
+
shared: {
|
|
6
|
+
container: {
|
|
7
|
+
display: "flex",
|
|
8
|
+
"flex-direction": "column",
|
|
9
|
+
gap: "0.25rem",
|
|
10
|
+
width: "100%"
|
|
11
|
+
},
|
|
12
|
+
label: {
|
|
13
|
+
color: "#000000",
|
|
14
|
+
disabled: {
|
|
15
|
+
color: "#999999"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
description: {
|
|
19
|
+
color: "#545454",
|
|
20
|
+
typography: {
|
|
21
|
+
font: "normal 460 0.875rem/1.3 Open Sans",
|
|
22
|
+
letterSpacing: "0rem",
|
|
23
|
+
fontWidth: 95
|
|
24
|
+
},
|
|
25
|
+
disabled: {
|
|
26
|
+
color: "#999999"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
sm: {
|
|
31
|
+
container: {
|
|
32
|
+
"max-width": "200px"
|
|
33
|
+
},
|
|
34
|
+
label: {
|
|
35
|
+
typography: {
|
|
36
|
+
font: "normal 700 0.875rem/1.15 Open Sans",
|
|
37
|
+
letterSpacing: "-0.0125rem",
|
|
38
|
+
fontWidth: 95
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
md: {
|
|
43
|
+
container: {
|
|
44
|
+
"max-width": "320px"
|
|
45
|
+
},
|
|
46
|
+
label: {
|
|
47
|
+
typography: {
|
|
48
|
+
font: "normal 700 1rem/1.15 Open Sans",
|
|
49
|
+
letterSpacing: "-0.03125rem",
|
|
50
|
+
fontWidth: 95
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
exports.componentForm = componentForm;
|