@parrot-co/parrot-ui 0.1.11 → 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/main.js CHANGED
@@ -742,10 +742,11 @@ function $ec2376a5dd0d13e6$export$a455218a85c89869({ label: label, description:
742
742
  $ec2376a5dd0d13e6$export$a455218a85c89869.displayName = "Field";
743
743
 
744
744
 
745
- function $d9ffc65197682590$export$f5b8910cec6cf069({ className: className, classNames: classNames, style: style, styles: styles, inputRef: inputRef, ...props }) {
745
+ function $d9ffc65197682590$export$f5b8910cec6cf069({ className: className, classNames: classNames, style: style, styles: styles, onChange: onChange, inputRef: inputRef, ...props }) {
746
746
  const internalInputRef = (0, ($parcel$interopDefault($8zHUo$react))).useRef(null);
747
747
  const { labelProps: labelProps, inputProps: inputProps, errorMessageProps: errorMessageProps, descriptionProps: descriptionProps } = (0, $8zHUo$reactaria.useTextField)({
748
748
  ...props,
749
+ onChange: onChange,
749
750
  inputElementType: "input"
750
751
  }, internalInputRef);
751
752
  return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $ec2376a5dd0d13e6$export$a455218a85c89869), {
@@ -758,7 +759,7 @@ function $d9ffc65197682590$export$f5b8910cec6cf069({ className: className, class
758
759
  style: style,
759
760
  ...props,
760
761
  children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("input", {
761
- ref: (0, $62f1c614c0962470$export$c9058316764c140e)(internalInputRef, inputRef),
762
+ ref: (0, $62f1c614c0962470$export$c9058316764c140e)(inputRef, internalInputRef),
762
763
  "data-has-left-addon": !!props.prepend,
763
764
  "data-has-right-addon": !!props.append,
764
765
  className: (0, $62f1c614c0962470$export$a274e22fb40f762e)("p-text-input-el"),
@@ -989,12 +990,13 @@ $3af04cd154cf4de1$export$c25acd513dcc8062.displayName = "IconButton";
989
990
 
990
991
 
991
992
 
992
- function $77c71203b3212c65$export$6bf0cd3a219bbade({ appearance: appearance = "outline", size: size = "md", color: color = "gray", classNames: classNames, styles: styles, append: append, prepend: prepend, placeholder: placeholder, showSteppers: showSteppers = false, error: error, label: label, minValue: minValue, maxValue: maxValue, formatOptions: formatOptions, inputRef: inputRef, incrementIcon: incrementIcon, decrementIcon: decrementIcon, ...props }) {
993
+ function $77c71203b3212c65$export$6bf0cd3a219bbade({ appearance: appearance = "outline", size: size = "md", color: color = "gray", classNames: classNames, styles: styles, append: append, prepend: prepend, placeholder: placeholder, showSteppers: showSteppers = false, error: error, label: label, minValue: minValue, maxValue: maxValue, formatOptions: formatOptions, inputRef: inputRef, incrementIcon: incrementIcon, decrementIcon: decrementIcon, onChange: onChange, ...props }) {
993
994
  const ariaProps = {
994
995
  ...props,
995
996
  maxValue: maxValue,
996
997
  formatOptions: formatOptions,
997
998
  minValue: minValue,
999
+ onChange: onChange,
998
1000
  "aria-label": props["aria-label"] ?? "number input"
999
1001
  };
1000
1002
  const space = (0, $eae337549f49a5a2$export$450c36e0b0e62ccd)();
@@ -3334,17 +3336,29 @@ function $9ff025417b0a683c$export$e6a97ba2cae5bb94({ items: items, render: rende
3334
3336
 
3335
3337
 
3336
3338
 
3337
- function $1278141024f0bc4d$export$c6fdb837b070b4ff({ children: children, state: state, ...props }) {
3339
+ function $1278141024f0bc4d$export$c6fdb837b070b4ff({ children: children, state: state, classNames: classNames, styles: styles, variant: variant = "modal", isDismissable: isDismissable = true, ...props }) {
3338
3340
  const modalRef = $8zHUo$react.useRef(null);
3339
- const { modalProps: modalProps, underlayProps: underlayProps } = (0, $8zHUo$reactaria.useModalOverlay)(props, // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
3341
+ const { modalProps: modalProps, underlayProps: underlayProps } = (0, $8zHUo$reactaria.useModalOverlay)({
3342
+ ...props,
3343
+ isDismissable: isDismissable
3344
+ }, // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
3340
3345
  state, modalRef);
3341
3346
  if (!state?.isOpen) return null;
3342
3347
  return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $8zHUo$reactaria.Overlay), {
3343
3348
  children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", {
3344
- className: "p-modal-underlay",
3349
+ style: styles?.underlay,
3350
+ className: (0, $62f1c614c0962470$export$a274e22fb40f762e)([
3351
+ "p-modal-underlay",
3352
+ classNames?.underlay
3353
+ ]),
3345
3354
  ...underlayProps,
3346
3355
  children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", {
3347
- className: "p-modal-container",
3356
+ "data-variant": variant,
3357
+ style: styles?.wrapper,
3358
+ className: (0, $62f1c614c0962470$export$a274e22fb40f762e)([
3359
+ "p-modal-container",
3360
+ classNames?.wrapper
3361
+ ]),
3348
3362
  ...modalProps,
3349
3363
  ref: modalRef,
3350
3364
  children: children
@@ -3352,23 +3366,23 @@ function $1278141024f0bc4d$export$c6fdb837b070b4ff({ children: children, state:
3352
3366
  })
3353
3367
  });
3354
3368
  }
3355
- function $1278141024f0bc4d$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 }) {
3369
+ function $1278141024f0bc4d$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 }) {
3356
3370
  const dialogRef = $8zHUo$react.useRef(null);
3357
3371
  const { dialogProps: dialogProps, titleProps: titleProps } = (0, $8zHUo$reactaria.useDialog)({
3358
3372
  role: "dialog",
3359
3373
  ...props
3360
3374
  }, dialogRef);
3361
3375
  function handleClose() {
3362
- onOpenChange?.(false);
3376
+ state?.close();
3363
3377
  onClose?.();
3364
3378
  }
3365
3379
  return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)("div", {
3366
3380
  "data-radius": "md",
3367
- className: (0, $62f1c614c0962470$export$a274e22fb40f762e)("p-modal-content", className),
3368
- "data-variant": variant,
3381
+ className: (0, $62f1c614c0962470$export$a274e22fb40f762e)("p-modal-content", className, classNames?.content),
3369
3382
  style: {
3370
- minWidth: width,
3371
- ...style
3383
+ width: width,
3384
+ ...style,
3385
+ ...styles?.content
3372
3386
  },
3373
3387
  ref: dialogRef,
3374
3388
  ...dialogProps,
@@ -3378,18 +3392,27 @@ function $1278141024f0bc4d$var$Dialog({ width: width = 400, title: title, onCanc
3378
3392
  as: "header",
3379
3393
  justify: "space-between",
3380
3394
  gap: "2xl",
3381
- className: "p-modal-head",
3395
+ style: styles?.header,
3396
+ className: (0, $62f1c614c0962470$export$a274e22fb40f762e)([
3397
+ "p-modal-head",
3398
+ classNames?.header
3399
+ ]),
3382
3400
  children: [
3383
3401
  /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), {
3384
3402
  stack: true,
3385
3403
  gap: "3xs",
3386
3404
  children: [
3387
3405
  title && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $88fa102d91bf323a$export$5f1af8db9871e1d6), {
3406
+ style: styles?.title,
3407
+ className: (0, $62f1c614c0962470$export$a274e22fb40f762e)([
3408
+ "p-modal-title",
3409
+ classNames?.title
3410
+ ]),
3388
3411
  weight: "medium",
3389
3412
  size: "md",
3390
3413
  color: "black",
3391
- ...titleProps,
3392
3414
  as: "div",
3415
+ ...titleProps,
3393
3416
  children: title
3394
3417
  }),
3395
3418
  description && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $88fa102d91bf323a$export$5f1af8db9871e1d6), {
@@ -3417,12 +3440,20 @@ function $1278141024f0bc4d$var$Dialog({ width: width = 400, title: title, onCanc
3417
3440
  }),
3418
3441
  /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), {
3419
3442
  stack: true,
3420
- className: "p-modal-body",
3443
+ className: (0, $62f1c614c0962470$export$a274e22fb40f762e)([
3444
+ "p-modal-body",
3445
+ classNames?.body
3446
+ ]),
3447
+ style: styles?.body,
3421
3448
  children: children
3422
3449
  }),
3423
3450
  (onConfirm || onCancel) && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), {
3424
3451
  as: "footer",
3425
- className: "p-modal-footer",
3452
+ style: styles?.footer,
3453
+ className: (0, $62f1c614c0962470$export$a274e22fb40f762e)([
3454
+ "p-modal-footer",
3455
+ classNames?.footer
3456
+ ]),
3426
3457
  gap: "xs",
3427
3458
  justify: "end",
3428
3459
  stretchX: true,