@popgrids/ui 0.0.24 → 0.0.26
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.cjs +53 -31
- package/dist/button.cjs.map +1 -1
- package/dist/button.d.cts +21 -4
- package/dist/button.d.ts +21 -4
- package/dist/button.js +54 -32
- package/dist/button.js.map +1 -1
- package/dist/dialog.cjs +53 -31
- package/dist/dialog.cjs.map +1 -1
- package/dist/dialog.js +53 -31
- package/dist/dialog.js.map +1 -1
- package/dist/index.cjs +53 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +53 -31
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -369,52 +369,74 @@ function Button({
|
|
|
369
369
|
children,
|
|
370
370
|
className,
|
|
371
371
|
collapsed = false,
|
|
372
|
+
focusableWhenDisabled,
|
|
372
373
|
leading,
|
|
373
374
|
outline = false,
|
|
374
375
|
pill = false,
|
|
375
376
|
loading = false,
|
|
376
377
|
loadingElement,
|
|
378
|
+
nativeButton,
|
|
379
|
+
render,
|
|
377
380
|
size = "default",
|
|
378
381
|
theme = "brand",
|
|
379
382
|
trailing,
|
|
380
383
|
variant = "default",
|
|
384
|
+
href,
|
|
381
385
|
...props
|
|
382
386
|
}) {
|
|
387
|
+
const sharedClassName = cn(
|
|
388
|
+
buttonVariants({
|
|
389
|
+
variant,
|
|
390
|
+
size,
|
|
391
|
+
align,
|
|
392
|
+
outline,
|
|
393
|
+
collapsed,
|
|
394
|
+
pill,
|
|
395
|
+
className,
|
|
396
|
+
hasLeading: !!leading,
|
|
397
|
+
theme,
|
|
398
|
+
hasTrailing: !!trailing
|
|
399
|
+
}),
|
|
400
|
+
tintVariants({ variant, outline })
|
|
401
|
+
);
|
|
402
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
403
|
+
loading && (loadingElement || /* @__PURE__ */ jsx(Loader, { className: "absolute inset-0 m-auto", variant: "spinner", theme: "reversed" })),
|
|
404
|
+
leading && /* @__PURE__ */ jsx("div", { className: cn("group-aria-busy/button:opacity-0 transition-opacity", { "opacity-0": loading }), children: leading }),
|
|
405
|
+
children && /* @__PURE__ */ jsx("span", { className: cn("min-w-[18px] truncate relative transition-opacity", { "opacity-0": loading }), children }),
|
|
406
|
+
trailing && /* @__PURE__ */ jsx(
|
|
407
|
+
"div",
|
|
408
|
+
{
|
|
409
|
+
className: cn("group-aria-busy/button:opacity-0 transition-opacity", {
|
|
410
|
+
"opacity-0": loading,
|
|
411
|
+
"absolute top-1/2 right-0 translate-x-1/2 -translate-y-1/2": collapsed
|
|
412
|
+
}),
|
|
413
|
+
children: trailing
|
|
414
|
+
}
|
|
415
|
+
)
|
|
416
|
+
] });
|
|
417
|
+
if (href != null) {
|
|
418
|
+
return /* @__PURE__ */ jsx(
|
|
419
|
+
"a",
|
|
420
|
+
{
|
|
421
|
+
"data-slot": "button",
|
|
422
|
+
className: sharedClassName,
|
|
423
|
+
href,
|
|
424
|
+
...props,
|
|
425
|
+
children: content
|
|
426
|
+
}
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
const buttonProps = props;
|
|
383
430
|
return /* @__PURE__ */ jsx(
|
|
384
431
|
Button$1,
|
|
385
432
|
{
|
|
386
433
|
"data-slot": "button",
|
|
387
|
-
className:
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
collapsed,
|
|
394
|
-
pill,
|
|
395
|
-
className,
|
|
396
|
-
hasLeading: !!leading,
|
|
397
|
-
theme,
|
|
398
|
-
hasTrailing: !!trailing
|
|
399
|
-
}),
|
|
400
|
-
tintVariants({ variant, outline })
|
|
401
|
-
),
|
|
402
|
-
...props,
|
|
403
|
-
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
404
|
-
loading && (loadingElement || /* @__PURE__ */ jsx(Loader, { className: "absolute inset-0 m-auto", variant: "spinner", theme: "reversed" })),
|
|
405
|
-
leading && /* @__PURE__ */ jsx("div", { className: cn("group-aria-busy/button:opacity-0 transition-opacity", { "opacity-0": loading }), children: leading }),
|
|
406
|
-
children && /* @__PURE__ */ jsx("span", { className: cn("min-w-[18px] truncate relative transition-opacity", { "opacity-0": loading }), children }),
|
|
407
|
-
trailing && /* @__PURE__ */ jsx(
|
|
408
|
-
"div",
|
|
409
|
-
{
|
|
410
|
-
className: cn("group-aria-busy/button:opacity-0 transition-opacity", {
|
|
411
|
-
"opacity-0": loading,
|
|
412
|
-
"absolute top-1/2 right-0 translate-x-1/2 -translate-y-1/2": collapsed
|
|
413
|
-
}),
|
|
414
|
-
children: trailing
|
|
415
|
-
}
|
|
416
|
-
)
|
|
417
|
-
] })
|
|
434
|
+
className: sharedClassName,
|
|
435
|
+
nativeButton,
|
|
436
|
+
focusableWhenDisabled,
|
|
437
|
+
render,
|
|
438
|
+
...buttonProps,
|
|
439
|
+
children: content
|
|
418
440
|
}
|
|
419
441
|
);
|
|
420
442
|
}
|