@almadar/ui 4.54.3 → 4.54.5

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.
@@ -13287,36 +13287,37 @@ var init_Popover = __esm({
13287
13287
  ...triggerProps
13288
13288
  }
13289
13289
  );
13290
+ const panel = isOpen && triggerRect ? /* @__PURE__ */ jsxRuntime.jsxs(
13291
+ "div",
13292
+ {
13293
+ ref: popoverRef,
13294
+ className: cn(
13295
+ "fixed z-50 p-4",
13296
+ "bg-card border-2 border-border shadow-lg",
13297
+ positionClasses2[position],
13298
+ className
13299
+ ),
13300
+ style: computePopoverStyle(position, triggerRect, popoverWidth),
13301
+ role: "dialog",
13302
+ onMouseEnter: trigger === "hover" ? handleOpen : void 0,
13303
+ onMouseLeave: trigger === "hover" ? handleClose : void 0,
13304
+ children: [
13305
+ typeof content === "string" ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", children: content }) : content,
13306
+ showArrow && /* @__PURE__ */ jsxRuntime.jsx(
13307
+ "div",
13308
+ {
13309
+ className: cn(
13310
+ "absolute w-0 h-0 border-4",
13311
+ arrowClasses2[position]
13312
+ )
13313
+ }
13314
+ )
13315
+ ]
13316
+ }
13317
+ ) : null;
13290
13318
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
13291
13319
  triggerElement,
13292
- isOpen && triggerRect && /* @__PURE__ */ jsxRuntime.jsxs(
13293
- "div",
13294
- {
13295
- ref: popoverRef,
13296
- className: cn(
13297
- "fixed z-50 p-4",
13298
- "bg-card border-2 border-border shadow-lg",
13299
- positionClasses2[position],
13300
- className
13301
- ),
13302
- style: computePopoverStyle(position, triggerRect, popoverWidth),
13303
- role: "dialog",
13304
- onMouseEnter: trigger === "hover" ? handleOpen : void 0,
13305
- onMouseLeave: trigger === "hover" ? handleClose : void 0,
13306
- children: [
13307
- typeof content === "string" ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", children: content }) : content,
13308
- showArrow && /* @__PURE__ */ jsxRuntime.jsx(
13309
- "div",
13310
- {
13311
- className: cn(
13312
- "absolute w-0 h-0 border-4",
13313
- arrowClasses2[position]
13314
- )
13315
- }
13316
- )
13317
- ]
13318
- }
13319
- )
13320
+ panel && typeof document !== "undefined" ? reactDom.createPortal(panel, document.body) : panel
13320
13321
  ] });
13321
13322
  };
13322
13323
  Popover.displayName = "Popover";
@@ -54542,10 +54543,10 @@ function getToastPosition(position) {
54542
54543
  }
54543
54544
  }
