@mt-gloss/ui 0.0.2
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/README.md +33 -0
- package/index.css +1 -0
- package/index.d.ts +80 -0
- package/index.js +17560 -0
- package/lib/Accordion.d.ts +103 -0
- package/lib/AsyncLoader.d.ts +41 -0
- package/lib/Badge.d.ts +42 -0
- package/lib/Button.d.ts +73 -0
- package/lib/ButtonGroup.d.ts +72 -0
- package/lib/Card.d.ts +140 -0
- package/lib/Checkbox.d.ts +70 -0
- package/lib/CheckboxGroup.d.ts +162 -0
- package/lib/Chip.d.ts +68 -0
- package/lib/ColorPicker.d.ts +82 -0
- package/lib/DatePicker.d.ts +102 -0
- package/lib/DateRangePicker.d.ts +109 -0
- package/lib/Dropdown.d.ts +65 -0
- package/lib/FileUpload.d.ts +109 -0
- package/lib/Form.d.ts +119 -0
- package/lib/FormField.d.ts +69 -0
- package/lib/Input.d.ts +89 -0
- package/lib/InputGroup.d.ts +59 -0
- package/lib/Link.d.ts +69 -0
- package/lib/MaskedInput.d.ts +95 -0
- package/lib/Menu.d.ts +132 -0
- package/lib/NumberInput.d.ts +81 -0
- package/lib/Radio.d.ts +60 -0
- package/lib/RadioGroup.d.ts +163 -0
- package/lib/RangeSlider.d.ts +105 -0
- package/lib/Rating.d.ts +115 -0
- package/lib/SegmentedControl.d.ts +96 -0
- package/lib/Select.d.ts +205 -0
- package/lib/Slider.d.ts +111 -0
- package/lib/SplitButton.d.ts +84 -0
- package/lib/Textarea.d.ts +59 -0
- package/lib/TimePicker.d.ts +93 -0
- package/lib/Toggle.d.ts +68 -0
- package/lib/Tooltip.d.ts +89 -0
- package/lib/Transition.d.ts +107 -0
- package/lib/composed/AddressSelect.d.ts +132 -0
- package/lib/composed/PasswordInput.d.ts +75 -0
- package/lib/composed/PaymentMethodSelect.d.ts +96 -0
- package/lib/composed/PhoneInput.d.ts +71 -0
- package/lib/composed/SearchInput.d.ts +80 -0
- package/lib/composed/TagInput.d.ts +98 -0
- package/lib/composed/index.d.ts +12 -0
- package/lib/dashboard/ChartControlBar/ChartControlBar.d.ts +45 -0
- package/lib/dashboard/ChartControlBar/FilterInput.d.ts +34 -0
- package/lib/dashboard/ChartControlBar/FusedShape.d.ts +32 -0
- package/lib/dashboard/ChartControlBar/Row1Controls.d.ts +62 -0
- package/lib/dashboard/ChartControlBar/Row2FilterTray.d.ts +62 -0
- package/lib/dashboard/ChartControlBar/fixtures/controlBarStates.d.ts +4 -0
- package/lib/dashboard/ChartControlBar/index.d.ts +8 -0
- package/lib/dashboard/ChartControlBar/types.d.ts +37 -0
- package/lib/dashboard/ChartControlBar/useFilterLayout.d.ts +51 -0
- package/lib/dashboard/FilterChip/FilterChip.d.ts +26 -0
- package/lib/dashboard/FilterChip/fixtures/filterChips.d.ts +11 -0
- package/lib/dashboard/FilterChip/index.d.ts +3 -0
- package/lib/dashboard/FilterChip/types.d.ts +17 -0
- package/lib/dashboard/MetricCard/CardShell.d.ts +22 -0
- package/lib/dashboard/MetricCard/GutterActions.d.ts +56 -0
- package/lib/dashboard/MetricCard/MetricCard.d.ts +33 -0
- package/lib/dashboard/MetricCard/StackedGroupCard.d.ts +43 -0
- package/lib/dashboard/MetricCard/TrendIndicator.d.ts +20 -0
- package/lib/dashboard/MetricCard/fixtures/allVariants.d.ts +6 -0
- package/lib/dashboard/MetricCard/fixtures/sparklineCard.d.ts +5 -0
- package/lib/dashboard/MetricCard/fixtures/standardCard.d.ts +7 -0
- package/lib/dashboard/MetricCard/fixtures/states.d.ts +19 -0
- package/lib/dashboard/MetricCard/index.d.ts +20 -0
- package/lib/dashboard/MetricCard/types.d.ts +109 -0
- package/lib/dashboard/MetricCard/useSlideOutReveal.d.ts +42 -0
- package/lib/dashboard/MetricCard/utils/formatTrend.d.ts +2 -0
- package/lib/dashboard/MetricCard/utils/formatValue.d.ts +2 -0
- package/lib/dashboard/MetricCard/visualizations/BarsBg.d.ts +25 -0
- package/lib/dashboard/MetricCard/visualizations/DonutChart.d.ts +26 -0
- package/lib/dashboard/MetricCard/visualizations/ObjectArrow.d.ts +28 -0
- package/lib/dashboard/MetricCard/visualizations/SparklineBg.d.ts +24 -0
- package/lib/dashboard/MetricCardGrid/MetricCardGrid.d.ts +28 -0
- package/lib/dashboard/MetricCardGrid/fixtures/gridCards.d.ts +3 -0
- package/lib/dashboard/MetricCardGrid/fixtures/layouts.d.ts +7 -0
- package/lib/dashboard/MetricCardGrid/index.d.ts +4 -0
- package/lib/dashboard/MetricCardGrid/types.d.ts +28 -0
- package/lib/dashboard/Skeleton/Skeleton.d.ts +25 -0
- package/lib/dashboard/Skeleton/SkeletonCard.d.ts +20 -0
- package/lib/dashboard/Skeleton/SkeletonChart.d.ts +18 -0
- package/lib/dashboard/Skeleton/SkeletonTable.d.ts +18 -0
- package/lib/dashboard/Skeleton/fixtures/skeletonSamples.d.ts +7 -0
- package/lib/dashboard/Skeleton/index.d.ts +6 -0
- package/lib/dashboard/Skeleton/types.d.ts +55 -0
- package/lib/dashboard/TabGroup/TabGroup.d.ts +27 -0
- package/lib/dashboard/TabGroup/fixtures/tabGroups.d.ts +7 -0
- package/lib/dashboard/TabGroup/index.d.ts +3 -0
- package/lib/dashboard/TabGroup/types.d.ts +22 -0
- package/lib/dashboard/TabbedDataView/TabbedDataView.d.ts +29 -0
- package/lib/dashboard/TabbedDataView/fixtures/tabConfigs.d.ts +9 -0
- package/lib/dashboard/TabbedDataView/index.d.ts +3 -0
- package/lib/dashboard/TabbedDataView/types.d.ts +20 -0
- package/lib/dashboard/TimeFrame/ExpandableChip.d.ts +22 -0
- package/lib/dashboard/TimeFrame/HybridDatePicker.d.ts +24 -0
- package/lib/dashboard/TimeFrame/MarketPresetRow.d.ts +16 -0
- package/lib/dashboard/TimeFrame/MiniCalendar.d.ts +16 -0
- package/lib/dashboard/TimeFrame/TimeFrame.d.ts +21 -0
- package/lib/dashboard/TimeFrame/fixtures/timeFrameSamples.d.ts +17 -0
- package/lib/dashboard/TimeFrame/index.d.ts +14 -0
- package/lib/dashboard/TimeFrame/types.d.ts +202 -0
- package/lib/dashboard/TimeFrame/utils/dateHelpers.d.ts +1 -0
- package/lib/dashboard/TimeFrame/utils/presets.d.ts +1 -0
- package/lib/dashboard/TimeFrame/utils/smartDateFormat.d.ts +1 -0
- package/lib/dashboard/UnifiedBreakdownTable/UnifiedBreakdownTable.d.ts +24 -0
- package/lib/dashboard/UnifiedBreakdownTable/fixtures/columns.d.ts +5 -0
- package/lib/dashboard/UnifiedBreakdownTable/fixtures/itemRows.d.ts +15 -0
- package/lib/dashboard/UnifiedBreakdownTable/fixtures/orderRows.d.ts +15 -0
- package/lib/dashboard/UnifiedBreakdownTable/index.d.ts +7 -0
- package/lib/dashboard/UnifiedBreakdownTable/types.d.ts +61 -0
- package/lib/dashboard/UnifiedContextMenu/UnifiedContextMenu.d.ts +5 -0
- package/lib/dashboard/UnifiedContextMenu/fixtures/menuActions.d.ts +9 -0
- package/lib/dashboard/UnifiedContextMenu/index.d.ts +3 -0
- package/lib/dashboard/UnifiedContextMenu/types.d.ts +130 -0
- package/lib/dashboard/index.d.ts +10 -0
- package/lib/hooks/index.d.ts +3 -0
- package/lib/hooks/useArrowNavigation.d.ts +106 -0
- package/lib/hooks/useFocusReturn.d.ts +26 -0
- package/lib/hooks/useFocusTrap.d.ts +50 -0
- package/lib/patterns/feedback/DestructiveModal.d.ts +31 -0
- package/lib/patterns/feedback/index.d.ts +1 -0
- package/lib/patterns/forms/AddressGroup.d.ts +37 -0
- package/lib/patterns/forms/CreditCardForm.d.ts +41 -0
- package/lib/patterns/forms/LoginForm.d.ts +38 -0
- package/lib/patterns/forms/index.d.ts +3 -0
- package/lib/patterns/index.d.ts +14 -0
- package/lib/patterns/types.d.ts +63 -0
- package/lib/types/icon.d.ts +27 -0
- package/lib/utils/animations.d.ts +60 -0
- package/lib/utils/renderIcon.d.ts +21 -0
- package/package.json +59 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AnimationPresetName } from './utils/animations';
|
|
3
|
+
interface AnimatedElementProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
'data-state'?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface TransitionProps {
|
|
9
|
+
/**
|
|
10
|
+
* Whether the component is visible
|
|
11
|
+
*/
|
|
12
|
+
show: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Animation preset name or custom config
|
|
15
|
+
*/
|
|
16
|
+
animation?: AnimationPresetName | {
|
|
17
|
+
enter: {
|
|
18
|
+
from: React.CSSProperties;
|
|
19
|
+
to: React.CSSProperties;
|
|
20
|
+
};
|
|
21
|
+
exit: {
|
|
22
|
+
from: React.CSSProperties;
|
|
23
|
+
to: React.CSSProperties;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Animation duration in ms
|
|
28
|
+
* @default 200
|
|
29
|
+
*/
|
|
30
|
+
duration?: number;
|
|
31
|
+
/**
|
|
32
|
+
* CSS easing function
|
|
33
|
+
* @default 'ease-out'
|
|
34
|
+
*/
|
|
35
|
+
easing?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Delay before animation starts
|
|
38
|
+
* @default 0
|
|
39
|
+
*/
|
|
40
|
+
delay?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Whether to unmount when hidden
|
|
43
|
+
* @default true
|
|
44
|
+
*/
|
|
45
|
+
unmountOnExit?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Callback when enter animation starts
|
|
48
|
+
*/
|
|
49
|
+
onEnter?: () => void;
|
|
50
|
+
/**
|
|
51
|
+
* Callback when enter animation ends
|
|
52
|
+
*/
|
|
53
|
+
onEntered?: () => void;
|
|
54
|
+
/**
|
|
55
|
+
* Callback when exit animation starts
|
|
56
|
+
*/
|
|
57
|
+
onExit?: () => void;
|
|
58
|
+
/**
|
|
59
|
+
* Callback when exit animation ends
|
|
60
|
+
*/
|
|
61
|
+
onExited?: () => void;
|
|
62
|
+
/**
|
|
63
|
+
* Child element to animate
|
|
64
|
+
*/
|
|
65
|
+
children: React.ReactElement<AnimatedElementProps>;
|
|
66
|
+
/**
|
|
67
|
+
* Additional class name
|
|
68
|
+
*/
|
|
69
|
+
className?: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Transition component for declarative enter/exit animations
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```tsx
|
|
76
|
+
* <Transition show={isOpen} animation="fadeScale">
|
|
77
|
+
* <div className="dropdown">Content</div>
|
|
78
|
+
* </Transition>
|
|
79
|
+
*
|
|
80
|
+
* <Transition
|
|
81
|
+
* show={visible}
|
|
82
|
+
* animation={{
|
|
83
|
+
* enter: { from: { opacity: 0 }, to: { opacity: 1 } },
|
|
84
|
+
* exit: { from: { opacity: 1 }, to: { opacity: 0 } }
|
|
85
|
+
* }}
|
|
86
|
+
* duration={300}
|
|
87
|
+
* >
|
|
88
|
+
* <div>Custom animation</div>
|
|
89
|
+
* </Transition>
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export declare const Transition: React.FC<TransitionProps>;
|
|
93
|
+
/**
|
|
94
|
+
* TransitionGroup component for managing lists with animations
|
|
95
|
+
*/
|
|
96
|
+
export interface TransitionGroupProps {
|
|
97
|
+
/**
|
|
98
|
+
* Child Transition components
|
|
99
|
+
*/
|
|
100
|
+
children: React.ReactNode;
|
|
101
|
+
/**
|
|
102
|
+
* Additional class name
|
|
103
|
+
*/
|
|
104
|
+
className?: string;
|
|
105
|
+
}
|
|
106
|
+
export declare const TransitionGroup: React.FC<TransitionGroupProps>;
|
|
107
|
+
export {};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Address data structure
|
|
4
|
+
*/
|
|
5
|
+
export interface Address {
|
|
6
|
+
/**
|
|
7
|
+
* Unique identifier for the address
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* Optional label for the address (e.g., "Home", "Office", "Store")
|
|
12
|
+
*/
|
|
13
|
+
label?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Company or person name
|
|
16
|
+
*/
|
|
17
|
+
name: string;
|
|
18
|
+
/**
|
|
19
|
+
* Street address line 1
|
|
20
|
+
*/
|
|
21
|
+
street: string;
|
|
22
|
+
/**
|
|
23
|
+
* Street address line 2 (apartment, suite, etc.)
|
|
24
|
+
*/
|
|
25
|
+
street2?: string;
|
|
26
|
+
/**
|
|
27
|
+
* City
|
|
28
|
+
*/
|
|
29
|
+
city: string;
|
|
30
|
+
/**
|
|
31
|
+
* State/Province code
|
|
32
|
+
*/
|
|
33
|
+
state: string;
|
|
34
|
+
/**
|
|
35
|
+
* ZIP/Postal code
|
|
36
|
+
*/
|
|
37
|
+
zip: string;
|
|
38
|
+
/**
|
|
39
|
+
* Country (optional, defaults to USA)
|
|
40
|
+
*/
|
|
41
|
+
country?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Whether this is the default address
|
|
44
|
+
*/
|
|
45
|
+
isDefault?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface AddressSelectProps {
|
|
48
|
+
/**
|
|
49
|
+
* Available addresses
|
|
50
|
+
*/
|
|
51
|
+
addresses: Address[];
|
|
52
|
+
/**
|
|
53
|
+
* Currently selected address ID
|
|
54
|
+
*/
|
|
55
|
+
value?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Callback when selection changes
|
|
58
|
+
*/
|
|
59
|
+
onChange?: (addressId: string, address: Address) => void;
|
|
60
|
+
/**
|
|
61
|
+
* Placeholder text
|
|
62
|
+
* @default 'Select address...'
|
|
63
|
+
*/
|
|
64
|
+
placeholder?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Format for displaying address in trigger
|
|
67
|
+
* - 'short': Single line with label/street and city
|
|
68
|
+
* - 'full': Multi-line with complete address
|
|
69
|
+
* @default 'short'
|
|
70
|
+
*/
|
|
71
|
+
triggerFormat?: 'short' | 'full';
|
|
72
|
+
/**
|
|
73
|
+
* Whether to show "Add new address" option
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
showAddNew?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Callback when "Add new address" is clicked
|
|
79
|
+
*/
|
|
80
|
+
onAddNew?: () => void;
|
|
81
|
+
/**
|
|
82
|
+
* Size variant
|
|
83
|
+
* @default 'md'
|
|
84
|
+
*/
|
|
85
|
+
size?: 'sm' | 'md' | 'lg';
|
|
86
|
+
/**
|
|
87
|
+
* Additional className
|
|
88
|
+
*/
|
|
89
|
+
className?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Disabled state
|
|
92
|
+
*/
|
|
93
|
+
disabled?: boolean;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Address select wrapper
|
|
97
|
+
*
|
|
98
|
+
* Configures the Select component to display multi-line addresses
|
|
99
|
+
* with proper formatting and visual hierarchy.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```tsx
|
|
103
|
+
* <AddressSelect
|
|
104
|
+
* addresses={[
|
|
105
|
+
* {
|
|
106
|
+
* id: '1',
|
|
107
|
+
* label: 'Store',
|
|
108
|
+
* name: 'Morrison & Sons',
|
|
109
|
+
* street: '445 Main Street',
|
|
110
|
+
* city: 'San Francisco',
|
|
111
|
+
* state: 'CA',
|
|
112
|
+
* zip: '94102',
|
|
113
|
+
* isDefault: true
|
|
114
|
+
* },
|
|
115
|
+
* {
|
|
116
|
+
* id: '2',
|
|
117
|
+
* label: 'Office',
|
|
118
|
+
* name: 'Morrison & Sons',
|
|
119
|
+
* street: '892 Market St',
|
|
120
|
+
* street2: 'Suite 400',
|
|
121
|
+
* city: 'San Francisco',
|
|
122
|
+
* state: 'CA',
|
|
123
|
+
* zip: '94103'
|
|
124
|
+
* }
|
|
125
|
+
* ]}
|
|
126
|
+
* value={selectedId}
|
|
127
|
+
* onChange={(id, address) => setSelectedId(id)}
|
|
128
|
+
* triggerFormat="full"
|
|
129
|
+
* />
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
export declare const AddressSelect: React.FC<AddressSelectProps>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { InputProps } from '../Input';
|
|
3
|
+
export interface PasswordStrengthRule {
|
|
4
|
+
/**
|
|
5
|
+
* Unique identifier for the rule
|
|
6
|
+
*/
|
|
7
|
+
id: string;
|
|
8
|
+
/**
|
|
9
|
+
* Display label for the rule
|
|
10
|
+
*/
|
|
11
|
+
label: string;
|
|
12
|
+
/**
|
|
13
|
+
* Validation function
|
|
14
|
+
*/
|
|
15
|
+
validate: (password: string) => boolean;
|
|
16
|
+
}
|
|
17
|
+
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
|
+
*/
|
|
23
|
+
showToggle?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether to show the password strength indicator
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
showStrength?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Pre-calculated password strength (if you want to control it externally)
|
|
31
|
+
*/
|
|
32
|
+
strength?: PasswordStrength;
|
|
33
|
+
/**
|
|
34
|
+
* Custom strength calculation rules
|
|
35
|
+
* If not provided, uses default rules
|
|
36
|
+
*/
|
|
37
|
+
strengthRules?: PasswordStrengthRule[];
|
|
38
|
+
/**
|
|
39
|
+
* Whether to show a generate password button
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
showGenerate?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Callback when generate button is clicked
|
|
45
|
+
* If not provided, uses built-in generator
|
|
46
|
+
*/
|
|
47
|
+
onGenerate?: (password: string) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Length of generated password
|
|
50
|
+
* @default 16
|
|
51
|
+
*/
|
|
52
|
+
generateLength?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Whether to show rule checklist
|
|
55
|
+
* @default false
|
|
56
|
+
*/
|
|
57
|
+
showRules?: boolean;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* PasswordInput - Specialized input for password entry
|
|
61
|
+
*
|
|
62
|
+
* Features visibility toggle, strength indicator, rule checklist,
|
|
63
|
+
* and password generation.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```tsx
|
|
67
|
+
* <PasswordInput
|
|
68
|
+
* label="Password"
|
|
69
|
+
* showStrength
|
|
70
|
+
* showRules
|
|
71
|
+
* showGenerate
|
|
72
|
+
* />
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export declare const PasswordInput: React.ForwardRefExoticComponent<PasswordInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Supported payment card types
|
|
4
|
+
*/
|
|
5
|
+
export type CardType = 'visa' | 'mastercard' | 'amex' | 'generic';
|
|
6
|
+
/**
|
|
7
|
+
* Payment method data structure
|
|
8
|
+
*/
|
|
9
|
+
export interface PaymentMethod {
|
|
10
|
+
/**
|
|
11
|
+
* Unique identifier for the payment method
|
|
12
|
+
*/
|
|
13
|
+
id: string;
|
|
14
|
+
/**
|
|
15
|
+
* Card network type
|
|
16
|
+
*/
|
|
17
|
+
type: CardType;
|
|
18
|
+
/**
|
|
19
|
+
* Last 4 digits of the card number
|
|
20
|
+
*/
|
|
21
|
+
last4: string;
|
|
22
|
+
/**
|
|
23
|
+
* Expiration date (e.g., "12/25")
|
|
24
|
+
*/
|
|
25
|
+
expiry?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Cardholder name
|
|
28
|
+
*/
|
|
29
|
+
holderName?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Whether this is the default payment method
|
|
32
|
+
*/
|
|
33
|
+
isDefault?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface PaymentMethodSelectProps {
|
|
36
|
+
/**
|
|
37
|
+
* Available payment methods
|
|
38
|
+
*/
|
|
39
|
+
methods: PaymentMethod[];
|
|
40
|
+
/**
|
|
41
|
+
* Currently selected method ID
|
|
42
|
+
*/
|
|
43
|
+
value?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Callback when selection changes
|
|
46
|
+
*/
|
|
47
|
+
onChange?: (methodId: string, method: PaymentMethod) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Placeholder text
|
|
50
|
+
* @default 'Select card...'
|
|
51
|
+
*/
|
|
52
|
+
placeholder?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Whether to show "Add new card" option
|
|
55
|
+
* @default false
|
|
56
|
+
*/
|
|
57
|
+
showAddNew?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Callback when "Add new card" is clicked
|
|
60
|
+
*/
|
|
61
|
+
onAddNew?: () => void;
|
|
62
|
+
/**
|
|
63
|
+
* Size variant
|
|
64
|
+
* @default 'md'
|
|
65
|
+
*/
|
|
66
|
+
size?: 'sm' | 'md' | 'lg';
|
|
67
|
+
/**
|
|
68
|
+
* Additional className
|
|
69
|
+
*/
|
|
70
|
+
className?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Disabled state
|
|
73
|
+
*/
|
|
74
|
+
disabled?: boolean;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Payment method select wrapper
|
|
78
|
+
*
|
|
79
|
+
* Configures the Select component to display credit cards with icons
|
|
80
|
+
* and masked numbers in a user-friendly format.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```tsx
|
|
84
|
+
* <PaymentMethodSelect
|
|
85
|
+
* methods={[
|
|
86
|
+
* { id: '1', type: 'visa', last4: '4242', expiry: '12/25' },
|
|
87
|
+
* { id: '2', type: 'mastercard', last4: '5555', expiry: '06/26' }
|
|
88
|
+
* ]}
|
|
89
|
+
* value={selectedId}
|
|
90
|
+
* onChange={(id, method) => setSelectedId(id)}
|
|
91
|
+
* showAddNew
|
|
92
|
+
* onAddNew={() => openAddCardModal()}
|
|
93
|
+
* />
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
export declare const PaymentMethodSelect: React.FC<PaymentMethodSelectProps>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { InputProps } from '../Input';
|
|
3
|
+
export interface Country {
|
|
4
|
+
/**
|
|
5
|
+
* ISO 3166-1 alpha-2 country code
|
|
6
|
+
*/
|
|
7
|
+
code: string;
|
|
8
|
+
/**
|
|
9
|
+
* Country name
|
|
10
|
+
*/
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* Dial code (e.g., +1, +44)
|
|
14
|
+
*/
|
|
15
|
+
dialCode: string;
|
|
16
|
+
/**
|
|
17
|
+
* Phone number format mask (# for digit)
|
|
18
|
+
* e.g., '(###) ###-####' for US
|
|
19
|
+
*/
|
|
20
|
+
format?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface PhoneInputProps extends Omit<InputProps, 'value' | 'onChange' | 'type' | 'leftIcon'> {
|
|
23
|
+
/**
|
|
24
|
+
* Current value in E.164 format (e.g., +14155551234)
|
|
25
|
+
*/
|
|
26
|
+
value?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Default value
|
|
29
|
+
*/
|
|
30
|
+
defaultValue?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Callback when value changes
|
|
33
|
+
* Returns E.164 formatted value
|
|
34
|
+
*/
|
|
35
|
+
onChange?: (value: string) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Default selected country code
|
|
38
|
+
* @default 'US'
|
|
39
|
+
*/
|
|
40
|
+
defaultCountry?: string;
|
|
41
|
+
/**
|
|
42
|
+
* List of countries to show in selector
|
|
43
|
+
* Uses default list if not provided
|
|
44
|
+
*/
|
|
45
|
+
countries?: Country[];
|
|
46
|
+
/**
|
|
47
|
+
* Whether to show country selector
|
|
48
|
+
* @default true
|
|
49
|
+
*/
|
|
50
|
+
showCountrySelect?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Format for display
|
|
53
|
+
* @default 'national'
|
|
54
|
+
*/
|
|
55
|
+
format?: 'national' | 'international';
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* PhoneInput - International phone number input with country selector
|
|
59
|
+
*
|
|
60
|
+
* Features country selection, automatic formatting, and E.164 output.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```tsx
|
|
64
|
+
* <PhoneInput
|
|
65
|
+
* value={phone}
|
|
66
|
+
* onChange={setPhone}
|
|
67
|
+
* defaultCountry="US"
|
|
68
|
+
* />
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export declare const PhoneInput: React.ForwardRefExoticComponent<PhoneInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { InputProps } from '../Input';
|
|
3
|
+
export interface SearchSuggestion {
|
|
4
|
+
/**
|
|
5
|
+
* Unique identifier for the suggestion
|
|
6
|
+
*/
|
|
7
|
+
id: string;
|
|
8
|
+
/**
|
|
9
|
+
* Display text for the suggestion
|
|
10
|
+
*/
|
|
11
|
+
label: string;
|
|
12
|
+
/**
|
|
13
|
+
* Optional description text
|
|
14
|
+
*/
|
|
15
|
+
description?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Optional icon name
|
|
18
|
+
*/
|
|
19
|
+
icon?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface SearchInputProps extends Omit<InputProps, 'leftIcon' | 'rightIcon' | 'clearable'> {
|
|
22
|
+
/**
|
|
23
|
+
* Callback when search is triggered (Enter key or search button)
|
|
24
|
+
*/
|
|
25
|
+
onSearch?: (value: string) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Debounce delay in milliseconds for onChange
|
|
28
|
+
* @default 0
|
|
29
|
+
*/
|
|
30
|
+
debounce?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Whether a search is currently in progress
|
|
33
|
+
*/
|
|
34
|
+
isSearching?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* List of suggestions to display in dropdown
|
|
37
|
+
*/
|
|
38
|
+
suggestions?: SearchSuggestion[];
|
|
39
|
+
/**
|
|
40
|
+
* Callback when a suggestion is selected
|
|
41
|
+
*/
|
|
42
|
+
onSuggestionSelect?: (suggestion: SearchSuggestion) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Whether to show suggestions dropdown
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
showSuggestions?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Show keyboard shortcut hint (e.g., Cmd+K)
|
|
50
|
+
*/
|
|
51
|
+
showShortcut?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Keyboard shortcut key (works with Cmd/Ctrl)
|
|
54
|
+
* @default 'k'
|
|
55
|
+
*/
|
|
56
|
+
shortcutKey?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Whether the search input should always show clear button when has value
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
clearable?: boolean;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* SearchInput - Specialized input for search functionality
|
|
65
|
+
*
|
|
66
|
+
* Features search icon, debounced onChange, suggestions dropdown,
|
|
67
|
+
* keyboard shortcut support, and loading state.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```tsx
|
|
71
|
+
* <SearchInput
|
|
72
|
+
* placeholder="Search..."
|
|
73
|
+
* onSearch={(query) => searchProducts(query)}
|
|
74
|
+
* suggestions={suggestions}
|
|
75
|
+
* onSuggestionSelect={handleSelect}
|
|
76
|
+
* showShortcut
|
|
77
|
+
* />
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare const SearchInput: React.ForwardRefExoticComponent<SearchInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface TagInputProps {
|
|
3
|
+
/**
|
|
4
|
+
* Current tags (controlled)
|
|
5
|
+
*/
|
|
6
|
+
value?: string[];
|
|
7
|
+
/**
|
|
8
|
+
* Default tags (uncontrolled)
|
|
9
|
+
*/
|
|
10
|
+
defaultValue?: string[];
|
|
11
|
+
/**
|
|
12
|
+
* Callback when tags change
|
|
13
|
+
*/
|
|
14
|
+
onChange?: (tags: string[]) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Characters that trigger tag creation
|
|
17
|
+
* @default [',', 'Enter']
|
|
18
|
+
*/
|
|
19
|
+
separator?: string[];
|
|
20
|
+
/**
|
|
21
|
+
* Maximum number of tags allowed
|
|
22
|
+
*/
|
|
23
|
+
maxTags?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Maximum length per tag
|
|
26
|
+
*/
|
|
27
|
+
maxLength?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Allow duplicate tags
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
allowDuplicates?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Validate tag before adding
|
|
35
|
+
* Return true if valid, string for error message
|
|
36
|
+
*/
|
|
37
|
+
validateTag?: (tag: string) => boolean | string;
|
|
38
|
+
/**
|
|
39
|
+
* Suggestions for autocomplete
|
|
40
|
+
*/
|
|
41
|
+
suggestions?: string[];
|
|
42
|
+
/**
|
|
43
|
+
* Placeholder text
|
|
44
|
+
* @default 'Add tags...'
|
|
45
|
+
*/
|
|
46
|
+
placeholder?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Whether the input is disabled
|
|
49
|
+
*/
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Label text
|
|
53
|
+
*/
|
|
54
|
+
label?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Helper text
|
|
57
|
+
*/
|
|
58
|
+
helperText?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Validation status
|
|
61
|
+
* @default 'default'
|
|
62
|
+
*/
|
|
63
|
+
status?: 'default' | 'success' | 'error';
|
|
64
|
+
/**
|
|
65
|
+
* Size variant
|
|
66
|
+
* @default 'md'
|
|
67
|
+
*/
|
|
68
|
+
size?: 'sm' | 'md' | 'lg';
|
|
69
|
+
/**
|
|
70
|
+
* Additional CSS class names
|
|
71
|
+
*/
|
|
72
|
+
className?: string;
|
|
73
|
+
/**
|
|
74
|
+
* ID for the input
|
|
75
|
+
*/
|
|
76
|
+
id?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Name for form submission
|
|
79
|
+
*/
|
|
80
|
+
name?: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* TagInput - Multi-value chip input with validation
|
|
84
|
+
*
|
|
85
|
+
* Features tag creation, deletion, validation, suggestions,
|
|
86
|
+
* and keyboard navigation.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```tsx
|
|
90
|
+
* <TagInput
|
|
91
|
+
* value={tags}
|
|
92
|
+
* onChange={setTags}
|
|
93
|
+
* maxTags={5}
|
|
94
|
+
* placeholder="Add skills..."
|
|
95
|
+
* />
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export declare const TagInput: React.ForwardRefExoticComponent<TagInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { PaymentMethodSelect } from './PaymentMethodSelect';
|
|
2
|
+
export type { PaymentMethodSelectProps, PaymentMethod, CardType, } from './PaymentMethodSelect';
|
|
3
|
+
export { AddressSelect } from './AddressSelect';
|
|
4
|
+
export type { AddressSelectProps, Address } from './AddressSelect';
|
|
5
|
+
export { SearchInput } from './SearchInput';
|
|
6
|
+
export type { SearchInputProps, SearchSuggestion } from './SearchInput';
|
|
7
|
+
export { PasswordInput } from './PasswordInput';
|
|
8
|
+
export type { PasswordInputProps, PasswordStrength, PasswordStrengthRule, } from './PasswordInput';
|
|
9
|
+
export { TagInput } from './TagInput';
|
|
10
|
+
export type { TagInputProps } from './TagInput';
|
|
11
|
+
export { PhoneInput } from './PhoneInput';
|
|
12
|
+
export type { PhoneInputProps, Country } from './PhoneInput';
|