snice 7.0.2 → 7.0.3
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/adapters/react/SniceProvider.js +1 -1
- package/adapters/react/SniceRouter.js +1 -1
- package/adapters/react/matchRoute.js +1 -1
- package/adapters/react/useRequestHandler.js +1 -1
- package/dist/cdn/accordion/snice-accordion.js +1 -1
- package/dist/cdn/action-bar/snice-action-bar.js +1 -1
- package/dist/cdn/activity-feed/snice-activity-feed.js +1 -1
- package/dist/cdn/alert/snice-alert.js +1 -1
- package/dist/cdn/app-tiles/snice-app-tiles.js +1 -1
- package/dist/cdn/approval-flow/snice-approval-flow.js +1 -1
- package/dist/cdn/audio-recorder/snice-audio-recorder.js +1 -1
- package/dist/cdn/availability/snice-availability.js +1 -1
- package/dist/cdn/avatar/snice-avatar.js +1 -1
- package/dist/cdn/avatar-group/snice-avatar-group.js +1 -1
- package/dist/cdn/badge/snice-badge.js +1 -1
- package/dist/cdn/banner/snice-banner.js +1 -1
- package/dist/cdn/binpack/snice-binpack.js +1 -1
- package/dist/cdn/book/snice-book.js +1 -1
- package/dist/cdn/booking/snice-booking.js +1 -1
- package/dist/cdn/breadcrumbs/snice-breadcrumbs.js +1 -1
- package/dist/cdn/button/snice-button.js +1 -1
- package/dist/cdn/calendar/snice-calendar.js +1 -1
- package/dist/cdn/camera/snice-camera.js +1 -1
- package/dist/cdn/camera-annotate/snice-camera-annotate.js +1 -1
- package/dist/cdn/candlestick/snice-candlestick.js +1 -1
- package/dist/cdn/card/snice-card.js +1 -1
- package/dist/cdn/carousel/snice-carousel.js +1 -1
- package/dist/cdn/cart/snice-cart.js +1 -1
- package/dist/cdn/chart/snice-chart.js +1 -1
- package/dist/cdn/chat/snice-chat.js +1 -1
- package/dist/cdn/checkbox/snice-checkbox.js +1 -1
- package/dist/cdn/chip/snice-chip.js +1 -1
- package/dist/cdn/code-block/snice-code-block.js +1 -1
- package/dist/cdn/color-display/snice-color-display.js +1 -1
- package/dist/cdn/color-picker/snice-color-picker.js +1 -1
- package/dist/cdn/command-palette/snice-command-palette.js +1 -1
- package/dist/cdn/comments/snice-comments.js +1 -1
- package/dist/cdn/countdown/snice-countdown.js +1 -1
- package/dist/cdn/cropper/snice-cropper.js +1 -1
- package/dist/cdn/data-card/snice-data-card.js +1 -1
- package/dist/cdn/date-picker/snice-date-picker.js +1 -1
- package/dist/cdn/date-range-picker/snice-date-range-picker.js +1 -1
- package/dist/cdn/date-time-picker/snice-date-time-picker.js +1 -1
- package/dist/cdn/diff/snice-diff.js +1 -1
- package/dist/cdn/divider/snice-divider.js +1 -1
- package/dist/cdn/doc/snice-doc.js +1 -1
- package/dist/cdn/draw/snice-draw.js +1 -1
- package/dist/cdn/drawer/snice-drawer.js +1 -1
- package/dist/cdn/empty-state/snice-empty-state.js +1 -1
- package/dist/cdn/estimate/snice-estimate.js +1 -1
- package/dist/cdn/file-gallery/snice-file-gallery.js +1 -1
- package/dist/cdn/file-upload/snice-file-upload.js +1 -1
- package/dist/cdn/flip-card/snice-flip-card.js +1 -1
- package/dist/cdn/flow/snice-flow.js +1 -1
- package/dist/cdn/form-layout/snice-form-layout.js +1 -1
- package/dist/cdn/funnel/snice-funnel.js +1 -1
- package/dist/cdn/gantt/snice-gantt.js +1 -1
- package/dist/cdn/gauge/snice-gauge.js +1 -1
- package/dist/cdn/grid/snice-grid.js +1 -1
- package/dist/cdn/heatmap/snice-heatmap.js +1 -1
- package/dist/cdn/image/snice-image.js +1 -1
- package/dist/cdn/input/snice-input.js +1 -1
- package/dist/cdn/invoice/snice-invoice.js +1 -1
- package/dist/cdn/kanban/snice-kanban.js +1 -1
- package/dist/cdn/key-value/snice-key-value.js +1 -1
- package/dist/cdn/kpi/snice-kpi.js +1 -1
- package/dist/cdn/layout/snice-layout.js +1 -1
- package/dist/cdn/leaderboard/snice-leaderboard.js +1 -1
- package/dist/cdn/link/snice-link.js +1 -1
- package/dist/cdn/link-preview/snice-link-preview.js +1 -1
- package/dist/cdn/list/snice-list.js +1 -1
- package/dist/cdn/location/snice-location.js +1 -1
- package/dist/cdn/login/snice-login.js +1 -1
- package/dist/cdn/map/snice-map.js +1 -1
- package/dist/cdn/markdown/snice-markdown.js +1 -1
- package/dist/cdn/masonry/snice-masonry.js +1 -1
- package/dist/cdn/menu/snice-menu.js +1 -1
- package/dist/cdn/message-strip/snice-message-strip.js +1 -1
- package/dist/cdn/modal/snice-modal.js +1 -1
- package/dist/cdn/music-player/snice-music-player.js +1 -1
- package/dist/cdn/nav/snice-nav.js +1 -1
- package/dist/cdn/network-graph/snice-network-graph.js +1 -1
- package/dist/cdn/notification-center/snice-notification-center.js +1 -1
- package/dist/cdn/order-tracker/snice-order-tracker.js +1 -1
- package/dist/cdn/org-chart/snice-org-chart.js +1 -1
- package/dist/cdn/pagination/snice-pagination.js +1 -1
- package/dist/cdn/paint/snice-paint.js +1 -1
- package/dist/cdn/pdf-viewer/snice-pdf-viewer.js +1 -1
- package/dist/cdn/permission-matrix/snice-permission-matrix.js +1 -1
- package/dist/cdn/podcast-player/snice-podcast-player.js +1 -1
- package/dist/cdn/popover/snice-popover.js +1 -1
- package/dist/cdn/pricing-table/snice-pricing-table.js +1 -1
- package/dist/cdn/product-card/snice-product-card.js +1 -1
- package/dist/cdn/progress/snice-progress.js +1 -1
- package/dist/cdn/progress-ring/snice-progress-ring.js +1 -1
- package/dist/cdn/qr-code/snice-qr-code.js +1 -1
- package/dist/cdn/qr-reader/snice-qr-reader.js +1 -1
- package/dist/cdn/radio/snice-radio.js +1 -1
- package/dist/cdn/range-slider/snice-range-slider.js +1 -1
- package/dist/cdn/rating/snice-rating.js +1 -1
- package/dist/cdn/receipt/snice-receipt.js +1 -1
- package/dist/cdn/recipe/snice-recipe.js +2 -2
- package/dist/cdn/recipe/snice-recipe.js.map +1 -1
- package/dist/cdn/recipe/snice-recipe.min.js +1 -1
- package/dist/cdn/recipe/snice-recipe.min.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.esm.js +4 -4
- package/dist/cdn/runtime/snice-runtime.esm.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.esm.min.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.js +4 -4
- package/dist/cdn/runtime/snice-runtime.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.min.js.map +1 -1
- package/dist/cdn/sankey/snice-sankey.js +1 -1
- package/dist/cdn/segmented-control/snice-segmented-control.js +1 -1
- package/dist/cdn/select/snice-select.js +1 -1
- package/dist/cdn/skeleton/snice-skeleton.js +1 -1
- package/dist/cdn/slider/snice-slider.js +1 -1
- package/dist/cdn/sortable/snice-sortable.js +1 -1
- package/dist/cdn/sparkline/snice-sparkline.js +1 -1
- package/dist/cdn/spinner/snice-spinner.js +1 -1
- package/dist/cdn/split-button/snice-split-button.js +1 -1
- package/dist/cdn/split-pane/snice-split-pane.js +1 -1
- package/dist/cdn/spotlight/snice-spotlight.js +1 -1
- package/dist/cdn/stat-group/snice-stat-group.js +1 -1
- package/dist/cdn/step-input/snice-step-input.js +1 -1
- package/dist/cdn/stepper/snice-stepper.js +1 -1
- package/dist/cdn/switch/snice-switch.js +1 -1
- package/dist/cdn/table/README.md +2 -2
- package/dist/cdn/table/snice-table.esm.js +20 -3
- package/dist/cdn/table/snice-table.esm.js.map +1 -1
- package/dist/cdn/table/snice-table.esm.min.js +35 -35
- package/dist/cdn/table/snice-table.esm.min.js.map +1 -1
- package/dist/cdn/table/snice-table.js +20 -3
- package/dist/cdn/table/snice-table.js.map +1 -1
- package/dist/cdn/table/snice-table.min.js +29 -29
- package/dist/cdn/table/snice-table.min.js.map +1 -1
- package/dist/cdn/tabs/snice-tabs.js +1 -1
- package/dist/cdn/tag/snice-tag.js +1 -1
- package/dist/cdn/tag-input/snice-tag-input.js +1 -1
- package/dist/cdn/terminal/snice-terminal.js +2 -1
- package/dist/cdn/terminal/snice-terminal.js.map +1 -1
- package/dist/cdn/terminal/snice-terminal.min.js +1 -0
- package/dist/cdn/terminal/snice-terminal.min.js.map +1 -1
- package/dist/cdn/testimonial/snice-testimonial.js +1 -1
- package/dist/cdn/textarea/snice-textarea.js +1 -1
- package/dist/cdn/time-picker/snice-time-picker.js +1 -1
- package/dist/cdn/time-range-picker/snice-time-range-picker.js +1 -1
- package/dist/cdn/timeline/snice-timeline.js +1 -1
- package/dist/cdn/timer/snice-timer.js +1 -1
- package/dist/cdn/toast/snice-toast.js +1 -1
- package/dist/cdn/tooltip/snice-tooltip.js +1 -1
- package/dist/cdn/tree/snice-tree.js +1 -1
- package/dist/cdn/treemap/snice-treemap.js +1 -1
- package/dist/cdn/user-card/snice-user-card.js +1 -1
- package/dist/cdn/video-player/README.md +1 -1
- package/dist/cdn/video-player/snice-video-player.js +2 -1
- package/dist/cdn/video-player/snice-video-player.js.map +1 -1
- package/dist/cdn/video-player/snice-video-player.min.js +1 -0
- package/dist/cdn/video-player/snice-video-player.min.js.map +1 -1
- package/dist/cdn/virtual-scroller/snice-virtual-scroller.js +1 -1
- package/dist/cdn/waterfall/snice-waterfall.js +1 -1
- package/dist/cdn/weather/snice-weather.js +1 -1
- package/dist/cdn/work-order/snice-work-order.js +1 -1
- package/dist/components/recipe/snice-recipe.js +1 -1
- package/dist/components/recipe/snice-recipe.js.map +1 -1
- package/dist/components/table/snice-table.d.ts +1 -0
- package/dist/components/table/snice-table.js +18 -2
- package/dist/components/table/snice-table.js.map +1 -1
- package/dist/components/table/table-tree-data.js +1 -0
- package/dist/components/table/table-tree-data.js.map +1 -1
- package/dist/components/terminal/snice-terminal.js +1 -0
- package/dist/components/terminal/snice-terminal.js.map +1 -1
- package/dist/components/video-player/snice-video-player.js +1 -0
- package/dist/components/video-player/snice-video-player.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.iife.js +1 -1
- package/dist/react/SniceProvider.js +1 -1
- package/dist/react/SniceRouter.js +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/matchRoute.js +1 -1
- package/dist/react/useRequestHandler.js +1 -1
- package/dist/symbols.cjs +1 -1
- package/dist/symbols.esm.js +1 -1
- package/dist/transitions.cjs +1 -1
- package/dist/transitions.esm.js +1 -1
- package/docs/ai/components/avatar.md +8 -8
- package/docs/ai/components/breadcrumbs.md +2 -1
- package/docs/ai/components/button.md +2 -7
- package/docs/ai/components/calendar.md +1 -1
- package/docs/ai/components/camera.md +1 -1
- package/docs/ai/components/chart.md +3 -1
- package/docs/ai/components/code-block.md +2 -2
- package/docs/ai/components/date-picker.md +5 -19
- package/docs/ai/components/date-range-picker.md +4 -12
- package/docs/ai/components/draw.md +5 -5
- package/docs/ai/components/drawer.md +4 -4
- package/docs/ai/components/form-layout.md +2 -0
- package/docs/ai/components/icons.md +7 -16
- package/docs/ai/components/key-value.md +3 -22
- package/docs/ai/components/layout.md +8 -12
- package/docs/ai/components/leaderboard.md +2 -2
- package/docs/ai/components/link-preview.md +4 -3
- package/docs/ai/components/login.md +11 -0
- package/docs/ai/components/markdown.md +7 -0
- package/docs/ai/components/masonry.md +6 -0
- package/docs/ai/components/menu.md +1 -1
- package/docs/ai/components/modal.md +7 -0
- package/docs/ai/components/notification-center.md +5 -4
- package/docs/ai/components/radio.md +7 -0
- package/docs/ai/components/rating.md +3 -3
- package/docs/ai/components/select.md +4 -13
- package/docs/ai/components/spotlight.md +2 -0
- package/docs/ai/components/table.md +1 -4
- package/docs/ai/components/tag-input.md +6 -0
- package/docs/ai/components/terminal.md +6 -0
- package/docs/ai/components/tooltip.md +10 -16
- package/docs/ai/components/tree.md +2 -2
- package/docs/ai/components/video-player.md +5 -0
- package/docs/ai/components/waterfall.md +7 -0
- package/docs/ai/events.md +29 -0
- package/docs/components/breadcrumbs.md +2 -1
- package/docs/components/calendar.md +1 -1
- package/docs/components/camera.md +1 -1
- package/docs/components/chart.md +1 -1
- package/docs/components/code-block.md +13 -4
- package/docs/components/color-picker.md +6 -5
- package/docs/components/date-time-picker.md +14 -0
- package/docs/components/diff.md +2 -1
- package/docs/components/draw.md +5 -5
- package/docs/components/drawer.md +4 -4
- package/docs/components/input.md +1 -0
- package/docs/components/layout.md +20 -22
- package/docs/components/leaderboard.md +10 -3
- package/docs/components/link-preview.md +11 -9
- package/docs/components/login.md +4 -0
- package/docs/components/menu.md +1 -1
- package/docs/components/modal.md +1 -0
- package/docs/components/nav.md +1 -0
- package/docs/components/network-graph.md +1 -0
- package/docs/components/notification-center.md +2 -1
- package/docs/components/product-card.md +1 -0
- package/docs/components/qr-reader.md +1 -0
- package/docs/components/rating.md +4 -4
- package/docs/components/select.md +1 -0
- package/docs/components/spotlight.md +2 -0
- package/docs/components/tabs.md +1 -0
- package/docs/components/terminal.md +3 -0
- package/docs/components/textarea.md +1 -1
- package/docs/components/time-picker.md +14 -0
- package/docs/components/tooltip.md +2 -0
- package/docs/components/tree.md +2 -2
- package/docs/events.md +73 -0
- package/package.json +1 -1
|
@@ -87,3 +87,9 @@ tagInput.addEventListener('tag-change', (e) => {
|
|
|
87
87
|
console.log('Tags:', e.detail.value);
|
|
88
88
|
});
|
|
89
89
|
```
|
|
90
|
+
|
|
91
|
+
## Accessibility
|
|
92
|
+
|
|
93
|
+
- `label` supplies the input's accessible name
|
|
94
|
+
- Adding, removing, and selecting tags are all reachable by keyboard (see Keyboard Navigation)
|
|
95
|
+
- Focus returns to the input after a tag is added or removed
|
|
@@ -23,6 +23,12 @@ showTimestamps: boolean = false; // attr: show-timestamps
|
|
|
23
23
|
- `getHistory()` - Get command history
|
|
24
24
|
- `clearHistory()` - Clear command history
|
|
25
25
|
|
|
26
|
+
Streaming API — feed raw chunks without splitting on newlines; a trailing partial line stays live and grows until a newline commits it:
|
|
27
|
+
|
|
28
|
+
- `appendChunk(chunk, type?)` - Append a raw chunk
|
|
29
|
+
- `pipeFrom(source, type?)` - Stream an `AsyncIterable<string>` or `ReadableStream<string|Uint8Array>`; returns `Promise<void>`
|
|
30
|
+
- `commitLiveLine()` - Force the live buffer to become a finished line
|
|
31
|
+
|
|
26
32
|
## Events
|
|
27
33
|
|
|
28
34
|
- `terminal-command` -> `{ command, args }` - Command entered
|
|
@@ -90,19 +90,13 @@ Observer for `tooltip` attribute on any element. No wrapper element -- safe insi
|
|
|
90
90
|
|
|
91
91
|
### CSS Variable API
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
| `--tooltip-strict-positioning` | (false) | `true` to disable auto-flip |
|
|
104
|
-
| `--tooltip-bg` | `hsl(0 0% 20%)` | Background color |
|
|
105
|
-
| `--tooltip-color` | `white` | Text color |
|
|
106
|
-
| `--tooltip-padding` | `8px 12px` | Content padding |
|
|
107
|
-
| `--tooltip-radius` | `6px` | Border radius |
|
|
108
|
-
| `--tooltip-font-size` | `14px` | Font size |
|
|
93
|
+
- `--tooltip-position` (`top`) — top/bottom/left/right + `-start`/`-end`
|
|
94
|
+
- `--tooltip-trigger` (`hover`) — hover, click, focus
|
|
95
|
+
- `--tooltip-delay` (`0`) / `--tooltip-hide-delay` (`0`) — show / hide delay (ms)
|
|
96
|
+
- `--tooltip-offset` (`12`) — distance from trigger (px)
|
|
97
|
+
- `--tooltip-arrow` (shown) — `none` to hide; `--tooltip-arrow-size` (`6px`) sizes it
|
|
98
|
+
- `--tooltip-max-width` (`250`) — max width (px)
|
|
99
|
+
- `--tooltip-z-index` (`10000`)
|
|
100
|
+
- `--tooltip-strict-positioning` (false) — `true` disables auto-flip
|
|
101
|
+
- `--tooltip-bg` (`hsl(0 0% 20%)`) background / `--tooltip-color` (`white`) text color
|
|
102
|
+
- `--tooltip-padding` (`8px 12px`) content padding, `--tooltip-radius` (`6px`), `--tooltip-font-size` (`14px`)
|
|
@@ -11,8 +11,8 @@ showCheckboxes: boolean = false; // attr: show-checkboxes
|
|
|
11
11
|
showIcons: boolean = true; // attr: show-icons
|
|
12
12
|
expandOnClick: boolean = false; // attr: expand-on-click
|
|
13
13
|
nodes: TreeNode[] = [];
|
|
14
|
-
selectedNodes: string[] = []; //
|
|
15
|
-
checkedNodes: string[] = []; //
|
|
14
|
+
selectedNodes: string[] = []; // JS-only; no attribute
|
|
15
|
+
checkedNodes: string[] = []; // JS-only; no attribute
|
|
16
16
|
|
|
17
17
|
interface TreeNode {
|
|
18
18
|
id: string;
|
|
@@ -78,6 +78,11 @@ duration: number; // read-only
|
|
|
78
78
|
- ArrowRight/ArrowLeft: Seek forward/backward 5s
|
|
79
79
|
- ArrowUp/ArrowDown: Volume up/down 10%
|
|
80
80
|
|
|
81
|
+
## Accessibility
|
|
82
|
+
|
|
83
|
+
- Controls carry ARIA labels; current time, duration, and playback state are exposed to AT
|
|
84
|
+
- Transitions respect `prefers-reduced-motion`
|
|
85
|
+
|
|
81
86
|
## Basic Usage
|
|
82
87
|
|
|
83
88
|
```html
|
|
@@ -58,3 +58,10 @@ chart.addEventListener('bar-click', (e) => {
|
|
|
58
58
|
console.log(`Clicked: ${e.detail.item.label} (${e.detail.item.value})`);
|
|
59
59
|
});
|
|
60
60
|
```
|
|
61
|
+
|
|
62
|
+
## Accessibility
|
|
63
|
+
|
|
64
|
+
- Bars carry data-visualization roles, are focusable, and activate by keyboard
|
|
65
|
+
- `showValues` exposes value labels as screen-reader text
|
|
66
|
+
- Bar types distinguishable by color *and* value label, not color alone
|
|
67
|
+
- Animations respect `prefers-reduced-motion`
|
package/docs/ai/events.md
CHANGED
|
@@ -342,6 +342,35 @@ changeColor(color: string) { this.color = color; return { color }; }
|
|
|
342
342
|
confirm() { return { color: this.color }; }
|
|
343
343
|
```
|
|
344
344
|
|
|
345
|
+
## Event bus
|
|
346
|
+
|
|
347
|
+
No bus object, no singleton. Bus = `@dispatch` publishing upward + `@on` subscribing at a chosen ancestor. Scope is a DOM node, so it lives and dies with the DOM.
|
|
348
|
+
|
|
349
|
+
Two publish paths — the choice decides who can hear it:
|
|
350
|
+
- **Bubble from host** — `@dispatch` defaults to `bubbles: true, composed: true`, so it crosses shadow boundaries and passes every ancestor up to `document`. For "this element did something".
|
|
351
|
+
- **Dispatch on a scope** — `@dispatch` takes the same `scope` option as `@on`, firing *on* that target instead of bubbling. For subscribers that are not ancestors (sibling subtree, or a detached host).
|
|
352
|
+
|
|
353
|
+
```typescript
|
|
354
|
+
@dispatch('bus:cart-added') // bubbles from host
|
|
355
|
+
@dispatch('bus:cart-added', { scope: 'global' }) // dispatched on document
|
|
356
|
+
|
|
357
|
+
@on('bus:cart-added', { scope: 'global' }) // document — app-wide
|
|
358
|
+
@on('bus:cart-added', { scope: 'cart-shell' }) // nearest <cart-shell> — per-instance
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
Match the halves: a bubbling publish only reaches subscribers on the host's ancestor chain. Sibling subtree → scope the dispatch too, so both meet on the same node. See [scope on @dispatch](#scope-dispatch-target).
|
|
362
|
+
|
|
363
|
+
Scope choice:
|
|
364
|
+
- `'global'` — genuinely app-wide (auth expiry, theme change, save shortcut)
|
|
365
|
+
- selector string — feature subtree; a second shell elsewhere keeps its own traffic
|
|
366
|
+
- `EventTarget` / resolver — you hold the node, or it moves and must re-resolve
|
|
367
|
+
|
|
368
|
+
Prefer the narrowest scope that works; `'global'` means every instance hears every message.
|
|
369
|
+
|
|
370
|
+
`bus:` is a naming convention, not a framework feature. Teardown is automatic — removed on disconnect from the resolved target, re-resolved on reconnect. Unresolvable selector → listener skipped + `console.warn`, never bound to the wrong node. Full table: [scope](#scope-listener-attachment-target).
|
|
371
|
+
|
|
372
|
+
Need a reply rather than a broadcast → [@request / @respond](./request-response.md).
|
|
373
|
+
|
|
345
374
|
## Custom events
|
|
346
375
|
|
|
347
376
|
Dispatching manually:
|
|
@@ -32,9 +32,10 @@ Individual breadcrumb item (data element, no shadow DOM).
|
|
|
32
32
|
| Property | Attribute | Type | Default | Description |
|
|
33
33
|
|----------|-----------|------|---------|-------------|
|
|
34
34
|
| `items` | -- | `BreadcrumbItem[]` | `[]` | Array of breadcrumb items (JS property only) |
|
|
35
|
-
| `separator` | `separator` | `'/' \| '>' \| '
|
|
35
|
+
| `separator` | `separator` | `'/' \| '>' \| '»' \| '•' \| '\|'` | `'/'` | Separator between items |
|
|
36
36
|
| `size` | `size` | `'small' \| 'medium' \| 'large'` | `'medium'` | Breadcrumb size |
|
|
37
37
|
| `maxItems` | `max-items` | `number` | `0` | Max items to show (0 = show all). Collapsed items show an ellipsis. |
|
|
38
|
+
| `collapsed` | `collapsed` | `boolean` | `true` | Whether the trail is collapsed behind the ellipsis. Clicking the ellipsis sets it `false`; it resets to `true` when `items`, `separator`, or `maxItems` change. Only has an effect once `maxItems` is exceeded. |
|
|
38
39
|
|
|
39
40
|
### BreadcrumbItem Interface
|
|
40
41
|
|
|
@@ -23,7 +23,7 @@ Display and select dates with event support, date restrictions, and locale-aware
|
|
|
23
23
|
| `events` | `CalendarEvent[]` | `[]` | Calendar events |
|
|
24
24
|
| `minDate` (attr: `min-date`) | `Date \| string` | `''` | Minimum selectable date |
|
|
25
25
|
| `maxDate` (attr: `max-date`) | `Date \| string` | `''` | Maximum selectable date |
|
|
26
|
-
| `disabledDates`
|
|
26
|
+
| `disabledDates` | `(Date \| string)[]` | `[]` | Disabled dates (JS-only; no attribute) |
|
|
27
27
|
| `highlightToday` (attr: `highlight-today`) | `boolean` | `true` | Highlight today's date |
|
|
28
28
|
| `showWeekNumbers` (attr: `show-week-numbers`) | `boolean` | `false` | Show week numbers |
|
|
29
29
|
| `firstDayOfWeek` (attr: `first-day-of-week`) | `number` | `0` | First day of week (0=Sun, 1=Mon) |
|
|
@@ -19,7 +19,7 @@ Live camera feed with built-in mobile-style controls, flexible positioning, aspe
|
|
|
19
19
|
|
|
20
20
|
| Property | Type | Default | Description |
|
|
21
21
|
|----------|------|---------|-------------|
|
|
22
|
-
| `autoStart` (attr: `auto-start`) | `boolean` | `
|
|
22
|
+
| `autoStart` (attr: `auto-start`) | `boolean` | `false` | Auto-start camera on load |
|
|
23
23
|
| `facingMode` (attr: `facing-mode`) | `'user' \| 'environment'` | `'user'` | Front or back camera |
|
|
24
24
|
| `mirror` | `boolean` | `true` | Mirror video for front camera |
|
|
25
25
|
| `controlsPosition` (attr: `controls-position`) | `ControlsPosition` | `'auto'` | Control button positioning |
|
package/docs/components/chart.md
CHANGED
|
@@ -19,7 +19,7 @@ General-purpose charting component supporting 10 chart types with animations, in
|
|
|
19
19
|
| `type` | `ChartType` | `'line'` | Chart type: `'line'`, `'bar'`, `'horizontal-bar'`, `'area'`, `'pie'`, `'donut'`, `'scatter'`, `'bubble'`, `'radar'`, `'mixed'` |
|
|
20
20
|
| `datasets` | `ChartDataset[]` | `[]` | Chart datasets (property only) |
|
|
21
21
|
| `labels` | `string[]` | `[]` | X-axis labels (property only) |
|
|
22
|
-
| `options` | `ChartOptions` |
|
|
22
|
+
| `options` | `ChartOptions` | see description | Chart options (property only). Defaults: responsive, no fixed aspect ratio, clickable legend on top, hover tooltip, 500ms ease-out animation, x/y grids on |
|
|
23
23
|
| `width` | `number` | `0` | Chart width (0 = auto) |
|
|
24
24
|
| `height` | `number` | `0` | Chart height (0 = auto) |
|
|
25
25
|
|
|
@@ -13,6 +13,10 @@ Display code with syntax highlighting, line numbers, and copy functionality. Use
|
|
|
13
13
|
- [Basic Usage](#basic-usage)
|
|
14
14
|
- [Examples](#examples)
|
|
15
15
|
- [Accessibility](#accessibility)
|
|
16
|
+
- [Fetch Mode](#fetch-mode)
|
|
17
|
+
- [Grammar System](#grammar-system)
|
|
18
|
+
- [Highlighter API](#highlighter-api)
|
|
19
|
+
- [Token CSS Classes](#token-css-classes)
|
|
16
20
|
|
|
17
21
|
## Properties
|
|
18
22
|
|
|
@@ -20,10 +24,10 @@ Display code with syntax highlighting, line numbers, and copy functionality. Use
|
|
|
20
24
|
|----------|------|---------|-------------|
|
|
21
25
|
| `code` | `string` | `''` | Code content (set via slot or property) |
|
|
22
26
|
| `language` | `CodeLanguage` | `'plaintext'` | Programming language |
|
|
23
|
-
| `grammar` | `Grammar \| string \| null` | `
|
|
27
|
+
| `grammar` | `Grammar \| string \| null` | `''` | Grammar object or URL to grammar JSON |
|
|
24
28
|
| `showLineNumbers` (attr: `show-line-numbers`) | `boolean` | `false` | Show line numbers |
|
|
25
29
|
| `startLine` (attr: `start-line`) | `number` | `1` | Starting line number |
|
|
26
|
-
| `highlightLines`
|
|
30
|
+
| `highlightLines` | `number[]` | `[]` | Lines to highlight (JS-only; no attribute) |
|
|
27
31
|
| `copyable` | `boolean` | `true` | Show copy button |
|
|
28
32
|
| `filename` | `string` | `''` | File name to display in header |
|
|
29
33
|
| `format` | `string` | `''` | Formatter name from grammar (e.g. `"pretty"`), or any truthy string with `setFormatter()` |
|
|
@@ -104,10 +108,11 @@ console.log(greeting);
|
|
|
104
108
|
|
|
105
109
|
### Highlight Specific Lines
|
|
106
110
|
|
|
107
|
-
|
|
111
|
+
Set `highlightLines` in JavaScript to draw attention to specific lines. There is no
|
|
112
|
+
`highlight-lines` attribute -- the property is JS-only.
|
|
108
113
|
|
|
109
114
|
```html
|
|
110
|
-
<snice-code-block grammar="grammars/python.json" language="python"
|
|
115
|
+
<snice-code-block id="snippet" grammar="grammars/python.json" language="python">
|
|
111
116
|
def hello():
|
|
112
117
|
name = "World"
|
|
113
118
|
greeting = f"Hello {name}"
|
|
@@ -115,6 +120,10 @@ def hello():
|
|
|
115
120
|
</snice-code-block>
|
|
116
121
|
```
|
|
117
122
|
|
|
123
|
+
```typescript
|
|
124
|
+
document.getElementById('snippet').highlightLines = [2, 3, 4];
|
|
125
|
+
```
|
|
126
|
+
|
|
118
127
|
### Programmatic Code
|
|
119
128
|
|
|
120
129
|
Set code via the `code` property for dynamic content.
|
|
@@ -123,11 +123,12 @@ Set `show-presets` to display a row of preset color swatches for quick selection
|
|
|
123
123
|
Use the `presets` property to provide your own set of preset colors.
|
|
124
124
|
|
|
125
125
|
```html
|
|
126
|
-
<snice-color-picker
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
<snice-color-picker id="brand" label="Brand Colors" show-presets></snice-color-picker>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
// presets is a JS-only property -- there is no presets attribute
|
|
131
|
+
document.getElementById('brand').presets = ['#ff0000', '#00ff00', '#0000ff', '#ffcc00'];
|
|
131
132
|
```
|
|
132
133
|
|
|
133
134
|
### Without Text Input
|
|
@@ -4,6 +4,20 @@
|
|
|
4
4
|
|
|
5
5
|
`<snice-date-time-picker>` combines an editable local date-time field, calendar, and time selectors. It is a form-associated custom element with native reset, disabled-fieldset, state-restoration, and constraint-validation behavior.
|
|
6
6
|
|
|
7
|
+
## Table of Contents
|
|
8
|
+
|
|
9
|
+
- [Basic usage](#basic-usage)
|
|
10
|
+
- [Local datetime contract](#local-datetime-contract)
|
|
11
|
+
- [Input and display](#input-and-display)
|
|
12
|
+
- [Labels and composite names](#labels-and-composite-names)
|
|
13
|
+
- [Validation](#validation)
|
|
14
|
+
- [Disabled, readonly, and loading states](#disabled-readonly-and-loading-states)
|
|
15
|
+
- [Properties](#properties)
|
|
16
|
+
- [Methods](#methods)
|
|
17
|
+
- [Events](#events)
|
|
18
|
+
- [CSS parts](#css-parts)
|
|
19
|
+
- [Accessibility](#accessibility)
|
|
20
|
+
|
|
7
21
|
## Basic usage
|
|
8
22
|
|
|
9
23
|
```typescript
|
package/docs/components/diff.md
CHANGED
|
@@ -200,7 +200,8 @@ When comparing large files, unchanged sections beyond the `context-lines` thresh
|
|
|
200
200
|
|
|
201
201
|
- Dark mode support via `[data-theme="dark"]` and `prefers-color-scheme: dark`
|
|
202
202
|
- Line numbers provide clear reference points for discussing specific changes
|
|
203
|
-
-
|
|
203
|
+
- Added and removed lines carry `+`/`-` gutter markers, so the distinction does not rely on color alone
|
|
204
|
+
- Color coding reinforces the markers: added lines green, removed lines red
|
|
204
205
|
- Word-level diffs highlight the specific words that differ within changed lines
|
|
205
206
|
- Collapsible sections reduce noise; click to expand
|
|
206
207
|
- Stats header provides an immediate +N/-N overview of change scope
|
package/docs/components/draw.md
CHANGED
|
@@ -67,11 +67,11 @@ interface DrawStroke {
|
|
|
67
67
|
|
|
68
68
|
| Event | Detail | Description |
|
|
69
69
|
|-------|--------|-------------|
|
|
70
|
-
| `draw-start` |
|
|
71
|
-
| `draw-end` | `{ stroke }` | Drawing ended (stroke complete) |
|
|
72
|
-
| `draw-clear` |
|
|
73
|
-
| `draw-undo` |
|
|
74
|
-
| `draw-redo` |
|
|
70
|
+
| `draw-start` | `{ draw, point }` | Drawing started |
|
|
71
|
+
| `draw-end` | `{ draw, stroke }` | Drawing ended (stroke complete) |
|
|
72
|
+
| `draw-clear` | `{ draw }` | Canvas cleared |
|
|
73
|
+
| `draw-undo` | `{ draw }` | Undo performed |
|
|
74
|
+
| `draw-redo` | `{ draw }` | Redo performed |
|
|
75
75
|
|
|
76
76
|
## CSS Parts
|
|
77
77
|
|
|
@@ -77,10 +77,10 @@ Slide-out panel from any viewport side with focus trap and dismissal options. Su
|
|
|
77
77
|
| `--drawer-height-xl` | XL drawer height (top/bottom) | `70vh` |
|
|
78
78
|
| `--drawer-height-xxl` | XXL drawer height (top/bottom) | `80vh` |
|
|
79
79
|
| `--drawer-height-xxxl` | XXXL drawer height (top/bottom) | `90vh` |
|
|
80
|
-
| `--drawer-bg` | Drawer background color | `var(--snice-color-surface, white)` |
|
|
81
|
-
| `--drawer-shadow` | Drawer shadow | `var(--snice-shadow-
|
|
82
|
-
| `--drawer-backdrop` | Backdrop color | `
|
|
83
|
-
| `--drawer-transition` | Transition timing | `transform
|
|
80
|
+
| `--drawer-bg` | Drawer background color | `var(--snice-color-surface-container-highest, var(--snice-color-surface, white))` |
|
|
81
|
+
| `--drawer-shadow` | Drawer shadow | `var(--snice-shadow-2xl, ...)` |
|
|
82
|
+
| `--drawer-backdrop` | Backdrop color | `var(--snice-drawer-backdrop, rgb(0 0 0 / 0.6))` |
|
|
83
|
+
| `--drawer-transition` | Transition timing | `transform 320ms var(--snice-ease-out, cubic-bezier(0.22, 1, 0.36, 1))` |
|
|
84
84
|
| `--drawer-z-index` | Z-index | `var(--snice-z-overlay, 1050)` |
|
|
85
85
|
|
|
86
86
|
## CSS Parts
|
package/docs/components/input.md
CHANGED
|
@@ -9,6 +9,7 @@ Application layout with header navigation, main content area, and footer.
|
|
|
9
9
|
- [Methods](#methods)
|
|
10
10
|
- [Slots](#slots)
|
|
11
11
|
- [CSS Parts](#css-parts)
|
|
12
|
+
- [CSS Custom Properties](#css-custom-properties)
|
|
12
13
|
- [Basic Usage](#basic-usage)
|
|
13
14
|
- [Examples](#examples)
|
|
14
15
|
- [Shell variants](#shell-variants)
|
|
@@ -68,6 +69,24 @@ snice-layout::part(footer) {
|
|
|
68
69
|
}
|
|
69
70
|
```
|
|
70
71
|
|
|
72
|
+
## CSS Custom Properties
|
|
73
|
+
|
|
74
|
+
| Property | Default | Applies to |
|
|
75
|
+
|----------|---------|------------|
|
|
76
|
+
| `--snice-layout-sidebar-width` | `16rem` | Expanded sidebar |
|
|
77
|
+
| `--snice-layout-rail-collapsed-width` | `3rem` | Collapsed rail |
|
|
78
|
+
| `--snice-layout-rail-width` | `18rem` | Dashboard right rail |
|
|
79
|
+
| `--snice-layout-measure` | `65ch` | Blog reading measure |
|
|
80
|
+
| `--snice-layout-container` | `80rem` | Landing band inner width |
|
|
81
|
+
| `--snice-layout-list-width` | `20rem` | Master-detail list pane |
|
|
82
|
+
| `--snice-layout-docs-nav-width` | `18.75rem` | Documentation navigation tree |
|
|
83
|
+
| `--snice-layout-docs-toc-width` | `18.75rem` | Documentation on-this-page rail |
|
|
84
|
+
| `--snice-layout-docs-header-height` | `4rem` | Documentation sticky header |
|
|
85
|
+
| `--snice-layout-docs-header-height-compact` | `3.5rem` | Documentation header below 768px |
|
|
86
|
+
| `--snice-layout-auth-width` | `24rem` | Auth split form column |
|
|
87
|
+
| `--snice-layout-auth-panel-bg` | `var(--snice-color-surface-container)` | Auth split decorative panel |
|
|
88
|
+
| `--snice-layout-control-size` | `2rem` | Sidebar and drawer toggle buttons |
|
|
89
|
+
|
|
71
90
|
## Basic Usage
|
|
72
91
|
|
|
73
92
|
```typescript
|
|
@@ -118,15 +137,6 @@ Use the `update()` method to sync navigation with the router.
|
|
|
118
137
|
layout.update(appContext, placards, currentRoute, routeParams);
|
|
119
138
|
```
|
|
120
139
|
|
|
121
|
-
## CSS Custom Properties
|
|
122
|
-
|
|
123
|
-
| Property | Description |
|
|
124
|
-
|----------|-------------|
|
|
125
|
-
| `--snice-layout-auth-panel-bg` | Layout auth panel background |
|
|
126
|
-
| `--snice-layout-control-size` | Layout control size |
|
|
127
|
-
| `--snice-layout-docs-header-height` | Layout docs header height |
|
|
128
|
-
| `--snice-layout-docs-header-height-compact` | Layout docs header height compact |
|
|
129
|
-
|
|
130
140
|
## Shell variants
|
|
131
141
|
|
|
132
142
|
`<snice-layout>` is the stacked shell (header / main / footer). These siblings cover the
|
|
@@ -266,16 +276,4 @@ it to the leading side.
|
|
|
266
276
|
| `snice-layout-master-detail` | `selected` | boolean | `false` | A detail is open; drives the single-pane view below 641px |
|
|
267
277
|
| `snice-layout-auth-split` | `panel-position` | `start`, `end` | `end` | Side the brand panel sits on |
|
|
268
278
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
| Custom property | Default | Applies to |
|
|
272
|
-
|-----------------|---------|------------|
|
|
273
|
-
| `--snice-layout-sidebar-width` | `16rem` | Expanded sidebar |
|
|
274
|
-
| `--snice-layout-rail-collapsed-width` | `3rem` | Collapsed rail |
|
|
275
|
-
| `--snice-layout-rail-width` | `18rem` | Dashboard right rail |
|
|
276
|
-
| `--snice-layout-measure` | `65ch` | Blog reading measure |
|
|
277
|
-
| `--snice-layout-container` | `80rem` | Landing band inner width |
|
|
278
|
-
| `--snice-layout-list-width` | `20rem` | Master-detail list pane |
|
|
279
|
-
| `--snice-layout-docs-nav-width` | `18.75rem` | Documentation navigation tree |
|
|
280
|
-
| `--snice-layout-docs-toc-width` | `18.75rem` | Documentation on-this-page rail |
|
|
281
|
-
| `--snice-layout-auth-width` | `24rem` | Auth split form column |
|
|
279
|
+
Shell sizing hooks are listed under [CSS Custom Properties](#css-custom-properties).
|
|
@@ -39,7 +39,7 @@ A ranked list of entries with optional avatars, change indicators, and podium hi
|
|
|
39
39
|
|----------|------|---------|-------------|
|
|
40
40
|
| `variant` | `'default' \| 'podium' \| 'compact'` | `'default'` | Display variant |
|
|
41
41
|
| `size` | `'small' \| 'medium' \| 'large'` | `'medium'` | Entry size |
|
|
42
|
-
| `title` | `string` | `''` | Optional title
|
|
42
|
+
| `title` | `string` | `''` | Optional title above the list (JS-only; a `title` attribute is the native tooltip) |
|
|
43
43
|
|
|
44
44
|
## Methods
|
|
45
45
|
|
|
@@ -108,12 +108,19 @@ import 'snice/components/leaderboard/snice-leaderboard';
|
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
```html
|
|
111
|
-
<snice-leaderboard
|
|
111
|
+
<snice-leaderboard id="board">
|
|
112
112
|
<snice-leaderboard-entry rank="1" name="Alice" score="2500"></snice-leaderboard-entry>
|
|
113
113
|
<snice-leaderboard-entry rank="2" name="Bob" score="2100"></snice-leaderboard-entry>
|
|
114
114
|
</snice-leaderboard>
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
+
`title` is a JS-only property. A `title` attribute is the native HTML tooltip and does
|
|
118
|
+
not set the heading.
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
document.getElementById('board').title = 'Top Players';
|
|
122
|
+
```
|
|
123
|
+
|
|
117
124
|
## Examples
|
|
118
125
|
|
|
119
126
|
### Declarative API (Child Elements)
|
|
@@ -121,7 +128,7 @@ import 'snice/components/leaderboard/snice-leaderboard';
|
|
|
121
128
|
Use `<snice-leaderboard-entry>` elements as children. The parent reads attributes and renders the full UI.
|
|
122
129
|
|
|
123
130
|
```html
|
|
124
|
-
<snice-leaderboard variant="podium"
|
|
131
|
+
<snice-leaderboard variant="podium">
|
|
125
132
|
<snice-leaderboard-entry rank="1" name="Alice" score="2,500" avatar="alice.jpg" change="3" highlighted></snice-leaderboard-entry>
|
|
126
133
|
<snice-leaderboard-entry rank="2" name="Bob" score="2,100" change="-1"></snice-leaderboard-entry>
|
|
127
134
|
<snice-leaderboard-entry rank="3" name="Charlie" score="1,800" change="2"></snice-leaderboard-entry>
|
|
@@ -18,7 +18,7 @@ Displays a rich preview card for a URL with image, title, description, and site
|
|
|
18
18
|
| Property | Type | Default | Description |
|
|
19
19
|
|----------|------|---------|-------------|
|
|
20
20
|
| `url` | `string` | `''` | Target URL (opens on click) |
|
|
21
|
-
| `title` | `string` | `''` | Preview title
|
|
21
|
+
| `title` | `string` | `''` | Preview title, clamped to 2 lines (JS-only; a `title` attribute is the native tooltip) |
|
|
22
22
|
| `description` | `string` | `''` | Preview description (clamped to 3 lines) |
|
|
23
23
|
| `image` | `string` | `''` | Preview image URL |
|
|
24
24
|
| `siteName` (attr: `site-name`) | `string` | `''` | Site name shown in footer |
|
|
@@ -62,13 +62,20 @@ import 'snice/components/link-preview/snice-link-preview';
|
|
|
62
62
|
|
|
63
63
|
```html
|
|
64
64
|
<snice-link-preview
|
|
65
|
+
id="preview"
|
|
65
66
|
url="https://example.com"
|
|
66
|
-
title="Example Website"
|
|
67
67
|
description="An example website for demonstration."
|
|
68
68
|
image="https://example.com/og-image.jpg">
|
|
69
69
|
</snice-link-preview>
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
+
`title` is a JS-only property. A `title` attribute is the native HTML tooltip and does
|
|
73
|
+
not set the preview heading.
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
document.getElementById('preview').title = 'Example Website';
|
|
77
|
+
```
|
|
78
|
+
|
|
72
79
|
## Examples
|
|
73
80
|
|
|
74
81
|
### Vertical Card
|
|
@@ -78,7 +85,6 @@ The default layout stacks the image above the content.
|
|
|
78
85
|
```html
|
|
79
86
|
<snice-link-preview
|
|
80
87
|
url="https://snice.dev"
|
|
81
|
-
title="Snice - Beautiful Decorators for Custom Elements"
|
|
82
88
|
description="Write clean, reactive web components with TypeScript decorators."
|
|
83
89
|
image="https://picsum.photos/600/300"
|
|
84
90
|
site-name="snice.dev">
|
|
@@ -93,7 +99,6 @@ Use `variant="horizontal"` to display the image beside the content.
|
|
|
93
99
|
<snice-link-preview
|
|
94
100
|
variant="horizontal"
|
|
95
101
|
url="https://snice.dev/guide"
|
|
96
|
-
title="Getting Started Guide"
|
|
97
102
|
description="Learn to build elements step by step."
|
|
98
103
|
site-name="snice.dev">
|
|
99
104
|
</snice-link-preview>
|
|
@@ -104,8 +109,8 @@ Use `variant="horizontal"` to display the image beside the content.
|
|
|
104
109
|
Use the `size` attribute to adjust padding, font sizes, and image dimensions.
|
|
105
110
|
|
|
106
111
|
```html
|
|
107
|
-
<snice-link-preview size="small" url="https://example.com"
|
|
108
|
-
<snice-link-preview size="large" url="https://example.com"
|
|
112
|
+
<snice-link-preview size="small" url="https://example.com" description="A short summary."></snice-link-preview>
|
|
113
|
+
<snice-link-preview size="large" url="https://example.com" description="A longer description with more room for content." image="https://picsum.photos/800/400"></snice-link-preview>
|
|
109
114
|
```
|
|
110
115
|
|
|
111
116
|
### Without Image
|
|
@@ -115,7 +120,6 @@ When no image is provided, a placeholder link icon is shown.
|
|
|
115
120
|
```html
|
|
116
121
|
<snice-link-preview
|
|
117
122
|
url="https://example.com"
|
|
118
|
-
title="Text-Only Preview"
|
|
119
123
|
description="When no image is provided, a placeholder icon is shown."
|
|
120
124
|
site-name="example.com">
|
|
121
125
|
</snice-link-preview>
|
|
@@ -126,7 +130,6 @@ When no image is provided, a placeholder link icon is shown.
|
|
|
126
130
|
```html
|
|
127
131
|
<snice-link-preview
|
|
128
132
|
url="https://example.com/article"
|
|
129
|
-
title="Article with Favicon"
|
|
130
133
|
description="Shows the site favicon next to the site name."
|
|
131
134
|
image="https://picsum.photos/600/300"
|
|
132
135
|
site-name="example.com"
|
|
@@ -139,7 +142,6 @@ When no image is provided, a placeholder link icon is shown.
|
|
|
139
142
|
```html
|
|
140
143
|
<snice-link-preview
|
|
141
144
|
id="preview"
|
|
142
|
-
title="Clickable Preview"
|
|
143
145
|
description="Listen for click events."
|
|
144
146
|
url="https://example.com">
|
|
145
147
|
</snice-link-preview>
|
package/docs/components/login.md
CHANGED
|
@@ -28,6 +28,8 @@ A complete authentication form with username/password fields, using Snice's @req
|
|
|
28
28
|
| `showRememberMe` (attr: `show-remember-me`) | `boolean` | `true` | Show "Remember me" checkbox |
|
|
29
29
|
| `showForgotPassword` (attr: `show-forgot-password`) | `boolean` | `true` | Show "Forgot password" link |
|
|
30
30
|
| `actionText` (attr: `action-text`) | `string` | `'Sign In'` | Submit button text |
|
|
31
|
+
| `alertMessage` | `string` | `''` | Inline alert text; set from JS to show a message above the form |
|
|
32
|
+
| `alertVariant` | `'error' \| 'success' \| ''` | `''` | Styling for `alertMessage` |
|
|
31
33
|
|
|
32
34
|
## Methods
|
|
33
35
|
|
|
@@ -38,6 +40,8 @@ A complete authentication form with username/password fields, using Snice's @req
|
|
|
38
40
|
| `setError()` | `message: string` | Display an error message |
|
|
39
41
|
| `clearError()` | -- | Remove error message |
|
|
40
42
|
| `setCredentials()` | `credentials: Partial<LoginCredentials>` | Set form field values |
|
|
43
|
+
| `showAlert()` | `message: string, variant: 'error' \| 'success'` | Show an inline alert above the form; `setError()` is the error-only shorthand |
|
|
44
|
+
| `clearAlert()` | -- | Remove the inline alert |
|
|
41
45
|
|
|
42
46
|
## Requests
|
|
43
47
|
|
package/docs/components/menu.md
CHANGED
|
@@ -112,7 +112,7 @@ A dropdown menu with composable items, dividers, icons, and keyboard shortcut hi
|
|
|
112
112
|
| `--menu-border` | Panel border color | `var(--snice-color-border, #e5e7eb)` |
|
|
113
113
|
| `--menu-shadow` | Panel box shadow | `var(--snice-shadow-lg)` |
|
|
114
114
|
| `--menu-z-index` | Panel z-index | `var(--snice-z-floating, 1000)` |
|
|
115
|
-
| `--menu-border-radius` | Panel border radius | `var(--snice-radius-md, 0.
|
|
115
|
+
| `--menu-border-radius` | Panel border radius | `var(--snice-border-radius-md, 0.25rem)` |
|
|
116
116
|
| `--menu-min-width` | Minimum panel width | `10rem` |
|
|
117
117
|
|
|
118
118
|
## Basic Usage
|
package/docs/components/modal.md
CHANGED
|
@@ -14,6 +14,7 @@ A dialog overlay with focus trapping, backdrop dismiss, and keyboard navigation.
|
|
|
14
14
|
- [Basic Usage](#basic-usage)
|
|
15
15
|
- [Examples](#examples)
|
|
16
16
|
- [Keyboard Navigation](#keyboard-navigation)
|
|
17
|
+
- [CSS Custom Properties](#css-custom-properties)
|
|
17
18
|
- [Accessibility](#accessibility)
|
|
18
19
|
|
|
19
20
|
## Properties
|
package/docs/components/nav.md
CHANGED
|
@@ -24,6 +24,7 @@ A bell icon with a dropdown notification panel. Displays an unread count badge,
|
|
|
24
24
|
| `notifications` | `NotificationItem[]` | `[]` | Array of notification objects to display (set via JS) |
|
|
25
25
|
| `open` | `boolean` | `false` | Whether the dropdown panel is visible |
|
|
26
26
|
| `icon` | `string` | `''` | Custom bell icon (URL, image file, or emoji). Use slot for icon fonts. |
|
|
27
|
+
| `placement` | `'start' \| 'end'` | `'end'` | Side the dropdown panel aligns to |
|
|
27
28
|
|
|
28
29
|
## Methods
|
|
29
30
|
|
|
@@ -74,7 +75,7 @@ snice-notification-center::part(panel) {
|
|
|
74
75
|
| Property | Description |
|
|
75
76
|
|----------|-------------|
|
|
76
77
|
| `--snice-color-primary` | Mark-all-read link color and unread highlight |
|
|
77
|
-
| `--snice-color-primary-subtle` | Unread item background |
|
|
78
|
+
| `--snice-color-primary-subtle-hover` | Unread item background on hover (the base unread tint derives from `--snice-color-primary`) |
|
|
78
79
|
| `--snice-color-danger` | Badge background and dismiss hover color |
|
|
79
80
|
| `--snice-color-text-secondary` | Message text color |
|
|
80
81
|
| `--snice-color-text-tertiary` | Timestamp, empty state text, and dismiss icon color |
|
|
@@ -12,6 +12,7 @@ A product display card with image gallery, pricing, star ratings, variant select
|
|
|
12
12
|
- [Basic Usage](#basic-usage)
|
|
13
13
|
- [Examples](#examples)
|
|
14
14
|
- [Accessibility](#accessibility)
|
|
15
|
+
- [CSS Custom Properties](#css-custom-properties)
|
|
15
16
|
- [Data Types](#data-types)
|
|
16
17
|
|
|
17
18
|
## Properties
|
|
@@ -12,6 +12,7 @@ A QR code scanner using device cameras with real-time detection.
|
|
|
12
12
|
- [CSS Custom Properties](#css-custom-properties)
|
|
13
13
|
- [Basic Usage](#basic-usage)
|
|
14
14
|
- [Examples](#examples)
|
|
15
|
+
- [CSS Parts](#css-parts)
|
|
15
16
|
- [Accessibility](#accessibility)
|
|
16
17
|
|
|
17
18
|
## Properties
|
|
@@ -21,8 +21,8 @@ An interactive star rating input with configurable precision, custom icons, and
|
|
|
21
21
|
|----------|------|---------|-------------|
|
|
22
22
|
| `value` | `number` | `0` | Current rating value |
|
|
23
23
|
| `max` | `number` | `5` | Maximum number of stars |
|
|
24
|
-
| `icon` | `string` | `'
|
|
25
|
-
| `emptyIcon` (attr: `empty-icon`) | `string` | `''` | Optional
|
|
24
|
+
| `icon` | `string` | `'star'` | Icon for each item: built-in catalogue name, emoji, URL, or image file |
|
|
25
|
+
| `emptyIcon` (attr: `empty-icon`) | `string` | `''` | Optional icon for the unfilled layer; empty uses `icon` |
|
|
26
26
|
| `size` | `'small' \| 'medium' \| 'large'` | `'medium'` | Display size |
|
|
27
27
|
| `readonly` | `boolean` | `false` | Disable user interaction |
|
|
28
28
|
| `precision` | `'full' \| 'half'` | `'full'` | Click precision (full or half star increments) |
|
|
@@ -37,8 +37,8 @@ An interactive star rating input with configurable precision, custom icons, and
|
|
|
37
37
|
|
|
38
38
|
| Property | Description | Default |
|
|
39
39
|
|----------|-------------|---------|
|
|
40
|
-
| `--rating-color` | Filled star color | `
|
|
41
|
-
| `--rating-color-empty` | Empty star color | `var(--snice-color-
|
|
40
|
+
| `--rating-color` | Filled star color | `rgb(245 158 11)` (not theme-derived) |
|
|
41
|
+
| `--rating-color-empty` | Empty star color | `var(--snice-color-text-tertiary, rgb(115 115 115))` |
|
|
42
42
|
| `--rating-size` | Star size (set automatically by `size` property) | `1.5rem` |
|
|
43
43
|
|
|
44
44
|
## CSS Parts
|
|
@@ -16,6 +16,7 @@ A customizable dropdown selection with single/multiple selection, search filteri
|
|
|
16
16
|
- [External Labels and Accessible Naming](#external-labels-and-accessible-naming)
|
|
17
17
|
- [Form Integration](#form-integration)
|
|
18
18
|
- [Keyboard Navigation](#keyboard-navigation)
|
|
19
|
+
- [CSS Custom Properties](#css-custom-properties)
|
|
19
20
|
- [Accessibility](#accessibility)
|
|
20
21
|
|
|
21
22
|
## Components
|