Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rpxl/recast

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rpxl/recast - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

75

dist/cjs/types.d.ts

@@ -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 ? {

2

package.json
{
"name": "@rpxl/recast",
"license": "MIT",
"version": "4.0.0",
"version": "4.0.1",
"type": "module",

@@ -6,0 +6,0 @@ "sideEffects": false,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc