@plexui/ui 0.41.0 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/Alert/Alert.js +12 -2
- package/dist/es/components/Alert/Alert.js.map +1 -1
- package/dist/es/components/ColorPicker/ColorPicker.js +12 -10
- package/dist/es/components/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/es/components/ColorPicker/ColorWell.js +1 -1
- package/dist/es/components/ColorPicker/ColorWell.js.map +1 -1
- package/dist/es/components/ColorPicker/shared.js +5 -4
- package/dist/es/components/ColorPicker/shared.js.map +1 -1
- package/dist/es/components/ContextMenu/ContextMenu.js +9 -9
- package/dist/es/components/ContextMenu/ContextMenu.js.map +1 -1
- package/dist/es/components/ContextMenu/shared.js +25 -5
- package/dist/es/components/ContextMenu/shared.js.map +1 -1
- package/dist/es/components/DataTable/columnHelpers.js +85 -4
- package/dist/es/components/DataTable/columnHelpers.js.map +1 -1
- package/dist/es/components/DatePicker/DatePicker.js +3 -3
- package/dist/es/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/es/components/DatePicker/useCalendarCollisionPadding.js +25 -0
- package/dist/es/components/DatePicker/useCalendarCollisionPadding.js.map +1 -0
- package/dist/es/components/DateRangePicker/DateRangePicker.js +3 -3
- package/dist/es/components/DateRangePicker/DateRangePicker.js.map +1 -1
- package/dist/es/components/Dialog/Dialog.js +1 -1
- package/dist/es/components/Dialog/Dialog.js.map +1 -1
- package/dist/es/components/Input/Input.js +1 -1
- package/dist/es/components/Input/Input.js.map +1 -1
- package/dist/es/components/Menu/Menu.js +15 -2
- package/dist/es/components/Menu/Menu.js.map +1 -1
- package/dist/es/components/PhoneLayout/PhoneLayout.js +6 -1
- package/dist/es/components/PhoneLayout/PhoneLayout.js.map +1 -1
- package/dist/es/components/Popover/Popover.js.map +1 -1
- package/dist/es/components/ProgressSteps/ProgressSteps.js +1 -1
- package/dist/es/components/ProgressSteps/ProgressSteps.js.map +1 -1
- package/dist/es/components/ProgressSteps/index.js.map +1 -1
- package/dist/es/components/Select/Select.js +155 -25
- package/dist/es/components/Select/Select.js.map +1 -1
- package/dist/es/components/SelectControl/SelectControl.js +1 -1
- package/dist/es/components/SelectControl/SelectControl.js.map +1 -1
- package/dist/es/components/Slider/Slider.js +19 -12
- package/dist/es/components/Slider/Slider.js.map +1 -1
- package/dist/es/components/Sortable/Sortable.js +1 -1
- package/dist/es/components/Sortable/Sortable.js.map +1 -1
- package/dist/es/components/StatCard/index.js +5 -1
- package/dist/es/components/StatCard/index.js.map +1 -1
- package/dist/es/components/StatsCard/StatsCard.js +48 -0
- package/dist/es/components/StatsCard/StatsCard.js.map +1 -0
- package/dist/es/components/StatsCard/index.js +2 -0
- package/dist/es/components/StatsCard/index.js.map +1 -0
- package/dist/es/components/SwipeActions/SwipeActions.js +30 -8
- package/dist/es/components/SwipeActions/SwipeActions.js.map +1 -1
- package/dist/es/components/TabBar/TabBar.js +11 -4
- package/dist/es/components/TabBar/TabBar.js.map +1 -1
- package/dist/es/components/Tabs/Tabs.js +200 -7
- package/dist/es/components/Tabs/Tabs.js.map +1 -1
- package/dist/es/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/es/lib/menuTriggerCover.js +40 -3
- package/dist/es/lib/menuTriggerCover.js.map +1 -1
- package/dist/types/components/ColorPicker/ColorPicker.d.ts +3 -2
- package/dist/types/components/ColorPicker/shared.d.ts +5 -4
- package/dist/types/components/ContextMenu/shared.d.ts +28 -6
- package/dist/types/components/DatePicker/useCalendarCollisionPadding.d.ts +8 -0
- package/dist/types/components/Dialog/Dialog.d.ts +1 -1
- package/dist/types/components/PhoneLayout/PhoneLayout.d.ts +5 -0
- package/dist/types/components/Popover/Popover.d.ts +2 -2
- package/dist/types/components/ProgressSteps/ProgressSteps.d.ts +11 -4
- package/dist/types/components/ProgressSteps/index.d.ts +1 -1
- package/dist/types/components/Select/Select.d.ts +11 -3
- package/dist/types/components/StatCard/index.d.ts +5 -1
- package/dist/types/components/{StatCard/StatCard.d.ts → StatsCard/StatsCard.d.ts} +7 -7
- package/dist/types/components/StatsCard/index.d.ts +1 -0
- package/dist/types/components/SwipeActions/SwipeActions.d.ts +1 -1
- package/dist/types/components/TabBar/TabBar.d.ts +12 -2
- package/dist/types/components/Tabs/Tabs.d.ts +12 -0
- package/dist/types/components/Toolbar/Toolbar.d.ts +1 -1
- package/dist/types/lib/menuTriggerCover.d.ts +16 -2
- package/package.json +2 -2
- package/dist/es/components/DatePicker/useCalendarGutter.js +0 -8
- package/dist/es/components/DatePicker/useCalendarGutter.js.map +0 -1
- package/dist/es/components/StatCard/StatCard.js +0 -39
- package/dist/es/components/StatCard/StatCard.js.map +0 -1
- package/dist/types/components/DatePicker/useCalendarGutter.d.ts +0 -1
|
@@ -7,9 +7,10 @@ import { isPhoneLayout, PHONE_LAYOUT_SCOPE } from "./phoneLayout.js";
|
|
|
7
7
|
* the upper half, upward from one in the lower half even when it would fit below (IMG_5688, the Icon and List Size
|
|
8
8
|
* row of Files' View Options; IMG_5687, IMG_5689, and IMG_5693 from a bottom bar). Reports the side offset that puts
|
|
9
9
|
* the panel there, minus the control's height, and that side, while the screen is a phone, and `null` on a larger one,
|
|
10
|
-
* where the menu keeps its gap below the control.
|
|
10
|
+
* where the menu keeps its gap below the control. `windowOnly` takes only a phone-wide window for a phone, for a list
|
|
11
|
+
* that is laid out as on a phone only there (Select: its list keeps no phone scope in a PhoneLayout).
|
|
11
12
|
*/
|
|
12
|
-
export function observeMenuTriggerCover(trigger, onChange) {
|
|
13
|
+
export function observeMenuTriggerCover(trigger, onChange, { windowOnly = false } = {}) {
|
|
13
14
|
const view = trigger.ownerDocument.defaultView;
|
|
14
15
|
if (!view || typeof view.matchMedia !== "function") {
|
|
15
16
|
onChange(null);
|
|
@@ -20,7 +21,7 @@ export function observeMenuTriggerCover(trigger, onChange) {
|
|
|
20
21
|
const measure = () => {
|
|
21
22
|
let cover = null;
|
|
22
23
|
// A narrow window, or a PhoneLayout or phone Dialog at any width
|
|
23
|
-
if (isPhoneLayout(trigger)) {
|
|
24
|
+
if (windowOnly ? media.matches : isPhoneLayout(trigger)) {
|
|
24
25
|
const rect = trigger.getBoundingClientRect();
|
|
25
26
|
// The visible part of the screen: the layout viewport less a keyboard or a pinch zoom, or the box of a
|
|
26
27
|
// PhoneLayout, which is the phone's screen (a phone Dialog's own scope has no box: the window is its screen)
|
|
@@ -47,6 +48,42 @@ export function observeMenuTriggerCover(trigger, onChange) {
|
|
|
47
48
|
media.removeEventListener?.("change", measure);
|
|
48
49
|
};
|
|
49
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* A phone menu that covers its trigger whole hides it while it is open, as iOS 27.2 turns a bar button into its menu
|
|
53
|
+
* (ref-app menus-bar, block 8: the More button is gone under the panel). Kept, the round 44pt button showed past the
|
|
54
|
+
* panel's 34pt corner and through its glass. A trigger the panel leaves a part of uncovered stays: one wider than the
|
|
55
|
+
* panel (a form row), one beside it (an align offset), one at the screen's edge past a panel kept off that edge.
|
|
56
|
+
* Marks the trigger `data-menu-covered` (touch.css) while it lies within the panel's resting box, and clears the mark
|
|
57
|
+
* on cleanup. That box is the primitive's positioned wrapper around the panel: the panel itself grows in from a
|
|
58
|
+
* smaller scale as it opens. The boxes are read again whenever the wrapper moves or either element resizes: the
|
|
59
|
+
* wrapper first stands off screen until it is placed, and a panel can mount with no size yet.
|
|
60
|
+
*/
|
|
61
|
+
export function markCoveredMenuTrigger(trigger, content) {
|
|
62
|
+
const view = trigger.ownerDocument.defaultView;
|
|
63
|
+
const place = content.parentElement ?? content;
|
|
64
|
+
const mark = () => {
|
|
65
|
+
const panel = place.getBoundingClientRect();
|
|
66
|
+
const rect = trigger.getBoundingClientRect();
|
|
67
|
+
// Half a pixel either way for subpixel layout
|
|
68
|
+
const within = rect.left >= panel.left - 0.5 && rect.right <= panel.right + 0.5 && rect.top >= panel.top - 0.5 && rect.bottom <= panel.bottom + 0.5;
|
|
69
|
+
if (content.offsetWidth > 0 && rect.width > 0 && within)
|
|
70
|
+
trigger.setAttribute("data-menu-covered", "");
|
|
71
|
+
else
|
|
72
|
+
trigger.removeAttribute("data-menu-covered");
|
|
73
|
+
};
|
|
74
|
+
const frame = view ? view.requestAnimationFrame(mark) : 0;
|
|
75
|
+
const resize = view?.ResizeObserver ? new view.ResizeObserver(mark) : null;
|
|
76
|
+
resize?.observe(content);
|
|
77
|
+
resize?.observe(trigger);
|
|
78
|
+
const move = view?.MutationObserver ? new view.MutationObserver(mark) : null;
|
|
79
|
+
move?.observe(place, { attributes: true, attributeFilter: ["style"] });
|
|
80
|
+
return () => {
|
|
81
|
+
view?.cancelAnimationFrame(frame);
|
|
82
|
+
resize?.disconnect();
|
|
83
|
+
move?.disconnect();
|
|
84
|
+
trigger.removeAttribute("data-menu-covered");
|
|
85
|
+
};
|
|
86
|
+
}
|
|
50
87
|
/**
|
|
51
88
|
* A mouse opens a menu when its button goes down, so on a phone-wide window the menu that covers the trigger is under
|
|
52
89
|
* the pointer when the button comes up, and that release would choose the item there. Cancels the release of the press
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menuTriggerCover.js","sourceRoot":"","sources":["../../../src/lib/menuTriggerCover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAKjE;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAoB,EAAE,QAAkD;IAC9G,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,CAAA;IAC9C,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;QACnD,QAAQ,CAAC,IAAI,CAAC,CAAA;QACd,OAAO,GAAG,EAAE,CAAC,SAAS,CAAA;IACxB,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAA;IACnD,IAAI,IAAwB,CAAA;IAC5B,MAAM,OA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,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,GAAG,IAAI,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAC3H,KAAK,CAAC,cAAc,EAAE,CAAA;QACxB,CAAC;IACH,CAAC,CAAA;IACD,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;IACjD,IAAI,CAAC,gBAAgB,CAAC,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;AACvD,CAAC","sourcesContent":["import { isPhoneLayout, PHONE_LAYOUT_SCOPE } from \"./phoneLayout\"\n\n/** Where a phone menu stands over its trigger: the side offset that covers it, and the side it opens to. */\nexport type MenuTriggerCover = { sideOffset: number; side: \"top\" | \"bottom\" }\n\n/**\n * 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\n * control's top, or its bottom when the menu opens upward, and its aligned edge is the control's edge (iOS-menu\n * 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\n * row; IMG_5675 opens upward over its row). It opens toward the larger part of the screen: downward from a control in\n * the upper half, upward from one in the lower half even when it would fit below (IMG_5688, the Icon and List Size\n * row of Files' View Options; IMG_5687, IMG_5689, and IMG_5693 from a bottom bar). Reports the side offset that puts\n * the panel there, minus the control's height, and that side, while the screen is a phone, and `null` on a larger one,\n * where the menu keeps its gap below the control.\n */\nexport function observeMenuTriggerCover(trigger: HTMLElement, onChange: (cover: MenuTriggerCover | null) => void): () => void {\n const view = trigger.ownerDocument.defaultView\n if (!view || typeof view.matchMedia !== \"function\") {\n onChange(null)\n return () => undefined\n }\n const media = view.matchMedia(\"(max-width: 767px)\")\n let last: string | undefined\n const measure = () => {\n let cover: MenuTriggerCover | null = null\n // A narrow window, or a PhoneLayout or phone Dialog at any width\n if (isPhoneLayout(trigger)) {\n const rect = trigger.getBoundingClientRect()\n // The visible part of the screen: the layout viewport less a keyboard or a pinch zoom, or the box of a\n // PhoneLayout, which is the phone's screen (a phone Dialog's own scope has no box: the window is its screen)\n const viewport = view.visualViewport\n const screen = trigger.closest(PHONE_LAYOUT_SCOPE)?.getBoundingClientRect()\n const middle = screen && screen.height > 0\n ? Math.max(screen.top, viewport?.offsetTop ?? 0) / 2 + Math.min(screen.bottom, (viewport?.offsetTop ?? 0) + (viewport?.height ?? view.innerHeight)) / 2\n : (viewport?.offsetTop ?? 0) + (viewport?.height ?? view.innerHeight) / 2\n // The layout height: a pressed control may be scaled, and the panel covers its resting box\n cover = { sideOffset: -trigger.offsetHeight, side: rect.top + rect.height / 2 > middle ? \"top\" : \"bottom\" }\n }\n const key = cover ? `${cover.sideOffset} ${cover.side}` : \"\"\n if (key === last) return\n last = key\n onChange(cover)\n }\n measure()\n const resize = typeof ResizeObserver === \"undefined\" ? undefined : new ResizeObserver(measure)\n resize?.observe(trigger)\n media.addEventListener?.(\"change\", measure)\n return () => {\n resize?.disconnect()\n media.removeEventListener?.(\"change\", measure)\n }\n}\n\n/**\n * A mouse opens a menu when its button goes down, so on a phone-wide window the menu that covers the trigger is under\n * the pointer when the button comes up, and that release would choose the item there. Cancels the release of the press\n * that opened the menu while it is still over the trigger; a press dragged off the trigger onto an item still chooses\n * it, as a touch dragged through an iOS menu does.\n */\nexport function ignoreReleaseOverTrigger(trigger: HTMLElement, pointerId: number): void {\n const view = trigger.ownerDocument.defaultView\n // Only a phone menu covers its trigger; elsewhere the gap keeps the items clear of the pointer\n if (!view || !isPhoneLayout(trigger)) return\n const release = (event: PointerEvent) => {\n if (event.pointerId !== pointerId) return\n view.removeEventListener(\"pointerup\", release, true)\n view.removeEventListener(\"pointercancel\", release, true)\n if (event.type !== \"pointerup\") return\n const rect = trigger.getBoundingClientRect()\n if (event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom) {\n event.preventDefault()\n }\n }\n view.addEventListener(\"pointerup\", release, true)\n view.addEventListener(\"pointercancel\", release, true)\n}\n"]}
|
|
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AAC,cAAc,EAAE,CAAA;QACxB,CAAC;IACH,CAAC,CAAA;IACD,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;IACjD,IAAI,CAAC,gBAAgB,CAAC,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC,CAAA;AACvD,CAAC","sourcesContent":["import { isPhoneLayout, PHONE_LAYOUT_SCOPE } from \"./phoneLayout\"\n\n/** Where a phone menu stands over its trigger: the side offset that covers it, and the side it opens to. */\nexport type MenuTriggerCover = { sideOffset: number; side: \"top\" | \"bottom\" }\n\n/**\n * 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\n * control's top, or its bottom when the menu opens upward, and its aligned edge is the control's edge (iOS-menu\n * 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\n * row; IMG_5675 opens upward over its row). It opens toward the larger part of the screen: downward from a control in\n * the upper half, upward from one in the lower half even when it would fit below (IMG_5688, the Icon and List Size\n * row of Files' View Options; IMG_5687, IMG_5689, and IMG_5693 from a bottom bar). Reports the side offset that puts\n * the panel there, minus the control's height, and that side, while the screen is a phone, and `null` on a larger one,\n * where the menu keeps its gap below the control. `windowOnly` takes only a phone-wide window for a phone, for a list\n * that is laid out as on a phone only there (Select: its list keeps no phone scope in a PhoneLayout).\n */\nexport function observeMenuTriggerCover(\n trigger: HTMLElement,\n onChange: (cover: MenuTriggerCover | null) => void,\n { windowOnly = false }: { windowOnly?: boolean } = {},\n): () => void {\n const view = trigger.ownerDocument.defaultView\n if (!view || typeof view.matchMedia !== \"function\") {\n onChange(null)\n return () => undefined\n }\n const media = view.matchMedia(\"(max-width: 767px)\")\n let last: string | undefined\n const measure = () => {\n let cover: MenuTriggerCover | null = null\n // A narrow window, or a PhoneLayout or phone Dialog at any width\n if (windowOnly ? media.matches : isPhoneLayout(trigger)) {\n const rect = trigger.getBoundingClientRect()\n // The visible part of the screen: the layout viewport less a keyboard or a pinch zoom, or the box of a\n // PhoneLayout, which is the phone's screen (a phone Dialog's own scope has no box: the window is its screen)\n const viewport = view.visualViewport\n const screen = trigger.closest(PHONE_LAYOUT_SCOPE)?.getBoundingClientRect()\n const middle = screen && screen.height > 0\n ? Math.max(screen.top, viewport?.offsetTop ?? 0) / 2 + Math.min(screen.bottom, (viewport?.offsetTop ?? 0) + (viewport?.height ?? view.innerHeight)) / 2\n : (viewport?.offsetTop ?? 0) + (viewport?.height ?? view.innerHeight) / 2\n // The layout height: a pressed control may be scaled, and the panel covers its resting box\n cover = { sideOffset: -trigger.offsetHeight, side: rect.top + rect.height / 2 > middle ? \"top\" : \"bottom\" }\n }\n const key = cover ? `${cover.sideOffset} ${cover.side}` : \"\"\n if (key === last) return\n last = key\n onChange(cover)\n }\n measure()\n const resize = typeof ResizeObserver === \"undefined\" ? undefined : new ResizeObserver(measure)\n resize?.observe(trigger)\n media.addEventListener?.(\"change\", measure)\n return () => {\n resize?.disconnect()\n media.removeEventListener?.(\"change\", measure)\n }\n}\n\n/**\n * A phone menu that covers its trigger whole hides it while it is open, as iOS 27.2 turns a bar button into its menu\n * (ref-app menus-bar, block 8: the More button is gone under the panel). Kept, the round 44pt button showed past the\n * panel's 34pt corner and through its glass. A trigger the panel leaves a part of uncovered stays: one wider than the\n * panel (a form row), one beside it (an align offset), one at the screen's edge past a panel kept off that edge.\n * Marks the trigger `data-menu-covered` (touch.css) while it lies within the panel's resting box, and clears the mark\n * on cleanup. That box is the primitive's positioned wrapper around the panel: the panel itself grows in from a\n * smaller scale as it opens. The boxes are read again whenever the wrapper moves or either element resizes: the\n * wrapper first stands off screen until it is placed, and a panel can mount with no size yet.\n */\nexport function markCoveredMenuTrigger(trigger: HTMLElement, content: HTMLElement): () => void {\n const view = trigger.ownerDocument.defaultView\n const place = content.parentElement ?? content\n const mark = () => {\n const panel = place.getBoundingClientRect()\n const rect = trigger.getBoundingClientRect()\n // Half a pixel either way for subpixel layout\n const within = rect.left >= panel.left - 0.5 && rect.right <= panel.right + 0.5 && rect.top >= panel.top - 0.5 && rect.bottom <= panel.bottom + 0.5\n if (content.offsetWidth > 0 && rect.width > 0 && within) trigger.setAttribute(\"data-menu-covered\", \"\")\n else trigger.removeAttribute(\"data-menu-covered\")\n }\n const frame = view ? view.requestAnimationFrame(mark) : 0\n const resize = view?.ResizeObserver ? new view.ResizeObserver(mark) : null\n resize?.observe(content)\n resize?.observe(trigger)\n const move = view?.MutationObserver ? new view.MutationObserver(mark) : null\n move?.observe(place, { attributes: true, attributeFilter: [\"style\"] })\n return () => {\n view?.cancelAnimationFrame(frame)\n resize?.disconnect()\n move?.disconnect()\n trigger.removeAttribute(\"data-menu-covered\")\n }\n}\n\n/**\n * A mouse opens a menu when its button goes down, so on a phone-wide window the menu that covers the trigger is under\n * the pointer when the button comes up, and that release would choose the item there. Cancels the release of the press\n * that opened the menu while it is still over the trigger; a press dragged off the trigger onto an item still chooses\n * it, as a touch dragged through an iOS menu does.\n */\nexport function ignoreReleaseOverTrigger(trigger: HTMLElement, pointerId: number): void {\n const view = trigger.ownerDocument.defaultView\n // Only a phone menu covers its trigger; elsewhere the gap keeps the items clear of the pointer\n if (!view || !isPhoneLayout(trigger)) return\n const release = (event: PointerEvent) => {\n if (event.pointerId !== pointerId) return\n view.removeEventListener(\"pointerup\", release, true)\n view.removeEventListener(\"pointercancel\", release, true)\n if (event.type !== \"pointerup\") return\n const rect = trigger.getBoundingClientRect()\n if (event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom) {\n event.preventDefault()\n }\n }\n view.addEventListener(\"pointerup\", release, true)\n view.addEventListener(\"pointercancel\", release, true)\n}\n"]}
|
|
@@ -28,7 +28,8 @@ export type ColorPickerProps = {
|
|
|
28
28
|
className?: string;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
|
-
* The system color picker of iOS 26
|
|
32
|
-
* slider, and the saved colors with Add. Show it inside a Popover or
|
|
31
|
+
* The system color picker of iOS 27.2 (UIColorPickerViewController, after the iOS 26 kit's Color Picker - iPhone
|
|
32
|
+
* 0:5275): Grid, Spectrum and Sliders, the Opacity slider, and the saved colors with Add. Show it inside a Popover or
|
|
33
|
+
* a Sheet, or use `ColorWell`, which does.
|
|
33
34
|
*/
|
|
34
35
|
export declare function ColorPicker({ id, value: valueProp, defaultValue, onChange, supportsAlpha, mode: modeProp, defaultMode, onModeChange, swatches: swatchesProp, defaultSwatches, onSwatchesChange, "aria-label": ariaLabel, className, }: ColorPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,9 +14,10 @@ export declare const COLOR_PICKER_MODES: readonly {
|
|
|
14
14
|
/** The kit's Color Grid (515:48178): a row of grays, then nine rows from dark to light, twelve hues across. */
|
|
15
15
|
export declare const COLOR_PICKER_GRID: readonly (readonly string[])[];
|
|
16
16
|
export declare const COLOR_PICKER_GRID_COLUMNS = 12;
|
|
17
|
-
/** Saved colors fill pages of two rows of
|
|
18
|
-
|
|
19
|
-
export declare const
|
|
17
|
+
/** Saved colors fill pages of two rows of six, with the Add button after the last one, as iOS 27.2's picker lays them
|
|
18
|
+
* out (UIColorPickerViewController on an iPhone 17; the iOS 26 kit's Swatches 515:52724 had rows of five). */
|
|
19
|
+
export declare const COLOR_PICKER_SWATCHES_PER_PAGE = 12;
|
|
20
|
+
export declare const COLOR_PICKER_SWATCHES_PER_ROW = 6;
|
|
20
21
|
/** Reads `#rgb`, `#rgba`, `#rrggbb` or `#rrggbbaa`, in either case; anything else is `null`. */
|
|
21
22
|
export declare function parseColor(input: string | null | undefined): Rgba | null;
|
|
22
23
|
/** `#rrggbb`, or `#rrggbbaa` when the color is not opaque. */
|
|
@@ -35,7 +36,7 @@ export declare const gridColor: (index: number) => string;
|
|
|
35
36
|
export declare function gridMove(index: number, key: string): number;
|
|
36
37
|
/** The item a key moves to in a list of `count` items (saved colors), or `index` itself. */
|
|
37
38
|
export declare function listMove(index: number, count: number, key: string): number;
|
|
38
|
-
/** Pages of saved colors: the colors and the Add button after them,
|
|
39
|
+
/** Pages of saved colors: the colors and the Add button after them, twelve to a page. */
|
|
39
40
|
export declare const swatchPageCount: (count: number) => number;
|
|
40
41
|
/**
|
|
41
42
|
* A point of the spectrum: hue from top to bottom, and from white at the leading edge through the full hue at the
|
|
@@ -10,7 +10,8 @@ type Rect = {
|
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
12
|
* Where the menu opens: at the pointer, under the element for the keyboard, or beside a touch-and-hold preview. A
|
|
13
|
-
* preview's `rect` is where it stands
|
|
13
|
+
* preview's `rect` is where it stands; once the menu is measured, `side` is the side of the preview it opens on and
|
|
14
|
+
* `shift` how far the preview moved up so that the menu stands whole below it.
|
|
14
15
|
*/
|
|
15
16
|
export type ContextMenuPresentation = {
|
|
16
17
|
kind: "pointer";
|
|
@@ -22,18 +23,23 @@ export type ContextMenuPresentation = {
|
|
|
22
23
|
kind: "preview";
|
|
23
24
|
rect: Rect;
|
|
24
25
|
radius: number;
|
|
25
|
-
align: "start" | "end";
|
|
26
|
+
align: "start" | "center" | "end";
|
|
27
|
+
side?: "top" | "bottom";
|
|
26
28
|
shift?: number;
|
|
27
29
|
};
|
|
28
30
|
/**
|
|
29
31
|
* The preview of a touch and hold: the element's box and corner (its own, or `--context-menu-preview-radius`), and
|
|
30
|
-
*
|
|
32
|
+
* where the menu keeps to across it, as iOS 27.2 places it by where the element stands on the screen, wherever the
|
|
33
|
+
* touch (ref-app menus-context, block 8): in the leading third its leading edge, in the trailing third its trailing
|
|
34
|
+
* edge, else its centre (a full-width row, a tile in the middle). The kit draws only Side=Leading and Side=Trailing.
|
|
35
|
+
* The screen is a PhoneLayout's box when the element is in one (a phone Dialog's scope has no box: the window is its
|
|
36
|
+
* screen), as for a menu that covers its trigger (menuTriggerCover.ts).
|
|
31
37
|
*/
|
|
32
|
-
export declare function contextMenuPreview(element: HTMLElement
|
|
38
|
+
export declare function contextMenuPreview(element: HTMLElement): ContextMenuPresentation;
|
|
33
39
|
/** The menu's side, alignment and offsets for a presentation. */
|
|
34
40
|
export declare function contextMenuPlacement(presentation: ContextMenuPresentation | null): {
|
|
35
|
-
side: "bottom";
|
|
36
|
-
align: "start" | "end";
|
|
41
|
+
side: "top" | "bottom";
|
|
42
|
+
align: "center" | "start" | "end";
|
|
37
43
|
sideOffset: number;
|
|
38
44
|
alignOffset: number;
|
|
39
45
|
};
|
|
@@ -63,6 +69,22 @@ export declare function contextMenuPreviewShift(rect: Rect, height: number, room
|
|
|
63
69
|
top: number;
|
|
64
70
|
bottom: number;
|
|
65
71
|
}, ceiling?: number, scale?: number): number;
|
|
72
|
+
/**
|
|
73
|
+
* The side a preview's menu opens on, and how far the preview moves up for it: above, unmoved, when the preview stands
|
|
74
|
+
* in the lower half of the room and the menu stands whole above it, as iOS 27.2 opens a menu toward the larger room
|
|
75
|
+
* (ref-app menus-context-small, block 8: a tile low on the screen opens its menu above, with room below too); else
|
|
76
|
+
* below, the preview moved up as `contextMenuPreviewShift` says.
|
|
77
|
+
*/
|
|
78
|
+
export declare function contextMenuPreviewLayout(rect: Rect, height: number, room: {
|
|
79
|
+
top: number;
|
|
80
|
+
bottom: number;
|
|
81
|
+
}, ceiling?: number, scale?: number): {
|
|
82
|
+
side: "top";
|
|
83
|
+
shift: number;
|
|
84
|
+
} | {
|
|
85
|
+
side: "bottom";
|
|
86
|
+
shift: number;
|
|
87
|
+
};
|
|
66
88
|
/** The top of the nearest box that clips the element: moved above it, the element would not be seen. */
|
|
67
89
|
export declare function contextMenuClipTop(element: HTMLElement): number;
|
|
68
90
|
/** A menu's height without the limit of the room it is given: the panel, and what its items scroll out of sight. */
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type CalendarCollisionPadding = {
|
|
2
|
+
top: number;
|
|
3
|
+
right: number;
|
|
4
|
+
bottom: number;
|
|
5
|
+
left: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const calendarCollisionPadding: (width: number) => CalendarCollisionPadding;
|
|
8
|
+
export declare const useCalendarCollisionPadding: () => CalendarCollisionPadding;
|
|
@@ -100,7 +100,7 @@ export type DialogHeaderProps = DialogSlotProps & {
|
|
|
100
100
|
export type DialogFooterProps = DialogSlotProps & {
|
|
101
101
|
/** How the bar meets the content scrolled under it in a phone Sheet. @default "soft" */
|
|
102
102
|
background?: DialogBarBackground;
|
|
103
|
-
/** Override the mobile action layout.
|
|
103
|
+
/** Override the mobile action layout. Two alert actions default to inline, three or more and sheets to stacked. */
|
|
104
104
|
mobileLayout?: "inline" | "stacked";
|
|
105
105
|
};
|
|
106
106
|
export type DialogStepsProps = {
|
|
@@ -16,3 +16,8 @@ export declare const PhoneLayout: ({ className, children, ref, ...rest }: PhoneL
|
|
|
16
16
|
* in a window 767px wide or narrower. The server answers false outside a PhoneLayout.
|
|
17
17
|
*/
|
|
18
18
|
export declare const usePhoneLayout: () => boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the window is 767px wide or narrower, whatever PhoneLayout is around: for a part portaled out of one, which
|
|
21
|
+
* its phone rules do not reach (a Select's list). The server answers false.
|
|
22
|
+
*/
|
|
23
|
+
export declare const usePhoneWindow: () => boolean;
|
|
@@ -26,10 +26,10 @@ export type PopoverContentProps = {
|
|
|
26
26
|
*/
|
|
27
27
|
avoidCollisions?: boolean;
|
|
28
28
|
/**
|
|
29
|
-
* Distance in pixels to keep from viewport and scroll container boundaries.
|
|
29
|
+
* Distance in pixels to keep from viewport and scroll container boundaries; an object sets it per side, and a side it leaves out gets 0.
|
|
30
30
|
* @default 20
|
|
31
31
|
*/
|
|
32
|
-
collisionPadding?:
|
|
32
|
+
collisionPadding?: Popper.PopperContentProps["collisionPadding"];
|
|
33
33
|
/**
|
|
34
34
|
* Set the `width` of the popover, in pixels.
|
|
35
35
|
* @default auto
|
|
@@ -43,10 +43,7 @@ export type ProgressStepsProps = {
|
|
|
43
43
|
export declare const ProgressSteps: {
|
|
44
44
|
({ current, total, variant, color, orientation, size, connectorStyle, children, className, }: ProgressStepsProps): import("react/jsx-runtime").JSX.Element;
|
|
45
45
|
Step: ({ children, icon, _index }: StepProps) => import("react/jsx-runtime").JSX.Element;
|
|
46
|
-
Title: ({ children, className }:
|
|
47
|
-
children: ReactNode;
|
|
48
|
-
className?: string;
|
|
49
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
Title: ({ children, className, visuallyHidden }: TitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
50
47
|
Description: ({ children, className }: {
|
|
51
48
|
children: ReactNode;
|
|
52
49
|
className?: string;
|
|
@@ -60,4 +57,14 @@ export type StepProps = {
|
|
|
60
57
|
/** @internal - injected by parent */
|
|
61
58
|
_index?: number;
|
|
62
59
|
};
|
|
60
|
+
export type TitleProps = {
|
|
61
|
+
children: ReactNode;
|
|
62
|
+
className?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Hides the title from view and keeps it for screen readers, for steps that show their indicators alone: an icon
|
|
65
|
+
* or a check has no name. The step then takes no room under its indicator.
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
68
|
+
visuallyHidden?: boolean;
|
|
69
|
+
};
|
|
63
70
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ProgressSteps, type ProgressStepsProps, type StepProps } from "./ProgressSteps.js";
|
|
1
|
+
export { ProgressSteps, type ProgressStepsProps, type StepProps, type TitleProps } from "./ProgressSteps.js";
|
|
@@ -160,10 +160,17 @@ export type SelectProps<T extends Option> = (SingleSelectProps<T> | MultiSelectP
|
|
|
160
160
|
*/
|
|
161
161
|
opticallyAlign?: "start" | "end";
|
|
162
162
|
/**
|
|
163
|
-
* Display a clear action that allows the select to be unset.
|
|
163
|
+
* Display a clear action that allows the select to be unset. On a phone it is the first row of the list, `noneLabel`,
|
|
164
|
+
* as an iOS pop-up button unsets its value with a None row instead of a clear button; a custom `trigger` keeps its
|
|
165
|
+
* own clearing and gets no None row.
|
|
164
166
|
* @default false
|
|
165
167
|
*/
|
|
166
168
|
clearable?: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* Label of the row that unsets a `clearable` select on a phone
|
|
171
|
+
* @default None
|
|
172
|
+
*/
|
|
173
|
+
noneLabel?: string;
|
|
167
174
|
/**
|
|
168
175
|
* Extends select to 100% of available width.
|
|
169
176
|
* @default true
|
|
@@ -171,6 +178,7 @@ export type SelectProps<T extends Option> = (SingleSelectProps<T> | MultiSelectP
|
|
|
171
178
|
block?: boolean;
|
|
172
179
|
/**
|
|
173
180
|
* The preferred side of the trigger to render against when open. Will be reversed when collisions occur.
|
|
181
|
+
* Without one the list opens below its trigger, and on a phone over it, toward the larger part of the screen.
|
|
174
182
|
* @default bottom
|
|
175
183
|
*/
|
|
176
184
|
side?: PopoverSide;
|
|
@@ -211,8 +219,8 @@ export type SelectProps<T extends Option> = (SingleSelectProps<T> | MultiSelectP
|
|
|
211
219
|
/** Accessible name of the search input, independent of the trigger label. */
|
|
212
220
|
searchAriaLabel?: string;
|
|
213
221
|
/**
|
|
214
|
-
* Size of the search input in the menu
|
|
215
|
-
*
|
|
222
|
+
* Size of the search input in the menu. A phone list has no search: it is
|
|
223
|
+
* an iOS menu, and a long one scrolls.
|
|
216
224
|
* @default md
|
|
217
225
|
*/
|
|
218
226
|
searchSize?: ControlSize;
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { StatsCard, type StatsCardProps } from "../StatsCard/index.js";
|
|
2
|
+
/** @deprecated Renamed to `StatsCard`: `import { StatsCard } from "@plexui/ui/components/StatsCard"`. */
|
|
3
|
+
export declare const StatCard: typeof StatsCard;
|
|
4
|
+
/** @deprecated Renamed to `StatsCardProps`. */
|
|
5
|
+
export type StatCardProps = StatsCardProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode, type Ref } from "react";
|
|
2
|
-
export type
|
|
2
|
+
export type StatsCardProps = {
|
|
3
3
|
/** Label describing the metric */
|
|
4
4
|
label: string;
|
|
5
5
|
/** The primary metric value (e.g. "1,234" or "$50K") */
|
|
@@ -15,20 +15,20 @@ export type StatCardProps = {
|
|
|
15
15
|
};
|
|
16
16
|
/** When true, a positive trend is bad (red) and negative is good (green). Use for metrics like "Error Rate" or "Avg Completion Time". */
|
|
17
17
|
invertTrend?: boolean;
|
|
18
|
-
/** Icon
|
|
18
|
+
/** Icon in a small tile with a soft background, at the end of the header */
|
|
19
19
|
icon?: ReactNode;
|
|
20
20
|
/** Optional ReactNode for a sparkline/chart rendered at the bottom */
|
|
21
21
|
sparkline?: ReactNode;
|
|
22
22
|
/** Progress value from 0 to 100. Shows a progress bar at the bottom. */
|
|
23
23
|
progress?: number;
|
|
24
|
-
/** Label displayed
|
|
24
|
+
/** Label displayed after the progress bar */
|
|
25
25
|
progressLabel?: string;
|
|
26
26
|
/** Tooltip text — renders an (i) icon next to the label with a tooltip on hover */
|
|
27
27
|
tooltip?: string;
|
|
28
28
|
/**
|
|
29
29
|
* Where the trend indicator is positioned
|
|
30
|
-
* - `"value"` —
|
|
31
|
-
* - `"header"` — right-aligned in the header row
|
|
30
|
+
* - `"value"` — under the value, with its label (default)
|
|
31
|
+
* - `"header"` — right-aligned in the header row, its label under the value
|
|
32
32
|
* @default "value"
|
|
33
33
|
*/
|
|
34
34
|
trendPosition?: "value" | "header";
|
|
@@ -52,7 +52,7 @@ export type StatCardProps = {
|
|
|
52
52
|
*/
|
|
53
53
|
variant?: "default" | "accent";
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* Color of the accent variant's bar
|
|
56
56
|
* @default "primary"
|
|
57
57
|
*/
|
|
58
58
|
accentColor?: "primary" | "secondary" | "info" | "success" | "warning" | "danger" | "discovery" | "caution";
|
|
@@ -61,4 +61,4 @@ export type StatCardProps = {
|
|
|
61
61
|
/** Ref applied to the card container */
|
|
62
62
|
ref?: Ref<HTMLDivElement>;
|
|
63
63
|
};
|
|
64
|
-
export declare const
|
|
64
|
+
export declare const StatsCard: ({ label, value, description, trend, invertTrend, icon, sparkline, progress, progressLabel, tooltip, trendPosition, trendVariant, size, variant, accentColor, className, ref, ...restProps }: StatsCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { StatsCard, type StatsCardProps } from "./StatsCard.js";
|
|
@@ -18,7 +18,7 @@ export type SwipeActionsProps = {
|
|
|
18
18
|
leading?: SwipeAction[];
|
|
19
19
|
/** Actions revealed by a swipe toward the leading edge, the first one at the trailing edge */
|
|
20
20
|
trailing?: SwipeAction[];
|
|
21
|
-
/** Where the actions show their labels: `"hidden"` (symbols only), `"inside"` the capsule, or `"below"` it (for rows of
|
|
21
|
+
/** Where the actions show their labels: `"hidden"` (symbols only), `"inside"` the capsule, or `"below"` it (for rows of 60px and taller, as iOS sets them). @default "hidden" */
|
|
22
22
|
labelPlacement?: "hidden" | "inside" | "below";
|
|
23
23
|
/** A swipe past the middle between the open actions and the far edge runs the first action of that side. @default true */
|
|
24
24
|
fullSwipe?: boolean;
|
|
@@ -42,6 +42,11 @@ export type TabBarProps = {
|
|
|
42
42
|
onMinimizedChange?: (minimized: boolean) => void;
|
|
43
43
|
/** How the bar meets the content scrolled under it; see `BarBackground`. @default "soft" */
|
|
44
44
|
background?: BarBackground;
|
|
45
|
+
/**
|
|
46
|
+
* Content in a glass capsule above the tabs, a now playing row or a status, as the iOS 27 bottom accessory;
|
|
47
|
+
* minimized, it stands between the two circles. The bar grows by its height.
|
|
48
|
+
*/
|
|
49
|
+
accessory?: ReactNode;
|
|
45
50
|
/** Accessible name of the navigation. @default "Tabs" */
|
|
46
51
|
"aria-label"?: string;
|
|
47
52
|
/** `TabBar.Item` elements. */
|
|
@@ -56,7 +61,7 @@ export type TabBarProps = {
|
|
|
56
61
|
* search or prominent tab in a circle of its own. It minimizes to the selected tab while the content scrolls
|
|
57
62
|
* down. A desktop layout navigates with a Sidebar or Tabs, so the bar never renders from 768px up.
|
|
58
63
|
*/
|
|
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;
|
|
64
|
+
declare function TabBarRoot({ value: valueProp, defaultValue, onValueChange, search, prominent, minimizeBehavior, minimized: minimizedProp, defaultMinimized, onMinimizedChange, background, accessory, "aria-label": ariaLabel, children, className, ref, }: TabBarProps): import("react/jsx-runtime").JSX.Element;
|
|
60
65
|
declare namespace TabBarRoot {
|
|
61
66
|
var displayName: string;
|
|
62
67
|
}
|
|
@@ -67,6 +72,11 @@ export type TabBarItemProps = {
|
|
|
67
72
|
label: string;
|
|
68
73
|
/** The symbol, a PlexUI icon. */
|
|
69
74
|
icon: ReactNode;
|
|
75
|
+
/**
|
|
76
|
+
* A count or a short word in a red capsule over the symbol, as an iOS tab badge; it is read after the label.
|
|
77
|
+
* A count of 0 shows none, as on iOS.
|
|
78
|
+
*/
|
|
79
|
+
badge?: ReactNode;
|
|
70
80
|
/** Makes the tab a link to this URL. */
|
|
71
81
|
href?: string;
|
|
72
82
|
/** When `true`, the tab cannot be selected. */
|
|
@@ -78,7 +88,7 @@ export type TabBarItemProps = {
|
|
|
78
88
|
/** @internal The search and the prominent tab show their symbol only. */
|
|
79
89
|
hideLabel?: boolean;
|
|
80
90
|
};
|
|
81
|
-
declare function TabBarItem({ value, label, icon, href, disabled, onClick, className, hideLabel }: TabBarItemProps): import("react/jsx-runtime").JSX.Element;
|
|
91
|
+
declare function TabBarItem({ value, label, icon, badge, href, disabled, onClick, className, hideLabel }: TabBarItemProps): import("react/jsx-runtime").JSX.Element;
|
|
82
92
|
declare namespace TabBarItem {
|
|
83
93
|
var displayName: string;
|
|
84
94
|
}
|
|
@@ -34,6 +34,9 @@ export type TabsProps<T extends string> = {
|
|
|
34
34
|
* | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- |
|
|
35
35
|
* | `22px` | `24px` | `26px` | `28px` | `32px` | `36px` | `40px` | `44px` | `48px` |
|
|
36
36
|
*
|
|
37
|
+
* On a phone horizontal tabs take the two sizes of the iOS 27 segmented control: `sm` and smaller the small 32px
|
|
38
|
+
* one, `md` and larger the large 48px one (49px with `mobileMaterial="flat"`).
|
|
39
|
+
*
|
|
37
40
|
* @default md
|
|
38
41
|
*/
|
|
39
42
|
"size"?: ControlSize;
|
|
@@ -79,6 +82,15 @@ export type TabsProps<T extends string> = {
|
|
|
79
82
|
* @default "More"
|
|
80
83
|
*/
|
|
81
84
|
"overflowLabel"?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Phone surface of horizontal tabs. On a phone the large control (`md` and larger) is the glass capsule of iOS 27
|
|
87
|
+
* apps and the small one (`sm` and smaller) the plain capsule of SwiftUI's segmented Picker; `flat` gives the large
|
|
88
|
+
* one the plain look of SwiftUI's `.controlSize(.large)`, and `glass` gives the small one `.glassEffect()`, as the
|
|
89
|
+
* Button prop of the same name does for a button. Inside a phone Toolbar the control is the large glass one
|
|
90
|
+
* anyway. Desktop keeps the chosen variant.
|
|
91
|
+
* @default "glass" at md and larger, "flat" at sm and smaller
|
|
92
|
+
*/
|
|
93
|
+
"mobileMaterial"?: "glass" | "flat";
|
|
82
94
|
"className"?: string;
|
|
83
95
|
"children": React.ReactNode;
|
|
84
96
|
};
|
|
@@ -17,7 +17,7 @@ export type BarBackground = "soft" | "hard" | "glass" | "solid";
|
|
|
17
17
|
export type ToolbarBackground = BarBackground | "edge";
|
|
18
18
|
/**
|
|
19
19
|
* A surface that places phone toolbars: `Page` puts the top bar over its content
|
|
20
|
-
* and reserves the space; `Dialog` puts it under the Sheet's
|
|
20
|
+
* and reserves the space; `Dialog` puts it 16px under the Sheet's top edge.
|
|
21
21
|
*/
|
|
22
22
|
export type ToolbarHost = {
|
|
23
23
|
kind: "page" | "dialog";
|
|
@@ -11,9 +11,23 @@ export type MenuTriggerCover = {
|
|
|
11
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
12
|
* row of Files' View Options; IMG_5687, IMG_5689, and IMG_5693 from a bottom bar). Reports the side offset that puts
|
|
13
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.
|
|
14
|
+
* where the menu keeps its gap below the control. `windowOnly` takes only a phone-wide window for a phone, for a list
|
|
15
|
+
* that is laid out as on a phone only there (Select: its list keeps no phone scope in a PhoneLayout).
|
|
15
16
|
*/
|
|
16
|
-
export declare function observeMenuTriggerCover(trigger: HTMLElement, onChange: (cover: MenuTriggerCover | null) => void
|
|
17
|
+
export declare function observeMenuTriggerCover(trigger: HTMLElement, onChange: (cover: MenuTriggerCover | null) => void, { windowOnly }?: {
|
|
18
|
+
windowOnly?: boolean;
|
|
19
|
+
}): () => void;
|
|
20
|
+
/**
|
|
21
|
+
* A phone menu that covers its trigger whole hides it while it is open, as iOS 27.2 turns a bar button into its menu
|
|
22
|
+
* (ref-app menus-bar, block 8: the More button is gone under the panel). Kept, the round 44pt button showed past the
|
|
23
|
+
* panel's 34pt corner and through its glass. A trigger the panel leaves a part of uncovered stays: one wider than the
|
|
24
|
+
* panel (a form row), one beside it (an align offset), one at the screen's edge past a panel kept off that edge.
|
|
25
|
+
* Marks the trigger `data-menu-covered` (touch.css) while it lies within the panel's resting box, and clears the mark
|
|
26
|
+
* on cleanup. That box is the primitive's positioned wrapper around the panel: the panel itself grows in from a
|
|
27
|
+
* smaller scale as it opens. The boxes are read again whenever the wrapper moves or either element resizes: the
|
|
28
|
+
* wrapper first stands off screen until it is placed, and a panel can mount with no size yet.
|
|
29
|
+
*/
|
|
30
|
+
export declare function markCoveredMenuTrigger(trigger: HTMLElement, content: HTMLElement): () => void;
|
|
17
31
|
/**
|
|
18
32
|
* 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
33
|
* the pointer when the button comes up, and that release would choose the item there. Cancels the release of the press
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plexui/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.43.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.
|
|
102
|
+
"@plexui/styles": "^0.2.0",
|
|
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",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { useWindowSize } from "usehooks-ts";
|
|
2
|
-
// Split the space left by seven 44px days across two outer and two inner
|
|
3
|
-
// gutters. Calendar.module.css uses the same formula for its content width.
|
|
4
|
-
export const useCalendarGutter = () => {
|
|
5
|
-
const { width } = useWindowSize({ initializeWithValue: false });
|
|
6
|
-
return width === undefined ? 16 : Math.max(3, Math.min(16, (width - 308) / 4));
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=useCalendarGutter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCalendarGutter.js","sourceRoot":"","sources":["../../../../src/components/DatePicker/useCalendarGutter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,yEAAyE;AACzE,4EAA4E;AAC5E,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAW,EAAE;IAC5C,MAAM,EAAE,KAAK,EAAE,GAAG,aAAa,CAAC,EAAE,mBAAmB,EAAE,KAAK,EAAE,CAAC,CAAA;IAC/D,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AAChF,CAAC,CAAA","sourcesContent":["import { useWindowSize } from \"usehooks-ts\"\n\n// Split the space left by seven 44px days across two outer and two inner\n// gutters. Calendar.module.css uses the same formula for its content width.\nexport const useCalendarGutter = (): number => {\n const { width } = useWindowSize({ initializeWithValue: false })\n return width === undefined ? 16 : Math.max(3, Math.min(16, (width - 308) / 4))\n}\n"]}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import clsx from "clsx";
|
|
4
|
-
import {} from "react";
|
|
5
|
-
import { Badge } from "../Badge/index.js";
|
|
6
|
-
import { InfoCircle } from "../Icon/index.js";
|
|
7
|
-
import { Tooltip } from "../Tooltip/index.js";
|
|
8
|
-
import s from "@plexui/styles/components/StatCard/StatCard.module.css";
|
|
9
|
-
export const StatCard = ({ label, value, description, trend, invertTrend, icon, sparkline, progress, progressLabel, tooltip, trendPosition = "value", trendVariant = "text", size = "default", variant = "default", accentColor = "primary", className, ref, ...restProps }) => {
|
|
10
|
-
const trendValue = trend?.value ?? 0;
|
|
11
|
-
const trendClassName = trendValue === 0
|
|
12
|
-
? s.TrendNeutral
|
|
13
|
-
: trendValue > 0
|
|
14
|
-
? invertTrend
|
|
15
|
-
? s.TrendNegative
|
|
16
|
-
: s.TrendPositive
|
|
17
|
-
: invertTrend
|
|
18
|
-
? s.TrendPositive
|
|
19
|
-
: s.TrendNegative;
|
|
20
|
-
const trendText = `${trendValue > 0 ? "+" : ""}${trendValue}%`;
|
|
21
|
-
const progressValue = progress === undefined ? undefined : Math.min(100, Math.max(0, progress));
|
|
22
|
-
const trendBadgeColor = trendValue === 0
|
|
23
|
-
? "secondary"
|
|
24
|
-
: trendValue > 0
|
|
25
|
-
? invertTrend
|
|
26
|
-
? "danger"
|
|
27
|
-
: "success"
|
|
28
|
-
: invertTrend
|
|
29
|
-
? "success"
|
|
30
|
-
: "danger";
|
|
31
|
-
const trendEl = trend != null && (trendVariant === "badge" ? (_jsx(Badge, { size: "sm", color: trendBadgeColor, children: trendText })) : (_jsx("div", { className: clsx(s.Trend, trendClassName), children: trendText })));
|
|
32
|
-
const headerEl = (_jsxs("div", { className: s.Header, children: [_jsxs("div", { className: s.LabelRow, children: [_jsx("div", { className: s.Label, children: label }), tooltip && (_jsx(Tooltip, { content: tooltip, children: _jsx("span", { className: s.InfoIcon, tabIndex: 0, role: "img", "aria-label": "More information", children: _jsx(InfoCircle, {}) }) }))] }), trendPosition === "header" && trendEl && (_jsx("div", { className: s.HeaderEnd, children: trendEl }))] }));
|
|
33
|
-
const valueRowEl = (_jsxs("div", { className: s.ValueRow, children: [_jsx("div", { className: s.Value, children: value }), trendPosition === "value" && trendEl, description && _jsx("div", { className: s.Description, children: description })] }));
|
|
34
|
-
const footerEl = trend?.label ? (_jsx("div", { className: s.Footer, children: _jsx("div", { className: s.TrendLabel, children: trend.label }) })) : null;
|
|
35
|
-
const progressEl = (progressValue !== undefined || progressLabel) ? (_jsxs("div", { className: s.Progress, children: [_jsx("div", { className: s.ProgressTrack, children: _jsx("div", { className: s.ProgressBar, style: { width: `${progressValue ?? 0}%` }, "aria-hidden": true }) }), progressLabel && _jsx("div", { className: s.ProgressLabel, children: progressLabel })] })) : null;
|
|
36
|
-
const sparklineEl = sparkline ? _jsx("div", { className: s.Sparkline, children: sparkline }) : null;
|
|
37
|
-
return (_jsx("div", { ref: ref, className: clsx(s.StatCard, className), "data-variant": variant, "data-size": size, "data-accent-color": accentColor, ...restProps, children: icon ? (_jsxs("div", { className: s.Body, children: [_jsx("div", { className: s.IconWrapper, children: icon }), _jsxs("div", { className: s.Content, children: [headerEl, valueRowEl, footerEl, progressEl, sparklineEl] })] })) : (_jsxs(_Fragment, { children: [headerEl, valueRowEl, footerEl, progressEl, sparklineEl] })) }));
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=StatCard.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StatCard.js","sourceRoot":"","sources":["../../../../src/components/StatCard/StatCard.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAA4B,MAAM,OAAO,CAAA;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,CAAC,MAAM,wDAAwD,CAAA;AAiEtE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EACvB,KAAK,EACL,KAAK,EACL,WAAW,EACX,KAAK,EACL,WAAW,EACX,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,aAAa,EACb,OAAO,EACP,aAAa,GAAG,OAAO,EACvB,YAAY,GAAG,MAAM,EACrB,IAAI,GAAG,SAAS,EAChB,OAAO,GAAG,SAAS,EACnB,WAAW,GAAG,SAAS,EACvB,SAAS,EACT,GAAG,EACH,GAAG,SAAS,EACE,EAAE,EAAE;IAClB,MAAM,UAAU,GAAG,KAAK,EAAE,KAAK,IAAI,CAAC,CAAA;IACpC,MAAM,cAAc,GAClB,UAAU,KAAK,CAAC;QACd,CAAC,CAAC,CAAC,CAAC,YAAY;QAChB,CAAC,CAAC,UAAU,GAAG,CAAC;YACd,CAAC,CAAC,WAAW;gBACX,CAAC,CAAC,CAAC,CAAC,aAAa;gBACjB,CAAC,CAAC,CAAC,CAAC,aAAa;YACnB,CAAC,CAAC,WAAW;gBACX,CAAC,CAAC,CAAC,CAAC,aAAa;gBACjB,CAAC,CAAC,CAAC,CAAC,aAAa,CAAA;IAEzB,MAAM,SAAS,GAAG,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,UAAU,GAA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AS,EAAE,CAAC,CAAC,IAAI,aACpB,cAAK,SAAS,EAAE,CAAC,CAAC,WAAW,YAAG,IAAI,GAAO,EAC3C,eAAK,SAAS,EAAE,CAAC,CAAC,OAAO,aACtB,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,UAAU,EACV,WAAW,IACR,IACF,CACP,CAAC,CAAC,CAAC,CACF,8BACG,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,UAAU,EACV,WAAW,IACX,CACJ,GACG,CACP,CAAA;AACH,CAAC,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport { type ReactNode, type Ref } from \"react\"\nimport { Badge } from \"../Badge\"\nimport { InfoCircle } from \"../Icon\"\nimport { Tooltip } from \"../Tooltip\"\nimport s from \"@plexui/styles/components/StatCard/StatCard.module.css\"\n\nexport type StatCardProps = {\n /** Label describing the metric */\n label: string\n /** The primary metric value (e.g. \"1,234\" or \"$50K\") */\n value: ReactNode\n /** Optional description or subtitle below the value */\n description?: string\n /** Trend indicator with percentage change */\n trend?: {\n /** The percentage change value (e.g. 12.5 for +12.5%) */\n value: number\n /** Optional label for the trend (e.g. \"vs last month\") */\n label?: string\n }\n /** When true, a positive trend is bad (red) and negative is good (green). Use for metrics like \"Error Rate\" or \"Avg Completion Time\". */\n invertTrend?: boolean\n /** Icon displayed on the left side with a soft background */\n icon?: ReactNode\n /** Optional ReactNode for a sparkline/chart rendered at the bottom */\n sparkline?: ReactNode\n /** Progress value from 0 to 100. Shows a progress bar at the bottom. */\n progress?: number\n /** Label displayed next to the progress bar */\n progressLabel?: string\n /** Tooltip text — renders an (i) icon next to the label with a tooltip on hover */\n tooltip?: string\n /**\n * Where the trend indicator is positioned\n * - `\"value\"` — next to the value (default)\n * - `\"header\"` — right-aligned in the header row\n * @default \"value\"\n */\n trendPosition?: \"value\" | \"header\"\n /**\n * Visual style of the trend indicator\n * - `\"text\"` — plain colored text (default)\n * - `\"badge\"` — wrapped in a Badge component\n * @default \"text\"\n */\n trendVariant?: \"text\" | \"badge\"\n /**\n * Size of the card\n * - `\"default\"` — standard dashboard card\n * - `\"sm\"` — compact card for dense layouts\n * @default \"default\"\n */\n size?: \"default\" | \"sm\"\n /**\n * Visual variant of the card\n * @default \"default\"\n */\n variant?: \"default\" | \"accent\"\n /**\n * Accent border color for the \"accent\" variant\n * @default \"primary\"\n */\n accentColor?: \"primary\" | \"secondary\" | \"info\" | \"success\" | \"warning\" | \"danger\" | \"discovery\" | \"caution\"\n /** Class applied to the card container */\n className?: string\n /** Ref applied to the card container */\n ref?: Ref<HTMLDivElement>\n}\n\nexport const StatCard = ({\n label,\n value,\n description,\n trend,\n invertTrend,\n icon,\n sparkline,\n progress,\n progressLabel,\n tooltip,\n trendPosition = \"value\",\n trendVariant = \"text\",\n size = \"default\",\n variant = \"default\",\n accentColor = \"primary\",\n className,\n ref,\n ...restProps\n}: StatCardProps) => {\n const trendValue = trend?.value ?? 0\n const trendClassName =\n trendValue === 0\n ? s.TrendNeutral\n : trendValue > 0\n ? invertTrend\n ? s.TrendNegative\n : s.TrendPositive\n : invertTrend\n ? s.TrendPositive\n : s.TrendNegative\n\n const trendText = `${trendValue > 0 ? \"+\" : \"\"}${trendValue}%`\n const progressValue =\n progress === undefined ? undefined : Math.min(100, Math.max(0, progress))\n\n const trendBadgeColor =\n trendValue === 0\n ? \"secondary\"\n : trendValue > 0\n ? invertTrend\n ? \"danger\"\n : \"success\"\n : invertTrend\n ? \"success\"\n : \"danger\"\n\n const trendEl = trend != null && (\n trendVariant === \"badge\" ? (\n <Badge size=\"sm\" color={trendBadgeColor as \"secondary\" | \"success\" | \"danger\"}>\n {trendText}\n </Badge>\n ) : (\n <div className={clsx(s.Trend, trendClassName)}>\n {trendText}\n </div>\n )\n )\n\n const headerEl = (\n <div className={s.Header}>\n <div className={s.LabelRow}>\n <div className={s.Label}>{label}</div>\n {tooltip && (\n <Tooltip content={tooltip}>\n {/* Focusable and named so keyboard and screen-reader users reach the tooltip */}\n <span className={s.InfoIcon} tabIndex={0} role=\"img\" aria-label=\"More information\">\n <InfoCircle />\n </span>\n </Tooltip>\n )}\n </div>\n {trendPosition === \"header\" && trendEl && (\n <div className={s.HeaderEnd}>{trendEl}</div>\n )}\n </div>\n )\n\n const valueRowEl = (\n <div className={s.ValueRow}>\n <div className={s.Value}>{value}</div>\n {trendPosition === \"value\" && trendEl}\n {description && <div className={s.Description}>{description}</div>}\n </div>\n )\n\n const footerEl = trend?.label ? (\n <div className={s.Footer}>\n <div className={s.TrendLabel}>{trend.label}</div>\n </div>\n ) : null\n\n const progressEl = (progressValue !== undefined || progressLabel) ? (\n <div className={s.Progress}>\n <div className={s.ProgressTrack}>\n <div\n className={s.ProgressBar}\n style={{ width: `${progressValue ?? 0}%` }}\n aria-hidden\n />\n </div>\n {progressLabel && <div className={s.ProgressLabel}>{progressLabel}</div>}\n </div>\n ) : null\n\n const sparklineEl = sparkline ? <div className={s.Sparkline}>{sparkline}</div> : null\n\n return (\n <div\n ref={ref}\n className={clsx(s.StatCard, className)}\n data-variant={variant}\n data-size={size}\n data-accent-color={accentColor}\n {...restProps}\n >\n {icon ? (\n <div className={s.Body}>\n <div className={s.IconWrapper}>{icon}</div>\n <div className={s.Content}>\n {headerEl}\n {valueRowEl}\n {footerEl}\n {progressEl}\n {sparklineEl}\n </div>\n </div>\n ) : (\n <>\n {headerEl}\n {valueRowEl}\n {footerEl}\n {progressEl}\n {sparklineEl}\n </>\n )}\n </div>\n )\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useCalendarGutter: () => number;
|