@plexui/ui 0.29.0 → 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.
Files changed (110) 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/Checkbox/Checkbox.js +1 -3
  6. package/dist/es/components/Checkbox/Checkbox.js.map +1 -1
  7. package/dist/es/components/ColorPicker/ColorPicker.js +227 -0
  8. package/dist/es/components/ColorPicker/ColorPicker.js.map +1 -0
  9. package/dist/es/components/ColorPicker/ColorWell.js +58 -0
  10. package/dist/es/components/ColorPicker/ColorWell.js.map +1 -0
  11. package/dist/es/components/ColorPicker/index.js +3 -0
  12. package/dist/es/components/ColorPicker/index.js.map +1 -0
  13. package/dist/es/components/ColorPicker/shared.js +132 -0
  14. package/dist/es/components/ColorPicker/shared.js.map +1 -0
  15. package/dist/es/components/ContextMenu/ContextMenu.js +164 -0
  16. package/dist/es/components/ContextMenu/ContextMenu.js.map +1 -0
  17. package/dist/es/components/ContextMenu/index.js +2 -0
  18. package/dist/es/components/ContextMenu/index.js.map +1 -0
  19. package/dist/es/components/ContextMenu/shared.js +56 -0
  20. package/dist/es/components/ContextMenu/shared.js.map +1 -0
  21. package/dist/es/components/DatePicker/DatePicker.js +4 -2
  22. package/dist/es/components/DatePicker/DatePicker.js.map +1 -1
  23. package/dist/es/components/DateRangePicker/DateRangePicker.js.map +1 -1
  24. package/dist/es/components/Dialog/Dialog.js +97 -16
  25. package/dist/es/components/Dialog/Dialog.js.map +1 -1
  26. package/dist/es/components/Field/Field.js +3 -3
  27. package/dist/es/components/Field/Field.js.map +1 -1
  28. package/dist/es/components/FieldGroup/FieldGroup.js +4 -2
  29. package/dist/es/components/FieldGroup/FieldGroup.js.map +1 -1
  30. package/dist/es/components/FloatingLabelInput/FloatingLabelInput.js +2 -2
  31. package/dist/es/components/FloatingLabelInput/FloatingLabelInput.js.map +1 -1
  32. package/dist/es/components/Icon/index.js +1 -0
  33. package/dist/es/components/Icon/index.js.map +1 -1
  34. package/dist/es/components/Icon/svg/Eyedropper.js +6 -0
  35. package/dist/es/components/Icon/svg/Eyedropper.js.map +1 -0
  36. package/dist/es/components/Indicator/LoadingIndicator.js.map +1 -1
  37. package/dist/es/components/Input/Input.js +2 -2
  38. package/dist/es/components/Input/Input.js.map +1 -1
  39. package/dist/es/components/Menu/Menu.js +106 -27
  40. package/dist/es/components/Menu/Menu.js.map +1 -1
  41. package/dist/es/components/Page/Page.js +42 -15
  42. package/dist/es/components/Page/Page.js.map +1 -1
  43. package/dist/es/components/PageControl/PageControl.js +146 -0
  44. package/dist/es/components/PageControl/PageControl.js.map +1 -0
  45. package/dist/es/components/PageControl/index.js +2 -0
  46. package/dist/es/components/PageControl/index.js.map +1 -0
  47. package/dist/es/components/Popover/Popover.js +2 -1
  48. package/dist/es/components/Popover/Popover.js.map +1 -1
  49. package/dist/es/components/Select/Select.js +11 -6
  50. package/dist/es/components/Select/Select.js.map +1 -1
  51. package/dist/es/components/SelectControl/SelectControl.js +1 -1
  52. package/dist/es/components/SelectControl/SelectControl.js.map +1 -1
  53. package/dist/es/components/Sidebar/Sidebar.js +21 -8
  54. package/dist/es/components/Sidebar/Sidebar.js.map +1 -1
  55. package/dist/es/components/Slider/Slider.js +10 -5
  56. package/dist/es/components/Slider/Slider.js.map +1 -1
  57. package/dist/es/components/Stepper/Stepper.js +114 -0
  58. package/dist/es/components/Stepper/Stepper.js.map +1 -0
  59. package/dist/es/components/Stepper/index.js +2 -0
  60. package/dist/es/components/Stepper/index.js.map +1 -0
  61. package/dist/es/components/TabBar/TabBar.js +128 -0
  62. package/dist/es/components/TabBar/TabBar.js.map +1 -0
  63. package/dist/es/components/TabBar/index.js +2 -0
  64. package/dist/es/components/TabBar/index.js.map +1 -0
  65. package/dist/es/components/Tabs/Tabs.js +13 -6
  66. package/dist/es/components/Tabs/Tabs.js.map +1 -1
  67. package/dist/es/components/Textarea/Textarea.js +1 -1
  68. package/dist/es/components/Textarea/Textarea.js.map +1 -1
  69. package/dist/es/components/Toolbar/Toolbar.js +31 -5
  70. package/dist/es/components/Toolbar/Toolbar.js.map +1 -1
  71. package/dist/es/components/Toolbar/index.js.map +1 -1
  72. package/dist/es/lib/fieldRow.js +7 -1
  73. package/dist/es/lib/fieldRow.js.map +1 -1
  74. package/dist/es/lib/menuSubmenuPlacement.js +51 -6
  75. package/dist/es/lib/menuSubmenuPlacement.js.map +1 -1
  76. package/dist/es/lib/menuTriggerCover.js +70 -0
  77. package/dist/es/lib/menuTriggerCover.js.map +1 -0
  78. package/dist/es/lib/scrollEdges.js +34 -0
  79. package/dist/es/lib/scrollEdges.js.map +1 -0
  80. package/dist/types/components/ColorPicker/ColorPicker.d.ts +34 -0
  81. package/dist/types/components/ColorPicker/ColorWell.d.ts +32 -0
  82. package/dist/types/components/ColorPicker/index.d.ts +3 -0
  83. package/dist/types/components/ColorPicker/shared.d.ts +69 -0
  84. package/dist/types/components/ContextMenu/ContextMenu.d.ts +78 -0
  85. package/dist/types/components/ContextMenu/index.d.ts +1 -0
  86. package/dist/types/components/ContextMenu/shared.d.ts +50 -0
  87. package/dist/types/components/DatePicker/DatePicker.d.ts +6 -1
  88. package/dist/types/components/DateRangePicker/DateRangePicker.d.ts +1 -0
  89. package/dist/types/components/Dialog/Dialog.d.ts +5 -1
  90. package/dist/types/components/Field/Field.d.ts +11 -2
  91. package/dist/types/components/FieldGroup/FieldGroup.d.ts +11 -2
  92. package/dist/types/components/Icon/index.d.ts +1 -0
  93. package/dist/types/components/Icon/svg/Eyedropper.d.ts +6 -0
  94. package/dist/types/components/Indicator/LoadingIndicator.d.ts +1 -1
  95. package/dist/types/components/Menu/Menu.d.ts +73 -8
  96. package/dist/types/components/Page/Page.d.ts +8 -4
  97. package/dist/types/components/PageControl/PageControl.d.ts +52 -0
  98. package/dist/types/components/PageControl/index.d.ts +1 -0
  99. package/dist/types/components/Select/Select.d.ts +3 -3
  100. package/dist/types/components/Stepper/Stepper.d.ts +56 -0
  101. package/dist/types/components/Stepper/index.d.ts +1 -0
  102. package/dist/types/components/TabBar/TabBar.d.ts +74 -0
  103. package/dist/types/components/TabBar/index.d.ts +1 -0
  104. package/dist/types/components/Toolbar/Toolbar.d.ts +17 -5
  105. package/dist/types/components/Toolbar/index.d.ts +1 -1
  106. package/dist/types/lib/fieldRow.d.ts +6 -0
  107. package/dist/types/lib/menuSubmenuPlacement.d.ts +14 -1
  108. package/dist/types/lib/menuTriggerCover.d.ts +23 -0
  109. package/dist/types/lib/scrollEdges.d.ts +16 -0
  110. package/package.json +1 -1
