@plexui/ui 0.30.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 (92) hide show
  1. package/dist/es/components/ButtonGroup/ButtonGroup.js +1 -1
  2. package/dist/es/components/ButtonGroup/ButtonGroup.js.map +1 -1
  3. package/dist/es/components/ButtonGroup/index.js.map +1 -1
  4. package/dist/es/components/ContextMenu/shared.js +3 -2
  5. package/dist/es/components/ContextMenu/shared.js.map +1 -1
  6. package/dist/es/components/Dialog/Dialog.js +42 -29
  7. package/dist/es/components/Dialog/Dialog.js.map +1 -1
  8. package/dist/es/components/Dialog/dialogSteps.js +85 -0
  9. package/dist/es/components/Dialog/dialogSteps.js.map +1 -0
  10. package/dist/es/components/Dialog/dialogViewport.js +74 -0
  11. package/dist/es/components/Dialog/dialogViewport.js.map +1 -0
  12. package/dist/es/components/Dialog/index.js +1 -1
  13. package/dist/es/components/Dialog/index.js.map +1 -1
  14. package/dist/es/components/Dialog/sheetDrag.js +2 -1
  15. package/dist/es/components/Dialog/sheetDrag.js.map +1 -1
  16. package/dist/es/components/IndexBar/IndexBar.js +164 -0
  17. package/dist/es/components/IndexBar/IndexBar.js.map +1 -0
  18. package/dist/es/components/IndexBar/index.js +2 -0
  19. package/dist/es/components/IndexBar/index.js.map +1 -0
  20. package/dist/es/components/MarkdownEditor/MarkdownEditor.js +142 -1
  21. package/dist/es/components/MarkdownEditor/MarkdownEditor.js.map +1 -1
  22. package/dist/es/components/Menu/Menu.js +3 -2
  23. package/dist/es/components/Menu/Menu.js.map +1 -1
  24. package/dist/es/components/Page/Page.js +1 -1
  25. package/dist/es/components/Page/Page.js.map +1 -1
  26. package/dist/es/components/PhoneLayout/PhoneLayout.js +41 -0
  27. package/dist/es/components/PhoneLayout/PhoneLayout.js.map +1 -0
  28. package/dist/es/components/PhoneLayout/index.js +2 -0
  29. package/dist/es/components/PhoneLayout/index.js.map +1 -0
  30. package/dist/es/components/Slider/Slider.js +33 -3
  31. package/dist/es/components/Slider/Slider.js.map +1 -1
  32. package/dist/es/components/SwipeActions/SwipeActions.js +321 -0
  33. package/dist/es/components/SwipeActions/SwipeActions.js.map +1 -0
  34. package/dist/es/components/SwipeActions/index.js +2 -0
  35. package/dist/es/components/SwipeActions/index.js.map +1 -0
  36. package/dist/es/components/TabBar/TabBar.js +4 -4
  37. package/dist/es/components/TabBar/TabBar.js.map +1 -1
  38. package/dist/es/components/TabBar/index.js.map +1 -1
  39. package/dist/es/components/Tabs/Tabs.js +1 -1
  40. package/dist/es/components/Tabs/Tabs.js.map +1 -1
  41. package/dist/es/components/TagInput/TagInput.js +5 -65
  42. package/dist/es/components/TagInput/TagInput.js.map +1 -1
  43. package/dist/es/components/Textarea/Textarea.js +1 -1
  44. package/dist/es/components/Textarea/Textarea.js.map +1 -1
  45. package/dist/es/components/Tip/Tip.js +106 -0
  46. package/dist/es/components/Tip/Tip.js.map +1 -0
  47. package/dist/es/components/Tip/index.js +2 -0
  48. package/dist/es/components/Tip/index.js.map +1 -0
  49. package/dist/es/components/Toast/ToastRenderer.js +22 -9
  50. package/dist/es/components/Toast/ToastRenderer.js.map +1 -1
  51. package/dist/es/components/Toast/Toaster.js +17 -6
  52. package/dist/es/components/Toast/Toaster.js.map +1 -1
  53. package/dist/es/components/Toast/toastLifecycle.js +113 -1
  54. package/dist/es/components/Toast/toastLifecycle.js.map +1 -1
  55. package/dist/es/components/Toolbar/Toolbar.js +1 -1
  56. package/dist/es/components/Toolbar/Toolbar.js.map +1 -1
  57. package/dist/es/hooks/useEscCloseStack.js +10 -3
  58. package/dist/es/hooks/useEscCloseStack.js.map +1 -1
  59. package/dist/es/lib/floatingBoundary.js +3 -1
  60. package/dist/es/lib/floatingBoundary.js.map +1 -1
  61. package/dist/es/lib/helpers.js +21 -0
  62. package/dist/es/lib/helpers.js.map +1 -1
  63. package/dist/es/lib/phoneLayout.js +16 -0
  64. package/dist/es/lib/phoneLayout.js.map +1 -0
  65. package/dist/es/lib/toastRegion.js +6 -0
  66. package/dist/es/lib/toastRegion.js.map +1 -0
  67. package/dist/types/components/ButtonGroup/ButtonGroup.d.ts +8 -1
  68. package/dist/types/components/ButtonGroup/index.d.ts +1 -1
  69. package/dist/types/components/ContextMenu/shared.d.ts +3 -2
  70. package/dist/types/components/Dialog/Dialog.d.ts +48 -3
  71. package/dist/types/components/Dialog/dialogSteps.d.ts +10 -0
  72. package/dist/types/components/Dialog/dialogViewport.d.ts +1 -0
  73. package/dist/types/components/Dialog/index.d.ts +1 -1
  74. package/dist/types/components/IndexBar/IndexBar.d.ts +35 -0
  75. package/dist/types/components/IndexBar/index.d.ts +1 -0
  76. package/dist/types/components/Menu/Menu.d.ts +6 -2
  77. package/dist/types/components/Page/Page.d.ts +1 -1
  78. package/dist/types/components/PhoneLayout/PhoneLayout.d.ts +18 -0
  79. package/dist/types/components/PhoneLayout/index.d.ts +1 -0
  80. package/dist/types/components/SwipeActions/SwipeActions.d.ts +46 -0
  81. package/dist/types/components/SwipeActions/index.d.ts +1 -0
  82. package/dist/types/components/TabBar/TabBar.d.ts +18 -4
  83. package/dist/types/components/TabBar/index.d.ts +1 -1
  84. package/dist/types/components/Tip/Tip.d.ts +57 -0
  85. package/dist/types/components/Tip/index.d.ts +1 -0
  86. package/dist/types/components/Toast/toastLifecycle.d.ts +34 -0
  87. package/dist/types/components/Toolbar/Toolbar.d.ts +5 -3
  88. package/dist/types/hooks/useEscCloseStack.d.ts +5 -1
  89. package/dist/types/lib/helpers.d.ts +6 -0
  90. package/dist/types/lib/phoneLayout.d.ts +11 -0
  91. package/dist/types/lib/toastRegion.d.ts +5 -0
  92. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { type ReactNode } from "react";
