@stackframe/stack-ui 2.6.16 → 2.6.19

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,29 @@
1
1
  # @stackframe/stack-ui
2
2
 
3
+ ## 2.6.19
4
+
5
+ ### Patch Changes
6
+
7
+ - Bugfixes
8
+ - Updated dependencies
9
+ - @stackframe/stack-shared@2.6.19
10
+
11
+ ## 2.6.18
12
+
13
+ ### Patch Changes
14
+
15
+ - fixed user update bug
16
+ - Updated dependencies
17
+ - @stackframe/stack-shared@2.6.18
18
+
19
+ ## 2.6.17
20
+
21
+ ### Patch Changes
22
+
23
+ - Loading skeletons
24
+ - Updated dependencies
25
+ - @stackframe/stack-shared@2.6.17
26
+
3
27
  ## 2.6.16
4
28
 
5
29
  ### Patch Changes
@@ -22,5 +22,6 @@ export type ActionDialogProps = {
22
22
  }>;
23
23
  confirmText?: string;
24
24
  children?: React.ReactNode;
25
+ preventClose?: boolean;
25
26
  };
26
27
  export declare function ActionDialog(props: ActionDialogProps): import("react/jsx-runtime").JSX.Element;
@@ -25,7 +25,7 @@ export function ActionDialog(props) {
25
25
  setOpenState(open);
26
26
  props.onOpenChange?.(open);
27
27
  };
