@harpercollins/harpercollins-design-system 1.16.6 → 1.17.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 +102 -77
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/types/src/components/global/AppBar/AppBar.d.ts +3 -1
- package/dist/cjs/types/src/components/global/AppBar/AppBar.stories.d.ts +1 -0
- package/dist/cjs/types/src/components/global/AppBar/NavigationProgress.d.ts +12 -0
- package/dist/cjs/types/src/contexts/NavigationProgressContext.d.ts +16 -0
- package/dist/cjs/types/src/contexts/index.d.ts +1 -0
- package/dist/cjs/types/src/index.d.ts +1 -0
- package/dist/esm/index.js +171 -146
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/src/components/global/AppBar/AppBar.d.ts +3 -1
- package/dist/esm/types/src/components/global/AppBar/AppBar.stories.d.ts +1 -0
- package/dist/esm/types/src/components/global/AppBar/NavigationProgress.d.ts +12 -0
- package/dist/esm/types/src/contexts/NavigationProgressContext.d.ts +16 -0
- package/dist/esm/types/src/contexts/index.d.ts +1 -0
- package/dist/esm/types/src/index.d.ts +1 -0
- package/dist/index.d.ts +18 -2
- package/package.json +1 -1
|
@@ -18,6 +18,8 @@ interface AppBarProps {
|
|
|
18
18
|
href: string;
|
|
19
19
|
text: string;
|
|
20
20
|
};
|
|
21
|
+
isNavigating?: boolean;
|
|
22
|
+
navigatingProgressDelay?: number;
|
|
21
23
|
mobileMenuPrimary?: JSX.Element;
|
|
22
24
|
mobileMenuSecondary?: JSX.Element;
|
|
23
25
|
user?: {
|
|
@@ -26,5 +28,5 @@ interface AppBarProps {
|
|
|
26
28
|
} | null;
|
|
27
29
|
logoUrl?: string;
|
|
28
30
|
}
|
|
29
|
-
declare function AppBar({ apps, currentApp, leftSide, rightSide, myAccountMenu, workspaces, workspacesMenu, currentWorkspace, helpButton, mobileMenuPrimary, mobileMenuSecondary, user, logoUrl, }: AppBarProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
declare function AppBar({ apps, currentApp, isNavigating, navigatingProgressDelay, leftSide, rightSide, myAccountMenu, workspaces, workspacesMenu, currentWorkspace, helpButton, mobileMenuPrimary, mobileMenuSecondary, user, logoUrl, }: AppBarProps): import("react/jsx-runtime").JSX.Element;
|
|
30
32
|
export default AppBar;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface NavigationProgressProps {
|
|
2
|
+
/**
|
|
3
|
+
* Whether a navigation event is in progress (e.g., page load or route change)
|
|
4
|
+
*/
|
|
5
|
+
isNavigating: boolean | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Delay in milliseconds before showing the progress bar
|
|
8
|
+
*/
|
|
9
|
+
delay?: number;
|
|
10
|
+
}
|
|
11
|
+
declare function NavigationProgress({ isNavigating, delay, }: NavigationProgressProps): JSX.Element | null;
|
|
12
|
+
export default NavigationProgress;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface NavigationProgressState {
|
|
3
|
+
showProgress: boolean;
|
|
4
|
+
completing: boolean;
|
|
5
|
+
width: number;
|
|
6
|
+
}
|
|
7
|
+
interface NavigationProgressContextType {
|
|
8
|
+
progressState: NavigationProgressState;
|
|
9
|
+
setNavigating: (isNavigating: boolean, delay?: number) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const NavigationProgressContext: React.Context<NavigationProgressContextType | undefined>;
|
|
12
|
+
export declare function NavigationProgressProvider({ children, }: {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const useNavigationProgress: () => NavigationProgressContextType;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useNavigationProgress, NavigationProgressProvider, } from "./NavigationProgressContext";
|
package/dist/index.d.ts
CHANGED
|
@@ -44,6 +44,8 @@ interface AppBarProps {
|
|
|
44
44
|
href: string;
|
|
45
45
|
text: string;
|
|
46
46
|
};
|
|
47
|
+
isNavigating?: boolean;
|
|
48
|
+
navigatingProgressDelay?: number;
|
|
47
49
|
mobileMenuPrimary?: JSX.Element;
|
|
48
50
|
mobileMenuSecondary?: JSX.Element;
|
|
49
51
|
user?: {
|
|
@@ -52,7 +54,7 @@ interface AppBarProps {
|
|
|
52
54
|
} | null;
|
|
53
55
|
logoUrl?: string;
|
|
54
56
|
}
|
|
55
|
-
declare function AppBar({ apps, currentApp, leftSide, rightSide, myAccountMenu, workspaces, workspacesMenu, currentWorkspace, helpButton, mobileMenuPrimary, mobileMenuSecondary, user, logoUrl, }: AppBarProps): react_jsx_runtime.JSX.Element;
|
|
57
|
+
declare function AppBar({ apps, currentApp, isNavigating, navigatingProgressDelay, leftSide, rightSide, myAccountMenu, workspaces, workspacesMenu, currentWorkspace, helpButton, mobileMenuPrimary, mobileMenuSecondary, user, logoUrl, }: AppBarProps): react_jsx_runtime.JSX.Element;
|
|
56
58
|
|
|
57
59
|
interface BaseOption {
|
|
58
60
|
label: string;
|
|
@@ -347,6 +349,20 @@ declare function Tooltip({ children, maxWidth, ...props }: React.PropsWithChildr
|
|
|
347
349
|
|
|
348
350
|
declare function Typography(props: TypographyProps): react_jsx_runtime.JSX.Element;
|
|
349
351
|
|
|
352
|
+
interface NavigationProgressState {
|
|
353
|
+
showProgress: boolean;
|
|
354
|
+
completing: boolean;
|
|
355
|
+
width: number;
|
|
356
|
+
}
|
|
357
|
+
interface NavigationProgressContextType {
|
|
358
|
+
progressState: NavigationProgressState;
|
|
359
|
+
setNavigating: (isNavigating: boolean, delay?: number) => void;
|
|
360
|
+
}
|
|
361
|
+
declare function NavigationProgressProvider({ children, }: {
|
|
362
|
+
children: React__default.ReactNode;
|
|
363
|
+
}): react_jsx_runtime.JSX.Element;
|
|
364
|
+
declare const useNavigationProgress: () => NavigationProgressContextType;
|
|
365
|
+
|
|
350
366
|
/**
|
|
351
367
|
* A hook to toggle a boolean value.
|
|
352
368
|
* @param initialState The initial state of the toggle.
|
|
@@ -417,4 +433,4 @@ declare const formatText: (text: string | null | undefined) => string;
|
|
|
417
433
|
* */
|
|
418
434
|
declare const formatCurrency: (value: number | string | null | undefined, locale?: string | undefined, options?: Intl.NumberFormatOptions) => string;
|
|
419
435
|
|
|
420
|
-
export { Accordion$1 as Accordion, AccordionDetails, AccordionGroup, Accordion as AccordionLegacy, AccordionSummary, 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, FormLabel, 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, Slider, StatusIcon, Switch, Table, Tabs, TextBlock, Textarea, ThemeProvider, ToastMessages, Tooltip, Typography, formatCurrency, formatDate, formatNumber, formatText, useFetch, useLocalStorage, useSentryFeedbackOpen, useToggle };
|
|
436
|
+
export { Accordion$1 as Accordion, AccordionDetails, AccordionGroup, Accordion as AccordionLegacy, AccordionSummary, 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, FormLabel, FullPageErrorFallback, Grid, Heading, Icon, Input, Layout, List, LoadingSpinner, LogoSVG as Logo, LogoSVGMini as LogoMini, Menu, MenuHeading, StyledMenuItem as MenuItem, NavigationProgressProvider, ProgressBar, ProgressCircle, Radio as RadioButton, ReadMore, RelativeTime, Slider, StatusIcon, Switch, Table, Tabs, TextBlock, Textarea, ThemeProvider, ToastMessages, Tooltip, Typography, formatCurrency, formatDate, formatNumber, formatText, useFetch, useLocalStorage, useNavigationProgress, useSentryFeedbackOpen, useToggle };
|