snice 2.5.4 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +501 -882
- package/bin/templates/base/src/components/counter-button.ts +13 -26
- package/bin/templates/base/src/controllers/counter-controller.ts +3 -3
- package/dist/components/accordion/snice-accordion-item.d.ts +4 -5
- package/dist/components/accordion/snice-accordion-item.js +37 -39
- package/dist/components/accordion/snice-accordion-item.js.map +1 -1
- package/dist/components/accordion/snice-accordion.d.ts +5 -11
- package/dist/components/accordion/snice-accordion.js +51 -52
- package/dist/components/accordion/snice-accordion.js.map +1 -1
- package/dist/components/alert/snice-alert.d.ts +2 -6
- package/dist/components/alert/snice-alert.js +41 -56
- package/dist/components/alert/snice-alert.js.map +1 -1
- package/dist/components/avatar/snice-avatar.d.ts +2 -6
- package/dist/components/avatar/snice-avatar.js +64 -71
- package/dist/components/avatar/snice-avatar.js.map +1 -1
- package/dist/components/badge/snice-badge.d.ts +2 -3
- package/dist/components/badge/snice-badge.js +22 -23
- package/dist/components/badge/snice-badge.js.map +1 -1
- package/dist/components/breadcrumbs/snice-breadcrumbs.d.ts +5 -12
- package/dist/components/breadcrumbs/snice-breadcrumbs.js +88 -89
- package/dist/components/breadcrumbs/snice-breadcrumbs.js.map +1 -1
- package/dist/components/button/snice-button.d.ts +3 -7
- package/dist/components/button/snice-button.js +37 -58
- package/dist/components/button/snice-button.js.map +1 -1
- package/dist/components/card/snice-card.d.ts +5 -8
- package/dist/components/card/snice-card.js +71 -56
- package/dist/components/card/snice-card.js.map +1 -1
- package/dist/components/checkbox/snice-checkbox.d.ts +4 -13
- package/dist/components/checkbox/snice-checkbox.js +66 -137
- package/dist/components/checkbox/snice-checkbox.js.map +1 -1
- package/dist/components/chip/snice-chip.d.ts +5 -11
- package/dist/components/chip/snice-chip.js +44 -47
- package/dist/components/chip/snice-chip.js.map +1 -1
- package/dist/components/date-picker/snice-date-picker.d.ts +11 -11
- package/dist/components/date-picker/snice-date-picker.js +134 -133
- package/dist/components/date-picker/snice-date-picker.js.map +1 -1
- package/dist/components/divider/snice-divider.d.ts +2 -4
- package/dist/components/divider/snice-divider.js +14 -22
- package/dist/components/divider/snice-divider.js.map +1 -1
- package/dist/components/drawer/snice-drawer.d.ts +4 -4
- package/dist/components/drawer/snice-drawer.js +25 -19
- package/dist/components/drawer/snice-drawer.js.map +1 -1
- package/dist/components/input/snice-input.d.ts +8 -6
- package/dist/components/input/snice-input.js +122 -105
- package/dist/components/input/snice-input.js.map +1 -1
- package/dist/components/layout/snice-layout-blog.d.ts +4 -4
- package/dist/components/layout/snice-layout-blog.js +21 -19
- package/dist/components/layout/snice-layout-blog.js.map +1 -1
- package/dist/components/layout/snice-layout-card.d.ts +2 -2
- package/dist/components/layout/snice-layout-card.js +16 -9
- package/dist/components/layout/snice-layout-card.js.map +1 -1
- package/dist/components/layout/snice-layout-centered.d.ts +2 -2
- package/dist/components/layout/snice-layout-centered.js +14 -7
- package/dist/components/layout/snice-layout-centered.js.map +1 -1
- package/dist/components/layout/snice-layout-dashboard.d.ts +5 -5
- package/dist/components/layout/snice-layout-dashboard.js +38 -30
- package/dist/components/layout/snice-layout-dashboard.js.map +1 -1
- package/dist/components/layout/snice-layout-fullscreen.d.ts +2 -2
- package/dist/components/layout/snice-layout-fullscreen.js +17 -10
- package/dist/components/layout/snice-layout-fullscreen.js.map +1 -1
- package/dist/components/layout/snice-layout-landing.d.ts +4 -4
- package/dist/components/layout/snice-layout-landing.js +21 -19
- package/dist/components/layout/snice-layout-landing.js.map +1 -1
- package/dist/components/layout/snice-layout-minimal.d.ts +2 -2
- package/dist/components/layout/snice-layout-minimal.js +17 -6
- package/dist/components/layout/snice-layout-minimal.js.map +1 -1
- package/dist/components/layout/snice-layout-sidebar.d.ts +5 -4
- package/dist/components/layout/snice-layout-sidebar.js +42 -20
- package/dist/components/layout/snice-layout-sidebar.js.map +1 -1
- package/dist/components/layout/snice-layout-split.d.ts +2 -2
- package/dist/components/layout/snice-layout-split.js +14 -7
- package/dist/components/layout/snice-layout-split.js.map +1 -1
- package/dist/components/layout/snice-layout.d.ts +4 -4
- package/dist/components/layout/snice-layout.js +16 -10
- package/dist/components/layout/snice-layout.js.map +1 -1
- package/dist/components/login/snice-login.d.ts +6 -11
- package/dist/components/login/snice-login.js +97 -71
- package/dist/components/login/snice-login.js.map +1 -1
- package/dist/components/modal/snice-modal.d.ts +5 -9
- package/dist/components/modal/snice-modal.js +47 -78
- package/dist/components/modal/snice-modal.js.map +1 -1
- package/dist/components/nav/snice-nav.d.ts +13 -7
- package/dist/components/nav/snice-nav.js +191 -100
- package/dist/components/nav/snice-nav.js.map +1 -1
- package/dist/components/nav/snice-nav.types.d.ts +3 -3
- package/dist/components/pagination/snice-pagination.d.ts +6 -7
- package/dist/components/pagination/snice-pagination.js +94 -81
- package/dist/components/pagination/snice-pagination.js.map +1 -1
- package/dist/components/progress/snice-progress.d.ts +2 -7
- package/dist/components/progress/snice-progress.js +41 -98
- package/dist/components/progress/snice-progress.js.map +1 -1
- package/dist/components/radio/snice-radio.d.ts +4 -4
- package/dist/components/radio/snice-radio.js +52 -44
- package/dist/components/radio/snice-radio.js.map +1 -1
- package/dist/components/select/snice-option.d.ts +2 -1
- package/dist/components/select/snice-option.js +12 -5
- package/dist/components/select/snice-option.js.map +1 -1
- package/dist/components/select/snice-select.d.ts +9 -21
- package/dist/components/select/snice-select.js +98 -170
- package/dist/components/select/snice-select.js.map +1 -1
- package/dist/components/skeleton/snice-skeleton.d.ts +2 -6
- package/dist/components/skeleton/snice-skeleton.js +18 -49
- package/dist/components/skeleton/snice-skeleton.js.map +1 -1
- package/dist/components/snice-cell-BLFVdxPp.js +4 -0
- package/dist/components/snice-cell-BLFVdxPp.js.map +1 -0
- package/dist/components/switch/snice-switch.d.ts +2 -2
- package/dist/components/switch/snice-switch.js +38 -26
- package/dist/components/switch/snice-switch.js.map +1 -1
- package/dist/components/table/snice-cell-actions.d.ts +24 -0
- package/dist/components/table/snice-cell-actions.js +149 -0
- package/dist/components/table/snice-cell-actions.js.map +1 -0
- package/dist/components/table/snice-cell-boolean.d.ts +2 -2
- package/dist/components/table/snice-cell-boolean.js +13 -7
- package/dist/components/table/snice-cell-boolean.js.map +1 -1
- package/dist/components/table/snice-cell-color.d.ts +18 -0
- package/dist/components/table/snice-cell-color.js +149 -0
- package/dist/components/table/snice-cell-color.js.map +1 -0
- package/dist/components/table/snice-cell-currency.d.ts +24 -0
- package/dist/components/table/snice-cell-currency.js +235 -0
- package/dist/components/table/snice-cell-currency.js.map +1 -0
- package/dist/components/table/snice-cell-date.d.ts +2 -2
- package/dist/components/table/snice-cell-date.js +14 -8
- package/dist/components/table/snice-cell-date.js.map +1 -1
- package/dist/components/table/snice-cell-duration.d.ts +2 -2
- package/dist/components/table/snice-cell-duration.js +12 -6
- package/dist/components/table/snice-cell-duration.js.map +1 -1
- package/dist/components/table/snice-cell-email.d.ts +15 -0
- package/dist/components/table/snice-cell-email.js +125 -0
- package/dist/components/table/snice-cell-email.js.map +1 -0
- package/dist/components/table/snice-cell-filesize.d.ts +2 -2
- package/dist/components/table/snice-cell-filesize.js +12 -6
- package/dist/components/table/snice-cell-filesize.js.map +1 -1
- package/dist/components/table/snice-cell-image.d.ts +20 -0
- package/dist/components/table/snice-cell-image.js +162 -0
- package/dist/components/table/snice-cell-image.js.map +1 -0
- package/dist/components/table/snice-cell-json.d.ts +20 -0
- package/dist/components/table/snice-cell-json.js +186 -0
- package/dist/components/table/snice-cell-json.js.map +1 -0
- package/dist/components/table/snice-cell-link.d.ts +17 -0
- package/dist/components/table/snice-cell-link.js +142 -0
- package/dist/components/table/snice-cell-link.js.map +1 -0
- package/dist/components/table/snice-cell-location.d.ts +19 -0
- package/dist/components/table/snice-cell-location.js +185 -0
- package/dist/components/table/snice-cell-location.js.map +1 -0
- package/dist/components/table/snice-cell-number.d.ts +2 -2
- package/dist/components/table/snice-cell-number.js +12 -6
- package/dist/components/table/snice-cell-number.js.map +1 -1
- package/dist/components/table/snice-cell-percentage.d.ts +22 -0
- package/dist/components/table/snice-cell-percentage.js +208 -0
- package/dist/components/table/snice-cell-percentage.js.map +1 -0
- package/dist/components/table/snice-cell-phone.d.ts +18 -0
- package/dist/components/table/snice-cell-phone.js +153 -0
- package/dist/components/table/snice-cell-phone.js.map +1 -0
- package/dist/components/table/snice-cell-progress.d.ts +2 -2
- package/dist/components/table/snice-cell-progress.js +12 -6
- package/dist/components/table/snice-cell-progress.js.map +1 -1
- package/dist/components/table/snice-cell-rating.d.ts +2 -2
- package/dist/components/table/snice-cell-rating.js +12 -6
- package/dist/components/table/snice-cell-rating.js.map +1 -1
- package/dist/components/table/snice-cell-sparkline.d.ts +2 -2
- package/dist/components/table/snice-cell-sparkline.js +13 -7
- package/dist/components/table/snice-cell-sparkline.js.map +1 -1
- package/dist/components/table/snice-cell-status.d.ts +17 -0
- package/dist/components/table/snice-cell-status.js +144 -0
- package/dist/components/table/snice-cell-status.js.map +1 -0
- package/dist/components/table/snice-cell-tag.d.ts +16 -0
- package/dist/components/table/snice-cell-tag.js +131 -0
- package/dist/components/table/snice-cell-tag.js.map +1 -0
- package/dist/components/table/snice-cell-text.d.ts +2 -2
- package/dist/components/table/snice-cell-text.js +14 -8
- package/dist/components/table/snice-cell-text.js.map +1 -1
- package/dist/components/table/snice-cell.d.ts +2 -2
- package/dist/components/table/snice-cell.js +12 -6
- package/dist/components/table/snice-cell.js.map +1 -1
- package/dist/components/table/snice-column.d.ts +1 -1
- package/dist/components/table/snice-column.js +6 -3
- package/dist/components/table/snice-column.js.map +1 -1
- package/dist/components/table/snice-header.d.ts +5 -5
- package/dist/components/table/snice-header.js +60 -50
- package/dist/components/table/snice-header.js.map +1 -1
- package/dist/components/table/snice-progress.d.ts +2 -2
- package/dist/components/table/snice-progress.js +18 -11
- package/dist/components/table/snice-progress.js.map +1 -1
- package/dist/components/table/snice-rating.d.ts +2 -2
- package/dist/components/table/snice-rating.js +15 -8
- package/dist/components/table/snice-rating.js.map +1 -1
- package/dist/components/table/snice-row.d.ts +17 -6
- package/dist/components/table/snice-row.js +95 -44
- package/dist/components/table/snice-row.js.map +1 -1
- package/dist/components/table/snice-table.d.ts +18 -10
- package/dist/components/table/snice-table.js +355 -173
- package/dist/components/table/snice-table.js.map +1 -1
- package/dist/components/table/snice-table.types.d.ts +101 -2
- package/dist/components/tabs/snice-tab-panel.d.ts +2 -2
- package/dist/components/tabs/snice-tab-panel.js +12 -6
- package/dist/components/tabs/snice-tab-panel.js.map +1 -1
- package/dist/components/tabs/snice-tab.d.ts +6 -5
- package/dist/components/tabs/snice-tab.js +36 -19
- package/dist/components/tabs/snice-tab.js.map +1 -1
- package/dist/components/tabs/snice-tabs.d.ts +5 -5
- package/dist/components/tabs/snice-tabs.js +38 -28
- package/dist/components/tabs/snice-tabs.js.map +1 -1
- package/dist/components/toast/snice-toast-container.d.ts +7 -7
- package/dist/components/toast/snice-toast-container.js +19 -12
- package/dist/components/toast/snice-toast-container.js.map +1 -1
- package/dist/components/toast/snice-toast.d.ts +3 -15
- package/dist/components/toast/snice-toast.js +49 -108
- package/dist/components/toast/snice-toast.js.map +1 -1
- package/dist/components/tooltip/snice-tooltip.d.ts +2 -2
- package/dist/components/tooltip/snice-tooltip.js +14 -7
- package/dist/components/tooltip/snice-tooltip.js.map +1 -1
- package/dist/context.d.ts +44 -0
- package/dist/element-ready.d.ts +40 -0
- package/dist/{types/element.d.ts → element.d.ts} +2 -8
- package/dist/{types/events.d.ts → events.d.ts} +0 -4
- package/dist/index.cjs +2589 -605
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +21 -0
- package/dist/index.esm.js +2568 -604
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +2589 -605
- package/dist/index.iife.js.map +1 -1
- package/dist/method-decorators.d.ts +121 -0
- package/dist/on.d.ts +59 -0
- package/dist/parts.d.ts +159 -0
- package/dist/render-debug.d.ts +27 -0
- package/dist/render-tracker.d.ts +14 -0
- package/dist/render.d.ts +96 -0
- package/dist/symbols.cjs +163 -0
- package/dist/symbols.cjs.map +1 -1
- package/dist/{types/symbols.d.ts → symbols.d.ts} +22 -0
- package/dist/symbols.esm.js +27 -3
- package/dist/symbols.esm.js.map +1 -1
- package/dist/template.d.ts +100 -0
- package/dist/transitions.cjs +219 -0
- package/dist/transitions.esm.js +2 -2
- package/dist/types/context.d.ts +48 -0
- package/dist/types/element-options.d.ts +26 -0
- package/dist/types/index.d.ts +25 -9
- package/dist/types/nav-context.d.ts +19 -0
- package/dist/types/{types/on-options.d.ts → on-options.d.ts} +2 -0
- package/dist/types/{types/placard.d.ts → placard.d.ts} +0 -1
- package/docs/ai/README.md +17 -0
- package/docs/ai/api.md +175 -0
- package/docs/ai/architecture.md +160 -0
- package/docs/ai/components/accordion.md +174 -0
- package/docs/ai/components/alert.md +77 -0
- package/docs/ai/components/avatar.md +61 -0
- package/docs/ai/components/badge.md +69 -0
- package/docs/ai/components/breadcrumbs.md +74 -0
- package/docs/ai/components/button.md +75 -0
- package/docs/ai/components/card.md +61 -0
- package/docs/ai/components/checkbox.md +74 -0
- package/docs/ai/components/chip.md +73 -0
- package/docs/ai/components/date-picker.md +75 -0
- package/docs/ai/components/divider.md +66 -0
- package/docs/ai/components/drawer.md +80 -0
- package/docs/ai/components/input.md +111 -0
- package/docs/ai/components/login.md +109 -0
- package/docs/ai/components/modal.md +67 -0
- package/docs/ai/components/nav.md +76 -0
- package/docs/ai/components/pagination.md +55 -0
- package/docs/ai/components/progress.md +72 -0
- package/docs/ai/components/radio.md +79 -0
- package/docs/ai/components/select.md +92 -0
- package/docs/ai/components/skeleton.md +57 -0
- package/docs/ai/components/switch.md +53 -0
- package/docs/ai/components/table.md +227 -0
- package/docs/ai/components/tabs.md +83 -0
- package/docs/ai/components/toast.md +140 -0
- package/docs/ai/components/tooltip.md +146 -0
- package/docs/ai/patterns.md +244 -0
- package/docs/components/accordion.md +558 -0
- package/docs/components/drawer.md +602 -0
- package/docs/components/modal.md +558 -0
- package/docs/components/nav.md +239 -0
- package/docs/components/pagination.md +289 -0
- package/docs/components/select.md +599 -0
- package/docs/components/switch.md +354 -0
- package/docs/components/tabs.md +546 -0
- package/docs/components/toast.md +506 -0
- package/docs/components/tooltip.md +523 -0
- package/docs/controllers.md +744 -0
- package/docs/elements.md +855 -0
- package/docs/events.md +807 -0
- package/docs/migration-v2-to-v3.md +569 -0
- package/docs/observe.md +588 -0
- package/docs/placards.md +401 -0
- package/docs/request-response.md +852 -0
- package/docs/routing.md +1186 -0
- package/package.json +10 -11
- package/dist/components/snice-cell-C9N6yGxQ.js +0 -4
- package/dist/components/snice-cell-C9N6yGxQ.js.map +0 -1
- package/dist/types/types/index.d.ts +0 -23
- /package/dist/{types/controller.d.ts → controller.d.ts} +0 -0
- /package/dist/{types/global.d.ts → global.d.ts} +0 -0
- /package/dist/{types/observe.d.ts → observe.d.ts} +0 -0
- /package/dist/{types/request-response.d.ts → request-response.d.ts} +0 -0
- /package/dist/{types/router.d.ts → router.d.ts} +0 -0
- /package/dist/{types/testing.d.ts → testing.d.ts} +0 -0
- /package/dist/{types/transitions.d.ts → transitions.d.ts} +0 -0
- /package/dist/types/{types/adopted-options.d.ts → adopted-options.d.ts} +0 -0
- /package/dist/types/{types/app-context.d.ts → app-context.d.ts} +0 -0
- /package/dist/types/{types/dispatch-options.d.ts → dispatch-options.d.ts} +0 -0
- /package/dist/types/{types/guard.d.ts → guard.d.ts} +0 -0
- /package/dist/types/{types/i-controller.d.ts → i-controller.d.ts} +0 -0
- /package/dist/types/{types/moved-options.d.ts → moved-options.d.ts} +0 -0
- /package/dist/types/{types/observe-options.d.ts → observe-options.d.ts} +0 -0
- /package/dist/types/{types/page-options.d.ts → page-options.d.ts} +0 -0
- /package/dist/types/{types/part-options.d.ts → part-options.d.ts} +0 -0
- /package/dist/types/{types/property-converter.d.ts → property-converter.d.ts} +0 -0
- /package/dist/types/{types/property-options.d.ts → property-options.d.ts} +0 -0
- /package/dist/types/{types/query-options.d.ts → query-options.d.ts} +0 -0
- /package/dist/types/{types/request-options.d.ts → request-options.d.ts} +0 -0
- /package/dist/types/{types/respond-options.d.ts → respond-options.d.ts} +0 -0
- /package/dist/types/{types/route-params.d.ts → route-params.d.ts} +0 -0
- /package/dist/types/{types/router-instance.d.ts → router-instance.d.ts} +0 -0
- /package/dist/types/{types/router-options.d.ts → router-options.d.ts} +0 -0
- /package/dist/types/{types/simple-array.d.ts → simple-array.d.ts} +0 -0
- /package/dist/types/{types/snice-element.d.ts → snice-element.d.ts} +0 -0
- /package/dist/types/{types/snice-global.d.ts → snice-global.d.ts} +0 -0
- /package/dist/types/{types/transition.d.ts → transition.d.ts} +0 -0
- /package/dist/{types/utils.d.ts → utils.d.ts} +0 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# snice-badge
|
|
2
|
+
|
|
3
|
+
Notification indicators and status markers.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
content: string = '';
|
|
9
|
+
count: number = 0;
|
|
10
|
+
max: number = 99;
|
|
11
|
+
dot: boolean = false;
|
|
12
|
+
variant: 'default'|'primary'|'success'|'warning'|'error'|'info' = 'default';
|
|
13
|
+
position: 'top-right'|'top-left'|'bottom-right'|'bottom-left' = 'top-right';
|
|
14
|
+
inline: boolean = false;
|
|
15
|
+
size: 'small'|'medium'|'large' = 'medium';
|
|
16
|
+
pulse: boolean = false;
|
|
17
|
+
offset: number = 0;
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```html
|
|
23
|
+
<!-- Basic -->
|
|
24
|
+
<snice-badge content="New"></snice-badge>
|
|
25
|
+
|
|
26
|
+
<!-- Count badge -->
|
|
27
|
+
<snice-badge count="5"></snice-badge>
|
|
28
|
+
|
|
29
|
+
<!-- Max count (99+) -->
|
|
30
|
+
<snice-badge count="150" max="99"></snice-badge>
|
|
31
|
+
|
|
32
|
+
<!-- Dot indicator -->
|
|
33
|
+
<snice-badge dot></snice-badge>
|
|
34
|
+
|
|
35
|
+
<!-- On element -->
|
|
36
|
+
<div style="position: relative; display: inline-block;">
|
|
37
|
+
<button>Messages</button>
|
|
38
|
+
<snice-badge count="3" variant="error"></snice-badge>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<!-- Variants -->
|
|
42
|
+
<snice-badge content="New" variant="primary"></snice-badge>
|
|
43
|
+
<snice-badge content="✓" variant="success"></snice-badge>
|
|
44
|
+
<snice-badge content="!" variant="warning"></snice-badge>
|
|
45
|
+
<snice-badge content="×" variant="error"></snice-badge>
|
|
46
|
+
<snice-badge content="i" variant="info"></snice-badge>
|
|
47
|
+
|
|
48
|
+
<!-- Positions -->
|
|
49
|
+
<snice-badge count="5" position="top-right"></snice-badge>
|
|
50
|
+
<snice-badge count="5" position="top-left"></snice-badge>
|
|
51
|
+
<snice-badge count="5" position="bottom-right"></snice-badge>
|
|
52
|
+
<snice-badge count="5" position="bottom-left"></snice-badge>
|
|
53
|
+
|
|
54
|
+
<!-- Inline -->
|
|
55
|
+
<p>Status <snice-badge inline content="Active"></snice-badge></p>
|
|
56
|
+
|
|
57
|
+
<!-- Pulse animation -->
|
|
58
|
+
<snice-badge dot pulse variant="error"></snice-badge>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Features
|
|
62
|
+
|
|
63
|
+
- 6 color variants
|
|
64
|
+
- Count with max limit (shows 99+ style)
|
|
65
|
+
- Dot mode for indicators
|
|
66
|
+
- 4 positioning options
|
|
67
|
+
- Inline or positioned
|
|
68
|
+
- Pulse animation
|
|
69
|
+
- Custom offset
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# snice-breadcrumbs & snice-crumb
|
|
2
|
+
|
|
3
|
+
Navigation breadcrumb trail.
|
|
4
|
+
|
|
5
|
+
## snice-breadcrumbs
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
items: BreadcrumbItem[] = [];
|
|
9
|
+
separator: '/'|'>'|'»'|'•'|'|' = '/';
|
|
10
|
+
size: 'small'|'medium'|'large' = 'medium';
|
|
11
|
+
maxItems: number = 0; // 0 = show all
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
**Methods:**
|
|
15
|
+
- `setItems(items)` - Update breadcrumb items
|
|
16
|
+
|
|
17
|
+
**BreadcrumbItem:**
|
|
18
|
+
```typescript
|
|
19
|
+
interface BreadcrumbItem {
|
|
20
|
+
label: string;
|
|
21
|
+
href?: string;
|
|
22
|
+
icon?: string;
|
|
23
|
+
iconImage?: string;
|
|
24
|
+
active?: boolean;
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
```html
|
|
31
|
+
<!-- Basic -->
|
|
32
|
+
<snice-breadcrumbs></snice-breadcrumbs>
|
|
33
|
+
|
|
34
|
+
<script>
|
|
35
|
+
const breadcrumbs = document.querySelector('snice-breadcrumbs');
|
|
36
|
+
breadcrumbs.items = [
|
|
37
|
+
{ label: 'Home', href: '/' },
|
|
38
|
+
{ label: 'Products', href: '/products' },
|
|
39
|
+
{ label: 'Laptop', active: true }
|
|
40
|
+
];
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<!-- Or use crumb elements -->
|
|
44
|
+
<snice-breadcrumbs>
|
|
45
|
+
<snice-crumb href="/" label="Home"></snice-crumb>
|
|
46
|
+
<snice-crumb href="/products" label="Products"></snice-crumb>
|
|
47
|
+
<snice-crumb label="Laptop" active></snice-crumb>
|
|
48
|
+
</snice-breadcrumbs>
|
|
49
|
+
|
|
50
|
+
<!-- Custom separator -->
|
|
51
|
+
<snice-breadcrumbs separator=">"></snice-breadcrumbs>
|
|
52
|
+
|
|
53
|
+
<!-- With icons -->
|
|
54
|
+
<snice-breadcrumbs></snice-breadcrumbs>
|
|
55
|
+
<script>
|
|
56
|
+
breadcrumbs.items = [
|
|
57
|
+
{ label: 'Home', href: '/', icon: '🏠' },
|
|
58
|
+
{ label: 'Products', href: '/products', icon: '📦' }
|
|
59
|
+
];
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<!-- Max items (collapse middle) -->
|
|
63
|
+
<snice-breadcrumbs max-items="3"></snice-breadcrumbs>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Features
|
|
67
|
+
|
|
68
|
+
- Item array or crumb elements
|
|
69
|
+
- 5 separator options
|
|
70
|
+
- 3 sizes
|
|
71
|
+
- Max items with collapse
|
|
72
|
+
- Icons support
|
|
73
|
+
- Active state
|
|
74
|
+
- Accessible: nav role, aria-label
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# snice-button
|
|
2
|
+
|
|
3
|
+
Interactive button with variants and states.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
variant: 'default'|'primary'|'success'|'warning'|'danger'|'text' = 'default';
|
|
9
|
+
size: 'small'|'medium'|'large' = 'medium';
|
|
10
|
+
disabled: boolean = false;
|
|
11
|
+
loading: boolean = false;
|
|
12
|
+
outline: boolean = false;
|
|
13
|
+
pill: boolean = false;
|
|
14
|
+
circle: boolean = false;
|
|
15
|
+
href: string = '';
|
|
16
|
+
target: string = '';
|
|
17
|
+
download: string = '';
|
|
18
|
+
icon: string = '';
|
|
19
|
+
iconPlacement: 'start'|'end' = 'start';
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Methods
|
|
23
|
+
|
|
24
|
+
- `focus(options?)` - Focus button
|
|
25
|
+
- `blur()` - Blur button
|
|
26
|
+
- `click()` - Programmatic click
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
```html
|
|
31
|
+
<!-- Basic -->
|
|
32
|
+
<snice-button>Click me</snice-button>
|
|
33
|
+
|
|
34
|
+
<!-- Variants -->
|
|
35
|
+
<snice-button variant="primary">Primary</snice-button>
|
|
36
|
+
<snice-button variant="success">Success</snice-button>
|
|
37
|
+
<snice-button variant="warning">Warning</snice-button>
|
|
38
|
+
<snice-button variant="danger">Danger</snice-button>
|
|
39
|
+
<snice-button variant="text">Text</snice-button>
|
|
40
|
+
|
|
41
|
+
<!-- Sizes -->
|
|
42
|
+
<snice-button size="small">Small</snice-button>
|
|
43
|
+
<snice-button size="medium">Medium</snice-button>
|
|
44
|
+
<snice-button size="large">Large</snice-button>
|
|
45
|
+
|
|
46
|
+
<!-- States -->
|
|
47
|
+
<snice-button disabled>Disabled</snice-button>
|
|
48
|
+
<snice-button loading>Loading...</snice-button>
|
|
49
|
+
|
|
50
|
+
<!-- Styles -->
|
|
51
|
+
<snice-button outline>Outline</snice-button>
|
|
52
|
+
<snice-button pill>Pill</snice-button>
|
|
53
|
+
<snice-button circle icon="×"></snice-button>
|
|
54
|
+
|
|
55
|
+
<!-- With icon -->
|
|
56
|
+
<snice-button icon="→">Next</snice-button>
|
|
57
|
+
<snice-button icon="←" icon-placement="start">Back</snice-button>
|
|
58
|
+
|
|
59
|
+
<!-- As link -->
|
|
60
|
+
<snice-button href="/page">Link</snice-button>
|
|
61
|
+
<snice-button href="/file.pdf" download>Download</snice-button>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Features
|
|
65
|
+
|
|
66
|
+
- 6 color variants
|
|
67
|
+
- 3 sizes
|
|
68
|
+
- Outline style
|
|
69
|
+
- Pill (rounded) shape
|
|
70
|
+
- Circle (icon only) shape
|
|
71
|
+
- Loading state with spinner
|
|
72
|
+
- Disabled state
|
|
73
|
+
- Link mode (href)
|
|
74
|
+
- Icon support with placement
|
|
75
|
+
- Download attribute support
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# snice-card
|
|
2
|
+
|
|
3
|
+
Container for grouped content.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
variant: 'elevated'|'bordered'|'flat' = 'elevated';
|
|
9
|
+
size: 'small'|'medium'|'large' = 'medium';
|
|
10
|
+
clickable: boolean = false;
|
|
11
|
+
selected: boolean = false;
|
|
12
|
+
disabled: boolean = false;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Slots
|
|
16
|
+
|
|
17
|
+
- `header` - Card header
|
|
18
|
+
- `footer` - Card footer
|
|
19
|
+
- default - Card body content
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<!-- Basic -->
|
|
25
|
+
<snice-card>
|
|
26
|
+
<p>Card content</p>
|
|
27
|
+
</snice-card>
|
|
28
|
+
|
|
29
|
+
<!-- With header and footer -->
|
|
30
|
+
<snice-card>
|
|
31
|
+
<div slot="header">Card Title</div>
|
|
32
|
+
<p>Card body content</p>
|
|
33
|
+
<div slot="footer">
|
|
34
|
+
<button>Action</button>
|
|
35
|
+
</div>
|
|
36
|
+
</snice-card>
|
|
37
|
+
|
|
38
|
+
<!-- Variants -->
|
|
39
|
+
<snice-card variant="elevated">Elevated (shadow)</snice-card>
|
|
40
|
+
<snice-card variant="bordered">Bordered</snice-card>
|
|
41
|
+
<snice-card variant="flat">Flat</snice-card>
|
|
42
|
+
|
|
43
|
+
<!-- Sizes -->
|
|
44
|
+
<snice-card size="small">Small padding</snice-card>
|
|
45
|
+
<snice-card size="medium">Medium padding</snice-card>
|
|
46
|
+
<snice-card size="large">Large padding</snice-card>
|
|
47
|
+
|
|
48
|
+
<!-- Interactive -->
|
|
49
|
+
<snice-card clickable>Click me</snice-card>
|
|
50
|
+
<snice-card clickable selected>Selected</snice-card>
|
|
51
|
+
<snice-card clickable disabled>Disabled</snice-card>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Features
|
|
55
|
+
|
|
56
|
+
- 3 style variants (elevated/bordered/flat)
|
|
57
|
+
- 3 size options for padding
|
|
58
|
+
- Clickable with hover/focus states
|
|
59
|
+
- Selected state
|
|
60
|
+
- Disabled state
|
|
61
|
+
- Header/footer slots
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# snice-checkbox
|
|
2
|
+
|
|
3
|
+
Form checkbox input with indeterminate state.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
checked: boolean = false;
|
|
9
|
+
indeterminate: boolean = false;
|
|
10
|
+
disabled: boolean = false;
|
|
11
|
+
required: boolean = false;
|
|
12
|
+
invalid: boolean = false;
|
|
13
|
+
size: 'small'|'medium'|'large' = 'medium';
|
|
14
|
+
name: string = '';
|
|
15
|
+
value: string = 'on';
|
|
16
|
+
label: string = '';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Methods
|
|
20
|
+
|
|
21
|
+
- `focus()` - Focus checkbox
|
|
22
|
+
- `blur()` - Blur checkbox
|
|
23
|
+
- `click()` - Programmatic click
|
|
24
|
+
|
|
25
|
+
## Events
|
|
26
|
+
|
|
27
|
+
- `change` - {checked, indeterminate, checkbox}
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
```html
|
|
32
|
+
<!-- Basic -->
|
|
33
|
+
<snice-checkbox label="Accept terms"></snice-checkbox>
|
|
34
|
+
|
|
35
|
+
<!-- Checked -->
|
|
36
|
+
<snice-checkbox label="Enabled" checked></snice-checkbox>
|
|
37
|
+
|
|
38
|
+
<!-- Indeterminate (partial selection) -->
|
|
39
|
+
<snice-checkbox label="Select all" indeterminate></snice-checkbox>
|
|
40
|
+
|
|
41
|
+
<!-- Disabled -->
|
|
42
|
+
<snice-checkbox label="Disabled" disabled></snice-checkbox>
|
|
43
|
+
|
|
44
|
+
<!-- Required -->
|
|
45
|
+
<snice-checkbox label="Required" required></snice-checkbox>
|
|
46
|
+
|
|
47
|
+
<!-- Invalid -->
|
|
48
|
+
<snice-checkbox label="Invalid" invalid></snice-checkbox>
|
|
49
|
+
|
|
50
|
+
<!-- Sizes -->
|
|
51
|
+
<snice-checkbox label="Small" size="small"></snice-checkbox>
|
|
52
|
+
<snice-checkbox label="Medium" size="medium"></snice-checkbox>
|
|
53
|
+
<snice-checkbox label="Large" size="large"></snice-checkbox>
|
|
54
|
+
|
|
55
|
+
<!-- Form integration -->
|
|
56
|
+
<snice-checkbox name="newsletter" value="yes" label="Subscribe"></snice-checkbox>
|
|
57
|
+
|
|
58
|
+
<!-- Event handling -->
|
|
59
|
+
<snice-checkbox id="cb"></snice-checkbox>
|
|
60
|
+
<script>
|
|
61
|
+
document.querySelector('#cb').addEventListener('change', (e) => {
|
|
62
|
+
console.log('Checked:', e.detail.checked);
|
|
63
|
+
});
|
|
64
|
+
</script>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Features
|
|
68
|
+
|
|
69
|
+
- Form-associated custom element
|
|
70
|
+
- Indeterminate state
|
|
71
|
+
- 3 sizes
|
|
72
|
+
- Keyboard accessible
|
|
73
|
+
- Change events
|
|
74
|
+
- Invalid state styling
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# snice-chip
|
|
2
|
+
|
|
3
|
+
Compact element for tags, filters, or selections.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
label: string = '';
|
|
9
|
+
variant: 'default'|'primary'|'success'|'warning'|'error'|'info' = 'default';
|
|
10
|
+
size: 'small'|'medium'|'large' = 'medium';
|
|
11
|
+
removable: boolean = false;
|
|
12
|
+
selected: boolean = false;
|
|
13
|
+
disabled: boolean = false;
|
|
14
|
+
icon: string = '';
|
|
15
|
+
avatar: string = '';
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Events
|
|
19
|
+
|
|
20
|
+
- `click` - Chip clicked
|
|
21
|
+
- `remove` - Remove button clicked
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<!-- Basic -->
|
|
27
|
+
<snice-chip label="Tag"></snice-chip>
|
|
28
|
+
|
|
29
|
+
<!-- Variants -->
|
|
30
|
+
<snice-chip label="Default" variant="default"></snice-chip>
|
|
31
|
+
<snice-chip label="Primary" variant="primary"></snice-chip>
|
|
32
|
+
<snice-chip label="Success" variant="success"></snice-chip>
|
|
33
|
+
<snice-chip label="Warning" variant="warning"></snice-chip>
|
|
34
|
+
<snice-chip label="Error" variant="error"></snice-chip>
|
|
35
|
+
<snice-chip label="Info" variant="info"></snice-chip>
|
|
36
|
+
|
|
37
|
+
<!-- Removable -->
|
|
38
|
+
<snice-chip label="Removable" removable></snice-chip>
|
|
39
|
+
|
|
40
|
+
<!-- Selected state -->
|
|
41
|
+
<snice-chip label="Selected" selected></snice-chip>
|
|
42
|
+
|
|
43
|
+
<!-- Disabled -->
|
|
44
|
+
<snice-chip label="Disabled" disabled></snice-chip>
|
|
45
|
+
|
|
46
|
+
<!-- With icon -->
|
|
47
|
+
<snice-chip label="Favorite" icon="★"></snice-chip>
|
|
48
|
+
|
|
49
|
+
<!-- With avatar -->
|
|
50
|
+
<snice-chip label="John Doe" avatar="/user.jpg"></snice-chip>
|
|
51
|
+
|
|
52
|
+
<!-- Sizes -->
|
|
53
|
+
<snice-chip label="Small" size="small"></snice-chip>
|
|
54
|
+
<snice-chip label="Medium" size="medium"></snice-chip>
|
|
55
|
+
<snice-chip label="Large" size="large"></snice-chip>
|
|
56
|
+
|
|
57
|
+
<!-- Events -->
|
|
58
|
+
<snice-chip id="chip" label="Click me" removable></snice-chip>
|
|
59
|
+
<script>
|
|
60
|
+
const chip = document.querySelector('#chip');
|
|
61
|
+
chip.addEventListener('click', () => console.log('Clicked'));
|
|
62
|
+
chip.addEventListener('remove', () => chip.remove());
|
|
63
|
+
</script>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Features
|
|
67
|
+
|
|
68
|
+
- 6 color variants
|
|
69
|
+
- 3 sizes
|
|
70
|
+
- Removable with X button
|
|
71
|
+
- Selected state
|
|
72
|
+
- Icon or avatar
|
|
73
|
+
- Click and remove events
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# snice-date-picker
|
|
2
|
+
|
|
3
|
+
Calendar-based date input with format options and validation.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
value: string = '';
|
|
9
|
+
format: 'YYYY-MM-DD'|'DD/MM/YYYY'|'MM/DD/YYYY'|'DD.MM.YYYY'|'YYYY/MM/DD'|'DD-MM-YYYY'|'MM-DD-YYYY' = 'YYYY-MM-DD';
|
|
10
|
+
placeholder: string = '';
|
|
11
|
+
disabled: boolean = false;
|
|
12
|
+
required: boolean = false;
|
|
13
|
+
invalid: boolean = false;
|
|
14
|
+
readonly: boolean = false;
|
|
15
|
+
clearable: boolean = true;
|
|
16
|
+
minDate: string = '';
|
|
17
|
+
maxDate: string = '';
|
|
18
|
+
size: 'small'|'medium'|'large' = 'medium';
|
|
19
|
+
name: string = '';
|
|
20
|
+
label: string = '';
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Methods
|
|
24
|
+
|
|
25
|
+
- `focus()` - Focus input
|
|
26
|
+
- `blur()` - Blur input
|
|
27
|
+
- `clear()` - Clear value
|
|
28
|
+
- `showCalendar()` - Open calendar
|
|
29
|
+
- `hideCalendar()` - Close calendar
|
|
30
|
+
|
|
31
|
+
## Events
|
|
32
|
+
|
|
33
|
+
- `change` - {value, datePicker}
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
<!-- Basic -->
|
|
39
|
+
<snice-date-picker label="Select date"></snice-date-picker>
|
|
40
|
+
|
|
41
|
+
<!-- With format -->
|
|
42
|
+
<snice-date-picker format="DD/MM/YYYY"></snice-date-picker>
|
|
43
|
+
|
|
44
|
+
<!-- With min/max -->
|
|
45
|
+
<snice-date-picker min-date="2024-01-01" max-date="2024-12-31"></snice-date-picker>
|
|
46
|
+
|
|
47
|
+
<!-- Clearable -->
|
|
48
|
+
<snice-date-picker value="2024-03-15" clearable></snice-date-picker>
|
|
49
|
+
|
|
50
|
+
<!-- Disabled/readonly -->
|
|
51
|
+
<snice-date-picker disabled></snice-date-picker>
|
|
52
|
+
<snice-date-picker readonly></snice-date-picker>
|
|
53
|
+
|
|
54
|
+
<!-- Form integration -->
|
|
55
|
+
<snice-date-picker name="birthdate" required></snice-date-picker>
|
|
56
|
+
|
|
57
|
+
<!-- Event handling -->
|
|
58
|
+
<snice-date-picker id="dp"></snice-date-picker>
|
|
59
|
+
<script>
|
|
60
|
+
document.querySelector('#dp').addEventListener('change', (e) => {
|
|
61
|
+
console.log('Date:', e.detail.value);
|
|
62
|
+
});
|
|
63
|
+
</script>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Features
|
|
67
|
+
|
|
68
|
+
- Form-associated custom element
|
|
69
|
+
- Calendar popup with month/year navigation
|
|
70
|
+
- 7 date format options
|
|
71
|
+
- Min/max date validation
|
|
72
|
+
- Clearable with X button
|
|
73
|
+
- 3 sizes
|
|
74
|
+
- Keyboard accessible
|
|
75
|
+
- Invalid state styling
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# snice-divider
|
|
2
|
+
|
|
3
|
+
Separator line with optional text.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
orientation: 'horizontal'|'vertical' = 'horizontal';
|
|
9
|
+
variant: 'solid'|'dashed'|'dotted' = 'solid';
|
|
10
|
+
spacing: 'none'|'small'|'medium'|'large' = 'medium';
|
|
11
|
+
align: 'start'|'center'|'end' = 'center';
|
|
12
|
+
text: string = '';
|
|
13
|
+
textBackground: string = '';
|
|
14
|
+
color: string = '';
|
|
15
|
+
capped: boolean = false;
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```html
|
|
21
|
+
<!-- Basic -->
|
|
22
|
+
<snice-divider></snice-divider>
|
|
23
|
+
|
|
24
|
+
<!-- With text -->
|
|
25
|
+
<snice-divider text="OR"></snice-divider>
|
|
26
|
+
|
|
27
|
+
<!-- Text alignment -->
|
|
28
|
+
<snice-divider text="Start" align="start"></snice-divider>
|
|
29
|
+
<snice-divider text="Center" align="center"></snice-divider>
|
|
30
|
+
<snice-divider text="End" align="end"></snice-divider>
|
|
31
|
+
|
|
32
|
+
<!-- Variants -->
|
|
33
|
+
<snice-divider variant="solid"></snice-divider>
|
|
34
|
+
<snice-divider variant="dashed"></snice-divider>
|
|
35
|
+
<snice-divider variant="dotted"></snice-divider>
|
|
36
|
+
|
|
37
|
+
<!-- Spacing -->
|
|
38
|
+
<snice-divider spacing="none"></snice-divider>
|
|
39
|
+
<snice-divider spacing="small"></snice-divider>
|
|
40
|
+
<snice-divider spacing="medium"></snice-divider>
|
|
41
|
+
<snice-divider spacing="large"></snice-divider>
|
|
42
|
+
|
|
43
|
+
<!-- Vertical -->
|
|
44
|
+
<div style="display: flex; height: 50px;">
|
|
45
|
+
<span>Left</span>
|
|
46
|
+
<snice-divider orientation="vertical"></snice-divider>
|
|
47
|
+
<span>Right</span>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<!-- Custom color -->
|
|
51
|
+
<snice-divider color="#3b82f6"></snice-divider>
|
|
52
|
+
|
|
53
|
+
<!-- Capped (rounded ends) -->
|
|
54
|
+
<snice-divider capped></snice-divider>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Features
|
|
58
|
+
|
|
59
|
+
- Horizontal or vertical
|
|
60
|
+
- 3 line styles (solid/dashed/dotted)
|
|
61
|
+
- Optional text label
|
|
62
|
+
- Text alignment (start/center/end)
|
|
63
|
+
- 4 spacing options
|
|
64
|
+
- Custom color
|
|
65
|
+
- Capped ends
|
|
66
|
+
- Custom text background
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# snice-drawer
|
|
2
|
+
|
|
3
|
+
Slide-out panel from any viewport side with focus trap and dismissal options.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
open: boolean = false; // Visibility state
|
|
9
|
+
position: 'left'|'right'|'top'|'bottom' = 'left';
|
|
10
|
+
size: 'small'|'medium'|'large'|'xl'|'xxl'|'xxxl'|'full' = 'medium';
|
|
11
|
+
noBackdrop: boolean = false; // Hide backdrop overlay
|
|
12
|
+
noBackdropDismiss: boolean = false; // Prevent backdrop click close
|
|
13
|
+
noEscapeDismiss: boolean = false; // Prevent Escape key close
|
|
14
|
+
noFocusTrap: boolean = false; // Disable focus trapping
|
|
15
|
+
persistent: boolean = false; // Hide close button, prevent all dismiss
|
|
16
|
+
pushContent: boolean = false; // Push main content instead of overlay
|
|
17
|
+
contained: boolean = false; // Position relative to parent
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Methods
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
show() // Open drawer
|
|
24
|
+
hide() // Close drawer
|
|
25
|
+
toggle() // Toggle drawer
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Events
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
'@snice/drawer-open' // { drawer }
|
|
32
|
+
'@snice/drawer-close' // { drawer }
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Slots
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
<snice-drawer>
|
|
39
|
+
<h2 slot="title">Title</h2>
|
|
40
|
+
<div>Body content</div>
|
|
41
|
+
<div slot="footer">Actions</div>
|
|
42
|
+
</snice-drawer>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Usage
|
|
46
|
+
|
|
47
|
+
```html
|
|
48
|
+
<snice-drawer id="menu" position="left">
|
|
49
|
+
<h2 slot="title">Menu</h2>
|
|
50
|
+
<nav>
|
|
51
|
+
<a href="/">Home</a>
|
|
52
|
+
<a href="/about">About</a>
|
|
53
|
+
</nav>
|
|
54
|
+
</snice-drawer>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
const drawer = document.querySelector('snice-drawer');
|
|
59
|
+
drawer.show();
|
|
60
|
+
drawer.hide();
|
|
61
|
+
drawer.toggle();
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Features
|
|
65
|
+
|
|
66
|
+
- Slides from any edge (left, right, top, bottom)
|
|
67
|
+
- Multiple size options
|
|
68
|
+
- Focus trap with Tab navigation
|
|
69
|
+
- Focus restoration on close
|
|
70
|
+
- Backdrop click to close
|
|
71
|
+
- Escape key to close
|
|
72
|
+
- Push content mode
|
|
73
|
+
- Persistent mode (no close button)
|
|
74
|
+
- ARIA attributes (role, aria-modal, aria-hidden)
|
|
75
|
+
|
|
76
|
+
## Notes
|
|
77
|
+
|
|
78
|
+
- Push content targets first `<main>` or `<body>`
|
|
79
|
+
- Contained mode positions relative to parent
|
|
80
|
+
- Default dismissal: close button, backdrop click, Escape key
|