@una-ui/preset-edge 0.58.0-29157462.e9c9aa7 → 0.58.0-29162078.50f53ef

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/index.mjs CHANGED
@@ -3,7 +3,7 @@ import { colors } from '@unocss/preset-mini/colors';
3
3
  import { fonts } from '@unocss/preset-mini/rules';
4
4
  import { handler, parseColor } from '@unocss/preset-mini/utils';
5
5
  import { mergeDeep } from 'unocss';
6
- import { s as shortcuts } from './shared/preset-edge.BHGEskTu.mjs';
6
+ import { s as shortcuts } from './shared/preset-edge.B3q7gadC.mjs';
7
7
 
8
8
  function presetUna(options = {
9
9
  // TODO: add options
@@ -12,6 +12,7 @@ function presetUna(options = {
12
12
  name: "@una-ui/preset",
13
13
  options,
14
14
  shortcuts,
15
+ separators: [":"],
15
16
  theme: mergeDeep(theme, {
16
17
  container: {
17
18
  center: true,
@@ -1044,38 +1044,27 @@ const slider = [
1044
1044
 
1045
1045
  const staticSwitch = {
1046
1046
  // base
1047
- "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",
1047
+ "switch": "h-1.25em w-2.25em switch-disabled inline-flex shrink-0 cursor-pointer items-center border-2 border-transparent rounded-full shadow-sm transition-colors",
1048
1048
  "switch-disabled": "data-[disabled]:n-disabled",
1049
- "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",
1050
1049
  // thumb
1051
- "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",
1050
+ "switch-thumb": "square-1em flex items-center justify-center pointer-events-none block rounded-full bg-base shadow-lg ring-0 transition-transform",
1052
1051
  "switch-thumb-checked": "translate-x-1.01em",
1053
1052
  "switch-thumb-unchecked": "translate-x-0.03em",
1054
- // icon
1053
+ // icons
1055
1054
  "switch-icon": "text-0.7em",
1056
1055
  "switch-icon-unchecked": "text-muted",
1057
1056
  "switch-icon-checked": "text-muted",
1058
1057
  // loading
1059
1058
  "switch-loading-icon": "text-gray animate-spin text-0.8em",
1060
- "switch-loading-icon-name": "i-loading"
1059
+ "switch-loading-icon-name": "i-loading",
1060
+ "switch-focus-gray": "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-base focus-visible:ring-offset-2 focus-visible:ring-offset-background"
1061
1061
  };
1062
1062
  const dynamicSwitch = [
1063
- [
1064
- /^switch-checked(?:-([^-]+))?(?:-([^-]+))?$/,
1065
- ([, color = "primary"], { theme }) => {
1066
- const parsedColor = parseColor$1(color, theme);
1067
- if ((parsedColor?.cssColor?.type === "rgb" || parsedColor?.cssColor?.type === "rgba") && parsedColor.cssColor.components)
1068
- return `data-[state=checked]:n-${color}-600 dark:data-[state=checked]:n-${color}-500`;
1069
- }
1070
- ],
1071
- [
1072
- /^switch-unchecked(?:-([^-]+))?(?:-([^-]+))?$/,
1073
- ([, color = "gray"], { theme }) => {
1074
- const parsedColor = parseColor$1(color, theme);
1075
- if ((parsedColor?.cssColor?.type === "rgb" || parsedColor?.cssColor?.type === "rgba") && parsedColor.cssColor.components)
1076
- return `data-[state=unchecked]:n-${color}-200 dark:data-[state=unchecked]:n-${color}-700/58`;
1077
- }
1078
- ]
1063
+ // base
1064
+ [/^switch-focus(-(\S+))?$/, ([, , c = "primary"]) => `focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-${c}-600 dark:focus-visible:ring-${c}-500 focus-visible:ring-offset-2 focus-visible:ring-offset-background`],
1065
+ // variants
1066
+ [/^switch-checked(-(\S+))?$/, ([, , c = "primary"]) => `data-[state=checked]:switch-focus-${c} data-[state=checked]:bg-${c}-600 dark:data-[state=checked]:bg-${c}-500`],
1067
+ [/^switch-unchecked(-(\S+))?$/, ([, , c = "gray"]) => `data-[state=unchecked]:switch-focus-${c} data-[state=unchecked]:bg-${c}-200 dark:data-[state=unchecked]:bg-${c}-700/58`]
1079
1068
  ];
1080
1069
  const _switch = [
1081
1070
  ...dynamicSwitch,
@@ -1,3 +1,3 @@
1
- export { s as shortcuts } from './shared/preset-edge.BHGEskTu.mjs';
1
+ export { s as shortcuts } from './shared/preset-edge.B3q7gadC.mjs';
2
2
  import '@unocss/preset-mini/utils';
3
3
  import '@unocss/preset-mini';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@una-ui/preset-edge",
3
- "version": "0.58.0-29157462.e9c9aa7",
3
+ "version": "0.58.0-29162078.50f53ef",
4
4
  "description": "The default preset for @una-ui",
5
5
  "author": "Phojie Rengel <phojrengel@gmail.com>",
6
6
  "license": "MIT",