@harpercollins/harpercollins-design-system 1.8.45 → 1.8.48

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.
Files changed (44) hide show
  1. package/dist/cjs/index.cjs +226 -339
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/cjs/types/src/components/data-display/TextBlock/TextBlock.d.ts +9 -0
  4. package/dist/cjs/types/src/components/data-display/{TextField/TextField.stories.d.ts → TextBlock/TextBlock.stories.d.ts} +3 -3
  5. package/dist/cjs/types/src/components/data-display/TextBlock/index.d.ts +2 -0
  6. package/dist/cjs/types/src/components/index.d.ts +4 -3
  7. package/dist/cjs/types/src/components/inputs/Autocomplete/Autocomplete.d.ts +5 -4
  8. package/dist/cjs/types/src/components/inputs/Autocomplete/Autocomplete.stories.d.ts +3 -3
  9. package/dist/cjs/types/src/components/inputs/Autocomplete/AutocompleteSelectMultiple/AutocompleteSelectMultiple.d.ts +1 -8
  10. package/dist/cjs/types/src/components/inputs/Autocomplete/types.d.ts +10 -0
  11. package/dist/cjs/types/src/components/inputs/Input/Input.d.ts +15 -0
  12. package/dist/cjs/types/src/components/inputs/Input/Input.stories.d.ts +6 -0
  13. package/dist/cjs/types/src/components/inputs/Input/index.d.ts +2 -0
  14. package/dist/cjs/types/src/components/overlay/{Modal/Modal.d.ts → Drawer/Drawer.d.ts} +5 -2
  15. package/dist/cjs/types/src/components/overlay/{Modal/Modal.stories.d.ts → Drawer/Drawer.stories.d.ts} +3 -4
  16. package/dist/cjs/types/src/components/overlay/Drawer/index.d.ts +2 -0
  17. package/dist/esm/index.js +227 -340
  18. package/dist/esm/index.js.map +1 -1
  19. package/dist/esm/types/src/components/data-display/TextBlock/TextBlock.d.ts +9 -0
  20. package/dist/esm/types/src/components/data-display/{TextField/TextField.stories.d.ts → TextBlock/TextBlock.stories.d.ts} +3 -3
  21. package/dist/esm/types/src/components/data-display/TextBlock/index.d.ts +2 -0
  22. package/dist/esm/types/src/components/index.d.ts +4 -3
  23. package/dist/esm/types/src/components/inputs/Autocomplete/Autocomplete.d.ts +5 -4
  24. package/dist/esm/types/src/components/inputs/Autocomplete/Autocomplete.stories.d.ts +3 -3
  25. package/dist/esm/types/src/components/inputs/Autocomplete/AutocompleteSelectMultiple/AutocompleteSelectMultiple.d.ts +1 -8
  26. package/dist/esm/types/src/components/inputs/Autocomplete/types.d.ts +10 -0
  27. package/dist/esm/types/src/components/inputs/Input/Input.d.ts +15 -0
  28. package/dist/esm/types/src/components/inputs/Input/Input.stories.d.ts +6 -0
  29. package/dist/esm/types/src/components/inputs/Input/index.d.ts +2 -0
  30. package/dist/esm/types/src/components/overlay/{Modal/Modal.d.ts → Drawer/Drawer.d.ts} +5 -2
  31. package/dist/esm/types/src/components/overlay/{Modal/Modal.stories.d.ts → Drawer/Drawer.stories.d.ts} +3 -4
  32. package/dist/esm/types/src/components/overlay/Drawer/index.d.ts +2 -0
  33. package/dist/index.d.ts +47 -24
  34. package/package.json +3 -6
  35. package/dist/cjs/types/src/components/data-display/TextField/TextField.d.ts +0 -9
  36. package/dist/cjs/types/src/components/data-display/TextField/index.d.ts +0 -2
  37. package/dist/cjs/types/src/components/inputs/TextField/TextField.d.ts +0 -6
  38. package/dist/cjs/types/src/components/inputs/TextField/index.d.ts +0 -2
  39. package/dist/cjs/types/src/components/overlay/Modal/index.d.ts +0 -2
  40. package/dist/esm/types/src/components/data-display/TextField/TextField.d.ts +0 -9
  41. package/dist/esm/types/src/components/data-display/TextField/index.d.ts +0 -2
  42. package/dist/esm/types/src/components/inputs/TextField/TextField.d.ts +0 -6
  43. package/dist/esm/types/src/components/inputs/TextField/index.d.ts +0 -2
  44. package/dist/esm/types/src/components/overlay/Modal/index.d.ts +0 -2
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ interface TextBlockProps {
3
+ label?: string;
4
+ content?: string | JSX.Element;
5
+ size?: "small" | "medium" | "large";
6
+ inline?: boolean;
7
+ }
8
+ declare function TextBlock({ label, content, size, inline }: TextBlockProps): import("react/jsx-runtime").JSX.Element;
9
+ export default TextBlock;
@@ -1,8 +1,8 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
- import TextField from "./TextField";
3
- declare const meta: Meta<typeof TextField>;
2
+ import TextBlock from "./TextBlock";
3
+ declare const meta: Meta<typeof TextBlock>;
4
4
  export default meta;
