@motor-hero/ui-kit 0.39.0 → 0.40.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.
@@ -7,6 +7,7 @@ export interface RowAction {
7
7
  href?: string;
8
8
  destructive?: boolean;
9
9
  disabled?: boolean;
10
+ children?: RowAction[];
10
11
  }
11
12
  export interface RowActionsMenuProps {
12
13
  actions: RowAction[];
@@ -1 +1 @@
1
- {"version":3,"file":"row-actions-menu.d.ts","sourceRoot":"","sources":["../../src/components/row-actions-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAA;AAIhD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAGzC,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,SAAS,EAAE,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,UAAU,CAAA;CACxB;AAWD,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,QAAgB,EAChB,KAAa,EACb,KAAe,EACf,UAA8B,GAC/B,EAAE,mBAAmB,sCAyHrB"}
1
+ {"version":3,"file":"row-actions-menu.d.ts","sourceRoot":"","sources":["../../src/components/row-actions-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAA;AAIhD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAGzC,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAGlB,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAA;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,SAAS,EAAE,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,UAAU,CAAA;CACxB;AAWD,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,QAAgB,EAChB,KAAa,EACb,KAAe,EACf,UAA8B,GAC/B,EAAE,mBAAmB,sCA2LrB"}
package/dist/index.cjs CHANGED
@@ -2208,6 +2208,45 @@ function RowActionsMenu({
2208
2208
  itemClass2,
2209
2209
  action.destructive && "text-destructive focus:bg-destructive/10"
2210
2210
  );
2211
+ if (action.children?.length) {
2212
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(DropdownMenu3.Sub, { children: [
2213
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2214
+ DropdownMenu3.SubTrigger,
2215
+ {
2216
+ className: cls,
2217
+ disabled: action.disabled,
2218
+ children: [
2219
+ action.icon,
2220
+ action.label,
2221
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react12.ChevronRight, { className: "ml-auto h-4 w-4 text-muted-foreground" })
2222
+ ]
2223
+ }
2224
+ ),
2225
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DropdownMenu3.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2226
+ DropdownMenu3.SubContent,
2227
+ {
2228
+ sideOffset: 4,
2229
+ className: "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",
2230
+ children: action.children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2231
+ DropdownMenu3.Item,
2232
+ {
2233
+ className: cn(
2234
+ itemClass2,
2235
+ child.destructive && "text-destructive focus:bg-destructive/10"
2236
+ ),
2237
+ disabled: child.disabled,
2238
+ onClick: child.onClick,
2239
+ children: [
2240
+ child.icon,
2241
+ child.label
2242
+ ]
2243
+ },
2244
+ child.label
2245
+ ))
2246
+ }
2247
+ ) })
2248
+ ] }, action.label);
2249
+ }
2211
2250
  return action.href ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2212
2251
  DropdownMenu3.Item,
2213
2252
  {
@@ -2257,6 +2296,36 @@ function RowActionsMenu({
2257
2296
  action.icon,
2258
2297
  action.label
2259
2298
  ] });
2299
+ if (action.children?.length) {
2300
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { children: [
2301
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "mx-3 my-1 h-px bg-border" }),
2302
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-3 px-3 pb-1 pt-2 text-xs font-medium uppercase tracking-wide text-muted-foreground", children: [
2303
+ action.icon,
2304
+ action.label
2305
+ ] }),
2306
+ action.children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
2307
+ "button",
2308
+ {
2309
+ type: "button",
2310
+ disabled: child.disabled,
2311
+ className: cn(
2312
+ sheetItemClass2,
2313
+ child.destructive && "text-destructive"
2314
+ ),
2315
+ onClick: () => {
2316
+ child.onClick?.();
2317
+ setOpen(false);
2318
+ },
2319
+ children: [
2320
+ child.icon,
2321
+ child.label
2322
+ ]
2323
+ },
2324
+ child.label
2325
+ )),
2326
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "mx-3 my-1 h-px bg-border" })
2327
+ ] }, action.label);
2328
+ }
2260
2329
  return action.href ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2261
2330
  "span",
2262
2331
  {