braid-design-system 34.0.2 → 34.0.3

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 (106) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/lib/components/Textarea/Textarea.cjs +9 -3
  3. package/dist/lib/components/Textarea/Textarea.mjs +9 -3
  4. package/dist/lib/playroom/snippets/Accordion.cjs +7 -7
  5. package/dist/lib/playroom/snippets/Accordion.mjs +7 -7
  6. package/dist/lib/playroom/snippets/Actions.cjs +2 -2
  7. package/dist/lib/playroom/snippets/Actions.mjs +2 -2
  8. package/dist/lib/playroom/snippets/Alert.cjs +6 -6
  9. package/dist/lib/playroom/snippets/Alert.mjs +6 -6
  10. package/dist/lib/playroom/snippets/Autosuggest.cjs +6 -6
  11. package/dist/lib/playroom/snippets/Autosuggest.mjs +6 -6
  12. package/dist/lib/playroom/snippets/Badge.cjs +13 -13
  13. package/dist/lib/playroom/snippets/Badge.mjs +13 -13
  14. package/dist/lib/playroom/snippets/Bleed.cjs +7 -7
  15. package/dist/lib/playroom/snippets/Bleed.mjs +7 -7
  16. package/dist/lib/playroom/snippets/Button.cjs +20 -20
  17. package/dist/lib/playroom/snippets/Button.mjs +20 -20
  18. package/dist/lib/playroom/snippets/ButtonIcon.cjs +5 -5
  19. package/dist/lib/playroom/snippets/ButtonIcon.mjs +5 -5
  20. package/dist/lib/playroom/snippets/Card.cjs +4 -4
  21. package/dist/lib/playroom/snippets/Card.mjs +4 -4
  22. package/dist/lib/playroom/snippets/Checkbox.cjs +6 -6
  23. package/dist/lib/playroom/snippets/Checkbox.mjs +6 -6
  24. package/dist/lib/playroom/snippets/Columns.cjs +5 -5
  25. package/dist/lib/playroom/snippets/Columns.mjs +5 -5
  26. package/dist/lib/playroom/snippets/ContentBlock.cjs +5 -5
  27. package/dist/lib/playroom/snippets/ContentBlock.mjs +5 -5
  28. package/dist/lib/playroom/snippets/Dialog.cjs +6 -6
  29. package/dist/lib/playroom/snippets/Dialog.mjs +6 -6
  30. package/dist/lib/playroom/snippets/Disclosure.cjs +1 -1
  31. package/dist/lib/playroom/snippets/Disclosure.mjs +1 -1
  32. package/dist/lib/playroom/snippets/Divider.cjs +2 -2
  33. package/dist/lib/playroom/snippets/Divider.mjs +2 -2
  34. package/dist/lib/playroom/snippets/Drawer.cjs +4 -4
  35. package/dist/lib/playroom/snippets/Drawer.mjs +4 -4
  36. package/dist/lib/playroom/snippets/Dropdown.cjs +7 -7
  37. package/dist/lib/playroom/snippets/Dropdown.mjs +7 -7
  38. package/dist/lib/playroom/snippets/FieldLabel.cjs +3 -3
  39. package/dist/lib/playroom/snippets/FieldLabel.mjs +3 -3
  40. package/dist/lib/playroom/snippets/FieldMessage.cjs +4 -4
  41. package/dist/lib/playroom/snippets/FieldMessage.mjs +4 -4
  42. package/dist/lib/playroom/snippets/Heading.cjs +9 -9
  43. package/dist/lib/playroom/snippets/Heading.mjs +9 -9
  44. package/dist/lib/playroom/snippets/Inline.cjs +3 -3
  45. package/dist/lib/playroom/snippets/Inline.mjs +3 -3
  46. package/dist/lib/playroom/snippets/List.cjs +8 -8
  47. package/dist/lib/playroom/snippets/List.mjs +8 -8
  48. package/dist/lib/playroom/snippets/Loader.cjs +1 -1
  49. package/dist/lib/playroom/snippets/Loader.mjs +1 -1
  50. package/dist/lib/playroom/snippets/MenuRenderer.cjs +5 -5
  51. package/dist/lib/playroom/snippets/MenuRenderer.mjs +5 -5
  52. package/dist/lib/playroom/snippets/MonthPicker.cjs +7 -7
  53. package/dist/lib/playroom/snippets/MonthPicker.mjs +7 -7
  54. package/dist/lib/playroom/snippets/Notice.cjs +4 -4
  55. package/dist/lib/playroom/snippets/Notice.mjs +4 -4
  56. package/dist/lib/playroom/snippets/OverflowMenu.cjs +2 -2
  57. package/dist/lib/playroom/snippets/OverflowMenu.mjs +2 -2
  58. package/dist/lib/playroom/snippets/Page.cjs +2 -2
  59. package/dist/lib/playroom/snippets/Page.mjs +2 -2
  60. package/dist/lib/playroom/snippets/PageBlock.cjs +4 -4
  61. package/dist/lib/playroom/snippets/PageBlock.mjs +4 -4
  62. package/dist/lib/playroom/snippets/Pagination.cjs +1 -1
  63. package/dist/lib/playroom/snippets/Pagination.mjs +1 -1
  64. package/dist/lib/playroom/snippets/PasswordField.cjs +6 -6
  65. package/dist/lib/playroom/snippets/PasswordField.mjs +6 -6
  66. package/dist/lib/playroom/snippets/RadioGroup.cjs +7 -7
  67. package/dist/lib/playroom/snippets/RadioGroup.mjs +7 -7
  68. package/dist/lib/playroom/snippets/Rating.cjs +4 -4
  69. package/dist/lib/playroom/snippets/Rating.mjs +4 -4
  70. package/dist/lib/playroom/snippets/Secondary.cjs +1 -1
  71. package/dist/lib/playroom/snippets/Secondary.mjs +1 -1
  72. package/dist/lib/playroom/snippets/Spread.cjs +4 -4
  73. package/dist/lib/playroom/snippets/Spread.mjs +4 -4
  74. package/dist/lib/playroom/snippets/Stack.cjs +9 -9
  75. package/dist/lib/playroom/snippets/Stack.mjs +9 -9
  76. package/dist/lib/playroom/snippets/Stepper.cjs +4 -4
  77. package/dist/lib/playroom/snippets/Stepper.mjs +4 -4
  78. package/dist/lib/playroom/snippets/Strong.cjs +1 -1
  79. package/dist/lib/playroom/snippets/Strong.mjs +1 -1
  80. package/dist/lib/playroom/snippets/Table.cjs +3 -3
  81. package/dist/lib/playroom/snippets/Table.mjs +3 -3
  82. package/dist/lib/playroom/snippets/Tabs.cjs +6 -6
  83. package/dist/lib/playroom/snippets/Tabs.mjs +6 -6
  84. package/dist/lib/playroom/snippets/Tag.cjs +5 -5
  85. package/dist/lib/playroom/snippets/Tag.mjs +5 -5
  86. package/dist/lib/playroom/snippets/Text.cjs +9 -9
  87. package/dist/lib/playroom/snippets/Text.mjs +9 -9
  88. package/dist/lib/playroom/snippets/TextDropdown.cjs +3 -3
  89. package/dist/lib/playroom/snippets/TextDropdown.mjs +3 -3
  90. package/dist/lib/playroom/snippets/TextField.cjs +8 -8
  91. package/dist/lib/playroom/snippets/TextField.mjs +8 -8
  92. package/dist/lib/playroom/snippets/TextLink.cjs +3 -3
  93. package/dist/lib/playroom/snippets/TextLink.mjs +3 -3
  94. package/dist/lib/playroom/snippets/Textarea.cjs +10 -10
  95. package/dist/lib/playroom/snippets/Textarea.mjs +10 -10
  96. package/dist/lib/playroom/snippets/Tiles.cjs +2 -2
  97. package/dist/lib/playroom/snippets/Tiles.mjs +2 -2
  98. package/dist/lib/playroom/snippets/Toggle.cjs +5 -5
  99. package/dist/lib/playroom/snippets/Toggle.mjs +5 -5
  100. package/dist/lib/playroom/snippets/TooltipRenderer.cjs +1 -1
  101. package/dist/lib/playroom/snippets/TooltipRenderer.mjs +1 -1
  102. package/dist/lib/playroom/snippets.cjs +2 -2
  103. package/dist/lib/playroom/snippets.d.cts +2 -2
  104. package/dist/lib/playroom/snippets.d.mts +2 -2
  105. package/dist/lib/playroom/snippets.mjs +2 -2
  106. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # braid-design-system
