@una-ui/preset 0.37.0-beta.1 → 0.38.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
@@ -5,7 +5,7 @@ const colors = require('@unocss/preset-mini/colors');
5
5
  const rules = require('@unocss/preset-mini/rules');
6
6
  const utils = require('@unocss/preset-mini/utils');
7
7
  const unocss = require('unocss');
8
- const index = require('./shared/preset.frTThEzw.cjs');
8
+ const index = require('./shared/preset.F4kNR6ES.cjs');
9
9
 
10
10
  function presetUna(options = {
11
11
  // TODO: add options
@@ -92,6 +92,10 @@ function presetUna(options = {
92
92
  }
93
93
  }],
94
94
  [/^size-(.*)$/, rules.fonts[1][1]],
95
+ [/^square-(min-|max-)?(.+)$/, ([, _m, s]) => ({
96
+ width: utils.handler.bracket.cssvar.global.auto.fraction.rem(s),
97
+ height: utils.handler.bracket.cssvar.global.auto.fraction.rem(s)
98
+ })],
95
99
  ["n-disabled", {
96
100
  "opacity": 0.5,
97
101
  "pointer-events": "none"
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  import { theme } from '@unocss/preset-mini';
2
2
  import { colors } from '@unocss/preset-mini/colors';
3
3
  import { fonts } from '@unocss/preset-mini/rules';
4
- import { parseColor } from '@unocss/preset-mini/utils';
4
+ import { parseColor, handler } from '@unocss/preset-mini/utils';
5
5
  import { mergeDeep } from 'unocss';
6
- import { s as shortcuts } from './shared/preset.nbSNq5ip.mjs';
6
+ import { s as shortcuts } from './shared/preset.CkLYnPnw.mjs';
7
7
 
8
8
  function presetUna(options = {
9
9
  // TODO: add options
@@ -90,6 +90,10 @@ function presetUna(options = {
90
90
  }
91
91
  }],
92
92
  [/^size-(.*)$/, fonts[1][1]],
93
+ [/^square-(min-|max-)?(.+)$/, ([, _m, s]) => ({
94
+ width: handler.bracket.cssvar.global.auto.fraction.rem(s),
95
+ height: handler.bracket.cssvar.global.auto.fraction.rem(s)
96
+ })],
93
97
  ["n-disabled", {
94
98
  "opacity": 0.5,
95
99
  "pointer-events": "none"
package/dist/prefixes.cjs CHANGED
@@ -20,7 +20,6 @@ const prefixes = [
20
20
  "btn",
21
21
  "button",
22
22
  "card",
23
- "card-about",
24
23
  "card-content",
25
24
  "card-description",
26
25
  "card-footer",
@@ -64,8 +63,6 @@ const prefixes = [
64
63
  "kbd",
65
64
  "label",
66
65
  "link",
67
- "nav-link",
68
- "nav-link-group",
69
66
  "pagination",
70
67
  "pagination-ellipsis",
71
68
  "pagination-selected",
@@ -79,7 +76,6 @@ const prefixes = [
79
76
  "popover",
80
77
  "popover-content",
81
78
  "progress",
82
- "radio",
83
79
  "radio-group",
84
80
  "radio-group-item",
85
81
  "resize",
package/dist/prefixes.mjs CHANGED
@@ -18,7 +18,6 @@ const prefixes = [
18
18
  "btn",
19
19
  "button",
20
20
  "card",
21
- "card-about",
22
21
  "card-content",
23
22
  "card-description",
24
23
  "card-footer",
@@ -62,8 +61,6 @@ const prefixes = [
62
61
  "kbd",
63
62
  "label",
64
63
  "link",
65
- "nav-link",
66
- "nav-link-group",
67
64
  "pagination",
68
65
  "pagination-ellipsis",
69
66
  "pagination-selected",
@@ -77,7 +74,6 @@ const prefixes = [
77
74
  "popover",
78
75
  "popover-content",
79
76
  "progress",
80
- "radio",
81
77
  "radio-group",
82
78
  "radio-group-item",
83
79
  "resize",
@@ -214,21 +214,19 @@ const btn = [
214
214
 
215
215
  const staticCard = {
216
216
  // base
217
- "card": "relative flex flex-col rounded-lg overflow-hidden shadow-sm",
217
+ "card": "rounded-xl shadow text-base",
218
218
  "card-default-variant": "card-outline-gray",
219
219
  // components
220
- "card-header": "",
221
- "card-title": "text-2xl font-semibold leading-none tracking-tight",
220
+ "card-header": "flex flex-col gap-y-1.5 p-6",
221
+ "card-title": "font-semibold leading-none tracking-tight",
222
222
  "card-description": "text-sm text-muted",
223
- "card-content": "px-4 py-5 pt-0 sm:p-6 sm:pt-0",
223
+ "card-content": "p-6 pt-0",
224
224
  "card-footer": "flex items-center p-6 pt-0",
225
- "card-about": "flex flex-col gap-y-1.5 px-4 py-5 sm:p-6",
226
225
  // static variants
227
226
  "card-soft-gray": "bg-muted border border-base",
228
227
  "card-outline-gray": "bg-base border border-base"
229
228
  };
230
229
  const dynamicCard = [
231
- // dynamic variants
232
230
  [/^card-soft(-(\S+))?$/, ([, , c = "gray"]) => `bg-${c}-50 dark:bg-${c}-900 border-${c}-200 dark:border-${c}-700/58`],
233
231
  [/^card-outline(-(\S+))?$/, ([, , c = "gray"]) => `border border-${c}-200 dark:border-${c}-700/58`]
234
232
  ];
@@ -311,7 +309,7 @@ const staticDropdownMenu = {
311
309
  "dropdown-menu-item-leading": "text-1em",
312
310
  "dropdown-menu-item-trailing": "ml-auto opacity-75 text-1em",
313
311
  // dropdown-menu-label
314
- "dropdown-menu-label": "px-2 py-1.5 text-1em font-semibold",
312
+ "dropdown-menu-label": "px-2 py-1.5 text-0.875em font-semibold",
315
313
  // dropdown-menu-separator
316
314
  "dropdown-menu-separator-root": "relative -mx-1",
317
315
  "dropdown-menu-separator": "",
@@ -437,12 +435,6 @@ const staticGeneral = {
437
435
  const dynamicGeneral = [
438
436
  // TODO: una-text-<color><-number><-number>
439
437
  // [/^una-text(-(\S+))?$/, ([, , c = 'primary']) => `text-${c}-700 dark:text-${c}-400`],
440
- /**
441
- * Since we override the default `size` utility, we need to provide an alternative for it.
442
- * @refer https://tailwindcss.com/docs/size
443
- * @example area-100 -> w-100 h-100
444
- */
445
- [/^square-([^-]+)$/, ([, size]) => `w-${size} h-${size}`]
446
438
  ];
447
439
  const general = [
448
440
  ...dynamicGeneral,
@@ -570,45 +562,6 @@ const link = [
570
562
  staticLink
571
563
  ];
572
564
 
573
- const staticNavLink = {
574
- // config
575
- "nav-link-default-variant": "nav-link-text-primary",
576
- // base
577
- "nav-link": "transition-base leading-6 justify-start gap-x-3 rounded-md",
578
- // badge
579
- "nav-link-badge": "min-w-max whitespace-nowrap rounded-full px-2.5 py-.5 leading-5",
580
- // text-variant
581
- "nav-link-text-gray": "hover:bg-$c-gray-100 hover:text-$c-gray-950",
582
- "nav-link-active-text-gray": "bg-$c-gray-100 text-$c-gray-950",
583
- "nav-link-inactive-text-gray": "text-$c-gray-950"
584
- };
585
- const dynamicNavLink = [
586
- // text-variant
587
- [/^nav-link-active-text(-(\S+))?$/, ([, , c = "primary"]) => `bg-$c-gray-100 text-${c}-600 dark:text-${c}-500`],
588
- [/^nav-link-inactive-text(-(\S+))?$/, ([, , c = "gray"]) => `text-${c}-800 dark:text-${c}-100`],
589
- [/^nav-link-text(-(\S+))?$/, ([, , c = "primary"]) => `btn-focus-${c} hover:nav-link-active-text-${c}`],
590
- // solid-variant
591
- [/^nav-link-active-solid(-(\S+))?$/, ([, , c = "primary"]) => `bg-${c}-700 dark:bg-${c}-400 text-white dark:text-${c}-950`],
592
- [/^nav-link-inactive-solid(-(\S+))?$/, ([, , c = "primary"]) => `text-white dark:text-${c}-950`],
593
- [/^nav-link-solid(-(\S+))?$/, ([, , c = "primary"]) => `btn-focus-${c} hover:nav-link-active-solid-${c}`]
594
- ];
595
- const navLink = [
596
- ...dynamicNavLink,
597
- staticNavLink
598
- ];
599
-
600
- const staticNavLinkGroup = {
601
- // base
602
- "nav-link-group": "w-60 flex flex-col border-2 border-base rounded-md border-dashed p-2 space-y-1",
603
- // panel
604
- "nav-link-group-panel": "mt-1 px-2 space-y-1"
605
- };
606
- const dynamicNavLinkGroup = [];
607
- const navLinkGroup = [
608
- ...dynamicNavLinkGroup,
609
- staticNavLinkGroup
610
- ];
611
-
612
565
  const staticPagination = {
613
566
  // configurations
614
567
  "pagination": "overflow-hidden",
@@ -680,33 +633,6 @@ const progress = [
680
633
  staticProgress
681
634
  ];
682
635
 
683
- const staticRadio = {
684
- // base
685
- "radio": "radio-primary flex items-center transition-base border border-$c-ring rounded-full p-0.12em h-1em w-1em n-checked:border-brand n-checked:bg-brand",
686
- "radio-disabled": "n-disabled",
687
- "radio-label": "block text-sm font-medium leading-6",
688
- "radio-input": "absolute w-full opacity-0",
689
- "radio-reverse": "flex-row-reverse",
690
- "radio-peer-focus": "peer-focus-(ring-2 ring-brand ring-offset-2 ring-offset-base)",
691
- // wrappers
692
- "radio-wrapper": "gap-x-3 relative inline-flex items-center hover:cursor-pointer",
693
- // icon
694
- "radio-icon-base": "m-auto opacity-0 text-inverted w-full h-full transition-base n-checked:opacity-100",
695
- "radio-icon": "i-dot"
696
- // refer to general.ts
697
- };
698
- const dynamicRadio = [
699
- [/^radio-(.*)$/, ([, body], { theme }) => {
700
- const color = parseColor(body, theme);
701
- if ((color?.cssColor?.type === "rgb" || color?.cssColor?.type === "rgba") && color.cssColor.components)
702
- return `n-${body}-600 dark:n-${body}-500`;
703
- }]
704
- ];
705
- const radio = [
706
- ...dynamicRadio,
707
- staticRadio
708
- ];
709
-
710
636
  const staticRadioGroup = {
711
637
  // configurations
712
638
  "radio-group": "gap-2 flex flex-wrap",
@@ -1058,10 +984,7 @@ const shortcuts = [
1058
984
  ...avatar,
1059
985
  ...indicator,
1060
986
  ...kbd,
1061
- ...navLink,
1062
- ...navLinkGroup,
1063
987
  ...link,
1064
- ...radio,
1065
988
  ...checkbox,
1066
989
  ...slider,
1067
990
  ...progress,
@@ -216,21 +216,19 @@ const btn = [
216
216
 
217
217
  const staticCard = {
218
218
  // base
219
- "card": "relative flex flex-col rounded-lg overflow-hidden shadow-sm",
219
+ "card": "rounded-xl shadow text-base",
220
220
  "card-default-variant": "card-outline-gray",
221
221
  // components
222
- "card-header": "",
223
- "card-title": "text-2xl font-semibold leading-none tracking-tight",
222
+ "card-header": "flex flex-col gap-y-1.5 p-6",
223
+ "card-title": "font-semibold leading-none tracking-tight",
224
224
  "card-description": "text-sm text-muted",
225
- "card-content": "px-4 py-5 pt-0 sm:p-6 sm:pt-0",
225
+ "card-content": "p-6 pt-0",
226
226
  "card-footer": "flex items-center p-6 pt-0",
227
- "card-about": "flex flex-col gap-y-1.5 px-4 py-5 sm:p-6",
228
227
  // static variants
229
228
  "card-soft-gray": "bg-muted border border-base",
230
229
  "card-outline-gray": "bg-base border border-base"
231
230
  };
232
231
  const dynamicCard = [
233
- // dynamic variants
234
232
  [/^card-soft(-(\S+))?$/, ([, , c = "gray"]) => `bg-${c}-50 dark:bg-${c}-900 border-${c}-200 dark:border-${c}-700/58`],
235
233
  [/^card-outline(-(\S+))?$/, ([, , c = "gray"]) => `border border-${c}-200 dark:border-${c}-700/58`]
236
234
  ];
@@ -313,7 +311,7 @@ const staticDropdownMenu = {
313
311
  "dropdown-menu-item-leading": "text-1em",
314
312
  "dropdown-menu-item-trailing": "ml-auto opacity-75 text-1em",
315
313
  // dropdown-menu-label
316
- "dropdown-menu-label": "px-2 py-1.5 text-1em font-semibold",
314
+ "dropdown-menu-label": "px-2 py-1.5 text-0.875em font-semibold",
317
315
  // dropdown-menu-separator
318
316
  "dropdown-menu-separator-root": "relative -mx-1",
319
317
  "dropdown-menu-separator": "",
@@ -439,12 +437,6 @@ const staticGeneral = {
439
437
  const dynamicGeneral = [
440
438
  // TODO: una-text-<color><-number><-number>
441
439
  // [/^una-text(-(\S+))?$/, ([, , c = 'primary']) => `text-${c}-700 dark:text-${c}-400`],
442
- /**
443
- * Since we override the default `size` utility, we need to provide an alternative for it.
444
- * @refer https://tailwindcss.com/docs/size
445
- * @example area-100 -> w-100 h-100
446
- */
447
- [/^square-([^-]+)$/, ([, size]) => `w-${size} h-${size}`]
448
440
  ];
449
441
  const general = [
450
442
  ...dynamicGeneral,
@@ -572,45 +564,6 @@ const link = [
572
564
  staticLink
573
565
  ];
574
566
 
575
- const staticNavLink = {
576
- // config
577
- "nav-link-default-variant": "nav-link-text-primary",
578
- // base
579
- "nav-link": "transition-base leading-6 justify-start gap-x-3 rounded-md",
580
- // badge
581
- "nav-link-badge": "min-w-max whitespace-nowrap rounded-full px-2.5 py-.5 leading-5",
582
- // text-variant
583
- "nav-link-text-gray": "hover:bg-$c-gray-100 hover:text-$c-gray-950",
584
- "nav-link-active-text-gray": "bg-$c-gray-100 text-$c-gray-950",
585
- "nav-link-inactive-text-gray": "text-$c-gray-950"
586
- };
587
- const dynamicNavLink = [
588
- // text-variant
589
- [/^nav-link-active-text(-(\S+))?$/, ([, , c = "primary"]) => `bg-$c-gray-100 text-${c}-600 dark:text-${c}-500`],
590
- [/^nav-link-inactive-text(-(\S+))?$/, ([, , c = "gray"]) => `text-${c}-800 dark:text-${c}-100`],
591
- [/^nav-link-text(-(\S+))?$/, ([, , c = "primary"]) => `btn-focus-${c} hover:nav-link-active-text-${c}`],
592
- // solid-variant
593
- [/^nav-link-active-solid(-(\S+))?$/, ([, , c = "primary"]) => `bg-${c}-700 dark:bg-${c}-400 text-white dark:text-${c}-950`],
594
- [/^nav-link-inactive-solid(-(\S+))?$/, ([, , c = "primary"]) => `text-white dark:text-${c}-950`],
595
- [/^nav-link-solid(-(\S+))?$/, ([, , c = "primary"]) => `btn-focus-${c} hover:nav-link-active-solid-${c}`]
596
- ];
597
- const navLink = [
598
- ...dynamicNavLink,
599
- staticNavLink
600
- ];
601
-
602
- const staticNavLinkGroup = {
603
- // base
604
- "nav-link-group": "w-60 flex flex-col border-2 border-base rounded-md border-dashed p-2 space-y-1",
605
- // panel
606
- "nav-link-group-panel": "mt-1 px-2 space-y-1"
607
- };
608
- const dynamicNavLinkGroup = [];
609
- const navLinkGroup = [
610
- ...dynamicNavLinkGroup,
611
- staticNavLinkGroup
612
- ];
613
-
614
567
  const staticPagination = {
615
568
  // configurations
616
569
  "pagination": "overflow-hidden",
@@ -682,33 +635,6 @@ const progress = [
682
635
  staticProgress
683
636
  ];
684
637
 
685
- const staticRadio = {
686
- // base
687
- "radio": "radio-primary flex items-center transition-base border border-$c-ring rounded-full p-0.12em h-1em w-1em n-checked:border-brand n-checked:bg-brand",
688
- "radio-disabled": "n-disabled",
689
- "radio-label": "block text-sm font-medium leading-6",
690
- "radio-input": "absolute w-full opacity-0",
691
- "radio-reverse": "flex-row-reverse",
692
- "radio-peer-focus": "peer-focus-(ring-2 ring-brand ring-offset-2 ring-offset-base)",
693
- // wrappers
694
- "radio-wrapper": "gap-x-3 relative inline-flex items-center hover:cursor-pointer",
695
- // icon
696
- "radio-icon-base": "m-auto opacity-0 text-inverted w-full h-full transition-base n-checked:opacity-100",
697
- "radio-icon": "i-dot"
698
- // refer to general.ts
699
- };
700
- const dynamicRadio = [
701
- [/^radio-(.*)$/, ([, body], { theme }) => {
702
- const color = utils.parseColor(body, theme);
703
- if ((color?.cssColor?.type === "rgb" || color?.cssColor?.type === "rgba") && color.cssColor.components)
704
- return `n-${body}-600 dark:n-${body}-500`;
705
- }]
706
- ];
707
- const radio = [
708
- ...dynamicRadio,
709
- staticRadio
710
- ];
711
-
712
638
  const staticRadioGroup = {
713
639
  // configurations
714
640
  "radio-group": "gap-2 flex flex-wrap",
@@ -1060,10 +986,7 @@ const shortcuts = [
1060
986
  ...avatar,
1061
987
  ...indicator,
1062
988
  ...kbd,
1063
- ...navLink,
1064
- ...navLinkGroup,
1065
989
  ...link,
1066
- ...radio,
1067
990
  ...checkbox,
1068
991
  ...slider,
1069
992
  ...progress,
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./shared/preset.frTThEzw.cjs');
3
+ const index = require('./shared/preset.F4kNR6ES.cjs');
4
4
  require('@unocss/preset-mini/utils');
5
5
  require('@unocss/preset-mini');
6
6
 
@@ -1,3 +1,3 @@
1
- export { s as shortcuts } from './shared/preset.nbSNq5ip.mjs';
1
+ export { s as shortcuts } from './shared/preset.CkLYnPnw.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",
3
- "version": "0.37.0-beta.1",
3
+ "version": "0.38.0-beta.1",
4
4
  "description": "The default preset for @una-ui",
5
5
  "author": "Phojie Rengel <phojrengel@gmail.com>",
6
6
  "license": "MIT",