@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.
Files changed (75) hide show
  1. package/dist/index.cjs +4285 -10
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +28 -0
  4. package/dist/index.d.ts +28 -0
  5. package/dist/index.js +4238 -11
  6. package/dist/index.js.map +1 -1
  7. package/dist/internal/audio-room/index.d.ts +91 -0
  8. package/dist/internal/call-controls/index.d.ts +83 -0
  9. package/dist/internal/checklist/index.d.ts +84 -0
  10. package/dist/internal/editor-status-bar/index.d.ts +70 -0
  11. package/dist/internal/editor-tabs/index.d.ts +68 -0
  12. package/dist/internal/empty-state/index.d.cts +39 -0
  13. package/dist/internal/empty-state/index.d.ts +39 -0
  14. package/dist/internal/floating-reactions/index.d.ts +98 -0
  15. package/dist/internal/flow-editor/index.d.ts +91 -0
  16. package/dist/internal/graph-view/index.d.ts +107 -0
  17. package/dist/internal/infinite-canvas/index.d.ts +74 -0
  18. package/dist/internal/input/index.d.cts +19 -1
  19. package/dist/internal/input/index.d.ts +19 -1
  20. package/dist/internal/live-captions/index.d.ts +59 -0
  21. package/dist/internal/live-cursors/index.d.ts +65 -0
  22. package/dist/internal/live-transcript/index.d.ts +73 -0
  23. package/dist/internal/mini-map/index.d.ts +81 -0
  24. package/dist/internal/pre-call-lobby/index.d.ts +97 -0
  25. package/dist/internal/radial-gauge/index.d.ts +120 -0
  26. package/dist/internal/rating-scale/index.d.ts +76 -0
  27. package/dist/internal/react-audio-room/index.d.ts +39 -0
  28. package/dist/internal/react-call-controls/index.d.ts +44 -0
  29. package/dist/internal/react-checklist/index.d.ts +27 -0
  30. package/dist/internal/react-editor-status-bar/index.d.ts +43 -0
  31. package/dist/internal/react-editor-tabs/index.d.ts +25 -0
  32. package/dist/internal/react-empty-state/index.d.cts +36 -0
  33. package/dist/internal/react-empty-state/index.d.ts +36 -0
  34. package/dist/internal/react-floating-reactions/index.d.ts +65 -0
  35. package/dist/internal/react-flow-editor/index.d.ts +35 -0
  36. package/dist/internal/react-graph-view/index.d.ts +25 -0
  37. package/dist/internal/react-infinite-canvas/index.d.ts +40 -0
  38. package/dist/internal/react-input/index.d.cts +16 -0
  39. package/dist/internal/react-input/index.d.ts +16 -0
  40. package/dist/internal/react-live-captions/index.d.ts +29 -0
  41. package/dist/internal/react-live-cursors/index.d.ts +42 -0
  42. package/dist/internal/react-live-transcript/index.d.ts +22 -0
  43. package/dist/internal/react-mini-map/index.d.ts +35 -0
  44. package/dist/internal/react-password-input/index.d.cts +26 -0
  45. package/dist/internal/react-password-input/index.d.ts +26 -0
  46. package/dist/internal/react-pre-call-lobby/index.d.ts +47 -0
  47. package/dist/internal/react-radial-gauge/index.d.ts +43 -0
  48. package/dist/internal/react-rating-scale/index.d.ts +38 -0
  49. package/dist/internal/react-segmented-control/index.d.cts +38 -0
  50. package/dist/internal/react-segmented-control/index.d.ts +38 -0
  51. package/dist/internal/react-separator/index.d.cts +29 -0
  52. package/dist/internal/react-separator/index.d.ts +29 -0
  53. package/dist/internal/react-social-auth-button/index.d.cts +31 -0
  54. package/dist/internal/react-social-auth-button/index.d.ts +31 -0
  55. package/dist/internal/react-sticky-note/index.d.ts +39 -0
  56. package/dist/internal/react-terminal/index.d.ts +39 -0
  57. package/dist/internal/react-test-results/index.d.ts +21 -0
  58. package/dist/internal/react-timeline/index.d.ts +35 -0
  59. package/dist/internal/react-video-grid/index.d.ts +33 -0
  60. package/dist/internal/react-video-tile/index.d.ts +41 -0
  61. package/dist/internal/react-wizard/index.d.ts +59 -0
  62. package/dist/internal/segmented-control/index.d.cts +56 -0
  63. package/dist/internal/segmented-control/index.d.ts +56 -0
  64. package/dist/internal/separator/index.d.cts +55 -0
  65. package/dist/internal/separator/index.d.ts +55 -0
  66. package/dist/internal/social-auth-button/index.d.cts +47 -0
  67. package/dist/internal/social-auth-button/index.d.ts +47 -0
  68. package/dist/internal/sticky-note/index.d.ts +49 -0
  69. package/dist/internal/terminal/index.d.ts +65 -0
  70. package/dist/internal/test-results/index.d.ts +97 -0
  71. package/dist/internal/timeline/index.d.ts +111 -0
  72. package/dist/internal/video-grid/index.d.ts +83 -0
  73. package/dist/internal/video-tile/index.d.ts +88 -0
  74. package/dist/internal/wizard/index.d.ts +148 -0
  75. package/package.json +48 -20
