@mt-gloss/ui 0.0.7 → 0.0.9

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,43 @@
1
+ /** Props for the BarChartCard composite (wraps BarsVariant). */
2
+ export interface BarChartCardProps {
3
+ /** KPI label displayed in the card header */
4
+ label: string;
5
+ /** Primary metric value */
6
+ value?: number | string | null;
7
+ /** Bar chart data points */
8
+ barData: number[];
9
+ /** Optional value formatting */
10
+ format?: {
11
+ prefix?: string;
12
+ suffix?: string;
13
+ abbreviated?: boolean;
14
+ };
15
+ /** Trend direction and magnitude */
16
+ trend?: {
17
+ value: number;
18
+ direction: 'up' | 'down' | 'flat';
19
+ label?: string;
20
+ } | null;
21
+ /** Secondary descriptive text */
22
+ subtitle?: string;
23
+ /** Show as loading state */
24
+ loading?: boolean;
25
+ /** Show as error state */
26
+ error?: boolean;
27
+ /** Show as empty/no-data state */
28
+ empty?: boolean;
29
+ /** Whether data is stale (triggers blur animation) */
30
+ stale?: boolean;
31
+ /** Accent color for bars */
32
+ accentColor?: string;
33
+ /** Open detail graph view */
34
+ onDetails?: () => void;
35
+ /** Remove card from grid */
36
+ onRemove?: () => void;
37
+ /** Navigate to source data */
38
+ onNavigate?: () => void;
39
+ }
40
+ export declare const BarChartCard: {
41
+ (props: BarChartCardProps): import("react/jsx-runtime").JSX.Element;
42
+ displayName: string;
43
+ };
@@ -0,0 +1,46 @@
1
+ /** Props for the ComparisonCard composite (wraps VersusVariant). */
2
+ export interface ComparisonCardProps {
3
+ /** KPI label displayed in the card header */
4
+ label: string;
5
+ /** Primary metric value (optional since versus shows dual values) */
6
+ value?: number | string | null;
7
+ /** Comparison data with current and prior period values */
8
+ comparison: {
9
+ current: number | string;
10
+ prior: number | string;
11
+ currentLabel?: string;
12
+ priorLabel?: string;
13
+ };
14
+ /** Optional value formatting */
15
+ format?: {
16
+ prefix?: string;
17
+ suffix?: string;
18
+ abbreviated?: boolean;
19
+ };
20
+ /** Trend direction and magnitude */
21
+ trend?: {
22
+ value: number;
23
+ direction: 'up' | 'down' | 'flat';
24
+ label?: string;
25
+ } | null;
26
+ /** Secondary descriptive text */
27
+ subtitle?: string;
28
+ /** Show as loading state */
29
+ loading?: boolean;
30
+ /** Show as error state */
31
+ error?: boolean;
32
+ /** Show as empty/no-data state */
33
+ empty?: boolean;
34
+ /** Whether data is stale (triggers blur animation) */
35
+ stale?: boolean;
36
+ /** Open detail graph view */
37
+ onDetails?: () => void;
38
+ /** Remove card from grid */
39
+ onRemove?: () => void;
40
+ /** Navigate to source data */
41
+ onNavigate?: () => void;
42
+ }
43
+ export declare const ComparisonCard: {
44
+ (props: ComparisonCardProps): import("react/jsx-runtime").JSX.Element;
45
+ displayName: string;
46
+ };
@@ -0,0 +1,43 @@
1
+ /** Props for the DirectionCard composite (wraps ArrowVariant). */
2
+ export interface DirectionCardProps {
3
+ /** KPI label displayed in the card header */
4
+ label: string;
5
+ /** Primary metric value */
6
+ value?: number | string | null;
7
+ /** Arrow pointing direction */
8
+ direction: 'up' | 'down';
9
+ /** Arrow visual shape */
10
+ shape?: 'chevron' | 'triple' | 'bars';
11
+ /** Optional value formatting */
12
+ format?: {
13
+ prefix?: string;
14
+ suffix?: string;
15
+ abbreviated?: boolean;
16
+ };
17
+ /** Trend direction and magnitude */
18
+ trend?: {
19
+ value: number;
20
+ direction: 'up' | 'down' | 'flat';
21
+ label?: string;
22
+ } | null;
23
+ /** Secondary descriptive text */
24
+ subtitle?: string;
25
+ /** Show as loading state */
26
+ loading?: boolean;
27
+ /** Show as error state */
28
+ error?: boolean;
29
+ /** Show as empty/no-data state */
30
+ empty?: boolean;
31
+ /** Whether data is stale (triggers blur animation) */
32
+ stale?: boolean;
33
+ /** Open detail graph view */
34
+ onDetails?: () => void;
35
+ /** Remove card from grid */
36
+ onRemove?: () => void;
37
+ /** Navigate to source data */
38
+ onNavigate?: () => void;
39
+ }
40
+ export declare const DirectionCard: {
41
+ (props: DirectionCardProps): import("react/jsx-runtime").JSX.Element;
42
+ displayName: string;
43
+ };
@@ -0,0 +1,45 @@
1
+ /** Props for the DistributionCard composite (wraps DonutVariant). */
2
+ export interface DistributionCardProps {
3
+ /** KPI label displayed in the card header */
4
+ label: string;
5
+ /** Primary metric value */
6
+ value?: number | string | null;
7
+ /** Current donut value */
8
+ donutValue: number;
9
+ /** Maximum donut value (100% ring) */
10
+ donutMax?: number;
11
+ /** Optional value formatting */
12
+ format?: {
13
+ prefix?: string;
14
+ suffix?: string;
15
+ abbreviated?: boolean;
16
+ };
17
+ /** Trend direction and magnitude */
18
+ trend?: {
19
+ value: number;
20
+ direction: 'up' | 'down' | 'flat';
21
+ label?: string;
22
+ } | null;
23
+ /** Secondary descriptive text */
24
+ subtitle?: string;
25
+ /** Show as loading state */
26
+ loading?: boolean;
27
+ /** Show as error state */
28
+ error?: boolean;
29
+ /** Show as empty/no-data state */
30
+ empty?: boolean;
31
+ /** Whether data is stale (triggers blur animation) */
32
+ stale?: boolean;
33
+ /** Accent color for donut */
34
+ accentColor?: string;
35
+ /** Open detail graph view */
36
+ onDetails?: () => void;
37
+ /** Remove card from grid */
38
+ onRemove?: () => void;
39
+ /** Navigate to source data */
40
+ onNavigate?: () => void;
41
+ }
42
+ export declare const DistributionCard: {
43
+ (props: DistributionCardProps): import("react/jsx-runtime").JSX.Element;
44
+ displayName: string;
45
+ };
@@ -0,0 +1,41 @@
1
+ /** Props for the HighlightCard composite (wraps HighlightVariant). */
2
+ export interface HighlightCardProps {
3
+ /** KPI label displayed in the card header */
4
+ label: string;
5
+ /** Primary metric value */
6
+ value?: number | string | null;
7
+ /** Semantic highlight color (hex or CSS variable) */
8
+ highlightColor: string;
9
+ /** Optional value formatting */
10
+ format?: {
11
+ prefix?: string;
12
+ suffix?: string;
13
+ abbreviated?: boolean;
14
+ };
15
+ /** Trend direction and magnitude */
16
+ trend?: {
17
+ value: number;
18
+ direction: 'up' | 'down' | 'flat';
19
+ label?: string;
20
+ } | null;
21
+ /** Secondary descriptive text */
22
+ subtitle?: string;
23
+ /** Show as loading state */
24
+ loading?: boolean;
25
+ /** Show as error state */
26
+ error?: boolean;
27
+ /** Show as empty/no-data state */
28
+ empty?: boolean;
29
+ /** Whether data is stale (triggers blur animation) */
30
+ stale?: boolean;
31
+ /** Open detail graph view */
32
+ onDetails?: () => void;
33
+ /** Remove card from grid */
34
+ onRemove?: () => void;
35
+ /** Navigate to source data */
36
+ onNavigate?: () => void;
37
+ }
38
+ export declare const HighlightCard: {
39
+ (props: HighlightCardProps): import("react/jsx-runtime").JSX.Element;
40
+ displayName: string;
41
+ };
@@ -0,0 +1,43 @@
1
+ /** Props for the ProgressCard composite (wraps ObjectArrowVariant). */
2
+ export interface ProgressCardProps {
3
+ /** KPI label displayed in the card header */
4
+ label: string;
5
+ /** Primary metric value */
6
+ value?: number | string | null;
7
+ /** Current progress value */
8
+ progressValue: number;
9
+ /** Maximum progress value */
10
+ progressMax: number;
11
+ /** Optional value formatting */
12
+ format?: {
13
+ prefix?: string;
14
+ suffix?: string;
15
+ abbreviated?: boolean;
16
+ };
17
+ /** Trend direction and magnitude */
18
+ trend?: {
19
+ value: number;
20
+ direction: 'up' | 'down' | 'flat';
21
+ label?: string;
22
+ } | null;
23
+ /** Secondary descriptive text */
24
+ subtitle?: string;
25
+ /** Show as loading state */
26
+ loading?: boolean;
27
+ /** Show as error state */
28
+ error?: boolean;
29
+ /** Show as empty/no-data state */
30
+ empty?: boolean;
31
+ /** Whether data is stale (triggers blur animation) */
32
+ stale?: boolean;
33
+ /** Open detail graph view */
34
+ onDetails?: () => void;
35
+ /** Remove card from grid */
36
+ onRemove?: () => void;
37
+ /** Navigate to source data */
38
+ onNavigate?: () => void;
39
+ }
40
+ export declare const ProgressCard: {
41
+ (props: ProgressCardProps): import("react/jsx-runtime").JSX.Element;
42
+ displayName: string;
43
+ };
@@ -0,0 +1,45 @@
1
+ /** Props for the SegmentCard composite (wraps SegmentedVariant). */
2
+ export interface SegmentCardProps {
3
+ /** KPI label displayed in the card header */
4
+ label: string;
5
+ /** Primary metric value */
6
+ value?: number | string | null;
7
+ /** Segment data for segmented bar visualization */
8
+ segments: Array<{
9
+ value: number;
10
+ color: string;
11
+ label?: string;
12
+ }>;
13
+ /** Optional value formatting */
14
+ format?: {
15
+ prefix?: string;
16
+ suffix?: string;
17
+ abbreviated?: boolean;
18
+ };
19
+ /** Trend direction and magnitude */
20
+ trend?: {
21
+ value: number;
22
+ direction: 'up' | 'down' | 'flat';
23
+ label?: string;
24
+ } | null;
25
+ /** Secondary descriptive text */
26
+ subtitle?: string;
27
+ /** Show as loading state */
28
+ loading?: boolean;
29
+ /** Show as error state */
30
+ error?: boolean;
31
+ /** Show as empty/no-data state */
32
+ empty?: boolean;
33
+ /** Whether data is stale (triggers blur animation) */
34
+ stale?: boolean;
35
+ /** Open detail graph view */
36
+ onDetails?: () => void;
37
+ /** Remove card from grid */
38
+ onRemove?: () => void;
39
+ /** Navigate to source data */
40
+ onNavigate?: () => void;
41
+ }
42
+ export declare const SegmentCard: {
43
+ (props: SegmentCardProps): import("react/jsx-runtime").JSX.Element;
44
+ displayName: string;
45
+ };
@@ -0,0 +1,39 @@
1
+ /** Props for the SimpleMetricCard composite (wraps StandardVariant). */
2
+ export interface SimpleMetricCardProps {
3
+ /** KPI label displayed in the card header */
4
+ label: string;
5
+ /** Primary metric value */
6
+ value?: number | string | null;
7
+ /** Optional value formatting */
8
+ format?: {
9
+ prefix?: string;
10
+ suffix?: string;
11
+ abbreviated?: boolean;
12
+ };
13
+ /** Trend direction and magnitude */
14
+ trend?: {
15
+ value: number;
16
+ direction: 'up' | 'down' | 'flat';
17
+ label?: string;
18
+ } | null;
19
+ /** Secondary descriptive text */
20
+ subtitle?: string;
21
+ /** Show as loading state */
22
+ loading?: boolean;
23
+ /** Show as error state */
24
+ error?: boolean;
25
+ /** Show as empty/no-data state */
26
+ empty?: boolean;
27
+ /** Whether data is stale (triggers blur animation) */
28
+ stale?: boolean;
29
+ /** Open detail graph view */
30
+ onDetails?: () => void;
31
+ /** Remove card from grid */
32
+ onRemove?: () => void;
33
+ /** Navigate to source data */
34
+ onNavigate?: () => void;
35
+ }
36
+ export declare const SimpleMetricCard: {
37
+ (props: SimpleMetricCardProps): import("react/jsx-runtime").JSX.Element;
38
+ displayName: string;
39
+ };
@@ -0,0 +1,43 @@
1
+ /** Props for the TrendCard composite (wraps SparklineVariant). */
2
+ export interface TrendCardProps {
3
+ /** KPI label displayed in the card header */
4
+ label: string;
5
+ /** Primary metric value */
6
+ value?: number | string | null;
7
+ /** Sparkline data points for trend visualization */
8
+ trendData: number[];
9
+ /** Optional value formatting */
10
+ format?: {
11
+ prefix?: string;
12
+ suffix?: string;
13
+ abbreviated?: boolean;
14
+ };
15
+ /** Trend direction and magnitude */
16
+ trend?: {
17
+ value: number;
18
+ direction: 'up' | 'down' | 'flat';
19
+ label?: string;
20
+ } | null;
21
+ /** Secondary descriptive text */
22
+ subtitle?: string;
23
+ /** Show as loading state */
24
+ loading?: boolean;
25
+ /** Show as error state */
26
+ error?: boolean;
27
+ /** Show as empty/no-data state */
28
+ empty?: boolean;
29
+ /** Whether data is stale (triggers blur animation) */
30
+ stale?: boolean;
31
+ /** Accent color for sparkline */
32
+ accentColor?: string;
33
+ /** Open detail graph view */
34
+ onDetails?: () => void;
35
+ /** Remove card from grid */
36
+ onRemove?: () => void;
37
+ /** Navigate to source data */
38
+ onNavigate?: () => void;
39
+ }
40
+ export declare const TrendCard: {
41
+ (props: TrendCardProps): import("react/jsx-runtime").JSX.Element;
42
+ displayName: string;
43
+ };
@@ -0,0 +1,18 @@
1
+ export { TrendCard } from './TrendCard';
2
+ export type { TrendCardProps } from './TrendCard';
3
+ export { BarChartCard } from './BarChartCard';
4
+ export type { BarChartCardProps } from './BarChartCard';
5
+ export { DistributionCard } from './DistributionCard';
6
+ export type { DistributionCardProps } from './DistributionCard';
7
+ export { HighlightCard } from './HighlightCard';
8
+ export type { HighlightCardProps } from './HighlightCard';
9
+ export { DirectionCard } from './DirectionCard';
10
+ export type { DirectionCardProps } from './DirectionCard';
11
+ export { ProgressCard } from './ProgressCard';
12
+ export type { ProgressCardProps } from './ProgressCard';
13
+ export { ComparisonCard } from './ComparisonCard';
14
+ export type { ComparisonCardProps } from './ComparisonCard';
15
+ export { SegmentCard } from './SegmentCard';
16
+ export type { SegmentCardProps } from './SegmentCard';
17
+ export { SimpleMetricCard } from './SimpleMetricCard';
18
+ export type { SimpleMetricCardProps } from './SimpleMetricCard';
@@ -1,5 +1,4 @@
1
1
  import { default as React } from 'react';
