@mhmo91/schmancy 0.5.45 → 0.5.46
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/ai/content-drawer.md +90 -160
- package/dist/ai/content-drawer.md +90 -160
- package/dist/{avatar-C6l64slz.js → avatar-CcHlQTbR.js} +33 -26
- package/dist/avatar-CcHlQTbR.js.map +1 -0
- package/dist/{avatar-wheGmG83.cjs → avatar-D93Sjal-.cjs} +2 -2
- package/dist/avatar-D93Sjal-.cjs.map +1 -0
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/content-drawer.cjs +1 -1
- package/dist/content-drawer.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/navigation-bar.cjs +1 -1
- package/dist/navigation-bar.js +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/teleport.js +1 -1
- package/package.json +1 -1
- package/types/src/content-drawer/drawer.service.d.ts +16 -0
- package/dist/avatar-C6l64slz.js.map +0 -1
- package/dist/avatar-wheGmG83.cjs.map +0 -1
package/ai/content-drawer.md
CHANGED
|
@@ -1,198 +1,128 @@
|
|
|
1
1
|
# Content Drawer
|
|
2
2
|
|
|
3
|
-
Responsive sliding panel that
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
The content drawer provides a responsive panel system that adapts to different screen sizes:
|
|
8
|
-
- **Large screens**: Panel pushes content aside (push mode)
|
|
9
|
-
- **Small screens**: Panel overlays content (overlay mode)
|
|
10
|
-
- **Automatic switching**: Responds to screen width changes
|
|
11
|
-
|
|
12
|
-
## Components
|
|
13
|
-
|
|
14
|
-
```js
|
|
15
|
-
// Main container that manages responsive behavior
|
|
16
|
-
<schmancy-content-drawer
|
|
17
|
-
?open="${boolean}" // Controls drawer visibility (auto-managed)
|
|
18
|
-
.minWidth="${{main: 360, sheet: 576}}" // Min widths for main and sheet
|
|
19
|
-
>
|
|
20
|
-
<schmancy-content-drawer-main
|
|
21
|
-
minWidth="${number}" // Minimum width for main content (default: 360px)
|
|
22
|
-
>
|
|
23
|
-
// Main content area
|
|
24
|
-
</schmancy-content-drawer-main>
|
|
3
|
+
Responsive sliding panel that switches between push mode (desktop) and overlay mode (mobile).
|
|
25
4
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
// Optional placeholder content when sheet is empty
|
|
31
|
-
</section>
|
|
32
|
-
</schmancy-content-drawer-sheet>
|
|
33
|
-
</schmancy-content-drawer>
|
|
5
|
+
## Service API
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { schmancyContentDrawer } from '@schmancy/content-drawer'
|
|
34
9
|
```
|
|
35
10
|
|
|
36
|
-
|
|
11
|
+
### `push(options)`
|
|
37
12
|
|
|
38
|
-
|
|
39
|
-
- **Push mode**: When `viewport >= main.minWidth + sheet.minWidth`
|
|
40
|
-
- Sheet panel appears inline beside main content
|
|
41
|
-
- Content is pushed to make room for the sheet
|
|
42
|
-
- Sheet remains visible
|
|
43
|
-
- **Overlay mode**: When `viewport < main.minWidth + sheet.minWidth`
|
|
44
|
-
- Sheet overlays on top of main content
|
|
45
|
-
- Opens/closes via the service API
|
|
46
|
-
- Shows as a modal sheet
|
|
13
|
+
Push a component to the drawer. Automatically resolves different component types.
|
|
47
14
|
|
|
48
|
-
|
|
15
|
+
**Parameters:**
|
|
49
16
|
|
|
50
|
-
|
|
51
|
-
|
|
17
|
+
- `options: ComponentType | DrawerPushOptions`
|
|
18
|
+
|
|
19
|
+
**ComponentType formats:**
|
|
52
20
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// - HTMLElement: new DemoButton() (component instance)
|
|
58
|
-
// - Factory: () => new DemoButton() (factory function)
|
|
59
|
-
// - Async: async () => import('./button').then(m => new m.default())
|
|
21
|
+
- `string` - HTML tag name (e.g., `'demo-button'`)
|
|
22
|
+
- `HTMLElement` - Component instance (e.g., `new MyComponent()`)
|
|
23
|
+
- `() => HTMLElement` - Factory function
|
|
24
|
+
- `() => Promise<{default: any}>` - Async import
|
|
60
25
|
|
|
61
|
-
|
|
62
|
-
schmancyContentDrawer.render(ref, component, title?)
|
|
26
|
+
**DrawerPushOptions object:**
|
|
63
27
|
|
|
64
|
-
|
|
65
|
-
|
|
28
|
+
```typescript
|
|
29
|
+
{
|
|
30
|
+
component: ComponentType
|
|
31
|
+
props?: Record<string, unknown> // Properties to set on component
|
|
32
|
+
state?: Record<string, unknown> // Router state (push mode only)
|
|
33
|
+
params?: Record<string, unknown> // Router params (push mode only)
|
|
34
|
+
}
|
|
66
35
|
```
|
|
67
36
|
|
|
68
|
-
|
|
37
|
+
**Usage:**
|
|
69
38
|
|
|
70
|
-
|
|
39
|
+
```typescript
|
|
40
|
+
// String tag
|
|
41
|
+
schmancyContentDrawer.push('demo-button')
|
|
71
42
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const myComponent = new MyComponent()
|
|
75
|
-
myComponent.variant = 'filled'
|
|
43
|
+
// HTMLElement instance
|
|
44
|
+
schmancyContentDrawer.push(new UserDetail())
|
|
76
45
|
|
|
77
|
-
//
|
|
78
|
-
schmancyContentDrawer.push(
|
|
46
|
+
// With options object (recommended)
|
|
47
|
+
schmancyContentDrawer.push({
|
|
48
|
+
component: new UserDetail(),
|
|
49
|
+
props: { userId: '123' }
|
|
50
|
+
})
|
|
79
51
|
|
|
80
|
-
//
|
|
81
|
-
|
|
82
|
-
schmancyContentDrawer.push(myComponent) // Automatically re-renders with new properties
|
|
83
|
-
```
|
|
52
|
+
// Factory function
|
|
53
|
+
schmancyContentDrawer.push(() => new MyComponent())
|
|
84
54
|
|
|
85
|
-
|
|
55
|
+
// Async import
|
|
56
|
+
schmancyContentDrawer.push(() => import('./my-component'))
|
|
57
|
+
```
|
|
86
58
|
|
|
87
|
-
###
|
|
59
|
+
### `render(ref, component, title?)`
|
|
88
60
|
|
|
89
|
-
|
|
90
|
-
<schmancy-content-drawer>
|
|
91
|
-
<schmancy-content-drawer-main>
|
|
92
|
-
<schmancy-list class="p-0">
|
|
93
|
-
<schmancy-list-item @click=${() => {
|
|
94
|
-
schmancyContentDrawer.push('demo-button')
|
|
95
|
-
}}>
|
|
96
|
-
Show Button Demo
|
|
97
|
-
</schmancy-list-item>
|
|
98
|
-
<schmancy-list-item @click=${() => {
|
|
99
|
-
schmancyContentDrawer.push(new TypographyDemo())
|
|
100
|
-
}}>
|
|
101
|
-
Show Typography Demo
|
|
102
|
-
</schmancy-list-item>
|
|
103
|
-
</schmancy-list>
|
|
104
|
-
</schmancy-content-drawer-main>
|
|
61
|
+
Lower-level API for rendering. Use `push()` instead for most cases.
|
|
105
62
|
|
|
106
|
-
|
|
107
|
-
<section slot="placeholder">
|
|
108
|
-
<schmancy-typography>Select an item to view</schmancy-typography>
|
|
109
|
-
</section>
|
|
110
|
-
</schmancy-content-drawer-sheet>
|
|
111
|
-
</schmancy-content-drawer>
|
|
112
|
-
```
|
|
63
|
+
**Parameters:**
|
|
113
64
|
|
|
114
|
-
|
|
65
|
+
- `ref: Element | Window` - Element to dispatch events from
|
|
66
|
+
- `component: HTMLElement` - Component instance
|
|
67
|
+
- `title?: string` - Optional title
|
|
115
68
|
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
|
|
69
|
+
```typescript
|
|
70
|
+
schmancyContentDrawer.render(window, new UserDetail(), 'User Details')
|
|
71
|
+
```
|
|
119
72
|
|
|
120
|
-
|
|
121
|
-
const button = new DemoButton()
|
|
122
|
-
button.variant = 'filled'
|
|
123
|
-
schmancyContentDrawer.push(button)
|
|
73
|
+
### `dimiss(ref)`
|
|
124
74
|
|
|
125
|
-
|
|
126
|
-
schmancyContentDrawer.push(() => {
|
|
127
|
-
const comp = new MyComponent()
|
|
128
|
-
comp.setAttribute('theme', 'dark')
|
|
129
|
-
return comp
|
|
130
|
-
})
|
|
75
|
+
Closes the drawer. *Note: typo in actual API*
|
|
131
76
|
|
|
132
|
-
|
|
133
|
-
schmancyContentDrawer.
|
|
134
|
-
const module = await import('./lazy-component')
|
|
135
|
-
return new module.default()
|
|
136
|
-
})
|
|
77
|
+
```typescript
|
|
78
|
+
schmancyContentDrawer.dimiss(window)
|
|
137
79
|
```
|
|
138
80
|
|
|
139
|
-
|
|
81
|
+
## Component Structure
|
|
140
82
|
|
|
141
83
|
```html
|
|
142
84
|
<schmancy-content-drawer>
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
<div>Main application content</div>
|
|
85
|
+
<schmancy-content-drawer-main>
|
|
86
|
+
<!-- Main content area -->
|
|
146
87
|
</schmancy-content-drawer-main>
|
|
147
88
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
89
|
+
<schmancy-content-drawer-sheet>
|
|
90
|
+
<section slot="placeholder">
|
|
91
|
+
<!-- Empty state content -->
|
|
92
|
+
</section>
|
|
151
93
|
</schmancy-content-drawer-sheet>
|
|
152
94
|
</schmancy-content-drawer>
|
|
153
95
|
```
|
|
154
96
|
|
|
155
|
-
##
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
-
|
|
166
|
-
-
|
|
167
|
-
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
</schmancy-list
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
**Navigation Drawer**: Navigation links in main, content in sheet
|
|
188
|
-
```js
|
|
189
|
-
// Navigation item clicks update sheet content
|
|
190
|
-
schmancyContentDrawer.push(() => import(`./pages/${page}`))
|
|
97
|
+
## Properties
|
|
98
|
+
|
|
99
|
+
- `minWidth: {main: number, sheet: number}` - Minimum widths (default: `{main: 360, sheet: 576}`)
|
|
100
|
+
- `open: 'open' | 'close'` - Auto-managed based on mode
|
|
101
|
+
- `mode: 'push' | 'overlay'` - Auto-switches at 936px breakpoint
|
|
102
|
+
|
|
103
|
+
## Example
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
html`
|
|
107
|
+
<schmancy-content-drawer>
|
|
108
|
+
<schmancy-content-drawer-main>
|
|
109
|
+
<schmancy-list>
|
|
110
|
+
${items.map(item => html`
|
|
111
|
+
<schmancy-list-item @click=${() => {
|
|
112
|
+
schmancyContentDrawer.push({
|
|
113
|
+
component: new ItemDetail(),
|
|
114
|
+
props: { item }
|
|
115
|
+
})
|
|
116
|
+
}}>
|
|
117
|
+
${item.name}
|
|
118
|
+
</schmancy-list-item>
|
|
119
|
+
`)}
|
|
120
|
+
</schmancy-list>
|
|
121
|
+
</schmancy-content-drawer-main>
|
|
122
|
+
|
|
123
|
+
<schmancy-content-drawer-sheet>
|
|
124
|
+
<section slot="placeholder">Select an item</section>
|
|
125
|
+
</schmancy-content-drawer-sheet>
|
|
126
|
+
</schmancy-content-drawer>
|
|
127
|
+
`
|
|
191
128
|
```
|
|
192
|
-
|
|
193
|
-
## Related Components
|
|
194
|
-
|
|
195
|
-
- [Sheet](./sheet.md) - Modal sheet component used in overlay mode
|
|
196
|
-
- [Area](./area.md) - Routing system used in push mode
|
|
197
|
-
- [Grid](./grid.md) - Layout system for responsive design
|
|
198
|
-
- [List](./list.md) - List component for navigation items
|
|
@@ -1,198 +1,128 @@
|
|
|
1
1
|
# Content Drawer
|
|
2
2
|
|
|
3
|
-
Responsive sliding panel that
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
The content drawer provides a responsive panel system that adapts to different screen sizes:
|
|
8
|
-
- **Large screens**: Panel pushes content aside (push mode)
|
|
9
|
-
- **Small screens**: Panel overlays content (overlay mode)
|
|
10
|
-
- **Automatic switching**: Responds to screen width changes
|
|
11
|
-
|
|
12
|
-
## Components
|
|
13
|
-
|
|
14
|
-
```js
|
|
15
|
-
// Main container that manages responsive behavior
|
|
16
|
-
<schmancy-content-drawer
|
|
17
|
-
?open="${boolean}" // Controls drawer visibility (auto-managed)
|
|
18
|
-
.minWidth="${{main: 360, sheet: 576}}" // Min widths for main and sheet
|
|
19
|
-
>
|
|
20
|
-
<schmancy-content-drawer-main
|
|
21
|
-
minWidth="${number}" // Minimum width for main content (default: 360px)
|
|
22
|
-
>
|
|
23
|
-
// Main content area
|
|
24
|
-
</schmancy-content-drawer-main>
|
|
3
|
+
Responsive sliding panel that switches between push mode (desktop) and overlay mode (mobile).
|
|
25
4
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
// Optional placeholder content when sheet is empty
|
|
31
|
-
</section>
|
|
32
|
-
</schmancy-content-drawer-sheet>
|
|
33
|
-
</schmancy-content-drawer>
|
|
5
|
+
## Service API
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { schmancyContentDrawer } from '@schmancy/content-drawer'
|
|
34
9
|
```
|
|
35
10
|
|
|
36
|
-
|
|
11
|
+
### `push(options)`
|
|
37
12
|
|
|
38
|
-
|
|
39
|
-
- **Push mode**: When `viewport >= main.minWidth + sheet.minWidth`
|
|
40
|
-
- Sheet panel appears inline beside main content
|
|
41
|
-
- Content is pushed to make room for the sheet
|
|
42
|
-
- Sheet remains visible
|
|
43
|
-
- **Overlay mode**: When `viewport < main.minWidth + sheet.minWidth`
|
|
44
|
-
- Sheet overlays on top of main content
|
|
45
|
-
- Opens/closes via the service API
|
|
46
|
-
- Shows as a modal sheet
|
|
13
|
+
Push a component to the drawer. Automatically resolves different component types.
|
|
47
14
|
|
|
48
|
-
|
|
15
|
+
**Parameters:**
|
|
49
16
|
|
|
50
|
-
|
|
51
|
-
|
|
17
|
+
- `options: ComponentType | DrawerPushOptions`
|
|
18
|
+
|
|
19
|
+
**ComponentType formats:**
|
|
52
20
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// - HTMLElement: new DemoButton() (component instance)
|
|
58
|
-
// - Factory: () => new DemoButton() (factory function)
|
|
59
|
-
// - Async: async () => import('./button').then(m => new m.default())
|
|
21
|
+
- `string` - HTML tag name (e.g., `'demo-button'`)
|
|
22
|
+
- `HTMLElement` - Component instance (e.g., `new MyComponent()`)
|
|
23
|
+
- `() => HTMLElement` - Factory function
|
|
24
|
+
- `() => Promise<{default: any}>` - Async import
|
|
60
25
|
|
|
61
|
-
|
|
62
|
-
schmancyContentDrawer.render(ref, component, title?)
|
|
26
|
+
**DrawerPushOptions object:**
|
|
63
27
|
|
|
64
|
-
|
|
65
|
-
|
|
28
|
+
```typescript
|
|
29
|
+
{
|
|
30
|
+
component: ComponentType
|
|
31
|
+
props?: Record<string, unknown> // Properties to set on component
|
|
32
|
+
state?: Record<string, unknown> // Router state (push mode only)
|
|
33
|
+
params?: Record<string, unknown> // Router params (push mode only)
|
|
34
|
+
}
|
|
66
35
|
```
|
|
67
36
|
|
|
68
|
-
|
|
37
|
+
**Usage:**
|
|
69
38
|
|
|
70
|
-
|
|
39
|
+
```typescript
|
|
40
|
+
// String tag
|
|
41
|
+
schmancyContentDrawer.push('demo-button')
|
|
71
42
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const myComponent = new MyComponent()
|
|
75
|
-
myComponent.variant = 'filled'
|
|
43
|
+
// HTMLElement instance
|
|
44
|
+
schmancyContentDrawer.push(new UserDetail())
|
|
76
45
|
|
|
77
|
-
//
|
|
78
|
-
schmancyContentDrawer.push(
|
|
46
|
+
// With options object (recommended)
|
|
47
|
+
schmancyContentDrawer.push({
|
|
48
|
+
component: new UserDetail(),
|
|
49
|
+
props: { userId: '123' }
|
|
50
|
+
})
|
|
79
51
|
|
|
80
|
-
//
|
|
81
|
-
|
|
82
|
-
schmancyContentDrawer.push(myComponent) // Automatically re-renders with new properties
|
|
83
|
-
```
|
|
52
|
+
// Factory function
|
|
53
|
+
schmancyContentDrawer.push(() => new MyComponent())
|
|
84
54
|
|
|
85
|
-
|
|
55
|
+
// Async import
|
|
56
|
+
schmancyContentDrawer.push(() => import('./my-component'))
|
|
57
|
+
```
|
|
86
58
|
|
|
87
|
-
###
|
|
59
|
+
### `render(ref, component, title?)`
|
|
88
60
|
|
|
89
|
-
|
|
90
|
-
<schmancy-content-drawer>
|
|
91
|
-
<schmancy-content-drawer-main>
|
|
92
|
-
<schmancy-list class="p-0">
|
|
93
|
-
<schmancy-list-item @click=${() => {
|
|
94
|
-
schmancyContentDrawer.push('demo-button')
|
|
95
|
-
}}>
|
|
96
|
-
Show Button Demo
|
|
97
|
-
</schmancy-list-item>
|
|
98
|
-
<schmancy-list-item @click=${() => {
|
|
99
|
-
schmancyContentDrawer.push(new TypographyDemo())
|
|
100
|
-
}}>
|
|
101
|
-
Show Typography Demo
|
|
102
|
-
</schmancy-list-item>
|
|
103
|
-
</schmancy-list>
|
|
104
|
-
</schmancy-content-drawer-main>
|
|
61
|
+
Lower-level API for rendering. Use `push()` instead for most cases.
|
|
105
62
|
|
|
106
|
-
|
|
107
|
-
<section slot="placeholder">
|
|
108
|
-
<schmancy-typography>Select an item to view</schmancy-typography>
|
|
109
|
-
</section>
|
|
110
|
-
</schmancy-content-drawer-sheet>
|
|
111
|
-
</schmancy-content-drawer>
|
|
112
|
-
```
|
|
63
|
+
**Parameters:**
|
|
113
64
|
|
|
114
|
-
|
|
65
|
+
- `ref: Element | Window` - Element to dispatch events from
|
|
66
|
+
- `component: HTMLElement` - Component instance
|
|
67
|
+
- `title?: string` - Optional title
|
|
115
68
|
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
|
|
69
|
+
```typescript
|
|
70
|
+
schmancyContentDrawer.render(window, new UserDetail(), 'User Details')
|
|
71
|
+
```
|
|
119
72
|
|
|
120
|
-
|
|
121
|
-
const button = new DemoButton()
|
|
122
|
-
button.variant = 'filled'
|
|
123
|
-
schmancyContentDrawer.push(button)
|
|
73
|
+
### `dimiss(ref)`
|
|
124
74
|
|
|
125
|
-
|
|
126
|
-
schmancyContentDrawer.push(() => {
|
|
127
|
-
const comp = new MyComponent()
|
|
128
|
-
comp.setAttribute('theme', 'dark')
|
|
129
|
-
return comp
|
|
130
|
-
})
|
|
75
|
+
Closes the drawer. *Note: typo in actual API*
|
|
131
76
|
|
|
132
|
-
|
|
133
|
-
schmancyContentDrawer.
|
|
134
|
-
const module = await import('./lazy-component')
|
|
135
|
-
return new module.default()
|
|
136
|
-
})
|
|
77
|
+
```typescript
|
|
78
|
+
schmancyContentDrawer.dimiss(window)
|
|
137
79
|
```
|
|
138
80
|
|
|
139
|
-
|
|
81
|
+
## Component Structure
|
|
140
82
|
|
|
141
83
|
```html
|
|
142
84
|
<schmancy-content-drawer>
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
<div>Main application content</div>
|
|
85
|
+
<schmancy-content-drawer-main>
|
|
86
|
+
<!-- Main content area -->
|
|
146
87
|
</schmancy-content-drawer-main>
|
|
147
88
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
89
|
+
<schmancy-content-drawer-sheet>
|
|
90
|
+
<section slot="placeholder">
|
|
91
|
+
<!-- Empty state content -->
|
|
92
|
+
</section>
|
|
151
93
|
</schmancy-content-drawer-sheet>
|
|
152
94
|
</schmancy-content-drawer>
|
|
153
95
|
```
|
|
154
96
|
|
|
155
|
-
##
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
-
|
|
166
|
-
-
|
|
167
|
-
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
</schmancy-list
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
**Navigation Drawer**: Navigation links in main, content in sheet
|
|
188
|
-
```js
|
|
189
|
-
// Navigation item clicks update sheet content
|
|
190
|
-
schmancyContentDrawer.push(() => import(`./pages/${page}`))
|
|
97
|
+
## Properties
|
|
98
|
+
|
|
99
|
+
- `minWidth: {main: number, sheet: number}` - Minimum widths (default: `{main: 360, sheet: 576}`)
|
|
100
|
+
- `open: 'open' | 'close'` - Auto-managed based on mode
|
|
101
|
+
- `mode: 'push' | 'overlay'` - Auto-switches at 936px breakpoint
|
|
102
|
+
|
|
103
|
+
## Example
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
html`
|
|
107
|
+
<schmancy-content-drawer>
|
|
108
|
+
<schmancy-content-drawer-main>
|
|
109
|
+
<schmancy-list>
|
|
110
|
+
${items.map(item => html`
|
|
111
|
+
<schmancy-list-item @click=${() => {
|
|
112
|
+
schmancyContentDrawer.push({
|
|
113
|
+
component: new ItemDetail(),
|
|
114
|
+
props: { item }
|
|
115
|
+
})
|
|
116
|
+
}}>
|
|
117
|
+
${item.name}
|
|
118
|
+
</schmancy-list-item>
|
|
119
|
+
`)}
|
|
120
|
+
</schmancy-list>
|
|
121
|
+
</schmancy-content-drawer-main>
|
|
122
|
+
|
|
123
|
+
<schmancy-content-drawer-sheet>
|
|
124
|
+
<section slot="placeholder">Select an item</section>
|
|
125
|
+
</schmancy-content-drawer-sheet>
|
|
126
|
+
</schmancy-content-drawer>
|
|
127
|
+
`
|
|
191
128
|
```
|
|
192
|
-
|
|
193
|
-
## Related Components
|
|
194
|
-
|
|
195
|
-
- [Sheet](./sheet.md) - Modal sheet component used in overlay mode
|
|
196
|
-
- [Area](./area.md) - Routing system used in push mode
|
|
197
|
-
- [Grid](./grid.md) - Layout system for responsive design
|
|
198
|
-
- [List](./list.md) - List component for navigation items
|