@plexui/ui 0.29.0 → 0.31.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.
Files changed (175) hide show
  1. package/dist/es/components/Alert/Alert.js +2 -2
  2. package/dist/es/components/Alert/Alert.js.map +1 -1
  3. package/dist/es/components/Avatar/Avatar.js +3 -1
  4. package/dist/es/components/Avatar/Avatar.js.map +1 -1
  5. package/dist/es/components/ButtonGroup/ButtonGroup.js +1 -1
  6. package/dist/es/components/ButtonGroup/ButtonGroup.js.map +1 -1
  7. package/dist/es/components/ButtonGroup/index.js.map +1 -1
  8. package/dist/es/components/Checkbox/Checkbox.js +1 -3
  9. package/dist/es/components/Checkbox/Checkbox.js.map +1 -1
  10. package/dist/es/components/ColorPicker/ColorPicker.js +227 -0
  11. package/dist/es/components/ColorPicker/ColorPicker.js.map +1 -0
  12. package/dist/es/components/ColorPicker/ColorWell.js +58 -0
  13. package/dist/es/components/ColorPicker/ColorWell.js.map +1 -0
  14. package/dist/es/components/ColorPicker/index.js +3 -0
  15. package/dist/es/components/ColorPicker/index.js.map +1 -0
  16. package/dist/es/components/ColorPicker/shared.js +132 -0
  17. package/dist/es/components/ColorPicker/shared.js.map +1 -0
  18. package/dist/es/components/ContextMenu/ContextMenu.js +164 -0
  19. package/dist/es/components/ContextMenu/ContextMenu.js.map +1 -0
  20. package/dist/es/components/ContextMenu/index.js +2 -0
  21. package/dist/es/components/ContextMenu/index.js.map +1 -0
  22. package/dist/es/components/ContextMenu/shared.js +57 -0
  23. package/dist/es/components/ContextMenu/shared.js.map +1 -0
  24. package/dist/es/components/DatePicker/DatePicker.js +4 -2
  25. package/dist/es/components/DatePicker/DatePicker.js.map +1 -1
  26. package/dist/es/components/DateRangePicker/DateRangePicker.js.map +1 -1
  27. package/dist/es/components/Dialog/Dialog.js +118 -24
  28. package/dist/es/components/Dialog/Dialog.js.map +1 -1
  29. package/dist/es/components/Dialog/dialogSteps.js +85 -0
  30. package/dist/es/components/Dialog/dialogSteps.js.map +1 -0
  31. package/dist/es/components/Dialog/dialogViewport.js +74 -0
  32. package/dist/es/components/Dialog/dialogViewport.js.map +1 -0
  33. package/dist/es/components/Dialog/index.js +1 -1
  34. package/dist/es/components/Dialog/index.js.map +1 -1
  35. package/dist/es/components/Dialog/sheetDrag.js +2 -1
  36. package/dist/es/components/Dialog/sheetDrag.js.map +1 -1
  37. package/dist/es/components/Field/Field.js +3 -3
  38. package/dist/es/components/Field/Field.js.map +1 -1
  39. package/dist/es/components/FieldGroup/FieldGroup.js +4 -2
  40. package/dist/es/components/FieldGroup/FieldGroup.js.map +1 -1
  41. package/dist/es/components/FloatingLabelInput/FloatingLabelInput.js +2 -2
  42. package/dist/es/components/FloatingLabelInput/FloatingLabelInput.js.map +1 -1
  43. package/dist/es/components/Icon/index.js +1 -0
  44. package/dist/es/components/Icon/index.js.map +1 -1
  45. package/dist/es/components/Icon/svg/Eyedropper.js +6 -0
  46. package/dist/es/components/Icon/svg/Eyedropper.js.map +1 -0
  47. package/dist/es/components/IndexBar/IndexBar.js +164 -0
  48. package/dist/es/components/IndexBar/IndexBar.js.map +1 -0
  49. package/dist/es/components/IndexBar/index.js +2 -0
  50. package/dist/es/components/IndexBar/index.js.map +1 -0
  51. package/dist/es/components/Indicator/LoadingIndicator.js.map +1 -1
  52. package/dist/es/components/Input/Input.js +2 -2
  53. package/dist/es/components/Input/Input.js.map +1 -1
  54. package/dist/es/components/MarkdownEditor/MarkdownEditor.js +142 -1
  55. package/dist/es/components/MarkdownEditor/MarkdownEditor.js.map +1 -1
  56. package/dist/es/components/Menu/Menu.js +109 -29
  57. package/dist/es/components/Menu/Menu.js.map +1 -1
  58. package/dist/es/components/Page/Page.js +41 -14
  59. package/dist/es/components/Page/Page.js.map +1 -1
  60. package/dist/es/components/PageControl/PageControl.js +146 -0
  61. package/dist/es/components/PageControl/PageControl.js.map +1 -0
  62. package/dist/es/components/PageControl/index.js +2 -0
  63. package/dist/es/components/PageControl/index.js.map +1 -0
  64. package/dist/es/components/PhoneLayout/PhoneLayout.js +41 -0
  65. package/dist/es/components/PhoneLayout/PhoneLayout.js.map +1 -0
  66. package/dist/es/components/PhoneLayout/index.js +2 -0
  67. package/dist/es/components/PhoneLayout/index.js.map +1 -0
  68. package/dist/es/components/Popover/Popover.js +2 -1
  69. package/dist/es/components/Popover/Popover.js.map +1 -1
  70. package/dist/es/components/Select/Select.js +11 -6
  71. package/dist/es/components/Select/Select.js.map +1 -1
  72. package/dist/es/components/SelectControl/SelectControl.js +1 -1
  73. package/dist/es/components/SelectControl/SelectControl.js.map +1 -1
  74. package/dist/es/components/Sidebar/Sidebar.js +21 -8
  75. package/dist/es/components/Sidebar/Sidebar.js.map +1 -1
  76. package/dist/es/components/Slider/Slider.js +43 -8
  77. package/dist/es/components/Slider/Slider.js.map +1 -1
  78. package/dist/es/components/Stepper/Stepper.js +114 -0
  79. package/dist/es/components/Stepper/Stepper.js.map +1 -0
  80. package/dist/es/components/Stepper/index.js +2 -0
  81. package/dist/es/components/Stepper/index.js.map +1 -0
  82. package/dist/es/components/SwipeActions/SwipeActions.js +321 -0
  83. package/dist/es/components/SwipeActions/SwipeActions.js.map +1 -0
  84. package/dist/es/components/SwipeActions/index.js +2 -0
  85. package/dist/es/components/SwipeActions/index.js.map +1 -0
  86. package/dist/es/components/TabBar/TabBar.js +128 -0
  87. package/dist/es/components/TabBar/TabBar.js.map +1 -0
  88. package/dist/es/components/TabBar/index.js +2 -0
  89. package/dist/es/components/TabBar/index.js.map +1 -0
  90. package/dist/es/components/Tabs/Tabs.js +13 -6
  91. package/dist/es/components/Tabs/Tabs.js.map +1 -1
  92. package/dist/es/components/TagInput/TagInput.js +5 -65
  93. package/dist/es/components/TagInput/TagInput.js.map +1 -1
  94. package/dist/es/components/Textarea/Textarea.js +1 -1
  95. package/dist/es/components/Textarea/Textarea.js.map +1 -1
  96. package/dist/es/components/Tip/Tip.js +106 -0
  97. package/dist/es/components/Tip/Tip.js.map +1 -0
  98. package/dist/es/components/Tip/index.js +2 -0
  99. package/dist/es/components/Tip/index.js.map +1 -0
  100. package/dist/es/components/Toast/ToastRenderer.js +22 -9
  101. package/dist/es/components/Toast/ToastRenderer.js.map +1 -1
  102. package/dist/es/components/Toast/Toaster.js +17 -6
  103. package/dist/es/components/Toast/Toaster.js.map +1 -1
  104. package/dist/es/components/Toast/toastLifecycle.js +113 -1
  105. package/dist/es/components/Toast/toastLifecycle.js.map +1 -1
  106. package/dist/es/components/Toolbar/Toolbar.js +31 -5
  107. package/dist/es/components/Toolbar/Toolbar.js.map +1 -1
  108. package/dist/es/components/Toolbar/index.js.map +1 -1
  109. package/dist/es/hooks/useEscCloseStack.js +10 -3
  110. package/dist/es/hooks/useEscCloseStack.js.map +1 -1
  111. package/dist/es/lib/fieldRow.js +7 -1
  112. package/dist/es/lib/fieldRow.js.map +1 -1
  113. package/dist/es/lib/floatingBoundary.js +3 -1
  114. package/dist/es/lib/floatingBoundary.js.map +1 -1
  115. package/dist/es/lib/helpers.js +21 -0
  116. package/dist/es/lib/helpers.js.map +1 -1
  117. package/dist/es/lib/menuSubmenuPlacement.js +51 -6
  118. package/dist/es/lib/menuSubmenuPlacement.js.map +1 -1
  119. package/dist/es/lib/menuTriggerCover.js +70 -0
  120. package/dist/es/lib/menuTriggerCover.js.map +1 -0
  121. package/dist/es/lib/phoneLayout.js +16 -0
  122. package/dist/es/lib/phoneLayout.js.map +1 -0
  123. package/dist/es/lib/scrollEdges.js +34 -0
  124. package/dist/es/lib/scrollEdges.js.map +1 -0
  125. package/dist/es/lib/toastRegion.js +6 -0
  126. package/dist/es/lib/toastRegion.js.map +1 -0
  127. package/dist/types/components/ButtonGroup/ButtonGroup.d.ts +8 -1
  128. package/dist/types/components/ButtonGroup/index.d.ts +1 -1
  129. package/dist/types/components/ColorPicker/ColorPicker.d.ts +34 -0
  130. package/dist/types/components/ColorPicker/ColorWell.d.ts +32 -0
  131. package/dist/types/components/ColorPicker/index.d.ts +3 -0
  132. package/dist/types/components/ColorPicker/shared.d.ts +69 -0
  133. package/dist/types/components/ContextMenu/ContextMenu.d.ts +78 -0
  134. package/dist/types/components/ContextMenu/index.d.ts +1 -0
  135. package/dist/types/components/ContextMenu/shared.d.ts +51 -0
  136. package/dist/types/components/DatePicker/DatePicker.d.ts +6 -1
  137. package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +1 -0
  138. package/dist/types/components/Dialog/Dialog.d.ts +52 -3
  139. package/dist/types/components/Dialog/dialogSteps.d.ts +10 -0
  140. package/dist/types/components/Dialog/dialogViewport.d.ts +1 -0
  141. package/dist/types/components/Dialog/index.d.ts +1 -1
  142. package/dist/types/components/Field/Field.d.ts +11 -2
  143. package/dist/types/components/FieldGroup/FieldGroup.d.ts +11 -2
  144. package/dist/types/components/Icon/index.d.ts +1 -0
  145. package/dist/types/components/Icon/svg/Eyedropper.d.ts +6 -0
  146. package/dist/types/components/IndexBar/IndexBar.d.ts +35 -0
  147. package/dist/types/components/IndexBar/index.d.ts +1 -0
  148. package/dist/types/components/Indicator/LoadingIndicator.d.ts +1 -1
  149. package/dist/types/components/Menu/Menu.d.ts +79 -10
  150. package/dist/types/components/Page/Page.d.ts +8 -4
  151. package/dist/types/components/PageControl/PageControl.d.ts +52 -0
  152. package/dist/types/components/PageControl/index.d.ts +1 -0
  153. package/dist/types/components/PhoneLayout/PhoneLayout.d.ts +18 -0
  154. package/dist/types/components/PhoneLayout/index.d.ts +1 -0
  155. package/dist/types/components/Select/Select.d.ts +3 -3
  156. package/dist/types/components/Stepper/Stepper.d.ts +56 -0
  157. package/dist/types/components/Stepper/index.d.ts +1 -0
  158. package/dist/types/components/SwipeActions/SwipeActions.d.ts +46 -0
  159. package/dist/types/components/SwipeActions/index.d.ts +1 -0
  160. package/dist/types/components/TabBar/TabBar.d.ts +88 -0
  161. package/dist/types/components/TabBar/index.d.ts +1 -0
  162. package/dist/types/components/Tip/Tip.d.ts +57 -0
  163. package/dist/types/components/Tip/index.d.ts +1 -0
  164. package/dist/types/components/Toast/toastLifecycle.d.ts +34 -0
  165. package/dist/types/components/Toolbar/Toolbar.d.ts +19 -5
  166. package/dist/types/components/Toolbar/index.d.ts +1 -1
  167. package/dist/types/hooks/useEscCloseStack.d.ts +5 -1
  168. package/dist/types/lib/fieldRow.d.ts +6 -0
  169. package/dist/types/lib/helpers.d.ts +6 -0
  170. package/dist/types/lib/menuSubmenuPlacement.d.ts +14 -1
  171. package/dist/types/lib/menuTriggerCover.d.ts +23 -0
  172. package/dist/types/lib/phoneLayout.d.ts +11 -0
  173. package/dist/types/lib/scrollEdges.d.ts +16 -0
  174. package/dist/types/lib/toastRegion.d.ts +5 -0
  175. package/package.json +2 -2
