@una-ui/preset 0.30.0-beta.1 → 0.32.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/README.md CHANGED
@@ -5,10 +5,10 @@
5
5
 
6
6
  ## 🏗ïļ Release Status
7
7
 
8
- | Branch | Version | Status | Downloads |
9
- | --- | --- | --- | --- |
10
- | Main (Edge) | [![npm-edge][npm-edge-src]][npm-edge-href] | [![github-status][github-status-src-main]][github-status-href-main] | [![npm-edge-downloads][npm-edge-downloads-src]][npm-edge-downloads-href] |
11
- | Release | [![npm-version][npm-version-src]][npm-version-href] | [![github-status][github-status-src-release]][github-status-href-release] | [![npm-downloads][npm-downloads-src]][npm-downloads-href] |
8
+ | Branch | Version | Status | Downloads |
9
+ | ----------- | --------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
10
+ | Main (Edge) | [![npm-edge][npm-edge-src]][npm-edge-href] | [![github-status][github-status-src-main]][github-status-href-main] | [![npm-edge-downloads][npm-edge-downloads-src]][npm-edge-downloads-href] |
11
+ | Release | [![npm-version][npm-version-src]][npm-version-href] | [![github-status][github-status-src-release]][github-status-href-release] | [![npm-downloads][npm-downloads-src]][npm-downloads-href] |
12
12
 
13
13
  ## 📙 Documentation
14
14
 
@@ -32,7 +32,7 @@ Visit https://www.unaui.com for full documentation.
32
32
 
33
33
  ## ðŸŠī Project Activity
34
34
 
