@guardian/stand 0.0.45 → 0.0.47
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/IntendedAudienceSignifier.cjs +2 -0
- package/dist/IntendedAudienceSignifier.d.cts +2 -1
- package/dist/IntendedAudienceSignifier.d.ts +2 -1
- package/dist/IntendedAudienceSignifier.js +2 -1
- package/dist/components/AlertBanner/AlertBanner.cjs +0 -1
- package/dist/components/AlertBanner/styles.cjs +0 -1
- package/dist/components/Avatar/Avatar.cjs +0 -1
- package/dist/components/Avatar/styles.cjs +0 -1
- package/dist/components/AvatarButton/AvatarButton.cjs +0 -1
- package/dist/components/AvatarButton/styles.cjs +0 -1
- package/dist/components/AvatarLink/AvatarLink.cjs +0 -1
- package/dist/components/AvatarLink/styles.cjs +0 -1
- package/dist/components/Button/Button.cjs +0 -1
- package/dist/components/Button/styles.cjs +0 -1
- package/dist/components/Byline/Byline.cjs +0 -1
- package/dist/components/Byline/Preview.cjs +0 -1
- package/dist/components/Byline/placeholder.cjs +0 -1
- package/dist/components/Byline/plugins.cjs +0 -1
- package/dist/components/Byline/schema.cjs +0 -1
- package/dist/components/Byline/styles.cjs +0 -1
- package/dist/components/Checkbox/Checkbox.cjs +0 -1
- package/dist/components/Checkbox/styles.cjs +0 -1
- package/dist/components/DatePicker/DatePicker.cjs +0 -1
- package/dist/components/DatePicker/styles.cjs +0 -1
- package/dist/components/Favicon/Favicon.cjs +0 -1
- package/dist/components/Favicon/styles.cjs +0 -1
- package/dist/components/Form/Form.cjs +0 -1
- package/dist/components/Form/styles.cjs +0 -1
- package/dist/components/Form/types.cjs +0 -1
- package/dist/components/Grid/Grid.cjs +0 -1
- package/dist/components/Grid/styles.cjs +0 -1
- package/dist/components/Icon/Icon.cjs +0 -1
- package/dist/components/Icon/Styles.cjs +0 -1
- package/dist/components/IconButton/IconButton.cjs +0 -1
- package/dist/components/IconLinkButton/IconLinkButton.cjs +0 -1
- package/dist/components/InlineMessage/InlineMessage.cjs +0 -1
- package/dist/components/InlineMessage/styles.cjs +0 -1
- package/dist/components/IntendedAudienceSignifier/FlagIcons.cjs +14 -14
- package/dist/components/IntendedAudienceSignifier/FlagIcons.js +14 -13
- package/dist/components/IntendedAudienceSignifier/IntendedAudienceSignifier.cjs +16 -18
- package/dist/components/IntendedAudienceSignifier/IntendedAudienceSignifier.js +16 -17
- package/dist/components/IntendedAudienceSignifier/styles.cjs +0 -2
- package/dist/components/IntendedAudienceSignifier/styles.js +0 -1
- package/dist/components/IntendedAudienceSignifier/types.d.cts +2 -2
- package/dist/components/IntendedAudienceSignifier/types.d.ts +2 -2
- package/dist/components/IntendedAudienceSignifier/utils.cjs +19 -0
- package/dist/components/IntendedAudienceSignifier/utils.d.cts +12 -0
- package/dist/components/IntendedAudienceSignifier/utils.d.ts +12 -0
- package/dist/components/IntendedAudienceSignifier/utils.js +19 -0
- package/dist/components/Layout/Layout.cjs +0 -1
- package/dist/components/Layout/styles.cjs +0 -1
- package/dist/components/Link/Link.cjs +0 -1
- package/dist/components/Link/styles.cjs +0 -1
- package/dist/components/LinkButton/LinkButton.cjs +0 -1
- package/dist/components/Menu/styles.cjs +0 -1
- package/dist/components/RadioGroup/styles.cjs +0 -1
- package/dist/components/Select/styles.cjs +0 -1
- package/dist/components/TagPicker/Autocomplete.cjs +0 -1
- package/dist/components/TagPicker/TagAutocomplete.cjs +0 -1
- package/dist/components/TagPicker/TagTable.cjs +0 -1
- package/dist/components/TagPicker/styles.cjs +0 -1
- package/dist/components/TextArea/TextArea.cjs +0 -1
- package/dist/components/TextArea/styles.cjs +0 -1
- package/dist/components/TextInput/TextInput.cjs +0 -1
- package/dist/components/TextInput/styles.cjs +0 -1
- package/dist/components/TopBar/TopBarItem/TopBarItem.cjs +0 -1
- package/dist/components/TopBar/TopBarItem/styles.cjs +0 -1
- package/dist/components/TopBar/TopBarNavigation/TopBarNavigation.cjs +0 -1
- package/dist/components/TopBar/TopBarNavigation/styles.cjs +0 -1
- package/dist/components/TopBar/TopBarToolName/TopBarToolName.cjs +0 -1
- package/dist/components/TopBar/TopBarToolName/styles.cjs +0 -1
- package/dist/components/TopBar/styles.cjs +0 -1
- package/dist/components/Typography/Typography.cjs +0 -1
- package/dist/components/Typography/styles.cjs +0 -1
- package/dist/components/UserMenu/PreferenceRadioGroup.cjs +0 -1
- package/dist/components/UserMenu/TitleText.cjs +0 -1
- package/dist/components/UserMenu/UserMenu.cjs +0 -1
- package/dist/components/UserMenu/styles.cjs +0 -1
- package/dist/styleD/build/typescript/component/intendedAudienceSignifier.cjs +1 -4
- package/dist/styleD/build/typescript/component/intendedAudienceSignifier.d.cts +0 -1
- package/dist/styleD/build/typescript/component/intendedAudienceSignifier.d.ts +0 -1
- package/dist/styleD/build/typescript/component/intendedAudienceSignifier.js +1 -4
- package/dist/styleD/utils/semantic/typography.cjs +0 -1
- package/dist/util/reset2.cjs +0 -1
- package/dist/util/useResize.cjs +0 -1
- package/package.json +25 -24
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_intendedAudienceSignifier = require("./styleD/build/typescript/component/intendedAudienceSignifier.cjs");
|
|
3
3
|
const require_IntendedAudienceSignifier = require("./components/IntendedAudienceSignifier/IntendedAudienceSignifier.cjs");
|
|
4
|
+
const require_utils = require("./components/IntendedAudienceSignifier/utils.cjs");
|
|
4
5
|
exports.IntendedAudienceSignifier = require_IntendedAudienceSignifier.IntendedAudienceSignifier;
|
|
5
6
|
exports.componentIntendedAudienceSignifier = require_intendedAudienceSignifier.componentIntendedAudienceSignifier;
|
|
7
|
+
exports.mapTagsToSourceAndTarget = require_utils.mapTagsToSourceAndTarget;
|
|
@@ -2,4 +2,5 @@ import { ComponentIntendedAudienceSignifier, componentIntendedAudienceSignifier
|
|
|
2
2
|
import { IntendedAudienceSignifierTheme } from "./components/IntendedAudienceSignifier/styles.cjs";
|
|
3
3
|
import { IntendedAudienceSignifierProps } from "./components/IntendedAudienceSignifier/types.cjs";
|
|
4
4
|
import { IntendedAudienceSignifier } from "./components/IntendedAudienceSignifier/IntendedAudienceSignifier.cjs";
|
|
5
|
-
|
|
5
|
+
import { mapTagsToSourceAndTarget } from "./components/IntendedAudienceSignifier/utils.cjs";
|
|
6
|
+
export { type ComponentIntendedAudienceSignifier, IntendedAudienceSignifier, type IntendedAudienceSignifierProps, type IntendedAudienceSignifierTheme, componentIntendedAudienceSignifier, mapTagsToSourceAndTarget };
|
|
@@ -2,4 +2,5 @@ import { ComponentIntendedAudienceSignifier, componentIntendedAudienceSignifier
|
|
|
2
2
|
import { IntendedAudienceSignifierTheme } from "./components/IntendedAudienceSignifier/styles.js";
|
|
3
3
|
import { IntendedAudienceSignifierProps } from "./components/IntendedAudienceSignifier/types.js";
|
|
4
4
|
import { IntendedAudienceSignifier } from "./components/IntendedAudienceSignifier/IntendedAudienceSignifier.js";
|
|
5
|
-
|
|
5
|
+
import { mapTagsToSourceAndTarget } from "./components/IntendedAudienceSignifier/utils.js";
|
|
6
|
+
export { type ComponentIntendedAudienceSignifier, IntendedAudienceSignifier, type IntendedAudienceSignifierProps, type IntendedAudienceSignifierTheme, componentIntendedAudienceSignifier, mapTagsToSourceAndTarget };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { componentIntendedAudienceSignifier } from "./styleD/build/typescript/component/intendedAudienceSignifier.js";
|
|
2
2
|
import { IntendedAudienceSignifier } from "./components/IntendedAudienceSignifier/IntendedAudienceSignifier.js";
|
|
3
|
-
|
|
3
|
+
import { mapTagsToSourceAndTarget } from "./components/IntendedAudienceSignifier/utils.js";
|
|
4
|
+
export { IntendedAudienceSignifier, componentIntendedAudienceSignifier, mapTagsToSourceAndTarget };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
1
|
const require_typography = require("../../styleD/utils/semantic/typography.cjs");
|
|
3
2
|
const require_alertBanner = require("../../styleD/build/typescript/component/alertBanner.cjs");
|
|
4
3
|
let _emotion_react = require("@emotion/react");
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
1
|
const require_typography = require("../../styleD/utils/semantic/typography.cjs");
|
|
3
2
|
const require_checkbox = require("../../styleD/build/typescript/component/checkbox.cjs");
|
|
4
3
|
let _emotion_react = require("@emotion/react");
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
1
|
const require_typography = require("../../styleD/utils/semantic/typography.cjs");
|
|
3
2
|
const require_datePicker = require("../../styleD/build/typescript/component/datePicker.cjs");
|
|
4
3
|
let _emotion_react = require("@emotion/react");
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
1
|
let _emotion_react_jsx_runtime = require("@emotion/react/jsx-runtime");
|
|
3
2
|
//#region src/components/IntendedAudienceSignifier/FlagIcons.tsx
|
|
4
|
-
const
|
|
3
|
+
const sharedProps = {
|
|
4
|
+
role: "presentation",
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
6
|
+
};
|
|
7
|
+
const sharedFlagProps = {
|
|
8
|
+
...sharedProps,
|
|
5
9
|
height: "12px",
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
viewBox: "0 0 640 480"
|
|
11
|
+
};
|
|
12
|
+
const ukFlag = /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)("svg", {
|
|
13
|
+
...sharedFlagProps,
|
|
9
14
|
children: [
|
|
10
15
|
/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("path", {
|
|
11
16
|
fill: "#012169",
|
|
@@ -30,10 +35,7 @@ const ukFlag = /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)("svg", {
|
|
|
30
35
|
]
|
|
31
36
|
});
|
|
32
37
|
const usFlag = /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)("svg", {
|
|
33
|
-
|
|
34
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
35
|
-
id: "flag-icons-us",
|
|
36
|
-
viewBox: "0 0 640 480",
|
|
38
|
+
...sharedFlagProps,
|
|
37
39
|
children: [
|
|
38
40
|
/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("path", {
|
|
39
41
|
fill: "#bd3d44",
|
|
@@ -65,10 +67,7 @@ const usFlag = /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)("svg", {
|
|
|
65
67
|
]
|
|
66
68
|
});
|
|
67
69
|
const auFlag = /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)("svg", {
|
|
68
|
-
|
|
69
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
70
|
-
id: "flag-icons-au",
|
|
71
|
-
viewBox: "0 0 640 480",
|
|
70
|
+
...sharedFlagProps,
|
|
72
71
|
children: [
|
|
73
72
|
/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("path", {
|
|
74
73
|
fill: "#00008B",
|
|
@@ -97,6 +96,7 @@ const auFlag = /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)("svg", {
|
|
|
97
96
|
]
|
|
98
97
|
});
|
|
99
98
|
const globeIcon = /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("svg", {
|
|
99
|
+
...sharedProps,
|
|
100
100
|
width: "12px",
|
|
101
101
|
height: "12px",
|
|
102
102
|
fill: "#000000",
|
|
@@ -104,10 +104,10 @@ const globeIcon = /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("svg", {
|
|
|
104
104
|
children: /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("path", { d: "M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0M3.668 2.501l-.288.646a.847.847 0 0 0 1.479.815l.245-.368a.81.81 0 0 1 1.034-.275.81.81 0 0 0 .724 0l.261-.13a1 1 0 0 1 .775-.05l.984.34q.118.04.243.054c.784.093.855.377.694.801-.155.41-.616.617-1.035.487l-.01-.003C8.274 4.663 7.748 4.5 6 4.5 4.8 4.5 3.5 5.62 3.5 7c0 1.96.826 2.166 1.696 2.382.46.115.935.233 1.304.618.449.467.393 1.181.339 1.877C6.755 12.96 6.674 14 8.5 14c1.75 0 3-3.5 3-4.5 0-.262.208-.468.444-.7.396-.392.87-.86.556-1.8-.097-.291-.396-.568-.641-.756-.174-.133-.207-.396-.052-.551a.33.33 0 0 1 .42-.042l1.085.724c.11.072.255.058.348-.035.15-.15.415-.083.489.117.16.43.445 1.05.849 1.357L15 8A7 7 0 1 1 3.668 2.501" })
|
|
105
105
|
});
|
|
106
106
|
const DoubleChevronRightSvg = /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)("svg", {
|
|
107
|
+
...sharedProps,
|
|
107
108
|
width: "12",
|
|
108
109
|
height: "12",
|
|
109
110
|
viewBox: "0 0 9 7",
|
|
110
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
111
111
|
children: [/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("path", { d: "M5.75 0H3.5L6 3.5L3.5 7H5.75L8.25 3.5L5.75 0Z" }), /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("path", { d: "M2.25 0H0L2.5 3.5L0 7H2.25L4.75 3.5L2.25 0Z" })]
|
|
112
112
|
});
|
|
113
113
|
//#endregion
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
2
2
|
//#region src/components/IntendedAudienceSignifier/FlagIcons.tsx
|
|
3
|
-
const
|
|
3
|
+
const sharedProps = {
|
|
4
|
+
role: "presentation",
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
6
|
+
};
|
|
7
|
+
const sharedFlagProps = {
|
|
8
|
+
...sharedProps,
|
|
4
9
|
height: "12px",
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
viewBox: "0 0 640 480"
|
|
11
|
+
};
|
|
12
|
+
const ukFlag = /* @__PURE__ */ jsxs("svg", {
|
|
13
|
+
...sharedFlagProps,
|
|
8
14
|
children: [
|
|
9
15
|
/* @__PURE__ */ jsx("path", {
|
|
10
16
|
fill: "#012169",
|
|
@@ -29,10 +35,7 @@ const ukFlag = /* @__PURE__ */ jsxs("svg", {
|
|
|
29
35
|
]
|
|
30
36
|
});
|
|
31
37
|
const usFlag = /* @__PURE__ */ jsxs("svg", {
|
|
32
|
-
|
|
33
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
34
|
-
id: "flag-icons-us",
|
|
35
|
-
viewBox: "0 0 640 480",
|
|
38
|
+
...sharedFlagProps,
|
|
36
39
|
children: [
|
|
37
40
|
/* @__PURE__ */ jsx("path", {
|
|
38
41
|
fill: "#bd3d44",
|
|
@@ -64,10 +67,7 @@ const usFlag = /* @__PURE__ */ jsxs("svg", {
|
|
|
64
67
|
]
|
|
65
68
|
});
|
|
66
69
|
const auFlag = /* @__PURE__ */ jsxs("svg", {
|
|
67
|
-
|
|
68
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
69
|
-
id: "flag-icons-au",
|
|
70
|
-
viewBox: "0 0 640 480",
|
|
70
|
+
...sharedFlagProps,
|
|
71
71
|
children: [
|
|
72
72
|
/* @__PURE__ */ jsx("path", {
|
|
73
73
|
fill: "#00008B",
|
|
@@ -96,6 +96,7 @@ const auFlag = /* @__PURE__ */ jsxs("svg", {
|
|
|
96
96
|
]
|
|
97
97
|
});
|
|
98
98
|
const globeIcon = /* @__PURE__ */ jsx("svg", {
|
|
99
|
+
...sharedProps,
|
|
99
100
|
width: "12px",
|
|
100
101
|
height: "12px",
|
|
101
102
|
fill: "#000000",
|
|
@@ -103,10 +104,10 @@ const globeIcon = /* @__PURE__ */ jsx("svg", {
|
|
|
103
104
|
children: /* @__PURE__ */ jsx("path", { d: "M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0M3.668 2.501l-.288.646a.847.847 0 0 0 1.479.815l.245-.368a.81.81 0 0 1 1.034-.275.81.81 0 0 0 .724 0l.261-.13a1 1 0 0 1 .775-.05l.984.34q.118.04.243.054c.784.093.855.377.694.801-.155.41-.616.617-1.035.487l-.01-.003C8.274 4.663 7.748 4.5 6 4.5 4.8 4.5 3.5 5.62 3.5 7c0 1.96.826 2.166 1.696 2.382.46.115.935.233 1.304.618.449.467.393 1.181.339 1.877C6.755 12.96 6.674 14 8.5 14c1.75 0 3-3.5 3-4.5 0-.262.208-.468.444-.7.396-.392.87-.86.556-1.8-.097-.291-.396-.568-.641-.756-.174-.133-.207-.396-.052-.551a.33.33 0 0 1 .42-.042l1.085.724c.11.072.255.058.348-.035.15-.15.415-.083.489.117.16.43.445 1.05.849 1.357L15 8A7 7 0 1 1 3.668 2.501" })
|
|
104
105
|
});
|
|
105
106
|
const DoubleChevronRightSvg = /* @__PURE__ */ jsxs("svg", {
|
|
107
|
+
...sharedProps,
|
|
106
108
|
width: "12",
|
|
107
109
|
height: "12",
|
|
108
110
|
viewBox: "0 0 9 7",
|
|
109
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
110
111
|
children: [/* @__PURE__ */ jsx("path", { d: "M5.75 0H3.5L6 3.5L3.5 7H5.75L8.25 3.5L5.75 0Z" }), /* @__PURE__ */ jsx("path", { d: "M2.25 0H0L2.5 3.5L0 7H2.25L4.75 3.5L2.25 0Z" })]
|
|
111
112
|
});
|
|
112
113
|
//#endregion
|
|
@@ -1,46 +1,44 @@
|
|
|
1
|
-
require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
1
|
const require_mergeDeep = require("../../util/mergeDeep.cjs");
|
|
3
2
|
const require_FlagIcons = require("./FlagIcons.cjs");
|
|
4
3
|
const require_styles = require("./styles.cjs");
|
|
5
4
|
let _emotion_react_jsx_runtime = require("@emotion/react/jsx-runtime");
|
|
6
5
|
//#region src/components/IntendedAudienceSignifier/IntendedAudienceSignifier.tsx
|
|
7
6
|
const icons = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
uk: require_FlagIcons.ukFlag,
|
|
8
|
+
us: require_FlagIcons.usFlag,
|
|
9
|
+
au: require_FlagIcons.auFlag,
|
|
11
10
|
global: require_FlagIcons.globeIcon
|
|
12
11
|
};
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
case "AUS": return source;
|
|
19
|
-
}
|
|
12
|
+
const descriptionMap = {
|
|
13
|
+
global: "Global",
|
|
14
|
+
uk: "United Kingdom",
|
|
15
|
+
us: "United States",
|
|
16
|
+
au: "Australia"
|
|
20
17
|
};
|
|
18
|
+
const getSourceDescription = (source) => descriptionMap[source];
|
|
21
19
|
const getTargetDescription = (source, target) => {
|
|
22
20
|
switch (target) {
|
|
23
21
|
case "global": return "Global";
|
|
24
|
-
case "
|
|
25
|
-
case "
|
|
26
|
-
case "
|
|
22
|
+
case "uk":
|
|
23
|
+
case "us":
|
|
24
|
+
case "au": return target === source ? "Domestic" : descriptionMap[source];
|
|
27
25
|
}
|
|
28
26
|
};
|
|
29
27
|
const AUDIENCE_NOT_KNOWN_DESCRIPTION = "Intended audience unknown";
|
|
30
|
-
const
|
|
28
|
+
const getSignifierTitle = (source, target) => {
|
|
31
29
|
if (!source || !target) return AUDIENCE_NOT_KNOWN_DESCRIPTION;
|
|
32
|
-
return `${getSourceDescription(source)}
|
|
30
|
+
return `${getSourceDescription(source)} for ${getTargetDescription(source, target)} audience`;
|
|
33
31
|
};
|
|
34
32
|
function IntendedAudienceSignifier({ source, target, theme = {}, cssOverrides, className, ...props }) {
|
|
35
33
|
const mergedTheme = require_mergeDeep.mergeDeep(require_styles.defaultIntendedAudienceSignifierTheme, theme);
|
|
36
|
-
const
|
|
34
|
+
const title = getSignifierTitle(source, target);
|
|
37
35
|
const iconStyles = require_styles.intendedAudienceSignifierIconStyles(mergedTheme);
|
|
38
36
|
const chevronIconStyles = require_styles.intendedAudienceSignifierChevronIconStyles(mergedTheme);
|
|
39
37
|
return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("div", {
|
|
40
38
|
...props,
|
|
41
39
|
className,
|
|
42
40
|
css: [require_styles.intendedAudienceSignifierStyles(mergedTheme), cssOverrides],
|
|
43
|
-
|
|
41
|
+
title,
|
|
44
42
|
children: target && source ? /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsxs)(_emotion_react_jsx_runtime.Fragment, { children: [
|
|
45
43
|
/* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)("div", {
|
|
46
44
|
css: iconStyles,
|
|
@@ -4,42 +4,41 @@ import { defaultIntendedAudienceSignifierTheme, intendedAudienceSignifierChevron
|
|
|
4
4
|
import { Fragment, jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
5
5
|
//#region src/components/IntendedAudienceSignifier/IntendedAudienceSignifier.tsx
|
|
6
6
|
const icons = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
uk: ukFlag,
|
|
8
|
+
us: usFlag,
|
|
9
|
+
au: auFlag,
|
|
10
10
|
global: globeIcon
|
|
11
11
|
};
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
case "AUS": return source;
|
|
18
|
-
}
|
|
12
|
+
const descriptionMap = {
|
|
13
|
+
global: "Global",
|
|
14
|
+
uk: "United Kingdom",
|
|
15
|
+
us: "United States",
|
|
16
|
+
au: "Australia"
|
|
19
17
|
};
|
|
18
|
+
const getSourceDescription = (source) => descriptionMap[source];
|
|
20
19
|
const getTargetDescription = (source, target) => {
|
|
21
20
|
switch (target) {
|
|
22
21
|
case "global": return "Global";
|
|
23
|
-
case "
|
|
24
|
-
case "
|
|
25
|
-
case "
|
|
22
|
+
case "uk":
|
|
23
|
+
case "us":
|
|
24
|
+
case "au": return target === source ? "Domestic" : descriptionMap[source];
|
|
26
25
|
}
|
|
27
26
|
};
|
|
28
27
|
const AUDIENCE_NOT_KNOWN_DESCRIPTION = "Intended audience unknown";
|
|
29
|
-
const
|
|
28
|
+
const getSignifierTitle = (source, target) => {
|
|
30
29
|
if (!source || !target) return AUDIENCE_NOT_KNOWN_DESCRIPTION;
|
|
31
|
-
return `${getSourceDescription(source)}
|
|
30
|
+
return `${getSourceDescription(source)} for ${getTargetDescription(source, target)} audience`;
|
|
32
31
|
};
|
|
33
32
|
function IntendedAudienceSignifier({ source, target, theme = {}, cssOverrides, className, ...props }) {
|
|
34
33
|
const mergedTheme = mergeDeep(defaultIntendedAudienceSignifierTheme, theme);
|
|
35
|
-
const
|
|
34
|
+
const title = getSignifierTitle(source, target);
|
|
36
35
|
const iconStyles = intendedAudienceSignifierIconStyles(mergedTheme);
|
|
37
36
|
const chevronIconStyles = intendedAudienceSignifierChevronIconStyles(mergedTheme);
|
|
38
37
|
return /* @__PURE__ */ jsx("div", {
|
|
39
38
|
...props,
|
|
40
39
|
className,
|
|
41
40
|
css: [intendedAudienceSignifierStyles(mergedTheme), cssOverrides],
|
|
42
|
-
|
|
41
|
+
title,
|
|
43
42
|
children: target && source ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
44
43
|
/* @__PURE__ */ jsx("div", {
|
|
45
44
|
css: iconStyles,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
1
|
const require_intendedAudienceSignifier = require("../../styleD/build/typescript/component/intendedAudienceSignifier.cjs");
|
|
3
2
|
let _emotion_react = require("@emotion/react");
|
|
4
3
|
//#region src/components/IntendedAudienceSignifier/styles.ts
|
|
@@ -9,7 +8,6 @@ const intendedAudienceSignifierStyles = (theme) => _emotion_react.css`
|
|
|
9
8
|
justify-content: ${theme.justifyContent};
|
|
10
9
|
align-items: ${theme.alignItems};
|
|
11
10
|
color: ${theme.color};
|
|
12
|
-
font: ${theme.typography.font};
|
|
13
11
|
line-height: ${theme.typography.lineHeight};
|
|
14
12
|
border-width: ${theme.borderWidth};
|
|
15
13
|
border-style: ${theme.borderStyle};
|
|
@@ -8,7 +8,6 @@ const intendedAudienceSignifierStyles = (theme) => css`
|
|
|
8
8
|
justify-content: ${theme.justifyContent};
|
|
9
9
|
align-items: ${theme.alignItems};
|
|
10
10
|
color: ${theme.color};
|
|
11
|
-
font: ${theme.typography.font};
|
|
12
11
|
line-height: ${theme.typography.lineHeight};
|
|
13
12
|
border-width: ${theme.borderWidth};
|
|
14
13
|
border-style: ${theme.borderStyle};
|
|
@@ -2,10 +2,10 @@ import { DefaultProps } from "../../util/types.cjs";
|
|
|
2
2
|
import { IntendedAudienceSignifierTheme } from "./styles.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/components/IntendedAudienceSignifier/types.d.ts
|
|
5
|
-
type SourceOrTarget = 'global' | '
|
|
5
|
+
type SourceOrTarget = 'global' | 'uk' | 'us' | 'au';
|
|
6
6
|
interface IntendedAudienceSignifierProps extends DefaultProps<IntendedAudienceSignifierTheme> {
|
|
7
7
|
source?: SourceOrTarget;
|
|
8
8
|
target?: SourceOrTarget;
|
|
9
9
|
}
|
|
10
10
|
//#endregion
|
|
11
|
-
export { IntendedAudienceSignifierProps };
|
|
11
|
+
export { IntendedAudienceSignifierProps, SourceOrTarget };
|
|
@@ -2,10 +2,10 @@ import { DefaultProps } from "../../util/types.js";
|
|
|
2
2
|
import { IntendedAudienceSignifierTheme } from "./styles.js";
|
|
3
3
|
|
|
4
4
|
//#region src/components/IntendedAudienceSignifier/types.d.ts
|
|
5
|
-
type SourceOrTarget = 'global' | '
|
|
5
|
+
type SourceOrTarget = 'global' | 'uk' | 'us' | 'au';
|
|
6
6
|
interface IntendedAudienceSignifierProps extends DefaultProps<IntendedAudienceSignifierTheme> {
|
|
7
7
|
source?: SourceOrTarget;
|
|
8
8
|
target?: SourceOrTarget;
|
|
9
9
|
}
|
|
10
10
|
//#endregion
|
|
11
|
-
export { IntendedAudienceSignifierProps };
|
|
11
|
+
export { IntendedAudienceSignifierProps, SourceOrTarget };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/components/IntendedAudienceSignifier/utils.ts
|
|
2
|
+
const mapTagsToSourceAndTarget = (tags) => {
|
|
3
|
+
const domesticAudience = tags.find((tag) => /tracking\/audience\/(au|us|uk)/.test(tag.path ?? ""))?.path?.split("/").at(-1);
|
|
4
|
+
const isGlobal = !!tags.find((tag) => tag.path === "tracking/audience/global");
|
|
5
|
+
if (domesticAudience && !isGlobal) return {
|
|
6
|
+
source: domesticAudience,
|
|
7
|
+
target: domesticAudience
|
|
8
|
+
};
|
|
9
|
+
else if (domesticAudience && isGlobal) return {
|
|
10
|
+
source: domesticAudience,
|
|
11
|
+
target: "global"
|
|
12
|
+
};
|
|
13
|
+
else if (!domesticAudience && isGlobal) return {
|
|
14
|
+
source: "global",
|
|
15
|
+
target: "global"
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.mapTagsToSourceAndTarget = mapTagsToSourceAndTarget;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SourceOrTarget } from "./types.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/components/IntendedAudienceSignifier/utils.d.ts
|
|
4
|
+
interface Tag {
|
|
5
|
+
path?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const mapTagsToSourceAndTarget: (tags: Tag[]) => {
|
|
8
|
+
source: SourceOrTarget;
|
|
9
|
+
target: SourceOrTarget;
|
|
10
|
+
} | undefined;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { mapTagsToSourceAndTarget };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SourceOrTarget } from "./types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/components/IntendedAudienceSignifier/utils.d.ts
|
|
4
|
+
interface Tag {
|
|
5
|
+
path?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const mapTagsToSourceAndTarget: (tags: Tag[]) => {
|
|
8
|
+
source: SourceOrTarget;
|
|
9
|
+
target: SourceOrTarget;
|
|
10
|
+
} | undefined;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { mapTagsToSourceAndTarget };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/components/IntendedAudienceSignifier/utils.ts
|
|
2
|
+
const mapTagsToSourceAndTarget = (tags) => {
|
|
3
|
+
const domesticAudience = tags.find((tag) => /tracking\/audience\/(au|us|uk)/.test(tag.path ?? ""))?.path?.split("/").at(-1);
|
|
4
|
+
const isGlobal = !!tags.find((tag) => tag.path === "tracking/audience/global");
|
|
5
|
+
if (domesticAudience && !isGlobal) return {
|
|
6
|
+
source: domesticAudience,
|
|
7
|
+
target: domesticAudience
|
|
8
|
+
};
|
|
9
|
+
else if (domesticAudience && isGlobal) return {
|
|
10
|
+
source: domesticAudience,
|
|
11
|
+
target: "global"
|
|
12
|
+
};
|
|
13
|
+
else if (!domesticAudience && isGlobal) return {
|
|
14
|
+
source: "global",
|
|
15
|
+
target: "global"
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { mapTagsToSourceAndTarget };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
1
|
const require_typography = require("../../styleD/utils/semantic/typography.cjs");
|
|
3
2
|
const require_radioGroup = require("../../styleD/build/typescript/component/radioGroup.cjs");
|
|
4
3
|
let _emotion_react = require("@emotion/react");
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
1
|
const require_mergeDeep = require("../../util/mergeDeep.cjs");
|
|
3
2
|
const require_autocomplete = require("../../styleD/build/typescript/component/autocomplete.cjs");
|
|
4
3
|
const require_tagTable = require("../../styleD/build/typescript/component/tagTable.cjs");
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
1
|
const require_typography = require("../../styleD/utils/semantic/typography.cjs");
|
|
3
2
|
const require_textArea = require("../../styleD/build/typescript/component/textArea.cjs");
|
|
4
3
|
let _emotion_react = require("@emotion/react");
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
1
|
const require_typography = require("../../styleD/utils/semantic/typography.cjs");
|
|
3
2
|
const require_textInput = require("../../styleD/build/typescript/component/textInput.cjs");
|
|
4
3
|
let _emotion_react = require("@emotion/react");
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
require("../../../_virtual/_rolldown/runtime.cjs");
|
|
2
1
|
const require_typography = require("../../../styleD/utils/semantic/typography.cjs");
|
|
3
2
|
const require_topBar = require("../../../styleD/build/typescript/component/topBar.cjs");
|
|
4
3
|
let _emotion_react = require("@emotion/react");
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
require("../../../_virtual/_rolldown/runtime.cjs");
|
|
2
1
|
const require_typography = require("../../../styleD/utils/semantic/typography.cjs");
|
|
3
2
|
const require_mq = require("../../../styleD/utils/semantic/mq.cjs");
|
|
4
3
|
const require_topBar = require("../../../styleD/build/typescript/component/topBar.cjs");
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
1
|
const require_typography = require("../../styleD/utils/semantic/typography.cjs");
|
|
3
2
|
const require_typography$1 = require("../../styleD/build/typescript/component/typography.cjs");
|
|
4
3
|
const require_typography$2 = require("../../styleD/build/typescript/semantic/typography.cjs");
|
|
@@ -25,10 +25,7 @@ const componentIntendedAudienceSignifier = {
|
|
|
25
25
|
size: "10px"
|
|
26
26
|
},
|
|
27
27
|
color: "#545454",
|
|
28
|
-
typography: {
|
|
29
|
-
font: "normal 460 0.75rem/1.3 Open Sans",
|
|
30
|
-
lineHeight: "1"
|
|
31
|
-
}
|
|
28
|
+
typography: { lineHeight: "1" }
|
|
32
29
|
};
|
|
33
30
|
//#endregion
|
|
34
31
|
exports.componentIntendedAudienceSignifier = componentIntendedAudienceSignifier;
|
|
@@ -25,10 +25,7 @@ const componentIntendedAudienceSignifier = {
|
|
|
25
25
|
size: "10px"
|
|
26
26
|
},
|
|
27
27
|
color: "#545454",
|
|
28
|
-
typography: {
|
|
29
|
-
font: "normal 460 0.75rem/1.3 Open Sans",
|
|
30
|
-
lineHeight: "1"
|
|
31
|
-
}
|
|
28
|
+
typography: { lineHeight: "1" }
|
|
32
29
|
};
|
|
33
30
|
//#endregion
|
|
34
31
|
export { componentIntendedAudienceSignifier };
|
package/dist/util/reset2.cjs
CHANGED
package/dist/util/useResize.cjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guardian/stand",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.47",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "https://github.com/guardian/stand"
|
|
6
6
|
},
|
|
@@ -448,23 +448,24 @@
|
|
|
448
448
|
"dist"
|
|
449
449
|
],
|
|
450
450
|
"devDependencies": {
|
|
451
|
-
"@arethetypeswrong/core": "0.18.
|
|
451
|
+
"@arethetypeswrong/core": "0.18.3",
|
|
452
452
|
"@changesets/cli": "2.31.0",
|
|
453
453
|
"@codesandbox/sandpack-react": "2.20.0",
|
|
454
454
|
"@emotion/react": "11.11.4",
|
|
455
|
-
"@figma/rest-api-spec": "0.
|
|
456
|
-
"@guardian/eslint-config": "
|
|
455
|
+
"@figma/rest-api-spec": "0.40.0",
|
|
456
|
+
"@guardian/eslint-config": "15.0.0",
|
|
457
457
|
"@guardian/prettier": "10.0.0",
|
|
458
458
|
"@guardian/prosemirror-invisibles": "3.1.1",
|
|
459
459
|
"@guardian/tsconfig": "1.0.1",
|
|
460
460
|
"@internationalized/date": "3.12.1",
|
|
461
461
|
"@material-design-icons/svg": "0.14.15",
|
|
462
462
|
"@playwright/experimental-ct-react17": "1.60.0",
|
|
463
|
-
"@storybook/addon-
|
|
464
|
-
"@storybook/addon-
|
|
465
|
-
"@storybook/
|
|
463
|
+
"@storybook/addon-a11y": "10.4.2",
|
|
464
|
+
"@storybook/addon-docs": "10.4.2",
|
|
465
|
+
"@storybook/addon-themes": "10.4.2",
|
|
466
|
+
"@storybook/react-vite": "10.4.2",
|
|
466
467
|
"@testing-library/jest-dom": "6.9.1",
|
|
467
|
-
"@tsdown/css": "0.22.
|
|
468
|
+
"@tsdown/css": "0.22.2",
|
|
468
469
|
"@types/jest": "30.0.0",
|
|
469
470
|
"@types/node": "24.10.1",
|
|
470
471
|
"@types/react": "17.0.76",
|
|
@@ -472,11 +473,11 @@
|
|
|
472
473
|
"change-case": "5.4.4",
|
|
473
474
|
"eslint": "9.39.3",
|
|
474
475
|
"eslint-plugin-check-file": "3.3.1",
|
|
475
|
-
"eslint-plugin-storybook": "10.4.
|
|
476
|
+
"eslint-plugin-storybook": "10.4.2",
|
|
476
477
|
"husky": "9.1.7",
|
|
477
478
|
"jest": "30.4.2",
|
|
478
479
|
"jest-environment-jsdom": "30.4.1",
|
|
479
|
-
"lint-staged": "17.0.
|
|
480
|
+
"lint-staged": "17.0.7",
|
|
480
481
|
"prettier": "3.8.3",
|
|
481
482
|
"prosemirror-dropcursor": "1.8.2",
|
|
482
483
|
"prosemirror-history": "1.4.1",
|
|
@@ -490,28 +491,28 @@
|
|
|
490
491
|
"react-dom": "17.0.2",
|
|
491
492
|
"remark-gfm": "4.0.1",
|
|
492
493
|
"rimraf": "6.1.3",
|
|
493
|
-
"sort-package-json": "
|
|
494
|
-
"storybook": "10.4.
|
|
495
|
-
"style-dictionary": "5.4.
|
|
496
|
-
"ts-jest": "29.4.
|
|
497
|
-
"tsdown": "0.22.
|
|
494
|
+
"sort-package-json": "4.0.0",
|
|
495
|
+
"storybook": "10.4.2",
|
|
496
|
+
"style-dictionary": "5.4.4",
|
|
497
|
+
"ts-jest": "29.4.11",
|
|
498
|
+
"tsdown": "0.22.2",
|
|
498
499
|
"tslib": "2.8.1",
|
|
499
500
|
"typescript": "5.1.3",
|
|
500
|
-
"vite": "8.0.
|
|
501
|
+
"vite": "8.0.16",
|
|
501
502
|
"vite-plugin-svgr": "5.2.0"
|
|
502
503
|
},
|
|
503
504
|
"peerDependencies": {
|
|
504
505
|
"@emotion/react": ">=11.11.4 <=11.14.0",
|
|
505
|
-
"@guardian/prosemirror-invisibles": "3.1.1",
|
|
506
|
+
"@guardian/prosemirror-invisibles": "^3.1.1",
|
|
506
507
|
"@internationalized/date": "^3.12.1",
|
|
507
|
-
"prosemirror-dropcursor": "1.8.2",
|
|
508
|
-
"prosemirror-history": "1.4.1",
|
|
509
|
-
"prosemirror-keymap": "1.2.2",
|
|
510
|
-
"prosemirror-model": "1.25.0",
|
|
511
|
-
"prosemirror-state": "1.4.3",
|
|
512
|
-
"prosemirror-view": "1.37.2",
|
|
508
|
+
"prosemirror-dropcursor": "^1.8.2",
|
|
509
|
+
"prosemirror-history": "^1.4.1",
|
|
510
|
+
"prosemirror-keymap": "^1.2.2",
|
|
511
|
+
"prosemirror-model": "^1.25.0",
|
|
512
|
+
"prosemirror-state": "^1.4.3",
|
|
513
|
+
"prosemirror-view": "^1.37.2",
|
|
513
514
|
"react": "^17.0.2 || ^18.0.0 || ^19.0.0",
|
|
514
|
-
"react-aria-components": ">= 1.13.0 <= 1.
|
|
515
|
+
"react-aria-components": ">= 1.13.0 <= 1.18.0",
|
|
515
516
|
"react-dom": "^17.0.2 || ^18.0.0 || ^19.0.0",
|
|
516
517
|
"typescript": ">=5.0.0 <=5.9.3"
|
|
517
518
|
},
|