54544
54545
  function renderPatternChildren(children, onDismiss, parentId = "root", parentPath = "root", sourceTrait) {
54545
- if (!children || !Array.isArray(children) || children.length === 0) {
54546
- return null;
54547
- }
54548
- return children.map((child, index) => {
54546
+ if (children === void 0 || children === null) return null;
54547
+ const childrenArray = Array.isArray(children) ? children : typeof children === "string" || typeof children === "object" && "type" in children ? [children] : [];
54548
+ if (childrenArray.length === 0) return null;
54549
+ return childrenArray.map((child, index) => {
54549
54550
  if (typeof child === "string") {
54550
54551
  const match = TRAIT_BINDING_RE.exec(child);
54551
54552
  if (match) {
@@ -54686,7 +54687,8 @@ function SlotContentRenderer({
54686
54687
  const PatternComponent = getComponentForPattern(content.pattern);
54687
54688
  if (PatternComponent) {
54688
54689
  const childrenConfig = content.props.children;
54689
- const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0;
54690
+ const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
54691
+ const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0 || isSingleChild;
54690
54692
  const myPath = patternPath ?? "root";
54691
54693
  const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait) : void 0;
54692
54694
  const incomingChildren = content.props.children;
package/dist/avl/index.js CHANGED
@@ -13241,36 +13241,37 @@ var init_Popover = __esm({
13241
13241
  ...triggerProps
13242
13242
  }
13243
13243
  );
13244
+ const panel = isOpen && triggerRect ? /* @__PURE__ */ jsxs(
13245
+ "div",
13246
+ {
13247
+ ref: popoverRef,
13248
+ className: cn(
13249
+ "fixed z-50 p-4",
13250
+ "bg-card border-2 border-border shadow-lg",
13251
+ positionClasses2[position],
13252
+ className
13253
+ ),
13254
+ style: computePopoverStyle(position, triggerRect, popoverWidth),
13255
+ role: "dialog",
13256
+ onMouseEnter: trigger === "hover" ? handleOpen : void 0,
13257
+ onMouseLeave: trigger === "hover" ? handleClose : void 0,
13258
+ children: [
13259
+ typeof content === "string" ? /* @__PURE__ */ jsx(Typography, { variant: "body", children: content }) : content,
13260
+ showArrow && /* @__PURE__ */ jsx(
13261
+ "div",
13262
+ {
13263
+ className: cn(
13264
+ "absolute w-0 h-0 border-4",
13265
+ arrowClasses2[position]
13266
+ )
13267
+ }
13268
+ )
13269
+ ]
13270
+ }
13271
+ ) : null;
13244
13272
  return /* @__PURE__ */ jsxs(Fragment, { children: [
13245
13273
  triggerElement,
13246
- isOpen && triggerRect && /* @__PURE__ */ jsxs(
13247
- "div",
13248
- {
13249
- ref: popoverRef,
13250
- className: cn(
13251
- "fixed z-50 p-4",
13252
- "bg-card border-2 border-border shadow-lg",
13253
- positionClasses2[position],
13254
- className
13255
- ),
13256
- style: computePopoverStyle(position, triggerRect, popoverWidth),
13257
- role: "dialog",
13258
- onMouseEnter: trigger === "hover" ? handleOpen : void 0,
13259
- onMouseLeave: trigger === "hover" ? handleClose : void 0,
13260
- children: [
13261
- typeof content === "string" ? /* @__PURE__ */ jsx(Typography, { variant: "body", children: content }) : content,
13262
- showArrow && /* @__PURE__ */ jsx(
13263
- "div",
13264
- {
13265
- className: cn(
13266
- "absolute w-0 h-0 border-4",
13267
- arrowClasses2[position]
13268
- )
13269
- }
13270
- )
13271
- ]
13272
- }
13273
- )
13274
+ panel && typeof document !== "undefined" ? createPortal(panel, document.body) : panel
13274
13275
  ] });
13275
13276
  };
13276
13277
  Popover.displayName = "Popover";
@@ -54496,10 +54497,10 @@ function getToastPosition(position) {
54496
54497
  }
54497
54498
  }
54498
54499
  function renderPatternChildren(children, onDismiss, parentId = "root", parentPath = "root", sourceTrait) {
54499
- if (!children || !Array.isArray(children) || children.length === 0) {
54500
- return null;
54501
- }
54502
- return children.map((child, index) => {
54500
+ if (children === void 0 || children === null) return null;
54501
+ const childrenArray = Array.isArray(children) ? children : typeof children === "string" || typeof children === "object" && "type" in children ? [children] : [];
54502
+ if (childrenArray.length === 0) return null;
54503
+ return childrenArray.map((child, index) => {
54503
54504
  if (typeof child === "string") {
54504
54505
  const match = TRAIT_BINDING_RE.exec(child);
54505
54506
  if (match) {
@@ -54640,7 +54641,8 @@ function SlotContentRenderer({
54640
54641
  const PatternComponent = getComponentForPattern(content.pattern);
54641
54642
  if (PatternComponent) {
54642
54643
  const childrenConfig = content.props.children;
54643
- const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0;
54644
+ const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
54645
+ const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0 || isSingleChild;
54644
54646
  const myPath = patternPath ?? "root";
54645
54647
  const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait) : void 0;
54646
54648
  const incomingChildren = content.props.children;
@@ -7344,36 +7344,37 @@ var init_Popover = __esm({
7344
7344
  ...triggerProps
7345
7345
  }
7346
7346
  );
7347
+ const panel = isOpen && triggerRect ? /* @__PURE__ */ jsxRuntime.jsxs(
7348
+ "div",
7349
+ {
7350
+ ref: popoverRef,
7351
+ className: cn(
7352
+ "fixed z-50 p-4",
7353
+ "bg-card border-2 border-border shadow-lg",
7354
+ positionClasses2[position],
7355
+ className
7356
+ ),
7357
+ style: computePopoverStyle(position, triggerRect, popoverWidth),
7358
+ role: "dialog",
7359
+ onMouseEnter: trigger === "hover" ? handleOpen : void 0,
7360
+ onMouseLeave: trigger === "hover" ? handleClose : void 0,
7361
+ children: [
7362
+ typeof content === "string" ? /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "body", children: content }) : content,
7363
+ showArrow && /* @__PURE__ */ jsxRuntime.jsx(
7364
+ "div",
7365
+ {
7366
+ className: cn(
7367
+ "absolute w-0 h-0 border-4",
7368
+ arrowClasses2[position]
7369
+ )
7370
+ }
7371
+ )
7372
+ ]
7373
+ }
7374
+ ) : null;
7347
7375
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7348
7376
  triggerElement,
7349
- isOpen && triggerRect && /* @__PURE__ */ jsxRuntime.jsxs(
7350
- "div",
7351
- {
7352
- ref: popoverRef,
7353
- className: cn(
7354
- "fixed z-50 p-4",
7355
- "bg-card border-2 border-border shadow-lg",
7356
- positionClasses2[position],
7357
- className
7358
- ),
7359
- style: computePopoverStyle(position, triggerRect, popoverWidth),
7360
- role: "dialog",
7361
- onMouseEnter: trigger === "hover" ? handleOpen : void 0,
7362
- onMouseLeave: trigger === "hover" ? handleClose : void 0,
7363
- children: [
7364
- typeof content === "string" ? /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "body", children: content }) : content,
7365
- showArrow && /* @__PURE__ */ jsxRuntime.jsx(
7366
- "div",
7367
- {
7368
- className: cn(
7369
- "absolute w-0 h-0 border-4",
7370
- arrowClasses2[position]
7371
- )
7372
- }
7373
- )
7374
- ]
7375
- }
7376
- )
7377
+ panel && typeof document !== "undefined" ? reactDom.createPortal(panel, document.body) : panel
7377
7378
  ] });
7378
7379
  };
7379
7380
  exports.Popover.displayName = "Popover";
@@ -45545,10 +45546,10 @@ function getToastPosition(position) {
45545
45546
  }
45546
45547
  }
45547
45548
  function renderPatternChildren(children, onDismiss, parentId = "root", parentPath = "root", sourceTrait) {
45548
- if (!children || !Array.isArray(children) || children.length === 0) {
45549
- return null;
45550
- }
45551
- return children.map((child, index) => {
45549
+ if (children === void 0 || children === null) return null;
45550
+ const childrenArray = Array.isArray(children) ? children : typeof children === "string" || typeof children === "object" && "type" in children ? [children] : [];
45551
+ if (childrenArray.length === 0) return null;
45552
+ return childrenArray.map((child, index) => {
45552
45553
  if (typeof child === "string") {
45553
45554
  const match = TRAIT_BINDING_RE.exec(child);
45554
45555
  if (match) {
@@ -45689,7 +45690,8 @@ function SlotContentRenderer({
45689
45690
  const PatternComponent = getComponentForPattern(content.pattern);
45690
45691
  if (PatternComponent) {
45691
45692
  const childrenConfig = content.props.children;
45692
- const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0;
45693
+ const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
45694
+ const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0 || isSingleChild;
45693
45695
  const myPath = patternPath ?? "root";
45694
45696
  const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait) : void 0;
45695
45697
  const incomingChildren = content.props.children;
@@ -7298,36 +7298,37 @@ var init_Popover = __esm({
7298
7298
  ...triggerProps
7299
7299
  }
7300
7300
  );
7301
+ const panel = isOpen && triggerRect ? /* @__PURE__ */ jsxs(
7302
+ "div",
7303
+ {
7304
+ ref: popoverRef,
7305
+ className: cn(
7306
+ "fixed z-50 p-4",
7307
+ "bg-card border-2 border-border shadow-lg",
7308
+ positionClasses2[position],
7309
+ className
7310
+ ),
7311
+ style: computePopoverStyle(position, triggerRect, popoverWidth),
7312
+ role: "dialog",
7313
+ onMouseEnter: trigger === "hover" ? handleOpen : void 0,
7314
+ onMouseLeave: trigger === "hover" ? handleClose : void 0,
7315
+ children: [
7316
+ typeof content === "string" ? /* @__PURE__ */ jsx(Typography, { variant: "body", children: content }) : content,
7317
+ showArrow && /* @__PURE__ */ jsx(
7318
+ "div",
7319
+ {
7320
+ className: cn(
7321
+ "absolute w-0 h-0 border-4",
7322
+ arrowClasses2[position]
7323
+ )
7324
+ }
7325
+ )
7326
+ ]
7327
+ }
7328
+ ) : null;
7301
7329
  return /* @__PURE__ */ jsxs(Fragment, { children: [
7302
7330
  triggerElement,
7303
- isOpen && triggerRect && /* @__PURE__ */ jsxs(
7304
- "div",
7305
- {
7306
- ref: popoverRef,
7307
- className: cn(
7308
- "fixed z-50 p-4",
7309
- "bg-card border-2 border-border shadow-lg",
7310
- positionClasses2[position],
7311
- className
7312
- ),
7313
- style: computePopoverStyle(position, triggerRect, popoverWidth),
7314
- role: "dialog",
7315
- onMouseEnter: trigger === "hover" ? handleOpen : void 0,
7316
- onMouseLeave: trigger === "hover" ? handleClose : void 0,
7317
- children: [
7318
- typeof content === "string" ? /* @__PURE__ */ jsx(Typography, { variant: "body", children: content }) : content,
7319
- showArrow && /* @__PURE__ */ jsx(
7320
- "div",
7321
- {
7322
- className: cn(
7323
- "absolute w-0 h-0 border-4",
7324
- arrowClasses2[position]
7325
- )
7326
- }
7327
- )
7328
- ]
7329
- }
7330
- )
7331
+ panel && typeof document !== "undefined" ? createPortal(panel, document.body) : panel
7331
7332
  ] });
7332
7333
  };
7333
7334
  Popover.displayName = "Popover";
@@ -45499,10 +45500,10 @@ function getToastPosition(position) {
45499
45500
  }
45500
45501
  }
45501
45502
  function renderPatternChildren(children, onDismiss, parentId = "root", parentPath = "root", sourceTrait) {
45502
- if (!children || !Array.isArray(children) || children.length === 0) {
45503
- return null;
45504
- }
45505
- return children.map((child, index) => {
45503
+ if (children === void 0 || children === null) return null;
45504
+ const childrenArray = Array.isArray(children) ? children : typeof children === "string" || typeof children === "object" && "type" in children ? [children] : [];
45505
+ if (childrenArray.length === 0) return null;
45506
+ return childrenArray.map((child, index) => {
45506
45507
  if (typeof child === "string") {
45507
45508
  const match = TRAIT_BINDING_RE.exec(child);
45508
45509
  if (match) {
@@ -45643,7 +45644,8 @@ function SlotContentRenderer({
45643
45644
  const PatternComponent = getComponentForPattern(content.pattern);
45644
45645
  if (PatternComponent) {
45645
45646
  const childrenConfig = content.props.children;
45646
- const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0;
45647
+ const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
45648
+ const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0 || isSingleChild;
45647
45649
  const myPath = patternPath ?? "root";
45648
45650
  const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait) : void 0;
45649
45651
  const incomingChildren = content.props.children;
@@ -8912,36 +8912,37 @@ var init_Popover = __esm({
8912
8912
  ...triggerProps
8913
8913
  }
8914
8914
  );
8915
+ const panel = isOpen && triggerRect ? /* @__PURE__ */ jsxRuntime.jsxs(
8916
+ "div",
8917
+ {
8918
+ ref: popoverRef,
8919
+ className: cn(
8920
+ "fixed z-50 p-4",
8921
+ "bg-card border-2 border-border shadow-lg",
8922
+ positionClasses2[position],
8923
+ className
8924
+ ),
8925
+ style: computePopoverStyle(position, triggerRect, popoverWidth),
8926
+ role: "dialog",
8927
+ onMouseEnter: trigger === "hover" ? handleOpen : void 0,
8928
+ onMouseLeave: trigger === "hover" ? handleClose : void 0,
8929
+ children: [
8930
+ typeof content === "string" ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", children: content }) : content,
8931
+ showArrow && /* @__PURE__ */ jsxRuntime.jsx(
8932
+ "div",
8933
+ {
8934
+ className: cn(
8935
+ "absolute w-0 h-0 border-4",
8936
+ arrowClasses2[position]
8937
+ )
8938
+ }
8939
+ )
8940
+ ]
8941
+ }
8942
+ ) : null;
8915
8943
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8916
8944
  triggerElement,
8917
- isOpen && triggerRect && /* @__PURE__ */ jsxRuntime.jsxs(
8918
- "div",
8919
- {
8920
- ref: popoverRef,
8921
- className: cn(
8922
- "fixed z-50 p-4",
8923
- "bg-card border-2 border-border shadow-lg",
8924
- positionClasses2[position],
8925
- className
8926
- ),
8927
- style: computePopoverStyle(position, triggerRect, popoverWidth),
8928
- role: "dialog",
8929
- onMouseEnter: trigger === "hover" ? handleOpen : void 0,
8930
- onMouseLeave: trigger === "hover" ? handleClose : void 0,
8931
- children: [
8932
- typeof content === "string" ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", children: content }) : content,
8933
- showArrow && /* @__PURE__ */ jsxRuntime.jsx(
8934
- "div",
8935
- {
8936
- className: cn(
8937
- "absolute w-0 h-0 border-4",
8938
- arrowClasses2[position]
8939
- )
8940
- }
8941
- )
8942
- ]
8943
- }
8944
- )
8945
+ panel && typeof document !== "undefined" ? reactDom.createPortal(panel, document.body) : panel
8945
8946
  ] });
8946
8947
  };
8947
8948
  Popover.displayName = "Popover";
@@ -45866,10 +45867,10 @@ function getToastPosition(position) {
45866
45867
  }
45867
45868
  }
45868
45869
  function renderPatternChildren(children, onDismiss, parentId = "root", parentPath = "root", sourceTrait) {
45869
- if (!children || !Array.isArray(children) || children.length === 0) {
45870
- return null;
45871
- }
45872
- return children.map((child, index) => {
45870
+ if (children === void 0 || children === null) return null;
45871
+ const childrenArray = Array.isArray(children) ? children : typeof children === "string" || typeof children === "object" && "type" in children ? [children] : [];
45872
+ if (childrenArray.length === 0) return null;
45873
+ return childrenArray.map((child, index) => {
45873
45874
  if (typeof child === "string") {
45874
45875
  const match = TRAIT_BINDING_RE.exec(child);
45875
45876
  if (match) {
@@ -46010,7 +46011,8 @@ function SlotContentRenderer({
46010
46011
  const PatternComponent = getComponentForPattern(content.pattern);
46011
46012
  if (PatternComponent) {
46012
46013
  const childrenConfig = content.props.children;
46013
- const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0;
46014
+ const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
46015
+ const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0 || isSingleChild;
46014
46016
  const myPath = patternPath ?? "root";
46015
46017
  const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait) : void 0;
46016
46018
  const incomingChildren = content.props.children;
@@ -8866,36 +8866,37 @@ var init_Popover = __esm({
8866
8866
  ...triggerProps
8867
8867
  }
8868
8868
  );
8869
+ const panel = isOpen && triggerRect ? /* @__PURE__ */ jsxs(
8870
+ "div",
8871
+ {
8872
+ ref: popoverRef,
8873
+ className: cn(
8874
+ "fixed z-50 p-4",
8875
+ "bg-card border-2 border-border shadow-lg",
8876
+ positionClasses2[position],
8877
+ className
8878
+ ),
8879
+ style: computePopoverStyle(position, triggerRect, popoverWidth),
8880
+ role: "dialog",
8881
+ onMouseEnter: trigger === "hover" ? handleOpen : void 0,
8882
+ onMouseLeave: trigger === "hover" ? handleClose : void 0,
8883
+ children: [
8884
+ typeof content === "string" ? /* @__PURE__ */ jsx(Typography, { variant: "body", children: content }) : content,
8885
+ showArrow && /* @__PURE__ */ jsx(
8886
+ "div",
8887
+ {
8888
+ className: cn(
8889
+ "absolute w-0 h-0 border-4",
8890
+ arrowClasses2[position]
8891
+ )
8892
+ }
8893
+ )
8894
+ ]
8895
+ }
8896
+ ) : null;
8869
8897
  return /* @__PURE__ */ jsxs(Fragment, { children: [
8870
8898
  triggerElement,
8871
- isOpen && triggerRect && /* @__PURE__ */ jsxs(
8872
- "div",
8873
- {
8874
- ref: popoverRef,
8875
- className: cn(
8876
- "fixed z-50 p-4",
8877
- "bg-card border-2 border-border shadow-lg",
8878
- positionClasses2[position],
8879
- className
8880
- ),
8881
- style: computePopoverStyle(position, triggerRect, popoverWidth),
8882
- role: "dialog",
8883
- onMouseEnter: trigger === "hover" ? handleOpen : void 0,
8884
- onMouseLeave: trigger === "hover" ? handleClose : void 0,
8885
- children: [
8886
- typeof content === "string" ? /* @__PURE__ */ jsx(Typography, { variant: "body", children: content }) : content,
8887
- showArrow && /* @__PURE__ */ jsx(
8888
- "div",
8889
- {
8890
- className: cn(
8891
- "absolute w-0 h-0 border-4",
8892
- arrowClasses2[position]
8893
- )
8894
- }
8895
- )
8896
- ]
8897
- }
8898
- )
8899
+ panel && typeof document !== "undefined" ? createPortal(panel, document.body) : panel
8899
8900
  ] });
8900
8901
  };
8901
8902
  Popover.displayName = "Popover";
@@ -45820,10 +45821,10 @@ function getToastPosition(position) {
45820
45821
  }
45821
45822
  }
45822
45823
  function renderPatternChildren(children, onDismiss, parentId = "root", parentPath = "root", sourceTrait) {
45823
- if (!children || !Array.isArray(children) || children.length === 0) {
45824
- return null;
45825
- }
45826
- return children.map((child, index) => {
45824
+ if (children === void 0 || children === null) return null;
45825
+ const childrenArray = Array.isArray(children) ? children : typeof children === "string" || typeof children === "object" && "type" in children ? [children] : [];
45826
+ if (childrenArray.length === 0) return null;
45827
+ return childrenArray.map((child, index) => {
45827
45828
  if (typeof child === "string") {
45828
45829
  const match = TRAIT_BINDING_RE.exec(child);
45829
45830
  if (match) {
@@ -45964,7 +45965,8 @@ function SlotContentRenderer({
45964
45965
  const PatternComponent = getComponentForPattern(content.pattern);
45965
45966
  if (PatternComponent) {
45966
45967
  const childrenConfig = content.props.children;
45967
- const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0;
45968
+ const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
45969
+ const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0 || isSingleChild;
45968
45970
  const myPath = patternPath ?? "root";
45969
45971
  const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait) : void 0;
45970
45972
  const incomingChildren = content.props.children;
@@ -8800,36 +8800,37 @@ var init_Popover = __esm({
8800
8800
  ...triggerProps
8801
8801
  }
8802
8802
  );
8803
+ const panel = isOpen && triggerRect ? /* @__PURE__ */ jsxRuntime.jsxs(
8804
+ "div",
8805
+ {
8806
+ ref: popoverRef,
8807
+ className: cn(
8808
+ "fixed z-50 p-4",
8809
+ "bg-card border-2 border-border shadow-lg",
8810
+ positionClasses2[position],
8811
+ className
8812
+ ),
8813
+ style: computePopoverStyle(position, triggerRect, popoverWidth),
8814
+ role: "dialog",
8815
+ onMouseEnter: trigger === "hover" ? handleOpen : void 0,
8816
+ onMouseLeave: trigger === "hover" ? handleClose : void 0,
8817
+ children: [
8818
+ typeof content === "string" ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", children: content }) : content,
8819
+ showArrow && /* @__PURE__ */ jsxRuntime.jsx(
8820
+ "div",
8821
+ {
8822
+ className: cn(
8823
+ "absolute w-0 h-0 border-4",
8824
+ arrowClasses2[position]
8825
+ )
8826
+ }
8827
+ )
8828
+ ]
8829
+ }
8830
+ ) : null;
8803
8831
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8804
8832
  triggerElement,
8805
- isOpen && triggerRect && /* @__PURE__ */ jsxRuntime.jsxs(
8806
- "div",
8807
- {
8808
- ref: popoverRef,
8809
- className: cn(
8810
- "fixed z-50 p-4",
8811
- "bg-card border-2 border-border shadow-lg",
8812
- positionClasses2[position],
8813
- className
8814
- ),
8815
- style: computePopoverStyle(position, triggerRect, popoverWidth),
8816
- role: "dialog",
8817
- onMouseEnter: trigger === "hover" ? handleOpen : void 0,
8818
- onMouseLeave: trigger === "hover" ? handleClose : void 0,
8819
- children: [
8820
- typeof content === "string" ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", children: content }) : content,
8821
- showArrow && /* @__PURE__ */ jsxRuntime.jsx(
8822
- "div",
8823
- {
8824
- className: cn(
8825
- "absolute w-0 h-0 border-4",
8826
- arrowClasses2[position]
8827
- )
8828
- }
8829
- )
8830
- ]
8831
- }
8832
- )
8833
+ panel && typeof document !== "undefined" ? reactDom.createPortal(panel, document.body) : panel
8833
8834
  ] });
8834
8835
  };
8835
8836
  Popover.displayName = "Popover";
@@ -45452,10 +45453,10 @@ function getToastPosition(position) {
45452
45453
  }
45453
45454
  }
45454
45455
  function renderPatternChildren(children, onDismiss, parentId = "root", parentPath = "root", sourceTrait) {
45455
- if (!children || !Array.isArray(children) || children.length === 0) {
45456
- return null;
45457
- }
45458
- return children.map((child, index) => {
45456
+ if (children === void 0 || children === null) return null;
45457
+ const childrenArray = Array.isArray(children) ? children : typeof children === "string" || typeof children === "object" && "type" in children ? [children] : [];
45458
+ if (childrenArray.length === 0) return null;
45459
+ return childrenArray.map((child, index) => {
45459
45460
  if (typeof child === "string") {
45460
45461
  const match = TRAIT_BINDING_RE.exec(child);
45461
45462
  if (match) {
@@ -45596,7 +45597,8 @@ function SlotContentRenderer({
45596
45597
  const PatternComponent = getComponentForPattern(content.pattern);
45597
45598
  if (PatternComponent) {
45598
45599
  const childrenConfig = content.props.children;
45599
- const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0;
45600
+ const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
45601
+ const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0 || isSingleChild;
45600
45602
  const myPath = patternPath ?? "root";
45601
45603
  const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait) : void 0;
45602
45604
  const incomingChildren = content.props.children;
@@ -8754,36 +8754,37 @@ var init_Popover = __esm({
8754
8754
  ...triggerProps
8755
8755
  }
8756
8756
  );
8757
+ const panel = isOpen && triggerRect ? /* @__PURE__ */ jsxs(
8758
+ "div",
8759
+ {
8760
+ ref: popoverRef,
8761
+ className: cn(
8762
+ "fixed z-50 p-4",
8763
+ "bg-card border-2 border-border shadow-lg",
8764
+ positionClasses2[position],
8765
+ className
8766
+ ),
8767
+ style: computePopoverStyle(position, triggerRect, popoverWidth),
8768
+ role: "dialog",
8769
+ onMouseEnter: trigger === "hover" ? handleOpen : void 0,
8770
+ onMouseLeave: trigger === "hover" ? handleClose : void 0,
8771
+ children: [
8772
+ typeof content === "string" ? /* @__PURE__ */ jsx(Typography, { variant: "body", children: content }) : content,
8773
+ showArrow && /* @__PURE__ */ jsx(
8774
+ "div",
8775
+ {
8776
+ className: cn(
8777
+ "absolute w-0 h-0 border-4",
8778
+ arrowClasses2[position]
8779
+ )
8780
+ }
8781
+ )
8782
+ ]
8783
+ }
8784
+ ) : null;
8757
8785
  return /* @__PURE__ */ jsxs(Fragment, { children: [
8758
8786
  triggerElement,
8759
- isOpen && triggerRect && /* @__PURE__ */ jsxs(
8760
- "div",
8761
- {
8762
- ref: popoverRef,
8763
- className: cn(
8764
- "fixed z-50 p-4",
8765
- "bg-card border-2 border-border shadow-lg",
8766
- positionClasses2[position],
8767
- className
8768
- ),
8769
- style: computePopoverStyle(position, triggerRect, popoverWidth),
8770
- role: "dialog",
8771
- onMouseEnter: trigger === "hover" ? handleOpen : void 0,
8772
- onMouseLeave: trigger === "hover" ? handleClose : void 0,
8773
- children: [
8774
- typeof content === "string" ? /* @__PURE__ */ jsx(Typography, { variant: "body", children: content }) : content,
8775
- showArrow && /* @__PURE__ */ jsx(
8776
- "div",
8777
- {
8778
- className: cn(
8779
- "absolute w-0 h-0 border-4",
8780
- arrowClasses2[position]
8781
- )
8782
- }
8783
- )
8784
- ]
8785
- }
8786
- )
8787
+ panel && typeof document !== "undefined" ? createPortal(panel, document.body) : panel
8787
8788
  ] });
8788
8789
  };
8789
8790
  Popover.displayName = "Popover";
@@ -45406,10 +45407,10 @@ function getToastPosition(position) {
45406
45407
  }
45407
45408
  }
45408
45409
  function renderPatternChildren(children, onDismiss, parentId = "root", parentPath = "root", sourceTrait) {
45409
- if (!children || !Array.isArray(children) || children.length === 0) {
45410
- return null;
45411
- }
45412
- return children.map((child, index) => {
45410
+ if (children === void 0 || children === null) return null;
45411
+ const childrenArray = Array.isArray(children) ? children : typeof children === "string" || typeof children === "object" && "type" in children ? [children] : [];
45412
+ if (childrenArray.length === 0) return null;
45413
+ return childrenArray.map((child, index) => {
45413
45414
  if (typeof child === "string") {
45414
45415
  const match = TRAIT_BINDING_RE.exec(child);
45415
45416
  if (match) {
@@ -45550,7 +45551,8 @@ function SlotContentRenderer({
45550
45551
  const PatternComponent = getComponentForPattern(content.pattern);
45551
45552
  if (PatternComponent) {
45552
45553
  const childrenConfig = content.props.children;
45553
- const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0;
45554
+ const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
45555
+ const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0 || isSingleChild;
45554
45556
  const myPath = patternPath ?? "root";
45555
45557
  const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait) : void 0;
45556
45558
  const incomingChildren = content.props.children;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "4.54.3",
3
+ "version": "4.54.5",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "sideEffects": [