@uniformdev/design-system 19.24.0 → 19.25.1-alpha.8

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
@@ -11152,11 +11152,13 @@ import { css as css20 } from "@emotion/react";
11152
11152
  var MenuGroupContainer = css20`
11153
11153
  display: flex;
11154
11154
  flex-direction: column;
11155
+ margin-top: var(--spacing-sm);
11155
11156
  `;
11156
11157
  var MenuTitle = css20`
11157
11158
  color: var(--gray-400);
11158
11159
  font-size: var(--fs-xs);
11159
11160
  font-weight: var(--fw-bold);
11161
+ padding: var(--spacing-xs) var(--spacing-sm);
11160
11162
  text-transform: uppercase;
11161
11163
  `;
11162
11164
 
@@ -11171,7 +11173,12 @@ var MenuGroup = ({ title, children }) => {
11171
11173
 
11172
11174
  // src/components/Menu/MenuItem.styles.ts
11173
11175
  import { css as css21 } from "@emotion/react";
11174
- var menuItem = (textTheme) => css21`
11176
+ var activeMenuItem = css21`
11177
+ box-shadow: none;
11178
+ background: var(--gray-200);
11179
+ outline: none;
11180
+ `;
11181
+ var menuItem = (textTheme, forceActive) => css21`
11175
11182
  align-items: center;
11176
11183
  border: none;
11177
11184
  border-radius: var(--rounded-base);
@@ -11182,9 +11189,10 @@ var menuItem = (textTheme) => css21`
11182
11189
  font-weight: var(--fw-regular);
11183
11190
  flex-grow: 1;
11184
11191
  gap: var(--spacing-xs);
11185
- line-height: 1.5;
11192
+
11186
11193
  white-space: nowrap;
11187
11194
  transition: background-color var(--duration-fast) var(--timing-ease-out);
11195
+ ${forceActive ? activeMenuItem : ""}
11188
11196
 
11189
11197
  &:disabled {
11190
11198
  color: var(--gray-300);
@@ -11192,9 +11200,7 @@ var menuItem = (textTheme) => css21`
11192
11200
 
11193
11201
  &:hover,
11194
11202
  &:focus {
11195
- box-shadow: none;
11196
- background: var(--gray-200);
11197
- outline: none;
11203
+ ${typeof forceActive === "undefined" ? activeMenuItem : ""}
11198
11204
  }
11199
11205
  `;
11200
11206
  var menuItemWithIcon = css21`
@@ -11323,14 +11329,15 @@ import * as React8 from "react";
11323
11329
  import { MenuItem as BaseMenuItem } from "reakit";
11324
11330
  import { jsx as jsx24, jsxs as jsxs13 } from "@emotion/react/jsx-runtime";
11325
11331
  var MenuItem = React8.forwardRef(
11326
- ({ children, className, hideMenuOnClick = true, icon, textColor = "base", ...props }, ref) => {
11332
+ ({ children, className, hideMenuOnClick = true, icon, textColor = "base", active, ...props }, ref) => {
11327
11333
  const menuState = useMenuContext();
11328
11334
  const resolveProps = (originalProps) => {
11329
11335
  const resolvedProps2 = { ...originalProps };
11330
11336
  if (resolvedProps2.onClick) {
11331
11337
  const origOnClick = resolvedProps2.onClick;
11332
11338
  resolvedProps2.onClick = (e) => {
11333
- menuState.hide();
11339
+ var _a;
11340
+ (_a = menuState == null ? void 0 : menuState.hide) == null ? void 0 : _a.call(menuState);
11334
11341
  origOnClick(e);
11335
11342
  };
11336
11343
  }
@@ -11346,7 +11353,7 @@ var MenuItem = React8.forwardRef(
11346
11353
  "data-test-id": "button-menu",
11347
11354
  ...menuState,
11348
11355
  ...resolvedProps,
11349
- css: [menuItem(textColor), typeof className === "object" ? className : void 0],
11356
+ css: [menuItem(textColor, active), typeof className === "object" ? className : void 0],
11350
11357
  className: typeof className === "string" ? className : void 0,
11351
11358
  children: icon ? renderWithIcon(resolvedChildren, icon) : resolvedChildren
11352
11359
  }
@@ -12481,47 +12488,52 @@ var summaryIconVisiblyHidden = css38`
12481
12488
 
12482
12489
  // src/components/Details/Details.tsx
12483
12490
  import { jsx as jsx38, jsxs as jsxs21 } from "@emotion/react/jsx-runtime";
12484
- var Details = ({ summary: summary2, children, isOpenByDefault = false, ...props }) => {
12491
+ var Details = ({
12492
+ summary: summary2,
12493
+ children,
12494
+ isOpenByDefault = false,
12495
+ isOpen,
12496
+ onChange,
12497
+ ...props
12498
+ }) => {
12485
12499
  const detailsRef = React9.useRef(null);
12486
- const [open, setOpen] = React9.useState(isOpenByDefault);
12487
- React9.useEffect(() => {
12488
- var _a;
12489
- if (!detailsRef) {
12490
- return;
12500
+ const [internalOpen, setInternalOpen] = React9.useState(isOpenByDefault);
12501
+ const memoizedIsOpen = React9.useMemo(() => {
12502
+ return isOpen !== void 0 ? isOpen : internalOpen;
12503
+ }, [internalOpen, isOpen]);
12504
+ return /* @__PURE__ */ jsxs21(
12505
+ "details",
12506
+ {
12507
+ "data-testid": "details",
12508
+ onToggle: (e) => {
12509
+ setInternalOpen(e.currentTarget.open);
12510
+ onChange == null ? void 0 : onChange(e.currentTarget.open);
12511
+ },
12512
+ css: details,
12513
+ open: memoizedIsOpen,
12514
+ ref: detailsRef,
12515
+ ...props,
12516
+ children: [
12517
+ /* @__PURE__ */ jsxs21("summary", { "data-testid": "summary", css: summary, children: [
12518
+ /* @__PURE__ */ jsx38(
12519
+ Icon,
12520
+ {
12521
+ css: [!children ? summaryIconVisiblyHidden : void 0, summaryIcon],
12522
+ icon: "chevron-down",
12523
+ iconColor: "currentColor",
12524
+ size: "1.25rem"
12525
+ }
12526
+ ),
12527
+ summary2
12528
+ ] }),
12529
+ memoizedIsOpen ? /* @__PURE__ */ jsx38("div", { "data-testid": "details-content", css: detailsContent, children }) : null
12530
+ ]
12491
12531
  }
12492
- const toggleEvent = () => {
12493
- var _a2;
12494
- const toggle = Boolean((_a2 = detailsRef == null ? void 0 : detailsRef.current) == null ? void 0 : _a2.open);
12495
- setOpen(toggle);
12496
- };
12497
- (_a = detailsRef.current) == null ? void 0 : _a.addEventListener("toggle", toggleEvent);
12498
- () => {
12499
- var _a2;
12500
- return (_a2 = detailsRef.current) == null ? void 0 : _a2.removeEventListener("toggle", toggleEvent);
12501
- };
12502
- }, [detailsRef]);
12503
- React9.useEffect(() => {
12504
- setOpen(isOpenByDefault);
12505
- }, [isOpenByDefault]);
12506
- return /* @__PURE__ */ jsxs21("details", { "data-testid": "details", css: details, open, ref: detailsRef, ...props, children: [
12507
- /* @__PURE__ */ jsxs21("summary", { "data-testid": "summary", css: summary, children: [
12508
- /* @__PURE__ */ jsx38(
12509
- Icon,
12510
- {
12511
- css: [!children ? summaryIconVisiblyHidden : void 0, summaryIcon],
12512
- icon: "chevron-down",
12513
- iconColor: "currentColor",
12514
- size: "1.25rem"
12515
- }
12516
- ),
12517
- summary2
12518
- ] }),
12519
- open ? /* @__PURE__ */ jsx38("div", { "data-testid": "details-content", css: detailsContent, children }) : null
12520
- ] });
12532
+ );
12521
12533
  };
12522
12534
 
12523
12535
  // src/components/Drawer/Drawer.tsx
12524
- import React12, { useEffect as useEffect6, useMemo, useRef as useRef2 } from "react";
12536
+ import React12, { useEffect as useEffect5, useMemo as useMemo2, useRef as useRef2 } from "react";
12525
12537
  import { CgChevronRight } from "react-icons/cg";
12526
12538
 
12527
12539
  // src/components/Drawer/Drawer.styles.ts
@@ -12797,7 +12809,7 @@ var DrawerInner = ({
12797
12809
  }) => {
12798
12810
  const { registerDrawer, unregisterDrawer } = useDrawer();
12799
12811
  const closeButtonRef = useRef2(null);
12800
- const component = useMemo(() => {
12812
+ const component = useMemo2(() => {
12801
12813
  const headerId = `dialog-header-${stackId}-${id}`;
12802
12814
  return /* @__PURE__ */ jsxs23(
12803
12815
  "div",
@@ -12838,7 +12850,7 @@ var DrawerInner = ({
12838
12850
  }
12839
12851
  );
12840
12852
  }, [children, header, id, stackId, bgColor, onRequestClose, ref, testId]);
12841
- useEffect6(() => {
12853
+ useEffect5(() => {
12842
12854
  registerDrawer({
12843
12855
  drawer: {
12844
12856
  id,
@@ -12857,7 +12869,7 @@ var DrawerInner = ({
12857
12869
  }
12858
12870
  });
12859
12871
  }, [component, instanceKey, registerDrawer]);
12860
- useEffect6(() => {
12872
+ useEffect5(() => {
12861
12873
  return () => unregisterDrawer({ id, stackId, instanceKey });
12862
12874
  }, [id, stackId, instanceKey, unregisterDrawer]);
12863
12875
  return null;
@@ -14065,7 +14077,7 @@ var LoadingIndicator = ({ ...props }) => {
14065
14077
  };
14066
14078
 
14067
14079
  // src/components/LoadingOverlay/LoadingOverlay.tsx
14068
- import { useCallback as useCallback2, useEffect as useEffect7, useRef as useRef4 } from "react";
14080
+ import { useCallback as useCallback2, useEffect as useEffect6, useRef as useRef4 } from "react";
14069
14081
 
14070
14082
  // src/components/LoadingOverlay/LoadingOverlay.styles.ts
14071
14083
  import { css as css55 } from "@emotion/react";
@@ -14118,7 +14130,7 @@ var LoadingOverlay = ({
14118
14130
  (_c = lottieRef.current) == null ? void 0 : _c.stop();
14119
14131
  }
14120
14132
  }, [isPaused]);
14121
- useEffect7(() => {
14133
+ useEffect6(() => {
14122
14134
  var _a, _b, _c, _d, _e, _f;
14123
14135
  if (!isPaused && ((_b = (_a = lottieRef.current) == null ? void 0 : _a.animationItem) == null ? void 0 : _b.isPaused)) {
14124
14136
  (_c = lottieRef.current) == null ? void 0 : _c.play();
@@ -14447,7 +14459,7 @@ var EditTeamIntegrationTile = ({
14447
14459
 
14448
14460
  // src/components/Tiles/IntegrationComingSoon.tsx
14449
14461
  import { css as css58 } from "@emotion/react";
14450
- import { useEffect as useEffect8, useState as useState6 } from "react";
14462
+ import { useEffect as useEffect7, useState as useState6 } from "react";
14451
14463
  import { CgHeart } from "react-icons/cg";
14452
14464
  import { jsx as jsx70, jsxs as jsxs45 } from "@emotion/react/jsx-runtime";
14453
14465
  var IntegrationComingSoon = ({
@@ -14463,7 +14475,7 @@ var IntegrationComingSoon = ({
14463
14475
  setUpVote((prev) => !prev);
14464
14476
  onUpVoteClick();
14465
14477
  };
14466
- useEffect8(() => {
14478
+ useEffect7(() => {
14467
14479
  if (upVote) {
14468
14480
  const timer = setTimeout(() => setUpVote(false), timing);
14469
14481
  return () => {
@@ -15310,7 +15322,7 @@ var ParameterGroup = forwardRef8(
15310
15322
  );
15311
15323
 
15312
15324
  // src/components/ParameterInputs/ParameterImage.tsx
15313
- import { forwardRef as forwardRef10, useCallback as useCallback3, useDeferredValue, useEffect as useEffect9, useState as useState8 } from "react";
15325
+ import { forwardRef as forwardRef10, useCallback as useCallback3, useDeferredValue, useEffect as useEffect8, useState as useState8 } from "react";
15314
15326
 
15315
15327
  // src/components/ParameterInputs/ParameterShell.tsx
15316
15328
  import { useState as useState7 } from "react";
@@ -15552,7 +15564,7 @@ var ParameterImageInner = forwardRef10(
15552
15564
  handleManuallySetErrorMessage(errorText);
15553
15565
  }
15554
15566
  };
15555
- useEffect9(() => {
15567
+ useEffect8(() => {
15556
15568
  updateImageSrc();
15557
15569
  }, [deferredValue]);
15558
15570
  return /* @__PURE__ */ jsxs56(Fragment11, { children: [
@@ -15871,7 +15883,7 @@ var getLabelForElement = (type) => {
15871
15883
  // src/components/ParameterInputs/ParameterRichText.tsx
15872
15884
  import { deepEqual as deepEqual2 } from "fast-equals";
15873
15885
  import { ParagraphNode } from "lexical";
15874
- import { useEffect as useEffect13, useRef as useRef6 } from "react";
15886
+ import { useEffect as useEffect12, useRef as useRef6 } from "react";
15875
15887
 
15876
15888
  // src/components/ParameterInputs/rich-text/editorStyles.ts
15877
15889
  import { css as css71 } from "@emotion/css";
@@ -16065,7 +16077,7 @@ import {
16065
16077
  ElementNode as ElementNode2,
16066
16078
  FOCUS_COMMAND
16067
16079
  } from "lexical";
16068
- import { useCallback as useCallback4, useEffect as useEffect10, useRef as useRef5, useState as useState9 } from "react";
16080
+ import { useCallback as useCallback4, useEffect as useEffect9, useRef as useRef5, useState as useState9 } from "react";
16069
16081
 
16070
16082
  // src/components/Popover/Popover.styles.ts
16071
16083
  import { css as css72 } from "@emotion/react";
@@ -16325,6 +16337,26 @@ function removeLinkNode(node) {
16325
16337
  }
16326
16338
  node.remove();
16327
16339
  }
16340
+ function removeLinkNodeFromSelection() {
16341
+ const selection = $getSelection();
16342
+ if (!$isRangeSelection(selection)) {
16343
+ return;
16344
+ }
16345
+ const nodes = selection.extract();
16346
+ const linkNodesFound = /* @__PURE__ */ new Set();
16347
+ for (const node of nodes) {
16348
+ if ($isElementNode2(node) && !node.isInline()) {
16349
+ continue;
16350
+ }
16351
+ const linkNodeAncestor = getLinkAncestor(node);
16352
+ if (linkNodeAncestor) {
16353
+ linkNodesFound.add(linkNodeAncestor);
16354
+ }
16355
+ }
16356
+ for (const node of linkNodesFound) {
16357
+ removeLinkNode(node);
16358
+ }
16359
+ }
16328
16360
  function upsertLinkNode(props) {
16329
16361
  var _a, _b, _c, _d, _e;
16330
16362
  const selection = $getSelection();
@@ -16382,6 +16414,7 @@ function upsertLinkNode(props) {
16382
16414
  }
16383
16415
  }
16384
16416
  }
16417
+ var REMOVE_LINK_NODE_COMMAND = createCommand("REMOVE_LINK_NODE_COMMAND");
16385
16418
  var UPSERT_LINK_NODE_COMMAND = createCommand("UPSERT_LINK_NODE_COMMAND");
16386
16419
  var OPEN_LINK_NODE_MODAL_COMMAND = createCommand(
16387
16420
  "OPEN_LINK_NODE_MODAL_COMMAND"
@@ -16407,13 +16440,13 @@ function LinkNodePlugin({ onConnectLink }) {
16407
16440
  const linkPopoverElRef = useRef5(null);
16408
16441
  const [isEditorFocused, setIsEditorFocused] = useState9(false);
16409
16442
  const [isLinkPopoverFocused, setIsLinkPopoverFocused] = useState9(false);
16410
- useEffect10(() => {
16443
+ useEffect9(() => {
16411
16444
  if (!isEditorFocused && !isLinkPopoverFocused) {
16412
16445
  setLinkPopoverState(void 0);
16413
16446
  return;
16414
16447
  }
16415
16448
  }, [isEditorFocused, isLinkPopoverFocused]);
16416
- useEffect10(() => {
16449
+ useEffect9(() => {
16417
16450
  if (!editor.hasNodes([LinkNode])) {
16418
16451
  throw new Error("LinkNode not registered on editor");
16419
16452
  }
@@ -16426,6 +16459,14 @@ function LinkNodePlugin({ onConnectLink }) {
16426
16459
  },
16427
16460
  COMMAND_PRIORITY_EDITOR
16428
16461
  ),
16462
+ editor.registerCommand(
16463
+ REMOVE_LINK_NODE_COMMAND,
16464
+ () => {
16465
+ removeLinkNodeFromSelection();
16466
+ return true;
16467
+ },
16468
+ COMMAND_PRIORITY_EDITOR
16469
+ ),
16429
16470
  editor.registerCommand(
16430
16471
  OPEN_LINK_NODE_MODAL_COMMAND,
16431
16472
  () => {
@@ -16506,7 +16547,7 @@ function LinkNodePlugin({ onConnectLink }) {
16506
16547
  }
16507
16548
  });
16508
16549
  }, [editor]);
16509
- useEffect10(() => {
16550
+ useEffect9(() => {
16510
16551
  return editor.registerUpdateListener(({ editorState }) => {
16511
16552
  requestAnimationFrame(() => {
16512
16553
  editorState.read(() => {
@@ -16596,7 +16637,7 @@ import {
16596
16637
  COMMAND_PRIORITY_CRITICAL,
16597
16638
  INDENT_CONTENT_COMMAND
16598
16639
  } from "lexical";
16599
- import { useEffect as useEffect11 } from "react";
16640
+ import { useEffect as useEffect10 } from "react";
16600
16641
  import { jsx as jsx91 } from "@emotion/react/jsx-runtime";
16601
16642
  function isIndentPermitted(maxDepth) {
16602
16643
  const selection = $getSelection2();
@@ -16620,7 +16661,7 @@ function isIndentPermitted(maxDepth) {
16620
16661
  }
16621
16662
  function ListIndentPlugin({ maxDepth }) {
16622
16663
  const [editor] = useLexicalComposerContext2();
16623
- useEffect11(() => {
16664
+ useEffect10(() => {
16624
16665
  return editor.registerCommand(
16625
16666
  INDENT_CONTENT_COMMAND,
16626
16667
  () => !isIndentPermitted(maxDepth),
@@ -16641,30 +16682,19 @@ import {
16641
16682
  REMOVE_LIST_COMMAND
16642
16683
  } from "@lexical/list";
16643
16684
  import { useLexicalComposerContext as useLexicalComposerContext3 } from "@lexical/react/LexicalComposerContext";
16644
- import { $isDecoratorBlockNode } from "@lexical/react/LexicalDecoratorBlockNode";
16645
- import {
16646
- $createHeadingNode,
16647
- $createQuoteNode,
16648
- $isHeadingNode,
16649
- $isQuoteNode
16650
- } from "@lexical/rich-text";
16685
+ import { $createHeadingNode, $createQuoteNode, $isHeadingNode } from "@lexical/rich-text";
16651
16686
  import { $setBlocksType } from "@lexical/selection";
16652
- import {
16653
- $findMatchingParent,
16654
- $getNearestBlockElementAncestorOrThrow,
16655
- $getNearestNodeOfType
16656
- } from "@lexical/utils";
16687
+ import { $findMatchingParent, $getNearestNodeOfType } from "@lexical/utils";
16657
16688
  import {
16658
16689
  $createParagraphNode,
16659
16690
  $getSelection as $getSelection3,
16660
16691
  $isRangeSelection as $isRangeSelection3,
16661
16692
  $isRootOrShadowRoot,
16662
- $isTextNode,
16663
16693
  COMMAND_PRIORITY_CRITICAL as COMMAND_PRIORITY_CRITICAL2,
16664
16694
  FORMAT_TEXT_COMMAND,
16665
16695
  SELECTION_CHANGE_COMMAND
16666
16696
  } from "lexical";
16667
- import { useCallback as useCallback5, useEffect as useEffect12, useMemo as useMemo2, useState as useState10 } from "react";
16697
+ import { useCallback as useCallback5, useEffect as useEffect11, useMemo as useMemo3, useState as useState10 } from "react";
16668
16698
  import { Fragment as Fragment14, jsx as jsx92, jsxs as jsxs60 } from "@emotion/react/jsx-runtime";
16669
16699
  var toolbar = css74`
16670
16700
  background: var(--gray-50);
@@ -16719,40 +16749,35 @@ var toolbarChevron = css74`
16719
16749
  var ToolbarIcon = ({ icon }) => {
16720
16750
  return /* @__PURE__ */ jsx92(Icon, { icon, css: toolbarIcon, size: "1rem" });
16721
16751
  };
16752
+ var FORMATS_WITH_ICON = /* @__PURE__ */ new Map([
16753
+ ["bold", "format-bold"],
16754
+ ["italic", "format-italic"],
16755
+ ["underline", "format-underline"],
16756
+ ["strikethrough", "format-strike"],
16757
+ ["code", "format-code"],
16758
+ ["superscript", "format-superscript"],
16759
+ ["subscript", "format-subscript"]
16760
+ ]);
16761
+ var HEADING_ELEMENTS = ["h1", "h2", "h3", "h4", "h5", "h6"];
16762
+ var TEXTUAL_ELEMENTS = HEADING_ELEMENTS;
16722
16763
  var RichTextToolbar = ({ config }) => {
16723
16764
  const [editor] = useLexicalComposerContext3();
16724
- const enabledBuiltInFormats = richTextBuiltInFormats.filter(
16725
- (format) => {
16726
- var _a, _b;
16727
- return (_b = (_a = config == null ? void 0 : config.formatting) == null ? void 0 : _a.builtIn) == null ? void 0 : _b.includes(format.type);
16728
- }
16729
- );
16730
- const enabledBuiltInElements = richTextBuiltInElements.filter(
16731
- (element) => {
16732
- var _a, _b;
16733
- return (_b = (_a = config == null ? void 0 : config.elements) == null ? void 0 : _a.builtIn) == null ? void 0 : _b.includes(element.type);
16734
- }
16735
- );
16736
- const formatsWithIcon = /* @__PURE__ */ new Map([
16737
- ["bold", "format-bold"],
16738
- ["italic", "format-italic"],
16739
- ["underline", "format-underline"],
16740
- ["strikethrough", "format-strike"],
16741
- ["code", "format-code"],
16742
- ["superscript", "format-superscript"],
16743
- ["subscript", "format-subscript"]
16744
- ]);
16745
- const enabledBuiltInFormatsWithIcon = enabledBuiltInFormats.filter(
16746
- (format) => formatsWithIcon.has(format.type)
16747
- );
16748
- const enabledBuiltInFormatsWithoutIcon = enabledBuiltInFormats.filter(
16749
- (format) => !formatsWithIcon.has(format.type)
16750
- );
16751
- const [activeFormats, setActiveFormats] = useState10([]);
16752
- const [activeElement, setActiveElement] = useState10("paragraph");
16753
- const enabledTextualElements = enabledBuiltInElements.filter(
16754
- (element) => ["h1", "h2", "h3", "h4", "h5", "h6"].includes(element.type)
16755
- );
16765
+ const {
16766
+ activeElement,
16767
+ setActiveElement,
16768
+ activeFormats,
16769
+ setActiveFormats,
16770
+ visibleFormatsWithIcon,
16771
+ visibleFormatsWithoutIcon,
16772
+ visibleTextualElements,
16773
+ isLink,
16774
+ setIsLink,
16775
+ linkElementVisible,
16776
+ visibleLists,
16777
+ codeElementVisible,
16778
+ quoteElementVisible,
16779
+ visibleElementsWithIcons
16780
+ } = useRichTextToolbarState({ config });
16756
16781
  const onSelectElement = (type) => {
16757
16782
  if (activeElement === type) {
16758
16783
  return;
@@ -16762,7 +16787,7 @@ var RichTextToolbar = ({ config }) => {
16762
16787
  if (!$isRangeSelection3(selection)) {
16763
16788
  return;
16764
16789
  }
16765
- if (["h1", "h2", "h3", "h4", "h5", "h6"].includes(type)) {
16790
+ if (HEADING_ELEMENTS.includes(type)) {
16766
16791
  $setBlocksType(selection, () => $createHeadingNode(type));
16767
16792
  } else if (type === "paragraph") {
16768
16793
  $setBlocksType(selection, () => $createParagraphNode());
@@ -16773,28 +16798,13 @@ var RichTextToolbar = ({ config }) => {
16773
16798
  }
16774
16799
  });
16775
16800
  };
16776
- const [isLink, setIsLink] = useState10(false);
16777
- const linkElementEnabled = useMemo2(() => {
16778
- return enabledBuiltInElements.some((element) => element.type === "link");
16779
- }, [enabledBuiltInElements]);
16780
- const enabledLists = useMemo2(() => {
16781
- return new Set(
16782
- enabledBuiltInElements.filter((element) => ["orderedList", "unorderedList"].includes(element.type)).map((element) => element.type)
16783
- );
16784
- }, [enabledBuiltInElements]);
16785
- const quoteElementEnabled = useMemo2(() => {
16786
- return enabledBuiltInElements.some((element) => element.type === "quote");
16787
- }, [enabledBuiltInElements]);
16788
- const codeElementEnabled = useMemo2(() => {
16789
- return enabledBuiltInElements.some((element) => element.type === "code");
16790
- }, [enabledBuiltInElements]);
16791
16801
  const updateToolbar = useCallback5(() => {
16792
16802
  const selection = $getSelection3();
16793
16803
  if (!$isRangeSelection3(selection)) {
16794
16804
  return;
16795
16805
  }
16796
16806
  const newActiveFormats = [];
16797
- for (const format of enabledBuiltInFormats) {
16807
+ for (const format of richTextBuiltInFormats) {
16798
16808
  if (selection.hasFormat(format.type)) {
16799
16809
  newActiveFormats.push(format.type);
16800
16810
  }
@@ -16826,8 +16836,8 @@ var RichTextToolbar = ({ config }) => {
16826
16836
  } else {
16827
16837
  setIsLink(false);
16828
16838
  }
16829
- }, [editor, enabledBuiltInFormats]);
16830
- useEffect12(() => {
16839
+ }, [editor, setActiveElement, setActiveFormats, setIsLink]);
16840
+ useEffect11(() => {
16831
16841
  return editor.registerCommand(
16832
16842
  SELECTION_CHANGE_COMMAND,
16833
16843
  (_payload) => {
@@ -16837,7 +16847,7 @@ var RichTextToolbar = ({ config }) => {
16837
16847
  COMMAND_PRIORITY_CRITICAL2
16838
16848
  );
16839
16849
  }, [editor, updateToolbar]);
16840
- useEffect12(() => {
16850
+ useEffect11(() => {
16841
16851
  return editor.registerUpdateListener(({ editorState }) => {
16842
16852
  requestAnimationFrame(() => {
16843
16853
  editorState.read(() => {
@@ -16846,103 +16856,56 @@ var RichTextToolbar = ({ config }) => {
16846
16856
  });
16847
16857
  });
16848
16858
  }, [editor, updateToolbar]);
16849
- const clearFormatting2 = useCallback5(() => {
16850
- editor.update(() => {
16851
- const selection = $getSelection3();
16852
- if ($isRangeSelection3(selection)) {
16853
- const anchor = selection.anchor;
16854
- const focus = selection.focus;
16855
- const nodes = selection.getNodes();
16856
- if (anchor.key === focus.key && anchor.offset === focus.offset) {
16857
- return;
16858
- }
16859
- nodes.forEach((node, idx) => {
16860
- if ($isTextNode(node)) {
16861
- if (idx === 0 && anchor.offset !== 0) {
16862
- node = node.splitText(anchor.offset)[1] || node;
16863
- }
16864
- if (idx === nodes.length - 1) {
16865
- node = node.splitText(focus.offset)[0] || node;
16866
- }
16867
- if (node.__style !== "") {
16868
- node.setStyle("");
16869
- }
16870
- if (node.__format !== 0) {
16871
- node.setFormat(0);
16872
- $getNearestBlockElementAncestorOrThrow(node).setFormat("");
16873
- }
16874
- } else if ($isHeadingNode(node) || $isQuoteNode(node)) {
16875
- node.replace($createParagraphNode(), true);
16876
- } else if ($isDecoratorBlockNode(node)) {
16877
- node.setFormat("");
16878
- }
16879
- });
16880
- }
16881
- updateToolbar();
16882
- });
16883
- }, [editor, updateToolbar]);
16884
- const elementsThatShouldBeVisibleInDropdown = useMemo2(() => {
16885
- if (activeElement === "paragraph") {
16886
- return enabledTextualElements;
16887
- }
16888
- if (enabledBuiltInElements.some((element) => element.type === activeElement)) {
16889
- return enabledTextualElements;
16890
- }
16891
- return [
16892
- ...enabledTextualElements,
16893
- {
16894
- label: getLabelForElement(activeElement),
16895
- type: activeElement
16896
- }
16897
- ];
16898
- }, [enabledBuiltInElements, enabledTextualElements, activeElement]);
16899
16859
  return /* @__PURE__ */ jsxs60("div", { css: toolbar, children: [
16900
- elementsThatShouldBeVisibleInDropdown.length > 0 ? /* @__PURE__ */ jsx92(
16860
+ /* @__PURE__ */ jsxs60(
16901
16861
  Menu,
16902
16862
  {
16903
16863
  menuLabel: "Elements",
16904
- menuTrigger: /* @__PURE__ */ jsxs60("button", { css: toolbarButton, title: "Text formatting", children: [
16905
- elementsThatShouldBeVisibleInDropdown.some((element) => element.type === activeElement) ? getLabelForElement(activeElement) : getLabelForElement("paragraph"),
16864
+ menuTrigger: /* @__PURE__ */ jsxs60("button", { css: toolbarButton, title: "Text styles", children: [
16865
+ visibleTextualElements.some((element) => element.type === activeElement) ? getLabelForElement(activeElement) : getLabelForElement("paragraph"),
16906
16866
  " ",
16907
16867
  /* @__PURE__ */ jsx92(Icon, { icon: "chevron-down", css: [toolbarIcon, toolbarChevron], size: "1rem" })
16908
16868
  ] }),
16909
16869
  placement: "bottom-start",
16910
16870
  children: [
16911
- {
16912
- label: "Normal",
16913
- type: "paragraph"
16914
- },
16915
- ...elementsThatShouldBeVisibleInDropdown
16916
- ].map((element) => /* @__PURE__ */ jsx92(
16917
- MenuItem,
16918
- {
16919
- onClick: () => {
16920
- onSelectElement(element.type);
16871
+ [
16872
+ {
16873
+ label: "Normal",
16874
+ type: "paragraph"
16921
16875
  },
16922
- children: element.label
16923
- },
16924
- element.type
16925
- ))
16876
+ ...visibleTextualElements
16877
+ ].map((element) => /* @__PURE__ */ jsx92(
16878
+ MenuItem,
16879
+ {
16880
+ onClick: () => {
16881
+ onSelectElement(element.type);
16882
+ },
16883
+ children: element.label
16884
+ },
16885
+ element.type
16886
+ )),
16887
+ visibleTextualElements.length === 0 ? /* @__PURE__ */ jsx92(MenuItem, { disabled: true, children: "Alternative text styles are not available" }) : null
16888
+ ]
16926
16889
  }
16927
- ) : null,
16928
- enabledBuiltInFormatsWithIcon.length > 0 || enabledBuiltInFormatsWithoutIcon.length > 0 ? /* @__PURE__ */ jsxs60("div", { css: toolbarGroup, children: [
16929
- enabledBuiltInFormatsWithIcon.map((format) => /* @__PURE__ */ jsx92(Tooltip, { title: format.label, placement: "top", children: /* @__PURE__ */ jsx92(
16890
+ ),
16891
+ visibleFormatsWithIcon.length > 0 || visibleFormatsWithoutIcon.length > 0 ? /* @__PURE__ */ jsxs60("div", { css: toolbarGroup, children: [
16892
+ visibleFormatsWithIcon.map((format) => /* @__PURE__ */ jsx92(Tooltip, { title: format.label, placement: "top", children: /* @__PURE__ */ jsx92(
16930
16893
  "button",
16931
16894
  {
16932
16895
  onClick: () => {
16933
16896
  editor.dispatchCommand(FORMAT_TEXT_COMMAND, format.type);
16934
16897
  },
16935
16898
  css: [toolbarButton, activeFormats.includes(format.type) ? toolbarButtonActive : null],
16936
- children: /* @__PURE__ */ jsx92(ToolbarIcon, { icon: formatsWithIcon.get(format.type) })
16899
+ children: /* @__PURE__ */ jsx92(ToolbarIcon, { icon: FORMATS_WITH_ICON.get(format.type) })
16937
16900
  }
16938
16901
  ) }, format.type)),
16939
- enabledBuiltInFormatsWithoutIcon.length > 0 ? /* @__PURE__ */ jsx92(
16902
+ visibleFormatsWithoutIcon.length > 0 ? /* @__PURE__ */ jsx92(
16940
16903
  Menu,
16941
16904
  {
16942
- menuLabel: "Text formatting",
16943
- menuTrigger: /* @__PURE__ */ jsx92("button", { css: toolbarButton, title: "Text formatting", children: /* @__PURE__ */ jsx92(Icon, { icon: "more-alt", css: toolbarIcon }) }),
16905
+ menuLabel: "Alternative text styles",
16906
+ menuTrigger: /* @__PURE__ */ jsx92("button", { css: toolbarButton, title: "Alternative text styles", children: /* @__PURE__ */ jsx92(Icon, { icon: "more-alt", css: toolbarIcon }) }),
16944
16907
  placement: "bottom-start",
16945
- children: enabledBuiltInFormatsWithoutIcon.map((format) => /* @__PURE__ */ jsx92(
16908
+ children: visibleFormatsWithoutIcon.map((format) => /* @__PURE__ */ jsx92(
16946
16909
  MenuItem,
16947
16910
  {
16948
16911
  onClick: () => {
@@ -16955,19 +16918,19 @@ var RichTextToolbar = ({ config }) => {
16955
16918
  }
16956
16919
  ) : null
16957
16920
  ] }) : null,
16958
- linkElementEnabled || enabledLists.size > 0 || quoteElementEnabled || codeElementEnabled ? /* @__PURE__ */ jsxs60("div", { css: toolbarGroup, children: [
16959
- linkElementEnabled ? /* @__PURE__ */ jsx92(Tooltip, { title: "Link", placement: "top", children: /* @__PURE__ */ jsx92(
16921
+ visibleElementsWithIcons.size > 0 ? /* @__PURE__ */ jsxs60("div", { css: toolbarGroup, children: [
16922
+ linkElementVisible ? /* @__PURE__ */ jsx92(Tooltip, { title: "Link", placement: "top", children: /* @__PURE__ */ jsx92(
16960
16923
  "button",
16961
16924
  {
16962
16925
  onClick: () => {
16963
- editor.dispatchCommand(OPEN_LINK_NODE_MODAL_COMMAND, {});
16926
+ isLink ? editor.dispatchCommand(REMOVE_LINK_NODE_COMMAND, {}) : editor.dispatchCommand(OPEN_LINK_NODE_MODAL_COMMAND, {});
16964
16927
  },
16965
16928
  css: [toolbarButton, isLink ? toolbarButtonActive : null],
16966
16929
  children: /* @__PURE__ */ jsx92(ToolbarIcon, { icon: "link" })
16967
16930
  }
16968
16931
  ) }) : null,
16969
- enabledLists.size > 0 ? /* @__PURE__ */ jsxs60(Fragment14, { children: [
16970
- enabledLists.has("unorderedList") ? /* @__PURE__ */ jsx92(Tooltip, { title: "Bullet list", placement: "top", children: /* @__PURE__ */ jsx92(
16932
+ visibleLists.size > 0 ? /* @__PURE__ */ jsxs60(Fragment14, { children: [
16933
+ visibleLists.has("unorderedList") ? /* @__PURE__ */ jsx92(Tooltip, { title: "Bullet List", placement: "top", children: /* @__PURE__ */ jsx92(
16971
16934
  "button",
16972
16935
  {
16973
16936
  onClick: () => {
@@ -16977,7 +16940,7 @@ var RichTextToolbar = ({ config }) => {
16977
16940
  children: /* @__PURE__ */ jsx92(ToolbarIcon, { icon: "layout-list" })
16978
16941
  }
16979
16942
  ) }) : null,
16980
- enabledLists.has("orderedList") ? /* @__PURE__ */ jsx92(Tooltip, { title: "Numbered list", placement: "top", children: /* @__PURE__ */ jsx92(
16943
+ visibleLists.has("orderedList") ? /* @__PURE__ */ jsx92(Tooltip, { title: "Ordered List", placement: "top", children: /* @__PURE__ */ jsx92(
16981
16944
  "button",
16982
16945
  {
16983
16946
  onClick: () => {
@@ -16988,7 +16951,7 @@ var RichTextToolbar = ({ config }) => {
16988
16951
  }
16989
16952
  ) }) : null
16990
16953
  ] }) : null,
16991
- quoteElementEnabled ? /* @__PURE__ */ jsx92(Tooltip, { title: "Blockquote", placement: "top", children: /* @__PURE__ */ jsx92(
16954
+ quoteElementVisible ? /* @__PURE__ */ jsx92(Tooltip, { title: "Blockquote", placement: "top", children: /* @__PURE__ */ jsx92(
16992
16955
  "button",
16993
16956
  {
16994
16957
  onClick: () => {
@@ -16998,7 +16961,7 @@ var RichTextToolbar = ({ config }) => {
16998
16961
  children: /* @__PURE__ */ jsx92(ToolbarIcon, { icon: "quote" })
16999
16962
  }
17000
16963
  ) }) : null,
17001
- codeElementEnabled ? /* @__PURE__ */ jsx92(Tooltip, { title: "Code", placement: "top", children: /* @__PURE__ */ jsx92(
16964
+ codeElementVisible ? /* @__PURE__ */ jsx92(Tooltip, { title: "Code Block", placement: "top", children: /* @__PURE__ */ jsx92(
17002
16965
  "button",
17003
16966
  {
17004
16967
  onClick: () => {
@@ -17008,31 +16971,118 @@ var RichTextToolbar = ({ config }) => {
17008
16971
  children: /* @__PURE__ */ jsx92(ToolbarIcon, { icon: "code-slash" })
17009
16972
  }
17010
16973
  ) }) : null
17011
- ] }) : null,
17012
- /* @__PURE__ */ jsx92(
17013
- "div",
17014
- {
17015
- css: [
17016
- toolbarGroup,
17017
- {
17018
- marginLeft: "auto"
17019
- }
17020
- ],
17021
- children: /* @__PURE__ */ jsx92(Tooltip, { title: "Clear formatting", placement: "top", children: /* @__PURE__ */ jsx92(
17022
- "button",
17023
- {
17024
- onClick: () => {
17025
- clearFormatting2();
17026
- },
17027
- css: [toolbarButton],
17028
- children: /* @__PURE__ */ jsx92(ToolbarIcon, { icon: "clear-formatting" })
17029
- }
17030
- ) })
17031
- }
17032
- )
16974
+ ] }) : null
17033
16975
  ] });
17034
16976
  };
17035
16977
  var RichTextToolbar_default = RichTextToolbar;
16978
+ var useRichTextToolbarState = ({ config }) => {
16979
+ var _a;
16980
+ const enabledBuiltInFormats = useMemo3(() => {
16981
+ return richTextBuiltInFormats.filter((format) => {
16982
+ var _a2, _b;
16983
+ return (_b = (_a2 = config == null ? void 0 : config.formatting) == null ? void 0 : _a2.builtIn) == null ? void 0 : _b.includes(format.type);
16984
+ });
16985
+ }, [config]);
16986
+ const enabledBuiltInElements = useMemo3(() => {
16987
+ return richTextBuiltInElements.filter((element) => {
16988
+ var _a2, _b;
16989
+ return (_b = (_a2 = config == null ? void 0 : config.elements) == null ? void 0 : _a2.builtIn) == null ? void 0 : _b.includes(element.type);
16990
+ });
16991
+ }, [config]);
16992
+ const enabledBuiltInFormatsWithIcon = useMemo3(() => {
16993
+ return enabledBuiltInFormats.filter((format) => FORMATS_WITH_ICON.has(format.type));
16994
+ }, [enabledBuiltInFormats]);
16995
+ const enabledBuiltInFormatsWithoutIcon = enabledBuiltInFormats.filter(
16996
+ (format) => !FORMATS_WITH_ICON.has(format.type)
16997
+ );
16998
+ const [activeFormats, setActiveFormats] = useState10([]);
16999
+ const visibleFormatsWithIcon = useMemo3(() => {
17000
+ const visibleFormats = /* @__PURE__ */ new Set();
17001
+ activeFormats.filter((type) => FORMATS_WITH_ICON.has(type)).forEach((type) => {
17002
+ visibleFormats.add(type);
17003
+ });
17004
+ enabledBuiltInFormatsWithIcon.forEach((format) => {
17005
+ visibleFormats.add(format.type);
17006
+ });
17007
+ return richTextBuiltInFormats.filter((format) => visibleFormats.has(format.type));
17008
+ }, [activeFormats, enabledBuiltInFormatsWithIcon]);
17009
+ const visibleFormatsWithoutIcon = useMemo3(() => {
17010
+ const visibleFormats = /* @__PURE__ */ new Set();
17011
+ activeFormats.filter((type) => !FORMATS_WITH_ICON.has(type)).forEach((type) => {
17012
+ visibleFormats.add(type);
17013
+ });
17014
+ enabledBuiltInFormatsWithoutIcon.forEach((format) => {
17015
+ visibleFormats.add(format.type);
17016
+ });
17017
+ return richTextBuiltInFormats.filter((format) => visibleFormats.has(format.type));
17018
+ }, [activeFormats, enabledBuiltInFormatsWithoutIcon]);
17019
+ const [activeElement, setActiveElement] = useState10("paragraph");
17020
+ const enabledTextualElements = enabledBuiltInElements.filter(
17021
+ (element) => TEXTUAL_ELEMENTS.includes(element.type)
17022
+ );
17023
+ const visibleTextualElements = useMemo3(() => {
17024
+ if (!TEXTUAL_ELEMENTS.includes(activeElement)) {
17025
+ return enabledTextualElements;
17026
+ }
17027
+ return richTextBuiltInElements.filter(
17028
+ (element) => {
17029
+ var _a2, _b;
17030
+ return TEXTUAL_ELEMENTS.includes(element.type) && (((_b = (_a2 = config == null ? void 0 : config.elements) == null ? void 0 : _a2.builtIn) == null ? void 0 : _b.includes(element.type)) || element.type === activeElement);
17031
+ }
17032
+ );
17033
+ }, [activeElement, (_a = config == null ? void 0 : config.elements) == null ? void 0 : _a.builtIn, enabledTextualElements]);
17034
+ const [isLink, setIsLink] = useState10(false);
17035
+ const linkElementVisible = useMemo3(() => {
17036
+ return enabledBuiltInElements.some((element) => element.type === "link") || isLink;
17037
+ }, [isLink, enabledBuiltInElements]);
17038
+ const visibleLists = useMemo3(() => {
17039
+ return new Set(
17040
+ ["orderedList", "unorderedList"].filter(
17041
+ (type) => enabledBuiltInElements.some((element) => element.type === type) || activeElement === type
17042
+ )
17043
+ );
17044
+ }, [activeElement, enabledBuiltInElements]);
17045
+ const quoteElementVisible = useMemo3(() => {
17046
+ return enabledBuiltInElements.some((element) => element.type === "quote") || activeElement === "quote";
17047
+ }, [activeElement, enabledBuiltInElements]);
17048
+ const codeElementVisible = useMemo3(() => {
17049
+ return enabledBuiltInElements.some((element) => element.type === "code") || activeElement === "code";
17050
+ }, [activeElement, enabledBuiltInElements]);
17051
+ const visibleElementsWithIcons = useMemo3(() => {
17052
+ const visibleElements = /* @__PURE__ */ new Set();
17053
+ if (linkElementVisible) {
17054
+ visibleElements.add("link");
17055
+ }
17056
+ if (visibleLists.size > 0) {
17057
+ visibleLists.forEach((type) => {
17058
+ visibleElements.add(type);
17059
+ });
17060
+ }
17061
+ if (quoteElementVisible) {
17062
+ visibleElements.add("quote");
17063
+ }
17064
+ if (codeElementVisible) {
17065
+ visibleElements.add("code");
17066
+ }
17067
+ return visibleElements;
17068
+ }, [codeElementVisible, linkElementVisible, quoteElementVisible, visibleLists]);
17069
+ return {
17070
+ activeFormats,
17071
+ setActiveFormats,
17072
+ activeElement,
17073
+ setActiveElement,
17074
+ visibleFormatsWithIcon,
17075
+ visibleFormatsWithoutIcon,
17076
+ visibleTextualElements,
17077
+ isLink,
17078
+ setIsLink,
17079
+ linkElementVisible,
17080
+ visibleLists,
17081
+ quoteElementVisible,
17082
+ codeElementVisible,
17083
+ visibleElementsWithIcons
17084
+ };
17085
+ };
17036
17086
 
17037
17087
  // src/components/ParameterInputs/ParameterRichText.tsx
17038
17088
  import { Fragment as Fragment15, jsx as jsx93, jsxs as jsxs61 } from "@emotion/react/jsx-runtime";
@@ -17216,12 +17266,12 @@ var RichText = ({
17216
17266
  }) => {
17217
17267
  const editorContainerRef = useRef6(null);
17218
17268
  const [editor] = useLexicalComposerContext4();
17219
- useEffect13(() => {
17269
+ useEffect12(() => {
17220
17270
  if (onRichTextInit) {
17221
17271
  onRichTextInit(editor);
17222
17272
  }
17223
17273
  }, [editor, onRichTextInit]);
17224
- useEffect13(() => {
17274
+ useEffect12(() => {
17225
17275
  const removeUpdateListener = editor.registerUpdateListener(({ editorState, prevEditorState }) => {
17226
17276
  requestAnimationFrame(() => {
17227
17277
  if (!deepEqual2(editorState.toJSON(), prevEditorState.toJSON())) {
@@ -17353,7 +17403,7 @@ var Popover2 = ({
17353
17403
 
17354
17404
  // src/components/ProgressList/ProgressList.tsx
17355
17405
  import { css as css77 } from "@emotion/react";
17356
- import { useMemo as useMemo3 } from "react";
17406
+ import { useMemo as useMemo4 } from "react";
17357
17407
  import { CgCheckO as CgCheckO2, CgRadioCheck, CgRecord } from "react-icons/cg";
17358
17408
 
17359
17409
  // src/components/ProgressList/styles/ProgressList.styles.ts
@@ -17373,7 +17423,7 @@ var progressListItemStyles = css76`
17373
17423
  // src/components/ProgressList/ProgressList.tsx
17374
17424
  import { jsx as jsx98, jsxs as jsxs65 } from "@emotion/react/jsx-runtime";
17375
17425
  var ProgressList = ({ inProgressId, items, autoEllipsis, ...htmlProps }) => {
17376
- const itemsWithStatus = useMemo3(() => {
17426
+ const itemsWithStatus = useMemo4(() => {
17377
17427
  const indexOfInProgressItem = items.findIndex(({ id }) => id === inProgressId);
17378
17428
  return items.map((item, index) => {
17379
17429
  let status = "queued";
@@ -17406,7 +17456,7 @@ var ProgressListItem = ({
17406
17456
  errorLevel = "danger",
17407
17457
  autoEllipsis = false
17408
17458
  }) => {
17409
- const Icon2 = useMemo3(() => {
17459
+ const Icon2 = useMemo4(() => {
17410
17460
  if (error) {
17411
17461
  return warningIcon;
17412
17462
  }
@@ -17417,7 +17467,7 @@ var ProgressListItem = ({
17417
17467
  };
17418
17468
  return iconPerStatus[status];
17419
17469
  }, [status, error]);
17420
- const statusStyles = useMemo3(() => {
17470
+ const statusStyles = useMemo4(() => {
17421
17471
  if (error) {
17422
17472
  return errorLevel === "caution" ? css77`
17423
17473
  color: rgb(161, 98, 7);
@@ -17455,7 +17505,7 @@ var ProgressListItem = ({
17455
17505
 
17456
17506
  // src/components/SegmentedControl/SegmentedControl.tsx
17457
17507
  import { css as css79 } from "@emotion/react";
17458
- import { useCallback as useCallback6, useMemo as useMemo4 } from "react";
17508
+ import { useCallback as useCallback6, useMemo as useMemo5 } from "react";
17459
17509
  import { CgCheck as CgCheck4 } from "react-icons/cg";
17460
17510
 
17461
17511
  // src/components/SegmentedControl/SegmentedControl.styles.ts
@@ -17570,7 +17620,7 @@ var SegmentedControl = ({
17570
17620
  },
17571
17621
  [options, onChange]
17572
17622
  );
17573
- const sizeStyles = useMemo4(() => {
17623
+ const sizeStyles = useMemo5(() => {
17574
17624
  const map = {
17575
17625
  sm: css79({ height: "calc(24px - 2px)", fontSize: "var(--fs-xs)" }),
17576
17626
  md: css79({ height: "calc(32px - 2px)", fontSize: "var(--fs-sm)" }),
@@ -17578,7 +17628,7 @@ var SegmentedControl = ({
17578
17628
  };
17579
17629
  return map[size];
17580
17630
  }, [size]);
17581
- const isIconOnly = useMemo4(() => {
17631
+ const isIconOnly = useMemo5(() => {
17582
17632
  return options.every((option) => option.icon && !option.label);
17583
17633
  }, [options]);
17584
17634
  return /* @__PURE__ */ jsx99(
@@ -17845,7 +17895,7 @@ var TableCellData = React21.forwardRef(
17845
17895
  );
17846
17896
 
17847
17897
  // src/components/Tabs/Tabs.tsx
17848
- import { createContext as createContext6, useContext as useContext7, useEffect as useEffect14, useMemo as useMemo5 } from "react";
17898
+ import { createContext as createContext6, useContext as useContext7, useEffect as useEffect13, useMemo as useMemo6 } from "react";
17849
17899
  import {
17850
17900
  Tab as ReakitTab,
17851
17901
  TabList as ReakitTabList,
@@ -17889,13 +17939,13 @@ var useCurrentTab = () => {
17889
17939
  return context;
17890
17940
  };
17891
17941
  var Tabs = ({ children, onSelectedIdChange, useHashForState, selectedId, ...props }) => {
17892
- const selected = useMemo5(() => {
17942
+ const selected = useMemo6(() => {
17893
17943
  if (selectedId)
17894
17944
  return selectedId;
17895
17945
  return useHashForState && typeof window !== "undefined" && window.location.hash ? window.location.hash.substring(1) : void 0;
17896
17946
  }, [selectedId, useHashForState]);
17897
17947
  const tab = useTabState({ ...props, selectedId: selected });
17898
- useEffect14(() => {
17948
+ useEffect13(() => {
17899
17949
  var _a;
17900
17950
  const selectedValueWithoutNull = (_a = tab.selectedId) != null ? _a : void 0;
17901
17951
  onSelectedIdChange == null ? void 0 : onSelectedIdChange(selectedValueWithoutNull);
@@ -17903,7 +17953,7 @@ var Tabs = ({ children, onSelectedIdChange, useHashForState, selectedId, ...prop
17903
17953
  window.location.hash = selectedValueWithoutNull != null ? selectedValueWithoutNull : "";
17904
17954
  }
17905
17955
  }, [tab.selectedId, onSelectedIdChange, useHashForState]);
17906
- useEffect14(() => {
17956
+ useEffect13(() => {
17907
17957
  if (selected && selected !== tab.selectedId) {
17908
17958
  tab.setSelectedId(selected);
17909
17959
  }