@harpercollins/harpercollins-design-system 1.8.47 → 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 (38) hide show
  1. package/dist/cjs/index.cjs +195 -307
  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/Input/Input.d.ts +15 -0
  9. package/dist/cjs/types/src/components/inputs/Input/Input.stories.d.ts +6 -0
  10. package/dist/cjs/types/src/components/inputs/Input/index.d.ts +2 -0
  11. package/dist/cjs/types/src/components/overlay/{Modal/Modal.d.ts → Drawer/Drawer.d.ts} +5 -2
  12. package/dist/cjs/types/src/components/overlay/{Modal/Modal.stories.d.ts → Drawer/Drawer.stories.d.ts} +3 -4
  13. package/dist/cjs/types/src/components/overlay/Drawer/index.d.ts +2 -0
  14. package/dist/esm/index.js +227 -339
  15. package/dist/esm/index.js.map +1 -1
  16. package/dist/esm/types/src/components/data-display/TextBlock/TextBlock.d.ts +9 -0
  17. package/dist/esm/types/src/components/data-display/{TextField/TextField.stories.d.ts → TextBlock/TextBlock.stories.d.ts} +3 -3
  18. package/dist/esm/types/src/components/data-display/TextBlock/index.d.ts +2 -0
  19. package/dist/esm/types/src/components/index.d.ts +4 -3
  20. package/dist/esm/types/src/components/inputs/Autocomplete/Autocomplete.d.ts +5 -4
  21. package/dist/esm/types/src/components/inputs/Input/Input.d.ts +15 -0
  22. package/dist/esm/types/src/components/inputs/Input/Input.stories.d.ts +6 -0
  23. package/dist/esm/types/src/components/inputs/Input/index.d.ts +2 -0
  24. package/dist/esm/types/src/components/overlay/{Modal/Modal.d.ts → Drawer/Drawer.d.ts} +5 -2
  25. package/dist/esm/types/src/components/overlay/{Modal/Modal.stories.d.ts → Drawer/Drawer.stories.d.ts} +3 -4
  26. package/dist/esm/types/src/components/overlay/Drawer/index.d.ts +2 -0
  27. package/dist/index.d.ts +38 -17
  28. package/package.json +2 -2
  29. package/dist/cjs/types/src/components/data-display/TextField/TextField.d.ts +0 -9
  30. package/dist/cjs/types/src/components/data-display/TextField/index.d.ts +0 -2
  31. package/dist/cjs/types/src/components/inputs/TextField/TextField.d.ts +0 -6
  32. package/dist/cjs/types/src/components/inputs/TextField/index.d.ts +0 -2
  33. package/dist/cjs/types/src/components/overlay/Modal/index.d.ts +0 -2
  34. package/dist/esm/types/src/components/data-display/TextField/TextField.d.ts +0 -9
  35. package/dist/esm/types/src/components/data-display/TextField/index.d.ts +0 -2
  36. package/dist/esm/types/src/components/inputs/TextField/TextField.d.ts +0 -6
  37. package/dist/esm/types/src/components/inputs/TextField/index.d.ts +0 -2
  38. 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;
@@ -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;
package/dist/index.d.ts CHANGED
@@ -6,7 +6,10 @@ import * as styled_components_dist_types from 'styled-components/dist/types';
6
6
  import * as styled_components from 'styled-components';
7
7
  import { IconProp } from '@fortawesome/fontawesome-svg-core';
8
8
  import { ColumnDef } from '@tanstack/react-table';
9
- import { AutocompleteProps as AutocompleteProps$1 } from '@mui/material/Autocomplete';
9
+ import { AutocompleteProps as AutocompleteProps$1 } from '@mui/joy/Autocomplete';
10
+ import * as _mui_joy_styles_types from '@mui/joy/styles/types';
11
+ import * as _mui_types from '@mui/types';
12
+ import * as _mui_joy from '@mui/joy';
10
13
 
