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,216 @@
|
|
|
1
|
+
# snice-stepper
|
|
2
|
+
|
|
3
|
+
Step indicator for multi-step processes, wizards, workflows. Shows progress with pending/active/completed/error states.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
steps: Step[] = [] // Array of step objects
|
|
9
|
+
currentStep: number = 0 // Current active step index
|
|
10
|
+
orientation: StepperOrientation = 'horizontal' // 'horizontal' | 'vertical'
|
|
11
|
+
clickable: boolean = false // Enable click navigation
|
|
12
|
+
|
|
13
|
+
// Step object:
|
|
14
|
+
{
|
|
15
|
+
label: string; // Step label (required)
|
|
16
|
+
description?: string; // Optional description
|
|
17
|
+
status?: StepStatus; // Override auto status: 'pending' | 'active' | 'completed' | 'error'
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<!-- Basic horizontal -->
|
|
25
|
+
<snice-stepper id="basic"></snice-stepper>
|
|
26
|
+
<script>
|
|
27
|
+
document.getElementById('basic').steps = [
|
|
28
|
+
{ label: 'Step 1' },
|
|
29
|
+
{ label: 'Step 2' },
|
|
30
|
+
{ label: 'Step 3' }
|
|
31
|
+
];
|
|
32
|
+
document.getElementById('basic').currentStep = 1;
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<!-- With panels (auto show/hide) -->
|
|
36
|
+
<snice-stepper id="wizard" clickable></snice-stepper>
|
|
37
|
+
<snice-stepper-panel>Step 1 content</snice-stepper-panel>
|
|
38
|
+
<snice-stepper-panel>Step 2 content</snice-stepper-panel>
|
|
39
|
+
<snice-stepper-panel>Step 3 content</snice-stepper-panel>
|
|
40
|
+
<script>
|
|
41
|
+
document.getElementById('wizard').steps = [
|
|
42
|
+
{ label: 'Account' },
|
|
43
|
+
{ label: 'Profile' },
|
|
44
|
+
{ label: 'Complete' }
|
|
45
|
+
];
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<!-- Vertical with descriptions -->
|
|
49
|
+
<snice-stepper id="vertical" orientation="vertical"></snice-stepper>
|
|
50
|
+
<script>
|
|
51
|
+
document.getElementById('vertical').steps = [
|
|
52
|
+
{ label: 'Account', description: 'Create your account' },
|
|
53
|
+
{ label: 'Profile', description: 'Personal info' },
|
|
54
|
+
{ label: 'Complete', description: 'Finish setup' }
|
|
55
|
+
];
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<!-- Clickable navigation -->
|
|
59
|
+
<snice-stepper id="wizard" clickable></snice-stepper>
|
|
60
|
+
<script>
|
|
61
|
+
const wizard = document.getElementById('wizard');
|
|
62
|
+
wizard.steps = [
|
|
63
|
+
{ label: 'Cart' },
|
|
64
|
+
{ label: 'Delivery' },
|
|
65
|
+
{ label: 'Payment' },
|
|
66
|
+
{ label: 'Confirm' }
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
wizard.addEventListener('step-change', (e) => {
|
|
70
|
+
console.log(e.detail.previousStep); // Previous step index
|
|
71
|
+
console.log(e.detail.currentStep); // New step index
|
|
72
|
+
console.log(e.detail.step); // Step object
|
|
73
|
+
// e.preventDefault(); to cancel navigation
|
|
74
|
+
});
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<!-- Error state -->
|
|
78
|
+
<snice-stepper id="validation"></snice-stepper>
|
|
79
|
+
<script>
|
|
80
|
+
document.getElementById('validation').steps = [
|
|
81
|
+
{ label: 'Upload', status: 'completed' },
|
|
82
|
+
{ label: 'Validate', status: 'error' },
|
|
83
|
+
{ label: 'Process', status: 'pending' }
|
|
84
|
+
];
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<!-- Programmatic navigation -->
|
|
88
|
+
<script>
|
|
89
|
+
const stepper = document.getElementById('my-stepper');
|
|
90
|
+
stepper.currentStep++; // Next
|
|
91
|
+
stepper.currentStep--; // Previous
|
|
92
|
+
stepper.currentStep = 2; // Go to step 3
|
|
93
|
+
</script>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Events
|
|
97
|
+
|
|
98
|
+
```javascript
|
|
99
|
+
// step-change (only in clickable mode)
|
|
100
|
+
stepper.addEventListener('step-change', (e) => {
|
|
101
|
+
const { previousStep, currentStep, step } = e.detail;
|
|
102
|
+
e.preventDefault(); // Cancel navigation if needed
|
|
103
|
+
});
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## CSS Parts
|
|
107
|
+
|
|
108
|
+
```css
|
|
109
|
+
::part(container) /* Main container */
|
|
110
|
+
::part(step) /* Individual step */
|
|
111
|
+
::part(step-indicator) /* Circular indicator */
|
|
112
|
+
::part(step-content) /* Label + description wrapper */
|
|
113
|
+
::part(step-label) /* Step label text */
|
|
114
|
+
::part(step-description) /* Description text */
|
|
115
|
+
::part(step-connector) /* Line between steps */
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Styling
|
|
119
|
+
|
|
120
|
+
```css
|
|
121
|
+
--snice-color-primary /* Active state */
|
|
122
|
+
--snice-color-success /* Completed state */
|
|
123
|
+
--snice-color-danger /* Error state */
|
|
124
|
+
--snice-color-text
|
|
125
|
+
--snice-color-text-secondary /* Pending state */
|
|
126
|
+
--snice-color-text-inverse /* Indicator text */
|
|
127
|
+
--snice-color-background
|
|
128
|
+
--snice-color-border
|
|
129
|
+
--snice-spacing-xs
|
|
130
|
+
--snice-spacing-sm
|
|
131
|
+
--snice-spacing-md
|
|
132
|
+
--snice-spacing-lg
|
|
133
|
+
--snice-font-size-xs
|
|
134
|
+
--snice-font-size-sm
|
|
135
|
+
--snice-font-weight-medium
|
|
136
|
+
--snice-font-weight-semibold
|
|
137
|
+
--snice-transition-fast
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Common Patterns
|
|
141
|
+
|
|
142
|
+
```html
|
|
143
|
+
<!-- Checkout flow -->
|
|
144
|
+
<snice-stepper id="checkout" clickable></snice-stepper>
|
|
145
|
+
<button onclick="document.getElementById('checkout').currentStep--">Back</button>
|
|
146
|
+
<button onclick="document.getElementById('checkout').currentStep++">Next</button>
|
|
147
|
+
<script>
|
|
148
|
+
document.getElementById('checkout').steps = [
|
|
149
|
+
{ label: 'Cart', description: 'Review items' },
|
|
150
|
+
{ label: 'Delivery', description: 'Shipping address' },
|
|
151
|
+
{ label: 'Payment', description: 'Billing info' },
|
|
152
|
+
{ label: 'Confirm', description: 'Place order' }
|
|
153
|
+
];
|
|
154
|
+
</script>
|
|
155
|
+
|
|
156
|
+
<!-- Onboarding wizard (vertical) -->
|
|
157
|
+
<snice-stepper id="onboarding" orientation="vertical" clickable></snice-stepper>
|
|
158
|
+
<script>
|
|
159
|
+
document.getElementById('onboarding').steps = [
|
|
160
|
+
{ label: 'Welcome' },
|
|
161
|
+
{ label: 'Profile Setup' },
|
|
162
|
+
{ label: 'Preferences' },
|
|
163
|
+
{ label: 'Get Started' }
|
|
164
|
+
];
|
|
165
|
+
</script>
|
|
166
|
+
|
|
167
|
+
<!-- Form validation -->
|
|
168
|
+
<snice-stepper id="form"></snice-stepper>
|
|
169
|
+
<script>
|
|
170
|
+
document.getElementById('form').steps = [
|
|
171
|
+
{ label: 'Personal Info', status: 'completed' },
|
|
172
|
+
{ label: 'Address', status: 'error' }, // Has validation error
|
|
173
|
+
{ label: 'Review', status: 'pending' }
|
|
174
|
+
];
|
|
175
|
+
</script>
|
|
176
|
+
|
|
177
|
+
<!-- Progress tracker -->
|
|
178
|
+
<snice-stepper id="upload"></snice-stepper>
|
|
179
|
+
<script>
|
|
180
|
+
const upload = document.getElementById('upload');
|
|
181
|
+
upload.steps = [
|
|
182
|
+
{ label: 'Upload', status: 'completed' },
|
|
183
|
+
{ label: 'Process', status: 'active' },
|
|
184
|
+
{ label: 'Complete', status: 'pending' }
|
|
185
|
+
];
|
|
186
|
+
upload.currentStep = 1;
|
|
187
|
+
</script>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Stepper Panels
|
|
191
|
+
|
|
192
|
+
```html
|
|
193
|
+
<!-- Panels auto show/hide based on currentStep -->
|
|
194
|
+
<snice-stepper id="wizard"></snice-stepper>
|
|
195
|
+
<snice-stepper-panel>Content for step 0</snice-stepper-panel>
|
|
196
|
+
<snice-stepper-panel>Content for step 1</snice-stepper-panel>
|
|
197
|
+
<snice-stepper-panel>Content for step 2</snice-stepper-panel>
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
- Panels must be direct children of stepper
|
|
201
|
+
- Panel index matches order (first panel = step 0, etc.)
|
|
202
|
+
- Automatically activated when stepper.currentStep changes
|
|
203
|
+
- Only active panel is visible (display: block), others hidden
|
|
204
|
+
|
|
205
|
+
## Notes
|
|
206
|
+
|
|
207
|
+
- Status auto-computed from currentStep if not explicitly set:
|
|
208
|
+
- Steps before currentStep: 'completed' (shows ✓)
|
|
209
|
+
- Step at currentStep: 'active'
|
|
210
|
+
- Steps after currentStep: 'pending'
|
|
211
|
+
- Completed steps show checkmark (✓) instead of number
|
|
212
|
+
- Connector lines auto-hidden on last step
|
|
213
|
+
- Click events only work when clickable=true
|
|
214
|
+
- step-change event is cancelable via preventDefault()
|
|
215
|
+
- Orientation affects layout but not behavior
|
|
216
|
+
- Panels sync automatically via @watch decorator on currentStep
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# snice-textarea
|
|
2
|
+
|
|
3
|
+
Multi-line text input field with auto-grow and character count.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
value: string = '';
|
|
9
|
+
variant: 'outlined'|'filled'|'underlined' = 'outlined';
|
|
10
|
+
size: 'small'|'medium'|'large' = 'medium';
|
|
11
|
+
resize: 'none'|'vertical'|'horizontal'|'both' = 'vertical';
|
|
12
|
+
placeholder: string = '';
|
|
13
|
+
disabled: boolean = false;
|
|
14
|
+
required: boolean = false;
|
|
15
|
+
invalid: boolean = false;
|
|
16
|
+
readonly: boolean = false;
|
|
17
|
+
label: string = '';
|
|
18
|
+
helperText: string = '';
|
|
19
|
+
errorText: string = '';
|
|
20
|
+
rows: number = 3;
|
|
21
|
+
cols: number = -1;
|
|
22
|
+
minlength: number = -1;
|
|
23
|
+
maxlength: number = -1;
|
|
24
|
+
autocomplete: string = '';
|
|
25
|
+
name: string = '';
|
|
26
|
+
autoGrow: boolean = false;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Methods
|
|
30
|
+
|
|
31
|
+
- `focus()` - Focus textarea
|
|
32
|
+
- `blur()` - Blur textarea
|
|
33
|
+
- `select()` - Select text
|
|
34
|
+
|
|
35
|
+
## Events
|
|
36
|
+
|
|
37
|
+
- `input` - {value, textarea}
|
|
38
|
+
- `change` - {value, textarea}
|
|
39
|
+
- `focus` - {textarea}
|
|
40
|
+
- `blur` - {textarea}
|
|
41
|
+
|
|
42
|
+
## Usage
|
|
43
|
+
|
|
44
|
+
```html
|
|
45
|
+
<!-- Basic -->
|
|
46
|
+
<snice-textarea label="Comments" placeholder="Enter comments"></snice-textarea>
|
|
47
|
+
|
|
48
|
+
<!-- Variants -->
|
|
49
|
+
<snice-textarea variant="outlined"></snice-textarea>
|
|
50
|
+
<snice-textarea variant="filled"></snice-textarea>
|
|
51
|
+
<snice-textarea variant="underlined"></snice-textarea>
|
|
52
|
+
|
|
53
|
+
<!-- Rows -->
|
|
54
|
+
<snice-textarea rows="5"></snice-textarea>
|
|
55
|
+
|
|
56
|
+
<!-- Auto-grow -->
|
|
57
|
+
<snice-textarea auto-grow></snice-textarea>
|
|
58
|
+
|
|
59
|
+
<!-- Character count -->
|
|
60
|
+
<snice-textarea maxlength="500"></snice-textarea>
|
|
61
|
+
|
|
62
|
+
<!-- Resize options -->
|
|
63
|
+
<snice-textarea resize="none"></snice-textarea>
|
|
64
|
+
<snice-textarea resize="both"></snice-textarea>
|
|
65
|
+
|
|
66
|
+
<!-- Sizes -->
|
|
67
|
+
<snice-textarea size="small"></snice-textarea>
|
|
68
|
+
<snice-textarea size="medium"></snice-textarea>
|
|
69
|
+
<snice-textarea size="large"></snice-textarea>
|
|
70
|
+
|
|
71
|
+
<!-- Helper text -->
|
|
72
|
+
<snice-textarea helper-text="Max 500 characters"></snice-textarea>
|
|
73
|
+
|
|
74
|
+
<!-- Error state -->
|
|
75
|
+
<snice-textarea invalid error-text="Required field"></snice-textarea>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Features
|
|
79
|
+
|
|
80
|
+
- Form-associated custom element
|
|
81
|
+
- 3 visual variants
|
|
82
|
+
- Auto-grow height option
|
|
83
|
+
- Character counter
|
|
84
|
+
- Resizable (4 modes)
|
|
85
|
+
- Helper and error text
|
|
86
|
+
- 3 sizes
|
|
87
|
+
- Keyboard accessible
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# snice-timeline
|
|
2
|
+
|
|
3
|
+
Displays chronological events with markers.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
orientation: 'vertical'|'horizontal' = 'vertical';
|
|
9
|
+
position: 'left'|'right'|'alternate' = 'left';
|
|
10
|
+
items: TimelineItem[] = [];
|
|
11
|
+
reverse: boolean = false;
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## TimelineItem
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
interface TimelineItem {
|
|
18
|
+
timestamp?: string;
|
|
19
|
+
title: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
icon?: string;
|
|
22
|
+
variant?: 'default'|'success'|'warning'|'error'|'info';
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
<!-- Basic --><snice-timeline id="timeline"></snice-timeline>
|
|
30
|
+
<script>
|
|
31
|
+
timeline.items = [{
|
|
32
|
+
timestamp: '2024-01-15',
|
|
33
|
+
title: 'Event',
|
|
34
|
+
description: 'Details'
|
|
35
|
+
}];
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<!-- Vertical positions -->
|
|
39
|
+
<snice-timeline position="left"></snice-timeline>
|
|
40
|
+
<snice-timeline position="right"></snice-timeline>
|
|
41
|
+
<snice-timeline position="alternate"></snice-timeline>
|
|
42
|
+
|
|
43
|
+
<!-- Horizontal -->
|
|
44
|
+
<snice-timeline orientation="horizontal"></snice-timeline>
|
|
45
|
+
|
|
46
|
+
<!-- Variants -->
|
|
47
|
+
<script>
|
|
48
|
+
timeline.items = [
|
|
49
|
+
{ title: 'Success', variant: 'success' },
|
|
50
|
+
{ title: 'Warning', variant: 'warning' },
|
|
51
|
+
{ title: 'Error', variant: 'error' },
|
|
52
|
+
{ title: 'Info', variant: 'info' }
|
|
53
|
+
];
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<!-- Custom icons -->
|
|
57
|
+
<script>
|
|
58
|
+
timeline.items = [
|
|
59
|
+
{ title: 'Planning', icon: '📋' },
|
|
60
|
+
{ title: 'Development', icon: '💻' },
|
|
61
|
+
{ title: 'Launch', icon: '🚀' }
|
|
62
|
+
];
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<!-- Reversed -->
|
|
66
|
+
<snice-timeline reverse></snice-timeline>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Features
|
|
70
|
+
|
|
71
|
+
- Vertical and horizontal orientations
|
|
72
|
+
- Left/right/alternate positioning (vertical)
|
|
73
|
+
- 5 item variants with default icons
|
|
74
|
+
- Custom icons supported
|
|
75
|
+
- Timestamps and descriptions optional
|
|
76
|
+
- Connecting lines between items
|
|
77
|
+
- Reversible order
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Banner Component
|
|
2
|
+
|
|
3
|
+
The `<snice-banner>` component displays fixed-position notification banners at the top or bottom of the viewport.
|
|
4
|
+
|
|
5
|
+
## Basic Usage
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<snice-banner
|
|
9
|
+
variant="info"
|
|
10
|
+
message="This is an informational message"
|
|
11
|
+
open
|
|
12
|
+
></snice-banner>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
| Property | Type | Default | Description |
|
|
18
|
+
|----------|------|---------|-------------|
|
|
19
|
+
| `variant` | `'info' \| 'success' \| 'warning' \| 'error'` | `'info'` | Visual variant |
|
|
20
|
+
| `position` | `'top' \| 'bottom'` | `'top'` | Position on screen |
|
|
21
|
+
| `message` | `string` | `''` | Banner message |
|
|
22
|
+
| `dismissible` | `boolean` | `true` | Show close button |
|
|
23
|
+
| `icon` | `string` | `''` | Custom icon (default icons per variant) |
|
|
24
|
+
| `actionText` | `string` | `''` | Action button text |
|
|
25
|
+
| `open` | `boolean` | `false` | Banner visibility |
|
|
26
|
+
|
|
27
|
+
## Methods
|
|
28
|
+
|
|
29
|
+
### `show(): void`
|
|
30
|
+
Show the banner.
|
|
31
|
+
|
|
32
|
+
### `hide(): void`
|
|
33
|
+
Hide the banner.
|
|
34
|
+
|
|
35
|
+
### `toggle(): void`
|
|
36
|
+
Toggle banner visibility.
|
|
37
|
+
|
|
38
|
+
## Events
|
|
39
|
+
|
|
40
|
+
### `@snice/banner-open`
|
|
41
|
+
Fired when banner opens.
|
|
42
|
+
|
|
43
|
+
### `@snice/banner-close`
|
|
44
|
+
Fired when banner closes.
|
|
45
|
+
|
|
46
|
+
### `@snice/banner-action`
|
|
47
|
+
Fired when action button is clicked.
|
|
48
|
+
|
|
49
|
+
## Examples
|
|
50
|
+
|
|
51
|
+
### Variants
|
|
52
|
+
|
|
53
|
+
```html
|
|
54
|
+
<snice-banner variant="info" message="Info message" open></snice-banner>
|
|
55
|
+
<snice-banner variant="success" message="Success!" open></snice-banner>
|
|
56
|
+
<snice-banner variant="warning" message="Warning" open></snice-banner>
|
|
57
|
+
<snice-banner variant="error" message="Error occurred" open></snice-banner>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### With Action Button
|
|
61
|
+
|
|
62
|
+
```html
|
|
63
|
+
<snice-banner
|
|
64
|
+
message="A new version is available"
|
|
65
|
+
action-text="Update Now"
|
|
66
|
+
open
|
|
67
|
+
></snice-banner>
|
|
68
|
+
|
|
69
|
+
<script>
|
|
70
|
+
document.querySelector('snice-banner').addEventListener('@snice/banner-action', () => {
|
|
71
|
+
console.log('Update clicked');
|
|
72
|
+
});
|
|
73
|
+
</script>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Bottom Position
|
|
77
|
+
|
|
78
|
+
```html
|
|
79
|
+
<snice-banner
|
|
80
|
+
position="bottom"
|
|
81
|
+
message="Cookie notice"
|
|
82
|
+
action-text="Accept"
|
|
83
|
+
open
|
|
84
|
+
></snice-banner>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Not Dismissible
|
|
88
|
+
|
|
89
|
+
```html
|
|
90
|
+
<snice-banner
|
|
91
|
+
message="Maintenance mode active"
|
|
92
|
+
dismissible="false"
|
|
93
|
+
variant="warning"
|
|
94
|
+
open
|
|
95
|
+
></snice-banner>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Programmatic Control
|
|
99
|
+
|
|
100
|
+
```html
|
|
101
|
+
<snice-banner id="myBanner" message="Hello"></snice-banner>
|
|
102
|
+
|
|
103
|
+
<button onclick="myBanner.show()">Show</button>
|
|
104
|
+
<button onclick="myBanner.hide()">Hide</button>
|
|
105
|
+
<button onclick="myBanner.toggle()">Toggle</button>
|
|
106
|
+
```
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Color Display Component
|
|
2
|
+
|
|
3
|
+
The `<snice-color-display>` component displays colors with a swatch and formatted label.
|
|
4
|
+
|
|
5
|
+
## Basic Usage
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<snice-color-display value="#3b82f6"></snice-color-display>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Properties
|
|
12
|
+
|
|
13
|
+
| Property | Type | Default | Description |
|
|
14
|
+
|----------|------|---------|-------------|
|
|
15
|
+
| `value` | `string` | `''` | Color value (hex format) |
|
|
16
|
+
| `format` | `'hex' \| 'rgb' \| 'hsl'` | `'hex'` | Display format |
|
|
17
|
+
| `showSwatch` | `boolean` | `true` | Show color swatch |
|
|
18
|
+
| `showLabel` | `boolean` | `true` | Show color label |
|
|
19
|
+
| `swatchSize` | `'small' \| 'medium' \| 'large'` | `'medium'` | Swatch size |
|
|
20
|
+
| `label` | `string` | `''` | Custom label text |
|
|
21
|
+
|
|
22
|
+
## Examples
|
|
23
|
+
|
|
24
|
+
### Basic Colors
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<snice-color-display value="#ff0000"></snice-color-display>
|
|
28
|
+
<snice-color-display value="#00ff00"></snice-color-display>
|
|
29
|
+
<snice-color-display value="#0000ff"></snice-color-display>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Color Formats
|
|
33
|
+
|
|
34
|
+
```html
|
|
35
|
+
<snice-color-display value="#3b82f6" format="hex"></snice-color-display>
|
|
36
|
+
<snice-color-display value="#3b82f6" format="rgb"></snice-color-display>
|
|
37
|
+
<snice-color-display value="#3b82f6" format="hsl"></snice-color-display>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Swatch Sizes
|
|
41
|
+
|
|
42
|
+
```html
|
|
43
|
+
<snice-color-display value="#10b981" swatch-size="small"></snice-color-display>
|
|
44
|
+
<snice-color-display value="#10b981" swatch-size="medium"></snice-color-display>
|
|
45
|
+
<snice-color-display value="#10b981" swatch-size="large"></snice-color-display>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Custom Labels
|
|
49
|
+
|
|
50
|
+
```html
|
|
51
|
+
<snice-color-display value="#ef4444" label="Error Red"></snice-color-display>
|
|
52
|
+
<snice-color-display value="#10b981" label="Success Green"></snice-color-display>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Swatch Only
|
|
56
|
+
|
|
57
|
+
```html
|
|
58
|
+
<snice-color-display
|
|
59
|
+
value="#3b82f6"
|
|
60
|
+
show-label="false"
|
|
61
|
+
swatch-size="large"
|
|
62
|
+
></snice-color-display>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Label Only
|
|
66
|
+
|
|
67
|
+
```html
|
|
68
|
+
<snice-color-display
|
|
69
|
+
value="#3b82f6"
|
|
70
|
+
show-swatch="false"
|
|
71
|
+
format="rgb"
|
|
72
|
+
></snice-color-display>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Styling
|
|
76
|
+
|
|
77
|
+
```css
|
|
78
|
+
snice-color-display::part(container) {
|
|
79
|
+
/* Container */
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
snice-color-display::part(swatch) {
|
|
83
|
+
/* Color swatch */
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
snice-color-display::part(label) {
|
|
87
|
+
/* Color label */
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Notes
|
|
92
|
+
|
|
93
|
+
- Colors must be provided in hex format (#RRGGBB)
|
|
94
|
+
- The component automatically converts to RGB and HSL formats
|
|
95
|
+
- When no custom label is provided, the formatted color value is used
|
|
96
|
+
- Swatch and label can be shown/hidden independently
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Color Picker Component
|
|
2
|
+
|
|
3
|
+
The `<snice-color-picker>` component provides a color selection interface with format conversion and preset colors.
|
|
4
|
+
|
|
5
|
+
## Basic Usage
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<snice-color-picker
|
|
9
|
+
label="Brand Color"
|
|
10
|
+
value="#3b82f6"
|
|
11
|
+
show-presets
|
|
12
|
+
></snice-color-picker>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
| Property | Type | Default | Description |
|
|
18
|
+
|----------|------|---------|-------------|
|
|
19
|
+
| `value` | `string` | `'#000000'` | Current color value |
|
|
20
|
+
| `format` | `'hex' \| 'rgb' \| 'hsl'` | `'hex'` | Display format |
|
|
21
|
+
| `size` | `'small' \| 'medium' \| 'large'` | `'medium'` | Size variant |
|
|
22
|
+
| `label` | `string` | `''` | Label text |
|
|
23
|
+
| `helperText` | `string` | `''` | Helper text |
|
|
24
|
+
| `errorText` | `string` | `''` | Error message |
|
|
25
|
+
| `disabled` | `boolean` | `false` | Disabled state |
|
|
26
|
+
| `required` | `boolean` | `false` | Required state |
|
|
27
|
+
| `invalid` | `boolean` | `false` | Invalid state |
|
|
28
|
+
| `name` | `string` | `''` | Form field name |
|
|
29
|
+
| `showInput` | `boolean` | `true` | Show text input |
|
|
30
|
+
| `showPresets` | `boolean` | `false` | Show preset colors |
|
|
31
|
+
| `presets` | `string[]` | `[...]` | Preset color values |
|
|
32
|
+
|
|
33
|
+
## Methods
|
|
34
|
+
|
|
35
|
+
### `focus(): void`
|
|
36
|
+
Focus the color picker.
|
|
37
|
+
|
|
38
|
+
### `blur(): void`
|
|
39
|
+
Blur the color picker.
|
|
40
|
+
|
|
41
|
+
## Events
|
|
42
|
+
|
|
43
|
+
### `@snice/color-picker-change`
|
|
44
|
+
Fired when color changes.
|
|
45
|
+
|
|
46
|
+
**Detail**: `{ value: string, colorPicker: SniceColorPickerElement }`
|
|
47
|
+
|
|
48
|
+
## Examples
|
|
49
|
+
|
|
50
|
+
### Basic
|
|
51
|
+
|
|
52
|
+
```html
|
|
53
|
+
<snice-color-picker label="Background Color"></snice-color-picker>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### With Presets
|
|
57
|
+
|
|
58
|
+
```html
|
|
59
|
+
<snice-color-picker
|
|
60
|
+
label="Theme Color"
|
|
61
|
+
show-presets
|
|
62
|
+
></snice-color-picker>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Different Formats
|
|
66
|
+
|
|
67
|
+
```html
|
|
68
|
+
<snice-color-picker format="hex" label="Hex"></snice-color-picker>
|
|
69
|
+
<snice-color-picker format="rgb" label="RGB"></snice-color-picker>
|
|
70
|
+
<snice-color-picker format="hsl" label="HSL"></snice-color-picker>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Custom Presets
|
|
74
|
+
|
|
75
|
+
```html
|
|
76
|
+
<snice-color-picker
|
|
77
|
+
label="Brand Colors"
|
|
78
|
+
show-presets
|
|
79
|
+
presets='["#ff0000", "#00ff00", "#0000ff"]'
|
|
80
|
+
></snice-color-picker>
|
|
81
|
+
```
|