@ixo/ui 0.0.13 → 0.0.15

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 (54) hide show
  1. package/dist/.vite/manifest.json +43 -43
  2. package/dist/components/AppShellNavigation/components/AsideResizable.d.ts +11 -0
  3. package/dist/components/AppShellNavigation/components/AsideResizable.d.ts.map +1 -0
  4. package/dist/components/AppShellNavigation/index.d.ts +5 -1
  5. package/dist/components/AppShellNavigation/index.d.ts.map +1 -1
  6. package/dist/{components-CV2rKBYZ.cjs → components-B0B09Vsk.cjs} +124 -16
  7. package/dist/components-B0B09Vsk.cjs.map +1 -0
  8. package/dist/{components-C4EqnIzL.js → components-CoGX1kwb.js} +125 -17
  9. package/dist/components-CoGX1kwb.js.map +1 -0
  10. package/dist/export/components.cjs +1 -1
  11. package/dist/export/components.mjs +1 -1
  12. package/dist/{index-C5CnSI8h.cjs → index-3RRyZp85.cjs} +3 -3
  13. package/dist/{index-C5CnSI8h.cjs.map → index-3RRyZp85.cjs.map} +1 -1
  14. package/dist/{index-CyWiU3i_.js → index-72gYmOmd.js} +3 -3
  15. package/dist/{index-CyWiU3i_.js.map → index-72gYmOmd.js.map} +1 -1
  16. package/dist/{index-D7EQ3eKf.js → index-BElczvPE.js} +2 -2
  17. package/dist/{index-D7EQ3eKf.js.map → index-BElczvPE.js.map} +1 -1
  18. package/dist/{index-CZbze3rk.js → index-BIF9-t6h.js} +2 -2
  19. package/dist/{index-CZbze3rk.js.map → index-BIF9-t6h.js.map} +1 -1
  20. package/dist/{index-CefO0Jav.cjs → index-BPiG2IqF.cjs} +2 -2
  21. package/dist/{index-CefO0Jav.cjs.map → index-BPiG2IqF.cjs.map} +1 -1
  22. package/dist/{index-BLat0Lyt.js → index-BVZ6ZzpV.js} +2 -2
  23. package/dist/{index-BLat0Lyt.js.map → index-BVZ6ZzpV.js.map} +1 -1
  24. package/dist/{index-X6VhYA9V.js → index-BphUXVlg.js} +3 -3
  25. package/dist/{index-X6VhYA9V.js.map → index-BphUXVlg.js.map} +1 -1
  26. package/dist/{index-Dj1BaWDs.cjs → index-BvkqUymq.cjs} +2 -2
  27. package/dist/{index-Dj1BaWDs.cjs.map → index-BvkqUymq.cjs.map} +1 -1
  28. package/dist/{index-Ckhzun7H.js → index-CDZdWXqv.js} +2 -2
  29. package/dist/{index-Ckhzun7H.js.map → index-CDZdWXqv.js.map} +1 -1
  30. package/dist/{index-Bg26rTdb.cjs → index-CJE1_yJ6.cjs} +2 -2
  31. package/dist/{index-Bg26rTdb.cjs.map → index-CJE1_yJ6.cjs.map} +1 -1
  32. package/dist/{index-C3_1bvTS.cjs → index-CWElz4HJ.cjs} +2 -2
  33. package/dist/{index-C3_1bvTS.cjs.map → index-CWElz4HJ.cjs.map} +1 -1
  34. package/dist/{index-4dRzDkrK.cjs → index-CXi6Syua.cjs} +2 -2
  35. package/dist/{index-4dRzDkrK.cjs.map → index-CXi6Syua.cjs.map} +1 -1
  36. package/dist/{index-C_T_TF7J.cjs → index-CfPgXC_X.cjs} +2 -2
  37. package/dist/{index-C_T_TF7J.cjs.map → index-CfPgXC_X.cjs.map} +1 -1
  38. package/dist/{index-Dkg-DJse.cjs → index-D0eJPLEq.cjs} +2 -2
  39. package/dist/{index-Dkg-DJse.cjs.map → index-D0eJPLEq.cjs.map} +1 -1
  40. package/dist/{index-mvsa-Ixl.cjs → index-DOa4tU-h.cjs} +2 -2
  41. package/dist/{index-mvsa-Ixl.cjs.map → index-DOa4tU-h.cjs.map} +1 -1
  42. package/dist/{index-BhVNm8RD.js → index-DRJd3yU2.js} +2 -2
  43. package/dist/{index-BhVNm8RD.js.map → index-DRJd3yU2.js.map} +1 -1
  44. package/dist/{index-CooLFL4R.js → index-DbRJT74u.js} +2 -2
  45. package/dist/{index-CooLFL4R.js.map → index-DbRJT74u.js.map} +1 -1
  46. package/dist/{index-CBpRYfw7.js → index-DeirAOH-.js} +2 -2
  47. package/dist/{index-CBpRYfw7.js.map → index-DeirAOH-.js.map} +1 -1
  48. package/dist/{index-Dw22tq1e.cjs → index-ffAWONI_.cjs} +3 -3
  49. package/dist/{index-Dw22tq1e.cjs.map → index-ffAWONI_.cjs.map} +1 -1
  50. package/dist/{index-CoOmnlIt.js → index-jE_hmlY8.js} +2 -2
  51. package/dist/{index-CoOmnlIt.js.map → index-jE_hmlY8.js.map} +1 -1
  52. package/package.json +1 -1
  53. package/dist/components-C4EqnIzL.js.map +0 -1
  54. package/dist/components-CV2rKBYZ.cjs.map +0 -1