@@ -0,0 +1,97 @@
1
+ import { AccessibilityProps } from '../shared/index.js';
2
+
3
+ /** The execution status of a single test case. */
4
+ type TestStatus = 'pass' | 'fail' | 'skip';
5
+ /** Data for a single test case result. */
6
+ interface TestResultData {
7
+ /** Unique identifier for the test. */
8
+ id: string;
9
+ /** Human-readable test name. */
10
+ name: string;
11
+ /** Execution status. */
12
+ status: TestStatus;
13
+ /** How long the test took to run, in milliseconds. */
14
+ durationMs?: number;
15
+ /** Expected value (shown in diff when the test fails). */
16
+ expected?: string;
17
+ /** Actual value received (shown in diff when the test fails). */
18
+ actual?: string;
19
+ /** Optional message — error message on failure, skip reason, etc. */
20
+ message?: string;
21
+ }
22
+ /** Aggregate counts derived from a list of test results. */
23
+ interface TestSummary {
24
+ total: number;
25
+ passed: number;
26
+ failed: number;
27
+ skipped: number;
28
+ /** True when every test passed (failed === 0 and skipped === 0). */
29
+ allPassed: boolean;
30
+ }
31
+ interface TestResultsAPI {
32
+ /** ARIA attributes to spread on the list container (`role="list"`). */
33
+ ariaProps: Partial<AccessibilityProps>;
34
+ /** Data attributes for styling hooks. */
35
+ dataAttributes: Record<string, string>;
36
+ }
37
+ /**
38
+ * Compute aggregate summary counts from a list of {@link TestResultData}.
39
+ *
40
+ * Pure function — no side effects, safe to call during SSR.
41
+ */
42
+ declare function summarizeTests(results: TestResultData[]): TestSummary;
43
+ /**
44
+ * Build the framework-agnostic container props for a test results list.
45
+ *
46
+ * Returns `role="list"` plus data attributes that adapters spread onto their
47
+ * container element. The adapter is responsible for rendering individual items
48
+ * with `role="listitem"`.
49
+ */
50
+ declare function createTestResults(): TestResultsAPI;
51
+
52
+ /** Outer container that wraps the summary bar and the test row list. */
53
+ declare const testResultsContainerVariants: (props?: ({} & {
54
+ className?: string;
55
+ }) | undefined) => string;
56
+ /**
57
+ * Summary bar ("2 / 3 passed").
58
+ *
59
+ * The `outcome` variant maps to a semantic color token so the bar turns green
60
+ * when everything passes, red when there are failures.
61
+ */
62
+ declare const testResultsSummaryVariants: (props?: ({
63
+ outcome?: "pass" | "fail" | "skip" | undefined;
64
+ } & {
65
+ className?: string;
66
+ }) | undefined) => string;
67
+ /** A single test row in the list. */
68
+ declare const testRowVariants: (props?: ({
69
+ status?: "pass" | "fail" | "skip" | undefined;
70
+ } & {
71
+ className?: string;
72
+ }) | undefined) => string;
73
+ /** Status icon / badge inside a test row (the PASS / FAIL / SKIP pill). */
74
+ declare const testStatusBadgeVariants: (props?: ({
75
+ status?: "pass" | "fail" | "skip" | undefined;
76
+ } & {
77
+ className?: string;
78
+ }) | undefined) => string;
79
+ /** Test name text inside a row. */
80
+ declare const testNameClass = "font-medium text-foreground";
81
+ /** Duration text ("12 ms") inside a row. */
82
+ declare const testDurationClass = "text-xs text-muted-foreground";
83
+ /**
84
+ * Expected / actual diff block shown beneath a failing test row.
85
+ *
86
+ * The `side` variant sets the left-border accent color to distinguish the two
87
+ * sides of the diff.
88
+ */
89
+ declare const testDiffBlockVariants: (props?: ({
90
+ side?: "expected" | "actual" | undefined;
91
+ } & {
92
+ className?: string;
93
+ }) | undefined) => string;
94
+ /** Error / skip message text beneath a test row. */
95
+ declare const testMessageClass = "text-xs text-muted-foreground italic";
96
+
97
+ export { type TestResultData, type TestResultsAPI, type TestStatus, type TestSummary, createTestResults, summarizeTests, testDiffBlockVariants, testDurationClass, testMessageClass, testNameClass, testResultsContainerVariants, testResultsSummaryVariants, testRowVariants, testStatusBadgeVariants };
@@ -0,0 +1,111 @@
1
+ import { AccessibilityProps } from '../shared/index.js';
2
+
3
+ /** Layout orientation of the timeline. */
4
+ type TimelineOrientation = 'vertical' | 'horizontal';
5
+ /** Visual status of a single timeline item. */
6
+ type TimelineItemStatus = 'done' | 'current' | 'upcoming' | 'default';
7
+ /** Data describing a single event in the timeline. */
8
+ interface TimelineItemData {
9
+ /** Unique identifier for the item. */
10
+ id: string;
11
+ /** Primary label shown beside the marker. */
12
+ title: string;
13
+ /** Optional timestamp / date string shown near the marker. */
14
+ time?: string;
15
+ /** Additional detail text rendered below the title. */
16
+ description?: string;
17
+ /** Visual status of this item. Defaults to `'default'` when omitted. */
18
+ status?: TimelineItemStatus;
19
+ }
20
+ interface TimelineProps {
21
+ /** Ordered list of events to display. */
22
+ items: TimelineItemData[];
23
+ /** Layout direction. */
24
+ orientation?: TimelineOrientation;
25
+ }
26
+ interface TimelineAPI {
27
+ /** ARIA attributes to spread on the list container (`role="list"`). */
28
+ ariaProps: Partial<AccessibilityProps>;
29
+ /** Data attributes for styling hooks. */
30
+ dataAttributes: Record<string, string>;
31
+ }
32
+ /**
33
+ * Build the framework-agnostic container props for a timeline.
34
+ *
35
+ * Returns `role="list"` (the items carry `role="listitem"`) plus a
36
+ * `data-orientation` attribute. The function is JSX-free so it can run in
37
+ * any environment including server-side Node and Astro SSR.
38
+ */
39
+ declare function createTimeline(props?: Pick<TimelineProps, 'orientation'>): TimelineAPI;
40
+ /**
41
+ * Accessibility props for a single timeline item.
42
+ *
43
+ * Every item gets `role="listitem"` regardless of status so screen readers
44
+ * announce the full list correctly.
45
+ */
46
+ declare function getTimelineItemAria(): Partial<AccessibilityProps>;
47
+ /**
48
+ * Normalise a raw list of timeline items so every entry has an explicit
49
+ * `status`. Items without a status receive `'default'`.
50
+ *
51
+ * This is the single source of truth shared by every adapter — call it once
52
+ * at render time and iterate over the result.
53
+ */
54
+ declare function resolveTimelineItems(items: TimelineItemData[]): Required<TimelineItemData>[];
55
+
56
+ /**
57
+ * Outer rail / list container.
58
+ *
59
+ * Vertical: a single column; horizontal: a row so items sit side-by-side.
60
+ */
61
+ declare const timelineVariants: (props?: ({
62
+ orientation?: "vertical" | "horizontal" | undefined;
63
+ } & {
64
+ className?: string;
65
+ }) | undefined) => string;
66
+ /**
67
+ * A single event row / column.
68
+ *
69
+ * In vertical mode items stack with a left gutter for the marker + connector.
70
+ * In horizontal mode each item takes equal width and the connector runs above.
71
+ */
72
+ declare const timelineItemVariants: (props?: ({
73
+ orientation?: "vertical" | "horizontal" | undefined;
74
+ } & {
75
+ className?: string;
76
+ }) | undefined) => string;
77
+ /**
78
+ * The marker / dot that represents the event on the rail.
79
+ *
80
+ * Status variants map directly to semantic token colours so theming is
81
+ * handled at the design-token level, not inline.
82
+ */
83
+ declare const timelineMarkerVariants: (props?: ({
84
+ status?: "done" | "current" | "upcoming" | "default" | undefined;
85
+ } & {
86
+ className?: string;
87
+ }) | undefined) => string;
88
+ /**
89
+ * The connector line drawn between adjacent markers.
90
+ *
91
+ * Vertical: a thin vertical stripe anchored to the left gutter.
92
+ * Horizontal: a thin horizontal stripe anchored above the content row.
93
+ * The last item hides its connector so the rail terminates cleanly.
94
+ */
95
+ declare const timelineConnectorVariants: (props?: ({
96
+ orientation?: "vertical" | "horizontal" | undefined;
97
+ } & {
98
+ className?: string;
99
+ }) | undefined) => string;
100
+ /** Wrapper that holds the marker + connector in the gutter column/row. */
101
+ declare const timelineGutterClass = "relative flex flex-col items-center";
102
+ /** Time / date label rendered near the marker. */
103
+ declare const timelineTimeClass = "text-xs text-muted-foreground tabular-nums";
104
+ /** Primary event title. */
105
+ declare const timelineTitleClass = "text-sm font-medium text-foreground leading-snug";
106
+ /** Secondary description text. */
107
+ declare const timelineDescriptionClass = "mt-0.5 text-xs text-muted-foreground leading-relaxed";
108
+ /** Content block (title + description) next to or below the marker. */
109
+ declare const timelineContentClass = "flex flex-col min-w-0";
110
+
111
+ export { type TimelineAPI, type TimelineItemData, type TimelineItemStatus, type TimelineOrientation, type TimelineProps, createTimeline, getTimelineItemAria, resolveTimelineItems, timelineConnectorVariants, timelineContentClass, timelineDescriptionClass, timelineGutterClass, timelineItemVariants, timelineMarkerVariants, timelineTimeClass, timelineTitleClass, timelineVariants };
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Layout mode for a VideoGrid.
3
+ *
4
+ * - 'auto' — choose grid or speaker view based on participant count (≤1 forces speaker)
5
+ * - 'grid' — always render an even CSS grid of tiles
6
+ * - 'speaker' — render one large spotlight tile + a filmstrip row for the rest
7
+ */
8
+ type VideoGridLayout = 'auto' | 'grid' | 'speaker';
9
+ /**
10
+ * Bucket label that describes the rough meeting size.
11
+ * Useful for analytics and adaptive UI decisions.
12
+ */
13
+ type VideoGridBucket = 'solo' | 'pair' | 'small' | 'medium' | 'large' | 'townhall';
14
+ interface VideoGridHeadlessProps {
15
+ /** Desired layout mode. */
16
+ layout?: VideoGridLayout;
17
+ }
18
+ interface VideoGridAPI {
19
+ /** ARIA attributes to spread on the grid container. */
20
+ ariaProps: {
21
+ role: 'group';
22
+ };
23
+ /** Data attributes for CSS styling hooks. */
24
+ dataAttributes: {
25
+ 'data-layout': VideoGridLayout;
26
+ 'data-count'?: string;
27
+ };
28
+ }
29
+ /**
30
+ * Compute the number of CSS grid columns for N participants.
31
+ *
32
+ * The responsive rule mirrors easyloops meeting layouts:
33
+ *
34
+ * | count | columns |
35
+ * |-------|---------|
36
+ * | 1 | 1 |
37
+ * | 2 | 2 |
38
+ * | 3–4 | 2 |
39
+ * | 5–9 | 3 |
40
+ * | 10–16 | 4 |
41
+ * | 17–25 | 5 |
42
+ * | 26+ | 6 |
43
+ */
44
+ declare function computeGridColumns(count: number): number;
45
+ /**
46
+ * Label the meeting size as a human-readable bucket.
47
+ *
48
+ * Useful for analytics events and adaptive UI decisions without
49
+ * coupling to the exact column math.
50
+ */
51
+ declare function bucketByCount(count: number): VideoGridBucket;
52
+ /**
53
+ * Build the framework-agnostic ARIA and data attributes for a VideoGrid
54
+ * container. Adapters spread these onto their host element.
55
+ */
56
+ declare function createVideoGrid(props?: VideoGridHeadlessProps): VideoGridAPI;
57
+
58
+ /**
59
+ * Grid container variants.
60
+ *
61
+ * - `layout: 'grid'` — uniform CSS grid; column count is set inline by the
62
+ * adapter using `computeGridColumns` (gridTemplateColumns).
63
+ * - `layout: 'speaker'` — two-row layout: large spotlight on top, filmstrip row
64
+ * below. The adapter renders the spotlight as the first child and a horizontal
65
+ * overflow row for remaining tiles.
66
+ */
67
+ declare const videoGridVariants: (props?: ({
68
+ layout?: "auto" | "grid" | "speaker" | undefined;
69
+ } & {
70
+ className?: string;
71
+ }) | undefined) => string;
72
+ /** Full-bleed spotlight area in speaker view (takes up remaining vertical space). */
73
+ declare const videoGridSpotlightClass = "relative flex-1 min-h-0 rounded-xl overflow-hidden bg-muted";
74
+ /**
75
+ * Horizontal filmstrip row used in speaker view.
76
+ * Each tile in this row is constrained to a fixed width so the row scrolls
77
+ * rather than wraps on large calls.
78
+ */
79
+ declare const videoGridFilmstripClass = "flex flex-row gap-2 overflow-x-auto py-1 shrink-0";
80
+ /** Individual filmstrip tile wrapper — fixed width so they don't collapse. */
81
+ declare const videoGridFilmstripTileClass = "w-36 shrink-0";
82
+
83
+ export { type VideoGridAPI, type VideoGridBucket, type VideoGridHeadlessProps, type VideoGridLayout, bucketByCount, computeGridColumns, createVideoGrid, videoGridFilmstripClass, videoGridFilmstripTileClass, videoGridSpotlightClass, videoGridVariants };
@@ -0,0 +1,88 @@
1
+ /** Microphone state for a video participant. */
2
+ type VideoTileMicState = 'on' | 'muted';
3
+ /** Data describing a video meeting participant tile. */
4
+ interface VideoTileData {
5
+ /** Unique participant identifier. */
6
+ id: string;
7
+ /** Display name shown in the name chip. */
8
+ name: string;
9
+ /** Current microphone state. Defaults to 'on'. */
10
+ micState?: VideoTileMicState;
11
+ /** Whether the participant is currently speaking (active audio). */
12
+ speaking?: boolean;
13
+ /** Whether the tile is pinned in the grid. */
14
+ pinned?: boolean;
15
+ }
16
+ interface VideoTileHeadlessProps {
17
+ /** Whether the participant is actively speaking. */
18
+ speaking?: boolean;
19
+ /** Whether the tile is pinned in the grid. */
20
+ pinned?: boolean;
21
+ }
22
+ interface VideoTileAPI {
23
+ /** Data attributes for styling hooks — spread onto the tile container. */
24
+ dataAttributes: {
25
+ 'data-speaking': string;
26
+ 'data-pinned': string;
27
+ };
28
+ /** ARIA props — spread onto the tile container. */
29
+ ariaProps: {
30
+ role: 'group';
31
+ };
32
+ }
33
+ /**
34
+ * Derive framework-agnostic data attributes and ARIA props for a VideoTile.
35
+ *
36
+ * Adapters spread `dataAttributes` and `ariaProps` onto the tile container so
37
+ * CSS selectors and assistive technology can reflect the current participant
38
+ * state without coupling to a specific framework.
39
+ */
40
+ declare function createVideoTile(props?: VideoTileHeadlessProps): VideoTileAPI;
41
+ /**
42
+ * Derive up to two uppercase initials from a display name.
43
+ *
44
+ * Splits on whitespace and takes the first character of the first two words.
45
+ * Single-word names produce a single initial.
46
+ *
47
+ * @example
48
+ * getInitials('Maya Goldberg') // 'MG'
49
+ * getInitials('Alice') // 'A'
50
+ */
51
+ declare function getInitials(name: string): string;
52
+
53
+ /**
54
+ * Root tile container — aspect-video, rounded corners, clipped media.
55
+ *
56
+ * `speaking` variant adds a visible ring to indicate active audio.
57
+ * `pinned` variant adds a stronger ring to mark a pinned participant.
58
+ *
59
+ * cva boolean-like variants use string values ('true'/'false') per the
60
+ * refraction-ui convention — callers must pass strings, not raw booleans.
61
+ */
62
+ declare const videoTileVariants: (props?: ({
63
+ speaking?: "true" | "false" | undefined;
64
+ pinned?: "true" | "false" | undefined;
65
+ } & {
66
+ className?: string;
67
+ }) | undefined) => string;
68
+ /**
69
+ * Name chip anchored to the bottom-left of the tile.
70
+ * Semi-transparent bg keeps it legible over any media content.
71
+ */
72
+ declare const videoTileNameChipClass = "absolute bottom-2 left-2 flex items-center gap-1.5 rounded-md bg-background/70 px-2 py-0.5 text-xs font-medium text-foreground backdrop-blur-sm";
73
+ /**
74
+ * Mic-muted icon container — sits inside the name chip at the trailing edge.
75
+ */
76
+ declare const videoTileMicIconClass = "text-destructive";
77
+ /**
78
+ * Avatar fallback circle — centred in the tile when no media stream is available.
79
+ */
80
+ declare const videoTileAvatarFallbackClass = "absolute inset-0 flex items-center justify-center";
81
+ /** Inner circle with initials. */
82
+ declare const videoTileAvatarCircleClass = "flex size-16 items-center justify-center rounded-full bg-card text-foreground text-xl font-semibold select-none";
83
+ /**
84
+ * Reaction badge slot — anchored to the top-right corner.
85
+ */
86
+ declare const videoTileReactionBadgeClass = "absolute right-2 top-2 flex items-center justify-center rounded-full bg-background/70 px-1.5 py-0.5 text-sm backdrop-blur-sm";
87
+
88
+ export { type VideoTileAPI, type VideoTileData, type VideoTileHeadlessProps, type VideoTileMicState, createVideoTile, getInitials, videoTileAvatarCircleClass, videoTileAvatarFallbackClass, videoTileMicIconClass, videoTileNameChipClass, videoTileReactionBadgeClass, videoTileVariants };
@@ -0,0 +1,148 @@
1
+ import { AccessibilityProps } from '../shared/index.js';
2
+
3
+ /** A single step in a wizard flow. */
4
+ interface WizardStep {
5
+ /** Unique identifier for the step. */
6
+ id: string;
7
+ /** Human-readable label shown in the step rail. */
8
+ label: string;
9
+ /** When true the user may skip this step. */
10
+ optional?: boolean;
11
+ }
12
+ /** The resolved status of a step relative to the current position. */
13
+ type WizardStepStatus = 'complete' | 'current' | 'upcoming';
14
+ /** A step enriched with its resolved status and position. */
15
+ interface WizardStepState {
16
+ step: WizardStep;
17
+ status: WizardStepStatus;
18
+ index: number;
19
+ }
20
+ /** Orientation of the step rail. */
21
+ type WizardOrientation = 'vertical' | 'horizontal';
22
+ interface WizardProps {
23
+ /** Controlled current step index (0-based). */
24
+ currentIndex?: number;
25
+ /** Total number of steps. */
26
+ count?: number;
27
+ /** Orientation of the step rail. */
28
+ orientation?: WizardOrientation;
29
+ }
30
+ interface WizardAPI {
31
+ /** ARIA attributes to spread on the root element. */
32
+ ariaProps: Partial<AccessibilityProps>;
33
+ /** Data attributes for styling hooks. */
34
+ dataAttributes: Record<string, string>;
35
+ }
36
+ /**
37
+ * Derive the status of every step from the current position.
38
+ *
39
+ * Steps before `currentIndex` are `'complete'`, the step at `currentIndex` is
40
+ * `'current'`, and every step after is `'upcoming'`.
41
+ */
42
+ declare function getStepState(steps: WizardStep[], currentIndex: number): WizardStepState[];
43
+ /**
44
+ * Returns the next step index, clamped to the last step so the wizard never
45
+ * advances past the final step.
46
+ */
47
+ declare function getNextIndex(currentIndex: number, count: number): number;
48
+ /**
49
+ * Returns the previous step index, clamped to 0 so the wizard never goes
50
+ * behind the first step.
51
+ */
52
+ declare function getPrevIndex(currentIndex: number): number;
53
+ /**
54
+ * Whether the wizard can advance from `currentIndex`.
55
+ *
56
+ * Returns `false` when already on the last step.
57
+ */
58
+ declare function canAdvance(currentIndex: number, count: number): boolean;
59
+ /**
60
+ * Fractional progress through the wizard (0 when on step 0, 1 when the final
61
+ * step is complete). Returns 0 for empty wizards.
62
+ *
63
+ * `wizardProgress(0, 4)` → 0 (just started)
64
+ * `wizardProgress(3, 4)` → 0.75
65
+ * `wizardProgress(4, 4)` → 1 (done)
66
+ */
67
+ declare function wizardProgress(currentIndex: number, count: number): number;
68
+ /**
69
+ * Build the framework-agnostic root props for a wizard component.
70
+ *
71
+ * Returns `role="group"` plus `data-step` / `data-orientation` attributes so
72
+ * adapters can spread them onto their container without duplicating logic.
73
+ */
74
+ declare function createWizard(props?: WizardProps): WizardAPI;
75
+
76
+ /**
77
+ * Root container that holds the step rail and the content/footer area
78
+ * side-by-side (vertical) or stacked (horizontal).
79
+ */
80
+ declare const wizardVariants: (props?: ({
81
+ orientation?: "vertical" | "horizontal" | undefined;
82
+ } & {
83
+ className?: string;
84
+ }) | undefined) => string;
85
+ /**
86
+ * The step rail — the ordered list of step indicators.
87
+ * Vertical: a narrow column on the left. Horizontal: a row across the top.
88
+ */
89
+ declare const wizardRailVariants: (props?: ({
90
+ orientation?: "vertical" | "horizontal" | undefined;
91
+ } & {
92
+ className?: string;
93
+ }) | undefined) => string;
94
+ /**
95
+ * A single step item in the rail. The `status` variant drives colour so
96
+ * adapters never inline these classes.
97
+ */
98
+ declare const wizardStepItemVariants: (props?: ({
99
+ orientation?: "vertical" | "horizontal" | undefined;
100
+ status?: "complete" | "current" | "upcoming" | undefined;
101
+ } & {
102
+ className?: string;
103
+ }) | undefined) => string;
104
+ /**
105
+ * The circular step indicator (the number/check badge on the rail).
106
+ * `status` variant applies the appropriate background and text treatment.
107
+ */
108
+ declare const wizardStepIndicatorVariants: (props?: ({
109
+ status?: "complete" | "current" | "upcoming" | undefined;
110
+ } & {
111
+ className?: string;
112
+ }) | undefined) => string;
113
+ /** The label text next to / below the step indicator. */
114
+ declare const wizardStepLabelVariants: (props?: ({
115
+ status?: "complete" | "current" | "upcoming" | undefined;
116
+ } & {
117
+ className?: string;
118
+ }) | undefined) => string;
119
+ /** "(Optional)" sub-label shown beneath the step label. */
120
+ declare const wizardStepOptionalClass = "text-xs text-muted-foreground";
121
+ /**
122
+ * The connector line drawn between two adjacent step indicators.
123
+ * Positioned absolutely so the indicator sits on top of it.
124
+ */
125
+ declare const wizardConnectorVariants: (props?: ({
126
+ orientation?: "vertical" | "horizontal" | undefined;
127
+ complete?: "true" | "false" | undefined;
128
+ } & {
129
+ className?: string;
130
+ }) | undefined) => string;
131
+ /** The main content area to the right (vertical) or below (horizontal) the rail. */
132
+ declare const wizardContentClass = "flex min-w-0 flex-1 flex-col";
133
+ /** Footer row that holds the Back / Skip / Next-or-Complete buttons. */
134
+ declare const wizardFooterClass = "mt-6 flex items-center gap-3";
135
+ /** The primary action button (Next / Complete). */
136
+ declare const wizardPrimaryButtonVariants: (props?: ({
137
+ [x: string]: string | undefined;
138
+ } & {
139
+ className?: string;
140
+ }) | undefined) => string;
141
+ /** The secondary action button (Back / Skip). */
142
+ declare const wizardSecondaryButtonVariants: (props?: ({
143
+ [x: string]: string | undefined;
144
+ } & {
145
+ className?: string;
146
+ }) | undefined) => string;
147
+
148
+ export { type WizardAPI, type WizardOrientation, type WizardProps, type WizardStep, type WizardStepState, type WizardStepStatus, canAdvance, createWizard, getNextIndex, getPrevIndex, getStepState, wizardConnectorVariants, wizardContentClass, wizardFooterClass, wizardPrimaryButtonVariants, wizardProgress, wizardRailVariants, wizardSecondaryButtonVariants, wizardStepIndicatorVariants, wizardStepItemVariants, wizardStepLabelVariants, wizardStepOptionalClass, wizardVariants };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@refraction-ui/react",
3
- "version": "0.12.3",
3
+ "version": "0.14.0",
4
4
  "description": "All Refraction UI React components in one package — headless, accessible, zero-dependency",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -51,8 +51,10 @@
