tailwind-styled-v4 5.1.29 → 5.1.31
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.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -13,7 +13,7 @@ type VariantLiterals = string | number | boolean;
|
|
|
13
13
|
/** Sizes sugar syntax — shorthand untuk variants.size */
|
|
14
14
|
type SizesConfig = Record<string, string>;
|
|
15
15
|
type InferVariantProps<T extends ComponentConfig> = {
|
|
16
|
-
[K in keyof T["variants"]]?: T["variants"][K] extends Record<infer Key, any> ? Key extends "true" | "false" ? boolean : Key extends `${infer N extends number}` ? N
|
|
16
|
+
[K in keyof T["variants"]]?: T["variants"][K] extends Record<infer Key, any> ? Key extends "true" | "false" ? boolean : Key extends number ? Key : Key extends `${infer N extends number}` ? N : Key : never;
|
|
17
17
|
};
|
|
18
18
|
type InferSizeProps<T extends ComponentConfig> = T["sizes"] extends Record<string, string> ? {
|
|
19
19
|
size?: keyof T["sizes"];
|
|
@@ -256,9 +256,9 @@ interface TwSubComponent<P = unknown> {
|
|
|
256
256
|
displayName?: string;
|
|
257
257
|
}
|
|
258
258
|
interface TwTemplateFactory<Config extends ComponentConfig = ComponentConfig, Tag extends HtmlTagName = HtmlTagName> {
|
|
259
|
+
<C extends ComponentConfig>(config: C): TwStyledComponent<C, InferSubFromConfig<C>, InferSubTagsFromConfig<C> extends Record<string, string> ? InferSubTagsFromConfig<C> : Record<string, never>, Tag>;
|
|
259
260
|
<const T extends string>(strings: readonly [T], ...exprs: []): TwStyledComponent<Config, ExtractSubNames<T>, Record<string, never>, Tag>;
|
|
260
261
|
(strings: TemplateStringsArray, ...exprs: unknown[]): TwStyledComponent<Config, string, Record<string, never>, Tag>;
|
|
261
|
-
<const C extends ComponentConfig>(config: C): TwStyledComponent<C, InferSubFromConfig<C>, InferSubTagsFromConfig<C> extends Record<string, string> ? InferSubTagsFromConfig<C> : Record<string, never>, Tag>;
|
|
262
262
|
}
|
|
263
263
|
type TwTagFactory = {
|
|
264
264
|
[K in HtmlTagName]: TwTemplateFactory<ComponentConfig, K>;
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ type VariantLiterals = string | number | boolean;
|
|
|
13
13
|
/** Sizes sugar syntax — shorthand untuk variants.size */
|
|
14
14
|
type SizesConfig = Record<string, string>;
|
|
15
15
|
type InferVariantProps<T extends ComponentConfig> = {
|
|
16
|
-
[K in keyof T["variants"]]?: T["variants"][K] extends Record<infer Key, any> ? Key extends "true" | "false" ? boolean : Key extends `${infer N extends number}` ? N
|
|
16
|
+
[K in keyof T["variants"]]?: T["variants"][K] extends Record<infer Key, any> ? Key extends "true" | "false" ? boolean : Key extends number ? Key : Key extends `${infer N extends number}` ? N : Key : never;
|
|
17
17
|
};
|
|
18
18
|
type InferSizeProps<T extends ComponentConfig> = T["sizes"] extends Record<string, string> ? {
|
|
19
19
|
size?: keyof T["sizes"];
|
|
@@ -256,9 +256,9 @@ interface TwSubComponent<P = unknown> {
|
|
|
256
256
|
displayName?: string;
|
|
257
257
|
}
|
|
258
258
|
interface TwTemplateFactory<Config extends ComponentConfig = ComponentConfig, Tag extends HtmlTagName = HtmlTagName> {
|
|
259
|
+
<C extends ComponentConfig>(config: C): TwStyledComponent<C, InferSubFromConfig<C>, InferSubTagsFromConfig<C> extends Record<string, string> ? InferSubTagsFromConfig<C> : Record<string, never>, Tag>;
|
|
259
260
|
<const T extends string>(strings: readonly [T], ...exprs: []): TwStyledComponent<Config, ExtractSubNames<T>, Record<string, never>, Tag>;
|
|
260
261
|
(strings: TemplateStringsArray, ...exprs: unknown[]): TwStyledComponent<Config, string, Record<string, never>, Tag>;
|
|
261
|
-
<const C extends ComponentConfig>(config: C): TwStyledComponent<C, InferSubFromConfig<C>, InferSubTagsFromConfig<C> extends Record<string, string> ? InferSubTagsFromConfig<C> : Record<string, never>, Tag>;
|
|
262
262
|
}
|
|
263
263
|
type TwTagFactory = {
|
|
264
264
|
[K in HtmlTagName]: TwTemplateFactory<ComponentConfig, K>;
|