@una-ui/preset 0.38.0-beta.1 → 0.40.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.F4kNR6ES.cjs');
8
+ const index = require('./shared/preset.DPKZgAqu.cjs');
9
9
 
10
10
  function presetUna(options = {
11
11
  // TODO: add options
package/dist/index.d.ts CHANGED
@@ -6,4 +6,4 @@ interface unaUIOptions {
6
6
 
7
7
  declare function presetUna(options?: unaUIOptions): Preset;
8
8
 
9
- export { presetUna as default };
9
+ export = presetUna;
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, handler } from '@unocss/preset-mini/utils';
4
+ import { handler, parseColor } from '@unocss/preset-mini/utils';
5
5
  import { mergeDeep } from 'unocss';
6
- import { s as shortcuts } from './shared/preset.CkLYnPnw.mjs';
6
+ import { s as shortcuts } from './shared/preset.rfZXnCIa.mjs';
7
7
 
8
8
  function presetUna(options = {
9
9
  // TODO: add options
package/dist/prefixes.cjs CHANGED
@@ -80,6 +80,8 @@ const prefixes = [
80
80
  "radio-group-item",
81
81
  "resize",
82
82
  "rounded",
83
+ "scroll-area",
84
+ "scroll-bar",
83
85
  "select",
84
86
  "select-content",
85
87
  "select-group",
@@ -118,7 +120,6 @@ const prefixes = [
118
120
  "table-head",
119
121
  "table-header",
120
122
  "table-loading",
121
- "table-root",
122
123
  "table-row",
123
124
  "tabs",
124
125
  "tabs-content",
@@ -1,3 +1,3 @@
1
1
  declare const _default: string[];
2
2
 
3
- export { _default as default };
3
+ export = _default;
package/dist/prefixes.mjs CHANGED
@@ -78,6 +78,8 @@ const prefixes = [
78
78
  "radio-group-item",
79
79
  "resize",
80
80
  "rounded",
81
+ "scroll-area",
82
+ "scroll-bar",
81
83
  "select",
82
84
  "select-content",
83
85
  "select-group",
@@ -116,7 +118,6 @@ const prefixes = [
116
118
  "table-head",
117
119
  "table-header",
118
120
  "table-loading",
119
- "table-root",
120
121
  "table-row",
121
122
  "tabs",
122
123
  "tabs-content",
@@ -70,20 +70,20 @@ const alert = [
70
70
 
71
71
  const staticAvatar = {
72
72
  // base
73
- "avatar": "relative flex shrink-0 overflow-hidden leading-1.5em",
74
- "avatar-image": "aspect-square h-full w-full",
73
+ "avatar": "relative inline-flex items-center font-normal select-none shrink-0 overflow-hidden",
74
+ "avatar-image": "h-full w-full object-cover",
75
75
  "avatar-fallback": "flex h-full w-full items-center justify-center",
76
- "avatar-label": "",
76
+ "avatar-label": "uppercase",
77
77
  "avatar-icon": "text-1em",
78
78
  // variants
79
- "avatar-solid-white": "bg-base text-base ring-1 ring-base",
79
+ "avatar-solid-white": "bg-base text-base border border-base",
80
80
  "avatar-solid-black": "bg-inverted text-inverted"
81
81
  };
82
82
  const dynamicAvatar = [
83
83
  // variants
84
84
  [/^avatar-solid(-(\S+))?$/, ([, , c = "gray"]) => `bg-${c}-600 dark:bg-${c}-500 text-inverted`],
85
85
  [/^avatar-soft(-(\S+))?$/, ([, , c = "gray"]) => `bg-${c}-50 text-${c}-700 dark:text-${c}-400 dark:bg-${c}-900`],
86
- [/^avatar-outline(-(\S+))?$/, ([, , c = "gray"]) => `bg-transparent text-${c}-500 dark:text-${c}-400 ring-1 ring-${c}-500 dark:ring-${c}-400`]
86
+ [/^avatar-outline(-(\S+))?$/, ([, , c = "gray"]) => `bg-transparent text-${c}-500 dark:text-${c}-400 border border-${c}-500 dark:border-${c}-400`]
87
87
  ];
88
88
  const avatar = [
89
89
  ...dynamicAvatar,
@@ -217,7 +217,6 @@ const btn = [
217
217
  const staticCard = {
218
218
  // base
219
219
  "card": "rounded-xl shadow text-base",
220
- "card-default-variant": "card-outline-gray",
221
220
  // components
222
221
  "card-header": "flex flex-col gap-y-1.5 p-6",
223
222
  "card-title": "font-semibold leading-none tracking-tight",
@@ -425,6 +424,7 @@ const staticGeneral = {
425
424
  "bg-base": "bg-$c-background",
426
425
  "bg-inverted": "bg-$c-foreground",
427
426
  "bg-muted": "bg-$c-muted",
427
+ "bg-border": "bg-$c-border",
428
428
  "bg-accent": "bg-$c-accent",
429
429
  "bg-accent-foreground": "bg-$c-accent-foreground",
430
430
  "bg-popover": "bg-$c-popover",
@@ -481,7 +481,7 @@ const indicator = [
481
481
 
482
482
  const staticInput = {
483
483
  // config
484
- "input-default-variant": "input-outline",
484
+ "input-default-variant": "input-outline-primary",
485
485
  "input-loading-icon": "i-loading",
486
486
  "input-info-icon": "i-info",
487
487
  "input-error-icon": "i-error",
@@ -490,7 +490,7 @@ const staticInput = {
490
490
  "input-leading-padding": "pl-2.9em",
491
491
  "input-trailing-padding": "pr-2.9em",
492
492
  // base
493
- "input": "text-0.875em leading-6 px-0.8571428571428571em py-0.5em w-full input-disabled ring-base ring-inset placeholder:text-$c-gray-400 block outline-none rounded-md border-0 shadow-sm bg-transparent",
493
+ "input": "text-base text-0.875em leading-6 px-0.8571428571428571em py-0.5em w-full input-disabled ring-base ring-inset placeholder:text-muted block outline-none rounded-md border-0 shadow-sm bg-transparent",
494
494
  "input-input": "h-9",
495
495
  // role='input'
496
496
  "input-textarea": "",
@@ -503,8 +503,8 @@ const staticInput = {
503
503
  "input-loading": "animate-spin text-1.042em",
504
504
  // wrappers
505
505
  "input-wrapper": "relative flex items-center",
506
- "input-leading-wrapper": "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-0.75em text-$c-gray-400",
507
- "input-trailing-wrapper": "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-0.75em text-$c-gray-400",
506
+ "input-leading-wrapper": "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-0.75em text-muted",
507
+ "input-trailing-wrapper": "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-0.75em text-muted",
508
508
  // variants
509
509
  "input-outline-gray": "focus:ring-2 ring-1",
510
510
  "input-outline-black": "ring-1 focus:ring-$c-foreground"
@@ -512,7 +512,7 @@ const staticInput = {
512
512
  const dynamicInput = [
513
513
  // config
514
514
  [/^input-focus(-(\S+))?$/, ([, , c = "primary"]) => `focus:ring-2 focus:ring-${c}-500 dark:focus:ring-${c}-400`],
515
- [/^input-status(-(\S+))?$/, ([, , c = "info"]) => `text-${c}-700 dark:text-${c}-200 placeholder-${c}-400/70 dark:placeholder-${c}-300/70`],
515
+ [/^input-status(-(\S+))?$/, ([, , c = "info"]) => `text-${c}-700 dark:text-${c}-200 placeholder-${c}-500 dark:placeholder-${c}-400`],
516
516
  // variants
517
517
  [/^input-outline(-(\S+))?$/, ([, , c = "primary"]) => `ring-1 input-focus-${c}`],
518
518
  [/^input-solid(-(\S+))?$/, ([, , c = "primary"]) => ` ring-1 input-focus-${c} ring-${c}-500 dark:ring-${c}-400`]
@@ -662,6 +662,32 @@ const radioGroup = [
662
662
  staticRadioGroup
663
663
  ];
664
664
 
665
+ const staticScrollArea = {
666
+ // configurations
667
+ "scroll-area": "",
668
+ "scroll-area-scrollbar-vertical": "h-full w-0.625em border-l border-l-transparent p-0.0625em",
669
+ "scroll-area-scrollbar-horizontal": "h-0.625em flex-col border-t border-t-transparent p-0.0625em",
670
+ // components
671
+ "scroll-area-root": "relative overflow-hidden",
672
+ "scroll-area-scrollbar": "flex touch-none select-none transition-colors",
673
+ "scroll-area-viewport": "h-full w-full rounded-inherit",
674
+ "scroll-area-scrollbar-thumb": "relative flex-1",
675
+ "scroll-area-gray": "bg-border"
676
+ };
677
+ const dynamicScrollArea = [
678
+ // dynamic preset
679
+ [/^scroll-area(-(\S+))?$/, ([, , c], { theme }) => {
680
+ const parsedColor = presetMini.parseColor(c, theme);
681
+ if ((parsedColor?.cssColor?.type === "rgb" || parsedColor?.cssColor?.type === "rgba") && parsedColor.cssColor.components)
682
+ return `bg-${c}-200 dark:bg-${c}-700/58`;
683
+ return void 0;
684
+ }]
685
+ ];
686
+ const scrollArea = [
687
+ ...dynamicScrollArea,
688
+ staticScrollArea
689
+ ];
690
+
665
691
  const staticSelect = {
666
692
  // configurations
667
693
  "select": "",
@@ -697,8 +723,18 @@ const staticSelect = {
697
723
  "select-item-selectItem": ""
698
724
  };
699
725
  const dynamicSelect = [
700
- [/^select-([^-]+)-([^-]+)$/, ([, v = "solid", c = "gray"]) => `btn-${v}-${c}`],
701
- [/^select-item(-(\S+))?$/, ([, , c = "gray"]) => `focus:bg-${c}-100 focus:text-${c}-800 dark:focus:bg-${c}-800 dark:focus:text-${c}-100`]
726
+ [/^select-([^-]+)-([^-]+)$/, ([, v = "solid", c = "gray"], { theme }) => {
727
+ const parsedColor = presetMini.parseColor(c, theme);
728
+ if ((parsedColor?.cssColor?.type === "rgb" || parsedColor?.cssColor?.type === "rgba") && parsedColor.cssColor.components)
729
+ return `btn-${v}-${c}`;
730
+ return void 0;
731
+ }],
732
+ [/^select-item(-(\S+))?$/, ([, , c = "gray"], { theme }) => {
733
+ const parsedColor = presetMini.parseColor(c || "gray", theme);
734
+ if ((parsedColor?.cssColor?.type === "rgb" || parsedColor?.cssColor?.type === "rgba") && parsedColor.cssColor.components)
735
+ return `focus:bg-${c || "gray"}-100 focus:text-${c || "gray"}-800 dark:focus:bg-${c || "gray"}-800 dark:focus:text-${c || "gray"}-100`;
736
+ return void 0;
737
+ }]
702
738
  ];
703
739
  const select = [
704
740
  ...dynamicSelect,
@@ -847,10 +883,9 @@ const _switch = [
847
883
  const staticTable = {
848
884
  // config
849
885
  "table-default-variant": "table-solid-gray",
850
- "table": "",
851
886
  // table-root
852
- "table-root-wrapper": "relative w-full overflow-x-auto overflow-y-hidden border border-base rounded-md",
853
- "table-root": "w-full caption-bottom text-sm",
887
+ "table-root": "relative w-full overflow-x-auto overflow-y-hidden border border-base rounded-md",
888
+ "table": "w-full caption-bottom text-sm",
854
889
  "table-body": "[&_tr:last-child]:border-0",
855
890
  "table-caption": "mt-4 text-sm text-muted",
856
891
  // table-head
@@ -1006,7 +1041,8 @@ const shortcuts = [
1006
1041
  ...collapsible,
1007
1042
  ...radioGroup,
1008
1043
  ...form,
1009
- ...sheet
1044
+ ...sheet,
1045
+ ...scrollArea
1010
1046
  ];
1011
1047
 
1012
1048
  exports.shortcuts = shortcuts;
@@ -68,20 +68,20 @@ const alert = [
68
68
 
69
69
  const staticAvatar = {
70
70
  // base
71
- "avatar": "relative flex shrink-0 overflow-hidden leading-1.5em",
72
- "avatar-image": "aspect-square h-full w-full",
71
+ "avatar": "relative inline-flex items-center font-normal select-none shrink-0 overflow-hidden",
72
+ "avatar-image": "h-full w-full object-cover",
73
73
  "avatar-fallback": "flex h-full w-full items-center justify-center",
74
- "avatar-label": "",
74
+ "avatar-label": "uppercase",
75
75
  "avatar-icon": "text-1em",
76
76
  // variants
77
- "avatar-solid-white": "bg-base text-base ring-1 ring-base",
77
+ "avatar-solid-white": "bg-base text-base border border-base",
78
78
  "avatar-solid-black": "bg-inverted text-inverted"
79
79
  };
80
80
  const dynamicAvatar = [
81
81
  // variants
82
82
  [/^avatar-solid(-(\S+))?$/, ([, , c = "gray"]) => `bg-${c}-600 dark:bg-${c}-500 text-inverted`],
83
83
  [/^avatar-soft(-(\S+))?$/, ([, , c = "gray"]) => `bg-${c}-50 text-${c}-700 dark:text-${c}-400 dark:bg-${c}-900`],
84
- [/^avatar-outline(-(\S+))?$/, ([, , c = "gray"]) => `bg-transparent text-${c}-500 dark:text-${c}-400 ring-1 ring-${c}-500 dark:ring-${c}-400`]
84
+ [/^avatar-outline(-(\S+))?$/, ([, , c = "gray"]) => `bg-transparent text-${c}-500 dark:text-${c}-400 border border-${c}-500 dark:border-${c}-400`]
85
85
  ];
86
86
  const avatar = [
87
87
  ...dynamicAvatar,
@@ -215,7 +215,6 @@ const btn = [
215
215
  const staticCard = {
216
216
  // base
217
217
  "card": "rounded-xl shadow text-base",
218
- "card-default-variant": "card-outline-gray",
219
218
  // components
220
219
  "card-header": "flex flex-col gap-y-1.5 p-6",
221
220
  "card-title": "font-semibold leading-none tracking-tight",
@@ -423,6 +422,7 @@ const staticGeneral = {
423
422
  "bg-base": "bg-$c-background",
424
423
  "bg-inverted": "bg-$c-foreground",
425
424
  "bg-muted": "bg-$c-muted",
425
+ "bg-border": "bg-$c-border",
426
426
  "bg-accent": "bg-$c-accent",
427
427
  "bg-accent-foreground": "bg-$c-accent-foreground",
428
428
  "bg-popover": "bg-$c-popover",
@@ -479,7 +479,7 @@ const indicator = [
479
479
 
480
480
  const staticInput = {
481
481
  // config
482
- "input-default-variant": "input-outline",
482
+ "input-default-variant": "input-outline-primary",
483
483
  "input-loading-icon": "i-loading",
484
484
  "input-info-icon": "i-info",
485
485
  "input-error-icon": "i-error",
@@ -488,7 +488,7 @@ const staticInput = {
488
488
  "input-leading-padding": "pl-2.9em",
489
489
  "input-trailing-padding": "pr-2.9em",
490
490
  // base
491
- "input": "text-0.875em leading-6 px-0.8571428571428571em py-0.5em w-full input-disabled ring-base ring-inset placeholder:text-$c-gray-400 block outline-none rounded-md border-0 shadow-sm bg-transparent",
491
+ "input": "text-base text-0.875em leading-6 px-0.8571428571428571em py-0.5em w-full input-disabled ring-base ring-inset placeholder:text-muted block outline-none rounded-md border-0 shadow-sm bg-transparent",
492
492
  "input-input": "h-9",
493
493
  // role='input'
494
494
  "input-textarea": "",
@@ -501,8 +501,8 @@ const staticInput = {
501
501
  "input-loading": "animate-spin text-1.042em",
502
502
  // wrappers
503
503
  "input-wrapper": "relative flex items-center",
504
- "input-leading-wrapper": "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-0.75em text-$c-gray-400",
505
- "input-trailing-wrapper": "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-0.75em text-$c-gray-400",
504
+ "input-leading-wrapper": "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-0.75em text-muted",
505
+ "input-trailing-wrapper": "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-0.75em text-muted",
506
506
  // variants
507
507
  "input-outline-gray": "focus:ring-2 ring-1",
508
508
  "input-outline-black": "ring-1 focus:ring-$c-foreground"
@@ -510,7 +510,7 @@ const staticInput = {
510
510
  const dynamicInput = [
511
511
  // config
512
512
  [/^input-focus(-(\S+))?$/, ([, , c = "primary"]) => `focus:ring-2 focus:ring-${c}-500 dark:focus:ring-${c}-400`],
513
- [/^input-status(-(\S+))?$/, ([, , c = "info"]) => `text-${c}-700 dark:text-${c}-200 placeholder-${c}-400/70 dark:placeholder-${c}-300/70`],
513
+ [/^input-status(-(\S+))?$/, ([, , c = "info"]) => `text-${c}-700 dark:text-${c}-200 placeholder-${c}-500 dark:placeholder-${c}-400`],
514
514
  // variants
515
515
  [/^input-outline(-(\S+))?$/, ([, , c = "primary"]) => `ring-1 input-focus-${c}`],
516
516
  [/^input-solid(-(\S+))?$/, ([, , c = "primary"]) => ` ring-1 input-focus-${c} ring-${c}-500 dark:ring-${c}-400`]
@@ -660,6 +660,32 @@ const radioGroup = [
660
660
  staticRadioGroup
661
661
  ];
662
662
 
663
+ const staticScrollArea = {
664
+ // configurations
665
+ "scroll-area": "",
666
+ "scroll-area-scrollbar-vertical": "h-full w-0.625em border-l border-l-transparent p-0.0625em",
667
+ "scroll-area-scrollbar-horizontal": "h-0.625em flex-col border-t border-t-transparent p-0.0625em",
668
+ // components
669
+ "scroll-area-root": "relative overflow-hidden",
670
+ "scroll-area-scrollbar": "flex touch-none select-none transition-colors",
671
+ "scroll-area-viewport": "h-full w-full rounded-inherit",
672
+ "scroll-area-scrollbar-thumb": "relative flex-1",
673
+ "scroll-area-gray": "bg-border"
674
+ };
675
+ const dynamicScrollArea = [
676
+ // dynamic preset
677
+ [/^scroll-area(-(\S+))?$/, ([, , c], { theme }) => {
678
+ const parsedColor = parseColor$1(c, theme);
679
+ if ((parsedColor?.cssColor?.type === "rgb" || parsedColor?.cssColor?.type === "rgba") && parsedColor.cssColor.components)
680
+ return `bg-${c}-200 dark:bg-${c}-700/58`;
681
+ return void 0;
682
+ }]
683
+ ];
684
+ const scrollArea = [
685
+ ...dynamicScrollArea,
686
+ staticScrollArea
687
+ ];
688
+
663
689
  const staticSelect = {
664
690
  // configurations
665
691
  "select": "",
@@ -695,8 +721,18 @@ const staticSelect = {
695
721
  "select-item-selectItem": ""
696
722
  };
697
723
  const dynamicSelect = [
698
- [/^select-([^-]+)-([^-]+)$/, ([, v = "solid", c = "gray"]) => `btn-${v}-${c}`],
699
- [/^select-item(-(\S+))?$/, ([, , c = "gray"]) => `focus:bg-${c}-100 focus:text-${c}-800 dark:focus:bg-${c}-800 dark:focus:text-${c}-100`]
724
+ [/^select-([^-]+)-([^-]+)$/, ([, v = "solid", c = "gray"], { theme }) => {
725
+ const parsedColor = parseColor$1(c, theme);
726
+ if ((parsedColor?.cssColor?.type === "rgb" || parsedColor?.cssColor?.type === "rgba") && parsedColor.cssColor.components)
727
+ return `btn-${v}-${c}`;
728
+ return void 0;
729
+ }],
730
+ [/^select-item(-(\S+))?$/, ([, , c = "gray"], { theme }) => {
731
+ const parsedColor = parseColor$1(c || "gray", theme);
732
+ if ((parsedColor?.cssColor?.type === "rgb" || parsedColor?.cssColor?.type === "rgba") && parsedColor.cssColor.components)
733
+ return `focus:bg-${c || "gray"}-100 focus:text-${c || "gray"}-800 dark:focus:bg-${c || "gray"}-800 dark:focus:text-${c || "gray"}-100`;
734
+ return void 0;
735
+ }]
700
736
  ];
701
737
  const select = [
702
738
  ...dynamicSelect,
@@ -845,10 +881,9 @@ const _switch = [
845
881
  const staticTable = {
846
882
  // config
847
883
  "table-default-variant": "table-solid-gray",
848
- "table": "",
849
884
  // table-root
850
- "table-root-wrapper": "relative w-full overflow-x-auto overflow-y-hidden border border-base rounded-md",
851
- "table-root": "w-full caption-bottom text-sm",
885
+ "table-root": "relative w-full overflow-x-auto overflow-y-hidden border border-base rounded-md",
886
+ "table": "w-full caption-bottom text-sm",
852
887
  "table-body": "[&_tr:last-child]:border-0",
853
888
  "table-caption": "mt-4 text-sm text-muted",
854
889
  // table-head
@@ -1004,7 +1039,8 @@ const shortcuts = [
1004
1039
  ...collapsible,
1005
1040
  ...radioGroup,
1006
1041
  ...form,
1007
- ...sheet
1042
+ ...sheet,
1043
+ ...scrollArea
1008
1044
  ];
1009
1045
 
1010
1046
  export { shortcuts as s };
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./shared/preset.F4kNR6ES.cjs');
3
+ const index = require('./shared/preset.DPKZgAqu.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.CkLYnPnw.mjs';
1
+ export { s as shortcuts } from './shared/preset.rfZXnCIa.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.38.0-beta.1",
3
+ "version": "0.40.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": "^65.4.3",
53
- "@unocss/preset-mini": "^65.4.3",
54
- "unocss": "^65.4.3"
52
+ "@unocss/core": "^66.0.0",
53
+ "@unocss/preset-mini": "^66.0.0",
54
+ "unocss": "^66.0.0"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "unbuild",