51
51
  "@refraction-ui/accordion": "workspace:*",
52
52
  "@refraction-ui/react-accordion": "workspace:*",
53
53
  "@refraction-ui/react-ai": "workspace:*",
54
+ "@refraction-ui/react-analytics": "workspace:*",
54
55
  "@refraction-ui/react-animated-text": "workspace:*",
55
56
  "@refraction-ui/react-app-shell": "workspace:*",
57
+ "@refraction-ui/react-audio-room": "workspace:*",
56
58
  "@refraction-ui/react-auth": "workspace:*",
57
59
  "@refraction-ui/react-avatar": "workspace:*",
58
60
  "@refraction-ui/react-avatar-group": "workspace:*",
@@ -61,15 +63,22 @@
61
63
  "@refraction-ui/react-breadcrumbs": "workspace:*",
62
64
  "@refraction-ui/react-button": "workspace:*",
63
65
  "@refraction-ui/react-calendar": "workspace:*",
66
+ "@refraction-ui/react-call-controls": "workspace:*",
67
+ "@refraction-ui/react-callout": "workspace:*",
64
68
  "@refraction-ui/react-card": "workspace:*",
69
+ "@refraction-ui/react-card-grid": "workspace:*",
70
+ "@refraction-ui/react-carousel": "workspace:*",
65
71
  "@refraction-ui/react-charts": "workspace:*",
