@una-ui/preset 0.31.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/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",
@@ -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,11 +336,36 @@ 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
366
  "form-group": "space-y-2",
338
367
  "form-group-description": "text-0.8rem text-muted",
339
- "form-group-hint": "text-sm text-muted",
368
+ "form-group-hint": "text-sm leading-none text-muted",
340
369
  "form-group-message": "text-0.8em transition-all duration-1000 ease-in-out",
341
370
  // wrappers
342
371
  "form-group-top-wrapper": "flex flex-col space-y-1.5",
@@ -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 }) => {
@@ -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;
@@ -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,11 +334,36 @@ 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
364
  "form-group": "space-y-2",
336
365
  "form-group-description": "text-0.8rem text-muted",
337
- "form-group-hint": "text-sm text-muted",
366
+ "form-group-hint": "text-sm leading-none text-muted",
338
367
  "form-group-message": "text-0.8em transition-all duration-1000 ease-in-out",
339
368
  // wrappers
340
369
  "form-group-top-wrapper": "flex flex-col space-y-1.5",
@@ -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 }) => {
@@ -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.31.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",