28
- return (_jsxs(Dialog, { open: open, onOpenChange: onOpenChange, children: [props.trigger && _jsx(DialogTrigger, { asChild: true, children: props.trigger }), _jsxs(DialogContent, { children: [_jsxs(DialogHeader, { children: [_jsxs(DialogTitle, { className: "flex items-center", children: [_jsx(TitleIcon, { className: "h-4 w-4 mr-2" }), title] }), _jsx(DialogDescription, { children: props.description })] }), _jsxs(DialogBody, { className: "pb-2", children: [_jsx("div", { children: props.children }), props.confirmText && _jsx(Alert, { children: _jsxs(Label, { className: "flex gap-4 items-center", children: [_jsx(Checkbox, { id: confirmId, checked: confirmed, onCheckedChange: (v) => setConfirmed(!!v) }), props.confirmText] }) })] }), anyButton && _jsxs(DialogFooter, { className: "gap-2", children: [cancelButton && (_jsx(Button, { variant: "secondary", color: "neutral", onClick: async () => {
28
+ return (_jsxs(Dialog, { open: open, onOpenChange: onOpenChange, children: [props.trigger && _jsx(DialogTrigger, { asChild: true, children: props.trigger }), _jsxs(DialogContent, { onInteractOutside: props.preventClose ? (e) => e.preventDefault() : undefined, className: props.preventClose ? "[&>button]:hidden" : "", children: [_jsxs(DialogHeader, { children: [_jsxs(DialogTitle, { className: "flex items-center", children: [_jsx(TitleIcon, { className: "h-4 w-4 mr-2" }), title] }), _jsx(DialogDescription, { children: props.description })] }), _jsxs(DialogBody, { className: "pb-2", children: [_jsx("div", { children: props.children }), props.confirmText && _jsx(Alert, { children: _jsxs(Label, { className: "flex gap-4 items-center", children: [_jsx(Checkbox, { id: confirmId, checked: confirmed, onCheckedChange: (v) => setConfirmed(!!v) }), props.confirmText] }) })] }), anyButton && _jsxs(DialogFooter, { className: "gap-2", children: [cancelButton && (_jsx(Button, { variant: "secondary", color: "neutral", onClick: async () => {
29
29
  if (await cancelButton.onClick?.() !== "prevent-close") {
30
30
  onOpenChange(false);
31
31
  }
@@ -10,8 +10,10 @@ type DataTableProps<TData, TValue> = {
10
10
  data: TData[];
11
11
  toolbarRender?: (table: TableType<TData>) => React.ReactNode;
12
12
  defaultVisibility?: VisibilityState;
13
+ defaultFilters?: ColumnFiltersState;
14
+ defaultSorting?: SortingState;
13
15
  };
14
- export declare function DataTable<TData, TValue>({ columns, data, toolbarRender, defaultVisibility, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
16
+ export declare function DataTable<TData, TValue>({ columns, data, toolbarRender, defaultVisibility, defaultFilters, defaultSorting, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
15
17
  type DataTableServerProps<TData, TValue> = DataTableProps<TData, TValue> & {
16
18
  sorting?: SortingState;
17
19
  setSorting?: OnChangeFn<SortingState>;
@@ -12,9 +12,9 @@ export function TableView(props) {
12
12
  : flexRender(header.column.columnDef.header, header.getContext()) }, header.id));
13
13
  }) }, headerGroup.id))) }), _jsx(TableBody, { children: props.table.getRowModel().rows.length ? (props.table.getRowModel().rows.map((row) => (_jsx(TableRow, { "data-state": row.getIsSelected() && "selected", children: row.getVisibleCells().map((cell) => (_jsx(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id)))) : (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: props.columns.length, className: "h-24 text-center", children: "No results." }) })) })] }) }), _jsx(DataTablePagination, { table: props.table })] }));
14
14
  }
15
- export function DataTable({ columns, data, toolbarRender, defaultVisibility, }) {
16
- const [sorting, setSorting] = React.useState([]);
17
- const [columnFilters, setColumnFilters] = React.useState([]);
15
+ export function DataTable({ columns, data, toolbarRender, defaultVisibility, defaultFilters, defaultSorting, }) {
16
+ const [sorting, setSorting] = React.useState(defaultSorting || []);
17
+ const [columnFilters, setColumnFilters] = React.useState(defaultFilters || []);
18
18
  const [pagination, setPagination] = React.useState({
19
19
  pageIndex: 0,
20
20
  pageSize: 10,
@@ -1,5 +1,3 @@
1
1
  import React from "react";
2
- declare const Skeleton: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
3
- deactivated?: boolean | undefined;
4
- } & React.RefAttributes<HTMLSpanElement>>;
2
+ declare function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
5
3
  export { Skeleton };
@@ -1,48 +1,7 @@
1
1
  "use client";
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import React from "react";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
4
3
  import { cn } from "../..";
5
- // TODO: add this to the generated global CSS
6
- const styleSheet = `
7
- @keyframes animation-light {
8
- 0% {
9
- filter: grayscale(1) contrast(0) brightness(0) invert(1) brightness(0.8);
4
+ function Skeleton({ className, ...props }) {
5
+ return (_jsx("div", { className: cn("animate-pulse rounded-md bg-primary/10", className), ...props }));
10
6
  }
11
- 100% {
12
- filter: grayscale(1) contrast(0) brightness(0) invert(1) brightness(0.9);
13
- }
14
-
15
- @keyframes animation-dark {
16
- 0% {
17
- filter: grayscale(1) contrast(0) brightness(0) invert(1) brightness(0.2);
18
- }
19
- 100% {
20
- filter: grayscale(1) contrast(0) brightness(0) invert(1) brightness(0.1);
21
- }
22
-
23
- .stack-skeleton[data-stack-state="activated"],
24
- .stack-skeleton[data-stack-state="activated"] * {
25
- pointer-events: none !important;
26
- -webkit-user-select: none !important;
27
- -moz-user-select: none !important;
28
- user-select: none !important;
29
- cursor: default !important;
30
- }
31
-
32
- .stack-skeleton[data-stack-state="activated"] {
33
- animation: animation-light 1s infinite alternate-reverse !important;
34
- }
35
-
36
- html[data-stack-theme='dark'] .stack-skeleton[data-stack-state="activated"] {
37
- animation: animation-dark 1s infinite alternate-reverse !important;
38
- }
39
-
40
- html[data-stack-theme='dark'] .stack-skeleton[data-stack-state="activated"] {
41
- animation: animation-dark 1s infinite alternate-reverse !important;
42
- }
43
- `;
44
- const Skeleton = React.forwardRef((props, ref) => {
45
- return (_jsxs(_Fragment, { children: [_jsx("style", { children: styleSheet }), _jsx("span", { ...props, ref: ref, "data-stack-state": props.deactivated ? "deactivated" : "activated", className: cn(props.className, "stack-skeleton") })] }));
46
- });
47
- Skeleton.displayName = "Skeleton";
48
7
  export { Skeleton };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackframe/stack-ui",
3
- "version": "2.6.16",
3
+ "version": "2.6.19",
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.16"
71
+ "@stackframe/stack-shared": "2.6.19"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@types/react": "^18.2.66",