@popgrids/ui 0.0.27 → 0.0.29

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
@@ -364,6 +364,24 @@ var tintVariants = cva(
364
364
  ]
365
365
  }
366
366
  );
367
+ var loaderCompoundVariants = [
368
+ { theme: "base", variant: "default", loaderTheme: "reversed" },
369
+ { theme: "base", variant: "primary", loaderTheme: "reversed" },
370
+ { theme: "base", variant: "tertiary", loaderTheme: "black" },
371
+ { theme: "base", variant: "outline", loaderTheme: "white" },
372
+ { theme: "brand", variant: "secondary", loaderTheme: "default" },
373
+ { theme: "brand", variant: "default", loaderTheme: "reversed" },
374
+ { theme: "brand", variant: "primary", loaderTheme: "reversed" },
375
+ { theme: "brand", variant: "tertiary", loaderTheme: "black" },
376
+ { theme: "brand", variant: "outline", loaderTheme: "reversed" }
377
+ ];
378
+ function loaderVariants2({
379
+ theme,
380
+ variant
381
+ }) {
382
+ const match = loaderCompoundVariants.find((c) => c.theme === theme && c.variant === variant);
383
+ return match?.loaderTheme ?? "default";
384
+ }
367
385
  function Button({
368
386
  align = "center",
369
387
  children,
@@ -400,7 +418,7 @@ function Button({
400
418
  tintVariants({ variant, outline })
401
419
  );
402
420
  const content = /* @__PURE__ */ jsxs(Fragment, { children: [
403
- loading && (loadingElement || /* @__PURE__ */ jsx(Loader, { className: "absolute inset-0 m-auto", variant: "spinner", theme: "reversed" })),
421
+ loading && (loadingElement || /* @__PURE__ */ jsx(Loader, { className: "absolute inset-0 m-auto", variant: "spinner", theme: loaderVariants2({ theme, variant }) })),
404
422
  leading && /* @__PURE__ */ jsx("div", { className: cn("group-aria-busy/button:opacity-0 transition-opacity", { "opacity-0": loading }), children: leading }),
405
423
  children && /* @__PURE__ */ jsx("span", { className: cn("min-w-[18px] truncate relative transition-opacity", { "opacity-0": loading }), children }),
406
424
  trailing && /* @__PURE__ */ jsx(
@@ -628,16 +646,16 @@ function DialogContent({
628
646
  Dialog.Popup,
629
647
  {
630
648
  "data-slot": "dialog-content",
631
- className: "group/popup pointer-events-none flex h-full max-h-full min-h-0 w-full max-w-full justify-center overflow-hidden transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0",
649
+ className: "group/popup pointer-events-none flex h-auto max-h-full min-h-0 w-full max-w-full justify-center overflow-hidden transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0",
632
650
  children: [
633
651
  /* @__PURE__ */ jsx(
634
652
  "div",
635
653
  {
636
654
  className: cn(
637
- "bg-background pointer-events-auto fixed top-1/2 left-1/2 flex h-full max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl shadow-2xl transition-all",
655
+ "bg-background pointer-events-auto fixed top-1/2 left-1/2 flex h-auto max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl shadow-2xl transition-all",
638
656
  {
639
657
  "group-data-closed/popup:duration-pop-hover group-data-open/popup:duration-pop-hover group-data-open/popup:ease-pop-hover group-data-closed/popup:ease-out group-data-ending-style/popup:scale-[0.96] group-data-ending-style/popup:opacity-0 group-data-starting-style/popup:scale-[0.96] group-data-starting-style/popup:opacity-0": !bottom,
640
- "group-data-open/popup:slide-in-from-bottom group-data-closed/popup:slide-out-to-bottom group-data-starting-style/popup-scale-100 group-data-ending-style/popup-scale-100 group-data-open/popup:animate-in group-data-closed/popup:animate-out top-auto bottom-0 h-full translate-y-0 rounded-b-none group-data-closed/popup:duration-200 group-data-ending-style/popup:translate-y-full group-data-open/popup:duration-300 group-data-open/popup:ease-[cubic-bezier(0.32,0.72,0,1)] group-data-closed/popup:ease-[cubic-bezier(0.32,0.72,0,1)] group-data-starting-style/popup:translate-y-full": bottom
658
+ "group-data-open/popup:slide-in-from-bottom group-data-closed/popup:slide-out-to-bottom group-data-closed/popup:zoom-out-95 group-data-starting-style/popup-scale-100 group-data-ending-style/popup-scale-100 group-data-open/popup:animate-in group-data-closed/popup:animate-out top-auto bottom-0 h-full translate-y-0 rounded-b-none group-data-closed/popup:duration-1000 group-data-ending-style/popup:translate-y-full group-data-open/popup:duration-500 group-data-open/popup:ease-[cubic-bezier(0.32,0.72,0,1)] group-data-open/popup:zoom-in-95 ease-[cubic-bezier(0.32,0.72,0,1)] group-data-starting-style/popup:translate-y-full": bottom
641
659
  },
642
660
  className
643
661
  ),
@@ -648,7 +666,7 @@ function DialogContent({
648
666
  showCloseButton && /* @__PURE__ */ jsxs(
649
667
  DialogClose,
650
668
  {
651
- className: cn("pointer-events-auto fixed top-[7px] z-50 transition-all", { "left-4": closePosition === "top-left", "right-4": closePosition === "top-right", "group-data-closed/popup:duration-pop-hover group-data-open/popup:duration-pop-hover group-data-open/popup:ease-pop-hover group-data-closed/popup:ease-out group-data-ending-style/popup:scale-[0.96] group-data-ending-style/popup:opacity-0 group-data-starting-style/popup:scale-[0.96] group-data-starting-style/popup:opacity-0": !bottom, " group-data-starting-style/popup-scale-[0.96] group-data-ending-style/popup-scale-100 group-data-open/popup:animate-in group-data-closed/popup:animate-out group-data-closed/popup:duration-200 group-data-closed/popup:ease-[cubic-bezier(1,0,0.72,0.32)] group-data-ending-style/popup:translate-y-1/2 group-data-open/popup:duration-pop-hover group-data-open/popup:ease-[cubic-bezier(0.32,0.72,0,1)] group-data-starting-style/popup:translate-y-1/2": bottom }),
669
+ className: cn("pointer-events-auto fixed top-[7px] z-50 transition-all", { "left-4": closePosition === "top-left", "right-4": closePosition === "top-right", "group-data-closed/popup:duration-pop-hover group-data-open/popup:duration-pop-hover group-data-open/popup:ease-pop-hover group-data-closed/popup:ease-out group-data-ending-style/popup:scale-[0.96] group-data-ending-style/popup:opacity-0 group-data-starting-style/popup:scale-[0.96] group-data-starting-style/popup:opacity-0": !bottom, " group-data-starting-style/popup-scale-[0.96] group-data-ending-style/popup-scale-100 group-data-open/popup:animate-in group-data-closed/popup:animate-out group-data-closed/popup:duration-1000 group-data-closed/popup:ease-[cubic-bezier(0.32,0.72,0,1)] group-data-open/popup:duration-500 group-data-open/popup:ease-[cubic-bezier(0.32,0.72,0,1)]": bottom }),
652
670
  "aria-label": "Close",
653
671
  children: [
654
672
  /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" }),
@@ -681,7 +699,7 @@ function DialogFooter({
681
699
  "div",
682
700
  {
683
701
  "data-slot": "dialog-footer",
684
- className: cn("flex flex-col-reverse gap-2 sm:flex-row", className),
702
+ className: cn("flex flex-col-reverse gap-2 sm:flex-row mt-auto", className),
685
703
  ...props,
686
704
  children: [
687
705
  children,
@@ -718,9 +736,9 @@ function DialogBody({ className, children, ...props }) {
718
736
  "div",
719
737
  {
720
738
  "data-slot": "dialog-body",
721
- className: cn("flex shrink-0 grow basis-0 flex-col items-start self-stretch", className),
739
+ className: cn("flex flex-col items-start self-stretch overflow-auto", className),
722
740
  ...props,
723
- children: /* @__PURE__ */ jsx("div", { className: "flex shrink-0 grow basis-0 flex-col items-start gap-10 self-stretch overflow-auto p-4", children })
741
+ children: /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-10 self-stretch overflow-auto p-4 items-stretch", children })
724
742
  }
725
743
  );
726
744
  }
@@ -1147,7 +1165,7 @@ function Input({ className, type, ...props }) {
1147
1165
  type,
1148
1166
  "data-slot": "input",
1149
1167
  className: cn(
1150
- "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
1168
+ "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-sm border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
1151
1169
  "focus-visible:border-ring focus-visible:ring-ring focus-visible:ring-[3px]",
1152
1170
  "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
1153
1171
  className