@@ -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;
@@ -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,8 +130,9 @@ 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
  /**
@@ -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;
@@ -179,12 +208,24 @@ export type MenuRadioGroupProps<T extends string> = {
179
208
  * @default end
180
209
  */
181
210
  indicatorPosition?: "start" | "end";
211
+ /**
212
+ * `horizontal` sets the options side by side, each an icon over its label and the chosen one on a fill: a mode at the
213
+ * top of an iOS menu, above its list, as Photos orders by Added or by Captured. No radio indicator is drawn; choosing
214
+ * one closes the menu, as any item does.
215
+ * @default "vertical"
216
+ */
217
+ layout?: "vertical" | "horizontal";
182
218
  };
183
219
  export type MenuRadioItemProps<T extends string> = {
184
220
  value: T;
185
221
  /** Class applied to the radio item */
186
222
  className?: string;
187
223
  children: ReactNode;
224
+ /**
225
+ * Second line under the label, as iOS shows the order of the chosen sort (Files: "Newest to Oldest" under Date). It
226
+ * stacks as an Item's description does.
227
+ */
228
+ description?: ReactNode;
188
229
  /** Callback triggered when the radio item is pressed */
189
230
  onSelect?: DropdownMenu.DropdownMenuItemProps["onSelect"];
190
231
  /** Disables the radio item */
@@ -213,4 +254,28 @@ export type MenuCheckboxItemProps = {
213
254
  */
214
255
  indicatorVariant?: "solid" | "ghost";
215
256
  };
257
+ export type MenuHeaderProps = {
258
+ className?: string;
259
+ /** The title: the name of what the menu acts on, such as a file or a board */
260
+ children: ReactNode;
261
+ /** A line under the title: what it is, such as its kind and size ("Folder · 382 KB") */
262
+ description?: ReactNode;
263
+ /**
264
+ * A picture before the title: a thumbnail image, an icon or an Avatar, in a square of 32px (40px on a phone). An
265
+ * image or icon fills the square; an image gets small rounded corners.
266
+ */
267
+ media?: ReactNode;
268
+ /** A round action at the end of the header: a `Menu.HeaderAction` */
269
+ action?: ReactNode;
270
+ };
271
+ export type MenuHeaderActionProps = {
272
+ /** The action's icon */
273
+ children: ReactNode;
274
+ /** Accessible name; the action is an icon-only button */
275
+ "aria-label": string;
276
+ /** Called when the action is pressed; the menu then closes. Call `event.preventDefault()` to keep it open. */
277
+ onSelect?: (event: Event) => void;
278
+ /** Disables the action */
279
+ disabled?: boolean;
280
+ };
216
281
  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 "soft" */
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. */
@@ -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";
@@ -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 not block)
204
+ * @default auto (300 when it fits the options)
205
205
  */
