snice 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -41
- package/dist/components/accordion/snice-accordion-item.js +1 -1
- package/dist/components/accordion/snice-accordion-item.js.map +1 -1
- package/dist/components/accordion/snice-accordion.js +1 -1
- package/dist/components/accordion/snice-accordion.js.map +1 -1
- package/dist/components/alert/snice-alert.js +1 -1
- package/dist/components/alert/snice-alert.js.map +1 -1
- package/dist/components/avatar/snice-avatar.js +1 -1
- package/dist/components/avatar/snice-avatar.js.map +1 -1
- package/dist/components/badge/snice-badge.js +1 -1
- package/dist/components/badge/snice-badge.js.map +1 -1
- package/dist/components/banner/snice-banner.d.ts +22 -0
- package/dist/components/banner/snice-banner.js +180 -0
- package/dist/components/banner/snice-banner.js.map +1 -0
- package/dist/components/banner/snice-banner.types.d.ts +14 -0
- package/dist/components/breadcrumbs/snice-breadcrumbs.js +1 -1
- package/dist/components/breadcrumbs/snice-breadcrumbs.js.map +1 -1
- package/dist/components/button/snice-button.js +1 -1
- package/dist/components/button/snice-button.js.map +1 -1
- package/dist/components/card/snice-card.js +1 -1
- package/dist/components/card/snice-card.js.map +1 -1
- package/dist/components/checkbox/snice-checkbox.js +1 -1
- package/dist/components/checkbox/snice-checkbox.js.map +1 -1
- package/dist/components/chip/snice-chip.js +1 -1
- package/dist/components/chip/snice-chip.js.map +1 -1
- package/dist/components/color-display/snice-color-display.d.ts +14 -0
- package/dist/components/color-display/snice-color-display.js +151 -0
- package/dist/components/color-display/snice-color-display.js.map +1 -0
- package/dist/components/color-display/snice-color-display.types.d.ts +10 -0
- package/dist/components/color-picker/snice-color-picker.d.ts +50 -0
- package/dist/components/color-picker/snice-color-picker.js +489 -0
- package/dist/components/color-picker/snice-color-picker.js.map +1 -0
- package/dist/components/color-picker/snice-color-picker.types.d.ts +19 -0
- package/dist/components/date-picker/snice-date-picker.js +1 -1
- package/dist/components/date-picker/snice-date-picker.js.map +1 -1
- package/dist/components/divider/snice-divider.js +1 -1
- package/dist/components/divider/snice-divider.js.map +1 -1
- package/dist/components/drawer/snice-drawer.js +1 -1
- package/dist/components/drawer/snice-drawer.js.map +1 -1
- package/dist/components/empty-state/snice-empty-state.d.ts +13 -0
- package/dist/components/empty-state/snice-empty-state.js +121 -0
- package/dist/components/empty-state/snice-empty-state.js.map +1 -0
- package/dist/components/empty-state/snice-empty-state.types.d.ts +9 -0
- package/dist/components/file-upload/snice-file-upload.d.ts +45 -0
- package/dist/components/file-upload/snice-file-upload.js +394 -0
- package/dist/components/file-upload/snice-file-upload.js.map +1 -0
- package/dist/components/file-upload/snice-file-upload.types.d.ts +22 -0
- package/dist/components/image/snice-image.d.ts +22 -0
- package/dist/components/image/snice-image.js +201 -0
- package/dist/components/image/snice-image.js.map +1 -0
- package/dist/components/image/snice-image.types.d.ts +17 -0
- package/dist/components/input/snice-input.js +1 -1
- package/dist/components/input/snice-input.js.map +1 -1
- package/dist/components/kpi/snice-kpi.d.ts +16 -0
- package/dist/components/kpi/snice-kpi.js +162 -0
- package/dist/components/kpi/snice-kpi.js.map +1 -0
- package/dist/components/kpi/snice-kpi.types.d.ts +12 -0
- package/dist/components/layout/snice-layout-blog.js +1 -1
- package/dist/components/layout/snice-layout-blog.js.map +1 -1
- package/dist/components/layout/snice-layout-card.js +1 -1
- package/dist/components/layout/snice-layout-card.js.map +1 -1
- package/dist/components/layout/snice-layout-centered.js +1 -1
- package/dist/components/layout/snice-layout-centered.js.map +1 -1
- package/dist/components/layout/snice-layout-dashboard.js +1 -1
- package/dist/components/layout/snice-layout-dashboard.js.map +1 -1
- package/dist/components/layout/snice-layout-fullscreen.js +1 -1
- package/dist/components/layout/snice-layout-fullscreen.js.map +1 -1
- package/dist/components/layout/snice-layout-landing.js +1 -1
- package/dist/components/layout/snice-layout-landing.js.map +1 -1
- package/dist/components/layout/snice-layout-minimal.js +1 -1
- package/dist/components/layout/snice-layout-minimal.js.map +1 -1
- package/dist/components/layout/snice-layout-sidebar.js +1 -1
- package/dist/components/layout/snice-layout-sidebar.js.map +1 -1
- package/dist/components/layout/snice-layout-split.js +1 -1
- package/dist/components/layout/snice-layout-split.js.map +1 -1
- package/dist/components/layout/snice-layout.js +1 -1
- package/dist/components/layout/snice-layout.js.map +1 -1
- package/dist/components/link/snice-link.d.ts +13 -0
- package/dist/components/link/snice-link.js +137 -0
- package/dist/components/link/snice-link.js.map +1 -0
- package/dist/components/link/snice-link.types.d.ts +11 -0
- package/dist/components/login/snice-login.js +1 -1
- package/dist/components/login/snice-login.js.map +1 -1
- package/dist/components/modal/snice-modal.js +1 -1
- package/dist/components/modal/snice-modal.js.map +1 -1
- package/dist/components/nav/snice-nav.js +1 -1
- package/dist/components/nav/snice-nav.js.map +1 -1
- package/dist/components/progress/snice-progress.js +1 -1
- package/dist/components/progress/snice-progress.js.map +1 -1
- package/dist/components/radio/snice-radio.js +1 -1
- package/dist/components/radio/snice-radio.js.map +1 -1
- package/dist/components/select/snice-select.js +1 -1
- package/dist/components/select/snice-select.js.map +1 -1
- package/dist/components/skeleton/snice-skeleton.js +1 -1
- package/dist/components/skeleton/snice-skeleton.js.map +1 -1
- package/dist/components/slider/snice-slider.d.ts +53 -0
- package/dist/components/slider/snice-slider.js +479 -0
- package/dist/components/slider/snice-slider.js.map +1 -0
- package/dist/components/slider/snice-slider.types.d.ts +26 -0
- package/dist/components/snice-cell-C0slgOpe.js +4 -0
- package/dist/components/snice-cell-C0slgOpe.js.map +1 -0
- package/dist/components/sparkline/snice-sparkline.d.ts +21 -0
- package/dist/components/sparkline/snice-sparkline.js +228 -0
- package/dist/components/sparkline/snice-sparkline.js.map +1 -0
- package/dist/components/sparkline/snice-sparkline.types.d.ts +16 -0
- package/dist/components/spinner/snice-spinner.d.ts +10 -0
- package/dist/components/spinner/snice-spinner.js +109 -0
- package/dist/components/spinner/snice-spinner.js.map +1 -0
- package/dist/components/spinner/snice-spinner.types.d.ts +8 -0
- package/dist/components/stepper/snice-stepper-panel.d.ts +8 -0
- package/dist/components/stepper/snice-stepper-panel.js +70 -0
- package/dist/components/stepper/snice-stepper-panel.js.map +1 -0
- package/dist/components/stepper/snice-stepper-panel.types.d.ts +4 -0
- package/dist/components/stepper/snice-stepper.d.ts +15 -0
- package/dist/components/stepper/snice-stepper.js +163 -0
- package/dist/components/stepper/snice-stepper.js.map +1 -0
- package/dist/components/stepper/snice-stepper.types.d.ts +13 -0
- package/dist/components/switch/snice-switch.js +1 -1
- package/dist/components/switch/snice-switch.js.map +1 -1
- package/dist/components/table/snice-cell-actions.js +1 -1
- package/dist/components/table/snice-cell-actions.js.map +1 -1
- package/dist/components/table/snice-cell-boolean.js +1 -1
- package/dist/components/table/snice-cell-color.js +1 -1
- package/dist/components/table/snice-cell-color.js.map +1 -1
- package/dist/components/table/snice-cell-currency.js +1 -1
- package/dist/components/table/snice-cell-date.js +1 -1
- package/dist/components/table/snice-cell-duration.js +1 -1
- package/dist/components/table/snice-cell-email.js +1 -1
- package/dist/components/table/snice-cell-email.js.map +1 -1
- package/dist/components/table/snice-cell-filesize.js +1 -1
- package/dist/components/table/snice-cell-image.js +1 -1
- package/dist/components/table/snice-cell-image.js.map +1 -1
- package/dist/components/table/snice-cell-json.js +1 -1
- package/dist/components/table/snice-cell-json.js.map +1 -1
- package/dist/components/table/snice-cell-link.js +1 -1
- package/dist/components/table/snice-cell-link.js.map +1 -1
- package/dist/components/table/snice-cell-location.js +1 -1
- package/dist/components/table/snice-cell-location.js.map +1 -1
- package/dist/components/table/snice-cell-number.js +1 -1
- package/dist/components/table/snice-cell-percentage.js +1 -1
- package/dist/components/table/snice-cell-percentage.js.map +1 -1
- package/dist/components/table/snice-cell-phone.js +1 -1
- package/dist/components/table/snice-cell-phone.js.map +1 -1
- package/dist/components/table/snice-cell-progress.js +1 -1
- package/dist/components/table/snice-cell-rating.js +1 -1
- package/dist/components/table/snice-cell-sparkline.js +1 -1
- package/dist/components/table/snice-cell-status.js +1 -1
- package/dist/components/table/snice-cell-status.js.map +1 -1
- package/dist/components/table/snice-cell-tag.js +1 -1
- package/dist/components/table/snice-cell-tag.js.map +1 -1
- package/dist/components/table/snice-cell-text.js +1 -1
- package/dist/components/table/snice-cell.js +1 -1
- package/dist/components/table/snice-header.js +1 -1
- package/dist/components/table/snice-header.js.map +1 -1
- package/dist/components/table/snice-row.js +2 -2
- package/dist/components/table/snice-row.js.map +1 -1
- package/dist/components/table/snice-table.js +1 -1
- package/dist/components/tabs/snice-tab-panel.js +1 -1
- package/dist/components/tabs/snice-tab-panel.js.map +1 -1
- package/dist/components/tabs/snice-tab.js +1 -1
- package/dist/components/tabs/snice-tab.js.map +1 -1
- package/dist/components/tabs/snice-tabs.js +1 -1
- package/dist/components/tabs/snice-tabs.js.map +1 -1
- package/dist/components/textarea/snice-textarea.d.ts +52 -0
- package/dist/components/textarea/snice-textarea.js +407 -0
- package/dist/components/textarea/snice-textarea.js.map +1 -0
- package/dist/components/textarea/snice-textarea.types.d.ts +30 -0
- package/dist/components/timeline/snice-timeline.d.ts +11 -0
- package/dist/components/timeline/snice-timeline.js +112 -0
- package/dist/components/timeline/snice-timeline.js.map +1 -0
- package/dist/components/timeline/snice-timeline.types.d.ts +16 -0
- package/dist/components/tooltip/snice-tooltip.js +2 -2
- package/dist/components/tooltip/snice-tooltip.js.map +1 -1
- package/dist/index.cjs +125 -158
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +125 -158
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +125 -158
- package/dist/index.iife.js.map +1 -1
- package/dist/parts.d.ts +13 -16
- package/dist/symbols.cjs +1 -1
- package/dist/symbols.esm.js +1 -1
- package/dist/template.d.ts +0 -1
- package/dist/transitions.cjs +1 -1
- package/dist/transitions.esm.js +1 -1
- package/docs/ai/README.md +10 -1
- package/docs/ai/components/banner.md +84 -0
- package/docs/ai/components/color-display.md +48 -0
- package/docs/ai/components/color-picker.md +75 -0
- package/docs/ai/components/empty-state.md +72 -0
- package/docs/ai/components/file-upload.md +93 -0
- package/docs/ai/components/image.md +60 -0
- package/docs/ai/components/kpi.md +158 -0
- package/docs/ai/components/link.md +77 -0
- package/docs/ai/components/slider.md +87 -0
- package/docs/ai/components/sparkline.md +168 -0
- package/docs/ai/components/spinner.md +47 -0
- package/docs/ai/components/stepper.md +216 -0
- package/docs/ai/components/textarea.md +87 -0
- package/docs/ai/components/timeline.md +77 -0
- package/docs/components/banner.md +106 -0
- package/docs/components/color-display.md +96 -0
- package/docs/components/color-picker.md +81 -0
- package/docs/components/empty-state.md +79 -0
- package/docs/components/file-upload.md +263 -0
- package/docs/components/image.md +110 -0
- package/docs/components/kpi.md +251 -0
- package/docs/components/link.md +229 -0
- package/docs/components/slider.md +297 -0
- package/docs/components/sparkline.md +293 -0
- package/docs/components/spinner.md +63 -0
- package/docs/components/stepper.md +410 -0
- package/docs/components/textarea.md +235 -0
- package/docs/components/timeline.md +192 -0
- package/package.json +2 -1
- package/dist/components/snice-cell-BLFVdxPp.js +0 -4
- package/dist/components/snice-cell-BLFVdxPp.js.map +0 -1
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# snice-kpi
|
|
2
|
+
|
|
3
|
+
Key performance indicator display with value, label, trend, sparkline, and sentiment.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
label: string = '' // Metric label/name
|
|
9
|
+
value: string | number = '' // Main metric value
|
|
10
|
+
trendValue?: string | number // Trend value (e.g., "+12.5%")
|
|
11
|
+
trendData?: number[] // Sparkline data array
|
|
12
|
+
sentiment?: KpiSentiment // 'up' | 'down' | 'neutral'
|
|
13
|
+
size: KpiSize = 'medium' // 'small' | 'medium' | 'large'
|
|
14
|
+
showSparkline: boolean = true // Show sparkline when data provided
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```html
|
|
20
|
+
<!-- Basic -->
|
|
21
|
+
<snice-kpi label="Revenue" value="$45,231"></snice-kpi>
|
|
22
|
+
|
|
23
|
+
<!-- With trend -->
|
|
24
|
+
<snice-kpi
|
|
25
|
+
label="Monthly Revenue"
|
|
26
|
+
value="$54,239"
|
|
27
|
+
trend-value="+12.5%"
|
|
28
|
+
sentiment="up">
|
|
29
|
+
</snice-kpi>
|
|
30
|
+
|
|
31
|
+
<!-- With sparkline -->
|
|
32
|
+
<snice-kpi
|
|
33
|
+
id="sales"
|
|
34
|
+
label="Weekly Sales"
|
|
35
|
+
value="$28,450"
|
|
36
|
+
trend-value="+15.3%"
|
|
37
|
+
sentiment="up">
|
|
38
|
+
</snice-kpi>
|
|
39
|
+
<script>
|
|
40
|
+
document.getElementById('sales').trendData = [20, 25, 22, 30, 28, 35, 32];
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<!-- Sentiments -->
|
|
44
|
+
<snice-kpi sentiment="up"></snice-kpi> <!-- Green, ↑ -->
|
|
45
|
+
<snice-kpi sentiment="down"></snice-kpi> <!-- Red, ↓ -->
|
|
46
|
+
<snice-kpi sentiment="neutral"></snice-kpi> <!-- Gray, → -->
|
|
47
|
+
|
|
48
|
+
<!-- Sizes -->
|
|
49
|
+
<snice-kpi size="small"></snice-kpi>
|
|
50
|
+
<snice-kpi size="medium"></snice-kpi>
|
|
51
|
+
<snice-kpi size="large"></snice-kpi>
|
|
52
|
+
|
|
53
|
+
<!-- Without sparkline -->
|
|
54
|
+
<snice-kpi show-sparkline="false"></snice-kpi>
|
|
55
|
+
|
|
56
|
+
<!-- Dashboard grid -->
|
|
57
|
+
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;">
|
|
58
|
+
<snice-kpi
|
|
59
|
+
id="mrr"
|
|
60
|
+
label="MRR"
|
|
61
|
+
value="$127K"
|
|
62
|
+
trend-value="+22%"
|
|
63
|
+
sentiment="up">
|
|
64
|
+
</snice-kpi>
|
|
65
|
+
|
|
66
|
+
<snice-kpi
|
|
67
|
+
id="users"
|
|
68
|
+
label="Active Users"
|
|
69
|
+
value="2,345"
|
|
70
|
+
trend-value="+8.7%"
|
|
71
|
+
sentiment="up">
|
|
72
|
+
</snice-kpi>
|
|
73
|
+
|
|
74
|
+
<snice-kpi
|
|
75
|
+
id="churn"
|
|
76
|
+
label="Churn"
|
|
77
|
+
value="2.3%"
|
|
78
|
+
trend-value="+0.8%"
|
|
79
|
+
sentiment="down">
|
|
80
|
+
</snice-kpi>
|
|
81
|
+
</div>
|
|
82
|
+
<script>
|
|
83
|
+
document.getElementById('mrr').trendData = [100, 110, 105, 120, 115, 130, 127];
|
|
84
|
+
document.getElementById('users').trendData = [2000, 2100, 2200, 2250, 2300, 2345];
|
|
85
|
+
document.getElementById('churn').trendData = [1.5, 1.8, 2.0, 2.2, 2.1, 2.3];
|
|
86
|
+
</script>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## CSS Parts
|
|
90
|
+
|
|
91
|
+
```css
|
|
92
|
+
::part(container) /* Main container */
|
|
93
|
+
::part(header) /* Header section */
|
|
94
|
+
::part(main) /* Main content (label + value) */
|
|
95
|
+
::part(label) /* Label text */
|
|
96
|
+
::part(value) /* Value text */
|
|
97
|
+
::part(trend) /* Trend container */
|
|
98
|
+
::part(trend-icon) /* Trend icon (↑↓→) */
|
|
99
|
+
::part(trend-value) /* Trend value text */
|
|
100
|
+
::part(sparkline) /* Sparkline container */
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Styling
|
|
104
|
+
|
|
105
|
+
```css
|
|
106
|
+
--snice-color-background
|
|
107
|
+
--snice-color-border
|
|
108
|
+
--snice-color-text
|
|
109
|
+
--snice-color-text-secondary
|
|
110
|
+
--snice-color-success /* Up sentiment */
|
|
111
|
+
--snice-color-danger /* Down sentiment */
|
|
112
|
+
--snice-spacing-xs
|
|
113
|
+
--snice-spacing-sm
|
|
114
|
+
--snice-spacing-md
|
|
115
|
+
--snice-spacing-lg
|
|
116
|
+
--snice-font-size-xs
|
|
117
|
+
--snice-font-size-sm
|
|
118
|
+
--snice-font-size-md
|
|
119
|
+
--snice-font-size-2xl
|
|
120
|
+
--snice-font-size-3xl
|
|
121
|
+
--snice-font-size-4xl
|
|
122
|
+
--snice-font-weight-medium
|
|
123
|
+
--snice-font-weight-semibold
|
|
124
|
+
--snice-font-weight-bold
|
|
125
|
+
--snice-border-radius-md
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Common Patterns
|
|
129
|
+
|
|
130
|
+
```html
|
|
131
|
+
<!-- Financial metrics -->
|
|
132
|
+
<snice-kpi label="Revenue" value="$127K" trend-value="+22%" sentiment="up"></snice-kpi>
|
|
133
|
+
<snice-kpi label="Costs" value="$45K" trend-value="-5%" sentiment="down"></snice-kpi>
|
|
134
|
+
<snice-kpi label="Profit" value="$82K" trend-value="+35%" sentiment="up"></snice-kpi>
|
|
135
|
+
|
|
136
|
+
<!-- User metrics -->
|
|
137
|
+
<snice-kpi label="Total Users" value="12,345" trend-value="+234" sentiment="up"></snice-kpi>
|
|
138
|
+
<snice-kpi label="Active Users" value="8,901" trend-value="+156" sentiment="up"></snice-kpi>
|
|
139
|
+
<snice-kpi label="Churn Rate" value="2.3%" trend-value="+0.2%" sentiment="down"></snice-kpi>
|
|
140
|
+
|
|
141
|
+
<!-- Performance metrics -->
|
|
142
|
+
<snice-kpi label="Response Time" value="245ms" trend-value="-23ms" sentiment="down"></snice-kpi>
|
|
143
|
+
<snice-kpi label="Uptime" value="99.9%" trend-value="±0%" sentiment="neutral"></snice-kpi>
|
|
144
|
+
<snice-kpi label="Error Rate" value="0.12%" trend-value="-0.03%" sentiment="down"></snice-kpi>
|
|
145
|
+
|
|
146
|
+
<!-- Marketing metrics -->
|
|
147
|
+
<snice-kpi label="Conversion Rate" value="3.24%" trend-value="+0.5%" sentiment="up"></snice-kpi>
|
|
148
|
+
<snice-kpi label="CAC" value="$156" trend-value="-$12" sentiment="down"></snice-kpi>
|
|
149
|
+
<snice-kpi label="LTV" value="$1,245" trend-value="+$87" sentiment="up"></snice-kpi>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Notes
|
|
153
|
+
|
|
154
|
+
- Sparkline automatically uses sentiment color (success/danger/muted)
|
|
155
|
+
- Sentiment icons: up=↑, down=↓, neutral=→
|
|
156
|
+
- trendData array automatically renders sparkline
|
|
157
|
+
- Value can be string or number for formatting flexibility
|
|
158
|
+
- showSparkline=false hides sparkline even if data provided
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# snice-link
|
|
2
|
+
|
|
3
|
+
Link component with variants and external link handling.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
href: string = '' // Link URL
|
|
9
|
+
target: LinkTarget = '_self' // '_self' | '_blank' | '_parent' | '_top'
|
|
10
|
+
variant: LinkVariant = 'default' // 'default' | 'primary' | 'secondary' | 'muted'
|
|
11
|
+
disabled: boolean = false // Disable link
|
|
12
|
+
external: boolean = false // Auto _blank + noopener
|
|
13
|
+
underline: boolean = false // Show underline
|
|
14
|
+
hash: boolean = false // Auto prepend # to href (for hash routing)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Events
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
@dispatch('click') // Emitted on click (prevented if disabled)
|
|
21
|
+
@dispatch('navigate') // Emitted on hash link click (for router integration)
|
|
22
|
+
// detail: { href: string }
|
|
23
|
+
// cancelable: true
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
<!-- Basic -->
|
|
30
|
+
<snice-link href="/page">Link text</snice-link>
|
|
31
|
+
|
|
32
|
+
<!-- External -->
|
|
33
|
+
<snice-link href="https://example.com" external>External</snice-link>
|
|
34
|
+
|
|
35
|
+
<!-- Variants -->
|
|
36
|
+
<snice-link href="/page" variant="primary">Primary</snice-link>
|
|
37
|
+
<snice-link href="/page" variant="secondary">Secondary</snice-link>
|
|
38
|
+
<snice-link href="/page" variant="muted">Muted</snice-link>
|
|
39
|
+
|
|
40
|
+
<!-- Underlined -->
|
|
41
|
+
<snice-link href="/page" underline>Underlined link</snice-link>
|
|
42
|
+
|
|
43
|
+
<!-- Disabled -->
|
|
44
|
+
<snice-link href="/page" disabled>Disabled</snice-link>
|
|
45
|
+
|
|
46
|
+
<!-- Hash links (for routing) -->
|
|
47
|
+
<snice-link href="home" hash>Home</snice-link>
|
|
48
|
+
<snice-link href="about" hash>About</snice-link>
|
|
49
|
+
<!-- Renders as: <a href="#home">Home</a> -->
|
|
50
|
+
|
|
51
|
+
<!-- Router integration -->
|
|
52
|
+
<snice-link href="profile" hash @navigate="${handleNavigate}">Profile</snice-link>
|
|
53
|
+
<script>
|
|
54
|
+
function handleNavigate(e) {
|
|
55
|
+
console.log('Navigate to:', e.detail.href);
|
|
56
|
+
// e.preventDefault() in the handler will cancel navigation
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## CSS Parts
|
|
62
|
+
|
|
63
|
+
```css
|
|
64
|
+
::part(link) /* Anchor element */
|
|
65
|
+
::part(external-icon) /* External icon */
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Styling
|
|
69
|
+
|
|
70
|
+
```css
|
|
71
|
+
--snice-color-primary
|
|
72
|
+
--snice-color-primary-dark
|
|
73
|
+
--snice-color-text-secondary
|
|
74
|
+
--snice-color-text
|
|
75
|
+
--snice-color-text-muted
|
|
76
|
+
--snice-color-text-disabled
|
|
77
|
+
```
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# snice-slider
|
|
2
|
+
|
|
3
|
+
Range slider for numeric value selection.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
value: number = 0;
|
|
9
|
+
min: number = 0;
|
|
10
|
+
max: number = 100;
|
|
11
|
+
step: number = 1;
|
|
12
|
+
variant: 'default'|'primary'|'success'|'warning'|'danger' = 'default';
|
|
13
|
+
size: 'small'|'medium'|'large' = 'medium';
|
|
14
|
+
disabled: boolean = false;
|
|
15
|
+
required: boolean = false;
|
|
16
|
+
invalid: boolean = false;
|
|
17
|
+
readonly: boolean = false;
|
|
18
|
+
label: string = '';
|
|
19
|
+
helperText: string = '';
|
|
20
|
+
errorText: string = '';
|
|
21
|
+
name: string = '';
|
|
22
|
+
showValue: boolean = false;
|
|
23
|
+
showTicks: boolean = false;
|
|
24
|
+
vertical: boolean = false;
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Methods
|
|
28
|
+
|
|
29
|
+
- `focus()` - Focus slider thumb
|
|
30
|
+
- `blur()` - Blur slider thumb
|
|
31
|
+
|
|
32
|
+
## Events
|
|
33
|
+
|
|
34
|
+
- `input` - {value, slider} - During drag
|
|
35
|
+
- `change` - {value, slider} - After drag complete
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
<!-- Basic -->
|
|
41
|
+
<snice-slider label="Volume" min="0" max="100"></snice-slider>
|
|
42
|
+
|
|
43
|
+
<!-- With value display -->
|
|
44
|
+
<snice-slider show-value value="50"></snice-slider>
|
|
45
|
+
|
|
46
|
+
<!-- With ticks -->
|
|
47
|
+
<snice-slider show-ticks min="0" max="10" step="1"></snice-slider>
|
|
48
|
+
|
|
49
|
+
<!-- Variants -->
|
|
50
|
+
<snice-slider variant="primary"></snice-slider>
|
|
51
|
+
<snice-slider variant="success"></snice-slider>
|
|
52
|
+
<snice-slider variant="warning"></snice-slider>
|
|
53
|
+
<snice-slider variant="danger"></snice-slider>
|
|
54
|
+
|
|
55
|
+
<!-- Sizes -->
|
|
56
|
+
<snice-slider size="small"></snice-slider>
|
|
57
|
+
<snice-slider size="medium"></snice-slider>
|
|
58
|
+
<snice-slider size="large"></snice-slider>
|
|
59
|
+
|
|
60
|
+
<!-- Vertical -->
|
|
61
|
+
<snice-slider vertical></snice-slider>
|
|
62
|
+
|
|
63
|
+
<!-- Step increments -->
|
|
64
|
+
<snice-slider min="0" max="100" step="5" value="50"></snice-slider>
|
|
65
|
+
|
|
66
|
+
<!-- Events -->
|
|
67
|
+
<snice-slider id="slider"></snice-slider>
|
|
68
|
+
<script>
|
|
69
|
+
const slider = document.querySelector('#slider');
|
|
70
|
+
slider.addEventListener('@snice/slider-change', (e) => {
|
|
71
|
+
console.log('Value:', e.detail.value);
|
|
72
|
+
});
|
|
73
|
+
</script>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Features
|
|
77
|
+
|
|
78
|
+
- Form-associated custom element
|
|
79
|
+
- Mouse and touch support
|
|
80
|
+
- Keyboard navigation (arrows, home/end, page up/down)
|
|
81
|
+
- 5 color variants
|
|
82
|
+
- 3 sizes
|
|
83
|
+
- Vertical orientation
|
|
84
|
+
- Optional value display
|
|
85
|
+
- Optional tick marks
|
|
86
|
+
- Step increments
|
|
87
|
+
- Accessible
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# snice-sparkline
|
|
2
|
+
|
|
3
|
+
Compact inline chart for visualizing trends and patterns. For dashboards, tables, data-dense interfaces.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
data: number[] = [] // Values to visualize
|
|
9
|
+
type: SparklineType = 'line' // 'line' | 'bar' | 'area'
|
|
10
|
+
color: SparklineColor = 'primary' // 'primary' | 'success' | 'warning' | 'danger' | 'muted'
|
|
11
|
+
customColor?: string // Any CSS color (overrides color)
|
|
12
|
+
width: number = 100 // Chart width in pixels
|
|
13
|
+
height: number = 30 // Chart height in pixels
|
|
14
|
+
strokeWidth: number = 2 // Line/dot stroke width
|
|
15
|
+
showDots: boolean = false // Show dots on data points (line charts)
|
|
16
|
+
showArea: boolean = false // Show area fill (line charts)
|
|
17
|
+
smooth: boolean = false // Use smooth bezier curves
|
|
18
|
+
min?: number // Min value for scaling (auto if unset)
|
|
19
|
+
max?: number // Max value for scaling (auto if unset)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<!-- Basic -->
|
|
26
|
+
<snice-sparkline id="chart"></snice-sparkline>
|
|
27
|
+
<script>
|
|
28
|
+
document.getElementById('chart').data = [10, 20, 15, 25, 30];
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<!-- Line chart -->
|
|
32
|
+
<snice-sparkline id="line" type="line"></snice-sparkline>
|
|
33
|
+
|
|
34
|
+
<!-- Bar chart -->
|
|
35
|
+
<snice-sparkline id="bar" type="bar"></snice-sparkline>
|
|
36
|
+
|
|
37
|
+
<!-- Area chart -->
|
|
38
|
+
<snice-sparkline id="area" type="area"></snice-sparkline>
|
|
39
|
+
|
|
40
|
+
<!-- Smooth curves -->
|
|
41
|
+
<snice-sparkline id="smooth" smooth></snice-sparkline>
|
|
42
|
+
|
|
43
|
+
<!-- With dots -->
|
|
44
|
+
<snice-sparkline id="dots" show-dots></snice-sparkline>
|
|
45
|
+
|
|
46
|
+
<!-- With area fill -->
|
|
47
|
+
<snice-sparkline id="fill" show-area></snice-sparkline>
|
|
48
|
+
|
|
49
|
+
<!-- Colors -->
|
|
50
|
+
<snice-sparkline color="primary"></snice-sparkline>
|
|
51
|
+
<snice-sparkline color="success"></snice-sparkline>
|
|
52
|
+
<snice-sparkline color="warning"></snice-sparkline>
|
|
53
|
+
<snice-sparkline color="danger"></snice-sparkline>
|
|
54
|
+
<snice-sparkline color="muted"></snice-sparkline>
|
|
55
|
+
|
|
56
|
+
<!-- Custom colors -->
|
|
57
|
+
<snice-sparkline custom-color="#9333ea"></snice-sparkline>
|
|
58
|
+
<snice-sparkline custom-color="rgb(147, 51, 234)"></snice-sparkline>
|
|
59
|
+
<snice-sparkline custom-color="hsl(270, 80%, 60%)"></snice-sparkline>
|
|
60
|
+
|
|
61
|
+
<!-- Sizing -->
|
|
62
|
+
<snice-sparkline width="200" height="50"></snice-sparkline>
|
|
63
|
+
|
|
64
|
+
<!-- Custom scale -->
|
|
65
|
+
<snice-sparkline min="0" max="100"></snice-sparkline>
|
|
66
|
+
|
|
67
|
+
<!-- Combined features -->
|
|
68
|
+
<snice-sparkline
|
|
69
|
+
id="advanced"
|
|
70
|
+
type="line"
|
|
71
|
+
color="primary"
|
|
72
|
+
width="150"
|
|
73
|
+
height="40"
|
|
74
|
+
smooth
|
|
75
|
+
show-area
|
|
76
|
+
min="0">
|
|
77
|
+
</snice-sparkline>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## CSS Parts
|
|
81
|
+
|
|
82
|
+
```css
|
|
83
|
+
::part(container) /* Container div */
|
|
84
|
+
::part(svg) /* SVG element */
|
|
85
|
+
::part(line) /* Line/path element */
|
|
86
|
+
::part(area) /* Area polygon/path */
|
|
87
|
+
::part(bar) /* Bar rect */
|
|
88
|
+
::part(dot) /* Dot circle */
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Styling
|
|
92
|
+
|
|
93
|
+
```css
|
|
94
|
+
--snice-color-primary
|
|
95
|
+
--snice-color-success
|
|
96
|
+
--snice-color-warning
|
|
97
|
+
--snice-color-danger
|
|
98
|
+
--snice-color-text-secondary
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## In Tables
|
|
102
|
+
|
|
103
|
+
```html
|
|
104
|
+
<snice-table id="table"></snice-table>
|
|
105
|
+
<script>
|
|
106
|
+
document.getElementById('table').data = [
|
|
107
|
+
{
|
|
108
|
+
product: 'A',
|
|
109
|
+
trend: [10, 15, 12, 18, 22, 25]
|
|
110
|
+
}
|
|
111
|
+
];
|
|
112
|
+
|
|
113
|
+
document.getElementById('table').columns = [
|
|
114
|
+
{ key: 'product', label: 'Product' },
|
|
115
|
+
{
|
|
116
|
+
key: 'trend',
|
|
117
|
+
label: 'Trend',
|
|
118
|
+
render: (value) => {
|
|
119
|
+
const sparkline = document.createElement('snice-sparkline');
|
|
120
|
+
sparkline.data = value;
|
|
121
|
+
sparkline.width = 80;
|
|
122
|
+
sparkline.height = 25;
|
|
123
|
+
sparkline.color = 'primary';
|
|
124
|
+
return sparkline;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
];
|
|
128
|
+
</script>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Common Patterns
|
|
132
|
+
|
|
133
|
+
```html
|
|
134
|
+
<!-- Website traffic -->
|
|
135
|
+
<snice-sparkline
|
|
136
|
+
id="traffic"
|
|
137
|
+
color="primary"
|
|
138
|
+
width="150"
|
|
139
|
+
height="40"
|
|
140
|
+
smooth
|
|
141
|
+
show-area>
|
|
142
|
+
</snice-sparkline>
|
|
143
|
+
|
|
144
|
+
<!-- Sales bars -->
|
|
145
|
+
<snice-sparkline
|
|
146
|
+
id="sales"
|
|
147
|
+
type="bar"
|
|
148
|
+
color="success"
|
|
149
|
+
width="150"
|
|
150
|
+
height="40">
|
|
151
|
+
</snice-sparkline>
|
|
152
|
+
|
|
153
|
+
<!-- Response time with dots -->
|
|
154
|
+
<snice-sparkline
|
|
155
|
+
id="response"
|
|
156
|
+
color="warning"
|
|
157
|
+
smooth
|
|
158
|
+
show-dots>
|
|
159
|
+
</snice-sparkline>
|
|
160
|
+
|
|
161
|
+
<!-- Error rate -->
|
|
162
|
+
<snice-sparkline
|
|
163
|
+
id="errors"
|
|
164
|
+
type="area"
|
|
165
|
+
color="danger"
|
|
166
|
+
min="0">
|
|
167
|
+
</snice-sparkline>
|
|
168
|
+
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# snice-spinner
|
|
2
|
+
|
|
3
|
+
Animated loading spinner.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
size: 'small'|'medium'|'large'|'xl' = 'medium';
|
|
9
|
+
color: 'primary'|'success'|'warning'|'error'|'info' = 'primary';
|
|
10
|
+
label: string = '';
|
|
11
|
+
thickness: number = 4;
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```html
|
|
17
|
+
<!-- Basic -->
|
|
18
|
+
<snice-spinner></snice-spinner>
|
|
19
|
+
|
|
20
|
+
<!-- Sizes -->
|
|
21
|
+
<snice-spinner size="small"></snice-spinner>
|
|
22
|
+
<snice-spinner size="medium"></snice-spinner>
|
|
23
|
+
<snice-spinner size="large"></snice-spinner>
|
|
24
|
+
<snice-spinner size="xl"></snice-spinner>
|
|
25
|
+
|
|
26
|
+
<!-- Colors -->
|
|
27
|
+
<snice-spinner color="primary"></snice-spinner>
|
|
28
|
+
<snice-spinner color="success"></snice-spinner>
|
|
29
|
+
<snice-spinner color="warning"></snice-spinner>
|
|
30
|
+
<snice-spinner color="error"></snice-spinner>
|
|
31
|
+
<snice-spinner color="info"></snice-spinner>
|
|
32
|
+
|
|
33
|
+
<!-- With label -->
|
|
34
|
+
<snice-spinner label="Loading..."></snice-spinner>
|
|
35
|
+
|
|
36
|
+
<!-- Custom thickness -->
|
|
37
|
+
<snice-spinner thickness="6"></snice-spinner>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Features
|
|
41
|
+
|
|
42
|
+
- Smooth circular animation
|
|
43
|
+
- 4 sizes
|
|
44
|
+
- 5 color variants
|
|
45
|
+
- Optional label
|
|
46
|
+
- Accessible (role=status, aria-label)
|
|
47
|
+
- Lightweight SVG-based
|