2
2
 
3
+ ## 34.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - **Textarea:** Add support for automatic shrinking height with the `grow` prop (`true` by default). ([#2000](https://github.com/seek-oss/braid-design-system/pull/2000))
8
+
9
+ Automatically shrink and grow height with content when using the `grow` prop.
10
+
3
11
  ## 34.0.2
4
12
 
5
13
  ### Patch Changes
@@ -11,11 +11,17 @@ let react_jsx_runtime = require("react/jsx-runtime");
11
11
  const pxToInt = (str) => typeof str === "string" ? parseInt(str.replace("px", ""), 10) : 0;
12
12
  const calculateLines = (target, lines, lineLimit) => {
13
13
  const { paddingBottom, paddingTop, lineHeight } = window.getComputedStyle(target);
14
- if (!lineHeight.endsWith("px")) return lines;
14
+ const lineHeightCannotBeAccuratelyCalculated = !lineHeight.endsWith("px");
15
+ const heightSetByUser = Boolean(target.style.height);
16
+ if (lineHeightCannotBeAccuratelyCalculated || heightSetByUser) return lines;
15
17
  const padding = pxToInt(paddingTop) + pxToInt(paddingBottom);
16
- const currentRows = Math.floor((target.scrollHeight - padding) / pxToInt(lineHeight));
18
+ target.style.height = "0";
19
+ const scrollHeight = target.scrollHeight;
20
+ target.style.height = "";
21
+ const currentRows = Math.floor((scrollHeight - padding) / pxToInt(lineHeight));
17
22
  if (target && target.value === "") return lines;
18
- return typeof lineLimit === "number" && currentRows > lineLimit ? lineLimit : currentRows;
23
+ const linesWithLimitApplied = typeof lineLimit === "number" ? Math.min(currentRows, lineLimit) : currentRows;
24
+ return Math.max(linesWithLimitApplied, lines);
19
25
  };
