tyrell-react 1.0.0-TC29 → 1.0.0-TC30
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/dist/components/TyButton.d.ts.map +1 -1
- package/dist/components/TyButton.js +2 -1
- package/dist/components/TyButton.js.map +1 -1
- package/dist/components/TyCalendar.d.ts.map +1 -1
- package/dist/components/TyCalendar.js +2 -1
- package/dist/components/TyCalendar.js.map +1 -1
- package/dist/components/TyCalendarMonth.d.ts.map +1 -1
- package/dist/components/TyCalendarMonth.js +2 -1
- package/dist/components/TyCalendarMonth.js.map +1 -1
- package/dist/components/TyCalendarNavigation.d.ts.map +1 -1
- package/dist/components/TyCalendarNavigation.js +2 -1
- package/dist/components/TyCalendarNavigation.js.map +1 -1
- package/dist/components/TyCheckbox.d.ts.map +1 -1
- package/dist/components/TyCheckbox.js +2 -1
- package/dist/components/TyCheckbox.js.map +1 -1
- package/dist/components/TyCopy.d.ts.map +1 -1
- package/dist/components/TyCopy.js +2 -1
- package/dist/components/TyCopy.js.map +1 -1
- package/dist/components/TyDatePicker.d.ts.map +1 -1
- package/dist/components/TyDatePicker.js +2 -1
- package/dist/components/TyDatePicker.js.map +1 -1
- package/dist/components/TyFileUpload.d.ts.map +1 -1
- package/dist/components/TyFileUpload.js +2 -1
- package/dist/components/TyFileUpload.js.map +1 -1
- package/dist/components/TyInput.d.ts.map +1 -1
- package/dist/components/TyInput.js +2 -1
- package/dist/components/TyInput.js.map +1 -1
- package/dist/components/TyModal.d.ts.map +1 -1
- package/dist/components/TyModal.js +2 -1
- package/dist/components/TyModal.js.map +1 -1
- package/dist/components/TyOption.d.ts.map +1 -1
- package/dist/components/TyOption.js +2 -1
- package/dist/components/TyOption.js.map +1 -1
- package/dist/components/TyPopup.d.ts.map +1 -1
- package/dist/components/TyPopup.js +2 -1
- package/dist/components/TyPopup.js.map +1 -1
- package/dist/components/TyRadio.d.ts.map +1 -1
- package/dist/components/TyRadio.js +2 -1
- package/dist/components/TyRadio.js.map +1 -1
- package/dist/components/TyRadioGroup.d.ts.map +1 -1
- package/dist/components/TyRadioGroup.js +2 -1
- package/dist/components/TyRadioGroup.js.map +1 -1
- package/dist/components/TyResizeObserver.d.ts.map +1 -1
- package/dist/components/TyResizeObserver.js +2 -1
- package/dist/components/TyResizeObserver.js.map +1 -1
- package/dist/components/TyScrollContainer.d.ts.map +1 -1
- package/dist/components/TyScrollContainer.js +2 -1
- package/dist/components/TyScrollContainer.js.map +1 -1
- package/dist/components/TySelect.d.ts.map +1 -1
- package/dist/components/TySelect.js +3 -2
- package/dist/components/TySelect.js.map +1 -1
- package/dist/components/TyStep.d.ts.map +1 -1
- package/dist/components/TyStep.js +2 -1
- package/dist/components/TyStep.js.map +1 -1
- package/dist/components/TySwitch.d.ts.map +1 -1
- package/dist/components/TySwitch.js +2 -1
- package/dist/components/TySwitch.js.map +1 -1
- package/dist/components/TyTab.d.ts.map +1 -1
- package/dist/components/TyTab.js +2 -1
- package/dist/components/TyTab.js.map +1 -1
- package/dist/components/TyTabs.d.ts.map +1 -1
- package/dist/components/TyTabs.js +2 -1
- package/dist/components/TyTabs.js.map +1 -1
- package/dist/components/TyTag.d.ts.map +1 -1
- package/dist/components/TyTag.js +2 -1
- package/dist/components/TyTag.js.map +1 -1
- package/dist/components/TyTextarea.d.ts.map +1 -1
- package/dist/components/TyTextarea.js +2 -1
- package/dist/components/TyTextarea.js.map +1 -1
- package/dist/components/TyTooltip.d.ts.map +1 -1
- package/dist/components/TyTooltip.js +2 -1
- package/dist/components/TyTooltip.js.map +1 -1
- package/dist/components/TyWizard.d.ts.map +1 -1
- package/dist/components/TyWizard.js +2 -1
- package/dist/components/TyWizard.js.map +1 -1
- package/dist/utils/host-props.d.ts +11 -0
- package/dist/utils/host-props.d.ts.map +1 -0
- package/dist/utils/host-props.js +16 -0
- package/dist/utils/host-props.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/components/TyButton.tsx +2 -1
- package/src/components/TyCalendar.tsx +2 -1
- package/src/components/TyCalendarMonth.tsx +2 -1
- package/src/components/TyCalendarNavigation.tsx +2 -1
- package/src/components/TyCheckbox.tsx +2 -1
- package/src/components/TyCopy.tsx +2 -1
- package/src/components/TyDatePicker.tsx +2 -1
- package/src/components/TyFileUpload.tsx +2 -1
- package/src/components/TyInput.tsx +2 -1
- package/src/components/TyModal.tsx +2 -1
- package/src/components/TyOption.tsx +2 -1
- package/src/components/TyPopup.tsx +2 -1
- package/src/components/TyRadio.tsx +2 -1
- package/src/components/TyRadioGroup.tsx +2 -1
- package/src/components/TyResizeObserver.tsx +2 -1
- package/src/components/TyScrollContainer.tsx +2 -1
- package/src/components/TySelect.tsx +3 -2
- package/src/components/TyStep.tsx +2 -1
- package/src/components/TySwitch.tsx +2 -1
- package/src/components/TyTab.tsx +2 -1
- package/src/components/TyTabs.tsx +2 -1
- package/src/components/TyTag.tsx +2 -1
- package/src/components/TyTextarea.tsx +2 -1
- package/src/components/TyTooltip.tsx +2 -1
- package/src/components/TyWizard.tsx +2 -1
- package/src/utils/host-props.ts +14 -0
- package/src/version.ts +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { hostProps } from '../utils/host-props';
|
|
2
3
|
import { useBooleanProperty } from '../utils/use-boolean-prop';
|
|
3
4
|
|
|
4
5
|
// Type definitions for Ty File Upload component
|
|
@@ -87,7 +88,7 @@ export const TyFileUpload = React.forwardRef<HTMLElement, TyFileUploadProps>(
|
|
|
87
88
|
const isRequired = useBooleanProperty(elementRef, 'required', required);
|
|
88
89
|
|
|
89
90
|
const webComponentProps: Record<string, any> = {
|
|
90
|
-
...props,
|
|
91
|
+
...hostProps(props),
|
|
91
92
|
ref: elementRef,
|
|
92
93
|
};
|
|
93
94
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useCallback } from 'react';
|
|
2
|
+
import { hostProps } from '../utils/host-props';
|
|
2
3
|
import { needsPropertyBridge } from '../utils/react-version';
|
|
3
4
|
import { useBooleanProperty } from '../utils/use-boolean-prop';
|
|
4
5
|
|
|
@@ -214,7 +215,7 @@ export const TyInput = React.forwardRef<HTMLElement, TyInputProps>(
|
|
|
214
215
|
|
|
215
216
|
// Convert React props to web component attributes
|
|
216
217
|
const webComponentProps: Record<string, any> = {
|
|
217
|
-
...props,
|
|
218
|
+
...hostProps(props),
|
|
218
219
|
ref: elementRef,
|
|
219
220
|
};
|
|
220
221
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useImperativeHandle } from 'react';
|
|
2
|
+
import { hostProps } from '../utils/host-props';
|
|
2
3
|
import { useBooleanProperty, coerceBool } from '../utils/use-boolean-prop';
|
|
3
4
|
import { needsPropertyBridge } from '../utils/react-version';
|
|
4
5
|
|
|
@@ -166,7 +167,7 @@ export const TyModal = React.forwardRef<TyModalRef, TyModalProps>(
|
|
|
166
167
|
|
|
167
168
|
// Convert React props to web component attributes
|
|
168
169
|
const webComponentProps: Record<string, any> = {
|
|
169
|
-
...props,
|
|
170
|
+
...hostProps(props),
|
|
170
171
|
ref: elementRef,
|
|
171
172
|
};
|
|
172
173
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { hostProps } from '../utils/host-props';
|
|
2
3
|
import { useBooleanProperty } from '../utils/use-boolean-prop';
|
|
3
4
|
|
|
4
5
|
// Type definitions for Ty Option component
|
|
@@ -44,7 +45,7 @@ export const TyOption = React.forwardRef<HTMLElement, TyOptionProps>(
|
|
|
44
45
|
return React.createElement(
|
|
45
46
|
'ty-option',
|
|
46
47
|
{
|
|
47
|
-
...props,
|
|
48
|
+
...hostProps(props),
|
|
48
49
|
...(label && { label }),
|
|
49
50
|
...(flavor && { flavor }),
|
|
50
51
|
...(isDisabled && { disabled: "" }),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { hostProps } from '../utils/host-props';
|
|
2
3
|
import { useBooleanProperty } from '../utils/use-boolean-prop';
|
|
3
4
|
|
|
4
5
|
// Type definitions for Ty Popup component
|
|
@@ -86,7 +87,7 @@ export const TyPopup = React.forwardRef<TyPopupElement, TyPopupProps>(
|
|
|
86
87
|
|
|
87
88
|
// Convert React props to web component attributes
|
|
88
89
|
const webComponentProps: Record<string, any> = {
|
|
89
|
-
...props,
|
|
90
|
+
...hostProps(props),
|
|
90
91
|
ref: elementRef,
|
|
91
92
|
};
|
|
92
93
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { hostProps } from '../utils/host-props';
|
|
2
3
|
import { useBooleanProperty } from '../utils/use-boolean-prop';
|
|
3
4
|
|
|
4
5
|
export interface TyRadioProps extends React.HTMLAttributes<HTMLElement> {
|
|
@@ -43,7 +44,7 @@ export const TyRadio = React.forwardRef<HTMLElement, TyRadioProps>(
|
|
|
43
44
|
const isDisabled = useBooleanProperty(elementRef, 'disabled', disabled);
|
|
44
45
|
|
|
45
46
|
const webComponentProps: Record<string, any> = {
|
|
46
|
-
...props,
|
|
47
|
+
...hostProps(props),
|
|
47
48
|
ref: elementRef,
|
|
48
49
|
};
|
|
49
50
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { hostProps } from '../utils/host-props';
|
|
2
3
|
import { useBooleanProperty } from '../utils/use-boolean-prop';
|
|
3
4
|
|
|
4
5
|
export interface TyRadioGroupProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'onInput'> {
|
|
@@ -103,7 +104,7 @@ export const TyRadioGroup = React.forwardRef<HTMLElement, TyRadioGroupProps>(
|
|
|
103
104
|
const isRequired = useBooleanProperty(elementRef, 'required', required);
|
|
104
105
|
|
|
105
106
|
const webComponentProps: Record<string, any> = {
|
|
106
|
-
...props,
|
|
107
|
+
...hostProps(props),
|
|
107
108
|
ref: elementRef,
|
|
108
109
|
};
|
|
109
110
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { hostProps } from '../utils/host-props';
|
|
2
3
|
|
|
3
4
|
// Type definitions for Ty ResizeObserver component
|
|
4
5
|
export interface TyResizeObserverProps extends React.HTMLAttributes<HTMLElement> {
|
|
@@ -35,7 +36,7 @@ export const TyResizeObserver = React.forwardRef<HTMLElement, TyResizeObserverPr
|
|
|
35
36
|
|
|
36
37
|
// Convert React props to web component attributes
|
|
37
38
|
const webComponentProps: Record<string, any> = {
|
|
38
|
-
...props,
|
|
39
|
+
...hostProps(props),
|
|
39
40
|
ref: elementRef,
|
|
40
41
|
id,
|
|
41
42
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useImperativeHandle } from 'react';
|
|
2
|
+
import { hostProps } from '../utils/host-props';
|
|
2
3
|
import { needsPropertyBridge } from '../utils/react-version';
|
|
3
4
|
import { useBooleanProperty, coerceBool } from '../utils/use-boolean-prop';
|
|
4
5
|
|
|
@@ -126,7 +127,7 @@ export const TyScrollContainer = React.forwardRef<TyScrollContainerRef, TyScroll
|
|
|
126
127
|
|
|
127
128
|
// Convert React props to web component attributes
|
|
128
129
|
const webComponentProps: Record<string, any> = {
|
|
129
|
-
...props,
|
|
130
|
+
...hostProps(props),
|
|
130
131
|
ref: elementRef,
|
|
131
132
|
};
|
|
132
133
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useCallback } from 'react';
|
|
2
|
+
import { hostProps } from '../utils/host-props';
|
|
2
3
|
import { needsPropertyBridge } from '../utils/react-version';
|
|
3
4
|
import { useBooleanProperty } from '../utils/use-boolean-prop';
|
|
4
5
|
|
|
@@ -175,7 +176,7 @@ export const TySelect = React.forwardRef<HTMLElement, TySelectProps>(
|
|
|
175
176
|
|
|
176
177
|
// Convert React props to web component attributes
|
|
177
178
|
const webComponentProps: Record<string, any> = {
|
|
178
|
-
...props,
|
|
179
|
+
...hostProps(props),
|
|
179
180
|
ref: elementRef,
|
|
180
181
|
};
|
|
181
182
|
|
|
@@ -230,7 +231,7 @@ export const TySelectedTags = React.forwardRef<HTMLElement, TySelectedTagsProps>
|
|
|
230
231
|
}
|
|
231
232
|
}, [ref]);
|
|
232
233
|
|
|
233
|
-
const webComponentProps: Record<string, any> = { ...props, ref: elementRef };
|
|
234
|
+
const webComponentProps: Record<string, any> = { ...hostProps(props), ref: elementRef };
|
|
234
235
|
if (htmlFor) webComponentProps.for = htmlFor;
|
|
235
236
|
|
|
236
237
|
return React.createElement('ty-selected-tags', webComponentProps, children);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { hostProps } from '../utils/host-props';
|
|
2
3
|
|
|
3
4
|
// Type definitions for Ty Step component
|
|
4
5
|
export interface TyStepProps extends React.HTMLAttributes<HTMLElement> {
|
|
@@ -47,7 +48,7 @@ export const TyStep = React.forwardRef<HTMLElement, TyStepProps>(
|
|
|
47
48
|
|
|
48
49
|
// Convert React props to web component attributes
|
|
49
50
|
const webComponentProps: Record<string, any> = {
|
|
50
|
-
...props,
|
|
51
|
+
...hostProps(props),
|
|
51
52
|
ref: elementRef,
|
|
52
53
|
id,
|
|
53
54
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { hostProps } from '../utils/host-props';
|
|
2
3
|
import { useBooleanProperty } from '../utils/use-boolean-prop';
|
|
3
4
|
|
|
4
5
|
export interface TySwitchProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'onInput'> {
|
|
@@ -94,7 +95,7 @@ export const TySwitch = React.forwardRef<HTMLElement, TySwitchProps>(
|
|
|
94
95
|
const isRequired = useBooleanProperty(elementRef, 'required', required);
|
|
95
96
|
|
|
96
97
|
const webComponentProps: Record<string, any> = {
|
|
97
|
-
...props,
|
|
98
|
+
...hostProps(props),
|
|
98
99
|
ref: elementRef,
|
|
99
100
|
};
|
|
100
101
|
|
package/src/components/TyTab.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { hostProps } from '../utils/host-props';
|
|
2
3
|
import { useBooleanProperty } from '../utils/use-boolean-prop';
|
|
3
4
|
|
|
4
5
|
// Type definitions for Ty Tab component
|
|
@@ -40,7 +41,7 @@ export const TyTab = React.forwardRef<HTMLElement, TyTabProps>(
|
|
|
40
41
|
|
|
41
42
|
// Convert React props to web component attributes
|
|
42
43
|
const webComponentProps: Record<string, any> = {
|
|
43
|
-
...props,
|
|
44
|
+
...hostProps(props),
|
|
44
45
|
ref: elementRef,
|
|
45
46
|
};
|
|
46
47
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { hostProps } from '../utils/host-props';
|
|
2
3
|
|
|
3
4
|
// Type definitions for Ty Tabs component
|
|
4
5
|
export interface TyTabsProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {
|
|
@@ -72,7 +73,7 @@ export const TyTabs = React.forwardRef<HTMLElement, TyTabsProps>(
|
|
|
72
73
|
|
|
73
74
|
// Convert React props to web component attributes
|
|
74
75
|
const webComponentProps: Record<string, any> = {
|
|
75
|
-
...props,
|
|
76
|
+
...hostProps(props),
|
|
76
77
|
ref: elementRef,
|
|
77
78
|
};
|
|
78
79
|
|
package/src/components/TyTag.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useCallback } from 'react';
|
|
2
|
+
import { hostProps } from '../utils/host-props';
|
|
2
3
|
import { useBooleanProperty } from '../utils/use-boolean-prop';
|
|
3
4
|
|
|
4
5
|
// CSS custom properties that cascade into the shadow DOM for full color control
|
|
@@ -67,7 +68,7 @@ export const TyTag = React.forwardRef<HTMLElement, TyTagProps>(
|
|
|
67
68
|
return React.createElement(
|
|
68
69
|
'ty-tag',
|
|
69
70
|
{
|
|
70
|
-
...props,
|
|
71
|
+
...hostProps(props),
|
|
71
72
|
// click is dispatched as composed CustomEvent by the web component — React's
|
|
72
73
|
// synthetic onClick already catches it, so we just pass it through as onClick
|
|
73
74
|
...(onClick && { onClick }),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useCallback } from 'react';
|
|
2
|
+
import { hostProps } from '../utils/host-props';
|
|
2
3
|
import { needsPropertyBridge } from '../utils/react-version';
|
|
3
4
|
import { useBooleanProperty } from '../utils/use-boolean-prop';
|
|
4
5
|
|
|
@@ -167,7 +168,7 @@ export const TyTextarea = React.forwardRef<HTMLElement, TyTextareaProps>(
|
|
|
167
168
|
return React.createElement(
|
|
168
169
|
'ty-textarea',
|
|
169
170
|
{
|
|
170
|
-
...props,
|
|
171
|
+
...hostProps(props),
|
|
171
172
|
...(isDisabled && { disabled: "" }),
|
|
172
173
|
...(isRequired && { required: "" }),
|
|
173
174
|
...(minHeight && { 'min-height': minHeight }), // Convert camelCase to kebab-case
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { hostProps } from '../utils/host-props';
|
|
2
3
|
import { useBooleanProperty } from '../utils/use-boolean-prop';
|
|
3
4
|
|
|
4
5
|
// Type definitions for Ty Tooltip component
|
|
@@ -48,7 +49,7 @@ export const TyTooltip = React.forwardRef<HTMLElement, TyTooltipProps>(
|
|
|
48
49
|
|
|
49
50
|
// Convert React props to web component attributes
|
|
50
51
|
const webComponentProps: Record<string, any> = {
|
|
51
|
-
...props,
|
|
52
|
+
...hostProps(props),
|
|
52
53
|
ref: elementRef,
|
|
53
54
|
};
|
|
54
55
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { hostProps } from '../utils/host-props';
|
|
2
3
|
|
|
3
4
|
// Type definitions for Ty Wizard component
|
|
4
5
|
export interface TyWizardProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {
|
|
@@ -77,7 +78,7 @@ export const TyWizard = React.forwardRef<HTMLElement, TyWizardProps>(
|
|
|
77
78
|
|
|
78
79
|
// Convert React props to web component attributes
|
|
79
80
|
const webComponentProps: Record<string, any> = {
|
|
80
|
-
...props,
|
|
81
|
+
...hostProps(props),
|
|
81
82
|
ref: elementRef,
|
|
82
83
|
};
|
|
83
84
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalize pass-through props for a custom-element host.
|
|
3
|
+
*
|
|
4
|
+
* React 18 does not special-case `className` on custom elements — it
|
|
5
|
+
* lowercases the prop into a literal `classname=""` attribute, which no CSS
|
|
6
|
+
* ever matches. Renaming it to `class` makes React pass it through verbatim,
|
|
7
|
+
* so host-level utility classes (layout, positioning) actually apply.
|
|
8
|
+
* React 19 handles `className` natively; this stays harmless there.
|
|
9
|
+
*/
|
|
10
|
+
export function hostProps<T extends Record<string, any>>(props: T): Record<string, any> {
|
|
11
|
+
const { className, ...rest } = props;
|
|
12
|
+
if (className != null) (rest as Record<string, any>).class = className;
|
|
13
|
+
return rest;
|
|
14
|
+
}
|
package/src/version.ts
CHANGED