baaz-custom-components 5.1.1 → 5.2.0

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/index.js CHANGED
@@ -1947,7 +1947,7 @@ var CustomBreadcrumb = ({
1947
1947
  var breadcrumb_default = CustomBreadcrumb;
1948
1948
 
1949
1949
  // src/components/custom/grid/index.tsx
1950
- var import_react7 = require("react");
1950
+ var import_react10 = require("react");
1951
1951
  var import_react_grid = require("@svar-ui/react-grid");
1952
1952
 
1953
1953
  // src/utils/exportPdf.ts
@@ -1982,7 +1982,7 @@ function exportExcel(rows, name) {
1982
1982
 
1983
1983
  // src/components/custom/grid/gridHeader/index.tsx
1984
1984
  var import_react6 = require("react");
1985
- var import_lucide_react13 = require("lucide-react");
1985
+ var import_lucide_react14 = require("lucide-react");
1986
1986
 
1987
1987
  // src/components/custom/grid/gridHeader/components/filters.tsx
1988
1988
  var import_react5 = require("react");
@@ -2039,13 +2039,13 @@ var Filters = ({
2039
2039
  }
2040
2040
  ]);
2041
2041
  };
2042
- const updateCondition = (id, next) => {
2042
+ const updateCondition = (id3, next) => {
2043
2043
  setConditions(
2044
- (prev) => prev.map((c) => c.id === id ? __spreadValues(__spreadValues({}, c), next) : c)
2044
+ (prev) => prev.map((c) => c.id === id3 ? __spreadValues(__spreadValues({}, c), next) : c)
2045
2045
  );
2046
2046
  };
2047
- const deleteCondition = (id) => {
2048
- const updatedConditions = conditions.filter((c) => c.id !== id);
2047
+ const deleteCondition = (id3) => {
2048
+ const updatedConditions = conditions.filter((c) => c.id !== id3);
2049
2049
  setConditions(updatedConditions);
2050
2050
  if (updatedConditions.length === 0) {
2051
2051
  setFilterMenu(false);
@@ -2348,9 +2348,52 @@ var Filters = ({
2348
2348
  };
2349
2349
  var filters_default = Filters;
2350
2350
 
2351
- // src/components/custom/grid/gridHeader/index.tsx
2351
+ // src/components/custom/grid/gridHeader/components/selectionBar.tsx
2352
+ var import_lucide_react13 = require("lucide-react");
2352
2353
  var import_jsx_runtime24 = require("react/jsx-runtime");
2353
- var GridHeader = ({
2354
+ function SelectionBar({
2355
+ selectedCount,
2356
+ selectedData,
2357
+ actions,
2358
+ onAction,
2359
+ onClear
2360
+ }) {
2361
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-2 animate-in fade-in slide-in-from-left-2 duration-150", children: [
2362
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2363
+ "button",
2364
+ {
2365
+ onClick: onClear,
2366
+ title: "Clear selection",
2367
+ className: "p-1.5 rounded-md hover:bg-input text-muted-foreground hover:text-foreground transition-colors cursor-pointer",
2368
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react13.X, { size: 15 })
2369
+ }
2370
+ ),
2371
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "text-xs font-medium text-foreground whitespace-nowrap", children: [
2372
+ selectedCount,
2373
+ " ",
2374
+ selectedCount === 1 ? "row" : "rows",
2375
+ " selected"
2376
+ ] }),
2377
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "h-4 w-px bg-border mx-1" }),
2378
+ actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2379
+ "button",
2380
+ {
2381
+ onClick: () => onAction(action.id, selectedData),
2382
+ title: action.label,
2383
+ className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs font-medium border border-border bg-primary/90 hover:bg-primary ease-in-out transition-colors cursor-pointer whitespace-nowrap",
2384
+ children: [
2385
+ action.icon && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "shrink-0 text-muted-foreground", children: action.icon }),
2386
+ action.label
2387
+ ]
2388
+ },
2389
+ action.id
2390
+ ))
2391
+ ] });
2392
+ }
2393
+
2394
+ // src/components/custom/grid/gridHeader/index.tsx
2395
+ var import_jsx_runtime25 = require("react/jsx-runtime");
2396
+ function GridHeader({
2354
2397
  onPdf,
2355
2398
  onExcel,
2356
2399
  onSearch = () => {
@@ -2362,11 +2405,17 @@ var GridHeader = ({
2362
2405
  filterList,
2363
2406
  onFilterChange,
2364
2407
  initialFilters = [],
2365
- children
2366
- }) => {
2408
+ children,
2409
+ selectedCount = 0,
2410
+ selectedData = [],
2411
+ selectionActions = [],
2412
+ onSelectionAction,
2413
+ onClearSelection
2414
+ }) {
2367
2415
  const [downloadMenu, setDownloadMenu] = (0, import_react6.useState)(false);
2368
2416
  const [searchOpen, setSearchOpen] = (0, import_react6.useState)(false);
2369
2417
  const downloadRef = (0, import_react6.useRef)(null);
2418
+ const isSelecting = selectedCount > 0;
2370
2419
  (0, import_react6.useEffect)(() => {
2371
2420
  const handleClickOutside = (e) => {
2372
2421
  if (downloadRef.current && !downloadRef.current.contains(e.target)) {
@@ -2376,9 +2425,18 @@ var GridHeader = ({
2376
2425
  document.addEventListener("mousedown", handleClickOutside);
2377
2426
  return () => document.removeEventListener("mousedown", handleClickOutside);
2378
2427
  }, []);
2379
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col md:flex-row md:items-center justify-between bg-card py-2 px-2 md:px-4 rounded-tl-md rounded-tr-md", children: [
2380
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex justify-between items-center gap-3", children: [
2381
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2428
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-col md:flex-row md:items-center justify-between bg-card py-2 px-2 md:px-4 rounded-tl-md rounded-tr-md border-l border-r border-t min-h-[48px]", children: [
2429
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex items-center gap-3", children: isSelecting ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2430
+ SelectionBar,
2431
+ {
2432
+ selectedCount,
2433
+ selectedData,
2434
+ actions: selectionActions,
2435
+ onAction: (actionId, data) => onSelectionAction == null ? void 0 : onSelectionAction(actionId, data),
2436
+ onClear: () => onClearSelection == null ? void 0 : onClearSelection()
2437
+ }
2438
+ ) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
2439
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2382
2440
  filters_default,
2383
2441
  {
2384
2442
  onFilterChange,
@@ -2386,17 +2444,17 @@ var GridHeader = ({
2386
2444
  filterList
2387
2445
  }
2388
2446
  ),
2389
- download && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "relative", ref: downloadRef, children: [
2390
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2447
+ download && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "relative", ref: downloadRef, children: [
2448
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2391
2449
  "button",
2392
2450
  {
2393
2451
  onClick: () => setDownloadMenu((p) => !p),
2394
2452
  className: "p-2 rounded-md hover:bg-input cursor-pointer",
2395
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react13.Ellipsis, { size: 16 })
2453
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react14.Ellipsis, { size: 16 })
2396
2454
  }
2397
2455
  ),
2398
- downloadMenu && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "absolute top-full right-0 mt-2 w-32 rounded-md border !bg-background shadow-lg z-50 overflow-hidden", children: [
2399
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2456
+ downloadMenu && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "absolute top-full right-0 mt-2 w-32 rounded-md border !bg-background shadow-lg z-50 overflow-hidden", children: [
2457
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
2400
2458
  "button",
2401
2459
  {
2402
2460
  onClick: () => {
@@ -2405,12 +2463,12 @@ var GridHeader = ({
2405
2463
  },
2406
2464
  className: "flex items-center gap-2 w-full px-3 py-2 text-sm hover:bg-muted cursor-pointer",
2407
2465
  children: [
2408
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react13.FileText, { size: 14 }),
2409
- "PDF"
2466
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react14.FileText, { size: 14 }),
2467
+ " PDF"
2410
2468
  ]
2411
2469
  }
2412
2470
  ),
2413
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
2471
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
2414
2472
  "button",
2415
2473
  {
2416
2474
  onClick: () => {
@@ -2419,29 +2477,29 @@ var GridHeader = ({
2419
2477
  },
2420
2478
  className: "flex items-center gap-2 w-full px-3 py-2 text-sm hover:bg-muted cursor-pointer",
2421
2479
  children: [
2422
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react13.FileSpreadsheet, { size: 14 }),
2423
- "Excel"
2480
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react14.FileSpreadsheet, { size: 14 }),
2481
+ " Excel"
2424
2482
  ]
2425
2483
  }
2426
2484
  )
2427
2485
  ] })
2428
2486
  ] })
