@ixo/ui 0.1.10 → 0.1.12

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.
Files changed (56) hide show
  1. package/dist/.vite/manifest.json +31 -31
  2. package/dist/components/AppShellNavigation/components/AsideResizable.d.ts.map +1 -1
  3. package/dist/components/AppShellNavigation/components/MenuItem.d.ts +2 -1
  4. package/dist/components/AppShellNavigation/components/MenuItem.d.ts.map +1 -1
  5. package/dist/components/AppShellNavigation/components/RoomCategory.d.ts +3 -1
  6. package/dist/components/AppShellNavigation/components/RoomCategory.d.ts.map +1 -1
  7. package/dist/components/AppShellNavigation/components/RoomItem.d.ts +2 -1
  8. package/dist/components/AppShellNavigation/components/RoomItem.d.ts.map +1 -1
  9. package/dist/components/AppShellNavigation/index.d.ts.map +1 -1
  10. package/dist/{components-Bzkhgo_i.cjs → components-D3rxdT4n.cjs} +54 -57
  11. package/dist/{components-Bzkhgo_i.cjs.map → components-D3rxdT4n.cjs.map} +1 -1
  12. package/dist/{components-kxgjjaBi.js → components-dTYQ8rTq.js} +54 -57
  13. package/dist/{components-kxgjjaBi.js.map → components-dTYQ8rTq.js.map} +1 -1
  14. package/dist/export/components.cjs +1 -1
  15. package/dist/export/components.mjs +1 -1
  16. package/dist/{index-Qq15_AqP.cjs → index-82ezVhzZ.cjs} +3 -3
  17. package/dist/{index-Qq15_AqP.cjs.map → index-82ezVhzZ.cjs.map} +1 -1
  18. package/dist/{index-DVpkDPVh.cjs → index-B1Z7u-Q2.cjs} +3 -3
  19. package/dist/{index-DVpkDPVh.cjs.map → index-B1Z7u-Q2.cjs.map} +1 -1
  20. package/dist/{index-DHpAlFBt.js → index-BPoZBmyU.js} +3 -3
  21. package/dist/{index-DHpAlFBt.js.map → index-BPoZBmyU.js.map} +1 -1
  22. package/dist/{index-D2nmz6Om.js → index-BQtjQahV.js} +2 -2
  23. package/dist/{index-D2nmz6Om.js.map → index-BQtjQahV.js.map} +1 -1
  24. package/dist/{index-bgLWLpix.cjs → index-BU1d2aXs.cjs} +2 -2
  25. package/dist/{index-bgLWLpix.cjs.map → index-BU1d2aXs.cjs.map} +1 -1
  26. package/dist/{index-Bxl6UNpR.js → index-BjOqIsrR.js} +2 -2
  27. package/dist/{index-Bxl6UNpR.js.map → index-BjOqIsrR.js.map} +1 -1
  28. package/dist/{index-b0lRsVpL.js → index-C5V_Znv6.js} +2 -2
  29. package/dist/{index-b0lRsVpL.js.map → index-C5V_Znv6.js.map} +1 -1
  30. package/dist/{index-9moXUHtl.js → index-CX5AcvQo.js} +2 -2
  31. package/dist/{index-9moXUHtl.js.map → index-CX5AcvQo.js.map} +1 -1
  32. package/dist/{index-xy6xJBbu.js → index-CbPdWxEp.js} +2 -2
  33. package/dist/{index-xy6xJBbu.js.map → index-CbPdWxEp.js.map} +1 -1
  34. package/dist/{index-D6ik1G_L.js → index-ChIy51g8.js} +3 -3
  35. package/dist/{index-D6ik1G_L.js.map → index-ChIy51g8.js.map} +1 -1
  36. package/dist/{index-D9z8zxGB.cjs → index-CpXitdO3.cjs} +2 -2
  37. package/dist/{index-D9z8zxGB.cjs.map → index-CpXitdO3.cjs.map} +1 -1
  38. package/dist/{index-BPpBzZ7I.js → index-CsFfgG7d.js} +2 -2
  39. package/dist/{index-BPpBzZ7I.js.map → index-CsFfgG7d.js.map} +1 -1
  40. package/dist/{index-DTabwbad.cjs → index-D-hlfLhF.cjs} +2 -2
  41. package/dist/{index-DTabwbad.cjs.map → index-D-hlfLhF.cjs.map} +1 -1
  42. package/dist/{index-DQZ62cn8.cjs → index-DZk2rXc1.cjs} +2 -2
  43. package/dist/{index-DQZ62cn8.cjs.map → index-DZk2rXc1.cjs.map} +1 -1
  44. package/dist/{index-BVjRfBNY.js → index-DjWinr86.js} +2 -2
  45. package/dist/{index-BVjRfBNY.js.map → index-DjWinr86.js.map} +1 -1
  46. package/dist/{index-DDSVvVaX.cjs → index-Dmacl8Cz.cjs} +2 -2
  47. package/dist/{index-DDSVvVaX.cjs.map → index-Dmacl8Cz.cjs.map} +1 -1
  48. package/dist/{index-DVBuQ8s_.cjs → index-DwToBgAS.cjs} +2 -2
  49. package/dist/{index-DVBuQ8s_.cjs.map → index-DwToBgAS.cjs.map} +1 -1
  50. package/dist/{index-S4XgkG5t.js → index-TP4S1689.js} +2 -2
  51. package/dist/{index-S4XgkG5t.js.map → index-TP4S1689.js.map} +1 -1
  52. package/dist/{index-BaKCtz_Q.cjs → index-rDm_w3ng.cjs} +2 -2
  53. package/dist/{index-BaKCtz_Q.cjs.map → index-rDm_w3ng.cjs.map} +1 -1
  54. package/dist/{index-CLxKEJcO.cjs → index-vOyrQuAW.cjs} +2 -2
  55. package/dist/{index-CLxKEJcO.cjs.map → index-vOyrQuAW.cjs.map} +1 -1
  56. package/package.json +1 -1
