@refraction-ui/react 0.12.3 → 0.13.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.
@@ -0,0 +1,39 @@
1
+ type EmptyStateTone = 'neutral' | 'success' | 'warning' | 'danger';
2
+ interface EmptyStateOptions {
3
+ /** Tone that tints the icon chip. Defaults to `neutral`. */
4
+ tone?: EmptyStateTone;
5
+ }
6
+ interface EmptyStateAPI {
7
+ /** Data attributes for CSS styling hooks. */
8
+ dataAttributes: Record<string, string>;
9
+ }
10
+ /**
11
+ * Headless EmptyState core — JSX-free. Resolves the tone into the data
12
+ * attributes that adapters spread onto the root element.
13
+ */
14
+ declare function createEmptyState(options?: EmptyStateOptions): EmptyStateAPI;
15
+
16
+ /**
17
+ * Container for the EmptyState column. The `bordered` variant wraps the
18
+ * content in a card surface.
19
+ */
20
+ declare const emptyStateVariants: (props?: ({
21
+ bordered?: "true" | "false" | undefined;
22
+ } & {
23
+ className?: string;
24
+ }) | undefined) => string;
25
+ /**
26
+ * Tone-tinted classes for the icon chip. Tone styling lives here as a single
27
+ * source of truth (no scattered inline literals in the adapters).
28
+ */
29
+ declare const emptyStateIconChipVariants: (props?: ({
30
+ tone?: "neutral" | "success" | "warning" | "danger" | undefined;
31
+ } & {
32
+ className?: string;
33
+ }) | undefined) => string;
34
+ /** Layout class helpers for the title/description/actions slots. */
35
+ declare const emptyStateTitleClass = "text-lg font-semibold text-foreground";
36
+ declare const emptyStateDescriptionClass = "text-sm text-muted-foreground";
37
+ declare const emptyStateActionsClass = "flex items-center justify-center gap-2";
38
+
39
+ export { type EmptyStateAPI, type EmptyStateOptions, type EmptyStateTone, createEmptyState, emptyStateActionsClass, emptyStateDescriptionClass, emptyStateIconChipVariants, emptyStateTitleClass, emptyStateVariants };
@@ -0,0 +1,39 @@
1
+ type EmptyStateTone = 'neutral' | 'success' | 'warning' | 'danger';
2
+ interface EmptyStateOptions {
3
+ /** Tone that tints the icon chip. Defaults to `neutral`. */
4
+ tone?: EmptyStateTone;
5
+ }
6
+ interface EmptyStateAPI {
7
+ /** Data attributes for CSS styling hooks. */
8
+ dataAttributes: Record<string, string>;
9
+ }
10
+ /**
11
+ * Headless EmptyState core — JSX-free. Resolves the tone into the data
12
+ * attributes that adapters spread onto the root element.
13
+ */
14
+ declare function createEmptyState(options?: EmptyStateOptions): EmptyStateAPI;
15
+
16
+ /**
17
+ * Container for the EmptyState column. The `bordered` variant wraps the
18
+ * content in a card surface.
19
+ */
20
+ declare const emptyStateVariants: (props?: ({
21
+ bordered?: "true" | "false" | undefined;
22
+ } & {
23
+ className?: string;
24
+ }) | undefined) => string;
25
+ /**
26
+ * Tone-tinted classes for the icon chip. Tone styling lives here as a single
27
+ * source of truth (no scattered inline literals in the adapters).
28
+ */
29
+ declare const emptyStateIconChipVariants: (props?: ({
30
+ tone?: "neutral" | "success" | "warning" | "danger" | undefined;
31
+ } & {
32
+ className?: string;
33
+ }) | undefined) => string;
34
+ /** Layout class helpers for the title/description/actions slots. */
35
+ declare const emptyStateTitleClass = "text-lg font-semibold text-foreground";
36
+ declare const emptyStateDescriptionClass = "text-sm text-muted-foreground";
37
+ declare const emptyStateActionsClass = "flex items-center justify-center gap-2";
38
+
39
+ export { type EmptyStateAPI, type EmptyStateOptions, type EmptyStateTone, createEmptyState, emptyStateActionsClass, emptyStateDescriptionClass, emptyStateIconChipVariants, emptyStateTitleClass, emptyStateVariants };
@@ -1,6 +1,8 @@
1
1
  import { AccessibilityProps } from '../shared/index.cjs';
2
2
 
3
3
  type InputType = 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search';
