@uniformdev/design-system 20.53.0 → 20.53.1

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/esm/index.js CHANGED
@@ -11895,7 +11895,7 @@ var LoadingIndicator = ({ size = "lg", color = "gray", ...props }) => {
11895
11895
  // src/components/Modal/Modal.tsx
11896
11896
  import { PortalContext } from "@ariakit/react";
11897
11897
  import { CgClose as CgClose5 } from "@react-icons/all-files/cg/CgClose";
11898
- import React16, { useEffect as useEffect17, useRef as useRef11 } from "react";
11898
+ import React16, { useCallback as useCallback9, useEffect as useEffect17, useRef as useRef11, useState as useState16 } from "react";
11899
11899
 
11900
11900
  // src/components/Modal/Modal.styles.ts
11901
11901
  import { css as css83 } from "@emotion/react";
@@ -12001,6 +12001,19 @@ var Modal = React16.forwardRef(
12001
12001
  }, ref) => {
12002
12002
  const mouseDownInsideModal = useRef11(false);
12003
12003
  const dialogRef = useRef11(null);
12004
+ const [portalTarget, setPortalTarget] = useState16(null);
12005
+ const setDialogRef = useCallback9(
12006
+ (element) => {
12007
+ dialogRef.current = element;
12008
+ setPortalTarget(element);
12009
+ if (typeof ref === "function") {
12010
+ ref(element);
12011
+ } else if (ref) {
12012
+ ref.current = element;
12013
+ }
12014
+ },
12015
+ [ref]
12016
+ );
12004
12017
  const size = {
12005
12018
  sm: modalSizeSmall,
12006
12019
  md: modalSizeMedium,
@@ -12029,17 +12042,7 @@ var Modal = React16.forwardRef(
12029
12042
  return /* @__PURE__ */ jsx108(
12030
12043
  "dialog",
12031
12044
  {
12032
- ref: (element) => {
12033
- dialogRef.current = element;
12034
- if (!ref) {
12035
- return;
12036
- }
12037
- if (typeof ref === "function") {
12038
- ref(element);
12039
- } else {
12040
- ref.current = element;
12041
- }
12042
- },
12045
+ ref: setDialogRef,
12043
12046
  css: [modalStyles, !width ? size[modalSize] : void 0],
12044
12047
  style: {
12045
12048
  width,
@@ -12064,7 +12067,7 @@ var Modal = React16.forwardRef(
12064
12067
  e.preventDefault();
12065
12068
  },
12066
12069
  ...modalProps,
12067
- children: /* @__PURE__ */ jsx108(PortalContext.Provider, { value: dialogRef.current, children: /* @__PURE__ */ jsxs73(
12070
+ children: /* @__PURE__ */ jsx108(PortalContext.Provider, { value: portalTarget, children: /* @__PURE__ */ jsxs73(
12068
12071
  "div",
12069
12072
  {
12070
12073
  css: [modalInnerStyles, { height: height === "auto" ? "auto" : "100%" }],
@@ -12448,7 +12451,7 @@ var ObjectGridItemCoverButton = ({
12448
12451
  };
12449
12452
 
12450
12453
  // src/components/Objects/ObjectGridItemHeading.tsx
12451
- import { useEffect as useEffect18, useRef as useRef12, useState as useState16 } from "react";
12454
+ import { useEffect as useEffect18, useRef as useRef12, useState as useState17 } from "react";
12452
12455
 
12453
12456
  // src/components/Objects/styles/ObjectGridItemHeading.styles.ts
12454
12457
  import { css as css87 } from "@emotion/react";
@@ -12474,7 +12477,7 @@ var ObjectGridItemHeading2 = ({
12474
12477
  tooltip,
12475
12478
  ...props
12476
12479
  }) => {
12477
- const [hasTruncation, setHasTruncation] = useState16(false);
12480
+ const [hasTruncation, setHasTruncation] = useState17(false);
12478
12481
  const headingRef = useRef12(null);
12479
12482
  const onStopPropagation = (e) => {
12480
12483
  e.stopPropagation();
@@ -13174,7 +13177,7 @@ var ParameterGroup = forwardRef21(
13174
13177
  import { forwardRef as forwardRef23, useDeferredValue } from "react";
13175
13178
 
13176
13179
  // src/components/ParameterInputs/ParameterImagePreview.tsx
13177
- import { useState as useState17 } from "react";
13180
+ import { useState as useState18 } from "react";
13178
13181
  import { createPortal as createPortal2 } from "react-dom";
13179
13182
 
13180
13183
  // src/components/ParameterInputs/styles/ParameterImage.styles.ts
@@ -13217,7 +13220,7 @@ var previewModalImage = css96`
13217
13220
  // src/components/ParameterInputs/ParameterImagePreview.tsx
13218
13221
  import { Fragment as Fragment13, jsx as jsx126, jsxs as jsxs85 } from "@emotion/react/jsx-runtime";
13219
13222
  function ParameterImagePreview({ imageSrc }) {
13220
- const [showModal, setShowModal] = useState17(false);
13223
+ const [showModal, setShowModal] = useState18(false);
13221
13224
  return imageSrc ? /* @__PURE__ */ jsxs85("div", { css: previewWrapper, children: [
13222
13225
  /* @__PURE__ */ jsx126(PreviewImageModal, { open: showModal, imageSrc, onRequestClose: () => setShowModal(false) }),
13223
13226
  /* @__PURE__ */ jsx126(
@@ -13249,7 +13252,7 @@ var PreviewImageModal = ({ open, onRequestClose, imageSrc }) => {
13249
13252
 
13250
13253
  // src/components/ParameterInputs/ParameterShell.tsx
13251
13254
  import { css as css99 } from "@emotion/react";
13252
- import { useState as useState18 } from "react";
13255
+ import { useState as useState19 } from "react";
13253
13256
 
13254
13257
  // src/components/ParameterInputs/styles/ParameterInput.styles.ts
13255
13258
  import { css as css97 } from "@emotion/react";
@@ -13697,7 +13700,7 @@ var ParameterShell = ({
13697
13700
  menuWithoutPortal,
13698
13701
  ...props
13699
13702
  }) => {
13700
- const [manualErrorMessage, setManualErrorMessage] = useState18(void 0);
13703
+ const [manualErrorMessage, setManualErrorMessage] = useState19(void 0);
13701
13704
  const setErrorMessage = (message) => setManualErrorMessage(message);
13702
13705
  const errorMessaging = errorMessage || manualErrorMessage;
13703
13706
  return /* @__PURE__ */ jsxs86("div", { css: inputContainer2, ...props, id, children: [
@@ -14209,10 +14212,10 @@ var ParameterNameAndPublicIdInput = ({
14209
14212
  import { forwardRef as forwardRef27 } from "react";
14210
14213
 
14211
14214
  // src/components/Slider/Slider.tsx
14212
- import { forwardRef as forwardRef26, useCallback as useCallback9, useMemo as useMemo8 } from "react";
14215
+ import { forwardRef as forwardRef26, useCallback as useCallback10, useMemo as useMemo8 } from "react";
14213
14216
 
14214
14217
  // src/components/Slider/SliderLabels.tsx
14215
- import { useEffect as useEffect19, useRef as useRef14, useState as useState19 } from "react";
14218
+ import { useEffect as useEffect19, useRef as useRef14, useState as useState20 } from "react";
14216
14219
 
14217
14220
  // src/components/Slider/styles/Slider.styles.ts
14218
14221
  import { css as css100 } from "@emotion/react";
@@ -14638,7 +14641,7 @@ function calculateLabelVisibility(ticks, currentValue, containerWidth) {
14638
14641
  }
14639
14642
  function SliderLabels({ ticks, currentValue, containerWidth = 300 }) {
14640
14643
  const containerRef = useRef14(null);
14641
- const [measuredWidth, setMeasuredWidth] = useState19(containerWidth);
14644
+ const [measuredWidth, setMeasuredWidth] = useState20(containerWidth);
14642
14645
  useEffect19(() => {
14643
14646
  if (containerRef.current) {
14644
14647
  const resizeObserver = new ResizeObserver((entries) => {
@@ -14771,14 +14774,14 @@ var Slider = forwardRef26(
14771
14774
  }, [isOptionsMode, options, propMin, propMax, propStep]);
14772
14775
  const isValueUnset = value === void 0 || value === null || typeof value === "number" && isNaN(value);
14773
14776
  const clampedValue = isValueUnset ? min : Math.min(Math.max(value, min), max);
14774
- const handleSliderChange = useCallback9(
14777
+ const handleSliderChange = useCallback10(
14775
14778
  (event) => {
14776
14779
  const newValue = Number(event.target.value);
14777
14780
  onChange(newValue);
14778
14781
  },
14779
14782
  [onChange]
14780
14783
  );
14781
- const handleNumberInputChange = useCallback9(
14784
+ const handleNumberInputChange = useCallback10(
14782
14785
  (event) => {
14783
14786
  if (event.target.value === "") {
14784
14787
  onChange(void 0);
@@ -15017,7 +15020,7 @@ var defaultParameterConfiguration = {
15017
15020
  // src/components/ParameterInputs/ParameterRichText.tsx
15018
15021
  import { deepEqual as deepEqual2 } from "fast-equals";
15019
15022
  import { ParagraphNode as ParagraphNode2 } from "lexical";
15020
- import { useEffect as useEffect28, useState as useState25 } from "react";
15023
+ import { useEffect as useEffect28, useState as useState26 } from "react";
15021
15024
 
15022
15025
  // src/components/ParameterInputs/rich-text/CustomCodeNode.ts
15023
15026
  import { CodeNode } from "@lexical/code";
@@ -15374,7 +15377,7 @@ import {
15374
15377
  FOCUS_COMMAND,
15375
15378
  PASTE_COMMAND
15376
15379
  } from "lexical";
15377
- import { useCallback as useCallback10, useEffect as useEffect22, useRef as useRef15, useState as useState20 } from "react";
15380
+ import { useCallback as useCallback11, useEffect as useEffect22, useRef as useRef15, useState as useState21 } from "react";
15378
15381
 
15379
15382
  // src/components/ParameterInputs/rich-text/utils.ts
15380
15383
  import { $isAtNodeEnd } from "@lexical/selection";
@@ -15747,10 +15750,10 @@ function LinkNodePlugin({
15747
15750
  return path;
15748
15751
  };
15749
15752
  const [editor] = useLexicalComposerContext3();
15750
- const [linkPopoverState, setLinkPopoverState] = useState20();
15753
+ const [linkPopoverState, setLinkPopoverState] = useState21();
15751
15754
  const linkPopoverElRef = useRef15(null);
15752
- const [isEditorFocused, setIsEditorFocused] = useState20(false);
15753
- const [isLinkPopoverFocused, setIsLinkPopoverFocused] = useState20(false);
15755
+ const [isEditorFocused, setIsEditorFocused] = useState21(false);
15756
+ const [isLinkPopoverFocused, setIsLinkPopoverFocused] = useState21(false);
15754
15757
  useEffect22(() => {
15755
15758
  if (!isEditorFocused && !isLinkPopoverFocused) {
15756
15759
  setLinkPopoverState(void 0);
@@ -15861,7 +15864,7 @@ function LinkNodePlugin({
15861
15864
  )
15862
15865
  );
15863
15866
  }, [editor, onConnectLink]);
15864
- const maybeShowLinkToolbar = useCallback10(() => {
15867
+ const maybeShowLinkToolbar = useCallback11(() => {
15865
15868
  if (!editor.isEditable()) {
15866
15869
  return;
15867
15870
  }
@@ -16121,7 +16124,7 @@ import {
16121
16124
  TableCellNode
16122
16125
  } from "@lexical/table";
16123
16126
  import { $getSelection as $getSelection3, $isRangeSelection as $isRangeSelection3, $setSelection } from "lexical";
16124
- import { forwardRef as forwardRef28, useCallback as useCallback11, useEffect as useEffect24, useLayoutEffect, useState as useState21 } from "react";
16127
+ import { forwardRef as forwardRef28, useCallback as useCallback12, useEffect as useEffect24, useLayoutEffect, useState as useState22 } from "react";
16125
16128
  import { jsx as jsx140, jsxs as jsxs92 } from "@emotion/react/jsx-runtime";
16126
16129
  function computeSelectionCount(selection) {
16127
16130
  const selectionShape = selection.getShape();
@@ -16136,7 +16139,7 @@ var tableActionMenuTrigger = css103`
16136
16139
  `;
16137
16140
  var TableActionMenuTrigger = forwardRef28((props, ref) => {
16138
16141
  const { tableCellEl, positioningAnchorEl, ...rest } = props;
16139
- const [coordinates, setCoordinates] = useState21({ x: 0, y: 0 });
16142
+ const [coordinates, setCoordinates] = useState22({ x: 0, y: 0 });
16140
16143
  useLayoutEffect(() => {
16141
16144
  const rect = tableCellEl.getBoundingClientRect();
16142
16145
  const parentRect = positioningAnchorEl.getBoundingClientRect();
@@ -16170,12 +16173,12 @@ function TableActionMenu({
16170
16173
  positioningAnchorEl
16171
16174
  }) {
16172
16175
  const [editor] = useLexicalComposerContext5();
16173
- const [tableCellNode, updateTableCellNode] = useState21(_tableCellNode);
16174
- const [selectionCounts, updateSelectionCounts] = useState21({
16176
+ const [tableCellNode, updateTableCellNode] = useState22(_tableCellNode);
16177
+ const [selectionCounts, updateSelectionCounts] = useState22({
16175
16178
  columns: 1,
16176
16179
  rows: 1
16177
16180
  });
16178
- const [menuTriggerKey, setMenuTriggerKey] = useState21(0);
16181
+ const [menuTriggerKey, setMenuTriggerKey] = useState22(0);
16179
16182
  const incrementMenuTriggerKey = () => {
16180
16183
  setMenuTriggerKey((key) => key += 1);
16181
16184
  };
@@ -16201,7 +16204,7 @@ function TableActionMenu({
16201
16204
  }
16202
16205
  });
16203
16206
  }, [editor]);
16204
- const clearTableSelection = useCallback11(() => {
16207
+ const clearTableSelection = useCallback12(() => {
16205
16208
  editor.update(() => {
16206
16209
  if (tableCellNode.isAttached()) {
16207
16210
  const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
@@ -16218,7 +16221,7 @@ function TableActionMenu({
16218
16221
  $setSelection(null);
16219
16222
  });
16220
16223
  }, [editor, tableCellNode]);
16221
- const insertTableRowAtSelection = useCallback11(
16224
+ const insertTableRowAtSelection = useCallback12(
16222
16225
  (shouldInsertAfter) => {
16223
16226
  editor.update(() => {
16224
16227
  for (let i = 0; i < selectionCounts.rows; i++) {
@@ -16228,7 +16231,7 @@ function TableActionMenu({
16228
16231
  },
16229
16232
  [editor, selectionCounts.rows]
16230
16233
  );
16231
- const insertTableColumnAtSelection = useCallback11(
16234
+ const insertTableColumnAtSelection = useCallback12(
16232
16235
  (shouldInsertAfter) => {
16233
16236
  editor.update(() => {
16234
16237
  for (let i = 0; i < selectionCounts.columns; i++) {
@@ -16238,26 +16241,26 @@ function TableActionMenu({
16238
16241
  },
16239
16242
  [editor, selectionCounts.columns]
16240
16243
  );
16241
- const deleteTableRowAtSelection = useCallback11(() => {
16244
+ const deleteTableRowAtSelection = useCallback12(() => {
16242
16245
  editor.update(() => {
16243
16246
  $deleteTableRowAtSelection();
16244
16247
  });
16245
16248
  incrementMenuTriggerKey();
16246
16249
  }, [editor]);
16247
- const deleteTableAtSelection = useCallback11(() => {
16250
+ const deleteTableAtSelection = useCallback12(() => {
16248
16251
  editor.update(() => {
16249
16252
  const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
16250
16253
  tableNode.remove();
16251
16254
  clearTableSelection();
16252
16255
  });
16253
16256
  }, [editor, tableCellNode, clearTableSelection]);
16254
- const deleteTableColumnAtSelection = useCallback11(() => {
16257
+ const deleteTableColumnAtSelection = useCallback12(() => {
16255
16258
  editor.update(() => {
16256
16259
  $deleteTableColumnAtSelection();
16257
16260
  });
16258
16261
  incrementMenuTriggerKey();
16259
16262
  }, [editor]);
16260
- const toggleTableRowIsHeader = useCallback11(() => {
16263
+ const toggleTableRowIsHeader = useCallback12(() => {
16261
16264
  editor.update(() => {
16262
16265
  const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
16263
16266
  const tableRowIndex = $getTableRowIndexFromTableCellNode(tableCellNode);
@@ -16277,7 +16280,7 @@ function TableActionMenu({
16277
16280
  clearTableSelection();
16278
16281
  });
16279
16282
  }, [editor, tableCellNode, clearTableSelection]);
16280
- const toggleTableColumnIsHeader = useCallback11(() => {
16283
+ const toggleTableColumnIsHeader = useCallback12(() => {
16281
16284
  editor.update(() => {
16282
16285
  const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
16283
16286
  const tableColumnIndex = $getTableColumnIndexFromTableCellNode(tableCellNode);
@@ -16368,9 +16371,9 @@ function TableCellActionMenuContainer({
16368
16371
  positioningAnchorEl
16369
16372
  }) {
16370
16373
  const [editor] = useLexicalComposerContext5();
16371
- const [tableCellNode, setTableMenuCellNode] = useState21(null);
16372
- const [tableCellNodeEl, _setTableMenuCellNodeEl] = useState21(null);
16373
- const [tableCellMenuPortalEl, setTableMenuCellMenuPortalEl] = useState21(null);
16374
+ const [tableCellNode, setTableMenuCellNode] = useState22(null);
16375
+ const [tableCellNodeEl, _setTableMenuCellNodeEl] = useState22(null);
16376
+ const [tableCellMenuPortalEl, setTableMenuCellMenuPortalEl] = useState22(null);
16374
16377
  useEffect24(() => {
16375
16378
  const newPortalEl = document.createElement("div");
16376
16379
  setTableMenuCellMenuPortalEl(newPortalEl);
@@ -16379,14 +16382,14 @@ function TableCellActionMenuContainer({
16379
16382
  newPortalEl.remove();
16380
16383
  };
16381
16384
  }, [menuPortalEl]);
16382
- const setTableMenuCellNodeElem = useCallback11((elem) => {
16385
+ const setTableMenuCellNodeElem = useCallback12((elem) => {
16383
16386
  if (elem) {
16384
16387
  _setTableMenuCellNodeEl(elem);
16385
16388
  } else {
16386
16389
  _setTableMenuCellNodeEl(null);
16387
16390
  }
16388
16391
  }, []);
16389
- const $moveMenu = useCallback11(() => {
16392
+ const $moveMenu = useCallback12(() => {
16390
16393
  const selection = $getSelection3();
16391
16394
  const nativeSelection = window.getSelection();
16392
16395
  const activeElement = document.activeElement;
@@ -16454,7 +16457,7 @@ import {
16454
16457
  } from "@lexical/table";
16455
16458
  import { calculateZoomLevel } from "@lexical/utils";
16456
16459
  import { $getNearestNodeFromDOMNode } from "lexical";
16457
- import { useCallback as useCallback12, useEffect as useEffect25, useMemo as useMemo9, useRef as useRef17, useState as useState22 } from "react";
16460
+ import { useCallback as useCallback13, useEffect as useEffect25, useMemo as useMemo9, useRef as useRef17, useState as useState23 } from "react";
16458
16461
  import { createPortal as createPortal3 } from "react-dom";
16459
16462
  import { Fragment as Fragment17, jsx as jsx141, jsxs as jsxs93 } from "@emotion/react/jsx-runtime";
16460
16463
  var MIN_ROW_HEIGHT = 33;
@@ -16485,11 +16488,11 @@ function TableCellResizer({ editor, positioningAnchorEl }) {
16485
16488
  const resizerRef = useRef17(null);
16486
16489
  const tableRectRef = useRef17(null);
16487
16490
  const mouseStartPosRef = useRef17(null);
16488
- const [mouseCurrentPos, updateMouseCurrentPos] = useState22(null);
16489
- const [activeCell, updateActiveCell] = useState22(null);
16490
- const [isMouseDown, updateIsMouseDown] = useState22(false);
16491
- const [draggingDirection, updateDraggingDirection] = useState22(null);
16492
- const resetState = useCallback12(() => {
16491
+ const [mouseCurrentPos, updateMouseCurrentPos] = useState23(null);
16492
+ const [activeCell, updateActiveCell] = useState23(null);
16493
+ const [isMouseDown, updateIsMouseDown] = useState23(false);
16494
+ const [draggingDirection, updateDraggingDirection] = useState23(null);
16495
+ const resetState = useCallback13(() => {
16493
16496
  updateActiveCell(null);
16494
16497
  targetRef.current = null;
16495
16498
  updateDraggingDirection(null);
@@ -16566,7 +16569,7 @@ function TableCellResizer({ editor, positioningAnchorEl }) {
16566
16569
  }
16567
16570
  return false;
16568
16571
  };
16569
- const updateRowHeight = useCallback12(
16572
+ const updateRowHeight = useCallback13(
16570
16573
  (heightChange) => {
16571
16574
  if (!activeCell) {
16572
16575
  throw new Error("TableCellResizer: Expected active cell.");
@@ -16628,7 +16631,7 @@ function TableCellResizer({ editor, positioningAnchorEl }) {
16628
16631
  }
16629
16632
  }
16630
16633
  };
16631
- const updateColumnWidth = useCallback12(
16634
+ const updateColumnWidth = useCallback13(
16632
16635
  (widthChange) => {
16633
16636
  if (!activeCell) {
16634
16637
  throw new Error("TableCellResizer: Expected active cell.");
@@ -16662,7 +16665,7 @@ function TableCellResizer({ editor, positioningAnchorEl }) {
16662
16665
  },
16663
16666
  [activeCell, editor]
16664
16667
  );
16665
- const mouseUpHandler = useCallback12(
16668
+ const mouseUpHandler = useCallback13(
16666
16669
  (direction) => {
16667
16670
  const handler = (event) => {
16668
16671
  event.preventDefault();
@@ -16691,7 +16694,7 @@ function TableCellResizer({ editor, positioningAnchorEl }) {
16691
16694
  },
16692
16695
  [activeCell, resetState, updateColumnWidth, updateRowHeight]
16693
16696
  );
16694
- const toggleResize = useCallback12(
16697
+ const toggleResize = useCallback13(
16695
16698
  (direction) => (event) => {
16696
16699
  event.preventDefault();
16697
16700
  event.stopPropagation();
@@ -16708,7 +16711,7 @@ function TableCellResizer({ editor, positioningAnchorEl }) {
16708
16711
  },
16709
16712
  [activeCell, mouseUpHandler]
16710
16713
  );
16711
- const getResizers = useCallback12(() => {
16714
+ const getResizers = useCallback13(() => {
16712
16715
  if (activeCell) {
16713
16716
  const { height, width, top, left } = activeCell.elem.getBoundingClientRect();
16714
16717
  const parentRect = positioningAnchorEl.getBoundingClientRect();
@@ -16798,10 +16801,10 @@ import {
16798
16801
  COMMAND_PRIORITY_NORMAL as COMMAND_PRIORITY_NORMAL2,
16799
16802
  SELECTION_CHANGE_COMMAND as SELECTION_CHANGE_COMMAND2
16800
16803
  } from "lexical";
16801
- import { useEffect as useEffect26, useState as useState23 } from "react";
16804
+ import { useEffect as useEffect26, useState as useState24 } from "react";
16802
16805
  var TableSelectionPlugin = () => {
16803
16806
  const [editor] = useLexicalComposerContext7();
16804
- const [closestTableCellNode, setClosestTableCellNode] = useState23(null);
16807
+ const [closestTableCellNode, setClosestTableCellNode] = useState24(null);
16805
16808
  useEffect26(() => {
16806
16809
  return editor.registerCommand(
16807
16810
  SELECTION_CHANGE_COMMAND2,
@@ -16871,7 +16874,7 @@ import {
16871
16874
  FORMAT_TEXT_COMMAND,
16872
16875
  SELECTION_CHANGE_COMMAND as SELECTION_CHANGE_COMMAND3
16873
16876
  } from "lexical";
16874
- import { useCallback as useCallback13, useEffect as useEffect27 } from "react";
16877
+ import { useCallback as useCallback14, useEffect as useEffect27 } from "react";
16875
16878
 
16876
16879
  // src/components/ParameterInputs/rich-text/toolbar/constants.ts
16877
16880
  var FORMATS_WITH_ICON = /* @__PURE__ */ new Map([
@@ -16887,7 +16890,7 @@ var HEADING_ELEMENTS = ["h1", "h2", "h3", "h4", "h5", "h6"];
16887
16890
  var TEXTUAL_ELEMENTS = HEADING_ELEMENTS;
16888
16891
 
16889
16892
  // src/components/ParameterInputs/rich-text/toolbar/useRichTextToolbarState.ts
16890
- import { useMemo as useMemo10, useState as useState24 } from "react";
16893
+ import { useMemo as useMemo10, useState as useState25 } from "react";
16891
16894
  var useRichTextToolbarState = ({ config }) => {
16892
16895
  var _a;
16893
16896
  const enabledBuiltInFormats = useMemo10(() => {
@@ -16908,7 +16911,7 @@ var useRichTextToolbarState = ({ config }) => {
16908
16911
  const enabledBuiltInFormatsWithoutIcon = enabledBuiltInFormats.filter(
16909
16912
  (format) => !FORMATS_WITH_ICON.has(format.type)
16910
16913
  );
16911
- const [activeFormats, setActiveFormats] = useState24([]);
16914
+ const [activeFormats, setActiveFormats] = useState25([]);
16912
16915
  const visibleFormatsWithIcon = useMemo10(() => {
16913
16916
  const visibleFormats = /* @__PURE__ */ new Set();
16914
16917
  activeFormats.filter((type) => FORMATS_WITH_ICON.has(type)).forEach((type) => {
@@ -16929,7 +16932,7 @@ var useRichTextToolbarState = ({ config }) => {
16929
16932
  });
16930
16933
  return richTextBuiltInFormats.filter((format) => visibleFormats.has(format.type));
16931
16934
  }, [activeFormats, enabledBuiltInFormatsWithoutIcon]);
16932
- const [activeElement, setActiveElement] = useState24("paragraph");
16935
+ const [activeElement, setActiveElement] = useState25("paragraph");
16933
16936
  const enabledTextualElements = enabledBuiltInElements.filter(
16934
16937
  (element) => TEXTUAL_ELEMENTS.includes(element.type)
16935
16938
  );
@@ -16944,7 +16947,7 @@ var useRichTextToolbarState = ({ config }) => {
16944
16947
  }
16945
16948
  );
16946
16949
  }, [activeElement, (_a = config == null ? void 0 : config.elements) == null ? void 0 : _a.builtIn, enabledTextualElements]);
16947
- const [isLink, setIsLink] = useState24(false);
16950
+ const [isLink, setIsLink] = useState25(false);
16948
16951
  const linkElementVisible = useMemo10(() => {
16949
16952
  return enabledBuiltInElements.some((element) => element.type === "link") || isLink;
16950
16953
  }, [isLink, enabledBuiltInElements]);
@@ -17133,7 +17136,7 @@ var RichTextToolbar = ({ config, customControls, onInsertTable, onInsertAsset })
17133
17136
  });
17134
17137
  });
17135
17138
  };
17136
- const updateToolbar = useCallback13(() => {
17139
+ const updateToolbar = useCallback14(() => {
17137
17140
  const selection = $getSelection5();
17138
17141
  if (!$isRangeSelection5(selection)) {
17139
17142
  return;
@@ -17608,13 +17611,13 @@ var RichText = ({
17608
17611
  useEffect28(() => {
17609
17612
  editor.setEditable(!readOnly);
17610
17613
  }, [editor, readOnly]);
17611
- const [editorContainerRef, setEditorContainerRef] = useState25(null);
17614
+ const [editorContainerRef, setEditorContainerRef] = useState26(null);
17612
17615
  const onEditorContainerRef = (_editorContainerRef) => {
17613
17616
  if (_editorContainerRef !== null) {
17614
17617
  setEditorContainerRef(_editorContainerRef);
17615
17618
  }
17616
17619
  };
17617
- const [portalContainerRef, setPortalContainerRef] = useState25(null);
17620
+ const [portalContainerRef, setPortalContainerRef] = useState26(null);
17618
17621
  const onPortalContainerRef = (_portalContainerRef) => {
17619
17622
  if (_portalContainerRef !== null) {
17620
17623
  setPortalContainerRef(_portalContainerRef);
@@ -17723,7 +17726,7 @@ var ParameterSelectInner = forwardRef29(
17723
17726
  );
17724
17727
 
17725
17728
  // src/components/ParameterInputs/ParameterSelectSlider.tsx
17726
- import { forwardRef as forwardRef30, useCallback as useCallback14, useMemo as useMemo11 } from "react";
17729
+ import { forwardRef as forwardRef30, useCallback as useCallback15, useMemo as useMemo11 } from "react";
17727
17730
  import { jsx as jsx145 } from "@emotion/react/jsx-runtime";
17728
17731
  var ParameterSelectSlider = forwardRef30(
17729
17732
  (props, ref) => {
@@ -17740,7 +17743,7 @@ var ParameterSelectSliderInner = forwardRef30(({ options, value, onChange, ...pr
17740
17743
  const index = options.findIndex((option) => option.value === value);
17741
17744
  return index >= 0 ? index : void 0;
17742
17745
  }, [options, value]);
17743
- const handleChange = useCallback14(
17746
+ const handleChange = useCallback15(
17744
17747
  (newValue) => {
17745
17748
  var _a;
17746
17749
  if (newValue === void 0) {
@@ -18022,7 +18025,7 @@ var ProgressListItem = ({
18022
18025
 
18023
18026
  // src/components/SegmentedControl/SegmentedControl.tsx
18024
18027
  import { css as css111 } from "@emotion/react";
18025
- import { useCallback as useCallback15, useEffect as useEffect29, useMemo as useMemo13, useRef as useRef18, useState as useState26 } from "react";
18028
+ import { useCallback as useCallback16, useEffect as useEffect29, useMemo as useMemo13, useRef as useRef18, useState as useState27 } from "react";
18026
18029
 
18027
18030
  // src/components/SegmentedControl/SegmentedControl.styles.ts
18028
18031
  import { css as css110 } from "@emotion/react";
@@ -18202,9 +18205,9 @@ var SegmentedControl = ({
18202
18205
  ...props
18203
18206
  }) => {
18204
18207
  const wrapperRef = useRef18(null);
18205
- const [isOverflowStartShadowVisible, setIsOverflowStartShadowVisible] = useState26(false);
18206
- const [isOverflowEndShadowVisible, setIsOverflowEndShadowVisible] = useState26(false);
18207
- const onOptionChange = useCallback15(
18208
+ const [isOverflowStartShadowVisible, setIsOverflowStartShadowVisible] = useState27(false);
18209
+ const [isOverflowEndShadowVisible, setIsOverflowEndShadowVisible] = useState27(false);
18210
+ const onOptionChange = useCallback16(
18208
18211
  (event) => {
18209
18212
  if (event.target.checked) {
18210
18213
  onChange == null ? void 0 : onChange(options[parseInt(event.target.value)].value);
@@ -18863,7 +18866,7 @@ var Spinner = ({
18863
18866
  };
18864
18867
 
18865
18868
  // src/components/StackedModal/hooks/StackedModalProvider.tsx
18866
- import { createContext as createContext6, useCallback as useCallback16, useContext as useContext6, useMemo as useMemo14, useRef as useRef20, useState as useState27 } from "react";
18869
+ import { createContext as createContext6, useCallback as useCallback17, useContext as useContext6, useMemo as useMemo14, useRef as useRef20, useState as useState28 } from "react";
18867
18870
  import { jsx as jsx153 } from "@emotion/react/jsx-runtime";
18868
18871
  var StackedModalContext = createContext6(null);
18869
18872
  function useStackedModal() {
@@ -18883,10 +18886,10 @@ function useStepTransition(index) {
18883
18886
  };
18884
18887
  }
18885
18888
  function StackedModalProvider({ children, totalSteps, initialStep }) {
18886
- const [currentStep, setCurrentStep] = useState27(initialStep);
18887
- const [direction, setDirection] = useState27("forward");
18889
+ const [currentStep, setCurrentStep] = useState28(initialStep);
18890
+ const [direction, setDirection] = useState28("forward");
18888
18891
  const previousStepRef = useRef20(initialStep);
18889
- const nextStep = useCallback16(() => {
18892
+ const nextStep = useCallback17(() => {
18890
18893
  setCurrentStep((prev) => {
18891
18894
  if (prev >= totalSteps - 1) {
18892
18895
  return prev;
@@ -18896,7 +18899,7 @@ function StackedModalProvider({ children, totalSteps, initialStep }) {
18896
18899
  return prev + 1;
18897
18900
  });
18898
18901
  }, [totalSteps]);
18899
- const goBack = useCallback16(() => {
18902
+ const goBack = useCallback17(() => {
18900
18903
  setCurrentStep((prev) => {
18901
18904
  if (prev <= 0) {
18902
18905
  return prev;
@@ -18906,7 +18909,7 @@ function StackedModalProvider({ children, totalSteps, initialStep }) {
18906
18909
  return prev - 1;
18907
18910
  });
18908
18911
  }, []);
18909
- const goToStep = useCallback16(
18912
+ const goToStep = useCallback17(
18910
18913
  (index) => {
18911
18914
  setCurrentStep((prev) => {
18912
18915
  if (index < 0 || index >= totalSteps || index === prev) {
@@ -19453,7 +19456,7 @@ import {
19453
19456
  TabProvider as AriakitTabProvider,
19454
19457
  useTabStore as useAriakitTabStore
19455
19458
  } from "@ariakit/react";
19456
- import { useCallback as useCallback17, useMemo as useMemo16 } from "react";
19459
+ import { useCallback as useCallback18, useMemo as useMemo16 } from "react";
19457
19460
 
19458
19461
  // src/components/Tabs/Tabs.styles.ts
19459
19462
  import { css as css117 } from "@emotion/react";
@@ -19501,7 +19504,7 @@ var Tabs = ({
19501
19504
  if (selectedId) return selectedId;
19502
19505
  return useHashForState && typeof window !== "undefined" && window.location.hash ? window.location.hash.substring(1) : void 0;
19503
19506
  }, [selectedId, useHashForState]);
19504
- const onTabSelect = useCallback17(
19507
+ const onTabSelect = useCallback18(
19505
19508
  (value) => {
19506
19509
  const selectedValueWithoutNull = value != null ? value : void 0;
19507
19510
  onSelectedIdChange == null ? void 0 : onSelectedIdChange(selectedValueWithoutNull);
package/dist/index.js CHANGED
@@ -13913,6 +13913,19 @@ var Modal = import_react131.default.forwardRef(
13913
13913
  }, ref) => {
13914
13914
  const mouseDownInsideModal = (0, import_react131.useRef)(false);
13915
13915
  const dialogRef = (0, import_react131.useRef)(null);
13916
+ const [portalTarget, setPortalTarget] = (0, import_react131.useState)(null);
13917
+ const setDialogRef = (0, import_react131.useCallback)(
13918
+ (element) => {
13919
+ dialogRef.current = element;
13920
+ setPortalTarget(element);
13921
+ if (typeof ref === "function") {
13922
+ ref(element);
13923
+ } else if (ref) {
13924
+ ref.current = element;
13925
+ }
13926
+ },
13927
+ [ref]
13928
+ );
13916
13929
  const size = {
13917
13930
  sm: modalSizeSmall,
13918
13931
  md: modalSizeMedium,
@@ -13941,17 +13954,7 @@ var Modal = import_react131.default.forwardRef(
13941
13954
  return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
13942
13955
  "dialog",
13943
13956
  {
13944
- ref: (element) => {
13945
- dialogRef.current = element;
13946
- if (!ref) {
13947
- return;
13948
- }
13949
- if (typeof ref === "function") {
13950
- ref(element);
13951
- } else {
13952
- ref.current = element;
13953
- }
13954
- },
13957
+ ref: setDialogRef,
13955
13958
  css: [modalStyles, !width ? size[modalSize] : void 0],
13956
13959
  style: {
13957
13960
  width,
@@ -13976,7 +13979,7 @@ var Modal = import_react131.default.forwardRef(
13976
13979
  e.preventDefault();
13977
13980
  },
13978
13981
  ...modalProps,
13979
- children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_react130.PortalContext.Provider, { value: dialogRef.current, children: /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
13982
+ children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_react130.PortalContext.Provider, { value: portalTarget, children: /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
13980
13983
  "div",
13981
13984
  {
13982
13985
  css: [modalInnerStyles, { height: height === "auto" ? "auto" : "100%" }],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/design-system",
3
- "version": "20.53.0",
3
+ "version": "20.53.1",
4
4
  "description": "Uniform design system components",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "exports": {
@@ -35,8 +35,8 @@
35
35
  "@storybook/react-vite": "10.1.0",
36
36
  "@types/react": "19.2.2",
37
37
  "@types/react-dom": "19.2.2",
38
- "@uniformdev/canvas": "^20.53.0",
39
- "@uniformdev/richtext": "^20.53.0",
38
+ "@uniformdev/canvas": "^20.53.1",
39
+ "@uniformdev/richtext": "^20.53.1",
40
40
  "autoprefixer": "10.4.21",
41
41
  "hygen": "6.2.11",
42
42
  "jsdom": "20.0.3",
@@ -88,5 +88,5 @@
88
88
  "publishConfig": {
89
89
  "access": "public"
90
90
  },
91
- "gitHead": "360d772af677a2ca8cb6b756208446ef096d698c"
91
+ "gitHead": "2a33fdce31a3a0f83b7b762356e03cdd65013a42"
92
92
  }