66
72
  "@refraction-ui/react-checkbox": "workspace:*",
73
+ "@refraction-ui/react-checklist": "workspace:*",
74
+ "@refraction-ui/react-code-block": "workspace:*",
67
75
  "@refraction-ui/react-code-editor": "workspace:*",
68
76
  "@refraction-ui/react-collapsible": "workspace:*",
69
77
  "@refraction-ui/react-combobox": "workspace:*",
70
78
  "@refraction-ui/react-command": "workspace:*",
71
- "@refraction-ui/react-conversation": "workspace:*",
79
+ "@refraction-ui/react-command-input": "workspace:*",
72
80
  "@refraction-ui/react-content-protection": "workspace:*",
81
+ "@refraction-ui/react-conversation": "workspace:*",
73
82
  "@refraction-ui/react-cookie-consent": "workspace:*",
74
83
  "@refraction-ui/react-data-table": "workspace:*",
75
84
  "@refraction-ui/react-date-picker": "workspace:*",
@@ -77,67 +86,86 @@
77
86
  "@refraction-ui/react-dialog": "workspace:*",
78
87
  "@refraction-ui/react-diff-viewer": "workspace:*",
79
88
  "@refraction-ui/react-dropdown-menu": "workspace:*",
89
+ "@refraction-ui/react-editor-status-bar": "workspace:*",
90
+ "@refraction-ui/react-editor-tabs": "workspace:*",
80
91
  "@refraction-ui/react-emoji-picker": "workspace:*",