@@ -823,8 +823,8 @@ function AccordionTable({
823
823
  }
824
824
  );
825
825
  }
826
- const Header$3 = lazy(() => import("./index-BVjRfBNY.js"));
827
- const Footer = lazy(() => import("./index-DHpAlFBt.js"));
826
+ const Header$3 = lazy(() => import("./index-DjWinr86.js"));
827
+ const Footer = lazy(() => import("./index-BPoZBmyU.js"));
828
828
  function ActionCard({ header, content, footer, useHoverMode = false }) {
829
829
  const hasContent = !!content || !!footer;
830
830
  const initialVisibility = footer?.startHidden !== true;
@@ -908,7 +908,7 @@ function Loader({ size, color = "primary" }) {
908
908
  }
909
909
  const CARD_WIDTH$1 = 350;
910
910
  const CARD_HEADER_HEIGHT = 158;
911
- const Header$2 = lazy(() => import("./index-BPpBzZ7I.js"));
911
+ const Header$2 = lazy(() => import("./index-CsFfgG7d.js"));
912
912
  function Card({ children, className, contentClassName, roundedBottom, noPadding = false, fullWidth = false, header, wrapperSx, onClick }) {
913
913
  const wrapperRef = useRef(null);
914
914
  const handleOnClick = useCallback(
@@ -1343,7 +1343,7 @@ function ModalSheet({ isOpen, children, hideHandler, zIndex, onRequestHide, onRe
1343
1343
  document.body
1344
1344
  );
1345
1345
  }
1346
- const Badge = lazy(() => import("./index-b0lRsVpL.js"));
1346
+ const Badge = lazy(() => import("./index-C5V_Znv6.js"));
1347
1347
  function ActionSheet({ children, isOpen, header, navMenu = void 0, onRequestHide, onRequestShow }) {
1348
1348
  const shadowScrollRef = useRef(null);
1349
1349
  const wrapperContentAreaRef = useRef(null);
@@ -2173,6 +2173,7 @@ function AsideResizable({ children, navbarWidth, asideMaximized, asideCollapsed
2173
2173
  const isShowingRef = useRef(false);
2174
2174
  const hasFiredMaxExpand = useRef(false);
2175
2175
  const theme = useUITheme();
2176
+ const isMobile = useMediaQuery("(max-width: 62em)");
2176
2177
  useEffect(() => {
2177
2178
  if (!asideCollapsed && width <= MIN_WIDTH) {
2178
2179
  isShowingRef.current = true;
@@ -2246,7 +2247,7 @@ function AsideResizable({ children, navbarWidth, asideMaximized, asideCollapsed
2246
2247
  {
2247
2248
  w: asideMaximized ? "100%" : width,
2248
2249
  miw: 200,
2249
- maw: asideMaximized ? `calc(100% - ${navbarWidth}px)` : MAX_WIDTH,
2250
+ maw: asideMaximized ? isMobile ? "100%" : `calc(100% - ${navbarWidth}px)` : MAX_WIDTH,
2250
2251
  ref,
2251
2252
  sx: {
2252
2253
  overflowY: "auto",
@@ -2323,37 +2324,7 @@ function NavigationItemSkeleton() {
2323
2324
  }
2324
2325
  );
2325
2326
  }
2326
- function cutText(text, length, ending = "…") {
2327
- if (!length || text.length <= length) {
2328
- return text;
2329
- }
2330
- const words = text.split(" ");
2331
- const endingSize = ending.length;
2332
- let result = "";
2333
- for (const word of words) {
2334
- const newValue = result + word + " ";
2335
- if (newValue.length + endingSize - 1 > length) {
2336
- break;
2337
- }
2338
- result = newValue;
2339
- }
2340
- return result.trim() + ending;
2341
- }
2342
- function shortStr(str, threshold = 30, saveSymbolsAtTheEnd = 10, insert = "...") {
2343
- if (!str) return str;
2344
- const len = str.length;
2345
- if (len <= threshold) return str;
2346
- const ending = saveSymbolsAtTheEnd ? str.slice(-1 * saveSymbolsAtTheEnd) : "";
2347
- const beginning = str.substring(0, threshold - saveSymbolsAtTheEnd - insert.length);
2348
- return `${beginning}${insert}${ending}`;
2349
- }
2350
- function carbonToUSD(carbon) {
2351
- return (carbon * 0.03).toLocaleString(void 0, {
2352
- minimumFractionDigits: 0,
2353
- maximumFractionDigits: 6
2354
- });
2355
- }
2356
- function RoomItem({ room }) {
2327
+ function RoomItem({ room, navbarWidth }) {
2357
2328
  const { hovered, ref } = useHover();
2358
2329
  const renderIcon = () => {
2359
2330
  if (!room.icon) return null;
@@ -2366,8 +2337,7 @@ function RoomItem({ room }) {
2366
2337
  return room.icon;
2367
2338
  }
2368
2339
  };
2369
- const displayName = shortStr(room.name, 19, 0) || room.name;
2370
- const shouldShowTooltip = room.name.length > 19;
2340
+ const textMaxWidth = navbarWidth - 190;
2371
2341
  const content = /* @__PURE__ */ jsxs(
2372
2342
  Flex,
2373
2343
  {
@@ -2387,7 +2357,7 @@ function RoomItem({ room }) {
2387
2357
  children: [
2388
2358
  /* @__PURE__ */ jsxs(Flex, { align: "center", gap: 8, children: [
2389
2359
  renderIcon(),
2390
- /* @__PURE__ */ jsx(Text$1, { c: room.isActive ? "neutralColor.8" : "neutralColor.7", fz: 14, children: displayName })
2360
+ /* @__PURE__ */ jsx(Text$1, { c: room.isActive ? "neutralColor.8" : "neutralColor.7", fz: 14, truncate: true, style: { maxWidth: textMaxWidth }, children: room.name })
2391
2361
  ] }),
2392
2362
  hovered && /* @__PURE__ */ jsxs(Flex, { align: "center", gap: 4, children: [
2393
2363
  room.onActionClick && /* @__PURE__ */ jsx(Tooltip$4, { label: room.onActionClick.label, children: /* @__PURE__ */ jsx(
@@ -2406,9 +2376,9 @@ function RoomItem({ room }) {
2406
2376
  ]
2407
2377
  }
2408
2378
  );
2409
- return shouldShowTooltip ? /* @__PURE__ */ jsx(Tooltip$4, { label: room.name, children: /* @__PURE__ */ jsx("span", { children: content }) }) : content;
2379
+ return content;
2410
2380
  }
2411
- function RoomCategory({ name, rooms, actions, primaryActions }) {
2381
+ function RoomCategory({ name, rooms, actions, primaryActions, navbarWidth }) {
2412
2382
  const { hovered, ref } = useHover();
2413
2383
  const { value, toggle: toggle2 } = useToggle(false);
2414
2384
  return /* @__PURE__ */ jsxs(Stack$1, { gap: 2, children: [
@@ -2474,14 +2444,19 @@ function RoomCategory({ name, rooms, actions, primaryActions }) {
2474
2444
  ]
2475
2445
  }
2476
2446
  ),
2477
- !value && /* @__PURE__ */ jsx(Stack$1, { gap: 5, children: rooms?.map((room) => /* @__PURE__ */ jsx(RoomItem, { room }, room.id)) })
2447
+ !value && /* @__PURE__ */ jsx(Stack$1, { gap: 5, children: rooms?.map((room) => /* @__PURE__ */ jsx(RoomItem, { room, navbarWidth }, room.id)) })
2478
2448
  ] });
2479
2449
  }
2480
2450
  function hasActiveDescendant(children) {
2481
2451
  if (!children || children.length === 0) return false;
2482
2452
  return children.some((child) => child.isActive === true || hasActiveDescendant(child.children));
2483
2453
  }
2484
- function MenuItem({ item, onMenuItemClick, depth = 0 }) {
2454
+ function MenuItem({
2455
+ item,
2456
+ onMenuItemClick,
2457
+ depth = 0,
2458
+ navbarWidth
2459
+ }) {
2485
2460
  const { hovered, ref } = useHover();
2486
2461
  const hasChildren = item.children && item.children.length > 0;
2487
2462
  const hasActiveChild = useMemo(() => hasActiveDescendant(item.children), [item.children]);
@@ -2561,7 +2536,7 @@ function MenuItem({ item, onMenuItemClick, depth = 0 }) {
2561
2536
  children: [
2562
2537
  /* @__PURE__ */ jsxs(Flex, { align: "center", gap: 8, children: [
2563
2538
  renderIcon(),
2564
- /* @__PURE__ */ jsx(Text$1, { fz: 14, fw: 500, c: item.isActive ? "neutralColor.8" : "neutralColor.7", style: { flex: 1 }, children: item.name }),
2539
+ /* @__PURE__ */ jsx(Text$1, { fz: 14, fw: 500, c: item.isActive ? "neutralColor.8" : "neutralColor.7", truncate: true, style: { maxWidth: navbarWidth - 160 - depth * 16 }, children: item.name }),
2565
2540
  item.badgeCount ? /* @__PURE__ */ jsx(Badge$1, { size: "xs", variant: "filled", ml: 4, style: { minWidth: "16px", height: "15px", padding: "0 4px", fontSize: "8px" }, children: item.badgeCount }) : null
2566
2541
  ] }),
2567
2542
  /* @__PURE__ */ jsx(Flex, { children: item?.actions && item.actions.length > 0 && /* @__PURE__ */ jsx(
@@ -2581,7 +2556,7 @@ function MenuItem({ item, onMenuItemClick, depth = 0 }) {
2581
2556
  ]
2582
2557
  }
2583
2558
  ),
2584
- hasChildren && isExpanded && /* @__PURE__ */ jsx(Stack$1, { gap: 1, children: item.children?.map((childItem) => /* @__PURE__ */ jsx(MenuItem, { item: childItem, onMenuItemClick, depth: depth + 1 }, childItem.id)) })
2559
+ hasChildren && isExpanded && /* @__PURE__ */ jsx(Stack$1, { gap: 1, children: item.children?.map((childItem) => /* @__PURE__ */ jsx(MenuItem, { item: childItem, onMenuItemClick, depth: depth + 1, navbarWidth }, childItem.id)) })
2585
2560
  ] });
2586
2561
  }
2587
2562
  function SelectedIndicator() {
@@ -2698,7 +2673,6 @@ function AppShellNavigation({
2698
2673
  },
2699
2674
  [onSplitRatioChange]
2700
2675
  );
2701
- const isTitleOverflowing = (pageItem?.pageTitle?.length || 0) > 21;
2702
2676
  const handleSplitMouseUp = useCallback(() => {
2703
2677
  setIsSplitResizing(false);
2704
2678
  isSplitResizingRef.current = false;
@@ -2728,8 +2702,9 @@ function AppShellNavigation({
2728
2702
  };
2729
2703
  }, [isSplitResizing, handleSplitMouseMove, handleSplitMouseUp]);
2730
2704
  const [navbarWidthAiOpen, setNavbarWidthAiOpen] = useLocalStorage("navbar-width-ai-open", 450);
2731
- const [navbarWidthAiClosed, setNavbarWidthAiClosed] = useLocalStorage("navbar-width-ai-closed", 300);
2705
+ const [navbarWidthAiClosed, setNavbarWidthAiClosed] = useLocalStorage("navbar-width-ai-closed", 330);
2732
2706
  const navbarWidth = isAiOpened ? navbarWidthAiOpen : navbarWidthAiClosed;
2707
+ const titleMaxWidth = navbarWidth - 120;
2733
2708
  const [isNavbarResizing, setIsNavbarResizing] = useState(false);
2734
2709
  const isNavbarResizingRef = useRef(false);
2735
2710
  function clearNavbarListeners() {
@@ -2884,7 +2859,7 @@ function AppShellNavigation({
2884
2859
  isAiOpened && !isMobile && aiNavbarContent,
2885
2860
  !isAiOpened && /* @__PURE__ */ jsxs(Box, { w: "100%", style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
2886
2861
  /* @__PURE__ */ jsx(AppShell.Section, { px: 12, pt: 16, children: /* @__PURE__ */ jsxs(Flex, { mb: 24, style: { width: "100%" }, justify: "space-between", align: "center", children: [
2887
- /* @__PURE__ */ jsx(Flex, { align: "center", gap: "10px", children: /* @__PURE__ */ jsx(Tooltip$4, { label: pageItem.pageTitle || "Unknown", disabled: !isTitleOverflowing, position: "bottom", withArrow: true, children: /* @__PURE__ */ jsx(Text$1, { lh: 1, c: "neutralColor.8", children: isTitleOverflowing ? shortStr(pageItem.pageTitle, 21, 0) : pageItem.pageTitle || "Unknown" }) }) }),
2862
+ /* @__PURE__ */ jsx(Flex, { align: "center", gap: "10px", children: /* @__PURE__ */ jsx(Text$1, { lh: 1, c: "neutralColor.8", truncate: true, style: { maxWidth: titleMaxWidth }, children: pageItem.pageTitle || "Unknown" }) }),
2888
2863
  isAiBtnVisible && !isAiOpened && !isMobile && /* @__PURE__ */ jsx(
2889
2864
  Center,
2890
2865
  {
@@ -2908,12 +2883,12 @@ function AppShellNavigation({
2908
2883
  if (index !== 0 && index === separator) {
2909
2884
  return /* @__PURE__ */ jsxs(Fragment, { children: [
2910
2885
  /* @__PURE__ */ jsx(Space, { h: 16 }),
2911
- /* @__PURE__ */ jsx(MenuItem, { onMenuItemClick, item }, item.id)
2886
+ /* @__PURE__ */ jsx(MenuItem, { onMenuItemClick, item, navbarWidth }, item.id)
2912
2887
  ] });
2913
2888
  }
2914
- return /* @__PURE__ */ jsx(MenuItem, { onMenuItemClick, item }, item.id);
2889
+ return /* @__PURE__ */ jsx(MenuItem, { onMenuItemClick, item, navbarWidth }, item.id);
2915
2890
  }),
2916
- roomCategories && roomCategories.length > 0 && /* @__PURE__ */ jsx(Stack$1, { gap: 8, mt: 16, children: roomCategories.map(({ id, name, actions, rooms, primaryActions: onAddClick }) => /* @__PURE__ */ jsx(RoomCategory, { id, name, actions, rooms, primaryActions: onAddClick }, id)) })
2891
+ roomCategories && roomCategories.length > 0 && /* @__PURE__ */ jsx(Stack$1, { gap: 8, mt: 16, children: roomCategories.map(({ id, name, actions, rooms, primaryActions: onAddClick }) => /* @__PURE__ */ jsx(RoomCategory, { id, name, actions, rooms, primaryActions: onAddClick, navbarWidth }, id)) })
2917
2892
  ] }) }),
2918
2893
  footerContent && /* @__PURE__ */ jsx(AppShell.Section, { px: 12, py: 10, children: /* @__PURE__ */ jsx(Stack$1, { gap: 5, children: footerContent }) })
2919
2894
  ] })
@@ -6119,13 +6094,13 @@ function ActionButton({ onClick, left, right }) {
6119
6094
  }
6120
6095
  );
6121
6096
  }
6122
- const MainAction = lazy(() => import("./index-xy6xJBbu.js"));
6123
- const Header$1 = lazy(() => import("./index-S4XgkG5t.js"));
6124
- const Content = lazy(() => import("./index-D2nmz6Om.js"));
6097
+ const MainAction = lazy(() => import("./index-CbPdWxEp.js"));
6098
+ const Header$1 = lazy(() => import("./index-TP4S1689.js"));
6099
+ const Content = lazy(() => import("./index-BQtjQahV.js"));
6125
6100
  const Map = lazy(() => import("./index-D5Ufmf-s.js"));
6126
6101
  const CustomContent = lazy(() => import("./index-DsYjW_4y.js"));
6127
- const Assets = lazy(() => import("./index-Bxl6UNpR.js"));
6128
- const Actions = lazy(() => import("./index-D6ik1G_L.js"));
6102
+ const Assets = lazy(() => import("./index-BjOqIsrR.js"));
6103
+ const Actions = lazy(() => import("./index-ChIy51g8.js"));
6129
6104
  const HOVER_BORDER_WIDTH = 1;
6130
6105
  function SodaCardCmp({ numSelected = 0, expanded = true, mainAction, header, content, map, customContent, customFooter, actions, assets, onClick }, ref) {
6131
6106
  const wrapperRef = useRef(null);
@@ -6462,6 +6437,28 @@ function AssetInfo({
6462
6437
  }
6463
6438
  );
6464
6439
  }
6440
+ function cutText(text, length, ending = "…") {
6441
+ if (!length || text.length <= length) {
6442
+ return text;
6443
+ }
6444
+ const words = text.split(" ");
6445
+ const endingSize = ending.length;
6446
+ let result = "";
6447
+ for (const word of words) {
6448
+ const newValue = result + word + " ";
6449
+ if (newValue.length + endingSize - 1 > length) {
6450
+ break;
6451
+ }
6452
+ result = newValue;
6453
+ }
6454
+ return result.trim() + ending;
6455
+ }
6456
+ function carbonToUSD(carbon) {
6457
+ return (carbon * 0.03).toLocaleString(void 0, {
6458
+ minimumFractionDigits: 0,
6459
+ maximumFractionDigits: 6
6460
+ });
6461
+ }
6465
6462
  const SHARED_ASSET_PROPS = {
6466
6463
  leftTitleColor: "text",
6467
6464
  rightTitleColor: "text",
@@ -11402,4 +11399,4 @@ export {
11402
11399
  CardHero as y,
11403
11400
  CardSelector as z
11404
11401
  };
11405
- //# sourceMappingURL=components-kxgjjaBi.js.map
11402
+ //# sourceMappingURL=components-dTYQ8rTq.js.map