2429
- ] }),
2487
+ ] }) }),
2430
2488
  children,
2431
- search && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "relative h-[40px] flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2489
+ search && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "relative h-[40px] flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2432
2490
  "div",
2433
2491
  {
2434
2492
  className: `absolute md:right-0 flex items-center transition-all duration-200 ${searchOpen ? "w-[250px]" : "w-[40px]"} h-[40px]`,
2435
- children: !searchOpen ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2493
+ children: !searchOpen ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2436
2494
  "button",
2437
2495
  {
2438
2496
  onClick: () => setSearchOpen(true),
2439
2497
  className: "w-[40px] h-[40px] flex items-center justify-center rounded-md hover:bg-input cursor-pointer",
2440
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react13.Search, { size: 18 })
2498
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react14.Search, { size: 18 })
2441
2499
  }
2442
- ) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-2 w-full h-full px-3 rounded-md border border-input bg-background", children: [
2443
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react13.Search, { size: 16 }),
2444
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2500
+ ) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-2 w-full h-full px-3 rounded-md border border-input bg-background", children: [
2501
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react14.Search, { size: 16 }),
2502
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2445
2503
  "input",
2446
2504
  {
2447
2505
  autoFocus: true,
@@ -2451,24 +2509,187 @@ var GridHeader = ({
2451
2509
  value: searchValue
2452
2510
  }
2453
2511
  ),
2454
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2455
- "button",
2456
- {
2457
- onClick: () => setSearchOpen(false),
2458
- className: "cursor-pointer",
2459
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react13.X, { size: 16 })
2460
- }
2461
- )
2512
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { onClick: () => setSearchOpen(false), className: "cursor-pointer", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react14.X, { size: 16 }) })
2462
2513
  ] })
2463
2514
  }
2464
2515
  ) })
2465
2516
  ] });
2466
- };
2517
+ }
2467
2518
  var gridHeader_default = GridHeader;
2468
2519
 
