@colixsystems/widget-sdk 0.15.0 → 0.16.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.
- package/README.md +9 -1
- package/dist/contract.cjs +9 -2
- package/dist/contract.js +4 -2
- package/dist/index.d.ts +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,15 @@ See the design reference for the full architecture: [`docs/architecture/widget-m
|
|
|
6
6
|
|
|
7
7
|
## Status
|
|
8
8
|
|
|
9
|
-
`v0.
|
|
9
|
+
`v0.16.0` — pre-publish. The package surface (types, function names, export paths) is the v1 contract; runtime behaviour for some hooks is stubbed (each hook documents what's wired and what isn't). It is **not yet published to npm**.
|
|
10
|
+
|
|
11
|
+
### What's new in 0.16.0
|
|
12
|
+
|
|
13
|
+
REQ-THEME — the tenant's **Theme Settings** now flow all the way into `useTheme()`.
|
|
14
|
+
|
|
15
|
+
- **`themeTokens.colors` gains `secondary` + `onSecondary`.** `useTheme().colors.secondary` reflects the tenant's *Secondary Color* picker (with `onSecondary` as its readable contrast color), alongside the existing `primary` / `onPrimary`. Built-in widgets like Button use it for their secondary variant; third-party widgets can use it for a branded second accent. The full `colors` shape is now `{ primary, onPrimary, secondary, onSecondary, surface, onSurface, surfaceMuted, onSurfaceMuted, border, danger, success, warning, info }`.
|
|
16
|
+
- **`colors.primary` / `colors.secondary` / `typography.fontFamily` are tenant-resolved.** The host maps the Studio Theme Settings blob (Primary Color, Secondary Color, Global Font) onto the default tokens before handing them to `useTheme()`, on both the live Player and the exported app — so a widget that reads tokens re-themes automatically. (Custom Google fonts render in the Player today; the exported app falls back to the system face for non-system fonts until font bundling lands.)
|
|
17
|
+
- **`CONTRACT.version` → `1.6.0`** (additive: two new `themeTokens.colors` keys). No existing export changed signature.
|
|
10
18
|
|
|
11
19
|
### What's new in 0.15.0
|
|
12
20
|
|
package/dist/contract.cjs
CHANGED
|
@@ -12,6 +12,8 @@ const DEFAULT_THEME_TOKENS = Object.freeze({
|
|
|
12
12
|
colors: Object.freeze({
|
|
13
13
|
primary: "#ff6b5b",
|
|
14
14
|
onPrimary: "#ffffff",
|
|
15
|
+
secondary: "#475569",
|
|
16
|
+
onSecondary: "#ffffff",
|
|
15
17
|
surface: "#ffffff",
|
|
16
18
|
onSurface: "#111827",
|
|
17
19
|
surfaceMuted: "#f8fafc",
|
|
@@ -37,7 +39,7 @@ const HOOKS = [
|
|
|
37
39
|
signature: "useTheme()",
|
|
38
40
|
returnShape: {
|
|
39
41
|
colors:
|
|
40
|
-
"{ primary, onPrimary, surface, onSurface, surfaceMuted, onSurfaceMuted, border, danger, success, warning, info }",
|
|
42
|
+
"{ primary, onPrimary, secondary, onSecondary, surface, onSurface, surfaceMuted, onSurfaceMuted, border, danger, success, warning, info }",
|
|
41
43
|
spacing: "{ xs, sm, md, lg, xl }",
|
|
42
44
|
radii: "{ sm, md, lg, pill }",
|
|
43
45
|
typography: "{ fontFamily, sizes: { xs, sm, md, lg, xl, xxl } }",
|
|
@@ -830,7 +832,12 @@ const CONTRACT = deepFreeze({
|
|
|
830
832
|
// Permissive-direction change: minor bump on the contract's own
|
|
831
833
|
// versioning (per CLAUDE.md §4, pre-1.0 minor is the breaking channel —
|
|
832
834
|
// the package.json version bumps accordingly).
|
|
833
|
-
|
|
835
|
+
//
|
|
836
|
+
// 1.6.0: additive — `themeTokens.colors` gains `secondary` + `onSecondary`
|
|
837
|
+
// so the tenant's Theme Settings "Secondary Color" flows through
|
|
838
|
+
// `useTheme().colors.secondary` (Button secondary variant + any widget
|
|
839
|
+
// that wants the brand's second accent).
|
|
840
|
+
version: "1.6.0",
|
|
834
841
|
hooks: HOOKS,
|
|
835
842
|
primitives: PRIMITIVES,
|
|
836
843
|
manifestSchema: MANIFEST_SCHEMA,
|
package/dist/contract.js
CHANGED
|
@@ -12,6 +12,8 @@ const DEFAULT_THEME_TOKENS = Object.freeze({
|
|
|
12
12
|
colors: Object.freeze({
|
|
13
13
|
primary: "#ff6b5b",
|
|
14
14
|
onPrimary: "#ffffff",
|
|
15
|
+
secondary: "#475569",
|
|
16
|
+
onSecondary: "#ffffff",
|
|
15
17
|
surface: "#ffffff",
|
|
16
18
|
onSurface: "#111827",
|
|
17
19
|
surfaceMuted: "#f8fafc",
|
|
@@ -37,7 +39,7 @@ const HOOKS = [
|
|
|
37
39
|
signature: "useTheme()",
|
|
38
40
|
returnShape: {
|
|
39
41
|
colors:
|
|
40
|
-
"{ primary, onPrimary, surface, onSurface, surfaceMuted, onSurfaceMuted, border, danger, success, warning, info }",
|
|
42
|
+
"{ primary, onPrimary, secondary, onSecondary, surface, onSurface, surfaceMuted, onSurfaceMuted, border, danger, success, warning, info }",
|
|
41
43
|
spacing: "{ xs, sm, md, lg, xl }",
|
|
42
44
|
radii: "{ sm, md, lg, pill }",
|
|
43
45
|
typography: "{ fontFamily, sizes: { xs, sm, md, lg, xl, xxl } }",
|
|
@@ -786,7 +788,7 @@ function deepFreeze(value) {
|
|
|
786
788
|
}
|
|
787
789
|
|
|
788
790
|
const CONTRACT = deepFreeze({
|
|
789
|
-
version: "1.
|
|
791
|
+
version: "1.6.0",
|
|
790
792
|
hooks: HOOKS,
|
|
791
793
|
primitives: PRIMITIVES,
|
|
792
794
|
manifestSchema: MANIFEST_SCHEMA,
|
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@colixsystems/widget-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Common widget interface for AppStudio. Implements WidgetManifest, WidgetContext, property schema, and helper hooks.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|