@guardian/stand 0.0.18 → 0.0.20
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/TopBar.cjs +2 -0
- package/dist/TopBar.js +1 -1
- package/dist/components/form/Form.cjs +47 -0
- package/dist/components/form/Form.js +17 -0
- package/dist/components/form/styles.cjs +49 -0
- package/dist/components/form/styles.js +35 -0
- package/dist/components/form/types.cjs +7 -0
- package/dist/components/form/types.js +5 -0
- package/dist/components/select/Select.cjs +58 -0
- package/dist/components/select/Select.js +33 -0
- package/dist/components/select/styles.cjs +101 -0
- package/dist/components/select/styles.js +95 -0
- package/dist/form.cjs +7 -0
- package/dist/form.js +1 -0
- package/dist/index.cjs +4 -0
- package/dist/index.js +2 -0
- package/dist/select.cjs +9 -0
- package/dist/select.js +2 -0
- package/dist/styleD/build/css/component/form.css +28 -0
- package/dist/styleD/build/css/component/select.css +48 -0
- package/dist/styleD/build/typescript/component/form.cjs +57 -0
- package/dist/styleD/build/typescript/component/form.js +55 -0
- package/dist/styleD/build/typescript/component/select.cjs +69 -0
- package/dist/styleD/build/typescript/component/select.js +67 -0
- package/dist/types/TopBar.d.ts +1 -1
- package/dist/types/components/form/Form.d.ts +5 -0
- package/dist/types/components/form/styles.d.ts +15 -0
- package/dist/types/components/form/types.d.ts +40 -0
- package/dist/types/components/select/Select.d.ts +3 -0
- package/dist/types/components/select/sandbox.d.ts +5 -0
- package/dist/types/components/select/styles.d.ts +10 -0
- package/dist/types/components/select/types.d.ts +9 -0
- package/dist/types/form.d.ts +8 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/select.d.ts +20 -0
- package/dist/types/styleD/build/typescript/component/form.d.ts +57 -0
- package/dist/types/styleD/build/typescript/component/select.d.ts +69 -0
- package/package.json +44 -20
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
const componentForm = {
|
|
2
|
+
input: {
|
|
3
|
+
shared: {
|
|
4
|
+
container: {
|
|
5
|
+
display: "flex",
|
|
6
|
+
"flex-direction": "column",
|
|
7
|
+
gap: "0.25rem",
|
|
8
|
+
width: "100%"
|
|
9
|
+
},
|
|
10
|
+
label: {
|
|
11
|
+
color: "#000000",
|
|
12
|
+
disabled: {
|
|
13
|
+
color: "#999999"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
description: {
|
|
17
|
+
color: "#545454",
|
|
18
|
+
typography: {
|
|
19
|
+
font: "normal 460 0.875rem/1.3 Open Sans",
|
|
20
|
+
letterSpacing: "0rem",
|
|
21
|
+
fontWidth: 95
|
|
22
|
+
},
|
|
23
|
+
disabled: {
|
|
24
|
+
color: "#999999"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
sm: {
|
|
29
|
+
container: {
|
|
30
|
+
"max-width": "200px"
|
|
31
|
+
},
|
|
32
|
+
label: {
|
|
33
|
+
typography: {
|
|
34
|
+
font: "normal 700 0.875rem/1.15 Open Sans",
|
|
35
|
+
letterSpacing: "-0.0125rem",
|
|
36
|
+
fontWidth: 95
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
md: {
|
|
41
|
+
container: {
|
|
42
|
+
"max-width": "320px"
|
|
43
|
+
},
|
|
44
|
+
label: {
|
|
45
|
+
typography: {
|
|
46
|
+
font: "normal 700 1rem/1.15 Open Sans",
|
|
47
|
+
letterSpacing: "-0.03125rem",
|
|
48
|
+
fontWidth: 95
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export { componentForm };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const componentSelect = {
|
|
4
|
+
shared: {
|
|
5
|
+
maxWidth: "320px",
|
|
6
|
+
width: "100%",
|
|
7
|
+
hover: {
|
|
8
|
+
backgroundColor: "#f6f6f6",
|
|
9
|
+
outline: "none"
|
|
10
|
+
},
|
|
11
|
+
pressed: {
|
|
12
|
+
backgroundColor: "#ededed"
|
|
13
|
+
},
|
|
14
|
+
button: {
|
|
15
|
+
display: "flex",
|
|
16
|
+
justifyContent: "space-between",
|
|
17
|
+
alignItems: "center",
|
|
18
|
+
marginTop: "0.25rem",
|
|
19
|
+
backgroundColor: "#ffffff",
|
|
20
|
+
border: "0.0625rem solid #545454",
|
|
21
|
+
borderRadius: "0.25rem",
|
|
22
|
+
height: "2.5rem",
|
|
23
|
+
paddingLeft: "0.75rem",
|
|
24
|
+
paddingRight: "0.25rem",
|
|
25
|
+
color: "#545454",
|
|
26
|
+
typography: {
|
|
27
|
+
font: "normal 460 1rem/1.3 Open Sans",
|
|
28
|
+
letterSpacing: "0rem",
|
|
29
|
+
fontWidth: 95
|
|
30
|
+
},
|
|
31
|
+
focused: {
|
|
32
|
+
outline: "0.125rem solid #0072a9",
|
|
33
|
+
"outline-offset": "0.125rem"
|
|
34
|
+
},
|
|
35
|
+
disabled: {
|
|
36
|
+
backgroundColor: "#ffffff",
|
|
37
|
+
cursor: "not-allowed",
|
|
38
|
+
color: "#999999",
|
|
39
|
+
border: "0.0625rem solid #dcdcdc"
|
|
40
|
+
},
|
|
41
|
+
error: {
|
|
42
|
+
border: "0.0625rem solid #b42a19"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
option: {
|
|
46
|
+
paddingLeft: "1rem",
|
|
47
|
+
paddingRight: "1rem",
|
|
48
|
+
paddingTop: "0.75rem",
|
|
49
|
+
paddingBottom: "0.75rem",
|
|
50
|
+
focused: {
|
|
51
|
+
outline: "0.125rem solid #0072a9",
|
|
52
|
+
"outline-offset": "0",
|
|
53
|
+
backgroundColor: "inherit"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
listBox: {
|
|
57
|
+
typography: {
|
|
58
|
+
font: "normal 460 1rem/1.3 Open Sans",
|
|
59
|
+
letterSpacing: "0rem",
|
|
60
|
+
fontWidth: 95
|
|
61
|
+
},
|
|
62
|
+
border: "0.0625rem solid #cccccc",
|
|
63
|
+
backgroundColor: "#ffffff",
|
|
64
|
+
shadow: "0 0.125rem 0.375rem 0 rgb(0% 0% 0% / 0.3)"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
exports.componentSelect = componentSelect;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const componentSelect = {
|
|
2
|
+
shared: {
|
|
3
|
+
maxWidth: "320px",
|
|
4
|
+
width: "100%",
|
|
5
|
+
hover: {
|
|
6
|
+
backgroundColor: "#f6f6f6",
|
|
7
|
+
outline: "none"
|
|
8
|
+
},
|
|
9
|
+
pressed: {
|
|
10
|
+
backgroundColor: "#ededed"
|
|
11
|
+
},
|
|
12
|
+
button: {
|
|
13
|
+
display: "flex",
|
|
14
|
+
justifyContent: "space-between",
|
|
15
|
+
alignItems: "center",
|
|
16
|
+
marginTop: "0.25rem",
|
|
17
|
+
backgroundColor: "#ffffff",
|
|
18
|
+
border: "0.0625rem solid #545454",
|
|
19
|
+
borderRadius: "0.25rem",
|
|
20
|
+
height: "2.5rem",
|
|
21
|
+
paddingLeft: "0.75rem",
|
|
22
|
+
paddingRight: "0.25rem",
|
|
23
|
+
color: "#545454",
|
|
24
|
+
typography: {
|
|
25
|
+
font: "normal 460 1rem/1.3 Open Sans",
|
|
26
|
+
letterSpacing: "0rem",
|
|
27
|
+
fontWidth: 95
|
|
28
|
+
},
|
|
29
|
+
focused: {
|
|
30
|
+
outline: "0.125rem solid #0072a9",
|
|
31
|
+
"outline-offset": "0.125rem"
|
|
32
|
+
},
|
|
33
|
+
disabled: {
|
|
34
|
+
backgroundColor: "#ffffff",
|
|
35
|
+
cursor: "not-allowed",
|
|
36
|
+
color: "#999999",
|
|
37
|
+
border: "0.0625rem solid #dcdcdc"
|
|
38
|
+
},
|
|
39
|
+
error: {
|
|
40
|
+
border: "0.0625rem solid #b42a19"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
option: {
|
|
44
|
+
paddingLeft: "1rem",
|
|
45
|
+
paddingRight: "1rem",
|
|
46
|
+
paddingTop: "0.75rem",
|
|
47
|
+
paddingBottom: "0.75rem",
|
|
48
|
+
focused: {
|
|
49
|
+
outline: "0.125rem solid #0072a9",
|
|
50
|
+
"outline-offset": "0",
|
|
51
|
+
backgroundColor: "inherit"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
listBox: {
|
|
55
|
+
typography: {
|
|
56
|
+
font: "normal 460 1rem/1.3 Open Sans",
|
|
57
|
+
letterSpacing: "0rem",
|
|
58
|
+
fontWidth: 95
|
|
59
|
+
},
|
|
60
|
+
border: "0.0625rem solid #cccccc",
|
|
61
|
+
backgroundColor: "#ffffff",
|
|
62
|
+
shadow: "0 0.125rem 0.375rem 0 rgb(0% 0% 0% / 0.3)"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export { componentSelect };
|
package/dist/types/TopBar.d.ts
CHANGED
|
@@ -23,6 +23,6 @@ export type { PartialTopBarNavigationTheme as TopBarNavigationTheme } from './co
|
|
|
23
23
|
export { TopBarItem } from './components/topbar/topBarItem/TopBarItem';
|
|
24
24
|
export type { TopBarItemProps } from './components/topbar/topBarItem/types';
|
|
25
25
|
export type { PartialTopBarItemTheme as TopBarItemTheme } from './components/topbar/topBarItem/styles';
|
|
26
|
-
export { TopBar } from './components/topbar/TopBar';
|
|
26
|
+
export { TopBar, TopBarContainerLeft, TopBarContainerRight, } from './components/topbar/TopBar';
|
|
27
27
|
export type { TopBarProps } from './components/topbar/types';
|
|
28
28
|
export type { PartialTopBarTheme as TopBarTheme } from './components/topbar/styles';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
+
import type { AllowedContainer, FormInputContainerDefaultProps } from './types';
|
|
3
|
+
export declare function FormInputContainer<C extends AllowedContainer>({ as: Component, size, label, description, error, isDisabled, theme, formInputContainerTheme, cssOverrides, children, ...props }: FormInputContainerDefaultProps<ComponentPropsWithRef<C>> & {
|
|
4
|
+
as: C;
|
|
5
|
+
}): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SerializedStyles } from '@emotion/react';
|
|
2
|
+
import type { ComponentForm } from '../../styleD/build/typescript/component/form';
|
|
3
|
+
import type { Prettify } from '../../util/types';
|
|
4
|
+
export type FormInputContainerTheme = Prettify<ComponentForm['input']>;
|
|
5
|
+
export declare const defaultFormInputContainerTheme: FormInputContainerTheme;
|
|
6
|
+
export declare const formInputContainerStyles: (theme: FormInputContainerTheme, { size, }: {
|
|
7
|
+
size: keyof Omit<FormInputContainerTheme, 'shared'>;
|
|
8
|
+
}) => SerializedStyles;
|
|
9
|
+
export declare const formInputLabelStyles: (theme: FormInputContainerTheme, { isDisabled, size, }: {
|
|
10
|
+
size: keyof Omit<FormInputContainerTheme, 'shared'>;
|
|
11
|
+
isDisabled?: boolean | undefined;
|
|
12
|
+
}) => SerializedStyles;
|
|
13
|
+
export declare const formInputDescriptionStyles: (theme: FormInputContainerTheme, { isDisabled, }: {
|
|
14
|
+
isDisabled?: boolean | undefined;
|
|
15
|
+
}) => SerializedStyles;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { DeepPartial, DefaultProps } from '../../util/types';
|
|
3
|
+
import type { FormInputContainerTheme } from './styles';
|
|
4
|
+
export type FormInputContainerDefaultProps<ReactAriaInput extends {
|
|
5
|
+
className?: unknown;
|
|
6
|
+
}, ComponentTheme = FormInputContainerTheme> = DefaultProps<ComponentTheme, ReactAriaInput['className']> & Omit<ReactAriaInput, 'children' | 'className'> & {
|
|
7
|
+
/**
|
|
8
|
+
* The size of the form input, 'md' (default) or 'sm'.
|
|
9
|
+
*/
|
|
10
|
+
size?: keyof Omit<ComponentTheme, 'shared'>;
|
|
11
|
+
/**
|
|
12
|
+
* The label text for the form field
|
|
13
|
+
*/
|
|
14
|
+
label?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The description text for the form field
|
|
17
|
+
*/
|
|
18
|
+
description?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Validation error message
|
|
21
|
+
*/
|
|
22
|
+
error?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Theme overrides for the FormInputContainer container, label, and description styles.
|
|
25
|
+
* Use this when the component has its own `theme` prop for component-specific styles.
|
|
26
|
+
*/
|
|
27
|
+
formInputContainerTheme?: DeepPartial<FormInputContainerTheme>;
|
|
28
|
+
/**
|
|
29
|
+
* The content of the form field (e.g. Input, Button, Popover) should always be plain React nodes.
|
|
30
|
+
* RAC render-prop children (present on Select etc.) are intentionally excluded to
|
|
31
|
+
* preserve React 18/19 compatibility where functions are not assignable to ReactNode.
|
|
32
|
+
*/
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* The React Aria form container components FormInputContainer supports.
|
|
37
|
+
* Add new components here
|
|
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];
|
|
40
|
+
export type AllowedContainer = (typeof ALLOWED_FORM_CONTAINERS)[number];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { OptionProps, SelectProps } from './types';
|
|
2
|
+
export declare function Option({ children, theme }: OptionProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function Select({ isInvalid, theme, children, ...props }: SelectProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const componentName = "Select";
|
|
2
|
+
export declare const componentTsx = "import { Select } from '@guardian/stand/select';\n\nexport const Component = () => (\n\t<Select label=\"Select\">\n\t\t<Option>Option 1</Option>\n\t\t<Option>Option 2</Option>\n\t</Select>\n);\n";
|
|
3
|
+
export declare const componentCss = "\n/* import the select styles */\n@import '@guardian/stand/component/select.css';\n\n.stand-select-container {\n\tdisplay: var(--component-select-shared-display);\n\tflex-direction: var(--component-select-shared-flex-direction);\n\tgap: var(--component-select-shared-gap);\n\n\tmax-width: var(--component-select-shared-maxWidth);\n\twidth: var(--component-select-shared-width);\n}\n\n.stand-select {\n\t\tdisplay: var(--component-select-button-display);\n\t\tjustify-content: var(--component-select-button-justify-content);\n\t\talign-items: var(--component-select-button-align-items);\n\t\tbackground-color: var(--component-select-button-background-color);\n\t\tborder: var(--component-select-button-border);\n\t\tborder-radius: var(--component-select-button-border-radius);\n\t\theight: var(--component-select-button-height);\n\t\tpadding-left: var(--component-select-button-padding-left);\n\t\tpadding-right: var(--component-select-button-padding-right);\n\t\tmargin-top: var(--component-select-button-margin-top);\n\t\tcolor: var(--component-select-button-color);\n\n\t\tfont: var(--component-select-button-body-md-typography-font);\n\t\tletter-spacing: var(--component-select-button-body-md-typography-letter-spacing);\n\t\tfont-variation-settings: \"wdth\" var(--component-select-button-body-md-typography-font-width);\n\n\n\t\t&:hover {\n\t\t\tbackground: var(--component-select-shared-hover-background-color);\n\t\t}\n\n\t\t&:active {\n\t\t\tbackground: var(--component-select-shared-active-background-color);\n\t\t}\n\n\t\t&:focus-visible {\n\t\t\toutline: var(--component-select-button-focused-outline);\n\t\t\toutline-offset: var(--component-select-button-focused-outline-offset);\n\t\t}\n\n\t\t&:disabled {\n\t\t\tcursor: var(--component-select-button-disabled-cursor);\n\t\t\tbackground-color: var(--component-select-button-disabled-background-color);\n\t\t\tcolor: var(--component-select-button-disabled-color);\n\t\t\tborder: var(--component-select-button-disabled-border);\n\t\t}\n}\n";
|
|
4
|
+
export declare const componentHtml = "<div class=\"container\">\n\t<div class=\"stand-select-container\">\n\t\t<label>Select</label>\n\t\t<select class=\"stand-select\">\n\t\t\t<option>Option 1</option>\n\t\t\t<option>Option 2</option>\n\t\t</select>\n\t</div>\n</div>\n";
|
|
5
|
+
export declare const componentJs = "\nimport { componentSelect } from \"@guardian/stand\";\n\n// example of creating a stylesheet in js\nconst sheet = new CSSStyleSheet();\n\n// apply the rules to the sheet\nsheet.replaceSync(`\n\n.js-stand-select-container {\n\tdisplay: ${componentSelect.shared.display};\n\tflex-direction: ${componentSelect.shared.flexDirection};\n\tgap: ${componentSelect.shared.gap};\n\n\tmax-width: ${componentSelect.shared.maxWidth};\n\twidth: ${componentSelect.shared.width};\n}\n\n.js-stand-select {\n\tdisplay: ${componentSelect.button.display};\n\tjustify-content: ${componentSelect.button.justifyContent};\n\talign-items: ${componentSelect.button.alignItems};\n\tbackground-color: ${componentSelect.button.backgroundColor};\n\tborder: ${componentSelect.button.border};\n\tborder-radius: ${componentSelect.button.borderRadius};\n\theight: ${componentSelect.button.height};\n\tpadding-left: ${componentSelect.button.paddingLeft};\n\tpadding-right: ${componentSelect.button.paddingRight};\n\tmargin-top: ${componentSelect.button.marginTop};\n\tcolor: ${componentSelect.button.color};\n\n\tfont: ${componentSelect.button.typography.font};\n\tletter-spacing: ${componentSelect.button.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentSelect.button.typography.fontWidth};\n\n\t&:hover {\n\t\tbackground: ${componentSelect.shared.hover.backgroundColor};\n\t}\n\n\t&:active {\n\t\tbackground: ${componentSelect.shared.pressed.backgroundColor};\n\t}\n\n\t&:focus-visible {\n\t\toutline: ${componentSelect.button.focused.outline};\n\t\toutline-offset: ${componentSelect.button.focused['outline-offset']};\n\t}\n\n\t&:disabled {\n\t\tcursor: ${componentSelect.button.disabled.cursor};\n\t\tbackground-color: ${componentSelect.button.disabled.backgroundColor};\n\t\tcolor: ${componentSelect.button.disabled.color};\n\t\tborder: ${componentSelect.button.disabled.border};\n\t}\n}\n`);\n\n// update the document with the sheet\ndocument.adoptedStyleSheets.push(sheet);\n\ndocument.getElementById(\"app\").innerHTML = `\n\t<div class=\"js-stand-select-container\">\n\t\t<label>Select</label>\n\t\t<select class=\"js-stand-select\">\n\t\t\t<option>Option 1</option>\n\t\t\t<option>Option 2</option>\n\t\t</select>\n\t</div>\n`;\n";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SerializedStyles } from '@emotion/react';
|
|
2
|
+
import type { ComponentSelect } from '../../styleD/build/typescript/component/select';
|
|
3
|
+
import type { DeepPartial, Prettify } from '../../util/types';
|
|
4
|
+
export type SelectTheme = Prettify<ComponentSelect>;
|
|
5
|
+
export type PartialSelectTheme = DeepPartial<SelectTheme>;
|
|
6
|
+
export declare const defaultSelectTheme: SelectTheme;
|
|
7
|
+
export declare const popoverStyles: (theme: SelectTheme) => SerializedStyles;
|
|
8
|
+
export declare const listBoxItemStyles: (theme: SelectTheme) => SerializedStyles;
|
|
9
|
+
export declare const listBoxStyles: (theme: SelectTheme) => SerializedStyles;
|
|
10
|
+
export declare const buttonStyles: (theme: SelectTheme, isInvalid?: boolean) => SerializedStyles;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ListBoxItemProps as RACListBoxItemProps, ListBoxProps as RACListBoxProps, SelectProps as RACSelectProps } from 'react-aria-components';
|
|
2
|
+
import type { DefaultPropsWithChildren } from '../../util/types';
|
|
3
|
+
import type { FormInputContainerDefaultProps } from '../form/types';
|
|
4
|
+
import type { SelectTheme } from './styles';
|
|
5
|
+
export interface OptionProps extends DefaultPropsWithChildren<SelectTheme, RACListBoxItemProps['className']>, Omit<RACListBoxItemProps, 'children'> {
|
|
6
|
+
}
|
|
7
|
+
export interface ListBoxProps extends DefaultPropsWithChildren<SelectTheme, RACListBoxProps<object>['className']>, Omit<RACListBoxProps<object>, 'children'> {
|
|
8
|
+
}
|
|
9
|
+
export type SelectProps = FormInputContainerDefaultProps<RACSelectProps<object, 'single' | 'multiple'>, SelectTheme>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared form components entry point
|
|
3
|
+
*
|
|
4
|
+
* If you only need the built CSS (./component/form.css),
|
|
5
|
+
* you don't need to install these.
|
|
6
|
+
*/
|
|
7
|
+
export { componentForm } from './styleD/build/typescript/component/form';
|
|
8
|
+
export type { ComponentForm } from './styleD/build/typescript/component/form';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -28,10 +28,14 @@ export { componentFavicon } from './styleD/build/typescript/component/favicon';
|
|
|
28
28
|
export type { ComponentFavicon } from './styleD/build/typescript/component/favicon';
|
|
29
29
|
export { componentInlineMessage } from './styleD/build/typescript/component/inlineMessage';
|
|
30
30
|
export type { ComponentInlineMessage } from './styleD/build/typescript/component/inlineMessage';
|
|
31
|
+
export { componentSelect } from './styleD/build/typescript/component/select';
|
|
32
|
+
export type { ComponentSelect } from './styleD/build/typescript/component/select';
|
|
31
33
|
export { componentMenu } from './styleD/build/typescript/component/menu';
|
|
32
34
|
export type { ComponentMenu } from './styleD/build/typescript/component/menu';
|
|
33
35
|
export { componentTopBar } from './styleD/build/typescript/component/TopBar';
|
|
34
36
|
export type { ComponentTopBar } from './styleD/build/typescript/component/TopBar';
|
|
37
|
+
export { componentForm } from './styleD/build/typescript/component/form';
|
|
38
|
+
export type { ComponentForm } from './styleD/build/typescript/component/form';
|
|
35
39
|
/**
|
|
36
40
|
* style dictionary exports - base
|
|
37
41
|
*/
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Select component entry point
|
|
3
|
+
*
|
|
4
|
+
* Peer dependencies required to use these components:
|
|
5
|
+
* - `@emotion/react`
|
|
6
|
+
* - `react`
|
|
7
|
+
* - `react-dom`
|
|
8
|
+
* - `react-aria-components`
|
|
9
|
+
* - `typescript`
|
|
10
|
+
*
|
|
11
|
+
* See the `peerDependencies` section of package.json for compatible versions.
|
|
12
|
+
*
|
|
13
|
+
* If you only need the built CSS (./component/select.css),
|
|
14
|
+
* you don't need to install these.
|
|
15
|
+
*/
|
|
16
|
+
export { Select } from './components/select/Select';
|
|
17
|
+
export type { SelectProps } from './components/select/types';
|
|
18
|
+
export type { PartialSelectTheme as SelectTheme } from './components/select/styles';
|
|
19
|
+
export { componentSelect } from './styleD/build/typescript/component/select';
|
|
20
|
+
export type { ComponentSelect } from './styleD/build/typescript/component/select';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
export declare const componentForm: {
|
|
5
|
+
input: {
|
|
6
|
+
shared: {
|
|
7
|
+
container: {
|
|
8
|
+
display: string;
|
|
9
|
+
'flex-direction': string;
|
|
10
|
+
gap: string;
|
|
11
|
+
width: string;
|
|
12
|
+
};
|
|
13
|
+
label: {
|
|
14
|
+
color: string;
|
|
15
|
+
disabled: {
|
|
16
|
+
color: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
description: {
|
|
20
|
+
color: string;
|
|
21
|
+
typography: {
|
|
22
|
+
font: string;
|
|
23
|
+
letterSpacing: string;
|
|
24
|
+
fontWidth: number;
|
|
25
|
+
};
|
|
26
|
+
disabled: {
|
|
27
|
+
color: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
sm: {
|
|
32
|
+
container: {
|
|
33
|
+
'max-width': string;
|
|
34
|
+
};
|
|
35
|
+
label: {
|
|
36
|
+
typography: {
|
|
37
|
+
font: string;
|
|
38
|
+
letterSpacing: string;
|
|
39
|
+
fontWidth: number;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
md: {
|
|
44
|
+
container: {
|
|
45
|
+
'max-width': string;
|
|
46
|
+
};
|
|
47
|
+
label: {
|
|
48
|
+
typography: {
|
|
49
|
+
font: string;
|
|
50
|
+
letterSpacing: string;
|
|
51
|
+
fontWidth: number;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export type ComponentForm = typeof componentForm;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
export declare const componentSelect: {
|
|
5
|
+
shared: {
|
|
6
|
+
maxWidth: string;
|
|
7
|
+
width: string;
|
|
8
|
+
hover: {
|
|
9
|
+
backgroundColor: string;
|
|
10
|
+
outline: string;
|
|
11
|
+
};
|
|
12
|
+
pressed: {
|
|
13
|
+
backgroundColor: string;
|
|
14
|
+
};
|
|
15
|
+
button: {
|
|
16
|
+
display: string;
|
|
17
|
+
justifyContent: string;
|
|
18
|
+
alignItems: string;
|
|
19
|
+
marginTop: string;
|
|
20
|
+
backgroundColor: string;
|
|
21
|
+
border: string;
|
|
22
|
+
borderRadius: string;
|
|
23
|
+
height: string;
|
|
24
|
+
paddingLeft: string;
|
|
25
|
+
paddingRight: string;
|
|
26
|
+
color: string;
|
|
27
|
+
typography: {
|
|
28
|
+
font: string;
|
|
29
|
+
letterSpacing: string;
|
|
30
|
+
fontWidth: number;
|
|
31
|
+
};
|
|
32
|
+
focused: {
|
|
33
|
+
outline: string;
|
|
34
|
+
'outline-offset': string;
|
|
35
|
+
};
|
|
36
|
+
disabled: {
|
|
37
|
+
backgroundColor: string;
|
|
38
|
+
cursor: string;
|
|
39
|
+
color: string;
|
|
40
|
+
border: string;
|
|
41
|
+
};
|
|
42
|
+
error: {
|
|
43
|
+
border: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
option: {
|
|
47
|
+
paddingLeft: string;
|
|
48
|
+
paddingRight: string;
|
|
49
|
+
paddingTop: string;
|
|
50
|
+
paddingBottom: string;
|
|
51
|
+
focused: {
|
|
52
|
+
outline: string;
|
|
53
|
+
'outline-offset': string;
|
|
54
|
+
backgroundColor: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
listBox: {
|
|
58
|
+
typography: {
|
|
59
|
+
font: string;
|
|
60
|
+
letterSpacing: string;
|
|
61
|
+
fontWidth: number;
|
|
62
|
+
};
|
|
63
|
+
border: string;
|
|
64
|
+
backgroundColor: string;
|
|
65
|
+
shadow: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export type ComponentSelect = typeof componentSelect;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guardian/stand",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20",
|
|
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": {
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
"import": "./dist/avatar.js",
|
|
15
15
|
"require": "./dist/avatar.cjs"
|
|
16
16
|
},
|
|
17
|
-
"./
|
|
18
|
-
"types": "./dist/types/
|
|
19
|
-
"import": "./dist/
|
|
20
|
-
"require": "./dist/
|
|
17
|
+
"./AvatarLink": {
|
|
18
|
+
"types": "./dist/types/avatarLink.d.ts",
|
|
19
|
+
"import": "./dist/avatarLink.js",
|
|
20
|
+
"require": "./dist/avatarLink.cjs"
|
|
21
21
|
},
|
|
22
|
-
"./
|
|
23
|
-
"types": "./dist/types/
|
|
24
|
-
"import": "./dist/
|
|
25
|
-
"require": "./dist/
|
|
22
|
+
"./AvatarButton": {
|
|
23
|
+
"types": "./dist/types/avatarButton.d.ts",
|
|
24
|
+
"import": "./dist/avatarButton.js",
|
|
25
|
+
"require": "./dist/avatarButton.cjs"
|
|
26
26
|
},
|
|
27
27
|
"./button": {
|
|
28
28
|
"types": "./dist/types/button.d.ts",
|
|
@@ -69,11 +69,21 @@
|
|
|
69
69
|
"import": "./dist/TopBar.js",
|
|
70
70
|
"require": "./dist/TopBar.cjs"
|
|
71
71
|
},
|
|
72
|
+
"./form": {
|
|
73
|
+
"types": "./dist/types/form.d.ts",
|
|
74
|
+
"import": "./dist/form.js",
|
|
75
|
+
"require": "./dist/form.cjs"
|
|
76
|
+
},
|
|
72
77
|
"./inline-message": {
|
|
73
78
|
"types": "./dist/types/inline-message.d.ts",
|
|
74
79
|
"import": "./dist/inline-message.js",
|
|
75
80
|
"require": "./dist/inline-message.cjs"
|
|
76
81
|
},
|
|
82
|
+
"./select": {
|
|
83
|
+
"types": "./dist/types/select.d.ts",
|
|
84
|
+
"import": "./dist/select.js",
|
|
85
|
+
"require": "./dist/select.cjs"
|
|
86
|
+
},
|
|
77
87
|
"./byline": {
|
|
78
88
|
"types": "./dist/types/byline.d.ts",
|
|
79
89
|
"import": "./dist/byline.js",
|
|
@@ -119,7 +129,9 @@
|
|
|
119
129
|
"./component/favicon.css": "./dist/styleD/build/css/component/favicon.css",
|
|
120
130
|
"./component/menu.css": "./dist/styleD/build/css/component/menu.css",
|
|
121
131
|
"./component/TopBar.css": "./dist/styleD/build/css/component/TopBar.css",
|
|
122
|
-
"./component/
|
|
132
|
+
"./component/form.css": "./dist/styleD/build/css/component/form.css",
|
|
133
|
+
"./component/inlineMessage.css": "./dist/styleD/build/css/component/inlineMessage.css",
|
|
134
|
+
"./component/select.css": "./dist/styleD/build/css/component/select.css"
|
|
123
135
|
},
|
|
124
136
|
"//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.",
|
|
125
137
|
"typesVersions": {
|
|
@@ -127,6 +139,12 @@
|
|
|
127
139
|
"avatar": [
|
|
128
140
|
"./dist/types/avatar.d.ts"
|
|
129
141
|
],
|
|
142
|
+
"AvatarButton": [
|
|
143
|
+
"./dist/types/avatarButton.d.ts"
|
|
144
|
+
],
|
|
145
|
+
"AvatarLink": [
|
|
146
|
+
"./dist/types/avatarLink.d.ts"
|
|
147
|
+
],
|
|
130
148
|
"button": [
|
|
131
149
|
"./dist/types/button.d.ts"
|
|
132
150
|
],
|
|
@@ -166,8 +184,14 @@
|
|
|
166
184
|
"menu": [
|
|
167
185
|
"./dist/types/menu.d.ts"
|
|
168
186
|
],
|
|
187
|
+
"form": [
|
|
188
|
+
"./dist/types/form.d.ts"
|
|
189
|
+
],
|
|
169
190
|
"inline-message": [
|
|
170
191
|
"./dist/types/inline-message.d.ts"
|
|
192
|
+
],
|
|
193
|
+
"select": [
|
|
194
|
+
"./dist/types/select.d.ts"
|
|
171
195
|
]
|
|
172
196
|
}
|
|
173
197
|
},
|
|
@@ -185,20 +209,20 @@
|
|
|
185
209
|
"@changesets/cli": "^2.30.0",
|
|
186
210
|
"@codesandbox/sandpack-react": "^2.20.0",
|
|
187
211
|
"@emotion/react": "11.11.4",
|
|
188
|
-
"@figma/rest-api-spec": "^0.
|
|
212
|
+
"@figma/rest-api-spec": "^0.37.0",
|
|
189
213
|
"@guardian/eslint-config": "14.0.1",
|
|
190
214
|
"@guardian/prettier": "10.0.0",
|
|
191
215
|
"@guardian/prosemirror-invisibles": "3.1.1",
|
|
192
216
|
"@guardian/tsconfig": "1.0.1",
|
|
193
217
|
"@material-design-icons/svg": "^0.14.15",
|
|
194
|
-
"@playwright/experimental-ct-react17": "^1.
|
|
218
|
+
"@playwright/experimental-ct-react17": "^1.59.1",
|
|
195
219
|
"@react-aria/focus": "3.21.5",
|
|
196
220
|
"@rollup/plugin-commonjs": "29.0.2",
|
|
197
221
|
"@rollup/plugin-node-resolve": "16.0.3",
|
|
198
222
|
"@rollup/plugin-typescript": "12.3.0",
|
|
199
|
-
"@storybook/addon-docs": "^10.3.
|
|
200
|
-
"@storybook/addon-themes": "^10.3.
|
|
201
|
-
"@storybook/react-vite": "^10.3.
|
|
223
|
+
"@storybook/addon-docs": "^10.3.4",
|
|
224
|
+
"@storybook/addon-themes": "^10.3.4",
|
|
225
|
+
"@storybook/react-vite": "^10.3.4",
|
|
202
226
|
"@testing-library/jest-dom": "^6.9.1",
|
|
203
227
|
"@types/jest": "30.0.0",
|
|
204
228
|
"@types/node": "^24.10.1",
|
|
@@ -206,7 +230,7 @@
|
|
|
206
230
|
"@types/react-dom": "17.0.25",
|
|
207
231
|
"change-case": "^5.4.4",
|
|
208
232
|
"eslint": "9.39.3",
|
|
209
|
-
"eslint-plugin-storybook": "^10.3.
|
|
233
|
+
"eslint-plugin-storybook": "^10.3.4",
|
|
210
234
|
"husky": "^9.1.7",
|
|
211
235
|
"jest": "30.3.0",
|
|
212
236
|
"jest-environment-jsdom": "^30.3.0",
|
|
@@ -227,13 +251,13 @@
|
|
|
227
251
|
"rollup-plugin-esbuild": "6.2.1",
|
|
228
252
|
"rollup-plugin-import-css": "^4.2.0",
|
|
229
253
|
"rollup-plugin-node-externals": "8.1.2",
|
|
230
|
-
"storybook": "^10.3.
|
|
254
|
+
"storybook": "^10.3.4",
|
|
231
255
|
"style-dictionary": "^5.4.0",
|
|
232
|
-
"ts-jest": "29.4.
|
|
256
|
+
"ts-jest": "29.4.9",
|
|
233
257
|
"tslib": "2.8.1",
|
|
234
258
|
"typescript": "5.1.3",
|
|
235
|
-
"vite": "^8.0.
|
|
236
|
-
"vite-plugin-svgr": "^5.
|
|
259
|
+
"vite": "^8.0.5",
|
|
260
|
+
"vite-plugin-svgr": "^5.2.0"
|
|
237
261
|
},
|
|
238
262
|
"peerDependencies": {
|
|
239
263
|
"@emotion/react": ">=11.11.4 <=11.14.0",
|