2520
+ // src/components/custom/grid/checkboxCell/checkBoxCell.tsx
2521
+ var import_react8 = __toESM(require("react"));
2522
+
2523
+ // node_modules/@svar-ui/lib-react/dist/index.js
2524
+ var import_react7 = require("react");
2525
+
2526
+ // node_modules/@svar-ui/lib-dom/dist/index.js
2527
+ function getEnv() {
2528
+ return {
2529
+ detect: () => true,
2530
+ addEvent: function(node, event, handler) {
2531
+ node.addEventListener(event, handler);
2532
+ return () => node.removeEventListener(event, handler);
2533
+ },
2534
+ addGlobalEvent: function(event, handler) {
2535
+ document.addEventListener(event, handler);
2536
+ return () => document.removeEventListener(event, handler);
2537
+ },
2538
+ getTopNode: function() {
2539
+ return window.document.body;
2540
+ }
2541
+ };
2542
+ }
2543
+ var env = getEnv();
2544
+ var id2 = (/* @__PURE__ */ new Date()).valueOf();
2545
+
2546
+ // node_modules/@svar-ui/lib-react/dist/index.js
2547
+ function useWritable(writable2, initialValue, name) {
2548
+ const [state, setState] = (0, import_react7.useState)(() => initialValue);
2549
+ if (!writable2) console.warn(`Writable ${name} is not defined`);
2550
+ (0, import_react7.useEffect)(() => {
2551
+ if (!writable2) return;
2552
+ const unsubscribe = writable2.subscribe((newValue) => {
2553
+ setState(() => newValue);
2554
+ });
2555
+ return unsubscribe;
2556
+ }, [writable2]);
2557
+ return state;
2558
+ }
2559
+ function useStore(store, name) {
2560
+ const s = store.getState();
2561
+ const r = store.getReactiveState();
2562
+ return useWritable(r[name], s[name], name);
2563
+ }
2564
+
2565
+ // src/components/custom/grid/checkboxCell/checkBoxCell.tsx
2566
+ var import_jsx_runtime26 = require("react/jsx-runtime");
2567
+ var CheckboxCell = ({ row, api, column }) => {
2568
+ const selectedRows = useStore(api, "selectedRows");
2569
+ const isSelected = selectedRows.includes(row.id);
2570
+ const handleChange = (e) => {
2571
+ var _a, _b;
2572
+ e.stopPropagation();
2573
+ const isChecked = e.target.checked;
2574
+ api.exec("select-row", { id: row.id, mode: isChecked, toggle: true });
2575
+ (_b = (_a = column == null ? void 0 : column.config) == null ? void 0 : _a.onSelectionChange) == null ? void 0 : _b.call(_a, row.id, row, isChecked);
2576
+ };
2577
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2578
+ "div",
2579
+ {
2580
+ className: "flex items-center justify-center w-full h-full",
2581
+ "data-action": "ignore-click",
2582
+ onClick: (e) => e.stopPropagation(),
2583
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2584
+ "input",
2585
+ {
2586
+ type: "checkbox",
2587
+ checked: isSelected,
2588
+ onChange: handleChange,
2589
+ className: "w-4 h-4 rounded border border-border bg-background accent-primary cursor-pointer focus:outline-none focus:ring-1 focus:ring-primary"
2590
+ }
2591
+ )
2592
+ }
2593
+ );
2594
+ };
2595
+ var checkBoxCell_default = import_react8.default.memo(CheckboxCell);
2596
+
2597
+ // src/components/custom/grid/checkboxCell/headerCheckBox.tsx
2598
+ var import_react9 = __toESM(require("react"));
2599
+ var import_jsx_runtime27 = require("react/jsx-runtime");
2600
+ var HeaderCheckbox = ({ api, column }) => {
2601
+ var _a;
2602
+ const checkboxRef = (0, import_react9.useRef)(null);
2603
+ const computeState = () => {
2604
+ var _a2, _b, _c;
2605
+ const pageData = (_b = (_a2 = column == null ? void 0 : column.config) == null ? void 0 : _a2.getPageData()) != null ? _b : [];
2606
+ const selectedRows = (_c = api.getState().selectedRows) != null ? _c : [];
2607
+ const selectedOnPage = pageData.filter(
2608
+ (r) => selectedRows.includes(r.id)
2609
+ ).length;
2610
+ return {
2611
+ allSelected: pageData.length > 0 && selectedOnPage === pageData.length,
2612
+ someSelected: selectedOnPage > 0 && selectedOnPage < pageData.length
2613
+ };
2614
+ };
2615
+ const [, forceUpdate] = (0, import_react9.useReducer)((x) => x + 1, 0);
2616
+ (0, import_react9.useEffect)(() => {
2617
+ const unsub = api.on("select-row", () => {
2618
+ forceUpdate();
2619
+ });
2620
+ return () => {
2621
+ if (typeof unsub === "function") unsub();
2622
+ };
2623
+ }, [api]);
2624
+ (0, import_react9.useEffect)(() => {
2625
+ var _a2;
2626
+ (_a2 = column == null ? void 0 : column.config) == null ? void 0 : _a2.clearToken;
2627
+ forceUpdate();
2628
+ }, [(_a = column == null ? void 0 : column.config) == null ? void 0 : _a.clearToken]);
2629
+ const state = computeState();
2630
+ (0, import_react9.useEffect)(() => {
2631
+ if (checkboxRef.current) {
2632
+ checkboxRef.current.indeterminate = state.someSelected;
2633
+ }
2634
+ }, [state.someSelected]);
2635
+ const handleChange = (e) => {
2636
+ var _a2, _b, _c, _d;
2637
+ e.stopPropagation();
2638
+ const isChecked = e.target.checked;
2639
+ const pageData = (_b = (_a2 = column == null ? void 0 : column.config) == null ? void 0 : _a2.getPageData()) != null ? _b : [];
2640
+ pageData.forEach((row) => {
2641
+ api.exec("select-row", { id: row.id, mode: isChecked, toggle: true });
2642
+ });
2643
+ (_d = (_c = column == null ? void 0 : column.config) == null ? void 0 : _c.onSelectAllPage) == null ? void 0 : _d.call(_c, pageData, isChecked);
2644
+ };
2645
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2646
+ "div",
2647
+ {
2648
+ className: "flex items-center justify-center w-full h-full",
2649
+ "data-action": "ignore-click",
2650
+ onClick: (e) => e.stopPropagation(),
2651
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2652
+ "input",
2653
+ {
2654
+ ref: checkboxRef,
2655
+ type: "checkbox",
2656
+ checked: state.allSelected,
2657
+ onChange: handleChange,
2658
+ className: "w-4 h-4 rounded border border-border bg-background accent-primary cursor-pointer focus:outline-none focus:ring-1 focus:ring-primary"
2659
+ }
2660
+ )
2661
+ }
2662
+ );
2663
+ };
2664
+ var headerCheckBox_default = import_react9.default.memo(HeaderCheckbox);
2665
+
2666
+ // src/components/custom/grid/utils/buildCheckboxColumn.tsx
2667
+ function buildCheckboxColumn({
2668
+ getPageData,
2669
+ onSelectionChange,
2670
+ onSelectAllPage,
2671
+ clearToken
2672
+ }) {
2673
+ const configRef = {
2674
+ getPageData,
2675
+ onSelectionChange,
2676
+ onSelectAllPage,
2677
+ clearToken
2678
+ };
2679
+ return {
2680
+ id: "__selection__",
2681
+ width: 58,
2682
+ sortable: false,
2683
+ resize: false,
2684
+ config: configRef,
2685
+ header: { cell: headerCheckBox_default },
2686
+ cell: checkBoxCell_default
2687
+ };
2688
+ }
2689
+
2469
2690
  // src/components/custom/grid/index.tsx
