@una-ui/preset 0.28.0-beta.1 → 0.30.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
@@ -17,10 +17,15 @@ function presetUna(options = {
17
17
  theme: unocss.mergeDeep(presetMini.theme, {
18
18
  container: {
19
19
  center: true,
20
- padding: "2rem"
20
+ padding: "2rem",
21
+ maxWidth: {
22
+ "2xl": "1400px"
23
+ }
21
24
  },
22
25
  colors: {
23
- brand: "rgba(var(--c-brand),%alpha)",
26
+ background: "rgba(var(--una-background) / <alpha-value>)",
27
+ foreground: "rgba(var(--una-foreground) / <alpha-value>)",
28
+ brand: "rgba(var(--una-brand) / <alpha-value>)",
24
29
  primary: {
25
30
  DEFAULT: "rgba(var(--una-primary) / <alpha-value>)",
26
31
  active: "rgba(var(--una-primary-active) / <alpha-value>)",
@@ -82,7 +87,7 @@ function presetUna(options = {
82
87
  const color = utils.parseColor(body, theme);
83
88
  if ((color?.cssColor?.type === "rgb" || color?.cssColor?.type === "rgba") && color.cssColor.components) {
84
89
  return {
85
- "--c-brand": `${color.cssColor.components.join(",")}`
90
+ "--una-brand": `${color.cssColor.components.join(",")}`
86
91
  };
87
92
  }
88
93
  }],
@@ -120,6 +125,9 @@ function presetUna(options = {
120
125
  border-radius: 0.25rem; /* 1 */
121
126
  outline-offset: 0.10rem; /* 1 */
122
127
  }
128
+ button, input, optgroup, select, textarea {
129
+ background-color: transparent; /* 1 */
130
+ }
123
131
  `
124
132
  }
125
133
  ]
package/dist/index.mjs CHANGED
@@ -15,10 +15,15 @@ function presetUna(options = {
15
15
  theme: mergeDeep(theme, {
16
16
  container: {
17
17
  center: true,
18
- padding: "2rem"
18
+ padding: "2rem",
19
+ maxWidth: {
20
+ "2xl": "1400px"
21
+ }
19
22
  },
20
23
  colors: {
21
- brand: "rgba(var(--c-brand),%alpha)",
24
+ background: "rgba(var(--una-background) / <alpha-value>)",
25
+ foreground: "rgba(var(--una-foreground) / <alpha-value>)",
26
+ brand: "rgba(var(--una-brand) / <alpha-value>)",
22
27
  primary: {
23
28
  DEFAULT: "rgba(var(--una-primary) / <alpha-value>)",
24
29
  active: "rgba(var(--una-primary-active) / <alpha-value>)",
@@ -80,7 +85,7 @@ function presetUna(options = {
80
85
  const color = parseColor(body, theme);
81
86
  if ((color?.cssColor?.type === "rgb" || color?.cssColor?.type === "rgba") && color.cssColor.components) {
82
87
  return {
83
- "--c-brand": `${color.cssColor.components.join(",")}`
88
+ "--una-brand": `${color.cssColor.components.join(",")}`
84
89
  };
85
90
  }
86
91
  }],
@@ -118,6 +123,9 @@ function presetUna(options = {
118
123
  border-radius: 0.25rem; /* 1 */
119
124
  outline-offset: 0.10rem; /* 1 */
120
125
  }
126
+ button, input, optgroup, select, textarea {
127
+ background-color: transparent; /* 1 */
128
+ }
121
129
  `
122
130
  }
123
131
  ]
package/dist/prefixes.cjs CHANGED
@@ -4,7 +4,9 @@ const prefixes = [
4
4
  "accordion",
5
5
  "alert",
6
6
  "avatar",
7
+ "avatar-fallback",
7
8
  "avatar-group",
9
+ "avatar-image",
8
10
  "badge",
9
11
  "breadcrumb",
10
12
  "breadcrumb-active",
@@ -72,6 +74,8 @@ const prefixes = [
72
74
  "popover-content",
73
75
  "progress",
74
76
  "radio",
77
+ "radio-group",
78
+ "radio-group-item",
75
79
  "resize",
76
80
  "rounded",
77
81
  "select",
package/dist/prefixes.mjs CHANGED
@@ -2,7 +2,9 @@ const prefixes = [
2
2
  "accordion",
3
3
  "alert",
4
4
  "avatar",
5
+ "avatar-fallback",
5
6
  "avatar-group",
7
+ "avatar-image",
6
8
  "badge",
7
9
  "breadcrumb",
8
10
  "breadcrumb-active",
@@ -70,6 +72,8 @@ const prefixes = [
70
72
  "popover-content",
71
73
  "progress",
72
74
  "radio",
75
+ "radio-group",
76
+ "radio-group-item",
73
77
  "resize",
74
78
  "rounded",
75
79
  "select",
@@ -65,16 +65,12 @@ const alert = [
65
65
  ];
66
66
 
67
67
  const staticAvatar = {
68
- // config
69
- "avatar-default-variant": "avatar-solid",
70
- "avatar-fallback-icon": "i-heroicons-user-20-solid",
71
68
  // base
72
- "avatar": "relative font-medium leading-none h-2.5em w-2.5em inline-flex items-center justify-center rounded-full overflow-hidden",
69
+ "avatar": "relative flex shrink-0 overflow-hidden leading-1.5em",
70
+ "avatar-image": "aspect-square h-full w-full",
71
+ "avatar-fallback": "flex h-full w-full items-center justify-center",
73
72
  "avatar-label": "",
74
- "avatar-fallback": "",
75
- "avatar-fallback-icon-base": "text-1.5em",
76
- "avatar-src": "w-full h-full",
77
- "avatar-icon-base": "text-1.2em",
73
+ "avatar-icon": "text-1em",
78
74
  // variants
79
75
  "avatar-solid-white": "bg-base text-base ring-1 ring-base",
80
76
  "avatar-solid-black": "bg-inverted text-inverted"
@@ -109,7 +105,7 @@ const staticBadge = {
109
105
  // base
110
106
  "badge": "text-xs leading-tight py-0.3333333333333333em px-0.6666666666666666em gap-x-0.25em inline-flex items-center rounded-md font-medium text-brand",
111
107
  "badge-icon-base": "text-1em",
112
- "badge-close": "relative rounded-sm h-1.16em w-1.16em grid place-items-center -mr-0.375em hover:bg-brand/20",
108
+ "badge-close": "relative rounded-sm h-1.16em w-1.16em grid place-items-center -mr-0.375em hover:bg-brand/20 bg-transparent",
113
109
  "badge-close-icon-base": "text-brand/75 group-hover:text-brand/90",
114
110
  // variants
115
111
  "badge-soft-gray": "bg-muted text-muted n-gray-900 dark:n-gray-50 ring-1 ring-gray-700/10 dark:ring-gray-400/30",
@@ -167,10 +163,10 @@ const staticBtn = {
167
163
  "btn": "btn-rectangle px-1em py-0.5em bg-transparent transition-colors text-0.875em leading-5 gap-x-0.5em rounded-md whitespace-nowrap inline-flex justify-center items-center btn-disabled font-medium cursor-pointer",
168
164
  "btn-disabled": "disabled:n-disabled",
169
165
  "btn-label": "",
170
- "btn-icon-label": "text-1.191em",
171
- "btn-leading": "-ml-0.14285714285714285em text-1.191em",
172
- "btn-trailing": "-mr-0.14285714285714285em text-1.191em",
173
- "btn-loading": "animate-spin text-1.191em",
166
+ "btn-icon-label": "text-1em",
167
+ "btn-leading": "-ml-0.14285714285714285em text-1em",
168
+ "btn-trailing": "-mr-0.14285714285714285em text-1em",
169
+ "btn-loading": "animate-spin text-1em",
174
170
  "btn-rectangle": "h-2.5em",
175
171
  "btn-square": "w-2.5em h-2.5em",
176
172
  // options
@@ -279,9 +275,9 @@ const staticDialog = {
279
275
  // base
280
276
  "dialog": "",
281
277
  // sub-components
282
- "dialog-overlay": "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
283
- "dialog-content": "fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border border-base bg-base p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-48% data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-48% sm:rounded-lg",
284
- "dialog-scroll-overlay": "fixed inset-0 z-50 grid place-items-center overflow-y-auto bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
278
+ "dialog-overlay": "fixed inset-0 z-50 bg-black/80",
279
+ "dialog-content": "fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border border-base bg-base p-6 shadow-lg duration-200 sm:rounded-lg",
280
+ "dialog-scroll-overlay": "fixed inset-0 z-50 grid place-items-center overflow-y-auto bg-black/80",
285
281
  "dialog-scroll-content": "relative z-50 grid w-full max-w-lg my-8 gap-4 border border-base bg-base p-6 shadow-lg duration-200 sm:rounded-lg md:w-full",
286
282
  "dialog-header": "flex flex-col gap-y-1.5 text-center sm:text-left",
287
283
  "dialog-title": "text-lg font-semibold leading-none tracking-tight",
@@ -306,11 +302,11 @@ const staticDropdownMenu = {
306
302
  "dropdown-menu-trigger-leading": "",
307
303
  "dropdown-menu-trigger-trailing": "ml-auto",
308
304
  // dropdown-menu-content
309
- "dropdown-menu-content": "z-50 min-w-32 overflow-hidden rounded-md border border-base bg-popover p-1 text-popover shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
305
+ "dropdown-menu-content": "z-50 min-w-32 overflow-hidden rounded-md border border-base bg-popover p-1 text-popover shadow-md",
310
306
  // dropdown-menu-item
311
307
  "dropdown-menu-item-base": "text-left transition-color focus-visible:outline-0",
312
- "dropdown-menu-item-leading": "opacity-75 text-1.1em",
313
- "dropdown-menu-item-trailing": "ml-auto opacity-75 text-1.1em",
308
+ "dropdown-menu-item-leading": "text-1em",
309
+ "dropdown-menu-item-trailing": "ml-auto opacity-75 text-1em",
314
310
  // dropdown-menu-label
315
311
  "dropdown-menu-label": "px-2 py-1.5 text-1em font-semibold",
316
312
  // dropdown-menu-separator
@@ -322,9 +318,10 @@ const staticDropdownMenu = {
322
318
  "dropdown-menu-group": "",
323
319
  // dropdown-menu-sub
324
320
  "dropdown-menu-sub-trigger": "transition-color focus-visible:outline-0",
325
- "dropdown-menu-sub-trigger-leading": "opacity-75 text-1.1em",
326
- "dropdown-menu-sub-trigger-trailing": "ml-auto opacity-75 text-1.1em",
327
- "dropdown-menu-sub-content": "z-50 min-w-32 overflow-hidden rounded-md border border-base bg-popover p-1 text-popover shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"
321
+ "dropdown-menu-sub-trigger-leading": "text-1em",
322
+ "dropdown-menu-sub-trigger-trailing": "ml-auto opacity-75 text-1em",
323
+ "dropdown-menu-sub-trigger-trailing-icon": "i-lucide-chevron-right",
324
+ "dropdown-menu-sub-content": "z-50 min-w-32 overflow-hidden rounded-md border border-base bg-popover p-1 text-popover shadow-lg"
328
325
  };
329
326
  const dynamicDropdownMenu = [
330
327
  [/^dropdown-menu-([^-]+)-([^-]+)$/, ([, v = "solid", c = "white"]) => `btn-${v}-${c}`],
@@ -361,6 +358,17 @@ const formGroup = [
361
358
  staticFormGroup
362
359
  ];
363
360
 
361
+ const staticIcons = {
362
+ "i-loading": "i-tabler-loader-2",
363
+ "i-warning": "i-tabler-alert-triangle-filled",
364
+ "i-error": "i-tabler-exclamation-circle-filled",
365
+ "i-success": "i-tabler-circle-check-filled",
366
+ "i-info": "i-tabler-info-circle-filled",
367
+ "i-close": "i-tabler-x",
368
+ "i-check": "i-tabler-check",
369
+ "i-dot": "i-tabler-circle-filled"
370
+ };
371
+
364
372
  const staticGeneral = {
365
373
  // text-size
366
374
  "text-md": "text-1rem leading-1.5rem",
@@ -379,9 +387,7 @@ const staticGeneral = {
379
387
  "text-warning": "text-warning-600 dark:text-warning-500",
380
388
  // ring
381
389
  "ring-base": "ring-$c-ring",
382
- "ring-inverted": "ring-$c-ring-foreground",
383
390
  "ring-offset-base": "ring-offset-$c-background",
384
- "ring-offset-inverted": "ring-offset-$c-bg-foreground",
385
391
  // border
386
392
  "border-base": "border-$c-border",
387
393
  "border-foreground": "border-$c-border-foreground",
@@ -395,15 +401,6 @@ const staticGeneral = {
395
401
  "bg-accent-foreground": "bg-$c-accent-foreground",
396
402
  "bg-popover": "bg-$c-popover",
397
403
  "bg-popover-foreground": "bg-$c-popover-foreground",
398
- // icon
399
- "i-loading": "i-tabler-loader-2",
400
- "i-warning": "i-heroicons-exclamation-triangle-20-solid",
401
- "i-error": "i-heroicons-exclamation-circle-20-solid",
402
- "i-success": "i-heroicons-check-circle-20-solid",
403
- "i-info": "i-heroicons-information-circle-20-solid",
404
- "i-close": "i-heroicons-x-mark-20-solid",
405
- "i-dot": "i-tabler-circle-filled",
406
- "i-check": "i-lucide-check",
407
404
  // transition
408
405
  "transition-base": "transition-all duration-100 ease-out",
409
406
  // overrides
@@ -421,7 +418,8 @@ const dynamicGeneral = [
421
418
  ];
422
419
  const general = [
423
420
  ...dynamicGeneral,
424
- staticGeneral
421
+ staticGeneral,
422
+ staticIcons
425
423
  ];
426
424
 
427
425
  const staticIcon = {
@@ -471,6 +469,10 @@ const staticInput = {
471
469
  "input-trailing-padding": "pr-2.9em",
472
470
  // base
473
471
  "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",
472
+ "input-input": "h-9",
473
+ // role='input'
474
+ "input-textarea": "",
475
+ // role='textarea'
474
476
  "input-disabled": "disabled:(n-disabled)",
475
477
  "input-status-ring": "ring-opacity-50 dark:ring-opacity-40",
476
478
  "input-status-icon-base": "text-1.042em",
@@ -674,6 +676,31 @@ const radio = [
674
676
  staticRadio
675
677
  ];
676
678
 
679
+ const staticRadioGroup = {
680
+ // configurations
681
+ "radio-group": "gap-2 flex flex-nowrap",
682
+ "radio-group-orientation-vertical": "flex-col",
683
+ "radio-group-orientation-horizontal": "flex-row",
684
+ // components
685
+ "radio-group-item-wrapper": "flex items-center space-x-2",
686
+ "radio-group-item": "aspect-square rounded-full border border-brand text-brand shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-base disabled:n-disabled",
687
+ "radio-group-indicator": "flex items-center justify-center",
688
+ "radio-group-indicator-icon-base": "h-0.875em w-0.875em fill-brand",
689
+ "radio-group-indicator-icon": "i-dot",
690
+ "radio-group-item-label": ""
691
+ };
692
+ const dynamicRadioGroup = [
693
+ [/^radio-group-(.*)$/, ([, body], { theme }) => {
694
+ const color = utils.parseColor(body, theme);
695
+ if ((color?.cssColor?.type === "rgb" || color?.cssColor?.type === "rgba") && color.cssColor.components)
696
+ return `n-${body}-600 dark:n-${body}-500`;
697
+ }]
698
+ ];
699
+ const radioGroup = [
700
+ ...dynamicRadioGroup,
701
+ staticRadioGroup
702
+ ];
703
+
677
704
  const staticSelect = {
678
705
  // configurations
679
706
  "select": "",
@@ -689,7 +716,7 @@ const staticSelect = {
689
716
  "select-trigger": "w-full",
690
717
  // [&>span]:line-clamp-1
691
718
  "select-trigger-trailing-icon": "i-lucide-chevrons-up-down !text-1.042em",
692
- "select-trigger-trailing": "ml-auto n-disabled",
719
+ "select-trigger-trailing": "ml-auto",
693
720
  "select-trigger-leading": "",
694
721
  "select-value": "h-1.5em",
695
722
  "select-content": "relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border border-base bg-popover text-popover shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
@@ -767,17 +794,17 @@ const skeleton = [
767
794
 
768
795
  const staticSlider = {
769
796
  // configurations
770
- "slider": "slider-primary",
771
797
  "slider-disabled": "n-disabled",
772
798
  "slider-root-vertical": "flex-col w-1em h-full",
773
799
  "slider-track-vertical": "w-0.5em h-full",
774
800
  "slider-range-vertical": "w-full",
775
801
  "slider-thumb-vertical": "w-1.25em h-1.25em",
776
802
  // components
777
- "slider-root": "slider relative flex w-full touch-none select-none items-center",
803
+ "slider-root": "relative flex w-full touch-none select-none items-center",
778
804
  "slider-track": "h-0.5em relative w-full grow overflow-hidden rounded-full bg-muted",
779
805
  "slider-range": "absolute h-full bg-brand",
780
- "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"
806
+ "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:slider-disabled focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
807
+ "slider-accent": "n-gray-300 dark:n-gray-800"
781
808
  };
782
809
  const dynamicSlider = [
783
810
  [/^slider-(.*)$/, ([, body], { theme }) => {
@@ -819,7 +846,7 @@ const dynamicSwitch = [
819
846
  ],
820
847
  [
821
848
  /^switch-unchecked(?:-([^-]+))?(?:-([^-]+))?$/,
822
- ([, color = "primary"], { theme }) => {
849
+ ([, color = "gray"], { theme }) => {
823
850
  const parsedColor = presetMini.parseColor(color, theme);
824
851
  if ((parsedColor?.cssColor?.type === "rgb" || parsedColor?.cssColor?.type === "rgba") && parsedColor.cssColor.components)
825
852
  return `data-[state=unchecked]:n-${color}-200 dark:data-[state=unchecked]:n-${color}-700/58`;
@@ -965,7 +992,8 @@ const shortcuts = [
965
992
  ...tooltip,
966
993
  ...pagination,
967
994
  ...toggle,
968
- ...collapsible
995
+ ...collapsible,
996
+ ...radioGroup
969
997
  ];
970
998
 
971
999
  exports.shortcuts = shortcuts;
@@ -63,16 +63,12 @@ const alert = [
63
63
  ];
64
64
 
65
65
  const staticAvatar = {
66
- // config
67
- "avatar-default-variant": "avatar-solid",
68
- "avatar-fallback-icon": "i-heroicons-user-20-solid",
69
66
  // base
70
- "avatar": "relative font-medium leading-none h-2.5em w-2.5em inline-flex items-center justify-center rounded-full overflow-hidden",
67
+ "avatar": "relative flex shrink-0 overflow-hidden leading-1.5em",
68
+ "avatar-image": "aspect-square h-full w-full",
69
+ "avatar-fallback": "flex h-full w-full items-center justify-center",
71
70
  "avatar-label": "",
72
- "avatar-fallback": "",
73
- "avatar-fallback-icon-base": "text-1.5em",
74
- "avatar-src": "w-full h-full",
75
- "avatar-icon-base": "text-1.2em",
71
+ "avatar-icon": "text-1em",
76
72
  // variants
77
73
  "avatar-solid-white": "bg-base text-base ring-1 ring-base",
78
74
  "avatar-solid-black": "bg-inverted text-inverted"
@@ -107,7 +103,7 @@ const staticBadge = {
107
103
  // base
108
104
  "badge": "text-xs leading-tight py-0.3333333333333333em px-0.6666666666666666em gap-x-0.25em inline-flex items-center rounded-md font-medium text-brand",
109
105
  "badge-icon-base": "text-1em",
110
- "badge-close": "relative rounded-sm h-1.16em w-1.16em grid place-items-center -mr-0.375em hover:bg-brand/20",
106
+ "badge-close": "relative rounded-sm h-1.16em w-1.16em grid place-items-center -mr-0.375em hover:bg-brand/20 bg-transparent",
111
107
  "badge-close-icon-base": "text-brand/75 group-hover:text-brand/90",
112
108
  // variants
113
109
  "badge-soft-gray": "bg-muted text-muted n-gray-900 dark:n-gray-50 ring-1 ring-gray-700/10 dark:ring-gray-400/30",
@@ -165,10 +161,10 @@ const staticBtn = {
165
161
  "btn": "btn-rectangle px-1em py-0.5em bg-transparent transition-colors text-0.875em leading-5 gap-x-0.5em rounded-md whitespace-nowrap inline-flex justify-center items-center btn-disabled font-medium cursor-pointer",
166
162
  "btn-disabled": "disabled:n-disabled",
167
163
  "btn-label": "",
168
- "btn-icon-label": "text-1.191em",
169
- "btn-leading": "-ml-0.14285714285714285em text-1.191em",
170
- "btn-trailing": "-mr-0.14285714285714285em text-1.191em",
171
- "btn-loading": "animate-spin text-1.191em",
164
+ "btn-icon-label": "text-1em",
165
+ "btn-leading": "-ml-0.14285714285714285em text-1em",
166
+ "btn-trailing": "-mr-0.14285714285714285em text-1em",
167
+ "btn-loading": "animate-spin text-1em",
172
168
  "btn-rectangle": "h-2.5em",
173
169
  "btn-square": "w-2.5em h-2.5em",
174
170
  // options
@@ -277,9 +273,9 @@ const staticDialog = {
277
273
  // base
278
274
  "dialog": "",
279
275
  // sub-components
280
- "dialog-overlay": "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
281
- "dialog-content": "fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border border-base bg-base p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-48% data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-48% sm:rounded-lg",
282
- "dialog-scroll-overlay": "fixed inset-0 z-50 grid place-items-center overflow-y-auto bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
276
+ "dialog-overlay": "fixed inset-0 z-50 bg-black/80",
277
+ "dialog-content": "fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border border-base bg-base p-6 shadow-lg duration-200 sm:rounded-lg",
278
+ "dialog-scroll-overlay": "fixed inset-0 z-50 grid place-items-center overflow-y-auto bg-black/80",
283
279
  "dialog-scroll-content": "relative z-50 grid w-full max-w-lg my-8 gap-4 border border-base bg-base p-6 shadow-lg duration-200 sm:rounded-lg md:w-full",
284
280
  "dialog-header": "flex flex-col gap-y-1.5 text-center sm:text-left",
285
281
  "dialog-title": "text-lg font-semibold leading-none tracking-tight",
@@ -304,11 +300,11 @@ const staticDropdownMenu = {
304
300
  "dropdown-menu-trigger-leading": "",
305
301
  "dropdown-menu-trigger-trailing": "ml-auto",
306
302
  // dropdown-menu-content
307
- "dropdown-menu-content": "z-50 min-w-32 overflow-hidden rounded-md border border-base bg-popover p-1 text-popover shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
303
+ "dropdown-menu-content": "z-50 min-w-32 overflow-hidden rounded-md border border-base bg-popover p-1 text-popover shadow-md",
308
304
  // dropdown-menu-item
309
305
  "dropdown-menu-item-base": "text-left transition-color focus-visible:outline-0",
310
- "dropdown-menu-item-leading": "opacity-75 text-1.1em",
311
- "dropdown-menu-item-trailing": "ml-auto opacity-75 text-1.1em",
306
+ "dropdown-menu-item-leading": "text-1em",
307
+ "dropdown-menu-item-trailing": "ml-auto opacity-75 text-1em",
312
308
  // dropdown-menu-label
313
309
  "dropdown-menu-label": "px-2 py-1.5 text-1em font-semibold",
314
310
  // dropdown-menu-separator
@@ -320,9 +316,10 @@ const staticDropdownMenu = {
320
316
  "dropdown-menu-group": "",
321
317
  // dropdown-menu-sub
322
318
  "dropdown-menu-sub-trigger": "transition-color focus-visible:outline-0",
323
- "dropdown-menu-sub-trigger-leading": "opacity-75 text-1.1em",
324
- "dropdown-menu-sub-trigger-trailing": "ml-auto opacity-75 text-1.1em",
325
- "dropdown-menu-sub-content": "z-50 min-w-32 overflow-hidden rounded-md border border-base bg-popover p-1 text-popover shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"
319
+ "dropdown-menu-sub-trigger-leading": "text-1em",
320
+ "dropdown-menu-sub-trigger-trailing": "ml-auto opacity-75 text-1em",
321
+ "dropdown-menu-sub-trigger-trailing-icon": "i-lucide-chevron-right",
322
+ "dropdown-menu-sub-content": "z-50 min-w-32 overflow-hidden rounded-md border border-base bg-popover p-1 text-popover shadow-lg"
326
323
  };
327
324
  const dynamicDropdownMenu = [
328
325
  [/^dropdown-menu-([^-]+)-([^-]+)$/, ([, v = "solid", c = "white"]) => `btn-${v}-${c}`],
@@ -359,6 +356,17 @@ const formGroup = [
359
356
  staticFormGroup
360
357
  ];
361
358
 
359
+ const staticIcons = {
360
+ "i-loading": "i-tabler-loader-2",
361
+ "i-warning": "i-tabler-alert-triangle-filled",
362
+ "i-error": "i-tabler-exclamation-circle-filled",
363
+ "i-success": "i-tabler-circle-check-filled",
364
+ "i-info": "i-tabler-info-circle-filled",
365
+ "i-close": "i-tabler-x",
366
+ "i-check": "i-tabler-check",
367
+ "i-dot": "i-tabler-circle-filled"
368
+ };
369
+
362
370
  const staticGeneral = {
363
371
  // text-size
364
372
  "text-md": "text-1rem leading-1.5rem",
@@ -377,9 +385,7 @@ const staticGeneral = {
377
385
  "text-warning": "text-warning-600 dark:text-warning-500",
378
386
  // ring
379
387
  "ring-base": "ring-$c-ring",
380
- "ring-inverted": "ring-$c-ring-foreground",
381
388
  "ring-offset-base": "ring-offset-$c-background",
382
- "ring-offset-inverted": "ring-offset-$c-bg-foreground",
383
389
  // border
384
390
  "border-base": "border-$c-border",
385
391
  "border-foreground": "border-$c-border-foreground",
@@ -393,15 +399,6 @@ const staticGeneral = {
393
399
  "bg-accent-foreground": "bg-$c-accent-foreground",
394
400
  "bg-popover": "bg-$c-popover",
395
401
  "bg-popover-foreground": "bg-$c-popover-foreground",
396
- // icon
397
- "i-loading": "i-tabler-loader-2",
398
- "i-warning": "i-heroicons-exclamation-triangle-20-solid",
399
- "i-error": "i-heroicons-exclamation-circle-20-solid",
400
- "i-success": "i-heroicons-check-circle-20-solid",
401
- "i-info": "i-heroicons-information-circle-20-solid",
402
- "i-close": "i-heroicons-x-mark-20-solid",
403
- "i-dot": "i-tabler-circle-filled",
404
- "i-check": "i-lucide-check",
405
402
  // transition
406
403
  "transition-base": "transition-all duration-100 ease-out",
407
404
  // overrides
@@ -419,7 +416,8 @@ const dynamicGeneral = [
419
416
  ];
420
417
  const general = [
421
418
  ...dynamicGeneral,
422
- staticGeneral
419
+ staticGeneral,
420
+ staticIcons
423
421
  ];
424
422
 
425
423
  const staticIcon = {
@@ -469,6 +467,10 @@ const staticInput = {
469
467
  "input-trailing-padding": "pr-2.9em",
470
468
  // base
471
469
  "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",
470
+ "input-input": "h-9",
471
+ // role='input'
472
+ "input-textarea": "",
473
+ // role='textarea'
472
474
  "input-disabled": "disabled:(n-disabled)",
473
475
  "input-status-ring": "ring-opacity-50 dark:ring-opacity-40",
474
476
  "input-status-icon-base": "text-1.042em",
@@ -672,6 +674,31 @@ const radio = [
672
674
  staticRadio
673
675
  ];
674
676
 
677
+ const staticRadioGroup = {
678
+ // configurations
679
+ "radio-group": "gap-2 flex flex-nowrap",
680
+ "radio-group-orientation-vertical": "flex-col",
681
+ "radio-group-orientation-horizontal": "flex-row",
682
+ // components
683
+ "radio-group-item-wrapper": "flex items-center space-x-2",
684
+ "radio-group-item": "aspect-square rounded-full border border-brand text-brand shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-base disabled:n-disabled",
685
+ "radio-group-indicator": "flex items-center justify-center",
686
+ "radio-group-indicator-icon-base": "h-0.875em w-0.875em fill-brand",
687
+ "radio-group-indicator-icon": "i-dot",
688
+ "radio-group-item-label": ""
689
+ };
690
+ const dynamicRadioGroup = [
691
+ [/^radio-group-(.*)$/, ([, body], { theme }) => {
692
+ const color = parseColor(body, theme);
693
+ if ((color?.cssColor?.type === "rgb" || color?.cssColor?.type === "rgba") && color.cssColor.components)
694
+ return `n-${body}-600 dark:n-${body}-500`;
695
+ }]
696
+ ];
697
+ const radioGroup = [
698
+ ...dynamicRadioGroup,
699
+ staticRadioGroup
700
+ ];
701
+
675
702
  const staticSelect = {
676
703
  // configurations
677
704
  "select": "",
@@ -687,7 +714,7 @@ const staticSelect = {
687
714
  "select-trigger": "w-full",
688
715
  // [&>span]:line-clamp-1
689
716
  "select-trigger-trailing-icon": "i-lucide-chevrons-up-down !text-1.042em",
690
- "select-trigger-trailing": "ml-auto n-disabled",
717
+ "select-trigger-trailing": "ml-auto",
691
718
  "select-trigger-leading": "",
692
719
  "select-value": "h-1.5em",
693
720
  "select-content": "relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border border-base bg-popover text-popover shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
@@ -765,17 +792,17 @@ const skeleton = [
765
792
 
766
793
  const staticSlider = {
767
794
  // configurations
768
- "slider": "slider-primary",
769
795
  "slider-disabled": "n-disabled",
770
796
  "slider-root-vertical": "flex-col w-1em h-full",
771
797
  "slider-track-vertical": "w-0.5em h-full",
772
798
  "slider-range-vertical": "w-full",
773
799
  "slider-thumb-vertical": "w-1.25em h-1.25em",
774
800
  // components
775
- "slider-root": "slider relative flex w-full touch-none select-none items-center",
801
+ "slider-root": "relative flex w-full touch-none select-none items-center",
776
802
  "slider-track": "h-0.5em relative w-full grow overflow-hidden rounded-full bg-muted",
777
803
  "slider-range": "absolute h-full bg-brand",
778
- "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"
804
+ "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:slider-disabled focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
805
+ "slider-accent": "n-gray-300 dark:n-gray-800"
779
806
  };
780
807
  const dynamicSlider = [
781
808
  [/^slider-(.*)$/, ([, body], { theme }) => {
@@ -817,7 +844,7 @@ const dynamicSwitch = [
817
844
  ],
818
845
  [
819
846
  /^switch-unchecked(?:-([^-]+))?(?:-([^-]+))?$/,
820
- ([, color = "primary"], { theme }) => {
847
+ ([, color = "gray"], { theme }) => {
821
848
  const parsedColor = parseColor$1(color, theme);
822
849
  if ((parsedColor?.cssColor?.type === "rgb" || parsedColor?.cssColor?.type === "rgba") && parsedColor.cssColor.components)
823
850
  return `data-[state=unchecked]:n-${color}-200 dark:data-[state=unchecked]:n-${color}-700/58`;
@@ -963,7 +990,8 @@ const shortcuts = [
963
990
  ...tooltip,
964
991
  ...pagination,
965
992
  ...toggle,
966
- ...collapsible
993
+ ...collapsible,
994
+ ...radioGroup
967
995
  ];
968
996
 
969
997
  export { shortcuts };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@una-ui/preset",
3
- "version": "0.28.0-beta.1",
3
+ "version": "0.30.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.63.4",
53
- "@unocss/preset-mini": "^0.63.4",
54
- "unocss": "^0.63.4"
52
+ "@unocss/core": "^0.64.1",
53
+ "@unocss/preset-mini": "^0.64.1",
54
+ "unocss": "^0.64.1"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "unbuild",
package/una.css CHANGED
@@ -59,18 +59,20 @@
59
59
  :root {
60
60
  --una-font-size: 16px;
61
61
  --una-radius: 0.5rem;
62
- --c-brand: rgb(var(--una-primary-600));
62
+ --una-brand: var(--una-primary-600);
63
63
  --una-primary: var(--una-primary-600);
64
64
  --una-primary-active: var(--una-primary-500);
65
65
  --una-gray: var(--una-gray-600);
66
66
  --una-gray-active: var(--una-gray-500);
67
- --c-background: rgb(255 255 255);
68
- --c-foreground: rgb(var(--una-gray-950));
67
+ --una-background: 255, 255, 255;
68
+ --una-foreground: var(--una-gray-950);
69
+ --c-background: rgb(var(--una-background));
70
+ --c-foreground: rgb(var(--una-foreground));
69
71
  --c-muted: rgb(var(--una-gray-50));
70
72
  --c-muted-foreground: rgb(var(--una-gray-500));
71
73
  --c-accent: rgb(var(--una-gray-100));
72
74
  --c-accent-foreground: rgb(var(--una-gray-800));
73
- --c-popover: rgb(255 255 255);
75
+ --c-popover: rgb(255, 255, 255);
74
76
  --c-popover-foreground: rgb(var(--una-gray-950));
75
77
  --c-border: rgb(var(--una-gray-200));
76
78
  --c-border-foreground: rgba(var(--una-gray-700), .58);
@@ -81,19 +83,21 @@
81
83
  }
82
84
 
83
85
  .dark {
84
- --c-brand: rgb(var(--una-primary-500));
86
+ --una-brand: var(--una-primary-500);
85
87
  --una-primary: var(--una-primary-500);
86
88
  --una-primary-active: var(--una-primary-400);
87
89
  --una-gray: var(--una-gray-500);
88
90
  --una-gray-active: var(--una-gray-400);
89
- --c-background: rgb(var(--una-gray-950));
90
- --c-foreground: rgb(255 255 255);
91
+ --una-background: var(--una-gray-950);
92
+ --una-foreground: 255, 255, 255;
93
+ --c-background: rgb(var(--una-background));
94
+ --c-foreground: rgb(var(--una-foreground));
91
95
  --c-muted: rgb(var(--una-gray-900));
92
96
  --c-muted-foreground: rgb(var(--una-gray-400));
93
97
  --c-accent: rgb(var(--una-gray-800));
94
98
  --c-accent-foreground: rgb(var(--una-gray-100));
95
99
  --c-popover: rgb(var(--una-gray-950));
96
- --c-popover-foreground: rgb(255 255 255);
100
+ --c-popover-foreground: rgb(255,255,255);
97
101
  --c-border: rgba(var(--una-gray-700), .58);
98
102
  --c-border-foreground: rgb(var(--una-gray-200));
99
103
  --c-ring: rgba(var(--una-gray-700), .58);