@prismicio/editor-ui 0.4.22 → 0.4.23
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 +19 -2
- package/dist/components/Alert/Alert.stories.d.ts +4 -2
- package/dist/components/Alert/AlertContext.d.ts +2 -6
- package/dist/components/Alert/index.d.ts +1 -1
- package/dist/components/BaseInput/BaseInput.d.ts +3 -0
- package/dist/components/Dialog/Dialog.d.ts +1 -0
- package/dist/components/Form/FormInput.css.d.ts +1 -5
- package/dist/components/Form/FormInput.d.ts +0 -2
- package/dist/components/Icon/PrismicLogo.d.ts +1 -5
- package/dist/components/SearchInput/SearchInput.d.ts +2 -0
- package/dist/components/Select/Select.stories.d.ts +61 -5
- package/dist/components/Switch/Switch.d.ts +1 -2
- package/dist/components/Switch/Switch.stories.d.ts +23 -5
- package/dist/components/TextLink/TextLink.css.d.ts +1 -1
- package/dist/components/TextLink/TextLink.d.ts +1 -2
- package/dist/index.cjs.js +115 -115
- package/dist/index.es.js +6181 -6182
- package/dist/style.css +1 -1
- package/dist/theme/new/theme.d.ts +2 -1
- package/package.json +4 -4
- package/dist/components/Calendar/Calendar.css.d.ts +0 -2
- package/dist/components/Calendar/CalendarCell.css.d.ts +0 -7
- package/dist/components/Calendar/CalendarGrid.css.d.ts +0 -1
- package/dist/components/Gradient/Gradient.css.d.ts +0 -1
- package/dist/components/Icon/PrismicLogo.css.d.ts +0 -1
- package/dist/components/Switch/Switch.css.d.ts +0 -3
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
+
import { type IconName } from "../Icon";
|
|
3
|
+
type Colors = "error" | "default";
|
|
2
4
|
type Props = {
|
|
3
5
|
title: string;
|
|
4
6
|
subtitle?: ReactNode;
|
|
5
|
-
footerButtons?: ReactNode;
|
|
6
7
|
onClose?: () => void;
|
|
8
|
+
color?: Colors;
|
|
9
|
+
footerButtons?: FooterButtons;
|
|
7
10
|
};
|
|
8
|
-
export
|
|
11
|
+
export interface FooterButtons {
|
|
12
|
+
/** Dismiss button in the footer, displayed first */
|
|
13
|
+
dismiss?: {
|
|
14
|
+
text: string;
|
|
15
|
+
onClick?: () => void;
|
|
16
|
+
};
|
|
17
|
+
/** Main action button in the footer, displayed second */
|
|
18
|
+
action?: {
|
|
19
|
+
text: string;
|
|
20
|
+
onClick: () => void;
|
|
21
|
+
/** Icon displayed on the right of the button, defaults to arrowForward */
|
|
22
|
+
icon?: IconName;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare function Alert(props: Props): JSX.Element;
|
|
9
26
|
export {};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, {
|
|
2
2
|
title: string;
|
|
3
3
|
subtitle?: import("react").ReactNode;
|
|
4
|
-
footerButtons?: import("react").ReactNode;
|
|
5
4
|
onClose?: (() => void) | undefined;
|
|
5
|
+
color?: ("default" | "error") | undefined;
|
|
6
|
+
footerButtons?: import("./Alert").FooterButtons | undefined;
|
|
6
7
|
}>;
|
|
7
8
|
export default _default;
|
|
8
9
|
export declare const Default: {
|
|
9
10
|
render: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
|
|
10
11
|
title: string;
|
|
11
12
|
subtitle?: import("react").ReactNode;
|
|
12
|
-
footerButtons?: import("react").ReactNode;
|
|
13
13
|
onClose?: (() => void) | undefined;
|
|
14
|
+
color?: ("default" | "error") | undefined;
|
|
15
|
+
footerButtons?: import("./Alert").FooterButtons | undefined;
|
|
14
16
|
}>;
|
|
15
17
|
args: {
|
|
16
18
|
title: string;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { type ReactNode, type RefObject } from "react";
|
|
2
|
-
import type
|
|
2
|
+
import { type FooterButtons } from ".";
|
|
3
3
|
export interface AlertConfig {
|
|
4
4
|
id?: string;
|
|
5
5
|
title: string;
|
|
6
6
|
subtitle: ReactNode;
|
|
7
|
-
buttons?:
|
|
8
|
-
text: string;
|
|
9
|
-
onClick: () => void;
|
|
10
|
-
icon?: IconName;
|
|
11
|
-
}[];
|
|
7
|
+
buttons?: FooterButtons;
|
|
12
8
|
onRetry?: () => void;
|
|
13
9
|
}
|
|
14
10
|
interface AlertContext {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Alert } from "./Alert";
|
|
1
|
+
export { Alert, type FooterButtons } from "./Alert";
|
|
2
2
|
export { type AlertConfig, AlertProvider, useAlert } from "./AlertContext";
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { type KeyboardEvent, type ReactNode } from "react";
|
|
2
2
|
import type { SX, ThemeKeys } from "../../theme/new";
|
|
3
|
+
/**
|
|
4
|
+
* Flexible base Input, provided with no height or block padding.
|
|
5
|
+
*/
|
|
3
6
|
export interface BaseInputProps {
|
|
4
7
|
autoComplete?: string;
|
|
5
8
|
id?: string;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type ClipboardEventHandler, type KeyboardEventHandler } from "react";
|
|
2
2
|
import type { SX } from "../../theme/new";
|
|
3
3
|
import { type IconName } from "../Icon";
|
|
4
|
-
import * as styles from "./FormInput.css";
|
|
5
4
|
export interface FormInputProps {
|
|
6
5
|
type?: "text" | "email" | "password";
|
|
7
6
|
disabled?: boolean;
|
|
@@ -9,7 +8,6 @@ export interface FormInputProps {
|
|
|
9
8
|
placeholder?: string;
|
|
10
9
|
value: string;
|
|
11
10
|
error?: boolean;
|
|
12
|
-
size?: keyof typeof styles.input;
|
|
13
11
|
icon?: IconName;
|
|
14
12
|
autoComplete?: AutoCompleteValue;
|
|
15
13
|
sx?: SX;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import type { SX } from "../../theme/new";
|
|
1
2
|
export interface SearchInputProps {
|
|
2
3
|
value: string;
|
|
3
4
|
placeholder?: string;
|
|
4
5
|
maxLength?: number;
|
|
5
6
|
isLoading?: boolean;
|
|
7
|
+
sx?: SX;
|
|
6
8
|
onValueChange: (value: string) => void;
|
|
7
9
|
}
|
|
8
10
|
export declare function SearchInput(props: SearchInputProps): JSX.Element;
|
|
@@ -1,12 +1,68 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { Select } from "./Select";
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: typeof Select;
|
|
5
|
+
argTypes: {
|
|
6
|
+
autoComplete: {
|
|
7
|
+
control: {
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
children: {
|
|
12
|
+
control: {
|
|
13
|
+
disable: boolean;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
id: {
|
|
17
|
+
control: {
|
|
18
|
+
type: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
name: {
|
|
22
|
+
control: {
|
|
23
|
+
type: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
onValueChange: {};
|
|
27
|
+
value: {};
|
|
28
|
+
size: {
|
|
29
|
+
control: {
|
|
30
|
+
type: string;
|
|
31
|
+
};
|
|
32
|
+
options: string[];
|
|
33
|
+
};
|
|
34
|
+
color: {
|
|
35
|
+
control: {
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
options: string[];
|
|
39
|
+
};
|
|
40
|
+
constrainContentWidth: {
|
|
41
|
+
control: {
|
|
42
|
+
type: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
side: {
|
|
46
|
+
control: {
|
|
47
|
+
type: string;
|
|
48
|
+
};
|
|
49
|
+
options: string[];
|
|
50
|
+
};
|
|
51
|
+
sideOffset: {
|
|
52
|
+
control: {
|
|
53
|
+
type: string;
|
|
54
|
+
step: number;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export default meta;
|
|
3
60
|
export declare const Default: {
|
|
4
61
|
args: {
|
|
5
62
|
children: JSX.Element;
|
|
6
|
-
disabled:
|
|
63
|
+
disabled: false;
|
|
7
64
|
placeholder: string;
|
|
8
|
-
size:
|
|
9
|
-
variant: string;
|
|
65
|
+
size: "medium";
|
|
10
66
|
};
|
|
11
67
|
name: string;
|
|
12
68
|
};
|
|
@@ -1,10 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { Switch } from "./Switch";
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: typeof Switch;
|
|
5
|
+
argTypes: {
|
|
6
|
+
id: {
|
|
7
|
+
control: {
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
size: {
|
|
12
|
+
control: {
|
|
13
|
+
type: string;
|
|
14
|
+
};
|
|
15
|
+
options: string[];
|
|
16
|
+
};
|
|
17
|
+
onCheckedChange: {};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default meta;
|
|
3
21
|
export declare const Default: {
|
|
4
22
|
args: {
|
|
5
|
-
checked:
|
|
6
|
-
disabled:
|
|
7
|
-
size:
|
|
23
|
+
checked: false;
|
|
24
|
+
disabled: false;
|
|
25
|
+
size: "medium";
|
|
8
26
|
};
|
|
9
27
|
name: string;
|
|
10
28
|
};
|
|
@@ -2,9 +2,8 @@ export interface TextLinkProps {
|
|
|
2
2
|
href: string;
|
|
3
3
|
children: string;
|
|
4
4
|
underline?: boolean;
|
|
5
|
-
color?: "
|
|
5
|
+
color?: "indigo11" | "purple11" | "tomato11";
|
|
6
6
|
inline?: boolean;
|
|
7
|
-
onClick?: () => void;
|
|
8
7
|
}
|
|
9
8
|
/**
|
|
10
9
|
* A basic link with a single line of text.
|