@prismicio/editor-ui 0.4.58 → 0.4.59-alpha.fix-prevent-onclick-on-tablerow.1
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/dist/components/Alert/Alert.d.ts +4 -0
- package/dist/components/Alert/Alert.stories.d.ts +1 -0
- package/dist/components/Banner/Banner.d.ts +18 -0
- package/dist/components/Banner/Banner.stories.d.ts +19 -0
- package/dist/components/Banner/index.d.ts +1 -0
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.stories.d.ts +1 -1
- package/dist/components/Card/Card.d.ts +6 -3
- package/dist/components/Card/Card.stories.d.ts +5 -2
- package/dist/components/Dialog/Dialog.d.ts +56 -3
- package/dist/components/Dialog/index.d.ts +1 -1
- package/dist/components/HairlineButton/HairlineButton.d.ts +8 -0
- package/dist/components/HairlineButton/HairlineButton.stories.d.ts +4 -0
- package/dist/components/IconButton/IconButton.d.ts +2 -0
- package/dist/components/List/UnorderedList.d.ts +6 -0
- package/dist/components/List/UnorderedList.stories.d.ts +4 -12
- package/dist/components/List/index.d.ts +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts +1 -1
- package/dist/components/Text/Text.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +1 -0
- package/dist/index.cjs.js +167 -167
- package/dist/index.d.ts +3 -2
- package/dist/index.es.js +10928 -10710
- package/dist/style.css +1 -1
- package/dist/theme/sx.d.ts +1 -1
- package/package.json +1 -1
|
@@ -14,6 +14,7 @@ export type AlertProps = {
|
|
|
14
14
|
color?: Colors;
|
|
15
15
|
footerButtons?: FooterButtons;
|
|
16
16
|
noShadow?: boolean;
|
|
17
|
+
align?: "center";
|
|
17
18
|
};
|
|
18
19
|
type RightButton = {
|
|
19
20
|
onClick: () => void;
|
|
@@ -22,6 +23,9 @@ type RightButton = {
|
|
|
22
23
|
} | {
|
|
23
24
|
type: "text";
|
|
24
25
|
title: string;
|
|
26
|
+
} | {
|
|
27
|
+
type: "text-dimmed";
|
|
28
|
+
title: string;
|
|
25
29
|
});
|
|
26
30
|
export interface FooterButtons {
|
|
27
31
|
/** Dismiss button in the footer, displayed first */
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type PropsWithChildren, type ReactNode } from "react";
|
|
2
|
+
import type { IconName } from "../Icon";
|
|
3
|
+
type Color = "error" | "warn" | "info";
|
|
4
|
+
export interface BannerProps {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
color?: Color;
|
|
7
|
+
iconName?: IconName;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function Banner(props: BannerProps): JSX.Element;
|
|
11
|
+
export declare function BannerTitle(props: PropsWithChildren): JSX.Element;
|
|
12
|
+
export declare function BannerDescription(props: PropsWithChildren): JSX.Element;
|
|
13
|
+
export interface BannerButtonProps {
|
|
14
|
+
children: string;
|
|
15
|
+
onClick: () => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function BannerButton(props: BannerButtonProps): JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/react";
|
|
2
|
+
import { Banner } from "./Banner";
|
|
3
|
+
type Story = StoryObj<typeof meta>;
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: typeof Banner;
|
|
7
|
+
argTypes: {
|
|
8
|
+
color: {
|
|
9
|
+
control: string;
|
|
10
|
+
options: string[];
|
|
11
|
+
};
|
|
12
|
+
iconName: {
|
|
13
|
+
control: string;
|
|
14
|
+
options: readonly ["add", "alert", "arrowBack", "arrowDownward", "arrowDropDown", "arrowDropDownCircle", "arrowForward", "arrowUpward", "attachFile", "autoFixHigh", "autorenew", "biToggle", "block", "calendarToday", "centerFocusWeak", "check", "checkBox", "checkBoxOutlinedBlank", "chevronLeft", "chevronRight", "close", "cloud", "cloudUpload", "code", "colorLens", "contentCopy", "contentPaste", "createNewFolder", "creditCard", "crop", "cropLandscape", "cropPortrait", "dataObject", "dataUsage", "database", "dateRange", "delete", "description", "desktopWindows", "dragIndicator", "driveFileMove", "edit", "event", "expandLess", "expandMore", "firstPage", "folder", "folderManaged", "formatBold", "formatClear", "formatItalic", "formatListBulleted", "formatListNumbered", "formatTextDirectionRToL", "groupWork", "hideImage", "image", "imageSearch", "insertDriveFile", "inventory", "invite", "javascript", "json", "keyboardArrowDown", "keyboardArrowUp", "label", "language", "link", "linkOff", "lock", "looks1", "looks2", "looks3", "looks4", "looks5", "looks6", "menuBook", "migrationRelease", "moreVert", "multipleStop", "musicNote", "notStarted", "notes", "openInFull", "openInNew", "outbound", "people", "phoneIphone", "photo", "pin", "place", "playCircle", "preview", "prismic", "public", "receiptLong", "refresh", "save", "schedule", "search", "security", "sentimentSatisfied", "settings", "settingsEthernet", "smartDisplay", "svelte", "tabletMac", "tag", "terminal", "textFields", "title", "toggleOff", "translate", "tune", "typescript", "unfoldMore", "unsplash", "upload", "videocam", "viewDay", "visibility", "vue", "warning", "zoomOutMap"];
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default meta;
|
|
19
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Banner, BannerButton, type BannerButtonProps, BannerDescription, type BannerProps, BannerTitle, } from "./Banner";
|
|
@@ -11,7 +11,7 @@ export interface ButtonProps {
|
|
|
11
11
|
*/
|
|
12
12
|
asChild?: boolean;
|
|
13
13
|
/** Note that black & white are only supported for the invisible button */
|
|
14
|
-
color?: "black" | "grey" | "darkGrey" | "purple" | "dark" | "tomato" | "amber" | "green" | "white" | "indigo";
|
|
14
|
+
color?: "black" | "grey" | "darkGrey" | "purple" | "dark" | "tomato" | "tomato-dimmed" | "amber" | "green" | "white" | "indigo";
|
|
15
15
|
size?: "small" | "medium" | "large";
|
|
16
16
|
disabled?: boolean;
|
|
17
17
|
loading?: boolean;
|
|
@@ -17,7 +17,7 @@ export declare const Default: {
|
|
|
17
17
|
render: (args: {
|
|
18
18
|
children?: import("react").ReactNode;
|
|
19
19
|
asChild?: boolean | undefined;
|
|
20
|
-
color?: "dark" | "white" | "black" | "green" | "grey" | "indigo" | "purple" | "tomato" | "darkGrey" | "amber" | undefined;
|
|
20
|
+
color?: "dark" | "white" | "black" | "green" | "grey" | "indigo" | "purple" | "tomato" | "darkGrey" | "tomato-dimmed" | "amber" | undefined;
|
|
21
21
|
size?: "small" | "medium" | "large" | undefined;
|
|
22
22
|
disabled?: boolean | undefined;
|
|
23
23
|
loading?: boolean | undefined;
|
|
@@ -7,8 +7,11 @@ export interface CardProps {
|
|
|
7
7
|
color?: "grey1" | "grey2" | "grey3" | "indigo2" | "purple1" | "purple2" | "tomato2";
|
|
8
8
|
variant?: "animated-light" | "animated-dark" | "dashed" | "elevated" | "highlighted" | "outlined" | "selected";
|
|
9
9
|
radius?: 4 | 6;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
gap?: 0 | 8 | 12 | 16 | 28 | 32;
|
|
11
|
+
paddingBlock?: 0 | 8 | 12 | 16 | 28 | 32;
|
|
12
|
+
paddingInline?: 0 | 8 | 16 | 24 | 32;
|
|
13
|
+
paddingLeft?: 0 | 16 | 32;
|
|
14
|
+
paddingRight?: 0 | 16 | 32;
|
|
12
15
|
padding?: 0 | 12 | 16;
|
|
13
16
|
sx?: SX;
|
|
14
17
|
onSelect?: (event: MouseEvent | KeyboardEvent) => void;
|
|
@@ -34,7 +37,7 @@ export declare function CardHeaderActions(props: CardHeaderActionsProps): JSX.El
|
|
|
34
37
|
interface CardContentProps {
|
|
35
38
|
children?: ReactNode;
|
|
36
39
|
sx?: SX;
|
|
37
|
-
gap?: ThemeKeys<"space", 0 | 8 | 12>;
|
|
40
|
+
gap?: ThemeKeys<"space", 0 | 4 | 8 | 12 | 16>;
|
|
38
41
|
padding?: 0 | 32;
|
|
39
42
|
}
|
|
40
43
|
export declare function CardContent(props: CardContentProps): JSX.Element;
|
|
@@ -35,8 +35,11 @@ export declare const Default: {
|
|
|
35
35
|
color?: "grey1" | "grey2" | "grey3" | "indigo2" | "tomato2" | "purple1" | "purple2" | undefined;
|
|
36
36
|
variant?: "dashed" | "selected" | "animated-light" | "animated-dark" | "elevated" | "highlighted" | "outlined" | undefined;
|
|
37
37
|
radius?: 4 | 6 | undefined;
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
gap?: 0 | 8 | 12 | 16 | 28 | 32 | undefined;
|
|
39
|
+
paddingBlock?: 0 | 8 | 12 | 16 | 28 | 32 | undefined;
|
|
40
|
+
paddingInline?: 0 | 8 | 16 | 24 | 32 | undefined;
|
|
41
|
+
paddingLeft?: 0 | 16 | 32 | undefined;
|
|
42
|
+
paddingRight?: 0 | 16 | 32 | undefined;
|
|
40
43
|
padding?: 0 | 12 | 16 | undefined;
|
|
41
44
|
sx?: import("../../theme").SX | undefined;
|
|
42
45
|
onSelect?: ((event: import("react").MouseEvent<Element, MouseEvent> | import("react").KeyboardEvent<Element>) => void) | undefined;
|
|
@@ -7,7 +7,7 @@ export interface Custom {
|
|
|
7
7
|
width: number | string;
|
|
8
8
|
height: number | string;
|
|
9
9
|
}
|
|
10
|
-
export
|
|
10
|
+
export type DialogProps = {
|
|
11
11
|
modal?: boolean;
|
|
12
12
|
trigger?: ReactNode;
|
|
13
13
|
children?: ReactNode;
|
|
@@ -16,7 +16,6 @@ export interface DialogProps {
|
|
|
16
16
|
onOpenChange?: (open: boolean) => void;
|
|
17
17
|
onAnimationEnd?: () => void;
|
|
18
18
|
onAnimationStart?: () => void;
|
|
19
|
-
hasClose?: boolean;
|
|
20
19
|
size?: "small" | "large" | "fullscreen" | Custom;
|
|
21
20
|
/**
|
|
22
21
|
* The position of the dialog in the viewport.
|
|
@@ -26,7 +25,23 @@ export interface DialogProps {
|
|
|
26
25
|
position?: "center" | "bottomRight" | "top";
|
|
27
26
|
onPointerDownOutside?: RadixDialogContentProps["onPointerDownOutside"];
|
|
28
27
|
onOpenAutoFocus?: RadixDialogContentProps["onOpenAutoFocus"];
|
|
29
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Pass this prop if the modal has no static text that describes it, i.e. if it's a form or a table.
|
|
30
|
+
* Passing true will disable the warning that the dialog has no description.
|
|
31
|
+
* If the dialog has some meaningful text description, wrap this text in a DialogDescription component and do not pass this prop.
|
|
32
|
+
* Sources:
|
|
33
|
+
* - https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/dialog/
|
|
34
|
+
* - https://www.radix-ui.com/primitives/docs/components/dialog#description
|
|
35
|
+
*/
|
|
36
|
+
noDescription?: true;
|
|
37
|
+
} & CloseButtonProps;
|
|
38
|
+
type CloseButtonProps = {
|
|
39
|
+
hasClose?: true;
|
|
40
|
+
closeButtonDisabled?: boolean;
|
|
41
|
+
} | {
|
|
42
|
+
hasClose?: false;
|
|
43
|
+
closeButtonDisabled?: never;
|
|
44
|
+
};
|
|
30
45
|
/**
|
|
31
46
|
* A Dialog rendered in document.body.
|
|
32
47
|
* The first focusable child will automatically be focused.
|
|
@@ -35,9 +50,47 @@ export declare function Dialog(props: DialogProps): JSX.Element;
|
|
|
35
50
|
interface DialogHeaderProps {
|
|
36
51
|
icon?: IconName;
|
|
37
52
|
onIconClick?: () => void;
|
|
53
|
+
/**
|
|
54
|
+
* If true, the Icon will have the same padding as the IconButton.
|
|
55
|
+
* This is useful when transitioning between headers with Icon and IconButton,
|
|
56
|
+
* to make sure there's no horizontal shift in the header.
|
|
57
|
+
*/
|
|
58
|
+
iconButtonPadding?: boolean;
|
|
38
59
|
title: string;
|
|
39
60
|
}
|
|
40
61
|
export declare function DialogHeader(props: DialogHeaderProps): JSX.Element;
|
|
62
|
+
interface DialogTitleProps {
|
|
63
|
+
children: ReactNode;
|
|
64
|
+
/**
|
|
65
|
+
* If true, will hide the title visually but keep it accessible for screen readers.
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
68
|
+
hidden?: boolean;
|
|
69
|
+
asChild?: boolean;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* DialogTitle is supposed to be placed inside of our Dialog.
|
|
73
|
+
* It is required to have either this component or DialogHeader inside of each Dialog,
|
|
74
|
+
* at least for screen readers only (see `hidden` prop).
|
|
75
|
+
*/
|
|
76
|
+
export declare function DialogTitle(props: DialogTitleProps): JSX.Element;
|
|
77
|
+
interface DialogDescriptionProps {
|
|
78
|
+
children: ReactNode;
|
|
79
|
+
/**
|
|
80
|
+
* If true, will hide the description visually but keep it accessible for screen readers.
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
hidden?: boolean;
|
|
84
|
+
asChild?: boolean;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* DialogDescription is supposed to be placed inside of our Dialog.
|
|
88
|
+
* It is required to use this component if the modal has some static text
|
|
89
|
+
* or pass `noDescription` flag to our Dialog if there's no proper description
|
|
90
|
+
* inside of a dialog, i.e. when it's a form or contains only a table.
|
|
91
|
+
* You can also pass `hidden` prop to hide the description visually.
|
|
92
|
+
*/
|
|
93
|
+
export declare function DialogDescription(props: DialogDescriptionProps): JSX.Element;
|
|
41
94
|
interface DialogContentProps {
|
|
42
95
|
children: ReactNode;
|
|
43
96
|
padding?: 16;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Dialog, DialogActionButton, DialogActionLink, DialogActions, DialogCancelButton, DialogContent, DialogHeader, type DialogProps, } from "./Dialog";
|
|
1
|
+
export { Dialog, DialogActionButton, DialogActionLink, DialogActions, DialogCancelButton, DialogContent, DialogDescription, DialogHeader, type DialogProps, DialogTitle, } from "./Dialog";
|
|
2
2
|
export { DialogOptions, DialogOptionsItem } from "./Options/DialogOptions";
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { type MouseEvent } from "react";
|
|
2
2
|
import type { SX } from "../../theme";
|
|
3
3
|
import { type IconName } from "../Icon";
|
|
4
|
+
import type { TooltipProps } from "../Tooltip/Tooltip";
|
|
5
|
+
type Variant = "centerSolid" | "rightDashed";
|
|
4
6
|
export interface HairlineButtonProps {
|
|
5
7
|
icon: IconName;
|
|
6
8
|
disabled?: boolean;
|
|
7
9
|
dropMode?: boolean;
|
|
8
10
|
sx?: SX;
|
|
9
11
|
onClick?: (event: MouseEvent) => void;
|
|
12
|
+
variant?: Variant;
|
|
13
|
+
tooltip?: {
|
|
14
|
+
content: string;
|
|
15
|
+
side?: TooltipProps["side"];
|
|
16
|
+
};
|
|
10
17
|
}
|
|
11
18
|
export declare const HairlineButton: (props: HairlineButtonProps & import("react").RefAttributes<HTMLButtonElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
|
19
|
+
export {};
|
|
@@ -5,6 +5,10 @@ export declare const Default: {
|
|
|
5
5
|
render: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./HairlineButton").HairlineButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
6
|
args: {
|
|
7
7
|
icon: string;
|
|
8
|
+
tooltip: {
|
|
9
|
+
content: string;
|
|
10
|
+
side: string;
|
|
11
|
+
};
|
|
8
12
|
dropMode: boolean;
|
|
9
13
|
disabled: boolean;
|
|
10
14
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type MouseEvent } from "react";
|
|
2
2
|
import type { Keys } from "react-hotkeys-hook";
|
|
3
|
+
import type { SX } from "../../theme";
|
|
3
4
|
import type { IconName } from "../Icon/iconNames";
|
|
4
5
|
export interface IconButtonProps {
|
|
5
6
|
color?: Color;
|
|
@@ -10,6 +11,7 @@ export interface IconButtonProps {
|
|
|
10
11
|
hotkeys?: Keys;
|
|
11
12
|
radius?: "normal" | "full";
|
|
12
13
|
size?: "small" | "medium" | "large";
|
|
14
|
+
sx?: SX;
|
|
13
15
|
variant?: "solid" | "ghost";
|
|
14
16
|
disabled?: boolean;
|
|
15
17
|
type?: "button";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import type { SX } from "../../theme";
|
|
3
|
+
import { type IconName } from "../Icon";
|
|
3
4
|
export interface UnorderedListProps {
|
|
4
5
|
children?: ReactNode;
|
|
5
6
|
density?: "regular" | "compact";
|
|
@@ -10,3 +11,8 @@ export interface ListItemProps {
|
|
|
10
11
|
children?: ReactNode;
|
|
11
12
|
}
|
|
12
13
|
export declare function ListItem(props: ListItemProps): JSX.Element;
|
|
14
|
+
interface IconListItemProps extends ListItemProps {
|
|
15
|
+
icon?: IconName;
|
|
16
|
+
}
|
|
17
|
+
export declare function IconListItem(props: IconListItemProps): JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import type { StoryObj } from "@storybook/react";
|
|
2
2
|
import { UnorderedList } from "./UnorderedList";
|
|
3
|
+
type Story = StoryObj<typeof meta>;
|
|
3
4
|
declare const meta: {
|
|
4
5
|
title: string;
|
|
5
6
|
component: typeof UnorderedList;
|
|
@@ -12,14 +13,5 @@ declare const meta: {
|
|
|
12
13
|
};
|
|
13
14
|
};
|
|
14
15
|
export default meta;
|
|
15
|
-
export declare const
|
|
16
|
-
|
|
17
|
-
render: (args: {
|
|
18
|
-
children?: import("react").ReactNode;
|
|
19
|
-
density?: "compact" | "regular" | undefined;
|
|
20
|
-
sx?: import("../../theme").SX | undefined;
|
|
21
|
-
}) => JSX.Element;
|
|
22
|
-
args: {
|
|
23
|
-
children: JSX.Element;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
16
|
+
export declare const ListItems: Story;
|
|
17
|
+
export declare const IconListItems: Story;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ListItem, UnorderedList } from "./UnorderedList";
|
|
1
|
+
export { IconListItem, ListItem, UnorderedList } from "./UnorderedList";
|
|
@@ -27,7 +27,7 @@ export declare function Skeleton(props: Props): import("react").DetailedReactHTM
|
|
|
27
27
|
width: string | number | undefined;
|
|
28
28
|
height: string | number | undefined;
|
|
29
29
|
zIndex: -1 | undefined;
|
|
30
|
-
flexGrow?: 1 | undefined;
|
|
30
|
+
flexGrow?: 0 | 1 | undefined;
|
|
31
31
|
flexShrink?: 0 | undefined;
|
|
32
32
|
flexBasis?: 0 | undefined;
|
|
33
33
|
flexWrap?: "wrap" | undefined;
|
|
@@ -47,7 +47,7 @@ interface NonLinkProps extends BaseTextProps {
|
|
|
47
47
|
}
|
|
48
48
|
export type TextProps = NonLinkProps | LinkProps;
|
|
49
49
|
export declare const Text: (props: TextProps & import("react").RefAttributes<HTMLElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
|
50
|
-
type Component = "code" | "h1" | "h2" | "h3" | "h4" | "h5" | "kbd" | "p" | "pre" | "span" | "label" | "a";
|
|
50
|
+
type Component = "code" | "h1" | "h2" | "h3" | "h4" | "h5" | "header" | "kbd" | "p" | "pre" | "span" | "label" | "a";
|
|
51
51
|
export declare const textVariantMapping: {
|
|
52
52
|
readonly normal: "p";
|
|
53
53
|
readonly bold: "p";
|