@guardian/stand 0.0.11 → 0.0.13
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/README.md +116 -1759
- package/dist/components/avatar/Avatar.js +1 -1
- package/dist/components/button/Button.cjs +1 -4
- package/dist/components/button/Button.js +1 -4
- package/dist/components/button/styles.cjs +1 -3
- package/dist/components/byline/Byline.cjs +4 -18
- package/dist/components/byline/Byline.js +1 -1
- package/dist/components/byline/Preview.cjs +1 -8
- package/dist/components/byline/plugins.cjs +3 -13
- package/dist/components/favicon/Favicon.cjs +47 -0
- package/dist/components/favicon/Favicon.js +30 -0
- package/dist/components/favicon/styles.cjs +34 -0
- package/dist/components/favicon/styles.js +29 -0
- package/dist/components/icon/Icon.cjs +1 -4
- package/dist/components/icon/Icon.js +1 -4
- package/dist/components/icon-link-button/IconLinkButton.cjs +1 -6
- package/dist/components/tag-picker/TagAutocomplete.js +1 -1
- package/dist/components/tag-picker/TagTable.js +1 -1
- package/dist/components/user-menu/UserMenu.cjs +1 -8
- package/dist/components/user-menu/UserMenu.js +1 -1
- package/dist/favicon.cjs +9 -0
- package/dist/favicon.js +2 -0
- package/dist/fonts/OpenSans.css +64 -68
- package/dist/index.cjs +6 -4
- package/dist/index.js +1 -0
- package/dist/styleD/build/css/component/button.css +15 -16
- package/dist/styleD/build/css/component/favicon.css +17 -0
- package/dist/styleD/build/css/semantic/typography.css +5 -10
- package/dist/styleD/build/typescript/component/favicon.cjs +20 -0
- package/dist/styleD/build/typescript/component/favicon.js +18 -0
- package/dist/types/components/favicon/Favicon.d.ts +2 -0
- package/dist/types/components/favicon/styles.d.ts +8 -0
- package/dist/types/components/favicon/types.d.ts +38 -0
- package/dist/types/favicon.d.ts +19 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/styleD/build/typescript/component/favicon.d.ts +20 -0
- package/package.json +27 -17
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, Fragment } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
4
|
-
import {
|
|
4
|
+
import { avatarImageStyles, avatarStyles, defaultAvatarTheme } from './styles.js';
|
|
5
5
|
import { avatarColors } from './types.js';
|
|
6
6
|
|
|
7
7
|
const getColorFromString = (input) => {
|
|
@@ -20,10 +20,7 @@ function Button({
|
|
|
20
20
|
reactAriaComponents.Button,
|
|
21
21
|
{
|
|
22
22
|
...props,
|
|
23
|
-
css: [
|
|
24
|
-
styles.buttonStyles(mergedTheme, { variant, size }, !!icon),
|
|
25
|
-
cssOverrides
|
|
26
|
-
],
|
|
23
|
+
css: [styles.buttonStyles(mergedTheme, { variant, size }, !!icon), cssOverrides],
|
|
27
24
|
children: reactAriaComponents.composeRenderProps(props.children, (children) => (
|
|
28
25
|
// TODO: isPending (loading) state - see https://react-aria.adobe.com/Button
|
|
29
26
|
/* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -7,10 +7,7 @@ import { buttonStyles, defaultButtonTheme } from './styles.js';
|
|
|
7
7
|
function Button({ variant = "emphasised-primary", size = "md", theme = {}, cssOverrides, icon, ...props }) {
|
|
8
8
|
const mergedTheme = mergeDeep(defaultButtonTheme, theme);
|
|
9
9
|
const iconSize = size === "xs" ? "sm" : size;
|
|
10
|
-
return jsx(Button$1, { ...props, css: [
|
|
11
|
-
buttonStyles(mergedTheme, { variant, size }, !!icon),
|
|
12
|
-
cssOverrides
|
|
13
|
-
], children: composeRenderProps(props.children, (children) => (
|
|
10
|
+
return jsx(Button$1, { ...props, css: [buttonStyles(mergedTheme, { variant, size }, !!icon), cssOverrides], children: composeRenderProps(props.children, (children) => (
|
|
14
11
|
// TODO: isPending (loading) state - see https://react-aria.adobe.com/Button
|
|
15
12
|
jsxs(Fragment, { children: [icon && jsx(Icon, { size: iconSize, children: icon }), children] })
|
|
16
13
|
)) });
|
|
@@ -24,9 +24,7 @@ const buttonStyles = (theme, { size, variant }, hasIcon = false, isIconButton =
|
|
|
24
24
|
${theme[variant][size].padding.right}
|
|
25
25
|
${theme[variant][size].padding.bottom}
|
|
26
26
|
${theme[variant][size].padding.left};
|
|
27
|
-
${typography.convertTypographyToEmotionStringStyle(
|
|
28
|
-
theme[variant][size].typography
|
|
29
|
-
)}
|
|
27
|
+
${typography.convertTypographyToEmotionStringStyle(theme[variant][size].typography)}
|
|
30
28
|
border: ${theme[variant].shared.border};
|
|
31
29
|
border-radius: ${theme[variant].shared.borderRadius};
|
|
32
30
|
|
|
@@ -165,9 +165,7 @@ const Byline = ({
|
|
|
165
165
|
if (readOnly) {
|
|
166
166
|
return false;
|
|
167
167
|
}
|
|
168
|
-
if (!dropdownRef.current?.contains(
|
|
169
|
-
event.relatedTarget
|
|
170
|
-
)) {
|
|
168
|
+
if (!dropdownRef.current?.contains(event.relatedTarget)) {
|
|
171
169
|
setShowDropdown(false);
|
|
172
170
|
}
|
|
173
171
|
return false;
|
|
@@ -203,10 +201,7 @@ const Byline = ({
|
|
|
203
201
|
void searchContributors(selectedText).then((contributors) => {
|
|
204
202
|
setTaggedContributors(contributors);
|
|
205
203
|
}).catch((error) => {
|
|
206
|
-
console.error(
|
|
207
|
-
"Error fetching tagged contributors:",
|
|
208
|
-
error
|
|
209
|
-
);
|
|
204
|
+
console.error("Error fetching tagged contributors:", error);
|
|
210
205
|
setTaggedContributors([]);
|
|
211
206
|
});
|
|
212
207
|
} else {
|
|
@@ -291,14 +286,7 @@ const Byline = ({
|
|
|
291
286
|
allowUntaggedContributors
|
|
292
287
|
]);
|
|
293
288
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { css: styles.bylineContainerStyles, children: [
|
|
294
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
295
|
-
"div",
|
|
296
|
-
{
|
|
297
|
-
css: styles.bylineEditorStyles(theme),
|
|
298
|
-
ref: editorRef,
|
|
299
|
-
onBlur
|
|
300
|
-
}
|
|
301
|
-
),
|
|
289
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { css: styles.bylineEditorStyles(theme), ref: editorRef, onBlur }),
|
|
302
290
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
303
291
|
"div",
|
|
304
292
|
{
|
|
@@ -351,9 +339,7 @@ const Byline = ({
|
|
|
351
339
|
],
|
|
352
340
|
onMouseMove: () => {
|
|
353
341
|
if (currentOptionIndex !== taggedContributors.length) {
|
|
354
|
-
setCurrentOptionIndex(
|
|
355
|
-
taggedContributors.length
|
|
356
|
-
);
|
|
342
|
+
setCurrentOptionIndex(taggedContributors.length);
|
|
357
343
|
}
|
|
358
344
|
},
|
|
359
345
|
onMouseDown: (e) => {
|
|
@@ -10,7 +10,7 @@ import { createPlaceholderPlugin } from './placeholder.js';
|
|
|
10
10
|
import { clipboardPlugin, keybindings, bylinePlugin } from './plugins.js';
|
|
11
11
|
import { Preview } from './Preview.js';
|
|
12
12
|
import { bylineEditorSchema } from './schema.js';
|
|
13
|
-
import { bylineContainerStyles, bylineEditorStyles,
|
|
13
|
+
import { bylineContainerStyles, bylineEditorStyles, dropdownUlStyles, dropdownLiStyles, selectedDropdownLiStyles, dropdownContainerStyles } from './styles.js';
|
|
14
14
|
|
|
15
15
|
const Byline = ({ theme, allowUntaggedContributors, contributorLimit, enablePreview, placeholder, initialValue, readOnly, handleSave, searchContributors, onBlur }) => {
|
|
16
16
|
const editorRef = useRef(null);
|
|
@@ -13,14 +13,7 @@ const Preview = ({ doc }) => {
|
|
|
13
13
|
});
|
|
14
14
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { css: styles.previewStyles, "data-testid": "byline-preview", children: parts.map((node, i) => {
|
|
15
15
|
if (node.isText) {
|
|
16
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17
|
-
"span",
|
|
18
|
-
{
|
|
19
|
-
css: styles.previewFreeTextStyles,
|
|
20
|
-
children: node.text
|
|
21
|
-
},
|
|
22
|
-
`${node.text}${i}`
|
|
23
|
-
);
|
|
16
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { css: styles.previewFreeTextStyles, children: node.text }, `${node.text}${i}`);
|
|
24
17
|
} else if (node.type.name === "chip") {
|
|
25
18
|
if (node.attrs.path) {
|
|
26
19
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -70,11 +70,7 @@ const clipboardPlugin = (allowUntaggedContributors, contributorLimit) => {
|
|
|
70
70
|
{},
|
|
71
71
|
transformedNodes
|
|
72
72
|
).content;
|
|
73
|
-
return new prosemirrorModel.Slice(
|
|
74
|
-
newFragment,
|
|
75
|
-
slice.openStart,
|
|
76
|
-
slice.openEnd
|
|
77
|
-
);
|
|
73
|
+
return new prosemirrorModel.Slice(newFragment, slice.openStart, slice.openEnd);
|
|
78
74
|
}
|
|
79
75
|
return slice;
|
|
80
76
|
}
|
|
@@ -110,10 +106,7 @@ const bylinePlugin = () => {
|
|
|
110
106
|
dom.setAttribute("data-tag-id", node.attrs.tagId);
|
|
111
107
|
dom.setAttribute("data-path", node.attrs.path);
|
|
112
108
|
if (node.attrs.meta) {
|
|
113
|
-
dom.setAttribute(
|
|
114
|
-
"data-meta",
|
|
115
|
-
JSON.stringify(node.attrs.meta)
|
|
116
|
-
);
|
|
109
|
+
dom.setAttribute("data-meta", JSON.stringify(node.attrs.meta));
|
|
117
110
|
}
|
|
118
111
|
dom.textContent = node.attrs.label;
|
|
119
112
|
const deleteHandle = document.createElement("span");
|
|
@@ -125,10 +118,7 @@ const bylinePlugin = () => {
|
|
|
125
118
|
if (pos === void 0) {
|
|
126
119
|
return;
|
|
127
120
|
}
|
|
128
|
-
const tr = view.state.tr.deleteRange(
|
|
129
|
-
pos,
|
|
130
|
-
pos + node.nodeSize
|
|
131
|
-
);
|
|
121
|
+
const tr = view.state.tr.deleteRange(pos, pos + node.nodeSize);
|
|
132
122
|
view.dispatch(tr);
|
|
133
123
|
});
|
|
134
124
|
dom.appendChild(deleteHandle);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
4
|
+
var react = require('react');
|
|
5
|
+
var mergeDeep = require('../../util/mergeDeep.cjs');
|
|
6
|
+
var Icon = require('../icon/Icon.cjs');
|
|
7
|
+
var styles = require('./styles.cjs');
|
|
8
|
+
|
|
9
|
+
const Favicon = (props) => {
|
|
10
|
+
const mergedTheme = mergeDeep.mergeDeep(styles.defaultFaviconTheme, props.theme ?? {});
|
|
11
|
+
const [imageError, setImageError] = react.useState(false);
|
|
12
|
+
const handleImageError = () => {
|
|
13
|
+
setImageError(true);
|
|
14
|
+
};
|
|
15
|
+
const displayLetter = props.letter?.slice(0, 1).toUpperCase() ?? "";
|
|
16
|
+
if ("src" in props && !imageError) {
|
|
17
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { css: [styles.faviconStyles(mergedTheme), props.cssOverrides], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18
|
+
"img",
|
|
19
|
+
{
|
|
20
|
+
src: props.src,
|
|
21
|
+
alt: props.alt,
|
|
22
|
+
title: props.alt,
|
|
23
|
+
onError: handleImageError,
|
|
24
|
+
css: styles.faviconImageStyles
|
|
25
|
+
}
|
|
26
|
+
) });
|
|
27
|
+
}
|
|
28
|
+
if ("letter" in props || imageError) {
|
|
29
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
css: [
|
|
33
|
+
styles.faviconStyles(mergedTheme),
|
|
34
|
+
styles.faviconTypographyStyles(mergedTheme),
|
|
35
|
+
props.cssOverrides
|
|
36
|
+
],
|
|
37
|
+
children: displayLetter
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
if ("icon" in props) {
|
|
42
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { css: [styles.faviconStyles(mergedTheme), props.cssOverrides], children: /* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { fill: mergedTheme.color.text, children: props.icon }) });
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
exports.Favicon = Favicon;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
4
|
+
import { Icon } from '../icon/Icon.js';
|
|
5
|
+
import { defaultFaviconTheme, faviconImageStyles, faviconStyles, faviconTypographyStyles } from './styles.js';
|
|
6
|
+
|
|
7
|
+
const Favicon = (props) => {
|
|
8
|
+
const mergedTheme = mergeDeep(defaultFaviconTheme, props.theme ?? {});
|
|
9
|
+
const [imageError, setImageError] = useState(false);
|
|
10
|
+
const handleImageError = () => {
|
|
11
|
+
setImageError(true);
|
|
12
|
+
};
|
|
13
|
+
const displayLetter = props.letter?.slice(0, 1).toUpperCase() ?? "";
|
|
14
|
+
if ("src" in props && !imageError) {
|
|
15
|
+
return jsx("div", { css: [faviconStyles(mergedTheme), props.cssOverrides], children: jsx("img", { src: props.src, alt: props.alt, title: props.alt, onError: handleImageError, css: faviconImageStyles }) });
|
|
16
|
+
}
|
|
17
|
+
if ("letter" in props || imageError) {
|
|
18
|
+
return jsx("div", { css: [
|
|
19
|
+
faviconStyles(mergedTheme),
|
|
20
|
+
faviconTypographyStyles(mergedTheme),
|
|
21
|
+
props.cssOverrides
|
|
22
|
+
], children: displayLetter });
|
|
23
|
+
}
|
|
24
|
+
if ("icon" in props) {
|
|
25
|
+
return jsx("div", { css: [faviconStyles(mergedTheme), props.cssOverrides], children: jsx(Icon, { fill: mergedTheme.color.text, children: props.icon }) });
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export { Favicon };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('@emotion/react');
|
|
4
|
+
var favicon = require('../../styleD/build/typescript/component/favicon.cjs');
|
|
5
|
+
var typography = require('../../styleD/utils/semantic/typography.cjs');
|
|
6
|
+
|
|
7
|
+
const defaultFaviconTheme = favicon.componentFavicon;
|
|
8
|
+
const faviconStyles = (theme) => {
|
|
9
|
+
return react.css`
|
|
10
|
+
background-color: ${theme.color.background};
|
|
11
|
+
display: ${theme.display};
|
|
12
|
+
align-items: ${theme["align-items"]};
|
|
13
|
+
justify-content: ${theme["justify-content"]};
|
|
14
|
+
width: ${theme.size};
|
|
15
|
+
height: ${theme.size};
|
|
16
|
+
user-select: ${theme["user-select"]};
|
|
17
|
+
`;
|
|
18
|
+
};
|
|
19
|
+
const faviconTypographyStyles = (theme) => {
|
|
20
|
+
return react.css`
|
|
21
|
+
color: ${theme.color.text};
|
|
22
|
+
${typography.convertTypographyToEmotionStringStyle(theme.typography)}
|
|
23
|
+
`;
|
|
24
|
+
};
|
|
25
|
+
const faviconImageStyles = react.css`
|
|
26
|
+
width: 100%;
|
|
27
|
+
height: 100%;
|
|
28
|
+
object-fit: cover;
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
exports.defaultFaviconTheme = defaultFaviconTheme;
|
|
32
|
+
exports.faviconImageStyles = faviconImageStyles;
|
|
33
|
+
exports.faviconStyles = faviconStyles;
|
|
34
|
+
exports.faviconTypographyStyles = faviconTypographyStyles;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
|
+
import { componentFavicon } from '../../styleD/build/typescript/component/favicon.js';
|
|
3
|
+
import { convertTypographyToEmotionStringStyle } from '../../styleD/utils/semantic/typography.js';
|
|
4
|
+
|
|
5
|
+
const defaultFaviconTheme = componentFavicon;
|
|
6
|
+
const faviconStyles = (theme) => {
|
|
7
|
+
return css`
|
|
8
|
+
background-color: ${theme.color.background};
|
|
9
|
+
display: ${theme.display};
|
|
10
|
+
align-items: ${theme["align-items"]};
|
|
11
|
+
justify-content: ${theme["justify-content"]};
|
|
12
|
+
width: ${theme.size};
|
|
13
|
+
height: ${theme.size};
|
|
14
|
+
user-select: ${theme["user-select"]};
|
|
15
|
+
`;
|
|
16
|
+
};
|
|
17
|
+
const faviconTypographyStyles = (theme) => {
|
|
18
|
+
return css`
|
|
19
|
+
color: ${theme.color.text};
|
|
20
|
+
${convertTypographyToEmotionStringStyle(theme.typography)}
|
|
21
|
+
`;
|
|
22
|
+
};
|
|
23
|
+
const faviconImageStyles = css`
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
object-fit: cover;
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
export { defaultFaviconTheme, faviconImageStyles, faviconStyles, faviconTypographyStyles };
|
|
@@ -33,10 +33,7 @@ function Icon({
|
|
|
33
33
|
"span",
|
|
34
34
|
{
|
|
35
35
|
className,
|
|
36
|
-
css: [
|
|
37
|
-
styles.iconStyles(mergedTheme, { size, fill, mode: "svg" }),
|
|
38
|
-
cssOverrides
|
|
39
|
-
],
|
|
36
|
+
css: [styles.iconStyles(mergedTheme, { size, fill, mode: "svg" }), cssOverrides],
|
|
40
37
|
...alt ? { role: "img", "aria-label": alt } : { "aria-hidden": true },
|
|
41
38
|
children
|
|
42
39
|
}
|
|
@@ -10,10 +10,7 @@ function Icon({ children, size = "md", fill, alt, symbol, theme = {}, cssOverrid
|
|
|
10
10
|
cssOverrides
|
|
11
11
|
], ...alt ? { role: "img", "aria-label": alt } : { "aria-hidden": true }, children: symbol ?? children });
|
|
12
12
|
}
|
|
13
|
-
return jsx("span", { className, css: [
|
|
14
|
-
iconStyles(mergedTheme, { size, fill, mode: "svg" }),
|
|
15
|
-
cssOverrides
|
|
16
|
-
], ...alt ? { role: "img", "aria-label": alt } : { "aria-hidden": true }, children });
|
|
13
|
+
return jsx("span", { className, css: [iconStyles(mergedTheme, { size, fill, mode: "svg" }), cssOverrides], ...alt ? { role: "img", "aria-label": alt } : { "aria-hidden": true }, children });
|
|
17
14
|
}
|
|
18
15
|
|
|
19
16
|
export { Icon };
|
|
@@ -31,12 +31,7 @@ function IconLinkButton({
|
|
|
31
31
|
ref: linkRef,
|
|
32
32
|
"aria-label": ariaLabel,
|
|
33
33
|
css: [
|
|
34
|
-
styles.iconLinkButtonStyles(
|
|
35
|
-
mergedTheme,
|
|
36
|
-
{ variant, size },
|
|
37
|
-
false,
|
|
38
|
-
true
|
|
39
|
-
),
|
|
34
|
+
styles.iconLinkButtonStyles(mergedTheme, { variant, size }, false, true),
|
|
40
35
|
cssOverrides
|
|
41
36
|
],
|
|
42
37
|
children: reactAriaComponents.composeRenderProps(props.children, (children) => /* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { size: iconSize, symbol, children }))
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
3
|
import { ComboBox, Input, Popover, ListBox, Collection, ListBoxItem, ListBoxLoadMoreItem } from 'react-aria-components';
|
|
4
|
-
import { tagAutocompleteInputStyles,
|
|
4
|
+
import { tagAutocompleteInputStyles, listboxItemStyles, listboxInfoStyles, listboxStyles } from './styles.js';
|
|
5
5
|
|
|
6
6
|
function TagAutocomplete({ addTag, loading, onChange, options, label, placeholder, disabled, value, "data-testid": dataTestId, loadingIcon, theme, cssOverrides }) {
|
|
7
7
|
return jsx("div", { css: [
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
|
2
2
|
import { css } from '@emotion/react';
|
|
3
3
|
import { useState, useRef, useEffect } from 'react';
|
|
4
4
|
import { useDragAndDrop, Table, TableHeader, Column, TableBody, Row, Cell, Button } from 'react-aria-components';
|
|
5
|
-
import { tagTableHeadingStyles,
|
|
5
|
+
import { tagTableHeadingStyles, tagTableDragButtonStyles, tagTableCellStyles, tagTableRemoveButtonStyles, tagTableAddButtonStyles, tagTableRowStyles, tagTableStyles, tagTableTypeBadgeStyles } from './styles.js';
|
|
6
6
|
|
|
7
7
|
const rowToTag = (row) => "tag" in row ? row.tag : row;
|
|
8
8
|
const TypeBadge = (type, theme) => {
|
|
@@ -17,14 +17,7 @@ function UserMenu({
|
|
|
17
17
|
headingLevel
|
|
18
18
|
}) {
|
|
19
19
|
return /* @__PURE__ */ jsxRuntime.jsxs("aside", { css: styles.userMenuStyles(theme), children: [
|
|
20
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21
|
-
TitleText.TitleText,
|
|
22
|
-
{
|
|
23
|
-
headingLevel,
|
|
24
|
-
css: styles.userMenuHeadingStyles(theme),
|
|
25
|
-
children: "Accessibility Settings"
|
|
26
|
-
}
|
|
27
|
-
),
|
|
20
|
+
/* @__PURE__ */ jsxRuntime.jsx(TitleText.TitleText, { headingLevel, css: styles.userMenuHeadingStyles(theme), children: "Accessibility Settings" }),
|
|
28
21
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
|
|
29
22
|
"Customise your reading & writing experience.",
|
|
30
23
|
" ",
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
|
2
2
|
import { TitleText } from '../TitleText.js';
|
|
3
3
|
import { textSizes, fontFamilies, colorSchemes } from './default-options.js';
|
|
4
4
|
import { PreferenceRadioGroup } from './PreferenceRadioGroup.js';
|
|
5
|
-
import {
|
|
5
|
+
import { userMenuHeadingStyles, userMenuStyles } from './styles.js';
|
|
6
6
|
|
|
7
7
|
function UserMenu({ theme, feedBacklink, preferences, updatePreferences, textSizeOptions, fontFamilyOptions, colorSchemeOptions, headingLevel }) {
|
|
8
8
|
return jsxs("aside", { css: userMenuStyles(theme), children: [jsx(TitleText, { headingLevel, css: userMenuHeadingStyles(theme), children: "Accessibility Settings" }), jsx("div", { children: jsxs("p", { children: ["Customise your reading & writing experience.", " ", feedBacklink && jsx("a", { href: feedBacklink, target: "_blank", rel: "noreferrer", children: "Send feedback" })] }) }), (!textSizeOptions || textSizeOptions.length > 0) && jsx(PreferenceRadioGroup, { theme, options: textSizeOptions ?? textSizes, name: "Text Size", currentValue: preferences.fontpreferences, changeValue: (fontpreferences) => updatePreferences({ fontpreferences }) }), (!fontFamilyOptions || fontFamilyOptions.length > 0) && jsx(PreferenceRadioGroup, { theme, options: fontFamilyOptions ?? fontFamilies, name: "Font Family", currentValue: preferences.fontType, changeValue: (fontType) => updatePreferences({ fontType }) }), (!colorSchemeOptions || colorSchemeOptions.length > 0) && jsx(PreferenceRadioGroup, { theme, format: "rows", options: colorSchemeOptions ?? colorSchemes, name: "Color scheme", currentValue: preferences.colorScheme, changeValue: (colorScheme) => updatePreferences({ colorScheme }) })] });
|
package/dist/favicon.cjs
ADDED
package/dist/favicon.js
ADDED
package/dist/fonts/OpenSans.css
CHANGED
|
@@ -78,16 +78,15 @@
|
|
|
78
78
|
U+0302-0303, U+0305, U+0307-0308, U+0310, U+0312, U+0315, U+031A,
|
|
79
79
|
U+0326-0327, U+032C, U+032F-0330, U+0332-0333, U+0338, U+033A, U+0346,
|
|
80
80
|
U+034D, U+0391-03A1, U+03A3-03A9, U+03B1-03C9, U+03D1, U+03D5-03D6,
|
|
81
|
-
U+03F0-03F1, U+03F4-03F5, U+2016-2017, U+2034-2038, U+203C, U+2040,
|
|
82
|
-
U+
|
|
83
|
-
U+
|
|
84
|
-
U+
|
|
85
|
-
U+
|
|
86
|
-
U+
|
|
87
|
-
U+
|
|
88
|
-
U+
|
|
89
|
-
U+
|
|
90
|
-
U+1EE00-1EEFF;
|
|
81
|
+
U+03F0-03F1, U+03F4-03F5, U+2016-2017, U+2034-2038, U+203C, U+2040, U+2043,
|
|
82
|
+
U+2047, U+2050, U+2057, U+205F, U+2070-2071, U+2074-208E, U+2090-209C,
|
|
83
|
+
U+20D0-20DC, U+20E1, U+20E5-20EF, U+2100-2112, U+2114-2115, U+2117-2121,
|
|
84
|
+
U+2123-214F, U+2190, U+2192, U+2194-21AE, U+21B0-21E5, U+21F1-21F2,
|
|
85
|
+
U+21F4-2211, U+2213-2214, U+2216-22FF, U+2308-230B, U+2310, U+2319,
|
|
86
|
+
U+231C-2321, U+2336-237A, U+237C, U+2395, U+239B-23B7, U+23D0, U+23DC-23E1,
|
|
87
|
+
U+2474-2475, U+25AF, U+25B3, U+25B7, U+25BD, U+25C1, U+25CA, U+25CC, U+25FB,
|
|
88
|
+
U+266D-266F, U+27C0-27FF, U+2900-2AFF, U+2B0E-2B11, U+2B30-2B4C, U+2BFE,
|
|
89
|
+
U+3030, U+FF5B, U+FF5D, U+1D400-1D7FF, U+1EE00-1EEFF;
|
|
91
90
|
}
|
|
92
91
|
/* symbols */
|
|
93
92
|
@font-face {
|
|
@@ -102,26 +101,25 @@
|
|
|
102
101
|
U+0001-000C, U+000E-001F, U+007F-009F, U+20DD-20E0, U+20E2-20E4,
|
|
103
102
|
U+2150-218F, U+2190, U+2192, U+2194-2199, U+21AF, U+21E6-21F0, U+21F3,
|
|
104
103
|
U+2218-2219, U+2299, U+22C4-22C6, U+2300-243F, U+2440-244A, U+2460-24FF,
|
|
105
|
-
U+25A0-27BF, U+2800-28FF, U+2921-2922, U+2981, U+29BF, U+29EB,
|
|
106
|
-
U+
|
|
107
|
-
U+
|
|
108
|
-
U+
|
|
109
|
-
U+
|
|
110
|
-
U+
|
|
111
|
-
U+
|
|
112
|
-
U+
|
|
113
|
-
U+
|
|
114
|
-
U+
|
|
115
|
-
U+
|
|
116
|
-
U+
|
|
117
|
-
U+
|
|
118
|
-
U+
|
|
119
|
-
U+
|
|
120
|
-
U+
|
|
121
|
-
U+
|
|
122
|
-
U+
|
|
123
|
-
U+
|
|
124
|
-
U+1FA8F-1FAC6, U+1FACE-1FADC, U+1FADF-1FAE9, U+1FAF0-1FAF8,
|
|
104
|
+
U+25A0-27BF, U+2800-28FF, U+2921-2922, U+2981, U+29BF, U+29EB, U+2B00-2BFF,
|
|
105
|
+
U+4DC0-4DFF, U+FFF9-FFFB, U+10140-1018E, U+10190-1019C, U+101A0,
|
|
106
|
+
U+101D0-101FD, U+102E0-102FB, U+10E60-10E7E, U+1D2C0-1D2D3, U+1D2E0-1D37F,
|
|
107
|
+
U+1F000-1F0FF, U+1F100-1F1AD, U+1F1E6-1F1FF, U+1F30D-1F30F, U+1F315,
|
|
108
|
+
U+1F31C, U+1F31E, U+1F320-1F32C, U+1F336, U+1F378, U+1F37D, U+1F382,
|
|
109
|
+
U+1F393-1F39F, U+1F3A7-1F3A8, U+1F3AC-1F3AF, U+1F3C2, U+1F3C4-1F3C6,
|
|
110
|
+
U+1F3CA-1F3CE, U+1F3D4-1F3E0, U+1F3ED, U+1F3F1-1F3F3, U+1F3F5-1F3F7,
|
|
111
|
+
U+1F408, U+1F415, U+1F41F, U+1F426, U+1F43F, U+1F441-1F442, U+1F444,
|
|
112
|
+
U+1F446-1F449, U+1F44C-1F44E, U+1F453, U+1F46A, U+1F47D, U+1F4A3, U+1F4B0,
|
|
113
|
+
U+1F4B3, U+1F4B9, U+1F4BB, U+1F4BF, U+1F4C8-1F4CB, U+1F4D6, U+1F4DA,
|
|
114
|
+
U+1F4DF, U+1F4E3-1F4E6, U+1F4EA-1F4ED, U+1F4F7, U+1F4F9-1F4FB,
|
|
115
|
+
U+1F4FD-1F4FE, U+1F503, U+1F507-1F50B, U+1F50D, U+1F512-1F513,
|
|
116
|
+
U+1F53E-1F54A, U+1F54F-1F5FA, U+1F610, U+1F650-1F67F, U+1F687, U+1F68D,
|
|
117
|
+
U+1F691, U+1F694, U+1F698, U+1F6AD, U+1F6B2, U+1F6B9-1F6BA, U+1F6BC,
|
|
118
|
+
U+1F6C6-1F6CF, U+1F6D3-1F6D7, U+1F6E0-1F6EA, U+1F6F0-1F6F3, U+1F6F7-1F6FC,
|
|
119
|
+
U+1F700-1F7FF, U+1F800-1F80B, U+1F810-1F847, U+1F850-1F859, U+1F860-1F887,
|
|
120
|
+
U+1F890-1F8AD, U+1F8B0-1F8BB, U+1F8C0-1F8C1, U+1F900-1F90B, U+1F93B,
|
|
121
|
+
U+1F946, U+1F984, U+1F996, U+1F9E9, U+1FA00-1FA6F, U+1FA70-1FA7C,
|
|
122
|
+
U+1FA80-1FA89, U+1FA8F-1FAC6, U+1FACE-1FADC, U+1FADF-1FAE9, U+1FAF0-1FAF8,
|
|
125
123
|
U+1FB00-1FBFF;
|
|
126
124
|
}
|
|
127
125
|
/* vietnamese */
|
|
@@ -149,8 +147,8 @@
|
|
|
149
147
|
format('woff2');
|
|
150
148
|
unicode-range:
|
|
151
149
|
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
|
|
152
|
-
U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
|
|
153
|
-
U+
|
|
150
|
+
U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
|
|
151
|
+
U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
|
154
152
|
}
|
|
155
153
|
/* latin */
|
|
156
154
|
@font-face {
|
|
@@ -163,8 +161,8 @@
|
|
|
163
161
|
format('woff2');
|
|
164
162
|
unicode-range:
|
|
165
163
|
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
|
|
166
|
-
U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
|
|
167
|
-
U+
|
|
164
|
+
U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
|
|
165
|
+
U+2215, U+FEFF, U+FFFD;
|
|
168
166
|
}
|
|
169
167
|
/* cyrillic-ext */
|
|
170
168
|
@font-face {
|
|
@@ -237,16 +235,15 @@
|
|
|
237
235
|
U+0302-0303, U+0305, U+0307-0308, U+0310, U+0312, U+0315, U+031A,
|
|
238
236
|
U+0326-0327, U+032C, U+032F-0330, U+0332-0333, U+0338, U+033A, U+0346,
|
|
239
237
|
U+034D, U+0391-03A1, U+03A3-03A9, U+03B1-03C9, U+03D1, U+03D5-03D6,
|
|
240
|
-
U+03F0-03F1, U+03F4-03F5, U+2016-2017, U+2034-2038, U+203C, U+2040,
|
|
241
|
-
U+
|
|
242
|
-
U+
|
|
243
|
-
U+
|
|
244
|
-
U+
|
|
245
|
-
U+
|
|
246
|
-
U+
|
|
247
|
-
U+
|
|
248
|
-
U+
|
|
249
|
-
U+1EE00-1EEFF;
|
|
238
|
+
U+03F0-03F1, U+03F4-03F5, U+2016-2017, U+2034-2038, U+203C, U+2040, U+2043,
|
|
239
|
+
U+2047, U+2050, U+2057, U+205F, U+2070-2071, U+2074-208E, U+2090-209C,
|
|
240
|
+
U+20D0-20DC, U+20E1, U+20E5-20EF, U+2100-2112, U+2114-2115, U+2117-2121,
|
|
241
|
+
U+2123-214F, U+2190, U+2192, U+2194-21AE, U+21B0-21E5, U+21F1-21F2,
|
|
242
|
+
U+21F4-2211, U+2213-2214, U+2216-22FF, U+2308-230B, U+2310, U+2319,
|
|
243
|
+
U+231C-2321, U+2336-237A, U+237C, U+2395, U+239B-23B7, U+23D0, U+23DC-23E1,
|
|
244
|
+
U+2474-2475, U+25AF, U+25B3, U+25B7, U+25BD, U+25C1, U+25CA, U+25CC, U+25FB,
|
|
245
|
+
U+266D-266F, U+27C0-27FF, U+2900-2AFF, U+2B0E-2B11, U+2B30-2B4C, U+2BFE,
|
|
246
|
+
U+3030, U+FF5B, U+FF5D, U+1D400-1D7FF, U+1EE00-1EEFF;
|
|
250
247
|
}
|
|
251
248
|
/* symbols */
|
|
252
249
|
@font-face {
|
|
@@ -261,26 +258,25 @@
|
|
|
261
258
|
U+0001-000C, U+000E-001F, U+007F-009F, U+20DD-20E0, U+20E2-20E4,
|
|
262
259
|
U+2150-218F, U+2190, U+2192, U+2194-2199, U+21AF, U+21E6-21F0, U+21F3,
|
|
263
260
|
U+2218-2219, U+2299, U+22C4-22C6, U+2300-243F, U+2440-244A, U+2460-24FF,
|
|
264
|
-
U+25A0-27BF, U+2800-28FF, U+2921-2922, U+2981, U+29BF, U+29EB,
|
|
265
|
-
U+
|
|
266
|
-
U+
|
|
267
|
-
U+
|
|
268
|
-
U+
|
|
269
|
-
U+
|
|
270
|
-
U+
|
|
271
|
-
U+
|
|
272
|
-
U+
|
|
273
|
-
U+
|
|
274
|
-
U+
|
|
275
|
-
U+
|
|
276
|
-
U+
|
|
277
|
-
U+
|
|
278
|
-
U+
|
|
279
|
-
U+
|
|
280
|
-
U+
|
|
281
|
-
U+
|
|
282
|
-
U+
|
|
283
|
-
U+1FA8F-1FAC6, U+1FACE-1FADC, U+1FADF-1FAE9, U+1FAF0-1FAF8,
|
|
261
|
+
U+25A0-27BF, U+2800-28FF, U+2921-2922, U+2981, U+29BF, U+29EB, U+2B00-2BFF,
|
|
262
|
+
U+4DC0-4DFF, U+FFF9-FFFB, U+10140-1018E, U+10190-1019C, U+101A0,
|
|
263
|
+
U+101D0-101FD, U+102E0-102FB, U+10E60-10E7E, U+1D2C0-1D2D3, U+1D2E0-1D37F,
|
|
264
|
+
U+1F000-1F0FF, U+1F100-1F1AD, U+1F1E6-1F1FF, U+1F30D-1F30F, U+1F315,
|
|
265
|
+
U+1F31C, U+1F31E, U+1F320-1F32C, U+1F336, U+1F378, U+1F37D, U+1F382,
|
|
266
|
+
U+1F393-1F39F, U+1F3A7-1F3A8, U+1F3AC-1F3AF, U+1F3C2, U+1F3C4-1F3C6,
|
|
267
|
+
U+1F3CA-1F3CE, U+1F3D4-1F3E0, U+1F3ED, U+1F3F1-1F3F3, U+1F3F5-1F3F7,
|
|
268
|
+
U+1F408, U+1F415, U+1F41F, U+1F426, U+1F43F, U+1F441-1F442, U+1F444,
|
|
269
|
+
U+1F446-1F449, U+1F44C-1F44E, U+1F453, U+1F46A, U+1F47D, U+1F4A3, U+1F4B0,
|
|
270
|
+
U+1F4B3, U+1F4B9, U+1F4BB, U+1F4BF, U+1F4C8-1F4CB, U+1F4D6, U+1F4DA,
|
|
271
|
+
U+1F4DF, U+1F4E3-1F4E6, U+1F4EA-1F4ED, U+1F4F7, U+1F4F9-1F4FB,
|
|
272
|
+
U+1F4FD-1F4FE, U+1F503, U+1F507-1F50B, U+1F50D, U+1F512-1F513,
|
|
273
|
+
U+1F53E-1F54A, U+1F54F-1F5FA, U+1F610, U+1F650-1F67F, U+1F687, U+1F68D,
|
|
274
|
+
U+1F691, U+1F694, U+1F698, U+1F6AD, U+1F6B2, U+1F6B9-1F6BA, U+1F6BC,
|
|
275
|
+
U+1F6C6-1F6CF, U+1F6D3-1F6D7, U+1F6E0-1F6EA, U+1F6F0-1F6F3, U+1F6F7-1F6FC,
|
|
276
|
+
U+1F700-1F7FF, U+1F800-1F80B, U+1F810-1F847, U+1F850-1F859, U+1F860-1F887,
|
|
277
|
+
U+1F890-1F8AD, U+1F8B0-1F8BB, U+1F8C0-1F8C1, U+1F900-1F90B, U+1F93B,
|
|
278
|
+
U+1F946, U+1F984, U+1F996, U+1F9E9, U+1FA00-1FA6F, U+1FA70-1FA7C,
|
|
279
|
+
U+1FA80-1FA89, U+1FA8F-1FAC6, U+1FACE-1FADC, U+1FADF-1FAE9, U+1FAF0-1FAF8,
|
|
284
280
|
U+1FB00-1FBFF;
|
|
285
281
|
}
|
|
286
282
|
/* vietnamese */
|
|
@@ -308,8 +304,8 @@
|
|
|
308
304
|
format('woff2');
|
|
309
305
|
unicode-range:
|
|
310
306
|
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
|
|
311
|
-
U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
|
|
312
|
-
U+
|
|
307
|
+
U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
|
|
308
|
+
U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
|
313
309
|
}
|
|
314
310
|
/* latin */
|
|
315
311
|
@font-face {
|
|
@@ -322,6 +318,6 @@
|
|
|
322
318
|
format('woff2');
|
|
323
319
|
unicode-range:
|
|
324
320
|
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
|
|
325
|
-
U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
|
|
326
|
-
U+
|
|
321
|
+
U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
|
|
322
|
+
U+2215, U+FEFF, U+FFFD;
|
|
327
323
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -6,10 +6,11 @@ var tagTable = require('./styleD/build/typescript/component/tagTable.cjs');
|
|
|
6
6
|
var userMenu = require('./styleD/build/typescript/component/userMenu.cjs');
|
|
7
7
|
var avatar = require('./styleD/build/typescript/component/avatar.cjs');
|
|
8
8
|
var button = require('./styleD/build/typescript/component/button.cjs');
|
|
9
|
-
var typography = require('./styleD/build/typescript/component/typography.cjs');
|
|
9
|
+
var typography$1 = require('./styleD/build/typescript/component/typography.cjs');
|
|
10
10
|
var icon = require('./styleD/build/typescript/component/icon.cjs');
|
|
11
|
+
var favicon = require('./styleD/build/typescript/component/favicon.cjs');
|
|
11
12
|
var colors = require('./styleD/build/typescript/base/colors.cjs');
|
|
12
|
-
var typography
|
|
13
|
+
var typography = require('./styleD/build/typescript/base/typography.cjs');
|
|
13
14
|
var spacing = require('./styleD/build/typescript/base/spacing.cjs');
|
|
14
15
|
var sizing = require('./styleD/build/typescript/base/sizing.cjs');
|
|
15
16
|
var radius = require('./styleD/build/typescript/base/radius.cjs');
|
|
@@ -26,10 +27,11 @@ exports.componentTagTable = tagTable.componentTagTable;
|
|
|
26
27
|
exports.componentUserMenu = userMenu.componentUserMenu;
|
|
27
28
|
exports.componentAvatar = avatar.componentAvatar;
|
|
28
29
|
exports.componentButton = button.componentButton;
|
|
29
|
-
exports.componentTypography = typography.componentTypography;
|
|
30
|
+
exports.componentTypography = typography$1.componentTypography;
|
|
30
31
|
exports.componentIcon = icon.componentIcon;
|
|
32
|
+
exports.componentFavicon = favicon.componentFavicon;
|
|
31
33
|
exports.baseColors = colors.baseColors;
|
|
32
|
-
exports.baseTypography = typography
|
|
34
|
+
exports.baseTypography = typography.baseTypography;
|
|
33
35
|
exports.baseSpacing = spacing.baseSpacing;
|
|
34
36
|
exports.baseSizing = sizing.baseSizing;
|
|
35
37
|
exports.baseRadius = radius.baseRadius;
|