@guardian/stand 0.0.36 → 0.0.38
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/alert-banner/AlertBanner.js +1 -1
- package/dist/components/avatar/Avatar.js +1 -1
- package/dist/components/button/Button.js +1 -1
- package/dist/components/checkbox/Checkbox.js +1 -1
- package/dist/components/checkbox/CheckboxGroup.js +1 -1
- package/dist/components/date-picker/DatePicker.js +1 -1
- package/dist/components/grid/Grid.js +1 -1
- package/dist/components/grid/styles.cjs +59 -39
- package/dist/components/grid/styles.js +47 -35
- package/dist/components/icon/Icon.js +1 -1
- package/dist/components/icon-button/IconButton.js +1 -1
- package/dist/components/icon-button/styles.js +1 -1
- package/dist/components/icon-link-button/IconLinkButton.js +1 -1
- package/dist/components/icon-link-button/styles.js +1 -1
- package/dist/components/inline-message/InlineMessage.js +1 -1
- package/dist/components/intended-audience-signifier/FlagIcons.cjs +5 -16
- package/dist/components/intended-audience-signifier/FlagIcons.js +2 -2
- package/dist/components/intended-audience-signifier/IntendedAudienceSignifier.cjs +5 -6
- package/dist/components/intended-audience-signifier/IntendedAudienceSignifier.js +4 -2
- package/dist/components/intended-audience-signifier/styles.cjs +16 -2
- package/dist/components/intended-audience-signifier/styles.js +15 -3
- package/dist/components/layout/Layout.cjs +49 -84
- package/dist/components/layout/Layout.js +27 -76
- package/dist/components/layout/styles.cjs +5 -3
- package/dist/components/layout/styles.js +5 -4
- package/dist/components/link/Link.cjs +5 -5
- package/dist/components/link/Link.js +1 -1
- package/dist/components/link-button/LinkButton.js +1 -1
- package/dist/components/link-button/styles.js +1 -1
- package/dist/components/menu/Menu.js +1 -1
- package/dist/components/radio-group/RadioGroup.js +1 -1
- package/dist/components/select/Select.js +1 -1
- package/dist/components/text-area/TextArea.js +1 -1
- package/dist/components/text-input/TextInput.js +1 -1
- package/dist/components/topbar/TopBar.js +1 -1
- package/dist/components/topbar/topBarItem/TopBarItem.js +1 -1
- package/dist/components/topbar/topBarNavigation/TopBarNavigation.js +1 -1
- package/dist/components/topbar/topBarToolName/TopBarToolName.js +1 -1
- package/dist/components/typography/Typography.js +1 -1
- package/dist/components/typography/styles.cjs +5 -5
- package/dist/index.cjs +2 -0
- package/dist/index.js +1 -0
- package/dist/layout.cjs +0 -1
- package/dist/layout.js +1 -1
- package/dist/styleD/build/css/component/grid.css +9 -2
- package/dist/styleD/build/css/component/intendedAudienceSignifier.css +6 -4
- package/dist/styleD/build/css/component/layout.css +4 -4
- package/dist/styleD/build/css/semantic/grid.css +15 -0
- package/dist/styleD/build/css/semantic/sizing.css +3 -0
- package/dist/styleD/build/typescript/component/grid.cjs +15 -2
- package/dist/styleD/build/typescript/component/grid.js +15 -2
- package/dist/styleD/build/typescript/component/intendedAudienceSignifier.cjs +8 -5
- package/dist/styleD/build/typescript/component/intendedAudienceSignifier.js +8 -5
- package/dist/styleD/build/typescript/component/layout.cjs +7 -5
- package/dist/styleD/build/typescript/component/layout.js +7 -5
- package/dist/styleD/build/typescript/semantic/grid.cjs +21 -0
- package/dist/styleD/build/typescript/semantic/grid.js +19 -0
- package/dist/styleD/build/typescript/semantic/sizing.cjs +7 -0
- package/dist/styleD/build/typescript/semantic/sizing.js +7 -0
- package/dist/types/components/grid/sandbox.d.ts +2 -2
- package/dist/types/components/intended-audience-signifier/sandbox.d.ts +2 -2
- package/dist/types/components/intended-audience-signifier/styles.d.ts +2 -0
- package/dist/types/components/layout/Layout.d.ts +11 -19
- package/dist/types/components/layout/sandbox.d.ts +1 -1
- package/dist/types/components/layout/styles.d.ts +5 -2
- package/dist/types/components/layout/types.d.ts +13 -3
- package/dist/types/index.d.ts +2 -0
- package/dist/types/layout.d.ts +3 -3
- package/dist/types/styleD/build/typescript/component/grid.d.ts +15 -2
- package/dist/types/styleD/build/typescript/component/intendedAudienceSignifier.d.ts +6 -3
- package/dist/types/styleD/build/typescript/component/layout.d.ts +5 -3
- package/dist/types/styleD/build/typescript/semantic/grid.d.ts +21 -0
- package/dist/types/styleD/build/typescript/semantic/sizing.d.ts +7 -0
- package/package.json +2 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
4
|
-
import { alertBannerContentStyles, alertBannerStyles
|
|
4
|
+
import { defaultAlertBannerTheme, alertBannerContentStyles, alertBannerStyles } from './styles.js';
|
|
5
5
|
import { Icon } from '../icon/Icon.js';
|
|
6
6
|
import { IconButton } from '../icon-button/IconButton.js';
|
|
7
7
|
|
|
@@ -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 { avatarImageStyles, avatarStyles
|
|
4
|
+
import { defaultAvatarTheme, avatarImageStyles, avatarStyles } from './styles.js';
|
|
5
5
|
import { avatarColors } from './types.js';
|
|
6
6
|
|
|
7
7
|
const getColorFromString = (input) => {
|
|
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
|
2
2
|
import { Button as Button$1, composeRenderProps } from 'react-aria-components';
|
|
3
3
|
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
4
4
|
import { Icon } from '../icon/Icon.js';
|
|
5
|
-
import {
|
|
5
|
+
import { defaultButtonTheme, buttonStyles } from './styles.js';
|
|
6
6
|
|
|
7
7
|
function Button({ variant = "primary", size = "md", theme = {}, cssOverrides, icon, ...props }) {
|
|
8
8
|
const mergedTheme = mergeDeep(defaultButtonTheme, theme);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { Checkbox as Checkbox$1 } from 'react-aria-components';
|
|
3
3
|
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
4
|
-
import { checkboxLabelStyles, checkboxStyles
|
|
4
|
+
import { defaultCheckboxTheme, checkboxLabelStyles, checkboxStyles } from './styles.js';
|
|
5
5
|
|
|
6
6
|
function Checkbox({ children, size = "md", isIndeterminate = false, theme = {}, cssOverrides, ...props }) {
|
|
7
7
|
const mergedTheme = mergeDeep(defaultCheckboxTheme, theme);
|
|
@@ -4,7 +4,7 @@ import { CheckboxGroup as CheckboxGroup$1 } from 'react-aria-components';
|
|
|
4
4
|
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
5
5
|
import { FormInputContainer } from '../form/Form.js';
|
|
6
6
|
import { Checkbox } from './Checkbox.js';
|
|
7
|
-
import {
|
|
7
|
+
import { defaultCheckboxTheme, checkboxGroupStyles } from './styles.js';
|
|
8
8
|
|
|
9
9
|
function CheckboxGroup({ size = "md", theme = {}, ...props }) {
|
|
10
10
|
const mergedTheme = mergeDeep(defaultCheckboxTheme, {
|
|
@@ -4,7 +4,7 @@ import { DatePicker as DatePicker$1, Group, I18nProvider, Button, Popover, DateI
|
|
|
4
4
|
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
5
5
|
import { FormInputContainer } from '../form/Form.js';
|
|
6
6
|
import { Icon } from '../icon/Icon.js';
|
|
7
|
-
import { dateSegmentStyles, datePickerStyles, datePickerPopoverStyles,
|
|
7
|
+
import { defaultDatePickerTheme, dateSegmentStyles, datePickerStyles, datePickerPopoverStyles, calendarHeaderStyles, calendarCellStyles, calendarGridStyles } from './styles.js';
|
|
8
8
|
|
|
9
9
|
const MONTHS = [
|
|
10
10
|
"January",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
3
|
-
import { gridStyles, itemStyles
|
|
3
|
+
import { defaultGridTheme, gridStyles, itemStyles } from './styles.js';
|
|
4
4
|
|
|
5
5
|
function Grid({ children, theme = {}, cssOverrides, as: Component = "div", ...props }) {
|
|
6
6
|
const mergedTheme = mergeDeep(defaultGridTheme, theme);
|
|
@@ -8,9 +8,9 @@ const defaultGridTheme = grid.componentGrid;
|
|
|
8
8
|
const isResponsiveGridSize = (size) => typeof size === "object";
|
|
9
9
|
const isResponsiveOffset = (offset) => typeof offset === "object";
|
|
10
10
|
const clampToColumns = (value, columns) => Math.max(0, Math.min(value, columns));
|
|
11
|
-
const numericOffsetMargin = (offset,
|
|
12
|
-
const numericSizeWidth = (size,
|
|
13
|
-
const fixedSizeStyles = (size, theme) => {
|
|
11
|
+
const numericOffsetMargin = (offset, columns, gap) => `calc(((100% - (${columns} - 1) * ${gap}) * ${offset} / ${columns}) + ${offset} * ${gap})`;
|
|
12
|
+
const numericSizeWidth = (size, columns, gap) => `calc(((100% - (${columns} - 1) * ${gap}) * ${size} / ${columns}) + (${size} - 1) * ${gap})`;
|
|
13
|
+
const fixedSizeStyles = (size, theme, breakpoint) => {
|
|
14
14
|
if (size === "grow") {
|
|
15
15
|
return react.css`
|
|
16
16
|
flex-basis: 0;
|
|
@@ -27,59 +27,53 @@ const fixedSizeStyles = (size, theme) => {
|
|
|
27
27
|
max-width: none;
|
|
28
28
|
`;
|
|
29
29
|
}
|
|
30
|
-
const
|
|
31
|
-
|
|
30
|
+
const width = numericSizeWidth(
|
|
31
|
+
clampToColumns(size, theme[breakpoint].columns),
|
|
32
|
+
theme[breakpoint].columns,
|
|
33
|
+
theme[breakpoint].gap
|
|
34
|
+
);
|
|
32
35
|
return react.css`
|
|
33
|
-
flex-basis: ${width};
|
|
34
36
|
flex-grow: 0;
|
|
37
|
+
flex-basis: ${width};
|
|
35
38
|
width: ${width};
|
|
36
39
|
max-width: ${width};
|
|
37
40
|
`;
|
|
38
41
|
};
|
|
39
|
-
const fixedOffsetStyles = (offset, theme) => {
|
|
42
|
+
const fixedOffsetStyles = (offset, theme, breakpoint) => {
|
|
43
|
+
if (typeof offset === "undefined") {
|
|
44
|
+
return react.css``;
|
|
45
|
+
}
|
|
40
46
|
if (offset === "auto") {
|
|
41
47
|
return react.css`
|
|
42
48
|
margin-left: auto;
|
|
43
49
|
`;
|
|
44
50
|
}
|
|
45
|
-
const clampedOffset = clampToColumns(offset, theme.shared.columns);
|
|
46
51
|
return react.css`
|
|
47
|
-
margin-left: ${numericOffsetMargin(
|
|
52
|
+
margin-left: ${numericOffsetMargin(
|
|
53
|
+
clampToColumns(offset, theme[breakpoint].columns),
|
|
54
|
+
theme[breakpoint].columns,
|
|
55
|
+
theme[breakpoint].gap
|
|
56
|
+
)};
|
|
48
57
|
`;
|
|
49
58
|
};
|
|
50
|
-
const offsetStyles = (offset, theme) => {
|
|
51
|
-
if (typeof offset === "undefined") {
|
|
52
|
-
return react.css``;
|
|
53
|
-
}
|
|
59
|
+
const offsetStyles = (offset, theme, breakpoint) => {
|
|
54
60
|
if (!isResponsiveOffset(offset)) {
|
|
55
|
-
return fixedOffsetStyles(offset, theme);
|
|
61
|
+
return fixedOffsetStyles(offset, theme, breakpoint);
|
|
56
62
|
}
|
|
57
|
-
return
|
|
58
|
-
${Object.entries(offset).map(
|
|
59
|
-
([breakpoint, breakpointOffset]) => react.css`
|
|
60
|
-
${mq.from[breakpoint]} {
|
|
61
|
-
${fixedOffsetStyles(breakpointOffset, theme)}
|
|
62
|
-
}
|
|
63
|
-
`
|
|
64
|
-
)}
|
|
65
|
-
`;
|
|
63
|
+
return fixedOffsetStyles(offset[breakpoint], theme, breakpoint);
|
|
66
64
|
};
|
|
67
|
-
const sizeStyles = (size, theme) => {
|
|
65
|
+
const sizeStyles = (size, theme, breakpoint) => {
|
|
68
66
|
if (typeof size === "undefined") {
|
|
69
|
-
|
|
67
|
+
size = theme[breakpoint].columns;
|
|
70
68
|
}
|
|
71
69
|
if (!isResponsiveGridSize(size)) {
|
|
72
|
-
return fixedSizeStyles(size, theme);
|
|
70
|
+
return fixedSizeStyles(size, theme, breakpoint);
|
|
73
71
|
}
|
|
74
|
-
return
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
`
|
|
81
|
-
)}
|
|
82
|
-
`;
|
|
72
|
+
return fixedSizeStyles(
|
|
73
|
+
size[breakpoint] ?? theme[breakpoint].columns,
|
|
74
|
+
theme,
|
|
75
|
+
breakpoint
|
|
76
|
+
);
|
|
83
77
|
};
|
|
84
78
|
const gridStyles = (theme) => {
|
|
85
79
|
return react.css`
|
|
@@ -87,17 +81,43 @@ const gridStyles = (theme) => {
|
|
|
87
81
|
width: ${theme.shared.width};
|
|
88
82
|
flex-direction: ${theme.shared.direction};
|
|
89
83
|
flex-wrap: ${theme.shared.wrap};
|
|
90
|
-
padding: 0 ${theme.shared.gap};
|
|
91
|
-
gap: ${theme.shared.gap};
|
|
92
84
|
justify-content: ${theme.shared.justifyContent};
|
|
93
85
|
align-items: ${theme.shared.alignItems};
|
|
86
|
+
|
|
87
|
+
${mq.from.sm} {
|
|
88
|
+
gap: ${theme.sm.gap};
|
|
89
|
+
padding: 0 ${theme.sm.padding};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
${mq.from.md} {
|
|
93
|
+
gap: ${theme.md.gap};
|
|
94
|
+
padding: 0 ${theme.md.padding};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
${mq.from.lg} {
|
|
98
|
+
gap: ${theme.lg.gap};
|
|
99
|
+
padding: 0 ${theme.lg.padding};
|
|
100
|
+
}
|
|
94
101
|
`;
|
|
95
102
|
};
|
|
96
103
|
const itemStyles = (theme, { size, offset }) => {
|
|
97
104
|
return react.css`
|
|
98
105
|
min-width: 0;
|
|
99
|
-
|
|
100
|
-
${
|
|
106
|
+
|
|
107
|
+
${mq.from.sm} {
|
|
108
|
+
${sizeStyles(size, theme, "sm")}
|
|
109
|
+
${offsetStyles(offset, theme, "sm")}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
${mq.from.md} {
|
|
113
|
+
${sizeStyles(size, theme, "md")}
|
|
114
|
+
${offsetStyles(offset, theme, "md")}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
${mq.from.lg} {
|
|
118
|
+
${sizeStyles(size, theme, "lg")}
|
|
119
|
+
${offsetStyles(offset, theme, "lg")}
|
|
120
|
+
}
|
|
101
121
|
`;
|
|
102
122
|
};
|
|
103
123
|
|
|
@@ -6,9 +6,9 @@ const defaultGridTheme = componentGrid;
|
|
|
6
6
|
const isResponsiveGridSize = (size) => typeof size === "object";
|
|
7
7
|
const isResponsiveOffset = (offset) => typeof offset === "object";
|
|
8
8
|
const clampToColumns = (value, columns) => Math.max(0, Math.min(value, columns));
|
|
9
|
-
const numericOffsetMargin = (offset,
|
|
10
|
-
const numericSizeWidth = (size,
|
|
11
|
-
const fixedSizeStyles = (size, theme) => {
|
|
9
|
+
const numericOffsetMargin = (offset, columns, gap) => `calc(((100% - (${columns} - 1) * ${gap}) * ${offset} / ${columns}) + ${offset} * ${gap})`;
|
|
10
|
+
const numericSizeWidth = (size, columns, gap) => `calc(((100% - (${columns} - 1) * ${gap}) * ${size} / ${columns}) + (${size} - 1) * ${gap})`;
|
|
11
|
+
const fixedSizeStyles = (size, theme, breakpoint) => {
|
|
12
12
|
if (size === "grow") {
|
|
13
13
|
return css`
|
|
14
14
|
flex-basis: 0;
|
|
@@ -25,55 +25,41 @@ const fixedSizeStyles = (size, theme) => {
|
|
|
25
25
|
max-width: none;
|
|
26
26
|
`;
|
|
27
27
|
}
|
|
28
|
-
const
|
|
29
|
-
const width = numericSizeWidth(clampedSize, theme);
|
|
28
|
+
const width = numericSizeWidth(clampToColumns(size, theme[breakpoint].columns), theme[breakpoint].columns, theme[breakpoint].gap);
|
|
30
29
|
return css`
|
|
31
|
-
flex-basis: ${width};
|
|
32
30
|
flex-grow: 0;
|
|
31
|
+
flex-basis: ${width};
|
|
33
32
|
width: ${width};
|
|
34
33
|
max-width: ${width};
|
|
35
34
|
`;
|
|
36
35
|
};
|
|
37
|
-
const fixedOffsetStyles = (offset, theme) => {
|
|
36
|
+
const fixedOffsetStyles = (offset, theme, breakpoint) => {
|
|
37
|
+
if (typeof offset === "undefined") {
|
|
38
|
+
return css``;
|
|
39
|
+
}
|
|
38
40
|
if (offset === "auto") {
|
|
39
41
|
return css`
|
|
40
42
|
margin-left: auto;
|
|
41
43
|
`;
|
|
42
44
|
}
|
|
43
|
-
const clampedOffset = clampToColumns(offset, theme.shared.columns);
|
|
44
45
|
return css`
|
|
45
|
-
margin-left: ${numericOffsetMargin(
|
|
46
|
+
margin-left: ${numericOffsetMargin(clampToColumns(offset, theme[breakpoint].columns), theme[breakpoint].columns, theme[breakpoint].gap)};
|
|
46
47
|
`;
|
|
47
48
|
};
|
|
48
|
-
const offsetStyles = (offset, theme) => {
|
|
49
|
-
if (typeof offset === "undefined") {
|
|
50
|
-
return css``;
|
|
51
|
-
}
|
|
49
|
+
const offsetStyles = (offset, theme, breakpoint) => {
|
|
52
50
|
if (!isResponsiveOffset(offset)) {
|
|
53
|
-
return fixedOffsetStyles(offset, theme);
|
|
51
|
+
return fixedOffsetStyles(offset, theme, breakpoint);
|
|
54
52
|
}
|
|
55
|
-
return
|
|
56
|
-
${Object.entries(offset).map(([breakpoint, breakpointOffset]) => css`
|
|
57
|
-
${from[breakpoint]} {
|
|
58
|
-
${fixedOffsetStyles(breakpointOffset, theme)}
|
|
59
|
-
}
|
|
60
|
-
`)}
|
|
61
|
-
`;
|
|
53
|
+
return fixedOffsetStyles(offset[breakpoint], theme, breakpoint);
|
|
62
54
|
};
|
|
63
|
-
const sizeStyles = (size, theme) => {
|
|
55
|
+
const sizeStyles = (size, theme, breakpoint) => {
|
|
64
56
|
if (typeof size === "undefined") {
|
|
65
|
-
|
|
57
|
+
size = theme[breakpoint].columns;
|
|
66
58
|
}
|
|
67
59
|
if (!isResponsiveGridSize(size)) {
|
|
68
|
-
return fixedSizeStyles(size, theme);
|
|
60
|
+
return fixedSizeStyles(size, theme, breakpoint);
|
|
69
61
|
}
|
|
70
|
-
return
|
|
71
|
-
${Object.entries(size).map(([breakpoint, breakpointSize]) => css`
|
|
72
|
-
${from[breakpoint]} {
|
|
73
|
-
${fixedSizeStyles(breakpointSize, theme)}
|
|
74
|
-
}
|
|
75
|
-
`)}
|
|
76
|
-
`;
|
|
62
|
+
return fixedSizeStyles(size[breakpoint] ?? theme[breakpoint].columns, theme, breakpoint);
|
|
77
63
|
};
|
|
78
64
|
const gridStyles = (theme) => {
|
|
79
65
|
return css`
|
|
@@ -81,17 +67,43 @@ const gridStyles = (theme) => {
|
|
|
81
67
|
width: ${theme.shared.width};
|
|
82
68
|
flex-direction: ${theme.shared.direction};
|
|
83
69
|
flex-wrap: ${theme.shared.wrap};
|
|
84
|
-
padding: 0 ${theme.shared.gap};
|
|
85
|
-
gap: ${theme.shared.gap};
|
|
86
70
|
justify-content: ${theme.shared.justifyContent};
|
|
87
71
|
align-items: ${theme.shared.alignItems};
|
|
72
|
+
|
|
73
|
+
${from.sm} {
|
|
74
|
+
gap: ${theme.sm.gap};
|
|
75
|
+
padding: 0 ${theme.sm.padding};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
${from.md} {
|
|
79
|
+
gap: ${theme.md.gap};
|
|
80
|
+
padding: 0 ${theme.md.padding};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
${from.lg} {
|
|
84
|
+
gap: ${theme.lg.gap};
|
|
85
|
+
padding: 0 ${theme.lg.padding};
|
|
86
|
+
}
|
|
88
87
|
`;
|
|
89
88
|
};
|
|
90
89
|
const itemStyles = (theme, { size, offset }) => {
|
|
91
90
|
return css`
|
|
92
91
|
min-width: 0;
|
|
93
|
-
|
|
94
|
-
${
|
|
92
|
+
|
|
93
|
+
${from.sm} {
|
|
94
|
+
${sizeStyles(size, theme, "sm")}
|
|
95
|
+
${offsetStyles(offset, theme, "sm")}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
${from.md} {
|
|
99
|
+
${sizeStyles(size, theme, "md")}
|
|
100
|
+
${offsetStyles(offset, theme, "md")}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
${from.lg} {
|
|
104
|
+
${sizeStyles(size, theme, "lg")}
|
|
105
|
+
${offsetStyles(offset, theme, "lg")}
|
|
106
|
+
}
|
|
95
107
|
`;
|
|
96
108
|
};
|
|
97
109
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
3
|
-
import {
|
|
3
|
+
import { defaultIconTheme, iconStyles } from './styles.js';
|
|
4
4
|
|
|
5
5
|
function Icon({ children, size = "md", fill, alt, symbol, theme = {}, cssOverrides, className }) {
|
|
6
6
|
const mergedTheme = mergeDeep(defaultIconTheme, theme);
|
|
@@ -3,7 +3,7 @@ import { useRef, useEffect } from 'react';
|
|
|
3
3
|
import { Button, composeRenderProps } from 'react-aria-components';
|
|
4
4
|
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
5
5
|
import { Icon } from '../icon/Icon.js';
|
|
6
|
-
import {
|
|
6
|
+
import { defaultIconButtonTheme, iconButtonStyles } from './styles.js';
|
|
7
7
|
|
|
8
8
|
function IconButton({ variant = "primary", size = "md", symbol, ariaLabel, theme = {}, cssOverrides, ...props }) {
|
|
9
9
|
const mergedTheme = mergeDeep(defaultIconButtonTheme, theme);
|
|
@@ -3,7 +3,7 @@ import { useRef, useEffect } from 'react';
|
|
|
3
3
|
import { Link, composeRenderProps } from 'react-aria-components';
|
|
4
4
|
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
5
5
|
import { Icon } from '../icon/Icon.js';
|
|
6
|
-
import {
|
|
6
|
+
import { defaultIconLinkButtonTheme, iconLinkButtonStyles } from './styles.js';
|
|
7
7
|
|
|
8
8
|
function IconLinkButton({ variant = "primary", size = "md", symbol, ariaLabel, theme = {}, cssOverrides, ...props }) {
|
|
9
9
|
const mergedTheme = mergeDeep(defaultIconLinkButtonTheme, theme);
|
|
@@ -3,7 +3,7 @@ import { useMemo } from 'react';
|
|
|
3
3
|
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
4
4
|
import { Icon } from '../icon/Icon.js';
|
|
5
5
|
import { Typography } from '../typography/Typography.js';
|
|
6
|
-
import { inlineMessageIconStyles, inlineMessageStyles
|
|
6
|
+
import { defaultInlineMessageTheme, inlineMessageIconStyles, inlineMessageStyles } from './styles.js';
|
|
7
7
|
|
|
8
8
|
function InlineMessage({ children, level, hideIcon = false, icon, theme = {}, cssOverrides, className, ...props }) {
|
|
9
9
|
const mergedTheme = mergeDeep(defaultInlineMessageTheme, theme);
|
|
@@ -95,28 +95,17 @@ const auFlag = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
|
95
95
|
]
|
|
96
96
|
}
|
|
97
97
|
);
|
|
98
|
-
const globeIcon = /* @__PURE__ */ jsxRuntime.jsx(
|
|
99
|
-
"svg",
|
|
100
|
-
{
|
|
101
|
-
style: { marginTop: "2px" },
|
|
102
|
-
width: "16px",
|
|
103
|
-
height: "16px",
|
|
104
|
-
fill: "#000000",
|
|
105
|
-
viewBox: "0 0 16 16",
|
|
106
|
-
children: /* @__PURE__ */ jsxRuntime.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" })
|
|
107
|
-
}
|
|
108
|
-
);
|
|
98
|
+
const globeIcon = /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "12px", height: "12px", fill: "#000000", viewBox: "0 0 16 16", children: /* @__PURE__ */ jsxRuntime.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" }) });
|
|
109
99
|
const DoubleChevronRightSvg = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
110
100
|
"svg",
|
|
111
101
|
{
|
|
112
|
-
width: "
|
|
113
|
-
height: "
|
|
102
|
+
width: "12",
|
|
103
|
+
height: "12",
|
|
114
104
|
viewBox: "0 0 9 7",
|
|
115
|
-
fill: "none",
|
|
116
105
|
xmlns: "http://www.w3.org/2000/svg",
|
|
117
106
|
children: [
|
|
118
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5.75 0H3.5L6 3.5L3.5 7H5.75L8.25 3.5L5.75 0Z"
|
|
119
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2.25 0H0L2.5 3.5L0 7H2.25L4.75 3.5L2.25 0Z"
|
|
107
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5.75 0H3.5L6 3.5L3.5 7H5.75L8.25 3.5L5.75 0Z" }),
|
|
108
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2.25 0H0L2.5 3.5L0 7H2.25L4.75 3.5L2.25 0Z" })
|
|
120
109
|
]
|
|
121
110
|
}
|
|
122
111
|
);
|
|
@@ -3,7 +3,7 @@ import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
|
3
3
|
const ukFlag = jsxs("svg", { height: "12px", xmlns: "http://www.w3.org/2000/svg", id: "flag-icons-gb", viewBox: "0 0 640 480", children: [jsx("path", { fill: "#012169", d: "M0 0h640v480H0z" }), jsx("path", { fill: "#FFF", d: "m75 0 244 181L562 0h78v62L400 241l240 178v61h-80L320 301 81 480H0v-60l239-178L0 64V0z" }), jsx("path", { fill: "#C8102E", d: "m424 281 216 159v40L369 281zm-184 20 6 35L54 480H0zM640 0v3L391 191l2-44L590 0zM0 0l239 176h-60L0 42z" }), jsx("path", { fill: "#FFF", d: "M241 0v480h160V0zM0 160v160h640V160z" }), jsx("path", { fill: "#C8102E", d: "M0 193v96h640v-96zM273 0v480h96V0z" })] });
|
|
4
4
|
const usFlag = jsxs("svg", { height: "12px", xmlns: "http://www.w3.org/2000/svg", id: "flag-icons-us", viewBox: "0 0 640 480", children: [jsx("path", { fill: "#bd3d44", d: "M0 0h640v480H0" }), jsx("path", { stroke: "#fff", strokeWidth: "37", d: "M0 55.3h640M0 129h640M0 203h640M0 277h640M0 351h640M0 425h640" }), jsx("path", { fill: "#192f5d", d: "M0 0h364.8v258.5H0" }), jsx("marker", { id: "us-a", markerHeight: "30", markerWidth: "30", children: jsx("path", { fill: "#fff", d: "m14 0 9 27L0 10h28L5 27z" }) }), jsx("path", { fill: "none", markerMid: "url(#us-a)", d: "m0 0 16 11h61 61 61 61 60L47 37h61 61 60 61L16 63h61 61 61 61 60L47 89h61 61 60 61L16 115h61 61 61 61 60L47 141h61 61 60 61L16 166h61 61 61 61 60L47 192h61 61 60 61L16 218h61 61 61 61 60z" })] });
|
|
5
5
|
const auFlag = jsxs("svg", { height: "12px", xmlns: "http://www.w3.org/2000/svg", id: "flag-icons-au", viewBox: "0 0 640 480", children: [jsx("path", { fill: "#00008B", d: "M0 0h640v480H0z" }), jsx("path", { fill: "#fff", d: "m37.5 0 122 90.5L281 0h39v31l-120 89.5 120 89V240h-40l-120-89.5L40.5 240H0v-30l119.5-89L0 32V0z" }), jsx("path", { fill: "red", d: "M212 140.5 320 220v20l-135.5-99.5zm-92 10 3 17.5-96 72H0zM320 0v1.5l-124.5 94 1-22L295 0zM0 0l119.5 88h-30L0 21z" }), jsx("path", { fill: "#fff", d: "M120.5 0v240h80V0zM0 80v80h320V80z" }), jsx("path", { fill: "red", d: "M0 96.5v48h320v-48zM136.5 0v240h48V0z" }), jsx("path", { fill: "#fff", d: "m527 396.7-20.5 2.6 2.2 20.5-14.8-14.4-14.7 14.5 2-20.5-20.5-2.4 17.3-11.2-10.9-17.5 19.6 6.5 6.9-19.5 7.1 19.4 19.5-6.7-10.7 17.6zm-3.7-117.2 2.7-13-9.8-9 13.2-1.5 5.5-12.1 5.5 12.1 13.2 1.5-9.8 9 2.7 13-11.6-6.6zm-104.1-60-20.3 2.2 1.8 20.3-14.4-14.5-14.8 14.1 2.4-20.3-20.2-2.7 17.3-10.8-10.5-17.5 19.3 6.8L387 178l6.7 19.3 19.4-6.3-10.9 17.3 17.1 11.2ZM623 186.7l-20.9 2.7 2.3 20.9-15.1-14.7-15 14.8 2.1-21-20.9-2.4 17.7-11.5-11.1-17.9 20 6.7 7-19.8 7.2 19.8 19.9-6.9-11 18zm-96.1-83.5-20.7 2.3 1.9 20.8-14.7-14.8-15.1 14.4 2.4-20.7-20.7-2.8 17.7-11L467 73.5l19.7 6.9 7.3-19.5 6.8 19.7 19.8-6.5-11.1 17.6zM234 385.7l-45.8 5.4 4.6 45.9-32.8-32.4-33 32.2 4.9-45.9-45.8-5.8 38.9-24.8-24-39.4 43.6 15 15.8-43.4 15.5 43.5 43.7-14.7-24.3 39.2 38.8 25.1Z" })] });
|
|
6
|
-
const globeIcon = jsx("svg", {
|
|
7
|
-
const DoubleChevronRightSvg = jsxs("svg", { width: "
|
|
6
|
+
const globeIcon = jsx("svg", { width: "12px", height: "12px", fill: "#000000", viewBox: "0 0 16 16", children: 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" }) });
|
|
7
|
+
const DoubleChevronRightSvg = jsxs("svg", { width: "12", height: "12", viewBox: "0 0 9 7", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { d: "M5.75 0H3.5L6 3.5L3.5 7H5.75L8.25 3.5L5.75 0Z" }), jsx("path", { d: "M2.25 0H0L2.5 3.5L0 7H2.25L4.75 3.5L2.25 0Z" })] });
|
|
8
8
|
|
|
9
9
|
export { DoubleChevronRightSvg, auFlag, globeIcon, ukFlag, usFlag };
|
|
@@ -46,6 +46,8 @@ function IntendedAudienceSignifier({
|
|
|
46
46
|
}
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
|
+
const iconStyles = styles.intendedAudienceSignifierIconStyles(mergedTheme);
|
|
50
|
+
const chevronIconStyles = styles.intendedAudienceSignifierChevronIconStyles(mergedTheme);
|
|
49
51
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
50
52
|
"div",
|
|
51
53
|
{
|
|
@@ -53,12 +55,9 @@ function IntendedAudienceSignifier({
|
|
|
53
55
|
className,
|
|
54
56
|
css: [styles.intendedAudienceSignifierStyles(mergedTheme), cssOverrides],
|
|
55
57
|
children: [
|
|
56
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { children: getSourceIconElement(source, intendedAudience) }),
|
|
57
|
-
/* @__PURE__ */ jsxRuntime.
|
|
58
|
-
|
|
59
|
-
FlagIcons.DoubleChevronRightSvg
|
|
60
|
-
] }),
|
|
61
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { children: getIntendedAudienceIconElement(source, intendedAudience) })
|
|
58
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { css: iconStyles, children: getSourceIconElement(source, intendedAudience) }),
|
|
59
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { css: chevronIconStyles, children: FlagIcons.DoubleChevronRightSvg }),
|
|
60
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { css: iconStyles, children: getIntendedAudienceIconElement(source, intendedAudience) })
|
|
62
61
|
]
|
|
63
62
|
}
|
|
64
63
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
2
2
|
import { mergeDeep } from '../../util/mergeDeep.js';
|
|
3
3
|
import { DoubleChevronRightSvg, globeIcon, auFlag, usFlag, ukFlag } from './FlagIcons.js';
|
|
4
|
-
import { intendedAudienceSignifierStyles,
|
|
4
|
+
import { defaultIntendedAudienceSignifierTheme, intendedAudienceSignifierStyles, intendedAudienceSignifierIconStyles, intendedAudienceSignifierChevronIconStyles } from './styles.js';
|
|
5
5
|
|
|
6
6
|
const sourceIcons = {
|
|
7
7
|
UK: ukFlag,
|
|
@@ -29,7 +29,9 @@ function IntendedAudienceSignifier({ source, intendedAudience, theme = {}, cssOv
|
|
|
29
29
|
if (intendedAudience === "Don't know") {
|
|
30
30
|
return jsx("div", { ...props, className, css: [intendedAudienceSignifierStyles(mergedTheme), cssOverrides], children: jsx("span", { children: "Don\u2018t know" }) });
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
const iconStyles = intendedAudienceSignifierIconStyles(mergedTheme);
|
|
33
|
+
const chevronIconStyles = intendedAudienceSignifierChevronIconStyles(mergedTheme);
|
|
34
|
+
return jsxs("div", { ...props, className, css: [intendedAudienceSignifierStyles(mergedTheme), cssOverrides], children: [jsx("div", { css: iconStyles, children: getSourceIconElement(source, intendedAudience) }), jsx("div", { css: chevronIconStyles, children: DoubleChevronRightSvg }), jsx("div", { css: iconStyles, children: getIntendedAudienceIconElement(source, intendedAudience) })] });
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
export { IntendedAudienceSignifier };
|
|
@@ -10,8 +10,7 @@ const intendedAudienceSignifierStyles = (theme) => react.css`
|
|
|
10
10
|
justify-content: ${theme.justifyContent};
|
|
11
11
|
align-items: ${theme.alignItems};
|
|
12
12
|
color: ${theme.color};
|
|
13
|
-
font
|
|
14
|
-
font-size: ${theme.typography.fontSize};
|
|
13
|
+
font: ${theme.typography.font};
|
|
15
14
|
line-height: ${theme.typography.lineHeight};
|
|
16
15
|
border-width: ${theme.borderWidth};
|
|
17
16
|
border-style: ${theme.borderStyle};
|
|
@@ -21,11 +20,26 @@ const intendedAudienceSignifierStyles = (theme) => react.css`
|
|
|
21
20
|
box-sizing: ${theme.boxSizing};
|
|
22
21
|
width: ${theme.width};
|
|
23
22
|
gap: ${theme.gap};
|
|
23
|
+
`;
|
|
24
|
+
const intendedAudienceSignifierIconStyles = (theme) => react.css`
|
|
25
|
+
display: flex;
|
|
24
26
|
svg {
|
|
25
27
|
height: ${theme.svg.height};
|
|
26
28
|
width: ${theme.svg.width};
|
|
27
29
|
}
|
|
28
30
|
`;
|
|
31
|
+
const intendedAudienceSignifierChevronIconStyles = (theme) => react.css`
|
|
32
|
+
display: flex;
|
|
33
|
+
svg {
|
|
34
|
+
height: ${theme.chevron.size};
|
|
35
|
+
width: ${theme.chevron.size};
|
|
36
|
+
}
|
|
37
|
+
svg path {
|
|
38
|
+
fill: ${theme.chevron.fill};
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
29
41
|
|
|
30
42
|
exports.defaultIntendedAudienceSignifierTheme = defaultIntendedAudienceSignifierTheme;
|
|
43
|
+
exports.intendedAudienceSignifierChevronIconStyles = intendedAudienceSignifierChevronIconStyles;
|
|
44
|
+
exports.intendedAudienceSignifierIconStyles = intendedAudienceSignifierIconStyles;
|
|
31
45
|
exports.intendedAudienceSignifierStyles = intendedAudienceSignifierStyles;
|
|
@@ -8,8 +8,7 @@ const intendedAudienceSignifierStyles = (theme) => css`
|
|
|
8
8
|
justify-content: ${theme.justifyContent};
|
|
9
9
|
align-items: ${theme.alignItems};
|
|
10
10
|
color: ${theme.color};
|
|
11
|
-
font
|
|
12
|
-
font-size: ${theme.typography.fontSize};
|
|
11
|
+
font: ${theme.typography.font};
|
|
13
12
|
line-height: ${theme.typography.lineHeight};
|
|
14
13
|
border-width: ${theme.borderWidth};
|
|
15
14
|
border-style: ${theme.borderStyle};
|
|
@@ -19,10 +18,23 @@ const intendedAudienceSignifierStyles = (theme) => css`
|
|
|
19
18
|
box-sizing: ${theme.boxSizing};
|
|
20
19
|
width: ${theme.width};
|
|
21
20
|
gap: ${theme.gap};
|
|
21
|
+
`;
|
|
22
|
+
const intendedAudienceSignifierIconStyles = (theme) => css`
|
|
23
|
+
display: flex;
|
|
22
24
|
svg {
|
|
23
25
|
height: ${theme.svg.height};
|
|
24
26
|
width: ${theme.svg.width};
|
|
25
27
|
}
|
|
26
28
|
`;
|
|
29
|
+
const intendedAudienceSignifierChevronIconStyles = (theme) => css`
|
|
30
|
+
display: flex;
|
|
31
|
+
svg {
|
|
32
|
+
height: ${theme.chevron.size};
|
|
33
|
+
width: ${theme.chevron.size};
|
|
34
|
+
}
|
|
35
|
+
svg path {
|
|
36
|
+
fill: ${theme.chevron.fill};
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
27
39
|
|
|
28
|
-
export { defaultIntendedAudienceSignifierTheme, intendedAudienceSignifierStyles };
|
|
40
|
+
export { defaultIntendedAudienceSignifierTheme, intendedAudienceSignifierChevronIconStyles, intendedAudienceSignifierIconStyles, intendedAudienceSignifierStyles };
|