@vitus-labs/rocketstyle 1.4.3-alpha.9 → 2.0.0-alpha.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.
Files changed (2) hide show
  1. package/lib/index.d.ts +13 -2
  2. package/package.json +5 -5
package/lib/index.d.ts CHANGED
@@ -65,7 +65,18 @@ type ExtractProps<TComponentOrTProps> = TComponentOrTProps extends ComponentType
65
65
  interface StylesDefault {}
66
66
  type Styles<S> = S extends unknown ? StylesDefault : MergeTypes<[StylesDefault, S]>;
67
67
  type Css = typeof config.css;
68
- type StylesCb = (css: Css) => ReturnType<Css>;
68
+ /**
69
+ * A tagged-template css function whose interpolation functions
70
+ * receive typed props including `$rocketstyle` (the computed theme).
71
+ *
72
+ * When used via `.styles()`, `CSS` is inferred from the chain's
73
+ * accumulated `.theme()` calls, so `$rocketstyle` is typed
74
+ * automatically.
75
+ */
76
+ type RocketCss<CSS extends TObj = TObj> = (strings: TemplateStringsArray, ...values: Array<string | number | boolean | null | undefined | ((props: {
77
+ $rocketstyle: CSS & Record<string, any>;
78
+ } & Record<string, any>) => any) | any[]>) => any;
79
+ type StylesCb<CSS extends TObj = TObj> = (css: RocketCss<CSS>) => ReturnType<Css>;
69
80
  type StylesCbArray = StylesCb[];
70
81
  //#endregion
71
82
  //#region src/constants/index.d.ts
@@ -358,7 +369,7 @@ interface IRocketStyleComponent<OA extends TObj = {}, EA extends TObj = {}, T ex
358
369
  * const newElement = base.styles(css => css``)
359
370
  * ```
360
371
  */
361
- styles: (param: StylesCb) => RocketStyleComponent<OA, EA, T, CSS, S, HOC, D, UB, DKP>;
372
+ styles: (param: StylesCb<CSS>) => RocketStyleComponent<OA, EA, T, CSS, S, HOC, D, UB, DKP>;
362
373
  /**
363
374
  * A chaining method to define high-order components to wrap
364
375
  * the defined component
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitus-labs/rocketstyle",
3
- "version": "1.4.3-alpha.9+6281beb",
3
+ "version": "2.0.0-alpha.0",
4
4
  "license": "MIT",
5
5
  "author": "Vit Bokisch <vit@bokisch.cz>",
6
6
  "maintainers": [
@@ -67,12 +67,12 @@
67
67
  "react": ">= 19"
68
68
  },
69
69
  "devDependencies": {
70
- "@vitus-labs/core": "1.4.3-alpha.9+6281beb",
71
- "@vitus-labs/elements": "1.4.3-alpha.9+6281beb",
70
+ "@vitus-labs/core": "2.0.0-alpha.0",
71
+ "@vitus-labs/elements": "2.0.0-alpha.0",
72
72
  "@vitus-labs/tools-rolldown": "^1.6.0",
73
73
  "@vitus-labs/tools-storybook": "^1.6.0",
74
74
  "@vitus-labs/tools-typescript": "^1.6.0",
75
- "@vitus-labs/unistyle": "1.4.3-alpha.9+6281beb"
75
+ "@vitus-labs/unistyle": "2.0.0-alpha.0"
76
76
  },
77
- "gitHead": "6281beb4302b5114c847fea02d01412cc81865ab"
77
+ "gitHead": "f2221c6fe2db3e39bfe1c30dc7ff0c01e2c66dc5"
78
78
  }