@guardian/stand 0.0.23 → 0.0.25

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 (58) hide show
  1. package/dist/components/menu/styles.cjs +0 -1
  2. package/dist/components/menu/styles.js +0 -1
  3. package/dist/components/text-area/TextArea.cjs +35 -0
  4. package/dist/components/text-area/TextArea.js +12 -0
  5. package/dist/components/text-area/styles.cjs +47 -0
  6. package/dist/components/text-area/styles.js +44 -0
  7. package/dist/components/text-input/TextInput.cjs +8 -1
  8. package/dist/components/text-input/TextInput.js +2 -2
  9. package/dist/components/text-input/styles.cjs +12 -0
  10. package/dist/components/text-input/styles.js +12 -0
  11. package/dist/components/topbar/TopBar.cjs +23 -9
  12. package/dist/components/topbar/TopBar.js +11 -9
  13. package/dist/components/topbar/topBarToolName/styles.cjs +1 -0
  14. package/dist/components/topbar/topBarToolName/styles.js +1 -0
  15. package/dist/index.cjs +2 -0
  16. package/dist/index.js +1 -0
  17. package/dist/styleD/build/css/component/TopBar.css +1 -0
  18. package/dist/styleD/build/css/component/radioGroup.css +1 -1
  19. package/dist/styleD/build/css/component/textArea.css +30 -0
  20. package/dist/styleD/build/css/component/textInput.css +2 -0
  21. package/dist/styleD/build/typescript/component/TopBar.cjs +1 -0
  22. package/dist/styleD/build/typescript/component/TopBar.js +1 -0
  23. package/dist/styleD/build/typescript/component/radioGroup.cjs +1 -1
  24. package/dist/styleD/build/typescript/component/radioGroup.js +1 -1
  25. package/dist/styleD/build/typescript/component/textArea.cjs +48 -0
  26. package/dist/styleD/build/typescript/component/textArea.js +46 -0
  27. package/dist/styleD/build/typescript/component/textInput.cjs +4 -0
  28. package/dist/styleD/build/typescript/component/textInput.js +4 -0
  29. package/dist/text-area.cjs +9 -0
  30. package/dist/text-area.js +2 -0
  31. package/dist/types/components/avatar/styles.d.ts +1 -1
  32. package/dist/types/components/button/styles.d.ts +1 -1
  33. package/dist/types/components/byline/theme.d.ts +2 -2
  34. package/dist/types/components/checkbox/styles.d.ts +2 -2
  35. package/dist/types/components/favicon/styles.d.ts +1 -1
  36. package/dist/types/components/icon/styles.d.ts +1 -1
  37. package/dist/types/components/menu/styles.d.ts +5 -5
  38. package/dist/types/components/select/styles.d.ts +1 -1
  39. package/dist/types/components/text-area/TextArea.d.ts +2 -0
  40. package/dist/types/components/text-area/sandbox.d.ts +5 -0
  41. package/dist/types/components/text-area/styles.d.ts +7 -0
  42. package/dist/types/components/text-area/types.d.ts +7 -0
  43. package/dist/types/components/text-input/TextInput.d.ts +1 -1
  44. package/dist/types/components/text-input/types.d.ts +4 -1
  45. package/dist/types/components/topbar/TopBar.d.ts +5 -2
  46. package/dist/types/components/topbar/styles.d.ts +1 -1
  47. package/dist/types/components/topbar/topBarItem/styles.d.ts +1 -1
  48. package/dist/types/components/topbar/topBarNavigation/styles.d.ts +1 -1
  49. package/dist/types/components/topbar/topBarToolName/styles.d.ts +1 -1
  50. package/dist/types/components/typography/styles.d.ts +1 -1
  51. package/dist/types/components/user-menu/theme.d.ts +2 -2
  52. package/dist/types/index.d.ts +2 -0
  53. package/dist/types/styleD/build/typescript/component/TopBar.d.ts +1 -0
  54. package/dist/types/styleD/build/typescript/component/radioGroup.d.ts +1 -1
  55. package/dist/types/styleD/build/typescript/component/textArea.d.ts +48 -0
  56. package/dist/types/styleD/build/typescript/component/textInput.d.ts +4 -0
  57. package/dist/types/text-area.d.ts +20 -0
  58. package/package.json +11 -2
@@ -74,7 +74,6 @@ const menuItemLabelStyles = (theme) => react.css`
74
74
  grid-area: ${theme.shared.label["grid-area"]};
75
75
  color: ${theme.shared.label.color};
76
76
  ${typography.convertTypographyToEmotionStringStyle(theme.shared.label.typography)}
77
- )}
78
77
  `;
79
78
  const menuItemDescriptionStyles = (theme) => react.css`
80
79
  grid-area: ${theme.shared.description["grid-area"]};
@@ -72,7 +72,6 @@ const menuItemLabelStyles = (theme) => css`
72
72
  grid-area: ${theme.shared.label["grid-area"]};
73
73
  color: ${theme.shared.label.color};
74
74
  ${convertTypographyToEmotionStringStyle(theme.shared.label.typography)}
75
- )}
76
75
  `;
77
76
  const menuItemDescriptionStyles = (theme) => css`
78
77
  grid-area: ${theme.shared.description["grid-area"]};
