@una-ui/preset 0.25.0-beta.1 → 0.27.0-beta.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/dist/prefixes.cjs +12 -0
- package/dist/prefixes.mjs +12 -0
- package/dist/shortcuts.cjs +70 -22
- package/dist/shortcuts.mjs +70 -22
- package/package.json +4 -4
package/dist/prefixes.cjs
CHANGED
|
@@ -25,6 +25,15 @@ const prefixes = [
|
|
|
25
25
|
"card-header",
|
|
26
26
|
"card-title",
|
|
27
27
|
"checkbox",
|
|
28
|
+
"dialog",
|
|
29
|
+
"dialog-close",
|
|
30
|
+
"dialog-content",
|
|
31
|
+
"dialog-description",
|
|
32
|
+
"dialog-footer",
|
|
33
|
+
"dialog-header",
|
|
34
|
+
"dialog-overlay",
|
|
35
|
+
"dialog-scroll-content",
|
|
36
|
+
"dialog-title",
|
|
28
37
|
"dropdown-menu",
|
|
29
38
|
"dropdown-menu-content",
|
|
30
39
|
"dropdown-menu-group",
|
|
@@ -100,6 +109,9 @@ const prefixes = [
|
|
|
100
109
|
"tabs-root",
|
|
101
110
|
"tabs-trigger",
|
|
102
111
|
"theme-switcher",
|
|
112
|
+
"toggle",
|
|
113
|
+
"toggle-off",
|
|
114
|
+
"toggle-on",
|
|
103
115
|
"tooltip",
|
|
104
116
|
"tooltip-content",
|
|
105
117
|
"tooltip-provider",
|
package/dist/prefixes.mjs
CHANGED
|
@@ -23,6 +23,15 @@ const prefixes = [
|
|
|
23
23
|
"card-header",
|
|
24
24
|
"card-title",
|
|
25
25
|
"checkbox",
|
|
26
|
+
"dialog",
|
|
27
|
+
"dialog-close",
|
|
28
|
+
"dialog-content",
|
|
29
|
+
"dialog-description",
|
|
30
|
+
"dialog-footer",
|
|
31
|
+
"dialog-header",
|
|
32
|
+
"dialog-overlay",
|
|
33
|
+
"dialog-scroll-content",
|
|
34
|
+
"dialog-title",
|
|
26
35
|
"dropdown-menu",
|
|
27
36
|
"dropdown-menu-content",
|
|
28
37
|
"dropdown-menu-group",
|
|
@@ -98,6 +107,9 @@ const prefixes = [
|
|
|
98
107
|
"tabs-root",
|
|
99
108
|
"tabs-trigger",
|
|
100
109
|
"theme-switcher",
|
|
110
|
+
"toggle",
|
|
111
|
+
"toggle-off",
|
|
112
|
+
"toggle-on",
|
|
101
113
|
"tooltip",
|
|
102
114
|
"tooltip-content",
|
|
103
115
|
"tooltip-provider",
|
package/dist/shortcuts.cjs
CHANGED
|
@@ -190,7 +190,10 @@ const staticBtn = {
|
|
|
190
190
|
"btn-link-black": "text-base btn-focus hover:underline underline-offset-4",
|
|
191
191
|
"btn-text-black": "text-base btn-focus",
|
|
192
192
|
"btn-soft-black": "text-base bg-base btn-focus shadow-sm",
|
|
193
|
-
"btn-text-muted": "text-muted btn-focus hover:text-accent"
|
|
193
|
+
"btn-text-muted": "text-muted btn-focus hover:text-accent",
|
|
194
|
+
"btn-link-muted": "text-muted btn-focus hover:underline underline-offset-4",
|
|
195
|
+
"btn-ghost-muted": "text-accent hover:text-muted btn-focus hover:bg-muted",
|
|
196
|
+
"btn-soft-accent": "text-accent bg-accent btn-focus"
|
|
194
197
|
};
|
|
195
198
|
const dynamicBtn = [
|
|
196
199
|
// base
|
|
@@ -201,7 +204,7 @@ const dynamicBtn = [
|
|
|
201
204
|
[/^btn-outline(-(\S+))?$/, ([, , c = "primary"]) => `btn-focus-${c} text-${c}-500 dark:text-${c}-400 ring-1 ring-inset ring-${c}-500 dark:ring-${c}-400 hover:bg-${c}-50 dark:hover:bg-${c}-950`],
|
|
202
205
|
[/^btn-soft(-(\S+))?$/, ([, , c = "primary"]) => `btn-focus-${c} text-${c}-600 dark:text-${c}-400 bg-${c}-50 dark:bg-${c}-950 hover:bg-${c}-100 dark:hover:bg-${c}-900`],
|
|
203
206
|
[/^btn-ghost(-(\S+))?$/, ([, , c = "primary"]) => `btn-focus-${c} text-${c}-600 dark:text-${c}-400 hover:bg-${c}-100 dark:hover:bg-${c}-900`],
|
|
204
|
-
[/^btn-link(-(\S+))?$/, ([, , c = "primary"]) => `btn-focus-${c} text-${c}-
|
|
207
|
+
[/^btn-link(-(\S+))?$/, ([, , c = "primary"]) => `btn-focus-${c} text-${c}-600 dark:text-${c}-500 hover:underline underline-offset-4`]
|
|
205
208
|
];
|
|
206
209
|
const btn = [
|
|
207
210
|
...dynamicBtn,
|
|
@@ -259,6 +262,28 @@ const checkbox = [
|
|
|
259
262
|
staticCheckbox
|
|
260
263
|
];
|
|
261
264
|
|
|
265
|
+
const staticDialog = {
|
|
266
|
+
// base
|
|
267
|
+
"dialog": "",
|
|
268
|
+
// sub-components
|
|
269
|
+
"dialog-overlay": "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
270
|
+
"dialog-content": "fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border border-base bg-base p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-48% data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-48% sm:rounded-lg",
|
|
271
|
+
"dialog-scroll-overlay": "fixed inset-0 z-50 grid place-items-center overflow-y-auto bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
272
|
+
"dialog-scroll-content": "relative z-50 grid w-full max-w-lg my-8 gap-4 border border-base bg-base p-6 shadow-lg duration-200 sm:rounded-lg md:w-full",
|
|
273
|
+
"dialog-header": "flex flex-col gap-y-1.5 text-center sm:text-left",
|
|
274
|
+
"dialog-title": "text-lg font-semibold leading-none tracking-tight",
|
|
275
|
+
"dialog-description": "text-sm text-muted",
|
|
276
|
+
"dialog-close": "absolute right-4 top-4",
|
|
277
|
+
"dialog-footer": "flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2"
|
|
278
|
+
};
|
|
279
|
+
const dynamicDialog = [
|
|
280
|
+
// dynamic preset
|
|
281
|
+
];
|
|
282
|
+
const dialog = [
|
|
283
|
+
...dynamicDialog,
|
|
284
|
+
staticDialog
|
|
285
|
+
];
|
|
286
|
+
|
|
262
287
|
const staticDropdownMenu = {
|
|
263
288
|
// configurations
|
|
264
289
|
"dropdown-menu": "",
|
|
@@ -335,10 +360,10 @@ const staticGeneral = {
|
|
|
335
360
|
"text-accent-foreground": "text-$c-accent",
|
|
336
361
|
"text-popover": "text-$c-popover-foreground",
|
|
337
362
|
"text-popover-foreground": "text-$c-popover",
|
|
338
|
-
"text-info": "text-info-
|
|
339
|
-
"text-error": "text-error-
|
|
340
|
-
"text-success": "text-success-
|
|
341
|
-
"text-warning": "text-warning-
|
|
363
|
+
"text-info": "text-info-600 dark:text-info-500",
|
|
364
|
+
"text-error": "text-error-600 dark:text-error-500",
|
|
365
|
+
"text-success": "text-success-600 dark:text-success-500",
|
|
366
|
+
"text-warning": "text-warning-600 dark:text-warning-500",
|
|
342
367
|
// ring
|
|
343
368
|
"ring-base": "ring-$c-ring",
|
|
344
369
|
"ring-inverted": "ring-$c-ring-foreground",
|
|
@@ -580,7 +605,7 @@ const pagination = [
|
|
|
580
605
|
];
|
|
581
606
|
|
|
582
607
|
const staticPopover = {
|
|
583
|
-
"popover-content": "w-72 rounded-md border border-base bg-popover p-4 text-popover shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"
|
|
608
|
+
"popover-content": "z-50 w-72 rounded-md border border-base bg-popover p-4 text-popover shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"
|
|
584
609
|
};
|
|
585
610
|
const dynamicPopover = [
|
|
586
611
|
// dynamic preset
|
|
@@ -591,12 +616,11 @@ const popover = [
|
|
|
591
616
|
];
|
|
592
617
|
|
|
593
618
|
const staticProgress = {
|
|
594
|
-
//
|
|
595
|
-
"progress": "
|
|
619
|
+
// base
|
|
620
|
+
"progress-indeterminate": "absolute bg-brand h-full",
|
|
596
621
|
// components
|
|
597
|
-
"progress-root": "
|
|
598
|
-
"progress-indicator": "h-full w-full flex-1 bg-brand transition-all"
|
|
599
|
-
"progress-indeterminate": "absolute bg-brand h-full"
|
|
622
|
+
"progress-root": "relative h-0.5em w-full overflow-hidden rounded-full bg-brand/20",
|
|
623
|
+
"progress-indicator": "h-full w-full flex-1 bg-brand transition-all"
|
|
600
624
|
};
|
|
601
625
|
const dynamicProgress = [
|
|
602
626
|
[/^progress-(.*)$/, ([, body], { theme }) => {
|
|
@@ -799,31 +823,34 @@ const staticTable = {
|
|
|
799
823
|
"table-default-variant": "table-solid-gray",
|
|
800
824
|
"table": "",
|
|
801
825
|
// table-root
|
|
802
|
-
"table-root": "w-full caption-bottom text-sm",
|
|
803
826
|
"table-root-wrapper": "relative w-full overflow-x-auto overflow-y-hidden border border-base rounded-md",
|
|
804
|
-
"table-
|
|
827
|
+
"table-root": "w-full caption-bottom text-sm",
|
|
828
|
+
"table-body": "[&_tr:last-child]:border-0",
|
|
805
829
|
"table-caption": "mt-4 text-sm text-muted",
|
|
806
830
|
// table-head
|
|
807
|
-
"table-head": "h-12 px-4 text-left align-middle font-medium text-muted [&:has([role=checkbox])]:pr-0",
|
|
831
|
+
"table-head": "h-12 px-4 text-left align-middle font-medium text-muted [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-0.5",
|
|
808
832
|
"table-head-pinned": "sticky bg-base",
|
|
809
833
|
"table-head-pinned-left": "left-0",
|
|
810
834
|
"table-head-pinned-right": "right-0",
|
|
811
835
|
// table-header
|
|
812
|
-
"table-header": "[&_tr]:border-b border-base",
|
|
836
|
+
"table-header": "[&_tr]:border-b [&_tr]:border-base",
|
|
813
837
|
// table-row
|
|
814
|
-
"table-row": "border-b border-base hover:bg-muted data-[filter=true]:hover:bg-base data-[state=selected]:bg-muted",
|
|
838
|
+
"table-row": "border-b border-base transition-colors hover:bg-muted data-[filter=true]:hover:bg-base data-[state=selected]:bg-muted",
|
|
815
839
|
// table-cell
|
|
816
|
-
"table-cell": "p-4 align-middle [&:has([role=checkbox])]:pr-0",
|
|
840
|
+
"table-cell": "p-4 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-0.5",
|
|
817
841
|
"table-cell-pinned": "sticky bg-base",
|
|
818
842
|
"table-cell-pinned-left": "left-0",
|
|
819
843
|
"table-cell-pinned-right": "right-0",
|
|
820
844
|
// table-empty
|
|
821
845
|
"table-empty-row": "",
|
|
822
|
-
"table-empty-cell": "p-4 whitespace-nowrap align-middle text-sm text-muted
|
|
846
|
+
"table-empty-cell": "p-4 whitespace-nowrap align-middle text-sm text-muted bg-base",
|
|
823
847
|
"table-empty": "flex items-center justify-center py-10",
|
|
824
848
|
// table-loading
|
|
825
|
-
"table-loading-icon": "
|
|
826
|
-
|
|
849
|
+
"table-loading-icon": "animate-spin text-lg",
|
|
850
|
+
// TODO: to add
|
|
851
|
+
"table-loading-icon-name": "i-lucide-refresh-ccw",
|
|
852
|
+
// TODO: to add
|
|
853
|
+
"table-loading-row": "data-[loading=true]:border-0 absolute inset-x-0 -mt-1.5px",
|
|
827
854
|
"table-loading-cell": "",
|
|
828
855
|
"table-loading": "absolute inset-x-0 overflow-hidden p-0",
|
|
829
856
|
// table-footer
|
|
@@ -854,6 +881,25 @@ const tabs = [
|
|
|
854
881
|
staticTabs
|
|
855
882
|
];
|
|
856
883
|
|
|
884
|
+
const staticToggle = {
|
|
885
|
+
// configurations
|
|
886
|
+
toggle: ""
|
|
887
|
+
};
|
|
888
|
+
const dynamicToggle = [
|
|
889
|
+
[
|
|
890
|
+
/^toggle-on(?:-([^-]+))?(?:-([^-]+))?$/,
|
|
891
|
+
([, variant = "soft", color = "accent"]) => `data-[state=on]:btn-${variant}-${color}`
|
|
892
|
+
],
|
|
893
|
+
[
|
|
894
|
+
/^toggle-off(?:-([^-]+))?(?:-([^-]+))?$/,
|
|
895
|
+
([, variant = "ghost", color = "muted"]) => `data-[state=off]:btn-${variant}-${color}`
|
|
896
|
+
]
|
|
897
|
+
];
|
|
898
|
+
const toggle = [
|
|
899
|
+
...dynamicToggle,
|
|
900
|
+
staticToggle
|
|
901
|
+
];
|
|
902
|
+
|
|
857
903
|
const staticTooltip = {
|
|
858
904
|
"tooltip-content": "z-50 overflow-hidden rounded-md px-0.75em py-0.375em text-xs shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
859
905
|
"tooltip-white": "border border-base bg-popover text-popover",
|
|
@@ -876,6 +922,7 @@ const shortcuts = [
|
|
|
876
922
|
...breadcrumb,
|
|
877
923
|
...accordion,
|
|
878
924
|
...btn,
|
|
925
|
+
...dialog,
|
|
879
926
|
...formGroup,
|
|
880
927
|
...input,
|
|
881
928
|
...icon,
|
|
@@ -903,7 +950,8 @@ const shortcuts = [
|
|
|
903
950
|
...label,
|
|
904
951
|
...popover,
|
|
905
952
|
...tooltip,
|
|
906
|
-
...pagination
|
|
953
|
+
...pagination,
|
|
954
|
+
...toggle
|
|
907
955
|
];
|
|
908
956
|
|
|
909
957
|
exports.shortcuts = shortcuts;
|
package/dist/shortcuts.mjs
CHANGED
|
@@ -188,7 +188,10 @@ const staticBtn = {
|
|
|
188
188
|
"btn-link-black": "text-base btn-focus hover:underline underline-offset-4",
|
|
189
189
|
"btn-text-black": "text-base btn-focus",
|
|
190
190
|
"btn-soft-black": "text-base bg-base btn-focus shadow-sm",
|
|
191
|
-
"btn-text-muted": "text-muted btn-focus hover:text-accent"
|
|
191
|
+
"btn-text-muted": "text-muted btn-focus hover:text-accent",
|
|
192
|
+
"btn-link-muted": "text-muted btn-focus hover:underline underline-offset-4",
|
|
193
|
+
"btn-ghost-muted": "text-accent hover:text-muted btn-focus hover:bg-muted",
|
|
194
|
+
"btn-soft-accent": "text-accent bg-accent btn-focus"
|
|
192
195
|
};
|
|
193
196
|
const dynamicBtn = [
|
|
194
197
|
// base
|
|
@@ -199,7 +202,7 @@ const dynamicBtn = [
|
|
|
199
202
|
[/^btn-outline(-(\S+))?$/, ([, , c = "primary"]) => `btn-focus-${c} text-${c}-500 dark:text-${c}-400 ring-1 ring-inset ring-${c}-500 dark:ring-${c}-400 hover:bg-${c}-50 dark:hover:bg-${c}-950`],
|
|
200
203
|
[/^btn-soft(-(\S+))?$/, ([, , c = "primary"]) => `btn-focus-${c} text-${c}-600 dark:text-${c}-400 bg-${c}-50 dark:bg-${c}-950 hover:bg-${c}-100 dark:hover:bg-${c}-900`],
|
|
201
204
|
[/^btn-ghost(-(\S+))?$/, ([, , c = "primary"]) => `btn-focus-${c} text-${c}-600 dark:text-${c}-400 hover:bg-${c}-100 dark:hover:bg-${c}-900`],
|
|
202
|
-
[/^btn-link(-(\S+))?$/, ([, , c = "primary"]) => `btn-focus-${c} text-${c}-
|
|
205
|
+
[/^btn-link(-(\S+))?$/, ([, , c = "primary"]) => `btn-focus-${c} text-${c}-600 dark:text-${c}-500 hover:underline underline-offset-4`]
|
|
203
206
|
];
|
|
204
207
|
const btn = [
|
|
205
208
|
...dynamicBtn,
|
|
@@ -257,6 +260,28 @@ const checkbox = [
|
|
|
257
260
|
staticCheckbox
|
|
258
261
|
];
|
|
259
262
|
|
|
263
|
+
const staticDialog = {
|
|
264
|
+
// base
|
|
265
|
+
"dialog": "",
|
|
266
|
+
// sub-components
|
|
267
|
+
"dialog-overlay": "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
268
|
+
"dialog-content": "fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border border-base bg-base p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-48% data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-48% sm:rounded-lg",
|
|
269
|
+
"dialog-scroll-overlay": "fixed inset-0 z-50 grid place-items-center overflow-y-auto bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
270
|
+
"dialog-scroll-content": "relative z-50 grid w-full max-w-lg my-8 gap-4 border border-base bg-base p-6 shadow-lg duration-200 sm:rounded-lg md:w-full",
|
|
271
|
+
"dialog-header": "flex flex-col gap-y-1.5 text-center sm:text-left",
|
|
272
|
+
"dialog-title": "text-lg font-semibold leading-none tracking-tight",
|
|
273
|
+
"dialog-description": "text-sm text-muted",
|
|
274
|
+
"dialog-close": "absolute right-4 top-4",
|
|
275
|
+
"dialog-footer": "flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2"
|
|
276
|
+
};
|
|
277
|
+
const dynamicDialog = [
|
|
278
|
+
// dynamic preset
|
|
279
|
+
];
|
|
280
|
+
const dialog = [
|
|
281
|
+
...dynamicDialog,
|
|
282
|
+
staticDialog
|
|
283
|
+
];
|
|
284
|
+
|
|
260
285
|
const staticDropdownMenu = {
|
|
261
286
|
// configurations
|
|
262
287
|
"dropdown-menu": "",
|
|
@@ -333,10 +358,10 @@ const staticGeneral = {
|
|
|
333
358
|
"text-accent-foreground": "text-$c-accent",
|
|
334
359
|
"text-popover": "text-$c-popover-foreground",
|
|
335
360
|
"text-popover-foreground": "text-$c-popover",
|
|
336
|
-
"text-info": "text-info-
|
|
337
|
-
"text-error": "text-error-
|
|
338
|
-
"text-success": "text-success-
|
|
339
|
-
"text-warning": "text-warning-
|
|
361
|
+
"text-info": "text-info-600 dark:text-info-500",
|
|
362
|
+
"text-error": "text-error-600 dark:text-error-500",
|
|
363
|
+
"text-success": "text-success-600 dark:text-success-500",
|
|
364
|
+
"text-warning": "text-warning-600 dark:text-warning-500",
|
|
340
365
|
// ring
|
|
341
366
|
"ring-base": "ring-$c-ring",
|
|
342
367
|
"ring-inverted": "ring-$c-ring-foreground",
|
|
@@ -578,7 +603,7 @@ const pagination = [
|
|
|
578
603
|
];
|
|
579
604
|
|
|
580
605
|
const staticPopover = {
|
|
581
|
-
"popover-content": "w-72 rounded-md border border-base bg-popover p-4 text-popover shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"
|
|
606
|
+
"popover-content": "z-50 w-72 rounded-md border border-base bg-popover p-4 text-popover shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"
|
|
582
607
|
};
|
|
583
608
|
const dynamicPopover = [
|
|
584
609
|
// dynamic preset
|
|
@@ -589,12 +614,11 @@ const popover = [
|
|
|
589
614
|
];
|
|
590
615
|
|
|
591
616
|
const staticProgress = {
|
|
592
|
-
//
|
|
593
|
-
"progress": "
|
|
617
|
+
// base
|
|
618
|
+
"progress-indeterminate": "absolute bg-brand h-full",
|
|
594
619
|
// components
|
|
595
|
-
"progress-root": "
|
|
596
|
-
"progress-indicator": "h-full w-full flex-1 bg-brand transition-all"
|
|
597
|
-
"progress-indeterminate": "absolute bg-brand h-full"
|
|
620
|
+
"progress-root": "relative h-0.5em w-full overflow-hidden rounded-full bg-brand/20",
|
|
621
|
+
"progress-indicator": "h-full w-full flex-1 bg-brand transition-all"
|
|
598
622
|
};
|
|
599
623
|
const dynamicProgress = [
|
|
600
624
|
[/^progress-(.*)$/, ([, body], { theme }) => {
|
|
@@ -797,31 +821,34 @@ const staticTable = {
|
|
|
797
821
|
"table-default-variant": "table-solid-gray",
|
|
798
822
|
"table": "",
|
|
799
823
|
// table-root
|
|
800
|
-
"table-root": "w-full caption-bottom text-sm",
|
|
801
824
|
"table-root-wrapper": "relative w-full overflow-x-auto overflow-y-hidden border border-base rounded-md",
|
|
802
|
-
"table-
|
|
825
|
+
"table-root": "w-full caption-bottom text-sm",
|
|
826
|
+
"table-body": "[&_tr:last-child]:border-0",
|
|
803
827
|
"table-caption": "mt-4 text-sm text-muted",
|
|
804
828
|
// table-head
|
|
805
|
-
"table-head": "h-12 px-4 text-left align-middle font-medium text-muted [&:has([role=checkbox])]:pr-0",
|
|
829
|
+
"table-head": "h-12 px-4 text-left align-middle font-medium text-muted [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-0.5",
|
|
806
830
|
"table-head-pinned": "sticky bg-base",
|
|
807
831
|
"table-head-pinned-left": "left-0",
|
|
808
832
|
"table-head-pinned-right": "right-0",
|
|
809
833
|
// table-header
|
|
810
|
-
"table-header": "[&_tr]:border-b border-base",
|
|
834
|
+
"table-header": "[&_tr]:border-b [&_tr]:border-base",
|
|
811
835
|
// table-row
|
|
812
|
-
"table-row": "border-b border-base hover:bg-muted data-[filter=true]:hover:bg-base data-[state=selected]:bg-muted",
|
|
836
|
+
"table-row": "border-b border-base transition-colors hover:bg-muted data-[filter=true]:hover:bg-base data-[state=selected]:bg-muted",
|
|
813
837
|
// table-cell
|
|
814
|
-
"table-cell": "p-4 align-middle [&:has([role=checkbox])]:pr-0",
|
|
838
|
+
"table-cell": "p-4 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-0.5",
|
|
815
839
|
"table-cell-pinned": "sticky bg-base",
|
|
816
840
|
"table-cell-pinned-left": "left-0",
|
|
817
841
|
"table-cell-pinned-right": "right-0",
|
|
818
842
|
// table-empty
|
|
819
843
|
"table-empty-row": "",
|
|
820
|
-
"table-empty-cell": "p-4 whitespace-nowrap align-middle text-sm text-muted
|
|
844
|
+
"table-empty-cell": "p-4 whitespace-nowrap align-middle text-sm text-muted bg-base",
|
|
821
845
|
"table-empty": "flex items-center justify-center py-10",
|
|
822
846
|
// table-loading
|
|
823
|
-
"table-loading-icon": "
|
|
824
|
-
|
|
847
|
+
"table-loading-icon": "animate-spin text-lg",
|
|
848
|
+
// TODO: to add
|
|
849
|
+
"table-loading-icon-name": "i-lucide-refresh-ccw",
|
|
850
|
+
// TODO: to add
|
|
851
|
+
"table-loading-row": "data-[loading=true]:border-0 absolute inset-x-0 -mt-1.5px",
|
|
825
852
|
"table-loading-cell": "",
|
|
826
853
|
"table-loading": "absolute inset-x-0 overflow-hidden p-0",
|
|
827
854
|
// table-footer
|
|
@@ -852,6 +879,25 @@ const tabs = [
|
|
|
852
879
|
staticTabs
|
|
853
880
|
];
|
|
854
881
|
|
|
882
|
+
const staticToggle = {
|
|
883
|
+
// configurations
|
|
884
|
+
toggle: ""
|
|
885
|
+
};
|
|
886
|
+
const dynamicToggle = [
|
|
887
|
+
[
|
|
888
|
+
/^toggle-on(?:-([^-]+))?(?:-([^-]+))?$/,
|
|
889
|
+
([, variant = "soft", color = "accent"]) => `data-[state=on]:btn-${variant}-${color}`
|
|
890
|
+
],
|
|
891
|
+
[
|
|
892
|
+
/^toggle-off(?:-([^-]+))?(?:-([^-]+))?$/,
|
|
893
|
+
([, variant = "ghost", color = "muted"]) => `data-[state=off]:btn-${variant}-${color}`
|
|
894
|
+
]
|
|
895
|
+
];
|
|
896
|
+
const toggle = [
|
|
897
|
+
...dynamicToggle,
|
|
898
|
+
staticToggle
|
|
899
|
+
];
|
|
900
|
+
|
|
855
901
|
const staticTooltip = {
|
|
856
902
|
"tooltip-content": "z-50 overflow-hidden rounded-md px-0.75em py-0.375em text-xs shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
857
903
|
"tooltip-white": "border border-base bg-popover text-popover",
|
|
@@ -874,6 +920,7 @@ const shortcuts = [
|
|
|
874
920
|
...breadcrumb,
|
|
875
921
|
...accordion,
|
|
876
922
|
...btn,
|
|
923
|
+
...dialog,
|
|
877
924
|
...formGroup,
|
|
878
925
|
...input,
|
|
879
926
|
...icon,
|
|
@@ -901,7 +948,8 @@ const shortcuts = [
|
|
|
901
948
|
...label,
|
|
902
949
|
...popover,
|
|
903
950
|
...tooltip,
|
|
904
|
-
...pagination
|
|
951
|
+
...pagination,
|
|
952
|
+
...toggle
|
|
905
953
|
];
|
|
906
954
|
|
|
907
955
|
export { shortcuts };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@una-ui/preset",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0-beta.1",
|
|
4
4
|
"description": "The default preset for @una-ui",
|
|
5
5
|
"author": "Phojie Rengel <phojrengel@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@unocss/core": "^0.63.
|
|
53
|
-
"@unocss/preset-mini": "^0.63.
|
|
54
|
-
"unocss": "^0.63.
|
|
52
|
+
"@unocss/core": "^0.63.3",
|
|
53
|
+
"@unocss/preset-mini": "^0.63.3",
|
|
54
|
+
"unocss": "^0.63.3"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "unbuild",
|