@guardian/stand 0.0.30 → 0.0.32
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/date-picker/DatePicker.cjs +166 -0
- package/dist/components/date-picker/DatePicker.js +126 -0
- package/dist/components/date-picker/styles.cjs +199 -0
- package/dist/components/date-picker/styles.js +187 -0
- package/dist/components/form/types.cjs +2 -1
- package/dist/components/form/types.js +3 -2
- package/dist/components/select/Select.cjs +1 -1
- package/dist/components/select/Select.js +7 -1
- package/dist/components/topbar/TopBar.cjs +8 -1
- package/dist/components/topbar/TopBar.js +1 -1
- package/dist/components/topbar/styles.cjs +4 -1
- package/dist/components/topbar/styles.js +4 -1
- package/dist/date-picker.cjs +9 -0
- package/dist/date-picker.js +2 -0
- package/dist/index.cjs +2 -0
- package/dist/index.js +1 -0
- package/dist/styleD/build/css/component/TopBar.css +5 -1
- package/dist/styleD/build/css/component/datePicker.css +120 -0
- package/dist/styleD/build/css/component/templateComponent.css +8 -0
- package/dist/styleD/build/typescript/component/TopBar.cjs +5 -1
- package/dist/styleD/build/typescript/component/TopBar.js +5 -1
- package/dist/styleD/build/typescript/component/datePicker.cjs +185 -0
- package/dist/styleD/build/typescript/component/datePicker.js +183 -0
- package/dist/types/components/date-picker/DatePicker.d.ts +2 -0
- package/dist/types/components/date-picker/sandbox.d.ts +2 -0
- package/dist/types/components/date-picker/styles.d.ts +11 -0
- package/dist/types/components/date-picker/types.d.ts +21 -0
- package/dist/types/components/form/types.d.ts +1 -1
- package/dist/types/date-picker.d.ts +21 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/styleD/build/typescript/component/TopBar.d.ts +5 -1
- package/dist/types/styleD/build/typescript/component/datePicker.d.ts +185 -0
- package/dist/types/styleD/build/typescript/component/templateComponent.d.ts +10 -0
- package/dist/types/templates/component/TemplateComponent.d.ts +2 -0
- package/dist/types/templates/component/sandbox.d.ts +5 -0
- package/dist/types/templates/component/styles.d.ts +7 -0
- package/dist/types/templates/component/types.d.ts +5 -0
- package/package.json +17 -2
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
const componentDatePicker = {
|
|
2
|
+
picker: {
|
|
3
|
+
shared: {
|
|
4
|
+
display: "flex",
|
|
5
|
+
width: "100%",
|
|
6
|
+
justifyContent: "space-between",
|
|
7
|
+
alignItems: "center",
|
|
8
|
+
height: "2.5rem",
|
|
9
|
+
borderRadius: "0.25rem",
|
|
10
|
+
border: "0.0625rem solid #545454",
|
|
11
|
+
backgroundColor: "#ffffff",
|
|
12
|
+
gap: "0.5rem",
|
|
13
|
+
padding: {
|
|
14
|
+
top: "0",
|
|
15
|
+
right: "0.25rem",
|
|
16
|
+
bottom: "0",
|
|
17
|
+
left: "0.75rem"
|
|
18
|
+
},
|
|
19
|
+
disabled: {
|
|
20
|
+
cursor: "not-allowed",
|
|
21
|
+
backgroundColor: "#ededed",
|
|
22
|
+
color: "#999999"
|
|
23
|
+
},
|
|
24
|
+
focusVisible: {
|
|
25
|
+
outline: "0.125rem solid #0072a9"
|
|
26
|
+
},
|
|
27
|
+
invalid: {
|
|
28
|
+
border: "0.0625rem solid #b42a19"
|
|
29
|
+
},
|
|
30
|
+
button: {
|
|
31
|
+
flex: "1",
|
|
32
|
+
backgroundColor: "#00000000",
|
|
33
|
+
border: "0 solid transparent",
|
|
34
|
+
padding: {
|
|
35
|
+
top: "0",
|
|
36
|
+
right: "0",
|
|
37
|
+
bottom: "0",
|
|
38
|
+
left: "0"
|
|
39
|
+
},
|
|
40
|
+
margin: {
|
|
41
|
+
top: "0",
|
|
42
|
+
right: "0",
|
|
43
|
+
bottom: "0",
|
|
44
|
+
left: "0"
|
|
45
|
+
},
|
|
46
|
+
display: "flex",
|
|
47
|
+
alignItems: "center",
|
|
48
|
+
justifyContent: "flex-end",
|
|
49
|
+
color: "#545454",
|
|
50
|
+
cursor: "pointer",
|
|
51
|
+
disabled: {
|
|
52
|
+
color: "#999999",
|
|
53
|
+
cursor: "not-allowed"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
segment: {
|
|
59
|
+
shared: {
|
|
60
|
+
placeholder: {
|
|
61
|
+
color: "#545454",
|
|
62
|
+
focusVisible: {
|
|
63
|
+
outline: "0.125rem solid #0072a9"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
popover: {
|
|
69
|
+
shared: {
|
|
70
|
+
offset: 8,
|
|
71
|
+
containerPadding: 0,
|
|
72
|
+
backgroundColor: "#ffffff",
|
|
73
|
+
padding: {
|
|
74
|
+
top: "0.25rem",
|
|
75
|
+
right: "0.25rem",
|
|
76
|
+
bottom: "0.25rem",
|
|
77
|
+
left: "0.25rem"
|
|
78
|
+
},
|
|
79
|
+
boxShadow: "0 2px 6px 0 rgba(0, 0, 0, 0.3)"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
calendar: {
|
|
83
|
+
header: {
|
|
84
|
+
shared: {
|
|
85
|
+
display: "flex",
|
|
86
|
+
alignItems: "center",
|
|
87
|
+
justifyContent: "space-between",
|
|
88
|
+
typography: {
|
|
89
|
+
font: "normal 700 0.875rem/1.15 Open Sans",
|
|
90
|
+
letterSpacing: "-0.0125rem",
|
|
91
|
+
fontWidth: 95
|
|
92
|
+
},
|
|
93
|
+
button: {
|
|
94
|
+
backgroundColor: "#00000000",
|
|
95
|
+
border: "none",
|
|
96
|
+
padding: {
|
|
97
|
+
top: "0",
|
|
98
|
+
right: "0",
|
|
99
|
+
bottom: "0",
|
|
100
|
+
left: "0"
|
|
101
|
+
},
|
|
102
|
+
margin: {
|
|
103
|
+
top: "0",
|
|
104
|
+
right: "0",
|
|
105
|
+
bottom: "0",
|
|
106
|
+
left: "0"
|
|
107
|
+
},
|
|
108
|
+
display: "flex",
|
|
109
|
+
alignItems: "center",
|
|
110
|
+
justifyContent: "center",
|
|
111
|
+
color: "#545454",
|
|
112
|
+
cursor: "pointer",
|
|
113
|
+
width: "2.5rem",
|
|
114
|
+
height: "2.5rem",
|
|
115
|
+
aspectRatio: "1",
|
|
116
|
+
hovered: {
|
|
117
|
+
backgroundColor: "#f6f6f6"
|
|
118
|
+
},
|
|
119
|
+
pressed: {
|
|
120
|
+
backgroundColor: "#ededed"
|
|
121
|
+
},
|
|
122
|
+
selected: {
|
|
123
|
+
backgroundColor: "#b8d8e7"
|
|
124
|
+
},
|
|
125
|
+
focusVisible: {
|
|
126
|
+
outline: "0.125rem solid #0072a9"
|
|
127
|
+
},
|
|
128
|
+
disabled: {
|
|
129
|
+
cursor: "not-allowed",
|
|
130
|
+
color: "#999999"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
grid: {
|
|
136
|
+
shared: {
|
|
137
|
+
typography: {
|
|
138
|
+
font: "normal 460 0.875rem/1.3 Open Sans",
|
|
139
|
+
letterSpacing: "0rem",
|
|
140
|
+
fontWidth: 95
|
|
141
|
+
},
|
|
142
|
+
borderCollapse: "collapse",
|
|
143
|
+
borderSpacing: "0",
|
|
144
|
+
th: {
|
|
145
|
+
width: "2.5rem",
|
|
146
|
+
height: "2.5rem",
|
|
147
|
+
verticalAlign: "middle"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
cell: {
|
|
152
|
+
shared: {
|
|
153
|
+
width: "2.5rem",
|
|
154
|
+
aspectRatio: "1",
|
|
155
|
+
display: "flex",
|
|
156
|
+
alignItems: "center",
|
|
157
|
+
justifyContent: "center",
|
|
158
|
+
cursor: "pointer",
|
|
159
|
+
outsideMonth: {
|
|
160
|
+
display: "none"
|
|
161
|
+
},
|
|
162
|
+
hovered: {
|
|
163
|
+
backgroundColor: "#f6f6f6"
|
|
164
|
+
},
|
|
165
|
+
pressed: {
|
|
166
|
+
backgroundColor: "#ededed"
|
|
167
|
+
},
|
|
168
|
+
selected: {
|
|
169
|
+
backgroundColor: "#b8d8e7"
|
|
170
|
+
},
|
|
171
|
+
focusVisible: {
|
|
172
|
+
outline: "0.125rem solid #0072a9"
|
|
173
|
+
},
|
|
174
|
+
disabled: {
|
|
175
|
+
cursor: "not-allowed",
|
|
176
|
+
color: "#999999"
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export { componentDatePicker };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const componentName = "DatePicker";
|
|
2
|
+
export declare const componentTsx = "import { CalendarDate } from '@internationalized/date';\nimport { DatePicker } from '@guardian/stand/date-picker';\n\nexport const Component = () => (\n\t<>\n\t\t{/* Basic usage */}\n\t\t<DatePicker\n\t\t\tlabel=\"Date of birth\"\n\t\t\tdescription=\"Enter your date of birth (e.g. 15 April 1990)\"\n\t\t/>\n\n\t\t{/* With min/max constraints and a pre-selected date */}\n\t\t<DatePicker\n\t\t\tlabel=\"Select a date\"\n\t\t\tdescription=\"Choose a date within 2026\"\n\t\t\tvalue={new CalendarDate(2026, 4, 15)}\n\t\t\tminValue={new CalendarDate(2026, 1, 1)}\n\t\t\tmaxValue={new CalendarDate(2026, 12, 31)}\n\t\t/>\n\t</>\n);\n";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SerializedStyles } from '@emotion/react';
|
|
2
|
+
import type { ComponentDatePicker } from '../../styleD/build/typescript/component/datePicker';
|
|
3
|
+
import type { Prettify } from '../../util/types';
|
|
4
|
+
export type DatePickerTheme = Prettify<ComponentDatePicker>;
|
|
5
|
+
export declare const defaultDatePickerTheme: DatePickerTheme;
|
|
6
|
+
export declare const datePickerStyles: (theme: DatePickerTheme) => SerializedStyles;
|
|
7
|
+
export declare const dateSegmentStyles: (theme: DatePickerTheme) => SerializedStyles;
|
|
8
|
+
export declare const datePickerPopoverStyles: (theme: DatePickerTheme) => SerializedStyles;
|
|
9
|
+
export declare const calendarHeaderStyles: (theme: DatePickerTheme) => SerializedStyles;
|
|
10
|
+
export declare const calendarGridStyles: (theme: DatePickerTheme) => SerializedStyles;
|
|
11
|
+
export declare const calendarCellStyles: (theme: DatePickerTheme) => SerializedStyles;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DateValue, CalendarProps as RACCalendarProps, DatePickerProps as RACDatePickerProps } from 'react-aria-components';
|
|
2
|
+
import type { DefaultProps } from '../../util/types';
|
|
3
|
+
import type { FormInputContainerDefaultProps } from '../form/types';
|
|
4
|
+
import type { DatePickerTheme } from './styles';
|
|
5
|
+
export interface DatePickerProps extends FormInputContainerDefaultProps<Omit<RACDatePickerProps<DateValue>, 'granularity' | 'hideTimeZone'>, DatePickerTheme> {
|
|
6
|
+
/**
|
|
7
|
+
* When true (default), the month segment displays full month names (e.g. "April") and
|
|
8
|
+
* supports typing the first letters of a month name to select it.
|
|
9
|
+
* Set to false to revert to React Aria's default numeric month behaviour.
|
|
10
|
+
*/
|
|
11
|
+
useMonthTextInput?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Locale to use for formatting the date. By default, it uses en-GB,
|
|
14
|
+
* you shouldn't need to set this prop in most scenarios,
|
|
15
|
+
* if you need low level control use this along with useMonthTextInput prop
|
|
16
|
+
*
|
|
17
|
+
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale for more details on supported locales and formatting options.
|
|
18
|
+
*/
|
|
19
|
+
locale?: string;
|
|
20
|
+
}
|
|
21
|
+
export type CalendarProps = DefaultProps<DatePickerTheme, RACCalendarProps<DateValue>['className']> & Omit<RACCalendarProps<DateValue>, 'className'>;
|
|
@@ -36,5 +36,5 @@ export type FormInputContainerDefaultProps<ReactAriaInput extends {
|
|
|
36
36
|
* The React Aria form container components FormInputContainer supports.
|
|
37
37
|
* Add new components here
|
|
38
38
|
*/
|
|
39
|
-
export declare const ALLOWED_FORM_CONTAINERS: readonly [(props: import("react-aria-components").TextFieldProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null, <T extends object = {}, M extends "single" | "multiple" = "single">(props: import("react-aria-components").SelectProps<T, M> & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null, (props: import("react-aria-components").RadioGroupProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null, (props: import("react-aria-components").CheckboxGroupProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null];
|
|
39
|
+
export declare const ALLOWED_FORM_CONTAINERS: readonly [(props: import("react-aria-components").TextFieldProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null, <T extends object = {}, M extends "single" | "multiple" = "single">(props: import("react-aria-components").SelectProps<T, M> & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null, (props: import("react-aria-components").RadioGroupProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null, (props: import("react-aria-components").CheckboxGroupProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null, <T_1 extends import("react-aria-components").DateValue>(props: import("react-aria-components").DatePickerProps<T_1> & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null];
|
|
40
40
|
export type AllowedContainer = (typeof ALLOWED_FORM_CONTAINERS)[number];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DatePicker component entry point
|
|
3
|
+
*
|
|
4
|
+
* Peer dependencies required to use these components:
|
|
5
|
+
* - `@emotion/react`
|
|
6
|
+
* - `react`
|
|
7
|
+
* - `react-dom`
|
|
8
|
+
* - `typescript`
|
|
9
|
+
* - `@internationalized/date`
|
|
10
|
+
* - `react-aria-components`
|
|
11
|
+
*
|
|
12
|
+
* See the `peerDependencies` section of package.json for compatible versions.
|
|
13
|
+
*
|
|
14
|
+
* If you only need the built CSS (./component/datePicker.css),
|
|
15
|
+
* you don't need to install these.
|
|
16
|
+
*/
|
|
17
|
+
export { DatePicker } from './components/date-picker/DatePicker';
|
|
18
|
+
export type { DatePickerProps } from './components/date-picker/types';
|
|
19
|
+
export type { DatePickerTheme } from './components/date-picker/styles';
|
|
20
|
+
export { componentDatePicker } from './styleD/build/typescript/component/datePicker';
|
|
21
|
+
export type { ComponentDatePicker } from './styleD/build/typescript/component/datePicker';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export { componentCheckbox } from './styleD/build/typescript/component/checkbox'
|
|
|
26
26
|
export type { ComponentCheckbox } from './styleD/build/typescript/component/checkbox';
|
|
27
27
|
export { componentFavicon } from './styleD/build/typescript/component/favicon';
|
|
28
28
|
export type { ComponentFavicon } from './styleD/build/typescript/component/favicon';
|
|
29
|
+
export { componentDatePicker } from './styleD/build/typescript/component/datePicker';
|
|
30
|
+
export type { ComponentDatePicker } from './styleD/build/typescript/component/datePicker';
|
|
29
31
|
export { componentForm } from './styleD/build/typescript/component/form';
|
|
30
32
|
export type { ComponentForm } from './styleD/build/typescript/component/form';
|
|
31
33
|
export { componentIcon } from './styleD/build/typescript/component/icon';
|
|
@@ -6,12 +6,16 @@ export declare const componentTopBar: {
|
|
|
6
6
|
display: string;
|
|
7
7
|
height: string;
|
|
8
8
|
'justify-content': string;
|
|
9
|
-
border: string;
|
|
9
|
+
'border-right': string;
|
|
10
|
+
'border-top': string;
|
|
11
|
+
'border-bottom': string;
|
|
12
|
+
'border-left': string;
|
|
10
13
|
spacer: {
|
|
11
14
|
'margin-left': string;
|
|
12
15
|
};
|
|
13
16
|
collapsedNavMenu: {
|
|
14
17
|
button: {
|
|
18
|
+
color: string;
|
|
15
19
|
margin: string;
|
|
16
20
|
padding: string;
|
|
17
21
|
background: string;
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
export declare const componentDatePicker: {
|
|
5
|
+
picker: {
|
|
6
|
+
shared: {
|
|
7
|
+
display: string;
|
|
8
|
+
width: string;
|
|
9
|
+
justifyContent: string;
|
|
10
|
+
alignItems: string;
|
|
11
|
+
height: string;
|
|
12
|
+
borderRadius: string;
|
|
13
|
+
border: string;
|
|
14
|
+
backgroundColor: string;
|
|
15
|
+
gap: string;
|
|
16
|
+
padding: {
|
|
17
|
+
top: string;
|
|
18
|
+
right: string;
|
|
19
|
+
bottom: string;
|
|
20
|
+
left: string;
|
|
21
|
+
};
|
|
22
|
+
disabled: {
|
|
23
|
+
cursor: string;
|
|
24
|
+
backgroundColor: string;
|
|
25
|
+
color: string;
|
|
26
|
+
};
|
|
27
|
+
focusVisible: {
|
|
28
|
+
outline: string;
|
|
29
|
+
};
|
|
30
|
+
invalid: {
|
|
31
|
+
border: string;
|
|
32
|
+
};
|
|
33
|
+
button: {
|
|
34
|
+
flex: string;
|
|
35
|
+
backgroundColor: string;
|
|
36
|
+
border: string;
|
|
37
|
+
padding: {
|
|
38
|
+
top: string;
|
|
39
|
+
right: string;
|
|
40
|
+
bottom: string;
|
|
41
|
+
left: string;
|
|
42
|
+
};
|
|
43
|
+
margin: {
|
|
44
|
+
top: string;
|
|
45
|
+
right: string;
|
|
46
|
+
bottom: string;
|
|
47
|
+
left: string;
|
|
48
|
+
};
|
|
49
|
+
display: string;
|
|
50
|
+
alignItems: string;
|
|
51
|
+
justifyContent: string;
|
|
52
|
+
color: string;
|
|
53
|
+
cursor: string;
|
|
54
|
+
disabled: {
|
|
55
|
+
color: string;
|
|
56
|
+
cursor: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
segment: {
|
|
62
|
+
shared: {
|
|
63
|
+
placeholder: {
|
|
64
|
+
color: string;
|
|
65
|
+
focusVisible: {
|
|
66
|
+
outline: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
popover: {
|
|
72
|
+
shared: {
|
|
73
|
+
offset: number;
|
|
74
|
+
containerPadding: number;
|
|
75
|
+
backgroundColor: string;
|
|
76
|
+
padding: {
|
|
77
|
+
top: string;
|
|
78
|
+
right: string;
|
|
79
|
+
bottom: string;
|
|
80
|
+
left: string;
|
|
81
|
+
};
|
|
82
|
+
boxShadow: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
calendar: {
|
|
86
|
+
header: {
|
|
87
|
+
shared: {
|
|
88
|
+
display: string;
|
|
89
|
+
alignItems: string;
|
|
90
|
+
justifyContent: string;
|
|
91
|
+
typography: {
|
|
92
|
+
font: string;
|
|
93
|
+
letterSpacing: string;
|
|
94
|
+
fontWidth: number;
|
|
95
|
+
};
|
|
96
|
+
button: {
|
|
97
|
+
backgroundColor: string;
|
|
98
|
+
border: string;
|
|
99
|
+
padding: {
|
|
100
|
+
top: string;
|
|
101
|
+
right: string;
|
|
102
|
+
bottom: string;
|
|
103
|
+
left: string;
|
|
104
|
+
};
|
|
105
|
+
margin: {
|
|
106
|
+
top: string;
|
|
107
|
+
right: string;
|
|
108
|
+
bottom: string;
|
|
109
|
+
left: string;
|
|
110
|
+
};
|
|
111
|
+
display: string;
|
|
112
|
+
alignItems: string;
|
|
113
|
+
justifyContent: string;
|
|
114
|
+
color: string;
|
|
115
|
+
cursor: string;
|
|
116
|
+
width: string;
|
|
117
|
+
height: string;
|
|
118
|
+
aspectRatio: string;
|
|
119
|
+
hovered: {
|
|
120
|
+
backgroundColor: string;
|
|
121
|
+
};
|
|
122
|
+
pressed: {
|
|
123
|
+
backgroundColor: string;
|
|
124
|
+
};
|
|
125
|
+
selected: {
|
|
126
|
+
backgroundColor: string;
|
|
127
|
+
};
|
|
128
|
+
focusVisible: {
|
|
129
|
+
outline: string;
|
|
130
|
+
};
|
|
131
|
+
disabled: {
|
|
132
|
+
cursor: string;
|
|
133
|
+
color: string;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
grid: {
|
|
139
|
+
shared: {
|
|
140
|
+
typography: {
|
|
141
|
+
font: string;
|
|
142
|
+
letterSpacing: string;
|
|
143
|
+
fontWidth: number;
|
|
144
|
+
};
|
|
145
|
+
borderCollapse: string;
|
|
146
|
+
borderSpacing: string;
|
|
147
|
+
th: {
|
|
148
|
+
width: string;
|
|
149
|
+
height: string;
|
|
150
|
+
verticalAlign: string;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
cell: {
|
|
155
|
+
shared: {
|
|
156
|
+
width: string;
|
|
157
|
+
aspectRatio: string;
|
|
158
|
+
display: string;
|
|
159
|
+
alignItems: string;
|
|
160
|
+
justifyContent: string;
|
|
161
|
+
cursor: string;
|
|
162
|
+
outsideMonth: {
|
|
163
|
+
display: string;
|
|
164
|
+
};
|
|
165
|
+
hovered: {
|
|
166
|
+
backgroundColor: string;
|
|
167
|
+
};
|
|
168
|
+
pressed: {
|
|
169
|
+
backgroundColor: string;
|
|
170
|
+
};
|
|
171
|
+
selected: {
|
|
172
|
+
backgroundColor: string;
|
|
173
|
+
};
|
|
174
|
+
focusVisible: {
|
|
175
|
+
outline: string;
|
|
176
|
+
};
|
|
177
|
+
disabled: {
|
|
178
|
+
cursor: string;
|
|
179
|
+
color: string;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
export type ComponentDatePicker = typeof componentDatePicker;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const componentName = "TemplateComponent";
|
|
2
|
+
export declare const componentTsx = "import { TemplateComponent } from '@guardian/stand/template-component';\n\nexport const Component = () => (\n\t<>\n\t\t{/* default example */}\n\t\t<TemplateComponent />\n\n\t\t{/* custom message example */}\n\t\t<TemplateComponent message=\"hi there\" />\n\n);\n\n";
|
|
3
|
+
export declare const componentCss = "\n/* import the templateComponent styles */\n@import '@guardian/stand/component/templateComponent.css';\n/* import the icon styles if using the icon variant of the templateComponent component */\n@import \"@guardian/stand/component/icon.css\";\n\n/* example setup of templateComponent style */\n.stand-template-component {\n\tbackground-color: var(--component-template-component-color-background);\n\tdisplay: var(--component-template-component-display);\n\talign-items: var(--component-template-component-align-items);\n\tjustify-content: var(--component-template-component-justify-content);\n\twidth: var(--component-template-component-size);\n\theight: var(--component-template-component-size);\n\tuser-select: var(--component-template-component-user-select);\n\tcolor: var(--component-template-component-color-text);\n\tfont: var(--component-template-component-typography-font);\n\tletter-spacing: var(--component-template-component-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-template-component-typography-font-width);\n}\n\n.stand-template-component-icon {\n\tdisplay: var(--component-icon-shared-display);\n\tuser-select: var(--component-icon-shared-user-select);\n\tfont-size: var(--component-icon-md-size);\n}\n\n.stand-template-component-icon-color-svg > svg {\n\twidth: var(--component-icon-md-size);\n\theight: var(--component-icon-md-size);\n\tfill: var(--component-template-component-color-text);\n}\n\n/* example setup for templateComponent image */\n.stand-template-component > img {\n\twidth: 100%;\n\theight: 100%;\n\tobject-fit: cover;\n}\n";
|
|
4
|
+
export declare const componentHtml = "<div class=\"container\">\n\t<div class=\"stand-template-component\">C</div>\n <div class=\"stand-template-component\">\n\t\t<span class=\"material-symbols stand-template-component-icon\">raven</span>\n </div>\n <div class=\"stand-template-component\">\n <span class=\"stand-template-component-icon stand-template-component-icon-color-svg\"><svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M240-200h120v-240h240v240h120v-360L480-740 240-560v360Zm-80 80v-480l320-240 320 240v480H520v-240h-80v240H160Zm320-350Z\"/></svg></span>\n </div>\n <div class=\"stand-template-component\">\n \t<img src=\"https://uploads.guimcode.co.uk/2026/01/27/f85e2e477ce54f4c3b671faa5cd21673aa9f8072fddb5d70a73e6038dc812eec.jpg\" alt=\"Mahesh Makani\" />\n </div>\n</div>\n";
|
|
5
|
+
export declare const componentJs = "\t// for ts/js\n\t\timport { componentTemplateComponent, componentIcon } from \"@guardian/stand\";\n\nconst templateComponentStyles = `\n background-color: ${componentTemplateComponent.color.background};\n display: ${componentTemplateComponent.display};\n align-items: ${componentTemplateComponent[\"align-items\"]};\n justify-content: ${componentTemplateComponent[\"justify-content\"]};\n width: ${componentTemplateComponent.size};\n height: ${componentTemplateComponent.size};\n user-select: ${componentTemplateComponent[\"user-select\"]};\n`;\n\nconst typographyStyle = `\n color: ${componentTemplateComponent.color.text};\n font: ${componentTemplateComponent.typography.font};\n letter-spacing: ${componentTemplateComponent.typography.letterSpacing};\n font-variation-settings: 'wdth' ${componentTemplateComponent.typography.fontWidth};\n`;\n\nconst imgStyle = `\n width: 100%;\n height: 100%;\n object-fit: cover;\n`;\n\nconst iconStyles = `\n display: ${componentIcon.shared.display};\n user-select: ${componentIcon.shared[\"user-select\"]};\n font-size: ${componentIcon.md.size};\n color: ${componentTemplateComponent.color.text};\n`;\n\nconst iconSvgStyles = `\n width: ${componentIcon.md.size};\n height: ${componentIcon.md.size};\n fill: ${componentTemplateComponent.color.text};\n`;\n\n// e.g. adding to DOM using vanilla JS styles\ndocument.getElementById(\"app\").innerHTML = `\n<div class=\"container\">\n <div style=\"${templateComponentStyles}${typographyStyle}\">C</div>\n <div style=\"${templateComponentStyles}\">\n\t<span class=\"material-symbols\" style=\"${iconStyles}\">raven</span>\n </div>\n <div style=\"${templateComponentStyles}\">\n <span class=\"material-symbols\" style=\"${iconStyles}\"><svg style=\"${iconSvgStyles}\" xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#1f1f1f\"><path d=\"M240-200h120v-240h240v240h120v-360L480-740 240-560v360Zm-80 80v-480l320-240 320 240v480H520v-240h-80v240H160Zm320-350Z\"/></svg></span>\n </div>\n <div style=\"${templateComponentStyles}\">\n <img style=\"${imgStyle}\" src=\"https://uploads.guimcode.co.uk/2026/01/27/f85e2e477ce54f4c3b671faa5cd21673aa9f8072fddb5d70a73e6038dc812eec.jpg\" alt=\"Mahesh Makani\" />\n </div>\n`;\n";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SerializedStyles } from '@emotion/react';
|
|
2
|
+
import { type ComponentTemplateComponent } from '../../styleD/build/typescript/component/templateComponent';
|
|
3
|
+
import type { DeepPartial, Prettify } from '../../util/types';
|
|
4
|
+
export type TemplateComponentTheme = Prettify<ComponentTemplateComponent>;
|
|
5
|
+
export type PartialTemplateComponentTheme = Prettify<DeepPartial<TemplateComponentTheme>>;
|
|
6
|
+
export declare const defaultTemplateComponentTheme: TemplateComponentTheme;
|
|
7
|
+
export declare const templateComponentStyles: (theme: TemplateComponentTheme) => SerializedStyles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guardian/stand",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.32",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"//exports": "Each component has its own entry point for optimal tree-shaking. Main entry point only includes design tokens and utilities. New components/foundations should follow the same pattern.",
|
|
6
6
|
"exports": {
|
|
@@ -109,6 +109,11 @@
|
|
|
109
109
|
"import": "./dist/alert-banner.js",
|
|
110
110
|
"require": "./dist/alert-banner.cjs"
|
|
111
111
|
},
|
|
112
|
+
"./date-picker": {
|
|
113
|
+
"types": "./dist/types/date-picker.d.ts",
|
|
114
|
+
"import": "./dist/date-picker.js",
|
|
115
|
+
"require": "./dist/date-picker.cjs"
|
|
116
|
+
},
|
|
112
117
|
"./byline": {
|
|
113
118
|
"types": "./dist/types/byline.d.ts",
|
|
114
119
|
"import": "./dist/byline.js",
|
|
@@ -161,7 +166,8 @@
|
|
|
161
166
|
"./component/radioGroup.css": "./dist/styleD/build/css/component/radioGroup.css",
|
|
162
167
|
"./component/checkbox.css": "./dist/styleD/build/css/component/checkbox.css",
|
|
163
168
|
"./component/textArea.css": "./dist/styleD/build/css/component/textArea.css",
|
|
164
|
-
"./component/alertBanner.css": "./dist/styleD/build/css/component/alertBanner.css"
|
|
169
|
+
"./component/alertBanner.css": "./dist/styleD/build/css/component/alertBanner.css",
|
|
170
|
+
"./component/datePicker.css": "./dist/styleD/build/css/component/datePicker.css"
|
|
165
171
|
},
|
|
166
172
|
"//typesVersions": "Provides backward compatibility for TypeScript moduleResolution: node - maps subpath imports to correct type definition files. When adding new components with their own entry points, ensure to add them here.",
|
|
167
173
|
"typesVersions": {
|
|
@@ -237,6 +243,9 @@
|
|
|
237
243
|
],
|
|
238
244
|
"alert-banner": [
|
|
239
245
|
"./dist/types/alert-banner.d.ts"
|
|
246
|
+
],
|
|
247
|
+
"date-picker": [
|
|
248
|
+
"./dist/types/date-picker.d.ts"
|
|
240
249
|
]
|
|
241
250
|
}
|
|
242
251
|
},
|
|
@@ -259,6 +268,7 @@
|
|
|
259
268
|
"@guardian/prettier": "10.0.0",
|
|
260
269
|
"@guardian/prosemirror-invisibles": "3.1.1",
|
|
261
270
|
"@guardian/tsconfig": "1.0.1",
|
|
271
|
+
"@internationalized/date": "3.12.1",
|
|
262
272
|
"@material-design-icons/svg": "^0.14.15",
|
|
263
273
|
"@playwright/experimental-ct-react17": "^1.59.1",
|
|
264
274
|
"@rollup/plugin-commonjs": "29.0.2",
|
|
@@ -306,6 +316,7 @@
|
|
|
306
316
|
"peerDependencies": {
|
|
307
317
|
"@emotion/react": ">=11.11.4 <=11.14.0",
|
|
308
318
|
"@guardian/prosemirror-invisibles": "3.1.1",
|
|
319
|
+
"@internationalized/date": "^3.12.1",
|
|
309
320
|
"prosemirror-dropcursor": "1.8.2",
|
|
310
321
|
"prosemirror-history": "1.4.1",
|
|
311
322
|
"prosemirror-keymap": "1.2.2",
|
|
@@ -324,6 +335,9 @@
|
|
|
324
335
|
"@guardian/prosemirror-invisibles": {
|
|
325
336
|
"optional": true
|
|
326
337
|
},
|
|
338
|
+
"@internationalized/date": {
|
|
339
|
+
"optional": true
|
|
340
|
+
},
|
|
327
341
|
"prosemirror-dropcursor": {
|
|
328
342
|
"optional": true
|
|
329
343
|
},
|
|
@@ -368,6 +382,7 @@
|
|
|
368
382
|
"test": "jest",
|
|
369
383
|
"test:setup-e2e": "playwright install --with-deps",
|
|
370
384
|
"test:e2e": "playwright test -c playwright-ct.config.ts",
|
|
385
|
+
"create-component": "npx ts-node ./scripts/create-component.ts",
|
|
371
386
|
"test:react-matrix": "./scripts/test-deps-matrix.sh"
|
|
372
387
|
}
|
|
373
388
|
}
|