@guardian/stand 0.0.19 → 0.0.21

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.
Files changed (59) hide show
  1. package/dist/TopBar.cjs +2 -0
  2. package/dist/TopBar.js +1 -1
  3. package/dist/components/form/Form.cjs +47 -0
  4. package/dist/components/form/Form.js +17 -0
  5. package/dist/components/form/styles.cjs +49 -0
  6. package/dist/components/form/styles.js +35 -0
  7. package/dist/components/form/types.cjs +7 -0
  8. package/dist/components/form/types.js +5 -0
  9. package/dist/components/menu/Menu.cjs +1 -7
  10. package/dist/components/menu/Menu.js +1 -9
  11. package/dist/components/menu/styles.cjs +25 -11
  12. package/dist/components/menu/styles.js +25 -11
  13. package/dist/components/select/Select.cjs +6 -15
  14. package/dist/components/select/Select.js +5 -5
  15. package/dist/components/select/styles.cjs +30 -55
  16. package/dist/components/select/styles.js +31 -53
  17. package/dist/components/text-input/TextInput.cjs +28 -0
  18. package/dist/components/text-input/TextInput.js +12 -0
  19. package/dist/components/text-input/styles.cjs +35 -0
  20. package/dist/components/text-input/styles.js +32 -0
  21. package/dist/form.cjs +7 -0
  22. package/dist/form.js +1 -0
  23. package/dist/index.cjs +4 -0
  24. package/dist/index.js +2 -0
  25. package/dist/styleD/build/css/component/form.css +28 -0
  26. package/dist/styleD/build/css/component/menu.css +2 -0
  27. package/dist/styleD/build/css/component/select.css +37 -46
  28. package/dist/styleD/build/css/component/textInput.css +29 -0
  29. package/dist/styleD/build/typescript/component/form.cjs +57 -0
  30. package/dist/styleD/build/typescript/component/form.js +55 -0
  31. package/dist/styleD/build/typescript/component/menu.cjs +5 -1
  32. package/dist/styleD/build/typescript/component/menu.js +5 -1
  33. package/dist/styleD/build/typescript/component/select.cjs +50 -69
  34. package/dist/styleD/build/typescript/component/select.js +50 -69
  35. package/dist/styleD/build/typescript/component/textInput.cjs +45 -0
  36. package/dist/styleD/build/typescript/component/textInput.js +43 -0
  37. package/dist/text-input.cjs +9 -0
  38. package/dist/text-input.js +2 -0
  39. package/dist/types/TopBar.d.ts +1 -1
  40. package/dist/types/components/form/Form.d.ts +5 -0
  41. package/dist/types/components/form/styles.d.ts +15 -0
  42. package/dist/types/components/form/types.d.ts +40 -0
  43. package/dist/types/components/menu/styles.d.ts +1 -1
  44. package/dist/types/components/select/Select.d.ts +1 -1
  45. package/dist/types/components/select/styles.d.ts +0 -3
  46. package/dist/types/components/select/types.d.ts +2 -14
  47. package/dist/types/components/text-input/TextInput.d.ts +2 -0
  48. package/dist/types/components/text-input/sandbox.d.ts +5 -0
  49. package/dist/types/components/text-input/styles.d.ts +7 -0
  50. package/dist/types/components/text-input/types.d.ts +4 -0
  51. package/dist/types/form.d.ts +8 -0
  52. package/dist/types/index.d.ts +4 -0
  53. package/dist/types/menu.d.ts +0 -1
  54. package/dist/types/styleD/build/typescript/component/form.d.ts +57 -0
  55. package/dist/types/styleD/build/typescript/component/menu.d.ts +4 -0
  56. package/dist/types/styleD/build/typescript/component/select.d.ts +46 -65
  57. package/dist/types/styleD/build/typescript/component/textInput.d.ts +45 -0
  58. package/dist/types/text-input.d.ts +20 -0
  59. package/package.json +30 -17
@@ -2,10 +2,7 @@
2
2
 