206
206
  listMaxWidth?: number | "auto";
207
207
  /** Predicate used to filter searches */
@@ -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";
@@ -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";
@@ -3,8 +3,16 @@ export type ToolbarPlacement = "top" | "bottom";
3
3
  /** Title layouts of the phone top bar. */
4
4
  export type ToolbarTitleStyle = "inline" | "large" | "compact-large" | "compact-medium";
5
5
  export type ToolbarTitleAlign = "center" | "start";
6
- /** `"edge"` fades the canvas over content scrolled under the bar; `"solid"` fills the bar. */
7
- export type ToolbarBackground = "edge" | "solid";
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";
8
16
  /**
9
17
  * A surface that places phone toolbars: `Page` puts the top bar over its content
10
18
  * and reserves the space; `Dialog` puts it under the Sheet's grabber.
@@ -12,8 +20,12 @@ export type ToolbarBackground = "edge" | "solid";
12
20
  export type ToolbarHost = {
13
21
  kind: "page" | "dialog";
14
22
  setHeight?: (placement: ToolbarPlacement, height: number | undefined) => void;
15
- /** Content has scrolled under the top bar, so its glass casts a shadow. */
23
+ /** Content has scrolled under the top bar, so its glass casts a shadow and a hard or glass bar shows its line. */
16
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;
17
29
  };
