@ng-cn/core 1.0.10 → 1.0.12
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 +3 -2
- package/src/app/lib/components/ui/accordion/accordion-content.component.ts +53 -0
- package/src/app/lib/components/ui/accordion/accordion-context.ts +33 -0
- package/src/app/lib/components/ui/accordion/accordion-item.component.ts +86 -0
- package/src/app/lib/components/ui/accordion/accordion-trigger.component.ts +73 -0
- package/src/app/lib/components/ui/accordion/accordion.component.ts +197 -0
- package/src/app/lib/components/ui/accordion/index.ts +15 -0
- package/src/app/lib/components/ui/alert/alert-description.component.ts +33 -0
- package/src/app/lib/components/ui/alert/alert-title.component.ts +30 -0
- package/src/app/lib/components/ui/alert/alert-variants.ts +23 -0
- package/src/app/lib/components/ui/alert/alert.component.ts +50 -0
- package/src/app/lib/components/ui/alert/index.ts +5 -0
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-action.component.ts +44 -0
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-cancel.component.ts +45 -0
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-content.component.ts +146 -0
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-context.ts +14 -0
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-description.component.ts +37 -0
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-footer.component.ts +35 -0
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-header.component.ts +35 -0
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-title.component.ts +37 -0
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-trigger.component.ts +44 -0
- package/src/app/lib/components/ui/alert-dialog/alert-dialog.component.ts +91 -0
- package/src/app/lib/components/ui/alert-dialog/index.ts +11 -0
- package/src/app/lib/components/ui/aspect-ratio/aspect-ratio.component.ts +63 -0
- package/src/app/lib/components/ui/aspect-ratio/index.ts +1 -0
- package/src/app/lib/components/ui/avatar/avatar-fallback.component.ts +34 -0
- package/src/app/lib/components/ui/avatar/avatar-image.component.ts +31 -0
- package/src/app/lib/components/ui/avatar/avatar.component.ts +37 -0
- package/src/app/lib/components/ui/avatar/index.ts +5 -0
- package/src/app/lib/components/ui/avatar/ui-avatar.component.ts +52 -0
- package/src/app/lib/components/ui/badge/badge-variants.ts +28 -0
- package/src/app/lib/components/ui/badge/badge.component.ts +50 -0
- package/src/app/lib/components/ui/badge/index.ts +3 -0
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-ellipsis.component.ts +48 -0
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-item.component.ts +28 -0
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-link.component.ts +32 -0
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-list.component.ts +31 -0
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-page.component.ts +31 -0
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-separator.component.ts +47 -0
- package/src/app/lib/components/ui/breadcrumb/breadcrumb.component.ts +43 -0
- package/src/app/lib/components/ui/breadcrumb/index.ts +8 -0
- package/src/app/lib/components/ui/button/button-variants.ts +38 -0
- package/src/app/lib/components/ui/button/button.component.ts +103 -0
- package/src/app/lib/components/ui/button/index.ts +3 -0
- package/src/app/lib/components/ui/button-group/button-group-variants.ts +24 -0
- package/src/app/lib/components/ui/button-group/button-group.component.ts +57 -0
- package/src/app/lib/components/ui/button-group/index.ts +6 -0
- package/src/app/lib/components/ui/calendar/calendar.component.ts +368 -0
- package/src/app/lib/components/ui/calendar/index.ts +1 -0
- package/src/app/lib/components/ui/card/card-action.component.ts +39 -0
- package/src/app/lib/components/ui/card/card-content.component.ts +31 -0
- package/src/app/lib/components/ui/card/card-description.component.ts +31 -0
- package/src/app/lib/components/ui/card/card-footer.component.ts +34 -0
- package/src/app/lib/components/ui/card/card-header.component.ts +37 -0
- package/src/app/lib/components/ui/card/card-title.component.ts +31 -0
- package/src/app/lib/components/ui/card/card.component.ts +41 -0
- package/src/app/lib/components/ui/card/index.ts +8 -0
- package/src/app/lib/components/ui/carousel/carousel-content.component.ts +38 -0
- package/src/app/lib/components/ui/carousel/carousel-context.ts +18 -0
- package/src/app/lib/components/ui/carousel/carousel-item.component.ts +32 -0
- package/src/app/lib/components/ui/carousel/carousel-next.component.ts +54 -0
- package/src/app/lib/components/ui/carousel/carousel-previous.component.ts +54 -0
- package/src/app/lib/components/ui/carousel/carousel.component.ts +125 -0
- package/src/app/lib/components/ui/carousel/index.ts +7 -0
- package/src/app/lib/components/ui/chart/chart-container.component.ts +81 -0
- package/src/app/lib/components/ui/chart/chart-context.ts +38 -0
- package/src/app/lib/components/ui/chart/chart-legend-content.component.ts +51 -0
- package/src/app/lib/components/ui/chart/chart-legend.component.ts +28 -0
- package/src/app/lib/components/ui/chart/chart-tooltip-content.component.ts +37 -0
- package/src/app/lib/components/ui/chart/chart-tooltip.component.ts +28 -0
- package/src/app/lib/components/ui/chart/chart.component.ts +308 -0
- package/src/app/lib/components/ui/chart/index.ts +16 -0
- package/src/app/lib/components/ui/checkbox/checkbox.component.ts +203 -0
- package/src/app/lib/components/ui/checkbox/index.ts +1 -0
- package/src/app/lib/components/ui/collapsible/collapsible-content.component.ts +58 -0
- package/src/app/lib/components/ui/collapsible/collapsible-context.ts +17 -0
- package/src/app/lib/components/ui/collapsible/collapsible-trigger.component.ts +56 -0
- package/src/app/lib/components/ui/collapsible/collapsible.component.ts +102 -0
- package/src/app/lib/components/ui/collapsible/index.ts +5 -0
- package/src/app/lib/components/ui/combobox/combobox-content.component.ts +59 -0
- package/src/app/lib/components/ui/combobox/combobox-context.ts +49 -0
- package/src/app/lib/components/ui/combobox/combobox-empty.component.ts +35 -0
- package/src/app/lib/components/ui/combobox/combobox-group.component.ts +32 -0
- package/src/app/lib/components/ui/combobox/combobox-input.component.ts +89 -0
- package/src/app/lib/components/ui/combobox/combobox-item.component.ts +129 -0
- package/src/app/lib/components/ui/combobox/combobox-list.component.ts +40 -0
- package/src/app/lib/components/ui/combobox/combobox-trigger.component.ts +53 -0
- package/src/app/lib/components/ui/combobox/combobox-value.component.ts +47 -0
- package/src/app/lib/components/ui/combobox/combobox.component.ts +290 -0
- package/src/app/lib/components/ui/combobox/index.ts +15 -0
- package/src/app/lib/components/ui/command/command-context.ts +24 -0
- package/src/app/lib/components/ui/command/command-dialog.component.ts +69 -0
- package/src/app/lib/components/ui/command/command-empty.component.ts +23 -0
- package/src/app/lib/components/ui/command/command-group.component.ts +66 -0
- package/src/app/lib/components/ui/command/command-input.component.ts +137 -0
- package/src/app/lib/components/ui/command/command-item.component.ts +148 -0
- package/src/app/lib/components/ui/command/command-list.component.ts +30 -0
- package/src/app/lib/components/ui/command/command-separator.component.ts +23 -0
- package/src/app/lib/components/ui/command/command-shortcut.component.ts +23 -0
- package/src/app/lib/components/ui/command/command.component.ts +105 -0
- package/src/app/lib/components/ui/command/index.ts +11 -0
- package/src/app/lib/components/ui/context-menu/context-menu-checkbox-item.component.ts +68 -0
- package/src/app/lib/components/ui/context-menu/context-menu-content.component.ts +213 -0
- package/src/app/lib/components/ui/context-menu/context-menu-context.ts +17 -0
- package/src/app/lib/components/ui/context-menu/context-menu-item.component.ts +63 -0
- package/src/app/lib/components/ui/context-menu/context-menu-label.component.ts +30 -0
- package/src/app/lib/components/ui/context-menu/context-menu-radio-group.component.ts +36 -0
- package/src/app/lib/components/ui/context-menu/context-menu-radio-item.component.ts +71 -0
- package/src/app/lib/components/ui/context-menu/context-menu-separator.component.ts +24 -0
- package/src/app/lib/components/ui/context-menu/context-menu-shortcut.component.ts +23 -0
- package/src/app/lib/components/ui/context-menu/context-menu-sub-content.component.ts +51 -0
- package/src/app/lib/components/ui/context-menu/context-menu-sub-trigger.component.ts +50 -0
- package/src/app/lib/components/ui/context-menu/context-menu-sub.component.ts +31 -0
- package/src/app/lib/components/ui/context-menu/context-menu-trigger.component.ts +51 -0
- package/src/app/lib/components/ui/context-menu/context-menu.component.ts +27 -0
- package/src/app/lib/components/ui/context-menu/index.ts +15 -0
- package/src/app/lib/components/ui/data-table/data-table-content.component.ts +226 -0
- package/src/app/lib/components/ui/data-table/data-table-context.ts +49 -0
- package/src/app/lib/components/ui/data-table/data-table-pagination.component.ts +138 -0
- package/src/app/lib/components/ui/data-table/data-table-search.component.ts +52 -0
- package/src/app/lib/components/ui/data-table/data-table-toolbar.component.ts +27 -0
- package/src/app/lib/components/ui/data-table/data-table-view-options.component.ts +92 -0
- package/src/app/lib/components/ui/data-table/data-table.component.ts +131 -0
- package/src/app/lib/components/ui/data-table/index.ts +16 -0
- package/src/app/lib/components/ui/date-picker/date-picker.component.ts +94 -0
- package/src/app/lib/components/ui/date-picker/index.ts +1 -0
- package/src/app/lib/components/ui/dialog/dialog-close.component.ts +31 -0
- package/src/app/lib/components/ui/dialog/dialog-content.component.ts +177 -0
- package/src/app/lib/components/ui/dialog/dialog-context.ts +15 -0
- package/src/app/lib/components/ui/dialog/dialog-description.component.ts +34 -0
- package/src/app/lib/components/ui/dialog/dialog-footer.component.ts +28 -0
- package/src/app/lib/components/ui/dialog/dialog-header.component.ts +28 -0
- package/src/app/lib/components/ui/dialog/dialog-title.component.ts +34 -0
- package/src/app/lib/components/ui/dialog/dialog-trigger.component.ts +38 -0
- package/src/app/lib/components/ui/dialog/dialog.component.ts +87 -0
- package/src/app/lib/components/ui/dialog/index.ts +10 -0
- package/src/app/lib/components/ui/drawer/drawer-close.component.ts +31 -0
- package/src/app/lib/components/ui/drawer/drawer-content.component.ts +143 -0
- package/src/app/lib/components/ui/drawer/drawer-context.ts +17 -0
- package/src/app/lib/components/ui/drawer/drawer-description.component.ts +33 -0
- package/src/app/lib/components/ui/drawer/drawer-footer.component.ts +28 -0
- package/src/app/lib/components/ui/drawer/drawer-header.component.ts +28 -0
- package/src/app/lib/components/ui/drawer/drawer-title.component.ts +33 -0
- package/src/app/lib/components/ui/drawer/drawer-trigger.component.ts +38 -0
- package/src/app/lib/components/ui/drawer/drawer.component.ts +93 -0
- package/src/app/lib/components/ui/drawer/index.ts +10 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.component.ts +68 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-content.component.ts +234 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-context.ts +15 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-group.component.ts +15 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-item.component.ts +56 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-label.component.ts +30 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.component.ts +42 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.component.ts +71 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-separator.component.ts +24 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.component.ts +23 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.component.ts +51 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.component.ts +53 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-sub.component.ts +31 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-trigger.component.ts +45 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu.component.ts +32 -0
- package/src/app/lib/components/ui/dropdown-menu/index.ts +16 -0
- package/src/app/lib/components/ui/empty/empty-action.component.ts +28 -0
- package/src/app/lib/components/ui/empty/empty-description.component.ts +31 -0
- package/src/app/lib/components/ui/empty/empty-icon.component.ts +31 -0
- package/src/app/lib/components/ui/empty/empty-title.component.ts +28 -0
- package/src/app/lib/components/ui/empty/empty.component.ts +53 -0
- package/src/app/lib/components/ui/empty/index.ts +6 -0
- package/src/app/lib/components/ui/form/form-context.ts +34 -0
- package/src/app/lib/components/ui/form/form-control.component.ts +137 -0
- package/src/app/lib/components/ui/form/form-description.component.ts +37 -0
- package/src/app/lib/components/ui/form/form-field.component.ts +84 -0
- package/src/app/lib/components/ui/form/form-item.component.ts +42 -0
- package/src/app/lib/components/ui/form/form-label.component.ts +58 -0
- package/src/app/lib/components/ui/form/form-message.component.ts +107 -0
- package/src/app/lib/components/ui/form/form.component.ts +123 -0
- package/src/app/lib/components/ui/form/index.ts +17 -0
- package/src/app/lib/components/ui/hover-card/hover-card-content.component.ts +203 -0
- package/src/app/lib/components/ui/hover-card/hover-card-context.ts +25 -0
- package/src/app/lib/components/ui/hover-card/hover-card-trigger.component.ts +160 -0
- package/src/app/lib/components/ui/hover-card/hover-card.component.ts +147 -0
- package/src/app/lib/components/ui/hover-card/index.ts +13 -0
- package/src/app/lib/components/ui/index.ts +551 -0
- package/src/app/lib/components/ui/input/index.ts +1 -0
- package/src/app/lib/components/ui/input/input.component.ts +165 -0
- package/src/app/lib/components/ui/input-group/index.ts +4 -0
- package/src/app/lib/components/ui/input-group/input-group-addon.component.ts +43 -0
- package/src/app/lib/components/ui/input-group/input-group-input.component.ts +33 -0
- package/src/app/lib/components/ui/input-group/input-group.component.ts +53 -0
- package/src/app/lib/components/ui/input-otp/index.ts +14 -0
- package/src/app/lib/components/ui/input-otp/input-otp-context.ts +31 -0
- package/src/app/lib/components/ui/input-otp/input-otp-group.component.ts +23 -0
- package/src/app/lib/components/ui/input-otp/input-otp-separator.component.ts +31 -0
- package/src/app/lib/components/ui/input-otp/input-otp-slot.component.ts +67 -0
- package/src/app/lib/components/ui/input-otp/input-otp.component.ts +240 -0
- package/src/app/lib/components/ui/kbd/index.ts +3 -0
- package/src/app/lib/components/ui/kbd/kbd-variants.ts +23 -0
- package/src/app/lib/components/ui/kbd/kbd.component.ts +50 -0
- package/src/app/lib/components/ui/label/index.ts +1 -0
- package/src/app/lib/components/ui/label/label.component.ts +139 -0
- package/src/app/lib/components/ui/menubar/index.ts +26 -0
- package/src/app/lib/components/ui/menubar/menubar-checkbox-item.component.ts +66 -0
- package/src/app/lib/components/ui/menubar/menubar-content.component.ts +236 -0
- package/src/app/lib/components/ui/menubar/menubar-context.ts +63 -0
- package/src/app/lib/components/ui/menubar/menubar-item.component.ts +60 -0
- package/src/app/lib/components/ui/menubar/menubar-label.component.ts +30 -0
- package/src/app/lib/components/ui/menubar/menubar-menu.component.ts +40 -0
- package/src/app/lib/components/ui/menubar/menubar-radio-group.component.ts +36 -0
- package/src/app/lib/components/ui/menubar/menubar-radio-item.component.ts +66 -0
- package/src/app/lib/components/ui/menubar/menubar-separator.component.ts +24 -0
- package/src/app/lib/components/ui/menubar/menubar-shortcut.component.ts +23 -0
- package/src/app/lib/components/ui/menubar/menubar-sub-content.component.ts +51 -0
- package/src/app/lib/components/ui/menubar/menubar-sub-trigger.component.ts +50 -0
- package/src/app/lib/components/ui/menubar/menubar-sub.component.ts +29 -0
- package/src/app/lib/components/ui/menubar/menubar-trigger.component.ts +132 -0
- package/src/app/lib/components/ui/menubar/menubar.component.ts +158 -0
- package/src/app/lib/components/ui/native-select/index.ts +6 -0
- package/src/app/lib/components/ui/native-select/native-select-variants.ts +23 -0
- package/src/app/lib/components/ui/native-select/native-select.component.ts +74 -0
- package/src/app/lib/components/ui/navigation-menu/index.ts +21 -0
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-content.component.ts +66 -0
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-context.ts +55 -0
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-indicator.component.ts +28 -0
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-item.component.ts +29 -0
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-link.component.ts +43 -0
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-list.component.ts +26 -0
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-trigger-style.ts +7 -0
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-trigger.component.ts +58 -0
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-viewport.component.ts +26 -0
- package/src/app/lib/components/ui/navigation-menu/navigation-menu.component.ts +149 -0
- package/src/app/lib/components/ui/pagination/index.ts +8 -0
- package/src/app/lib/components/ui/pagination/pagination-content.component.ts +28 -0
- package/src/app/lib/components/ui/pagination/pagination-ellipsis.component.ts +47 -0
- package/src/app/lib/components/ui/pagination/pagination-item.component.ts +28 -0
- package/src/app/lib/components/ui/pagination/pagination-link.component.ts +46 -0
- package/src/app/lib/components/ui/pagination/pagination-next.component.ts +54 -0
- package/src/app/lib/components/ui/pagination/pagination-previous.component.ts +54 -0
- package/src/app/lib/components/ui/pagination/pagination.component.ts +48 -0
- package/src/app/lib/components/ui/popover/index.ts +14 -0
- package/src/app/lib/components/ui/popover/popover-anchor.component.ts +64 -0
- package/src/app/lib/components/ui/popover/popover-content.component.ts +231 -0
- package/src/app/lib/components/ui/popover/popover-context.ts +29 -0
- package/src/app/lib/components/ui/popover/popover-trigger.component.ts +100 -0
- package/src/app/lib/components/ui/popover/popover.component.ts +163 -0
- package/src/app/lib/components/ui/progress/index.ts +6 -0
- package/src/app/lib/components/ui/progress/progress.component.ts +212 -0
- package/src/app/lib/components/ui/radio-group/index.ts +10 -0
- package/src/app/lib/components/ui/radio-group/radio-group-context.ts +38 -0
- package/src/app/lib/components/ui/radio-group/radio-group-item.component.ts +298 -0
- package/src/app/lib/components/ui/radio-group/radio-group.component.ts +275 -0
- package/src/app/lib/components/ui/resizable/index.ts +5 -0
- package/src/app/lib/components/ui/resizable/resizable-context.ts +14 -0
- package/src/app/lib/components/ui/resizable/resizable-handle.component.ts +232 -0
- package/src/app/lib/components/ui/resizable/resizable-panel-group.component.ts +140 -0
- package/src/app/lib/components/ui/resizable/resizable-panel.component.ts +77 -0
- package/src/app/lib/components/ui/scroll-area/index.ts +8 -0
- package/src/app/lib/components/ui/scroll-area/scroll-area.component.ts +126 -0
- package/src/app/lib/components/ui/scroll-area/scroll-bar.component.ts +93 -0
- package/src/app/lib/components/ui/segmented/index.ts +13 -0
- package/src/app/lib/components/ui/segmented/segmented-context.ts +11 -0
- package/src/app/lib/components/ui/segmented/segmented-item.component.ts +72 -0
- package/src/app/lib/components/ui/segmented/segmented-variants.ts +40 -0
- package/src/app/lib/components/ui/segmented/segmented.component.ts +99 -0
- package/src/app/lib/components/ui/select/index.ts +19 -0
- package/src/app/lib/components/ui/select/select-content.component.ts +97 -0
- package/src/app/lib/components/ui/select/select-context.ts +53 -0
- package/src/app/lib/components/ui/select/select-group.component.ts +56 -0
- package/src/app/lib/components/ui/select/select-item.component.ts +163 -0
- package/src/app/lib/components/ui/select/select-label.component.ts +32 -0
- package/src/app/lib/components/ui/select/select-separator.component.ts +34 -0
- package/src/app/lib/components/ui/select/select-trigger.component.ts +164 -0
- package/src/app/lib/components/ui/select/select-value.component.ts +49 -0
- package/src/app/lib/components/ui/select/select.component.ts +263 -0
- package/src/app/lib/components/ui/separator/index.ts +6 -0
- package/src/app/lib/components/ui/separator/separator.component.ts +128 -0
- package/src/app/lib/components/ui/sheet/index.ts +11 -0
- package/src/app/lib/components/ui/sheet/sheet-close.component.ts +32 -0
- package/src/app/lib/components/ui/sheet/sheet-content.component.ts +157 -0
- package/src/app/lib/components/ui/sheet/sheet-context.ts +15 -0
- package/src/app/lib/components/ui/sheet/sheet-description.component.ts +34 -0
- package/src/app/lib/components/ui/sheet/sheet-footer.component.ts +28 -0
- package/src/app/lib/components/ui/sheet/sheet-header.component.ts +28 -0
- package/src/app/lib/components/ui/sheet/sheet-title.component.ts +34 -0
- package/src/app/lib/components/ui/sheet/sheet-trigger.component.ts +38 -0
- package/src/app/lib/components/ui/sheet/sheet-variants.ts +22 -0
- package/src/app/lib/components/ui/sheet/sheet.component.ts +97 -0
- package/src/app/lib/components/ui/sidebar/index.ts +41 -0
- package/src/app/lib/components/ui/sidebar/sidebar-content.component.ts +31 -0
- package/src/app/lib/components/ui/sidebar/sidebar-context.ts +33 -0
- package/src/app/lib/components/ui/sidebar/sidebar-footer.component.ts +28 -0
- package/src/app/lib/components/ui/sidebar/sidebar-group-action.component.ts +33 -0
- package/src/app/lib/components/ui/sidebar/sidebar-group-content.component.ts +28 -0
- package/src/app/lib/components/ui/sidebar/sidebar-group-label.component.ts +32 -0
- package/src/app/lib/components/ui/sidebar/sidebar-group.component.ts +28 -0
- package/src/app/lib/components/ui/sidebar/sidebar-header.component.ts +28 -0
- package/src/app/lib/components/ui/sidebar/sidebar-input.component.ts +31 -0
- package/src/app/lib/components/ui/sidebar/sidebar-inset.component.ts +31 -0
- package/src/app/lib/components/ui/sidebar/sidebar-menu-action.component.ts +56 -0
- package/src/app/lib/components/ui/sidebar/sidebar-menu-badge.component.ts +42 -0
- package/src/app/lib/components/ui/sidebar/sidebar-menu-button.component.ts +64 -0
- package/src/app/lib/components/ui/sidebar/sidebar-menu-item.component.ts +32 -0
- package/src/app/lib/components/ui/sidebar/sidebar-menu-skeleton.component.ts +39 -0
- package/src/app/lib/components/ui/sidebar/sidebar-menu-sub-button.component.ts +59 -0
- package/src/app/lib/components/ui/sidebar/sidebar-menu-sub-item.component.ts +25 -0
- package/src/app/lib/components/ui/sidebar/sidebar-menu-sub.component.ts +32 -0
- package/src/app/lib/components/ui/sidebar/sidebar-menu.component.ts +31 -0
- package/src/app/lib/components/ui/sidebar/sidebar-provider.component.ts +141 -0
- package/src/app/lib/components/ui/sidebar/sidebar-rail.component.ts +47 -0
- package/src/app/lib/components/ui/sidebar/sidebar-route-active.service.ts +124 -0
- package/src/app/lib/components/ui/sidebar/sidebar-separator.component.ts +28 -0
- package/src/app/lib/components/ui/sidebar/sidebar-trigger.component.ts +57 -0
- package/src/app/lib/components/ui/sidebar/sidebar.component.ts +130 -0
- package/src/app/lib/components/ui/skeleton/index.ts +1 -0
- package/src/app/lib/components/ui/skeleton/skeleton.component.ts +52 -0
- package/src/app/lib/components/ui/slider/index.ts +6 -0
- package/src/app/lib/components/ui/slider/slider.component.ts +477 -0
- package/src/app/lib/components/ui/spinner/index.ts +3 -0
- package/src/app/lib/components/ui/spinner/spinner-variants.ts +32 -0
- package/src/app/lib/components/ui/spinner/spinner.component.ts +77 -0
- package/src/app/lib/components/ui/switch/index.ts +6 -0
- package/src/app/lib/components/ui/switch/switch.component.ts +282 -0
- package/src/app/lib/components/ui/table/index.ts +9 -0
- package/src/app/lib/components/ui/table/table-body.component.ts +28 -0
- package/src/app/lib/components/ui/table/table-caption.component.ts +28 -0
- package/src/app/lib/components/ui/table/table-cell.component.ts +31 -0
- package/src/app/lib/components/ui/table/table-footer.component.ts +28 -0
- package/src/app/lib/components/ui/table/table-head.component.ts +36 -0
- package/src/app/lib/components/ui/table/table-header.component.ts +28 -0
- package/src/app/lib/components/ui/table/table-row.component.ts +34 -0
- package/src/app/lib/components/ui/table/table.component.ts +52 -0
- package/src/app/lib/components/ui/tabs/index.ts +14 -0
- package/src/app/lib/components/ui/tabs/tabs-content.component.ts +132 -0
- package/src/app/lib/components/ui/tabs/tabs-context.ts +33 -0
- package/src/app/lib/components/ui/tabs/tabs-list.component.ts +228 -0
- package/src/app/lib/components/ui/tabs/tabs-trigger.component.ts +167 -0
- package/src/app/lib/components/ui/tabs/tabs.component.ts +203 -0
- package/src/app/lib/components/ui/textarea/index.ts +1 -0
- package/src/app/lib/components/ui/textarea/textarea.component.ts +44 -0
- package/src/app/lib/components/ui/toast/index.ts +16 -0
- package/src/app/lib/components/ui/toast/toast-action.component.ts +77 -0
- package/src/app/lib/components/ui/toast/toast-description.component.ts +52 -0
- package/src/app/lib/components/ui/toast/toast-title.component.ts +52 -0
- package/src/app/lib/components/ui/toast/toast-variants.ts +24 -0
- package/src/app/lib/components/ui/toast/toast.component.ts +177 -0
- package/src/app/lib/components/ui/toast/toast.service.ts +202 -0
- package/src/app/lib/components/ui/toast/toaster.component.ts +128 -0
- package/src/app/lib/components/ui/toggle/index.ts +6 -0
- package/src/app/lib/components/ui/toggle/toggle-variants.ts +30 -0
- package/src/app/lib/components/ui/toggle/toggle.component.ts +199 -0
- package/src/app/lib/components/ui/toggle-group/index.ts +11 -0
- package/src/app/lib/components/ui/toggle-group/toggle-group-context.ts +48 -0
- package/src/app/lib/components/ui/toggle-group/toggle-group-item.component.ts +241 -0
- package/src/app/lib/components/ui/toggle-group/toggle-group.component.ts +288 -0
- package/src/app/lib/components/ui/tooltip/index.ts +14 -0
- package/src/app/lib/components/ui/tooltip/tooltip-content.component.ts +154 -0
- package/src/app/lib/components/ui/tooltip/tooltip-context.ts +29 -0
- package/src/app/lib/components/ui/tooltip/tooltip-provider.component.ts +95 -0
- package/src/app/lib/components/ui/tooltip/tooltip-trigger.component.ts +138 -0
- package/src/app/lib/components/ui/tooltip/tooltip.component.ts +159 -0
- package/src/app/lib/components/ui/typography/index.ts +13 -0
- package/src/app/lib/components/ui/typography/typography-blockquote.component.ts +31 -0
- package/src/app/lib/components/ui/typography/typography-h1.component.ts +32 -0
- package/src/app/lib/components/ui/typography/typography-h2.component.ts +32 -0
- package/src/app/lib/components/ui/typography/typography-h3.component.ts +29 -0
- package/src/app/lib/components/ui/typography/typography-h4.component.ts +29 -0
- package/src/app/lib/components/ui/typography/typography-inline-code.component.ts +31 -0
- package/src/app/lib/components/ui/typography/typography-large.component.ts +28 -0
- package/src/app/lib/components/ui/typography/typography-lead.component.ts +31 -0
- package/src/app/lib/components/ui/typography/typography-list.component.ts +31 -0
- package/src/app/lib/components/ui/typography/typography-muted.component.ts +28 -0
- package/src/app/lib/components/ui/typography/typography-p.component.ts +29 -0
- package/src/app/lib/components/ui/typography/typography-small.component.ts +28 -0
- package/src/app/lib/index.ts +7 -0
- package/src/app/lib/utils/accessibility/aria-id.service.ts +118 -0
- package/src/app/lib/utils/accessibility/click-outside.directive.ts +85 -0
- package/src/app/lib/utils/accessibility/focus-management.service.ts +231 -0
- package/src/app/lib/utils/accessibility/focus-trap.directive.ts +203 -0
- package/src/app/lib/utils/accessibility/index.ts +23 -0
- package/src/app/lib/utils/accessibility/keyboard-navigation.directive.ts +440 -0
- package/src/app/lib/utils/accessibility/live-region.directive.ts +260 -0
- package/src/app/lib/utils/accessibility/touch-target.directive.ts +81 -0
- package/src/app/lib/utils/accessibility/visually-hidden.component.ts +79 -0
- package/src/app/lib/utils/animation/animated.directive.ts +191 -0
- package/src/app/lib/utils/animation/animation-tokens.service.ts +88 -0
- package/src/app/lib/utils/animation/animation.types.ts +55 -0
- package/src/app/lib/utils/animation/animation.utils.ts +158 -0
- package/src/app/lib/utils/animation/index.ts +17 -0
- package/src/app/lib/utils/animation/presence.component.ts +168 -0
- package/src/app/lib/utils/animation/presence.directive.ts +169 -0
- package/src/app/lib/utils/cn.ts +15 -0
- package/src/app/lib/utils/index.ts +11 -0
- package/src/app/lib/utils/positioning/index.ts +218 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { InjectionToken, WritableSignal } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
// ============================================================================
|
|
4
|
+
// Types
|
|
5
|
+
// ============================================================================
|
|
6
|
+
|
|
7
|
+
export type TooltipSide = 'top' | 'right' | 'bottom' | 'left';
|
|
8
|
+
export type TooltipAlign = 'start' | 'center' | 'end';
|
|
9
|
+
|
|
10
|
+
export interface TooltipContextValue {
|
|
11
|
+
/** Signal for open state */
|
|
12
|
+
open: WritableSignal<boolean>;
|
|
13
|
+
/** Set open state */
|
|
14
|
+
setOpen: (open: boolean) => void;
|
|
15
|
+
/** Delay before showing tooltip (ms) */
|
|
16
|
+
delayDuration: number;
|
|
17
|
+
/** Skip delay duration when quickly hovering between tooltips (ms) */
|
|
18
|
+
skipDelayDuration: number;
|
|
19
|
+
/** Unique ID for aria-describedby relationship */
|
|
20
|
+
tooltipId: string;
|
|
21
|
+
/** Whether hoverable content is disabled */
|
|
22
|
+
disableHoverableContent: () => boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// ============================================================================
|
|
26
|
+
// Injection Tokens
|
|
27
|
+
// ============================================================================
|
|
28
|
+
|
|
29
|
+
export const TOOLTIP_CONTEXT = new InjectionToken<TooltipContextValue>('TOOLTIP_CONTEXT');
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
forwardRef,
|
|
5
|
+
input,
|
|
6
|
+
signal,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
import { TOOLTIP_CONTEXT, type TooltipContextValue } from './tooltip-context';
|
|
9
|
+
|
|
10
|
+
let tooltipIdCounter = 0;
|
|
11
|
+
|
|
12
|
+
// ============================================================================
|
|
13
|
+
// Types
|
|
14
|
+
// ============================================================================
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Props for the TooltipProvider component
|
|
18
|
+
*/
|
|
19
|
+
export interface TooltipProviderProps {
|
|
20
|
+
/** The duration from when the pointer enters the trigger until the tooltip opens.
|
|
21
|
+
* @default 700 */
|
|
22
|
+
delayDuration?: number;
|
|
23
|
+
/** How much time a user has to enter another trigger without incurring a delay again.
|
|
24
|
+
* @default 300 */
|
|
25
|
+
skipDelayDuration?: number;
|
|
26
|
+
/** When true, trying to hover the content will result in the tooltip closing.
|
|
27
|
+
* @default false */
|
|
28
|
+
disableHoverableContent?: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// ============================================================================
|
|
32
|
+
// Component
|
|
33
|
+
// ============================================================================
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @component TooltipProvider
|
|
37
|
+
*
|
|
38
|
+
* Wraps your app to provide global tooltip behavior configuration.
|
|
39
|
+
*
|
|
40
|
+
* @description
|
|
41
|
+
* TooltipProvider allows you to configure shared tooltip behavior for all
|
|
42
|
+
* tooltips in your application. Place it near the root of your app.
|
|
43
|
+
*
|
|
44
|
+
* ## Features
|
|
45
|
+
* - Shared delay duration for all tooltips
|
|
46
|
+
* - Skip delay when rapidly moving between tooltips
|
|
47
|
+
* - Control hoverable content behavior
|
|
48
|
+
*
|
|
49
|
+
* @example Basic usage
|
|
50
|
+
* ```html
|
|
51
|
+
* <TooltipProvider>
|
|
52
|
+
* <Tooltip>
|
|
53
|
+
* <TooltipTrigger>Hover me</TooltipTrigger>
|
|
54
|
+
* <TooltipContent>Tooltip content</TooltipContent>
|
|
55
|
+
* </Tooltip>
|
|
56
|
+
* </TooltipProvider>
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @example Custom delays
|
|
60
|
+
* ```html
|
|
61
|
+
* <TooltipProvider [delayDuration]="400" [skipDelayDuration]="200">
|
|
62
|
+
* <!-- Tooltips will use these delays -->
|
|
63
|
+
* </TooltipProvider>
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
@Component({
|
|
67
|
+
selector: 'TooltipProvider',
|
|
68
|
+
template: `<ng-content />`,
|
|
69
|
+
providers: [
|
|
70
|
+
{
|
|
71
|
+
provide: TOOLTIP_CONTEXT,
|
|
72
|
+
useExisting: forwardRef(() => TooltipProvider),
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
76
|
+
})
|
|
77
|
+
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
|
+
/** When true, trying to hover the content will result in the tooltip closing */
|
|
88
|
+
readonly disableHoverableContent = input<boolean>(false);
|
|
89
|
+
|
|
90
|
+
readonly open = signal(false);
|
|
91
|
+
|
|
92
|
+
setOpen(open: boolean): void {
|
|
93
|
+
this.open.set(open);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
inject,
|
|
5
|
+
input,
|
|
6
|
+
OnDestroy,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
import { TOOLTIP_CONTEXT } from './tooltip-context';
|
|
9
|
+
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// Types
|
|
12
|
+
// ============================================================================
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Props for the TooltipTrigger component
|
|
16
|
+
*/
|
|
17
|
+
export interface TooltipTriggerProps {
|
|
18
|
+
/** Change the default rendered element for the one passed as a child.
|
|
19
|
+
* @default false */
|
|
20
|
+
asChild?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// ============================================================================
|
|
24
|
+
// Component
|
|
25
|
+
// ============================================================================
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @component TooltipTrigger
|
|
29
|
+
*
|
|
30
|
+
* The element that triggers the tooltip when hovered or focused.
|
|
31
|
+
*
|
|
32
|
+
* @description
|
|
33
|
+
* TooltipTrigger wraps the element that activates the tooltip. It handles
|
|
34
|
+
* mouse and keyboard events to show/hide the tooltip.
|
|
35
|
+
*
|
|
36
|
+
* ## Features
|
|
37
|
+
* - Shows tooltip on hover with configurable delay
|
|
38
|
+
* - Shows tooltip on focus for keyboard users
|
|
39
|
+
* - Dismissible via Escape key (WCAG 1.4.13)
|
|
40
|
+
* - Supports custom trigger elements via content projection
|
|
41
|
+
*
|
|
42
|
+
* ## Accessibility
|
|
43
|
+
* - `aria-describedby` points to tooltip content when open
|
|
44
|
+
* - Escape key dismisses tooltip (WCAG 1.4.13 compliance)
|
|
45
|
+
* - Focus triggers tooltip for keyboard users
|
|
46
|
+
*
|
|
47
|
+
* ## Keyboard Navigation
|
|
48
|
+
* - `Escape` - Dismiss the tooltip
|
|
49
|
+
* - `Tab` - Focus triggers tooltip to show
|
|
50
|
+
*
|
|
51
|
+
* @example Basic usage
|
|
52
|
+
* ```html
|
|
53
|
+
* <TooltipTrigger>
|
|
54
|
+
* <button>Hover me</button>
|
|
55
|
+
* </TooltipTrigger>
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @example With icon button
|
|
59
|
+
* ```html
|
|
60
|
+
* <TooltipTrigger>
|
|
61
|
+
* <button class="icon-button">
|
|
62
|
+
* <HelpIcon />
|
|
63
|
+
* </button>
|
|
64
|
+
* </TooltipTrigger>
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
@Component({
|
|
68
|
+
selector: 'TooltipTrigger',
|
|
69
|
+
template: `<ng-content />`,
|
|
70
|
+
host: {
|
|
71
|
+
'(mouseenter)': 'onMouseEnter()',
|
|
72
|
+
'(mouseleave)': 'onMouseLeave()',
|
|
73
|
+
'(focus)': 'onFocus()',
|
|
74
|
+
'(blur)': 'onBlur()',
|
|
75
|
+
'(keydown.escape)': 'onEscape()',
|
|
76
|
+
'[attr.aria-describedby]': 'context.open() ? context.tooltipId : null',
|
|
77
|
+
'[attr.data-state]': 'context.open() ? "open" : "closed"',
|
|
78
|
+
},
|
|
79
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
80
|
+
})
|
|
81
|
+
export class TooltipTrigger implements OnDestroy {
|
|
82
|
+
protected readonly context = inject(TOOLTIP_CONTEXT);
|
|
83
|
+
|
|
84
|
+
/** Change the default rendered element for the one passed as a child */
|
|
85
|
+
readonly asChild = input<boolean>(false);
|
|
86
|
+
|
|
87
|
+
private showTimeout: ReturnType<typeof setTimeout> | null = null;
|
|
88
|
+
private hideTimeout: ReturnType<typeof setTimeout> | null = null;
|
|
89
|
+
|
|
90
|
+
ngOnDestroy(): void {
|
|
91
|
+
this.clearTimeouts();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
onMouseEnter(): void {
|
|
95
|
+
this.clearTimeouts();
|
|
96
|
+
this.showTimeout = setTimeout(() => {
|
|
97
|
+
this.context.setOpen(true);
|
|
98
|
+
}, this.context.delayDuration);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
onMouseLeave(): void {
|
|
102
|
+
this.clearTimeouts();
|
|
103
|
+
// Small delay to allow moving to tooltip content
|
|
104
|
+
this.hideTimeout = setTimeout(() => {
|
|
105
|
+
this.context.setOpen(false);
|
|
106
|
+
}, 100);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
onFocus(): void {
|
|
110
|
+
// Show immediately on focus for keyboard users
|
|
111
|
+
this.context.setOpen(true);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
onBlur(): void {
|
|
115
|
+
this.context.setOpen(false);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Escape key handler for WCAG 1.4.13 compliance.
|
|
120
|
+
* Content on hover/focus must be dismissible via Escape.
|
|
121
|
+
*/
|
|
122
|
+
onEscape(): void {
|
|
123
|
+
if (this.context.open()) {
|
|
124
|
+
this.context.setOpen(false);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
private clearTimeouts(): void {
|
|
129
|
+
if (this.showTimeout) {
|
|
130
|
+
clearTimeout(this.showTimeout);
|
|
131
|
+
this.showTimeout = null;
|
|
132
|
+
}
|
|
133
|
+
if (this.hideTimeout) {
|
|
134
|
+
clearTimeout(this.hideTimeout);
|
|
135
|
+
this.hideTimeout = null;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
forwardRef,
|
|
5
|
+
input,
|
|
6
|
+
output,
|
|
7
|
+
signal,
|
|
8
|
+
} from '@angular/core';
|
|
9
|
+
import { TOOLTIP_CONTEXT, type TooltipContextValue } from './tooltip-context';
|
|
10
|
+
|
|
11
|
+
let tooltipIdCounter = 0;
|
|
12
|
+
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// Types
|
|
15
|
+
// ============================================================================
|
|
16
|
+
|
|
17
|
+
export type TooltipState = 'open' | 'closed';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Props for the Tooltip component
|
|
21
|
+
*/
|
|
22
|
+
export interface TooltipProps {
|
|
23
|
+
/** The open state of the tooltip when initially rendered.
|
|
24
|
+
* Use when you do not need to control its open state.
|
|
25
|
+
* @default false */
|
|
26
|
+
defaultOpen?: boolean;
|
|
27
|
+
/** The controlled open state of the tooltip.
|
|
28
|
+
* Must be used in conjunction with onOpenChange. */
|
|
29
|
+
open?: boolean;
|
|
30
|
+
/** The duration from when the pointer enters the trigger until the tooltip opens.
|
|
31
|
+
* @default 700 */
|
|
32
|
+
delayDuration?: number;
|
|
33
|
+
/** How much time a user has to enter another trigger without incurring a delay again.
|
|
34
|
+
* @default 300 */
|
|
35
|
+
skipDelayDuration?: number;
|
|
36
|
+
/** When true, clicking on trigger will not close the tooltip.
|
|
37
|
+
* @default false */
|
|
38
|
+
disableHoverableContent?: boolean;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// ============================================================================
|
|
42
|
+
// Component
|
|
43
|
+
// ============================================================================
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @component Tooltip
|
|
47
|
+
*
|
|
48
|
+
* A popup that displays information related to an element when the element
|
|
49
|
+
* receives keyboard focus or the mouse hovers over it.
|
|
50
|
+
*
|
|
51
|
+
* @description
|
|
52
|
+
* Tooltip wraps the trigger and content and manages the open/closed state.
|
|
53
|
+
* It provides context for child components to coordinate behavior.
|
|
54
|
+
*
|
|
55
|
+
* ## Features
|
|
56
|
+
* - Shows on hover and focus
|
|
57
|
+
* - Supports controlled and uncontrolled state
|
|
58
|
+
* - Configurable open delay
|
|
59
|
+
* - Skip delay for rapid hover between tooltips
|
|
60
|
+
* - Keyboard support (Escape to dismiss)
|
|
61
|
+
* - ARIA compliant
|
|
62
|
+
*
|
|
63
|
+
* ## Accessibility
|
|
64
|
+
* Implements WCAG 2.1 Content on Hover or Focus (1.4.13):
|
|
65
|
+
* - Dismissible: Can be dismissed with Escape key
|
|
66
|
+
* - Hoverable: Content can be hovered without disappearing
|
|
67
|
+
* - Persistent: Remains visible until user dismisses
|
|
68
|
+
*
|
|
69
|
+
* ## Keyboard Navigation
|
|
70
|
+
* - `Escape` - Dismiss the tooltip
|
|
71
|
+
*
|
|
72
|
+
* @example Basic usage
|
|
73
|
+
* ```html
|
|
74
|
+
* <Tooltip>
|
|
75
|
+
* <TooltipTrigger>
|
|
76
|
+
* <button>Hover me</button>
|
|
77
|
+
* </TooltipTrigger>
|
|
78
|
+
* <TooltipContent>
|
|
79
|
+
* <p>Tooltip content</p>
|
|
80
|
+
* </TooltipContent>
|
|
81
|
+
* </Tooltip>
|
|
82
|
+
* ```
|
|
83
|
+
*
|
|
84
|
+
* @example With custom delay
|
|
85
|
+
* ```html
|
|
86
|
+
* <Tooltip [delayDuration]="0">
|
|
87
|
+
* <TooltipTrigger>Instant tooltip</TooltipTrigger>
|
|
88
|
+
* <TooltipContent>Shows immediately</TooltipContent>
|
|
89
|
+
* </Tooltip>
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* @example Controlled
|
|
93
|
+
* ```html
|
|
94
|
+
* <Tooltip [open]="isOpen" (openChange)="isOpen = $event">
|
|
95
|
+
* <TooltipTrigger>Controlled tooltip</TooltipTrigger>
|
|
96
|
+
* <TooltipContent>Controlled content</TooltipContent>
|
|
97
|
+
* </Tooltip>
|
|
98
|
+
* ```
|
|
99
|
+
*
|
|
100
|
+
* @data-attributes
|
|
101
|
+
* - `data-state` - 'open' | 'closed' (on content)
|
|
102
|
+
*/
|
|
103
|
+
@Component({
|
|
104
|
+
selector: 'Tooltip',
|
|
105
|
+
template: `<ng-content />`,
|
|
106
|
+
host: {
|
|
107
|
+
class: 'relative inline-block',
|
|
108
|
+
},
|
|
109
|
+
providers: [
|
|
110
|
+
{
|
|
111
|
+
provide: TOOLTIP_CONTEXT,
|
|
112
|
+
useExisting: forwardRef(() => Tooltip),
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
116
|
+
})
|
|
117
|
+
export class Tooltip implements TooltipContextValue {
|
|
118
|
+
/** The open state of the tooltip when initially rendered */
|
|
119
|
+
readonly defaultOpen = input<boolean>(false);
|
|
120
|
+
|
|
121
|
+
/** The controlled open state of the tooltip */
|
|
122
|
+
readonly controlledOpen = input<boolean | undefined>(undefined, { alias: 'open' });
|
|
123
|
+
|
|
124
|
+
/** The duration from when the pointer enters the trigger until the tooltip opens */
|
|
125
|
+
readonly delayDuration = 700;
|
|
126
|
+
|
|
127
|
+
/** How much time a user has to enter another trigger without incurring a delay again */
|
|
128
|
+
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
|
+
/** Unique ID for aria-describedby relationship */
|
|
137
|
+
readonly tooltipId = `tooltip-${++tooltipIdCounter}`;
|
|
138
|
+
|
|
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
|
+
setOpen(open: boolean): void {
|
|
149
|
+
const controlled = this.controlledOpen();
|
|
150
|
+
if (controlled === undefined) {
|
|
151
|
+
this.open.set(open);
|
|
152
|
+
}
|
|
153
|
+
this.openChange.emit(open);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
isOpen(): boolean {
|
|
157
|
+
return this.controlledOpen() !== undefined ? this.controlledOpen()! : this.open();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { TypographyBlockquote } from './typography-blockquote.component';
|
|
2
|
+
export { TypographyH1 } from './typography-h1.component';
|
|
3
|
+
export { TypographyH2 } from './typography-h2.component';
|
|
4
|
+
export { TypographyH3 } from './typography-h3.component';
|
|
5
|
+
export { TypographyH4 } from './typography-h4.component';
|
|
6
|
+
export { TypographyInlineCode } from './typography-inline-code.component';
|
|
7
|
+
export { TypographyLarge } from './typography-large.component';
|
|
8
|
+
export { TypographyLead } from './typography-lead.component';
|
|
9
|
+
export { TypographyList } from './typography-list.component';
|
|
10
|
+
export { TypographyMuted } from './typography-muted.component';
|
|
11
|
+
export { TypographyP } from './typography-p.component';
|
|
12
|
+
export { TypographySmall } from './typography-small.component';
|
|
13
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
input,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Typography Blockquote component
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <TypographyBlockquote>
|
|
14
|
+
* "This is a quote from someone important."
|
|
15
|
+
* </TypographyBlockquote>
|
|
16
|
+
*/
|
|
17
|
+
@Component({
|
|
18
|
+
selector: 'TypographyBlockquote',
|
|
19
|
+
template: `<ng-content />`,
|
|
20
|
+
host: {
|
|
21
|
+
'[class]': 'computedClass()',
|
|
22
|
+
style: 'display: block',
|
|
23
|
+
},
|
|
24
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
25
|
+
})
|
|
26
|
+
export class TypographyBlockquote {
|
|
27
|
+
readonly class = input<string>('');
|
|
28
|
+
protected readonly computedClass = computed(() =>
|
|
29
|
+
cn('mt-6 border-l-2 pl-6 italic', this.class())
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
input,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Typography H1 component
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <TypographyH1>Heading 1</TypographyH1>
|
|
14
|
+
*/
|
|
15
|
+
@Component({
|
|
16
|
+
selector: 'TypographyH1',
|
|
17
|
+
template: `<ng-content />`,
|
|
18
|
+
host: {
|
|
19
|
+
'[class]': 'computedClass()',
|
|
20
|
+
style: 'display: block',
|
|
21
|
+
},
|
|
22
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
23
|
+
})
|
|
24
|
+
export class TypographyH1 {
|
|
25
|
+
readonly class = input<string>('');
|
|
26
|
+
protected readonly computedClass = computed(() =>
|
|
27
|
+
cn(
|
|
28
|
+
'scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl',
|
|
29
|
+
this.class()
|
|
30
|
+
)
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
input,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Typography H2 component
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <TypographyH2>Heading 2</TypographyH2>
|
|
14
|
+
*/
|
|
15
|
+
@Component({
|
|
16
|
+
selector: 'TypographyH2',
|
|
17
|
+
template: `<ng-content />`,
|
|
18
|
+
host: {
|
|
19
|
+
'[class]': 'computedClass()',
|
|
20
|
+
style: 'display: block',
|
|
21
|
+
},
|
|
22
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
23
|
+
})
|
|
24
|
+
export class TypographyH2 {
|
|
25
|
+
readonly class = input<string>('');
|
|
26
|
+
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
|
+
)
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
input,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Typography H3 component
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <TypographyH3>Heading 3</TypographyH3>
|
|
14
|
+
*/
|
|
15
|
+
@Component({
|
|
16
|
+
selector: 'TypographyH3',
|
|
17
|
+
template: `<ng-content />`,
|
|
18
|
+
host: {
|
|
19
|
+
'[class]': 'computedClass()',
|
|
20
|
+
style: 'display: block',
|
|
21
|
+
},
|
|
22
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
23
|
+
})
|
|
24
|
+
export class TypographyH3 {
|
|
25
|
+
readonly class = input<string>('');
|
|
26
|
+
protected readonly computedClass = computed(() =>
|
|
27
|
+
cn('scroll-m-20 text-2xl font-semibold tracking-tight', this.class())
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
input,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Typography H4 component
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <TypographyH4>Heading 4</TypographyH4>
|
|
14
|
+
*/
|
|
15
|
+
@Component({
|
|
16
|
+
selector: 'TypographyH4',
|
|
17
|
+
template: `<ng-content />`,
|
|
18
|
+
host: {
|
|
19
|
+
'[class]': 'computedClass()',
|
|
20
|
+
style: 'display: block',
|
|
21
|
+
},
|
|
22
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
23
|
+
})
|
|
24
|
+
export class TypographyH4 {
|
|
25
|
+
readonly class = input<string>('');
|
|
26
|
+
protected readonly computedClass = computed(() =>
|
|
27
|
+
cn('scroll-m-20 text-xl font-semibold tracking-tight', this.class())
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
input,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Typography InlineCode component
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <TypographyInlineCode>npm install</TypographyInlineCode>
|
|
14
|
+
*/
|
|
15
|
+
@Component({
|
|
16
|
+
selector: 'TypographyInlineCode',
|
|
17
|
+
template: `<ng-content />`,
|
|
18
|
+
host: {
|
|
19
|
+
'[class]': 'computedClass()',
|
|
20
|
+
},
|
|
21
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
22
|
+
})
|
|
23
|
+
export class TypographyInlineCode {
|
|
24
|
+
readonly class = input<string>('');
|
|
25
|
+
protected readonly computedClass = computed(() =>
|
|
26
|
+
cn(
|
|
27
|
+
'relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold',
|
|
28
|
+
this.class()
|
|
29
|
+
)
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
input,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Typography Large component
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <TypographyLarge>Large text</TypographyLarge>
|
|
14
|
+
*/
|
|
15
|
+
@Component({
|
|
16
|
+
selector: 'TypographyLarge',
|
|
17
|
+
template: `<ng-content />`,
|
|
18
|
+
host: {
|
|
19
|
+
'[class]': 'computedClass()',
|
|
20
|
+
},
|
|
21
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
22
|
+
})
|
|
23
|
+
export class TypographyLarge {
|
|
24
|
+
readonly class = input<string>('');
|
|
25
|
+
protected readonly computedClass = computed(() =>
|
|
26
|
+
cn('text-lg font-semibold', this.class())
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils';
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
input,
|
|
7
|
+
} from '@angular/core';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Typography Lead component - larger intro text
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <TypographyLead>
|
|
14
|
+
* A modal dialog that interrupts the user with important content.
|
|
15
|
+
* </TypographyLead>
|
|
16
|
+
*/
|
|
17
|
+
@Component({
|
|
18
|
+
selector: 'TypographyLead',
|
|
19
|
+
template: `<ng-content />`,
|
|
20
|
+
host: {
|
|
21
|
+
'[class]': 'computedClass()',
|
|
22
|
+
style: 'display: block',
|
|
23
|
+
},
|
|
24
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
25
|
+
})
|
|
26
|
+
export class TypographyLead {
|
|
27
|
+
readonly class = input<string>('');
|
|
28
|
+
protected readonly computedClass = computed(() =>
|
|
29
|
+
cn('text-xl text-muted-foreground', this.class())
|
|
30
|
+
);
|
|
31
|
+
}
|