2
- import { InputProps } from '../../primitives/Input';
3
2
  export interface PasswordStrengthRule {
4
3
  /**
5
4
  * Unique identifier for the rule
@@ -15,45 +14,50 @@ export interface PasswordStrengthRule {
15
14
  validate: (password: string) => boolean;
16
15
  }
17
16
  export type PasswordStrength = 'weak' | 'fair' | 'good' | 'strong';
18
- export interface PasswordInputProps extends Omit<InputProps, 'type' | 'rightIcon'> {
19
- /**
20
- * Whether to show the visibility toggle button
21
- * @default true
22
- */
17
+ export interface PasswordInputProps {
18
+ /** Current password value */
19
+ value?: string;
20
+ /** Default password value (uncontrolled) */
21
+ defaultValue?: string;
22
+ /** Change handler */
23
+ onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
24
+ /** Blur handler */
25
+ onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
26
+ /** Field label */
27
+ label?: string;
28
+ /** Placeholder text */
29
+ placeholder?: string;
30
+ /** Validation status */
31
+ status?: 'default' | 'success' | 'error' | 'pending';
32
+ /** Helper/error text below field */
33
+ helperText?: string;
34
+ /** Required field indicator */
35
+ required?: boolean;
36
+ /** Disabled state */
37
+ disabled?: boolean;
38
+ /** Input name attribute */
39
+ name?: string;
40
+ /** Input id attribute */
41
+ id?: string;
42
+ /** CSS class name */
43
+ className?: string;
44
+ /** Auto-complete hint */
45
+ autoComplete?: string;
46
+ /** Whether to show the visibility toggle button @default true */
23
47
  showToggle?: boolean;
24
- /**
25
- * Whether to show the password strength indicator
26
- * @default false
27
- */
48
+ /** Whether to show the password strength indicator @default false */
28
49
  showStrength?: boolean;
29
- /**
30
- * Pre-calculated password strength (if you want to control it externally)
31
- */
50
+ /** Pre-calculated password strength (if you want to control it externally) */
32
51
  strength?: PasswordStrength;
33
- /**
34
- * Custom strength calculation rules
35
- * If not provided, uses default rules
36
- */
52
+ /** Custom strength calculation rules. If not provided, uses default rules */
37
53
  strengthRules?: PasswordStrengthRule[];
38
- /**
39
- * Whether to show a generate password button
40
- * @default false
41
- */
54
+ /** Whether to show a generate password button @default false */
42
55
  showGenerate?: boolean;
43
- /**
44
- * Callback when generate button is clicked
45
- * If not provided, uses built-in generator
46
- */
56
+ /** Callback when generate button is clicked. If not provided, uses built-in generator */
47
57
  onGenerate?: (password: string) => void;
48
- /**
49
- * Length of generated password
50
- * @default 16
51
- */
58
+ /** Length of generated password @default 16 */
52
59
  generateLength?: number;
53
- /**
54
- * Whether to show rule checklist
55
- * @default false
56
- */
60
+ /** Whether to show rule checklist @default false */
57
61
  showRules?: boolean;
58
62
  }
59
63
  /**
@@ -1,5 +1,4 @@
1
1
  import { default as React } from 'react';
2
- import { InputProps } from '../../primitives/Input';
3
2
  export interface Country {
4
3
  /**
5
4
  * ISO 3166-1 alpha-2 country code
@@ -19,39 +18,38 @@ export interface Country {
19
18
  */
20
19
  format?: string;
21
20
  }
