@semantic-components/ui-lab 0.62.0 → 0.63.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/eslint.config.mjs +39 -0
- package/ng-package.json +7 -0
- package/package.json +3 -17
- package/project.json +28 -0
- package/src/index.ts +2 -0
- package/src/lib/components/accordion/README.md +269 -0
- package/src/lib/components/accordion/TODO.md +58 -0
- package/src/lib/components/accordion/accordion-content.ts +31 -0
- package/src/lib/components/accordion/accordion-header.ts +15 -0
- package/src/lib/components/accordion/accordion-item.ts +17 -0
- package/src/lib/components/accordion/accordion-panel.ts +42 -0
- package/src/lib/components/accordion/accordion-trigger-icon.ts +27 -0
- package/src/lib/components/accordion/accordion-trigger.ts +46 -0
- package/src/lib/components/accordion/accordion.ts +35 -0
- package/src/lib/components/accordion/index.ts +7 -0
- package/src/lib/components/alert/README.md +117 -0
- package/src/lib/components/alert/alert-action.ts +17 -0
- package/src/lib/components/alert/alert-description.ts +20 -0
- package/src/lib/components/alert/alert-title.ts +20 -0
- package/src/lib/components/alert/alert.ts +39 -0
- package/src/lib/components/alert/index.ts +4 -0
- package/src/lib/components/alert-dialog/ARCHITECTURE.md +808 -0
- package/src/lib/components/alert-dialog/README.md +215 -0
- package/src/lib/components/alert-dialog/alert-dialog-action.ts +32 -0
- package/src/lib/components/alert-dialog/alert-dialog-cancel.ts +32 -0
- package/src/lib/components/alert-dialog/alert-dialog-description.ts +24 -0
- package/src/lib/components/alert-dialog/alert-dialog-footer.ts +21 -0
- package/src/lib/components/alert-dialog/alert-dialog-header.ts +23 -0
- package/src/lib/components/alert-dialog/alert-dialog-media.ts +22 -0
- package/src/lib/components/alert-dialog/alert-dialog-portal.ts +8 -0
- package/src/lib/components/alert-dialog/alert-dialog-provider.ts +135 -0
- package/src/lib/components/alert-dialog/alert-dialog-title.ts +20 -0
- package/src/lib/components/alert-dialog/alert-dialog-trigger.ts +25 -0
- package/src/lib/components/alert-dialog/alert-dialog.ts +77 -0
- package/src/lib/components/alert-dialog/index.ts +11 -0
- package/src/lib/components/animated-counter/README.md +102 -0
- package/src/lib/components/animated-counter/animated-counter-types.ts +23 -0
- package/src/lib/components/animated-counter/animated-counter.ts +143 -0
- package/src/lib/components/animated-counter/index.ts +6 -0
- package/src/lib/components/aspect-ratio/README.md +97 -0
- package/src/lib/components/aspect-ratio/aspect-ratio.ts +19 -0
- package/src/lib/components/aspect-ratio/index.ts +1 -0
- package/src/lib/components/audio-player/README.md +252 -0
- package/src/lib/components/audio-player/audio-player-audio.ts +32 -0
- package/src/lib/components/audio-player/audio-player-cover.ts +39 -0
- package/src/lib/components/audio-player/audio-player-info.ts +40 -0
- package/src/lib/components/audio-player/audio-player-next.ts +40 -0
- package/src/lib/components/audio-player/audio-player-play-button.ts +39 -0
- package/src/lib/components/audio-player/audio-player-previous.ts +40 -0
- package/src/lib/components/audio-player/audio-player-progress.ts +77 -0
- package/src/lib/components/audio-player/audio-player-repeat.ts +38 -0
- package/src/lib/components/audio-player/audio-player-shuffle.ts +39 -0
- package/src/lib/components/audio-player/audio-player-volume.ts +91 -0
- package/src/lib/components/audio-player/audio-player.ts +246 -0
- package/src/lib/components/audio-player/index.ts +11 -0
- package/src/lib/components/avatar/README.md +117 -0
- package/src/lib/components/avatar/avatar-fallback.ts +25 -0
- package/src/lib/components/avatar/avatar-image.ts +39 -0
- package/src/lib/components/avatar/avatar.ts +25 -0
- package/src/lib/components/avatar/index.ts +3 -0
- package/src/lib/components/avatar-group/README.md +94 -0
- package/src/lib/components/avatar-group/avatar-group-types.ts +9 -0
- package/src/lib/components/avatar-group/avatar-group.ts +181 -0
- package/src/lib/components/avatar-group/index.ts +2 -0
- package/src/lib/components/backdrop/backdrop.ts +75 -0
- package/src/lib/components/backdrop/index.ts +1 -0
- package/src/lib/components/badge/README.md +66 -0
- package/src/lib/components/badge/badge.ts +43 -0
- package/src/lib/components/badge/index.ts +1 -0
- package/src/lib/components/barcode-scanner/README.md +144 -0
- package/src/lib/components/barcode-scanner/barcode-scanner-simple.ts +36 -0
- package/src/lib/components/barcode-scanner/barcode-scanner.ts +460 -0
- package/src/lib/components/barcode-scanner/index.ts +3 -0
- package/src/lib/components/breadcrumb/README.md +80 -0
- package/src/lib/components/breadcrumb/breadcrumb-ellipsis.ts +46 -0
- package/src/lib/components/breadcrumb/breadcrumb-item.ts +17 -0
- package/src/lib/components/breadcrumb/breadcrumb-link.ts +17 -0
- package/src/lib/components/breadcrumb/breadcrumb-list.ts +20 -0
- package/src/lib/components/breadcrumb/breadcrumb-page.ts +20 -0
- package/src/lib/components/breadcrumb/breadcrumb-separator.ts +45 -0
- package/src/lib/components/breadcrumb/breadcrumb.ts +10 -0
- package/src/lib/components/breadcrumb/index.ts +7 -0
- package/src/lib/components/button-group/button-group-separator.ts +26 -0
- package/src/lib/components/button-group/button-group-text.ts +20 -0
- package/src/lib/components/button-group/button-group.ts +43 -0
- package/src/lib/components/button-group/index.ts +10 -0
- package/src/lib/components/calendar/CALENDAR-VIEWS.md +443 -0
- package/src/lib/components/calendar/README.md +227 -0
- package/src/lib/components/calendar/calendar-day-view.ts +310 -0
- package/src/lib/components/calendar/calendar-header.ts +58 -0
- package/src/lib/components/calendar/calendar-month-view.ts +176 -0
- package/src/lib/components/calendar/calendar-year-view.ts +167 -0
- package/src/lib/components/calendar/calendar.ts +273 -0
- package/src/lib/components/calendar/index.ts +1 -0
- package/src/lib/components/card/README.md +86 -0
- package/src/lib/components/card/card-content.ts +15 -0
- package/src/lib/components/card/card-description.ts +17 -0
- package/src/lib/components/card/card-footer.ts +17 -0
- package/src/lib/components/card/card-header.ts +17 -0
- package/src/lib/components/card/card-title.ts +17 -0
- package/src/lib/components/card/card.ts +20 -0
- package/src/lib/components/card/index.ts +6 -0
- package/src/lib/components/chart/README.md +220 -0
- package/src/lib/components/chart/bar-chart.ts +186 -0
- package/src/lib/components/chart/chart-container.ts +33 -0
- package/src/lib/components/chart/chart-legend.ts +42 -0
- package/src/lib/components/chart/chart-tooltip.ts +42 -0
- package/src/lib/components/chart/chart-types.ts +21 -0
- package/src/lib/components/chart/donut-chart.ts +35 -0
- package/src/lib/components/chart/index.ts +9 -0
- package/src/lib/components/chart/line-chart.ts +223 -0
- package/src/lib/components/chart/pie-chart.ts +186 -0
- package/src/lib/components/checkbox/README.md +293 -0
- package/src/lib/components/checkbox/checkbox-field.ts +78 -0
- package/src/lib/components/checkbox/checkbox-indicator.ts +27 -0
- package/src/lib/components/checkbox/checkbox-types.ts +15 -0
- package/src/lib/components/checkbox/checkbox.ts +74 -0
- package/src/lib/components/checkbox/index.ts +5 -0
- package/src/lib/components/checkbox/visual-checkbox.ts +47 -0
- package/src/lib/components/collapsible/README.md +191 -0
- package/src/lib/components/collapsible/collapsible-content.ts +28 -0
- package/src/lib/components/collapsible/collapsible-panel.ts +42 -0
- package/src/lib/components/collapsible/collapsible-trigger.ts +48 -0
- package/src/lib/components/collapsible/collapsible.ts +33 -0
- package/src/lib/components/collapsible/index.ts +4 -0
- package/src/lib/components/color-picker/README.md +218 -0
- package/src/lib/components/color-picker/color-picker-area.ts +107 -0
- package/src/lib/components/color-picker/color-picker-eyedropper.ts +76 -0
- package/src/lib/components/color-picker/color-picker-hue.ts +92 -0
- package/src/lib/components/color-picker/color-picker-input.ts +70 -0
- package/src/lib/components/color-picker/color-picker-preview.ts +21 -0
- package/src/lib/components/color-picker/color-picker-swatches.ts +60 -0
- package/src/lib/components/color-picker/color-picker.ts +227 -0
- package/src/lib/components/color-picker/index.ts +8 -0
- package/src/lib/components/combobox/README.md +166 -0
- package/src/lib/components/combobox/combobox-empty.ts +17 -0
- package/src/lib/components/combobox/combobox-icon.ts +20 -0
- package/src/lib/components/combobox/combobox-input.ts +32 -0
- package/src/lib/components/combobox/combobox-item-indicator.ts +20 -0
- package/src/lib/components/combobox/combobox-item.ts +49 -0
- package/src/lib/components/combobox/combobox-list.ts +40 -0
- package/src/lib/components/combobox/combobox-portal.ts +111 -0
- package/src/lib/components/combobox/combobox-trigger.ts +20 -0
- package/src/lib/components/combobox/combobox.ts +42 -0
- package/src/lib/components/combobox/index.ts +9 -0
- package/src/lib/components/command/README.md +161 -0
- package/src/lib/components/command/command-empty.ts +17 -0
- package/src/lib/components/command/command-group-heading.ts +20 -0
- package/src/lib/components/command/command-group.ts +23 -0
- package/src/lib/components/command/command-input.ts +67 -0
- package/src/lib/components/command/command-item.ts +61 -0
- package/src/lib/components/command/command-list.ts +19 -0
- package/src/lib/components/command/command-separator.ts +18 -0
- package/src/lib/components/command/command-shortcut.ts +20 -0
- package/src/lib/components/command/command.ts +35 -0
- package/src/lib/components/command/index.ts +9 -0
- package/src/lib/components/confetti/README.md +103 -0
- package/src/lib/components/confetti/confetti-types.ts +47 -0
- package/src/lib/components/confetti/confetti.ts +220 -0
- package/src/lib/components/confetti/index.ts +7 -0
- package/src/lib/components/context-menu/README.md +149 -0
- package/src/lib/components/context-menu/context-menu-content.ts +46 -0
- package/src/lib/components/context-menu/context-menu-item.ts +44 -0
- package/src/lib/components/context-menu/context-menu-label.ts +22 -0
- package/src/lib/components/context-menu/context-menu-separator.ts +18 -0
- package/src/lib/components/context-menu/context-menu-shortcut.ts +20 -0
- package/src/lib/components/context-menu/context-menu-sub-content.ts +83 -0
- package/src/lib/components/context-menu/context-menu-sub-trigger.ts +91 -0
- package/src/lib/components/context-menu/context-menu-sub.ts +38 -0
- package/src/lib/components/context-menu/context-menu-trigger.ts +40 -0
- package/src/lib/components/context-menu/context-menu.ts +106 -0
- package/src/lib/components/context-menu/index.ts +10 -0
- package/src/lib/components/copy-button/README.md +211 -0
- package/src/lib/components/copy-button/copy-button-with-text.ts +53 -0
- package/src/lib/components/copy-button/copy-button.ts +137 -0
- package/src/lib/components/copy-button/copy-code.ts +42 -0
- package/src/lib/components/copy-button/copy-input.ts +54 -0
- package/src/lib/components/copy-button/index.ts +4 -0
- package/src/lib/components/countdown/README.md +168 -0
- package/src/lib/components/countdown/countdown-simple.ts +118 -0
- package/src/lib/components/countdown/countdown.ts +235 -0
- package/src/lib/components/countdown/index.ts +3 -0
- package/src/lib/components/data-table/README.md +330 -0
- package/src/lib/components/data-table/data-table-body.ts +28 -0
- package/src/lib/components/data-table/data-table-cell.ts +20 -0
- package/src/lib/components/data-table/data-table-column-toggle.ts +96 -0
- package/src/lib/components/data-table/data-table-filter.ts +45 -0
- package/src/lib/components/data-table/data-table-head.ts +96 -0
- package/src/lib/components/data-table/data-table-header.ts +28 -0
- package/src/lib/components/data-table/data-table-pagination.ts +152 -0
- package/src/lib/components/data-table/data-table-row.ts +23 -0
- package/src/lib/components/data-table/data-table.ts +181 -0
- package/src/lib/components/data-table/index.ts +15 -0
- package/src/lib/components/date-picker/README.md +101 -0
- package/src/lib/components/date-picker/date-picker.ts +175 -0
- package/src/lib/components/date-picker/index.ts +1 -0
- package/src/lib/components/date-range-picker/README.md +148 -0
- package/src/lib/components/date-range-picker/date-range-picker.ts +348 -0
- package/src/lib/components/date-range-picker/index.ts +3 -0
- package/src/lib/components/dialog/ARCHITECTURE.md +792 -0
- package/src/lib/components/dialog/README.md +208 -0
- package/src/lib/components/dialog/dialog-close.ts +33 -0
- package/src/lib/components/dialog/dialog-description.ts +23 -0
- package/src/lib/components/dialog/dialog-footer.ts +20 -0
- package/src/lib/components/dialog/dialog-header.ts +17 -0
- package/src/lib/components/dialog/dialog-portal.ts +8 -0
- package/src/lib/components/dialog/dialog-provider.ts +175 -0
- package/src/lib/components/dialog/dialog-title.ts +20 -0
- package/src/lib/components/dialog/dialog-trigger.ts +25 -0
- package/src/lib/components/dialog/dialog.ts +79 -0
- package/src/lib/components/dialog/index.ts +9 -0
- package/src/lib/components/diff-viewer/README.md +172 -0
- package/src/lib/components/diff-viewer/diff-algorithm.ts +337 -0
- package/src/lib/components/diff-viewer/diff-viewer.ts +369 -0
- package/src/lib/components/diff-viewer/index.ts +8 -0
- package/src/lib/components/dock/README.md +204 -0
- package/src/lib/components/dock/dock-badge.ts +36 -0
- package/src/lib/components/dock/dock-item.ts +76 -0
- package/src/lib/components/dock/dock-items.ts +31 -0
- package/src/lib/components/dock/dock-types.ts +25 -0
- package/src/lib/components/dock/dock.ts +101 -0
- package/src/lib/components/dock/index.ts +11 -0
- package/src/lib/components/drawer/ARCHITECTURE.md +972 -0
- package/src/lib/components/drawer/README.md +205 -0
- package/src/lib/components/drawer/drawer-close.ts +18 -0
- package/src/lib/components/drawer/drawer-description.ts +17 -0
- package/src/lib/components/drawer/drawer-footer.ts +17 -0
- package/src/lib/components/drawer/drawer-handle.ts +17 -0
- package/src/lib/components/drawer/drawer-header.ts +17 -0
- package/src/lib/components/drawer/drawer-portal.ts +8 -0
- package/src/lib/components/drawer/drawer-provider.ts +142 -0
- package/src/lib/components/drawer/drawer-title.ts +17 -0
- package/src/lib/components/drawer/drawer-trigger.ts +24 -0
- package/src/lib/components/drawer/drawer.ts +77 -0
- package/src/lib/components/drawer/index.ts +11 -0
- package/src/lib/components/emoji-picker/README.md +151 -0
- package/src/lib/components/emoji-picker/emoji-picker-trigger.ts +48 -0
- package/src/lib/components/emoji-picker/emoji-picker.ts +666 -0
- package/src/lib/components/emoji-picker/index.ts +3 -0
- package/src/lib/components/empty/README.md +72 -0
- package/src/lib/components/empty/empty-content.ts +20 -0
- package/src/lib/components/empty/empty-description.ts +20 -0
- package/src/lib/components/empty/empty-header.ts +17 -0
- package/src/lib/components/empty/empty-media.ts +29 -0
- package/src/lib/components/empty/empty-title.ts +17 -0
- package/src/lib/components/empty/empty.ts +20 -0
- package/src/lib/components/empty/index.ts +6 -0
- package/src/lib/components/field/README.md +326 -0
- package/src/lib/components/field/field-content.ts +20 -0
- package/src/lib/components/field/field-description.ts +22 -0
- package/src/lib/components/field/field-error.ts +18 -0
- package/src/lib/components/field/field-group.ts +20 -0
- package/src/lib/components/field/field-legend.ts +24 -0
- package/src/lib/components/field/field-separator.ts +20 -0
- package/src/lib/components/field/field-set.ts +20 -0
- package/src/lib/components/field/field-title.ts +20 -0
- package/src/lib/components/field/field.ts +89 -0
- package/src/lib/components/field/index.ts +9 -0
- package/src/lib/components/file-upload/README.md +256 -0
- package/src/lib/components/file-upload/file-upload-dropzone.ts +100 -0
- package/src/lib/components/file-upload/file-upload-item-delete.ts +59 -0
- package/src/lib/components/file-upload/file-upload-item-name.ts +17 -0
- package/src/lib/components/file-upload/file-upload-item-preview.ts +52 -0
- package/src/lib/components/file-upload/file-upload-item-progress.ts +33 -0
- package/src/lib/components/file-upload/file-upload-item-size.ts +39 -0
- package/src/lib/components/file-upload/file-upload-item.ts +35 -0
- package/src/lib/components/file-upload/file-upload-list.ts +17 -0
- package/src/lib/components/file-upload/file-upload-trigger.ts +70 -0
- package/src/lib/components/file-upload/file-upload.ts +156 -0
- package/src/lib/components/file-upload/index.ts +11 -0
- package/src/lib/components/hover-card/ARCHITECTURE.md +341 -0
- package/src/lib/components/hover-card/README.md +118 -0
- package/src/lib/components/hover-card/hover-card-portal.ts +142 -0
- package/src/lib/components/hover-card/hover-card-provider.ts +85 -0
- package/src/lib/components/hover-card/hover-card-trigger.ts +75 -0
- package/src/lib/components/hover-card/hover-card.ts +97 -0
- package/src/lib/components/hover-card/index.ts +5 -0
- package/src/lib/components/image-annotator/README.md +132 -0
- package/src/lib/components/image-annotator/image-annotator-types.ts +29 -0
- package/src/lib/components/image-annotator/image-annotator.ts +549 -0
- package/src/lib/components/image-annotator/index.ts +7 -0
- package/src/lib/components/image-compare/README.md +239 -0
- package/src/lib/components/image-compare/image-compare-after.ts +39 -0
- package/src/lib/components/image-compare/image-compare-before.ts +30 -0
- package/src/lib/components/image-compare/image-compare-container.ts +119 -0
- package/src/lib/components/image-compare/image-compare-label.ts +34 -0
- package/src/lib/components/image-compare/image-compare-slider.ts +103 -0
- package/src/lib/components/image-compare/image-compare.ts +79 -0
- package/src/lib/components/image-compare/index.ts +10 -0
- package/src/lib/components/image-cropper/README.md +322 -0
- package/src/lib/components/image-cropper/image-cropper-aspect-ratio.ts +65 -0
- package/src/lib/components/image-cropper/image-cropper-container.ts +294 -0
- package/src/lib/components/image-cropper/image-cropper-controls.ts +95 -0
- package/src/lib/components/image-cropper/image-cropper-preview.ts +66 -0
- package/src/lib/components/image-cropper/image-cropper.ts +459 -0
- package/src/lib/components/image-cropper/index.ts +10 -0
- package/src/lib/components/index.ts +106 -0
- package/src/lib/components/infinite-scroll/README.md +134 -0
- package/src/lib/components/infinite-scroll/index.ts +4 -0
- package/src/lib/components/infinite-scroll/infinite-scroll-end.ts +9 -0
- package/src/lib/components/infinite-scroll/infinite-scroll-loader.ts +9 -0
- package/src/lib/components/infinite-scroll/infinite-scroll.ts +199 -0
- package/src/lib/components/infinite-scroll/virtual-scroll.ts +83 -0
- package/src/lib/components/input/README.md +93 -0
- package/src/lib/components/input/index.ts +1 -0
- package/src/lib/components/input/input.ts +41 -0
- package/src/lib/components/input-group/README.md +60 -0
- package/src/lib/components/input-group/index.ts +6 -0
- package/src/lib/components/input-group/input-group-addon.ts +46 -0
- package/src/lib/components/input-group/input-group-button.ts +49 -0
- package/src/lib/components/input-group/input-group-input.ts +20 -0
- package/src/lib/components/input-group/input-group-text.ts +20 -0
- package/src/lib/components/input-group/input-group-textarea.ts +20 -0
- package/src/lib/components/input-group/input-group.ts +21 -0
- package/src/lib/components/kanban-board/README.md +238 -0
- package/src/lib/components/kanban-board/index.ts +12 -0
- package/src/lib/components/kanban-board/kanban-board.ts +281 -0
- package/src/lib/components/kanban-board/kanban-card.ts +241 -0
- package/src/lib/components/kanban-board/kanban-column.ts +371 -0
- package/src/lib/components/kanban-board/kanban-types.ts +52 -0
- package/src/lib/components/kbd/README.md +58 -0
- package/src/lib/components/kbd/index.ts +2 -0
- package/src/lib/components/kbd/kbd-group.ts +17 -0
- package/src/lib/components/kbd/kbd.ts +20 -0
- package/src/lib/components/label/README.md +90 -0
- package/src/lib/components/label/index.ts +1 -0
- package/src/lib/components/label/label.ts +32 -0
- package/src/lib/components/language-switcher/index.ts +4 -0
- package/src/lib/components/language-switcher/language-button.ts +98 -0
- package/src/lib/components/language-switcher/language-select.ts +65 -0
- package/src/lib/components/language-switcher/language-toggle.ts +98 -0
- package/src/lib/components/language-switcher/language.service.ts +239 -0
- package/src/lib/components/language-switcher/styles.ts +16 -0
- package/src/lib/components/lightbox/README.md +387 -0
- package/src/lib/components/lightbox/index.ts +9 -0
- package/src/lib/components/lightbox/lightbox-container.ts +338 -0
- package/src/lib/components/lightbox/lightbox-gallery.ts +81 -0
- package/src/lib/components/lightbox/lightbox-trigger.ts +19 -0
- package/src/lib/components/lightbox/lightbox.ts +210 -0
- package/src/lib/components/lightbox/lightbox.types.ts +7 -0
- package/src/lib/components/marquee/README.md +183 -0
- package/src/lib/components/marquee/auto-marquee.ts +73 -0
- package/src/lib/components/marquee/index.ts +6 -0
- package/src/lib/components/marquee/marquee-clone.ts +17 -0
- package/src/lib/components/marquee/marquee-fade.ts +53 -0
- package/src/lib/components/marquee/marquee-item.ts +17 -0
- package/src/lib/components/marquee/marquee-text.ts +80 -0
- package/src/lib/components/marquee/marquee.ts +96 -0
- package/src/lib/components/masonry-grid/README.md +204 -0
- package/src/lib/components/masonry-grid/index.ts +4 -0
- package/src/lib/components/masonry-grid/masonry-grid.ts +178 -0
- package/src/lib/components/masonry-grid/masonry-item.ts +66 -0
- package/src/lib/components/masonry-grid/masonry-types.ts +24 -0
- package/src/lib/components/mention-input/README.md +122 -0
- package/src/lib/components/mention-input/index.ts +2 -0
- package/src/lib/components/mention-input/mention-input.ts +279 -0
- package/src/lib/components/menu/README.md +176 -0
- package/src/lib/components/menu/index.ts +11 -0
- package/src/lib/components/menu/menu-item.ts +32 -0
- package/src/lib/components/menu/menu-portal.ts +53 -0
- package/src/lib/components/menu/menu-provider.ts +50 -0
- package/src/lib/components/menu/menu-separator.ts +19 -0
- package/src/lib/components/menu/menu-sub-icon.ts +18 -0
- package/src/lib/components/menu/menu-sub-portal.ts +53 -0
- package/src/lib/components/menu/menu-sub-provider.ts +52 -0
- package/src/lib/components/menu/menu-sub-trigger.ts +34 -0
- package/src/lib/components/menu/menu-sub.ts +41 -0
- package/src/lib/components/menu/menu-trigger.ts +27 -0
- package/src/lib/components/menu/menu.ts +41 -0
- package/src/lib/components/multi-select/README.md +155 -0
- package/src/lib/components/multi-select/index.ts +2 -0
- package/src/lib/components/multi-select/multi-select.ts +394 -0
- package/src/lib/components/native-checkbox/README.md +113 -0
- package/src/lib/components/native-checkbox/index.ts +1 -0
- package/src/lib/components/native-checkbox/native-checkbox.ts +116 -0
- package/src/lib/components/navbar/ARCHITECTURE.md +605 -0
- package/src/lib/components/navbar/README.md +246 -0
- package/src/lib/components/navbar/index.ts +9 -0
- package/src/lib/components/navbar/navbar-actions.ts +28 -0
- package/src/lib/components/navbar/navbar-brand.ts +24 -0
- package/src/lib/components/navbar/navbar-group.ts +28 -0
- package/src/lib/components/navbar/navbar-mobile-link.ts +28 -0
- package/src/lib/components/navbar/navbar-mobile-menu.ts +71 -0
- package/src/lib/components/navbar/navbar-mobile-portal.ts +118 -0
- package/src/lib/components/navbar/navbar-mobile-trigger.ts +51 -0
- package/src/lib/components/navbar/navbar-provider.ts +85 -0
- package/src/lib/components/navbar/navbar.ts +40 -0
- package/src/lib/components/navigation-menu/README.md +135 -0
- package/src/lib/components/navigation-menu/index.ts +8 -0
- package/src/lib/components/navigation-menu/navigation-menu-content.ts +80 -0
- package/src/lib/components/navigation-menu/navigation-menu-indicator.ts +35 -0
- package/src/lib/components/navigation-menu/navigation-menu-item.ts +88 -0
- package/src/lib/components/navigation-menu/navigation-menu-link.ts +29 -0
- package/src/lib/components/navigation-menu/navigation-menu-list.ts +20 -0
- package/src/lib/components/navigation-menu/navigation-menu-trigger.ts +52 -0
- package/src/lib/components/navigation-menu/navigation-menu-viewport.ts +35 -0
- package/src/lib/components/navigation-menu/navigation-menu.ts +39 -0
- package/src/lib/components/notification-center/README.md +365 -0
- package/src/lib/components/notification-center/index.ts +20 -0
- package/src/lib/components/notification-center/notification-center-container.ts +226 -0
- package/src/lib/components/notification-center/notification-center.ts +157 -0
- package/src/lib/components/notification-center/notification-group.ts +198 -0
- package/src/lib/components/notification-center/notification-item.ts +214 -0
- package/src/lib/components/notification-center/notification-types.ts +52 -0
- package/src/lib/components/number-field/README.md +369 -0
- package/src/lib/components/number-field/index.ts +6 -0
- package/src/lib/components/number-field/number-field-decrement.ts +57 -0
- package/src/lib/components/number-field/number-field-increment.ts +58 -0
- package/src/lib/components/number-field/number-field-input-group.ts +37 -0
- package/src/lib/components/number-field/number-field-input.ts +87 -0
- package/src/lib/components/number-field/number-field-scrub-area.ts +74 -0
- package/src/lib/components/number-field/number-field.ts +143 -0
- package/src/lib/components/opt-field/index.ts +7 -0
- package/src/lib/components/opt-field/opt-field-separator.ts +18 -0
- package/src/lib/components/opt-field/opt-field-slot-caret.ts +31 -0
- package/src/lib/components/opt-field/opt-field-slot-char.ts +19 -0
- package/src/lib/components/opt-field/opt-field-slot-group.ts +17 -0
- package/src/lib/components/opt-field/opt-field-slot-input.ts +60 -0
- package/src/lib/components/opt-field/opt-field-slot.ts +111 -0
- package/src/lib/components/opt-field/opt-field.ts +113 -0
- package/src/lib/components/org-chart/README.md +265 -0
- package/src/lib/components/org-chart/index.ts +8 -0
- package/src/lib/components/org-chart/org-chart-node.ts +253 -0
- package/src/lib/components/org-chart/org-chart-types.ts +22 -0
- package/src/lib/components/org-chart/org-chart.ts +67 -0
- package/src/lib/components/pagination/ACCESSIBILITY_REVIEW.md +530 -0
- package/src/lib/components/pagination/KEYBOARD-NAVIGATION.md +356 -0
- package/src/lib/components/pagination/README.md +359 -0
- package/src/lib/components/pagination/REVIEW_SUMMARY.md +55 -0
- package/src/lib/components/pagination/SMART-PAGINATION.md +345 -0
- package/src/lib/components/pagination/index.ts +11 -0
- package/src/lib/components/pagination/pagination-ellipsis.ts +32 -0
- package/src/lib/components/pagination/pagination-first.ts +75 -0
- package/src/lib/components/pagination/pagination-item.ts +15 -0
- package/src/lib/components/pagination/pagination-last.ts +77 -0
- package/src/lib/components/pagination/pagination-link.ts +70 -0
- package/src/lib/components/pagination/pagination-list.ts +17 -0
- package/src/lib/components/pagination/pagination-next.ts +78 -0
- package/src/lib/components/pagination/pagination-page-size-select.ts +44 -0
- package/src/lib/components/pagination/pagination-previous.ts +78 -0
- package/src/lib/components/pagination/pagination.ts +190 -0
- package/src/lib/components/password-field/README.md +247 -0
- package/src/lib/components/password-field/index.ts +7 -0
- package/src/lib/components/password-field/password-field-input-group.ts +32 -0
- package/src/lib/components/password-field/password-field-input.ts +55 -0
- package/src/lib/components/password-field/password-field-requirements.ts +90 -0
- package/src/lib/components/password-field/password-field-strength-bar.ts +64 -0
- package/src/lib/components/password-field/password-field-strength.ts +91 -0
- package/src/lib/components/password-field/password-field-toggle.ts +86 -0
- package/src/lib/components/password-field/password-field.ts +95 -0
- package/src/lib/components/pdf-viewer/README.md +221 -0
- package/src/lib/components/pdf-viewer/index.ts +47 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-container.ts +54 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-content.ts +60 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-download.ts +34 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-empty.ts +62 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-error.ts +73 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-fullscreen.ts +36 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-loading.ts +44 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-nav.ts +30 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-next-page.ts +38 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-page-info.ts +53 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-prev-page.ts +38 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-print.ts +34 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-retry.ts +36 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-root.ts +239 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-rotate-left.ts +34 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-rotate-right.ts +34 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-separator.ts +28 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-spacer.ts +24 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-toolbar-base.ts +34 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-toolbar.ts +391 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-types.ts +52 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-zoom-in.ts +37 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-zoom-out.ts +37 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-zoom-select.ts +61 -0
- package/src/lib/components/pdf-viewer/pdf-viewer-zoom.ts +30 -0
- package/src/lib/components/pdf-viewer/pdf-viewer.ts +417 -0
- package/src/lib/components/phone-input/README.md +173 -0
- package/src/lib/components/phone-input/countries.ts +69 -0
- package/src/lib/components/phone-input/index.ts +4 -0
- package/src/lib/components/phone-input/phone-input-simple.ts +141 -0
- package/src/lib/components/phone-input/phone-input.ts +304 -0
- package/src/lib/components/popover/ARCHITECTURE.md +569 -0
- package/src/lib/components/popover/README.md +247 -0
- package/src/lib/components/popover/index.ts +6 -0
- package/src/lib/components/popover/popover-close.ts +29 -0
- package/src/lib/components/popover/popover-portal.ts +161 -0
- package/src/lib/components/popover/popover-provider.ts +82 -0
- package/src/lib/components/popover/popover-trigger.ts +27 -0
- package/src/lib/components/popover/popover.ts +66 -0
- package/src/lib/components/progress/README.md +75 -0
- package/src/lib/components/progress/index.ts +1 -0
- package/src/lib/components/progress/progress.ts +62 -0
- package/src/lib/components/qr-code/README.md +124 -0
- package/src/lib/components/qr-code/index.ts +3 -0
- package/src/lib/components/qr-code/qr-code-download.ts +105 -0
- package/src/lib/components/qr-code/qr-code.ts +121 -0
- package/src/lib/components/qr-code/qr-generator.ts +479 -0
- package/src/lib/components/radio-group/README.md +273 -0
- package/src/lib/components/radio-group/index.ts +3 -0
- package/src/lib/components/radio-group/radio-field.ts +43 -0
- package/src/lib/components/radio-group/radio-group.ts +18 -0
- package/src/lib/components/radio-group/radio.ts +30 -0
- package/src/lib/components/range-slider/README.md +118 -0
- package/src/lib/components/range-slider/index.ts +1 -0
- package/src/lib/components/range-slider/range-slider.ts +304 -0
- package/src/lib/components/rating-field/README.md +150 -0
- package/src/lib/components/rating-field/index.ts +3 -0
- package/src/lib/components/rating-field/rating-field.ts +87 -0
- package/src/lib/components/rating-field/rating-item-group.ts +73 -0
- package/src/lib/components/rating-field/rating-item.ts +89 -0
- package/src/lib/components/resizable/README.md +133 -0
- package/src/lib/components/resizable/index.ts +4 -0
- package/src/lib/components/resizable/resizable-handle.ts +160 -0
- package/src/lib/components/resizable/resizable-panel-group.ts +38 -0
- package/src/lib/components/resizable/resizable-panel.ts +51 -0
- package/src/lib/components/resizable/resizable.types.ts +1 -0
- package/src/lib/components/scroll-area/README.md +76 -0
- package/src/lib/components/scroll-area/index.ts +2 -0
- package/src/lib/components/scroll-area/scroll-area.ts +87 -0
- package/src/lib/components/scroll-area/scroll-bar.ts +207 -0
- package/src/lib/components/search-input/README.md +99 -0
- package/src/lib/components/search-input/index.ts +6 -0
- package/src/lib/components/search-input/search-input-types.ts +21 -0
- package/src/lib/components/search-input/search-input.ts +302 -0
- package/src/lib/components/select/README.md +175 -0
- package/src/lib/components/select/index.ts +9 -0
- package/src/lib/components/select/select-icon.ts +20 -0
- package/src/lib/components/select/select-input.ts +32 -0
- package/src/lib/components/select/select-item-indicator.ts +20 -0
- package/src/lib/components/select/select-item.ts +48 -0
- package/src/lib/components/select/select-list.ts +42 -0
- package/src/lib/components/select/select-portal.ts +48 -0
- package/src/lib/components/select/select-trigger.ts +36 -0
- package/src/lib/components/select/select-value.ts +32 -0
- package/src/lib/components/select/select.ts +57 -0
- package/src/lib/components/separator/README.md +59 -0
- package/src/lib/components/separator/index.ts +1 -0
- package/src/lib/components/separator/separator.ts +29 -0
- package/src/lib/components/sheet/ARCHITECTURE.md +915 -0
- package/src/lib/components/sheet/README.md +248 -0
- package/src/lib/components/sheet/index.ts +10 -0
- package/src/lib/components/sheet/sheet-close.ts +32 -0
- package/src/lib/components/sheet/sheet-description.ts +20 -0
- package/src/lib/components/sheet/sheet-footer.ts +20 -0
- package/src/lib/components/sheet/sheet-header.ts +17 -0
- package/src/lib/components/sheet/sheet-portal.ts +8 -0
- package/src/lib/components/sheet/sheet-provider.ts +142 -0
- package/src/lib/components/sheet/sheet-title.ts +20 -0
- package/src/lib/components/sheet/sheet-trigger.ts +24 -0
- package/src/lib/components/sheet/sheet.ts +92 -0
- package/src/lib/components/sidebar/README.md +254 -0
- package/src/lib/components/sidebar/index.ts +24 -0
- package/src/lib/components/sidebar/sidebar-content.ts +20 -0
- package/src/lib/components/sidebar/sidebar-footer.ts +17 -0
- package/src/lib/components/sidebar/sidebar-group-action.ts +24 -0
- package/src/lib/components/sidebar/sidebar-group-content.ts +17 -0
- package/src/lib/components/sidebar/sidebar-group-label.ts +23 -0
- package/src/lib/components/sidebar/sidebar-group.ts +17 -0
- package/src/lib/components/sidebar/sidebar-header.ts +17 -0
- package/src/lib/components/sidebar/sidebar-input.ts +20 -0
- package/src/lib/components/sidebar/sidebar-inset.ts +21 -0
- package/src/lib/components/sidebar/sidebar-menu-action.ts +31 -0
- package/src/lib/components/sidebar/sidebar-menu-badge.ts +25 -0
- package/src/lib/components/sidebar/sidebar-menu-button.ts +55 -0
- package/src/lib/components/sidebar/sidebar-menu-item.ts +17 -0
- package/src/lib/components/sidebar/sidebar-menu-skeleton.ts +40 -0
- package/src/lib/components/sidebar/sidebar-menu-sub-button.ts +33 -0
- package/src/lib/components/sidebar/sidebar-menu-sub-item.ts +15 -0
- package/src/lib/components/sidebar/sidebar-menu-sub.ts +21 -0
- package/src/lib/components/sidebar/sidebar-menu.ts +17 -0
- package/src/lib/components/sidebar/sidebar-provider.ts +128 -0
- package/src/lib/components/sidebar/sidebar-rail.ts +39 -0
- package/src/lib/components/sidebar/sidebar-separator.ts +21 -0
- package/src/lib/components/sidebar/sidebar-state.service.ts +33 -0
- package/src/lib/components/sidebar/sidebar-trigger.ts +38 -0
- package/src/lib/components/sidebar/sidebar.ts +120 -0
- package/src/lib/components/signature-pad/README.md +236 -0
- package/src/lib/components/signature-pad/index.ts +8 -0
- package/src/lib/components/signature-pad/signature-pad-canvas.ts +228 -0
- package/src/lib/components/signature-pad/signature-pad-clear-button.ts +48 -0
- package/src/lib/components/signature-pad/signature-pad-color-button.ts +50 -0
- package/src/lib/components/signature-pad/signature-pad-controls.ts +26 -0
- package/src/lib/components/signature-pad/signature-pad-toolbar.ts +25 -0
- package/src/lib/components/signature-pad/signature-pad-undo-button.ts +48 -0
- package/src/lib/components/signature-pad/signature-pad-width-button.ts +50 -0
- package/src/lib/components/signature-pad/signature-pad.ts +97 -0
- package/src/lib/components/skeleton/README.md +80 -0
- package/src/lib/components/skeleton/index.ts +1 -0
- package/src/lib/components/skeleton/skeleton.ts +17 -0
- package/src/lib/components/slider/README.md +106 -0
- package/src/lib/components/slider/index.ts +4 -0
- package/src/lib/components/slider/slider-range.ts +28 -0
- package/src/lib/components/slider/slider-thumb.ts +73 -0
- package/src/lib/components/slider/slider-track.ts +31 -0
- package/src/lib/components/slider/slider.ts +185 -0
- package/src/lib/components/sortable-list/README.md +229 -0
- package/src/lib/components/sortable-list/index.ts +4 -0
- package/src/lib/components/sortable-list/sortable-handle.ts +72 -0
- package/src/lib/components/sortable-list/sortable-item.ts +162 -0
- package/src/lib/components/sortable-list/sortable-list.ts +127 -0
- package/src/lib/components/sortable-list/sortable-overlay.ts +31 -0
- package/src/lib/components/speed-dial/README.md +259 -0
- package/src/lib/components/speed-dial/index.ts +7 -0
- package/src/lib/components/speed-dial/speed-dial-action.ts +99 -0
- package/src/lib/components/speed-dial/speed-dial-types.ts +14 -0
- package/src/lib/components/speed-dial/speed-dial.ts +224 -0
- package/src/lib/components/spinner/README.md +41 -0
- package/src/lib/components/spinner/index.ts +1 -0
- package/src/lib/components/spinner/spinner.ts +20 -0
- package/src/lib/components/split-button/README.md +99 -0
- package/src/lib/components/split-button/index.ts +6 -0
- package/src/lib/components/split-button/split-button-types.ts +14 -0
- package/src/lib/components/split-button/split-button.ts +240 -0
- package/src/lib/components/spotlight/README.md +136 -0
- package/src/lib/components/spotlight/index.ts +5 -0
- package/src/lib/components/spotlight/spotlight-actions.ts +24 -0
- package/src/lib/components/spotlight/spotlight-description.ts +24 -0
- package/src/lib/components/spotlight/spotlight-title.ts +24 -0
- package/src/lib/components/spotlight/spotlight.ts +367 -0
- package/src/lib/components/stat-card/README.md +319 -0
- package/src/lib/components/stat-card/REFACTORING-COMPLETE.md +250 -0
- package/src/lib/components/stat-card/REFACTORING-PLAN.md +471 -0
- package/src/lib/components/stat-card/index.ts +11 -0
- package/src/lib/components/stat-card/stat-card-change.ts +27 -0
- package/src/lib/components/stat-card/stat-card-description.ts +17 -0
- package/src/lib/components/stat-card/stat-card-icon.ts +28 -0
- package/src/lib/components/stat-card/stat-card-label.ts +27 -0
- package/src/lib/components/stat-card/stat-card-types.ts +3 -0
- package/src/lib/components/stat-card/stat-card-value.ts +27 -0
- package/src/lib/components/stat-card/stat-card.ts +34 -0
- package/src/lib/components/stepper/README.md +250 -0
- package/src/lib/components/stepper/index.ts +12 -0
- package/src/lib/components/stepper/stepper-content.ts +25 -0
- package/src/lib/components/stepper/stepper-description.ts +17 -0
- package/src/lib/components/stepper/stepper-item.ts +35 -0
- package/src/lib/components/stepper/stepper-list.ts +26 -0
- package/src/lib/components/stepper/stepper-next.ts +41 -0
- package/src/lib/components/stepper/stepper-previous.ts +42 -0
- package/src/lib/components/stepper/stepper-separator.ts +35 -0
- package/src/lib/components/stepper/stepper-title.ts +17 -0
- package/src/lib/components/stepper/stepper-trigger.ts +67 -0
- package/src/lib/components/stepper/stepper-types.ts +10 -0
- package/src/lib/components/stepper/stepper.ts +46 -0
- package/src/lib/components/switch/README.md +99 -0
- package/src/lib/components/switch/index.ts +1 -0
- package/src/lib/components/switch/switch.ts +56 -0
- package/src/lib/components/table/README.md +105 -0
- package/src/lib/components/table/index.ts +8 -0
- package/src/lib/components/table/table-body.ts +17 -0
- package/src/lib/components/table/table-caption.ts +17 -0
- package/src/lib/components/table/table-cell.ts +17 -0
- package/src/lib/components/table/table-footer.ts +20 -0
- package/src/lib/components/table/table-header-cell.ts +20 -0
- package/src/lib/components/table/table-header.ts +17 -0
- package/src/lib/components/table/table-row.ts +20 -0
- package/src/lib/components/table/table.ts +17 -0
- package/src/lib/components/tabs/README.md +169 -0
- package/src/lib/components/tabs/index.ts +4 -0
- package/src/lib/components/tabs/tab-list.ts +38 -0
- package/src/lib/components/tabs/tab-panel.ts +45 -0
- package/src/lib/components/tabs/tab.ts +45 -0
- package/src/lib/components/tabs/tabs.ts +28 -0
- package/src/lib/components/tag-input/README.md +271 -0
- package/src/lib/components/tag-input/index.ts +5 -0
- package/src/lib/components/tag-input/tag-input-clear.ts +60 -0
- package/src/lib/components/tag-input/tag-input-count.ts +42 -0
- package/src/lib/components/tag-input/tag-input-field.ts +121 -0
- package/src/lib/components/tag-input/tag-input-tag.ts +70 -0
- package/src/lib/components/tag-input/tag-input.ts +118 -0
- package/src/lib/components/textarea/README.md +80 -0
- package/src/lib/components/textarea/index.ts +1 -0
- package/src/lib/components/textarea/textarea.ts +41 -0
- package/src/lib/components/theme-toggle/README.md +258 -0
- package/src/lib/components/theme-toggle/index.ts +4 -0
- package/src/lib/components/theme-toggle/theme-field.ts +40 -0
- package/src/lib/components/theme-toggle/theme-select.ts +56 -0
- package/src/lib/components/theme-toggle/theme-toggle.ts +76 -0
- package/src/lib/components/theme-toggle/theme.service.ts +81 -0
- package/src/lib/components/time-picker/README.md +188 -0
- package/src/lib/components/time-picker/index.ts +5 -0
- package/src/lib/components/time-picker/time-picker-clock.ts +195 -0
- package/src/lib/components/time-picker/time-picker-input.ts +174 -0
- package/src/lib/components/time-picker/time-picker-period.ts +89 -0
- package/src/lib/components/time-picker/time-picker-separator.ts +20 -0
- package/src/lib/components/time-picker/time-picker.ts +87 -0
- package/src/lib/components/timeline/README.md +177 -0
- package/src/lib/components/timeline/index.ts +8 -0
- package/src/lib/components/timeline/timeline-connector.ts +29 -0
- package/src/lib/components/timeline/timeline-content.ts +26 -0
- package/src/lib/components/timeline/timeline-description.ts +17 -0
- package/src/lib/components/timeline/timeline-dot.ts +45 -0
- package/src/lib/components/timeline/timeline-item.ts +28 -0
- package/src/lib/components/timeline/timeline-time.ts +17 -0
- package/src/lib/components/timeline/timeline-title.ts +17 -0
- package/src/lib/components/timeline/timeline.ts +17 -0
- package/src/lib/components/timezone/index.ts +5 -0
- package/src/lib/components/timezone/timezone-badge.ts +85 -0
- package/src/lib/components/timezone/timezone-button.ts +104 -0
- package/src/lib/components/timezone/timezone-display.ts +105 -0
- package/src/lib/components/timezone/timezone-select.ts +87 -0
- package/src/lib/components/timezone/timezone.service.ts +233 -0
- package/src/lib/components/toast/README.md +151 -0
- package/src/lib/components/toast/index.ts +8 -0
- package/src/lib/components/toast/toast-action.ts +27 -0
- package/src/lib/components/toast/toast-close.ts +29 -0
- package/src/lib/components/toast/toast-description.ts +17 -0
- package/src/lib/components/toast/toast-stack.ts +95 -0
- package/src/lib/components/toast/toast-title.ts +17 -0
- package/src/lib/components/toast/toast.ts +64 -0
- package/src/lib/components/toast/toast.types.ts +24 -0
- package/src/lib/components/toast/toaster.ts +67 -0
- package/src/lib/components/toggle/README.md +72 -0
- package/src/lib/components/toggle/index.ts +1 -0
- package/src/lib/components/toggle/toggle.ts +53 -0
- package/src/lib/components/toggle-group/README.md +101 -0
- package/src/lib/components/toggle-group/index.ts +2 -0
- package/src/lib/components/toggle-group/toggle-group-item.ts +62 -0
- package/src/lib/components/toggle-group/toggle-group.ts +53 -0
- package/src/lib/components/toolbar/README.md +76 -0
- package/src/lib/components/toolbar/index.ts +4 -0
- package/src/lib/components/toolbar/toolbar-separator.ts +32 -0
- package/src/lib/components/toolbar/toolbar-widget-group.ts +35 -0
- package/src/lib/components/toolbar/toolbar-widget.ts +48 -0
- package/src/lib/components/toolbar/toolbar.ts +44 -0
- package/src/lib/components/tooltip/ANIMATIONS.md +274 -0
- package/src/lib/components/tooltip/README.md +100 -0
- package/src/lib/components/tooltip/index.ts +3 -0
- package/src/lib/components/tooltip/tooltip-manager.ts +194 -0
- package/src/lib/components/tooltip/tooltip-trigger.ts +148 -0
- package/src/lib/components/tooltip/tooltip.ts +72 -0
- package/src/lib/components/tour-guide/README.md +158 -0
- package/src/lib/components/tour-guide/index.ts +2 -0
- package/src/lib/components/tour-guide/tour-guide.ts +492 -0
- package/src/lib/components/transfer-list/README.md +98 -0
- package/src/lib/components/transfer-list/index.ts +5 -0
- package/src/lib/components/transfer-list/transfer-list-types.ts +11 -0
- package/src/lib/components/transfer-list/transfer-list.ts +434 -0
- package/src/lib/components/tree/README.md +358 -0
- package/src/lib/components/tree/TODO.md +94 -0
- package/src/lib/components/tree/index.ts +6 -0
- package/src/lib/components/tree/tree-item-group.ts +40 -0
- package/src/lib/components/tree/tree-item-icon.ts +17 -0
- package/src/lib/components/tree/tree-item-trigger-icon.ts +26 -0
- package/src/lib/components/tree/tree-item-trigger.ts +51 -0
- package/src/lib/components/tree/tree-item.ts +64 -0
- package/src/lib/components/tree/tree.ts +21 -0
- package/src/lib/components/video-player/README.md +275 -0
- package/src/lib/components/video-player/index.ts +14 -0
- package/src/lib/components/video-player/video-player-big-play-button.ts +35 -0
- package/src/lib/components/video-player/video-player-buffering.ts +36 -0
- package/src/lib/components/video-player/video-player-controls.ts +28 -0
- package/src/lib/components/video-player/video-player-fullscreen-button.ts +38 -0
- package/src/lib/components/video-player/video-player-pip-button.ts +37 -0
- package/src/lib/components/video-player/video-player-play-button.ts +37 -0
- package/src/lib/components/video-player/video-player-progress.ts +56 -0
- package/src/lib/components/video-player/video-player-skip-button.ts +44 -0
- package/src/lib/components/video-player/video-player-speed-button.ts +74 -0
- package/src/lib/components/video-player/video-player-time.ts +31 -0
- package/src/lib/components/video-player/video-player-types.ts +13 -0
- package/src/lib/components/video-player/video-player-video.ts +127 -0
- package/src/lib/components/video-player/video-player-volume.ts +61 -0
- package/src/lib/components/video-player/video-player.ts +139 -0
- package/src/lib/components/virtual-list/README.md +120 -0
- package/src/lib/components/virtual-list/index.ts +2 -0
- package/src/lib/components/virtual-list/virtual-list-types.ts +9 -0
- package/src/lib/components/virtual-list/virtual-list.ts +174 -0
- package/src/lib/layouts/auth-layout.ts +30 -0
- package/src/lib/layouts/index.ts +3 -0
- package/src/lib/layouts/sidebar-layout.ts +37 -0
- package/src/lib/layouts/stacked-layout/README.md +84 -0
- package/src/lib/layouts/stacked-layout/index.ts +1 -0
- package/src/lib/layouts/stacked-layout/stacked-layout.ts +39 -0
- package/tsconfig.json +28 -0
- package/tsconfig.lib.json +12 -0
- package/tsconfig.lib.prod.json +9 -0
- package/fesm2022/semantic-components-ui-lab.mjs +0 -36277
- package/fesm2022/semantic-components-ui-lab.mjs.map +0 -1
- package/types/semantic-components-ui-lab.d.ts +0 -7454
|
@@ -0,0 +1,549 @@
|
|
|
1
|
+
import {
|
|
2
|
+
afterNextRender,
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
ElementRef,
|
|
7
|
+
inject,
|
|
8
|
+
input,
|
|
9
|
+
output,
|
|
10
|
+
signal,
|
|
11
|
+
viewChild,
|
|
12
|
+
ViewEncapsulation,
|
|
13
|
+
} from '@angular/core';
|
|
14
|
+
import { DomSanitizer, type SafeHtml } from '@angular/platform-browser';
|
|
15
|
+
import { cn } from '@semantic-components/ui';
|
|
16
|
+
import type {
|
|
17
|
+
Annotation,
|
|
18
|
+
AnnotationPoint,
|
|
19
|
+
AnnotationTool,
|
|
20
|
+
} from './image-annotator-types';
|
|
21
|
+
|
|
22
|
+
@Component({
|
|
23
|
+
selector: 'sc-image-annotator',
|
|
24
|
+
template: `
|
|
25
|
+
<div [class]="containerClass()">
|
|
26
|
+
<!-- Toolbar -->
|
|
27
|
+
<div class="flex items-center gap-2 p-2 border-b bg-muted/50">
|
|
28
|
+
<!-- Tool Selection -->
|
|
29
|
+
<div class="flex items-center gap-1 border-r pr-2">
|
|
30
|
+
@for (tool of tools; track tool.id) {
|
|
31
|
+
<button
|
|
32
|
+
type="button"
|
|
33
|
+
[class]="toolButtonClass(tool.id)"
|
|
34
|
+
[attr.aria-pressed]="currentTool() === tool.id"
|
|
35
|
+
[attr.aria-label]="tool.label"
|
|
36
|
+
[title]="tool.label"
|
|
37
|
+
(click)="selectTool(tool.id)"
|
|
38
|
+
>
|
|
39
|
+
<span [innerHTML]="tool.icon"></span>
|
|
40
|
+
</button>
|
|
41
|
+
}
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<!-- Color Selection -->
|
|
45
|
+
<div class="flex items-center gap-1 border-r pr-2">
|
|
46
|
+
@for (color of colors; track color) {
|
|
47
|
+
<button
|
|
48
|
+
type="button"
|
|
49
|
+
class="w-6 h-6 rounded border-2 transition-transform hover:scale-110"
|
|
50
|
+
[class.ring-2]="currentColor() === color"
|
|
51
|
+
[class.ring-offset-1]="currentColor() === color"
|
|
52
|
+
[style.background-color]="color"
|
|
53
|
+
[attr.aria-pressed]="currentColor() === color"
|
|
54
|
+
[attr.aria-label]="'Color ' + color"
|
|
55
|
+
(click)="selectColor(color)"
|
|
56
|
+
></button>
|
|
57
|
+
}
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<!-- Line Width -->
|
|
61
|
+
<div class="flex items-center gap-2 border-r pr-2">
|
|
62
|
+
<span class="text-xs text-muted-foreground">Width:</span>
|
|
63
|
+
<input
|
|
64
|
+
type="range"
|
|
65
|
+
min="1"
|
|
66
|
+
max="20"
|
|
67
|
+
[value]="lineWidth()"
|
|
68
|
+
class="w-20 h-1 accent-primary"
|
|
69
|
+
(input)="onLineWidthChange($event)"
|
|
70
|
+
/>
|
|
71
|
+
<span class="text-xs w-4">{{ lineWidth() }}</span>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<!-- Actions -->
|
|
75
|
+
<div class="flex items-center gap-1 ml-auto">
|
|
76
|
+
<button
|
|
77
|
+
type="button"
|
|
78
|
+
class="p-2 rounded hover:bg-muted transition-colors"
|
|
79
|
+
title="Undo"
|
|
80
|
+
[disabled]="annotations().length === 0"
|
|
81
|
+
(click)="undo()"
|
|
82
|
+
>
|
|
83
|
+
<span [innerHTML]="undoIcon"></span>
|
|
84
|
+
</button>
|
|
85
|
+
<button
|
|
86
|
+
type="button"
|
|
87
|
+
class="p-2 rounded hover:bg-muted transition-colors"
|
|
88
|
+
title="Clear All"
|
|
89
|
+
[disabled]="annotations().length === 0"
|
|
90
|
+
(click)="clearAll()"
|
|
91
|
+
>
|
|
92
|
+
<span [innerHTML]="clearIcon"></span>
|
|
93
|
+
</button>
|
|
94
|
+
<button
|
|
95
|
+
type="button"
|
|
96
|
+
class="p-2 rounded hover:bg-muted transition-colors"
|
|
97
|
+
title="Download"
|
|
98
|
+
(click)="download()"
|
|
99
|
+
>
|
|
100
|
+
<span [innerHTML]="downloadIcon"></span>
|
|
101
|
+
</button>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
|
|
105
|
+
<!-- Canvas Container -->
|
|
106
|
+
<div class="relative overflow-hidden" [style.cursor]="getCursor()">
|
|
107
|
+
<canvas
|
|
108
|
+
#imageCanvas
|
|
109
|
+
class="absolute top-0 left-0"
|
|
110
|
+
[width]="canvasWidth()"
|
|
111
|
+
[height]="canvasHeight()"
|
|
112
|
+
></canvas>
|
|
113
|
+
<canvas
|
|
114
|
+
#annotationCanvas
|
|
115
|
+
class="absolute top-0 left-0"
|
|
116
|
+
[width]="canvasWidth()"
|
|
117
|
+
[height]="canvasHeight()"
|
|
118
|
+
(mousedown)="onMouseDown($event)"
|
|
119
|
+
(mousemove)="onMouseMove($event)"
|
|
120
|
+
(mouseup)="onMouseUp($event)"
|
|
121
|
+
(mouseleave)="onMouseUp($event)"
|
|
122
|
+
></canvas>
|
|
123
|
+
@if (!imageLoaded()) {
|
|
124
|
+
<div
|
|
125
|
+
class="flex items-center justify-center bg-muted"
|
|
126
|
+
[style.width.px]="canvasWidth()"
|
|
127
|
+
[style.height.px]="canvasHeight()"
|
|
128
|
+
>
|
|
129
|
+
<span class="text-muted-foreground">Loading image...</span>
|
|
130
|
+
</div>
|
|
131
|
+
}
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
`,
|
|
135
|
+
styles: `
|
|
136
|
+
:host {
|
|
137
|
+
display: block;
|
|
138
|
+
}
|
|
139
|
+
`,
|
|
140
|
+
encapsulation: ViewEncapsulation.None,
|
|
141
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
142
|
+
})
|
|
143
|
+
export class ScImageAnnotator {
|
|
144
|
+
private readonly sanitizer = inject(DomSanitizer);
|
|
145
|
+
|
|
146
|
+
readonly imageCanvasRef =
|
|
147
|
+
viewChild<ElementRef<HTMLCanvasElement>>('imageCanvas');
|
|
148
|
+
readonly annotationCanvasRef =
|
|
149
|
+
viewChild<ElementRef<HTMLCanvasElement>>('annotationCanvas');
|
|
150
|
+
|
|
151
|
+
readonly src = input.required<string>();
|
|
152
|
+
readonly width = input(600);
|
|
153
|
+
readonly height = input(400);
|
|
154
|
+
readonly class = input<string>('');
|
|
155
|
+
|
|
156
|
+
readonly annotationsChange = output<Annotation[]>();
|
|
157
|
+
readonly save = output<string>();
|
|
158
|
+
|
|
159
|
+
protected readonly annotations = signal<Annotation[]>([]);
|
|
160
|
+
protected readonly currentTool = signal<AnnotationTool>('pen');
|
|
161
|
+
protected readonly currentColor = signal('#ef4444');
|
|
162
|
+
protected readonly lineWidth = signal(3);
|
|
163
|
+
protected readonly imageLoaded = signal(false);
|
|
164
|
+
|
|
165
|
+
private isDrawing = false;
|
|
166
|
+
private currentAnnotation: Annotation | null = null;
|
|
167
|
+
private startPoint: AnnotationPoint | null = null;
|
|
168
|
+
|
|
169
|
+
private trustHtml(html: string): SafeHtml {
|
|
170
|
+
return this.sanitizer.bypassSecurityTrustHtml(html);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
readonly tools: { id: AnnotationTool; label: string; icon: SafeHtml }[] = [];
|
|
174
|
+
|
|
175
|
+
readonly colors = [
|
|
176
|
+
'#ef4444',
|
|
177
|
+
'#f97316',
|
|
178
|
+
'#eab308',
|
|
179
|
+
'#22c55e',
|
|
180
|
+
'#3b82f6',
|
|
181
|
+
'#8b5cf6',
|
|
182
|
+
'#000000',
|
|
183
|
+
'#ffffff',
|
|
184
|
+
];
|
|
185
|
+
|
|
186
|
+
readonly undoIcon: SafeHtml;
|
|
187
|
+
readonly clearIcon: SafeHtml;
|
|
188
|
+
readonly downloadIcon: SafeHtml;
|
|
189
|
+
|
|
190
|
+
protected readonly canvasWidth = computed(() => this.width());
|
|
191
|
+
protected readonly canvasHeight = computed(() => this.height());
|
|
192
|
+
|
|
193
|
+
protected readonly containerClass = computed(() =>
|
|
194
|
+
cn('border rounded-lg overflow-hidden bg-background', this.class()),
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
constructor() {
|
|
198
|
+
this.tools = [
|
|
199
|
+
{
|
|
200
|
+
id: 'pen',
|
|
201
|
+
label: 'Pen',
|
|
202
|
+
icon: this.trustHtml(
|
|
203
|
+
`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"/></svg>`,
|
|
204
|
+
),
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
id: 'line',
|
|
208
|
+
label: 'Line',
|
|
209
|
+
icon: this.trustHtml(
|
|
210
|
+
`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="5" y1="19" x2="19" y2="5"/></svg>`,
|
|
211
|
+
),
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
id: 'rectangle',
|
|
215
|
+
label: 'Rectangle',
|
|
216
|
+
icon: this.trustHtml(
|
|
217
|
+
`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/></svg>`,
|
|
218
|
+
),
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
id: 'circle',
|
|
222
|
+
label: 'Circle',
|
|
223
|
+
icon: this.trustHtml(
|
|
224
|
+
`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/></svg>`,
|
|
225
|
+
),
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
id: 'arrow',
|
|
229
|
+
label: 'Arrow',
|
|
230
|
+
icon: this.trustHtml(
|
|
231
|
+
`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="5" y1="12" x2="19" y2="12"/><polyline points="12 5 19 12 12 19"/></svg>`,
|
|
232
|
+
),
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
id: 'eraser',
|
|
236
|
+
label: 'Eraser',
|
|
237
|
+
icon: this.trustHtml(
|
|
238
|
+
`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21"/><path d="M22 21H7"/><path d="m5 11 9 9"/></svg>`,
|
|
239
|
+
),
|
|
240
|
+
},
|
|
241
|
+
];
|
|
242
|
+
|
|
243
|
+
this.undoIcon = this.trustHtml(
|
|
244
|
+
`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 7v6h6"/><path d="M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"/></svg>`,
|
|
245
|
+
);
|
|
246
|
+
this.clearIcon = this.trustHtml(
|
|
247
|
+
`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/></svg>`,
|
|
248
|
+
);
|
|
249
|
+
this.downloadIcon = this.trustHtml(
|
|
250
|
+
`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/></svg>`,
|
|
251
|
+
);
|
|
252
|
+
|
|
253
|
+
afterNextRender(() => {
|
|
254
|
+
this.loadImage();
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
private loadImage(): void {
|
|
259
|
+
const imageCanvas = this.imageCanvasRef()?.nativeElement;
|
|
260
|
+
if (!imageCanvas) return;
|
|
261
|
+
|
|
262
|
+
const ctx = imageCanvas.getContext('2d');
|
|
263
|
+
if (!ctx) return;
|
|
264
|
+
|
|
265
|
+
const img = new Image();
|
|
266
|
+
img.crossOrigin = 'anonymous';
|
|
267
|
+
img.onload = () => {
|
|
268
|
+
ctx.drawImage(img, 0, 0, this.canvasWidth(), this.canvasHeight());
|
|
269
|
+
this.imageLoaded.set(true);
|
|
270
|
+
};
|
|
271
|
+
img.onerror = () => {
|
|
272
|
+
ctx.fillStyle = '#f3f4f6';
|
|
273
|
+
ctx.fillRect(0, 0, this.canvasWidth(), this.canvasHeight());
|
|
274
|
+
ctx.fillStyle = '#9ca3af';
|
|
275
|
+
ctx.font = '14px sans-serif';
|
|
276
|
+
ctx.textAlign = 'center';
|
|
277
|
+
ctx.fillText(
|
|
278
|
+
'Failed to load image',
|
|
279
|
+
this.canvasWidth() / 2,
|
|
280
|
+
this.canvasHeight() / 2,
|
|
281
|
+
);
|
|
282
|
+
this.imageLoaded.set(true);
|
|
283
|
+
};
|
|
284
|
+
img.src = this.src();
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
protected toolButtonClass(tool: AnnotationTool): string {
|
|
288
|
+
return cn(
|
|
289
|
+
'p-2 rounded transition-colors',
|
|
290
|
+
this.currentTool() === tool
|
|
291
|
+
? 'bg-primary text-primary-foreground'
|
|
292
|
+
: 'hover:bg-muted',
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
selectTool(tool: AnnotationTool): void {
|
|
297
|
+
this.currentTool.set(tool);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
selectColor(color: string): void {
|
|
301
|
+
this.currentColor.set(color);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
onLineWidthChange(event: Event): void {
|
|
305
|
+
const input = event.target as HTMLInputElement;
|
|
306
|
+
this.lineWidth.set(parseInt(input.value, 10));
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
getCursor(): string {
|
|
310
|
+
return this.currentTool() === 'eraser' ? 'cell' : 'crosshair';
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
onMouseDown(event: MouseEvent): void {
|
|
314
|
+
const canvas = this.annotationCanvasRef()?.nativeElement;
|
|
315
|
+
if (!canvas) return;
|
|
316
|
+
|
|
317
|
+
const rect = canvas.getBoundingClientRect();
|
|
318
|
+
const x = event.clientX - rect.left;
|
|
319
|
+
const y = event.clientY - rect.top;
|
|
320
|
+
|
|
321
|
+
this.isDrawing = true;
|
|
322
|
+
this.startPoint = { x, y };
|
|
323
|
+
|
|
324
|
+
if (this.currentTool() === 'eraser') {
|
|
325
|
+
this.eraseAt(x, y);
|
|
326
|
+
} else {
|
|
327
|
+
this.currentAnnotation = {
|
|
328
|
+
id: crypto.randomUUID(),
|
|
329
|
+
tool: this.currentTool(),
|
|
330
|
+
points: [{ x, y }],
|
|
331
|
+
color: this.currentColor(),
|
|
332
|
+
lineWidth: this.lineWidth(),
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
onMouseMove(event: MouseEvent): void {
|
|
338
|
+
if (!this.isDrawing) return;
|
|
339
|
+
|
|
340
|
+
const canvas = this.annotationCanvasRef()?.nativeElement;
|
|
341
|
+
if (!canvas) return;
|
|
342
|
+
|
|
343
|
+
const rect = canvas.getBoundingClientRect();
|
|
344
|
+
const x = event.clientX - rect.left;
|
|
345
|
+
const y = event.clientY - rect.top;
|
|
346
|
+
|
|
347
|
+
if (this.currentTool() === 'eraser') {
|
|
348
|
+
this.eraseAt(x, y);
|
|
349
|
+
} else if (this.currentAnnotation) {
|
|
350
|
+
if (this.currentTool() === 'pen') {
|
|
351
|
+
this.currentAnnotation.points.push({ x, y });
|
|
352
|
+
} else {
|
|
353
|
+
this.currentAnnotation.points = [this.startPoint!, { x, y }];
|
|
354
|
+
}
|
|
355
|
+
this.redrawAnnotations();
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
onMouseUp(event: MouseEvent): void {
|
|
360
|
+
if (!this.isDrawing) return;
|
|
361
|
+
|
|
362
|
+
if (this.currentAnnotation && this.currentTool() !== 'eraser') {
|
|
363
|
+
this.annotations.update((anns) => [...anns, this.currentAnnotation!]);
|
|
364
|
+
this.annotationsChange.emit(this.annotations());
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
this.isDrawing = false;
|
|
368
|
+
this.currentAnnotation = null;
|
|
369
|
+
this.startPoint = null;
|
|
370
|
+
this.redrawAnnotations();
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
private eraseAt(x: number, y: number): void {
|
|
374
|
+
const eraseRadius = this.lineWidth() * 2;
|
|
375
|
+
this.annotations.update((anns) =>
|
|
376
|
+
anns.filter((ann) => {
|
|
377
|
+
for (const point of ann.points) {
|
|
378
|
+
const distance = Math.sqrt((point.x - x) ** 2 + (point.y - y) ** 2);
|
|
379
|
+
if (distance < eraseRadius) return false;
|
|
380
|
+
}
|
|
381
|
+
return true;
|
|
382
|
+
}),
|
|
383
|
+
);
|
|
384
|
+
this.redrawAnnotations();
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
private redrawAnnotations(): void {
|
|
388
|
+
const canvas = this.annotationCanvasRef()?.nativeElement;
|
|
389
|
+
if (!canvas) return;
|
|
390
|
+
|
|
391
|
+
const ctx = canvas.getContext('2d');
|
|
392
|
+
if (!ctx) return;
|
|
393
|
+
|
|
394
|
+
ctx.clearRect(0, 0, this.canvasWidth(), this.canvasHeight());
|
|
395
|
+
|
|
396
|
+
// Draw saved annotations
|
|
397
|
+
for (const ann of this.annotations()) {
|
|
398
|
+
this.drawAnnotation(ctx, ann);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// Draw current annotation
|
|
402
|
+
if (this.currentAnnotation) {
|
|
403
|
+
this.drawAnnotation(ctx, this.currentAnnotation);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
private drawAnnotation(ctx: CanvasRenderingContext2D, ann: Annotation): void {
|
|
408
|
+
ctx.strokeStyle = ann.color;
|
|
409
|
+
ctx.fillStyle = ann.color;
|
|
410
|
+
ctx.lineWidth = ann.lineWidth;
|
|
411
|
+
ctx.lineCap = 'round';
|
|
412
|
+
ctx.lineJoin = 'round';
|
|
413
|
+
|
|
414
|
+
switch (ann.tool) {
|
|
415
|
+
case 'pen':
|
|
416
|
+
this.drawPen(ctx, ann.points);
|
|
417
|
+
break;
|
|
418
|
+
case 'line':
|
|
419
|
+
this.drawLine(ctx, ann.points);
|
|
420
|
+
break;
|
|
421
|
+
case 'rectangle':
|
|
422
|
+
this.drawRectangle(ctx, ann.points);
|
|
423
|
+
break;
|
|
424
|
+
case 'circle':
|
|
425
|
+
this.drawCircle(ctx, ann.points);
|
|
426
|
+
break;
|
|
427
|
+
case 'arrow':
|
|
428
|
+
this.drawArrow(ctx, ann.points);
|
|
429
|
+
break;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
private drawPen(
|
|
434
|
+
ctx: CanvasRenderingContext2D,
|
|
435
|
+
points: AnnotationPoint[],
|
|
436
|
+
): void {
|
|
437
|
+
if (points.length < 2) return;
|
|
438
|
+
ctx.beginPath();
|
|
439
|
+
ctx.moveTo(points[0].x, points[0].y);
|
|
440
|
+
for (let i = 1; i < points.length; i++) {
|
|
441
|
+
ctx.lineTo(points[i].x, points[i].y);
|
|
442
|
+
}
|
|
443
|
+
ctx.stroke();
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
private drawLine(
|
|
447
|
+
ctx: CanvasRenderingContext2D,
|
|
448
|
+
points: AnnotationPoint[],
|
|
449
|
+
): void {
|
|
450
|
+
if (points.length < 2) return;
|
|
451
|
+
ctx.beginPath();
|
|
452
|
+
ctx.moveTo(points[0].x, points[0].y);
|
|
453
|
+
ctx.lineTo(points[1].x, points[1].y);
|
|
454
|
+
ctx.stroke();
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
private drawRectangle(
|
|
458
|
+
ctx: CanvasRenderingContext2D,
|
|
459
|
+
points: AnnotationPoint[],
|
|
460
|
+
): void {
|
|
461
|
+
if (points.length < 2) return;
|
|
462
|
+
const width = points[1].x - points[0].x;
|
|
463
|
+
const height = points[1].y - points[0].y;
|
|
464
|
+
ctx.strokeRect(points[0].x, points[0].y, width, height);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
private drawCircle(
|
|
468
|
+
ctx: CanvasRenderingContext2D,
|
|
469
|
+
points: AnnotationPoint[],
|
|
470
|
+
): void {
|
|
471
|
+
if (points.length < 2) return;
|
|
472
|
+
const radius = Math.sqrt(
|
|
473
|
+
(points[1].x - points[0].x) ** 2 + (points[1].y - points[0].y) ** 2,
|
|
474
|
+
);
|
|
475
|
+
ctx.beginPath();
|
|
476
|
+
ctx.arc(points[0].x, points[0].y, radius, 0, Math.PI * 2);
|
|
477
|
+
ctx.stroke();
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
private drawArrow(
|
|
481
|
+
ctx: CanvasRenderingContext2D,
|
|
482
|
+
points: AnnotationPoint[],
|
|
483
|
+
): void {
|
|
484
|
+
if (points.length < 2) return;
|
|
485
|
+
const [start, end] = points;
|
|
486
|
+
const headLength = 15;
|
|
487
|
+
const angle = Math.atan2(end.y - start.y, end.x - start.x);
|
|
488
|
+
|
|
489
|
+
ctx.beginPath();
|
|
490
|
+
ctx.moveTo(start.x, start.y);
|
|
491
|
+
ctx.lineTo(end.x, end.y);
|
|
492
|
+
ctx.lineTo(
|
|
493
|
+
end.x - headLength * Math.cos(angle - Math.PI / 6),
|
|
494
|
+
end.y - headLength * Math.sin(angle - Math.PI / 6),
|
|
495
|
+
);
|
|
496
|
+
ctx.moveTo(end.x, end.y);
|
|
497
|
+
ctx.lineTo(
|
|
498
|
+
end.x - headLength * Math.cos(angle + Math.PI / 6),
|
|
499
|
+
end.y - headLength * Math.sin(angle + Math.PI / 6),
|
|
500
|
+
);
|
|
501
|
+
ctx.stroke();
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
undo(): void {
|
|
505
|
+
this.annotations.update((anns) => anns.slice(0, -1));
|
|
506
|
+
this.annotationsChange.emit(this.annotations());
|
|
507
|
+
this.redrawAnnotations();
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
clearAll(): void {
|
|
511
|
+
this.annotations.set([]);
|
|
512
|
+
this.annotationsChange.emit([]);
|
|
513
|
+
this.redrawAnnotations();
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
download(): void {
|
|
517
|
+
const imageCanvas = this.imageCanvasRef()?.nativeElement;
|
|
518
|
+
const annotationCanvas = this.annotationCanvasRef()?.nativeElement;
|
|
519
|
+
if (!imageCanvas || !annotationCanvas) return;
|
|
520
|
+
|
|
521
|
+
// Create combined canvas
|
|
522
|
+
const combinedCanvas = document.createElement('canvas');
|
|
523
|
+
combinedCanvas.width = this.canvasWidth();
|
|
524
|
+
combinedCanvas.height = this.canvasHeight();
|
|
525
|
+
const ctx = combinedCanvas.getContext('2d');
|
|
526
|
+
if (!ctx) return;
|
|
527
|
+
|
|
528
|
+
ctx.drawImage(imageCanvas, 0, 0);
|
|
529
|
+
ctx.drawImage(annotationCanvas, 0, 0);
|
|
530
|
+
|
|
531
|
+
const dataUrl = combinedCanvas.toDataURL('image/png');
|
|
532
|
+
this.save.emit(dataUrl);
|
|
533
|
+
|
|
534
|
+
// Trigger download
|
|
535
|
+
const link = document.createElement('a');
|
|
536
|
+
link.download = 'annotated-image.png';
|
|
537
|
+
link.href = dataUrl;
|
|
538
|
+
link.click();
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
getAnnotations(): Annotation[] {
|
|
542
|
+
return this.annotations();
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
setAnnotations(annotations: Annotation[]): void {
|
|
546
|
+
this.annotations.set(annotations);
|
|
547
|
+
this.redrawAnnotations();
|
|
548
|
+
}
|
|
549
|
+
}
|