3
3
  const componentSelect = {
4
4
  shared: {
5
- display: "flex",
6
- flexDirection: "column",
7
- gap: "0.25rem",
8
- maxWidth: "333px",
5
+ maxWidth: "320px",
9
6
  width: "100%",
10
7
  hover: {
11
8
  backgroundColor: "#f6f6f6",
@@ -13,75 +10,59 @@ const componentSelect = {
13
10
  },
14
11
  pressed: {
15
12
  backgroundColor: "#ededed"
16
- }
17
- },
18
- label: {
19
- color: "#000000",
20
- typography: {
21
- font: "normal 700 1rem/1.15 Open Sans",
22
- letterSpacing: "-0.03125rem",
23
- fontWidth: 95
24
- }
25
- },
26
- helpText: {
27
- color: "#545454",
28
- typography: {
29
- font: "normal 460 0.875rem/1.3 Open Sans",
30
- letterSpacing: "0rem",
31
- fontWidth: 95
32
- }
33
- },
34
- button: {
35
- display: "flex",
36
- justifyContent: "space-between",
37
- alignItems: "center",
38
- marginTop: "0.25rem",
39
- backgroundColor: "#ffffff",
40
- border: "0.0625rem solid #545454",
41
- borderRadius: "0.25rem",
42
- height: "2.5rem",
43
- paddingLeft: "0.75rem",
44
- paddingRight: "0.25rem",
45
- color: "#545454",
46
- typography: {
47
- font: "normal 460 1rem/1.3 Open Sans",
48
- letterSpacing: "0rem",
49
- fontWidth: 95
50
- },
51
- focused: {
52
- outline: "0.125rem solid #0072a9",
53
- "outline-offset": "0.125rem"
54
13
  },
55
- disabled: {
14
+ button: {
15
+ display: "flex",
16
+ justifyContent: "space-between",
17
+ alignItems: "center",
18
+ marginTop: "0.25rem",
56
19
  backgroundColor: "#ffffff",
57
- cursor: "not-allowed",
58
- color: "#999999",
59
- border: "0.0625rem solid #dcdcdc"
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
+ }
60
44
  },
61
- error: {
62
- border: "0.0625rem solid #b42a19"
63
- }
64
- },
65
- option: {
66
- paddingLeft: "1rem",
67
- paddingRight: "1rem",
68
- paddingTop: "0.75rem",
69
- paddingBottom: "0.75rem",
70
- focused: {
71
- outline: "0.125rem solid #0072a9",
72
- "outline-offset": "0",
73
- backgroundColor: "inherit"
74
- }
75
- },
76
- listBox: {
77
- typography: {
78
- font: "normal 460 1rem/1.3 Open Sans",
79
- letterSpacing: "0rem",
80
- fontWidth: 95
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
+ }
81
55
  },
82
- border: "0.0625rem solid #cccccc",
83
- backgroundColor: "#ffffff",
84
- shadow: "0 0.125rem 0.375rem 0 rgb(0% 0% 0% / 0.3)"
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
+ }
85
66
  }
86
67
  };
87
68
 