2470
- var import_jsx_runtime25 = require("react/jsx-runtime");
2471
- var Grid = (0, import_react7.forwardRef)(
2691
+ var import_jsx_runtime28 = require("react/jsx-runtime");
2692
+ var Grid = (0, import_react10.forwardRef)(
2472
2693
  (_a, ref) => {
2473
2694
  var _b = _a, {
2474
2695
  data,
@@ -2483,7 +2704,17 @@ var Grid = (0, import_react7.forwardRef)(
2483
2704
  fonts,
2484
2705
  onFilterChange,
2485
2706
  initialFilters,
2486
- children
2707
+ children,
2708
+ onFocusCell = () => false,
2709
+ selectionEnabled = false,
2710
+ selectedIds = [],
2711
+ onRowSelectionChange,
2712
+ onSelectAllPage,
2713
+ selectedCount,
2714
+ selectedData,
2715
+ selectionActions,
2716
+ onSelectionAction,
2717
+ onClearSelection
2487
2718
  } = _b, rest = __objRest(_b, [
2488
2719
  "data",
2489
2720
  "columns",
@@ -2497,95 +2728,143 @@ var Grid = (0, import_react7.forwardRef)(
2497
2728
  "fonts",
2498
2729
  "onFilterChange",
2499
2730
  "initialFilters",
2500
- "children"
2731
+ "children",
2732
+ "onFocusCell",
2733
+ "selectionEnabled",
2734
+ "selectedIds",
2735
+ "onRowSelectionChange",
2736
+ "onSelectAllPage",
2737
+ "selectedCount",
2738
+ "selectedData",
2739
+ "selectionActions",
2740
+ "onSelectionAction",
2741
+ "onClearSelection"
2501
2742
  ]);
2502
- const apiRef = (0, import_react7.useRef)(null);
2503
- const containerRef = (0, import_react7.useRef)(null);
2504
- (0, import_react7.useImperativeHandle)(ref, () => apiRef.current, []);
2505
- const resizeColumns = (0, import_react7.useCallback)(() => {
2506
- var _a2;
2743
+ var _a2;
2744
+ const apiRef = (0, import_react10.useRef)(null);
2745
+ const containerRef = (0, import_react10.useRef)(null);
2746
+ const dataRef = (0, import_react10.useRef)(data);
2747
+ (0, import_react10.useEffect)(() => {
2748
+ dataRef.current = data;
2749
+ }, [data]);
2750
+ const onRowSelectionChangeRef = (0, import_react10.useRef)(onRowSelectionChange);
2751
+ (0, import_react10.useEffect)(() => {
2752
+ onRowSelectionChangeRef.current = onRowSelectionChange;
2753
+ }, [onRowSelectionChange]);
2754
+ const onSelectAllPageRef = (0, import_react10.useRef)(onSelectAllPage);
2755
+ (0, import_react10.useEffect)(() => {
2756
+ onSelectAllPageRef.current = onSelectAllPage;
2757
+ }, [onSelectAllPage]);
2758
+ (0, import_react10.useImperativeHandle)(ref, () => apiRef.current, []);
2759
+ const clearTokenRef = (0, import_react10.useRef)(0);
2760
+ const prevSelectedCountRef = (0, import_react10.useRef)(selectedCount != null ? selectedCount : 0);
2761
+ if (((_a2 = prevSelectedCountRef.current) != null ? _a2 : 0) > 0 && (selectedCount != null ? selectedCount : 0) === 0) {
2762
+ clearTokenRef.current += 1;
2763
+ }
2764
+ prevSelectedCountRef.current = selectedCount != null ? selectedCount : 0;
2765
+ const resolvedColumns = (0, import_react10.useMemo)(() => {
2766
+ if (!selectionEnabled) return columns;
2767
+ const checkboxCol = buildCheckboxColumn({
2768
+ getPageData: () => {
2769
+ var _a3;
2770
+ return (_a3 = dataRef.current) != null ? _a3 : [];
2771
+ },
2772
+ onSelectionChange: (id3, rowData, checked) => {
2773
+ var _a3;
2774
+ (_a3 = onRowSelectionChangeRef.current) == null ? void 0 : _a3.call(onRowSelectionChangeRef, id3, rowData, checked);
2775
+ },
2776
+ onSelectAllPage: (pageData, checked) => {
2777
+ var _a3;
2778
+ (_a3 = onSelectAllPageRef.current) == null ? void 0 : _a3.call(onSelectAllPageRef, pageData, checked);
2779
+ },
2780
+ clearToken: clearTokenRef.current
2781
+ });
2782
+ return [checkboxCol, ...columns];
2783
+ }, [selectionEnabled, columns, clearTokenRef.current]);
2784
+ const resizeColumns = (0, import_react10.useCallback)(() => {
2507
2785
  const api = apiRef.current;
2508
2786
  const container = containerRef.current;
2509
- if (!api) return;
2510
- const gridWidth = (_a2 = container == null ? void 0 : container.clientWidth) != null ? _a2 : 0;
2787
+ if (!api || !container) return;
2788
+ const gridWidth = container.clientWidth;
2789
+ const isFixedColumn = (col) => col.id === "__selection__";
2790
+ const resizableColumns = resolvedColumns.filter(
2791
+ (col) => !isFixedColumn(col)
2792
+ );
2793
+ const fixedColumns = resolvedColumns.filter(
2794
+ (col) => isFixedColumn(col)
2795
+ );
2796
+ const totalFixedWidth = fixedColumns.reduce((sum, col) => {
2797
+ var _a3, _b2;
2798
+ const column = api.getColumn(col.id);
2799
+ const width = (_b2 = (_a3 = column == null ? void 0 : column.width) != null ? _a3 : col.width) != null ? _b2 : 0;
2800
+ return sum + (isNaN(width) ? 0 : width);
2801
+ }, 0);
2802
+ const availableWidth = Math.max(gridWidth - totalFixedWidth, 0);
2511
2803
  if (data && data.length > 0) {
2512
- columns.forEach((col) => {
2513
- api.exec("resize-column", {
2514
- id: col.id,
2515
- auto: "data"
2516
- });
2804
+ resizableColumns.forEach((col) => {
2805
+ api.exec("resize-column", { id: col.id, auto: "data" });
2517
2806
  });
2518
- const totalColumnWidth = columns.reduce((sum, col) => {
2807
+ const totalAutoWidth = resizableColumns.reduce((sum, col) => {
2519
2808
  var _a3;
2520
2809
  const column = api.getColumn(col.id);
2521
2810
  const width = (_a3 = column == null ? void 0 : column.width) != null ? _a3 : 0;
2522
2811
  return sum + (isNaN(width) ? 0 : width);
2523
2812
  }, 0);
2524
- if (totalColumnWidth < gridWidth) {
2525
- const extra = (gridWidth - totalColumnWidth) / columns.length;
2526
- columns.forEach((col) => {
2813
+ if (totalAutoWidth < availableWidth && resizableColumns.length > 0) {
2814
+ const extra = (availableWidth - totalAutoWidth) / resizableColumns.length;
2815
+ resizableColumns.forEach((col) => {
2527
2816
  var _a3;
2528
2817
  const column = api.getColumn(col.id);
2529
2818
  const currentWidth = (_a3 = column == null ? void 0 : column.width) != null ? _a3 : 0;
2530
2819
  if (!isNaN(currentWidth)) {
2531
2820
  api.exec("resize-column", {
2532
2821
  id: col.id,
2533
- width: currentWidth + extra - 0.3
2822
+ width: currentWidth + extra
2534
2823
  });
2535
2824
  }
2536
2825
  });
2537
2826
  }
2538
2827
  } else {
2539
- const columnWidth = gridWidth / columns.length;
2540
- columns.forEach((col) => {
2828
+ const equalWidth = resizableColumns.length > 0 ? availableWidth / resizableColumns.length : 0;
2829
+ resizableColumns.forEach((col) => {
2541
2830
  api.exec("resize-column", {
2542
2831
  id: col.id,
2543
- width: columnWidth - 0.3
2832
+ width: equalWidth
2544
2833
  });
2545
2834
  });
2546
2835
  }
2547
- }, [columns, data]);
2548
- (0, import_react7.useEffect)(() => {
2836
+ }, [resolvedColumns, data]);
2837
+ (0, import_react10.useEffect)(() => {
2549
2838
  if (!containerRef.current) return;
2550
- const observer = new ResizeObserver(() => {
2551
- resizeColumns();
2552
- });
2839
+ const observer = new ResizeObserver(() => resizeColumns());
2553
2840
  observer.observe(containerRef.current);
2554
2841
  return () => observer.disconnect();
2555
2842
  }, [resizeColumns]);
2556
- const init = (0, import_react7.useCallback)(
2843
+ const init = (0, import_react10.useCallback)(
2557
2844
  (api) => {
2558
2845
  apiRef.current = api;
2559
2846
  resizeColumns();
2847
+ api.intercept("focus-cell", onFocusCell);
2560
2848
  },
2561
- [resizeColumns]
2849
+ [resizeColumns, onFocusCell]
2562
2850
  );
2563
2851
  const getSelectedData = () => {
2564
- var _a2, _b2;
2565
- const selected = (_b2 = (_a2 = apiRef.current) == null ? void 0 : _a2.getState().selectedRows) != null ? _b2 : [];
2566
- let selectedData = data.filter((row) => {
2567
- return selected.includes(row.id);
2568
- });
2569
- return selectedData;
2852
+ var _a3, _b2;
2853
+ const selected = (_b2 = (_a3 = apiRef.current) == null ? void 0 : _a3.getState().selectedRows) != null ? _b2 : [];
2854
+ return data.filter((row) => selected.includes(row.id));
2570
2855
  };
2571
- const handleExportPdf = (0, import_react7.useCallback)(() => {
2856
+ const handleExportPdf = (0, import_react10.useCallback)(() => {
2572
2857
  const selected = getSelectedData();
2573
- if (selected.length) {
2574
- exportPdf(selected, fileName);
2575
- } else {
2576
- onExportPdf == null ? void 0 : onExportPdf();
2577
- }
2578
- }, [getSelectedData, exportPdf, onExportPdf, fileName]);
2579
- const handleExportExcel = (0, import_react7.useCallback)(() => {
2858
+ if (selected.length) exportPdf(selected, fileName);
2859
+ else onExportPdf == null ? void 0 : onExportPdf();
2860
+ }, [data, fileName, onExportPdf]);
2861
+ const handleExportExcel = (0, import_react10.useCallback)(() => {
2580
2862
  const selected = getSelectedData();
2581
- if (selected.length) {
2582
- exportExcel(selected, fileName);
2583
- } else {
2584
- onExportExcel == null ? void 0 : onExportExcel();
2585
- }
2586
- }, [getSelectedData, exportExcel, onExportExcel, fileName]);
2587
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "w-full h-full flex flex-col overflow-hidden", children: [
2588
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2863
+ if (selected.length) exportExcel(selected, fileName);
2864
+ else onExportExcel == null ? void 0 : onExportExcel();
2865
+ }, [data, fileName, onExportExcel]);
2866
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "w-full h-full flex flex-col overflow-hidden", children: [
2867
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2589
2868
  gridHeader_default,
2590
2869
  {
2591
2870
  onPdf: handleExportPdf,
@@ -2598,20 +2877,42 @@ var Grid = (0, import_react7.forwardRef)(
2598
2877
  filterList: rest.filterList,
2599
2878
  onFilterChange,
2600
2879
  initialFilters,
2880
+ selectedCount,
2881
+ selectedData,
2882
+ selectionActions,
2883
+ onSelectionAction,
2884
+ onClearSelection,
2601
2885
  children
2602
2886
  }
2603
2887
  ),
2604
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex-1 w-full overflow-hidden", ref: containerRef, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_grid.WillowDark, { fonts, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "w-full h-full relative", children: rest.loading ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "absolute inset-0 bg-background/60 backdrop-blur-sm flex items-center justify-center z-10", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "animate-spin rounded-full h-8 w-8 border-2 border-primary border-t-transparent" }) }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_grid.Grid, __spreadProps(__spreadValues({}, rest), { data, columns, init })) }) }) })
2888
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2889
+ "div",
2890
+ {
2891
+ className: "flex-1 w-full border border-border overflow-hidden",
2892
+ ref: containerRef,
2893
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_grid.WillowDark, { fonts, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "w-full h-full relative", children: rest.loading ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "absolute inset-0 bg-background/60 backdrop-blur-sm flex items-center justify-center z-10", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "animate-spin rounded-full h-8 w-8 border-2 border-primary border-t-transparent" }) }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2894
+ import_react_grid.Grid,
2895
+ __spreadProps(__spreadValues({}, rest), {
2896
+ data,
2897
+ columns: resolvedColumns,
2898
+ init,
2899
+ selectedRows: selectionEnabled ? selectedIds : void 0,
2900
+ select: selectionEnabled ? false : rest.select
2901
+ })
2902
+ ) }) })
2903
+ }
2904
+ )
2605
2905
  ] });
2606
2906
  }
2607
2907
  );
2608
2908
  var grid_default = Grid;
2609
2909
 
2610
2910
  // src/components/custom/grid/sortableHeaderCell.tsx
2611
- var import_lucide_react14 = require("lucide-react");
2612
- var import_jsx_runtime26 = require("react/jsx-runtime");
2613
- function SortableHeaderCell({ cell, sortKey, sortOrder, onSortChange }) {
2614
- if (!(cell == null ? void 0 : cell.id)) return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: cell == null ? void 0 : cell.text });
2911
+ var import_lucide_react15 = require("lucide-react");
2912
+ var import_react11 = __toESM(require("react"));
2913
+ var import_jsx_runtime29 = require("react/jsx-runtime");
2914
+ var SortableHeaderCell = ({ cell, sortKey, sortOrder, onSortChange }) => {
2915
+ if (!(cell == null ? void 0 : cell.id)) return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: cell == null ? void 0 : cell.text });
2615
2916
  const active = sortKey === cell.id;
2616
2917
  const handleClick = () => {
2617
2918
  if (!onSortChange || !cell.id) return;
@@ -2625,20 +2926,27 @@ function SortableHeaderCell({ cell, sortKey, sortOrder, onSortChange }) {
2625
2926
  }
2626
2927
  onSortChange("", null);
2627
2928
  };
2628
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2929
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
2629
2930
  "div",
2630
2931
  {
2631
2932
  onClick: handleClick,
2632
2933
  className: "cursor-pointer flex items-center gap-2 justify-between select-none",
2633
2934
  children: [
2634
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: cell.text }),
2635
- !active && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react14.ArrowUpDown, { className: "w-4 h-4 opacity-50" }),
2636
- active && (sortOrder === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react14.MoveDown, { className: "w-4 h-4" }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react14.MoveUp, { className: "w-4 h-4" }))
2935
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: cell.text }),
2936
+ !active && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.ArrowUpDown, { className: "w-4 h-4 opacity-50" }),
2937
+ active && (sortOrder === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.MoveDown, { className: "w-4 h-4" }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react15.MoveUp, { className: "w-4 h-4" }))
2637
2938
  ]
