@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.
- package/dist/cjs/index.cjs +195 -307
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/types/src/components/data-display/TextBlock/TextBlock.d.ts +9 -0
- package/dist/cjs/types/src/components/data-display/{TextField/TextField.stories.d.ts → TextBlock/TextBlock.stories.d.ts} +3 -3
- package/dist/cjs/types/src/components/data-display/TextBlock/index.d.ts +2 -0
- package/dist/cjs/types/src/components/index.d.ts +4 -3
- package/dist/cjs/types/src/components/inputs/Autocomplete/Autocomplete.d.ts +5 -4
- package/dist/cjs/types/src/components/inputs/Input/Input.d.ts +15 -0
- package/dist/cjs/types/src/components/inputs/Input/Input.stories.d.ts +6 -0
- package/dist/cjs/types/src/components/inputs/Input/index.d.ts +2 -0
- package/dist/cjs/types/src/components/overlay/{Modal/Modal.d.ts → Drawer/Drawer.d.ts} +5 -2
- package/dist/cjs/types/src/components/overlay/{Modal/Modal.stories.d.ts → Drawer/Drawer.stories.d.ts} +3 -4
- package/dist/cjs/types/src/components/overlay/Drawer/index.d.ts +2 -0
- package/dist/esm/index.js +227 -339
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/data-display/TextBlock/TextBlock.d.ts +9 -0
- package/dist/esm/types/src/components/data-display/{TextField/TextField.stories.d.ts → TextBlock/TextBlock.stories.d.ts} +3 -3
- package/dist/esm/types/src/components/data-display/TextBlock/index.d.ts +2 -0
- package/dist/esm/types/src/components/index.d.ts +4 -3
- package/dist/esm/types/src/components/inputs/Autocomplete/Autocomplete.d.ts +5 -4
- package/dist/esm/types/src/components/inputs/Input/Input.d.ts +15 -0
- package/dist/esm/types/src/components/inputs/Input/Input.stories.d.ts +6 -0
- package/dist/esm/types/src/components/inputs/Input/index.d.ts +2 -0
- package/dist/esm/types/src/components/overlay/{Modal/Modal.d.ts → Drawer/Drawer.d.ts} +5 -2
- package/dist/esm/types/src/components/overlay/{Modal/Modal.stories.d.ts → Drawer/Drawer.stories.d.ts} +3 -4
- package/dist/esm/types/src/components/overlay/Drawer/index.d.ts +2 -0
- package/dist/index.d.ts +38 -17
- package/package.json +2 -2
- package/dist/cjs/types/src/components/data-display/TextField/TextField.d.ts +0 -9
- package/dist/cjs/types/src/components/data-display/TextField/index.d.ts +0 -2
- package/dist/cjs/types/src/components/inputs/TextField/TextField.d.ts +0 -6
- package/dist/cjs/types/src/components/inputs/TextField/index.d.ts +0 -2
- package/dist/cjs/types/src/components/overlay/Modal/index.d.ts +0 -2
- package/dist/esm/types/src/components/data-display/TextField/TextField.d.ts +0 -9
- package/dist/esm/types/src/components/data-display/TextField/index.d.ts +0 -2
- package/dist/esm/types/src/components/inputs/TextField/TextField.d.ts +0 -6
- package/dist/esm/types/src/components/inputs/TextField/index.d.ts +0 -2
- 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
|
|
3
|
-
declare const meta: Meta<typeof
|
|
2
|
+
import TextBlock from "./TextBlock";
|
|
3
|
+
declare const meta: Meta<typeof TextBlock>;
|
|
4
4
|
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof
|
|
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;
|
|
@@ -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
|
|
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
|
-
|
|
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/
|
|
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
|
-
|
|
6
|
-
|
|
5
|
+
id: string;
|
|
6
|
+
options: Option[];
|
|
7
|
+
renderInput?: MuiAutocompleteProps<Option, true, false, false>;
|
|
7
8
|
}
|
|
8
|
-
declare function Autocomplete({
|
|
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;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export interface ModalWindowProps {
|
|
3
|
-
side: "left" | "right"
|
|
3
|
+
side: "left" | "right";
|
|
4
|
+
size?: "sm" | "md" | "lg";
|
|
4
5
|
open: boolean;
|
|
5
6
|
onClose: () => void;
|
|
6
|
-
|
|
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
|
|
3
|
-
type Story = StoryObj<typeof
|
|
4
|
-
declare const meta: Meta<typeof
|
|
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;
|
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/
|
|
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
|
|
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
|
|
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
|
-
|
|
240
|
-
|
|
232
|
+
id: string;
|
|
233
|
+
options: Option[];
|
|
234
|
+
renderInput?: AutocompleteProps$1<Option, true, false, false>;
|
|
241
235
|
}
|
|
242
|
-
declare function Autocomplete({
|
|
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,
|
|
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.
|
|
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/
|
|
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,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,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,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;
|