92
+ "@refraction-ui/react-empty-state": "workspace:*",
81
93
  "@refraction-ui/react-feedback-dialog": "workspace:*",
94
+ "@refraction-ui/react-file-tree": "workspace:*",
82
95
  "@refraction-ui/react-file-upload": "workspace:*",
96
+ "@refraction-ui/react-floating-reactions": "workspace:*",
97
+ "@refraction-ui/react-flow-editor": "workspace:*",
83
98
  "@refraction-ui/react-footer": "workspace:*",
84
99
  "@refraction-ui/react-form": "workspace:*",
100
+ "@refraction-ui/react-graph-view": "workspace:*",
101
+ "@refraction-ui/react-icon-system": "workspace:*",
102
+ "@refraction-ui/react-infinite-canvas": "workspace:*",
85
103
  "@refraction-ui/react-inline-editor": "workspace:*",
86
104
  "@refraction-ui/react-input": "workspace:*",
87
105
  "@refraction-ui/react-input-group": "workspace:*",
88
106
  "@refraction-ui/react-install-prompt": "workspace:*",
89
107
  "@refraction-ui/react-keyboard-shortcut": "workspace:*",
90
108
  "@refraction-ui/react-language-selector": "workspace:*",
109
+ "@refraction-ui/react-link-card": "workspace:*",
110
+ "@refraction-ui/react-live-captions": "workspace:*",
111
+ "@refraction-ui/react-live-cursors": "workspace:*",
112
+ "@refraction-ui/react-live-transcript": "workspace:*",
113
+ "@refraction-ui/react-logger": "workspace:*",
91
114
  "@refraction-ui/react-markdown-renderer": "workspace:*",
