@una-ui/preset 0.26.0-beta.2 → 0.27.1-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 +3 -0
- package/dist/prefixes.mjs +3 -0
- package/dist/shortcuts.cjs +45 -21
- package/dist/shortcuts.mjs +45 -21
- package/package.json +4 -4
package/dist/prefixes.cjs
CHANGED
package/dist/prefixes.mjs
CHANGED
package/dist/shortcuts.cjs
CHANGED
|
@@ -191,7 +191,9 @@ const staticBtn = {
|
|
|
191
191
|
"btn-text-black": "text-base btn-focus",
|
|
192
192
|
"btn-soft-black": "text-base bg-base btn-focus shadow-sm",
|
|
193
193
|
"btn-text-muted": "text-muted btn-focus hover:text-accent",
|
|
194
|
-
"btn-link-muted": "text-muted btn-focus hover:underline underline-offset-4"
|
|
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"
|
|
195
197
|
};
|
|
196
198
|
const dynamicBtn = [
|
|
197
199
|
// base
|
|
@@ -202,7 +204,7 @@ const dynamicBtn = [
|
|
|
202
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`],
|
|
203
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`],
|
|
204
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`],
|
|
205
|
-
[/^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`]
|
|
206
208
|
];
|
|
207
209
|
const btn = [
|
|
208
210
|
...dynamicBtn,
|
|
@@ -358,10 +360,10 @@ const staticGeneral = {
|
|
|
358
360
|
"text-accent-foreground": "text-$c-accent",
|
|
359
361
|
"text-popover": "text-$c-popover-foreground",
|
|
360
362
|
"text-popover-foreground": "text-$c-popover",
|
|
361
|
-
"text-info": "text-info-
|
|
362
|
-
"text-error": "text-error-
|
|
363
|
-
"text-success": "text-success-
|
|
364
|
-
"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",
|
|
365
367
|
// ring
|
|
366
368
|
"ring-base": "ring-$c-ring",
|
|
367
369
|
"ring-inverted": "ring-$c-ring-foreground",
|
|
@@ -614,12 +616,11 @@ const popover = [
|
|
|
614
616
|
];
|
|
615
617
|
|
|
616
618
|
const staticProgress = {
|
|
617
|
-
//
|
|
618
|
-
"progress": "
|
|
619
|
+
// base
|
|
620
|
+
"progress-indeterminate": "absolute bg-brand h-full",
|
|
619
621
|
// components
|
|
620
|
-
"progress-root": "
|
|
621
|
-
"progress-indicator": "h-full w-full flex-1 bg-brand transition-all"
|
|
622
|
-
"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"
|
|
623
624
|
};
|
|
624
625
|
const dynamicProgress = [
|
|
625
626
|
[/^progress-(.*)$/, ([, body], { theme }) => {
|
|
@@ -822,31 +823,34 @@ const staticTable = {
|
|
|
822
823
|
"table-default-variant": "table-solid-gray",
|
|
823
824
|
"table": "",
|
|
824
825
|
// table-root
|
|
825
|
-
"table-root": "w-full caption-bottom text-sm",
|
|
826
826
|
"table-root-wrapper": "relative w-full overflow-x-auto overflow-y-hidden border border-base rounded-md",
|
|
827
|
-
"table-
|
|
827
|
+
"table-root": "w-full caption-bottom text-sm",
|
|
828
|
+
"table-body": "[&_tr:last-child]:border-0",
|
|
828
829
|
"table-caption": "mt-4 text-sm text-muted",
|
|
829
830
|
// table-head
|
|
830
|
-
"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",
|
|
831
832
|
"table-head-pinned": "sticky bg-base",
|
|
832
833
|
"table-head-pinned-left": "left-0",
|
|
833
834
|
"table-head-pinned-right": "right-0",
|
|
834
835
|
// table-header
|
|
835
|
-
"table-header": "[&_tr]:border-b border-base",
|
|
836
|
+
"table-header": "[&_tr]:border-b [&_tr]:border-base",
|
|
836
837
|
// table-row
|
|
837
|
-
"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",
|
|
838
839
|
// table-cell
|
|
839
|
-
"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",
|
|
840
841
|
"table-cell-pinned": "sticky bg-base",
|
|
841
842
|
"table-cell-pinned-left": "left-0",
|
|
842
843
|
"table-cell-pinned-right": "right-0",
|
|
843
844
|
// table-empty
|
|
844
845
|
"table-empty-row": "",
|
|
845
|
-
"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",
|
|
846
847
|
"table-empty": "flex items-center justify-center py-10",
|
|
847
848
|
// table-loading
|
|
848
|
-
"table-loading-icon": "
|
|
849
|
-
|
|
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",
|
|
850
854
|
"table-loading-cell": "",
|
|
851
855
|
"table-loading": "absolute inset-x-0 overflow-hidden p-0",
|
|
852
856
|
// table-footer
|
|
@@ -877,6 +881,25 @@ const tabs = [
|
|
|
877
881
|
staticTabs
|
|
878
882
|
];
|
|
879
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
|
+
|
|
880
903
|
const staticTooltip = {
|
|
881
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",
|
|
882
905
|
"tooltip-white": "border border-base bg-popover text-popover",
|
|
@@ -927,7 +950,8 @@ const shortcuts = [
|
|
|
927
950
|
...label,
|
|
928
951
|
...popover,
|
|
929
952
|
...tooltip,
|
|
930
|
-
...pagination
|
|
953
|
+
...pagination,
|
|
954
|
+
...toggle
|
|
931
955
|
];
|
|
932
956
|
|
|
933
957
|
exports.shortcuts = shortcuts;
|
package/dist/shortcuts.mjs
CHANGED
|
@@ -189,7 +189,9 @@ const staticBtn = {
|
|
|
189
189
|
"btn-text-black": "text-base btn-focus",
|
|
190
190
|
"btn-soft-black": "text-base bg-base btn-focus shadow-sm",
|
|
191
191
|
"btn-text-muted": "text-muted btn-focus hover:text-accent",
|
|
192
|
-
"btn-link-muted": "text-muted btn-focus hover:underline underline-offset-4"
|
|
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"
|
|
193
195
|
};
|
|
194
196
|
const dynamicBtn = [
|
|
195
197
|
// base
|
|
@@ -200,7 +202,7 @@ const dynamicBtn = [
|
|
|
200
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`],
|
|
201
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`],
|
|
202
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`],
|
|
203
|
-
[/^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`]
|
|
204
206
|
];
|
|
205
207
|
const btn = [
|
|
206
208
|
...dynamicBtn,
|
|
@@ -356,10 +358,10 @@ const staticGeneral = {
|
|
|
356
358
|
"text-accent-foreground": "text-$c-accent",
|
|
357
359
|
"text-popover": "text-$c-popover-foreground",
|
|
358
360
|
"text-popover-foreground": "text-$c-popover",
|
|
359
|
-
"text-info": "text-info-
|
|
360
|
-
"text-error": "text-error-
|
|
361
|
-
"text-success": "text-success-
|
|
362
|
-
"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",
|
|
363
365
|
// ring
|
|
364
366
|
"ring-base": "ring-$c-ring",
|
|
365
367
|
"ring-inverted": "ring-$c-ring-foreground",
|
|
@@ -612,12 +614,11 @@ const popover = [
|
|
|
612
614
|
];
|
|
613
615
|
|
|
614
616
|
const staticProgress = {
|
|
615
|
-
//
|
|
616
|
-
"progress": "
|
|
617
|
+
// base
|
|
618
|
+
"progress-indeterminate": "absolute bg-brand h-full",
|
|
617
619
|
// components
|
|
618
|
-
"progress-root": "
|
|
619
|
-
"progress-indicator": "h-full w-full flex-1 bg-brand transition-all"
|
|
620
|
-
"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"
|
|
621
622
|
};
|
|
622
623
|
const dynamicProgress = [
|
|
623
624
|
[/^progress-(.*)$/, ([, body], { theme }) => {
|
|
@@ -820,31 +821,34 @@ const staticTable = {
|
|
|
820
821
|
"table-default-variant": "table-solid-gray",
|
|
821
822
|
"table": "",
|
|
822
823
|
// table-root
|
|
823
|
-
"table-root": "w-full caption-bottom text-sm",
|
|
824
824
|
"table-root-wrapper": "relative w-full overflow-x-auto overflow-y-hidden border border-base rounded-md",
|
|
825
|
-
"table-
|
|
825
|
+
"table-root": "w-full caption-bottom text-sm",
|
|
826
|
+
"table-body": "[&_tr:last-child]:border-0",
|
|
826
827
|
"table-caption": "mt-4 text-sm text-muted",
|
|
827
828
|
// table-head
|
|
828
|
-
"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",
|
|
829
830
|
"table-head-pinned": "sticky bg-base",
|
|
830
831
|
"table-head-pinned-left": "left-0",
|
|
831
832
|
"table-head-pinned-right": "right-0",
|
|
832
833
|
// table-header
|
|
833
|
-
"table-header": "[&_tr]:border-b border-base",
|
|
834
|
+
"table-header": "[&_tr]:border-b [&_tr]:border-base",
|
|
834
835
|
// table-row
|
|
835
|
-
"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",
|
|
836
837
|
// table-cell
|
|
837
|
-
"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",
|
|
838
839
|
"table-cell-pinned": "sticky bg-base",
|
|
839
840
|
"table-cell-pinned-left": "left-0",
|
|
840
841
|
"table-cell-pinned-right": "right-0",
|
|
841
842
|
// table-empty
|
|
842
843
|
"table-empty-row": "",
|
|
843
|
-
"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",
|
|
844
845
|
"table-empty": "flex items-center justify-center py-10",
|
|
845
846
|
// table-loading
|
|
846
|
-
"table-loading-icon": "
|
|
847
|
-
|
|
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",
|
|
848
852
|
"table-loading-cell": "",
|
|
849
853
|
"table-loading": "absolute inset-x-0 overflow-hidden p-0",
|
|
850
854
|
// table-footer
|
|
@@ -875,6 +879,25 @@ const tabs = [
|
|
|
875
879
|
staticTabs
|
|
876
880
|
];
|
|
877
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
|
+
|
|
878
901
|
const staticTooltip = {
|
|
879
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",
|
|
880
903
|
"tooltip-white": "border border-base bg-popover text-popover",
|
|
@@ -925,7 +948,8 @@ const shortcuts = [
|
|
|
925
948
|
...label,
|
|
926
949
|
...popover,
|
|
927
950
|
...tooltip,
|
|
928
|
-
...pagination
|
|
951
|
+
...pagination,
|
|
952
|
+
...toggle
|
|
929
953
|
];
|
|
930
954
|
|
|
931
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.1-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.4",
|
|
53
|
+
"@unocss/preset-mini": "^0.63.4",
|
|
54
|
+
"unocss": "^0.63.4"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "unbuild",
|