| @@ -80,14 +80,17 @@ | ||
| 80 | 80 | |
| 81 | 81 | // packages/icons/build-module/library/layout.mjs |
| 82 | 82 | var import_primitives = __toESM(require_primitives(), 1); |
| 83 | 83 | var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); |
| 84 | -var layout_default = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.Path, { d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) }); | |
| 84 | +var layout_default = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.Path, { d: "M9.75 19.25H18C18.6904 19.25 19.25 18.6904 19.25 18V9.75M9.75 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V9.75M9.75 19.25V9.75M19.25 9.75V6C19.25 5.30964 18.6904 4.75 18 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V9.75M19.25 9.75H9.75M9.75 9.75H4.75", vectorEffect: "non-scaling-stroke" }) }); | |
| 85 | 85 | |
| 86 | 86 | // packages/icons/build-module/library/pencil.mjs |
| 87 | 87 | var import_primitives2 = __toESM(require_primitives(), 1); |
| 88 | 88 | var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); |
| 89 | -var pencil_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.Path, { d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" }) }); | |
| 89 | +var pencil_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ | |
| 90 | + /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.Path, { d: "M5 19.25H12", vectorEffect: "non-scaling-stroke" }), | |
| 91 | + /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.Path, { d: "M10 15L7.5 15.5L8 13L16 5L18 7L10 15Z", fill: "currentColor", vectorEffect: "non-scaling-stroke" }) | |
| 92 | +] }); | |
| 90 | 93 | |
| 91 | 94 | // packages/icons/build-module/library/styles.mjs |
| 92 | 95 | var import_primitives3 = __toESM(require_primitives(), 1); |
| 93 | 96 | var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); |
| @@ -111,8 +114,31 @@ | ||
| 111 | 114 | return n; |
| 112 | 115 | } |
| 113 | 116 | var clsx_default = clsx; |
| 114 | 117 | |
| 118 | +// node_modules/@base-ui/utils/createLogOnce.mjs | |
| 119 | +var loggedMessages; | |
| 120 | +if (true) { | |
| 121 | + loggedMessages = /* @__PURE__ */ new Set(); | |
| 122 | +} | |
| 123 | +function createLogOnce(severity, prefix) { | |
| 124 | + return function logOnce(...messages) { | |
| 125 | + if (true) { | |
| 126 | + const message = messages.join(" "); | |
| 127 | + const output = prefix ? `${prefix}: ${message}` : message; | |
| 128 | + const key = `${severity}:${output}`; | |
| 129 | + if (!loggedMessages.has(key)) { | |
| 130 | + loggedMessages.add(key); | |
| 131 | + if (severity === "warn") { | |
| 132 | + console.warn(output); | |
| 133 | + } else { | |
| 134 | + console.error(output); | |
| 135 | + } | |
| 136 | + } | |
| 137 | + } | |
| 138 | + }; | |
| 139 | +} | |
| 140 | + | |
| 115 | 141 | // node_modules/@base-ui/utils/useRefWithInit.mjs |
| 116 | 142 | var React = __toESM(require_react(), 1); |
| 117 | 143 | var UNINITIALIZED = {}; |
| 118 | 144 | function useRefWithInit(init, initArg) { |
| @@ -123,22 +149,14 @@ | ||
| 123 | 149 | return ref; |
| 124 | 150 | } |
| 125 | 151 | |
| 126 | 152 | // node_modules/@base-ui/utils/warn.mjs |
| 127 | -var set; | |
| 128 | -if (true) { | |
| 129 | - set = /* @__PURE__ */ new Set(); | |
| 130 | -} | |
| 131 | -function warn(...messages) { | |
| 132 | - if (true) { | |
| 133 | - const messageKey = messages.join(" "); | |
| 134 | - if (!set.has(messageKey)) { | |
| 135 | - set.add(messageKey); | |
| 136 | - console.warn(`Base UI: ${messageKey}`); | |
| 137 | - } | |
| 138 | - } | |
| 139 | -} | |
| 153 | +var warn = createLogOnce("warn", "Base UI"); | |
| 140 | 154 | |
| 155 | +// node_modules/@base-ui/utils/empty.mjs | |
| 156 | +var EMPTY_ARRAY = Object.freeze([]); | |
| 157 | +var EMPTY_OBJECT = Object.freeze({}); | |
| 158 | + | |
| 141 | 159 | // node_modules/@base-ui/react/internals/useRenderElement.mjs |
| 142 | 160 | var React4 = __toESM(require_react(), 1); |
| 143 | 161 | |
| 144 | 162 | // node_modules/@base-ui/utils/useMergedRefs.mjs |
| @@ -266,12 +284,8 @@ | ||
| 266 | 284 | } |
| 267 | 285 | return void 0; |
| 268 | 286 | } |
| 269 | 287 | |
| 270 | -// node_modules/@base-ui/utils/empty.mjs | |
| 271 | -var EMPTY_ARRAY = Object.freeze([]); | |
| 272 | -var EMPTY_OBJECT = Object.freeze({}); | |
| 273 | - | |
| 274 | 288 | // node_modules/@base-ui/react/internals/getStateAttributesProps.mjs |
| 275 | 289 | function getStateAttributesProps(state, customMapping) { |
| 276 | 290 | const props = {}; |
| 277 | 291 | for (const key in state) { |
| @@ -459,10 +473,13 @@ | ||
| 459 | 473 | |
| 460 | 474 | // node_modules/@base-ui/react/internals/useRenderElement.mjs |
| 461 | 475 | var import_react = __toESM(require_react(), 1); |
| 462 | 476 | function useRenderElement(element, componentProps, params = {}) { |
| 463 | - const renderProp = componentProps.render; | |
| 464 | - const outProps = useRenderElementProps(componentProps, params); | |
| 477 | + let renderProp = componentProps.render; | |
| 478 | + if (params.enabled !== false) { | |
| 479 | + renderProp = unwrapLazyRenderProp(renderProp); | |
| 480 | + } | |
| 481 | + const outProps = useRenderElementProps(componentProps, params, renderProp); | |
| 465 | 482 | if (params.enabled === false) { |
| 466 | 483 | return null; |
| 467 | 484 | } |
| 468 | 485 | const state = params.state ?? EMPTY_OBJECT; |
| @@ -467,13 +484,12 @@ | ||
| 467 | 484 | } |
| 468 | 485 | const state = params.state ?? EMPTY_OBJECT; |
| 469 | 486 | return evaluateRenderProp(element, renderProp, outProps, state); |
| 470 | 487 | } |
| 471 | -function useRenderElementProps(componentProps, params = {}) { | |
| 488 | +function useRenderElementProps(componentProps, params, renderProp) { | |
| 472 | 489 | const { |
| 473 | 490 | className: classNameProp, |
| 474 | - style: styleProp, | |
| 475 | - render: renderProp | |
| 491 | + style: styleProp | |
| 476 | 492 | } = componentProps; |
| 477 | 493 | const { |
| 478 | 494 | state = EMPTY_OBJECT, |
| 479 | 495 | ref, |
| @@ -514,8 +530,15 @@ | ||
| 514 | 530 | } |
| 515 | 531 | var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); |
| 516 | 532 | var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/; |
| 517 | 533 | var LOWERCASE_CHARACTER_PATTERN = /[a-z]/; |
| 534 | +function unwrapLazyRenderProp(render) { | |
| 535 | + if (render?.$$typeof !== REACT_LAZY_TYPE) { | |
| 536 | + return render; | |
| 537 | + } | |
| 538 | + const unwrapped = React4.Children.toArray(render)[0]; | |
| 539 | + return /* @__PURE__ */ React4.isValidElement(unwrapped) ? unwrapped : render; | |
| 540 | +} | |
| 518 | 541 | function evaluateRenderProp(element, render, props, state) { |
| 519 | 542 | if (render) { |
| 520 | 543 | if (typeof render === "function") { |
| 521 | 544 | if (true) { |
| @@ -524,19 +547,14 @@ | ||
| 524 | 547 | return render(props, state); |
| 525 | 548 | } |
| 526 | 549 | const mergedProps = mergeProps(props, render.props); |
| 527 | 550 | mergedProps.ref = props.ref; |
| 528 | - let newElement = render; | |
| 529 | - if (newElement?.$$typeof === REACT_LAZY_TYPE) { | |
| 530 | - const children = React4.Children.toArray(render); | |
| 531 | - newElement = children[0]; | |
| 532 | - } | |
| 533 | 551 | if (true) { |
| 534 | - if (!/* @__PURE__ */ React4.isValidElement(newElement)) { | |
| 552 | + if (!/* @__PURE__ */ React4.isValidElement(render)) { | |
| 535 | 553 | throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.", "A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.", "https://base-ui.com/r/invalid-render-prop"].join("\n")); |
| 536 | 554 | } |
| 537 | 555 | } |
| 538 | - return /* @__PURE__ */ React4.cloneElement(newElement, mergedProps); | |
| 556 | + return /* @__PURE__ */ React4.cloneElement(render, mergedProps); | |
| 539 | 557 | } |
| 540 | 558 | if (element) { |
| 541 | 559 | if (typeof element === "string") { |
| 542 | 560 | return renderTag(element, props); |