@harpercollins/harpercollins-design-system 1.28.1 → 1.29.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.
@@ -10,6 +10,7 @@ interface LayoutProps {
10
10
  collapsedSidebarWidth?: number;
11
11
  sidebarHeaderContent?: React.ReactNode;
12
12
  footerReleaseName?: string;
13
+ footerCopyright?: string;
13
14
  }
14
- declare function Layout({ children, header, theme, showSidebar, sidebarContent, sidebarWidth, collapsedSidebarWidth, sidebarHeaderContent, footerReleaseName, }: React.PropsWithChildren<LayoutProps>): import("react/jsx-runtime").JSX.Element;
15
+ declare function Layout({ children, header, theme, showSidebar, sidebarContent, sidebarWidth, collapsedSidebarWidth, sidebarHeaderContent, footerReleaseName, footerCopyright, }: React.PropsWithChildren<LayoutProps>): import("react/jsx-runtime").JSX.Element;
15
16
  export default Layout;
@@ -57,12 +57,13 @@ import Box from "./layout/Box";
57
57
  import Container from "./layout/Container";
58
58
  import Grid from "./layout/Grid";
59
59
  import Breadcrumb from "./navigation/Breadcrumb";
60
+ import Drawer from "./navigation/Drawer";
60
61
  import Dropdown from "./navigation/Dropdown";
61
62
  import Menu from "./navigation/Menu";
62
63
  import MenuButton from "./navigation/Menu/MenuButton";
63
64
  import MenuHeading from "./navigation/Menu/MenuHeading";
64
65
  import MenuItem from "./navigation/Menu/MenuItem";
65
- import Drawer from "./navigation/Drawer";
66
+ import PrimaryNavigation from "./navigation/PrimaryNavigation";
66
67
  import Accordion from "./surfaces/Accordion";
67
68
  import AccordionDetails from "./surfaces/Accordion/AccordionDetails";
68
69
  import AccordionGroup from "./surfaces/Accordion/AccordionGroup";
@@ -74,4 +75,4 @@ import CardContent from "./surfaces/Card/CardContent";
74
75
  import CardCover from "./surfaces/Card/CardCover";
75
76
  import CardOverflow from "./surfaces/Card/CardOverflow";
76
77
  import Sheet from "./surfaces/Sheet/Sheet";
77
- export { Accordion, AccordionDetails, AccordionGroup, AccordionLegacy, AccordionSummary, Alert, AppBar, Autocomplete, AutocompleteOption, AutocompleteSelectMultiple, Avatar, Badge, Box, Breadcrumb, Button, Card, CardActions, CardContent, CardCover, CardOverflow, Checkbox, Chip, ChipIcon, CircularProgress, Container, DatePicker, DateTimeInput, DialogActions, DialogContent, DialogTitle, 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, Modal, ModalClose, ModalDialog, ModalOverflow, 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, };
78
+ export { Accordion, AccordionDetails, AccordionGroup, AccordionLegacy, AccordionSummary, Alert, AppBar, Autocomplete, AutocompleteOption, AutocompleteSelectMultiple, Avatar, Badge, Box, Breadcrumb, Button, Card, CardActions, CardContent, CardCover, CardOverflow, Checkbox, Chip, ChipIcon, CircularProgress, Container, DatePicker, DateTimeInput, DialogActions, DialogContent, DialogTitle, 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, Modal, ModalClose, ModalDialog, ModalOverflow, Option, PrimaryNavigation, 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, };
@@ -4,3 +4,4 @@ declare const meta: Meta<typeof Button>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof Button>;
6
6
  export declare const Default: Story;
