tailwind-styled-v4 5.1.27 → 5.1.28
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/index.browser.mjs +4 -8
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.d.mts +1 -21
- package/dist/index.d.ts +1 -21
- package/dist/index.js +4 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,24 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
type CSSFillMode = "none" | "forwards" | "backwards" | "both";
|
|
4
|
-
type CSSDirection = "normal" | "reverse" | "alternate" | "alternate-reverse";
|
|
5
|
-
type CSSIterationCount = number | "infinite";
|
|
6
|
-
type PresetEasing = "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out" | "step-start" | "step-end";
|
|
7
|
-
type CubicBezierEasing = `cubic-bezier(${string})`;
|
|
8
|
-
type StepsEasing = `steps(${string})`;
|
|
9
|
-
type CSSEasing = PresetEasing | CubicBezierEasing | StepsEasing;
|
|
10
|
-
interface AnimateOptions {
|
|
11
|
-
from: string;
|
|
12
|
-
to: string;
|
|
13
|
-
duration?: number;
|
|
14
|
-
easing?: CSSEasing;
|
|
15
|
-
delay?: number;
|
|
16
|
-
fill?: CSSFillMode;
|
|
17
|
-
iterations?: CSSIterationCount;
|
|
18
|
-
direction?: CSSDirection;
|
|
19
|
-
name?: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
3
|
type HtmlTagName = keyof HTMLElementTagNameMap;
|
|
23
4
|
|
|
24
5
|
/**
|
|
@@ -94,7 +75,7 @@ interface ComponentConfig {
|
|
|
94
75
|
* Supports string and boolean keys: { disabled: { true: "...", false: "..." } }
|
|
95
76
|
*/
|
|
96
77
|
variants?: Record<string, Record<string | "true" | "false", string>>;
|
|
97
|
-
defaultVariants?: Record<string, string>;
|
|
78
|
+
defaultVariants?: Record<string, string | number | boolean>;
|
|
98
79
|
compoundVariants?: Array<{
|
|
99
80
|
class: string;
|
|
100
81
|
[key: string]: string;
|
|
@@ -268,7 +249,6 @@ type TwStyledComponent<Config extends ComponentConfig = ComponentConfig, S exten
|
|
|
268
249
|
* Button.xyz // ❌ TypeScript error
|
|
269
250
|
*/
|
|
270
251
|
withSub<NewS extends string>(): TwStyledComponent<Config, NewS, TagMap, Tag>;
|
|
271
|
-
animate: (opts: AnimateOptions) => Promise<TwStyledComponent<Config, S, TagMap, Tag>>;
|
|
272
252
|
} & SubComponentKeys<S, TagMap>;
|
|
273
253
|
interface TwSubComponent<P = unknown> {
|
|
274
254
|
(props: P): React.ReactElement | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,24 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
type CSSFillMode = "none" | "forwards" | "backwards" | "both";
|
|
4
|
-
type CSSDirection = "normal" | "reverse" | "alternate" | "alternate-reverse";
|
|
5
|
-
type CSSIterationCount = number | "infinite";
|
|
6
|
-
type PresetEasing = "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out" | "step-start" | "step-end";
|
|
7
|
-
type CubicBezierEasing = `cubic-bezier(${string})`;
|
|
8
|
-
type StepsEasing = `steps(${string})`;
|
|
9
|
-
type CSSEasing = PresetEasing | CubicBezierEasing | StepsEasing;
|
|
10
|
-
interface AnimateOptions {
|
|
11
|
-
from: string;
|
|
12
|
-
to: string;
|
|
13
|
-
duration?: number;
|
|
14
|
-
easing?: CSSEasing;
|
|
15
|
-
delay?: number;
|
|
16
|
-
fill?: CSSFillMode;
|
|
17
|
-
iterations?: CSSIterationCount;
|
|
18
|
-
direction?: CSSDirection;
|
|
19
|
-
name?: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
3
|
type HtmlTagName = keyof HTMLElementTagNameMap;
|
|
23
4
|
|
|
24
5
|
/**
|
|
@@ -94,7 +75,7 @@ interface ComponentConfig {
|
|
|
94
75
|
* Supports string and boolean keys: { disabled: { true: "...", false: "..." } }
|
|
95
76
|
*/
|
|
96
77
|
variants?: Record<string, Record<string | "true" | "false", string>>;
|
|
97
|
-
defaultVariants?: Record<string, string>;
|
|
78
|
+
defaultVariants?: Record<string, string | number | boolean>;
|
|
98
79
|
compoundVariants?: Array<{
|
|
99
80
|
class: string;
|
|
100
81
|
[key: string]: string;
|
|
@@ -268,7 +249,6 @@ type TwStyledComponent<Config extends ComponentConfig = ComponentConfig, S exten
|
|
|
268
249
|
* Button.xyz // ❌ TypeScript error
|
|
269
250
|
*/
|
|
270
251
|
withSub<NewS extends string>(): TwStyledComponent<Config, NewS, TagMap, Tag>;
|
|
271
|
-
animate: (opts: AnimateOptions) => Promise<TwStyledComponent<Config, S, TagMap, Tag>>;
|
|
272
252
|
} & SubComponentKeys<S, TagMap>;
|
|
273
253
|
interface TwSubComponent<P = unknown> {
|
|
274
254
|
(props: P): React.ReactElement | null;
|
package/dist/index.js
CHANGED
|
@@ -1062,12 +1062,6 @@ function attachExtend(component, originalTag, base, config) {
|
|
|
1062
1062
|
}
|
|
1063
1063
|
});
|
|
1064
1064
|
};
|
|
1065
|
-
component.animate = async (_opts) => {
|
|
1066
|
-
console.warn(
|
|
1067
|
-
'[tailwind-styled-v4] .animate() tidak tersedia di main bundle.\nGunakan: import { animate } from "tailwind-styled-v4/animate"'
|
|
1068
|
-
);
|
|
1069
|
-
return component;
|
|
1070
|
-
};
|
|
1071
1065
|
component.withSub = (() => component);
|
|
1072
1066
|
return component;
|
|
1073
1067
|
}
|
|
@@ -1213,11 +1207,12 @@ function parseTemplate(strings, exprs) {
|
|
|
1213
1207
|
return result;
|
|
1214
1208
|
}
|
|
1215
1209
|
function makeTag(tag) {
|
|
1216
|
-
|
|
1210
|
+
const impl = ((stringsOrConfig, ...exprs) => {
|
|
1217
1211
|
if (!Array.isArray(stringsOrConfig) && typeof stringsOrConfig === "object" && stringsOrConfig !== null && !("raw" in stringsOrConfig)) {
|
|
1218
1212
|
return createComponent(tag, stringsOrConfig);
|
|
1219
1213
|
}
|
|
1220
|
-
const
|
|
1214
|
+
const strings = stringsOrConfig;
|
|
1215
|
+
const parsed = parseTemplate(strings, exprs);
|
|
1221
1216
|
const component = createComponent(tag, parsed.base);
|
|
1222
1217
|
if (parsed.hasSubs) {
|
|
1223
1218
|
for (const [name, classes] of Object.entries(parsed.subs)) {
|
|
@@ -1234,6 +1229,7 @@ function makeTag(tag) {
|
|
|
1234
1229
|
}
|
|
1235
1230
|
return component;
|
|
1236
1231
|
});
|
|
1232
|
+
return impl;
|
|
1237
1233
|
}
|
|
1238
1234
|
var HTML_TAGS = [
|
|
1239
1235
|
"html",
|