tyrell-react 1.0.0-TC10
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/LICENSE +21 -0
- package/README.md +410 -0
- package/dist/components/TyButton.d.ts +50 -0
- package/dist/components/TyButton.d.ts.map +1 -0
- package/dist/components/TyButton.js +68 -0
- package/dist/components/TyButton.js.map +1 -0
- package/dist/components/TyCalendar.d.ts +63 -0
- package/dist/components/TyCalendar.d.ts.map +1 -0
- package/dist/components/TyCalendar.js +122 -0
- package/dist/components/TyCalendar.js.map +1 -0
- package/dist/components/TyCalendarMonth.d.ts +32 -0
- package/dist/components/TyCalendarMonth.d.ts.map +1 -0
- package/dist/components/TyCalendarMonth.js +54 -0
- package/dist/components/TyCalendarMonth.js.map +1 -0
- package/dist/components/TyCalendarNavigation.d.ts +21 -0
- package/dist/components/TyCalendarNavigation.d.ts.map +1 -0
- package/dist/components/TyCalendarNavigation.js +50 -0
- package/dist/components/TyCalendarNavigation.js.map +1 -0
- package/dist/components/TyCheckbox.d.ts +39 -0
- package/dist/components/TyCheckbox.d.ts.map +1 -0
- package/dist/components/TyCheckbox.js +79 -0
- package/dist/components/TyCheckbox.js.map +1 -0
- package/dist/components/TyCopy.d.ts +21 -0
- package/dist/components/TyCopy.d.ts.map +1 -0
- package/dist/components/TyCopy.js +42 -0
- package/dist/components/TyCopy.js.map +1 -0
- package/dist/components/TyDatePicker.d.ts +45 -0
- package/dist/components/TyDatePicker.d.ts.map +1 -0
- package/dist/components/TyDatePicker.js +114 -0
- package/dist/components/TyDatePicker.js.map +1 -0
- package/dist/components/TyDropdown.d.ts +51 -0
- package/dist/components/TyDropdown.d.ts.map +1 -0
- package/dist/components/TyDropdown.js +109 -0
- package/dist/components/TyDropdown.js.map +1 -0
- package/dist/components/TyIcon.d.ts +17 -0
- package/dist/components/TyIcon.d.ts.map +1 -0
- package/dist/components/TyIcon.js +41 -0
- package/dist/components/TyIcon.js.map +1 -0
- package/dist/components/TyInput.d.ts +65 -0
- package/dist/components/TyInput.d.ts.map +1 -0
- package/dist/components/TyInput.js +105 -0
- package/dist/components/TyInput.js.map +1 -0
- package/dist/components/TyModal.d.ts +29 -0
- package/dist/components/TyModal.d.ts.map +1 -0
- package/dist/components/TyModal.js +74 -0
- package/dist/components/TyModal.js.map +1 -0
- package/dist/components/TyMultiselect.d.ts +51 -0
- package/dist/components/TyMultiselect.d.ts.map +1 -0
- package/dist/components/TyMultiselect.js +103 -0
- package/dist/components/TyMultiselect.js.map +1 -0
- package/dist/components/TyOption.d.ts +10 -0
- package/dist/components/TyOption.d.ts.map +1 -0
- package/dist/components/TyOption.js +25 -0
- package/dist/components/TyOption.js.map +1 -0
- package/dist/components/TyPopup.d.ts +24 -0
- package/dist/components/TyPopup.d.ts.map +1 -0
- package/dist/components/TyPopup.js +61 -0
- package/dist/components/TyPopup.js.map +1 -0
- package/dist/components/TyRadio.d.ts +20 -0
- package/dist/components/TyRadio.d.ts.map +1 -0
- package/dist/components/TyRadio.js +31 -0
- package/dist/components/TyRadio.js.map +1 -0
- package/dist/components/TyRadioGroup.d.ts +40 -0
- package/dist/components/TyRadioGroup.d.ts.map +1 -0
- package/dist/components/TyRadioGroup.js +58 -0
- package/dist/components/TyRadioGroup.js.map +1 -0
- package/dist/components/TyResizeObserver.d.ts +11 -0
- package/dist/components/TyResizeObserver.d.ts.map +1 -0
- package/dist/components/TyResizeObserver.js +28 -0
- package/dist/components/TyResizeObserver.js.map +1 -0
- package/dist/components/TyScrollContainer.d.ts +25 -0
- package/dist/components/TyScrollContainer.d.ts.map +1 -0
- package/dist/components/TyScrollContainer.js +43 -0
- package/dist/components/TyScrollContainer.js.map +1 -0
- package/dist/components/TyStep.d.ts +17 -0
- package/dist/components/TyStep.d.ts.map +1 -0
- package/dist/components/TyStep.js +35 -0
- package/dist/components/TyStep.js.map +1 -0
- package/dist/components/TySwitch.d.ts +35 -0
- package/dist/components/TySwitch.d.ts.map +1 -0
- package/dist/components/TySwitch.js +54 -0
- package/dist/components/TySwitch.js.map +1 -0
- package/dist/components/TyTab.d.ts +13 -0
- package/dist/components/TyTab.d.ts.map +1 -0
- package/dist/components/TyTab.js +32 -0
- package/dist/components/TyTab.js.map +1 -0
- package/dist/components/TyTabs.d.ts +23 -0
- package/dist/components/TyTabs.d.ts.map +1 -0
- package/dist/components/TyTabs.js +48 -0
- package/dist/components/TyTabs.js.map +1 -0
- package/dist/components/TyTag.d.ts +22 -0
- package/dist/components/TyTag.d.ts.map +1 -0
- package/dist/components/TyTag.js +45 -0
- package/dist/components/TyTag.js.map +1 -0
- package/dist/components/TyTextarea.d.ts +37 -0
- package/dist/components/TyTextarea.d.ts.map +1 -0
- package/dist/components/TyTextarea.js +93 -0
- package/dist/components/TyTextarea.js.map +1 -0
- package/dist/components/TyTooltip.d.ts +17 -0
- package/dist/components/TyTooltip.d.ts.map +1 -0
- package/dist/components/TyTooltip.js +40 -0
- package/dist/components/TyTooltip.js.map +1 -0
- package/dist/components/TyWizard.d.ts +26 -0
- package/dist/components/TyWizard.d.ts.map +1 -0
- package/dist/components/TyWizard.js +50 -0
- package/dist/components/TyWizard.js.map +1 -0
- package/dist/components/index.d.ts +105 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +112 -0
- package/dist/components/index.js.map +1 -0
- package/package.json +46 -0
- package/src/components/EventConventionTest.tsx +155 -0
- package/src/components/TyButton.tsx +145 -0
- package/src/components/TyCalendar.tsx +244 -0
- package/src/components/TyCalendarMonth.tsx +108 -0
- package/src/components/TyCalendarNavigation.tsx +91 -0
- package/src/components/TyCheckbox.tsx +149 -0
- package/src/components/TyCopy.tsx +78 -0
- package/src/components/TyDatePicker.tsx +216 -0
- package/src/components/TyDropdown.tsx +218 -0
- package/src/components/TyIcon.tsx +72 -0
- package/src/components/TyInput.tsx +207 -0
- package/src/components/TyModal.tsx +142 -0
- package/src/components/TyMultiselect.tsx +200 -0
- package/src/components/TyOption.tsx +42 -0
- package/src/components/TyPopup.tsx +111 -0
- package/src/components/TyRadio.tsx +56 -0
- package/src/components/TyRadioGroup.tsx +121 -0
- package/src/components/TyResizeObserver.tsx +54 -0
- package/src/components/TyScrollContainer.tsx +87 -0
- package/src/components/TyStep.tsx +71 -0
- package/src/components/TySwitch.tsx +108 -0
- package/src/components/TyTab.tsx +63 -0
- package/src/components/TyTabs.tsx +93 -0
- package/src/components/TyTag.tsx +79 -0
- package/src/components/TyTextarea.tsx +154 -0
- package/src/components/TyTooltip.tsx +83 -0
- package/src/components/TyWizard.tsx +99 -0
- package/src/components/index.ts +251 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
// Event detail structure for ty-textarea events
|
|
4
|
+
export interface TyTextareaEventDetail {
|
|
5
|
+
value: string; // textarea value
|
|
6
|
+
originalEvent: Event; // original DOM event
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// Type definitions for Ty Textarea component
|
|
10
|
+
export interface TyTextareaProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'onInput' | 'onFocus' | 'onBlur' | 'style'> {
|
|
11
|
+
style?: import('./TyInput').TyInputCSSProperties;
|
|
12
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
13
|
+
value?: string;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
label?: string;
|
|
16
|
+
error?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
required?: boolean;
|
|
19
|
+
name?: string; // Important for HTMX/form compatibility
|
|
20
|
+
|
|
21
|
+
// Textarea-specific props
|
|
22
|
+
rows?: string | number;
|
|
23
|
+
cols?: string | number;
|
|
24
|
+
resize?: 'none' | 'both' | 'horizontal' | 'vertical';
|
|
25
|
+
minHeight?: string; // e.g., '100px' - converts to min-height
|
|
26
|
+
maxHeight?: string; // e.g., '500px' - converts to max-height
|
|
27
|
+
|
|
28
|
+
// React event handlers - override with our custom types
|
|
29
|
+
/**
|
|
30
|
+
* Fires on every keystroke (React convention)
|
|
31
|
+
* Maps to native 'input' event from ty-textarea
|
|
32
|
+
*/
|
|
33
|
+
onChange?: (event: CustomEvent<TyTextareaEventDetail>) => void;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Fires on blur if value changed (native DOM behavior)
|
|
37
|
+
* Maps to native 'change' event from ty-textarea
|
|
38
|
+
*/
|
|
39
|
+
onChangeCommit?: (event: CustomEvent<TyTextareaEventDetail>) => void;
|
|
40
|
+
|
|
41
|
+
/** Standard focus event */
|
|
42
|
+
onFocus?: (event: FocusEvent) => void;
|
|
43
|
+
|
|
44
|
+
/** Standard blur event */
|
|
45
|
+
onBlur?: (event: FocusEvent) => void;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// React wrapper for ty-textarea web component
|
|
49
|
+
export const TyTextarea = React.forwardRef<HTMLElement, TyTextareaProps>(
|
|
50
|
+
({ onChange, onChangeCommit, onFocus, onBlur, disabled, required, minHeight, maxHeight, ...props }, ref) => {
|
|
51
|
+
const elementRef = useRef<HTMLElement>(null);
|
|
52
|
+
|
|
53
|
+
// Map onChange to input event (React convention)
|
|
54
|
+
const handleInput = useCallback((event: CustomEvent<TyTextareaEventDetail>) => {
|
|
55
|
+
if (onChange) {
|
|
56
|
+
onChange(event);
|
|
57
|
+
}
|
|
58
|
+
}, [onChange]);
|
|
59
|
+
|
|
60
|
+
// Map onChangeCommit to change event (blur behavior)
|
|
61
|
+
const handleChangeCommit = useCallback((event: CustomEvent<TyTextareaEventDetail>) => {
|
|
62
|
+
if (onChangeCommit) {
|
|
63
|
+
onChangeCommit(event);
|
|
64
|
+
}
|
|
65
|
+
}, [onChangeCommit]);
|
|
66
|
+
|
|
67
|
+
const handleFocus = useCallback((event: FocusEvent) => {
|
|
68
|
+
if (onFocus) {
|
|
69
|
+
onFocus(event);
|
|
70
|
+
}
|
|
71
|
+
}, [onFocus]);
|
|
72
|
+
|
|
73
|
+
const handleBlur = useCallback((event: FocusEvent) => {
|
|
74
|
+
if (onBlur) {
|
|
75
|
+
onBlur(event);
|
|
76
|
+
}
|
|
77
|
+
}, [onBlur]);
|
|
78
|
+
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
const element = elementRef.current;
|
|
81
|
+
if (!element) return;
|
|
82
|
+
|
|
83
|
+
// Listen for custom input/change events from ty-textarea
|
|
84
|
+
// Map onChange → input event (React convention)
|
|
85
|
+
if (onChange) {
|
|
86
|
+
element.addEventListener('input', handleInput as EventListener);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Map onChangeCommit → change event (blur behavior)
|
|
90
|
+
if (onChangeCommit) {
|
|
91
|
+
element.addEventListener('change', handleChangeCommit as EventListener);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Listen for standard focus/blur events
|
|
95
|
+
if (onFocus) {
|
|
96
|
+
element.addEventListener('focus', handleFocus as EventListener);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (onBlur) {
|
|
100
|
+
element.addEventListener('blur', handleBlur as EventListener);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return () => {
|
|
104
|
+
if (onChange) {
|
|
105
|
+
element.removeEventListener('input', handleInput as EventListener);
|
|
106
|
+
}
|
|
107
|
+
if (onChangeCommit) {
|
|
108
|
+
element.removeEventListener('change', handleChangeCommit as EventListener);
|
|
109
|
+
}
|
|
110
|
+
if (onFocus) {
|
|
111
|
+
element.removeEventListener('focus', handleFocus as EventListener);
|
|
112
|
+
}
|
|
113
|
+
if (onBlur) {
|
|
114
|
+
element.removeEventListener('blur', handleBlur as EventListener);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}, [handleInput, handleChangeCommit, handleFocus, handleBlur, onChange, onChangeCommit, onFocus, onBlur]);
|
|
118
|
+
|
|
119
|
+
// Handle ref forwarding
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
if (ref && elementRef.current) {
|
|
122
|
+
if (typeof ref === 'function') {
|
|
123
|
+
ref(elementRef.current);
|
|
124
|
+
} else {
|
|
125
|
+
ref.current = elementRef.current;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}, [ref]);
|
|
129
|
+
|
|
130
|
+
// Imperatively sync `value` to the underlying element's property.
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
const element = elementRef.current as any;
|
|
133
|
+
if (!element) return;
|
|
134
|
+
const next = (props as any).value ?? '';
|
|
135
|
+
if (element.value !== next) {
|
|
136
|
+
element.value = next;
|
|
137
|
+
}
|
|
138
|
+
}, [(props as any).value]);
|
|
139
|
+
|
|
140
|
+
return React.createElement(
|
|
141
|
+
'ty-textarea',
|
|
142
|
+
{
|
|
143
|
+
...props,
|
|
144
|
+
...(disabled && { disabled: "" }),
|
|
145
|
+
...(required && { required: "" }),
|
|
146
|
+
...(minHeight && { 'min-height': minHeight }), // Convert camelCase to kebab-case
|
|
147
|
+
...(maxHeight && { 'max-height': maxHeight }), // Convert camelCase to kebab-case
|
|
148
|
+
ref: elementRef,
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
TyTextarea.displayName = 'TyTextarea';
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
// Type definitions for Ty Tooltip component
|
|
4
|
+
export interface TyTooltipProps extends React.HTMLAttributes<HTMLElement> {
|
|
5
|
+
/** Tooltip positioning relative to the parent element */
|
|
6
|
+
placement?: 'top' | 'bottom' | 'left' | 'right';
|
|
7
|
+
|
|
8
|
+
/** Distance in pixels from the anchor element (default: 8) */
|
|
9
|
+
offset?: number;
|
|
10
|
+
|
|
11
|
+
/** Delay in milliseconds before showing tooltip (default: 600) */
|
|
12
|
+
delay?: number;
|
|
13
|
+
|
|
14
|
+
/** Disable the tooltip */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
|
|
17
|
+
/** Semantic styling variant */
|
|
18
|
+
flavor?: 'dark' | 'light' | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'neutral';
|
|
19
|
+
|
|
20
|
+
/** Tooltip content */
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// React wrapper for ty-tooltip web component
|
|
25
|
+
export const TyTooltip = React.forwardRef<HTMLElement, TyTooltipProps>(
|
|
26
|
+
({
|
|
27
|
+
placement,
|
|
28
|
+
offset,
|
|
29
|
+
delay,
|
|
30
|
+
disabled,
|
|
31
|
+
flavor,
|
|
32
|
+
children,
|
|
33
|
+
...props
|
|
34
|
+
}, ref) => {
|
|
35
|
+
const elementRef = useRef<HTMLElement>(null);
|
|
36
|
+
|
|
37
|
+
// Handle ref forwarding
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (ref && elementRef.current) {
|
|
40
|
+
if (typeof ref === 'function') {
|
|
41
|
+
ref(elementRef.current);
|
|
42
|
+
} else {
|
|
43
|
+
ref.current = elementRef.current;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}, [ref]);
|
|
47
|
+
|
|
48
|
+
// Convert React props to web component attributes
|
|
49
|
+
const webComponentProps: Record<string, any> = {
|
|
50
|
+
...props,
|
|
51
|
+
ref: elementRef,
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// Add optional attributes only if they have values
|
|
55
|
+
if (placement) {
|
|
56
|
+
webComponentProps.placement = placement;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (offset !== undefined) {
|
|
60
|
+
webComponentProps.offset = offset.toString();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (delay !== undefined) {
|
|
64
|
+
webComponentProps.delay = delay.toString();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (disabled) {
|
|
68
|
+
webComponentProps.disabled = ''; // Boolean attributes as empty string
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (flavor) {
|
|
72
|
+
webComponentProps.flavor = flavor;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return React.createElement(
|
|
76
|
+
'ty-tooltip',
|
|
77
|
+
webComponentProps,
|
|
78
|
+
children
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
TyTooltip.displayName = 'TyTooltip';
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
// Type definitions for Ty Wizard component
|
|
4
|
+
export interface TyWizardProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {
|
|
5
|
+
/** Content area width (accepts px or %) */
|
|
6
|
+
width?: string;
|
|
7
|
+
|
|
8
|
+
/** Total container height including step indicators */
|
|
9
|
+
height?: string;
|
|
10
|
+
|
|
11
|
+
/** ID of currently active step */
|
|
12
|
+
active?: string;
|
|
13
|
+
|
|
14
|
+
/** Comma-separated IDs of completed steps */
|
|
15
|
+
completed?: string;
|
|
16
|
+
|
|
17
|
+
/** Step indicator layout */
|
|
18
|
+
orientation?: 'horizontal' | 'vertical';
|
|
19
|
+
|
|
20
|
+
/** Step change event handler */
|
|
21
|
+
onStepChange?: (event: CustomEvent<WizardStepChangeDetail>) => void;
|
|
22
|
+
|
|
23
|
+
/** Wizard content (TyStep components) */
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface WizardStepChangeDetail {
|
|
28
|
+
activeId: string;
|
|
29
|
+
activeIndex: number;
|
|
30
|
+
previousId: string | null;
|
|
31
|
+
previousIndex: number | null;
|
|
32
|
+
direction: 'forward' | 'backward' | 'none';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// React wrapper for ty-wizard web component
|
|
36
|
+
export const TyWizard = React.forwardRef<HTMLElement, TyWizardProps>(
|
|
37
|
+
({
|
|
38
|
+
children,
|
|
39
|
+
width,
|
|
40
|
+
height,
|
|
41
|
+
active,
|
|
42
|
+
completed,
|
|
43
|
+
orientation,
|
|
44
|
+
onStepChange,
|
|
45
|
+
...props
|
|
46
|
+
}, ref) => {
|
|
47
|
+
const elementRef = useRef<HTMLElement>(null);
|
|
48
|
+
|
|
49
|
+
// Handle step change events
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
const element = elementRef.current;
|
|
52
|
+
if (!element) return;
|
|
53
|
+
|
|
54
|
+
const handleStepChange = (event: Event) => {
|
|
55
|
+
if (onStepChange) {
|
|
56
|
+
onStepChange(event as CustomEvent<WizardStepChangeDetail>);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
element.addEventListener('ty-wizard-step-change', handleStepChange);
|
|
61
|
+
|
|
62
|
+
return () => {
|
|
63
|
+
element.removeEventListener('ty-wizard-step-change', handleStepChange);
|
|
64
|
+
};
|
|
65
|
+
}, [onStepChange]);
|
|
66
|
+
|
|
67
|
+
// Combine refs if needed
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if (ref && elementRef.current) {
|
|
70
|
+
if (typeof ref === 'function') {
|
|
71
|
+
ref(elementRef.current);
|
|
72
|
+
} else {
|
|
73
|
+
ref.current = elementRef.current;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}, [ref]);
|
|
77
|
+
|
|
78
|
+
// Convert React props to web component attributes
|
|
79
|
+
const webComponentProps: Record<string, any> = {
|
|
80
|
+
...props,
|
|
81
|
+
ref: elementRef,
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// Add string attributes
|
|
85
|
+
if (width) webComponentProps.width = width;
|
|
86
|
+
if (height) webComponentProps.height = height;
|
|
87
|
+
if (active) webComponentProps.active = active;
|
|
88
|
+
if (completed) webComponentProps.completed = completed;
|
|
89
|
+
if (orientation) webComponentProps.orientation = orientation;
|
|
90
|
+
|
|
91
|
+
return React.createElement(
|
|
92
|
+
'ty-wizard',
|
|
93
|
+
webComponentProps,
|
|
94
|
+
children
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
TyWizard.displayName = 'TyWizard';
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
// ===================================================================
|
|
2
|
+
// TYRELL REACT WRAPPER EXPORTS
|
|
3
|
+
// ===================================================================
|
|
4
|
+
// This file provides two export styles for maximum developer flexibility:
|
|
5
|
+
// 1. Ty-prefixed exports (TyButton, TyInput) - explicit and backward compatible
|
|
6
|
+
// 2. Short name exports (Button, Input) - clean and familiar to React developers
|
|
7
|
+
//
|
|
8
|
+
// Choose the style that fits your team's preferences!
|
|
9
|
+
|
|
10
|
+
// ===================================================================
|
|
11
|
+
// TY-PREFIXED EXPORTS (Explicit Style - Backward Compatible)
|
|
12
|
+
// ===================================================================
|
|
13
|
+
|
|
14
|
+
export { TyButton } from './TyButton';
|
|
15
|
+
export type { TyButtonProps, TyButtonCSSProperties } from './TyButton';
|
|
16
|
+
|
|
17
|
+
export { TyTag } from './TyTag';
|
|
18
|
+
export type { TyTagProps, TyTagCSSProperties } from './TyTag';
|
|
19
|
+
|
|
20
|
+
export { TyInput } from './TyInput';
|
|
21
|
+
export type { TyInputProps, TyInputEventDetail, TyInputCSSProperties } from './TyInput';
|
|
22
|
+
|
|
23
|
+
export { TyTextarea } from './TyTextarea';
|
|
24
|
+
export type { TyTextareaProps, TyTextareaEventDetail } from './TyTextarea';
|
|
25
|
+
|
|
26
|
+
export { TyDropdown } from './TyDropdown';
|
|
27
|
+
export type { TyDropdownProps, TyDropdownEventDetail } from './TyDropdown';
|
|
28
|
+
|
|
29
|
+
export { TyOption } from './TyOption';
|
|
30
|
+
export type { TyOptionProps } from './TyOption';
|
|
31
|
+
|
|
32
|
+
export { TyIcon } from './TyIcon';
|
|
33
|
+
export type { TyIconProps } from './TyIcon';
|
|
34
|
+
|
|
35
|
+
export { TyModal } from './TyModal';
|
|
36
|
+
export type { TyModalProps, TyModalEventDetail, TyModalRef } from './TyModal';
|
|
37
|
+
|
|
38
|
+
export { TyTooltip } from './TyTooltip';
|
|
39
|
+
export type { TyTooltipProps } from './TyTooltip';
|
|
40
|
+
|
|
41
|
+
export { TyMultiselect } from './TyMultiselect';
|
|
42
|
+
export type { TyMultiselectProps, TyMultiselectEventDetail } from './TyMultiselect';
|
|
43
|
+
|
|
44
|
+
export { TyCalendar } from './TyCalendar';
|
|
45
|
+
export type { TyCalendarProps, TyCalendarChangeEventDetail, TyCalendarNavigateEventDetail } from './TyCalendar';
|
|
46
|
+
|
|
47
|
+
export { TyDatePicker } from './TyDatePicker';
|
|
48
|
+
export type { TyDatePickerProps, TyDatePickerEventDetail } from './TyDatePicker';
|
|
49
|
+
|
|
50
|
+
export { TyPopup } from './TyPopup';
|
|
51
|
+
export type { TyPopupProps, TyPopupElement } from './TyPopup';
|
|
52
|
+
|
|
53
|
+
export { TyCheckbox } from './TyCheckbox';
|
|
54
|
+
export type { TyCheckboxProps, TyCheckboxEventDetail } from './TyCheckbox';
|
|
55
|
+
|
|
56
|
+
export { TySwitch } from './TySwitch';
|
|
57
|
+
export type { TySwitchProps, TySwitchEventDetail } from './TySwitch';
|
|
58
|
+
|
|
59
|
+
export { TyRadio } from './TyRadio';
|
|
60
|
+
export type { TyRadioProps } from './TyRadio';
|
|
61
|
+
|
|
62
|
+
export { TyRadioGroup } from './TyRadioGroup';
|
|
63
|
+
export type { TyRadioGroupProps, TyRadioGroupEventDetail } from './TyRadioGroup';
|
|
64
|
+
|
|
65
|
+
export { TyCopy } from './TyCopy';
|
|
66
|
+
export type { TyCopyProps } from './TyCopy';
|
|
67
|
+
|
|
68
|
+
export { TyTabs } from './TyTabs';
|
|
69
|
+
export type { TyTabsProps, TabChangeDetail } from './TyTabs';
|
|
70
|
+
|
|
71
|
+
export { TyTab } from './TyTab';
|
|
72
|
+
export type { TyTabProps } from './TyTab';
|
|
73
|
+
|
|
74
|
+
export { TyCalendarMonth } from './TyCalendarMonth';
|
|
75
|
+
export type { TyCalendarMonthProps, DayClickDetail } from './TyCalendarMonth';
|
|
76
|
+
|
|
77
|
+
export { TyCalendarNavigation } from './TyCalendarNavigation';
|
|
78
|
+
export type { TyCalendarNavigationProps, NavigationChangeDetail } from './TyCalendarNavigation';
|
|
79
|
+
|
|
80
|
+
export { TyWizard } from './TyWizard';
|
|
81
|
+
export type { TyWizardProps, WizardStepChangeDetail } from './TyWizard';
|
|
82
|
+
|
|
83
|
+
export { TyStep } from './TyStep';
|
|
84
|
+
export type { TyStepProps } from './TyStep';
|
|
85
|
+
|
|
86
|
+
export { TyResizeObserver } from './TyResizeObserver';
|
|
87
|
+
export type { TyResizeObserverProps } from './TyResizeObserver';
|
|
88
|
+
|
|
89
|
+
export { TyScrollContainer } from './TyScrollContainer';
|
|
90
|
+
export type { TyScrollContainerProps, TyScrollContainerRef } from './TyScrollContainer';
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
// ===================================================================
|
|
94
|
+
// SHORT NAME EXPORTS (Clean Style - Developer Choice)
|
|
95
|
+
// ===================================================================
|
|
96
|
+
|
|
97
|
+
export { TyButton as Button } from './TyButton';
|
|
98
|
+
export { TyTag as Tag } from './TyTag';
|
|
99
|
+
export { TyInput as Input } from './TyInput';
|
|
100
|
+
export { TyTextarea as Textarea } from './TyTextarea';
|
|
101
|
+
export { TyDropdown as Dropdown } from './TyDropdown';
|
|
102
|
+
export { TyOption as Option } from './TyOption';
|
|
103
|
+
export { TyIcon as Icon } from './TyIcon';
|
|
104
|
+
export { TyModal as Modal } from './TyModal';
|
|
105
|
+
export { TyTooltip as Tooltip } from './TyTooltip';
|
|
106
|
+
export { TyMultiselect as Multiselect } from './TyMultiselect';
|
|
107
|
+
export { TyCalendar as Calendar } from './TyCalendar';
|
|
108
|
+
export { TyDatePicker as DatePicker } from './TyDatePicker';
|
|
109
|
+
export { TyPopup as Popup } from './TyPopup';
|
|
110
|
+
export { TyCheckbox as Checkbox } from './TyCheckbox';
|
|
111
|
+
export { TySwitch as Switch } from './TySwitch';
|
|
112
|
+
export { TyRadio as Radio } from './TyRadio';
|
|
113
|
+
export { TyRadioGroup as RadioGroup } from './TyRadioGroup';
|
|
114
|
+
export { TyCopy as Copy } from './TyCopy';
|
|
115
|
+
export { TyTabs as Tabs } from './TyTabs';
|
|
116
|
+
export { TyTab as Tab } from './TyTab';
|
|
117
|
+
export { TyCalendarMonth as CalendarMonth } from './TyCalendarMonth';
|
|
118
|
+
export { TyCalendarNavigation as CalendarNavigation } from './TyCalendarNavigation';
|
|
119
|
+
export { TyWizard as Wizard } from './TyWizard';
|
|
120
|
+
export { TyStep as Step } from './TyStep';
|
|
121
|
+
export { TyResizeObserver as ResizeObserver } from './TyResizeObserver';
|
|
122
|
+
export { TyScrollContainer as ScrollContainer } from './TyScrollContainer';
|
|
123
|
+
|
|
124
|
+
// ===================================================================
|
|
125
|
+
// TYPE ALIASES (Both Styles Supported)
|
|
126
|
+
// ===================================================================
|
|
127
|
+
|
|
128
|
+
// Button types
|
|
129
|
+
export type { TyButtonProps as ButtonProps } from './TyButton';
|
|
130
|
+
|
|
131
|
+
// Tag types
|
|
132
|
+
export type { TyTagProps as TagProps } from './TyTag';
|
|
133
|
+
|
|
134
|
+
// Input types
|
|
135
|
+
export type { TyInputProps as InputProps, TyInputEventDetail as InputEventDetail } from './TyInput';
|
|
136
|
+
|
|
137
|
+
// Textarea types
|
|
138
|
+
export type { TyTextareaProps as TextareaProps, TyTextareaEventDetail as TextareaEventDetail } from './TyTextarea';
|
|
139
|
+
|
|
140
|
+
// Dropdown types
|
|
141
|
+
export type { TyDropdownProps as DropdownProps, TyDropdownEventDetail as DropdownEventDetail, OptionData } from './TyDropdown';
|
|
142
|
+
|
|
143
|
+
// Option types
|
|
144
|
+
export type { TyOptionProps as OptionProps } from './TyOption';
|
|
145
|
+
|
|
146
|
+
// Icon types
|
|
147
|
+
export type { TyIconProps as IconProps } from './TyIcon';
|
|
148
|
+
|
|
149
|
+
// Modal types
|
|
150
|
+
export type { TyModalProps as ModalProps, TyModalEventDetail as ModalEventDetail, TyModalRef as ModalRef } from './TyModal';
|
|
151
|
+
|
|
152
|
+
// Tooltip types
|
|
153
|
+
export type { TyTooltipProps as TooltipProps } from './TyTooltip';
|
|
154
|
+
|
|
155
|
+
// Multiselect types
|
|
156
|
+
export type { TyMultiselectProps as MultiselectProps, TyMultiselectEventDetail as MultiselectEventDetail } from './TyMultiselect';
|
|
157
|
+
|
|
158
|
+
// Calendar types
|
|
159
|
+
export type { TyCalendarProps as CalendarProps, TyCalendarChangeEventDetail as CalendarChangeEventDetail, TyCalendarNavigateEventDetail as CalendarNavigateEventDetail } from './TyCalendar';
|
|
160
|
+
|
|
161
|
+
// DatePicker types
|
|
162
|
+
export type { TyDatePickerProps as DatePickerProps, TyDatePickerEventDetail as DatePickerEventDetail } from './TyDatePicker';
|
|
163
|
+
|
|
164
|
+
// Popup types
|
|
165
|
+
export type { TyPopupProps as PopupProps, TyPopupElement as PopupElement } from './TyPopup';
|
|
166
|
+
|
|
167
|
+
// Checkbox types
|
|
168
|
+
export type { TyCheckboxProps as CheckboxProps, TyCheckboxEventDetail as CheckboxEventDetail } from './TyCheckbox';
|
|
169
|
+
|
|
170
|
+
// Switch types
|
|
171
|
+
export type { TySwitchProps as SwitchProps, TySwitchEventDetail as SwitchEventDetail } from './TySwitch';
|
|
172
|
+
|
|
173
|
+
// Radio types
|
|
174
|
+
export type { TyRadioProps as RadioProps } from './TyRadio';
|
|
175
|
+
|
|
176
|
+
// RadioGroup types
|
|
177
|
+
export type { TyRadioGroupProps as RadioGroupProps, TyRadioGroupEventDetail as RadioGroupEventDetail } from './TyRadioGroup';
|
|
178
|
+
|
|
179
|
+
// Copy types
|
|
180
|
+
export type { TyCopyProps as CopyProps } from './TyCopy';
|
|
181
|
+
|
|
182
|
+
// Tabs types
|
|
183
|
+
export type { TyTabsProps as TabsProps } from './TyTabs';
|
|
184
|
+
|
|
185
|
+
// Tab types
|
|
186
|
+
export type { TyTabProps as TabProps } from './TyTab';
|
|
187
|
+
|
|
188
|
+
// CalendarMonth types
|
|
189
|
+
export type { TyCalendarMonthProps as CalendarMonthProps } from './TyCalendarMonth';
|
|
190
|
+
|
|
191
|
+
// CalendarNavigation types
|
|
192
|
+
export type { TyCalendarNavigationProps as CalendarNavigationProps } from './TyCalendarNavigation';
|
|
193
|
+
|
|
194
|
+
// Wizard types
|
|
195
|
+
export type { TyWizardProps as WizardProps, WizardStepChangeDetail as StepChangeDetail } from './TyWizard';
|
|
196
|
+
|
|
197
|
+
// Step types
|
|
198
|
+
export type { TyStepProps as StepProps } from './TyStep';
|
|
199
|
+
|
|
200
|
+
// ResizeObserver types
|
|
201
|
+
export type { TyResizeObserverProps as ResizeObserverProps } from './TyResizeObserver';
|
|
202
|
+
|
|
203
|
+
// ScrollContainer types
|
|
204
|
+
export type { TyScrollContainerProps as ScrollContainerProps, TyScrollContainerRef as ScrollContainerRef } from './TyScrollContainer';
|
|
205
|
+
|
|
206
|
+
// ===================================================================
|
|
207
|
+
// USAGE EXAMPLES
|
|
208
|
+
// ===================================================================
|
|
209
|
+
|
|
210
|
+
/*
|
|
211
|
+
|
|
212
|
+
// STYLE 1: Ty-prefixed (Explicit and backward compatible)
|
|
213
|
+
import { TyButton, TyInput, TyModal } from 'tyrell-react';
|
|
214
|
+
import type { TyButtonProps, TyInputProps } from 'tyrell-react';
|
|
215
|
+
|
|
216
|
+
function MyComponent() {
|
|
217
|
+
return (
|
|
218
|
+
<TyModal>
|
|
219
|
+
<TyInput placeholder="Enter text..." />
|
|
220
|
+
<TyButton>Submit</TyButton>
|
|
221
|
+
</TyModal>
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// STYLE 2: Short names (Clean and familiar)
|
|
226
|
+
import { Button, Input, Modal } from 'tyrell-react';
|
|
227
|
+
import type { ButtonProps, InputProps } from 'tyrell-react';
|
|
228
|
+
|
|
229
|
+
function MyComponent() {
|
|
230
|
+
return (
|
|
231
|
+
<Modal>
|
|
232
|
+
<Input placeholder="Enter text..." />
|
|
233
|
+
<Button>Submit</Button>
|
|
234
|
+
</Modal>
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// STYLE 3: Mixed (Team preferences)
|
|
239
|
+
import { TyModal, Input, Button } from 'tyrell-react';
|
|
240
|
+
import type { TyModalProps, InputProps } from 'tyrell-react';
|
|
241
|
+
|
|
242
|
+
function MyComponent() {
|
|
243
|
+
return (
|
|
244
|
+
<TyModal>
|
|
245
|
+
<Input placeholder="Enter text..." />
|
|
246
|
+
<Button>Submit</Button>
|
|
247
|
+
</TyModal>
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
*/
|