@nanahoshi/mona-ui 0.1.1 → 0.2.1
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/auto-complete/package.json +4 -0
- package/avatar/package.json +4 -0
- package/breadcrumb/package.json +4 -0
- package/button/package.json +4 -0
- package/button-group/package.json +4 -0
- package/calendar/package.json +4 -0
- package/check-box/package.json +4 -0
- package/chip/package.json +4 -0
- package/circular-progress-bar/package.json +4 -0
- package/color-gradient/package.json +4 -0
- package/color-palette/package.json +4 -0
- package/color-picker/package.json +4 -0
- package/combo-box/package.json +4 -0
- package/common/package.json +4 -0
- package/contextmenu/package.json +4 -0
- package/date-input/package.json +4 -0
- package/date-picker/package.json +4 -0
- package/datetime-picker/package.json +4 -0
- package/dialog/package.json +4 -0
- package/dropdown-button/package.json +4 -0
- package/dropdown-list/package.json +4 -0
- package/dropdowns/package.json +4 -0
- package/editor/package.json +4 -0
- package/expansion-panel/package.json +4 -0
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +40 -55
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +19 -53
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +15 -26
- package/fesm2022/nanahoshi-mona-ui-button.mjs +67 -68
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +54 -150
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +67 -99
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +35 -45
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +9 -23
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +27 -78
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +17 -39
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +39 -48
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +34 -54
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +9 -12
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +42 -29
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +53 -53
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +40 -153
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +33 -54
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +7 -12
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +59 -219
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +24 -75
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +11 -44
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +11 -41
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-B2ETh-uI.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-B6FBLtrr.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-DZk18LJC.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-OJe4UYuw.mjs} +4 -8
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-C7WKhhig.mjs → nanahoshi-mona-ui-grid-grid-list.component-DCd8K6ng.mjs} +9 -16
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-BRiY0CDX.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-Dl8Hlkhj.mjs} +15 -44
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-BrYpFMyF.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-C5FRZlvv.mjs} +11 -20
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-T9Bj98kl.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BRZUd8cE.mjs} +109 -393
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +10 -28
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +27 -57
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +31 -122
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +29 -1
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +4 -26
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +5 -18
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +48 -154
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +36 -63
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +24 -108
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +38 -64
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +21 -73
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +8 -30
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +29 -50
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +36 -108
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +19 -60
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +78 -98
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +53 -144
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +54 -110
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +7 -20
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +15 -50
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +28 -91
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +37 -59
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +35 -107
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +19 -31
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +60 -65
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +1111 -269
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +43 -29
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +40 -102
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +13 -41
- package/fesm2022/nanahoshi-mona-ui-window.mjs +29 -108
- package/fieldset/package.json +4 -0
- package/filter/package.json +4 -0
- package/grid/package.json +4 -0
- package/internal/filter-input/package.json +4 -0
- package/internal/indicator-icon/package.json +4 -0
- package/internal/list/package.json +4 -0
- package/internal/package.json +4 -0
- package/internal/tree/package.json +4 -0
- package/list/package.json +4 -0
- package/list-box/package.json +4 -0
- package/list-view/package.json +4 -0
- package/menubar/package.json +4 -0
- package/multi-select/package.json +4 -0
- package/notification/package.json +4 -0
- package/numeric-text-box/package.json +4 -0
- package/package.json +2 -1
- package/pager/package.json +4 -0
- package/placeholder/package.json +4 -0
- package/popover/package.json +4 -0
- package/popup/package.json +4 -0
- package/popup-menu/package.json +4 -0
- package/progress-bar/package.json +4 -0
- package/query/package.json +4 -0
- package/radio-button/package.json +4 -0
- package/scroll-view/package.json +4 -0
- package/slider/package.json +4 -0
- package/split-button/package.json +4 -0
- package/splitter/package.json +4 -0
- package/stepper/package.json +4 -0
- package/switch/package.json +4 -0
- package/tabs/package.json +4 -0
- package/text-area/package.json +4 -0
- package/text-box/package.json +4 -0
- package/theme/package.json +4 -0
- package/time-picker/package.json +4 -0
- package/time-selector/package.json +4 -0
- package/tooltip/package.json +4 -0
- package/tree-view/package.json +4 -0
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +6 -7
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +4 -6
- package/types/nanahoshi-mona-ui-button-group.d.ts +2 -3
- package/types/nanahoshi-mona-ui-button.d.ts +2 -3
- package/types/nanahoshi-mona-ui-calendar.d.ts +21 -22
- package/types/nanahoshi-mona-ui-check-box.d.ts +18 -10
- package/types/nanahoshi-mona-ui-chip.d.ts +2 -3
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +2 -4
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +10 -11
- package/types/nanahoshi-mona-ui-color-palette.d.ts +4 -5
- package/types/nanahoshi-mona-ui-color-picker.d.ts +6 -5
- package/types/nanahoshi-mona-ui-combo-box.d.ts +6 -7
- package/types/nanahoshi-mona-ui-date-input.d.ts +2 -3
- package/types/nanahoshi-mona-ui-date-picker.d.ts +2 -3
- package/types/nanahoshi-mona-ui-dialog.d.ts +6 -7
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +6 -7
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +2 -3
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +8 -10
- package/types/nanahoshi-mona-ui-fieldset.d.ts +6 -8
- package/types/nanahoshi-mona-ui-filter.d.ts +2 -3
- package/types/nanahoshi-mona-ui-grid.d.ts +14 -15
- package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +0 -1
- package/types/nanahoshi-mona-ui-internal.d.ts +8 -1
- package/types/nanahoshi-mona-ui-list-box.d.ts +4 -5
- package/types/nanahoshi-mona-ui-list-view.d.ts +2 -3
- package/types/nanahoshi-mona-ui-menubar.d.ts +6 -7
- package/types/nanahoshi-mona-ui-multi-select.d.ts +8 -9
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +2 -3
- package/types/nanahoshi-mona-ui-pager.d.ts +6 -7
- package/types/nanahoshi-mona-ui-placeholder.d.ts +4 -6
- package/types/nanahoshi-mona-ui-popover.d.ts +8 -9
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +12 -13
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +8 -9
- package/types/nanahoshi-mona-ui-radio-button.d.ts +28 -13
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +18 -20
- package/types/nanahoshi-mona-ui-slider.d.ts +18 -18
- package/types/nanahoshi-mona-ui-split-button.d.ts +2 -3
- package/types/nanahoshi-mona-ui-splitter.d.ts +6 -8
- package/types/nanahoshi-mona-ui-stepper.d.ts +12 -13
- package/types/nanahoshi-mona-ui-switch.d.ts +6 -7
- package/types/nanahoshi-mona-ui-tabs.d.ts +14 -16
- package/types/nanahoshi-mona-ui-text-area.d.ts +2 -4
- package/types/nanahoshi-mona-ui-text-box.d.ts +16 -7
- package/types/nanahoshi-mona-ui-theme.d.ts +111 -12
- package/types/nanahoshi-mona-ui-time-picker.d.ts +2 -3
- package/types/nanahoshi-mona-ui-time-selector.d.ts +11 -11
- package/types/nanahoshi-mona-ui-tooltip.d.ts +4 -5
- package/types/nanahoshi-mona-ui-window.d.ts +16 -17
- package/window/package.json +4 -0
|
@@ -3,9 +3,9 @@ import * as i0 from '@angular/core';
|
|
|
3
3
|
import { inject, ElementRef, Directive, Pipe, DestroyRef, signal, viewChildren, NgZone, computed, contentChild, TemplateRef, input, output, afterNextRender, viewChild, model, Component } from '@angular/core';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import { fromEvent, tap, filter, switchMap, takeUntil } from 'rxjs';
|
|
6
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
7
6
|
import { twMerge } from 'tailwind-merge';
|
|
8
7
|
import { cva } from 'class-variance-authority';
|
|
8
|
+
import { themeRaisedSurfaceClasses } from '@nanahoshi/mona-ui/internal';
|
|
9
9
|
|
|
10
10
|
class SliderTickDirective {
|
|
11
11
|
constructor() {
|
|
@@ -150,26 +150,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
150
150
|
}]
|
|
151
151
|
}] });
|
|
152
152
|
|
|
153
|
-
const
|
|
154
|
-
flex
|
|
153
|
+
const sliderBaseThemeVariants = cva(`
|
|
154
|
+
relative flex select-none
|
|
155
155
|
|
|
156
|
-
data-[orientation="horizontal"]:h-6
|
|
157
156
|
data-[orientation="horizontal"]:w-full
|
|
157
|
+
data-[orientation="horizontal"]:h-6
|
|
158
158
|
data-[orientation="horizontal"]:min-w-[200px]
|
|
159
159
|
data-[orientation="horizontal"]:items-center
|
|
160
160
|
|
|
161
|
-
data-[orientation="vertical"]:w-6
|
|
162
161
|
data-[orientation="vertical"]:h-[200px]
|
|
162
|
+
data-[orientation="vertical"]:w-6
|
|
163
163
|
data-[orientation="vertical"]:justify-center
|
|
164
164
|
|
|
165
165
|
data-[disabled="true"]:pointer-events-none
|
|
166
|
-
data-[disabled="true"]:opacity-50
|
|
167
166
|
data-[disabled="true"]:cursor-not-allowed
|
|
167
|
+
data-[disabled="true"]:opacity-50
|
|
168
168
|
`);
|
|
169
|
-
const
|
|
169
|
+
const sliderTrackThemeVariants = cva(`
|
|
170
170
|
relative z-2 cursor-pointer
|
|
171
|
-
|
|
172
|
-
bg-
|
|
171
|
+
overflow-hidden
|
|
172
|
+
bg-surface-muted text-foreground
|
|
173
173
|
|
|
174
174
|
data-[orientation="horizontal"]:w-full
|
|
175
175
|
data-[orientation="horizontal"]:h-1.5
|
|
@@ -177,12 +177,22 @@ const sliderTrackVariants = cva(`
|
|
|
177
177
|
data-[orientation="vertical"]:h-full
|
|
178
178
|
data-[orientation="vertical"]:w-1.5
|
|
179
179
|
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
`, {
|
|
181
|
+
variants: {
|
|
182
|
+
rounded: {
|
|
183
|
+
full: "rounded-full",
|
|
184
|
+
large: "rounded-lg",
|
|
185
|
+
medium: "rounded-md",
|
|
186
|
+
none: "rounded-none",
|
|
187
|
+
small: "rounded-sm"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
const sliderSelectionThemeVariants = cva(`
|
|
182
192
|
absolute
|
|
183
|
-
bg-primary
|
|
184
|
-
|
|
185
|
-
ease-out
|
|
193
|
+
bg-primary
|
|
194
|
+
border-none
|
|
195
|
+
transition duration-(--mona-motion-fast) ease-out
|
|
186
196
|
|
|
187
197
|
data-[orientation="horizontal"]:top-0
|
|
188
198
|
data-[orientation="horizontal"]:bottom-0
|
|
@@ -194,7 +204,7 @@ const sliderSelectionVariants = cva(`
|
|
|
194
204
|
data-[orientation="vertical"]:transition-[top,bottom]
|
|
195
205
|
data-[orientation="vertical"]:data-[dragging="true"]:transition-none
|
|
196
206
|
`);
|
|
197
|
-
const
|
|
207
|
+
const sliderTickListThemeVariants = cva(`
|
|
198
208
|
absolute
|
|
199
209
|
|
|
200
210
|
data-[orientation="horizontal"]:w-full
|
|
@@ -207,34 +217,29 @@ const sliderTickListVariants = cva(`
|
|
|
207
217
|
data-[orientation="vertical"]:top-0
|
|
208
218
|
data-[orientation="vertical"]:left-0
|
|
209
219
|
`);
|
|
210
|
-
const
|
|
220
|
+
const sliderTickThemeVariants = cva(`
|
|
211
221
|
cursor-pointer
|
|
212
|
-
bg-
|
|
213
|
-
brightness-75
|
|
222
|
+
bg-border-control-hover
|
|
214
223
|
`);
|
|
215
|
-
const
|
|
216
|
-
absolute
|
|
217
|
-
w-full h-full
|
|
224
|
+
const sliderTickLabelListThemeVariants = cva(`
|
|
225
|
+
absolute h-full w-full
|
|
218
226
|
select-none
|
|
219
227
|
`);
|
|
220
|
-
const
|
|
221
|
-
absolute flex
|
|
222
|
-
|
|
228
|
+
const sliderTickLabelThemeVariants = cva(`
|
|
229
|
+
absolute flex items-center justify-center
|
|
230
|
+
text-xs/[1.667] text-foreground
|
|
223
231
|
|
|
224
|
-
text-xs/[1.667]
|
|
225
|
-
text-foreground
|
|
226
|
-
|
|
227
|
-
data-[orientation="vertical"]:w-4.25
|
|
228
232
|
data-[orientation="vertical"]:h-auto
|
|
233
|
+
data-[orientation="vertical"]:w-4.25
|
|
229
234
|
`);
|
|
230
|
-
const
|
|
235
|
+
const sliderHandleThemeVariants = cva(`
|
|
231
236
|
absolute z-2 flex items-center justify-center
|
|
232
|
-
|
|
237
|
+
h-4.25 w-4.25
|
|
233
238
|
cursor-pointer
|
|
239
|
+
${themeRaisedSurfaceClasses}
|
|
240
|
+
border border-(--mona-slider-handle-border-color) shadow-(--shadow-control)
|
|
234
241
|
outline-none
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
ease-out duration-200
|
|
242
|
+
transition duration-(--mona-motion-fast) ease-out
|
|
238
243
|
|
|
239
244
|
data-[orientation="horizontal"]:translate-x-[-50%]
|
|
240
245
|
data-[orientation="horizontal"]:transition-[left]
|
|
@@ -244,11 +249,14 @@ const sliderHandleVariants = cva(`
|
|
|
244
249
|
data-[orientation="vertical"]:transition-[bottom]
|
|
245
250
|
data-[orientation="vertical"]:data-[dragging="true"]:transition-none
|
|
246
251
|
|
|
252
|
+
data-[focused="true"]:border-focus-indicator
|
|
247
253
|
data-[focused="true"]:ring-2
|
|
248
|
-
data-[focused="true"]:ring-
|
|
254
|
+
data-[focused="true"]:ring-focus-indicator/35
|
|
249
255
|
|
|
250
256
|
data-[invalid="true"]:border-error
|
|
251
|
-
data-[invalid="true"]:ring-2 data-[invalid="true"]:ring-error/
|
|
257
|
+
data-[invalid="true"]:ring-2 data-[invalid="true"]:ring-error/35
|
|
258
|
+
data-[invalid="true"]:data-[focused="true"]:border-error
|
|
259
|
+
data-[invalid="true"]:data-[focused="true"]:ring-error/35
|
|
252
260
|
`, {
|
|
253
261
|
variants: {
|
|
254
262
|
rounded: {
|
|
@@ -261,75 +269,8 @@ const sliderHandleVariants = cva(`
|
|
|
261
269
|
}
|
|
262
270
|
});
|
|
263
271
|
|
|
264
|
-
const sliderBaseThemeVariants = (theme) => {
|
|
265
|
-
switch (theme) {
|
|
266
|
-
case "mona":
|
|
267
|
-
return sliderBaseVariants;
|
|
268
|
-
default:
|
|
269
|
-
return sliderBaseVariants; // Default to Mona styles
|
|
270
|
-
}
|
|
271
|
-
};
|
|
272
|
-
const sliderTrackThemeVariants = (theme) => {
|
|
273
|
-
switch (theme) {
|
|
274
|
-
case "mona":
|
|
275
|
-
return sliderTrackVariants;
|
|
276
|
-
default:
|
|
277
|
-
return sliderTrackVariants; // Default to Mona styles
|
|
278
|
-
}
|
|
279
|
-
};
|
|
280
|
-
const sliderSelectionThemeVariants = (theme) => {
|
|
281
|
-
switch (theme) {
|
|
282
|
-
case "mona":
|
|
283
|
-
return sliderSelectionVariants;
|
|
284
|
-
default:
|
|
285
|
-
return sliderSelectionVariants; // Default to Mona styles
|
|
286
|
-
}
|
|
287
|
-
};
|
|
288
|
-
const sliderTickListThemeVariants = (theme) => {
|
|
289
|
-
switch (theme) {
|
|
290
|
-
case "mona":
|
|
291
|
-
return sliderTickListVariants;
|
|
292
|
-
default:
|
|
293
|
-
return sliderTickListVariants; // Default to Mona styles
|
|
294
|
-
}
|
|
295
|
-
};
|
|
296
|
-
const sliderTickThemeVariants = (theme) => {
|
|
297
|
-
switch (theme) {
|
|
298
|
-
case "mona":
|
|
299
|
-
return sliderTickVariants;
|
|
300
|
-
default:
|
|
301
|
-
return sliderTickVariants; // Default to Mona styles
|
|
302
|
-
}
|
|
303
|
-
};
|
|
304
|
-
const sliderTickLabelListThemeVariants = (theme) => {
|
|
305
|
-
switch (theme) {
|
|
306
|
-
case "mona":
|
|
307
|
-
return sliderTickLabelListVariants;
|
|
308
|
-
default:
|
|
309
|
-
return sliderTickLabelListVariants; // Default to Mona styles
|
|
310
|
-
}
|
|
311
|
-
};
|
|
312
|
-
const sliderTickLabelThemeVariants = (theme) => {
|
|
313
|
-
switch (theme) {
|
|
314
|
-
case "mona":
|
|
315
|
-
return sliderTickLabelVariants;
|
|
316
|
-
default:
|
|
317
|
-
return sliderTickLabelVariants; // Default to Mona styles
|
|
318
|
-
}
|
|
319
|
-
};
|
|
320
|
-
const sliderHandleThemeVariants = (theme) => {
|
|
321
|
-
switch (theme) {
|
|
322
|
-
case "mona":
|
|
323
|
-
return sliderHandleVariants;
|
|
324
|
-
default:
|
|
325
|
-
return sliderHandleVariants; // Default to Mona styles
|
|
326
|
-
}
|
|
327
|
-
};
|
|
328
|
-
|
|
329
272
|
class SliderBaseComponent {
|
|
330
|
-
#themeService;
|
|
331
273
|
constructor() {
|
|
332
|
-
this.#themeService = inject(ThemeService);
|
|
333
274
|
this.destroyRef = inject(DestroyRef);
|
|
334
275
|
this.dragging = signal(false, /* @ts-ignore */
|
|
335
276
|
...(ngDevMode ? [{ debugName: "dragging" }] : /* istanbul ignore next */ []));
|
|
@@ -337,7 +278,7 @@ class SliderBaseComponent {
|
|
|
337
278
|
this.tickElements = viewChildren(SliderTickDirective, /* @ts-ignore */
|
|
338
279
|
...(ngDevMode ? [{ debugName: "tickElements" }] : /* istanbul ignore next */ []));
|
|
339
280
|
this.zone = inject(NgZone);
|
|
340
|
-
this.baseClasses = computed(() => sliderBaseThemeVariants(
|
|
281
|
+
this.baseClasses = computed(() => sliderBaseThemeVariants(), /* @ts-ignore */
|
|
341
282
|
...(ngDevMode ? [{ debugName: "baseClasses" }] : /* istanbul ignore next */ []));
|
|
342
283
|
this.effectiveDisabled = computed(() => this.disabled(), /* @ts-ignore */
|
|
343
284
|
...(ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []));
|
|
@@ -398,12 +339,12 @@ class SliderBaseComponent {
|
|
|
398
339
|
return typeof bg === "string" ? { background: bg } : bg;
|
|
399
340
|
}, /* @ts-ignore */
|
|
400
341
|
...(ngDevMode ? [{ debugName: "selectionBackgroundStyle" }] : /* istanbul ignore next */ []));
|
|
401
|
-
this.selectionClasses = computed(() => sliderSelectionThemeVariants(
|
|
342
|
+
this.selectionClasses = computed(() => sliderSelectionThemeVariants(), /* @ts-ignore */
|
|
402
343
|
...(ngDevMode ? [{ debugName: "selectionClasses" }] : /* istanbul ignore next */ []));
|
|
403
344
|
this.sliderHandleClasses = computed(() => {
|
|
404
345
|
const rounded = this.rounded();
|
|
405
346
|
const handleClasses = this.handleClasses();
|
|
406
|
-
const variants = sliderHandleThemeVariants(
|
|
347
|
+
const variants = sliderHandleThemeVariants({ rounded });
|
|
407
348
|
return twMerge(variants ?? "", Array.isArray(handleClasses) ? handleClasses.join(" ") : handleClasses);
|
|
408
349
|
}, /* @ts-ignore */
|
|
409
350
|
...(ngDevMode ? [{ debugName: "sliderHandleClasses" }] : /* istanbul ignore next */ []));
|
|
@@ -422,13 +363,13 @@ class SliderBaseComponent {
|
|
|
422
363
|
return `${number}px`;
|
|
423
364
|
}, /* @ts-ignore */
|
|
424
365
|
...(ngDevMode ? [{ debugName: "sliderTrackSize" }] : /* istanbul ignore next */ []));
|
|
425
|
-
this.tickClasses = computed(() => sliderTickThemeVariants(
|
|
366
|
+
this.tickClasses = computed(() => sliderTickThemeVariants(), /* @ts-ignore */
|
|
426
367
|
...(ngDevMode ? [{ debugName: "tickClasses" }] : /* istanbul ignore next */ []));
|
|
427
|
-
this.tickLabelClasses = computed(() => sliderTickLabelThemeVariants(
|
|
368
|
+
this.tickLabelClasses = computed(() => sliderTickLabelThemeVariants(), /* @ts-ignore */
|
|
428
369
|
...(ngDevMode ? [{ debugName: "tickLabelClasses" }] : /* istanbul ignore next */ []));
|
|
429
|
-
this.tickLabelListClasses = computed(() => sliderTickLabelListThemeVariants(
|
|
370
|
+
this.tickLabelListClasses = computed(() => sliderTickLabelListThemeVariants(), /* @ts-ignore */
|
|
430
371
|
...(ngDevMode ? [{ debugName: "tickLabelListClasses" }] : /* istanbul ignore next */ []));
|
|
431
|
-
this.tickListClasses = computed(() => sliderTickListThemeVariants(
|
|
372
|
+
this.tickListClasses = computed(() => sliderTickListThemeVariants(), /* @ts-ignore */
|
|
432
373
|
...(ngDevMode ? [{ debugName: "tickListClasses" }] : /* istanbul ignore next */ []));
|
|
433
374
|
this.tickStyleArgs = computed(() => {
|
|
434
375
|
const largeTickStep = this.largeTickStep();
|
|
@@ -464,7 +405,10 @@ class SliderBaseComponent {
|
|
|
464
405
|
return typeof bg === "string" ? { background: bg } : bg;
|
|
465
406
|
}, /* @ts-ignore */
|
|
466
407
|
...(ngDevMode ? [{ debugName: "trackBackgroundStyle" }] : /* istanbul ignore next */ []));
|
|
467
|
-
this.trackClasses = computed(() =>
|
|
408
|
+
this.trackClasses = computed(() => {
|
|
409
|
+
const rounded = this.rounded();
|
|
410
|
+
return sliderTrackThemeVariants({ rounded });
|
|
411
|
+
}, /* @ts-ignore */
|
|
468
412
|
...(ngDevMode ? [{ debugName: "trackClasses" }] : /* istanbul ignore next */ []));
|
|
469
413
|
/**
|
|
470
414
|
* @description Human-readable override for the `aria-valuenow` announcement. Pass a function that receives the current value and returns the string to announce.
|
|
@@ -5,7 +5,6 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
|
5
5
|
import { LucideChevronDown } from '@lucide/angular';
|
|
6
6
|
import { ButtonDirective } from '@nanahoshi/mona-ui/button';
|
|
7
7
|
import { PopupMenuGroupTemplateDirective, PopupMenuTemplateOrigin, PopupMenuGroupTemplateToken, PopupMenuIconTemplateDirective, PopupMenuIconTemplateToken, PopupMenuShortcutTemplateDirective, PopupMenuShortcutTemplateToken, PopupMenuTextTemplateDirective, PopupMenuTextTemplateToken, PopupMenuToken, PopupMenuComponent, PopupMenuItemType, PopupMenuTemplateType, ensurePopupComponentTypes, PopupMenuOrigin, ensurePopupTemplateTypes, PopupMenuCheckboxItemComponent, PopupMenuGroupComponent, PopupMenuItemComponent, PopupMenuRadioGroupComponent, PopupMenuRadioItemComponent, PopupMenuRadioItemToken, PopupMenuSeparatorComponent } from '@nanahoshi/mona-ui/popup-menu';
|
|
8
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
9
8
|
import { createElementControlId } from '@nanahoshi/mona-ui/internal';
|
|
10
9
|
import { fromEvent } from 'rxjs';
|
|
11
10
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -137,10 +136,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
137
136
|
}]
|
|
138
137
|
}] });
|
|
139
138
|
|
|
140
|
-
const
|
|
139
|
+
const splitButtonThemeVariants = cva(`
|
|
141
140
|
inline-flex flex-nowrap items-center
|
|
142
141
|
[&>button]:focus-visible:z-10
|
|
143
|
-
[&_svg]:
|
|
142
|
+
[&_svg]:h-5 [&_svg]:w-5
|
|
144
143
|
`, {
|
|
145
144
|
variants: {
|
|
146
145
|
look: {
|
|
@@ -148,7 +147,7 @@ const splitButtonVariants = cva(`
|
|
|
148
147
|
error: "",
|
|
149
148
|
ghost: "border-transparent",
|
|
150
149
|
info: "",
|
|
151
|
-
outline: "[&>button:not(:last-child)]:border-r",
|
|
150
|
+
outline: "[&>button:not(:last-child)]:border-r [&>button:not(:last-child)]:border-input-border",
|
|
152
151
|
primary: "",
|
|
153
152
|
secondary: "",
|
|
154
153
|
success: "",
|
|
@@ -181,13 +180,13 @@ const splitButtonVariants = cva(`
|
|
|
181
180
|
},
|
|
182
181
|
size: {
|
|
183
182
|
large: `
|
|
184
|
-
[&_svg]:
|
|
183
|
+
[&_svg]:h-5 [&_svg]:w-5
|
|
185
184
|
`,
|
|
186
185
|
medium: `
|
|
187
|
-
[&_svg]:
|
|
186
|
+
[&_svg]:h-5 [&_svg]:w-5
|
|
188
187
|
`,
|
|
189
188
|
small: `
|
|
190
|
-
[&_svg]:
|
|
189
|
+
[&_svg]:h-4 [&_svg]:w-4
|
|
191
190
|
`
|
|
192
191
|
}
|
|
193
192
|
},
|
|
@@ -198,32 +197,20 @@ const splitButtonVariants = cva(`
|
|
|
198
197
|
}
|
|
199
198
|
});
|
|
200
199
|
|
|
201
|
-
const splitButtonThemeVariants = (theme) => {
|
|
202
|
-
switch (theme) {
|
|
203
|
-
case "mona":
|
|
204
|
-
return splitButtonVariants;
|
|
205
|
-
default:
|
|
206
|
-
return splitButtonVariants; // Default to Mona styles
|
|
207
|
-
}
|
|
208
|
-
};
|
|
209
|
-
|
|
210
200
|
class SplitButtonComponent {
|
|
211
201
|
#destroyRef;
|
|
212
|
-
#themeService;
|
|
213
202
|
constructor() {
|
|
214
203
|
this.#destroyRef = inject(DestroyRef);
|
|
215
|
-
this.#themeService = inject(ThemeService);
|
|
216
204
|
this.menuItemComponents = contentChildren(PopupMenuToken, { ...(ngDevMode ? { debugName: "menuItemComponents" } : /* istanbul ignore next */ {}), descendants: false });
|
|
217
205
|
this.menuButtonRef = viewChild("menuButton", /* @ts-ignore */
|
|
218
206
|
...(ngDevMode ? [{ debugName: "menuButtonRef" }] : /* istanbul ignore next */ []));
|
|
219
207
|
this.popupMenuRef = viewChild("popupMenu", /* @ts-ignore */
|
|
220
208
|
...(ngDevMode ? [{ debugName: "popupMenuRef" }] : /* istanbul ignore next */ []));
|
|
221
209
|
this.classes = computed(() => {
|
|
222
|
-
const theme = this.#themeService.theme();
|
|
223
210
|
const look = this.look();
|
|
224
211
|
const rounded = this.rounded();
|
|
225
212
|
const size = this.size();
|
|
226
|
-
const classes = splitButtonThemeVariants(
|
|
213
|
+
const classes = splitButtonThemeVariants({
|
|
227
214
|
look,
|
|
228
215
|
rounded,
|
|
229
216
|
size
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { computed, input, Directive, model, viewChild, TemplateRef, Component,
|
|
3
|
+
import { computed, input, Directive, model, viewChild, TemplateRef, Component, output, inject, DestroyRef, ElementRef, signal, afterNextRender, afterRenderEffect, contentChildren } from '@angular/core';
|
|
4
4
|
import { where, compact, from } from '@mirei/ts-collections';
|
|
5
|
-
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
6
5
|
import { cva } from 'class-variance-authority';
|
|
7
6
|
import { v4 } from 'uuid';
|
|
8
7
|
import { Directionality } from '@angular/cdk/bidi';
|
|
@@ -105,8 +104,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
105
104
|
}]
|
|
106
105
|
}], propDecorators: { pane: [{ type: i0.Input, args: [{ isSignal: true, alias: "pane", required: true }] }], paneList: [{ type: i0.Input, args: [{ isSignal: true, alias: "paneList", required: true }] }] } });
|
|
107
106
|
|
|
108
|
-
const
|
|
109
|
-
flex
|
|
107
|
+
const splitterBaseThemeVariants = cva(`
|
|
108
|
+
flex h-full w-full min-h-0 min-w-0 overflow-hidden
|
|
110
109
|
`, {
|
|
111
110
|
variants: {
|
|
112
111
|
orientation: {
|
|
@@ -118,13 +117,13 @@ const splitterBaseVariants = cva(`
|
|
|
118
117
|
orientation: "horizontal"
|
|
119
118
|
}
|
|
120
119
|
});
|
|
121
|
-
const
|
|
122
|
-
flex items-center justify-center
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
active:bg-
|
|
126
|
-
|
|
127
|
-
focus-visible:
|
|
120
|
+
const splitterResizerThemeVariants = cva(`
|
|
121
|
+
relative flex shrink-0 items-center justify-center
|
|
122
|
+
bg-border-subtle outline-none
|
|
123
|
+
transition-colors
|
|
124
|
+
hover:bg-border-control active:bg-border-control-hover
|
|
125
|
+
focus-visible:bg-border-control
|
|
126
|
+
focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-indicator/35
|
|
128
127
|
`, {
|
|
129
128
|
variants: {
|
|
130
129
|
orientation: {
|
|
@@ -132,7 +131,7 @@ const splitterResizerVariants = cva(`
|
|
|
132
131
|
vertical: "h-0.5 flex-row"
|
|
133
132
|
},
|
|
134
133
|
resizing: {
|
|
135
|
-
true: "",
|
|
134
|
+
true: "bg-border-control-hover",
|
|
136
135
|
false: ""
|
|
137
136
|
}
|
|
138
137
|
},
|
|
@@ -141,7 +140,7 @@ const splitterResizerVariants = cva(`
|
|
|
141
140
|
resizing: false
|
|
142
141
|
}
|
|
143
142
|
});
|
|
144
|
-
const
|
|
143
|
+
const splitterResizerHandleThemeVariants = cva(`
|
|
145
144
|
flex items-center justify-center
|
|
146
145
|
[&_button]:p-0
|
|
147
146
|
`, {
|
|
@@ -156,31 +155,6 @@ const splitterResizerHandleVariants = cva(`
|
|
|
156
155
|
}
|
|
157
156
|
});
|
|
158
157
|
|
|
159
|
-
const splitterBaseThemeVariants = (theme) => {
|
|
160
|
-
switch (theme) {
|
|
161
|
-
case "mona":
|
|
162
|
-
return splitterBaseVariants;
|
|
163
|
-
default:
|
|
164
|
-
return splitterBaseVariants;
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
const splitterResizerThemeVariants = (theme) => {
|
|
168
|
-
switch (theme) {
|
|
169
|
-
case "mona":
|
|
170
|
-
return splitterResizerVariants;
|
|
171
|
-
default:
|
|
172
|
-
return splitterResizerVariants;
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
const splitterResizerHandleThemeVariants = (theme) => {
|
|
176
|
-
switch (theme) {
|
|
177
|
-
case "mona":
|
|
178
|
-
return splitterResizerHandleVariants;
|
|
179
|
-
default:
|
|
180
|
-
return splitterResizerHandleVariants;
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
|
|
184
158
|
class SplitterPaneComponent {
|
|
185
159
|
constructor() {
|
|
186
160
|
/**
|
|
@@ -238,11 +212,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
238
212
|
|
|
239
213
|
class SplitterResizerHandleComponent {
|
|
240
214
|
constructor() {
|
|
241
|
-
this.#themeService = inject(ThemeService);
|
|
242
215
|
this.baseClass = computed(() => {
|
|
243
|
-
const theme = this.#themeService.theme();
|
|
244
216
|
const orientation = this.orientation();
|
|
245
|
-
return splitterResizerHandleThemeVariants(
|
|
217
|
+
return splitterResizerHandleThemeVariants({ orientation });
|
|
246
218
|
}, /* @ts-ignore */
|
|
247
219
|
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
248
220
|
this.collapseNext = output();
|
|
@@ -256,7 +228,6 @@ class SplitterResizerHandleComponent {
|
|
|
256
228
|
this.resizable = input.required(/* @ts-ignore */
|
|
257
229
|
...(ngDevMode ? [{ debugName: "resizable" }] : /* istanbul ignore next */ []));
|
|
258
230
|
}
|
|
259
|
-
#themeService;
|
|
260
231
|
onPointerDown(event) {
|
|
261
232
|
event.preventDefault();
|
|
262
233
|
event.stopPropagation();
|
|
@@ -277,14 +248,12 @@ class SplitterResizerComponent {
|
|
|
277
248
|
#hostElementRef;
|
|
278
249
|
#paneSizeMemory;
|
|
279
250
|
#splitter;
|
|
280
|
-
#themeService;
|
|
281
251
|
constructor() {
|
|
282
252
|
this.#destroyRef = inject(DestroyRef);
|
|
283
253
|
this.#directionality = inject(Directionality);
|
|
284
254
|
this.#hostElementRef = inject(ElementRef);
|
|
285
255
|
this.#paneSizeMemory = new WeakMap();
|
|
286
256
|
this.#splitter = inject(SplitterComponent);
|
|
287
|
-
this.#themeService = inject(ThemeService);
|
|
288
257
|
this.ariaValueMax = signal(0, /* @ts-ignore */
|
|
289
258
|
...(ngDevMode ? [{ debugName: "ariaValueMax" }] : /* istanbul ignore next */ []));
|
|
290
259
|
this.ariaValueMin = signal(0, /* @ts-ignore */
|
|
@@ -292,10 +261,9 @@ class SplitterResizerComponent {
|
|
|
292
261
|
this.ariaValueNow = signal(0, /* @ts-ignore */
|
|
293
262
|
...(ngDevMode ? [{ debugName: "ariaValueNow" }] : /* istanbul ignore next */ []));
|
|
294
263
|
this.baseClass = computed(() => {
|
|
295
|
-
const theme = this.#themeService.theme();
|
|
296
264
|
const orientation = this.orientation();
|
|
297
265
|
const resizing = this.resizing();
|
|
298
|
-
return splitterResizerThemeVariants(
|
|
266
|
+
return splitterResizerThemeVariants({ orientation, resizing });
|
|
299
267
|
}, /* @ts-ignore */
|
|
300
268
|
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
301
269
|
this.hovered = signal(false, /* @ts-ignore */
|
|
@@ -798,11 +766,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
798
766
|
|
|
799
767
|
class SplitterComponent {
|
|
800
768
|
constructor() {
|
|
801
|
-
this.#themeService = inject(ThemeService);
|
|
802
769
|
this.baseClass = computed(() => {
|
|
803
|
-
const theme = this.#themeService.theme();
|
|
804
770
|
const orientation = this.orientation();
|
|
805
|
-
return splitterBaseThemeVariants(
|
|
771
|
+
return splitterBaseThemeVariants({ orientation });
|
|
806
772
|
}, /* @ts-ignore */
|
|
807
773
|
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
808
774
|
this.paneList = contentChildren(SplitterPaneComponent, /* @ts-ignore */
|
|
@@ -814,7 +780,6 @@ class SplitterComponent {
|
|
|
814
780
|
this.orientation = input("horizontal", /* @ts-ignore */
|
|
815
781
|
...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
816
782
|
}
|
|
817
|
-
#themeService;
|
|
818
783
|
/**
|
|
819
784
|
* @internal Used by SplitterResizerComponent to resolve sibling panes by id.
|
|
820
785
|
*/
|