18
30
  export declare const ToolbarHostContext: import("react").Context<ToolbarHost | null>;
19
31
  export type ToolbarProps = HTMLAttributes<HTMLDivElement> & {
@@ -23,11 +35,11 @@ export type ToolbarProps = HTMLAttributes<HTMLDivElement> & {
23
35
  titleStyle?: ToolbarTitleStyle;
24
36
  /** Alignment of an inline title. Compact and large titles always start at the leading edge. @default "center" */
25
37
  titleAlign?: ToolbarTitleAlign;
26
- /** @default "edge" */
38
+ /** How the bar meets the content scrolled under it on a phone. @default "soft" */
27
39
  background?: ToolbarBackground;
28
40
  ref?: Ref<HTMLDivElement>;
29
41
  };
30
- declare function ToolbarRoot({ placement, titleStyle, titleAlign, background, className, ref, ...restProps }: ToolbarProps): import("react/jsx-runtime").JSX.Element;
42
+ declare function ToolbarRoot({ placement, titleStyle, titleAlign, background, className, children, ref, ...restProps }: ToolbarProps): import("react/jsx-runtime").JSX.Element;
31
43
  declare namespace ToolbarRoot {
32
44
  var displayName: string;
33
45
  }
@@ -1 +1 @@
1
- export { Toolbar, ToolbarHostContext, type ToolbarBackground, type ToolbarContentProps, type ToolbarHost, type ToolbarPlacement, type ToolbarProps, type ToolbarSlotProps, type ToolbarTitleAlign, type ToolbarTitleProps, type ToolbarTitleStyle, } from "./Toolbar.js";
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";
@@ -4,5 +4,11 @@
4
4
  * rounded.
5
5
  */
6
6
  export declare const FieldRowContext: import("react").Context<boolean>;
7
+ /** True when the control ends a `Field row`. */
8
+ export declare const useFieldRow: () => boolean;
9
+ /** True in a `FieldGroup columns`, where every value starts at one column. */
10
+ export declare const FieldColumnsContext: import("react").Context<boolean>;
11
+ /** True when the control's value starts at the column of a `FieldGroup columns`. */
12
+ export declare const useFieldColumns: () => boolean;
7
13
  /** The control's own `pill`, or else the shape of its row. */
8
14
  export declare const useFieldRowPill: (pill: boolean | undefined) => boolean;
@@ -22,15 +22,28 @@ export type PhoneSubmenuState = {
22
22
  unavailable: boolean;
23
23
  label: string;
24
24
  } & PhoneSubmenuPlacement);
