@ng-cn/core 1.0.15 → 1.0.17
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 +34 -33
- package/schematics/component/index.js +454 -95
- package/schematics/component/index.ts +459 -98
- package/schematics/ng-add/index.js +539 -55
- package/schematics/ng-add/index.ts +555 -62
- package/schematics/ng-add/schema.json +8 -2
- package/schematics/test-schematic.js +1 -2
- package/src/app/lib/components/ui/.gitkeep +0 -0
- package/src/app/lib/components/ui/accordion/accordion-content.component.ts +16 -24
- package/src/app/lib/components/ui/accordion/accordion-context.ts +4 -9
- package/src/app/lib/components/ui/accordion/accordion-item.component.ts +33 -29
- package/src/app/lib/components/ui/accordion/accordion-trigger.component.ts +11 -14
- package/src/app/lib/components/ui/accordion/accordion.component.ts +60 -49
- package/src/app/lib/components/ui/accordion/index.ts +5 -6
- package/src/app/lib/components/ui/alert/alert-description.component.ts +3 -8
- package/src/app/lib/components/ui/alert/alert-title.component.ts +2 -7
- package/src/app/lib/components/ui/alert/alert-variants.ts +19 -5
- package/src/app/lib/components/ui/alert/alert.component.ts +2 -10
- package/src/app/lib/components/ui/alert/index.ts +0 -1
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-action.component.ts +5 -12
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-cancel.component.ts +5 -11
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-content.component.ts +63 -66
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-context.ts +10 -5
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-description.component.ts +5 -10
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-footer.component.ts +3 -7
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-header.component.ts +3 -7
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-title.component.ts +5 -12
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-trigger.component.ts +8 -12
- package/src/app/lib/components/ui/alert-dialog/alert-dialog.component.ts +28 -34
- package/src/app/lib/components/ui/alert-dialog/index.ts +0 -1
- package/src/app/lib/components/ui/aspect-ratio/aspect-ratio.component.ts +3 -9
- package/src/app/lib/components/ui/avatar/avatar-context.ts +9 -0
- package/src/app/lib/components/ui/avatar/avatar-fallback.component.ts +7 -18
- package/src/app/lib/components/ui/avatar/avatar-image.component.ts +39 -17
- package/src/app/lib/components/ui/avatar/avatar.component.ts +17 -20
- package/src/app/lib/components/ui/avatar/index.ts +1 -1
- package/src/app/lib/components/ui/avatar/ui-avatar.component.ts +9 -30
- package/src/app/lib/components/ui/badge/badge-variants.ts +5 -5
- package/src/app/lib/components/ui/badge/badge.component.ts +4 -8
- package/src/app/lib/components/ui/badge/index.ts +0 -1
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-ellipsis.component.ts +3 -7
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-item.component.ts +5 -14
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-link.component.ts +6 -18
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-list.component.ts +6 -15
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-page.component.ts +3 -7
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-separator.component.ts +22 -31
- package/src/app/lib/components/ui/breadcrumb/breadcrumb.component.ts +3 -9
- package/src/app/lib/components/ui/breadcrumb/index.ts +0 -1
- package/src/app/lib/components/ui/button/button-variants.ts +6 -8
- package/src/app/lib/components/ui/button/button.component.ts +4 -8
- package/src/app/lib/components/ui/button/index.ts +0 -1
- package/src/app/lib/components/ui/button-group/button-group-variants.ts +12 -15
- package/src/app/lib/components/ui/button-group/button-group.component.ts +6 -14
- package/src/app/lib/components/ui/button-group/index.ts +1 -5
- package/src/app/lib/components/ui/calendar/calendar.component.ts +103 -115
- package/src/app/lib/components/ui/card/card-action.component.ts +2 -10
- package/src/app/lib/components/ui/card/card-content.component.ts +1 -6
- package/src/app/lib/components/ui/card/card-description.component.ts +2 -7
- package/src/app/lib/components/ui/card/card-footer.component.ts +2 -7
- package/src/app/lib/components/ui/card/card-header.component.ts +3 -8
- package/src/app/lib/components/ui/card/card-title.component.ts +2 -9
- package/src/app/lib/components/ui/card/card.component.ts +3 -8
- package/src/app/lib/components/ui/card/index.ts +0 -1
- package/src/app/lib/components/ui/carousel/carousel-content.component.ts +3 -9
- package/src/app/lib/components/ui/carousel/carousel-item.component.ts +5 -5
- package/src/app/lib/components/ui/carousel/carousel-next.component.ts +9 -8
- package/src/app/lib/components/ui/carousel/carousel-previous.component.ts +9 -8
- package/src/app/lib/components/ui/carousel/carousel.component.ts +14 -25
- package/src/app/lib/components/ui/carousel/index.ts +5 -2
- package/src/app/lib/components/ui/chart/chart-container.component.ts +20 -26
- package/src/app/lib/components/ui/chart/chart-legend-content.component.ts +6 -16
- package/src/app/lib/components/ui/chart/chart-legend.component.ts +2 -7
- package/src/app/lib/components/ui/chart/chart-tooltip-content.component.ts +2 -9
- package/src/app/lib/components/ui/chart/chart-tooltip.component.ts +2 -7
- package/src/app/lib/components/ui/chart/chart.component.ts +12 -32
- package/src/app/lib/components/ui/chart/index.ts +7 -8
- package/src/app/lib/components/ui/checkbox/checkbox.component.ts +55 -74
- package/src/app/lib/components/ui/collapsible/collapsible-content.component.ts +16 -25
- package/src/app/lib/components/ui/collapsible/collapsible-context.ts +0 -8
- package/src/app/lib/components/ui/collapsible/collapsible-trigger.component.ts +6 -16
- package/src/app/lib/components/ui/collapsible/collapsible.component.ts +29 -33
- package/src/app/lib/components/ui/collapsible/index.ts +0 -1
- package/src/app/lib/components/ui/combobox/combobox-content.component.ts +8 -15
- package/src/app/lib/components/ui/combobox/combobox-context.ts +5 -4
- package/src/app/lib/components/ui/combobox/combobox-empty.component.ts +5 -12
- package/src/app/lib/components/ui/combobox/combobox-group.component.ts +3 -7
- package/src/app/lib/components/ui/combobox/combobox-input.component.ts +25 -25
- package/src/app/lib/components/ui/combobox/combobox-item.component.ts +45 -44
- package/src/app/lib/components/ui/combobox/combobox-list.component.ts +14 -12
- package/src/app/lib/components/ui/combobox/combobox-trigger.component.ts +24 -14
- package/src/app/lib/components/ui/combobox/combobox-value.component.ts +27 -22
- package/src/app/lib/components/ui/combobox/combobox.component.ts +74 -54
- package/src/app/lib/components/ui/combobox/index.ts +1 -6
- package/src/app/lib/components/ui/command/command-context.ts +1 -5
- package/src/app/lib/components/ui/command/command-dialog.component.ts +12 -14
- package/src/app/lib/components/ui/command/command-empty.component.ts +2 -3
- package/src/app/lib/components/ui/command/command-group.component.ts +32 -25
- package/src/app/lib/components/ui/command/command-input.component.ts +29 -28
- package/src/app/lib/components/ui/command/command-item.component.ts +46 -58
- package/src/app/lib/components/ui/command/command-list.component.ts +5 -4
- package/src/app/lib/components/ui/command/command-separator.component.ts +2 -3
- package/src/app/lib/components/ui/command/command-shortcut.component.ts +2 -1
- package/src/app/lib/components/ui/command/command.component.ts +33 -22
- package/src/app/lib/components/ui/command/index.ts +0 -1
- package/src/app/lib/components/ui/context-menu/context-menu-checkbox-item.component.ts +20 -11
- package/src/app/lib/components/ui/context-menu/context-menu-content.component.ts +36 -43
- package/src/app/lib/components/ui/context-menu/context-menu-context.ts +1 -1
- package/src/app/lib/components/ui/context-menu/context-menu-item.component.ts +12 -13
- package/src/app/lib/components/ui/context-menu/context-menu-label.component.ts +2 -5
- package/src/app/lib/components/ui/context-menu/context-menu-radio-group.component.ts +9 -2
- package/src/app/lib/components/ui/context-menu/context-menu-radio-item.component.ts +14 -14
- package/src/app/lib/components/ui/context-menu/context-menu-separator.component.ts +2 -3
- package/src/app/lib/components/ui/context-menu/context-menu-shortcut.component.ts +2 -1
- package/src/app/lib/components/ui/context-menu/context-menu-sub-content.component.ts +5 -5
- package/src/app/lib/components/ui/context-menu/context-menu-sub-trigger.component.ts +8 -7
- package/src/app/lib/components/ui/context-menu/context-menu-sub.component.ts +9 -2
- package/src/app/lib/components/ui/context-menu/context-menu-trigger.component.ts +8 -7
- package/src/app/lib/components/ui/context-menu/context-menu.component.ts +1 -0
- package/src/app/lib/components/ui/context-menu/index.ts +15 -4
- package/src/app/lib/components/ui/data-table/data-table-content.component.ts +22 -28
- package/src/app/lib/components/ui/data-table/data-table-context.ts +1 -3
- package/src/app/lib/components/ui/data-table/data-table-pagination.component.ts +17 -27
- package/src/app/lib/components/ui/data-table/data-table-search.component.ts +6 -14
- package/src/app/lib/components/ui/data-table/data-table-toolbar.component.ts +3 -7
- package/src/app/lib/components/ui/data-table/data-table-view-options.component.ts +11 -20
- package/src/app/lib/components/ui/data-table/data-table.component.ts +41 -49
- package/src/app/lib/components/ui/data-table/index.ts +7 -8
- package/src/app/lib/components/ui/date-picker/date-picker.component.ts +24 -24
- package/src/app/lib/components/ui/dialog/dialog-close.component.ts +4 -8
- package/src/app/lib/components/ui/dialog/dialog-content.component.ts +72 -73
- package/src/app/lib/components/ui/dialog/dialog-context.ts +7 -5
- package/src/app/lib/components/ui/dialog/dialog-description.component.ts +5 -10
- package/src/app/lib/components/ui/dialog/dialog-footer.component.ts +3 -7
- package/src/app/lib/components/ui/dialog/dialog-header.component.ts +3 -7
- package/src/app/lib/components/ui/dialog/dialog-title.component.ts +5 -10
- package/src/app/lib/components/ui/dialog/dialog-trigger.component.ts +7 -11
- package/src/app/lib/components/ui/dialog/dialog.component.ts +29 -34
- package/src/app/lib/components/ui/dialog/index.ts +0 -1
- package/src/app/lib/components/ui/drawer/drawer-close.component.ts +4 -8
- package/src/app/lib/components/ui/drawer/drawer-content.component.ts +39 -35
- package/src/app/lib/components/ui/drawer/drawer-description.component.ts +5 -10
- package/src/app/lib/components/ui/drawer/drawer-footer.component.ts +3 -7
- package/src/app/lib/components/ui/drawer/drawer-header.component.ts +3 -7
- package/src/app/lib/components/ui/drawer/drawer-title.component.ts +5 -10
- package/src/app/lib/components/ui/drawer/drawer-trigger.component.ts +7 -11
- package/src/app/lib/components/ui/drawer/drawer.component.ts +25 -26
- package/src/app/lib/components/ui/drawer/index.ts +0 -1
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.component.ts +20 -11
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-content.component.ts +96 -61
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-context.ts +1 -1
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-group.component.ts +1 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-item.component.ts +10 -11
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-label.component.ts +2 -5
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.component.ts +14 -5
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.component.ts +14 -14
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-separator.component.ts +2 -3
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.component.ts +2 -1
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.component.ts +5 -5
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.component.ts +8 -7
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-sub.component.ts +9 -2
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-trigger.component.ts +6 -5
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu.component.ts +1 -0
- package/src/app/lib/components/ui/dropdown-menu/index.ts +10 -3
- package/src/app/lib/components/ui/empty/empty-action.component.ts +2 -9
- package/src/app/lib/components/ui/empty/empty-description.component.ts +2 -10
- package/src/app/lib/components/ui/empty/empty-icon.component.ts +3 -8
- package/src/app/lib/components/ui/empty/empty-title.component.ts +2 -9
- package/src/app/lib/components/ui/empty/empty.component.ts +3 -8
- package/src/app/lib/components/ui/empty/index.ts +0 -1
- package/src/app/lib/components/ui/form/form-context.ts +1 -11
- package/src/app/lib/components/ui/form/form-control.component.ts +22 -22
- package/src/app/lib/components/ui/form/form-description.component.ts +4 -10
- package/src/app/lib/components/ui/form/form-field.component.ts +7 -10
- package/src/app/lib/components/ui/form/form-item.component.ts +2 -12
- package/src/app/lib/components/ui/form/form-label.component.ts +15 -15
- package/src/app/lib/components/ui/form/form-message.component.ts +7 -15
- package/src/app/lib/components/ui/form/form.component.ts +9 -20
- package/src/app/lib/components/ui/form/index.ts +4 -5
- package/src/app/lib/components/ui/hover-card/hover-card-content.component.ts +21 -33
- package/src/app/lib/components/ui/hover-card/hover-card-context.ts +0 -8
- package/src/app/lib/components/ui/hover-card/hover-card-trigger.component.ts +17 -26
- package/src/app/lib/components/ui/hover-card/hover-card.component.ts +18 -28
- package/src/app/lib/components/ui/hover-card/index.ts +9 -6
- package/src/app/lib/components/ui/input/input.component.ts +57 -75
- package/src/app/lib/components/ui/input-group/index.ts +0 -1
- package/src/app/lib/components/ui/input-group/input-group-addon.component.ts +4 -11
- package/src/app/lib/components/ui/input-group/input-group-input.component.ts +3 -8
- package/src/app/lib/components/ui/input-group/input-group.component.ts +4 -9
- package/src/app/lib/components/ui/input-otp/index.ts +4 -5
- package/src/app/lib/components/ui/input-otp/input-otp-context.ts +0 -8
- package/src/app/lib/components/ui/input-otp/input-otp-group.component.ts +2 -3
- package/src/app/lib/components/ui/input-otp/input-otp-separator.component.ts +4 -3
- package/src/app/lib/components/ui/input-otp/input-otp-slot.component.ts +8 -10
- package/src/app/lib/components/ui/input-otp/input-otp.component.ts +27 -45
- package/src/app/lib/components/ui/kbd/index.ts +0 -1
- package/src/app/lib/components/ui/kbd/kbd-variants.ts +1 -1
- package/src/app/lib/components/ui/kbd/kbd.component.ts +4 -8
- package/src/app/lib/components/ui/label/label.component.ts +15 -28
- package/src/app/lib/components/ui/menubar/index.ts +11 -8
- package/src/app/lib/components/ui/menubar/menubar-checkbox-item.component.ts +21 -12
- package/src/app/lib/components/ui/menubar/menubar-content.component.ts +46 -53
- package/src/app/lib/components/ui/menubar/menubar-context.ts +3 -9
- package/src/app/lib/components/ui/menubar/menubar-item.component.ts +13 -14
- package/src/app/lib/components/ui/menubar/menubar-label.component.ts +2 -5
- package/src/app/lib/components/ui/menubar/menubar-menu.component.ts +14 -2
- package/src/app/lib/components/ui/menubar/menubar-radio-group.component.ts +9 -2
- package/src/app/lib/components/ui/menubar/menubar-radio-item.component.ts +13 -13
- package/src/app/lib/components/ui/menubar/menubar-separator.component.ts +2 -3
- package/src/app/lib/components/ui/menubar/menubar-shortcut.component.ts +2 -1
- package/src/app/lib/components/ui/menubar/menubar-sub-content.component.ts +5 -5
- package/src/app/lib/components/ui/menubar/menubar-sub-trigger.component.ts +7 -6
- package/src/app/lib/components/ui/menubar/menubar-sub.component.ts +8 -1
- package/src/app/lib/components/ui/menubar/menubar-trigger.component.ts +26 -21
- package/src/app/lib/components/ui/menubar/menubar.component.ts +6 -13
- package/src/app/lib/components/ui/native-select/index.ts +1 -5
- package/src/app/lib/components/ui/native-select/native-select-variants.ts +1 -1
- package/src/app/lib/components/ui/native-select/native-select.component.ts +14 -15
- package/src/app/lib/components/ui/navigation-menu/index.ts +10 -8
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-content.component.ts +18 -13
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-context.ts +2 -10
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-indicator.component.ts +3 -2
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-item.component.ts +6 -1
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-link.component.ts +3 -8
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-list.component.ts +2 -4
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-trigger-style.ts +1 -1
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-trigger.component.ts +8 -7
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-viewport.component.ts +3 -2
- package/src/app/lib/components/ui/navigation-menu/navigation-menu.component.ts +8 -15
- package/src/app/lib/components/ui/pagination/index.ts +0 -1
- package/src/app/lib/components/ui/pagination/pagination-content.component.ts +3 -7
- package/src/app/lib/components/ui/pagination/pagination-ellipsis.component.ts +3 -7
- package/src/app/lib/components/ui/pagination/pagination-item.component.ts +3 -9
- package/src/app/lib/components/ui/pagination/pagination-link.component.ts +4 -8
- package/src/app/lib/components/ui/pagination/pagination-next.component.ts +3 -11
- package/src/app/lib/components/ui/pagination/pagination-previous.component.ts +3 -11
- package/src/app/lib/components/ui/pagination/pagination.component.ts +3 -7
- package/src/app/lib/components/ui/popover/index.ts +9 -6
- package/src/app/lib/components/ui/popover/popover-anchor.component.ts +2 -13
- package/src/app/lib/components/ui/popover/popover-content.component.ts +119 -69
- package/src/app/lib/components/ui/popover/popover-context.ts +0 -8
- package/src/app/lib/components/ui/popover/popover-trigger.component.ts +22 -22
- package/src/app/lib/components/ui/popover/popover.component.ts +20 -33
- package/src/app/lib/components/ui/progress/index.ts +1 -6
- package/src/app/lib/components/ui/progress/progress.component.ts +15 -30
- package/src/app/lib/components/ui/radio-group/index.ts +1 -4
- package/src/app/lib/components/ui/radio-group/radio-group-context.ts +1 -7
- package/src/app/lib/components/ui/radio-group/radio-group-item.component.ts +36 -69
- package/src/app/lib/components/ui/radio-group/radio-group.component.ts +38 -67
- package/src/app/lib/components/ui/resizable/index.ts +0 -1
- package/src/app/lib/components/ui/resizable/resizable-handle.component.ts +25 -39
- package/src/app/lib/components/ui/resizable/resizable-panel-group.component.ts +15 -18
- package/src/app/lib/components/ui/resizable/resizable-panel.component.ts +12 -31
- package/src/app/lib/components/ui/scroll-area/index.ts +4 -5
- package/src/app/lib/components/ui/scroll-area/scroll-area.component.ts +5 -19
- package/src/app/lib/components/ui/scroll-area/scroll-bar.component.ts +8 -27
- package/src/app/lib/components/ui/segmented/index.ts +5 -9
- package/src/app/lib/components/ui/segmented/segmented-context.ts +1 -3
- package/src/app/lib/components/ui/segmented/segmented-item.component.ts +21 -29
- package/src/app/lib/components/ui/segmented/segmented-variants.ts +2 -2
- package/src/app/lib/components/ui/segmented/segmented.component.ts +24 -32
- package/src/app/lib/components/ui/select/index.ts +5 -6
- package/src/app/lib/components/ui/select/select-content.component.ts +34 -62
- package/src/app/lib/components/ui/select/select-context.ts +4 -14
- package/src/app/lib/components/ui/select/select-group.component.ts +6 -7
- package/src/app/lib/components/ui/select/select-item.component.ts +46 -55
- package/src/app/lib/components/ui/select/select-label.component.ts +2 -7
- package/src/app/lib/components/ui/select/select-separator.component.ts +3 -8
- package/src/app/lib/components/ui/select/select-trigger.component.ts +28 -25
- package/src/app/lib/components/ui/select/select-value.component.ts +7 -13
- package/src/app/lib/components/ui/select/select.component.ts +52 -64
- package/src/app/lib/components/ui/separator/index.ts +1 -6
- package/src/app/lib/components/ui/separator/separator.component.ts +4 -19
- package/src/app/lib/components/ui/sheet/index.ts +0 -1
- package/src/app/lib/components/ui/sheet/sheet-close.component.ts +4 -8
- package/src/app/lib/components/ui/sheet/sheet-content.component.ts +31 -36
- package/src/app/lib/components/ui/sheet/sheet-description.component.ts +5 -10
- package/src/app/lib/components/ui/sheet/sheet-footer.component.ts +3 -7
- package/src/app/lib/components/ui/sheet/sheet-header.component.ts +3 -7
- package/src/app/lib/components/ui/sheet/sheet-title.component.ts +5 -10
- package/src/app/lib/components/ui/sheet/sheet-trigger.component.ts +7 -11
- package/src/app/lib/components/ui/sheet/sheet-variants.ts +1 -1
- package/src/app/lib/components/ui/sheet/sheet.component.ts +36 -36
- package/src/app/lib/components/ui/sidebar/index.ts +14 -15
- package/src/app/lib/components/ui/sidebar/sidebar-content.component.ts +4 -8
- package/src/app/lib/components/ui/sidebar/sidebar-context.ts +1 -3
- package/src/app/lib/components/ui/sidebar/sidebar-footer.component.ts +3 -9
- package/src/app/lib/components/ui/sidebar/sidebar-group-action.component.ts +4 -8
- package/src/app/lib/components/ui/sidebar/sidebar-group-content.component.ts +3 -9
- package/src/app/lib/components/ui/sidebar/sidebar-group-label.component.ts +4 -8
- package/src/app/lib/components/ui/sidebar/sidebar-group.component.ts +3 -7
- package/src/app/lib/components/ui/sidebar/sidebar-header.component.ts +3 -9
- package/src/app/lib/components/ui/sidebar/sidebar-input.component.ts +4 -8
- package/src/app/lib/components/ui/sidebar/sidebar-inset.component.ts +4 -8
- package/src/app/lib/components/ui/sidebar/sidebar-menu-action.component.ts +4 -8
- package/src/app/lib/components/ui/sidebar/sidebar-menu-badge.component.ts +4 -8
- package/src/app/lib/components/ui/sidebar/sidebar-menu-button.component.ts +4 -9
- package/src/app/lib/components/ui/sidebar/sidebar-menu-item.component.ts +3 -9
- package/src/app/lib/components/ui/sidebar/sidebar-menu-skeleton.component.ts +6 -11
- package/src/app/lib/components/ui/sidebar/sidebar-menu-sub-button.component.ts +4 -8
- package/src/app/lib/components/ui/sidebar/sidebar-menu-sub-item.component.ts +2 -6
- package/src/app/lib/components/ui/sidebar/sidebar-menu-sub.component.ts +4 -8
- package/src/app/lib/components/ui/sidebar/sidebar-menu.component.ts +3 -7
- package/src/app/lib/components/ui/sidebar/sidebar-provider.component.ts +46 -52
- package/src/app/lib/components/ui/sidebar/sidebar-rail.component.ts +6 -11
- package/src/app/lib/components/ui/sidebar/sidebar-route-active.service.ts +17 -17
- package/src/app/lib/components/ui/sidebar/sidebar-separator.component.ts +3 -7
- package/src/app/lib/components/ui/sidebar/sidebar-trigger.component.ts +6 -11
- package/src/app/lib/components/ui/sidebar/sidebar.component.ts +20 -31
- package/src/app/lib/components/ui/skeleton/skeleton.component.ts +3 -8
- package/src/app/lib/components/ui/slider/index.ts +1 -6
- package/src/app/lib/components/ui/slider/slider.component.ts +73 -138
- package/src/app/lib/components/ui/spinner/index.ts +0 -1
- package/src/app/lib/components/ui/spinner/spinner-variants.ts +19 -22
- package/src/app/lib/components/ui/spinner/spinner.component.ts +4 -8
- package/src/app/lib/components/ui/switch/index.ts +1 -6
- package/src/app/lib/components/ui/switch/switch.component.ts +83 -108
- package/src/app/lib/components/ui/table/index.ts +0 -1
- package/src/app/lib/components/ui/table/table-body.component.ts +6 -10
- package/src/app/lib/components/ui/table/table-caption.component.ts +6 -8
- package/src/app/lib/components/ui/table/table-cell.component.ts +4 -8
- package/src/app/lib/components/ui/table/table-footer.component.ts +6 -8
- package/src/app/lib/components/ui/table/table-head.component.ts +4 -8
- package/src/app/lib/components/ui/table/table-header.component.ts +6 -10
- package/src/app/lib/components/ui/table/table-row.component.ts +6 -11
- package/src/app/lib/components/ui/table/table.component.ts +4 -8
- package/src/app/lib/components/ui/tabs/index.ts +14 -7
- package/src/app/lib/components/ui/tabs/tabs-content.component.ts +11 -36
- package/src/app/lib/components/ui/tabs/tabs-context.ts +0 -8
- package/src/app/lib/components/ui/tabs/tabs-list.component.ts +54 -60
- package/src/app/lib/components/ui/tabs/tabs-trigger.component.ts +20 -35
- package/src/app/lib/components/ui/tabs/tabs.component.ts +32 -49
- package/src/app/lib/components/ui/textarea/textarea.component.ts +3 -8
- package/src/app/lib/components/ui/toast/index.ts +6 -7
- package/src/app/lib/components/ui/toast/toast-action.component.ts +7 -18
- package/src/app/lib/components/ui/toast/toast-description.component.ts +2 -11
- package/src/app/lib/components/ui/toast/toast-title.component.ts +2 -9
- package/src/app/lib/components/ui/toast/toast-variants.ts +1 -1
- package/src/app/lib/components/ui/toast/toast.component.ts +18 -24
- package/src/app/lib/components/ui/toast/toast.service.ts +22 -37
- package/src/app/lib/components/ui/toast/toaster.component.ts +6 -16
- package/src/app/lib/components/ui/toggle/index.ts +1 -5
- package/src/app/lib/components/ui/toggle/toggle-variants.ts +2 -2
- package/src/app/lib/components/ui/toggle/toggle.component.ts +32 -51
- package/src/app/lib/components/ui/toggle-group/index.ts +1 -4
- package/src/app/lib/components/ui/toggle-group/toggle-group-context.ts +1 -7
- package/src/app/lib/components/ui/toggle-group/toggle-group-item.component.ts +38 -59
- package/src/app/lib/components/ui/toggle-group/toggle-group.component.ts +33 -51
- package/src/app/lib/components/ui/tooltip/index.ts +9 -6
- package/src/app/lib/components/ui/tooltip/tooltip-content.component.ts +6 -24
- package/src/app/lib/components/ui/tooltip/tooltip-context.ts +0 -8
- package/src/app/lib/components/ui/tooltip/tooltip-provider.component.ts +12 -24
- package/src/app/lib/components/ui/tooltip/tooltip-trigger.component.ts +4 -21
- package/src/app/lib/components/ui/tooltip/tooltip.component.ts +21 -33
- package/src/app/lib/components/ui/typography/index.ts +0 -1
- package/src/app/lib/components/ui/typography/typography-blockquote.component.ts +3 -7
- package/src/app/lib/components/ui/typography/typography-h1.component.ts +3 -10
- package/src/app/lib/components/ui/typography/typography-h2.component.ts +3 -10
- package/src/app/lib/components/ui/typography/typography-h3.component.ts +3 -7
- package/src/app/lib/components/ui/typography/typography-h4.component.ts +3 -7
- package/src/app/lib/components/ui/typography/typography-inline-code.component.ts +4 -8
- package/src/app/lib/components/ui/typography/typography-large.component.ts +3 -9
- package/src/app/lib/components/ui/typography/typography-lead.component.ts +3 -7
- package/src/app/lib/components/ui/typography/typography-list.component.ts +3 -7
- package/src/app/lib/components/ui/typography/typography-muted.component.ts +3 -7
- package/src/app/lib/components/ui/typography/typography-p.component.ts +3 -7
- package/src/app/lib/components/ui/typography/typography-small.component.ts +3 -7
- package/src/app/lib/utils/accessibility/click-outside.directive.ts +1 -8
- package/src/app/lib/utils/accessibility/focus-management.service.ts +4 -15
- package/src/app/lib/utils/accessibility/focus-trap.directive.ts +32 -106
- package/src/app/lib/utils/accessibility/index.ts +16 -5
- package/src/app/lib/utils/accessibility/keyboard-navigation.directive.ts +5 -8
- package/src/app/lib/utils/accessibility/live-region.directive.ts +10 -13
- package/src/app/lib/utils/accessibility/touch-target.directive.ts +1 -8
- package/src/app/lib/utils/animation/animation.utils.ts +4 -7
- package/src/app/lib/utils/animation/index.ts +15 -5
- package/src/app/lib/utils/animation/presence.component.ts +1 -1
- package/src/app/lib/utils/animation/presence.directive.ts +2 -2
- package/src/app/lib/utils/positioning/index.ts +40 -18
- package/src/app/lib/components/ui/index.ts +0 -551
- package/src/app/lib/index.ts +0 -7
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
|
-
import {
|
|
3
|
-
ChangeDetectionStrategy,
|
|
4
|
-
Component,
|
|
5
|
-
computed,
|
|
6
|
-
input,
|
|
7
|
-
} from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
8
3
|
|
|
9
4
|
/**
|
|
10
5
|
* Typography InlineCode component
|
|
@@ -16,6 +11,7 @@ import {
|
|
|
16
11
|
selector: 'TypographyInlineCode',
|
|
17
12
|
template: `<ng-content />`,
|
|
18
13
|
host: {
|
|
14
|
+
'attr.data-slot': '"typography-inline-code"',
|
|
19
15
|
'[class]': 'computedClass()',
|
|
20
16
|
},
|
|
21
17
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -25,7 +21,7 @@ export class TypographyInlineCode {
|
|
|
25
21
|
protected readonly computedClass = computed(() =>
|
|
26
22
|
cn(
|
|
27
23
|
'relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold',
|
|
28
|
-
this.class()
|
|
29
|
-
)
|
|
24
|
+
this.class(),
|
|
25
|
+
),
|
|
30
26
|
);
|
|
31
27
|
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
|
-
import {
|
|
3
|
-
ChangeDetectionStrategy,
|
|
4
|
-
Component,
|
|
5
|
-
computed,
|
|
6
|
-
input,
|
|
7
|
-
} from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
8
3
|
|
|
9
4
|
/**
|
|
10
5
|
* Typography Large component
|
|
@@ -16,13 +11,12 @@ import {
|
|
|
16
11
|
selector: 'TypographyLarge',
|
|
17
12
|
template: `<ng-content />`,
|
|
18
13
|
host: {
|
|
14
|
+
'attr.data-slot': '"typography-large"',
|
|
19
15
|
'[class]': 'computedClass()',
|
|
20
16
|
},
|
|
21
17
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
22
18
|
})
|
|
23
19
|
export class TypographyLarge {
|
|
24
20
|
readonly class = input<string>('');
|
|
25
|
-
protected readonly computedClass = computed(() =>
|
|
26
|
-
cn('text-lg font-semibold', this.class())
|
|
27
|
-
);
|
|
21
|
+
protected readonly computedClass = computed(() => cn('text-lg font-semibold', this.class()));
|
|
28
22
|
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
|
-
import {
|
|
3
|
-
ChangeDetectionStrategy,
|
|
4
|
-
Component,
|
|
5
|
-
computed,
|
|
6
|
-
input,
|
|
7
|
-
} from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
8
3
|
|
|
9
4
|
/**
|
|
10
5
|
* Typography Lead component - larger intro text
|
|
@@ -18,6 +13,7 @@ import {
|
|
|
18
13
|
selector: 'TypographyLead',
|
|
19
14
|
template: `<ng-content />`,
|
|
20
15
|
host: {
|
|
16
|
+
'attr.data-slot': '"typography-lead"',
|
|
21
17
|
'[class]': 'computedClass()',
|
|
22
18
|
style: 'display: block',
|
|
23
19
|
},
|
|
@@ -26,6 +22,6 @@ import {
|
|
|
26
22
|
export class TypographyLead {
|
|
27
23
|
readonly class = input<string>('');
|
|
28
24
|
protected readonly computedClass = computed(() =>
|
|
29
|
-
cn('text-xl text-muted-foreground', this.class())
|
|
25
|
+
cn('text-xl text-muted-foreground', this.class()),
|
|
30
26
|
);
|
|
31
27
|
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
|
-
import {
|
|
3
|
-
ChangeDetectionStrategy,
|
|
4
|
-
Component,
|
|
5
|
-
computed,
|
|
6
|
-
input,
|
|
7
|
-
} from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
8
3
|
|
|
9
4
|
/**
|
|
10
5
|
* Typography List component (unordered list)
|
|
@@ -19,6 +14,7 @@ import {
|
|
|
19
14
|
selector: 'TypographyList',
|
|
20
15
|
template: `<ng-content />`,
|
|
21
16
|
host: {
|
|
17
|
+
'attr.data-slot': '"typography-list"',
|
|
22
18
|
'[class]': 'computedClass()',
|
|
23
19
|
},
|
|
24
20
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -26,6 +22,6 @@ import {
|
|
|
26
22
|
export class TypographyList {
|
|
27
23
|
readonly class = input<string>('');
|
|
28
24
|
protected readonly computedClass = computed(() =>
|
|
29
|
-
cn('my-6 ml-6 list-disc [&>li]:mt-2', this.class())
|
|
25
|
+
cn('my-6 ml-6 list-disc [&>li]:mt-2', this.class()),
|
|
30
26
|
);
|
|
31
27
|
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
|
-
import {
|
|
3
|
-
ChangeDetectionStrategy,
|
|
4
|
-
Component,
|
|
5
|
-
computed,
|
|
6
|
-
input,
|
|
7
|
-
} from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
8
3
|
|
|
9
4
|
/**
|
|
10
5
|
* Typography Muted component
|
|
@@ -16,6 +11,7 @@ import {
|
|
|
16
11
|
selector: 'TypographyMuted',
|
|
17
12
|
template: `<ng-content />`,
|
|
18
13
|
host: {
|
|
14
|
+
'attr.data-slot': '"typography-muted"',
|
|
19
15
|
'[class]': 'computedClass()',
|
|
20
16
|
},
|
|
21
17
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -23,6 +19,6 @@ import {
|
|
|
23
19
|
export class TypographyMuted {
|
|
24
20
|
readonly class = input<string>('');
|
|
25
21
|
protected readonly computedClass = computed(() =>
|
|
26
|
-
cn('text-sm text-muted-foreground', this.class())
|
|
22
|
+
cn('text-sm text-muted-foreground', this.class()),
|
|
27
23
|
);
|
|
28
24
|
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
|
-
import {
|
|
3
|
-
ChangeDetectionStrategy,
|
|
4
|
-
Component,
|
|
5
|
-
computed,
|
|
6
|
-
input,
|
|
7
|
-
} from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
8
3
|
|
|
9
4
|
/**
|
|
10
5
|
* Typography P (paragraph) component
|
|
@@ -16,6 +11,7 @@ import {
|
|
|
16
11
|
selector: 'TypographyP',
|
|
17
12
|
template: `<ng-content />`,
|
|
18
13
|
host: {
|
|
14
|
+
'attr.data-slot': '"typography-p"',
|
|
19
15
|
'[class]': 'computedClass()',
|
|
20
16
|
style: 'display: block',
|
|
21
17
|
},
|
|
@@ -24,6 +20,6 @@ import {
|
|
|
24
20
|
export class TypographyP {
|
|
25
21
|
readonly class = input<string>('');
|
|
26
22
|
protected readonly computedClass = computed(() =>
|
|
27
|
-
cn('leading-7 [&:not(:first-child)]:mt-6', this.class())
|
|
23
|
+
cn('leading-7 [&:not(:first-child)]:mt-6', this.class()),
|
|
28
24
|
);
|
|
29
25
|
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
|
-
import {
|
|
3
|
-
ChangeDetectionStrategy,
|
|
4
|
-
Component,
|
|
5
|
-
computed,
|
|
6
|
-
input,
|
|
7
|
-
} from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
8
3
|
|
|
9
4
|
/**
|
|
10
5
|
* Typography Small component
|
|
@@ -16,6 +11,7 @@ import {
|
|
|
16
11
|
selector: 'TypographySmall',
|
|
17
12
|
template: `<ng-content />`,
|
|
18
13
|
host: {
|
|
14
|
+
'attr.data-slot': '"typography-small"',
|
|
19
15
|
'[class]': 'computedClass()',
|
|
20
16
|
},
|
|
21
17
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -23,6 +19,6 @@ import {
|
|
|
23
19
|
export class TypographySmall {
|
|
24
20
|
readonly class = input<string>('');
|
|
25
21
|
protected readonly computedClass = computed(() =>
|
|
26
|
-
cn('text-sm font-medium leading-none', this.class())
|
|
22
|
+
cn('text-sm font-medium leading-none', this.class()),
|
|
27
23
|
);
|
|
28
24
|
}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Directive,
|
|
3
|
-
ElementRef,
|
|
4
|
-
OnDestroy,
|
|
5
|
-
afterNextRender,
|
|
6
|
-
inject,
|
|
7
|
-
output,
|
|
8
|
-
} from '@angular/core';
|
|
1
|
+
import { Directive, ElementRef, OnDestroy, afterNextRender, inject, output } from '@angular/core';
|
|
9
2
|
|
|
10
3
|
/**
|
|
11
4
|
* Directive that detects clicks outside the host element.
|
|
@@ -52,10 +52,7 @@ export class FocusManagementService {
|
|
|
52
52
|
* @param options - Focus options
|
|
53
53
|
* @returns The element that was focused, or null if none found
|
|
54
54
|
*/
|
|
55
|
-
focusFirstFocusable(
|
|
56
|
-
container: HTMLElement,
|
|
57
|
-
options: FocusOptions = {}
|
|
58
|
-
): HTMLElement | null {
|
|
55
|
+
focusFirstFocusable(container: HTMLElement, options: FocusOptions = {}): HTMLElement | null {
|
|
59
56
|
const focusable = this.getFocusableElements(container);
|
|
60
57
|
if (focusable.length > 0) {
|
|
61
58
|
const target = focusable[0];
|
|
@@ -71,10 +68,7 @@ export class FocusManagementService {
|
|
|
71
68
|
* @param options - Focus options
|
|
72
69
|
* @returns The element that was focused, or null if none found
|
|
73
70
|
*/
|
|
74
|
-
focusLastFocusable(
|
|
75
|
-
container: HTMLElement,
|
|
76
|
-
options: FocusOptions = {}
|
|
77
|
-
): HTMLElement | null {
|
|
71
|
+
focusLastFocusable(container: HTMLElement, options: FocusOptions = {}): HTMLElement | null {
|
|
78
72
|
const focusable = this.getFocusableElements(container);
|
|
79
73
|
if (focusable.length > 0) {
|
|
80
74
|
const target = focusable[focusable.length - 1];
|
|
@@ -124,9 +118,7 @@ export class FocusManagementService {
|
|
|
124
118
|
'details > summary:first-of-type',
|
|
125
119
|
].join(', ');
|
|
126
120
|
|
|
127
|
-
const elements = Array.from(
|
|
128
|
-
container.querySelectorAll<HTMLElement>(selector)
|
|
129
|
-
);
|
|
121
|
+
const elements = Array.from(container.querySelectorAll<HTMLElement>(selector));
|
|
130
122
|
|
|
131
123
|
return elements.filter((el) => this.isElementVisible(el));
|
|
132
124
|
}
|
|
@@ -195,10 +187,7 @@ export class FocusManagementService {
|
|
|
195
187
|
let parent = element.parentElement;
|
|
196
188
|
while (parent) {
|
|
197
189
|
const parentStyle = getComputedStyle(parent);
|
|
198
|
-
if (
|
|
199
|
-
parentStyle.display === 'none' ||
|
|
200
|
-
parentStyle.visibility === 'hidden'
|
|
201
|
-
) {
|
|
190
|
+
if (parentStyle.display === 'none' || parentStyle.visibility === 'hidden') {
|
|
202
191
|
return false;
|
|
203
192
|
}
|
|
204
193
|
if (parent.hasAttribute('hidden')) return false;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import { DOCUMENT } from '@angular/common';
|
|
2
|
-
import {
|
|
3
|
-
Directive,
|
|
4
|
-
ElementRef,
|
|
5
|
-
OnDestroy,
|
|
6
|
-
OnInit,
|
|
7
|
-
inject,
|
|
8
|
-
input,
|
|
9
|
-
output,
|
|
10
|
-
} from '@angular/core';
|
|
2
|
+
import { Directive, ElementRef, OnDestroy, OnInit, inject, input, output } from '@angular/core';
|
|
11
3
|
import { FocusManagementService } from './focus-management.service';
|
|
12
4
|
|
|
13
5
|
/**
|
|
14
6
|
* Directive to trap focus within a container element.
|
|
15
7
|
* Essential for modals, dialogs, and other overlay components.
|
|
8
|
+
* Uses simplified Tab key handling without focus sentinels to prevent infinite loops.
|
|
16
9
|
*
|
|
17
10
|
* @example
|
|
18
11
|
* ```html
|
|
@@ -24,8 +17,9 @@ import { FocusManagementService } from './focus-management.service';
|
|
|
24
17
|
*/
|
|
25
18
|
@Directive({
|
|
26
19
|
selector: '[hlmFocusTrap]',
|
|
20
|
+
standalone: true,
|
|
27
21
|
host: {
|
|
28
|
-
'(keydown)': '
|
|
22
|
+
'(keydown)': 'onKeydown($event)',
|
|
29
23
|
},
|
|
30
24
|
})
|
|
31
25
|
export class FocusTrapDirective implements OnInit, OnDestroy {
|
|
@@ -49,16 +43,12 @@ export class FocusTrapDirective implements OnInit, OnDestroy {
|
|
|
49
43
|
readonly focusEscaped = output<void>();
|
|
50
44
|
|
|
51
45
|
private previouslyFocused: HTMLElement | null = null;
|
|
52
|
-
private focusSentinelStart: HTMLElement | null = null;
|
|
53
|
-
private focusSentinelEnd: HTMLElement | null = null;
|
|
54
46
|
|
|
55
47
|
ngOnInit(): void {
|
|
56
48
|
if (this.restoreFocus()) {
|
|
57
49
|
this.previouslyFocused = this.focusManager.saveFocus();
|
|
58
50
|
}
|
|
59
51
|
|
|
60
|
-
this.createFocusSentinels();
|
|
61
|
-
|
|
62
52
|
if (this.autoFocus() && this.trapFocus()) {
|
|
63
53
|
// Delay to ensure DOM is ready
|
|
64
54
|
setTimeout(() => this.setInitialFocus(), 0);
|
|
@@ -66,64 +56,61 @@ export class FocusTrapDirective implements OnInit, OnDestroy {
|
|
|
66
56
|
}
|
|
67
57
|
|
|
68
58
|
ngOnDestroy(): void {
|
|
69
|
-
this.
|
|
70
|
-
|
|
71
|
-
if (this.restoreFocus()) {
|
|
59
|
+
if (this.restoreFocus() && this.previouslyFocused) {
|
|
72
60
|
this.focusManager.restoreFocus();
|
|
73
61
|
}
|
|
74
62
|
}
|
|
75
63
|
|
|
76
64
|
/**
|
|
77
|
-
* Handles keydown events
|
|
65
|
+
* Handles keydown events and filters for Tab key
|
|
66
|
+
*/
|
|
67
|
+
onKeydown(event: Event): void {
|
|
68
|
+
const keyEvent = event as KeyboardEvent;
|
|
69
|
+
if (keyEvent.key === 'Tab') {
|
|
70
|
+
this.handleTabKey(keyEvent);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Handles Tab key press to manage focus within the trap.
|
|
76
|
+
* Simplified approach without sentinels to prevent infinite focus loops.
|
|
78
77
|
*/
|
|
79
|
-
|
|
80
|
-
if (!this.trapFocus()
|
|
78
|
+
private handleTabKey(event: KeyboardEvent): void {
|
|
79
|
+
if (!this.trapFocus()) return;
|
|
81
80
|
|
|
82
81
|
const container = this.elementRef.nativeElement;
|
|
83
82
|
const focusable = this.focusManager.getTabbableElements(container);
|
|
84
83
|
|
|
84
|
+
// No focusable elements - nothing to trap
|
|
85
85
|
if (focusable.length === 0) {
|
|
86
|
-
// No focusable elements, prevent tab
|
|
87
86
|
event.preventDefault();
|
|
88
87
|
return;
|
|
89
88
|
}
|
|
90
89
|
|
|
90
|
+
const activeElement = this.document.activeElement as HTMLElement;
|
|
91
91
|
const firstFocusable = focusable[0];
|
|
92
92
|
const lastFocusable = focusable[focusable.length - 1];
|
|
93
|
-
|
|
93
|
+
|
|
94
|
+
// Check if active element is within the container
|
|
95
|
+
const isInContainer = container.contains(activeElement);
|
|
94
96
|
|
|
95
97
|
if (event.shiftKey) {
|
|
96
|
-
// Shift+Tab:
|
|
97
|
-
if (activeElement === firstFocusable
|
|
98
|
+
// Shift+Tab: moving backward
|
|
99
|
+
if (!isInContainer || activeElement === firstFocusable) {
|
|
98
100
|
event.preventDefault();
|
|
99
|
-
lastFocusable.focus();
|
|
101
|
+
lastFocusable.focus({ preventScroll: true });
|
|
100
102
|
}
|
|
101
103
|
} else {
|
|
102
|
-
// Tab:
|
|
103
|
-
if (activeElement === lastFocusable
|
|
104
|
+
// Tab: moving forward
|
|
105
|
+
if (!isInContainer || activeElement === lastFocusable) {
|
|
104
106
|
event.preventDefault();
|
|
105
|
-
firstFocusable.focus();
|
|
107
|
+
firstFocusable.focus({ preventScroll: true });
|
|
106
108
|
}
|
|
107
109
|
}
|
|
108
110
|
}
|
|
109
111
|
|
|
110
112
|
/**
|
|
111
|
-
*
|
|
112
|
-
*/
|
|
113
|
-
focusFirst(): void {
|
|
114
|
-
this.setInitialFocus();
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Manually focuses the last focusable element.
|
|
119
|
-
*/
|
|
120
|
-
focusLast(): void {
|
|
121
|
-
const container = this.elementRef.nativeElement;
|
|
122
|
-
this.focusManager.focusLastFocusable(container);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Sets the initial focus based on configuration.
|
|
113
|
+
* Sets initial focus based on configuration
|
|
127
114
|
*/
|
|
128
115
|
private setInitialFocus(): void {
|
|
129
116
|
const container = this.elementRef.nativeElement;
|
|
@@ -132,72 +119,11 @@ export class FocusTrapDirective implements OnInit, OnDestroy {
|
|
|
132
119
|
if (selector) {
|
|
133
120
|
const target = container.querySelector(selector) as HTMLElement | null;
|
|
134
121
|
if (target && this.focusManager.isElementFocusable(target)) {
|
|
135
|
-
target.focus();
|
|
122
|
+
target.focus({ preventScroll: true });
|
|
136
123
|
return;
|
|
137
124
|
}
|
|
138
125
|
}
|
|
139
126
|
|
|
140
127
|
this.focusManager.focusFirstFocusable(container);
|
|
141
128
|
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Creates invisible sentinel elements at the start and end of the container.
|
|
145
|
-
* These catch focus when tabbing out of the trap.
|
|
146
|
-
*/
|
|
147
|
-
private createFocusSentinels(): void {
|
|
148
|
-
const container = this.elementRef.nativeElement;
|
|
149
|
-
|
|
150
|
-
// Create start sentinel
|
|
151
|
-
this.focusSentinelStart = this.createSentinel('start');
|
|
152
|
-
container.insertBefore(this.focusSentinelStart, container.firstChild);
|
|
153
|
-
|
|
154
|
-
// Create end sentinel
|
|
155
|
-
this.focusSentinelEnd = this.createSentinel('end');
|
|
156
|
-
container.appendChild(this.focusSentinelEnd);
|
|
157
|
-
|
|
158
|
-
// Add focus listeners to sentinels
|
|
159
|
-
this.focusSentinelStart.addEventListener('focus', () => {
|
|
160
|
-
if (this.trapFocus()) {
|
|
161
|
-
this.focusManager.focusLastFocusable(container);
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
this.focusSentinelEnd.addEventListener('focus', () => {
|
|
166
|
-
if (this.trapFocus()) {
|
|
167
|
-
this.focusManager.focusFirstFocusable(container);
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Creates a focus sentinel element.
|
|
174
|
-
*/
|
|
175
|
-
private createSentinel(position: 'start' | 'end'): HTMLElement {
|
|
176
|
-
const sentinel = this.document.createElement('span');
|
|
177
|
-
sentinel.setAttribute('tabindex', '0');
|
|
178
|
-
sentinel.setAttribute('aria-hidden', 'true');
|
|
179
|
-
sentinel.setAttribute('data-focus-sentinel', position);
|
|
180
|
-
sentinel.style.cssText = `
|
|
181
|
-
position: absolute;
|
|
182
|
-
width: 1px;
|
|
183
|
-
height: 1px;
|
|
184
|
-
padding: 0;
|
|
185
|
-
margin: -1px;
|
|
186
|
-
overflow: hidden;
|
|
187
|
-
clip: rect(0, 0, 0, 0);
|
|
188
|
-
white-space: nowrap;
|
|
189
|
-
border: 0;
|
|
190
|
-
`;
|
|
191
|
-
return sentinel;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Removes focus sentinel elements.
|
|
196
|
-
*/
|
|
197
|
-
private removeFocusSentinels(): void {
|
|
198
|
-
this.focusSentinelStart?.remove();
|
|
199
|
-
this.focusSentinelEnd?.remove();
|
|
200
|
-
this.focusSentinelStart = null;
|
|
201
|
-
this.focusSentinelEnd = null;
|
|
202
|
-
}
|
|
203
129
|
}
|
|
@@ -2,16 +2,28 @@
|
|
|
2
2
|
// Provides WCAG AA compliant accessibility infrastructure
|
|
3
3
|
|
|
4
4
|
// Services
|
|
5
|
-
export {
|
|
5
|
+
export {
|
|
6
|
+
AriaIdService,
|
|
7
|
+
type AriaAccordionIds,
|
|
8
|
+
type AriaDialogIds,
|
|
9
|
+
type AriaMenuIds,
|
|
10
|
+
type AriaTabIds,
|
|
11
|
+
} from './aria-id.service';
|
|
6
12
|
export { FocusManagementService, type FocusOptions } from './focus-management.service';
|
|
7
|
-
export {
|
|
13
|
+
export {
|
|
14
|
+
LiveAnnouncerService,
|
|
15
|
+
type Announcement,
|
|
16
|
+
type AnnouncementPriority,
|
|
17
|
+
} from './live-region.directive';
|
|
8
18
|
|
|
9
19
|
// Directives
|
|
10
20
|
export { ClickOutsideDirective } from './click-outside.directive';
|
|
11
21
|
export { FocusTrapDirective } from './focus-trap.directive';
|
|
12
22
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
23
|
+
KeyboardNavigationDirective,
|
|
24
|
+
type KeyboardNavigationConfig,
|
|
25
|
+
type NavigationDirection,
|
|
26
|
+
type NavigationEvent,
|
|
15
27
|
} from './keyboard-navigation.directive';
|
|
16
28
|
export { LiveRegionDirective, StatusAnnouncerDirective } from './live-region.directive';
|
|
17
29
|
|
|
@@ -20,4 +32,3 @@ export { VisuallyHidden, VisuallyHiddenInput } from './visually-hidden.component
|
|
|
20
32
|
|
|
21
33
|
// Touch Target Utilities
|
|
22
34
|
export { MinTouchTarget, TouchTargetDirective } from './touch-target.directive';
|
|
23
|
-
|
|
@@ -87,7 +87,9 @@ export class KeyboardNavigationDirective implements OnInit, OnDestroy {
|
|
|
87
87
|
readonly moveFocus = input<boolean>(true);
|
|
88
88
|
|
|
89
89
|
/** CSS selector for navigable items */
|
|
90
|
-
readonly itemSelector = input<string>(
|
|
90
|
+
readonly itemSelector = input<string>(
|
|
91
|
+
'[role="menuitem"], [role="option"], [role="tab"], [role="treeitem"], li, button',
|
|
92
|
+
);
|
|
91
93
|
|
|
92
94
|
/** Enable typeahead search */
|
|
93
95
|
readonly typeahead = input<boolean>(true);
|
|
@@ -127,7 +129,7 @@ export class KeyboardNavigationDirective implements OnInit, OnDestroy {
|
|
|
127
129
|
const selector = this.itemSelector();
|
|
128
130
|
const elements = Array.from(container.querySelectorAll(selector)) as HTMLElement[];
|
|
129
131
|
return elements.filter(
|
|
130
|
-
(el) => !el.hasAttribute('disabled') && el.getAttribute('aria-disabled') !== 'true'
|
|
132
|
+
(el) => !el.hasAttribute('disabled') && el.getAttribute('aria-disabled') !== 'true',
|
|
131
133
|
);
|
|
132
134
|
}
|
|
133
135
|
|
|
@@ -383,12 +385,7 @@ export class KeyboardNavigationDirective implements OnInit, OnDestroy {
|
|
|
383
385
|
*/
|
|
384
386
|
private isTypeaheadKey(event: KeyboardEvent): boolean {
|
|
385
387
|
// Single printable character
|
|
386
|
-
return
|
|
387
|
-
event.key.length === 1 &&
|
|
388
|
-
!event.ctrlKey &&
|
|
389
|
-
!event.metaKey &&
|
|
390
|
-
!event.altKey
|
|
391
|
-
);
|
|
388
|
+
return event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey;
|
|
392
389
|
}
|
|
393
390
|
|
|
394
391
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { DOCUMENT } from '@angular/common';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
Directive,
|
|
4
|
+
ElementRef,
|
|
5
|
+
Injectable,
|
|
6
|
+
OnDestroy,
|
|
7
|
+
OnInit,
|
|
8
|
+
inject,
|
|
9
|
+
input,
|
|
10
|
+
signal,
|
|
11
11
|
} from '@angular/core';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -47,7 +47,7 @@ export class LiveAnnouncerService implements OnDestroy {
|
|
|
47
47
|
announce(
|
|
48
48
|
message: string,
|
|
49
49
|
priority: AnnouncementPriority = 'polite',
|
|
50
|
-
clearAfter: number = 1000
|
|
50
|
+
clearAfter: number = 1000,
|
|
51
51
|
): void {
|
|
52
52
|
this.ensureLiveRegions();
|
|
53
53
|
|
|
@@ -67,10 +67,7 @@ export class LiveAnnouncerService implements OnDestroy {
|
|
|
67
67
|
region.textContent = message;
|
|
68
68
|
|
|
69
69
|
// Track announcement
|
|
70
|
-
this.announcements.update((list) => [
|
|
71
|
-
...list,
|
|
72
|
-
{ message, priority, timestamp: Date.now() },
|
|
73
|
-
]);
|
|
70
|
+
this.announcements.update((list) => [...list, { message, priority, timestamp: Date.now() }]);
|
|
74
71
|
|
|
75
72
|
// Clear after delay
|
|
76
73
|
this.clearTimeoutId = setTimeout(() => {
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Directive,
|
|
3
|
-
ElementRef,
|
|
4
|
-
OnInit,
|
|
5
|
-
Renderer2,
|
|
6
|
-
inject,
|
|
7
|
-
input,
|
|
8
|
-
} from '@angular/core';
|
|
1
|
+
import { Directive, ElementRef, OnInit, Renderer2, inject, input } from '@angular/core';
|
|
9
2
|
|
|
10
3
|
/**
|
|
11
4
|
* TouchTarget directive - expands the clickable/tappable area of an element
|
|
@@ -38,7 +38,7 @@ export const ANIMATION_PRESETS = {
|
|
|
38
38
|
* Manages the 4-state animation lifecycle
|
|
39
39
|
*/
|
|
40
40
|
export function createAnimationState(
|
|
41
|
-
initialState: AnimationState = 'closed'
|
|
41
|
+
initialState: AnimationState = 'closed',
|
|
42
42
|
): Signal<AnimationState> {
|
|
43
43
|
return signal<AnimationState>(initialState);
|
|
44
44
|
}
|
|
@@ -49,7 +49,7 @@ export function createAnimationState(
|
|
|
49
49
|
export function getAnimationClasses(
|
|
50
50
|
state: AnimationState,
|
|
51
51
|
direction?: AnimationSide,
|
|
52
|
-
animate: boolean = true
|
|
52
|
+
animate: boolean = true,
|
|
53
53
|
): string {
|
|
54
54
|
if (!animate) return '';
|
|
55
55
|
|
|
@@ -76,10 +76,7 @@ export function getAnimationClasses(
|
|
|
76
76
|
/**
|
|
77
77
|
* Get slide animation classes based on direction
|
|
78
78
|
*/
|
|
79
|
-
export function getSlideAnimationClasses(
|
|
80
|
-
state: AnimationState,
|
|
81
|
-
direction: AnimationSide
|
|
82
|
-
): string {
|
|
79
|
+
export function getSlideAnimationClasses(state: AnimationState, direction: AnimationSide): string {
|
|
83
80
|
const baseClasses = ['duration-200'];
|
|
84
81
|
|
|
85
82
|
const directionMap: Record<AnimationState, Record<AnimationSide, string>> = {
|
|
@@ -118,7 +115,7 @@ export function getSlideAnimationClasses(
|
|
|
118
115
|
export function buildAnimationAttributes(
|
|
119
116
|
state: AnimationState,
|
|
120
117
|
side?: AnimationSide,
|
|
121
|
-
align?: AnimationAlign
|
|
118
|
+
align?: AnimationAlign,
|
|
122
119
|
): Record<string, string | undefined> {
|
|
123
120
|
return {
|
|
124
121
|
'data-state': state,
|
|
@@ -3,15 +3,25 @@
|
|
|
3
3
|
* Exports all animation utilities and services
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export type {
|
|
6
|
+
export type {
|
|
7
|
+
AnimatedElementAttributes,
|
|
8
|
+
AnimationAlign,
|
|
9
|
+
AnimationConfig,
|
|
10
|
+
AnimationSide,
|
|
11
|
+
AnimationState,
|
|
12
|
+
PresenceToken,
|
|
13
|
+
} from './animation.types';
|
|
7
14
|
|
|
8
15
|
export { AnimatedDirective } from './animated.directive';
|
|
9
16
|
export { AnimationTokensService } from './animation-tokens.service';
|
|
10
17
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
ANIMATION_PRESETS,
|
|
19
|
+
areAnimationsEnabled,
|
|
20
|
+
buildAnimationAttributes,
|
|
21
|
+
createAnimationState,
|
|
22
|
+
getAnimationClasses,
|
|
23
|
+
getSlideAnimationClasses,
|
|
24
|
+
waitForAnimation,
|
|
14
25
|
} from './animation.utils';
|
|
15
26
|
export { Presence, type PresenceState } from './presence.component';
|
|
16
27
|
export { PresenceIfDirective, PresenceService } from './presence.directive';
|
|
17
|
-
|