@guardian/stand 0.0.18 → 0.0.19
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/select/Select.cjs +67 -0
- package/dist/components/select/Select.js +33 -0
- package/dist/components/select/styles.cjs +126 -0
- package/dist/components/select/styles.js +117 -0
- package/dist/index.cjs +2 -0
- package/dist/index.js +1 -0
- package/dist/select.cjs +9 -0
- package/dist/select.js +2 -0
- package/dist/styleD/build/css/component/select.css +57 -0
- package/dist/styleD/build/typescript/component/select.cjs +88 -0
- package/dist/styleD/build/typescript/component/select.js +86 -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 +13 -0
- package/dist/types/components/select/types.d.ts +21 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/select.d.ts +20 -0
- package/dist/types/styleD/build/typescript/component/select.d.ts +88 -0
- package/package.json +25 -10
|
@@ -0,0 +1,67 @@
|
|
|
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 Icon = require('../icon/Icon.cjs');
|
|
8
|
+
var InlineMessage = require('../inline-message/InlineMessage.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
|
+
children,
|
|
34
|
+
label,
|
|
35
|
+
contextualHelpText,
|
|
36
|
+
theme = {},
|
|
37
|
+
cssOverrides,
|
|
38
|
+
className,
|
|
39
|
+
isInvalid,
|
|
40
|
+
errorMessage,
|
|
41
|
+
...props
|
|
42
|
+
}) {
|
|
43
|
+
const mergedTheme = mergeDeep.mergeDeep(styles.defaultSelectTheme, theme);
|
|
44
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
45
|
+
reactAriaComponents.Select,
|
|
46
|
+
{
|
|
47
|
+
css: [styles.selectStyles(mergedTheme), cssOverrides],
|
|
48
|
+
className,
|
|
49
|
+
isInvalid,
|
|
50
|
+
...props,
|
|
51
|
+
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
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactAriaComponents.Button, { css: styles.buttonStyles(mergedTheme, isInvalid), children: [
|
|
56
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.SelectValue, {}),
|
|
57
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { symbol: "keyboard_arrow_down", size: "lg" })
|
|
58
|
+
] }),
|
|
59
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.FieldError, { children: /* @__PURE__ */ jsxRuntime.jsx(InlineMessage.InlineMessage, { level: "error", children: errorMessage }) }),
|
|
60
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Popover, { css: styles.popoverStyles(mergedTheme), children: /* @__PURE__ */ jsxRuntime.jsx(ListBox, { children }) })
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
exports.Option = Option;
|
|
67
|
+
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, Label, Button, SelectValue, FieldError, Popover, ListBox as ListBox$1, ListBoxItem } from 'react-aria-components';
|
|
4
|
+
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
5
|
+
import { Icon } from '../icon/Icon.js';
|
|
6
|
+
import { InlineMessage } from '../inline-message/InlineMessage.js';
|
|
7
|
+
import { labelStyles, helpTextStyles, buttonStyles, popoverStyles, selectStyles, 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({ children, label, contextualHelpText, theme = {}, cssOverrides, className, isInvalid, errorMessage, ...props }) {
|
|
29
|
+
const mergedTheme = mergeDeep(defaultSelectTheme, theme);
|
|
30
|
+
return jsxs(Select$1, { css: [selectStyles(mergedTheme), cssOverrides], className, isInvalid, ...props, children: [label && jsx(Label, { css: labelStyles(mergedTheme), children: label }), " ", contextualHelpText && jsx("div", { css: helpTextStyles(mergedTheme), children: contextualHelpText }), jsxs(Button, { css: buttonStyles(mergedTheme, isInvalid), children: [jsx(SelectValue, {}), jsx(Icon, { symbol: "keyboard_arrow_down", size: "lg" })] }), jsx(FieldError, { children: jsx(InlineMessage, { level: "error", children: errorMessage }) }), jsx(Popover, { css: popoverStyles(mergedTheme), children: jsx(ListBox, { children }) })] });
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { Option, Select };
|
|
@@ -0,0 +1,126 @@
|
|
|
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 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
|
+
const popoverStyles = (theme) => {
|
|
19
|
+
return react.css`
|
|
20
|
+
max-width: ${theme.shared.maxWidth};
|
|
21
|
+
width: ${theme.shared.width};
|
|
22
|
+
`;
|
|
23
|
+
};
|
|
24
|
+
const listBoxItemStyles = (theme) => {
|
|
25
|
+
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};
|
|
30
|
+
|
|
31
|
+
&[data-hovered] {
|
|
32
|
+
outline: ${theme.shared.hover.outline};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Hovering adds data-focused and the item stays focused after hovering away */
|
|
36
|
+
&[data-focused] {
|
|
37
|
+
background-color: ${theme.shared.hover.backgroundColor};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* Override default browser focus behaviour */
|
|
41
|
+
:focus-visible {
|
|
42
|
+
outline: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&[data-focus-visible] {
|
|
46
|
+
outline: ${theme.option.focused.outline};
|
|
47
|
+
outline-offset: ${theme.option.focused["outline-offset"]};
|
|
48
|
+
background-color: ${theme.option.focused.backgroundColor};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Must be last to take precedence */
|
|
52
|
+
&[data-pressed] {
|
|
53
|
+
background-color: ${theme.shared.pressed.backgroundColor};
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
};
|
|
57
|
+
const listBoxStyles = (theme) => {
|
|
58
|
+
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};
|
|
63
|
+
max-width: ${theme.shared.maxWidth};
|
|
64
|
+
width: ${theme.shared.width};
|
|
65
|
+
outline: none;
|
|
66
|
+
`;
|
|
67
|
+
};
|
|
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
|
+
const buttonStyles = (theme, isInvalid) => {
|
|
81
|
+
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};
|
|
94
|
+
|
|
95
|
+
&[data-hovered] {
|
|
96
|
+
background-color: ${theme.shared.hover.backgroundColor};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&[data-pressed] {
|
|
100
|
+
background-color: ${theme.shared.pressed.backgroundColor};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&[data-focus-visible] {
|
|
104
|
+
outline: ${theme.button.focused.outline};
|
|
105
|
+
outline-offset: ${theme.button.focused["outline-offset"]};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&[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};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
${isInvalid ? `border: ${theme.button.error.border};` : ``}
|
|
116
|
+
`;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
exports.buttonStyles = buttonStyles;
|
|
120
|
+
exports.defaultSelectTheme = defaultSelectTheme;
|
|
121
|
+
exports.helpTextStyles = helpTextStyles;
|
|
122
|
+
exports.labelStyles = labelStyles;
|
|
123
|
+
exports.listBoxItemStyles = listBoxItemStyles;
|
|
124
|
+
exports.listBoxStyles = listBoxStyles;
|
|
125
|
+
exports.popoverStyles = popoverStyles;
|
|
126
|
+
exports.selectStyles = selectStyles;
|
|
@@ -0,0 +1,117 @@
|
|
|
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 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
|
+
const popoverStyles = (theme) => {
|
|
17
|
+
return css`
|
|
18
|
+
max-width: ${theme.shared.maxWidth};
|
|
19
|
+
width: ${theme.shared.width};
|
|
20
|
+
`;
|
|
21
|
+
};
|
|
22
|
+
const listBoxItemStyles = (theme) => {
|
|
23
|
+
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};
|
|
28
|
+
|
|
29
|
+
&[data-hovered] {
|
|
30
|
+
outline: ${theme.shared.hover.outline};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Hovering adds data-focused and the item stays focused after hovering away */
|
|
34
|
+
&[data-focused] {
|
|
35
|
+
background-color: ${theme.shared.hover.backgroundColor};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Override default browser focus behaviour */
|
|
39
|
+
:focus-visible {
|
|
40
|
+
outline: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&[data-focus-visible] {
|
|
44
|
+
outline: ${theme.option.focused.outline};
|
|
45
|
+
outline-offset: ${theme.option.focused["outline-offset"]};
|
|
46
|
+
background-color: ${theme.option.focused.backgroundColor};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* Must be last to take precedence */
|
|
50
|
+
&[data-pressed] {
|
|
51
|
+
background-color: ${theme.shared.pressed.backgroundColor};
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
};
|
|
55
|
+
const listBoxStyles = (theme) => {
|
|
56
|
+
return css`
|
|
57
|
+
${convertTypographyToEmotionStringStyle(theme.listBox.typography)}
|
|
58
|
+
background-color: ${theme.listBox.backgroundColor};
|
|
59
|
+
border: ${theme.listBox.border};
|
|
60
|
+
box-shadow: ${theme.listBox.shadow};
|
|
61
|
+
max-width: ${theme.shared.maxWidth};
|
|
62
|
+
width: ${theme.shared.width};
|
|
63
|
+
outline: none;
|
|
64
|
+
`;
|
|
65
|
+
};
|
|
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
|
+
const buttonStyles = (theme, isInvalid) => {
|
|
79
|
+
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};
|
|
92
|
+
|
|
93
|
+
&[data-hovered] {
|
|
94
|
+
background-color: ${theme.shared.hover.backgroundColor};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&[data-pressed] {
|
|
98
|
+
background-color: ${theme.shared.pressed.backgroundColor};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&[data-focus-visible] {
|
|
102
|
+
outline: ${theme.button.focused.outline};
|
|
103
|
+
outline-offset: ${theme.button.focused["outline-offset"]};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&[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};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
${isInvalid ? `border: ${theme.button.error.border};` : ``}
|
|
114
|
+
`;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export { buttonStyles, defaultSelectTheme, helpTextStyles, labelStyles, listBoxItemStyles, listBoxStyles, popoverStyles, selectStyles };
|
package/dist/index.cjs
CHANGED
|
@@ -10,6 +10,7 @@ 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');
|
|
15
16
|
var colors = require('./styleD/build/typescript/base/colors.cjs');
|
|
@@ -34,6 +35,7 @@ exports.componentTypography = typography$1.componentTypography;
|
|
|
34
35
|
exports.componentIcon = icon.componentIcon;
|
|
35
36
|
exports.componentFavicon = favicon.componentFavicon;
|
|
36
37
|
exports.componentInlineMessage = inlineMessage.componentInlineMessage;
|
|
38
|
+
exports.componentSelect = select.componentSelect;
|
|
37
39
|
exports.componentMenu = menu.componentMenu;
|
|
38
40
|
exports.componentTopBar = TopBar.componentTopBar;
|
|
39
41
|
exports.baseColors = colors.baseColors;
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ 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';
|
|
13
14
|
export { baseColors } from './styleD/build/typescript/base/colors.js';
|
package/dist/select.cjs
ADDED
package/dist/select.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
:root {
|
|
6
|
+
--component-select-shared-display: flex;
|
|
7
|
+
--component-select-shared-flex-direction: column;
|
|
8
|
+
--component-select-shared-gap: 0.25rem;
|
|
9
|
+
--component-select-shared-max-width: 333px;
|
|
10
|
+
--component-select-shared-width: 100%;
|
|
11
|
+
--component-select-shared-hover-background-color: #f6f6f6;
|
|
12
|
+
--component-select-shared-hover-outline: none; /** Override outline focus styles on hover */
|
|
13
|
+
--component-select-shared-pressed-background-color: #ededed;
|
|
14
|
+
--component-select-label-color: #000000;
|
|
15
|
+
--component-select-label-typography-font: normal 700 1rem/1.15 'Open Sans';
|
|
16
|
+
--component-select-label-typography-letter-spacing: -0.03125rem;
|
|
17
|
+
--component-select-label-typography-font-width: 95;
|
|
18
|
+
--component-select-help-text-color: #545454;
|
|
19
|
+
--component-select-help-text-typography-font: normal 460 0.875rem/1.3
|
|
20
|
+
'Open Sans';
|
|
21
|
+
--component-select-help-text-typography-letter-spacing: 0;
|
|
22
|
+
--component-select-help-text-typography-font-width: 95;
|
|
23
|
+
--component-select-button-display: flex;
|
|
24
|
+
--component-select-button-justify-content: space-between;
|
|
25
|
+
--component-select-button-align-items: center;
|
|
26
|
+
--component-select-button-margin-top: 0.25rem;
|
|
27
|
+
--component-select-button-background-color: #ffffff;
|
|
28
|
+
--component-select-button-border: 0.0625rem solid #545454;
|
|
29
|
+
--component-select-button-border-radius: 0.25rem;
|
|
30
|
+
--component-select-button-height: 2.5rem;
|
|
31
|
+
--component-select-button-padding-left: 0.75rem;
|
|
32
|
+
--component-select-button-padding-right: 0.25rem;
|
|
33
|
+
--component-select-button-color: #545454;
|
|
34
|
+
--component-select-button-typography-font: normal 460 1rem/1.3 'Open Sans';
|
|
35
|
+
--component-select-button-typography-letter-spacing: 0;
|
|
36
|
+
--component-select-button-typography-font-width: 95;
|
|
37
|
+
--component-select-button-focused-outline: 0.125rem solid #0072a9;
|
|
38
|
+
--component-select-button-focused-outline-offset: 0.125rem;
|
|
39
|
+
--component-select-button-disabled-background-color: #ffffff;
|
|
40
|
+
--component-select-button-disabled-cursor: not-allowed;
|
|
41
|
+
--component-select-button-disabled-color: #999999;
|
|
42
|
+
--component-select-button-disabled-border: 0.0625rem solid #dcdcdc;
|
|
43
|
+
--component-select-button-error-border: 0.0625rem solid #b42a19;
|
|
44
|
+
--component-select-option-padding-left: 1rem;
|
|
45
|
+
--component-select-option-padding-right: 1rem;
|
|
46
|
+
--component-select-option-padding-top: 0.75rem;
|
|
47
|
+
--component-select-option-padding-bottom: 0.75rem;
|
|
48
|
+
--component-select-option-focused-outline: 0.125rem solid #0072a9;
|
|
49
|
+
--component-select-option-focused-outline-offset: 0;
|
|
50
|
+
--component-select-option-focused-background-color: inherit;
|
|
51
|
+
--component-select-list-box-typography-font: normal 460 1rem/1.3 'Open Sans';
|
|
52
|
+
--component-select-list-box-typography-letter-spacing: 0;
|
|
53
|
+
--component-select-list-box-typography-font-width: 95;
|
|
54
|
+
--component-select-list-box-border: 0.0625rem solid #cccccc;
|
|
55
|
+
--component-select-list-box-background-color: #ffffff;
|
|
56
|
+
--component-select-list-box-shadow: 0 0.125rem 0.375rem 0 rgb(0% 0% 0% / 0.3);
|
|
57
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const componentSelect = {
|
|
4
|
+
shared: {
|
|
5
|
+
display: "flex",
|
|
6
|
+
flexDirection: "column",
|
|
7
|
+
gap: "0.25rem",
|
|
8
|
+
maxWidth: "333px",
|
|
9
|
+
width: "100%",
|
|
10
|
+
hover: {
|
|
11
|
+
backgroundColor: "#f6f6f6",
|
|
12
|
+
outline: "none"
|
|
13
|
+
},
|
|
14
|
+
pressed: {
|
|
15
|
+
backgroundColor: "#ededed"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
label: {
|
|
19
|
+
color: "#000000",
|
|
20
|
+
typography: {
|
|
21
|
+
font: "normal 700 1rem/1.15 Open Sans",
|
|
22
|
+
letterSpacing: "-0.03125rem",
|
|
23
|
+
fontWidth: 95
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
helpText: {
|
|
27
|
+
color: "#545454",
|
|
28
|
+
typography: {
|
|
29
|
+
font: "normal 460 0.875rem/1.3 Open Sans",
|
|
30
|
+
letterSpacing: "0rem",
|
|
31
|
+
fontWidth: 95
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
button: {
|
|
35
|
+
display: "flex",
|
|
36
|
+
justifyContent: "space-between",
|
|
37
|
+
alignItems: "center",
|
|
38
|
+
marginTop: "0.25rem",
|
|
39
|
+
backgroundColor: "#ffffff",
|
|
40
|
+
border: "0.0625rem solid #545454",
|
|
41
|
+
borderRadius: "0.25rem",
|
|
42
|
+
height: "2.5rem",
|
|
43
|
+
paddingLeft: "0.75rem",
|
|
44
|
+
paddingRight: "0.25rem",
|
|
45
|
+
color: "#545454",
|
|
46
|
+
typography: {
|
|
47
|
+
font: "normal 460 1rem/1.3 Open Sans",
|
|
48
|
+
letterSpacing: "0rem",
|
|
49
|
+
fontWidth: 95
|
|
50
|
+
},
|
|
51
|
+
focused: {
|
|
52
|
+
outline: "0.125rem solid #0072a9",
|
|
53
|
+
"outline-offset": "0.125rem"
|
|
54
|
+
},
|
|
55
|
+
disabled: {
|
|
56
|
+
backgroundColor: "#ffffff",
|
|
57
|
+
cursor: "not-allowed",
|
|
58
|
+
color: "#999999",
|
|
59
|
+
border: "0.0625rem solid #dcdcdc"
|
|
60
|
+
},
|
|
61
|
+
error: {
|
|
62
|
+
border: "0.0625rem solid #b42a19"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
option: {
|
|
66
|
+
paddingLeft: "1rem",
|
|
67
|
+
paddingRight: "1rem",
|
|
68
|
+
paddingTop: "0.75rem",
|
|
69
|
+
paddingBottom: "0.75rem",
|
|
70
|
+
focused: {
|
|
71
|
+
outline: "0.125rem solid #0072a9",
|
|
72
|
+
"outline-offset": "0",
|
|
73
|
+
backgroundColor: "inherit"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
listBox: {
|
|
77
|
+
typography: {
|
|
78
|
+
font: "normal 460 1rem/1.3 Open Sans",
|
|
79
|
+
letterSpacing: "0rem",
|
|
80
|
+
fontWidth: 95
|
|
81
|
+
},
|
|
82
|
+
border: "0.0625rem solid #cccccc",
|
|
83
|
+
backgroundColor: "#ffffff",
|
|
84
|
+
shadow: "0 0.125rem 0.375rem 0 rgb(0% 0% 0% / 0.3)"
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
exports.componentSelect = componentSelect;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
const componentSelect = {
|
|
2
|
+
shared: {
|
|
3
|
+
display: "flex",
|
|
4
|
+
flexDirection: "column",
|
|
5
|
+
gap: "0.25rem",
|
|
6
|
+
maxWidth: "333px",
|
|
7
|
+
width: "100%",
|
|
8
|
+
hover: {
|
|
9
|
+
backgroundColor: "#f6f6f6",
|
|
10
|
+
outline: "none"
|
|
11
|
+
},
|
|
12
|
+
pressed: {
|
|
13
|
+
backgroundColor: "#ededed"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
label: {
|
|
17
|
+
color: "#000000",
|
|
18
|
+
typography: {
|
|
19
|
+
font: "normal 700 1rem/1.15 Open Sans",
|
|
20
|
+
letterSpacing: "-0.03125rem",
|
|
21
|
+
fontWidth: 95
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
helpText: {
|
|
25
|
+
color: "#545454",
|
|
26
|
+
typography: {
|
|
27
|
+
font: "normal 460 0.875rem/1.3 Open Sans",
|
|
28
|
+
letterSpacing: "0rem",
|
|
29
|
+
fontWidth: 95
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
button: {
|
|
33
|
+
display: "flex",
|
|
34
|
+
justifyContent: "space-between",
|
|
35
|
+
alignItems: "center",
|
|
36
|
+
marginTop: "0.25rem",
|
|
37
|
+
backgroundColor: "#ffffff",
|
|
38
|
+
border: "0.0625rem solid #545454",
|
|
39
|
+
borderRadius: "0.25rem",
|
|
40
|
+
height: "2.5rem",
|
|
41
|
+
paddingLeft: "0.75rem",
|
|
42
|
+
paddingRight: "0.25rem",
|
|
43
|
+
color: "#545454",
|
|
44
|
+
typography: {
|
|
45
|
+
font: "normal 460 1rem/1.3 Open Sans",
|
|
46
|
+
letterSpacing: "0rem",
|
|
47
|
+
fontWidth: 95
|
|
48
|
+
},
|
|
49
|
+
focused: {
|
|
50
|
+
outline: "0.125rem solid #0072a9",
|
|
51
|
+
"outline-offset": "0.125rem"
|
|
52
|
+
},
|
|
53
|
+
disabled: {
|
|
54
|
+
backgroundColor: "#ffffff",
|
|
55
|
+
cursor: "not-allowed",
|
|
56
|
+
color: "#999999",
|
|
57
|
+
border: "0.0625rem solid #dcdcdc"
|
|
58
|
+
},
|
|
59
|
+
error: {
|
|
60
|
+
border: "0.0625rem solid #b42a19"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
option: {
|
|
64
|
+
paddingLeft: "1rem",
|
|
65
|
+
paddingRight: "1rem",
|
|
66
|
+
paddingTop: "0.75rem",
|
|
67
|
+
paddingBottom: "0.75rem",
|
|
68
|
+
focused: {
|
|
69
|
+
outline: "0.125rem solid #0072a9",
|
|
70
|
+
"outline-offset": "0",
|
|
71
|
+
backgroundColor: "inherit"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
listBox: {
|
|
75
|
+
typography: {
|
|
76
|
+
font: "normal 460 1rem/1.3 Open Sans",
|
|
77
|
+
letterSpacing: "0rem",
|
|
78
|
+
fontWidth: 95
|
|
79
|
+
},
|
|
80
|
+
border: "0.0625rem solid #cccccc",
|
|
81
|
+
backgroundColor: "#ffffff",
|
|
82
|
+
shadow: "0 0.125rem 0.375rem 0 rgb(0% 0% 0% / 0.3)"
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export { componentSelect };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { OptionProps, SelectProps } from './types';
|
|
2
|
+
export declare function Option({ children, theme }: OptionProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function Select({ children, label, contextualHelpText, theme, cssOverrides, className, isInvalid, errorMessage, ...props }: SelectProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const componentName = "Select";
|
|
2
|
+
export declare const componentTsx = "import { Select } from '@guardian/stand/select';\n\nexport const Component = () => (\n\t<Select label=\"Select\">\n\t\t<Option>Option 1</Option>\n\t\t<Option>Option 2</Option>\n\t</Select>\n);\n";
|
|
3
|
+
export declare const componentCss = "\n/* import the select styles */\n@import '@guardian/stand/component/select.css';\n\n.stand-select-container {\n\tdisplay: var(--component-select-shared-display);\n\tflex-direction: var(--component-select-shared-flex-direction);\n\tgap: var(--component-select-shared-gap);\n\n\tmax-width: var(--component-select-shared-maxWidth);\n\twidth: var(--component-select-shared-width);\n}\n\n.stand-select {\n\t\tdisplay: var(--component-select-button-display);\n\t\tjustify-content: var(--component-select-button-justify-content);\n\t\talign-items: var(--component-select-button-align-items);\n\t\tbackground-color: var(--component-select-button-background-color);\n\t\tborder: var(--component-select-button-border);\n\t\tborder-radius: var(--component-select-button-border-radius);\n\t\theight: var(--component-select-button-height);\n\t\tpadding-left: var(--component-select-button-padding-left);\n\t\tpadding-right: var(--component-select-button-padding-right);\n\t\tmargin-top: var(--component-select-button-margin-top);\n\t\tcolor: var(--component-select-button-color);\n\n\t\tfont: var(--component-select-button-body-md-typography-font);\n\t\tletter-spacing: var(--component-select-button-body-md-typography-letter-spacing);\n\t\tfont-variation-settings: \"wdth\" var(--component-select-button-body-md-typography-font-width);\n\n\n\t\t&:hover {\n\t\t\tbackground: var(--component-select-shared-hover-background-color);\n\t\t}\n\n\t\t&:active {\n\t\t\tbackground: var(--component-select-shared-active-background-color);\n\t\t}\n\n\t\t&:focus-visible {\n\t\t\toutline: var(--component-select-button-focused-outline);\n\t\t\toutline-offset: var(--component-select-button-focused-outline-offset);\n\t\t}\n\n\t\t&:disabled {\n\t\t\tcursor: var(--component-select-button-disabled-cursor);\n\t\t\tbackground-color: var(--component-select-button-disabled-background-color);\n\t\t\tcolor: var(--component-select-button-disabled-color);\n\t\t\tborder: var(--component-select-button-disabled-border);\n\t\t}\n}\n";
|
|
4
|
+
export declare const componentHtml = "<div class=\"container\">\n\t<div class=\"stand-select-container\">\n\t\t<label>Select</label>\n\t\t<select class=\"stand-select\">\n\t\t\t<option>Option 1</option>\n\t\t\t<option>Option 2</option>\n\t\t</select>\n\t</div>\n</div>\n";
|
|
5
|
+
export declare const componentJs = "\nimport { componentSelect } from \"@guardian/stand\";\n\n// example of creating a stylesheet in js\nconst sheet = new CSSStyleSheet();\n\n// apply the rules to the sheet\nsheet.replaceSync(`\n\n.js-stand-select-container {\n\tdisplay: ${componentSelect.shared.display};\n\tflex-direction: ${componentSelect.shared.flexDirection};\n\tgap: ${componentSelect.shared.gap};\n\n\tmax-width: ${componentSelect.shared.maxWidth};\n\twidth: ${componentSelect.shared.width};\n}\n\n.js-stand-select {\n\tdisplay: ${componentSelect.button.display};\n\tjustify-content: ${componentSelect.button.justifyContent};\n\talign-items: ${componentSelect.button.alignItems};\n\tbackground-color: ${componentSelect.button.backgroundColor};\n\tborder: ${componentSelect.button.border};\n\tborder-radius: ${componentSelect.button.borderRadius};\n\theight: ${componentSelect.button.height};\n\tpadding-left: ${componentSelect.button.paddingLeft};\n\tpadding-right: ${componentSelect.button.paddingRight};\n\tmargin-top: ${componentSelect.button.marginTop};\n\tcolor: ${componentSelect.button.color};\n\n\tfont: ${componentSelect.button.typography.font};\n\tletter-spacing: ${componentSelect.button.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentSelect.button.typography.fontWidth};\n\n\t&:hover {\n\t\tbackground: ${componentSelect.shared.hover.backgroundColor};\n\t}\n\n\t&:active {\n\t\tbackground: ${componentSelect.shared.pressed.backgroundColor};\n\t}\n\n\t&:focus-visible {\n\t\toutline: ${componentSelect.button.focused.outline};\n\t\toutline-offset: ${componentSelect.button.focused['outline-offset']};\n\t}\n\n\t&:disabled {\n\t\tcursor: ${componentSelect.button.disabled.cursor};\n\t\tbackground-color: ${componentSelect.button.disabled.backgroundColor};\n\t\tcolor: ${componentSelect.button.disabled.color};\n\t\tborder: ${componentSelect.button.disabled.border};\n\t}\n}\n`);\n\n// update the document with the sheet\ndocument.adoptedStyleSheets.push(sheet);\n\ndocument.getElementById(\"app\").innerHTML = `\n\t<div class=\"js-stand-select-container\">\n\t\t<label>Select</label>\n\t\t<select class=\"js-stand-select\">\n\t\t\t<option>Option 1</option>\n\t\t\t<option>Option 2</option>\n\t\t</select>\n\t</div>\n`;\n";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SerializedStyles } from '@emotion/react';
|
|
2
|
+
import type { ComponentSelect } from '../../styleD/build/typescript/component/select';
|
|
3
|
+
import type { DeepPartial, Prettify } from '../../util/types';
|
|
4
|
+
export type SelectTheme = Prettify<ComponentSelect>;
|
|
5
|
+
export type PartialSelectTheme = DeepPartial<SelectTheme>;
|
|
6
|
+
export declare const defaultSelectTheme: SelectTheme;
|
|
7
|
+
export declare const selectStyles: (theme: SelectTheme) => SerializedStyles;
|
|
8
|
+
export declare const popoverStyles: (theme: SelectTheme) => SerializedStyles;
|
|
9
|
+
export declare const listBoxItemStyles: (theme: SelectTheme) => SerializedStyles;
|
|
10
|
+
export declare const listBoxStyles: (theme: SelectTheme) => SerializedStyles;
|
|
11
|
+
export declare const labelStyles: (theme: SelectTheme) => SerializedStyles;
|
|
12
|
+
export declare const helpTextStyles: (theme: SelectTheme) => SerializedStyles;
|
|
13
|
+
export declare const buttonStyles: (theme: SelectTheme, isInvalid?: boolean) => SerializedStyles;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ListBoxItemProps as RACListBoxItemProps, ListBoxProps as RACListBoxProps, SelectProps as RACSelectProps } from 'react-aria-components';
|
|
2
|
+
import type { DefaultPropsWithChildren } from '../../util/types';
|
|
3
|
+
import type { SelectTheme } from './styles';
|
|
4
|
+
export interface OptionProps extends DefaultPropsWithChildren<SelectTheme, RACListBoxItemProps['className']>, Omit<RACListBoxItemProps, 'children'> {
|
|
5
|
+
}
|
|
6
|
+
export interface ListBoxProps extends DefaultPropsWithChildren<SelectTheme, RACListBoxProps<object>['className']>, Omit<RACListBoxProps<object>, 'children'> {
|
|
7
|
+
}
|
|
8
|
+
export interface SelectProps extends DefaultPropsWithChildren<SelectTheme, RACSelectProps<object>['className']>, Omit<RACSelectProps<object>, 'children'> {
|
|
9
|
+
/**
|
|
10
|
+
* The label text of the select box
|
|
11
|
+
*/
|
|
12
|
+
label: string;
|
|
13
|
+
/**
|
|
14
|
+
* Validation error message
|
|
15
|
+
*/
|
|
16
|
+
errorMessage?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Optional contextual help text
|
|
19
|
+
*/
|
|
20
|
+
contextualHelpText?: string;
|
|
21
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ export { componentFavicon } from './styleD/build/typescript/component/favicon';
|
|
|
28
28
|
export type { ComponentFavicon } from './styleD/build/typescript/component/favicon';
|
|
29
29
|
export { componentInlineMessage } from './styleD/build/typescript/component/inlineMessage';
|
|
30
30
|
export type { ComponentInlineMessage } from './styleD/build/typescript/component/inlineMessage';
|
|
31
|
+
export { componentSelect } from './styleD/build/typescript/component/select';
|
|
32
|
+
export type { ComponentSelect } from './styleD/build/typescript/component/select';
|
|
31
33
|
export { componentMenu } from './styleD/build/typescript/component/menu';
|
|
32
34
|
export type { ComponentMenu } from './styleD/build/typescript/component/menu';
|
|
33
35
|
export { componentTopBar } from './styleD/build/typescript/component/TopBar';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Select component entry point
|
|
3
|
+
*
|
|
4
|
+
* Peer dependencies required to use these components:
|
|
5
|
+
* - `@emotion/react`
|
|
6
|
+
* - `react`
|
|
7
|
+
* - `react-dom`
|
|
8
|
+
* - `react-aria-components`
|
|
9
|
+
* - `typescript`
|
|
10
|
+
*
|
|
11
|
+
* See the `peerDependencies` section of package.json for compatible versions.
|
|
12
|
+
*
|
|
13
|
+
* If you only need the built CSS (./component/select.css),
|
|
14
|
+
* you don't need to install these.
|
|
15
|
+
*/
|
|
16
|
+
export { Select } from './components/select/Select';
|
|
17
|
+
export type { SelectProps } from './components/select/types';
|
|
18
|
+
export type { PartialSelectTheme as SelectTheme } from './components/select/styles';
|
|
19
|
+
export { componentSelect } from './styleD/build/typescript/component/select';
|
|
20
|
+
export type { ComponentSelect } from './styleD/build/typescript/component/select';
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
export declare const componentSelect: {
|
|
5
|
+
shared: {
|
|
6
|
+
display: string;
|
|
7
|
+
flexDirection: string;
|
|
8
|
+
gap: string;
|
|
9
|
+
maxWidth: string;
|
|
10
|
+
width: string;
|
|
11
|
+
hover: {
|
|
12
|
+
backgroundColor: string;
|
|
13
|
+
outline: string;
|
|
14
|
+
};
|
|
15
|
+
pressed: {
|
|
16
|
+
backgroundColor: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
label: {
|
|
20
|
+
color: string;
|
|
21
|
+
typography: {
|
|
22
|
+
font: string;
|
|
23
|
+
letterSpacing: string;
|
|
24
|
+
fontWidth: number;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
helpText: {
|
|
28
|
+
color: string;
|
|
29
|
+
typography: {
|
|
30
|
+
font: string;
|
|
31
|
+
letterSpacing: string;
|
|
32
|
+
fontWidth: number;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
button: {
|
|
36
|
+
display: string;
|
|
37
|
+
justifyContent: string;
|
|
38
|
+
alignItems: string;
|
|
39
|
+
marginTop: string;
|
|
40
|
+
backgroundColor: string;
|
|
41
|
+
border: string;
|
|
42
|
+
borderRadius: string;
|
|
43
|
+
height: string;
|
|
44
|
+
paddingLeft: string;
|
|
45
|
+
paddingRight: string;
|
|
46
|
+
color: string;
|
|
47
|
+
typography: {
|
|
48
|
+
font: string;
|
|
49
|
+
letterSpacing: string;
|
|
50
|
+
fontWidth: number;
|
|
51
|
+
};
|
|
52
|
+
focused: {
|
|
53
|
+
outline: string;
|
|
54
|
+
'outline-offset': string;
|
|
55
|
+
};
|
|
56
|
+
disabled: {
|
|
57
|
+
backgroundColor: string;
|
|
58
|
+
cursor: string;
|
|
59
|
+
color: string;
|
|
60
|
+
border: string;
|
|
61
|
+
};
|
|
62
|
+
error: {
|
|
63
|
+
border: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
option: {
|
|
67
|
+
paddingLeft: string;
|
|
68
|
+
paddingRight: string;
|
|
69
|
+
paddingTop: string;
|
|
70
|
+
paddingBottom: string;
|
|
71
|
+
focused: {
|
|
72
|
+
outline: string;
|
|
73
|
+
'outline-offset': string;
|
|
74
|
+
backgroundColor: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
listBox: {
|
|
78
|
+
typography: {
|
|
79
|
+
font: string;
|
|
80
|
+
letterSpacing: string;
|
|
81
|
+
fontWidth: number;
|
|
82
|
+
};
|
|
83
|
+
border: string;
|
|
84
|
+
backgroundColor: string;
|
|
85
|
+
shadow: string;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
export type ComponentSelect = typeof componentSelect;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guardian/stand",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"//exports": "Each component has its own entry point for optimal tree-shaking. Main entry point only includes design tokens and utilities. New components/foundations should follow the same pattern.",
|
|
6
6
|
"exports": {
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
"import": "./dist/avatar.js",
|
|
15
15
|
"require": "./dist/avatar.cjs"
|
|
16
16
|
},
|
|
17
|
-
"./
|
|
18
|
-
"types": "./dist/types/
|
|
19
|
-
"import": "./dist/
|
|
20
|
-
"require": "./dist/
|
|
17
|
+
"./AvatarLink": {
|
|
18
|
+
"types": "./dist/types/avatarLink.d.ts",
|
|
19
|
+
"import": "./dist/avatarLink.js",
|
|
20
|
+
"require": "./dist/avatarLink.cjs"
|
|
21
21
|
},
|
|
22
|
-
"./
|
|
23
|
-
"types": "./dist/types/
|
|
24
|
-
"import": "./dist/
|
|
25
|
-
"require": "./dist/
|
|
22
|
+
"./AvatarButton": {
|
|
23
|
+
"types": "./dist/types/avatarButton.d.ts",
|
|
24
|
+
"import": "./dist/avatarButton.js",
|
|
25
|
+
"require": "./dist/avatarButton.cjs"
|
|
26
26
|
},
|
|
27
27
|
"./button": {
|
|
28
28
|
"types": "./dist/types/button.d.ts",
|
|
@@ -74,6 +74,11 @@
|
|
|
74
74
|
"import": "./dist/inline-message.js",
|
|
75
75
|
"require": "./dist/inline-message.cjs"
|
|
76
76
|
},
|
|
77
|
+
"./select": {
|
|
78
|
+
"types": "./dist/types/select.d.ts",
|
|
79
|
+
"import": "./dist/select.js",
|
|
80
|
+
"require": "./dist/select.cjs"
|
|
81
|
+
},
|
|
77
82
|
"./byline": {
|
|
78
83
|
"types": "./dist/types/byline.d.ts",
|
|
79
84
|
"import": "./dist/byline.js",
|
|
@@ -119,7 +124,8 @@
|
|
|
119
124
|
"./component/favicon.css": "./dist/styleD/build/css/component/favicon.css",
|
|
120
125
|
"./component/menu.css": "./dist/styleD/build/css/component/menu.css",
|
|
121
126
|
"./component/TopBar.css": "./dist/styleD/build/css/component/TopBar.css",
|
|
122
|
-
"./component/inlineMessage.css": "./dist/styleD/build/css/component/inlineMessage.css"
|
|
127
|
+
"./component/inlineMessage.css": "./dist/styleD/build/css/component/inlineMessage.css",
|
|
128
|
+
"./component/select.css": "./dist/styleD/build/css/component/select.css"
|
|
123
129
|
},
|
|
124
130
|
"//typesVersions": "Provides backward compatibility for TypeScript moduleResolution: node - maps subpath imports to correct type definition files. When adding new components with their own entry points, ensure to add them here.",
|
|
125
131
|
"typesVersions": {
|
|
@@ -127,6 +133,12 @@
|
|
|
127
133
|
"avatar": [
|
|
128
134
|
"./dist/types/avatar.d.ts"
|
|
129
135
|
],
|
|
136
|
+
"AvatarButton": [
|
|
137
|
+
"./dist/types/avatarButton.d.ts"
|
|
138
|
+
],
|
|
139
|
+
"AvatarLink": [
|
|
140
|
+
"./dist/types/avatarLink.d.ts"
|
|
141
|
+
],
|
|
130
142
|
"button": [
|
|
131
143
|
"./dist/types/button.d.ts"
|
|
132
144
|
],
|
|
@@ -168,6 +180,9 @@
|
|
|
168
180
|
],
|
|
169
181
|
"inline-message": [
|
|
170
182
|
"./dist/types/inline-message.d.ts"
|
|
183
|
+
],
|
|
184
|
+
"select": [
|
|
185
|
+
"./dist/types/select.d.ts"
|
|
171
186
|
]
|
|
172
187
|
}
|
|
173
188
|
},
|