@ultralabs/glass 0.0.0-stage → 0.1.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 +318 -0
- package/DESIGN.md +682 -0
- package/LICENSE +21 -0
- package/README.md +690 -2
- package/dist/esm/index.js +20872 -0
- package/dist/types/src/charts/ULCartesianChart.d.ts +177 -0
- package/dist/types/src/charts/ULDonutChart.d.ts +65 -0
- package/dist/types/src/charts/ULFunnelChart.d.ts +64 -0
- package/dist/types/src/charts/ULHeatmapChart.d.ts +40 -0
- package/dist/types/src/charts/ULRadarChart.d.ts +19 -0
- package/dist/types/src/charts/ULRadialChart.d.ts +48 -0
- package/dist/types/src/charts/ULScatterChart.d.ts +49 -0
- package/dist/types/src/charts/core.d.ts +287 -0
- package/dist/types/src/charts/decimate.d.ts +8 -0
- package/dist/types/src/charts/nav.d.ts +368 -0
- package/dist/types/src/charts/quadtree.d.ts +9 -0
- package/dist/types/src/charts/scales.d.ts +59 -0
- package/dist/types/src/charts/timeseries.d.ts +56 -0
- package/dist/types/src/components/ULAnchoredSurface/ULAnchoredSurface.d.ts +72 -0
- package/dist/types/src/components/ULBatch2/carousel.d.ts +31 -0
- package/dist/types/src/components/ULBatch2/hovercard.d.ts +40 -0
- package/dist/types/src/components/ULBatch2/layout.d.ts +16 -0
- package/dist/types/src/components/ULBatch2/menubar.d.ts +29 -0
- package/dist/types/src/components/ULBatch2/navmenu.d.ts +51 -0
- package/dist/types/src/components/ULBatch2/resizable.d.ts +48 -0
- package/dist/types/src/components/ULBatch2/typography.d.ts +55 -0
- package/dist/types/src/components/ULButton/ULButton.d.ts +87 -0
- package/dist/types/src/components/ULContainers/ULCard.d.ts +54 -0
- package/dist/types/src/components/ULContainers/ULDialog.d.ts +57 -0
- package/dist/types/src/components/ULContainers/ULLayout.d.ts +81 -0
- package/dist/types/src/components/ULContainers/ULMenu.d.ts +99 -0
- package/dist/types/src/components/ULContainers/ULOverlays.d.ts +113 -0
- package/dist/types/src/components/ULContainers/contextTarget.d.ts +91 -0
- package/dist/types/src/components/ULData/ULData.d.ts +225 -0
- package/dist/types/src/components/ULData/ULKpi.d.ts +159 -0
- package/dist/types/src/components/ULField/ULField.d.ts +93 -0
- package/dist/types/src/components/ULForms/fieldContext.d.ts +39 -0
- package/dist/types/src/components/ULForms/forms.d.ts +143 -0
- package/dist/types/src/components/ULIsland/ULIsland.d.ts +39 -0
- package/dist/types/src/components/ULIsland/headerConfig.d.ts +43 -0
- package/dist/types/src/components/ULIsland/navIndicator.d.ts +26 -0
- package/dist/types/src/components/ULListbox/ULListbox.d.ts +75 -0
- package/dist/types/src/components/ULPickers/ULPickers.d.ts +141 -0
- package/dist/types/src/components/ULSegmented/ULSegmented.d.ts +50 -0
- package/dist/types/src/components/ULSelection/ULSelection.d.ts +71 -0
- package/dist/types/src/components/ULSlider/ULSlider.d.ts +43 -0
- package/dist/types/src/components/ULSpinner/ULSpinner.d.ts +8 -0
- package/dist/types/src/components/ULStructure/kbd.d.ts +22 -0
- package/dist/types/src/components/ULStructure/structure.d.ts +154 -0
- package/dist/types/src/components/ULTabs/ULTabs.d.ts +28 -0
- package/dist/types/src/components/ULTooltip/anchoredTooltip.d.ts +22 -0
- package/dist/types/src/components/actions/actions.d.ts +175 -0
- package/dist/types/src/components/actions/core.d.ts +346 -0
- package/dist/types/src/components/dashboard/blocks.d.ts +583 -0
- package/dist/types/src/components/dashboard/blocks2.d.ts +297 -0
- package/dist/types/src/components/dashboard/columnsDrag.d.ts +27 -0
- package/dist/types/src/components/shared/ULCheckMark.d.ts +9 -0
- package/dist/types/src/components/shared/dev.d.ts +13 -0
- package/dist/types/src/components/shared/icons.d.ts +23 -0
- package/dist/types/src/glass/ULGlass.d.ts +78 -0
- package/dist/types/src/glass/ULGlassGroup.d.ts +16 -0
- package/dist/types/src/glass/accent.d.ts +31 -0
- package/dist/types/src/glass/contrast.d.ts +78 -0
- package/dist/types/src/glass/engine.d.ts +177 -0
- package/dist/types/src/glass/glassDebug.d.ts +27 -0
- package/dist/types/src/glass/material.d.ts +49 -0
- package/dist/types/src/glass/radius.d.ts +2 -0
- package/dist/types/src/hooks/useAnchoredMorph.d.ts +20 -0
- package/dist/types/src/hooks/usePointerLight.d.ts +6 -0
- package/dist/types/src/hooks/useReducedMotion.d.ts +3 -0
- package/dist/types/src/index.d.ts +150 -0
- package/dist/types/src/island/sectionAccent.d.ts +18 -0
- package/dist/types/src/live/ULLiveStatus.d.ts +18 -0
- package/dist/types/src/live/liveQueue.d.ts +13 -0
- package/dist/types/src/live/liveSource.d.ts +149 -0
- package/dist/types/src/live/liveStore.d.ts +72 -0
- package/dist/types/src/motion/anchoredMorph.d.ts +163 -0
- package/dist/types/src/motion/goo.d.ts +3 -0
- package/dist/types/src/motion/lensBubble.d.ts +143 -0
- package/dist/types/src/motion/lensSelect.d.ts +31 -0
- package/dist/types/src/motion/overlayStack.d.ts +13 -0
- package/dist/types/src/motion/placement.d.ts +18 -0
- package/dist/types/src/motion/spring.d.ts +20 -0
- package/dist/types/src/motion/topLayer.d.ts +13 -0
- package/dist/types/src/motion/viewSwap.d.ts +33 -0
- package/dist/types/src/motion/virtualAnchor.d.ts +28 -0
- package/dist/ul-glass.css +10508 -0
- package/dist/ul-glass.js +20915 -0
- package/dist/ul-glass.min.js +14 -0
- package/dist/ul-glass.min.js.map +7 -0
- package/icons/arrow-up-down.svg +5 -0
- package/icons/bell.svg +3 -0
- package/icons/bold.svg +2 -0
- package/icons/calendar.svg +5 -0
- package/icons/check.svg +2 -0
- package/icons/chevron-down.svg +2 -0
- package/icons/chevron-left.svg +2 -0
- package/icons/chevron-right.svg +2 -0
- package/icons/chevrons-right.svg +3 -0
- package/icons/circle-check.svg +3 -0
- package/icons/circle-x.svg +4 -0
- package/icons/circle.svg +2 -0
- package/icons/copy.svg +3 -0
- package/icons/ellipsis.svg +4 -0
- package/icons/eye.svg +3 -0
- package/icons/filter.svg +2 -0
- package/icons/flags/LICENSE.md +2 -0
- package/icons/flags/cs.svg +1 -0
- package/icons/flags/de.svg +1 -0
- package/icons/flags/en.svg +1 -0
- package/icons/flags/sk.svg +1 -0
- package/icons/folder-kanban.svg +5 -0
- package/icons/icons.json +1 -0
- package/icons/inbox.svg +3 -0
- package/icons/info.svg +4 -0
- package/icons/layout-dashboard.svg +5 -0
- package/icons/layout-grid.svg +5 -0
- package/icons/loader-circle.svg +2 -0
- package/icons/lock.svg +3 -0
- package/icons/mail.svg +3 -0
- package/icons/menu.svg +4 -0
- package/icons/minus.svg +2 -0
- package/icons/panel-left-close.svg +4 -0
- package/icons/plus.svg +3 -0
- package/icons/refresh-cw.svg +5 -0
- package/icons/search.svg +3 -0
- package/icons/shield-check.svg +3 -0
- package/icons/shopping-bag.svg +4 -0
- package/icons/sparkles.svg +6 -0
- package/icons/trash-2.svg +6 -0
- package/icons/triangle-alert.svg +4 -0
- package/icons/upload.svg +4 -0
- package/icons/users.svg +5 -0
- package/icons/x.svg +3 -0
- package/package.json +62 -4
- package/tokens/tokens.css +799 -0
- package/tokens/tokens.json +1017 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export interface LinearScale {
|
|
2
|
+
kind: 'linear' | 'log';
|
|
3
|
+
domain: [number, number];
|
|
4
|
+
range: [number, number];
|
|
5
|
+
(v: number): number;
|
|
6
|
+
ticks(n?: number): number[];
|
|
7
|
+
invert(px: number): number;
|
|
8
|
+
}
|
|
9
|
+
export interface BandScale {
|
|
10
|
+
kind: 'band';
|
|
11
|
+
count: number;
|
|
12
|
+
range: [number, number];
|
|
13
|
+
(i: number): number;
|
|
14
|
+
bandwidth: number;
|
|
15
|
+
step: number;
|
|
16
|
+
invert(px: number): number;
|
|
17
|
+
}
|
|
18
|
+
export interface PointScale {
|
|
19
|
+
kind: 'point';
|
|
20
|
+
count: number;
|
|
21
|
+
range: [number, number];
|
|
22
|
+
(i: number): number;
|
|
23
|
+
step: number;
|
|
24
|
+
invert(px: number): number;
|
|
25
|
+
}
|
|
26
|
+
export interface TimeScale {
|
|
27
|
+
kind: 'time';
|
|
28
|
+
domain: [number, number];
|
|
29
|
+
range: [number, number];
|
|
30
|
+
(t: number): number;
|
|
31
|
+
ticks(n?: number): number[];
|
|
32
|
+
invert(px: number): number;
|
|
33
|
+
}
|
|
34
|
+
/** d3-style tick step: 1, 2 or 5 × 10^k. */
|
|
35
|
+
export declare function tickStep(lo: number, hi: number, count: number): number;
|
|
36
|
+
/** Extends a domain to round tick values. Keeps 0 when the data crosses or touches it. */
|
|
37
|
+
export declare function niceDomain(lo: number, hi: number, count?: number): [number, number];
|
|
38
|
+
export declare function linearTicks(lo: number, hi: number, count?: number): number[];
|
|
39
|
+
export declare function scaleLinear(domain: [number, number], range: [number, number]): LinearScale;
|
|
40
|
+
export declare function scaleLog(domain: [number, number], range: [number, number]): LinearScale;
|
|
41
|
+
export declare function logDomain(lo: number, hi: number): [number, number];
|
|
42
|
+
export declare function scaleBand(count: number, range: [number, number], padding?: number): BandScale;
|
|
43
|
+
export declare function scalePoint(count: number, range: [number, number]): PointScale;
|
|
44
|
+
export declare function scaleTime(domain: [number, number], range: [number, number]): TimeScale;
|
|
45
|
+
export type ChartLocale = 'en' | 'sk' | 'de' | 'cs';
|
|
46
|
+
export declare function chartLocale(locale?: string): ChartLocale;
|
|
47
|
+
/** Axis / tooltip number formatter: tabular-friendly, compact notation (1,2 tis. / 1.2K / 1.200) by locale. */
|
|
48
|
+
export declare function makeNumberFormat(locale?: string, opts?: Intl.NumberFormatOptions, compact?: boolean): (v: number | null | undefined) => string;
|
|
49
|
+
export declare function makeTimeFormat(locale: string | undefined, spanMs: number): (t: number) => string;
|
|
50
|
+
export type Pt = [number, number] | null;
|
|
51
|
+
/** Linear or monotone-x (Fritsch–Carlson) path; null points split the line (gaps). */
|
|
52
|
+
export declare function linePath(pts: Pt[], curve?: 'linear' | 'monotone'): string;
|
|
53
|
+
/** Area between top points and a baseline (per point, for stacking); gaps split the area. */
|
|
54
|
+
export declare function areaPath(top: Pt[], base: Pt[], curve?: 'linear' | 'monotone'): string;
|
|
55
|
+
/** Donut / pie segment path (angles in radians, 0 = 12 o'clock, clockwise). */
|
|
56
|
+
export declare function arcPath(cx: number, cy: number, r0: number, r1: number, a0: number, a1: number, padPx?: number): string;
|
|
57
|
+
export type ScatterShape = 'circle' | 'square' | 'triangle' | 'diamond';
|
|
58
|
+
export declare const SCATTER_SHAPES: ScatterShape[];
|
|
59
|
+
export declare const shapePath: (shape: ScatterShape, x: number, y: number, r: number) => string;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time-series interaction on top of ULCartesianChart: zoom / pan / range brush (ZoomHost, registered into the chart),
|
|
3
|
+
* pure zoom maths (tested), the overview strip, and streaming: createChartStream (appendPoint / setWindow, bounded
|
|
4
|
+
* buffer, one commit per frame, pause queue, stale) + ULStreamChart (sliding window, pulsing latest bead, live status).
|
|
5
|
+
* Rules: the wheel zooms only with Ctrl / Cmd (pinch on trackpads arrives as Ctrl+wheel) and never blocks page scroll;
|
|
6
|
+
* touch: pinch zooms, one finger pans; drag = brush, Shift+drag = pan; Esc cancels a brush; double-click resets.
|
|
7
|
+
*/
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
import type { LiveSource } from '../live/liveSource.js';
|
|
10
|
+
import type { TimeRangeValue } from '../components/dashboard/blocks.js';
|
|
11
|
+
import { type ULCartesianChartProps } from './ULCartesianChart.js';
|
|
12
|
+
import './charts-adv.css';
|
|
13
|
+
export type Span = [number, number];
|
|
14
|
+
/** Zoom around `center` by `factor` (< 1 zooms in), clamped to the full extent and a minimum span. */
|
|
15
|
+
export declare function zoomAt(view: Span, full: Span, center: number, factor: number, minSpan: number): Span;
|
|
16
|
+
export declare function panBy(view: Span, full: Span, delta: number): Span;
|
|
17
|
+
export declare function clampView(v: Span, full: Span): Span;
|
|
18
|
+
export declare const isFull: (v: Span, full: Span) => boolean;
|
|
19
|
+
/** onRangeChange payload: the ULTimeRange value shape (preset 'custom'); category charts send indices as numbers in from / to via Date(ms = index). */
|
|
20
|
+
export declare const rangeValue: (v: Span) => TimeRangeValue;
|
|
21
|
+
/** Visible index range for a view (time: values; category: rounded indices). */
|
|
22
|
+
export declare function sliceFor(xs: ArrayLike<number>, v: Span, time: boolean): [number, number];
|
|
23
|
+
export interface ChartStreamOptions<P> {
|
|
24
|
+
time: (p: P) => number;
|
|
25
|
+
windowMs: number;
|
|
26
|
+
maxPoints?: number;
|
|
27
|
+
staleAfter?: number;
|
|
28
|
+
}
|
|
29
|
+
export interface ChartStreamSnapshot<P> {
|
|
30
|
+
points: P[];
|
|
31
|
+
version: number;
|
|
32
|
+
pending: number;
|
|
33
|
+
lastT: number;
|
|
34
|
+
lastAt: number;
|
|
35
|
+
interval: number;
|
|
36
|
+
windowMs: number;
|
|
37
|
+
}
|
|
38
|
+
export interface ChartStream<P> extends Omit<LiveSource<P>, 'subscribe'> {
|
|
39
|
+
appendPoint(p: P | P[]): void;
|
|
40
|
+
setWindow(ms: number): void;
|
|
41
|
+
/** One notification per animation frame at most. */
|
|
42
|
+
subscribe(fn: () => void): () => void;
|
|
43
|
+
snapshot(): ChartStreamSnapshot<P>;
|
|
44
|
+
/** Hold (hover / pin): commits stop, appended points count as pending. Independent of the user pause. */
|
|
45
|
+
hold(on: boolean): void;
|
|
46
|
+
/** Feed from a LiveSource (already batched per frame); map returns the point(s) or null. Returns the unsubscribe. */
|
|
47
|
+
connect<M>(source: LiveSource<M>, map: (m: M) => P | P[] | null | undefined): () => void;
|
|
48
|
+
}
|
|
49
|
+
export declare function createChartStream<P>(o: ChartStreamOptions<P>): ChartStream<P>;
|
|
50
|
+
export interface ULStreamChartProps<P> extends Omit<ULCartesianChartProps<P>, 'data' | 'x' | 'xScale' | 'xDomain' | 'zoom'> {
|
|
51
|
+
/** Stream from createChartStream (one commit per frame, bounded buffer). */ stream: ChartStream<P>;
|
|
52
|
+
/** Time accessor (p, i) => ms epoch | Date. */ x?: (p: P, i: number) => number | Date;
|
|
53
|
+
/** Pause while the pointer is over the plot or a tooltip is pinned. Default true. */
|
|
54
|
+
pauseOnHover?: boolean;
|
|
55
|
+
}
|
|
56
|
+
export declare function ULStreamChart<P>(props: ULStreamChartProps<P>): React.JSX.Element;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type GlassVariant, type ULGlassProps } from '../../glass/ULGlass.js';
|
|
3
|
+
import type { GlassTier } from '../../glass/engine.js';
|
|
4
|
+
import type { Backdrop } from '../../glass/accent.js';
|
|
5
|
+
import type { Align, Side } from '../../motion/placement.js';
|
|
6
|
+
import type { MorphOptions, AnchoredMorph } from '../../motion/anchoredMorph.js';
|
|
7
|
+
import './ULAnchoredSurface.css';
|
|
8
|
+
export interface ULAnchoredSurfaceProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
9
|
+
/** Accent of the surface glass (forwarded to ULGlass through the rest props; omit to inherit the anchor's accent). */ accent?: ULGlassProps['accent'];
|
|
10
|
+
/** subtle | tinted | vivid, or k 0..1 (forwarded to ULGlass). Omit to inherit. */ accentStrength?: ULGlassProps['accentStrength'];
|
|
11
|
+
/** Controlled open state. */ open: boolean;
|
|
12
|
+
/** Element the surface is anchored to (and morphs from). */ anchorRef: React.RefObject<HTMLElement | null>;
|
|
13
|
+
/** Called on outside pointerdown and Escape (only while this is the top overlay). */
|
|
14
|
+
onClose?: () => void;
|
|
15
|
+
/** Preferred side: "top" | "bottom" | "left" | "right" (flips when there is no room). */ side?: Side;
|
|
16
|
+
/** Alignment on the side: "start" | "center" | "end". */ align?: Align;
|
|
17
|
+
/** Gap between anchor and surface in px. Default --ul-popover-offset. */ offset?: number;
|
|
18
|
+
/** Glass size tier of the surface ("sm" | "md" | "lg" | "xl"). */ tier?: GlassTier;
|
|
19
|
+
/** Glass variant ("regular" | "chrome" | "clear"). */ variant?: GlassVariant;
|
|
20
|
+
/** Inner padding (px or CSS length). */ padding?: number | string;
|
|
21
|
+
/** Corner radius (px or CSS length); list rows derive --ul-item-radius from it. */ radius?: number | string;
|
|
22
|
+
/** Close on pointerdown outside surface and anchor. Default true. */ closeOnOutside?: boolean;
|
|
23
|
+
/** Close on Escape (focus returns to the anchor). Default true. */ closeOnEscape?: boolean;
|
|
24
|
+
/** Render at document.body so transformed / clipped ancestors cannot trap or crop it. Theme, accent and backdrop are copied from the anchor. Default true. */
|
|
25
|
+
portal?: boolean;
|
|
26
|
+
/** Contrast class for the overlay. Default inherits (from the anchor when portalled). */
|
|
27
|
+
backdrop?: Backdrop;
|
|
28
|
+
/** lock (default for role menu / listbox / dialog) | fixed (default for role status / alert: anchored toasts) | follow (default otherwise) | close. */
|
|
29
|
+
scrollBehavior?: 'lock' | 'follow' | 'fixed' | 'close';
|
|
30
|
+
/** Shorthand: scrollLock true = scrollBehavior "lock", false = "follow". */
|
|
31
|
+
scrollLock?: boolean;
|
|
32
|
+
/** Anchor fully out of view: keep (default) | hide | close (calls onClose). */
|
|
33
|
+
onAnchorHidden?: 'keep' | 'hide' | 'close';
|
|
34
|
+
/** Where the surface settles (anchored default; center / edges for modals, sheets, drawers). The morph still starts on the anchor. */
|
|
35
|
+
layout?: MorphOptions['layout'];
|
|
36
|
+
/** Owner lays the surface out itself (toast stack); the morph derives its side from geometry. */
|
|
37
|
+
manual?: boolean;
|
|
38
|
+
/** Soft graphite scrim under the surface (not glass); its opacity rides the morph. Click = outside. */
|
|
39
|
+
scrim?: boolean;
|
|
40
|
+
/** Modal: aria-modal, focus trap, initial focus, focus returns on close. */
|
|
41
|
+
modal?: boolean;
|
|
42
|
+
/** Initial focus inside a modal surface: element or selector. Default [data-autofocus] or the first focusable. */
|
|
43
|
+
initialFocus?: HTMLElement | string | null;
|
|
44
|
+
/** Element focus returns to on close. Default the element focused when it opened. */
|
|
45
|
+
returnFocus?: HTMLElement | null;
|
|
46
|
+
/** Ref to the glass surface element (tests, measurement). */
|
|
47
|
+
surfaceRef?: React.MutableRefObject<HTMLElement | null>;
|
|
48
|
+
/** Ref to the AnchoredMorph instance (owners that drag the settled surface call shiftFinal). */
|
|
49
|
+
morphRef?: React.MutableRefObject<AnchoredMorph | null>;
|
|
50
|
+
/** Join the overlay stack (Esc / outside / focus order). Default true; toasts pass false. */
|
|
51
|
+
stack?: boolean;
|
|
52
|
+
/** Hole that keeps the trigger on top while morphing. Default: auto (false when the trigger lives inside a dialog surface). */
|
|
53
|
+
anchorOnTop?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* above (default for non-modal overlays): the trigger stays visible + clickable through the clip hole while morphing.
|
|
56
|
+
* covered (default for modal / alertdialog: modal, sheet, drawer, command palette): surface + scrim go into the TOP LAYER
|
|
57
|
+
* from the first frame (popover="manual"), so no trigger, sticky header, island or transformed ancestor can draw above them.
|
|
58
|
+
*/
|
|
59
|
+
anchorVisibility?: 'above' | 'covered';
|
|
60
|
+
/** Non-modal covered surfaces: place the surface over the anchor with this inset (px), so the anchor is under the surface in every frame. */
|
|
61
|
+
overlapAnchor?: number;
|
|
62
|
+
/** Small pointer toward the anchor (popover). Flat (tint + rim), never a second glass layer; hidden while morphing. */
|
|
63
|
+
arrow?: boolean;
|
|
64
|
+
/** Surface content (embedded variants inside: no own glass). */ children?: React.ReactNode;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Base for every anchored overlay: one glass layer pinned to an anchor with
|
|
68
|
+
* collision-aware placement and the shared elastic morph. Menus, popovers,
|
|
69
|
+
* selects, tooltips, pickers, modals, drawers, toasts and the command palette
|
|
70
|
+
* compose this; none implement their own motion, scrolling or stacking.
|
|
71
|
+
*/
|
|
72
|
+
export declare function ULAnchoredSurface({ open, anchorRef, onClose, side, align, offset, tier, variant, padding, radius, closeOnOutside, closeOnEscape, portal, backdrop, scrollBehavior, scrollLock, onAnchorHidden, layout, manual, scrim, modal, initialFocus, returnFocus, surfaceRef: outerRef, morphRef, stack, arrow, anchorOnTop, anchorVisibility, overlapAnchor, className, children, ...rest }: ULAnchoredSurfaceProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './batch2.css';
|
|
3
|
+
export interface ULCarouselProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/** Accessible name of the region. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Slides visible at once (default 1). */
|
|
8
|
+
visible?: number;
|
|
9
|
+
/** Next on the last position goes to the first (and back). Default false. */
|
|
10
|
+
loop?: boolean;
|
|
11
|
+
/** Autoplay interval in ms. Off by default; never runs under reduced motion; pauses on hover and focus. */
|
|
12
|
+
autoplay?: number | false;
|
|
13
|
+
/** Gap between slides (CSS length). Default var(--ul-space-3). */
|
|
14
|
+
gap?: string;
|
|
15
|
+
/** Show previous / next buttons (default true) and position indicators (default true). */
|
|
16
|
+
controls?: boolean;
|
|
17
|
+
indicators?: boolean;
|
|
18
|
+
index?: number;
|
|
19
|
+
defaultIndex?: number;
|
|
20
|
+
onIndexChange?: (i: number) => void;
|
|
21
|
+
locale?: string;
|
|
22
|
+
className?: string;
|
|
23
|
+
style?: React.CSSProperties;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Native scroll-snap carousel. Touch = native momentum (no hijacking, vertical page scroll never blocked);
|
|
27
|
+
* mouse drag scrolls the track and snaps to the nearest slide on release. Indicators = buttons with the shared nav
|
|
28
|
+
* indicator resting on the current one (no own indicator element). Keys on the region: ← → Home End.
|
|
29
|
+
* role region + aria-roledescription carousel; slides role group "n of N"; the polite status speaks only when autoplay is off.
|
|
30
|
+
*/
|
|
31
|
+
export declare function ULCarousel({ children, label, visible, loop, autoplay, gap, controls, indicators, index, defaultIndex, onIndexChange, locale, className, style }: ULCarouselProps): React.JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type ContextMenuProps } from '../ULContainers/contextTarget.js';
|
|
3
|
+
import type { Side, Align } from '../../motion/placement.js';
|
|
4
|
+
import './batch2.css';
|
|
5
|
+
export interface ULHoverCardProps extends ContextMenuProps<{
|
|
6
|
+
group: string;
|
|
7
|
+
}> {
|
|
8
|
+
/** The trigger (a link, button or avatar). It keeps its own role; the card is supplementary. */
|
|
9
|
+
children: React.ReactElement;
|
|
10
|
+
/** Card content: avatar, text, ULKeyValue, buttons. Never the only place where information lives. */
|
|
11
|
+
content: React.ReactNode;
|
|
12
|
+
side?: Side;
|
|
13
|
+
align?: Align;
|
|
14
|
+
arrow?: boolean;
|
|
15
|
+
/** Accessible name of the card (role dialog, non-modal). */
|
|
16
|
+
label?: string;
|
|
17
|
+
/** Hover-intent delays in ms. Default --ul-hovercard-open-delay (500) / --ul-hovercard-close-delay (250). */
|
|
18
|
+
openDelay?: number;
|
|
19
|
+
closeDelay?: number;
|
|
20
|
+
/** One card open at a time per group. Default "default". */
|
|
21
|
+
group?: string;
|
|
22
|
+
open?: boolean;
|
|
23
|
+
defaultOpen?: boolean;
|
|
24
|
+
onOpenChange?: (open: boolean) => void;
|
|
25
|
+
/** Content components inside the card render their embedded variant (no own card / glass); the card is the one glass surface. Default true. */
|
|
26
|
+
embedded?: boolean;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
className?: string;
|
|
29
|
+
/** @internal tests */
|
|
30
|
+
surfaceRef?: React.MutableRefObject<HTMLElement | null>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Hover card on the existing ULPopover (anchored morph, anchorVisibility 'above', scroll follow).
|
|
34
|
+
* Pointer: opens after openDelay over the trigger, closes closeDelay after the pointer left both the trigger and the card;
|
|
35
|
+
* an invisible bridge inside the surface covers the --ul-pop-offset gap (same technique as the submenu bridge).
|
|
36
|
+
* Keyboard: opens after openDelay on focus-visible; Tab from the trigger moves into the card when it has controls;
|
|
37
|
+
* stays open while focus is inside; Esc closes and returns focus to the trigger.
|
|
38
|
+
* Touch: first tap opens (the tap's default action is suppressed), a second tap or an outside tap closes.
|
|
39
|
+
*/
|
|
40
|
+
export declare function ULHoverCard(props: ULHoverCardProps): React.JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './batch2.css';
|
|
3
|
+
export interface ULAspectRatioProps {
|
|
4
|
+
/** width / height, e.g. 16 / 9 (default), 1, 4 / 3. */
|
|
5
|
+
ratio?: number;
|
|
6
|
+
/** object-fit for img / video / iframe / canvas children. Default cover. */
|
|
7
|
+
fit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
|
|
8
|
+
/** Loading placeholder (shared ULSkeleton shimmer) instead of children. */
|
|
9
|
+
skeleton?: boolean;
|
|
10
|
+
/** Rounded corners (default true, --ul-radius-md). */
|
|
11
|
+
rounded?: boolean;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
style?: React.CSSProperties;
|
|
15
|
+
}
|
|
16
|
+
export declare function ULAspectRatio({ ratio, fit, skeleton, rounded, children, className, style }: ULAspectRatioProps): React.JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type MenuItem } from '../ULContainers/ULMenu.js';
|
|
3
|
+
import './batch2.css';
|
|
4
|
+
export interface MenubarMenu {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
items: MenuItem[];
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface ULMenubarProps {
|
|
11
|
+
menus: MenubarMenu[];
|
|
12
|
+
/** Accessible name of the bar. */
|
|
13
|
+
label?: string;
|
|
14
|
+
onAction?: (menuId: string, itemId: string, item: MenuItem) => void;
|
|
15
|
+
/** Label of the back row when a submenu drills in (phones). */
|
|
16
|
+
backLabel?: string;
|
|
17
|
+
size?: 'sm' | 'md';
|
|
18
|
+
className?: string;
|
|
19
|
+
/** @internal tests: surface of the open menu */
|
|
20
|
+
surfaceRef?: React.MutableRefObject<HTMLElement | null>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Menubar: a flat paint bar of menu triggers (role menubar), the shared nav indicator follows hover / focus.
|
|
24
|
+
* Each trigger owns one ULMenu (anchored morph; submenus beside with the 2px gap, drill-in on phones; check items = ULCheckMark; shortcuts = ULKbd).
|
|
25
|
+
* Keys on the bar: ← → (wrap) Home End move, Enter / Space / ↓ open on the first item, ↑ on the last.
|
|
26
|
+
* While a menu is open, ← → inside it (when no submenu handles the key) or hovering another trigger switch menus at once:
|
|
27
|
+
* the old surface exits and the new one enters with no delay (AnchoredMorph has no re-anchor; overlay code is frozen).
|
|
28
|
+
*/
|
|
29
|
+
export declare function ULMenubar({ menus, label, onAction, backLabel, size, className, surfaceRef }: ULMenubarProps): React.JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './batch2.css';
|
|
3
|
+
export interface NavLink {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
href: string;
|
|
8
|
+
icon?: string;
|
|
9
|
+
current?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface NavMenuItem {
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
/** Link item. */
|
|
15
|
+
href?: string;
|
|
16
|
+
/** Marks the current page (aria-current="page"); the indicator rests on it. */
|
|
17
|
+
current?: boolean;
|
|
18
|
+
/** Trigger item: opens a panel with a grid of links. */
|
|
19
|
+
panel?: {
|
|
20
|
+
links: NavLink[]; /** min column width in px (auto-fill grid). Default 220. */
|
|
21
|
+
minColumn?: number;
|
|
22
|
+
footer?: React.ReactNode;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export interface ULNavigationMenuProps {
|
|
26
|
+
items: NavMenuItem[];
|
|
27
|
+
/** Accessible name of the <nav>. */
|
|
28
|
+
label?: string;
|
|
29
|
+
/** In-app routing: called on link activation (call e.preventDefault() to route yourself). */
|
|
30
|
+
onNavigate?: (e: React.MouseEvent, link: {
|
|
31
|
+
id: string;
|
|
32
|
+
href: string;
|
|
33
|
+
}) => void;
|
|
34
|
+
/** Below this width (px) the bar collapses into a button + bottom sheet with drill-in. Default 640. */
|
|
35
|
+
collapseBelow?: number;
|
|
36
|
+
locale?: string;
|
|
37
|
+
/** Sheet title on phones. Default the nav label. */
|
|
38
|
+
sheetTitle?: string;
|
|
39
|
+
className?: string;
|
|
40
|
+
/** @internal tests: the open panel surface */
|
|
41
|
+
surfaceRef?: React.MutableRefObject<HTMLElement | null>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Navigation menu: <nav> with link items and trigger items that open a panel (grid of ULItem links).
|
|
45
|
+
* Desktop: one ULAnchoredSurface anchored to the bar (anchored morph, scroll follow); switching panels runs the shared
|
|
46
|
+
* runViewSwap on the same surface (no second overlay). Shared nav indicator follows hover / focus and rests on the current item.
|
|
47
|
+
* Keys: ← → Home End between top items, ↓ / Enter / Space on a trigger opens its panel (↓ focuses the first link), Esc closes and
|
|
48
|
+
* returns focus, Tab runs through the links (Tab after the last link closes and moves on). Below collapseBelow: a Menu button opens
|
|
49
|
+
* a bottom sheet; trigger items drill in through the dialog context (useDialog().push), links come from props only.
|
|
50
|
+
*/
|
|
51
|
+
export declare function ULNavigationMenu(props: ULNavigationMenuProps): React.JSX.Element;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './batch2.css';
|
|
3
|
+
export interface ULResizablePanelProps {
|
|
4
|
+
id?: string;
|
|
5
|
+
/** Percent of the group. Panels without one share what is left. */
|
|
6
|
+
defaultSize?: number;
|
|
7
|
+
minSize?: number;
|
|
8
|
+
maxSize?: number;
|
|
9
|
+
/** Can collapse to collapsedSize (Enter on its handle, or dragging below minSize / 2). */
|
|
10
|
+
collapsible?: boolean;
|
|
11
|
+
collapsedSize?: number;
|
|
12
|
+
/** Accessible name (handles use it for aria-label). */
|
|
13
|
+
label?: string;
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
style?: React.CSSProperties;
|
|
17
|
+
/** @internal */ __i?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface ULResizableHandleProps {
|
|
20
|
+
withGrip?: boolean;
|
|
21
|
+
label?: string;
|
|
22
|
+
className?: string; /** @internal */
|
|
23
|
+
__i?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface ULResizablePanelGroupProps {
|
|
26
|
+
direction?: 'horizontal' | 'vertical';
|
|
27
|
+
/** localStorage key (per viewer, try / catch); restores sizes on mount. */
|
|
28
|
+
storageKey?: string;
|
|
29
|
+
/** Committed layout (pointer up, key, collapse, reset) in percent. */
|
|
30
|
+
onLayout?: (sizes: number[]) => void;
|
|
31
|
+
/** Below this group width (px) the panels stack vertically at their natural height and the handles hide. */
|
|
32
|
+
stackBelow?: number;
|
|
33
|
+
children: React.ReactNode;
|
|
34
|
+
className?: string;
|
|
35
|
+
style?: React.CSSProperties;
|
|
36
|
+
/** @internal tests */ apiRef?: React.MutableRefObject<ResizableApi | null>;
|
|
37
|
+
}
|
|
38
|
+
export interface ResizableApi {
|
|
39
|
+
sizes(): number[]; /** painted sizes this frame */
|
|
40
|
+
visual(): number[];
|
|
41
|
+
setSizes(s: number[], animate?: boolean): void;
|
|
42
|
+
collapse(i: number): void;
|
|
43
|
+
expand(i: number): void;
|
|
44
|
+
renders(): number;
|
|
45
|
+
}
|
|
46
|
+
export declare function ULResizablePanelGroup({ direction, storageKey, onLayout, stackBelow, children, className, style, apiRef }: ULResizablePanelGroupProps): React.JSX.Element;
|
|
47
|
+
export declare function ULResizablePanel({ __i, children, className, style, id, label }: ULResizablePanelProps): React.JSX.Element;
|
|
48
|
+
export declare function ULResizableHandle({ __i, withGrip, label, className }: ULResizableHandleProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './typography.css';
|
|
3
|
+
export type TypeSize = 'display' | 'h1' | 'h2' | 'h3' | 'h4';
|
|
4
|
+
export interface ULHeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
5
|
+
/** Document outline level (h1–h6). */
|
|
6
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
7
|
+
/** Visual size, independent of the level. Default: h1→h1 … h4+→h4. */
|
|
8
|
+
size?: TypeSize;
|
|
9
|
+
/** Clamp to n lines (ellipsis). */
|
|
10
|
+
lines?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function ULHeading({ level, size, lines, className, style, children, ...rest }: ULHeadingProps): React.JSX.Element;
|
|
13
|
+
export interface ULTextProps extends React.HTMLAttributes<HTMLElement> {
|
|
14
|
+
variant?: 'body' | 'lead' | 'small' | 'caption' | 'muted';
|
|
15
|
+
as?: 'p' | 'span' | 'div' | 'label' | 'small' | 'strong';
|
|
16
|
+
/** One line with ellipsis. */
|
|
17
|
+
truncate?: boolean;
|
|
18
|
+
/** Clamp to n lines. */
|
|
19
|
+
lines?: number;
|
|
20
|
+
/** Tabular numerals (tables, counters). */
|
|
21
|
+
tabular?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function ULText({ variant, as, truncate, lines, tabular, className, style, children, ...rest }: ULTextProps): React.JSX.Element;
|
|
24
|
+
export declare function ULCode({ children, className, ...rest }: React.HTMLAttributes<HTMLElement>): React.JSX.Element;
|
|
25
|
+
export interface ULBlockquoteProps {
|
|
26
|
+
children: React.ReactNode; /** Who said it (figcaption). */
|
|
27
|
+
source?: React.ReactNode; /** URL of the source (cite attribute). */
|
|
28
|
+
cite?: string;
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function ULBlockquote({ children, source, cite, className }: ULBlockquoteProps): React.JSX.Element;
|
|
32
|
+
export interface ULListProps {
|
|
33
|
+
ordered?: boolean;
|
|
34
|
+
items?: React.ReactNode[];
|
|
35
|
+
children?: React.ReactNode; /** Tighter spacing. */
|
|
36
|
+
dense?: boolean;
|
|
37
|
+
className?: string;
|
|
38
|
+
}
|
|
39
|
+
export declare function ULList({ ordered, items, children, dense, className }: ULListProps): React.JSX.Element;
|
|
40
|
+
export interface ULLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
41
|
+
href: string;
|
|
42
|
+
/** External link: icon + rel. Default: auto (absolute URL on another host). */
|
|
43
|
+
external?: boolean;
|
|
44
|
+
/** Open in a new tab (target _blank + rel noopener noreferrer + spoken hint). Default: same as external. */
|
|
45
|
+
newTab?: boolean;
|
|
46
|
+
/** Visual: inline (underlined, in text) or standalone. */
|
|
47
|
+
variant?: 'inline' | 'standalone';
|
|
48
|
+
locale?: string;
|
|
49
|
+
}
|
|
50
|
+
/** Link: focus ring outside, external indicator via ULIcon, rel / target handled (never a bare target=_blank). */
|
|
51
|
+
export declare function ULLink({ href, external, newTab, variant, locale, className, children, rel, target, ...rest }: ULLinkProps): React.JSX.Element;
|
|
52
|
+
/** Rich content wrapper: styles h1–h4, p, lists, blockquote, code, pre, a, hr, tables and media with the type scale; safe wrapping. */
|
|
53
|
+
export declare function ULProse({ children, className, size, ...rest }: React.HTMLAttributes<HTMLDivElement> & {
|
|
54
|
+
size?: 'sm' | 'md' | 'lg';
|
|
55
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { Accent, Backdrop } from '../../glass/accent.js';
|
|
3
|
+
import type { Material } from '../../glass/material.js';
|
|
4
|
+
import './ULButton.css';
|
|
5
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'tinted' | 'plain' | 'destructive';
|
|
6
|
+
export type ButtonSize = 'sm' | 'md' | 'lg';
|
|
7
|
+
export type ButtonShape = 'capsule' | 'rounded' | 'circle';
|
|
8
|
+
/** @internal showcase / visual tests only: render a state without the pointer. */
|
|
9
|
+
export type ForceState = 'hover' | 'focus' | 'pressed' | (string & {});
|
|
10
|
+
export interface ULButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
|
|
11
|
+
/** primary = vivid accent glass · secondary = neutral glass · tinted = tinted accent glass · plain = no surface (only on solid or glass surfaces) · destructive = vivid danger glass. Default secondary. */
|
|
12
|
+
variant?: ButtonVariant;
|
|
13
|
+
/** Visual height sm 36 / md 44 / lg 52. The hit area never drops below 44px. */
|
|
14
|
+
size?: ButtonSize;
|
|
15
|
+
/** Default "capsule" ("circle" when icon-only). */
|
|
16
|
+
shape?: ButtonShape;
|
|
17
|
+
/** Leading icon (an <svg>). With no children the button is icon-only and needs aria-label. */
|
|
18
|
+
icon?: React.ReactNode;
|
|
19
|
+
/** Icon after the label (e.g. chevron, external). Sized by the button (ULIcon md). */ iconEnd?: React.ReactNode;
|
|
20
|
+
/** Keeps the width, shows a spinner, sets aria-busy and ignores clicks. */
|
|
21
|
+
loading?: boolean;
|
|
22
|
+
/** Renders a real <a>. Disabled links get aria-disabled and leave the tab order. */
|
|
23
|
+
href?: string;
|
|
24
|
+
/** Link target when `href` is set (e.g. "_blank"; rel defaults to "noopener noreferrer"). */ target?: string;
|
|
25
|
+
/** Link rel when `href` is set. Default: "noopener noreferrer" for target="_blank". */ rel?: string;
|
|
26
|
+
/** Toggle button: sets aria-pressed. Use with onPressedChange. */
|
|
27
|
+
pressed?: boolean;
|
|
28
|
+
/** Toggle mode: called with the next pressed state on click (aria-pressed). */ onPressedChange?: (pressed: boolean) => void;
|
|
29
|
+
/** Accent preset or CSS color. Omit to inherit. */
|
|
30
|
+
accent?: Accent;
|
|
31
|
+
/** What sits behind the button. Use "light" (reading variant) on busy or bright backdrops. */
|
|
32
|
+
backdrop?: Backdrop;
|
|
33
|
+
/** "glass" | "flat" (controls category). Omit to resolve from ULProvider. @default undefined (resolved: "glass") */ material?: Material;
|
|
34
|
+
/** Native button type. Default "button" (never submits a form by accident). */ type?: 'button' | 'submit' | 'reset';
|
|
35
|
+
/** Stretch to the container width. Default false. */ fullWidth?: boolean;
|
|
36
|
+
/** Layers drawn across the WHOLE button (inset 0, clipped to its radius, under icon + label): fills, ripples. */
|
|
37
|
+
layers?: React.ReactNode;
|
|
38
|
+
/** @internal */
|
|
39
|
+
forceState?: ForceState;
|
|
40
|
+
}
|
|
41
|
+
/** Glass button. Elastic (2-3px, --ul-elasticity) and pressable; plain has no surface and does not move. */
|
|
42
|
+
export declare const ULButton: React.ForwardRefExoticComponent<ULButtonProps & React.RefAttributes<HTMLElement>>;
|
|
43
|
+
export interface ULToggleButtonProps extends Omit<ULButtonProps, 'pressed' | 'onPressedChange'> {
|
|
44
|
+
/** Controlled pressed state (aria-pressed). */ pressed?: boolean;
|
|
45
|
+
/** Initial pressed state when uncontrolled. Default false. */ defaultPressed?: boolean;
|
|
46
|
+
/** Called with the next pressed state on every click. */ onPressedChange?: (pressed: boolean) => void;
|
|
47
|
+
}
|
|
48
|
+
/** On/off button (aria-pressed). Controlled with pressed, or uncontrolled with defaultPressed. */
|
|
49
|
+
export declare const ULToggleButton: React.ForwardRefExoticComponent<ULToggleButtonProps & React.RefAttributes<HTMLElement>>;
|
|
50
|
+
export interface ULButtonGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
51
|
+
/** Required: what the group is for. */
|
|
52
|
+
'aria-label'?: string;
|
|
53
|
+
/** One glass capsule with flattened buttons inside (default), or separate buttons with a gap. */
|
|
54
|
+
attached?: boolean;
|
|
55
|
+
/** "horizontal" (default) | "vertical". Buttons inside use the vertical-only hit layer. */ orientation?: 'horizontal' | 'vertical';
|
|
56
|
+
/** Backdrop hint for the glass ("dark" | "mid" | "light"), passed to every button. */ backdrop?: Backdrop;
|
|
57
|
+
}
|
|
58
|
+
/** Related actions. Attached groups are ONE glass layer; the buttons inside are flattened (they never sample glass). */
|
|
59
|
+
export declare function ULButtonGroup({ attached, orientation, backdrop, className, children, ...rest }: ULButtonGroupProps): React.JSX.Element;
|
|
60
|
+
export interface SplitItem {
|
|
61
|
+
label: string;
|
|
62
|
+
onSelect?: () => void;
|
|
63
|
+
icon?: React.ReactNode;
|
|
64
|
+
disabled?: boolean;
|
|
65
|
+
destructive?: boolean;
|
|
66
|
+
}
|
|
67
|
+
export interface ULSplitButtonProps extends Omit<ULButtonProps, 'icon' | 'iconEnd' | 'shape' | 'pressed' | 'onPressedChange' | 'href'> {
|
|
68
|
+
/** Menu items of the secondary part (ULMenu items, opened from the chevron). */ items: SplitItem[];
|
|
69
|
+
/** aria-label of the menu trigger. Default "More options". */
|
|
70
|
+
menuLabel?: string;
|
|
71
|
+
/** Render the menu at the page root (works inside transformed ancestors). Default true. */
|
|
72
|
+
portal?: boolean;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Main action + a menu of related actions. The menu is a ULAnchoredSurface:
|
|
76
|
+
* it pours out from behind the trigger with the shared anchored morph.
|
|
77
|
+
* Keys: ArrowDown / Enter / Space on the trigger opens and focuses the first item; ArrowUp/Down, Home/End move; Escape closes.
|
|
78
|
+
*/
|
|
79
|
+
export declare function ULSplitButton({ items, menuLabel, portal, variant, size, disabled, loading, children, className, style, accent, backdrop, ...rest }: ULSplitButtonProps): React.JSX.Element;
|
|
80
|
+
export interface ULFabProps extends Omit<ULButtonProps, 'size' | 'shape'> {
|
|
81
|
+
/** Extended FAB: a label next to the icon. Without it the FAB is icon-only (aria-label required). */
|
|
82
|
+
label?: string;
|
|
83
|
+
/** Fixed placement with safe-area insets, or 'none' to place it yourself. Default 'none'. */
|
|
84
|
+
placement?: 'none' | 'bottom-end' | 'bottom-start' | 'bottom-center';
|
|
85
|
+
}
|
|
86
|
+
/** Floating action button: 56px, vivid accent glass, elastic. */
|
|
87
|
+
export declare const ULFab: React.ForwardRefExoticComponent<ULFabProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type Accent, type AccentStrength, type Backdrop } from '../../glass/accent.js';
|
|
3
|
+
import './ULContainers.css';
|
|
4
|
+
import { type ContextMenuProps } from './contextTarget.js';
|
|
5
|
+
type Size = 'sm' | 'md' | 'lg';
|
|
6
|
+
type ForceState = 'hover' | 'focus' | 'pressed';
|
|
7
|
+
export interface ULCardProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title'> {
|
|
8
|
+
size?: Size;
|
|
9
|
+
title?: React.ReactNode;
|
|
10
|
+
description?: React.ReactNode;
|
|
11
|
+
/** Top-right of the header (badges, a menu button). */
|
|
12
|
+
actions?: React.ReactNode;
|
|
13
|
+
/** Media above the header (image slot, chart). */
|
|
14
|
+
media?: React.ReactNode;
|
|
15
|
+
footer?: React.ReactNode;
|
|
16
|
+
/** Makes the card interactive: the title becomes this link; the whole card is its hit area. */
|
|
17
|
+
href?: string;
|
|
18
|
+
/** Makes the card interactive: the title becomes a button. */
|
|
19
|
+
onPress?: () => void;
|
|
20
|
+
/** aria-current / selected look for picker cards. */
|
|
21
|
+
selected?: boolean;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
loading?: boolean;
|
|
24
|
+
error?: React.ReactNode;
|
|
25
|
+
accent?: Accent;
|
|
26
|
+
accentStrength?: AccentStrength;
|
|
27
|
+
backdrop?: Backdrop;
|
|
28
|
+
/** Heading level of the title. Default 3. */
|
|
29
|
+
level?: 2 | 3 | 4;
|
|
30
|
+
/** @internal showcase */
|
|
31
|
+
forceState?: ForceState;
|
|
32
|
+
children?: React.ReactNode;
|
|
33
|
+
}
|
|
34
|
+
/** Card. contextMenu target: { component: 'card', kind: 'self', id }. */
|
|
35
|
+
export declare function ULCard(props: ULCardProps & ContextMenuProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
36
|
+
export interface ULPanelProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title'> {
|
|
37
|
+
/** glass (lg, default) | calm (flat graphite, never refracts: data, tables, charts) | well (inset). */
|
|
38
|
+
surface?: 'glass' | 'calm' | 'well';
|
|
39
|
+
size?: Size;
|
|
40
|
+
title?: React.ReactNode;
|
|
41
|
+
description?: React.ReactNode;
|
|
42
|
+
actions?: React.ReactNode;
|
|
43
|
+
footer?: React.ReactNode;
|
|
44
|
+
as?: React.ElementType;
|
|
45
|
+
level?: 2 | 3 | 4;
|
|
46
|
+
accent?: Accent;
|
|
47
|
+
accentStrength?: AccentStrength;
|
|
48
|
+
backdrop?: Backdrop;
|
|
49
|
+
loading?: boolean;
|
|
50
|
+
children?: React.ReactNode;
|
|
51
|
+
}
|
|
52
|
+
/** Panel. contextMenu target: { component: 'panel', kind: 'self', id }. */
|
|
53
|
+
export declare function ULPanel(props: ULPanelProps & ContextMenuProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
54
|
+
export {};
|