@salty-css/core 0.0.1-alpha.44 → 0.0.1-alpha.46

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types/index.d.ts +4 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salty-css/core",
3
- "version": "0.0.1-alpha.44",
3
+ "version": "0.0.1-alpha.46",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "typings": "./dist/index.d.ts",
package/types/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { AllHTMLAttributes, ReactDOM, ReactNode } from 'react';
2
2
  import { StyleComponentGenerator } from '../generator';
3
- import { OrString } from './util-types';
3
+ import { OrAny, OrString } from './util-types';
4
4
  export type CreateElementProps = {
5
5
  extend?: Tag<any>;
6
6
  children?: ReactNode;
@@ -13,7 +13,7 @@ export type CreateElementProps = {
13
13
  };
14
14
  export type StyledComponentProps = Record<string, unknown> & CreateElementProps;
15
15
  type FnComponent<PROPS extends StyledComponentProps> = {
16
- (props: PROPS): ReactNode;
16
+ (props: OrAny | PROPS): ReactNode;
17
17
  generator?: StyleComponentGenerator;
18
18
  };
19
19
  export type Tag<PROPS extends StyledComponentProps> = OrString | keyof ReactDOM | FnComponent<PROPS>;
@@ -38,7 +38,8 @@ type Variants = {
38
38
  };
39
39
  compoundVariants?: CompoundVariant[];
40
40
  };
41
- type VariantPropValue<T> = T extends 'true' ? 'true' | true : T;
41
+ type BooleanVariantValue = 'true' | 'false' | boolean;
42
+ type VariantPropValue<T> = T extends 'true' ? BooleanVariantValue : T extends 'false' ? BooleanVariantValue : T;
42
43
  export type VariantProps<STYLES extends StyledParams> = STYLES['variants'] extends undefined ? object : {
43
44
  [K in keyof STYLES['variants']]?: VariantPropValue<keyof STYLES['variants'][K]> | '';
44
45
  };