@una-ui/preset 0.4.0-beta.0 → 0.5.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/index.cjs CHANGED
@@ -64,7 +64,7 @@ function presetUna(options = {
64
64
  }],
65
65
  [/^size-(.*)$/, rules.fonts[1][1]],
66
66
  ["n-disabled", {
67
- "opacity": 0.7,
67
+ "opacity": 0.5,
68
68
  "pointer-events": "none"
69
69
  }]
70
70
  ],
package/dist/index.mjs CHANGED
@@ -62,7 +62,7 @@ function presetUna(options = {
62
62
  }],
63
63
  [/^size-(.*)$/, fonts[1][1]],
64
64
  ["n-disabled", {
65
- "opacity": 0.7,
65
+ "opacity": 0.5,
66
66
  "pointer-events": "none"
67
67
  }]
68
68
  ],
package/dist/prefixes.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const prefixes = ["accordion", "alert", "avatar-group", "avatar", "badge", "btn", "checkbox", "form-group", "general", "icon", "indicator", "input", "kbd", "link", "nav-link-group", "nav-link", "radio", "switch", "resize", "size", "nav-link-active", "nav-link-inactive"];
3
+ const prefixes = ["accordion", "alert", "avatar-group", "avatar", "badge", "btn", "checkbox", "form-group", "general", "icon", "indicator", "input", "kbd", "link", "nav-link-group", "nav-link", "radio", "slider", "switch", "resize", "size", "nav-link-active", "nav-link-inactive"];
4
4
 
5
5
  module.exports = prefixes;
package/dist/prefixes.mjs CHANGED
@@ -1,3 +1,3 @@
1
- const prefixes = ["accordion", "alert", "avatar-group", "avatar", "badge", "btn", "checkbox", "form-group", "general", "icon", "indicator", "input", "kbd", "link", "nav-link-group", "nav-link", "radio", "switch", "resize", "size", "nav-link-active", "nav-link-inactive"];
1
+ const prefixes = ["accordion", "alert", "avatar-group", "avatar", "badge", "btn", "checkbox", "form-group", "general", "icon", "indicator", "input", "kbd", "link", "nav-link-group", "nav-link", "radio", "slider", "switch", "resize", "size", "nav-link-active", "nav-link-inactive"];
2
2
 
3
3
  export { prefixes as default };
