@una-ui/preset 0.22.0-beta.2 → 0.23.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 +12 -0
- package/dist/prefixes.mjs +12 -0
- package/dist/shortcuts.cjs +54 -8
- package/dist/shortcuts.mjs +54 -8
- package/package.json +1 -1
package/dist/prefixes.cjs
CHANGED
|
@@ -46,11 +46,22 @@ const prefixes = [
|
|
|
46
46
|
"link",
|
|
47
47
|
"nav-link",
|
|
48
48
|
"nav-link-group",
|
|
49
|
+
"pagination",
|
|
50
|
+
"pagination-ellipsis",
|
|
51
|
+
"pagination-selected",
|
|
52
|
+
"pagination-unselected",
|
|
53
|
+
"pagination-ellipsis",
|
|
54
|
+
"pagination-first",
|
|
55
|
+
"pagination-last",
|
|
56
|
+
"pagination-list-item",
|
|
57
|
+
"pagination-next",
|
|
58
|
+
"pagination-prev",
|
|
49
59
|
"popover",
|
|
50
60
|
"popover-content",
|
|
51
61
|
"progress",
|
|
52
62
|
"radio",
|
|
53
63
|
"resize",
|
|
64
|
+
"rounded",
|
|
54
65
|
"select",
|
|
55
66
|
"select-content",
|
|
56
67
|
"select-group",
|
|
@@ -68,6 +79,7 @@ const prefixes = [
|
|
|
68
79
|
"size",
|
|
69
80
|
"skeleton",
|
|
70
81
|
"slider",
|
|
82
|
+
"square",
|
|
71
83
|
"switch",
|
|
72
84
|
"table",
|
|
73
85
|
"table-body",
|
package/dist/prefixes.mjs
CHANGED
|
@@ -44,11 +44,22 @@ const prefixes = [
|
|
|
44
44
|
"link",
|
|
45
45
|
"nav-link",
|
|
46
46
|
"nav-link-group",
|
|
47
|
+
"pagination",
|
|
48
|
+
"pagination-ellipsis",
|
|
49
|
+
"pagination-selected",
|
|
50
|
+
"pagination-unselected",
|
|
51
|
+
"pagination-ellipsis",
|
|
52
|
+
"pagination-first",
|
|
53
|
+
"pagination-last",
|
|
54
|
+
"pagination-list-item",
|
|
55
|
+
"pagination-next",
|
|
56
|
+
"pagination-prev",
|
|
47
57
|
"popover",
|
|
48
58
|
"popover-content",
|
|
49
59
|
"progress",
|
|
50
60
|
"radio",
|
|
51
61
|
"resize",
|
|
62
|
+
"rounded",
|
|
52
63
|
"select",
|
|
53
64
|
"select-content",
|
|
54
65
|
"select-group",
|
|
@@ -66,6 +77,7 @@ const prefixes = [
|
|
|
66
77
|
"size",
|
|
67
78
|
"skeleton",
|
|
68
79
|
"slider",
|
|
80
|
+
"square",
|
|
69
81
|
"switch",
|
|
70
82
|
"table",
|
|
71
83
|
"table-body",
|
package/dist/shortcuts.cjs
CHANGED
|
@@ -161,19 +161,20 @@ const staticBtn = {
|
|
|
161
161
|
// config
|
|
162
162
|
"btn-default-variant": "btn-solid",
|
|
163
163
|
"btn-loading-icon": "i-loading",
|
|
164
|
+
"btn-default-radius": "rounded-md",
|
|
164
165
|
// base
|
|
165
|
-
"btn": "bg-transparent transition-colors text-0.875em leading-5 gap-0.42857142857142855em
|
|
166
|
+
"btn": "btn-rectangle px-0.7142857142857143em py-0.42857142857142855em bg-transparent transition-colors text-0.875em leading-5 gap-x-0.42857142857142855em rounded-md whitespace-nowrap inline-flex justify-center items-center btn-disabled font-medium cursor-pointer",
|
|
166
167
|
"btn-disabled": "disabled:n-disabled",
|
|
167
168
|
"btn-label": "",
|
|
168
169
|
"btn-icon-label": "text-1.191em",
|
|
169
170
|
"btn-leading": "-ml-0.14285714285714285em text-1.191em",
|
|
170
171
|
"btn-trailing": "-mr-0.14285714285714285em text-1.191em",
|
|
171
172
|
"btn-loading": "animate-spin text-1.191em",
|
|
173
|
+
"btn-rectangle": "h-2.5em",
|
|
174
|
+
"btn-square": "w-2.5em h-2.5em",
|
|
172
175
|
// options
|
|
173
176
|
"btn-block": "w-full",
|
|
174
177
|
"btn-reverse": "flex-row-reverse",
|
|
175
|
-
"btn-rectangle": "px-0.7142857142857143em py-0.42857142857142855em",
|
|
176
|
-
"btn-square": "p-0.42857142857142855em",
|
|
177
178
|
// variants
|
|
178
179
|
"btn-solid-white": "bg-base text-base ring-1 ring-base ring-inset shadow-sm btn-focus hover:bg-muted",
|
|
179
180
|
"btn-ghost-white": "text-base btn-focus hover:bg-$c-gray-50",
|
|
@@ -368,8 +369,14 @@ const staticGeneral = {
|
|
|
368
369
|
"transition-base": "transition-all duration-100 ease-out"
|
|
369
370
|
};
|
|
370
371
|
const dynamicGeneral = [
|
|
371
|
-
// TODO:
|
|
372
|
-
// [/^
|
|
372
|
+
// TODO: una-text-<color><-number><-number>
|
|
373
|
+
// [/^una-text(-(\S+))?$/, ([, , c = 'primary']) => `text-${c}-700 dark:text-${c}-400`],
|
|
374
|
+
/**
|
|
375
|
+
* Since we override the default `size` utility, we need to provide an alternative for it.
|
|
376
|
+
* @refer https://tailwindcss.com/docs/size
|
|
377
|
+
* @example area-100 -> w-100 h-100
|
|
378
|
+
*/
|
|
379
|
+
[/^square-([^-]+)$/, ([, size]) => `w-${size} h-${size}`]
|
|
373
380
|
];
|
|
374
381
|
const general = [
|
|
375
382
|
...dynamicGeneral,
|
|
@@ -531,6 +538,44 @@ const navLinkGroup = [
|
|
|
531
538
|
staticNavLinkGroup
|
|
532
539
|
];
|
|
533
540
|
|
|
541
|
+
const staticPagination = {
|
|
542
|
+
// configurations
|
|
543
|
+
"pagination": "overflow-hidden",
|
|
544
|
+
"pagination-list": "flex items-center gap-1 overflow-hidden",
|
|
545
|
+
// components
|
|
546
|
+
"pagination-root": "",
|
|
547
|
+
"pagination-list-item": "pagination",
|
|
548
|
+
"pagination-ellipsis-base": "btn flex items-center justify-center",
|
|
549
|
+
"pagination-ellipsis-icon-base": "w-1em h-1em",
|
|
550
|
+
"pagination-ellipsis-icon": "i-lucide-ellipsis",
|
|
551
|
+
"pagination-first": "pagination",
|
|
552
|
+
"pagination-first-icon": "i-lucide-chevrons-left",
|
|
553
|
+
"pagination-prev": "pagination",
|
|
554
|
+
"pagination-prev-icon": "i-lucide-chevron-left",
|
|
555
|
+
"pagination-next": "pagination",
|
|
556
|
+
"pagination-next-icon": "i-lucide-chevron-right",
|
|
557
|
+
"pagination-last": "pagination",
|
|
558
|
+
"pagination-last-icon": "i-lucide-chevrons-right"
|
|
559
|
+
};
|
|
560
|
+
const dynamicPagination = [
|
|
561
|
+
[
|
|
562
|
+
/^pagination-ellipsis(?:-([^-]+))?(?:-([^-]+))?$/,
|
|
563
|
+
([, variant = "text", color = "black"]) => `btn-${variant}-${color}`
|
|
564
|
+
],
|
|
565
|
+
[
|
|
566
|
+
/^pagination-selected(?:-([^-]+))?(?:-([^-]+))?$/,
|
|
567
|
+
([, variant = "solid", color = "primary"]) => `data-[selected=true]:btn-${variant}-${color}`
|
|
568
|
+
],
|
|
569
|
+
[
|
|
570
|
+
/^pagination-unselected(?:-([^-]+))?(?:-([^-]+))?$/,
|
|
571
|
+
([, variant = "solid", color = "white"]) => `data-[selected=false]:btn-${variant}-${color}`
|
|
572
|
+
]
|
|
573
|
+
];
|
|
574
|
+
const pagination = [
|
|
575
|
+
...dynamicPagination,
|
|
576
|
+
staticPagination
|
|
577
|
+
];
|
|
578
|
+
|
|
534
579
|
const staticPopover = {
|
|
535
580
|
"popover-content": "w-72 rounded-md border border-base bg-popover p-4 text-popover shadow-md outline-none 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"
|
|
536
581
|
};
|
|
@@ -601,7 +646,7 @@ const staticSelect = {
|
|
|
601
646
|
"select-trigger-warning-icon": "i-warning",
|
|
602
647
|
// components
|
|
603
648
|
"select-root": "",
|
|
604
|
-
"select-trigger": "
|
|
649
|
+
"select-trigger": "w-full",
|
|
605
650
|
// [&>span]:line-clamp-1
|
|
606
651
|
"select-trigger-trailing-icon": "i-lucide-chevrons-up-down !text-1.042em",
|
|
607
652
|
"select-trigger-trailing": "ml-auto n-disabled",
|
|
@@ -682,7 +727,7 @@ const skeleton = [
|
|
|
682
727
|
|
|
683
728
|
const staticSlider = {
|
|
684
729
|
// configurations
|
|
685
|
-
"slider": "slider-primary
|
|
730
|
+
"slider": "slider-primary",
|
|
686
731
|
"slider-disabled": "n-disabled",
|
|
687
732
|
"slider-root-vertical": "flex-col w-1em h-full",
|
|
688
733
|
"slider-track-vertical": "w-0.5em h-full",
|
|
@@ -849,7 +894,8 @@ const shortcuts = [
|
|
|
849
894
|
...dropdowMenu,
|
|
850
895
|
...label,
|
|
851
896
|
...popover,
|
|
852
|
-
...tooltip
|
|
897
|
+
...tooltip,
|
|
898
|
+
...pagination
|
|
853
899
|
];
|
|
854
900
|
|
|
855
901
|
exports.shortcuts = shortcuts;
|
package/dist/shortcuts.mjs
CHANGED
|
@@ -159,19 +159,20 @@ const staticBtn = {
|
|
|
159
159
|
// config
|
|
160
160
|
"btn-default-variant": "btn-solid",
|
|
161
161
|
"btn-loading-icon": "i-loading",
|
|
162
|
+
"btn-default-radius": "rounded-md",
|
|
162
163
|
// base
|
|
163
|
-
"btn": "bg-transparent transition-colors text-0.875em leading-5 gap-0.42857142857142855em
|
|
164
|
+
"btn": "btn-rectangle px-0.7142857142857143em py-0.42857142857142855em bg-transparent transition-colors text-0.875em leading-5 gap-x-0.42857142857142855em rounded-md whitespace-nowrap inline-flex justify-center items-center btn-disabled font-medium cursor-pointer",
|
|
164
165
|
"btn-disabled": "disabled:n-disabled",
|
|
165
166
|
"btn-label": "",
|
|
166
167
|
"btn-icon-label": "text-1.191em",
|
|
167
168
|
"btn-leading": "-ml-0.14285714285714285em text-1.191em",
|
|
168
169
|
"btn-trailing": "-mr-0.14285714285714285em text-1.191em",
|
|
169
170
|
"btn-loading": "animate-spin text-1.191em",
|
|
171
|
+
"btn-rectangle": "h-2.5em",
|
|
172
|
+
"btn-square": "w-2.5em h-2.5em",
|
|
170
173
|
// options
|
|
171
174
|
"btn-block": "w-full",
|
|
172
175
|
"btn-reverse": "flex-row-reverse",
|
|
173
|
-
"btn-rectangle": "px-0.7142857142857143em py-0.42857142857142855em",
|
|
174
|
-
"btn-square": "p-0.42857142857142855em",
|
|
175
176
|
// variants
|
|
176
177
|
"btn-solid-white": "bg-base text-base ring-1 ring-base ring-inset shadow-sm btn-focus hover:bg-muted",
|
|
177
178
|
"btn-ghost-white": "text-base btn-focus hover:bg-$c-gray-50",
|
|
@@ -366,8 +367,14 @@ const staticGeneral = {
|
|
|
366
367
|
"transition-base": "transition-all duration-100 ease-out"
|
|
367
368
|
};
|
|
368
369
|
const dynamicGeneral = [
|
|
369
|
-
// TODO:
|
|
370
|
-
// [/^
|
|
370
|
+
// TODO: una-text-<color><-number><-number>
|
|
371
|
+
// [/^una-text(-(\S+))?$/, ([, , c = 'primary']) => `text-${c}-700 dark:text-${c}-400`],
|
|
372
|
+
/**
|
|
373
|
+
* Since we override the default `size` utility, we need to provide an alternative for it.
|
|
374
|
+
* @refer https://tailwindcss.com/docs/size
|
|
375
|
+
* @example area-100 -> w-100 h-100
|
|
376
|
+
*/
|
|
377
|
+
[/^square-([^-]+)$/, ([, size]) => `w-${size} h-${size}`]
|
|
371
378
|
];
|
|
372
379
|
const general = [
|
|
373
380
|
...dynamicGeneral,
|
|
@@ -529,6 +536,44 @@ const navLinkGroup = [
|
|
|
529
536
|
staticNavLinkGroup
|
|
530
537
|
];
|
|
531
538
|
|
|
539
|
+
const staticPagination = {
|
|
540
|
+
// configurations
|
|
541
|
+
"pagination": "overflow-hidden",
|
|
542
|
+
"pagination-list": "flex items-center gap-1 overflow-hidden",
|
|
543
|
+
// components
|
|
544
|
+
"pagination-root": "",
|
|
545
|
+
"pagination-list-item": "pagination",
|
|
546
|
+
"pagination-ellipsis-base": "btn flex items-center justify-center",
|
|
547
|
+
"pagination-ellipsis-icon-base": "w-1em h-1em",
|
|
548
|
+
"pagination-ellipsis-icon": "i-lucide-ellipsis",
|
|
549
|
+
"pagination-first": "pagination",
|
|
550
|
+
"pagination-first-icon": "i-lucide-chevrons-left",
|
|
551
|
+
"pagination-prev": "pagination",
|
|
552
|
+
"pagination-prev-icon": "i-lucide-chevron-left",
|
|
553
|
+
"pagination-next": "pagination",
|
|
554
|
+
"pagination-next-icon": "i-lucide-chevron-right",
|
|
555
|
+
"pagination-last": "pagination",
|
|
556
|
+
"pagination-last-icon": "i-lucide-chevrons-right"
|
|
557
|
+
};
|
|
558
|
+
const dynamicPagination = [
|
|
559
|
+
[
|
|
560
|
+
/^pagination-ellipsis(?:-([^-]+))?(?:-([^-]+))?$/,
|
|
561
|
+
([, variant = "text", color = "black"]) => `btn-${variant}-${color}`
|
|
562
|
+
],
|
|
563
|
+
[
|
|
564
|
+
/^pagination-selected(?:-([^-]+))?(?:-([^-]+))?$/,
|
|
565
|
+
([, variant = "solid", color = "primary"]) => `data-[selected=true]:btn-${variant}-${color}`
|
|
566
|
+
],
|
|
567
|
+
[
|
|
568
|
+
/^pagination-unselected(?:-([^-]+))?(?:-([^-]+))?$/,
|
|
569
|
+
([, variant = "solid", color = "white"]) => `data-[selected=false]:btn-${variant}-${color}`
|
|
570
|
+
]
|
|
571
|
+
];
|
|
572
|
+
const pagination = [
|
|
573
|
+
...dynamicPagination,
|
|
574
|
+
staticPagination
|
|
575
|
+
];
|
|
576
|
+
|
|
532
577
|
const staticPopover = {
|
|
533
578
|
"popover-content": "w-72 rounded-md border border-base bg-popover p-4 text-popover shadow-md outline-none 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"
|
|
534
579
|
};
|
|
@@ -599,7 +644,7 @@ const staticSelect = {
|
|
|
599
644
|
"select-trigger-warning-icon": "i-warning",
|
|
600
645
|
// components
|
|
601
646
|
"select-root": "",
|
|
602
|
-
"select-trigger": "
|
|
647
|
+
"select-trigger": "w-full",
|
|
603
648
|
// [&>span]:line-clamp-1
|
|
604
649
|
"select-trigger-trailing-icon": "i-lucide-chevrons-up-down !text-1.042em",
|
|
605
650
|
"select-trigger-trailing": "ml-auto n-disabled",
|
|
@@ -680,7 +725,7 @@ const skeleton = [
|
|
|
680
725
|
|
|
681
726
|
const staticSlider = {
|
|
682
727
|
// configurations
|
|
683
|
-
"slider": "slider-primary
|
|
728
|
+
"slider": "slider-primary",
|
|
684
729
|
"slider-disabled": "n-disabled",
|
|
685
730
|
"slider-root-vertical": "flex-col w-1em h-full",
|
|
686
731
|
"slider-track-vertical": "w-0.5em h-full",
|
|
@@ -847,7 +892,8 @@ const shortcuts = [
|
|
|
847
892
|
...dropdowMenu,
|
|
848
893
|
...label,
|
|
849
894
|
...popover,
|
|
850
|
-
...tooltip
|
|
895
|
+
...tooltip,
|
|
896
|
+
...pagination
|
|
851
897
|
];
|
|
852
898
|
|
|
853
899
|
export { shortcuts };
|