@harpercollins/harpercollins-design-system 1.13.1 → 1.14.2
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 +147 -127
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/types/src/components/feedback/ToastMessages/ToastMessages.d.ts +3 -2
- package/dist/cjs/types/src/components/feedback/ToastMessages/ToastMessages.stories.d.ts +1 -0
- package/dist/cjs/types/src/components/global/Layout/Layout.d.ts +1 -1
- package/dist/cjs/types/src/components/global/ThemeProvider/ThemeProvider.d.ts +6 -0
- package/dist/cjs/types/src/components/global/ThemeProvider/index.d.ts +2 -0
- package/dist/cjs/types/src/components/index.d.ts +2 -1
- package/dist/cjs/types/src/components/navigation/Menu/MenuHeading.d.ts +2 -12
- package/dist/esm/index.js +147 -128
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/feedback/ToastMessages/ToastMessages.d.ts +3 -2
- package/dist/esm/types/src/components/feedback/ToastMessages/ToastMessages.stories.d.ts +1 -0
- package/dist/esm/types/src/components/global/Layout/Layout.d.ts +1 -1
- package/dist/esm/types/src/components/global/ThemeProvider/ThemeProvider.d.ts +6 -0
- package/dist/esm/types/src/components/global/ThemeProvider/index.d.ts +2 -0
- package/dist/esm/types/src/components/index.d.ts +2 -1
- package/dist/esm/types/src/components/navigation/Menu/MenuHeading.d.ts +2 -12
- package/dist/index.d.ts +11 -18
- package/package.json +1 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ReactElement } from "react";
|
|
2
|
+
type MessageLevel = "info" | "success" | "warning" | "error";
|
|
2
3
|
export interface TextMessage {
|
|
3
|
-
level:
|
|
4
|
+
level: MessageLevel;
|
|
4
5
|
text: string;
|
|
5
6
|
noFade?: boolean;
|
|
6
7
|
}
|
|
7
8
|
export interface HTMLMessage {
|
|
8
|
-
level:
|
|
9
|
+
level: MessageLevel;
|
|
9
10
|
html: string;
|
|
10
11
|
noFade?: boolean;
|
|
11
12
|
}
|
|
@@ -4,6 +4,7 @@ declare const meta: Meta<typeof ToastMessages>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
export declare function Success(): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare function Warning(): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function Info(): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export declare function Error(): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export declare function HTML(): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export declare function Multiple(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../../../styles/css/vendor/meyer-reset.css";
|
|
2
2
|
import "../../../styles/css/globals.css";
|
|
3
|
-
|
|
3
|
+
import { Theme } from "../ThemeProvider/ThemeProvider";
|
|
4
4
|
interface LayoutProps {
|
|
5
5
|
header?: JSX.Element;
|
|
6
6
|
theme?: Theme;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type Theme = "light_internal" | "light_external";
|
|
2
|
+
interface ThemeProviderProps {
|
|
3
|
+
theme?: Theme;
|
|
4
|
+
}
|
|
5
|
+
declare function ThemeProvider({ children, theme, }: React.PropsWithChildren<ThemeProviderProps>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default ThemeProvider;
|
|
@@ -57,6 +57,7 @@ import Textarea from "./inputs/Textarea";
|
|
|
57
57
|
import TextBlock from "./data-display/TextBlock";
|
|
58
58
|
import TextField from "./inputs/TextField";
|
|
59
59
|
import ToastMessages from "./feedback/ToastMessages";
|
|
60
|
+
import ThemeProvider from "./global/ThemeProvider";
|
|
60
61
|
import Tooltip from "./data-display/Tooltip";
|
|
61
62
|
import Typography from "./data-display/Typography";
|
|
62
|
-
export { Accordion, Alert, AppBar, Autocomplete, AutocompleteSelectMultiple, Avatar, Badge, Box, Breadcrumb, Button, Card, CardActions, CardContent, CardCover, CardOverflow, Checkbox, Chip, ChipIcon, Container, DatePicker, DateTimeInput, Divider, Drawer, Dropdown, FormControl, FullPageErrorFallback, Grid, Heading, Icon, IconButton, Input, Layout, List, ListItem, ListItemButton, ListItemContent, ListItemDecorator, ListDivider, ListSubheader, LoadingSpinner, Logo, LogoMini, Menu, MenuButton, MenuHeading, MenuItem, ProgressBar, ProgressCircle, RadioButton, RadioGroup, ReadMore, RelativeTime, StatusIcon, Table, Tabs, Textarea, TextBlock, TextField, ToastMessages, Tooltip, Typography, };
|
|
63
|
+
export { Accordion, Alert, AppBar, Autocomplete, AutocompleteSelectMultiple, Avatar, Badge, Box, Breadcrumb, Button, Card, CardActions, CardContent, CardCover, CardOverflow, Checkbox, Chip, ChipIcon, Container, DatePicker, DateTimeInput, Divider, Drawer, Dropdown, FormControl, FullPageErrorFallback, Grid, Heading, Icon, IconButton, Input, Layout, List, ListItem, ListItemButton, ListItemContent, ListItemDecorator, ListDivider, ListSubheader, LoadingSpinner, Logo, LogoMini, Menu, MenuButton, MenuHeading, MenuItem, ProgressBar, ProgressCircle, RadioButton, RadioGroup, ReadMore, RelativeTime, StatusIcon, Table, Tabs, Textarea, TextBlock, TextField, ThemeProvider, ToastMessages, Tooltip, Typography, };
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
children?: React.ReactNode;
|
|
4
|
-
startAction?: React.ReactNode;
|
|
5
|
-
endAction?: React.ReactNode;
|
|
6
|
-
nested?: boolean;
|
|
7
|
-
sticky?: boolean;
|
|
8
|
-
variant?: import("@mui/types").OverridableStringUnion<import("@mui/joy").VariantProp, import("@mui/joy").ListItemPropsVariantOverrides>;
|
|
9
|
-
sx?: import("@mui/joy/styles/types").SxProps;
|
|
10
|
-
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
|
|
11
|
-
ref?: ((instance: HTMLLIElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLLIElement> | null | undefined;
|
|
12
|
-
}, "children" | "color" | "sticky" | "sx" | "variant" | keyof import("@mui/joy").ListItemSlotsAndSlotProps | "startAction" | "endAction" | "nested">, never>> & string & Omit<import("@mui/types").OverridableComponent<import("@mui/joy").ListItemTypeMap<{}, "li">>, keyof import("react").Component<any, {}, any>>;
|
|
1
|
+
import { ListItem } from "@mui/joy";
|
|
2
|
+
declare const MenuHeading: typeof ListItem;
|
|
13
3
|
export default MenuHeading;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as _mui_joy from '@mui/joy';
|
|
3
|
-
import { AlertProps, AutocompleteProps as AutocompleteProps$1, AvatarProps, BadgeProps, CardProps, CheckboxProps, ChipProps, ColorPaletteProp, ContainerProps, DividerProps, DropdownProps, FormControlProps, GridProps, InputProps, ListProps, MenuProps, RadioProps, TextareaProps, TooltipProps as TooltipProps$1, TypographyProps } from '@mui/joy';
|
|
3
|
+
import { AlertProps, AutocompleteProps as AutocompleteProps$1, AvatarProps, BadgeProps, CardProps, CheckboxProps, ChipProps, ColorPaletteProp, ContainerProps, DividerProps, DropdownProps, FormControlProps, GridProps, InputProps, ListProps, MenuProps, ListItem, RadioProps, TextareaProps, TooltipProps as TooltipProps$1, TypographyProps } from '@mui/joy';
|
|
4
4
|
export { Box, CardActions, CardContent, CardCover, CardOverflow, IconButton, ListDivider, ListItem, ListItemButton, ListItemContent, ListItemDecorator, ListSubheader, MenuButton, RadioGroup, TextField } from '@mui/joy';
|
|
5
5
|
import * as React$1 from 'react';
|
|
6
6
|
import React__default, { ReactElement, PropsWithChildren } from 'react';
|
|
@@ -9,8 +9,6 @@ import * as styled_components from 'styled-components';
|
|
|
9
9
|
import { IconDefinition } from '@fortawesome/free-solid-svg-icons';
|
|
10
10
|
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
11
11
|
import ReactDatePicker, { ReactDatePickerProps } from 'react-datepicker';
|
|
12
|
-
import * as _mui_joy_styles_types from '@mui/joy/styles/types';
|
|
13
|
-
import * as _mui_types from '@mui/types';
|
|
14
12
|
import { ColumnDef } from '@tanstack/react-table';
|
|
15
13
|
|
|
16
14
|
interface AccordionProps {
|
|
@@ -191,6 +189,11 @@ declare function Heading({ children, as }: HeadingProps): react_jsx_runtime.JSX.
|
|
|
191
189
|
declare function Input(props: InputProps): react_jsx_runtime.JSX.Element;
|
|
192
190
|
|
|
193
191
|
type Theme = "light_internal" | "light_external";
|
|
192
|
+
interface ThemeProviderProps {
|
|
193
|
+
theme?: Theme;
|
|
194
|
+
}
|
|
195
|
+
declare function ThemeProvider({ children, theme, }: React.PropsWithChildren<ThemeProviderProps>): react_jsx_runtime.JSX.Element;
|
|
196
|
+
|
|
194
197
|
interface LayoutProps {
|
|
195
198
|
header?: JSX.Element;
|
|
196
199
|
theme?: Theme;
|
|
@@ -217,18 +220,7 @@ declare function LogoSVGMini({ width, fillColour }: LogoProps): JSX.Element;
|
|
|
217
220
|
|
|
218
221
|
declare function Menu(props: MenuProps): react_jsx_runtime.JSX.Element;
|
|
219
222
|
|
|
220
|
-
declare const MenuHeading:
|
|
221
|
-
color?: _mui_types.OverridableStringUnion<_mui_joy.ColorPaletteProp, _mui_joy.ListItemPropsColorOverrides>;
|
|
222
|
-
children?: React.ReactNode;
|
|
223
|
-
startAction?: React.ReactNode;
|
|
224
|
-
endAction?: React.ReactNode;
|
|
225
|
-
nested?: boolean;
|
|
226
|
-
sticky?: boolean;
|
|
227
|
-
variant?: _mui_types.OverridableStringUnion<_mui_joy.VariantProp, _mui_joy.ListItemPropsVariantOverrides>;
|
|
228
|
-
sx?: _mui_joy_styles_types.SxProps;
|
|
229
|
-
} & Omit<Omit<React$1.DetailedHTMLProps<React$1.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
|
|
230
|
-
ref?: ((instance: HTMLLIElement | null) => void | React$1.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React$1.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React$1.RefObject<HTMLLIElement> | null | undefined;
|
|
231
|
-
}, "children" | "color" | "sticky" | "sx" | "variant" | keyof _mui_joy.ListItemSlotsAndSlotProps | "startAction" | "endAction" | "nested">, never>> & string & Omit<_mui_types.OverridableComponent<_mui_joy.ListItemTypeMap<{}, "li">>, keyof React$1.Component<any, {}, any>>;
|
|
223
|
+
declare const MenuHeading: typeof ListItem;
|
|
232
224
|
|
|
233
225
|
declare const StyledMenuItem: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<Omit<_mui_joy.ListItemButtonProps, "slots" | "slotProps"> & _mui_joy.MenuItemSlotsAndSlotProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
234
226
|
ref?: ((instance: HTMLDivElement | null) => void | React$1.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React$1.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React$1.RefObject<HTMLDivElement> | null | undefined;
|
|
@@ -320,13 +312,14 @@ interface TextBlockProps {
|
|
|
320
312
|
}
|
|
321
313
|
declare function TextBlock({ label, content, size, inline }: TextBlockProps): react_jsx_runtime.JSX.Element;
|
|
322
314
|
|
|
315
|
+
type MessageLevel = "info" | "success" | "warning" | "error";
|
|
323
316
|
interface TextMessage {
|
|
324
|
-
level:
|
|
317
|
+
level: MessageLevel;
|
|
325
318
|
text: string;
|
|
326
319
|
noFade?: boolean;
|
|
327
320
|
}
|
|
328
321
|
interface HTMLMessage {
|
|
329
|
-
level:
|
|
322
|
+
level: MessageLevel;
|
|
330
323
|
html: string;
|
|
331
324
|
noFade?: boolean;
|
|
332
325
|
}
|
|
@@ -406,4 +399,4 @@ declare const formatText: (text: string | null | undefined) => string;
|
|
|
406
399
|
* */
|
|
407
400
|
declare const formatCurrency: (value: number | string | null | undefined, locale?: string | undefined, options?: Intl.NumberFormatOptions) => string;
|
|
408
401
|
|
|
409
|
-
export { Accordion, Alert, AppBar, AutoComplete as Autocomplete, AutocompleteSelectMultiple, Avatar, Badge, Breadcrumb, Button, Card, Checkbox, Chip, ChipIcon, Container, DateInput as DatePicker, DateTimeInput, Divider, Modal as Drawer, Dropdown, FormControl, FullPageErrorFallback, Grid, Heading, Icon, Input, Layout, List, LoadingSpinner, LogoSVG as Logo, LogoSVGMini as LogoMini, Menu, MenuHeading, StyledMenuItem as MenuItem, ProgressBar, ProgressCircle, Radio as RadioButton, ReadMore, RelativeTime, StatusIcon, Table, Tabs, TextBlock, Textarea, ToastMessages, Tooltip, Typography, formatCurrency, formatDate, formatNumber, formatText, useFetch, useLocalStorage, useToggle };
|
|
402
|
+
export { Accordion, Alert, AppBar, AutoComplete as Autocomplete, AutocompleteSelectMultiple, Avatar, Badge, Breadcrumb, Button, Card, Checkbox, Chip, ChipIcon, Container, DateInput as DatePicker, DateTimeInput, Divider, Modal as Drawer, Dropdown, FormControl, FullPageErrorFallback, Grid, Heading, Icon, Input, Layout, List, LoadingSpinner, LogoSVG as Logo, LogoSVGMini as LogoMini, Menu, MenuHeading, StyledMenuItem as MenuItem, ProgressBar, ProgressCircle, Radio as RadioButton, ReadMore, RelativeTime, StatusIcon, Table, Tabs, TextBlock, Textarea, ThemeProvider, ToastMessages, Tooltip, Typography, formatCurrency, formatDate, formatNumber, formatText, useFetch, useLocalStorage, useToggle };
|