@@ -0,0 +1,78 @@
1
+ import { type ReactElement, type ReactNode } from "react";
2
+ import { type MenuContentProps } from "../Menu/Menu.js";
3
+ export type ContextMenuProps = {
4
+ /** `ContextMenu.Trigger` and `ContextMenu.Content`. */
5
+ children: ReactNode;
6
+ /** Called when the menu opens. */
7
+ onOpen?: () => void;
8
+ /** Called when the menu closes. */
9
+ onClose?: () => void;
10
+ };
11
+ /**
12
+ * A menu of actions for an element, after the iOS 26 kit Context Menu (507:25994): a secondary click opens it at
13
+ * the pointer, a touch and hold opens it beside the element, which stays clear above a dimmed, blurred page, as
14
+ * iOS lifts the preview. The items are the ones of `Menu`.
15
+ */
16
+ declare function ContextMenuRoot({ children, onOpen, onClose }: ContextMenuProps): import("react/jsx-runtime").JSX.Element;
17
+ declare namespace ContextMenuRoot {
18
+ var displayName: string;
19
+ }
20
+ export type ContextMenuTriggerProps = {
21
+ /** The element the menu is for; it receives the handlers, so it keeps its own role and focus. */
22
+ children: ReactElement;
23
+ /** When `true`, the element keeps the browser's own context menu. */
24
+ disabled?: boolean;
25
+ };
26
+ declare function ContextMenuTrigger({ children, disabled }: ContextMenuTriggerProps): import("react/jsx-runtime").JSX.Element;
27
+ declare namespace ContextMenuTrigger {
28
+ var displayName: string;
29
+ }
30
+ /** The props of `Menu.Content` but its placement, which follows how the menu opened. */
31
+ export type ContextMenuContentProps = Omit<MenuContentProps, "side" | "sideOffset" | "align" | "alignOffset" | "onCloseAutoFocus" | "layout" | "size">;
32
+ declare function ContextMenuContent(props: ContextMenuContentProps): import("react/jsx-runtime").JSX.Element;
33
+ declare namespace ContextMenuContent {
34
+ var displayName: string;
35
+ }
36
+ export declare const ContextMenu: typeof ContextMenuRoot & {
37
+ Trigger: typeof ContextMenuTrigger;
38
+ Content: typeof ContextMenuContent;
39
+ Item: ({ className, children, description, disabled, danger, onSelect, onClick }: import("../Menu/Menu.js").MenuItemProps) => import("react/jsx-runtime").JSX.Element;
40
+ Link: <T extends import("react").ComponentType<any> | "a" = "a">(props: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "href"> & (Omit<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, "children" | "href"> & {
41
+ children: React.ReactNode;
42
+ disabled?: boolean;
43
+ danger?: boolean;
44
+ }) & {
45
+ as?: T;
46
+ } & import("react").ComponentProps<T>) => ReactNode;
47
+ Separator: ({ className }: {
48
+ className?: string;
49
+ }) => import("react/jsx-runtime").JSX.Element;
50
+ Label: ({ className, children }: {
51
+ className?: string;
52
+ children: ReactNode;
53
+ }) => import("react/jsx-runtime").JSX.Element;
54
+ Group: ({ className, children, }: {
55
+ className?: string;
56
+ children: ReactNode;
57
+ }) => import("react/jsx-runtime").JSX.Element;
58
+ Sub: ({ children, forceOpen, onOpen, onClose }: import("../Menu/Menu.js").SubmenuProps) => import("react/jsx-runtime").JSX.Element;
59
+ SubTrigger: ({ className, children, description, disabled, }: {
60
+ className?: string;
61
+ children: ReactNode;
62
+ description?: ReactNode;
63
+ disabled?: boolean;
64
+ }) => import("react/jsx-runtime").JSX.Element;
65
+ SubContent: ({ children, sideOffset, alignOffset, width, minWidth, maxHeight, pill, }: {
66
+ children: ReactNode;
67
+ sideOffset?: import("@radix-ui/react-dropdown-menu").DropdownMenuSubContentProps["sideOffset"];
68
+ alignOffset?: import("@radix-ui/react-dropdown-menu").DropdownMenuSubContentProps["alignOffset"];
69
+ width?: number | "auto";
70
+ minWidth?: number | "auto";
71
+ maxHeight?: number;
72
+ pill?: boolean;
73
+ }) => import("react/jsx-runtime").JSX.Element;
74
+ CheckboxItem: ({ className, children, indicatorPosition, indicatorVariant, ...props }: import("../Menu/Menu.js").MenuCheckboxItemProps) => import("react/jsx-runtime").JSX.Element;
75
+ RadioGroup: <T extends string>({ children, value, onChange, indicatorPosition, layout, ...props }: import("../Menu/Menu.js").MenuRadioGroupProps<T>) => import("react/jsx-runtime").JSX.Element;
76
+ RadioItem: <T extends string>({ className, children, description, ...props }: import("../Menu/Menu.js").MenuRadioItemProps<T>) => import("react/jsx-runtime").JSX.Element;
77
+ };
78
+ export {};
@@ -0,0 +1 @@
1
+ export { ContextMenu, type ContextMenuContentProps, type ContextMenuProps, type ContextMenuTriggerProps } from "./ContextMenu.js";
@@ -0,0 +1,51 @@
1
+ /** A touch held this long opens the menu, as a UIKit long press (0.5 s). */
2
+ export declare const CONTEXT_MENU_LONG_PRESS = 500;
3
+ /** A touch that moves farther than this before then scrolls or drags instead. */
4
+ export declare const CONTEXT_MENU_LONG_PRESS_SLOP = 10;
5
+ /** The kit's gap between the preview and the menu: iOS 27 Context Menu 125:58750, Alignment=Vertical, the menu at
6
+ * 176.5 under a content area that ends at 160.5 (the iOS 26 kit had 18). */
7
+ export declare const CONTEXT_MENU_PREVIEW_GAP = 16;
8
+ type Rect = {
9
+ x: number;
10
+ y: number;
11
+ width: number;
12
+ height: number;
13
+ };
14
+ /** Where the menu opens: at the pointer, under the element for the keyboard, or beside a touch-and-hold preview. */
15
+ export type ContextMenuPresentation = {
16
+ kind: "pointer";
17
+ rect: Rect;
18
+ } | {
19
+ kind: "keyboard";
20
+ rect: Rect;
21
+ } | {
22
+ kind: "preview";
23
+ rect: Rect;
24
+ radius: number;
25
+ align: "start" | "end";
26
+ };
27
+ /**
28
+ * The preview of a touch and hold: the element's box and corner (its own, or `--context-menu-preview-radius`), and
29
+ * the edge the menu keeps to, the one on the side of the touch, as the kit's Side=Leading and Side=Trailing.
30
+ */
31
+ export declare function contextMenuPreview(element: HTMLElement, touchX: number): ContextMenuPresentation;
32
+ /** The menu's side, alignment and offsets for a presentation. */
33
+ export declare function contextMenuPlacement(presentation: ContextMenuPresentation | null): {
34
+ side: "bottom";
35
+ align: "start" | "end";
36
+ sideOffset: number;
37
+ alignOffset: number;
38
+ };
39
+ /**
40
+ * The dimming covers the page but the element: an SVG mask with the element's rounded box cut out, written to
41
+ * `--context-menu-hole`, so the element stays clear above the dimmed, blurred page.
42
+ */
43
+ export declare function contextMenuHoleMask(preview: Extract<ContextMenuPresentation, {
44
+ kind: "preview";
45
+ }>, viewport?: {
46
+ width: number;
47
+ height: number;
48
+ }): {
49
+ "--context-menu-hole": string;
50
+ };
51
+ export {};
@@ -88,9 +88,14 @@ export type DatePickerProps = Pick<SelectControlProps, "aria-label" | "aria-labe
88
88
  triggerShowIcon?: boolean;
