@passui/react 0.1.45 → 0.1.46
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/README.md +57 -46
- package/dist/types/src/components/accordion/accordion.d.ts +1 -1
- package/dist/types/src/components/breadcrumb/breadcrumb.d.ts +1 -1
- package/dist/types/src/components/inline-disclosure/inline-disclosure.d.ts +1 -1
- package/dist/types/src/components/popover/anchored-surface.d.ts +5 -1
- package/dist/types/src/components/popover/index.d.ts +41 -0
- package/dist/types/src/components/popover/popover-content.d.ts +32 -0
- package/dist/types/src/components/popover/popover-root.d.ts +22 -0
- package/dist/types/src/components/popover/popover-trigger.d.ts +23 -0
- package/dist/types/src/components/stepper/rolling-digit.d.ts +1 -1
- package/dist/types/src/components/table/table.d.ts +1 -1
- package/dist/types/src/components/view-controller/view-controller.d.ts +2 -2
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/machines/popover.machine.d.ts +30 -0
- package/package.json +307 -307
- package/src/appearance/index.ts +2 -2
- package/src/appearance/platform.tsx +76 -60
- package/src/appearance/theme.tsx +409 -377
- package/src/components/accordion/accordion.tsx +58 -49
- package/src/components/ambient/ambient.tsx +25 -25
- package/src/components/ambient/index.ts +1 -1
- package/src/components/aspect-ratio/aspect-ratio.tsx +21 -16
- package/src/components/breadcrumb/breadcrumb.tsx +63 -57
- package/src/components/button/button-styles.ts +39 -32
- package/src/components/button/button.tsx +91 -84
- package/src/components/button/icon-button.tsx +27 -25
- package/src/components/button/pending-spinner.tsx +8 -8
- package/src/components/button/use-pending-indicator.ts +11 -11
- package/src/components/chip/chip.tsx +35 -30
- package/src/components/code-block/code-block.tsx +40 -39
- package/src/components/combo-box/combo-box.tsx +5 -5
- package/src/components/command/command.tsx +124 -94
- package/src/components/compact-date-picker/calendar-month.ts +75 -53
- package/src/components/compact-date-picker/compact-date-picker.tsx +308 -289
- package/src/components/compact-time-picker/compact-time-picker.tsx +288 -281
- package/src/components/compact-time-picker/time-value.ts +32 -29
- package/src/components/content-unavailable-view/content-unavailable-view.tsx +64 -48
- package/src/components/content-view/content-view.tsx +168 -159
- package/src/components/content-view/index.ts +1 -1
- package/src/components/context-menu/conceal-menu-source.ts +25 -25
- package/src/components/context-menu/context-menu-host.tsx +439 -402
- package/src/components/context-menu/context-menu-store.ts +125 -123
- package/src/components/context-menu/menu-navigation.ts +25 -18
- package/src/components/context-menu/menu-position.ts +33 -29
- package/src/components/context-menu/menu-reveal.ts +32 -32
- package/src/components/context-menu/use-context-menu.ts +63 -56
- package/src/components/conversation/conversation.tsx +265 -263
- package/src/components/conversation/index.ts +1 -1
- package/src/components/date-picker/date-picker.tsx +95 -94
- package/src/components/date-picker/date-value.ts +20 -10
- package/src/components/dialog/dialog-host.tsx +105 -103
- package/src/components/dialog/dialog-store.ts +37 -36
- package/src/components/dialog/dialog.tsx +192 -179
- package/src/components/dialog/index.ts +1 -1
- package/src/components/disclosure-group/disclosure-group.tsx +93 -86
- package/src/components/divider/divider.tsx +24 -22
- package/src/components/inline-disclosure/inline-disclosure.tsx +40 -36
- package/src/components/keyboard-shortcut/keyboard-shortcut.tsx +23 -19
- package/src/components/labeled-content/labeled-content.tsx +68 -68
- package/src/components/locale-switcher/index.ts +1 -1
- package/src/components/locale-switcher/locale-switcher.tsx +279 -251
- package/src/components/menu/menu.tsx +75 -58
- package/src/components/morph/index.ts +2 -2
- package/src/components/morph/morph.tsx +227 -201
- package/src/components/morph/use-morph-disclosure.ts +19 -19
- package/src/components/one-time-code/one-time-code.tsx +216 -200
- package/src/components/picker/picker-trigger.ts +16 -13
- package/src/components/picker/picker.tsx +371 -345
- package/src/components/popover/anchored-surface.tsx +253 -229
- package/src/components/popover/index.ts +50 -0
- package/src/components/popover/popover-content.tsx +334 -0
- package/src/components/popover/popover-fit.ts +58 -53
- package/src/components/popover/popover-root.tsx +97 -0
- package/src/components/popover/popover-trigger.tsx +71 -0
- package/src/components/profile-image/profile-image.tsx +80 -64
- package/src/components/progress-view/progress-view.tsx +61 -59
- package/src/components/progress-view/use-liquid-progress.ts +38 -38
- package/src/components/radio-group/radio-group.tsx +71 -68
- package/src/components/search-field/expanding-search-field.tsx +191 -177
- package/src/components/search-field/search-field.tsx +59 -50
- package/src/components/search-list/search-list.tsx +246 -236
- package/src/components/section/section.tsx +58 -58
- package/src/components/secure-field/secure-field.tsx +3 -3
- package/src/components/segmented-control/segmented-control.tsx +136 -136
- package/src/components/sheet/modal-environment.ts +71 -64
- package/src/components/sheet/sheet-portal.tsx +58 -53
- package/src/components/sheet/sheet.tsx +146 -141
- package/src/components/sheet/use-sheet-focus.ts +97 -82
- package/src/components/sidebar/sidebar.tsx +78 -78
- package/src/components/skeleton/skeleton.tsx +30 -21
- package/src/components/slider/slider.tsx +113 -104
- package/src/components/slosh-slider/liquid-step.ts +32 -31
- package/src/components/slosh-slider/slosh-slider.tsx +265 -228
- package/src/components/stat-tile/index.ts +1 -1
- package/src/components/stat-tile/stat-tile.tsx +79 -68
- package/src/components/status-indicator/status-indicator.tsx +40 -37
- package/src/components/stepper/rolling-digit.tsx +82 -68
- package/src/components/stepper/stepper.tsx +122 -113
- package/src/components/swatch-picker/swatch-picker.tsx +120 -120
- package/src/components/tab-bar/tab-bar.tsx +149 -148
- package/src/components/tab-view/tab-view.tsx +140 -137
- package/src/components/table/table.tsx +117 -98
- package/src/components/text-editor/text-editor.tsx +34 -29
- package/src/components/text-field/text-field.tsx +182 -180
- package/src/components/toast/toast-store.ts +127 -115
- package/src/components/toast/toaster.tsx +361 -347
- package/src/components/toggle/toggle.tsx +297 -282
- package/src/components/tooltip/tooltip-host.tsx +157 -150
- package/src/components/view-controller/index.ts +1 -1
- package/src/components/view-controller/view-controller.tsx +64 -53
- package/src/components/wake-slider/wake-slider.tsx +220 -205
- package/src/hooks/scroll/minimize-decision.ts +11 -7
- package/src/hooks/use-anchored-disclosure.ts +19 -19
- package/src/hooks/use-anchored-placement.ts +29 -25
- package/src/hooks/use-dismiss.ts +33 -29
- package/src/hooks/use-floating-dismiss.ts +24 -22
- package/src/hooks/use-media-query.ts +67 -60
- package/src/hooks/use-minimize-on-scroll.ts +69 -60
- package/src/hooks/use-visual-viewport.ts +63 -63
- package/src/hooks/viewport/types.ts +16 -16
- package/src/hooks/viewport/viewport-metrics.ts +16 -10
- package/src/icons/icons.tsx +440 -328
- package/src/index.ts +91 -91
- package/src/lib/anchored-placement.ts +70 -65
- package/src/lib/class-names.ts +14 -13
- package/src/lib/clipboard.ts +8 -7
- package/src/lib/date.ts +61 -60
- package/src/lib/floating-layers.ts +39 -24
- package/src/lib/haptics.ts +10 -10
- package/src/lib/language.ts +9 -9
- package/src/lib/range-value.ts +27 -21
- package/src/lib/screen-edges.ts +33 -30
- package/src/lib/shapes.ts +38 -34
- package/src/machines/popover.machine.ts +51 -0
- package/src/motion/transitions.ts +46 -43
- package/src/styles/code-block.css +69 -43
- package/src/styles/motion-controls.css +393 -191
- package/src/tokens.ts +1 -1
- package/dist/types/src/components/popover/popover.d.ts +0 -21
- package/src/components/popover/popover.tsx +0 -334
package/README.md
CHANGED
|
@@ -33,10 +33,10 @@ Import the styles once and each control from its own entry point:
|
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
```tsx
|
|
36
|
-
import { Button } from "@passui/react/button"
|
|
36
|
+
import { Button } from "@passui/react/button";
|
|
37
37
|
|
|
38
38
|
export function SaveButton() {
|
|
39
|
-
|
|
39
|
+
return <Button variant="accent">Save</Button>;
|
|
40
40
|
}
|
|
41
41
|
```
|
|
42
42
|
|
|
@@ -47,31 +47,31 @@ for settings, quantity adjustments, task progress, and layout separation.
|
|
|
47
47
|
They have individual subpath exports and named TypeScript props.
|
|
48
48
|
|
|
49
49
|
```tsx
|
|
50
|
-
import { useState } from "react"
|
|
51
|
-
import { Slider } from "@passui/react/slider"
|
|
52
|
-
import { Stepper } from "@passui/react/stepper"
|
|
53
|
-
import { ProgressView } from "@passui/react/progress-view"
|
|
54
|
-
import { Divider } from "@passui/react/divider"
|
|
50
|
+
import { useState } from "react";
|
|
51
|
+
import { Slider } from "@passui/react/slider";
|
|
52
|
+
import { Stepper } from "@passui/react/stepper";
|
|
53
|
+
import { ProgressView } from "@passui/react/progress-view";
|
|
54
|
+
import { Divider } from "@passui/react/divider";
|
|
55
55
|
|
|
56
56
|
export function DownloadSettings() {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
57
|
+
const [volume, setVolume] = useState(50);
|
|
58
|
+
const [copies, setCopies] = useState(1);
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<section className="flex flex-col gap-4">
|
|
62
|
+
<Slider label="Volume" value={volume} onChange={setVolume} />
|
|
63
|
+
<Stepper
|
|
64
|
+
label="Copies"
|
|
65
|
+
labels={{ decrement: "Fewer copies", increment: "More copies" }}
|
|
66
|
+
value={copies}
|
|
67
|
+
onChange={setCopies}
|
|
68
|
+
min={1}
|
|
69
|
+
max={10}
|
|
70
|
+
/>
|
|
71
|
+
<Divider />
|
|
72
|
+
<ProgressView label="Downloading" value={42} max={100} />
|
|
73
|
+
</section>
|
|
74
|
+
);
|
|
75
75
|
}
|
|
76
76
|
```
|
|
77
77
|
|
|
@@ -90,22 +90,29 @@ menus. `DisclosureGroup` provides a controlled, accessible expansion row on
|
|
|
90
90
|
top of `InlineDisclosure`.
|
|
91
91
|
|
|
92
92
|
```tsx
|
|
93
|
-
import { useState } from "react"
|
|
94
|
-
import { Menu } from "@passui/react/menu"
|
|
95
|
-
import { DisclosureGroup } from "@passui/react/disclosure-group"
|
|
93
|
+
import { useState } from "react";
|
|
94
|
+
import { Menu } from "@passui/react/menu";
|
|
95
|
+
import { DisclosureGroup } from "@passui/react/disclosure-group";
|
|
96
96
|
|
|
97
97
|
export function Preferences() {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
98
|
+
const [advanced, setAdvanced] = useState(false);
|
|
99
|
+
return (
|
|
100
|
+
<section>
|
|
101
|
+
<Menu
|
|
102
|
+
label="More options"
|
|
103
|
+
items={[{ label: "Refresh", onSelect: () => {} }]}
|
|
104
|
+
>
|
|
105
|
+
More
|
|
106
|
+
</Menu>
|
|
107
|
+
<DisclosureGroup
|
|
108
|
+
label="Advanced"
|
|
109
|
+
open={advanced}
|
|
110
|
+
onOpenChange={setAdvanced}
|
|
111
|
+
>
|
|
112
|
+
<p>Additional preferences</p>
|
|
113
|
+
</DisclosureGroup>
|
|
114
|
+
</section>
|
|
115
|
+
);
|
|
109
116
|
}
|
|
110
117
|
```
|
|
111
118
|
|
|
@@ -114,17 +121,21 @@ export function Preferences() {
|
|
|
114
121
|
On this development branch, React icons have a dedicated entry point:
|
|
115
122
|
|
|
116
123
|
```tsx
|
|
117
|
-
import { IconButton, type IconButtonProps } from "@passui/react/icon-button"
|
|
118
|
-
import { SettingsIcon } from "@passui/react/icons"
|
|
124
|
+
import { IconButton, type IconButtonProps } from "@passui/react/icon-button";
|
|
125
|
+
import { SettingsIcon } from "@passui/react/icons";
|
|
119
126
|
|
|
120
127
|
const settingsAction: IconButtonProps = {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
128
|
+
label: "Settings",
|
|
129
|
+
variant: "ghost",
|
|
130
|
+
size: "icon-sm",
|
|
131
|
+
};
|
|
125
132
|
|
|
126
133
|
export function SettingsButton() {
|
|
127
|
-
|
|
134
|
+
return (
|
|
135
|
+
<IconButton {...settingsAction}>
|
|
136
|
+
<SettingsIcon />
|
|
137
|
+
</IconButton>
|
|
138
|
+
);
|
|
128
139
|
}
|
|
129
140
|
```
|
|
130
141
|
|
|
@@ -20,4 +20,4 @@ export interface AccordionProps {
|
|
|
20
20
|
className?: string;
|
|
21
21
|
}
|
|
22
22
|
/** A single-open, collapsible accordion with labelled animated content regions. */
|
|
23
|
-
export declare function Accordion({ items, value, onValueChange, size, className }: AccordionProps): import("react").JSX.Element;
|
|
23
|
+
export declare function Accordion({ items, value, onValueChange, size, className, }: AccordionProps): import("react").JSX.Element;
|
|
@@ -16,4 +16,4 @@ export interface BreadcrumbProps {
|
|
|
16
16
|
size?: BreadcrumbSize;
|
|
17
17
|
}
|
|
18
18
|
/** Ancestors stay links; the final item identifies the current page. */
|
|
19
|
-
export declare function Breadcrumb({ label, items, className, renderLink, size }: BreadcrumbProps): import("react").JSX.Element;
|
|
19
|
+
export declare function Breadcrumb({ label, items, className, renderLink, size, }: BreadcrumbProps): import("react").JSX.Element;
|
|
@@ -12,4 +12,4 @@ export interface InlineDisclosureProps {
|
|
|
12
12
|
* instead of jumping. Motion is disabled when the user requests less motion.
|
|
13
13
|
* The content unmounts after its exit animation completes.
|
|
14
14
|
*/
|
|
15
|
-
export declare function InlineDisclosure({ open, children, className }: InlineDisclosureProps): import("react").JSX.Element;
|
|
15
|
+
export declare function InlineDisclosure({ open, children, className, }: InlineDisclosureProps): import("react").JSX.Element;
|
|
@@ -8,6 +8,10 @@ interface AnchoredSurfaceProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
8
8
|
onClose: (restoreFocus: boolean) => void;
|
|
9
9
|
contentClassName?: string;
|
|
10
10
|
}
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Shared material and lifetime for portaled
|
|
13
|
+
* pickers; their content owns
|
|
14
|
+
* selection.
|
|
15
|
+
* */
|
|
12
16
|
export declare const AnchoredSurface: import("react").ForwardRefExoticComponent<AnchoredSurfaceProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
17
|
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Popover — a glass surface that springs open from its trigger.
|
|
3
|
+
*
|
|
4
|
+
* Compound API (the only API):
|
|
5
|
+
*
|
|
6
|
+
* ```tsx
|
|
7
|
+
* <Popover>
|
|
8
|
+
* <Popover.Trigger render={(props) => <Button {...props}>Open</Button>} />
|
|
9
|
+
* <Popover.Content origin="top-left" className="top-full left-0 mt-2 w-64 p-4">
|
|
10
|
+
* …content…
|
|
11
|
+
* </Popover.Content>
|
|
12
|
+
* </Popover>
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* The `Popover.Trigger` clones its child (or uses a `render` prop) and wires
|
|
16
|
+
* up aria-haspopup, aria-expanded, aria-controls, click + keyboard toggling.
|
|
17
|
+
* The `Popover.Content` portals out of the authored layout, morphs its glass
|
|
18
|
+
* surface from the trigger's rect, and keeps itself inside the viewport as
|
|
19
|
+
* it resizes or scrolls. `origin` picks the corner it grows from; pass
|
|
20
|
+
* `placement="center"` for a modal center-screen variant.
|
|
21
|
+
*
|
|
22
|
+
* State is driven by a small pure machine (`popover.machine.ts`) that
|
|
23
|
+
* translates directly to a Rust enum — see the architecture plan.
|
|
24
|
+
*/
|
|
25
|
+
export { PopoverRoot as Root } from "./popover-root";
|
|
26
|
+
export { PopoverTrigger as Trigger, type PopoverTriggerRenderProps, } from "./popover-trigger";
|
|
27
|
+
export { PopoverContent as Content, type PopoverOrigin, } from "./popover-content";
|
|
28
|
+
import { PopoverRoot } from "./popover-root";
|
|
29
|
+
import { PopoverTrigger } from "./popover-trigger";
|
|
30
|
+
import { PopoverContent } from "./popover-content";
|
|
31
|
+
/**
|
|
32
|
+
* Compound Popover. Use as `<Popover>` with `.Trigger` and `.Content` parts,
|
|
33
|
+
* or import `Root` / `Trigger` / `Content` directly from the barrel.
|
|
34
|
+
*/
|
|
35
|
+
export declare const Popover: typeof PopoverRoot & {
|
|
36
|
+
Trigger: typeof PopoverTrigger;
|
|
37
|
+
Content: typeof PopoverContent;
|
|
38
|
+
};
|
|
39
|
+
export type { PopoverRootProps } from "./popover-root";
|
|
40
|
+
export type { PopoverTriggerProps } from "./popover-trigger";
|
|
41
|
+
export type { PopoverContentProps } from "./popover-content";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type PopoverOrigin = "top-left" | "top-right";
|
|
3
|
+
export interface PopoverContentProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
/** Accessible name (used when there is no labelledBy). */
|
|
7
|
+
label?: string;
|
|
8
|
+
/** ID of a visible heading inside the content. */
|
|
9
|
+
labelledBy?: string;
|
|
10
|
+
/** Allow tapping outside to close. Escape always closes. */
|
|
11
|
+
dismissOnOutsidePress?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Where the content rests once expanded:
|
|
14
|
+
* - "anchor" positions relative to the trigger (default)
|
|
15
|
+
* - "center" floats in the middle of the viewport (modal)
|
|
16
|
+
*/
|
|
17
|
+
placement?: "anchor" | "center";
|
|
18
|
+
/**
|
|
19
|
+
* Which corner the popover grows from when placement="anchor".
|
|
20
|
+
* top-left: panel's left edge aligns to the trigger's left.
|
|
21
|
+
* top-right: panel's right edge aligns to the trigger's right.
|
|
22
|
+
* @default "top-left"
|
|
23
|
+
*/
|
|
24
|
+
origin?: PopoverOrigin;
|
|
25
|
+
/**
|
|
26
|
+
* ARIA role for the panel. Use "menu" for action menus, "dialog"
|
|
27
|
+
* (the default) for free-form content, "tooltip" for tips.
|
|
28
|
+
* @default "dialog"
|
|
29
|
+
*/
|
|
30
|
+
role?: "dialog" | "menu" | "tooltip";
|
|
31
|
+
}
|
|
32
|
+
export declare function PopoverContent({ children, className, label, labelledBy, dismissOnOutsidePress, placement, origin, role, }: PopoverContentProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ReactNode, type RefObject } from "react";
|
|
2
|
+
import { type PopoverContextValue } from "../../machines/popover.machine";
|
|
3
|
+
export declare function usePopover(): PopoverContextValue;
|
|
4
|
+
export interface PopoverRootProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* Start open (uncontrolled) or set the initial state.
|
|
8
|
+
* Ignored when `open` is provided.
|
|
9
|
+
*/
|
|
10
|
+
defaultOpen?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Controlled open state. When provided, the popover is driven by this
|
|
13
|
+
* prop: setting it to true opens, false closes. The internal machine
|
|
14
|
+
* still runs the open/close transitions so the morph can play.
|
|
15
|
+
*/
|
|
16
|
+
open?: boolean;
|
|
17
|
+
/** Called when the popover finishes opening or closing. */
|
|
18
|
+
onOpenChange?: (open: boolean) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function PopoverRoot({ children, defaultOpen, open, onOpenChange, }: PopoverRootProps): import("react").JSX.Element;
|
|
21
|
+
export type { PopoverContextValue };
|
|
22
|
+
export type { RefObject };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type PopoverTriggerRenderProps = {
|
|
3
|
+
ref: (node: HTMLElement | null) => void;
|
|
4
|
+
"aria-haspopup": "dialog";
|
|
5
|
+
"aria-expanded": boolean;
|
|
6
|
+
"aria-controls": string | undefined;
|
|
7
|
+
onClick: () => void;
|
|
8
|
+
onKeyDown: (event: React.KeyboardEvent) => void;
|
|
9
|
+
};
|
|
10
|
+
export interface PopoverTriggerProps {
|
|
11
|
+
/** The trigger content when using render prop. */
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Render prop: receives the trigger props (ref, aria, onClick) and
|
|
15
|
+
* returns the trigger element. This prevents ref-passing conflicts
|
|
16
|
+
* when multiple triggers exist — borrowed from Base UI.
|
|
17
|
+
*
|
|
18
|
+
* If you pass a single element as children instead, it will be
|
|
19
|
+
* cloned with the trigger props merged in.
|
|
20
|
+
*/
|
|
21
|
+
render?: (props: PopoverTriggerRenderProps) => ReactNode;
|
|
22
|
+
}
|
|
23
|
+
export declare function PopoverTrigger({ children, render }: PopoverTriggerProps): ReactNode;
|
|
@@ -5,7 +5,7 @@ export declare function advanceDigit(position: number, velocity: number, target:
|
|
|
5
5
|
velocity: number;
|
|
6
6
|
};
|
|
7
7
|
/** Three recycled cells keep the strip continuous through either side of zero. */
|
|
8
|
-
export declare function RollingDigit({ count, place }: {
|
|
8
|
+
export declare function RollingDigit({ count, place, }: {
|
|
9
9
|
count: number;
|
|
10
10
|
place: number;
|
|
11
11
|
}): import("react").JSX.Element;
|
|
@@ -10,4 +10,4 @@ declare function TableRow({ className, ...props }: React.ComponentProps<"tr">):
|
|
|
10
10
|
declare function TableHead({ className, ...props }: React.ComponentProps<"th">): React.JSX.Element;
|
|
11
11
|
declare function TableCell({ className, ...props }: React.ComponentProps<"td">): React.JSX.Element;
|
|
12
12
|
declare function TableCaption({ className, ...props }: React.ComponentProps<"caption">): React.JSX.Element;
|
|
13
|
-
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
13
|
+
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, };
|
|
@@ -13,9 +13,9 @@ declare const titleSizes: {
|
|
|
13
13
|
readonly default: "text-large-title leading-large-title";
|
|
14
14
|
readonly compact: "text-title leading-title font-semibold tracking-tight";
|
|
15
15
|
};
|
|
16
|
-
export declare function ViewController({ heading, className, children }: ViewControllerProps): import("react").JSX.Element;
|
|
16
|
+
export declare function ViewController({ heading, className, children, }: ViewControllerProps): import("react").JSX.Element;
|
|
17
17
|
export declare namespace ViewController {
|
|
18
18
|
export { Heading };
|
|
19
19
|
}
|
|
20
|
-
declare function Heading({ title, description, action, size }: HeadingProps): import("react").JSX.Element;
|
|
20
|
+
declare function Heading({ title, description, action, size, }: HeadingProps): import("react").JSX.Element;
|
|
21
21
|
export {};
|
|
@@ -16,7 +16,7 @@ export * from "./components/dialog/dialog-host";
|
|
|
16
16
|
export { type ConfirmOptions, confirmDialog, } from "./components/dialog/dialog-store";
|
|
17
17
|
export * from "./components/labeled-content/labeled-content";
|
|
18
18
|
export * from "./components/picker/picker";
|
|
19
|
-
export * from "./components/popover
|
|
19
|
+
export * from "./components/popover";
|
|
20
20
|
export * from "./components/search-field/search-field";
|
|
21
21
|
export * from "./components/section/section";
|
|
22
22
|
export * from "./components/inline-disclosure/inline-disclosure";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Popover state machine — pure function, no React, no DOM.
|
|
3
|
+
*
|
|
4
|
+
* Translates directly to a Rust enum with match arms.
|
|
5
|
+
*
|
|
6
|
+
* States:
|
|
7
|
+
* closed → nothing visible
|
|
8
|
+
* opening → surface morphing from trigger to content
|
|
9
|
+
* open → content fully visible
|
|
10
|
+
* closing → surface morphing back to trigger
|
|
11
|
+
*
|
|
12
|
+
* The OPENED/CLOSED events are fired by onAnimationComplete,
|
|
13
|
+
* so the machine stays in "opening"/"closing" until the animation
|
|
14
|
+
* actually finishes — enabling interruptibility (close during open).
|
|
15
|
+
*/
|
|
16
|
+
export type PopoverState = "closed" | "opening" | "open" | "closing";
|
|
17
|
+
export type PopoverEvent = "OPEN" | "OPENED" | "CLOSE" | "CLOSED" | "TOGGLE";
|
|
18
|
+
export declare function popoverMachine(state: PopoverState, event: PopoverEvent): PopoverState;
|
|
19
|
+
export type PopoverContextValue = {
|
|
20
|
+
state: PopoverState;
|
|
21
|
+
send: (event: PopoverEvent) => void;
|
|
22
|
+
/** The trigger element — set by PopoverTrigger, read by PopoverContent for positioning. */
|
|
23
|
+
triggerRef: React.RefObject<HTMLElement | null>;
|
|
24
|
+
/** Unique ID for aria-controls + layoutId morphing. */
|
|
25
|
+
contentId: string;
|
|
26
|
+
/** Shared layoutId for motion's matched-geometry transition. */
|
|
27
|
+
surfaceId: string;
|
|
28
|
+
/** Whether the popover is open or transitioning (not closed). */
|
|
29
|
+
isPresent: boolean;
|
|
30
|
+
};
|