@sparklingopinions/sparkling-ui 0.5.0 → 0.6.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 +1 -1
- package/dist/aliases.d.ts +176 -26
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Avatar/Avatar.vue.d.ts +3 -2
- package/dist/components/Avatar/Avatar.vue_vue_type_script_setup_true_lang.js +20 -14
- package/dist/components/Avatar/Avatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.vue.d.ts +1 -1
- package/dist/components/Button/Button.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/components/Button/Button.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +7 -0
- package/dist/components/ContextMenu/ContextMenu.js.map +1 -0
- package/dist/components/ContextMenu/ContextMenu.vue.d.ts +44 -0
- package/dist/components/ContextMenu/ContextMenu.vue_vue_type_script_setup_true_lang.js +84 -0
- package/dist/components/ContextMenu/ContextMenu.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/ContextMenu/index.d.ts +2 -0
- package/dist/components/DataList/DataList.js.map +1 -1
- package/dist/components/DataList/DataList.vue.d.ts +8 -0
- package/dist/components/DataList/DataList.vue_vue_type_script_setup_true_lang.js +71 -52
- package/dist/components/DataList/DataList.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/DataList/types.d.ts +5 -1
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Dialog/Dialog.vue.d.ts +22 -6
- package/dist/components/Dialog/Dialog.vue_vue_type_script_setup_true_lang.js +174 -72
- package/dist/components/Dialog/Dialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/Dialog/useSheetDrag.d.ts +16 -0
- package/dist/components/Dialog/useSheetDrag.js +37 -0
- package/dist/components/Dialog/useSheetDrag.js.map +1 -0
- package/dist/components/DropdownMenu/DropdownMenu.js.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.vue.d.ts +6 -30
- package/dist/components/DropdownMenu/DropdownMenu.vue_vue_type_script_setup_true_lang.js +54 -74
- package/dist/components/DropdownMenu/DropdownMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/EmptyState/EmptyState.js.map +1 -1
- package/dist/components/EmptyState/EmptyState.vue.d.ts +9 -3
- package/dist/components/EmptyState/EmptyState.vue_vue_type_script_setup_true_lang.js +35 -7
- package/dist/components/EmptyState/EmptyState.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/Filters/FilterMenu.js.map +1 -1
- package/dist/components/Filters/FilterMenu.vue.d.ts +20 -1
- package/dist/components/Filters/FilterMenu.vue_vue_type_script_setup_true_lang.js +78 -56
- package/dist/components/Filters/FilterMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/Filters/SortMenu.js.map +1 -1
- package/dist/components/Filters/SortMenu.vue.d.ts +21 -1
- package/dist/components/Filters/SortMenu.vue_vue_type_script_setup_true_lang.js +90 -67
- package/dist/components/Filters/SortMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/Filters/index.d.ts +1 -0
- package/dist/components/Filters/trigger.d.ts +17 -0
- package/dist/components/Filters/trigger.js +33 -0
- package/dist/components/Filters/trigger.js.map +1 -0
- package/dist/components/FormField/FormField.js.map +1 -1
- package/dist/components/FormField/FormField.vue.d.ts +10 -0
- package/dist/components/FormField/FormField.vue_vue_type_script_setup_true_lang.js +31 -20
- package/dist/components/FormField/FormField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/Icon/iconSet.js +9 -1
- package/dist/components/Icon/iconSet.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.vue.d.ts +6 -3
- package/dist/components/SegmentedControl/SegmentedControl.vue_vue_type_script_setup_true_lang.js +20 -17
- package/dist/components/SegmentedControl/SegmentedControl.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/SegmentedControl/index.d.ts +1 -1
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/Table/Table.vue.d.ts +4 -0
- package/dist/components/Table/Table.vue_vue_type_script_setup_true_lang.js +65 -56
- package/dist/components/Table/Table.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/Tag/Tag.js.map +1 -1
- package/dist/components/Tag/Tag.vue.d.ts +16 -3
- package/dist/components/Tag/Tag.vue_vue_type_script_setup_true_lang.js +42 -19
- package/dist/components/Tag/Tag.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/Toast/ToastMessage.js.map +1 -1
- package/dist/components/Toast/ToastMessage.vue.d.ts +13 -1
- package/dist/components/Toast/ToastMessage.vue_vue_type_script_setup_true_lang.js +58 -23
- package/dist/components/Toast/ToastMessage.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/Toast/Toaster.js.map +1 -1
- package/dist/components/Toast/Toaster.vue.d.ts +7 -3
- package/dist/components/Toast/Toaster.vue_vue_type_script_setup_true_lang.js +50 -21
- package/dist/components/Toast/Toaster.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/internal/MenuItemContent.js +7 -0
- package/dist/components/internal/MenuItemContent.js.map +1 -0
- package/dist/components/internal/MenuItemContent.vue.d.ts +7 -0
- package/dist/components/internal/MenuItemContent.vue_vue_type_script_setup_true_lang.js +26 -0
- package/dist/components/internal/MenuItemContent.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/internal/menu.d.ts +46 -0
- package/dist/components/internal/menu.js +33 -0
- package/dist/components/internal/menu.js.map +1 -0
- package/dist/composables/toast.d.ts +20 -5
- package/dist/composables/toast.js +28 -20
- package/dist/composables/toast.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +34 -33
- package/package.json +1 -1
- package/src/styles/tailwind.css +29 -0
package/README.md
CHANGED
|
@@ -67,7 +67,7 @@ The package is published to npm as `@sparklingopinions/sparkling-ui`. Apps insta
|
|
|
67
67
|
import { Button } from 'sparkling-ui'
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
5. `Icon` draws the library's set of
|
|
70
|
+
5. `Icon` draws the library's set of 118 icons by name: `<Icon name="users" color="ink-muted" />`. Older names (`people`, `companies`, `dot-vertical`...) resolve as aliases, and `iconNames` lists the set. To add icons or replace some of the set, register a resolver once, before mounting; names it returns a component for win. With SVG files imported as components (e.g. `vite-svg-loader`):
|
|
71
71
|
|
|
72
72
|
```ts
|
|
73
73
|
import { type Component, defineAsyncComponent } from 'vue'
|
package/dist/aliases.d.ts
CHANGED
|
@@ -182,6 +182,11 @@ export declare const List: <T extends Record<string, any>>(__VLS_props: NonNulla
|
|
|
182
182
|
'group-leading'?: (props: {
|
|
183
183
|
group: DataListGroup<T>;
|
|
184
184
|
}) => unknown;
|
|
185
|
+
'group-header'?: (props: {
|
|
186
|
+
group: DataListGroup<T>;
|
|
187
|
+
count: number;
|
|
188
|
+
collapsed: boolean;
|
|
189
|
+
}) => unknown;
|
|
185
190
|
leading?: (props: {
|
|
186
191
|
item: T;
|
|
187
192
|
}) => unknown;
|
|
@@ -200,6 +205,7 @@ export declare const List: <T extends Record<string, any>>(__VLS_props: NonNulla
|
|
|
200
205
|
rowKey?: (keyof T & string) | undefined;
|
|
201
206
|
selectable?: boolean | undefined;
|
|
202
207
|
loading?: boolean | undefined;
|
|
208
|
+
variant?: "joined" | "cards" | undefined;
|
|
203
209
|
headingLevel?: 2 | 3 | 4 | 5 | 6 | undefined;
|
|
204
210
|
onRowClick?: ((item: T) => void) | undefined;
|
|
205
211
|
onNew?: ((group: DataListGroup<T>) => void) | undefined;
|
|
@@ -220,6 +226,11 @@ export declare const List: <T extends Record<string, any>>(__VLS_props: NonNulla
|
|
|
220
226
|
'group-leading'?: (props: {
|
|
221
227
|
group: DataListGroup<T>;
|
|
222
228
|
}) => unknown;
|
|
229
|
+
'group-header'?: (props: {
|
|
230
|
+
group: DataListGroup<T>;
|
|
231
|
+
count: number;
|
|
232
|
+
collapsed: boolean;
|
|
233
|
+
}) => unknown;
|
|
223
234
|
leading?: (props: {
|
|
224
235
|
item: T;
|
|
225
236
|
}) => unknown;
|
|
@@ -262,6 +273,8 @@ export declare const Modal: {
|
|
|
262
273
|
confirmIcon: string;
|
|
263
274
|
band: string | boolean;
|
|
264
275
|
hint: string;
|
|
276
|
+
presentation: "dialog" | "auto" | "sheet";
|
|
277
|
+
sheetBelow: number;
|
|
265
278
|
}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
266
279
|
P: {};
|
|
267
280
|
B: {};
|
|
@@ -286,6 +299,8 @@ export declare const Modal: {
|
|
|
286
299
|
confirmIcon: string;
|
|
287
300
|
band: string | boolean;
|
|
288
301
|
hint: string;
|
|
302
|
+
presentation: "dialog" | "auto" | "sheet";
|
|
303
|
+
sheetBelow: number;
|
|
289
304
|
}>;
|
|
290
305
|
__isFragment?: never;
|
|
291
306
|
__isTeleport?: never;
|
|
@@ -311,8 +326,18 @@ export declare const Modal: {
|
|
|
311
326
|
confirmIcon: string;
|
|
312
327
|
band: string | boolean;
|
|
313
328
|
hint: string;
|
|
329
|
+
presentation: "dialog" | "auto" | "sheet";
|
|
330
|
+
sheetBelow: number;
|
|
314
331
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
315
332
|
$slots: {
|
|
333
|
+
title?: (props: {}) => any;
|
|
334
|
+
} & {
|
|
335
|
+
default?: (props: {}) => any;
|
|
336
|
+
} & {
|
|
337
|
+
footer?: (props: {}) => any;
|
|
338
|
+
} & {
|
|
339
|
+
'footer-start'?: (props: {}) => any;
|
|
340
|
+
} & {
|
|
316
341
|
hero?: (props: {}) => any;
|
|
317
342
|
} & {
|
|
318
343
|
title?: (props: {}) => any;
|
|
@@ -345,13 +370,13 @@ export declare const OptionsMenu: {
|
|
|
345
370
|
confirmLabel: string;
|
|
346
371
|
cancelLabel: string;
|
|
347
372
|
id: string;
|
|
373
|
+
confirmTitle: string;
|
|
374
|
+
confirmMessage: string;
|
|
375
|
+
deleteLabel: string;
|
|
348
376
|
items: DropdownMenuEntry[];
|
|
349
377
|
buttonIcon: string;
|
|
350
378
|
buttonLabel: string;
|
|
351
379
|
tooltip: string | null;
|
|
352
|
-
confirmTitle: string;
|
|
353
|
-
confirmMessage: string;
|
|
354
|
-
deleteLabel: string;
|
|
355
380
|
}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
356
381
|
P: {};
|
|
357
382
|
B: {};
|
|
@@ -370,13 +395,13 @@ export declare const OptionsMenu: {
|
|
|
370
395
|
confirmLabel: string;
|
|
371
396
|
cancelLabel: string;
|
|
372
397
|
id: string;
|
|
398
|
+
confirmTitle: string;
|
|
399
|
+
confirmMessage: string;
|
|
400
|
+
deleteLabel: string;
|
|
373
401
|
items: DropdownMenuEntry[];
|
|
374
402
|
buttonIcon: string;
|
|
375
403
|
buttonLabel: string;
|
|
376
404
|
tooltip: string | null;
|
|
377
|
-
confirmTitle: string;
|
|
378
|
-
confirmMessage: string;
|
|
379
|
-
deleteLabel: string;
|
|
380
405
|
}>;
|
|
381
406
|
__isFragment?: never;
|
|
382
407
|
__isTeleport?: never;
|
|
@@ -398,13 +423,13 @@ export declare const OptionsMenu: {
|
|
|
398
423
|
confirmLabel: string;
|
|
399
424
|
cancelLabel: string;
|
|
400
425
|
id: string;
|
|
426
|
+
confirmTitle: string;
|
|
427
|
+
confirmMessage: string;
|
|
428
|
+
deleteLabel: string;
|
|
401
429
|
items: DropdownMenuEntry[];
|
|
402
430
|
buttonIcon: string;
|
|
403
431
|
buttonLabel: string;
|
|
404
432
|
tooltip: string | null;
|
|
405
|
-
confirmTitle: string;
|
|
406
|
-
confirmMessage: string;
|
|
407
|
-
deleteLabel: string;
|
|
408
433
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
409
434
|
$slots: {
|
|
410
435
|
trigger?: (props: {
|
|
@@ -425,17 +450,67 @@ export declare const FormErrors: import("vue").DefineComponent<ErrorSummaryProps
|
|
|
425
450
|
/** @deprecated Renamed to ErrorSummaryProps. */
|
|
426
451
|
export type FormErrorsProps = ErrorSummaryProps;
|
|
427
452
|
/** @deprecated Renamed to FilterMenu. */
|
|
428
|
-
export declare const FilterFieldPicker:
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
453
|
+
export declare const FilterFieldPicker: {
|
|
454
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<FilterMenuProps & {
|
|
455
|
+
open?: boolean;
|
|
456
|
+
}> & Readonly<{
|
|
457
|
+
onPick?: ((name: string) => any) | undefined;
|
|
458
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
459
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
460
|
+
pick: (name: string) => any;
|
|
461
|
+
"update:open": (value: boolean) => any;
|
|
462
|
+
}, import("vue").PublicProps, {
|
|
463
|
+
variant: "secondary" | "tinted" | "ghost";
|
|
464
|
+
as: "button" | "chip";
|
|
465
|
+
label: string;
|
|
466
|
+
closeLabel: string;
|
|
467
|
+
buttonLabel: string;
|
|
468
|
+
status: string;
|
|
469
|
+
inUse: string[];
|
|
470
|
+
searchPlaceholder: string;
|
|
471
|
+
inUseLabel: string;
|
|
472
|
+
addLabel: string;
|
|
473
|
+
fieldsLabel: string;
|
|
474
|
+
noMatchLabel: string;
|
|
475
|
+
}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
476
|
+
P: {};
|
|
477
|
+
B: {};
|
|
478
|
+
D: {};
|
|
479
|
+
C: {};
|
|
480
|
+
M: {};
|
|
481
|
+
Defaults: {};
|
|
482
|
+
}, Readonly<FilterMenuProps & {
|
|
483
|
+
open?: boolean;
|
|
484
|
+
}> & Readonly<{
|
|
485
|
+
onPick?: ((name: string) => any) | undefined;
|
|
486
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
487
|
+
}>, {}, {}, {}, {}, {
|
|
488
|
+
variant: "secondary" | "tinted" | "ghost";
|
|
489
|
+
as: "button" | "chip";
|
|
490
|
+
label: string;
|
|
491
|
+
closeLabel: string;
|
|
492
|
+
buttonLabel: string;
|
|
493
|
+
status: string;
|
|
494
|
+
inUse: string[];
|
|
495
|
+
searchPlaceholder: string;
|
|
496
|
+
inUseLabel: string;
|
|
497
|
+
addLabel: string;
|
|
498
|
+
fieldsLabel: string;
|
|
499
|
+
noMatchLabel: string;
|
|
500
|
+
}>;
|
|
501
|
+
__isFragment?: never;
|
|
502
|
+
__isTeleport?: never;
|
|
503
|
+
__isSuspense?: never;
|
|
504
|
+
} & import("vue").ComponentOptionsBase<Readonly<FilterMenuProps & {
|
|
434
505
|
open?: boolean;
|
|
435
506
|
}> & Readonly<{
|
|
436
507
|
onPick?: ((name: string) => any) | undefined;
|
|
437
508
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
438
|
-
}>, {
|
|
509
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
510
|
+
pick: (name: string) => any;
|
|
511
|
+
"update:open": (value: boolean) => any;
|
|
512
|
+
}, string, {
|
|
513
|
+
variant: "secondary" | "tinted" | "ghost";
|
|
439
514
|
as: "button" | "chip";
|
|
440
515
|
label: string;
|
|
441
516
|
closeLabel: string;
|
|
@@ -447,23 +522,79 @@ export declare const FilterFieldPicker: import("vue").DefineComponent<FilterMenu
|
|
|
447
522
|
addLabel: string;
|
|
448
523
|
fieldsLabel: string;
|
|
449
524
|
noMatchLabel: string;
|
|
450
|
-
}, {},
|
|
525
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
526
|
+
$slots: {
|
|
527
|
+
trigger?: (props: {
|
|
528
|
+
open: boolean;
|
|
529
|
+
toggle: () => void;
|
|
530
|
+
count: number;
|
|
531
|
+
props: import("./index.ts").FilterTriggerProps;
|
|
532
|
+
}) => unknown;
|
|
533
|
+
};
|
|
534
|
+
});
|
|
451
535
|
/** @deprecated Renamed to FilterMenuProps. */
|
|
452
536
|
export type FilterFieldPickerProps = FilterMenuProps;
|
|
453
537
|
/** @deprecated Renamed to SortMenu. */
|
|
454
|
-
export declare const SortControl:
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
538
|
+
export declare const SortControl: {
|
|
539
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<SortMenuProps & {
|
|
540
|
+
modelValue?: import("./index.ts").ViewSort | null;
|
|
541
|
+
open?: boolean;
|
|
542
|
+
}> & Readonly<{
|
|
543
|
+
"onUpdate:modelValue"?: ((value: import("./index.ts").ViewSort | null) => any) | undefined;
|
|
544
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
545
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
546
|
+
"update:modelValue": (value: import("./index.ts").ViewSort | null) => any;
|
|
547
|
+
"update:open": (value: boolean) => any;
|
|
548
|
+
}, import("vue").PublicProps, {
|
|
549
|
+
variant: "secondary" | "tinted" | "ghost";
|
|
550
|
+
as: "button" | "chip";
|
|
551
|
+
title: string;
|
|
552
|
+
clearLabel: string;
|
|
553
|
+
closeLabel: string;
|
|
554
|
+
buttonLabel: string;
|
|
555
|
+
status: string;
|
|
556
|
+
directionLabels: Partial<Record<import("./index.ts").FilterFieldType, [string, string]>>;
|
|
557
|
+
directionLabel: string;
|
|
558
|
+
doneLabel: string;
|
|
559
|
+
}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
560
|
+
P: {};
|
|
561
|
+
B: {};
|
|
562
|
+
D: {};
|
|
563
|
+
C: {};
|
|
564
|
+
M: {};
|
|
565
|
+
Defaults: {};
|
|
566
|
+
}, Readonly<SortMenuProps & {
|
|
567
|
+
modelValue?: import("./index.ts").ViewSort | null;
|
|
568
|
+
open?: boolean;
|
|
569
|
+
}> & Readonly<{
|
|
570
|
+
"onUpdate:modelValue"?: ((value: import("./index.ts").ViewSort | null) => any) | undefined;
|
|
571
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
572
|
+
}>, {}, {}, {}, {}, {
|
|
573
|
+
variant: "secondary" | "tinted" | "ghost";
|
|
574
|
+
as: "button" | "chip";
|
|
575
|
+
title: string;
|
|
576
|
+
clearLabel: string;
|
|
577
|
+
closeLabel: string;
|
|
578
|
+
buttonLabel: string;
|
|
579
|
+
status: string;
|
|
580
|
+
directionLabels: Partial<Record<import("./index.ts").FilterFieldType, [string, string]>>;
|
|
581
|
+
directionLabel: string;
|
|
582
|
+
doneLabel: string;
|
|
583
|
+
}>;
|
|
584
|
+
__isFragment?: never;
|
|
585
|
+
__isTeleport?: never;
|
|
586
|
+
__isSuspense?: never;
|
|
587
|
+
} & import("vue").ComponentOptionsBase<Readonly<SortMenuProps & {
|
|
461
588
|
modelValue?: import("./index.ts").ViewSort | null;
|
|
462
589
|
open?: boolean;
|
|
463
590
|
}> & Readonly<{
|
|
464
591
|
"onUpdate:modelValue"?: ((value: import("./index.ts").ViewSort | null) => any) | undefined;
|
|
465
592
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
466
|
-
}>, {
|
|
593
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
594
|
+
"update:modelValue": (value: import("./index.ts").ViewSort | null) => any;
|
|
595
|
+
"update:open": (value: boolean) => any;
|
|
596
|
+
}, string, {
|
|
597
|
+
variant: "secondary" | "tinted" | "ghost";
|
|
467
598
|
as: "button" | "chip";
|
|
468
599
|
title: string;
|
|
469
600
|
clearLabel: string;
|
|
@@ -473,7 +604,17 @@ export declare const SortControl: import("vue").DefineComponent<SortMenuProps &
|
|
|
473
604
|
directionLabels: Partial<Record<import("./index.ts").FilterFieldType, [string, string]>>;
|
|
474
605
|
directionLabel: string;
|
|
475
606
|
doneLabel: string;
|
|
476
|
-
}, {},
|
|
607
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
608
|
+
$slots: {
|
|
609
|
+
trigger?: (props: {
|
|
610
|
+
open: boolean;
|
|
611
|
+
toggle: () => void;
|
|
612
|
+
active: boolean;
|
|
613
|
+
label: string;
|
|
614
|
+
props: import("./index.ts").FilterTriggerProps;
|
|
615
|
+
}) => unknown;
|
|
616
|
+
};
|
|
617
|
+
});
|
|
477
618
|
/** @deprecated Renamed to SortMenuProps. */
|
|
478
619
|
export type SortControlProps = SortMenuProps;
|
|
479
620
|
/** @deprecated Renamed to FormField. */
|
|
@@ -484,10 +625,13 @@ export declare const Field: {
|
|
|
484
625
|
id: string;
|
|
485
626
|
hint: string;
|
|
486
627
|
maxLength: number;
|
|
628
|
+
softLimit: number;
|
|
487
629
|
layout: "stacked" | "inline";
|
|
488
630
|
optionalLabel: string;
|
|
489
631
|
requiredLabel: string;
|
|
490
632
|
counterLabel: string;
|
|
633
|
+
softCounterLabel: string;
|
|
634
|
+
overSoftLabel: string;
|
|
491
635
|
}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
492
636
|
P: {};
|
|
493
637
|
B: {};
|
|
@@ -501,10 +645,13 @@ export declare const Field: {
|
|
|
501
645
|
id: string;
|
|
502
646
|
hint: string;
|
|
503
647
|
maxLength: number;
|
|
648
|
+
softLimit: number;
|
|
504
649
|
layout: "stacked" | "inline";
|
|
505
650
|
optionalLabel: string;
|
|
506
651
|
requiredLabel: string;
|
|
507
652
|
counterLabel: string;
|
|
653
|
+
softCounterLabel: string;
|
|
654
|
+
overSoftLabel: string;
|
|
508
655
|
}>;
|
|
509
656
|
__isFragment?: never;
|
|
510
657
|
__isTeleport?: never;
|
|
@@ -515,10 +662,13 @@ export declare const Field: {
|
|
|
515
662
|
id: string;
|
|
516
663
|
hint: string;
|
|
517
664
|
maxLength: number;
|
|
665
|
+
softLimit: number;
|
|
518
666
|
layout: "stacked" | "inline";
|
|
519
667
|
optionalLabel: string;
|
|
520
668
|
requiredLabel: string;
|
|
521
669
|
counterLabel: string;
|
|
670
|
+
softCounterLabel: string;
|
|
671
|
+
overSoftLabel: string;
|
|
522
672
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
523
673
|
$slots: {
|
|
524
674
|
default?: (props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","names":["_sfc_main","Avatar_vue_vue_type_script_setup_true_lang_default","Avatar_default"],"sources":["../../../src/components/Avatar/Avatar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\n\nimport { type Hue, hueFor } from '../../utils/hues'\n\nexport interface AvatarProps {\n name?: string | null\n image?: string | null\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n shape?: 'circle' | 'square'\n /** An attention dot, e.g. unread. */\n badge?: boolean\n /** Pins the colour when it means something; otherwise it comes from the name, stable per person. */\n hue?: Hue\n}\n\nconst props = withDefaults(defineProps<AvatarProps>(), {\n name: undefined,\n image: undefined,\n size: 'sm',\n shape: 'circle',\n hue: undefined\n})\n\n// One uppercased initial reads cleaner than two letters.\nconst initial = computed(() => (props.name || '?').trim().charAt(0).toUpperCase() || '?')\n\nconst sizes = {\n xs: 'h-4 w-4 text-10',\n sm: 'h-6 w-6 text-11',\n md: 'h-8 w-8 text-xs',\n lg: 'h-10 w-10 text-sm',\n xl: 'h-16 w-16 text-2xl'\n}\n\n// A soft coin of one hue: tinted fill, saturated text, a hairline of the hue.\nconst hues: Record<Hue, string> = {\n blue: 'border-sui-hue-blue-line bg-sui-hue-blue-soft text-sui-hue-blue-ink',\n green: 'border-sui-hue-green-line bg-sui-hue-green-soft text-sui-hue-green-ink',\n orange: 'border-sui-hue-orange-line bg-sui-hue-orange-soft text-sui-hue-orange-ink',\n pink: 'border-sui-hue-pink-line bg-sui-hue-pink-soft text-sui-hue-pink-ink',\n purple: 'border-sui-hue-purple-line bg-sui-hue-purple-soft text-sui-hue-purple-ink',\n slate: 'border-sui-hue-slate-line bg-sui-hue-slate-soft text-sui-hue-slate-ink',\n red: 'border-sui-hue-red-line bg-sui-hue-red-soft text-sui-hue-red-ink',\n amber: 'border-sui-hue-amber-line bg-sui-hue-amber-soft text-sui-hue-amber-ink',\n gray: 'border-sui-line bg-sui-sunken text-sui-ink-body'\n}\n\nconst shapeClass = computed(() => (props.shape === 'square' ? 'rounded-lg' : 'rounded-full'))\n\n// A photo gets a neutral hairline, so it reads as a crisp coin too.\nconst colorClass = computed(() => (props.image ? 'border-sui-line-subtle' : hues[props.hue ?? hueFor(props.name)]))\n</script>\n\n<template>\n <div\n class=\"relative inline-flex shrink-0 items-center justify-center border font-semibold\"\n :class=\"[
|
|
1
|
+
{"version":3,"file":"Avatar.js","names":["_sfc_main","Avatar_vue_vue_type_script_setup_true_lang_default","Avatar_default"],"sources":["../../../src/components/Avatar/Avatar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\n\nimport { type Hue, hueFor } from '../../utils/hues'\n\nexport interface AvatarProps {\n name?: string | null\n image?: string | null\n /** xs 16, sm 24, md 32, lg 40, xl 64; or a number of px, 20 for list rows and activity feeds. */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number\n shape?: 'circle' | 'square'\n /** An attention dot, e.g. unread. */\n badge?: boolean\n /** Pins the colour when it means something; otherwise it comes from the name, stable per person. */\n hue?: Hue\n}\n\nconst props = withDefaults(defineProps<AvatarProps>(), {\n name: undefined,\n image: undefined,\n size: 'sm',\n shape: 'circle',\n hue: undefined\n})\n\n// One uppercased initial reads cleaner than two letters.\nconst initial = computed(() => (props.name || '?').trim().charAt(0).toUpperCase() || '?')\n\nconst sizes = {\n xs: 'h-4 w-4 text-10',\n sm: 'h-6 w-6 text-11',\n md: 'h-8 w-8 text-xs',\n lg: 'h-10 w-10 text-sm',\n xl: 'h-16 w-16 text-2xl'\n}\n\n// A soft coin of one hue: tinted fill, saturated text, a hairline of the hue.\nconst hues: Record<Hue, string> = {\n blue: 'border-sui-hue-blue-line bg-sui-hue-blue-soft text-sui-hue-blue-ink',\n green: 'border-sui-hue-green-line bg-sui-hue-green-soft text-sui-hue-green-ink',\n orange: 'border-sui-hue-orange-line bg-sui-hue-orange-soft text-sui-hue-orange-ink',\n pink: 'border-sui-hue-pink-line bg-sui-hue-pink-soft text-sui-hue-pink-ink',\n purple: 'border-sui-hue-purple-line bg-sui-hue-purple-soft text-sui-hue-purple-ink',\n slate: 'border-sui-hue-slate-line bg-sui-hue-slate-soft text-sui-hue-slate-ink',\n red: 'border-sui-hue-red-line bg-sui-hue-red-soft text-sui-hue-red-ink',\n amber: 'border-sui-hue-amber-line bg-sui-hue-amber-soft text-sui-hue-amber-ink',\n gray: 'border-sui-line bg-sui-sunken text-sui-ink-body'\n}\n\n// A number of px: the initial steps down with the coin.\nconst sizeClass = computed(() => {\n if (typeof props.size !== 'number') return sizes[props.size]\n if (props.size <= 20) return 'text-10'\n if (props.size <= 28) return 'text-11'\n return props.size <= 36 ? 'text-xs' : 'text-sm'\n})\nconst sizeStyle = computed(() =>\n typeof props.size === 'number' ? { width: `${props.size}px`, height: `${props.size}px` } : undefined\n)\n\nconst shapeClass = computed(() => (props.shape === 'square' ? 'rounded-lg' : 'rounded-full'))\n\n// A photo gets a neutral hairline, so it reads as a crisp coin too.\nconst colorClass = computed(() => (props.image ? 'border-sui-line-subtle' : hues[props.hue ?? hueFor(props.name)]))\n</script>\n\n<template>\n <div\n class=\"relative inline-flex shrink-0 items-center justify-center border font-semibold\"\n :class=\"[sizeClass, shapeClass, colorClass]\"\n :style=\"sizeStyle\"\n >\n <img v-if=\"image\" alt=\"\" class=\"h-full w-full object-cover\" :class=\"shapeClass\" :src=\"image\" />\n <template v-else>{{ initial }}</template>\n <span\n v-if=\"badge\"\n class=\"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-sui-accent-solid ring-2 ring-sui-surface\"\n />\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -2,7 +2,8 @@ import { type Hue } from '../../utils/hues';
|
|
|
2
2
|
export interface AvatarProps {
|
|
3
3
|
name?: string | null;
|
|
4
4
|
image?: string | null;
|
|
5
|
-
|
|
5
|
+
/** xs 16, sm 24, md 32, lg 40, xl 64; or a number of px, 20 for list rows and activity feeds. */
|
|
6
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number;
|
|
6
7
|
shape?: 'circle' | 'square';
|
|
7
8
|
/** An attention dot, e.g. unread. */
|
|
8
9
|
badge?: boolean;
|
|
@@ -10,7 +11,7 @@ export interface AvatarProps {
|
|
|
10
11
|
hue?: Hue;
|
|
11
12
|
}
|
|
12
13
|
declare const __VLS_export: import("vue").DefineComponent<AvatarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AvatarProps> & Readonly<{}>, {
|
|
13
|
-
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
14
|
+
size: number | "xs" | "sm" | "md" | "lg" | "xl";
|
|
14
15
|
image: string | null;
|
|
15
16
|
name: string | null;
|
|
16
17
|
shape: "circle" | "square";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { hueFor as e } from "../../utils/hues.js";
|
|
2
|
-
import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, createTextVNode as a, defineComponent as o, normalizeClass as s,
|
|
2
|
+
import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, createTextVNode as a, defineComponent as o, normalizeClass as s, normalizeStyle as c, openBlock as l, toDisplayString as u } from "vue";
|
|
3
3
|
//#region src/components/Avatar/Avatar.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
4
|
+
var d = ["src"], f = {
|
|
5
5
|
key: 2,
|
|
6
6
|
class: "absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-sui-accent-solid ring-2 ring-sui-surface"
|
|
7
|
-
},
|
|
7
|
+
}, p = /*@__PURE__*/ o({
|
|
8
8
|
__name: "Avatar",
|
|
9
9
|
props: {
|
|
10
10
|
name: { default: void 0 },
|
|
@@ -15,13 +15,13 @@ var u = ["src"], d = {
|
|
|
15
15
|
hue: { default: void 0 }
|
|
16
16
|
},
|
|
17
17
|
setup(o) {
|
|
18
|
-
let
|
|
18
|
+
let p = o, m = n(() => (p.name || "?").trim().charAt(0).toUpperCase() || "?"), h = {
|
|
19
19
|
xs: "h-4 w-4 text-10",
|
|
20
20
|
sm: "h-6 w-6 text-11",
|
|
21
21
|
md: "h-8 w-8 text-xs",
|
|
22
22
|
lg: "h-10 w-10 text-sm",
|
|
23
23
|
xl: "h-16 w-16 text-2xl"
|
|
24
|
-
},
|
|
24
|
+
}, g = {
|
|
25
25
|
blue: "border-sui-hue-blue-line bg-sui-hue-blue-soft text-sui-hue-blue-ink",
|
|
26
26
|
green: "border-sui-hue-green-line bg-sui-hue-green-soft text-sui-hue-green-ink",
|
|
27
27
|
orange: "border-sui-hue-orange-line bg-sui-hue-orange-soft text-sui-hue-orange-ink",
|
|
@@ -31,20 +31,26 @@ var u = ["src"], d = {
|
|
|
31
31
|
red: "border-sui-hue-red-line bg-sui-hue-red-soft text-sui-hue-red-ink",
|
|
32
32
|
amber: "border-sui-hue-amber-line bg-sui-hue-amber-soft text-sui-hue-amber-ink",
|
|
33
33
|
gray: "border-sui-line bg-sui-sunken text-sui-ink-body"
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
}, _ = n(() => typeof p.size == "number" ? p.size <= 20 ? "text-10" : p.size <= 28 ? "text-11" : p.size <= 36 ? "text-xs" : "text-sm" : h[p.size]), v = n(() => typeof p.size == "number" ? {
|
|
35
|
+
width: `${p.size}px`,
|
|
36
|
+
height: `${p.size}px`
|
|
37
|
+
} : void 0), y = n(() => p.shape === "square" ? "rounded-lg" : "rounded-full"), b = n(() => p.image ? "border-sui-line-subtle" : g[p.hue ?? e(p.name)]);
|
|
38
|
+
return (e, n) => (l(), i("div", {
|
|
39
|
+
class: s(["relative inline-flex shrink-0 items-center justify-center border font-semibold", [
|
|
40
|
+
_.value,
|
|
41
|
+
y.value,
|
|
42
|
+
b.value
|
|
43
|
+
]]),
|
|
44
|
+
style: c(v.value)
|
|
45
|
+
}, [o.image ? (l(), i("img", {
|
|
40
46
|
key: 0,
|
|
41
47
|
alt: "",
|
|
42
|
-
class: s(["h-full w-full object-cover",
|
|
48
|
+
class: s(["h-full w-full object-cover", y.value]),
|
|
43
49
|
src: o.image
|
|
44
|
-
}, null, 10,
|
|
50
|
+
}, null, 10, d)) : (l(), i(t, { key: 1 }, [a(u(m.value), 1)], 64)), o.badge ? (l(), i("span", f)) : r("", !0)], 6));
|
|
45
51
|
}
|
|
46
52
|
});
|
|
47
53
|
//#endregion
|
|
48
|
-
export {
|
|
54
|
+
export { p as default };
|
|
49
55
|
|
|
50
56
|
//# sourceMappingURL=Avatar.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_Fragment","_createTextVNode","_toDisplayString","_createCommentVNode","_hoisted_1","_hoisted_2","Avatar_vue_vue_type_script_setup_true_lang_default","props","__props","initial","computed","sizes","hues","shapeClass","colorClass","hueFor","openBlock","createElementBlock","normalizeClass","Fragment","createTextVNode","toDisplayString","createCommentVNode"],"sources":["../../../src/components/Avatar/Avatar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\n\nimport { type Hue, hueFor } from '../../utils/hues'\n\nexport interface AvatarProps {\n name?: string | null\n image?: string | null\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n shape?: 'circle' | 'square'\n /** An attention dot, e.g. unread. */\n badge?: boolean\n /** Pins the colour when it means something; otherwise it comes from the name, stable per person. */\n hue?: Hue\n}\n\nconst props = withDefaults(defineProps<AvatarProps>(), {\n name: undefined,\n image: undefined,\n size: 'sm',\n shape: 'circle',\n hue: undefined\n})\n\n// One uppercased initial reads cleaner than two letters.\nconst initial = computed(() => (props.name || '?').trim().charAt(0).toUpperCase() || '?')\n\nconst sizes = {\n xs: 'h-4 w-4 text-10',\n sm: 'h-6 w-6 text-11',\n md: 'h-8 w-8 text-xs',\n lg: 'h-10 w-10 text-sm',\n xl: 'h-16 w-16 text-2xl'\n}\n\n// A soft coin of one hue: tinted fill, saturated text, a hairline of the hue.\nconst hues: Record<Hue, string> = {\n blue: 'border-sui-hue-blue-line bg-sui-hue-blue-soft text-sui-hue-blue-ink',\n green: 'border-sui-hue-green-line bg-sui-hue-green-soft text-sui-hue-green-ink',\n orange: 'border-sui-hue-orange-line bg-sui-hue-orange-soft text-sui-hue-orange-ink',\n pink: 'border-sui-hue-pink-line bg-sui-hue-pink-soft text-sui-hue-pink-ink',\n purple: 'border-sui-hue-purple-line bg-sui-hue-purple-soft text-sui-hue-purple-ink',\n slate: 'border-sui-hue-slate-line bg-sui-hue-slate-soft text-sui-hue-slate-ink',\n red: 'border-sui-hue-red-line bg-sui-hue-red-soft text-sui-hue-red-ink',\n amber: 'border-sui-hue-amber-line bg-sui-hue-amber-soft text-sui-hue-amber-ink',\n gray: 'border-sui-line bg-sui-sunken text-sui-ink-body'\n}\n\nconst shapeClass = computed(() => (props.shape === 'square' ? 'rounded-lg' : 'rounded-full'))\n\n// A photo gets a neutral hairline, so it reads as a crisp coin too.\nconst colorClass = computed(() => (props.image ? 'border-sui-line-subtle' : hues[props.hue ?? hueFor(props.name)]))\n</script>\n\n<template>\n <div\n class=\"relative inline-flex shrink-0 items-center justify-center border font-semibold\"\n :class=\"[
|
|
1
|
+
{"version":3,"file":"Avatar.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_normalizeStyle","_Fragment","_createTextVNode","_toDisplayString","_createCommentVNode","_hoisted_1","_hoisted_2","Avatar_vue_vue_type_script_setup_true_lang_default","props","__props","initial","computed","sizes","hues","sizeClass","sizeStyle","shapeClass","colorClass","hueFor","openBlock","createElementBlock","normalizeClass","normalizeStyle","Fragment","createTextVNode","toDisplayString","createCommentVNode"],"sources":["../../../src/components/Avatar/Avatar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\n\nimport { type Hue, hueFor } from '../../utils/hues'\n\nexport interface AvatarProps {\n name?: string | null\n image?: string | null\n /** xs 16, sm 24, md 32, lg 40, xl 64; or a number of px, 20 for list rows and activity feeds. */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number\n shape?: 'circle' | 'square'\n /** An attention dot, e.g. unread. */\n badge?: boolean\n /** Pins the colour when it means something; otherwise it comes from the name, stable per person. */\n hue?: Hue\n}\n\nconst props = withDefaults(defineProps<AvatarProps>(), {\n name: undefined,\n image: undefined,\n size: 'sm',\n shape: 'circle',\n hue: undefined\n})\n\n// One uppercased initial reads cleaner than two letters.\nconst initial = computed(() => (props.name || '?').trim().charAt(0).toUpperCase() || '?')\n\nconst sizes = {\n xs: 'h-4 w-4 text-10',\n sm: 'h-6 w-6 text-11',\n md: 'h-8 w-8 text-xs',\n lg: 'h-10 w-10 text-sm',\n xl: 'h-16 w-16 text-2xl'\n}\n\n// A soft coin of one hue: tinted fill, saturated text, a hairline of the hue.\nconst hues: Record<Hue, string> = {\n blue: 'border-sui-hue-blue-line bg-sui-hue-blue-soft text-sui-hue-blue-ink',\n green: 'border-sui-hue-green-line bg-sui-hue-green-soft text-sui-hue-green-ink',\n orange: 'border-sui-hue-orange-line bg-sui-hue-orange-soft text-sui-hue-orange-ink',\n pink: 'border-sui-hue-pink-line bg-sui-hue-pink-soft text-sui-hue-pink-ink',\n purple: 'border-sui-hue-purple-line bg-sui-hue-purple-soft text-sui-hue-purple-ink',\n slate: 'border-sui-hue-slate-line bg-sui-hue-slate-soft text-sui-hue-slate-ink',\n red: 'border-sui-hue-red-line bg-sui-hue-red-soft text-sui-hue-red-ink',\n amber: 'border-sui-hue-amber-line bg-sui-hue-amber-soft text-sui-hue-amber-ink',\n gray: 'border-sui-line bg-sui-sunken text-sui-ink-body'\n}\n\n// A number of px: the initial steps down with the coin.\nconst sizeClass = computed(() => {\n if (typeof props.size !== 'number') return sizes[props.size]\n if (props.size <= 20) return 'text-10'\n if (props.size <= 28) return 'text-11'\n return props.size <= 36 ? 'text-xs' : 'text-sm'\n})\nconst sizeStyle = computed(() =>\n typeof props.size === 'number' ? { width: `${props.size}px`, height: `${props.size}px` } : undefined\n)\n\nconst shapeClass = computed(() => (props.shape === 'square' ? 'rounded-lg' : 'rounded-full'))\n\n// A photo gets a neutral hairline, so it reads as a crisp coin too.\nconst colorClass = computed(() => (props.image ? 'border-sui-line-subtle' : hues[props.hue ?? hueFor(props.name)]))\n</script>\n\n<template>\n <div\n class=\"relative inline-flex shrink-0 items-center justify-center border font-semibold\"\n :class=\"[sizeClass, shapeClass, colorClass]\"\n :style=\"sizeStyle\"\n >\n <img v-if=\"image\" alt=\"\" class=\"h-full w-full object-cover\" :class=\"shapeClass\" :src=\"image\" />\n <template v-else>{{ initial }}</template>\n <span\n v-if=\"badge\"\n class=\"absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-sui-accent-solid ring-2 ring-sui-surface\"\n />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;EAiBA,IAAMW,IAAQC,GASRC,IAAUC,SAAgBH,EAAM,QAAQ,IAAA,CAAK,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,KAAK,GAAG,GAElFI,IAAQ;GACZ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN,GAGMC,IAA4B;GAChC,MAAM;GACN,OAAO;GACP,QAAQ;GACR,MAAM;GACN,QAAQ;GACR,OAAO;GACP,KAAK;GACL,OAAO;GACP,MAAM;EACR,GAGMC,IAAYH,QACZ,OAAOH,EAAM,QAAS,WACtBA,EAAM,QAAQ,KAAW,YACzBA,EAAM,QAAQ,KAAW,YACtBA,EAAM,QAAQ,KAAK,YAAY,YAHKI,EAAMJ,EAAM,KAIxD,GACKO,IAAYJ,QAChB,OAAOH,EAAM,QAAS,WAAW;GAAE,OAAO,GAAGA,EAAM,KAAK;GAAK,QAAQ,GAAGA,EAAM,KAAK;EAAI,IAAI,KAAA,CAC7F,GAEMQ,IAAaL,QAAgBH,EAAM,UAAU,WAAW,eAAe,cAAe,GAGtFS,IAAaN,QAAgBH,EAAM,QAAQ,2BAA2BK,EAAKL,EAAM,OAAOU,EAAOV,EAAM,IAAI,EAAG;E,kBAIhHX,EAAA,GAAAC,EAWM,OAAA;GAVJ,OAAKC,EAAA,CAAC,kFAAgF;IAC7Ee,EAAA;IAAWE,EAAA;IAAYC,EAAA;GAAU,CAAA,CAAA;GACzC,OAAKjB,EAAEe,EAAA,KAAS;E,IAENN,EAAA,SAAXZ,EAAA,GAAAC,EAA+F,OAAA;;GAA7E,KAAI;GAAG,OAAKC,EAAA,CAAC,8BAAqCiB,EAAA,KAAU,CAAA;GAAG,KAAKP,EAAA;E,oBACtFZ,EAAA,GAAAC,EAAyCG,GAAA,EAAA,KAAA,EAAA,GAAA,CAArBC,EAAAC,EAAAO,EAAA,KAAO,GAAA,CAAA,C,SAEnBD,EAAA,SADRZ,EAAA,GAAAC,EAGE,QAHFQ,CAGE,K"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","names":["_sfc_main","Button_vue_vue_type_script_setup_true_lang_default","Button_default"],"sources":["../../../src/components/Button/Button.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\n\nimport { Primitive, type PrimitiveProps } from 'reka-ui'\n\nexport type ButtonVariant
|
|
1
|
+
{"version":3,"file":"Button.js","names":["_sfc_main","Button_vue_vue_type_script_setup_true_lang_default","Button_default"],"sources":["../../../src/components/Button/Button.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\n\nimport { Primitive, type PrimitiveProps } from 'reka-ui'\n\nexport type ButtonVariant =\n 'primary' | 'secondary' | 'tinted' | 'ghost' | 'contrast' | 'danger' | 'danger-outline' | 'ghost-inverse'\nexport type ButtonSize = 'xs' | 'sm' | 'md' | 'lg'\n\nexport interface ButtonProps extends PrimitiveProps {\n variant?: ButtonVariant\n size?: ButtonSize\n /** Fully rounded ends. */\n pill?: boolean\n /** Square, for a single icon; give it an `aria-label`. */\n iconOnly?: boolean\n /** Where the icon sits next to the label; it's spaced from the text on the other side. */\n iconPosition?: 'start' | 'end'\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<ButtonProps>(), {\n as: 'button',\n variant: 'secondary',\n size: 'md',\n iconPosition: 'start'\n})\n\nconst variants: Record<ButtonVariant, string> = {\n primary:\n 'border border-sui-accent-solid bg-sui-accent-solid text-sui-on-accent not-data-disabled:hover:border-sui-accent-hover not-data-disabled:hover:bg-sui-accent-hover [&_svg]:stroke-sui-on-accent',\n secondary:\n 'border border-sui-line bg-sui-surface text-sui-ink-emphasis shadow-(--sui-shadow-raised) not-data-disabled:hover:border-sui-line-strong not-data-disabled:hover:bg-sui-canvas [&_svg]:stroke-sui-ink-emphasis',\n tinted:\n 'border border-sui-accent-line bg-sui-accent-wash text-sui-accent not-data-disabled:hover:bg-sui-accent-soft [&_svg]:stroke-sui-accent',\n ghost:\n 'border border-transparent bg-transparent text-sui-ink-subtle not-data-disabled:hover:bg-sui-sunken not-data-disabled:hover:text-sui-ink-emphasis',\n contrast:\n 'border border-sui-contrast bg-sui-contrast text-sui-on-contrast not-data-disabled:hover:border-sui-contrast-hover not-data-disabled:hover:bg-sui-contrast-hover',\n // No border: it's 2px narrower than the other variants.\n danger: 'bg-sui-danger-solid text-sui-on-danger not-data-disabled:hover:bg-sui-danger-hover',\n 'danger-outline':\n 'border border-sui-danger-line bg-sui-surface text-sui-danger not-data-disabled:hover:bg-sui-danger-soft [&_svg]:stroke-sui-danger',\n // For inverse grounds: toasts, dark bands.\n 'ghost-inverse':\n 'border border-transparent bg-transparent text-sui-on-inverse not-data-disabled:hover:bg-sui-on-inverse/[0.12] not-data-disabled:active:bg-sui-on-inverse/[0.2] [&_svg]:stroke-sui-on-inverse'\n}\n\nconst heights: Record<ButtonSize, string> = {\n xs: 'h-6',\n sm: 'h-7',\n md: 'h-(--sui-button-height)',\n lg: 'h-12'\n}\n\nconst paddings: Record<ButtonSize, string> = {\n xs: 'px-2',\n sm: 'px-2.5',\n md: 'px-(--sui-button-padding-x)',\n lg: 'px-(--sui-button-padding-x)'\n}\n\nconst texts: Record<ButtonSize, string> = {\n xs: 'text-xs',\n sm: 'text-sm',\n md: 'text-(length:--sui-button-text) leading-5',\n lg: 'text-(length:--sui-button-text) leading-5'\n}\n\nconst classes = computed(() => [\n // no-underline: as a link, it shouldn't pick up the app's link styles.\n 'flex items-center justify-center font-medium text-nowrap no-underline transition-all duration-200 ease-in-out data-disabled:opacity-50',\n props.variant === 'ghost-inverse' ? 'focus-visible:sui-ring-inverse' : 'focus-visible:sui-ring',\n variants[props.variant],\n heights[props.size],\n texts[props.size],\n props.iconOnly ? 'aspect-square px-0' : paddings[props.size],\n // xs uses rounded-md: rounded-lg reads as a pill at that height.\n props.pill ? 'rounded-full' : props.size === 'xs' ? 'rounded-md' : 'rounded-(--sui-radius-button)',\n props.iconOnly ? '' : props.iconPosition === 'end' ? '[&_svg]:ml-2' : '[&_svg:first-child]:mr-2'\n])\n\n// A link or custom element can't be natively disabled: it says so to assistive tech instead.\nconst isNativeButton = computed(() => props.as === 'button' && !props.asChild)\n</script>\n\n<template>\n <Primitive\n :aria-disabled=\"disabled && !isNativeButton ? 'true' : undefined\"\n :as=\"as\"\n :as-child=\"asChild\"\n :class=\"classes\"\n :data-disabled=\"disabled ? '' : undefined\"\n :disabled=\"isNativeButton ? disabled : undefined\"\n >\n <slot />\n </Primitive>\n</template>\n"],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type PrimitiveProps } from 'reka-ui';
|
|
2
|
-
export type ButtonVariant = 'primary' | 'secondary' | 'tinted' | 'ghost' | 'contrast' | 'danger' | 'danger-outline';
|
|
2
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'tinted' | 'ghost' | 'contrast' | 'danger' | 'danger-outline' | 'ghost-inverse';
|
|
3
3
|
export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
4
4
|
export interface ButtonProps extends PrimitiveProps {
|
|
5
5
|
variant?: ButtonVariant;
|
|
@@ -21,7 +21,8 @@ var l = /*@__PURE__*/ n({
|
|
|
21
21
|
ghost: "border border-transparent bg-transparent text-sui-ink-subtle not-data-disabled:hover:bg-sui-sunken not-data-disabled:hover:text-sui-ink-emphasis",
|
|
22
22
|
contrast: "border border-sui-contrast bg-sui-contrast text-sui-on-contrast not-data-disabled:hover:border-sui-contrast-hover not-data-disabled:hover:bg-sui-contrast-hover",
|
|
23
23
|
danger: "bg-sui-danger-solid text-sui-on-danger not-data-disabled:hover:bg-sui-danger-hover",
|
|
24
|
-
"danger-outline": "border border-sui-danger-line bg-sui-surface text-sui-danger not-data-disabled:hover:bg-sui-danger-soft [&_svg]:stroke-sui-danger"
|
|
24
|
+
"danger-outline": "border border-sui-danger-line bg-sui-surface text-sui-danger not-data-disabled:hover:bg-sui-danger-soft [&_svg]:stroke-sui-danger",
|
|
25
|
+
"ghost-inverse": "border border-transparent bg-transparent text-sui-on-inverse not-data-disabled:hover:bg-sui-on-inverse/[0.12] not-data-disabled:active:bg-sui-on-inverse/[0.2] [&_svg]:stroke-sui-on-inverse"
|
|
25
26
|
}, d = {
|
|
26
27
|
xs: "h-6",
|
|
27
28
|
sm: "h-7",
|
|
@@ -38,7 +39,8 @@ var l = /*@__PURE__*/ n({
|
|
|
38
39
|
md: "text-(length:--sui-button-text) leading-5",
|
|
39
40
|
lg: "text-(length:--sui-button-text) leading-5"
|
|
40
41
|
}, m = e(() => [
|
|
41
|
-
"flex items-center justify-center font-medium text-nowrap no-underline transition-all duration-200 ease-in-out
|
|
42
|
+
"flex items-center justify-center font-medium text-nowrap no-underline transition-all duration-200 ease-in-out data-disabled:opacity-50",
|
|
43
|
+
l.variant === "ghost-inverse" ? "focus-visible:sui-ring-inverse" : "focus-visible:sui-ring",
|
|
42
44
|
u[l.variant],
|
|
43
45
|
d[l.size],
|
|
44
46
|
p[l.size],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","_normalizeClass","_withCtx","_renderSlot","Button_vue_vue_type_script_setup_true_lang_default","props","__props","variants","heights","paddings","texts","classes","computed","isNativeButton","openBlock","createBlock","unref","Primitive","normalizeClass","withCtx","renderSlot","_ctx"],"sources":["../../../src/components/Button/Button.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\n\nimport { Primitive, type PrimitiveProps } from 'reka-ui'\n\nexport type ButtonVariant
|
|
1
|
+
{"version":3,"file":"Button.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","_normalizeClass","_withCtx","_renderSlot","Button_vue_vue_type_script_setup_true_lang_default","props","__props","variants","heights","paddings","texts","classes","computed","isNativeButton","openBlock","createBlock","unref","Primitive","normalizeClass","withCtx","renderSlot","_ctx"],"sources":["../../../src/components/Button/Button.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\n\nimport { Primitive, type PrimitiveProps } from 'reka-ui'\n\nexport type ButtonVariant =\n 'primary' | 'secondary' | 'tinted' | 'ghost' | 'contrast' | 'danger' | 'danger-outline' | 'ghost-inverse'\nexport type ButtonSize = 'xs' | 'sm' | 'md' | 'lg'\n\nexport interface ButtonProps extends PrimitiveProps {\n variant?: ButtonVariant\n size?: ButtonSize\n /** Fully rounded ends. */\n pill?: boolean\n /** Square, for a single icon; give it an `aria-label`. */\n iconOnly?: boolean\n /** Where the icon sits next to the label; it's spaced from the text on the other side. */\n iconPosition?: 'start' | 'end'\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<ButtonProps>(), {\n as: 'button',\n variant: 'secondary',\n size: 'md',\n iconPosition: 'start'\n})\n\nconst variants: Record<ButtonVariant, string> = {\n primary:\n 'border border-sui-accent-solid bg-sui-accent-solid text-sui-on-accent not-data-disabled:hover:border-sui-accent-hover not-data-disabled:hover:bg-sui-accent-hover [&_svg]:stroke-sui-on-accent',\n secondary:\n 'border border-sui-line bg-sui-surface text-sui-ink-emphasis shadow-(--sui-shadow-raised) not-data-disabled:hover:border-sui-line-strong not-data-disabled:hover:bg-sui-canvas [&_svg]:stroke-sui-ink-emphasis',\n tinted:\n 'border border-sui-accent-line bg-sui-accent-wash text-sui-accent not-data-disabled:hover:bg-sui-accent-soft [&_svg]:stroke-sui-accent',\n ghost:\n 'border border-transparent bg-transparent text-sui-ink-subtle not-data-disabled:hover:bg-sui-sunken not-data-disabled:hover:text-sui-ink-emphasis',\n contrast:\n 'border border-sui-contrast bg-sui-contrast text-sui-on-contrast not-data-disabled:hover:border-sui-contrast-hover not-data-disabled:hover:bg-sui-contrast-hover',\n // No border: it's 2px narrower than the other variants.\n danger: 'bg-sui-danger-solid text-sui-on-danger not-data-disabled:hover:bg-sui-danger-hover',\n 'danger-outline':\n 'border border-sui-danger-line bg-sui-surface text-sui-danger not-data-disabled:hover:bg-sui-danger-soft [&_svg]:stroke-sui-danger',\n // For inverse grounds: toasts, dark bands.\n 'ghost-inverse':\n 'border border-transparent bg-transparent text-sui-on-inverse not-data-disabled:hover:bg-sui-on-inverse/[0.12] not-data-disabled:active:bg-sui-on-inverse/[0.2] [&_svg]:stroke-sui-on-inverse'\n}\n\nconst heights: Record<ButtonSize, string> = {\n xs: 'h-6',\n sm: 'h-7',\n md: 'h-(--sui-button-height)',\n lg: 'h-12'\n}\n\nconst paddings: Record<ButtonSize, string> = {\n xs: 'px-2',\n sm: 'px-2.5',\n md: 'px-(--sui-button-padding-x)',\n lg: 'px-(--sui-button-padding-x)'\n}\n\nconst texts: Record<ButtonSize, string> = {\n xs: 'text-xs',\n sm: 'text-sm',\n md: 'text-(length:--sui-button-text) leading-5',\n lg: 'text-(length:--sui-button-text) leading-5'\n}\n\nconst classes = computed(() => [\n // no-underline: as a link, it shouldn't pick up the app's link styles.\n 'flex items-center justify-center font-medium text-nowrap no-underline transition-all duration-200 ease-in-out data-disabled:opacity-50',\n props.variant === 'ghost-inverse' ? 'focus-visible:sui-ring-inverse' : 'focus-visible:sui-ring',\n variants[props.variant],\n heights[props.size],\n texts[props.size],\n props.iconOnly ? 'aspect-square px-0' : paddings[props.size],\n // xs uses rounded-md: rounded-lg reads as a pill at that height.\n props.pill ? 'rounded-full' : props.size === 'xs' ? 'rounded-md' : 'rounded-(--sui-radius-button)',\n props.iconOnly ? '' : props.iconPosition === 'end' ? '[&_svg]:ml-2' : '[&_svg:first-child]:mr-2'\n])\n\n// A link or custom element can't be natively disabled: it says so to assistive tech instead.\nconst isNativeButton = computed(() => props.as === 'button' && !props.asChild)\n</script>\n\n<template>\n <Primitive\n :aria-disabled=\"disabled && !isNativeButton ? 'true' : undefined\"\n :as=\"as\"\n :as-child=\"asChild\"\n :class=\"classes\"\n :data-disabled=\"disabled ? '' : undefined\"\n :disabled=\"isNativeButton ? disabled : undefined\"\n >\n <slot />\n </Primitive>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAqBA,IAAMO,IAAQC,GAORC,IAA0C;GAC9C,SACE;GACF,WACE;GACF,QACE;GACF,OACE;GACF,UACE;GAEF,QAAQ;GACR,kBACE;GAEF,iBACE;EACJ,GAEMC,IAAsC;GAC1C,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN,GAEMC,IAAuC;GAC3C,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN,GAEMC,IAAoC;GACxC,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN,GAEMC,IAAUC,QAAe;GAE7B;GACAP,EAAM,YAAY,kBAAkB,mCAAmC;GACvEE,EAASF,EAAM;GACfG,EAAQH,EAAM;GACdK,EAAML,EAAM;GACZA,EAAM,WAAW,uBAAuBI,EAASJ,EAAM;GAEvDA,EAAM,OAAO,iBAAiBA,EAAM,SAAS,OAAO,eAAe;GACnEA,EAAM,WAAW,KAAKA,EAAM,iBAAiB,QAAQ,iBAAiB;EACxE,CAAC,GAGKQ,IAAiBD,QAAeP,EAAM,OAAO,YAAY,CAACA,EAAM,OAAO;E,kBAI3EP,EAAA,GAAAC,EASYC,EAAAiB,CAAA,GAAA;GART,iBAAeX,EAAA,YAAQ,CAAKO,EAAA,QAAc,SAAY,KAAA;GACtD,IAAIP,EAAA;GACJ,YAAUA,EAAA;GACV,OAAKL,EAAEU,EAAA,KAAO;GACd,iBAAeL,EAAA,WAAQ,KAAQ,KAAA;GAC/B,UAAUO,EAAA,QAAiBP,EAAA,WAAW,KAAA;;GAEvC,SAAAJ,QAAQ,CAARC,EAAQkB,EAAA,QAAA,SAAA,C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextMenu.js","names":["_sfc_main","ContextMenu_vue_vue_type_script_setup_true_lang_default","ContextMenu_default"],"sources":["../../../src/components/ContextMenu/ContextMenu.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuPortal,\n ContextMenuRoot,\n ContextMenuSeparator,\n ContextMenuTrigger\n} from 'reka-ui'\n\nimport MenuItemContent from '../internal/MenuItemContent.vue'\nimport {\n type DropdownMenuAction,\n type DropdownMenuEntry,\n type MenuConfirmLabels,\n menuConfirmDefaults,\n menuContentClass,\n menuItemClass,\n menuSeparatorClass,\n useMenuSelect\n} from '../internal/menu'\n\nexport interface ContextMenuProps extends MenuConfirmLabels {\n items?: DropdownMenuEntry[]\n /** The menu's accessible name, e.g. \"Post actions\". */\n label?: string\n /** Lets the browser's own menu through. */\n disabled?: boolean\n}\n\nconst props = withDefaults(defineProps<ContextMenuProps>(), {\n ...menuConfirmDefaults,\n items: () => [],\n label: undefined\n})\n\nconst emit = defineEmits<{\n 'click-item': [item: DropdownMenuAction & { id?: string }]\n 'update:open': [open: boolean]\n show: []\n hide: []\n}>()\n\nconst select = useMenuSelect(props, (item) => emit('click-item', item))\n\nfunction onOpenChange(open: boolean) {\n emit('update:open', open)\n if (open) emit('show')\n else emit('hide')\n}\n\n// Shift+F10 and the Menu key open it at the focused element. Browsers fire `contextmenu` for these only on some\n// platforms, so the keys open it themselves, the way a right-click would, near the element's top left.\nfunction onKeydown(event: KeyboardEvent) {\n if (props.disabled || !((event.key === 'F10' && event.shiftKey) || event.key === 'ContextMenu')) return\n event.preventDefault()\n const target = event.currentTarget as HTMLElement\n const rect = (event.target as HTMLElement).getBoundingClientRect()\n target.dispatchEvent(\n new MouseEvent('contextmenu', {\n bubbles: true,\n cancelable: true,\n clientX: rect.left + 8,\n clientY: rect.top + Math.min(rect.height, 32)\n })\n )\n}\n</script>\n\n<!-- DropdownMenu's items at the pointer: right-click the default slot, or Shift+F10 or the Menu key while it has focus. -->\n<template>\n <ContextMenuRoot :modal=\"false\" @update:open=\"onOpenChange\">\n <ContextMenuTrigger as-child :disabled=\"disabled\" @keydown=\"onKeydown\">\n <slot />\n </ContextMenuTrigger>\n <ContextMenuPortal>\n <ContextMenuContent :aria-label=\"label\" :class=\"[menuContentClass, 'min-w-48']\" :collision-padding=\"8\">\n <template v-for=\"(item, index) in items\" :key=\"index\">\n <ContextMenuSeparator v-if=\"item.type === 'separator'\" :class=\"menuSeparatorClass\" />\n <ContextMenuItem v-else :class=\"menuItemClass\" @select=\"select(item)\">\n <MenuItemContent :item=\"item\" />\n </ContextMenuItem>\n </template>\n </ContextMenuContent>\n </ContextMenuPortal>\n </ContextMenuRoot>\n</template>\n"],"mappings":""}
|