@guardian/stand 0.0.29 → 0.0.31
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/tag-picker/Autocomplete.cjs +107 -0
- package/dist/components/tag-picker/Autocomplete.js +26 -0
- package/dist/components/tag-picker/TagAutocomplete.cjs +15 -83
- package/dist/components/tag-picker/TagAutocomplete.js +4 -22
- package/dist/components/tag-picker/TagTable.cjs +5 -5
- package/dist/components/tag-picker/TagTable.js +5 -5
- package/dist/components/tag-picker/styles.cjs +10 -7
- package/dist/components/tag-picker/styles.js +10 -7
- package/dist/components/topbar/TopBar.cjs +8 -1
- package/dist/components/topbar/TopBar.js +1 -1
- package/dist/components/topbar/styles.cjs +4 -1
- package/dist/components/topbar/styles.js +4 -1
- package/dist/index.cjs +24 -24
- package/dist/index.js +12 -12
- package/dist/styleD/build/css/component/TopBar.css +5 -1
- package/dist/styleD/build/css/component/autocomplete.css +26 -0
- package/dist/styleD/build/typescript/component/TopBar.cjs +5 -1
- package/dist/styleD/build/typescript/component/TopBar.js +5 -1
- package/dist/styleD/build/typescript/component/{tagAutocomplete.js → autocomplete.cjs} +8 -3
- package/dist/styleD/build/typescript/component/{tagAutocomplete.cjs → autocomplete.js} +6 -5
- package/dist/tag-picker.cjs +6 -4
- package/dist/tag-picker.js +3 -2
- package/dist/types/components/tag-picker/Autocomplete.d.ts +117 -0
- package/dist/types/components/tag-picker/TagAutocomplete.d.ts +34 -23
- package/dist/types/components/tag-picker/example-tags.d.ts +2 -2
- package/dist/types/components/tag-picker/styles.d.ts +5 -5
- package/dist/types/components/tag-picker/types.d.ts +4 -5
- package/dist/types/index.d.ts +24 -24
- package/dist/types/styleD/build/typescript/component/TopBar.d.ts +5 -1
- package/dist/types/styleD/build/typescript/component/{tagAutocomplete.d.ts → autocomplete.d.ts} +5 -2
- package/dist/types/tag-picker.d.ts +4 -3
- package/package.json +2 -2
- package/dist/styleD/build/css/component/tagAutocomplete.css +0 -23
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
4
|
+
var react = require('@emotion/react');
|
|
5
|
+
var reactAriaComponents = require('react-aria-components');
|
|
6
|
+
var styles = require('./styles.cjs');
|
|
7
|
+
|
|
8
|
+
function Autocomplete({
|
|
9
|
+
addSelection,
|
|
10
|
+
loading,
|
|
11
|
+
onTextInputChange,
|
|
12
|
+
options,
|
|
13
|
+
label,
|
|
14
|
+
placeholder,
|
|
15
|
+
disabled,
|
|
16
|
+
value,
|
|
17
|
+
"data-testid": dataTestId,
|
|
18
|
+
loadingIcon,
|
|
19
|
+
theme,
|
|
20
|
+
cssOverrides
|
|
21
|
+
}) {
|
|
22
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
css: [
|
|
26
|
+
react.css`
|
|
27
|
+
position: relative;
|
|
28
|
+
`,
|
|
29
|
+
cssOverrides
|
|
30
|
+
],
|
|
31
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
32
|
+
reactAriaComponents.ComboBox,
|
|
33
|
+
{
|
|
34
|
+
"aria-label": label,
|
|
35
|
+
inputValue: value,
|
|
36
|
+
onInputChange: onTextInputChange,
|
|
37
|
+
onChange: (key) => {
|
|
38
|
+
const tag = options.find((t) => t.id === key);
|
|
39
|
+
if (tag) {
|
|
40
|
+
addSelection(tag);
|
|
41
|
+
onTextInputChange("");
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
allowsEmptyCollection: true,
|
|
45
|
+
items: options,
|
|
46
|
+
allowsCustomValue: true,
|
|
47
|
+
menuTrigger: "focus",
|
|
48
|
+
shouldFocusWrap: true,
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
51
|
+
reactAriaComponents.Input,
|
|
52
|
+
{
|
|
53
|
+
css: styles.autocompleteInputStyles(theme),
|
|
54
|
+
placeholder,
|
|
55
|
+
disabled,
|
|
56
|
+
"data-testid": dataTestId
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
60
|
+
reactAriaComponents.Popover,
|
|
61
|
+
{
|
|
62
|
+
placement: "bottom",
|
|
63
|
+
css: react.css`
|
|
64
|
+
width: var(--trigger-width);
|
|
65
|
+
`,
|
|
66
|
+
offset: 0,
|
|
67
|
+
shouldFlip: false,
|
|
68
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
69
|
+
reactAriaComponents.ListBox,
|
|
70
|
+
{
|
|
71
|
+
css: (value || options.length || loading) && styles.listboxStyles(theme),
|
|
72
|
+
autoFocus: "first",
|
|
73
|
+
renderEmptyState: () => (
|
|
74
|
+
// Only show a "no results" box if user has typed
|
|
75
|
+
value && !loading && /* @__PURE__ */ jsxRuntime.jsx("div", { css: styles.listboxInfoStyles(theme), children: "No results" })
|
|
76
|
+
),
|
|
77
|
+
children: [
|
|
78
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Collection, { items: options, children: (item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
79
|
+
reactAriaComponents.ListBoxItem,
|
|
80
|
+
{
|
|
81
|
+
css: styles.listboxItemStyles(theme),
|
|
82
|
+
value: item,
|
|
83
|
+
children: item.name
|
|
84
|
+
},
|
|
85
|
+
item.id
|
|
86
|
+
) }),
|
|
87
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
88
|
+
reactAriaComponents.ListBoxLoadMoreItem,
|
|
89
|
+
{
|
|
90
|
+
css: styles.listboxInfoStyles(theme),
|
|
91
|
+
isLoading: loading,
|
|
92
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-label": "Loading", children: loadingIcon ?? "Loading..." })
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
exports.Autocomplete = Autocomplete;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { css } from '@emotion/react';
|
|
3
|
+
import { ComboBox, Input, Popover, ListBox, Collection, ListBoxItem, ListBoxLoadMoreItem } from 'react-aria-components';
|
|
4
|
+
import { autocompleteInputStyles, listboxItemStyles, listboxInfoStyles, listboxStyles } from './styles.js';
|
|
5
|
+
|
|
6
|
+
function Autocomplete({ addSelection, loading, onTextInputChange, options, label, placeholder, disabled, value, "data-testid": dataTestId, loadingIcon, theme, cssOverrides }) {
|
|
7
|
+
return jsx("div", { css: [
|
|
8
|
+
css`
|
|
9
|
+
position: relative;
|
|
10
|
+
`,
|
|
11
|
+
cssOverrides
|
|
12
|
+
], children: jsxs(ComboBox, { "aria-label": label, inputValue: value, onInputChange: onTextInputChange, onChange: (key) => {
|
|
13
|
+
const tag = options.find((t) => t.id === key);
|
|
14
|
+
if (tag) {
|
|
15
|
+
addSelection(tag);
|
|
16
|
+
onTextInputChange("");
|
|
17
|
+
}
|
|
18
|
+
}, allowsEmptyCollection: true, items: options, allowsCustomValue: true, menuTrigger: "focus", shouldFocusWrap: true, children: [jsx(Input, { css: autocompleteInputStyles(theme), placeholder, disabled, "data-testid": dataTestId }), jsx(Popover, { placement: "bottom", css: css`
|
|
19
|
+
width: var(--trigger-width);
|
|
20
|
+
`, offset: 0, shouldFlip: false, children: jsxs(ListBox, { css: (value || options.length || loading) && listboxStyles(theme), autoFocus: "first", renderEmptyState: () => (
|
|
21
|
+
// Only show a "no results" box if user has typed
|
|
22
|
+
value && !loading && jsx("div", { css: listboxInfoStyles(theme), children: "No results" })
|
|
23
|
+
), children: [jsx(Collection, { items: options, children: (item) => jsx(ListBoxItem, { css: listboxItemStyles(theme), value: item, children: item.name }, item.id) }), jsx(ListBoxLoadMoreItem, { css: listboxInfoStyles(theme), isLoading: loading, children: jsx("span", { "aria-label": "Loading", children: loadingIcon ?? "Loading..." }) })] }) })] }) });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { Autocomplete };
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
4
|
-
var
|
|
5
|
-
var reactAriaComponents = require('react-aria-components');
|
|
6
|
-
var styles = require('./styles.cjs');
|
|
4
|
+
var Autocomplete = require('./Autocomplete.cjs');
|
|
7
5
|
|
|
8
6
|
function TagAutocomplete({
|
|
9
7
|
addTag,
|
|
10
8
|
loading,
|
|
11
|
-
|
|
9
|
+
onTextInputChange,
|
|
12
10
|
options,
|
|
13
11
|
label,
|
|
14
12
|
placeholder,
|
|
@@ -20,86 +18,20 @@ function TagAutocomplete({
|
|
|
20
18
|
cssOverrides
|
|
21
19
|
}) {
|
|
22
20
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
23
|
-
|
|
21
|
+
Autocomplete.Autocomplete,
|
|
24
22
|
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
onSelectionChange: (key) => {
|
|
38
|
-
const tag = options.find((t) => t.id === key);
|
|
39
|
-
if (tag) {
|
|
40
|
-
addTag(tag);
|
|
41
|
-
onChange("");
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
allowsEmptyCollection: true,
|
|
45
|
-
items: options,
|
|
46
|
-
allowsCustomValue: true,
|
|
47
|
-
menuTrigger: "focus",
|
|
48
|
-
shouldFocusWrap: true,
|
|
49
|
-
children: [
|
|
50
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
51
|
-
reactAriaComponents.Input,
|
|
52
|
-
{
|
|
53
|
-
css: styles.tagAutocompleteInputStyles(theme),
|
|
54
|
-
placeholder,
|
|
55
|
-
disabled,
|
|
56
|
-
"data-testid": dataTestId
|
|
57
|
-
}
|
|
58
|
-
),
|
|
59
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
60
|
-
reactAriaComponents.Popover,
|
|
61
|
-
{
|
|
62
|
-
placement: "bottom",
|
|
63
|
-
css: react.css`
|
|
64
|
-
width: var(--trigger-width);
|
|
65
|
-
`,
|
|
66
|
-
offset: 0,
|
|
67
|
-
shouldFlip: false,
|
|
68
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
69
|
-
reactAriaComponents.ListBox,
|
|
70
|
-
{
|
|
71
|
-
css: (value || options.length || loading) && styles.listboxStyles(theme),
|
|
72
|
-
autoFocus: "first",
|
|
73
|
-
renderEmptyState: () => (
|
|
74
|
-
// Only show a "no results" box if user has typed
|
|
75
|
-
value && !loading && /* @__PURE__ */ jsxRuntime.jsx("div", { css: styles.listboxInfoStyles(theme), children: "No results" })
|
|
76
|
-
),
|
|
77
|
-
children: [
|
|
78
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Collection, { items: options, children: (item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
79
|
-
reactAriaComponents.ListBoxItem,
|
|
80
|
-
{
|
|
81
|
-
css: styles.listboxItemStyles(theme),
|
|
82
|
-
value: item,
|
|
83
|
-
children: item.internalName
|
|
84
|
-
},
|
|
85
|
-
item.id
|
|
86
|
-
) }),
|
|
87
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
88
|
-
reactAriaComponents.ListBoxLoadMoreItem,
|
|
89
|
-
{
|
|
90
|
-
css: styles.listboxInfoStyles(theme),
|
|
91
|
-
isLoading: loading,
|
|
92
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-label": "Loading", children: loadingIcon ?? "Loading..." })
|
|
93
|
-
}
|
|
94
|
-
)
|
|
95
|
-
]
|
|
96
|
-
}
|
|
97
|
-
)
|
|
98
|
-
}
|
|
99
|
-
)
|
|
100
|
-
]
|
|
101
|
-
}
|
|
102
|
-
)
|
|
23
|
+
onTextInputChange,
|
|
24
|
+
options,
|
|
25
|
+
label,
|
|
26
|
+
addSelection: addTag,
|
|
27
|
+
loading,
|
|
28
|
+
placeholder,
|
|
29
|
+
disabled,
|
|
30
|
+
value,
|
|
31
|
+
"data-testid": dataTestId,
|
|
32
|
+
loadingIcon,
|
|
33
|
+
theme,
|
|
34
|
+
cssOverrides
|
|
103
35
|
}
|
|
104
36
|
);
|
|
105
37
|
}
|
|
@@ -1,26 +1,8 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import {
|
|
3
|
-
import { ComboBox, Input, Popover, ListBox, Collection, ListBoxItem, ListBoxLoadMoreItem } from 'react-aria-components';
|
|
4
|
-
import { tagAutocompleteInputStyles, listboxItemStyles, listboxInfoStyles, listboxStyles } from './styles.js';
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { Autocomplete } from './Autocomplete.js';
|
|
5
3
|
|
|
6
|
-
function TagAutocomplete({ addTag, loading,
|
|
7
|
-
return jsx(
|
|
8
|
-
css`
|
|
9
|
-
position: relative;
|
|
10
|
-
`,
|
|
11
|
-
cssOverrides
|
|
12
|
-
], children: jsxs(ComboBox, { "aria-label": label, inputValue: value, onInputChange: onChange, onSelectionChange: (key) => {
|
|
13
|
-
const tag = options.find((t) => t.id === key);
|
|
14
|
-
if (tag) {
|
|
15
|
-
addTag(tag);
|
|
16
|
-
onChange("");
|
|
17
|
-
}
|
|
18
|
-
}, allowsEmptyCollection: true, items: options, allowsCustomValue: true, menuTrigger: "focus", shouldFocusWrap: true, children: [jsx(Input, { css: tagAutocompleteInputStyles(theme), placeholder, disabled, "data-testid": dataTestId }), jsx(Popover, { placement: "bottom", css: css`
|
|
19
|
-
width: var(--trigger-width);
|
|
20
|
-
`, offset: 0, shouldFlip: false, children: jsxs(ListBox, { css: (value || options.length || loading) && listboxStyles(theme), autoFocus: "first", renderEmptyState: () => (
|
|
21
|
-
// Only show a "no results" box if user has typed
|
|
22
|
-
value && !loading && jsx("div", { css: listboxInfoStyles(theme), children: "No results" })
|
|
23
|
-
), children: [jsx(Collection, { items: options, children: (item) => jsx(ListBoxItem, { css: listboxItemStyles(theme), value: item, children: item.internalName }, item.id) }), jsx(ListBoxLoadMoreItem, { css: listboxInfoStyles(theme), isLoading: loading, children: jsx("span", { "aria-label": "Loading", children: loadingIcon ?? "Loading..." }) })] }) })] }) });
|
|
4
|
+
function TagAutocomplete({ addTag, loading, onTextInputChange, options, label, placeholder, disabled, value, "data-testid": dataTestId, loadingIcon, theme, cssOverrides }) {
|
|
5
|
+
return jsx(Autocomplete, { onTextInputChange, options, label, addSelection: addTag, loading, placeholder, disabled, value, "data-testid": dataTestId, loadingIcon, theme, cssOverrides });
|
|
24
6
|
}
|
|
25
7
|
|
|
26
8
|
export { TagAutocomplete };
|
|
@@ -93,7 +93,7 @@ function TagTable({
|
|
|
93
93
|
{
|
|
94
94
|
id: rowToTag(item).id,
|
|
95
95
|
css: styles.tagTableRowStyles(canDrag, theme),
|
|
96
|
-
textValue: rowToTag(item).
|
|
96
|
+
textValue: rowToTag(item).name,
|
|
97
97
|
children: [
|
|
98
98
|
onReorder && /* @__PURE__ */ jsxRuntime.jsx(
|
|
99
99
|
reactAriaComponents.Cell,
|
|
@@ -129,7 +129,7 @@ function TagTable({
|
|
|
129
129
|
`
|
|
130
130
|
],
|
|
131
131
|
"data-testid": `tags-table-item-${filtered.indexOf(item)}-name`,
|
|
132
|
-
children: rowToTag(item).
|
|
132
|
+
children: rowToTag(item).name
|
|
133
133
|
}
|
|
134
134
|
),
|
|
135
135
|
showTagSectionName && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -141,7 +141,7 @@ function TagTable({
|
|
|
141
141
|
width: 20%;
|
|
142
142
|
`
|
|
143
143
|
],
|
|
144
|
-
children: rowToTag(item).
|
|
144
|
+
children: rowToTag(item).sectionName
|
|
145
145
|
}
|
|
146
146
|
),
|
|
147
147
|
removeTag && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -161,7 +161,7 @@ function TagTable({
|
|
|
161
161
|
onPress: () => {
|
|
162
162
|
removeTag(item);
|
|
163
163
|
},
|
|
164
|
-
"aria-label": `Remove ${rowToTag(item).
|
|
164
|
+
"aria-label": `Remove ${rowToTag(item).name}`,
|
|
165
165
|
children: removeIcon ?? "Remove"
|
|
166
166
|
}
|
|
167
167
|
)
|
|
@@ -184,7 +184,7 @@ function TagTable({
|
|
|
184
184
|
onPress: () => {
|
|
185
185
|
addTag(item);
|
|
186
186
|
},
|
|
187
|
-
"aria-label": `Add ${rowToTag(item).
|
|
187
|
+
"aria-label": `Add ${rowToTag(item).name}`,
|
|
188
188
|
children: "Add"
|
|
189
189
|
}
|
|
190
190
|
)
|
|
@@ -49,7 +49,7 @@ function TagTable({ rows, filterRows, heading, showTagType, showTagSectionName,
|
|
|
49
49
|
if (filtered.length === 0) {
|
|
50
50
|
return null;
|
|
51
51
|
}
|
|
52
|
-
return jsxs("div", { css: cssOverrides, children: [heading && jsx("div", { css: tagTableHeadingStyles(theme), children: heading }), jsxs(Table, { css: tagTableStyles(!!removeTag, theme), "aria-label": "Tag Table", "data-testid": dataTestId, dragAndDropHooks: onReorder && dragAndDropHooks, children: [jsxs(TableHeader, { hidden: true, children: [onReorder && jsx(Column, {}), showTagType && jsx(Column, { children: "Type" }), jsx(Column, { isRowHeader: true, children: "Name" }), showTagSectionName && jsx(Column, { children: "Section" }), removeTag && jsx(Column, {}), addTag && jsx(Column, {})] }), jsx(TableBody, { items: filtered, dependencies: [localRows], children: (item) => jsxs(Row, { id: rowToTag(item).id, css: tagTableRowStyles(canDrag, theme), textValue: rowToTag(item).
|
|
52
|
+
return jsxs("div", { css: cssOverrides, children: [heading && jsx("div", { css: tagTableHeadingStyles(theme), children: heading }), jsxs(Table, { css: tagTableStyles(!!removeTag, theme), "aria-label": "Tag Table", "data-testid": dataTestId, dragAndDropHooks: onReorder && dragAndDropHooks, children: [jsxs(TableHeader, { hidden: true, children: [onReorder && jsx(Column, {}), showTagType && jsx(Column, { children: "Type" }), jsx(Column, { isRowHeader: true, children: "Name" }), showTagSectionName && jsx(Column, { children: "Section" }), removeTag && jsx(Column, {}), addTag && jsx(Column, {})] }), jsx(TableBody, { items: filtered, dependencies: [localRows], children: (item) => jsxs(Row, { id: rowToTag(item).id, css: tagTableRowStyles(canDrag, theme), textValue: rowToTag(item).name, children: [onReorder && jsx(Cell, { css: [
|
|
53
53
|
css`
|
|
54
54
|
width: 1%;
|
|
55
55
|
`
|
|
@@ -64,12 +64,12 @@ function TagTable({ rows, filterRows, heading, showTagType, showTagSectionName,
|
|
|
64
64
|
css`
|
|
65
65
|
width: 50%;
|
|
66
66
|
`
|
|
67
|
-
], "data-testid": `tags-table-item-${filtered.indexOf(item)}-name`, children: rowToTag(item).
|
|
67
|
+
], "data-testid": `tags-table-item-${filtered.indexOf(item)}-name`, children: rowToTag(item).name }), showTagSectionName && jsx(Cell, { css: [
|
|
68
68
|
tagTableCellStyles(theme),
|
|
69
69
|
css`
|
|
70
70
|
width: 20%;
|
|
71
71
|
`
|
|
72
|
-
], children: rowToTag(item).
|
|
72
|
+
], children: rowToTag(item).sectionName }), removeTag && jsx(Cell, { css: [
|
|
73
73
|
tagTableCellStyles(theme),
|
|
74
74
|
css`
|
|
75
75
|
text-align: center;
|
|
@@ -77,7 +77,7 @@ function TagTable({ rows, filterRows, heading, showTagType, showTagSectionName,
|
|
|
77
77
|
`
|
|
78
78
|
], children: canRemove(item) && jsx(Button, { css: tagTableRemoveButtonStyles, onPress: () => {
|
|
79
79
|
removeTag(item);
|
|
80
|
-
}, "aria-label": `Remove ${rowToTag(item).
|
|
80
|
+
}, "aria-label": `Remove ${rowToTag(item).name}`, children: removeIcon ?? "Remove" }) }), addTag && jsx(Cell, { css: [
|
|
81
81
|
tagTableCellStyles(theme),
|
|
82
82
|
css`
|
|
83
83
|
text-align: center;
|
|
@@ -85,7 +85,7 @@ function TagTable({ rows, filterRows, heading, showTagType, showTagSectionName,
|
|
|
85
85
|
`
|
|
86
86
|
], children: jsx(Button, { css: tagTableAddButtonStyles(theme), onPress: () => {
|
|
87
87
|
addTag(item);
|
|
88
|
-
}, "aria-label": `Add ${rowToTag(item).
|
|
88
|
+
}, "aria-label": `Add ${rowToTag(item).name}`, children: "Add" }) })] }, rowToTag(item).id) })] })] });
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
export { TagTable };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var react = require('@emotion/react');
|
|
4
|
-
var
|
|
4
|
+
var autocomplete = require('../../styleD/build/typescript/component/autocomplete.cjs');
|
|
5
5
|
var tagTable = require('../../styleD/build/typescript/component/tagTable.cjs');
|
|
6
6
|
var mergeDeep = require('../../util/mergeDeep.cjs');
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
const theme = mergeDeep.mergeDeep(
|
|
8
|
+
const autocompleteInputStyles = (partialTheme = {}) => {
|
|
9
|
+
const theme = mergeDeep.mergeDeep(autocomplete.componentAutocomplete, partialTheme);
|
|
10
10
|
return react.css`
|
|
11
11
|
width: 100%;
|
|
12
12
|
box-sizing: border-box;
|
|
@@ -23,7 +23,7 @@ const tagAutocompleteInputStyles = (partialTheme = {}) => {
|
|
|
23
23
|
`;
|
|
24
24
|
};
|
|
25
25
|
const listboxStyles = (partialTheme = {}) => {
|
|
26
|
-
const theme = mergeDeep.mergeDeep(
|
|
26
|
+
const theme = mergeDeep.mergeDeep(autocomplete.componentAutocomplete, partialTheme);
|
|
27
27
|
return react.css`
|
|
28
28
|
padding: ${theme.listbox.paddingY} ${theme.listbox.paddingX};
|
|
29
29
|
max-height: 320px;
|
|
@@ -35,20 +35,23 @@ const listboxStyles = (partialTheme = {}) => {
|
|
|
35
35
|
`;
|
|
36
36
|
};
|
|
37
37
|
const listboxItemStyles = (partialTheme = {}) => {
|
|
38
|
-
const theme = mergeDeep.mergeDeep(
|
|
38
|
+
const theme = mergeDeep.mergeDeep(autocomplete.componentAutocomplete, partialTheme);
|
|
39
39
|
return react.css`
|
|
40
40
|
padding: ${theme.listbox.item.paddingY} ${theme.listbox.item.paddingX};
|
|
41
41
|
cursor: pointer;
|
|
42
|
+
color: ${theme.listbox.item.color};
|
|
42
43
|
&:hover {
|
|
43
44
|
background-color: ${theme.listbox.item.backgroundHoverColor};
|
|
45
|
+
color: ${theme.listbox.item.colorHover};
|
|
44
46
|
}
|
|
45
47
|
&[data-focused] {
|
|
46
48
|
background-color: ${theme.listbox.item.backgroundFocusedColor};
|
|
49
|
+
color: ${theme.listbox.item.colorFocused};
|
|
47
50
|
}
|
|
48
51
|
`;
|
|
49
52
|
};
|
|
50
53
|
const listboxInfoStyles = (partialTheme = {}) => {
|
|
51
|
-
const theme = mergeDeep.mergeDeep(
|
|
54
|
+
const theme = mergeDeep.mergeDeep(autocomplete.componentAutocomplete, partialTheme);
|
|
52
55
|
return react.css`
|
|
53
56
|
padding: ${theme.listbox.item.paddingY} ${theme.listbox.item.paddingX};
|
|
54
57
|
`;
|
|
@@ -184,10 +187,10 @@ const tagTableTypeBadgeStyles = (partialTheme = {}) => {
|
|
|
184
187
|
`;
|
|
185
188
|
};
|
|
186
189
|
|
|
190
|
+
exports.autocompleteInputStyles = autocompleteInputStyles;
|
|
187
191
|
exports.listboxInfoStyles = listboxInfoStyles;
|
|
188
192
|
exports.listboxItemStyles = listboxItemStyles;
|
|
189
193
|
exports.listboxStyles = listboxStyles;
|
|
190
|
-
exports.tagAutocompleteInputStyles = tagAutocompleteInputStyles;
|
|
191
194
|
exports.tagTableAddButtonStyles = tagTableAddButtonStyles;
|
|
192
195
|
exports.tagTableCellStyles = tagTableCellStyles;
|
|
193
196
|
exports.tagTableDragButtonStyles = tagTableDragButtonStyles;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
|
-
import {
|
|
2
|
+
import { componentAutocomplete } from '../../styleD/build/typescript/component/autocomplete.js';
|
|
3
3
|
import { componentTagTable } from '../../styleD/build/typescript/component/tagTable.js';
|
|
4
4
|
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
const theme = mergeDeep(
|
|
6
|
+
const autocompleteInputStyles = (partialTheme = {}) => {
|
|
7
|
+
const theme = mergeDeep(componentAutocomplete, partialTheme);
|
|
8
8
|
return css`
|
|
9
9
|
width: 100%;
|
|
10
10
|
box-sizing: border-box;
|
|
@@ -21,7 +21,7 @@ const tagAutocompleteInputStyles = (partialTheme = {}) => {
|
|
|
21
21
|
`;
|
|
22
22
|
};
|
|
23
23
|
const listboxStyles = (partialTheme = {}) => {
|
|
24
|
-
const theme = mergeDeep(
|
|
24
|
+
const theme = mergeDeep(componentAutocomplete, partialTheme);
|
|
25
25
|
return css`
|
|
26
26
|
padding: ${theme.listbox.paddingY} ${theme.listbox.paddingX};
|
|
27
27
|
max-height: 320px;
|
|
@@ -33,20 +33,23 @@ const listboxStyles = (partialTheme = {}) => {
|
|
|
33
33
|
`;
|
|
34
34
|
};
|
|
35
35
|
const listboxItemStyles = (partialTheme = {}) => {
|
|
36
|
-
const theme = mergeDeep(
|
|
36
|
+
const theme = mergeDeep(componentAutocomplete, partialTheme);
|
|
37
37
|
return css`
|
|
38
38
|
padding: ${theme.listbox.item.paddingY} ${theme.listbox.item.paddingX};
|
|
39
39
|
cursor: pointer;
|
|
40
|
+
color: ${theme.listbox.item.color};
|
|
40
41
|
&:hover {
|
|
41
42
|
background-color: ${theme.listbox.item.backgroundHoverColor};
|
|
43
|
+
color: ${theme.listbox.item.colorHover};
|
|
42
44
|
}
|
|
43
45
|
&[data-focused] {
|
|
44
46
|
background-color: ${theme.listbox.item.backgroundFocusedColor};
|
|
47
|
+
color: ${theme.listbox.item.colorFocused};
|
|
45
48
|
}
|
|
46
49
|
`;
|
|
47
50
|
};
|
|
48
51
|
const listboxInfoStyles = (partialTheme = {}) => {
|
|
49
|
-
const theme = mergeDeep(
|
|
52
|
+
const theme = mergeDeep(componentAutocomplete, partialTheme);
|
|
50
53
|
return css`
|
|
51
54
|
padding: ${theme.listbox.item.paddingY} ${theme.listbox.item.paddingX};
|
|
52
55
|
`;
|
|
@@ -182,4 +185,4 @@ const tagTableTypeBadgeStyles = (partialTheme = {}) => {
|
|
|
182
185
|
`;
|
|
183
186
|
};
|
|
184
187
|
|
|
185
|
-
export { listboxInfoStyles, listboxItemStyles, listboxStyles,
|
|
188
|
+
export { autocompleteInputStyles, listboxInfoStyles, listboxItemStyles, listboxStyles, tagTableAddButtonStyles, tagTableCellStyles, tagTableDragButtonStyles, tagTableHeadingStyles, tagTableRemoveButtonStyles, tagTableRowStyles, tagTableStyles, tagTableTypeBadgeStyles };
|
|
@@ -172,7 +172,14 @@ function TopBar({
|
|
|
172
172
|
size: "sm",
|
|
173
173
|
theme: mergedTheme.Item,
|
|
174
174
|
"aria-label": "Navigation Menu",
|
|
175
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
175
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
176
|
+
Icon.Icon,
|
|
177
|
+
{
|
|
178
|
+
fill: mergedTheme.collapsedNavMenu.button.color,
|
|
179
|
+
size: "lg",
|
|
180
|
+
children: menuOpen ? "close" : "menu"
|
|
181
|
+
}
|
|
182
|
+
)
|
|
176
183
|
}
|
|
177
184
|
)
|
|
178
185
|
}
|
|
@@ -100,7 +100,7 @@ function TopBar({ children, collapseBelow = {
|
|
|
100
100
|
showUntil: collapseBelow.containerLeft
|
|
101
101
|
}), children: jsxs(DialogTrigger, { isOpen: menuOpen, onOpenChange: (isOpen) => {
|
|
102
102
|
setMenuOpen(isOpen);
|
|
103
|
-
}, children: [jsx(Button, { "aria-label": "Navigation Menu", ref: buttonRef, css: topBarCollapsedNavMenuButtonStyles(mergedTheme, menuOpen), children: jsx(TopBarItem, { alignment: "left", size: "sm", theme: mergedTheme.Item, "aria-label": "Navigation Menu", children: jsx(Icon, { size: "lg", children: menuOpen ? "close" : "menu" }) }) }), jsx(Popover, { css: topBarCollapsedNavMenuPopoverStyles(mergedTheme), offset: mergedTheme.collapsedNavMenu.popover.offset, containerPadding: mergedTheme.collapsedNavMenu.popover.containerPadding, shouldFlip: false, children: leftSideMenuItems })] }) }), jsx("div", { css: topBarContainerStyles(mergedTheme), children: toolName }), jsx("div", { css: topBarContainerStyles(mergedTheme, {
|
|
103
|
+
}, children: [jsx(Button, { "aria-label": "Navigation Menu", ref: buttonRef, css: topBarCollapsedNavMenuButtonStyles(mergedTheme, menuOpen), children: jsx(TopBarItem, { alignment: "left", size: "sm", theme: mergedTheme.Item, "aria-label": "Navigation Menu", children: jsx(Icon, { fill: mergedTheme.collapsedNavMenu.button.color, size: "lg", children: menuOpen ? "close" : "menu" }) }) }), jsx(Popover, { css: topBarCollapsedNavMenuPopoverStyles(mergedTheme), offset: mergedTheme.collapsedNavMenu.popover.offset, containerPadding: mergedTheme.collapsedNavMenu.popover.containerPadding, shouldFlip: false, children: leftSideMenuItems })] }) }), jsx("div", { css: topBarContainerStyles(mergedTheme), children: toolName }), jsx("div", { css: topBarContainerStyles(mergedTheme, {
|
|
104
104
|
collapseBelow: collapseBelow.containerLeft
|
|
105
105
|
}), children: leftSide }), jsx("div", { css: [
|
|
106
106
|
topBarSpacerStyles(mergedTheme),
|
|
@@ -9,7 +9,10 @@ const topBarStyles = (theme) => {
|
|
|
9
9
|
return react.css`
|
|
10
10
|
background-color: ${theme["background-color"]};
|
|
11
11
|
height: ${theme.height};
|
|
12
|
-
border: ${theme
|
|
12
|
+
border-top: ${theme["border-top"]};
|
|
13
|
+
border-right: ${theme["border-right"]};
|
|
14
|
+
border-bottom: ${theme["border-bottom"]};
|
|
15
|
+
border-left: ${theme["border-left"]};
|
|
13
16
|
display: ${theme.display};
|
|
14
17
|
justify-content: ${theme["justify-content"]};
|
|
15
18
|
`;
|
|
@@ -7,7 +7,10 @@ const topBarStyles = (theme) => {
|
|
|
7
7
|
return css`
|
|
8
8
|
background-color: ${theme["background-color"]};
|
|
9
9
|
height: ${theme.height};
|
|
10
|
-
border: ${theme
|
|
10
|
+
border-top: ${theme["border-top"]};
|
|
11
|
+
border-right: ${theme["border-right"]};
|
|
12
|
+
border-bottom: ${theme["border-bottom"]};
|
|
13
|
+
border-left: ${theme["border-left"]};
|
|
11
14
|
display: ${theme.display};
|
|
12
15
|
justify-content: ${theme["justify-content"]};
|
|
13
16
|
`;
|
package/dist/index.cjs
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var autocomplete = require('./styleD/build/typescript/component/autocomplete.cjs');
|
|
3
4
|
var byline = require('./styleD/build/typescript/component/byline.cjs');
|
|
4
|
-
var tagAutocomplete = require('./styleD/build/typescript/component/tagAutocomplete.cjs');
|
|
5
5
|
var tagTable = require('./styleD/build/typescript/component/tagTable.cjs');
|
|
6
6
|
var userMenu = require('./styleD/build/typescript/component/userMenu.cjs');
|
|
7
|
+
var alertBanner = require('./styleD/build/typescript/component/alertBanner.cjs');
|
|
7
8
|
var avatar = require('./styleD/build/typescript/component/avatar.cjs');
|
|
8
9
|
var button = require('./styleD/build/typescript/component/button.cjs');
|
|
9
|
-
var
|
|
10
|
-
var icon = require('./styleD/build/typescript/component/icon.cjs');
|
|
10
|
+
var checkbox = require('./styleD/build/typescript/component/checkbox.cjs');
|
|
11
11
|
var favicon = require('./styleD/build/typescript/component/favicon.cjs');
|
|
12
|
-
var
|
|
12
|
+
var form = require('./styleD/build/typescript/component/form.cjs');
|
|
13
|
+
var icon = require('./styleD/build/typescript/component/icon.cjs');
|
|
14
|
+
var inlineMessage = require('./styleD/build/typescript/component/inlineMessage.cjs');
|
|
15
|
+
var menu = require('./styleD/build/typescript/component/menu.cjs');
|
|
13
16
|
var radioGroup = require('./styleD/build/typescript/component/radioGroup.cjs');
|
|
14
|
-
var
|
|
17
|
+
var select = require('./styleD/build/typescript/component/select.cjs');
|
|
15
18
|
var textArea = require('./styleD/build/typescript/component/textArea.cjs');
|
|
16
19
|
var textInput = require('./styleD/build/typescript/component/textInput.cjs');
|
|
17
|
-
var inlineMessage = require('./styleD/build/typescript/component/inlineMessage.cjs');
|
|
18
|
-
var select = require('./styleD/build/typescript/component/select.cjs');
|
|
19
|
-
var menu = require('./styleD/build/typescript/component/menu.cjs');
|
|
20
20
|
var TopBar = require('./styleD/build/typescript/component/TopBar.cjs');
|
|
21
|
-
var
|
|
21
|
+
var typography$1 = require('./styleD/build/typescript/component/typography.cjs');
|
|
22
22
|
var colors = require('./styleD/build/typescript/base/colors.cjs');
|
|
23
|
-
var typography = require('./styleD/build/typescript/base/typography.cjs');
|
|
24
|
-
var spacing = require('./styleD/build/typescript/base/spacing.cjs');
|
|
25
|
-
var sizing = require('./styleD/build/typescript/base/sizing.cjs');
|
|
26
23
|
var radius = require('./styleD/build/typescript/base/radius.cjs');
|
|
24
|
+
var sizing = require('./styleD/build/typescript/base/sizing.cjs');
|
|
25
|
+
var spacing = require('./styleD/build/typescript/base/spacing.cjs');
|
|
26
|
+
var typography = require('./styleD/build/typescript/base/typography.cjs');
|
|
27
27
|
var colors$1 = require('./styleD/build/typescript/semantic/colors.cjs');
|
|
28
28
|
var typography$2 = require('./styleD/build/typescript/semantic/typography.cjs');
|
|
29
29
|
var sizing$1 = require('./styleD/build/typescript/semantic/sizing.cjs');
|
|
@@ -32,30 +32,30 @@ var breakpoints = require('./styleD/build/typescript/semantic/breakpoints.cjs');
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
+
exports.componentAutocomplete = autocomplete.componentAutocomplete;
|
|
35
36
|
exports.componentByline = byline.componentByline;
|
|
36
|
-
exports.componentTagAutocomplete = tagAutocomplete.componentTagAutocomplete;
|
|
37
37
|
exports.componentTagTable = tagTable.componentTagTable;
|
|
38
38
|
exports.componentUserMenu = userMenu.componentUserMenu;
|
|
39
|
+
exports.componentAlertBanner = alertBanner.componentAlertBanner;
|
|
39
40
|
exports.componentAvatar = avatar.componentAvatar;
|
|
40
41
|
exports.componentButton = button.componentButton;
|
|
41
|
-
exports.
|
|
42
|
-
exports.componentIcon = icon.componentIcon;
|
|
42
|
+
exports.componentCheckbox = checkbox.componentCheckbox;
|
|
43
43
|
exports.componentFavicon = favicon.componentFavicon;
|
|
44
|
-
exports.
|
|
44
|
+
exports.componentForm = form.componentForm;
|
|
45
|
+
exports.componentIcon = icon.componentIcon;
|
|
46
|
+
exports.componentInlineMessage = inlineMessage.componentInlineMessage;
|
|
47
|
+
exports.componentMenu = menu.componentMenu;
|
|
45
48
|
exports.componentRadioGroup = radioGroup.componentRadioGroup;
|
|
46
|
-
exports.
|
|
49
|
+
exports.componentSelect = select.componentSelect;
|
|
47
50
|
exports.componentTextArea = textArea.componentTextArea;
|
|
48
51
|
exports.componentTextInput = textInput.componentTextInput;
|
|
49
|
-
exports.componentInlineMessage = inlineMessage.componentInlineMessage;
|
|
50
|
-
exports.componentSelect = select.componentSelect;
|
|
51
|
-
exports.componentMenu = menu.componentMenu;
|
|
52
52
|
exports.componentTopBar = TopBar.componentTopBar;
|
|
53
|
-
exports.
|
|
53
|
+
exports.componentTypography = typography$1.componentTypography;
|
|
54
54
|
exports.baseColors = colors.baseColors;
|
|
55
|
-
exports.baseTypography = typography.baseTypography;
|
|
56
|
-
exports.baseSpacing = spacing.baseSpacing;
|
|
57
|
-
exports.baseSizing = sizing.baseSizing;
|
|
58
55
|
exports.baseRadius = radius.baseRadius;
|
|
56
|
+
exports.baseSizing = sizing.baseSizing;
|
|
57
|
+
exports.baseSpacing = spacing.baseSpacing;
|
|
58
|
+
exports.baseTypography = typography.baseTypography;
|
|
59
59
|
exports.semanticColors = colors$1.semanticColors;
|
|
60
60
|
exports.semanticTypography = typography$2.semanticTypography;
|
|
61
61
|
exports.semanticSizing = sizing$1.semanticSizing;
|