@plexui/ui 0.28.1 → 0.30.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/es/components/Alert/Alert.js +2 -2
- package/dist/es/components/Alert/Alert.js.map +1 -1
- package/dist/es/components/Avatar/Avatar.js +3 -1
- package/dist/es/components/Avatar/Avatar.js.map +1 -1
- package/dist/es/components/Badge/index.js +1 -1
- package/dist/es/components/Badge/index.js.map +1 -1
- package/dist/es/components/Button/Button.js +4 -3
- package/dist/es/components/Button/Button.js.map +1 -1
- package/dist/es/components/Button/NavigationButton.js +10 -0
- package/dist/es/components/Button/NavigationButton.js.map +1 -0
- package/dist/es/components/Button/NavigationGlyph.js +19 -0
- package/dist/es/components/Button/NavigationGlyph.js.map +1 -0
- package/dist/es/components/Button/index.js +1 -0
- package/dist/es/components/Button/index.js.map +1 -1
- package/dist/es/components/Checkbox/Checkbox.js +2 -1
- package/dist/es/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/es/components/ColorPicker/ColorPicker.js +227 -0
- package/dist/es/components/ColorPicker/ColorPicker.js.map +1 -0
- package/dist/es/components/ColorPicker/ColorWell.js +58 -0
- package/dist/es/components/ColorPicker/ColorWell.js.map +1 -0
- package/dist/es/components/ColorPicker/index.js +3 -0
- package/dist/es/components/ColorPicker/index.js.map +1 -0
- package/dist/es/components/ColorPicker/shared.js +132 -0
- package/dist/es/components/ColorPicker/shared.js.map +1 -0
- package/dist/es/components/ContextMenu/ContextMenu.js +164 -0
- package/dist/es/components/ContextMenu/ContextMenu.js.map +1 -0
- package/dist/es/components/ContextMenu/index.js +2 -0
- package/dist/es/components/ContextMenu/index.js.map +1 -0
- package/dist/es/components/ContextMenu/shared.js +56 -0
- package/dist/es/components/ContextMenu/shared.js.map +1 -0
- package/dist/es/components/DateInput/DateInput.js +4 -2
- package/dist/es/components/DateInput/DateInput.js.map +1 -1
- package/dist/es/components/DatePicker/Calendar.js +89 -55
- package/dist/es/components/DatePicker/Calendar.js.map +1 -1
- package/dist/es/components/DatePicker/CalendarNavigationIcon.js +13 -0
- package/dist/es/components/DatePicker/CalendarNavigationIcon.js.map +1 -0
- package/dist/es/components/DatePicker/DatePicker.js +9 -2
- package/dist/es/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/es/components/DatePicker/useCalendarGutter.js +8 -0
- package/dist/es/components/DatePicker/useCalendarGutter.js.map +1 -0
- package/dist/es/components/DateRangePicker/Calendar.js +66 -49
- package/dist/es/components/DateRangePicker/Calendar.js.map +1 -1
- package/dist/es/components/DateRangePicker/DateRangePicker.js +6 -1
- package/dist/es/components/DateRangePicker/DateRangePicker.js.map +1 -1
- package/dist/es/components/DateRangePicker/Trigger.js +1 -1
- package/dist/es/components/DateRangePicker/Trigger.js.map +1 -1
- package/dist/es/components/Dialog/Dialog.js +136 -20
- package/dist/es/components/Dialog/Dialog.js.map +1 -1
- package/dist/es/components/Dialog/index.js.map +1 -1
- package/dist/es/components/Dialog/sheetDrag.js +77 -24
- package/dist/es/components/Dialog/sheetDrag.js.map +1 -1
- package/dist/es/components/Field/Field.js +51 -4
- package/dist/es/components/Field/Field.js.map +1 -1
- package/dist/es/components/FieldGroup/FieldGroup.js +4 -2
- package/dist/es/components/FieldGroup/FieldGroup.js.map +1 -1
- package/dist/es/components/FileUpload/FileUpload.js +43 -3
- package/dist/es/components/FileUpload/FileUpload.js.map +1 -1
- package/dist/es/components/FloatingLabelInput/FloatingLabelInput.js +18 -16
- package/dist/es/components/FloatingLabelInput/FloatingLabelInput.js.map +1 -1
- package/dist/es/components/FloatingLabelSelect/FloatingLabelSelect.js +11 -6
- package/dist/es/components/FloatingLabelSelect/FloatingLabelSelect.js.map +1 -1
- package/dist/es/components/Icon/index.js +2 -0
- package/dist/es/components/Icon/index.js.map +1 -1
- package/dist/es/components/Icon/svg/Disclosure.js +5 -0
- package/dist/es/components/Icon/svg/Disclosure.js.map +1 -0
- package/dist/es/components/Icon/svg/Eyedropper.js +6 -0
- package/dist/es/components/Icon/svg/Eyedropper.js.map +1 -0
- package/dist/es/components/Indicator/LoadingIndicator.js +1 -1
- package/dist/es/components/Indicator/LoadingIndicator.js.map +1 -1
- package/dist/es/components/Input/Input.js +3 -3
- package/dist/es/components/Input/Input.js.map +1 -1
- package/dist/es/components/InputGroup/InputGroup.js +3 -1
- package/dist/es/components/InputGroup/InputGroup.js.map +1 -1
- package/dist/es/components/MarkdownEditor/MarkdownEditor.js +95 -93
- package/dist/es/components/MarkdownEditor/MarkdownEditor.js.map +1 -1
- package/dist/es/components/Menu/Menu.js +306 -34
- package/dist/es/components/Menu/Menu.js.map +1 -1
- package/dist/es/components/OTPInput/OTPInput.js +4 -1
- package/dist/es/components/OTPInput/OTPInput.js.map +1 -1
- package/dist/es/components/Page/Page.js +147 -19
- package/dist/es/components/Page/Page.js.map +1 -1
- package/dist/es/components/Page/index.js.map +1 -1
- package/dist/es/components/PageControl/PageControl.js +146 -0
- package/dist/es/components/PageControl/PageControl.js.map +1 -0
- package/dist/es/components/PageControl/index.js +2 -0
- package/dist/es/components/PageControl/index.js.map +1 -0
- package/dist/es/components/Popover/Popover.js +75 -33
- package/dist/es/components/Popover/Popover.js.map +1 -1
- package/dist/es/components/Popover/deferredOutsidePress.js +90 -0
- package/dist/es/components/Popover/deferredOutsidePress.js.map +1 -0
- package/dist/es/components/Popover/usePopoverContext.js.map +1 -1
- package/dist/es/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/es/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/es/components/Select/Select.js +98 -32
- package/dist/es/components/Select/Select.js.map +1 -1
- package/dist/es/components/SelectControl/SelectControl.js +48 -29
- package/dist/es/components/SelectControl/SelectControl.js.map +1 -1
- package/dist/es/components/SelectControl/index.js +1 -1
- package/dist/es/components/SelectControl/index.js.map +1 -1
- package/dist/es/components/ShimmerText/ShimmerText.js +17 -7
- package/dist/es/components/ShimmerText/ShimmerText.js.map +1 -1
- package/dist/es/components/Sidebar/Sidebar.js +21 -8
- package/dist/es/components/Sidebar/Sidebar.js.map +1 -1
- package/dist/es/components/Slider/Slider.js +61 -15
- package/dist/es/components/Slider/Slider.js.map +1 -1
- package/dist/es/components/Sortable/Sortable.js +16 -6
- package/dist/es/components/Sortable/Sortable.js.map +1 -1
- package/dist/es/components/Stepper/Stepper.js +114 -0
- package/dist/es/components/Stepper/Stepper.js.map +1 -0
- package/dist/es/components/Stepper/index.js +2 -0
- package/dist/es/components/Stepper/index.js.map +1 -0
- package/dist/es/components/Switch/Switch.js +2 -2
- package/dist/es/components/Switch/Switch.js.map +1 -1
- package/dist/es/components/TabBar/TabBar.js +128 -0
- package/dist/es/components/TabBar/TabBar.js.map +1 -0
- package/dist/es/components/TabBar/index.js +2 -0
- package/dist/es/components/TabBar/index.js.map +1 -0
- package/dist/es/components/Tabs/Tabs.js +27 -11
- package/dist/es/components/Tabs/Tabs.js.map +1 -1
- package/dist/es/components/TagInput/TagInput.js +40 -4
- package/dist/es/components/TagInput/TagInput.js.map +1 -1
- package/dist/es/components/Textarea/Textarea.js +7 -1
- package/dist/es/components/Textarea/Textarea.js.map +1 -1
- package/dist/es/components/Toast/ToastRenderer.js +86 -0
- package/dist/es/components/Toast/ToastRenderer.js.map +1 -0
- package/dist/es/components/Toast/Toaster.js +31 -16
- package/dist/es/components/Toast/Toaster.js.map +1 -1
- package/dist/es/components/Toast/toastLifecycle.js +283 -0
- package/dist/es/components/Toast/toastLifecycle.js.map +1 -0
- package/dist/es/components/Toolbar/Toolbar.js +92 -0
- package/dist/es/components/Toolbar/Toolbar.js.map +1 -0
- package/dist/es/components/Toolbar/index.js +2 -0
- package/dist/es/components/Toolbar/index.js.map +1 -0
- package/dist/es/components/Tooltip/CopyTooltip.js +37 -11
- package/dist/es/components/Tooltip/CopyTooltip.js.map +1 -1
- package/dist/es/components/Tooltip/Tooltip.js +61 -9
- package/dist/es/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/es/hooks/useFloatingBoundary.js +35 -0
- package/dist/es/hooks/useFloatingBoundary.js.map +1 -0
- package/dist/es/hooks/usePhoneSubmenu.js +22 -0
- package/dist/es/hooks/usePhoneSubmenu.js.map +1 -0
- package/dist/es/lib/copyToClipboard.js +16 -7
- package/dist/es/lib/copyToClipboard.js.map +1 -1
- package/dist/es/lib/fieldRow.js +7 -1
- package/dist/es/lib/fieldRow.js.map +1 -1
- package/dist/es/lib/floatingBoundary.js +90 -0
- package/dist/es/lib/floatingBoundary.js.map +1 -0
- package/dist/es/lib/focusRestore.js +56 -0
- package/dist/es/lib/focusRestore.js.map +1 -0
- package/dist/es/lib/helpers.js +0 -18
- package/dist/es/lib/helpers.js.map +1 -1
- package/dist/es/lib/inputMode.js +9 -0
- package/dist/es/lib/inputMode.js.map +1 -0
- package/dist/es/lib/menuInitialFocus.js +100 -0
- package/dist/es/lib/menuInitialFocus.js.map +1 -0
- package/dist/es/lib/menuSubmenuPlacement.js +264 -0
- package/dist/es/lib/menuSubmenuPlacement.js.map +1 -0
- package/dist/es/lib/menuTriggerCover.js +70 -0
- package/dist/es/lib/menuTriggerCover.js.map +1 -0
- package/dist/es/lib/observeTextareaWidth.js +49 -0
- package/dist/es/lib/observeTextareaWidth.js.map +1 -0
- package/dist/es/lib/scrollEdges.js +34 -0
- package/dist/es/lib/scrollEdges.js.map +1 -0
- package/dist/es/lib/selectPress.js +34 -0
- package/dist/es/lib/selectPress.js.map +1 -0
- package/dist/es/lib/sortable.js +74 -20
- package/dist/es/lib/sortable.js.map +1 -1
- package/dist/es/styles/mobile-materials.css +1 -0
- package/dist/es/styles/mobile-surfaces.css +1 -0
- package/dist/types/components/Button/Button.d.ts +2 -0
- package/dist/types/components/Button/NavigationButton.d.ts +8 -0
- package/dist/types/components/Button/NavigationGlyph.d.ts +7 -0
- package/dist/types/components/Button/index.d.ts +1 -0
- package/dist/types/components/ColorPicker/ColorPicker.d.ts +34 -0
- package/dist/types/components/ColorPicker/ColorWell.d.ts +32 -0
- package/dist/types/components/ColorPicker/index.d.ts +3 -0
- package/dist/types/components/ColorPicker/shared.d.ts +69 -0
- package/dist/types/components/ContextMenu/ContextMenu.d.ts +78 -0
- package/dist/types/components/ContextMenu/index.d.ts +1 -0
- package/dist/types/components/ContextMenu/shared.d.ts +50 -0
- package/dist/types/components/DatePicker/CalendarNavigationIcon.d.ts +5 -0
- package/dist/types/components/DatePicker/DatePicker.d.ts +7 -1
- package/dist/types/components/DatePicker/useCalendarGutter.d.ts +1 -0
- package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +2 -0
- package/dist/types/components/Dialog/Dialog.d.ts +17 -6
- package/dist/types/components/Dialog/index.d.ts +1 -1
- package/dist/types/components/Field/Field.d.ts +12 -2
- package/dist/types/components/FieldGroup/FieldGroup.d.ts +11 -2
- package/dist/types/components/Icon/index.d.ts +2 -0
- package/dist/types/components/Icon/svg/Disclosure.d.ts +6 -0
- package/dist/types/components/Icon/svg/Eyedropper.d.ts +6 -0
- package/dist/types/components/Indicator/LoadingIndicator.d.ts +1 -1
- package/dist/types/components/Menu/Menu.d.ts +74 -9
- package/dist/types/components/Page/Page.d.ts +24 -9
- package/dist/types/components/Page/index.d.ts +1 -1
- package/dist/types/components/PageControl/PageControl.d.ts +52 -0
- package/dist/types/components/PageControl/index.d.ts +1 -0
- package/dist/types/components/Popover/Popover.d.ts +11 -6
- package/dist/types/components/Popover/deferredOutsidePress.d.ts +14 -0
- package/dist/types/components/Popover/usePopoverContext.d.ts +1 -0
- package/dist/types/components/Select/Select.d.ts +3 -3
- package/dist/types/components/SelectControl/SelectControl.d.ts +2 -2
- package/dist/types/components/SelectControl/index.d.ts +1 -1
- package/dist/types/components/Sortable/Sortable.d.ts +1 -1
- package/dist/types/components/Stepper/Stepper.d.ts +56 -0
- package/dist/types/components/Stepper/index.d.ts +1 -0
- package/dist/types/components/Switch/Switch.d.ts +3 -1
- package/dist/types/components/TabBar/TabBar.d.ts +74 -0
- package/dist/types/components/TabBar/index.d.ts +1 -0
- package/dist/types/components/Toast/ToastRenderer.d.ts +3 -0
- package/dist/types/components/Toast/Toaster.d.ts +4 -2
- package/dist/types/components/Toast/toastLifecycle.d.ts +90 -0
- package/dist/types/components/Toolbar/Toolbar.d.ts +93 -0
- package/dist/types/components/Toolbar/index.d.ts +1 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts +2 -2
- package/dist/types/hooks/useFloatingBoundary.d.ts +24 -0
- package/dist/types/hooks/usePhoneSubmenu.d.ts +3 -0
- package/dist/types/lib/fieldRow.d.ts +6 -0
- package/dist/types/lib/floatingBoundary.d.ts +9 -0
- package/dist/types/lib/focusRestore.d.ts +5 -0
- package/dist/types/lib/helpers.d.ts +1 -5
- package/dist/types/lib/inputMode.d.ts +7 -0
- package/dist/types/lib/menuInitialFocus.d.ts +9 -0
- package/dist/types/lib/menuSubmenuPlacement.d.ts +57 -0
- package/dist/types/lib/menuTriggerCover.d.ts +23 -0
- package/dist/types/lib/observeTextareaWidth.d.ts +2 -0
- package/dist/types/lib/scrollEdges.d.ts +16 -0
- package/dist/types/lib/selectPress.d.ts +23 -0
- package/dist/types/lib/sortable.d.ts +1 -1
- package/package.json +6 -2
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { type HTMLAttributes, type Ref } from "react";
|
|
2
|
+
import { type BarBackground } from "../Toolbar/Toolbar.js";
|
|
3
|
+
/** How a phone bar of the page meets the content scrolled under it; see `BarBackground`. */
|
|
4
|
+
export type PageBarBackground = BarBackground;
|
|
2
5
|
export type PageWidth = "full" | "wide" | "column";
|
|
3
6
|
export type PageProps = HTMLAttributes<HTMLDivElement> & {
|
|
4
7
|
/**
|
|
@@ -11,32 +14,41 @@ export type PageProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
11
14
|
* @default "full"
|
|
12
15
|
*/
|
|
13
16
|
width?: PageWidth;
|
|
17
|
+
/** Mobile canvas and grouped-field palette. @default "plain" */
|
|
18
|
+
surface?: "plain" | "grouped";
|
|
14
19
|
ref?: Ref<HTMLDivElement>;
|
|
15
20
|
};
|
|
16
|
-
declare function PageRoot({ width, className, children, ...restProps }: PageProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare function PageRoot({ width, surface, className, children, style, ref, ...restProps }: PageProps): import("react/jsx-runtime").JSX.Element;
|
|
17
22
|
declare namespace PageRoot {
|
|
18
23
|
var displayName: string;
|
|
19
24
|
}
|
|
20
25
|
export type PageHeaderProps = HTMLAttributes<HTMLDivElement> & {
|
|
21
26
|
/**
|
|
22
|
-
* Shows
|
|
27
|
+
* Shows a divider once the content has scrolled under the header: on a desktop layout, and on a phone
|
|
28
|
+
* with a `"hard"` or `"glass"` background.
|
|
23
29
|
* Turn it off when the content already draws a line of its own at that place.
|
|
24
30
|
* @default true
|
|
25
31
|
*/
|
|
26
32
|
divider?: boolean;
|
|
33
|
+
/** How the bar meets the content scrolled under it on a phone. @default "soft" */
|
|
34
|
+
background?: PageBarBackground;
|
|
27
35
|
ref?: Ref<HTMLDivElement>;
|
|
28
36
|
};
|
|
29
|
-
declare function PageHeader({ divider, className, children, ...restProps }: PageHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
declare function PageHeader({ divider, background, className, children, ref, ...restProps }: PageHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
30
38
|
declare namespace PageHeader {
|
|
31
39
|
var displayName: string;
|
|
32
40
|
}
|
|
33
41
|
export type PageSlotProps = HTMLAttributes<HTMLDivElement> & {
|
|
34
42
|
ref?: Ref<HTMLDivElement>;
|
|
35
43
|
};
|
|
36
|
-
declare function PageBar({ className, ...restProps }: PageSlotProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
declare function PageBar({ className, ref, ...restProps }: PageSlotProps): import("react/jsx-runtime").JSX.Element;
|
|
37
45
|
declare namespace PageBar {
|
|
38
46
|
var displayName: string;
|
|
39
47
|
}
|
|
48
|
+
declare function PageLeading({ className, ...restProps }: PageSlotProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
declare namespace PageLeading {
|
|
50
|
+
var displayName: string;
|
|
51
|
+
}
|
|
40
52
|
declare function PageHeading({ className, ...restProps }: PageSlotProps): import("react/jsx-runtime").JSX.Element;
|
|
41
53
|
declare namespace PageHeading {
|
|
42
54
|
var displayName: string;
|
|
@@ -47,9 +59,7 @@ declare function PageTitle({ className, ...restProps }: HTMLAttributes<HTMLHeadi
|
|
|
47
59
|
declare namespace PageTitle {
|
|
48
60
|
var displayName: string;
|
|
49
61
|
}
|
|
50
|
-
declare function PageSubtitle({ className, ...restProps }:
|
|
51
|
-
ref?: Ref<HTMLParagraphElement>;
|
|
52
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
declare function PageSubtitle({ className, ...restProps }: PageSlotProps): import("react/jsx-runtime").JSX.Element;
|
|
53
63
|
declare namespace PageSubtitle {
|
|
54
64
|
var displayName: string;
|
|
55
65
|
}
|
|
@@ -66,18 +76,23 @@ export type PageContentProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
66
76
|
fill?: boolean;
|
|
67
77
|
ref?: Ref<HTMLDivElement>;
|
|
68
78
|
};
|
|
69
|
-
declare function PageContent({ fill, className, children, onScroll, ...restProps }: PageContentProps): import("react/jsx-runtime").JSX.Element;
|
|
79
|
+
declare function PageContent({ fill, className, children, onScroll, ref, ...restProps }: PageContentProps): import("react/jsx-runtime").JSX.Element;
|
|
70
80
|
declare namespace PageContent {
|
|
71
81
|
var displayName: string;
|
|
72
82
|
}
|
|
83
|
+
export type PageFooterProps = PageSlotProps & {
|
|
84
|
+
/** How the bar meets the content scrolled under it on a phone. @default "soft" */
|
|
85
|
+
background?: PageBarBackground;
|
|
86
|
+
};
|
|
73
87
|
/** Actions that remain below the scrolling content, inside the page's safe area. */
|
|
74
|
-
declare function PageFooter({ className, children, ...restProps }:
|
|
88
|
+
declare function PageFooter({ className, children, background, ref, ...restProps }: PageFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
75
89
|
declare namespace PageFooter {
|
|
76
90
|
var displayName: string;
|
|
77
91
|
}
|
|
78
92
|
export declare const Page: typeof PageRoot & {
|
|
79
93
|
Header: typeof PageHeader;
|
|
80
94
|
Bar: typeof PageBar;
|
|
95
|
+
Leading: typeof PageLeading;
|
|
81
96
|
Heading: typeof PageHeading;
|
|
82
97
|
Title: typeof PageTitle;
|
|
83
98
|
Subtitle: typeof PageSubtitle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Page, type PageContentProps, type PageHeaderProps, type PageProps, type PageSlotProps, type PageWidth, } from "./Page.js";
|
|
1
|
+
export { Page, type PageBarBackground, type PageFooterProps, type PageContentProps, type PageHeaderProps, type PageProps, type PageSlotProps, type PageWidth, } from "./Page.js";
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type FocusEventHandler } from "react";
|
|
2
|
+
/** How an indicator shows: full size, one of the two shrinking sizes past the window, or hidden. */
|
|
3
|
+
export type PageControlDotSize = "full" | "small" | "smaller" | "hidden";
|
|
4
|
+
export type PageControlChangeDetails = {
|
|
5
|
+
/** The change came from scrubbing: show the page without the scrolling animation, as the HIG asks. */
|
|
6
|
+
scrubbing: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type PageControlProps = {
|
|
9
|
+
/** The `id` of the page control. */
|
|
10
|
+
id?: string;
|
|
11
|
+
/** The number of pages. */
|
|
12
|
+
count: number;
|
|
13
|
+
/** The controlled index of the current page, from 0. Use with `onChange`. */
|
|
14
|
+
value?: number;
|
|
15
|
+
/** The index of the page when it is initially rendered. Use when you do not need to control the page. @default 0 */
|
|
16
|
+
defaultValue?: number;
|
|
17
|
+
/** Called with the index of the next page. */
|
|
18
|
+
onChange?: (index: number, details: PageControlChangeDetails) => void;
|
|
19
|
+
/**
|
|
20
|
+
* The rounded background behind the indicators: `automatic` shows it while a pointer presses or scrubs,
|
|
21
|
+
* `prominent` always, `minimal` never and turns off scrubbing, as in iOS. @default "automatic"
|
|
22
|
+
*/
|
|
23
|
+
background?: "automatic" | "prominent" | "minimal";
|
|
24
|
+
/** The text assistive technology reads for the current page. @default (index, count) => `Page ${index + 1} of ${count}` */
|
|
25
|
+
valueText?: (index: number, count: number) => string;
|
|
26
|
+
/** Accessible name of the page control, when no visible label names it. @default "Pages" */
|
|
27
|
+
"aria-label"?: string;
|
|
28
|
+
/** The `id` of the visible label of the page control. */
|
|
29
|
+
"aria-labelledby"?: string;
|
|
30
|
+
/** The `id` of the element that shows the pages. */
|
|
31
|
+
"aria-controls"?: string;
|
|
32
|
+
/** Event handler called when the page control gains focus. */
|
|
33
|
+
onFocus?: FocusEventHandler<HTMLDivElement>;
|
|
34
|
+
/** Event handler called when the page control loses focus. */
|
|
35
|
+
onBlur?: FocusEventHandler<HTMLDivElement>;
|
|
36
|
+
/** CSS classes applied to the page control */
|
|
37
|
+
className?: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* The size of each indicator, after the variants of the iOS 26 kit Page control (507:24679). Up to six pages
|
|
41
|
+
* show full size. Seven show six, and the one past them at 6px. From eight a window of full dots holds the current
|
|
42
|
+
* page: six at either end, otherwise five with the current one in the middle, and the two dots past each side of
|
|
43
|
+
* the window shrink to 6px and 4px; the rest hide.
|
|
44
|
+
*/
|
|
45
|
+
export declare const pageControlDots: (count: number, current: number) => PageControlDotSize[];
|
|
46
|
+
/**
|
|
47
|
+
* A row of dots, one for each page, the current one solid, as the iOS 26 page control. Tapping the leading or
|
|
48
|
+
* trailing side of the current dot shows the previous or next page; a mouse or pen picks a dot. Dragging across
|
|
49
|
+
* scrubs page by page, and past either end goes to the first or last page. It is a slider for assistive
|
|
50
|
+
* technology: Left and Right (or Up and Down) move one page, Home and End go to the first and last.
|
|
51
|
+
*/
|
|
52
|
+
export declare function PageControl({ id, count, value: valueProp, defaultValue, onChange, background, valueText, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-controls": ariaControls, onFocus, onBlur, className, }: PageControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PageControl, pageControlDots, type PageControlChangeDetails, type PageControlDotSize, type PageControlProps } from "./PageControl.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Popper from "@radix-ui/react-popper";
|
|
2
2
|
import { type MouseEventHandler, type PointerEventHandler, type ReactNode } from "react";
|
|
3
3
|
export type PopoverProps = {
|
|
4
4
|
/** Sets controlled visibility state */
|
|
@@ -21,10 +21,15 @@ export declare const Popover: {
|
|
|
21
21
|
export type PopoverContentProps = {
|
|
22
22
|
children: ReactNode;
|
|
23
23
|
/**
|
|
24
|
-
* Whether to avoid collisions with
|
|
24
|
+
* Whether to avoid collisions with the viewport and scroll containers.
|
|
25
25
|
* @default true
|
|
26
26
|
*/
|
|
27
27
|
avoidCollisions?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Distance in pixels to keep from viewport and scroll container boundaries.
|
|
30
|
+
* @default 20
|
|
31
|
+
*/
|
|
32
|
+
collisionPadding?: number;
|
|
28
33
|
/**
|
|
29
34
|
* Set the `width` of the popover, in pixels.
|
|
30
35
|
* @default auto
|
|
@@ -47,22 +52,22 @@ export type PopoverContentProps = {
|
|
|
47
52
|
* The preferred side of the trigger to render against when open. Will be reversed when collisions occur.
|
|
48
53
|
* @default bottom
|
|
49
54
|
*/
|
|
50
|
-
side?:
|
|
55
|
+
side?: Popper.PopperContentProps["side"];
|
|
51
56
|
/**
|
|
52
57
|
* The distance in pixels from the trigger.
|
|
53
58
|
* @default 8
|
|
54
59
|
*/
|
|
55
|
-
sideOffset?:
|
|
60
|
+
sideOffset?: Popper.PopperContentProps["sideOffset"];
|
|
56
61
|
/**
|
|
57
62
|
* The preferred alignment against the trigger. May change when collisions occur.
|
|
58
63
|
* @default center
|
|
59
64
|
*/
|
|
60
|
-
align?:
|
|
65
|
+
align?: Popper.PopperContentProps["align"];
|
|
61
66
|
/**
|
|
62
67
|
* An offset in pixels from the "start" or "end" alignment options.
|
|
63
68
|
* @default 0
|
|
64
69
|
*/
|
|
65
|
-
alignOffset?:
|
|
70
|
+
alignOffset?: Popper.PopperContentProps["alignOffset"];
|
|
66
71
|
/**
|
|
67
72
|
* Whether the popover surface should be translucent.
|
|
68
73
|
* @default false
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
type OutsidePointerEvent = CustomEvent<{
|
|
3
|
+
originalEvent: PointerEvent;
|
|
4
|
+
}>;
|
|
5
|
+
export declare const usePopoverDismissableSurface: () => (node: HTMLElement | null) => void;
|
|
6
|
+
/** Defers only the outside press delivered by Radix's public layer/branch filter. */
|
|
7
|
+
export declare const useDeferredOutsidePress: (dismiss: () => void, triggerRef: RefObject<HTMLElement | null>) => {
|
|
8
|
+
onPointerDownOutside: (event: OutsidePointerEvent) => void;
|
|
9
|
+
onFocusOutside: (event: CustomEvent<{
|
|
10
|
+
originalEvent: FocusEvent;
|
|
11
|
+
}>) => void;
|
|
12
|
+
reset: () => void;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -176,7 +176,7 @@ export type SelectProps<T extends Option> = (SingleSelectProps<T> | MultiSelectP
|
|
|
176
176
|
side?: PopoverSide;
|
|
177
177
|
/**
|
|
178
178
|
* The preferred alignment against the trigger. May change when collisions occur.
|
|
179
|
-
* @default center
|
|
179
|
+
* @default "end" at the end of a `Field row` ("start" in a `FieldGroup columns`), "center" when block, otherwise "start"
|
|
180
180
|
*/
|
|
181
181
|
align?: PopoverAlign;
|
|
182
182
|
/**
|
|
@@ -191,7 +191,7 @@ export type SelectProps<T extends Option> = (SingleSelectProps<T> | MultiSelectP
|
|
|
191
191
|
avoidCollisions?: boolean;
|
|
192
192
|
/**
|
|
193
193
|
* Set the width of the custom select menu
|
|
194
|
-
* @default the width of the trigger (fits the options when not block)
|
|
194
|
+
* @default the width of the trigger (fits the options when not block or at the end of a `Field row`)
|
|
195
195
|
*/
|
|
196
196
|
listWidth?: number | "auto";
|
|
197
197
|
/**
|
|
@@ -201,7 +201,7 @@ export type SelectProps<T extends Option> = (SingleSelectProps<T> | MultiSelectP
|
|
|
201
201
|
listMinWidth?: number | "auto";
|
|
202
202
|
/**
|
|
203
203
|
* Defines the `max-width` property of the custom select menu, in pixels.
|
|
204
|
-
* @default auto (300 when
|
|
204
|
+
* @default auto (300 when it fits the options)
|
|
205
205
|
*/
|
|
206
206
|
listMaxWidth?: number | "auto";
|
|
207
207
|
/** Predicate used to filter searches */
|
|
@@ -79,9 +79,9 @@ export type SelectControlProps = Omit<React.HTMLAttributes<HTMLSpanElement>, "on
|
|
|
79
79
|
children: ReactNode;
|
|
80
80
|
ref?: React.Ref<HTMLSpanElement | null>;
|
|
81
81
|
};
|
|
82
|
-
export declare const SelectControl: ({ ref, onPointerDown, onKeyDown, onPointerEnter, onInteract, interactOnEnter, invalid, disabled, children, className, variant, size, block, opticallyAlign, pill, loading, onClearClick, selected, StartIcon, dropdownIconType, ...restProps }: SelectControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
82
|
+
export declare const SelectControl: ({ ref, onPointerDown, onPointerCancel, onKeyDown, onPointerEnter, onInteract, interactOnEnter, invalid, disabled, children, className, variant, size, block, opticallyAlign, pill, loading, onClearClick, selected, StartIcon, dropdownIconType, ...restProps }: SelectControlProps) => import("react/jsx-runtime").JSX.Element;
|
|
83
83
|
type DropdownIconProps = {
|
|
84
|
-
iconType:
|
|
84
|
+
iconType: Exclude<DropdownIconType, "none">;
|
|
85
85
|
};
|
|
86
86
|
export declare const DropdownIcon: ({ iconType }: DropdownIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
87
87
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { SelectControl, type DropdownIconType, type SelectControlProps } from "./SelectControl.js";
|
|
1
|
+
export { SelectControl, DropdownIcon, type DropdownIconType, type SelectControlProps } from "./SelectControl.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ComponentProps, type ElementType, type ReactNode } from "react";
|
|
2
2
|
import { type SortableLayout, type SortableMove } from "../../lib/sortable.js";
|
|
3
3
|
export type SortableProps<T> = {
|
|
4
4
|
/**
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type FocusEventHandler } from "react";
|
|
2
|
+
export type StepperProps = {
|
|
3
|
+
/** The `id` of the stepper. */
|
|
4
|
+
id?: string;
|
|
5
|
+
/** The controlled value. Use with `onChange`. */
|
|
6
|
+
value?: number;
|
|
7
|
+
/** The value when it is initially rendered. Use when you do not need to control the value. @default min */
|
|
8
|
+
defaultValue?: number;
|
|
9
|
+
/** Called with the next value after a step. */
|
|
10
|
+
onChange?: (value: number) => void;
|
|
11
|
+
/** The lowest value. @default 0 */
|
|
12
|
+
min?: number;
|
|
13
|
+
/** The highest value. @default 100 */
|
|
14
|
+
max?: number;
|
|
15
|
+
/** The amount each step adds or removes. @default 1 */
|
|
16
|
+
step?: number;
|
|
17
|
+
/** A step past `max` continues from `min`, and one below `min` from `max`. @default false */
|
|
18
|
+
wrap?: boolean;
|
|
19
|
+
/** Holding a segment keeps stepping, as a native stepper does. @default true */
|
|
20
|
+
autoRepeat?: boolean;
|
|
21
|
+
/** When `true`, prevents the user from interacting with the stepper. */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** Fully rounded ends. @default true */
|
|
24
|
+
pill?: boolean;
|
|
25
|
+
/** Accessible name of the decrement segment. @default "Decrease" */
|
|
26
|
+
decrementLabel?: string;
|
|
27
|
+
/** Accessible name of the increment segment. @default "Increase" */
|
|
28
|
+
incrementLabel?: string;
|
|
29
|
+
/** The name of the stepper. Submits its value with the owning form. */
|
|
30
|
+
name?: string;
|
|
31
|
+
/** Accessible name of the value the stepper changes, when no visible label names it. */
|
|
32
|
+
"aria-label"?: string;
|
|
33
|
+
/** The `id` of the visible label of the value the stepper changes. */
|
|
34
|
+
"aria-labelledby"?: string;
|
|
35
|
+
/** The `id` of an element that describes the stepper, such as the text that shows its value. */
|
|
36
|
+
"aria-describedby"?: string;
|
|
37
|
+
/** Event handler called when the stepper gains focus. */
|
|
38
|
+
onFocus?: FocusEventHandler<HTMLDivElement>;
|
|
39
|
+
/** Event handler called when the stepper loses focus. */
|
|
40
|
+
onBlur?: FocusEventHandler<HTMLDivElement>;
|
|
41
|
+
/** CSS classes applied to the stepper */
|
|
42
|
+
className?: string;
|
|
43
|
+
};
|
|
44
|
+
/** The value one step away, clamped to the range or wrapped, without floating point drift. */
|
|
45
|
+
export declare const stepValue: (current: number, direction: 1 | -1, { min, max, step, wrap }: {
|
|
46
|
+
min: number;
|
|
47
|
+
max: number;
|
|
48
|
+
step: number;
|
|
49
|
+
wrap: boolean;
|
|
50
|
+
}) => number;
|
|
51
|
+
/**
|
|
52
|
+
* Two segments that decrease and increase a number, as the iOS 26 stepper does. It shows no value of its own:
|
|
53
|
+
* name it with `aria-label` or `aria-labelledby` and show the value beside it. Keyboard focus lands on the
|
|
54
|
+
* stepper, a spin button: Up and Down step, Page Up and Page Down step ten times, Home and End go to the range ends.
|
|
55
|
+
*/
|
|
56
|
+
export declare function Stepper({ id, value: valueProp, defaultValue, onChange, min, max, step, wrap, autoRepeat, disabled, pill, decrementLabel, incrementLabel, name, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, onFocus, onBlur, className, }: StepperProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Stepper, type StepperProps } from "./Stepper.js";
|
|
@@ -6,6 +6,8 @@ export type SwitchProps = {
|
|
|
6
6
|
defaultChecked?: boolean;
|
|
7
7
|
/** The controlled state of the switch. Must be used in conjunction with `onCheckedChange`. */
|
|
8
8
|
checked?: boolean;
|
|
9
|
+
/** Checked track color. The accent option uses the platform toggle green. @default primary */
|
|
10
|
+
color?: "primary" | "accent";
|
|
9
11
|
/** Optional accessible label rendered next to the switch. */
|
|
10
12
|
label?: ReactNode;
|
|
11
13
|
/** Optional description rendered below the label. Linked via `aria-describedby`. */
|
|
@@ -32,4 +34,4 @@ export type SwitchProps = {
|
|
|
32
34
|
*/
|
|
33
35
|
labelPosition?: "start" | "end";
|
|
34
36
|
};
|
|
35
|
-
export declare const Switch: ({ className, label, description, id: propsId, disabled, labelPosition, ...restProps }: SwitchProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare const Switch: ({ className, label, description, id: propsId, disabled, color, labelPosition, ...restProps }: SwitchProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { type MouseEvent, type ReactNode, type Ref } from "react";
|
|
2
|
+
import { type BarBackground } from "../Toolbar/Toolbar.js";
|
|
3
|
+
export type TabBarSearch = {
|
|
4
|
+
/** The value of the search tab. */
|
|
5
|
+
value: string;
|
|
6
|
+
/** Accessible name of the search tab. @default "Search" */
|
|
7
|
+
label?: string;
|
|
8
|
+
};
|
|
9
|
+
export type TabBarProps = {
|
|
10
|
+
/** The controlled value of the selected tab. Use with `onValueChange`. */
|
|
11
|
+
value?: string;
|
|
12
|
+
/** The selected tab when it is initially rendered. */
|
|
13
|
+
defaultValue?: string;
|
|
14
|
+
/** Called with the value of the tab a person selects. */
|
|
15
|
+
onValueChange?: (value: string) => void;
|
|
16
|
+
/** A search tab in a glass circle of its own at the trailing end, as the iOS 26 separate search tab. */
|
|
17
|
+
search?: TabBarSearch;
|
|
18
|
+
/**
|
|
19
|
+
* `onScrollDown` minimizes the bar to the selected tab while the content of the `Page` scrolls down and
|
|
20
|
+
* expands it when the content scrolls back up; a tap on the minimized tab expands it too. @default "never"
|
|
21
|
+
*/
|
|
22
|
+
minimizeBehavior?: "never" | "onScrollDown";
|
|
23
|
+
/** Controlled minimized state. Use with `onMinimizedChange`. */
|
|
24
|
+
minimized?: boolean;
|
|
25
|
+
/** The minimized state when it is initially rendered. @default false */
|
|
26
|
+
defaultMinimized?: boolean;
|
|
27
|
+
/** Called when the bar minimizes or expands. */
|
|
28
|
+
onMinimizedChange?: (minimized: boolean) => void;
|
|
29
|
+
/** How the bar meets the content scrolled under it; see `BarBackground`. @default "soft" */
|
|
30
|
+
background?: BarBackground;
|
|
31
|
+
/** Accessible name of the navigation. @default "Tabs" */
|
|
32
|
+
"aria-label"?: string;
|
|
33
|
+
/** `TabBar.Item` elements. */
|
|
34
|
+
children?: ReactNode;
|
|
35
|
+
/** CSS classes applied to the bar */
|
|
36
|
+
className?: string;
|
|
37
|
+
ref?: Ref<HTMLElement>;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* The tab bar of a phone screen after the iOS 26 kit Tab Bar - iPhone (507:24689): two to five tabs, each a
|
|
41
|
+
* symbol over a label, in a floating glass capsule at the bottom, the selected tab on a pill, and an optional
|
|
42
|
+
* search tab in a circle of its own. It minimizes to the selected tab while the content scrolls down. A desktop
|
|
43
|
+
* layout navigates with a Sidebar or Tabs, so the bar never renders from 768px up.
|
|
44
|
+
*/
|
|
45
|
+
declare function TabBarRoot({ value: valueProp, defaultValue, onValueChange, search, minimizeBehavior, minimized: minimizedProp, defaultMinimized, onMinimizedChange, background, "aria-label": ariaLabel, children, className, ref, }: TabBarProps): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
declare namespace TabBarRoot {
|
|
47
|
+
var displayName: string;
|
|
48
|
+
}
|
|
49
|
+
export type TabBarItemProps = {
|
|
50
|
+
/** The value of the tab. */
|
|
51
|
+
value: string;
|
|
52
|
+
/** The label under the symbol, and the accessible name of the tab. */
|
|
53
|
+
label: string;
|
|
54
|
+
/** The symbol, a PlexUI icon. */
|
|
55
|
+
icon: ReactNode;
|
|
56
|
+
/** Makes the tab a link to this URL. */
|
|
57
|
+
href?: string;
|
|
58
|
+
/** When `true`, the tab cannot be selected. */
|
|
59
|
+
disabled?: boolean;
|
|
60
|
+
/** Called when the tab is pressed, before it is selected. */
|
|
61
|
+
onClick?: (event: MouseEvent<HTMLElement>) => void;
|
|
62
|
+
/** CSS classes applied to the tab */
|
|
63
|
+
className?: string;
|
|
64
|
+
/** @internal The search tab shows its symbol only. */
|
|
65
|
+
hideLabel?: boolean;
|
|
66
|
+
};
|
|
67
|
+
declare function TabBarItem({ value, label, icon, href, disabled, onClick, className, hideLabel }: TabBarItemProps): import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
declare namespace TabBarItem {
|
|
69
|
+
var displayName: string;
|
|
70
|
+
}
|
|
71
|
+
export declare const TabBar: typeof TabBarRoot & {
|
|
72
|
+
Item: typeof TabBarItem;
|
|
73
|
+
};
|
|
74
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TabBar, type TabBarItemProps, type TabBarProps, type TabBarSearch } from "./TabBar.js";
|
|
@@ -10,6 +10,8 @@ export type ToasterProps = {
|
|
|
10
10
|
position?: SonnerToasterProps["position"];
|
|
11
11
|
duration?: SonnerToasterProps["duration"];
|
|
12
12
|
offset?: SonnerToasterProps["offset"];
|
|
13
|
+
/** Mobile gutter outside the safe area; explicit edges override the safe defaults. */
|
|
14
|
+
mobileOffset?: SonnerToasterProps["mobileOffset"];
|
|
13
15
|
gap?: SonnerToasterProps["gap"];
|
|
14
|
-
} & Omit<SonnerToasterProps, "position" | "duration" | "closeButton" | "offset" | "gap" | "theme" | "richColors" | "toastOptions" | "style">;
|
|
15
|
-
export declare const Toaster: ({ position, duration, offset, gap, ...restProps }: ToasterProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
} & Omit<SonnerToasterProps, "position" | "duration" | "closeButton" | "offset" | "mobileOffset" | "gap" | "theme" | "richColors" | "toastOptions" | "style">;
|
|
17
|
+
export declare const Toaster: ({ position, duration, offset, mobileOffset, gap, ...restProps }: ToasterProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/** Framework-independent lifecycle, mirrored in the Vue/React packages so neither
|
|
2
|
+
* published port depends on the other framework. Vendor stores remain public. */
|
|
3
|
+
export type ToastId = string | number;
|
|
4
|
+
export type Position = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
5
|
+
export type Direction = "top" | "bottom" | "left" | "right";
|
|
6
|
+
type ToastData = {
|
|
7
|
+
id: ToastId;
|
|
8
|
+
toasterId?: string;
|
|
9
|
+
position?: Position;
|
|
10
|
+
duration?: number;
|
|
11
|
+
type?: string;
|
|
12
|
+
dismissible?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type ToastConfig = {
|
|
15
|
+
id?: string;
|
|
16
|
+
position: Position;
|
|
17
|
+
duration: number;
|
|
18
|
+
gap: number;
|
|
19
|
+
visibleToasts: number;
|
|
20
|
+
expand?: boolean;
|
|
21
|
+
swipeDirections?: Direction[];
|
|
22
|
+
};
|
|
23
|
+
export type ToastEntry<T> = {
|
|
24
|
+
toast: T;
|
|
25
|
+
removed: boolean;
|
|
26
|
+
detached?: boolean;
|
|
27
|
+
mounted: boolean;
|
|
28
|
+
height: number;
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
swiping: boolean;
|
|
32
|
+
swipeOut?: "up" | "down" | "left" | "right";
|
|
33
|
+
remaining: number;
|
|
34
|
+
started?: number;
|
|
35
|
+
timer?: ReturnType<typeof setTimeout>;
|
|
36
|
+
exitTimer?: ReturnType<typeof setTimeout>;
|
|
37
|
+
mountTimer?: ReturnType<typeof setTimeout>;
|
|
38
|
+
exitOffset: number;
|
|
39
|
+
};
|
|
40
|
+
export declare class ToastLifecycle<T extends ToastData> {
|
|
41
|
+
private dismissStore;
|
|
42
|
+
private notify;
|
|
43
|
+
entries: ToastEntry<T>[];
|
|
44
|
+
config: ToastConfig;
|
|
45
|
+
private listeners;
|
|
46
|
+
private revision;
|
|
47
|
+
private doc;
|
|
48
|
+
private hidden;
|
|
49
|
+
private hovered;
|
|
50
|
+
private focused;
|
|
51
|
+
private gesture?;
|
|
52
|
+
private previousFocus;
|
|
53
|
+
private nodes;
|
|
54
|
+
private lists;
|
|
55
|
+
private suppressed;
|
|
56
|
+
private lastPointerType;
|
|
57
|
+
constructor(dismissStore: (id: ToastId) => unknown, notify: (reason: "dismiss" | "auto", toast: T) => void);
|
|
58
|
+
subscribe: (listener: () => void) => () => void;
|
|
59
|
+
snapshot: () => number;
|
|
60
|
+
private emit;
|
|
61
|
+
get expanded(): boolean;
|
|
62
|
+
get paused(): boolean;
|
|
63
|
+
connect(doc: Document): void;
|
|
64
|
+
private visibility;
|
|
65
|
+
disconnect(): void;
|
|
66
|
+
sync(toasts: T[], config: ToastConfig): void;
|
|
67
|
+
private pause;
|
|
68
|
+
private refreshTimers;
|
|
69
|
+
position(entry: ToastEntry<T>): Position;
|
|
70
|
+
at(position: Position): ToastEntry<T>[];
|
|
71
|
+
offset(entry: ToastEntry<T>): number;
|
|
72
|
+
setNode(id: ToastId, node: HTMLElement | null): void;
|
|
73
|
+
setList(position: Position, node: HTMLElement | null): void;
|
|
74
|
+
measure(id: ToastId, height: number): void;
|
|
75
|
+
close(id: ToastId, reason: "dismiss" | "auto" | "action" | "external" | "detach"): void;
|
|
76
|
+
private ownsFocus;
|
|
77
|
+
focusIn(event: FocusEvent): void;
|
|
78
|
+
focusOut(event: FocusEvent): void;
|
|
79
|
+
private restoreFocus;
|
|
80
|
+
keyDown(event: KeyboardEvent, hotkey: string[]): void;
|
|
81
|
+
pointerEnter(event: PointerEvent): void;
|
|
82
|
+
hover(value: boolean): void;
|
|
83
|
+
pointerDown(id: ToastId, event: PointerEvent): void;
|
|
84
|
+
pointerMove(id: ToastId, event: PointerEvent): void;
|
|
85
|
+
pointerEnd(id: ToastId, event: PointerEvent, cancelled?: boolean): void;
|
|
86
|
+
}
|
|
87
|
+
export type Offset = number | string | Partial<Record<"top" | "right" | "bottom" | "left", number | string>>;
|
|
88
|
+
export declare const offsetStyles: (offset: Offset | undefined, mobileOffset: Offset | undefined) => Record<string, string>;
|
|
89
|
+
export declare const documentDirection: (doc: Document | undefined) => "ltr" | "rtl";
|
|
90
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode, type Ref } from "react";
|
|
2
|
+
export type ToolbarPlacement = "top" | "bottom";
|
|
3
|
+
/** Title layouts of the phone top bar. */
|
|
4
|
+
export type ToolbarTitleStyle = "inline" | "large" | "compact-large" | "compact-medium";
|
|
5
|
+
export type ToolbarTitleAlign = "center" | "start";
|
|
6
|
+
/**
|
|
7
|
+
* How a bar meets the content scrolled under it, after the scroll edge effect of iOS 26:
|
|
8
|
+
* - `"soft"`: the canvas color covers the content under the bar's controls and fades out past them, over a light blur
|
|
9
|
+
* - `"hard"`: an opaque bar of the canvas color with a line once content is under it
|
|
10
|
+
* - `"glass"`: a translucent, blurred bar with a hairline, shown once content is under it
|
|
11
|
+
* - `"solid"`: an opaque bar of the canvas color without a line
|
|
12
|
+
*/
|
|
13
|
+
export type BarBackground = "soft" | "hard" | "glass" | "solid";
|
|
14
|
+
/** `"edge"` is the earlier name of `"soft"`. */
|
|
15
|
+
export type ToolbarBackground = BarBackground | "edge";
|
|
16
|
+
/**
|
|
17
|
+
* A surface that places phone toolbars: `Page` puts the top bar over its content
|
|
18
|
+
* and reserves the space; `Dialog` puts it under the Sheet's grabber.
|
|
19
|
+
*/
|
|
20
|
+
export type ToolbarHost = {
|
|
21
|
+
kind: "page" | "dialog";
|
|
22
|
+
setHeight?: (placement: ToolbarPlacement, height: number | undefined) => void;
|
|
23
|
+
/** Content has scrolled under the top bar, so its glass casts a shadow and a hard or glass bar shows its line. */
|
|
24
|
+
scrolled?: boolean;
|
|
25
|
+
/** Content continues under the bottom bar, so a hard or glass bar shows its line. */
|
|
26
|
+
contentBelow?: boolean;
|
|
27
|
+
/** Calls the listener with the content's scroll offset on every scroll; returns the unsubscribe. A TabBar minimizes with it. */
|
|
28
|
+
subscribeScroll?: (listener: (scrollTop: number) => void) => () => void;
|
|
29
|
+
};
|
|
30
|
+
export declare const ToolbarHostContext: import("react").Context<ToolbarHost | null>;
|
|
31
|
+
export type ToolbarProps = HTMLAttributes<HTMLDivElement> & {
|
|
32
|
+
/** @default "top" */
|
|
33
|
+
placement?: ToolbarPlacement;
|
|
34
|
+
/** Layout of `Toolbar.Title` in a top bar. @default "inline" */
|
|
35
|
+
titleStyle?: ToolbarTitleStyle;
|
|
36
|
+
/** Alignment of an inline title. Compact and large titles always start at the leading edge. @default "center" */
|
|
37
|
+
titleAlign?: ToolbarTitleAlign;
|
|
38
|
+
/** How the bar meets the content scrolled under it on a phone. @default "soft" */
|
|
39
|
+
background?: ToolbarBackground;
|
|
40
|
+
ref?: Ref<HTMLDivElement>;
|
|
41
|
+
};
|
|
42
|
+
declare function ToolbarRoot({ placement, titleStyle, titleAlign, background, className, children, ref, ...restProps }: ToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
declare namespace ToolbarRoot {
|
|
44
|
+
var displayName: string;
|
|
45
|
+
}
|
|
46
|
+
export type ToolbarSlotProps = HTMLAttributes<HTMLDivElement> & {
|
|
47
|
+
ref?: Ref<HTMLDivElement>;
|
|
48
|
+
};
|
|
49
|
+
declare function ToolbarLeading({ className, ...restProps }: ToolbarSlotProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
declare namespace ToolbarLeading {
|
|
51
|
+
var displayName: string;
|
|
52
|
+
}
|
|
53
|
+
declare function ToolbarTrailing({ className, ...restProps }: ToolbarSlotProps): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
declare namespace ToolbarTrailing {
|
|
55
|
+
var displayName: string;
|
|
56
|
+
}
|
|
57
|
+
export type ToolbarContentProps = ToolbarSlotProps & {
|
|
58
|
+
/** Stretch between the leading and trailing items, as a search field does. */
|
|
59
|
+
fill?: boolean;
|
|
60
|
+
};
|
|
61
|
+
/** Custom middle content: a search field, a segmented control or a single centered action. */
|
|
62
|
+
declare function ToolbarContent({ fill, className, ...restProps }: ToolbarContentProps): import("react/jsx-runtime").JSX.Element;
|
|
63
|
+
declare namespace ToolbarContent {
|
|
64
|
+
var displayName: string;
|
|
65
|
+
}
|
|
66
|
+
/** Buttons that share one capsule. */
|
|
67
|
+
declare function ToolbarGroup({ className, ...restProps }: ToolbarSlotProps): import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
declare namespace ToolbarGroup {
|
|
69
|
+
var displayName: string;
|
|
70
|
+
}
|
|
71
|
+
export type ToolbarTitleProps = Omit<HTMLAttributes<HTMLHeadingElement>, "children"> & {
|
|
72
|
+
children: ReactNode;
|
|
73
|
+
/** A second, smaller line below the title. */
|
|
74
|
+
subtitle?: ReactNode;
|
|
75
|
+
/**
|
|
76
|
+
* Heading level. In a Dialog the dialog's own title names the Sheet, so the bar title is hidden from
|
|
77
|
+
* assistive technology there. @default "h1"
|
|
78
|
+
*/
|
|
79
|
+
as?: "h1" | "h2" | "h3";
|
|
80
|
+
ref?: Ref<HTMLHeadingElement>;
|
|
81
|
+
};
|
|
82
|
+
declare function ToolbarTitle({ children, subtitle, as, className, ref, ...restProps }: ToolbarTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
declare namespace ToolbarTitle {
|
|
84
|
+
var displayName: string;
|
|
85
|
+
}
|
|
86
|
+
export declare const Toolbar: typeof ToolbarRoot & {
|
|
87
|
+
Leading: typeof ToolbarLeading;
|
|
88
|
+
Title: typeof ToolbarTitle;
|
|
89
|
+
Content: typeof ToolbarContent;
|
|
90
|
+
Group: typeof ToolbarGroup;
|
|
91
|
+
Trailing: typeof ToolbarTrailing;
|
|
92
|
+
};
|
|
93
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Toolbar, ToolbarHostContext, type BarBackground, type ToolbarBackground, type ToolbarContentProps, type ToolbarHost, type ToolbarPlacement, type ToolbarProps, type ToolbarSlotProps, type ToolbarTitleAlign, type ToolbarTitleProps, type ToolbarTitleStyle, } from "./Toolbar.js";
|