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.
Files changed (185) hide show
  1. package/bin/templates/base/tsconfig.json +5 -4
  2. package/components/accordion/demo.html +403 -0
  3. package/components/accordion/snice-accordion-item.css +85 -0
  4. package/components/accordion/snice-accordion-item.ts +226 -0
  5. package/components/accordion/snice-accordion.css +31 -0
  6. package/components/accordion/snice-accordion.ts +182 -0
  7. package/components/accordion/snice-accordion.types.ts +32 -0
  8. package/components/alert/demo.html +445 -0
  9. package/components/alert/snice-alert.css +195 -0
  10. package/components/alert/snice-alert.ts +141 -0
  11. package/components/alert/snice-alert.types.ts +12 -0
  12. package/components/avatar/demo.html +598 -0
  13. package/components/avatar/snice-avatar.css +131 -0
  14. package/components/avatar/snice-avatar.ts +136 -0
  15. package/components/avatar/snice-avatar.types.ts +13 -0
  16. package/components/badge/demo.html +523 -0
  17. package/components/badge/snice-badge.css +161 -0
  18. package/components/badge/snice-badge.ts +117 -0
  19. package/components/badge/snice-badge.types.ts +16 -0
  20. package/components/breadcrumbs/demo.html +404 -0
  21. package/components/breadcrumbs/snice-breadcrumbs.css +133 -0
  22. package/components/breadcrumbs/snice-breadcrumbs.ts +191 -0
  23. package/components/breadcrumbs/snice-breadcrumbs.types.ts +26 -0
  24. package/components/breadcrumbs/snice-crumb.ts +26 -0
  25. package/components/button/demo.html +42 -0
  26. package/components/button/snice-button.css +230 -0
  27. package/components/button/snice-button.ts +169 -0
  28. package/components/button/snice-button.types.ts +25 -0
  29. package/components/card/demo.html +525 -0
  30. package/components/card/snice-card.css +140 -0
  31. package/components/card/snice-card.ts +102 -0
  32. package/components/card/snice-card.types.ts +10 -0
  33. package/components/checkbox/demo.html +253 -0
  34. package/components/checkbox/snice-checkbox.css +164 -0
  35. package/components/checkbox/snice-checkbox.ts +223 -0
  36. package/components/checkbox/snice-checkbox.types.ts +22 -0
  37. package/components/chip/demo.html +383 -0
  38. package/components/chip/snice-chip.css +195 -0
  39. package/components/chip/snice-chip.ts +139 -0
  40. package/components/chip/snice-chip.types.ts +15 -0
  41. package/components/date-picker/README.md +233 -0
  42. package/components/date-picker/demo.html +191 -0
  43. package/components/date-picker/snice-date-picker.css +330 -0
  44. package/components/date-picker/snice-date-picker.ts +777 -0
  45. package/components/date-picker/snice-date-picker.types.ts +83 -0
  46. package/components/divider/demo.html +233 -0
  47. package/components/divider/snice-divider.css +155 -0
  48. package/components/divider/snice-divider.ts +69 -0
  49. package/components/divider/snice-divider.types.ts +15 -0
  50. package/components/drawer/demo.html +328 -0
  51. package/components/drawer/snice-drawer.css +476 -0
  52. package/components/drawer/snice-drawer.ts +287 -0
  53. package/components/drawer/snice-drawer.types.ts +17 -0
  54. package/components/global.d.ts +14 -0
  55. package/components/input/demo.html +303 -0
  56. package/components/input/snice-input.css +257 -0
  57. package/components/input/snice-input.ts +442 -0
  58. package/components/input/snice-input.types.ts +59 -0
  59. package/components/input/test.html +77 -0
  60. package/components/layout/README.md +260 -0
  61. package/components/layout/demo.html +538 -0
  62. package/components/layout/snice-layout-blog.css +129 -0
  63. package/components/layout/snice-layout-blog.ts +48 -0
  64. package/components/layout/snice-layout-card.css +104 -0
  65. package/components/layout/snice-layout-card.ts +35 -0
  66. package/components/layout/snice-layout-centered.css +51 -0
  67. package/components/layout/snice-layout-centered.ts +22 -0
  68. package/components/layout/snice-layout-dashboard.css +98 -0
  69. package/components/layout/snice-layout-dashboard.ts +45 -0
  70. package/components/layout/snice-layout-fullscreen.css +72 -0
  71. package/components/layout/snice-layout-fullscreen.ts +34 -0
  72. package/components/layout/snice-layout-landing.css +92 -0
  73. package/components/layout/snice-layout-landing.ts +47 -0
  74. package/components/layout/snice-layout-minimal.css +16 -0
  75. package/components/layout/snice-layout-minimal.ts +19 -0
  76. package/components/layout/snice-layout-sidebar.css +117 -0
  77. package/components/layout/snice-layout-sidebar.ts +48 -0
  78. package/components/layout/snice-layout-split.css +103 -0
  79. package/components/layout/snice-layout-split.ts +29 -0
  80. package/components/layout/snice-layout.css +72 -0
  81. package/components/layout/snice-layout.ts +35 -0
  82. package/components/layout/snice-layout.types.ts +5 -0
  83. package/components/login/demo-auth-controller.ts +185 -0
  84. package/components/login/demo.html +470 -0
  85. package/components/login/snice-login.css +204 -0
  86. package/components/login/snice-login.ts +337 -0
  87. package/components/login/snice-login.types.ts +34 -0
  88. package/components/modal/demo.html +291 -0
  89. package/components/modal/snice-modal.css +203 -0
  90. package/components/modal/snice-modal.ts +233 -0
  91. package/components/modal/snice-modal.types.ts +21 -0
  92. package/components/pagination/demo.html +395 -0
  93. package/components/pagination/snice-pagination.ts +333 -0
  94. package/components/pagination/snice-pagination.types.ts +21 -0
  95. package/components/progress/demo.html +510 -0
  96. package/components/progress/snice-progress.css +267 -0
  97. package/components/progress/snice-progress.ts +247 -0
  98. package/components/progress/snice-progress.types.ts +19 -0
  99. package/components/radio/demo.html +287 -0
  100. package/components/radio/snice-radio.css +171 -0
  101. package/components/radio/snice-radio.ts +218 -0
  102. package/components/radio/snice-radio.types.ts +21 -0
  103. package/components/select/demo.html +511 -0
  104. package/components/select/snice-option.ts +52 -0
  105. package/components/select/snice-option.types.ts +14 -0
  106. package/components/select/snice-select.css +392 -0
  107. package/components/select/snice-select.ts +796 -0
  108. package/components/select/snice-select.types.ts +55 -0
  109. package/components/skeleton/demo.html +514 -0
  110. package/components/skeleton/snice-skeleton.css +109 -0
  111. package/components/skeleton/snice-skeleton.ts +126 -0
  112. package/components/skeleton/snice-skeleton.types.ts +11 -0
  113. package/components/switch/demo.html +284 -0
  114. package/components/switch/snice-switch.css +221 -0
  115. package/components/switch/snice-switch.ts +229 -0
  116. package/components/switch/snice-switch.types.ts +23 -0
  117. package/components/symbols.ts +23 -0
  118. package/components/table/demo-table-controller.ts +100 -0
  119. package/components/table/demo.html +480 -0
  120. package/components/table/snice-cell-boolean.ts +112 -0
  121. package/components/table/snice-cell-date.ts +210 -0
  122. package/components/table/snice-cell-duration.ts +91 -0
  123. package/components/table/snice-cell-filesize.ts +90 -0
  124. package/components/table/snice-cell-number.ts +165 -0
  125. package/components/table/snice-cell-progress.ts +83 -0
  126. package/components/table/snice-cell-rating.ts +82 -0
  127. package/components/table/snice-cell-sparkline.ts +253 -0
  128. package/components/table/snice-cell-text.ts +125 -0
  129. package/components/table/snice-cell.css +296 -0
  130. package/components/table/snice-cell.ts +473 -0
  131. package/components/table/snice-column.ts +353 -0
  132. package/components/table/snice-header.css +243 -0
  133. package/components/table/snice-header.ts +261 -0
  134. package/components/table/snice-progress.ts +66 -0
  135. package/components/table/snice-rating.ts +45 -0
  136. package/components/table/snice-row.css +255 -0
  137. package/components/table/snice-row.ts +331 -0
  138. package/components/table/snice-table.css +241 -0
  139. package/components/table/snice-table.ts +737 -0
  140. package/components/table/snice-table.types.ts +158 -0
  141. package/components/tabs/demo.html +487 -0
  142. package/components/tabs/snice-tab-panel.css +264 -0
  143. package/components/tabs/snice-tab-panel.ts +47 -0
  144. package/components/tabs/snice-tab.css +96 -0
  145. package/components/tabs/snice-tab.ts +65 -0
  146. package/components/tabs/snice-tabs.css +189 -0
  147. package/components/tabs/snice-tabs.ts +332 -0
  148. package/components/tabs/snice-tabs.types.ts +28 -0
  149. package/components/theme/theme.css +234 -0
  150. package/components/toast/demo.html +329 -0
  151. package/components/toast/snice-toast-container.ts +256 -0
  152. package/components/toast/snice-toast.css +213 -0
  153. package/components/toast/snice-toast.ts +276 -0
  154. package/components/toast/snice-toast.types.ts +35 -0
  155. package/components/tooltip/demo.html +350 -0
  156. package/components/tooltip/snice-tooltip-portal.css +79 -0
  157. package/components/tooltip/snice-tooltip.css +117 -0
  158. package/components/tooltip/snice-tooltip.ts +612 -0
  159. package/components/tooltip/snice-tooltip.types.ts +32 -0
  160. package/components/transitions.ts +94 -0
  161. package/components/tsconfig.json +18 -0
  162. package/dist/index.cjs +441 -329
  163. package/dist/index.cjs.map +1 -1
  164. package/dist/index.cjs.min.map +1 -1
  165. package/dist/index.esm.js +441 -329
  166. package/dist/index.esm.js.map +1 -1
  167. package/dist/index.esm.min.js +3 -3
  168. package/dist/index.esm.min.js.map +1 -1
  169. package/dist/index.iife.js +441 -329
  170. package/dist/index.iife.js.map +1 -1
  171. package/dist/index.iife.min.js +3 -3
  172. package/dist/index.iife.min.js.map +1 -1
  173. package/dist/symbols.esm.js +1 -1
  174. package/dist/transitions.esm.js +1 -1
  175. package/dist/types/controller.d.ts +1 -1
  176. package/dist/types/element.d.ts +10 -10
  177. package/dist/types/events.d.ts +2 -2
  178. package/dist/types/index.d.ts +1 -1
  179. package/dist/types/observe.d.ts +1 -1
  180. package/dist/types/request-response.d.ts +2 -3
  181. package/dist/types/router.d.ts +1 -1
  182. package/package.json +9 -3
  183. package/dist/index.cjs.min +0 -15
  184. package/dist/symbols.cjs +0 -103
  185. package/dist/transitions.cjs +0 -219