89
89
  /**
90
90
  * Format of dates displayed in the trigger
91
- * @default "MM/dd/yy", or "MM/dd/yy HH:mm" with showTime
91
+ * @default "MM/dd/yy", or "MM/dd/yy HH:mm" with showTime and no triggerTimeFormat
92
92
  */
93
93
  triggerDateFormat?: string;
94
+ /**
95
+ * With `showTime`, the format of the time shown after the date in the trigger. The date and the time are
96
+ * then two parts: in a row of a `FieldGroup` on a phone, the two capsules of iOS's compact date and time.
97
+ */
98
+ triggerTimeFormat?: string;
94
99
  /**
95
100
  * Display a clear action that allows the select to be unset.
96
101
  * @default false
@@ -31,6 +31,7 @@ export type DateRangePickerProps = {
31
31
  weekStartsOn?: WeekStart;
32
32
  /**
33
33
  * List of date range shortcuts displayed for quick selection, shown to the left of the calendar.
34
+ * Not shown below the md breakpoint: on a phone, offer them in a row of their own (see the docs).
34
35
  */
35
36
  shortcuts?: DateRangeShortcut[];
36
37
  /**
@@ -1,4 +1,5 @@
1
- import { type ReactNode } from "react";
1
+ import { type CSSProperties, type ReactNode } from "react";
2
+ import { type BarBackground } from "../Toolbar/Toolbar.js";
2
3
  export type DialogProps = {
3
4
  open?: boolean;
4
5
  onOpenChange?: (open: boolean) => void;
@@ -9,7 +10,7 @@ export declare const Dialog: {
9
10
  Trigger: ({ children }: {
10
11
  children: ReactNode;
11
12
  }) => import("react/jsx-runtime").JSX.Element;
12
- Content: ({ children, width, showClose, pill, className, placement, mobilePlacement: requestedMobilePlacement, mobileVariant, surface, onOpenAutoFocus, onCloseAutoFocus, }: DialogContentProps) => import("react/jsx-runtime").JSX.Element;
13
+ Content: ({ children, width, showClose, pill, className, placement, mobilePlacement: requestedMobilePlacement, mobileVariant, surface, onOpenAutoFocus, onCloseAutoFocus, onEscapeKeyDown, onInteractOutside, zIndex, rootProps, overlayProps, layout, ...rest }: DialogContentProps) => import("react/jsx-runtime").JSX.Element;
13
14
  Header: ({ children, className, background }: DialogHeaderProps) => import("react/jsx-runtime").JSX.Element;
14
15
  HeaderAction: ({ children, className }: DialogSlotProps) => import("react/jsx-runtime").JSX.Element;
15
16
  Body: ({ children, className }: DialogSlotProps) => import("react/jsx-runtime").JSX.Element;
@@ -19,8 +20,19 @@ export declare const Dialog: {
19
20
  Close: ({ children }: {
20
21
  children: ReactNode;
21
22
  }) => import("react/jsx-runtime").JSX.Element;
23
+ Steps: ({ step, direction, children, className }: DialogStepsProps) => import("react/jsx-runtime").JSX.Element;
22
24
  };
23
25
  export type DialogPlacement = "center" | "top" | "bottom" | "start" | "end" | "fullscreen";
26
+ /** A press or a focus outside the dialog; `event.detail.originalEvent` is the browser's event. */
27
+ export type DialogInteractOutsideEvent = CustomEvent<{
28
+ originalEvent: PointerEvent | FocusEvent;
29
+ }>;
30
+ /** Class, style and data attributes for one of the dialog's layers. */
31
+ export type DialogLayerProps = {
32
+ className?: string;
33
+ style?: CSSProperties;
34
+ [dataAttribute: `data-${string}`]: string | number | boolean | undefined;
35
+ };
24
36
  export type DialogContentProps = {
25
37
  children: ReactNode;
26
38
  width?: number | string;
@@ -51,18 +63,55 @@ export type DialogContentProps = {
51
63
  onOpenAutoFocus?: (event: Event) => void;
52
64
  /** Called when focus returns on close. Call `event.preventDefault()` to keep it elsewhere. */
53
65
  onCloseAutoFocus?: (event: Event) => void;
66
+ /**
67
+ * Called on Escape before the dialog closes. Call `event.preventDefault()` to keep it open, such as for a form
68
+ * with unsaved changes.
69
+ */
70
+ onEscapeKeyDown?: (event: KeyboardEvent) => void;
71
+ /**
72
+ * Called on a press or a focus outside the dialog before it closes. Call `event.preventDefault()` to keep it open,
73
+ * such as for a press on a developer panel over the page.
74
+ */
75
+ onInteractOutside?: (event: DialogInteractOutsideEvent) => void;
76
+ /** Stack order of the overlay and the dialog. @default 50 */
77
+ zIndex?: number;
78
+ /** Class, style and data attributes for the fixed layer that holds the panel. Data attributes of Content land here too. */
79
+ rootProps?: DialogLayerProps;
80
+ /** Class, style and data attributes for the overlay. */
81
+ overlayProps?: DialogLayerProps;
82
+ /**
83
+ * `phone` lays the dialog out as on a phone at any window width. Inside a PhoneLayout it always is.
84
+ * @default "auto"
85
+ */
86
+ layout?: "auto" | "phone";
87
+ [dataAttribute: `data-${string}`]: string | number | boolean | undefined;
54
88
  };
55
89
  type DialogSlotProps = {
56
90
  children: ReactNode;
57
91
  className?: string;
58
92
  };
59
- export type DialogBarBackground = "glass" | "solid";
93
+ /** How a Sheet's bar meets the content scrolled under it; see `BarBackground`. */
94
+ export type DialogBarBackground = BarBackground;
60
95
  export type DialogHeaderProps = DialogSlotProps & {
96
+ /** How the bar meets the content scrolled under it in a phone Sheet. @default "glass" */
61
97
  background?: DialogBarBackground;
62
98
  };
63
99
  export type DialogFooterProps = DialogSlotProps & {
100
+ /** How the bar meets the content scrolled under it in a phone Sheet. @default "soft" */
64
101
  background?: DialogBarBackground;
65
102
  /** Override the mobile action layout. Alerts default to inline; sheets to stacked. */
66
103
  mobileLayout?: "inline" | "stacked";
67
104
  };
105
+ export type DialogStepsProps = {
106
+ /** The step on screen. A new value brings its content in. */
107
+ step: string | number;
108
+ /**
109
+ * `forward` brings the new step in from the trailing edge over the one before, as a push on iOS; `back` returns to
110
+ * a step before it.
111
+ * @default "forward"
112
+ */
113
+ direction?: "forward" | "back";
114
+ children: ReactNode;
115
+ className?: string;
116
+ };
68
117
  export {};
@@ -0,0 +1,10 @@
1
+ export declare const STEP_TIMING: {
2
+ enterDuration: number;
3
+ exitDuration: number;
4
+ };
5
+ type TransitionElement = HTMLElement | SVGElement;
6
+ export declare const enterStep: (element: TransitionElement) => void;
7
+ export declare const leaveStep: (element: TransitionElement) => void;
8
+ export declare const settleStepHeight: (element: TransitionElement) => void;
9
+ export declare const releaseStepHeight: (element: TransitionElement) => void;
10
+ export {};
@@ -0,0 +1 @@
1
+ export declare const watchDialogViewport: (content: HTMLElement, container: HTMLElement | null) => (() => void);
@@ -1 +1 @@
1
- export { Dialog, type DialogBarBackground, type DialogHeaderProps, type DialogFooterProps, type DialogContentProps, type DialogPlacement, type DialogProps } from "./Dialog.js";
1
+ export { Dialog, type DialogBarBackground, type DialogContentProps, type DialogFooterProps, type DialogHeaderProps, type DialogInteractOutsideEvent, type DialogLayerProps, type DialogPlacement, type DialogProps, type DialogStepsProps, } from "./Dialog.js";
@@ -17,6 +17,15 @@ export type FieldProps = {
17
17
  * Automatically linked via aria-describedby.
18
18
  */
19
19
  description?: React.ReactNode;
20
+ /**
21
+ * Hides the label from view; it still names the control for assistive technology.
22
+ * On a `row` the value or placeholder then starts at the row's edge, as an iOS cell that
23
+ * shows only its placeholder or value (Notes, a title, a server's address), so the row is
24
+ * vertical unless `orientation` says otherwise. Words that explain the field go in the
25
+ * FieldGroup's `footer`.
26
+ * @default false
27
+ */
28
+ hideLabel?: boolean;
20
29
  /**
21
30
  * Error message displayed below the control.
22
31
  * When provided, the child control receives aria-invalid="true".
@@ -50,7 +59,7 @@ export type FieldProps = {
50
59
  * Layout direction of label and control.
51
60
  * - "vertical": label stacked above control (default)
52
61
  * - "horizontal": label beside control
53
- * @default "horizontal" on a `row`, else "vertical"
62
+ * @default "horizontal" on a `row` with a visible label, else "vertical"
54
63
  */
55
64
  orientation?: "vertical" | "horizontal";
56
65
  /**
@@ -95,4 +104,4 @@ export type FieldProps = {
95
104
  */
96
105
  children: React.ReactElement | ((fieldProps: FieldChildProps) => React.ReactNode);
97
106
  } & Omit<React.ComponentProps<"div">, "children" | "id" | "className">;
98
- export declare function Field({ label, description, errorMessage, labelAction, action, size: sizeProp, required, orientation: orientationProp, row, fill, opticallyAlign, id: idProp, className, children, ...rest }: FieldProps): import("react/jsx-runtime").JSX.Element;
107
+ export declare function Field({ label, hideLabel, description, errorMessage, labelAction, action, size: sizeProp, required, orientation: orientationProp, row, fill, opticallyAlign, id: idProp, className, children, ...rest }: FieldProps): import("react/jsx-runtime").JSX.Element;
@@ -3,12 +3,21 @@ export type FieldGroupProps = {
3
3
  * Heading over the block. It names the group.
4
4
  */
5
5
  title?: React.ReactNode;
6
+ /**
7
+ * How much the title stands out. "standard" is a quiet heading over the rows (on a
8
+ * phone the kit's Nested list header: 17 Semibold, secondary). "increased" leads its
9
+ * content, as a section of a page does (the kit's Prominent header: 20 Semibold,
10
+ * primary).
11
+ * @default "standard"
12
+ */
13
+ headerProminence?: "standard" | "increased";
6
14
  /**
7
15
  * Line under the title.
8
16
  */
9
17
  description?: React.ReactNode;
10
18
  /**
11
- * Content at the end of the header, such as a button.
19
+ * Content at the end of the header, such as a button. On a phone a ghost text button
20
+ * reads as the list header's action: tinted text on the title's last line.
12
21
  */
13
22
  action?: React.ReactNode;
14
23
  /**
@@ -31,4 +40,4 @@ export type FieldGroupProps = {
31
40
  children?: React.ReactNode;
32
41
  } & Omit<React.ComponentProps<"section">, "title" | "children">;
33
42
  /** A titled block of rows: `Field row` lines with hairlines between them. */
34
- export declare function FieldGroup({ title, description, action, footer, columns, bodyClassName, className, children, ...rest }: FieldGroupProps): import("react/jsx-runtime").JSX.Element;
43
+ export declare function FieldGroup({ title, headerProminence, description, action, footer, columns, bodyClassName, className, children, ...rest }: FieldGroupProps): import("react/jsx-runtime").JSX.Element;
@@ -219,6 +219,7 @@ export { default as ExpandMd } from "./svg/ExpandMd.js";
219
219
  export { default as ExpandSm } from "./svg/ExpandSm.js";
220
220
  export { default as ExternalLink } from "./svg/ExternalLink.js";
221
221
  export { default as Eye } from "./svg/Eye.js";
222
+ export { default as Eyedropper } from "./svg/Eyedropper.js";
222
223
  export { default as EyeOff } from "./svg/EyeOff.js";
223
224
  export { default as FeaturedWreath } from "./svg/FeaturedWreath.js";
224
225
  export { default as File3D } from "./svg/File3D.js";
@@ -0,0 +1,6 @@
1
+ import type { SVGProps } from "react";
2
+ declare const Eyedropper: {
3
+ (props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
4
+ displayName: string;
5
+ };
6
+ export default Eyedropper;
@@ -0,0 +1,35 @@
1
+ import { type FocusEventHandler } from "react";
2
+ export type IndexBarProps = {
3
+ /** The `id` of the index bar. */
4
+ id?: string;
5
+ /** The titles of the sections, in order: usually letters, such as `"A"` to `"Z"` and `"#"`. */
6
+ items: string[];
7
+ /** Called with the title and the index of the section to show: on a press, on each new letter while dragging, and from the keys. */
8
+ onSelect?: (item: string, index: number) => void;
9
+ /** Accessible name of the index bar. @default "Section index" */
10
+ "aria-label"?: string;
11
+ /** The `id` of the list the index scrolls. */
12
+ "aria-controls"?: string;
13
+ /** Event handler called when the index bar gains focus. */
14
+ onFocus?: FocusEventHandler<HTMLDivElement>;
15
+ /** Event handler called when the index bar loses focus. */
16
+ onBlur?: FocusEventHandler<HTMLDivElement>;
17
+ /** CSS classes applied to the index bar */
18
+ className?: string;
19
+ };
20
+ /**
21
+ * What the bar shows: the index of each title, or `null` for a dot. Every title shows while they fit in `capacity`
22
+ * lines, or while `capacity` is not known (`undefined`). Otherwise the first and the last title keep their places
23
+ * and titles spread evenly between them, a dot in each line between two, as UIKit's index shortens itself on a
24
+ * short screen; two lines hold the first and the last title, one the first, none nothing.
25
+ */
26
+ export declare const indexBarSlots: (count: number, capacity?: number) => Array<number | null>;
27
+ /**
28
+ * The section index of a phone list, as the iOS section index: a column of letters at the trailing edge of the
29
+ * nearest positioned container (a Page), centred between the bars of the Page. A press shows the section of the letter under the
30
+ * finger, and a drag moves through the sections letter by letter. On a short screen every other letter gives
31
+ * way to a dot. It is one slider for assistive technology: Down and Up (or Right and Left) move one section, Home
32
+ * and End go to the first and the last, and Enter or Space shows the current one again. A desktop list has no
33
+ * index, so the bar renders under 768px only.
34
+ */
35
+ export declare function IndexBar({ id, items, onSelect, "aria-label": ariaLabel, "aria-controls": ariaControls, onFocus, onBlur, className, }: IndexBarProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export { IndexBar, indexBarSlots, type IndexBarProps } from "./IndexBar.js";
@@ -2,7 +2,7 @@ import type { ComponentProps } from "react";
2
2
  export type LoadingIndicatorProps = {
3
3
  /** Classname applied to the indicator */
4
4
  className?: string;
5
- /** Size of the indicator, in pixels. The optional touch stylesheet defaults to 30px.
5
+ /** Size of the indicator, in pixels. The optional touch stylesheet defaults to 20px.
6
6
  * @default 1em
7
7
  */
8
8
  size?: number | string;
@@ -1,5 +1,18 @@
1
1
  import { DropdownMenu } from "radix-ui";
2
2
  import React, { type ComponentProps, type ComponentType, type MouseEvent, type ReactNode } from "react";
3
+ type MenuContextValue = {
4
+ open: boolean;
5
+ setOpen: (next: boolean) => void;
6
+ prepareFocusRestore: (trigger: HTMLElement) => void;
7
+ isUsingKeyboard: React.RefObject<boolean>;
8
+ /** The element of `Menu.Trigger`, which a phone menu covers */
9
+ triggerElement: HTMLElement | null;
10
+ setTriggerElement: (element: HTMLElement | null) => void;
11
+ /** Whether the menu is modal, which decides whether an outside interaction skips the focus return */
12
+ modal: boolean;
13
+ };
14
+ /** @internal The open state of the enclosing Menu, for ContextMenu. Not exported from the package. */
15
+ export declare const useMenuContext: () => MenuContextValue;
3
16
  export type MenuProps = {
4
17
  children: React.ReactNode;
5
18
  /** Force the menu to remain open or closed */
@@ -16,7 +29,7 @@ export type MenuProps = {
16
29
  };
17
30
  export declare const Menu: {
18
31
  ({ children, forceOpen, onOpen, onClose, modal }: MenuProps): import("react/jsx-runtime").JSX.Element;
19
- Content: ({ children, side, sideOffset, align, alignOffset, width, minWidth, maxHeight, pill, layout, size, onCloseAutoFocus, }: MenuContentProps) => import("react/jsx-runtime").JSX.Element;
32
+ Content: ({ children, side, sideOffset, align, alignOffset, width, minWidth, maxHeight, pill, layout, size, onCloseAutoFocus, onOpenAutoFocus, }: MenuContentProps) => import("react/jsx-runtime").JSX.Element;
20
33
  Item: ({ className, children, description, disabled, danger, onSelect, onClick }: MenuItemProps) => import("react/jsx-runtime").JSX.Element;
21
34
  ItemActions: ({ className, children }: {
22
35
  className?: string;
@@ -36,15 +49,20 @@ export declare const Menu: {
36
49
  ref?: React.Ref<HTMLButtonElement>;
37
50
  }) => import("react/jsx-runtime").JSX.Element;
38
51
  Sub: ({ children, forceOpen, onOpen, onClose }: SubmenuProps) => import("react/jsx-runtime").JSX.Element;
39
- SubTrigger: ({ className, children, disabled, }: {
52
+ SubTrigger: ({ className, children, description, disabled, }: {
40
53
  className?: string;
41
54
  children: ReactNode;
55
+ /**
56
+ * Second line under the label: what the submenu has chosen, as Reminders shows "Manual" under Sort By. It stacks
57
+ * as an Item's description does; icons before the label stay beside both lines.
58
+ */
59
+ description?: ReactNode;
42
60
  disabled?: boolean;
43
61
  }) => import("react/jsx-runtime").JSX.Element;
44
62
  SubContent: ({ children, sideOffset, alignOffset, width, minWidth, maxHeight, pill, }: SubContentProps) => import("react/jsx-runtime").JSX.Element;
45
63
  CheckboxItem: ({ className, children, indicatorPosition, indicatorVariant, ...props }: MenuCheckboxItemProps) => import("react/jsx-runtime").JSX.Element;
46
- RadioGroup: <T extends string>({ children, value, onChange, indicatorPosition, ...props }: MenuRadioGroupProps<T>) => import("react/jsx-runtime").JSX.Element;
47
- RadioItem: <T extends string>({ className, children, ...props }: MenuRadioItemProps<T>) => import("react/jsx-runtime").JSX.Element;
64
+ RadioGroup: <T extends string>({ children, value, onChange, indicatorPosition, layout, ...props }: MenuRadioGroupProps<T>) => import("react/jsx-runtime").JSX.Element;
65
+ RadioItem: <T extends string>({ className, children, description, ...props }: MenuRadioItemProps<T>) => import("react/jsx-runtime").JSX.Element;
48
66
  Label: ({ className, children }: {
49
67
  className?: string;
50
68
  children: ReactNode;
@@ -53,6 +71,8 @@ export declare const Menu: {
53
71
  className?: string;
54
72
  children: ReactNode;
55
73
  }) => import("react/jsx-runtime").JSX.Element;
74
+ Header: ({ className, children, description, media, action }: MenuHeaderProps) => import("react/jsx-runtime").JSX.Element;
75
+ HeaderAction: ({ children, "aria-label": ariaLabel, onSelect, disabled }: MenuHeaderActionProps) => import("react/jsx-runtime").JSX.Element;
56
76
  };
57
77
  export type MenuItemProps = {
58
78
  className?: string;
@@ -93,12 +113,14 @@ type MenuLink = <T extends ComponentType<any> | "a" = PlexUI.LinkComponent>(prop
93
113
  export type MenuContentProps = {
94
114
  children: React.ReactNode;
95
115
  /**
96
- * The preferred side of the trigger to render against when open. Will be reversed when collisions occur.
116
+ * The preferred side of the trigger to render against when open. Will be reversed when collisions occur. Without it
117
+ * a menu on a phone opens toward the larger part of the screen: upward from a trigger in the lower half.
97
118
  * @default bottom
98
119
  */
99
120
  side?: DropdownMenu.DropdownMenuContentProps["side"];
100
121
  /**
101
- * The distance in pixels from the trigger.
122
+ * The distance in pixels from the trigger. Without it a menu on a phone covers its trigger, as iOS menus grow out
123
+ * of the control that opens them.
102
124
  * @default 5
103
125
  */
104
126
  sideOffset?: DropdownMenu.DropdownMenuContentProps["sideOffset"];
@@ -108,13 +130,14 @@ export type MenuContentProps = {
108
130
  */
109
131
  align?: DropdownMenu.DropdownMenuContentProps["align"];
110
132
  /**
111
- * An offset in pixels from the "start" or "end" alignment options.
112
- * @default 0
133
+ * An offset in pixels from the "start" or "end" alignment options. Without it a menu on a phone that covers its
134
+ * trigger keeps the trigger's edge.
135
+ * @default -5 with "start" or "end", 0 with "center"
113
136
  */
114
137
  alignOffset?: DropdownMenu.DropdownMenuContentProps["alignOffset"];
115
138
  /**
116
- * Defines the `width` property of the content
117
- * @default auto
139
+ * Defines the `width` property of the content. Without it the menu fits its content, or with `touch.css` on a phone
140
+ * is the 250px panel of an iOS menu; `"auto"` fits its content there too.
118
141
  */
119
142
  width?: number | "auto";
120
143
  /**
@@ -149,6 +172,12 @@ export type MenuContentProps = {
149
172
  * trigger from regaining focus (and its focus-visible ring).
150
173
  */
151
174
  onCloseAutoFocus?: DropdownMenu.DropdownMenuContentProps["onCloseAutoFocus"];
175
+ /**
176
+ * Event handler called when focus moves into the menu as it opens. Call
177
+ * `event.preventDefault()` to leave focus where it is, as for a menu that
178
+ * stands open when its screen appears.
179
+ */
180
+ onOpenAutoFocus?: (event: Event) => void;
152
181
  };
153
182
  export type SubmenuProps = {
154
183
  children: React.ReactNode;
@@ -163,6 +192,10 @@ type SubContentProps = {
163
192
  children: ReactNode;
164
193
  sideOffset?: DropdownMenu.DropdownMenuSubContentProps["sideOffset"];
165
194
  alignOffset?: DropdownMenu.DropdownMenuSubContentProps["alignOffset"];
195
+ /**
196
+ * The width of the submenu. Without it the submenu fits its content, or with `touch.css` on a phone is the 250px of a
197
+ * menu; `"auto"` fits its content there too.
198
+ */
166
199
  width?: number | "auto";
167
200
  minWidth?: number | "auto";
168
201
  maxHeight?: number;
@@ -179,12 +212,24 @@ export type MenuRadioGroupProps<T extends string> = {
179
212
  * @default end
180
213
  */
181
214
  indicatorPosition?: "start" | "end";
215
+ /**
216
+ * `horizontal` sets the options side by side, each an icon over its label and the chosen one on a fill: a mode at the
217
+ * top of an iOS menu, above its list, as Photos orders by Added or by Captured. No radio indicator is drawn; choosing
218
+ * one closes the menu, as any item does.
219
+ * @default "vertical"
220
+ */
221
+ layout?: "vertical" | "horizontal";
182
222
  };
183
223
  export type MenuRadioItemProps<T extends string> = {
184
224
  value: T;
185
225
  /** Class applied to the radio item */
186
226
  className?: string;
187
227
  children: ReactNode;
228
+ /**
229
+ * Second line under the label, as iOS shows the order of the chosen sort (Files: "Newest to Oldest" under Date). It
230
+ * stacks as an Item's description does.
231
+ */
232
+ description?: ReactNode;
188
233
  /** Callback triggered when the radio item is pressed */
189
234
  onSelect?: DropdownMenu.DropdownMenuItemProps["onSelect"];
190
235
  /** Disables the radio item */
@@ -213,4 +258,28 @@ export type MenuCheckboxItemProps = {
213
258
  */
214
259
  indicatorVariant?: "solid" | "ghost";
215
260
  };
261
+ export type MenuHeaderProps = {
262
+ className?: string;
263
+ /** The title: the name of what the menu acts on, such as a file or a board */
264
+ children: ReactNode;
265
+ /** A line under the title: what it is, such as its kind and size ("Folder · 382 KB") */
266
+ description?: ReactNode;
267
+ /**
268
+ * A picture before the title: a thumbnail image, an icon or an Avatar, in a square of 32px (40px on a phone). An
269
+ * image or icon fills the square; an image gets small rounded corners.
270
+ */
271
+ media?: ReactNode;
272
+ /** A round action at the end of the header: a `Menu.HeaderAction` */
273
+ action?: ReactNode;
274
+ };
275
+ export type MenuHeaderActionProps = {
276
+ /** The action's icon */
277
+ children: ReactNode;
278
+ /** Accessible name; the action is an icon-only button */
279
+ "aria-label": string;
280
+ /** Called when the action is pressed; the menu then closes. Call `event.preventDefault()` to keep it open. */
281
+ onSelect?: (event: Event) => void;
282
+ /** Disables the action */
283
+ disabled?: boolean;
284
+ };
216
285
  export {};
@@ -1,5 +1,7 @@
1
1
  import { type HTMLAttributes, type Ref } from "react";
2
- export type PageBarBackground = "glass" | "solid";
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;
3
5
  export type PageWidth = "full" | "wide" | "column";
4
6
  export type PageProps = HTMLAttributes<HTMLDivElement> & {
5
7
  /**
@@ -22,12 +24,13 @@ declare namespace PageRoot {
22
24
  }
23
25
  export type PageHeaderProps = HTMLAttributes<HTMLDivElement> & {
24
26
  /**
25
- * Shows a divider once the content has scrolled under the header.
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.
26
29
  * Turn it off when the content already draws a line of its own at that place.
27
30
  * @default true
28
31
  */
29
32
  divider?: boolean;
30
- /** Mobile bar surface. Glass blurs content beneath the bar. */
33
+ /** How the bar meets the content scrolled under it on a phone. @default "glass" */
31
34
  background?: PageBarBackground;
32
35
  ref?: Ref<HTMLDivElement>;
33
36
  };
@@ -73,11 +76,12 @@ export type PageContentProps = HTMLAttributes<HTMLDivElement> & {
73
76
  fill?: boolean;
74
77
  ref?: Ref<HTMLDivElement>;
75
78
  };
76
- 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;
77
80
  declare namespace PageContent {
78
81
  var displayName: string;
79
82
  }
80
83
  export type PageFooterProps = PageSlotProps & {
84
+ /** How the bar meets the content scrolled under it on a phone. @default "soft" */
81
85
  background?: PageBarBackground;
82
86
  };
83
87
  /** Actions that remain below the scrolling content, inside the page's safe area. */