@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/module.js CHANGED
@@ -675,10 +675,11 @@ function $095d89378519ff08$export$a455218a85c89869({ label: label, description:
675
675
  $095d89378519ff08$export$a455218a85c89869.displayName = "Field";
676
676
 
677
677
 
678
- function $ef10b8551376ecd8$export$f5b8910cec6cf069({ className: className, classNames: classNames, style: style, styles: styles, inputRef: inputRef, ...props }) {
678
+ function $ef10b8551376ecd8$export$f5b8910cec6cf069({ className: className, classNames: classNames, style: style, styles: styles, onChange: onChange, inputRef: inputRef, ...props }) {
679
679
  const internalInputRef = (0, $hgUW1$react).useRef(null);
680
680
  const { labelProps: labelProps, inputProps: inputProps, errorMessageProps: errorMessageProps, descriptionProps: descriptionProps } = (0, $hgUW1$useTextField)({
681
681
  ...props,
682
+ onChange: onChange,
682
683
  inputElementType: "input"
683
684
  }, internalInputRef);
684
685
  return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $095d89378519ff08$export$a455218a85c89869), {
@@ -691,7 +692,7 @@ function $ef10b8551376ecd8$export$f5b8910cec6cf069({ className: className, class
691
692
  style: style,
692
693
  ...props,
693
694
  children: /*#__PURE__*/ (0, $hgUW1$jsx)("input", {
694
- ref: (0, $cce662c1d2ec881b$export$c9058316764c140e)(internalInputRef, inputRef),
695
+ ref: (0, $cce662c1d2ec881b$export$c9058316764c140e)(inputRef, internalInputRef),
695
696
  "data-has-left-addon": !!props.prepend,
696
697
  "data-has-right-addon": !!props.append,
697
698
  className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-text-input-el"),
@@ -922,12 +923,13 @@ $e3f71af5eaf1c216$export$c25acd513dcc8062.displayName = "IconButton";
922
923
 
923
924
 
924
925
 
925
- function $2e89c7375b40283e$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 }) {
926
+ function $2e89c7375b40283e$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 }) {
926
927
  const ariaProps = {
927
928
  ...props,
928
929
  maxValue: maxValue,
929
930
  formatOptions: formatOptions,
930
931
  minValue: minValue,
932
+ onChange: onChange,
931
933
  "aria-label": props["aria-label"] ?? "number input"
932
934
  };
933
935
  const space = (0, $41cc567ab0625f8f$export$450c36e0b0e62ccd)();
@@ -3267,17 +3269,29 @@ function $727b3a4d9b39464f$export$e6a97ba2cae5bb94({ items: items, render: rende
3267
3269
 
3268
3270
 
3269
3271
 
3270
- 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 }) {
3271
3273
  const modalRef = $hgUW1$useRef(null);
3272
- 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
3273
3278
  state, modalRef);
3274
3279
  if (!state?.isOpen) return null;
3275
3280
  return /*#__PURE__*/ (0, $hgUW1$jsx)((0, $hgUW1$Overlay), {
3276
3281
  children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3277
- className: "p-modal-underlay",
3282
+ style: styles?.underlay,
3283
+ className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
3284
+ "p-modal-underlay",
3285
+ classNames?.underlay
3286
+ ]),
3278
3287
  ...underlayProps,
3279
3288
  children: /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3280
- 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
+ ]),
3281
3295
  ...modalProps,
3282
3296
  ref: modalRef,
3283
3297
  children: children
@@ -3285,23 +3299,23 @@ function $4bad2c10a2b6e638$export$c6fdb837b070b4ff({ children: children, state:
3285
3299
  })
3286
3300
  });
3287
3301
  }
3288
- 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 }) {
3289
3303
  const dialogRef = $hgUW1$useRef(null);
3290
3304
  const { dialogProps: dialogProps, titleProps: titleProps } = (0, $hgUW1$useDialog)({
3291
3305
  role: "dialog",
3292
3306
  ...props
3293
3307
  }, dialogRef);
3294
3308
  function handleClose() {
3295
- onOpenChange?.(false);
3309
+ state?.close();
3296
3310
  onClose?.();
3297
3311
  }
3298
3312
  return /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
3299
3313
  "data-radius": "md",
3300
- className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-modal-content", className),
3301
- "data-variant": variant,
3314
+ className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)("p-modal-content", className, classNames?.content),
3302
3315
  style: {
3303
- minWidth: width,
3304
- ...style
3316
+ width: width,
3317
+ ...style,
3318
+ ...styles?.content
3305
3319
  },
3306
3320
  ref: dialogRef,
3307
3321
  ...dialogProps,
@@ -3311,18 +3325,27 @@ function $4bad2c10a2b6e638$var$Dialog({ width: width = 400, title: title, onCanc
3311
3325
  as: "header",
3312
3326
  justify: "space-between",
3313
3327
  gap: "2xl",
3314
- className: "p-modal-head",
3328
+ style: styles?.header,
3329
+ className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
3330
+ "p-modal-head",
3331
+ classNames?.header
3332
+ ]),
3315
3333
  children: [
3316
3334
  /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
3317
3335
  stack: true,
3318
3336
  gap: "3xs",
3319
3337
  children: [
3320
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
+ ]),
3321
3344
  weight: "medium",
3322
3345
  size: "md",
3323
3346
  color: "black",
3324
- ...titleProps,
3325
3347
  as: "div",
3348
+ ...titleProps,
3326
3349
  children: title
3327
3350
  }),
3328
3351
  description && /*#__PURE__*/ (0, $hgUW1$jsx)((0, $3157c40f7d0e6fa2$export$5f1af8db9871e1d6), {
@@ -3350,12 +3373,20 @@ function $4bad2c10a2b6e638$var$Dialog({ width: width = 400, title: title, onCanc
3350
3373
  }),
3351
3374
  /*#__PURE__*/ (0, $hgUW1$jsx)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
3352
3375
  stack: true,
3353
- className: "p-modal-body",
3376
+ className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
3377
+ "p-modal-body",
3378
+ classNames?.body
3379
+ ]),
3380
+ style: styles?.body,
3354
3381
  children: children
3355
3382
  }),
3356
3383
  (onConfirm || onCancel) && /*#__PURE__*/ (0, $hgUW1$jsxs)((0, $e2f278d76a00796a$export$f51f4c4ede09e011), {
3357
3384
  as: "footer",
3358
- className: "p-modal-footer",
3385
+ style: styles?.footer,
3386
+ className: (0, $cce662c1d2ec881b$export$a274e22fb40f762e)([
3387
+ "p-modal-footer",
3388
+ classNames?.footer
3389
+ ]),
3359
3390
  gap: "xs",
3360
3391
  justify: "end",
3361
3392
  stretchX: true,