22
- export interface PhoneInputProps extends Omit<InputProps, 'value' | 'onChange' | 'type' | 'leftIcon'> {
23
- /**
24
- * Current value in E.164 format (e.g., +14155551234)
25
- */
21
+ export interface PhoneInputProps {
22
+ /** Current value in E.164 format (e.g., +14155551234) */
26
23
  value?: string;
27
- /**
28
- * Default value
29
- */
24
+ /** Default value */
30
25
  defaultValue?: string;
31
- /**
32
- * Callback when value changes
33
- * Returns E.164 formatted value
34
- */
26
+ /** Callback when value changes. Returns E.164 formatted value */
35
27
  onChange?: (value: string) => void;
36
- /**
37
- * Default selected country code
38
- * @default 'US'
39
- */
28
+ /** Field label */
29
+ label?: string;
30
+ /** Placeholder text */
31
+ placeholder?: string;
32
+ /** Validation status */
33
+ status?: 'default' | 'success' | 'error' | 'pending';
34
+ /** Helper/error text below field */
35
+ helperText?: string;
36
+ /** Required field indicator */
37
+ required?: boolean;
38
+ /** Disabled state */
39
+ disabled?: boolean;
40
+ /** Input name attribute */
41
+ name?: string;
42
+ /** Input id attribute */
43
+ id?: string;
44
+ /** CSS class name */
45
+ className?: string;
46
+ /** Default selected country code @default 'US' */
40
47
  defaultCountry?: string;
41
- /**
42
- * List of countries to show in selector
43
- * Uses default list if not provided
44
- */
48
+ /** List of countries to show in selector. Uses default list if not provided */
45
49
  countries?: Country[];
46
- /**
47
- * Whether to show country selector
48
- * @default true
49
- */
50
+ /** Whether to show country selector @default true */
50
51
  showCountrySelect?: boolean;
51
- /**
52
- * Format for display
53
- * @default 'national'
54
- */
52
+ /** Format for display @default 'national' */
55
53
  format?: 'national' | 'international';
56
54
  }
57
55
  /**
@@ -1,5 +1,4 @@
1
1
  import { default as React } from 'react';
2
- import { InputProps } from '../../primitives/Input';
3
2
  export interface SearchSuggestion {
4
3
  /**
5
4
  * Unique identifier for the suggestion
@@ -18,46 +17,56 @@ export interface SearchSuggestion {
18
17
  */
19
18
  icon?: string;
20
19
  }
