@popgrids/ui 0.0.23 → 0.0.25

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/index.cjs CHANGED
@@ -5,8 +5,9 @@ var clsx = require('clsx');
5
5
  var tailwindMerge = require('tailwind-merge');
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
  var button = require('@base-ui/react/button');
8
- var dialog = require('@base-ui/react/dialog');
8
+ var checkbox = require('@base-ui/react/checkbox');
9
9
  var icons = require('@untitledui/icons');
10
+ var dialog = require('@base-ui/react/dialog');
10
11
  var menu = require('@base-ui/react/menu');
11
12
  var input = require('@base-ui/react/input');
12
13
  var mergeProps = require('@base-ui/react/merge-props');
@@ -379,45 +380,53 @@ function Button({
379
380
  theme = "brand",
380
381
  trailing,
381
382
  variant = "default",
383
+ href,
382
384
  ...props
383
385
  }) {
384
- return /* @__PURE__ */ jsxRuntime.jsx(
385
- button.Button,
386
- {
387
- "data-slot": "button",
388
- className: cn(
389
- buttonVariants({
390
- variant,
391
- size,
392
- align,
393
- outline,
394
- collapsed,
395
- pill,
396
- className,
397
- hasLeading: !!leading,
398
- theme,
399
- hasTrailing: !!trailing
400
- }),
401
- tintVariants({ variant, outline })
402
- ),
403
- ...props,
404
- children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
405
- loading && (loadingElement || /* @__PURE__ */ jsxRuntime.jsx(Loader, { className: "absolute inset-0 m-auto", variant: "spinner", theme: "reversed" })),
406
- leading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("group-aria-busy/button:opacity-0 transition-opacity", { "opacity-0": loading }), children: leading }),
407
- children && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("min-w-[18px] truncate relative transition-opacity", { "opacity-0": loading }), children }),
408
- trailing && /* @__PURE__ */ jsxRuntime.jsx(
409
- "div",
410
- {
411
- className: cn("group-aria-busy/button:opacity-0 transition-opacity", {
412
- "opacity-0": loading,
413
- "absolute top-1/2 right-0 translate-x-1/2 -translate-y-1/2": collapsed
414
- }),
415
- children: trailing
416
- }
417
- )
418
- ] })
419
- }
386
+ const sharedClassName = cn(
387
+ buttonVariants({
388
+ variant,
389
+ size,
390
+ align,
391
+ outline,
392
+ collapsed,
393
+ pill,
394
+ className,
395
+ hasLeading: !!leading,
396
+ theme,
397
+ hasTrailing: !!trailing
398
+ }),
399
+ tintVariants({ variant, outline })
420
400
  );
401
+ const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
402
+ loading && (loadingElement || /* @__PURE__ */ jsxRuntime.jsx(Loader, { className: "absolute inset-0 m-auto", variant: "spinner", theme: "reversed" })),
403
+ leading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("group-aria-busy/button:opacity-0 transition-opacity", { "opacity-0": loading }), children: leading }),
404
+ children && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("min-w-[18px] truncate relative transition-opacity", { "opacity-0": loading }), children }),
405
+ trailing && /* @__PURE__ */ jsxRuntime.jsx(
406
+ "div",
407
+ {
408
+ className: cn("group-aria-busy/button:opacity-0 transition-opacity", {
409
+ "opacity-0": loading,
410
+ "absolute top-1/2 right-0 translate-x-1/2 -translate-y-1/2": collapsed
411
+ }),
412
+ children: trailing
413
+ }
414
+ )
415
+ ] });
416
+ if (href != null) {
417
+ return /* @__PURE__ */ jsxRuntime.jsx(
418
+ "a",
419
+ {
420
+ "data-slot": "button",
421
+ className: sharedClassName,
422
+ href,
423
+ ...props,
424
+ children: content
425
+ }
426
+ );
427
+ }
428
+ const buttonProps = props;
429
+ return /* @__PURE__ */ jsxRuntime.jsx(button.Button, { "data-slot": "button", className: sharedClassName, ...buttonProps, children: content });
421
430
  }
422
431
  var buttonLinkVariants = classVarianceAuthority.cva(
423
432
  "inline-flex relative items-center gap-1.5 whitespace-nowrap font-medium transition-all rounded-xs -translate-y-px border-y border-x-4 border-transparent [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none no-underline cursor-pointer",
@@ -527,6 +536,27 @@ function ContentBlock({ className, children, title, subhead, cta }) {
527
536
  children && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "prose prose-base max-w-(--width-xl) pb-3", children })
528
537
  ] });
529
538
  }
539
+ function Checkbox({ className, ...props }) {
540
+ return /* @__PURE__ */ jsxRuntime.jsx(
541
+ checkbox.Checkbox.Root,
542
+ {
543
+ "data-slot": "checkbox",
544
+ className: cn(
545
+ "border-foreground dark:bg-input/30 dark:data-checked:bg-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 data-disabled:cursor-not-allowed data-disabled:opacity-50 aria-invalid:ring-3 data-checked:border-foreground data-checked:bg-foreground data-checked:text-background",
546
+ className
547
+ ),
548
+ ...props,
549
+ children: /* @__PURE__ */ jsxRuntime.jsx(
550
+ checkbox.Checkbox.Indicator,
551
+ {
552
+ "data-slot": "checkbox-indicator",
553
+ className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
554
+ children: /* @__PURE__ */ jsxRuntime.jsx(icons.Check, {})
555
+ }
556
+ )
557
+ }
558
+ );
559
+ }
530
560
  function DialogRoot(props) {
531
561
  return /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Root, { "data-slot": "dialog", ...props });
532
562
  }
@@ -1459,6 +1489,7 @@ function Tag({
1459
1489
  exports.BannerNotification = BannerNotification;
1460
1490
  exports.Button = Button;
1461
1491
  exports.ButtonLink = ButtonLink;
1492
+ exports.Checkbox = Checkbox;
1462
1493
  exports.ContentBlock = ContentBlock;
1463
1494
  exports.Dialog = DialogRoot;
1464
1495
  exports.DialogBody = DialogBody;