115
+ "@refraction-ui/react-mini-map": "workspace:*",
92
116
  "@refraction-ui/react-mobile-nav": "workspace:*",
93
117
  "@refraction-ui/react-navbar": "workspace:*",
94
118
  "@refraction-ui/react-otp-input": "workspace:*",
119
+ "@refraction-ui/react-pagination": "workspace:*",
120
+ "@refraction-ui/react-password-input": "workspace:*",
121
+ "@refraction-ui/react-payment": "workspace:*",
95
122
  "@refraction-ui/react-popover": "workspace:*",
123
+ "@refraction-ui/react-pre-call-lobby": "workspace:*",
96
124
  "@refraction-ui/react-presence-indicator": "workspace:*",
97
125
  "@refraction-ui/react-progress-display": "workspace:*",
126
+ "@refraction-ui/react-radial-gauge": "workspace:*",
98
127
  "@refraction-ui/react-radio": "workspace:*",
128
+ "@refraction-ui/react-rating-scale": "workspace:*",
99
129
  "@refraction-ui/react-reaction-bar": "workspace:*",
100
130
  "@refraction-ui/react-resizable-layout": "workspace:*",
101
131
  "@refraction-ui/react-rich-editor": "workspace:*",
102
132
  "@refraction-ui/react-search-bar": "workspace:*",
