@ceed/ads 1.35.1 → 1.36.0
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/README.md +85 -95
- package/dist/components/Accordions/Accordions.d.ts +1 -0
- package/dist/components/Alert/Alert.d.ts +5 -5
- package/dist/components/Autocomplete/Autocomplete.d.ts +2 -2
- package/dist/components/Avatar/Avatar.d.ts +7 -17
- package/dist/components/Box/Box.d.ts +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +6 -5
- package/dist/components/Button/Button.d.ts +3 -2
- package/dist/components/Calendar/Calendar.d.ts +1 -0
- package/dist/components/Card/Card.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/Chip/Chip.d.ts +1 -0
- package/dist/components/Container/Container.d.ts +6 -1
- package/dist/components/DialogActions/DialogActions.d.ts +1 -0
- package/dist/components/DialogContent/DialogContent.d.ts +1 -0
- package/dist/components/DialogFrame/DialogFrame.d.ts +1 -1
- package/dist/components/DialogTitle/DialogTitle.d.ts +1 -0
- package/dist/components/Divider/Divider.d.ts +1 -0
- package/dist/components/Dropdown/Dropdown.d.ts +28 -1
- package/dist/components/FilterMenu/components/MonthRange.d.ts +11 -0
- package/dist/components/FilterMenu/types.d.ts +5 -1
- package/dist/components/FormControl/FormControl.d.ts +1 -0
- package/dist/components/FormHelperText/FormHelperText.d.ts +1 -0
- package/dist/components/FormLabel/FormLabel.d.ts +1 -0
- package/dist/components/Grid/Grid.d.ts +1 -0
- package/dist/components/IconButton/IconButton.d.ts +3 -2
- package/dist/components/IconMenuButton/IconMenuButton.d.ts +7 -6
- package/dist/components/InfoSign/InfoSign.d.ts +3 -2
- package/dist/components/Input/Input.d.ts +8 -22
- package/dist/components/InsetDrawer/InsetDrawer.d.ts +1 -0
- package/dist/components/Markdown/Markdown.d.ts +9 -24
- package/dist/components/Menu/Menu.d.ts +2 -1
- package/dist/components/MenuButton/MenuButton.d.ts +10 -8
- package/dist/components/Modal/Modal.d.ts +4 -2
- package/dist/components/NavigationGroup/NavigationGroup.d.ts +3 -2
- package/dist/components/NavigationItem/NavigationItem.d.ts +3 -2
- package/dist/components/Navigator/Navigator.d.ts +5 -4
- package/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/ProfileMenu/ProfileMenu.d.ts +2 -2
- package/dist/components/Radio/Radio.d.ts +1 -0
- package/dist/components/RadioList/RadioList.d.ts +3 -2
- package/dist/components/Select/Select.d.ts +12 -10
- package/dist/components/Sheet/Sheet.d.ts +1 -0
- package/dist/components/Stack/Stack.d.ts +1 -0
- package/dist/components/Stepper/Stepper.d.ts +2 -1
- package/dist/components/Switch/Switch.d.ts +1 -0
- package/dist/components/Table/Table.d.ts +7 -5
- package/dist/components/Tabs/Tabs.d.ts +1 -0
- package/dist/components/Textarea/Textarea.d.ts +8 -20
- package/dist/components/ThemeProvider/ThemeProvider.d.ts +4 -2
- package/dist/components/Tooltip/Tooltip.d.ts +1 -0
- package/dist/components/Typography/Typography.d.ts +1 -0
- package/dist/components/Uploader/Uploader.d.ts +18 -17
- package/dist/components/data-display/Avatar.md +60 -72
- package/dist/components/data-display/Badge.md +197 -181
- package/dist/components/data-display/Chip.md +164 -142
- package/dist/components/data-display/DataTable.md +843 -338
- package/dist/components/data-display/InfoSign.md +1 -3
- package/dist/components/data-display/Markdown.md +93 -125
- package/dist/components/data-display/Table.md +1453 -1007
- package/dist/components/data-display/Typography.md +101 -104
- package/dist/components/feedback/Alert.md +80 -86
- package/dist/components/feedback/CircularProgress.md +32 -36
- package/dist/components/feedback/Dialog.md +25 -17
- package/dist/components/feedback/Modal.md +296 -265
- package/dist/components/feedback/Skeleton.md +125 -89
- package/dist/components/index.d.ts +60 -1
- package/dist/components/inputs/Autocomplete.md +191 -95
- package/dist/components/inputs/Button.md +83 -83
- package/dist/components/inputs/ButtonGroup.md +195 -185
- package/dist/components/inputs/Calendar.md +25 -28
- package/dist/components/inputs/Checkbox.md +11 -29
- package/dist/components/inputs/CurrencyInput.md +4 -4
- package/dist/components/inputs/DatePicker.md +229 -110
- package/dist/components/inputs/DateRangePicker.md +248 -137
- package/dist/components/inputs/FilterMenu.md +138 -8
- package/dist/components/inputs/FilterableCheckboxGroup.md +115 -55
- package/dist/components/inputs/FormControl.md +75 -69
- package/dist/components/inputs/IconButton.md +229 -205
- package/dist/components/inputs/Input.md +131 -98
- package/dist/components/inputs/MonthPicker.md +186 -84
- package/dist/components/inputs/MonthRangePicker.md +73 -49
- package/dist/components/inputs/PercentageInput.md +15 -31
- package/dist/components/inputs/RadioButton.md +320 -256
- package/dist/components/inputs/RadioList.md +66 -50
- package/dist/components/inputs/RadioTileGroup.md +287 -170
- package/dist/components/inputs/SearchBar.md +82 -60
- package/dist/components/inputs/Select.md +106 -95
- package/dist/components/inputs/Slider.md +153 -102
- package/dist/components/inputs/Switch.md +193 -138
- package/dist/components/inputs/Textarea.md +15 -20
- package/dist/components/inputs/Uploader/Uploader.md +68 -39
- package/dist/components/layout/Box.md +841 -662
- package/dist/components/layout/Container.md +3 -11
- package/dist/components/layout/Grid.md +480 -394
- package/dist/components/layout/Stack.md +739 -566
- package/dist/components/navigation/Breadcrumbs.md +182 -116
- package/dist/components/navigation/Dropdown.md +732 -391
- package/dist/components/navigation/IconMenuButton.md +14 -6
- package/dist/components/navigation/InsetDrawer.md +550 -378
- package/dist/components/navigation/Link.md +104 -94
- package/dist/components/navigation/Menu.md +623 -502
- package/dist/components/navigation/MenuButton.md +18 -10
- package/dist/components/navigation/NavigationGroup.md +19 -50
- package/dist/components/navigation/NavigationItem.md +6 -6
- package/dist/components/navigation/Navigator.md +26 -28
- package/dist/components/navigation/Pagination.md +86 -75
- package/dist/components/navigation/ProfileMenu.md +65 -43
- package/dist/components/navigation/Stepper.md +2 -12
- package/dist/components/navigation/Tabs.md +209 -183
- package/dist/components/surfaces/Accordions.md +89 -172
- package/dist/components/surfaces/Card.md +1094 -709
- package/dist/components/surfaces/Divider.md +562 -412
- package/dist/components/surfaces/Sheet.md +700 -518
- package/dist/guides/ThemeProvider.md +65 -40
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +4 -4
- package/dist/index.cjs +1643 -1550
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1303 -1202
- package/framer/index.js +1 -1
- package/package.json +32 -35
|
@@ -7,133 +7,190 @@ InsetDrawer is a slide-out panel that appears from any edge of the screen, provi
|
|
|
7
7
|
It is commonly used for mobile navigation menus, filter panels, configuration sidebars, and detail views. The component supports four anchor positions (left, right, top, bottom) and three size presets, making it adaptable to a wide range of layout requirements.
|
|
8
8
|
|
|
9
9
|
```tsx
|
|
10
|
-
<Box
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
<
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
10
|
+
<Box
|
|
11
|
+
sx={{
|
|
12
|
+
display: "flex",
|
|
13
|
+
flexDirection: "column",
|
|
14
|
+
gap: 2
|
|
15
|
+
}}
|
|
16
|
+
>
|
|
17
|
+
<Button
|
|
18
|
+
variant="outlined"
|
|
19
|
+
color="neutral"
|
|
20
|
+
startDecorator={<FilterListIcon />}
|
|
21
|
+
onClick={() => setOpen(true)}
|
|
22
|
+
>
|
|
23
|
+
Open Drawer
|
|
24
|
+
</Button>
|
|
25
|
+
|
|
26
|
+
<InsetDrawer {...args} open={open} onClose={() => setOpen(false)}>
|
|
27
|
+
<Sheet
|
|
28
|
+
sx={{
|
|
29
|
+
borderRadius: "md",
|
|
30
|
+
p: 2,
|
|
31
|
+
display: "flex",
|
|
32
|
+
flexDirection: "column",
|
|
33
|
+
gap: 2,
|
|
34
|
+
height: "100%",
|
|
35
|
+
overflow: "auto"
|
|
36
|
+
}}
|
|
37
|
+
>
|
|
38
|
+
<DialogTitle>Filters</DialogTitle>
|
|
39
|
+
<ModalClose />
|
|
40
|
+
<Divider
|
|
41
|
+
sx={{
|
|
42
|
+
mt: "auto"
|
|
43
|
+
}}
|
|
44
|
+
/>
|
|
45
|
+
<DialogContent>
|
|
46
|
+
<FormControl>
|
|
47
|
+
<FormLabel
|
|
48
|
+
sx={{
|
|
49
|
+
typography: "title-md",
|
|
50
|
+
fontWeight: "bold"
|
|
51
|
+
}}
|
|
52
|
+
>
|
|
53
|
+
Property type
|
|
54
|
+
</FormLabel>
|
|
55
|
+
<RadioGroup>
|
|
56
|
+
<Box
|
|
57
|
+
sx={{
|
|
58
|
+
display: "grid",
|
|
59
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(140px, 1fr))",
|
|
60
|
+
gap: 1.5
|
|
61
|
+
}}
|
|
62
|
+
>
|
|
63
|
+
{[
|
|
64
|
+
{
|
|
65
|
+
name: "House",
|
|
66
|
+
icon: <HomeRoundedIcon />
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "Apartment",
|
|
70
|
+
icon: <ApartmentRoundedIcon />
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "Guesthouse",
|
|
74
|
+
icon: <MeetingRoomRoundedIcon />
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "Hotel",
|
|
78
|
+
icon: <HotelRoundedIcon />
|
|
79
|
+
}
|
|
80
|
+
].map((item) => (
|
|
81
|
+
<Card
|
|
82
|
+
key={item.name}
|
|
83
|
+
sx={{
|
|
84
|
+
boxShadow: "none",
|
|
85
|
+
"&:hover": {
|
|
86
|
+
bgcolor: "background.level1"
|
|
87
|
+
}
|
|
88
|
+
}}
|
|
89
|
+
>
|
|
90
|
+
<CardContent>
|
|
91
|
+
{item.icon}
|
|
92
|
+
<Typography level="title-md">{item.name}</Typography>
|
|
93
|
+
</CardContent>
|
|
94
|
+
<Radio
|
|
95
|
+
disableIcon
|
|
96
|
+
overlay
|
|
97
|
+
variant="outlined"
|
|
98
|
+
color="neutral"
|
|
99
|
+
value={item.name}
|
|
100
|
+
sx={{
|
|
101
|
+
mt: -2
|
|
102
|
+
}}
|
|
103
|
+
slotProps={{
|
|
104
|
+
action: {
|
|
105
|
+
sx: {
|
|
106
|
+
"&:hover": {
|
|
107
|
+
bgcolor: "transparent"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}}
|
|
112
|
+
/>
|
|
113
|
+
</Card>
|
|
114
|
+
))}
|
|
115
|
+
</Box>
|
|
116
|
+
</RadioGroup>
|
|
117
|
+
</FormControl>
|
|
118
|
+
|
|
119
|
+
<Typography
|
|
120
|
+
level="title-md"
|
|
121
|
+
fontWeight="bold"
|
|
122
|
+
sx={{
|
|
123
|
+
mt: 2
|
|
124
|
+
}}
|
|
125
|
+
>
|
|
126
|
+
Booking options
|
|
127
|
+
</Typography>
|
|
128
|
+
<FormControl orientation="horizontal">
|
|
129
|
+
<Box
|
|
130
|
+
sx={{
|
|
131
|
+
flex: 1,
|
|
132
|
+
pr: 1
|
|
133
|
+
}}
|
|
134
|
+
>
|
|
135
|
+
<FormLabel
|
|
136
|
+
sx={{
|
|
137
|
+
typography: "title-sm"
|
|
138
|
+
}}
|
|
139
|
+
>
|
|
140
|
+
Instant booking
|
|
141
|
+
</FormLabel>
|
|
142
|
+
<FormHelperText
|
|
143
|
+
sx={{
|
|
144
|
+
typography: "body-sm"
|
|
145
|
+
}}
|
|
146
|
+
>
|
|
147
|
+
Listings that you can book without waiting for host approval.
|
|
148
|
+
</FormHelperText>
|
|
149
|
+
</Box>
|
|
150
|
+
<Switch />
|
|
151
|
+
</FormControl>
|
|
152
|
+
|
|
153
|
+
<FormControl orientation="horizontal">
|
|
154
|
+
<Box
|
|
155
|
+
sx={{
|
|
156
|
+
flex: 1,
|
|
157
|
+
mt: 1,
|
|
158
|
+
mr: 1
|
|
159
|
+
}}
|
|
160
|
+
>
|
|
161
|
+
<FormLabel
|
|
162
|
+
sx={{
|
|
163
|
+
typography: "title-sm"
|
|
164
|
+
}}
|
|
165
|
+
>
|
|
166
|
+
Self check-in
|
|
167
|
+
</FormLabel>
|
|
168
|
+
<FormHelperText
|
|
169
|
+
sx={{
|
|
170
|
+
typography: "body-sm"
|
|
171
|
+
}}
|
|
172
|
+
>
|
|
173
|
+
Easy access to the property when you arrive.
|
|
174
|
+
</FormHelperText>
|
|
175
|
+
</Box>
|
|
176
|
+
<Switch />
|
|
177
|
+
</FormControl>
|
|
178
|
+
</DialogContent>
|
|
179
|
+
|
|
180
|
+
<Divider
|
|
181
|
+
sx={{
|
|
182
|
+
mt: "auto"
|
|
183
|
+
}}
|
|
184
|
+
/>
|
|
185
|
+
<Stack direction="row" justifyContent="space-between" useFlexGap spacing={1}>
|
|
186
|
+
<Button variant="outlined" color="neutral">
|
|
187
|
+
Clear
|
|
188
|
+
</Button>
|
|
189
|
+
<Button onClick={() => setOpen(false)}>Show 165 properties</Button>
|
|
190
|
+
</Stack>
|
|
191
|
+
</Sheet>
|
|
192
|
+
</InsetDrawer>
|
|
193
|
+
</Box>
|
|
137
194
|
```
|
|
138
195
|
|
|
139
196
|
| Field | Description | Default |
|
|
@@ -155,9 +212,7 @@ function FilterDrawer() {
|
|
|
155
212
|
<Sheet sx={{ p: 2, height: '100%' }}>
|
|
156
213
|
<DialogTitle>Filters</DialogTitle>
|
|
157
214
|
<ModalClose />
|
|
158
|
-
<DialogContent>
|
|
159
|
-
{/* Filter content */}
|
|
160
|
-
</DialogContent>
|
|
215
|
+
<DialogContent>{/* Filter content */}</DialogContent>
|
|
161
216
|
</Sheet>
|
|
162
217
|
</InsetDrawer>
|
|
163
218
|
</>
|
|
@@ -170,48 +225,63 @@ function FilterDrawer() {
|
|
|
170
225
|
InsetDrawer supports four anchor positions. Use `left` for navigation, `right` for details or filters, `top` for search bars, and `bottom` for mobile action sheets.
|
|
171
226
|
|
|
172
227
|
```tsx
|
|
173
|
-
<Box
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
<
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}}
|
|
211
|
-
|
|
212
|
-
</
|
|
213
|
-
|
|
214
|
-
|
|
228
|
+
<Box
|
|
229
|
+
sx={{
|
|
230
|
+
display: "flex",
|
|
231
|
+
flexDirection: "column",
|
|
232
|
+
gap: 2
|
|
233
|
+
}}
|
|
234
|
+
>
|
|
235
|
+
<Stack direction="row" spacing={2}>
|
|
236
|
+
<Button variant="outlined" onClick={() => setAnchor("left")}>
|
|
237
|
+
Left
|
|
238
|
+
</Button>
|
|
239
|
+
<Button variant="outlined" onClick={() => setAnchor("right")}>
|
|
240
|
+
Right
|
|
241
|
+
</Button>
|
|
242
|
+
<Button variant="outlined" onClick={() => setAnchor("top")}>
|
|
243
|
+
Top
|
|
244
|
+
</Button>
|
|
245
|
+
<Button variant="outlined" onClick={() => setAnchor("bottom")}>
|
|
246
|
+
Bottom
|
|
247
|
+
</Button>
|
|
248
|
+
</Stack>
|
|
249
|
+
|
|
250
|
+
{(["left", "right", "top", "bottom"] as const).map((anchorValue) => (
|
|
251
|
+
<InsetDrawer
|
|
252
|
+
key={anchorValue}
|
|
253
|
+
anchor={anchorValue}
|
|
254
|
+
open={anchor === anchorValue}
|
|
255
|
+
onClose={() => setAnchor(null)}
|
|
256
|
+
>
|
|
257
|
+
<Sheet
|
|
258
|
+
sx={{
|
|
259
|
+
borderRadius: "md",
|
|
260
|
+
p: 2,
|
|
261
|
+
display: "flex",
|
|
262
|
+
flexDirection: "column",
|
|
263
|
+
gap: 2,
|
|
264
|
+
height: "100%"
|
|
265
|
+
}}
|
|
266
|
+
>
|
|
267
|
+
<DialogTitle>Drawer from {anchorValue}</DialogTitle>
|
|
268
|
+
<ModalClose />
|
|
269
|
+
<Divider />
|
|
270
|
+
<DialogContent>
|
|
271
|
+
<Typography>
|
|
272
|
+
This drawer slides in from the {anchorValue} side of the screen.
|
|
273
|
+
</Typography>
|
|
274
|
+
</DialogContent>
|
|
275
|
+
<Divider
|
|
276
|
+
sx={{
|
|
277
|
+
mt: "auto"
|
|
278
|
+
}}
|
|
279
|
+
/>
|
|
280
|
+
<Button onClick={() => setAnchor(null)}>Close</Button>
|
|
281
|
+
</Sheet>
|
|
282
|
+
</InsetDrawer>
|
|
283
|
+
))}
|
|
284
|
+
</Box>
|
|
215
285
|
```
|
|
216
286
|
|
|
217
287
|
## Sizes
|
|
@@ -219,45 +289,58 @@ InsetDrawer supports four anchor positions. Use `left` for navigation, `right` f
|
|
|
219
289
|
Three size presets are available: `sm`, `md`, and `lg`. The size controls width for left/right anchors and height for top/bottom anchors.
|
|
220
290
|
|
|
221
291
|
```tsx
|
|
222
|
-
<Box
|
|
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
|
-
|
|
292
|
+
<Box
|
|
293
|
+
sx={{
|
|
294
|
+
display: "flex",
|
|
295
|
+
flexDirection: "column",
|
|
296
|
+
gap: 2
|
|
297
|
+
}}
|
|
298
|
+
>
|
|
299
|
+
<Stack direction="row" spacing={2}>
|
|
300
|
+
<Button variant="outlined" size="sm" onClick={() => setSize("sm")}>
|
|
301
|
+
Small
|
|
302
|
+
</Button>
|
|
303
|
+
<Button variant="outlined" onClick={() => setSize("md")}>
|
|
304
|
+
Medium
|
|
305
|
+
</Button>
|
|
306
|
+
<Button variant="outlined" size="lg" onClick={() => setSize("lg")}>
|
|
307
|
+
Large
|
|
308
|
+
</Button>
|
|
309
|
+
</Stack>
|
|
310
|
+
|
|
311
|
+
{(["sm", "md", "lg"] as const).map((sizeValue) => (
|
|
312
|
+
<InsetDrawer
|
|
313
|
+
key={sizeValue}
|
|
314
|
+
size={sizeValue}
|
|
315
|
+
open={size === sizeValue}
|
|
316
|
+
onClose={() => setSize(null)}
|
|
317
|
+
>
|
|
318
|
+
<Sheet
|
|
319
|
+
sx={{
|
|
320
|
+
borderRadius: "md",
|
|
321
|
+
p: 2,
|
|
322
|
+
display: "flex",
|
|
323
|
+
flexDirection: "column",
|
|
324
|
+
gap: 2,
|
|
325
|
+
height: "100%"
|
|
326
|
+
}}
|
|
327
|
+
>
|
|
328
|
+
<DialogTitle>Size: {sizeValue}</DialogTitle>
|
|
329
|
+
<ModalClose />
|
|
330
|
+
<Divider />
|
|
331
|
+
<DialogContent>
|
|
332
|
+
<Typography>This is a {sizeValue} sized drawer.</Typography>
|
|
333
|
+
</DialogContent>
|
|
334
|
+
<Divider
|
|
335
|
+
sx={{
|
|
336
|
+
mt: "auto"
|
|
337
|
+
}}
|
|
338
|
+
/>
|
|
339
|
+
<Button onClick={() => setSize(null)}>Close</Button>
|
|
340
|
+
</Sheet>
|
|
341
|
+
</InsetDrawer>
|
|
342
|
+
))}
|
|
343
|
+
</Box>
|
|
261
344
|
```
|
|
262
345
|
|
|
263
346
|
## Navigation Menu
|
|
@@ -266,32 +349,50 @@ A typical mobile navigation menu pattern using InsetDrawer anchored to the left
|
|
|
266
349
|
|
|
267
350
|
```tsx
|
|
268
351
|
<Box>
|
|
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
|
-
|
|
352
|
+
<IconButton
|
|
353
|
+
variant="outlined"
|
|
354
|
+
color="neutral"
|
|
355
|
+
onClick={() => setOpen(true)}
|
|
356
|
+
aria-label="Open navigation menu"
|
|
357
|
+
>
|
|
358
|
+
<MenuIcon />
|
|
359
|
+
</IconButton>
|
|
360
|
+
|
|
361
|
+
<InsetDrawer open={open} onClose={() => setOpen(false)} anchor="left" size="sm">
|
|
362
|
+
<Sheet
|
|
363
|
+
sx={{
|
|
364
|
+
p: 2,
|
|
365
|
+
display: "flex",
|
|
366
|
+
flexDirection: "column",
|
|
367
|
+
height: "100%"
|
|
368
|
+
}}
|
|
369
|
+
>
|
|
370
|
+
<DialogTitle>Navigation</DialogTitle>
|
|
371
|
+
<ModalClose />
|
|
372
|
+
<Divider
|
|
373
|
+
sx={{
|
|
374
|
+
my: 2
|
|
375
|
+
}}
|
|
376
|
+
/>
|
|
377
|
+
<Stack spacing={1}>
|
|
378
|
+
{menuItems.map((item) => (
|
|
379
|
+
<Button
|
|
380
|
+
key={item.label}
|
|
381
|
+
variant="plain"
|
|
382
|
+
color="neutral"
|
|
383
|
+
startDecorator={item.icon}
|
|
384
|
+
sx={{
|
|
385
|
+
justifyContent: "flex-start"
|
|
386
|
+
}}
|
|
387
|
+
onClick={() => setOpen(false)}
|
|
388
|
+
>
|
|
389
|
+
{item.label}
|
|
390
|
+
</Button>
|
|
391
|
+
))}
|
|
392
|
+
</Stack>
|
|
393
|
+
</Sheet>
|
|
394
|
+
</InsetDrawer>
|
|
395
|
+
</Box>
|
|
295
396
|
```
|
|
296
397
|
|
|
297
398
|
## Filter Panel
|
|
@@ -300,139 +401,213 @@ A filter panel that slides in from the right, containing form controls for refin
|
|
|
300
401
|
|
|
301
402
|
```tsx
|
|
302
403
|
<Box>
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
<
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
}, {
|
|
345
|
-
name: 'Hotel',
|
|
346
|
-
icon: <HotelRoundedIcon />
|
|
347
|
-
}].map(item => <Card key={item.name} sx={{
|
|
348
|
-
boxShadow: 'none',
|
|
349
|
-
'&:hover': {
|
|
350
|
-
bgcolor: 'background.level1'
|
|
351
|
-
}
|
|
352
|
-
}}>
|
|
353
|
-
<CardContent>
|
|
354
|
-
{item.icon}
|
|
355
|
-
<Typography level="title-md">{item.name}</Typography>
|
|
356
|
-
</CardContent>
|
|
357
|
-
<Radio disableIcon overlay variant="outlined" color="neutral" value={item.name} sx={{
|
|
358
|
-
mt: -2
|
|
359
|
-
}} slotProps={{
|
|
360
|
-
action: {
|
|
361
|
-
sx: {
|
|
362
|
-
'&:hover': {
|
|
363
|
-
bgcolor: 'transparent'
|
|
404
|
+
<Button
|
|
405
|
+
variant="outlined"
|
|
406
|
+
color="neutral"
|
|
407
|
+
startDecorator={<FilterListIcon />}
|
|
408
|
+
onClick={() => setOpen(true)}
|
|
409
|
+
>
|
|
410
|
+
Filters
|
|
411
|
+
</Button>
|
|
412
|
+
|
|
413
|
+
<InsetDrawer open={open} onClose={() => setOpen(false)} anchor="right">
|
|
414
|
+
<Sheet
|
|
415
|
+
sx={{
|
|
416
|
+
borderRadius: "md",
|
|
417
|
+
p: 2,
|
|
418
|
+
display: "flex",
|
|
419
|
+
flexDirection: "column",
|
|
420
|
+
gap: 2,
|
|
421
|
+
height: "100%",
|
|
422
|
+
overflow: "auto"
|
|
423
|
+
}}
|
|
424
|
+
>
|
|
425
|
+
<DialogTitle>Filters</DialogTitle>
|
|
426
|
+
<ModalClose />
|
|
427
|
+
<Divider />
|
|
428
|
+
<DialogContent>
|
|
429
|
+
<FormControl>
|
|
430
|
+
<FormLabel
|
|
431
|
+
sx={{
|
|
432
|
+
typography: "title-md",
|
|
433
|
+
fontWeight: "bold"
|
|
434
|
+
}}
|
|
435
|
+
>
|
|
436
|
+
Property type
|
|
437
|
+
</FormLabel>
|
|
438
|
+
<RadioGroup
|
|
439
|
+
value={filters.propertyType}
|
|
440
|
+
onChange={(e) =>
|
|
441
|
+
setFilters((prev) => ({
|
|
442
|
+
...prev,
|
|
443
|
+
propertyType: e.target.value
|
|
444
|
+
}))
|
|
364
445
|
}
|
|
446
|
+
>
|
|
447
|
+
<Box
|
|
448
|
+
sx={{
|
|
449
|
+
display: "grid",
|
|
450
|
+
gridTemplateColumns: "repeat(auto-fill, minmax(140px, 1fr))",
|
|
451
|
+
gap: 1.5
|
|
452
|
+
}}
|
|
453
|
+
>
|
|
454
|
+
{[
|
|
455
|
+
{
|
|
456
|
+
name: "House",
|
|
457
|
+
icon: <HomeRoundedIcon />
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
name: "Apartment",
|
|
461
|
+
icon: <ApartmentRoundedIcon />
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
name: "Guesthouse",
|
|
465
|
+
icon: <MeetingRoomRoundedIcon />
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
name: "Hotel",
|
|
469
|
+
icon: <HotelRoundedIcon />
|
|
470
|
+
}
|
|
471
|
+
].map((item) => (
|
|
472
|
+
<Card
|
|
473
|
+
key={item.name}
|
|
474
|
+
sx={{
|
|
475
|
+
boxShadow: "none",
|
|
476
|
+
"&:hover": {
|
|
477
|
+
bgcolor: "background.level1"
|
|
478
|
+
}
|
|
479
|
+
}}
|
|
480
|
+
>
|
|
481
|
+
<CardContent>
|
|
482
|
+
{item.icon}
|
|
483
|
+
<Typography level="title-md">{item.name}</Typography>
|
|
484
|
+
</CardContent>
|
|
485
|
+
<Radio
|
|
486
|
+
disableIcon
|
|
487
|
+
overlay
|
|
488
|
+
variant="outlined"
|
|
489
|
+
color="neutral"
|
|
490
|
+
value={item.name}
|
|
491
|
+
sx={{
|
|
492
|
+
mt: -2
|
|
493
|
+
}}
|
|
494
|
+
slotProps={{
|
|
495
|
+
action: {
|
|
496
|
+
sx: {
|
|
497
|
+
"&:hover": {
|
|
498
|
+
bgcolor: "transparent"
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}}
|
|
503
|
+
/>
|
|
504
|
+
</Card>
|
|
505
|
+
))}
|
|
506
|
+
</Box>
|
|
507
|
+
</RadioGroup>
|
|
508
|
+
</FormControl>
|
|
509
|
+
|
|
510
|
+
<Typography
|
|
511
|
+
level="title-md"
|
|
512
|
+
fontWeight="bold"
|
|
513
|
+
sx={{
|
|
514
|
+
mt: 2
|
|
515
|
+
}}
|
|
516
|
+
>
|
|
517
|
+
Booking options
|
|
518
|
+
</Typography>
|
|
519
|
+
<FormControl orientation="horizontal">
|
|
520
|
+
<Box
|
|
521
|
+
sx={{
|
|
522
|
+
flex: 1,
|
|
523
|
+
pr: 1
|
|
524
|
+
}}
|
|
525
|
+
>
|
|
526
|
+
<FormLabel
|
|
527
|
+
sx={{
|
|
528
|
+
typography: "title-sm"
|
|
529
|
+
}}
|
|
530
|
+
>
|
|
531
|
+
Instant booking
|
|
532
|
+
</FormLabel>
|
|
533
|
+
<FormHelperText
|
|
534
|
+
sx={{
|
|
535
|
+
typography: "body-sm"
|
|
536
|
+
}}
|
|
537
|
+
>
|
|
538
|
+
Listings that you can book without waiting for host approval.
|
|
539
|
+
</FormHelperText>
|
|
540
|
+
</Box>
|
|
541
|
+
<Switch
|
|
542
|
+
checked={filters.instantBooking}
|
|
543
|
+
onChange={(e) =>
|
|
544
|
+
setFilters((prev) => ({
|
|
545
|
+
...prev,
|
|
546
|
+
instantBooking: e.target.checked
|
|
547
|
+
}))
|
|
548
|
+
}
|
|
549
|
+
/>
|
|
550
|
+
</FormControl>
|
|
551
|
+
|
|
552
|
+
<FormControl orientation="horizontal">
|
|
553
|
+
<Box
|
|
554
|
+
sx={{
|
|
555
|
+
flex: 1,
|
|
556
|
+
mt: 1,
|
|
557
|
+
mr: 1
|
|
558
|
+
}}
|
|
559
|
+
>
|
|
560
|
+
<FormLabel
|
|
561
|
+
sx={{
|
|
562
|
+
typography: "title-sm"
|
|
563
|
+
}}
|
|
564
|
+
>
|
|
565
|
+
Self check-in
|
|
566
|
+
</FormLabel>
|
|
567
|
+
<FormHelperText
|
|
568
|
+
sx={{
|
|
569
|
+
typography: "body-sm"
|
|
570
|
+
}}
|
|
571
|
+
>
|
|
572
|
+
Easy access to the property when you arrive.
|
|
573
|
+
</FormHelperText>
|
|
574
|
+
</Box>
|
|
575
|
+
<Switch
|
|
576
|
+
checked={filters.selfCheckIn}
|
|
577
|
+
onChange={(e) =>
|
|
578
|
+
setFilters((prev) => ({
|
|
579
|
+
...prev,
|
|
580
|
+
selfCheckIn: e.target.checked
|
|
581
|
+
}))
|
|
582
|
+
}
|
|
583
|
+
/>
|
|
584
|
+
</FormControl>
|
|
585
|
+
</DialogContent>
|
|
586
|
+
|
|
587
|
+
<Divider
|
|
588
|
+
sx={{
|
|
589
|
+
mt: "auto"
|
|
590
|
+
}}
|
|
591
|
+
/>
|
|
592
|
+
<Stack direction="row" justifyContent="space-between" useFlexGap spacing={1}>
|
|
593
|
+
<Button
|
|
594
|
+
variant="outlined"
|
|
595
|
+
color="neutral"
|
|
596
|
+
onClick={() =>
|
|
597
|
+
setFilters({
|
|
598
|
+
propertyType: "",
|
|
599
|
+
instantBooking: false,
|
|
600
|
+
selfCheckIn: false
|
|
601
|
+
})
|
|
365
602
|
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
</
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
mt: 2
|
|
375
|
-
}}>
|
|
376
|
-
Booking options
|
|
377
|
-
</Typography>
|
|
378
|
-
<FormControl orientation="horizontal">
|
|
379
|
-
<Box sx={{
|
|
380
|
-
flex: 1,
|
|
381
|
-
pr: 1
|
|
382
|
-
}}>
|
|
383
|
-
<FormLabel sx={{
|
|
384
|
-
typography: 'title-sm'
|
|
385
|
-
}}>Instant booking</FormLabel>
|
|
386
|
-
<FormHelperText sx={{
|
|
387
|
-
typography: 'body-sm'
|
|
388
|
-
}}>
|
|
389
|
-
Listings that you can book without waiting for host approval.
|
|
390
|
-
</FormHelperText>
|
|
391
|
-
</Box>
|
|
392
|
-
<Switch checked={filters.instantBooking} onChange={e => setFilters(prev => ({
|
|
393
|
-
...prev,
|
|
394
|
-
instantBooking: e.target.checked
|
|
395
|
-
}))} />
|
|
396
|
-
</FormControl>
|
|
397
|
-
|
|
398
|
-
<FormControl orientation="horizontal">
|
|
399
|
-
<Box sx={{
|
|
400
|
-
flex: 1,
|
|
401
|
-
mt: 1,
|
|
402
|
-
mr: 1
|
|
403
|
-
}}>
|
|
404
|
-
<FormLabel sx={{
|
|
405
|
-
typography: 'title-sm'
|
|
406
|
-
}}>Self check-in</FormLabel>
|
|
407
|
-
<FormHelperText sx={{
|
|
408
|
-
typography: 'body-sm'
|
|
409
|
-
}}>
|
|
410
|
-
Easy access to the property when you arrive.
|
|
411
|
-
</FormHelperText>
|
|
412
|
-
</Box>
|
|
413
|
-
<Switch checked={filters.selfCheckIn} onChange={e => setFilters(prev => ({
|
|
414
|
-
...prev,
|
|
415
|
-
selfCheckIn: e.target.checked
|
|
416
|
-
}))} />
|
|
417
|
-
</FormControl>
|
|
418
|
-
</DialogContent>
|
|
419
|
-
|
|
420
|
-
<Divider sx={{
|
|
421
|
-
mt: 'auto'
|
|
422
|
-
}} />
|
|
423
|
-
<Stack direction="row" justifyContent="space-between" useFlexGap spacing={1}>
|
|
424
|
-
<Button variant="outlined" color="neutral" onClick={() => setFilters({
|
|
425
|
-
propertyType: '',
|
|
426
|
-
instantBooking: false,
|
|
427
|
-
selfCheckIn: false
|
|
428
|
-
})}>
|
|
429
|
-
Clear
|
|
430
|
-
</Button>
|
|
431
|
-
<Button onClick={() => setOpen(false)}>Show 165 properties</Button>
|
|
432
|
-
</Stack>
|
|
433
|
-
</Sheet>
|
|
434
|
-
</InsetDrawer>
|
|
435
|
-
</Box>
|
|
603
|
+
>
|
|
604
|
+
Clear
|
|
605
|
+
</Button>
|
|
606
|
+
<Button onClick={() => setOpen(false)}>Show 165 properties</Button>
|
|
607
|
+
</Stack>
|
|
608
|
+
</Sheet>
|
|
609
|
+
</InsetDrawer>
|
|
610
|
+
</Box>
|
|
436
611
|
```
|
|
437
612
|
|
|
438
613
|
## Settings Drawer
|
|
@@ -460,9 +635,7 @@ function SettingsDrawer({ open, onClose }) {
|
|
|
460
635
|
</Box>
|
|
461
636
|
<Switch
|
|
462
637
|
checked={settings.notifications}
|
|
463
|
-
onChange={(e) =>
|
|
464
|
-
setSettings({ ...settings, notifications: e.target.checked })
|
|
465
|
-
}
|
|
638
|
+
onChange={(e) => setSettings({ ...settings, notifications: e.target.checked })}
|
|
466
639
|
/>
|
|
467
640
|
</FormControl>
|
|
468
641
|
<FormControl orientation="horizontal">
|
|
@@ -472,9 +645,7 @@ function SettingsDrawer({ open, onClose }) {
|
|
|
472
645
|
</Box>
|
|
473
646
|
<Switch
|
|
474
647
|
checked={settings.darkMode}
|
|
475
|
-
onChange={(e) =>
|
|
476
|
-
setSettings({ ...settings, darkMode: e.target.checked })
|
|
477
|
-
}
|
|
648
|
+
onChange={(e) => setSettings({ ...settings, darkMode: e.target.checked })}
|
|
478
649
|
/>
|
|
479
650
|
</FormControl>
|
|
480
651
|
</Stack>
|
|
@@ -531,7 +702,10 @@ function ActionSheet({ open, onClose, onAction }) {
|
|
|
531
702
|
<ListItem key={action.id}>
|
|
532
703
|
<ListItemButton
|
|
533
704
|
color={action.color}
|
|
534
|
-
onClick={() => {
|
|
705
|
+
onClick={() => {
|
|
706
|
+
onAction(action.id);
|
|
707
|
+
onClose();
|
|
708
|
+
}}
|
|
535
709
|
>
|
|
536
710
|
<ListItemDecorator>{action.icon}</ListItemDecorator>
|
|
537
711
|
{action.label}
|
|
@@ -593,9 +767,7 @@ function ActionSheet({ open, onClose, onAction }) {
|
|
|
593
767
|
<DialogTitle>Title</DialogTitle>
|
|
594
768
|
<ModalClose />
|
|
595
769
|
</Box>
|
|
596
|
-
<DialogContent sx={{ flex: 1, overflow: 'auto', p: 2 }}>
|
|
597
|
-
{/* Scrollable content */}
|
|
598
|
-
</DialogContent>
|
|
770
|
+
<DialogContent sx={{ flex: 1, overflow: 'auto', p: 2 }}>{/* Scrollable content */}</DialogContent>
|
|
599
771
|
<Box sx={{ p: 2, borderTop: '1px solid', borderColor: 'divider' }}>
|
|
600
772
|
<Button>Save</Button>
|
|
601
773
|
</Box>
|