@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,22 +1,18 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
afterNextRender,
|
|
4
|
+
ChangeDetectionStrategy,
|
|
5
|
+
Component,
|
|
6
|
+
computed,
|
|
7
|
+
effect,
|
|
8
|
+
ElementRef,
|
|
9
|
+
inject,
|
|
10
|
+
Injector,
|
|
11
|
+
input,
|
|
12
|
+
signal,
|
|
13
13
|
} from '@angular/core';
|
|
14
14
|
import { TABS_CONTEXT } from './tabs-context';
|
|
15
15
|
|
|
16
|
-
// ============================================================================
|
|
17
|
-
// Types
|
|
18
|
-
// ============================================================================
|
|
19
|
-
|
|
20
16
|
/**
|
|
21
17
|
* Props for the TabsList component
|
|
22
18
|
*/
|
|
@@ -30,10 +26,6 @@ export interface TabsListProps {
|
|
|
30
26
|
class?: string;
|
|
31
27
|
}
|
|
32
28
|
|
|
33
|
-
// ============================================================================
|
|
34
|
-
// Component
|
|
35
|
-
// ============================================================================
|
|
36
|
-
|
|
37
29
|
/**
|
|
38
30
|
* @component TabsList
|
|
39
31
|
*
|
|
@@ -94,8 +86,9 @@ export interface TabsListProps {
|
|
|
94
86
|
}
|
|
95
87
|
`,
|
|
96
88
|
host: {
|
|
89
|
+
'attr.data-slot': '"tabs-list"',
|
|
97
90
|
'[class]': 'computedClass()',
|
|
98
|
-
|
|
91
|
+
role: 'tablist',
|
|
99
92
|
'[attr.id]': 'tabs.tablistId',
|
|
100
93
|
'[attr.aria-orientation]': 'tabs.orientation()',
|
|
101
94
|
'(keydown)': 'onKeydown($event)',
|
|
@@ -103,65 +96,47 @@ export interface TabsListProps {
|
|
|
103
96
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
104
97
|
})
|
|
105
98
|
export class TabsList {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
constructor() {
|
|
100
|
+
// Update indicator when value changes (browser-only via afterNextRender)
|
|
101
|
+
effect(() => {
|
|
102
|
+
const _ = this.tabs.value(); // Subscribe to value changes
|
|
103
|
+
// Schedule browser-only DOM update
|
|
104
|
+
afterNextRender(
|
|
105
|
+
() => {
|
|
106
|
+
this.updateIndicator();
|
|
107
|
+
},
|
|
108
|
+
{ injector: this._injector },
|
|
109
|
+
);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
109
112
|
|
|
110
113
|
/** Additional CSS classes */
|
|
111
114
|
readonly class = input<string>('');
|
|
112
|
-
|
|
113
115
|
/** Whether to show the animated indicator */
|
|
114
116
|
readonly showIndicator = input<boolean>(false);
|
|
115
|
-
|
|
116
117
|
/** Additional indicator CSS classes */
|
|
117
118
|
readonly indicatorClass = input<string>('');
|
|
118
119
|
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
private readonly _elementRef = inject(ElementRef);
|
|
121
|
+
private readonly _injector = inject(Injector);
|
|
122
|
+
|
|
123
|
+
protected readonly tabs = inject(TABS_CONTEXT);
|
|
121
124
|
|
|
122
125
|
protected readonly computedClass = computed(() =>
|
|
123
126
|
cn(
|
|
124
127
|
'text-muted-foreground inline-flex h-9 w-fit items-center justify-center gap-1 rounded-lg bg-transparent p-1',
|
|
125
|
-
this.class()
|
|
126
|
-
)
|
|
128
|
+
this.class(),
|
|
129
|
+
),
|
|
127
130
|
);
|
|
128
|
-
|
|
129
131
|
protected readonly computedIndicatorClass = computed(() =>
|
|
130
132
|
cn(
|
|
131
133
|
'absolute inset-y-1 bg-background rounded-md shadow-sm transition-all duration-200',
|
|
132
|
-
this.indicatorClass()
|
|
133
|
-
)
|
|
134
|
+
this.indicatorClass(),
|
|
135
|
+
),
|
|
134
136
|
);
|
|
135
137
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
effect(() => {
|
|
139
|
-
const _ = this.tabs.value(); // Subscribe to value changes
|
|
140
|
-
// Schedule browser-only DOM update
|
|
141
|
-
afterNextRender(() => {
|
|
142
|
-
this.updateIndicator();
|
|
143
|
-
}, { injector: this.injector });
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
private updateIndicator(): void {
|
|
148
|
-
const activeValue = this.tabs.value();
|
|
149
|
-
if (!activeValue) return;
|
|
150
|
-
|
|
151
|
-
const tabId = this.tabs.getTabId(activeValue);
|
|
152
|
-
const tabElement = document.getElementById(tabId);
|
|
153
|
-
const listElement = this.elementRef.nativeElement;
|
|
154
|
-
|
|
155
|
-
if (tabElement && listElement) {
|
|
156
|
-
const tabRect = tabElement.getBoundingClientRect();
|
|
157
|
-
const listRect = listElement.getBoundingClientRect();
|
|
158
|
-
|
|
159
|
-
this.indicatorStyle.set({
|
|
160
|
-
width: tabRect.width,
|
|
161
|
-
left: tabRect.left - listRect.left,
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
}
|
|
138
|
+
/** Indicator position and size */
|
|
139
|
+
protected readonly indicatorStyle = signal({ width: 0, left: 0 });
|
|
165
140
|
|
|
166
141
|
onKeydown(event: KeyboardEvent): void {
|
|
167
142
|
const tabValues = this.tabs.tabValues();
|
|
@@ -225,4 +200,23 @@ export class TabsList {
|
|
|
225
200
|
tabElement?.focus();
|
|
226
201
|
}
|
|
227
202
|
}
|
|
203
|
+
|
|
204
|
+
private updateIndicator(): void {
|
|
205
|
+
const activeValue = this.tabs.value();
|
|
206
|
+
if (!activeValue) return;
|
|
207
|
+
|
|
208
|
+
const tabId = this.tabs.getTabId(activeValue);
|
|
209
|
+
const tabElement = document.getElementById(tabId);
|
|
210
|
+
const listElement = this._elementRef.nativeElement;
|
|
211
|
+
|
|
212
|
+
if (tabElement && listElement) {
|
|
213
|
+
const tabRect = tabElement.getBoundingClientRect();
|
|
214
|
+
const listRect = listElement.getBoundingClientRect();
|
|
215
|
+
|
|
216
|
+
this.indicatorStyle.set({
|
|
217
|
+
width: tabRect.width,
|
|
218
|
+
left: tabRect.left - listRect.left,
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
}
|
|
228
222
|
}
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
inject,
|
|
7
|
+
input,
|
|
8
|
+
OnDestroy,
|
|
9
|
+
OnInit,
|
|
10
10
|
} from '@angular/core';
|
|
11
11
|
import { TABS_CONTEXT } from './tabs-context';
|
|
12
12
|
|
|
13
|
-
// ============================================================================
|
|
14
|
-
// Types
|
|
15
|
-
// ============================================================================
|
|
16
|
-
|
|
17
13
|
export type TabsTriggerState = 'active' | 'inactive';
|
|
18
14
|
|
|
19
15
|
/**
|
|
@@ -29,10 +25,6 @@ export interface TabsTriggerProps {
|
|
|
29
25
|
class?: string;
|
|
30
26
|
}
|
|
31
27
|
|
|
32
|
-
// ============================================================================
|
|
33
|
-
// Component
|
|
34
|
-
// ============================================================================
|
|
35
|
-
|
|
36
28
|
/**
|
|
37
29
|
* @component TabsTrigger
|
|
38
30
|
*
|
|
@@ -82,6 +74,7 @@ export interface TabsTriggerProps {
|
|
|
82
74
|
selector: 'TabsTrigger',
|
|
83
75
|
template: `<ng-content />`,
|
|
84
76
|
host: {
|
|
77
|
+
'attr.data-slot': '"tabs-trigger"',
|
|
85
78
|
'[class]': 'computedClass()',
|
|
86
79
|
'[attr.id]': 'tabId()',
|
|
87
80
|
'[attr.data-state]': 'state()',
|
|
@@ -94,36 +87,27 @@ export interface TabsTriggerProps {
|
|
|
94
87
|
'(click)': 'onClick()',
|
|
95
88
|
'(keydown.enter)': 'onClick()',
|
|
96
89
|
'(keydown.space)': 'onSpace($event)',
|
|
97
|
-
|
|
90
|
+
role: 'tab',
|
|
98
91
|
},
|
|
99
92
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
100
93
|
})
|
|
101
94
|
export class TabsTrigger implements OnInit, OnDestroy {
|
|
102
|
-
protected readonly tabs = inject(TABS_CONTEXT);
|
|
103
|
-
|
|
104
95
|
/** A unique value that associates the trigger with a content */
|
|
105
96
|
readonly value = input.required<string>();
|
|
106
97
|
|
|
107
98
|
/** When true, prevents the user from interacting with the tab */
|
|
108
99
|
readonly disabled = input<boolean>(false);
|
|
109
|
-
|
|
110
100
|
/** Additional CSS classes */
|
|
111
101
|
readonly class = input<string>('');
|
|
112
102
|
|
|
103
|
+
protected readonly tabs = inject(TABS_CONTEXT);
|
|
104
|
+
|
|
113
105
|
/** Check if this tab is currently active */
|
|
114
106
|
protected readonly isActive = computed(() => this.tabs.value() === this.value());
|
|
115
|
-
|
|
116
|
-
/** Current state: active or inactive */
|
|
117
|
-
protected readonly state = computed<TabsTriggerState>(() =>
|
|
118
|
-
this.isActive() ? 'active' : 'inactive'
|
|
119
|
-
);
|
|
120
|
-
|
|
121
107
|
/** Generate tab ID */
|
|
122
108
|
protected readonly tabId = computed(() => this.tabs.getTabId(this.value()));
|
|
123
|
-
|
|
124
109
|
/** Generate panel ID for aria-controls */
|
|
125
110
|
protected readonly panelId = computed(() => this.tabs.getPanelId(this.value()));
|
|
126
|
-
|
|
127
111
|
protected readonly computedClass = computed(() =>
|
|
128
112
|
cn(
|
|
129
113
|
'inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium ring-offset-background transition-all',
|
|
@@ -133,25 +117,27 @@ export class TabsTrigger implements OnInit, OnDestroy {
|
|
|
133
117
|
'data-[state=inactive]:hover:text-foreground',
|
|
134
118
|
'cursor-pointer',
|
|
135
119
|
this.disabled() && 'pointer-events-none opacity-50',
|
|
136
|
-
this.class()
|
|
137
|
-
)
|
|
120
|
+
this.class(),
|
|
121
|
+
),
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
/** Current state: active or inactive */
|
|
125
|
+
protected readonly state = computed<TabsTriggerState>(() =>
|
|
126
|
+
this.isActive() ? 'active' : 'inactive',
|
|
138
127
|
);
|
|
139
128
|
|
|
140
129
|
ngOnInit(): void {
|
|
141
130
|
// Register this tab's value for keyboard navigation
|
|
142
|
-
this.tabs.tabValues.update(values => {
|
|
131
|
+
this.tabs.tabValues.update((values) => {
|
|
143
132
|
if (!values.includes(this.value())) {
|
|
144
133
|
return [...values, this.value()];
|
|
145
134
|
}
|
|
146
135
|
return values;
|
|
147
136
|
});
|
|
148
137
|
}
|
|
149
|
-
|
|
150
138
|
ngOnDestroy(): void {
|
|
151
139
|
// Unregister this tab's value
|
|
152
|
-
this.tabs.tabValues.update(values =>
|
|
153
|
-
values.filter(v => v !== this.value())
|
|
154
|
-
);
|
|
140
|
+
this.tabs.tabValues.update((values) => values.filter((v) => v !== this.value()));
|
|
155
141
|
}
|
|
156
142
|
|
|
157
143
|
protected onClick(): void {
|
|
@@ -159,7 +145,6 @@ export class TabsTrigger implements OnInit, OnDestroy {
|
|
|
159
145
|
this.tabs.onValueChange(this.value());
|
|
160
146
|
}
|
|
161
147
|
}
|
|
162
|
-
|
|
163
148
|
protected onSpace(event: Event): void {
|
|
164
149
|
event.preventDefault();
|
|
165
150
|
this.onClick();
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
2
|
import { AriaIdService } from '@/lib/utils/accessibility';
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
ChangeDetectionStrategy,
|
|
5
|
+
Component,
|
|
6
|
+
computed,
|
|
7
|
+
effect,
|
|
8
|
+
forwardRef,
|
|
9
|
+
inject,
|
|
10
|
+
input,
|
|
11
|
+
output,
|
|
12
|
+
signal,
|
|
13
13
|
} from '@angular/core';
|
|
14
14
|
import { TABS_CONTEXT, TabsActivationMode, TabsContext, TabsOrientation } from './tabs-context';
|
|
15
15
|
|
|
16
|
-
// ============================================================================
|
|
17
|
-
// Types
|
|
18
|
-
// ============================================================================
|
|
19
|
-
|
|
20
16
|
/**
|
|
21
17
|
* Props for the Tabs component
|
|
22
18
|
*/
|
|
@@ -38,10 +34,6 @@ export interface TabsProps {
|
|
|
38
34
|
class?: string;
|
|
39
35
|
}
|
|
40
36
|
|
|
41
|
-
// ============================================================================
|
|
42
|
-
// Component
|
|
43
|
-
// ============================================================================
|
|
44
|
-
|
|
45
37
|
/**
|
|
46
38
|
* @component Tabs
|
|
47
39
|
*
|
|
@@ -124,6 +116,7 @@ export interface TabsProps {
|
|
|
124
116
|
selector: 'Tabs',
|
|
125
117
|
template: `<ng-content />`,
|
|
126
118
|
host: {
|
|
119
|
+
'attr.data-slot': '"tabs"',
|
|
127
120
|
'[class]': 'computedClass()',
|
|
128
121
|
'[attr.data-orientation]': 'orientation()',
|
|
129
122
|
},
|
|
@@ -136,59 +129,53 @@ export interface TabsProps {
|
|
|
136
129
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
137
130
|
})
|
|
138
131
|
export class Tabs implements TabsContext {
|
|
139
|
-
|
|
140
|
-
|
|
132
|
+
constructor() {
|
|
133
|
+
// Initialize with defaultValue, controlled value takes precedence
|
|
134
|
+
effect(() => {
|
|
135
|
+
const defaultVal = this.defaultValue();
|
|
136
|
+
const controlled = this.controlledValue();
|
|
137
|
+
|
|
138
|
+
if (controlled !== undefined) {
|
|
139
|
+
this._value.set(controlled);
|
|
140
|
+
} else if (defaultVal && !this._value()) {
|
|
141
|
+
this._value.set(defaultVal);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** Event called when the value changes */
|
|
147
|
+
readonly valueChange = output<string>();
|
|
141
148
|
|
|
142
149
|
/** The value of the tab that should be active when initially rendered */
|
|
143
150
|
readonly defaultValue = input<string>('');
|
|
144
|
-
|
|
145
151
|
/** The controlled value of the tab to activate */
|
|
146
152
|
readonly controlledValue = input<string | undefined>(undefined, { alias: 'value' });
|
|
147
|
-
|
|
148
153
|
/** The orientation of the component */
|
|
149
154
|
readonly orientation = input<TabsOrientation>('horizontal');
|
|
150
|
-
|
|
151
155
|
/** When automatic, tabs are activated upon focus. When manual, upon click. */
|
|
152
156
|
readonly activationMode = input<TabsActivationMode>('automatic');
|
|
153
|
-
|
|
154
157
|
/** Additional CSS classes */
|
|
155
158
|
readonly class = input<string>('');
|
|
156
159
|
|
|
157
|
-
|
|
158
|
-
|
|
160
|
+
private readonly _ariaIdService = inject(AriaIdService);
|
|
161
|
+
|
|
162
|
+
protected readonly computedClass = computed(() => cn('flex flex-col gap-2', this.class()));
|
|
159
163
|
|
|
160
164
|
/** Internal state for the active tab value */
|
|
161
165
|
private readonly _value = signal<string>('');
|
|
166
|
+
/** Registry of tab values for keyboard navigation */
|
|
167
|
+
readonly tabValues = signal<string[]>([]);
|
|
162
168
|
|
|
169
|
+
private readonly ariaIds = this._ariaIdService.generateTabIds('tabs');
|
|
163
170
|
/** ARIA IDs */
|
|
164
171
|
readonly tablistId = this.ariaIds.tablistId;
|
|
165
172
|
|
|
166
|
-
/** Registry of tab values for keyboard navigation */
|
|
167
|
-
readonly tabValues = signal<string[]>([]);
|
|
168
|
-
|
|
169
173
|
/** Generate tab ID for a specific value */
|
|
170
174
|
getTabId = (value: string): string => `${this.tablistId}-tab-${value}`;
|
|
171
|
-
|
|
172
175
|
/** Generate panel ID for a specific value */
|
|
173
176
|
getPanelId = (value: string): string => `${this.tablistId}-panel-${value}`;
|
|
174
|
-
|
|
175
|
-
constructor() {
|
|
176
|
-
// Initialize with defaultValue, controlled value takes precedence
|
|
177
|
-
effect(() => {
|
|
178
|
-
const defaultVal = this.defaultValue();
|
|
179
|
-
const controlled = this.controlledValue();
|
|
180
|
-
|
|
181
|
-
if (controlled !== undefined) {
|
|
182
|
-
this._value.set(controlled);
|
|
183
|
-
} else if (defaultVal && !this._value()) {
|
|
184
|
-
this._value.set(defaultVal);
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
|
|
189
177
|
/** Get the current active tab value */
|
|
190
178
|
value = () => this.controlledValue() ?? this._value();
|
|
191
|
-
|
|
192
179
|
/** Handle tab change */
|
|
193
180
|
onValueChange = (newValue: string) => {
|
|
194
181
|
if (this.controlledValue() === undefined) {
|
|
@@ -196,8 +183,4 @@ export class Tabs implements TabsContext {
|
|
|
196
183
|
}
|
|
197
184
|
this.valueChange.emit(newValue);
|
|
198
185
|
};
|
|
199
|
-
|
|
200
|
-
protected readonly computedClass = computed(() =>
|
|
201
|
-
cn('flex flex-col gap-2', this.class())
|
|
202
|
-
);
|
|
203
186
|
}
|
|
@@ -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
|
* Textarea component that applies shadcn textarea styles.
|
|
@@ -38,7 +33,7 @@ export class Textarea {
|
|
|
38
33
|
'placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
|
|
39
34
|
'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',
|
|
40
35
|
'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',
|
|
41
|
-
this.class()
|
|
42
|
-
)
|
|
36
|
+
this.class(),
|
|
37
|
+
),
|
|
43
38
|
);
|
|
44
39
|
}
|
|
@@ -5,12 +5,11 @@ export { ToastTitle, type ToastTitleProps } from './toast-title.component';
|
|
|
5
5
|
export { toastVariants, type ToastVariants } from './toast-variants';
|
|
6
6
|
export { Toast, type ToastProps, type ToastState, type ToastSwipeState } from './toast.component';
|
|
7
7
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
ToastService,
|
|
9
|
+
type Toast as ToastData,
|
|
10
|
+
type ToastOptions,
|
|
11
|
+
type ToastPosition,
|
|
12
|
+
type ToastSwipeDirection,
|
|
13
|
+
type ToastType,
|
|
14
14
|
} from './toast.service';
|
|
15
15
|
export { Toaster, type ToasterProps } from './toaster.component';
|
|
16
|
-
|
|
@@ -2,10 +2,6 @@ import { cn } from '@/lib/utils';
|
|
|
2
2
|
import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';
|
|
3
3
|
import { buttonVariants } from '../button';
|
|
4
4
|
|
|
5
|
-
// ============================================================================
|
|
6
|
-
// Types
|
|
7
|
-
// ============================================================================
|
|
8
|
-
|
|
9
5
|
/**
|
|
10
6
|
* Props for the ToastAction component
|
|
11
7
|
*/
|
|
@@ -17,10 +13,6 @@ export interface ToastActionProps {
|
|
|
17
13
|
class?: string;
|
|
18
14
|
}
|
|
19
15
|
|
|
20
|
-
// ============================================================================
|
|
21
|
-
// Component
|
|
22
|
-
// ============================================================================
|
|
23
|
-
|
|
24
16
|
/**
|
|
25
17
|
* @component ToastAction
|
|
26
18
|
*
|
|
@@ -47,31 +39,28 @@ export interface ToastActionProps {
|
|
|
47
39
|
@Component({
|
|
48
40
|
selector: 'ToastAction',
|
|
49
41
|
template: `
|
|
50
|
-
<button
|
|
51
|
-
type="button"
|
|
52
|
-
[class]="computedClass()"
|
|
53
|
-
(click)="onClick.emit()"
|
|
54
|
-
>
|
|
42
|
+
<button type="button" [class]="computedClass()" (click)="onClick.emit()">
|
|
55
43
|
<ng-content />
|
|
56
44
|
</button>
|
|
57
45
|
`,
|
|
58
46
|
host: {
|
|
47
|
+
'attr.data-slot': '"toast-action"',
|
|
59
48
|
class: 'contents',
|
|
60
49
|
},
|
|
61
50
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
62
51
|
})
|
|
63
52
|
export class ToastAction {
|
|
64
|
-
/** Additional CSS classes */
|
|
65
|
-
readonly class = input<string>('');
|
|
66
|
-
|
|
67
53
|
/** Event emitted when the action button is clicked */
|
|
68
54
|
readonly onClick = output<void>();
|
|
69
55
|
|
|
56
|
+
/** Additional CSS classes */
|
|
57
|
+
readonly class = input<string>('');
|
|
58
|
+
|
|
70
59
|
protected readonly computedClass = computed(() =>
|
|
71
60
|
cn(
|
|
72
61
|
buttonVariants({ variant: 'outline', size: 'sm' }),
|
|
73
62
|
'shrink-0 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive',
|
|
74
|
-
this.class()
|
|
75
|
-
)
|
|
63
|
+
this.class(),
|
|
64
|
+
),
|
|
76
65
|
);
|
|
77
66
|
}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
2
|
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
3
3
|
|
|
4
|
-
// ============================================================================
|
|
5
|
-
// Types
|
|
6
|
-
// ============================================================================
|
|
7
|
-
|
|
8
4
|
/**
|
|
9
5
|
* Props for the ToastDescription component
|
|
10
6
|
*/
|
|
@@ -13,10 +9,6 @@ export interface ToastDescriptionProps {
|
|
|
13
9
|
class?: string;
|
|
14
10
|
}
|
|
15
11
|
|
|
16
|
-
// ============================================================================
|
|
17
|
-
// Component
|
|
18
|
-
// ============================================================================
|
|
19
|
-
|
|
20
12
|
/**
|
|
21
13
|
* @component ToastDescription
|
|
22
14
|
*
|
|
@@ -38,6 +30,7 @@ export interface ToastDescriptionProps {
|
|
|
38
30
|
selector: 'ToastDescription',
|
|
39
31
|
template: `<ng-content />`,
|
|
40
32
|
host: {
|
|
33
|
+
'attr.data-slot': '"toast-description"',
|
|
41
34
|
'[class]': 'computedClass()',
|
|
42
35
|
},
|
|
43
36
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -46,7 +39,5 @@ export class ToastDescription {
|
|
|
46
39
|
/** Additional CSS classes */
|
|
47
40
|
readonly class = input<string>('');
|
|
48
41
|
|
|
49
|
-
protected readonly computedClass = computed(() =>
|
|
50
|
-
cn('text-sm opacity-90', this.class())
|
|
51
|
-
);
|
|
42
|
+
protected readonly computedClass = computed(() => cn('text-sm opacity-90', this.class()));
|
|
52
43
|
}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
2
|
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
3
3
|
|
|
4
|
-
// ============================================================================
|
|
5
|
-
// Types
|
|
6
|
-
// ============================================================================
|
|
7
|
-
|
|
8
4
|
/**
|
|
9
5
|
* Props for the ToastTitle component
|
|
10
6
|
*/
|
|
@@ -13,10 +9,6 @@ export interface ToastTitleProps {
|
|
|
13
9
|
class?: string;
|
|
14
10
|
}
|
|
15
11
|
|
|
16
|
-
// ============================================================================
|
|
17
|
-
// Component
|
|
18
|
-
// ============================================================================
|
|
19
|
-
|
|
20
12
|
/**
|
|
21
13
|
* @component ToastTitle
|
|
22
14
|
*
|
|
@@ -38,6 +30,7 @@ export interface ToastTitleProps {
|
|
|
38
30
|
selector: 'ToastTitle',
|
|
39
31
|
template: `<ng-content />`,
|
|
40
32
|
host: {
|
|
33
|
+
'attr.data-slot': '"toast-title"',
|
|
41
34
|
'[class]': 'computedClass()',
|
|
42
35
|
},
|
|
43
36
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -47,6 +40,6 @@ export class ToastTitle {
|
|
|
47
40
|
readonly class = input<string>('');
|
|
48
41
|
|
|
49
42
|
protected readonly computedClass = computed(() =>
|
|
50
|
-
cn('text-sm font-semibold [&+div]:text-xs', this.class())
|
|
43
|
+
cn('text-sm font-semibold [&+div]:text-xs', this.class()),
|
|
51
44
|
);
|
|
52
45
|
}
|