133
+ "@refraction-ui/react-segmented-control": "workspace:*",
103
134
  "@refraction-ui/react-select": "workspace:*",
135
+ "@refraction-ui/react-separator": "workspace:*",
136
+ "@refraction-ui/react-sheet": "workspace:*",
104
137
  "@refraction-ui/react-sidebar": "workspace:*",
105
138
  "@refraction-ui/react-skeleton": "workspace:*",
139
+ "@refraction-ui/react-skip-to-content": "workspace:*",
106
140
  "@refraction-ui/react-slide-viewer": "workspace:*",
141
+ "@refraction-ui/react-slider": "workspace:*",
142
+ "@refraction-ui/react-social-auth-button": "workspace:*",
107
143
  "@refraction-ui/react-status-indicator": "workspace:*",
144
+ "@refraction-ui/react-steps": "workspace:*",
145
+ "@refraction-ui/react-sticky-note": "workspace:*",
108
146
  "@refraction-ui/react-switch": "workspace:*",
147
+ "@refraction-ui/react-table-of-contents": "workspace:*",
109
148
  "@refraction-ui/react-tabs": "workspace:*",
149
+ "@refraction-ui/react-terminal": "workspace:*",
150
+ "@refraction-ui/react-test-results": "workspace:*",
110
151
  "@refraction-ui/react-textarea": "workspace:*",