11
14
  declare const theme: {
12
15
  colours: {
@@ -109,13 +112,13 @@ interface TabsProps {
109
112
  }
110
113
  declare function Tabs({ tabsConfig, defaultIndex }: TabsProps): react_jsx_runtime.JSX.Element;
111
114
 
112
- interface TextFieldProps {
115
+ interface TextBlockProps {
113
116
  label?: string;
114
117
  content?: string | JSX.Element;
115
118
  size?: "small" | "medium" | "large";
116
119
  inline?: boolean;
117
120
  }
118
- declare function TextField({ label, content, size, inline }: TextFieldProps): react_jsx_runtime.JSX.Element;
121
+ declare function TextBlock({ label, content, size, inline }: TextBlockProps): react_jsx_runtime.JSX.Element;
119
122
 
120
123
  interface TooltipProps {
121
124
  content: string;
@@ -210,16 +213,6 @@ declare namespace Breadcrumb {
210
213
  var Item: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<React$1.DetailedHTMLProps<React$1.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, never>> & string;
211
214
  }
212
215
 
213
- interface ModalWindowProps {
214
- side: "left" | "right" | "center";
215
- open: boolean;
216
- onClose: () => void;
217
- showWarning?: boolean;
218
- }
219
- declare const Modal: React__default.ForwardRefExoticComponent<ModalWindowProps & {
220
- children?: React__default.ReactNode;
221
- } & React__default.RefAttributes<HTMLDivElement>>;
222
-
223
216
  interface Option {
224
217
  label: string;
225
218
  value: string;
@@ -236,13 +229,41 @@ interface AutocompleteSelectMultipleProps {
236
229
  }
237
230
 
238
231
  interface AutocompleteProps extends AutocompleteProps$1<Option, true, false, false> {
239
- changeNotification: () => void;
240
- label: string;
232
+ id: string;
233
+ options: Option[];
234
+ renderInput?: AutocompleteProps$1<Option, true, false, false>;
241
235
  }
242
- declare function Autocomplete({ changeNotification, defaultValue, id, label, onChange: originalOnChange, options, ...props }: AutocompleteProps): ReactElement;
236
+ declare function Autocomplete({ defaultValue, id, options, onChange, ...props }: AutocompleteProps): ReactElement;
243
237
 
244
238
  declare function AutocompleteSelectMultiple({ changeNotification, defaultValue, id, inline, label, onChange: originalOnChange, options, ...props }: AutocompleteSelectMultipleProps): ReactElement;
245
239
 
240
+ declare const Input: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<Pick<React$1.InputHTMLAttributes<HTMLInputElement>, "name" | "type" | "defaultValue" | "autoFocus" | "id" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "onKeyUp" | "onClick" | "disabled" | "value" | "autoComplete" | "placeholder" | "readOnly" | "required"> & {
241
+ className?: string | undefined;
242
+ color?: _mui_types.OverridableStringUnion<_mui_joy.ColorPaletteProp, _mui_joy.InputPropsColorOverrides> | undefined;
243
+ endDecorator?: React$1.ReactNode;
244
+ error?: boolean | undefined;
245
+ fullWidth?: boolean | undefined;
246
+ startDecorator?: React$1.ReactNode;
247
+ size?: _mui_types.OverridableStringUnion<"sm" | "md" | "lg", _mui_joy.InputPropsSizeOverrides> | undefined;
248
+ sx?: _mui_joy_styles_types.SxProps | undefined;
249
+ variant?: _mui_types.OverridableStringUnion<_mui_joy.VariantProp, _mui_joy.InputPropsVariantOverrides> | undefined;
250
+ } & _mui_joy.InputSlotsAndSlotProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
251
+ ref?: ((instance: HTMLDivElement | null) => void) | React$1.RefObject<HTMLDivElement> | null | undefined;
252
+ }, "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 _mui_joy.InputSlotsAndSlotProps>, never>> & string & Omit<_mui_types.OverridableComponent<_mui_joy.InputTypeMap<{}, "div">>, keyof React$1.Component<any, {}, any>>;
253
+
254
+ interface ModalWindowProps {
255
+ side: "left" | "right";
256
+ size?: "sm" | "md" | "lg";
257
+ open: boolean;
258
+ onClose: () => void;
259
+ onCloseCompleted?: () => void;
260
+ closeRequested?: boolean;
261
+ closeBlocked?: boolean;
262
+ }
263
+ declare const Modal: React__default.ForwardRefExoticComponent<ModalWindowProps & {
264
+ children?: React__default.ReactNode;
265
+ } & React__default.RefAttributes<HTMLDivElement>>;
266
+
246
267
  declare function useToggle(initialState: boolean | (() => boolean)): {
247
268
  value: boolean;
248
269
  toggle: () => void;
@@ -250,4 +271,4 @@ declare function useToggle(initialState: boolean | (() => boolean)): {
250
271
  setFalse: () => void;
251
272
  };
252
273
 
253
- export { Accordion, AppBar, Autocomplete, AutocompleteSelectMultiple, Badge, Breadcrumb, Button, Divider, DropDownMenu, Heading, Icon, Layout, LoadingSpinner, Logo, Modal, ProgressBar, ProgressCircle, ReadMore, RelativeTime, StatusIcon, Table, Tabs, TextField, ToastMessages, Tooltip, theme, useToggle };
274
+ export { Accordion, AppBar, Autocomplete, AutocompleteSelectMultiple, Badge, Breadcrumb, Button, Divider, Modal as Drawer, DropDownMenu, Heading, Icon, Input, Layout, LoadingSpinner, Logo, ProgressBar, ProgressCircle, ReadMore, RelativeTime, StatusIcon, Table, Tabs, TextBlock, ToastMessages, Tooltip, theme, useToggle };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harpercollins/harpercollins-design-system",
3
- "version": "1.8.47",
3
+ "version": "1.8.48",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@ssh.dev.azure.com:v3/HarperCollinsUK/HCDesignSystem/HCDesignSystem"
@@ -43,7 +43,7 @@
43
43
  "@fortawesome/free-regular-svg-icons": "^6.5.2",
44
44
  "@fortawesome/free-solid-svg-icons": "^6.5.2",
45
45
  "@fortawesome/react-fontawesome": "^0.2.2",
46
- "@mui/material": "^5.15.20",
46
+ "@mui/joy": "^5.0.0-beta.36",
47
47
  "@popperjs/core": "^2.11.8",
48
48
  "@storybook/react": "^8.1.4",
49
49
  "@storybook/test": "^8.1.4",
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- interface TextFieldProps {
3
- label?: string;
4
- content?: string | JSX.Element;
5
- size?: "small" | "medium" | "large";
6
- inline?: boolean;
7
- }
8
- declare function TextField({ label, content, size, inline }: TextFieldProps): import("react/jsx-runtime").JSX.Element;
9
- export default TextField;
@@ -1,2 +0,0 @@
1
- import TextField from "./TextField";
2
- export default TextField;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import { TextField as MuiTextField } from "@mui/material";
3
- declare const StyledTextField: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<{
4
- variant?: import("@mui/material").TextFieldVariants | undefined;
5
- } & Omit<import("@mui/material").FilledTextFieldProps | import("@mui/material").OutlinedTextFieldProps | import("@mui/material").StandardTextFieldProps, "variant">, never>> & string & Omit<typeof MuiTextField, keyof import("react").Component<any, {}, any>>;
6
- export default StyledTextField;
@@ -1,2 +0,0 @@
1
- import TextField from "./TextField";
2
- export default TextField;
@@ -1,2 +0,0 @@
1
- import Modal from "./Modal";
2
- export default Modal;
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- interface TextFieldProps {
3
- label?: string;
4
- content?: string | JSX.Element;
5
- size?: "small" | "medium" | "large";
6
- inline?: boolean;
7
- }
8
- declare function TextField({ label, content, size, inline }: TextFieldProps): import("react/jsx-runtime").JSX.Element;
9
- export default TextField;
@@ -1,2 +0,0 @@
1
- import TextField from "./TextField";
2
- export default TextField;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import { TextField as MuiTextField } from "@mui/material";
3
- declare const StyledTextField: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<{
4
- variant?: import("@mui/material").TextFieldVariants | undefined;
5
- } & Omit<import("@mui/material").FilledTextFieldProps | import("@mui/material").OutlinedTextFieldProps | import("@mui/material").StandardTextFieldProps, "variant">, never>> & string & Omit<typeof MuiTextField, keyof import("react").Component<any, {}, any>>;
6
- export default StyledTextField;
@@ -1,2 +0,0 @@
1
- import TextField from "./TextField";
2
- export default TextField;
@@ -1,2 +0,0 @@
1
- import Modal from "./Modal";
2
- export default Modal;