reshaped 3.3.11 → 3.3.12
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 +9 -0
- package/dist/bundle.css +1 -1
- package/dist/bundle.js +16 -17
- package/dist/cjs/themes/_generator/utilities/generateColors.d.ts +1 -1
- package/dist/cjs/themes/_generator/utilities/generateColors.js +3 -2
- package/dist/cjs/themes/_generator/utilities/tests/color.test.js +32 -31
- package/dist/cjs/themes/slate/theme.css +1 -1
- package/dist/components/Accordion/tests/Accordion.stories.d.ts +30 -8
- package/dist/components/Accordion/tests/Accordion.stories.js +172 -119
- package/dist/components/ActionBar/tests/ActionBar.stories.d.ts +12 -3
- package/dist/components/ActionBar/tests/ActionBar.stories.js +51 -36
- package/dist/components/ActionBar/tests/ActionBar.test.stories.d.ts +15 -0
- package/dist/components/ActionBar/tests/ActionBar.test.stories.js +26 -0
- package/dist/components/Actionable/Actionable.js +1 -1
- package/dist/components/Actionable/tests/Actionable.stories.d.ts +19 -5
- package/dist/components/Actionable/tests/Actionable.stories.js +88 -63
- package/dist/components/Actionable/tests/Actionable.test.stories.d.ts +32 -0
- package/dist/components/Actionable/tests/Actionable.test.stories.js +130 -0
- package/dist/components/Alert/Alert.js +1 -1
- package/dist/components/Alert/tests/Alert.stories.d.ts +12 -3
- package/dist/components/Alert/tests/Alert.stories.js +51 -86
- package/dist/components/Alert/tests/Alert.test.stories.d.ts +15 -0
- package/dist/components/Alert/tests/Alert.test.stories.js +26 -0
- package/dist/components/Autocomplete/Autocomplete.js +9 -2
- package/dist/components/Autocomplete/tests/Autocomplete.stories.d.ts +6 -2
- package/dist/components/Autocomplete/tests/Autocomplete.stories.js +94 -111
- package/dist/components/Autocomplete/tests/Autocomplete.test.stories.d.ts +23 -0
- package/dist/components/Autocomplete/tests/Autocomplete.test.stories.js +86 -0
- package/dist/components/Avatar/Avatar.js +1 -1
- package/dist/components/Avatar/tests/Avatar.stories.d.ts +14 -4
- package/dist/components/Avatar/tests/Avatar.stories.js +94 -80
- package/dist/components/Avatar/tests/Avatar.test.stories.d.ts +17 -0
- package/dist/components/Avatar/tests/Avatar.test.stories.js +39 -0
- package/dist/components/Badge/tests/Badge.stories.d.ts +33 -8
- package/dist/components/Badge/tests/Badge.stories.js +238 -212
- package/dist/components/Badge/tests/Badge.test.stories.d.ts +20 -0
- package/dist/components/Badge/tests/Badge.test.stories.js +44 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +2 -2
- package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +1 -0
- package/dist/components/Breadcrumbs/tests/Breadcrumbs.stories.d.ts +24 -5
- package/dist/components/Breadcrumbs/tests/Breadcrumbs.stories.js +114 -95
- package/dist/components/Breadcrumbs/tests/Breadcrumbs.test.stories.d.ts +23 -0
- package/dist/components/Breadcrumbs/tests/Breadcrumbs.test.stories.js +76 -0
- package/dist/components/Button/Button.js +5 -2
- package/dist/components/Button/Button.module.css +1 -1
- package/dist/components/Button/Button.types.d.ts +1 -0
- package/dist/components/Button/tests/Button.stories.d.ts +2 -2
- package/dist/components/Button/tests/Button.stories.js +77 -74
- package/dist/components/Button/tests/Button.test.stories.d.ts +27 -0
- package/dist/components/Button/tests/Button.test.stories.js +112 -0
- package/dist/components/Calendar/tests/Calendar.test.stories.d.ts +26 -0
- package/dist/components/Calendar/tests/Calendar.test.stories.js +161 -0
- package/dist/components/Card/tests/Card.stories.d.ts +0 -1
- package/dist/components/Card/tests/Card.stories.js +0 -11
- package/dist/components/Card/tests/Card.test.stories.d.ts +35 -0
- package/dist/components/Card/tests/Card.test.stories.js +54 -0
- package/dist/components/Carousel/CarouselControl.js +1 -1
- package/dist/components/Carousel/tests/Carousel.stories.d.ts +3 -0
- package/dist/components/Carousel/tests/Carousel.stories.js +4 -0
- package/dist/components/Carousel/tests/Carousel.test.stories.d.ts +17 -0
- package/dist/components/Carousel/tests/Carousel.test.stories.js +52 -0
- package/dist/components/Checkbox/tests/Checkbox.test.stories.d.ts +25 -0
- package/dist/components/Checkbox/tests/Checkbox.test.stories.js +104 -0
- package/dist/components/CheckboxGroup/tests/CheckboxGroup.test.stories.d.ts +22 -0
- package/dist/components/CheckboxGroup/tests/CheckboxGroup.test.stories.js +78 -0
- package/dist/components/Container/Container.module.css +1 -1
- package/dist/components/Container/tests/Container.stories.d.ts +12 -3
- package/dist/components/Container/tests/Container.stories.js +50 -31
- package/dist/components/Container/tests/Container.test.stories.d.ts +15 -0
- package/dist/components/Container/tests/Container.test.stories.js +26 -0
- package/dist/components/ContextMenu/ContextMenu.js +13 -9
- package/dist/components/ContextMenu/tests/ContextMenu.stories.js +2 -3
- package/dist/components/ContextMenu/tests/ContextMenu.test.stories.d.ts +26 -0
- package/dist/components/ContextMenu/tests/ContextMenu.test.stories.js +53 -0
- package/dist/components/Dismissible/Dismissible.js +1 -1
- package/dist/components/Dismissible/tests/Dismissible.stories.d.ts +10 -3
- package/dist/components/Dismissible/tests/Dismissible.stories.js +51 -34
- package/dist/components/Dismissible/tests/Dismissible.test.stories.d.ts +19 -0
- package/dist/components/Dismissible/tests/Dismissible.test.stories.js +42 -0
- package/dist/components/Divider/tests/Divider.test.stories.d.ts +18 -0
- package/dist/components/Divider/tests/Divider.test.stories.js +47 -0
- package/dist/components/DropdownMenu/tests/DropdownMenu.test.stories.d.ts +37 -0
- package/dist/components/DropdownMenu/tests/DropdownMenu.test.stories.js +117 -0
- package/dist/components/FileUpload/tests/FileUpload.test.stories.d.ts +22 -0
- package/dist/components/FileUpload/tests/FileUpload.test.stories.js +52 -0
- package/dist/components/FormControl/FormControlCaption.js +1 -1
- package/dist/components/FormControl/FormControlLabel.js +1 -1
- package/dist/components/FormControl/tests/FormControl.stories.d.ts +11 -5
- package/dist/components/FormControl/tests/FormControl.stories.js +78 -73
- package/dist/components/FormControl/tests/FormControl.test.stories.d.ts +20 -0
- package/dist/components/FormControl/tests/FormControl.test.stories.js +49 -0
- package/dist/components/Grid/tests/Grid.stories.d.ts +20 -5
- package/dist/components/Grid/tests/Grid.stories.js +164 -149
- package/dist/components/Grid/tests/Grid.test.stories.d.ts +19 -0
- package/dist/components/Grid/tests/Grid.test.stories.js +42 -0
- package/dist/components/Hidden/tests/Hidden.stories.d.ts +4 -1
- package/dist/components/Hidden/tests/Hidden.stories.js +28 -25
- package/dist/components/Hidden/tests/Hidden.test.stories.d.ts +15 -0
- package/dist/components/Hidden/tests/Hidden.test.stories.js +20 -0
- package/dist/components/HiddenVisually/tests/HiddenVisually.stories.d.ts +4 -1
- package/dist/components/HiddenVisually/tests/HiddenVisually.stories.js +8 -5
- package/dist/components/HiddenVisually/tests/HiddenVisually.test.stories.d.ts +15 -0
- package/dist/components/HiddenVisually/tests/HiddenVisually.test.stories.js +20 -0
- package/dist/components/Hotkey/tests/Hotkey.test.stories.d.ts +15 -0
- package/dist/components/Hotkey/tests/Hotkey.test.stories.js +26 -0
- package/dist/components/Icon/tests/Icon.stories.d.ts +12 -3
- package/dist/components/Icon/tests/Icon.stories.js +69 -60
- package/dist/components/Icon/tests/Icon.test.stories.d.ts +16 -0
- package/dist/components/Icon/tests/Icon.test.stories.js +35 -0
- package/dist/components/Image/tests/Image.stories.d.ts +24 -5
- package/dist/components/Image/tests/Image.stories.js +95 -75
- package/dist/components/Image/tests/Image.test.stories.d.ts +25 -0
- package/dist/components/Image/tests/Image.test.stories.js +80 -0
- package/dist/components/Link/tests/Link.test.stories.d.ts +29 -0
- package/dist/components/Link/tests/Link.test.stories.js +87 -0
- package/dist/components/Loader/Loader.js +1 -1
- package/dist/components/Loader/Loader.types.d.ts +1 -0
- package/dist/components/Loader/tests/Loader.stories.js +8 -8
- package/dist/components/Loader/tests/Loader.test.stories.d.ts +16 -0
- package/dist/components/Loader/tests/Loader.test.stories.js +32 -0
- package/dist/components/MenuItem/tests/MenuItem.test.stories.d.ts +26 -0
- package/dist/components/MenuItem/tests/MenuItem.test.stories.js +100 -0
- package/dist/components/Modal/tests/Modal.test.stories.d.ts +32 -0
- package/dist/components/Modal/tests/Modal.test.stories.js +149 -0
- package/dist/components/Overlay/tests/Overlay.stories.d.ts +4 -2
- package/dist/components/Overlay/tests/Overlay.stories.js +53 -53
- package/dist/components/Overlay/tests/Overlay.test.stories.d.ts +28 -0
- package/dist/components/Overlay/tests/Overlay.test.stories.js +146 -0
- package/dist/components/Pagination/tests/Pagination.test.stories.d.ts +23 -0
- package/dist/components/Pagination/tests/Pagination.test.stories.js +86 -0
- package/dist/components/PinField/tests/PinField.stories.d.ts +0 -1
- package/dist/components/PinField/tests/PinField.stories.js +10 -19
- package/dist/components/PinField/tests/PinField.test.stories.d.ts +29 -0
- package/dist/components/PinField/tests/PinField.test.stories.js +177 -0
- package/dist/components/Popover/tests/Popover.test.stories.d.ts +40 -0
- package/dist/components/Popover/tests/Popover.test.stories.js +167 -0
- package/dist/components/Progress/Progress.js +2 -2
- package/dist/components/Progress/Progress.types.d.ts +1 -0
- package/dist/components/Progress/tests/Progress.stories.js +10 -10
- package/dist/components/Progress/tests/Progress.test.stories.d.ts +16 -0
- package/dist/components/Progress/tests/Progress.test.stories.js +35 -0
- package/dist/components/Radio/tests/Radio.test.stories.d.ts +30 -0
- package/dist/components/Radio/tests/Radio.test.stories.js +118 -0
- package/dist/components/RadioGroup/tests/RadioGroup.test.stories.d.ts +22 -0
- package/dist/components/RadioGroup/tests/RadioGroup.test.stories.js +78 -0
- package/dist/components/Reshaped/tests/Reshaped.stories.d.ts +33 -0
- package/dist/components/Reshaped/tests/Reshaped.stories.js +88 -0
- package/dist/components/Resizable/Resizable.js +1 -0
- package/dist/components/Resizable/tests/Resizable.stories.d.ts +3 -0
- package/dist/components/Resizable/tests/Resizable.stories.js +4 -0
- package/dist/components/Resizable/tests/Resizable.test.stories.d.ts +19 -0
- package/dist/components/Resizable/tests/Resizable.test.stories.js +25 -0
- package/dist/components/Scrim/tests/Scrim.test.stories.d.ts +15 -0
- package/dist/components/Scrim/tests/Scrim.test.stories.js +25 -0
- package/dist/components/ScrollArea/ScrollArea.js +1 -1
- package/dist/components/ScrollArea/ScrollArea.module.css +1 -1
- package/dist/components/ScrollArea/tests/ScrollArea.stories.d.ts +17 -4
- package/dist/components/ScrollArea/tests/ScrollArea.stories.js +114 -139
- package/dist/components/ScrollArea/tests/ScrollArea.test.stories.d.ts +23 -0
- package/dist/components/ScrollArea/tests/ScrollArea.test.stories.js +66 -0
- package/dist/components/Select/tests/Select.stories.d.ts +1 -1
- package/dist/components/Select/tests/Select.stories.js +5 -12
- package/dist/components/Select/tests/Select.test.stories.d.ts +27 -0
- package/dist/components/Select/tests/Select.test.stories.js +132 -0
- package/dist/components/Skeleton/tests/Skeleton.test.stories.d.ts +15 -0
- package/dist/components/Skeleton/tests/Skeleton.test.stories.js +23 -0
- package/dist/components/Slider/tests/Slider.stories.d.ts +0 -1
- package/dist/components/Slider/tests/Slider.stories.js +8 -9
- package/dist/components/Slider/tests/Slider.test.stories.d.ts +38 -0
- package/dist/components/Slider/tests/Slider.test.stories.js +150 -0
- package/dist/components/Stepper/Stepper.js +1 -1
- package/dist/components/Stepper/tests/Stepper.stories.js +0 -3
- package/dist/components/Stepper/tests/Stepper.test.stories.d.ts +18 -0
- package/dist/components/Stepper/tests/Stepper.test.stories.js +28 -0
- package/dist/components/Switch/tests/Switch.test.stories.d.ts +23 -0
- package/dist/components/Switch/tests/Switch.test.stories.js +79 -0
- package/dist/components/Table/tests/Table.test.stories.d.ts +25 -0
- package/dist/components/Table/tests/Table.test.stories.js +93 -0
- package/dist/components/Tabs/tests/Tabs.stories.js +4 -4
- package/dist/components/Tabs/tests/Tabs.test.stories.d.ts +28 -0
- package/dist/components/Tabs/tests/Tabs.test.stories.js +128 -0
- package/dist/components/Text/tests/Text.stories.d.ts +28 -7
- package/dist/components/Text/tests/Text.stories.js +148 -125
- package/dist/components/Text/tests/Text.test.stories.d.ts +18 -0
- package/dist/components/Text/tests/Text.test.stories.js +49 -0
- package/dist/components/TextArea/TextArea.module.css +1 -1
- package/dist/components/TextArea/tests/TextArea.stories.js +1 -1
- package/dist/components/TextArea/tests/TextArea.test.stories.d.ts +29 -0
- package/dist/components/TextArea/tests/TextArea.test.stories.js +99 -0
- package/dist/components/TextField/tests/TextField.stories.js +1 -1
- package/dist/components/TextField/tests/TextField.test.stories.d.ts +29 -0
- package/dist/components/TextField/tests/TextField.test.stories.js +99 -0
- package/dist/components/Theme/tests/Theme.test.stories.d.ts +24 -0
- package/dist/components/Theme/tests/Theme.test.stories.js +133 -0
- package/dist/components/Timeline/tests/Timeline.test.stories.d.ts +18 -0
- package/dist/components/Timeline/tests/Timeline.test.stories.js +32 -0
- package/dist/components/Toast/tests/Toast.test.stories.d.ts +16 -0
- package/dist/components/Toast/tests/Toast.test.stories.js +101 -0
- package/dist/components/Tooltip/tests/Tooltip.stories.js +0 -14
- package/dist/components/Tooltip/tests/Tooltip.test.stories.d.ts +19 -0
- package/dist/components/Tooltip/tests/Tooltip.test.stories.js +40 -0
- package/dist/components/View/View.js +1 -2
- package/dist/components/View/tests/View.stories.d.ts +112 -28
- package/dist/components/View/tests/View.stories.js +1092 -1012
- package/dist/components/View/tests/View.test.stories.d.ts +20 -0
- package/dist/components/View/tests/View.test.stories.js +50 -0
- package/dist/components/_private/Flyout/FlyoutContent.js +1 -1
- package/dist/components/_private/Flyout/tests/Flyout.stories.js +4 -4
- package/dist/components/_private/Flyout/tests/Flyout.test.stories.d.ts +28 -0
- package/dist/components/_private/Flyout/tests/Flyout.test.stories.js +205 -0
- package/dist/components/_private/Portal/tests/Portal.stories.js +1 -1
- package/dist/hooks/_private/useSingletonHotkeys.d.ts +3 -3
- package/dist/hooks/_private/useSingletonHotkeys.js +1 -1
- package/dist/hooks/tests/useDrag.stories.js +1 -0
- package/dist/hooks/tests/useDrag.test.stories.d.ts +26 -0
- package/dist/hooks/tests/useDrag.test.stories.js +120 -0
- package/dist/hooks/tests/useElementId.stories.d.ts +6 -0
- package/dist/hooks/tests/useElementId.stories.js +19 -0
- package/dist/hooks/tests/useHotkeys.test.stories.d.ts +39 -0
- package/dist/hooks/tests/useHotkeys.test.stories.js +119 -0
- package/dist/hooks/tests/useRTL.stories.d.ts +6 -0
- package/dist/hooks/tests/useRTL.stories.js +25 -0
- package/dist/hooks/tests/useResponsiveClientValue.stories.d.ts +9 -1
- package/dist/hooks/tests/useResponsiveClientValue.stories.js +22 -9
- package/dist/hooks/tests/useScrollLock.stories.d.ts +6 -0
- package/dist/hooks/tests/useScrollLock.stories.js +22 -0
- package/dist/hooks/tests/useToggle.stories.d.ts +8 -0
- package/dist/hooks/tests/useToggle.stories.js +54 -0
- package/dist/hooks/useHotkeys.js +0 -2
- package/dist/hooks/useScrollLock.d.ts +1 -0
- package/dist/hooks/useScrollLock.js +7 -3
- package/dist/tests/ShadowDOM.stories.js +1 -1
- package/dist/themes/_generator/tests/themes.stories.d.ts +3 -0
- package/dist/themes/_generator/tests/themes.stories.js +7 -11
- package/dist/themes/_generator/utilities/generateColors.d.ts +1 -1
- package/dist/themes/_generator/utilities/generateColors.js +3 -2
- package/dist/themes/slate/theme.css +1 -1
- package/dist/utilities/helpers.d.ts +1 -0
- package/dist/utilities/helpers.js +3 -0
- package/dist/utilities/scroll/lock.d.ts +1 -0
- package/dist/utilities/scroll/lock.js +3 -3
- package/dist/utilities/scroll/lockSafari.d.ts +1 -1
- package/dist/utilities/scroll/lockSafari.js +4 -5
- package/dist/utilities/scroll/lockStandard.d.ts +4 -1
- package/dist/utilities/scroll/lockStandard.js +7 -2
- package/dist/utilities/storybook/Example.js +1 -2
- package/package.json +20 -19
- package/dist/components/Theme/tests/Theme.stories.d.ts +0 -13
- package/dist/components/Theme/tests/Theme.stories.js +0 -80
- package/dist/utilities/storybook/Example.module.css +0 -1
@@ -16,1091 +16,1171 @@ export default {
|
|
16
16
|
},
|
17
17
|
},
|
18
18
|
};
|
19
|
-
export const padding =
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
</Example.Item>
|
25
|
-
<Example.Item title="padding: 6">
|
26
|
-
<View padding={6} borderColor="neutral">
|
27
|
-
<Placeholder />
|
28
|
-
</View>
|
29
|
-
</Example.Item>
|
30
|
-
<Example.Item title="padding: 0">
|
31
|
-
<View padding={0} borderColor="neutral">
|
32
|
-
<Placeholder />
|
33
|
-
</View>
|
34
|
-
</Example.Item>
|
35
|
-
<Example.Item title="padding: vertical 2, horizontal 4">
|
36
|
-
<View paddingInline={4} paddingBlock={2} borderColor="neutral">
|
37
|
-
<Placeholder />
|
38
|
-
</View>
|
39
|
-
</Example.Item>
|
40
|
-
<Example.Item title="paddingTop: 4">
|
41
|
-
<View paddingTop={4} borderColor="neutral">
|
42
|
-
<Placeholder />
|
43
|
-
</View>
|
44
|
-
</Example.Item>
|
45
|
-
<Example.Item title="paddingBottom: 4">
|
46
|
-
<View paddingBottom={4} borderColor="neutral">
|
47
|
-
<Placeholder />
|
48
|
-
</View>
|
49
|
-
</Example.Item>
|
50
|
-
<Example.Item title="paddingStart: 4">
|
51
|
-
<View paddingStart={4} borderColor="neutral">
|
52
|
-
<Placeholder />
|
53
|
-
</View>
|
54
|
-
</Example.Item>
|
55
|
-
<Example.Item title="paddingEnd: 4">
|
56
|
-
<View paddingEnd={4} borderColor="neutral">
|
57
|
-
<Placeholder />
|
58
|
-
</View>
|
59
|
-
</Example.Item>
|
60
|
-
<Example.Item title={[
|
61
|
-
"responsive padding:",
|
62
|
-
"[s] vertical 2, horizontal 4",
|
63
|
-
"[m+] vertical 4, horizontal 8",
|
64
|
-
]}>
|
65
|
-
<View paddingInline={{ s: 4, m: 8 }} paddingBlock={{ s: 2, m: 4 }} borderColor="neutral">
|
66
|
-
<Placeholder />
|
67
|
-
</View>
|
68
|
-
</Example.Item>
|
69
|
-
<Example.Item title={["responsive padding:", "[s] top 2, bottom 4", "[m+] top 4, bottom 0, start: 8"]}>
|
70
|
-
<View paddingTop={{ s: 2, m: 4 }} paddingBottom={{ s: 4, m: 0 }} paddingStart={{ s: 0, m: 8 }} borderColor="neutral">
|
71
|
-
<Placeholder />
|
72
|
-
</View>
|
73
|
-
</Example.Item>
|
74
|
-
<Example.Item title="nested padding, child view should have no horizontal padding">
|
75
|
-
<View paddingStart={4} borderColor="neutral">
|
76
|
-
<View borderColor="primary" paddingBlock={4}>
|
19
|
+
export const padding = {
|
20
|
+
name: "padding",
|
21
|
+
render: () => (<Example title="Border is used to highlight the padding value">
|
22
|
+
<Example.Item title="padding: 4">
|
23
|
+
<View padding={4} borderColor="neutral">
|
77
24
|
<Placeholder />
|
78
25
|
</View>
|
79
|
-
</
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
<View
|
26
|
+
</Example.Item>
|
27
|
+
<Example.Item title="padding: 6">
|
28
|
+
<View padding={6} borderColor="neutral">
|
29
|
+
<Placeholder />
|
30
|
+
</View>
|
31
|
+
</Example.Item>
|
32
|
+
<Example.Item title="padding: 0">
|
33
|
+
<View padding={0} borderColor="neutral">
|
34
|
+
<Placeholder />
|
35
|
+
</View>
|
36
|
+
</Example.Item>
|
37
|
+
<Example.Item title="padding: vertical 2, horizontal 4">
|
38
|
+
<View paddingInline={4} paddingBlock={2} borderColor="neutral">
|
39
|
+
<Placeholder />
|
40
|
+
</View>
|
41
|
+
</Example.Item>
|
42
|
+
<Example.Item title="paddingTop: 4">
|
43
|
+
<View paddingTop={4} borderColor="neutral">
|
44
|
+
<Placeholder />
|
45
|
+
</View>
|
46
|
+
</Example.Item>
|
47
|
+
<Example.Item title="paddingBottom: 4">
|
48
|
+
<View paddingBottom={4} borderColor="neutral">
|
49
|
+
<Placeholder />
|
50
|
+
</View>
|
51
|
+
</Example.Item>
|
52
|
+
<Example.Item title="paddingStart: 4">
|
53
|
+
<View paddingStart={4} borderColor="neutral">
|
54
|
+
<Placeholder />
|
55
|
+
</View>
|
56
|
+
</Example.Item>
|
57
|
+
<Example.Item title="paddingEnd: 4">
|
58
|
+
<View paddingEnd={4} borderColor="neutral">
|
59
|
+
<Placeholder />
|
60
|
+
</View>
|
61
|
+
</Example.Item>
|
62
|
+
<Example.Item title={[
|
63
|
+
"responsive padding:",
|
64
|
+
"[s] vertical 2, horizontal 4",
|
65
|
+
"[m+] vertical 4, horizontal 8",
|
66
|
+
]}>
|
67
|
+
<View paddingInline={{ s: 4, m: 8 }} paddingBlock={{ s: 2, m: 4 }} borderColor="neutral">
|
68
|
+
<Placeholder />
|
69
|
+
</View>
|
70
|
+
</Example.Item>
|
71
|
+
<Example.Item title={["responsive padding:", "[s] top 2, bottom 4", "[m+] top 4, bottom 0, start: 8"]}>
|
72
|
+
<View paddingTop={{ s: 2, m: 4 }} paddingBottom={{ s: 4, m: 0 }} paddingStart={{ s: 0, m: 8 }} borderColor="neutral">
|
73
|
+
<Placeholder />
|
74
|
+
</View>
|
75
|
+
</Example.Item>
|
76
|
+
<Example.Item title="nested padding, child view should have no horizontal padding">
|
77
|
+
<View paddingStart={4} borderColor="neutral">
|
78
|
+
<View borderColor="primary" paddingBlock={4}>
|
79
|
+
<Placeholder />
|
80
|
+
</View>
|
81
|
+
</View>
|
82
|
+
</Example.Item>
|
83
|
+
</Example>),
|
84
|
+
};
|
85
|
+
export const direction = {
|
86
|
+
name: "direction",
|
87
|
+
render: () => (<Example title="Item 1 is another component, Item 2 is View.Item, Item 3 is text">
|
88
|
+
<Example.Item title="direction: column as default">
|
89
|
+
<View gap={3}>
|
90
|
+
<Placeholder>Item 1</Placeholder>
|
91
|
+
<View.Item>
|
92
|
+
<Placeholder>Item 2</Placeholder>
|
93
|
+
</View.Item>
|
94
|
+
Text item 3
|
95
|
+
</View>
|
96
|
+
</Example.Item>
|
97
|
+
<Example.Item title="direction: column">
|
98
|
+
<View gap={3} direction="column">
|
99
|
+
<Placeholder>Item 1</Placeholder>
|
100
|
+
<View.Item>
|
101
|
+
<Placeholder>Item 2</Placeholder>
|
102
|
+
</View.Item>
|
103
|
+
Text item 3
|
104
|
+
</View>
|
105
|
+
</Example.Item>
|
106
|
+
<Example.Item title="direction: column-reverse">
|
107
|
+
<View gap={3} direction="column-reverse">
|
108
|
+
<Placeholder>Item 1</Placeholder>
|
109
|
+
<View.Item>
|
110
|
+
<Placeholder>Item 2</Placeholder>
|
111
|
+
</View.Item>
|
112
|
+
Text item 3
|
113
|
+
</View>
|
114
|
+
</Example.Item>
|
115
|
+
<Example.Item title="direction: row">
|
116
|
+
<View gap={3} direction="row">
|
117
|
+
<Placeholder>Item 1</Placeholder>
|
118
|
+
<View.Item>
|
119
|
+
<Placeholder>Item 2</Placeholder>
|
120
|
+
</View.Item>
|
121
|
+
Text item 3
|
122
|
+
</View>
|
123
|
+
</Example.Item>
|
124
|
+
<Example.Item title="direction: row-reverse">
|
125
|
+
<View gap={3} direction="row-reverse">
|
126
|
+
<Placeholder>Item 1</Placeholder>
|
127
|
+
<View.Item>
|
128
|
+
<Placeholder>Item 2</Placeholder>
|
129
|
+
</View.Item>
|
130
|
+
Text item 3
|
131
|
+
</View>
|
132
|
+
</Example.Item>
|
133
|
+
<Example.Item title={["responsive direction", "[s] column-reverse", "[m] row-reverse", "[l+] row"]}>
|
134
|
+
<View direction={{ s: "column-reverse", m: "row-reverse", l: "row" }} gap={3}>
|
135
|
+
<Placeholder>Item 1</Placeholder>
|
87
136
|
<Placeholder>Item 2</Placeholder>
|
88
|
-
</View
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
137
|
+
</View>
|
138
|
+
</Example.Item>
|
139
|
+
</Example>),
|
140
|
+
};
|
141
|
+
export const gap = {
|
142
|
+
name: "gap",
|
143
|
+
render: () => (<Example>
|
144
|
+
<Example.Item title="gap: 4, direction: row">
|
145
|
+
<View direction="row" gap={4} divided>
|
146
|
+
<Placeholder>Item 1</Placeholder>
|
96
147
|
<Placeholder>Item 2</Placeholder>
|
97
|
-
|
98
|
-
|
99
|
-
</
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
<Placeholder>Item 1</Placeholder>
|
104
|
-
<View.Item>
|
148
|
+
<Placeholder>Item 3</Placeholder>
|
149
|
+
</View>
|
150
|
+
</Example.Item>
|
151
|
+
<Example.Item title="gap: 0, direction: row">
|
152
|
+
<View direction="row" gap={0}>
|
153
|
+
<Placeholder>Item 1</Placeholder>
|
105
154
|
<Placeholder>Item 2</Placeholder>
|
106
|
-
</View
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
<View gap={3} direction="row">
|
112
|
-
<Placeholder>Item 1</Placeholder>
|
113
|
-
<View.Item>
|
155
|
+
</View>
|
156
|
+
</Example.Item>
|
157
|
+
<Example.Item title={["responsive gap, direction: row", "[s] 4", "[m+] 8"]}>
|
158
|
+
<View direction="row" gap={{ s: 4, m: 8 }}>
|
159
|
+
<Placeholder>Item 1</Placeholder>
|
114
160
|
<Placeholder>Item 2</Placeholder>
|
115
|
-
</View
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
<View gap={3} direction="row-reverse">
|
121
|
-
<Placeholder>Item 1</Placeholder>
|
122
|
-
<View.Item>
|
161
|
+
</View>
|
162
|
+
</Example.Item>
|
163
|
+
<Example.Item title="gap: 4, direction: column">
|
164
|
+
<View gap={4}>
|
165
|
+
<Placeholder>Item 1</Placeholder>
|
123
166
|
<Placeholder>Item 2</Placeholder>
|
124
|
-
</View
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
<Example.Item title={["responsive direction", "[s] column-reverse", "[m] row-reverse", "[l+] row"]}>
|
129
|
-
<View direction={{ s: "column-reverse", m: "row-reverse", l: "row" }} gap={3}>
|
130
|
-
<Placeholder>Item 1</Placeholder>
|
131
|
-
<Placeholder>Item 2</Placeholder>
|
132
|
-
</View>
|
133
|
-
</Example.Item>
|
134
|
-
</Example>);
|
135
|
-
export const gap = () => (<Example>
|
136
|
-
<Example.Item title="gap: 4, direction: row">
|
137
|
-
<View direction="row" gap={4} divided>
|
138
|
-
<Placeholder>Item 1</Placeholder>
|
139
|
-
<Placeholder>Item 2</Placeholder>
|
140
|
-
<Placeholder>Item 3</Placeholder>
|
141
|
-
</View>
|
142
|
-
</Example.Item>
|
143
|
-
<Example.Item title="gap: 0, direction: row">
|
144
|
-
<View direction="row" gap={0}>
|
145
|
-
<Placeholder>Item 1</Placeholder>
|
146
|
-
<Placeholder>Item 2</Placeholder>
|
147
|
-
</View>
|
148
|
-
</Example.Item>
|
149
|
-
<Example.Item title={["responsive gap, direction: row", "[s] 4", "[m+] 8"]}>
|
150
|
-
<View direction="row" gap={{ s: 4, m: 8 }}>
|
151
|
-
<Placeholder>Item 1</Placeholder>
|
152
|
-
<Placeholder>Item 2</Placeholder>
|
153
|
-
</View>
|
154
|
-
</Example.Item>
|
155
|
-
<Example.Item title="gap: 4, direction: column">
|
156
|
-
<View gap={4}>
|
157
|
-
<Placeholder>Item 1</Placeholder>
|
158
|
-
<Placeholder>Item 2</Placeholder>
|
159
|
-
</View>
|
160
|
-
</Example.Item>
|
161
|
-
<Example.Item title="gap: 0, direction: column">
|
162
|
-
<View gap={0}>
|
163
|
-
<Placeholder>Item 1</Placeholder>
|
164
|
-
<Placeholder>Item 2</Placeholder>
|
165
|
-
</View>
|
166
|
-
</Example.Item>
|
167
|
-
<Example.Item title={["responsive gap, direction: column", "[s] 4", "[m+] 8"]}>
|
168
|
-
<View gap={{ s: 4, m: 8 }}>
|
169
|
-
<Placeholder>Item 1</Placeholder>
|
170
|
-
<Placeholder>Item 2</Placeholder>
|
171
|
-
</View>
|
172
|
-
</Example.Item>
|
173
|
-
</Example>);
|
174
|
-
export const divided = () => (<Example>
|
175
|
-
<Example.Item title="direction: row">
|
176
|
-
<View divided direction="row" gap={3}>
|
177
|
-
<Placeholder>Item 1</Placeholder>
|
178
|
-
<Placeholder>Item 2</Placeholder>
|
179
|
-
</View>
|
180
|
-
</Example.Item>
|
181
|
-
<Example.Item title="direction: column">
|
182
|
-
<View divided gap={3}>
|
183
|
-
<Placeholder>Item 1</Placeholder>
|
184
|
-
<Placeholder>Item 2</Placeholder>
|
185
|
-
</View>
|
186
|
-
</Example.Item>
|
187
|
-
<Example.Item title={["responsive divided", "[s] direction: row", "[m+] direction: column"]}>
|
188
|
-
<View divided direction={{ s: "row", m: "column" }} gap={3}>
|
189
|
-
<Placeholder />
|
190
|
-
<Placeholder />
|
191
|
-
</View>
|
192
|
-
</Example.Item>
|
193
|
-
<Example.Item title="direction: row, columns">
|
194
|
-
<View divided gap={3} direction="row">
|
195
|
-
<View.Item columns={2}>
|
167
|
+
</View>
|
168
|
+
</Example.Item>
|
169
|
+
<Example.Item title="gap: 0, direction: column">
|
170
|
+
<View gap={0}>
|
196
171
|
<Placeholder>Item 1</Placeholder>
|
197
|
-
</View.Item>
|
198
|
-
<View.Item columns={8}>
|
199
172
|
<Placeholder>Item 2</Placeholder>
|
200
|
-
</View
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
</Example.Item>
|
206
|
-
<Example.Item title="with React.Fragment">
|
207
|
-
<View direction="row" gap={4} divided>
|
208
|
-
<Placeholder>Item 1</Placeholder>
|
209
|
-
<>
|
173
|
+
</View>
|
174
|
+
</Example.Item>
|
175
|
+
<Example.Item title={["responsive gap, direction: column", "[s] 4", "[m+] 8"]}>
|
176
|
+
<View gap={{ s: 4, m: 8 }}>
|
177
|
+
<Placeholder>Item 1</Placeholder>
|
210
178
|
<Placeholder>Item 2</Placeholder>
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
<
|
219
|
-
<
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
<
|
231
|
-
<
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
<
|
279
|
-
<
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
<
|
302
|
-
<
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
<
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
</View>
|
323
|
-
</Example.Item>
|
324
|
-
|
325
|
-
<Example.Item title="justify: start, direction: column, height: 200px">
|
326
|
-
<View height="200px" justify="start" direction="column" gap={3}>
|
327
|
-
<Placeholder />
|
328
|
-
<Placeholder />
|
329
|
-
</View>
|
330
|
-
</Example.Item>
|
331
|
-
<Example.Item title="justify: center, direction: column, height: 200px">
|
332
|
-
<View height="200px" justify="center" direction="column" gap={3}>
|
333
|
-
<Placeholder />
|
334
|
-
<Placeholder />
|
335
|
-
</View>
|
336
|
-
</Example.Item>
|
337
|
-
<Example.Item title="justify: end, direction: column, height: 200px">
|
338
|
-
<View justify="end" height="200px" direction="column" gap={3}>
|
339
|
-
<Placeholder />
|
340
|
-
<Placeholder />
|
341
|
-
</View>
|
342
|
-
</Example.Item>
|
343
|
-
<Example.Item title="justify: space-between, direction: column, height: 200px">
|
344
|
-
<View justify="space-between" height="200px" direction="column" gap={3}>
|
345
|
-
<Placeholder />
|
346
|
-
<Placeholder />
|
347
|
-
</View>
|
348
|
-
</Example.Item>
|
349
|
-
</Example>);
|
350
|
-
export const textAlign = () => (<Example>
|
351
|
-
<Example.Item title="textAlign: start">
|
352
|
-
<View textAlign="start">Content</View>
|
353
|
-
</Example.Item>
|
179
|
+
</View>
|
180
|
+
</Example.Item>
|
181
|
+
</Example>),
|
182
|
+
};
|
183
|
+
export const divided = {
|
184
|
+
name: "divided",
|
185
|
+
render: () => (<Example>
|
186
|
+
<Example.Item title="direction: row">
|
187
|
+
<View divided direction="row" gap={3}>
|
188
|
+
<Placeholder>Item 1</Placeholder>
|
189
|
+
<Placeholder>Item 2</Placeholder>
|
190
|
+
</View>
|
191
|
+
</Example.Item>
|
192
|
+
<Example.Item title="direction: column">
|
193
|
+
<View divided gap={3}>
|
194
|
+
<Placeholder>Item 1</Placeholder>
|
195
|
+
<Placeholder>Item 2</Placeholder>
|
196
|
+
</View>
|
197
|
+
</Example.Item>
|
198
|
+
<Example.Item title={["responsive divided", "[s] direction: row", "[m+] direction: column"]}>
|
199
|
+
<View divided direction={{ s: "row", m: "column" }} gap={3}>
|
200
|
+
<Placeholder />
|
201
|
+
<Placeholder />
|
202
|
+
</View>
|
203
|
+
</Example.Item>
|
204
|
+
<Example.Item title="direction: row, columns">
|
205
|
+
<View divided gap={3} direction="row">
|
206
|
+
<View.Item columns={2}>
|
207
|
+
<Placeholder>Item 1</Placeholder>
|
208
|
+
</View.Item>
|
209
|
+
<View.Item columns={8}>
|
210
|
+
<Placeholder>Item 2</Placeholder>
|
211
|
+
</View.Item>
|
212
|
+
<View.Item columns={2}>
|
213
|
+
<Placeholder>Item 3</Placeholder>
|
214
|
+
</View.Item>
|
215
|
+
</View>
|
216
|
+
</Example.Item>
|
217
|
+
<Example.Item title="with React.Fragment">
|
218
|
+
<View direction="row" gap={4} divided>
|
219
|
+
<Placeholder>Item 1</Placeholder>
|
220
|
+
<>
|
221
|
+
<Placeholder>Item 2</Placeholder>
|
222
|
+
<Placeholder>Item 3</Placeholder>
|
223
|
+
</>
|
224
|
+
</View>
|
225
|
+
</Example.Item>
|
226
|
+
</Example>),
|
227
|
+
};
|
228
|
+
export const bleed = {
|
229
|
+
name: "bleed",
|
230
|
+
render: () => (<Example title="Removes side borders and border radius when applied">
|
231
|
+
<Example.Item title="bleed: 4">
|
232
|
+
<View bleed={4} padding={4} borderColor="neutral">
|
233
|
+
<Placeholder />
|
234
|
+
</View>
|
235
|
+
</Example.Item>
|
236
|
+
<Example.Item title={["responsive bleed", "[s] 4", "[m+] 0"]}>
|
237
|
+
<View bleed={{ s: 4, m: 0 }} padding={4} borderRadius="small" borderColor="neutral">
|
238
|
+
<Placeholder />
|
239
|
+
</View>
|
240
|
+
</Example.Item>
|
241
|
+
</Example>),
|
242
|
+
};
|
243
|
+
export const wrap = {
|
244
|
+
name: "wrap",
|
245
|
+
render: () => (<Example>
|
246
|
+
<Example.Item title="wrap: false">
|
247
|
+
<View direction="row" wrap={false} gap={3}>
|
248
|
+
<Placeholder w={600} h={100}/>
|
249
|
+
<Placeholder w={600} h={100}/>
|
250
|
+
</View>
|
251
|
+
</Example.Item>
|
252
|
+
</Example>),
|
253
|
+
};
|
254
|
+
export const align = {
|
255
|
+
name: "align",
|
256
|
+
render: () => (<Example>
|
257
|
+
<Example.Item title="align: start, direction: row">
|
258
|
+
<View align="start" direction="row" gap={3}>
|
259
|
+
<Placeholder />
|
260
|
+
<Placeholder h={100}/>
|
261
|
+
</View>
|
262
|
+
</Example.Item>
|
263
|
+
<Example.Item title="align: center, direction: row">
|
264
|
+
<View align="center" direction="row" gap={3}>
|
265
|
+
<Placeholder />
|
266
|
+
<Placeholder h={100}/>
|
267
|
+
</View>
|
268
|
+
</Example.Item>
|
269
|
+
<Example.Item title="align: end, direction: row">
|
270
|
+
<View align="end" direction="row" gap={3}>
|
271
|
+
<Placeholder />
|
272
|
+
<Placeholder h={100}/>
|
273
|
+
</View>
|
274
|
+
</Example.Item>
|
275
|
+
<Example.Item title={[
|
276
|
+
"align: stretch, direction: row",
|
277
|
+
"2nd item is stretched based on the 1st item height",
|
278
|
+
]}>
|
279
|
+
<View align="stretch" direction="row" gap={3}>
|
280
|
+
<Placeholder h={100}/>
|
281
|
+
<Placeholder h="auto"/>
|
282
|
+
</View>
|
283
|
+
</Example.Item>
|
284
|
+
<Example.Item title="align: baseline, direction: row">
|
285
|
+
<View align="baseline" direction="row" gap={3}>
|
286
|
+
<Placeholder />
|
287
|
+
<Text variant="title-6">Content</Text>
|
288
|
+
</View>
|
289
|
+
</Example.Item>
|
354
290
|
|
355
|
-
|
356
|
-
|
357
|
-
|
291
|
+
<Example.Item title="align: start, direction: column">
|
292
|
+
<View align="start" direction="column" gap={3}>
|
293
|
+
<Placeholder />
|
294
|
+
<Placeholder w={100}/>
|
295
|
+
</View>
|
296
|
+
</Example.Item>
|
297
|
+
<Example.Item title="align: center, direction: column">
|
298
|
+
<View align="center" direction="column" gap={3}>
|
299
|
+
<Placeholder />
|
300
|
+
<Placeholder w={100}/>
|
301
|
+
</View>
|
302
|
+
</Example.Item>
|
303
|
+
<Example.Item title="align: end, direction: row">
|
304
|
+
<View align="end" direction="column" gap={3}>
|
305
|
+
<Placeholder />
|
306
|
+
<Placeholder w={100}/>
|
307
|
+
</View>
|
308
|
+
</Example.Item>
|
309
|
+
<Example.Item title={[
|
310
|
+
"align: stretch, direction: column",
|
311
|
+
"1st item uses its own width, 2nd item is stretched to full width",
|
312
|
+
]}>
|
313
|
+
<View align="stretch" direction="column" gap={3}>
|
314
|
+
<Placeholder w={100}/>
|
315
|
+
<Placeholder w="auto"/>
|
316
|
+
</View>
|
317
|
+
</Example.Item>
|
318
|
+
</Example>),
|
319
|
+
};
|
320
|
+
export const justify = {
|
321
|
+
name: "justify",
|
322
|
+
render: () => (<Example>
|
323
|
+
<Example.Item title="justify: start, direction: row">
|
324
|
+
<View justify="start" direction="row" gap={3}>
|
325
|
+
<Placeholder />
|
326
|
+
<Placeholder />
|
327
|
+
</View>
|
328
|
+
</Example.Item>
|
329
|
+
<Example.Item title="justify: center, direction: row">
|
330
|
+
<View justify="center" direction="row" gap={3}>
|
331
|
+
<Placeholder />
|
332
|
+
<Placeholder />
|
333
|
+
</View>
|
334
|
+
</Example.Item>
|
335
|
+
<Example.Item title="justify: end, direction: row">
|
336
|
+
<View justify="end" direction="row" gap={3}>
|
337
|
+
<Placeholder />
|
338
|
+
<Placeholder />
|
339
|
+
</View>
|
340
|
+
</Example.Item>
|
341
|
+
<Example.Item title="justify: space-between, direction: row">
|
342
|
+
<View justify="space-between" direction="row" gap={3}>
|
343
|
+
<Placeholder />
|
344
|
+
<Placeholder />
|
345
|
+
</View>
|
346
|
+
</Example.Item>
|
358
347
|
|
359
|
-
|
360
|
-
|
361
|
-
|
348
|
+
<Example.Item title="justify: start, direction: column, height: 200px">
|
349
|
+
<View height="200px" justify="start" direction="column" gap={3}>
|
350
|
+
<Placeholder />
|
351
|
+
<Placeholder />
|
352
|
+
</View>
|
353
|
+
</Example.Item>
|
354
|
+
<Example.Item title="justify: center, direction: column, height: 200px">
|
355
|
+
<View height="200px" justify="center" direction="column" gap={3}>
|
356
|
+
<Placeholder />
|
357
|
+
<Placeholder />
|
358
|
+
</View>
|
359
|
+
</Example.Item>
|
360
|
+
<Example.Item title="justify: end, direction: column, height: 200px">
|
361
|
+
<View justify="end" height="200px" direction="column" gap={3}>
|
362
|
+
<Placeholder />
|
363
|
+
<Placeholder />
|
364
|
+
</View>
|
365
|
+
</Example.Item>
|
366
|
+
<Example.Item title="justify: space-between, direction: column, height: 200px">
|
367
|
+
<View justify="space-between" height="200px" direction="column" gap={3}>
|
368
|
+
<Placeholder />
|
369
|
+
<Placeholder />
|
370
|
+
</View>
|
371
|
+
</Example.Item>
|
372
|
+
</Example>),
|
373
|
+
};
|
374
|
+
export const textAlign = {
|
375
|
+
name: "textAlign",
|
376
|
+
render: () => (<Example>
|
377
|
+
<Example.Item title="textAlign: start">
|
378
|
+
<View textAlign="start">Content</View>
|
379
|
+
</Example.Item>
|
362
380
|
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
</Example>);
|
367
|
-
export const size = () => (<Example>
|
368
|
-
<Example.Item title="height: 100px, width: 100px">
|
369
|
-
<View backgroundColor="neutral-faded" height="100px" width="100px"/>
|
370
|
-
</Example.Item>
|
371
|
-
<Example.Item title="height: 25, width: 25">
|
372
|
-
<View backgroundColor="neutral-faded" height={25} width={25}/>
|
373
|
-
</Example.Item>
|
374
|
-
<Example.Item title={[
|
375
|
-
"responsive height and width",
|
376
|
-
"[s] height: 25, width: 25",
|
377
|
-
"[m+] height: 200px, width: 200px",
|
378
|
-
]}>
|
379
|
-
<View backgroundColor="neutral-faded" height={{ s: 25, m: "200px" }} width={{ s: 25, m: "200px" }}/>
|
380
|
-
</Example.Item>
|
381
|
-
</Example>);
|
382
|
-
export const ratio = () => (<Example>
|
383
|
-
<Example.Item title="ratio: 16 / 9">
|
384
|
-
<View backgroundColor="neutral-faded" aspectRatio={16 / 9} width="200px"/>
|
385
|
-
</Example.Item>
|
386
|
-
<Example.Item title={["responsive ratio", "[s] 1/1", "[m+] 16/9"]}>
|
387
|
-
<View backgroundColor="neutral-faded" aspectRatio={{ s: 1, m: 16 / 9 }} width="200px"/>
|
388
|
-
</Example.Item>
|
389
|
-
</Example>);
|
390
|
-
export const maxSize = () => (<Example>
|
391
|
-
<Example.Item title="maxHeight: 150px, maxWidth: 150px, height: 300px">
|
392
|
-
<View backgroundColor="neutral-faded" maxHeight="150px" maxWidth="150px" height="300px"/>
|
393
|
-
</Example.Item>
|
394
|
-
<Example.Item title="maxHeight: 25, maxWidth: 25, height: 50">
|
395
|
-
<View backgroundColor="neutral-faded" maxHeight={25} maxWidth={25} height={50}/>
|
396
|
-
</Example.Item>
|
397
|
-
<Example.Item title={[
|
398
|
-
"responsive maxHeight and maxWidth, height: 300",
|
399
|
-
"[s] maxHeight: 25, maxWidth: 25",
|
400
|
-
"[m+] maxHeight: 200px, maxWidth: 200px",
|
401
|
-
]}>
|
402
|
-
<View backgroundColor="neutral-faded" maxHeight={{ s: 25, m: "200px" }} maxWidth={{ s: 25, m: "200px" }} height="300px"/>
|
403
|
-
</Example.Item>
|
404
|
-
</Example>);
|
405
|
-
export const minSize = () => (<Example>
|
406
|
-
<Example.Item title="minHeight: 150px, minWidth: 150px, height: 50px, width: 50px">
|
407
|
-
<View backgroundColor="neutral-faded" minHeight="150px" minWidth="150px" height="50px" width="50px"/>
|
408
|
-
</Example.Item>
|
409
|
-
<Example.Item title="minHeight: 25, minWidth: 25, height: 5, width: 5">
|
410
|
-
<View backgroundColor="neutral-faded" minHeight={25} minWidth={25} height={5} width={5}/>
|
411
|
-
</Example.Item>
|
412
|
-
<Example.Item title={[
|
413
|
-
"responsive minHeight and minWidth, height: 50px, width: 50px",
|
414
|
-
"[s] minHeight: 25, minWidth: 25",
|
415
|
-
"[m+] minHeight: 200px, minWidth: 200px",
|
416
|
-
]}>
|
417
|
-
<View backgroundColor="neutral-faded" minHeight={{ s: 25, m: "200px" }} minWidth={{ s: 25, m: "200px" }} height="50px" width="50px"/>
|
418
|
-
</Example.Item>
|
419
|
-
</Example>);
|
420
|
-
export const background = () => (<Example title="border is used to highlight the backround value when it's similar to the page background, text color changes based on the background">
|
421
|
-
<Example.Item title="bg: page">
|
422
|
-
<View backgroundColor="page" borderColor="neutral" padding={4}>
|
423
|
-
Content
|
424
|
-
</View>
|
425
|
-
</Example.Item>
|
426
|
-
<Example.Item title="bg: page-faded">
|
427
|
-
<View backgroundColor="page-faded" padding={4}>
|
428
|
-
Content
|
429
|
-
</View>
|
430
|
-
</Example.Item>
|
431
|
-
<Example.Item title="bg: disabled">
|
432
|
-
<View backgroundColor="disabled" padding={4}>
|
433
|
-
Content
|
434
|
-
</View>
|
435
|
-
</Example.Item>
|
436
|
-
<Example.Item title="bg: disabled-faded">
|
437
|
-
<View backgroundColor="disabled-faded" padding={4}>
|
438
|
-
Content
|
439
|
-
</View>
|
440
|
-
</Example.Item>
|
441
|
-
<Example.Item title="bg: elevation-base">
|
442
|
-
<View backgroundColor="elevation-base" borderColor="neutral" padding={4}>
|
443
|
-
Content
|
444
|
-
</View>
|
445
|
-
</Example.Item>
|
446
|
-
<Example.Item title="bg: elevation-raised">
|
447
|
-
<View backgroundColor="elevation-raised" borderColor="neutral" padding={4}>
|
448
|
-
Content
|
449
|
-
</View>
|
450
|
-
</Example.Item>
|
451
|
-
<Example.Item title="bg: elevation-overlay">
|
452
|
-
<View backgroundColor="elevation-overlay" borderColor="neutral" padding={4}>
|
453
|
-
Content
|
454
|
-
</View>
|
455
|
-
</Example.Item>
|
456
|
-
<Example.Item title="bg: neutral">
|
457
|
-
<View backgroundColor="neutral" padding={4}>
|
458
|
-
Content
|
459
|
-
</View>
|
460
|
-
</Example.Item>
|
461
|
-
<Example.Item title="bg: neutral-faded">
|
462
|
-
<View backgroundColor="neutral-faded" padding={4}>
|
463
|
-
Content
|
464
|
-
</View>
|
465
|
-
</Example.Item>
|
466
|
-
<Example.Item title="bg: primary">
|
467
|
-
<View backgroundColor="primary" padding={4}>
|
468
|
-
Content
|
469
|
-
</View>
|
470
|
-
</Example.Item>
|
471
|
-
<Example.Item title="bg: primary-faded">
|
472
|
-
<View backgroundColor="primary-faded" padding={4}>
|
473
|
-
Content
|
474
|
-
</View>
|
475
|
-
</Example.Item>
|
476
|
-
<Example.Item title="bg: critical">
|
477
|
-
<View backgroundColor="critical" padding={4}>
|
478
|
-
Content
|
479
|
-
</View>
|
480
|
-
</Example.Item>
|
481
|
-
<Example.Item title="bg: critical-faded">
|
482
|
-
<View backgroundColor="critical-faded" padding={4}>
|
483
|
-
Content
|
484
|
-
</View>
|
485
|
-
</Example.Item>
|
486
|
-
<Example.Item title="bg: warning">
|
487
|
-
<View backgroundColor="warning" padding={4}>
|
488
|
-
Content
|
489
|
-
</View>
|
490
|
-
</Example.Item>
|
491
|
-
<Example.Item title="bg: warning-faded">
|
492
|
-
<View backgroundColor="warning-faded" padding={4}>
|
493
|
-
Content
|
494
|
-
</View>
|
495
|
-
</Example.Item>
|
496
|
-
<Example.Item title="bg: positive">
|
497
|
-
<View backgroundColor="positive" padding={4}>
|
498
|
-
Content
|
499
|
-
</View>
|
500
|
-
</Example.Item>
|
501
|
-
<Example.Item title="bg: positive-faded">
|
502
|
-
<View backgroundColor="positive-faded" padding={4}>
|
503
|
-
Content
|
504
|
-
</View>
|
505
|
-
</Example.Item>
|
506
|
-
</Example>);
|
507
|
-
export const border = () => (<Example>
|
508
|
-
<Example.Item title="border: neutral">
|
509
|
-
<View borderColor="neutral" padding={4}>
|
510
|
-
Content
|
511
|
-
</View>
|
512
|
-
</Example.Item>
|
381
|
+
<Example.Item title="textAlign: center">
|
382
|
+
<View textAlign="center">Content</View>
|
383
|
+
</Example.Item>
|
513
384
|
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
</View>
|
518
|
-
</Example.Item>
|
385
|
+
<Example.Item title="textAlign: end">
|
386
|
+
<View textAlign="end">Content</View>
|
387
|
+
</Example.Item>
|
519
388
|
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
389
|
+
<Example.Item title="textAlign: [s] start, [m+] end">
|
390
|
+
<View textAlign={{ s: "start", m: "end" }}>Content</View>
|
391
|
+
</Example.Item>
|
392
|
+
</Example>),
|
393
|
+
};
|
394
|
+
export const size = {
|
395
|
+
name: "size",
|
396
|
+
render: () => (<Example>
|
397
|
+
<Example.Item title="height: 100px, width: 100px">
|
398
|
+
<View backgroundColor="neutral-faded" height="100px" width="100px"/>
|
399
|
+
</Example.Item>
|
400
|
+
<Example.Item title="height: 25, width: 25">
|
401
|
+
<View backgroundColor="neutral-faded" height={25} width={25}/>
|
402
|
+
</Example.Item>
|
403
|
+
<Example.Item title={[
|
404
|
+
"responsive height and width",
|
405
|
+
"[s] height: 25, width: 25",
|
406
|
+
"[m+] height: 200px, width: 200px",
|
407
|
+
]}>
|
408
|
+
<View backgroundColor="neutral-faded" height={{ s: 25, m: "200px" }} width={{ s: 25, m: "200px" }}/>
|
409
|
+
</Example.Item>
|
410
|
+
</Example>),
|
411
|
+
};
|
412
|
+
export const ratio = {
|
413
|
+
name: "aspectRatio",
|
414
|
+
render: () => (<Example>
|
415
|
+
<Example.Item title="ratio: 16 / 9">
|
416
|
+
<View backgroundColor="neutral-faded" aspectRatio={16 / 9} width="200px"/>
|
417
|
+
</Example.Item>
|
418
|
+
<Example.Item title={["responsive ratio", "[s] 1/1", "[m+] 16/9"]}>
|
419
|
+
<View backgroundColor="neutral-faded" aspectRatio={{ s: 1, m: 16 / 9 }} width="200px"/>
|
420
|
+
</Example.Item>
|
421
|
+
</Example>),
|
422
|
+
};
|
423
|
+
export const maxSize = {
|
424
|
+
name: "width, height, maxWidth, maxHeight",
|
425
|
+
render: () => (<Example>
|
426
|
+
<Example.Item title="maxHeight: 150px, maxWidth: 150px, height: 300px">
|
427
|
+
<View backgroundColor="neutral-faded" maxHeight="150px" maxWidth="150px" height="300px"/>
|
428
|
+
</Example.Item>
|
429
|
+
<Example.Item title="maxHeight: 25, maxWidth: 25, height: 50">
|
430
|
+
<View backgroundColor="neutral-faded" maxHeight={25} maxWidth={25} height={50}/>
|
431
|
+
</Example.Item>
|
432
|
+
<Example.Item title={[
|
433
|
+
"responsive maxHeight and maxWidth, height: 300",
|
434
|
+
"[s] maxHeight: 25, maxWidth: 25",
|
435
|
+
"[m+] maxHeight: 200px, maxWidth: 200px",
|
436
|
+
]}>
|
437
|
+
<View backgroundColor="neutral-faded" maxHeight={{ s: 25, m: "200px" }} maxWidth={{ s: 25, m: "200px" }} height="300px"/>
|
438
|
+
</Example.Item>
|
439
|
+
</Example>),
|
440
|
+
};
|
441
|
+
export const minSize = {
|
442
|
+
name: "width, height, minWidth, minHeight",
|
443
|
+
render: () => (<Example>
|
444
|
+
<Example.Item title="minHeight: 150px, minWidth: 150px, height: 50px, width: 50px">
|
445
|
+
<View backgroundColor="neutral-faded" minHeight="150px" minWidth="150px" height="50px" width="50px"/>
|
446
|
+
</Example.Item>
|
447
|
+
<Example.Item title="minHeight: 25, minWidth: 25, height: 5, width: 5">
|
448
|
+
<View backgroundColor="neutral-faded" minHeight={25} minWidth={25} height={5} width={5}/>
|
449
|
+
</Example.Item>
|
450
|
+
<Example.Item title={[
|
451
|
+
"responsive minHeight and minWidth, height: 50px, width: 50px",
|
452
|
+
"[s] minHeight: 25, minWidth: 25",
|
453
|
+
"[m+] minHeight: 200px, minWidth: 200px",
|
454
|
+
]}>
|
455
|
+
<View backgroundColor="neutral-faded" minHeight={{ s: 25, m: "200px" }} minWidth={{ s: 25, m: "200px" }} height="50px" width="50px"/>
|
456
|
+
</Example.Item>
|
457
|
+
</Example>),
|
458
|
+
};
|
459
|
+
export const background = {
|
460
|
+
name: "backgroundColor",
|
461
|
+
render: () => (<Example title="border is used to highlight the backround value when it's similar to the page background, text color changes based on the background">
|
462
|
+
<Example.Item title="bg: page">
|
463
|
+
<View backgroundColor="page" borderColor="neutral" padding={4}>
|
464
|
+
Content
|
465
|
+
</View>
|
466
|
+
</Example.Item>
|
467
|
+
<Example.Item title="bg: page-faded">
|
468
|
+
<View backgroundColor="page-faded" padding={4}>
|
469
|
+
Content
|
470
|
+
</View>
|
471
|
+
</Example.Item>
|
472
|
+
<Example.Item title="bg: disabled">
|
473
|
+
<View backgroundColor="disabled" padding={4}>
|
474
|
+
Content
|
475
|
+
</View>
|
476
|
+
</Example.Item>
|
477
|
+
<Example.Item title="bg: disabled-faded">
|
478
|
+
<View backgroundColor="disabled-faded" padding={4}>
|
479
|
+
Content
|
480
|
+
</View>
|
481
|
+
</Example.Item>
|
482
|
+
<Example.Item title="bg: elevation-base">
|
483
|
+
<View backgroundColor="elevation-base" borderColor="neutral" padding={4}>
|
484
|
+
Content
|
485
|
+
</View>
|
486
|
+
</Example.Item>
|
487
|
+
<Example.Item title="bg: elevation-raised">
|
488
|
+
<View backgroundColor="elevation-raised" borderColor="neutral" padding={4}>
|
489
|
+
Content
|
490
|
+
</View>
|
491
|
+
</Example.Item>
|
492
|
+
<Example.Item title="bg: elevation-overlay">
|
493
|
+
<View backgroundColor="elevation-overlay" borderColor="neutral" padding={4}>
|
494
|
+
Content
|
495
|
+
</View>
|
496
|
+
</Example.Item>
|
497
|
+
<Example.Item title="bg: neutral">
|
498
|
+
<View backgroundColor="neutral" padding={4}>
|
499
|
+
Content
|
500
|
+
</View>
|
501
|
+
</Example.Item>
|
502
|
+
<Example.Item title="bg: neutral-faded">
|
503
|
+
<View backgroundColor="neutral-faded" padding={4}>
|
504
|
+
Content
|
505
|
+
</View>
|
506
|
+
</Example.Item>
|
507
|
+
<Example.Item title="bg: primary">
|
508
|
+
<View backgroundColor="primary" padding={4}>
|
509
|
+
Content
|
510
|
+
</View>
|
511
|
+
</Example.Item>
|
512
|
+
<Example.Item title="bg: primary-faded">
|
513
|
+
<View backgroundColor="primary-faded" padding={4}>
|
514
|
+
Content
|
515
|
+
</View>
|
516
|
+
</Example.Item>
|
517
|
+
<Example.Item title="bg: critical">
|
518
|
+
<View backgroundColor="critical" padding={4}>
|
519
|
+
Content
|
520
|
+
</View>
|
521
|
+
</Example.Item>
|
522
|
+
<Example.Item title="bg: critical-faded">
|
523
|
+
<View backgroundColor="critical-faded" padding={4}>
|
524
|
+
Content
|
525
|
+
</View>
|
526
|
+
</Example.Item>
|
527
|
+
<Example.Item title="bg: warning">
|
528
|
+
<View backgroundColor="warning" padding={4}>
|
529
|
+
Content
|
530
|
+
</View>
|
531
|
+
</Example.Item>
|
532
|
+
<Example.Item title="bg: warning-faded">
|
533
|
+
<View backgroundColor="warning-faded" padding={4}>
|
534
|
+
Content
|
535
|
+
</View>
|
536
|
+
</Example.Item>
|
537
|
+
<Example.Item title="bg: positive">
|
538
|
+
<View backgroundColor="positive" padding={4}>
|
539
|
+
Content
|
540
|
+
</View>
|
541
|
+
</Example.Item>
|
542
|
+
<Example.Item title="bg: positive-faded">
|
543
|
+
<View backgroundColor="positive-faded" padding={4}>
|
544
|
+
Content
|
545
|
+
</View>
|
546
|
+
</Example.Item>
|
547
|
+
</Example>),
|
548
|
+
};
|
549
|
+
export const border = {
|
550
|
+
name: "borderColor",
|
551
|
+
render: () => (<Example>
|
552
|
+
<Example.Item title="border: neutral">
|
553
|
+
<View borderColor="neutral" padding={4}>
|
554
|
+
Content
|
555
|
+
</View>
|
556
|
+
</Example.Item>
|
525
557
|
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
558
|
+
<Example.Item title="border: neutral-faded">
|
559
|
+
<View borderColor="neutral-faded" padding={4}>
|
560
|
+
Content
|
561
|
+
</View>
|
562
|
+
</Example.Item>
|
531
563
|
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
564
|
+
<Example.Item title="border: primary">
|
565
|
+
<View borderColor="primary" padding={4}>
|
566
|
+
Content
|
567
|
+
</View>
|
568
|
+
</Example.Item>
|
537
569
|
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
570
|
+
<Example.Item title="border: primary-faded">
|
571
|
+
<View borderColor="primary-faded" padding={4}>
|
572
|
+
Content
|
573
|
+
</View>
|
574
|
+
</Example.Item>
|
543
575
|
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
576
|
+
<Example.Item title="border: critical">
|
577
|
+
<View borderColor="critical" padding={4}>
|
578
|
+
Content
|
579
|
+
</View>
|
580
|
+
</Example.Item>
|
549
581
|
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
582
|
+
<Example.Item title="border: critical-faded">
|
583
|
+
<View borderColor="critical-faded" padding={4}>
|
584
|
+
Content
|
585
|
+
</View>
|
586
|
+
</Example.Item>
|
555
587
|
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
588
|
+
<Example.Item title="border: warning">
|
589
|
+
<View borderColor="warning" padding={4}>
|
590
|
+
Content
|
591
|
+
</View>
|
592
|
+
</Example.Item>
|
561
593
|
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
594
|
+
<Example.Item title="border: warning-faded">
|
595
|
+
<View borderColor="warning-faded" padding={4}>
|
596
|
+
Content
|
597
|
+
</View>
|
598
|
+
</Example.Item>
|
567
599
|
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
600
|
+
<Example.Item title="border: positive">
|
601
|
+
<View borderColor="positive" padding={4}>
|
602
|
+
Content
|
603
|
+
</View>
|
604
|
+
</Example.Item>
|
573
605
|
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
</Example>);
|
580
|
-
export const radius = () => (<Example>
|
581
|
-
<Example.Item title="radius: small">
|
582
|
-
<View borderRadius="small" borderColor="neutral" padding={4}>
|
583
|
-
Content
|
584
|
-
</View>
|
585
|
-
</Example.Item>
|
606
|
+
<Example.Item title="border: positive-faded">
|
607
|
+
<View borderColor="positive-faded" padding={4}>
|
608
|
+
Content
|
609
|
+
</View>
|
610
|
+
</Example.Item>
|
586
611
|
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
612
|
+
<Example.Item title="border: transparent, background: primary-faded">
|
613
|
+
<View borderColor="transparent" backgroundColor="primary-faded" padding={4}>
|
614
|
+
Content
|
615
|
+
</View>
|
616
|
+
</Example.Item>
|
592
617
|
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
618
|
+
<Example.Item title={["responsive", "[s] primary", "[m+] neutral"]}>
|
619
|
+
<View borderColor={{ s: "primary", m: "neutral" }} padding={4}>
|
620
|
+
Content
|
621
|
+
</View>
|
622
|
+
</Example.Item>
|
623
|
+
</Example>),
|
624
|
+
};
|
625
|
+
export const radius = {
|
626
|
+
name: "borderRadius",
|
627
|
+
render: () => (<Example>
|
628
|
+
<Example.Item title="radius: small">
|
629
|
+
<View borderRadius="small" borderColor="neutral" padding={4}>
|
630
|
+
Content
|
631
|
+
</View>
|
632
|
+
</Example.Item>
|
598
633
|
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
</Example>);
|
605
|
-
export const shadow = () => (<Example>
|
606
|
-
<Example.Item title="shadow: raised, radius: medium">
|
607
|
-
<View height="100px" width="100px" shadow="raised" borderRadius="medium" backgroundColor="elevation-raised"/>
|
608
|
-
</Example.Item>
|
609
|
-
<Example.Item title="shadow: overlay, radius: medium">
|
610
|
-
<View height="100px" width="100px" shadow="overlay" borderRadius="medium" backgroundColor="elevation-overlay"/>
|
611
|
-
</Example.Item>
|
612
|
-
</Example>);
|
613
|
-
export const overflow = () => (<Example>
|
614
|
-
<Example.Item title={["overflow: hidden, radius: medium", "child background should have radius"]}>
|
615
|
-
<View height="100px" width="100px" shadow="raised" borderRadius="medium" overflow="hidden">
|
616
|
-
<View backgroundColor="primary" height="100%" width="100%"/>
|
617
|
-
</View>
|
618
|
-
</Example.Item>
|
619
|
-
</Example>);
|
620
|
-
export const position = () => (<Example>
|
621
|
-
<Example.Item title="position: relative + absolute">
|
622
|
-
<View borderColor="neutral" position="relative">
|
623
|
-
<Placeholder />
|
624
|
-
<View position="absolute" insetTop={0} insetEnd={0} backgroundColor="critical" zIndex={5}>
|
625
|
-
top
|
626
|
-
</View>
|
627
|
-
<View position="absolute" insetTop={0} insetEnd={0} backgroundColor="primary">
|
628
|
-
below
|
629
|
-
</View>
|
630
|
-
</View>
|
631
|
-
</Example.Item>
|
634
|
+
<Example.Item title="radius: medium">
|
635
|
+
<View borderRadius="medium" borderColor="neutral" padding={4}>
|
636
|
+
Content
|
637
|
+
</View>
|
638
|
+
</Example.Item>
|
632
639
|
|
633
|
-
|
634
|
-
|
635
|
-
<View position="sticky" borderColor="primary" insetTop={0}>
|
640
|
+
<Example.Item title="radius: large">
|
641
|
+
<View borderRadius="large" borderColor="neutral" padding={4}>
|
636
642
|
Content
|
637
643
|
</View>
|
638
|
-
|
639
|
-
</div>
|
640
|
-
</Example.Item>
|
644
|
+
</Example.Item>
|
641
645
|
|
642
|
-
|
643
|
-
|
644
|
-
<View position={{ s: "absolute", m: "relative" }} borderColor="primary" insetTop={0}>
|
646
|
+
<Example.Item title="radius: circular">
|
647
|
+
<View borderRadius="circular" borderColor="neutral" padding={4}>
|
645
648
|
Content
|
646
649
|
</View>
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
<
|
654
|
-
<View
|
655
|
-
</
|
656
|
-
|
650
|
+
</Example.Item>
|
651
|
+
</Example>),
|
652
|
+
};
|
653
|
+
export const shadow = {
|
654
|
+
name: "shadow",
|
655
|
+
render: () => (<Example>
|
656
|
+
<Example.Item title="shadow: raised, radius: medium">
|
657
|
+
<View height="100px" width="100px" shadow="raised" borderRadius="medium" backgroundColor="elevation-raised"/>
|
658
|
+
</Example.Item>
|
659
|
+
<Example.Item title="shadow: overlay, radius: medium">
|
660
|
+
<View height="100px" width="100px" shadow="overlay" borderRadius="medium" backgroundColor="elevation-overlay"/>
|
661
|
+
</Example.Item>
|
662
|
+
</Example>),
|
663
|
+
};
|
664
|
+
export const overflow = {
|
665
|
+
name: "overflow",
|
666
|
+
render: () => (<Example>
|
667
|
+
<Example.Item title={["overflow: hidden, radius: medium", "child background should have radius"]}>
|
668
|
+
<View height="100px" width="100px" shadow="raised" borderRadius="medium" overflow="hidden">
|
669
|
+
<View backgroundColor="primary" height="100%" width="100%"/>
|
670
|
+
</View>
|
671
|
+
</Example.Item>
|
672
|
+
</Example>),
|
673
|
+
};
|
674
|
+
export const positioning = {
|
675
|
+
name: "position",
|
676
|
+
render: () => (<Example>
|
677
|
+
<Example.Item title="position: relative + absolute">
|
678
|
+
<View borderColor="neutral" position="relative">
|
679
|
+
<Placeholder />
|
680
|
+
<View position="absolute" insetTop={0} insetEnd={0} backgroundColor="critical" zIndex={5} height={10} width={10}/>
|
681
|
+
<View position="absolute" insetTop={0} insetEnd={0} backgroundColor="primary" height={15} width={15}/>
|
682
|
+
</View>
|
683
|
+
</Example.Item>
|
657
684
|
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
685
|
+
<Example.Item title="position: sticky">
|
686
|
+
<div style={{ overflow: "auto", height: 100 }} tabIndex={0}>
|
687
|
+
<View position="sticky" borderColor="primary" insetTop={0}>
|
688
|
+
Content
|
689
|
+
</View>
|
690
|
+
<Placeholder h={1000}/>
|
691
|
+
</div>
|
692
|
+
</Example.Item>
|
663
693
|
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
694
|
+
<Example.Item title={["responsive", "[s] position: absolute", "[m+]: position: relative"]}>
|
695
|
+
<div style={{ overflow: "auto", height: 100, position: "relative" }} tabIndex={0}>
|
696
|
+
<View position={{ s: "absolute", m: "relative" }} borderColor="primary" insetTop={0}>
|
697
|
+
Content
|
698
|
+
</View>
|
699
|
+
<Placeholder h={1000}/>
|
700
|
+
</div>
|
701
|
+
</Example.Item>
|
702
|
+
</Example>),
|
703
|
+
};
|
704
|
+
export const inset = {
|
705
|
+
name: "inset",
|
706
|
+
render: () => (<Example>
|
707
|
+
<Example.Item title="inset: 4">
|
708
|
+
<View backgroundColor="neutral-faded" width={25} height={25}>
|
709
|
+
<View backgroundColor="neutral" position="absolute" inset={4}/>
|
710
|
+
</View>
|
711
|
+
</Example.Item>
|
669
712
|
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
713
|
+
<Example.Item title="insetTop: 4">
|
714
|
+
<View backgroundColor="neutral-faded" width={25} height={25}>
|
715
|
+
<View backgroundColor="neutral" position="absolute" insetTop={4} height={10} width={10}/>
|
716
|
+
</View>
|
717
|
+
</Example.Item>
|
675
718
|
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
719
|
+
<Example.Item title="insetStart: 4">
|
720
|
+
<View backgroundColor="neutral-faded" width={25} height={25}>
|
721
|
+
<View backgroundColor="neutral" position="absolute" insetStart={4} height={10} width={10}/>
|
722
|
+
</View>
|
723
|
+
</Example.Item>
|
681
724
|
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
<
|
695
|
-
|
696
|
-
|
697
|
-
|
725
|
+
<Example.Item title="insetEnd: 4">
|
726
|
+
<View backgroundColor="neutral-faded" width={25} height={25}>
|
727
|
+
<View backgroundColor="neutral" position="absolute" insetEnd={4} height={10} width={10}/>
|
728
|
+
</View>
|
729
|
+
</Example.Item>
|
730
|
+
|
731
|
+
<Example.Item title="insetBottom: 4">
|
732
|
+
<View backgroundColor="neutral-faded" width={25} height={25}>
|
733
|
+
<View backgroundColor="neutral" position="absolute" insetBottom={4} height={10} width={10}/>
|
734
|
+
</View>
|
735
|
+
</Example.Item>
|
736
|
+
|
737
|
+
<Example.Item title="responsive, [s] insetBottom: 4 [m+] insetEnd: 4">
|
738
|
+
<View backgroundColor="neutral-faded" width={25} height={25}>
|
739
|
+
<View backgroundColor="neutral" position="absolute" insetBottom={{ s: 4, m: "auto" }} insetEnd={{ s: "auto", m: 4 }} height={10} width={10}/>
|
740
|
+
</View>
|
741
|
+
</Example.Item>
|
742
|
+
</Example>),
|
698
743
|
};
|
699
|
-
export const animated =
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
<
|
705
|
-
|
744
|
+
export const animated = {
|
745
|
+
name: "animated",
|
746
|
+
render: () => {
|
747
|
+
const [background, setBackground] = React.useState("neutral");
|
748
|
+
return (<View gap={3} align="start">
|
749
|
+
<Button onClick={() => setBackground((prev) => (prev === "neutral" ? "primary" : "neutral"))}>
|
750
|
+
Change background
|
751
|
+
</Button>
|
752
|
+
<View height="100px" width="100px" backgroundColor={background} align="center" justify="center" animated>
|
753
|
+
Content
|
754
|
+
</View>
|
755
|
+
</View>);
|
756
|
+
},
|
757
|
+
};
|
758
|
+
export const itemGapBefore = {
|
759
|
+
name: "item, gapBefore",
|
760
|
+
render: () => (<Example>
|
761
|
+
<Example.Item title={["gap: 4, 3rd item gapBefore: 10, direction: row", "increased gap"]}>
|
762
|
+
<View direction="row" gap={4}>
|
763
|
+
<Placeholder />
|
764
|
+
<Placeholder />
|
765
|
+
<View.Item gapBefore={10}>
|
766
|
+
<Placeholder />
|
767
|
+
</View.Item>
|
768
|
+
</View>
|
769
|
+
</Example.Item>
|
770
|
+
<Example.Item title={["gap: 10, 3rd item gapBefore: 4, direction: row", "reduced gap"]}>
|
771
|
+
<View direction="row" gap={10}>
|
706
772
|
<Placeholder />
|
707
|
-
</View.Item>
|
708
|
-
</View>
|
709
|
-
</Example.Item>
|
710
|
-
<Example.Item title={["gap: 10, 3rd item gapBefore: 4, direction: row", "reduced gap"]}>
|
711
|
-
<View direction="row" gap={10}>
|
712
|
-
<Placeholder />
|
713
|
-
<Placeholder />
|
714
|
-
<View.Item gapBefore={4}>
|
715
773
|
<Placeholder />
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
<
|
723
|
-
<View.Item gapBefore={0}>
|
774
|
+
<View.Item gapBefore={4}>
|
775
|
+
<Placeholder />
|
776
|
+
</View.Item>
|
777
|
+
</View>
|
778
|
+
</Example.Item>
|
779
|
+
<Example.Item title={["gap: 10, 3rd item gapBefore: 0, direction: row", "removed gap"]}>
|
780
|
+
<View direction="row" gap={10}>
|
724
781
|
<Placeholder />
|
725
|
-
</View.Item>
|
726
|
-
</View>
|
727
|
-
</Example.Item>
|
728
|
-
|
729
|
-
<Example.Item title="gap: 4, direction: row, 2nd item gap: auto">
|
730
|
-
<View direction="row" gap={4}>
|
731
|
-
<Placeholder w={200}/>
|
732
|
-
<View.Item gapBefore="auto">
|
733
782
|
<Placeholder />
|
734
|
-
|
735
|
-
|
736
|
-
|
783
|
+
<View.Item gapBefore={0}>
|
784
|
+
<Placeholder />
|
785
|
+
</View.Item>
|
786
|
+
</View>
|
787
|
+
</Example.Item>
|
788
|
+
|
789
|
+
<Example.Item title="gap: 4, direction: row, 2nd item gap: auto">
|
790
|
+
<View direction="row" gap={4}>
|
791
|
+
<Placeholder w={200}/>
|
792
|
+
<View.Item gapBefore="auto">
|
793
|
+
<Placeholder />
|
794
|
+
</View.Item>
|
795
|
+
</View>
|
796
|
+
</Example.Item>
|
737
797
|
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
798
|
+
<Example.Item title={["gap: 4, 3rd item gapBefore: 10, direction: column", "increased gap"]}>
|
799
|
+
<View direction="column" gap={4}>
|
800
|
+
<Placeholder />
|
801
|
+
<Placeholder />
|
802
|
+
<View.Item gapBefore={10}>
|
803
|
+
<Placeholder />
|
804
|
+
</View.Item>
|
805
|
+
</View>
|
806
|
+
</Example.Item>
|
807
|
+
<Example.Item title={["gap: 10, 3rd item gapBefore: 4, direction: column", "reduced gap"]}>
|
808
|
+
<View direction="column" gap={10}>
|
809
|
+
<Placeholder />
|
743
810
|
<Placeholder />
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
<
|
751
|
-
<View.Item gapBefore={4}>
|
811
|
+
<View.Item gapBefore={4}>
|
812
|
+
<Placeholder />
|
813
|
+
</View.Item>
|
814
|
+
</View>
|
815
|
+
</Example.Item>
|
816
|
+
<Example.Item title={["gap: 10, 3rd item gapBefore: 0, direction: column", "removed gap"]}>
|
817
|
+
<View direction="column" gap={10}>
|
752
818
|
<Placeholder />
|
753
|
-
</View.Item>
|
754
|
-
</View>
|
755
|
-
</Example.Item>
|
756
|
-
<Example.Item title={["gap: 10, 3rd item gapBefore: 0, direction: column", "removed gap"]}>
|
757
|
-
<View direction="column" gap={10}>
|
758
|
-
<Placeholder />
|
759
|
-
<Placeholder />
|
760
|
-
<View.Item gapBefore={0}>
|
761
819
|
<Placeholder />
|
762
|
-
|
763
|
-
|
764
|
-
|
820
|
+
<View.Item gapBefore={0}>
|
821
|
+
<Placeholder />
|
822
|
+
</View.Item>
|
823
|
+
</View>
|
824
|
+
</Example.Item>
|
765
825
|
|
766
|
-
|
767
|
-
|
768
|
-
<Placeholder />
|
769
|
-
<View.Item gapBefore="auto">
|
826
|
+
<Example.Item title="gap: 4, direction: column, height: 200px, 2nd item gap: auto">
|
827
|
+
<View height="200px" gap={4}>
|
770
828
|
<Placeholder />
|
771
|
-
|
772
|
-
|
773
|
-
|
829
|
+
<View.Item gapBefore="auto">
|
830
|
+
<Placeholder />
|
831
|
+
</View.Item>
|
832
|
+
</View>
|
833
|
+
</Example.Item>
|
774
834
|
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
<Placeholder />
|
783
|
-
<Placeholder />
|
784
|
-
<View.Item gapBefore={{ s: 10, m: 0 }}>
|
835
|
+
<Example.Item title={[
|
836
|
+
"responsive item gap",
|
837
|
+
"gap: 4, direction: row",
|
838
|
+
"[s] 3rd item gapBefore: 10",
|
839
|
+
"[m+] 3rd item gapBefore: 0",
|
840
|
+
]}>
|
841
|
+
<View direction="row" gap={4}>
|
785
842
|
<Placeholder />
|
786
|
-
</View.Item>
|
787
|
-
</View>
|
788
|
-
</Example.Item>
|
789
|
-
</Example>);
|
790
|
-
export const itemGrow = () => (<Example>
|
791
|
-
<Example.Item title="direction: row, 2nd item grow">
|
792
|
-
<View direction="row" gap={3}>
|
793
|
-
<Placeholder w={200}/>
|
794
|
-
<View.Item grow>
|
795
843
|
<Placeholder />
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
844
|
+
<View.Item gapBefore={{ s: 10, m: 0 }}>
|
845
|
+
<Placeholder />
|
846
|
+
</View.Item>
|
847
|
+
</View>
|
848
|
+
</Example.Item>
|
849
|
+
</Example>),
|
850
|
+
};
|
851
|
+
export const itemGrow = {
|
852
|
+
name: "item, grow",
|
853
|
+
render: () => (<Example>
|
854
|
+
<Example.Item title="direction: row, 2nd item grow">
|
855
|
+
<View direction="row" gap={3}>
|
856
|
+
<Placeholder w={200}/>
|
857
|
+
<View.Item grow>
|
858
|
+
<Placeholder />
|
859
|
+
</View.Item>
|
860
|
+
</View>
|
861
|
+
</Example.Item>
|
862
|
+
<Example.Item title="direction: column, height: 200px, 2nd item grow">
|
863
|
+
<View direction="column" gap={3} height="200px">
|
811
864
|
<Placeholder />
|
865
|
+
<View.Item grow>
|
866
|
+
<Placeholder h="100%"/>
|
867
|
+
</View.Item>
|
868
|
+
</View>
|
869
|
+
</Example.Item>
|
870
|
+
<Example.Item title="direction: row, 2nd item grow, applied to View">
|
871
|
+
<View direction="row" gap={3}>
|
872
|
+
<Placeholder w={200}/>
|
873
|
+
<View grow>
|
874
|
+
<Placeholder />
|
875
|
+
</View>
|
876
|
+
</View>
|
877
|
+
</Example.Item>
|
878
|
+
<Example.Item title={[
|
879
|
+
"responsive item grow, direction: row",
|
880
|
+
"[s] 2nd item grow",
|
881
|
+
"[m+] 2nd item doesn't grow",
|
882
|
+
]}>
|
883
|
+
<View direction="row" gap={3}>
|
884
|
+
<Placeholder w={200}/>
|
885
|
+
<View.Item grow={{ s: true, m: false }}>
|
886
|
+
<Placeholder />
|
887
|
+
</View.Item>
|
812
888
|
</View>
|
813
|
-
</
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
<View direction="row" gap={3}>
|
821
|
-
<Placeholder w={200}/>
|
822
|
-
<View.Item grow={{ s: true, m: false }}>
|
889
|
+
</Example.Item>
|
890
|
+
<Example.Item title={[
|
891
|
+
"responsive item grow, direction: column, height: 200px",
|
892
|
+
"[s] 2nd item grow",
|
893
|
+
"[m+] 2nd item doesn't grow",
|
894
|
+
]}>
|
895
|
+
<View direction="column" gap={3} height="200px">
|
823
896
|
<Placeholder />
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
<Placeholder>Item 1</Placeholder>
|
845
|
-
</View.Item>
|
846
|
-
<View.Item columns={6}>
|
847
|
-
<Placeholder>Item 2</Placeholder>
|
848
|
-
</View.Item>
|
849
|
-
</View>
|
850
|
-
</Example.Item>
|
897
|
+
<View.Item grow={{ s: true, m: false }}>
|
898
|
+
<Placeholder h="100%"/>
|
899
|
+
</View.Item>
|
900
|
+
</View>
|
901
|
+
</Example.Item>
|
902
|
+
</Example>),
|
903
|
+
};
|
904
|
+
export const itemColumns = {
|
905
|
+
name: "item, columns",
|
906
|
+
render: () => (<Example>
|
907
|
+
<Example.Item title="columns 6, 6, gap: 0">
|
908
|
+
<View direction="row">
|
909
|
+
<View.Item columns={6}>
|
910
|
+
<Placeholder>Item 1</Placeholder>
|
911
|
+
</View.Item>
|
912
|
+
<View.Item columns={6}>
|
913
|
+
<Placeholder>Item 2</Placeholder>
|
914
|
+
</View.Item>
|
915
|
+
</View>
|
916
|
+
</Example.Item>
|
851
917
|
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
918
|
+
<Example.Item title="columns 6, 6, gap: 4">
|
919
|
+
<View direction="row" gap={4}>
|
920
|
+
<View.Item columns={6}>
|
921
|
+
<Placeholder>Item 1</Placeholder>
|
922
|
+
</View.Item>
|
923
|
+
<View.Item columns={6}>
|
924
|
+
<Placeholder>Item 2</Placeholder>
|
925
|
+
</View.Item>
|
926
|
+
</View>
|
927
|
+
</Example.Item>
|
862
928
|
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
929
|
+
<Example.Item title="columns 3, 9, gap: 4">
|
930
|
+
<View direction="row" gap={4}>
|
931
|
+
<View.Item columns={3}>
|
932
|
+
<Placeholder>Item 1</Placeholder>
|
933
|
+
</View.Item>
|
934
|
+
<View.Item columns={9}>
|
935
|
+
<Placeholder>Item 2</Placeholder>
|
936
|
+
</View.Item>
|
937
|
+
</View>
|
938
|
+
</Example.Item>
|
873
939
|
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
940
|
+
<Example.Item title="columns 6, 6, 9, gap: 4">
|
941
|
+
<View direction="row" gap={4}>
|
942
|
+
<View.Item columns={6}>
|
943
|
+
<Placeholder>Item 1</Placeholder>
|
944
|
+
</View.Item>
|
945
|
+
<View.Item columns={6}>
|
946
|
+
<Placeholder>Item 2</Placeholder>
|
947
|
+
</View.Item>
|
948
|
+
<View.Item columns={9}>
|
949
|
+
<Placeholder>Item 3</Placeholder>
|
950
|
+
</View.Item>
|
951
|
+
</View>
|
952
|
+
</Example.Item>
|
887
953
|
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
954
|
+
<Example.Item title={["responsive columns", "[s] columns 6, 6, 12, gap: 4", "[m+]: 4, 4, 4"]}>
|
955
|
+
<View direction="row" gap={4}>
|
956
|
+
<View.Item columns={{ s: 6, m: 4 }}>
|
957
|
+
<Placeholder>Item 1</Placeholder>
|
958
|
+
</View.Item>
|
959
|
+
<View.Item columns={{ s: 6, m: 4 }}>
|
960
|
+
<Placeholder>Item 2</Placeholder>
|
961
|
+
</View.Item>
|
962
|
+
<View.Item columns={{ s: 12, m: 4 }}>
|
963
|
+
<Placeholder>Item 3</Placeholder>
|
964
|
+
</View.Item>
|
965
|
+
</View>
|
966
|
+
</Example.Item>
|
901
967
|
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
</View.Item>
|
941
|
-
</View>
|
942
|
-
</Example.Item>
|
943
|
-
<Example.Item title={[
|
944
|
-
"responsive order",
|
945
|
-
"[s]: 1 3 2, 2 is full width on second row",
|
946
|
-
"[m+]: 1 2 3, 2 has grow in the center of the first row",
|
947
|
-
]}>
|
948
|
-
<View direction="row" gap={3}>
|
949
|
-
<View.Item columns={{ s: 6, m: "auto" }}>
|
950
|
-
<Placeholder>Item 1</Placeholder>
|
951
|
-
</View.Item>
|
952
|
-
<View.Item grow={{ s: false, m: true }} order={{ s: 1, m: 0 }} columns={{ s: 12, m: "auto" }}>
|
953
|
-
<Placeholder>Item 2</Placeholder>
|
954
|
-
</View.Item>
|
955
|
-
<View.Item columns={{ s: 6, m: "auto" }}>
|
956
|
-
<Placeholder>Item 3</Placeholder>
|
957
|
-
</View.Item>
|
958
|
-
</View>
|
959
|
-
</Example.Item>
|
960
|
-
</Example>);
|
961
|
-
export const testHiddenItem = () => (<Example>
|
962
|
-
<Example.Item title={[
|
963
|
-
"[s] 2nd item: visible, grow, 3rd item: !grow",
|
964
|
-
"[m+] 2nd item: hidden, 2nd item divider: hidden, 3rd item: grow",
|
965
|
-
]}>
|
966
|
-
<View direction="row" divided gap={3}>
|
967
|
-
<Placeholder />
|
968
|
-
<Hidden hide={{ s: false, m: true }}>
|
969
|
-
<View.Item grow key="3">
|
970
|
-
<Placeholder />
|
968
|
+
<Example.Item title="columns 6, 6, 9, gap: 4, 2nd item gapBefore: 20">
|
969
|
+
<View direction="row" gap={4}>
|
970
|
+
<View.Item columns={6}>
|
971
|
+
<Placeholder>Item 1</Placeholder>
|
972
|
+
</View.Item>
|
973
|
+
<View.Item columns={6} gapBefore={20}>
|
974
|
+
<Placeholder>Item 2</Placeholder>
|
975
|
+
</View.Item>
|
976
|
+
<View.Item columns={9}>
|
977
|
+
<Placeholder>Item 3</Placeholder>
|
978
|
+
</View.Item>
|
979
|
+
</View>
|
980
|
+
</Example.Item>
|
981
|
+
</Example>),
|
982
|
+
};
|
983
|
+
export const itemOrder = {
|
984
|
+
name: "item, order",
|
985
|
+
render: () => (<Example>
|
986
|
+
<Example.Item title="order: 1 3 2">
|
987
|
+
<View direction="row" gap={4}>
|
988
|
+
<View.Item columns={4}>
|
989
|
+
<Placeholder>Item 1</Placeholder>
|
990
|
+
</View.Item>
|
991
|
+
<View.Item columns={4} order={1}>
|
992
|
+
<Placeholder>Item 2</Placeholder>
|
993
|
+
</View.Item>
|
994
|
+
<View.Item columns={4}>
|
995
|
+
<Placeholder>Item 3</Placeholder>
|
996
|
+
</View.Item>
|
997
|
+
</View>
|
998
|
+
</Example.Item>
|
999
|
+
<Example.Item title={["responsive order", "[s] 1 2 3", "[m+] 1 3 2"]}>
|
1000
|
+
<View direction="row" gap={4}>
|
1001
|
+
<View.Item columns={4}>
|
1002
|
+
<Placeholder>Item 1</Placeholder>
|
1003
|
+
</View.Item>
|
1004
|
+
<View.Item columns={4} order={{ s: 0, m: 1 }}>
|
1005
|
+
<Placeholder>Item 2</Placeholder>
|
971
1006
|
</View.Item>
|
972
|
-
|
973
|
-
|
1007
|
+
<View.Item columns={4}>
|
1008
|
+
<Placeholder>Item 3</Placeholder>
|
1009
|
+
</View.Item>
|
1010
|
+
</View>
|
1011
|
+
</Example.Item>
|
1012
|
+
<Example.Item title={[
|
1013
|
+
"responsive order",
|
1014
|
+
"[s]: 1 3 2, 2 is full width on second row",
|
1015
|
+
"[m+]: 1 2 3, 2 has grow in the center of the first row",
|
1016
|
+
]}>
|
1017
|
+
<View direction="row" gap={3}>
|
1018
|
+
<View.Item columns={{ s: 6, m: "auto" }}>
|
1019
|
+
<Placeholder>Item 1</Placeholder>
|
1020
|
+
</View.Item>
|
1021
|
+
<View.Item grow={{ s: false, m: true }} order={{ s: 1, m: 0 }} columns={{ s: 12, m: "auto" }}>
|
1022
|
+
<Placeholder>Item 2</Placeholder>
|
1023
|
+
</View.Item>
|
1024
|
+
<View.Item columns={{ s: 6, m: "auto" }}>
|
1025
|
+
<Placeholder>Item 3</Placeholder>
|
1026
|
+
</View.Item>
|
1027
|
+
</View>
|
1028
|
+
</Example.Item>
|
1029
|
+
</Example>),
|
1030
|
+
};
|
1031
|
+
export const hiddenItem = {
|
1032
|
+
name: "composition, Hidden item",
|
1033
|
+
render: () => (<Example>
|
1034
|
+
<Example.Item title={[
|
1035
|
+
"[s] 2nd item: visible, grow, 3rd item: !grow",
|
1036
|
+
"[m+] 2nd item: hidden, 2nd item divider: hidden, 3rd item: grow",
|
1037
|
+
]}>
|
1038
|
+
<View direction="row" divided gap={3}>
|
974
1039
|
<Placeholder />
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
"[m+] 2nd item: hidden, 2nd item: grow doesn't push 3rd item, 3rd item: grow",
|
982
|
-
]}>
|
983
|
-
<View direction="row" gap={3}>
|
984
|
-
<Placeholder />
|
985
|
-
<Hidden hide={{ s: false, m: true }}>
|
986
|
-
<View.Item grow>
|
1040
|
+
<Hidden hide={{ s: false, m: true }}>
|
1041
|
+
<View.Item grow key="3">
|
1042
|
+
<Placeholder />
|
1043
|
+
</View.Item>
|
1044
|
+
</Hidden>
|
1045
|
+
<View.Item grow={{ s: false, m: true }}>
|
987
1046
|
<Placeholder />
|
988
1047
|
</View.Item>
|
989
|
-
</Hidden>
|
990
|
-
<View.Item grow={{ s: false, m: true }}>
|
991
|
-
<Placeholder />
|
992
|
-
</View.Item>
|
993
|
-
</View>
|
994
|
-
</Example.Item>
|
995
|
-
</Example>);
|
996
|
-
export const testNestedGaps = () => (<Example>
|
997
|
-
<Example.Item title={[
|
998
|
-
"direction: column, gap: 10",
|
999
|
-
"Child 1: direction: column, gap: 2",
|
1000
|
-
"Child 2: direction column, gap: 6",
|
1001
|
-
"Child 3: gapBefore: 0",
|
1002
|
-
"Child 3 view: direction: row, gap: 2",
|
1003
|
-
]}>
|
1004
|
-
<View gap={10}>
|
1005
|
-
<View gap={2}>
|
1006
|
-
<Placeholder>Child 1</Placeholder>
|
1007
|
-
<Placeholder>Child 1</Placeholder>
|
1008
1048
|
</View>
|
1049
|
+
</Example.Item>
|
1009
1050
|
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1051
|
+
<Example.Item title={[
|
1052
|
+
"[s] 2nd item: visible, grow, 3rd item: !grow",
|
1053
|
+
"[m+] 2nd item: hidden, 2nd item: grow doesn't push 3rd item, 3rd item: grow",
|
1054
|
+
]}>
|
1055
|
+
<View direction="row" gap={3}>
|
1056
|
+
<Placeholder />
|
1057
|
+
<Hidden hide={{ s: false, m: true }}>
|
1058
|
+
<View.Item grow>
|
1059
|
+
<Placeholder />
|
1060
|
+
</View.Item>
|
1061
|
+
</Hidden>
|
1062
|
+
<View.Item grow={{ s: false, m: true }}>
|
1063
|
+
<Placeholder />
|
1064
|
+
</View.Item>
|
1013
1065
|
</View>
|
1066
|
+
</Example.Item>
|
1067
|
+
</Example>),
|
1068
|
+
};
|
1069
|
+
export const nestedGaps = {
|
1070
|
+
name: "composition, nested gap",
|
1071
|
+
render: () => (<Example>
|
1072
|
+
<Example.Item title={[
|
1073
|
+
"direction: column, gap: 10",
|
1074
|
+
"Child 1: direction: column, gap: 2",
|
1075
|
+
"Child 2: direction column, gap: 6",
|
1076
|
+
"Child 3: gapBefore: 0",
|
1077
|
+
"Child 3 view: direction: row, gap: 2",
|
1078
|
+
]}>
|
1079
|
+
<View gap={10}>
|
1080
|
+
<View gap={2}>
|
1081
|
+
<Placeholder>Child 1</Placeholder>
|
1082
|
+
<Placeholder>Child 1</Placeholder>
|
1083
|
+
</View>
|
1014
1084
|
|
1015
|
-
|
1016
|
-
|
1017
|
-
<Placeholder>Child
|
1018
|
-
<Placeholder>Child 3, very long text</Placeholder>
|
1019
|
-
<Placeholder>Child 3, very long text</Placeholder>
|
1020
|
-
<Placeholder>Child 3, very long text</Placeholder>
|
1021
|
-
<Placeholder>Child 3, very long text</Placeholder>
|
1022
|
-
<Placeholder>Child 3, very long text</Placeholder>
|
1085
|
+
<View gap={6}>
|
1086
|
+
<Placeholder>Child 2</Placeholder>
|
1087
|
+
<Placeholder>Child 2</Placeholder>
|
1023
1088
|
</View>
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1089
|
+
|
1090
|
+
<View.Item gapBefore={0}>
|
1091
|
+
<View direction="row" gap={2}>
|
1092
|
+
<Placeholder>Child 3, very long text</Placeholder>
|
1093
|
+
<Placeholder>Child 3, very long text</Placeholder>
|
1094
|
+
<Placeholder>Child 3, very long text</Placeholder>
|
1095
|
+
<Placeholder>Child 3, very long text</Placeholder>
|
1096
|
+
<Placeholder>Child 3, very long text</Placeholder>
|
1097
|
+
<Placeholder>Child 3, very long text</Placeholder>
|
1098
|
+
</View>
|
1099
|
+
</View.Item>
|
1100
|
+
</View>
|
1101
|
+
</Example.Item>
|
1102
|
+
</Example>),
|
1103
|
+
};
|
1104
|
+
export const testComposition = {
|
1105
|
+
name: "composition, edge cases",
|
1106
|
+
render: () => (<Example>
|
1107
|
+
<Example.Item title={[
|
1108
|
+
"View.Item, MenuItem, Aspect ratio",
|
1109
|
+
"ratio should increase height on viewport change",
|
1110
|
+
]}>
|
1111
|
+
<View direction="row" gap={3}>
|
1112
|
+
<View.Item>
|
1113
|
+
<Placeholder />
|
1114
|
+
</View.Item>
|
1115
|
+
<MenuItem selected roundedCorners>
|
1116
|
+
Menu
|
1117
|
+
</MenuItem>
|
1118
|
+
<View.Item grow>
|
1119
|
+
<View aspectRatio={16 / 9}>
|
1120
|
+
<Placeholder h="100%"/>
|
1121
|
+
</View>
|
1122
|
+
</View.Item>
|
1123
|
+
</View>
|
1124
|
+
</Example.Item>
|
1125
|
+
<Example.Item title="Scrollable tabs inside View.Item with grow">
|
1126
|
+
<View gap={3}>
|
1035
1127
|
<Placeholder />
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1128
|
+
<View direction="row" align="center" gap={3}>
|
1129
|
+
<Placeholder />
|
1130
|
+
<View.Item grow>
|
1131
|
+
<View padding={0} align="center">
|
1132
|
+
<Tabs variant="pills">
|
1133
|
+
<Tabs.List>
|
1134
|
+
<Tabs.Item value="1">Very long item</Tabs.Item>
|
1135
|
+
<Tabs.Item value="2">Very long item</Tabs.Item>
|
1136
|
+
<Tabs.Item value="3">Very long item</Tabs.Item>
|
1137
|
+
<Tabs.Item value="4">Very long item</Tabs.Item>
|
1138
|
+
<Tabs.Item value="5">Very long item</Tabs.Item>
|
1139
|
+
<Tabs.Item value="6">Very long item</Tabs.Item>
|
1140
|
+
</Tabs.List>
|
1141
|
+
{[1, 2, 3, 5, 6].map((i) => (<Tabs.Panel key={i} value={i.toString()}/>))}
|
1142
|
+
</Tabs>
|
1143
|
+
</View>
|
1144
|
+
</View.Item>
|
1145
|
+
<Placeholder />
|
1043
1146
|
</View>
|
1044
|
-
</View
|
1045
|
-
</
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
<Placeholder />
|
1050
|
-
<View direction="row" align="center" gap={3}>
|
1051
|
-
<Placeholder />
|
1147
|
+
</View>
|
1148
|
+
</Example.Item>
|
1149
|
+
<Example.Item title="2nd item has grow, Avatar stays circle">
|
1150
|
+
<View direction="row" gap={3}>
|
1151
|
+
<Avatar initials="DB"/>
|
1052
1152
|
<View.Item grow>
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1153
|
+
Veggies sunt bona vobis, proinde vos postulo esse magis grape pea sprouts horseradish
|
1154
|
+
courgette maize spinach prairie turnip jícama coriander quandong gourd broccoli seakale
|
1155
|
+
gumbo. Parsley corn lentil zucchini radicchio maize burdock avocado sea lettuce.
|
1156
|
+
Garbanzo tigernut earthnut pea fennel.
|
1157
|
+
</View.Item>
|
1158
|
+
</View>
|
1159
|
+
</Example.Item>
|
1160
|
+
<Example.Item title={[
|
1161
|
+
"item gapBefore from parent doesn't affect the child view",
|
1162
|
+
"columns should take full width",
|
1163
|
+
]}>
|
1164
|
+
<View>
|
1165
|
+
<View.Item gapBefore={20}>
|
1166
|
+
<View direction="row" gap={4}>
|
1167
|
+
<View.Item columns={6}>
|
1168
|
+
<Placeholder />
|
1169
|
+
</View.Item>
|
1170
|
+
<View.Item columns={6}>
|
1171
|
+
<Placeholder />
|
1172
|
+
</View.Item>
|
1064
1173
|
</View>
|
1065
1174
|
</View.Item>
|
1066
|
-
<Placeholder />
|
1067
1175
|
</View>
|
1068
|
-
</
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
Veggies sunt bona vobis, proinde vos postulo esse magis grape pea sprouts horseradish
|
1075
|
-
courgette maize spinach prairie turnip jícama coriander quandong gourd broccoli seakale
|
1076
|
-
gumbo. Parsley corn lentil zucchini radicchio maize burdock avocado sea lettuce. Garbanzo
|
1077
|
-
tigernut earthnut pea fennel.
|
1078
|
-
</View.Item>
|
1079
|
-
</View>
|
1080
|
-
</Example.Item>
|
1081
|
-
<Example.Item title={[
|
1082
|
-
"item gapBefore from parent doesn't affect the child view",
|
1083
|
-
"columns should take full width",
|
1084
|
-
]}>
|
1085
|
-
<View>
|
1086
|
-
<View.Item gapBefore={20}>
|
1087
|
-
<View direction="row" gap={4}>
|
1088
|
-
<View.Item columns={6}>
|
1089
|
-
<Placeholder />
|
1090
|
-
</View.Item>
|
1091
|
-
<View.Item columns={6}>
|
1092
|
-
<Placeholder />
|
1093
|
-
</View.Item>
|
1176
|
+
</Example.Item>
|
1177
|
+
<Example.Item title="View becomes flexbox if there is a child with grow">
|
1178
|
+
<View height="300px" borderColor="neutral-faded">
|
1179
|
+
<View height="50px"/>
|
1180
|
+
<View grow backgroundColor="neutral-faded" padding={4}>
|
1181
|
+
Grow
|
1094
1182
|
</View>
|
1095
|
-
</View
|
1096
|
-
</
|
1097
|
-
</Example
|
1098
|
-
|
1099
|
-
<View height="300px" borderColor="neutral-faded">
|
1100
|
-
<View height="50px"/>
|
1101
|
-
<View grow backgroundColor="neutral-faded" padding={4}>
|
1102
|
-
Grow
|
1103
|
-
</View>
|
1104
|
-
</View>
|
1105
|
-
</Example.Item>
|
1106
|
-
</Example>);
|
1183
|
+
</View>
|
1184
|
+
</Example.Item>
|
1185
|
+
</Example>),
|
1186
|
+
};
|