4
+ /** High-level validation affordance for an input. */
5
+ type InputValidationState = 'valid' | 'invalid';
4
6
  interface InputProps {
5
7
  type?: InputType;
6
8
  disabled?: boolean;
@@ -8,6 +10,14 @@ interface InputProps {
8
10
  required?: boolean;
9
11
  placeholder?: string;
10
12
  'aria-invalid'?: boolean;
13
+ /**
14
+ * Validation affordance. The core derives `aria-invalid` from this:
15
+ * - `'valid'` → `aria-invalid={false}`
16
+ * - `'invalid'` → `aria-invalid={true}`
17
+ *
18
+ * An explicit `aria-invalid` prop always takes precedence.
19
+ */
20
+ validationState?: InputValidationState;
11
21
  }
12
22
  interface InputAPI {
13
23
  /** ARIA attributes to spread on the element */
@@ -18,6 +28,13 @@ interface InputAPI {
18
28
  /** Data attributes for CSS styling hooks */
19
29
  dataAttributes: Record<string, string>;
20
30
  }
31
+ /**
32
+ * Resolve the effective `aria-invalid` value from an explicit `aria-invalid`
33
+ * prop and a high-level `validationState`. The explicit prop always wins;
34
+ * otherwise `validationState` maps `'invalid' → true`, `'valid' → false`, and
35
+ * an absent state leaves `aria-invalid` undefined (legacy behavior).
36
+ */
37
+ declare function resolveAriaInvalid(ariaInvalid: boolean | undefined, validationState: InputValidationState | undefined): boolean | undefined;
21
38
  declare function createInput(props?: InputProps): InputAPI;
22
39
  declare function getInputAriaProps(state: {
23
40
  disabled?: boolean;
@@ -31,8 +48,9 @@ declare function getInputAriaProps(state: {
31
48
 
32
49
  declare const inputVariants: (props?: ({
33
50
  size?: "sm" | "default" | "lg" | undefined;
51
+ validationState?: "valid" | "invalid" | undefined;
34
52
  } & {
35
53
  className?: string;
36
54
  }) | undefined) => string;
37
55
 
38
- export { type InputAPI, type InputProps, type InputType, createInput, getInputAriaProps, inputVariants };
56
+ export { type InputAPI, type InputProps, type InputType, type InputValidationState, createInput, getInputAriaProps, inputVariants, resolveAriaInvalid };
@@ -1,6 +1,8 @@
1
1
  import { AccessibilityProps } from '../shared/index.js';
2
2
 
3
3
  type InputType = 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search';
4
+ /** High-level validation affordance for an input. */
5
+ type InputValidationState = 'valid' | 'invalid';
4
6
  interface InputProps {
5
7
  type?: InputType;
6
8
  disabled?: boolean;
@@ -8,6 +10,14 @@ interface InputProps {
8
10
  required?: boolean;
9
11
  placeholder?: string;
10
12
  'aria-invalid'?: boolean;
13
+ /**
14
+ * Validation affordance. The core derives `aria-invalid` from this:
15
+ * - `'valid'` → `aria-invalid={false}`
16
+ * - `'invalid'` → `aria-invalid={true}`
17
+ *
18
+ * An explicit `aria-invalid` prop always takes precedence.
19
+ */
20
+ validationState?: InputValidationState;
11
21
  }
12
22
  interface InputAPI {
13
23
  /** ARIA attributes to spread on the element */
@@ -18,6 +28,13 @@ interface InputAPI {
18
28
  /** Data attributes for CSS styling hooks */
19
29
  dataAttributes: Record<string, string>;
20
30
  }
31
+ /**
32
+ * Resolve the effective `aria-invalid` value from an explicit `aria-invalid`
33
+ * prop and a high-level `validationState`. The explicit prop always wins;
34
+ * otherwise `validationState` maps `'invalid' → true`, `'valid' → false`, and
35
+ * an absent state leaves `aria-invalid` undefined (legacy behavior).
36
+ */
37
+ declare function resolveAriaInvalid(ariaInvalid: boolean | undefined, validationState: InputValidationState | undefined): boolean | undefined;
21
38
  declare function createInput(props?: InputProps): InputAPI;
22
39
  declare function getInputAriaProps(state: {
23
40
  disabled?: boolean;
@@ -31,8 +48,9 @@ declare function getInputAriaProps(state: {
31
48
 
32
49
  declare const inputVariants: (props?: ({
33
50
  size?: "sm" | "default" | "lg" | undefined;
51
+ validationState?: "valid" | "invalid" | undefined;
34
52
  } & {
35
53
  className?: string;
36
54
  }) | undefined) => string;
37
55
 
38
- export { type InputAPI, type InputProps, type InputType, createInput, getInputAriaProps, inputVariants };
56
+ export { type InputAPI, type InputProps, type InputType, type InputValidationState, createInput, getInputAriaProps, inputVariants, resolveAriaInvalid };
@@ -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 };
@@ -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.
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { InputValidationState } from '../input/index.js';
2
3
  export { InputType, inputVariants } from '../input/index.js';
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.
@@ -0,0 +1,26 @@
1
+ import * as React from 'react';
2
+ import { InputProps } from '../react-input/index.cjs';
3
+
4
+ interface PasswordInputProps extends Omit<InputProps, 'type' | 'leadingIcon'> {
5
+ /**
6
+ * Accessible label for the reveal (show password) action.
7
+ * @default 'Show password'
8
+ */
9
+ revealLabel?: string;
10
+ /**
11
+ * Accessible label for the hide action.
12
+ * @default 'Hide password'
13
+ */
14
+ hideLabel?: string;
15
+ }
16
+ /**
17
+ * PasswordInput — a password field with a built-in reveal/hide toggle.
18
+ *
19
+ * Wraps the styled {@link Input} from `@refraction-ui/react-input`, toggling
20
+ * the underlying input `type` between `'password'` and `'text'`. Forwards all
21
+ * Input props (`value`, `onChange`, `validationState`, `minLength`, …) through
22
+ * to the underlying element, including the `ref`.
23
+ */
24
+ declare const PasswordInput: React.ForwardRefExoticComponent<PasswordInputProps & React.RefAttributes<HTMLInputElement>>;
25
+
26
+ export { PasswordInput, type PasswordInputProps };
@@ -0,0 +1,26 @@
1
+ import * as React from 'react';
2
+ import { InputProps } from '../react-input/index.js';
3
+
4
+ interface PasswordInputProps extends Omit<InputProps, 'type' | 'leadingIcon'> {
5
+ /**
6
+ * Accessible label for the reveal (show password) action.
7
+ * @default 'Show password'
8
+ */
9
+ revealLabel?: string;
10
+ /**
11
+ * Accessible label for the hide action.
12
+ * @default 'Hide password'
13
+ */
14
+ hideLabel?: string;
15
+ }
16
+ /**
17
+ * PasswordInput — a password field with a built-in reveal/hide toggle.
18
+ *
19
+ * Wraps the styled {@link Input} from `@refraction-ui/react-input`, toggling
20
+ * the underlying input `type` between `'password'` and `'text'`. Forwards all
21
+ * Input props (`value`, `onChange`, `validationState`, `minLength`, …) through
22
+ * to the underlying element, including the `ref`.
23
+ */
24
+ declare const PasswordInput: React.ForwardRefExoticComponent<PasswordInputProps & React.RefAttributes<HTMLInputElement>>;
25
+
26
+ export { PasswordInput, type PasswordInputProps };
@@ -0,0 +1,38 @@
1
+ import * as React from 'react';
2
+ import { SegmentedControlSize } from '../segmented-control/index.cjs';
3
+ export { SegmentedControlSize, SegmentedControlValue, createSegmentedControl, getNextSegmentIndex, segmentedControlItemVariants, segmentedControlVariants } from '../segmented-control/index.cjs';
4
+
5
+ interface SegmentedControlProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
6
+ /** Controlled selected item value. */
7
+ value?: string;
8
+ /** Initial selected value for uncontrolled usage. */
9
+ defaultValue?: string;
10
+ /** Called with the newly selected item value. */
11
+ onValueChange?: (value: string) => void;
12
+ /** Visual size of the control. */
13
+ size?: SegmentedControlSize;
14
+ }
15
+ /**
16
+ * SegmentedControl — a pill-shaped single-select control with radio semantics.
17
+ *
18
+ * Renders `role="radiogroup"`; each {@link SegmentedControlItem} is a
19
+ * `role="radio"`. Supports controlled (`value`/`onValueChange`) and
20
+ * uncontrolled (`defaultValue`) usage, roving tabindex, arrow-key navigation
21
+ * with wrap, and Home/End jumps. Logic/styles come from the headless
22
+ * `@refraction-ui/segmented-control` core; styling via Tailwind utilities only.
23
+ */
24
+ declare const SegmentedControl: React.ForwardRefExoticComponent<SegmentedControlProps & React.RefAttributes<HTMLDivElement>>;
25
+ interface SegmentedControlItemProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value'> {
26
+ /** Value identifying this item; selected when it matches the group value. */
27
+ value: string;
28
+ }
29
+ /**
30
+ * SegmentedControlItem — a single selectable segment (`role="radio"`).
31
+ *
32
+ * Children may include a leading icon. Only the active item is tabbable
33
+ * (roving tabindex); arrow/Home/End keys delegate navigation to the group,
34
+ * which applies the shared `getNextSegmentIndex` rule from the core.
35
+ */
36
+ declare const SegmentedControlItem: React.ForwardRefExoticComponent<SegmentedControlItemProps & React.RefAttributes<HTMLButtonElement>>;
37
+
38
+ export { SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps };
@@ -0,0 +1,38 @@
1
+ import * as React from 'react';
2
+ import { SegmentedControlSize } from '../segmented-control/index.js';
3
+ export { SegmentedControlSize, SegmentedControlValue, createSegmentedControl, getNextSegmentIndex, segmentedControlItemVariants, segmentedControlVariants } from '../segmented-control/index.js';
4
+
5
+ interface SegmentedControlProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
6
+ /** Controlled selected item value. */
7
+ value?: string;
8
+ /** Initial selected value for uncontrolled usage. */
9
+ defaultValue?: string;
10
+ /** Called with the newly selected item value. */
11
+ onValueChange?: (value: string) => void;
12
+ /** Visual size of the control. */
13
+ size?: SegmentedControlSize;
14
+ }
15
+ /**
16
+ * SegmentedControl — a pill-shaped single-select control with radio semantics.
17
+ *
18
+ * Renders `role="radiogroup"`; each {@link SegmentedControlItem} is a
19
+ * `role="radio"`. Supports controlled (`value`/`onValueChange`) and
20
+ * uncontrolled (`defaultValue`) usage, roving tabindex, arrow-key navigation
21
+ * with wrap, and Home/End jumps. Logic/styles come from the headless
22
+ * `@refraction-ui/segmented-control` core; styling via Tailwind utilities only.
23
+ */
24
+ declare const SegmentedControl: React.ForwardRefExoticComponent<SegmentedControlProps & React.RefAttributes<HTMLDivElement>>;
25
+ interface SegmentedControlItemProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value'> {
26
+ /** Value identifying this item; selected when it matches the group value. */
27
+ value: string;
28
+ }
29
+ /**
30
+ * SegmentedControlItem — a single selectable segment (`role="radio"`).
31
+ *
32
+ * Children may include a leading icon. Only the active item is tabbable
33
+ * (roving tabindex); arrow/Home/End keys delegate navigation to the group,
34
+ * which applies the shared `getNextSegmentIndex` rule from the core.
35
+ */
36
+ declare const SegmentedControlItem: React.ForwardRefExoticComponent<SegmentedControlItemProps & React.RefAttributes<HTMLButtonElement>>;
37
+
38
+ export { SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps };
@@ -0,0 +1,29 @@
1
+ import * as React from 'react';
2
+ import { SeparatorOrientation } from '../separator/index.cjs';
3
+
4
+ interface SeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
5
+ /** Orientation of the separator. Defaults to `'horizontal'`. */
6
+ orientation?: SeparatorOrientation;
7
+ /**
8
+ * Optional centered label. Only meaningful for horizontal separators —
9
+ * renders a line on each side of the label (a "labeled divider").
10
+ */
11
+ label?: React.ReactNode;
12
+ /**
13
+ * When `true` (the default) the separator is purely visual and is hidden
14
+ * from assistive tech (`role="none"`). When `false` it is exposed as a
15
+ * semantic `role="separator"` with the appropriate `aria-orientation`.
16
+ */
17
+ decorative?: boolean;
18
+ }
19
+ /**
20
+ * Separator / LabeledDivider — a thin rule that visually divides content.
21
+ *
22
+ * Supports horizontal and vertical orientations and an optional centered
23
+ * label (the "labeled divider" variant, horizontal only). State and ARIA
24
+ * semantics come from the headless @refraction-ui/separator core; styling
25
+ * via Tailwind utility classes (no external CSS-in-JS).
26
+ */
27
+ declare const Separator: React.ForwardRefExoticComponent<SeparatorProps & React.RefAttributes<HTMLDivElement>>;
28
+
29
+ export { Separator, type SeparatorProps };
@@ -0,0 +1,29 @@
1
+ import * as React from 'react';
2
+ import { SeparatorOrientation } from '../separator/index.js';
3
+
4
+ interface SeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
5
+ /** Orientation of the separator. Defaults to `'horizontal'`. */
6
+ orientation?: SeparatorOrientation;
7
+ /**
8
+ * Optional centered label. Only meaningful for horizontal separators —
9
+ * renders a line on each side of the label (a "labeled divider").
10
+ */
11
+ label?: React.ReactNode;
12
+ /**
13
+ * When `true` (the default) the separator is purely visual and is hidden
14
+ * from assistive tech (`role="none"`). When `false` it is exposed as a
15
+ * semantic `role="separator"` with the appropriate `aria-orientation`.
16
+ */
17
+ decorative?: boolean;
18
+ }
19
+ /**
20
+ * Separator / LabeledDivider — a thin rule that visually divides content.
21
+ *
22
+ * Supports horizontal and vertical orientations and an optional centered
23
+ * label (the "labeled divider" variant, horizontal only). State and ARIA
24
+ * semantics come from the headless @refraction-ui/separator core; styling
25
+ * via Tailwind utility classes (no external CSS-in-JS).
26
+ */
27
+ declare const Separator: React.ForwardRefExoticComponent<SeparatorProps & React.RefAttributes<HTMLDivElement>>;
28
+
29
+ export { Separator, type SeparatorProps };
@@ -0,0 +1,31 @@
1
+ import * as React from 'react';
2
+ import { ButtonProps } from '../react-button/index.cjs';
3
+ import { SocialProvider } from '../social-auth-button/index.cjs';
4
+ export { SocialProvider } from '../social-auth-button/index.cjs';
5
+
6
+ interface SocialAuthButtonProps extends Omit<ButtonProps, 'variant' | 'children'> {
7
+ /** Identity provider this button authenticates against. */
8
+ provider: SocialProvider;
9
+ /** Marks this as the provider the user signed in with last. */
10
+ lastUsed?: boolean;
11
+ /** Shows a spinner and disables interaction. */
12
+ loading?: boolean;
13
+ }
14
+ /**
15
+ * A branded social sign-in button built on the outline Button. Renders the
16
+ * provider's brand icon and a "Continue with …" label, with optional loading
17
+ * and "Last used" affordances. Labels, the `data-provider` hook, and the
18
+ * monochrome decision come from the headless @refraction-ui/social-auth-button
19
+ * core; only the icon markup lives here.
20
+ */
21
+ declare const SocialAuthButton: React.ForwardRefExoticComponent<SocialAuthButtonProps & React.RefAttributes<HTMLButtonElement>>;
22
+ interface SocialAuthRowProps extends React.HTMLAttributes<HTMLDivElement> {
23
+ children?: React.ReactNode;
24
+ }
25
+ /**
26
+ * Responsive grid wrapper for SocialAuthButtons: one column on mobile, two
27
+ * columns from the `sm` breakpoint up.
28
+ */
29
+ declare const SocialAuthRow: React.ForwardRefExoticComponent<SocialAuthRowProps & React.RefAttributes<HTMLDivElement>>;
30
+
31
+ export { SocialAuthButton, type SocialAuthButtonProps, SocialAuthRow, type SocialAuthRowProps };
@@ -0,0 +1,31 @@
1
+ import * as React from 'react';
2
+ import { ButtonProps } from '../react-button/index.js';
3
+ import { SocialProvider } from '../social-auth-button/index.js';
4
+ export { SocialProvider } from '../social-auth-button/index.js';
5
+
6
+ interface SocialAuthButtonProps extends Omit<ButtonProps, 'variant' | 'children'> {
7
+ /** Identity provider this button authenticates against. */
8
+ provider: SocialProvider;
9
+ /** Marks this as the provider the user signed in with last. */
10
+ lastUsed?: boolean;
11
+ /** Shows a spinner and disables interaction. */
12
+ loading?: boolean;
13
+ }
14
+ /**
15
+ * A branded social sign-in button built on the outline Button. Renders the
16
+ * provider's brand icon and a "Continue with …" label, with optional loading
17
+ * and "Last used" affordances. Labels, the `data-provider` hook, and the
18
+ * monochrome decision come from the headless @refraction-ui/social-auth-button
19
+ * core; only the icon markup lives here.
20
+ */
21
+ declare const SocialAuthButton: React.ForwardRefExoticComponent<SocialAuthButtonProps & React.RefAttributes<HTMLButtonElement>>;
22
+ interface SocialAuthRowProps extends React.HTMLAttributes<HTMLDivElement> {
23
+ children?: React.ReactNode;
24
+ }
25
+ /**
26
+ * Responsive grid wrapper for SocialAuthButtons: one column on mobile, two
27
+ * columns from the `sm` breakpoint up.
28
+ */
29
+ declare const SocialAuthRow: React.ForwardRefExoticComponent<SocialAuthRowProps & React.RefAttributes<HTMLDivElement>>;
30
+
31
+ export { SocialAuthButton, type SocialAuthButtonProps, SocialAuthRow, type SocialAuthRowProps };
@@ -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 };