@parrot-co/parrot-ui 0.1.12 → 0.1.14

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
@@ -418,10 +418,6 @@ const $8ddcc69383feb36a$export$b4e0e71242920c6a = {
418
418
  pill: "full",
419
419
  rounded: undefined
420
420
  };
421
- function $8ddcc69383feb36a$var$ps(styles) {
422
- // 1. iterate over the keys of the styles object
423
- // 2. for each key, check is is valid css property
424
- }
425
421
 
426
422
 
427
423
  function $4af7da5c7dd0b9c2$export$1c4d39b152e0f791(deprecatedProp, newProp, value) {
@@ -653,6 +649,9 @@ function $eae337549f49a5a2$export$450c36e0b0e62ccd() {
653
649
  const $f2fd0cbe11b7f0dd$var$ThemeContext = /*#__PURE__*/ $8zHUo$react.createContext(null);
654
650
  function $f2fd0cbe11b7f0dd$export$d8964aec282183a3(props) {
655
651
  const { children: children, className: className, scaling: scaling = "100%", ...themeProps } = props;
652
+ $8zHUo$react.useEffect(()=>{
653
+ document.body.classList.add("dark");
654
+ });
656
655
  return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)($f2fd0cbe11b7f0dd$var$ThemeContext.Provider, {
657
656
  value: themeProps,
658
657
  children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", {
@@ -2081,15 +2080,15 @@ $71fcf48f7e2e9427$export$f8afaea2e9656b91.displayName = "RadioCard";
2081
2080
 
2082
2081
 
2083
2082
 
2084
-
2085
- const $cfadb0728cf907ff$export$3288d34c523a1192 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$react))).forwardRef(({ prepend: prepend, append: append, children: children, hashValue: hashValue, color: color, size: size = "sm", shape: shape = "rounded", variant: variant = "light", className: className, ...props }, ref)=>{
2083
+ const $cfadb0728cf907ff$export$3288d34c523a1192 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$react))).forwardRef(({ prepend: prepend, append: append, children: children, hashValue: hashValue, color: color, size: size = "sm", shape: /**@deprecated use radius instead */ shape = "rounded", variant: variant = "light", className: className, radius: radius = "full", ...props }, ref)=>{
2084
+ (0, $4af7da5c7dd0b9c2$export$1c4d39b152e0f791)("shape", "radius", shape);
2086
2085
  const randomColor = (0, ($parcel$interopDefault($8zHUo$react))).useMemo(()=>{
2087
2086
  if (hashValue) return (0, $4af7da5c7dd0b9c2$export$e4369cabd7e84cd9)(hashValue);
2088
2087
  return "gray";
2089
2088
  }, []);
2090
2089
  return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)("span", {
2091
2090
  className: (0, $62f1c614c0962470$export$a274e22fb40f762e)(className, "p-tag"),
2092
- "data-radius": (0, $8ddcc69383feb36a$export$b4e0e71242920c6a)[shape],
2091
+ "data-radius": radius,
2093
2092
  "data-size": size,
2094
2093
  "data-color": color ?? randomColor,
2095
2094
  "data-variant": variant,
@@ -2629,7 +2628,7 @@ $e0a58c83d4c36e4e$export$7edc06cf1783b30f.displayName = "DateInput";
2629
2628
 
2630
2629
 
2631
2630
 
2632
- const $2fdd5844efb4cca1$export$e2255cf6045e8d47 = /*#__PURE__*/ $8zHUo$react.forwardRef(({ src: src, alt: alt, name: name, color: color, variant: variant = "light", fallback: fallback, children: children, size: size = "md", shape: shape, className: className, radius: radius = "lg", classNames: classNames, styles: styles, style: style, ...props }, ref)=>{
2631
+ const $2fdd5844efb4cca1$export$e2255cf6045e8d47 = /*#__PURE__*/ $8zHUo$react.forwardRef(({ src: src, alt: alt, name: name, color: color, variant: variant = "light", fallback: fallback, children: children, size: size = "md", shape: shape, className: className, radius: radius = "full", classNames: classNames, styles: styles, style: style, ...props }, ref)=>{
2633
2632
  const [imageError, setImageError] = $8zHUo$react.useState(false);
2634
2633
  const theme = (0, $f2fd0cbe11b7f0dd$export$93d4e7f90805808f)();
2635
2634
  function getAvatarRadius() {
@@ -3336,17 +3335,29 @@ function $9ff025417b0a683c$export$e6a97ba2cae5bb94({ items: items, render: rende
3336
3335
 
3337
3336
 
3338
3337
 
3339
- function $1278141024f0bc4d$export$c6fdb837b070b4ff({ children: children, state: state, ...props }) {
3338
+ function $1278141024f0bc4d$export$c6fdb837b070b4ff({ children: children, state: state, classNames: classNames, styles: styles, variant: variant = "modal", isDismissable: isDismissable = true, ...props }) {
3340
3339
  const modalRef = $8zHUo$react.useRef(null);
3341
- const { modalProps: modalProps, underlayProps: underlayProps } = (0, $8zHUo$reactaria.useModalOverlay)(props, // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
3340
+ const { modalProps: modalProps, underlayProps: underlayProps } = (0, $8zHUo$reactaria.useModalOverlay)({
3341
+ ...props,
3342
+ isDismissable: isDismissable
3343
+ }, // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
3342
3344
  state, modalRef);
3343
3345
  if (!state?.isOpen) return null;
3344
3346
  return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $8zHUo$reactaria.Overlay), {
3345
3347
  children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", {
3346
- className: "p-modal-underlay",
3348
+ style: styles?.underlay,
3349
+ className: (0, $62f1c614c0962470$export$a274e22fb40f762e)([
3350
+ "p-modal-underlay",
3351
+ classNames?.underlay
3352
+ ]),
3347
3353
  ...underlayProps,
3348
3354
  children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", {
3349
- className: "p-modal-container",
3355
+ "data-variant": variant,
3356
+ style: styles?.wrapper,
3357
+ className: (0, $62f1c614c0962470$export$a274e22fb40f762e)([
3358
+ "p-modal-container",
3359
+ classNames?.wrapper
3360
+ ]),
3350
3361
  ...modalProps,
3351
3362
  ref: modalRef,
3352
3363
  children: children
@@ -3354,23 +3365,23 @@ function $1278141024f0bc4d$export$c6fdb837b070b4ff({ children: children, state:
3354
3365
  })
3355
3366
  });
3356
3367
  }
3357
- 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 }) {
3368
+ 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 }) {
3358
3369
  const dialogRef = $8zHUo$react.useRef(null);
3359
3370
  const { dialogProps: dialogProps, titleProps: titleProps } = (0, $8zHUo$reactaria.useDialog)({
3360
3371
  role: "dialog",
3361
3372
  ...props
3362
3373
  }, dialogRef);
3363
3374
  function handleClose() {
3364
- onOpenChange?.(false);
3375
+ state?.close();
3365
3376
  onClose?.();
3366
3377
  }
3367
3378
  return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)("div", {
3368
3379
  "data-radius": "md",
3369
- className: (0, $62f1c614c0962470$export$a274e22fb40f762e)("p-modal-content", className),
3370
- "data-variant": variant,
3380
+ className: (0, $62f1c614c0962470$export$a274e22fb40f762e)("p-modal-content", className, classNames?.content),
3371
3381
  style: {
3372
- minWidth: width,
3373
- ...style
3382
+ width: width,
3383
+ ...style,
3384
+ ...styles?.content
3374
3385
  },
3375
3386
  ref: dialogRef,
3376
3387
  ...dialogProps,
@@ -3380,18 +3391,27 @@ function $1278141024f0bc4d$var$Dialog({ width: width = 400, title: title, onCanc
3380
3391
  as: "header",
3381
3392
  justify: "space-between",
3382
3393
  gap: "2xl",
3383
- className: "p-modal-head",
3394
+ style: styles?.header,
3395
+ className: (0, $62f1c614c0962470$export$a274e22fb40f762e)([
3396
+ "p-modal-head",
3397
+ classNames?.header
3398
+ ]),
3384
3399
  children: [
3385
3400
  /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), {
3386
3401
  stack: true,
3387
3402
  gap: "3xs",
3388
3403
  children: [
3389
3404
  title && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $88fa102d91bf323a$export$5f1af8db9871e1d6), {
3405
+ style: styles?.title,
3406
+ className: (0, $62f1c614c0962470$export$a274e22fb40f762e)([
3407
+ "p-modal-title",
3408
+ classNames?.title
3409
+ ]),
3390
3410
  weight: "medium",
3391
3411
  size: "md",
3392
3412
  color: "black",
3393
- ...titleProps,
3394
3413
  as: "div",
3414
+ ...titleProps,
3395
3415
  children: title
3396
3416
  }),
3397
3417
  description && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $88fa102d91bf323a$export$5f1af8db9871e1d6), {
@@ -3419,12 +3439,20 @@ function $1278141024f0bc4d$var$Dialog({ width: width = 400, title: title, onCanc
3419
3439
  }),
3420
3440
  /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), {
3421
3441
  stack: true,
3422
- className: "p-modal-body",
3442
+ className: (0, $62f1c614c0962470$export$a274e22fb40f762e)([
3443
+ "p-modal-body",
3444
+ classNames?.body
3445
+ ]),
3446
+ style: styles?.body,
3423
3447
  children: children
3424
3448
  }),
3425
3449
  (onConfirm || onCancel) && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), {
3426
3450
  as: "footer",
3427
- className: "p-modal-footer",
3451
+ style: styles?.footer,
3452
+ className: (0, $62f1c614c0962470$export$a274e22fb40f762e)([
3453
+ "p-modal-footer",
3454
+ classNames?.footer
3455
+ ]),
3428
3456
  gap: "xs",
3429
3457
  justify: "end",
3430
3458
  stretchX: true,