@prismicio/editor-ui 0.4.14 → 0.4.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.
@@ -2,5 +2,6 @@ export interface CheckboxProps {
2
2
  checked?: boolean;
3
3
  disabled?: boolean;
4
4
  onCheckedChange?: (checked: boolean) => void;
5
+ tabIndex?: number;
5
6
  }
6
7
  export declare function Checkbox(props: CheckboxProps): JSX.Element;
@@ -4,8 +4,10 @@ export declare const Default: import("@storybook/types").StoryAnnotations<import
4
4
  checked?: boolean | undefined;
5
5
  disabled?: boolean | undefined;
6
6
  onCheckedChange?: ((checked: boolean) => void) | undefined;
7
+ tabIndex?: number | undefined;
7
8
  }, {
8
9
  disabled?: boolean | undefined;
10
+ tabIndex?: number | undefined;
9
11
  checked?: boolean | undefined;
10
12
  onCheckedChange?: ((checked: boolean) => void) | undefined;
11
13
  }>;
@@ -1,4 +1,5 @@
1
1
  export declare const content: string;
2
+ export declare const contentWidth: Record<128 | 256, string>;
2
3
  export declare const contentChild: string;
3
4
  export declare const contentChildColors: {
4
5
  grey: string;
@@ -9,9 +9,10 @@ interface DropdownMenuTriggerProps {
9
9
  children: ReactNode;
10
10
  }
11
11
  export declare function DropdownMenuTrigger(props: DropdownMenuTriggerProps): JSX.Element;
12
- interface DropdownMenuContentProps {
12
+ export interface DropdownMenuContentProps {
13
13
  align?: "center" | "end" | "start";
14
14
  side?: "bottom" | "left" | "right" | "top";
15
+ minWidth?: 128 | 256;
15
16
  children: ReactNode;
16
17
  containerRef?: MutableRefObject<null>;
17
18
  }
@@ -1,6 +1,8 @@
1
- declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("./DropdownMenu").DropdownMenuProps>;
1
+ import { type DropdownMenuContentProps, type DropdownMenuProps } from "./DropdownMenu";
2
+ type Args = DropdownMenuProps & Pick<DropdownMenuContentProps, "minWidth">;
3
+ declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, Args>;
2
4
  export default _default;
3
5
  export declare const Default: {
4
- render: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./DropdownMenu").DropdownMenuProps>;
6
+ render: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, Args>;
5
7
  name: string;
6
8
  };
@@ -8,4 +8,5 @@ export declare const borderRadius: {
8
8
  0: string;
9
9
  4: string;
10
10
  6: string;
11
+ "100%": string;
11
12
  };
@@ -0,0 +1 @@
1
+ export declare const childrenAnimationWrapper: string;
@@ -0,0 +1,9 @@
1
+ import { type ReactNode } from "react";
2
+ import { type Sprinkles } from "../../theme/sprinkles.css";
3
+ interface AnimatedSuspenseProps {
4
+ children: ReactNode;
5
+ fallback?: ReactNode;
6
+ animationDuration?: Sprinkles["animationDuration"];
7
+ }
8
+ export declare function AnimatedSuspense(props: AnimatedSuspenseProps): JSX.Element;
9
+ export {};
@@ -0,0 +1 @@
1
+ export { AnimatedSuspense } from "./AnimatedSuspense";
@@ -1,9 +1,12 @@
1
1
  export declare const root: string;
2
- export declare const table: string;
3
- export declare const head: string;
4
- export declare const body: string;
5
- export declare const row: string;
2
+ export declare const header: string;
6
3
  export declare const bodyRow: string;
7
- export declare const rowClickable: string;
4
+ export declare const disablePointerEvents: string;
5
+ export declare const onClickBodyRow: string;
6
+ export declare const staticBodyRow: string;
7
+ export declare const headerCell: string;
8
+ export declare const bodyCell: string;
8
9
  export declare const cell: string;
9
- export declare const cellContent: string;
10
+ export declare const linkedRowContainer: string;
11
+ export declare const linkElementWrapper: string;
12
+ export declare const link: string;
@@ -1,24 +1,63 @@
1
- import { type MouseEventHandler, type ReactNode } from "react";
1
+ import { type ReactNode } from "react";
2
2
  export interface TableProps {
3
3
  children: ReactNode;
4
+ /** The number and size of columns. See [grid-template-columns](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns). */
5
+ columnLayout: string;
4
6
  }
5
- export declare function Table({ children }: TableProps): JSX.Element;
7
+ /**
8
+ * Outer table component. This should wrap any table header and body in order to
9
+ * set the layout context.
10
+ */
11
+ export declare function Table(props: TableProps): JSX.Element;
6
12
  export interface TableHeadProps {
7
13
  children: ReactNode;
8
14
  }
9
- export declare function TableHead({ children }: TableHeadProps): JSX.Element;
15
+ /**
16
+ * Wrapper for the entire table header. This ensures any rows contained in it have the
17
+ * header row style applied.
18
+ */
19
+ export declare function TableHead(props: TableHeadProps): JSX.Element;
10
20
  export interface TableBodyProps {
11
21
  children: ReactNode;
12
22
  }
13
- export declare function TableBody({ children }: TableBodyProps): JSX.Element;
14
- export interface TableRowProps {
23
+ /**
24
+ * Wrapper for the entire table body and its rows. This ensures any rows contained in
25
+ * it have the body row style applied.
26
+ */
27
+ export declare function TableBody(props: TableBodyProps): JSX.Element;
28
+ export interface ClickableTableRowProps {
15
29
  children: ReactNode;
16
- onClick?: MouseEventHandler<HTMLTableRowElement>;
30
+ /** Callback fired when the row is clicked */
31
+ onClick?: () => void;
32
+ renderLink?: never;
17
33
  }
34
+ export interface LinkTableRowProps {
35
+ children: ReactNode;
36
+ onClick?: never;
37
+ /** Anchor tag wrapper for the row to enable using any routing library such as next Link or react-router. */
38
+ renderLink: ({ children }: {
39
+ children: ReactNode;
40
+ }) => JSX.Element;
41
+ }
42
+ type TableRowProps = ClickableTableRowProps | LinkTableRowProps;
43
+ /**
44
+ * A possibly interactable table row. This component is used in
45
+ * both the header and the table body. The interactivity works in 1 of 3 ways:
46
+ *
47
+ * - Not giving any props other than children: The table acts as a static element which you can't interact with
48
+ * - Given an onClick prop: fires the onClick callback when the row is clicked
49
+ * - Given a renderLink: wraps the **entire** row in the given component. E.g. wrapping it in `react-router-dom` `<Link>`
50
+ */
18
51
  export declare function TableRow(props: TableRowProps): JSX.Element;
19
52
  export interface TableCellProps {
20
53
  children?: ReactNode;
21
54
  /** How to align the content in the cell. Note that undefined defaults to start */
22
55
  align?: "center" | "end";
56
+ /** Whether the content of the cell is interactive, this disables the link properties for that cell. Defaults to `false`. */
57
+ interactive?: boolean;
23
58
  }
59
+ /**
60
+ * Table cells wrap the individual content of the table.
61
+ */
24
62
  export declare function TableCell(props: TableCellProps): JSX.Element;
63
+ export {};
package/dist/index.d.ts CHANGED
@@ -56,6 +56,7 @@ export { Separator } from "./components/Separator";
56
56
  export { Skeleton } from "./components/Skeleton";
57
57
  export { SliceCard, SliceSelectCard } from "./components/Slice";
58
58
  export { Slider } from "./components/Slider";
59
+ export { AnimatedSuspense } from "./components/Suspense";
59
60
  export { Switch } from "./components/Switch";
60
61
  export { Tab } from "./components/Tab";
61
62
  export { Table, TableBody, TableCell, TableHead, TableRow } from "./components/Table";