UNPKG

@parrot-co/parrot-ui

Version:

React UI components by Parrot built on top of react-aria (https://react-spectrum.adobe.com/react-aria/index.html

1,284 lines (1,117 loc) 192 kB
var $8zHUo$reactjsxruntime = require("react/jsx-runtime"); var $8zHUo$react = require("react"); var $8zHUo$reactaria = require("react-aria"); var $8zHUo$reactstately = require("react-stately"); var $8zHUo$reacticonshi = require("react-icons/hi"); var $8zHUo$internationalizeddate = require("@internationalized/date"); var $8zHUo$reactstatelycolor = require("@react-stately/color"); var $8zHUo$reactariacolor = require("@react-aria/color"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true}); } function $parcel$interopDefault(a) { return a && a.__esModule ? a.default : a; } $parcel$export(module.exports, "Box", () => $eb8f27c3596a0e6b$export$e71c4d32a2263218); $parcel$export(module.exports, "Grid", () => $df66c26cdcece32b$export$ef2184bd89960b14); $parcel$export(module.exports, "GridItem", () => $df66c26cdcece32b$export$9eb849b9b922d396); $parcel$export(module.exports, "Flex", () => $c3a954a7c0cb5109$export$f51f4c4ede09e011); $parcel$export(module.exports, "Input", () => $d9ffc65197682590$export$f5b8910cec6cf069); $parcel$export(module.exports, "NumberInput", () => $77c71203b3212c65$export$6bf0cd3a219bbade); $parcel$export(module.exports, "Text", () => $88fa102d91bf323a$export$5f1af8db9871e1d6); $parcel$export(module.exports, "Textarea", () => $491b98ef80f40f98$export$379139ebc1c2b235); $parcel$export(module.exports, "Button", () => $5a6f28f3fd58ff6e$export$353f5b6fc5456de1); $parcel$export(module.exports, "IconButton", () => $3af04cd154cf4de1$export$c25acd513dcc8062); $parcel$export(module.exports, "ButtonGroup", () => $7f70742e736041ff$export$69b1032f2ecdf404); $parcel$export(module.exports, "Checkbox", () => $f88e10ca2ba68239$export$48513f6b9f8ce62d); $parcel$export(module.exports, "CheckboxGroup", () => $0f8ef6f4acac1766$export$4aa08d5625cb8ead); $parcel$export(module.exports, "CheckboxItem", () => $c31ad898a2916b00$export$16ce288f89fa631c); $parcel$export(module.exports, "DropdownMenu", () => $3b903582a5253460$export$e44a253a59704894); $parcel$export(module.exports, "ComboBox", () => $d67a8dc6cbdaa7ed$export$72b9695b8216309a); $parcel$export(module.exports, "Radio", () => $e158c5cf7e190200$export$d7b12c4107be0d61); $parcel$export(module.exports, "RadioGroup", () => $e158c5cf7e190200$export$a98f0dcb43a68a25); $parcel$export(module.exports, "RadioCard", () => $71fcf48f7e2e9427$export$f8afaea2e9656b91); $parcel$export(module.exports, "RadioItem", () => $60c8e601ab261224$export$371ab307eab489c0); $parcel$export(module.exports, "Select", () => $e37831ebf64d8e7d$export$ef9b1a59e592288f); $parcel$export(module.exports, "Option", () => $86685406b084d356$export$5b7f4051a57920d0); $parcel$export(module.exports, "Section", () => $86685406b084d356$export$ef146090a6472d9e); $parcel$export(module.exports, "ListBoxItem", () => $86685406b084d356$export$5b7f4051a57920d0); $parcel$export(module.exports, "ListBoxSection", () => $86685406b084d356$export$ef146090a6472d9e); $parcel$export(module.exports, "ListBox", () => $dcfc4542aa84c062$export$41f133550aa26f48); $parcel$export(module.exports, "DateInput", () => $e0a58c83d4c36e4e$export$7edc06cf1783b30f); $parcel$export(module.exports, "Calendar", () => $284d30e280d297d3$export$e1aef45b828286de); $parcel$export(module.exports, "Avatar", () => $2fdd5844efb4cca1$export$e2255cf6045e8d47); $parcel$export(module.exports, "FileUploader", () => $5f87818f4e8f8603$export$1a5cb5295a7d2749); $parcel$export(module.exports, "Separator", () => $9e8a15ca4065ce60$export$1ff3c3f08ae963c0); $parcel$export(module.exports, "Progress", () => $e04b6210b7063851$export$b25a304ec7d746bb); $parcel$export(module.exports, "Loader", () => $a28e128499dd0b02$export$3b0d6d7590275603); $parcel$export(module.exports, "Tag", () => $cfadb0728cf907ff$export$3288d34c523a1192); $parcel$export(module.exports, "Switch", () => $c5c6f63b49c9056a$export$b5d5cf8927ab7262); $parcel$export(module.exports, "Slider", () => $a945a7e4eb75da9e$export$472062a354075cee); $parcel$export(module.exports, "IconTray", () => $43de550aebbf1320$export$50e381fea3a45244); $parcel$export(module.exports, "Sticker", () => $fedef2bba4e6812a$export$ea98c603db73aee7); $parcel$export(module.exports, "Tabs", () => $6c55ad3905040a74$export$b2539bed5023c21c); $parcel$export(module.exports, "Tab", () => $6c55ad3905040a74$export$6d08773d2e66f8f2); $parcel$export(module.exports, "Table", () => $9fcb37cb330ef9cd$export$54ec01a60f47d33d); $parcel$export(module.exports, "Timeline", () => $9ff025417b0a683c$export$e6a97ba2cae5bb94); $parcel$export(module.exports, "Modal", () => $1278141024f0bc4d$export$2b77a92f1a5ad772); $parcel$export(module.exports, "useModal", () => $1278141024f0bc4d$export$33ffd74ebf07f060); $parcel$export(module.exports, "Space", () => $eae337549f49a5a2$export$eef1e68107c58ef2); $parcel$export(module.exports, "TagInput", () => $0cdc620c9e9fb79f$export$39299b56cfd4e361); $parcel$export(module.exports, "Popover", () => $0f347092d3465402$export$5b6b19405a83ff9d); $parcel$export(module.exports, "PopoverContent", () => $0f347092d3465402$export$d7e1f420b25549ff); $parcel$export(module.exports, "PopoverTrigger", () => $0f347092d3465402$export$7dacb05d26466c3); $parcel$export(module.exports, "TagGroup", () => $d26053f02b9f370b$export$67ea30858aaf75e3); $parcel$export(module.exports, "TagGroupItem", () => $d26053f02b9f370b$export$a79147a60006308c); $parcel$export(module.exports, "ThemeProvider", () => $f2fd0cbe11b7f0dd$export$d8964aec282183a3); $parcel$export(module.exports, "useTheme", () => $f2fd0cbe11b7f0dd$export$93d4e7f90805808f); $parcel$export(module.exports, "ColorArea", () => $ce7da1514c7ab67c$export$b2103f68a961418e); $parcel$export(module.exports, "ColorField", () => $ca14d49a10ed918f$export$b865d4358897bb17); $parcel$export(module.exports, "ColorPicker", () => $b4c448f742efa2a7$export$9feb1bc2e5f1ccb3); $parcel$export(module.exports, "ColorSlider", () => $7796dcb4fe09bf12$export$44fd664bcca5b6fb); $parcel$export(module.exports, "ColorSwatchPicker", () => $799f02b9b0e744b9$export$b46792416e3d8515); $parcel$export(module.exports, "parseColor", () => $e93fd810053d36a8$export$6e865ea70d7724f); $parcel$export(module.exports, "Toggle", () => $fcb2cacda3f71fdc$export$bea8ebba691c5813); $parcel$export(module.exports, "ToggleGroup", () => $fcb2cacda3f71fdc$export$af3ec21f6cfb5e30); function $d99c85a751d7ffbd$export$7e4aa119212bc614(value) { return typeof value === "number"; } function $d99c85a751d7ffbd$export$43bee75e5e14138e(value) { return value !== null && Array.isArray(value); } function $d99c85a751d7ffbd$export$4c0262a4f954db45(value) { return $d99c85a751d7ffbd$export$43bee75e5e14138e(value) && value.length === 0; } function $d99c85a751d7ffbd$export$a6cdc56e425d0d0a(value) { return (typeof value === "object" || typeof value === "function") && !Array.isArray(value) && value !== null; } function $d99c85a751d7ffbd$export$83b788b1a3698c03(value) { return $d99c85a751d7ffbd$export$a6cdc56e425d0d0a(value) && Object.keys(value).length === 0; } function $d99c85a751d7ffbd$export$36496bb54b8933da(value) { return Object.values(value).filter((value)=>{ return value === "" || value === undefined || value === null; }).length > 0; } function $d99c85a751d7ffbd$export$ae45edb09e2fe7c2(value) { return value == null; } function $d99c85a751d7ffbd$export$fce6876652108ab(value) { return value === undefined; } // cns("p-button", {space: true, firs-item:false}, className, [className], ()=>"hello world") function $62f1c614c0962470$var$processClassValue(value) { if (!value) return null; if (typeof value === "function") return $62f1c614c0962470$var$processClassValue(value?.()); if ((0, $d99c85a751d7ffbd$export$43bee75e5e14138e)(value)) { let i = 0; let temp = ""; while(i < value.length){ const result = $62f1c614c0962470$var$processClassValue(value[i++]); if (result) { temp && (temp += " "); temp += `${result}`; } } return temp; } if ((0, $d99c85a751d7ffbd$export$a6cdc56e425d0d0a)(value)) { let str = ""; for(const key in value)if (value[key]) { str && (str += " "); str += `${key}`; } return str; } return value; } function $62f1c614c0962470$export$a274e22fb40f762e(...args) { let i = 0; let classStr = ""; while(i < args.length){ const result = $62f1c614c0962470$var$processClassValue(args[i++]); if (result) { classStr && (classStr += " "); classStr += result; } } return classStr; } function $62f1c614c0962470$export$c9058316764c140e(...refs) { return (node)=>{ for (const ref of refs){ if (typeof ref === "function") ref(node); else if (ref && typeof ref === "object") ref.current = node; } }; } const $62f1c614c0962470$var$validDOMProperties = new Set([ // Common HTML attributes "accept", "acceptCharset", "accessKey", "action", "allowFullScreen", "allowTransparency", "alt", "async", "autoComplete", "autoFocus", "autoPlay", "capture", "cellPadding", "cellSpacing", "challenge", "charSet", "checked", "cite", "classID", "className", "colSpan", "cols", "content", "contentEditable", "contextMenu", "controls", "coords", "crossOrigin", "data", "dateTime", "default", "defer", "dir", "disabled", "download", "draggable", "encType", "form", "formAction", "formEncType", "formMethod", "formNoValidate", "formTarget", "frameBorder", "headers", "height", "hidden", "high", "href", "hrefLang", "htmlFor", "httpEquiv", "icon", "id", "inputMode", "integrity", "is", "keyParams", "keyType", "kind", "label", "lang", "list", "loop", "low", "manifest", "marginHeight", "marginWidth", "max", "maxLength", "media", "mediaGroup", "method", "min", "minLength", "multiple", "muted", "name", "noValidate", "nonce", "open", "optimum", "pattern", "placeholder", "poster", "preload", "profile", "radioGroup", "readOnly", "referrerPolicy", "rel", "required", "reversed", "role", "rowSpan", "rows", "sandbox", "scope", "scoped", "scrolling", "seamless", "selected", "shape", "size", "sizes", "span", "spellCheck", "src", "srcDoc", "srcLang", "srcSet", "start", "step", "style", "summary", "tabIndex", "target", "title", "type", "useMap", "value", "width", "wmode", "wrap", // Event handlers "onCopy", "onCut", "onPaste", "onCompositionEnd", "onCompositionStart", "onCompositionUpdate", "onKeyDown", "onKeyPress", "onKeyUp", "onFocus", "onBlur", "onChange", "onInput", "onInvalid", "onSubmit", "onClick", "onContextMenu", "onDoubleClick", "onDrag", "onDragEnd", "onDragEnter", "onDragExit", "onDragLeave", "onDragOver", "onDragStart", "onDrop", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseMove", "onMouseOut", "onMouseOver", "onMouseUp", "onSelect", "onTouchCancel", "onTouchEnd", "onTouchMove", "onTouchStart", "onScroll", "onWheel", "onAbort", "onCanPlay", "onCanPlayThrough", "onDurationChange", "onEmptied", "onEncrypted", "onEnded", "onError", "onLoadedData", "onLoadedMetadata", "onLoadStart", "onPause", "onPlay", "onPlaying", "onProgress", "onRateChange", "onSeeked", "onSeeking", "onStalled", "onSuspend", "onTimeUpdate", "onVolumeChange", "onWaiting", "onLoad", "onAnimationStart", "onAnimationEnd", "onAnimationIteration", "onTransitionEnd", "onToggle" ]); function $62f1c614c0962470$export$457c3d6518dd4c6f(props) { const newProps = {}; for(const key in props){ if (!key.startsWith("data-") && !$62f1c614c0962470$var$validDOMProperties.has(key)) continue; newProps[key] = props[key]; } return newProps; } const $eb8f27c3596a0e6b$export$23c260ee8e4dfaad = ({ stretchX: stretchX, stretchY: stretchY, stretchXY: stretchXY, children: children, className: className, position: position, as: as = "div", ...props }, ref)=>{ const Comp = as; return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)(Comp, { className: (0, $62f1c614c0962470$export$a274e22fb40f762e)({ [`position-${position}`]: !!position, "stretch-x": !!stretchX, "stretch-y": !!stretchY, "stretch-xy": !!stretchXY, [`${className}`]: !!className }), ref: ref, ...props, children: children }); }; $eb8f27c3596a0e6b$export$23c260ee8e4dfaad.displayName = "Box"; const $eb8f27c3596a0e6b$export$e71c4d32a2263218 = /*#__PURE__*/ $8zHUo$react.forwardRef($eb8f27c3596a0e6b$export$23c260ee8e4dfaad); const $8ddcc69383feb36a$export$36308cce1deef340 = [ "tomato", "red", "crimson", "pink", "plum", "purple", "violet", "indigo", "blue", "cyan", "teal", "green", "grass", "orange", "brown", "sky", "mint", "lime", "yellow", "amber", "gold", "bronze", "gray", "mauve", "slate", "sage", "olive", "sand" ]; const $8ddcc69383feb36a$export$b4e0e71242920c6a = { sharp: "none", pill: "full", rounded: undefined }; function $4af7da5c7dd0b9c2$export$de9bdbce6502b027(name, length = 1) { if (!name || length < 1) return ""; if (length == 1) return name.charAt(0); return name.trim().split(/\s+/).slice(0, length).map((c)=>c.charAt(0)).join(""); } function $4af7da5c7dd0b9c2$export$1c4d39b152e0f791(deprecatedProp, newProp, value) { if (!(0, $d99c85a751d7ffbd$export$ae45edb09e2fe7c2)(value)) console.warn(`${deprecatedProp} is deprecated and will be removed in a future release. ${newProp ? `Please use ${newProp} instead.` : ""}`); } function $4af7da5c7dd0b9c2$export$d41d9ab3de2def3d(text) { const str = String(text); let hash = 0; let char; if (str.trim().length === 0) return hash; for(let i = 0; i < str.length; i++){ char = str.charCodeAt(i); hash = (hash << 5) - hash + char; // Convert to 32bit integer hash &= hash; } return Math.abs(hash); } function $4af7da5c7dd0b9c2$export$d560c7e4a29451c2() { return Math.random().toString(36); } function $4af7da5c7dd0b9c2$export$e4369cabd7e84cd9(string) { const hash = $4af7da5c7dd0b9c2$export$d41d9ab3de2def3d(string); return (0, $8ddcc69383feb36a$export$36308cce1deef340)[hash % (0, $8ddcc69383feb36a$export$36308cce1deef340).length]; } function $4af7da5c7dd0b9c2$export$2db1d02db18b2d82(prefix, value) { if (!value) return ""; if (typeof value === "string" || typeof value === "number") return `${prefix}-${value}`; let classNames = ""; for (const key of Object.keys(value)){ const breakpoint = key; const breakpointValue = value[breakpoint]; if (breakpointValue) { classNames && (classNames += " "); classNames += breakpoint === "base" ? `${prefix}-${breakpointValue}` : `${breakpoint}:${prefix}-${breakpointValue}`; } } return classNames; } const $df66c26cdcece32b$export$de87bc49c164ff72 = (props, ref)=>{ const { columns: columns = 12, gap: gap = "sm", gapX: gapX, gapY: gapY, align: align, justify: justify, as: as, className: className, ...otherProps } = props; return(// TODO figure out why ts is screaming over here // eslint-disable-next-line @typescript-eslint/ban-ts-comment //@ts-ignore /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $eb8f27c3596a0e6b$export$e71c4d32a2263218), { as: as, ref: ref, className: (0, $62f1c614c0962470$export$a274e22fb40f762e)("p-grid", "display-grid", (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("columns", columns), (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("gap", gap), (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("column-gap", gapX), (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("row-gap", gapY), (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("flex-align", align), (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("flex-justify", justify), className), ...otherProps })); }; $df66c26cdcece32b$export$de87bc49c164ff72.displayName = "Grid"; const $df66c26cdcece32b$export$ef2184bd89960b14 = /*#__PURE__*/ $8zHUo$react.forwardRef($df66c26cdcece32b$export$de87bc49c164ff72); const $df66c26cdcece32b$export$faaf771f35016530 = (props, ref)=>{ return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $eb8f27c3596a0e6b$export$e71c4d32a2263218), { ref: ref, className: (0, $62f1c614c0962470$export$a274e22fb40f762e)("p-grid-item", (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("col-span", props.colSpan), props.className), ...props }); }; const $df66c26cdcece32b$export$9eb849b9b922d396 = /*#__PURE__*/ $8zHUo$react.forwardRef($df66c26cdcece32b$export$faaf771f35016530); $df66c26cdcece32b$export$faaf771f35016530.displayName = "GridItem"; const $c3a954a7c0cb5109$export$21ee1313e2afe36c = (props, ref)=>{ const { justify: justify, align: align, direction: direction, gap: gap = "sm", columnGap: columnGap, rowGap: rowGap, inline: inline, wrap: wrap, stack: stack, className: className, as: as, ...otherProps } = props; const flexDirection = stack ? "column" : direction ?? "row"; return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $eb8f27c3596a0e6b$export$e71c4d32a2263218), { as: as, className: (0, $62f1c614c0962470$export$a274e22fb40f762e)(className, inline ? "display-inline-flex" : "display-flex", `flex-direction-${flexDirection}`, wrap && `flex-${wrap}`, justify && `flex-justify-${justify}`, align && `flex-align-${align}`, (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("gap", gap), (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("column-gap", columnGap), (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("row-gap", rowGap)), // TODO - Fix types here - seems to work just fine though ref: ref, ...(0, $62f1c614c0962470$export$457c3d6518dd4c6f)(otherProps), children: props.children }); }; $c3a954a7c0cb5109$export$21ee1313e2afe36c.displayName = "Flex"; const $c3a954a7c0cb5109$export$f51f4c4ede09e011 = /*#__PURE__*/ $8zHUo$react.forwardRef($c3a954a7c0cb5109$export$21ee1313e2afe36c); const $88fa102d91bf323a$export$f5a10939c0132d55 = (props, ref)=>{ const { textCase: textCase, size: size = "sm", weight: weight, color: color = "gray", variant: variant = "default", highlight: highlight, align: align, lineHeight: lineHeight, underline: underline, italic: italic, as: Comp = "span", className: className, ...rest } = props; return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)(Comp, { className: (0, $62f1c614c0962470$export$a274e22fb40f762e)("p-text", className, { [`text-highlight`]: !!highlight, [`text-weight-${weight}`]: !!weight, [`text-align-${align}`]: !!align, [`text-line-height-${lineHeight}`]: !!lineHeight, [`text-transform-${textCase}`]: !!textCase }, (0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("text-size", size)), "data-underline": underline, "data-italic": italic, "data-color": color, "data-color-variant": variant, ref: ref, ...rest }); }; $88fa102d91bf323a$export$f5a10939c0132d55.displayName = "Text"; const $88fa102d91bf323a$export$5f1af8db9871e1d6 = /*#__PURE__*/ $8zHUo$react.forwardRef($88fa102d91bf323a$export$f5a10939c0132d55); const $5a5b41d120374960$var$InputLabel = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$react))).forwardRef(({ children: children, className: className, color: color, ...props }, ref)=>{ return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $88fa102d91bf323a$export$5f1af8db9871e1d6), { ref: ref, size: "sm", color: color || "gray", variant: "light", as: "label", className: (0, $62f1c614c0962470$export$a274e22fb40f762e)([ className, "p-input-label" ]), ...props, children: children }); }); $5a5b41d120374960$var$InputLabel.displayName = "InputLabel"; var $5a5b41d120374960$export$2e2bcd8739ae039 = $5a5b41d120374960$var$InputLabel; const $4b54f76a59afa8a5$var$InputError = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$react))).forwardRef(({ children: children, validationStatus: validationStatus = "error", ...props }, ref)=>{ return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $88fa102d91bf323a$export$5f1af8db9871e1d6), { size: "sm", className: "p-input-error", lineHeight: "base", as: "div", color: "red", variant: "default", "data-validation-status": validationStatus, ref: ref, ...props, children: children }); }); $4b54f76a59afa8a5$var$InputError.displayName = "InputError"; var $4b54f76a59afa8a5$export$2e2bcd8739ae039 = $4b54f76a59afa8a5$var$InputError; const $eae337549f49a5a2$var$SpaceContext = /*#__PURE__*/ $8zHUo$react.createContext({ classNames: {}, compactItemWrapperAdjust: "" }); function $eae337549f49a5a2$export$eef1e68107c58ef2({ children: children, compact: compact, gap: gap, className: className, classNames: classNames, style: style, styles: styles, ...props }) { const childrenCount = $8zHUo$react.Children.count(children); const nodes = $8zHUo$react.useMemo(()=>{ return $8zHUo$react.Children.map(children, (child, index)=>{ const isFirstChild = index == 0; const isLastChild = index == childrenCount - 1; if (!/*#__PURE__*/ $8zHUo$react.isValidElement(child)) return null; return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)($eae337549f49a5a2$var$SpaceContext.Provider, { value: { classNames: { "space-item-first": isFirstChild, "space-item-last": isLastChild, "space-item": true }, compactItemWrapperAdjust: isLastChild ? "" : "compact-item-wrapper-adjust" }, children: child }); }); }, [ children ]); return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), { "data-compact": compact, style: { ...style, ...styles?.wrapper }, className: (0, $62f1c614c0962470$export$a274e22fb40f762e)([ className, "p-space", classNames?.wrapper ]), gap: gap ?? "none", ...props, children: nodes }); } function $eae337549f49a5a2$export$450c36e0b0e62ccd() { return $8zHUo$react.useContext($eae337549f49a5a2$var$SpaceContext); } const $f2fd0cbe11b7f0dd$var$ThemeContext = /*#__PURE__*/ $8zHUo$react.createContext(null); function $f2fd0cbe11b7f0dd$export$d8964aec282183a3(props) { const { children: children, className: className, scaling: scaling = "100%", ...themeProps } = props; return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)($f2fd0cbe11b7f0dd$var$ThemeContext.Provider, { value: themeProps, children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", { id: "parrot-theme-provider", "data-gray-variant": themeProps.grayVariant, "data-radius": themeProps.radius, "data-color": themeProps.color, "data-scaling": scaling, className: (0, $62f1c614c0962470$export$a274e22fb40f762e)([ "parrot-theme", className ]), children: children }) }); } function $f2fd0cbe11b7f0dd$export$93d4e7f90805808f(options) { const theme = $8zHUo$react.useContext($f2fd0cbe11b7f0dd$var$ThemeContext); if (!theme && options?.requireThemeProvider) throw new Error("No theme found"); return theme; } function $ec2376a5dd0d13e6$export$a455218a85c89869({ label: label, description: description, error: error, color: color = "gray", radius: radius, size: size = "md", className: className, classNames: classNames, style: style, styles: styles, prepend: prepend, append: append, appearance: appearance = "outline", validationStatus: validationStatus, labelProps: labelProps, errorMessageProps: errorMessageProps, descriptionProps: descriptionProps, children: children, replaceDefaultControlWrapper: replaceDefaultControlWrapper, isDisabled: isDisabled, wrapperRef: wrapperRef, ...props }) { const space = (0, $eae337549f49a5a2$export$450c36e0b0e62ccd)(); const theme = (0, $f2fd0cbe11b7f0dd$export$93d4e7f90805808f)(); return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), { ref: wrapperRef, ...props, "data-color": color, "data-radius": radius ?? theme?.radius ?? "lg", "data-size": size, className: (0, $62f1c614c0962470$export$a274e22fb40f762e)("p-input-group", space.compactItemWrapperAdjust, className, classNames?.wrapper), stack: true, gap: "3xs", style: { ...style, ...styles?.wrapper }, children: [ label && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $5a5b41d120374960$export$2e2bcd8739ae039), { style: styles?.label, className: classNames?.label, color: color, ...labelProps, children: label }), !replaceDefaultControlWrapper && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), { align: "center", className: (0, $62f1c614c0962470$export$a274e22fb40f762e)(space.classNames, "p-input-control"), "data-has-error": !!error, "data-appearance": appearance, "data-disabled": isDisabled, stretchX: true, inline: true, position: "relative", children: [ prepend && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), { className: "add-on add-on-left", children: prepend }), children, append && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), { className: "add-on add-on-right", children: append }) ] }), replaceDefaultControlWrapper && children, error && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $4b54f76a59afa8a5$export$2e2bcd8739ae039), { validationStatus: validationStatus, ...errorMessageProps, children: error }), description && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $88fa102d91bf323a$export$5f1af8db9871e1d6), { as: "div", variant: "light", color: "gray", size: "sm", lineHeight: "short", ...descriptionProps, children: description }) ] }); } $ec2376a5dd0d13e6$export$a455218a85c89869.displayName = "Field"; function $d9ffc65197682590$export$f5b8910cec6cf069({ className: className, classNames: classNames, style: style, styles: styles, onChange: onChange, inputRef: inputRef, ...props }) { const internalInputRef = (0, ($parcel$interopDefault($8zHUo$react))).useRef(null); const { labelProps: labelProps, inputProps: inputProps, errorMessageProps: errorMessageProps, descriptionProps: descriptionProps } = (0, $8zHUo$reactaria.useTextField)({ ...props, onChange: onChange, inputElementType: "input" }, internalInputRef); return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $ec2376a5dd0d13e6$export$a455218a85c89869), { labelProps: labelProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, className: className, classNames: classNames, styles: styles, style: style, ...props, children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("input", { ref: (0, $62f1c614c0962470$export$c9058316764c140e)(inputRef, internalInputRef), "data-has-left-addon": !!props.prepend, "data-has-right-addon": !!props.append, className: (0, $62f1c614c0962470$export$a274e22fb40f762e)("p-text-input-el"), ...inputProps }) }); } const $a28e128499dd0b02$export$3b0d6d7590275603 = /*#__PURE__*/ $8zHUo$react.forwardRef(({ color: color = "var(--color-10)", className: className, style: style, size: size = "sm", ...props }, ref)=>{ const theme = (0, $f2fd0cbe11b7f0dd$export$93d4e7f90805808f)(); return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("div", { "data-color": theme?.color ?? "gray", style: { fill: color, ...style }, className: (0, $62f1c614c0962470$export$a274e22fb40f762e)([ className, "p-loader-wrapper" ]), ref: ref, ...props, children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("svg", { className: "p-loader-svg", "data-size": size, viewBox: "0 0 1024 1024", fill: "inherit", children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("path", { d: "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" }) }) }); }); $a28e128499dd0b02$export$3b0d6d7590275603.displayName = "Loader"; function $ff6fce0e059b3a1a$export$30a06c8d3562193f(object, keys) { const keySet = new Set(keys); return Object.keys(object).reduce((obj, key)=>{ if (!keySet.has(key)) obj[key] = object[key]; return obj; }, {}); } function $ff6fce0e059b3a1a$export$357523c63a2253b9(object, keys) { // TODO handle invalid objects properly if (!object) return {}; return Object.keys(object).reduce((obj, key)=>{ if (keys.includes(key)) return { ...obj, [key]: object[key] }; return { ...obj }; }, {}); } function $ff6fce0e059b3a1a$export$65980d18b75784e2(object, keys) { const picked = $ff6fce0e059b3a1a$export$357523c63a2253b9(object, keys); const omitted = $ff6fce0e059b3a1a$export$30a06c8d3562193f(object, keys); return [ picked, omitted ]; } function $ff6fce0e059b3a1a$export$d2dae087199d2383(object) { return Object.keys(object).reduce((obj, key)=>{ if (object[key] == null) return { ...obj }; return { ...obj, [key]: object[key] }; }, {}); } const $7f70742e736041ff$var$ButtonGroupContext = /*#__PURE__*/ $8zHUo$react.createContext({}); function $7f70742e736041ff$export$69b1032f2ecdf404({ color: color, variant: variant, size: size, compact: compact, radius: radius, gap: gap, children: children, idleColor: idleColor, activeColor: activeColor, idleVariant: idleVariant, activeVariant: activeVariant, isToggle: isToggle, className: className, classNames: classNames, style: style, styles: styles }) { const cleanProps = (0, $ff6fce0e059b3a1a$export$d2dae087199d2383)({ color: color, variant: variant, size: size, radius: radius, idleColor: idleColor, activeColor: activeColor, idleVariant: idleVariant, activeVariant: activeVariant, isToggle: isToggle }); return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)($7f70742e736041ff$var$ButtonGroupContext.Provider, { value: cleanProps, children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $eae337549f49a5a2$export$eef1e68107c58ef2), { className: className, classNames: classNames, style: style, styles: styles, gap: gap, compact: compact, children: children }) }); } function $7f70742e736041ff$export$749e21be8b14b968() { return $8zHUo$react.useContext($7f70742e736041ff$var$ButtonGroupContext); } const $5a6f28f3fd58ff6e$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$react))).forwardRef((props, ref)=>{ const space = (0, $eae337549f49a5a2$export$450c36e0b0e62ccd)(); const buttonGroupProps = (0, $7f70742e736041ff$export$749e21be8b14b968)(); const theme = (0, $f2fd0cbe11b7f0dd$export$93d4e7f90805808f)(); const { color: color = theme?.color ?? "violet", variant: variant = "solid", append: append, prepend: prepend, size: size = "md", children: children, as: as = "button", className: className, isLoading: isLoading, radius: radius = "full", isToggle: isToggle, activeColor: activeColor = theme?.color, activeVariant: activeVariant = "solid", idleColor: idleColor = "gray", idleVariant: idleVariant = "outline", isIconButton: isIconButton, style: style, classNames: classNames, styles: styles, form: form, ...otherProps } = { ...buttonGroupProps, ...props }; const state = isToggle ? (0, $8zHUo$reactstately.useToggleState)({ ...otherProps }) : {}; const buttonRef = (0, ($parcel$interopDefault($8zHUo$react))).useRef(null); const { buttonProps: buttonProps, isPressed: isPressed } = isToggle ? (0, $8zHUo$reactaria.useToggleButton)({ ...otherProps, elementType: as }, state, buttonRef) : (0, $8zHUo$reactaria.useButton)({ ...otherProps, elementType: as }, buttonRef); function getColor() { if (!state.isSelected && isToggle) return { color: idleColor, variant: idleVariant }; if (state.isSelected && isToggle) return { color: activeColor, variant: activeVariant }; return { variant: variant, color: color }; } const Comp = as; return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)(Comp, { style: { ...style, ...styles?.wrapper }, "data-is-toggle": isToggle, "data-pressed": isPressed, "data-radius": radius, "data-icon-button": isIconButton, "data-loading": isLoading, "aria-busy": isLoading, "data-color": getColor().color, "data-variant": getColor().variant, "data-selected": state.isSelected, className: (0, $62f1c614c0962470$export$a274e22fb40f762e)((0, $4af7da5c7dd0b9c2$export$2db1d02db18b2d82)("size", size), className, "p-button", space.classNames), ref: (0, $62f1c614c0962470$export$c9058316764c140e)(ref, buttonRef), form: form, ...buttonProps, children: [ prepend, children, isLoading ? /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $a28e128499dd0b02$export$3b0d6d7590275603), { className: (0, $62f1c614c0962470$export$a274e22fb40f762e)([ "p-button-loader", classNames?.loader ]), style: { marginLeft: 8, ...styles?.loader }, color: "inherit", size: "xs" }) : append ] }); }); $5a6f28f3fd58ff6e$export$353f5b6fc5456de1.displayName = "Button"; const $3af04cd154cf4de1$export$c25acd513dcc8062 = /*#__PURE__*/ $8zHUo$react.forwardRef((props, ref)=>{ return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $5a6f28f3fd58ff6e$export$353f5b6fc5456de1), { isIconButton: true, ref: ref, ...props, children: props.children }); }); $3af04cd154cf4de1$export$c25acd513dcc8062.displayName = "IconButton"; 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 }) { const ariaProps = { ...props, maxValue: maxValue, formatOptions: formatOptions, minValue: minValue, onChange: onChange, "aria-label": props["aria-label"] ?? "number input" }; const space = (0, $eae337549f49a5a2$export$450c36e0b0e62ccd)(); const internalInputRef = $8zHUo$react.useRef(null); const { locale: locale } = (0, $8zHUo$reactaria.useLocale)(); const state = (0, $8zHUo$reactstately.useNumberFieldState)({ ...ariaProps, locale: locale }); const { errorMessageProps: errorMessageProps, descriptionProps: descriptionProps, labelProps: labelProps, groupProps: groupProps, inputProps: inputProps, incrementButtonProps: incrementButtonProps, decrementButtonProps: decrementButtonProps } = (0, $8zHUo$reactaria.useNumberField)(ariaProps, state, internalInputRef); return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $ec2376a5dd0d13e6$export$a455218a85c89869), { classNames: classNames, color: color, size: size, labelProps: labelProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, error: error, label: label, replaceDefaultControlWrapper: true, ...props, children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), { gap: "4xs", ...groupProps, className: "p-input-container", children: [ showSteppers && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $3af04cd154cf4de1$export$c25acd513dcc8062), { ...decrementButtonProps, radius: "md", color: color, variant: "outline", size: size, className: classNames?.decrement, style: styles?.decrement, children: decrementIcon }), /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("input", { style: styles?.input, ref: (0, $62f1c614c0962470$export$c9058316764c140e)(internalInputRef, inputRef), placeholder: placeholder, className: (0, $62f1c614c0962470$export$a274e22fb40f762e)(classNames?.input, "p-input-control", "space-item", space.classNames), "data-appearance": appearance, "data-has-left-addon": !!prepend, "data-has-right-addon": !!append, type: "text", ...inputProps }), showSteppers && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $3af04cd154cf4de1$export$c25acd513dcc8062), { ...incrementButtonProps, radius: "md", color: color, variant: "outline", size: size, className: classNames?.increment, style: styles?.increment, children: incrementIcon }) ] }) }); } function $868b95cd1882a2c1$export$b28585a458fee016({ wrapperRef: wrapperRef, ...props }) { const [showPassword, setShowPassword] = (0, ($parcel$interopDefault($8zHUo$react))).useState(false); return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $d9ffc65197682590$export$f5b8910cec6cf069), { wrapperRef: wrapperRef, ...props, type: showPassword ? "text" : "password", append: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $3af04cd154cf4de1$export$c25acd513dcc8062), { onPress: ()=>setShowPassword((p)=>!p), size: "sm", variant: "light", children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $8zHUo$reacticonshi.HiEye), { size: 16 }) }) }); } const $491b98ef80f40f98$export$379139ebc1c2b235 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$react))).forwardRef(({ appearance: appearance = "outline", resize: resize, label: label, description: description, error: error, color: color = "gray", style: style, radius: radius, ...props }, ref)=>{ const textAreaRef = (0, ($parcel$interopDefault($8zHUo$react))).useRef(null); const { labelProps: labelProps, inputProps: inputProps, errorMessageProps: errorMessageProps, descriptionProps: descriptionProps } = (0, $8zHUo$reactaria.useTextField)({ ...props, inputElementType: "textarea", label: label, description: description, errorMessage: error }, textAreaRef); const theme = (0, $f2fd0cbe11b7f0dd$export$93d4e7f90805808f)(); return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), { "data-color": color, "data-radius": radius ?? theme?.radius ?? "lg", style: style, className: "p-input-group", ref: ref, stack: true, gap: "2xs", children: [ label && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $5a5b41d120374960$export$2e2bcd8739ae039), { ...labelProps, children: label }), /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("textarea", { className: "p-input-control p-text-area", disabled: props.isDisabled, "data-has-error": !!error, "data-resize": resize, "data-appearance": appearance, ...inputProps }), error && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $4b54f76a59afa8a5$export$2e2bcd8739ae039), { ...errorMessageProps, children: error }), description && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $88fa102d91bf323a$export$5f1af8db9871e1d6), { lineHeight: "base", ...descriptionProps, variant: "light", as: "div", size: "sm", children: description }) ] }); }); $491b98ef80f40f98$export$379139ebc1c2b235.displayName = "Textarea"; const $0f8ef6f4acac1766$export$f9c6924e160136d1 = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$react))).createContext(null); const $0f8ef6f4acac1766$export$4aa08d5625cb8ead = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$react))).forwardRef((props, ref)=>{ const { children: children, align: align, justify: justify, label: label, description: description, errorMessage: errorMessage, size: size, appearance: appearance, color: color, shape: shape } = props; const state = (0, $8zHUo$reactstately.useCheckboxGroupState)(props); const { groupProps: groupProps, labelProps: labelProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $8zHUo$reactaria.useCheckboxGroup)(props, state); return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)((0, $c3a954a7c0cb5109$export$f51f4c4ede09e011), { align: align, justify: justify, ref: ref, stack: true, gap: "2xs", ...groupProps, children: [ /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $88fa102d91bf323a$export$5f1af8db9871e1d6), { ...labelProps, children: label }), /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)($0f8ef6f4acac1766$export$f9c6924e160136d1.Provider, { value: { state: state, props: { size: size, appearance: appearance, color: color, shape: shape } }, children: children }), description && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $88fa102d91bf323a$export$5f1af8db9871e1d6), { lineHeight: "base", variant: "lighter", size: "xs", ...descriptionProps, children: description }), errorMessage && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $4b54f76a59afa8a5$export$2e2bcd8739ae039), { ...errorMessageProps, children: errorMessage }) ] }); }); $0f8ef6f4acac1766$export$4aa08d5625cb8ead.displayName = "CheckboxGroup"; const $f88e10ca2ba68239$export$48513f6b9f8ce62d = /*#__PURE__*/ (0, ($parcel$interopDefault($8zHUo$react))).forwardRef((props, ref)=>{ const { appearance: appearance, size: size, shape: shape = "round", color: color, className: className, classNames: classNames, styles: styles, style: style, ...otherProps } = props; // check if checkbox is rendered in a group context const groupContext = (0, ($parcel$interopDefault($8zHUo$react))).useContext((0, $0f8ef6f4acac1766$export$f9c6924e160136d1)); const groupState = groupContext?.state; const groupProps = groupContext?.props; const isWithinGroup = groupState != null; const singleState = (0, $8zHUo$reactstately.useToggleState)(props); const inputRef = (0, ($parcel$interopDefault($8zHUo$react))).useRef(null); const single = (0, $8zHUo$reactaria.useCheckbox)(otherProps, singleState, inputRef); const group = groupState && (0, $8zHUo$reactaria.useCheckboxGroupItem)(otherProps, groupState, inputRef); const { isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $8zHUo$reactaria.useFocusRing)(); const inputProps = isWithinGroup ? group?.inputProps : single.inputProps; const state = isWithinGroup ? groupState : singleState; const isSelected = isWithinGroup ? groupState.isSelected(props.value ?? "") : state.isSelected; function getRadius() { const resolvedShape = shape || groupProps?.shape || undefined; if (resolvedShape === "sharp") return "none"; if (resolvedShape === "round") return "md"; return undefined; } const resolvedColor = color || groupProps?.color || undefined; const resolvedAppearance = appearance || groupProps?.appearance || "outline"; const resolvedSize = size || groupProps?.size || "md"; return /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)("label", { style: { ...style, ...styles?.wrapper }, className: (0, $62f1c614c0962470$export$a274e22fb40f762e)(className, "p-checkbox", classNames?.wrapper), "data-disabled": inputProps?.disabled, ref: ref, children: [ /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)((0, $8zHUo$reactaria.VisuallyHidden), { children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("input", { type: "checkbox", ref: inputRef, ...inputProps, ...focusProps }) }), /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsxs)("div", { style: { ...style, ...styles?.checkbox }, "data-color": resolvedColor, "data-radius": getRadius(), className: (0, $62f1c614c0962470$export$a274e22fb40f762e)([ "p-fake-checkbox", classNames?.checkbox ]), "data-focused": isFocusVisible, "aria-hidden": "true", "data-checked": isSelected && !props.isIndeterminate, "data-indeterminate": props.isIndeterminate, "data-size": resolvedSize, "data-appearance": resolvedAppearance, children: [ isSelected && !props.isIndeterminate && /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("svg", { className: (0, $62f1c614c0962470$export$a274e22fb40f762e)([ "p-checkbox-icon", classNames?.icon ]), stroke: "white", width: "0.75rem", height: "0.75rem", viewBox: "0 0 18 18", children: /*#__PURE__*/ (0, $8zHUo$reactjsxruntime.jsx)("polyline", { points: "1 9 7 14 15 4", fill: "none", strokeWidth: 3, strokeDasharray: 22, strokeDashoffset: isSele