@@ -9,7 +9,7 @@ import { cx, css } from "@emotion/css";
9
9
  import { createPortal } from "react-dom";
10
10
  import DOMPurify from "dompurify";
11
11
  import { u as useUITheme } from "./useUITheme-7i8NJ2FG.js";
12
- import { useDisclosure, useHover } from "@mantine/hooks";
12
+ import { useResizeObserver, useDisclosure, useHover } from "@mantine/hooks";
13
13
  import Markdown from "react-markdown";
14
14
  import remarkGfm from "remark-gfm";
15
15
  import { useCombobox, useSelect } from "downshift";
@@ -774,8 +774,8 @@ function AccordionTable({
774
774
  }
775
775
  );
776
776
  }
777
- const Header$3 = lazy(() => import("./index-CBpRYfw7.js"));
778
- const Footer = lazy(() => import("./index-CyWiU3i_.js"));
777
+ const Header$3 = lazy(() => import("./index-DeirAOH-.js"));
778
+ const Footer = lazy(() => import("./index-72gYmOmd.js"));
779
779
  function ActionCard({ header, content, footer, useHoverMode = false }) {
780
780
  const hasContent = !!content || !!footer;
781
781
  const initialVisibility = footer?.startHidden !== true;
@@ -859,7 +859,7 @@ function Loader({ size, color = "primary" }) {
859
859
  }
860
860
  const CARD_WIDTH$1 = 350;
861
861
  const CARD_HEADER_HEIGHT = 158;
862
- const Header$2 = lazy(() => import("./index-CZbze3rk.js"));
862
+ const Header$2 = lazy(() => import("./index-BIF9-t6h.js"));
863
863
  function Card({ children, className, contentClassName, roundedBottom, noPadding = false, fullWidth = false, header, wrapperSx, onClick }) {
864
864
  const wrapperRef = useRef(null);
865
865
  const handleOnClick = useCallback(
@@ -1294,7 +1294,7 @@ function ModalSheet({ isOpen, children, hideHandler, zIndex, onRequestHide, onRe
1294
1294
  document.body
1295
1295
  );
1296
1296
  }
1297
- const Badge = lazy(() => import("./index-CooLFL4R.js"));
1297
+ const Badge = lazy(() => import("./index-DbRJT74u.js"));
1298
1298
  function ActionSheet({ children, isOpen, header, navMenu = void 0, onRequestHide, onRequestShow }) {
1299
1299
  const shadowScrollRef = useRef(null);
1300
1300
  const wrapperContentAreaRef = useRef(null);
@@ -2136,6 +2136,101 @@ function Avatar({ src, rounded = true, size = 62, did }) {
2136
2136
  }
2137
2137
  return /* @__PURE__ */ jsx(User, { css: ({ text }) => ({ ...css2, backgroundColor: text.secondary }) });
2138
2138
  }
2139
+ const MIN_WIDTH = 200;
2140
+ function AsideResizable({ children, asideCollapsed = false, onAsideToggle, width = 450, onWidthChange, onMaxExpand }) {
2141
+ const [isResizing, setIsResizing] = useState(false);
2142
+ const [ref] = useResizeObserver();
2143
+ const isShowingRef = useRef(false);
2144
+ const hasFiredMaxExpand = useRef(false);
2145
+ const theme = useUITheme();
2146
+ useEffect(() => {
2147
+ if (!asideCollapsed && width <= MIN_WIDTH) {
2148
+ isShowingRef.current = true;
2149
+ onWidthChange?.(width);
2150
+ setTimeout(() => {
2151
+ isShowingRef.current = false;
2152
+ }, 200);
2153
+ }
2154
+ }, [asideCollapsed]);
2155
+ function clearListeners() {
2156
+ document.removeEventListener("mousemove", handleMouseMove);
2157
+ document.removeEventListener("mouseup", handleMouseUp);
2158
+ document.body.style.cursor = "";
2159
+ document.body.style.userSelect = "";
2160
+ }
2161
+ useEffect(() => {
2162
+ if (isResizing) {
2163
+ document.addEventListener("mousemove", handleMouseMove);
2164
+ document.addEventListener("mouseup", handleMouseUp);
2165
+ document.body.style.cursor = "col-resize";
2166
+ document.body.style.userSelect = "none";
2167
+ } else {
2168
+ clearListeners();
2169
+ }
2170
+ return () => clearListeners();
2171
+ }, [isResizing]);
2172
+ const handleMouseMove = (e) => {
2173
+ if (!isResizing) return;
2174
+ const newWidth = window.innerWidth - e.clientX;
2175
+ const maxWidth = window.innerWidth - 600;
2176
+ const constrainedWidth = Math.min(Math.max(newWidth, MIN_WIDTH), maxWidth);
2177
+ onWidthChange?.(constrainedWidth);
2178
+ };
2179
+ useEffect(() => {
2180
+ if (width === MIN_WIDTH && !asideCollapsed && onAsideToggle && !isShowingRef.current) {
2181
+ clearListeners();
2182
+ onAsideToggle();
2183
+ }
2184
+ }, [width, asideCollapsed, onAsideToggle]);
2185
+ useEffect(() => {
2186
+ const maxWidth = window.innerWidth - 600;
2187
+ if (width >= maxWidth && onMaxExpand && !hasFiredMaxExpand.current) {
2188
+ hasFiredMaxExpand.current = true;
2189
+ clearListeners();
2190
+ onMaxExpand();
2191
+ } else if (width < maxWidth) {
2192
+ hasFiredMaxExpand.current = false;
2193
+ }
2194
+ }, [width, onMaxExpand]);
2195
+ useEffect(() => {
2196
+ const handleWindowResize = () => {
2197
+ const newMaxWidth = window.innerWidth - 600;
2198
+ const newMinWidth = MIN_WIDTH;
2199
+ if (width > newMaxWidth) {
2200
+ onWidthChange?.(newMaxWidth);
2201
+ } else if (width < newMinWidth) {
2202
+ onWidthChange?.(newMinWidth);
2203
+ }
2204
+ };
2205
+ window.addEventListener("resize", handleWindowResize);
2206
+ return () => window.removeEventListener("resize", handleWindowResize);
2207
+ }, [width, onWidthChange]);
2208
+ const handleMouseUp = () => setIsResizing(false);
2209
+ const handleMouseDown = (e) => {
2210
+ e.preventDefault();
2211
+ setIsResizing(true);
2212
+ };
2213
+ if (asideCollapsed) return null;
2214
+ return /* @__PURE__ */ jsxs(AppShell.Aside, { w: width, miw: 200, maw: window.innerWidth - 340, ref, children: [
2215
+ /* @__PURE__ */ jsx(
2216
+ Box,
2217
+ {
2218
+ w: 4,
2219
+ top: 0,
2220
+ left: 0,
2221
+ h: "100%",
2222
+ pos: "absolute",
2223
+ bg: isResizing ? theme.colors.focus : "transparent",
2224
+ sx: {
2225
+ cursor: "col-resize",
2226
+ transition: "background-color 0.2s ease"
2227
+ },
2228
+ onMouseDown: handleMouseDown
2229
+ }
2230
+ ),
2231
+ children
2232
+ ] });
2233
+ }
2139
2234
  function SelectedIndicator() {
2140
2235
  const theme = useUITheme();
2141
2236
  return /* @__PURE__ */ jsx(
@@ -2333,9 +2428,14 @@ function AppShellNavigation({
2333
2428
  isBackButtonVisible,
2334
2429
  footerMenuItems,
2335
2430
  roomCategories,
2431
+ right,
2432
+ asideCollapsed = true,
2433
+ onAsideToggle,
2434
+ onMaxExpand,
2336
2435
  children
2337
2436
  }) {
2338
- const [desktopOpened, { toggle: toggleDesktop }] = useDisclosure(true);
2437
+ const [navbarCollapsed, { toggle: toggleNavbar }] = useDisclosure(true);
2438
+ const [asideWidth, setAsideWidth] = useState(450);
2339
2439
  const theme = useUITheme();
2340
2440
  return /* @__PURE__ */ jsxs(
2341
2441
  AppShell,
@@ -2344,11 +2444,18 @@ function AppShellNavigation({
2344
2444
  styles: {
2345
2445
  navbar: {
2346
2446
  background: theme.bg.navScaled
2447
+ },
2448
+ aside: {
2449
+ background: theme.bg.navScaled
2347
2450
  }
2348
2451
  },
2349
2452
  bg: theme.bg.navIconsBg,
2350
2453
  navbar: {
2351
- width: desktopOpened ? 300 : 56,
2454
+ width: navbarCollapsed ? 300 : 56,
2455
+ breakpoint: "sm"
2456
+ },
2457
+ aside: {
2458
+ width: asideCollapsed ? 0 : asideWidth,
2352
2459
  breakpoint: "sm"
2353
2460
  },
2354
2461
  children: [
@@ -2404,17 +2511,17 @@ function AppShellNavigation({
2404
2511
  /* @__PURE__ */ jsxs(Stack$1, { align: "center", gap: 8, children: [
2405
2512
  /* @__PURE__ */ jsx(Divider, { w: 40, mx: 10, color: theme.neutral.transparent10 }),
2406
2513
  /* @__PURE__ */ jsx(Center, { sx: { cursor: "pointer", borderRadius: 24 }, bg: theme.bg.navIconsBg, h: 40, w: 40, onClick: onSettingsIconClick, children: /* @__PURE__ */ jsx(SettingsBarSolid, { size: 22, color: "secondary" }) }),
2407
- !desktopOpened && /* @__PURE__ */ jsx(Center, { sx: { cursor: "pointer", borderRadius: 24 }, bg: theme.bg.navIconsBg, h: 40, w: 40, onClick: toggleDesktop, children: /* @__PURE__ */ jsx(AngleRightSolid, { color: "secondary" }) })
2514
+ !navbarCollapsed && /* @__PURE__ */ jsx(Center, { sx: { cursor: "pointer", borderRadius: 24 }, bg: theme.bg.navIconsBg, h: 40, w: 40, onClick: toggleNavbar, children: /* @__PURE__ */ jsx(AngleRightSolid, { color: "secondary" }) })
2408
2515
  ] })
2409
2516
  ] }),
2410
- desktopOpened && /* @__PURE__ */ jsxs(Stack$1, { justify: "space-between", w: "100%", pt: 16, pb: 10, px: 12, children: [
2517
+ navbarCollapsed && /* @__PURE__ */ jsxs(Stack$1, { justify: "space-between", w: "100%", pt: 16, pb: 10, px: 12, children: [
2411
2518
  /* @__PURE__ */ jsxs(Stack$1, { gap: 5, children: [
2412
2519
  /* @__PURE__ */ jsxs(Flex, { mb: 24, style: { width: "100%" }, justify: "space-between", align: "center", children: [
2413
2520
  /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "10px", children: [
2414
2521
  isBackButtonVisible ? /* @__PURE__ */ jsx(Center, { onClick: onBackClick, sx: { borderRadius: 4, cursor: "pointer", padding: 2, background: theme.bg.navIconsBg }, children: /* @__PURE__ */ jsx(ArrowLeftSolid, { size: 18 }) }) : /* @__PURE__ */ jsx(Center, { sx: { borderRadius: 4, padding: 2, background: theme.bg.navIconsBg }, children: pageItem.pageIcon ? /* @__PURE__ */ jsx(pageItem.pageIcon, { size: 18 }) : /* @__PURE__ */ jsx(Globe, { size: 18 }) }),
2415
2522
  /* @__PURE__ */ jsx(Text$1, { lh: 1, c: theme.text.overPicture, children: pageItem.pageTitle || "Unknown" })
2416
2523
  ] }),
2417
- /* @__PURE__ */ jsx(Flex, { gap: 12, align: "center", children: /* @__PURE__ */ jsx(Center, { sx: { cursor: "pointer" }, onClick: toggleDesktop, children: /* @__PURE__ */ jsx(PanelLeftSolid, { size: 22, color: "secondary" }) }) })
2524
+ /* @__PURE__ */ jsx(Flex, { gap: 12, align: "center", children: /* @__PURE__ */ jsx(Center, { sx: { cursor: "pointer" }, onClick: toggleNavbar, children: /* @__PURE__ */ jsx(PanelLeftSolid, { size: 22, color: "secondary" }) }) })
2418
2525
  ] }),
2419
2526
  menuItems?.map((item) => /* @__PURE__ */ jsx(MenuItem, { onMenuItemClick, item }, item.id)),
2420
2527
  roomCategories && roomCategories.length > 0 && /* @__PURE__ */ jsx(Stack$1, { gap: 8, mt: 16, children: roomCategories.map((category) => /* @__PURE__ */ jsx(RoomCategory, { category }, category.id)) })
@@ -2422,7 +2529,8 @@ function AppShellNavigation({
2422
2529
  /* @__PURE__ */ jsx(Stack$1, { gap: 5, children: footerMenuItems?.map((item) => /* @__PURE__ */ jsx(MenuItem, { onMenuItemClick, item }, item.id)) })
2423
2530
  ] })
2424
2531
  ] }) }),
2425
- /* @__PURE__ */ jsx(AppShell.Main, { children })
2532
+ /* @__PURE__ */ jsx(AppShell.Main, { children }),
2533
+ /* @__PURE__ */ jsx(AsideResizable, { asideCollapsed, onAsideToggle, onMaxExpand, width: asideWidth, onWidthChange: setAsideWidth, children: right })
2426
2534
  ]
2427
2535
  }
2428
2536
  );
@@ -5400,13 +5508,13 @@ function ActionButton({ onClick, left, right }) {
5400
5508
  }
5401
5509
  );
5402
5510
  }
5403
- const MainAction = lazy(() => import("./index-D7EQ3eKf.js"));
5404
- const Header$1 = lazy(() => import("./index-Ckhzun7H.js"));
5405
- const Content = lazy(() => import("./index-BLat0Lyt.js"));
5511
+ const MainAction = lazy(() => import("./index-BElczvPE.js"));
5512
+ const Header$1 = lazy(() => import("./index-CDZdWXqv.js"));
5513
+ const Content = lazy(() => import("./index-BVZ6ZzpV.js"));
5406
5514
  const Map = lazy(() => import("./index-D5Ufmf-s.js"));
5407
5515
  const CustomContent = lazy(() => import("./index-DsYjW_4y.js"));
5408
- const Assets = lazy(() => import("./index-BhVNm8RD.js"));
5409
- const Actions = lazy(() => import("./index-X6VhYA9V.js"));
5516
+ const Assets = lazy(() => import("./index-DRJd3yU2.js"));
5517
+ const Actions = lazy(() => import("./index-BphUXVlg.js"));
5410
5518
  const HOVER_BORDER_WIDTH = 1;
5411
5519
  function SodaCardCmp({ numSelected = 0, expanded = true, mainAction, header, content, map, customContent, customFooter, actions, assets, onClick }, ref) {
5412
5520
  const wrapperRef = useRef(null);
@@ -10720,4 +10828,4 @@ export {
10720
10828
  CardSelector as y,
10721
10829
  CardOutput as z
10722
10830
  };
10723
- //# sourceMappingURL=components-C4EqnIzL.js.map
10831
+ //# sourceMappingURL=components-CoGX1kwb.js.map