@@ -1,9 +1,6 @@
1
1
  const componentSelect = {
2
2
  shared: {
3
- display: "flex",
4
- flexDirection: "column",
5
- gap: "0.25rem",
6
- maxWidth: "333px",
3
+ maxWidth: "320px",
7
4
  width: "100%",
8
5
  hover: {
9
6
  backgroundColor: "#f6f6f6",
@@ -11,75 +8,59 @@ const componentSelect = {
11
8
  },
12
9
  pressed: {
13
10
  backgroundColor: "#ededed"
14
- }
15
- },
16
- label: {
17
- color: "#000000",
18
- typography: {
19
- font: "normal 700 1rem/1.15 Open Sans",
20
- letterSpacing: "-0.03125rem",
21
- fontWidth: 95
22
- }
23
- },
24
- helpText: {
25
- color: "#545454",
26
- typography: {
27
- font: "normal 460 0.875rem/1.3 Open Sans",
28
- letterSpacing: "0rem",
29
- fontWidth: 95
30
- }
31
- },
32
- button: {
33
- display: "flex",
34
- justifyContent: "space-between",
35
- alignItems: "center",
36
- marginTop: "0.25rem",
37
- backgroundColor: "#ffffff",
38
- border: "0.0625rem solid #545454",
39
- borderRadius: "0.25rem",
40
- height: "2.5rem",
41
- paddingLeft: "0.75rem",
42
- paddingRight: "0.25rem",
43
- color: "#545454",
44
- typography: {
45
- font: "normal 460 1rem/1.3 Open Sans",
46
- letterSpacing: "0rem",
47
- fontWidth: 95
48
- },
49
- focused: {
50
- outline: "0.125rem solid #0072a9",
51
- "outline-offset": "0.125rem"
52
11
  },
53
- disabled: {
12
+ button: {
13
+ display: "flex",
14
+ justifyContent: "space-between",
15
+ alignItems: "center",
16
+ marginTop: "0.25rem",
54
17
  backgroundColor: "#ffffff",
55
- cursor: "not-allowed",
56
- color: "#999999",
57
- border: "0.0625rem solid #dcdcdc"
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
+ }
58
42
  },
59
- error: {
60
- border: "0.0625rem solid #b42a19"
61
- }
62
- },
63
- option: {
64
- paddingLeft: "1rem",
65
- paddingRight: "1rem",
66
- paddingTop: "0.75rem",
67
- paddingBottom: "0.75rem",
68
- focused: {
69
- outline: "0.125rem solid #0072a9",
70
- "outline-offset": "0",
71
- backgroundColor: "inherit"
72
- }
73
- },
74
- listBox: {
75
- typography: {
76
- font: "normal 460 1rem/1.3 Open Sans",
77
- letterSpacing: "0rem",
78
- fontWidth: 95
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
+ }
79
53
  },
80
- border: "0.0625rem solid #cccccc",
81
- backgroundColor: "#ffffff",
82
- shadow: "0 0.125rem 0.375rem 0 rgb(0% 0% 0% / 0.3)"
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
+ }
83
64
  }
84
65
  };
85
66
 
