@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,19 +1,15 @@
|
|
|
1
1
|
import { cn, Presence } from '@/lib/utils';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
ElementRef,
|
|
7
|
+
inject,
|
|
8
|
+
input,
|
|
9
|
+
OnDestroy,
|
|
10
10
|
} from '@angular/core';
|
|
11
11
|
import { HOVER_CARD_CONTEXT, HoverCardAlign, HoverCardSide } from './hover-card-context';
|
|
12
12
|
|
|
13
|
-
// ============================================================================
|
|
14
|
-
// Types
|
|
15
|
-
// ============================================================================
|
|
16
|
-
|
|
17
13
|
export type HoverCardContentState = 'open' | 'closed';
|
|
18
14
|
|
|
19
15
|
/**
|
|
@@ -33,10 +29,6 @@ export interface HoverCardContentProps {
|
|
|
33
29
|
class?: string;
|
|
34
30
|
}
|
|
35
31
|
|
|
36
|
-
// ============================================================================
|
|
37
|
-
// Component
|
|
38
|
-
// ============================================================================
|
|
39
|
-
|
|
40
32
|
/**
|
|
41
33
|
* @component HoverCardContent
|
|
42
34
|
*
|
|
@@ -101,32 +93,24 @@ export interface HoverCardContentProps {
|
|
|
101
93
|
</Presence>
|
|
102
94
|
`,
|
|
103
95
|
host: {
|
|
96
|
+
'attr.data-slot': '"hover-card-content"',
|
|
104
97
|
class: 'contents',
|
|
105
98
|
},
|
|
106
99
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
107
100
|
})
|
|
108
101
|
export class HoverCardContent implements OnDestroy {
|
|
109
|
-
protected readonly context = inject(HOVER_CARD_CONTEXT);
|
|
110
|
-
private readonly elementRef = inject(ElementRef<HTMLElement>);
|
|
111
|
-
|
|
112
102
|
/** The preferred side of the trigger to render against */
|
|
113
103
|
readonly side = input<HoverCardSide>('bottom');
|
|
114
|
-
|
|
115
104
|
/** The distance in pixels from the trigger */
|
|
116
105
|
readonly sideOffset = input<number>(4);
|
|
117
|
-
|
|
118
106
|
/** The preferred alignment against the trigger */
|
|
119
107
|
readonly align = input<HoverCardAlign>('center');
|
|
120
|
-
|
|
121
108
|
/** Additional CSS classes */
|
|
122
109
|
readonly class = input<string>('');
|
|
123
110
|
|
|
124
|
-
private
|
|
111
|
+
private readonly _elementRef = inject(ElementRef<HTMLElement>);
|
|
125
112
|
|
|
126
|
-
|
|
127
|
-
protected readonly state = computed<HoverCardContentState>(() =>
|
|
128
|
-
this.context.open() ? 'open' : 'closed'
|
|
129
|
-
);
|
|
113
|
+
protected readonly context = inject(HOVER_CARD_CONTEXT);
|
|
130
114
|
|
|
131
115
|
protected readonly computedClass = computed(() => {
|
|
132
116
|
const sideClasses = {
|
|
@@ -151,10 +135,16 @@ export class HoverCardContent implements OnDestroy {
|
|
|
151
135
|
'data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
|
|
152
136
|
sideClasses[this.side()],
|
|
153
137
|
this.side() === 'top' || this.side() === 'bottom' ? alignClasses[this.align()] : '',
|
|
154
|
-
this.class()
|
|
138
|
+
this.class(),
|
|
155
139
|
);
|
|
156
140
|
});
|
|
157
141
|
|
|
142
|
+
private closeTimeout: ReturnType<typeof setTimeout> | null = null;
|
|
143
|
+
/** Current state: open or closed */
|
|
144
|
+
protected readonly state = computed<HoverCardContentState>(() =>
|
|
145
|
+
this.context.open() ? 'open' : 'closed',
|
|
146
|
+
);
|
|
147
|
+
|
|
158
148
|
ngOnDestroy(): void {
|
|
159
149
|
this.clearTimeout();
|
|
160
150
|
}
|
|
@@ -162,20 +152,17 @@ export class HoverCardContent implements OnDestroy {
|
|
|
162
152
|
onMouseEnter(): void {
|
|
163
153
|
this.clearTimeout();
|
|
164
154
|
}
|
|
165
|
-
|
|
166
155
|
onMouseLeave(): void {
|
|
167
156
|
this.closeTimeout = setTimeout(() => {
|
|
168
157
|
this.context.setOpen(false);
|
|
169
158
|
}, this.context.closeDelay);
|
|
170
159
|
}
|
|
171
|
-
|
|
172
160
|
onFocusIn(): void {
|
|
173
161
|
this.clearTimeout();
|
|
174
162
|
}
|
|
175
|
-
|
|
176
163
|
onFocusOut(event: FocusEvent): void {
|
|
177
164
|
const relatedTarget = event.relatedTarget as HTMLElement | null;
|
|
178
|
-
const trigger = this.
|
|
165
|
+
const trigger = this._elementRef.nativeElement.parentElement?.querySelector('[data-state]');
|
|
179
166
|
|
|
180
167
|
// Check if focus moved to trigger or stayed within content
|
|
181
168
|
if (relatedTarget && (trigger === relatedTarget || trigger?.contains(relatedTarget))) {
|
|
@@ -186,11 +173,12 @@ export class HoverCardContent implements OnDestroy {
|
|
|
186
173
|
this.context.setOpen(false);
|
|
187
174
|
}, this.context.closeDelay);
|
|
188
175
|
}
|
|
189
|
-
|
|
190
176
|
onEscape(): void {
|
|
191
177
|
this.context.setOpen(false);
|
|
192
178
|
// Return focus to trigger
|
|
193
|
-
const trigger = this.
|
|
179
|
+
const trigger = this._elementRef.nativeElement.parentElement?.querySelector(
|
|
180
|
+
'[data-state]',
|
|
181
|
+
) as HTMLElement;
|
|
194
182
|
trigger?.focus();
|
|
195
183
|
}
|
|
196
184
|
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { InjectionToken, WritableSignal } from '@angular/core';
|
|
2
2
|
|
|
3
|
-
// ============================================================================
|
|
4
|
-
// Types
|
|
5
|
-
// ============================================================================
|
|
6
|
-
|
|
7
3
|
export type HoverCardSide = 'top' | 'right' | 'bottom' | 'left';
|
|
8
4
|
export type HoverCardAlign = 'start' | 'center' | 'end';
|
|
9
5
|
|
|
@@ -18,8 +14,4 @@ export interface HoverCardContextValue {
|
|
|
18
14
|
closeDelay: number;
|
|
19
15
|
}
|
|
20
16
|
|
|
21
|
-
// ============================================================================
|
|
22
|
-
// Injection Tokens
|
|
23
|
-
// ============================================================================
|
|
24
|
-
|
|
25
17
|
export const HOVER_CARD_CONTEXT = new InjectionToken<HoverCardContextValue>('HOVER_CARD_CONTEXT');
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
ElementRef,
|
|
5
|
+
inject,
|
|
6
|
+
input,
|
|
7
|
+
OnDestroy,
|
|
8
8
|
} from '@angular/core';
|
|
9
9
|
import { HOVER_CARD_CONTEXT } from './hover-card-context';
|
|
10
10
|
|
|
11
|
-
// ============================================================================
|
|
12
|
-
// Types
|
|
13
|
-
// ============================================================================
|
|
14
|
-
|
|
15
11
|
/**
|
|
16
12
|
* Props for the HoverCardTrigger component
|
|
17
13
|
*/
|
|
@@ -21,10 +17,6 @@ export interface HoverCardTriggerProps {
|
|
|
21
17
|
asChild?: boolean;
|
|
22
18
|
}
|
|
23
19
|
|
|
24
|
-
// ============================================================================
|
|
25
|
-
// Component
|
|
26
|
-
// ============================================================================
|
|
27
|
-
|
|
28
20
|
/**
|
|
29
21
|
* @component HoverCardTrigger
|
|
30
22
|
*
|
|
@@ -72,8 +64,9 @@ export interface HoverCardTriggerProps {
|
|
|
72
64
|
selector: 'HoverCardTrigger',
|
|
73
65
|
template: `<ng-content />`,
|
|
74
66
|
host: {
|
|
75
|
-
'
|
|
76
|
-
|
|
67
|
+
'attr.data-slot': '"hover-card-trigger"',
|
|
68
|
+
tabindex: '0',
|
|
69
|
+
role: 'button',
|
|
77
70
|
'(mouseenter)': 'onMouseEnter()',
|
|
78
71
|
'(mouseleave)': 'onMouseLeave()',
|
|
79
72
|
'(focus)': 'onFocus()',
|
|
@@ -88,12 +81,13 @@ export interface HoverCardTriggerProps {
|
|
|
88
81
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
89
82
|
})
|
|
90
83
|
export class HoverCardTrigger implements OnDestroy {
|
|
91
|
-
protected readonly context = inject(HOVER_CARD_CONTEXT);
|
|
92
|
-
private readonly elementRef = inject(ElementRef<HTMLElement>);
|
|
93
|
-
|
|
94
84
|
/** Change the default rendered element for the one passed as a child */
|
|
95
85
|
readonly asChild = input<boolean>(false);
|
|
96
86
|
|
|
87
|
+
private readonly _elementRef = inject(ElementRef<HTMLElement>);
|
|
88
|
+
|
|
89
|
+
protected readonly context = inject(HOVER_CARD_CONTEXT);
|
|
90
|
+
|
|
97
91
|
private openTimeout: ReturnType<typeof setTimeout> | null = null;
|
|
98
92
|
private closeTimeout: ReturnType<typeof setTimeout> | null = null;
|
|
99
93
|
|
|
@@ -107,24 +101,23 @@ export class HoverCardTrigger implements OnDestroy {
|
|
|
107
101
|
this.context.setOpen(true);
|
|
108
102
|
}, this.context.openDelay);
|
|
109
103
|
}
|
|
110
|
-
|
|
111
104
|
onMouseLeave(): void {
|
|
112
105
|
this.clearTimeouts();
|
|
113
106
|
this.closeTimeout = setTimeout(() => {
|
|
114
107
|
this.context.setOpen(false);
|
|
115
108
|
}, this.context.closeDelay);
|
|
116
109
|
}
|
|
117
|
-
|
|
118
110
|
onFocus(): void {
|
|
119
111
|
this.clearTimeouts();
|
|
120
112
|
// Open immediately on focus for keyboard users
|
|
121
113
|
this.context.setOpen(true);
|
|
122
114
|
}
|
|
123
|
-
|
|
124
115
|
onBlur(event: FocusEvent): void {
|
|
125
116
|
// Check if focus moved to the hover card content
|
|
126
117
|
const relatedTarget = event.relatedTarget as HTMLElement | null;
|
|
127
|
-
const hoverCardContent = this.
|
|
118
|
+
const hoverCardContent = this._elementRef.nativeElement.parentElement?.querySelector(
|
|
119
|
+
'[data-slot="hover-card-content"]',
|
|
120
|
+
);
|
|
128
121
|
|
|
129
122
|
if (relatedTarget && hoverCardContent?.contains(relatedTarget)) {
|
|
130
123
|
// Focus moved to content, don't close
|
|
@@ -136,15 +129,13 @@ export class HoverCardTrigger implements OnDestroy {
|
|
|
136
129
|
this.context.setOpen(false);
|
|
137
130
|
}, this.context.closeDelay);
|
|
138
131
|
}
|
|
139
|
-
|
|
140
132
|
onKeyDown(event: Event): void {
|
|
141
133
|
event.preventDefault();
|
|
142
134
|
this.context.setOpen(!this.context.open());
|
|
143
135
|
}
|
|
144
|
-
|
|
145
136
|
onEscape(): void {
|
|
146
137
|
this.context.setOpen(false);
|
|
147
|
-
this.
|
|
138
|
+
this._elementRef.nativeElement.focus();
|
|
148
139
|
}
|
|
149
140
|
|
|
150
141
|
private clearTimeouts(): void {
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
forwardRef,
|
|
5
|
+
input,
|
|
6
|
+
output,
|
|
7
|
+
signal,
|
|
8
8
|
} from '@angular/core';
|
|
9
9
|
import { HOVER_CARD_CONTEXT, type HoverCardContextValue } from './hover-card-context';
|
|
10
10
|
|
|
11
|
-
// ============================================================================
|
|
12
|
-
// Types
|
|
13
|
-
// ============================================================================
|
|
14
|
-
|
|
15
11
|
export type HoverCardState = 'open' | 'closed';
|
|
16
12
|
|
|
17
13
|
/**
|
|
@@ -33,10 +29,6 @@ export interface HoverCardProps {
|
|
|
33
29
|
closeDelay?: number;
|
|
34
30
|
}
|
|
35
31
|
|
|
36
|
-
// ============================================================================
|
|
37
|
-
// Component
|
|
38
|
-
// ============================================================================
|
|
39
|
-
|
|
40
32
|
/**
|
|
41
33
|
* @component HoverCard
|
|
42
34
|
*
|
|
@@ -100,6 +92,7 @@ export interface HoverCardProps {
|
|
|
100
92
|
selector: 'HoverCard',
|
|
101
93
|
template: `<ng-content />`,
|
|
102
94
|
host: {
|
|
95
|
+
'attr.data-slot': '"hover-card"',
|
|
103
96
|
class: 'relative inline-block',
|
|
104
97
|
},
|
|
105
98
|
providers: [
|
|
@@ -111,36 +104,33 @@ export interface HoverCardProps {
|
|
|
111
104
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
112
105
|
})
|
|
113
106
|
export class HoverCard implements HoverCardContextValue {
|
|
107
|
+
constructor() {
|
|
108
|
+
if (this.defaultOpen()) {
|
|
109
|
+
this.open.set(true);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** Event handler called when the open state changes */
|
|
114
|
+
readonly openChange = output<boolean>();
|
|
115
|
+
|
|
114
116
|
/** The open state of the hover card when initially rendered */
|
|
115
117
|
readonly defaultOpen = input<boolean>(false);
|
|
116
|
-
|
|
117
118
|
/** The controlled open state of the hover card */
|
|
118
119
|
readonly controlledOpen = input<boolean | undefined>(undefined, { alias: 'open' });
|
|
119
120
|
|
|
121
|
+
readonly open = signal(false);
|
|
122
|
+
|
|
120
123
|
/** The duration from when the pointer enters the trigger until the hover card opens (ms) */
|
|
121
124
|
readonly openDelay = 700;
|
|
122
|
-
|
|
123
125
|
/** The duration from when the pointer leaves the trigger/content until the hover card closes (ms) */
|
|
124
126
|
readonly closeDelay = 300;
|
|
125
127
|
|
|
126
|
-
/** Event handler called when the open state changes */
|
|
127
|
-
readonly openChange = output<boolean>();
|
|
128
|
-
|
|
129
|
-
readonly open = signal(false);
|
|
130
|
-
|
|
131
|
-
constructor() {
|
|
132
|
-
if (this.defaultOpen()) {
|
|
133
|
-
this.open.set(true);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
128
|
setOpen(open: boolean): void {
|
|
138
129
|
if (this.controlledOpen() === undefined) {
|
|
139
130
|
this.open.set(open);
|
|
140
131
|
}
|
|
141
132
|
this.openChange.emit(open);
|
|
142
133
|
}
|
|
143
|
-
|
|
144
134
|
isOpen(): boolean {
|
|
145
135
|
return this.controlledOpen() !== undefined ? this.controlledOpen()! : this.open();
|
|
146
136
|
}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
// Context and types
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
HOVER_CARD_CONTEXT,
|
|
4
|
+
type HoverCardAlign,
|
|
5
|
+
type HoverCardContextValue,
|
|
6
|
+
type HoverCardSide,
|
|
7
7
|
} from './hover-card-context';
|
|
8
8
|
|
|
9
9
|
// Components and their types
|
|
10
|
-
export {
|
|
10
|
+
export {
|
|
11
|
+
HoverCardContent,
|
|
12
|
+
type HoverCardContentProps,
|
|
13
|
+
type HoverCardContentState,
|
|
14
|
+
} from './hover-card-content.component';
|
|
11
15
|
export { HoverCardTrigger, type HoverCardTriggerProps } from './hover-card-trigger.component';
|
|
12
16
|
export { HoverCard, type HoverCardProps, type HoverCardState } from './hover-card.component';
|
|
13
|
-
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
AfterViewInit,
|
|
4
|
+
ChangeDetectionStrategy,
|
|
5
|
+
Component,
|
|
6
|
+
computed,
|
|
7
|
+
ElementRef,
|
|
8
|
+
forwardRef,
|
|
9
|
+
inject,
|
|
10
|
+
input,
|
|
11
|
+
signal,
|
|
12
12
|
} from '@angular/core';
|
|
13
13
|
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
14
14
|
|
|
@@ -30,27 +30,23 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
|
30
30
|
* <Input type="email" formControlName="email" placeholder="Enter email" />
|
|
31
31
|
*/
|
|
32
32
|
@Component({
|
|
33
|
-
selector: 'Input',
|
|
34
|
-
template:
|
|
35
|
-
<input
|
|
36
|
-
#inputEl
|
|
37
|
-
[type]="type()"
|
|
38
|
-
[placeholder]="placeholder()"
|
|
39
|
-
[disabled]="isDisabled()"
|
|
40
|
-
[id]="id()"
|
|
41
|
-
[name]="name()"
|
|
42
|
-
[autocomplete]="autocomplete()"
|
|
43
|
-
[value]="value()"
|
|
44
|
-
(input)="onInput($event)"
|
|
45
|
-
(blur)="onTouched()"
|
|
46
|
-
[class]="inputClass()"
|
|
47
|
-
[attr.aria-invalid]="ariaInvalid() || null"
|
|
48
|
-
[attr.aria-describedby]="ariaDescribedBy() || null"
|
|
49
|
-
/>
|
|
50
|
-
`,
|
|
33
|
+
selector: 'input[Input]',
|
|
34
|
+
template: '',
|
|
51
35
|
host: {
|
|
52
|
-
'[
|
|
53
|
-
'
|
|
36
|
+
'[type]': 'type()',
|
|
37
|
+
'[placeholder]': 'placeholder()',
|
|
38
|
+
'[disabled]': 'isDisabled()',
|
|
39
|
+
'[id]': 'id()',
|
|
40
|
+
'[name]': 'name()',
|
|
41
|
+
'[autocomplete]': 'autocomplete()',
|
|
42
|
+
'[autofocus]': 'autofocus()',
|
|
43
|
+
'[value]': 'value()',
|
|
44
|
+
'(input)': 'onInput($event)',
|
|
45
|
+
'(blur)': 'onTouched()',
|
|
46
|
+
'[class]': 'inputClass()',
|
|
47
|
+
'[attr.aria-invalid]': 'ariaInvalid() || null',
|
|
48
|
+
'[attr.aria-describedby]': 'ariaDescribedBy() || null',
|
|
49
|
+
'[attr.data-slot]': '"input"',
|
|
54
50
|
},
|
|
55
51
|
providers: [
|
|
56
52
|
{
|
|
@@ -62,43 +58,56 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
|
62
58
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
63
59
|
})
|
|
64
60
|
export class Input implements ControlValueAccessor, AfterViewInit {
|
|
65
|
-
|
|
61
|
+
constructor() {
|
|
62
|
+
// Sync initial value from input
|
|
63
|
+
const initialValue = this.inputValue();
|
|
64
|
+
if (initialValue) {
|
|
65
|
+
this.value.set(initialValue);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
66
68
|
|
|
67
69
|
/** Input type */
|
|
68
70
|
readonly type = input<string>('text');
|
|
69
|
-
|
|
70
71
|
/** Placeholder text */
|
|
71
72
|
readonly placeholder = input<string>('');
|
|
72
|
-
|
|
73
73
|
/** Input id attribute */
|
|
74
74
|
readonly id = input<string>('');
|
|
75
|
-
|
|
76
75
|
/** Input name attribute */
|
|
77
76
|
readonly name = input<string>('');
|
|
78
|
-
|
|
79
77
|
/** Autocomplete attribute */
|
|
80
78
|
readonly autocomplete = input<string>('');
|
|
81
|
-
|
|
79
|
+
/** Autofocus attribute */
|
|
80
|
+
readonly autofocus = input(false, {
|
|
81
|
+
transform: (value: boolean | string) => value === '' || value === true || value === 'true',
|
|
82
|
+
});
|
|
82
83
|
/** Whether the input is disabled - accepts boolean or empty string (for HTML attribute) */
|
|
83
84
|
readonly disabled = input(false, {
|
|
84
85
|
transform: (value: boolean | string) => value === '' || value === true || value === 'true',
|
|
85
86
|
});
|
|
86
|
-
|
|
87
87
|
/** Initial value for non-form usage */
|
|
88
88
|
readonly inputValue = input<string>('', { alias: 'value' });
|
|
89
|
-
|
|
90
89
|
/** Aria-invalid state for error display */
|
|
91
90
|
readonly ariaInvalid = input<boolean | undefined>(undefined, { alias: 'aria-invalid' });
|
|
92
|
-
|
|
93
91
|
/** Aria-describedby for accessibility */
|
|
94
92
|
readonly ariaDescribedBy = input<string | undefined>(undefined, { alias: 'aria-describedby' });
|
|
95
|
-
|
|
96
93
|
/** Additional CSS classes to apply */
|
|
97
94
|
readonly class = input<string>('');
|
|
98
95
|
|
|
96
|
+
private readonly _elementRef = inject(ElementRef<HTMLInputElement>);
|
|
97
|
+
|
|
98
|
+
/** Classes applied to the input element */
|
|
99
|
+
protected readonly inputClass = computed(() =>
|
|
100
|
+
cn(
|
|
101
|
+
'file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground border-input w-full min-w-0 rounded-xl border px-4 py-1 text-base text-left shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
|
|
102
|
+
'bg-zinc-50 dark:bg-zinc-800/50 border-zinc-300 dark:border-zinc-700/50 !text-zinc-900 dark:!text-zinc-50 placeholder:text-zinc-500',
|
|
103
|
+
'focus-visible:border-primary/30 dark:focus-visible:border-white/30 focus-visible:ring-primary/20 dark:focus-visible:ring-white/20 focus-visible:ring-2',
|
|
104
|
+
'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
|
|
105
|
+
this.class(),
|
|
106
|
+
),
|
|
107
|
+
);
|
|
108
|
+
|
|
99
109
|
/** Internal value signal */
|
|
100
110
|
protected readonly value = signal<string>('');
|
|
101
|
-
|
|
102
111
|
/** Internal disabled state */
|
|
103
112
|
protected readonly isDisabled = signal<boolean>(false);
|
|
104
113
|
|
|
@@ -106,60 +115,33 @@ export class Input implements ControlValueAccessor, AfterViewInit {
|
|
|
106
115
|
private onChange: (value: string) => void = () => {};
|
|
107
116
|
protected onTouched: () => void = () => {};
|
|
108
117
|
|
|
109
|
-
constructor() {
|
|
110
|
-
// Sync initial value from input
|
|
111
|
-
const initialValue = this.inputValue();
|
|
112
|
-
if (initialValue) {
|
|
113
|
-
this.value.set(initialValue);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
118
|
ngAfterViewInit(): void {
|
|
118
119
|
// View initialization logic after view is ready
|
|
119
120
|
// This ensures the element is available after hydration
|
|
120
121
|
}
|
|
121
122
|
|
|
122
|
-
/** Computed class combining base styles and custom classes */
|
|
123
|
-
protected readonly computedClass = computed(() => cn('relative inline-block w-full'));
|
|
124
|
-
|
|
125
|
-
/** Classes applied to the actual input element */
|
|
126
|
-
protected readonly inputClass = computed(() =>
|
|
127
|
-
cn(
|
|
128
|
-
'file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
|
|
129
|
-
'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',
|
|
130
|
-
'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
|
|
131
|
-
this.class()
|
|
132
|
-
)
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
/** Handle input events */
|
|
136
|
-
protected onInput(event: Event): void {
|
|
137
|
-
const target = event.target as HTMLInputElement;
|
|
138
|
-
this.value.set(target.value);
|
|
139
|
-
this.onChange(target.value);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
123
|
// ControlValueAccessor implementation
|
|
143
124
|
writeValue(value: string): void {
|
|
144
125
|
this.value.set(value ?? '');
|
|
145
126
|
}
|
|
146
|
-
|
|
147
127
|
registerOnChange(fn: (value: string) => void): void {
|
|
148
128
|
this.onChange = fn;
|
|
149
129
|
}
|
|
150
|
-
|
|
151
130
|
registerOnTouched(fn: () => void): void {
|
|
152
131
|
this.onTouched = fn;
|
|
153
132
|
}
|
|
154
|
-
|
|
155
133
|
setDisabledState(isDisabled: boolean): void {
|
|
156
134
|
this.isDisabled.set(isDisabled);
|
|
157
135
|
}
|
|
158
|
-
|
|
159
136
|
/** Focus the input element */
|
|
160
137
|
focus(): void {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
138
|
+
this._elementRef.nativeElement.focus();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** Handle input events */
|
|
142
|
+
protected onInput(event: Event): void {
|
|
143
|
+
const target = event.target as HTMLInputElement;
|
|
144
|
+
this.value.set(target.value);
|
|
145
|
+
this.onChange(target.value);
|
|
164
146
|
}
|
|
165
147
|
}
|
|
@@ -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
|
* InputGroupAddon component - prefix or suffix addon for InputGroup.
|
|
@@ -34,10 +29,8 @@ export class InputGroupAddon {
|
|
|
34
29
|
protected readonly computedClass = computed(() =>
|
|
35
30
|
cn(
|
|
36
31
|
'flex h-9 items-center justify-center bg-muted px-3 text-sm text-muted-foreground',
|
|
37
|
-
this.position() === 'start'
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
this.class()
|
|
41
|
-
)
|
|
32
|
+
this.position() === 'start' ? 'rounded-l-md border-r' : 'rounded-r-md border-l',
|
|
33
|
+
this.class(),
|
|
34
|
+
),
|
|
42
35
|
);
|
|
43
36
|
}
|
|
@@ -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
|
* InputGroupInput component - styled input for InputGroup without border.
|
|
@@ -27,7 +22,7 @@ export class InputGroupInput {
|
|
|
27
22
|
protected readonly computedClass = computed(() =>
|
|
28
23
|
cn(
|
|
29
24
|
'flex h-9 w-full bg-transparent px-3 py-1 text-base placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
|
|
30
|
-
this.class()
|
|
31
|
-
)
|
|
25
|
+
this.class(),
|
|
26
|
+
),
|
|
32
27
|
);
|
|
33
28
|
}
|
|
@@ -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
|
* InputGroup component - wrapper for input with prefix/suffix addons.
|
|
@@ -46,8 +41,8 @@ export class InputGroup {
|
|
|
46
41
|
/** Computed class combining base styles and custom classes */
|
|
47
42
|
protected readonly computedClass = computed(() =>
|
|
48
43
|
cn(
|
|
49
|
-
'flex items-center rounded-md border border-input bg-background shadow-xs ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2 [&>input]:border-0 [&>input]:shadow-none [&>input]:focus-visible:ring-0 [&>input]:focus-visible:ring-offset-0',
|
|
50
|
-
this.class()
|
|
51
|
-
)
|
|
44
|
+
'flex items-center gap-3 rounded-md border border-input bg-background shadow-xs ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2 [&>input]:border-0 [&>input]:shadow-none [&>input]:focus-visible:ring-0 [&>input]:focus-visible:ring-offset-0',
|
|
45
|
+
this.class(),
|
|
46
|
+
),
|
|
52
47
|
);
|
|
53
48
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Context and types
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
INPUT_OTP_CONTEXT,
|
|
4
|
+
type InputOTPContextValue,
|
|
5
|
+
type InputOTPRenderFn,
|
|
6
|
+
type InputOTPSlotProps,
|
|
7
7
|
} from './input-otp-context';
|
|
8
8
|
|
|
9
9
|
// Components and their types
|
|
@@ -11,4 +11,3 @@ export { InputOTPGroup } from './input-otp-group.component';
|
|
|
11
11
|
export { InputOTPSeparator } from './input-otp-separator.component';
|
|
12
12
|
export { InputOTPSlot } from './input-otp-slot.component';
|
|
13
13
|
export { InputOTP, type InputOTPProps } from './input-otp.component';
|
|
14
|
-
|