@jinaan/uikit 0.1.17 → 0.1.19
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/button.d.ts.map +1 -1
- package/dist/index.js +167 -146
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/button.tsx +29 -14
- package/src/dialog.tsx +1 -1
package/package.json
CHANGED
package/src/button.tsx
CHANGED
|
@@ -94,6 +94,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
94
94
|
buttonVariants({ variant, size }),
|
|
95
95
|
iconOnly && "aspect-square px-0",
|
|
96
96
|
fullWidth && "w-full",
|
|
97
|
+
loading && "disabled:opacity-100",
|
|
97
98
|
className,
|
|
98
99
|
)}
|
|
99
100
|
{...props}
|
|
@@ -101,21 +102,35 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
101
102
|
{asChild ? (
|
|
102
103
|
children
|
|
103
104
|
) : (
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
105
|
+
<span className="relative inline-flex items-center justify-center gap-[var(--control-gap)]">
|
|
106
|
+
<span
|
|
107
|
+
className={cn(
|
|
108
|
+
"inline-flex items-center justify-center gap-[var(--control-gap)] transition-[opacity,translate] duration-150 ease-out motion-reduce:transition-none",
|
|
109
|
+
loading && "translate-y-2 opacity-0",
|
|
110
|
+
)}
|
|
111
|
+
aria-hidden={loading || undefined}
|
|
112
|
+
>
|
|
113
|
+
{!loading && leadingIcon ? (
|
|
114
|
+
<span className={cn("inline-flex shrink-0", icon)} aria-hidden>
|
|
115
|
+
{leadingIcon}
|
|
116
|
+
</span>
|
|
117
|
+
) : null}
|
|
118
|
+
{children}
|
|
119
|
+
{!loading && trailingIcon ? (
|
|
120
|
+
<span className={cn("inline-flex shrink-0", icon)} aria-hidden>
|
|
121
|
+
{trailingIcon}
|
|
122
|
+
</span>
|
|
123
|
+
) : null}
|
|
124
|
+
</span>
|
|
125
|
+
{loading && (
|
|
126
|
+
<span
|
|
127
|
+
className="pointer-events-none absolute inset-0 flex items-center justify-center animate-in fade-in-0 slide-in-from-top-2 duration-150"
|
|
128
|
+
aria-hidden
|
|
129
|
+
>
|
|
130
|
+
<Spinner className={cn("text-current", icon)} />
|
|
110
131
|
</span>
|
|
111
|
-
)
|
|
112
|
-
|
|
113
|
-
{!loading && trailingIcon ? (
|
|
114
|
-
<span className={cn("inline-flex shrink-0", icon)} aria-hidden>
|
|
115
|
-
{trailingIcon}
|
|
116
|
-
</span>
|
|
117
|
-
) : null}
|
|
118
|
-
</>
|
|
132
|
+
)}
|
|
133
|
+
</span>
|
|
119
134
|
)}
|
|
120
135
|
</Comp>
|
|
121
136
|
);
|
package/src/dialog.tsx
CHANGED
|
@@ -385,7 +385,7 @@ export function DialogFooter({
|
|
|
385
385
|
<div
|
|
386
386
|
data-slot="footer"
|
|
387
387
|
className={cn(
|
|
388
|
-
"flex shrink-0 flex-col-reverse gap-2 px-3 pt-3 sm:flex-row sm:px-4 sm:pt-3.5 sm
|
|
388
|
+
"flex shrink-0 flex-col-reverse gap-2 px-3 pt-3 sm:flex-row sm:px-4 sm:pt-3.5 sm:*:flex-1",
|
|
389
389
|
className,
|
|
390
390
|
)}
|
|
391
391
|
{...props}
|