@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.js CHANGED
@@ -3,8 +3,9 @@ import { clsx } from 'clsx';
3
3
  import { twMerge } from 'tailwind-merge';
4
4
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
5
5
  import { Button as Button$1 } from '@base-ui/react/button';
6
+ import { Checkbox as Checkbox$1 } from '@base-ui/react/checkbox';
7
+ import { Check, XClose, ChevronRight, InfoCircle } from '@untitledui/icons';
6
8
  import { Dialog } from '@base-ui/react/dialog';
7
- import { XClose, ChevronRight, Check, InfoCircle } from '@untitledui/icons';
8
9
  import { Menu } from '@base-ui/react/menu';
9
10
  import { Input as Input$1 } from '@base-ui/react/input';
10
11
  import { mergeProps } from '@base-ui/react/merge-props';
@@ -377,45 +378,53 @@ function Button({
377
378
  theme = "brand",
378
379
  trailing,
379
380
  variant = "default",
381
+ href,
380
382
  ...props
381
383
  }) {
382
- return /* @__PURE__ */ jsx(
383
- Button$1,
384
- {
385
- "data-slot": "button",
386
- className: 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 })
400
- ),
401
- ...props,
402
- children: /* @__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
- }
384
+ const sharedClassName = cn(
385
+ buttonVariants({
386
+ variant,
387
+ size,
388
+ align,
389
+ outline,
390
+ collapsed,
391
+ pill,
392
+ className,
393
+ hasLeading: !!leading,
394
+ theme,
395
+ hasTrailing: !!trailing
396
+ }),
397
+ tintVariants({ variant, outline })
418
398
  );
399
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
400
+ loading && (loadingElement || /* @__PURE__ */ jsx(Loader, { className: "absolute inset-0 m-auto", variant: "spinner", theme: "reversed" })),
401
+ leading && /* @__PURE__ */ jsx("div", { className: cn("group-aria-busy/button:opacity-0 transition-opacity", { "opacity-0": loading }), children: leading }),
402
+ children && /* @__PURE__ */ jsx("span", { className: cn("min-w-[18px] truncate relative transition-opacity", { "opacity-0": loading }), children }),
403
+ trailing && /* @__PURE__ */ jsx(
404
+ "div",
405
+ {
406
+ className: cn("group-aria-busy/button:opacity-0 transition-opacity", {
407
+ "opacity-0": loading,
408
+ "absolute top-1/2 right-0 translate-x-1/2 -translate-y-1/2": collapsed
409
+ }),
410
+ children: trailing
411
+ }
412
+ )
413
+ ] });
414
+ if (href != null) {
415
+ return /* @__PURE__ */ jsx(
416
+ "a",
417
+ {
418
+ "data-slot": "button",
419
+ className: sharedClassName,
420
+ href,
421
+ ...props,
422
+ children: content
423
+ }
424
+ );
425
+ }
426
+ const buttonProps = props;
427
+ return /* @__PURE__ */ jsx(Button$1, { "data-slot": "button", className: sharedClassName, ...buttonProps, children: content });
419
428
  }
420
429
  var buttonLinkVariants = cva(
421
430
  "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",
@@ -525,6 +534,27 @@ function ContentBlock({ className, children, title, subhead, cta }) {
525
534
  children && /* @__PURE__ */ jsx("div", { className: "prose prose-base max-w-(--width-xl) pb-3", children })
526
535
  ] });
527
536
  }
537
+ function Checkbox({ className, ...props }) {
538
+ return /* @__PURE__ */ jsx(
539
+ Checkbox$1.Root,
540
+ {
541
+ "data-slot": "checkbox",
542
+ className: cn(
543
+ "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",
544
+ className
545
+ ),
546
+ ...props,
547
+ children: /* @__PURE__ */ jsx(
548
+ Checkbox$1.Indicator,
549
+ {
550
+ "data-slot": "checkbox-indicator",
551
+ className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
552
+ children: /* @__PURE__ */ jsx(Check, {})
553
+ }
554
+ )
555
+ }
556
+ );
557
+ }
528
558
  function DialogRoot(props) {
529
559
  return /* @__PURE__ */ jsx(Dialog.Root, { "data-slot": "dialog", ...props });
530
560
  }
@@ -1454,6 +1484,6 @@ function Tag({
1454
1484
  );
1455
1485
  }
1456
1486
 
1457
- export { BannerNotification, Button, ButtonLink, ContentBlock, DialogRoot as Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DialogViewport, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Footer, Input, Label, Loader, NotificationBadge, SectionFlourish, SectionHeader, Tag, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipTrigger };
1487
+ export { BannerNotification, Button, ButtonLink, Checkbox, ContentBlock, DialogRoot as Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DialogViewport, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Footer, Input, Label, Loader, NotificationBadge, SectionFlourish, SectionHeader, Tag, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipTrigger };
1458
1488
  //# sourceMappingURL=index.js.map
1459
1489
  //# sourceMappingURL=index.js.map