@parrot-co/parrot-ui 0.1.12 → 0.1.13

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/module.js CHANGED
@@ -3269,17 +3269,29 @@ function $727b3a4d9b39464f$export$e6a97ba2cae5bb94({ items: items, render: rende
3269
3269
 
3270
3270
 
3271
3271
 
3272
- function $4bad2c10a2b6e638$export$c6fdb837b070b4ff({ children: children, state: state, ...props }) {
3272
+ function $4bad2c10a2b6e638$export$c6fdb837b070b4ff({ children: children, state: state, classNames: classNames, styles: styles, variant: variant = "modal", isDismissable: isDismissable = true, ...props }) {
3273
3273
  const modalRef = $hgUW1$useRef(null);
3274
- const { modalProps: modalProps, underlayProps: underlayProps } = (0, $hgUW1$useModalOverlay)(props, // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
3274
+ const { modalProps: modalProps, underlayProps: underlayProps } = (0, $hgUW1$useModalOverlay)({
3275
+ ...props,
3276
+ isDismissable: isDismissable
3277
+ }, // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
3275
3278
  state, modalRef);
3276
3279
  if (!state?.isOpen) return null;
3277
3280
  return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Overlay), {
3278
3281
  children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3279
- className: "p-modal-underlay",
3282
+ style: styles?.underlay,
3283
+ className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
3284
+ "p-modal-underlay",
3285
+ classNames?.underlay
3286
+ ]),
3280
3287
  ...underlayProps,
3281
3288
  children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3282
- className: "p-modal-container",
3289
+ "data-variant": variant,
3290
+ style: styles?.wrapper,
3291
+ className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
3292
+ "p-modal-container",
3293
+ classNames?.wrapper
3294
+ ]),
3283
3295
  ...modalProps,
3284
3296
  ref: modalRef,
3285
3297
  children: children
@@ -3287,23 +3299,23 @@ function $4bad2c10a2b6e638$export$c6fdb837b070b4ff({ children: children, state:
3287
3299
  })
3288
3300
  });
3289
3301
  }
3290
- function $4bad2c10a2b6e638$var$Dialog({ width: width = 400, title: title, onCancel: onCancel, onConfirm: onConfirm, confirmLabel: confirmLabel = "Confirm", cancelLabel: cancelLabel = "Cancel", description: description, children: children, confirmButtonProps: confirmButtonProps, cancelButtonProps: cancelButtonProps, variant: variant = "modal", showCloseButton: showCloseButton = true, onClose: onClose, onOpenChange: onOpenChange, className: className, style: style, hideTitle: hideTitle, ...props }) {
3302
+ function $4bad2c10a2b6e638$var$Dialog({ width: width = 400, title: title, onCancel: onCancel, onConfirm: onConfirm, confirmLabel: confirmLabel = "Confirm", cancelLabel: cancelLabel = "Cancel", description: description, children: children, confirmButtonProps: confirmButtonProps, cancelButtonProps: cancelButtonProps, showCloseButton: showCloseButton = true, onClose: onClose, className: className, style: style, hideTitle: hideTitle, classNames: classNames, styles: styles, state: state, ...props }) {
3291
3303
  const dialogRef = $hgUW1$useRef(null);
3292
3304
  const { dialogProps: dialogProps, titleProps: titleProps } = (0, $hgUW1$useDialog)({
3293
3305
  role: "dialog",
3294
3306
  ...props
3295
3307
  }, dialogRef);
3296
3308
  function handleClose() {
3297
- onOpenChange?.(false);
3309
+ state?.close();
3298
3310
  onClose?.();
3299
3311
  }
3300
3312
  return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3301
3313
  "data-radius": "md",
3302
- className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-modal-content", className),
3303
- "data-variant": variant,
3314
+ className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-modal-content", className, classNames?.content),
3304
3315
  style: {
3305
- minWidth: width,
3306
- ...style
3316
+ width: width,
3317
+ ...style,
3318
+ ...styles?.content
3307
3319
  },
3308
3320
  ref: dialogRef,
3309
3321
  ...dialogProps,
@@ -3313,18 +3325,27 @@ function $4bad2c10a2b6e638$var$Dialog({ width: width = 400, title: title, onCanc
3313
3325
  as: "header",
3314
3326
  justify: "space-between",
3315
3327
  gap: "2xl",
3316
- className: "p-modal-head",
3328
+ style: styles?.header,
3329
+ className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
3330
+ "p-modal-head",
3331
+ classNames?.header
3332
+ ]),
3317
3333
  children: [
3318
3334
  /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
3319
3335
  stack: true,
3320
3336
  gap: "3xs",
3321
3337
  children: [
3322
3338
  title && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $3157c40f7d0e6fa2$export$5f1af8db9871e1d6), {
3339
+ style: styles?.title,
3340
+ className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
3341
+ "p-modal-title",
3342
+ classNames?.title
3343
+ ]),
3323
3344
  weight: "medium",
3324
3345
  size: "md",
3325
3346
  color: "black",
3326
- ...titleProps,
3327
3347
  as: "div",
3348
+ ...titleProps,
3328
3349
  children: title
3329
3350
  }),
3330
3351
  description && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $3157c40f7d0e6fa2$export$5f1af8db9871e1d6), {
@@ -3352,12 +3373,20 @@ function $4bad2c10a2b6e638$var$Dialog({ width: width = 400, title: title, onCanc
3352
3373
  }),
3353
3374
  /*#__PURE__*/ (0, $hgUW1$jsx)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
3354
3375
  stack: true,
3355
- className: "p-modal-body",
3376
+ className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
3377
+ "p-modal-body",
3378
+ classNames?.body
3379
+ ]),
3380
+ style: styles?.body,
3356
3381
  children: children
3357
3382
  }),
3358
3383
  (onConfirm || onCancel) && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
3359
3384
  as: "footer",
3360
- className: "p-modal-footer",
3385
+ style: styles?.footer,
3386
+ className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
3387
+ "p-modal-footer",
3388
+ classNames?.footer
3389
+ ]),
3361
3390
  gap: "xs",
3362
3391
  justify: "end",
3363
3392
  stretchX: true,