simplestyle-js 5.0.0 → 5.1.0

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.
@@ -1,7 +1,7 @@
1
1
  import type { Properties } from 'csstype';
2
2
  import type { SimpleStyleRegistry } from './simpleStyleRegistry.js';
3
- import type { SimpleStyleRules, SimpleStyleVariables } from './types.js';
4
- type MakeCssFuncsOpts<T extends SimpleStyleVariables> = {} | {
3
+ import type { SimpleStyleRules } from './types.js';
4
+ type MakeCssFuncsOpts<T extends object> = {} | {
5
5
  registry: SimpleStyleRegistry;
6
6
  } | {
7
7
  variables: T;
@@ -16,7 +16,7 @@ type MakeCssFuncsOpts<T extends SimpleStyleVariables> = {} | {
16
16
  * they accept a function as the 2nd parameter, instead of the usual object.
17
17
  * The function will be provided with your variables
18
18
  */
19
- export declare function makeCssFuncs<V extends SimpleStyleVariables>(opts: MakeCssFuncsOpts<V>): {
19
+ export declare function makeCssFuncs<V extends object>(opts: MakeCssFuncsOpts<V>): {
20
20
  createStyles: <T extends SimpleStyleRules, K extends keyof T, O extends Record<K, string>>(ruleId: string, rulesFnc: (vars?: V) => T) => {
21
21
  classes: O;
22
22
  stylesheet: string;
@@ -3,12 +3,4 @@ export type SimpleStyleRules = {
3
3
  [key: string]: Properties | SimpleStyleRules;
4
4
  };
5
5
  export type RenderableSimpleStyleRules = SimpleStyleRules & Record<string, Properties[]>;
6
- export type SimpleStyleVariables = {
7
- [group: string]: {
8
- [variable: string]: {
9
- default: string | number;
10
- [variants: string]: string | number;
11
- };
12
- };
13
- };
14
6
  export type HasProperty<T, K extends keyof T> = T extends Record<K, any> ? true : false;
@@ -1,7 +1,7 @@
1
1
  import type { Properties } from 'csstype';
2
2
  import type { SimpleStyleRegistry } from './simpleStyleRegistry.js';
3
- import type { SimpleStyleRules, SimpleStyleVariables } from './types.js';
4
- type MakeCssFuncsOpts<T extends SimpleStyleVariables> = {} | {
3
+ import type { SimpleStyleRules } from './types.js';
4
+ type MakeCssFuncsOpts<T extends object> = {} | {
5
5
  registry: SimpleStyleRegistry;
6
6
  } | {
7
7
  variables: T;
@@ -16,7 +16,7 @@ type MakeCssFuncsOpts<T extends SimpleStyleVariables> = {} | {
16
16
  * they accept a function as the 2nd parameter, instead of the usual object.
17
17
  * The function will be provided with your variables
18
18
  */
19
- export declare function makeCssFuncs<V extends SimpleStyleVariables>(opts: MakeCssFuncsOpts<V>): {
19
+ export declare function makeCssFuncs<V extends object>(opts: MakeCssFuncsOpts<V>): {
20
20
  createStyles: <T extends SimpleStyleRules, K extends keyof T, O extends Record<K, string>>(ruleId: string, rulesFnc: (vars?: V) => T) => {
21
21
  classes: O;
22
22
  stylesheet: string;
@@ -3,12 +3,4 @@ export type SimpleStyleRules = {
3
3
  [key: string]: Properties | SimpleStyleRules;
4
4
  };
5
5
  export type RenderableSimpleStyleRules = SimpleStyleRules & Record<string, Properties[]>;
6
- export type SimpleStyleVariables = {
7
- [group: string]: {
8
- [variable: string]: {
9
- default: string | number;
10
- [variants: string]: string | number;
11
- };
12
- };
13
- };
14
6
  export type HasProperty<T, K extends keyof T> = T extends Record<K, any> ? true : false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simplestyle-js",
3
- "version": "5.0.0",
3
+ "version": "5.1.0",
4
4
  "description": "An incredibly straightforward and simple CSS-in-JS solution with zero runtime dependencies, and out-of-the-box TypeScript support",
5
5
  "type": "module",
6
6
  "repository": {