@@ -0,0 +1,35 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('@emotion/react/jsx-runtime');
4
+ var reactAriaComponents = require('react-aria-components');
5
+ var mergeDeep = require('../../util/mergeDeep.cjs');
6
+ var Form = require('../form/Form.cjs');
7
+ var styles = require('./styles.cjs');
8
+
9
+ function TextArea({
10
+ size = "md",
11
+ isInvalid = false,
12
+ theme = {},
13
+ placeholder,
14
+ ...props
15
+ }) {
16
+ const mergedTheme = mergeDeep.mergeDeep(styles.defaultTextAreaTheme, theme);
17
+ return /* @__PURE__ */ jsxRuntime.jsx(
18
+ Form.FormInputContainer,
19
+ {
20
+ as: reactAriaComponents.TextField,
21
+ size,
22
+ isInvalid,
23
+ ...props,
24
+ children: /* @__PURE__ */ jsxRuntime.jsx(
25
+ reactAriaComponents.TextArea,
26
+ {
27
+ placeholder,
28
+ css: styles.textAreaStyles(mergedTheme, { size, isInvalid })
29
+ }
30
+ )
31
+ }
32
+ );
33
+ }
34
+
35
+ exports.TextArea = TextArea;
@@ -0,0 +1,12 @@
1
+ import { jsx } from '@emotion/react/jsx-runtime';
2
+ import { TextField, TextArea as TextArea$1 } from 'react-aria-components';
3
+ import { mergeDeep } from '../../util/mergeDeep.js';
4
+ import { FormInputContainer } from '../form/Form.js';
5
+ import { textAreaStyles, defaultTextAreaTheme } from './styles.js';
6
+
7
+ function TextArea({ size = "md", isInvalid = false, theme = {}, placeholder, ...props }) {
8
+ const mergedTheme = mergeDeep(defaultTextAreaTheme, theme);
9
+ return jsx(FormInputContainer, { as: TextField, size, isInvalid, ...props, children: jsx(TextArea$1, { placeholder, css: textAreaStyles(mergedTheme, { size, isInvalid }) }) });
10
+ }
11
+
12
+ export { TextArea };
@@ -0,0 +1,47 @@
1
+ 'use strict';
2
+
3
+ var react = require('@emotion/react');
4
+ var textArea = require('../../styleD/build/typescript/component/textArea.cjs');
5
+ var typography = require('../../styleD/utils/semantic/typography.cjs');
6
+
7
+ const defaultTextAreaTheme = textArea.componentTextArea;
8
+ const textAreaStyles = (theme, { size, isInvalid }) => {
9
+ return react.css`
10
+ ${typography.convertTypographyToEmotionStringStyle(theme[size].typography)}
11
+ background-color: ${theme.shared["background-color"]};
12
+ border-radius: ${theme.shared["border-radius"]};
13
+ border: ${theme.shared.border};
14
+ color: ${theme.shared.color};
15
+ cursor: ${theme.shared.cursor};
16
+ height: ${theme.shared.height};
17
+ margin-top: ${theme.shared["margin-top"]};
18
+ padding: ${theme.shared.padding.top} ${theme.shared.padding.right}
19
+ ${theme.shared.padding.bottom} ${theme.shared.padding.left};
20
+
21
+ ::placeholder {
22
+ color: ${theme.shared.placeholderColor};
23
+ }
24
+
25
+ &[data-disabled] {
26
+ background-color: ${theme.shared.disabled.backgroundColor};
27
+ border: ${theme.shared.disabled.border};
28
+ color: ${theme.shared.disabled.color};
29
+ cursor: ${theme.shared.disabled.cursor};
30
+
31
+ ::placeholder {
32
+ color: ${theme.shared.disabled.color};
33
+ }
34
+ }
35
+
36
+ &[data-focused] {
37
+ outline: ${theme.shared.focused.outline};
38
+ }
39
+
40
+ ${isInvalid && react.css`
41
+ border: ${theme.shared.error.border};
42
+ `}
43
+ `;
44
+ };
45
+
46
+ exports.defaultTextAreaTheme = defaultTextAreaTheme;
47
+ exports.textAreaStyles = textAreaStyles;
@@ -0,0 +1,44 @@
1
+ import { css } from '@emotion/react';
2
+ import { componentTextArea } from '../../styleD/build/typescript/component/textArea.js';
3
+ import { convertTypographyToEmotionStringStyle } from '../../styleD/utils/semantic/typography.js';
4
+
5
+ const defaultTextAreaTheme = componentTextArea;
6
+ const textAreaStyles = (theme, { size, isInvalid }) => {
7
+ return css`
8
+ ${convertTypographyToEmotionStringStyle(theme[size].typography)}
9
+ background-color: ${theme.shared["background-color"]};
10
+ border-radius: ${theme.shared["border-radius"]};
11
+ border: ${theme.shared.border};
12
+ color: ${theme.shared.color};
13
+ cursor: ${theme.shared.cursor};
14
+ height: ${theme.shared.height};
15
+ margin-top: ${theme.shared["margin-top"]};
16
+ padding: ${theme.shared.padding.top} ${theme.shared.padding.right}
17
+ ${theme.shared.padding.bottom} ${theme.shared.padding.left};
18
+
19
+ ::placeholder {
20
+ color: ${theme.shared.placeholderColor};
21
+ }
22
+
23
+ &[data-disabled] {
24
+ background-color: ${theme.shared.disabled.backgroundColor};
25
+ border: ${theme.shared.disabled.border};
26
+ color: ${theme.shared.disabled.color};
27
+ cursor: ${theme.shared.disabled.cursor};
28
+
29
+ ::placeholder {
30
+ color: ${theme.shared.disabled.color};
31
+ }
32
+ }
33
+
34
+ &[data-focused] {
35
+ outline: ${theme.shared.focused.outline};
36
+ }
37
+
38
+ ${isInvalid && css`
39
+ border: ${theme.shared.error.border};
40
+ `}
41
+ `;
42
+ };
43
+
44
+ export { defaultTextAreaTheme, textAreaStyles };
@@ -10,6 +10,7 @@ function TextInput({
10
10
  size = "md",
11
11
  isInvalid = false,
12
12
  theme = {},
13
+ placeholder,
13
14
  ...props
14
15
  }) {
15
16
  const mergedTheme = mergeDeep.mergeDeep(styles.defaultTextInputTheme, theme);
@@ -20,7 +21,13 @@ function TextInput({
20
21
  size,
21
22
  isInvalid,
22
23
  ...props,
23
- children: /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Input, { css: styles.textInputStyles(mergedTheme, { size, isInvalid }) })
24
+ children: /* @__PURE__ */ jsxRuntime.jsx(
25
+ reactAriaComponents.Input,
26
+ {
27
+ placeholder,
28
+ css: styles.textInputStyles(mergedTheme, { size, isInvalid })
29
+ }
30
+ )
24
31
  }
25
32
  );
26
33
  }
@@ -4,9 +4,9 @@ import { mergeDeep } from '../../util/mergeDeep.js';
4
4
  import { FormInputContainer } from '../form/Form.js';
5
5
  import { textInputStyles, defaultTextInputTheme } from './styles.js';
6
6
 
