fetta 1.2.1 → 1.3.0
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/react.d.ts +7 -1
- package/dist/react.js +7 -2
- package/package.json +1 -1
package/dist/react.d.ts
CHANGED
|
@@ -43,6 +43,12 @@ type CallbackReturn = void | {
|
|
|
43
43
|
}> | Promise<unknown>;
|
|
44
44
|
interface SplitTextProps {
|
|
45
45
|
children: ReactElement;
|
|
46
|
+
/** The wrapper element type. Default: "div" */
|
|
47
|
+
as?: keyof React.JSX.IntrinsicElements;
|
|
48
|
+
/** Class name for the wrapper element */
|
|
49
|
+
className?: string;
|
|
50
|
+
/** Additional styles for the wrapper element (merged with internal styles) */
|
|
51
|
+
style?: React.CSSProperties;
|
|
46
52
|
/**
|
|
47
53
|
* Called after text is split.
|
|
48
54
|
* Return an animation or promise to enable revert (requires revertOnComplete).
|
|
@@ -115,6 +121,6 @@ interface SplitTextProps {
|
|
|
115
121
|
* </SplitText>
|
|
116
122
|
* ```
|
|
117
123
|
*/
|
|
118
|
-
declare const SplitText: react.ForwardRefExoticComponent<SplitTextProps & react.RefAttributes<
|
|
124
|
+
declare const SplitText: react.ForwardRefExoticComponent<SplitTextProps & react.RefAttributes<HTMLElement>>;
|
|
119
125
|
|
|
120
126
|
export { SplitText, type SplitTextElements };
|
package/dist/react.js
CHANGED
|
@@ -5,6 +5,9 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
5
5
|
var SplitText = forwardRef(
|
|
6
6
|
function SplitText2({
|
|
7
7
|
children,
|
|
8
|
+
as: Component = "div",
|
|
9
|
+
className,
|
|
10
|
+
style: userStyle,
|
|
8
11
|
onSplit,
|
|
9
12
|
onResize,
|
|
10
13
|
options,
|
|
@@ -167,11 +170,13 @@ var SplitText = forwardRef(
|
|
|
167
170
|
const clonedChild = cloneElement(children, {
|
|
168
171
|
ref: childRefCallback
|
|
169
172
|
});
|
|
173
|
+
const Wrapper = Component;
|
|
170
174
|
return /* @__PURE__ */ jsx(
|
|
171
|
-
|
|
175
|
+
Wrapper,
|
|
172
176
|
{
|
|
173
177
|
ref: mergedRef,
|
|
174
|
-
|
|
178
|
+
className,
|
|
179
|
+
style: __spreadValues({ visibility: "hidden", position: "relative" }, userStyle),
|
|
175
180
|
children: clonedChild
|
|
176
181
|
}
|
|
177
182
|
);
|