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,510 @@
|
|
|
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>Snice Progress Demo</title>
|
|
7
|
+
<style>
|
|
8
|
+
body {
|
|
9
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
10
|
+
padding: 40px;
|
|
11
|
+
line-height: 1.6;
|
|
12
|
+
background: #f5f5f5;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.container {
|
|
16
|
+
max-width: 900px;
|
|
17
|
+
margin: 0 auto;
|
|
18
|
+
background: white;
|
|
19
|
+
padding: 40px;
|
|
20
|
+
border-radius: 8px;
|
|
21
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
h1 {
|
|
25
|
+
color: #333;
|
|
26
|
+
border-bottom: 2px solid #e0e0e0;
|
|
27
|
+
padding-bottom: 10px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
h2 {
|
|
31
|
+
color: #555;
|
|
32
|
+
margin-top: 30px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.demo-section {
|
|
36
|
+
margin: 30px 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.demo-item {
|
|
40
|
+
margin: 20px 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.demo-label {
|
|
44
|
+
display: block;
|
|
45
|
+
margin-bottom: 8px;
|
|
46
|
+
font-weight: 500;
|
|
47
|
+
color: #666;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.demo-grid {
|
|
51
|
+
display: grid;
|
|
52
|
+
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
|
53
|
+
gap: 30px;
|
|
54
|
+
margin: 20px 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.controls {
|
|
58
|
+
display: flex;
|
|
59
|
+
gap: 10px;
|
|
60
|
+
margin: 20px 0;
|
|
61
|
+
flex-wrap: wrap;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
button {
|
|
65
|
+
padding: 8px 16px;
|
|
66
|
+
background: #3b82f6;
|
|
67
|
+
color: white;
|
|
68
|
+
border: none;
|
|
69
|
+
border-radius: 4px;
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
font-size: 14px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
button:hover {
|
|
75
|
+
background: #2563eb;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
button:disabled {
|
|
79
|
+
background: #9ca3af;
|
|
80
|
+
cursor: not-allowed;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
input[type="range"] {
|
|
84
|
+
width: 200px;
|
|
85
|
+
margin: 0 10px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.circular-demo {
|
|
89
|
+
display: flex;
|
|
90
|
+
gap: 40px;
|
|
91
|
+
align-items: center;
|
|
92
|
+
flex-wrap: wrap;
|
|
93
|
+
margin: 20px 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.status {
|
|
97
|
+
padding: 12px;
|
|
98
|
+
background: #f0f9ff;
|
|
99
|
+
border: 1px solid #0ea5e9;
|
|
100
|
+
border-radius: 4px;
|
|
101
|
+
color: #0369a1;
|
|
102
|
+
margin-top: 20px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
code {
|
|
106
|
+
background: #f0f0f0;
|
|
107
|
+
padding: 2px 6px;
|
|
108
|
+
border-radius: 3px;
|
|
109
|
+
font-size: 0.9em;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.custom-progress {
|
|
113
|
+
--progress-height: 16px;
|
|
114
|
+
--progress-radius: 8px;
|
|
115
|
+
--progress-bg: #fef3c7;
|
|
116
|
+
--progress-color: #f59e0b;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.space-y {
|
|
120
|
+
display: flex;
|
|
121
|
+
flex-direction: column;
|
|
122
|
+
gap: 20px;
|
|
123
|
+
}
|
|
124
|
+
</style>
|
|
125
|
+
</head>
|
|
126
|
+
<body>
|
|
127
|
+
<div class="container">
|
|
128
|
+
<h1>Snice Progress Component Demo</h1>
|
|
129
|
+
|
|
130
|
+
<div class="demo-section">
|
|
131
|
+
<h2>Basic Linear Progress</h2>
|
|
132
|
+
|
|
133
|
+
<div class="demo-item">
|
|
134
|
+
<span class="demo-label">Default (0%)</span>
|
|
135
|
+
<snice-progress></snice-progress>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<div class="demo-item">
|
|
139
|
+
<span class="demo-label">25% Complete</span>
|
|
140
|
+
<snice-progress value="25"></snice-progress>
|
|
141
|
+
</div>
|
|
142
|
+
|
|
143
|
+
<div class="demo-item">
|
|
144
|
+
<span class="demo-label">50% Complete</span>
|
|
145
|
+
<snice-progress value="50"></snice-progress>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<div class="demo-item">
|
|
149
|
+
<span class="demo-label">75% Complete</span>
|
|
150
|
+
<snice-progress value="75"></snice-progress>
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
<div class="demo-item">
|
|
154
|
+
<span class="demo-label">100% Complete</span>
|
|
155
|
+
<snice-progress value="100"></snice-progress>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
|
|
159
|
+
<div class="demo-section">
|
|
160
|
+
<h2>Interactive Progress</h2>
|
|
161
|
+
|
|
162
|
+
<div class="demo-item">
|
|
163
|
+
<span class="demo-label">Adjust Progress: <span id="progress-value">50</span>%</span>
|
|
164
|
+
<input type="range" min="0" max="100" value="50" id="progress-slider">
|
|
165
|
+
<snice-progress id="interactive-progress" value="50" show-label></snice-progress>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<div class="controls">
|
|
169
|
+
<button onclick="startProgress()">Start</button>
|
|
170
|
+
<button onclick="pauseProgress()">Pause</button>
|
|
171
|
+
<button onclick="resetProgress()">Reset</button>
|
|
172
|
+
<button onclick="completeProgress()">Complete</button>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
|
|
176
|
+
<div class="demo-section">
|
|
177
|
+
<h2>Sizes</h2>
|
|
178
|
+
|
|
179
|
+
<div class="space-y">
|
|
180
|
+
<div class="demo-item">
|
|
181
|
+
<span class="demo-label">Small</span>
|
|
182
|
+
<snice-progress value="60" size="small"></snice-progress>
|
|
183
|
+
</div>
|
|
184
|
+
|
|
185
|
+
<div class="demo-item">
|
|
186
|
+
<span class="demo-label">Medium (Default)</span>
|
|
187
|
+
<snice-progress value="60" size="medium"></snice-progress>
|
|
188
|
+
</div>
|
|
189
|
+
|
|
190
|
+
<div class="demo-item">
|
|
191
|
+
<span class="demo-label">Large</span>
|
|
192
|
+
<snice-progress value="60" size="large"></snice-progress>
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
|
|
197
|
+
<div class="demo-section">
|
|
198
|
+
<h2>Colors</h2>
|
|
199
|
+
|
|
200
|
+
<div class="space-y">
|
|
201
|
+
<div class="demo-item">
|
|
202
|
+
<span class="demo-label">Primary</span>
|
|
203
|
+
<snice-progress value="70" color="primary"></snice-progress>
|
|
204
|
+
</div>
|
|
205
|
+
|
|
206
|
+
<div class="demo-item">
|
|
207
|
+
<span class="demo-label">Success</span>
|
|
208
|
+
<snice-progress value="70" color="success"></snice-progress>
|
|
209
|
+
</div>
|
|
210
|
+
|
|
211
|
+
<div class="demo-item">
|
|
212
|
+
<span class="demo-label">Warning</span>
|
|
213
|
+
<snice-progress value="70" color="warning"></snice-progress>
|
|
214
|
+
</div>
|
|
215
|
+
|
|
216
|
+
<div class="demo-item">
|
|
217
|
+
<span class="demo-label">Error</span>
|
|
218
|
+
<snice-progress value="70" color="error"></snice-progress>
|
|
219
|
+
</div>
|
|
220
|
+
|
|
221
|
+
<div class="demo-item">
|
|
222
|
+
<span class="demo-label">Info</span>
|
|
223
|
+
<snice-progress value="70" color="info"></snice-progress>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
|
|
228
|
+
<div class="demo-section">
|
|
229
|
+
<h2>Striped & Animated</h2>
|
|
230
|
+
|
|
231
|
+
<div class="space-y">
|
|
232
|
+
<div class="demo-item">
|
|
233
|
+
<span class="demo-label">Striped</span>
|
|
234
|
+
<snice-progress value="60" striped></snice-progress>
|
|
235
|
+
</div>
|
|
236
|
+
|
|
237
|
+
<div class="demo-item">
|
|
238
|
+
<span class="demo-label">Striped & Animated</span>
|
|
239
|
+
<snice-progress value="60" striped animated></snice-progress>
|
|
240
|
+
</div>
|
|
241
|
+
|
|
242
|
+
<div class="demo-item">
|
|
243
|
+
<span class="demo-label">Animated with Label</span>
|
|
244
|
+
<snice-progress value="75" striped animated show-label color="success"></snice-progress>
|
|
245
|
+
</div>
|
|
246
|
+
</div>
|
|
247
|
+
</div>
|
|
248
|
+
|
|
249
|
+
<div class="demo-section">
|
|
250
|
+
<h2>Indeterminate State</h2>
|
|
251
|
+
|
|
252
|
+
<div class="space-y">
|
|
253
|
+
<div class="demo-item">
|
|
254
|
+
<span class="demo-label">Loading... (Indeterminate)</span>
|
|
255
|
+
<snice-progress indeterminate></snice-progress>
|
|
256
|
+
</div>
|
|
257
|
+
|
|
258
|
+
<div class="demo-item">
|
|
259
|
+
<span class="demo-label">Indeterminate with Custom Color</span>
|
|
260
|
+
<snice-progress indeterminate color="warning"></snice-progress>
|
|
261
|
+
</div>
|
|
262
|
+
</div>
|
|
263
|
+
</div>
|
|
264
|
+
|
|
265
|
+
<div class="demo-section">
|
|
266
|
+
<h2>With Labels</h2>
|
|
267
|
+
|
|
268
|
+
<div class="space-y">
|
|
269
|
+
<div class="demo-item">
|
|
270
|
+
<span class="demo-label">Percentage Label</span>
|
|
271
|
+
<snice-progress value="45" show-label></snice-progress>
|
|
272
|
+
</div>
|
|
273
|
+
|
|
274
|
+
<div class="demo-item">
|
|
275
|
+
<span class="demo-label">Custom Label</span>
|
|
276
|
+
<snice-progress value="60" show-label label="Processing..."></snice-progress>
|
|
277
|
+
</div>
|
|
278
|
+
|
|
279
|
+
<div class="demo-item">
|
|
280
|
+
<span class="demo-label">Step Progress</span>
|
|
281
|
+
<snice-progress id="step-progress" value="3" max="5" show-label label="Step 3 of 5"></snice-progress>
|
|
282
|
+
</div>
|
|
283
|
+
</div>
|
|
284
|
+
</div>
|
|
285
|
+
|
|
286
|
+
<div class="demo-section">
|
|
287
|
+
<h2>Circular Progress</h2>
|
|
288
|
+
|
|
289
|
+
<div class="circular-demo">
|
|
290
|
+
<div>
|
|
291
|
+
<span class="demo-label">Small</span>
|
|
292
|
+
<snice-progress variant="circular" value="75" size="small" show-label></snice-progress>
|
|
293
|
+
</div>
|
|
294
|
+
|
|
295
|
+
<div>
|
|
296
|
+
<span class="demo-label">Medium</span>
|
|
297
|
+
<snice-progress variant="circular" value="60" size="medium" show-label></snice-progress>
|
|
298
|
+
</div>
|
|
299
|
+
|
|
300
|
+
<div>
|
|
301
|
+
<span class="demo-label">Large</span>
|
|
302
|
+
<snice-progress variant="circular" value="85" size="large" show-label></snice-progress>
|
|
303
|
+
</div>
|
|
304
|
+
|
|
305
|
+
<div>
|
|
306
|
+
<span class="demo-label">XL</span>
|
|
307
|
+
<snice-progress variant="circular" value="90" size="xl" show-label></snice-progress>
|
|
308
|
+
</div>
|
|
309
|
+
|
|
310
|
+
<div>
|
|
311
|
+
<span class="demo-label">XXL</span>
|
|
312
|
+
<snice-progress variant="circular" value="95" size="xxl" show-label></snice-progress>
|
|
313
|
+
</div>
|
|
314
|
+
|
|
315
|
+
<div>
|
|
316
|
+
<span class="demo-label">XXXL</span>
|
|
317
|
+
<snice-progress variant="circular" value="100" size="xxxl" show-label></snice-progress>
|
|
318
|
+
</div>
|
|
319
|
+
</div>
|
|
320
|
+
</div>
|
|
321
|
+
|
|
322
|
+
<div class="demo-section">
|
|
323
|
+
<h2>Circular Colors</h2>
|
|
324
|
+
|
|
325
|
+
<div class="circular-demo">
|
|
326
|
+
<snice-progress variant="circular" value="80" color="primary" show-label></snice-progress>
|
|
327
|
+
<snice-progress variant="circular" value="90" color="success" show-label></snice-progress>
|
|
328
|
+
<snice-progress variant="circular" value="70" color="warning" show-label></snice-progress>
|
|
329
|
+
<snice-progress variant="circular" value="60" color="error" show-label></snice-progress>
|
|
330
|
+
<snice-progress variant="circular" value="50" color="info" show-label></snice-progress>
|
|
331
|
+
</div>
|
|
332
|
+
</div>
|
|
333
|
+
|
|
334
|
+
<div class="demo-section">
|
|
335
|
+
<h2>Circular Indeterminate (Spinner)</h2>
|
|
336
|
+
|
|
337
|
+
<div class="circular-demo">
|
|
338
|
+
<div>
|
|
339
|
+
<span class="demo-label">Small Spinner</span>
|
|
340
|
+
<snice-progress variant="circular" indeterminate size="small"></snice-progress>
|
|
341
|
+
</div>
|
|
342
|
+
|
|
343
|
+
<div>
|
|
344
|
+
<span class="demo-label">Medium Spinner</span>
|
|
345
|
+
<snice-progress variant="circular" indeterminate size="medium"></snice-progress>
|
|
346
|
+
</div>
|
|
347
|
+
|
|
348
|
+
<div>
|
|
349
|
+
<span class="demo-label">Large Spinner</span>
|
|
350
|
+
<snice-progress variant="circular" indeterminate size="large" color="success"></snice-progress>
|
|
351
|
+
</div>
|
|
352
|
+
</div>
|
|
353
|
+
</div>
|
|
354
|
+
|
|
355
|
+
<div class="demo-section">
|
|
356
|
+
<h2>Custom Styling</h2>
|
|
357
|
+
|
|
358
|
+
<div class="demo-item">
|
|
359
|
+
<span class="demo-label">Custom Colors and Height</span>
|
|
360
|
+
<snice-progress value="65" class="custom-progress" show-label></snice-progress>
|
|
361
|
+
</div>
|
|
362
|
+
</div>
|
|
363
|
+
|
|
364
|
+
<div class="demo-section">
|
|
365
|
+
<h2>Real-world Examples</h2>
|
|
366
|
+
|
|
367
|
+
<div class="space-y">
|
|
368
|
+
<div class="demo-item">
|
|
369
|
+
<span class="demo-label">File Upload: <span id="upload-status">0%</span></span>
|
|
370
|
+
<snice-progress id="upload-progress" value="0" show-label color="info"></snice-progress>
|
|
371
|
+
<button onclick="simulateUpload()" style="margin-top: 10px">Simulate Upload</button>
|
|
372
|
+
</div>
|
|
373
|
+
|
|
374
|
+
<div class="demo-item">
|
|
375
|
+
<span class="demo-label">System Resources</span>
|
|
376
|
+
<div style="margin: 10px 0">
|
|
377
|
+
<small>CPU Usage</small>
|
|
378
|
+
<snice-progress value="45" color="primary" size="small"></snice-progress>
|
|
379
|
+
</div>
|
|
380
|
+
<div style="margin: 10px 0">
|
|
381
|
+
<small>Memory Usage</small>
|
|
382
|
+
<snice-progress value="72" color="warning" size="small"></snice-progress>
|
|
383
|
+
</div>
|
|
384
|
+
<div style="margin: 10px 0">
|
|
385
|
+
<small>Disk Usage</small>
|
|
386
|
+
<snice-progress value="89" color="error" size="small"></snice-progress>
|
|
387
|
+
</div>
|
|
388
|
+
</div>
|
|
389
|
+
</div>
|
|
390
|
+
</div>
|
|
391
|
+
|
|
392
|
+
<div class="demo-section">
|
|
393
|
+
<h2>Events</h2>
|
|
394
|
+
<div class="demo-item">
|
|
395
|
+
<span class="demo-label">Progress with Events</span>
|
|
396
|
+
<snice-progress id="event-progress" value="30" show-label></snice-progress>
|
|
397
|
+
<div class="controls">
|
|
398
|
+
<button onclick="increaseProgress()">+10%</button>
|
|
399
|
+
<button onclick="decreaseProgress()">-10%</button>
|
|
400
|
+
</div>
|
|
401
|
+
<div id="event-log" class="status">
|
|
402
|
+
Event log will appear here...
|
|
403
|
+
</div>
|
|
404
|
+
</div>
|
|
405
|
+
</div>
|
|
406
|
+
</div>
|
|
407
|
+
|
|
408
|
+
<script type="module">
|
|
409
|
+
import './snice-progress.ts';
|
|
410
|
+
|
|
411
|
+
// Interactive progress
|
|
412
|
+
const slider = document.getElementById('progress-slider');
|
|
413
|
+
const progressValue = document.getElementById('progress-value');
|
|
414
|
+
const interactiveProgress = document.getElementById('interactive-progress');
|
|
415
|
+
|
|
416
|
+
slider.addEventListener('input', (e) => {
|
|
417
|
+
const value = e.target.value;
|
|
418
|
+
progressValue.textContent = value;
|
|
419
|
+
interactiveProgress.value = value;
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
// Progress animation
|
|
423
|
+
let progressInterval;
|
|
424
|
+
let currentProgress = 0;
|
|
425
|
+
|
|
426
|
+
window.startProgress = function() {
|
|
427
|
+
if (progressInterval) return;
|
|
428
|
+
|
|
429
|
+
progressInterval = setInterval(() => {
|
|
430
|
+
currentProgress += 1;
|
|
431
|
+
if (currentProgress >= 100) {
|
|
432
|
+
currentProgress = 100;
|
|
433
|
+
clearInterval(progressInterval);
|
|
434
|
+
progressInterval = null;
|
|
435
|
+
}
|
|
436
|
+
interactiveProgress.value = currentProgress;
|
|
437
|
+
slider.value = currentProgress;
|
|
438
|
+
progressValue.textContent = currentProgress;
|
|
439
|
+
}, 50);
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
window.pauseProgress = function() {
|
|
443
|
+
if (progressInterval) {
|
|
444
|
+
clearInterval(progressInterval);
|
|
445
|
+
progressInterval = null;
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
window.resetProgress = function() {
|
|
450
|
+
window.pauseProgress();
|
|
451
|
+
currentProgress = 0;
|
|
452
|
+
interactiveProgress.value = 0;
|
|
453
|
+
slider.value = 0;
|
|
454
|
+
progressValue.textContent = 0;
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
window.completeProgress = function() {
|
|
458
|
+
window.pauseProgress();
|
|
459
|
+
currentProgress = 100;
|
|
460
|
+
interactiveProgress.value = 100;
|
|
461
|
+
slider.value = 100;
|
|
462
|
+
progressValue.textContent = 100;
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
// Upload simulation
|
|
466
|
+
window.simulateUpload = function() {
|
|
467
|
+
const uploadProgress = document.getElementById('upload-progress');
|
|
468
|
+
const uploadStatus = document.getElementById('upload-status');
|
|
469
|
+
let progress = 0;
|
|
470
|
+
|
|
471
|
+
uploadProgress.indeterminate = true;
|
|
472
|
+
uploadStatus.textContent = 'Preparing...';
|
|
473
|
+
|
|
474
|
+
setTimeout(() => {
|
|
475
|
+
uploadProgress.indeterminate = false;
|
|
476
|
+
|
|
477
|
+
const interval = setInterval(() => {
|
|
478
|
+
progress += Math.random() * 15;
|
|
479
|
+
if (progress >= 100) {
|
|
480
|
+
progress = 100;
|
|
481
|
+
clearInterval(interval);
|
|
482
|
+
uploadStatus.textContent = 'Complete!';
|
|
483
|
+
} else {
|
|
484
|
+
uploadStatus.textContent = `${Math.round(progress)}%`;
|
|
485
|
+
}
|
|
486
|
+
uploadProgress.value = progress;
|
|
487
|
+
}, 300);
|
|
488
|
+
}, 1000);
|
|
489
|
+
};
|
|
490
|
+
|
|
491
|
+
// Event handling
|
|
492
|
+
const eventProgress = document.getElementById('event-progress');
|
|
493
|
+
const eventLog = document.getElementById('event-log');
|
|
494
|
+
|
|
495
|
+
eventProgress.addEventListener('progress-change', (e) => {
|
|
496
|
+
eventLog.textContent = `Progress changed: ${e.detail.value}/${e.detail.max} (${e.detail.percentage.toFixed(1)}%)`;
|
|
497
|
+
});
|
|
498
|
+
|
|
499
|
+
window.increaseProgress = function() {
|
|
500
|
+
const newValue = Math.min(100, eventProgress.value + 10);
|
|
501
|
+
eventProgress.setProgress(newValue);
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
window.decreaseProgress = function() {
|
|
505
|
+
const newValue = Math.max(0, eventProgress.value - 10);
|
|
506
|
+
eventProgress.setProgress(newValue);
|
|
507
|
+
};
|
|
508
|
+
</script>
|
|
509
|
+
</body>
|
|
510
|
+
</html>
|