@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,28 +1,24 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
ElementRef,
|
|
7
|
+
forwardRef,
|
|
8
|
+
inject,
|
|
9
|
+
input,
|
|
10
|
+
model,
|
|
11
|
+
output,
|
|
12
|
+
signal,
|
|
13
13
|
} from '@angular/core';
|
|
14
14
|
import type { ToggleVariants } from '../toggle/toggle-variants';
|
|
15
15
|
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
TOGGLE_GROUP_CONTEXT,
|
|
17
|
+
type ToggleGroupContext,
|
|
18
|
+
type ToggleGroupOrientation,
|
|
19
|
+
type ToggleGroupType,
|
|
20
20
|
} from './toggle-group-context';
|
|
21
21
|
|
|
22
|
-
// ============================================================================
|
|
23
|
-
// Types
|
|
24
|
-
// ============================================================================
|
|
25
|
-
|
|
26
22
|
export type ToggleGroupProps = {
|
|
27
23
|
/** Selection type: single or multiple */
|
|
28
24
|
type?: ToggleGroupType;
|
|
@@ -46,10 +42,6 @@ export type ToggleGroupProps = {
|
|
|
46
42
|
class?: string;
|
|
47
43
|
};
|
|
48
44
|
|
|
49
|
-
// ============================================================================
|
|
50
|
-
// ToggleGroup Component
|
|
51
|
-
// ============================================================================
|
|
52
|
-
|
|
53
45
|
/**
|
|
54
46
|
* ToggleGroup component - a set of toggle buttons where one or more can be pressed.
|
|
55
47
|
* Based on Radix UI ToggleGroup primitive with shadcn/ui styling.
|
|
@@ -146,40 +138,41 @@ export type ToggleGroupProps = {
|
|
|
146
138
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
147
139
|
})
|
|
148
140
|
export class ToggleGroup {
|
|
149
|
-
|
|
141
|
+
/** Emitted when value changes */
|
|
142
|
+
readonly valueChange = output<string | string[]>();
|
|
150
143
|
|
|
151
144
|
/** The current selected value(s) */
|
|
152
145
|
readonly value = model<string | string[]>('');
|
|
153
146
|
|
|
154
147
|
/** Default value for uncontrolled mode */
|
|
155
148
|
readonly defaultValue = input<string | string[]>('');
|
|
156
|
-
|
|
157
149
|
/** Selection type: single or multiple */
|
|
158
150
|
readonly type = input<ToggleGroupType>('single');
|
|
159
|
-
|
|
160
151
|
/** The visual style variant of the toggle items */
|
|
161
152
|
readonly variant = input<ToggleVariants['variant']>('default');
|
|
162
|
-
|
|
163
153
|
/** The size of the toggle items */
|
|
164
154
|
readonly size = input<ToggleVariants['size']>('default');
|
|
165
|
-
|
|
166
155
|
/** Whether the toggle group is disabled */
|
|
167
156
|
readonly disabled = input<boolean>(false);
|
|
168
|
-
|
|
169
157
|
/** The orientation of the toggle group */
|
|
170
158
|
readonly orientation = input<ToggleGroupOrientation>('horizontal');
|
|
171
|
-
|
|
172
159
|
/** Whether to loop focus at boundaries */
|
|
173
160
|
readonly loop = input<boolean>(true);
|
|
174
|
-
|
|
175
161
|
/** Whether focus should follow selection in single mode */
|
|
176
162
|
readonly rovingFocus = input<boolean>(true);
|
|
177
|
-
|
|
178
163
|
/** Additional CSS classes to apply */
|
|
179
164
|
readonly class = input<string>('');
|
|
180
165
|
|
|
181
|
-
|
|
182
|
-
|
|
166
|
+
private readonly _elementRef = inject(ElementRef<HTMLElement>);
|
|
167
|
+
|
|
168
|
+
/** Computed class combining base styles and custom classes */
|
|
169
|
+
protected readonly computedClass = computed(() =>
|
|
170
|
+
cn(
|
|
171
|
+
'flex items-center justify-center gap-1',
|
|
172
|
+
this.orientation() === 'vertical' && 'flex-col',
|
|
173
|
+
this.class(),
|
|
174
|
+
),
|
|
175
|
+
);
|
|
183
176
|
|
|
184
177
|
/** Context for child ToggleGroupItem components */
|
|
185
178
|
readonly context: ToggleGroupContext = {
|
|
@@ -224,19 +217,9 @@ export class ToggleGroup {
|
|
|
224
217
|
focusNext: (currentValue: string) => this.focusItem(currentValue, 1),
|
|
225
218
|
focusPrevious: (currentValue: string) => this.focusItem(currentValue, -1),
|
|
226
219
|
focusFirst: () => this.focusItemByIndex(0),
|
|
227
|
-
focusLast: () =>
|
|
228
|
-
this.focusItemByIndex(this.context.itemValues().length - 1),
|
|
220
|
+
focusLast: () => this.focusItemByIndex(this.context.itemValues().length - 1),
|
|
229
221
|
};
|
|
230
222
|
|
|
231
|
-
/** Computed class combining base styles and custom classes */
|
|
232
|
-
protected readonly computedClass = computed(() =>
|
|
233
|
-
cn(
|
|
234
|
-
'flex items-center justify-center gap-1',
|
|
235
|
-
this.orientation() === 'vertical' && 'flex-col',
|
|
236
|
-
this.class()
|
|
237
|
-
)
|
|
238
|
-
);
|
|
239
|
-
|
|
240
223
|
ngOnChanges(): void {
|
|
241
224
|
this.context.value.set(this.value());
|
|
242
225
|
this.context.type.set(this.type());
|
|
@@ -268,21 +251,20 @@ export class ToggleGroup {
|
|
|
268
251
|
|
|
269
252
|
this.focusItemByIndex(nextIndex);
|
|
270
253
|
}
|
|
271
|
-
|
|
272
254
|
/** Focus a toggle item by index */
|
|
273
255
|
private focusItemByIndex(index: number): void {
|
|
274
256
|
const values = this.context.itemValues();
|
|
275
257
|
if (index < 0 || index >= values.length) return;
|
|
276
258
|
|
|
277
|
-
const
|
|
278
|
-
this.context.focusedValue.set(
|
|
259
|
+
const targetValue = values[index];
|
|
260
|
+
this.context.focusedValue.set(targetValue);
|
|
279
261
|
|
|
280
|
-
const
|
|
281
|
-
`[data-slot="toggle-group-item"][data-value="${
|
|
262
|
+
const toggleItem = this._elementRef.nativeElement.querySelector(
|
|
263
|
+
`[data-slot="toggle-group-item"][data-value="${targetValue}"]`,
|
|
282
264
|
) as HTMLElement;
|
|
283
265
|
|
|
284
|
-
if (
|
|
285
|
-
|
|
266
|
+
if (toggleItem) {
|
|
267
|
+
toggleItem.focus();
|
|
286
268
|
}
|
|
287
269
|
}
|
|
288
270
|
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
// Context and types
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
TOOLTIP_CONTEXT,
|
|
4
|
+
type TooltipAlign,
|
|
5
|
+
type TooltipContextValue,
|
|
6
|
+
type TooltipSide,
|
|
7
7
|
} from './tooltip-context';
|
|
8
8
|
|
|
9
9
|
// Components and their types
|
|
10
|
-
export {
|
|
10
|
+
export {
|
|
11
|
+
TooltipContent,
|
|
12
|
+
type TooltipContentProps,
|
|
13
|
+
type TooltipContentState,
|
|
14
|
+
} from './tooltip-content.component';
|
|
11
15
|
export { TooltipProvider, type TooltipProviderProps } from './tooltip-provider.component';
|
|
12
16
|
export { TooltipTrigger, type TooltipTriggerProps } from './tooltip-trigger.component';
|
|
13
17
|
export { Tooltip, type TooltipProps, type TooltipState } from './tooltip.component';
|
|
14
|
-
|
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
import { cn, Presence } from '@/lib/utils';
|
|
2
|
-
import {
|
|
3
|
-
ChangeDetectionStrategy,
|
|
4
|
-
Component,
|
|
5
|
-
computed,
|
|
6
|
-
inject,
|
|
7
|
-
input,
|
|
8
|
-
} from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';
|
|
9
3
|
import { TOOLTIP_CONTEXT, TooltipAlign, TooltipSide } from './tooltip-context';
|
|
10
4
|
|
|
11
|
-
// ============================================================================
|
|
12
|
-
// Types
|
|
13
|
-
// ============================================================================
|
|
14
|
-
|
|
15
5
|
export type TooltipContentState = 'open' | 'closed';
|
|
16
6
|
|
|
17
7
|
/**
|
|
@@ -37,10 +27,6 @@ export interface TooltipContentProps {
|
|
|
37
27
|
class?: string;
|
|
38
28
|
}
|
|
39
29
|
|
|
40
|
-
// ============================================================================
|
|
41
|
-
// Component
|
|
42
|
-
// ============================================================================
|
|
43
|
-
|
|
44
30
|
/**
|
|
45
31
|
* @component TooltipContent
|
|
46
32
|
*
|
|
@@ -105,33 +91,29 @@ export interface TooltipContentProps {
|
|
|
105
91
|
</Presence>
|
|
106
92
|
`,
|
|
107
93
|
host: {
|
|
94
|
+
'attr.data-slot': '"tooltip-content"',
|
|
108
95
|
class: 'contents',
|
|
109
96
|
},
|
|
110
97
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
111
98
|
})
|
|
112
99
|
export class TooltipContent {
|
|
113
|
-
protected readonly context = inject(TOOLTIP_CONTEXT);
|
|
114
|
-
|
|
115
100
|
/** The preferred side of the trigger to render against */
|
|
116
101
|
readonly side = input<TooltipSide>('top');
|
|
117
|
-
|
|
118
102
|
/** The distance in pixels from the trigger */
|
|
119
103
|
readonly sideOffset = input<number>(4);
|
|
120
|
-
|
|
121
104
|
/** The preferred alignment against the trigger */
|
|
122
105
|
readonly align = input<TooltipAlign>('center');
|
|
123
|
-
|
|
124
106
|
/** An offset in pixels from the alignment options */
|
|
125
107
|
readonly alignOffset = input<number>(0);
|
|
126
|
-
|
|
127
108
|
/** Additional CSS classes */
|
|
128
109
|
readonly class = input<string>('');
|
|
129
110
|
|
|
111
|
+
protected readonly context = inject(TOOLTIP_CONTEXT);
|
|
112
|
+
|
|
130
113
|
/** Current state: open or closed */
|
|
131
114
|
protected readonly state = computed<TooltipContentState>(() =>
|
|
132
|
-
this.context.open() ? 'open' : 'closed'
|
|
115
|
+
this.context.open() ? 'open' : 'closed',
|
|
133
116
|
);
|
|
134
|
-
|
|
135
117
|
protected readonly computedClass = computed(() => {
|
|
136
118
|
const sideClasses = {
|
|
137
119
|
top: 'bottom-full left-1/2 -translate-x-1/2 mb-2',
|
|
@@ -148,7 +130,7 @@ export class TooltipContent {
|
|
|
148
130
|
'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2',
|
|
149
131
|
'data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
|
|
150
132
|
sideClasses[this.side()],
|
|
151
|
-
this.class()
|
|
133
|
+
this.class(),
|
|
152
134
|
);
|
|
153
135
|
});
|
|
154
136
|
}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { InjectionToken, WritableSignal } from '@angular/core';
|
|
2
2
|
|
|
3
|
-
// ============================================================================
|
|
4
|
-
// Types
|
|
5
|
-
// ============================================================================
|
|
6
|
-
|
|
7
3
|
export type TooltipSide = 'top' | 'right' | 'bottom' | 'left';
|
|
8
4
|
export type TooltipAlign = 'start' | 'center' | 'end';
|
|
9
5
|
|
|
@@ -22,8 +18,4 @@ export interface TooltipContextValue {
|
|
|
22
18
|
disableHoverableContent: () => boolean;
|
|
23
19
|
}
|
|
24
20
|
|
|
25
|
-
// ============================================================================
|
|
26
|
-
// Injection Tokens
|
|
27
|
-
// ============================================================================
|
|
28
|
-
|
|
29
21
|
export const TOOLTIP_CONTEXT = new InjectionToken<TooltipContextValue>('TOOLTIP_CONTEXT');
|
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChangeDetectionStrategy,
|
|
3
|
-
Component,
|
|
4
|
-
forwardRef,
|
|
5
|
-
input,
|
|
6
|
-
signal,
|
|
7
|
-
} from '@angular/core';
|
|
1
|
+
import { ChangeDetectionStrategy, Component, forwardRef, input, signal } from '@angular/core';
|
|
8
2
|
import { TOOLTIP_CONTEXT, type TooltipContextValue } from './tooltip-context';
|
|
9
3
|
|
|
10
4
|
let tooltipIdCounter = 0;
|
|
11
5
|
|
|
12
|
-
// ============================================================================
|
|
13
|
-
// Types
|
|
14
|
-
// ============================================================================
|
|
15
|
-
|
|
16
6
|
/**
|
|
17
7
|
* Props for the TooltipProvider component
|
|
18
8
|
*/
|
|
@@ -28,10 +18,6 @@ export interface TooltipProviderProps {
|
|
|
28
18
|
disableHoverableContent?: boolean;
|
|
29
19
|
}
|
|
30
20
|
|
|
31
|
-
// ============================================================================
|
|
32
|
-
// Component
|
|
33
|
-
// ============================================================================
|
|
34
|
-
|
|
35
21
|
/**
|
|
36
22
|
* @component TooltipProvider
|
|
37
23
|
*
|
|
@@ -66,6 +52,10 @@ export interface TooltipProviderProps {
|
|
|
66
52
|
@Component({
|
|
67
53
|
selector: 'TooltipProvider',
|
|
68
54
|
template: `<ng-content />`,
|
|
55
|
+
host: {
|
|
56
|
+
'attr.data-slot': '"tooltip-provider"',
|
|
57
|
+
style: 'display: contents',
|
|
58
|
+
},
|
|
69
59
|
providers: [
|
|
70
60
|
{
|
|
71
61
|
provide: TOOLTIP_CONTEXT,
|
|
@@ -75,20 +65,18 @@ export interface TooltipProviderProps {
|
|
|
75
65
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
76
66
|
})
|
|
77
67
|
export class TooltipProvider implements TooltipContextValue {
|
|
78
|
-
/** The duration from when the pointer enters the trigger until the tooltip opens */
|
|
79
|
-
readonly delayDuration = 700;
|
|
80
|
-
|
|
81
|
-
/** How much time a user has to enter another trigger without incurring a delay again */
|
|
82
|
-
readonly skipDelayDuration = 300;
|
|
83
|
-
|
|
84
|
-
/** Unique ID for aria-describedby relationship */
|
|
85
|
-
readonly tooltipId = `tooltip-provider-${++tooltipIdCounter}`;
|
|
86
|
-
|
|
87
68
|
/** When true, trying to hover the content will result in the tooltip closing */
|
|
88
69
|
readonly disableHoverableContent = input<boolean>(false);
|
|
89
70
|
|
|
90
71
|
readonly open = signal(false);
|
|
91
72
|
|
|
73
|
+
/** Unique ID for aria-describedby relationship */
|
|
74
|
+
readonly tooltipId = `tooltip-provider-${++tooltipIdCounter}`;
|
|
75
|
+
/** The duration from when the pointer enters the trigger until the tooltip opens */
|
|
76
|
+
readonly delayDuration = 700;
|
|
77
|
+
/** How much time a user has to enter another trigger without incurring a delay again */
|
|
78
|
+
readonly skipDelayDuration = 300;
|
|
79
|
+
|
|
92
80
|
setOpen(open: boolean): void {
|
|
93
81
|
this.open.set(open);
|
|
94
82
|
}
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ChangeDetectionStrategy,
|
|
3
|
-
Component,
|
|
4
|
-
inject,
|
|
5
|
-
input,
|
|
6
|
-
OnDestroy,
|
|
7
|
-
} from '@angular/core';
|
|
1
|
+
import { ChangeDetectionStrategy, Component, inject, input, OnDestroy } from '@angular/core';
|
|
8
2
|
import { TOOLTIP_CONTEXT } from './tooltip-context';
|
|
9
3
|
|
|
10
|
-
// ============================================================================
|
|
11
|
-
// Types
|
|
12
|
-
// ============================================================================
|
|
13
|
-
|
|
14
4
|
/**
|
|
15
5
|
* Props for the TooltipTrigger component
|
|
16
6
|
*/
|
|
@@ -20,10 +10,6 @@ export interface TooltipTriggerProps {
|
|
|
20
10
|
asChild?: boolean;
|
|
21
11
|
}
|
|
22
12
|
|
|
23
|
-
// ============================================================================
|
|
24
|
-
// Component
|
|
25
|
-
// ============================================================================
|
|
26
|
-
|
|
27
13
|
/**
|
|
28
14
|
* @component TooltipTrigger
|
|
29
15
|
*
|
|
@@ -68,6 +54,7 @@ export interface TooltipTriggerProps {
|
|
|
68
54
|
selector: 'TooltipTrigger',
|
|
69
55
|
template: `<ng-content />`,
|
|
70
56
|
host: {
|
|
57
|
+
'attr.data-slot': '"tooltip-trigger"',
|
|
71
58
|
'(mouseenter)': 'onMouseEnter()',
|
|
72
59
|
'(mouseleave)': 'onMouseLeave()',
|
|
73
60
|
'(focus)': 'onFocus()',
|
|
@@ -79,11 +66,11 @@ export interface TooltipTriggerProps {
|
|
|
79
66
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
80
67
|
})
|
|
81
68
|
export class TooltipTrigger implements OnDestroy {
|
|
82
|
-
protected readonly context = inject(TOOLTIP_CONTEXT);
|
|
83
|
-
|
|
84
69
|
/** Change the default rendered element for the one passed as a child */
|
|
85
70
|
readonly asChild = input<boolean>(false);
|
|
86
71
|
|
|
72
|
+
protected readonly context = inject(TOOLTIP_CONTEXT);
|
|
73
|
+
|
|
87
74
|
private showTimeout: ReturnType<typeof setTimeout> | null = null;
|
|
88
75
|
private hideTimeout: ReturnType<typeof setTimeout> | null = null;
|
|
89
76
|
|
|
@@ -97,7 +84,6 @@ export class TooltipTrigger implements OnDestroy {
|
|
|
97
84
|
this.context.setOpen(true);
|
|
98
85
|
}, this.context.delayDuration);
|
|
99
86
|
}
|
|
100
|
-
|
|
101
87
|
onMouseLeave(): void {
|
|
102
88
|
this.clearTimeouts();
|
|
103
89
|
// Small delay to allow moving to tooltip content
|
|
@@ -105,16 +91,13 @@ export class TooltipTrigger implements OnDestroy {
|
|
|
105
91
|
this.context.setOpen(false);
|
|
106
92
|
}, 100);
|
|
107
93
|
}
|
|
108
|
-
|
|
109
94
|
onFocus(): void {
|
|
110
95
|
// Show immediately on focus for keyboard users
|
|
111
96
|
this.context.setOpen(true);
|
|
112
97
|
}
|
|
113
|
-
|
|
114
98
|
onBlur(): void {
|
|
115
99
|
this.context.setOpen(false);
|
|
116
100
|
}
|
|
117
|
-
|
|
118
101
|
/**
|
|
119
102
|
* Escape key handler for WCAG 1.4.13 compliance.
|
|
120
103
|
* Content on hover/focus must be dismissible via Escape.
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
forwardRef,
|
|
5
|
+
input,
|
|
6
|
+
output,
|
|
7
|
+
signal,
|
|
8
8
|
} from '@angular/core';
|
|
9
9
|
import { TOOLTIP_CONTEXT, type TooltipContextValue } from './tooltip-context';
|
|
10
10
|
|
|
11
11
|
let tooltipIdCounter = 0;
|
|
12
12
|
|
|
13
|
-
// ============================================================================
|
|
14
|
-
// Types
|
|
15
|
-
// ============================================================================
|
|
16
|
-
|
|
17
13
|
export type TooltipState = 'open' | 'closed';
|
|
18
14
|
|
|
19
15
|
/**
|
|
@@ -38,10 +34,6 @@ export interface TooltipProps {
|
|
|
38
34
|
disableHoverableContent?: boolean;
|
|
39
35
|
}
|
|
40
36
|
|
|
41
|
-
// ============================================================================
|
|
42
|
-
// Component
|
|
43
|
-
// ============================================================================
|
|
44
|
-
|
|
45
37
|
/**
|
|
46
38
|
* @component Tooltip
|
|
47
39
|
*
|
|
@@ -104,6 +96,7 @@ export interface TooltipProps {
|
|
|
104
96
|
selector: 'Tooltip',
|
|
105
97
|
template: `<ng-content />`,
|
|
106
98
|
host: {
|
|
99
|
+
'attr.data-slot': '"tooltip"',
|
|
107
100
|
class: 'relative inline-block',
|
|
108
101
|
},
|
|
109
102
|
providers: [
|
|
@@ -115,36 +108,32 @@ export interface TooltipProps {
|
|
|
115
108
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
116
109
|
})
|
|
117
110
|
export class Tooltip implements TooltipContextValue {
|
|
111
|
+
constructor() {
|
|
112
|
+
// Initialize from defaultOpen
|
|
113
|
+
if (this.defaultOpen()) {
|
|
114
|
+
this.open.set(true);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Event handler called when the open state changes */
|
|
119
|
+
readonly openChange = output<boolean>();
|
|
120
|
+
|
|
118
121
|
/** The open state of the tooltip when initially rendered */
|
|
119
122
|
readonly defaultOpen = input<boolean>(false);
|
|
120
|
-
|
|
121
123
|
/** The controlled open state of the tooltip */
|
|
122
124
|
readonly controlledOpen = input<boolean | undefined>(undefined, { alias: 'open' });
|
|
125
|
+
/** When true, trying to hover the content will result in the tooltip closing */
|
|
126
|
+
readonly disableHoverableContent = input<boolean>(false);
|
|
127
|
+
|
|
128
|
+
readonly open = signal(false);
|
|
123
129
|
|
|
124
130
|
/** The duration from when the pointer enters the trigger until the tooltip opens */
|
|
125
131
|
readonly delayDuration = 700;
|
|
126
|
-
|
|
127
132
|
/** How much time a user has to enter another trigger without incurring a delay again */
|
|
128
133
|
readonly skipDelayDuration = 300;
|
|
129
|
-
|
|
130
|
-
/** When true, trying to hover the content will result in the tooltip closing */
|
|
131
|
-
readonly disableHoverableContent = input<boolean>(false);
|
|
132
|
-
|
|
133
|
-
/** Event handler called when the open state changes */
|
|
134
|
-
readonly openChange = output<boolean>();
|
|
135
|
-
|
|
136
134
|
/** Unique ID for aria-describedby relationship */
|
|
137
135
|
readonly tooltipId = `tooltip-${++tooltipIdCounter}`;
|
|
138
136
|
|
|
139
|
-
readonly open = signal(false);
|
|
140
|
-
|
|
141
|
-
constructor() {
|
|
142
|
-
// Initialize from defaultOpen
|
|
143
|
-
if (this.defaultOpen()) {
|
|
144
|
-
this.open.set(true);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
137
|
setOpen(open: boolean): void {
|
|
149
138
|
const controlled = this.controlledOpen();
|
|
150
139
|
if (controlled === undefined) {
|
|
@@ -152,7 +141,6 @@ export class Tooltip implements TooltipContextValue {
|
|
|
152
141
|
}
|
|
153
142
|
this.openChange.emit(open);
|
|
154
143
|
}
|
|
155
|
-
|
|
156
144
|
isOpen(): boolean {
|
|
157
145
|
return this.controlledOpen() !== undefined ? this.controlledOpen()! : this.open();
|
|
158
146
|
}
|
|
@@ -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
|
* Typography Blockquote component
|
|
@@ -18,6 +13,7 @@ import {
|
|
|
18
13
|
selector: 'TypographyBlockquote',
|
|
19
14
|
template: `<ng-content />`,
|
|
20
15
|
host: {
|
|
16
|
+
'attr.data-slot': '"typography-blockquote"',
|
|
21
17
|
'[class]': 'computedClass()',
|
|
22
18
|
style: 'display: block',
|
|
23
19
|
},
|
|
@@ -26,6 +22,6 @@ import {
|
|
|
26
22
|
export class TypographyBlockquote {
|
|
27
23
|
readonly class = input<string>('');
|
|
28
24
|
protected readonly computedClass = computed(() =>
|
|
29
|
-
cn('mt-6 border-l-2 pl-6 italic', this.class())
|
|
25
|
+
cn('mt-6 border-l-2 pl-6 italic', this.class()),
|
|
30
26
|
);
|
|
31
27
|
}
|
|
@@ -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
|
* Typography H1 component
|
|
@@ -16,6 +11,7 @@ import {
|
|
|
16
11
|
selector: 'TypographyH1',
|
|
17
12
|
template: `<ng-content />`,
|
|
18
13
|
host: {
|
|
14
|
+
'attr.data-slot': '"typography-h1"',
|
|
19
15
|
'[class]': 'computedClass()',
|
|
20
16
|
style: 'display: block',
|
|
21
17
|
},
|
|
@@ -24,9 +20,6 @@ import {
|
|
|
24
20
|
export class TypographyH1 {
|
|
25
21
|
readonly class = input<string>('');
|
|
26
22
|
protected readonly computedClass = computed(() =>
|
|
27
|
-
cn(
|
|
28
|
-
'scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl',
|
|
29
|
-
this.class()
|
|
30
|
-
)
|
|
23
|
+
cn('scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl', this.class()),
|
|
31
24
|
);
|
|
32
25
|
}
|
|
@@ -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
|
* Typography H2 component
|
|
@@ -16,6 +11,7 @@ import {
|
|
|
16
11
|
selector: 'TypographyH2',
|
|
17
12
|
template: `<ng-content />`,
|
|
18
13
|
host: {
|
|
14
|
+
'attr.data-slot': '"typography-h2"',
|
|
19
15
|
'[class]': 'computedClass()',
|
|
20
16
|
style: 'display: block',
|
|
21
17
|
},
|
|
@@ -24,9 +20,6 @@ import {
|
|
|
24
20
|
export class TypographyH2 {
|
|
25
21
|
readonly class = input<string>('');
|
|
26
22
|
protected readonly computedClass = computed(() =>
|
|
27
|
-
cn(
|
|
28
|
-
'scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0',
|
|
29
|
-
this.class()
|
|
30
|
-
)
|
|
23
|
+
cn('scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0', this.class()),
|
|
31
24
|
);
|
|
32
25
|
}
|
|
@@ -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
|
* Typography H3 component
|
|
@@ -16,6 +11,7 @@ import {
|
|
|
16
11
|
selector: 'TypographyH3',
|
|
17
12
|
template: `<ng-content />`,
|
|
18
13
|
host: {
|
|
14
|
+
'attr.data-slot': '"typography-h3"',
|
|
19
15
|
'[class]': 'computedClass()',
|
|
20
16
|
style: 'display: block',
|
|
21
17
|
},
|
|
@@ -24,6 +20,6 @@ import {
|
|
|
24
20
|
export class TypographyH3 {
|
|
25
21
|
readonly class = input<string>('');
|
|
26
22
|
protected readonly computedClass = computed(() =>
|
|
27
|
-
cn('scroll-m-20 text-2xl font-semibold tracking-tight', this.class())
|
|
23
|
+
cn('scroll-m-20 text-2xl font-semibold tracking-tight', this.class()),
|
|
28
24
|
);
|
|
29
25
|
}
|
|
@@ -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
|
* Typography H4 component
|
|
@@ -16,6 +11,7 @@ import {
|
|
|
16
11
|
selector: 'TypographyH4',
|
|
17
12
|
template: `<ng-content />`,
|
|
18
13
|
host: {
|
|
14
|
+
'attr.data-slot': '"typography-h4"',
|
|
19
15
|
'[class]': 'computedClass()',
|
|
20
16
|
style: 'display: block',
|
|
21
17
|
},
|
|
@@ -24,6 +20,6 @@ import {
|
|
|
24
20
|
export class TypographyH4 {
|
|
25
21
|
readonly class = input<string>('');
|
|
26
22
|
protected readonly computedClass = computed(() =>
|
|
27
|
-
cn('scroll-m-20 text-xl font-semibold tracking-tight', this.class())
|
|
23
|
+
cn('scroll-m-20 text-xl font-semibold tracking-tight', this.class()),
|
|
28
24
|
);
|
|
29
25
|
}
|