@harpercollins/harpercollins-design-system 1.22.4 → 1.23.0
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 +141 -369
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/types/src/components/data-display/Tabs/Tabs.d.ts +39 -9
- package/dist/cjs/types/src/components/data-display/Tabs/Tabs.stories.d.ts +5 -3
- package/dist/cjs/types/src/components/data-display/Tabs/index.d.ts +3 -2
- package/dist/cjs/types/src/components/index.d.ts +2 -2
- package/dist/cjs/types/src/components/inputs/Button/Button.d.ts +2 -37
- package/dist/cjs/types/src/components/inputs/Button/Button.stories.d.ts +1 -14
- package/dist/esm/index.js +142 -370
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/data-display/Tabs/Tabs.d.ts +39 -9
- package/dist/esm/types/src/components/data-display/Tabs/Tabs.stories.d.ts +5 -3
- package/dist/esm/types/src/components/data-display/Tabs/index.d.ts +3 -2
- package/dist/esm/types/src/components/index.d.ts +2 -2
- package/dist/esm/types/src/components/inputs/Button/Button.d.ts +2 -37
- package/dist/esm/types/src/components/inputs/Button/Button.stories.d.ts +1 -14
- package/dist/index.d.ts +41 -39
- package/package.json +12 -12
- package/dist/cjs/types/src/components/data-display/Tabs/Tabs.style.d.ts +0 -9
- package/dist/esm/types/src/components/data-display/Tabs/Tabs.style.d.ts +0 -9
|
@@ -1,11 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import JoyTab, { tabClasses } from "@mui/joy/Tab";
|
|
2
|
+
import TabList, { tabListClasses } from "@mui/joy/TabList";
|
|
3
|
+
import TabPanel, { tabPanelClasses } from "@mui/joy/TabPanel";
|
|
4
|
+
import type { TabsProps as JoyTabsProps } from "@mui/joy/Tabs";
|
|
5
|
+
import { SyntheticEvent } from "react";
|
|
6
|
+
export { JoyTab as Tab, tabClasses, TabList, tabListClasses, TabPanel, tabPanelClasses, };
|
|
7
|
+
interface TabsProps extends Omit<JoyTabsProps, "value" | "onChange" | "defaultValue"> {
|
|
8
|
+
/**
|
|
9
|
+
* The content of the tabs.
|
|
10
|
+
*/
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* The default value of the tabs.
|
|
14
|
+
*/
|
|
15
|
+
defaultValue?: string | number;
|
|
16
|
+
/**
|
|
17
|
+
* The controlled value of the tabs.
|
|
18
|
+
*/
|
|
19
|
+
value?: string | number;
|
|
20
|
+
/**
|
|
21
|
+
* Callback fired when the value changes.
|
|
22
|
+
* @param event
|
|
23
|
+
* @param value
|
|
24
|
+
* @returns void
|
|
25
|
+
*/
|
|
26
|
+
onChange?: (event: SyntheticEvent | null, value: string | number | null) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Whether to update the URL with the selected tab value.
|
|
29
|
+
*/
|
|
30
|
+
updateUrl?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The style of the tabs.
|
|
33
|
+
*/
|
|
34
|
+
tabStyle?: "default" | "attached";
|
|
35
|
+
/**
|
|
36
|
+
* A key to use for storing the selected tab in localStorage.
|
|
37
|
+
*/
|
|
38
|
+
storageKey?: string;
|
|
5
39
|
}
|
|
6
|
-
|
|
7
|
-
tabsConfig: TabConfig[];
|
|
8
|
-
defaultId?: string;
|
|
9
|
-
}
|
|
10
|
-
declare function Tabs({ tabsConfig, defaultId }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare function Tabs({ children, defaultValue, value: controlledValue, onChange, updateUrl, sx, tabStyle, storageKey, ...restProps }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
11
41
|
export default Tabs;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
-
import
|
|
3
|
-
declare const meta: Meta<typeof
|
|
2
|
+
import HCTabs from "./Tabs";
|
|
3
|
+
declare const meta: Meta<typeof HCTabs>;
|
|
4
4
|
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof
|
|
5
|
+
type Story = StoryObj<typeof HCTabs>;
|
|
6
6
|
export declare const Default: Story;
|
|
7
|
+
export declare const AttachedTabs: Story;
|
|
8
|
+
export declare const NestedTabs: Story;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
export
|
|
1
|
+
import HCTabs, { Tab, TabList, TabPanel, tabClasses, tabListClasses, tabPanelClasses } from "./Tabs";
|
|
2
|
+
export { Tab, TabList, TabPanel, tabClasses, tabListClasses, tabPanelClasses };
|
|
3
|
+
export default HCTabs;
|
|
@@ -17,7 +17,7 @@ import ReadMore from "./data-display/ReadMore";
|
|
|
17
17
|
import RelativeTime from "./data-display/RelativeTime";
|
|
18
18
|
import StatusIcon from "./data-display/StatusIcon";
|
|
19
19
|
import Table from "./data-display/Table";
|
|
20
|
-
import Tabs from "./data-display/Tabs";
|
|
20
|
+
import Tabs, { Tab, tabClasses, TabList, tabListClasses, TabPanel, tabPanelClasses } from "./data-display/Tabs";
|
|
21
21
|
import TextBlock from "./data-display/TextBlock";
|
|
22
22
|
import Tooltip from "./data-display/Tooltip";
|
|
23
23
|
import Typography from "./data-display/Typography";
|
|
@@ -72,4 +72,4 @@ import CardContent from "./surfaces/Card/CardContent";
|
|
|
72
72
|
import CardCover from "./surfaces/Card/CardCover";
|
|
73
73
|
import CardOverflow from "./surfaces/Card/CardOverflow";
|
|
74
74
|
import Sheet from "./surfaces/Sheet/Sheet";
|
|
75
|
-
export { Accordion, AccordionDetails, AccordionGroup, AccordionLegacy, AccordionSummary, Alert, AppBar, Autocomplete, AutocompleteSelectMultiple, Avatar, Badge, Box, Breadcrumb, Button, Card, CardActions, CardContent, CardCover, CardOverflow, Checkbox, Chip, ChipIcon, CircularProgress, Container, DatePicker, DateTimeInput, Divider, Drawer, Dropdown, FormControl, FormLabel, FullPageErrorFallback, Grid, Heading, Icon, IconButton, Input, Layout, List, ListDivider, ListItem, ListItemButton, ListItemContent, ListItemDecorator, ListSubheader, LoadingSpinner, Logo, LogoMini, Menu, MenuButton, MenuHeading, MenuItem, Option, ProgressBar, ProgressCircle, RadioButton, RadioGroup, ReadMore, RelativeTime, Select, Sheet, Skeleton, Slider, StatusIcon, Switch, Table, Tabs, Textarea, TextBlock, TextField, ThemeProvider, ToastMessages, Tooltip, Typography, };
|
|
75
|
+
export { Accordion, AccordionDetails, AccordionGroup, AccordionLegacy, AccordionSummary, Alert, AppBar, Autocomplete, AutocompleteSelectMultiple, Avatar, Badge, Box, Breadcrumb, Button, Card, CardActions, CardContent, CardCover, CardOverflow, Checkbox, Chip, ChipIcon, CircularProgress, Container, DatePicker, DateTimeInput, Divider, Drawer, Dropdown, FormControl, FormLabel, FullPageErrorFallback, Grid, Heading, Icon, IconButton, Input, Layout, List, ListDivider, ListItem, ListItemButton, ListItemContent, ListItemDecorator, ListSubheader, LoadingSpinner, Logo, LogoMini, Menu, MenuButton, MenuHeading, MenuItem, Option, ProgressBar, ProgressCircle, RadioButton, RadioGroup, ReadMore, RelativeTime, Select, Sheet, Skeleton, Slider, StatusIcon, Switch, Tab, tabClasses, Table, TabList, tabListClasses, TabPanel, tabPanelClasses, Tabs, Textarea, TextBlock, TextField, ThemeProvider, ToastMessages, Tooltip, Typography, };
|
|
@@ -1,38 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
kind?: "primary" | "secondary" | "danger" | "basic" | "debug";
|
|
4
|
-
size?: "normal" | "small";
|
|
5
|
-
}
|
|
6
|
-
export declare const LinkButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, {
|
|
7
|
-
kind?: LinkButtonInternalProps["kind"];
|
|
8
|
-
size?: LinkButtonInternalProps["size"];
|
|
9
|
-
}>> & string;
|
|
10
|
-
export declare const HTMLButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
11
|
-
kind?: LinkButtonInternalProps["kind"];
|
|
12
|
-
size?: LinkButtonInternalProps["size"];
|
|
13
|
-
$isSubmitting?: boolean;
|
|
14
|
-
}>> & string;
|
|
15
|
-
interface CommonButtonProps {
|
|
16
|
-
kind?: "primary" | "secondary" | "danger" | "basic" | "debug";
|
|
17
|
-
size?: "normal" | "small";
|
|
18
|
-
disabled?: boolean;
|
|
19
|
-
style?: React.CSSProperties;
|
|
20
|
-
isSubmitting?: boolean;
|
|
21
|
-
}
|
|
22
|
-
interface LinkButtonProps extends CommonButtonProps, LinkButtonInternalProps {
|
|
23
|
-
type: "link";
|
|
24
|
-
href: string;
|
|
25
|
-
as?: React.ElementType;
|
|
26
|
-
}
|
|
27
|
-
interface SubmitButtonProps extends CommonButtonProps {
|
|
28
|
-
type: "submit";
|
|
29
|
-
name?: string;
|
|
30
|
-
value?: string;
|
|
31
|
-
hideSpinner?: boolean;
|
|
32
|
-
}
|
|
33
|
-
interface ButtonProps extends CommonButtonProps {
|
|
34
|
-
type: "button";
|
|
35
|
-
onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
36
|
-
}
|
|
37
|
-
declare function Button({ children, ...props }: React.PropsWithChildren<LinkButtonProps | SubmitButtonProps | ButtonProps>): React.ReactElement;
|
|
1
|
+
import { ButtonProps } from "@mui/joy";
|
|
2
|
+
declare function Button(props: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
38
3
|
export default Button;
|
|
@@ -3,17 +3,4 @@ import Button from "./Button";
|
|
|
3
3
|
declare const meta: Meta<typeof Button>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof Button>;
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const Secondary: Story;
|
|
8
|
-
export declare const Danger: Story;
|
|
9
|
-
export declare const Basic: Story;
|
|
10
|
-
export declare const Debug: Story;
|
|
11
|
-
export declare const WithIcon: Story;
|
|
12
|
-
export declare const ManualWidth: Story;
|
|
13
|
-
export declare const Disabled: Story;
|
|
14
|
-
export declare const SecondaryDisabled: Story;
|
|
15
|
-
export declare const DangerDisabled: Story;
|
|
16
|
-
export declare const DebugDisabled: Story;
|
|
17
|
-
export declare const PrimarySubmitting: Story;
|
|
18
|
-
export declare const SecondarySubmitting: Story;
|
|
19
|
-
export declare const DangerSubmitting: Story;
|
|
6
|
+
export declare const Default: Story;
|