@una-ui/preset 0.24.0-beta.1 → 0.25.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 +2 -0
- package/dist/prefixes.mjs +2 -0
- package/dist/shortcuts.cjs +33 -27
- package/dist/shortcuts.mjs +33 -27
- package/package.json +4 -4
package/dist/prefixes.cjs
CHANGED
package/dist/prefixes.mjs
CHANGED
package/dist/shortcuts.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const utils = require('@unocss/preset-mini/utils');
|
|
4
|
+
const presetMini = require('@unocss/preset-mini');
|
|
4
5
|
|
|
5
6
|
const staticAccordion = {
|
|
6
7
|
// config
|
|
@@ -755,37 +756,38 @@ const slider = [
|
|
|
755
756
|
|
|
756
757
|
const staticSwitch = {
|
|
757
758
|
// base
|
|
758
|
-
"switch": "switch-
|
|
759
|
-
"switch-disabled": "n-disabled",
|
|
760
|
-
"switch-focus": "focus
|
|
761
|
-
// inset
|
|
762
|
-
"switch-inset": "h-1.5em w-2.75em",
|
|
763
|
-
"switch-track-inset": "h-1.5em w-2.75em",
|
|
764
|
-
// outset
|
|
765
|
-
"switch-outset": "h-1.25em w-2.5em",
|
|
766
|
-
"switch-track-outset": "h-1em w-2.25em",
|
|
759
|
+
"switch": "bg-brand switch-focus h-1.25em w-2.25em switch-disabled inline-flex shrink-0 cursor-pointer items-center border-2 border-transparent rounded-full shadow-sm",
|
|
760
|
+
"switch-disabled": "data-[disabled]:n-disabled",
|
|
761
|
+
"switch-focus": "focus-visible:ring-brand focus-visible:ring-offset-base transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
767
762
|
// thumb
|
|
768
|
-
"switch-thumb": "flex items-center justify-center
|
|
769
|
-
"switch-thumb-
|
|
770
|
-
"switch-thumb-
|
|
771
|
-
// track
|
|
772
|
-
"switch-track": "pointer-events-none absolute mx-auto rounded-full transition-base",
|
|
773
|
-
"switch-track-on": "bg-brand",
|
|
774
|
-
"switch-track-off": "bg-$c-gray-200",
|
|
763
|
+
"switch-thumb": "square-1em flex items-center justify-center absolute pointer-events-none block border border-base rounded-full bg-base shadow-lg ring-0 transition-transform",
|
|
764
|
+
"switch-thumb-checked": "translate-x-1.01em",
|
|
765
|
+
"switch-thumb-unchecked": "translate-x-0.03em",
|
|
775
766
|
// icon
|
|
776
|
-
"switch-icon
|
|
777
|
-
"switch-icon-
|
|
778
|
-
"switch-icon-
|
|
767
|
+
"switch-icon": "text-0.7em",
|
|
768
|
+
"switch-icon-unchecked": "text-muted",
|
|
769
|
+
"switch-icon-checked": "text-muted",
|
|
779
770
|
// loading
|
|
780
|
-
"switch-loading-icon": "
|
|
781
|
-
"switch-loading": "
|
|
771
|
+
"switch-loading-icon": "text-gray animate-spin text-0.8em",
|
|
772
|
+
"switch-loading-icon-name": "i-loading"
|
|
782
773
|
};
|
|
783
774
|
const dynamicSwitch = [
|
|
784
|
-
[
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
775
|
+
[
|
|
776
|
+
/^switch-checked(?:-([^-]+))?(?:-([^-]+))?$/,
|
|
777
|
+
([, color = "primary"], { theme }) => {
|
|
778
|
+
const parsedColor = presetMini.parseColor(color, theme);
|
|
779
|
+
if ((parsedColor?.cssColor?.type === "rgb" || parsedColor?.cssColor?.type === "rgba") && parsedColor.cssColor.components)
|
|
780
|
+
return `data-[state=checked]:n-${color}-600 dark:data-[state=checked]:n-${color}-500`;
|
|
781
|
+
}
|
|
782
|
+
],
|
|
783
|
+
[
|
|
784
|
+
/^switch-unchecked(?:-([^-]+))?(?:-([^-]+))?$/,
|
|
785
|
+
([, color = "primary"], { theme }) => {
|
|
786
|
+
const parsedColor = presetMini.parseColor(color, theme);
|
|
787
|
+
if ((parsedColor?.cssColor?.type === "rgb" || parsedColor?.cssColor?.type === "rgba") && parsedColor.cssColor.components)
|
|
788
|
+
return `data-[state=unchecked]:n-${color}-200 dark:data-[state=unchecked]:n-${color}-700/58`;
|
|
789
|
+
}
|
|
790
|
+
]
|
|
789
791
|
];
|
|
790
792
|
const _switch = [
|
|
791
793
|
...dynamicSwitch,
|
|
@@ -858,7 +860,11 @@ const staticTooltip = {
|
|
|
858
860
|
"tooltip-black": "border border-foreground bg-popover-foreground text-popover-foreground"
|
|
859
861
|
};
|
|
860
862
|
const dynamicTooltip = [
|
|
861
|
-
[/^tooltip(
|
|
863
|
+
[/^tooltip-(.*)$/, ([, c], { theme }) => {
|
|
864
|
+
const color = utils.parseColor(c, theme);
|
|
865
|
+
if ((color?.cssColor?.type === "rgb" || color?.cssColor?.type === "rgba") && color.cssColor.components)
|
|
866
|
+
return `bg-${c}-100 border-${c}-50 text-${c}-800 dark:bg-${c}-800 dark:border-${c}-800 dark:text-${c}-100`;
|
|
867
|
+
}]
|
|
862
868
|
];
|
|
863
869
|
const tooltip = [
|
|
864
870
|
...dynamicTooltip,
|
package/dist/shortcuts.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { parseColor } from '@unocss/preset-mini/utils';
|
|
2
|
+
import { parseColor as parseColor$1 } from '@unocss/preset-mini';
|
|
2
3
|
|
|
3
4
|
const staticAccordion = {
|
|
4
5
|
// config
|
|
@@ -753,37 +754,38 @@ const slider = [
|
|
|
753
754
|
|
|
754
755
|
const staticSwitch = {
|
|
755
756
|
// base
|
|
756
|
-
"switch": "switch-
|
|
757
|
-
"switch-disabled": "n-disabled",
|
|
758
|
-
"switch-focus": "focus
|
|
759
|
-
// inset
|
|
760
|
-
"switch-inset": "h-1.5em w-2.75em",
|
|
761
|
-
"switch-track-inset": "h-1.5em w-2.75em",
|
|
762
|
-
// outset
|
|
763
|
-
"switch-outset": "h-1.25em w-2.5em",
|
|
764
|
-
"switch-track-outset": "h-1em w-2.25em",
|
|
757
|
+
"switch": "bg-brand switch-focus h-1.25em w-2.25em switch-disabled inline-flex shrink-0 cursor-pointer items-center border-2 border-transparent rounded-full shadow-sm",
|
|
758
|
+
"switch-disabled": "data-[disabled]:n-disabled",
|
|
759
|
+
"switch-focus": "focus-visible:ring-brand focus-visible:ring-offset-base transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
765
760
|
// thumb
|
|
766
|
-
"switch-thumb": "flex items-center justify-center
|
|
767
|
-
"switch-thumb-
|
|
768
|
-
"switch-thumb-
|
|
769
|
-
// track
|
|
770
|
-
"switch-track": "pointer-events-none absolute mx-auto rounded-full transition-base",
|
|
771
|
-
"switch-track-on": "bg-brand",
|
|
772
|
-
"switch-track-off": "bg-$c-gray-200",
|
|
761
|
+
"switch-thumb": "square-1em flex items-center justify-center absolute pointer-events-none block border border-base rounded-full bg-base shadow-lg ring-0 transition-transform",
|
|
762
|
+
"switch-thumb-checked": "translate-x-1.01em",
|
|
763
|
+
"switch-thumb-unchecked": "translate-x-0.03em",
|
|
773
764
|
// icon
|
|
774
|
-
"switch-icon
|
|
775
|
-
"switch-icon-
|
|
776
|
-
"switch-icon-
|
|
765
|
+
"switch-icon": "text-0.7em",
|
|
766
|
+
"switch-icon-unchecked": "text-muted",
|
|
767
|
+
"switch-icon-checked": "text-muted",
|
|
777
768
|
// loading
|
|
778
|
-
"switch-loading-icon": "
|
|
779
|
-
"switch-loading": "
|
|
769
|
+
"switch-loading-icon": "text-gray animate-spin text-0.8em",
|
|
770
|
+
"switch-loading-icon-name": "i-loading"
|
|
780
771
|
};
|
|
781
772
|
const dynamicSwitch = [
|
|
782
|
-
[
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
773
|
+
[
|
|
774
|
+
/^switch-checked(?:-([^-]+))?(?:-([^-]+))?$/,
|
|
775
|
+
([, color = "primary"], { theme }) => {
|
|
776
|
+
const parsedColor = parseColor$1(color, theme);
|
|
777
|
+
if ((parsedColor?.cssColor?.type === "rgb" || parsedColor?.cssColor?.type === "rgba") && parsedColor.cssColor.components)
|
|
778
|
+
return `data-[state=checked]:n-${color}-600 dark:data-[state=checked]:n-${color}-500`;
|
|
779
|
+
}
|
|
780
|
+
],
|
|
781
|
+
[
|
|
782
|
+
/^switch-unchecked(?:-([^-]+))?(?:-([^-]+))?$/,
|
|
783
|
+
([, color = "primary"], { theme }) => {
|
|
784
|
+
const parsedColor = parseColor$1(color, theme);
|
|
785
|
+
if ((parsedColor?.cssColor?.type === "rgb" || parsedColor?.cssColor?.type === "rgba") && parsedColor.cssColor.components)
|
|
786
|
+
return `data-[state=unchecked]:n-${color}-200 dark:data-[state=unchecked]:n-${color}-700/58`;
|
|
787
|
+
}
|
|
788
|
+
]
|
|
787
789
|
];
|
|
788
790
|
const _switch = [
|
|
789
791
|
...dynamicSwitch,
|
|
@@ -856,7 +858,11 @@ const staticTooltip = {
|
|
|
856
858
|
"tooltip-black": "border border-foreground bg-popover-foreground text-popover-foreground"
|
|
857
859
|
};
|
|
858
860
|
const dynamicTooltip = [
|
|
859
|
-
[/^tooltip(
|
|
861
|
+
[/^tooltip-(.*)$/, ([, c], { theme }) => {
|
|
862
|
+
const color = parseColor(c, theme);
|
|
863
|
+
if ((color?.cssColor?.type === "rgb" || color?.cssColor?.type === "rgba") && color.cssColor.components)
|
|
864
|
+
return `bg-${c}-100 border-${c}-50 text-${c}-800 dark:bg-${c}-800 dark:border-${c}-800 dark:text-${c}-100`;
|
|
865
|
+
}]
|
|
860
866
|
];
|
|
861
867
|
const tooltip = [
|
|
862
868
|
...dynamicTooltip,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@una-ui/preset",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.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.
|
|
53
|
-
"@unocss/preset-mini": "^0.
|
|
54
|
-
"unocss": "^0.
|
|
52
|
+
"@unocss/core": "^0.63.1",
|
|
53
|
+
"@unocss/preset-mini": "^0.63.1",
|
|
54
|
+
"unocss": "^0.63.1"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "unbuild",
|