@@ -203,8 +203,8 @@ const input = [
203
203
 
204
204
  const staticGeneral = {
205
205
  // text-size
206
- "text-md": "text-16px",
207
- "size-md": "text-16px",
206
+ "text-md": "text-1rem leading-1.5rem",
207
+ "size-md": "text-md",
208
208
  // text color
209
209
  "text-base": "text-$c-foreground",
210
210
  "text-inverted": "text-$c-background",
@@ -479,6 +479,32 @@ const checkbox = [
479
479
  staticCheckbox
480
480
  ];
481
481
 
482
+ const staticSlider = {
483
+ // configurations
484
+ "slider": "slider-primary size-base",
485
+ "slider-disabled": "n-disabled",
486
+ "slider-root-vertical": "flex-col w-1em h-full",
487
+ "slider-track-vertical": "w-0.5em h-full",
488
+ "slider-range-vertical": "w-full",
489
+ "slider-thumb-vertical": "w-1.25em h-1.25em",
490
+ // components
491
+ "slider-root": "slider relative flex w-full touch-none select-none items-center",
492
+ "slider-track": "h-0.5em relative w-full grow overflow-hidden rounded-full bg-muted",
493
+ "slider-range": "absolute h-full bg-brand",
494
+ "slider-thumb": "w-1.25em h-1.25em block border-2 border-brand rounded-full bg-base focus-visible:ring-base ring-offset-base transition-colors disabled:pointer-events-none disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2"
495
+ };
496
+ const dynamicSlider = [
497
+ [/^slider-(.*)$/, ([, body], { theme }) => {
498
+ const color = utils.parseColor(body, theme);
499
+ if ((color?.cssColor?.type === "rgb" || color?.cssColor?.type === "rgba") && color.cssColor.components)
500
+ return `n-${body}-600 dark:n-${body}-500`;
501
+ }]
502
+ ];
503
+ const slider = [
504
+ ...dynamicSlider,
505
+ staticSlider
506
+ ];
507
+
482
508
  const shortcuts = [
483
509
  ...general,
484
510
  ...accordion,
@@ -497,7 +523,8 @@ const shortcuts = [
497
523
  ...navLinkGroup,
498
524
  ...link,
499
525
  ...radio,
500
- ...checkbox
526
+ ...checkbox,
527
+ ...slider
501
528
  ];
502
529
 
503
530
  exports.shortcuts = shortcuts;
@@ -1,6 +1,5 @@
1
- import * as _unocss_core from '@unocss/core';
2
- import { StaticShortcutMap } from '@unocss/core';
1
+ import { Preset, StaticShortcutMap } from '@unocss/core';
3
2
 
4
- declare const shortcuts: (StaticShortcutMap | _unocss_core.StaticShortcut | _unocss_core.DynamicShortcut<object>)[];
3
+ declare const shortcuts: Exclude<Preset["shortcuts"], undefined | StaticShortcutMap>;
5
4
 
6
5
  export { shortcuts };
@@ -1,6 +1,5 @@
1
- import * as _unocss_core from '@unocss/core';
2
- import { StaticShortcutMap } from '@unocss/core';
1
+ import { Preset, StaticShortcutMap } from '@unocss/core';
3
2
 
4
- declare const shortcuts: (StaticShortcutMap | _unocss_core.StaticShortcut | _unocss_core.DynamicShortcut<object>)[];
3
+ declare const shortcuts: Exclude<Preset["shortcuts"], undefined | StaticShortcutMap>;
5
4
 
6
5
  export { shortcuts };
@@ -1,6 +1,5 @@
1
- import * as _unocss_core from '@unocss/core';
2
- import { StaticShortcutMap } from '@unocss/core';
1
+ import { Preset, StaticShortcutMap } from '@unocss/core';
3
2
 
4
- declare const shortcuts: (StaticShortcutMap | _unocss_core.StaticShortcut | _unocss_core.DynamicShortcut<object>)[];
3
+ declare const shortcuts: Exclude<Preset["shortcuts"], undefined | StaticShortcutMap>;
5
4
 
6
5
  export { shortcuts };
@@ -201,8 +201,8 @@ const input = [
201
201
 
202
202
  const staticGeneral = {
203
203
  // text-size
204
- "text-md": "text-16px",
205
- "size-md": "text-16px",
204
+ "text-md": "text-1rem leading-1.5rem",
205
+ "size-md": "text-md",
206
206
  // text color
207
207
  "text-base": "text-$c-foreground",
208
208
  "text-inverted": "text-$c-background",
@@ -477,6 +477,32 @@ const checkbox = [
477
477
  staticCheckbox
478
478
  ];
479
479
 
480
+ const staticSlider = {
481
+ // configurations
482
+ "slider": "slider-primary size-base",
483
+ "slider-disabled": "n-disabled",
484
+ "slider-root-vertical": "flex-col w-1em h-full",
485
+ "slider-track-vertical": "w-0.5em h-full",
486
+ "slider-range-vertical": "w-full",
487
+ "slider-thumb-vertical": "w-1.25em h-1.25em",
488
+ // components
489
+ "slider-root": "slider relative flex w-full touch-none select-none items-center",
490
+ "slider-track": "h-0.5em relative w-full grow overflow-hidden rounded-full bg-muted",
491
+ "slider-range": "absolute h-full bg-brand",
492
+ "slider-thumb": "w-1.25em h-1.25em block border-2 border-brand rounded-full bg-base focus-visible:ring-base ring-offset-base transition-colors disabled:pointer-events-none disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2"
493
+ };
494
+ const dynamicSlider = [
495
+ [/^slider-(.*)$/, ([, body], { theme }) => {
496
+ const color = parseColor(body, theme);
497
+ if ((color?.cssColor?.type === "rgb" || color?.cssColor?.type === "rgba") && color.cssColor.components)
498
+ return `n-${body}-600 dark:n-${body}-500`;
499
+ }]
500
+ ];
501
+ const slider = [
502
+ ...dynamicSlider,
503
+ staticSlider
504
+ ];
505
+
480
506
  const shortcuts = [
481
507
  ...general,
482
508
  ...accordion,
@@ -495,7 +521,8 @@ const shortcuts = [
495
521
  ...navLinkGroup,
496
522
  ...link,
497
523
  ...radio,
498
- ...checkbox
524
+ ...checkbox,
525
+ ...slider
499
526
  ];
500
527
 
501
528
  export { shortcuts };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@una-ui/preset",
3
- "version": "0.4.0-beta.0",
3
+ "version": "0.5.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.57.3",
53
- "@unocss/preset-mini": "^0.57.3",
54
- "unocss": "^0.57.3"
52
+ "@unocss/core": "^0.61.5",
53
+ "@unocss/preset-mini": "^0.61.5",
54
+ "unocss": "^0.61.5"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "unbuild",