@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,87 @@
|
|
|
1
|
+
import { AriaIdService } from '@/lib/utils/accessibility';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
forwardRef,
|
|
7
|
+
inject,
|
|
8
|
+
input,
|
|
9
|
+
output,
|
|
10
|
+
signal,
|
|
11
|
+
} from '@angular/core';
|
|
12
|
+
import { DIALOG_CONTEXT, type DialogContextValue } from './dialog-context';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Dialog component - root container for modal dialogs.
|
|
16
|
+
* Matches shadcn/ui React Dialog exactly.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* <Dialog>
|
|
20
|
+
* <DialogTrigger>
|
|
21
|
+
* <Button variant="outline">Open Dialog</Button>
|
|
22
|
+
* </DialogTrigger>
|
|
23
|
+
* <DialogContent>
|
|
24
|
+
* <DialogHeader>
|
|
25
|
+
* <DialogTitle>Dialog Title</DialogTitle>
|
|
26
|
+
* <DialogDescription>Dialog description here.</DialogDescription>
|
|
27
|
+
* </DialogHeader>
|
|
28
|
+
* <DialogFooter>
|
|
29
|
+
* <Button>Save changes</Button>
|
|
30
|
+
* </DialogFooter>
|
|
31
|
+
* </DialogContent>
|
|
32
|
+
* </Dialog>
|
|
33
|
+
*/
|
|
34
|
+
@Component({
|
|
35
|
+
selector: 'Dialog',
|
|
36
|
+
template: `<ng-content />`,
|
|
37
|
+
providers: [
|
|
38
|
+
{
|
|
39
|
+
provide: DIALOG_CONTEXT,
|
|
40
|
+
useExisting: forwardRef(() => Dialog),
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
44
|
+
})
|
|
45
|
+
export class Dialog implements DialogContextValue {
|
|
46
|
+
private readonly ariaIdService = inject(AriaIdService);
|
|
47
|
+
|
|
48
|
+
/** Default open state */
|
|
49
|
+
readonly defaultOpen = input<boolean>(false);
|
|
50
|
+
|
|
51
|
+
/** Controlled open state */
|
|
52
|
+
readonly controlledOpen = input<boolean | undefined>(undefined, { alias: 'open' });
|
|
53
|
+
|
|
54
|
+
/** Modal mode - prevents interaction with outside elements */
|
|
55
|
+
readonly modal = input<boolean>(true);
|
|
56
|
+
|
|
57
|
+
/** Open change event */
|
|
58
|
+
readonly openChange = output<boolean>();
|
|
59
|
+
|
|
60
|
+
readonly open = signal(false);
|
|
61
|
+
|
|
62
|
+
/** ARIA IDs for accessibility relationships */
|
|
63
|
+
private readonly ariaIds = this.ariaIdService.generateDialogIds('dialog');
|
|
64
|
+
readonly titleId = this.ariaIds.titleId;
|
|
65
|
+
readonly descriptionId = this.ariaIds.descriptionId;
|
|
66
|
+
readonly contentId = this.ariaIds.contentId;
|
|
67
|
+
|
|
68
|
+
/** Reference to trigger element for focus restoration */
|
|
69
|
+
readonly triggerElement = signal<HTMLElement | null>(null);
|
|
70
|
+
|
|
71
|
+
constructor() {
|
|
72
|
+
if (this.defaultOpen()) {
|
|
73
|
+
this.open.set(true);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
setOpen(open: boolean): void {
|
|
78
|
+
if (this.controlledOpen() === undefined) {
|
|
79
|
+
this.open.set(open);
|
|
80
|
+
}
|
|
81
|
+
this.openChange.emit(open);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
readonly isOpen = computed(() =>
|
|
85
|
+
this.controlledOpen() !== undefined ? this.controlledOpen()! : this.open()
|
|
86
|
+
);
|
|
87
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { DialogClose } from './dialog-close.component';
|
|
2
|
+
export { DialogContent } from './dialog-content.component';
|
|
3
|
+
export { DIALOG_CONTEXT, type DialogContextValue } from './dialog-context';
|
|
4
|
+
export { DialogDescription } from './dialog-description.component';
|
|
5
|
+
export { DialogFooter } from './dialog-footer.component';
|
|
6
|
+
export { DialogHeader } from './dialog-header.component';
|
|
7
|
+
export { DialogTitle } from './dialog-title.component';
|
|
8
|
+
export { DialogTrigger } from './dialog-trigger.component';
|
|
9
|
+
export { Dialog } from './dialog.component';
|
|
10
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
inject,
|
|
5
|
+
input,
|
|
6
|
+
} from '@angular/core';
|
|
7
|
+
import { DRAWER_CONTEXT } from './drawer-context';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* DrawerClose component - button that closes the drawer.
|
|
11
|
+
* Matches shadcn/ui React DrawerClose exactly.
|
|
12
|
+
*/
|
|
13
|
+
@Component({
|
|
14
|
+
selector: 'DrawerClose',
|
|
15
|
+
template: `<ng-content />`,
|
|
16
|
+
host: {
|
|
17
|
+
'(click)': 'onClick($event)',
|
|
18
|
+
},
|
|
19
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
20
|
+
})
|
|
21
|
+
export class DrawerClose {
|
|
22
|
+
protected readonly context = inject(DRAWER_CONTEXT);
|
|
23
|
+
|
|
24
|
+
/** Render as child */
|
|
25
|
+
readonly asChild = input<boolean>(false);
|
|
26
|
+
|
|
27
|
+
onClick(event: Event): void {
|
|
28
|
+
event.stopPropagation();
|
|
29
|
+
this.context.setOpen(false);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { cn, Presence } from '@/lib/utils';
|
|
2
|
+
import { FocusTrapDirective } from '@/lib/utils/accessibility';
|
|
3
|
+
import {
|
|
4
|
+
afterNextRender,
|
|
5
|
+
ChangeDetectionStrategy,
|
|
6
|
+
Component,
|
|
7
|
+
computed,
|
|
8
|
+
effect,
|
|
9
|
+
ElementRef,
|
|
10
|
+
inject,
|
|
11
|
+
Injector,
|
|
12
|
+
input,
|
|
13
|
+
OnDestroy,
|
|
14
|
+
viewChild,
|
|
15
|
+
} from '@angular/core';
|
|
16
|
+
import { DRAWER_CONTEXT } from './drawer-context';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* DrawerContent component - the content of the drawer.
|
|
20
|
+
* Matches shadcn/ui React DrawerContent exactly with enhanced accessibility.
|
|
21
|
+
* Includes focus trap, ARIA relationships, and focus restoration.
|
|
22
|
+
*/
|
|
23
|
+
@Component({
|
|
24
|
+
selector: 'DrawerContent',
|
|
25
|
+
imports: [FocusTrapDirective, Presence],
|
|
26
|
+
template: `
|
|
27
|
+
<Presence [present]="context.open()">
|
|
28
|
+
<!-- Overlay -->
|
|
29
|
+
<div
|
|
30
|
+
class="fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
|
|
31
|
+
[attr.data-state]="context.open() ? 'open' : 'closed'"
|
|
32
|
+
(click)="onOverlayClick($event)"
|
|
33
|
+
></div>
|
|
34
|
+
<!-- Content -->
|
|
35
|
+
<div
|
|
36
|
+
#contentEl
|
|
37
|
+
[class]="computedClass()"
|
|
38
|
+
[attr.data-state]="context.open() ? 'open' : 'closed'"
|
|
39
|
+
role="dialog"
|
|
40
|
+
aria-modal="true"
|
|
41
|
+
[attr.id]="context.contentId"
|
|
42
|
+
[attr.aria-labelledby]="context.titleId"
|
|
43
|
+
[attr.aria-describedby]="context.descriptionId"
|
|
44
|
+
hlmFocusTrap
|
|
45
|
+
[trapFocus]="context.open()"
|
|
46
|
+
(keydown.escape)="onEscapeKey()"
|
|
47
|
+
>
|
|
48
|
+
<!-- Handle -->
|
|
49
|
+
<div class="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"></div>
|
|
50
|
+
<ng-content />
|
|
51
|
+
</div>
|
|
52
|
+
</Presence>
|
|
53
|
+
`,
|
|
54
|
+
host: {
|
|
55
|
+
class: 'contents',
|
|
56
|
+
},
|
|
57
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
58
|
+
})
|
|
59
|
+
export class DrawerContent implements OnDestroy {
|
|
60
|
+
protected readonly context = inject(DRAWER_CONTEXT);
|
|
61
|
+
private readonly contentEl = viewChild<ElementRef<HTMLElement>>('contentEl');
|
|
62
|
+
private readonly injector = inject(Injector);
|
|
63
|
+
|
|
64
|
+
/** Additional CSS classes */
|
|
65
|
+
readonly class = input<string>('');
|
|
66
|
+
|
|
67
|
+
/** Previous body overflow style for restoration */
|
|
68
|
+
private previousBodyOverflow = '';
|
|
69
|
+
|
|
70
|
+
constructor() {
|
|
71
|
+
// Handle body scroll lock and focus restoration
|
|
72
|
+
effect(() => {
|
|
73
|
+
if (this.context.open()) {
|
|
74
|
+
this.lockBodyScroll();
|
|
75
|
+
// Focus first element when opened (browser-only, deferred)
|
|
76
|
+
afterNextRender(() => {
|
|
77
|
+
this.focusFirstElement();
|
|
78
|
+
}, { injector: this.injector });
|
|
79
|
+
} else {
|
|
80
|
+
this.unlockBodyScroll();
|
|
81
|
+
this.restoreFocus();
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
ngOnDestroy(): void {
|
|
87
|
+
this.unlockBodyScroll();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
protected readonly computedClass = computed(() => {
|
|
91
|
+
const directionClasses = {
|
|
92
|
+
top: 'inset-x-0 top-0 mb-24 rounded-b-[10px] border-b data-[state=open]:slide-in-from-top data-[state=closed]:slide-out-to-top',
|
|
93
|
+
bottom: 'inset-x-0 bottom-0 mt-24 rounded-t-[10px] border-t data-[state=open]:slide-in-from-bottom data-[state=closed]:slide-out-to-bottom',
|
|
94
|
+
left: 'inset-y-0 left-0 mr-24 w-auto rounded-r-[10px] border-r data-[state=open]:slide-in-from-left data-[state=closed]:slide-out-to-left',
|
|
95
|
+
right: 'inset-y-0 right-0 ml-24 w-auto rounded-l-[10px] border-l data-[state=open]:slide-in-from-right data-[state=closed]:slide-out-to-right',
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
return cn(
|
|
99
|
+
'fixed z-50 flex flex-col bg-background text-foreground',
|
|
100
|
+
'data-[state=open]:animate-in data-[state=closed]:animate-out',
|
|
101
|
+
'data-[state=open]:duration-500 data-[state=closed]:duration-300',
|
|
102
|
+
directionClasses[this.context.direction],
|
|
103
|
+
this.class()
|
|
104
|
+
);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
onOverlayClick(event: Event): void {
|
|
108
|
+
event.stopPropagation();
|
|
109
|
+
this.context.setOpen(false);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
onEscapeKey(): void {
|
|
113
|
+
this.context.setOpen(false);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
private focusFirstElement(): void {
|
|
117
|
+
setTimeout(() => {
|
|
118
|
+
const content = this.contentEl()?.nativeElement;
|
|
119
|
+
if (content) {
|
|
120
|
+
const focusable = content.querySelector(
|
|
121
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
122
|
+
) as HTMLElement;
|
|
123
|
+
focusable?.focus();
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
private restoreFocus(): void {
|
|
129
|
+
const trigger = this.context.triggerElement();
|
|
130
|
+
if (trigger) {
|
|
131
|
+
setTimeout(() => trigger.focus());
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
private lockBodyScroll(): void {
|
|
136
|
+
this.previousBodyOverflow = document.body.style.overflow;
|
|
137
|
+
document.body.style.overflow = 'hidden';
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
private unlockBodyScroll(): void {
|
|
141
|
+
document.body.style.overflow = this.previousBodyOverflow;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { InjectionToken, WritableSignal } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
export interface DrawerContextValue {
|
|
4
|
+
open: WritableSignal<boolean>;
|
|
5
|
+
setOpen: (open: boolean) => void;
|
|
6
|
+
direction: 'top' | 'right' | 'bottom' | 'left';
|
|
7
|
+
/** ARIA ID for the title element */
|
|
8
|
+
titleId: string;
|
|
9
|
+
/** ARIA ID for the description element */
|
|
10
|
+
descriptionId: string;
|
|
11
|
+
/** ARIA ID for the content element */
|
|
12
|
+
contentId: string;
|
|
13
|
+
/** Reference to the trigger element for focus restoration */
|
|
14
|
+
triggerElement: WritableSignal<HTMLElement | null>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const DRAWER_CONTEXT = new InjectionToken<DrawerContextValue>('DRAWER_CONTEXT');
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
inject,
|
|
7
|
+
input,
|
|
8
|
+
} from '@angular/core';
|
|
9
|
+
import { DRAWER_CONTEXT } from './drawer-context';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* DrawerDescription component - description text of the drawer.
|
|
13
|
+
* Matches shadcn/ui React DrawerDescription exactly with ARIA support.
|
|
14
|
+
*/
|
|
15
|
+
@Component({
|
|
16
|
+
selector: 'DrawerDescription',
|
|
17
|
+
template: `<ng-content />`,
|
|
18
|
+
host: {
|
|
19
|
+
'[class]': 'computedClass()',
|
|
20
|
+
'[attr.id]': 'context.descriptionId',
|
|
21
|
+
},
|
|
22
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
23
|
+
})
|
|
24
|
+
export class DrawerDescription {
|
|
25
|
+
protected readonly context = inject(DRAWER_CONTEXT);
|
|
26
|
+
|
|
27
|
+
/** Additional CSS classes */
|
|
28
|
+
readonly class = input<string>('');
|
|
29
|
+
|
|
30
|
+
protected readonly computedClass = computed(() =>
|
|
31
|
+
cn('text-sm text-muted-foreground', this.class())
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
input,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* DrawerFooter component - footer area of the drawer.
|
|
11
|
+
* Matches shadcn/ui React DrawerFooter exactly.
|
|
12
|
+
*/
|
|
13
|
+
@Component({
|
|
14
|
+
selector: 'DrawerFooter',
|
|
15
|
+
template: `<ng-content />`,
|
|
16
|
+
host: {
|
|
17
|
+
'[class]': 'computedClass()',
|
|
18
|
+
},
|
|
19
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
20
|
+
})
|
|
21
|
+
export class DrawerFooter {
|
|
22
|
+
/** Additional CSS classes */
|
|
23
|
+
readonly class = input<string>('');
|
|
24
|
+
|
|
25
|
+
protected readonly computedClass = computed(() =>
|
|
26
|
+
cn('mt-auto flex flex-col gap-2 p-4', this.class())
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
input,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* DrawerHeader component - header area of the drawer.
|
|
11
|
+
* Matches shadcn/ui React DrawerHeader exactly.
|
|
12
|
+
*/
|
|
13
|
+
@Component({
|
|
14
|
+
selector: 'DrawerHeader',
|
|
15
|
+
template: `<ng-content />`,
|
|
16
|
+
host: {
|
|
17
|
+
'[class]': 'computedClass()',
|
|
18
|
+
},
|
|
19
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
20
|
+
})
|
|
21
|
+
export class DrawerHeader {
|
|
22
|
+
/** Additional CSS classes */
|
|
23
|
+
readonly class = input<string>('');
|
|
24
|
+
|
|
25
|
+
protected readonly computedClass = computed(() =>
|
|
26
|
+
cn('grid gap-1.5 p-4 text-center sm:text-left', this.class())
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
inject,
|
|
7
|
+
input,
|
|
8
|
+
} from '@angular/core';
|
|
9
|
+
import { DRAWER_CONTEXT } from './drawer-context';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* DrawerTitle component - title text of the drawer.
|
|
13
|
+
* Matches shadcn/ui React DrawerTitle exactly with ARIA support.
|
|
14
|
+
*/
|
|
15
|
+
@Component({
|
|
16
|
+
selector: 'DrawerTitle',
|
|
17
|
+
template: `<ng-content />`,
|
|
18
|
+
host: {
|
|
19
|
+
'[class]': 'computedClass()',
|
|
20
|
+
'[attr.id]': 'context.titleId',
|
|
21
|
+
},
|
|
22
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
23
|
+
})
|
|
24
|
+
export class DrawerTitle {
|
|
25
|
+
protected readonly context = inject(DRAWER_CONTEXT);
|
|
26
|
+
|
|
27
|
+
/** Additional CSS classes */
|
|
28
|
+
readonly class = input<string>('');
|
|
29
|
+
|
|
30
|
+
protected readonly computedClass = computed(() =>
|
|
31
|
+
cn('text-lg font-semibold leading-none tracking-tight', this.class())
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
ElementRef,
|
|
5
|
+
inject,
|
|
6
|
+
input,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
import { DRAWER_CONTEXT } from './drawer-context';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* DrawerTrigger component - element that opens the drawer.
|
|
12
|
+
* Matches shadcn/ui React DrawerTrigger exactly with enhanced accessibility.
|
|
13
|
+
*/
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'DrawerTrigger',
|
|
16
|
+
template: `<ng-content />`,
|
|
17
|
+
host: {
|
|
18
|
+
'(click)': 'onClick($event)',
|
|
19
|
+
'[attr.aria-controls]': 'context.contentId',
|
|
20
|
+
'[attr.aria-expanded]': 'context.open()',
|
|
21
|
+
'[attr.aria-haspopup]': '"dialog"',
|
|
22
|
+
},
|
|
23
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
24
|
+
})
|
|
25
|
+
export class DrawerTrigger {
|
|
26
|
+
protected readonly context = inject(DRAWER_CONTEXT);
|
|
27
|
+
private readonly elementRef = inject(ElementRef<HTMLElement>);
|
|
28
|
+
|
|
29
|
+
/** Render as child */
|
|
30
|
+
readonly asChild = input<boolean>(false);
|
|
31
|
+
|
|
32
|
+
onClick(event: Event): void {
|
|
33
|
+
event.stopPropagation();
|
|
34
|
+
// Save trigger element for focus restoration
|
|
35
|
+
this.context.triggerElement.set(this.elementRef.nativeElement);
|
|
36
|
+
this.context.setOpen(true);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
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 { DRAWER_CONTEXT, type DrawerContextValue } from './drawer-context';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Drawer component - a modal drawer that slides up from the bottom.
|
|
15
|
+
* Matches shadcn/ui React Drawer exactly with enhanced accessibility.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* <Drawer>
|
|
19
|
+
* <DrawerTrigger>
|
|
20
|
+
* <Button variant="outline">Open Drawer</Button>
|
|
21
|
+
* </DrawerTrigger>
|
|
22
|
+
* <DrawerContent>
|
|
23
|
+
* <DrawerHeader>
|
|
24
|
+
* <DrawerTitle>Drawer Title</DrawerTitle>
|
|
25
|
+
* <DrawerDescription>Description</DrawerDescription>
|
|
26
|
+
* </DrawerHeader>
|
|
27
|
+
* Content here...
|
|
28
|
+
* <DrawerFooter>
|
|
29
|
+
* <Button>Submit</Button>
|
|
30
|
+
* <DrawerClose>
|
|
31
|
+
* <Button variant="outline">Cancel</Button>
|
|
32
|
+
* </DrawerClose>
|
|
33
|
+
* </DrawerFooter>
|
|
34
|
+
* </DrawerContent>
|
|
35
|
+
* </Drawer>
|
|
36
|
+
*/
|
|
37
|
+
@Component({
|
|
38
|
+
selector: 'Drawer',
|
|
39
|
+
template: `<ng-content />`,
|
|
40
|
+
providers: [
|
|
41
|
+
{
|
|
42
|
+
provide: DRAWER_CONTEXT,
|
|
43
|
+
useExisting: forwardRef(() => Drawer),
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
47
|
+
})
|
|
48
|
+
export class Drawer implements DrawerContextValue {
|
|
49
|
+
private readonly ariaIdService = inject(AriaIdService);
|
|
50
|
+
private readonly ariaIds = this.ariaIdService.generateDialogIds('drawer');
|
|
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
|
+
/** Direction the drawer appears from */
|
|
59
|
+
readonly direction: 'top' | 'right' | 'bottom' | 'left' = 'bottom';
|
|
60
|
+
|
|
61
|
+
/** Whether to show the handle bar */
|
|
62
|
+
readonly shouldScaleBackground = input<boolean>(true);
|
|
63
|
+
|
|
64
|
+
/** Open change event */
|
|
65
|
+
readonly openChange = output<boolean>();
|
|
66
|
+
|
|
67
|
+
readonly open = signal(false);
|
|
68
|
+
|
|
69
|
+
/** ARIA IDs for accessibility */
|
|
70
|
+
readonly titleId = this.ariaIds.titleId;
|
|
71
|
+
readonly descriptionId = this.ariaIds.descriptionId;
|
|
72
|
+
readonly contentId = this.ariaIds.contentId;
|
|
73
|
+
|
|
74
|
+
/** Reference to the trigger element for focus restoration */
|
|
75
|
+
readonly triggerElement = signal<HTMLElement | null>(null);
|
|
76
|
+
|
|
77
|
+
constructor() {
|
|
78
|
+
if (this.defaultOpen()) {
|
|
79
|
+
this.open.set(true);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
setOpen(open: boolean): void {
|
|
84
|
+
if (this.controlledOpen() === undefined) {
|
|
85
|
+
this.open.set(open);
|
|
86
|
+
}
|
|
87
|
+
this.openChange.emit(open);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
isOpen(): boolean {
|
|
91
|
+
return this.controlledOpen() !== undefined ? this.controlledOpen()! : this.open();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { DrawerClose } from './drawer-close.component';
|
|
2
|
+
export { DrawerContent } from './drawer-content.component';
|
|
3
|
+
export { DRAWER_CONTEXT, type DrawerContextValue } from './drawer-context';
|
|
4
|
+
export { DrawerDescription } from './drawer-description.component';
|
|
5
|
+
export { DrawerFooter } from './drawer-footer.component';
|
|
6
|
+
export { DrawerHeader } from './drawer-header.component';
|
|
7
|
+
export { DrawerTitle } from './drawer-title.component';
|
|
8
|
+
export { DrawerTrigger } from './drawer-trigger.component';
|
|
9
|
+
export { Drawer } from './drawer.component';
|
|
10
|
+
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, inject, input, model, output } from '@angular/core';
|
|
3
|
+
import { Check, LucideAngularModule } from 'lucide-angular';
|
|
4
|
+
import { DROPDOWN_MENU_CONTEXT } from './dropdown-menu-context';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* DropdownMenuCheckboxItem component - a checkbox item in the dropdown.
|
|
8
|
+
* Matches shadcn/ui React DropdownMenuCheckboxItem exactly.
|
|
9
|
+
*/
|
|
10
|
+
@Component({
|
|
11
|
+
selector: 'DropdownMenuCheckboxItem',
|
|
12
|
+
imports: [LucideAngularModule],
|
|
13
|
+
template: `
|
|
14
|
+
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
15
|
+
@if (checked()) {
|
|
16
|
+
<lucide-icon [img]="CheckIcon" class="h-4 w-4" />
|
|
17
|
+
}
|
|
18
|
+
</span>
|
|
19
|
+
<ng-content />
|
|
20
|
+
`,
|
|
21
|
+
host: {
|
|
22
|
+
'[class]': 'computedClass()',
|
|
23
|
+
'[attr.role]': '"menuitemcheckbox"',
|
|
24
|
+
'[attr.aria-checked]': 'checked()',
|
|
25
|
+
'[attr.tabindex]': 'disabled() ? -1 : 0',
|
|
26
|
+
'[attr.aria-disabled]': 'disabled()',
|
|
27
|
+
'[attr.data-disabled]': 'disabled() ? "" : null',
|
|
28
|
+
'[attr.data-state]': 'checked() ? "checked" : "unchecked"',
|
|
29
|
+
'(click)': 'handleClick($event)',
|
|
30
|
+
'(keydown.enter)': 'handleClick($event)',
|
|
31
|
+
'(keydown.space)': 'handleClick($event)',
|
|
32
|
+
},
|
|
33
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
34
|
+
})
|
|
35
|
+
export class DropdownMenuCheckboxItem {
|
|
36
|
+
private readonly context = inject(DROPDOWN_MENU_CONTEXT);
|
|
37
|
+
protected readonly CheckIcon = Check;
|
|
38
|
+
|
|
39
|
+
/** Whether the checkbox is checked */
|
|
40
|
+
readonly checked = model<boolean>(false);
|
|
41
|
+
|
|
42
|
+
/** Whether the item is disabled */
|
|
43
|
+
readonly disabled = input<boolean>(false);
|
|
44
|
+
|
|
45
|
+
/** Additional CSS classes */
|
|
46
|
+
readonly class = input<string>('');
|
|
47
|
+
|
|
48
|
+
/** Select event emitted when item is clicked */
|
|
49
|
+
readonly onCheckedChange = output<boolean>();
|
|
50
|
+
|
|
51
|
+
protected readonly computedClass = computed(() =>
|
|
52
|
+
cn(
|
|
53
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
54
|
+
!this.disabled() && 'cursor-pointer hover:bg-accent hover:text-accent-foreground',
|
|
55
|
+
this.class()
|
|
56
|
+
)
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
protected handleClick(event: Event): void {
|
|
60
|
+
if (this.disabled()) {
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const newValue = !this.checked();
|
|
65
|
+
this.checked.set(newValue);
|
|
66
|
+
this.onCheckedChange.emit(newValue);
|
|
67
|
+
}
|
|
68
|
+
}
|