111
152
  "@refraction-ui/react-theme": "workspace:*",
112
153
  "@refraction-ui/react-thread-view": "workspace:*",
154
+ "@refraction-ui/react-timeline": "workspace:*",
113
155
  "@refraction-ui/react-toast": "workspace:*",
114
156
  "@refraction-ui/react-tooltip": "workspace:*",
115
157
  "@refraction-ui/react-version-selector": "workspace:*",
158
+ "@refraction-ui/react-video-grid": "workspace:*",
116
159
  "@refraction-ui/react-video-player": "workspace:*",
160
+ "@refraction-ui/react-video-tile": "workspace:*",
117
161
  "@refraction-ui/react-voice-pill": "workspace:*",
118
162
  "@refraction-ui/react-waveform": "workspace:*",
163
+ "@refraction-ui/react-wizard": "workspace:*",
119
164
  "@refraction-ui/shared": "workspace:*",
120
165
  "@types/react": "19.0.0",
121
166
  "@types/react-dom": "19.0.0",
122
167
  "react": "19.0.0",
123
- "react-dom": "19.0.0",
124
- "@refraction-ui/react-table-of-contents": "workspace:*",
125
- "@refraction-ui/react-carousel": "workspace:*",
126
- "@refraction-ui/react-slider": "workspace:*",
127
- "@refraction-ui/react-pagination": "workspace:*",
128
- "@refraction-ui/react-callout": "workspace:*",
129
- "@refraction-ui/react-steps": "workspace:*",
130
- "@refraction-ui/react-file-tree": "workspace:*",
131
- "@refraction-ui/react-icon-system": "workspace:*",
132
- "@refraction-ui/react-skip-to-content": "workspace:*",
133
- "@refraction-ui/react-code-block": "workspace:*",
134
- "@refraction-ui/react-link-card": "workspace:*",
135
- "@refraction-ui/react-card-grid": "workspace:*",
136
- "@refraction-ui/react-payment": "workspace:*",
137
- "@refraction-ui/react-command-input": "workspace:*",
138
- "@refraction-ui/react-sheet": "workspace:*",
139
- "@refraction-ui/react-logger": "workspace:*",
140
- "@refraction-ui/react-analytics": "workspace:*"
168
+ "react-dom": "19.0.0"
141
169
  },
142
170
  "publishConfig": {
143
171
  "access": "public"