5
- type Story = StoryObj<typeof TextField>;
5
+ type Story = StoryObj<typeof TextBlock>;
6
6
  export declare const Default: Story;
7
7
  export declare const Small: Story;
8
8
  export declare const Medium: Story;
@@ -0,0 +1,2 @@
1
+ import TextBlock from "./TextBlock";
2
+ export default TextBlock;
@@ -10,7 +10,7 @@ import RelativeTime from "./data-display/RelativeTime";
10
10
  import StatusIcon from "./data-display/StatusIcon";
11
11
  import Table from "./data-display/Table";
12
12
  import Tabs from "./data-display/Tabs";
13
- import TextField from "./data-display/TextField";
13
+ import TextBlock from "./data-display/TextBlock";
14
14
  import Tooltip from "./data-display/Tooltip";
15
15
  import LoadingSpinner from "./feedback/LoadingSpinner";
16
16
  import ProgressBar from "./feedback/ProgressBar";
@@ -21,7 +21,8 @@ import Layout from "./global/Layout";
21
21
  import Logo from "./global/Logo";
22
22
  import Button from "./inputs/Button";
23
23
  import Breadcrumb from "./navigation/Breadcrumb";
24
- import Modal from "./overlay/Modal";
25
24
  import Autocomplete from "./inputs/Autocomplete";
26
25
  import AutocompleteSelectMultiple from "./inputs/Autocomplete/AutocompleteSelectMultiple";
27
- export { Autocomplete, AutocompleteSelectMultiple, Accordion, AppBar, Badge, Breadcrumb, Button, Divider, DropDownMenu, Heading, Icon, Layout, LoadingSpinner, Logo, Modal, ProgressBar, ProgressCircle, ReadMore, RelativeTime, StatusIcon, Table, Tabs, TextField, theme, ToastMessages, Tooltip, };
26
+ import Input from "./inputs/Input";
27
+ import Drawer from "./overlay/Drawer";
28
+ export { Autocomplete, AutocompleteSelectMultiple, Accordion, AppBar, Badge, Breadcrumb, Button, Divider, Drawer, DropDownMenu, Heading, Icon, Input, Layout, LoadingSpinner, Logo, ProgressBar, ProgressCircle, ReadMore, RelativeTime, StatusIcon, Table, Tabs, TextBlock, theme, ToastMessages, Tooltip, };
@@ -1,9 +1,10 @@
1
1
  import { ReactElement } from "react";
2
- import { AutocompleteProps as MuiAutocompleteProps } from "@mui/material/Autocomplete";
2
+ import { AutocompleteProps as MuiAutocompleteProps } from "@mui/joy/Autocomplete";
3
3
  import { Option } from "./types";
4
4
  export interface AutocompleteProps extends MuiAutocompleteProps<Option, true, false, false> {
5
- changeNotification: () => void;
6
- label: string;
5
+ id: string;
6
+ options: Option[];
7
+ renderInput?: MuiAutocompleteProps<Option, true, false, false>;
7
8
  }
8
- declare function Autocomplete({ changeNotification, defaultValue, id, label, onChange: originalOnChange, options, ...props }: AutocompleteProps): ReactElement;
9
+ declare function Autocomplete({ defaultValue, id, options, onChange, ...props }: AutocompleteProps): ReactElement;
9
10
  export default Autocomplete;
@@ -1,6 +1,6 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
- import Autocomplete from "./Autocomplete";
3
- declare const meta: Meta<typeof Autocomplete>;
2
+ import CustomAutocomplete from "./Autocomplete";
3
+ declare const meta: Meta<typeof CustomAutocomplete>;
4
4
  export default meta;
5
- type Story = StoryObj<typeof Autocomplete>;
5
+ type Story = StoryObj<typeof CustomAutocomplete>;
6
6
  export declare const Default: Story;
@@ -1,11 +1,4 @@
1
1
  import { ReactElement } from "react";
