@rpxl/recast
Advanced tools
Comparing version 4.0.0 to 4.0.1
@@ -25,18 +25,34 @@ /** | ||
} : never; | ||
export type RecastProps<T> = Leaves<T> extends Nullish ? any : { | ||
rcx?: Leaves<T>; | ||
export type RecastProps<T> = { | ||
[K in keyof T]: T[K]; | ||
} & { | ||
rcx?: object; | ||
}; | ||
export type RecastStyles<V, M, P> = { | ||
/** Default values for variants and modifiers */ | ||
/** | ||
* Default values for variants and modifiers. Defaults will only be applied | ||
* if the variant or modifier is not provided. | ||
* {@link https://reactivepixels.github.io/recast/theming#set-some-defaults | See docs}. | ||
* | ||
* @example | ||
* ```ts | ||
* defaults: { | ||
* variants: { variant: "primary", size: "md" }, | ||
* } | ||
* ``` | ||
*/ | ||
defaults?: { | ||
/** Variants stuff */ | ||
variants?: Omit<{ | ||
[K in keyof V]?: keyof V[K]; | ||
}, MaybeVariants<V>>; | ||
/** Modifier stuff */ | ||
modifiers?: (keyof M)[]; | ||
}; | ||
/** | ||
* Base style properties | ||
* These will be applied. | ||
* Base styles for component. These will always be applied. | ||
* {@link https://reactivepixels.github.io/recast/theming#add-base-styles | See docs}. | ||
* | ||
* @example | ||
* ```ts | ||
* { base: "bg-blue-500 rounded-md" } | ||
* ``` | ||
*/ | ||
@@ -46,3 +62,17 @@ base?: keyof NonNullable<Leaves<P>> extends Nullish ? string | string[] : string | string[] | { | ||
}; | ||
/** Yadda yadda */ | ||
/** | ||
* Variants can be used to create distinct variations for a component. | ||
* {@link https://reactivepixels.github.io/recast/theming#add-variants | See docs}. | ||
* | ||
* @example | ||
* ```ts | ||
* variants: { | ||
* size: { | ||
* sm: "text-sm", | ||
* md: "text-md", | ||
* lg: "text-lg" | ||
* } | ||
* } | ||
* ``` | ||
*/ | ||
variants?: { | ||
@@ -53,2 +83,16 @@ [K in keyof V]: Record<keyof V[K], keyof NonNullable<Leaves<P>> extends Nullish ? string | string[] : string | string[] | { | ||
}; | ||
/** | ||
* Modifiers are variations of a component that can be "mixed-in" | ||
* and combined with other modifiers and all variants. | ||
* {@link https://reactivepixels.github.io/recast/theming#add-modifiers | See docs}. | ||
* | ||
* @example | ||
* ```ts | ||
* modifiers: { | ||
* block: "w-full", | ||
* floating: "shadow-lg", | ||
* pill: "rounded-full px-8", | ||
* } | ||
* ``` | ||
*/ | ||
modifiers?: { | ||
@@ -59,2 +103,17 @@ [K in keyof M]: keyof NonNullable<Leaves<P>> extends Nullish ? string | string[] : string | string[] | { | ||
}; | ||
/** | ||
* Conditonals are a way to define conditional styles that will only be applied if certain rules are met. | ||
* {@link https://reactivepixels.github.io/recast/theming#add-conditional-styles | See docs}. | ||
* | ||
* @example | ||
* ```ts | ||
* conditionals: [ | ||
* { | ||
* variants: { size: "lg" }, | ||
* modifiers: ["floating"], | ||
* className: "border-4 border-blue-500 text-white", | ||
* }, | ||
* ] | ||
* ``` | ||
*/ | ||
conditionals?: { | ||
@@ -61,0 +120,0 @@ variants?: V extends object ? { |
@@ -25,18 +25,34 @@ /** | ||
} : never; | ||
export type RecastProps<T> = Leaves<T> extends Nullish ? any : { | ||
rcx?: Leaves<T>; | ||
export type RecastProps<T> = { | ||
[K in keyof T]: T[K]; | ||
} & { | ||
rcx?: object; | ||
}; | ||
export type RecastStyles<V, M, P> = { | ||
/** Default values for variants and modifiers */ | ||
/** | ||
* Default values for variants and modifiers. Defaults will only be applied | ||
* if the variant or modifier is not provided. | ||
* {@link https://reactivepixels.github.io/recast/theming#set-some-defaults | See docs}. | ||
* | ||
* @example | ||
* ```ts | ||
* defaults: { | ||
* variants: { variant: "primary", size: "md" }, | ||
* } | ||
* ``` | ||
*/ | ||
defaults?: { | ||
/** Variants stuff */ | ||
variants?: Omit<{ | ||
[K in keyof V]?: keyof V[K]; | ||
}, MaybeVariants<V>>; | ||
/** Modifier stuff */ | ||
modifiers?: (keyof M)[]; | ||
}; | ||
/** | ||
* Base style properties | ||
* These will be applied. | ||
* Base styles for component. These will always be applied. | ||
* {@link https://reactivepixels.github.io/recast/theming#add-base-styles | See docs}. | ||
* | ||
* @example | ||
* ```ts | ||
* { base: "bg-blue-500 rounded-md" } | ||
* ``` | ||
*/ | ||
@@ -46,3 +62,17 @@ base?: keyof NonNullable<Leaves<P>> extends Nullish ? string | string[] : string | string[] | { | ||
}; | ||
/** Yadda yadda */ | ||
/** | ||
* Variants can be used to create distinct variations for a component. | ||
* {@link https://reactivepixels.github.io/recast/theming#add-variants | See docs}. | ||
* | ||
* @example | ||
* ```ts | ||
* variants: { | ||
* size: { | ||
* sm: "text-sm", | ||
* md: "text-md", | ||
* lg: "text-lg" | ||
* } | ||
* } | ||
* ``` | ||
*/ | ||
variants?: { | ||
@@ -53,2 +83,16 @@ [K in keyof V]: Record<keyof V[K], keyof NonNullable<Leaves<P>> extends Nullish ? string | string[] : string | string[] | { | ||
}; | ||
/** | ||
* Modifiers are variations of a component that can be "mixed-in" | ||
* and combined with other modifiers and all variants. | ||
* {@link https://reactivepixels.github.io/recast/theming#add-modifiers | See docs}. | ||
* | ||
* @example | ||
* ```ts | ||
* modifiers: { | ||
* block: "w-full", | ||
* floating: "shadow-lg", | ||
* pill: "rounded-full px-8", | ||
* } | ||
* ``` | ||
*/ | ||
modifiers?: { | ||
@@ -59,2 +103,17 @@ [K in keyof M]: keyof NonNullable<Leaves<P>> extends Nullish ? string | string[] : string | string[] | { | ||
}; | ||
/** | ||
* Conditonals are a way to define conditional styles that will only be applied if certain rules are met. | ||
* {@link https://reactivepixels.github.io/recast/theming#add-conditional-styles | See docs}. | ||
* | ||
* @example | ||
* ```ts | ||
* conditionals: [ | ||
* { | ||
* variants: { size: "lg" }, | ||
* modifiers: ["floating"], | ||
* className: "border-4 border-blue-500 text-white", | ||
* }, | ||
* ] | ||
* ``` | ||
*/ | ||
conditionals?: { | ||
@@ -61,0 +120,0 @@ variants?: V extends object ? { |
{ | ||
"name": "@rpxl/recast", | ||
"license": "MIT", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "sideEffects": false, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
88116
1287
0