@guardian/stand 0.0.19 → 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 +6 -15
- package/dist/components/select/Select.js +5 -5
- package/dist/components/select/styles.cjs +30 -55
- package/dist/components/select/styles.js +31 -53
- package/dist/form.cjs +7 -0
- package/dist/form.js +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.js +1 -0
- package/dist/styleD/build/css/component/form.css +28 -0
- package/dist/styleD/build/css/component/select.css +37 -46
- 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 +50 -69
- package/dist/styleD/build/typescript/component/select.js +50 -69
- 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 +1 -1
- package/dist/types/components/select/styles.d.ts +0 -3
- package/dist/types/components/select/types.d.ts +2 -14
- package/dist/types/form.d.ts +8 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/styleD/build/typescript/component/form.d.ts +57 -0
- package/dist/types/styleD/build/typescript/component/select.d.ts +46 -65
- package/package.json +20 -11
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 };
|
|
@@ -4,8 +4,8 @@ var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var reactAriaComponents = require('react-aria-components');
|
|
6
6
|
var mergeDeep = require('../../util/mergeDeep.cjs');
|
|
7
|
+
var Form = require('../form/Form.cjs');
|
|
7
8
|
var Icon = require('../icon/Icon.cjs');
|
|
8
|
-
var InlineMessage = require('../inline-message/InlineMessage.cjs');
|
|
9
9
|
var styles = require('./styles.cjs');
|
|
10
10
|
|
|
11
11
|
function Option({ children, theme = {} }) {
|
|
@@ -30,33 +30,24 @@ function ListBox({ children, theme = {} }) {
|
|
|
30
30
|
return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.ListBox, { css: styles.listBoxStyles(mergedTheme), children: items });
|
|
31
31
|
}
|
|
32
32
|
function Select({
|
|
33
|
-
children,
|
|
34
|
-
label,
|
|
35
|
-
contextualHelpText,
|
|
36
|
-
theme = {},
|
|
37
|
-
cssOverrides,
|
|
38
|
-
className,
|
|
39
33
|
isInvalid,
|
|
40
|
-
|
|
34
|
+
theme = {},
|
|
35
|
+
children,
|
|
41
36
|
...props
|
|
42
37
|
}) {
|
|
43
38
|
const mergedTheme = mergeDeep.mergeDeep(styles.defaultSelectTheme, theme);
|
|
44
39
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
45
|
-
|
|
40
|
+
Form.FormInputContainer,
|
|
46
41
|
{
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
as: reactAriaComponents.Select,
|
|
43
|
+
size: "md",
|
|
49
44
|
isInvalid,
|
|
50
45
|
...props,
|
|
51
46
|
children: [
|
|
52
|
-
label && /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Label, { css: styles.labelStyles(mergedTheme), children: label }),
|
|
53
|
-
" ",
|
|
54
|
-
contextualHelpText && /* @__PURE__ */ jsxRuntime.jsx("div", { css: styles.helpTextStyles(mergedTheme), children: contextualHelpText }),
|
|
55
47
|
/* @__PURE__ */ jsxRuntime.jsxs(reactAriaComponents.Button, { css: styles.buttonStyles(mergedTheme, isInvalid), children: [
|
|
56
48
|
/* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.SelectValue, {}),
|
|
57
49
|
/* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { symbol: "keyboard_arrow_down", size: "lg" })
|
|
58
50
|
] }),
|
|
59
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.FieldError, { children: /* @__PURE__ */ jsxRuntime.jsx(InlineMessage.InlineMessage, { level: "error", children: errorMessage }) }),
|
|
60
51
|
/* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Popover, { css: styles.popoverStyles(mergedTheme), children: /* @__PURE__ */ jsxRuntime.jsx(ListBox, { children }) })
|
|
61
52
|
]
|
|
62
53
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Select as Select$1,
|
|
3
|
+
import { Select as Select$1, Button, SelectValue, Popover, ListBox as ListBox$1, ListBoxItem } from 'react-aria-components';
|
|
4
4
|
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
5
|
+
import { FormInputContainer } from '../form/Form.js';
|
|
5
6
|
import { Icon } from '../icon/Icon.js';
|
|
6
|
-
import {
|
|
7
|
-
import { labelStyles, helpTextStyles, buttonStyles, popoverStyles, selectStyles, defaultSelectTheme, listBoxStyles, listBoxItemStyles } from './styles.js';
|
|
7
|
+
import { buttonStyles, popoverStyles, defaultSelectTheme, listBoxStyles, listBoxItemStyles } from './styles.js';
|
|
8
8
|
|
|
9
9
|
function Option({ children, theme = {} }) {
|
|
10
10
|
const mergedTheme = mergeDeep(defaultSelectTheme, theme);
|
|
@@ -25,9 +25,9 @@ function ListBox({ children, theme = {} }) {
|
|
|
25
25
|
});
|
|
26
26
|
return jsx(ListBox$1, { css: listBoxStyles(mergedTheme), children: items });
|
|
27
27
|
}
|
|
28
|
-
function Select({
|
|
28
|
+
function Select({ isInvalid, theme = {}, children, ...props }) {
|
|
29
29
|
const mergedTheme = mergeDeep(defaultSelectTheme, theme);
|
|
30
|
-
return jsxs(
|
|
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
31
|
}
|
|
32
32
|
|
|
33
33
|
export { Option, Select };
|
|
@@ -5,16 +5,6 @@ var select = require('../../styleD/build/typescript/component/select.cjs');
|
|
|
5
5
|
var typography = require('../../styleD/utils/semantic/typography.cjs');
|
|
6
6
|
|
|
7
7
|
const defaultSelectTheme = select.componentSelect;
|
|
8
|
-
const selectStyles = (theme) => {
|
|
9
|
-
return react.css`
|
|
10
|
-
display: ${theme.shared.display};
|
|
11
|
-
flex-direction: ${theme.shared.flexDirection};
|
|
12
|
-
gap: ${theme.shared.gap};
|
|
13
|
-
|
|
14
|
-
max-width: ${theme.shared.maxWidth};
|
|
15
|
-
width: ${theme.shared.width};
|
|
16
|
-
`;
|
|
17
|
-
};
|
|
18
8
|
const popoverStyles = (theme) => {
|
|
19
9
|
return react.css`
|
|
20
10
|
max-width: ${theme.shared.maxWidth};
|
|
@@ -23,10 +13,10 @@ const popoverStyles = (theme) => {
|
|
|
23
13
|
};
|
|
24
14
|
const listBoxItemStyles = (theme) => {
|
|
25
15
|
return react.css`
|
|
26
|
-
padding-left: ${theme.option.paddingLeft};
|
|
27
|
-
padding-right: ${theme.option.paddingRight};
|
|
28
|
-
padding-top: ${theme.option.paddingTop};
|
|
29
|
-
padding-bottom: ${theme.option.paddingBottom};
|
|
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};
|
|
30
20
|
|
|
31
21
|
&[data-hovered] {
|
|
32
22
|
outline: ${theme.shared.hover.outline};
|
|
@@ -43,9 +33,9 @@ const listBoxItemStyles = (theme) => {
|
|
|
43
33
|
}
|
|
44
34
|
|
|
45
35
|
&[data-focus-visible] {
|
|
46
|
-
outline: ${theme.option.focused.outline};
|
|
47
|
-
outline-offset: ${theme.option.focused["outline-offset"]};
|
|
48
|
-
background-color: ${theme.option.focused.backgroundColor};
|
|
36
|
+
outline: ${theme.shared.option.focused.outline};
|
|
37
|
+
outline-offset: ${theme.shared.option.focused["outline-offset"]};
|
|
38
|
+
background-color: ${theme.shared.option.focused.backgroundColor};
|
|
49
39
|
}
|
|
50
40
|
|
|
51
41
|
/* Must be last to take precedence */
|
|
@@ -56,41 +46,29 @@ const listBoxItemStyles = (theme) => {
|
|
|
56
46
|
};
|
|
57
47
|
const listBoxStyles = (theme) => {
|
|
58
48
|
return react.css`
|
|
59
|
-
${typography.convertTypographyToEmotionStringStyle(theme.listBox.typography)}
|
|
60
|
-
background-color: ${theme.listBox.backgroundColor};
|
|
61
|
-
border: ${theme.listBox.border};
|
|
62
|
-
box-shadow: ${theme.listBox.shadow};
|
|
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};
|
|
63
53
|
max-width: ${theme.shared.maxWidth};
|
|
64
54
|
width: ${theme.shared.width};
|
|
65
55
|
outline: none;
|
|
66
56
|
`;
|
|
67
57
|
};
|
|
68
|
-
const labelStyles = (theme) => {
|
|
69
|
-
return react.css`
|
|
70
|
-
color: ${theme.label.color};
|
|
71
|
-
${typography.convertTypographyToEmotionStringStyle(theme.label.typography)};
|
|
72
|
-
`;
|
|
73
|
-
};
|
|
74
|
-
const helpTextStyles = (theme) => {
|
|
75
|
-
return react.css`
|
|
76
|
-
color: ${theme.helpText.color};
|
|
77
|
-
${typography.convertTypographyToEmotionStringStyle(theme.helpText.typography)}
|
|
78
|
-
`;
|
|
79
|
-
};
|
|
80
58
|
const buttonStyles = (theme, isInvalid) => {
|
|
81
59
|
return react.css`
|
|
82
|
-
display: ${theme.button.display};
|
|
83
|
-
justify-content: ${theme.button.justifyContent};
|
|
84
|
-
align-items: ${theme.button.alignItems};
|
|
85
|
-
background-color: ${theme.button.backgroundColor};
|
|
86
|
-
border: ${theme.button.border};
|
|
87
|
-
border-radius: ${theme.button.borderRadius};
|
|
88
|
-
height: ${theme.button.height};
|
|
89
|
-
padding-left: ${theme.button.paddingLeft};
|
|
90
|
-
padding-right: ${theme.button.paddingRight};
|
|
91
|
-
margin-top: ${theme.button.marginTop};
|
|
92
|
-
${typography.convertTypographyToEmotionStringStyle(theme.button.typography)}
|
|
93
|
-
color: ${theme.button.color};
|
|
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};
|
|
94
72
|
|
|
95
73
|
&[data-hovered] {
|
|
96
74
|
background-color: ${theme.shared.hover.backgroundColor};
|
|
@@ -101,26 +79,23 @@ const buttonStyles = (theme, isInvalid) => {
|
|
|
101
79
|
}
|
|
102
80
|
|
|
103
81
|
&[data-focus-visible] {
|
|
104
|
-
outline: ${theme.button.focused.outline};
|
|
105
|
-
outline-offset: ${theme.button.focused["outline-offset"]};
|
|
82
|
+
outline: ${theme.shared.button.focused.outline};
|
|
83
|
+
outline-offset: ${theme.shared.button.focused["outline-offset"]};
|
|
106
84
|
}
|
|
107
85
|
|
|
108
86
|
&[data-disabled] {
|
|
109
|
-
cursor: ${theme.button.disabled.cursor};
|
|
110
|
-
background-color: ${theme.button.disabled.backgroundColor};
|
|
111
|
-
color: ${theme.button.disabled.color};
|
|
112
|
-
border: ${theme.button.disabled.border};
|
|
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};
|
|
113
91
|
}
|
|
114
92
|
|
|
115
|
-
${isInvalid ? `border: ${theme.button.error.border};` : ``}
|
|
93
|
+
${isInvalid ? `border: ${theme.shared.button.error.border};` : ``}
|
|
116
94
|
`;
|
|
117
95
|
};
|
|
118
96
|
|
|
119
97
|
exports.buttonStyles = buttonStyles;
|
|
120
98
|
exports.defaultSelectTheme = defaultSelectTheme;
|
|
121
|
-
exports.helpTextStyles = helpTextStyles;
|
|
122
|
-
exports.labelStyles = labelStyles;
|
|
123
99
|
exports.listBoxItemStyles = listBoxItemStyles;
|
|
124
100
|
exports.listBoxStyles = listBoxStyles;
|
|
125
101
|
exports.popoverStyles = popoverStyles;
|
|
126
|
-
exports.selectStyles = selectStyles;
|
|
@@ -3,16 +3,6 @@ import { componentSelect } from '../../styleD/build/typescript/component/select.
|
|
|
3
3
|
import { convertTypographyToEmotionStringStyle } from '../../styleD/utils/semantic/typography.js';
|
|
4
4
|
|
|
5
5
|
const defaultSelectTheme = componentSelect;
|
|
6
|
-
const selectStyles = (theme) => {
|
|
7
|
-
return css`
|
|
8
|
-
display: ${theme.shared.display};
|
|
9
|
-
flex-direction: ${theme.shared.flexDirection};
|
|
10
|
-
gap: ${theme.shared.gap};
|
|
11
|
-
|
|
12
|
-
max-width: ${theme.shared.maxWidth};
|
|
13
|
-
width: ${theme.shared.width};
|
|
14
|
-
`;
|
|
15
|
-
};
|
|
16
6
|
const popoverStyles = (theme) => {
|
|
17
7
|
return css`
|
|
18
8
|
max-width: ${theme.shared.maxWidth};
|
|
@@ -21,10 +11,10 @@ const popoverStyles = (theme) => {
|
|
|
21
11
|
};
|
|
22
12
|
const listBoxItemStyles = (theme) => {
|
|
23
13
|
return css`
|
|
24
|
-
padding-left: ${theme.option.paddingLeft};
|
|
25
|
-
padding-right: ${theme.option.paddingRight};
|
|
26
|
-
padding-top: ${theme.option.paddingTop};
|
|
27
|
-
padding-bottom: ${theme.option.paddingBottom};
|
|
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};
|
|
28
18
|
|
|
29
19
|
&[data-hovered] {
|
|
30
20
|
outline: ${theme.shared.hover.outline};
|
|
@@ -41,9 +31,9 @@ const listBoxItemStyles = (theme) => {
|
|
|
41
31
|
}
|
|
42
32
|
|
|
43
33
|
&[data-focus-visible] {
|
|
44
|
-
outline: ${theme.option.focused.outline};
|
|
45
|
-
outline-offset: ${theme.option.focused["outline-offset"]};
|
|
46
|
-
background-color: ${theme.option.focused.backgroundColor};
|
|
34
|
+
outline: ${theme.shared.option.focused.outline};
|
|
35
|
+
outline-offset: ${theme.shared.option.focused["outline-offset"]};
|
|
36
|
+
background-color: ${theme.shared.option.focused.backgroundColor};
|
|
47
37
|
}
|
|
48
38
|
|
|
49
39
|
/* Must be last to take precedence */
|
|
@@ -54,41 +44,29 @@ const listBoxItemStyles = (theme) => {
|
|
|
54
44
|
};
|
|
55
45
|
const listBoxStyles = (theme) => {
|
|
56
46
|
return css`
|
|
57
|
-
${convertTypographyToEmotionStringStyle(theme.listBox.typography)}
|
|
58
|
-
background-color: ${theme.listBox.backgroundColor};
|
|
59
|
-
border: ${theme.listBox.border};
|
|
60
|
-
box-shadow: ${theme.listBox.shadow};
|
|
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};
|
|
61
51
|
max-width: ${theme.shared.maxWidth};
|
|
62
52
|
width: ${theme.shared.width};
|
|
63
53
|
outline: none;
|
|
64
54
|
`;
|
|
65
55
|
};
|
|
66
|
-
const labelStyles = (theme) => {
|
|
67
|
-
return css`
|
|
68
|
-
color: ${theme.label.color};
|
|
69
|
-
${convertTypographyToEmotionStringStyle(theme.label.typography)};
|
|
70
|
-
`;
|
|
71
|
-
};
|
|
72
|
-
const helpTextStyles = (theme) => {
|
|
73
|
-
return css`
|
|
74
|
-
color: ${theme.helpText.color};
|
|
75
|
-
${convertTypographyToEmotionStringStyle(theme.helpText.typography)}
|
|
76
|
-
`;
|
|
77
|
-
};
|
|
78
56
|
const buttonStyles = (theme, isInvalid) => {
|
|
79
57
|
return css`
|
|
80
|
-
display: ${theme.button.display};
|
|
81
|
-
justify-content: ${theme.button.justifyContent};
|
|
82
|
-
align-items: ${theme.button.alignItems};
|
|
83
|
-
background-color: ${theme.button.backgroundColor};
|
|
84
|
-
border: ${theme.button.border};
|
|
85
|
-
border-radius: ${theme.button.borderRadius};
|
|
86
|
-
height: ${theme.button.height};
|
|
87
|
-
padding-left: ${theme.button.paddingLeft};
|
|
88
|
-
padding-right: ${theme.button.paddingRight};
|
|
89
|
-
margin-top: ${theme.button.marginTop};
|
|
90
|
-
${convertTypographyToEmotionStringStyle(theme.button.typography)}
|
|
91
|
-
color: ${theme.button.color};
|
|
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};
|
|
92
70
|
|
|
93
71
|
&[data-hovered] {
|
|
94
72
|
background-color: ${theme.shared.hover.backgroundColor};
|
|
@@ -99,19 +77,19 @@ const buttonStyles = (theme, isInvalid) => {
|
|
|
99
77
|
}
|
|
100
78
|
|
|
101
79
|
&[data-focus-visible] {
|
|
102
|
-
outline: ${theme.button.focused.outline};
|
|
103
|
-
outline-offset: ${theme.button.focused["outline-offset"]};
|
|
80
|
+
outline: ${theme.shared.button.focused.outline};
|
|
81
|
+
outline-offset: ${theme.shared.button.focused["outline-offset"]};
|
|
104
82
|
}
|
|
105
83
|
|
|
106
84
|
&[data-disabled] {
|
|
107
|
-
cursor: ${theme.button.disabled.cursor};
|
|
108
|
-
background-color: ${theme.button.disabled.backgroundColor};
|
|
109
|
-
color: ${theme.button.disabled.color};
|
|
110
|
-
border: ${theme.button.disabled.border};
|
|
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};
|
|
111
89
|
}
|
|
112
90
|
|
|
113
|
-
${isInvalid ? `border: ${theme.button.error.border};` : ``}
|
|
91
|
+
${isInvalid ? `border: ${theme.shared.button.error.border};` : ``}
|
|
114
92
|
`;
|
|
115
93
|
};
|
|
116
94
|
|
|
117
|
-
export { buttonStyles, defaultSelectTheme,
|
|
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
|
@@ -13,6 +13,7 @@ var inlineMessage = require('./styleD/build/typescript/component/inlineMessage.c
|
|
|
13
13
|
var select = require('./styleD/build/typescript/component/select.cjs');
|
|
14
14
|
var menu = require('./styleD/build/typescript/component/menu.cjs');
|
|
15
15
|
var TopBar = require('./styleD/build/typescript/component/TopBar.cjs');
|
|
16
|
+
var form = require('./styleD/build/typescript/component/form.cjs');
|
|
16
17
|
var colors = require('./styleD/build/typescript/base/colors.cjs');
|
|
17
18
|
var typography = require('./styleD/build/typescript/base/typography.cjs');
|
|
18
19
|
var spacing = require('./styleD/build/typescript/base/spacing.cjs');
|
|
@@ -38,6 +39,7 @@ exports.componentInlineMessage = inlineMessage.componentInlineMessage;
|
|
|
38
39
|
exports.componentSelect = select.componentSelect;
|
|
39
40
|
exports.componentMenu = menu.componentMenu;
|
|
40
41
|
exports.componentTopBar = TopBar.componentTopBar;
|
|
42
|
+
exports.componentForm = form.componentForm;
|
|
41
43
|
exports.baseColors = colors.baseColors;
|
|
42
44
|
exports.baseTypography = typography.baseTypography;
|
|
43
45
|
exports.baseSpacing = spacing.baseSpacing;
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,7 @@ export { componentInlineMessage } from './styleD/build/typescript/component/inli
|
|
|
11
11
|
export { componentSelect } from './styleD/build/typescript/component/select.js';
|
|
12
12
|
export { componentMenu } from './styleD/build/typescript/component/menu.js';
|
|
13
13
|
export { componentTopBar } from './styleD/build/typescript/component/TopBar.js';
|
|
14
|
+
export { componentForm } from './styleD/build/typescript/component/form.js';
|
|
14
15
|
export { baseColors } from './styleD/build/typescript/base/colors.js';
|
|
15
16
|
export { baseTypography } from './styleD/build/typescript/base/typography.js';
|
|
16
17
|
export { baseSpacing } from './styleD/build/typescript/base/spacing.js';
|
|
@@ -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
|
+
}
|