@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
|
@@ -2,10 +2,6 @@ import { cn } from '@/lib/utils';
|
|
|
2
2
|
import { ChangeDetectionStrategy, Component, computed, input, signal } from '@angular/core';
|
|
3
3
|
import { MENUBAR_CONTEXT, type MenubarContextValue } from './menubar-context';
|
|
4
4
|
|
|
5
|
-
// ============================================================================
|
|
6
|
-
// Types
|
|
7
|
-
// ============================================================================
|
|
8
|
-
|
|
9
5
|
/**
|
|
10
6
|
* Props for the Menubar component
|
|
11
7
|
*/
|
|
@@ -17,10 +13,6 @@ export interface MenubarProps {
|
|
|
17
13
|
class?: string;
|
|
18
14
|
}
|
|
19
15
|
|
|
20
|
-
// ============================================================================
|
|
21
|
-
// Component
|
|
22
|
-
// ============================================================================
|
|
23
|
-
|
|
24
16
|
/**
|
|
25
17
|
* @component Menubar
|
|
26
18
|
*
|
|
@@ -117,10 +109,10 @@ export interface MenubarProps {
|
|
|
117
109
|
menuIds,
|
|
118
110
|
focusedMenuIndex,
|
|
119
111
|
registerMenu: (menuId: string) => {
|
|
120
|
-
menuIds.update(ids => [...ids, menuId]);
|
|
112
|
+
menuIds.update((ids) => [...ids, menuId]);
|
|
121
113
|
},
|
|
122
114
|
unregisterMenu: (menuId: string) => {
|
|
123
|
-
menuIds.update(ids => ids.filter(id => id !== menuId));
|
|
115
|
+
menuIds.update((ids) => ids.filter((id) => id !== menuId));
|
|
124
116
|
},
|
|
125
117
|
focusNextMenu: () => {
|
|
126
118
|
const ids = menuIds();
|
|
@@ -139,8 +131,9 @@ export interface MenubarProps {
|
|
|
139
131
|
},
|
|
140
132
|
],
|
|
141
133
|
host: {
|
|
134
|
+
'attr.data-slot': '"menubar"',
|
|
142
135
|
'[class]': 'computedClass()',
|
|
143
|
-
|
|
136
|
+
role: 'menubar',
|
|
144
137
|
'aria-orientation': 'horizontal',
|
|
145
138
|
},
|
|
146
139
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -152,7 +145,7 @@ export class Menubar {
|
|
|
152
145
|
protected readonly computedClass = computed(() =>
|
|
153
146
|
cn(
|
|
154
147
|
'flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm',
|
|
155
|
-
this.class()
|
|
156
|
-
)
|
|
148
|
+
this.class(),
|
|
149
|
+
),
|
|
157
150
|
);
|
|
158
151
|
}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
Component,
|
|
5
|
-
computed,
|
|
6
|
-
input,
|
|
7
|
-
} from '@angular/core';
|
|
8
|
-
import {
|
|
9
|
-
nativeSelectVariants,
|
|
10
|
-
type NativeSelectVariants,
|
|
11
|
-
} from './native-select-variants';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
3
|
+
import { nativeSelectVariants, type NativeSelectVariants } from './native-select-variants';
|
|
12
4
|
|
|
13
5
|
/**
|
|
14
6
|
* NativeSelect component - styled HTML native select element.
|
|
@@ -46,10 +38,11 @@ import {
|
|
|
46
38
|
@Component({
|
|
47
39
|
// Use attribute selector to apply to native select elements
|
|
48
40
|
selector: 'select[NativeSelect], NativeSelect',
|
|
41
|
+
standalone: true,
|
|
49
42
|
template: `<ng-content />`,
|
|
50
43
|
host: {
|
|
51
44
|
'[class]': 'computedClass()',
|
|
52
|
-
'data-slot': 'native-select',
|
|
45
|
+
'attr.data-slot': '"native-select"',
|
|
53
46
|
},
|
|
54
47
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
55
48
|
})
|
|
@@ -66,9 +59,15 @@ export class NativeSelect {
|
|
|
66
59
|
nativeSelectVariants({
|
|
67
60
|
size: this.size(),
|
|
68
61
|
}),
|
|
69
|
-
//
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
62
|
+
// Chevron arrow — light mode (gray-700 stroke, visible on light backgrounds)
|
|
63
|
+
"bg-[image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E\")]",
|
|
64
|
+
// Chevron arrow — dark mode (neutral-400 stroke, visible on dark backgrounds)
|
|
65
|
+
"dark:bg-[image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E\")]",
|
|
66
|
+
'bg-[size:16px_16px]',
|
|
67
|
+
'bg-[position:right_0.5rem_center]',
|
|
68
|
+
'bg-no-repeat',
|
|
69
|
+
'pr-8',
|
|
70
|
+
this.class(),
|
|
71
|
+
),
|
|
73
72
|
);
|
|
74
73
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Context and types
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
NAVIGATION_MENU_CONTEXT,
|
|
4
|
+
NAVIGATION_MENU_ITEM_CONTEXT,
|
|
5
|
+
type NavigationMenuContextValue,
|
|
6
|
+
type NavigationMenuDirection,
|
|
7
|
+
type NavigationMenuItemContextValue,
|
|
8
|
+
type NavigationMenuOrientation,
|
|
9
9
|
} from './navigation-menu-context';
|
|
10
10
|
|
|
11
11
|
// Components and their types
|
|
@@ -14,8 +14,10 @@ export { NavigationMenuIndicator } from './navigation-menu-indicator.component';
|
|
|
14
14
|
export { NavigationMenuItem } from './navigation-menu-item.component';
|
|
15
15
|
export { NavigationMenuLink } from './navigation-menu-link.component';
|
|
16
16
|
export { NavigationMenuList } from './navigation-menu-list.component';
|
|
17
|
-
export {
|
|
17
|
+
export {
|
|
18
|
+
navigationMenuTriggerStyle,
|
|
19
|
+
type NavigationMenuTriggerStyleProps,
|
|
20
|
+
} from './navigation-menu-trigger-style';
|
|
18
21
|
export { NavigationMenuTrigger } from './navigation-menu-trigger.component';
|
|
19
22
|
export { NavigationMenuViewport } from './navigation-menu-viewport.component';
|
|
20
23
|
export { NavigationMenu, type NavigationMenuProps } from './navigation-menu.component';
|
|
21
|
-
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { cn, Presence } from '@/lib/utils';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
ElementRef,
|
|
7
|
+
inject,
|
|
8
|
+
input,
|
|
9
|
+
} from '@angular/core';
|
|
3
10
|
import { NAVIGATION_MENU_CONTEXT, NAVIGATION_MENU_ITEM_CONTEXT } from './navigation-menu-context';
|
|
4
11
|
|
|
5
12
|
/**
|
|
@@ -11,15 +18,13 @@ import { NAVIGATION_MENU_CONTEXT, NAVIGATION_MENU_ITEM_CONTEXT } from './navigat
|
|
|
11
18
|
imports: [Presence],
|
|
12
19
|
template: `
|
|
13
20
|
<Presence [present]="itemContext.open()">
|
|
14
|
-
<div
|
|
15
|
-
[class]="computedClass()"
|
|
16
|
-
[attr.data-state]="itemContext.open() ? 'open' : 'closed'"
|
|
17
|
-
>
|
|
21
|
+
<div [class]="computedClass()" [attr.data-state]="itemContext.open() ? 'open' : 'closed'">
|
|
18
22
|
<ng-content />
|
|
19
23
|
</div>
|
|
20
24
|
</Presence>
|
|
21
25
|
`,
|
|
22
26
|
host: {
|
|
27
|
+
'attr.data-slot': '"navigation-menu-content"',
|
|
23
28
|
class: 'contents',
|
|
24
29
|
'(document:click)': 'onDocumentClick($event)',
|
|
25
30
|
'(document:keydown.escape)': 'onEscapeKey()',
|
|
@@ -27,13 +32,14 @@ import { NAVIGATION_MENU_CONTEXT, NAVIGATION_MENU_ITEM_CONTEXT } from './navigat
|
|
|
27
32
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
28
33
|
})
|
|
29
34
|
export class NavigationMenuContent {
|
|
30
|
-
protected readonly context = inject(NAVIGATION_MENU_CONTEXT);
|
|
31
|
-
protected readonly itemContext = inject(NAVIGATION_MENU_ITEM_CONTEXT);
|
|
32
|
-
private readonly elementRef = inject(ElementRef);
|
|
33
|
-
|
|
34
35
|
/** Additional CSS classes */
|
|
35
36
|
readonly class = input<string>('');
|
|
36
37
|
|
|
38
|
+
private readonly _elementRef = inject(ElementRef);
|
|
39
|
+
|
|
40
|
+
protected readonly context = inject(NAVIGATION_MENU_CONTEXT);
|
|
41
|
+
protected readonly itemContext = inject(NAVIGATION_MENU_ITEM_CONTEXT);
|
|
42
|
+
|
|
37
43
|
protected readonly computedClass = computed(() =>
|
|
38
44
|
cn(
|
|
39
45
|
'absolute left-0 top-full mt-2 w-full rounded-xl border bg-popover p-4 text-popover-foreground shadow-lg',
|
|
@@ -44,13 +50,13 @@ export class NavigationMenuContent {
|
|
|
44
50
|
'data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52',
|
|
45
51
|
'data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52',
|
|
46
52
|
'md:absolute md:w-auto',
|
|
47
|
-
this.class()
|
|
48
|
-
)
|
|
53
|
+
this.class(),
|
|
54
|
+
),
|
|
49
55
|
);
|
|
50
56
|
|
|
51
57
|
protected onDocumentClick(event: MouseEvent): void {
|
|
52
58
|
const target = event.target as HTMLElement;
|
|
53
|
-
const hostElement = this.
|
|
59
|
+
const hostElement = this._elementRef.nativeElement;
|
|
54
60
|
const parent = hostElement.closest('NavigationMenuItem');
|
|
55
61
|
|
|
56
62
|
if (parent && !parent.contains(target)) {
|
|
@@ -58,7 +64,6 @@ export class NavigationMenuContent {
|
|
|
58
64
|
this.context.activeItem.set(null);
|
|
59
65
|
}
|
|
60
66
|
}
|
|
61
|
-
|
|
62
67
|
protected onEscapeKey(): void {
|
|
63
68
|
this.itemContext.open.set(false);
|
|
64
69
|
this.context.activeItem.set(null);
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { InjectionToken, type WritableSignal } from '@angular/core';
|
|
2
2
|
|
|
3
|
-
// ============================================================================
|
|
4
|
-
// Types
|
|
5
|
-
// ============================================================================
|
|
6
|
-
|
|
7
3
|
/**
|
|
8
4
|
* Orientation of the navigation menu
|
|
9
5
|
*/
|
|
@@ -14,10 +10,6 @@ export type NavigationMenuOrientation = 'horizontal' | 'vertical';
|
|
|
14
10
|
*/
|
|
15
11
|
export type NavigationMenuDirection = 'ltr' | 'rtl';
|
|
16
12
|
|
|
17
|
-
// ============================================================================
|
|
18
|
-
// Context Interfaces
|
|
19
|
-
// ============================================================================
|
|
20
|
-
|
|
21
13
|
/**
|
|
22
14
|
* Context value for the NavigationMenu component
|
|
23
15
|
*
|
|
@@ -33,7 +25,7 @@ export interface NavigationMenuContextValue {
|
|
|
33
25
|
}
|
|
34
26
|
|
|
35
27
|
export const NAVIGATION_MENU_CONTEXT = new InjectionToken<NavigationMenuContextValue>(
|
|
36
|
-
'NAVIGATION_MENU_CONTEXT'
|
|
28
|
+
'NAVIGATION_MENU_CONTEXT',
|
|
37
29
|
);
|
|
38
30
|
|
|
39
31
|
/**
|
|
@@ -51,5 +43,5 @@ export interface NavigationMenuItemContextValue {
|
|
|
51
43
|
}
|
|
52
44
|
|
|
53
45
|
export const NAVIGATION_MENU_ITEM_CONTEXT = new InjectionToken<NavigationMenuItemContextValue>(
|
|
54
|
-
'NAVIGATION_MENU_ITEM_CONTEXT'
|
|
46
|
+
'NAVIGATION_MENU_ITEM_CONTEXT',
|
|
55
47
|
);
|
|
@@ -11,6 +11,7 @@ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/co
|
|
|
11
11
|
<div class="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"></div>
|
|
12
12
|
`,
|
|
13
13
|
host: {
|
|
14
|
+
'attr.data-slot': '"navigation-menu-indicator"',
|
|
14
15
|
'[class]': 'computedClass()',
|
|
15
16
|
},
|
|
16
17
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -22,7 +23,7 @@ export class NavigationMenuIndicator {
|
|
|
22
23
|
protected readonly computedClass = computed(() =>
|
|
23
24
|
cn(
|
|
24
25
|
'top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in',
|
|
25
|
-
this.class()
|
|
26
|
-
)
|
|
26
|
+
this.class(),
|
|
27
|
+
),
|
|
27
28
|
);
|
|
28
29
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ChangeDetectionStrategy, Component, inject, signal } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
NAVIGATION_MENU_CONTEXT,
|
|
4
|
+
NAVIGATION_MENU_ITEM_CONTEXT,
|
|
5
|
+
type NavigationMenuItemContextValue,
|
|
6
|
+
} from './navigation-menu-context';
|
|
3
7
|
|
|
4
8
|
let itemIdCounter = 0;
|
|
5
9
|
|
|
@@ -20,6 +24,7 @@ let itemIdCounter = 0;
|
|
|
20
24
|
},
|
|
21
25
|
],
|
|
22
26
|
host: {
|
|
27
|
+
'attr.data-slot': '"navigation-menu-item"',
|
|
23
28
|
class: 'relative',
|
|
24
29
|
},
|
|
25
30
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -12,6 +12,7 @@ import { navigationMenuTriggerStyle } from './navigation-menu-trigger-style';
|
|
|
12
12
|
selector: 'NavigationMenuLink',
|
|
13
13
|
template: `<ng-content />`,
|
|
14
14
|
host: {
|
|
15
|
+
'attr.data-slot': '"navigation-menu-link"',
|
|
15
16
|
'[class]': 'computedClass()',
|
|
16
17
|
'[attr.aria-current]': 'ariaCurrent()',
|
|
17
18
|
'[attr.data-active]': 'active() || null',
|
|
@@ -29,15 +30,9 @@ export class NavigationMenuLink {
|
|
|
29
30
|
readonly class = input<string>('');
|
|
30
31
|
|
|
31
32
|
/** Calculate aria-current value */
|
|
32
|
-
protected readonly ariaCurrent = computed(() =>
|
|
33
|
-
this.active() ? this.currentType() : null
|
|
34
|
-
);
|
|
33
|
+
protected readonly ariaCurrent = computed(() => (this.active() ? this.currentType() : null));
|
|
35
34
|
|
|
36
35
|
protected readonly computedClass = computed(() =>
|
|
37
|
-
cn(
|
|
38
|
-
navigationMenuTriggerStyle(),
|
|
39
|
-
this.active() && 'bg-accent/50 font-medium',
|
|
40
|
-
this.class()
|
|
41
|
-
)
|
|
36
|
+
cn(navigationMenuTriggerStyle(), this.active() && 'bg-accent/50 font-medium', this.class()),
|
|
42
37
|
);
|
|
43
38
|
}
|
|
@@ -9,6 +9,7 @@ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/co
|
|
|
9
9
|
selector: 'NavigationMenuList',
|
|
10
10
|
template: `<ng-content />`,
|
|
11
11
|
host: {
|
|
12
|
+
'attr.data-slot': '"navigation-menu-list"',
|
|
12
13
|
'[class]': 'computedClass()',
|
|
13
14
|
},
|
|
14
15
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -18,9 +19,6 @@ export class NavigationMenuList {
|
|
|
18
19
|
readonly class = input<string>('');
|
|
19
20
|
|
|
20
21
|
protected readonly computedClass = computed(() =>
|
|
21
|
-
cn(
|
|
22
|
-
'group flex flex-1 list-none items-center justify-center space-x-1',
|
|
23
|
-
this.class()
|
|
24
|
-
)
|
|
22
|
+
cn('group flex flex-1 list-none items-center justify-center space-x-1', this.class()),
|
|
25
23
|
);
|
|
26
24
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
2
2
|
|
|
3
3
|
export const navigationMenuTriggerStyle = cva(
|
|
4
|
-
'group inline-flex h-10 w-max items-center justify-center gap-1 rounded-full bg-background px-5 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50'
|
|
4
|
+
'group inline-flex h-10 w-max items-center justify-center gap-1 rounded-full bg-background px-5 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50',
|
|
5
5
|
);
|
|
6
6
|
|
|
7
7
|
export type NavigationMenuTriggerStyleProps = VariantProps<typeof navigationMenuTriggerStyle>;
|
|
@@ -20,6 +20,7 @@ import { navigationMenuTriggerStyle } from './navigation-menu-trigger-style';
|
|
|
20
20
|
/>
|
|
21
21
|
`,
|
|
22
22
|
host: {
|
|
23
|
+
'attr.data-slot': '"navigation-menu-trigger"',
|
|
23
24
|
'[class]': 'computedClass()',
|
|
24
25
|
'[attr.data-state]': 'itemContext.open() ? "open" : "closed"',
|
|
25
26
|
'(click)': 'toggle()',
|
|
@@ -28,26 +29,26 @@ import { navigationMenuTriggerStyle } from './navigation-menu-trigger-style';
|
|
|
28
29
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
29
30
|
})
|
|
30
31
|
export class NavigationMenuTrigger {
|
|
31
|
-
protected readonly context = inject(NAVIGATION_MENU_CONTEXT);
|
|
32
|
-
protected readonly itemContext = inject(NAVIGATION_MENU_ITEM_CONTEXT);
|
|
33
|
-
protected readonly ChevronDownIcon = ChevronDown;
|
|
34
|
-
|
|
35
32
|
/** Additional CSS classes */
|
|
36
33
|
readonly class = input<string>('');
|
|
37
34
|
|
|
35
|
+
protected readonly context = inject(NAVIGATION_MENU_CONTEXT);
|
|
36
|
+
protected readonly itemContext = inject(NAVIGATION_MENU_ITEM_CONTEXT);
|
|
37
|
+
|
|
38
38
|
protected readonly computedClass = computed(() =>
|
|
39
|
-
cn(navigationMenuTriggerStyle(), 'group', this.class())
|
|
39
|
+
cn(navigationMenuTriggerStyle(), 'group', this.class()),
|
|
40
40
|
);
|
|
41
41
|
|
|
42
|
+
protected readonly ChevronDownIcon = ChevronDown;
|
|
43
|
+
|
|
42
44
|
protected toggle(): void {
|
|
43
|
-
this.itemContext.open.update(v => !v);
|
|
45
|
+
this.itemContext.open.update((v) => !v);
|
|
44
46
|
if (this.itemContext.open()) {
|
|
45
47
|
this.context.activeItem.set(this.itemContext.itemId);
|
|
46
48
|
} else {
|
|
47
49
|
this.context.activeItem.set(null);
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
|
-
|
|
51
52
|
protected onMouseEnter(): void {
|
|
52
53
|
const activeItem = this.context.activeItem();
|
|
53
54
|
if (activeItem && activeItem !== this.itemContext.itemId) {
|
|
@@ -9,6 +9,7 @@ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/co
|
|
|
9
9
|
selector: 'NavigationMenuViewport',
|
|
10
10
|
template: `<ng-content />`,
|
|
11
11
|
host: {
|
|
12
|
+
'attr.data-slot': '"navigation-menu-viewport"',
|
|
12
13
|
'[class]': 'computedClass()',
|
|
13
14
|
},
|
|
14
15
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -20,7 +21,7 @@ export class NavigationMenuViewport {
|
|
|
20
21
|
protected readonly computedClass = computed(() =>
|
|
21
22
|
cn(
|
|
22
23
|
'origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]',
|
|
23
|
-
this.class()
|
|
24
|
-
)
|
|
24
|
+
this.class(),
|
|
25
|
+
),
|
|
25
26
|
);
|
|
26
27
|
}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
2
|
import { ChangeDetectionStrategy, Component, computed, input, signal } from '@angular/core';
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
NAVIGATION_MENU_CONTEXT,
|
|
5
|
+
type NavigationMenuContextValue,
|
|
6
|
+
type NavigationMenuOrientation,
|
|
7
7
|
} from './navigation-menu-context';
|
|
8
8
|
import { NavigationMenuViewport } from './navigation-menu-viewport.component';
|
|
9
9
|
|
|
10
|
-
// ============================================================================
|
|
11
|
-
// Types
|
|
12
|
-
// ============================================================================
|
|
13
|
-
|
|
14
10
|
/**
|
|
15
11
|
* Props for the NavigationMenu component
|
|
16
12
|
*/
|
|
@@ -32,10 +28,6 @@ export interface NavigationMenuProps {
|
|
|
32
28
|
class?: string;
|
|
33
29
|
}
|
|
34
30
|
|
|
35
|
-
// ============================================================================
|
|
36
|
-
// Component
|
|
37
|
-
// ============================================================================
|
|
38
|
-
|
|
39
31
|
/**
|
|
40
32
|
* @component NavigationMenu
|
|
41
33
|
*
|
|
@@ -122,6 +114,10 @@ export interface NavigationMenuProps {
|
|
|
122
114
|
<NavigationMenuViewport />
|
|
123
115
|
</div>
|
|
124
116
|
`,
|
|
117
|
+
host: {
|
|
118
|
+
'attr.data-slot': '"navigation-menu"',
|
|
119
|
+
style: 'display: contents',
|
|
120
|
+
},
|
|
125
121
|
providers: [
|
|
126
122
|
{
|
|
127
123
|
provide: NAVIGATION_MENU_CONTEXT,
|
|
@@ -141,9 +137,6 @@ export class NavigationMenu {
|
|
|
141
137
|
readonly class = input<string>('');
|
|
142
138
|
|
|
143
139
|
protected readonly computedClass = computed(() =>
|
|
144
|
-
cn(
|
|
145
|
-
'relative z-10 flex max-w-max flex-1 items-center justify-center gap-1',
|
|
146
|
-
this.class()
|
|
147
|
-
)
|
|
140
|
+
cn('relative z-10 flex max-w-max flex-1 items-center justify-center gap-1', this.class()),
|
|
148
141
|
);
|
|
149
142
|
}
|
|
@@ -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
|
* PaginationContent component - ul container.
|
|
@@ -14,6 +9,7 @@ import {
|
|
|
14
9
|
selector: 'PaginationContent',
|
|
15
10
|
template: `<ng-content />`,
|
|
16
11
|
host: {
|
|
12
|
+
'attr.data-slot': '"pagination-content"',
|
|
17
13
|
'[class]': 'computedClass()',
|
|
18
14
|
},
|
|
19
15
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -23,6 +19,6 @@ export class PaginationContent {
|
|
|
23
19
|
readonly class = input<string>('');
|
|
24
20
|
|
|
25
21
|
protected readonly computedClass = computed(() =>
|
|
26
|
-
cn('flex flex-row items-center gap-1', this.class())
|
|
22
|
+
cn('flex flex-row items-center gap-1', 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
|
* PaginationEllipsis component - shows more pages indicator.
|
|
@@ -32,6 +27,7 @@ import {
|
|
|
32
27
|
<span class="sr-only">More pages</span>
|
|
33
28
|
`,
|
|
34
29
|
host: {
|
|
30
|
+
'attr.data-slot': '"pagination-ellipsis"',
|
|
35
31
|
'[class]': 'computedClass()',
|
|
36
32
|
'[attr.aria-hidden]': '"true"',
|
|
37
33
|
},
|
|
@@ -42,6 +38,6 @@ export class PaginationEllipsis {
|
|
|
42
38
|
readonly class = input<string>('');
|
|
43
39
|
|
|
44
40
|
protected readonly computedClass = computed(() =>
|
|
45
|
-
cn('flex h-9 w-9 items-center justify-center', this.class())
|
|
41
|
+
cn('flex h-9 w-9 items-center justify-center', this.class()),
|
|
46
42
|
);
|
|
47
43
|
}
|
|
@@ -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
|
* PaginationItem component - li container.
|
|
@@ -14,6 +9,7 @@ import {
|
|
|
14
9
|
selector: 'PaginationItem',
|
|
15
10
|
template: `<ng-content />`,
|
|
16
11
|
host: {
|
|
12
|
+
'attr.data-slot': '"pagination-item"',
|
|
17
13
|
'[class]': 'computedClass()',
|
|
18
14
|
},
|
|
19
15
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -22,7 +18,5 @@ export class PaginationItem {
|
|
|
22
18
|
/** Additional CSS classes */
|
|
23
19
|
readonly class = input<string>('');
|
|
24
20
|
|
|
25
|
-
protected readonly computedClass = computed(() =>
|
|
26
|
-
cn('', this.class())
|
|
27
|
-
);
|
|
21
|
+
protected readonly computedClass = computed(() => cn('', 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
|
import { buttonVariants } from '../button/button-variants';
|
|
9
4
|
|
|
10
5
|
/**
|
|
@@ -15,6 +10,7 @@ import { buttonVariants } from '../button/button-variants';
|
|
|
15
10
|
selector: 'PaginationLink',
|
|
16
11
|
template: `<ng-content />`,
|
|
17
12
|
host: {
|
|
13
|
+
'attr.data-slot': '"pagination-link"',
|
|
18
14
|
'[class]': 'computedClass()',
|
|
19
15
|
'[attr.href]': 'href()',
|
|
20
16
|
'[attr.aria-current]': 'isActive() ? "page" : null',
|
|
@@ -40,7 +36,7 @@ export class PaginationLink {
|
|
|
40
36
|
variant: this.isActive() ? 'outline' : 'ghost',
|
|
41
37
|
size: this.size(),
|
|
42
38
|
}),
|
|
43
|
-
this.class()
|
|
44
|
-
)
|
|
39
|
+
this.class(),
|
|
40
|
+
),
|
|
45
41
|
);
|
|
46
42
|
}
|
|
@@ -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
|
import { buttonVariants } from '../button/button-variants';
|
|
9
4
|
|
|
10
5
|
/**
|
|
@@ -31,6 +26,7 @@ import { buttonVariants } from '../button/button-variants';
|
|
|
31
26
|
</svg>
|
|
32
27
|
`,
|
|
33
28
|
host: {
|
|
29
|
+
'attr.data-slot': '"pagination-next"',
|
|
34
30
|
'[class]': 'computedClass()',
|
|
35
31
|
'[attr.href]': 'href()',
|
|
36
32
|
'[attr.aria-label]': '"Go to next page"',
|
|
@@ -45,10 +41,6 @@ export class PaginationNext {
|
|
|
45
41
|
readonly class = input<string>('');
|
|
46
42
|
|
|
47
43
|
protected readonly computedClass = computed(() =>
|
|
48
|
-
cn(
|
|
49
|
-
buttonVariants({ variant: 'ghost', size: 'default' }),
|
|
50
|
-
'gap-1 pr-2.5',
|
|
51
|
-
this.class()
|
|
52
|
-
)
|
|
44
|
+
cn(buttonVariants({ variant: 'ghost', size: 'default' }), 'gap-1 pr-2.5', this.class()),
|
|
53
45
|
);
|
|
54
46
|
}
|
|
@@ -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
|
import { buttonVariants } from '../button/button-variants';
|
|
9
4
|
|
|
10
5
|
/**
|
|
@@ -31,6 +26,7 @@ import { buttonVariants } from '../button/button-variants';
|
|
|
31
26
|
<span>Previous</span>
|
|
32
27
|
`,
|
|
33
28
|
host: {
|
|
29
|
+
'attr.data-slot': '"pagination-previous"',
|
|
34
30
|
'[class]': 'computedClass()',
|
|
35
31
|
'[attr.href]': 'href()',
|
|
36
32
|
'[attr.aria-label]': '"Go to previous page"',
|
|
@@ -45,10 +41,6 @@ export class PaginationPrevious {
|
|
|
45
41
|
readonly class = input<string>('');
|
|
46
42
|
|
|
47
43
|
protected readonly computedClass = computed(() =>
|
|
48
|
-
cn(
|
|
49
|
-
buttonVariants({ variant: 'ghost', size: 'default' }),
|
|
50
|
-
'gap-1 pl-2.5',
|
|
51
|
-
this.class()
|
|
52
|
-
)
|
|
44
|
+
cn(buttonVariants({ variant: 'ghost', size: 'default' }), 'gap-1 pl-2.5', this.class()),
|
|
53
45
|
);
|
|
54
46
|
}
|