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,50 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
// React wrapper for ty-wizard web component
|
|
3
|
+
export const TyWizard = React.forwardRef(({ children, width, height, active, completed, orientation, onStepChange, ...props }, ref) => {
|
|
4
|
+
const elementRef = useRef(null);
|
|
5
|
+
// Handle step change events
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
const element = elementRef.current;
|
|
8
|
+
if (!element)
|
|
9
|
+
return;
|
|
10
|
+
const handleStepChange = (event) => {
|
|
11
|
+
if (onStepChange) {
|
|
12
|
+
onStepChange(event);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
element.addEventListener('ty-wizard-step-change', handleStepChange);
|
|
16
|
+
return () => {
|
|
17
|
+
element.removeEventListener('ty-wizard-step-change', handleStepChange);
|
|
18
|
+
};
|
|
19
|
+
}, [onStepChange]);
|
|
20
|
+
// Combine refs if needed
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (ref && elementRef.current) {
|
|
23
|
+
if (typeof ref === 'function') {
|
|
24
|
+
ref(elementRef.current);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
ref.current = elementRef.current;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}, [ref]);
|
|
31
|
+
// Convert React props to web component attributes
|
|
32
|
+
const webComponentProps = {
|
|
33
|
+
...props,
|
|
34
|
+
ref: elementRef,
|
|
35
|
+
};
|
|
36
|
+
// Add string attributes
|
|
37
|
+
if (width)
|
|
38
|
+
webComponentProps.width = width;
|
|
39
|
+
if (height)
|
|
40
|
+
webComponentProps.height = height;
|
|
41
|
+
if (active)
|
|
42
|
+
webComponentProps.active = active;
|
|
43
|
+
if (completed)
|
|
44
|
+
webComponentProps.completed = completed;
|
|
45
|
+
if (orientation)
|
|
46
|
+
webComponentProps.orientation = orientation;
|
|
47
|
+
return React.createElement('ty-wizard', webComponentProps, children);
|
|
48
|
+
});
|
|
49
|
+
TyWizard.displayName = 'TyWizard';
|
|
50
|
+
//# sourceMappingURL=TyWizard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TyWizard.js","sourceRoot":"","sources":["../../src/components/TyWizard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAkCjD,4CAA4C;AAC5C,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CACtC,CAAC,EACC,QAAQ,EACR,KAAK,EACL,MAAM,EACN,MAAM,EACN,SAAS,EACT,WAAW,EACX,YAAY,EACZ,GAAG,KAAK,EACT,EAAE,GAAG,EAAE,EAAE;IACR,MAAM,UAAU,GAAG,MAAM,CAAc,IAAI,CAAC,CAAC;IAE7C,4BAA4B;IAC5B,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;QACnC,IAAI,CAAC,OAAO;YAAE,OAAO;QAErB,MAAM,gBAAgB,GAAG,CAAC,KAAY,EAAE,EAAE;YACxC,IAAI,YAAY,EAAE,CAAC;gBACjB,YAAY,CAAC,KAA4C,CAAC,CAAC;YAC7D,CAAC;QACH,CAAC,CAAC;QAEF,OAAO,CAAC,gBAAgB,CAAC,uBAAuB,EAAE,gBAAgB,CAAC,CAAC;QAEpE,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,mBAAmB,CAAC,uBAAuB,EAAE,gBAAgB,CAAC,CAAC;QACzE,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,yBAAyB;IACzB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,GAAG,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;YAC9B,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,CAAC;gBAC9B,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YAC1B,CAAC;iBAAM,CAAC;gBACN,GAAG,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;YACnC,CAAC;QACH,CAAC;IACH,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEV,kDAAkD;IAClD,MAAM,iBAAiB,GAAwB;QAC7C,GAAG,KAAK;QACR,GAAG,EAAE,UAAU;KAChB,CAAC;IAEF,wBAAwB;IACxB,IAAI,KAAK;QAAE,iBAAiB,CAAC,KAAK,GAAG,KAAK,CAAC;IAC3C,IAAI,MAAM;QAAE,iBAAiB,CAAC,MAAM,GAAG,MAAM,CAAC;IAC9C,IAAI,MAAM;QAAE,iBAAiB,CAAC,MAAM,GAAG,MAAM,CAAC;IAC9C,IAAI,SAAS;QAAE,iBAAiB,CAAC,SAAS,GAAG,SAAS,CAAC;IACvD,IAAI,WAAW;QAAE,iBAAiB,CAAC,WAAW,GAAG,WAAW,CAAC;IAE7D,OAAO,KAAK,CAAC,aAAa,CACxB,WAAW,EACX,iBAAiB,EACjB,QAAQ,CACT,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
export { TyButton } from './TyButton';
|
|
2
|
+
export type { TyButtonProps, TyButtonCSSProperties } from './TyButton';
|
|
3
|
+
export { TyTag } from './TyTag';
|
|
4
|
+
export type { TyTagProps, TyTagCSSProperties } from './TyTag';
|
|
5
|
+
export { TyInput } from './TyInput';
|
|
6
|
+
export type { TyInputProps, TyInputEventDetail, TyInputCSSProperties } from './TyInput';
|
|
7
|
+
export { TyTextarea } from './TyTextarea';
|
|
8
|
+
export type { TyTextareaProps, TyTextareaEventDetail } from './TyTextarea';
|
|
9
|
+
export { TyDropdown } from './TyDropdown';
|
|
10
|
+
export type { TyDropdownProps, TyDropdownEventDetail } from './TyDropdown';
|
|
11
|
+
export { TyOption } from './TyOption';
|
|
12
|
+
export type { TyOptionProps } from './TyOption';
|
|
13
|
+
export { TyIcon } from './TyIcon';
|
|
14
|
+
export type { TyIconProps } from './TyIcon';
|
|
15
|
+
export { TyModal } from './TyModal';
|
|
16
|
+
export type { TyModalProps, TyModalEventDetail, TyModalRef } from './TyModal';
|
|
17
|
+
export { TyTooltip } from './TyTooltip';
|
|
18
|
+
export type { TyTooltipProps } from './TyTooltip';
|
|
19
|
+
export { TyMultiselect } from './TyMultiselect';
|
|
20
|
+
export type { TyMultiselectProps, TyMultiselectEventDetail } from './TyMultiselect';
|
|
21
|
+
export { TyCalendar } from './TyCalendar';
|
|
22
|
+
export type { TyCalendarProps, TyCalendarChangeEventDetail, TyCalendarNavigateEventDetail } from './TyCalendar';
|
|
23
|
+
export { TyDatePicker } from './TyDatePicker';
|
|
24
|
+
export type { TyDatePickerProps, TyDatePickerEventDetail } from './TyDatePicker';
|
|
25
|
+
export { TyPopup } from './TyPopup';
|
|
26
|
+
export type { TyPopupProps, TyPopupElement } from './TyPopup';
|
|
27
|
+
export { TyCheckbox } from './TyCheckbox';
|
|
28
|
+
export type { TyCheckboxProps, TyCheckboxEventDetail } from './TyCheckbox';
|
|
29
|
+
export { TySwitch } from './TySwitch';
|
|
30
|
+
export type { TySwitchProps, TySwitchEventDetail } from './TySwitch';
|
|
31
|
+
export { TyRadio } from './TyRadio';
|
|
32
|
+
export type { TyRadioProps } from './TyRadio';
|
|
33
|
+
export { TyRadioGroup } from './TyRadioGroup';
|
|
34
|
+
export type { TyRadioGroupProps, TyRadioGroupEventDetail } from './TyRadioGroup';
|
|
35
|
+
export { TyCopy } from './TyCopy';
|
|
36
|
+
export type { TyCopyProps } from './TyCopy';
|
|
37
|
+
export { TyTabs } from './TyTabs';
|
|
38
|
+
export type { TyTabsProps, TabChangeDetail } from './TyTabs';
|
|
39
|
+
export { TyTab } from './TyTab';
|
|
40
|
+
export type { TyTabProps } from './TyTab';
|
|
41
|
+
export { TyCalendarMonth } from './TyCalendarMonth';
|
|
42
|
+
export type { TyCalendarMonthProps, DayClickDetail } from './TyCalendarMonth';
|
|
43
|
+
export { TyCalendarNavigation } from './TyCalendarNavigation';
|
|
44
|
+
export type { TyCalendarNavigationProps, NavigationChangeDetail } from './TyCalendarNavigation';
|
|
45
|
+
export { TyWizard } from './TyWizard';
|
|
46
|
+
export type { TyWizardProps, WizardStepChangeDetail } from './TyWizard';
|
|
47
|
+
export { TyStep } from './TyStep';
|
|
48
|
+
export type { TyStepProps } from './TyStep';
|
|
49
|
+
export { TyResizeObserver } from './TyResizeObserver';
|
|
50
|
+
export type { TyResizeObserverProps } from './TyResizeObserver';
|
|
51
|
+
export { TyScrollContainer } from './TyScrollContainer';
|
|
52
|
+
export type { TyScrollContainerProps, TyScrollContainerRef } from './TyScrollContainer';
|
|
53
|
+
export { TyButton as Button } from './TyButton';
|
|
54
|
+
export { TyTag as Tag } from './TyTag';
|
|
55
|
+
export { TyInput as Input } from './TyInput';
|
|
56
|
+
export { TyTextarea as Textarea } from './TyTextarea';
|
|
57
|
+
export { TyDropdown as Dropdown } from './TyDropdown';
|
|
58
|
+
export { TyOption as Option } from './TyOption';
|
|
59
|
+
export { TyIcon as Icon } from './TyIcon';
|
|
60
|
+
export { TyModal as Modal } from './TyModal';
|
|
61
|
+
export { TyTooltip as Tooltip } from './TyTooltip';
|
|
62
|
+
export { TyMultiselect as Multiselect } from './TyMultiselect';
|
|
63
|
+
export { TyCalendar as Calendar } from './TyCalendar';
|
|
64
|
+
export { TyDatePicker as DatePicker } from './TyDatePicker';
|
|
65
|
+
export { TyPopup as Popup } from './TyPopup';
|
|
66
|
+
export { TyCheckbox as Checkbox } from './TyCheckbox';
|
|
67
|
+
export { TySwitch as Switch } from './TySwitch';
|
|
68
|
+
export { TyRadio as Radio } from './TyRadio';
|
|
69
|
+
export { TyRadioGroup as RadioGroup } from './TyRadioGroup';
|
|
70
|
+
export { TyCopy as Copy } from './TyCopy';
|
|
71
|
+
export { TyTabs as Tabs } from './TyTabs';
|
|
72
|
+
export { TyTab as Tab } from './TyTab';
|
|
73
|
+
export { TyCalendarMonth as CalendarMonth } from './TyCalendarMonth';
|
|
74
|
+
export { TyCalendarNavigation as CalendarNavigation } from './TyCalendarNavigation';
|
|
75
|
+
export { TyWizard as Wizard } from './TyWizard';
|
|
76
|
+
export { TyStep as Step } from './TyStep';
|
|
77
|
+
export { TyResizeObserver as ResizeObserver } from './TyResizeObserver';
|
|
78
|
+
export { TyScrollContainer as ScrollContainer } from './TyScrollContainer';
|
|
79
|
+
export type { TyButtonProps as ButtonProps } from './TyButton';
|
|
80
|
+
export type { TyTagProps as TagProps } from './TyTag';
|
|
81
|
+
export type { TyInputProps as InputProps, TyInputEventDetail as InputEventDetail } from './TyInput';
|
|
82
|
+
export type { TyTextareaProps as TextareaProps, TyTextareaEventDetail as TextareaEventDetail } from './TyTextarea';
|
|
83
|
+
export type { TyDropdownProps as DropdownProps, TyDropdownEventDetail as DropdownEventDetail, OptionData } from './TyDropdown';
|
|
84
|
+
export type { TyOptionProps as OptionProps } from './TyOption';
|
|
85
|
+
export type { TyIconProps as IconProps } from './TyIcon';
|
|
86
|
+
export type { TyModalProps as ModalProps, TyModalEventDetail as ModalEventDetail, TyModalRef as ModalRef } from './TyModal';
|
|
87
|
+
export type { TyTooltipProps as TooltipProps } from './TyTooltip';
|
|
88
|
+
export type { TyMultiselectProps as MultiselectProps, TyMultiselectEventDetail as MultiselectEventDetail } from './TyMultiselect';
|
|
89
|
+
export type { TyCalendarProps as CalendarProps, TyCalendarChangeEventDetail as CalendarChangeEventDetail, TyCalendarNavigateEventDetail as CalendarNavigateEventDetail } from './TyCalendar';
|
|
90
|
+
export type { TyDatePickerProps as DatePickerProps, TyDatePickerEventDetail as DatePickerEventDetail } from './TyDatePicker';
|
|
91
|
+
export type { TyPopupProps as PopupProps, TyPopupElement as PopupElement } from './TyPopup';
|
|
92
|
+
export type { TyCheckboxProps as CheckboxProps, TyCheckboxEventDetail as CheckboxEventDetail } from './TyCheckbox';
|
|
93
|
+
export type { TySwitchProps as SwitchProps, TySwitchEventDetail as SwitchEventDetail } from './TySwitch';
|
|
94
|
+
export type { TyRadioProps as RadioProps } from './TyRadio';
|
|
95
|
+
export type { TyRadioGroupProps as RadioGroupProps, TyRadioGroupEventDetail as RadioGroupEventDetail } from './TyRadioGroup';
|
|
96
|
+
export type { TyCopyProps as CopyProps } from './TyCopy';
|
|
97
|
+
export type { TyTabsProps as TabsProps } from './TyTabs';
|
|
98
|
+
export type { TyTabProps as TabProps } from './TyTab';
|
|
99
|
+
export type { TyCalendarMonthProps as CalendarMonthProps } from './TyCalendarMonth';
|
|
100
|
+
export type { TyCalendarNavigationProps as CalendarNavigationProps } from './TyCalendarNavigation';
|
|
101
|
+
export type { TyWizardProps as WizardProps, WizardStepChangeDetail as StepChangeDetail } from './TyWizard';
|
|
102
|
+
export type { TyStepProps as StepProps } from './TyStep';
|
|
103
|
+
export type { TyResizeObserverProps as ResizeObserverProps } from './TyResizeObserver';
|
|
104
|
+
export type { TyScrollContainerProps as ScrollContainerProps, TyScrollContainerRef as ScrollContainerRef } from './TyScrollContainer';
|
|
105
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEvE,OAAO,E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E,aAAa,IAAI,WAAW,EAAE,sBAAsB,IAAI,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAG3G,YAAY,EAAE,WAAW,IAAI,SAAS,EAAE,MAAM,UAAU,CAAC;AAGzD,YAAY,EAAE,qBAAqB,IAAI,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGvF,YAAY,EAAE,sBAAsB,IAAI,oBAAoB,EAAE,oBAAoB,IAAI,kBAAkB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
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
|
+
// TY-PREFIXED EXPORTS (Explicit Style - Backward Compatible)
|
|
11
|
+
// ===================================================================
|
|
12
|
+
export { TyButton } from './TyButton';
|
|
13
|
+
export { TyTag } from './TyTag';
|
|
14
|
+
export { TyInput } from './TyInput';
|
|
15
|
+
export { TyTextarea } from './TyTextarea';
|
|
16
|
+
export { TyDropdown } from './TyDropdown';
|
|
17
|
+
export { TyOption } from './TyOption';
|
|
18
|
+
export { TyIcon } from './TyIcon';
|
|
19
|
+
export { TyModal } from './TyModal';
|
|
20
|
+
export { TyTooltip } from './TyTooltip';
|
|
21
|
+
export { TyMultiselect } from './TyMultiselect';
|
|
22
|
+
export { TyCalendar } from './TyCalendar';
|
|
23
|
+
export { TyDatePicker } from './TyDatePicker';
|
|
24
|
+
export { TyPopup } from './TyPopup';
|
|
25
|
+
export { TyCheckbox } from './TyCheckbox';
|
|
26
|
+
export { TySwitch } from './TySwitch';
|
|
27
|
+
export { TyRadio } from './TyRadio';
|
|
28
|
+
export { TyRadioGroup } from './TyRadioGroup';
|
|
29
|
+
export { TyCopy } from './TyCopy';
|
|
30
|
+
export { TyTabs } from './TyTabs';
|
|
31
|
+
export { TyTab } from './TyTab';
|
|
32
|
+
export { TyCalendarMonth } from './TyCalendarMonth';
|
|
33
|
+
export { TyCalendarNavigation } from './TyCalendarNavigation';
|
|
34
|
+
export { TyWizard } from './TyWizard';
|
|
35
|
+
export { TyStep } from './TyStep';
|
|
36
|
+
export { TyResizeObserver } from './TyResizeObserver';
|
|
37
|
+
export { TyScrollContainer } from './TyScrollContainer';
|
|
38
|
+
// ===================================================================
|
|
39
|
+
// SHORT NAME EXPORTS (Clean Style - Developer Choice)
|
|
40
|
+
// ===================================================================
|
|
41
|
+
export { TyButton as Button } from './TyButton';
|
|
42
|
+
export { TyTag as Tag } from './TyTag';
|
|
43
|
+
export { TyInput as Input } from './TyInput';
|
|
44
|
+
export { TyTextarea as Textarea } from './TyTextarea';
|
|
45
|
+
export { TyDropdown as Dropdown } from './TyDropdown';
|
|
46
|
+
export { TyOption as Option } from './TyOption';
|
|
47
|
+
export { TyIcon as Icon } from './TyIcon';
|
|
48
|
+
export { TyModal as Modal } from './TyModal';
|
|
49
|
+
export { TyTooltip as Tooltip } from './TyTooltip';
|
|
50
|
+
export { TyMultiselect as Multiselect } from './TyMultiselect';
|
|
51
|
+
export { TyCalendar as Calendar } from './TyCalendar';
|
|
52
|
+
export { TyDatePicker as DatePicker } from './TyDatePicker';
|
|
53
|
+
export { TyPopup as Popup } from './TyPopup';
|
|
54
|
+
export { TyCheckbox as Checkbox } from './TyCheckbox';
|
|
55
|
+
export { TySwitch as Switch } from './TySwitch';
|
|
56
|
+
export { TyRadio as Radio } from './TyRadio';
|
|
57
|
+
export { TyRadioGroup as RadioGroup } from './TyRadioGroup';
|
|
58
|
+
export { TyCopy as Copy } from './TyCopy';
|
|
59
|
+
export { TyTabs as Tabs } from './TyTabs';
|
|
60
|
+
export { TyTab as Tab } from './TyTab';
|
|
61
|
+
export { TyCalendarMonth as CalendarMonth } from './TyCalendarMonth';
|
|
62
|
+
export { TyCalendarNavigation as CalendarNavigation } from './TyCalendarNavigation';
|
|
63
|
+
export { TyWizard as Wizard } from './TyWizard';
|
|
64
|
+
export { TyStep as Step } from './TyStep';
|
|
65
|
+
export { TyResizeObserver as ResizeObserver } from './TyResizeObserver';
|
|
66
|
+
export { TyScrollContainer as ScrollContainer } from './TyScrollContainer';
|
|
67
|
+
// ===================================================================
|
|
68
|
+
// USAGE EXAMPLES
|
|
69
|
+
// ===================================================================
|
|
70
|
+
/*
|
|
71
|
+
|
|
72
|
+
// STYLE 1: Ty-prefixed (Explicit and backward compatible)
|
|
73
|
+
import { TyButton, TyInput, TyModal } from 'tyrell-react';
|
|
74
|
+
import type { TyButtonProps, TyInputProps } from 'tyrell-react';
|
|
75
|
+
|
|
76
|
+
function MyComponent() {
|
|
77
|
+
return (
|
|
78
|
+
<TyModal>
|
|
79
|
+
<TyInput placeholder="Enter text..." />
|
|
80
|
+
<TyButton>Submit</TyButton>
|
|
81
|
+
</TyModal>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// STYLE 2: Short names (Clean and familiar)
|
|
86
|
+
import { Button, Input, Modal } from 'tyrell-react';
|
|
87
|
+
import type { ButtonProps, InputProps } from 'tyrell-react';
|
|
88
|
+
|
|
89
|
+
function MyComponent() {
|
|
90
|
+
return (
|
|
91
|
+
<Modal>
|
|
92
|
+
<Input placeholder="Enter text..." />
|
|
93
|
+
<Button>Submit</Button>
|
|
94
|
+
</Modal>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// STYLE 3: Mixed (Team preferences)
|
|
99
|
+
import { TyModal, Input, Button } from 'tyrell-react';
|
|
100
|
+
import type { TyModalProps, InputProps } from 'tyrell-react';
|
|
101
|
+
|
|
102
|
+
function MyComponent() {
|
|
103
|
+
return (
|
|
104
|
+
<TyModal>
|
|
105
|
+
<Input placeholder="Enter text..." />
|
|
106
|
+
<Button>Submit</Button>
|
|
107
|
+
</TyModal>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
*/
|
|
112
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,+BAA+B;AAC/B,sEAAsE;AACtE,0EAA0E;AAC1E,gFAAgF;AAChF,iFAAiF;AACjF,EAAE;AACF,sDAAsD;AAEtD,sEAAsE;AACtE,6DAA6D;AAC7D,sEAAsE;AAEtE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,YAAY,EAAE,MAAM,g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EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,UAAU,IAAI,QAAQ,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,QAAQ,IAAI,MAAM,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,YAAY,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,MAAM,IAAI,IAAI,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,MAAM,IAAI,IAAI,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,KAAK,IAAI,GAAG,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,eAAe,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,oBAAoB,IAAI,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,EAAE,QAAQ,IAAI,MAAM,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,MAAM,IAAI,IAAI,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,gBAAgB,IAAI,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,iBAAiB,IAAI,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAoF3E,sEAAsE;AACtE,iBAAiB;AACjB,sEAAsE;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyCE"}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tyrell-react",
|
|
3
|
+
"version": "1.0.0-TC10",
|
|
4
|
+
"description": "React wrappers for Tyrell Components",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/components/index.js",
|
|
7
|
+
"types": "./dist/components/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist/**/*",
|
|
10
|
+
"src/**/*",
|
|
11
|
+
"README.md",
|
|
12
|
+
"LICENSE"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"clean": "rm -rf dist",
|
|
17
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
18
|
+
},
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"react": ">=18.0.0",
|
|
21
|
+
"react-dom": ">=18.0.0"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/react": "^18.2.66",
|
|
25
|
+
"@types/react-dom": "^18.2.22",
|
|
26
|
+
"typescript": "^5.7.0"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"react",
|
|
30
|
+
"web-components",
|
|
31
|
+
"typescript",
|
|
32
|
+
"ui-components",
|
|
33
|
+
"tyrell",
|
|
34
|
+
"wrapper",
|
|
35
|
+
"clojurescript",
|
|
36
|
+
"reagent",
|
|
37
|
+
"uix"
|
|
38
|
+
],
|
|
39
|
+
"author": "Gersak <dev@gersak.io>",
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "git+https://github.com/gersak/tyrell.git",
|
|
44
|
+
"directory": "packages/react"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test Example: React Event Convention
|
|
3
|
+
*
|
|
4
|
+
* This file demonstrates the new event handling convention
|
|
5
|
+
* for tyrell-react components.
|
|
6
|
+
*
|
|
7
|
+
* To test:
|
|
8
|
+
* 1. Create a new React project or use existing
|
|
9
|
+
* 2. npm install tyrell-react
|
|
10
|
+
* 3. Add this component to your app
|
|
11
|
+
* 4. Observe console logs and state updates
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import React, { useState } from 'react';
|
|
15
|
+
import { TyInput } from './TyInput';
|
|
16
|
+
import { TyTextarea } from './TyTextarea';
|
|
17
|
+
import { TyCheckbox } from './TyCheckbox';
|
|
18
|
+
import type { TyInputEventDetail } from './TyInput';
|
|
19
|
+
import type { TyTextareaEventDetail } from './TyTextarea';
|
|
20
|
+
import type { TyCheckboxEventDetail } from './TyCheckbox';
|
|
21
|
+
|
|
22
|
+
export function EventConventionTest() {
|
|
23
|
+
const [inputValue, setInputValue] = useState('');
|
|
24
|
+
const [textareaValue, setTextareaValue] = useState('');
|
|
25
|
+
const [checked, setChecked] = useState(false);
|
|
26
|
+
const [logs, setLogs] = useState<string[]>([]);
|
|
27
|
+
|
|
28
|
+
const addLog = (message: string) => {
|
|
29
|
+
setLogs(prev => [...prev, `${new Date().toLocaleTimeString()}: ${message}`]);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div className="p-8 space-y-6 max-w-2xl">
|
|
34
|
+
<h1 className="text-2xl font-bold">React Event Convention Test</h1>
|
|
35
|
+
|
|
36
|
+
{/* Input Test */}
|
|
37
|
+
<div className="space-y-2">
|
|
38
|
+
<h2 className="text-lg font-semibold">TyInput Test</h2>
|
|
39
|
+
<TyInput
|
|
40
|
+
label="Email"
|
|
41
|
+
placeholder="Type to test onChange..."
|
|
42
|
+
value={inputValue}
|
|
43
|
+
onChange={(e: CustomEvent<TyInputEventDetail>) => {
|
|
44
|
+
setInputValue(e.detail.value);
|
|
45
|
+
addLog(`onChange: "${e.detail.value}" (fires on keystroke)`);
|
|
46
|
+
}}
|
|
47
|
+
onChangeCommit={(e: CustomEvent<TyInputEventDetail>) => {
|
|
48
|
+
addLog(`onChangeCommit: "${e.detail.value}" (fires on blur)`);
|
|
49
|
+
}}
|
|
50
|
+
onFocus={() => addLog('onFocus')}
|
|
51
|
+
onBlur={() => addLog('onBlur')}
|
|
52
|
+
/>
|
|
53
|
+
<p className="text-sm text-gray-600">
|
|
54
|
+
Current value: <strong>{inputValue}</strong>
|
|
55
|
+
</p>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
{/* Textarea Test */}
|
|
59
|
+
<div className="space-y-2">
|
|
60
|
+
<h2 className="text-lg font-semibold">TyTextarea Test</h2>
|
|
61
|
+
<TyTextarea
|
|
62
|
+
label="Comments"
|
|
63
|
+
placeholder="Type to test onChange..."
|
|
64
|
+
value={textareaValue}
|
|
65
|
+
rows={3}
|
|
66
|
+
onChange={(e: CustomEvent<TyTextareaEventDetail>) => {
|
|
67
|
+
setTextareaValue(e.detail.value);
|
|
68
|
+
addLog(`Textarea onChange: "${e.detail.value}"`);
|
|
69
|
+
}}
|
|
70
|
+
onChangeCommit={(e: CustomEvent<TyTextareaEventDetail>) => {
|
|
71
|
+
addLog(`Textarea onChangeCommit: "${e.detail.value}"`);
|
|
72
|
+
}}
|
|
73
|
+
/>
|
|
74
|
+
<p className="text-sm text-gray-600">
|
|
75
|
+
Current value: <strong>{textareaValue}</strong>
|
|
76
|
+
</p>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
{/* Checkbox Test */}
|
|
80
|
+
<div className="space-y-2">
|
|
81
|
+
<h2 className="text-lg font-semibold">TyCheckbox Test</h2>
|
|
82
|
+
<TyCheckbox
|
|
83
|
+
checked={checked}
|
|
84
|
+
onChange={(e: CustomEvent<TyCheckboxEventDetail>) => {
|
|
85
|
+
setChecked(e.detail.checked);
|
|
86
|
+
addLog(`Checkbox onChange: ${e.detail.checked} (fires immediately)`);
|
|
87
|
+
}}
|
|
88
|
+
onChangeCommit={(e: CustomEvent<TyCheckboxEventDetail>) => {
|
|
89
|
+
addLog(`Checkbox onChangeCommit: ${e.detail.checked} (fires on blur)`);
|
|
90
|
+
}}
|
|
91
|
+
>
|
|
92
|
+
Subscribe to newsletter
|
|
93
|
+
</TyCheckbox>
|
|
94
|
+
<p className="text-sm text-gray-600">
|
|
95
|
+
Current state: <strong>{checked ? 'Checked' : 'Unchecked'}</strong>
|
|
96
|
+
</p>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
{/* Event Log */}
|
|
100
|
+
<div className="space-y-2">
|
|
101
|
+
<h2 className="text-lg font-semibold">Event Log</h2>
|
|
102
|
+
<div className="bg-gray-100 p-4 rounded max-h-64 overflow-y-auto font-mono text-xs">
|
|
103
|
+
{logs.length === 0 ? (
|
|
104
|
+
<p className="text-gray-500">No events yet. Start typing or checking boxes!</p>
|
|
105
|
+
) : (
|
|
106
|
+
logs.map((log, i) => (
|
|
107
|
+
<div key={i} className="text-gray-800">
|
|
108
|
+
{log}
|
|
109
|
+
</div>
|
|
110
|
+
))
|
|
111
|
+
)}
|
|
112
|
+
</div>
|
|
113
|
+
<button
|
|
114
|
+
onClick={() => setLogs([])}
|
|
115
|
+
className="px-4 py-2 bg-gray-200 rounded hover:bg-gray-300"
|
|
116
|
+
>
|
|
117
|
+
Clear Log
|
|
118
|
+
</button>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
{/* Expected Behavior */}
|
|
122
|
+
<div className="bg-blue-50 p-4 rounded">
|
|
123
|
+
<h3 className="font-semibold mb-2">Expected Behavior:</h3>
|
|
124
|
+
<ul className="list-disc list-inside space-y-1 text-sm">
|
|
125
|
+
<li>
|
|
126
|
+
<strong>onChange</strong> - Fires on every keystroke/state change (React convention)
|
|
127
|
+
</li>
|
|
128
|
+
<li>
|
|
129
|
+
<strong>onChangeCommit</strong> - Fires on blur if value changed (optional)
|
|
130
|
+
</li>
|
|
131
|
+
<li>
|
|
132
|
+
<strong>onFocus</strong> - Fires when element gains focus
|
|
133
|
+
</li>
|
|
134
|
+
<li>
|
|
135
|
+
<strong>onBlur</strong> - Fires when element loses focus
|
|
136
|
+
</li>
|
|
137
|
+
</ul>
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
{/* Verification */}
|
|
141
|
+
<div className="bg-green-50 p-4 rounded">
|
|
142
|
+
<h3 className="font-semibold mb-2">Verification Checklist:</h3>
|
|
143
|
+
<ul className="list-disc list-inside space-y-1 text-sm">
|
|
144
|
+
<li>✅ onChange fires on EVERY keystroke (not just on blur)</li>
|
|
145
|
+
<li>✅ State updates in real-time as you type</li>
|
|
146
|
+
<li>✅ onChangeCommit fires ONLY on blur (if value changed)</li>
|
|
147
|
+
<li>✅ Event order: onChange → onBlur → onChangeCommit</li>
|
|
148
|
+
<li>✅ Checkbox onChange fires immediately on click</li>
|
|
149
|
+
</ul>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export default EventConventionTest;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
type BuiltinFlavor = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'neutral';
|
|
4
|
+
type ShadedFlavor = BuiltinFlavor | `${BuiltinFlavor}+` | `${BuiltinFlavor}-`;
|
|
5
|
+
type ButtonAppearance = 'solid' | 'outlined' | 'ghost';
|
|
6
|
+
|
|
7
|
+
export interface TyButtonCSSProperties extends React.CSSProperties {
|
|
8
|
+
'--ty-button-bg'?: string;
|
|
9
|
+
'--ty-button-bg-hover'?: string;
|
|
10
|
+
'--ty-button-color'?: string;
|
|
11
|
+
'--ty-button-border'?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface TyButtonProps extends Omit<React.HTMLAttributes<HTMLElement>, 'style'> {
|
|
15
|
+
style?: TyButtonCSSProperties;
|
|
16
|
+
/**
|
|
17
|
+
* Semantic styling variant. Built-in flavors get themed styles; append `+`
|
|
18
|
+
* for a stronger shade or `-` for a softer one (e.g. `"primary+"`,
|
|
19
|
+
* `"danger-"`). Any other string is passed through as-is — theme it via
|
|
20
|
+
* `--ty-button-*` CSS variables.
|
|
21
|
+
*/
|
|
22
|
+
flavor?: ShadedFlavor | (string & {});
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Visual appearance:
|
|
26
|
+
* - `"solid"` (default) — saturated brand fill with paired text color
|
|
27
|
+
* - `"outlined"` — transparent background, text === border
|
|
28
|
+
* - `"ghost"` — text only with hover background
|
|
29
|
+
*/
|
|
30
|
+
appearance?: ButtonAppearance;
|
|
31
|
+
|
|
32
|
+
/** Button size */
|
|
33
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
34
|
+
|
|
35
|
+
/** Button type for form submission */
|
|
36
|
+
type?: 'button' | 'submit' | 'reset';
|
|
37
|
+
|
|
38
|
+
/** Disable the button */
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
|
|
41
|
+
/** Pill-shaped button (rounded ends) */
|
|
42
|
+
pill?: boolean;
|
|
43
|
+
|
|
44
|
+
/** Action (icon-only square) */
|
|
45
|
+
action?: boolean;
|
|
46
|
+
|
|
47
|
+
/** Accessible label for screen readers */
|
|
48
|
+
label?: string;
|
|
49
|
+
|
|
50
|
+
/** Form field name for form submission */
|
|
51
|
+
name?: string;
|
|
52
|
+
|
|
53
|
+
/** Form field value for form submission */
|
|
54
|
+
value?: string;
|
|
55
|
+
|
|
56
|
+
/** Full-width button */
|
|
57
|
+
wide?: boolean;
|
|
58
|
+
|
|
59
|
+
/** Button content */
|
|
60
|
+
children?: React.ReactNode;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const TyButton = React.forwardRef<HTMLElement, TyButtonProps>(
|
|
64
|
+
({
|
|
65
|
+
children,
|
|
66
|
+
type,
|
|
67
|
+
appearance,
|
|
68
|
+
disabled,
|
|
69
|
+
pill,
|
|
70
|
+
action,
|
|
71
|
+
wide,
|
|
72
|
+
label,
|
|
73
|
+
name,
|
|
74
|
+
value,
|
|
75
|
+
onClick,
|
|
76
|
+
...props
|
|
77
|
+
}, ref) => {
|
|
78
|
+
const elementRef = useRef<HTMLElement>(null);
|
|
79
|
+
|
|
80
|
+
// Imperatively attach the click listener so onClick reliably fires for the
|
|
81
|
+
// CustomEvent('click') that <ty-button> re-dispatches on its host (the
|
|
82
|
+
// inner <button> calls stopPropagation, so React's delegated onClick can
|
|
83
|
+
// miss it). Also handles type=submit by dispatching a synthetic submit.
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
const element = elementRef.current;
|
|
86
|
+
if (!element) return;
|
|
87
|
+
|
|
88
|
+
const handler = (event: Event) => {
|
|
89
|
+
if (type === 'submit') {
|
|
90
|
+
const form = element.closest('form');
|
|
91
|
+
if (form) {
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
event.stopPropagation();
|
|
94
|
+
form.dispatchEvent(new Event('submit', {
|
|
95
|
+
bubbles: true,
|
|
96
|
+
cancelable: true,
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (onClick) {
|
|
101
|
+
onClick(event as unknown as React.MouseEvent<HTMLElement>);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
element.addEventListener('click', handler);
|
|
106
|
+
return () => {
|
|
107
|
+
element.removeEventListener('click', handler);
|
|
108
|
+
};
|
|
109
|
+
}, [type, onClick]);
|
|
110
|
+
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
if (ref && elementRef.current) {
|
|
113
|
+
if (typeof ref === 'function') {
|
|
114
|
+
ref(elementRef.current);
|
|
115
|
+
} else {
|
|
116
|
+
ref.current = elementRef.current;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}, [ref]);
|
|
120
|
+
|
|
121
|
+
const webComponentProps: Record<string, any> = {
|
|
122
|
+
...props,
|
|
123
|
+
ref: elementRef,
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
if (disabled) webComponentProps.disabled = '';
|
|
127
|
+
if (pill) webComponentProps.pill = '';
|
|
128
|
+
if (action) webComponentProps.action = '';
|
|
129
|
+
if (wide) webComponentProps.wide = '';
|
|
130
|
+
|
|
131
|
+
if (appearance) webComponentProps.appearance = appearance;
|
|
132
|
+
if (type) webComponentProps.type = type;
|
|
133
|
+
if (label) webComponentProps.label = label;
|
|
134
|
+
if (name) webComponentProps.name = name;
|
|
135
|
+
if (value) webComponentProps.value = value;
|
|
136
|
+
|
|
137
|
+
return React.createElement(
|
|
138
|
+
'ty-button',
|
|
139
|
+
webComponentProps,
|
|
140
|
+
children
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
TyButton.displayName = 'TyButton';
|