7
- function TextInput({ size = "md", isInvalid = false, theme = {}, ...props }) {
7
+ function TextInput({ size = "md", isInvalid = false, theme = {}, placeholder, ...props }) {
8
8
  const mergedTheme = mergeDeep(defaultTextInputTheme, theme);
9
- return jsx(FormInputContainer, { as: TextField, size, isInvalid, ...props, children: jsx(Input, { css: textInputStyles(mergedTheme, { size, isInvalid }) }) });
9
+ return jsx(FormInputContainer, { as: TextField, size, isInvalid, ...props, children: jsx(Input, { placeholder, css: textInputStyles(mergedTheme, { size, isInvalid }) }) });
10
10
  }
11
11
 
12
12
  export { TextInput };
@@ -18,11 +18,23 @@ const textInputStyles = (theme, { size, isInvalid }) => {
18
18
  padding: ${theme.shared.padding.top} ${theme.shared.padding.right}
19
19
  ${theme.shared.padding.bottom} ${theme.shared.padding.left};
20
20
 
21
+ ::placeholder {
22
+ color: ${theme.shared.placeholderColor};
23
+ }
24
+
21
25
  &[data-disabled] {
22
26
  background-color: ${theme.shared.disabled.backgroundColor};
23
27
  border: ${theme.shared.disabled.border};
24
28
  color: ${theme.shared.disabled.color};
25
29
  cursor: ${theme.shared.disabled.cursor};
30
+
31
+ ::placeholder {
32
+ color: ${theme.shared.disabled.color};
33
+ }
34
+ }
35
+
36
+ &[data-focused] {
37
+ outline: ${theme.shared.focused.outline};
26
38
  }
27
39
 
28
40
  ${isInvalid && react.css`
@@ -16,11 +16,23 @@ const textInputStyles = (theme, { size, isInvalid }) => {
16
16
  padding: ${theme.shared.padding.top} ${theme.shared.padding.right}
17
17
  ${theme.shared.padding.bottom} ${theme.shared.padding.left};
18
18
 
19
+ ::placeholder {
20
+ color: ${theme.shared.placeholderColor};
21
+ }
22
+
19
23
  &[data-disabled] {
20
24
  background-color: ${theme.shared.disabled.backgroundColor};
21
25
  border: ${theme.shared.disabled.border};
22
26
  color: ${theme.shared.disabled.color};
23
27
  cursor: ${theme.shared.disabled.cursor};
28
+
29
+ ::placeholder {
30
+ color: ${theme.shared.disabled.color};
31
+ }
32
+ }
33
+
34
+ &[data-focused] {
35
+ outline: ${theme.shared.focused.outline};
24
36
  }
25
37
 
26
38
  ${isInvalid && css`
@@ -11,7 +11,8 @@ var TopBarToolName = require('./topBarToolName/TopBarToolName.cjs');
11
11
 
12
12
  function TopBarSide({
13
13
  children,
14
- alignment
14
+ alignment,
15
+ theme
15
16
  }) {
16
17
  const items = [];
17
18
  React.Children.forEach(children, (child, i) => {
@@ -22,6 +23,7 @@ function TopBarSide({
22
23
  items.push(
23
24
  React.cloneElement(child, {
24
25
  key: `${child.key}-${i}`,
26
+ theme: theme?.Item,
25
27
  alignment
26
28
  })
27
29
  );
@@ -30,6 +32,7 @@ function TopBarSide({
30
32
  items.push(
31
33
  React.cloneElement(child, {
32
34
  key: `${child.key}-${i}`,
35
+ theme: theme?.Navigation,
33
36
  alignment
34
37
  })
35
38
  );
@@ -38,14 +41,16 @@ function TopBarSide({
38
41
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: items });
39
42
  }
40
43
  function TopBarContainerRight({
41
- children
44
+ children,
45
+ theme
42
46
  }) {
43
- return /* @__PURE__ */ jsxRuntime.jsx(TopBarSide, { alignment: "right", children });
47
+ return /* @__PURE__ */ jsxRuntime.jsx(TopBarSide, { alignment: "right", theme, children });
44
48
  }
45
49
  function TopBarContainerLeft({
46
- children
50
+ children,
51
+ theme
47
52
  }) {
48
- return /* @__PURE__ */ jsxRuntime.jsx(TopBarSide, { alignment: "left", children });
53
+ return /* @__PURE__ */ jsxRuntime.jsx(TopBarSide, { alignment: "left", theme, children });
49
54
  }
50
55
  function TopBar({
51
56
  children,
@@ -64,16 +69,25 @@ function TopBar({
64
69
  return;
65
70
  }
66
71
  if (child.type === TopBarToolName.TopBarToolName) {
67
- toolName ?? (toolName = child);
72
+ toolName ?? (toolName = React.cloneElement(
73
+ child,
74
+ { theme: mergedTheme.ToolName }
75
+ ));
68
76
  }
69
77
  if (child.type === Avatar.Avatar) {
70
- avatar ?? (avatar = /* @__PURE__ */ jsxRuntime.jsx(TopBarItem.TopBarItem, { alignment: "right", children: child }));
78
+ avatar ?? (avatar = /* @__PURE__ */ jsxRuntime.jsx(TopBarItem.TopBarItem, { theme: mergedTheme.Item, alignment: "right", children: child }));
71
79
  }
72
80
  if (child.type === TopBarContainerLeft) {
73
- leftSide ?? (leftSide = child);
81
+ leftSide ?? (leftSide = React.cloneElement(
82
+ child,
83
+ { theme: mergedTheme }
84
+ ));
74
85
  }
75
86
  if (child.type === TopBarContainerRight) {
76
- rightSide ?? (rightSide = child);
87
+ rightSide ?? (rightSide = React.cloneElement(
88
+ child,
89
+ { theme: mergedTheme }
90
+ ));
77
91
  }
78
92
  });
79
93
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -7,7 +7,7 @@ import { TopBarItem } from './topBarItem/TopBarItem.js';
7
7
  import { TopBarNavigation } from './topBarNavigation/TopBarNavigation.js';
8
8
  import { TopBarToolName } from './topBarToolName/TopBarToolName.js';
9
9
 
10
- function TopBarSide({ children, alignment }) {
10
+ function TopBarSide({ children, alignment, theme }) {
11
11
  const items = [];
12
12
  React.Children.forEach(children, (child, i) => {
13
13
  if (!React.isValidElement(child)) {
@@ -16,23 +16,25 @@ function TopBarSide({ children, alignment }) {
16
16
  if (child.type === TopBarItem) {
17
17
  items.push(React.cloneElement(child, {
18
18
  key: `${child.key}-${i}`,
19
+ theme: theme?.Item,
19
20
  alignment
20
21
  }));
21
22
  }
22
23
  if (child.type === TopBarNavigation) {
23
24
  items.push(React.cloneElement(child, {
24
25
  key: `${child.key}-${i}`,
26
+ theme: theme?.Navigation,
25
27
  alignment
26
28
  }));
27
29
  }
28
30
  });
29
31
  return jsx(Fragment, { children: items });
30
32
  }
31
- function TopBarContainerRight({ children }) {
32
- return jsx(TopBarSide, { alignment: "right", children });
33
+ function TopBarContainerRight({ children, theme }) {
34
+ return jsx(TopBarSide, { alignment: "right", theme, children });
33
35
  }
34
- function TopBarContainerLeft({ children }) {
35
- return jsx(TopBarSide, { alignment: "left", children });
36
+ function TopBarContainerLeft({ children, theme }) {
37
+ return jsx(TopBarSide, { alignment: "left", theme, children });
36
38
  }
37
39
  function TopBar({ children, theme = {}, cssOverrides, className, ...props }) {
38
40
  const mergedTheme = mergeDeep(defaultTopBarTheme, theme);
@@ -45,16 +47,16 @@ function TopBar({ children, theme = {}, cssOverrides, className, ...props }) {
45
47
  return;
46
48
  }
47
49
  if (child.type === TopBarToolName) {
48
- toolName ?? (toolName = child);
50
+ toolName ?? (toolName = React.cloneElement(child, { theme: mergedTheme.ToolName }));
49
51
  }
50
52
  if (child.type === Avatar) {
51
- avatar ?? (avatar = jsx(TopBarItem, { alignment: "right", children: child }));
53
+ avatar ?? (avatar = jsx(TopBarItem, { theme: mergedTheme.Item, alignment: "right", children: child }));
52
54
  }
53
55
  if (child.type === TopBarContainerLeft) {
54
- leftSide ?? (leftSide = child);
56
+ leftSide ?? (leftSide = React.cloneElement(child, { theme: mergedTheme }));
55
57
  }
56
58
  if (child.type === TopBarContainerRight) {
57
- rightSide ?? (rightSide = child);
59
+ rightSide ?? (rightSide = React.cloneElement(child, { theme: mergedTheme }));
58
60
  }
59
61
  });
60
62
  return jsxs("div", { css: [topBarStyles(mergedTheme), cssOverrides], className, ...props, children: [jsxs("div", { css: topBarContainerLeftStyles(mergedTheme), children: [toolName, leftSide] }), jsxs("div", { css: topBarContainerRightStyles(mergedTheme), children: [rightSide, avatar] })] });
@@ -47,6 +47,7 @@ const toolNameStyles = (theme) => {
47
47
  display: ${theme.display};
48
48
  align-items: ${theme["align-items"]};
49
49
  gap: ${theme.gap};
50
+ color: ${theme.color};
50
51
  `;
51
52
  };
52
53
  const toolNameTypography = (theme) => {
@@ -45,6 +45,7 @@ const toolNameStyles = (theme) => {
45
45
  display: ${theme.display};
46
46
  align-items: ${theme["align-items"]};
47
47
  gap: ${theme.gap};
48
+ color: ${theme.color};
48
49
  `;
49
50
  };
50
51
  const toolNameTypography = (theme) => {
package/dist/index.cjs CHANGED
@@ -11,6 +11,7 @@ var icon = require('./styleD/build/typescript/component/icon.cjs');
11
11
  var favicon = require('./styleD/build/typescript/component/favicon.cjs');
12
12
  var radioGroup = require('./styleD/build/typescript/component/radioGroup.cjs');
13
13
  var checkbox = require('./styleD/build/typescript/component/checkbox.cjs');
14
+ var textArea = require('./styleD/build/typescript/component/textArea.cjs');
14
15
  var textInput = require('./styleD/build/typescript/component/textInput.cjs');
15
16
  var inlineMessage = require('./styleD/build/typescript/component/inlineMessage.cjs');
16
17
  var select = require('./styleD/build/typescript/component/select.cjs');
@@ -40,6 +41,7 @@ exports.componentIcon = icon.componentIcon;
40
41
  exports.componentFavicon = favicon.componentFavicon;
41
42
  exports.componentRadioGroup = radioGroup.componentRadioGroup;
42
43
  exports.componentCheckbox = checkbox.componentCheckbox;
44
+ exports.componentTextArea = textArea.componentTextArea;
43
45
  exports.componentTextInput = textInput.componentTextInput;
44
46
  exports.componentInlineMessage = inlineMessage.componentInlineMessage;
45
47
  exports.componentSelect = select.componentSelect;
package/dist/index.js CHANGED
@@ -9,6 +9,7 @@ export { componentIcon } from './styleD/build/typescript/component/icon.js';
9
9
  export { componentFavicon } from './styleD/build/typescript/component/favicon.js';
10
10
  export { componentRadioGroup } from './styleD/build/typescript/component/radioGroup.js';
11
11
  export { componentCheckbox } from './styleD/build/typescript/component/checkbox.js';
12
+ export { componentTextArea } from './styleD/build/typescript/component/textArea.js';
12
13
  export { componentTextInput } from './styleD/build/typescript/component/textInput.js';
13
14
  export { componentInlineMessage } from './styleD/build/typescript/component/inlineMessage.js';
14
15
  export { componentSelect } from './styleD/build/typescript/component/select.js';
@@ -58,6 +58,7 @@
58
58
  --component-top-bar-navigation-sm-typography-letter-spacing: -0.0125rem;
59
59
  --component-top-bar-navigation-sm-typography-font-width: 95;
60
60
  --component-top-bar-tool-name-display: flex;
61
+ --component-top-bar-tool-name-color: #000000;
61
62
  --component-top-bar-tool-name-align-items: center;
62
63
  --component-top-bar-tool-name-gap: 8px;
63
64
  --component-top-bar-tool-name-typography-font: normal 700 1.25rem/1.15
@@ -28,7 +28,7 @@
28
28
  --component-radio-group-shared-indicator-disabled-border: 0.0625rem solid
29
29
  #dcdcdc;
30
30
  --component-radio-group-shared-indicator-selected-after-background-color: #005d8b;
31
- --component-radio-group-shared-indicator-selected-after-scale: 0.6rem;
31
+ --component-radio-group-shared-indicator-selected-after-scale: 0.6;
32
32
  --component-radio-group-shared-indicator-selected-border: 0.125rem solid
33
33
  #0072a9;
34
34
  --component-radio-group-shared-indicator-selected-invalid-border: 0.125rem
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Do not edit directly, this file was auto-generated.
3
+ */
4
+
5
+ :root {
6
+ --component-text-area-shared-color: #000000;
7
+ --component-text-area-shared-cursor: text;
8
+ --component-text-area-shared-padding-top: 0.5rem;
9
+ --component-text-area-shared-padding-right: 0.75rem;
10
+ --component-text-area-shared-padding-bottom: 0.5rem;
11
+ --component-text-area-shared-padding-left: 0.75rem;
12
+ --component-text-area-shared-height: 144px;
13
+ --component-text-area-shared-margin-top: 0.5rem; /** spacing between the input itself and the previous element (label or description) minus the flex gap (default 4px), e.g. if the spacing between label and input should be 12px, then margin-top should be 8px */
14
+ --component-text-area-shared-border-radius: 0.25rem;
15
+ --component-text-area-shared-border: 0.0625rem solid #545454;
16
+ --component-text-area-shared-background-color: #ffffff;
17
+ --component-text-area-shared-placeholder-color: #545454;
18
+ --component-text-area-shared-disabled-background-color: #ffffff;
19
+ --component-text-area-shared-disabled-cursor: not-allowed;
20
+ --component-text-area-shared-disabled-color: #999999;
21
+ --component-text-area-shared-disabled-border: 0.0625rem solid #dcdcdc;
22
+ --component-text-area-shared-focused-outline: 0.125rem auto #0072a9;
23
+ --component-text-area-shared-error-border: 0.0625rem solid #b42a19;
24
+ --component-text-area-sm-typography-font: normal 460 0.875rem/1.3 'Open Sans';
25
+ --component-text-area-sm-typography-letter-spacing: 0;
26
+ --component-text-area-sm-typography-font-width: 95;
27
+ --component-text-area-md-typography-font: normal 460 1rem/1.3 'Open Sans';
28
+ --component-text-area-md-typography-letter-spacing: 0;
29
+ --component-text-area-md-typography-font-width: 95;
30
+ }
@@ -13,10 +13,12 @@
13
13
  --component-text-input-shared-border-radius: 0.25rem;
14
14
  --component-text-input-shared-border: 0.0625rem solid #545454;
15
15
  --component-text-input-shared-background-color: #ffffff;
16
+ --component-text-input-shared-placeholder-color: #545454;
16
17
  --component-text-input-shared-disabled-background-color: #ffffff;
17
18
  --component-text-input-shared-disabled-cursor: not-allowed;
18
19
  --component-text-input-shared-disabled-color: #999999;
19
20
  --component-text-input-shared-disabled-border: 0.0625rem solid #dcdcdc;
21
+ --component-text-input-shared-focused-outline: 0.125rem auto #0072a9;
20
22
  --component-text-input-shared-error-border: 0.0625rem solid #b42a19;
21
23
  --component-text-input-sm-height: 2rem;
22
24
  --component-text-input-sm-typography-font: normal 460 0.875rem/1.3 'Open Sans';
@@ -97,6 +97,7 @@ const componentTopBar = {
97
97
  },
98
98
  ToolName: {
99
99
  display: "flex",
100
+ color: "#000000",
100
101
  "align-items": "center",
101
102
  gap: "8px",
102
103
  typography: {
@@ -95,6 +95,7 @@ const componentTopBar = {
95
95
  },
96
96
  ToolName: {
97
97
  display: "flex",
98
+ color: "#000000",
98
99
  "align-items": "center",
99
100
  gap: "8px",
100
101
  typography: {
@@ -41,7 +41,7 @@ const componentRadioGroup = {
41
41
  selected: {
42
42
  after: {
43
43
  backgroundColor: "#005d8b",
44
- scale: "0.6"
44
+ scale: 0.6
45
45
  },
46
46
  border: "0.125rem solid #0072a9",
47
47
  invalid: {
@@ -39,7 +39,7 @@ const componentRadioGroup = {
39
39
  selected: {
40
40
  after: {
41
41
  backgroundColor: "#005d8b",
42
- scale: "0.6"
42
+ scale: 0.6
43
43
  },
44
44
  border: "0.125rem solid #0072a9",
45
45
  invalid: {
@@ -0,0 +1,48 @@
1
+ 'use strict';
2
+
3
+ const componentTextArea = {
4
+ shared: {
5
+ color: "#000000",
6
+ cursor: "text",
7
+ padding: {
8
+ top: "0.5rem",
9
+ right: "0.75rem",
10
+ bottom: "0.5rem",
11
+ left: "0.75rem"
12
+ },
13
+ height: "144px",
14
+ "margin-top": "0.5rem",
15
+ "border-radius": "0.25rem",
16
+ border: "0.0625rem solid #545454",
17
+ "background-color": "#ffffff",
18
+ placeholderColor: "#545454",
19
+ disabled: {
20
+ backgroundColor: "#ffffff",
21
+ cursor: "not-allowed",
22
+ color: "#999999",
23
+ border: "0.0625rem solid #dcdcdc"
24
+ },
25
+ focused: {
26
+ outline: "0.125rem auto #0072a9"
27
+ },
28
+ error: {
29
+ border: "0.0625rem solid #b42a19"
30
+ }
31
+ },
32
+ sm: {
33
+ typography: {
34
+ font: "normal 460 0.875rem/1.3 Open Sans",
35
+ letterSpacing: "0rem",
36
+ fontWidth: 95
37
+ }
38
+ },
39
+ md: {
40
+ typography: {
41
+ font: "normal 460 1rem/1.3 Open Sans",
42
+ letterSpacing: "0rem",
43
+ fontWidth: 95
44
+ }
45
+ }
46
+ };
47
+
48
+ exports.componentTextArea = componentTextArea;
@@ -0,0 +1,46 @@
1
+ const componentTextArea = {
2
+ shared: {
3
+ color: "#000000",
4
+ cursor: "text",
5
+ padding: {
6
+ top: "0.5rem",
7
+ right: "0.75rem",
8
+ bottom: "0.5rem",
9
+ left: "0.75rem"
10
+ },
11
+ height: "144px",
12
+ "margin-top": "0.5rem",
13
+ "border-radius": "0.25rem",
14
+ border: "0.0625rem solid #545454",
15
+ "background-color": "#ffffff",
16
+ placeholderColor: "#545454",
17
+ disabled: {
18
+ backgroundColor: "#ffffff",
19
+ cursor: "not-allowed",
20
+ color: "#999999",
21
+ border: "0.0625rem solid #dcdcdc"
22
+ },
23
+ focused: {
24
+ outline: "0.125rem auto #0072a9"
25
+ },
26
+ error: {
27
+ border: "0.0625rem solid #b42a19"
28
+ }
29
+ },
30
+ sm: {
31
+ typography: {
32
+ font: "normal 460 0.875rem/1.3 Open Sans",
33
+ letterSpacing: "0rem",
34
+ fontWidth: 95
35
+ }
36
+ },
37
+ md: {
38
+ typography: {
39
+ font: "normal 460 1rem/1.3 Open Sans",
40
+ letterSpacing: "0rem",
41
+ fontWidth: 95
42
+ }
43
+ }
44
+ };
45
+
46
+ export { componentTextArea };
@@ -14,12 +14,16 @@ const componentTextInput = {
14
14
  "border-radius": "0.25rem",
15
15
  border: "0.0625rem solid #545454",
16
16
  "background-color": "#ffffff",
17
+ placeholderColor: "#545454",
17
18
  disabled: {
18
19
  backgroundColor: "#ffffff",
19
20
  cursor: "not-allowed",
20
21
  color: "#999999",
21
22
  border: "0.0625rem solid #dcdcdc"
22
23
  },
24
+ focused: {
25
+ outline: "0.125rem auto #0072a9"
26
+ },
23
27
  error: {
24
28
  border: "0.0625rem solid #b42a19"
25
29
  }
@@ -12,12 +12,16 @@ const componentTextInput = {
12
12
  "border-radius": "0.25rem",
13
13
  border: "0.0625rem solid #545454",
14
14
  "background-color": "#ffffff",
15
+ placeholderColor: "#545454",
15
16
  disabled: {
16
17
  backgroundColor: "#ffffff",
17
18
  cursor: "not-allowed",
18
19
  color: "#999999",
19
20
  border: "0.0625rem solid #dcdcdc"
20
21
  },
22
+ focused: {
23
+ outline: "0.125rem auto #0072a9"
24
+ },
21
25
  error: {
22
26
  border: "0.0625rem solid #b42a19"
23
27
  }
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var TextArea = require('./components/text-area/TextArea.cjs');
4
+ var textArea = require('./styleD/build/typescript/component/textArea.cjs');
5
+
6
+
7
+
8
+ exports.TextArea = TextArea.TextArea;
9
+ exports.componentTextArea = textArea.componentTextArea;
@@ -0,0 +1,2 @@
1
+ export { TextArea } from './components/text-area/TextArea.js';
2
+ export { componentTextArea } from './styleD/build/typescript/component/textArea.js';
@@ -3,7 +3,7 @@ import type { ComponentAvatar } from '../../styleD/build/typescript/component/av
3
3
  import type { DeepPartial, Prettify } from '../../util/types';
4
4
  import type { AvatarProps } from './types';
5
5
  export type AvatarTheme = Prettify<ComponentAvatar>;
6
- export type PartialAvatarTheme = DeepPartial<AvatarTheme>;
6
+ export type PartialAvatarTheme = Prettify<DeepPartial<AvatarTheme>>;
7
7
  export declare const defaultAvatarTheme: AvatarTheme;
8
8
  export declare const avatarImageStyles: SerializedStyles;
9
9
  export declare const avatarStyles: (theme: AvatarTheme, { size, color }: Required<Pick<AvatarProps, 'size' | 'color'>>) => SerializedStyles;
@@ -3,6 +3,6 @@ import type { ComponentButton } from '../../styleD/build/typescript/component/bu
3
3
  import type { DeepPartial, Prettify } from '../../util/types';
4
4
  import type { ButtonProps } from './types';
5
5
  export type ButtonTheme = Prettify<ComponentButton>;
6
- export type PartialButtonTheme = DeepPartial<ButtonTheme>;
6
+ export type PartialButtonTheme = Prettify<DeepPartial<ButtonTheme>>;
7
7
  export declare const defaultButtonTheme: ButtonTheme;
8
8
  export declare const buttonStyles: (theme: ButtonTheme, { size, variant }: Required<Pick<ButtonProps, 'size' | 'variant'>>, hasIcon?: boolean, isIconButton?: boolean) => SerializedStyles;
@@ -1,3 +1,3 @@
1
1
  import type { ComponentByline } from '../../styleD/build/typescript/component/byline';
2
- import type { DeepPartial } from '../../util/types';
3
- export type PartialBylineTheme = DeepPartial<ComponentByline>;
2
+ import type { DeepPartial, Prettify } from '../../util/types';
3
+ export type PartialBylineTheme = Prettify<DeepPartial<ComponentByline>>;
@@ -1,9 +1,9 @@
1
1
  import type { SerializedStyles } from '@emotion/react';
2
2
  import type { ComponentCheckbox } from '../../styleD/build/typescript/component/checkbox';
3
- import type { Prettify } from '../../util/types';
3
+ import type { DeepPartial, Prettify } from '../../util/types';
4
4
  import type { CheckboxGroupProps, CheckboxProps } from './types';
5
5
  export type CheckboxTheme = Prettify<ComponentCheckbox>;
6
- export type PartialCheckboxTheme = Prettify<Partial<CheckboxTheme>>;
6
+ export type PartialCheckboxTheme = Prettify<DeepPartial<CheckboxTheme>>;
7
7
  export declare const defaultCheckboxTheme: CheckboxTheme;
8
8
  export declare const checkboxStyles: (theme: CheckboxTheme, { size, isIndeterminate, }: Required<Pick<CheckboxProps, 'size' | 'isIndeterminate'>>) => SerializedStyles;
9
9
  export declare const checkboxLabelStyles: (theme: CheckboxTheme) => SerializedStyles;
@@ -2,7 +2,7 @@ import type { SerializedStyles } from '@emotion/react';
2
2
  import { type ComponentFavicon } from '../../styleD/build/typescript/component/favicon';
3
3
  import type { DeepPartial, Prettify } from '../../util/types';
4
4
  export type FaviconTheme = Prettify<ComponentFavicon>;
5
- export type PartialFaviconTheme = DeepPartial<FaviconTheme>;
5
+ export type PartialFaviconTheme = Prettify<DeepPartial<FaviconTheme>>;
6
6
  export declare const defaultFaviconTheme: FaviconTheme;
7
7
  export declare const faviconStyles: (theme: FaviconTheme) => SerializedStyles;
8
8
  export declare const faviconTypographyStyles: (theme: FaviconTheme) => SerializedStyles;
@@ -2,7 +2,7 @@ import type { ComponentIcon } from '../../styleD/build/typescript/component/icon
2
2
  import type { DeepPartial, Prettify } from '../../util/types';
3
3
  import type { IconProps } from './types';
4
4
  export type IconTheme = Prettify<ComponentIcon>;
5
- export type PartialIconTheme = DeepPartial<IconTheme>;
5
+ export type PartialIconTheme = Prettify<DeepPartial<IconTheme>>;
6
6
  export declare const defaultIconTheme: IconTheme;
7
7
  export declare const iconStyles: (theme: IconTheme, { size, fill, mode, }: Required<Pick<IconProps, "size">> & Pick<IconProps, "fill"> & {
8
8
  mode: 'text' | 'svg';
@@ -3,15 +3,15 @@ import type { ComponentMenu } from '../../styleD/build/typescript/component/menu
3
3
  import type { DeepPartial, Prettify } from '../../util/types';
4
4
  import type { MenuItemProps, MenuPopoverProps, MenuSectionProps } from './types';
5
5
  export type MenuTheme = Prettify<ComponentMenu['menu']>;
6
- export type PartialMenuTheme = DeepPartial<MenuTheme>;
6
+ export type PartialMenuTheme = Prettify<DeepPartial<MenuTheme>>;
7
7
  export declare const defaultMenuTheme: MenuTheme;
8
8
  export declare const menuStyles: (theme: MenuTheme) => SerializedStyles;
9
9
  export type MenuSectionTheme = Prettify<ComponentMenu['menuSection']>;
10
- export type PartialMenuSectionTheme = DeepPartial<MenuSectionTheme>;
10
+ export type PartialMenuSectionTheme = Prettify<DeepPartial<MenuSectionTheme>>;
11
11
  export declare const defaultMenuSectionTheme: MenuSectionTheme;
12
12
  export declare const menuSectionHeaderStyles: (theme: MenuSectionTheme, { size }: Required<Pick<MenuSectionProps, 'size'>>) => SerializedStyles;
13
13
  export type MenuItemTheme = Prettify<ComponentMenu['menuItem']>;
14
- export type PartialMenuItemTheme = DeepPartial<MenuItemTheme>;
14
+ export type PartialMenuItemTheme = Prettify<DeepPartial<MenuItemTheme>>;
15
15
  export declare const defaultMenuItemTheme: MenuItemTheme;
16
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;
@@ -19,10 +19,10 @@ export declare const menuItemLabelStyles: (theme: MenuItemTheme) => SerializedSt
19
19
  export declare const menuItemDescriptionStyles: (theme: MenuItemTheme) => SerializedStyles;
20
20
  export declare const menuItemAsideStyles: (theme: MenuItemTheme) => SerializedStyles;
21
21
  export type MenuSeparatorTheme = Prettify<ComponentMenu['menuSeparator']>;
22
- export type PartialMenuSeparatorTheme = DeepPartial<MenuSeparatorTheme>;
22
+ export type PartialMenuSeparatorTheme = Prettify<DeepPartial<MenuSeparatorTheme>>;
23
23
  export declare const defaultMenuSeparatorTheme: MenuSeparatorTheme;
24
24
  export declare const menuSeparatorStyles: (theme: MenuSeparatorTheme) => SerializedStyles;
25
25
  export type MenuPopoverTheme = Prettify<ComponentMenu['menuPopover']>;
26
- export type PartialMenuPopoverTheme = DeepPartial<MenuPopoverTheme>;
26
+ export type PartialMenuPopoverTheme = Prettify<DeepPartial<MenuPopoverTheme>>;
27
27
  export declare const defaultMenuPopoverTheme: MenuPopoverTheme;
28
28
  export declare const menuPopoverStyles: (theme: MenuPopoverTheme, { size }: Required<Pick<MenuPopoverProps, 'size'>>) => SerializedStyles;
@@ -2,7 +2,7 @@ import type { SerializedStyles } from '@emotion/react';
2
2
  import type { ComponentSelect } from '../../styleD/build/typescript/component/select';
3
3
  import type { DeepPartial, Prettify } from '../../util/types';
4
4
  export type SelectTheme = Prettify<ComponentSelect>;
5
- export type PartialSelectTheme = DeepPartial<SelectTheme>;
5
+ export type PartialSelectTheme = Prettify<DeepPartial<SelectTheme>>;
6
6
  export declare const defaultSelectTheme: SelectTheme;
7
7
  export declare const popoverStyles: (theme: SelectTheme) => SerializedStyles;
8
8
  export declare const listBoxItemStyles: (theme: SelectTheme) => SerializedStyles;
@@ -0,0 +1,2 @@
1
+ import type { TextAreaProps } from './types';
2
+ export declare function TextArea({ size, isInvalid, theme, placeholder, ...props }: TextAreaProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export declare const componentName = "TextArea";
2
+ export declare const componentTsx = "import { TextArea } from '@guardian/stand/text-area';\n\nexport const Component = () => (\n\t<TextArea\n\t\t\tlabel=\"Description\"\n\t\t\tdescription=\"This is a description for the text area.\"\n\t\t/>\n);\n";
3
+ export declare const componentCss = "\n/* import the textarea, form and inline message styles */\n@import '@guardian/stand/component/inlineMessage.css';\n@import '@guardian/stand/component/form.css';\n@import '@guardian/stand/component/textArea.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.stand-text-area {\n\tdisplay: var(--component-textArea-shared-display);\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 area styles */\n\n.stand-text-area {\n\tbackground-color: var(--component-text-area-shared-background-color);\n\tborder-radius: var(--component-text-area-shared-border-radius);\n\tborder: var(--component-text-area-shared-border);\n\tcolor: var(--component-text-area-shared-color);\n\tcursor: var(--component-text-area-shared-cursor);\n\tmargin-top: var(--component-text-area-shared-margin-top);\n\tpadding-top: var(--component-text-area-shared-padding-top);\n\tpadding-right: var(--component-text-area-shared-padding-right);\n\tpadding-bottom: var(--component-text-area-shared-padding-bottom);\n\tpadding-left: var(--component-text-area-shared-padding-left);\n}\n\n.stand-text-area[disabled] {\n\tbackground-color: var(--component-text-area-shared-disabled-background-color);\n\tborder: var(--component-text-area-shared-disabled-border);\n\tcolor: var(--component-text-area-shared-disabled-color);\n\tcursor: var(--component-text-area-shared-disabled-cursor);\n}\n\n.stand-text-area[data-invalid] {\n\tborder: var(--component-text-area-shared-error-border);\n}\n\n.stand-text-area.md {\n\theight: var(--component-text-area-shared-height);\n\tfont: var(--component-text-area-md-typography-font);\n\tletter-spacing: var(--component-text-area-md-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-text-area-md-typography-font-width);\n}\n\n.stand-text-area.sm {\n\theight: var(--component-text-area-shared-height);\n\tfont: var(--component-text-area-sm-typography-font);\n\tletter-spacing: var(--component-text-area-sm-typography-letter-spacing);\n\tfont-variation-settings: \"wdth\" var(--component-text-area-sm-typography-font-width);\n}\n";
4
+ export declare const componentHtml = "<div class=\"container\">\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 area.</span>\n\t\t<textarea id=\"name\" class=\"stand-text-area md\" type=\"text\"></textarea>\n\t</div>\n\t<div class=\"stand-form-input-container sm\">\n\t\t<label for=\"story\">Tell us a story</label>\n\t\t<textarea\n\t\t\tid=\"story\"\n\t\t\tclass=\"stand-text-area sm\"\n\t\t\ttype=\"text\"\n\t\t\tdata-invalid\n\t\t>It was a dark and stormy night...</textarea>\n\t\t<span class=\"stand-inline-message stand-inline-message-error\"><span class=\"material-symbols\">warning</span> Story is below character count</span>\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<textarea\n\t\t\tid=\"notes\"\n\t\t\tclass=\"stand-text-area md\"\n\t\t\ttype=\"text\"\n\t\t\tdisabled\n\t\t></textarea>\n\t</div>\n</div>\n";
5
+ export declare const componentJs = "\nimport { componentTextArea, 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 area styles */\n\n.js-stand-text-area {\n\tbackground-color: ${componentTextArea.shared['background-color']};\n\tborder-radius: ${componentTextArea.shared['border-radius']};\n\tborder: ${componentTextArea.shared.border};\n\tcolor: ${componentTextArea.shared.color};\n\tcursor: ${componentTextArea.shared.cursor};\n\tmargin-top: ${componentTextArea.shared['margin-top']};\n\tpadding-top: ${componentTextArea.shared.padding.top};\n\tpadding-right: ${componentTextArea.shared.padding.right};\n\tpadding-bottom: ${componentTextArea.shared.padding.bottom};\n\tpadding-left: ${componentTextArea.shared.padding.left};\n}\n\n.js-stand-text-area[disabled] {\n\tbackground-color: ${componentTextArea.shared.disabled.backgroundColor};\n\tborder: ${componentTextArea.shared.disabled.border};\n\tcolor: ${componentTextArea.shared.disabled.color};\n\tcursor: ${componentTextArea.shared.disabled.cursor};\n}\n\n.js-stand-text-area[data-invalid] {\n\tborder: ${componentTextArea.shared.errorBorder};\n}\n\n.js-stand-text-area.md {\n\theight: ${componentTextArea.shared.height};\n\tfont: ${componentTextArea.md.typography.font};\n\tletter-spacing: ${componentTextArea.md.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentTextArea.md.typography.fontWidth};\n}\n\n.js-stand-text-area.sm {\n\theight: ${componentTextArea.shared.height};\n\tfont: ${componentTextArea.sm.typography.font};\n\tletter-spacing: ${componentTextArea.sm.typography.letterSpacing};\n\tfont-variation-settings: \"wdth\" ${componentTextArea.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<textarea id=\"name\" class=\"js-stand-text-area md\"></textarea>\n\t</div>\n\t<div class=\"js-stand-form-input-container sm\">\n\t\t<label for=\"story\">Story</label>\n\t\t<textarea\n\t\t\tid=\"story\"\n\t\t\tclass=\"js-stand-text-area sm\"\n\t\t>It was a dark and stormy night...</textarea>\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\" data-disabled>\n\t\t<label for=\"notes\">Notes</label>\n\t\t<textarea\n\t\t\tid=\"notes\"\n\t\t\tclass=\"js-stand-text-area md\"\n\t\t\ttype=\"text\"\n\t\t\tdisabled\n\t\t </textarea>\n\t</div>\n</div>\n`;\n";
@@ -0,0 +1,7 @@
1
+ import type { SerializedStyles } from '@emotion/react';
2
+ import type { ComponentTextArea } from '../../styleD/build/typescript/component/textArea';
3
+ import type { Prettify } from '../../util/types';
4
+ import type { TextAreaProps } from './types';
5
+ export type TextAreaTheme = Prettify<ComponentTextArea>;
6
+ export declare const defaultTextAreaTheme: TextAreaTheme;
7
+ export declare const textAreaStyles: (theme: TextAreaTheme, { size, isInvalid }: Required<Pick<TextAreaProps, 'size' | 'isInvalid'>>) => SerializedStyles;
@@ -0,0 +1,7 @@
1
+ import type { TextFieldProps as RACTextAreaProps } from 'react-aria-components';
2
+ import type { FormInputContainerDefaultProps } from '../form/types';
3
+ import type { TextAreaTheme } from './styles';
4
+ export interface TextAreaProps extends FormInputContainerDefaultProps<RACTextAreaProps, TextAreaTheme> {
5
+ /** Temporary text that occupies the text area when it is empty */
6
+ placeholder?: string;
7
+ }
@@ -1,2 +1,2 @@
1
1
  import type { TextInputProps } from './types';
2
- export declare function TextInput({ size, isInvalid, theme, ...props }: TextInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
2
+ export declare function TextInput({ size, isInvalid, theme, placeholder, ...props }: TextInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,4 +1,7 @@
1
1
  import type { TextFieldProps as RACTextInputProps } from 'react-aria-components';
2
2
  import type { FormInputContainerDefaultProps } from '../form/types';
3
3
  import type { TextInputTheme } from './styles';
4
- export type TextInputProps = FormInputContainerDefaultProps<RACTextInputProps, TextInputTheme>;
4
+ export interface TextInputProps extends FormInputContainerDefaultProps<RACTextInputProps, TextInputTheme> {
5
+ /** Temporary text that occupies the text input when it is empty */
6
+ placeholder?: string;
7
+ }
@@ -1,8 +1,11 @@
1
+ import type { TopBarTheme } from './styles';
1
2
  import type { TopBarProps } from './types';
2
- export declare function TopBarContainerRight({ children, }: {
3
+ export declare function TopBarContainerRight({ children, theme, }: {
3
4
  children: TopBarProps['children'];
5
+ theme?: TopBarTheme;
4
6
  }): import("@emotion/react/jsx-runtime").JSX.Element;
5
- export declare function TopBarContainerLeft({ children, }: {
7
+ export declare function TopBarContainerLeft({ children, theme, }: {
6
8
  children: TopBarProps['children'];
9
+ theme?: TopBarTheme;
7
10
  }): import("@emotion/react/jsx-runtime").JSX.Element;
8
11
  export declare function TopBar({ children, theme, cssOverrides, className, ...props }: TopBarProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -2,7 +2,7 @@ import type { SerializedStyles } from '@emotion/react';
2
2
  import type { ComponentTopBar } from '../../styleD/build/typescript/component/TopBar';
3
3
  import type { DeepPartial, Prettify } from '../../util/types';
4
4
  export type TopBarTheme = Prettify<ComponentTopBar>;
5
- export type PartialTopBarTheme = DeepPartial<TopBarTheme>;
5
+ export type PartialTopBarTheme = Prettify<DeepPartial<TopBarTheme>>;
6
6
  export declare const defaultTopBarTheme: TopBarTheme;
7
7
  export declare const topBarStyles: (theme: TopBarTheme) => SerializedStyles;
8
8
  export declare const topBarContainerLeftStyles: (theme: TopBarTheme) => SerializedStyles;
@@ -3,6 +3,6 @@ import type { ComponentTopBar } from '../../../styleD/build/typescript/component
3
3
  import type { DeepPartial, Prettify } from '../../../util/types';
4
4
  import type { TopBarItemProps } from './types';
5
5
  export type TopBarItemTheme = Prettify<ComponentTopBar['Item']>;
6
- export type PartialTopBarItemTheme = DeepPartial<TopBarItemTheme>;
6
+ export type PartialTopBarItemTheme = Prettify<DeepPartial<TopBarItemTheme>>;
7
7
  export declare const defaultTopBarItemTheme: TopBarItemTheme;
8
8
  export declare const topBarItemStyles: (theme: TopBarItemTheme, alignment: 'left' | 'right', { size }: Required<Pick<TopBarItemProps, 'size'>>) => SerializedStyles;
@@ -3,7 +3,7 @@ import type { ComponentTopBar } from '../../../styleD/build/typescript/component
3
3
  import type { DeepPartial, Prettify } from '../../../util/types';
4
4
  import type { TopBarNavigationProps } from './types';
5
5
  export type TopBarNavigationTheme = Prettify<ComponentTopBar['Navigation']>;
6
- export type PartialTopBarNavigationTheme = DeepPartial<TopBarNavigationTheme>;
6
+ export type PartialTopBarNavigationTheme = Prettify<DeepPartial<TopBarNavigationTheme>>;
7
7
  export declare const defaultTopBarNavigationTheme: TopBarNavigationTheme;
8
8
  export declare const topBarNavigationStyles: (theme: TopBarNavigationTheme, selected: boolean) => SerializedStyles;
9
9
  export declare const topBarNavigationDividerStyles: (theme: TopBarNavigationTheme, { alignment }: Required<Pick<TopBarNavigationProps, 'alignment'>>) => SerializedStyles;
@@ -2,7 +2,7 @@ import type { SerializedStyles } from '@emotion/react';
2
2
  import { type ComponentTopBar } from '../../..//styleD/build/typescript/component/TopBar';
3
3
  import type { DeepPartial, Prettify } from '../../../util/types';
4
4
  export type TopBarToolNameTheme = Prettify<ComponentTopBar['ToolName']>;
5
- export type PartialTopBarToolNameTheme = DeepPartial<TopBarToolNameTheme>;
5
+ export type PartialTopBarToolNameTheme = Prettify<DeepPartial<TopBarToolNameTheme>>;
6
6
  export declare const defaultToolNameTheme: TopBarToolNameTheme;
7
7
  export declare const toolNameHoverLinkStyles: (theme: TopBarToolNameTheme) => SerializedStyles;
8
8
  export declare const toolNameLinkStyles: (theme: TopBarToolNameTheme) => SerializedStyles;
@@ -3,6 +3,6 @@ import { type ComponentTypography } from '../../styleD/build/typescript/componen
3
3
  import type { DeepPartial, Prettify } from '../../util/types';
4
4
  import type { TypographyProps } from './types';
5
5
  export type TypographyTheme = Prettify<ComponentTypography>;
6
- export type PartialTypographyTheme = DeepPartial<TypographyTheme>;
6
+ export type PartialTypographyTheme = Prettify<DeepPartial<TypographyTheme>>;
7
7
  export declare const defaultTypographyTheme: TypographyTheme;
8
8
  export declare const typographyStyles: (theme: TypographyTheme, { variant }: Required<Pick<TypographyProps, 'variant'>>) => SerializedStyles;
@@ -1,3 +1,3 @@
1
1
  import type { ComponentUserMenu } from '../../styleD/build/typescript/component/userMenu';
2
- import type { DeepPartial } from '../../util/types';
3
- export type PartialUserMenuTheme = DeepPartial<ComponentUserMenu>;
2
+ import type { DeepPartial, Prettify } from '../../util/types';
3
+ export type PartialUserMenuTheme = Prettify<DeepPartial<ComponentUserMenu>>;
@@ -30,6 +30,8 @@ export { componentRadioGroup } from './styleD/build/typescript/component/radioGr
30
30
  export type { ComponentRadioGroup } from './styleD/build/typescript/component/radioGroup';
31
31
  export { componentCheckbox } from './styleD/build/typescript/component/checkbox';
32
32
  export type { ComponentCheckbox } from './styleD/build/typescript/component/checkbox';
33
+ export { componentTextArea } from './styleD/build/typescript/component/textArea';
34
+ export type { ComponentTextArea } from './styleD/build/typescript/component/textArea';
33
35
  export { componentTextInput } from './styleD/build/typescript/component/textInput';
34
36
  export type { ComponentTextInput } from './styleD/build/typescript/component/textInput';
35
37
  export { componentInlineMessage } from './styleD/build/typescript/component/inlineMessage';
@@ -98,6 +98,7 @@ export declare const componentTopBar: {
98
98
  };
99
99
  ToolName: {
100
100
  display: string;
101
+ color: string;
101
102
  'align-items': string;
102
103
  gap: string;
103
104
  typography: {
@@ -42,7 +42,7 @@ export declare const componentRadioGroup: {
42
42
  selected: {
43
43
  after: {
44
44
  backgroundColor: string;
45
- scale: string;
45
+ scale: number;
46
46
  };
47
47
  border: string;
48
48
  invalid: {
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Do not edit directly, this file was auto-generated.
3
+ */
4
+ export declare const componentTextArea: {
5
+ shared: {
6
+ color: string;
7
+ cursor: string;
8
+ padding: {
9
+ top: string;
10
+ right: string;
11
+ bottom: string;
12
+ left: string;
13
+ };
14
+ height: string;
15
+ 'margin-top': string;
16
+ 'border-radius': string;
17
+ border: string;
18
+ 'background-color': string;
19
+ placeholderColor: string;
20
+ disabled: {
21
+ backgroundColor: string;
22
+ cursor: string;
23
+ color: string;
24
+ border: string;
25
+ };
26
+ focused: {
27
+ outline: string;
28
+ };
29
+ error: {
30
+ border: string;
31
+ };
32
+ };
33
+ sm: {
34
+ typography: {
35
+ font: string;
36
+ letterSpacing: string;
37
+ fontWidth: number;
38
+ };
39
+ };
40
+ md: {
41
+ typography: {
42
+ font: string;
43
+ letterSpacing: string;
44
+ fontWidth: number;
45
+ };
46
+ };
47
+ };
48
+ export type ComponentTextArea = typeof componentTextArea;
@@ -15,12 +15,16 @@ export declare const componentTextInput: {
15
15
  'border-radius': string;
16
16
  border: string;
17
17
  'background-color': string;
18
+ placeholderColor: string;
18
19
  disabled: {
19
20
  backgroundColor: string;
20
21
  cursor: string;
21
22
  color: string;
22
23
  border: string;
23
24
  };
25
+ focused: {
26
+ outline: string;
27
+ };
24
28
  error: {
25
29
  border: string;
26
30
  };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * TextArea 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/textArea.css),
14
+ * you don't need to install these.
15
+ */
16
+ export { TextArea } from './components/text-area/TextArea';
17
+ export type { TextAreaProps } from './components/text-area/types';
18
+ export type { TextAreaTheme } from './components/text-area/styles';
19
+ export { componentTextArea } from './styleD/build/typescript/component/textArea';
20
+ export type { ComponentTextArea } from './styleD/build/typescript/component/textArea';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guardian/stand",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
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": {
@@ -99,6 +99,11 @@
99
99
  "import": "./dist/checkbox.js",
100
100
  "require": "./dist/checkbox.cjs"
101
101
  },
102
+ "./text-area": {
103
+ "types": "./dist/types/text-area.d.ts",
104
+ "import": "./dist/text-area.js",
105
+ "require": "./dist/text-area.cjs"
106
+ },
102
107
  "./byline": {
103
108
  "types": "./dist/types/byline.d.ts",
104
109
  "import": "./dist/byline.js",
@@ -149,7 +154,8 @@
149
154
  "./component/select.css": "./dist/styleD/build/css/component/select.css",
150
155
  "./component/textInput.css": "./dist/styleD/build/css/component/textInput.css",
151
156
  "./component/radioGroup.css": "./dist/styleD/build/css/component/radioGroup.css",
152
- "./component/checkbox.css": "./dist/styleD/build/css/component/checkbox.css"
157
+ "./component/checkbox.css": "./dist/styleD/build/css/component/checkbox.css",
158
+ "./component/textArea.css": "./dist/styleD/build/css/component/textArea.css"
153
159
  },
154
160
  "//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.",
155
161
  "typesVersions": {
@@ -219,6 +225,9 @@
219
225
  ],
220
226
  "checkbox": [
221
227
  "./dist/types/checkbox.d.ts"
228
+ ],
229
+ "text-area": [
230
+ "./dist/types/text-area.d.ts"
222
231
  ]
223
232
  }
224
233
  },