/**
* Type definitions for the Progress component.
*
* @module @mks2508/mks-ui/react/ui/Progress/Progress.types
*/
import type { Progress as ProgressPrimitives } from '@base-ui/react/progress';
import type { IBaseConfig, SlotOverrides } from '../../../core/types';
import type { ICountingNumberProps } from '../../../react-ui/primitives/CountingNumber';
/**
* Available style slot names for the Progress component.
* Each slot maps to a visual region that can be customized via the `slots` prop.
*
* - `root` - The outer progress container
* - `track` - The background track bar
* - `indicator` - The filled indicator bar that animates to the current value
* - `label` - Optional label text (e.g., "Uploading...")
* - `value` - Optional animated numeric value display
*
* @example
* ```tsx
*
* ```
*/
export type ProgressSlot = 'root' | 'track' | 'indicator' | 'label' | 'value';
/**
* Internal context type for Progress state management.
* Shared between the Progress root and its child components via React context.
*/
export type ProgressContextType = {
/** Current progress value (0-100). */
value: number;
};
/**
* Configuration options for Progress behavior and animation.
* Extends the base config with progress-specific settings.
*
* @example
* ```tsx
*
* ```
*/
export interface IProgressConfig extends IBaseConfig {
/**
* Spring stiffness for the indicator animation.
* @defaultValue 100
*/
springStiffness?: number;
/**
* Spring damping for the indicator animation.
* @defaultValue 30
*/
springDamping?: number;
}
/**
* Props for the Progress root component.
* Wraps Base UI Progress.Root with context provider, slot overrides, and configuration.
*
* @example
* ```tsx
*
* ```
*/
export type IProgressProps = React.ComponentProps & {
/** Partial class overrides for each visual slot. */
slots?: SlotOverrides;
/** Behavioral and animation configuration. */
config?: IProgressConfig;
};
/**
* Props for the ProgressIndicator sub-component.
* Uses `motion.create` for spring-animated width transitions.
*
* @example
* ```tsx
*
* ```
*/
export type IProgressIndicatorProps = React.ComponentProps & React.ComponentProps<'div'> & {
/** Spring transition config for the indicator animation. */
transition?: {
type?: 'spring' | 'tween' | 'keyframes' | 'decay' | 'inertia';
stiffness?: number;
damping?: number;
[key: string]: unknown;
};
/** Partial class overrides for each visual slot. */
slots?: SlotOverrides;
};
/**
* Props for the ProgressTrack sub-component.
* Wraps Base UI Progress.Track with slot overrides.
*
* @example
* ```tsx
*
*
*
* ```
*/
export type IProgressTrackProps = React.ComponentProps & {
/** Partial class overrides for each visual slot. */
slots?: SlotOverrides;
};
/**
* Props for the ProgressLabel sub-component.
* Wraps Base UI Progress.Label with slot overrides.
*
* @example
* ```tsx
* Uploading files...
* ```
*/
export type IProgressLabelProps = React.ComponentProps & {
/** Partial class overrides for each visual slot. */
slots?: SlotOverrides;
};
/**
* Props for the ProgressValue sub-component.
* Combines Base UI Progress.Value with CountingNumber for animated numeric display.
*
* @example
* ```tsx
*
* ```
*/
export type IProgressValueProps = Omit, 'render'> & Omit & {
/** Partial class overrides for each visual slot. */
slots?: SlotOverrides;
};
//# sourceMappingURL=Progress.types.d.ts.map