1
+ import { type CSSProperties, type ReactNode } from "react";
2
2
  import { type BarBackground } from "../Toolbar/Toolbar.js";
3
3
  export type DialogProps = {
4
4
  open?: boolean;
@@ -10,7 +10,7 @@ export declare const Dialog: {
10
10
  Trigger: ({ children }: {
11
11
  children: ReactNode;
12
12
  }) => import("react/jsx-runtime").JSX.Element;
13
- 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;
14
14
  Header: ({ children, className, background }: DialogHeaderProps) => import("react/jsx-runtime").JSX.Element;
15
15
  HeaderAction: ({ children, className }: DialogSlotProps) => import("react/jsx-runtime").JSX.Element;
16
16
  Body: ({ children, className }: DialogSlotProps) => import("react/jsx-runtime").JSX.Element;
@@ -20,8 +20,19 @@ export declare const Dialog: {
20
20
  Close: ({ children }: {
21
21
  children: ReactNode;
22
22
  }) => import("react/jsx-runtime").JSX.Element;
23
+ Steps: ({ step, direction, children, className }: DialogStepsProps) => import("react/jsx-runtime").JSX.Element;
23
24
  };
24
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
+ };
25
36
  export type DialogContentProps = {
26
37
  children: ReactNode;
27
38
  width?: number | string;
@@ -52,6 +63,28 @@ export type DialogContentProps = {
52
63
  onOpenAutoFocus?: (event: Event) => void;
53
64
  /** Called when focus returns on close. Call `event.preventDefault()` to keep it elsewhere. */
54
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;
55
88
  };
56
89
  type DialogSlotProps = {
57
90
  children: ReactNode;
@@ -60,7 +93,7 @@ type DialogSlotProps = {
60
93
  /** How a Sheet's bar meets the content scrolled under it; see `BarBackground`. */
61
94
  export type DialogBarBackground = BarBackground;
62
95
  export type DialogHeaderProps = DialogSlotProps & {
63
- /** How the bar meets the content scrolled under it in a phone Sheet. @default "soft" */
96
+ /** How the bar meets the content scrolled under it in a phone Sheet. @default "glass" */
64
97
  background?: DialogBarBackground;
65
98
  };
66
99
  export type DialogFooterProps = DialogSlotProps & {
@@ -69,4 +102,16 @@ export type DialogFooterProps = DialogSlotProps & {
69
102
  /** Override the mobile action layout. Alerts default to inline; sheets to stacked. */
70
103
  mobileLayout?: "inline" | "stacked";
71
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
+ };
72
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";
@@ -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";
@@ -136,8 +136,8 @@ export type MenuContentProps = {
136
136
  */
137
137
  alignOffset?: DropdownMenu.DropdownMenuContentProps["alignOffset"];
138
138
  /**
139
- * Defines the `width` property of the content
140
- * @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.
141
141
  */
142
142
  width?: number | "auto";
143
143
  /**
@@ -192,6 +192,10 @@ type SubContentProps = {
192
192
  children: ReactNode;
193
193
  sideOffset?: DropdownMenu.DropdownMenuSubContentProps["sideOffset"];
194
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
+ */
195
199
  width?: number | "auto";
196
200
  minWidth?: number | "auto";
197
201
  maxHeight?: number;
@@ -30,7 +30,7 @@ export type PageHeaderProps = HTMLAttributes<HTMLDivElement> & {
30
30
  * @default true
31
31
  */
32
32
  divider?: boolean;
33
- /** How the bar meets the content scrolled under it on a phone. @default "soft" */
33
+ /** How the bar meets the content scrolled under it on a phone. @default "glass" */
34
34
  background?: PageBarBackground;
35
35
  ref?: Ref<HTMLDivElement>;
36
36
  };
@@ -0,0 +1,18 @@
1
+ import { type ComponentProps } from "react";
2
+ export type PhoneLayoutValue = {
3
+ /** Where dialogs inside the layout portal to: the PhoneLayout box, or null for the document body. */
4
+ container: HTMLElement | null;
5
+ };
6
+ /** Non-null inside a PhoneLayout or a Dialog with `layout="phone"`. */
7
+ export declare const PhoneLayoutContext: import("react").Context<PhoneLayoutValue | null>;
8
+ export type PhoneLayoutProps = ComponentProps<"div">;
9
+ /**
10
+ * Lays out what it holds as on a phone at any window width, such as a phone frame on a desktop page: components take
11
+ * their phone presentation inside it, and a Dialog opened inside it covers the box instead of the window.
12
+ */
13
+ export declare const PhoneLayout: ({ className, children, ref, ...rest }: PhoneLayoutProps) => import("react/jsx-runtime").JSX.Element;
14
+ /**
15
+ * Whether components here are laid out as on a phone: inside a PhoneLayout (or a Dialog with `layout="phone"`), or
16
+ * in a window 767px wide or narrower. The server answers false outside a PhoneLayout.
17
+ */
18
+ export declare const usePhoneLayout: () => boolean;
@@ -0,0 +1 @@
1
+ export { PhoneLayout, PhoneLayoutContext, usePhoneLayout, type PhoneLayoutProps, type PhoneLayoutValue } from "./PhoneLayout.js";
@@ -0,0 +1,46 @@
1
+ import { type ComponentType, type ReactNode, type SVGProps } from "react";
2
+ export type SwipeActionColor = "primary" | "secondary" | "danger" | "success" | "info" | "discovery" | "caution" | "warning";
3
+ export type SwipeAction = {
4
+ /** Unique ID of the action within its side */
5
+ id: string;
6
+ /** Name of the action: shown with `labelPlacement` `"inside"` or `"below"` (and on an action without an icon), and its accessible name always */
7
+ label: string;
8
+ /** Icon of the action */
9
+ Icon?: ComponentType<SVGProps<SVGSVGElement>>;
10
+ /** Solid color of the action. @default "secondary" */
11
+ color?: SwipeActionColor;
12
+ /** Called when the action is pressed, or by a full swipe when it is the first action of its side */
13
+ onSelect?: () => void;
14
+ };
15
+ export type SwipeActionsSide = "leading" | "trailing";
16
+ export type SwipeActionsProps = {
17
+ /** Actions revealed by a swipe toward the trailing edge, the first one at the leading edge */
18
+ leading?: SwipeAction[];
19
+ /** Actions revealed by a swipe toward the leading edge, the first one at the trailing edge */
20
+ trailing?: SwipeAction[];
21
+ /** Where the actions show their labels: `"hidden"` (symbols only), `"inside"` the capsule, or `"below"` it (for rows of 68px and taller). @default "hidden" */
22
+ labelPlacement?: "hidden" | "inside" | "below";
23
+ /** A swipe past the middle between the open actions and the far edge runs the first action of that side. @default true */
24
+ fullSwipe?: boolean;
25
+ /** CSS classes applied to the row */
26
+ className?: string;
27
+ /** The content of the row */
28
+ children?: ReactNode;
29
+ };
30
+ /**
31
+ * Where the content goes for a swipe of `raw` px toward the trailing edge (negative: toward the leading edge), and
32
+ * whether that is a full swipe. A side without actions stays shut. Past its actions the content follows the finger
33
+ * where a full swipe is allowed, and a third as fast where it is not; past the middle between the open actions and
34
+ * the far edge of the row the swipe is full.
35
+ */
36
+ export declare const swipeActionsOffset: (raw: number, widths: Record<SwipeActionsSide, number>, rowWidth: number, fullSwipe: boolean) => {
37
+ offset: number;
38
+ full: boolean;
39
+ };
40
+ /**
41
+ * Actions behind a row of a list, as the swipe actions of an iOS list: a swipe toward the leading edge reveals the
42
+ * trailing actions, a swipe toward the trailing edge the leading ones, and a full swipe runs the first action of
43
+ * that side. The row is a `data-row` of a FieldGroup. Each action is also a button in the order of the screen, and
44
+ * the focus on one shows its side.
45
+ */
46
+ export declare function SwipeActions({ leading, trailing, labelPlacement, fullSwipe, className, children, }: SwipeActionsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { SwipeActions, swipeActionsOffset, type SwipeAction, type SwipeActionColor, type SwipeActionsProps, type SwipeActionsSide } from "./SwipeActions.js";
@@ -6,6 +6,14 @@ export type TabBarSearch = {
6
6
  /** Accessible name of the search tab. @default "Search" */
7
7
  label?: string;
8
8
  };
9
+ export type TabBarProminent = {
10
+ /** The value of the prominent tab. */
11
+ value: string;
12
+ /** Accessible name of the prominent tab: its circle shows the symbol only. */
13
+ label: string;
14
+ /** The symbol, a PlexUI icon. */
15
+ icon: ReactNode;
16
+ };
9
17
  export type TabBarProps = {
10
18
  /** The controlled value of the selected tab. Use with `onValueChange`. */
11
19
  value?: string;
@@ -15,6 +23,12 @@ export type TabBarProps = {
15
23
  onValueChange?: (value: string) => void;
16
24
  /** A search tab in a glass circle of its own at the trailing end, as the iOS 26 separate search tab. */
17
25
  search?: TabBarSearch;
26
+ /**
27
+ * The one destination the app lifts out of the capsule, a cart or a library, in a glass circle of its own at
28
+ * the trailing end, as the iOS 27 prominent tab role. It takes the circle of the search tab: with both, search
29
+ * is the last tab of the capsule, as iOS gives search that place only when no other tab is prominent.
30
+ */
31
+ prominent?: TabBarProminent;
18
32
  /**
19
33
  * `onScrollDown` minimizes the bar to the selected tab while the content of the `Page` scrolls down and
20
34
  * expands it when the content scrolls back up; a tap on the minimized tab expands it too. @default "never"
@@ -39,10 +53,10 @@ export type TabBarProps = {
39
53
  /**
40
54
  * The tab bar of a phone screen after the iOS 26 kit Tab Bar - iPhone (507:24689): two to five tabs, each a
41
55
  * 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.
56
+ * search or prominent tab in a circle of its own. It minimizes to the selected tab while the content scrolls
57
+ * down. A desktop layout navigates with a Sidebar or Tabs, so the bar never renders from 768px up.
44
58
  */
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;
59
+ declare function TabBarRoot({ value: valueProp, defaultValue, onValueChange, search, prominent, minimizeBehavior, minimized: minimizedProp, defaultMinimized, onMinimizedChange, background, "aria-label": ariaLabel, children, className, ref, }: TabBarProps): import("react/jsx-runtime").JSX.Element;
46
60
  declare namespace TabBarRoot {
47
61
  var displayName: string;
48
62
  }
@@ -61,7 +75,7 @@ export type TabBarItemProps = {
61
75
  onClick?: (event: MouseEvent<HTMLElement>) => void;
62
76
  /** CSS classes applied to the tab */
63
77
  className?: string;
64
- /** @internal The search tab shows its symbol only. */
78
+ /** @internal The search and the prominent tab show their symbol only. */
65
79
  hideLabel?: boolean;
66
80
  };
67
81
  declare function TabBarItem({ value, label, icon, href, disabled, onClick, className, hideLabel }: TabBarItemProps): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- export { TabBar, type TabBarItemProps, type TabBarProps, type TabBarSearch } from "./TabBar.js";
1
+ export { TabBar, type TabBarItemProps, type TabBarProminent, type TabBarProps, type TabBarSearch } from "./TabBar.js";
@@ -0,0 +1,57 @@
1
+ import { type ReactElement, type ReactNode, type Ref } from "react";
2
+ /** The edge of an inline tip that points at what it explains. */
3
+ export type TipArrowEdge = "top" | "bottom" | "left" | "right";
4
+ /** How a tip's actions show on a phone. */
5
+ export type TipMobileActions = "rows" | "buttons";
6
+ type TipContentProps = {
7
+ /** The tip's title: what the feature is. */
8
+ title: ReactNode;
9
+ /** One or two sentences on how to use it. */
10
+ description?: ReactNode;
11
+ /** A symbol or image that leads the message, as a TipKit tip's image. */
12
+ icon?: ReactNode;
13
+ /** Buttons for the tip's actions, side by side below the message. */
14
+ actions?: ReactNode;
15
+ /**
16
+ * How the actions show at 767px and below: rows of text under a separator, as iOS tips show them, or the buttons
17
+ * as given, each a full-width capsule under the message, as an iOS card that asks for a permission.
18
+ * @default "rows"
19
+ */
20
+ mobileActions?: TipMobileActions;
21
+ };
22
+ export type TipProps = TipContentProps & {
23
+ /** Shows the Close button; called when it is clicked. */
24
+ onClose?: () => void;
25
+ /** Draws an arrow at this edge, pointing at what the tip explains (TipKit's annotation). */
26
+ arrowEdge?: TipArrowEdge;
27
+ /** Class applied to the tip */
28
+ className?: string;
29
+ /** Ref applied to the tip */
30
+ ref?: Ref<HTMLDivElement>;
31
+ };
32
+ /** A tip inside the page, after TipKit: a title, a description, an optional symbol, actions and Close. */
33
+ export declare const Tip: {
34
+ ({ ref, ...props }: TipProps): import("react/jsx-runtime").JSX.Element;
35
+ Popover: ({ open: controlledOpen, defaultOpen, onOpenChange, children, side, align, sideOffset, closeButton, className, ...content }: TipPopoverProps) => import("react/jsx-runtime").JSX.Element;
36
+ };
37
+ export type TipPopoverProps = TipContentProps & {
38
+ /** Shows the tip (controlled). */
39
+ open?: boolean;
40
+ /** Shows the tip at first (uncontrolled). @default false */
41
+ defaultOpen?: boolean;
42
+ /** Called when the tip opens or closes: Close, Escape or a press outside closes it. */
43
+ onOpenChange?: (open: boolean) => void;
44
+ /** The control the tip explains. It stays usable while the tip shows. */
45
+ children: ReactElement;
46
+ /** The side of the control the tip shows on. Turned when it does not fit. @default bottom */
47
+ side?: "top" | "right" | "bottom" | "left";
48
+ /** The alignment against the control. @default center */
49
+ align?: "start" | "center" | "end";
50
+ /** The distance from the control to the arrow's point, in pixels. @default 4 */
51
+ sideOffset?: number;
52
+ /** Shows the Close button. @default true */
53
+ closeButton?: boolean;
54
+ /** Class applied to the popover around the tip and its arrow */
55
+ className?: string;
56
+ };
57
+ export {};
@@ -0,0 +1 @@
1
+ export { Tip, type TipArrowEdge, type TipMobileActions, type TipPopoverProps, type TipProps } from "./Tip.js";
@@ -54,6 +54,14 @@ export declare class ToastLifecycle<T extends ToastData> {
54
54
  private lists;
55
55
  private suppressed;
56
56
  private lastPointerType;
57
+ private region;
58
+ private announcers;
59
+ private announced;
60
+ /** Alerts read by the assertive announcer: shown behind the stack, their own role could not speak */
61
+ private assertive;
62
+ private announceTimers;
63
+ private pending;
64
+ private flushTimer?;
57
65
  constructor(dismissStore: (id: ToastId) => unknown, notify: (reason: "dismiss" | "auto", toast: T) => void);
58
66
  subscribe: (listener: () => void) => () => void;
59
67
  snapshot: () => number;
@@ -62,6 +70,17 @@ export declare class ToastLifecycle<T extends ToastData> {
62
70
  get paused(): boolean;
63
71
  connect(doc: Document): void;
64
72
  private visibility;
73
+ private isolate;
74
+ setRegion(node: HTMLElement | null): void;
75
+ setAnnouncer(kind: "polite" | "assertive", node: HTMLElement | null): void;
76
+ /** An error that waits to be closed interrupts as an alert; every other toast is read politely. */
77
+ alert(entry: ToastEntry<T>): boolean;
78
+ /** Whether a toast's content carries role="alert": an alert, unless it came in behind the stack and the assertive announcer read it. */
79
+ alertRole(entry: ToastEntry<T>, custom: boolean): boolean;
80
+ private visible;
81
+ /** Reads a toast's words once, and again only when they change (a promise that settles, a custom toast's own state). */
82
+ speak(id: ToastId, node: HTMLElement, custom: boolean): void;
83
+ private flush;
65
84
  disconnect(): void;
66
85
  sync(toasts: T[], config: ToastConfig): void;
67
86
  private pause;
@@ -84,6 +103,21 @@ export declare class ToastLifecycle<T extends ToastData> {
84
103
  pointerMove(id: ToastId, event: PointerEvent): void;
85
104
  pointerEnd(id: ToastId, event: PointerEvent, cancelled?: boolean): void;
86
105
  }
106
+ /** The words a toast says: its title and description, or a custom toast's text. */
107
+ export declare const toastText: (node: HTMLElement) => string;
108
+ /** Hides the polite announcer from sight, not from a screen reader. */
109
+ export declare const announcerStyle: {
110
+ readonly position: "absolute";
111
+ readonly width: "1px";
112
+ readonly height: "1px";
113
+ readonly margin: "-1px";
114
+ readonly padding: "0";
115
+ readonly overflow: "hidden";
116
+ readonly clip: "rect(0 0 0 0)";
117
+ readonly clipPath: "inset(50%)";
118
+ readonly whiteSpace: "nowrap";
119
+ readonly border: "0";
120
+ };
87
121
  export type Offset = number | string | Partial<Record<"top" | "right" | "bottom" | "left", number | string>>;
88
122
  export declare const offsetStyles: (offset: Offset | undefined, mobileOffset: Offset | undefined) => Record<string, string>;
89
123
  export declare const documentDirection: (doc: Document | undefined) => "ltr" | "rtl";
@@ -5,9 +5,11 @@ export type ToolbarTitleStyle = "inline" | "large" | "compact-large" | "compact-
5
5
  export type ToolbarTitleAlign = "center" | "start";
6
6
  /**
7
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
8
+ * - `"soft"` (the default of a bottom bar): at the top, the canvas color covers the content under the bar's controls and fades out past them, over a
9
+ * light blur; at the bottom of a page the content stays clear under and around the controls, as on native iOS 26,
10
+ * and a Sheet's bottom bar fades its content into the panel
9
11
  * - `"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
12
+ * - `"glass"` (the default of a top bar): a translucent, blurred bar with a hairline, shown once content is under it
11
13
  * - `"solid"`: an opaque bar of the canvas color without a line
12
14
  */
13
15
  export type BarBackground = "soft" | "hard" | "glass" | "solid";
@@ -35,7 +37,7 @@ export type ToolbarProps = HTMLAttributes<HTMLDivElement> & {
35
37
  titleStyle?: ToolbarTitleStyle;
36
38
  /** Alignment of an inline title. Compact and large titles always start at the leading edge. @default "center" */
37
39
  titleAlign?: ToolbarTitleAlign;
38
- /** How the bar meets the content scrolled under it on a phone. @default "soft" */
40
+ /** How the bar meets the content scrolled under it on a phone. @default "glass" at the top, "soft" at the bottom */
39
41
  background?: ToolbarBackground;
40
42
  ref?: Ref<HTMLDivElement>;
41
43
  };
@@ -1 +1,5 @@
1
- export declare const useEscCloseStack: (listening: boolean, cb: () => void) => void;
1
+ /**
2
+ * Escape closes the most recently registered listener first, so nested overlays close one at a time. The callback
3
+ * gets the key event, already prevented.
4
+ */
5
+ export declare const useEscCloseStack: (listening: boolean, cb: (event: KeyboardEvent) => void) => void;
@@ -26,6 +26,12 @@ export declare const toFilterProperty: ({ blur }?: {
26
26
  export declare const dataAttributes: (props: Record<string, unknown>) => {
27
27
  [k: string]: unknown;
28
28
  };
29
+ /**
30
+ * A copy of a key event that a handler can cancel. An event that reaches the Escape stack is already prevented, so
31
+ * its own `defaultPrevented` cannot tell whether an owner's handler asked to keep the overlay open. The copy keeps
32
+ * the key, the modifiers and the target.
33
+ */
34
+ export declare const cancelableKeyCopy: (event: KeyboardEvent) => KeyboardEvent;
29
35
  export declare const preventDefaultHandler: (evt: Event) => void;
30
36
  /**
31
37
  * For an overlay's close auto focus: focus that moved on to something else
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The phone layout outside a narrow window (plan 176). The style sheets apply their phone rules (767px and below)
3
+ * inside an element marked `data-plex-layout="phone"` too, at any window width: PhoneLayout marks one, and so does a
4
+ * Dialog with `layout="phone"`. Scripts that change what they do on a phone ask the same question here.
5
+ */
6
+ export declare const PHONE_LAYOUT_SCOPE = "[data-plex-layout=\"phone\"]";
7
+ export declare const PHONE_MEDIA = "(max-width: 767px)";
8
+ /** The window is 767px wide or narrower. */
9
+ export declare const isPhoneWindow: (view: Window | null | undefined) => boolean;
10
+ /** The element is laid out as on a phone: inside a phone layout, or in a window 767px wide or narrower. */
11
+ export declare const isPhoneLayout: (element: Element) => boolean;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The toast region is a layer of its own above any overlay: a press, focus or Escape inside a toast belongs to the
3
+ * toast, never to a Dialog, Popover or Menu under it. Every toast list carries `data-sonner-toaster`.
4
+ */
5
+ export declare const inToastRegion: (target: EventTarget | null | undefined) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plexui/ui",
3
- "version": "0.30.0",
3
+ "version": "0.31.0",
4
4
  "description": "Modern design system for building high-quality applications",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -99,7 +99,7 @@
99
99
  "@maskito/core": "^5.2.2",
100
100
  "@maskito/kit": "^5.2.2",
101
101
  "@maskito/react": "^5.2.2",
102
- "@plexui/styles": "^0.1.33",
102
+ "@plexui/styles": "^0.1.35",
103
103
  "@radix-ui/react-dismissable-layer": "1.2.1",
104
104
  "@radix-ui/react-focus-guards": "1.2.0",
105
105
  "@radix-ui/react-focus-scope": "1.3.1",