2638
2939
  }
2639
2940
  );
2640
- }
2641
- var sortableHeaderCell_default = SortableHeaderCell;
2941
+ };
2942
+ var sortableHeaderCell_default = import_react11.default.memo(SortableHeaderCell, (prev, next) => {
2943
+ var _a, _b, _c, _d;
2944
+ if (((_a = prev.cell) == null ? void 0 : _a.id) !== ((_b = next.cell) == null ? void 0 : _b.id)) return false;
2945
+ if (((_c = prev.cell) == null ? void 0 : _c.text) !== ((_d = next.cell) == null ? void 0 : _d.text)) return false;
2946
+ if (prev.sortKey !== next.sortKey) return false;
2947
+ if (prev.sortOrder !== next.sortOrder) return false;
2948
+ return true;
2949
+ });
2642
2950
 
2643
2951
  // src/utils/pagination.ts
2644
2952
  function getPaginationRange(currentPage, totalPages, siblingCount = 2) {
@@ -2671,8 +2979,8 @@ function getPaginationRange(currentPage, totalPages, siblingCount = 2) {
2671
2979
  }
2672
2980
 
2673
2981
  // src/components/custom/pagination/index.tsx
2674
- var import_lucide_react15 = require("lucide-react");
2675
- var import_jsx_runtime27 = require("react/jsx-runtime");
2982
+ var import_lucide_react16 = require("lucide-react");
2983
+ var import_jsx_runtime30 = require("react/jsx-runtime");
2676
2984
  function Pagination({
2677
2985
  totalCount,
2678
2986
  count = null,
@@ -2692,47 +3000,47 @@ function Pagination({
2692
3000
  const handlePageSizeChange = (size) => {
2693
3001
  onPageSizeChange == null ? void 0 : onPageSizeChange(size);
2694
3002
  };
2695
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col-reverse gap-2 md:flex-row items-center justify-between bg-card px-3 py-2 rounded-br-md rounded-bl-md", children: [
2696
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex justify-between w-full md:w-auto items-center gap-3 text-xs text-muted-foreground tracking-wider font-medium", children: [
2697
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { children: [
3003
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-col-reverse gap-2 md:flex-row items-center justify-between bg-card px-3 py-2 rounded-br-md rounded-bl-md border-l border-r border-b", children: [
3004
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex justify-between w-full md:w-auto items-center gap-3 text-xs text-muted-foreground tracking-wider font-medium", children: [
3005
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { children: [
2698
3006
  "Showing ",
2699
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-foreground", children: count }),
3007
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-foreground", children: count }),
2700
3008
  " of",
2701
3009
  " ",
2702
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-foreground", children: totalCount })
3010
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-foreground", children: totalCount })
2703
3011
  ] }),
2704
- showSizeChanger && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3012
+ showSizeChanger && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2705
3013
  "select",
2706
3014
  {
2707
3015
  value: pageSize,
2708
3016
  onChange: (e) => handlePageSizeChange(Number(e.target.value)),
2709
3017
  className: "rounded-md border border-input bg-background px-3 py-2 text-xs text-foreground focus:outline-none",
2710
- children: sizeChangerOptions.map((size) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("option", { value: size, children: [
3018
+ children: sizeChangerOptions.map((size) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("option", { value: size, children: [
2711
3019
  size,
2712
3020
  " / page"
2713
3021
  ] }, size))
2714
3022
  }
2715
3023
  )
2716
3024
  ] }),
2717
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex w-full md:w-auto justify-between items-center gap-1", children: [
2718
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3025
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex w-full md:w-auto justify-between items-center gap-1", children: [
3026
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2719
3027
  "button",
2720
3028
  {
2721
3029
  disabled: currentPage === 1,
2722
3030
  onClick: () => handlePageChange(currentPage - 1),
2723
3031
  className: "border border-border w-8 h-8 rounded-md flex items-center justify-center disabled:opacity-40 hover:bg-card-foreground transition",
2724
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.ChevronLeft, { className: "w-5 h-5 select-none" })
3032
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.ChevronLeft, { className: "w-5 h-5 select-none" })
2725
3033
  }
2726
3034
  ),
2727
3035
  pages.map(
2728
- (page, idx) => page === "dots" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3036
+ (page, idx) => page === "dots" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2729
3037
  "span",
2730
3038
  {
2731
3039
  className: "px-2 text-muted-foreground text-xs tracking-wider font-medium",
2732
3040
  children: "\u2026"
2733
3041
  },
2734
3042
  `dots-${idx}`
2735
- ) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3043
+ ) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2736
3044
  "button",
2737
3045
  {
2738
3046
  onClick: () => handlePageChange(page),
@@ -2742,13 +3050,13 @@ function Pagination({
2742
3050
  page
2743
3051
  )
2744
3052
  ),
2745
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3053
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2746
3054
  "button",
2747
3055
  {
2748
3056
  disabled: currentPage === totalPages,
2749
3057
  onClick: () => handlePageChange(currentPage + 1),
2750
3058
  className: "border border-border w-8 h-8 rounded-md flex items-center justify-center disabled:opacity-40 hover:bg-card-foreground transition",
2751
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.ChevronRight, { className: "w-5 h-5 select-none" })
3059
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react16.ChevronRight, { className: "w-5 h-5 select-none" })
2752
3060
  }
2753
3061
  )
