snice 4.27.0 → 4.29.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/adapters/react/action-bar.d.ts +30 -0
- package/adapters/react/action-bar.d.ts.map +1 -0
- package/adapters/react/action-bar.js +24 -0
- package/adapters/react/action-bar.js.map +1 -0
- package/adapters/react/action-bar.tsx +38 -0
- package/adapters/react/binpack.d.ts +35 -0
- package/adapters/react/binpack.d.ts.map +1 -0
- package/adapters/react/binpack.js +24 -0
- package/adapters/react/binpack.js.map +1 -0
- package/adapters/react/binpack.tsx +43 -0
- package/adapters/react/components.d.ts +4 -0
- package/adapters/react/components.d.ts.map +1 -1
- package/adapters/react/components.js +2 -0
- package/adapters/react/components.js.map +1 -1
- package/adapters/react/components.ts +4 -0
- package/adapters/react/useRequestHandler.d.ts +56 -0
- package/adapters/react/useRequestHandler.js +103 -0
- package/adapters/react/useRequestHandler.js.map +1 -0
- package/dist/cdn/accordion/snice-accordion.js +1 -1
- package/dist/cdn/accordion/snice-accordion.min.js +1 -1
- package/dist/cdn/action-bar/README.md +27 -0
- package/dist/cdn/action-bar/snice-action-bar.js +249 -0
- package/dist/cdn/action-bar/snice-action-bar.js.map +1 -0
- package/dist/cdn/action-bar/snice-action-bar.min.js +12 -0
- package/dist/cdn/action-bar/snice-action-bar.min.js.map +1 -0
- package/dist/cdn/activity-feed/snice-activity-feed.js +1 -1
- package/dist/cdn/activity-feed/snice-activity-feed.min.js +1 -1
- package/dist/cdn/alert/snice-alert.js +1 -1
- package/dist/cdn/alert/snice-alert.min.js +1 -1
- package/dist/cdn/app-tiles/snice-app-tiles.js +1 -1
- package/dist/cdn/app-tiles/snice-app-tiles.min.js +1 -1
- package/dist/cdn/approval-flow/snice-approval-flow.js +1 -1
- package/dist/cdn/approval-flow/snice-approval-flow.min.js +1 -1
- package/dist/cdn/audio-recorder/snice-audio-recorder.js +1 -1
- package/dist/cdn/audio-recorder/snice-audio-recorder.min.js +1 -1
- package/dist/cdn/availability/snice-availability.js +1 -1
- package/dist/cdn/availability/snice-availability.min.js +1 -1
- package/dist/cdn/avatar/snice-avatar.js +1 -1
- package/dist/cdn/avatar/snice-avatar.min.js +1 -1
- package/dist/cdn/avatar-group/snice-avatar-group.js +1 -1
- package/dist/cdn/avatar-group/snice-avatar-group.min.js +1 -1
- package/dist/cdn/badge/snice-badge.js +2 -2
- package/dist/cdn/badge/snice-badge.js.map +1 -1
- package/dist/cdn/badge/snice-badge.min.js +2 -2
- package/dist/cdn/badge/snice-badge.min.js.map +1 -1
- package/dist/cdn/banner/snice-banner.js +1 -1
- package/dist/cdn/banner/snice-banner.min.js +1 -1
- package/dist/cdn/binpack/README.md +27 -0
- package/dist/cdn/binpack/snice-binpack.js +1037 -0
- package/dist/cdn/binpack/snice-binpack.js.map +1 -0
- package/dist/cdn/binpack/snice-binpack.min.js +13 -0
- package/dist/cdn/binpack/snice-binpack.min.js.map +1 -0
- package/dist/cdn/book/snice-book.js +1 -1
- package/dist/cdn/book/snice-book.min.js +1 -1
- package/dist/cdn/booking/snice-booking.js +1 -1
- package/dist/cdn/booking/snice-booking.min.js +1 -1
- package/dist/cdn/breadcrumbs/snice-breadcrumbs.js +1 -1
- package/dist/cdn/breadcrumbs/snice-breadcrumbs.min.js +1 -1
- package/dist/cdn/button/README.md +1 -1
- package/dist/cdn/button/snice-button.js +11 -10
- package/dist/cdn/button/snice-button.js.map +1 -1
- package/dist/cdn/button/snice-button.min.js +3 -3
- package/dist/cdn/button/snice-button.min.js.map +1 -1
- package/dist/cdn/calendar/snice-calendar.js +1 -1
- package/dist/cdn/calendar/snice-calendar.min.js +1 -1
- package/dist/cdn/camera/snice-camera.js +1 -1
- package/dist/cdn/camera/snice-camera.min.js +1 -1
- package/dist/cdn/camera-annotate/snice-camera-annotate.js +1 -1
- package/dist/cdn/camera-annotate/snice-camera-annotate.min.js +1 -1
- package/dist/cdn/candlestick/snice-candlestick.js +1 -1
- package/dist/cdn/candlestick/snice-candlestick.min.js +1 -1
- package/dist/cdn/card/snice-card.js +1 -1
- package/dist/cdn/card/snice-card.min.js +1 -1
- package/dist/cdn/carousel/snice-carousel.js +1 -1
- package/dist/cdn/carousel/snice-carousel.min.js +1 -1
- package/dist/cdn/cart/snice-cart.js +1 -1
- package/dist/cdn/cart/snice-cart.min.js +1 -1
- package/dist/cdn/chart/snice-chart.js +1 -1
- package/dist/cdn/chart/snice-chart.min.js +1 -1
- package/dist/cdn/chat/snice-chat.js +1 -1
- package/dist/cdn/chat/snice-chat.min.js +1 -1
- package/dist/cdn/checkbox/snice-checkbox.js +1 -1
- package/dist/cdn/checkbox/snice-checkbox.min.js +1 -1
- package/dist/cdn/chip/snice-chip.js +1 -1
- package/dist/cdn/chip/snice-chip.min.js +1 -1
- package/dist/cdn/code-block/snice-code-block.js +1 -1
- package/dist/cdn/code-block/snice-code-block.min.js +1 -1
- package/dist/cdn/color-display/snice-color-display.js +1 -1
- package/dist/cdn/color-display/snice-color-display.min.js +1 -1
- package/dist/cdn/color-picker/snice-color-picker.js +1 -1
- package/dist/cdn/color-picker/snice-color-picker.min.js +1 -1
- package/dist/cdn/command-palette/snice-command-palette.js +1 -1
- package/dist/cdn/command-palette/snice-command-palette.min.js +1 -1
- package/dist/cdn/comments/snice-comments.js +1 -1
- package/dist/cdn/comments/snice-comments.min.js +1 -1
- package/dist/cdn/countdown/snice-countdown.js +1 -1
- package/dist/cdn/countdown/snice-countdown.min.js +1 -1
- package/dist/cdn/cropper/snice-cropper.js +1 -1
- package/dist/cdn/cropper/snice-cropper.min.js +1 -1
- package/dist/cdn/data-card/snice-data-card.js +1 -1
- package/dist/cdn/data-card/snice-data-card.min.js +1 -1
- package/dist/cdn/date-picker/snice-date-picker.js +1 -1
- package/dist/cdn/date-picker/snice-date-picker.min.js +1 -1
- package/dist/cdn/date-range-picker/snice-date-range-picker.js +1 -1
- package/dist/cdn/date-range-picker/snice-date-range-picker.min.js +1 -1
- package/dist/cdn/date-time-picker/snice-date-time-picker.js +1 -1
- package/dist/cdn/date-time-picker/snice-date-time-picker.min.js +1 -1
- package/dist/cdn/diff/snice-diff.js +1 -1
- package/dist/cdn/diff/snice-diff.min.js +1 -1
- package/dist/cdn/divider/snice-divider.js +1 -1
- package/dist/cdn/divider/snice-divider.min.js +1 -1
- package/dist/cdn/doc/snice-doc.js +1 -1
- package/dist/cdn/doc/snice-doc.min.js +1 -1
- package/dist/cdn/draw/snice-draw.js +1 -1
- package/dist/cdn/draw/snice-draw.min.js +1 -1
- package/dist/cdn/drawer/snice-drawer.js +1 -1
- package/dist/cdn/drawer/snice-drawer.min.js +1 -1
- package/dist/cdn/empty-state/snice-empty-state.js +1 -1
- package/dist/cdn/empty-state/snice-empty-state.min.js +1 -1
- package/dist/cdn/estimate/snice-estimate.js +1 -1
- package/dist/cdn/estimate/snice-estimate.min.js +1 -1
- package/dist/cdn/file-gallery/snice-file-gallery.js +1 -1
- package/dist/cdn/file-gallery/snice-file-gallery.min.js +1 -1
- package/dist/cdn/file-upload/snice-file-upload.js +1 -1
- package/dist/cdn/file-upload/snice-file-upload.min.js +1 -1
- package/dist/cdn/flip-card/snice-flip-card.js +1 -1
- package/dist/cdn/flip-card/snice-flip-card.min.js +1 -1
- package/dist/cdn/flow/snice-flow.js +1 -1
- package/dist/cdn/flow/snice-flow.min.js +1 -1
- package/dist/cdn/form-layout/snice-form-layout.js +1 -1
- package/dist/cdn/form-layout/snice-form-layout.min.js +1 -1
- package/dist/cdn/funnel/snice-funnel.js +1 -1
- package/dist/cdn/funnel/snice-funnel.min.js +1 -1
- package/dist/cdn/gantt/snice-gantt.js +1 -1
- package/dist/cdn/gantt/snice-gantt.min.js +1 -1
- package/dist/cdn/gauge/snice-gauge.js +1 -1
- package/dist/cdn/gauge/snice-gauge.min.js +1 -1
- package/dist/cdn/heatmap/snice-heatmap.js +1 -1
- package/dist/cdn/heatmap/snice-heatmap.min.js +1 -1
- package/dist/cdn/image/snice-image.js +1 -1
- package/dist/cdn/image/snice-image.min.js +1 -1
- package/dist/cdn/input/snice-input.js +1 -1
- package/dist/cdn/input/snice-input.min.js +1 -1
- package/dist/cdn/invoice/snice-invoice.js +1 -1
- package/dist/cdn/invoice/snice-invoice.min.js +1 -1
- package/dist/cdn/kanban/snice-kanban.js +1 -1
- package/dist/cdn/kanban/snice-kanban.min.js +1 -1
- package/dist/cdn/key-value/snice-key-value.js +1 -1
- package/dist/cdn/key-value/snice-key-value.min.js +1 -1
- package/dist/cdn/kpi/snice-kpi.js +1 -1
- package/dist/cdn/kpi/snice-kpi.min.js +1 -1
- package/dist/cdn/layout/snice-layout.js +1 -1
- package/dist/cdn/layout/snice-layout.min.js +1 -1
- package/dist/cdn/leaderboard/snice-leaderboard.js +1 -1
- package/dist/cdn/leaderboard/snice-leaderboard.min.js +1 -1
- package/dist/cdn/link/snice-link.js +1 -1
- package/dist/cdn/link/snice-link.min.js +1 -1
- package/dist/cdn/link-preview/snice-link-preview.js +1 -1
- package/dist/cdn/link-preview/snice-link-preview.min.js +1 -1
- package/dist/cdn/list/snice-list.js +1 -1
- package/dist/cdn/list/snice-list.min.js +1 -1
- package/dist/cdn/location/snice-location.js +1 -1
- package/dist/cdn/location/snice-location.min.js +1 -1
- package/dist/cdn/login/README.md +2 -2
- package/dist/cdn/login/snice-login.js +11 -10
- package/dist/cdn/login/snice-login.js.map +1 -1
- package/dist/cdn/login/snice-login.min.js +5 -5
- package/dist/cdn/login/snice-login.min.js.map +1 -1
- package/dist/cdn/map/snice-map.js +1 -1
- package/dist/cdn/map/snice-map.min.js +1 -1
- package/dist/cdn/markdown/snice-markdown.js +1 -1
- package/dist/cdn/markdown/snice-markdown.min.js +1 -1
- package/dist/cdn/masonry/snice-masonry.js +1 -1
- package/dist/cdn/masonry/snice-masonry.min.js +1 -1
- package/dist/cdn/menu/snice-menu.js +1 -1
- package/dist/cdn/menu/snice-menu.min.js +1 -1
- package/dist/cdn/message-strip/snice-message-strip.js +1 -1
- package/dist/cdn/message-strip/snice-message-strip.min.js +1 -1
- package/dist/cdn/metric-table/snice-metric-table.js +1 -1
- package/dist/cdn/metric-table/snice-metric-table.min.js +1 -1
- package/dist/cdn/modal/snice-modal.js +1 -1
- package/dist/cdn/modal/snice-modal.min.js +1 -1
- package/dist/cdn/music-player/snice-music-player.js +1 -1
- package/dist/cdn/music-player/snice-music-player.min.js +1 -1
- package/dist/cdn/nav/snice-nav.js +1 -1
- package/dist/cdn/nav/snice-nav.min.js +1 -1
- package/dist/cdn/network-graph/snice-network-graph.js +1 -1
- package/dist/cdn/network-graph/snice-network-graph.min.js +1 -1
- package/dist/cdn/notification-center/snice-notification-center.js +1 -1
- package/dist/cdn/notification-center/snice-notification-center.min.js +1 -1
- package/dist/cdn/order-tracker/snice-order-tracker.js +1 -1
- package/dist/cdn/order-tracker/snice-order-tracker.min.js +1 -1
- package/dist/cdn/org-chart/snice-org-chart.js +1 -1
- package/dist/cdn/org-chart/snice-org-chart.min.js +1 -1
- package/dist/cdn/pagination/snice-pagination.js +1 -1
- package/dist/cdn/pagination/snice-pagination.min.js +1 -1
- package/dist/cdn/paint/snice-paint.js +1 -1
- package/dist/cdn/paint/snice-paint.min.js +1 -1
- package/dist/cdn/pdf-viewer/snice-pdf-viewer.js +1 -1
- package/dist/cdn/pdf-viewer/snice-pdf-viewer.min.js +1 -1
- package/dist/cdn/permission-matrix/snice-permission-matrix.js +1 -1
- package/dist/cdn/permission-matrix/snice-permission-matrix.min.js +1 -1
- package/dist/cdn/podcast-player/snice-podcast-player.js +1 -1
- package/dist/cdn/podcast-player/snice-podcast-player.min.js +1 -1
- package/dist/cdn/pricing-table/snice-pricing-table.js +1 -1
- package/dist/cdn/pricing-table/snice-pricing-table.min.js +1 -1
- package/dist/cdn/product-card/snice-product-card.js +1 -1
- package/dist/cdn/product-card/snice-product-card.min.js +1 -1
- package/dist/cdn/progress/snice-progress.js +1 -1
- package/dist/cdn/progress/snice-progress.min.js +1 -1
- package/dist/cdn/progress-ring/snice-progress-ring.js +1 -1
- package/dist/cdn/progress-ring/snice-progress-ring.min.js +1 -1
- package/dist/cdn/qr-code/snice-qr-code.js +1 -1
- package/dist/cdn/qr-code/snice-qr-code.min.js +1 -1
- package/dist/cdn/qr-reader/snice-qr-reader.js +1 -1
- package/dist/cdn/qr-reader/snice-qr-reader.min.js +1 -1
- package/dist/cdn/radio/snice-radio.js +1 -1
- package/dist/cdn/radio/snice-radio.min.js +1 -1
- package/dist/cdn/range-slider/snice-range-slider.js +1 -1
- package/dist/cdn/range-slider/snice-range-slider.min.js +1 -1
- package/dist/cdn/rating/snice-rating.js +1 -1
- package/dist/cdn/rating/snice-rating.min.js +1 -1
- package/dist/cdn/receipt/snice-receipt.js +1 -1
- package/dist/cdn/receipt/snice-receipt.min.js +1 -1
- package/dist/cdn/recipe/snice-recipe.js +1 -1
- package/dist/cdn/recipe/snice-recipe.min.js +1 -1
- package/dist/cdn/runtime/README.md +2 -2
- package/dist/cdn/runtime/snice-runtime.esm.js +152 -62
- package/dist/cdn/runtime/snice-runtime.esm.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.esm.min.js +8 -8
- package/dist/cdn/runtime/snice-runtime.esm.min.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.js +152 -61
- package/dist/cdn/runtime/snice-runtime.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.min.js +8 -8
- package/dist/cdn/runtime/snice-runtime.min.js.map +1 -1
- package/dist/cdn/sankey/snice-sankey.js +1 -1
- package/dist/cdn/sankey/snice-sankey.min.js +1 -1
- package/dist/cdn/segmented-control/snice-segmented-control.js +1 -1
- package/dist/cdn/segmented-control/snice-segmented-control.min.js +1 -1
- package/dist/cdn/select/snice-select.js +1 -1
- package/dist/cdn/select/snice-select.min.js +1 -1
- package/dist/cdn/skeleton/snice-skeleton.js +1 -1
- package/dist/cdn/skeleton/snice-skeleton.min.js +1 -1
- package/dist/cdn/slider/snice-slider.js +1 -1
- package/dist/cdn/slider/snice-slider.min.js +1 -1
- package/dist/cdn/sortable/snice-sortable.js +1 -1
- package/dist/cdn/sortable/snice-sortable.min.js +1 -1
- package/dist/cdn/sparkline/snice-sparkline.js +1 -1
- package/dist/cdn/sparkline/snice-sparkline.min.js +1 -1
- package/dist/cdn/spinner/snice-spinner.js +1 -1
- package/dist/cdn/spinner/snice-spinner.min.js +1 -1
- package/dist/cdn/split-button/snice-split-button.js +1 -1
- package/dist/cdn/split-button/snice-split-button.min.js +1 -1
- package/dist/cdn/split-pane/snice-split-pane.js +1 -1
- package/dist/cdn/split-pane/snice-split-pane.min.js +1 -1
- package/dist/cdn/spotlight/snice-spotlight.js +1 -1
- package/dist/cdn/spotlight/snice-spotlight.min.js +1 -1
- package/dist/cdn/spreadsheet/snice-spreadsheet.js +1 -1
- package/dist/cdn/spreadsheet/snice-spreadsheet.min.js +1 -1
- package/dist/cdn/stat-group/snice-stat-group.js +1 -1
- package/dist/cdn/stat-group/snice-stat-group.min.js +1 -1
- package/dist/cdn/step-input/snice-step-input.js +1 -1
- package/dist/cdn/step-input/snice-step-input.min.js +1 -1
- package/dist/cdn/stepper/snice-stepper.js +1 -1
- package/dist/cdn/stepper/snice-stepper.min.js +1 -1
- package/dist/cdn/switch/snice-switch.js +1 -1
- package/dist/cdn/switch/snice-switch.min.js +1 -1
- package/dist/cdn/table/README.md +1 -1
- package/dist/cdn/table/snice-table.js +11 -10
- package/dist/cdn/table/snice-table.js.map +1 -1
- package/dist/cdn/table/snice-table.min.js +73 -73
- package/dist/cdn/table/snice-table.min.js.map +1 -1
- package/dist/cdn/tabs/snice-tabs.js +1 -1
- package/dist/cdn/tabs/snice-tabs.min.js +1 -1
- package/dist/cdn/tag/snice-tag.js +1 -1
- package/dist/cdn/tag/snice-tag.min.js +1 -1
- package/dist/cdn/tag-input/snice-tag-input.js +1 -1
- package/dist/cdn/tag-input/snice-tag-input.min.js +1 -1
- package/dist/cdn/terminal/snice-terminal.js +1 -1
- package/dist/cdn/terminal/snice-terminal.min.js +1 -1
- package/dist/cdn/testimonial/snice-testimonial.js +1 -1
- package/dist/cdn/testimonial/snice-testimonial.min.js +1 -1
- package/dist/cdn/textarea/snice-textarea.js +1 -1
- package/dist/cdn/textarea/snice-textarea.min.js +1 -1
- package/dist/cdn/time-picker/snice-time-picker.js +1 -1
- package/dist/cdn/time-picker/snice-time-picker.min.js +1 -1
- package/dist/cdn/time-range-picker/snice-time-range-picker.js +1 -1
- package/dist/cdn/time-range-picker/snice-time-range-picker.min.js +1 -1
- package/dist/cdn/timeline/snice-timeline.js +1 -1
- package/dist/cdn/timeline/snice-timeline.min.js +1 -1
- package/dist/cdn/timer/snice-timer.js +1 -1
- package/dist/cdn/timer/snice-timer.min.js +1 -1
- package/dist/cdn/toast/snice-toast.js +1 -1
- package/dist/cdn/toast/snice-toast.min.js +1 -1
- package/dist/cdn/tooltip/snice-tooltip.js +1 -1
- package/dist/cdn/tooltip/snice-tooltip.min.js +1 -1
- package/dist/cdn/tree/snice-tree.js +1 -1
- package/dist/cdn/tree/snice-tree.min.js +1 -1
- package/dist/cdn/treemap/snice-treemap.js +1 -1
- package/dist/cdn/treemap/snice-treemap.min.js +1 -1
- package/dist/cdn/user-card/snice-user-card.js +1 -1
- package/dist/cdn/user-card/snice-user-card.min.js +1 -1
- package/dist/cdn/video-player/snice-video-player.js +1 -1
- package/dist/cdn/video-player/snice-video-player.min.js +1 -1
- package/dist/cdn/virtual-scroller/snice-virtual-scroller.js +1 -1
- package/dist/cdn/virtual-scroller/snice-virtual-scroller.min.js +1 -1
- package/dist/cdn/waterfall/snice-waterfall.js +1 -1
- package/dist/cdn/waterfall/snice-waterfall.min.js +1 -1
- package/dist/cdn/weather/snice-weather.js +1 -1
- package/dist/cdn/weather/snice-weather.min.js +1 -1
- package/dist/cdn/work-order/snice-work-order.js +1 -1
- package/dist/cdn/work-order/snice-work-order.min.js +1 -1
- package/dist/components/action-bar/snice-action-bar.d.ts +22 -0
- package/dist/components/action-bar/snice-action-bar.js +182 -0
- package/dist/components/action-bar/snice-action-bar.js.map +1 -0
- package/dist/components/action-bar/snice-action-bar.types.d.ts +17 -0
- package/dist/components/badge/snice-badge.js +1 -1
- package/dist/components/badge/snice-badge.js.map +1 -1
- package/dist/components/binpack/snice-binpack.d.ts +82 -0
- package/dist/components/binpack/snice-binpack.js +970 -0
- package/dist/components/binpack/snice-binpack.js.map +1 -0
- package/dist/components/binpack/snice-binpack.types.d.ts +52 -0
- package/dist/components/button/snice-button.d.ts +2 -2
- package/dist/components/button/snice-button.js +11 -10
- package/dist/components/button/snice-button.js.map +1 -1
- package/dist/create-request-handler.d.ts +42 -0
- package/dist/index.cjs +149 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +149 -59
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +149 -58
- package/dist/index.iife.js.map +1 -1
- package/dist/parts.d.ts +9 -7
- package/dist/react/useRequestHandler.d.ts +56 -0
- package/dist/react/useRequestHandler.js +103 -0
- package/dist/react/useRequestHandler.js.map +1 -0
- 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/DEVELOPMENT.md +1 -1
- package/docs/ai/components/accordion.md +46 -80
- package/docs/ai/components/action-bar.md +75 -0
- package/docs/ai/components/activity-feed.md +7 -7
- package/docs/ai/components/alert.md +26 -44
- package/docs/ai/components/app-tiles.md +34 -39
- package/docs/ai/components/approval-flow.md +1 -1
- package/docs/ai/components/audio-recorder.md +35 -67
- package/docs/ai/components/availability.md +13 -34
- package/docs/ai/components/avatar-group.md +26 -13
- package/docs/ai/components/avatar.md +52 -36
- package/docs/ai/components/badge.md +21 -32
- package/docs/ai/components/banner.md +21 -43
- package/docs/ai/components/binpack.md +89 -0
- package/docs/ai/components/book.md +25 -23
- package/docs/ai/components/booking.md +31 -36
- package/docs/ai/components/breadcrumbs.md +36 -11
- package/docs/ai/components/button.md +33 -44
- package/docs/ai/components/calendar.md +37 -70
- package/docs/ai/components/camera-annotate.md +31 -64
- package/docs/ai/components/camera.md +38 -120
- package/docs/ai/components/candlestick.md +32 -52
- package/docs/ai/components/card.md +20 -30
- package/docs/ai/components/carousel.md +32 -32
- package/docs/ai/components/cart.md +24 -29
- package/docs/ai/components/chart.md +29 -114
- package/docs/ai/components/chat.md +38 -75
- package/docs/ai/components/checkbox.md +22 -41
- package/docs/ai/components/chip.md +18 -54
- package/docs/ai/components/code-block.md +57 -178
- package/docs/ai/components/color-display.md +12 -32
- package/docs/ai/components/color-picker.md +17 -39
- package/docs/ai/components/command-palette.md +49 -71
- package/docs/ai/components/comments.md +55 -36
- package/docs/ai/components/countdown.md +28 -30
- package/docs/ai/components/cropper.md +33 -33
- package/docs/ai/components/data-card.md +20 -14
- package/docs/ai/components/date-picker.md +40 -47
- package/docs/ai/components/date-range-picker.md +31 -15
- package/docs/ai/components/date-time-picker.md +23 -46
- package/docs/ai/components/diff.md +30 -31
- package/docs/ai/components/divider.md +17 -47
- package/docs/ai/components/doc.md +43 -68
- package/docs/ai/components/draw.md +35 -87
- package/docs/ai/components/drawer.md +48 -77
- package/docs/ai/components/empty-state.md +10 -44
- package/docs/ai/components/estimate.md +33 -58
- package/docs/ai/components/file-gallery.md +48 -100
- package/docs/ai/components/file-upload.md +17 -53
- package/docs/ai/components/flip-card.md +31 -23
- package/docs/ai/components/flow.md +37 -65
- package/docs/ai/components/form-builder.md +35 -75
- package/docs/ai/components/form-layout.md +10 -20
- package/docs/ai/components/funnel.md +33 -48
- package/docs/ai/components/gantt.md +27 -23
- package/docs/ai/components/gauge.md +16 -17
- package/docs/ai/components/heatmap.md +21 -21
- package/docs/ai/components/image.md +7 -13
- package/docs/ai/components/input.md +38 -70
- package/docs/ai/components/invoice.md +35 -36
- package/docs/ai/components/kanban.md +32 -61
- package/docs/ai/components/key-value.md +32 -16
- package/docs/ai/components/kpi.md +38 -73
- package/docs/ai/components/layout.md +29 -23
- package/docs/ai/components/leaderboard.md +28 -37
- package/docs/ai/components/link-preview.md +12 -18
- package/docs/ai/components/link.md +10 -7
- package/docs/ai/components/list.md +21 -5
- package/docs/ai/components/location.md +21 -25
- package/docs/ai/components/login.md +14 -9
- package/docs/ai/components/map.md +27 -33
- package/docs/ai/components/markdown.md +20 -24
- package/docs/ai/components/masonry.md +10 -14
- package/docs/ai/components/mentions.md +26 -12
- package/docs/ai/components/menu.md +54 -52
- package/docs/ai/components/message-strip.md +20 -20
- package/docs/ai/components/metric-table.md +14 -21
- package/docs/ai/components/modal.md +27 -18
- package/docs/ai/components/music-player.md +49 -41
- package/docs/ai/components/nav.md +34 -31
- package/docs/ai/components/network-graph.md +27 -42
- package/docs/ai/components/notification-center.md +31 -33
- package/docs/ai/components/order-tracker.md +36 -27
- package/docs/ai/components/org-chart.md +36 -31
- package/docs/ai/components/pagination.md +34 -26
- package/docs/ai/components/paint.md +53 -91
- package/docs/ai/components/pdf-viewer.md +35 -36
- package/docs/ai/components/permission-matrix.md +26 -31
- package/docs/ai/components/podcast-player.md +64 -70
- package/docs/ai/components/pricing-table.md +37 -48
- package/docs/ai/components/product-card.md +58 -41
- package/docs/ai/components/progress-ring.md +20 -24
- package/docs/ai/components/progress.md +28 -45
- package/docs/ai/components/qr-code.md +25 -27
- package/docs/ai/components/qr-reader.md +20 -23
- package/docs/ai/components/radio.md +17 -15
- package/docs/ai/components/range-slider.md +22 -11
- package/docs/ai/components/rating.md +29 -33
- package/docs/ai/components/receipt.md +50 -127
- package/docs/ai/components/recipe.md +44 -42
- package/docs/ai/components/sankey.md +21 -30
- package/docs/ai/components/scheduler.md +29 -41
- package/docs/ai/components/segmented-control.md +11 -15
- package/docs/ai/components/select.md +58 -102
- package/docs/ai/components/skeleton.md +16 -30
- package/docs/ai/components/slider.md +26 -20
- package/docs/ai/components/sortable.md +25 -27
- package/docs/ai/components/sparkline.md +21 -17
- package/docs/ai/components/spinner.md +9 -5
- package/docs/ai/components/split-button.md +10 -13
- package/docs/ai/components/split-pane.md +19 -14
- package/docs/ai/components/spotlight.md +31 -26
- package/docs/ai/components/spreadsheet.md +51 -97
- package/docs/ai/components/stat-group.md +9 -19
- package/docs/ai/components/step-input.md +17 -15
- package/docs/ai/components/stepper.md +14 -15
- package/docs/ai/components/switch.md +15 -9
- package/docs/ai/components/table.md +24 -84
- package/docs/ai/components/tabs.md +18 -10
- package/docs/ai/components/tag-input.md +18 -29
- package/docs/ai/components/tag.md +10 -22
- package/docs/ai/components/terminal.md +9 -9
- package/docs/ai/components/testimonial.md +9 -19
- package/docs/ai/components/textarea.md +15 -16
- package/docs/ai/components/theme.md +3 -3
- package/docs/ai/components/time-picker.md +30 -49
- package/docs/ai/components/time-range-picker.md +16 -15
- package/docs/ai/components/timeline.md +5 -4
- package/docs/ai/components/timer.md +8 -8
- package/docs/ai/components/toast.md +24 -18
- package/docs/ai/components/tooltip.md +11 -22
- package/docs/ai/components/tree.md +9 -9
- package/docs/ai/components/treemap.md +14 -13
- package/docs/ai/components/user-card.md +21 -27
- package/docs/ai/components/video-player.md +35 -52
- package/docs/ai/components/virtual-scroller.md +1 -1
- package/docs/ai/components/waterfall.md +17 -16
- package/docs/ai/components/weather.md +19 -34
- package/docs/ai/components/work-order.md +58 -134
- package/docs/ai/patterns.md +63 -0
- package/docs/components/accordion.md +72 -151
- package/docs/components/action-bar.md +185 -0
- package/docs/components/activity-feed.md +9 -14
- package/docs/components/alert.md +17 -109
- package/docs/components/app-tiles.md +58 -43
- package/docs/components/approval-flow.md +8 -14
- package/docs/components/audio-recorder.md +45 -51
- package/docs/components/availability.md +30 -45
- package/docs/components/avatar-group.md +34 -14
- package/docs/components/avatar.md +20 -55
- package/docs/components/badge.md +53 -470
- package/docs/components/banner.md +44 -30
- package/docs/components/binpack.md +208 -0
- package/docs/components/book.md +78 -57
- package/docs/components/booking.md +35 -87
- package/docs/components/breadcrumbs.md +74 -448
- package/docs/components/button.md +72 -603
- package/docs/components/calendar.md +77 -261
- package/docs/components/camera-annotate.md +44 -96
- package/docs/components/camera.md +94 -333
- package/docs/components/candlestick.md +79 -116
- package/docs/components/card.md +51 -689
- package/docs/components/carousel.md +29 -76
- package/docs/components/cart.md +44 -136
- package/docs/components/chart.md +95 -438
- package/docs/components/chat.md +175 -439
- package/docs/components/checkbox.md +52 -609
- package/docs/components/chip.md +45 -574
- package/docs/components/code-block.md +157 -421
- package/docs/components/color-display.md +45 -54
- package/docs/components/color-picker.md +103 -36
- package/docs/components/command-palette.md +98 -92
- package/docs/components/comments.md +16 -10
- package/docs/components/countdown.md +15 -20
- package/docs/components/cropper.md +14 -16
- package/docs/components/data-card.md +16 -15
- package/docs/components/date-picker.md +45 -25
- package/docs/components/date-range-picker.md +140 -87
- package/docs/components/date-time-picker.md +25 -28
- package/docs/components/diff.md +22 -17
- package/docs/components/divider.md +18 -20
- package/docs/components/doc.md +105 -197
- package/docs/components/draw.md +117 -223
- package/docs/components/drawer.md +113 -478
- package/docs/components/empty-state.md +13 -29
- package/docs/components/estimate.md +58 -118
- package/docs/components/file-gallery.md +123 -495
- package/docs/components/file-upload.md +36 -123
- package/docs/components/flip-card.md +30 -34
- package/docs/components/flow.md +74 -89
- package/docs/components/form-builder.md +59 -86
- package/docs/components/form-layout.md +21 -31
- package/docs/components/funnel.md +21 -22
- package/docs/components/gantt.md +5 -5
- package/docs/components/gauge.md +5 -23
- package/docs/components/heatmap.md +13 -55
- package/docs/components/image.md +28 -32
- package/docs/components/input.md +25 -14
- package/docs/components/invoice.md +34 -33
- package/docs/components/kanban.md +99 -394
- package/docs/components/key-value.md +22 -12
- package/docs/components/kpi.md +41 -112
- package/docs/components/layout.md +7 -13
- package/docs/components/leaderboard.md +52 -76
- package/docs/components/link-preview.md +20 -16
- package/docs/components/link.md +22 -19
- package/docs/components/list.md +44 -26
- package/docs/components/location.md +9 -13
- package/docs/components/login.md +42 -36
- package/docs/components/map.md +24 -46
- package/docs/components/markdown.md +14 -25
- package/docs/components/masonry.md +15 -13
- package/docs/components/mentions.md +36 -25
- package/docs/components/menu.md +39 -46
- package/docs/components/message-strip.md +15 -51
- package/docs/components/metric-table.md +50 -72
- package/docs/components/modal.md +32 -43
- package/docs/components/music-player.md +41 -49
- package/docs/components/nav.md +23 -13
- package/docs/components/network-graph.md +14 -13
- package/docs/components/notification-center.md +68 -172
- package/docs/components/order-tracker.md +72 -117
- package/docs/components/org-chart.md +58 -207
- package/docs/components/pagination.md +67 -89
- package/docs/components/paint.md +86 -172
- package/docs/components/pdf-viewer.md +46 -151
- package/docs/components/permission-matrix.md +61 -112
- package/docs/components/podcast-player.md +41 -119
- package/docs/components/pricing-table.md +104 -147
- package/docs/components/product-card.md +94 -197
- package/docs/components/progress-ring.md +29 -32
- package/docs/components/progress.md +30 -61
- package/docs/components/qr-code.md +53 -61
- package/docs/components/qr-reader.md +53 -42
- package/docs/components/radio.md +42 -40
- package/docs/components/range-slider.md +41 -30
- package/docs/components/rating.md +50 -84
- package/docs/components/receipt.md +91 -129
- package/docs/components/recipe.md +107 -216
- package/docs/components/sankey.md +47 -83
- package/docs/components/scheduler.md +81 -184
- package/docs/components/segmented-control.md +48 -40
- package/docs/components/select.md +107 -129
- package/docs/components/skeleton.md +33 -47
- package/docs/components/slider.md +49 -53
- package/docs/components/sortable.md +43 -186
- package/docs/components/sparkline.md +26 -25
- package/docs/components/spinner.md +32 -37
- package/docs/components/split-button.md +43 -23
- package/docs/components/split-pane.md +41 -58
- package/docs/components/spotlight.md +53 -145
- package/docs/components/spreadsheet.md +84 -307
- package/docs/components/stat-group.md +27 -61
- package/docs/components/step-input.md +44 -41
- package/docs/components/stepper.md +55 -89
- package/docs/components/switch.md +39 -39
- package/docs/components/table.md +27 -32
- package/docs/components/tabs.md +36 -27
- package/docs/components/tag-input.md +50 -176
- package/docs/components/tag.md +12 -50
- package/docs/components/terminal.md +32 -37
- package/docs/components/testimonial.md +24 -81
- package/docs/components/textarea.md +9 -14
- package/docs/components/theme.md +10 -23
- package/docs/components/time-picker.md +48 -72
- package/docs/components/time-range-picker.md +22 -41
- package/docs/components/timeline.md +7 -14
- package/docs/components/timer.md +16 -32
- package/docs/components/toast.md +19 -45
- package/docs/components/tooltip.md +13 -115
- package/docs/components/tree.md +2 -19
- package/docs/components/treemap.md +19 -43
- package/docs/components/user-card.md +13 -22
- package/docs/components/video-player.md +53 -227
- package/docs/components/virtual-scroller.md +11 -44
- package/docs/components/waterfall.md +58 -137
- package/docs/components/weather.md +94 -153
- package/docs/components/work-order.md +56 -143
- package/docs/plans/2026-03-09-action-bar-design.md +104 -0
- package/docs/plans/2026-03-09-action-bar-plan.md +676 -0
- package/docs/plans/2026-03-10-react-integration-design.md +166 -0
- package/docs/request-response.md +77 -0
- package/package.json +20 -10
|
@@ -1,142 +1,74 @@
|
|
|
1
|
-
<!-- AI: For
|
|
1
|
+
<!-- AI: For the AI-optimized version of this doc, see docs/ai/components/camera.md -->
|
|
2
2
|
|
|
3
3
|
# Camera Component
|
|
4
4
|
|
|
5
|
-
Live camera feed with built-in mobile-style controls and
|
|
5
|
+
Live camera feed with built-in mobile-style controls, flexible positioning, aspect ratio presets, and fullscreen support.
|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
- [Properties](#properties)
|
|
9
|
+
- [Methods](#methods)
|
|
10
|
+
- [Events](#events)
|
|
11
|
+
- [Slots](#slots)
|
|
12
|
+
- [CSS Custom Properties](#css-custom-properties)
|
|
13
|
+
- [CSS Parts](#css-parts)
|
|
14
|
+
- [Basic Usage](#basic-usage)
|
|
15
|
+
- [Examples](#examples)
|
|
16
|
+
- [Accessibility](#accessibility)
|
|
6
17
|
|
|
7
18
|
## Properties
|
|
8
19
|
|
|
9
20
|
| Property | Type | Default | Description |
|
|
10
21
|
|----------|------|---------|-------------|
|
|
11
|
-
| `autoStart` | `boolean` | `true` | Auto-start camera on load |
|
|
12
|
-
| `facingMode` | `'user' \| 'environment'` | `'user'` | Front or back camera |
|
|
22
|
+
| `autoStart` (attr: `auto-start`) | `boolean` | `true` | Auto-start camera on load |
|
|
23
|
+
| `facingMode` (attr: `facing-mode`) | `'user' \| 'environment'` | `'user'` | Front or back camera |
|
|
13
24
|
| `mirror` | `boolean` | `true` | Mirror video for front camera |
|
|
14
|
-
| `controlsPosition` | `ControlsPosition` | `'auto'` | Control button positioning |
|
|
15
|
-
| `showControls` | `boolean` | `true` | Show built-in controls |
|
|
25
|
+
| `controlsPosition` (attr: `controls-position`) | `ControlsPosition` | `'auto'` | Control button positioning |
|
|
26
|
+
| `showControls` (attr: `show-controls`) | `boolean` | `true` | Show built-in controls |
|
|
16
27
|
| `width` | `number` | `1280` | Video width (resolution) |
|
|
17
28
|
| `height` | `number` | `720` | Video height (resolution) |
|
|
18
|
-
| `aspectRatio` | `string` | `'auto'` | Aspect ratio: `'auto'
|
|
19
|
-
| `objectFit` | `'contain' \| 'cover'` | `'cover'` | How video fits container
|
|
29
|
+
| `aspectRatio` (attr: `aspect-ratio`) | `string` | `'auto'` | Aspect ratio: `'auto'`, `'16:9'`, `'9:16'`, `'4:3'`, `'1:1'`, `'21:9'` |
|
|
30
|
+
| `objectFit` (attr: `object-fit`) | `'contain' \| 'cover'` | `'cover'` | How video fits container |
|
|
20
31
|
|
|
21
32
|
## Methods
|
|
22
33
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
### `switchCamera(): Promise<void>`
|
|
46
|
-
Toggle between front/back camera.
|
|
47
|
-
|
|
48
|
-
```javascript
|
|
49
|
-
await camera.switchCamera();
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### `isActive(): boolean`
|
|
53
|
-
Check if camera is running.
|
|
54
|
-
|
|
55
|
-
```javascript
|
|
56
|
-
if (camera.isActive()) {
|
|
57
|
-
// Camera is on
|
|
34
|
+
| Method | Arguments | Returns | Description |
|
|
35
|
+
|--------|-----------|---------|-------------|
|
|
36
|
+
| `start()` | -- | `Promise<void>` | Start camera feed |
|
|
37
|
+
| `stop()` | -- | `void` | Stop camera and release resources |
|
|
38
|
+
| `capture()` | -- | `Promise<CapturedImage>` | Capture current frame as image |
|
|
39
|
+
| `switchCamera()` | -- | `Promise<void>` | Toggle between front/back camera |
|
|
40
|
+
| `isActive()` | -- | `boolean` | Check if camera is running |
|
|
41
|
+
| `getStream()` | -- | `MediaStream \| null` | Get current media stream |
|
|
42
|
+
| `enterFullscreen()` | -- | `void` | Enter fullscreen mode |
|
|
43
|
+
| `exitFullscreen()` | -- | `void` | Exit fullscreen mode |
|
|
44
|
+
| `toggleFullscreen()` | -- | `void` | Toggle fullscreen mode |
|
|
45
|
+
|
|
46
|
+
### CapturedImage
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
interface CapturedImage {
|
|
50
|
+
dataURL: string;
|
|
51
|
+
blob: Blob;
|
|
52
|
+
width: number;
|
|
53
|
+
height: number;
|
|
54
|
+
timestamp: number;
|
|
58
55
|
}
|
|
59
56
|
```
|
|
60
57
|
|
|
61
|
-
### `getStream(): MediaStream | null`
|
|
62
|
-
Get current media stream.
|
|
63
|
-
|
|
64
|
-
```javascript
|
|
65
|
-
const stream = camera.getStream();
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### `enterFullscreen(): void`
|
|
69
|
-
Enter fullscreen mode.
|
|
70
|
-
|
|
71
|
-
```javascript
|
|
72
|
-
camera.enterFullscreen();
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### `exitFullscreen(): void`
|
|
76
|
-
Exit fullscreen mode.
|
|
77
|
-
|
|
78
|
-
```javascript
|
|
79
|
-
camera.exitFullscreen();
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### `toggleFullscreen(): void`
|
|
83
|
-
Toggle fullscreen mode.
|
|
84
|
-
|
|
85
|
-
```javascript
|
|
86
|
-
camera.toggleFullscreen();
|
|
87
|
-
```
|
|
88
|
-
|
|
89
58
|
## Events
|
|
90
59
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
camera
|
|
96
|
-
|
|
97
|
-
});
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### `camera-stop`
|
|
101
|
-
Camera stopped.
|
|
102
|
-
|
|
103
|
-
```javascript
|
|
104
|
-
camera.addEventListener('camera-stop', () => {
|
|
105
|
-
console.log('Camera off');
|
|
106
|
-
});
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### `camera-capture`
|
|
110
|
-
Photo captured.
|
|
111
|
-
|
|
112
|
-
```javascript
|
|
113
|
-
camera.addEventListener('camera-capture', (e) => {
|
|
114
|
-
const image = e.detail.image;
|
|
115
|
-
console.log(image.dataURL);
|
|
116
|
-
});
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
### `camera-error`
|
|
120
|
-
Camera error occurred.
|
|
121
|
-
|
|
122
|
-
```javascript
|
|
123
|
-
camera.addEventListener('camera-error', (e) => {
|
|
124
|
-
console.error(e.detail.error);
|
|
125
|
-
});
|
|
126
|
-
```
|
|
60
|
+
| Event | Detail | Description |
|
|
61
|
+
|-------|--------|-------------|
|
|
62
|
+
| `camera-start` | `{ stream: MediaStream }` | Camera started successfully |
|
|
63
|
+
| `camera-stop` | -- | Camera stopped |
|
|
64
|
+
| `camera-capture` | `{ image: CapturedImage }` | Photo captured |
|
|
65
|
+
| `camera-error` | `{ error: Error }` | Camera error occurred |
|
|
127
66
|
|
|
128
67
|
## Slots
|
|
129
68
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
```html
|
|
134
|
-
<snice-camera>
|
|
135
|
-
<div slot="controls" style="position: absolute; top: 10px; left: 10px; color: white; background: rgba(0,0,0,0.5); padding: 8px 12px; border-radius: 4px;">
|
|
136
|
-
LIVE
|
|
137
|
-
</div>
|
|
138
|
-
</snice-camera>
|
|
139
|
-
```
|
|
69
|
+
| Name | Description |
|
|
70
|
+
|------|-------------|
|
|
71
|
+
| `controls` | Custom controls overlay area. Full viewport, positioned absolutely. |
|
|
140
72
|
|
|
141
73
|
## CSS Custom Properties
|
|
142
74
|
|
|
@@ -155,138 +87,101 @@ Custom controls overlay area. Full viewport, positioned absolutely.
|
|
|
155
87
|
|
|
156
88
|
## CSS Parts
|
|
157
89
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
|
161
|
-
|
|
162
|
-
| `base` | `<div>` | Outer camera container holding the video feed |
|
|
163
|
-
| `controls` | `<div>` | Built-in control buttons area (capture and switch camera) |
|
|
164
|
-
|
|
165
|
-
```css
|
|
166
|
-
snice-camera::part(base) {
|
|
167
|
-
border-radius: 12px;
|
|
168
|
-
overflow: hidden;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
snice-camera::part(controls) {
|
|
172
|
-
padding: 1rem;
|
|
173
|
-
}
|
|
174
|
-
```
|
|
90
|
+
| Part | Description |
|
|
91
|
+
|------|-------------|
|
|
92
|
+
| `base` | Outer camera container holding the video feed |
|
|
93
|
+
| `controls` | Built-in control buttons area (capture and switch camera) |
|
|
175
94
|
|
|
176
95
|
## Basic Usage
|
|
177
96
|
|
|
178
97
|
```html
|
|
179
|
-
<snice-camera
|
|
180
|
-
|
|
181
|
-
<script>
|
|
182
|
-
const camera = document.getElementById('camera');
|
|
183
|
-
|
|
184
|
-
// Auto-starts by default, but you can manually start
|
|
185
|
-
await camera.start();
|
|
186
|
-
|
|
187
|
-
// Capture photo
|
|
188
|
-
const image = await camera.capture();
|
|
189
|
-
console.log(image.dataURL);
|
|
190
|
-
</script>
|
|
98
|
+
<snice-camera></snice-camera>
|
|
191
99
|
```
|
|
192
100
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
### Zero Config (Recommended)
|
|
101
|
+
```typescript
|
|
102
|
+
import 'snice/components/camera/snice-camera';
|
|
196
103
|
|
|
197
|
-
|
|
198
|
-
|
|
104
|
+
const image = await camera.capture();
|
|
105
|
+
console.log(image.dataURL);
|
|
199
106
|
```
|
|
200
107
|
|
|
201
|
-
|
|
108
|
+
## Examples
|
|
202
109
|
|
|
203
110
|
### Back Camera
|
|
204
111
|
|
|
112
|
+
Use `facing-mode="environment"` to activate the rear camera on mobile devices.
|
|
113
|
+
|
|
205
114
|
```html
|
|
206
115
|
<snice-camera facing-mode="environment"></snice-camera>
|
|
207
116
|
```
|
|
208
117
|
|
|
209
118
|
### Control Positioning
|
|
210
119
|
|
|
120
|
+
Use `controls-position` to place the built-in controls at different locations.
|
|
121
|
+
|
|
211
122
|
```html
|
|
212
|
-
<!-- Bottom-left corner -->
|
|
213
123
|
<snice-camera controls-position="bottom-left"></snice-camera>
|
|
214
|
-
|
|
215
|
-
<!-- Right edge (centered) -->
|
|
216
124
|
<snice-camera controls-position="right"></snice-camera>
|
|
217
|
-
|
|
218
|
-
<!-- Top-right corner -->
|
|
219
125
|
<snice-camera controls-position="top-right"></snice-camera>
|
|
220
126
|
```
|
|
221
127
|
|
|
222
|
-
###
|
|
128
|
+
### Aspect Ratios
|
|
129
|
+
|
|
130
|
+
Use `aspect-ratio` to constrain the camera display shape.
|
|
223
131
|
|
|
224
132
|
```html
|
|
225
|
-
<snice-camera
|
|
133
|
+
<snice-camera aspect-ratio="16:9"></snice-camera>
|
|
134
|
+
<snice-camera aspect-ratio="1:1" width="1080" height="1080"></snice-camera>
|
|
135
|
+
<snice-camera aspect-ratio="9:16" object-fit="cover" width="720" height="1280"></snice-camera>
|
|
226
136
|
```
|
|
227
137
|
|
|
228
138
|
### Custom Resolution
|
|
229
139
|
|
|
140
|
+
Use `width` and `height` to request a specific camera resolution.
|
|
141
|
+
|
|
230
142
|
```html
|
|
231
|
-
<!-- 4K -->
|
|
232
143
|
<snice-camera width="3840" height="2160"></snice-camera>
|
|
233
|
-
|
|
234
|
-
<!-- Full HD -->
|
|
235
144
|
<snice-camera width="1920" height="1080"></snice-camera>
|
|
236
|
-
|
|
237
|
-
<!-- VGA -->
|
|
238
|
-
<snice-camera width="640" height="480"></snice-camera>
|
|
239
145
|
```
|
|
240
146
|
|
|
241
|
-
###
|
|
242
|
-
|
|
243
|
-
```html
|
|
244
|
-
<!-- 16:9 widescreen -->
|
|
245
|
-
<snice-camera aspect-ratio="16:9"></snice-camera>
|
|
246
|
-
|
|
247
|
-
<!-- 9:16 portrait -->
|
|
248
|
-
<snice-camera aspect-ratio="9:16" width="720" height="1280"></snice-camera>
|
|
249
|
-
|
|
250
|
-
<!-- 4:3 classic -->
|
|
251
|
-
<snice-camera aspect-ratio="4:3"></snice-camera>
|
|
147
|
+
### Fullscreen
|
|
252
148
|
|
|
253
|
-
|
|
254
|
-
<snice-camera aspect-ratio="1:1" width="1080" height="1080"></snice-camera>
|
|
149
|
+
Use the fullscreen methods for immersive camera views.
|
|
255
150
|
|
|
256
|
-
|
|
257
|
-
<snice-camera
|
|
151
|
+
```html
|
|
152
|
+
<snice-camera id="cam"></snice-camera>
|
|
153
|
+
<button onclick="document.getElementById('cam').toggleFullscreen()">Fullscreen</button>
|
|
258
154
|
```
|
|
259
155
|
|
|
260
|
-
###
|
|
156
|
+
### Custom Overlay Controls
|
|
157
|
+
|
|
158
|
+
Use the `controls` slot to add custom overlays alongside or instead of the built-in controls.
|
|
261
159
|
|
|
262
160
|
```html
|
|
263
|
-
|
|
264
|
-
<
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
<snice-camera object-fit="cover"></snice-camera>
|
|
268
|
-
|
|
269
|
-
<!-- Portrait with cover for full-screen mobile -->
|
|
270
|
-
<snice-camera
|
|
271
|
-
aspect-ratio="9:16"
|
|
272
|
-
object-fit="cover"
|
|
273
|
-
width="720"
|
|
274
|
-
height="1280"
|
|
275
|
-
style="height: 100vh;">
|
|
161
|
+
<snice-camera>
|
|
162
|
+
<div slot="controls" style="position: absolute; top: 10px; left: 10px; color: white; background: rgba(0,0,0,0.5); padding: 8px 12px; border-radius: 4px;">
|
|
163
|
+
LIVE
|
|
164
|
+
</div>
|
|
276
165
|
</snice-camera>
|
|
277
166
|
```
|
|
278
167
|
|
|
279
|
-
###
|
|
168
|
+
### Fully Custom Controls
|
|
169
|
+
|
|
170
|
+
Set `show-controls="false"` and use the `controls` slot for complete control customization.
|
|
280
171
|
|
|
281
172
|
```html
|
|
282
|
-
<snice-camera id="
|
|
283
|
-
<
|
|
284
|
-
|
|
285
|
-
</button>
|
|
173
|
+
<snice-camera id="camera" show-controls="false">
|
|
174
|
+
<div slot="controls" style="position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px;">
|
|
175
|
+
<button onclick="document.getElementById('camera').capture()">Take Photo</button>
|
|
176
|
+
<button onclick="document.getElementById('camera').switchCamera()">Flip</button>
|
|
177
|
+
</div>
|
|
178
|
+
</snice-camera>
|
|
286
179
|
```
|
|
287
180
|
|
|
288
181
|
### Save Captured Image
|
|
289
182
|
|
|
183
|
+
Use the `capture()` method to get images for download or upload.
|
|
184
|
+
|
|
290
185
|
```javascript
|
|
291
186
|
const image = await camera.capture();
|
|
292
187
|
|
|
@@ -302,142 +197,8 @@ formData.append('photo', image.blob, 'photo.jpg');
|
|
|
302
197
|
await fetch('/upload', { method: 'POST', body: formData });
|
|
303
198
|
```
|
|
304
199
|
|
|
305
|
-
### Photo Gallery
|
|
306
|
-
|
|
307
|
-
```javascript
|
|
308
|
-
const gallery = [];
|
|
309
|
-
|
|
310
|
-
camera.addEventListener('camera-capture', (e) => {
|
|
311
|
-
gallery.push(e.detail.image);
|
|
312
|
-
displayGallery();
|
|
313
|
-
});
|
|
314
|
-
|
|
315
|
-
function displayGallery() {
|
|
316
|
-
const container = document.getElementById('gallery');
|
|
317
|
-
container.innerHTML = '';
|
|
318
|
-
|
|
319
|
-
gallery.forEach(image => {
|
|
320
|
-
const img = document.createElement('img');
|
|
321
|
-
img.src = image.dataURL;
|
|
322
|
-
img.width = 200;
|
|
323
|
-
container.appendChild(img);
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
### Custom Overlay Controls (With Built-in Controls)
|
|
329
|
-
|
|
330
|
-
```html
|
|
331
|
-
<snice-camera>
|
|
332
|
-
<div slot="controls" class="my-controls">
|
|
333
|
-
<div class="recording-indicator">● REC</div>
|
|
334
|
-
<div class="timer">00:00</div>
|
|
335
|
-
</div>
|
|
336
|
-
</snice-camera>
|
|
337
|
-
|
|
338
|
-
<style>
|
|
339
|
-
.my-controls {
|
|
340
|
-
position: absolute;
|
|
341
|
-
top: 20px;
|
|
342
|
-
left: 20px;
|
|
343
|
-
right: 20px;
|
|
344
|
-
display: flex;
|
|
345
|
-
justify-content: space-between;
|
|
346
|
-
color: white;
|
|
347
|
-
font-size: 14px;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
.recording-indicator {
|
|
351
|
-
color: red;
|
|
352
|
-
animation: blink 1s infinite;
|
|
353
|
-
}
|
|
354
|
-
</style>
|
|
355
|
-
```
|
|
356
|
-
|
|
357
|
-
### Fully Custom Controls (No Built-in Controls)
|
|
358
|
-
|
|
359
|
-
```html
|
|
360
|
-
<snice-camera id="camera" show-controls="false">
|
|
361
|
-
<div slot="controls" class="custom-controls">
|
|
362
|
-
<button class="custom-capture" onclick="document.getElementById('camera').capture()">
|
|
363
|
-
📷 Take Photo
|
|
364
|
-
</button>
|
|
365
|
-
<button class="custom-switch" onclick="document.getElementById('camera').switchCamera()">
|
|
366
|
-
🔄 Flip
|
|
367
|
-
</button>
|
|
368
|
-
</div>
|
|
369
|
-
</snice-camera>
|
|
370
|
-
|
|
371
|
-
<style>
|
|
372
|
-
.custom-controls {
|
|
373
|
-
position: absolute;
|
|
374
|
-
bottom: 20px;
|
|
375
|
-
left: 50%;
|
|
376
|
-
transform: translateX(-50%);
|
|
377
|
-
display: flex;
|
|
378
|
-
gap: 10px;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
.custom-capture, .custom-switch {
|
|
382
|
-
padding: 12px 24px;
|
|
383
|
-
background: rgba(255, 255, 255, 0.9);
|
|
384
|
-
border: none;
|
|
385
|
-
border-radius: 8px;
|
|
386
|
-
font-size: 16px;
|
|
387
|
-
cursor: pointer;
|
|
388
|
-
}
|
|
389
|
-
</style>
|
|
390
|
-
```
|
|
391
|
-
|
|
392
|
-
## Control Positions
|
|
393
|
-
|
|
394
|
-
| Position | Description |
|
|
395
|
-
|----------|-------------|
|
|
396
|
-
| `'auto'` | Auto-detect: `bottom-right` (portrait), `right` (landscape) |
|
|
397
|
-
| **Corners** | |
|
|
398
|
-
| `'bottom-left'` | Bottom-left corner |
|
|
399
|
-
| `'bottom-right'` | Bottom-right corner |
|
|
400
|
-
| `'top-left'` | Top-left corner |
|
|
401
|
-
| `'top-right'` | Top-right corner |
|
|
402
|
-
| **Edges** | |
|
|
403
|
-
| `'bottom'` | Bottom edge (centered) |
|
|
404
|
-
| `'right'` | Right edge (centered) |
|
|
405
|
-
| `'left'` | Left edge (centered) |
|
|
406
|
-
| `'top'` | Top edge (centered) |
|
|
407
|
-
|
|
408
|
-
## Built-in Controls
|
|
409
|
-
|
|
410
|
-
The camera includes built-in mobile-style controls:
|
|
411
|
-
|
|
412
|
-
- **Capture button** (56px) - White circle with camera icon, positioned for thumb access
|
|
413
|
-
- **Switch camera button** (40px) - Auto-hides if only one camera available
|
|
414
|
-
|
|
415
|
-
Controls use Material Design-style icons and are positioned based on `controlsPosition`.
|
|
416
|
-
|
|
417
|
-
## Technical Details
|
|
418
|
-
|
|
419
|
-
- **Resolution**: Default 720p HD (1280x720) - configurable via `width`/`height`
|
|
420
|
-
- **Format**: JPEG at 0.92 quality
|
|
421
|
-
- **Mirror**: Automatically mirrors front camera video (can be disabled)
|
|
422
|
-
- **Orientation**: Auto-detects portrait/landscape for control positioning
|
|
423
|
-
- **Aspect Ratios**: Supports 16:9, 4:3, 1:1, 21:9 presets
|
|
424
|
-
- **Fullscreen**: Native browser fullscreen API support
|
|
425
|
-
|
|
426
|
-
## Security
|
|
427
|
-
|
|
428
|
-
- Requires HTTPS (or localhost for development)
|
|
429
|
-
- Requires user permission
|
|
430
|
-
- Permission prompts are browser-controlled
|
|
431
|
-
- Stream automatically stops on page unload
|
|
432
|
-
|
|
433
200
|
## Accessibility
|
|
434
201
|
|
|
435
202
|
- Keyboard navigation for controls
|
|
436
203
|
- Visual feedback for capture
|
|
437
204
|
- Error messaging
|
|
438
|
-
|
|
439
|
-
## Browser Support
|
|
440
|
-
|
|
441
|
-
- Modern browsers with getUserMedia API
|
|
442
|
-
- Requires camera hardware
|
|
443
|
-
- May not work on some mobile browsers
|