20
26
  const Textarea = (0, react.forwardRef)(({ value, onChange, onBlur, onFocus, onPaste, placeholder, characterLimit, highlightRanges: highlightRangesProp = [], lines = 3, lineLimit, grow = true, tone, spellCheck, ...restProps }, ref) => {
21
27
  const [rows, setRows] = (0, react.useState)(lines);
@@ -10,11 +10,17 @@ import { jsx, jsxs } from "react/jsx-runtime";
10
10
  const pxToInt = (str) => typeof str === "string" ? parseInt(str.replace("px", ""), 10) : 0;
11
11
  const calculateLines = (target, lines, lineLimit) => {
12
12
  const { paddingBottom, paddingTop, lineHeight } = window.getComputedStyle(target);
13
- if (!lineHeight.endsWith("px")) return lines;
13
+ const lineHeightCannotBeAccuratelyCalculated = !lineHeight.endsWith("px");
14
+ const heightSetByUser = Boolean(target.style.height);
15
+ if (lineHeightCannotBeAccuratelyCalculated || heightSetByUser) return lines;
14
16
  const padding = pxToInt(paddingTop) + pxToInt(paddingBottom);
15
- const currentRows = Math.floor((target.scrollHeight - padding) / pxToInt(lineHeight));
17
+ target.style.height = "0";
18
+ const scrollHeight = target.scrollHeight;
19
+ target.style.height = "";
20
+ const currentRows = Math.floor((scrollHeight - padding) / pxToInt(lineHeight));
16
21
  if (target && target.value === "") return lines;
17
- return typeof lineLimit === "number" && currentRows > lineLimit ? lineLimit : currentRows;
22
+ const linesWithLimitApplied = typeof lineLimit === "number" ? Math.min(currentRows, lineLimit) : currentRows;
23
+ return Math.max(linesWithLimitApplied, lines);
18
24
  };
19
25
  const Textarea = forwardRef(({ value, onChange, onBlur, onFocus, onPaste, placeholder, characterLimit, highlightRanges: highlightRangesProp = [], lines = 3, lineLimit, grow = true, tone, spellCheck, ...restProps }, ref) => {
20
26
  const [rows, setRows] = useState(lines);
@@ -2,31 +2,31 @@
2
2
  //#region src/lib/playroom/snippets/Accordion.ts
3
3
  const snippets = [
4
4
  {
5
- name: "Large",
5
+ description: "Large",
6
6
  code: "<Accordion>\n <AccordionItem label=\"Item 1\">\n <Placeholder height={100} />\n </AccordionItem>\n <AccordionItem label=\"Item 2\">\n <Placeholder height={100} />\n </AccordionItem>\n <AccordionItem label=\"Item 3\">\n <Placeholder height={100} />\n </AccordionItem>\n</Accordion>"
7
7
  },
8
8
  {
9
- name: "Large, without dividers",
9
+ description: "Large, without dividers",
10
10
  code: "<Accordion dividers={false}>\n <AccordionItem label=\"Item 1\">\n <Placeholder height={100} />\n </AccordionItem>\n <AccordionItem label=\"Item 2\">\n <Placeholder height={100} />\n </AccordionItem>\n <AccordionItem label=\"Item 3\">\n <Placeholder height={100} />\n </AccordionItem>\n</Accordion>"
11
11
  },
12
12
  {
13
- name: "Standard",
13
+ description: "Standard",
14
14
  code: "<Accordion size=\"standard\">\n <AccordionItem label=\"Item 1\">\n <Placeholder height={100} />\n </AccordionItem>\n <AccordionItem label=\"Item 2\">\n <Placeholder height={100} />\n </AccordionItem>\n <AccordionItem label=\"Item 3\">\n <Placeholder height={100} />\n </AccordionItem>\n</Accordion>"
15
15
  },
16
16
  {
17
- name: "Standard, without dividers",
17
+ description: "Standard, without dividers",
18
18
  code: "<Accordion size=\"standard\" dividers={false}>\n <AccordionItem label=\"Item 1\">\n <Placeholder height={100} />\n </AccordionItem>\n <AccordionItem label=\"Item 2\">\n <Placeholder height={100} />\n </AccordionItem>\n <AccordionItem label=\"Item 3\">\n <Placeholder height={100} />\n </AccordionItem>\n</Accordion>"
19
19
  },
20
20
  {
21
- name: "Large standalone item",
21
+ description: "Large standalone item",
22
22
  code: "<AccordionItem label=\"Label\">\n <Placeholder height={100} />\n</AccordionItem>"
23
23
  },
24
24
  {
25
- name: "Standard standalone item",
25
+ description: "Standard standalone item",
26
26
  code: "<AccordionItem label=\"Label\" size=\"standard\">\n <Placeholder height={100} />\n</AccordionItem>"
27
27
  },
28
28
  {
29
- name: "Standalone item with a badge",
29
+ description: "Standalone item with a badge",
30
30
  code: "<AccordionItem\n label=\"Label\"\n badge={\n <Badge tone=\"promote\" weight=\"strong\">\n Badge\n </Badge>\n }\n>\n <Placeholder height={100} />\n</AccordionItem>"
31
31
  }
32
32
  ];
@@ -1,31 +1,31 @@
1
1
  //#region src/lib/playroom/snippets/Accordion.ts
2
2
  const snippets = [
3
3
  {
4
- name: "Large",
4
+ description: "Large",
5
5
  code: "<Accordion>\n <AccordionItem label=\"Item 1\">\n <Placeholder height={100} />\n </AccordionItem>\n <AccordionItem label=\"Item 2\">\n <Placeholder height={100} />\n </AccordionItem>\n <AccordionItem label=\"Item 3\">\n <Placeholder height={100} />\n </AccordionItem>\n</Accordion>"
6
6
  },
7
7
  {
8
- name: "Large, without dividers",
8
+ description: "Large, without dividers",
9
9
  code: "<Accordion dividers={false}>\n <AccordionItem label=\"Item 1\">\n <Placeholder height={100} />\n </AccordionItem>\n <AccordionItem label=\"Item 2\">\n <Placeholder height={100} />\n </AccordionItem>\n <AccordionItem label=\"Item 3\">\n <Placeholder height={100} />\n </AccordionItem>\n</Accordion>"
10
10
  },
11
11
  {
12
- name: "Standard",
12
+ description: "Standard",
13
13
  code: "<Accordion size=\"standard\">\n <AccordionItem label=\"Item 1\">\n <Placeholder height={100} />\n </AccordionItem>\n <AccordionItem label=\"Item 2\">\n <Placeholder height={100} />\n </AccordionItem>\n <AccordionItem label=\"Item 3\">\n <Placeholder height={100} />\n </AccordionItem>\n</Accordion>"
14
14
  },
15
15
  {
16
- name: "Standard, without dividers",
16
+ description: "Standard, without dividers",
17
17
  code: "<Accordion size=\"standard\" dividers={false}>\n <AccordionItem label=\"Item 1\">\n <Placeholder height={100} />\n </AccordionItem>\n <AccordionItem label=\"Item 2\">\n <Placeholder height={100} />\n </AccordionItem>\n <AccordionItem label=\"Item 3\">\n <Placeholder height={100} />\n </AccordionItem>\n</Accordion>"
18
18
  },
19
19
  {
20
- name: "Large standalone item",
20
+ description: "Large standalone item",
21
21
  code: "<AccordionItem label=\"Label\">\n <Placeholder height={100} />\n</AccordionItem>"
22
22
  },
23
23
  {
24
- name: "Standard standalone item",
24
+ description: "Standard standalone item",
25
25
  code: "<AccordionItem label=\"Label\" size=\"standard\">\n <Placeholder height={100} />\n</AccordionItem>"
26
26
  },
27
27
  {
28
- name: "Standalone item with a badge",
28
+ description: "Standalone item with a badge",
29
29
  code: "<AccordionItem\n label=\"Label\"\n badge={\n <Badge tone=\"promote\" weight=\"strong\">\n Badge\n </Badge>\n }\n>\n <Placeholder height={100} />\n</AccordionItem>"
30
30
  }
31
31
  ];
@@ -1,10 +1,10 @@
1
1
 
2
2
  //#region src/lib/playroom/snippets/Actions.ts
3
3
  const snippets = [{
4
- name: "Standard size",
4
+ description: "Standard size",
5
5
  code: "<Actions>\n <Button>Button 1</Button>\n <Button variant=\"transparent\">Button 2</Button>\n</Actions>"
6
6
  }, {
7
- name: "Small size",
7
+ description: "Small size",
8
8
  code: "<Actions size=\"small\">\n <Button>Button 1</Button>\n <Button>Button 2</Button>\n <Button variant=\"transparent\">Button 3</Button>\n</Actions>"
9
9
  }];
10
10
 
@@ -1,9 +1,9 @@
1
1
  //#region src/lib/playroom/snippets/Actions.ts
2
2
  const snippets = [{
3
- name: "Standard size",
3
+ description: "Standard size",
4
4
  code: "<Actions>\n <Button>Button 1</Button>\n <Button variant=\"transparent\">Button 2</Button>\n</Actions>"
5
5
  }, {
6
- name: "Small size",
6
+ description: "Small size",
7
7
  code: "<Actions size=\"small\">\n <Button>Button 1</Button>\n <Button>Button 2</Button>\n <Button variant=\"transparent\">Button 3</Button>\n</Actions>"
8
8
  }];
9
9
 
@@ -2,27 +2,27 @@
2
2
  //#region src/lib/playroom/snippets/Alert.ts
3
3
  const snippets = [
4
4
  {
5
- name: "Critical",
5
+ description: "Critical",
6
6
  code: "<Alert tone=\"critical\">\n <Text>Critical Alert</Text>\n</Alert>"
7
7
  },
8
8
  {
9
- name: "Caution",
9
+ description: "Caution",
10
10
  code: "<Alert tone=\"caution\">\n <Text>Caution Alert</Text>\n</Alert>"
11
11
  },
12
12
  {
13
- name: "Positive",
13
+ description: "Positive",
14
14
  code: "<Alert tone=\"positive\">\n <Text>Positive Alert</Text>\n</Alert>"
15
15
  },
16
16
  {
17
- name: "Info",
17
+ description: "Info",
18
18
  code: "<Alert tone=\"info\">\n <Text>Info Alert</Text>\n</Alert>"
19
19
  },
20
20
  {
21
- name: "Promote",
21
+ description: "Promote",
22
22
  code: "<Alert tone=\"promote\">\n <Text>Promote Alert</Text>\n</Alert>"
23
23
  },
24
24
  {
25
- name: "Dismissible alert",
25
+ description: "Dismissible alert",
26
26
  code: "<Alert onClose={() => {}} closeLabel=\"Close\">\n <Text>Dismissible Alert</Text>\n</Alert>"
27
27
  }
28
28
  ];
@@ -1,27 +1,27 @@
1
1
  //#region src/lib/playroom/snippets/Alert.ts
2
2
  const snippets = [
3
3
  {
4
- name: "Critical",
4
+ description: "Critical",
5
5
  code: "<Alert tone=\"critical\">\n <Text>Critical Alert</Text>\n</Alert>"
6
6
  },
7
7
  {
8
- name: "Caution",
8
+ description: "Caution",
9
9
  code: "<Alert tone=\"caution\">\n <Text>Caution Alert</Text>\n</Alert>"
10
10
  },
11
11
  {
12
- name: "Positive",
12
+ description: "Positive",
13
13
  code: "<Alert tone=\"positive\">\n <Text>Positive Alert</Text>\n</Alert>"
14
14
  },
15
15
  {
16
- name: "Info",
16
+ description: "Info",
17
17
  code: "<Alert tone=\"info\">\n <Text>Info Alert</Text>\n</Alert>"
18
18
  },
19
19
  {
20
- name: "Promote",
20
+ description: "Promote",
21
21
  code: "<Alert tone=\"promote\">\n <Text>Promote Alert</Text>\n</Alert>"
22
22
  },
23
23
  {
24
- name: "Dismissible alert",
24
+ description: "Dismissible alert",
25
25
  code: "<Alert onClose={() => {}} closeLabel=\"Close\">\n <Text>Dismissible Alert</Text>\n</Alert>"
26
26
  }
27
27
  ];
@@ -2,27 +2,27 @@
2
2
  //#region src/lib/playroom/snippets/Autosuggest.ts
3
3
  const snippets = [
4
4
  {
5
- name: "Standard",
5
+ description: "Standard",
6
6
  code: "<Autosuggest\n label=\"Fruit\"\n suggestions={[{ text: \"Apples\" }, { text: \"Bananas\" }, { text: \"Carrots\" }]}\n/>"
7
7
  },
8
8
  {
9
- name: "Grouped suggestions",
9
+ description: "Grouped suggestions",
10
10
  code: "<Autosuggest\n label=\"I like to eat\"\n suggestions={[\n {\n label: \"Fruit\",\n suggestions: [\n { text: \"Apples\" },\n { text: \"Bananas\" },\n { text: \"Carrots\" },\n ],\n },\n {\n label: \"Vegetables\",\n suggestions: [\n { text: \"Broccoli\" },\n { text: \"Carrots\" },\n { text: \"Carrots\" },\n ],\n },\n ]}\n/>"
11
11
  },
12
12
  {
13
- name: "With mobile backdrop",
13
+ description: "With mobile backdrop",
14
14
  code: "<Autosuggest\n showMobileBackdrop\n label=\"Fruit\"\n suggestions={[{ text: \"Apples\" }, { text: \"Bananas\" }, { text: \"Carrots\" }]}\n/>"
15
15
  },
16
16
  {
17
- name: "With error",
17
+ description: "With error",
18
18
  code: "<Autosuggest\n label=\"I like to eat\"\n tone=\"critical\"\n message=\"You must make a selection\"\n suggestions={[{ text: \"Apples\" }, { text: \"Bananas\" }, { text: \"Carrots\" }]}\n/>"
19
19
  },
20
20
  {
21
- name: "With description",
21
+ description: "With description",
22
22
  code: "<Autosuggest\n label=\"Fruit\"\n description=\"Select your favourite fruit to eat from the available suggestions.\"\n suggestions={[{ text: \"Apples\" }, { text: \"Bananas\" }, { text: \"Carrots\" }]}\n/>"
23
23
  },
24
24
  {
25
- name: "With icon",
25
+ description: "With icon",
26
26
  code: "<Autosuggest\n aria-label=\"Location\"\n icon={<IconLocation />}\n placeholder=\"Enter a location\"\n suggestions={[\n { text: \"Adelaide\" },\n { text: \"Brisbane\" },\n { text: \"Darwin\" },\n { text: \"Hobart\" },\n { text: \"Melbourne\" },\n { text: \"Perth\" },\n { text: \"Sydney\" },\n ]}\n/>"
27
27
  }
28
28
  ];
@@ -1,27 +1,27 @@
1
1
  //#region src/lib/playroom/snippets/Autosuggest.ts
2
2
  const snippets = [
3
3
  {
4
- name: "Standard",
4
+ description: "Standard",
5
5
  code: "<Autosuggest\n label=\"Fruit\"\n suggestions={[{ text: \"Apples\" }, { text: \"Bananas\" }, { text: \"Carrots\" }]}\n/>"
6
6
  },
7
7
  {
8
- name: "Grouped suggestions",
8
+ description: "Grouped suggestions",
9
9
  code: "<Autosuggest\n label=\"I like to eat\"\n suggestions={[\n {\n label: \"Fruit\",\n suggestions: [\n { text: \"Apples\" },\n { text: \"Bananas\" },\n { text: \"Carrots\" },\n ],\n },\n {\n label: \"Vegetables\",\n suggestions: [\n { text: \"Broccoli\" },\n { text: \"Carrots\" },\n { text: \"Carrots\" },\n ],\n },\n ]}\n/>"
10
10
  },
11
11
  {
12
- name: "With mobile backdrop",
12
+ description: "With mobile backdrop",
13
13
  code: "<Autosuggest\n showMobileBackdrop\n label=\"Fruit\"\n suggestions={[{ text: \"Apples\" }, { text: \"Bananas\" }, { text: \"Carrots\" }]}\n/>"
14
14
  },
15
15
  {
16
- name: "With error",
16
+ description: "With error",
17
17
  code: "<Autosuggest\n label=\"I like to eat\"\n tone=\"critical\"\n message=\"You must make a selection\"\n suggestions={[{ text: \"Apples\" }, { text: \"Bananas\" }, { text: \"Carrots\" }]}\n/>"
18
18
  },
19
19
  {
20
- name: "With description",
20
+ description: "With description",
21
21
  code: "<Autosuggest\n label=\"Fruit\"\n description=\"Select your favourite fruit to eat from the available suggestions.\"\n suggestions={[{ text: \"Apples\" }, { text: \"Bananas\" }, { text: \"Carrots\" }]}\n/>"
22
22
  },
23
23
  {
24
- name: "With icon",
24
+ description: "With icon",
25
25
  code: "<Autosuggest\n aria-label=\"Location\"\n icon={<IconLocation />}\n placeholder=\"Enter a location\"\n suggestions={[\n { text: \"Adelaide\" },\n { text: \"Brisbane\" },\n { text: \"Darwin\" },\n { text: \"Hobart\" },\n { text: \"Melbourne\" },\n { text: \"Perth\" },\n { text: \"Sydney\" },\n ]}\n/>"
26
26
  }
27
27
  ];
@@ -2,55 +2,55 @@
2
2
  //#region src/lib/playroom/snippets/Badge.ts
3
3
  const snippets = [
4
4
  {
5
- name: "Info",
5
+ description: "Info",
6
6
  code: "<Badge tone=\"info\">Badge</Badge>"
7
7
  },
8
8
  {
9
- name: "Info (strong)",
9
+ description: "Info (strong)",
10
10
  code: "<Badge tone=\"info\" weight=\"strong\">\n Badge\n</Badge>"
11
11
  },
12
12
  {
13
- name: "Promote",
13
+ description: "Promote",
14
14
  code: "<Badge tone=\"promote\">Badge</Badge>"
15
15
  },
16
16
  {
17
- name: "Promote (strong)",
17
+ description: "Promote (strong)",
18
18
  code: "<Badge tone=\"promote\" weight=\"strong\">\n Badge\n</Badge>"
19
19
  },
20
20
  {
21
- name: "Positive",
21
+ description: "Positive",
22
22
  code: "<Badge tone=\"positive\">Badge</Badge>"
23
23
  },
24
24
  {
25
- name: "Positive (strong)",
25
+ description: "Positive (strong)",
26
26
  code: "<Badge tone=\"positive\" weight=\"strong\">\n Badge\n</Badge>"
27
27
  },
28
28
  {
29
- name: "Caution",
29
+ description: "Caution",
30
30
  code: "<Badge tone=\"caution\">Badge</Badge>"
31
31
  },
32
32
  {
33
- name: "Caution (strong)",
33
+ description: "Caution (strong)",
34
34
  code: "<Badge tone=\"caution\" weight=\"strong\">\n Badge\n</Badge>"
35
35
  },
36
36
  {
37
- name: "Critical",
37
+ description: "Critical",
38
38
  code: "<Badge tone=\"critical\">Badge</Badge>"
39
39
  },
40
40
  {
41
- name: "Critical (strong)",
41
+ description: "Critical (strong)",
42
42
  code: "<Badge tone=\"critical\" weight=\"strong\">\n Badge\n</Badge>"
43
43
  },
44
44
  {
45
- name: "Neutral",
45
+ description: "Neutral",
46
46
  code: "<Badge tone=\"neutral\">Badge</Badge>"
47
47
  },
48
48
  {
49
- name: "Neutral (strong)",
49
+ description: "Neutral (strong)",
50
50
  code: "<Badge tone=\"neutral\" weight=\"strong\">\n Badge\n</Badge>"
51
51
  },
52
52
  {
53
- name: "Multiple",
53
+ description: "Multiple",
54
54
  code: "<Inline space=\"small\">\n <Badge tone=\"info\">Badge</Badge>\n <Badge tone=\"positive\">Badge</Badge>\n <Badge tone=\"promote\">Badge</Badge>\n</Inline>"
55
55
  }
56
56
  ];
@@ -1,55 +1,55 @@
1
1
  //#region src/lib/playroom/snippets/Badge.ts
2
2
  const snippets = [
3
3
  {
4
- name: "Info",
4
+ description: "Info",
5
5
  code: "<Badge tone=\"info\">Badge</Badge>"
6
6
  },
7
7
  {
8
- name: "Info (strong)",
8
+ description: "Info (strong)",
9
9
  code: "<Badge tone=\"info\" weight=\"strong\">\n Badge\n</Badge>"
10
10
  },
11
11
  {
12
- name: "Promote",
12
+ description: "Promote",
13
13
  code: "<Badge tone=\"promote\">Badge</Badge>"
14
14
  },
15
15
  {
16
- name: "Promote (strong)",
16
+ description: "Promote (strong)",
17
17
  code: "<Badge tone=\"promote\" weight=\"strong\">\n Badge\n</Badge>"
18
18
  },
19
19
  {
20
- name: "Positive",
20
+ description: "Positive",
21
21
  code: "<Badge tone=\"positive\">Badge</Badge>"
22
22
  },
23
23
  {
24
- name: "Positive (strong)",
24
+ description: "Positive (strong)",
25
25
  code: "<Badge tone=\"positive\" weight=\"strong\">\n Badge\n</Badge>"
26
26
  },
27
27
  {
28
- name: "Caution",
28
+ description: "Caution",
29
29
  code: "<Badge tone=\"caution\">Badge</Badge>"
30
30
  },
31
31
  {
32
- name: "Caution (strong)",
32
+ description: "Caution (strong)",
33
33
  code: "<Badge tone=\"caution\" weight=\"strong\">\n Badge\n</Badge>"
34
34
  },
35
35
  {
36
- name: "Critical",
36
+ description: "Critical",
37
37
  code: "<Badge tone=\"critical\">Badge</Badge>"
38
38
  },
39
39
  {
40
- name: "Critical (strong)",
40
+ description: "Critical (strong)",
41
41
  code: "<Badge tone=\"critical\" weight=\"strong\">\n Badge\n</Badge>"
42
42
  },
43
43
  {
44
- name: "Neutral",
44
+ description: "Neutral",
45
45
  code: "<Badge tone=\"neutral\">Badge</Badge>"
46
46
  },
47
47
  {
48
- name: "Neutral (strong)",
48
+ description: "Neutral (strong)",
49
49
  code: "<Badge tone=\"neutral\" weight=\"strong\">\n Badge\n</Badge>"
50
50
  },
51
51
  {
52
- name: "Multiple",
52
+ description: "Multiple",
53
53
  code: "<Inline space=\"small\">\n <Badge tone=\"info\">Badge</Badge>\n <Badge tone=\"positive\">Badge</Badge>\n <Badge tone=\"promote\">Badge</Badge>\n</Inline>"
54
54
  }
55
55
  ];
@@ -2,31 +2,31 @@
2
2
  //#region src/lib/playroom/snippets/Bleed.ts
3
3
  const snippets = [
4
4
  {
5
- name: "On all sides",
5
+ description: "On all sides",
6
6
  code: "<Bleed space=\"gutter\">\n <Placeholder height={80} />\n</Bleed>"
7
7
  },
8
8
  {
9
- name: "Horizontally",
9
+ description: "Horizontally",
10
10
  code: "<Bleed horizontal=\"gutter\">\n <Placeholder height={80} />\n</Bleed>"
11
11
  },
12
12
  {
13
- name: "Vertically",
13
+ description: "Vertically",
14
14
  code: "<Bleed vertical=\"gutter\">\n <Placeholder height={80} />\n</Bleed>"
15
15
  },
16
16
  {
17
- name: "To the top",
17
+ description: "To the top",
18
18
  code: "<Bleed top=\"gutter\">\n <Placeholder height={80} />\n</Bleed>"
19
19
  },
20
20
  {
21
- name: "To the bottom",
21
+ description: "To the bottom",
22
22
  code: "<Bleed bottom=\"gutter\">\n <Placeholder height={80} />\n</Bleed>"
23
23
  },
24
24
  {
25
- name: "To the left",
25
+ description: "To the left",
26
26
  code: "<Bleed left=\"gutter\">\n <Placeholder height={80} />\n</Bleed>"
27
27
  },
28
28
  {
29
- name: "To the right",
29
+ description: "To the right",
30
30
  code: "<Bleed right=\"gutter\">\n <Placeholder height={80} />\n</Bleed>"
31
31
  }
32
32
  ];
@@ -1,31 +1,31 @@
1
1
  //#region src/lib/playroom/snippets/Bleed.ts
2
2
  const snippets = [
3
3
  {
4
- name: "On all sides",
4
+ description: "On all sides",
5
5
  code: "<Bleed space=\"gutter\">\n <Placeholder height={80} />\n</Bleed>"
6
6
  },
7
7
  {
8
- name: "Horizontally",
8
+ description: "Horizontally",
9
9
  code: "<Bleed horizontal=\"gutter\">\n <Placeholder height={80} />\n</Bleed>"
10
10
  },
11
11
  {
12
- name: "Vertically",
12
+ description: "Vertically",
13
13
  code: "<Bleed vertical=\"gutter\">\n <Placeholder height={80} />\n</Bleed>"
14
14
  },
15
15
  {
16
- name: "To the top",
16
+ description: "To the top",
17
17
  code: "<Bleed top=\"gutter\">\n <Placeholder height={80} />\n</Bleed>"
18
18
  },
19
19
  {
20
- name: "To the bottom",
20
+ description: "To the bottom",
21
21
  code: "<Bleed bottom=\"gutter\">\n <Placeholder height={80} />\n</Bleed>"
22
22
  },
23
23
  {
24
- name: "To the left",
24
+ description: "To the left",
25
25
  code: "<Bleed left=\"gutter\">\n <Placeholder height={80} />\n</Bleed>"
26
26
  },
27
27
  {
28
- name: "To the right",
28
+ description: "To the right",
29
29
  code: "<Bleed right=\"gutter\">\n <Placeholder height={80} />\n</Bleed>"
30
30
  }
31
31
  ];
@@ -2,83 +2,83 @@
2
2
  //#region src/lib/playroom/snippets/Button.ts
3
3
  const snippets = [
4
4
  {
5
- name: "Solid",
5
+ description: "Solid",
6
6
  code: "<Button variant=\"solid\">Button</Button>"
7
7
  },
8
8
  {
9
- name: "Ghost",
9
+ description: "Ghost",
10
10
  code: "<Button variant=\"ghost\">Button</Button>"
11
11
  },
12
12
  {
13
- name: "Soft",
13
+ description: "Soft",
14
14
  code: "<Button variant=\"soft\">Button</Button>"
15
15
  },
16
16
  {
17
- name: "Transparent",
17
+ description: "Transparent",
18
18
  code: "<Button variant=\"transparent\">Button</Button>"
19
19
  },
20
20
  {
21
- name: "Critical Solid",
21
+ description: "Critical Solid",
22
22
  code: "<Button tone=\"critical\" variant=\"solid\">\n Button\n</Button>"
23
23
  },
24
24
  {
25
- name: "Critical Ghost",
25
+ description: "Critical Ghost",
26
26
  code: "<Button tone=\"critical\" variant=\"ghost\">\n Button\n</Button>"
27
27
  },
28
28
  {
29
- name: "Critical Soft",
29
+ description: "Critical Soft",
30
30
  code: "<Button tone=\"critical\" variant=\"soft\">\n Button\n</Button>"
31
31
  },
32
32
  {
33
- name: "Critical Transparent",
33
+ description: "Critical Transparent",
34
34
  code: "<Button tone=\"critical\" variant=\"transparent\">\n Button\n</Button>"
35
35
  },
36
36
  {
37
- name: "BrandAccent Solid",
37
+ description: "BrandAccent Solid",
38
38
  code: "<Button tone=\"brandAccent\" variant=\"solid\">\n Button\n</Button>"
39
39
  },
40
40
  {
41
- name: "BrandAccent Ghost",
41
+ description: "BrandAccent Ghost",
42
42
  code: "<Button tone=\"brandAccent\" variant=\"ghost\">\n Button\n</Button>"
43
43
  },
44
44
  {
45
- name: "BrandAccent Soft",
45
+ description: "BrandAccent Soft",
46
46
  code: "<Button tone=\"brandAccent\" variant=\"soft\">\n Button\n</Button>"
47
47
  },
48
48
  {
49
- name: "BrandAccent Transparent",
49
+ description: "BrandAccent Transparent",
50
50
  code: "<Button tone=\"brandAccent\" variant=\"transparent\">\n Button\n</Button>"
51
51
  },
52
52
  {
53
- name: "Neutral Solid",
53
+ description: "Neutral Solid",
54
54
  code: "<Button tone=\"neutral\" variant=\"solid\">\n Button\n</Button>"
55
55
  },
56
56
  {
57
- name: "Neutral Ghost",
57
+ description: "Neutral Ghost",
58
58
  code: "<Button tone=\"neutral\" variant=\"ghost\">\n Button\n</Button>"
59
59
  },
60
60
  {
61
- name: "Neutral Soft",
61
+ description: "Neutral Soft",
62
62
  code: "<Button tone=\"neutral\" variant=\"soft\">\n Button\n</Button>"
63
63
  },
64
64
  {
65
- name: "Neutral Transparent",
65
+ description: "Neutral Transparent",
66
66
  code: "<Button tone=\"neutral\" variant=\"transparent\">\n Button\n</Button>"
67
67
  },
68
68
  {
69
- name: "Small Solid",
69
+ description: "Small Solid",
70
70
  code: "<Button size=\"small\" variant=\"solid\">\n Button\n</Button>"
71
71
  },
72
72
  {
73
- name: "Small Ghost",
73
+ description: "Small Ghost",
74
74
  code: "<Button size=\"small\" variant=\"ghost\">\n Button\n</Button>"
75
75
  },
76
76
  {
77
- name: "Small Soft",
77
+ description: "Small Soft",
78
78
  code: "<Button size=\"small\" variant=\"soft\">\n Button\n</Button>"
79
79
  },
80
80
  {
81
- name: "Small Transparent",
81
+ description: "Small Transparent",
82
82
  code: "<Button size=\"small\" variant=\"transparent\">\n Button\n</Button>"
83
83
  }
84
84
  ];