@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,9 +1,5 @@
|
|
|
1
1
|
import { InjectionToken, type WritableSignal } from '@angular/core';
|
|
2
2
|
|
|
3
|
-
// ============================================================================
|
|
4
|
-
// Types
|
|
5
|
-
// ============================================================================
|
|
6
|
-
|
|
7
3
|
export type InputOTPRenderFn = (props: { slots: InputOTPSlotProps[] }) => unknown;
|
|
8
4
|
|
|
9
5
|
export interface InputOTPSlotProps {
|
|
@@ -24,8 +20,4 @@ export interface InputOTPContextValue {
|
|
|
24
20
|
activeIndex: WritableSignal<number>;
|
|
25
21
|
}
|
|
26
22
|
|
|
27
|
-
// ============================================================================
|
|
28
|
-
// Injection Tokens
|
|
29
|
-
// ============================================================================
|
|
30
|
-
|
|
31
23
|
export const INPUT_OTP_CONTEXT = new InjectionToken<InputOTPContextValue>('INPUT_OTP_CONTEXT');
|
|
@@ -9,6 +9,7 @@ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/co
|
|
|
9
9
|
selector: 'InputOTPGroup',
|
|
10
10
|
template: `<ng-content />`,
|
|
11
11
|
host: {
|
|
12
|
+
'attr.data-slot': '"input-otp-group"',
|
|
12
13
|
'[class]': 'computedClass()',
|
|
13
14
|
},
|
|
14
15
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -17,7 +18,5 @@ export class InputOTPGroup {
|
|
|
17
18
|
/** Additional CSS classes */
|
|
18
19
|
readonly class = input<string>('');
|
|
19
20
|
|
|
20
|
-
protected readonly computedClass = computed(() =>
|
|
21
|
-
cn('flex items-center', this.class())
|
|
22
|
-
);
|
|
21
|
+
protected readonly computedClass = computed(() => cn('flex items-center', this.class()));
|
|
23
22
|
}
|
|
@@ -15,17 +15,18 @@ import { LucideAngularModule, Minus } from 'lucide-angular';
|
|
|
15
15
|
</div>
|
|
16
16
|
`,
|
|
17
17
|
host: {
|
|
18
|
+
'attr.data-slot': '"input-otp-separator"',
|
|
18
19
|
'[class]': 'computedClass()',
|
|
19
20
|
},
|
|
20
21
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21
22
|
})
|
|
22
23
|
export class InputOTPSeparator {
|
|
23
|
-
protected readonly icons = { Minus };
|
|
24
|
-
|
|
25
24
|
/** Additional CSS classes */
|
|
26
25
|
readonly class = input<string>('');
|
|
27
26
|
|
|
28
27
|
protected readonly computedClass = computed(() =>
|
|
29
|
-
cn('flex items-center justify-center', this.class())
|
|
28
|
+
cn('flex items-center justify-center', this.class()),
|
|
30
29
|
);
|
|
30
|
+
|
|
31
|
+
protected readonly icons = { Minus };
|
|
31
32
|
}
|
|
@@ -19,6 +19,7 @@ import { INPUT_OTP_CONTEXT } from './input-otp-context';
|
|
|
19
19
|
}
|
|
20
20
|
`,
|
|
21
21
|
host: {
|
|
22
|
+
'attr.data-slot': '"input-otp-slot"',
|
|
22
23
|
'[class]': 'computedClass()',
|
|
23
24
|
'[attr.data-active]': 'isActive() ? "" : null',
|
|
24
25
|
'[attr.aria-label]': 'ariaLabel()',
|
|
@@ -26,29 +27,27 @@ import { INPUT_OTP_CONTEXT } from './input-otp-context';
|
|
|
26
27
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
27
28
|
})
|
|
28
29
|
export class InputOTPSlot {
|
|
29
|
-
private readonly context = inject(INPUT_OTP_CONTEXT, { optional: true });
|
|
30
|
-
|
|
31
30
|
/** Index of this slot */
|
|
32
31
|
readonly index = input.required<number>();
|
|
33
32
|
|
|
34
33
|
/** Additional CSS classes */
|
|
35
34
|
readonly class = input<string>('');
|
|
36
35
|
|
|
36
|
+
private readonly _context = inject(INPUT_OTP_CONTEXT, { optional: true });
|
|
37
|
+
|
|
37
38
|
/** Character to display - reads from context value at this index */
|
|
38
39
|
protected readonly char = computed(() => {
|
|
39
|
-
const value = this.
|
|
40
|
+
const value = this._context?.value() ?? '';
|
|
40
41
|
return value[this.index()] ?? '';
|
|
41
42
|
});
|
|
42
|
-
|
|
43
43
|
/** Whether this slot is active - based on context activeIndex */
|
|
44
44
|
protected readonly isActive = computed(() => {
|
|
45
|
-
const activeIndex = this.
|
|
45
|
+
const activeIndex = this._context?.activeIndex() ?? -1;
|
|
46
46
|
return activeIndex === this.index();
|
|
47
47
|
});
|
|
48
|
-
|
|
49
48
|
/** ARIA label for the slot */
|
|
50
49
|
protected readonly ariaLabel = computed(() => {
|
|
51
|
-
const maxLength = this.
|
|
50
|
+
const maxLength = this._context?.maxLength() ?? 6;
|
|
52
51
|
const position = this.index() + 1;
|
|
53
52
|
const char = this.char();
|
|
54
53
|
if (char) {
|
|
@@ -56,12 +55,11 @@ export class InputOTPSlot {
|
|
|
56
55
|
}
|
|
57
56
|
return `Digit ${position} of ${maxLength}: empty`;
|
|
58
57
|
});
|
|
59
|
-
|
|
60
58
|
protected readonly computedClass = computed(() =>
|
|
61
59
|
cn(
|
|
62
60
|
'relative flex h-9 w-9 items-center justify-center border-y border-r border-input text-sm shadow-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md',
|
|
63
61
|
this.isActive() && 'z-10 ring-1 ring-ring',
|
|
64
|
-
this.class()
|
|
65
|
-
)
|
|
62
|
+
this.class(),
|
|
63
|
+
),
|
|
66
64
|
);
|
|
67
65
|
}
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
ElementRef,
|
|
7
|
+
forwardRef,
|
|
8
|
+
input,
|
|
9
|
+
model,
|
|
10
|
+
output,
|
|
11
|
+
signal,
|
|
12
|
+
viewChild,
|
|
13
13
|
} from '@angular/core';
|
|
14
14
|
import { FormsModule } from '@angular/forms';
|
|
15
15
|
import { INPUT_OTP_CONTEXT, type InputOTPContextValue } from './input-otp-context';
|
|
16
16
|
|
|
17
|
-
// ============================================================================
|
|
18
|
-
// Types
|
|
19
|
-
// ============================================================================
|
|
20
|
-
|
|
21
17
|
/**
|
|
22
18
|
* Props for the InputOTP component
|
|
23
19
|
*/
|
|
@@ -39,10 +35,6 @@ export interface InputOTPProps {
|
|
|
39
35
|
class?: string;
|
|
40
36
|
}
|
|
41
37
|
|
|
42
|
-
// ============================================================================
|
|
43
|
-
// Component
|
|
44
|
-
// ============================================================================
|
|
45
|
-
|
|
46
38
|
/**
|
|
47
39
|
* @component InputOTP
|
|
48
40
|
*
|
|
@@ -138,6 +130,7 @@ export interface InputOTPProps {
|
|
|
138
130
|
},
|
|
139
131
|
],
|
|
140
132
|
host: {
|
|
133
|
+
'attr.data-slot': '"input-otp"',
|
|
141
134
|
class: 'contents',
|
|
142
135
|
'[attr.data-disabled]': 'disabled() ? "" : null',
|
|
143
136
|
},
|
|
@@ -146,36 +139,34 @@ export interface InputOTPProps {
|
|
|
146
139
|
export class InputOTP {
|
|
147
140
|
private readonly hiddenInput = viewChild<ElementRef<HTMLInputElement>>('hiddenInput');
|
|
148
141
|
|
|
142
|
+
/** Event handler called when the value changes */
|
|
143
|
+
readonly onChange = output<string>();
|
|
144
|
+
/** Event handler called when all slots are filled */
|
|
145
|
+
readonly onComplete = output<string>();
|
|
146
|
+
|
|
149
147
|
/** The controlled value of the input */
|
|
150
148
|
readonly value = model<string>('');
|
|
151
149
|
|
|
152
|
-
/**
|
|
153
|
-
readonly
|
|
154
|
-
|
|
150
|
+
/** Additional CSS classes */
|
|
151
|
+
readonly class = input<string>('');
|
|
155
152
|
/** Maximum number of characters */
|
|
156
153
|
readonly maxLength = input<number>(6);
|
|
157
|
-
|
|
158
154
|
/** Whether the input is disabled */
|
|
159
155
|
readonly disabled = input<boolean>(false);
|
|
160
156
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
/** Event handler called when the value changes */
|
|
165
|
-
readonly onChange = output<string>();
|
|
166
|
-
|
|
167
|
-
/** Event handler called when all slots are filled */
|
|
168
|
-
readonly onComplete = output<string>();
|
|
157
|
+
protected readonly computedClass = computed(() =>
|
|
158
|
+
cn('relative flex items-center gap-2 has-[:disabled]:opacity-50', this.class()),
|
|
159
|
+
);
|
|
169
160
|
|
|
161
|
+
/** Internal value signal for context sharing */
|
|
162
|
+
readonly internalValue = signal<string>('');
|
|
170
163
|
protected readonly isFocused = signal(false);
|
|
171
164
|
readonly activeIndex = signal(-1);
|
|
172
165
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
)
|
|
178
|
-
);
|
|
166
|
+
/** Programmatically focus the input */
|
|
167
|
+
focus(): void {
|
|
168
|
+
this.hiddenInput()?.nativeElement.focus();
|
|
169
|
+
}
|
|
179
170
|
|
|
180
171
|
protected onInput(event: Event): void {
|
|
181
172
|
const target = event.target as HTMLInputElement;
|
|
@@ -190,7 +181,6 @@ export class InputOTP {
|
|
|
190
181
|
this.onComplete.emit(newValue);
|
|
191
182
|
}
|
|
192
183
|
}
|
|
193
|
-
|
|
194
184
|
protected onKeyDown(event: KeyboardEvent): void {
|
|
195
185
|
if (event.key === 'Backspace') {
|
|
196
186
|
const currentValue = this.value();
|
|
@@ -203,7 +193,6 @@ export class InputOTP {
|
|
|
203
193
|
}
|
|
204
194
|
}
|
|
205
195
|
}
|
|
206
|
-
|
|
207
196
|
protected onPaste(event: ClipboardEvent): void {
|
|
208
197
|
event.preventDefault();
|
|
209
198
|
const pastedData = event.clipboardData?.getData('text') ?? '';
|
|
@@ -222,19 +211,12 @@ export class InputOTP {
|
|
|
222
211
|
}
|
|
223
212
|
}
|
|
224
213
|
}
|
|
225
|
-
|
|
226
214
|
protected onFocus(): void {
|
|
227
215
|
this.isFocused.set(true);
|
|
228
216
|
this.activeIndex.set(this.value().length);
|
|
229
217
|
}
|
|
230
|
-
|
|
231
218
|
protected onBlur(): void {
|
|
232
219
|
this.isFocused.set(false);
|
|
233
220
|
this.activeIndex.set(-1);
|
|
234
221
|
}
|
|
235
|
-
|
|
236
|
-
/** Programmatically focus the input */
|
|
237
|
-
focus(): void {
|
|
238
|
-
this.hiddenInput()?.nativeElement.focus();
|
|
239
|
-
}
|
|
240
222
|
}
|
|
@@ -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 { kbdVariants, type KbdVariants } from './kbd-variants';
|
|
9
4
|
|
|
10
5
|
/**
|
|
@@ -27,6 +22,7 @@ import { kbdVariants, type KbdVariants } from './kbd-variants';
|
|
|
27
22
|
selector: 'Kbd',
|
|
28
23
|
template: `<ng-content />`,
|
|
29
24
|
host: {
|
|
25
|
+
'attr.data-slot': '"kbd"',
|
|
30
26
|
'[class]': 'computedClass()',
|
|
31
27
|
},
|
|
32
28
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -44,7 +40,7 @@ export class Kbd {
|
|
|
44
40
|
kbdVariants({
|
|
45
41
|
size: this.size(),
|
|
46
42
|
}),
|
|
47
|
-
this.class()
|
|
48
|
-
)
|
|
43
|
+
this.class(),
|
|
44
|
+
),
|
|
49
45
|
);
|
|
50
46
|
}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
ElementRef,
|
|
7
|
+
inject,
|
|
8
|
+
input,
|
|
9
9
|
} from '@angular/core';
|
|
10
10
|
|
|
11
|
-
// ============================================================================
|
|
12
|
-
// Types
|
|
13
|
-
// ============================================================================
|
|
14
|
-
|
|
15
11
|
export type LabelProps = {
|
|
16
12
|
/** ID of the form element this label is for */
|
|
17
13
|
for?: string;
|
|
@@ -21,10 +17,6 @@ export type LabelProps = {
|
|
|
21
17
|
class?: string;
|
|
22
18
|
};
|
|
23
19
|
|
|
24
|
-
// ============================================================================
|
|
25
|
-
// Label Component
|
|
26
|
-
// ============================================================================
|
|
27
|
-
|
|
28
20
|
/**
|
|
29
21
|
* Label component renders an accessible label associated with form controls.
|
|
30
22
|
* Based on Radix UI Label primitive with shadcn/ui styling.
|
|
@@ -76,11 +68,7 @@ export type LabelProps = {
|
|
|
76
68
|
@Component({
|
|
77
69
|
selector: 'Label',
|
|
78
70
|
template: `
|
|
79
|
-
<label
|
|
80
|
-
[attr.for]="forId()"
|
|
81
|
-
[class]="computedClass()"
|
|
82
|
-
(mousedown)="onMouseDown($event)"
|
|
83
|
-
>
|
|
71
|
+
<label [attr.for]="forId()" [class]="computedClass()" (mousedown)="onMouseDown($event)">
|
|
84
72
|
<ng-content />
|
|
85
73
|
</label>
|
|
86
74
|
`,
|
|
@@ -91,20 +79,17 @@ export type LabelProps = {
|
|
|
91
79
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
92
80
|
})
|
|
93
81
|
export class Label {
|
|
94
|
-
private readonly elementRef = inject(ElementRef<HTMLElement>);
|
|
95
|
-
|
|
96
82
|
/** ID of the form element this label is for */
|
|
97
83
|
readonly for = input<string>();
|
|
98
|
-
|
|
99
84
|
/** Alternative binding for 'for' attribute (React-style) */
|
|
100
85
|
readonly htmlFor = input<string>();
|
|
101
|
-
|
|
102
|
-
/** Computed ID - prefers 'for' over 'htmlFor' */
|
|
103
|
-
protected readonly forId = computed(() => this.for() || this.htmlFor());
|
|
104
|
-
|
|
105
86
|
/** Additional CSS classes to apply */
|
|
106
87
|
readonly class = input<string>('');
|
|
107
88
|
|
|
89
|
+
private readonly _elementRef = inject(ElementRef<HTMLElement>);
|
|
90
|
+
|
|
91
|
+
/** Computed ID - prefers 'for' over 'htmlFor' */
|
|
92
|
+
protected readonly forId = computed(() => this.for() || this.htmlFor());
|
|
108
93
|
/** Computed class combining base styles and custom classes */
|
|
109
94
|
protected readonly computedClass = computed(() =>
|
|
110
95
|
cn(
|
|
@@ -112,12 +97,14 @@ export class Label {
|
|
|
112
97
|
'flex items-center gap-2 text-sm font-medium leading-none',
|
|
113
98
|
// Cursor
|
|
114
99
|
'cursor-pointer select-none',
|
|
100
|
+
// Margin
|
|
101
|
+
'mb-2',
|
|
115
102
|
// Disabled states - peer for sibling inputs, group for parent containers
|
|
116
103
|
'peer-disabled:cursor-not-allowed peer-disabled:opacity-50',
|
|
117
104
|
'group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50',
|
|
118
105
|
// Custom classes
|
|
119
|
-
this.class()
|
|
120
|
-
)
|
|
106
|
+
this.class(),
|
|
107
|
+
),
|
|
121
108
|
);
|
|
122
109
|
|
|
123
110
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Context and types
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
MENUBAR_CONTEXT,
|
|
4
|
+
MENUBAR_MENU_CONTEXT,
|
|
5
|
+
type MenubarContextValue,
|
|
6
|
+
type MenubarDirection,
|
|
7
|
+
type MenubarMenuContextValue,
|
|
8
|
+
type MenubarNavigationDirection,
|
|
9
9
|
} from './menubar-context';
|
|
10
10
|
|
|
11
11
|
// Components and their types
|
|
@@ -14,7 +14,11 @@ export { MenubarContent } from './menubar-content.component';
|
|
|
14
14
|
export { MenubarItem } from './menubar-item.component';
|
|
15
15
|
export { MenubarLabel } from './menubar-label.component';
|
|
16
16
|
export { MenubarMenu } from './menubar-menu.component';
|
|
17
|
-
export {
|
|
17
|
+
export {
|
|
18
|
+
MENUBAR_RADIO_GROUP_CONTEXT,
|
|
19
|
+
MenubarRadioGroup,
|
|
20
|
+
type MenubarRadioGroupContext,
|
|
21
|
+
} from './menubar-radio-group.component';
|
|
18
22
|
export { MenubarRadioItem } from './menubar-radio-item.component';
|
|
19
23
|
export { MenubarSeparator } from './menubar-separator.component';
|
|
20
24
|
export { MenubarShortcut } from './menubar-shortcut.component';
|
|
@@ -23,4 +27,3 @@ export { MenubarSubTrigger } from './menubar-sub-trigger.component';
|
|
|
23
27
|
export { MENUBAR_SUB_CONTEXT, MenubarSub, type MenubarSubContext } from './menubar-sub.component';
|
|
24
28
|
export { MenubarTrigger } from './menubar-trigger.component';
|
|
25
29
|
export { Menubar, type MenubarProps } from './menubar.component';
|
|
26
|
-
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
inject,
|
|
7
|
+
input,
|
|
8
|
+
model,
|
|
9
|
+
output,
|
|
10
|
+
} from '@angular/core';
|
|
3
11
|
import { Check, LucideAngularModule } from 'lucide-angular';
|
|
4
12
|
import { MENUBAR_CONTEXT, MENUBAR_MENU_CONTEXT } from './menubar-context';
|
|
5
13
|
|
|
@@ -19,6 +27,7 @@ import { MENUBAR_CONTEXT, MENUBAR_MENU_CONTEXT } from './menubar-context';
|
|
|
19
27
|
<ng-content />
|
|
20
28
|
`,
|
|
21
29
|
host: {
|
|
30
|
+
'attr.data-slot': '"menubar-checkbox-item"',
|
|
22
31
|
'[class]': 'computedClass()',
|
|
23
32
|
'[attr.role]': '"menuitemcheckbox"',
|
|
24
33
|
'[attr.aria-checked]': 'checked()',
|
|
@@ -30,30 +39,30 @@ import { MENUBAR_CONTEXT, MENUBAR_MENU_CONTEXT } from './menubar-context';
|
|
|
30
39
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
31
40
|
})
|
|
32
41
|
export class MenubarCheckboxItem {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
protected readonly CheckIcon = Check;
|
|
42
|
+
/** Checked change event */
|
|
43
|
+
readonly onCheckedChange = output<boolean>();
|
|
36
44
|
|
|
37
45
|
/** Whether the checkbox is checked */
|
|
38
46
|
readonly checked = model<boolean>(false);
|
|
39
47
|
|
|
40
|
-
/** Whether the item is disabled */
|
|
41
|
-
readonly disabled = input<boolean>(false);
|
|
42
|
-
|
|
43
48
|
/** Additional CSS classes */
|
|
44
49
|
readonly class = input<string>('');
|
|
50
|
+
/** Whether the item is disabled */
|
|
51
|
+
readonly disabled = input<boolean>(false);
|
|
45
52
|
|
|
46
|
-
|
|
47
|
-
readonly
|
|
53
|
+
private readonly _context = inject(MENUBAR_CONTEXT);
|
|
54
|
+
private readonly _menuContext = inject(MENUBAR_MENU_CONTEXT);
|
|
48
55
|
|
|
49
56
|
protected readonly computedClass = computed(() =>
|
|
50
57
|
cn(
|
|
51
|
-
|
|
58
|
+
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
52
59
|
!this.disabled() && 'cursor-pointer hover:bg-accent hover:text-accent-foreground',
|
|
53
|
-
this.class()
|
|
54
|
-
)
|
|
60
|
+
this.class(),
|
|
61
|
+
),
|
|
55
62
|
);
|
|
56
63
|
|
|
64
|
+
protected readonly CheckIcon = Check;
|
|
65
|
+
|
|
57
66
|
protected handleClick(event: Event): void {
|
|
58
67
|
if (this.disabled()) {
|
|
59
68
|
event.preventDefault();
|