25
- export declare function solvePhoneSubmenuPlacement({ boundary, trigger, parent, width, height, paddingTop, direction, }: {
25
+ export declare function solvePhoneSubmenuPlacement({ boundary, trigger, parent, reference, width, height, paddingTop, direction, }: {
26
26
  boundary: MenuRect;
27
27
  trigger: MenuRect;
28
28
  parent: MenuRect;
29
+ /** The row's box as the primitive measures it, when the parent steps back (`readRestingMenuRects`) */
30
+ reference?: MenuRect;
29
31
  width: number;
30
32
  height: number;
31
33
  paddingTop: number;
32
34
  direction: "ltr" | "rtl";
33
35
  }): PhoneSubmenuPlacement | null;
36
+ /**
37
+ * The boxes of a parent menu and of the row that opened a submenu at rest. While a phone submenu stands over it the
38
+ * parent steps back with the CSS `scale` property (Menu.module.css, iOS-menu IMG_5677), and the submenu keeps the
39
+ * parent's resting box, as the native one does: undo that scale around the parent's transform origin, at whatever
40
+ * value its transition has reached.
41
+ */
42
+ export declare function readRestingMenuRects(parent: HTMLElement, trigger: HTMLElement): {
43
+ parent: MenuRect;
44
+ trigger: MenuRect;
45
+ reference: MenuRect;
46
+ };
34
47
  /** Consume boundary91's resolved footer padding; never subtract the footer again. */
35
48
  export declare function readMenuBoundaryRect(document: Document, boundary: MenuFloatingBoundary): MenuRect | null;
36
49
  /** A text snapshot, never a clone of a consumer's rich children or their IDs. */
@@ -0,0 +1,23 @@
1
+ /** Where a phone menu stands over its trigger: the side offset that covers it, and the side it opens to. */
2
+ export type MenuTriggerCover = {
3
+ sideOffset: number;
4
+ side: "top" | "bottom";
5
+ };
6
+ /**
7
+ * On a phone a menu grows out of the control that opens it and covers it, as iOS 26 menus do: the panel's top is the
8
+ * control's top, or its bottom when the menu opens upward, and its aligned edge is the control's edge (iOS-menu
9
+ * IMG_5657 and IMG_5654, the More button of a top bar; IMG_5658, a button of a group; IMG_5649, the value of a form
10
+ * row; IMG_5675 opens upward over its row). It opens toward the larger part of the screen: downward from a control in
11
+ * the upper half, upward from one in the lower half even when it would fit below (IMG_5688, the Icon and List Size
12
+ * row of Files' View Options; IMG_5687, IMG_5689, and IMG_5693 from a bottom bar). Reports the side offset that puts
13
+ * the panel there, minus the control's height, and that side, while the screen is a phone, and `null` on a larger one,
14
+ * where the menu keeps its gap below the control.
15
+ */
16
+ export declare function observeMenuTriggerCover(trigger: HTMLElement, onChange: (cover: MenuTriggerCover | null) => void): () => void;
17
+ /**
18
+ * A mouse opens a menu when its button goes down, so on a phone-wide window the menu that covers the trigger is under
19
+ * the pointer when the button comes up, and that release would choose the item there. Cancels the release of the press
20
+ * that opened the menu while it is still over the trigger; a press dragged off the trigger onto an item still chooses
21
+ * it, as a touch dragged through an iOS menu does.
22
+ */
23
+ export declare function ignoreReleaseOverTrigger(trigger: HTMLElement, pointerId: number): void;
@@ -0,0 +1,16 @@
1
+ /** Where content lies under the bars of a scroll area. */
2
+ export type ScrollEdges = {
3
+ /** Content has scrolled under the top bar. */
4
+ scrolled: boolean;
5
+ /** Content continues under the bottom bar. */
6
+ contentBelow: boolean;
7
+ };
8
+ export declare const NO_SCROLL_EDGES: ScrollEdges;
9
+ export declare const SCROLL_EDGE_SLOP = 4;
10
+ export declare const scrollEdges: (element: HTMLElement) => ScrollEdges;
11
+ export declare const sameScrollEdges: (a: ScrollEdges, b: ScrollEdges) => boolean;
12
+ /**
13
+ * Reports the scroll edges of `element` now and whenever its scroll offset, its size or the size of its
14
+ * content changes, so a bar can show its line only while content is under it. Returns the cleanup.
15
+ */
16
+ export declare const observeScrollEdges: (element: HTMLElement, onChange: (edges: ScrollEdges) => void) => (() => void);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plexui/ui",
3
- "version": "0.29.0",
3
+ "version": "0.30.0",
4
4
  "description": "Modern design system for building high-quality applications",
5
5
  "type": "module",
6
6
  "license": "MIT",