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
package/dist/parts.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Simplified lit-html-style template system
|
|
3
|
-
* Based on lit-html's approach but simplified
|
|
4
|
-
*/
|
|
5
1
|
import { TemplateResult } from './template';
|
|
6
2
|
/**
|
|
7
3
|
* A prepared template ready for rendering
|
|
@@ -12,13 +8,12 @@ declare class Template {
|
|
|
12
8
|
constructor(result: TemplateResult, element: HTMLTemplateElement, attrNamesForParts: string[]);
|
|
13
9
|
}
|
|
14
10
|
interface TemplatePart {
|
|
15
|
-
type: 'node' | 'attribute' | 'property' | 'boolean-attribute' | 'event' | 'if' | 'case';
|
|
11
|
+
type: 'node' | 'attribute' | 'property' | 'boolean-attribute' | 'event' | 'conditional-if' | 'conditional-case';
|
|
16
12
|
index: number;
|
|
17
13
|
name?: string;
|
|
18
14
|
element?: Element;
|
|
19
15
|
startNode?: Comment;
|
|
20
16
|
endNode?: Comment;
|
|
21
|
-
caseElement?: Element;
|
|
22
17
|
attrStrings?: string[];
|
|
23
18
|
}
|
|
24
19
|
/**
|
|
@@ -28,6 +23,8 @@ export declare class TemplateInstance {
|
|
|
28
23
|
template: Template;
|
|
29
24
|
parts: Part[];
|
|
30
25
|
fragment: DocumentFragment | null;
|
|
26
|
+
private conditionalParts;
|
|
27
|
+
private regularParts;
|
|
31
28
|
constructor(result: TemplateResult);
|
|
32
29
|
renderFragment(): DocumentFragment;
|
|
33
30
|
render(values: readonly any[]): DocumentFragment;
|
|
@@ -100,6 +97,7 @@ export declare class EventPart extends Part {
|
|
|
100
97
|
private listener;
|
|
101
98
|
private value;
|
|
102
99
|
private keyFilter;
|
|
100
|
+
private host;
|
|
103
101
|
constructor(element: Element, eventName: string);
|
|
104
102
|
commit(value: any): void;
|
|
105
103
|
clear(): void;
|
|
@@ -129,29 +127,28 @@ export declare function parseKeyboardFilter(spec: string): KeyboardFilter;
|
|
|
129
127
|
*/
|
|
130
128
|
export declare function matchesKeyboardFilter(event: KeyboardEvent, filter: KeyboardFilter): boolean;
|
|
131
129
|
/**
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* instead of just hiding them with CSS
|
|
130
|
+
* ConditionalIfPart handles <if> conditional rendering
|
|
131
|
+
* Removes/inserts DOM nodes based on condition
|
|
135
132
|
*/
|
|
136
|
-
export declare class
|
|
133
|
+
export declare class ConditionalIfPart extends Part {
|
|
137
134
|
private ifElement;
|
|
138
135
|
private value;
|
|
139
136
|
private fragment;
|
|
140
|
-
private childNodes;
|
|
141
137
|
constructor(ifElement: Element);
|
|
142
138
|
commit(value: any): void;
|
|
143
139
|
clear(): void;
|
|
144
140
|
}
|
|
145
141
|
/**
|
|
146
|
-
*
|
|
147
|
-
*
|
|
142
|
+
* ConditionalCasePart handles <case>/<when>/<default> conditional rendering
|
|
143
|
+
* Removes/inserts matching branch based on value
|
|
148
144
|
*/
|
|
149
|
-
export declare class
|
|
145
|
+
export declare class ConditionalCasePart extends Part {
|
|
150
146
|
private caseElement;
|
|
151
147
|
private value;
|
|
152
|
-
private
|
|
148
|
+
private childrenMap;
|
|
153
149
|
private fragments;
|
|
154
|
-
private
|
|
150
|
+
private defaultChild;
|
|
151
|
+
private currentChild;
|
|
155
152
|
constructor(caseElement: Element);
|
|
156
153
|
commit(value: any): void;
|
|
157
154
|
clear(): void;
|
package/dist/symbols.cjs
CHANGED
package/dist/symbols.esm.js
CHANGED
package/dist/template.d.ts
CHANGED
package/dist/transitions.cjs
CHANGED
package/dist/transitions.esm.js
CHANGED
package/docs/ai/README.md
CHANGED
|
@@ -12,6 +12,15 @@ Token-efficient reference docs for AI assistants. Same content as human docs, mi
|
|
|
12
12
|
- `api.md` - Complete API reference
|
|
13
13
|
- `patterns.md` - Common usage patterns
|
|
14
14
|
- `architecture.md` - System design
|
|
15
|
-
- `components/*.md` - Component reference
|
|
15
|
+
- `components/*.md` - Component reference (DO NOT read all upfront - read only as needed)
|
|
16
16
|
|
|
17
17
|
Read these instead of `/docs/*.md` for faster context loading.
|
|
18
|
+
|
|
19
|
+
## Available Components
|
|
20
|
+
|
|
21
|
+
**IMPORTANT:** Do NOT read all component docs. Only read a component's doc when you need to use or reference it.
|
|
22
|
+
|
|
23
|
+
**Implemented Components:**
|
|
24
|
+
- accordion, accordion-item, alert, avatar, badge, banner, breadcrumbs, button, card, checkbox, chip, color-display, color-picker, date-picker, divider, drawer, empty-state, file-upload, image, input, login, modal, nav, progress, radio, select, skeleton, slider, spinner, switch, table, tabs, tab, textarea, timeline, tooltip
|
|
25
|
+
|
|
26
|
+
**To use a component:** Read `docs/ai/components/{component-name}.md` only when needed.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# snice-banner
|
|
2
|
+
|
|
3
|
+
Fixed position notification banner.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
variant: 'info'|'success'|'warning'|'error' = 'info';
|
|
9
|
+
position: 'top'|'bottom' = 'top';
|
|
10
|
+
message: string = '';
|
|
11
|
+
dismissible: boolean = true;
|
|
12
|
+
icon: string = '';
|
|
13
|
+
actionText: string = '';
|
|
14
|
+
open: boolean = false;
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Methods
|
|
18
|
+
|
|
19
|
+
- `show()` - Show banner
|
|
20
|
+
- `hide()` - Hide banner
|
|
21
|
+
- `toggle()` - Toggle banner
|
|
22
|
+
|
|
23
|
+
## Events
|
|
24
|
+
|
|
25
|
+
- `open` - {banner}
|
|
26
|
+
- `close` - {banner}
|
|
27
|
+
- `action` - {banner}
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
```html
|
|
32
|
+
<!-- Basic -->
|
|
33
|
+
<snice-banner message="This is an info message" open></snice-banner>
|
|
34
|
+
|
|
35
|
+
<!-- Variants -->
|
|
36
|
+
<snice-banner variant="info" message="Info"></snice-banner>
|
|
37
|
+
<snice-banner variant="success" message="Success"></snice-banner>
|
|
38
|
+
<snice-banner variant="warning" message="Warning"></snice-banner>
|
|
39
|
+
<snice-banner variant="error" message="Error"></snice-banner>
|
|
40
|
+
|
|
41
|
+
<!-- Position -->
|
|
42
|
+
<snice-banner position="top" message="Top banner" open></snice-banner>
|
|
43
|
+
<snice-banner position="bottom" message="Bottom banner" open></snice-banner>
|
|
44
|
+
|
|
45
|
+
<!-- With action -->
|
|
46
|
+
<snice-banner
|
|
47
|
+
message="Update available"
|
|
48
|
+
action-text="Update Now"
|
|
49
|
+
open
|
|
50
|
+
></snice-banner>
|
|
51
|
+
|
|
52
|
+
<!-- Not dismissible -->
|
|
53
|
+
<snice-banner
|
|
54
|
+
message="Important notice"
|
|
55
|
+
dismissible="false"
|
|
56
|
+
open
|
|
57
|
+
></snice-banner>
|
|
58
|
+
|
|
59
|
+
<!-- Custom icon -->
|
|
60
|
+
<snice-banner
|
|
61
|
+
icon="🎉"
|
|
62
|
+
message="Celebration!"
|
|
63
|
+
open
|
|
64
|
+
></snice-banner>
|
|
65
|
+
|
|
66
|
+
<!-- API -->
|
|
67
|
+
<snice-banner id="banner" message="Hello"></snice-banner>
|
|
68
|
+
<script>
|
|
69
|
+
const banner = document.querySelector('#banner');
|
|
70
|
+
banner.show();
|
|
71
|
+
banner.hide();
|
|
72
|
+
banner.toggle();
|
|
73
|
+
</script>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Features
|
|
77
|
+
|
|
78
|
+
- 4 variants (info, success, warning, error)
|
|
79
|
+
- Top or bottom positioning
|
|
80
|
+
- Dismissible with close button
|
|
81
|
+
- Optional action button
|
|
82
|
+
- Smooth slide animation
|
|
83
|
+
- Fixed positioning
|
|
84
|
+
- Accessible (role=alert)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# snice-color-display
|
|
2
|
+
|
|
3
|
+
Displays colors with swatch and label.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
value: string = '';
|
|
9
|
+
format: 'hex'|'rgb'|'hsl' = 'hex';
|
|
10
|
+
showSwatch: boolean = true;
|
|
11
|
+
showLabel: boolean = true;
|
|
12
|
+
swatchSize: 'small'|'medium'|'large' = 'medium';
|
|
13
|
+
label: string = '';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<!-- Basic -->
|
|
20
|
+
<snice-color-display value="#3b82f6"></snice-color-display>
|
|
21
|
+
|
|
22
|
+
<!-- Formats -->
|
|
23
|
+
<snice-color-display value="#ff0000" format="hex"></snice-color-display>
|
|
24
|
+
<snice-color-display value="#ff0000" format="rgb"></snice-color-display>
|
|
25
|
+
<snice-color-display value="#ff0000" format="hsl"></snice-color-display>
|
|
26
|
+
|
|
27
|
+
<!-- Sizes -->
|
|
28
|
+
<snice-color-display value="#10b981" swatch-size="small"></snice-color-display>
|
|
29
|
+
<snice-color-display value="#10b981" swatch-size="medium"></snice-color-display>
|
|
30
|
+
<snice-color-display value="#10b981" swatch-size="large"></snice-color-display>
|
|
31
|
+
|
|
32
|
+
<!-- Custom label -->
|
|
33
|
+
<snice-color-display value="#ef4444" label="Error Red"></snice-color-display>
|
|
34
|
+
|
|
35
|
+
<!-- Swatch only -->
|
|
36
|
+
<snice-color-display value="#3b82f6" show-label="false"></snice-color-display>
|
|
37
|
+
|
|
38
|
+
<!-- Label only -->
|
|
39
|
+
<snice-color-display value="#3b82f6" show-swatch="false"></snice-color-display>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Features
|
|
43
|
+
|
|
44
|
+
- Auto-converts hex to RGB/HSL
|
|
45
|
+
- 3 swatch sizes (16px, 24px, 32px)
|
|
46
|
+
- Custom labels supported
|
|
47
|
+
- Swatch and label toggle
|
|
48
|
+
- Monospace font for color values
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# snice-color-picker
|
|
2
|
+
|
|
3
|
+
Color picker with format conversion and presets.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
value: string = '#000000';
|
|
9
|
+
format: 'hex'|'rgb'|'hsl' = 'hex';
|
|
10
|
+
size: 'small'|'medium'|'large' = 'medium';
|
|
11
|
+
label: string = '';
|
|
12
|
+
helperText: string = '';
|
|
13
|
+
errorText: string = '';
|
|
14
|
+
disabled: boolean = false;
|
|
15
|
+
required: boolean = false;
|
|
16
|
+
invalid: boolean = false;
|
|
17
|
+
name: string = '';
|
|
18
|
+
showInput: boolean = true;
|
|
19
|
+
showPresets: boolean = false;
|
|
20
|
+
presets: string[] = [...];
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Methods
|
|
24
|
+
|
|
25
|
+
- `focus()` - Focus picker
|
|
26
|
+
- `blur()` - Blur picker
|
|
27
|
+
|
|
28
|
+
## Events
|
|
29
|
+
|
|
30
|
+
- `input` - {value, colorPicker}
|
|
31
|
+
- `change` - {value, colorPicker}
|
|
32
|
+
- `focus` - {colorPicker}
|
|
33
|
+
- `blur` - {colorPicker}
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
<!-- Basic -->
|
|
39
|
+
<snice-color-picker label="Color" value="#ff0000"></snice-color-picker>
|
|
40
|
+
|
|
41
|
+
<!-- Formats -->
|
|
42
|
+
<snice-color-picker format="hex"></snice-color-picker>
|
|
43
|
+
<snice-color-picker format="rgb"></snice-color-picker>
|
|
44
|
+
<snice-color-picker format="hsl"></snice-color-picker>
|
|
45
|
+
|
|
46
|
+
<!-- With presets -->
|
|
47
|
+
<snice-color-picker show-presets></snice-color-picker>
|
|
48
|
+
|
|
49
|
+
<!-- No input -->
|
|
50
|
+
<snice-color-picker show-input="false"></snice-color-picker>
|
|
51
|
+
|
|
52
|
+
<!-- Sizes -->
|
|
53
|
+
<snice-color-picker size="small"></snice-color-picker>
|
|
54
|
+
<snice-color-picker size="medium"></snice-color-picker>
|
|
55
|
+
<snice-color-picker size="large"></snice-color-picker>
|
|
56
|
+
|
|
57
|
+
<!-- Events -->
|
|
58
|
+
<snice-color-picker id="picker"></snice-color-picker>
|
|
59
|
+
<script>
|
|
60
|
+
const picker = document.querySelector('#picker');
|
|
61
|
+
picker.addEventListener('@snice/color-picker-change', (e) => {
|
|
62
|
+
console.log('Color:', e.detail.value);
|
|
63
|
+
});
|
|
64
|
+
</script>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Features
|
|
68
|
+
|
|
69
|
+
- Form-associated custom element
|
|
70
|
+
- Native color picker integration
|
|
71
|
+
- 3 color formats (hex, rgb, hsl)
|
|
72
|
+
- Format conversion
|
|
73
|
+
- Color presets
|
|
74
|
+
- 3 sizes
|
|
75
|
+
- Accessible
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# snice-empty-state
|
|
2
|
+
|
|
3
|
+
Empty state placeholder for no data scenarios.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
size: 'small'|'medium'|'large' = 'medium';
|
|
9
|
+
icon: string = '📭';
|
|
10
|
+
title: string = 'No data';
|
|
11
|
+
description: string = '';
|
|
12
|
+
actionText: string = '';
|
|
13
|
+
actionHref: string = '';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Events
|
|
17
|
+
|
|
18
|
+
- `action` - {emptyState}
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```html
|
|
23
|
+
<!-- Basic -->
|
|
24
|
+
<snice-empty-state></snice-empty-state>
|
|
25
|
+
|
|
26
|
+
<!-- Custom -->
|
|
27
|
+
<snice-empty-state
|
|
28
|
+
icon="🔍"
|
|
29
|
+
title="No results found"
|
|
30
|
+
description="Try adjusting your search"
|
|
31
|
+
></snice-empty-state>
|
|
32
|
+
|
|
33
|
+
<!-- With action -->
|
|
34
|
+
<snice-empty-state
|
|
35
|
+
title="No items yet"
|
|
36
|
+
description="Get started by creating your first item"
|
|
37
|
+
action-text="Create Item"
|
|
38
|
+
></snice-empty-state>
|
|
39
|
+
|
|
40
|
+
<!-- With link -->
|
|
41
|
+
<snice-empty-state
|
|
42
|
+
title="Page not found"
|
|
43
|
+
action-text="Go Home"
|
|
44
|
+
action-href="/"
|
|
45
|
+
></snice-empty-state>
|
|
46
|
+
|
|
47
|
+
<!-- Sizes -->
|
|
48
|
+
<snice-empty-state size="small"></snice-empty-state>
|
|
49
|
+
<snice-empty-state size="medium"></snice-empty-state>
|
|
50
|
+
<snice-empty-state size="large"></snice-empty-state>
|
|
51
|
+
|
|
52
|
+
<!-- Events -->
|
|
53
|
+
<snice-empty-state id="empty" action-text="Click"></snice-empty-state>
|
|
54
|
+
<script>
|
|
55
|
+
document.querySelector('#empty').addEventListener('@snice/empty-state-action', () => {
|
|
56
|
+
console.log('Action clicked');
|
|
57
|
+
});
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<!-- Custom content -->
|
|
61
|
+
<snice-empty-state title="No data">
|
|
62
|
+
<div>Custom HTML content here</div>
|
|
63
|
+
</snice-empty-state>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Features
|
|
67
|
+
|
|
68
|
+
- Customizable icon, title, description
|
|
69
|
+
- Optional action button or link
|
|
70
|
+
- 3 sizes
|
|
71
|
+
- Slot for custom content
|
|
72
|
+
- Accessible
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# snice-file-upload
|
|
2
|
+
|
|
3
|
+
File upload with drag-and-drop and preview.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
variant: 'outlined'|'filled' = 'outlined';
|
|
9
|
+
size: 'small'|'medium'|'large' = 'medium';
|
|
10
|
+
accept: string = '';
|
|
11
|
+
multiple: boolean = false;
|
|
12
|
+
disabled: boolean = false;
|
|
13
|
+
required: boolean = false;
|
|
14
|
+
invalid: boolean = false;
|
|
15
|
+
label: string = '';
|
|
16
|
+
helperText: string = '';
|
|
17
|
+
errorText: string = '';
|
|
18
|
+
maxSize: number = -1; // bytes
|
|
19
|
+
maxFiles: number = -1;
|
|
20
|
+
name: string = '';
|
|
21
|
+
dragDrop: boolean = true;
|
|
22
|
+
showPreview: boolean = true;
|
|
23
|
+
files: FileList | null;
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Methods
|
|
27
|
+
|
|
28
|
+
- `clear()` - Clear all files
|
|
29
|
+
- `removeFile(index)` - Remove file by index
|
|
30
|
+
|
|
31
|
+
## Events
|
|
32
|
+
|
|
33
|
+
- `change` - {files, fileUpload}
|
|
34
|
+
- `error` - {message, fileUpload}
|
|
35
|
+
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
```html
|
|
39
|
+
<!-- Basic -->
|
|
40
|
+
<snice-file-upload label="Upload File"></snice-file-upload>
|
|
41
|
+
|
|
42
|
+
<!-- Multiple files -->
|
|
43
|
+
<snice-file-upload multiple label="Upload Files"></snice-file-upload>
|
|
44
|
+
|
|
45
|
+
<!-- File type restrictions -->
|
|
46
|
+
<snice-file-upload accept="image/*" label="Images only"></snice-file-upload>
|
|
47
|
+
<snice-file-upload accept=".pdf,.doc,.docx"></snice-file-upload>
|
|
48
|
+
|
|
49
|
+
<!-- Size limit (5MB) -->
|
|
50
|
+
<snice-file-upload max-size="5242880"></snice-file-upload>
|
|
51
|
+
|
|
52
|
+
<!-- File count limit -->
|
|
53
|
+
<snice-file-upload multiple max-files="5"></snice-file-upload>
|
|
54
|
+
|
|
55
|
+
<!-- No drag-drop -->
|
|
56
|
+
<snice-file-upload drag-drop="false"></snice-file-upload>
|
|
57
|
+
|
|
58
|
+
<!-- No preview -->
|
|
59
|
+
<snice-file-upload show-preview="false"></snice-file-upload>
|
|
60
|
+
|
|
61
|
+
<!-- Variants -->
|
|
62
|
+
<snice-file-upload variant="outlined"></snice-file-upload>
|
|
63
|
+
<snice-file-upload variant="filled"></snice-file-upload>
|
|
64
|
+
|
|
65
|
+
<!-- Sizes -->
|
|
66
|
+
<snice-file-upload size="small"></snice-file-upload>
|
|
67
|
+
<snice-file-upload size="medium"></snice-file-upload>
|
|
68
|
+
<snice-file-upload size="large"></snice-file-upload>
|
|
69
|
+
|
|
70
|
+
<!-- Events -->
|
|
71
|
+
<snice-file-upload id="upload"></snice-file-upload>
|
|
72
|
+
<script>
|
|
73
|
+
const upload = document.querySelector('#upload');
|
|
74
|
+
upload.addEventListener('@snice/file-upload-change', (e) => {
|
|
75
|
+
console.log('Files:', e.detail.files);
|
|
76
|
+
});
|
|
77
|
+
upload.addEventListener('@snice/file-upload-error', (e) => {
|
|
78
|
+
console.error('Error:', e.detail.message);
|
|
79
|
+
});
|
|
80
|
+
</script>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Features
|
|
84
|
+
|
|
85
|
+
- Form-associated custom element
|
|
86
|
+
- Drag-and-drop support
|
|
87
|
+
- Image preview
|
|
88
|
+
- File type filtering
|
|
89
|
+
- Size validation
|
|
90
|
+
- File count limits
|
|
91
|
+
- Multiple file selection
|
|
92
|
+
- 2 variants, 3 sizes
|
|
93
|
+
- Accessible
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# snice-image
|
|
2
|
+
|
|
3
|
+
Flexible image component with variants and lazy loading.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
src: string = '';
|
|
9
|
+
alt: string = '';
|
|
10
|
+
fallback: string = '';
|
|
11
|
+
variant: 'rounded'|'square'|'circle' = 'rounded';
|
|
12
|
+
size: 'small'|'medium'|'large' = 'medium';
|
|
13
|
+
lazy: boolean = true;
|
|
14
|
+
fit: 'cover'|'contain'|'fill'|'none'|'scale-down' = 'cover';
|
|
15
|
+
width: string = '';
|
|
16
|
+
height: string = '';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<!-- Basic -->
|
|
23
|
+
<snice-image src="image.jpg" alt="Description"></snice-image>
|
|
24
|
+
|
|
25
|
+
<!-- Sizes -->
|
|
26
|
+
<snice-image src="image.jpg" size="small"></snice-image>
|
|
27
|
+
<snice-image src="image.jpg" size="medium"></snice-image>
|
|
28
|
+
<snice-image src="image.jpg" size="large"></snice-image>
|
|
29
|
+
|
|
30
|
+
<!-- Variants -->
|
|
31
|
+
<snice-image src="image.jpg" variant="rounded"></snice-image>
|
|
32
|
+
<snice-image src="image.jpg" variant="square"></snice-image>
|
|
33
|
+
<snice-image src="image.jpg" variant="circle"></snice-image>
|
|
34
|
+
|
|
35
|
+
<!-- Fit -->
|
|
36
|
+
<snice-image src="image.jpg" fit="cover" width="200px" height="200px"></snice-image>
|
|
37
|
+
<snice-image src="image.jpg" fit="contain" width="200px" height="200px"></snice-image>
|
|
38
|
+
|
|
39
|
+
<!-- Fallback -->
|
|
40
|
+
<snice-image src="image.jpg" fallback="placeholder.jpg"></snice-image>
|
|
41
|
+
|
|
42
|
+
<!-- Custom dimensions -->
|
|
43
|
+
<snice-image src="image.jpg" width="300px" height="200px"></snice-image>
|
|
44
|
+
|
|
45
|
+
<!-- Lazy loading -->
|
|
46
|
+
<snice-image src="image.jpg" lazy="false"></snice-image>
|
|
47
|
+
|
|
48
|
+
<!-- Placeholder -->
|
|
49
|
+
<snice-image size="medium" variant="circle"></snice-image>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Features
|
|
53
|
+
|
|
54
|
+
- 3 size presets (small: 48px, medium: 96px, large: 192px)
|
|
55
|
+
- 3 shape variants (rounded, square, circle)
|
|
56
|
+
- 5 object-fit options
|
|
57
|
+
- Lazy loading (default on)
|
|
58
|
+
- Fallback image support
|
|
59
|
+
- Placeholder for missing images
|
|
60
|
+
- Custom width/height
|