snice 1.14.3 → 2.1.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/bin/templates/base/tsconfig.json +5 -4
- package/components/accordion/demo.html +403 -0
- package/components/accordion/snice-accordion-item.css +85 -0
- package/components/accordion/snice-accordion-item.ts +226 -0
- package/components/accordion/snice-accordion.css +31 -0
- package/components/accordion/snice-accordion.ts +182 -0
- package/components/accordion/snice-accordion.types.ts +32 -0
- package/components/alert/demo.html +445 -0
- package/components/alert/snice-alert.css +195 -0
- package/components/alert/snice-alert.ts +141 -0
- package/components/alert/snice-alert.types.ts +12 -0
- package/components/avatar/demo.html +598 -0
- package/components/avatar/snice-avatar.css +131 -0
- package/components/avatar/snice-avatar.ts +136 -0
- package/components/avatar/snice-avatar.types.ts +13 -0
- package/components/badge/demo.html +523 -0
- package/components/badge/snice-badge.css +161 -0
- package/components/badge/snice-badge.ts +117 -0
- package/components/badge/snice-badge.types.ts +16 -0
- package/components/breadcrumbs/demo.html +404 -0
- package/components/breadcrumbs/snice-breadcrumbs.css +133 -0
- package/components/breadcrumbs/snice-breadcrumbs.ts +191 -0
- package/components/breadcrumbs/snice-breadcrumbs.types.ts +26 -0
- package/components/breadcrumbs/snice-crumb.ts +26 -0
- package/components/button/demo.html +42 -0
- package/components/button/snice-button.css +230 -0
- package/components/button/snice-button.ts +169 -0
- package/components/button/snice-button.types.ts +25 -0
- package/components/card/demo.html +525 -0
- package/components/card/snice-card.css +140 -0
- package/components/card/snice-card.ts +102 -0
- package/components/card/snice-card.types.ts +10 -0
- package/components/checkbox/demo.html +253 -0
- package/components/checkbox/snice-checkbox.css +164 -0
- package/components/checkbox/snice-checkbox.ts +223 -0
- package/components/checkbox/snice-checkbox.types.ts +22 -0
- package/components/chip/demo.html +383 -0
- package/components/chip/snice-chip.css +195 -0
- package/components/chip/snice-chip.ts +139 -0
- package/components/chip/snice-chip.types.ts +15 -0
- package/components/date-picker/README.md +233 -0
- package/components/date-picker/demo.html +191 -0
- package/components/date-picker/snice-date-picker.css +330 -0
- package/components/date-picker/snice-date-picker.ts +777 -0
- package/components/date-picker/snice-date-picker.types.ts +83 -0
- package/components/divider/demo.html +233 -0
- package/components/divider/snice-divider.css +155 -0
- package/components/divider/snice-divider.ts +69 -0
- package/components/divider/snice-divider.types.ts +15 -0
- package/components/drawer/demo.html +328 -0
- package/components/drawer/snice-drawer.css +476 -0
- package/components/drawer/snice-drawer.ts +287 -0
- package/components/drawer/snice-drawer.types.ts +17 -0
- package/components/global.d.ts +14 -0
- package/components/input/demo.html +303 -0
- package/components/input/snice-input.css +257 -0
- package/components/input/snice-input.ts +442 -0
- package/components/input/snice-input.types.ts +59 -0
- package/components/input/test.html +77 -0
- package/components/layout/README.md +260 -0
- package/components/layout/demo.html +538 -0
- package/components/layout/snice-layout-blog.css +129 -0
- package/components/layout/snice-layout-blog.ts +48 -0
- package/components/layout/snice-layout-card.css +104 -0
- package/components/layout/snice-layout-card.ts +35 -0
- package/components/layout/snice-layout-centered.css +51 -0
- package/components/layout/snice-layout-centered.ts +22 -0
- package/components/layout/snice-layout-dashboard.css +98 -0
- package/components/layout/snice-layout-dashboard.ts +45 -0
- package/components/layout/snice-layout-fullscreen.css +72 -0
- package/components/layout/snice-layout-fullscreen.ts +34 -0
- package/components/layout/snice-layout-landing.css +92 -0
- package/components/layout/snice-layout-landing.ts +47 -0
- package/components/layout/snice-layout-minimal.css +16 -0
- package/components/layout/snice-layout-minimal.ts +19 -0
- package/components/layout/snice-layout-sidebar.css +117 -0
- package/components/layout/snice-layout-sidebar.ts +48 -0
- package/components/layout/snice-layout-split.css +103 -0
- package/components/layout/snice-layout-split.ts +29 -0
- package/components/layout/snice-layout.css +72 -0
- package/components/layout/snice-layout.ts +35 -0
- package/components/layout/snice-layout.types.ts +5 -0
- package/components/login/demo-auth-controller.ts +185 -0
- package/components/login/demo.html +470 -0
- package/components/login/snice-login.css +204 -0
- package/components/login/snice-login.ts +337 -0
- package/components/login/snice-login.types.ts +34 -0
- package/components/modal/demo.html +291 -0
- package/components/modal/snice-modal.css +203 -0
- package/components/modal/snice-modal.ts +233 -0
- package/components/modal/snice-modal.types.ts +21 -0
- package/components/pagination/demo.html +395 -0
- package/components/pagination/snice-pagination.ts +333 -0
- package/components/pagination/snice-pagination.types.ts +21 -0
- package/components/progress/demo.html +510 -0
- package/components/progress/snice-progress.css +267 -0
- package/components/progress/snice-progress.ts +247 -0
- package/components/progress/snice-progress.types.ts +19 -0
- package/components/radio/demo.html +287 -0
- package/components/radio/snice-radio.css +171 -0
- package/components/radio/snice-radio.ts +218 -0
- package/components/radio/snice-radio.types.ts +21 -0
- package/components/select/demo.html +511 -0
- package/components/select/snice-option.ts +52 -0
- package/components/select/snice-option.types.ts +14 -0
- package/components/select/snice-select.css +392 -0
- package/components/select/snice-select.ts +796 -0
- package/components/select/snice-select.types.ts +55 -0
- package/components/skeleton/demo.html +514 -0
- package/components/skeleton/snice-skeleton.css +109 -0
- package/components/skeleton/snice-skeleton.ts +126 -0
- package/components/skeleton/snice-skeleton.types.ts +11 -0
- package/components/switch/demo.html +284 -0
- package/components/switch/snice-switch.css +221 -0
- package/components/switch/snice-switch.ts +229 -0
- package/components/switch/snice-switch.types.ts +23 -0
- package/components/symbols.ts +23 -0
- package/components/table/demo-table-controller.ts +100 -0
- package/components/table/demo.html +480 -0
- package/components/table/snice-cell-boolean.ts +112 -0
- package/components/table/snice-cell-date.ts +210 -0
- package/components/table/snice-cell-duration.ts +91 -0
- package/components/table/snice-cell-filesize.ts +90 -0
- package/components/table/snice-cell-number.ts +165 -0
- package/components/table/snice-cell-progress.ts +83 -0
- package/components/table/snice-cell-rating.ts +82 -0
- package/components/table/snice-cell-sparkline.ts +253 -0
- package/components/table/snice-cell-text.ts +125 -0
- package/components/table/snice-cell.css +296 -0
- package/components/table/snice-cell.ts +473 -0
- package/components/table/snice-column.ts +353 -0
- package/components/table/snice-header.css +243 -0
- package/components/table/snice-header.ts +261 -0
- package/components/table/snice-progress.ts +66 -0
- package/components/table/snice-rating.ts +45 -0
- package/components/table/snice-row.css +255 -0
- package/components/table/snice-row.ts +331 -0
- package/components/table/snice-table.css +241 -0
- package/components/table/snice-table.ts +737 -0
- package/components/table/snice-table.types.ts +158 -0
- package/components/tabs/demo.html +487 -0
- package/components/tabs/snice-tab-panel.css +264 -0
- package/components/tabs/snice-tab-panel.ts +47 -0
- package/components/tabs/snice-tab.css +96 -0
- package/components/tabs/snice-tab.ts +65 -0
- package/components/tabs/snice-tabs.css +189 -0
- package/components/tabs/snice-tabs.ts +332 -0
- package/components/tabs/snice-tabs.types.ts +28 -0
- package/components/theme/theme.css +234 -0
- package/components/toast/demo.html +329 -0
- package/components/toast/snice-toast-container.ts +256 -0
- package/components/toast/snice-toast.css +213 -0
- package/components/toast/snice-toast.ts +276 -0
- package/components/toast/snice-toast.types.ts +35 -0
- package/components/tooltip/demo.html +350 -0
- package/components/tooltip/snice-tooltip-portal.css +79 -0
- package/components/tooltip/snice-tooltip.css +117 -0
- package/components/tooltip/snice-tooltip.ts +612 -0
- package/components/tooltip/snice-tooltip.types.ts +32 -0
- package/components/transitions.ts +94 -0
- package/components/tsconfig.json +18 -0
- package/dist/index.cjs +441 -329
- package/dist/index.cjs.map +1 -1
- package/dist/index.cjs.min.map +1 -1
- package/dist/index.esm.js +441 -329
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +3 -3
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +441 -329
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +3 -3
- package/dist/index.iife.min.js.map +1 -1
- package/dist/symbols.esm.js +1 -1
- package/dist/transitions.esm.js +1 -1
- package/dist/types/controller.d.ts +1 -1
- package/dist/types/element.d.ts +10 -10
- package/dist/types/events.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/observe.d.ts +1 -1
- package/dist/types/request-response.d.ts +2 -3
- package/dist/types/router.d.ts +1 -1
- package/package.json +9 -3
- package/dist/index.cjs.min +0 -15
- package/dist/symbols.cjs +0 -103
- package/dist/transitions.cjs +0 -219
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export type InputType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search' | 'date' | 'time' | 'datetime-local';
|
|
2
|
+
export type InputSize = 'small' | 'medium' | 'large';
|
|
3
|
+
export type InputVariant = 'outlined' | 'filled' | 'underlined';
|
|
4
|
+
|
|
5
|
+
export interface SniceInputElement extends HTMLElement {
|
|
6
|
+
type: InputType;
|
|
7
|
+
size: InputSize;
|
|
8
|
+
variant: InputVariant;
|
|
9
|
+
value: string;
|
|
10
|
+
placeholder: string;
|
|
11
|
+
label: string;
|
|
12
|
+
helperText: string;
|
|
13
|
+
errorText: string;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
readonly: boolean;
|
|
16
|
+
required: boolean;
|
|
17
|
+
invalid: boolean;
|
|
18
|
+
clearable: boolean;
|
|
19
|
+
password: boolean;
|
|
20
|
+
min: string;
|
|
21
|
+
max: string;
|
|
22
|
+
step: string;
|
|
23
|
+
pattern: string;
|
|
24
|
+
maxlength: number;
|
|
25
|
+
minlength: number;
|
|
26
|
+
autocomplete: string;
|
|
27
|
+
name: string;
|
|
28
|
+
prefixIcon: string;
|
|
29
|
+
suffixIcon: string;
|
|
30
|
+
focus(): void;
|
|
31
|
+
blur(): void;
|
|
32
|
+
select(): void;
|
|
33
|
+
clear(): void;
|
|
34
|
+
checkValidity(): boolean;
|
|
35
|
+
reportValidity(): boolean;
|
|
36
|
+
setCustomValidity(message: string): void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface InputChangeDetail {
|
|
40
|
+
value: string;
|
|
41
|
+
input: SniceInputElement;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface InputInputDetail {
|
|
45
|
+
value: string;
|
|
46
|
+
input: SniceInputElement;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface InputFocusDetail {
|
|
50
|
+
input: SniceInputElement;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface InputBlurDetail {
|
|
54
|
+
input: SniceInputElement;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface InputClearDetail {
|
|
58
|
+
input: SniceInputElement;
|
|
59
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Input Test</title>
|
|
7
|
+
<link rel="stylesheet" href="../theme/theme.css">
|
|
8
|
+
<style>
|
|
9
|
+
body {
|
|
10
|
+
padding: 40px;
|
|
11
|
+
font-family: var(--snice-font-family);
|
|
12
|
+
background: var(--snice-color-background);
|
|
13
|
+
color: var(--snice-color-text);
|
|
14
|
+
}
|
|
15
|
+
.test-group {
|
|
16
|
+
margin-bottom: 30px;
|
|
17
|
+
padding: 20px;
|
|
18
|
+
background: var(--snice-color-background-secondary);
|
|
19
|
+
border-radius: 8px;
|
|
20
|
+
}
|
|
21
|
+
</style>
|
|
22
|
+
</head>
|
|
23
|
+
<body>
|
|
24
|
+
<h2>Input Component Test</h2>
|
|
25
|
+
|
|
26
|
+
<div class="test-group">
|
|
27
|
+
<h3>Test 1: Basic with Label</h3>
|
|
28
|
+
<snice-input label="Test Label" placeholder="Enter text..."></snice-input>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div class="test-group">
|
|
32
|
+
<h3>Test 2: Number with Max/Min</h3>
|
|
33
|
+
<snice-input
|
|
34
|
+
type="number"
|
|
35
|
+
label="Number Input (0-100)"
|
|
36
|
+
min="0"
|
|
37
|
+
max="100"
|
|
38
|
+
step="5"
|
|
39
|
+
placeholder="0-100">
|
|
40
|
+
</snice-input>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div class="test-group">
|
|
44
|
+
<h3>Test 3: Required Field</h3>
|
|
45
|
+
<snice-input
|
|
46
|
+
label="Required Field"
|
|
47
|
+
placeholder="This is required"
|
|
48
|
+
required>
|
|
49
|
+
</snice-input>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div class="test-group">
|
|
53
|
+
<h3>Test 4: Max Length</h3>
|
|
54
|
+
<snice-input
|
|
55
|
+
label="Max 10 Characters"
|
|
56
|
+
maxlength="10"
|
|
57
|
+
placeholder="Max 10 chars">
|
|
58
|
+
</snice-input>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<script type="module">
|
|
62
|
+
import './snice-input.ts';
|
|
63
|
+
|
|
64
|
+
// Test that we can access the element and its properties
|
|
65
|
+
setTimeout(() => {
|
|
66
|
+
const inputs = document.querySelectorAll('snice-input');
|
|
67
|
+
inputs.forEach(input => {
|
|
68
|
+
console.log('Input label:', input.label);
|
|
69
|
+
console.log('Shadow root:', input.shadowRoot);
|
|
70
|
+
const labelEl = input.shadowRoot?.querySelector('.label');
|
|
71
|
+
console.log('Label element:', labelEl);
|
|
72
|
+
console.log('Label text:', labelEl?.textContent);
|
|
73
|
+
});
|
|
74
|
+
}, 1000);
|
|
75
|
+
</script>
|
|
76
|
+
</body>
|
|
77
|
+
</html>
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
# Layout Components
|
|
2
|
+
|
|
3
|
+
A collection of layout components for structuring web applications.
|
|
4
|
+
|
|
5
|
+
## Components
|
|
6
|
+
|
|
7
|
+
### snice-layout
|
|
8
|
+
Basic layout with header, main content, and footer areas.
|
|
9
|
+
|
|
10
|
+
```html
|
|
11
|
+
<snice-layout>
|
|
12
|
+
<div slot="brand"><h1>My App</h1></div>
|
|
13
|
+
<nav slot="nav">
|
|
14
|
+
<a href="/">Home</a>
|
|
15
|
+
<a href="/about">About</a>
|
|
16
|
+
</nav>
|
|
17
|
+
|
|
18
|
+
<!-- Main content -->
|
|
19
|
+
<div>
|
|
20
|
+
<h1>Welcome</h1>
|
|
21
|
+
<p>This is the main content area.</p>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div slot="footer">
|
|
25
|
+
<p>© 2024 My Company</p>
|
|
26
|
+
</div>
|
|
27
|
+
</snice-layout>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### snice-layout-sidebar
|
|
31
|
+
Layout with collapsible sidebar navigation.
|
|
32
|
+
|
|
33
|
+
```html
|
|
34
|
+
<snice-layout-sidebar>
|
|
35
|
+
<div slot="brand"><h2>Dashboard</h2></div>
|
|
36
|
+
<nav slot="nav">
|
|
37
|
+
<a href="/dashboard">Overview</a>
|
|
38
|
+
<a href="/users">Users</a>
|
|
39
|
+
<a href="/settings">Settings</a>
|
|
40
|
+
</nav>
|
|
41
|
+
<div slot="header">
|
|
42
|
+
<h1>Page Title</h1>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<!-- Main content -->
|
|
46
|
+
<div>
|
|
47
|
+
<p>Dashboard content goes here</p>
|
|
48
|
+
</div>
|
|
49
|
+
</snice-layout-sidebar>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### snice-layout-minimal
|
|
53
|
+
Clean layout with just content area.
|
|
54
|
+
|
|
55
|
+
```html
|
|
56
|
+
<snice-layout-minimal>
|
|
57
|
+
<div>
|
|
58
|
+
<h1>Simple Page</h1>
|
|
59
|
+
<p>Minimal layout for focused content.</p>
|
|
60
|
+
</div>
|
|
61
|
+
</snice-layout-minimal>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### snice-layout-centered
|
|
65
|
+
Centered container perfect for forms, authentication pages.
|
|
66
|
+
|
|
67
|
+
```html
|
|
68
|
+
<snice-layout-centered width="md">
|
|
69
|
+
<form>
|
|
70
|
+
<h2>Sign In</h2>
|
|
71
|
+
<input type="email" placeholder="Email">
|
|
72
|
+
<input type="password" placeholder="Password">
|
|
73
|
+
<button type="submit">Sign In</button>
|
|
74
|
+
</form>
|
|
75
|
+
</snice-layout-centered>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
#### Properties
|
|
79
|
+
- `width`: Container width - `"sm"` | `"md"` | `"lg"` | `"xl"` (default: `"md"`)
|
|
80
|
+
|
|
81
|
+
### snice-layout-landing
|
|
82
|
+
Marketing/landing page layout with hero section.
|
|
83
|
+
|
|
84
|
+
```html
|
|
85
|
+
<snice-layout-landing>
|
|
86
|
+
<div slot="brand"><h1>Company</h1></div>
|
|
87
|
+
<nav slot="nav">
|
|
88
|
+
<a href="#features">Features</a>
|
|
89
|
+
<a href="#pricing">Pricing</a>
|
|
90
|
+
</nav>
|
|
91
|
+
<button slot="cta">Get Started</button>
|
|
92
|
+
|
|
93
|
+
<div slot="hero">
|
|
94
|
+
<h1>Amazing Product</h1>
|
|
95
|
+
<p>Transform your business today</p>
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
<!-- Main content sections -->
|
|
99
|
+
<section>
|
|
100
|
+
<h2>Features</h2>
|
|
101
|
+
<p>Feature content...</p>
|
|
102
|
+
</section>
|
|
103
|
+
</snice-layout-landing>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### snice-layout-split
|
|
107
|
+
Two-panel layout with configurable split ratios.
|
|
108
|
+
|
|
109
|
+
```html
|
|
110
|
+
<snice-layout-split direction="horizontal" ratio="60-40">
|
|
111
|
+
<div slot="left">
|
|
112
|
+
<h2>Left Panel</h2>
|
|
113
|
+
<p>Content for left side</p>
|
|
114
|
+
</div>
|
|
115
|
+
<div slot="right">
|
|
116
|
+
<h2>Right Panel</h2>
|
|
117
|
+
<p>Content for right side</p>
|
|
118
|
+
</div>
|
|
119
|
+
</snice-layout-split>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
#### Properties
|
|
123
|
+
- `direction`: Split direction - `"horizontal"` | `"vertical"` (default: `"horizontal"`)
|
|
124
|
+
- `ratio`: Panel size ratio - `"50-50"` | `"60-40"` | `"70-30"` | `"33-67"` | `"67-33"` (default: `"50-50"`)
|
|
125
|
+
|
|
126
|
+
### snice-layout-card
|
|
127
|
+
Grid layout optimized for card-based content.
|
|
128
|
+
|
|
129
|
+
```html
|
|
130
|
+
<snice-layout-card columns="3" gap="lg">
|
|
131
|
+
<div slot="header">
|
|
132
|
+
<h1>Product Gallery</h1>
|
|
133
|
+
</div>
|
|
134
|
+
|
|
135
|
+
<!-- Cards go in main slot -->
|
|
136
|
+
<div class="card">Product 1</div>
|
|
137
|
+
<div class="card">Product 2</div>
|
|
138
|
+
<div class="card">Product 3</div>
|
|
139
|
+
</snice-layout-card>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
#### Properties
|
|
143
|
+
- `columns`: Number of columns - `"1"` | `"2"` | `"3"` | `"4"` | `"6"` (default: `"3"`)
|
|
144
|
+
- `gap`: Grid gap size - `"sm"` | `"md"` | `"lg"` | `"xl"` (default: `"md"`)
|
|
145
|
+
|
|
146
|
+
### snice-layout-blog
|
|
147
|
+
Article layout with sidebar for additional content.
|
|
148
|
+
|
|
149
|
+
```html
|
|
150
|
+
<snice-layout-blog>
|
|
151
|
+
<div slot="brand"><h1>My Blog</h1></div>
|
|
152
|
+
<nav slot="nav">
|
|
153
|
+
<a href="/">Home</a>
|
|
154
|
+
<a href="/archive">Archive</a>
|
|
155
|
+
</nav>
|
|
156
|
+
|
|
157
|
+
<!-- Article content -->
|
|
158
|
+
<article>
|
|
159
|
+
<h1>Blog Post Title</h1>
|
|
160
|
+
<p>Article content goes here...</p>
|
|
161
|
+
</article>
|
|
162
|
+
|
|
163
|
+
<div slot="sidebar">
|
|
164
|
+
<h3>Recent Posts</h3>
|
|
165
|
+
<ul>
|
|
166
|
+
<li><a href="/post1">Post 1</a></li>
|
|
167
|
+
<li><a href="/post2">Post 2</a></li>
|
|
168
|
+
</ul>
|
|
169
|
+
</div>
|
|
170
|
+
</snice-layout-blog>
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### snice-layout-dashboard
|
|
174
|
+
Complex dashboard layout with multiple content areas.
|
|
175
|
+
|
|
176
|
+
```html
|
|
177
|
+
<snice-layout-dashboard>
|
|
178
|
+
<div slot="brand"><h1>Analytics</h1></div>
|
|
179
|
+
<input slot="search" type="search" placeholder="Search...">
|
|
180
|
+
<div slot="user">Welcome, John!</div>
|
|
181
|
+
|
|
182
|
+
<nav slot="nav">
|
|
183
|
+
<a href="/dashboard">Overview</a>
|
|
184
|
+
<a href="/analytics">Analytics</a>
|
|
185
|
+
</nav>
|
|
186
|
+
|
|
187
|
+
<div slot="sidebar">
|
|
188
|
+
<h3>Quick Actions</h3>
|
|
189
|
+
<button>New Report</button>
|
|
190
|
+
</div>
|
|
191
|
+
|
|
192
|
+
<!-- Main dashboard content -->
|
|
193
|
+
<div>
|
|
194
|
+
<h2>Dashboard Overview</h2>
|
|
195
|
+
<div class="metrics">...</div>
|
|
196
|
+
</div>
|
|
197
|
+
|
|
198
|
+
<div slot="right-sidebar">
|
|
199
|
+
<h3>Recent Activity</h3>
|
|
200
|
+
<ul>...</ul>
|
|
201
|
+
</div>
|
|
202
|
+
</snice-layout-dashboard>
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### snice-layout-fullscreen
|
|
206
|
+
Immersive fullscreen layout for presentations, media viewers.
|
|
207
|
+
|
|
208
|
+
```html
|
|
209
|
+
<snice-layout-fullscreen overlay>
|
|
210
|
+
<img slot="background" src="background.jpg" alt="Background">
|
|
211
|
+
|
|
212
|
+
<div slot="overlay">
|
|
213
|
+
<h1>Overlay Content</h1>
|
|
214
|
+
</div>
|
|
215
|
+
|
|
216
|
+
<!-- Main fullscreen content -->
|
|
217
|
+
<div>
|
|
218
|
+
<h2>Centered Content</h2>
|
|
219
|
+
</div>
|
|
220
|
+
|
|
221
|
+
<div slot="controls">
|
|
222
|
+
<button>Play</button>
|
|
223
|
+
<button>Pause</button>
|
|
224
|
+
<button>Fullscreen</button>
|
|
225
|
+
</div>
|
|
226
|
+
</snice-layout-fullscreen>
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
#### Properties
|
|
230
|
+
- `overlay`: Show overlay background - `boolean` (default: `false`)
|
|
231
|
+
|
|
232
|
+
## Styling
|
|
233
|
+
|
|
234
|
+
All layout components use the Snice design system CSS custom properties for consistent theming. You can override these variables to customize the appearance:
|
|
235
|
+
|
|
236
|
+
```css
|
|
237
|
+
:root {
|
|
238
|
+
--snice-color-primary: #your-primary-color;
|
|
239
|
+
--snice-color-background: #your-background-color;
|
|
240
|
+
--snice-spacing-md: your-spacing-value;
|
|
241
|
+
/* ... other theme variables */
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Responsive Design
|
|
246
|
+
|
|
247
|
+
All layouts include responsive breakpoints and will adapt to mobile devices automatically. Most layouts stack vertically on small screens for optimal mobile experience.
|
|
248
|
+
|
|
249
|
+
## Events
|
|
250
|
+
|
|
251
|
+
Layout components are structural and don't emit custom events. However, you can listen for standard DOM events on slotted content:
|
|
252
|
+
|
|
253
|
+
```javascript
|
|
254
|
+
document.querySelector('snice-layout-sidebar')
|
|
255
|
+
.addEventListener('click', (e) => {
|
|
256
|
+
if (e.target.matches('.sidebar-toggle')) {
|
|
257
|
+
// Handle sidebar toggle
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
```
|