2
- import { AutocompleteProps } from "@mui/material";
3
- import { Option } from "../types";
4
- export interface AutocompleteSelectMultipleProps extends AutocompleteProps<Option, true, false, false> {
5
- defaultValue: Option[] | undefined;
6
- inline?: boolean;
7
- changeNotification?: () => void;
8
- label: string;
9
- }
2
+ import { AutocompleteSelectMultipleProps } from "../types";
10
3
  declare function AutocompleteSelectMultiple({ changeNotification, defaultValue, id, inline, label, onChange: originalOnChange, options, ...props }: AutocompleteSelectMultipleProps): ReactElement;
11
4
  export default AutocompleteSelectMultiple;
@@ -1,5 +1,15 @@
1
+ import { SyntheticEvent } from "react";
1
2
  export interface Option {
2
3
  label: string;
3
4
  value: string;
4
5
  id?: number | string;
5
6
  }
7
+ export interface AutocompleteSelectMultipleProps {
8
+ defaultValue: Option[] | undefined;
9
+ inline?: boolean;
10
+ changeNotification?: () => void;
11
+ label: string;
12
+ id: string;
13
+ options: Option[];
14
+ onChange: (event: SyntheticEvent<Element, Event>, value: Option[], reason: string) => void;
15
+ }
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ declare const Input: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Pick<import("react").InputHTMLAttributes<HTMLInputElement>, "name" | "type" | "defaultValue" | "autoFocus" | "id" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "onKeyUp" | "onClick" | "disabled" | "value" | "autoComplete" | "placeholder" | "readOnly" | "required"> & {
3
+ className?: string | undefined;
4
+ color?: import("@mui/types").OverridableStringUnion<import("@mui/joy").ColorPaletteProp, import("@mui/joy").InputPropsColorOverrides> | undefined;
5
+ endDecorator?: import("react").ReactNode;
6
+ error?: boolean | undefined;
7
+ fullWidth?: boolean | undefined;
8
+ startDecorator?: import("react").ReactNode;
9
+ size?: import("@mui/types").OverridableStringUnion<"sm" | "md" | "lg", import("@mui/joy").InputPropsSizeOverrides> | undefined;
10
+ sx?: import("@mui/joy/styles/types").SxProps | undefined;
11
+ variant?: import("@mui/types").OverridableStringUnion<import("@mui/joy").VariantProp, import("@mui/joy").InputPropsVariantOverrides> | undefined;
12
+ } & import("@mui/joy").InputSlotsAndSlotProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
13
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
14
+ }, "name" | "type" | "defaultValue" | "autoFocus" | "className" | "id" | "color" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "onKeyUp" | "onClick" | "disabled" | "value" | "autoComplete" | "placeholder" | "readOnly" | "required" | "size" | "error" | "endDecorator" | "startDecorator" | "sx" | "variant" | "fullWidth" | keyof import("@mui/joy").InputSlotsAndSlotProps>, never>> & string & Omit<import("@mui/types").OverridableComponent<import("@mui/joy").InputTypeMap<{}, "div">>, keyof import("react").Component<any, {}, any>>;
15
+ export default Input;
@@ -0,0 +1,6 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import Input from "./Input";
3
+ declare const meta: Meta<typeof Input>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Input>;
6
+ export declare const Default: Story;
@@ -0,0 +1,2 @@
1
+ import Input from "./Input";
2
+ export default Input;
@@ -1,9 +1,12 @@
1
1
  import React from "react";
2
2
  export interface ModalWindowProps {
3
- side: "left" | "right" | "center";
3
+ side: "left" | "right";
4
+ size?: "sm" | "md" | "lg";
4
5
  open: boolean;
5
6
  onClose: () => void;
6
- showWarning?: boolean;
7
+ onCloseCompleted?: () => void;
8
+ closeRequested?: boolean;
9
+ closeBlocked?: boolean;
7
10
  }
8
11
  declare const Modal: React.ForwardRefExoticComponent<ModalWindowProps & {
9
12
  children?: React.ReactNode;
@@ -1,9 +1,8 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
- import Modal from "./Modal";
3
- type Story = StoryObj<typeof Modal>;
4
- declare const meta: Meta<typeof Modal>;
2
+ import Drawer from "./Drawer";
3
+ type Story = StoryObj<typeof Drawer>;
4
+ declare const meta: Meta<typeof Drawer>;
5
5
  export default meta;
6
6
  export declare const Left: Story;
7
7
  export declare const Right: Story;
8
8
  export declare const Warning: Story;
9
- export declare const Center: Story;
@@ -0,0 +1,2 @@
1
+ import Drawer from "./Drawer";
2
+ export default Drawer;