7
+ export declare const AsLink: Story;
@@ -0,0 +1,20 @@
1
+ import { IconDefinition } from "@fortawesome/free-solid-svg-icons";
2
+ import React from "react";
3
+ export interface NavItem {
4
+ id: string;
5
+ label: string;
6
+ icon?: IconDefinition;
7
+ href?: string;
8
+ isActive?: boolean;
9
+ show?: boolean;
10
+ onClick?: (e: React.MouseEvent) => void;
11
+ children?: NavItem[];
12
+ }
13
+ export interface PrimaryNavigationProps {
14
+ items: NavItem[];
15
+ sidebarOpen?: boolean;
16
+ onSidebarToggle?: () => void;
17
+ linkComponent?: React.ElementType;
18
+ }
19
+ declare function PrimaryNavigation({ items, sidebarOpen, onSidebarToggle, linkComponent: LinkComponent, }: PrimaryNavigationProps): React.JSX.Element;
20
+ export default PrimaryNavigation;
@@ -0,0 +1,13 @@
1
+ import { Meta, StoryObj } from "@storybook/react-vite";
2
+ import PrimaryNavigation from "./PrimaryNavigation";
3
+ declare const meta: Meta<typeof PrimaryNavigation>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof PrimaryNavigation>;
6
+ export declare const Default: Story;
7
+ export declare const Collapsed: Story;
8
+ export declare const CollapsedWithActiveItem: Story;
9
+ export declare const CollapsedWithActiveChild: Story;
10
+ export declare const WithActiveItem: Story;
11
+ export declare const WithActiveChild: Story;
12
+ export declare const WithActiveGrandchild: Story;
13
+ export declare function ToggleSidebar(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import PrimaryNavigation from "./PrimaryNavigation";
2
+ export type { NavItem, PrimaryNavigationProps } from "./PrimaryNavigation";
3
+ export default PrimaryNavigation;
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 { AvatarProps, BadgeProps, ChipProps, ColorPaletteProp, DividerProps, ListProps, TooltipProps as TooltipProps$1, TypographyProps, AlertProps, CircularProgressProps, ModalProps, SkeletonProps, AutocompleteProps as AutocompleteProps$1, AutocompleteOptionProps, ButtonProps, CheckboxProps, InputProps, FormControlProps, FormLabelProps, RadioProps, SelectProps, SliderProps, SwitchProps, TextareaProps, ContainerProps, GridProps, DropdownProps, MenuProps, ListItem, DrawerProps, AccordionProps as AccordionProps$1, AccordionDetailsProps, AccordionGroupProps, AccordionSummaryProps, CardProps, SheetProps } from '@mui/joy';
3
+ import { AvatarProps, BadgeProps, ChipProps, ColorPaletteProp, DividerProps, ListProps, TooltipProps as TooltipProps$1, TypographyProps, AlertProps, CircularProgressProps, ModalProps, SkeletonProps, AutocompleteProps as AutocompleteProps$1, AutocompleteOptionProps, ButtonProps, CheckboxProps, InputProps, FormControlProps, FormLabelProps, RadioProps, SelectProps, SliderProps, SwitchProps, TextareaProps, ContainerProps, GridProps, DrawerProps, DropdownProps, MenuProps, ListItem, AccordionProps as AccordionProps$1, AccordionDetailsProps, AccordionGroupProps, AccordionSummaryProps, CardProps, SheetProps } from '@mui/joy';
4
4
  export { Box, CardActions, CardContent, CardCover, CardOverflow, DialogActions, DialogContent, DialogTitle, IconButton, ListDivider, ListItem, ListItemButton, ListItemContent, ListItemDecorator, ListSubheader, MenuButton, ModalClose, ModalDialog, ModalOverflow, Option, RadioGroup, TextField } from '@mui/joy';
5
5
  import { IconDefinition } from '@fortawesome/free-solid-svg-icons';
6
6
  import { IconProp } from '@fortawesome/fontawesome-svg-core';
@@ -288,8 +288,9 @@ interface LayoutProps {
288
288
  collapsedSidebarWidth?: number;
289
289
  sidebarHeaderContent?: react.ReactNode;
290
290
  footerReleaseName?: string;
291
+ footerCopyright?: string;
291
292
  }
292
- declare function Layout({ children, header, theme, showSidebar, sidebarContent, sidebarWidth, collapsedSidebarWidth, sidebarHeaderContent, footerReleaseName, }: react.PropsWithChildren<LayoutProps>): react_jsx_runtime.JSX.Element;
293
+ declare function Layout({ children, header, theme, showSidebar, sidebarContent, sidebarWidth, collapsedSidebarWidth, sidebarHeaderContent, footerReleaseName, footerCopyright, }: react.PropsWithChildren<LayoutProps>): react_jsx_runtime.JSX.Element;
293
294
 
294
295
  interface LogoProps {
295
296
  width?: number;
@@ -368,6 +369,18 @@ declare namespace Breadcrumb {
368
369
  var Item: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, never> & Partial<Pick<react.DetailedHTMLProps<react.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, never>>> & string;
369
370
  }
370
371
 
372
+ interface ModalWindowProps extends Omit<DrawerProps, "open" | "anchor"> {
373
+ side: "left" | "right";
374
+ size?: "sm" | "md" | "lg";
375
+ open: boolean;
376
+ onClose: () => void;
377
+ onCloseCompleted?: () => void;
378
+ closeRequested?: boolean;
379
+ closeBlocked?: boolean;
380
+ showCloseButton?: boolean;
381
+ }
382
+ declare const Modal: react__default.ForwardRefExoticComponent<Omit<react__default.PropsWithChildren<ModalWindowProps>, "ref"> & react__default.RefAttributes<HTMLDivElement>>;
383
+
371
384
  declare function Dropdown(props: DropdownProps): react_jsx_runtime.JSX.Element;
372
385
 
373
386
  declare function Menu(props: MenuProps): react_jsx_runtime.JSX.Element;
@@ -380,17 +393,23 @@ declare const StyledMenuItem: styled_components_dist_types.IStyledComponentBase<
380
393
  ref?: ((instance: HTMLDivElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLDivElement> | null | undefined;
381
394
  }, "color" | "content" | "translate" | "children" | "sx" | "variant" | "slot" | "style" | "title" | "ref" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "component" | "orientation" | "disabled" | "action" | "selected" | "focusVisibleClassName" | keyof _mui_joy.MenuItemSlotsAndSlotProps>, never>>> & string & Omit<_mui_joy.ExtendMenuItem<_mui_joy.MenuItemTypeMap<{}, "div">>, keyof react.Component<any, {}, any>>;
382
395
 
383
- interface ModalWindowProps extends Omit<DrawerProps, "open" | "anchor"> {
384
- side: "left" | "right";
385
- size?: "sm" | "md" | "lg";
386
- open: boolean;
387
- onClose: () => void;
388
- onCloseCompleted?: () => void;
389
- closeRequested?: boolean;
390
- closeBlocked?: boolean;
391
- showCloseButton?: boolean;
396
+ interface NavItem {
397
+ id: string;
398
+ label: string;
399
+ icon?: IconDefinition;
400
+ href?: string;
401
+ isActive?: boolean;
402
+ show?: boolean;
403
+ onClick?: (e: react__default.MouseEvent) => void;
404
+ children?: NavItem[];
392
405
  }
393
- declare const Modal: react__default.ForwardRefExoticComponent<Omit<react__default.PropsWithChildren<ModalWindowProps>, "ref"> & react__default.RefAttributes<HTMLDivElement>>;
406
+ interface PrimaryNavigationProps {
407
+ items: NavItem[];
408
+ sidebarOpen?: boolean;
409
+ onSidebarToggle?: () => void;
410
+ linkComponent?: react__default.ElementType;
411
+ }
412
+ declare function PrimaryNavigation({ items, sidebarOpen, onSidebarToggle, linkComponent: LinkComponent, }: PrimaryNavigationProps): react__default.JSX.Element;
394
413
 
395
414
  declare function Accordion$1(props: AccordionProps$1): react_jsx_runtime.JSX.Element;
396
415
 
@@ -494,4 +513,4 @@ declare const formatText: (text: string | null | undefined) => string;
494
513
  * */
495
514
  declare const formatCurrency: (value: number | string | null | undefined, locale?: string | undefined, options?: Intl.NumberFormatOptions) => string;
496
515
 
497
- export { Accordion$1 as Accordion, AccordionDetails, AccordionGroup, Accordion as AccordionLegacy, AccordionSummary, Alert, AppBar, AutoComplete as Autocomplete, AutocompleteOption, AutocompleteSelectMultiple, Avatar, Badge, Breadcrumb, Button, Card, Checkbox, Chip, ChipIcon, CircularProgress, Container, DateInput as DatePicker, DateTimeInput, Divider, Modal as Drawer, Dropdown, FormControl, FormLabel, FullPageErrorFallback, Grid, Heading, Icon, Input, Layout, List, LoadingSpinner, LogoSVG as Logo, LogoSVGMini as LogoMini, Menu, MenuHeading, StyledMenuItem as MenuItem, Modal$1 as Modal, NavigationProgressProvider, ProgressBar, ProgressCircle, Radio as RadioButton, ReadMore, RelativeTime, Select, Sheet, Skeleton, Slider, StatusIcon, Switch, Table, Tabs, TextBlock, Textarea, ThemeProvider, ToastMessages, Tooltip, Typography, formatCurrency, formatDate, formatNumber, formatText, useFetch, useLocalStorage, useNavigationProgress, useSentryFeedbackOpen, useToggle };
516
+ export { Accordion$1 as Accordion, AccordionDetails, AccordionGroup, Accordion as AccordionLegacy, AccordionSummary, Alert, AppBar, AutoComplete as Autocomplete, AutocompleteOption, AutocompleteSelectMultiple, Avatar, Badge, Breadcrumb, Button, Card, Checkbox, Chip, ChipIcon, CircularProgress, Container, DateInput as DatePicker, DateTimeInput, Divider, Modal as Drawer, Dropdown, FormControl, FormLabel, FullPageErrorFallback, Grid, Heading, Icon, Input, Layout, List, LoadingSpinner, LogoSVG as Logo, LogoSVGMini as LogoMini, Menu, MenuHeading, StyledMenuItem as MenuItem, Modal$1 as Modal, NavigationProgressProvider, PrimaryNavigation, ProgressBar, ProgressCircle, Radio as RadioButton, ReadMore, RelativeTime, Select, Sheet, Skeleton, Slider, StatusIcon, Switch, Table, Tabs, TextBlock, Textarea, ThemeProvider, ToastMessages, Tooltip, Typography, formatCurrency, formatDate, formatNumber, formatText, useFetch, useLocalStorage, useNavigationProgress, useSentryFeedbackOpen, useToggle };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harpercollins/harpercollins-design-system",
3
- "version": "1.28.1",
3
+ "version": "1.29.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@ssh.dev.azure.com:v3/HarperCollinsUK/HCDesignSystem/HCDesignSystem"