21
- export interface SearchInputProps extends Omit<InputProps, 'leftIcon' | 'rightIcon' | 'clearable'> {
22
- /**
23
- * Callback when search is triggered (Enter key or search button)
24
- */
20
+ export interface SearchInputProps {
21
+ /** Current search value */
22
+ value?: string;
23
+ /** Default search value (uncontrolled) */
24
+ defaultValue?: string;
25
+ /** Change handler */
26
+ onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
27
+ /** Key down handler */
28
+ onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
29
+ /** Focus handler */
30
+ onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
31
+ /** Blur handler */
32
+ onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
33
+ /** Field label */
34
+ label?: string;
35
+ /** Placeholder text @default 'Search...' */
36
+ placeholder?: string;
37
+ /** Validation status */
38
+ status?: 'default' | 'success' | 'error' | 'pending';
39
+ /** Helper/error text below field */
40
+ helperText?: string;
41
+ /** Required field indicator */
42
+ required?: boolean;
43
+ /** Disabled state */
44
+ disabled?: boolean;
45
+ /** Input name attribute */
46
+ name?: string;
47
+ /** Input id attribute */
48
+ id?: string;
49
+ /** CSS class name */
50
+ className?: string;
51
+ /** Auto-complete hint */
52
+ autoComplete?: string;
53
+ /** Callback when search is triggered (Enter key or search button) */
25
54
  onSearch?: (value: string) => void;
26
- /**
27
- * Debounce delay in milliseconds for onChange
28
- * @default 0
29
- */
55
+ /** Debounce delay in milliseconds for onChange @default 0 */
30
56
  debounce?: number;
31
- /**
32
- * Whether a search is currently in progress
33
- */
57
+ /** Whether a search is currently in progress */
34
58
  isSearching?: boolean;
35
- /**
36
- * List of suggestions to display in dropdown
37
- */
59
+ /** List of suggestions to display in dropdown */
38
60
  suggestions?: SearchSuggestion[];
39
- /**
40
- * Callback when a suggestion is selected
41
- */
61
+ /** Callback when a suggestion is selected */
42
62
  onSuggestionSelect?: (suggestion: SearchSuggestion) => void;
43
- /**
44
- * Whether to show suggestions dropdown
45
- * @default false
46
- */
63
+ /** Whether to show suggestions dropdown @default false */
47
64
  showSuggestions?: boolean;
48
- /**
49
- * Show keyboard shortcut hint (e.g., Cmd+K)
50
- */
65
+ /** Show keyboard shortcut hint (e.g., Cmd+K) */
51
66
  showShortcut?: boolean;
52
- /**
53
- * Keyboard shortcut key (works with Cmd/Ctrl)
54
- * @default 'k'
55
- */
67
+ /** Keyboard shortcut key (works with Cmd/Ctrl) @default 'k' */
56
68
  shortcutKey?: string;
57
- /**
58
- * Whether the search input should always show clear button when has value
59
- * @default true
60
- */
69
+ /** Whether the search input should always show clear button when has value @default true */
61
70
  clearable?: boolean;
62
71
  }
63
72
  /**
@@ -1 +1,2 @@
1
+ export * from './cards';
1
2
  export * from './forms';