@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.
@@ -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 declare function Alert({ title, subtitle, footerButtons, onClose }: Props): JSX.Element;
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 { IconName } from "../Icon";
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;
@@ -42,6 +42,7 @@ type ActionsProps = {
42
42
  cancel?: {
43
43
  text: string;
44
44
  };
45
+ link?: ReactNode;
45
46
  /**
46
47
  * If true, the actions will be rendered in the dialog grid area `footer`.
47
48
  */
@@ -1,8 +1,4 @@
1
- export declare const input: {
2
- small: string;
3
- medium: string;
4
- large: string;
5
- };
1
+ export declare const input: string;
6
2
  export declare const inputPadding: {
7
3
  normal: string;
8
4
  withIcon: 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,5 +1 @@
1
- interface Props {
2
- pulse?: boolean;
3
- }
4
- export declare const PrismicLogo: import("react").MemoExoticComponent<({ pulse }: Props) => JSX.Element>;
5
- export {};
1
+ export declare const PrismicLogo: import("react").MemoExoticComponent<() => JSX.Element>;
@@ -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
- declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("./Select").SelectProps<string>>;
2
- export default _default;
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: boolean;
63
+ disabled: false;
7
64
  placeholder: string;
8
- size: string;
9
- variant: string;
65
+ size: "medium";
10
66
  };
11
67
  name: string;
12
68
  };
@@ -1,8 +1,7 @@
1
1
  import type { SX } from "../../theme/new";
2
- import * as styles from "./Switch.css";
3
2
  export interface SwitchProps {
4
3
  id?: string;
5
- size?: keyof typeof styles.size;
4
+ size?: "small" | "medium";
6
5
  disabled?: boolean;
7
6
  checked?: boolean;
8
7
  sx?: SX;
@@ -1,10 +1,28 @@
1
- declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("./Switch").SwitchProps>;
2
- export default _default;
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: boolean;
6
- disabled: boolean;
7
- size: string;
23
+ checked: false;
24
+ disabled: false;
25
+ size: "medium";
8
26
  };
9
27
  name: string;
10
28
  };
@@ -3,6 +3,6 @@ export declare const underline: string;
3
3
  export declare const inline: string;
4
4
  export declare const hoverColor: {
5
5
  readonly indigo11: "indigo10";
6
- readonly grey11: "grey10";
6
+ readonly purple11: "purple10";
7
7
  readonly tomato11: "tomato10";
8
8
  };
@@ -2,9 +2,8 @@ export interface TextLinkProps {
2
2
  href: string;
3
3
  children: string;
4
4
  underline?: boolean;
5
- color?: "grey11" | "indigo11" | "tomato11";
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.