@egose/shadcn-theme-ng 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 +27 -39
- package/alert/README.md +343 -34
- package/alert/fesm2022/alert.mjs +47 -47
- package/alert-dialog/README.md +471 -5
- package/alert-dialog/fesm2022/alert-dialog.mjs +47 -47
- 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 +53 -71
- package/avatar/README.md +357 -5
- package/avatar/fesm2022/avatar.mjs +32 -32
- package/badge/README.md +289 -34
- package/badge/fesm2022/badge.mjs +57 -57
- package/basic-alert/README.md +324 -34
- package/basic-alert/fesm2022/basic-alert.mjs +6 -18
- package/breadcrumb/README.md +406 -5
- package/breadcrumb/fesm2022/breadcrumb.mjs +33 -39
- package/button/README.md +453 -34
- package/button/fesm2022/button.mjs +147 -219
- 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 +29 -743
- package/card/README.md +331 -5
- package/card/fesm2022/card.mjs +33 -33
- package/carousel/README.md +333 -5
- package/carousel/fesm2022/carousel.mjs +39 -78
- package/checkbox/README.md +291 -34
- package/checkbox/fesm2022/checkbox.mjs +20 -58
- 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 +91 -224
- package/command/README.md +435 -5
- package/command/fesm2022/command.mjs +49 -109
- package/confirmation-dialog/README.md +272 -34
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs +15 -40
- package/confirmation-dialog/types/confirmation-dialog.d.ts +8 -4
- 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 +64 -267
- package/date-picker/types/date-picker.d.ts +7 -3
- package/dialog/README.md +419 -34
- package/dialog/fesm2022/dialog.mjs +45 -71
- package/drawer/README.md +395 -5
- package/drawer/fesm2022/drawer.mjs +44 -54
- package/dropdown-menu/README.md +417 -5
- package/dropdown-menu/fesm2022/dropdown-menu.mjs +82 -70
- package/dropdown-menu/types/dropdown-menu.d.ts +4 -0
- package/empty/README.md +329 -5
- package/empty/fesm2022/empty.mjs +30 -30
- package/field/README.md +385 -5
- package/field/fesm2022/field.mjs +56 -72
- package/form-checkbox/README.md +283 -34
- package/form-checkbox/fesm2022/form-checkbox.mjs +25 -85
- 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 +31 -84
- 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 +33 -19
- 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 +31 -91
- package/form-searchable-multiselect/types/form-searchable-multiselect.d.ts +7 -1
- package/form-select/README.md +321 -34
- package/form-select/fesm2022/form-select.mjs +32 -149
- 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 +35 -149
- 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 +34 -109
- 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 +34 -34
- package/input-otp/README.md +375 -5
- package/input-otp/fesm2022/input-otp.mjs +26 -26
- package/item/README.md +385 -5
- package/item/fesm2022/item.mjs +53 -53
- package/kbd/README.md +291 -5
- package/kbd/fesm2022/kbd.mjs +12 -12
- package/label/README.md +243 -34
- package/label/fesm2022/label.mjs +10 -10
- package/label/types/label.d.ts +1 -1
- package/layout-simple/README.md +174 -44
- package/layout-simple/fesm2022/layout-simple.mjs +508 -603
- package/layout-simple/types/layout-simple.d.ts +179 -128
- package/menu/README.md +418 -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 +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 +35 -47
- package/package.json +183 -154
- package/pagination/README.md +388 -5
- package/pagination/fesm2022/pagination.mjs +45 -331
- 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/radio-group/types/radio-group.d.ts +1 -1
- package/resizable/README.md +269 -5
- package/resizable/fesm2022/resizable.mjs +18 -26
- 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 +28 -117
- package/searchable-multiselect/types/searchable-multiselect.d.ts +8 -2
- package/select/README.md +408 -34
- package/select/fesm2022/select.mjs +71 -111
- 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 +41 -53
- package/sidebar/README.md +457 -5
- package/sidebar/fesm2022/sidebar.mjs +125 -227
- package/skeleton/README.md +217 -5
- package/skeleton/fesm2022/skeleton.mjs +9 -9
- package/slider/README.md +273 -5
- package/slider/fesm2022/slider.mjs +10 -80
- package/sonner/README.md +317 -34
- package/sonner/fesm2022/sonner.mjs +13 -13
- package/spinner/README.md +255 -34
- package/spinner/fesm2022/spinner.mjs +11 -11
- package/switch/README.md +281 -34
- package/switch/fesm2022/switch.mjs +13 -15
- package/table/README.md +423 -5
- package/table/fesm2022/table.mjs +41 -41
- package/tabs/README.md +382 -34
- package/tabs/fesm2022/tabs.mjs +35 -111
- package/textarea/README.md +282 -5
- package/textarea/fesm2022/textarea.mjs +9 -9
- package/toggle/README.md +270 -5
- package/toggle/fesm2022/toggle.mjs +13 -13
- 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 +19 -19
- 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
|
@@ -7,73 +7,145 @@ import { NgTemplateOutlet } from '@angular/common';
|
|
|
7
7
|
import { HlmSpinner } from '@egose/shadcn-theme-ng/spinner';
|
|
8
8
|
import { cva } from 'class-variance-authority';
|
|
9
9
|
|
|
10
|
+
// Keep complete utility names here so consumer Tailwind builds can discover every tone.
|
|
11
|
+
const toneTextClasses = {
|
|
12
|
+
default: "text-primary",
|
|
13
|
+
primary: "text-primary",
|
|
14
|
+
secondary: "text-secondary",
|
|
15
|
+
success: "text-success",
|
|
16
|
+
warning: "text-warning",
|
|
17
|
+
danger: "text-danger",
|
|
18
|
+
info: "text-info",
|
|
19
|
+
light: "text-light-foreground",
|
|
20
|
+
dark: "text-dark",
|
|
21
|
+
accent: "text-accent",
|
|
22
|
+
destructive: "text-destructive",
|
|
23
|
+
muted: "text-muted-foreground",
|
|
24
|
+
outline: "text-primary",
|
|
25
|
+
link: "text-primary",
|
|
26
|
+
ghost: "text-light-foreground",
|
|
27
|
+
};
|
|
28
|
+
const outlineClasses = {
|
|
29
|
+
default: "border-primary hover:bg-primary/10",
|
|
30
|
+
primary: "border-primary hover:bg-primary/10",
|
|
31
|
+
secondary: "border-secondary hover:bg-secondary/10",
|
|
32
|
+
success: "border-success hover:bg-success/10",
|
|
33
|
+
warning: "border-warning hover:bg-warning/10",
|
|
34
|
+
danger: "border-danger hover:bg-danger/10",
|
|
35
|
+
info: "border-info hover:bg-info/10",
|
|
36
|
+
light: "border-light hover:bg-light/10",
|
|
37
|
+
dark: "border-dark hover:bg-dark/10",
|
|
38
|
+
accent: "border-accent hover:bg-accent/10",
|
|
39
|
+
destructive: "border-destructive hover:bg-destructive/10",
|
|
40
|
+
muted: "border-muted hover:bg-muted/10",
|
|
41
|
+
outline: "border-primary hover:bg-primary/10",
|
|
42
|
+
link: '',
|
|
43
|
+
ghost: '',
|
|
44
|
+
};
|
|
45
|
+
const outlineFilledClasses = {
|
|
46
|
+
default: "hover:bg-primary hover:text-primary-foreground",
|
|
47
|
+
primary: "hover:bg-primary hover:text-primary-foreground",
|
|
48
|
+
secondary: "hover:bg-secondary hover:text-secondary-foreground",
|
|
49
|
+
success: "hover:bg-success hover:text-success-foreground",
|
|
50
|
+
warning: "hover:bg-warning hover:text-warning-foreground",
|
|
51
|
+
danger: "hover:bg-danger hover:text-danger-foreground",
|
|
52
|
+
info: "hover:bg-info hover:text-info-foreground",
|
|
53
|
+
light: "hover:bg-light hover:text-light-foreground",
|
|
54
|
+
dark: "hover:bg-dark hover:text-dark-foreground",
|
|
55
|
+
accent: "hover:bg-accent hover:text-accent-foreground",
|
|
56
|
+
destructive: "hover:bg-destructive hover:text-destructive-foreground",
|
|
57
|
+
muted: "hover:bg-muted hover:text-muted-foreground",
|
|
58
|
+
outline: "hover:bg-primary hover:text-primary-foreground",
|
|
59
|
+
link: "hover:underline",
|
|
60
|
+
ghost: "hover:bg-light",
|
|
61
|
+
};
|
|
62
|
+
/** Semantic color utilities and appearances. Merge the result with hlm() for custom hosts. */
|
|
10
63
|
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
|
-
|
|
64
|
+
"cursor-pointer",
|
|
65
|
+
"active:translate-y-[0.5px]",
|
|
66
|
+
"disabled:pointer-events-none",
|
|
67
|
+
"disabled:opacity-50",
|
|
68
|
+
"focus-visible:outline-none",
|
|
69
|
+
"focus-visible:ring-1",
|
|
70
|
+
"focus-visible:ring-ring",
|
|
71
|
+
"font-medium",
|
|
72
|
+
"gap-2",
|
|
73
|
+
"inline-flex",
|
|
74
|
+
"items-center",
|
|
75
|
+
"justify-center",
|
|
76
|
+
"rounded-sm",
|
|
77
|
+
"text-sm",
|
|
78
|
+
"transform",
|
|
79
|
+
"transition",
|
|
80
|
+
"transition-colors",
|
|
81
|
+
"whitespace-nowrap",
|
|
82
|
+
"[&_svg]:pointer-events-none",
|
|
83
|
+
"[&_svg]:shrink-0",
|
|
84
|
+
"[&_svg]:size-4",
|
|
85
|
+
"no-underline",
|
|
33
86
|
], {
|
|
34
87
|
variants: {
|
|
35
88
|
variant: {
|
|
36
|
-
default:
|
|
37
|
-
primary:
|
|
38
|
-
secondary:
|
|
39
|
-
success:
|
|
40
|
-
warning:
|
|
41
|
-
danger:
|
|
42
|
-
info:
|
|
43
|
-
light:
|
|
44
|
-
dark:
|
|
45
|
-
accent:
|
|
46
|
-
destructive:
|
|
47
|
-
muted:
|
|
48
|
-
outline:
|
|
49
|
-
link:
|
|
50
|
-
ghost:
|
|
89
|
+
default: "border border-primary bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",
|
|
90
|
+
primary: "border border-primary bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",
|
|
91
|
+
secondary: "border border-secondary bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/90",
|
|
92
|
+
success: "border border-success bg-success text-success-foreground shadow-sm hover:bg-success/90",
|
|
93
|
+
warning: "border border-warning bg-warning text-warning-foreground shadow-sm hover:bg-warning/90",
|
|
94
|
+
danger: "border border-danger bg-danger text-danger-foreground shadow-sm hover:bg-danger/90",
|
|
95
|
+
info: "border border-info bg-info text-info-foreground shadow-sm hover:bg-info/90",
|
|
96
|
+
light: "border border-light bg-light text-light-foreground shadow-sm hover:bg-light/90",
|
|
97
|
+
dark: "border border-dark bg-dark text-dark-foreground shadow-sm hover:bg-dark/90",
|
|
98
|
+
accent: "border border-accent bg-accent text-accent-foreground shadow-sm hover:bg-accent/90",
|
|
99
|
+
destructive: "border border-destructive bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
100
|
+
muted: "border border-muted bg-muted text-muted-foreground shadow-sm hover:bg-muted/90",
|
|
101
|
+
outline: "border border-primary bg-background text-primary shadow-sm hover:bg-primary/10",
|
|
102
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
103
|
+
ghost: "hover:bg-light hover:text-light-foreground",
|
|
51
104
|
},
|
|
52
105
|
size: {
|
|
53
|
-
xs:
|
|
54
|
-
sm:
|
|
55
|
-
default:
|
|
56
|
-
lg:
|
|
57
|
-
icon:
|
|
58
|
-
'icon-xs':
|
|
59
|
-
'icon-sm':
|
|
60
|
-
'icon-lg':
|
|
61
|
-
'compact-xs':
|
|
62
|
-
'compact-sm':
|
|
63
|
-
'compact-default':
|
|
64
|
-
'compact-lg':
|
|
65
|
-
'compact-icon':
|
|
106
|
+
xs: "h-7 rounded-xs px-2 text-xs",
|
|
107
|
+
sm: "h-8 rounded-sm px-3",
|
|
108
|
+
default: "h-9 px-4 py-2",
|
|
109
|
+
lg: "h-10 rounded-sm px-7 text-base",
|
|
110
|
+
icon: "h-9 w-9",
|
|
111
|
+
'icon-xs': "h-6 w-6 rounded-xs",
|
|
112
|
+
'icon-sm': "h-8 w-8 rounded-sm",
|
|
113
|
+
'icon-lg': "h-10 w-10 rounded-sm",
|
|
114
|
+
'compact-xs': "h-6 px-2 py-1 text-xs",
|
|
115
|
+
'compact-sm': "h-7 px-2 py-1",
|
|
116
|
+
'compact-default': "h-8 px-2 py-1",
|
|
117
|
+
'compact-lg': "h-9 px-2 py-1 text-base",
|
|
118
|
+
'compact-icon': "h-8 w-8",
|
|
66
119
|
},
|
|
67
120
|
appearance: {
|
|
68
121
|
solid: '',
|
|
69
|
-
outline:
|
|
70
|
-
'outline-filled':
|
|
122
|
+
outline: "bg-background border shadow-sm",
|
|
123
|
+
'outline-filled': "bg-background border shadow-sm",
|
|
124
|
+
ghost: "bg-transparent border-0 shadow-none",
|
|
125
|
+
link: "bg-transparent border-0 shadow-none hover:bg-transparent underline-offset-4 hover:underline",
|
|
71
126
|
},
|
|
72
127
|
loading: {
|
|
73
|
-
true:
|
|
128
|
+
true: "pointer-events-none",
|
|
74
129
|
false: null,
|
|
75
130
|
},
|
|
76
131
|
},
|
|
132
|
+
compoundVariants: Object.keys(toneTextClasses).flatMap((variant) => [
|
|
133
|
+
{
|
|
134
|
+
variant,
|
|
135
|
+
appearance: ['outline', 'outline-filled', 'ghost', 'link'],
|
|
136
|
+
class: toneTextClasses[variant],
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
variant,
|
|
140
|
+
appearance: ['outline', 'outline-filled', 'ghost'],
|
|
141
|
+
class: outlineClasses[variant],
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
variant,
|
|
145
|
+
appearance: 'outline-filled',
|
|
146
|
+
class: outlineFilledClasses[variant],
|
|
147
|
+
},
|
|
148
|
+
]),
|
|
77
149
|
defaultVariants: {
|
|
78
150
|
variant: 'primary',
|
|
79
151
|
size: 'default',
|
|
@@ -82,11 +154,12 @@ const buttonVariants = cva([
|
|
|
82
154
|
},
|
|
83
155
|
});
|
|
84
156
|
class HlmButton {
|
|
85
|
-
/**
|
|
157
|
+
/** Semantic color token. Legacy default, outline, link, and ghost variants remain supported. */
|
|
86
158
|
variant = input('primary', /* @ts-ignore */
|
|
87
159
|
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
88
160
|
size = input('default', /* @ts-ignore */
|
|
89
161
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
162
|
+
/** Visual treatment independent of color: solid, outline, outline-filled, ghost, or link. */
|
|
90
163
|
appearance = input('solid', /* @ts-ignore */
|
|
91
164
|
...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
|
|
92
165
|
loading = input(false, /* @ts-ignore */
|
|
@@ -105,143 +178,23 @@ class HlmButton {
|
|
|
105
178
|
_additionalClasses = signal('', /* @ts-ignore */
|
|
106
179
|
...(ngDevMode ? [{ debugName: "_additionalClasses" }] : /* istanbul ignore next */ []));
|
|
107
180
|
/** Computed button class merging */
|
|
108
|
-
_computedClass = computed(() => {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
return hlm(buttonVariants({
|
|
116
|
-
variant: this.variant(),
|
|
117
|
-
size: this.size(),
|
|
118
|
-
appearance: this.appearance(),
|
|
119
|
-
loading: this.loading(),
|
|
120
|
-
className: this.userClass(),
|
|
121
|
-
}), outlineClasses, this.loading() ? 'pointer-events-none' : '', this._additionalClasses());
|
|
122
|
-
}, /* @ts-ignore */
|
|
181
|
+
_computedClass = computed(() => hlm(buttonVariants({
|
|
182
|
+
variant: this.variant(),
|
|
183
|
+
size: this.size(),
|
|
184
|
+
appearance: this.appearance(),
|
|
185
|
+
loading: this.loading(),
|
|
186
|
+
}), this.userClass(), this.loading() ? "pointer-events-none" : '', this._additionalClasses()), /* @ts-ignore */
|
|
123
187
|
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
124
|
-
/**
|
|
125
|
-
spinnerClass = computed(() =>
|
|
126
|
-
const base = this.appearance() === 'outline' || this.appearance() === 'outline-filled'
|
|
127
|
-
? this.getOutlineSpinnerClasses(this.variant())
|
|
128
|
-
: this.getSpinnerClasses(this.variant());
|
|
129
|
-
return hlm(base, this.spinnerUserClass());
|
|
130
|
-
}, /* @ts-ignore */
|
|
188
|
+
/** Inherit the button's resolved text color, including theme and consumer overrides. */
|
|
189
|
+
spinnerClass = computed(() => hlm("[&>svg]:text-current", this.spinnerUserClass()), /* @ts-ignore */
|
|
131
190
|
...(ngDevMode ? [{ debugName: "spinnerClass" }] : /* istanbul ignore next */ []));
|
|
132
191
|
setClass(classes) {
|
|
133
192
|
this._additionalClasses.set(classes);
|
|
134
193
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
const colors = {
|
|
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',
|
|
153
|
-
};
|
|
154
|
-
return colors[variant];
|
|
155
|
-
}
|
|
156
|
-
getOutlineFilledClasses(variant) {
|
|
157
|
-
const colors = {
|
|
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',
|
|
173
|
-
};
|
|
174
|
-
return colors[variant];
|
|
175
|
-
}
|
|
176
|
-
getSpinnerClasses(variant) {
|
|
177
|
-
const colors = {
|
|
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',
|
|
193
|
-
};
|
|
194
|
-
return colors[variant];
|
|
195
|
-
}
|
|
196
|
-
getOutlineSpinnerClasses(variant) {
|
|
197
|
-
const colors = {
|
|
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',
|
|
213
|
-
};
|
|
214
|
-
return colors[variant];
|
|
215
|
-
}
|
|
216
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HlmButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
217
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", 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: `
|
|
218
|
-
<ng-template #projected>
|
|
219
|
-
<ng-content></ng-content>
|
|
220
|
-
</ng-template>
|
|
221
|
-
|
|
222
|
-
@if (loading()) {
|
|
223
|
-
<div class="relative inline-flex items-center">
|
|
224
|
-
<span class="invisible">
|
|
225
|
-
<ng-container *ngTemplateOutlet="projected" />
|
|
226
|
-
</span>
|
|
227
|
-
<span class="absolute inset-0 flex items-center justify-center">
|
|
228
|
-
<hlm-spinner [spinnerClass]="spinnerClass()" />
|
|
229
|
-
</span>
|
|
230
|
-
</div>
|
|
231
|
-
} @else {
|
|
232
|
-
<div class="flex items-center gap-1">
|
|
233
|
-
@if (icon() && iconPosition() === 'left') {
|
|
234
|
-
<ng-container *ngTemplateOutlet="icon()" />
|
|
235
|
-
}
|
|
236
|
-
<ng-container *ngTemplateOutlet="projected" />
|
|
237
|
-
@if (icon() && iconPosition() === 'right') {
|
|
238
|
-
<ng-container *ngTemplateOutlet="icon()" />
|
|
239
|
-
}
|
|
240
|
-
</div>
|
|
241
|
-
}
|
|
242
|
-
`, 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"] }] });
|
|
194
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
195
|
+
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"] }] });
|
|
243
196
|
}
|
|
244
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
197
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmButton, decorators: [{
|
|
245
198
|
type: Component,
|
|
246
199
|
args: [{
|
|
247
200
|
selector: 'button[hlmButton], a[hlmButton]',
|
|
@@ -254,32 +207,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
254
207
|
'[attr.disabled]': '(loading() || disabled()) ? true : null',
|
|
255
208
|
'[attr.type]': 'type()',
|
|
256
209
|
},
|
|
257
|
-
template:
|
|
258
|
-
<ng-template #projected>
|
|
259
|
-
<ng-content></ng-content>
|
|
260
|
-
</ng-template>
|
|
261
|
-
|
|
262
|
-
@if (loading()) {
|
|
263
|
-
<div class="relative inline-flex items-center">
|
|
264
|
-
<span class="invisible">
|
|
265
|
-
<ng-container *ngTemplateOutlet="projected" />
|
|
266
|
-
</span>
|
|
267
|
-
<span class="absolute inset-0 flex items-center justify-center">
|
|
268
|
-
<hlm-spinner [spinnerClass]="spinnerClass()" />
|
|
269
|
-
</span>
|
|
270
|
-
</div>
|
|
271
|
-
} @else {
|
|
272
|
-
<div class="flex items-center gap-1">
|
|
273
|
-
@if (icon() && iconPosition() === 'left') {
|
|
274
|
-
<ng-container *ngTemplateOutlet="icon()" />
|
|
275
|
-
}
|
|
276
|
-
<ng-container *ngTemplateOutlet="projected" />
|
|
277
|
-
@if (icon() && iconPosition() === 'right') {
|
|
278
|
-
<ng-container *ngTemplateOutlet="icon()" />
|
|
279
|
-
}
|
|
280
|
-
</div>
|
|
281
|
-
}
|
|
282
|
-
`,
|
|
210
|
+
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 ",
|
|
283
211
|
}]
|
|
284
212
|
}], 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 }] }] } });
|
|
285
213
|
|
|
@@ -314,10 +242,10 @@ class HlmBtn {
|
|
|
314
242
|
setClass(classes) {
|
|
315
243
|
this._additionalClasses.set(classes);
|
|
316
244
|
}
|
|
317
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
318
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.
|
|
245
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmBtn, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
246
|
+
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 });
|
|
319
247
|
}
|
|
320
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
248
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmBtn, decorators: [{
|
|
321
249
|
type: Directive,
|
|
322
250
|
args: [{
|
|
323
251
|
selector: 'button[hlmBtn], a[hlmBtn]',
|
|
@@ -337,11 +265,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
337
265
|
*/
|
|
338
266
|
const HlmButtonImports = [HlmButton, HlmBtn];
|
|
339
267
|
class HlmButtonModule {
|
|
340
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
341
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.
|
|
342
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.
|
|
268
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
269
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.3", ngImport: i0, type: HlmButtonModule, imports: [HlmButton, HlmBtn], exports: [HlmButton, HlmBtn] });
|
|
270
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmButtonModule, imports: [HlmButton] });
|
|
343
271
|
}
|
|
344
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
272
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmButtonModule, decorators: [{
|
|
345
273
|
type: NgModule,
|
|
346
274
|
args: [{
|
|
347
275
|
imports: [...HlmButtonImports],
|
|
@@ -354,4 +282,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
354
282
|
*/
|
|
355
283
|
|
|
356
284
|
export { HlmBtn, HlmButton, HlmButtonImports, HlmButtonModule, buttonVariants, injectBrnButtonConfig, provideBrnButtonConfig };
|
|
357
|
-
|
|
285
|
+
|
package/button/types/button.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { ValueProvider } from '@angular/core';
|
|
2
|
+
import { TemplateRef, ValueProvider } from '@angular/core';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
import * as i1 from '@spartan-ng/brain/button';
|
|
5
5
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
@@ -18,10 +18,11 @@ declare class HlmBtn {
|
|
|
18
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
19
|
}
|
|
20
20
|
|
|
21
|
+
/** Semantic color utilities and appearances. Merge the result with hlm() for custom hosts. */
|
|
21
22
|
declare const buttonVariants: (props?: ({
|
|
22
23
|
variant?: "default" | "primary" | "secondary" | "success" | "warning" | "danger" | "info" | "light" | "dark" | "accent" | "destructive" | "muted" | "outline" | "link" | "ghost" | null | undefined;
|
|
23
24
|
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;
|
|
25
|
+
appearance?: "outline" | "link" | "ghost" | "solid" | "outline-filled" | null | undefined;
|
|
25
26
|
loading?: boolean | null | undefined;
|
|
26
27
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
27
28
|
type ButtonVariants = VariantProps<typeof buttonVariants>;
|
|
@@ -29,12 +30,13 @@ type VariantType = NonNullable<ButtonVariants['variant']>;
|
|
|
29
30
|
type SizeType = NonNullable<ButtonVariants['size']>;
|
|
30
31
|
type AppearanceType = NonNullable<ButtonVariants['appearance']>;
|
|
31
32
|
declare class HlmButton {
|
|
32
|
-
/**
|
|
33
|
+
/** Semantic color token. Legacy default, outline, link, and ghost variants remain supported. */
|
|
33
34
|
readonly variant: _angular_core.InputSignal<VariantType>;
|
|
34
35
|
readonly size: _angular_core.InputSignal<SizeType>;
|
|
36
|
+
/** Visual treatment independent of color: solid, outline, outline-filled, ghost, or link. */
|
|
35
37
|
readonly appearance: _angular_core.InputSignal<AppearanceType>;
|
|
36
38
|
readonly loading: _angular_core.InputSignal<boolean>;
|
|
37
|
-
readonly icon: _angular_core.InputSignal<
|
|
39
|
+
readonly icon: _angular_core.InputSignal<TemplateRef<unknown> | undefined>;
|
|
38
40
|
readonly iconPosition: _angular_core.InputSignal<"left" | "right">;
|
|
39
41
|
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
40
42
|
readonly spinnerUserClass: _angular_core.InputSignal<ClassValue>;
|
|
@@ -43,14 +45,9 @@ declare class HlmButton {
|
|
|
43
45
|
private readonly _additionalClasses;
|
|
44
46
|
/** Computed button class merging */
|
|
45
47
|
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
46
|
-
/**
|
|
48
|
+
/** Inherit the button's resolved text color, including theme and consumer overrides. */
|
|
47
49
|
protected readonly spinnerClass: _angular_core.Signal<string>;
|
|
48
50
|
setClass(classes: string): void;
|
|
49
|
-
/** Helper functions */
|
|
50
|
-
private getOutlineClasses;
|
|
51
|
-
private getOutlineFilledClasses;
|
|
52
|
-
private getSpinnerClasses;
|
|
53
|
-
private getOutlineSpinnerClasses;
|
|
54
51
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmButton, never>;
|
|
55
52
|
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: {}; }]>;
|
|
56
53
|
}
|