@saasmakers/ui 2.1.6 → 2.1.7
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/app/components/bases/BaseButton.vue +1 -1
- package/app/components/bases/BaseChip.vue +1 -1
- package/app/components/bases/BaseToast.vue +5 -5
- package/app/components/fields/FieldAvatar.vue +2 -1
- package/app/components/fields/FieldCheckbox.vue +1 -1
- package/app/components/fields/FieldDate.vue +8 -7
- package/app/components/fields/FieldSelect.vue +3 -3
- package/package.json +1 -1
- package/uno.config.ts +6 -0
|
@@ -72,7 +72,7 @@ function onClick(event: MouseEvent) {
|
|
|
72
72
|
<template>
|
|
73
73
|
<component
|
|
74
74
|
:is="to ? NuxtLinkLocale : 'button'"
|
|
75
|
-
class="relative inline-block select-none appearance-none border uppercase focus-visible
|
|
75
|
+
class="relative inline-block select-none appearance-none border uppercase base-focus-visible"
|
|
76
76
|
:class="{
|
|
77
77
|
'flex items-center justify-center': hasFixedSize,
|
|
78
78
|
'cursor-not-allowed opacity-50': disabled,
|
|
@@ -68,7 +68,7 @@ function onMouseEnter(event: MouseEvent) {
|
|
|
68
68
|
<component
|
|
69
69
|
:is="as"
|
|
70
70
|
:id="id"
|
|
71
|
-
class="min-h-8 inline-flex items-center border rounded-md font-normal tracking-tight
|
|
71
|
+
class="min-h-8 inline-flex items-center border rounded-md font-normal tracking-tight transition-colors base-focus-visible"
|
|
72
72
|
:class="{
|
|
73
73
|
'max-w-full': maxWidth,
|
|
74
74
|
'gap-1': hasLeadingIcon || hasTrailingIcon,
|
|
@@ -61,12 +61,12 @@ function onClose(event: KeyboardEvent | MouseEvent) {
|
|
|
61
61
|
|
|
62
62
|
<button
|
|
63
63
|
v-if="action"
|
|
64
|
-
class="ml-2 min-h-6 inline-flex items-center justify-center gap-1.25 rounded-md px-2 py-0.5 uppercase transition-colors
|
|
64
|
+
class="ml-2 min-h-6 inline-flex items-center justify-center gap-1.25 rounded-md px-2 py-0.5 uppercase transition-colors base-focus-visible"
|
|
65
65
|
:class="{
|
|
66
|
-
'bg-red-100 text-red-700 hover:bg-red-200
|
|
67
|
-
'bg-indigo-100 text-indigo-700 hover:bg-indigo-200
|
|
68
|
-
'bg-green-100 text-green-700 hover:bg-green-200
|
|
69
|
-
'bg-orange-100 text-orange-700 hover:bg-orange-200
|
|
66
|
+
'bg-red-100 text-red-700 hover:bg-red-200 dark:bg-red-400/15 dark:text-red-400 dark:hover:bg-red-400/25': status === 'error',
|
|
67
|
+
'bg-indigo-100 text-indigo-700 hover:bg-indigo-200 dark:bg-indigo-400/15 dark:text-indigo-400 dark:hover:bg-indigo-400/25': status === 'info',
|
|
68
|
+
'bg-green-100 text-green-700 hover:bg-green-200 dark:bg-green-400/15 dark:text-green-400 dark:hover:bg-green-400/25': status === 'success',
|
|
69
|
+
'bg-orange-100 text-orange-700 hover:bg-orange-200 dark:bg-orange-400/15 dark:text-orange-400 dark:hover:bg-orange-400/25': status === 'warning',
|
|
70
70
|
}"
|
|
71
71
|
type="button"
|
|
72
72
|
@click.stop="onAction"
|
|
@@ -75,8 +75,9 @@ function onOpenFilePicker() {
|
|
|
75
75
|
|
|
76
76
|
<div
|
|
77
77
|
:aria-label="loading ? t('actionLoading') : (typeof action === 'string' ? action : (action?.base || t('action')))"
|
|
78
|
-
class="w-full flex items-center gap-2 uppercase
|
|
78
|
+
class="w-full flex items-center gap-2 uppercase"
|
|
79
79
|
:class="{
|
|
80
|
+
'base-focus-visible': !disabled && !loading,
|
|
80
81
|
'cursor-pointer': !disabled && !loading,
|
|
81
82
|
'field-disabled': disabled,
|
|
82
83
|
'pointer-events-none opacity-50': disabled,
|
|
@@ -58,7 +58,7 @@ const modelValue = defineModel<FieldCheckbox['modelValue']>({ default: false })
|
|
|
58
58
|
'h-4 w-4': size === 'sm',
|
|
59
59
|
'h-4.5 w-4.5': size === 'base',
|
|
60
60
|
'h-5 w-5': size === 'lg',
|
|
61
|
-
'
|
|
61
|
+
'base-focus-ring-peer': !disabled,
|
|
62
62
|
}"
|
|
63
63
|
>
|
|
64
64
|
<Icon
|
|
@@ -416,8 +416,9 @@ function syncFocusedDayIndex() {
|
|
|
416
416
|
>
|
|
417
417
|
<div
|
|
418
418
|
:id="id"
|
|
419
|
-
class="flex cursor-pointer items-center gap-2
|
|
419
|
+
class="flex cursor-pointer items-center gap-2 rounded-lg"
|
|
420
420
|
:class="{
|
|
421
|
+
'base-focus-visible-inset': !disabled,
|
|
421
422
|
'h-sm': size === 'sm',
|
|
422
423
|
'h-base': size === 'base',
|
|
423
424
|
'h-lg': size === 'lg',
|
|
@@ -471,7 +472,7 @@ function syncFocusedDayIndex() {
|
|
|
471
472
|
<button
|
|
472
473
|
v-if="modelValue"
|
|
473
474
|
:aria-label="t('clear')"
|
|
474
|
-
class="mr-3 inline-flex shrink-0 items-center self-center justify-center rounded-full base-control-hover p-1 text-gray-600
|
|
475
|
+
class="mr-3 inline-flex shrink-0 items-center self-center justify-center rounded-full base-control-hover p-1 text-gray-600 transition-[transform,colors] base-focus-visible hover:scale-105 dark:text-gray-400"
|
|
475
476
|
type="button"
|
|
476
477
|
@click="onClearClick"
|
|
477
478
|
>
|
|
@@ -494,7 +495,7 @@ function syncFocusedDayIndex() {
|
|
|
494
495
|
v-if="!calendarOpen"
|
|
495
496
|
:id="chipListId"
|
|
496
497
|
ref="chipListRef"
|
|
497
|
-
class="flex flex-wrap gap-1.5
|
|
498
|
+
class="flex flex-wrap gap-1.5 base-focus-visible"
|
|
498
499
|
:class="{
|
|
499
500
|
'text-xs': size === 'sm',
|
|
500
501
|
'text-sm': size === 'base',
|
|
@@ -554,7 +555,7 @@ function syncFocusedDayIndex() {
|
|
|
554
555
|
<div class="grid grid-cols-7 mb-0.5 gap-px">
|
|
555
556
|
<button
|
|
556
557
|
:aria-label="t('prevMonth')"
|
|
557
|
-
class="min-h-7 min-w-7 inline-flex cursor-pointer items-center justify-center rounded-md base-bg-hover
|
|
558
|
+
class="min-h-7 min-w-7 inline-flex cursor-pointer items-center justify-center rounded-md base-bg-hover transition-colors base-focus-visible"
|
|
558
559
|
type="button"
|
|
559
560
|
@click="onPreviousMonth"
|
|
560
561
|
>
|
|
@@ -571,7 +572,7 @@ function syncFocusedDayIndex() {
|
|
|
571
572
|
|
|
572
573
|
<button
|
|
573
574
|
:aria-label="t('nextMonth')"
|
|
574
|
-
class="min-h-7 min-w-7 inline-flex cursor-pointer items-center justify-center rounded-md base-bg-hover
|
|
575
|
+
class="min-h-7 min-w-7 inline-flex cursor-pointer items-center justify-center rounded-md base-bg-hover transition-colors base-focus-visible"
|
|
575
576
|
type="button"
|
|
576
577
|
@click="onNextMonth"
|
|
577
578
|
>
|
|
@@ -601,14 +602,14 @@ function syncFocusedDayIndex() {
|
|
|
601
602
|
<button
|
|
602
603
|
v-for="(cell, index) in calendarCells"
|
|
603
604
|
:key="`${cell.date.toISOString()}-${index}`"
|
|
604
|
-
class="relative min-h-7 min-w-7 inline-flex items-center justify-center border border-transparent rounded-md text-xs font-medium
|
|
605
|
+
class="relative min-h-7 min-w-7 inline-flex items-center justify-center border border-transparent rounded-md text-xs font-medium base-focus-visible"
|
|
605
606
|
:class="{
|
|
606
607
|
'cursor-not-allowed text-gray-400 opacity-40 dark:text-gray-600': !cell.inMonth || isDayDisabled(cell.date),
|
|
607
608
|
'base-bg-hover': cell.inMonth && !isDayDisabled(cell.date) && !(modelValue && isSameDay(cell.date, modelValue)),
|
|
608
609
|
'text-indigo-600 font-bold dark:text-indigo-400': cell.inMonth && !isDayDisabled(cell.date) && isSameDay(cell.date, today) && !(modelValue && isSameDay(cell.date, modelValue)),
|
|
609
610
|
'text-gray-600 dark:text-gray-400': cell.inMonth && !isDayDisabled(cell.date) && !isSameDay(cell.date, today) && !(modelValue && isSameDay(cell.date, modelValue)),
|
|
610
611
|
'border-indigo-600/35 bg-indigo-600/[0.08] text-gray-900 dark:border-indigo-400/35 dark:bg-indigo-400/[0.08] dark:text-gray-100': modelValue && isSameDay(cell.date, modelValue),
|
|
611
|
-
'
|
|
612
|
+
'base-focus-ring': index === focusedDayIndex && calendarOpen && !(modelValue && isSameDay(cell.date, modelValue)),
|
|
612
613
|
}"
|
|
613
614
|
:disabled="!cell.inMonth || isDayDisabled(cell.date)"
|
|
614
615
|
role="gridcell"
|
|
@@ -338,14 +338,14 @@ function toggle() {
|
|
|
338
338
|
<div
|
|
339
339
|
:id="id"
|
|
340
340
|
ref="triggerRef"
|
|
341
|
-
class="group flex items-center rounded-lg bg-white
|
|
341
|
+
class="group flex items-center rounded-lg bg-white dark:bg-gray-900"
|
|
342
342
|
:class="{
|
|
343
343
|
'base-box': border === 'full',
|
|
344
344
|
'base-border-b': border === 'bottom',
|
|
345
345
|
'border-0': border === 'none',
|
|
346
346
|
'base-border-active': isOpen,
|
|
347
347
|
'base-border-hover': !isOpen && !disabled,
|
|
348
|
-
'base-
|
|
348
|
+
'base-focus-visible': !disabled,
|
|
349
349
|
'text-xs h-sm': size === 'sm' && !square,
|
|
350
350
|
'text-sm h-base': size === 'base' && !square,
|
|
351
351
|
'text-base h-lg': size === 'lg' && !square,
|
|
@@ -502,7 +502,7 @@ function toggle() {
|
|
|
502
502
|
<div
|
|
503
503
|
v-for="option in column.options"
|
|
504
504
|
:key="option.value"
|
|
505
|
-
class="flex cursor-pointer items-center
|
|
505
|
+
class="flex cursor-pointer items-center base-focus-visible-inset"
|
|
506
506
|
:class="{
|
|
507
507
|
'base-border-b base-bg-hover last:border-b-0': !isMultiColumn,
|
|
508
508
|
'h-sm px-sm': size === 'sm' && !isMultiColumn,
|
package/package.json
CHANGED
package/uno.config.ts
CHANGED
|
@@ -34,6 +34,12 @@ export const shortcuts: Record<string, string> = {
|
|
|
34
34
|
'base-border-interactive': 'hover:border-gray-300 focus:border-gray-400 dark:hover:border-gray-700 dark:focus:border-gray-600',
|
|
35
35
|
'base-border-interactive-focus-visible': 'hover:border-gray-300 focus-visible:border-gray-400 dark:hover:border-gray-700 dark:focus-visible:border-gray-600',
|
|
36
36
|
'base-border-interactive-focus-within': 'hover:border-gray-300 focus-within:border-gray-400 dark:hover:border-gray-700 dark:focus-within:border-gray-600',
|
|
37
|
+
'base-focus-overlay': 'pointer-events-none rounded-lg opacity-0 outline outline-2 outline-gray-900 dark:outline-gray-100',
|
|
38
|
+
'base-focus-ring': 'outline outline-2 outline-offset-2 outline-gray-900 dark:outline-gray-100',
|
|
39
|
+
'base-focus-ring-peer': 'peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-gray-900 dark:peer-focus-visible:outline-gray-100',
|
|
40
|
+
'base-focus-ring-inset': 'outline outline-2 outline-offset--2 outline-gray-900 dark:outline-gray-100',
|
|
41
|
+
'base-focus-visible': 'focus-visible:base-focus-ring',
|
|
42
|
+
'base-focus-visible-inset': 'focus-visible:base-focus-ring-inset',
|
|
37
43
|
'base-bg': 'bg-white dark:bg-gray-900',
|
|
38
44
|
'base-box': 'border shadow-sm base-border rounded-lg',
|
|
39
45
|
'base-highlight-indigo': 'border border-indigo-600/35 bg-indigo-600/[0.08] shadow-indigo-600/15 dark:border-indigo-400/35 dark:bg-indigo-400/[0.08] dark:shadow-indigo-400/15',
|