35
- ![Alt](https://repobeats.axiom.co/api/embed/49dee6a65be83113d1241c7bd38f23e211a0f189.svg "Repobeats analytics image")
35
+ ![Alt](https://repobeats.axiom.co/api/embed/49dee6a65be83113d1241c7bd38f23e211a0f189.svg 'Repobeats analytics image')
36
36
 
37
37
  ## ðŸ‘Ļ‍ðŸ’ŧ Contributors
38
38
 
package/dist/prefixes.cjs CHANGED
@@ -51,7 +51,13 @@ const prefixes = [
51
51
  "dropdown-menu-sub-content",
52
52
  "dropdown-menu-sub-trigger",
53
53
  "dropdown-menu-trigger",
54
+ "form-control",
55
+ "form-description",
56
+ "form-field",
54
57
  "form-group",
58
+ "form-item",
59
+ "form-label",
60
+ "form-message",
55
61
  "icon",
56
62
  "indicator",
57
63
  "input",
@@ -116,6 +122,15 @@ const prefixes = [
116
122
  "tabs-root",
117
123
  "tabs-trigger",
118
124
  "theme-switcher",
125
+ "toast",
126
+ "toast-action",
127
+ "toast-close",
128
+ "toast-description",
129
+ "toaster",
130
+ "toast-info",
131
+ "toast-provider",
132
+ "toast-title",
133
+ "toast-viewport",
119
134
  "toggle",
120
135
  "toggle-off",
121
136
  "toggle-on",
package/dist/prefixes.mjs CHANGED
@@ -49,7 +49,13 @@ const prefixes = [
49
49
  "dropdown-menu-sub-content",
50
50
  "dropdown-menu-sub-trigger",
51
51
  "dropdown-menu-trigger",
52
+ "form-control",
53
+ "form-description",
54
+ "form-field",
52
55
  "form-group",
56
+ "form-item",
57
+ "form-label",
58
+ "form-message",
53
59
  "icon",
54
60
  "indicator",
55
61
  "input",
@@ -114,6 +120,15 @@ const prefixes = [
114
120
  "tabs-root",
115
121
  "tabs-trigger",
116
122
  "theme-switcher",
123
+ "toast",
124
+ "toast-action",
125
+ "toast-close",
126
+ "toast-description",
127
+ "toaster",
128
+ "toast-info",
129
+ "toast-provider",
130
+ "toast-title",
131
+ "toast-viewport",
117
132
  "toggle",
118
133
  "toggle-off",
119
134
  "toggle-on",
@@ -5,7 +5,7 @@ const presetMini = require('@unocss/preset-mini');
5
5
 
6
6
  const staticAccordion = {
7
7
  // config
8
- "accordion-trailing-icon": "i-heroicons-chevron-up",
8
+ "accordion-trailing-icon": "i-lucide-chevron-up",
9
9
  "accordion-button-padding": "p-(x-3 y-4)",
10
10
  "accordion-button-default-variant": "btn-text",
11
11
  "accordion-divider": "divide-(y base)",
@@ -51,10 +51,14 @@ const staticAlert = {
51
51
  "alert-content-wrapper": "flex flex-col w-full space-y-0.5em",
52
52
  "alert-icon-wrapper": "-mt-0.2em",
53
53
  "alert-close-wrapper": "ml-auto pl-0.2em",
54
- "alert-close-inner-wrapper": "-mx-1.1 -my-1.1"
54
+ "alert-close-inner-wrapper": "-mx-1.1 -my-1.1",
55
+ // static variants
56
+ "alert-solid-white": "rounded-md text-brand bg-base n-gray-950 dark:n-white border",
57
+ "alert-solid-black": "rounded-md text-brand bg-inverted n-white dark:n-gray-950 border border-foreground"
55
58
  };
56
59
  const dynamicAlert = [
57
60
  // variants
61
+ [/^alert-solid(-(\S+))?$/, ([, , c = "primary"]) => `rounded-md text-white bg-${c}-500 dark:bg-${c}-800 n-white dark:n-${c}-400`],
58
62
  [/^alert-soft(-(\S+))?$/, ([, , c = "primary"]) => `rounded-md bg-${c}-50 text-${c}-400 dark:text-${c}-300 dark:bg-${c}-950 n-${c}-800 dark:n-${c}-100`],
59
63
  [/^alert-outline(-(\S+))?$/, ([, , c = "primary"]) => `rounded-md border border-${c}-600 dark:border-${c}-500 text-brand n-${c}-600 dark:n-${c}-500`],
60
64
  [/^alert-border(-(\S+))?$/, ([, , c = "primary"]) => `border-l-4 border-${c}-400 dark:border-${c}-500 bg-${c}-50 dark:bg-${c}-950 text-${c}-400 dark:text-${c}-300 n-${c}-800 dark:n-${c}-100`]
@@ -332,27 +336,52 @@ const dropdowMenu = [
332
336
  staticDropdownMenu
333
337
  ];
334
338
 
339
+ const staticForm = {
340
+ // base
341
+ "form": "",
342
+ "form-field": "",
343
+ "form-field-description": "text-muted",
344
+ "form-field-hint": "text-sm leading-none text-muted",
345
+ "form-field-message": "",
346
+ // wrappers
347
+ "form-field-top-wrapper": "flex flex-col space-y-1.5 pb-0.5",
348
+ "form-field-top-wrapper-inner": "flex justify-between items-end space-x-1.5",
349
+ "form-field-bottom-wrapper": "flex space-x-1.5 justify-between items-start",
350
+ "form-field-message-wrapper": "",
351
+ // label
352
+ "form-field-label-wrapper": "flex",
353
+ "form-field-label": "block",
354
+ "form-field-label-required": "after:content-['*'] after:ms-0.5 after:text-error",
355
+ "form-message": "text-0.8rem font-medium transition-all duration-1000 ease-in-out text-error",
356
+ "form-label": "",
357
+ "form-description": "text-sm text-muted",
358
+ "form-item": "space-y-2"
359
+ };
360
+ const form = [
361
+ staticForm
362
+ ];
363
+
335
364
  const staticFormGroup = {
336
365
  // base
337
- "form-group": "space-y-2 flex flex-col",
338
- "form-group-description": "text-sm leading-6 text-$c-gray-500",
339
- "form-group-hint": "text-sm leading-6 text-$c-gray-500",
340
- "form-group-message": "text-sm transition-all duration-1000 ease-in-out",
366
+ "form-group": "space-y-2",
367
+ "form-group-description": "text-0.8rem text-muted",
368
+ "form-group-hint": "text-sm leading-none text-muted",
369
+ "form-group-message": "text-0.8em transition-all duration-1000 ease-in-out",
341
370
  // wrappers
342
- "form-group-top-wrapper": "flex flex-col",
371
+ "form-group-top-wrapper": "flex flex-col space-y-1.5",
343
372
  "form-group-top-wrapper-inner": "flex justify-between items-end space-x-1.5",
344
373
  "form-group-bottom-wrapper": "flex space-x-1.5 justify-between items-start",
345
374
  "form-group-message-wrapper": "",
346
375
  // label
347
376
  "form-group-label-wrapper": "flex",
348
- "form-group-label": "block text-sm leading-6 font-medium text-$c-gray-900",
377
+ "form-group-label": "block label-base",
349
378
  "form-group-label-required": "after:content-['*'] after:ms-0.5 after:text-error",
350
379
  // counter
351
- "form-group-counter-wrapper": "text-sm",
380
+ "form-group-counter-wrapper": "text-0.8em",
352
381
  "form-group-counter-error": "text-error",
353
- "form-group-counter-current": "text-$c-gray-900",
354
- "form-group-counter-separator": "text-$c-gray-500",
355
- "form-group-counter-max": "text-$c-gray-500"
382
+ "form-group-counter-current": "text-accent",
383
+ "form-group-counter-separator": "text-muted",
384
+ "form-group-counter-max": "text-muted"
356
385
  };
357
386
  const formGroup = [
358
387
  staticFormGroup
@@ -635,7 +664,10 @@ const staticProgress = {
635
664
  "progress-indeterminate": "absolute bg-brand h-full",
636
665
  // components
637
666
  "progress-root": "relative h-0.5em w-full overflow-hidden rounded-full bg-brand/20",
638
- "progress-indicator": "h-full w-full flex-1 bg-brand transition-all"
667
+ "progress-indicator": "h-full w-full flex-1 bg-brand transition-all",
668
+ // static
669
+ "progress-white": "bg-inverted",
670
+ "progress-black": "bg-base"
639
671
  };
640
672
  const dynamicProgress = [
641
673
  [/^progress-(.*)$/, ([, body], { theme }) => {
@@ -678,7 +710,7 @@ const radio = [
678
710
 
679
711
  const staticRadioGroup = {
680
712
  // configurations
681
- "radio-group": "gap-2 flex flex-nowrap",
713
+ "radio-group": "gap-2 flex flex-wrap",
682
714
  "radio-group-orientation-vertical": "flex-col",
683
715
  "radio-group-orientation-horizontal": "flex-row",
684
716
  // components
@@ -921,6 +953,33 @@ const tabs = [
921
953
  staticTabs
922
954
  ];
923
955
 
956
+ const staticToast = {
957
+ // config
958
+ "toast": "pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all ",
959
+ "toast-viewport": "fixed top-0 z-100 flex max-h-screen gap-y-4 w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-420px",
960
+ "toast-wrapper": "w-0 flex flex-1 flex-col gap-2",
961
+ "toast-title": "text-sm font-semibold [&+div]:text-xs",
962
+ "toast-description": "text-sm opacity-90",
963
+ "toast-leading": "square-5",
964
+ "toast-close": "bg-transparent flex items-center justify-center absolute right-1 top-1 rounded-md p-1 text-brand/80 opacity-0 transition-opacity hover:text-brand focus:opacity-100 focus:ring-1 focus:ring-brand/80 focus:outline-none group-hover:opacity-100",
965
+ "toast-close-icon": "i-close",
966
+ "toast-close-icon-base": "h-1em w-1em",
967
+ "toast-info": "grid gap-1",
968
+ "toast-actions": "flex shrink-0 gap-1.5",
969
+ "toast-progress": "h-1 rounded-none"
970
+ };
971
+ const dynamicToast = [
972
+ // dynamic variants
973
+ [/^toast-solid(-(\S+))?$/, ([, , c = "primary"]) => `alert-solid-${c}`],
974
+ [/^toast-soft(-(\S+))?$/, ([, , c = "primary"]) => `alert-soft-${c}`],
975
+ [/^toast-outline(-(\S+))?$/, ([, , c = "primary"]) => `alert-outline-${c}`],
976
+ [/^toast-border(-(\S+))?$/, ([, , c = "primary"]) => `alert-border-${c}`]
977
+ ];
978
+ const toast = [
979
+ ...dynamicToast,
980
+ staticToast
981
+ ];
982
+
924
983
  const staticToggle = {
925
984
  // configurations
926
985
  toggle: ""
@@ -991,9 +1050,11 @@ const shortcuts = [
991
1050
  ...popover,
992
1051
  ...tooltip,
993
1052
  ...pagination,
1053
+ ...toast,
994
1054
  ...toggle,
995
1055
  ...collapsible,
996
- ...radioGroup
1056
+ ...radioGroup,
1057
+ ...form
997
1058
  ];
998
1059
 
999
1060
  exports.shortcuts = shortcuts;
@@ -3,7 +3,7 @@ import { parseColor as parseColor$1 } from '@unocss/preset-mini';
3
3
 
4
4
  const staticAccordion = {
5
5
  // config
6
- "accordion-trailing-icon": "i-heroicons-chevron-up",
6
+ "accordion-trailing-icon": "i-lucide-chevron-up",
7
7
  "accordion-button-padding": "p-(x-3 y-4)",
8
8
  "accordion-button-default-variant": "btn-text",
9
9
  "accordion-divider": "divide-(y base)",
@@ -49,10 +49,14 @@ const staticAlert = {
49
49
  "alert-content-wrapper": "flex flex-col w-full space-y-0.5em",
50
50
  "alert-icon-wrapper": "-mt-0.2em",
51
51
  "alert-close-wrapper": "ml-auto pl-0.2em",
52
- "alert-close-inner-wrapper": "-mx-1.1 -my-1.1"
52
+ "alert-close-inner-wrapper": "-mx-1.1 -my-1.1",
53
+ // static variants
54
+ "alert-solid-white": "rounded-md text-brand bg-base n-gray-950 dark:n-white border",
55
+ "alert-solid-black": "rounded-md text-brand bg-inverted n-white dark:n-gray-950 border border-foreground"
53
56
  };
54
57
  const dynamicAlert = [
55
58
  // variants
59
+ [/^alert-solid(-(\S+))?$/, ([, , c = "primary"]) => `rounded-md text-white bg-${c}-500 dark:bg-${c}-800 n-white dark:n-${c}-400`],
56
60
  [/^alert-soft(-(\S+))?$/, ([, , c = "primary"]) => `rounded-md bg-${c}-50 text-${c}-400 dark:text-${c}-300 dark:bg-${c}-950 n-${c}-800 dark:n-${c}-100`],
57
61
  [/^alert-outline(-(\S+))?$/, ([, , c = "primary"]) => `rounded-md border border-${c}-600 dark:border-${c}-500 text-brand n-${c}-600 dark:n-${c}-500`],
58
62
  [/^alert-border(-(\S+))?$/, ([, , c = "primary"]) => `border-l-4 border-${c}-400 dark:border-${c}-500 bg-${c}-50 dark:bg-${c}-950 text-${c}-400 dark:text-${c}-300 n-${c}-800 dark:n-${c}-100`]
@@ -330,27 +334,52 @@ const dropdowMenu = [
330
334
  staticDropdownMenu
331
335
  ];
332
336
 
337
+ const staticForm = {
338
+ // base
339
+ "form": "",
340
+ "form-field": "",
341
+ "form-field-description": "text-muted",
342
+ "form-field-hint": "text-sm leading-none text-muted",
343
+ "form-field-message": "",
344
+ // wrappers
345
+ "form-field-top-wrapper": "flex flex-col space-y-1.5 pb-0.5",
346
+ "form-field-top-wrapper-inner": "flex justify-between items-end space-x-1.5",
347
+ "form-field-bottom-wrapper": "flex space-x-1.5 justify-between items-start",
348
+ "form-field-message-wrapper": "",
349
+ // label
350
+ "form-field-label-wrapper": "flex",
351
+ "form-field-label": "block",
352
+ "form-field-label-required": "after:content-['*'] after:ms-0.5 after:text-error",
353
+ "form-message": "text-0.8rem font-medium transition-all duration-1000 ease-in-out text-error",
354
+ "form-label": "",
355
+ "form-description": "text-sm text-muted",
356
+ "form-item": "space-y-2"
357
+ };
358
+ const form = [
359
+ staticForm
360
+ ];
361
+
333
362
  const staticFormGroup = {
334
363
  // base
335
- "form-group": "space-y-2 flex flex-col",
336
- "form-group-description": "text-sm leading-6 text-$c-gray-500",
337
- "form-group-hint": "text-sm leading-6 text-$c-gray-500",
338
- "form-group-message": "text-sm transition-all duration-1000 ease-in-out",
364
+ "form-group": "space-y-2",
365
+ "form-group-description": "text-0.8rem text-muted",
366
+ "form-group-hint": "text-sm leading-none text-muted",
367
+ "form-group-message": "text-0.8em transition-all duration-1000 ease-in-out",
339
368
  // wrappers
340
- "form-group-top-wrapper": "flex flex-col",
369
+ "form-group-top-wrapper": "flex flex-col space-y-1.5",
341
370
  "form-group-top-wrapper-inner": "flex justify-between items-end space-x-1.5",
342
371
  "form-group-bottom-wrapper": "flex space-x-1.5 justify-between items-start",
343
372
  "form-group-message-wrapper": "",
344
373
  // label
345
374
  "form-group-label-wrapper": "flex",
346
- "form-group-label": "block text-sm leading-6 font-medium text-$c-gray-900",
375
+ "form-group-label": "block label-base",
347
376
  "form-group-label-required": "after:content-['*'] after:ms-0.5 after:text-error",
348
377
  // counter
349
- "form-group-counter-wrapper": "text-sm",
378
+ "form-group-counter-wrapper": "text-0.8em",
350
379
  "form-group-counter-error": "text-error",
351
- "form-group-counter-current": "text-$c-gray-900",
352
- "form-group-counter-separator": "text-$c-gray-500",
353
- "form-group-counter-max": "text-$c-gray-500"
380
+ "form-group-counter-current": "text-accent",
381
+ "form-group-counter-separator": "text-muted",
382
+ "form-group-counter-max": "text-muted"
354
383
  };
355
384
  const formGroup = [
356
385
  staticFormGroup
@@ -633,7 +662,10 @@ const staticProgress = {
633
662
  "progress-indeterminate": "absolute bg-brand h-full",
634
663
  // components
635
664
  "progress-root": "relative h-0.5em w-full overflow-hidden rounded-full bg-brand/20",
636
- "progress-indicator": "h-full w-full flex-1 bg-brand transition-all"
665
+ "progress-indicator": "h-full w-full flex-1 bg-brand transition-all",
666
+ // static
667
+ "progress-white": "bg-inverted",
668
+ "progress-black": "bg-base"
637
669
  };
638
670
  const dynamicProgress = [
639
671
  [/^progress-(.*)$/, ([, body], { theme }) => {
@@ -676,7 +708,7 @@ const radio = [
676
708
 
677
709
  const staticRadioGroup = {
678
710
  // configurations
679
- "radio-group": "gap-2 flex flex-nowrap",
711
+ "radio-group": "gap-2 flex flex-wrap",
680
712
  "radio-group-orientation-vertical": "flex-col",
681
713
  "radio-group-orientation-horizontal": "flex-row",
682
714
  // components
@@ -919,6 +951,33 @@ const tabs = [
919
951
  staticTabs
920
952
  ];
921
953
 
954
+ const staticToast = {
955
+ // config
956
+ "toast": "pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all ",
957
+ "toast-viewport": "fixed top-0 z-100 flex max-h-screen gap-y-4 w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-420px",
958
+ "toast-wrapper": "w-0 flex flex-1 flex-col gap-2",
959
+ "toast-title": "text-sm font-semibold [&+div]:text-xs",
960
+ "toast-description": "text-sm opacity-90",
961
+ "toast-leading": "square-5",
962
+ "toast-close": "bg-transparent flex items-center justify-center absolute right-1 top-1 rounded-md p-1 text-brand/80 opacity-0 transition-opacity hover:text-brand focus:opacity-100 focus:ring-1 focus:ring-brand/80 focus:outline-none group-hover:opacity-100",
963
+ "toast-close-icon": "i-close",
964
+ "toast-close-icon-base": "h-1em w-1em",
965
+ "toast-info": "grid gap-1",
966
+ "toast-actions": "flex shrink-0 gap-1.5",
967
+ "toast-progress": "h-1 rounded-none"
968
+ };
969
+ const dynamicToast = [
970
+ // dynamic variants
971
+ [/^toast-solid(-(\S+))?$/, ([, , c = "primary"]) => `alert-solid-${c}`],
972
+ [/^toast-soft(-(\S+))?$/, ([, , c = "primary"]) => `alert-soft-${c}`],
973
+ [/^toast-outline(-(\S+))?$/, ([, , c = "primary"]) => `alert-outline-${c}`],
974
+ [/^toast-border(-(\S+))?$/, ([, , c = "primary"]) => `alert-border-${c}`]
975
+ ];
976
+ const toast = [
977
+ ...dynamicToast,
978
+ staticToast
979
+ ];
980
+
922
981
  const staticToggle = {
923
982
  // configurations
924
983
  toggle: ""
@@ -989,9 +1048,11 @@ const shortcuts = [
989
1048
  ...popover,
990
1049
  ...tooltip,
991
1050
  ...pagination,
1051
+ ...toast,
992
1052
  ...toggle,
993
1053
  ...collapsible,
994
- ...radioGroup
1054
+ ...radioGroup,
1055
+ ...form
995
1056
  ];
996
1057
 
997
1058
  export { shortcuts };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@una-ui/preset",
3
- "version": "0.30.0-beta.1",
3
+ "version": "0.32.0-beta.1",
4
4
  "description": "The default preset for @una-ui",
5
5
  "author": "Phojie Rengel <phojrengel@gmail.com>",
6
6
  "license": "MIT",
package/una.css CHANGED
@@ -75,7 +75,7 @@
75
75
  --c-popover: rgb(255, 255, 255);
76
76
  --c-popover-foreground: rgb(var(--una-gray-950));
77
77
  --c-border: rgb(var(--una-gray-200));
78
- --c-border-foreground: rgba(var(--una-gray-700), .58);
78
+ --c-border-foreground: rgba(var(--una-gray-700), 0.58);
79
79
  --c-ring: rgb(var(--una-gray-200));
80
80
  --c-divider: rgb(var(--una-gray-200));
81
81
  --c-bg-selection: rgba(var(--una-primary-600), 0.2);
@@ -97,11 +97,11 @@
97
97
  --c-accent: rgb(var(--una-gray-800));
98
98
  --c-accent-foreground: rgb(var(--una-gray-100));
99
99
  --c-popover: rgb(var(--una-gray-950));
100
- --c-popover-foreground: rgb(255,255,255);
101
- --c-border: rgba(var(--una-gray-700), .58);
100
+ --c-popover-foreground: rgb(255, 255, 255);
101
+ --c-border: rgba(var(--una-gray-700), 0.58);
102
102
  --c-border-foreground: rgb(var(--una-gray-200));
103
- --c-ring: rgba(var(--una-gray-700), .58);
104
- --c-divider: rgba(var(--una-gray-700), .58);
103
+ --c-ring: rgba(var(--una-gray-700), 0.58);
104
+ --c-divider: rgba(var(--una-gray-700), 0.58);
105
105
  --c-bg-selection: rgba(var(--una-primary-500), 0.2);
106
106
  }
107
107