@sovereignfs/ui 0.92.0 → 0.98.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/CHANGELOG.md +36 -0
- package/README.md +3 -1
- package/dist/AppTile.module.css +100 -0
- package/dist/AvatarStack.module.css +46 -0
- package/dist/DateRangePicker.module.css +33 -0
- package/dist/FloatingActionButton.module.css +70 -0
- package/dist/Map.module.css +110 -0
- package/dist/PhotoGrid.module.css +44 -0
- package/dist/PhotoViewer.module.css +153 -0
- package/dist/RecoveryKit.module.css +114 -0
- package/dist/chunk-E24U223W.js +36 -0
- package/dist/index.d.ts +224 -3
- package/dist/index.js +1666 -758
- package/dist/map.d.ts +87 -0
- package/dist/map.js +384 -0
- package/package.json +19 -9
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: var(--sv-space-4);
|
|
5
|
+
max-width: 28rem;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.heading {
|
|
9
|
+
margin: 0;
|
|
10
|
+
font-size: var(--sv-font-size-xl);
|
|
11
|
+
font-weight: var(--sv-font-weight-semibold);
|
|
12
|
+
color: var(--sv-color-text-primary);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.explain,
|
|
16
|
+
.note {
|
|
17
|
+
margin: 0;
|
|
18
|
+
color: var(--sv-color-text-muted);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.explain {
|
|
22
|
+
font-size: var(--sv-font-size-sm);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.note {
|
|
26
|
+
font-size: var(--sv-font-size-xs);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.printable {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
gap: var(--sv-space-3);
|
|
33
|
+
padding: var(--sv-space-4);
|
|
34
|
+
border: 1px solid var(--sv-color-border);
|
|
35
|
+
border-radius: var(--sv-radius-md);
|
|
36
|
+
background: var(--sv-color-surface-sunken);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* Shown only on paper, where the page around it is not. */
|
|
40
|
+
.printTitle {
|
|
41
|
+
display: none;
|
|
42
|
+
margin: 0;
|
|
43
|
+
font-size: var(--sv-font-size-md);
|
|
44
|
+
font-weight: var(--sv-font-weight-semibold);
|
|
45
|
+
color: var(--sv-color-text-primary);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.groups {
|
|
49
|
+
display: grid;
|
|
50
|
+
grid-template-columns: repeat(5, 1fr);
|
|
51
|
+
gap: var(--sv-space-3) var(--sv-space-4);
|
|
52
|
+
margin: 0;
|
|
53
|
+
padding: 0;
|
|
54
|
+
list-style: none;
|
|
55
|
+
font-family: var(--sv-font-family-mono);
|
|
56
|
+
font-size: var(--sv-font-size-md);
|
|
57
|
+
color: var(--sv-color-text-primary);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.group {
|
|
61
|
+
letter-spacing: 0.08em;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.check {
|
|
65
|
+
color: var(--sv-color-text-muted);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.actions {
|
|
69
|
+
display: flex;
|
|
70
|
+
flex-wrap: wrap;
|
|
71
|
+
gap: var(--sv-space-2);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.continue {
|
|
75
|
+
width: 100%;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@media (max-width: 768px) {
|
|
79
|
+
.groups {
|
|
80
|
+
grid-template-columns: repeat(3, 1fr);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.actions {
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.actions > * {
|
|
88
|
+
width: 100%;
|
|
89
|
+
min-height: var(--sv-touch-target-min);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Printing the page prints the kit alone. */
|
|
94
|
+
@media print {
|
|
95
|
+
:global(body *) {
|
|
96
|
+
visibility: hidden;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.printable,
|
|
100
|
+
.printable * {
|
|
101
|
+
visibility: visible;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.printable {
|
|
105
|
+
position: absolute;
|
|
106
|
+
inset: 0 auto auto 0;
|
|
107
|
+
border: none;
|
|
108
|
+
background: none;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.printTitle {
|
|
112
|
+
display: block;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
// src/motion.ts
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
function useMountTransition(open, durationMs) {
|
|
6
|
+
const [phase, setPhase] = useState(open ? "entering" : "closed");
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (open) {
|
|
9
|
+
setPhase("entering");
|
|
10
|
+
const raf = requestAnimationFrame(() => setPhase("open"));
|
|
11
|
+
return () => cancelAnimationFrame(raf);
|
|
12
|
+
}
|
|
13
|
+
setPhase((p) => p === "closed" ? "closed" : "closing");
|
|
14
|
+
const timer = setTimeout(() => setPhase("closed"), durationMs);
|
|
15
|
+
return () => clearTimeout(timer);
|
|
16
|
+
}, [open, durationMs]);
|
|
17
|
+
return { mounted: phase !== "closed", phase };
|
|
18
|
+
}
|
|
19
|
+
function usePrefersReducedMotion() {
|
|
20
|
+
const [reduced, setReduced] = useState(false);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const mql = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
23
|
+
setReduced(mql.matches);
|
|
24
|
+
function handleChange(e) {
|
|
25
|
+
setReduced(e.matches);
|
|
26
|
+
}
|
|
27
|
+
mql.addEventListener("change", handleChange);
|
|
28
|
+
return () => mql.removeEventListener("change", handleChange);
|
|
29
|
+
}, []);
|
|
30
|
+
return reduced;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
useMountTransition,
|
|
35
|
+
usePrefersReducedMotion
|
|
36
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode, ButtonHTMLAttributes, HTMLAttributes, FormHTMLAttributes, AnchorHTMLAttributes, SelectHTMLAttributes, ReactElement, CSSProperties, InputHTMLAttributes, Ref, TextareaHTMLAttributes, TdHTMLAttributes, ThHTMLAttributes, LabelHTMLAttributes, ElementType, PointerEvent, KeyboardEvent, MouseEvent, RefObject } from 'react';
|
|
2
|
+
import { ReactNode, ButtonHTMLAttributes, HTMLAttributes, FormHTMLAttributes, AnchorHTMLAttributes, SelectHTMLAttributes, ReactElement, CSSProperties, InputHTMLAttributes, Ref, TextareaHTMLAttributes, TdHTMLAttributes, ThHTMLAttributes, LabelHTMLAttributes, ElementType, MouseEventHandler, PointerEvent, KeyboardEvent, MouseEvent, RefObject } from 'react';
|
|
3
3
|
import * as _dnd_kit_core from '@dnd-kit/core';
|
|
4
4
|
|
|
5
5
|
interface LegalLinksProps {
|
|
@@ -1068,6 +1068,27 @@ interface CardProps extends HTMLAttributes<HTMLElement> {
|
|
|
1068
1068
|
}
|
|
1069
1069
|
declare function Card({ as: Tag, interactive, padding, className, children, ...rest }: CardProps): react.JSX.Element;
|
|
1070
1070
|
|
|
1071
|
+
interface AppTileProps {
|
|
1072
|
+
/** The tile's picture, centred in a rounded box: an `<Icon>`, an `<Avatar>`, or an image. */
|
|
1073
|
+
icon: ReactNode;
|
|
1074
|
+
/** The app's name. */
|
|
1075
|
+
name: string;
|
|
1076
|
+
/** One or two lines saying what it is. */
|
|
1077
|
+
description?: string;
|
|
1078
|
+
/** What kind of thing it is, as small labels beneath a divider — typically `<Badge variant="mono">`. Omit for no footer. */
|
|
1079
|
+
tags?: ReactNode;
|
|
1080
|
+
/** Makes the whole tile one link. Without it the tile is a plain box. The tile never imports a router: pass the address, or wrap it yourself. */
|
|
1081
|
+
href?: string;
|
|
1082
|
+
/** `ghost` is a dashed, flat tile for adding another one: the same size as the others, so it sits in the grid as an empty place. */
|
|
1083
|
+
variant?: 'solid' | 'ghost';
|
|
1084
|
+
className?: string;
|
|
1085
|
+
}
|
|
1086
|
+
/**
|
|
1087
|
+
* AppTile — one app in a grid: a rounded icon box, the name, a line about it and, beneath a divider, what kind of app it is. The
|
|
1088
|
+
* whole tile is the link when `href` is given. Lay tiles out with `CardTileGrid`.
|
|
1089
|
+
*/
|
|
1090
|
+
declare function AppTile({ icon, name, description, tags, href, variant, className, }: AppTileProps): react.JSX.Element;
|
|
1091
|
+
|
|
1071
1092
|
interface CardTileGridProps {
|
|
1072
1093
|
children: ReactNode;
|
|
1073
1094
|
/** Minimum tile width (px) before the grid wraps to fewer columns. */
|
|
@@ -1416,6 +1437,57 @@ interface EmptyStateProps {
|
|
|
1416
1437
|
}
|
|
1417
1438
|
declare function EmptyState({ icon, heading, description, action, className }: EmptyStateProps): react.JSX.Element;
|
|
1418
1439
|
|
|
1440
|
+
/**
|
|
1441
|
+
* Why a place is locked: `locked` — this browser is not unlocked yet; `removed` — the person who shared it stopped sharing it.
|
|
1442
|
+
*/
|
|
1443
|
+
type LockedReason = 'locked' | 'removed';
|
|
1444
|
+
interface LockedStateProps {
|
|
1445
|
+
reason: LockedReason;
|
|
1446
|
+
/** The app's own name, as people know it: "Notes". */
|
|
1447
|
+
appName: string;
|
|
1448
|
+
/** For `removed`: who stopped sharing, if the app knows. */
|
|
1449
|
+
sharedBy?: string;
|
|
1450
|
+
/**
|
|
1451
|
+
* The one way forward, made by the consumer: for `locked`, a `ButtonLink` to unlock (the SDK takes the person to core and back);
|
|
1452
|
+
* for `removed`, a way back to the app's list. This package knows no router and no core, so it builds neither.
|
|
1453
|
+
*/
|
|
1454
|
+
action?: ReactNode;
|
|
1455
|
+
className?: string;
|
|
1456
|
+
}
|
|
1457
|
+
/**
|
|
1458
|
+
* LockedState — what an encrypted app shows where it cannot open something (core-app §5.9): never ciphertext, never nothing.
|
|
1459
|
+
* Built on `EmptyState`. While the app is still finding out whether it can open the place, it renders nothing rather than this, so
|
|
1460
|
+
* the locked state never flashes on a page about to open. Presentational and RSC-safe.
|
|
1461
|
+
*/
|
|
1462
|
+
declare function LockedState({ reason, appName, sharedBy, action, className }: LockedStateProps): react.JSX.Element;
|
|
1463
|
+
|
|
1464
|
+
interface RecoveryKitProps {
|
|
1465
|
+
/** The kit as `@sovereignfs/crypto/web`'s `formatKit` writes it: fourteen groups of four, joined by hyphens. */
|
|
1466
|
+
kit: string;
|
|
1467
|
+
/** The instance's name, for the saved file's name and first line. */
|
|
1468
|
+
instanceName: string;
|
|
1469
|
+
/** Called when the person has said they kept it and presses Continue. */
|
|
1470
|
+
onContinue: () => void;
|
|
1471
|
+
/** True while what Continue started is running: the button says so and cannot be pressed again. */
|
|
1472
|
+
continuing?: boolean;
|
|
1473
|
+
/**
|
|
1474
|
+
* True when the instance's owner turned on recovery (escrow, core-app §5.8): the kit is then the person's own way back, and not the
|
|
1475
|
+
* only one. Leave it off otherwise; the kit then says that nobody else can get the data back.
|
|
1476
|
+
*/
|
|
1477
|
+
ownerCanRecover?: boolean;
|
|
1478
|
+
className?: string;
|
|
1479
|
+
}
|
|
1480
|
+
/** The saved file's name: the instance's name in lower case, letters and digits joined by hyphens. */
|
|
1481
|
+
declare function recoveryKitFileName(instanceName: string): string;
|
|
1482
|
+
/** What the saved file holds. */
|
|
1483
|
+
declare function recoveryKitFileText(kit: string, instanceName: string, ownerCanRecover?: boolean): string;
|
|
1484
|
+
/**
|
|
1485
|
+
* RecoveryKit — the recovery kit, shown once when an account is set up (core-app §5.3), with Print and Save as a file, and
|
|
1486
|
+
* Continue held off until the person says they kept it. It shows the text it is given and never sees the bytes behind it.
|
|
1487
|
+
* The file is made only when Save is pressed, never in render. When the page is printed, only the kit is printed.
|
|
1488
|
+
*/
|
|
1489
|
+
declare function RecoveryKit({ kit, instanceName, onContinue, continuing, ownerCanRecover, className, }: RecoveryKitProps): react.JSX.Element;
|
|
1490
|
+
|
|
1419
1491
|
interface OfflineGateProps {
|
|
1420
1492
|
children: ReactNode;
|
|
1421
1493
|
/** Defaults to a generic "this section" phrasing — pass the surface's own name. */
|
|
@@ -1543,6 +1615,26 @@ interface AvatarProps {
|
|
|
1543
1615
|
}
|
|
1544
1616
|
declare function Avatar({ name, src, size, className }: AvatarProps): react.JSX.Element;
|
|
1545
1617
|
|
|
1618
|
+
interface AvatarStackPerson {
|
|
1619
|
+
name: string;
|
|
1620
|
+
src?: string;
|
|
1621
|
+
}
|
|
1622
|
+
interface AvatarStackProps {
|
|
1623
|
+
/** Everyone in the stack, in the order they should appear. */
|
|
1624
|
+
people: readonly AvatarStackPerson[];
|
|
1625
|
+
/** How many avatars are drawn before the rest become a "+N" count. Default 4. */
|
|
1626
|
+
max?: number;
|
|
1627
|
+
size?: NonNullable<AvatarProps['size']>;
|
|
1628
|
+
/** What the whole stack is, said before the names ("Going", "Members"). Optional. */
|
|
1629
|
+
label?: string;
|
|
1630
|
+
className?: string;
|
|
1631
|
+
}
|
|
1632
|
+
/**
|
|
1633
|
+
* Overlapping avatars with a "+N" count beyond a limit, for who is in something (a trip's members, the people on a split). The stack is **one image to assistive technology**, labelled
|
|
1634
|
+
* with every name, so the drawn avatars and the count are hidden from it: a screen reader says "Ada, Grace and Sam", not "AL, GH, +1".
|
|
1635
|
+
*/
|
|
1636
|
+
declare function AvatarStack({ people, max, size, label, className }: AvatarStackProps): react.JSX.Element | null;
|
|
1637
|
+
|
|
1546
1638
|
interface NavTabItem {
|
|
1547
1639
|
label: string;
|
|
1548
1640
|
href: string;
|
|
@@ -1890,6 +1982,85 @@ interface TypographyProps {
|
|
|
1890
1982
|
/** Typography — text bound to the design system's font-size/weight scale. */
|
|
1891
1983
|
declare function Typography({ variant, children, as, className }: TypographyProps): react.JSX.Element;
|
|
1892
1984
|
|
|
1985
|
+
interface FloatingActionButtonProps extends Omit<HTMLAttributes<HTMLElement>, 'children' | 'aria-label' | 'onClick'> {
|
|
1986
|
+
/** What it does, in words: the button is an icon, so this is its accessible name (and its text when `extended`). */
|
|
1987
|
+
label: string;
|
|
1988
|
+
/** The icon, an `<Icon>` or an app's own mark. Decorative: the label names the button. */
|
|
1989
|
+
icon: ReactNode;
|
|
1990
|
+
/** Shows the label beside the icon instead of the icon alone. */
|
|
1991
|
+
extended?: boolean;
|
|
1992
|
+
/** Makes it a link to this address instead of a button. */
|
|
1993
|
+
href?: string;
|
|
1994
|
+
onClick?: MouseEventHandler<HTMLElement>;
|
|
1995
|
+
/** Buttons only. */
|
|
1996
|
+
disabled?: boolean;
|
|
1997
|
+
type?: 'button' | 'submit' | 'reset';
|
|
1998
|
+
/** Links only. */
|
|
1999
|
+
rel?: string;
|
|
2000
|
+
target?: string;
|
|
2001
|
+
}
|
|
2002
|
+
/**
|
|
2003
|
+
* The phone's one main action (an app's _Check in_, _Add expense_): a round button that floats **above `MobileFooter`**, at the end of the line, clear of the safe area. It reads
|
|
2004
|
+
* `--sv-shell-footer-height`, which the footer publishes (and the platform shell sets), so it sits above the footer however tall that is, and above the home indicator when there is no footer. A
|
|
2005
|
+
* link when it is given an `href`, a button otherwise. Render it only on a phone: it has no breakpoint of its own, so an app decides where it belongs (`DESIGN.md` of the app).
|
|
2006
|
+
*
|
|
2007
|
+
* Presentational and RSC-safe: no state, and no `next/link`; the app passes its own `href`.
|
|
2008
|
+
*/
|
|
2009
|
+
declare function FloatingActionButton({ label, icon, extended, className, href, type, disabled, rel, target, ...rest }: FloatingActionButtonProps): react.JSX.Element;
|
|
2010
|
+
|
|
2011
|
+
interface Photo {
|
|
2012
|
+
/** Stable, for the list's keys. */
|
|
2013
|
+
id: string;
|
|
2014
|
+
/** The picture, from an address the app gives: an `https:` or `blob:` URL, or a path of the app's own. Nothing else is ever requested. */
|
|
2015
|
+
src: string;
|
|
2016
|
+
/** A smaller picture for the grid; `src` when absent. */
|
|
2017
|
+
thumbSrc?: string;
|
|
2018
|
+
/** What the picture shows, for someone who cannot see it. */
|
|
2019
|
+
alt: string;
|
|
2020
|
+
/** Shown beneath the picture in the viewer: a place and a date, a note, an author. */
|
|
2021
|
+
caption?: ReactNode;
|
|
2022
|
+
}
|
|
2023
|
+
interface PhotoViewerProps {
|
|
2024
|
+
photos: readonly Photo[];
|
|
2025
|
+
/** Whether the viewer is showing. */
|
|
2026
|
+
open: boolean;
|
|
2027
|
+
/** Which photo is showing. */
|
|
2028
|
+
index: number;
|
|
2029
|
+
onIndexChange: (index: number) => void;
|
|
2030
|
+
onClose: () => void;
|
|
2031
|
+
/** Names the viewer for assistive technology. Default "Photos". */
|
|
2032
|
+
label?: string;
|
|
2033
|
+
}
|
|
2034
|
+
/**
|
|
2035
|
+
* A full-screen photo viewer (a design-system part, so every app's photos behave alike): swipe or the arrow keys between photos, pinch, double tap, a trackpad's pinch or the wheel to zoom, drag a
|
|
2036
|
+
* zoomed photo around, close with `Esc`, the close button or a swipe down. It is a dialog (`aria-modal`), traps focus, locks the page's scroll, **returns focus to what opened it**, and says
|
|
2037
|
+
* "3 of 12" to assistive technology as it moves. It shows the **caption slot** beneath the picture.
|
|
2038
|
+
*
|
|
2039
|
+
* It requests only the `src` addresses it is given, from the browser's own `<img>`: it adds no origin, no library and no font, so an app's CSP (`img-src`) is all it needs, and a `blob:` URL (a photo
|
|
2040
|
+
* not yet uploaded) works as any other. Neighbouring photos are fetched ahead from the same addresses.
|
|
2041
|
+
*/
|
|
2042
|
+
declare function PhotoViewer({ photos, open, index, onIndexChange, onClose, label, }: PhotoViewerProps): react.ReactPortal | null;
|
|
2043
|
+
|
|
2044
|
+
interface PhotoGridProps {
|
|
2045
|
+
photos: readonly Photo[];
|
|
2046
|
+
/** Called with the index of the thumbnail that was chosen. */
|
|
2047
|
+
onOpen: (index: number) => void;
|
|
2048
|
+
/** Names the grid for assistive technology. Default "Photos". */
|
|
2049
|
+
label?: string;
|
|
2050
|
+
className?: string;
|
|
2051
|
+
}
|
|
2052
|
+
/** A grid of thumbnails, each a button that opens that photo. A thumbnail is named by what its photo shows and where it is in the list ("Photo 2 of 9: …"). */
|
|
2053
|
+
declare function PhotoGrid({ photos, onOpen, label, className }: PhotoGridProps): react.JSX.Element | null;
|
|
2054
|
+
interface PhotoGalleryProps extends Omit<PhotoGridProps, 'onOpen'> {
|
|
2055
|
+
/** Called as the viewer moves from photo to photo, for an app that keeps track. */
|
|
2056
|
+
onView?: (index: number) => void;
|
|
2057
|
+
}
|
|
2058
|
+
/**
|
|
2059
|
+
* The grid and the viewer together, for the usual case: choosing a thumbnail opens the viewer on that photo, and closing it **returns focus to that thumbnail**. An app that needs to control the
|
|
2060
|
+
* viewer itself (to open it from somewhere else, say) uses `PhotoGrid` and `PhotoViewer` directly.
|
|
2061
|
+
*/
|
|
2062
|
+
declare function PhotoGallery({ photos, label, className, onView }: PhotoGalleryProps): react.JSX.Element;
|
|
2063
|
+
|
|
1893
2064
|
interface MarkerProps {
|
|
1894
2065
|
/** The number shown in the marker, e.g. 1, 2, 3. */
|
|
1895
2066
|
index: number;
|
|
@@ -2343,6 +2514,56 @@ interface DatePickerProps {
|
|
|
2343
2514
|
*/
|
|
2344
2515
|
declare function DatePicker({ value, onChange, minDate, maxDate, placeholder, 'aria-label': ariaLabel, disabled, }: DatePickerProps): react.JSX.Element;
|
|
2345
2516
|
|
|
2517
|
+
/** A range of calendar dates as `YYYY-MM-DD`, in and out: no time, no zone. Either end is `null` for no choice yet. */
|
|
2518
|
+
interface DateRange {
|
|
2519
|
+
start: string | null;
|
|
2520
|
+
end: string | null;
|
|
2521
|
+
}
|
|
2522
|
+
interface DateRangePickerProps {
|
|
2523
|
+
value: DateRange;
|
|
2524
|
+
/** Called with both ends once a range is complete; the earlier date is `start`. */
|
|
2525
|
+
onChange: (range: {
|
|
2526
|
+
start: string;
|
|
2527
|
+
end: string;
|
|
2528
|
+
}) => void;
|
|
2529
|
+
/** `YYYY-MM-DD`: earlier dates are disabled. */
|
|
2530
|
+
min?: string | undefined;
|
|
2531
|
+
/** `YYYY-MM-DD`: later dates are disabled. */
|
|
2532
|
+
max?: string | undefined;
|
|
2533
|
+
placeholder?: string;
|
|
2534
|
+
'aria-label': string;
|
|
2535
|
+
disabled?: boolean;
|
|
2536
|
+
}
|
|
2537
|
+
/**
|
|
2538
|
+
* DateRangePicker — a form field that picks two dates, such as a stop's arrival and departure: a trigger that says the range and the nights between (`10 May 2026 – 12 May 2026 · 2 nights`), opening a `RangeCalendar` in a popover on
|
|
2539
|
+
* a wide screen and a bottom sheet on a narrow one, as `DatePicker` does. **Dates in and out are `YYYY-MM-DD` strings**, because the date a person means has no time or zone to be wrong in; `min` and `max` disable the days outside them;
|
|
2540
|
+
* the keyboard is the calendar grid's. Choosing the second date closes it.
|
|
2541
|
+
*/
|
|
2542
|
+
declare function DateRangePicker({ value, onChange, min, max, placeholder, 'aria-label': ariaLabel, disabled, }: DateRangePickerProps): react.JSX.Element;
|
|
2543
|
+
|
|
2544
|
+
interface Range {
|
|
2545
|
+
readonly start: Date;
|
|
2546
|
+
readonly end: Date;
|
|
2547
|
+
}
|
|
2548
|
+
|
|
2549
|
+
interface RangeCalendarProps {
|
|
2550
|
+
/** The range chosen, or `null` for none. */
|
|
2551
|
+
value: Range | null;
|
|
2552
|
+
/** Called when a second date completes a range. */
|
|
2553
|
+
onChange: (range: Range) => void;
|
|
2554
|
+
/** Dates before this are disabled and unselectable. */
|
|
2555
|
+
minDate?: Date | undefined;
|
|
2556
|
+
/** Dates after this are disabled and unselectable. */
|
|
2557
|
+
maxDate?: Date | undefined;
|
|
2558
|
+
'aria-label'?: string;
|
|
2559
|
+
}
|
|
2560
|
+
/**
|
|
2561
|
+
* RangeCalendar — a month grid that picks two dates. **The first pick starts a range and the second ends it** (the earlier of the two is the start, whichever came first); the days between are shaded as the pointer or focus moves, and the nights
|
|
2562
|
+
* between are said. Keyboard as `Calendar`'s (the WAI-ARIA grid pattern, roving tabindex): arrows move by day and week, Home and End to the ends of the week, PageUp and PageDown by month, Enter or Space picks. Dates outside `minDate` and
|
|
2563
|
+
* `maxDate` are disabled. A pick on one day twice is a range of one day (no nights).
|
|
2564
|
+
*/
|
|
2565
|
+
declare function RangeCalendar({ value, onChange, minDate, maxDate, 'aria-label': ariaLabel, }: RangeCalendarProps): react.JSX.Element;
|
|
2566
|
+
|
|
2346
2567
|
interface SuggestionOption {
|
|
2347
2568
|
id: string;
|
|
2348
2569
|
label: string;
|
|
@@ -3573,5 +3794,5 @@ interface QrCodeProps {
|
|
|
3573
3794
|
*/
|
|
3574
3795
|
declare function QrCode({ modules, label }: QrCodeProps): react.JSX.Element;
|
|
3575
3796
|
|
|
3576
|
-
export { Accordion, Alert, AppsLauncher, AspectRatio, AuthButton, AuthCard, AuthCodeInput, AuthDivider, AuthError, AuthField, AuthFooter, AuthForm, AuthLink, AuthLinkButton, AuthNotice, AuthShell, Avatar, Badge, BalanceChip, BrandBadge, Breadcrumb, Button, ButtonGroup, ButtonLink, Calendar, Card, CardTile, CardTileGrid, CheckableListRow, Checkbox, CodeTextarea, Collapsible, ColorPicker, Combobox, Command, ConfirmDialog, ConsentPrompt, ContextMenu, CopyButton, CurrencyInput, DataTable, DatePicker, DeviceOnlyGate, DeviceStorageKeyGate, Dialog, DragHandleRow, Drawer, EmptyState, FileDropzone, FormField, GripIcon, Header, HeaderFooterLayout, HoverCard, Icon, IconPicker, Input, Item, Kbd, Label, LegalLinks, MOBILE_BREAKPOINT_PX, Markdown, Marker, MemberMultiSelect, Menu, MenuEntries, Menubar, Message, MessageScroller, MobileAppsDrawer, MobileFooter, MobileHeader, NavList, NavTabs, NavigationMenu, NewCardTile, NotificationsPanel, OfflineGate, OverlayHeader, PageContainer, PageHeader, PageLayout, Pagination, Popover, Progress, QrCode, QuantityStepper, RadioGroup, ResizableHandle, ResizablePanel, ResizablePanelGroup, ResponsiveSurface, RootLayout, SWIPE_STACK_TRANSITION_MS, ScrollArea, SegmentedControl, Select, Sheet, Slider, Spinner, SplitMethodSelector, SplitPane, StatusBadge, StepStrip, SuggestionInput, SwipableMobileCarousel, SwipableMobileCarouselDots, SwipableMobileCarouselSlide, SwipableMobileCarouselSlideBody, SwipableMobileCarouselSlideFooter, SwipableMobileCarouselSlideHeader, SwipeStack, SwipeStackCard, SystemBanner, THEME_PRESETS, THEME_PRESET_NAMES, Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRow, Tabs, TagInput, Textarea, ThreeColumnLayout, ToastProvider, Toggle, Tooltip, Typography, UserMenu, shouldHandleDndEvent, useCarouselRouteSync, useCommitOnEnterOrBlur, useDoubleTapHandler, useIsMobile, useIsOffline, useLongPress, useOfflineTileState, useOverlaySecondRow, useReorderSensors, useResponsiveLayout, useSingleOrDoubleTap, useSnapCarousel, useSwipeReveal, useSwipeStack, useToast };
|
|
3577
|
-
export type { AccordionItem, AccordionProps, AlertProps, AlertVariant, AppsLauncherItem, AppsLauncherProps, AspectRatioProps, AuthCardProps, AuthCodeInputProps, AuthFieldControl, AuthFieldProps, AuthFooterProps, AvatarProps, BadgeProps, BadgeStatus, BadgeVariant, BalanceChipProps, BannerVariant, BrandBadgeProps, BreadcrumbItem, BreadcrumbProps, ButtonGroupProps, ButtonLinkProps, ButtonProps, ButtonSize, ButtonVariant, CalendarProps, CardProps, CardTileGridProps, CardTileProps, CheckableListRowProps, CheckboxProps, CodeTextareaProps, CollapsibleProps, ColorPickerProps, ColorPickerSwatch, ComboboxOption, ComboboxProps, CommandItem, CommandProps, CommitOnEnterOrBlurHandlers, ConfirmDialogProps, ConsentPromptProps, ContextMenuProps, CopyButtonProps, CurrencyInputProps, DataTableColumn, DataTableProps, DatePickerProps, DeviceOnlyGateProps, DeviceStorageKeyGateProps, DeviceStorageKeyGateStatus, DialogProps, DialogSize, DragHandleRowProps, DrawerProps, EmptyStateProps, FileDropzoneProps, FooterIcon, FormFieldProps, FormFieldRenderProps, GripIconProps, HeaderFooterLayoutProps, HeaderPlugin, HeaderProps, HoverCardProps, IconName, IconPickerProps, IconProps, InputProps, ItemProps, KbdProps, LabelProps, LegalLinksProps, LongPressHandlers, MarkdownProps, MarkerProps, MemberMultiSelectOption, MemberMultiSelectProps, MenuEntry, MenuItem, MenuLabel, MenuProps, MenuSeparator, MenubarMenu, MenubarProps, MessageProps, MessageScrollerProps, MessageSender, MobileAppsDrawerItem, MobileAppsDrawerProps, MobileFooterProps, MobileHeaderProps, NavListGroup, NavListItem, NavListLinkProps, NavListProps, NavTabItem, NavTabLinkProps, NavTabsProps, NavigationMenuItem, NavigationMenuProps, NewCardTileProps, NotificationsPanelItem, NotificationsPanelProps, OfflineGateProps, OfflineTileState, OverlayHeaderProps, PageContainerProps, PageHeaderProps, PageLayoutPadding, PageLayoutProps, PaginationProps, PopoverProps, ProgressProps, QrCodeProps, QuantityStepperProps, RadioGroupItem, RadioGroupProps, ResizableDirection, ResizableHandleProps, ResizablePanelGroupProps, ResizablePanelProps, ResponsiveSurfaceProps, RootLayoutProps, RootLayoutVariant, ScrollAreaProps, SegmentedControlProps, SegmentedOption, SelectProps, SheetProps, SliderProps, SortDirection, SpinnerProps, SplitMethod, SplitMethodSelectorProps, SplitPaneProps, StatusBadgeProps, StatusBadgeStatus, StepStripItem, StepStripProps, SuggestionInputProps, SuggestionOption, SwipableMobileCarouselDotsProps, SwipableMobileCarouselIndicatorProps, SwipableMobileCarouselProps, SwipableMobileCarouselSlideBodyProps, SwipableMobileCarouselSlideFooterProps, SwipableMobileCarouselSlideHeaderProps, SwipableMobileCarouselSlideProps, SwipeDirection, SwipeDirectionMeta, SwipeStackCardProps, SwipeStackProps, SystemBannerProps, TabItem, TableProps, TabsProps, TagInputProps, TextareaProps, ThemePresetName, ThemePresetTokens, ThreeColumnLayoutProps, ToastContextValue, ToastItem, ToggleProps, TooltipProps, TypographyProps, TypographyVariant, UseCarouselRouteSyncOptions, UseCarouselRouteSyncResult, UseLongPressOptions, UseReorderSensorsOptions, UseResponsiveLayoutOptions, UseResponsiveLayoutResult, UseSnapCarouselOptions, UseSnapCarouselResult, UseSwipeRevealHandlers, UseSwipeRevealOptions, UseSwipeRevealResult, UseSwipeStackHandlers, UseSwipeStackOptions, UseSwipeStackResult, UserMenuItem, UserMenuProps };
|
|
3797
|
+
export { Accordion, Alert, AppTile, AppsLauncher, AspectRatio, AuthButton, AuthCard, AuthCodeInput, AuthDivider, AuthError, AuthField, AuthFooter, AuthForm, AuthLink, AuthLinkButton, AuthNotice, AuthShell, Avatar, AvatarStack, Badge, BalanceChip, BrandBadge, Breadcrumb, Button, ButtonGroup, ButtonLink, Calendar, Card, CardTile, CardTileGrid, CheckableListRow, Checkbox, CodeTextarea, Collapsible, ColorPicker, Combobox, Command, ConfirmDialog, ConsentPrompt, ContextMenu, CopyButton, CurrencyInput, DataTable, DatePicker, DateRangePicker, DeviceOnlyGate, DeviceStorageKeyGate, Dialog, DragHandleRow, Drawer, EmptyState, FileDropzone, FloatingActionButton, FormField, GripIcon, Header, HeaderFooterLayout, HoverCard, Icon, IconPicker, Input, Item, Kbd, Label, LegalLinks, LockedState, MOBILE_BREAKPOINT_PX, Markdown, Marker, MemberMultiSelect, Menu, MenuEntries, Menubar, Message, MessageScroller, MobileAppsDrawer, MobileFooter, MobileHeader, NavList, NavTabs, NavigationMenu, NewCardTile, NotificationsPanel, OfflineGate, OverlayHeader, PageContainer, PageHeader, PageLayout, Pagination, PhotoGallery, PhotoGrid, PhotoViewer, Popover, Progress, QrCode, QuantityStepper, RadioGroup, RangeCalendar, RecoveryKit, ResizableHandle, ResizablePanel, ResizablePanelGroup, ResponsiveSurface, RootLayout, SWIPE_STACK_TRANSITION_MS, ScrollArea, SegmentedControl, Select, Sheet, Slider, Spinner, SplitMethodSelector, SplitPane, StatusBadge, StepStrip, SuggestionInput, SwipableMobileCarousel, SwipableMobileCarouselDots, SwipableMobileCarouselSlide, SwipableMobileCarouselSlideBody, SwipableMobileCarouselSlideFooter, SwipableMobileCarouselSlideHeader, SwipeStack, SwipeStackCard, SystemBanner, THEME_PRESETS, THEME_PRESET_NAMES, Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRow, Tabs, TagInput, Textarea, ThreeColumnLayout, ToastProvider, Toggle, Tooltip, Typography, UserMenu, recoveryKitFileName, recoveryKitFileText, shouldHandleDndEvent, useCarouselRouteSync, useCommitOnEnterOrBlur, useDoubleTapHandler, useIsMobile, useIsOffline, useLongPress, useOfflineTileState, useOverlaySecondRow, useReorderSensors, useResponsiveLayout, useSingleOrDoubleTap, useSnapCarousel, useSwipeReveal, useSwipeStack, useToast };
|
|
3798
|
+
export type { AccordionItem, AccordionProps, AlertProps, AlertVariant, AppTileProps, AppsLauncherItem, AppsLauncherProps, AspectRatioProps, AuthCardProps, AuthCodeInputProps, AuthFieldControl, AuthFieldProps, AuthFooterProps, AvatarProps, AvatarStackPerson, AvatarStackProps, BadgeProps, BadgeStatus, BadgeVariant, BalanceChipProps, BannerVariant, BrandBadgeProps, BreadcrumbItem, BreadcrumbProps, ButtonGroupProps, ButtonLinkProps, ButtonProps, ButtonSize, ButtonVariant, CalendarProps, CardProps, CardTileGridProps, CardTileProps, CheckableListRowProps, CheckboxProps, CodeTextareaProps, CollapsibleProps, ColorPickerProps, ColorPickerSwatch, ComboboxOption, ComboboxProps, CommandItem, CommandProps, CommitOnEnterOrBlurHandlers, ConfirmDialogProps, ConsentPromptProps, ContextMenuProps, CopyButtonProps, CurrencyInputProps, DataTableColumn, DataTableProps, DatePickerProps, DateRange, DateRangePickerProps, DeviceOnlyGateProps, DeviceStorageKeyGateProps, DeviceStorageKeyGateStatus, DialogProps, DialogSize, DragHandleRowProps, DrawerProps, EmptyStateProps, FileDropzoneProps, FloatingActionButtonProps, FooterIcon, FormFieldProps, FormFieldRenderProps, GripIconProps, HeaderFooterLayoutProps, HeaderPlugin, HeaderProps, HoverCardProps, IconName, IconPickerProps, IconProps, InputProps, ItemProps, KbdProps, LabelProps, LegalLinksProps, LockedReason, LockedStateProps, LongPressHandlers, MarkdownProps, MarkerProps, MemberMultiSelectOption, MemberMultiSelectProps, MenuEntry, MenuItem, MenuLabel, MenuProps, MenuSeparator, MenubarMenu, MenubarProps, MessageProps, MessageScrollerProps, MessageSender, MobileAppsDrawerItem, MobileAppsDrawerProps, MobileFooterProps, MobileHeaderProps, NavListGroup, NavListItem, NavListLinkProps, NavListProps, NavTabItem, NavTabLinkProps, NavTabsProps, NavigationMenuItem, NavigationMenuProps, NewCardTileProps, NotificationsPanelItem, NotificationsPanelProps, OfflineGateProps, OfflineTileState, OverlayHeaderProps, PageContainerProps, PageHeaderProps, PageLayoutPadding, PageLayoutProps, PaginationProps, Photo, PhotoGalleryProps, PhotoGridProps, PhotoViewerProps, PopoverProps, ProgressProps, QrCodeProps, QuantityStepperProps, RadioGroupItem, RadioGroupProps, RangeCalendarProps, RecoveryKitProps, ResizableDirection, ResizableHandleProps, ResizablePanelGroupProps, ResizablePanelProps, ResponsiveSurfaceProps, RootLayoutProps, RootLayoutVariant, ScrollAreaProps, SegmentedControlProps, SegmentedOption, SelectProps, SheetProps, SliderProps, SortDirection, SpinnerProps, SplitMethod, SplitMethodSelectorProps, SplitPaneProps, StatusBadgeProps, StatusBadgeStatus, StepStripItem, StepStripProps, SuggestionInputProps, SuggestionOption, SwipableMobileCarouselDotsProps, SwipableMobileCarouselIndicatorProps, SwipableMobileCarouselProps, SwipableMobileCarouselSlideBodyProps, SwipableMobileCarouselSlideFooterProps, SwipableMobileCarouselSlideHeaderProps, SwipableMobileCarouselSlideProps, SwipeDirection, SwipeDirectionMeta, SwipeStackCardProps, SwipeStackProps, SystemBannerProps, TabItem, TableProps, TabsProps, TagInputProps, TextareaProps, ThemePresetName, ThemePresetTokens, ThreeColumnLayoutProps, ToastContextValue, ToastItem, ToggleProps, TooltipProps, TypographyProps, TypographyVariant, UseCarouselRouteSyncOptions, UseCarouselRouteSyncResult, UseLongPressOptions, UseReorderSensorsOptions, UseResponsiveLayoutOptions, UseResponsiveLayoutResult, UseSnapCarouselOptions, UseSnapCarouselResult, UseSwipeRevealHandlers, UseSwipeRevealOptions, UseSwipeRevealResult, UseSwipeStackHandlers, UseSwipeStackOptions, UseSwipeStackResult, UserMenuItem, UserMenuProps };
|