@@ -0,0 +1,55 @@
1
+ export type SelectSize = 'small' | 'medium' | 'large';
2
+
3
+ export interface SelectOption {
4
+ value: string;
5
+ label: string;
6
+ disabled?: boolean;
7
+ selected?: boolean;
8
+ icon?: string;
9
+ }
10
+
11
+ export interface SniceOptionElement extends HTMLElement {
12
+ value: string;
13
+ label: string;
14
+ disabled: boolean;
15
+ selected: boolean;
16
+ optionData: SelectOption;
17
+ }
18
+
19
+ export interface SniceSelectElement extends HTMLElement {
20
+ value: string;
21
+ disabled: boolean;
22
+ required: boolean;
23
+ invalid: boolean;
24
+ readonly: boolean;
25
+ multiple: boolean;
26
+ searchable: boolean;
27
+ clearable: boolean;
28
+ open: boolean;
29
+ size: SelectSize;
30
+ name: string;
31
+ label: string;
32
+ placeholder: string;
33
+ maxHeight: string;
34
+ focus(): void;
35
+ blur(): void;
36
+ clear(): void;
37
+ openDropdown(): void;
38
+ closeDropdown(): void;
39
+ toggleDropdown(): void;
40
+ selectOption(value: string): void;
41
+ }
42
+
43
+ export interface SelectChangeDetail {
44
+ value: string | string[];
45
+ option?: SelectOption;
46
+ select: SniceSelectElement;
47
+ }
48
+
49
+ export interface SelectOpenDetail {
50
+ select: SniceSelectElement;
51
+ }
52
+
53
+ export interface SelectCloseDetail {
54
+ select: SniceSelectElement;
55
+ }
@@ -0,0 +1,514 @@
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 Skeleton Demo</title>
7
+ <link rel="stylesheet" href="../theme/theme.css">
8
+ <style>
9
+ body {
10
+ font-family: system-ui, -apple-system, sans-serif;
11
+ padding: 40px;
12
+ line-height: 1.6;
13
+ background: #f5f5f5;
14
+ }
15
+
16
+ .container {
17
+ max-width: 900px;
18
+ margin: 0 auto;
19
+ background: white;
20
+ padding: 40px;
21
+ border-radius: 8px;
22
+ box-shadow: 0 2px 8px rgba(0,0,0,0.1);
23
+ }
24
+
25
+ h1 {
26
+ color: #333;
27
+ border-bottom: 2px solid #e0e0e0;
28
+ padding-bottom: 10px;
29
+ }
30
+
31
+ h2 {
32
+ color: #555;
33
+ margin-top: 30px;
34
+ }
35
+
36
+ .demo-section {
37
+ margin: 30px 0;
38
+ padding: 20px;
39
+ background: #fafafa;
40
+ border-radius: 4px;
41
+ }
42
+
43
+ .demo-label {
44
+ display: block;
45
+ margin-bottom: 12px;
46
+ font-weight: 500;
47
+ color: #666;
48
+ font-size: 14px;
49
+ }
50
+
51
+ .skeleton-demo {
52
+ margin: 20px 0;
53
+ padding: 20px;
54
+ background: white;
55
+ border: 1px solid #e0e0e0;
56
+ border-radius: 4px;
57
+ }
58
+
59
+ .controls {
60
+ display: flex;
61
+ gap: 10px;
62
+ margin: 20px 0;
63
+ flex-wrap: wrap;
64
+ }
65
+
66
+ button {
67
+ padding: 8px 16px;
68
+ background: #3b82f6;
69
+ color: white;
70
+ border: none;
71
+ border-radius: 4px;
72
+ cursor: pointer;
73
+ font-size: 14px;
74
+ transition: background 0.2s;
75
+ }
76
+
77
+ button:hover {
78
+ background: #2563eb;
79
+ }
80
+
81
+ .card-demo {
82
+ display: grid;
83
+ grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
84
+ gap: 20px;
85
+ margin: 20px 0;
86
+ }
87
+
88
+ .card {
89
+ padding: 16px;
90
+ background: white;
91
+ border: 1px solid #e0e0e0;
92
+ border-radius: 8px;
93
+ }
94
+
95
+ .card-header {
96
+ display: flex;
97
+ align-items: center;
98
+ gap: 12px;
99
+ margin-bottom: 12px;
100
+ }
101
+
102
+ .list-item {
103
+ display: flex;
104
+ align-items: start;
105
+ gap: 16px;
106
+ padding: 16px;
107
+ background: white;
108
+ border: 1px solid #e0e0e0;
109
+ border-radius: 4px;
110
+ margin-bottom: 12px;
111
+ }
112
+
113
+ .list-content {
114
+ flex: 1;
115
+ }
116
+
117
+ .row {
118
+ display: flex;
119
+ gap: 12px;
120
+ align-items: center;
121
+ margin: 12px 0;
122
+ }
123
+
124
+ code {
125
+ background: #f0f0f0;
126
+ padding: 2px 6px;
127
+ border-radius: 3px;
128
+ font-size: 0.9em;
129
+ }
130
+
131
+ select {
132
+ padding: 6px 12px;
133
+ border: 1px solid #d1d5db;
134
+ border-radius: 4px;
135
+ background: white;
136
+ font-size: 14px;
137
+ }
138
+
139
+ input[type="number"] {
140
+ padding: 6px 12px;
141
+ border: 1px solid #d1d5db;
142
+ border-radius: 4px;
143
+ width: 80px;
144
+ font-size: 14px;
145
+ }
146
+
147
+ .inline-demo {
148
+ display: flex;
149
+ align-items: center;
150
+ gap: 12px;
151
+ font-size: 16px;
152
+ padding: 16px;
153
+ background: white;
154
+ border: 1px solid #e0e0e0;
155
+ border-radius: 4px;
156
+ }
157
+
158
+ .article-demo {
159
+ max-width: 600px;
160
+ padding: 20px;
161
+ background: white;
162
+ border: 1px solid #e0e0e0;
163
+ border-radius: 4px;
164
+ }
165
+
166
+ .article-header {
167
+ margin-bottom: 20px;
168
+ }
169
+
170
+ .article-meta {
171
+ display: flex;
172
+ gap: 16px;
173
+ margin: 12px 0;
174
+ }
175
+
176
+ .input-group {
177
+ margin: 12px 0;
178
+ }
179
+
180
+ .input-group label {
181
+ display: inline-block;
182
+ width: 120px;
183
+ font-size: 14px;
184
+ color: #666;
185
+ }
186
+ </style>
187
+ </head>
188
+ <body>
189
+ <div class="container">
190
+ <h1>Snice Skeleton Component Demo</h1>
191
+
192
+ <div class="demo-section">
193
+ <h2>Basic Skeletons</h2>
194
+
195
+ <span class="demo-label">Text Skeleton (Default)</span>
196
+ <div class="skeleton-demo">
197
+ <snice-skeleton variant="text" count="3"></snice-skeleton>
198
+ </div>
199
+
200
+ <span class="demo-label">Circular Skeleton</span>
201
+ <div class="skeleton-demo">
202
+ <div class="row">
203
+ <snice-skeleton variant="circular"></snice-skeleton>
204
+ <snice-skeleton variant="circular" width="60px" height="60px"></snice-skeleton>
205
+ <snice-skeleton variant="circular" width="80px" height="80px"></snice-skeleton>
206
+ </div>
207
+ </div>
208
+
209
+ <span class="demo-label">Rectangular Skeleton</span>
210
+ <div class="skeleton-demo">
211
+ <snice-skeleton variant="rectangular" height="200px"></snice-skeleton>
212
+ </div>
213
+
214
+ <span class="demo-label">Rounded Skeleton</span>
215
+ <div class="skeleton-demo">
216
+ <snice-skeleton variant="rounded" height="150px"></snice-skeleton>
217
+ </div>
218
+ </div>
219
+
220
+ <div class="demo-section">
221
+ <h2>Animation Types</h2>
222
+
223
+ <span class="demo-label">Wave Animation (Default)</span>
224
+ <div class="skeleton-demo">
225
+ <snice-skeleton variant="text" animation="wave" count="2"></snice-skeleton>
226
+ </div>
227
+
228
+ <span class="demo-label">Pulse Animation</span>
229
+ <div class="skeleton-demo">
230
+ <snice-skeleton variant="text" animation="pulse" count="2"></snice-skeleton>
231
+ </div>
232
+
233
+ <span class="demo-label">No Animation</span>
234
+ <div class="skeleton-demo">
235
+ <snice-skeleton variant="text" animation="none" count="2"></snice-skeleton>
236
+ </div>
237
+ </div>
238
+
239
+ <div class="demo-section">
240
+ <h2>Custom Sizing</h2>
241
+
242
+ <span class="demo-label">Custom Width Text</span>
243
+ <div class="skeleton-demo">
244
+ <snice-skeleton variant="text" width="200px"></snice-skeleton>
245
+ <snice-skeleton variant="text" width="350px"></snice-skeleton>
246
+ <snice-skeleton variant="text" width="150px"></snice-skeleton>
247
+ </div>
248
+
249
+ <span class="demo-label">Custom Dimensions</span>
250
+ <div class="skeleton-demo">
251
+ <div class="row">
252
+ <snice-skeleton variant="rounded" width="100px" height="100px"></snice-skeleton>
253
+ <snice-skeleton variant="rounded" width="150px" height="80px"></snice-skeleton>
254
+ <snice-skeleton variant="rounded" width="200px" height="60px"></snice-skeleton>
255
+ </div>
256
+ </div>
257
+ </div>
258
+
259
+ <div class="demo-section">
260
+ <h2>Multiple Items with Spacing</h2>
261
+
262
+ <span class="demo-label">Text Lines with Custom Spacing</span>
263
+ <div class="skeleton-demo">
264
+ <snice-skeleton variant="text" count="5" spacing="12px"></snice-skeleton>
265
+ </div>
266
+
267
+ <span class="demo-label">Grid of Rectangles</span>
268
+ <div class="skeleton-demo">
269
+ <div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;">
270
+ <snice-skeleton variant="rounded" height="100px"></snice-skeleton>
271
+ <snice-skeleton variant="rounded" height="100px"></snice-skeleton>
272
+ <snice-skeleton variant="rounded" height="100px"></snice-skeleton>
273
+ </div>
274
+ </div>
275
+ </div>
276
+
277
+ <div class="demo-section">
278
+ <h2>Real-world Examples</h2>
279
+
280
+ <span class="demo-label">Card Skeleton</span>
281
+ <div class="card-demo">
282
+ <div class="card">
283
+ <div class="card-header">
284
+ <snice-skeleton variant="circular" width="40px" height="40px"></snice-skeleton>
285
+ <div style="flex: 1;">
286
+ <snice-skeleton variant="text" width="120px" height="16px"></snice-skeleton>
287
+ <div style="margin-top: 4px;">
288
+ <snice-skeleton variant="text" width="80px" height="14px"></snice-skeleton>
289
+ </div>
290
+ </div>
291
+ </div>
292
+ <snice-skeleton variant="rounded" height="180px"></snice-skeleton>
293
+ <div style="margin-top: 12px;">
294
+ <snice-skeleton variant="text" count="2"></snice-skeleton>
295
+ </div>
296
+ </div>
297
+
298
+ <div class="card">
299
+ <div class="card-header">
300
+ <snice-skeleton variant="circular" width="40px" height="40px"></snice-skeleton>
301
+ <div style="flex: 1;">
302
+ <snice-skeleton variant="text" width="150px" height="16px"></snice-skeleton>
303
+ <div style="margin-top: 4px;">
304
+ <snice-skeleton variant="text" width="100px" height="14px"></snice-skeleton>
305
+ </div>
306
+ </div>
307
+ </div>
308
+ <snice-skeleton variant="rounded" height="180px"></snice-skeleton>
309
+ <div style="margin-top: 12px;">
310
+ <snice-skeleton variant="text" count="2"></snice-skeleton>
311
+ </div>
312
+ </div>
313
+ </div>
314
+
315
+ <span class="demo-label">List Item Skeleton</span>
316
+ <div class="skeleton-demo">
317
+ <div class="list-item">
318
+ <snice-skeleton variant="circular" width="48px" height="48px"></snice-skeleton>
319
+ <div class="list-content">
320
+ <snice-skeleton variant="text" width="200px" height="18px"></snice-skeleton>
321
+ <div style="margin-top: 8px;">
322
+ <snice-skeleton variant="text" width="100%" height="14px"></snice-skeleton>
323
+ <snice-skeleton variant="text" width="80%" height="14px" style="margin-top: 4px;"></snice-skeleton>
324
+ </div>
325
+ </div>
326
+ </div>
327
+
328
+ <div class="list-item">
329
+ <snice-skeleton variant="circular" width="48px" height="48px"></snice-skeleton>
330
+ <div class="list-content">
331
+ <snice-skeleton variant="text" width="250px" height="18px"></snice-skeleton>
332
+ <div style="margin-top: 8px;">
333
+ <snice-skeleton variant="text" width="100%" height="14px"></snice-skeleton>
334
+ <snice-skeleton variant="text" width="70%" height="14px" style="margin-top: 4px;"></snice-skeleton>
335
+ </div>
336
+ </div>
337
+ </div>
338
+ </div>
339
+
340
+ <span class="demo-label">Article Skeleton</span>
341
+ <div class="skeleton-demo">
342
+ <div class="article-demo">
343
+ <div class="article-header">
344
+ <snice-skeleton variant="text" width="80%" height="32px"></snice-skeleton>
345
+ <div class="article-meta">
346
+ <snice-skeleton variant="circular" width="32px" height="32px"></snice-skeleton>
347
+ <div style="flex: 1;">
348
+ <snice-skeleton variant="text" width="120px" height="16px"></snice-skeleton>
349
+ <snice-skeleton variant="text" width="80px" height="14px" style="margin-top: 4px;"></snice-skeleton>
350
+ </div>
351
+ </div>
352
+ </div>
353
+ <snice-skeleton variant="text" count="8" spacing="16px"></snice-skeleton>
354
+ </div>
355
+ </div>
356
+
357
+ <span class="demo-label">Inline Loading</span>
358
+ <div class="skeleton-demo">
359
+ <div class="inline-demo">
360
+ <span>Loading user data</span>
361
+ <snice-skeleton variant="text" width="120px" height="20px"></snice-skeleton>
362
+ <span>from server...</span>
363
+ </div>
364
+ </div>
365
+ </div>
366
+
367
+ <div class="demo-section">
368
+ <h2>Interactive Demo</h2>
369
+
370
+ <div class="controls">
371
+ <div class="input-group">
372
+ <label>Variant:</label>
373
+ <select id="variant-select">
374
+ <option value="text">Text</option>
375
+ <option value="circular">Circular</option>
376
+ <option value="rectangular">Rectangular</option>
377
+ <option value="rounded">Rounded</option>
378
+ </select>
379
+ </div>
380
+
381
+ <div class="input-group">
382
+ <label>Animation:</label>
383
+ <select id="animation-select">
384
+ <option value="wave">Wave</option>
385
+ <option value="pulse">Pulse</option>
386
+ <option value="none">None</option>
387
+ </select>
388
+ </div>
389
+
390
+ <div class="input-group">
391
+ <label>Count:</label>
392
+ <input type="number" id="count-input" value="1" min="1" max="10">
393
+ </div>
394
+
395
+ <button onclick="updateSkeleton()">Update</button>
396
+ <button onclick="toggleContent()">Toggle Content</button>
397
+ </div>
398
+
399
+ <div class="skeleton-demo" id="interactive-demo">
400
+ <div id="skeleton-container">
401
+ <snice-skeleton id="demo-skeleton" variant="text" count="3"></snice-skeleton>
402
+ </div>
403
+ <div id="content-container" style="display: none;">
404
+ <h3>Content Loaded!</h3>
405
+ <p>This is the actual content that appears after loading is complete. The skeleton provides a better user experience while waiting for data.</p>
406
+ </div>
407
+ </div>
408
+ </div>
409
+
410
+ <div class="demo-section">
411
+ <h2>Loading States Simulation</h2>
412
+
413
+ <button onclick="simulateLoading()">Simulate Loading</button>
414
+
415
+ <div class="skeleton-demo" id="simulation-demo">
416
+ <div id="simulation-skeleton">
417
+ <div class="card">
418
+ <div class="card-header">
419
+ <snice-skeleton variant="circular" width="40px" height="40px"></snice-skeleton>
420
+ <div style="flex: 1;">
421
+ <snice-skeleton variant="text" width="120px" height="16px"></snice-skeleton>
422
+ <div style="margin-top: 4px;">
423
+ <snice-skeleton variant="text" width="80px" height="14px"></snice-skeleton>
424
+ </div>
425
+ </div>
426
+ </div>
427
+ <snice-skeleton variant="rounded" height="180px"></snice-skeleton>
428
+ <div style="margin-top: 12px;">
429
+ <snice-skeleton variant="text" count="2"></snice-skeleton>
430
+ </div>
431
+ </div>
432
+ </div>
433
+ <div id="simulation-content" style="display: none;">
434
+ <div class="card">
435
+ <div class="card-header">
436
+ <div style="width: 40px; height: 40px; border-radius: 50%; background: #3b82f6; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold;">
437
+ JD
438
+ </div>
439
+ <div style="flex: 1;">
440
+ <div style="font-weight: 600;">John Doe</div>
441
+ <div style="font-size: 14px; color: #666; margin-top: 4px;">2 hours ago</div>
442
+ </div>
443
+ </div>
444
+ <div style="height: 180px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 8px;"></div>
445
+ <div style="margin-top: 12px;">
446
+ <p style="margin: 0;">Beautiful sunset captured during my evening walk. Nature never fails to amaze!</p>
447
+ </div>
448
+ </div>
449
+ </div>
450
+ </div>
451
+ </div>
452
+ </div>
453
+
454
+ <script type="module">
455
+ import './snice-skeleton.ts';
456
+
457
+ // Interactive demo
458
+ window.updateSkeleton = function() {
459
+ const skeleton = document.getElementById('demo-skeleton');
460
+ const variant = document.getElementById('variant-select').value;
461
+ const animation = document.getElementById('animation-select').value;
462
+ const count = parseInt(document.getElementById('count-input').value);
463
+
464
+ skeleton.variant = variant;
465
+ skeleton.animation = animation;
466
+ skeleton.count = count;
467
+
468
+ // Reset dimensions for different variants
469
+ if (variant === 'circular') {
470
+ skeleton.width = '60px';
471
+ skeleton.height = '60px';
472
+ } else if (variant === 'rectangular' || variant === 'rounded') {
473
+ skeleton.width = '';
474
+ skeleton.height = '150px';
475
+ } else {
476
+ skeleton.width = '';
477
+ skeleton.height = '';
478
+ }
479
+ };
480
+
481
+ window.toggleContent = function() {
482
+ const skeletonContainer = document.getElementById('skeleton-container');
483
+ const contentContainer = document.getElementById('content-container');
484
+
485
+ if (skeletonContainer.style.display === 'none') {
486
+ skeletonContainer.style.display = 'block';
487
+ contentContainer.style.display = 'none';
488
+ } else {
489
+ skeletonContainer.style.display = 'none';
490
+ contentContainer.style.display = 'block';
491
+ }
492
+ };
493
+
494
+ // Loading simulation
495
+ window.simulateLoading = function() {
496
+ const skeleton = document.getElementById('simulation-skeleton');
497
+ const content = document.getElementById('simulation-content');
498
+
499
+ skeleton.style.display = 'block';
500
+ content.style.display = 'none';
501
+
502
+ setTimeout(() => {
503
+ skeleton.style.display = 'none';
504
+ content.style.display = 'block';
505
+ }, 2000);
506
+ };
507
+
508
+ // Auto-update when variant changes
509
+ document.getElementById('variant-select').addEventListener('change', updateSkeleton);
510
+ document.getElementById('animation-select').addEventListener('change', updateSkeleton);
511
+ document.getElementById('count-input').addEventListener('input', updateSkeleton);
512
+ </script>
513
+ </body>
514
+ </html>
@@ -0,0 +1,109 @@
1
+ :host {
2
+ display: block;
3
+ --skeleton-bg: #e5e7eb;
4
+ --skeleton-highlight: #f3f4f6;
5
+ --skeleton-duration: 1.5s;
6
+ }
7
+
8
+ .skeleton-container {
9
+ display: flex;
10
+ flex-direction: column;
11
+ gap: var(--skeleton-spacing, 0.5rem); /* 8px */
12
+ width: 100%;
13
+ }
14
+
15
+ .skeleton {
16
+ background: var(--skeleton-bg);
17
+ overflow: hidden;
18
+ position: relative;
19
+ }
20
+
21
+ .skeleton-screen-reader {
22
+ position: absolute;
23
+ width: 1px;
24
+ height: 1px;
25
+ padding: 0;
26
+ margin: -1px;
27
+ overflow: hidden;
28
+ clip: rect(0, 0, 0, 0);
29
+ white-space: nowrap;
30
+ border: 0;
31
+ }
32
+
33
+ /* Variants */
34
+ .skeleton--text {
35
+ height: 1em;
36
+ border-radius: 4px;
37
+ width: var(--skeleton-width, 100%);
38
+ }
39
+
40
+ .skeleton--circular {
41
+ width: var(--skeleton-width, 2.5rem); /* 40px */
42
+ height: var(--skeleton-height, 2.5rem); /* 40px */
43
+ border-radius: 50%;
44
+ }
45
+
46
+ .skeleton--rectangular {
47
+ width: var(--skeleton-width, 100%);
48
+ height: var(--skeleton-height, 6.25rem); /* 100px */
49
+ border-radius: 0;
50
+ }
51
+
52
+ .skeleton--rounded {
53
+ width: var(--skeleton-width, 100%);
54
+ height: var(--skeleton-height, 6.25rem); /* 100px */
55
+ border-radius: 8px;
56
+ }
57
+
58
+ /* Animations */
59
+ .skeleton--pulse {
60
+ animation: skeleton-pulse var(--skeleton-duration) ease-in-out infinite;
61
+ }
62
+
63
+ @keyframes skeleton-pulse {
64
+ 0%, 100% {
65
+ opacity: 1;
66
+ }
67
+ 50% {
68
+ opacity: 0.5;
69
+ }
70
+ }
71
+
72
+ /* Wave animation */
73
+ .skeleton--wave::after {
74
+ content: '';
75
+ position: absolute;
76
+ top: 0;
77
+ left: 0;
78
+ right: 0;
79
+ bottom: 0;
80
+ background: linear-gradient(
81
+ 90deg,
82
+ transparent,
83
+ var(--skeleton-highlight),
84
+ transparent
85
+ );
86
+ transform: translateX(-100%);
87
+ animation: skeleton-wave var(--skeleton-duration) linear infinite;
88
+ }
89
+
90
+ @keyframes skeleton-wave {
91
+ 0% {
92
+ transform: translateX(-100%);
93
+ }
94
+ 100% {
95
+ transform: translateX(100%);
96
+ }
97
+ }
98
+
99
+ /* Multiple skeletons with varied widths for text */
100
+ :host([variant="text"]) .skeleton:nth-child(1) { width: 100%; }
101
+ :host([variant="text"]) .skeleton:nth-child(2) { width: 90%; }
102
+ :host([variant="text"]) .skeleton:nth-child(3) { width: 95%; }
103
+ :host([variant="text"]) .skeleton:nth-child(4) { width: 85%; }
104
+ :host([variant="text"]) .skeleton:nth-child(5) { width: 92%; }
105
+
106
+ /* Last line shorter for paragraph effect */
107
+ :host([variant="text"]) .skeleton:last-child:not(:only-child) {
108
+ width: 60%;
109
+ }