@olwiba/cn 0.1.41 → 0.1.43

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.d.ts CHANGED
@@ -410,6 +410,15 @@ type DialogContentProps = React$1.ComponentPropsWithoutRef<typeof DialogPrimitiv
410
410
  * centred dialog geometry from `sm` upward.
411
411
  */
412
412
  presentation?: DialogPresentation;
413
+ /**
414
+ * Whether the corner close button renders.
415
+ *
416
+ * Leave it on for anything the reader might want out of quickly. Turn it off
417
+ * only when the dialog already ends in an obvious way out, where a second
418
+ * control in the corner is one exit too many. Escape and clicking the
419
+ * overlay still close it either way, so this costs no accessibility.
420
+ */
421
+ showCloseButton?: boolean;
413
422
  };
414
423
  declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
415
424
  mode?: DialogMode;
@@ -421,6 +430,15 @@ declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<DialogPrimit
421
430
  * centred dialog geometry from `sm` upward.
422
431
  */
423
432
  presentation?: DialogPresentation;
433
+ /**
434
+ * Whether the corner close button renders.
435
+ *
436
+ * Leave it on for anything the reader might want out of quickly. Turn it off
437
+ * only when the dialog already ends in an obvious way out, where a second
438
+ * control in the corner is one exit too many. Escape and clicking the
439
+ * overlay still close it either way, so this costs no accessibility.
440
+ */
441
+ showCloseButton?: boolean;
424
442
  } & React$1.RefAttributes<HTMLDivElement>>;
425
443
  declare const DialogHeader: {
426
444
  ({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
package/dist/index.js CHANGED
@@ -1551,7 +1551,7 @@ var DialogOverlay = React38.forwardRef(({ className, ...props }, ref) => /* @__P
1551
1551
  }
1552
1552
  ));
1553
1553
  DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
1554
- var DialogContent = React38.forwardRef(({ className, mode: modeProp, presentation = "default", children, ...props }, ref) => {
1554
+ var DialogContent = React38.forwardRef(({ className, mode: modeProp, presentation = "default", showCloseButton = true, children, ...props }, ref) => {
1555
1555
  const mode = modeProp ?? useUIVariant();
1556
1556
  return /* @__PURE__ */ jsxs(DialogPortal, { children: [
1557
1557
  /* @__PURE__ */ jsx(DialogOverlay, { className: mode === "glass" ? "bg-black/40" : void 0 }),
@@ -1572,7 +1572,7 @@ var DialogContent = React38.forwardRef(({ className, mode: modeProp, presentatio
1572
1572
  ...props,
1573
1573
  children: /* @__PURE__ */ jsxs(UIVariantProvider, { mode, children: [
1574
1574
  children,
1575
- /* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
1575
+ showCloseButton && /* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
1576
1576
  /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
1577
1577
  /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
1578
1578
  ] })