@stackframe/stack-ui 2.6.11 → 2.6.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @stackframe/stack-ui
2
2
 
3
+ ## 2.6.15
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @stackframe/stack-shared@2.6.15
9
+
10
+ ## 2.6.14
11
+
12
+ ### Patch Changes
13
+
14
+ - @stackframe/stack-shared@2.6.14
15
+
16
+ ## 2.6.13
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies
21
+ - @stackframe/stack-shared@2.6.13
22
+
23
+ ## 2.6.12
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated account settings page
28
+ - Updated dependencies
29
+ - @stackframe/stack-shared@2.6.12
30
+
3
31
  ## 2.6.11
4
32
 
5
33
  ### Patch Changes
@@ -15,6 +15,8 @@ type ActionItem = '-' | {
15
15
  item: React.ReactNode;
16
16
  onClick: (e: React.MouseEvent) => void | Promise<void>;
17
17
  danger?: boolean;
18
+ disabled?: boolean;
19
+ disabledTooltip?: string;
18
20
  };
19
21
  export declare function ActionCell(props: {
20
22
  items?: ActionItem[];
@@ -1,7 +1,8 @@
1
1
  'use client';
2
+ import { createElement as _createElement } from "react";
2
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
4
  import { DotsHorizontalIcon } from "@radix-ui/react-icons";
4
- import { useEffect, useRef, useState } from "react";
5
+ import React, { useEffect, useRef, useState } from "react";
5
6
  import { SimpleTooltip, cn, Avatar, AvatarImage, Badge, Button, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "../..";
6
7
  export function TextCell(props) {
7
8
  const textRef = useRef(null);
@@ -31,7 +32,23 @@ export function DateCell(props) {
31
32
  return (_jsx(TextCell, { size: 140, children: ignore ? 'Never' : timeString }));
32
33
  }
33
34
  export function ActionCell(props) {
34
- return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", className: cn("flex h-8 w-8 p-0 data-[state=open]:bg-muted", props.invisible && "invisible"), children: [_jsx(DotsHorizontalIcon, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Open menu" })] }) }), _jsx(DropdownMenuContent, { align: "end", className: "w-[160px]", children: props.items?.map((item, index) => item === '-' ? (_jsx(DropdownMenuSeparator, {}, index)) : (_jsx(DropdownMenuItem, { onClick: item.onClick, className: item.danger ? "text-destructive" : "", children: item.item }, index))) })] }));
35
+ return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", className: cn("flex h-8 w-8 p-0 data-[state=open]:bg-muted", props.invisible && "invisible"), children: [_jsx(DotsHorizontalIcon, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Open menu" })] }) }), _jsx(DropdownMenuContent, { align: "end", className: "min-w-[150px] max-w-[300px]", children: props.items?.map((item, index) => {
36
+ if (item === '-') {
37
+ return _jsx(DropdownMenuSeparator, {}, index);
38
+ }
39
+ const menuItemProps = {
40
+ onClick: item.onClick,
41
+ className: cn(item.danger ? "text-destructive" : ""),
42
+ disabled: item.disabled
43
+ };
44
+ const menuItem = (_createElement(DropdownMenuItem, { ...menuItemProps, key: index }, item.item));
45
+ if (item.disabled && item.disabledTooltip) {
46
+ return (_jsx(SimpleTooltip, { tooltip: item.disabledTooltip, children: React.cloneElement(menuItem, {
47
+ className: cn(menuItemProps.className, "opacity-50 cursor-not-allowed")
48
+ }) }, index));
49
+ }
50
+ return menuItem;
51
+ }) })] }));
35
52
  }
36
53
  export function BadgeCell(props) {
37
54
  return (_jsx("div", { className: "flex items-center gap-1 flex-wrap", children: props.badges.map((badge, index) => (_jsx(Badge, { variant: "secondary", children: badge }, index))) }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackframe/stack-ui",
3
- "version": "2.6.11",
3
+ "version": "2.6.15",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [
@@ -68,7 +68,7 @@
68
68
  "react-hook-form": "^7.51.4",
69
69
  "react-resizable-panels": "^2.0.19",
70
70
  "tailwind-merge": "^2.3.0",
71
- "@stackframe/stack-shared": "2.6.11"
71
+ "@stackframe/stack-shared": "2.6.15"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@types/react": "^18.2.66",