@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,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TimelineItemData, TimelineOrientation } from '../timeline/index.js';
|
|
3
|
+
export { TimelineItemData, TimelineItemStatus, TimelineOrientation } from '../timeline/index.js';
|
|
4
|
+
|
|
5
|
+
interface TimelineItemProps {
|
|
6
|
+
/** The normalised item data. */
|
|
7
|
+
item: Required<TimelineItemData>;
|
|
8
|
+
/** Orientation inherited from the parent Timeline. */
|
|
9
|
+
orientation: TimelineOrientation;
|
|
10
|
+
/** True when this is the last item (hides the trailing connector). */
|
|
11
|
+
isLast: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** A single event entry inside a Timeline. */
|
|
14
|
+
declare const TimelineItem: React.ForwardRefExoticComponent<TimelineItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
15
|
+
interface TimelineProps extends Omit<React.HTMLAttributes<HTMLUListElement>, 'children'> {
|
|
16
|
+
/** Ordered list of events to render. */
|
|
17
|
+
items: TimelineItemData[];
|
|
18
|
+
/** Layout direction. Defaults to `'vertical'`. */
|
|
19
|
+
orientation?: TimelineOrientation;
|
|
20
|
+
/**
|
|
21
|
+
* Optional render-prop override for a single item.
|
|
22
|
+
* Receives the normalised item and its index; return a React node.
|
|
23
|
+
*/
|
|
24
|
+
renderItem?: (item: Required<TimelineItemData>, index: number, isLast: boolean) => React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Timeline — a time-ordered list of events with a marker rail.
|
|
28
|
+
*
|
|
29
|
+
* Renders `role="list"`; each item carries `role="listitem"`.
|
|
30
|
+
* Supports vertical (default) and horizontal orientations.
|
|
31
|
+
* Pass `renderItem` to take full control of individual entries.
|
|
32
|
+
*/
|
|
33
|
+
declare const Timeline: React.ForwardRefExoticComponent<TimelineProps & React.RefAttributes<HTMLUListElement>>;
|
|
34
|
+
|
|
35
|
+
export { Timeline, TimelineItem, type TimelineItemProps, type TimelineProps };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { VideoGridLayout } from '../video-grid/index.js';
|
|
3
|
+
export { VideoGridLayout } from '../video-grid/index.js';
|
|
4
|
+
import { VideoTileData } from '../react-video-tile/index.js';
|
|
5
|
+
export { VideoTileData } from '../react-video-tile/index.js';
|
|
6
|
+
|
|
7
|
+
interface VideoGridProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color' | 'content'> {
|
|
8
|
+
/** List of participant data to render as tiles. */
|
|
9
|
+
participants: VideoTileData[];
|
|
10
|
+
/**
|
|
11
|
+
* Grid layout mode.
|
|
12
|
+
* - 'auto' — grid unless ≤1 participant (falls back to speaker)
|
|
13
|
+
* - 'grid' — always uniform CSS grid
|
|
14
|
+
* - 'speaker' — spotlight for `spotlightId` (or first participant) + filmstrip
|
|
15
|
+
*/
|
|
16
|
+
layout?: VideoGridLayout;
|
|
17
|
+
/**
|
|
18
|
+
* Participant `id` to spotlight in speaker view.
|
|
19
|
+
* Falls back to the first participant when omitted.
|
|
20
|
+
*/
|
|
21
|
+
spotlightId?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* VideoGrid — adaptive participant grid for easyloops meetings.
|
|
25
|
+
*
|
|
26
|
+
* Composes `<VideoTile>` tiles in a responsive CSS grid (1→6 columns based on
|
|
27
|
+
* participant count) or a speaker-view layout (spotlight + filmstrip). The
|
|
28
|
+
* column math lives in the headless `@refraction-ui/video-grid` core so it is
|
|
29
|
+
* shared with the Astro adapter.
|
|
30
|
+
*/
|
|
31
|
+
declare const VideoGrid: React.ForwardRefExoticComponent<VideoGridProps & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
|
|
33
|
+
export { VideoGrid, type VideoGridProps };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { VideoTileMicState } from '../video-tile/index.js';
|
|
3
|
+
export { VideoTileData, VideoTileMicState } from '../video-tile/index.js';
|
|
4
|
+
|
|
5
|
+
interface VideoTileProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'content' | 'color'> {
|
|
6
|
+
/** Participant display name — shown in the name chip and used for initials. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Current microphone state. Defaults to 'on'. */
|
|
9
|
+
micState?: VideoTileMicState;
|
|
10
|
+
/** Whether the participant is actively speaking. Adds an emerald ring. */
|
|
11
|
+
speaking?: boolean;
|
|
12
|
+
/** Whether the tile is pinned in the grid. Adds a primary ring. */
|
|
13
|
+
pinned?: boolean;
|
|
14
|
+
/** URL of the participant's avatar image, used in the fallback circle. */
|
|
15
|
+
avatarUrl?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Media slot — pass a `<video>` element (or any ReactNode) to render as the
|
|
18
|
+
* tile's background media layer. When omitted, an avatar fallback is shown.
|
|
19
|
+
*/
|
|
20
|
+
mediaSlot?: React.ReactNode;
|
|
21
|
+
/** Optional emoji/reaction badge rendered at the top-right of the tile. */
|
|
22
|
+
reaction?: React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* VideoTile — a single participant tile for a video meeting grid.
|
|
26
|
+
*
|
|
27
|
+
* Renders a `role="group"` container with an aspect-video aspect ratio.
|
|
28
|
+
* If a `mediaSlot` is provided it fills the tile; otherwise an avatar fallback
|
|
29
|
+
* with initials is centred on a muted background.
|
|
30
|
+
*
|
|
31
|
+
* Overlays:
|
|
32
|
+
* - Name chip (bottom-left) with optional mic-muted indicator
|
|
33
|
+
* - Speaking ring (emerald) when `speaking` is true
|
|
34
|
+
* - Pinned ring (primary) when `pinned` is true
|
|
35
|
+
* - Reaction badge (top-right) when `reaction` is provided
|
|
36
|
+
*
|
|
37
|
+
* Logic and styles come from the headless `@refraction-ui/video-tile` core.
|
|
38
|
+
*/
|
|
39
|
+
declare const VideoTile: React.ForwardRefExoticComponent<VideoTileProps & React.RefAttributes<HTMLDivElement>>;
|
|
40
|
+
|
|
41
|
+
export { VideoTile, type VideoTileProps };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { WizardStep, WizardOrientation } from '../wizard/index.js';
|
|
3
|
+
export { WizardOrientation, WizardStep } from '../wizard/index.js';
|
|
4
|
+
|
|
5
|
+
interface WizardContextValue {
|
|
6
|
+
currentIndex: number;
|
|
7
|
+
steps: WizardStep[];
|
|
8
|
+
orientation: WizardOrientation;
|
|
9
|
+
}
|
|
10
|
+
interface WizardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'children'> {
|
|
11
|
+
/** Step definitions for the rail. */
|
|
12
|
+
steps: WizardStep[];
|
|
13
|
+
/** Controlled current step index (0-based). */
|
|
14
|
+
step?: number;
|
|
15
|
+
/** Initial step index for uncontrolled usage. */
|
|
16
|
+
defaultStep?: number;
|
|
17
|
+
/** Called when the current step changes (Back/Next). */
|
|
18
|
+
onStepChange?: (index: number) => void;
|
|
19
|
+
/** Called when the user completes the final step. */
|
|
20
|
+
onComplete?: () => void;
|
|
21
|
+
/** Orientation of the step rail. Default `'vertical'`. */
|
|
22
|
+
orientation?: WizardOrientation;
|
|
23
|
+
/** Label for the Next button. */
|
|
24
|
+
nextLabel?: React.ReactNode;
|
|
25
|
+
/** Label for the Back button. */
|
|
26
|
+
backLabel?: React.ReactNode;
|
|
27
|
+
/** Label for the button on the final step. */
|
|
28
|
+
completeLabel?: React.ReactNode;
|
|
29
|
+
/** Label for the Skip button (shown on optional steps only). */
|
|
30
|
+
skipLabel?: React.ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* Content for the active step. Either pass a render prop that receives the
|
|
33
|
+
* current step index, or plain children shown for every step.
|
|
34
|
+
*/
|
|
35
|
+
children?: React.ReactNode | ((currentIndex: number) => React.ReactNode);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Wizard — a multi-step flow orchestration component.
|
|
39
|
+
*
|
|
40
|
+
* Renders a step rail (vertical by default) alongside the active step content
|
|
41
|
+
* and a footer with Back / Skip (optional steps) / Next-or-Complete actions.
|
|
42
|
+
* Supports controlled (`step` / `onStepChange`) and uncontrolled
|
|
43
|
+
* (`defaultStep`) usage. Logic and styles come from the headless
|
|
44
|
+
* `@refraction-ui/wizard` core.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* <Wizard steps={steps} onComplete={handleComplete}>
|
|
49
|
+
* {(index) => <StepContent stepIndex={index} />}
|
|
50
|
+
* </Wizard>
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
declare const Wizard: React.ForwardRefExoticComponent<WizardProps & React.RefAttributes<HTMLDivElement>>;
|
|
54
|
+
/**
|
|
55
|
+
* Access wizard state from within a child component rendered inside `<Wizard>`.
|
|
56
|
+
*/
|
|
57
|
+
declare function useWizard(): WizardContextValue;
|
|
58
|
+
|
|
59
|
+
export { Wizard, type WizardProps, useWizard };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { AccessibilityProps } from '../shared/index.cjs';
|
|
2
|
+
|
|
3
|
+
type SegmentedControlSize = 'sm' | 'md';
|
|
4
|
+
/** Value identifying a single segment. */
|
|
5
|
+
type SegmentedControlValue = string;
|
|
6
|
+
interface SegmentedControlProps {
|
|
7
|
+
/** Currently selected segment value (controlled). */
|
|
8
|
+
value?: SegmentedControlValue;
|
|
9
|
+
/** Visual size of the control. */
|
|
10
|
+
size?: SegmentedControlSize;
|
|
11
|
+
}
|
|
12
|
+
interface SegmentedControlAPI {
|
|
13
|
+
/** ARIA attributes to spread on the group element. */
|
|
14
|
+
ariaProps: Partial<AccessibilityProps>;
|
|
15
|
+
/** Data attributes for CSS styling hooks. */
|
|
16
|
+
dataAttributes: Record<string, string>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Build the framework-agnostic group props for a segmented control.
|
|
20
|
+
*
|
|
21
|
+
* Returns `role="radiogroup"` plus data attributes; adapters spread these
|
|
22
|
+
* onto their group element and handle their own rendering/state.
|
|
23
|
+
*/
|
|
24
|
+
declare function createSegmentedControl(props?: SegmentedControlProps): SegmentedControlAPI;
|
|
25
|
+
/**
|
|
26
|
+
* Pure keyboard-navigation rule shared by every adapter.
|
|
27
|
+
*
|
|
28
|
+
* Given the current index, the pressed key, and the item count, returns the
|
|
29
|
+
* index that focus/selection should move to. Arrow keys wrap; Home/End jump
|
|
30
|
+
* to the ends. Unhandled keys (or an empty group) return `current` unchanged.
|
|
31
|
+
*
|
|
32
|
+
* - ArrowRight / ArrowDown → next (wraps to 0 past the end)
|
|
33
|
+
* - ArrowLeft / ArrowUp → previous (wraps to last before 0)
|
|
34
|
+
* - Home → first
|
|
35
|
+
* - End → last
|
|
36
|
+
*/
|
|
37
|
+
declare function getNextSegmentIndex(current: number, key: string, count: number): number;
|
|
38
|
+
|
|
39
|
+
/** Pill-shaped container that holds the segments (`role="radiogroup"`). */
|
|
40
|
+
declare const segmentedControlVariants: (props?: ({
|
|
41
|
+
size?: "sm" | "md" | undefined;
|
|
42
|
+
} & {
|
|
43
|
+
className?: string;
|
|
44
|
+
}) | undefined) => string;
|
|
45
|
+
/**
|
|
46
|
+
* A single segment (`role="radio"`). The `state` variant carries the
|
|
47
|
+
* active vs inactive visual treatment so adapters never inline these classes.
|
|
48
|
+
*/
|
|
49
|
+
declare const segmentedControlItemVariants: (props?: ({
|
|
50
|
+
size?: "sm" | "md" | undefined;
|
|
51
|
+
state?: "checked" | "unchecked" | undefined;
|
|
52
|
+
} & {
|
|
53
|
+
className?: string;
|
|
54
|
+
}) | undefined) => string;
|
|
55
|
+
|
|
56
|
+
export { type SegmentedControlAPI, type SegmentedControlProps, type SegmentedControlSize, type SegmentedControlValue, createSegmentedControl, getNextSegmentIndex, segmentedControlItemVariants, segmentedControlVariants };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { AccessibilityProps } from '../shared/index.js';
|
|
2
|
+
|
|
3
|
+
type SegmentedControlSize = 'sm' | 'md';
|
|
4
|
+
/** Value identifying a single segment. */
|
|
5
|
+
type SegmentedControlValue = string;
|
|
6
|
+
interface SegmentedControlProps {
|
|
7
|
+
/** Currently selected segment value (controlled). */
|
|
8
|
+
value?: SegmentedControlValue;
|
|
9
|
+
/** Visual size of the control. */
|
|
10
|
+
size?: SegmentedControlSize;
|
|
11
|
+
}
|
|
12
|
+
interface SegmentedControlAPI {
|
|
13
|
+
/** ARIA attributes to spread on the group element. */
|
|
14
|
+
ariaProps: Partial<AccessibilityProps>;
|
|
15
|
+
/** Data attributes for CSS styling hooks. */
|
|
16
|
+
dataAttributes: Record<string, string>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Build the framework-agnostic group props for a segmented control.
|
|
20
|
+
*
|
|
21
|
+
* Returns `role="radiogroup"` plus data attributes; adapters spread these
|
|
22
|
+
* onto their group element and handle their own rendering/state.
|
|
23
|
+
*/
|
|
24
|
+
declare function createSegmentedControl(props?: SegmentedControlProps): SegmentedControlAPI;
|
|
25
|
+
/**
|
|
26
|
+
* Pure keyboard-navigation rule shared by every adapter.
|
|
27
|
+
*
|
|
28
|
+
* Given the current index, the pressed key, and the item count, returns the
|
|
29
|
+
* index that focus/selection should move to. Arrow keys wrap; Home/End jump
|
|
30
|
+
* to the ends. Unhandled keys (or an empty group) return `current` unchanged.
|
|
31
|
+
*
|
|
32
|
+
* - ArrowRight / ArrowDown → next (wraps to 0 past the end)
|
|
33
|
+
* - ArrowLeft / ArrowUp → previous (wraps to last before 0)
|
|
34
|
+
* - Home → first
|
|
35
|
+
* - End → last
|
|
36
|
+
*/
|
|
37
|
+
declare function getNextSegmentIndex(current: number, key: string, count: number): number;
|
|
38
|
+
|
|
39
|
+
/** Pill-shaped container that holds the segments (`role="radiogroup"`). */
|
|
40
|
+
declare const segmentedControlVariants: (props?: ({
|
|
41
|
+
size?: "sm" | "md" | undefined;
|
|
42
|
+
} & {
|
|
43
|
+
className?: string;
|
|
44
|
+
}) | undefined) => string;
|
|
45
|
+
/**
|
|
46
|
+
* A single segment (`role="radio"`). The `state` variant carries the
|
|
47
|
+
* active vs inactive visual treatment so adapters never inline these classes.
|
|
48
|
+
*/
|
|
49
|
+
declare const segmentedControlItemVariants: (props?: ({
|
|
50
|
+
size?: "sm" | "md" | undefined;
|
|
51
|
+
state?: "checked" | "unchecked" | undefined;
|
|
52
|
+
} & {
|
|
53
|
+
className?: string;
|
|
54
|
+
}) | undefined) => string;
|
|
55
|
+
|
|
56
|
+
export { type SegmentedControlAPI, type SegmentedControlProps, type SegmentedControlSize, type SegmentedControlValue, createSegmentedControl, getNextSegmentIndex, segmentedControlItemVariants, segmentedControlVariants };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { AccessibilityProps } from '../shared/index.cjs';
|
|
2
|
+
|
|
3
|
+
type SeparatorOrientation = 'horizontal' | 'vertical';
|
|
4
|
+
interface SeparatorProps {
|
|
5
|
+
/** Orientation of the separator. Defaults to `'horizontal'`. */
|
|
6
|
+
orientation?: SeparatorOrientation;
|
|
7
|
+
/**
|
|
8
|
+
* When `true` (the default) the separator is purely visual and is hidden
|
|
9
|
+
* from assistive tech (`role="none"`). When `false` it is exposed as a
|
|
10
|
+
* semantic `role="separator"` with the appropriate `aria-orientation`.
|
|
11
|
+
*/
|
|
12
|
+
decorative?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* ARIA attributes for a separator. Extends the shared base with
|
|
16
|
+
* `aria-orientation`, which is specific to the `separator` role.
|
|
17
|
+
*/
|
|
18
|
+
interface SeparatorAriaProps extends Partial<AccessibilityProps> {
|
|
19
|
+
'aria-orientation'?: SeparatorOrientation;
|
|
20
|
+
}
|
|
21
|
+
interface SeparatorAPI {
|
|
22
|
+
/** ARIA attributes to spread on the element. */
|
|
23
|
+
ariaProps: SeparatorAriaProps;
|
|
24
|
+
/** Data attributes for CSS styling hooks. */
|
|
25
|
+
dataAttributes: Record<string, string>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Headless separator core — computes ARIA semantics and data attributes for
|
|
29
|
+
* a separator rule. JSX-free so it can be shared across framework adapters.
|
|
30
|
+
*
|
|
31
|
+
* Per ARIA, a decorative separator must not be announced (`role="none"`),
|
|
32
|
+
* while a semantic one exposes `role="separator"` and `aria-orientation`.
|
|
33
|
+
*/
|
|
34
|
+
declare function createSeparator(props?: SeparatorProps): SeparatorAPI;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Visual variants for the separator rule.
|
|
38
|
+
*
|
|
39
|
+
* - `orientation: horizontal` → a full-width 1px line.
|
|
40
|
+
* - `orientation: vertical` → a full-height 1px line.
|
|
41
|
+
* - `labeled` → flex layout used by the labeled-divider variant, which
|
|
42
|
+
* arranges a centered label between two flanking lines.
|
|
43
|
+
*/
|
|
44
|
+
declare const separatorVariants: (props?: ({
|
|
45
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
46
|
+
labeled?: "true" | "false" | undefined;
|
|
47
|
+
} & {
|
|
48
|
+
className?: string;
|
|
49
|
+
}) | undefined) => string;
|
|
50
|
+
/** Class for each flanking line in the labeled-divider variant. */
|
|
51
|
+
declare const separatorLineClass = "h-px flex-1 bg-border";
|
|
52
|
+
/** Class for the centered label in the labeled-divider variant. */
|
|
53
|
+
declare const separatorLabelClass = "px-3 text-xs uppercase tracking-wide text-muted-foreground";
|
|
54
|
+
|
|
55
|
+
export { type SeparatorAPI, type SeparatorOrientation, type SeparatorProps, createSeparator, separatorLabelClass, separatorLineClass, separatorVariants };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { AccessibilityProps } from '../shared/index.js';
|
|
2
|
+
|
|
3
|
+
type SeparatorOrientation = 'horizontal' | 'vertical';
|
|
4
|
+
interface SeparatorProps {
|
|
5
|
+
/** Orientation of the separator. Defaults to `'horizontal'`. */
|
|
6
|
+
orientation?: SeparatorOrientation;
|
|
7
|
+
/**
|
|
8
|
+
* When `true` (the default) the separator is purely visual and is hidden
|
|
9
|
+
* from assistive tech (`role="none"`). When `false` it is exposed as a
|
|
10
|
+
* semantic `role="separator"` with the appropriate `aria-orientation`.
|
|
11
|
+
*/
|
|
12
|
+
decorative?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* ARIA attributes for a separator. Extends the shared base with
|
|
16
|
+
* `aria-orientation`, which is specific to the `separator` role.
|
|
17
|
+
*/
|
|
18
|
+
interface SeparatorAriaProps extends Partial<AccessibilityProps> {
|
|
19
|
+
'aria-orientation'?: SeparatorOrientation;
|
|
20
|
+
}
|
|
21
|
+
interface SeparatorAPI {
|
|
22
|
+
/** ARIA attributes to spread on the element. */
|
|
23
|
+
ariaProps: SeparatorAriaProps;
|
|
24
|
+
/** Data attributes for CSS styling hooks. */
|
|
25
|
+
dataAttributes: Record<string, string>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Headless separator core — computes ARIA semantics and data attributes for
|
|
29
|
+
* a separator rule. JSX-free so it can be shared across framework adapters.
|
|
30
|
+
*
|
|
31
|
+
* Per ARIA, a decorative separator must not be announced (`role="none"`),
|
|
32
|
+
* while a semantic one exposes `role="separator"` and `aria-orientation`.
|
|
33
|
+
*/
|
|
34
|
+
declare function createSeparator(props?: SeparatorProps): SeparatorAPI;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Visual variants for the separator rule.
|
|
38
|
+
*
|
|
39
|
+
* - `orientation: horizontal` → a full-width 1px line.
|
|
40
|
+
* - `orientation: vertical` → a full-height 1px line.
|
|
41
|
+
* - `labeled` → flex layout used by the labeled-divider variant, which
|
|
42
|
+
* arranges a centered label between two flanking lines.
|
|
43
|
+
*/
|
|
44
|
+
declare const separatorVariants: (props?: ({
|
|
45
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
46
|
+
labeled?: "true" | "false" | undefined;
|
|
47
|
+
} & {
|
|
48
|
+
className?: string;
|
|
49
|
+
}) | undefined) => string;
|
|
50
|
+
/** Class for each flanking line in the labeled-divider variant. */
|
|
51
|
+
declare const separatorLineClass = "h-px flex-1 bg-border";
|
|
52
|
+
/** Class for the centered label in the labeled-divider variant. */
|
|
53
|
+
declare const separatorLabelClass = "px-3 text-xs uppercase tracking-wide text-muted-foreground";
|
|
54
|
+
|
|
55
|
+
export { type SeparatorAPI, type SeparatorOrientation, type SeparatorProps, createSeparator, separatorLabelClass, separatorLineClass, separatorVariants };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
type SocialProvider = 'google' | 'github' | 'microsoft' | 'apple';
|
|
2
|
+
/** "Continue with …" label shown on each provider's button. */
|
|
3
|
+
declare const PROVIDER_LABELS: Record<SocialProvider, string>;
|
|
4
|
+
/**
|
|
5
|
+
* Which providers render their brand mark monochrome (currentColor). GitHub and
|
|
6
|
+
* Apple are monochrome by design so they read correctly on dark/outline
|
|
7
|
+
* surfaces; Google and Microsoft keep their full brand color.
|
|
8
|
+
*/
|
|
9
|
+
declare const PROVIDER_MONO: Record<SocialProvider, boolean>;
|
|
10
|
+
interface SocialAuthButtonProps {
|
|
11
|
+
/** Identity provider this button authenticates against. */
|
|
12
|
+
provider: SocialProvider;
|
|
13
|
+
}
|
|
14
|
+
interface SocialAuthButtonAPI {
|
|
15
|
+
/** Data attributes for CSS styling hooks. */
|
|
16
|
+
dataAttributes: Record<string, string>;
|
|
17
|
+
/** "Continue with …" label for the provider. */
|
|
18
|
+
label: string;
|
|
19
|
+
/** Whether the brand mark should render monochrome. */
|
|
20
|
+
mono: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Framework-agnostic core for a social sign-in button. Returns the provider
|
|
24
|
+
* label, monochrome hint, and the `data-provider` styling hook. No React/JSX.
|
|
25
|
+
*/
|
|
26
|
+
declare function createSocialAuthButton(props: SocialAuthButtonProps): SocialAuthButtonAPI;
|
|
27
|
+
|
|
28
|
+
/** Wrapper around an individual social auth button (positions the lastUsed badge). */
|
|
29
|
+
declare const socialAuthButtonVariants: (props?: ({
|
|
30
|
+
[x: string]: string | undefined;
|
|
31
|
+
} & {
|
|
32
|
+
className?: string;
|
|
33
|
+
}) | undefined) => string;
|
|
34
|
+
/** Responsive grid wrapper: one column on mobile, two columns from `sm` up. */
|
|
35
|
+
declare const socialAuthRowVariants: (props?: ({
|
|
36
|
+
[x: string]: string | undefined;
|
|
37
|
+
} & {
|
|
38
|
+
className?: string;
|
|
39
|
+
}) | undefined) => string;
|
|
40
|
+
/** Floating "Last used" badge anchored to the top-right of a button. */
|
|
41
|
+
declare const lastUsedBadgeVariants: (props?: ({
|
|
42
|
+
[x: string]: string | undefined;
|
|
43
|
+
} & {
|
|
44
|
+
className?: string;
|
|
45
|
+
}) | undefined) => string;
|
|
46
|
+
|
|
47
|
+
export { PROVIDER_LABELS, PROVIDER_MONO, type SocialAuthButtonAPI, type SocialAuthButtonProps, type SocialProvider, createSocialAuthButton, lastUsedBadgeVariants, socialAuthButtonVariants, socialAuthRowVariants };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
type SocialProvider = 'google' | 'github' | 'microsoft' | 'apple';
|
|
2
|
+
/** "Continue with …" label shown on each provider's button. */
|
|
3
|
+
declare const PROVIDER_LABELS: Record<SocialProvider, string>;
|
|
4
|
+
/**
|
|
5
|
+
* Which providers render their brand mark monochrome (currentColor). GitHub and
|
|
6
|
+
* Apple are monochrome by design so they read correctly on dark/outline
|
|
7
|
+
* surfaces; Google and Microsoft keep their full brand color.
|
|
8
|
+
*/
|
|
9
|
+
declare const PROVIDER_MONO: Record<SocialProvider, boolean>;
|
|
10
|
+
interface SocialAuthButtonProps {
|
|
11
|
+
/** Identity provider this button authenticates against. */
|
|
12
|
+
provider: SocialProvider;
|
|
13
|
+
}
|
|
14
|
+
interface SocialAuthButtonAPI {
|
|
15
|
+
/** Data attributes for CSS styling hooks. */
|
|
16
|
+
dataAttributes: Record<string, string>;
|
|
17
|
+
/** "Continue with …" label for the provider. */
|
|
18
|
+
label: string;
|
|
19
|
+
/** Whether the brand mark should render monochrome. */
|
|
20
|
+
mono: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Framework-agnostic core for a social sign-in button. Returns the provider
|
|
24
|
+
* label, monochrome hint, and the `data-provider` styling hook. No React/JSX.
|
|
25
|
+
*/
|
|
26
|
+
declare function createSocialAuthButton(props: SocialAuthButtonProps): SocialAuthButtonAPI;
|
|
27
|
+
|
|
28
|
+
/** Wrapper around an individual social auth button (positions the lastUsed badge). */
|
|
29
|
+
declare const socialAuthButtonVariants: (props?: ({
|
|
30
|
+
[x: string]: string | undefined;
|
|
31
|
+
} & {
|
|
32
|
+
className?: string;
|
|
33
|
+
}) | undefined) => string;
|
|
34
|
+
/** Responsive grid wrapper: one column on mobile, two columns from `sm` up. */
|
|
35
|
+
declare const socialAuthRowVariants: (props?: ({
|
|
36
|
+
[x: string]: string | undefined;
|
|
37
|
+
} & {
|
|
38
|
+
className?: string;
|
|
39
|
+
}) | undefined) => string;
|
|
40
|
+
/** Floating "Last used" badge anchored to the top-right of a button. */
|
|
41
|
+
declare const lastUsedBadgeVariants: (props?: ({
|
|
42
|
+
[x: string]: string | undefined;
|
|
43
|
+
} & {
|
|
44
|
+
className?: string;
|
|
45
|
+
}) | undefined) => string;
|
|
46
|
+
|
|
47
|
+
export { PROVIDER_LABELS, PROVIDER_MONO, type SocialAuthButtonAPI, type SocialAuthButtonProps, type SocialProvider, createSocialAuthButton, lastUsedBadgeVariants, socialAuthButtonVariants, socialAuthRowVariants };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** The available color variants for a sticky note. */
|
|
2
|
+
type StickyNoteColor = 'yellow' | 'pink' | 'blue' | 'green' | 'purple' | 'orange';
|
|
3
|
+
/** Ordered list of all sticky note colors — used for cycling and iteration. */
|
|
4
|
+
declare const STICKY_NOTE_COLORS: StickyNoteColor[];
|
|
5
|
+
/**
|
|
6
|
+
* Returns the next color in the cycle. Wraps from the last color back to the
|
|
7
|
+
* first. Useful for "add note" flows that auto-assign colors in sequence.
|
|
8
|
+
*/
|
|
9
|
+
declare function nextStickyColor(color: StickyNoteColor): StickyNoteColor;
|
|
10
|
+
interface CreateStickyNoteOptions {
|
|
11
|
+
/** Color of the note. */
|
|
12
|
+
color: StickyNoteColor;
|
|
13
|
+
}
|
|
14
|
+
interface StickyNoteAPI {
|
|
15
|
+
/** Data attributes for styling hooks; spread onto the note container. */
|
|
16
|
+
dataAttributes: {
|
|
17
|
+
'data-color': StickyNoteColor;
|
|
18
|
+
};
|
|
19
|
+
/** ARIA props for the note container. */
|
|
20
|
+
ariaProps: {
|
|
21
|
+
role: 'group';
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Build the framework-agnostic props for a sticky note container.
|
|
26
|
+
*
|
|
27
|
+
* Returns `role="group"` plus the `data-color` attribute that adapters use
|
|
28
|
+
* as a styling hook. Logic is pure and SSR-safe — no Math.random, no Date.
|
|
29
|
+
*/
|
|
30
|
+
declare function createStickyNote(options: CreateStickyNoteOptions): StickyNoteAPI;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Note container with color variant.
|
|
34
|
+
*
|
|
35
|
+
* Sticky notes are intrinsically colorful — an approved exception to the
|
|
36
|
+
* semantic-token-only rule. Each color maps to a soft tint background with a
|
|
37
|
+
* readable dark text.
|
|
38
|
+
*/
|
|
39
|
+
declare const stickyNoteVariants: (props?: ({
|
|
40
|
+
color?: "yellow" | "pink" | "blue" | "green" | "purple" | "orange" | undefined;
|
|
41
|
+
} & {
|
|
42
|
+
className?: string;
|
|
43
|
+
}) | undefined) => string;
|
|
44
|
+
/** Class for the editable/static text area inside the note. */
|
|
45
|
+
declare const stickyNoteTextClass = "flex-1 w-full resize-none bg-transparent text-sm leading-relaxed placeholder:opacity-60 outline-none";
|
|
46
|
+
/** Class for the author chip rendered in the note footer. */
|
|
47
|
+
declare const stickyNoteAuthorClass = "mt-auto text-xs font-medium opacity-70 truncate";
|
|
48
|
+
|
|
49
|
+
export { type CreateStickyNoteOptions, STICKY_NOTE_COLORS, type StickyNoteAPI, type StickyNoteColor, createStickyNote, nextStickyColor, stickyNoteAuthorClass, stickyNoteTextClass, stickyNoteVariants };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/** The semantic kind of a terminal output line. */
|
|
2
|
+
type TerminalLineKind = 'command' | 'stdout' | 'stderr' | 'info' | 'success';
|
|
3
|
+
/** A single line displayed in the terminal output panel. */
|
|
4
|
+
interface TerminalLine {
|
|
5
|
+
/** Optional stable key for list rendering. */
|
|
6
|
+
id?: string;
|
|
7
|
+
/** Semantic kind — drives styling and screen-reader announcements. */
|
|
8
|
+
kind: TerminalLineKind;
|
|
9
|
+
/** Text content of the line. */
|
|
10
|
+
text: string;
|
|
11
|
+
}
|
|
12
|
+
interface TerminalAPI {
|
|
13
|
+
/**
|
|
14
|
+
* ARIA attributes to spread on the terminal container element.
|
|
15
|
+
* - `role="log"` semantics: assistive technologies announce appended content.
|
|
16
|
+
* - `aria-live="polite"` so new output does not interrupt the user mid-action.
|
|
17
|
+
*/
|
|
18
|
+
ariaProps: {
|
|
19
|
+
role: 'log';
|
|
20
|
+
'aria-live': 'polite';
|
|
21
|
+
'aria-label'?: string;
|
|
22
|
+
};
|
|
23
|
+
/** Data attributes for styling hooks. */
|
|
24
|
+
dataAttributes: Record<string, string>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Build the prompt string shown before a command line.
|
|
28
|
+
*
|
|
29
|
+
* @param promptSymbol - The shell prompt character(s), e.g. `'$'` or `'❯'`.
|
|
30
|
+
* @param command - The command text that follows the prompt.
|
|
31
|
+
* @returns The formatted prompt string, e.g. `'$ python solution.py'`.
|
|
32
|
+
*/
|
|
33
|
+
declare function formatPrompt(promptSymbol: string, command: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Build the framework-agnostic ARIA and data props for a terminal output panel.
|
|
36
|
+
*
|
|
37
|
+
* Returns `role="log"` (live region semantics for streaming output) plus data
|
|
38
|
+
* attributes; adapters spread these onto their scroll container.
|
|
39
|
+
*/
|
|
40
|
+
declare function createTerminal(options?: {
|
|
41
|
+
label?: string;
|
|
42
|
+
}): TerminalAPI;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The outer scroll container — a dark monospaced surface that houses all
|
|
46
|
+
* terminal lines. Uses semantic card tokens so it inherits the active theme.
|
|
47
|
+
*/
|
|
48
|
+
declare const terminalVariants: (props?: ({
|
|
49
|
+
maxHeight?: "sm" | "md" | "lg" | "none" | undefined;
|
|
50
|
+
} & {
|
|
51
|
+
className?: string;
|
|
52
|
+
}) | undefined) => string;
|
|
53
|
+
/**
|
|
54
|
+
* A single terminal line. The `kind` variant maps each semantic category to
|
|
55
|
+
* the appropriate semantic token class — no raw color values inline.
|
|
56
|
+
*/
|
|
57
|
+
declare const terminalLineVariants: (props?: ({
|
|
58
|
+
kind?: "command" | "stdout" | "stderr" | "info" | "success" | undefined;
|
|
59
|
+
} & {
|
|
60
|
+
className?: string;
|
|
61
|
+
}) | undefined) => string;
|
|
62
|
+
/** The prompt symbol (`$`, `❯`, …) preceding a command line. */
|
|
63
|
+
declare const terminalPromptClass = "select-none mr-2 text-muted-foreground";
|
|
64
|
+
|
|
65
|
+
export { type TerminalAPI, type TerminalLine, type TerminalLineKind, createTerminal, formatPrompt, terminalLineVariants, terminalPromptClass, terminalVariants };
|