2754
3062
  ] })
@@ -2757,9 +3065,9 @@ function Pagination({
2757
3065
  var pagination_default = Pagination;
2758
3066
 
2759
3067
  // src/components/custom/toolbar/index.tsx
2760
- var import_lucide_react16 = require("lucide-react");
2761
- var import_react8 = require("react");
2762
- var import_jsx_runtime28 = require("react/jsx-runtime");
3068
+ var import_lucide_react17 = require("lucide-react");
3069
+ var import_react12 = require("react");
3070
+ var import_jsx_runtime31 = require("react/jsx-runtime");
2763
3071
  var SlideToolbar = ({
2764
3072
  items,
2765
3073
  children,
@@ -2771,9 +3079,9 @@ var SlideToolbar = ({
2771
3079
  className = ""
2772
3080
  }) => {
2773
3081
  const resolvedItems = items != null ? items : children ? void 0 : [];
2774
- const [open, setOpen] = (0, import_react8.useState)(false);
2775
- const panelRef = (0, import_react8.useRef)(null);
2776
- (0, import_react8.useEffect)(() => {
3082
+ const [open, setOpen] = (0, import_react12.useState)(false);
3083
+ const panelRef = (0, import_react12.useRef)(null);
3084
+ (0, import_react12.useEffect)(() => {
2777
3085
  if (!open || !closeOnBackdrop) return;
2778
3086
  const handlePointerDown = (e) => {
2779
3087
  if (panelRef.current && !panelRef.current.contains(e.target)) {
@@ -2786,8 +3094,8 @@ var SlideToolbar = ({
2786
3094
  const handleItem = (item) => {
2787
3095
  onAction == null ? void 0 : onAction(item.id);
2788
3096
  };
2789
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
2790
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("style", { children: `
3097
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
3098
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("style", { children: `
2791
3099
  @keyframes bounceX {
2792
3100
  0%, 100% { transform: translateX(0px); }
2793
3101
  40% { transform: translateX(4px); }
@@ -2797,7 +3105,7 @@ var SlideToolbar = ({
2797
3105
  animation: bounceX 1.4s ease-in-out infinite;
2798
3106
  }
2799
3107
  ` }),
2800
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3108
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2801
3109
  "div",
2802
3110
  {
2803
3111
  role: "button",
@@ -2811,8 +3119,8 @@ var SlideToolbar = ({
2811
3119
  "hover:brightness-110 transition-all duration-200",
2812
3120
  open ? "opacity-0 pointer-events-none !w-0 border-r-0" : "opacity-100 pointer-events-auto"
2813
3121
  ].join(" "),
2814
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2815
- import_lucide_react16.ChevronRight,
3122
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3123
+ import_lucide_react17.ChevronRight,
2816
3124
  {
2817
3125
  className: "text-primary-foreground chevron-bounce",
2818
3126
  size: 16
@@ -2820,7 +3128,7 @@ var SlideToolbar = ({
2820
3128
  )
2821
3129
  }
2822
3130
  ),
2823
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
3131
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
2824
3132
  "div",
2825
3133
  {
2826
3134
  ref: panelRef,
@@ -2837,41 +3145,36 @@ var SlideToolbar = ({
2837
3145
  ].join(" "),
2838
3146
  style: { width: `${panelWidth}px` },
2839
3147
  children: [
2840
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center justify-between px-3 py-2.5 bg-surface-alt border-b border-border shrink-0", children: [
2841
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-xs font-semibold tracking-[0.15em] uppercase text-foreground", children: title }),
2842
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3148
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center justify-between px-4 py-3 border-b border-border shrink-0", children: [
3149
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-sm font-semibold text-foreground tracking-wide", children: title }),
3150
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2843
3151
  "button",
2844
3152
  {
2845
3153
  onClick: () => setOpen(false),
2846
3154
  "aria-label": "Close toolbar",
2847
- className: "flex items-center justify-center w-5 h-5 rounded cursor-pointer\n text-foreground hover:text-foreground hover:bg-border\n transition-colors duration-100",
2848
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react16.X, { size: 14 })
3155
+ className: "flex items-center justify-center w-6 h-6 rounded-md\n text-foreground/50 hover:text-foreground hover:bg-surface-alt\n transition-all duration-150 cursor-pointer",
3156
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react17.X, { size: 13 })
2849
3157
  }
2850
3158
  )
2851
3159
  ] }),
2852
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex-1 overflow-y-auto overflow-x-hidden p-1.5 scrollbar-none", children: resolvedItems ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
2853
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "p-2 text-xs font-semibold tracking-[0.14em] uppercase text-foreground/30", children: "Actions" }),
2854
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("nav", { className: "flex flex-col gap-2", children: resolvedItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
3160
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex-1 overflow-y-auto overflow-x-hidden py-2 scrollbar-none", children: resolvedItems ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
3161
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "px-4 pt-1 pb-2 text-[10px] font-semibold tracking-[0.16em] uppercase text-foreground/35", children: "Actions" }),
3162
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("nav", { className: "flex flex-col px-2", children: resolvedItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
2855
3163
  "button",
2856
3164
  {
2857
3165
  onClick: () => handleItem(item),
2858
- className: [
2859
- "group flex items-center gap-2.5 p-2.5 rounded w-full",
2860
- "text-left text-sm cursor-pointer border-l-2",
2861
- "transition-colors duration-100",
2862
- "border-transparent text-foreground/70 hover:text-foreground hover:bg-surface-alt hover:border-primary"
2863
- ].join(" "),
3166
+ className: "group flex items-center gap-3 px-3 py-2.5 rounded-lg w-full\n text-left text-[13px] font-medium cursor-pointer\n text-foreground/60 hover:text-foreground hover:bg-surface-alt\n transition-all duration-150 border-l-2 border-transparent\n hover:border-primary",
2864
3167
  children: [
2865
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "flex shrink-0 transition-colors duration-100 text-foreground/70 group-hover:text-foreground/90", children: item.icon }),
2866
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "flex-1 leading-none", children: item.label })
3168
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "flex shrink-0 text-foreground/40 group-hover:text-primary transition-colors duration-150", children: item.icon }),
3169
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "flex-1 leading-none", children: item.label })
2867
3170
  ]
2868
3171
  },
2869
3172
  item.id
2870
3173
  )) })
2871
3174
  ] }) : children }),
2872
- footerLabel && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center gap-2 px-3 py-2 border-t border-border bg-surface-alt shrink-0", children: [
2873
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "w-1 h-1 rounded-full bg-foreground/20 shrink-0" }),
2874
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-[9px] tracking-[0.1em] uppercase text-foreground/25", children: footerLabel })
3175
+ footerLabel && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center gap-2 px-4 py-3 border-t border-border shrink-0", children: [
3176
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-foreground/20 shrink-0" }),
3177
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-[10px] tracking-[0.12em] uppercase text-foreground/30 font-medium", children: footerLabel })
2875
3178
  ] })
2876
3179
  ]
2877
3180
  }