@refraction-ui/react 0.12.3 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4285 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +4238 -11
- package/dist/index.js.map +1 -1
- package/dist/internal/audio-room/index.d.ts +91 -0
- package/dist/internal/call-controls/index.d.ts +83 -0
- package/dist/internal/checklist/index.d.ts +84 -0
- package/dist/internal/editor-status-bar/index.d.ts +70 -0
- package/dist/internal/editor-tabs/index.d.ts +68 -0
- package/dist/internal/empty-state/index.d.cts +39 -0
- package/dist/internal/empty-state/index.d.ts +39 -0
- package/dist/internal/floating-reactions/index.d.ts +98 -0
- package/dist/internal/flow-editor/index.d.ts +91 -0
- package/dist/internal/graph-view/index.d.ts +107 -0
- package/dist/internal/infinite-canvas/index.d.ts +74 -0
- package/dist/internal/input/index.d.cts +19 -1
- package/dist/internal/input/index.d.ts +19 -1
- package/dist/internal/live-captions/index.d.ts +59 -0
- package/dist/internal/live-cursors/index.d.ts +65 -0
- package/dist/internal/live-transcript/index.d.ts +73 -0
- package/dist/internal/mini-map/index.d.ts +81 -0
- package/dist/internal/pre-call-lobby/index.d.ts +97 -0
- package/dist/internal/radial-gauge/index.d.ts +120 -0
- package/dist/internal/rating-scale/index.d.ts +76 -0
- package/dist/internal/react-audio-room/index.d.ts +39 -0
- package/dist/internal/react-call-controls/index.d.ts +44 -0
- package/dist/internal/react-checklist/index.d.ts +27 -0
- package/dist/internal/react-editor-status-bar/index.d.ts +43 -0
- package/dist/internal/react-editor-tabs/index.d.ts +25 -0
- package/dist/internal/react-empty-state/index.d.cts +36 -0
- package/dist/internal/react-empty-state/index.d.ts +36 -0
- package/dist/internal/react-floating-reactions/index.d.ts +65 -0
- package/dist/internal/react-flow-editor/index.d.ts +35 -0
- package/dist/internal/react-graph-view/index.d.ts +25 -0
- package/dist/internal/react-infinite-canvas/index.d.ts +40 -0
- package/dist/internal/react-input/index.d.cts +16 -0
- package/dist/internal/react-input/index.d.ts +16 -0
- package/dist/internal/react-live-captions/index.d.ts +29 -0
- package/dist/internal/react-live-cursors/index.d.ts +42 -0
- package/dist/internal/react-live-transcript/index.d.ts +22 -0
- package/dist/internal/react-mini-map/index.d.ts +35 -0
- package/dist/internal/react-password-input/index.d.cts +26 -0
- package/dist/internal/react-password-input/index.d.ts +26 -0
- package/dist/internal/react-pre-call-lobby/index.d.ts +47 -0
- package/dist/internal/react-radial-gauge/index.d.ts +43 -0
- package/dist/internal/react-rating-scale/index.d.ts +38 -0
- package/dist/internal/react-segmented-control/index.d.cts +38 -0
- package/dist/internal/react-segmented-control/index.d.ts +38 -0
- package/dist/internal/react-separator/index.d.cts +29 -0
- package/dist/internal/react-separator/index.d.ts +29 -0
- package/dist/internal/react-social-auth-button/index.d.cts +31 -0
- package/dist/internal/react-social-auth-button/index.d.ts +31 -0
- package/dist/internal/react-sticky-note/index.d.ts +39 -0
- package/dist/internal/react-terminal/index.d.ts +39 -0
- package/dist/internal/react-test-results/index.d.ts +21 -0
- package/dist/internal/react-timeline/index.d.ts +35 -0
- package/dist/internal/react-video-grid/index.d.ts +33 -0
- package/dist/internal/react-video-tile/index.d.ts +41 -0
- package/dist/internal/react-wizard/index.d.ts +59 -0
- package/dist/internal/segmented-control/index.d.cts +56 -0
- package/dist/internal/segmented-control/index.d.ts +56 -0
- package/dist/internal/separator/index.d.cts +55 -0
- package/dist/internal/separator/index.d.ts +55 -0
- package/dist/internal/social-auth-button/index.d.cts +47 -0
- package/dist/internal/social-auth-button/index.d.ts +47 -0
- package/dist/internal/sticky-note/index.d.ts +49 -0
- package/dist/internal/terminal/index.d.ts +65 -0
- package/dist/internal/test-results/index.d.ts +97 -0
- package/dist/internal/timeline/index.d.ts +111 -0
- package/dist/internal/video-grid/index.d.ts +83 -0
- package/dist/internal/video-tile/index.d.ts +88 -0
- package/dist/internal/wizard/index.d.ts +148 -0
- package/package.json +48 -20
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/** The visual size of the gauge. */
|
|
2
|
+
type GaugeSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
/** Tone mapped to a zone range. */
|
|
4
|
+
type GaugeTone = 'default' | 'success' | 'warning' | 'danger';
|
|
5
|
+
/**
|
|
6
|
+
* A threshold zone that applies a semantic tone when the gauge value falls
|
|
7
|
+
* at or below `upTo`. Zones should be listed in ascending `upTo` order; the
|
|
8
|
+
* first zone whose `upTo >= value` wins.
|
|
9
|
+
*/
|
|
10
|
+
interface GaugeZone {
|
|
11
|
+
/** Value up to (and including) which this zone applies. */
|
|
12
|
+
upTo: number;
|
|
13
|
+
/** Semantic tone for the arc while the value is in this zone. */
|
|
14
|
+
tone: GaugeTone;
|
|
15
|
+
}
|
|
16
|
+
interface RadialGaugeProps {
|
|
17
|
+
/** Current gauge value. */
|
|
18
|
+
value: number;
|
|
19
|
+
/** Minimum possible value. */
|
|
20
|
+
min?: number;
|
|
21
|
+
/** Maximum possible value. */
|
|
22
|
+
max?: number;
|
|
23
|
+
/** Visual size. */
|
|
24
|
+
size?: GaugeSize;
|
|
25
|
+
}
|
|
26
|
+
interface RadialGaugeAPI {
|
|
27
|
+
/** ARIA attributes to spread on the SVG element (`role="meter"`). */
|
|
28
|
+
ariaProps: Record<string, string | number>;
|
|
29
|
+
/** Data attributes for styling hooks. */
|
|
30
|
+
dataAttributes: Record<string, string>;
|
|
31
|
+
}
|
|
32
|
+
declare const GAUGE_SIZE_PX: Record<GaugeSize, number>;
|
|
33
|
+
/**
|
|
34
|
+
* Clamp `value` to the inclusive range `[min, max]`.
|
|
35
|
+
*/
|
|
36
|
+
declare function clampValue(value: number, min: number, max: number): number;
|
|
37
|
+
/**
|
|
38
|
+
* Map a `value` within `[min, max]` to a fraction in `[0, 1]`.
|
|
39
|
+
* Returns 0 when `min === max` to avoid division by zero.
|
|
40
|
+
*/
|
|
41
|
+
declare function valueToFraction(value: number, min: number, max: number): number;
|
|
42
|
+
/**
|
|
43
|
+
* Convert polar coordinates to Cartesian.
|
|
44
|
+
* `angleDeg` is measured clockwise from the positive x-axis (SVG convention).
|
|
45
|
+
*/
|
|
46
|
+
declare function polarToCartesian(cx: number, cy: number, r: number, angleDeg: number): {
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Build an SVG arc path `d` string from `startAngleDeg` to `endAngleDeg`
|
|
52
|
+
* (both measured clockwise from the top / 12-o'clock position).
|
|
53
|
+
*
|
|
54
|
+
* Returns an empty string when the arc span is zero.
|
|
55
|
+
*/
|
|
56
|
+
declare function describeArc(cx: number, cy: number, r: number, startAngleDeg: number, endAngleDeg: number): string;
|
|
57
|
+
/**
|
|
58
|
+
* Compute the `stroke-dashoffset` for a full-circle ring gauge.
|
|
59
|
+
*
|
|
60
|
+
* With `stroke-dasharray="circumference circumference"` and this offset, the
|
|
61
|
+
* visible portion of the stroke equals `fraction × circumference`.
|
|
62
|
+
*/
|
|
63
|
+
declare function gaugeStrokeDashoffset(fraction: number, circumference: number): number;
|
|
64
|
+
/**
|
|
65
|
+
* Find the active zone tone for the current `value`.
|
|
66
|
+
* Zones are tested in ascending `upTo` order; the first zone whose
|
|
67
|
+
* `upTo >= value` wins. Falls back to `'default'` when no zone matches.
|
|
68
|
+
*/
|
|
69
|
+
declare function resolveZoneTone(value: number, zones: GaugeZone[], _max: number): GaugeTone;
|
|
70
|
+
/**
|
|
71
|
+
* Build the framework-agnostic props for a radial gauge element.
|
|
72
|
+
*
|
|
73
|
+
* Returns `role="meter"` plus ARIA value attributes and data attributes;
|
|
74
|
+
* adapters spread these onto their `<svg>` element.
|
|
75
|
+
*/
|
|
76
|
+
declare function createRadialGauge(props: RadialGaugeProps): RadialGaugeAPI;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Root SVG element variants — controls the rendered size via an inline
|
|
80
|
+
* width/height (adapters use GAUGE_SIZE_PX) and sets up the color context.
|
|
81
|
+
*/
|
|
82
|
+
declare const radialGaugeRootVariants: (props?: ({
|
|
83
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
84
|
+
} & {
|
|
85
|
+
className?: string;
|
|
86
|
+
}) | undefined) => string;
|
|
87
|
+
/**
|
|
88
|
+
* Track (background) circle stroke class.
|
|
89
|
+
* Uses a muted foreground so it sits behind the value arc without competing.
|
|
90
|
+
*/
|
|
91
|
+
declare const gaugeTrackClass = "fill-none stroke-muted-foreground/20";
|
|
92
|
+
/**
|
|
93
|
+
* Value arc stroke class — resolved per tone via {@link gaugeArcToneVariants}.
|
|
94
|
+
* `currentColor` stroke picks up the Tailwind text-* class applied by the
|
|
95
|
+
* tone variant so we only need one class-generating helper.
|
|
96
|
+
*/
|
|
97
|
+
declare const gaugeArcClass = "fill-none stroke-current transition-[stroke-dashoffset] duration-300 ease-out";
|
|
98
|
+
/**
|
|
99
|
+
* Tone variants for the value arc. Adapters combine this with `gaugeArcClass`.
|
|
100
|
+
*/
|
|
101
|
+
declare const gaugeArcToneVariants: (props?: ({
|
|
102
|
+
tone?: "default" | "success" | "warning" | "danger" | undefined;
|
|
103
|
+
} & {
|
|
104
|
+
className?: string;
|
|
105
|
+
}) | undefined) => string;
|
|
106
|
+
/** Center label (primary text) classes. */
|
|
107
|
+
declare const gaugeLabelClass = "fill-foreground text-center font-semibold";
|
|
108
|
+
/** Center sub-label (secondary text) classes. */
|
|
109
|
+
declare const gaugeSublabelClass = "fill-muted-foreground";
|
|
110
|
+
/**
|
|
111
|
+
* Font size for the primary label by size variant.
|
|
112
|
+
* Expressed as SVG `font-size` values (px) for use in the `<text>` element.
|
|
113
|
+
*/
|
|
114
|
+
declare const GAUGE_LABEL_FONT_SIZE: Record<'sm' | 'md' | 'lg', number>;
|
|
115
|
+
/**
|
|
116
|
+
* Font size for the sub-label by size variant.
|
|
117
|
+
*/
|
|
118
|
+
declare const GAUGE_SUBLABEL_FONT_SIZE: Record<'sm' | 'md' | 'lg', number>;
|
|
119
|
+
|
|
120
|
+
export { GAUGE_LABEL_FONT_SIZE, GAUGE_SIZE_PX, GAUGE_SUBLABEL_FONT_SIZE, type GaugeSize, type GaugeTone, type GaugeZone, type RadialGaugeAPI, type RadialGaugeProps, clampValue, createRadialGauge, describeArc, gaugeArcClass, gaugeArcToneVariants, gaugeLabelClass, gaugeStrokeDashoffset, gaugeSublabelClass, gaugeTrackClass, polarToCartesian, radialGaugeRootVariants, resolveZoneTone, valueToFraction };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { AccessibilityProps } from '../shared/index.js';
|
|
2
|
+
|
|
3
|
+
/** Visual size of a rating scale. */
|
|
4
|
+
type RatingScaleSize = 'sm' | 'md';
|
|
5
|
+
/** A single selectable point on the scale (1-indexed value + accessible label). */
|
|
6
|
+
interface RatingScalePoint {
|
|
7
|
+
/** The value this point represents. */
|
|
8
|
+
value: number;
|
|
9
|
+
/** Accessible label for the point (falls back to the value). */
|
|
10
|
+
label?: string;
|
|
11
|
+
}
|
|
12
|
+
interface RatingScaleProps {
|
|
13
|
+
/** Currently selected value (controlled). */
|
|
14
|
+
value?: number;
|
|
15
|
+
/** Number of points on the scale. Ignored when {@link points} is given. */
|
|
16
|
+
count?: number;
|
|
17
|
+
/** Visual size. */
|
|
18
|
+
size?: RatingScaleSize;
|
|
19
|
+
}
|
|
20
|
+
interface RatingScaleAPI {
|
|
21
|
+
/** ARIA attributes to spread on the group element (`role="radiogroup"`). */
|
|
22
|
+
ariaProps: Partial<AccessibilityProps>;
|
|
23
|
+
/** Data attributes for styling hooks. */
|
|
24
|
+
dataAttributes: Record<string, string>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Build the framework-agnostic group props for a rating / Likert scale.
|
|
28
|
+
*
|
|
29
|
+
* Returns `role="radiogroup"` plus data attributes; adapters spread these onto
|
|
30
|
+
* their container and render the points themselves. A rating scale is a
|
|
31
|
+
* single-select control with radio semantics, like a segmented control, but
|
|
32
|
+
* tuned for ordinal self-rating (e.g. a 1–5 Likert prompt with end labels).
|
|
33
|
+
*/
|
|
34
|
+
declare function createRatingScale(props?: RatingScaleProps): RatingScaleAPI;
|
|
35
|
+
/**
|
|
36
|
+
* Resolve the list of points for a scale from either an explicit list or a
|
|
37
|
+
* `count` (producing `1..count`). The single source of truth shared by every
|
|
38
|
+
* adapter so a `count={5}` scale renders identical points everywhere.
|
|
39
|
+
*/
|
|
40
|
+
declare function resolveRatingPoints(points: RatingScalePoint[] | undefined, count?: number): RatingScalePoint[];
|
|
41
|
+
/**
|
|
42
|
+
* Pure keyboard-navigation rule shared by every adapter.
|
|
43
|
+
*
|
|
44
|
+
* Unlike a wrapping segmented control, an ordinal rating scale **clamps** at
|
|
45
|
+
* the ends (you can't wrap from "5 — strongly agree" back to "1"). Home/End
|
|
46
|
+
* jump to the extremes; unhandled keys return `current` unchanged.
|
|
47
|
+
*
|
|
48
|
+
* - ArrowRight / ArrowUp → next (clamped to last)
|
|
49
|
+
* - ArrowLeft / ArrowDown → previous (clamped to first)
|
|
50
|
+
* - Home → first
|
|
51
|
+
* - End → last
|
|
52
|
+
*/
|
|
53
|
+
declare function getNextRatingIndex(current: number, key: string, count: number): number;
|
|
54
|
+
|
|
55
|
+
/** Container row that holds the points plus optional end labels. */
|
|
56
|
+
declare const ratingScaleVariants: (props?: ({
|
|
57
|
+
size?: "sm" | "md" | undefined;
|
|
58
|
+
} & {
|
|
59
|
+
className?: string;
|
|
60
|
+
}) | undefined) => string;
|
|
61
|
+
/** Row of point buttons (the scale itself, between the end labels). */
|
|
62
|
+
declare const ratingScaleTrackClass = "inline-flex items-center gap-1.5";
|
|
63
|
+
/**
|
|
64
|
+
* A single point button. The `state` variant carries the selected vs unselected
|
|
65
|
+
* treatment so adapters never inline these classes.
|
|
66
|
+
*/
|
|
67
|
+
declare const ratingScaleItemVariants: (props?: ({
|
|
68
|
+
size?: "sm" | "md" | undefined;
|
|
69
|
+
state?: "checked" | "unchecked" | undefined;
|
|
70
|
+
} & {
|
|
71
|
+
className?: string;
|
|
72
|
+
}) | undefined) => string;
|
|
73
|
+
/** End-label text flanking the scale (e.g. "Never seen this" / "Could write it"). */
|
|
74
|
+
declare const ratingScaleLabelClass = "text-xs text-muted-foreground";
|
|
75
|
+
|
|
76
|
+
export { type RatingScaleAPI, type RatingScalePoint, type RatingScaleProps, type RatingScaleSize, createRatingScale, getNextRatingIndex, ratingScaleItemVariants, ratingScaleLabelClass, ratingScaleTrackClass, ratingScaleVariants, resolveRatingPoints };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { AudioParticipant } from '../audio-room/index.js';
|
|
3
|
+
export { AudioParticipant } from '../audio-room/index.js';
|
|
4
|
+
|
|
5
|
+
interface SpeakingOrbProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color' | 'content'> {
|
|
6
|
+
/** Participant display name; used for initials and aria-label. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Optional avatar image URL. Falls back to initials when absent. */
|
|
9
|
+
avatarUrl?: string;
|
|
10
|
+
/** Whether this participant is actively speaking. */
|
|
11
|
+
speaking?: boolean;
|
|
12
|
+
/** Whether this participant is muted. */
|
|
13
|
+
muted?: boolean;
|
|
14
|
+
/** Whether this participant has raised their hand. */
|
|
15
|
+
handRaised?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* SpeakingOrb — a circular avatar for one audio-room participant.
|
|
19
|
+
*
|
|
20
|
+
* Renders an avatar image (or initials fallback), an animated speaking ring
|
|
21
|
+
* when `speaking` is true, a mic-muted badge when `muted` is true, and an
|
|
22
|
+
* optional raised-hand badge. Fully accessible with `role="img"` and an
|
|
23
|
+
* `aria-label` set to the participant's name.
|
|
24
|
+
*/
|
|
25
|
+
declare const SpeakingOrb: React.ForwardRefExoticComponent<SpeakingOrbProps & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
interface AudioRoomProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color' | 'content'> {
|
|
27
|
+
/** List of participants to render as speaking orbs. */
|
|
28
|
+
participants: AudioParticipant[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* AudioRoom — a responsive grid of SpeakingOrbs for an audio-only meeting.
|
|
32
|
+
*
|
|
33
|
+
* Column count is derived from `orbColumns(n)` so the layout adapts
|
|
34
|
+
* automatically as participants join or leave. The grid uses inline
|
|
35
|
+
* `gridTemplateColumns` because the column count is dynamic.
|
|
36
|
+
*/
|
|
37
|
+
declare const AudioRoom: React.ForwardRefExoticComponent<AudioRoomProps & React.RefAttributes<HTMLDivElement>>;
|
|
38
|
+
|
|
39
|
+
export { AudioRoom, type AudioRoomProps, SpeakingOrb, type SpeakingOrbProps };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CallControlTone } from '../call-controls/index.js';
|
|
3
|
+
export { CallControlItem, CallControlTone } from '../call-controls/index.js';
|
|
4
|
+
|
|
5
|
+
interface CallControlButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'content'> {
|
|
6
|
+
/** Accessible label (used as aria-label and visible to screen readers). */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Optional icon node rendered inside the button. */
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
/** Visual/semantic tone of the button. */
|
|
11
|
+
tone?: CallControlTone;
|
|
12
|
+
/**
|
|
13
|
+
* Whether this control is currently in a "pressed" / toggled-on state.
|
|
14
|
+
* When provided, the button gains `aria-pressed`.
|
|
15
|
+
*/
|
|
16
|
+
pressed?: boolean;
|
|
17
|
+
/** Visual size of the button. */
|
|
18
|
+
size?: 'sm' | 'md';
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A single round meeting-control button with icon, accessible label,
|
|
22
|
+
* tone variants (default / active / destructive), and optional aria-pressed
|
|
23
|
+
* for toggleable controls (mic, camera, screen-share).
|
|
24
|
+
*/
|
|
25
|
+
declare const CallControlButton: React.ForwardRefExoticComponent<CallControlButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
26
|
+
interface CallControlsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color' | 'content'> {
|
|
27
|
+
/** Visual size passed down to child buttons when using the composable API. */
|
|
28
|
+
size?: 'sm' | 'md';
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Toolbar wrapper for a set of meeting-control buttons.
|
|
32
|
+
*
|
|
33
|
+
* Composable: render `<CallControlButton>` children directly.
|
|
34
|
+
*
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <CallControls>
|
|
37
|
+
* <CallControlButton label="Mute" icon={<MicIcon />} tone="active" pressed={true} />
|
|
38
|
+
* <CallControlButton label="Leave" tone="destructive" />
|
|
39
|
+
* </CallControls>
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare const CallControls: React.ForwardRefExoticComponent<CallControlsProps & React.RefAttributes<HTMLDivElement>>;
|
|
43
|
+
|
|
44
|
+
export { CallControlButton, type CallControlButtonProps, CallControls, type CallControlsProps };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ChecklistItemData } from '../checklist/index.js';
|
|
3
|
+
export { ChecklistItemData } from '../checklist/index.js';
|
|
4
|
+
|
|
5
|
+
interface ChecklistProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
6
|
+
/** Controlled list of items. */
|
|
7
|
+
items?: ChecklistItemData[];
|
|
8
|
+
/** Initial items for uncontrolled usage. */
|
|
9
|
+
defaultItems?: ChecklistItemData[];
|
|
10
|
+
/** Called when an item is toggled, with the updated items array. */
|
|
11
|
+
onChange?: (items: ChecklistItemData[]) => void;
|
|
12
|
+
/** Called with the id of the item that was toggled. */
|
|
13
|
+
onItemToggle?: (id: string) => void;
|
|
14
|
+
/** Show a "{completed}/{total}" progress summary below the list. */
|
|
15
|
+
showProgress?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Checklist — an interactive task list with optional progress summary.
|
|
19
|
+
*
|
|
20
|
+
* Supports controlled (`items`) and uncontrolled (`defaultItems`) usage.
|
|
21
|
+
* Each item renders as a `role="checkbox"` button; clicking toggles its
|
|
22
|
+
* checked state. Completed items receive muted + strikethrough styling.
|
|
23
|
+
* Logic and styles come from the headless `@refraction-ui/checklist` core.
|
|
24
|
+
*/
|
|
25
|
+
declare const Checklist: React.ForwardRefExoticComponent<ChecklistProps & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
|
|
27
|
+
export { Checklist, type ChecklistProps };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StatusSegment } from '../editor-status-bar/index.js';
|
|
3
|
+
export { StatusSegment, StatusSegmentTone } from '../editor-status-bar/index.js';
|
|
4
|
+
|
|
5
|
+
/** Convenience props that map to common IDE status-bar segments. */
|
|
6
|
+
interface EditorStatusBarConvenienceProps {
|
|
7
|
+
/** Current line number (1-indexed). */
|
|
8
|
+
line?: number;
|
|
9
|
+
/** Current column number (1-indexed). */
|
|
10
|
+
col?: number;
|
|
11
|
+
/** Indentation descriptor, e.g. `'Spaces: 4'` or `'Tab Size: 2'`. */
|
|
12
|
+
indentation?: string;
|
|
13
|
+
/** Language / runtime label, e.g. `'Python 3.11.4'`. */
|
|
14
|
+
language?: string;
|
|
15
|
+
/** File encoding, e.g. `'UTF-8'`. */
|
|
16
|
+
encoding?: string;
|
|
17
|
+
/** End-of-line sequence, e.g. `'LF'` or `'CRLF'`. */
|
|
18
|
+
eol?: string;
|
|
19
|
+
/** Persistence status label, e.g. `'Auto-saved'` or `'Unsaved changes'`. */
|
|
20
|
+
status?: string;
|
|
21
|
+
}
|
|
22
|
+
interface EditorStatusBarProps extends React.HTMLAttributes<HTMLDivElement>, EditorStatusBarConvenienceProps {
|
|
23
|
+
/**
|
|
24
|
+
* Explicit list of segments. When provided, the convenience props (`line`,
|
|
25
|
+
* `col`, `language`, etc.) are ignored and you have full control over which
|
|
26
|
+
* segments appear and where.
|
|
27
|
+
*/
|
|
28
|
+
segments?: StatusSegment[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* EditorStatusBar — an IDE-style bottom bar.
|
|
32
|
+
*
|
|
33
|
+
* Accepts either an explicit `segments` array for full control, or the
|
|
34
|
+
* convenience props (`line`, `col`, `language`, `encoding`, `indentation`,
|
|
35
|
+
* `eol`, `status`) which are assembled into a standard left/right layout
|
|
36
|
+
* automatically.
|
|
37
|
+
*
|
|
38
|
+
* Uses `role="status"` with `aria-live="polite"` so cursor-position updates
|
|
39
|
+
* are announced to screen readers without interrupting flow.
|
|
40
|
+
*/
|
|
41
|
+
declare const EditorStatusBar: React.ForwardRefExoticComponent<EditorStatusBarProps & React.RefAttributes<HTMLDivElement>>;
|
|
42
|
+
|
|
43
|
+
export { EditorStatusBar, type EditorStatusBarConvenienceProps, type EditorStatusBarProps };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { EditorTabData } from '../editor-tabs/index.js';
|
|
3
|
+
export { EditorTabData } from '../editor-tabs/index.js';
|
|
4
|
+
|
|
5
|
+
interface EditorTabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
6
|
+
/** The list of tab entries to render. */
|
|
7
|
+
tabs: EditorTabData[];
|
|
8
|
+
/** The id of the currently active tab (controlled). */
|
|
9
|
+
activeId: string;
|
|
10
|
+
/** Called when the user clicks or navigates to a tab. */
|
|
11
|
+
onSelect: (id: string) => void;
|
|
12
|
+
/** Called when the user clicks the close button on a tab. */
|
|
13
|
+
onClose?: (id: string) => void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* EditorTabs — an IDE-style open-file tab bar.
|
|
17
|
+
*
|
|
18
|
+
* Renders `role="tablist"`; each tab is `role="tab"` with `aria-selected`.
|
|
19
|
+
* Supports optional icons, dirty-state dots, and close buttons. Keyboard
|
|
20
|
+
* navigation uses wrapping roving tabindex (ArrowLeft/Right, Home/End) via the
|
|
21
|
+
* headless `@refraction-ui/editor-tabs` core helper.
|
|
22
|
+
*/
|
|
23
|
+
declare const EditorTabs: React.ForwardRefExoticComponent<EditorTabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
|
|
25
|
+
export { EditorTabs, type EditorTabsProps };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { EmptyStateTone } from '../empty-state/index.cjs';
|
|
3
|
+
export { EmptyStateTone } from '../empty-state/index.cjs';
|
|
4
|
+
|
|
5
|
+
interface EmptyStateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
6
|
+
/** Optional icon rendered inside a tone-tinted rounded chip. */
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
/** Tone that tints the icon chip. Defaults to `neutral`. */
|
|
9
|
+
tone?: EmptyStateTone;
|
|
10
|
+
/** Primary heading. */
|
|
11
|
+
title: React.ReactNode;
|
|
12
|
+
/** Optional supporting copy (supports rich children). */
|
|
13
|
+
description?: React.ReactNode;
|
|
14
|
+
/** Optional action row (e.g. buttons), centered under the description. */
|
|
15
|
+
actions?: React.ReactNode;
|
|
16
|
+
/** Wrap the content in a bordered card surface. */
|
|
17
|
+
bordered?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* EmptyState — a centered column for empty/zero/result states and inline
|
|
21
|
+
* confirmations. The icon chip is tinted via `tone`; pass `bordered` to render
|
|
22
|
+
* it on a card surface.
|
|
23
|
+
*
|
|
24
|
+
* Styling and tone resolution come from the headless @refraction-ui/empty-state
|
|
25
|
+
* core (no inline class literals here).
|
|
26
|
+
*/
|
|
27
|
+
declare const EmptyState: React.ForwardRefExoticComponent<EmptyStateProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
interface ConfirmationCardProps extends EmptyStateProps {
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* ConfirmationCard — a thin preset of {@link EmptyState} with `bordered`
|
|
32
|
+
* defaulting to `true`, for inline confirmation states (e.g. "Check your email").
|
|
33
|
+
*/
|
|
34
|
+
declare const ConfirmationCard: React.ForwardRefExoticComponent<ConfirmationCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
|
|
36
|
+
export { ConfirmationCard, type ConfirmationCardProps, EmptyState, type EmptyStateProps };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { EmptyStateTone } from '../empty-state/index.js';
|
|
3
|
+
export { EmptyStateTone } from '../empty-state/index.js';
|
|
4
|
+
|
|
5
|
+
interface EmptyStateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
6
|
+
/** Optional icon rendered inside a tone-tinted rounded chip. */
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
/** Tone that tints the icon chip. Defaults to `neutral`. */
|
|
9
|
+
tone?: EmptyStateTone;
|
|
10
|
+
/** Primary heading. */
|
|
11
|
+
title: React.ReactNode;
|
|
12
|
+
/** Optional supporting copy (supports rich children). */
|
|
13
|
+
description?: React.ReactNode;
|
|
14
|
+
/** Optional action row (e.g. buttons), centered under the description. */
|
|
15
|
+
actions?: React.ReactNode;
|
|
16
|
+
/** Wrap the content in a bordered card surface. */
|
|
17
|
+
bordered?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* EmptyState — a centered column for empty/zero/result states and inline
|
|
21
|
+
* confirmations. The icon chip is tinted via `tone`; pass `bordered` to render
|
|
22
|
+
* it on a card surface.
|
|
23
|
+
*
|
|
24
|
+
* Styling and tone resolution come from the headless @refraction-ui/empty-state
|
|
25
|
+
* core (no inline class literals here).
|
|
26
|
+
*/
|
|
27
|
+
declare const EmptyState: React.ForwardRefExoticComponent<EmptyStateProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
interface ConfirmationCardProps extends EmptyStateProps {
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* ConfirmationCard — a thin preset of {@link EmptyState} with `bordered`
|
|
32
|
+
* defaulting to `true`, for inline confirmation states (e.g. "Check your email").
|
|
33
|
+
*/
|
|
34
|
+
declare const ConfirmationCard: React.ForwardRefExoticComponent<ConfirmationCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
|
|
36
|
+
export { ConfirmationCard, type ConfirmationCardProps, EmptyState, type EmptyStateProps };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { FloatingReaction } from '../floating-reactions/index.js';
|
|
4
|
+
export { FloatingReaction } from '../floating-reactions/index.js';
|
|
5
|
+
|
|
6
|
+
interface FloatingReactionsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color' | 'content'> {
|
|
7
|
+
/**
|
|
8
|
+
* Controlled list of reactions currently visible in the overlay. The parent
|
|
9
|
+
* is responsible for adding items and removing them after REACTION_LIFETIME_MS
|
|
10
|
+
* (or use the useFloatingReactions hook which handles this automatically).
|
|
11
|
+
*/
|
|
12
|
+
reactions: FloatingReaction[];
|
|
13
|
+
/**
|
|
14
|
+
* Total number of horizontal lane buckets used to spread reactions.
|
|
15
|
+
* @default 5
|
|
16
|
+
*/
|
|
17
|
+
lanes?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* FloatingReactions — a controlled overlay that renders transient emoji
|
|
21
|
+
* reactions floating upward. Intended to be positioned absolutely over a
|
|
22
|
+
* meeting/video surface.
|
|
23
|
+
*
|
|
24
|
+
* - Reactions animate upward and fade via `animate-[float-up_3s_ease-out_forwards]`.
|
|
25
|
+
* Consumers must supply the `@keyframes float-up` rule (see
|
|
26
|
+
* `floatingReactionItemClass` in the core styles for the recommended keyframe).
|
|
27
|
+
* - The overlay is `pointer-events-none` so it never blocks interaction.
|
|
28
|
+
* - role="status" aria-live="polite" announces new reactions to screen readers.
|
|
29
|
+
*/
|
|
30
|
+
declare const FloatingReactions: React.ForwardRefExoticComponent<FloatingReactionsProps & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
+
interface ReactionBurstProps {
|
|
32
|
+
emoji: string;
|
|
33
|
+
lane?: number;
|
|
34
|
+
lanes?: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* ReactionBurst renders a single emoji at the specified lane offset — useful
|
|
38
|
+
* for static demos or Storybook stories showing a specific burst position.
|
|
39
|
+
*/
|
|
40
|
+
declare function ReactionBurst({ emoji, lane, lanes }: ReactionBurstProps): react_jsx_runtime.JSX.Element;
|
|
41
|
+
interface UseFloatingReactionsResult {
|
|
42
|
+
reactions: FloatingReaction[];
|
|
43
|
+
/**
|
|
44
|
+
* Add an emoji reaction. An auto-incrementing id (not Math.random) is
|
|
45
|
+
* generated internally unless you pass one explicitly.
|
|
46
|
+
*/
|
|
47
|
+
emit: (emoji: string, options?: {
|
|
48
|
+
id?: string;
|
|
49
|
+
lane?: number;
|
|
50
|
+
}) => void;
|
|
51
|
+
/** Remove all current reactions immediately. */
|
|
52
|
+
clear: () => void;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Manages a list of FloatingReaction items with automatic expiry after
|
|
56
|
+
* REACTION_LIFETIME_MS. IDs use an incrementing ref counter — no Math.random.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* const { reactions, emit } = useFloatingReactions()
|
|
60
|
+
* // <FloatingReactions reactions={reactions} />
|
|
61
|
+
* // <button onClick={() => emit('👋')}>Wave</button>
|
|
62
|
+
*/
|
|
63
|
+
declare function useFloatingReactions(): UseFloatingReactionsResult;
|
|
64
|
+
|
|
65
|
+
export { FloatingReactions, type FloatingReactionsProps, ReactionBurst, type ReactionBurstProps, type UseFloatingReactionsResult, useFloatingReactions };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { FlowNode, FlowEdge } from '../flow-editor/index.js';
|
|
3
|
+
export { FlowEdge, FlowNode } from '../flow-editor/index.js';
|
|
4
|
+
|
|
5
|
+
interface FlowEditorProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect' | 'results' | 'color' | 'content'> {
|
|
6
|
+
/** The nodes to render on the canvas. */
|
|
7
|
+
nodes: FlowNode[];
|
|
8
|
+
/** The directed edges connecting nodes. */
|
|
9
|
+
edges: FlowEdge[];
|
|
10
|
+
/** Called when a node is clicked; receives the node's id. */
|
|
11
|
+
onNodeClick?: (id: string) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Called when a node has been dragged to a new position.
|
|
14
|
+
* Receives the node id and the new (x, y) canvas coordinates.
|
|
15
|
+
*/
|
|
16
|
+
onNodeMove?: (id: string, x: number, y: number) => void;
|
|
17
|
+
/** Override the rendering of individual node boxes. */
|
|
18
|
+
renderNode?: (node: FlowNode) => React.ReactNode;
|
|
19
|
+
/** Id of the currently selected node (controlled). */
|
|
20
|
+
selectedId?: string;
|
|
21
|
+
/** Whether to show the pan/zoom grid. */
|
|
22
|
+
showGrid?: boolean;
|
|
23
|
+
/** Whether to show zoom/pan controls. */
|
|
24
|
+
showControls?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* FlowEditor — a node-and-edge diagram editor.
|
|
28
|
+
*
|
|
29
|
+
* Renders inside `<InfiniteCanvas>` so the whole graph is pan/zoomable.
|
|
30
|
+
* Edges are drawn as SVG cubic bezier paths behind the node boxes.
|
|
31
|
+
* Node drag is kept deliberately simple (pointer events, no external dep).
|
|
32
|
+
*/
|
|
33
|
+
declare const FlowEditor: React.ForwardRefExoticComponent<FlowEditorProps & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
|
|
35
|
+
export { FlowEditor, type FlowEditorProps };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GraphNode, GraphEdge } from '../graph-view/index.js';
|
|
3
|
+
export { GraphEdge, GraphNode, GraphNodeState } from '../graph-view/index.js';
|
|
4
|
+
|
|
5
|
+
interface GraphViewProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect' | 'color' | 'content' | 'results'> {
|
|
6
|
+
/** Nodes to render. */
|
|
7
|
+
nodes: GraphNode[];
|
|
8
|
+
/** Directed edges connecting nodes. */
|
|
9
|
+
edges: GraphEdge[];
|
|
10
|
+
/** Called when a node chip is clicked (read-only — no selection state). */
|
|
11
|
+
onNodeClick?: (node: GraphNode) => void;
|
|
12
|
+
/** Show a legend summarising mastery-state counts. */
|
|
13
|
+
showLegend?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* GraphView — a read-only knowledge / dependency graph rendered inside an
|
|
17
|
+
* InfiniteCanvas (pan + zoom). Concept nodes are coloured by mastery state;
|
|
18
|
+
* edges are SVG curves. An optional legend shows per-state node counts.
|
|
19
|
+
*
|
|
20
|
+
* The component is intentionally read-only: clicking a node fires `onNodeClick`
|
|
21
|
+
* but never mutates the `nodes` array — the caller owns the data.
|
|
22
|
+
*/
|
|
23
|
+
declare const GraphView: React.ForwardRefExoticComponent<GraphViewProps & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
|
|
25
|
+
export { GraphView, type GraphViewProps };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CanvasTransform, Bounds } from '../infinite-canvas/index.js';
|
|
3
|
+
export { Bounds, CanvasTransform } from '../infinite-canvas/index.js';
|
|
4
|
+
|
|
5
|
+
interface InfiniteCanvasProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color' | 'content'> {
|
|
6
|
+
/** Controlled zoom level. */
|
|
7
|
+
zoom?: number;
|
|
8
|
+
/** Controlled pan offset (x). */
|
|
9
|
+
x?: number;
|
|
10
|
+
/** Controlled pan offset (y). */
|
|
11
|
+
y?: number;
|
|
12
|
+
/** Whether pointer-drag-to-pan is enabled (uncontrolled mode). */
|
|
13
|
+
pan?: boolean;
|
|
14
|
+
/** Minimum zoom level (default 0.25). */
|
|
15
|
+
minZoom?: number;
|
|
16
|
+
/** Maximum zoom level (default 4). */
|
|
17
|
+
maxZoom?: number;
|
|
18
|
+
/** Show a dot-grid background. */
|
|
19
|
+
showGrid?: boolean;
|
|
20
|
+
/** Show the zoom-controls overlay (+, −, fit). */
|
|
21
|
+
showControls?: boolean;
|
|
22
|
+
/** Called when the transform changes (wheel or drag in uncontrolled mode). */
|
|
23
|
+
onTransformChange?: (transform: CanvasTransform) => void;
|
|
24
|
+
/** Content bounds used by the fit/reset control. */
|
|
25
|
+
contentBounds?: Bounds;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* InfiniteCanvas — a pan/zoom viewport foundation.
|
|
29
|
+
*
|
|
30
|
+
* Renders a `role="group"` container that clips children and applies a CSS
|
|
31
|
+
* transform to a content layer, enabling infinite-canvas interactions
|
|
32
|
+
* (whiteboard, system-design diagram, goal-graph).
|
|
33
|
+
*
|
|
34
|
+
* Supports controlled (`zoom`/`x`/`y`) and uncontrolled usage. Wheel-to-zoom
|
|
35
|
+
* and pointer-drag-to-pan are enabled by default in uncontrolled mode. All
|
|
36
|
+
* pointer handlers are registered after mount so they are SSR-safe.
|
|
37
|
+
*/
|
|
38
|
+
declare const InfiniteCanvas: React.ForwardRefExoticComponent<InfiniteCanvasProps & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
|
|
40
|
+
export { InfiniteCanvas, type InfiniteCanvasProps };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { InputValidationState } from '../input/index.cjs';
|
|
2
3
|
export { InputType, inputVariants } from '../input/index.cjs';
|
|
3
4
|
|
|
4
5
|
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
@@ -19,6 +20,21 @@ interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, '
|
|
|
19
20
|
* See the package README's "Sizing" section for more.
|
|
20
21
|
*/
|
|
21
22
|
size?: 'sm' | 'default' | 'lg';
|
|
23
|
+
/**
|
|
24
|
+
* Validation affordance. Tints the border and wires `aria-invalid`:
|
|
25
|
+
* - `'valid'` → green border, trailing check icon, `aria-invalid={false}`
|
|
26
|
+
* - `'invalid'` → destructive border, `aria-invalid={true}`
|
|
27
|
+
*
|
|
28
|
+
* When omitted the input is rendered without a wrapper (identical to the
|
|
29
|
+
* legacy bare `<input>` markup), unless `leadingIcon` is set.
|
|
30
|
+
*/
|
|
31
|
+
validationState?: InputValidationState;
|
|
32
|
+
/**
|
|
33
|
+
* Optional icon rendered inside the input's left padding. When provided
|
|
34
|
+
* (or when `validationState` is set) the input is wrapped in a relative
|
|
35
|
+
* `<div>` and gains left padding to make room for the icon.
|
|
36
|
+
*/
|
|
37
|
+
leadingIcon?: React.ReactNode;
|
|
22
38
|
}
|
|
23
39
|
/**
|
|
24
40
|
* Input component — renders a styled input with size support.
|