@stackframe/stack-ui 2.8.17 → 2.8.20

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,27 @@
1
1
  # @stackframe/stack-ui
2
2
 
3
+ ## 2.8.20
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @stackframe/stack-shared@2.8.20
9
+
10
+ ## 2.8.19
11
+
12
+ ### Patch Changes
13
+
14
+ - Various changes
15
+ - Updated dependencies
16
+ - @stackframe/stack-shared@2.8.19
17
+
18
+ ## 2.8.18
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies
23
+ - @stackframe/stack-shared@2.8.18
24
+
3
25
  ## 2.8.17
4
26
 
5
27
  ### Patch Changes
@@ -29,7 +29,7 @@ export function ActionDialog(props) {
29
29
  if (await cancelButton.onClick?.() !== "prevent-close") {
30
30
  onOpenChange(false);
31
31
  }
32
- }, ...cancelButton.props, children: "Cancel" })), okButton && (_jsx(Button, { disabled: !!props.confirmText && !confirmed, variant: props.danger ? "destructive" : "default", onClick: async () => {
32
+ }, ...cancelButton.props, children: cancelButton.label ?? "Cancel" })), okButton && (_jsx(Button, { disabled: !!props.confirmText && !confirmed, variant: props.danger ? "destructive" : "default", onClick: async () => {
33
33
  if (await okButton.onClick?.() !== "prevent-close") {
34
34
  onOpenChange(false);
35
35
  }
@@ -2,6 +2,7 @@ import React from "react";
2
2
  declare const CopyButton: React.FC<{
3
3
  onClick?: ((e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void | Promise<void>) | undefined;
4
4
  loading?: boolean | undefined;
5
+ loadingStyle?: "spinner" | "disabled" | undefined;
5
6
  } & {
6
7
  asChild?: boolean | undefined;
7
8
  } & React.ButtonHTMLAttributes<HTMLButtonElement> & import("class-variance-authority").VariantProps<(props?: ({
@@ -1 +1 @@
1
- {"version":3,"file":"copy-button.d.ts","sourceRoot":"","sources":["../../src/components/copy-button.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,QAAA,MAAM,UAAU;;;;;;;;;;;aAEmC,MAAM;EAuBvD,CAAC;AAGH,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"copy-button.d.ts","sourceRoot":"","sources":["../../src/components/copy-button.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,QAAA,MAAM,UAAU;;;;;;;;;;;;aAEmC,MAAM;EAuBvD,CAAC;AAGH,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -9,5 +9,5 @@ export function SimpleTooltip(props) {
9
9
  _jsx(Info, { className: iconClassName }) :
10
10
  null;
11
11
  const trigger = (_jsxs(_Fragment, { children: [icon, props.children] }));
12
- return (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { open: props.disabled ? false : undefined, children: [_jsx(TooltipTrigger, { asChild: true, children: props.inline ? (_jsx("span", { className: cn(props.className), children: trigger })) : (_jsx("div", { className: cn("flex items-center gap-1", props.className), children: trigger })) }), _jsx(TooltipContent, { children: _jsx("div", { className: "max-w-60 text-center text-wrap whitespace-pre-wrap", children: props.tooltip }) })] }) }));
12
+ return (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { open: props.disabled ? false : undefined, children: [_jsx(TooltipTrigger, { asChild: true, children: props.inline ? (_jsx("span", { className: cn(props.className), children: trigger })) : (_jsx("div", { className: cn("flex items-center gap-1", props.className), children: trigger })) }), props.tooltip && _jsx(TooltipContent, { children: _jsx("div", { className: "max-w-60 text-center text-wrap whitespace-pre-wrap", children: props.tooltip }) })] }) }));
13
13
  }
@@ -10,10 +10,12 @@ export type OriginalButtonProps = {
10
10
  type ButtonProps = {
11
11
  onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void | Promise<void>;
12
12
  loading?: boolean;
13
+ loadingStyle?: "spinner" | "disabled";
13
14
  } & OriginalButtonProps;
14
15
  declare const Button: React.FC<{
15
16
  onClick?: ((e: React.MouseEvent<HTMLButtonElement>) => void | Promise<void>) | undefined;
16
17
  loading?: boolean | undefined;
18
+ loadingStyle?: "spinner" | "disabled" | undefined;
17
19
  } & {
18
20
  asChild?: boolean | undefined;
19
21
  } & React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<(props?: ({
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,QAAA,MAAM,cAAc;;;8EA8BnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAA;AAgBvF,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,mBAAmB,CAAA;AAEvB,QAAA,MAAM,MAAM;mBAJI,gBAAgB,CAAC,iBAAiB,CAAC,KAAK,IAAI,GAAG,QAAQ,IAAI,CAAC;;;;;;;;;EA0B3E,CAAC;AAGF,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,QAAA,MAAM,cAAc;;;8EA8BnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAA;AAgBvF,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;CACvC,GAAG,mBAAmB,CAAA;AAEvB,QAAA,MAAM,MAAM;mBALI,gBAAgB,CAAC,iBAAiB,CAAC,KAAK,IAAI,GAAG,QAAQ,IAAI,CAAC;;;;;;;;;;EA2B3E,CAAC;AAGF,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC"}
@@ -35,12 +35,12 @@ const OriginalButton = forwardRefIfNeeded(({ className, variant, size, asChild =
35
35
  return (_jsx(Comp, { className: cn(buttonVariants({ variant, size, className })), ref: ref, ...props }));
36
36
  });
37
37
  OriginalButton.displayName = "Button";
38
- const Button = forwardRefIfNeeded(({ onClick, loading: loadingProp, children, size, ...props }, ref) => {
38
+ const Button = forwardRefIfNeeded(({ onClick, loading: loadingProp, loadingStyle = "spinner", children, size, ...props }, ref) => {
39
39
  const [handleClick, isLoading] = useAsyncCallback(async (e) => {
40
40
  await onClick?.(e);
41
41
  }, [onClick]);
42
42
  const loading = loadingProp || isLoading;
43
- return (_jsxs(OriginalButton, { ...props, ref: ref, disabled: props.disabled || loading, onClick: (e) => runAsynchronouslyWithAlert(handleClick(e)), size: size, className: cn("relative", loading && "[&>:not(.stack-button-do-not-hide-when-siblings-are)]:invisible", props.className), children: [_jsx(Spinner, { className: cn("absolute inset-0 flex items-center justify-center stack-button-do-not-hide-when-siblings-are", !loading && "invisible") }), typeof children === "string" ? _jsx("span", { children: children }) : children] }));
43
+ return (_jsxs(OriginalButton, { ...props, ref: ref, disabled: props.disabled || loading, onClick: (e) => runAsynchronouslyWithAlert(handleClick(e)), size: size, className: cn("relative", loading && "[&>:not(.stack-button-do-not-hide-when-siblings-are)]:invisible", props.className), children: [loadingStyle === "spinner" && _jsx(Spinner, { className: cn("absolute inset-0 flex items-center justify-center stack-button-do-not-hide-when-siblings-are", !loading && "invisible") }), typeof children === "string" ? _jsx("span", { children: children }) : children] }));
44
44
  });
45
45
  Button.displayName = "Button";
46
46
  export { Button, buttonVariants };
@@ -8,6 +8,10 @@ declare const DialogOverlay: React.FC<Omit<DialogPrimitive.DialogOverlayProps &
8
8
  ref?: React.Ref<HTMLDivElement> | undefined;
9
9
  }>;
10
10
  declare const DialogContent: React.FC<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
11
+ overlayProps?: Omit<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
12
+ ref?: React.Ref<HTMLDivElement> | undefined;
13
+ }, "ref"> | undefined;
14
+ } & {
11
15
  ref?: React.Ref<HTMLDivElement> | undefined;
12
16
  }>;
13
17
  declare const DialogBody: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
@@ -25,5 +29,5 @@ declare const DialogTitle: React.FC<Omit<DialogPrimitive.DialogTitleProps & Reac
25
29
  declare const DialogDescription: React.FC<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & {
26
30
  ref?: React.Ref<HTMLParagraphElement> | undefined;
27
31
  }>;
28
- export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
32
+ export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
29
33
  //# sourceMappingURL=dialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAG1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,QAAA,MAAM,MAAM,uCAAuB,CAAC;AAEpC,QAAA,MAAM,aAAa,8GAA0B,CAAC;AAE9C,QAAA,MAAM,YAAY,6CAAyB,CAAC;AAE5C,QAAA,MAAM,WAAW,4GAAwB,CAAC;AAE1C,QAAA,MAAM,aAAa;;EAYjB,CAAC;AAGH,QAAA,MAAM,aAAa;;EAqBjB,CAAC;AAGH,QAAA,MAAM,UAAU,4BAGb,MAAM,cAAc,CAAC,cAAc,CAAC,4CAEtC,CAAC;AAEF,QAAA,MAAM,YAAY;8BAGf,MAAM,cAAc,CAAC,cAAc,CAAC;;CAQtC,CAAC;AAGF,QAAA,MAAM,YAAY;8BAGf,MAAM,cAAc,CAAC,cAAc,CAAC;;CAQtC,CAAC;AAGF,QAAA,MAAM,WAAW;;EAYf,CAAC;AAGH,QAAA,MAAM,iBAAiB;;EASrB,CAAC;AAGH,OAAO,EACL,MAAM,EACN,UAAU,EACV,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAC"}
1
+ {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAG1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,QAAA,MAAM,MAAM,uCAAuB,CAAC;AAEpC,QAAA,MAAM,aAAa,8GAA0B,CAAC;AAE9C,QAAA,MAAM,YAAY,6CAAyB,CAAC;AAE5C,QAAA,MAAM,WAAW,4GAAwB,CAAC;AAE1C,QAAA,MAAM,aAAa;;EAYjB,CAAC;AAGH,QAAA,MAAM,aAAa;;;;;;EAuBjB,CAAC;AAGH,QAAA,MAAM,UAAU,4BAGb,MAAM,cAAc,CAAC,cAAc,CAAC,4CAEtC,CAAC;AAEF,QAAA,MAAM,YAAY;8BAGf,MAAM,cAAc,CAAC,cAAc,CAAC;;CAQtC,CAAC;AAGF,QAAA,MAAM,YAAY;8BAGf,MAAM,cAAc,CAAC,cAAc,CAAC;;CAQtC,CAAC;AAGF,QAAA,MAAM,WAAW;;EAYf,CAAC;AAGH,QAAA,MAAM,iBAAiB;;EASrB,CAAC;AAGH,OAAO,EACL,MAAM,EACN,UAAU,EACV,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,EACd,CAAC"}
@@ -8,9 +8,9 @@ const Dialog = DialogPrimitive.Root;
8
8
  const DialogTrigger = DialogPrimitive.Trigger;
9
9
  const DialogPortal = DialogPrimitive.Portal;
10
10
  const DialogClose = DialogPrimitive.Close;
11
- const DialogOverlay = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Overlay, { ref: ref, className: cn("stack-scope fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className), ...props })));
11
+ const DialogOverlay = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Overlay, { ref: ref, className: cn("stack-scope fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:fade-in", className), ...props })));
12
12
  DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
13
- const DialogContent = forwardRefIfNeeded(({ className, children, ...props }, ref) => (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { ref: ref, className: cn("stack-scope fixed left-[50%] top-[50%] max-h-screen z-50 flex flex-col w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-background p-6 shadow-lg duration-100 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className), ...props, children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [_jsx(Cross2Icon, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] })] })));
13
+ const DialogContent = forwardRefIfNeeded(({ className, children, overlayProps, ...props }, ref) => (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, { ...overlayProps }), _jsxs(DialogPrimitive.Content, { ref: ref, className: cn("stack-scope fixed left-[50%] top-[50%] max-h-screen z-50 flex flex-col w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-background p-6 shadow-lg duration-100 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className), ...props, children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [_jsx(Cross2Icon, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] })] })));
14
14
  DialogContent.displayName = DialogPrimitive.Content.displayName;
15
15
  const DialogBody = ({ className, ...props }) => (_jsx("div", { className: cn("stack-scope overflow-y-auto flex flex-col gap-4 w-[calc(100%+3rem)] -mx-6 px-6 my-2 py-2", className), ...props }));
16
16
  const DialogHeader = ({ className, ...props }) => (_jsx("div", { className: cn("stack-scope flex flex-col space-y-1.5 text-center sm:text-left", className), ...props }));
@@ -21,4 +21,4 @@ const DialogTitle = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx(D
21
21
  DialogTitle.displayName = DialogPrimitive.Title.displayName;
22
22
  const DialogDescription = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Description, { ref: ref, className: cn("stack-scope text-sm text-muted-foreground", className), ...props })));
23
23
  DialogDescription.displayName = DialogPrimitive.Description.displayName;
24
- export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
24
+ export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackframe/stack-ui",
3
- "version": "2.8.17",
3
+ "version": "2.8.20",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "sideEffects": false,
@@ -76,7 +76,7 @@
76
76
  "react-hook-form": "^7.53.1",
77
77
  "react-resizable-panels": "^2.1.6",
78
78
  "tailwind-merge": "^2.5.4",
79
- "@stackframe/stack-shared": "2.8.17"
79
+ "@stackframe/stack-shared": "2.8.20"
80
80
  },
81
81
  "devDependencies": {
82
82
  "@types/react": "^18.2.12",