@peripheries/core 0.7.0 → 0.8.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/README.md +1 -1
- package/index.css +1 -1
- package/index.js +3 -3
- package/package.json +1 -1
- package/types/core/overlay/Dialog/Dialog.d.ts +2 -1
- package/types/core/overlay/Menu/Menu.d.ts +1 -0
- package/types/core/overlay/Sheet/Sheet.d.ts +3 -2
- package/types/core/overlay/_shared/Modal.d.ts +4 -2
- package/types/core/overlay/_shared/host.d.ts +17 -0
- package/types/core/page/ListRow/ListRow.d.ts +6 -1
- package/types/core/page/PageHead/PageHead.d.ts +2 -1
- package/types/index.core.d.ts +1 -0
package/package.json
CHANGED
|
@@ -5,11 +5,12 @@ export interface SheetBack {
|
|
|
5
5
|
}
|
|
6
6
|
export interface SheetProps {
|
|
7
7
|
open: boolean;
|
|
8
|
-
onClose
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
onOpenChange?: (open: boolean) => void;
|
|
9
10
|
title: ReactNode;
|
|
10
11
|
label?: string;
|
|
11
12
|
description?: ReactNode;
|
|
12
|
-
side?: 'bottom' | 'end';
|
|
13
|
+
side?: 'bottom' | 'end' | 'auto';
|
|
13
14
|
back?: SheetBack;
|
|
14
15
|
initialFocus?: string;
|
|
15
16
|
dismissOnBackdrop?: boolean;
|
|
@@ -2,8 +2,10 @@ import { type ReactNode } from 'react';
|
|
|
2
2
|
export type ModalVariant = 'dialog' | 'sheet-bottom' | 'sheet-end';
|
|
3
3
|
export interface ModalProps {
|
|
4
4
|
variant: ModalVariant;
|
|
5
|
+
kind?: 'sheet' | 'dialog';
|
|
5
6
|
open: boolean;
|
|
6
|
-
onClose
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
onOpenChange?: (open: boolean) => void;
|
|
7
9
|
title: ReactNode;
|
|
8
10
|
label?: string;
|
|
9
11
|
description?: ReactNode;
|
|
@@ -16,4 +18,4 @@ export interface ModalProps {
|
|
|
16
18
|
children?: ReactNode;
|
|
17
19
|
className?: string;
|
|
18
20
|
}
|
|
19
|
-
export declare function Modal(
|
|
21
|
+
export declare function Modal(props: ModalProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
export type OverlayFormat = 'mobile' | 'desktop';
|
|
3
|
+
export interface OverlayHostValue {
|
|
4
|
+
format: OverlayFormat;
|
|
5
|
+
mount?: HTMLElement | null;
|
|
6
|
+
portal?: (node: ReactNode, container: Element) => ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const OVERLAY_DISMISS_EVENT = "core-overlay-dismiss";
|
|
9
|
+
export type OverlayDismissReason = 'escape' | 'outside' | 'shell';
|
|
10
|
+
export declare const dismissReason: (detail: unknown) => OverlayDismissReason;
|
|
11
|
+
export declare function normalizeOverlayHost(value: unknown): OverlayHostValue;
|
|
12
|
+
export declare function OverlayHost({ value, children }: {
|
|
13
|
+
value: unknown;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
}): ReactElement;
|
|
16
|
+
export declare function useOverlayHost(): OverlayHostValue | null;
|
|
17
|
+
export declare function useOverlayFormat(): OverlayFormat;
|
|
@@ -2,12 +2,17 @@ import type { ReactNode, CSSProperties } from 'react';
|
|
|
2
2
|
import { type PressProps } from '../../actions/_shared/press';
|
|
3
3
|
export interface ListRowProps extends Pick<PressProps, 'href' | 'navigate' | 'onClick'> {
|
|
4
4
|
title: ReactNode;
|
|
5
|
+
titleLevel?: number;
|
|
5
6
|
meta?: ReactNode;
|
|
6
7
|
leading?: ReactNode;
|
|
7
8
|
value?: ReactNode;
|
|
8
9
|
trailing?: ReactNode;
|
|
10
|
+
badge?: ReactNode;
|
|
11
|
+
detail?: ReactNode;
|
|
12
|
+
actions?: ReactNode;
|
|
13
|
+
selected?: boolean;
|
|
9
14
|
as?: 'li' | 'div';
|
|
10
15
|
className?: string;
|
|
11
16
|
style?: CSSProperties;
|
|
12
17
|
}
|
|
13
|
-
export declare function ListRow({ title, meta, leading, value, trailing, href, navigate, onClick, as, className, ...rest }: ListRowProps): import("react").JSX.Element;
|
|
18
|
+
export declare function ListRow({ title, titleLevel, meta, leading, value, trailing, badge, detail, actions, selected, href, navigate, onClick, as, className, ...rest }: ListRowProps): import("react").JSX.Element;
|
|
@@ -3,9 +3,10 @@ export interface PageHeadProps {
|
|
|
3
3
|
title: string;
|
|
4
4
|
level?: 1 | 2;
|
|
5
5
|
eyebrow?: string;
|
|
6
|
+
meta?: ReadonlyArray<string>;
|
|
6
7
|
intro?: ReactNode;
|
|
7
8
|
actions?: ReactNode;
|
|
8
9
|
className?: string;
|
|
9
10
|
style?: CSSProperties;
|
|
10
11
|
}
|
|
11
|
-
export declare function PageHead({ title, level, eyebrow, intro, actions, className, ...rest }: PageHeadProps): import("react").JSX.Element;
|
|
12
|
+
export declare function PageHead({ title, level, eyebrow, meta, intro, actions, className, ...rest }: PageHeadProps): import("react").JSX.Element;
|
package/types/index.core.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export { ToastRegion, Toast, dismissToast, toast, useToast, type ToastInput, typ
|
|
|
13
13
|
export { Popover, type Placement, type PopoverProps } from './core/overlay/Popover/Popover';
|
|
14
14
|
export { Dialog, type DialogProps } from './core/overlay/Dialog/Dialog';
|
|
15
15
|
export { Sheet, type SheetBack, type SheetProps } from './core/overlay/Sheet/Sheet';
|
|
16
|
+
export { OverlayHost, OVERLAY_DISMISS_EVENT, useOverlayHost, useOverlayFormat, type OverlayDismissReason, type OverlayFormat, type OverlayHostValue } from './core/overlay/_shared/host';
|
|
16
17
|
export { Spacer } from './core/Spacer/Spacer';
|
|
17
18
|
export { Stack } from './core/Stack/Stack';
|
|
18
19
|
export { ListRow, type ListRowProps } from './core/page/ListRow/ListRow';
|