@@ -0,0 +1,45 @@
1
+ 'use strict';
2
+
3
+ const componentTextInput = {
4
+ shared: {
5
+ color: "#000000",
6
+ cursor: "text",
7
+ padding: {
8
+ top: "0",
9
+ right: "0.75rem",
10
+ bottom: "0",
11
+ left: "0.75rem"
12
+ },
13
+ "margin-top": "0.5rem",
14
+ "border-radius": "0.25rem",
15
+ border: "0.0625rem solid #545454",
16
+ "background-color": "#ffffff",
17
+ disabled: {
18
+ backgroundColor: "#ffffff",
19
+ cursor: "not-allowed",
20
+ color: "#999999",
21
+ border: "0.0625rem solid #dcdcdc"
22
+ },
23
+ error: {
24
+ border: "0.0625rem solid #b42a19"
25
+ }
26
+ },
27
+ sm: {
28
+ height: "2rem",
29
+ typography: {
30
+ font: "normal 460 0.875rem/1.3 Open Sans",
31
+ letterSpacing: "0rem",
32
+ fontWidth: 95
33
+ }
34
+ },
35
+ md: {
36
+ height: "2.5rem",
37
+ typography: {
38
+ font: "normal 460 1rem/1.3 Open Sans",
39
+ letterSpacing: "0rem",
40
+ fontWidth: 95
41
+ }
42
+ }
43
+ };
44
+
45
+ exports.componentTextInput = componentTextInput;
@@ -0,0 +1,43 @@
1
+ const componentTextInput = {
2
+ shared: {
3
+ color: "#000000",
4
+ cursor: "text",
5
+ padding: {
6
+ top: "0",
7
+ right: "0.75rem",
8
+ bottom: "0",
9
+ left: "0.75rem"
10
+ },
11
+ "margin-top": "0.5rem",
12
+ "border-radius": "0.25rem",
13
+ border: "0.0625rem solid #545454",
14
+ "background-color": "#ffffff",
15
+ disabled: {
16
+ backgroundColor: "#ffffff",
17
+ cursor: "not-allowed",
18
+ color: "#999999",
19
+ border: "0.0625rem solid #dcdcdc"
20
+ },
21
+ error: {
22
+ border: "0.0625rem solid #b42a19"
23
+ }
24
+ },
25
+ sm: {
26
+ height: "2rem",
27
+ typography: {
28
+ font: "normal 460 0.875rem/1.3 Open Sans",
29
+ letterSpacing: "0rem",
30
+ fontWidth: 95
31
+ }
32
+ },
33
+ md: {
34
+ height: "2.5rem",
35
+ typography: {
36
+ font: "normal 460 1rem/1.3 Open Sans",
37
+ letterSpacing: "0rem",
38
+ fontWidth: 95
39
+ }
40
+ }
41
+ };
42
+
43
+ export { componentTextInput };
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var TextInput = require('./components/text-input/TextInput.cjs');
4
+ var textInput = require('./styleD/build/typescript/component/textInput.cjs');
5
+
6
+
7
+
8
+ exports.TextInput = TextInput.TextInput;
9
+ exports.componentTextInput = textInput.componentTextInput;
@@ -0,0 +1,2 @@
1
+ export { TextInput } from './components/text-input/TextInput.js';
2
+ export { componentTextInput } from './styleD/build/typescript/component/textInput.js';
@@ -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];
@@ -13,7 +13,7 @@ export declare const menuSectionHeaderStyles: (theme: MenuSectionTheme, { size }
13
13
  export type MenuItemTheme = Prettify<ComponentMenu['menuItem']>;
14
14
  export type PartialMenuItemTheme = DeepPartial<MenuItemTheme>;
15
15
  export declare const defaultMenuItemTheme: MenuItemTheme;
16
- export declare const menuItemStyles: (theme: MenuItemTheme, { description }: Pick<MenuItemProps, 'description'>, isFocusVisible?: boolean) => SerializedStyles;
16
+ export declare const menuItemStyles: (theme: MenuItemTheme, { description }: Pick<MenuItemProps, 'description'>) => SerializedStyles;
17
17
  export declare const menuItemIconStyles: (theme: MenuItemTheme, { size }: Required<Pick<MenuItemProps, 'size'>>) => SerializedStyles;
18
18
  export declare const menuItemLabelStyles: (theme: MenuItemTheme) => SerializedStyles;
19
19
  export declare const menuItemDescriptionStyles: (theme: MenuItemTheme) => SerializedStyles;
@@ -1,3 +1,3 @@
1
1
  import type { OptionProps, SelectProps } from './types';
2
2
  export declare function Option({ children, theme }: OptionProps): import("@emotion/react/jsx-runtime").JSX.Element;
3
- export declare function Select({ children, label, contextualHelpText, theme, cssOverrides, className, isInvalid, errorMessage, ...props }: SelectProps): import("@emotion/react/jsx-runtime").JSX.Element;
3
+ export declare function Select({ isInvalid, theme, children, ...props }: SelectProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -4,10 +4,7 @@ import type { DeepPartial, Prettify } from '../../util/types';
4
4
  export type SelectTheme = Prettify<ComponentSelect>;
5
5
  export type PartialSelectTheme = DeepPartial<SelectTheme>;
6
6
  export declare const defaultSelectTheme: SelectTheme;
7
- export declare const selectStyles: (theme: SelectTheme) => SerializedStyles;
8
7
  export declare const popoverStyles: (theme: SelectTheme) => SerializedStyles;
9
8
  export declare const listBoxItemStyles: (theme: SelectTheme) => SerializedStyles;
10
9
  export declare const listBoxStyles: (theme: SelectTheme) => SerializedStyles;
11
- export declare const labelStyles: (theme: SelectTheme) => SerializedStyles;
12
- export declare const helpTextStyles: (theme: SelectTheme) => SerializedStyles;
13
10
  export declare const buttonStyles: (theme: SelectTheme, isInvalid?: boolean) => SerializedStyles;
@@ -1,21 +1,9 @@
1
1
  import type { ListBoxItemProps as RACListBoxItemProps, ListBoxProps as RACListBoxProps, SelectProps as RACSelectProps } from 'react-aria-components';
2
2
  import type { DefaultPropsWithChildren } from '../../util/types';
3
+ import type { FormInputContainerDefaultProps } from '../form/types';
3
4
  import type { SelectTheme } from './styles';
4
5
  export interface OptionProps extends DefaultPropsWithChildren<SelectTheme, RACListBoxItemProps['className']>, Omit<RACListBoxItemProps, 'children'> {
5
6
  }
6
7
  export interface ListBoxProps extends DefaultPropsWithChildren<SelectTheme, RACListBoxProps<object>['className']>, Omit<RACListBoxProps<object>, 'children'> {
7
8
  }
8
- export interface SelectProps extends DefaultPropsWithChildren<SelectTheme, RACSelectProps<object>['className']>, Omit<RACSelectProps<object>, 'children'> {
9
- /**
10
- * The label text of the select box
11
- */
12
- label: string;
13
- /**
14
- * Validation error message
15
- */
16
- errorMessage?: string;
17
- /**
18
- * Optional contextual help text
19
- */
20
- contextualHelpText?: string;
21
- }
9
+ export type SelectProps = FormInputContainerDefaultProps<RACSelectProps<object, 'single' | 'multiple'>, SelectTheme>;
@@ -0,0 +1,2 @@
1
+ import type { TextInputProps } from './types';
2
+ export declare function TextInput({ size, isInvalid, theme, ...props }: TextInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export declare const componentName = "TextInput";
2
+ export declare const componentTsx = "import { TextInput } from '@guardian/stand/text-input';\n\nexport const Component = () => (\n\t<>\n\t\t<TextInput\n\t\t\tlabel=\"Name\"\n\t\t\tdescription=\"This is a description for the text input.\"\n\t\t/>\n\n\t\t<TextInput\n\t\t\tsize=\"sm\"\n\t\t\tlabel=\"Username\"\n\t\t\tisInvalid\n\t\t\tdefaultValue=\"guardian_user\"\n\t\t\terror=\"Username is already taken\"\n\t\t/>\n\n\t\t<TextInput\n\t\t\tlabel=\"Password\"\n\t\t\tdescription=\"Showing a different type\"\n\t\t\ttype=\"password\"\n\t\t/>\n\n\t\t<TextInput label=\"Notes\" isDisabled defaultValue=\"Read only content\" />\n\t</>\n);\n";
3
+ export declare const componentCss = "\n/* import the text input, form, inline message styles */\n@import '@guardian/stand/component/inlineMessage.css';\n@import '@guardian/stand/component/form.css';\n@import '@guardian/stand/component/textInput.css';\n\n/* inline message styles - error */\n.stand-inline-message {\n display: var(--component-inline-message-shared-display);\n align-items: var(--component-inline-message-shared-align-items);\n gap: var(--component-inline-message-shared-gap);\n font: var(--component-inline-message-shared-typography-font);\n letter-spacing: var(\n --component-inline-message-shared-typography-letter-spacing\n );\n font-variation-settings: \"wdth\"\n var(--component-inline-message-shared-typography-font-width);\n}\n\n.stand-inline-message > .material-symbols {\n font-size: var(--component-inline-message-shared-icon-size);\n}\n\n.stand-inline-message > svg {\n width: var(--component-inline-message-shared-icon-size);\n height: var(--component-inline-message-shared-icon-size);\n}\n\n.stand-inline-message-error {\n color: var(--component-inline-message-error-color);\n fill: var(--component-inline-message-error-color);\n}\n\n/* form input container styles */\n\n.stand-form-input-container {\n\tdisplay: var(--component-form-input-shared-container-display);\n\tflex-direction: var(--component-form-input-shared-container-flex-direction);\n\tgap: var(--component-form-input-shared-container-gap);\n\twidth: var(--component-form-input-shared-container-width);\n}\n\n.stand-form-input-container.sm {\n\tmax-width: var(--component-form-input-sm-container-max-width);\n}\n\n.stand-form-input-container.md {\n\tmax-width: var(--component-form-input-md-container-max-width);\n}\n\n.stand-form-input-container > label {\n\tcolor: var(--component-form-input-shared-label-color);\n\tfont: var(--component-form-input-md-label-typography-font);\n\tletter-spacing: var(--component-form-input-md-label-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-form-input-md-label-typography-font-width);\n}\n\n.stand-form-input-container[data-disabled] > label {\n\tcolor: var(--component-form-input-shared-label-disabled-color);\n}\n\n.stand-form-input-container > span.description {\n\tcolor: var(--component-form-input-shared-description-color);\n\tfont: var(--component-form-input-shared-description-typography-font);\n\tletter-spacing: var(--component-form-input-shared-description-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-form-input-shared-description-typography-font-width);\n}\n\n.stand-form-input-container[data-disabled] > span.description {\n\tcolor: var(--component-form-input-shared-description-disabled-color);\n}\n\n/* text input styles */\n\n.stand-text-input {\n\tbackground-color: var(--component-text-input-shared-background-color);\n\tborder-radius: var(--component-text-input-shared-border-radius);\n\tborder: var(--component-text-input-shared-border);\n\tcolor: var(--component-text-input-shared-color);\n\tcursor: var(--component-text-input-shared-cursor);\n\tmargin-top: var(--component-text-input-shared-margin-top);\n\tpadding-top: var(--component-text-input-shared-padding-top);\n\tpadding-right: var(--component-text-input-shared-padding-right);\n\tpadding-bottom: var(--component-text-input-shared-padding-bottom);\n\tpadding-left: var(--component-text-input-shared-padding-left);\n}\n\n.stand-text-input[disabled] {\n\tbackground-color: var(--component-text-input-shared-disabled-background-color);\n\tborder: var(--component-text-input-shared-disabled-border);\n\tcolor: var(--component-text-input-shared-disabled-color);\n\tcursor: var(--component-text-input-shared-disabled-cursor);\n}\n\n.stand-text-input[data-invalid] {\n\tborder: var(--component-text-input-shared-error-border);\n}\n\n.stand-text-input.md {\n\theight: var(--component-text-input-md-height);\n\tfont: var(--component-text-input-md-typography-font);\n\tletter-spacing: var(--component-text-input-md-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-text-input-md-typography-font-width);\n}\n\n.stand-text-input.sm {\n\theight: var(--component-text-input-sm-height);\n\tfont: var(--component-text-input-sm-typography-font);\n\tletter-spacing: var(--component-text-input-sm-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-text-input-sm-typography-font-width);\n}\n";
4
+ export declare const componentHtml = "<div class=\"container flow-column\">\n\t<div class=\"stand-form-input-container md\">\n\t\t<label for=\"name\">Name</label>\n\t\t<span class=\"description\">This is a description for the text input.</span>\n\t\t<input id=\"name\" class=\"stand-text-input md\" type=\"text\" />\n\t</div>\n\t<div class=\"stand-form-input-container sm\">\n\t\t<label for=\"username\">Username</label>\n\t\t<input\n\t\t\tid=\"username\"\n\t\t\tclass=\"stand-text-input sm\"\n\t\t\ttype=\"text\"\n\t\t\tvalue=\"guardian_user\"\n\t\t\tdata-invalid\n\t\t/>\n\t\t<span class=\"stand-inline-message stand-inline-message-error\"><span class=\"material-symbols\">warning</span> Username is already taken</span>\n\t</div>\n\t<div class=\"stand-form-input-container md\">\n\t\t<label for=\"password\">Password</label>\n\t\t<span class=\"description\">Showing a different type</span>\n\t\t<input id=\"password\" class=\"stand-text-input md\" type=\"password\" />\n\t</div>\n\t<div class=\"stand-form-input-container md\" data-disabled>\n\t\t<label for=\"notes\">Notes</label>\n\t\t<input\n\t\t\tid=\"notes\"\n\t\t\tclass=\"stand-text-input md\"\n\t\t\ttype=\"text\"\n\t\t\tvalue=\"Read only content\"\n\t\t\tdisabled\n\t\t/>\n\t</div>\n</div>\n";
5
+ export declare const componentJs = "\nimport { componentTextInput, componentForm, componentInlineMessage } 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/* inline message styles - error */\n.js-stand-inline-message {\n display: ${componentInlineMessage.shared.display};\n align-items: ${componentInlineMessage.shared['align-items']};\n gap: ${componentInlineMessage.shared.gap};\n font: ${componentInlineMessage.shared.typography.font};\n letter-spacing: ${componentInlineMessage.shared.typography.letterSpacing};\n font-variation-settings: \"wdth\" ${componentInlineMessage.shared.typography.fontWidth};\n}\n\n.js-stand-inline-message > .material-symbols {\n font-size: ${componentInlineMessage.shared.icon.size};\n}\n\n.js-stand-inline-message > svg {\n width: ${componentInlineMessage.shared.icon.size};\n height: ${componentInlineMessage.shared.icon.size};\n}\n\n.js-stand-inline-message-error {\n color: ${componentInlineMessage.error.color};\n fill: ${componentInlineMessage.error.color};\n}\n\n/* form input container styles */\n\n.js-stand-form-input-container {\n\tdisplay: ${componentForm.input.shared.container.display};\n\tflex-direction: ${componentForm.input.shared.container['flex-direction']};\n\tgap: ${componentForm.input.shared.container.gap};\n\twidth: ${componentForm.input.shared.container.width};\n}\n\n.js-stand-form-input-container.sm {\n\tmax-width: ${componentForm.input.sm.container['max-width']};\n}\n\n.js-stand-form-input-container.md {\n\tmax-width: ${componentForm.input.md.container['max-width']};\n}\n\n.js-stand-form-input-container > label {\n\tcolor: ${componentForm.input.shared.label.color};\n\tfont: ${componentForm.input.md.label.typography.font};\n\tletter-spacing: ${componentForm.input.md.label.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentForm.input.md.label.typography.fontWidth};\n}\n\n.js-stand-form-input-container[data-disabled] > label {\n\tcolor: ${componentForm.input.shared.label.disabled.color};\n}\n\n.js-stand-form-input-container > span.description {\n\tcolor: ${componentForm.input.shared.description.color};\n\tfont: ${componentForm.input.shared.description.typography.font};\n\tletter-spacing: ${componentForm.input.shared.description.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentForm.input.shared.description.typography.fontWidth};\n}\n\n.js-stand-form-input-container[data-disabled] > span.description {\n\tcolor: ${componentForm.input.shared.description.disabled.color};\n}\n\n/* text input styles */\n\n.js-stand-text-input {\n\tbackground-color: ${componentTextInput.shared['background-color']};\n\tborder-radius: ${componentTextInput.shared['border-radius']};\n\tborder: ${componentTextInput.shared.border};\n\tcolor: ${componentTextInput.shared.color};\n\tcursor: ${componentTextInput.shared.cursor};\n\tmargin-top: ${componentTextInput.shared['margin-top']};\n\tpadding-top: ${componentTextInput.shared.padding.top};\n\tpadding-right: ${componentTextInput.shared.padding.right};\n\tpadding-bottom: ${componentTextInput.shared.padding.bottom};\n\tpadding-left: ${componentTextInput.shared.padding.left};\n}\n\n.js-stand-text-input[disabled] {\n\tbackground-color: ${componentTextInput.shared.disabled.backgroundColor};\n\tborder: ${componentTextInput.shared.disabled.border};\n\tcolor: ${componentTextInput.shared.disabled.color};\n\tcursor: ${componentTextInput.shared.disabled.cursor};\n}\n\n.js-stand-text-input[data-invalid] {\n\tborder: ${componentTextInput.shared.errorBorder};\n}\n\n.js-stand-text-input.md {\n\theight: ${componentTextInput.md.height};\n\tfont: ${componentTextInput.md.typography.font};\n\tletter-spacing: ${componentTextInput.md.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentTextInput.md.typography.fontWidth};\n}\n\n.js-stand-text-input.sm {\n\theight: ${componentTextInput.sm.height};\n\tfont: ${componentTextInput.sm.typography.font};\n\tletter-spacing: ${componentTextInput.sm.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentTextInput.sm.typography.fontWidth};\n}\n`);\n\n// update the document with the sheet\ndocument.adoptedStyleSheets.push(sheet);\n\n// modify the dom with the button components using the generated stylesheet\ndocument.getElementById(\"app\").innerHTML = `\n<div class=\"container flow-column\">\n\t<div class=\"js-stand-form-input-container md\">\n\t\t<label for=\"name\">Name</label>\n\t\t<span class=\"description\">This is a description for the text input.</span>\n\t\t<input id=\"name\" class=\"js-stand-text-input md\" type=\"text\" />\n\t</div>\n\t<div class=\"js-stand-form-input-container sm\">\n\t\t<label for=\"username\">Username</label>\n\t\t<input\n\t\t\tid=\"username\"\n\t\t\tclass=\"js-stand-text-input sm\"\n\t\t\ttype=\"text\"\n\t\t/>\n\t\t<span class=\"js-stand-inline-message js-stand-inline-message-error\"><span class=\"material-symbols\">warning</span> Username is already taken</span>\n\t</div>\n\t<div class=\"js-stand-form-input-container md\">\n\t\t<label for=\"password\">Password</label>\n\t\t<span class=\"description\">Showing a different type</span>\n\t\t<input id=\"password\" class=\"js-stand-text-input md\" type=\"password\" />\n\t</div>\n\t<div class=\"js-stand-form-input-container md\" data-disabled>\n\t\t<label for=\"notes\">Notes</label>\n\t\t<input\n\t\t\tid=\"notes\"\n\t\t\tclass=\"js-stand-text-input md\"\n\t\t\ttype=\"text\"\n\t\t\tvalue=\"Read only content\"\n\t\t\tdisabled\n\t\t />\n\t</div>\n</div>\n`;\n";
@@ -0,0 +1,7 @@
1
+ import type { SerializedStyles } from '@emotion/react';
2
+ import type { ComponentTextInput } from '../../styleD/build/typescript/component/textInput';
3
+ import type { Prettify } from '../../util/types';
4
+ import type { TextInputProps } from './types';
5
+ export type TextInputTheme = Prettify<ComponentTextInput>;
6
+ export declare const defaultTextInputTheme: TextInputTheme;
7
+ export declare const textInputStyles: (theme: TextInputTheme, { size, isInvalid }: Required<Pick<TextInputProps, 'size' | 'isInvalid'>>) => SerializedStyles;
@@ -0,0 +1,4 @@
1
+ import type { TextFieldProps as RACTextInputProps } from 'react-aria-components';
2
+ import type { FormInputContainerDefaultProps } from '../form/types';
3
+ import type { TextInputTheme } from './styles';
4
+ export type TextInputProps = FormInputContainerDefaultProps<RACTextInputProps, TextInputTheme>;
@@ -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';
@@ -26,6 +26,8 @@ export { componentIcon } from './styleD/build/typescript/component/icon';
26
26
  export type { ComponentIcon } from './styleD/build/typescript/component/icon';
27
27
  export { componentFavicon } from './styleD/build/typescript/component/favicon';
28
28
  export type { ComponentFavicon } from './styleD/build/typescript/component/favicon';
29
+ export { componentTextInput } from './styleD/build/typescript/component/textInput';
30
+ export type { ComponentTextInput } from './styleD/build/typescript/component/textInput';
29
31
  export { componentInlineMessage } from './styleD/build/typescript/component/inlineMessage';
30
32
  export type { ComponentInlineMessage } from './styleD/build/typescript/component/inlineMessage';
31
33
  export { componentSelect } from './styleD/build/typescript/component/select';
@@ -34,6 +36,8 @@ export { componentMenu } from './styleD/build/typescript/component/menu';
34
36
  export type { ComponentMenu } from './styleD/build/typescript/component/menu';
35
37
  export { componentTopBar } from './styleD/build/typescript/component/TopBar';
36
38
  export type { ComponentTopBar } from './styleD/build/typescript/component/TopBar';
39
+ export { componentForm } from './styleD/build/typescript/component/form';
40
+ export type { ComponentForm } from './styleD/build/typescript/component/form';
37
41
  /**
38
42
  * style dictionary exports - base
39
43
  */
@@ -7,7 +7,6 @@
7
7
  * - `react-dom`
8
8
  * - `typescript`
9
9
  * - `react-aria-components`
10
- * - `@react-aria/focus`
11
10
  *
12
11
  * See the `peerDependencies` section of package.json for compatible versions.
13
12
  *
@@ -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;