@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,14 +1,6 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
Component,
|
|
5
|
-
computed,
|
|
6
|
-
input,
|
|
7
|
-
} from '@angular/core';
|
|
8
|
-
import {
|
|
9
|
-
buttonGroupVariants,
|
|
10
|
-
type ButtonGroupVariants,
|
|
11
|
-
} from './button-group-variants';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
3
|
+
import { buttonGroupVariants, type ButtonGroupVariants } from './button-group-variants';
|
|
12
4
|
|
|
13
5
|
/**
|
|
14
6
|
* ButtonGroup component - groups buttons together with shared styling.
|
|
@@ -32,6 +24,7 @@ import {
|
|
|
32
24
|
selector: 'ButtonGroup',
|
|
33
25
|
template: `<ng-content />`,
|
|
34
26
|
host: {
|
|
27
|
+
'attr.data-slot': '"button-group"',
|
|
35
28
|
'[class]': 'computedClass()',
|
|
36
29
|
role: 'group',
|
|
37
30
|
},
|
|
@@ -39,8 +32,7 @@ import {
|
|
|
39
32
|
})
|
|
40
33
|
export class ButtonGroup {
|
|
41
34
|
/** The orientation of the button group */
|
|
42
|
-
readonly orientation =
|
|
43
|
-
input<ButtonGroupVariants['orientation']>('horizontal');
|
|
35
|
+
readonly orientation = input<ButtonGroupVariants['orientation']>('horizontal');
|
|
44
36
|
|
|
45
37
|
/** Additional CSS classes to apply */
|
|
46
38
|
readonly class = input<string>('');
|
|
@@ -51,7 +43,7 @@ export class ButtonGroup {
|
|
|
51
43
|
buttonGroupVariants({
|
|
52
44
|
orientation: this.orientation(),
|
|
53
45
|
}),
|
|
54
|
-
this.class()
|
|
55
|
-
)
|
|
46
|
+
this.class(),
|
|
47
|
+
),
|
|
56
48
|
);
|
|
57
49
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
2
|
import { LiveAnnouncerService } from '@/lib/utils/accessibility';
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
ChangeDetectionStrategy,
|
|
5
|
+
Component,
|
|
6
|
+
computed,
|
|
7
|
+
inject,
|
|
8
|
+
input,
|
|
9
|
+
model,
|
|
10
|
+
output,
|
|
11
|
+
signal,
|
|
12
12
|
} from '@angular/core';
|
|
13
13
|
import { ChevronLeft, ChevronRight, LucideAngularModule } from 'lucide-angular';
|
|
14
14
|
import { buttonVariants } from '../button';
|
|
@@ -29,10 +29,10 @@ import { buttonVariants } from '../button';
|
|
|
29
29
|
template: `
|
|
30
30
|
<div [class]="computedClass()" role="application" [attr.aria-label]="ariaLabel()">
|
|
31
31
|
<!-- Header with navigation -->
|
|
32
|
-
<div class="
|
|
33
|
-
<div class="space-y-4">
|
|
32
|
+
<div class="w-full">
|
|
33
|
+
<div class="w-full space-y-4">
|
|
34
34
|
<!-- Month navigation -->
|
|
35
|
-
<div class="flex justify-center pt-1
|
|
35
|
+
<div class="relative flex items-center justify-center pt-1">
|
|
36
36
|
<div
|
|
37
37
|
class="text-sm font-medium"
|
|
38
38
|
aria-live="polite"
|
|
@@ -63,13 +63,17 @@ import { buttonVariants } from '../button';
|
|
|
63
63
|
</div>
|
|
64
64
|
|
|
65
65
|
<!-- Calendar grid -->
|
|
66
|
-
<table
|
|
66
|
+
<table
|
|
67
|
+
class="w-full border-collapse space-y-1"
|
|
68
|
+
role="grid"
|
|
69
|
+
[attr.aria-label]="monthYear()"
|
|
70
|
+
>
|
|
67
71
|
<thead>
|
|
68
72
|
<tr class="flex" role="row">
|
|
69
73
|
@for (day of weekDays; track day; let i = $index) {
|
|
70
74
|
<th
|
|
71
75
|
scope="col"
|
|
72
|
-
class="text-muted-foreground rounded-md
|
|
76
|
+
class="text-muted-foreground w-full rounded-md font-normal text-[0.8rem]"
|
|
73
77
|
[attr.aria-label]="fullWeekDays[i]"
|
|
74
78
|
>
|
|
75
79
|
{{ day }}
|
|
@@ -83,7 +87,7 @@ import { buttonVariants } from '../button';
|
|
|
83
87
|
@for (day of week; track day.date.toISOString()) {
|
|
84
88
|
<td
|
|
85
89
|
role="gridcell"
|
|
86
|
-
class="relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-
|
|
90
|
+
class="relative w-full p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-gray-100 dark:[&:has([aria-selected])]:bg-neutral-800 [&:has([aria-selected].day-outside)]:bg-gray-100/50 dark:[&:has([aria-selected].day-outside)]:bg-neutral-800/50 [&:has([aria-selected].day-range-end)]:rounded-r-md"
|
|
87
91
|
[class.first:rounded-l-md]="true"
|
|
88
92
|
[class.last:rounded-r-md]="true"
|
|
89
93
|
>
|
|
@@ -91,9 +95,9 @@ import { buttonVariants } from '../button';
|
|
|
91
95
|
type="button"
|
|
92
96
|
[class]="getDayClass(day)"
|
|
93
97
|
[attr.aria-label]="getDateLabel(day.date)"
|
|
94
|
-
[attr.aria-selected]="isSelected(day.date)"
|
|
98
|
+
[attr.aria-selected]="isSelected(day.date) ? 'true' : null"
|
|
95
99
|
[attr.aria-current]="isToday(day.date) ? 'date' : null"
|
|
96
|
-
[attr.aria-disabled]="day.disabled"
|
|
100
|
+
[attr.aria-disabled]="day.disabled ? 'true' : null"
|
|
97
101
|
[disabled]="day.disabled"
|
|
98
102
|
[tabindex]="getDayTabIndex(day)"
|
|
99
103
|
(click)="selectDate(day.date)"
|
|
@@ -114,57 +118,103 @@ import { buttonVariants } from '../button';
|
|
|
114
118
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
115
119
|
})
|
|
116
120
|
export class Calendar {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
121
|
+
/** Date select event */
|
|
122
|
+
readonly onSelect = output<Date | undefined>();
|
|
123
|
+
/** Month change event */
|
|
124
|
+
readonly onMonthChange = output<Date>();
|
|
120
125
|
|
|
121
126
|
/** Selected date */
|
|
122
127
|
readonly selected = model<Date | undefined>(undefined);
|
|
123
128
|
|
|
124
129
|
/** Mode - single, multiple, or range */
|
|
125
130
|
readonly mode = input<'single' | 'multiple' | 'range'>('single');
|
|
126
|
-
|
|
127
131
|
/** Number of months to display */
|
|
128
132
|
readonly numberOfMonths = input<number>(1);
|
|
129
|
-
|
|
130
133
|
/** Whether to show days outside current month */
|
|
131
134
|
readonly showOutsideDays = input<boolean>(true);
|
|
132
|
-
|
|
133
135
|
/** Disabled dates function */
|
|
134
136
|
readonly disabled = input<((date: Date) => boolean) | undefined>(undefined);
|
|
135
|
-
|
|
136
137
|
/** Accessible label for the calendar */
|
|
137
138
|
readonly ariaLabel = input<string>('Calendar');
|
|
138
|
-
|
|
139
139
|
/** Additional CSS classes */
|
|
140
140
|
readonly class = input<string>('');
|
|
141
141
|
|
|
142
|
-
|
|
143
|
-
readonly onSelect = output<Date | undefined>();
|
|
144
|
-
|
|
145
|
-
/** Month change event */
|
|
146
|
-
readonly onMonthChange = output<Date>();
|
|
147
|
-
|
|
148
|
-
protected readonly weekDays = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];
|
|
149
|
-
protected readonly fullWeekDays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
|
150
|
-
|
|
151
|
-
protected readonly currentMonth = signal(new Date());
|
|
152
|
-
|
|
153
|
-
protected readonly computedClass = computed(() =>
|
|
154
|
-
cn('p-3', this.class())
|
|
155
|
-
);
|
|
142
|
+
private readonly _liveAnnouncer = inject(LiveAnnouncerService);
|
|
156
143
|
|
|
144
|
+
protected readonly computedClass = computed(() => cn('w-full p-3', this.class()));
|
|
157
145
|
protected readonly navButtonClass = computed(() =>
|
|
158
146
|
cn(
|
|
159
147
|
buttonVariants({ variant: 'outline' }),
|
|
160
|
-
'h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100'
|
|
161
|
-
)
|
|
148
|
+
'h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 hover:bg-gray-100 dark:hover:bg-neutral-800',
|
|
149
|
+
),
|
|
162
150
|
);
|
|
163
|
-
|
|
164
151
|
protected readonly monthYear = computed(() => {
|
|
165
152
|
const date = this.currentMonth();
|
|
166
153
|
return date.toLocaleDateString('en-US', { month: 'long', year: 'numeric' });
|
|
167
154
|
});
|
|
155
|
+
protected readonly calendarWeeks = computed(() => {
|
|
156
|
+
const date = this.currentMonth();
|
|
157
|
+
const year = date.getFullYear();
|
|
158
|
+
const month = date.getMonth();
|
|
159
|
+
|
|
160
|
+
const firstDay = new Date(year, month, 1);
|
|
161
|
+
const lastDay = new Date(year, month + 1, 0);
|
|
162
|
+
|
|
163
|
+
const startDate = new Date(firstDay);
|
|
164
|
+
startDate.setDate(startDate.getDate() - firstDay.getDay());
|
|
165
|
+
|
|
166
|
+
const endDate = new Date(lastDay);
|
|
167
|
+
endDate.setDate(endDate.getDate() + (6 - lastDay.getDay()));
|
|
168
|
+
|
|
169
|
+
const weeks: {
|
|
170
|
+
date: Date;
|
|
171
|
+
isOutside: boolean;
|
|
172
|
+
disabled: boolean;
|
|
173
|
+
}[][] = [];
|
|
174
|
+
|
|
175
|
+
const current = new Date(startDate);
|
|
176
|
+
while (current <= endDate) {
|
|
177
|
+
const week: {
|
|
178
|
+
date: Date;
|
|
179
|
+
isOutside: boolean;
|
|
180
|
+
disabled: boolean;
|
|
181
|
+
}[] = [];
|
|
182
|
+
|
|
183
|
+
for (let i = 0; i < 7; i++) {
|
|
184
|
+
const dayDate = new Date(current);
|
|
185
|
+
const isOutside = dayDate.getMonth() !== month;
|
|
186
|
+
const disabledFn = this.disabled();
|
|
187
|
+
const isDisabled = disabledFn ? disabledFn(dayDate) : false;
|
|
188
|
+
|
|
189
|
+
week.push({
|
|
190
|
+
date: dayDate,
|
|
191
|
+
isOutside,
|
|
192
|
+
disabled: isDisabled,
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
current.setDate(current.getDate() + 1);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
weeks.push(week);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return weeks;
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
protected readonly currentMonth = signal(new Date());
|
|
205
|
+
|
|
206
|
+
protected readonly ChevronLeftIcon = ChevronLeft;
|
|
207
|
+
protected readonly ChevronRightIcon = ChevronRight;
|
|
208
|
+
protected readonly weekDays = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];
|
|
209
|
+
protected readonly fullWeekDays = [
|
|
210
|
+
'Sunday',
|
|
211
|
+
'Monday',
|
|
212
|
+
'Tuesday',
|
|
213
|
+
'Wednesday',
|
|
214
|
+
'Thursday',
|
|
215
|
+
'Friday',
|
|
216
|
+
'Saturday',
|
|
217
|
+
];
|
|
168
218
|
|
|
169
219
|
/** Get accessible label for a date */
|
|
170
220
|
protected getDateLabel(date: Date): string {
|
|
@@ -172,7 +222,7 @@ export class Calendar {
|
|
|
172
222
|
weekday: 'long',
|
|
173
223
|
month: 'long',
|
|
174
224
|
day: 'numeric',
|
|
175
|
-
year: 'numeric'
|
|
225
|
+
year: 'numeric',
|
|
176
226
|
};
|
|
177
227
|
const label = date.toLocaleDateString('en-US', options);
|
|
178
228
|
|
|
@@ -184,26 +234,22 @@ export class Calendar {
|
|
|
184
234
|
}
|
|
185
235
|
return label;
|
|
186
236
|
}
|
|
187
|
-
|
|
188
237
|
/** Check if date is today */
|
|
189
238
|
protected isToday(date: Date): boolean {
|
|
190
239
|
return this.isSameDay(date, new Date());
|
|
191
240
|
}
|
|
192
|
-
|
|
193
241
|
/** Get label for previous month button */
|
|
194
242
|
protected getPreviousMonthLabel(): string {
|
|
195
243
|
const current = this.currentMonth();
|
|
196
244
|
const prev = new Date(current.getFullYear(), current.getMonth() - 1, 1);
|
|
197
245
|
return prev.toLocaleDateString('en-US', { month: 'long', year: 'numeric' });
|
|
198
246
|
}
|
|
199
|
-
|
|
200
247
|
/** Get label for next month button */
|
|
201
248
|
protected getNextMonthLabel(): string {
|
|
202
249
|
const current = this.currentMonth();
|
|
203
250
|
const next = new Date(current.getFullYear(), current.getMonth() + 1, 1);
|
|
204
251
|
return next.toLocaleDateString('en-US', { month: 'long', year: 'numeric' });
|
|
205
252
|
}
|
|
206
|
-
|
|
207
253
|
/** Get tabindex for day button (roving tabindex) */
|
|
208
254
|
protected getDayTabIndex(day: { date: Date; isOutside: boolean; disabled: boolean }): number {
|
|
209
255
|
if (day.disabled || day.isOutside) return -1;
|
|
@@ -212,7 +258,6 @@ export class Calendar {
|
|
|
212
258
|
if (this.isToday(day.date)) return 0;
|
|
213
259
|
return -1;
|
|
214
260
|
}
|
|
215
|
-
|
|
216
261
|
/** Handle keyboard navigation within the calendar */
|
|
217
262
|
protected onDayKeydown(event: KeyboardEvent, currentDate: Date): void {
|
|
218
263
|
let newDate: Date | null = null;
|
|
@@ -255,109 +300,52 @@ export class Calendar {
|
|
|
255
300
|
}
|
|
256
301
|
// Focus the new date after DOM update
|
|
257
302
|
setTimeout(() => {
|
|
258
|
-
const button = document.querySelector(
|
|
303
|
+
const button = document.querySelector(
|
|
304
|
+
`[aria-label*="${newDate!.getDate()},"]`,
|
|
305
|
+
) as HTMLElement;
|
|
259
306
|
button?.focus();
|
|
260
307
|
}, 0);
|
|
261
308
|
}
|
|
262
309
|
}
|
|
263
|
-
|
|
264
|
-
protected readonly calendarWeeks = computed(() => {
|
|
265
|
-
const date = this.currentMonth();
|
|
266
|
-
const year = date.getFullYear();
|
|
267
|
-
const month = date.getMonth();
|
|
268
|
-
|
|
269
|
-
const firstDay = new Date(year, month, 1);
|
|
270
|
-
const lastDay = new Date(year, month + 1, 0);
|
|
271
|
-
|
|
272
|
-
const startDate = new Date(firstDay);
|
|
273
|
-
startDate.setDate(startDate.getDate() - firstDay.getDay());
|
|
274
|
-
|
|
275
|
-
const endDate = new Date(lastDay);
|
|
276
|
-
endDate.setDate(endDate.getDate() + (6 - lastDay.getDay()));
|
|
277
|
-
|
|
278
|
-
const weeks: {
|
|
279
|
-
date: Date;
|
|
280
|
-
isOutside: boolean;
|
|
281
|
-
disabled: boolean;
|
|
282
|
-
}[][] = [];
|
|
283
|
-
|
|
284
|
-
const current = new Date(startDate);
|
|
285
|
-
while (current <= endDate) {
|
|
286
|
-
const week: {
|
|
287
|
-
date: Date;
|
|
288
|
-
isOutside: boolean;
|
|
289
|
-
disabled: boolean;
|
|
290
|
-
}[] = [];
|
|
291
|
-
|
|
292
|
-
for (let i = 0; i < 7; i++) {
|
|
293
|
-
const dayDate = new Date(current);
|
|
294
|
-
const isOutside = dayDate.getMonth() !== month;
|
|
295
|
-
const disabledFn = this.disabled();
|
|
296
|
-
const isDisabled = disabledFn ? disabledFn(dayDate) : false;
|
|
297
|
-
|
|
298
|
-
week.push({
|
|
299
|
-
date: dayDate,
|
|
300
|
-
isOutside,
|
|
301
|
-
disabled: isDisabled,
|
|
302
|
-
});
|
|
303
|
-
|
|
304
|
-
current.setDate(current.getDate() + 1);
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
weeks.push(week);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
return weeks;
|
|
311
|
-
});
|
|
312
|
-
|
|
313
|
-
protected getDayClass(day: {
|
|
314
|
-
date: Date;
|
|
315
|
-
isOutside: boolean;
|
|
316
|
-
disabled: boolean;
|
|
317
|
-
}): string {
|
|
310
|
+
protected getDayClass(day: { date: Date; isOutside: boolean; disabled: boolean }): string {
|
|
318
311
|
const todayCheck = this.isSameDay(day.date, new Date());
|
|
319
312
|
const selected = this.isSelected(day.date);
|
|
320
313
|
|
|
321
314
|
return cn(
|
|
322
315
|
buttonVariants({ variant: 'ghost' }),
|
|
323
|
-
'h-
|
|
324
|
-
todayCheck && 'bg-
|
|
316
|
+
'h-9 w-full p-0 font-normal aria-selected:opacity-100 hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-neutral-800 dark:hover:text-neutral-100',
|
|
317
|
+
todayCheck && 'bg-gray-100 text-gray-900 dark:bg-neutral-800 dark:text-neutral-100',
|
|
325
318
|
selected &&
|
|
326
319
|
'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground',
|
|
327
320
|
day.isOutside &&
|
|
328
|
-
'day-outside text-muted-foreground aria-selected:bg-
|
|
329
|
-
day.disabled && 'text-muted-foreground opacity-50'
|
|
321
|
+
'day-outside text-muted-foreground aria-selected:bg-gray-100/50 aria-selected:text-muted-foreground dark:aria-selected:bg-neutral-800/50',
|
|
322
|
+
day.disabled && 'text-muted-foreground opacity-50',
|
|
330
323
|
);
|
|
331
324
|
}
|
|
332
|
-
|
|
333
325
|
protected isSelected(date: Date): boolean {
|
|
334
326
|
const selected = this.selected();
|
|
335
327
|
if (!selected) return false;
|
|
336
328
|
return this.isSameDay(date, selected);
|
|
337
329
|
}
|
|
338
|
-
|
|
339
330
|
protected selectDate(date: Date): void {
|
|
340
331
|
this.selected.set(date);
|
|
341
332
|
this.onSelect.emit(date);
|
|
342
|
-
this.
|
|
333
|
+
this._liveAnnouncer.announce(`Selected ${this.getDateLabel(date)}`, 'polite');
|
|
343
334
|
}
|
|
344
|
-
|
|
345
335
|
protected previousMonth(): void {
|
|
346
336
|
const current = this.currentMonth();
|
|
347
337
|
const newDate = new Date(current.getFullYear(), current.getMonth() - 1, 1);
|
|
348
338
|
this.currentMonth.set(newDate);
|
|
349
339
|
this.onMonthChange.emit(newDate);
|
|
350
|
-
this.
|
|
340
|
+
this._liveAnnouncer.announce(this.getPreviousMonthLabel(), 'polite');
|
|
351
341
|
}
|
|
352
|
-
|
|
353
342
|
protected nextMonth(): void {
|
|
354
343
|
const current = this.currentMonth();
|
|
355
344
|
const newDate = new Date(current.getFullYear(), current.getMonth() + 1, 1);
|
|
356
345
|
this.currentMonth.set(newDate);
|
|
357
346
|
this.onMonthChange.emit(newDate);
|
|
358
|
-
this.
|
|
347
|
+
this._liveAnnouncer.announce(this.getNextMonthLabel(), 'polite');
|
|
359
348
|
}
|
|
360
|
-
|
|
361
349
|
private isSameDay(date1: Date, date2: Date): boolean {
|
|
362
350
|
return (
|
|
363
351
|
date1.getFullYear() === date2.getFullYear() &&
|
|
@@ -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
|
* Card action element.
|
|
@@ -31,9 +26,6 @@ export class CardAction {
|
|
|
31
26
|
readonly class = input<string>('');
|
|
32
27
|
|
|
33
28
|
protected readonly computedClass = computed(() =>
|
|
34
|
-
cn(
|
|
35
|
-
'col-start-2 row-span-2 row-start-1 self-start justify-self-end',
|
|
36
|
-
this.class()
|
|
37
|
-
)
|
|
29
|
+
cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', this.class()),
|
|
38
30
|
);
|
|
39
31
|
}
|
|
@@ -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
|
* Card description element.
|
|
@@ -26,6 +21,6 @@ export class CardDescription {
|
|
|
26
21
|
readonly class = input<string>('');
|
|
27
22
|
|
|
28
23
|
protected readonly computedClass = computed(() =>
|
|
29
|
-
cn('text-muted-foreground text-sm', this.class())
|
|
24
|
+
cn('text-muted-foreground text-sm', this.class()),
|
|
30
25
|
);
|
|
31
26
|
}
|
|
@@ -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
|
* Card footer section.
|
|
@@ -29,6 +24,6 @@ export class CardFooter {
|
|
|
29
24
|
readonly class = input<string>('');
|
|
30
25
|
|
|
31
26
|
protected readonly computedClass = computed(() =>
|
|
32
|
-
cn('flex items-center px-6 [.border-t]:pt-6', this.class())
|
|
27
|
+
cn('flex items-center px-6 [.border-t]:pt-6', this.class()),
|
|
33
28
|
);
|
|
34
29
|
}
|
|
@@ -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
|
* Card header section.
|
|
@@ -31,7 +26,7 @@ export class CardHeader {
|
|
|
31
26
|
protected readonly computedClass = computed(() =>
|
|
32
27
|
cn(
|
|
33
28
|
'@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',
|
|
34
|
-
this.class()
|
|
35
|
-
)
|
|
29
|
+
this.class(),
|
|
30
|
+
),
|
|
36
31
|
);
|
|
37
32
|
}
|
|
@@ -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
|
* Card title element.
|
|
@@ -25,7 +20,5 @@ import {
|
|
|
25
20
|
export class CardTitle {
|
|
26
21
|
readonly class = input<string>('');
|
|
27
22
|
|
|
28
|
-
protected readonly computedClass = computed(() =>
|
|
29
|
-
cn('leading-none font-semibold', this.class())
|
|
30
|
-
);
|
|
23
|
+
protected readonly computedClass = computed(() => cn('leading-none font-semibold', this.class()));
|
|
31
24
|
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
|
-
import {
|
|
3
|
-
ChangeDetectionStrategy,
|
|
4
|
-
Component,
|
|
5
|
-
computed,
|
|
6
|
-
input,
|
|
7
|
-
} from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
8
3
|
|
|
9
4
|
/**
|
|
10
5
|
* Card container component.
|
|
@@ -35,7 +30,7 @@ export class Card {
|
|
|
35
30
|
protected readonly computedClass = computed(() =>
|
|
36
31
|
cn(
|
|
37
32
|
'bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm',
|
|
38
|
-
this.class()
|
|
39
|
-
)
|
|
33
|
+
this.class(),
|
|
34
|
+
),
|
|
40
35
|
);
|
|
41
36
|
}
|
|
@@ -20,19 +20,13 @@ import { CAROUSEL_CONTEXT } from './carousel-context';
|
|
|
20
20
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21
21
|
})
|
|
22
22
|
export class CarouselContent {
|
|
23
|
-
protected readonly context = inject(CAROUSEL_CONTEXT);
|
|
24
|
-
|
|
25
23
|
/** Additional CSS classes */
|
|
26
24
|
readonly class = input<string>('');
|
|
27
25
|
|
|
28
|
-
protected readonly
|
|
29
|
-
cn('overflow-hidden', this.class())
|
|
30
|
-
);
|
|
26
|
+
protected readonly context = inject(CAROUSEL_CONTEXT);
|
|
31
27
|
|
|
28
|
+
protected readonly computedClass = computed(() => cn('overflow-hidden', this.class()));
|
|
32
29
|
protected readonly innerClass = computed(() =>
|
|
33
|
-
cn(
|
|
34
|
-
'flex',
|
|
35
|
-
this.context.orientation() === 'horizontal' ? '-ml-4' : '-mt-4 flex-col'
|
|
36
|
-
)
|
|
30
|
+
cn('flex', this.context.orientation() === 'horizontal' ? '-ml-4' : '-mt-4 flex-col'),
|
|
37
31
|
);
|
|
38
32
|
}
|
|
@@ -11,22 +11,22 @@ import { CAROUSEL_CONTEXT } from './carousel-context';
|
|
|
11
11
|
template: `<ng-content />`,
|
|
12
12
|
host: {
|
|
13
13
|
'[class]': 'computedClass()',
|
|
14
|
-
|
|
14
|
+
role: 'group',
|
|
15
15
|
'aria-roledescription': 'slide',
|
|
16
16
|
},
|
|
17
17
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
18
18
|
})
|
|
19
19
|
export class CarouselItem {
|
|
20
|
-
protected readonly context = inject(CAROUSEL_CONTEXT);
|
|
21
|
-
|
|
22
20
|
/** Additional CSS classes */
|
|
23
21
|
readonly class = input<string>('');
|
|
24
22
|
|
|
23
|
+
protected readonly context = inject(CAROUSEL_CONTEXT);
|
|
24
|
+
|
|
25
25
|
protected readonly computedClass = computed(() =>
|
|
26
26
|
cn(
|
|
27
27
|
'min-w-0 shrink-0 grow-0 basis-full',
|
|
28
28
|
this.context.orientation() === 'horizontal' ? 'pl-4' : 'pt-4',
|
|
29
|
-
this.class()
|
|
30
|
-
)
|
|
29
|
+
this.class(),
|
|
30
|
+
),
|
|
31
31
|
);
|
|
32
32
|
}
|
|
@@ -29,18 +29,17 @@ import { CAROUSEL_CONTEXT } from './carousel-context';
|
|
|
29
29
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
30
30
|
})
|
|
31
31
|
export class CarouselNext {
|
|
32
|
-
protected readonly context = inject(CAROUSEL_CONTEXT);
|
|
33
|
-
protected readonly ArrowRightIcon = ArrowRight;
|
|
34
|
-
|
|
35
32
|
/** Button variant */
|
|
36
|
-
readonly variant = input<'default' | 'outline' | 'secondary' | 'ghost' | 'link' | 'destructive'>(
|
|
37
|
-
|
|
33
|
+
readonly variant = input<'default' | 'outline' | 'secondary' | 'ghost' | 'link' | 'destructive'>(
|
|
34
|
+
'outline',
|
|
35
|
+
);
|
|
38
36
|
/** Button size */
|
|
39
37
|
readonly size = input<'default' | 'sm' | 'lg' | 'icon'>('icon');
|
|
40
|
-
|
|
41
38
|
/** Additional CSS classes */
|
|
42
39
|
readonly class = input<string>('');
|
|
43
40
|
|
|
41
|
+
protected readonly context = inject(CAROUSEL_CONTEXT);
|
|
42
|
+
|
|
44
43
|
protected readonly computedClass = computed(() =>
|
|
45
44
|
cn(
|
|
46
45
|
buttonVariants({ variant: this.variant(), size: this.size() }),
|
|
@@ -48,7 +47,9 @@ export class CarouselNext {
|
|
|
48
47
|
this.context.orientation() === 'horizontal'
|
|
49
48
|
? '-right-12 top-1/2 -translate-y-1/2'
|
|
50
49
|
: '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',
|
|
51
|
-
this.class()
|
|
52
|
-
)
|
|
50
|
+
this.class(),
|
|
51
|
+
),
|
|
53
52
|
);
|
|
53
|
+
|
|
54
|
+
protected readonly ArrowRightIcon = ArrowRight;
|
|
54
55
|
}
|