@ng-cn/core 1.0.10 → 1.0.12
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/package.json +3 -2
- package/src/app/lib/components/ui/accordion/accordion-content.component.ts +53 -0
- package/src/app/lib/components/ui/accordion/accordion-context.ts +33 -0
- package/src/app/lib/components/ui/accordion/accordion-item.component.ts +86 -0
- package/src/app/lib/components/ui/accordion/accordion-trigger.component.ts +73 -0
- package/src/app/lib/components/ui/accordion/accordion.component.ts +197 -0
- package/src/app/lib/components/ui/accordion/index.ts +15 -0
- package/src/app/lib/components/ui/alert/alert-description.component.ts +33 -0
- package/src/app/lib/components/ui/alert/alert-title.component.ts +30 -0
- package/src/app/lib/components/ui/alert/alert-variants.ts +23 -0
- package/src/app/lib/components/ui/alert/alert.component.ts +50 -0
- package/src/app/lib/components/ui/alert/index.ts +5 -0
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-action.component.ts +44 -0
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-cancel.component.ts +45 -0
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-content.component.ts +146 -0
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-context.ts +14 -0
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-description.component.ts +37 -0
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-footer.component.ts +35 -0
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-header.component.ts +35 -0
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-title.component.ts +37 -0
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-trigger.component.ts +44 -0
- package/src/app/lib/components/ui/alert-dialog/alert-dialog.component.ts +91 -0
- package/src/app/lib/components/ui/alert-dialog/index.ts +11 -0
- package/src/app/lib/components/ui/aspect-ratio/aspect-ratio.component.ts +63 -0
- package/src/app/lib/components/ui/aspect-ratio/index.ts +1 -0
- package/src/app/lib/components/ui/avatar/avatar-fallback.component.ts +34 -0
- package/src/app/lib/components/ui/avatar/avatar-image.component.ts +31 -0
- package/src/app/lib/components/ui/avatar/avatar.component.ts +37 -0
- package/src/app/lib/components/ui/avatar/index.ts +5 -0
- package/src/app/lib/components/ui/avatar/ui-avatar.component.ts +52 -0
- package/src/app/lib/components/ui/badge/badge-variants.ts +28 -0
- package/src/app/lib/components/ui/badge/badge.component.ts +50 -0
- package/src/app/lib/components/ui/badge/index.ts +3 -0
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-ellipsis.component.ts +48 -0
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-item.component.ts +28 -0
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-link.component.ts +32 -0
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-list.component.ts +31 -0
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-page.component.ts +31 -0
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-separator.component.ts +47 -0
- package/src/app/lib/components/ui/breadcrumb/breadcrumb.component.ts +43 -0
- package/src/app/lib/components/ui/breadcrumb/index.ts +8 -0
- package/src/app/lib/components/ui/button/button-variants.ts +38 -0
- package/src/app/lib/components/ui/button/button.component.ts +103 -0
- package/src/app/lib/components/ui/button/index.ts +3 -0
- package/src/app/lib/components/ui/button-group/button-group-variants.ts +24 -0
- package/src/app/lib/components/ui/button-group/button-group.component.ts +57 -0
- package/src/app/lib/components/ui/button-group/index.ts +6 -0
- package/src/app/lib/components/ui/calendar/calendar.component.ts +368 -0
- package/src/app/lib/components/ui/calendar/index.ts +1 -0
- package/src/app/lib/components/ui/card/card-action.component.ts +39 -0
- package/src/app/lib/components/ui/card/card-content.component.ts +31 -0
- package/src/app/lib/components/ui/card/card-description.component.ts +31 -0
- package/src/app/lib/components/ui/card/card-footer.component.ts +34 -0
- package/src/app/lib/components/ui/card/card-header.component.ts +37 -0
- package/src/app/lib/components/ui/card/card-title.component.ts +31 -0
- package/src/app/lib/components/ui/card/card.component.ts +41 -0
- package/src/app/lib/components/ui/card/index.ts +8 -0
- package/src/app/lib/components/ui/carousel/carousel-content.component.ts +38 -0
- package/src/app/lib/components/ui/carousel/carousel-context.ts +18 -0
- package/src/app/lib/components/ui/carousel/carousel-item.component.ts +32 -0
- package/src/app/lib/components/ui/carousel/carousel-next.component.ts +54 -0
- package/src/app/lib/components/ui/carousel/carousel-previous.component.ts +54 -0
- package/src/app/lib/components/ui/carousel/carousel.component.ts +125 -0
- package/src/app/lib/components/ui/carousel/index.ts +7 -0
- package/src/app/lib/components/ui/chart/chart-container.component.ts +81 -0
- package/src/app/lib/components/ui/chart/chart-context.ts +38 -0
- package/src/app/lib/components/ui/chart/chart-legend-content.component.ts +51 -0
- package/src/app/lib/components/ui/chart/chart-legend.component.ts +28 -0
- package/src/app/lib/components/ui/chart/chart-tooltip-content.component.ts +37 -0
- package/src/app/lib/components/ui/chart/chart-tooltip.component.ts +28 -0
- package/src/app/lib/components/ui/chart/chart.component.ts +308 -0
- package/src/app/lib/components/ui/chart/index.ts +16 -0
- package/src/app/lib/components/ui/checkbox/checkbox.component.ts +203 -0
- package/src/app/lib/components/ui/checkbox/index.ts +1 -0
- package/src/app/lib/components/ui/collapsible/collapsible-content.component.ts +58 -0
- package/src/app/lib/components/ui/collapsible/collapsible-context.ts +17 -0
- package/src/app/lib/components/ui/collapsible/collapsible-trigger.component.ts +56 -0
- package/src/app/lib/components/ui/collapsible/collapsible.component.ts +102 -0
- package/src/app/lib/components/ui/collapsible/index.ts +5 -0
- package/src/app/lib/components/ui/combobox/combobox-content.component.ts +59 -0
- package/src/app/lib/components/ui/combobox/combobox-context.ts +49 -0
- package/src/app/lib/components/ui/combobox/combobox-empty.component.ts +35 -0
- package/src/app/lib/components/ui/combobox/combobox-group.component.ts +32 -0
- package/src/app/lib/components/ui/combobox/combobox-input.component.ts +89 -0
- package/src/app/lib/components/ui/combobox/combobox-item.component.ts +129 -0
- package/src/app/lib/components/ui/combobox/combobox-list.component.ts +40 -0
- package/src/app/lib/components/ui/combobox/combobox-trigger.component.ts +53 -0
- package/src/app/lib/components/ui/combobox/combobox-value.component.ts +47 -0
- package/src/app/lib/components/ui/combobox/combobox.component.ts +290 -0
- package/src/app/lib/components/ui/combobox/index.ts +15 -0
- package/src/app/lib/components/ui/command/command-context.ts +24 -0
- package/src/app/lib/components/ui/command/command-dialog.component.ts +69 -0
- package/src/app/lib/components/ui/command/command-empty.component.ts +23 -0
- package/src/app/lib/components/ui/command/command-group.component.ts +66 -0
- package/src/app/lib/components/ui/command/command-input.component.ts +137 -0
- package/src/app/lib/components/ui/command/command-item.component.ts +148 -0
- package/src/app/lib/components/ui/command/command-list.component.ts +30 -0
- package/src/app/lib/components/ui/command/command-separator.component.ts +23 -0
- package/src/app/lib/components/ui/command/command-shortcut.component.ts +23 -0
- package/src/app/lib/components/ui/command/command.component.ts +105 -0
- package/src/app/lib/components/ui/command/index.ts +11 -0
- package/src/app/lib/components/ui/context-menu/context-menu-checkbox-item.component.ts +68 -0
- package/src/app/lib/components/ui/context-menu/context-menu-content.component.ts +213 -0
- package/src/app/lib/components/ui/context-menu/context-menu-context.ts +17 -0
- package/src/app/lib/components/ui/context-menu/context-menu-item.component.ts +63 -0
- package/src/app/lib/components/ui/context-menu/context-menu-label.component.ts +30 -0
- package/src/app/lib/components/ui/context-menu/context-menu-radio-group.component.ts +36 -0
- package/src/app/lib/components/ui/context-menu/context-menu-radio-item.component.ts +71 -0
- package/src/app/lib/components/ui/context-menu/context-menu-separator.component.ts +24 -0
- package/src/app/lib/components/ui/context-menu/context-menu-shortcut.component.ts +23 -0
- package/src/app/lib/components/ui/context-menu/context-menu-sub-content.component.ts +51 -0
- package/src/app/lib/components/ui/context-menu/context-menu-sub-trigger.component.ts +50 -0
- package/src/app/lib/components/ui/context-menu/context-menu-sub.component.ts +31 -0
- package/src/app/lib/components/ui/context-menu/context-menu-trigger.component.ts +51 -0
- package/src/app/lib/components/ui/context-menu/context-menu.component.ts +27 -0
- package/src/app/lib/components/ui/context-menu/index.ts +15 -0
- package/src/app/lib/components/ui/data-table/data-table-content.component.ts +226 -0
- package/src/app/lib/components/ui/data-table/data-table-context.ts +49 -0
- package/src/app/lib/components/ui/data-table/data-table-pagination.component.ts +138 -0
- package/src/app/lib/components/ui/data-table/data-table-search.component.ts +52 -0
- package/src/app/lib/components/ui/data-table/data-table-toolbar.component.ts +27 -0
- package/src/app/lib/components/ui/data-table/data-table-view-options.component.ts +92 -0
- package/src/app/lib/components/ui/data-table/data-table.component.ts +131 -0
- package/src/app/lib/components/ui/data-table/index.ts +16 -0
- package/src/app/lib/components/ui/date-picker/date-picker.component.ts +94 -0
- package/src/app/lib/components/ui/date-picker/index.ts +1 -0
- package/src/app/lib/components/ui/dialog/dialog-close.component.ts +31 -0
- package/src/app/lib/components/ui/dialog/dialog-content.component.ts +177 -0
- package/src/app/lib/components/ui/dialog/dialog-context.ts +15 -0
- package/src/app/lib/components/ui/dialog/dialog-description.component.ts +34 -0
- package/src/app/lib/components/ui/dialog/dialog-footer.component.ts +28 -0
- package/src/app/lib/components/ui/dialog/dialog-header.component.ts +28 -0
- package/src/app/lib/components/ui/dialog/dialog-title.component.ts +34 -0
- package/src/app/lib/components/ui/dialog/dialog-trigger.component.ts +38 -0
- package/src/app/lib/components/ui/dialog/dialog.component.ts +87 -0
- package/src/app/lib/components/ui/dialog/index.ts +10 -0
- package/src/app/lib/components/ui/drawer/drawer-close.component.ts +31 -0
- package/src/app/lib/components/ui/drawer/drawer-content.component.ts +143 -0
- package/src/app/lib/components/ui/drawer/drawer-context.ts +17 -0
- package/src/app/lib/components/ui/drawer/drawer-description.component.ts +33 -0
- package/src/app/lib/components/ui/drawer/drawer-footer.component.ts +28 -0
- package/src/app/lib/components/ui/drawer/drawer-header.component.ts +28 -0
- package/src/app/lib/components/ui/drawer/drawer-title.component.ts +33 -0
- package/src/app/lib/components/ui/drawer/drawer-trigger.component.ts +38 -0
- package/src/app/lib/components/ui/drawer/drawer.component.ts +93 -0
- package/src/app/lib/components/ui/drawer/index.ts +10 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.component.ts +68 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-content.component.ts +234 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-context.ts +15 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-group.component.ts +15 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-item.component.ts +56 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-label.component.ts +30 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.component.ts +42 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.component.ts +71 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-separator.component.ts +24 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.component.ts +23 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.component.ts +51 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.component.ts +53 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-sub.component.ts +31 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-trigger.component.ts +45 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu.component.ts +32 -0
- package/src/app/lib/components/ui/dropdown-menu/index.ts +16 -0
- package/src/app/lib/components/ui/empty/empty-action.component.ts +28 -0
- package/src/app/lib/components/ui/empty/empty-description.component.ts +31 -0
- package/src/app/lib/components/ui/empty/empty-icon.component.ts +31 -0
- package/src/app/lib/components/ui/empty/empty-title.component.ts +28 -0
- package/src/app/lib/components/ui/empty/empty.component.ts +53 -0
- package/src/app/lib/components/ui/empty/index.ts +6 -0
- package/src/app/lib/components/ui/form/form-context.ts +34 -0
- package/src/app/lib/components/ui/form/form-control.component.ts +137 -0
- package/src/app/lib/components/ui/form/form-description.component.ts +37 -0
- package/src/app/lib/components/ui/form/form-field.component.ts +84 -0
- package/src/app/lib/components/ui/form/form-item.component.ts +42 -0
- package/src/app/lib/components/ui/form/form-label.component.ts +58 -0
- package/src/app/lib/components/ui/form/form-message.component.ts +107 -0
- package/src/app/lib/components/ui/form/form.component.ts +123 -0
- package/src/app/lib/components/ui/form/index.ts +17 -0
- package/src/app/lib/components/ui/hover-card/hover-card-content.component.ts +203 -0
- package/src/app/lib/components/ui/hover-card/hover-card-context.ts +25 -0
- package/src/app/lib/components/ui/hover-card/hover-card-trigger.component.ts +160 -0
- package/src/app/lib/components/ui/hover-card/hover-card.component.ts +147 -0
- package/src/app/lib/components/ui/hover-card/index.ts +13 -0
- package/src/app/lib/components/ui/index.ts +551 -0
- package/src/app/lib/components/ui/input/index.ts +1 -0
- package/src/app/lib/components/ui/input/input.component.ts +165 -0
- package/src/app/lib/components/ui/input-group/index.ts +4 -0
- package/src/app/lib/components/ui/input-group/input-group-addon.component.ts +43 -0
- package/src/app/lib/components/ui/input-group/input-group-input.component.ts +33 -0
- package/src/app/lib/components/ui/input-group/input-group.component.ts +53 -0
- package/src/app/lib/components/ui/input-otp/index.ts +14 -0
- package/src/app/lib/components/ui/input-otp/input-otp-context.ts +31 -0
- package/src/app/lib/components/ui/input-otp/input-otp-group.component.ts +23 -0
- package/src/app/lib/components/ui/input-otp/input-otp-separator.component.ts +31 -0
- package/src/app/lib/components/ui/input-otp/input-otp-slot.component.ts +67 -0
- package/src/app/lib/components/ui/input-otp/input-otp.component.ts +240 -0
- package/src/app/lib/components/ui/kbd/index.ts +3 -0
- package/src/app/lib/components/ui/kbd/kbd-variants.ts +23 -0
- package/src/app/lib/components/ui/kbd/kbd.component.ts +50 -0
- package/src/app/lib/components/ui/label/index.ts +1 -0
- package/src/app/lib/components/ui/label/label.component.ts +139 -0
- package/src/app/lib/components/ui/menubar/index.ts +26 -0
- package/src/app/lib/components/ui/menubar/menubar-checkbox-item.component.ts +66 -0
- package/src/app/lib/components/ui/menubar/menubar-content.component.ts +236 -0
- package/src/app/lib/components/ui/menubar/menubar-context.ts +63 -0
- package/src/app/lib/components/ui/menubar/menubar-item.component.ts +60 -0
- package/src/app/lib/components/ui/menubar/menubar-label.component.ts +30 -0
- package/src/app/lib/components/ui/menubar/menubar-menu.component.ts +40 -0
- package/src/app/lib/components/ui/menubar/menubar-radio-group.component.ts +36 -0
- package/src/app/lib/components/ui/menubar/menubar-radio-item.component.ts +66 -0
- package/src/app/lib/components/ui/menubar/menubar-separator.component.ts +24 -0
- package/src/app/lib/components/ui/menubar/menubar-shortcut.component.ts +23 -0
- package/src/app/lib/components/ui/menubar/menubar-sub-content.component.ts +51 -0
- package/src/app/lib/components/ui/menubar/menubar-sub-trigger.component.ts +50 -0
- package/src/app/lib/components/ui/menubar/menubar-sub.component.ts +29 -0
- package/src/app/lib/components/ui/menubar/menubar-trigger.component.ts +132 -0
- package/src/app/lib/components/ui/menubar/menubar.component.ts +158 -0
- package/src/app/lib/components/ui/native-select/index.ts +6 -0
- package/src/app/lib/components/ui/native-select/native-select-variants.ts +23 -0
- package/src/app/lib/components/ui/native-select/native-select.component.ts +74 -0
- package/src/app/lib/components/ui/navigation-menu/index.ts +21 -0
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-content.component.ts +66 -0
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-context.ts +55 -0
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-indicator.component.ts +28 -0
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-item.component.ts +29 -0
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-link.component.ts +43 -0
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-list.component.ts +26 -0
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-trigger-style.ts +7 -0
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-trigger.component.ts +58 -0
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-viewport.component.ts +26 -0
- package/src/app/lib/components/ui/navigation-menu/navigation-menu.component.ts +149 -0
- package/src/app/lib/components/ui/pagination/index.ts +8 -0
- package/src/app/lib/components/ui/pagination/pagination-content.component.ts +28 -0
- package/src/app/lib/components/ui/pagination/pagination-ellipsis.component.ts +47 -0
- package/src/app/lib/components/ui/pagination/pagination-item.component.ts +28 -0
- package/src/app/lib/components/ui/pagination/pagination-link.component.ts +46 -0
- package/src/app/lib/components/ui/pagination/pagination-next.component.ts +54 -0
- package/src/app/lib/components/ui/pagination/pagination-previous.component.ts +54 -0
- package/src/app/lib/components/ui/pagination/pagination.component.ts +48 -0
- package/src/app/lib/components/ui/popover/index.ts +14 -0
- package/src/app/lib/components/ui/popover/popover-anchor.component.ts +64 -0
- package/src/app/lib/components/ui/popover/popover-content.component.ts +231 -0
- package/src/app/lib/components/ui/popover/popover-context.ts +29 -0
- package/src/app/lib/components/ui/popover/popover-trigger.component.ts +100 -0
- package/src/app/lib/components/ui/popover/popover.component.ts +163 -0
- package/src/app/lib/components/ui/progress/index.ts +6 -0
- package/src/app/lib/components/ui/progress/progress.component.ts +212 -0
- package/src/app/lib/components/ui/radio-group/index.ts +10 -0
- package/src/app/lib/components/ui/radio-group/radio-group-context.ts +38 -0
- package/src/app/lib/components/ui/radio-group/radio-group-item.component.ts +298 -0
- package/src/app/lib/components/ui/radio-group/radio-group.component.ts +275 -0
- package/src/app/lib/components/ui/resizable/index.ts +5 -0
- package/src/app/lib/components/ui/resizable/resizable-context.ts +14 -0
- package/src/app/lib/components/ui/resizable/resizable-handle.component.ts +232 -0
- package/src/app/lib/components/ui/resizable/resizable-panel-group.component.ts +140 -0
- package/src/app/lib/components/ui/resizable/resizable-panel.component.ts +77 -0
- package/src/app/lib/components/ui/scroll-area/index.ts +8 -0
- package/src/app/lib/components/ui/scroll-area/scroll-area.component.ts +126 -0
- package/src/app/lib/components/ui/scroll-area/scroll-bar.component.ts +93 -0
- package/src/app/lib/components/ui/segmented/index.ts +13 -0
- package/src/app/lib/components/ui/segmented/segmented-context.ts +11 -0
- package/src/app/lib/components/ui/segmented/segmented-item.component.ts +72 -0
- package/src/app/lib/components/ui/segmented/segmented-variants.ts +40 -0
- package/src/app/lib/components/ui/segmented/segmented.component.ts +99 -0
- package/src/app/lib/components/ui/select/index.ts +19 -0
- package/src/app/lib/components/ui/select/select-content.component.ts +97 -0
- package/src/app/lib/components/ui/select/select-context.ts +53 -0
- package/src/app/lib/components/ui/select/select-group.component.ts +56 -0
- package/src/app/lib/components/ui/select/select-item.component.ts +163 -0
- package/src/app/lib/components/ui/select/select-label.component.ts +32 -0
- package/src/app/lib/components/ui/select/select-separator.component.ts +34 -0
- package/src/app/lib/components/ui/select/select-trigger.component.ts +164 -0
- package/src/app/lib/components/ui/select/select-value.component.ts +49 -0
- package/src/app/lib/components/ui/select/select.component.ts +263 -0
- package/src/app/lib/components/ui/separator/index.ts +6 -0
- package/src/app/lib/components/ui/separator/separator.component.ts +128 -0
- package/src/app/lib/components/ui/sheet/index.ts +11 -0
- package/src/app/lib/components/ui/sheet/sheet-close.component.ts +32 -0
- package/src/app/lib/components/ui/sheet/sheet-content.component.ts +157 -0
- package/src/app/lib/components/ui/sheet/sheet-context.ts +15 -0
- package/src/app/lib/components/ui/sheet/sheet-description.component.ts +34 -0
- package/src/app/lib/components/ui/sheet/sheet-footer.component.ts +28 -0
- package/src/app/lib/components/ui/sheet/sheet-header.component.ts +28 -0
- package/src/app/lib/components/ui/sheet/sheet-title.component.ts +34 -0
- package/src/app/lib/components/ui/sheet/sheet-trigger.component.ts +38 -0
- package/src/app/lib/components/ui/sheet/sheet-variants.ts +22 -0
- package/src/app/lib/components/ui/sheet/sheet.component.ts +97 -0
- package/src/app/lib/components/ui/sidebar/index.ts +41 -0
- package/src/app/lib/components/ui/sidebar/sidebar-content.component.ts +31 -0
- package/src/app/lib/components/ui/sidebar/sidebar-context.ts +33 -0
- package/src/app/lib/components/ui/sidebar/sidebar-footer.component.ts +28 -0
- package/src/app/lib/components/ui/sidebar/sidebar-group-action.component.ts +33 -0
- package/src/app/lib/components/ui/sidebar/sidebar-group-content.component.ts +28 -0
- package/src/app/lib/components/ui/sidebar/sidebar-group-label.component.ts +32 -0
- package/src/app/lib/components/ui/sidebar/sidebar-group.component.ts +28 -0
- package/src/app/lib/components/ui/sidebar/sidebar-header.component.ts +28 -0
- package/src/app/lib/components/ui/sidebar/sidebar-input.component.ts +31 -0
- package/src/app/lib/components/ui/sidebar/sidebar-inset.component.ts +31 -0
- package/src/app/lib/components/ui/sidebar/sidebar-menu-action.component.ts +56 -0
- package/src/app/lib/components/ui/sidebar/sidebar-menu-badge.component.ts +42 -0
- package/src/app/lib/components/ui/sidebar/sidebar-menu-button.component.ts +64 -0
- package/src/app/lib/components/ui/sidebar/sidebar-menu-item.component.ts +32 -0
- package/src/app/lib/components/ui/sidebar/sidebar-menu-skeleton.component.ts +39 -0
- package/src/app/lib/components/ui/sidebar/sidebar-menu-sub-button.component.ts +59 -0
- package/src/app/lib/components/ui/sidebar/sidebar-menu-sub-item.component.ts +25 -0
- package/src/app/lib/components/ui/sidebar/sidebar-menu-sub.component.ts +32 -0
- package/src/app/lib/components/ui/sidebar/sidebar-menu.component.ts +31 -0
- package/src/app/lib/components/ui/sidebar/sidebar-provider.component.ts +141 -0
- package/src/app/lib/components/ui/sidebar/sidebar-rail.component.ts +47 -0
- package/src/app/lib/components/ui/sidebar/sidebar-route-active.service.ts +124 -0
- package/src/app/lib/components/ui/sidebar/sidebar-separator.component.ts +28 -0
- package/src/app/lib/components/ui/sidebar/sidebar-trigger.component.ts +57 -0
- package/src/app/lib/components/ui/sidebar/sidebar.component.ts +130 -0
- package/src/app/lib/components/ui/skeleton/index.ts +1 -0
- package/src/app/lib/components/ui/skeleton/skeleton.component.ts +52 -0
- package/src/app/lib/components/ui/slider/index.ts +6 -0
- package/src/app/lib/components/ui/slider/slider.component.ts +477 -0
- package/src/app/lib/components/ui/spinner/index.ts +3 -0
- package/src/app/lib/components/ui/spinner/spinner-variants.ts +32 -0
- package/src/app/lib/components/ui/spinner/spinner.component.ts +77 -0
- package/src/app/lib/components/ui/switch/index.ts +6 -0
- package/src/app/lib/components/ui/switch/switch.component.ts +282 -0
- package/src/app/lib/components/ui/table/index.ts +9 -0
- package/src/app/lib/components/ui/table/table-body.component.ts +28 -0
- package/src/app/lib/components/ui/table/table-caption.component.ts +28 -0
- package/src/app/lib/components/ui/table/table-cell.component.ts +31 -0
- package/src/app/lib/components/ui/table/table-footer.component.ts +28 -0
- package/src/app/lib/components/ui/table/table-head.component.ts +36 -0
- package/src/app/lib/components/ui/table/table-header.component.ts +28 -0
- package/src/app/lib/components/ui/table/table-row.component.ts +34 -0
- package/src/app/lib/components/ui/table/table.component.ts +52 -0
- package/src/app/lib/components/ui/tabs/index.ts +14 -0
- package/src/app/lib/components/ui/tabs/tabs-content.component.ts +132 -0
- package/src/app/lib/components/ui/tabs/tabs-context.ts +33 -0
- package/src/app/lib/components/ui/tabs/tabs-list.component.ts +228 -0
- package/src/app/lib/components/ui/tabs/tabs-trigger.component.ts +167 -0
- package/src/app/lib/components/ui/tabs/tabs.component.ts +203 -0
- package/src/app/lib/components/ui/textarea/index.ts +1 -0
- package/src/app/lib/components/ui/textarea/textarea.component.ts +44 -0
- package/src/app/lib/components/ui/toast/index.ts +16 -0
- package/src/app/lib/components/ui/toast/toast-action.component.ts +77 -0
- package/src/app/lib/components/ui/toast/toast-description.component.ts +52 -0
- package/src/app/lib/components/ui/toast/toast-title.component.ts +52 -0
- package/src/app/lib/components/ui/toast/toast-variants.ts +24 -0
- package/src/app/lib/components/ui/toast/toast.component.ts +177 -0
- package/src/app/lib/components/ui/toast/toast.service.ts +202 -0
- package/src/app/lib/components/ui/toast/toaster.component.ts +128 -0
- package/src/app/lib/components/ui/toggle/index.ts +6 -0
- package/src/app/lib/components/ui/toggle/toggle-variants.ts +30 -0
- package/src/app/lib/components/ui/toggle/toggle.component.ts +199 -0
- package/src/app/lib/components/ui/toggle-group/index.ts +11 -0
- package/src/app/lib/components/ui/toggle-group/toggle-group-context.ts +48 -0
- package/src/app/lib/components/ui/toggle-group/toggle-group-item.component.ts +241 -0
- package/src/app/lib/components/ui/toggle-group/toggle-group.component.ts +288 -0
- package/src/app/lib/components/ui/tooltip/index.ts +14 -0
- package/src/app/lib/components/ui/tooltip/tooltip-content.component.ts +154 -0
- package/src/app/lib/components/ui/tooltip/tooltip-context.ts +29 -0
- package/src/app/lib/components/ui/tooltip/tooltip-provider.component.ts +95 -0
- package/src/app/lib/components/ui/tooltip/tooltip-trigger.component.ts +138 -0
- package/src/app/lib/components/ui/tooltip/tooltip.component.ts +159 -0
- package/src/app/lib/components/ui/typography/index.ts +13 -0
- package/src/app/lib/components/ui/typography/typography-blockquote.component.ts +31 -0
- package/src/app/lib/components/ui/typography/typography-h1.component.ts +32 -0
- package/src/app/lib/components/ui/typography/typography-h2.component.ts +32 -0
- package/src/app/lib/components/ui/typography/typography-h3.component.ts +29 -0
- package/src/app/lib/components/ui/typography/typography-h4.component.ts +29 -0
- package/src/app/lib/components/ui/typography/typography-inline-code.component.ts +31 -0
- package/src/app/lib/components/ui/typography/typography-large.component.ts +28 -0
- package/src/app/lib/components/ui/typography/typography-lead.component.ts +31 -0
- package/src/app/lib/components/ui/typography/typography-list.component.ts +31 -0
- package/src/app/lib/components/ui/typography/typography-muted.component.ts +28 -0
- package/src/app/lib/components/ui/typography/typography-p.component.ts +29 -0
- package/src/app/lib/components/ui/typography/typography-small.component.ts +28 -0
- package/src/app/lib/index.ts +7 -0
- package/src/app/lib/utils/accessibility/aria-id.service.ts +118 -0
- package/src/app/lib/utils/accessibility/click-outside.directive.ts +85 -0
- package/src/app/lib/utils/accessibility/focus-management.service.ts +231 -0
- package/src/app/lib/utils/accessibility/focus-trap.directive.ts +203 -0
- package/src/app/lib/utils/accessibility/index.ts +23 -0
- package/src/app/lib/utils/accessibility/keyboard-navigation.directive.ts +440 -0
- package/src/app/lib/utils/accessibility/live-region.directive.ts +260 -0
- package/src/app/lib/utils/accessibility/touch-target.directive.ts +81 -0
- package/src/app/lib/utils/accessibility/visually-hidden.component.ts +79 -0
- package/src/app/lib/utils/animation/animated.directive.ts +191 -0
- package/src/app/lib/utils/animation/animation-tokens.service.ts +88 -0
- package/src/app/lib/utils/animation/animation.types.ts +55 -0
- package/src/app/lib/utils/animation/animation.utils.ts +158 -0
- package/src/app/lib/utils/animation/index.ts +17 -0
- package/src/app/lib/utils/animation/presence.component.ts +168 -0
- package/src/app/lib/utils/animation/presence.directive.ts +169 -0
- package/src/app/lib/utils/cn.ts +15 -0
- package/src/app/lib/utils/index.ts +11 -0
- package/src/app/lib/utils/positioning/index.ts +218 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
inject,
|
|
7
|
+
input,
|
|
8
|
+
} from '@angular/core';
|
|
9
|
+
import { buttonVariants } from '../button/button-variants';
|
|
10
|
+
import { ALERT_DIALOG_CONTEXT } from './alert-dialog-context';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* AlertDialogCancel component - cancel button that closes the dialog.
|
|
14
|
+
* Matches shadcn/ui React AlertDialogCancel exactly.
|
|
15
|
+
* Styled as a secondary/outline button.
|
|
16
|
+
* This is the default focus target when AlertDialog opens.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* <AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
20
|
+
*/
|
|
21
|
+
@Component({
|
|
22
|
+
selector: 'AlertDialogCancel',
|
|
23
|
+
template: `<ng-content />`,
|
|
24
|
+
host: {
|
|
25
|
+
'[class]': 'computedClass()',
|
|
26
|
+
'(click)': 'onClick($event)',
|
|
27
|
+
'data-slot': 'alert-dialog-cancel',
|
|
28
|
+
},
|
|
29
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
30
|
+
})
|
|
31
|
+
export class AlertDialogCancel {
|
|
32
|
+
protected readonly context = inject(ALERT_DIALOG_CONTEXT);
|
|
33
|
+
|
|
34
|
+
/** Additional CSS classes to apply */
|
|
35
|
+
readonly class = input<string>('');
|
|
36
|
+
|
|
37
|
+
protected readonly computedClass = computed(() =>
|
|
38
|
+
cn(buttonVariants({ variant: 'outline' }), 'mt-2 sm:mt-0', this.class())
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
onClick(event: Event): void {
|
|
42
|
+
event.stopPropagation();
|
|
43
|
+
this.context.setOpen(false);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { cn, Presence } from '@/lib/utils';
|
|
2
|
+
import { FocusTrapDirective } from '@/lib/utils/accessibility';
|
|
3
|
+
import {
|
|
4
|
+
ChangeDetectionStrategy,
|
|
5
|
+
Component,
|
|
6
|
+
computed,
|
|
7
|
+
effect,
|
|
8
|
+
HostListener,
|
|
9
|
+
inject,
|
|
10
|
+
input,
|
|
11
|
+
OnDestroy,
|
|
12
|
+
} from '@angular/core';
|
|
13
|
+
import { ALERT_DIALOG_CONTEXT } from './alert-dialog-context';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* AlertDialogContent component - the modal content of the alert dialog.
|
|
17
|
+
* Matches shadcn/ui React AlertDialogContent exactly.
|
|
18
|
+
*
|
|
19
|
+
* Features:
|
|
20
|
+
* - Escape key closes the dialog
|
|
21
|
+
* - Overlay/backdrop click does NOT close the dialog
|
|
22
|
+
* - Focus is trapped within the dialog
|
|
23
|
+
* - User must explicitly click Cancel or Action to close
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* <AlertDialogContent>
|
|
27
|
+
* <AlertDialogHeader>
|
|
28
|
+
* <AlertDialogTitle>Delete Account</AlertDialogTitle>
|
|
29
|
+
* <AlertDialogDescription>Are you sure?</AlertDialogDescription>
|
|
30
|
+
* </AlertDialogHeader>
|
|
31
|
+
* <AlertDialogFooter>
|
|
32
|
+
* <AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
33
|
+
* <AlertDialogAction>Delete</AlertDialogAction>
|
|
34
|
+
* </AlertDialogFooter>
|
|
35
|
+
* </AlertDialogContent>
|
|
36
|
+
*/
|
|
37
|
+
@Component({
|
|
38
|
+
selector: 'AlertDialogContent',
|
|
39
|
+
imports: [FocusTrapDirective, Presence],
|
|
40
|
+
template: `
|
|
41
|
+
<Presence [present]="context.open()">
|
|
42
|
+
<!-- Overlay - does NOT close on click -->
|
|
43
|
+
<div
|
|
44
|
+
class="fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
|
|
45
|
+
[attr.data-state]="context.open() ? 'open' : 'closed'"
|
|
46
|
+
aria-hidden="true"
|
|
47
|
+
></div>
|
|
48
|
+
<!-- Content Dialog -->
|
|
49
|
+
<div
|
|
50
|
+
hlmFocusTrap
|
|
51
|
+
[trapFocus]="context.open()"
|
|
52
|
+
[autoFocus]="true"
|
|
53
|
+
[restoreFocus]="false"
|
|
54
|
+
[initialFocus]="'[data-slot=alert-dialog-cancel]'"
|
|
55
|
+
[class]="computedClass()"
|
|
56
|
+
[attr.data-state]="context.open() ? 'open' : 'closed'"
|
|
57
|
+
[attr.id]="context.contentId"
|
|
58
|
+
[attr.aria-labelledby]="context.titleId"
|
|
59
|
+
[attr.aria-describedby]="context.descriptionId"
|
|
60
|
+
role="alertdialog"
|
|
61
|
+
aria-modal="true"
|
|
62
|
+
>
|
|
63
|
+
<ng-content />
|
|
64
|
+
</div>
|
|
65
|
+
</Presence>
|
|
66
|
+
`,
|
|
67
|
+
host: {
|
|
68
|
+
class: 'contents',
|
|
69
|
+
},
|
|
70
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
71
|
+
})
|
|
72
|
+
export class AlertDialogContent implements OnDestroy {
|
|
73
|
+
protected readonly context = inject(ALERT_DIALOG_CONTEXT);
|
|
74
|
+
|
|
75
|
+
/** Additional CSS classes */
|
|
76
|
+
readonly class = input<string>('');
|
|
77
|
+
|
|
78
|
+
/** Previous body overflow for restoration */
|
|
79
|
+
private previousBodyOverflow = '';
|
|
80
|
+
|
|
81
|
+
protected readonly computedClass = computed(() =>
|
|
82
|
+
cn(
|
|
83
|
+
'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200',
|
|
84
|
+
'data-[state=open]:animate-in data-[state=closed]:animate-out',
|
|
85
|
+
'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
|
|
86
|
+
'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',
|
|
87
|
+
'data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]',
|
|
88
|
+
'data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]',
|
|
89
|
+
'sm:rounded-lg',
|
|
90
|
+
this.class()
|
|
91
|
+
)
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
constructor() {
|
|
95
|
+
// Handle body scroll lock based on open state
|
|
96
|
+
effect(() => {
|
|
97
|
+
const isOpen = this.context.open();
|
|
98
|
+
if (isOpen) {
|
|
99
|
+
this.lockBodyScroll();
|
|
100
|
+
} else {
|
|
101
|
+
this.unlockBodyScroll();
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
private lockBodyScroll(): void {
|
|
107
|
+
if (typeof document !== 'undefined') {
|
|
108
|
+
this.previousBodyOverflow = document.body.style.overflow;
|
|
109
|
+
document.body.style.overflow = 'hidden';
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
private unlockBodyScroll(): void {
|
|
114
|
+
if (typeof document !== 'undefined') {
|
|
115
|
+
document.body.style.overflow = this.previousBodyOverflow;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
ngOnDestroy(): void {
|
|
120
|
+
// Restore body scroll
|
|
121
|
+
this.unlockBodyScroll();
|
|
122
|
+
// Restore focus to trigger element
|
|
123
|
+
this.restoreFocus();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@HostListener('document:keydown.escape')
|
|
127
|
+
onEscapeKey(): void {
|
|
128
|
+
if (this.context.open()) {
|
|
129
|
+
this.close();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
private close(): void {
|
|
134
|
+
this.restoreFocus();
|
|
135
|
+
this.context.setOpen(false);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
private restoreFocus(): void {
|
|
139
|
+
const triggerEl = this.context.triggerElement();
|
|
140
|
+
if (triggerEl) {
|
|
141
|
+
setTimeout(() => {
|
|
142
|
+
triggerEl.focus();
|
|
143
|
+
}, 0);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { InjectionToken, WritableSignal } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
export interface AlertDialogContextValue {
|
|
4
|
+
open: WritableSignal<boolean>;
|
|
5
|
+
setOpen: (open: boolean) => void;
|
|
6
|
+
/** Unique IDs for ARIA relationships */
|
|
7
|
+
titleId: string;
|
|
8
|
+
descriptionId: string;
|
|
9
|
+
contentId: string;
|
|
10
|
+
/** Trigger element reference for focus restoration */
|
|
11
|
+
triggerElement: WritableSignal<HTMLElement | null>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const ALERT_DIALOG_CONTEXT = new InjectionToken<AlertDialogContextValue>('ALERT_DIALOG_CONTEXT');
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
inject,
|
|
7
|
+
input,
|
|
8
|
+
} from '@angular/core';
|
|
9
|
+
import { ALERT_DIALOG_CONTEXT } from './alert-dialog-context';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* AlertDialogDescription component - description text of the alert dialog.
|
|
13
|
+
* Matches shadcn/ui React AlertDialogDescription exactly.
|
|
14
|
+
* Automatically links to dialog via aria-describedby.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <AlertDialogDescription>This action cannot be undone.</AlertDialogDescription>
|
|
18
|
+
*/
|
|
19
|
+
@Component({
|
|
20
|
+
selector: 'AlertDialogDescription',
|
|
21
|
+
template: `<ng-content />`,
|
|
22
|
+
host: {
|
|
23
|
+
'[class]': 'computedClass()',
|
|
24
|
+
'[attr.id]': 'context.descriptionId',
|
|
25
|
+
},
|
|
26
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
27
|
+
})
|
|
28
|
+
export class AlertDialogDescription {
|
|
29
|
+
protected readonly context = inject(ALERT_DIALOG_CONTEXT);
|
|
30
|
+
|
|
31
|
+
/** Additional CSS classes to apply */
|
|
32
|
+
readonly class = input<string>('');
|
|
33
|
+
|
|
34
|
+
protected readonly computedClass = computed(() =>
|
|
35
|
+
cn('text-sm text-muted-foreground', this.class())
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
input,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* AlertDialogFooter component - footer area of the alert dialog.
|
|
11
|
+
* Matches shadcn/ui React AlertDialogFooter exactly.
|
|
12
|
+
* Contains action and cancel buttons.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <AlertDialogFooter>
|
|
16
|
+
* <AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
17
|
+
* <AlertDialogAction>Delete</AlertDialogAction>
|
|
18
|
+
* </AlertDialogFooter>
|
|
19
|
+
*/
|
|
20
|
+
@Component({
|
|
21
|
+
selector: 'AlertDialogFooter',
|
|
22
|
+
template: `<ng-content />`,
|
|
23
|
+
host: {
|
|
24
|
+
'[class]': 'computedClass()',
|
|
25
|
+
},
|
|
26
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
27
|
+
})
|
|
28
|
+
export class AlertDialogFooter {
|
|
29
|
+
/** Additional CSS classes to apply */
|
|
30
|
+
readonly class = input<string>('');
|
|
31
|
+
|
|
32
|
+
protected readonly computedClass = computed(() =>
|
|
33
|
+
cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', this.class())
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
input,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* AlertDialogHeader component - header area of the alert dialog.
|
|
11
|
+
* Matches shadcn/ui React AlertDialogHeader exactly.
|
|
12
|
+
* Contains title and description elements.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <AlertDialogHeader>
|
|
16
|
+
* <AlertDialogTitle>Delete Account</AlertDialogTitle>
|
|
17
|
+
* <AlertDialogDescription>Are you absolutely sure?</AlertDialogDescription>
|
|
18
|
+
* </AlertDialogHeader>
|
|
19
|
+
*/
|
|
20
|
+
@Component({
|
|
21
|
+
selector: 'AlertDialogHeader',
|
|
22
|
+
template: `<ng-content />`,
|
|
23
|
+
host: {
|
|
24
|
+
'[class]': 'computedClass()',
|
|
25
|
+
},
|
|
26
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
27
|
+
})
|
|
28
|
+
export class AlertDialogHeader {
|
|
29
|
+
/** Additional CSS classes to apply */
|
|
30
|
+
readonly class = input<string>('');
|
|
31
|
+
|
|
32
|
+
protected readonly computedClass = computed(() =>
|
|
33
|
+
cn('flex flex-col space-y-2 text-center sm:text-left', this.class())
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
inject,
|
|
7
|
+
input,
|
|
8
|
+
} from '@angular/core';
|
|
9
|
+
import { ALERT_DIALOG_CONTEXT } from './alert-dialog-context';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* AlertDialogTitle component - title text of the alert dialog.
|
|
13
|
+
* Matches shadcn/ui React AlertDialogTitle exactly.
|
|
14
|
+
* Automatically links to dialog via aria-labelledby.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <AlertDialogTitle>Delete Account?</AlertDialogTitle>
|
|
18
|
+
*/
|
|
19
|
+
@Component({
|
|
20
|
+
selector: 'AlertDialogTitle',
|
|
21
|
+
template: `<ng-content />`,
|
|
22
|
+
host: {
|
|
23
|
+
'[class]': 'computedClass()',
|
|
24
|
+
'[attr.id]': 'context.titleId',
|
|
25
|
+
},
|
|
26
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
27
|
+
})
|
|
28
|
+
export class AlertDialogTitle {
|
|
29
|
+
protected readonly context = inject(ALERT_DIALOG_CONTEXT);
|
|
30
|
+
|
|
31
|
+
/** Additional CSS classes to apply */
|
|
32
|
+
readonly class = input<string>('');
|
|
33
|
+
|
|
34
|
+
protected readonly computedClass = computed(() =>
|
|
35
|
+
cn('text-lg font-semibold', this.class())
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
ElementRef,
|
|
5
|
+
inject,
|
|
6
|
+
input,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
import { ALERT_DIALOG_CONTEXT } from './alert-dialog-context';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* AlertDialogTrigger component - element that opens the alert dialog.
|
|
12
|
+
* Matches shadcn/ui React AlertDialogTrigger exactly.
|
|
13
|
+
* Saves the trigger element for focus restoration when dialog closes.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* <AlertDialogTrigger>
|
|
17
|
+
* <Button variant="destructive">Delete</Button>
|
|
18
|
+
* </AlertDialogTrigger>
|
|
19
|
+
*/
|
|
20
|
+
@Component({
|
|
21
|
+
selector: 'AlertDialogTrigger',
|
|
22
|
+
template: `<ng-content />`,
|
|
23
|
+
host: {
|
|
24
|
+
'(click)': 'onClick($event)',
|
|
25
|
+
'[attr.aria-haspopup]': '"dialog"',
|
|
26
|
+
'[attr.aria-expanded]': 'context.open()',
|
|
27
|
+
'[attr.aria-controls]': 'context.contentId',
|
|
28
|
+
},
|
|
29
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
30
|
+
})
|
|
31
|
+
export class AlertDialogTrigger {
|
|
32
|
+
protected readonly context = inject(ALERT_DIALOG_CONTEXT);
|
|
33
|
+
private readonly elementRef = inject(ElementRef<HTMLElement>);
|
|
34
|
+
|
|
35
|
+
/** Render as child (for custom trigger elements) */
|
|
36
|
+
readonly asChild = input<boolean>(false);
|
|
37
|
+
|
|
38
|
+
onClick(event: Event): void {
|
|
39
|
+
event.stopPropagation();
|
|
40
|
+
// Save trigger element for focus restoration when dialog closes
|
|
41
|
+
this.context.triggerElement.set(this.elementRef.nativeElement);
|
|
42
|
+
this.context.setOpen(true);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { AriaIdService } from '@/lib/utils/accessibility';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
forwardRef,
|
|
6
|
+
inject,
|
|
7
|
+
input,
|
|
8
|
+
output,
|
|
9
|
+
signal,
|
|
10
|
+
} from '@angular/core';
|
|
11
|
+
import { ALERT_DIALOG_CONTEXT, type AlertDialogContextValue } from './alert-dialog-context';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* AlertDialog component - a modal dialog for important actions.
|
|
15
|
+
* Matches shadcn/ui React AlertDialog exactly.
|
|
16
|
+
* Follows Radix UI AlertDialog behavior:
|
|
17
|
+
* - Escape key closes the dialog
|
|
18
|
+
* - Overlay/backdrop click does NOT close the dialog
|
|
19
|
+
* - User can explicitly click Cancel or Action to close
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* <AlertDialog>
|
|
23
|
+
* <AlertDialogTrigger>
|
|
24
|
+
* <Button variant="destructive">Delete Account</Button>
|
|
25
|
+
* </AlertDialogTrigger>
|
|
26
|
+
* <AlertDialogContent>
|
|
27
|
+
* <AlertDialogHeader>
|
|
28
|
+
* <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
|
|
29
|
+
* <AlertDialogDescription>This action cannot be undone.</AlertDialogDescription>
|
|
30
|
+
* </AlertDialogHeader>
|
|
31
|
+
* <AlertDialogFooter>
|
|
32
|
+
* <AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
33
|
+
* <AlertDialogAction>Continue</AlertDialogAction>
|
|
34
|
+
* </AlertDialogFooter>
|
|
35
|
+
* </AlertDialogContent>
|
|
36
|
+
* </AlertDialog>
|
|
37
|
+
*/
|
|
38
|
+
@Component({
|
|
39
|
+
selector: 'AlertDialog',
|
|
40
|
+
template: `<ng-content />`,
|
|
41
|
+
providers: [
|
|
42
|
+
{
|
|
43
|
+
provide: ALERT_DIALOG_CONTEXT,
|
|
44
|
+
useExisting: forwardRef(() => AlertDialog),
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
48
|
+
})
|
|
49
|
+
export class AlertDialog implements AlertDialogContextValue {
|
|
50
|
+
private readonly ariaIdService = inject(AriaIdService);
|
|
51
|
+
|
|
52
|
+
/** Default open state */
|
|
53
|
+
readonly defaultOpen = input<boolean>(false);
|
|
54
|
+
|
|
55
|
+
/** Controlled open state */
|
|
56
|
+
readonly controlledOpen = input<boolean | undefined>(undefined, { alias: 'open' });
|
|
57
|
+
|
|
58
|
+
/** Open change event emitted when dialog state changes */
|
|
59
|
+
readonly openChange = output<boolean>();
|
|
60
|
+
|
|
61
|
+
/** Internal open state signal */
|
|
62
|
+
readonly open = signal(false);
|
|
63
|
+
|
|
64
|
+
/** ARIA IDs for accessibility relationships */
|
|
65
|
+
private readonly ariaIds = this.ariaIdService.generateDialogIds('alertdialog');
|
|
66
|
+
readonly titleId = this.ariaIds.titleId;
|
|
67
|
+
readonly descriptionId = this.ariaIds.descriptionId;
|
|
68
|
+
readonly contentId = this.ariaIds.contentId;
|
|
69
|
+
|
|
70
|
+
/** Reference to trigger element for focus restoration */
|
|
71
|
+
readonly triggerElement = signal<HTMLElement | null>(null);
|
|
72
|
+
|
|
73
|
+
constructor() {
|
|
74
|
+
if (this.defaultOpen()) {
|
|
75
|
+
this.open.set(true);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** Set the open state and emit change event */
|
|
80
|
+
setOpen(open: boolean): void {
|
|
81
|
+
if (this.controlledOpen() === undefined) {
|
|
82
|
+
this.open.set(open);
|
|
83
|
+
}
|
|
84
|
+
this.openChange.emit(open);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Get current open state */
|
|
88
|
+
isOpen(): boolean {
|
|
89
|
+
return this.controlledOpen() !== undefined ? this.controlledOpen()! : this.open();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { AlertDialogAction } from './alert-dialog-action.component';
|
|
2
|
+
export { AlertDialogCancel } from './alert-dialog-cancel.component';
|
|
3
|
+
export { AlertDialogContent } from './alert-dialog-content.component';
|
|
4
|
+
export { ALERT_DIALOG_CONTEXT, type AlertDialogContextValue } from './alert-dialog-context';
|
|
5
|
+
export { AlertDialogDescription } from './alert-dialog-description.component';
|
|
6
|
+
export { AlertDialogFooter } from './alert-dialog-footer.component';
|
|
7
|
+
export { AlertDialogHeader } from './alert-dialog-header.component';
|
|
8
|
+
export { AlertDialogTitle } from './alert-dialog-title.component';
|
|
9
|
+
export { AlertDialogTrigger } from './alert-dialog-trigger.component';
|
|
10
|
+
export { AlertDialog } from './alert-dialog.component';
|
|
11
|
+
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
input,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* AspectRatio component that maintains a fixed aspect ratio for its content.
|
|
11
|
+
* Matches shadcn/ui React AspectRatio exactly.
|
|
12
|
+
* Follows Radix UI AspectRatio specification.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <!-- 16:9 aspect ratio (default) -->
|
|
16
|
+
* <AspectRatio [ratio]="16/9">
|
|
17
|
+
* <img src="image.jpg" alt="Image" class="object-cover w-full h-full" />
|
|
18
|
+
* </AspectRatio>
|
|
19
|
+
*
|
|
20
|
+
* <!-- Square aspect ratio -->
|
|
21
|
+
* <AspectRatio [ratio]="1">
|
|
22
|
+
* <div class="bg-muted flex items-center justify-center">Square</div>
|
|
23
|
+
* </AspectRatio>
|
|
24
|
+
*
|
|
25
|
+
* <!-- 4:3 aspect ratio -->
|
|
26
|
+
* <AspectRatio [ratio]="4/3">
|
|
27
|
+
* <video src="video.mp4"></video>
|
|
28
|
+
* </AspectRatio>
|
|
29
|
+
*/
|
|
30
|
+
@Component({
|
|
31
|
+
selector: 'AspectRatio',
|
|
32
|
+
template: `
|
|
33
|
+
<div class="absolute inset-0 h-full w-full">
|
|
34
|
+
<ng-content />
|
|
35
|
+
</div>
|
|
36
|
+
`,
|
|
37
|
+
host: {
|
|
38
|
+
'[class]': 'computedClass()',
|
|
39
|
+
'[style.padding-bottom]': 'paddingBottom()',
|
|
40
|
+
'[style.position]': '"relative"',
|
|
41
|
+
'[style.display]': '"block"',
|
|
42
|
+
'[style.width]': '"100%"',
|
|
43
|
+
},
|
|
44
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
45
|
+
})
|
|
46
|
+
export class AspectRatio {
|
|
47
|
+
/** The desired aspect ratio (width / height). Defaults to 16/9 */
|
|
48
|
+
readonly ratio = input<number>(16 / 9);
|
|
49
|
+
|
|
50
|
+
/** Additional CSS classes to apply */
|
|
51
|
+
readonly class = input<string>('');
|
|
52
|
+
|
|
53
|
+
/** Calculate padding-bottom for aspect ratio */
|
|
54
|
+
protected readonly paddingBottom = computed(() => {
|
|
55
|
+
const r = this.ratio();
|
|
56
|
+
return r > 0 ? `${(1 / r) * 100}%` : '56.25%';
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
/** Computed class combining base styles and custom classes */
|
|
60
|
+
protected readonly computedClass = computed(() =>
|
|
61
|
+
cn('relative block w-full', this.class())
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AspectRatio } from './aspect-ratio.component';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
input,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Avatar fallback component.
|
|
11
|
+
* Shown when the image fails to load or is not provided.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <AvatarFallback>JD</AvatarFallback>
|
|
15
|
+
*/
|
|
16
|
+
@Component({
|
|
17
|
+
selector: 'AvatarFallback',
|
|
18
|
+
template: `<ng-content />`,
|
|
19
|
+
host: {
|
|
20
|
+
'[class]': 'computedClass()',
|
|
21
|
+
'data-slot': 'avatar-fallback',
|
|
22
|
+
},
|
|
23
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
24
|
+
})
|
|
25
|
+
export class AvatarFallback {
|
|
26
|
+
readonly class = input<string>('');
|
|
27
|
+
|
|
28
|
+
protected readonly computedClass = computed(() =>
|
|
29
|
+
cn(
|
|
30
|
+
'bg-muted flex size-full items-center justify-center rounded-full text-xs',
|
|
31
|
+
this.class()
|
|
32
|
+
)
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
input,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Avatar image component.
|
|
11
|
+
* The image to display for the avatar.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <AvatarImage src="/avatar.png" alt="User avatar" />
|
|
15
|
+
*/
|
|
16
|
+
@Component({
|
|
17
|
+
selector: 'AvatarImage',
|
|
18
|
+
template: `<ng-content />`,
|
|
19
|
+
host: {
|
|
20
|
+
'[class]': 'computedClass()',
|
|
21
|
+
'data-slot': 'avatar-image',
|
|
22
|
+
},
|
|
23
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
24
|
+
})
|
|
25
|
+
export class AvatarImage {
|
|
26
|
+
readonly class = input<string>('');
|
|
27
|
+
|
|
28
|
+
protected readonly computedClass = computed(() =>
|
|
29
|
+
cn('aspect-square size-full', this.class())
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
input,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Avatar container component.
|
|
11
|
+
* Wraps the avatar image and fallback.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <Avatar>
|
|
15
|
+
* <img AvatarImage src="/avatar.png" alt="User" />
|
|
16
|
+
* <AvatarFallback>JD</AvatarFallback>
|
|
17
|
+
* </Avatar>
|
|
18
|
+
*/
|
|
19
|
+
@Component({
|
|
20
|
+
selector: 'Avatar',
|
|
21
|
+
template: `<ng-content />`,
|
|
22
|
+
host: {
|
|
23
|
+
'[class]': 'computedClass()',
|
|
24
|
+
'data-slot': 'avatar',
|
|
25
|
+
},
|
|
26
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
27
|
+
})
|
|
28
|
+
export class Avatar {
|
|
29
|
+
readonly class = input<string>('');
|
|
30
|
+
|
|
31
|
+
protected readonly computedClass = computed(() =>
|
|
32
|
+
cn(
|
|
33
|
+
'relative flex size-8 shrink-0 overflow-hidden rounded-full',
|
|
34
|
+
this.class()
|
|
35
|
+
)
|
|
36
|
+
);
|
|
37
|
+
}
|