@jobber/components-native 0.101.5 → 0.101.6
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/dist/docs/ActionItem/ActionItem.md +65 -0
- package/dist/docs/ActionItemGroup/ActionItemGroup.md +33 -0
- package/dist/docs/ActionLabel/ActionLabel.md +43 -0
- package/dist/docs/ActivityIndicator/ActivityIndicator.md +116 -0
- package/dist/docs/Animation/Animation.md +71 -0
- package/dist/docs/AtlantisThemeContext/AtlantisThemeContext.md +256 -0
- package/dist/docs/AutoLink/AutoLink.md +47 -0
- package/dist/docs/Banner/Banner.md +390 -0
- package/dist/docs/Borders/Borders.md +45 -0
- package/dist/docs/BottomSheet/BottomSheet.md +67 -0
- package/dist/docs/Button/Button.md +918 -0
- package/dist/docs/ButtonGroup/ButtonGroup.md +89 -0
- package/dist/docs/Card/Card.md +270 -0
- package/dist/docs/Checkbox/Checkbox.md +69 -0
- package/dist/docs/Chip/Chip.md +371 -0
- package/dist/docs/Colors/Colors.md +217 -0
- package/dist/docs/Content/Content.md +67 -0
- package/dist/docs/ContentOverlay/ContentOverlay.md +64 -0
- package/dist/docs/Disclosure/Disclosure.md +161 -0
- package/dist/docs/Divider/Divider.md +84 -0
- package/dist/docs/Elevations/Elevations.md +76 -0
- package/dist/docs/EmptyState/EmptyState.md +72 -0
- package/dist/docs/Flex/Flex.md +37 -0
- package/dist/docs/Form/Form.md +126 -0
- package/dist/docs/FormField/FormField.md +57 -0
- package/dist/docs/FormatFile/FormatFile.md +56 -0
- package/dist/docs/Glimmer/Glimmer.md +143 -0
- package/dist/docs/Heading/Heading.md +132 -0
- package/dist/docs/Icon/Icon.md +585 -0
- package/dist/docs/IconButton/IconButton.md +25 -0
- package/dist/docs/InputCurrency/InputCurrency.md +61 -0
- package/dist/docs/InputDate/InputDate.md +133 -0
- package/dist/docs/InputEmail/InputEmail.md +69 -0
- package/dist/docs/InputFieldWrapper/InputFieldWrapper.md +70 -0
- package/dist/docs/InputNumber/InputNumber.md +72 -0
- package/dist/docs/InputPassword/InputPassword.md +61 -0
- package/dist/docs/InputPressable/InputPressable.md +64 -0
- package/dist/docs/InputSearch/InputSearch.md +49 -0
- package/dist/docs/InputText/InputText.md +324 -0
- package/dist/docs/InputTime/InputTime.md +54 -0
- package/dist/docs/Opacity/Opacity.md +12 -0
- package/dist/docs/ProgressBar/ProgressBar.md +39 -0
- package/dist/docs/Radii/Radii.md +23 -0
- package/dist/docs/ResponsiveBreakpoint/ResponsiveBreakpoint.md +74 -0
- package/dist/docs/Select/Select.md +213 -0
- package/dist/docs/Spacing/Spacing.md +103 -0
- package/dist/docs/StatusLabel/StatusLabel.md +119 -0
- package/dist/docs/Switch/Switch.md +54 -0
- package/dist/docs/Text/Text.md +368 -0
- package/dist/docs/TextList/TextList.md +29 -0
- package/dist/docs/ThumbnailList/ThumbnailList.md +16 -0
- package/dist/docs/Toast/Toast.md +71 -0
- package/dist/docs/Typography/Typography.md +170 -0
- package/dist/docs/choosing-components/choosing-components.md +76 -0
- package/dist/docs/customizing-components/customizing-components.md +167 -0
- package/dist/docs/disabled-states/disabled-states.md +86 -0
- package/dist/docs/empty-states/empty-states.md +126 -0
- package/dist/docs/errors/errors.md +114 -0
- package/dist/docs/index.md +64 -0
- package/dist/docs/interaction/interaction.md +109 -0
- package/dist/docs/page-layouts/page-layouts.md +323 -0
- package/dist/docs/scaffolding/scaffolding.md +109 -0
- package/dist/docs/settings/settings.md +58 -0
- package/dist/docs/usage-guidelines/usage-guidelines.md +177 -0
- package/dist/package.json +8 -4
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -4
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Interaction
|
|
2
|
+
|
|
3
|
+
| **Platform** | **Status** |
|
|
4
|
+
| :----------- | :--------- |
|
|
5
|
+
| Web Mobile | Ready |
|
|
6
|
+
|
|
7
|
+
## Goal
|
|
8
|
+
|
|
9
|
+
Provide feedback (or feedforward) to the user in a consistent way to help them
|
|
10
|
+
predict what will happen when they engage with Jobber.
|
|
11
|
+
|
|
12
|
+
## Use when...
|
|
13
|
+
|
|
14
|
+
An interactive element is... being interacted with.
|
|
15
|
+
|
|
16
|
+
## Solution
|
|
17
|
+
|
|
18
|
+
### Web
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
<Card header="Interactive element example" url="#">
|
|
22
|
+
<Content>
|
|
23
|
+
<Text>This card has examples of hover and focus states for the web</Text>
|
|
24
|
+
<InputText placeholder="Inputs change too" />
|
|
25
|
+
</Content>
|
|
26
|
+
</Card>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
#### Hover
|
|
30
|
+
|
|
31
|
+
* background-color increases contrast with the surface
|
|
32
|
+
* cursor changes to a pointer
|
|
33
|
+
|
|
34
|
+
#### Focused with keyboard (:focus-visible)
|
|
35
|
+
|
|
36
|
+
* background-color increases contrast with the surface
|
|
37
|
+
* a custom focus ring is applied
|
|
38
|
+
|
|
39
|
+
#### Timing
|
|
40
|
+
|
|
41
|
+
Most state transitions use `var(--timing-base) ease-out` for a pleasant
|
|
42
|
+
transition.
|
|
43
|
+
|
|
44
|
+
#### CSS implementation
|
|
45
|
+
|
|
46
|
+
Atlantis components come with these states handled, but if you're extending or
|
|
47
|
+
creating custom elements, this is the general pattern used to achieve an "Atlantis"
|
|
48
|
+
interactive state.
|
|
49
|
+
|
|
50
|
+
```css
|
|
51
|
+
.myElement {
|
|
52
|
+
background-color: var(--color-surface);
|
|
53
|
+
/* apply consistent transitions to background and box-shadow */
|
|
54
|
+
transition: all var(--timing-base) ease-out;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
/* hide the default focus ring, but still support "high contrast" modes */
|
|
57
|
+
outline: transparent;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.myElement:hover,
|
|
61
|
+
/* use :focus-visible instead of :focus to reduce visual noise for mouse users */
|
|
62
|
+
.myElement:focus-visible {
|
|
63
|
+
background-color: var(--color-surface--hover);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.myElement:focus-visible {
|
|
67
|
+
box-shadow: var(--shadow-focus);
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Mobile
|
|
72
|
+
|
|
73
|
+
#### Pressed
|
|
74
|
+
|
|
75
|
+
* Most elements will reduce in opacity using the `opacity-pressed` token
|
|
76
|
+
|
|
77
|
+
#### Focused inputs
|
|
78
|
+
|
|
79
|
+
* While there is no system-wide "focus ring" in mobile, input borders change color when focused
|
|
80
|
+
|
|
81
|
+
#### React Native implementation
|
|
82
|
+
|
|
83
|
+
```.ts
|
|
84
|
+
// as a classname in styles.ts files
|
|
85
|
+
|
|
86
|
+
pressed {
|
|
87
|
+
opacity: tokens["opacity-pressed"]
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
```.ts
|
|
92
|
+
// as a property on react-native core components
|
|
93
|
+
|
|
94
|
+
<TouchableOpacity
|
|
95
|
+
activeOpacity={tokens["opacity-pressed"]}
|
|
96
|
+
onPress={yourActionHere}
|
|
97
|
+
>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Related
|
|
101
|
+
|
|
102
|
+
* [Disabled states](../disabled-states/disabled-states.md)
|
|
103
|
+
* [Color](../design/color)
|
|
104
|
+
* [Animation](../Animation/Animation.md)
|
|
105
|
+
|
|
106
|
+
## Principles
|
|
107
|
+
|
|
108
|
+
* [Visibility of system status](https://www.nngroup.com/articles/visibility-system-status/)
|
|
109
|
+
* [Consistency and standards](https://www.nngroup.com/articles/consistency-and-standards/)
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
# Page layouts
|
|
2
|
+
|
|
3
|
+
These layout components are designed to help you easily build smaller-scale layouts without needing to reach for CSS.  
|
|
4
|
+
More complex full-page scaffolding can be found on the [Scaffolding](../scaffolding/scaffolding.md) page.  
|
|
5
|
+
|
|
6
|
+
```tsx
|
|
7
|
+
<Stack>
|
|
8
|
+
<Heading level={1}>Stack</Heading>
|
|
9
|
+
<Text>The Stack component is used to create a vertical stack of elements. It is a flex container that aligns items in a column direction.</Text>
|
|
10
|
+
</Stack>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
<Stack>
|
|
15
|
+
<Heading level={2}>Stack Form Layouts</Heading>
|
|
16
|
+
<Text>Every item stacks with equal spacing and a responsive vertical rhythm.</Text>
|
|
17
|
+
<Stack>
|
|
18
|
+
<FormFieldLabel external>Name</FormFieldLabel>
|
|
19
|
+
<InputText label="Name" />
|
|
20
|
+
<FormFieldLabel external>Email</FormFieldLabel>
|
|
21
|
+
<InputText label="Email" />
|
|
22
|
+
</Stack>
|
|
23
|
+
</Stack>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
<Stack>
|
|
28
|
+
<Heading level={2}>Stack Card Layouts</Heading>
|
|
29
|
+
<Text>Stacks are a great way to layout content in a card format. They are responsive and easy to read.</Text>
|
|
30
|
+
<Cluster>
|
|
31
|
+
<Card elevation="base">
|
|
32
|
+
<Box padding="base">
|
|
33
|
+
<Stack>
|
|
34
|
+
<Heading level={3}>Card Layout</Heading>
|
|
35
|
+
<Text>A card with a header, body text, and footer</Text>
|
|
36
|
+
<Button label="Button" />
|
|
37
|
+
<Text>And they're all stacked vertically</Text>
|
|
38
|
+
<Text>with equal spacing</Text>
|
|
39
|
+
</Stack>
|
|
40
|
+
</Box>
|
|
41
|
+
</Card>
|
|
42
|
+
</Cluster>
|
|
43
|
+
</Stack>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
<Stack>
|
|
48
|
+
<Heading level={1}>Cluster</Heading>
|
|
49
|
+
<Text>The Cluster component is used to create a horizontal stack of elements. It is a flex container that aligns items in a row direction.</Text>
|
|
50
|
+
<Cluster>
|
|
51
|
+
<Chip label="Cluster Chip" />
|
|
52
|
+
<Heading level={5}>These are all in a cluster</Heading>
|
|
53
|
+
<Button label="Clustered items have variable widths" />
|
|
54
|
+
<Text>They wrap when they run out of space</Text>
|
|
55
|
+
</Cluster>
|
|
56
|
+
</Stack>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
<Stack>
|
|
61
|
+
<Heading level={2}>Spaced Out Cluster</Heading>
|
|
62
|
+
<Text>The Cluster component has a default space of 12px between items. You can customize this space by passing the gap prop.</Text>
|
|
63
|
+
|
|
64
|
+
<Cluster gap="larger">
|
|
65
|
+
<Chip label="There" />
|
|
66
|
+
<Chip label="is" />
|
|
67
|
+
<Chip label="a" />
|
|
68
|
+
<Chip label="default" />
|
|
69
|
+
<Chip label="space" />
|
|
70
|
+
<Chip label="between" />
|
|
71
|
+
<Chip label="items" />
|
|
72
|
+
<Chip label="that" />
|
|
73
|
+
<Chip label="you" />
|
|
74
|
+
<Chip label="can" />
|
|
75
|
+
<Chip label="customize" />
|
|
76
|
+
</Cluster>
|
|
77
|
+
</Stack>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
<Stack>
|
|
82
|
+
<Typography size="largest" align="end" fontWeight="bold">Justified Cluster</Typography>
|
|
83
|
+
<Text align="end">The Cluster component has a default horizontal alignment of start. You can customize this alignment by passing the justify prop.</Text>
|
|
84
|
+
<Cluster justify="end">
|
|
85
|
+
<Chip label="You" />
|
|
86
|
+
<Chip label="can" />
|
|
87
|
+
<Chip label="justify" />
|
|
88
|
+
<Chip label="the items" />
|
|
89
|
+
<Chip label="in the cluster" />
|
|
90
|
+
<Chip label="horizontally" />
|
|
91
|
+
</Cluster>
|
|
92
|
+
</Stack>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
<Stack>
|
|
97
|
+
<Heading level={2}>Aligned Cluster</Heading>
|
|
98
|
+
<Text>The Cluster component has a default vertical alignment of top/start. You can customize this alignment by passing the align prop.</Text>
|
|
99
|
+
<Cluster align="center">
|
|
100
|
+
<Chip label="You can also align" />
|
|
101
|
+
<Text>
|
|
102
|
+
items vertically
|
|
103
|
+
</Text>
|
|
104
|
+
<div style={{ height: "100px", backgroundColor: "var(--color-surface--background)", width:200 }}>
|
|
105
|
+
|
|
106
|
+
</div>
|
|
107
|
+
</Cluster>
|
|
108
|
+
</Stack>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
<Stack>
|
|
113
|
+
<Heading level={1}>Tiles</Heading>
|
|
114
|
+
<Text>The Tiles component is used to create a horizontal grid of fixed-width items.
|
|
115
|
+
It is a flexible container that aligns items horizontally and will start moving items to the next row when there is no more room.</Text>
|
|
116
|
+
<Tiles minSize="15ch" gap="12px">
|
|
117
|
+
<Text>Here is a longer bit of repeated copy that will surely cause the tile to wrap.</Text>
|
|
118
|
+
<Text>Here is a longer bit of repeated copy that will surely cause the tile to wrap.</Text>
|
|
119
|
+
<Text>Here is a longer bit of repeated copy that will surely cause the tile to wrap.</Text>
|
|
120
|
+
<Text>Here is a longer bit of repeated copy that will surely cause the tile to wrap.</Text>
|
|
121
|
+
</Tiles>
|
|
122
|
+
</Stack>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
```tsx
|
|
126
|
+
<Stack>
|
|
127
|
+
<Heading level={1}>Cover</Heading>
|
|
128
|
+
<Text>The Cover component is used to create an arbitrary height layout with an option to center content and have content above/below the centered content.</Text>
|
|
129
|
+
<Cover minHeight="30vh">
|
|
130
|
+
<Cover.Center>
|
|
131
|
+
<Box padding="base" background="surface--background">
|
|
132
|
+
<Stack>
|
|
133
|
+
<Heading level={2}>Centered Content</Heading>
|
|
134
|
+
<Box colorSurface="color-text" colorInverse="color-surface" invert>
|
|
135
|
+
<Text>This is a square</Text>
|
|
136
|
+
</Box>
|
|
137
|
+
</Stack>
|
|
138
|
+
</Box>
|
|
139
|
+
</Cover.Center>
|
|
140
|
+
</Cover>
|
|
141
|
+
</Stack>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
```tsx
|
|
145
|
+
<Cover minHeight="40vh">
|
|
146
|
+
<Stack>
|
|
147
|
+
<Heading level={2}>Cover with a heading</Heading>
|
|
148
|
+
<Text>You can place content above and below the centered content and align it any way you want, and the centered content will always be centered in the provided parent space.</Text>
|
|
149
|
+
</Stack>
|
|
150
|
+
<Cover.Center>
|
|
151
|
+
<Box background="color-surface--background">
|
|
152
|
+
<Text>This is the centered content</Text>
|
|
153
|
+
</Box>
|
|
154
|
+
</Cover.Center>
|
|
155
|
+
<Box background="color-surface--background">
|
|
156
|
+
<Stack>
|
|
157
|
+
<Heading level={2}>Cover Footer Content</Heading>
|
|
158
|
+
<Text>This is the footer content</Text>
|
|
159
|
+
</Stack>
|
|
160
|
+
</Box>
|
|
161
|
+
</Cover>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
```tsx
|
|
165
|
+
<ContentBlock maxWidth="100%">
|
|
166
|
+
<Stack>
|
|
167
|
+
<Heading level={1}>Content Block</Heading>
|
|
168
|
+
<Text>The ContentBlock component is used to horizontally justify and limit content.</Text>
|
|
169
|
+
</Stack>
|
|
170
|
+
</ContentBlock>
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
```tsx
|
|
174
|
+
<ContentBlock maxWidth="300px" justify="center" andText>
|
|
175
|
+
<Stack>
|
|
176
|
+
<Heading level={1}>Text Center</Heading>
|
|
177
|
+
<Text>The `andText` prop will center the text as well as the content.</Text>
|
|
178
|
+
</Stack>
|
|
179
|
+
</ContentBlock>
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
```tsx
|
|
183
|
+
<ContentBlock maxWidth="200px">
|
|
184
|
+
<Stack>
|
|
185
|
+
<Heading level={2}>Max Width</Heading>
|
|
186
|
+
<Text>The Center component can also take a `maxWidth` prop to limit the width of the content.</Text>
|
|
187
|
+
</Stack>
|
|
188
|
+
</ContentBlock>
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
```tsx
|
|
192
|
+
<ContentBlock gutters="largest">
|
|
193
|
+
<Stack>
|
|
194
|
+
<Heading level={2}>Gutters</Heading>
|
|
195
|
+
<Text>The Center component can also take a `gutters` prop to add minimum space between the content and the edges of the parent so the content never touches the edge of the parent/screen. This space only applies to the element when required, not by default.</Text>
|
|
196
|
+
</Stack>
|
|
197
|
+
</ContentBlock>
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
```tsx
|
|
201
|
+
<Stack>
|
|
202
|
+
<Heading level={1}>Frame</Heading>
|
|
203
|
+
<Text>The Frame component is used to create an aspect ratio with a layout. It's especially good at handling images and videos and cropping them to fit the aspect ratio (default 16x9).</Text>
|
|
204
|
+
<Frame>
|
|
205
|
+
<img src="/img_collage.jpg" alt="Placeholder" />
|
|
206
|
+
</Frame>
|
|
207
|
+
|
|
208
|
+
</Stack>
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
```tsx
|
|
212
|
+
<Stack>
|
|
213
|
+
<Heading level={2}>1x1</Heading>
|
|
214
|
+
<Frame aspectX={1} aspectY={1}>
|
|
215
|
+
<img src="/img_collage.jpg" alt="Placeholder" />
|
|
216
|
+
</Frame>
|
|
217
|
+
</Stack>
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
```tsx
|
|
221
|
+
<Stack>
|
|
222
|
+
<Heading level={2}>4x3</Heading>
|
|
223
|
+
<Frame aspectX={4} aspectY={3}>
|
|
224
|
+
<img src="/img_collage.jpg" alt="Placeholder" />
|
|
225
|
+
</Frame>
|
|
226
|
+
</Stack>
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
```tsx
|
|
230
|
+
<Frame>
|
|
231
|
+
<Cover>
|
|
232
|
+
<Heading level={2}>It Works for Content As Well</Heading>
|
|
233
|
+
<Text>Everything is centered and cropped to fit the aspect ratio.</Text>
|
|
234
|
+
</Cover>
|
|
235
|
+
</Frame>
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
```tsx
|
|
239
|
+
<Stack>
|
|
240
|
+
<Heading level={1}>Responsive Switcher</Heading>
|
|
241
|
+
<Text>The Responsive Switcher component is used to create a responsive layout that will automatically swap from horizontal to vertical when the content exceeds the threshold.</Text>
|
|
242
|
+
<ResponsiveSwitcher threshold="60ch" gap="12px" limit={2}>
|
|
243
|
+
<Box padding="base" background="surface--background">
|
|
244
|
+
<Heading level={3}>Content on the left/top</Heading>
|
|
245
|
+
</Box>
|
|
246
|
+
<Box padding="base" background="surface--background">
|
|
247
|
+
<Heading level={3}>Content on the right/bottom</Heading>
|
|
248
|
+
</Box>
|
|
249
|
+
</ResponsiveSwitcher>
|
|
250
|
+
</Stack>
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
```tsx
|
|
254
|
+
<ResponsiveSwitcher threshold="50ch" limit={3}>
|
|
255
|
+
<Card elevation="base">
|
|
256
|
+
<Box padding="base">
|
|
257
|
+
<Heading level={3}>Some Card Content</Heading>
|
|
258
|
+
</Box>
|
|
259
|
+
</Card>
|
|
260
|
+
<Card elevation="base">
|
|
261
|
+
<Box padding="base">
|
|
262
|
+
<Heading level={3}>Some Card Content</Heading>
|
|
263
|
+
</Box>
|
|
264
|
+
</Card>
|
|
265
|
+
<Card elevation="base">
|
|
266
|
+
<Box padding="base">
|
|
267
|
+
<Heading level={3}>Some Card Content</Heading>
|
|
268
|
+
</Box>
|
|
269
|
+
</Card>
|
|
270
|
+
</ResponsiveSwitcher>
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
```tsx
|
|
274
|
+
<Stack>
|
|
275
|
+
<Heading level={1}>Sidekick</Heading>
|
|
276
|
+
<Text>The Sidekick component is used to create a horizontal layout where one half of the content is fixed width, and the other half is fluid. Where there is no longer the specified sideWidth space remaining, the content will wrap to the next line.</Text>
|
|
277
|
+
<SideKick sideWidth="120px" contentMinWidth="60%">
|
|
278
|
+
<InputText placeholder="Sidekick Input" />
|
|
279
|
+
<Button label="Sidekick Button" />
|
|
280
|
+
</SideKick>
|
|
281
|
+
</Stack>
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
```tsx
|
|
285
|
+
<SideKick sideWidth="60%" contentMinWidth="200px">
|
|
286
|
+
<Cover>
|
|
287
|
+
<Cover.Center>
|
|
288
|
+
<Stack>
|
|
289
|
+
<Heading level={2}>Sidekick Content</Heading>
|
|
290
|
+
<Text>The Sidekick component is used to create a horizontal layout where one half of the content is fixed width, and the other half is fluid. Where there is no longer the specified sideWidth space remaining, the content will wrap to the next line.</Text>
|
|
291
|
+
</Stack>
|
|
292
|
+
</Cover.Center>
|
|
293
|
+
</Cover>
|
|
294
|
+
<Frame aspectX={9} aspectY={16}>
|
|
295
|
+
<img src="/img_collage.jpg" alt="Placeholder" />
|
|
296
|
+
</Frame>
|
|
297
|
+
</SideKick>
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
Container
|
|
301
|
+
Containers are for isolating style overrides to a specific layout. Set a container name, and apply associated styles where needed.
|
|
302
|
+
Containers are just container queries, and are fairly advanced. Only use them when absolutely necessary.
|
|
303
|
+
We will soon provide a set of predfined Containers and styles for common layout pattern adjustments.
|
|
304
|
+
You can also create your own containers and portable style overrides with these tools.
|
|
305
|
+
|
|
306
|
+
Container Example
|
|
307
|
+
We've overridden the default styles without having to modify any existing code or styles.
|
|
308
|
+
|
|
309
|
+
Container Example
|
|
310
|
+
These cards are functionally identical except they have different container queries based on their content widths.
|
|
311
|
+
|
|
312
|
+
Container Example
|
|
313
|
+
They're also perfectly portable. If you just need the layout, take everything under the Container.Apply. If you want the wrapper but not the container styles, grab the Container.Apply as well. Or, just re-use the container elsewhere to wrap other content.
|
|
314
|
+
|
|
315
|
+
Container Example
|
|
316
|
+
This last example is exactly the same as the others, except it's not in the container.
|
|
317
|
+
|
|
318
|
+
```tsx
|
|
319
|
+
<Stack>
|
|
320
|
+
<Heading level={1}>Looking For More?</Heading>
|
|
321
|
+
<Text>Check out the [Scaffolding](../scaffolding/scaffolding.md) page to see how to layout full pages with these components</Text>
|
|
322
|
+
</Stack>
|
|
323
|
+
```
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Scaffolding
|
|
2
|
+
|
|
3
|
+
Scaffolding are full-page layouts to ensure consistency across the app and full
|
|
4
|
+
responsive behavior for free.
|
|
5
|
+
|
|
6
|
+
Legacy Page
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
<Page
|
|
10
|
+
title="Page"
|
|
11
|
+
subtitle="Subtitle goes here"
|
|
12
|
+
primaryAction={{ label: "Action 1" }}
|
|
13
|
+
secondaryAction={{ label: "Action 2" }}
|
|
14
|
+
moreActionsMenu={[
|
|
15
|
+
{
|
|
16
|
+
actions: [
|
|
17
|
+
{
|
|
18
|
+
label: "Action 1",
|
|
19
|
+
onClick: () => {
|
|
20
|
+
console.log("Action 1");
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: "Action 2",
|
|
25
|
+
onClick: () => {
|
|
26
|
+
console.log("Action 2");
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
]}
|
|
32
|
+
>
|
|
33
|
+
<Text>Children Go Here</Text>
|
|
34
|
+
</Page>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Composed Page With New Layout Components
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
<ContentBlock align="left" maxWidth="1285px">
|
|
41
|
+
<Box padding="base">
|
|
42
|
+
<Stack gap="larger">
|
|
43
|
+
<SideKick contentMinWidth="40%" sideWidth="20ch" collapseBelow="1285px">
|
|
44
|
+
<Stack>
|
|
45
|
+
<Heading level={1}>Page</Heading>
|
|
46
|
+
<Text size="large" variation="subdued">
|
|
47
|
+
<Emphasis variation="bold">Subtitle goes here</Emphasis>
|
|
48
|
+
</Text>
|
|
49
|
+
</Stack>
|
|
50
|
+
<Cluster justify="end" gap="small" collapseBelow="1285px">
|
|
51
|
+
<Button label="Action 1" />
|
|
52
|
+
<Button label="Action 2" type="secondary" />
|
|
53
|
+
<Menu
|
|
54
|
+
items={[
|
|
55
|
+
{
|
|
56
|
+
actions: [{ label: "Action 1" }, { label: "Action 2" }],
|
|
57
|
+
label: "Action 3",
|
|
58
|
+
},
|
|
59
|
+
]}
|
|
60
|
+
/>
|
|
61
|
+
</Cluster>
|
|
62
|
+
</SideKick>
|
|
63
|
+
<Text>Children Go Here</Text>
|
|
64
|
+
</Stack>
|
|
65
|
+
</Box>
|
|
66
|
+
</ContentBlock>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Composed Page With New Layout Components + Container Query
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
<Container name="container-items">
|
|
73
|
+
<Box padding="base">
|
|
74
|
+
<ContentBlock align="left" maxWidth="1285px">
|
|
75
|
+
<Stack gap="larger">
|
|
76
|
+
<SideKick
|
|
77
|
+
collapseBelow="1285px"
|
|
78
|
+
contentMinWidth="30%"
|
|
79
|
+
sideWidth="20ch"
|
|
80
|
+
>
|
|
81
|
+
<Stack>
|
|
82
|
+
<Heading level={1}>Page</Heading>
|
|
83
|
+
<Text size="large" variation="subdued">
|
|
84
|
+
<Emphasis variation="bold">Subtitle goes here</Emphasis>
|
|
85
|
+
</Text>
|
|
86
|
+
</Stack>
|
|
87
|
+
<Box>
|
|
88
|
+
<Container.Apply className={styles.actions}>
|
|
89
|
+
<Cluster justify="end" gap="small">
|
|
90
|
+
<Button label="Action 1" />
|
|
91
|
+
<Button label="Action 2" type="secondary" />
|
|
92
|
+
<Menu
|
|
93
|
+
items={[
|
|
94
|
+
{
|
|
95
|
+
actions: [{ label: "Action 1" }, { label: "Action 2" }],
|
|
96
|
+
label: "Action 3",
|
|
97
|
+
},
|
|
98
|
+
]}
|
|
99
|
+
/>
|
|
100
|
+
</Cluster>
|
|
101
|
+
</Container.Apply>
|
|
102
|
+
</Box>
|
|
103
|
+
</SideKick>
|
|
104
|
+
<Text>Children Go Here</Text>
|
|
105
|
+
</Stack>
|
|
106
|
+
</ContentBlock>
|
|
107
|
+
</Box>
|
|
108
|
+
</Container>
|
|
109
|
+
```
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Settings
|
|
2
|
+
|
|
3
|
+
| **Platform** | **Status** |
|
|
4
|
+
| :----------- | :--------- |
|
|
5
|
+
| Web | Ready |
|
|
6
|
+
|
|
7
|
+
## Goal
|
|
8
|
+
|
|
9
|
+
Allow the user to consistently manage settings for their account or for specific
|
|
10
|
+
features within the application.
|
|
11
|
+
|
|
12
|
+
## Use when…
|
|
13
|
+
|
|
14
|
+
Something about the user's account or functionality needs to be managed and it
|
|
15
|
+
|
|
16
|
+
* can't be done in the context of the main application
|
|
17
|
+
* involves setting a default that does not frequently change
|
|
18
|
+
* has a group of related options that are better managed in a single place
|
|
19
|
+
|
|
20
|
+
## Solution
|
|
21
|
+
|
|
22
|
+
Under the appropriate section in the Settings menu, add a setting for the
|
|
23
|
+
feature.
|
|
24
|
+
|
|
25
|
+
Most settings can be managed with the
|
|
26
|
+
[FeatureSwitch](../components/FeatureSwitch) component, which allows:
|
|
27
|
+
|
|
28
|
+
* turning functionality on and off
|
|
29
|
+
* editing aspects of the feature via a [Modal](../components/Modal)
|
|
30
|
+
* if the page supports it, live updates to the setting
|
|
31
|
+
|
|
32
|
+
### Grouping settings
|
|
33
|
+
|
|
34
|
+
Use a [Card](../Card/Card.md) to group related settings together.
|
|
35
|
+
|
|
36
|
+
## Implementation
|
|
37
|
+
|
|
38
|
+
The [FeatureSwitch](../components/FeatureSwitch) component is a good starting
|
|
39
|
+
point for most settings. If the setting is more complex, you can trigger a
|
|
40
|
+
[Modal](../components/Modal) to edit the setting.
|
|
41
|
+
|
|
42
|
+
For cases where you don't need the full functionality of the `FeatureSwitch`,
|
|
43
|
+
you can either opt out of props like `onSwitch` or `onEdit`, or compose a layout
|
|
44
|
+
of the pieces you do need.
|
|
45
|
+
|
|
46
|
+
## Related
|
|
47
|
+
|
|
48
|
+
### Components
|
|
49
|
+
|
|
50
|
+
* [FeatureSwitch](../components/FeatureSwitch)
|
|
51
|
+
* [Card](../Card/Card.md)
|
|
52
|
+
* [Modal](../components/Modal)
|
|
53
|
+
* [Switch](../Switch/Switch.md)
|
|
54
|
+
|
|
55
|
+
## Principles
|
|
56
|
+
|
|
57
|
+
* [Visibility of system status](https://www.nngroup.com/articles/visibility-system-status/)
|
|
58
|
+
* [Help users recognize, diagnose and recover from errors](https://www.nngroup.com/articles/ten-usability-heuristics/#toc-9-help-users-recognize-diagnose-and-recover-from-errors-9)
|