@spartan-ng/cli 0.0.1-alpha.717 → 0.0.1-alpha.719
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/generators/base/generator.d.ts +1 -0
- package/src/generators/base/generator.js +96 -0
- package/src/generators/base/generator.js.map +1 -1
- package/src/generators/base/lib/build-dependency-array.js +13 -0
- package/src/generators/base/lib/build-dependency-array.js.map +1 -1
- package/src/generators/base/versions.d.ts +1 -1
- package/src/generators/base/versions.js +1 -1
- package/src/generators/healthcheck/healthchecks/version.js +5 -1
- package/src/generators/healthcheck/healthchecks/version.js.map +1 -1
- package/src/generators/migrate-helm-libraries/generator.js +26 -7
- package/src/generators/migrate-helm-libraries/generator.js.map +1 -1
- package/src/generators/migrate-icon/generator.js +1 -1
- package/src/generators/migrate-icon/generator.js.map +1 -1
- package/src/generators/migrate-naming-convention/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/generators/migrate-scroll-area/generator.js +1 -1
- package/src/generators/migrate-scroll-area/generator.js.map +1 -1
- package/src/generators/ui/libs/avatar/files/lib/hlm-avatar-badge.ts.template +2 -2
- package/src/generators/ui/libs/breadcrumb/files/lib/hlm-breadcrumb-ellipsis.ts.template +9 -4
- package/src/generators/ui/libs/calendar/files/lib/hlm-calendar-multi.ts.template +134 -183
- package/src/generators/ui/libs/calendar/files/lib/hlm-calendar-range.ts.template +133 -176
- package/src/generators/ui/libs/calendar/files/lib/hlm-calendar.ts.template +121 -169
- package/src/generators/ui/libs/carousel/files/lib/hlm-carousel-next.ts.template +3 -4
- package/src/generators/ui/libs/carousel/files/lib/hlm-carousel-previous.ts.template +3 -4
- package/src/generators/ui/libs/checkbox/files/lib/hlm-checkbox.ts.template +3 -4
- package/src/generators/ui/libs/date-picker/files/lib/hlm-date-picker-multi.ts.template +1 -1
- package/src/generators/ui/libs/date-picker/files/lib/hlm-date-picker.ts.template +1 -1
- package/src/generators/ui/libs/date-picker/files/lib/hlm-date-range-picker.ts.template +1 -1
- package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-content.ts.template +4 -4
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-item-sub-indicator.ts.template +1 -1
- package/src/generators/ui/libs/input-otp/files/lib/hlm-input-otp-separator.ts.template +2 -3
- package/src/generators/ui/libs/sheet/files/lib/hlm-sheet-content.ts.template +4 -4
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-button.ts.template +1 -1
- package/src/generators/ui/libs/spinner/files/lib/hlm-spinner.ts.template +1 -1
- package/src/generators/ui/libs/tabs/files/lib/hlm-tabs-paginated-list.ts.template +7 -8
- package/src/generators/ui/libs/utils/files/index.ts.template +1 -0
- package/src/generators/ui/libs/utils/files/lib/provide-spartan-hlm.ts.template +34 -0
- package/src/generators/ui/primitive-deps.js +19 -20
- package/src/generators/ui/primitive-deps.js.map +1 -1
- package/src/generators/ui/primitives.d.ts +1 -1
- package/src/generators/ui/style-luma.css +43 -47
- package/src/generators/ui/style-lyra.css +44 -48
- package/src/generators/ui/style-maia.css +43 -47
- package/src/generators/ui/style-mira.css +48 -52
- package/src/generators/ui/style-nova.css +45 -49
- package/src/generators/ui/style-vega.css +43 -47
- package/src/generators/ui/supported-ui-libraries.json +43 -52
- package/src/utils/string-change.d.ts +26 -0
- package/src/utils/string-change.js +84 -0
- package/src/utils/string-change.js.map +1 -0
- package/src/generators/ui/libs/icon/files/index.ts.template +0 -7
- package/src/generators/ui/libs/icon/files/lib/hlm-icon.token.ts.template +0 -20
- package/src/generators/ui/libs/icon/files/lib/hlm-icon.ts.template +0 -35
- package/src/generators/ui/libs/icon/generator.d.ts +0 -3
- package/src/generators/ui/libs/icon/generator.js +0 -9
- package/src/generators/ui/libs/icon/generator.js.map +0 -1
|
@@ -1,197 +1,146 @@
|
|
|
1
|
-
import type { BooleanInput, NumberInput } from '@angular/cdk/coercion';
|
|
2
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
3
|
-
import {
|
|
4
|
-
booleanAttribute,
|
|
5
|
-
ChangeDetectionStrategy,
|
|
6
|
-
Component,
|
|
7
|
-
computed,
|
|
8
|
-
input,
|
|
9
|
-
model,
|
|
10
|
-
numberAttribute,
|
|
11
|
-
viewChild,
|
|
12
|
-
} from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';
|
|
13
3
|
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
14
4
|
import { lucideChevronLeft, lucideChevronRight } from '@ng-icons/lucide';
|
|
15
|
-
import { BrnCalendar, BrnCalendarImports, injectBrnCalendarI18n
|
|
5
|
+
import { BrnCalendar, BrnCalendarImports, injectBrnCalendarI18n } from '@spartan-ng/brain/calendar';
|
|
16
6
|
import { injectDateAdapter } from '@spartan-ng/brain/date-time';
|
|
17
|
-
import { buttonVariants } from '<%- importAlias %>/button';
|
|
18
|
-
import { HlmIcon } from '<%- importAlias %>/icon';
|
|
7
|
+
import { buttonVariants, HlmButtonImports } from '<%- importAlias %>/button';
|
|
19
8
|
import { HlmSelectImports } from '<%- importAlias %>/select';
|
|
20
|
-
import { hlm } from '<%- importAlias %>/utils';
|
|
21
|
-
import type { ClassValue } from 'clsx';
|
|
9
|
+
import { classes, hlm } from '<%- importAlias %>/utils';
|
|
22
10
|
|
|
23
11
|
@Component({
|
|
24
12
|
selector: 'hlm-calendar',
|
|
25
|
-
imports: [BrnCalendarImports, NgIcon,
|
|
13
|
+
imports: [BrnCalendarImports, NgIcon, HlmSelectImports, NgTemplateOutlet, HlmButtonImports],
|
|
26
14
|
viewProviders: [provideIcons({ lucideChevronLeft, lucideChevronRight })],
|
|
27
15
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
16
|
+
hostDirectives: [
|
|
17
|
+
{
|
|
18
|
+
directive: BrnCalendar,
|
|
19
|
+
inputs: ['min', 'max', 'disabled', 'date', 'dateDisabled', 'weekStartsOn', 'highlightDays', 'defaultFocusedDate'],
|
|
20
|
+
outputs: ['dateChange'],
|
|
21
|
+
},
|
|
22
|
+
],
|
|
28
23
|
host: { 'data-slot': 'calendar' },
|
|
29
24
|
template: `
|
|
30
|
-
<div
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<div class="inline-flex flex-col space-y-4">
|
|
43
|
-
<!-- Header -->
|
|
44
|
-
<div class="space-y-4">
|
|
45
|
-
<div class="relative flex items-center justify-center pt-1">
|
|
46
|
-
<div class="flex w-full items-center justify-center gap-1.5">
|
|
47
|
-
<ng-template #month>
|
|
48
|
-
<hlm-select brnCalendarMonthSelect>
|
|
49
|
-
<hlm-select-trigger size="sm" [class]="_selectClass">
|
|
50
|
-
<hlm-select-value />
|
|
51
|
-
</hlm-select-trigger>
|
|
52
|
-
<hlm-select-content *hlmSelectPortal class="max-h-80">
|
|
53
|
-
<hlm-select-group>
|
|
54
|
-
@for (month of _i18n.config().months(); track month) {
|
|
55
|
-
<hlm-select-item [value]="month">{{ month }}</hlm-select-item>
|
|
56
|
-
}
|
|
57
|
-
</hlm-select-group>
|
|
58
|
-
</hlm-select-content>
|
|
59
|
-
</hlm-select>
|
|
60
|
-
</ng-template>
|
|
61
|
-
<ng-template #year>
|
|
62
|
-
<hlm-select brnCalendarYearSelect>
|
|
63
|
-
<hlm-select-trigger size="sm" [class]="_selectClass">
|
|
64
|
-
<hlm-select-value />
|
|
65
|
-
</hlm-select-trigger>
|
|
66
|
-
<hlm-select-content *hlmSelectPortal class="max-h-80">
|
|
67
|
-
<hlm-select-group>
|
|
68
|
-
@for (year of _i18n.config().years(); track year) {
|
|
69
|
-
<hlm-select-item [value]="year">{{ year }}</hlm-select-item>
|
|
70
|
-
}
|
|
71
|
-
</hlm-select-group>
|
|
72
|
-
</hlm-select-content>
|
|
73
|
-
</hlm-select>
|
|
74
|
-
</ng-template>
|
|
75
|
-
@let heading = _heading();
|
|
76
|
-
@switch (captionLayout()) {
|
|
77
|
-
@case ('dropdown') {
|
|
78
|
-
<ng-container [ngTemplateOutlet]="month" />
|
|
79
|
-
<ng-container [ngTemplateOutlet]="year" />
|
|
25
|
+
<div class="inline-flex flex-col gap-4">
|
|
26
|
+
<!-- Header -->
|
|
27
|
+
<div class="flex w-full items-center justify-between gap-1.5">
|
|
28
|
+
<ng-template #month>
|
|
29
|
+
<hlm-select brnCalendarMonthSelect class="order-1">
|
|
30
|
+
<hlm-select-trigger size="sm" [class]="_selectClass">
|
|
31
|
+
<hlm-select-value />
|
|
32
|
+
</hlm-select-trigger>
|
|
33
|
+
<hlm-select-content *hlmSelectPortal class="max-h-80">
|
|
34
|
+
<hlm-select-group>
|
|
35
|
+
@for (month of _i18n.config().months(); track month) {
|
|
36
|
+
<hlm-select-item [value]="month">{{ month }}</hlm-select-item>
|
|
80
37
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
38
|
+
</hlm-select-group>
|
|
39
|
+
</hlm-select-content>
|
|
40
|
+
</hlm-select>
|
|
41
|
+
</ng-template>
|
|
42
|
+
<ng-template #year>
|
|
43
|
+
<hlm-select brnCalendarYearSelect class="order-3">
|
|
44
|
+
<hlm-select-trigger size="sm" [class]="_selectClass">
|
|
45
|
+
<hlm-select-value />
|
|
46
|
+
</hlm-select-trigger>
|
|
47
|
+
<hlm-select-content *hlmSelectPortal class="max-h-80">
|
|
48
|
+
<hlm-select-group>
|
|
49
|
+
@for (year of _i18n.config().years(); track year) {
|
|
50
|
+
<hlm-select-item [value]="year">{{ year }}</hlm-select-item>
|
|
84
51
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
52
|
+
</hlm-select-group>
|
|
53
|
+
</hlm-select-content>
|
|
54
|
+
</hlm-select>
|
|
55
|
+
</ng-template>
|
|
56
|
+
@let heading = _heading();
|
|
57
|
+
|
|
58
|
+
<button
|
|
59
|
+
brnCalendarPreviousButton
|
|
60
|
+
variant="ghost"
|
|
61
|
+
hlmBtn
|
|
62
|
+
class="order-first size-(--cell-size) p-0 select-none aria-disabled:opacity-50"
|
|
63
|
+
>
|
|
64
|
+
<ng-icon name="lucideChevronLeft" class="rtl:rotate-180" />
|
|
65
|
+
</button>
|
|
66
|
+
|
|
67
|
+
@switch (captionLayout()) {
|
|
68
|
+
@case ('dropdown') {
|
|
69
|
+
<ng-container [ngTemplateOutlet]="month" />
|
|
70
|
+
<ng-container [ngTemplateOutlet]="year" />
|
|
71
|
+
}
|
|
72
|
+
@case ('dropdown-months') {
|
|
73
|
+
<ng-container [ngTemplateOutlet]="month" />
|
|
74
|
+
<div brnCalendarHeader class="order-4 text-sm font-medium">{{ heading.year }}</div>
|
|
75
|
+
}
|
|
76
|
+
@case ('dropdown-years') {
|
|
77
|
+
<div brnCalendarHeader class="order-2 text-sm font-medium">{{ heading.month }}</div>
|
|
78
|
+
<ng-container [ngTemplateOutlet]="year" />
|
|
79
|
+
}
|
|
80
|
+
@case ('label') {
|
|
81
|
+
<div brnCalendarHeader class="order-5 text-sm font-medium">{{ heading.header }}</div>
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
<button
|
|
86
|
+
brnCalendarNextButton
|
|
87
|
+
hlmBtn
|
|
88
|
+
variant="ghost"
|
|
89
|
+
class="order-last size-(--cell-size) p-0 select-none aria-disabled:opacity-50"
|
|
90
|
+
>
|
|
91
|
+
<ng-icon name="lucideChevronRight" class="rtl:rotate-180" />
|
|
92
|
+
</button>
|
|
93
|
+
</div>
|
|
112
94
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
95
|
+
<table class="w-full border-collapse space-y-1" brnCalendarGrid>
|
|
96
|
+
<thead aria-hidden="true">
|
|
97
|
+
<tr class="flex">
|
|
98
|
+
<th
|
|
99
|
+
*brnCalendarWeekday="let weekday"
|
|
100
|
+
scope="col"
|
|
101
|
+
class="text-muted-foreground flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal select-none"
|
|
102
|
+
[attr.aria-label]="_i18n.config().labelWeekday(weekday)"
|
|
103
|
+
>
|
|
104
|
+
{{ _i18n.config().formatWeekdayName(weekday) }}
|
|
105
|
+
</th>
|
|
106
|
+
</tr>
|
|
107
|
+
</thead>
|
|
108
|
+
|
|
109
|
+
<tbody role="rowgroup">
|
|
110
|
+
<tr *brnCalendarWeek="let week" class="mt-2 flex w-full">
|
|
111
|
+
@for (date of week; track _dateAdapter.getTime(date)) {
|
|
112
|
+
<td
|
|
113
|
+
brnCalendarCell
|
|
114
|
+
class="group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:first-child[data-selected=true]_button]:rounded-s-(--cell-radius) [&:last-child[data-selected=true]_button]:rounded-e-(--cell-radius)"
|
|
121
115
|
>
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
<td
|
|
131
|
-
brnCalendarCell
|
|
132
|
-
class="data-[selected]:data-[outside]:bg-accent/50 data-[selected]:bg-accent relative size-8 p-0 text-center text-sm focus-within:relative focus-within:z-20 first:data-[selected]:rounded-l-md last:data-[selected]:rounded-r-md [&:has([aria-selected].day-range-end)]:rounded-r-md"
|
|
133
|
-
>
|
|
134
|
-
<button brnCalendarCellButton [date]="date" [class]="_btnClass">
|
|
135
|
-
{{ _dateAdapter.getDate(date) }}
|
|
136
|
-
</button>
|
|
137
|
-
</td>
|
|
138
|
-
}
|
|
139
|
-
</tr>
|
|
140
|
-
</tbody>
|
|
141
|
-
</table>
|
|
142
|
-
</div>
|
|
116
|
+
<button brnCalendarCellButton [date]="date" [class]="_btnClass">
|
|
117
|
+
{{ _dateAdapter.getDate(date) }}
|
|
118
|
+
</button>
|
|
119
|
+
</td>
|
|
120
|
+
}
|
|
121
|
+
</tr>
|
|
122
|
+
</tbody>
|
|
123
|
+
</table>
|
|
143
124
|
</div>
|
|
144
125
|
`,
|
|
145
126
|
})
|
|
146
127
|
export class HlmCalendar<T> {
|
|
147
|
-
public readonly calendarClass = input<ClassValue>('');
|
|
148
|
-
|
|
149
|
-
protected readonly _computedCalenderClass = computed(() => hlm('rounded-md border p-3', this.calendarClass()));
|
|
150
|
-
|
|
151
128
|
/** Access the calendar i18n */
|
|
152
129
|
protected readonly _i18n = injectBrnCalendarI18n();
|
|
153
130
|
|
|
154
131
|
/** Access the date time adapter */
|
|
155
132
|
protected readonly _dateAdapter = injectDateAdapter<T>();
|
|
156
133
|
|
|
157
|
-
/** The days to highlight. */
|
|
158
|
-
public readonly highlightDays = input<T[]>([]);
|
|
159
|
-
|
|
160
|
-
/** The minimum date that can be selected.*/
|
|
161
|
-
public readonly min = input<T>();
|
|
162
|
-
|
|
163
|
-
/** The maximum date that can be selected. */
|
|
164
|
-
public readonly max = input<T>();
|
|
165
|
-
|
|
166
134
|
/** Show dropdowns to navigate between months or years. */
|
|
167
135
|
public readonly captionLayout = input<'dropdown' | 'label' | 'dropdown-months' | 'dropdown-years'>('label');
|
|
168
136
|
|
|
169
|
-
/** Determine if the date picker is disabled. */
|
|
170
|
-
public readonly disabled = input<boolean, BooleanInput>(false, {
|
|
171
|
-
transform: booleanAttribute,
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
/** The selected value. */
|
|
175
|
-
public readonly date = model<T>();
|
|
176
|
-
|
|
177
|
-
/** Whether a specific date is disabled. */
|
|
178
|
-
public readonly dateDisabled = input<(date: T) => boolean>(() => false);
|
|
179
|
-
|
|
180
|
-
/** The day the week starts on */
|
|
181
|
-
public readonly weekStartsOn = input<Weekday, NumberInput>(undefined, {
|
|
182
|
-
transform: (v: unknown) => numberAttribute(v) as Weekday,
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
/** The default focused date. */
|
|
186
|
-
public readonly defaultFocusedDate = input<T>();
|
|
187
|
-
|
|
188
137
|
/** Access the calendar directive */
|
|
189
|
-
private readonly _calendar =
|
|
138
|
+
private readonly _calendar = inject(BrnCalendar);
|
|
190
139
|
|
|
191
140
|
/** Get the heading for the current month and year */
|
|
192
141
|
protected readonly _heading = computed(() => {
|
|
193
142
|
const config = this._i18n.config();
|
|
194
|
-
const date = this._calendar
|
|
143
|
+
const date = this._calendar.focusedDate();
|
|
195
144
|
|
|
196
145
|
return {
|
|
197
146
|
header: config.formatHeader(this._dateAdapter.getMonth(date), this._dateAdapter.getYear(date)),
|
|
@@ -201,17 +150,13 @@ export class HlmCalendar<T> {
|
|
|
201
150
|
});
|
|
202
151
|
|
|
203
152
|
protected readonly _btnClass = hlm(
|
|
204
|
-
buttonVariants({ variant: 'ghost' }),
|
|
205
|
-
'size-
|
|
206
|
-
'data-[outside]:
|
|
207
|
-
'data-[today]:bg-accent data-[today]:text-accent-foreground',
|
|
208
|
-
'data-[selected]:bg-primary data-[selected]:text-primary-foreground data-[selected]:hover:bg-primary dark:hover:text-accent-foreground data-[selected]:focus:bg-primary data-[selected]:focus:text-primary-foreground',
|
|
209
|
-
'data-[disabled]:text-muted-foreground data-[disabled]:opacity-50',
|
|
210
|
-
'dark:hover:text-accent-foreground',
|
|
153
|
+
buttonVariants({ variant: 'ghost', size: 'icon' }),
|
|
154
|
+
'data-[today=true]:bg-muted group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-e-(--cell-radius) data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-s-(--cell-radius) [&>span]:text-xs [&>span]:opacity-70',
|
|
155
|
+
'data-[outside=true]:opacity-50',
|
|
211
156
|
"data-[highlighted]:before:content-['']",
|
|
212
157
|
'data-[highlighted]:before:absolute',
|
|
213
158
|
'data-[highlighted]:before:bottom-1',
|
|
214
|
-
'data-[highlighted]:before:
|
|
159
|
+
'data-[highlighted]:before:start-1/2',
|
|
215
160
|
'data-[highlighted]:before:h-1',
|
|
216
161
|
'data-[highlighted]:before:w-1',
|
|
217
162
|
'data-[highlighted]:before:-translate-x-1/2',
|
|
@@ -219,5 +164,12 @@ export class HlmCalendar<T> {
|
|
|
219
164
|
'data-[highlighted]:before:bg-destructive',
|
|
220
165
|
);
|
|
221
166
|
|
|
222
|
-
protected readonly _selectClass = 'gap-0 px-1.5 py-2 [&>ng-icon]:
|
|
167
|
+
protected readonly _selectClass = 'gap-0 px-1.5 py-2 [&>ng-icon]:ms-1';
|
|
168
|
+
|
|
169
|
+
constructor() {
|
|
170
|
+
classes(
|
|
171
|
+
() =>
|
|
172
|
+
'spartan-calendar group/calendar bg-background block in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent',
|
|
173
|
+
);
|
|
174
|
+
}
|
|
223
175
|
}
|
|
@@ -2,14 +2,13 @@ import { ChangeDetectionStrategy, Component, computed, effect, inject, untracked
|
|
|
2
2
|
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
3
3
|
import { lucideArrowRight } from '@ng-icons/lucide';
|
|
4
4
|
import { HlmButton, provideBrnButtonConfig } from '<%- importAlias %>/button';
|
|
5
|
-
import { HlmIcon } from '<%- importAlias %>/icon';
|
|
6
5
|
import { hlm } from '<%- importAlias %>/utils';
|
|
7
6
|
import { HlmCarousel } from './hlm-carousel';
|
|
8
7
|
|
|
9
8
|
@Component({
|
|
10
9
|
selector: 'button[hlm-carousel-next], button[hlmCarouselNext]',
|
|
11
|
-
imports: [NgIcon
|
|
12
|
-
providers: [provideIcons({ lucideArrowRight }), provideBrnButtonConfig({ variant: 'outline', size: 'icon' })],
|
|
10
|
+
imports: [NgIcon],
|
|
11
|
+
providers: [provideIcons({ lucideArrowRight }), provideBrnButtonConfig({ variant: 'outline', size: 'icon-sm' })],
|
|
13
12
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
14
13
|
hostDirectives: [{ directive: HlmButton, inputs: ['variant', 'size'] }],
|
|
15
14
|
host: {
|
|
@@ -18,7 +17,7 @@ import { HlmCarousel } from './hlm-carousel';
|
|
|
18
17
|
'(click)': '_carousel.scrollNext()',
|
|
19
18
|
},
|
|
20
19
|
template: `
|
|
21
|
-
<ng-icon
|
|
20
|
+
<ng-icon name="lucideArrowRight" class="rtl:rotate-180" />
|
|
22
21
|
<span class="sr-only">Next slide</span>
|
|
23
22
|
`,
|
|
24
23
|
})
|
|
@@ -2,14 +2,13 @@ import { ChangeDetectionStrategy, Component, computed, effect, inject, untracked
|
|
|
2
2
|
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
3
3
|
import { lucideArrowLeft } from '@ng-icons/lucide';
|
|
4
4
|
import { HlmButton, provideBrnButtonConfig } from '<%- importAlias %>/button';
|
|
5
|
-
import { HlmIcon } from '<%- importAlias %>/icon';
|
|
6
5
|
import { hlm } from '<%- importAlias %>/utils';
|
|
7
6
|
import { HlmCarousel } from './hlm-carousel';
|
|
8
7
|
|
|
9
8
|
@Component({
|
|
10
9
|
selector: 'button[hlm-carousel-previous], button[hlmCarouselPrevious]',
|
|
11
|
-
imports: [NgIcon
|
|
12
|
-
providers: [provideIcons({ lucideArrowLeft }), provideBrnButtonConfig({ variant: 'outline', size: 'icon' })],
|
|
10
|
+
imports: [NgIcon],
|
|
11
|
+
providers: [provideIcons({ lucideArrowLeft }), provideBrnButtonConfig({ variant: 'outline', size: 'icon-sm' })],
|
|
13
12
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
14
13
|
hostDirectives: [{ directive: HlmButton, inputs: ['variant', 'size'] }],
|
|
15
14
|
host: {
|
|
@@ -18,7 +17,7 @@ import { HlmCarousel } from './hlm-carousel';
|
|
|
18
17
|
'(click)': '_carousel.scrollPrev()',
|
|
19
18
|
},
|
|
20
19
|
template: `
|
|
21
|
-
<ng-icon
|
|
20
|
+
<ng-icon name="lucideArrowLeft" class="rtl:rotate-180" />
|
|
22
21
|
<span class="sr-only">Previous slide</span>
|
|
23
22
|
`,
|
|
24
23
|
})
|
|
@@ -17,7 +17,6 @@ import { lucideCheck } from '@ng-icons/lucide';
|
|
|
17
17
|
import { BrnCheckbox } from '@spartan-ng/brain/checkbox';
|
|
18
18
|
import { BrnFieldControlDescribedBy } from '@spartan-ng/brain/field';
|
|
19
19
|
import type { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';
|
|
20
|
-
import { HlmIcon } from '<%- importAlias %>/icon';
|
|
21
20
|
import { hlm } from '<%- importAlias %>/utils';
|
|
22
21
|
import type { ClassValue } from 'clsx';
|
|
23
22
|
|
|
@@ -29,7 +28,7 @@ export const HLM_CHECKBOX_VALUE_ACCESSOR = {
|
|
|
29
28
|
|
|
30
29
|
@Component({
|
|
31
30
|
selector: 'hlm-checkbox',
|
|
32
|
-
imports: [BrnCheckbox, NgIcon
|
|
31
|
+
imports: [BrnCheckbox, NgIcon],
|
|
33
32
|
providers: [HLM_CHECKBOX_VALUE_ACCESSOR],
|
|
34
33
|
viewProviders: [provideIcons({ lucideCheck })],
|
|
35
34
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -58,8 +57,8 @@ export const HLM_CHECKBOX_VALUE_ACCESSOR = {
|
|
|
58
57
|
(touched)="_onTouched?.()"
|
|
59
58
|
>
|
|
60
59
|
@if (checked() || indeterminate()) {
|
|
61
|
-
<span class="flex items-center justify-center text-current transition-none">
|
|
62
|
-
<ng-icon
|
|
60
|
+
<span class="spartan-checkbox-indicator flex items-center justify-center text-current transition-none">
|
|
61
|
+
<ng-icon name="lucideCheck" />
|
|
63
62
|
</span>
|
|
64
63
|
}
|
|
65
64
|
</brn-checkbox>
|
|
@@ -53,7 +53,7 @@ export const HLM_DATE_PICKER_MUTLI_VALUE_ACCESSOR = {
|
|
|
53
53
|
<hlm-popover-content class="w-fit p-0" *hlmPopoverPortal="let ctx">
|
|
54
54
|
<ng-content select="[hlmDatePickerHeader]" />
|
|
55
55
|
<hlm-calendar-multi
|
|
56
|
-
|
|
56
|
+
class="rounded-none border-0"
|
|
57
57
|
[date]="_mutableDate()"
|
|
58
58
|
[captionLayout]="captionLayout()"
|
|
59
59
|
[min]="min()"
|
|
@@ -47,7 +47,7 @@ export const HLM_DATE_PICKER_VALUE_ACCESSOR = {
|
|
|
47
47
|
<hlm-popover-content class="w-fit p-0" *hlmPopoverPortal="let ctx">
|
|
48
48
|
<ng-content select="[hlmDatePickerHeader]" />
|
|
49
49
|
<hlm-calendar
|
|
50
|
-
|
|
50
|
+
class="rounded-none border-0"
|
|
51
51
|
[captionLayout]="captionLayout()"
|
|
52
52
|
[date]="_mutableDate()"
|
|
53
53
|
[defaultFocusedDate]="_mutableDate() ?? defaultFocusedDate()"
|
|
@@ -53,7 +53,7 @@ export const HLM_DATE_RANGE_PICKER_VALUE_ACCESSOR = {
|
|
|
53
53
|
<hlm-popover-content class="w-fit p-0" *hlmPopoverPortal="let ctx">
|
|
54
54
|
<ng-content select="[hlmDatePickerHeader]" />
|
|
55
55
|
<hlm-calendar-range
|
|
56
|
-
|
|
56
|
+
class="rounded-none border-0"
|
|
57
57
|
[startDate]="_start()"
|
|
58
58
|
[captionLayout]="captionLayout()"
|
|
59
59
|
[endDate]="_end()"
|
|
@@ -2,11 +2,11 @@ import type { BooleanInput } from '@angular/cdk/coercion';
|
|
|
2
2
|
import type { ComponentType } from '@angular/cdk/portal';
|
|
3
3
|
import { NgComponentOutlet } from '@angular/common';
|
|
4
4
|
import { booleanAttribute, ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';
|
|
5
|
-
import { provideIcons } from '@ng-icons/core';
|
|
5
|
+
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
6
6
|
import { lucideX } from '@ng-icons/lucide';
|
|
7
7
|
import { BrnDialogRef, injectBrnDialogContext } from '@spartan-ng/brain/dialog';
|
|
8
8
|
import { HlmButton } from '<%- importAlias %>/button';
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
import { classes } from '<%- importAlias %>/utils';
|
|
11
11
|
import { HlmDialogClose } from './hlm-dialog-close';
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ type HlmDialogContentContext = {
|
|
|
18
18
|
|
|
19
19
|
@Component({
|
|
20
20
|
selector: 'hlm-dialog-content',
|
|
21
|
-
imports: [NgComponentOutlet,
|
|
21
|
+
imports: [NgComponentOutlet, HlmButton, HlmDialogClose, NgIcon],
|
|
22
22
|
providers: [provideIcons({ lucideX })],
|
|
23
23
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
24
24
|
host: {
|
|
@@ -35,7 +35,7 @@ type HlmDialogContentContext = {
|
|
|
35
35
|
@if (showCloseButton()) {
|
|
36
36
|
<button hlmBtn variant="ghost" size="icon-sm" class="spartan-dialog-close" hlmDialogClose>
|
|
37
37
|
<span class="sr-only">close</span>
|
|
38
|
-
<ng-icon
|
|
38
|
+
<ng-icon name="lucideX" />
|
|
39
39
|
</button>
|
|
40
40
|
}
|
|
41
41
|
`,
|
|
@@ -9,7 +9,7 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
9
9
|
providers: [provideIcons({ lucideChevronRight })],
|
|
10
10
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11
11
|
template: `
|
|
12
|
-
<ng-icon name="lucideChevronRight" class="text-[
|
|
12
|
+
<ng-icon name="lucideChevronRight" class="text-[length:--spacing(4)] rtl:rotate-180" />
|
|
13
13
|
`,
|
|
14
14
|
})
|
|
15
15
|
export class HlmDropdownMenuItemSubIndicator {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
2
|
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
3
3
|
import { lucideMinus } from '@ng-icons/lucide';
|
|
4
|
-
import { HlmIcon } from '<%- importAlias %>/icon';
|
|
5
4
|
import { classes } from '<%- importAlias %>/utils';
|
|
6
5
|
|
|
7
6
|
@Component({
|
|
8
7
|
selector: 'hlm-input-otp-separator',
|
|
9
|
-
imports: [
|
|
8
|
+
imports: [NgIcon],
|
|
10
9
|
providers: [provideIcons({ lucideMinus })],
|
|
11
10
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
11
|
host: {
|
|
@@ -14,7 +13,7 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
14
13
|
'data-slot': 'input-otp-separator',
|
|
15
14
|
},
|
|
16
15
|
template: `
|
|
17
|
-
<ng-icon
|
|
16
|
+
<ng-icon name="lucideMinus" />
|
|
18
17
|
`,
|
|
19
18
|
})
|
|
20
19
|
export class HlmInputOtpSeparator {
|
|
@@ -10,17 +10,17 @@ import {
|
|
|
10
10
|
Renderer2,
|
|
11
11
|
signal,
|
|
12
12
|
} from '@angular/core';
|
|
13
|
-
import { provideIcons } from '@ng-icons/core';
|
|
13
|
+
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
14
14
|
import { lucideX } from '@ng-icons/lucide';
|
|
15
15
|
import { injectExposedSideProvider, injectExposesStateProvider } from '@spartan-ng/brain/core';
|
|
16
16
|
import { HlmButton } from '<%- importAlias %>/button';
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
import { classes } from '<%- importAlias %>/utils';
|
|
19
19
|
import { HlmSheetClose } from './hlm-sheet-close';
|
|
20
20
|
|
|
21
21
|
@Component({
|
|
22
22
|
selector: 'hlm-sheet-content',
|
|
23
|
-
imports: [
|
|
23
|
+
imports: [HlmButton, HlmSheetClose, NgIcon],
|
|
24
24
|
providers: [provideIcons({ lucideX })],
|
|
25
25
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
26
26
|
host: {
|
|
@@ -34,7 +34,7 @@ import { HlmSheetClose } from './hlm-sheet-close';
|
|
|
34
34
|
@if (showCloseButton()) {
|
|
35
35
|
<button hlmBtn variant="ghost" size="icon-sm" class="spartan-sheet-close" hlmSheetClose>
|
|
36
36
|
<span class="sr-only">Close</span>
|
|
37
|
-
<ng-icon
|
|
37
|
+
<ng-icon name="lucideX" />
|
|
38
38
|
</button>
|
|
39
39
|
}
|
|
40
40
|
`,
|
|
@@ -12,7 +12,7 @@ import { HlmSidebarService } from './hlm-sidebar.service';
|
|
|
12
12
|
import { injectHlmSidebarConfig } from './hlm-sidebar.token';
|
|
13
13
|
|
|
14
14
|
const sidebarMenuButtonVariants = cva(
|
|
15
|
-
'spartan-sidebar-menu-button peer/menu-button group/menu-button flex w-full items-center overflow-hidden outline-hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_ng-icon]:shrink-0 [&_ng-icon]:text-[
|
|
15
|
+
'spartan-sidebar-menu-button peer/menu-button group/menu-button flex w-full items-center overflow-hidden outline-hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_ng-icon]:shrink-0 [&_ng-icon]:text-[length:--spacing(4)] [&>span:last-child]:truncate',
|
|
16
16
|
{
|
|
17
17
|
variants: {
|
|
18
18
|
variant: {
|
|
@@ -27,6 +27,6 @@ export class HlmSpinner {
|
|
|
27
27
|
public readonly ariaLabel = input<string>('Loading', { alias: 'aria-label' });
|
|
28
28
|
|
|
29
29
|
constructor() {
|
|
30
|
-
classes(() => 'inline-flex text-[
|
|
30
|
+
classes(() => 'inline-flex text-[length:--spacing(4)] motion-safe:animate-spin');
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -2,9 +2,9 @@ import { CdkObserveContent } from '@angular/cdk/observers';
|
|
|
2
2
|
import {
|
|
3
3
|
ChangeDetectionStrategy,
|
|
4
4
|
Component,
|
|
5
|
-
type ElementRef,
|
|
6
5
|
computed,
|
|
7
6
|
contentChildren,
|
|
7
|
+
type ElementRef,
|
|
8
8
|
input,
|
|
9
9
|
viewChild,
|
|
10
10
|
} from '@angular/core';
|
|
@@ -13,7 +13,6 @@ import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
|
13
13
|
import { lucideChevronLeft, lucideChevronRight } from '@ng-icons/lucide';
|
|
14
14
|
import { type BrnPaginatedTabHeaderItem, BrnTabsPaginatedList, BrnTabsTrigger } from '@spartan-ng/brain/tabs';
|
|
15
15
|
import { buttonVariants } from '<%- importAlias %>/button';
|
|
16
|
-
import { HlmIcon } from '<%- importAlias %>/icon';
|
|
17
16
|
import { classes, hlm } from '<%- importAlias %>/utils';
|
|
18
17
|
import type { ClassValue } from 'clsx';
|
|
19
18
|
import type { Observable } from 'rxjs';
|
|
@@ -21,7 +20,7 @@ import { listVariants } from './hlm-tabs-list';
|
|
|
21
20
|
|
|
22
21
|
@Component({
|
|
23
22
|
selector: 'hlm-paginated-tabs-list',
|
|
24
|
-
imports: [CdkObserveContent, NgIcon
|
|
23
|
+
imports: [CdkObserveContent, NgIcon],
|
|
25
24
|
providers: [provideIcons({ lucideChevronRight, lucideChevronLeft })],
|
|
26
25
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
27
26
|
host: {
|
|
@@ -42,7 +41,7 @@ import { listVariants } from './hlm-tabs-list';
|
|
|
42
41
|
(mousedown)="_handlePaginatorPress('before', $event)"
|
|
43
42
|
(touchend)="_stopInterval()"
|
|
44
43
|
>
|
|
45
|
-
<ng-icon
|
|
44
|
+
<ng-icon name="lucideChevronLeft" />
|
|
46
45
|
</button>
|
|
47
46
|
|
|
48
47
|
<div #tabListContainer class="z-[1] flex grow overflow-hidden" (keydown)="_handleKeydown($event)">
|
|
@@ -67,14 +66,14 @@ import { listVariants } from './hlm-tabs-list';
|
|
|
67
66
|
(mousedown)="_handlePaginatorPress('after', $event)"
|
|
68
67
|
(touchend)="_stopInterval()"
|
|
69
68
|
>
|
|
70
|
-
<ng-icon
|
|
69
|
+
<ng-icon name="lucideChevronRight" />
|
|
71
70
|
</button>
|
|
72
71
|
`,
|
|
73
72
|
})
|
|
74
73
|
export class HlmTabsPaginatedList extends BrnTabsPaginatedList {
|
|
75
74
|
constructor() {
|
|
76
75
|
super();
|
|
77
|
-
classes(() => 'relative flex flex-shrink-0 gap-1 overflow-hidden');
|
|
76
|
+
classes(() => 'relative flex flex-shrink-0 items-center gap-1 overflow-hidden');
|
|
78
77
|
}
|
|
79
78
|
|
|
80
79
|
public readonly items = contentChildren(BrnTabsTrigger, { descendants: false });
|
|
@@ -90,11 +89,11 @@ export class HlmTabsPaginatedList extends BrnTabsPaginatedList {
|
|
|
90
89
|
public readonly tabListClass = input<ClassValue>('', { alias: 'tabListClass' });
|
|
91
90
|
protected readonly _tabListClass = computed(() => hlm(listVariants(), this.tabListClass()));
|
|
92
91
|
|
|
93
|
-
public readonly paginationButtonClass = input<ClassValue>(''
|
|
92
|
+
public readonly paginationButtonClass = input<ClassValue>('');
|
|
94
93
|
protected readonly _paginationButtonClass = computed(() =>
|
|
95
94
|
hlm(
|
|
96
95
|
'relative z-[2] select-none disabled:cursor-default',
|
|
97
|
-
buttonVariants({ variant: 'ghost', size: 'icon' }),
|
|
96
|
+
buttonVariants({ variant: 'ghost', size: 'icon-sm' }),
|
|
98
97
|
this.paginationButtonClass(),
|
|
99
98
|
),
|
|
100
99
|
);
|