@egose/shadcn-theme-ng 0.0.27 → 0.1.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 +3 -0
- package/accordion/fesm2022/accordion.mjs +148 -0
- package/accordion/package.json +25 -0
- package/accordion/types/accordion.d.ts +49 -0
- package/alert/README.md +2 -63
- package/alert/fesm2022/alert.mjs +58 -53
- package/alert/package.json +25 -0
- package/alert-dialog/README.md +11 -0
- package/alert-dialog/fesm2022/alert-dialog.mjs +287 -0
- package/alert-dialog/package.json +25 -0
- package/alert-dialog/types/alert-dialog.d.ts +90 -0
- package/aspect-ratio/README.md +11 -0
- package/aspect-ratio/fesm2022/aspect-ratio.mjs +62 -0
- package/aspect-ratio/package.json +25 -0
- package/aspect-ratio/types/aspect-ratio.d.ts +21 -0
- package/autocomplete/README.md +3 -0
- package/autocomplete/fesm2022/autocomplete.mjs +391 -0
- package/autocomplete/package.json +24 -0
- package/autocomplete/types/autocomplete.d.ts +96 -0
- package/avatar/README.md +11 -0
- package/avatar/fesm2022/avatar.mjs +178 -0
- package/avatar/package.json +25 -0
- package/avatar/types/avatar.d.ts +50 -0
- package/badge/README.md +2 -63
- package/badge/fesm2022/badge.mjs +69 -63
- package/badge/package.json +25 -0
- package/basic-alert/README.md +2 -63
- package/basic-alert/fesm2022/basic-alert.mjs +14 -22
- package/basic-alert/package.json +24 -0
- package/breadcrumb/README.md +11 -0
- package/breadcrumb/fesm2022/breadcrumb.mjs +218 -0
- package/breadcrumb/package.json +25 -0
- package/breadcrumb/types/breadcrumb.d.ts +57 -0
- package/button/README.md +2 -63
- package/button/fesm2022/button.mjs +201 -177
- package/button/package.json +25 -0
- package/button/{index.d.ts → types/button.d.ts} +31 -10
- package/button-group/README.md +11 -0
- package/button-group/fesm2022/button-group.mjs +102 -0
- package/button-group/package.json +25 -0
- package/button-group/types/button-group.d.ts +30 -0
- package/calendar/README.md +2 -63
- package/calendar/fesm2022/calendar.mjs +178 -570
- package/calendar/package.json +24 -0
- package/calendar/types/calendar.d.ts +94 -0
- package/card/README.md +11 -0
- package/card/fesm2022/card.mjs +169 -0
- package/card/package.json +25 -0
- package/card/types/card.d.ts +54 -0
- package/carousel/README.md +11 -0
- package/carousel/fesm2022/carousel.mjs +267 -0
- package/carousel/package.json +25 -0
- package/carousel/types/carousel.d.ts +84 -0
- package/checkbox/README.md +3 -0
- package/checkbox/fesm2022/checkbox.mjs +113 -0
- package/checkbox/package.json +24 -0
- package/checkbox/types/checkbox.d.ts +56 -0
- package/collapsible/README.md +11 -0
- package/collapsible/fesm2022/collapsible.mjs +77 -0
- package/collapsible/package.json +25 -0
- package/collapsible/types/collapsible.d.ts +27 -0
- package/combobox/README.md +11 -0
- package/combobox/fesm2022/combobox.mjs +547 -0
- package/combobox/package.json +25 -0
- package/combobox/types/combobox.d.ts +151 -0
- package/command/README.md +11 -0
- package/command/fesm2022/command.mjs +301 -0
- package/command/package.json +25 -0
- package/command/types/command.d.ts +89 -0
- package/confirmation-dialog/README.md +3 -0
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs +79 -0
- package/confirmation-dialog/package.json +24 -0
- package/confirmation-dialog/types/confirmation-dialog.d.ts +28 -0
- package/context-menu/README.md +11 -0
- package/context-menu/fesm2022/context-menu.mjs +89 -0
- package/context-menu/package.json +25 -0
- package/context-menu/types/context-menu.d.ts +34 -0
- package/date-picker/README.md +2 -63
- package/date-picker/fesm2022/date-picker.mjs +1104 -352
- package/date-picker/package.json +24 -0
- package/date-picker/types/date-picker.d.ts +555 -0
- package/dialog/README.md +3 -0
- package/dialog/fesm2022/dialog.mjs +281 -0
- package/dialog/package.json +24 -0
- package/dialog/types/dialog.d.ts +95 -0
- package/drawer/README.md +11 -0
- package/drawer/fesm2022/drawer.mjs +261 -0
- package/drawer/package.json +25 -0
- package/drawer/types/drawer.d.ts +76 -0
- package/dropdown-menu/README.md +11 -0
- package/dropdown-menu/fesm2022/dropdown-menu.mjs +554 -0
- package/dropdown-menu/package.json +25 -0
- package/dropdown-menu/types/dropdown-menu.d.ts +180 -0
- package/empty/README.md +11 -0
- package/empty/fesm2022/empty.mjs +151 -0
- package/empty/package.json +25 -0
- package/empty/types/empty.d.ts +54 -0
- package/field/README.md +11 -0
- package/field/fesm2022/field.mjs +351 -0
- package/field/package.json +25 -0
- package/field/types/field.d.ts +107 -0
- package/form-checkbox/README.md +3 -0
- package/form-checkbox/fesm2022/form-checkbox.mjs +94 -0
- package/form-checkbox/package.json +24 -0
- package/form-checkbox/types/form-checkbox.d.ts +33 -0
- package/form-date-picker/README.md +2 -63
- package/form-date-picker/fesm2022/form-date-picker.mjs +74 -120
- package/form-date-picker/package.json +24 -0
- package/form-date-picker/{index.d.ts → types/form-date-picker.d.ts} +7 -1
- package/form-field/README.md +2 -63
- package/form-field/fesm2022/form-field.mjs +54 -28
- package/form-field/package.json +25 -0
- package/form-field/types/form-field.d.ts +46 -0
- package/form-field-simple/README.md +2 -63
- package/form-field-simple/fesm2022/form-field-simple.mjs +15 -10
- package/form-field-simple/package.json +24 -0
- package/form-searchable-multiselect/README.md +3 -0
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +98 -0
- package/form-searchable-multiselect/package.json +24 -0
- package/form-searchable-multiselect/types/form-searchable-multiselect.d.ts +36 -0
- package/form-select/README.md +2 -63
- package/form-select/fesm2022/form-select.mjs +85 -141
- package/form-select/package.json +24 -0
- package/form-select/{index.d.ts → types/form-select.d.ts} +7 -1
- package/form-text-input/README.md +2 -63
- package/form-text-input/fesm2022/form-text-input.mjs +86 -171
- package/form-text-input/package.json +24 -0
- package/form-text-input/{index.d.ts → types/form-text-input.d.ts} +9 -12
- package/form-textarea/README.md +2 -63
- package/form-textarea/fesm2022/form-textarea.mjs +77 -128
- package/form-textarea/package.json +24 -0
- package/form-textarea/{index.d.ts → types/form-textarea.d.ts} +8 -1
- package/hover-card/README.md +11 -0
- package/hover-card/fesm2022/hover-card.mjs +123 -0
- package/hover-card/package.json +25 -0
- package/hover-card/types/hover-card.d.ts +36 -0
- package/icon/README.md +2 -63
- package/icon/fesm2022/icon.mjs +12 -10
- package/icon/package.json +25 -0
- package/input/README.md +2 -63
- package/input/fesm2022/input.mjs +25 -70
- package/input/package.json +25 -0
- package/input/types/input.d.ts +19 -0
- package/input-group/README.md +11 -0
- package/input-group/fesm2022/input-group.mjs +199 -0
- package/input-group/package.json +25 -0
- package/input-group/types/input-group.d.ts +52 -0
- package/input-otp/README.md +11 -0
- package/input-otp/fesm2022/input-otp.mjs +141 -0
- package/input-otp/package.json +25 -0
- package/input-otp/types/input-otp.d.ts +43 -0
- package/item/README.md +11 -0
- package/item/fesm2022/item.mjs +278 -0
- package/item/package.json +25 -0
- package/item/types/item.d.ts +101 -0
- package/kbd/README.md +11 -0
- package/kbd/fesm2022/kbd.mjs +61 -0
- package/kbd/package.json +25 -0
- package/kbd/types/kbd.d.ts +22 -0
- package/label/README.md +2 -63
- package/label/fesm2022/label.mjs +12 -11
- package/label/package.json +25 -0
- package/label/{index.d.ts → types/label.d.ts} +1 -1
- package/layout-simple/README.md +3 -0
- package/layout-simple/fesm2022/layout-simple.mjs +388 -0
- package/layout-simple/package.json +24 -0
- package/layout-simple/types/layout-simple.d.ts +167 -0
- package/menu/README.md +3 -0
- package/menu/fesm2022/menu.mjs +455 -0
- package/menu/package.json +24 -0
- package/menu/types/menu.d.ts +137 -0
- package/menubar/README.md +11 -0
- package/menubar/fesm2022/menubar.mjs +108 -0
- package/menubar/package.json +25 -0
- package/menubar/types/menubar.d.ts +40 -0
- package/native-select/README.md +11 -0
- package/native-select/fesm2022/native-select.mjs +207 -0
- package/native-select/package.json +25 -0
- package/native-select/types/native-select.d.ts +70 -0
- package/navigation-menu/README.md +11 -0
- package/navigation-menu/fesm2022/navigation-menu.mjs +194 -0
- package/navigation-menu/package.json +25 -0
- package/navigation-menu/types/navigation-menu.d.ts +54 -0
- package/package.json +284 -63
- package/pagination/README.md +11 -0
- package/pagination/fesm2022/pagination.mjs +522 -0
- package/pagination/package.json +25 -0
- package/pagination/types/pagination.d.ts +192 -0
- package/popover/README.md +2 -63
- package/popover/fesm2022/popover.mjs +124 -30
- package/popover/package.json +24 -0
- package/popover/types/popover.d.ts +54 -0
- package/progress/README.md +11 -0
- package/progress/fesm2022/progress.mjs +77 -0
- package/progress/package.json +25 -0
- package/progress/types/progress.d.ts +27 -0
- package/radio-group/README.md +3 -0
- package/radio-group/fesm2022/radio-group.mjs +207 -0
- package/radio-group/package.json +25 -0
- package/radio-group/types/radio-group.d.ts +71 -0
- package/resizable/README.md +11 -0
- package/resizable/fesm2022/resizable.mjs +103 -0
- package/resizable/package.json +25 -0
- package/resizable/types/resizable.d.ts +32 -0
- package/scroll-area/README.md +11 -0
- package/scroll-area/fesm2022/scroll-area.mjs +51 -0
- package/scroll-area/package.json +25 -0
- package/scroll-area/types/scroll-area.d.ts +16 -0
- package/searchable-multiselect/README.md +3 -0
- package/searchable-multiselect/fesm2022/searchable-multiselect.mjs +136 -0
- package/searchable-multiselect/package.json +24 -0
- package/searchable-multiselect/types/searchable-multiselect.d.ts +45 -0
- package/select/README.md +2 -63
- package/select/fesm2022/select.mjs +340 -198
- package/select/package.json +25 -0
- package/select/types/select.d.ts +121 -0
- package/separator/README.md +2 -63
- package/separator/fesm2022/separator.mjs +17 -15
- package/separator/package.json +24 -0
- package/separator/{index.d.ts → types/separator.d.ts} +4 -5
- package/sheet/README.md +2 -63
- package/sheet/fesm2022/sheet.mjs +56 -61
- package/sheet/package.json +24 -0
- package/sidebar/README.md +11 -0
- package/sidebar/fesm2022/sidebar.mjs +846 -0
- package/sidebar/package.json +25 -0
- package/sidebar/types/sidebar.d.ts +237 -0
- package/skeleton/README.md +11 -0
- package/skeleton/fesm2022/skeleton.mjs +44 -0
- package/skeleton/package.json +25 -0
- package/skeleton/types/skeleton.d.ts +16 -0
- package/slider/README.md +11 -0
- package/slider/fesm2022/slider.mjs +74 -0
- package/slider/package.json +25 -0
- package/slider/types/slider.d.ts +19 -0
- package/sonner/README.md +2 -63
- package/sonner/fesm2022/sonner.mjs +34 -39
- package/sonner/package.json +25 -0
- package/spinner/README.md +2 -63
- package/spinner/fesm2022/spinner.mjs +20 -16
- package/spinner/package.json +25 -0
- package/switch/README.md +2 -63
- package/switch/fesm2022/switch.mjs +28 -27
- package/switch/package.json +25 -0
- package/table/README.md +11 -0
- package/table/fesm2022/table.mjs +211 -0
- package/table/package.json +25 -0
- package/table/types/table.d.ts +87 -0
- package/tabs/README.md +3 -0
- package/tabs/fesm2022/tabs.mjs +210 -0
- package/tabs/package.json +25 -0
- package/tabs/types/tabs.d.ts +71 -0
- package/textarea/README.md +11 -0
- package/textarea/fesm2022/textarea.mjs +47 -0
- package/textarea/package.json +25 -0
- package/textarea/types/textarea.d.ts +18 -0
- package/toggle/README.md +11 -0
- package/toggle/fesm2022/toggle.mjs +78 -0
- package/toggle/package.json +25 -0
- package/toggle/types/toggle.d.ts +27 -0
- package/toggle-group/README.md +11 -0
- package/toggle-group/fesm2022/toggle-group.mjs +117 -0
- package/toggle-group/package.json +25 -0
- package/toggle-group/types/toggle-group.d.ts +45 -0
- package/tooltip/README.md +3 -0
- package/tooltip/fesm2022/tooltip.mjs +72 -0
- package/tooltip/package.json +25 -0
- package/tooltip/types/tooltip.d.ts +22 -0
- package/typography/README.md +11 -0
- package/typography/fesm2022/typography.mjs +242 -0
- package/typography/package.json +25 -0
- package/typography/types/typography.d.ts +94 -0
- package/utils/README.md +2 -63
- package/utils/fesm2022/utils.mjs +209 -2
- package/utils/package.json +25 -0
- package/utils/types/utils.d.ts +13 -0
- package/alert/fesm2022/alert.mjs.map +0 -1
- package/badge/fesm2022/badge.mjs.map +0 -1
- package/basic-alert/fesm2022/basic-alert.mjs.map +0 -1
- package/button/fesm2022/button.mjs.map +0 -1
- package/calendar/fesm2022/calendar.mjs.map +0 -1
- package/calendar/index.d.ts +0 -111
- package/date-picker/fesm2022/date-picker.mjs.map +0 -1
- package/date-picker/index.d.ts +0 -227
- 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/index.d.ts +0 -37
- package/form-field-simple/fesm2022/form-field-simple.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/icon/fesm2022/icon.mjs.map +0 -1
- package/input/fesm2022/input.mjs.map +0 -1
- package/input/index.d.ts +0 -41
- package/label/fesm2022/label.mjs.map +0 -1
- package/popover/fesm2022/popover.mjs.map +0 -1
- package/popover/index.d.ts +0 -30
- package/select/fesm2022/select.mjs.map +0 -1
- package/select/index.d.ts +0 -92
- package/separator/fesm2022/separator.mjs.map +0 -1
- package/sheet/fesm2022/sheet.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/utils/fesm2022/utils.mjs.map +0 -1
- package/utils/index.d.ts +0 -5
- /package/alert/{index.d.ts → types/alert.d.ts} +0 -0
- /package/badge/{index.d.ts → types/badge.d.ts} +0 -0
- /package/basic-alert/{index.d.ts → types/basic-alert.d.ts} +0 -0
- /package/form-field-simple/{index.d.ts → types/form-field-simple.d.ts} +0 -0
- /package/icon/{index.d.ts → types/icon.d.ts} +0 -0
- /package/sheet/{index.d.ts → types/sheet.d.ts} +0 -0
- /package/sonner/{index.d.ts → types/sonner.d.ts} +0 -0
- /package/spinner/{index.d.ts → types/spinner.d.ts} +0 -0
- /package/switch/{index.d.ts → types/switch.d.ts} +0 -0
|
@@ -1,71 +1,76 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, signal, computed, Component, NgModule } from '@angular/core';
|
|
3
|
-
import { NgTemplateOutlet } from '@angular/common';
|
|
2
|
+
import { input, signal, computed, Component, InjectionToken, inject, Directive, NgModule } from '@angular/core';
|
|
4
3
|
import * as i1 from '@spartan-ng/brain/button';
|
|
5
4
|
import { BrnButton } from '@spartan-ng/brain/button';
|
|
5
|
+
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
6
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
6
7
|
import { HlmSpinner } from '@egose/shadcn-theme-ng/spinner';
|
|
7
8
|
import { cva } from 'class-variance-authority';
|
|
8
|
-
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
9
9
|
|
|
10
10
|
const buttonVariants = cva([
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
11
|
+
"cursor-pointer",
|
|
12
|
+
"active:translate-y-[0.5px]",
|
|
13
|
+
"disabled:pointer-events-none",
|
|
14
|
+
"disabled:opacity-50",
|
|
15
|
+
"focus-visible:outline-none",
|
|
16
|
+
"focus-visible:ring-1",
|
|
17
|
+
"focus-visible:ring-ring",
|
|
18
|
+
"font-medium",
|
|
19
|
+
"gap-2",
|
|
20
|
+
"inline-flex",
|
|
21
|
+
"items-center",
|
|
22
|
+
"justify-center",
|
|
23
|
+
"rounded-sm",
|
|
24
|
+
"text-sm",
|
|
25
|
+
"transform",
|
|
26
|
+
"transition",
|
|
27
|
+
"transition-colors",
|
|
28
|
+
"whitespace-nowrap",
|
|
29
|
+
"[&_svg]:pointer-events-none",
|
|
30
|
+
"[&_svg]:shrink-0",
|
|
31
|
+
"[&_svg]:size-4",
|
|
32
|
+
"no-underline",
|
|
33
33
|
], {
|
|
34
34
|
variants: {
|
|
35
35
|
variant: {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
default: "border border-primary bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",
|
|
37
|
+
primary: "border border-primary bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",
|
|
38
|
+
secondary: "border border-secondary bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/90",
|
|
39
|
+
success: "border border-success bg-success text-success-foreground shadow-sm hover:bg-success/90",
|
|
40
|
+
warning: "border border-warning bg-warning text-warning-foreground shadow-sm hover:bg-warning/90",
|
|
41
|
+
danger: "border border-danger bg-danger text-danger-foreground shadow-sm hover:bg-danger/90",
|
|
42
|
+
info: "border border-info bg-info text-info-foreground shadow-sm hover:bg-info/90",
|
|
43
|
+
light: "border border-light bg-light text-light-foreground shadow-sm hover:bg-light/90",
|
|
44
|
+
dark: "border border-dark bg-dark text-dark-foreground shadow-sm hover:bg-dark/90",
|
|
45
|
+
accent: "border border-accent bg-accent text-accent-foreground shadow-sm hover:bg-accent/90",
|
|
46
|
+
destructive: "border border-destructive bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
47
|
+
muted: "border border-muted bg-muted text-muted-foreground shadow-sm hover:bg-muted/90",
|
|
48
|
+
outline: "border border-primary bg-white text-primary shadow-sm hover:bg-primary/10",
|
|
49
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
50
|
+
ghost: "hover:bg-light hover:text-light-foreground",
|
|
49
51
|
},
|
|
50
52
|
size: {
|
|
51
|
-
xs:
|
|
52
|
-
sm:
|
|
53
|
-
default:
|
|
54
|
-
lg:
|
|
55
|
-
icon:
|
|
56
|
-
'
|
|
57
|
-
'
|
|
58
|
-
'
|
|
59
|
-
'compact-
|
|
60
|
-
'compact-
|
|
53
|
+
xs: "h-7 rounded-xs px-2 text-xs",
|
|
54
|
+
sm: "h-8 rounded-sm px-3",
|
|
55
|
+
default: "h-9 px-4 py-2",
|
|
56
|
+
lg: "h-10 rounded-sm px-7 text-base",
|
|
57
|
+
icon: "h-9 w-9",
|
|
58
|
+
'icon-xs': "h-6 w-6 rounded-xs",
|
|
59
|
+
'icon-sm': "h-8 w-8 rounded-sm",
|
|
60
|
+
'icon-lg': "h-10 w-10 rounded-sm",
|
|
61
|
+
'compact-xs': "h-6 px-2 py-1 text-xs",
|
|
62
|
+
'compact-sm': "h-7 px-2 py-1",
|
|
63
|
+
'compact-default': "h-8 px-2 py-1",
|
|
64
|
+
'compact-lg': "h-9 px-2 py-1 text-base",
|
|
65
|
+
'compact-icon': "h-8 w-8",
|
|
61
66
|
},
|
|
62
67
|
appearance: {
|
|
63
68
|
solid: '',
|
|
64
|
-
outline:
|
|
65
|
-
'outline-filled':
|
|
69
|
+
outline: "bg-white border",
|
|
70
|
+
'outline-filled': "bg-white border",
|
|
66
71
|
},
|
|
67
72
|
loading: {
|
|
68
|
-
true:
|
|
73
|
+
true: "pointer-events-none",
|
|
69
74
|
false: null,
|
|
70
75
|
},
|
|
71
76
|
},
|
|
@@ -78,17 +83,27 @@ const buttonVariants = cva([
|
|
|
78
83
|
});
|
|
79
84
|
class HlmButton {
|
|
80
85
|
/** Props as signal-based inputs */
|
|
81
|
-
variant = input('primary',
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
86
|
+
variant = input('primary', /* @ts-ignore */
|
|
87
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
88
|
+
size = input('default', /* @ts-ignore */
|
|
89
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
90
|
+
appearance = input('solid', /* @ts-ignore */
|
|
91
|
+
...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
|
|
92
|
+
loading = input(false, /* @ts-ignore */
|
|
93
|
+
...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
94
|
+
icon = input(undefined, /* @ts-ignore */
|
|
95
|
+
...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
96
|
+
iconPosition = input('left', /* @ts-ignore */
|
|
97
|
+
...(ngDevMode ? [{ debugName: "iconPosition" }] : /* istanbul ignore next */ []));
|
|
98
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
99
|
+
spinnerUserClass = input('', /* @ts-ignore */
|
|
100
|
+
...(ngDevMode ? [{ debugName: "spinnerUserClass" }] : /* istanbul ignore next */ []));
|
|
101
|
+
disabled = input(false, /* @ts-ignore */
|
|
102
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
103
|
+
type = input('button', /* @ts-ignore */
|
|
104
|
+
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
105
|
+
_additionalClasses = signal('', /* @ts-ignore */
|
|
106
|
+
...(ngDevMode ? [{ debugName: "_additionalClasses" }] : /* istanbul ignore next */ []));
|
|
92
107
|
/** Computed button class merging */
|
|
93
108
|
_computedClass = computed(() => {
|
|
94
109
|
const outlineClasses = this.appearance() === 'outline' || this.appearance() === 'outline-filled'
|
|
@@ -103,120 +118,105 @@ class HlmButton {
|
|
|
103
118
|
appearance: this.appearance(),
|
|
104
119
|
loading: this.loading(),
|
|
105
120
|
className: this.userClass(),
|
|
106
|
-
}), outlineClasses, this.loading() ?
|
|
107
|
-
},
|
|
121
|
+
}), outlineClasses, this.loading() ? "pointer-events-none" : '', this._additionalClasses());
|
|
122
|
+
}, /* @ts-ignore */
|
|
123
|
+
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
108
124
|
/** Computed spinner classes */
|
|
109
125
|
spinnerClass = computed(() => {
|
|
110
126
|
const base = this.appearance() === 'outline' || this.appearance() === 'outline-filled'
|
|
111
127
|
? this.getOutlineSpinnerClasses(this.variant())
|
|
112
128
|
: this.getSpinnerClasses(this.variant());
|
|
113
129
|
return hlm(base, this.spinnerUserClass());
|
|
114
|
-
},
|
|
130
|
+
}, /* @ts-ignore */
|
|
131
|
+
...(ngDevMode ? [{ debugName: "spinnerClass" }] : /* istanbul ignore next */ []));
|
|
115
132
|
setClass(classes) {
|
|
116
133
|
this._additionalClasses.set(classes);
|
|
117
134
|
}
|
|
118
135
|
/** Helper functions */
|
|
119
136
|
getOutlineClasses(variant) {
|
|
120
137
|
const colors = {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
138
|
+
default: "border-primary text-primary shadow-sm hover:bg-primary/10",
|
|
139
|
+
primary: "border-primary text-primary shadow-sm hover:bg-primary/10",
|
|
140
|
+
secondary: "border-secondary text-secondary shadow-sm hover:bg-secondary/10",
|
|
141
|
+
success: "border-success text-success shadow-sm hover:bg-success/10",
|
|
142
|
+
warning: "border-warning text-warning shadow-sm hover:bg-warning/10",
|
|
143
|
+
danger: "border-danger text-danger shadow-sm hover:bg-danger/10",
|
|
144
|
+
info: "border-info text-info shadow-sm hover:bg-info/10",
|
|
145
|
+
light: "border-light text-light-foreground shadow-sm hover:bg-light/10",
|
|
146
|
+
dark: "border-dark text-dark shadow-sm hover:bg-dark/10",
|
|
147
|
+
accent: "border-accent text-accent shadow-sm hover:bg-accent/10",
|
|
148
|
+
destructive: "border-destructive text-destructive shadow-sm hover:bg-destructive/10",
|
|
149
|
+
muted: "border-muted text-muted-foreground shadow-sm hover:bg-muted/10",
|
|
150
|
+
outline: "border-primary text-primary shadow-sm hover:bg-primary/10",
|
|
151
|
+
link: "text-primary",
|
|
152
|
+
ghost: "text-light-foreground",
|
|
134
153
|
};
|
|
135
154
|
return colors[variant];
|
|
136
155
|
}
|
|
137
156
|
getOutlineFilledClasses(variant) {
|
|
138
157
|
const colors = {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
158
|
+
default: "hover:bg-primary hover:text-primary-foreground",
|
|
159
|
+
primary: "hover:bg-primary hover:text-primary-foreground",
|
|
160
|
+
secondary: "hover:bg-secondary hover:text-secondary-foreground",
|
|
161
|
+
success: "hover:bg-success hover:text-success-foreground",
|
|
162
|
+
warning: "hover:bg-warning hover:text-warning-foreground",
|
|
163
|
+
danger: "hover:bg-danger hover:text-danger-foreground",
|
|
164
|
+
info: "hover:bg-info hover:text-info-foreground",
|
|
165
|
+
light: "hover:bg-light hover:text-light-foreground",
|
|
166
|
+
dark: "hover:bg-dark hover:text-dark-foreground",
|
|
167
|
+
accent: "hover:bg-accent hover:text-accent-foreground",
|
|
168
|
+
destructive: "hover:bg-destructive hover:text-destructive-foreground",
|
|
169
|
+
muted: "hover:bg-muted hover:text-muted-foreground",
|
|
170
|
+
outline: "hover:bg-primary hover:text-primary-foreground",
|
|
171
|
+
link: "hover:underline",
|
|
172
|
+
ghost: "hover:bg-light",
|
|
152
173
|
};
|
|
153
174
|
return colors[variant];
|
|
154
175
|
}
|
|
155
176
|
getSpinnerClasses(variant) {
|
|
156
177
|
const colors = {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
178
|
+
default: "[&>svg]:text-primary-foreground",
|
|
179
|
+
primary: "[&>svg]:text-primary-foreground",
|
|
180
|
+
secondary: "[&>svg]:text-secondary-foreground",
|
|
181
|
+
success: "[&>svg]:text-success-foreground",
|
|
182
|
+
warning: "[&>svg]:text-warning-foreground",
|
|
183
|
+
danger: "[&>svg]:text-danger-foreground",
|
|
184
|
+
info: "[&>svg]:text-info-foreground",
|
|
185
|
+
light: "[&>svg]:text-light-foreground",
|
|
186
|
+
dark: "[&>svg]:text-dark-foreground",
|
|
187
|
+
accent: "[&>svg]:text-accent-foreground",
|
|
188
|
+
destructive: "[&>svg]:text-destructive-foreground",
|
|
189
|
+
muted: "[&>svg]:text-muted-foreground",
|
|
190
|
+
outline: "[&>svg]:text-primary",
|
|
191
|
+
link: "[&>svg]:text-primary",
|
|
192
|
+
ghost: "[&>svg]:text-light-foreground",
|
|
170
193
|
};
|
|
171
194
|
return colors[variant];
|
|
172
195
|
}
|
|
173
196
|
getOutlineSpinnerClasses(variant) {
|
|
174
197
|
const colors = {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
198
|
+
default: "[&>svg]:text-primary",
|
|
199
|
+
primary: "[&>svg]:text-primary",
|
|
200
|
+
secondary: "[&>svg]:text-secondary",
|
|
201
|
+
success: "[&>svg]:text-success",
|
|
202
|
+
warning: "[&>svg]:text-warning",
|
|
203
|
+
danger: "[&>svg]:text-danger",
|
|
204
|
+
info: "[&>svg]:text-info",
|
|
205
|
+
light: "[&>svg]:text-light",
|
|
206
|
+
dark: "[&>svg]:text-dark",
|
|
207
|
+
accent: "[&>svg]:text-accent",
|
|
208
|
+
destructive: "[&>svg]:text-destructive",
|
|
209
|
+
muted: "[&>svg]:text-muted-foreground",
|
|
210
|
+
outline: "[&>svg]:text-primary",
|
|
211
|
+
link: "[&>svg]:text-primary",
|
|
212
|
+
ghost: "[&>svg]:text-light-foreground",
|
|
188
213
|
};
|
|
189
214
|
return colors[variant];
|
|
190
215
|
}
|
|
191
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
192
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
193
|
-
<ng-template #projected>
|
|
194
|
-
<ng-content></ng-content>
|
|
195
|
-
</ng-template>
|
|
196
|
-
|
|
197
|
-
@if (loading()) {
|
|
198
|
-
<div class="relative inline-flex items-center">
|
|
199
|
-
<span class="invisible">
|
|
200
|
-
<ng-container *ngTemplateOutlet="projected" />
|
|
201
|
-
</span>
|
|
202
|
-
<span class="absolute inset-0 flex items-center justify-center">
|
|
203
|
-
<hlm-spinner [spinnerClass]="spinnerClass()" />
|
|
204
|
-
</span>
|
|
205
|
-
</div>
|
|
206
|
-
} @else {
|
|
207
|
-
<div class="flex items-center gap-1">
|
|
208
|
-
@if (icon() && iconPosition() === 'left') {
|
|
209
|
-
<ng-container *ngTemplateOutlet="icon()" />
|
|
210
|
-
}
|
|
211
|
-
<ng-container *ngTemplateOutlet="projected" />
|
|
212
|
-
@if (icon() && iconPosition() === 'right') {
|
|
213
|
-
<ng-container *ngTemplateOutlet="icon()" />
|
|
214
|
-
}
|
|
215
|
-
</div>
|
|
216
|
-
}
|
|
217
|
-
`, isInline: true, dependencies: [{ kind: "component", type: HlmSpinner, selector: "hlm-spinner", inputs: ["size", "show", "class", "spinnerClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
216
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
217
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: HlmButton, isStandalone: true, selector: "button[hlmButton], a[hlmButton]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconPosition: { classPropertyName: "iconPosition", publicName: "iconPosition", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, spinnerUserClass: { classPropertyName: "spinnerUserClass", publicName: "spinnerUserClass", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()", "attr.aria-busy": "loading() || null", "attr.disabled": "(loading() || disabled()) ? true : null", "attr.type": "type()" } }, hostDirectives: [{ directive: i1.BrnButton, inputs: ["disabled", "disabled"] }], ngImport: i0, template: "\n <ng-template #projected>\n <ng-content></ng-content>\n </ng-template>\n\n @if (loading()) {\n <div class=\"relative inline-flex items-center\">\n <span class=\"invisible\">\n <ng-container *ngTemplateOutlet=\"projected\" />\n </span>\n <span class=\"absolute inset-0 flex items-center justify-center\">\n <hlm-spinner [spinnerClass]=\"spinnerClass()\" />\n </span>\n </div>\n } @else {\n <div class=\"flex items-center gap-1\">\n @if (icon() && iconPosition() === 'left') {\n <ng-container *ngTemplateOutlet=\"icon()\" />\n }\n <ng-container *ngTemplateOutlet=\"projected\" />\n @if (icon() && iconPosition() === 'right') {\n <ng-container *ngTemplateOutlet=\"icon()\" />\n }\n </div>\n }\n ", isInline: true, dependencies: [{ kind: "component", type: HlmSpinner, selector: "hlm-spinner", inputs: ["size", "show", "class", "spinnerClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
218
218
|
}
|
|
219
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
219
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmButton, decorators: [{
|
|
220
220
|
type: Component,
|
|
221
221
|
args: [{
|
|
222
222
|
selector: 'button[hlmButton], a[hlmButton]',
|
|
@@ -229,45 +229,69 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
229
229
|
'[attr.disabled]': '(loading() || disabled()) ? true : null',
|
|
230
230
|
'[attr.type]': 'type()',
|
|
231
231
|
},
|
|
232
|
-
template:
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
</ng-template>
|
|
232
|
+
template: "\n <ng-template #projected>\n <ng-content></ng-content>\n </ng-template>\n\n @if (loading()) {\n <div class=\"relative inline-flex items-center\">\n <span class=\"invisible\">\n <ng-container *ngTemplateOutlet=\"projected\" />\n </span>\n <span class=\"absolute inset-0 flex items-center justify-center\">\n <hlm-spinner [spinnerClass]=\"spinnerClass()\" />\n </span>\n </div>\n } @else {\n <div class=\"flex items-center gap-1\">\n @if (icon() && iconPosition() === 'left') {\n <ng-container *ngTemplateOutlet=\"icon()\" />\n }\n <ng-container *ngTemplateOutlet=\"projected\" />\n @if (icon() && iconPosition() === 'right') {\n <ng-container *ngTemplateOutlet=\"icon()\" />\n }\n </div>\n }\n ",
|
|
233
|
+
}]
|
|
234
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconPosition", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], spinnerUserClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "spinnerUserClass", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }] } });
|
|
236
235
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
236
|
+
const defaultConfig = {
|
|
237
|
+
variant: 'default',
|
|
238
|
+
size: 'default',
|
|
239
|
+
};
|
|
240
|
+
const BrnButtonConfigToken = new InjectionToken('BrnButtonConfig');
|
|
241
|
+
function provideBrnButtonConfig(config) {
|
|
242
|
+
return { provide: BrnButtonConfigToken, useValue: { ...defaultConfig, ...config } };
|
|
243
|
+
}
|
|
244
|
+
function injectBrnButtonConfig() {
|
|
245
|
+
return inject(BrnButtonConfigToken, { optional: true }) ?? defaultConfig;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
class HlmBtn {
|
|
249
|
+
_config = injectBrnButtonConfig();
|
|
250
|
+
_additionalClasses = signal('', /* @ts-ignore */
|
|
251
|
+
...(ngDevMode ? [{ debugName: "_additionalClasses" }] : /* istanbul ignore next */ []));
|
|
252
|
+
variant = input(this._config.variant, /* @ts-ignore */
|
|
253
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
254
|
+
size = input(this._config.size, /* @ts-ignore */
|
|
255
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
256
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
257
|
+
type = input('button', /* @ts-ignore */
|
|
258
|
+
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
259
|
+
_computedClass = computed(() => hlm(buttonVariants({
|
|
260
|
+
variant: this.variant(),
|
|
261
|
+
size: this.size(),
|
|
262
|
+
}), this.userClass(), this._additionalClasses()), /* @ts-ignore */
|
|
263
|
+
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
264
|
+
setClass(classes) {
|
|
265
|
+
this._additionalClasses.set(classes);
|
|
256
266
|
}
|
|
257
|
-
|
|
267
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmBtn, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
268
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmBtn, isStandalone: true, selector: "button[hlmBtn], a[hlmBtn]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "button" }, properties: { "class": "_computedClass()", "attr.type": "type()" } }, exportAs: ["hlmBtn"], hostDirectives: [{ directive: i1.BrnButton, inputs: ["disabled", "disabled"] }], ngImport: i0 });
|
|
269
|
+
}
|
|
270
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmBtn, decorators: [{
|
|
271
|
+
type: Directive,
|
|
272
|
+
args: [{
|
|
273
|
+
selector: 'button[hlmBtn], a[hlmBtn]',
|
|
274
|
+
exportAs: 'hlmBtn',
|
|
275
|
+
standalone: true,
|
|
276
|
+
hostDirectives: [{ directive: BrnButton, inputs: ['disabled'] }],
|
|
277
|
+
host: {
|
|
278
|
+
'[class]': '_computedClass()',
|
|
279
|
+
'[attr.type]': 'type()',
|
|
280
|
+
'data-slot': 'button',
|
|
281
|
+
},
|
|
258
282
|
}]
|
|
259
|
-
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }],
|
|
283
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }] } });
|
|
260
284
|
|
|
261
285
|
/*
|
|
262
286
|
* Public API Surface of button
|
|
263
287
|
*/
|
|
264
|
-
const HlmButtonImports = [HlmButton];
|
|
288
|
+
const HlmButtonImports = [HlmButton, HlmBtn];
|
|
265
289
|
class HlmButtonModule {
|
|
266
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
267
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
268
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
290
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
291
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.3", ngImport: i0, type: HlmButtonModule, imports: [HlmButton, HlmBtn], exports: [HlmButton, HlmBtn] });
|
|
292
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmButtonModule, imports: [HlmButton] });
|
|
269
293
|
}
|
|
270
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
294
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmButtonModule, decorators: [{
|
|
271
295
|
type: NgModule,
|
|
272
296
|
args: [{
|
|
273
297
|
imports: [...HlmButtonImports],
|
|
@@ -279,5 +303,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
279
303
|
* Generated bundle index. Do not edit.
|
|
280
304
|
*/
|
|
281
305
|
|
|
282
|
-
export { HlmButton, HlmButtonImports, HlmButtonModule, buttonVariants };
|
|
283
|
-
|
|
306
|
+
export { HlmBtn, HlmButton, HlmButtonImports, HlmButtonModule, buttonVariants, injectBrnButtonConfig, provideBrnButtonConfig };
|
|
307
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "button",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^20.2.0 || ^22.0.0",
|
|
6
|
+
"@angular/core": "^20.2.0 || ^22.0.0",
|
|
7
|
+
"@spartan-ng/brain": "^0.0.1-alpha.512"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"tslib": "^2.3.0"
|
|
11
|
+
},
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"module": "fesm2022/button.mjs",
|
|
14
|
+
"typings": "types/button.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
"./package.json": {
|
|
17
|
+
"default": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./types/button.d.ts",
|
|
21
|
+
"default": "./fesm2022/button.mjs"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"type": "module"
|
|
25
|
+
}
|
|
@@ -1,13 +1,27 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import
|
|
3
|
-
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { TemplateRef, ValueProvider } from '@angular/core';
|
|
4
3
|
import { ClassValue } from 'clsx';
|
|
5
4
|
import * as i1 from '@spartan-ng/brain/button';
|
|
5
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
6
|
+
import { VariantProps } from 'class-variance-authority';
|
|
7
|
+
|
|
8
|
+
declare class HlmBtn {
|
|
9
|
+
private readonly _config;
|
|
10
|
+
private readonly _additionalClasses;
|
|
11
|
+
readonly variant: _angular_core.InputSignal<"default" | "primary" | "secondary" | "success" | "warning" | "danger" | "info" | "light" | "dark" | "accent" | "destructive" | "muted" | "outline" | "link" | "ghost" | null | undefined>;
|
|
12
|
+
readonly size: _angular_core.InputSignal<"default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | "compact-xs" | "compact-sm" | "compact-default" | "compact-lg" | "compact-icon" | null | undefined>;
|
|
13
|
+
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
14
|
+
readonly type: _angular_core.InputSignal<"button" | "submit" | "reset">;
|
|
15
|
+
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
16
|
+
setClass(classes: string): void;
|
|
17
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmBtn, never>;
|
|
18
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<HlmBtn, "button[hlmBtn], a[hlmBtn]", ["hlmBtn"], { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.BrnButton; inputs: { "disabled": "disabled"; }; outputs: {}; }]>;
|
|
19
|
+
}
|
|
6
20
|
|
|
7
21
|
declare const buttonVariants: (props?: ({
|
|
8
|
-
variant?: "primary" | "secondary" | "success" | "warning" | "danger" | "info" | "light" | "dark" | "accent" | "destructive" | "muted" | "link" | "ghost" | null | undefined;
|
|
9
|
-
size?: "xs" | "sm" | "
|
|
10
|
-
appearance?: "
|
|
22
|
+
variant?: "default" | "primary" | "secondary" | "success" | "warning" | "danger" | "info" | "light" | "dark" | "accent" | "destructive" | "muted" | "outline" | "link" | "ghost" | null | undefined;
|
|
23
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | "compact-xs" | "compact-sm" | "compact-default" | "compact-lg" | "compact-icon" | null | undefined;
|
|
24
|
+
appearance?: "outline" | "solid" | "outline-filled" | null | undefined;
|
|
11
25
|
loading?: boolean | null | undefined;
|
|
12
26
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
13
27
|
type ButtonVariants = VariantProps<typeof buttonVariants>;
|
|
@@ -20,7 +34,7 @@ declare class HlmButton {
|
|
|
20
34
|
readonly size: _angular_core.InputSignal<SizeType>;
|
|
21
35
|
readonly appearance: _angular_core.InputSignal<AppearanceType>;
|
|
22
36
|
readonly loading: _angular_core.InputSignal<boolean>;
|
|
23
|
-
readonly icon: _angular_core.InputSignal<
|
|
37
|
+
readonly icon: _angular_core.InputSignal<TemplateRef<unknown> | undefined>;
|
|
24
38
|
readonly iconPosition: _angular_core.InputSignal<"left" | "right">;
|
|
25
39
|
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
26
40
|
readonly spinnerUserClass: _angular_core.InputSignal<ClassValue>;
|
|
@@ -41,12 +55,19 @@ declare class HlmButton {
|
|
|
41
55
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmButton, "button[hlmButton], a[hlmButton]", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "iconPosition": { "alias": "iconPosition"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "spinnerUserClass": { "alias": "spinnerUserClass"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof i1.BrnButton; inputs: { "disabled": "disabled"; }; outputs: {}; }]>;
|
|
42
56
|
}
|
|
43
57
|
|
|
44
|
-
|
|
58
|
+
interface BrnButtonConfig {
|
|
59
|
+
variant: ButtonVariants['variant'];
|
|
60
|
+
size: ButtonVariants['size'];
|
|
61
|
+
}
|
|
62
|
+
declare function provideBrnButtonConfig(config: Partial<BrnButtonConfig>): ValueProvider;
|
|
63
|
+
declare function injectBrnButtonConfig(): BrnButtonConfig;
|
|
64
|
+
|
|
65
|
+
declare const HlmButtonImports: readonly [typeof HlmButton, typeof HlmBtn];
|
|
45
66
|
declare class HlmButtonModule {
|
|
46
67
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmButtonModule, never>;
|
|
47
|
-
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<HlmButtonModule, never, [typeof HlmButton], [typeof HlmButton]>;
|
|
68
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<HlmButtonModule, never, [typeof HlmButton, typeof HlmBtn], [typeof HlmButton, typeof HlmBtn]>;
|
|
48
69
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<HlmButtonModule>;
|
|
49
70
|
}
|
|
50
71
|
|
|
51
|
-
export { HlmButton, HlmButtonImports, HlmButtonModule, buttonVariants };
|
|
52
|
-
export type { AppearanceType, ButtonVariants, SizeType, VariantType };
|
|
72
|
+
export { HlmBtn, HlmButton, HlmButtonImports, HlmButtonModule, buttonVariants, injectBrnButtonConfig, provideBrnButtonConfig };
|
|
73
|
+
export type { AppearanceType, BrnButtonConfig, ButtonVariants, SizeType, VariantType };
|