@egose/shadcn-theme-ng-tw 0.0.28 → 0.2.0
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/README.md +130 -13
- package/accordion/README.md +376 -34
- package/accordion/fesm2022/accordion.mjs +20 -20
- package/alert/README.md +343 -34
- package/alert/fesm2022/alert.mjs +18 -18
- package/alert-dialog/README.md +471 -5
- package/alert-dialog/fesm2022/alert-dialog.mjs +48 -48
- package/alert-dialog/types/alert-dialog.d.ts +1 -1
- package/aspect-ratio/README.md +272 -5
- package/aspect-ratio/fesm2022/aspect-ratio.mjs +9 -9
- package/autocomplete/README.md +473 -34
- package/autocomplete/fesm2022/autocomplete.mjs +54 -54
- package/autocomplete/types/autocomplete.d.ts +1 -1
- package/avatar/README.md +357 -5
- package/avatar/fesm2022/avatar.mjs +32 -32
- package/badge/README.md +289 -34
- package/badge/fesm2022/badge.mjs +4 -4
- package/basic-alert/README.md +324 -34
- package/basic-alert/fesm2022/basic-alert.mjs +4 -4
- package/basic-alert/types/basic-alert.d.ts +1 -1
- package/breadcrumb/README.md +406 -5
- package/breadcrumb/fesm2022/breadcrumb.mjs +34 -34
- package/button/README.md +453 -34
- package/button/fesm2022/button.mjs +96 -118
- package/button/types/button.d.ts +7 -10
- package/button-group/README.md +318 -5
- package/button-group/fesm2022/button-group.mjs +20 -20
- package/calendar/README.md +328 -34
- package/calendar/fesm2022/calendar.mjs +154 -154
- package/card/README.md +331 -5
- package/card/fesm2022/card.mjs +33 -33
- package/carousel/README.md +333 -5
- package/carousel/fesm2022/carousel.mjs +47 -44
- package/carousel/types/carousel.d.ts +1 -1
- package/checkbox/README.md +291 -34
- package/checkbox/fesm2022/checkbox.mjs +22 -20
- package/checkbox/types/checkbox.d.ts +5 -4
- package/collapsible/README.md +332 -5
- package/collapsible/fesm2022/collapsible.mjs +15 -15
- package/combobox/README.md +507 -5
- package/combobox/fesm2022/combobox.mjs +95 -92
- package/combobox/types/combobox.d.ts +1 -1
- package/command/README.md +435 -5
- package/command/fesm2022/command.mjs +56 -56
- package/confirmation-dialog/README.md +272 -34
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs +13 -12
- package/confirmation-dialog/types/confirmation-dialog.d.ts +9 -5
- package/context-menu/README.md +366 -5
- package/context-menu/fesm2022/context-menu.mjs +9 -9
- package/date-picker/README.md +436 -34
- package/date-picker/fesm2022/date-picker.mjs +79 -68
- package/date-picker/types/date-picker.d.ts +8 -4
- package/dialog/README.md +419 -34
- package/dialog/fesm2022/dialog.mjs +48 -48
- package/drawer/README.md +395 -5
- package/drawer/fesm2022/drawer.mjs +45 -45
- package/dropdown-menu/README.md +417 -5
- package/dropdown-menu/fesm2022/dropdown-menu.mjs +85 -73
- package/dropdown-menu/types/dropdown-menu.d.ts +4 -0
- package/empty/README.md +329 -5
- package/empty/fesm2022/empty.mjs +31 -31
- package/field/README.md +385 -5
- package/field/fesm2022/field.mjs +59 -59
- package/field/types/field.d.ts +1 -1
- package/form-checkbox/README.md +283 -34
- package/form-checkbox/fesm2022/form-checkbox.mjs +37 -19
- package/form-checkbox/types/form-checkbox.d.ts +7 -1
- package/form-date-picker/README.md +293 -34
- package/form-date-picker/fesm2022/form-date-picker.mjs +59 -24
- package/form-date-picker/types/form-date-picker.d.ts +7 -1
- package/form-field/README.md +327 -34
- package/form-field/fesm2022/form-field.mjs +30 -16
- package/form-field/types/form-field.d.ts +28 -20
- package/form-field-simple/README.md +311 -34
- package/form-field-simple/fesm2022/form-field-simple.mjs +4 -4
- package/form-searchable-multiselect/README.md +332 -34
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +41 -21
- package/form-searchable-multiselect/types/form-searchable-multiselect.d.ts +8 -2
- package/form-select/README.md +321 -34
- package/form-select/fesm2022/form-select.mjs +62 -29
- package/form-select/types/form-select.d.ts +7 -1
- package/form-text-input/README.md +342 -34
- package/form-text-input/fesm2022/form-text-input.mjs +43 -55
- package/form-text-input/types/form-text-input.d.ts +9 -12
- package/form-textarea/README.md +318 -34
- package/form-textarea/fesm2022/form-textarea.mjs +42 -23
- package/form-textarea/types/form-textarea.d.ts +8 -1
- package/hover-card/README.md +256 -5
- package/hover-card/fesm2022/hover-card.mjs +19 -19
- package/icon/README.md +210 -34
- package/icon/fesm2022/icon.mjs +8 -8
- package/input/README.md +240 -34
- package/input/fesm2022/input.mjs +17 -12
- package/input/types/input.d.ts +2 -1
- package/input-group/README.md +335 -5
- package/input-group/fesm2022/input-group.mjs +37 -37
- package/input-group/types/input-group.d.ts +3 -3
- package/input-otp/README.md +375 -5
- package/input-otp/fesm2022/input-otp.mjs +27 -27
- package/item/README.md +385 -5
- package/item/fesm2022/item.mjs +54 -54
- package/kbd/README.md +291 -5
- package/kbd/fesm2022/kbd.mjs +13 -13
- package/label/README.md +243 -34
- package/label/fesm2022/label.mjs +9 -9
- package/label/types/label.d.ts +1 -1
- package/layout-simple/README.md +174 -44
- package/layout-simple/fesm2022/layout-simple.mjs +917 -398
- package/layout-simple/types/layout-simple.d.ts +180 -129
- package/menu/README.md +418 -0
- package/menu/fesm2022/menu.mjs +461 -0
- package/menu/package.json +24 -0
- package/menu/types/menu.d.ts +137 -0
- package/menubar/README.md +343 -5
- package/menubar/fesm2022/menubar.mjs +13 -13
- package/native-select/README.md +323 -5
- package/native-select/fesm2022/native-select.mjs +19 -19
- package/navigation-menu/README.md +369 -5
- package/navigation-menu/fesm2022/navigation-menu.mjs +37 -37
- package/package.json +183 -154
- package/pagination/README.md +388 -5
- package/pagination/fesm2022/pagination.mjs +63 -63
- package/popover/README.md +302 -34
- package/popover/fesm2022/popover.mjs +30 -30
- package/progress/README.md +311 -5
- package/progress/fesm2022/progress.mjs +13 -13
- package/radio-group/README.md +335 -34
- package/radio-group/fesm2022/radio-group.mjs +26 -19
- package/resizable/README.md +269 -5
- package/resizable/fesm2022/resizable.mjs +19 -19
- package/scroll-area/README.md +233 -5
- package/scroll-area/fesm2022/scroll-area.mjs +9 -9
- package/searchable-multiselect/README.md +294 -34
- package/searchable-multiselect/fesm2022/searchable-multiselect.mjs +63 -16
- package/searchable-multiselect/types/searchable-multiselect.d.ts +8 -2
- package/select/README.md +408 -34
- package/select/fesm2022/select.mjs +80 -72
- package/select/types/select.d.ts +3 -1
- package/separator/README.md +193 -34
- package/separator/fesm2022/separator.mjs +9 -9
- package/separator/types/separator.d.ts +1 -1
- package/sheet/README.md +282 -34
- package/sheet/fesm2022/sheet.mjs +30 -30
- package/sidebar/README.md +457 -5
- package/sidebar/fesm2022/sidebar.mjs +136 -134
- package/sidebar/types/sidebar.d.ts +3 -3
- package/skeleton/README.md +217 -5
- package/skeleton/fesm2022/skeleton.mjs +9 -9
- package/slider/README.md +273 -5
- package/slider/fesm2022/slider.mjs +29 -25
- package/sonner/README.md +317 -34
- package/sonner/fesm2022/sonner.mjs +9 -9
- package/spinner/README.md +255 -34
- package/spinner/fesm2022/spinner.mjs +8 -8
- package/switch/README.md +281 -34
- package/switch/fesm2022/switch.mjs +12 -14
- package/table/README.md +423 -5
- package/table/fesm2022/table.mjs +41 -41
- package/tabs/README.md +382 -34
- package/tabs/fesm2022/tabs.mjs +48 -38
- package/textarea/README.md +282 -5
- package/textarea/fesm2022/textarea.mjs +9 -9
- package/toggle/README.md +270 -5
- package/toggle/fesm2022/toggle.mjs +14 -14
- package/toggle-group/README.md +340 -5
- package/toggle-group/fesm2022/toggle-group.mjs +13 -13
- package/toggle-group/types/toggle-group.d.ts +13 -7
- package/tooltip/README.md +240 -34
- package/tooltip/fesm2022/tooltip.mjs +14 -14
- package/typography/README.md +271 -5
- package/typography/fesm2022/typography.mjs +53 -53
- package/typography/types/typography.d.ts +12 -12
- package/utils/README.md +274 -34
- package/utils/fesm2022/utils.mjs +68 -44
- package/accordion/fesm2022/accordion.mjs.map +0 -1
- package/alert/fesm2022/alert.mjs.map +0 -1
- package/alert-dialog/fesm2022/alert-dialog.mjs.map +0 -1
- package/aspect-ratio/fesm2022/aspect-ratio.mjs.map +0 -1
- package/autocomplete/fesm2022/autocomplete.mjs.map +0 -1
- package/avatar/fesm2022/avatar.mjs.map +0 -1
- package/badge/fesm2022/badge.mjs.map +0 -1
- package/basic-alert/fesm2022/basic-alert.mjs.map +0 -1
- package/breadcrumb/fesm2022/breadcrumb.mjs.map +0 -1
- package/button/fesm2022/button.mjs.map +0 -1
- package/button-group/fesm2022/button-group.mjs.map +0 -1
- package/calendar/fesm2022/calendar.mjs.map +0 -1
- package/card/fesm2022/card.mjs.map +0 -1
- package/carousel/fesm2022/carousel.mjs.map +0 -1
- package/checkbox/fesm2022/checkbox.mjs.map +0 -1
- package/collapsible/fesm2022/collapsible.mjs.map +0 -1
- package/combobox/fesm2022/combobox.mjs.map +0 -1
- package/command/fesm2022/command.mjs.map +0 -1
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs.map +0 -1
- package/context-menu/fesm2022/context-menu.mjs.map +0 -1
- package/date-picker/fesm2022/date-picker.mjs.map +0 -1
- package/dialog/fesm2022/dialog.mjs.map +0 -1
- package/drawer/fesm2022/drawer.mjs.map +0 -1
- package/dropdown-menu/fesm2022/dropdown-menu.mjs.map +0 -1
- package/empty/fesm2022/empty.mjs.map +0 -1
- package/field/fesm2022/field.mjs.map +0 -1
- package/form-checkbox/fesm2022/form-checkbox.mjs.map +0 -1
- package/form-date-picker/fesm2022/form-date-picker.mjs.map +0 -1
- package/form-field/fesm2022/form-field.mjs.map +0 -1
- package/form-field-simple/fesm2022/form-field-simple.mjs.map +0 -1
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs.map +0 -1
- package/form-select/fesm2022/form-select.mjs.map +0 -1
- package/form-text-input/fesm2022/form-text-input.mjs.map +0 -1
- package/form-textarea/fesm2022/form-textarea.mjs.map +0 -1
- package/hover-card/fesm2022/hover-card.mjs.map +0 -1
- package/icon/fesm2022/icon.mjs.map +0 -1
- package/input/fesm2022/input.mjs.map +0 -1
- package/input-group/fesm2022/input-group.mjs.map +0 -1
- package/input-otp/fesm2022/input-otp.mjs.map +0 -1
- package/item/fesm2022/item.mjs.map +0 -1
- package/kbd/fesm2022/kbd.mjs.map +0 -1
- package/label/fesm2022/label.mjs.map +0 -1
- package/layout-simple/fesm2022/layout-simple.mjs.map +0 -1
- package/menubar/fesm2022/menubar.mjs.map +0 -1
- package/native-select/fesm2022/native-select.mjs.map +0 -1
- package/navigation-menu/fesm2022/navigation-menu.mjs.map +0 -1
- package/pagination/fesm2022/pagination.mjs.map +0 -1
- package/popover/fesm2022/popover.mjs.map +0 -1
- package/progress/fesm2022/progress.mjs.map +0 -1
- package/radio-group/fesm2022/radio-group.mjs.map +0 -1
- package/resizable/fesm2022/resizable.mjs.map +0 -1
- package/scroll-area/fesm2022/scroll-area.mjs.map +0 -1
- package/searchable-multiselect/fesm2022/searchable-multiselect.mjs.map +0 -1
- package/select/fesm2022/select.mjs.map +0 -1
- package/separator/fesm2022/separator.mjs.map +0 -1
- package/sheet/fesm2022/sheet.mjs.map +0 -1
- package/sidebar/fesm2022/sidebar.mjs.map +0 -1
- package/skeleton/fesm2022/skeleton.mjs.map +0 -1
- package/slider/fesm2022/slider.mjs.map +0 -1
- package/sonner/fesm2022/sonner.mjs.map +0 -1
- package/spinner/fesm2022/spinner.mjs.map +0 -1
- package/switch/fesm2022/switch.mjs.map +0 -1
- package/table/fesm2022/table.mjs.map +0 -1
- package/tabs/fesm2022/tabs.mjs.map +0 -1
- package/textarea/fesm2022/textarea.mjs.map +0 -1
- package/toggle/fesm2022/toggle.mjs.map +0 -1
- package/toggle-group/fesm2022/toggle-group.mjs.map +0 -1
- package/tooltip/fesm2022/tooltip.mjs.map +0 -1
- package/typography/fesm2022/typography.mjs.map +0 -1
- package/utils/fesm2022/utils.mjs.map +0 -1
|
@@ -12,10 +12,10 @@ class HlmAccordion {
|
|
|
12
12
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
13
13
|
_computedClass = computed(() => hlm('tw:flex', this._brn.orientation() === 'horizontal' ? 'tw:flex-row' : 'tw:flex-col', this.userClass()), /* @ts-ignore */
|
|
14
14
|
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
15
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
16
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.
|
|
15
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAccordion, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
16
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmAccordion, isStandalone: true, selector: "[hlmAccordion], hlm-accordion", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, hostDirectives: [{ directive: i1.BrnAccordion, inputs: ["type", "type", "orientation", "orientation"] }], ngImport: i0 });
|
|
17
17
|
}
|
|
18
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAccordion, decorators: [{
|
|
19
19
|
type: Directive,
|
|
20
20
|
args: [{
|
|
21
21
|
selector: '[hlmAccordion], hlm-accordion',
|
|
@@ -33,8 +33,8 @@ class HlmAccordionContent extends BrnAccordionContent {
|
|
|
33
33
|
return hlm('tw:grid tw:text-sm tw:transition-all', gridRows, this.userClass());
|
|
34
34
|
}, /* @ts-ignore */
|
|
35
35
|
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
36
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
37
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.
|
|
36
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAccordionContent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
37
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.3", type: HlmAccordionContent, isStandalone: true, selector: "hlm-accordion-content", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, usesInheritance: true, ngImport: i0, template: `
|
|
38
38
|
<div [attr.inert]="_inert()" style="tw:overflow:hidden">
|
|
39
39
|
<div class="tw:flex tw:flex-col tw:gap-4 tw:text-balance tw:pb-4 tw:pt-0">
|
|
40
40
|
<ng-content />
|
|
@@ -42,7 +42,7 @@ class HlmAccordionContent extends BrnAccordionContent {
|
|
|
42
42
|
</div>
|
|
43
43
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
44
44
|
}
|
|
45
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAccordionContent, decorators: [{
|
|
46
46
|
type: Component,
|
|
47
47
|
args: [{
|
|
48
48
|
selector: 'hlm-accordion-content',
|
|
@@ -65,10 +65,10 @@ class HlmAccordionIcon {
|
|
|
65
65
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
66
66
|
_computedClass = computed(() => hlm('tw:text-muted-foreground tw:pointer-events-none tw:size-4 tw:shrink-0 tw:translate-y-0.5 tw:transition-transform tw:duration-200', this.userClass()), /* @ts-ignore */
|
|
67
67
|
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
68
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
69
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.
|
|
68
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAccordionIcon, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
69
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmAccordionIcon, isStandalone: true, selector: "ng-icon[egAccordionIcon], ng-icon[hlmAccIcon]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, providers: [provideIcons({ lucideChevronDown }), provideHlmIconConfig({ size: 'sm' })], ngImport: i0 });
|
|
70
70
|
}
|
|
71
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAccordionIcon, decorators: [{
|
|
72
72
|
type: Directive,
|
|
73
73
|
args: [{
|
|
74
74
|
selector: 'ng-icon[egAccordionIcon], ng-icon[hlmAccIcon]',
|
|
@@ -83,10 +83,10 @@ class HlmAccordionItem {
|
|
|
83
83
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
84
84
|
_computedClass = computed(() => hlm('tw:border-border tw:flex tw:flex-1 tw:flex-col tw:border-b', this.userClass()), /* @ts-ignore */
|
|
85
85
|
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
86
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
87
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.
|
|
86
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAccordionItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
87
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmAccordionItem, isStandalone: true, selector: "[hlmAccordionItem],brn-accordion-item[hlm],hlm-accordion-item", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, hostDirectives: [{ directive: i1.BrnAccordionItem, inputs: ["isOpened", "isOpened"] }], ngImport: i0 });
|
|
88
88
|
}
|
|
89
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
89
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAccordionItem, decorators: [{
|
|
90
90
|
type: Directive,
|
|
91
91
|
args: [{
|
|
92
92
|
selector: '[hlmAccordionItem],brn-accordion-item[hlm],hlm-accordion-item',
|
|
@@ -106,10 +106,10 @@ class HlmAccordionTrigger {
|
|
|
106
106
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
107
107
|
_computedClass = computed(() => hlm('tw:focus-visible:border-ring tw:focus-visible:ring-ring/50 tw:flex tw:flex-1 tw:items-start tw:justify-between tw:gap-4 tw:rounded-md tw:py-4 tw:text-left tw:text-sm tw:font-medium tw:outline-none tw:transition-all tw:hover:underline tw:focus-visible:ring-[3px] tw:disabled:pointer-events-none tw:disabled:opacity-50 tw:[&[data-state=open]>[egAccIcon]]:rotate-180', this.userClass()), /* @ts-ignore */
|
|
108
108
|
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
109
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
110
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.
|
|
109
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAccordionTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
110
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmAccordionTrigger, isStandalone: true, selector: "[hlmAccordionTrigger]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.--tw-ring-offset-shadow": "\"0 0 #000\"", "class": "_computedClass()" } }, hostDirectives: [{ directive: i1.BrnAccordionTrigger }], ngImport: i0 });
|
|
111
111
|
}
|
|
112
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
112
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAccordionTrigger, decorators: [{
|
|
113
113
|
type: Directive,
|
|
114
114
|
args: [{
|
|
115
115
|
selector: '[hlmAccordionTrigger]',
|
|
@@ -132,8 +132,8 @@ const HlmAccordionImports = [
|
|
|
132
132
|
HlmAccordionContent,
|
|
133
133
|
];
|
|
134
134
|
class HlmAccordionModule {
|
|
135
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
136
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.
|
|
135
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAccordionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
136
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.3", ngImport: i0, type: HlmAccordionModule, imports: [HlmAccordion,
|
|
137
137
|
HlmAccordionItem,
|
|
138
138
|
HlmAccordionTrigger,
|
|
139
139
|
HlmAccordionIcon,
|
|
@@ -142,9 +142,9 @@ class HlmAccordionModule {
|
|
|
142
142
|
HlmAccordionTrigger,
|
|
143
143
|
HlmAccordionIcon,
|
|
144
144
|
HlmAccordionContent] });
|
|
145
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.
|
|
145
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAccordionModule });
|
|
146
146
|
}
|
|
147
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAccordionModule, decorators: [{
|
|
148
148
|
type: NgModule,
|
|
149
149
|
args: [{
|
|
150
150
|
imports: [...HlmAccordionImports],
|
|
@@ -157,4 +157,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
157
157
|
*/
|
|
158
158
|
|
|
159
159
|
export { HlmAccordion, HlmAccordionContent, HlmAccordionIcon, HlmAccordionImports, HlmAccordionItem, HlmAccordionModule, HlmAccordionTrigger };
|
|
160
|
-
|
|
160
|
+
|
package/alert/README.md
CHANGED
|
@@ -1,64 +1,373 @@
|
|
|
1
|
-
# Alert
|
|
1
|
+
# Alert (`@egose/shadcn-theme-ng/alert`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A non-modal status banner in the shadcn/ui Alert style: an icon, a title, and a description
|
|
4
|
+
arranged in a bordered, tone-colored box. Use it for inline feedback (success confirmations,
|
|
5
|
+
warnings, informational hints) that stays visible in the page flow.
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
This is a **pure styling layer — no brain primitive underneath**. `HlmAlert` and its pieces are
|
|
8
|
+
plain attribute directives that compute shadcn classes with `cva` + `hlm()` from
|
|
9
|
+
`@egose/shadcn-theme-ng/utils`. The host gets `role="alert"` automatically. `HlmAlertIcon` only
|
|
10
|
+
applies the `sm` icon-size config (`provideHlmIconConfig`); pair it with an `ng-icon`.
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
> **Ships as:** `@egose/shadcn-theme-ng/alert` and `@egose/shadcn-theme-ng-tw/alert`
|
|
13
|
+
> (the `tw:`-prefixed Tailwind variant). Both expose the identical TypeScript surface; only the
|
|
14
|
+
> emitted Tailwind class strings differ. See the [package README](../../README.md) for install
|
|
15
|
+
> steps, peer dependencies, and Tailwind setup. Do not publish this project directory independently.
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
8
18
|
|
|
9
19
|
```bash
|
|
10
|
-
|
|
20
|
+
# Plain Tailwind (no prefix)
|
|
21
|
+
npm install @egose/shadcn-theme-ng
|
|
22
|
+
|
|
23
|
+
# tw:-prefixed Tailwind variant
|
|
24
|
+
npm install @egose/shadcn-theme-ng-tw
|
|
11
25
|
```
|
|
12
26
|
|
|
13
|
-
|
|
27
|
+
Peer dependencies (Angular, `@spartan-ng/brain`, `@ng-icons/*`, `rxjs`, …) are documented in the
|
|
28
|
+
[package README](../../README.md#peer-dependencies). This subpath additionally relies at runtime on
|
|
29
|
+
`@egose/shadcn-theme-ng/utils` (`hlm()`) and `@egose/shadcn-theme-ng/icon`
|
|
30
|
+
(`provideHlmIconConfig`).
|
|
14
31
|
|
|
15
|
-
|
|
16
|
-
|
|
32
|
+
## Imports
|
|
33
|
+
|
|
34
|
+
All symbols are exported from the subpath root (`projects/alert/src/public-api.ts`):
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
import {
|
|
38
|
+
HlmAlert,
|
|
39
|
+
HlmAlertTitle,
|
|
40
|
+
HlmAlertDescription,
|
|
41
|
+
HlmAlertIcon,
|
|
42
|
+
HlmAlertImports,
|
|
43
|
+
HlmAlertModule,
|
|
44
|
+
type AlertVariants,
|
|
45
|
+
type VariantType,
|
|
46
|
+
type AppearanceType,
|
|
47
|
+
} from '@egose/shadcn-theme-ng/alert';
|
|
48
|
+
// tw variant: replace with '@egose/shadcn-theme-ng-tw/alert'
|
|
17
49
|
```
|
|
18
50
|
|
|
19
|
-
|
|
51
|
+
Standalone component — spread the `*Imports` array:
|
|
20
52
|
|
|
21
|
-
|
|
53
|
+
```ts
|
|
54
|
+
import { Component } from '@angular/core';
|
|
55
|
+
import { HlmAlertImports } from '@egose/shadcn-theme-ng/alert';
|
|
22
56
|
|
|
23
|
-
|
|
24
|
-
|
|
57
|
+
@Component({
|
|
58
|
+
selector: 'app-demo',
|
|
59
|
+
standalone: true,
|
|
60
|
+
imports: [...HlmAlertImports],
|
|
61
|
+
template: `...`,
|
|
62
|
+
})
|
|
63
|
+
export class DemoComponent {}
|
|
25
64
|
```
|
|
26
65
|
|
|
27
|
-
|
|
66
|
+
NgModule-based consumer — import the module:
|
|
28
67
|
|
|
29
|
-
|
|
68
|
+
```ts
|
|
69
|
+
import { NgModule } from '@angular/core';
|
|
70
|
+
import { HlmAlertModule } from '@egose/shadcn-theme-ng/alert';
|
|
30
71
|
|
|
31
|
-
|
|
72
|
+
@NgModule({ imports: [HlmAlertModule] })
|
|
73
|
+
export class DemoModule {}
|
|
74
|
+
```
|
|
32
75
|
|
|
33
|
-
|
|
76
|
+
## Anatomy / Structure
|
|
34
77
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
78
|
+
```html
|
|
79
|
+
<div hlmAlert variant="info" appearance="solid">
|
|
80
|
+
<ng-icon hlm hlmAlertIcon name="lucideInfo" />
|
|
81
|
+
<h4 hlmAlertTitle>Heads up</h4>
|
|
82
|
+
<p hlmAlertDescription>Detail text goes here.</p>
|
|
83
|
+
</div>
|
|
84
|
+
```
|
|
38
85
|
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
npm publish
|
|
42
|
-
```
|
|
86
|
+
Real selectors (from source):
|
|
43
87
|
|
|
44
|
-
|
|
88
|
+
| Class | Selector(s) | Kind |
|
|
89
|
+
| --------------------- | --------------------------------------- | --------- |
|
|
90
|
+
| `HlmAlert` | `[hlmAlert]` | Directive |
|
|
91
|
+
| `HlmAlertTitle` | `[hlmAlertTitle]` | Directive |
|
|
92
|
+
| `HlmAlertDescription` | `[hlmAlertDesc], [hlmAlertDescription]` | Directive |
|
|
93
|
+
| `HlmAlertIcon` | `[hlmAlertIcon]` | Directive |
|
|
45
94
|
|
|
46
|
-
|
|
95
|
+
When an `[hlmAlertIcon]` child is present, the host switches to a two-column grid
|
|
96
|
+
(`grid-cols-[calc(theme(spacing.1)*4)_1fr]`) with the title/description placed in column 2 —
|
|
97
|
+
no extra markup needed.
|
|
47
98
|
|
|
48
|
-
|
|
49
|
-
|
|
99
|
+
## API reference
|
|
100
|
+
|
|
101
|
+
### `HlmAlert` — `[hlmAlert]`
|
|
102
|
+
|
|
103
|
+
| Input | Type | Default | Description |
|
|
104
|
+
| ------------ | -------------------------------------- | ----------- | ---------------------------------------------------------------- |
|
|
105
|
+
| `variant` | `AlertVariants['variant']` (see below) | `'primary'` | Color tone. |
|
|
106
|
+
| `appearance` | `AlertVariants['appearance']` | `'solid'` | `'solid'` (saturated fill) or `'light'` (tinted `bg-*/20` fill). |
|
|
107
|
+
| `class` | `ClassValue` | `''` | Extra classes merged via `hlm()`. |
|
|
108
|
+
|
|
109
|
+
`variant` values: `primary` · `secondary` · `success` · `warning` · `danger` · `info` ·
|
|
110
|
+
`light` · `dark` · `accent` · `destructive` · `muted` · `link` · `ghost`.
|
|
111
|
+
|
|
112
|
+
`appearance` values: `solid` · `light`. Every `variant × light` pair has a dedicated
|
|
113
|
+
`compoundVariants` entry (e.g. `warning + light` → `bg-warning/20 text-warning`).
|
|
114
|
+
|
|
115
|
+
Exported helper types: `AlertVariants` (`VariantProps<typeof alertVariants>`), `VariantType`,
|
|
116
|
+
`AppearanceType`.
|
|
117
|
+
|
|
118
|
+
### `HlmAlertTitle` — `[hlmAlertTitle]`
|
|
119
|
+
|
|
120
|
+
| Input | Type | Default | Description |
|
|
121
|
+
| ------- | ------------ | ------- | --------------------------------- |
|
|
122
|
+
| `class` | `ClassValue` | `''` | Extra classes merged via `hlm()`. |
|
|
123
|
+
|
|
124
|
+
Renders semibold, tracking-tight, single-line-clamped title text in grid column 2.
|
|
125
|
+
|
|
126
|
+
### `HlmAlertDescription` — `[hlmAlertDesc], [hlmAlertDescription]`
|
|
127
|
+
|
|
128
|
+
| Input | Type | Default | Description |
|
|
129
|
+
| ------- | ------------ | ------- | --------------------------------- |
|
|
130
|
+
| `class` | `ClassValue` | `''` | Extra classes merged via `hlm()`. |
|
|
131
|
+
|
|
132
|
+
Small relaxed-leading body text in grid column 2. Both selector spellings are equivalent.
|
|
133
|
+
|
|
134
|
+
### `HlmAlertIcon` — `[hlmAlertIcon]`
|
|
135
|
+
|
|
136
|
+
Size-only directive: provides `provideHlmIconConfig({ size: 'sm' })` so the decorated `ng-icon`
|
|
137
|
+
renders small. It declares **no inputs** and adds no classes of its own — the parent `HlmAlert`
|
|
138
|
+
stylesheet sizes/positions it (`size-4`, `translate-y-0.5`, `text-current`).
|
|
139
|
+
|
|
140
|
+
## Examples
|
|
141
|
+
|
|
142
|
+
### 1. Basic alert with icon, title, and description
|
|
143
|
+
|
|
144
|
+
```ts
|
|
145
|
+
import { Component } from '@angular/core';
|
|
146
|
+
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
147
|
+
import { lucideInfo } from '@ng-icons/lucide';
|
|
148
|
+
import { HlmAlertImports } from '@egose/shadcn-theme-ng/alert';
|
|
149
|
+
import { HlmIcon } from '@egose/shadcn-theme-ng/icon';
|
|
150
|
+
|
|
151
|
+
@Component({
|
|
152
|
+
selector: 'app-alert-basic',
|
|
153
|
+
standalone: true,
|
|
154
|
+
imports: [...HlmAlertImports, NgIcon, HlmIcon],
|
|
155
|
+
providers: [provideIcons({ lucideInfo })],
|
|
156
|
+
template: `
|
|
157
|
+
<div hlmAlert variant="info">
|
|
158
|
+
<ng-icon hlm hlmAlertIcon name="lucideInfo" />
|
|
159
|
+
<h4 hlmAlertTitle>Heads up</h4>
|
|
160
|
+
<p hlmAlertDescription>Your trial ends in 3 days. Upgrade to keep your data.</p>
|
|
161
|
+
</div>
|
|
162
|
+
`,
|
|
163
|
+
})
|
|
164
|
+
export class AlertBasicComponent {}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
```html
|
|
168
|
+
<app-alert-basic />
|
|
50
169
|
```
|
|
51
170
|
|
|
52
|
-
|
|
171
|
+
### 2. All variants (solid)
|
|
53
172
|
|
|
54
|
-
|
|
173
|
+
```ts
|
|
174
|
+
import { Component } from '@angular/core';
|
|
175
|
+
import { HlmAlertImports, type VariantType } from '@egose/shadcn-theme-ng/alert';
|
|
55
176
|
|
|
56
|
-
|
|
57
|
-
|
|
177
|
+
@Component({
|
|
178
|
+
selector: 'app-alert-variants',
|
|
179
|
+
standalone: true,
|
|
180
|
+
imports: [...HlmAlertImports],
|
|
181
|
+
template: `
|
|
182
|
+
@for (v of variants; track v) {
|
|
183
|
+
<div hlmAlert [variant]="v" class="tw:mb-3">
|
|
184
|
+
<h4 hlmAlertTitle class="tw:capitalize">{{ v }}</h4>
|
|
185
|
+
<p hlmAlertDescription>This is the {{ v }} tone in solid appearance.</p>
|
|
186
|
+
</div>
|
|
187
|
+
}
|
|
188
|
+
`,
|
|
189
|
+
})
|
|
190
|
+
export class AlertVariantsComponent {
|
|
191
|
+
readonly variants: VariantType[] = [
|
|
192
|
+
'primary',
|
|
193
|
+
'secondary',
|
|
194
|
+
'success',
|
|
195
|
+
'warning',
|
|
196
|
+
'danger',
|
|
197
|
+
'info',
|
|
198
|
+
'light',
|
|
199
|
+
'dark',
|
|
200
|
+
'accent',
|
|
201
|
+
'destructive',
|
|
202
|
+
'muted',
|
|
203
|
+
'link',
|
|
204
|
+
'ghost',
|
|
205
|
+
];
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### 3. Light appearance + semantic states
|
|
210
|
+
|
|
211
|
+
```ts
|
|
212
|
+
import { Component } from '@angular/core';
|
|
213
|
+
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
214
|
+
import { lucideCircleCheck, lucideCircleAlert, lucideInfo } from '@ng-icons/lucide';
|
|
215
|
+
import { HlmAlertImports } from '@egose/shadcn-theme-ng/alert';
|
|
216
|
+
import { HlmIcon } from '@egose/shadcn-theme-ng/icon';
|
|
217
|
+
|
|
218
|
+
@Component({
|
|
219
|
+
selector: 'app-alert-states',
|
|
220
|
+
standalone: true,
|
|
221
|
+
imports: [...HlmAlertImports, NgIcon, HlmIcon],
|
|
222
|
+
providers: [provideIcons({ lucideCircleCheck, lucideCircleAlert, lucideInfo })],
|
|
223
|
+
template: `
|
|
224
|
+
<div hlmAlert variant="success" appearance="light" class="tw:mb-3">
|
|
225
|
+
<ng-icon hlm hlmAlertIcon name="lucideCircleCheck" />
|
|
226
|
+
<h4 hlmAlertTitle>Payment confirmed</h4>
|
|
227
|
+
<p hlmAlertDescription>Receipt #INV-2041 was emailed to you.</p>
|
|
228
|
+
</div>
|
|
229
|
+
<div hlmAlert variant="warning" appearance="light" class="tw:mb-3">
|
|
230
|
+
<ng-icon hlm hlmAlertIcon name="lucideCircleAlert" />
|
|
231
|
+
<h4 hlmAlertTitle>Storage almost full</h4>
|
|
232
|
+
<p hlmAlertDescription>You have used 9.2 of 10 GB.</p>
|
|
233
|
+
</div>
|
|
234
|
+
<div hlmAlert variant="destructive" appearance="light">
|
|
235
|
+
<ng-icon hlm hlmAlertIcon name="lucideCircleAlert" />
|
|
236
|
+
<h4 hlmAlertTitle>Deployment failed</h4>
|
|
237
|
+
<p hlmAlertDescription>Unit tests failed on step 4. See the logs.</p>
|
|
238
|
+
</div>
|
|
239
|
+
`,
|
|
240
|
+
})
|
|
241
|
+
export class AlertStatesComponent {}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### 4. Conditional alert driven by a signal (form error pattern)
|
|
245
|
+
|
|
246
|
+
```ts
|
|
247
|
+
import { Component, computed, signal } from '@angular/core';
|
|
248
|
+
import { HlmAlertImports, type VariantType } from '@egose/shadcn-theme-ng/alert';
|
|
249
|
+
|
|
250
|
+
@Component({
|
|
251
|
+
selector: 'app-alert-conditional',
|
|
252
|
+
standalone: true,
|
|
253
|
+
imports: [...HlmAlertImports],
|
|
254
|
+
template: `
|
|
255
|
+
@if (tone(); as t) {
|
|
256
|
+
<div hlmAlert [variant]="t">
|
|
257
|
+
<h4 hlmAlertTitle>{{ title() }}</h4>
|
|
258
|
+
<p hlmAlertDescription>{{ message() }}</p>
|
|
259
|
+
</div>
|
|
260
|
+
}
|
|
261
|
+
<div class="tw:mt-3 tw:flex tw:gap-2">
|
|
262
|
+
<button (click)="show('success')">Succeed</button>
|
|
263
|
+
<button (click)="show('destructive')">Fail</button>
|
|
264
|
+
<button (click)="clear()">Clear</button>
|
|
265
|
+
</div>
|
|
266
|
+
`,
|
|
267
|
+
})
|
|
268
|
+
export class AlertConditionalComponent {
|
|
269
|
+
private readonly _tone = signal<VariantType | null>(null);
|
|
270
|
+
readonly tone = this._tone.asReadonly();
|
|
271
|
+
readonly title = computed(() => (this._tone() === 'success' ? 'Saved' : 'Something went wrong'));
|
|
272
|
+
readonly message = computed(() =>
|
|
273
|
+
this._tone() === 'success' ? 'Your changes were saved.' : 'Please fix the highlighted fields.',
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
show(t: VariantType) {
|
|
277
|
+
this._tone.set(t);
|
|
278
|
+
}
|
|
279
|
+
clear() {
|
|
280
|
+
this._tone.set(null);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
58
283
|
```
|
|
59
284
|
|
|
60
|
-
|
|
285
|
+
### 5. Title-only and description-only compositions
|
|
286
|
+
|
|
287
|
+
The title and description are independent directives — use either alone:
|
|
288
|
+
|
|
289
|
+
```ts
|
|
290
|
+
import { Component } from '@angular/core';
|
|
291
|
+
import { HlmAlertImports } from '@egose/shadcn-theme-ng/alert';
|
|
292
|
+
|
|
293
|
+
@Component({
|
|
294
|
+
selector: 'app-alert-minimal',
|
|
295
|
+
standalone: true,
|
|
296
|
+
imports: [...HlmAlertImports],
|
|
297
|
+
template: `
|
|
298
|
+
<!-- title only -->
|
|
299
|
+
<div hlmAlert variant="muted" class="tw:mb-3">
|
|
300
|
+
<h4 hlmAlertTitle>Maintenance window: Sunday 02:00–04:00 UTC</h4>
|
|
301
|
+
</div>
|
|
302
|
+
<!-- description only, short spelling -->
|
|
303
|
+
<div hlmAlert variant="ghost">
|
|
304
|
+
<p hlmAlertDesc>Cookies help us improve. No action required.</p>
|
|
305
|
+
</div>
|
|
306
|
+
`,
|
|
307
|
+
})
|
|
308
|
+
export class AlertMinimalComponent {}
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### 6. Dismissible alert + composition with a button
|
|
312
|
+
|
|
313
|
+
```ts
|
|
314
|
+
import { Component, signal } from '@angular/core';
|
|
315
|
+
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
316
|
+
import { lucideInfo, lucideX } from '@ng-icons/lucide';
|
|
317
|
+
import { HlmAlertImports } from '@egose/shadcn-theme-ng/alert';
|
|
318
|
+
import { HlmButtonImports } from '@egose/shadcn-theme-ng/button';
|
|
319
|
+
import { HlmIcon } from '@egose/shadcn-theme-ng/icon';
|
|
320
|
+
|
|
321
|
+
@Component({
|
|
322
|
+
selector: 'app-alert-dismissible',
|
|
323
|
+
standalone: true,
|
|
324
|
+
imports: [...HlmAlertImports, ...HlmButtonImports, NgIcon, HlmIcon],
|
|
325
|
+
providers: [provideIcons({ lucideInfo, lucideX })],
|
|
326
|
+
template: `
|
|
327
|
+
@if (visible()) {
|
|
328
|
+
<div hlmAlert variant="info" class="tw:relative tw:pr-12">
|
|
329
|
+
<ng-icon hlm hlmAlertIcon name="lucideInfo" />
|
|
330
|
+
<h4 hlmAlertTitle>New version available</h4>
|
|
331
|
+
<p hlmAlertDescription>Restart the app to apply v2.4.1.</p>
|
|
332
|
+
<button
|
|
333
|
+
hlmBtn
|
|
334
|
+
variant="ghost"
|
|
335
|
+
size="icon-sm"
|
|
336
|
+
class="tw:absolute tw:top-2 tw:right-2"
|
|
337
|
+
(click)="visible.set(false)"
|
|
338
|
+
aria-label="Dismiss"
|
|
339
|
+
>
|
|
340
|
+
<ng-icon hlm name="lucideX" size="sm" />
|
|
341
|
+
</button>
|
|
342
|
+
</div>
|
|
343
|
+
}
|
|
344
|
+
`,
|
|
345
|
+
})
|
|
346
|
+
export class AlertDismissibleComponent {
|
|
347
|
+
readonly visible = signal(true);
|
|
348
|
+
}
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
## Accessibility notes
|
|
352
|
+
|
|
353
|
+
- The host carries `role="alert"`, so assistive technology announces content injected dynamically
|
|
354
|
+
(e.g. after a failed save). For purely decorative/informational banners that should not
|
|
355
|
+
interrupt, prefer `variant="muted"` copy and consider whether a `role="status"` wrapper of your
|
|
356
|
+
own is more appropriate — the role is baked into the directive and cannot be switched off.
|
|
357
|
+
- Keep the title short and the description actionable; screen readers read both in DOM order
|
|
358
|
+
(icon → title → description).
|
|
359
|
+
- Do not put interactive controls other than a dismiss button inside an `role="alert"` region;
|
|
360
|
+
links and buttons inside the description are allowed but keep them minimal.
|
|
361
|
+
|
|
362
|
+
## Theming / CSS variables
|
|
363
|
+
|
|
364
|
+
Class-based theming via `cva` variants (`bg-*/text-*` tokens); no component-specific CSS variables.
|
|
365
|
+
Extend with `class` on any piece. The `link` and `ghost` variants are intentionally low-chrome for
|
|
366
|
+
embedding alerts in prose or cards.
|
|
61
367
|
|
|
62
|
-
##
|
|
368
|
+
## Related subpaths
|
|
63
369
|
|
|
64
|
-
|
|
370
|
+
- `@egose/shadcn-theme-ng/basic-alert` — ready-made `EgBasicAlert` (icon + title + description in one tag)
|
|
371
|
+
- `@egose/shadcn-theme-ng/badge` — inline status chips for compact labeling
|
|
372
|
+
- `@egose/shadcn-theme-ng/button` — dismiss/action buttons inside alerts
|
|
373
|
+
- `@egose/shadcn-theme-ng/icon` — `HlmIcon` sizing and `provideHlmIconConfig`
|
package/alert/fesm2022/alert.mjs
CHANGED
|
@@ -68,7 +68,7 @@ const alertVariants = cva('tw:relative tw:w-full tw:items-start tw:gap-y-0.5 tw:
|
|
|
68
68
|
class: 'tw:bg-dark/20 tw:text-dark tw:[&>[hlmAlertDescription]]:text-dark',
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
|
-
variant:
|
|
71
|
+
variant: "tw:accent",
|
|
72
72
|
appearance: 'light',
|
|
73
73
|
class: 'tw:bg-accent/20 tw:text-accent tw:[&>[hlmAlertDescription]]:text-accent',
|
|
74
74
|
},
|
|
@@ -109,10 +109,10 @@ class HlmAlert {
|
|
|
109
109
|
appearance: this.appearance(),
|
|
110
110
|
}), this.userClass()), /* @ts-ignore */
|
|
111
111
|
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
112
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
113
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.
|
|
112
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAlert, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
113
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmAlert, isStandalone: true, selector: "[hlmAlert]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "alert" }, properties: { "class": "_computedClass()" } }, ngImport: i0 });
|
|
114
114
|
}
|
|
115
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAlert, decorators: [{
|
|
116
116
|
type: Directive,
|
|
117
117
|
args: [{
|
|
118
118
|
selector: '[hlmAlert]',
|
|
@@ -127,10 +127,10 @@ class HlmAlertDescription {
|
|
|
127
127
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
128
128
|
_computedClass = computed(() => hlm('tw:text-current tw:col-start-2 tw:grid tw:justify-items-start tw:gap-1 tw:text-sm tw:[&_p]:leading-relaxed', this.userClass()), /* @ts-ignore */
|
|
129
129
|
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
130
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
131
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.
|
|
130
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAlertDescription, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
131
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmAlertDescription, isStandalone: true, selector: "[hlmAlertDesc],[hlmAlertDescription]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, ngImport: i0 });
|
|
132
132
|
}
|
|
133
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAlertDescription, decorators: [{
|
|
134
134
|
type: Directive,
|
|
135
135
|
args: [{
|
|
136
136
|
selector: '[hlmAlertDesc],[hlmAlertDescription]',
|
|
@@ -141,10 +141,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
141
141
|
}], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
142
142
|
|
|
143
143
|
class HlmAlertIcon {
|
|
144
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
145
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.
|
|
144
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAlertIcon, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
145
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmAlertIcon, isStandalone: true, selector: "[hlmAlertIcon]", providers: [provideHlmIconConfig({ size: 'sm' })], ngImport: i0 });
|
|
146
146
|
}
|
|
147
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAlertIcon, decorators: [{
|
|
148
148
|
type: Directive,
|
|
149
149
|
args: [{
|
|
150
150
|
selector: '[hlmAlertIcon]',
|
|
@@ -156,10 +156,10 @@ class HlmAlertTitle {
|
|
|
156
156
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
157
157
|
_computedClass = computed(() => hlm('tw:col-start-2 tw:line-clamp-1 tw:min-h-4 tw:text-md tw:font-semibold tw:tracking-tight', this.userClass()), /* @ts-ignore */
|
|
158
158
|
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
159
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
160
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.
|
|
159
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAlertTitle, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
160
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmAlertTitle, isStandalone: true, selector: "[hlmAlertTitle]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, ngImport: i0 });
|
|
161
161
|
}
|
|
162
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
162
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAlertTitle, decorators: [{
|
|
163
163
|
type: Directive,
|
|
164
164
|
args: [{
|
|
165
165
|
selector: '[hlmAlertTitle]',
|
|
@@ -174,11 +174,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
174
174
|
*/
|
|
175
175
|
const HlmAlertImports = [HlmAlert, HlmAlertTitle, HlmAlertDescription, HlmAlertIcon];
|
|
176
176
|
class HlmAlertModule {
|
|
177
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
178
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.
|
|
179
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.
|
|
177
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAlertModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
178
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.3", ngImport: i0, type: HlmAlertModule, imports: [HlmAlert, HlmAlertTitle, HlmAlertDescription, HlmAlertIcon], exports: [HlmAlert, HlmAlertTitle, HlmAlertDescription, HlmAlertIcon] });
|
|
179
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAlertModule });
|
|
180
180
|
}
|
|
181
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
181
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmAlertModule, decorators: [{
|
|
182
182
|
type: NgModule,
|
|
183
183
|
args: [{
|
|
184
184
|
imports: [...HlmAlertImports],
|
|
@@ -191,4 +191,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
191
191
|
*/
|
|
192
192
|
|
|
193
193
|
export { HlmAlert, HlmAlertDescription, HlmAlertIcon, HlmAlertImports, HlmAlertModule, HlmAlertTitle };
|
|
194
|
-
|
|
194
|
+
|