braid-design-system 34.0.2 → 34.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/color-mode/query-param.d.cts +1 -1
- package/dist/color-mode/query-param.d.mts +1 -1
- package/dist/lib/components/Accordion/AccordionContext.d.mts +0 -2
- package/dist/lib/components/Box/Box.playroom.cjs +1 -0
- package/dist/lib/components/Box/Box.playroom.mjs +1 -0
- package/dist/lib/components/Button/Button.d.mts +0 -3
- package/dist/lib/components/Columns/ColumnsContext.d.mts +0 -5
- package/dist/lib/components/Dialog/Dialog.d.mts +0 -3
- package/dist/lib/components/Drawer/Drawer.d.mts +0 -3
- package/dist/lib/components/Hidden/Hidden.d.cts +1 -1
- package/dist/lib/components/Hidden/Hidden.d.mts +1 -1
- package/dist/lib/components/Hidden/Hidden.playroom.cjs +10 -0
- package/dist/lib/components/Hidden/Hidden.playroom.d.cts +7 -0
- package/dist/lib/components/Hidden/Hidden.playroom.d.mts +7 -0
- package/dist/lib/components/Hidden/Hidden.playroom.mjs +9 -0
- package/dist/lib/components/HiddenVisually/HiddenVisually.playroom.cjs +10 -0
- package/dist/lib/components/HiddenVisually/HiddenVisually.playroom.d.cts +7 -0
- package/dist/lib/components/HiddenVisually/HiddenVisually.playroom.d.mts +7 -0
- package/dist/lib/components/HiddenVisually/HiddenVisually.playroom.mjs +9 -0
- package/dist/lib/components/MenuItem/useMenuItem.d.mts +0 -3
- package/dist/lib/components/MenuRenderer/MenuRenderer.d.mts +0 -2
- package/dist/lib/components/Stack/Stack.playroom.cjs +52 -5
- package/dist/lib/components/Stack/Stack.playroom.mjs +53 -6
- package/dist/lib/components/Stepper/StepperContext.d.mts +0 -2
- package/dist/lib/components/Tabs/Tab.d.mts +0 -2
- package/dist/lib/components/Tabs/TabListContext.d.mts +0 -2
- package/dist/lib/components/TextLink/TextLink.d.mts +0 -3
- package/dist/lib/components/Textarea/Textarea.cjs +9 -3
- package/dist/lib/components/Textarea/Textarea.mjs +9 -3
- package/dist/lib/components/TooltipRenderer/TooltipRenderer.d.mts +0 -2
- package/dist/lib/components/icons/IconContainer.d.mts +0 -3
- package/dist/lib/components/icons/SVGTypes.d.mts +0 -2
- package/dist/lib/components/index.d.mts +0 -2
- package/dist/lib/components/private/Field/Field.d.mts +0 -3
- package/dist/lib/components/private/FieldGroup/FieldGroup.d.mts +0 -4
- package/dist/lib/components/private/Modal/Modal.d.mts +0 -3
- package/dist/lib/components/private/Modal/ModalContent.d.mts +0 -2
- package/dist/lib/components/private/Typography/Typography.d.mts +0 -2
- package/dist/lib/css/typography.css.d.mts +0 -2
- package/dist/lib/hooks/useIcon/index.d.mts +0 -1
- package/dist/lib/playroom/FrameComponent.cjs +15 -27
- package/dist/lib/playroom/FrameComponent.d.cts +3 -1
- package/dist/lib/playroom/FrameComponent.d.mts +3 -1
- package/dist/lib/playroom/FrameComponent.mjs +16 -28
- package/dist/lib/playroom/SpaceDebugContext.cjs +8 -0
- package/dist/lib/playroom/SpaceDebugContext.mjs +7 -0
- package/dist/lib/playroom/components/DebugSpace/DebugSpace.cjs +86 -0
- package/dist/lib/playroom/components/DebugSpace/DebugSpace.css.cjs +34 -0
- package/dist/lib/playroom/components/DebugSpace/DebugSpace.css.mjs +28 -0
- package/dist/lib/playroom/components/DebugSpace/DebugSpace.mjs +85 -0
- package/dist/lib/playroom/components.cjs +2 -2
- package/dist/lib/playroom/components.d.cts +2 -2
- package/dist/lib/playroom/components.d.mts +2 -2
- package/dist/lib/playroom/components.mjs +2 -2
- package/dist/lib/playroom/playroomState.d.cts +1 -1
- package/dist/lib/playroom/playroomState.d.mts +1 -3
- package/dist/lib/playroom/snippets/Accordion.cjs +7 -7
- package/dist/lib/playroom/snippets/Accordion.mjs +7 -7
- package/dist/lib/playroom/snippets/Actions.cjs +2 -2
- package/dist/lib/playroom/snippets/Actions.mjs +2 -2
- package/dist/lib/playroom/snippets/Alert.cjs +6 -6
- package/dist/lib/playroom/snippets/Alert.mjs +6 -6
- package/dist/lib/playroom/snippets/Autosuggest.cjs +6 -6
- package/dist/lib/playroom/snippets/Autosuggest.mjs +6 -6
- package/dist/lib/playroom/snippets/Badge.cjs +13 -13
- package/dist/lib/playroom/snippets/Badge.mjs +13 -13
- package/dist/lib/playroom/snippets/Bleed.cjs +7 -7
- package/dist/lib/playroom/snippets/Bleed.mjs +7 -7
- package/dist/lib/playroom/snippets/Button.cjs +20 -20
- package/dist/lib/playroom/snippets/Button.mjs +20 -20
- package/dist/lib/playroom/snippets/ButtonIcon.cjs +5 -5
- package/dist/lib/playroom/snippets/ButtonIcon.mjs +5 -5
- package/dist/lib/playroom/snippets/Card.cjs +4 -4
- package/dist/lib/playroom/snippets/Card.mjs +4 -4
- package/dist/lib/playroom/snippets/Checkbox.cjs +6 -6
- package/dist/lib/playroom/snippets/Checkbox.mjs +6 -6
- package/dist/lib/playroom/snippets/Columns.cjs +5 -5
- package/dist/lib/playroom/snippets/Columns.mjs +5 -5
- package/dist/lib/playroom/snippets/ContentBlock.cjs +5 -5
- package/dist/lib/playroom/snippets/ContentBlock.mjs +5 -5
- package/dist/lib/playroom/snippets/Dialog.cjs +6 -6
- package/dist/lib/playroom/snippets/Dialog.mjs +6 -6
- package/dist/lib/playroom/snippets/Disclosure.cjs +1 -1
- package/dist/lib/playroom/snippets/Disclosure.mjs +1 -1
- package/dist/lib/playroom/snippets/Divider.cjs +2 -2
- package/dist/lib/playroom/snippets/Divider.mjs +2 -2
- package/dist/lib/playroom/snippets/Drawer.cjs +4 -4
- package/dist/lib/playroom/snippets/Drawer.mjs +4 -4
- package/dist/lib/playroom/snippets/Dropdown.cjs +7 -7
- package/dist/lib/playroom/snippets/Dropdown.mjs +7 -7
- package/dist/lib/playroom/snippets/FieldLabel.cjs +3 -3
- package/dist/lib/playroom/snippets/FieldLabel.mjs +3 -3
- package/dist/lib/playroom/snippets/FieldMessage.cjs +4 -4
- package/dist/lib/playroom/snippets/FieldMessage.mjs +4 -4
- package/dist/lib/playroom/snippets/Heading.cjs +9 -9
- package/dist/lib/playroom/snippets/Heading.mjs +9 -9
- package/dist/lib/playroom/snippets/Inline.cjs +3 -3
- package/dist/lib/playroom/snippets/Inline.mjs +3 -3
- package/dist/lib/playroom/snippets/List.cjs +8 -8
- package/dist/lib/playroom/snippets/List.mjs +8 -8
- package/dist/lib/playroom/snippets/Loader.cjs +1 -1
- package/dist/lib/playroom/snippets/Loader.mjs +1 -1
- package/dist/lib/playroom/snippets/MenuRenderer.cjs +5 -5
- package/dist/lib/playroom/snippets/MenuRenderer.mjs +5 -5
- package/dist/lib/playroom/snippets/MonthPicker.cjs +7 -7
- package/dist/lib/playroom/snippets/MonthPicker.mjs +7 -7
- package/dist/lib/playroom/snippets/Notice.cjs +4 -4
- package/dist/lib/playroom/snippets/Notice.mjs +4 -4
- package/dist/lib/playroom/snippets/OverflowMenu.cjs +2 -2
- package/dist/lib/playroom/snippets/OverflowMenu.mjs +2 -2
- package/dist/lib/playroom/snippets/Page.cjs +2 -2
- package/dist/lib/playroom/snippets/Page.mjs +2 -2
- package/dist/lib/playroom/snippets/PageBlock.cjs +4 -4
- package/dist/lib/playroom/snippets/PageBlock.mjs +4 -4
- package/dist/lib/playroom/snippets/Pagination.cjs +1 -1
- package/dist/lib/playroom/snippets/Pagination.mjs +1 -1
- package/dist/lib/playroom/snippets/PasswordField.cjs +6 -6
- package/dist/lib/playroom/snippets/PasswordField.mjs +6 -6
- package/dist/lib/playroom/snippets/RadioGroup.cjs +7 -7
- package/dist/lib/playroom/snippets/RadioGroup.mjs +7 -7
- package/dist/lib/playroom/snippets/Rating.cjs +4 -4
- package/dist/lib/playroom/snippets/Rating.mjs +4 -4
- package/dist/lib/playroom/snippets/Secondary.cjs +1 -1
- package/dist/lib/playroom/snippets/Secondary.mjs +1 -1
- package/dist/lib/playroom/snippets/Spread.cjs +4 -4
- package/dist/lib/playroom/snippets/Spread.mjs +4 -4
- package/dist/lib/playroom/snippets/Stack.cjs +9 -9
- package/dist/lib/playroom/snippets/Stack.mjs +9 -9
- package/dist/lib/playroom/snippets/Stepper.cjs +4 -4
- package/dist/lib/playroom/snippets/Stepper.mjs +4 -4
- package/dist/lib/playroom/snippets/Strong.cjs +1 -1
- package/dist/lib/playroom/snippets/Strong.mjs +1 -1
- package/dist/lib/playroom/snippets/Table.cjs +3 -3
- package/dist/lib/playroom/snippets/Table.mjs +3 -3
- package/dist/lib/playroom/snippets/Tabs.cjs +6 -6
- package/dist/lib/playroom/snippets/Tabs.mjs +6 -6
- package/dist/lib/playroom/snippets/Tag.cjs +5 -5
- package/dist/lib/playroom/snippets/Tag.mjs +5 -5
- package/dist/lib/playroom/snippets/Text.cjs +9 -9
- package/dist/lib/playroom/snippets/Text.mjs +9 -9
- package/dist/lib/playroom/snippets/TextDropdown.cjs +3 -3
- package/dist/lib/playroom/snippets/TextDropdown.mjs +3 -3
- package/dist/lib/playroom/snippets/TextField.cjs +8 -8
- package/dist/lib/playroom/snippets/TextField.mjs +8 -8
- package/dist/lib/playroom/snippets/TextLink.cjs +3 -3
- package/dist/lib/playroom/snippets/TextLink.mjs +3 -3
- package/dist/lib/playroom/snippets/Textarea.cjs +10 -10
- package/dist/lib/playroom/snippets/Textarea.mjs +10 -10
- package/dist/lib/playroom/snippets/Tiles.cjs +2 -2
- package/dist/lib/playroom/snippets/Tiles.mjs +2 -2
- package/dist/lib/playroom/snippets/Toggle.cjs +5 -5
- package/dist/lib/playroom/snippets/Toggle.mjs +5 -5
- package/dist/lib/playroom/snippets/TooltipRenderer.cjs +1 -1
- package/dist/lib/playroom/snippets/TooltipRenderer.mjs +1 -1
- package/dist/lib/playroom/snippets/blocks.cjs +59 -0
- package/dist/lib/playroom/snippets/blocks.mjs +58 -0
- package/dist/lib/playroom/snippets/layouts.cjs +22 -0
- package/dist/lib/playroom/snippets/layouts.mjs +21 -0
- package/dist/lib/playroom/snippets.cjs +22 -5
- package/dist/lib/playroom/snippets.d.cts +2 -6
- package/dist/lib/playroom/snippets.d.mts +2 -6
- package/dist/lib/playroom/snippets.mjs +22 -5
- package/dist/lib/playroom/useScope.d.mts +0 -1
- package/dist/lib/utils/align.d.mts +0 -2
- package/dist/playroom/components.cjs +4 -4
- package/dist/playroom/components.d.cts +2 -2
- package/dist/playroom/components.d.mts +2 -2
- package/dist/playroom/components.mjs +2 -2
- package/dist/playroom/frameSettings.cjs +15 -0
- package/dist/playroom/frameSettings.d.cts +8 -0
- package/dist/playroom/frameSettings.d.mts +8 -0
- package/dist/playroom/frameSettings.mjs +13 -0
- package/dist/playroom/snippets.d.cts +2 -2
- package/dist/playroom/snippets.d.mts +2 -2
- package/dist/playroom/snippets.mjs +2 -2
- package/dist/reset.d.mts +1 -1
- package/package.json +6 -2
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
//#region src/lib/playroom/snippets/TextField.ts
|
|
2
2
|
const snippets = [
|
|
3
3
|
{
|
|
4
|
-
|
|
4
|
+
description: "Standard",
|
|
5
5
|
code: "<TextField label=\"Label\" />"
|
|
6
6
|
},
|
|
7
7
|
{
|
|
8
|
-
|
|
8
|
+
description: "With additional labels",
|
|
9
9
|
code: "<TextField\n label=\"Label\"\n secondaryLabel=\"optional\"\n tertiaryLabel={\n <TextLink href=\"#\" icon={<IconHelp />}>\n Help\n </TextLink>\n }\n/>"
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
|
-
|
|
12
|
+
description: "With a description",
|
|
13
13
|
code: "<TextField label=\"Label\" description=\"More detailed description of field.\" />"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
|
-
|
|
16
|
+
description: "With an icon",
|
|
17
17
|
code: "<TextField label=\"Label\" icon={<IconSearch />} placeholder=\"Search\" />"
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
|
-
|
|
20
|
+
description: "With a prefix",
|
|
21
21
|
code: "<TextField label=\"Label\" prefix=\"Prefix\" placeholder=\"Search\" />"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
|
|
24
|
+
description: "With a critical message",
|
|
25
25
|
code: "<TextField label=\"Label\" tone=\"critical\" message=\"Critical message\" />"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
|
|
28
|
+
description: "With a positive message",
|
|
29
29
|
code: "<TextField label=\"Label\" tone=\"positive\" message=\"Positive message\" />"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
|
|
32
|
+
description: "With a neutral message",
|
|
33
33
|
code: "<TextField label=\"Label\" tone=\"neutral\" message=\"Neutral message\" />"
|
|
34
34
|
}
|
|
35
35
|
];
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
//#region src/lib/playroom/snippets/TextLink.ts
|
|
3
3
|
const snippets = [
|
|
4
4
|
{
|
|
5
|
-
|
|
5
|
+
description: "Inline link",
|
|
6
6
|
code: "<Text>\n <TextLink href=\"#\">Link text</TextLink>\n</Text>"
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
|
-
|
|
9
|
+
description: "Large hit area",
|
|
10
10
|
code: "<Text>\n <TextLink href=\"#\" hitArea=\"large\">\n Large hit area\n </TextLink>\n</Text>"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
|
-
|
|
13
|
+
description: "Visited",
|
|
14
14
|
code: "<Text>\n <TextLink href=\"\" showVisited>\n Visited link\n </TextLink>\n</Text>"
|
|
15
15
|
}
|
|
16
16
|
];
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
//#region src/lib/playroom/snippets/TextLink.ts
|
|
2
2
|
const snippets = [
|
|
3
3
|
{
|
|
4
|
-
|
|
4
|
+
description: "Inline link",
|
|
5
5
|
code: "<Text>\n <TextLink href=\"#\">Link text</TextLink>\n</Text>"
|
|
6
6
|
},
|
|
7
7
|
{
|
|
8
|
-
|
|
8
|
+
description: "Large hit area",
|
|
9
9
|
code: "<Text>\n <TextLink href=\"#\" hitArea=\"large\">\n Large hit area\n </TextLink>\n</Text>"
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
|
-
|
|
12
|
+
description: "Visited",
|
|
13
13
|
code: "<Text>\n <TextLink href=\"\" showVisited>\n Visited link\n </TextLink>\n</Text>"
|
|
14
14
|
}
|
|
15
15
|
];
|
|
@@ -2,43 +2,43 @@
|
|
|
2
2
|
//#region src/lib/playroom/snippets/Textarea.ts
|
|
3
3
|
const snippets = [
|
|
4
4
|
{
|
|
5
|
-
|
|
5
|
+
description: "Standard",
|
|
6
6
|
code: "<Textarea label=\"Label\" />"
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
|
-
|
|
9
|
+
description: "With additional labels",
|
|
10
10
|
code: "<Textarea\n label=\"Label\"\n secondaryLabel=\"optional\"\n tertiaryLabel={\n <TextLink href=\"#\" icon={<IconHelp />}>\n Help\n </TextLink>\n }\n/>"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
|
-
|
|
13
|
+
description: "With a description",
|
|
14
14
|
code: "<Textarea label=\"Label\" description=\"More detailed description of field.\" />"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
|
|
17
|
+
description: "With a critical message",
|
|
18
18
|
code: "<Textarea label=\"Label\" tone=\"critical\" message=\"Critical message\" />"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
|
-
|
|
21
|
+
description: "With a positive message",
|
|
22
22
|
code: "<Textarea label=\"Label\" tone=\"positive\" message=\"Positive message\" />"
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
|
-
|
|
25
|
+
description: "With a neutral message",
|
|
26
26
|
code: "<Textarea label=\"Label\" tone=\"neutral\" message=\"Neutral message\" />"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
|
-
|
|
29
|
+
description: "With fixed height of 5 lines",
|
|
30
30
|
code: "<Textarea label=\"Label\" grow={false} lines={5} />"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
|
-
|
|
33
|
+
description: "With dynamic height, limited to 7 lines",
|
|
34
34
|
code: "<Textarea label=\"Label\" grow={true} lineLimit={7} />"
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
|
-
|
|
37
|
+
description: "With character limit",
|
|
38
38
|
code: "<Textarea\n label=\"Label\"\n description=\"Character limit of 100\"\n characterLimit={100}\n/>"
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
|
-
|
|
41
|
+
description: "With a highlighted range",
|
|
42
42
|
code: "<Textarea\n label=\"Label\"\n description=\"Characters 11-20 are highlighted\"\n tone=\"critical\"\n message=\"Critical message\"\n highlightRanges={[{ start: 11, end: 20 }]}\n/>"
|
|
43
43
|
}
|
|
44
44
|
];
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
//#region src/lib/playroom/snippets/Textarea.ts
|
|
2
2
|
const snippets = [
|
|
3
3
|
{
|
|
4
|
-
|
|
4
|
+
description: "Standard",
|
|
5
5
|
code: "<Textarea label=\"Label\" />"
|
|
6
6
|
},
|
|
7
7
|
{
|
|
8
|
-
|
|
8
|
+
description: "With additional labels",
|
|
9
9
|
code: "<Textarea\n label=\"Label\"\n secondaryLabel=\"optional\"\n tertiaryLabel={\n <TextLink href=\"#\" icon={<IconHelp />}>\n Help\n </TextLink>\n }\n/>"
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
|
-
|
|
12
|
+
description: "With a description",
|
|
13
13
|
code: "<Textarea label=\"Label\" description=\"More detailed description of field.\" />"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
|
-
|
|
16
|
+
description: "With a critical message",
|
|
17
17
|
code: "<Textarea label=\"Label\" tone=\"critical\" message=\"Critical message\" />"
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
|
-
|
|
20
|
+
description: "With a positive message",
|
|
21
21
|
code: "<Textarea label=\"Label\" tone=\"positive\" message=\"Positive message\" />"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
|
|
24
|
+
description: "With a neutral message",
|
|
25
25
|
code: "<Textarea label=\"Label\" tone=\"neutral\" message=\"Neutral message\" />"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
|
|
28
|
+
description: "With fixed height of 5 lines",
|
|
29
29
|
code: "<Textarea label=\"Label\" grow={false} lines={5} />"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
|
|
32
|
+
description: "With dynamic height, limited to 7 lines",
|
|
33
33
|
code: "<Textarea label=\"Label\" grow={true} lineLimit={7} />"
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
|
-
|
|
36
|
+
description: "With character limit",
|
|
37
37
|
code: "<Textarea\n label=\"Label\"\n description=\"Character limit of 100\"\n characterLimit={100}\n/>"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
|
-
|
|
40
|
+
description: "With a highlighted range",
|
|
41
41
|
code: "<Textarea\n label=\"Label\"\n description=\"Characters 11-20 are highlighted\"\n tone=\"critical\"\n message=\"Critical message\"\n highlightRanges={[{ start: 11, end: 20 }]}\n/>"
|
|
42
42
|
}
|
|
43
43
|
];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
//#region src/lib/playroom/snippets/Tiles.ts
|
|
3
3
|
const snippets = [{
|
|
4
|
-
|
|
4
|
+
description: "2 columns",
|
|
5
5
|
code: "<Tiles space=\"small\" columns={2}>\n <Placeholder height={48} />\n <Placeholder height={48} />\n <Placeholder height={48} />\n <Placeholder height={48} />\n <Placeholder height={48} />\n</Tiles>"
|
|
6
6
|
}, {
|
|
7
|
-
|
|
7
|
+
description: "Responsive columns",
|
|
8
8
|
code: "<Tiles space=\"small\" columns={{ mobile: 2, tablet: 4 }}>\n <Placeholder height={48} />\n <Placeholder height={48} />\n <Placeholder height={48} />\n <Placeholder height={48} />\n <Placeholder height={48} />\n <Placeholder height={48} />\n</Tiles>"
|
|
9
9
|
}];
|
|
10
10
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
//#region src/lib/playroom/snippets/Tiles.ts
|
|
2
2
|
const snippets = [{
|
|
3
|
-
|
|
3
|
+
description: "2 columns",
|
|
4
4
|
code: "<Tiles space=\"small\" columns={2}>\n <Placeholder height={48} />\n <Placeholder height={48} />\n <Placeholder height={48} />\n <Placeholder height={48} />\n <Placeholder height={48} />\n</Tiles>"
|
|
5
5
|
}, {
|
|
6
|
-
|
|
6
|
+
description: "Responsive columns",
|
|
7
7
|
code: "<Tiles space=\"small\" columns={{ mobile: 2, tablet: 4 }}>\n <Placeholder height={48} />\n <Placeholder height={48} />\n <Placeholder height={48} />\n <Placeholder height={48} />\n <Placeholder height={48} />\n <Placeholder height={48} />\n</Tiles>"
|
|
8
8
|
}];
|
|
9
9
|
|
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
//#region src/lib/playroom/snippets/Toggle.ts
|
|
3
3
|
const snippets = [
|
|
4
4
|
{
|
|
5
|
-
|
|
5
|
+
description: "Standard",
|
|
6
6
|
code: "<Toggle label=\"Label\" />"
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
|
-
|
|
9
|
+
description: "Small",
|
|
10
10
|
code: "<Toggle label=\"Label\" size=\"small\" />"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
|
-
|
|
13
|
+
description: "Right aligned",
|
|
14
14
|
code: "<Toggle label=\"Label\" align=\"right\" />"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
|
|
17
|
+
description: "Justified",
|
|
18
18
|
code: "<Toggle label=\"Label\" align=\"justify\" />"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
|
-
|
|
21
|
+
description: "Trailing toggle position",
|
|
22
22
|
code: "<Toggle label=\"Label\" togglePosition=\"trailing\" />"
|
|
23
23
|
}
|
|
24
24
|
];
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
//#region src/lib/playroom/snippets/Toggle.ts
|
|
2
2
|
const snippets = [
|
|
3
3
|
{
|
|
4
|
-
|
|
4
|
+
description: "Standard",
|
|
5
5
|
code: "<Toggle label=\"Label\" />"
|
|
6
6
|
},
|
|
7
7
|
{
|
|
8
|
-
|
|
8
|
+
description: "Small",
|
|
9
9
|
code: "<Toggle label=\"Label\" size=\"small\" />"
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
|
-
|
|
12
|
+
description: "Right aligned",
|
|
13
13
|
code: "<Toggle label=\"Label\" align=\"right\" />"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
|
-
|
|
16
|
+
description: "Justified",
|
|
17
17
|
code: "<Toggle label=\"Label\" align=\"justify\" />"
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
|
-
|
|
20
|
+
description: "Trailing toggle position",
|
|
21
21
|
code: "<Toggle label=\"Label\" togglePosition=\"trailing\" />"
|
|
22
22
|
}
|
|
23
23
|
];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
//#region src/lib/playroom/snippets/TooltipRenderer.ts
|
|
3
3
|
const snippets = [{
|
|
4
|
-
|
|
4
|
+
description: "Standard",
|
|
5
5
|
code: "<TooltipRenderer tooltip={<Text>This is a tooltip!</Text>}>\n {({ triggerProps }) => (\n <Box {...triggerProps}>\n <Placeholder label=\"Tooltip trigger\" height={100} />\n </Box>\n )}\n</TooltipRenderer>"
|
|
6
6
|
}];
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/lib/playroom/snippets/TooltipRenderer.ts
|
|
2
2
|
const snippets = [{
|
|
3
|
-
|
|
3
|
+
description: "Standard",
|
|
4
4
|
code: "<TooltipRenderer tooltip={<Text>This is a tooltip!</Text>}>\n {({ triggerProps }) => (\n <Box {...triggerProps}>\n <Placeholder label=\"Tooltip trigger\" height={100} />\n </Box>\n )}\n</TooltipRenderer>"
|
|
5
5
|
}];
|
|
6
6
|
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/lib/playroom/snippets/blocks.ts
|
|
3
|
+
const snippets = [
|
|
4
|
+
{
|
|
5
|
+
group: "Blocks",
|
|
6
|
+
name: "Standard",
|
|
7
|
+
code: "<PageBlock width=\"medium\">\n <Stack space=\"medium\">\n <Stack space=\"small\">\n <Heading level=\"3\">Heading</Heading>\n\n <Text tone=\"secondary\">\n Subtitle (optional, consider using secondary tone to avoid clashing with\n content below)\n </Text>\n </Stack>\n\n <Text>\n Combines a <Strong>Heading level 3</Strong> with a{\" \"}\n <Strong>medium Stack</Strong> spacing content groups within the section.\n </Text>\n\n <Text>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. In convallis\n cursus quam nec volutpat. In hac habitasse platea dictumst. Praesent\n egestas erat id mollis imperdiet. Vestibulum non commodo nisi, sed tempus\n magna. Duis a malesuada diam.\n </Text>\n\n <Actions>\n <Button>Action (optional)</Button>\n </Actions>\n </Stack>\n</PageBlock>"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
group: "Blocks",
|
|
11
|
+
name: "Card list",
|
|
12
|
+
code: "<PageBlock width=\"medium\">\n <Stack space=\"medium\">\n <Heading level=\"3\">Heading (optional)</Heading>\n\n <Stack component=\"ul\" space=\"small\">\n {[\n {\n title: \"Item 1\",\n subTitle: \"Ea proident nulla veniam\",\n description: \"Lorem ipsum\",\n date: \"2d ago\",\n },\n {\n title: \"Item 2\",\n subTitle: \"Occaecat ad sunt elit\",\n description: \"Consectetur adipiscing\",\n date: \"6d ago\",\n },\n {\n title: \"Item 3\",\n subTitle: \"Commodo exercitation nisi laborum\",\n description: \"Vel odio\",\n date: \"3w ago\",\n },\n ].map((item) => (\n <Box component=\"li\" key={item.title}>\n <Card component=\"article\">\n <Stack space=\"medium\">\n <Stack space=\"small\">\n <Heading level=\"4\">{item.title}</Heading>\n <Text>{item.subTitle}</Text>\n </Stack>\n <Text>{item.description}</Text>\n <Text tone=\"secondary\">{item.date}</Text>\n </Stack>\n </Card>\n </Box>\n ))}\n </Stack>\n\n <Actions>\n <Button>Action (optional)</Button>\n </Actions>\n </Stack>\n</PageBlock>"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
group: "Blocks",
|
|
16
|
+
name: "Divided list",
|
|
17
|
+
code: "<PageBlock width=\"medium\">\n <Stack space=\"medium\">\n <Heading level=\"3\">Heading (optional)</Heading>\n\n {[\n {\n title: \"Item 1\",\n description: \"Lorem ipsum\",\n },\n {\n title: \"Item 2\",\n description: \"Consectetur adipiscing\",\n },\n {\n title: \"Item 3\",\n description: \"Vel odio\",\n },\n ].map((item) => (\n <>\n <Columns space=\"small\">\n <Column>\n <Stack space=\"small\">\n <Text component=\"h4\" weight=\"strong\">\n {item.title}\n </Text>\n <Text tone=\"secondary\">{item.description}</Text>\n </Stack>\n </Column>\n <Column width=\"content\">\n <ButtonIcon\n variant=\"transparent\"\n icon={<IconEdit />}\n label=\"Edit\"\n />\n </Column>\n </Columns>\n <Divider />\n </>\n ))}\n\n <Actions>\n <Button>Action (optional)</Button>\n </Actions>\n </Stack>\n</PageBlock>"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
group: "Blocks",
|
|
21
|
+
name: "Branded container",
|
|
22
|
+
description: "Full bleed",
|
|
23
|
+
code: "<Box background=\"brand\" paddingY=\"xlarge\">\n <PageBlock width=\"medium\">\n <Stack space=\"large\">\n <Heading level=\"2\">Heading</Heading>\n\n <Text>\n Combines a <Strong>Heading level 2</Strong> with a{\" \"}\n <Strong>large Stack</Strong> spacing content groups within the section.\n <br />\n Uses a <Strong>PageBlock</Strong> inside the section to maintain screen\n gutters on small screens.\n </Text>\n\n <Text>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. In convallis\n cursus quam nec volutpat. In hac habitasse platea dictumst. Praesent\n egestas erat id mollis imperdiet. Vestibulum non commodo nisi, sed\n tempus magna. Duis a malesuada diam.\n </Text>\n </Stack>\n </PageBlock>\n</Box>"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
group: "Blocks",
|
|
27
|
+
name: "Branded container",
|
|
28
|
+
description: "Rounded from desktop (full bleed below)",
|
|
29
|
+
code: "<Box paddingX={{ desktop: \"gutter\" }}>\n <ContentBlock width=\"large\">\n <Box\n background=\"brand\"\n paddingY=\"xlarge\"\n borderRadius={{ desktop: \"xlarge\" }}\n >\n <PageBlock width=\"medium\">\n <Stack space=\"large\">\n <Heading level=\"2\">Heading</Heading>\n\n <Text>\n Combines a <Strong>Heading level 2</Strong> with a{\" \"}\n <Strong>large Stack</Strong> spacing content groups within the\n section.\n <br />\n Uses a <Strong>PageBlock</Strong> inside the section to maintain\n screen gutters on small screens.\n </Text>\n\n <Text>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. In\n convallis cursus quam nec volutpat. In hac habitasse platea\n dictumst. Praesent egestas erat id mollis imperdiet. Vestibulum non\n commodo nisi, sed tempus magna. Duis a malesuada diam.\n </Text>\n </Stack>\n </PageBlock>\n </Box>\n </ContentBlock>\n</Box>"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
group: "Blocks",
|
|
33
|
+
name: "Form (basic)",
|
|
34
|
+
code: "<PageBlock width=\"medium\">\n <Stack space=\"xlarge\">\n <Stack space=\"small\">\n <Heading level=\"3\">Heading</Heading>\n\n <Text>\n For forms with minimal or no validation as errors will impact layout.\n </Text>\n\n <Text>\n Uses a <Strong>large Stack</Strong> for fields, with a{\" \"}\n <Strong>xlarge Stack</Strong> separating the actions from the form.\n </Text>\n </Stack>\n\n <Stack space=\"large\">\n <TextField label=\"TextField\" />\n\n <Dropdown\n label=\"Dropdown\"\n tone={getState(\"error\") ? \"critical\" : undefined}\n message={getState(\"error\") ? \"Required field\" : undefined}\n >\n <option>Option 1</option>\n <option>Option 2</option>\n <option>Option 3</option>\n </Dropdown>\n\n <MonthPicker label=\"MonthPicker\" />\n\n <Checkbox label=\"Checkbox\" />\n </Stack>\n\n <Actions>\n <Button>Primary action</Button>\n <Button variant=\"transparent\" onClick={() => toggleState(\"error\")}>\n Toggle error\n </Button>\n </Actions>\n </Stack>\n</PageBlock>"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
group: "Blocks",
|
|
38
|
+
name: "Form (validation)",
|
|
39
|
+
code: "<PageBlock width=\"medium\">\n <Stack space=\"xlarge\">\n <Stack space=\"small\">\n <Heading level=\"3\">Heading</Heading>\n\n <Text>\n For forms that are more likely to show validation errors, it is\n recommended to use <Strong>reserveMessageSpace</Strong> to prevent the\n elements shifting when messages appear.\n </Text>\n\n <Text>\n Uses a <Strong>small Stack</Strong> for fields, with a{\" \"}\n <Strong>large Stack</Strong> separating the actions from the form.\n </Text>\n </Stack>\n\n <Stack space=\"large\">\n <Stack space=\"small\">\n <TextField\n label=\"TextField\"\n reserveMessageSpace\n tone={getState(\"error\") ? \"critical\" : undefined}\n message={getState(\"error\") ? \"Required field\" : undefined}\n />\n\n <Dropdown\n label=\"Dropdown\"\n reserveMessageSpace\n tone={getState(\"error\") ? \"critical\" : undefined}\n message={getState(\"error\") ? \"Required field\" : undefined}\n >\n <option>Option 1</option>\n <option>Option 2</option>\n <option>Option 3</option>\n </Dropdown>\n\n <MonthPicker\n label=\"MonthPicker\"\n reserveMessageSpace\n tone={getState(\"error\") ? \"critical\" : undefined}\n message={getState(\"error\") ? \"Required field\" : undefined}\n />\n\n <Checkbox\n label=\"Checkbox\"\n reserveMessageSpace\n tone={getState(\"error\") ? \"critical\" : undefined}\n message={getState(\"error\") ? \"Required field\" : undefined}\n />\n </Stack>\n\n <Actions>\n <Button onClick={() => toggleState(\"error\")}>Toggle errors</Button>\n </Actions>\n </Stack>\n </Stack>\n</PageBlock>"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
group: "Blocks",
|
|
43
|
+
name: "Table",
|
|
44
|
+
code: "<PageBlock width=\"medium\">\n <Stack space=\"medium\">\n <Heading level=\"3\">Heading (optional)</Heading>\n\n <Table label=\"Table Block\">\n <TableHeader>\n <TableRow>\n <TableHeaderCell width=\"content\">\n <Text>Status</Text>\n </TableHeaderCell>\n <TableHeaderCell>\n <Text>Data 1</Text>\n </TableHeaderCell>\n <TableHeaderCell>\n <Text>Data 2</Text>\n </TableHeaderCell>\n <TableHeaderCell>\n <Text>Data 3</Text>\n </TableHeaderCell>\n <TableHeaderCell width=\"content\" align=\"right\">\n <Text>Actions</Text>\n </TableHeaderCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {[\n {\n status: \"Lorem\",\n data1: \"Sit\",\n data2: \"Amet\",\n data3: \"Consectetur\",\n },\n {\n status: \"Ipsum\",\n data1: \"Adipiscing\",\n data2: \"Elit\",\n data3: \"Praesent\",\n },\n {\n status: \"Dolor\",\n data1: \"Semper\",\n data2: \"Interdum\",\n data3: \"Viverra\",\n },\n ].map((row) => (\n <TableRow key={row.data1}>\n <TableCell width=\"content\">\n <Badge>{row.status}</Badge>\n </TableCell>\n <TableCell>\n <Text>{row.data1}</Text>\n </TableCell>\n <TableCell>\n <Text>{row.data2}</Text>\n </TableCell>\n <TableCell>\n <Text>{row.data3}</Text>\n </TableCell>\n <TableCell width=\"content\" align=\"right\">\n <OverflowMenu size=\"small\" label=\"Options\">\n <MenuItem>Option 1</MenuItem>\n <MenuItem>Option 2</MenuItem>\n </OverflowMenu>\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </Stack>\n</PageBlock>"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
group: "Blocks",
|
|
48
|
+
name: "Stepper",
|
|
49
|
+
code: "<PageBlock width=\"medium\">\n {setDefaultState(\"progress\", 1)}\n {setDefaultState(\"activeStep\", 1)}\n <Stack space=\"large\">\n <Stepper\n label=\"Stepped Block\"\n align=\"left\"\n progress={getState(\"progress\")}\n activeStep={getState(\"activeStep\")}\n onStepClick={({ stepNumber }) => setState(\"activeStep\", stepNumber)}\n >\n <Step>Step 1</Step>\n <Step>Step 2</Step>\n <Step>Step 3</Step>\n <Step>Step 4</Step>\n <Step>Step 5</Step>\n </Stepper>\n\n {getState(\"activeStep\") === 1 && (\n <Placeholder label=\"Step content 1\" height={400} />\n )}\n {getState(\"activeStep\") === 2 && (\n <Placeholder label=\"Step content 2\" height={400} />\n )}\n {getState(\"activeStep\") === 3 && (\n <Placeholder label=\"Step content 3\" height={400} />\n )}\n {getState(\"activeStep\") === 4 && (\n <Placeholder label=\"Step content 4\" height={400} />\n )}\n {getState(\"activeStep\") === 5 && (\n <Placeholder label=\"Step content 5\" height={400} />\n )}\n\n <Columns space=\"small\">\n <Column>\n {getState(\"activeStep\") > 1 && (\n <Actions>\n <Button\n icon={<IconArrow direction=\"left\" />}\n onClick={() => setState(\"activeStep\", getState(\"activeStep\") - 1)}\n >\n Back\n </Button>\n </Actions>\n )}\n </Column>\n <Column width=\"content\">\n {getState(\"activeStep\") < 5 && (\n <Actions>\n <Button\n variant=\"solid\"\n tone=\"formAccent\"\n icon={<IconArrow direction=\"right\" />}\n iconPosition=\"trailing\"\n onClick={() => {\n const newStep = getState(\"activeStep\") + 1\n setState(\"activeStep\", newStep)\n if (newStep > getState(\"progress\")) {\n setState(\"progress\", newStep)\n }\n }}\n >\n Continue\n </Button>\n </Actions>\n )}\n </Column>\n </Columns>\n </Stack>\n</PageBlock>"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
group: "Blocks",
|
|
53
|
+
name: "Tabs",
|
|
54
|
+
code: "<PageBlock width=\"medium\">\n <TabsProvider>\n <Stack space=\"large\">\n <Tabs divider=\"none\" label=\"Tabs Block\">\n <Tab>Tab 1</Tab>\n <Tab>Tab 2</Tab>\n <Tab>Tab 3</Tab>\n </Tabs>\n\n <TabPanels>\n <TabPanel>\n <Placeholder label=\"Tab 1 content\" height={500} />\n </TabPanel>\n <TabPanel>\n <Placeholder label=\"Tab 2 content\" height={300} />\n </TabPanel>\n <TabPanel>\n <Placeholder label=\"Tab 3 content\" height={400} />\n </TabPanel>\n </TabPanels>\n </Stack>\n </TabsProvider>\n</PageBlock>"
|
|
55
|
+
}
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
//#endregion
|
|
59
|
+
exports.snippets = snippets;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
//#region src/lib/playroom/snippets/blocks.ts
|
|
2
|
+
const snippets = [
|
|
3
|
+
{
|
|
4
|
+
group: "Blocks",
|
|
5
|
+
name: "Standard",
|
|
6
|
+
code: "<PageBlock width=\"medium\">\n <Stack space=\"medium\">\n <Stack space=\"small\">\n <Heading level=\"3\">Heading</Heading>\n\n <Text tone=\"secondary\">\n Subtitle (optional, consider using secondary tone to avoid clashing with\n content below)\n </Text>\n </Stack>\n\n <Text>\n Combines a <Strong>Heading level 3</Strong> with a{\" \"}\n <Strong>medium Stack</Strong> spacing content groups within the section.\n </Text>\n\n <Text>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. In convallis\n cursus quam nec volutpat. In hac habitasse platea dictumst. Praesent\n egestas erat id mollis imperdiet. Vestibulum non commodo nisi, sed tempus\n magna. Duis a malesuada diam.\n </Text>\n\n <Actions>\n <Button>Action (optional)</Button>\n </Actions>\n </Stack>\n</PageBlock>"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
group: "Blocks",
|
|
10
|
+
name: "Card list",
|
|
11
|
+
code: "<PageBlock width=\"medium\">\n <Stack space=\"medium\">\n <Heading level=\"3\">Heading (optional)</Heading>\n\n <Stack component=\"ul\" space=\"small\">\n {[\n {\n title: \"Item 1\",\n subTitle: \"Ea proident nulla veniam\",\n description: \"Lorem ipsum\",\n date: \"2d ago\",\n },\n {\n title: \"Item 2\",\n subTitle: \"Occaecat ad sunt elit\",\n description: \"Consectetur adipiscing\",\n date: \"6d ago\",\n },\n {\n title: \"Item 3\",\n subTitle: \"Commodo exercitation nisi laborum\",\n description: \"Vel odio\",\n date: \"3w ago\",\n },\n ].map((item) => (\n <Box component=\"li\" key={item.title}>\n <Card component=\"article\">\n <Stack space=\"medium\">\n <Stack space=\"small\">\n <Heading level=\"4\">{item.title}</Heading>\n <Text>{item.subTitle}</Text>\n </Stack>\n <Text>{item.description}</Text>\n <Text tone=\"secondary\">{item.date}</Text>\n </Stack>\n </Card>\n </Box>\n ))}\n </Stack>\n\n <Actions>\n <Button>Action (optional)</Button>\n </Actions>\n </Stack>\n</PageBlock>"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
group: "Blocks",
|
|
15
|
+
name: "Divided list",
|
|
16
|
+
code: "<PageBlock width=\"medium\">\n <Stack space=\"medium\">\n <Heading level=\"3\">Heading (optional)</Heading>\n\n {[\n {\n title: \"Item 1\",\n description: \"Lorem ipsum\",\n },\n {\n title: \"Item 2\",\n description: \"Consectetur adipiscing\",\n },\n {\n title: \"Item 3\",\n description: \"Vel odio\",\n },\n ].map((item) => (\n <>\n <Columns space=\"small\">\n <Column>\n <Stack space=\"small\">\n <Text component=\"h4\" weight=\"strong\">\n {item.title}\n </Text>\n <Text tone=\"secondary\">{item.description}</Text>\n </Stack>\n </Column>\n <Column width=\"content\">\n <ButtonIcon\n variant=\"transparent\"\n icon={<IconEdit />}\n label=\"Edit\"\n />\n </Column>\n </Columns>\n <Divider />\n </>\n ))}\n\n <Actions>\n <Button>Action (optional)</Button>\n </Actions>\n </Stack>\n</PageBlock>"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
group: "Blocks",
|
|
20
|
+
name: "Branded container",
|
|
21
|
+
description: "Full bleed",
|
|
22
|
+
code: "<Box background=\"brand\" paddingY=\"xlarge\">\n <PageBlock width=\"medium\">\n <Stack space=\"large\">\n <Heading level=\"2\">Heading</Heading>\n\n <Text>\n Combines a <Strong>Heading level 2</Strong> with a{\" \"}\n <Strong>large Stack</Strong> spacing content groups within the section.\n <br />\n Uses a <Strong>PageBlock</Strong> inside the section to maintain screen\n gutters on small screens.\n </Text>\n\n <Text>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. In convallis\n cursus quam nec volutpat. In hac habitasse platea dictumst. Praesent\n egestas erat id mollis imperdiet. Vestibulum non commodo nisi, sed\n tempus magna. Duis a malesuada diam.\n </Text>\n </Stack>\n </PageBlock>\n</Box>"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
group: "Blocks",
|
|
26
|
+
name: "Branded container",
|
|
27
|
+
description: "Rounded from desktop (full bleed below)",
|
|
28
|
+
code: "<Box paddingX={{ desktop: \"gutter\" }}>\n <ContentBlock width=\"large\">\n <Box\n background=\"brand\"\n paddingY=\"xlarge\"\n borderRadius={{ desktop: \"xlarge\" }}\n >\n <PageBlock width=\"medium\">\n <Stack space=\"large\">\n <Heading level=\"2\">Heading</Heading>\n\n <Text>\n Combines a <Strong>Heading level 2</Strong> with a{\" \"}\n <Strong>large Stack</Strong> spacing content groups within the\n section.\n <br />\n Uses a <Strong>PageBlock</Strong> inside the section to maintain\n screen gutters on small screens.\n </Text>\n\n <Text>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. In\n convallis cursus quam nec volutpat. In hac habitasse platea\n dictumst. Praesent egestas erat id mollis imperdiet. Vestibulum non\n commodo nisi, sed tempus magna. Duis a malesuada diam.\n </Text>\n </Stack>\n </PageBlock>\n </Box>\n </ContentBlock>\n</Box>"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
group: "Blocks",
|
|
32
|
+
name: "Form (basic)",
|
|
33
|
+
code: "<PageBlock width=\"medium\">\n <Stack space=\"xlarge\">\n <Stack space=\"small\">\n <Heading level=\"3\">Heading</Heading>\n\n <Text>\n For forms with minimal or no validation as errors will impact layout.\n </Text>\n\n <Text>\n Uses a <Strong>large Stack</Strong> for fields, with a{\" \"}\n <Strong>xlarge Stack</Strong> separating the actions from the form.\n </Text>\n </Stack>\n\n <Stack space=\"large\">\n <TextField label=\"TextField\" />\n\n <Dropdown\n label=\"Dropdown\"\n tone={getState(\"error\") ? \"critical\" : undefined}\n message={getState(\"error\") ? \"Required field\" : undefined}\n >\n <option>Option 1</option>\n <option>Option 2</option>\n <option>Option 3</option>\n </Dropdown>\n\n <MonthPicker label=\"MonthPicker\" />\n\n <Checkbox label=\"Checkbox\" />\n </Stack>\n\n <Actions>\n <Button>Primary action</Button>\n <Button variant=\"transparent\" onClick={() => toggleState(\"error\")}>\n Toggle error\n </Button>\n </Actions>\n </Stack>\n</PageBlock>"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
group: "Blocks",
|
|
37
|
+
name: "Form (validation)",
|
|
38
|
+
code: "<PageBlock width=\"medium\">\n <Stack space=\"xlarge\">\n <Stack space=\"small\">\n <Heading level=\"3\">Heading</Heading>\n\n <Text>\n For forms that are more likely to show validation errors, it is\n recommended to use <Strong>reserveMessageSpace</Strong> to prevent the\n elements shifting when messages appear.\n </Text>\n\n <Text>\n Uses a <Strong>small Stack</Strong> for fields, with a{\" \"}\n <Strong>large Stack</Strong> separating the actions from the form.\n </Text>\n </Stack>\n\n <Stack space=\"large\">\n <Stack space=\"small\">\n <TextField\n label=\"TextField\"\n reserveMessageSpace\n tone={getState(\"error\") ? \"critical\" : undefined}\n message={getState(\"error\") ? \"Required field\" : undefined}\n />\n\n <Dropdown\n label=\"Dropdown\"\n reserveMessageSpace\n tone={getState(\"error\") ? \"critical\" : undefined}\n message={getState(\"error\") ? \"Required field\" : undefined}\n >\n <option>Option 1</option>\n <option>Option 2</option>\n <option>Option 3</option>\n </Dropdown>\n\n <MonthPicker\n label=\"MonthPicker\"\n reserveMessageSpace\n tone={getState(\"error\") ? \"critical\" : undefined}\n message={getState(\"error\") ? \"Required field\" : undefined}\n />\n\n <Checkbox\n label=\"Checkbox\"\n reserveMessageSpace\n tone={getState(\"error\") ? \"critical\" : undefined}\n message={getState(\"error\") ? \"Required field\" : undefined}\n />\n </Stack>\n\n <Actions>\n <Button onClick={() => toggleState(\"error\")}>Toggle errors</Button>\n </Actions>\n </Stack>\n </Stack>\n</PageBlock>"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
group: "Blocks",
|
|
42
|
+
name: "Table",
|
|
43
|
+
code: "<PageBlock width=\"medium\">\n <Stack space=\"medium\">\n <Heading level=\"3\">Heading (optional)</Heading>\n\n <Table label=\"Table Block\">\n <TableHeader>\n <TableRow>\n <TableHeaderCell width=\"content\">\n <Text>Status</Text>\n </TableHeaderCell>\n <TableHeaderCell>\n <Text>Data 1</Text>\n </TableHeaderCell>\n <TableHeaderCell>\n <Text>Data 2</Text>\n </TableHeaderCell>\n <TableHeaderCell>\n <Text>Data 3</Text>\n </TableHeaderCell>\n <TableHeaderCell width=\"content\" align=\"right\">\n <Text>Actions</Text>\n </TableHeaderCell>\n </TableRow>\n </TableHeader>\n <TableBody>\n {[\n {\n status: \"Lorem\",\n data1: \"Sit\",\n data2: \"Amet\",\n data3: \"Consectetur\",\n },\n {\n status: \"Ipsum\",\n data1: \"Adipiscing\",\n data2: \"Elit\",\n data3: \"Praesent\",\n },\n {\n status: \"Dolor\",\n data1: \"Semper\",\n data2: \"Interdum\",\n data3: \"Viverra\",\n },\n ].map((row) => (\n <TableRow key={row.data1}>\n <TableCell width=\"content\">\n <Badge>{row.status}</Badge>\n </TableCell>\n <TableCell>\n <Text>{row.data1}</Text>\n </TableCell>\n <TableCell>\n <Text>{row.data2}</Text>\n </TableCell>\n <TableCell>\n <Text>{row.data3}</Text>\n </TableCell>\n <TableCell width=\"content\" align=\"right\">\n <OverflowMenu size=\"small\" label=\"Options\">\n <MenuItem>Option 1</MenuItem>\n <MenuItem>Option 2</MenuItem>\n </OverflowMenu>\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </Stack>\n</PageBlock>"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
group: "Blocks",
|
|
47
|
+
name: "Stepper",
|
|
48
|
+
code: "<PageBlock width=\"medium\">\n {setDefaultState(\"progress\", 1)}\n {setDefaultState(\"activeStep\", 1)}\n <Stack space=\"large\">\n <Stepper\n label=\"Stepped Block\"\n align=\"left\"\n progress={getState(\"progress\")}\n activeStep={getState(\"activeStep\")}\n onStepClick={({ stepNumber }) => setState(\"activeStep\", stepNumber)}\n >\n <Step>Step 1</Step>\n <Step>Step 2</Step>\n <Step>Step 3</Step>\n <Step>Step 4</Step>\n <Step>Step 5</Step>\n </Stepper>\n\n {getState(\"activeStep\") === 1 && (\n <Placeholder label=\"Step content 1\" height={400} />\n )}\n {getState(\"activeStep\") === 2 && (\n <Placeholder label=\"Step content 2\" height={400} />\n )}\n {getState(\"activeStep\") === 3 && (\n <Placeholder label=\"Step content 3\" height={400} />\n )}\n {getState(\"activeStep\") === 4 && (\n <Placeholder label=\"Step content 4\" height={400} />\n )}\n {getState(\"activeStep\") === 5 && (\n <Placeholder label=\"Step content 5\" height={400} />\n )}\n\n <Columns space=\"small\">\n <Column>\n {getState(\"activeStep\") > 1 && (\n <Actions>\n <Button\n icon={<IconArrow direction=\"left\" />}\n onClick={() => setState(\"activeStep\", getState(\"activeStep\") - 1)}\n >\n Back\n </Button>\n </Actions>\n )}\n </Column>\n <Column width=\"content\">\n {getState(\"activeStep\") < 5 && (\n <Actions>\n <Button\n variant=\"solid\"\n tone=\"formAccent\"\n icon={<IconArrow direction=\"right\" />}\n iconPosition=\"trailing\"\n onClick={() => {\n const newStep = getState(\"activeStep\") + 1\n setState(\"activeStep\", newStep)\n if (newStep > getState(\"progress\")) {\n setState(\"progress\", newStep)\n }\n }}\n >\n Continue\n </Button>\n </Actions>\n )}\n </Column>\n </Columns>\n </Stack>\n</PageBlock>"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
group: "Blocks",
|
|
52
|
+
name: "Tabs",
|
|
53
|
+
code: "<PageBlock width=\"medium\">\n <TabsProvider>\n <Stack space=\"large\">\n <Tabs divider=\"none\" label=\"Tabs Block\">\n <Tab>Tab 1</Tab>\n <Tab>Tab 2</Tab>\n <Tab>Tab 3</Tab>\n </Tabs>\n\n <TabPanels>\n <TabPanel>\n <Placeholder label=\"Tab 1 content\" height={500} />\n </TabPanel>\n <TabPanel>\n <Placeholder label=\"Tab 2 content\" height={300} />\n </TabPanel>\n <TabPanel>\n <Placeholder label=\"Tab 3 content\" height={400} />\n </TabPanel>\n </TabPanels>\n </Stack>\n </TabsProvider>\n</PageBlock>"
|
|
54
|
+
}
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
export { snippets };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/lib/playroom/snippets/layouts.ts
|
|
3
|
+
const snippets = [
|
|
4
|
+
{
|
|
5
|
+
group: "Layouts",
|
|
6
|
+
name: "Standard Page",
|
|
7
|
+
code: "<Page footer={<PlaceholderFooter />} footerPosition=\"belowFold\">\n <Stack space=\"xxlarge\">\n <PlaceholderHeader />\n\n <PageBlock width=\"medium\">\n <Stack space=\"medium\">\n <Heading level=\"2\">Standard Page</Heading>\n\n <Text>\n Combines a <Strong>Heading level 2</Strong> with{\" \"}\n <Strong>xxlarge Stack</Strong> spacing between sections, where each\n section uses a <Strong>medium PageBlock</Strong> to establish content\n max width and consistent screen gutters.\n </Text>\n\n <Text>\n If providing text immediately below the Heading, consider using{\" \"}\n <Strong>standard Text</Strong> and grouping with a{\" \"}\n <Strong>medium Stack</Strong>.\n </Text>\n\n <Text>Use this layout as a starting point.</Text>\n </Stack>\n </PageBlock>\n\n <PageBlock width=\"medium\">\n <Placeholder label=\"Section\" height={300} />\n </PageBlock>\n\n <PageBlock width=\"medium\">\n <Placeholder label=\"Section\" height={250} />\n </PageBlock>\n\n <PageBlock width=\"medium\">\n <Placeholder label=\"Section\" height={400} />\n </PageBlock>\n </Stack>\n</Page>"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
group: "Layouts",
|
|
11
|
+
name: "Compact Page",
|
|
12
|
+
code: "<Page footer={<PlaceholderFooter />} footerPosition=\"belowFold\">\n <Stack space=\"xlarge\">\n <PlaceholderHeader />\n\n <PageBlock width=\"medium\">\n <Stack space=\"medium\">\n <Heading level=\"2\">Compact Page</Heading>\n\n <Text>\n Combines a <Strong>Heading level 2</Strong> with{\" \"}\n <Strong>xlarge Stack</Strong> spacing between sections, where each\n section uses a <Strong>medium PageBlock</Strong> to establish content\n max width and consistent screen gutters.\n </Text>\n\n <Text>\n If providing text immediately below the Heading, consider using{\" \"}\n <Strong>standard Text</Strong> and grouping with a{\" \"}\n <Strong>medium Stack</Strong>.\n </Text>\n\n <Text>\n Use this layout as a starting point where information density needs to\n be optimised.\n </Text>\n </Stack>\n </PageBlock>\n\n <PageBlock width=\"medium\">\n <Placeholder label=\"Section\" height={300} />\n </PageBlock>\n\n <PageBlock width=\"medium\">\n <Placeholder label=\"Section\" height={250} />\n </PageBlock>\n\n <PageBlock width=\"medium\">\n <Placeholder label=\"Section\" height={400} />\n </PageBlock>\n </Stack>\n</Page>"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
group: "Layouts",
|
|
16
|
+
name: "Spacious Page",
|
|
17
|
+
code: "<Page footer={<PlaceholderFooter />} footerPosition=\"belowFold\">\n <Stack space=\"xxxlarge\">\n <PlaceholderHeader />\n\n <PageBlock width=\"large\">\n <Stack space=\"large\">\n <Heading level=\"1\">Spacious Page</Heading>\n\n <Text size=\"large\">\n Combines a <Strong>Heading level 1</Strong> with{\" \"}\n <Strong>xxxlarge Stack</Strong> spacing between sections, where each\n section uses a <Strong>large PageBlock</Strong> to establish content\n max width and consistent screen gutters.\n </Text>\n\n <Text size=\"large\">\n If providing text immediately below the Heading, consider using{\" \"}\n <Strong>large Text</Strong> and grouping with a{\" \"}\n <Strong>large Stack</Strong>.\n </Text>\n\n <Text size=\"large\">\n Use this layout for landing pages and larger form content.\n </Text>\n </Stack>\n </PageBlock>\n\n <PageBlock width=\"large\">\n <Placeholder label=\"Section\" height={300} />\n </PageBlock>\n\n <PageBlock width=\"large\">\n <Placeholder label=\"Section\" height={250} />\n </PageBlock>\n\n <PageBlock width=\"large\">\n <Placeholder label=\"Section\" height={400} />\n </PageBlock>\n </Stack>\n</Page>"
|
|
18
|
+
}
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
exports.snippets = snippets;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/lib/playroom/snippets/layouts.ts
|
|
2
|
+
const snippets = [
|
|
3
|
+
{
|
|
4
|
+
group: "Layouts",
|
|
5
|
+
name: "Standard Page",
|
|
6
|
+
code: "<Page footer={<PlaceholderFooter />} footerPosition=\"belowFold\">\n <Stack space=\"xxlarge\">\n <PlaceholderHeader />\n\n <PageBlock width=\"medium\">\n <Stack space=\"medium\">\n <Heading level=\"2\">Standard Page</Heading>\n\n <Text>\n Combines a <Strong>Heading level 2</Strong> with{\" \"}\n <Strong>xxlarge Stack</Strong> spacing between sections, where each\n section uses a <Strong>medium PageBlock</Strong> to establish content\n max width and consistent screen gutters.\n </Text>\n\n <Text>\n If providing text immediately below the Heading, consider using{\" \"}\n <Strong>standard Text</Strong> and grouping with a{\" \"}\n <Strong>medium Stack</Strong>.\n </Text>\n\n <Text>Use this layout as a starting point.</Text>\n </Stack>\n </PageBlock>\n\n <PageBlock width=\"medium\">\n <Placeholder label=\"Section\" height={300} />\n </PageBlock>\n\n <PageBlock width=\"medium\">\n <Placeholder label=\"Section\" height={250} />\n </PageBlock>\n\n <PageBlock width=\"medium\">\n <Placeholder label=\"Section\" height={400} />\n </PageBlock>\n </Stack>\n</Page>"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
group: "Layouts",
|
|
10
|
+
name: "Compact Page",
|
|
11
|
+
code: "<Page footer={<PlaceholderFooter />} footerPosition=\"belowFold\">\n <Stack space=\"xlarge\">\n <PlaceholderHeader />\n\n <PageBlock width=\"medium\">\n <Stack space=\"medium\">\n <Heading level=\"2\">Compact Page</Heading>\n\n <Text>\n Combines a <Strong>Heading level 2</Strong> with{\" \"}\n <Strong>xlarge Stack</Strong> spacing between sections, where each\n section uses a <Strong>medium PageBlock</Strong> to establish content\n max width and consistent screen gutters.\n </Text>\n\n <Text>\n If providing text immediately below the Heading, consider using{\" \"}\n <Strong>standard Text</Strong> and grouping with a{\" \"}\n <Strong>medium Stack</Strong>.\n </Text>\n\n <Text>\n Use this layout as a starting point where information density needs to\n be optimised.\n </Text>\n </Stack>\n </PageBlock>\n\n <PageBlock width=\"medium\">\n <Placeholder label=\"Section\" height={300} />\n </PageBlock>\n\n <PageBlock width=\"medium\">\n <Placeholder label=\"Section\" height={250} />\n </PageBlock>\n\n <PageBlock width=\"medium\">\n <Placeholder label=\"Section\" height={400} />\n </PageBlock>\n </Stack>\n</Page>"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
group: "Layouts",
|
|
15
|
+
name: "Spacious Page",
|
|
16
|
+
code: "<Page footer={<PlaceholderFooter />} footerPosition=\"belowFold\">\n <Stack space=\"xxxlarge\">\n <PlaceholderHeader />\n\n <PageBlock width=\"large\">\n <Stack space=\"large\">\n <Heading level=\"1\">Spacious Page</Heading>\n\n <Text size=\"large\">\n Combines a <Strong>Heading level 1</Strong> with{\" \"}\n <Strong>xxxlarge Stack</Strong> spacing between sections, where each\n section uses a <Strong>large PageBlock</Strong> to establish content\n max width and consistent screen gutters.\n </Text>\n\n <Text size=\"large\">\n If providing text immediately below the Heading, consider using{\" \"}\n <Strong>large Text</Strong> and grouping with a{\" \"}\n <Strong>large Stack</Strong>.\n </Text>\n\n <Text size=\"large\">\n Use this layout for landing pages and larger form content.\n </Text>\n </Stack>\n </PageBlock>\n\n <PageBlock width=\"large\">\n <Placeholder label=\"Section\" height={300} />\n </PageBlock>\n\n <PageBlock width=\"large\">\n <Placeholder label=\"Section\" height={250} />\n </PageBlock>\n\n <PageBlock width=\"large\">\n <Placeholder label=\"Section\" height={400} />\n </PageBlock>\n </Stack>\n</Page>"
|
|
17
|
+
}
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { snippets };
|
|
@@ -47,9 +47,19 @@ const require_Textarea = require('./snippets/Textarea.cjs');
|
|
|
47
47
|
const require_Tiles = require('./snippets/Tiles.cjs');
|
|
48
48
|
const require_Toggle = require('./snippets/Toggle.cjs');
|
|
49
49
|
const require_TooltipRenderer = require('./snippets/TooltipRenderer.cjs');
|
|
50
|
+
const require_blocks = require('./snippets/blocks.cjs');
|
|
51
|
+
const require_layouts = require('./snippets/layouts.cjs');
|
|
50
52
|
|
|
51
53
|
//#region src/lib/playroom/snippets.ts
|
|
52
|
-
|
|
54
|
+
const groupOrder = [
|
|
55
|
+
"Layouts",
|
|
56
|
+
"Blocks",
|
|
57
|
+
"Components"
|
|
58
|
+
];
|
|
59
|
+
const allSnippets = [];
|
|
60
|
+
const snippetsMap = {
|
|
61
|
+
blocks: require_blocks.snippets,
|
|
62
|
+
layouts: require_layouts.snippets,
|
|
53
63
|
Accordion: require_Accordion.snippets,
|
|
54
64
|
Actions: require_Actions.snippets,
|
|
55
65
|
Alert: require_Alert.snippets,
|
|
@@ -99,10 +109,17 @@ var snippets_default = Object.entries({
|
|
|
99
109
|
Tiles: require_Tiles.snippets,
|
|
100
110
|
Toggle: require_Toggle.snippets,
|
|
101
111
|
TooltipRenderer: require_TooltipRenderer.snippets
|
|
102
|
-
}
|
|
112
|
+
};
|
|
113
|
+
for (const [name, snippets] of Object.entries(snippetsMap)) for (const snippet of snippets) allSnippets.push({
|
|
103
114
|
...snippet,
|
|
104
|
-
|
|
105
|
-
|
|
115
|
+
name: "name" in snippet ? snippet.name : name,
|
|
116
|
+
group: "group" in snippet ? snippet.group : "Components"
|
|
117
|
+
});
|
|
118
|
+
allSnippets.sort((a, b) => {
|
|
119
|
+
const aIndex = groupOrder.indexOf(a.group);
|
|
120
|
+
const bIndex = groupOrder.indexOf(b.group);
|
|
121
|
+
return (aIndex === -1 ? 3 : aIndex) - (bIndex === -1 ? 3 : bIndex);
|
|
122
|
+
});
|
|
106
123
|
|
|
107
124
|
//#endregion
|
|
108
|
-
exports.default =
|
|
125
|
+
exports.default = allSnippets;
|