@awc-ui/theme 1.0.0-beta.1 → 1.0.0-beta.11
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/dist/apply-theme.d.ts +11 -2
- package/dist/apply-theme.d.ts.map +1 -1
- package/dist/compute-theme.d.ts +1 -1
- package/dist/generate-css.d.ts +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.mjs.map +2 -2
- package/package.json +13 -3
- package/src/apply-theme.ts +10 -1
package/dist/apply-theme.d.ts
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
import { type RoleMap, type ThemeComputeResult } from './types';
|
|
1
|
+
import { type RoleMap, type ThemeComputeResult } from './types.js';
|
|
2
2
|
/** Apply generated MD3 color role tokens as inline CSS custom properties on an element. */
|
|
3
3
|
export declare function applyThemeRoles(element: HTMLElement, roles: RoleMap): void;
|
|
4
4
|
/** Remove inline MD3 color role overrides so stylesheet / data-theme tokens can apply. */
|
|
5
5
|
export declare function clearThemeRoles(element: HTMLElement): void;
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Inject or update a stylesheet with light (:root) and dark ([data-theme="dark"]) role tokens.
|
|
8
|
+
*
|
|
9
|
+
* Charts pick this up automatically: they watch `document.head` for the
|
|
10
|
+
* `<style>` this appends and for later rewrites of its content, so a seed or
|
|
11
|
+
* accent swap repaints every canvas on the page. The one path no browser API
|
|
12
|
+
* can observe is a sheet applied through `document.adoptedStyleSheets` or
|
|
13
|
+
* edited via CSSOM `insertRule` — if you theme that way with charts on
|
|
14
|
+
* screen, call each chart's `refreshTheme()` afterwards.
|
|
15
|
+
*/
|
|
7
16
|
export declare function applyThemeStylesheet(theme: ThemeComputeResult, styleId?: string): void;
|
|
8
17
|
//# sourceMappingURL=apply-theme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-theme.d.ts","sourceRoot":"","sources":["../src/apply-theme.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE3E,2FAA2F;AAC3F,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAI1E;AAED,0FAA0F;AAC1F,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAI1D;AAED
|
|
1
|
+
{"version":3,"file":"apply-theme.d.ts","sourceRoot":"","sources":["../src/apply-theme.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE3E,2FAA2F;AAC3F,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAI1E;AAED,0FAA0F;AAC1F,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAI1D;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,kBAAkB,EACzB,OAAO,SAAyB,GAC/B,IAAI,CAQN"}
|
package/dist/compute-theme.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ThemeComputeRequest, type ThemeComputeResult } from './types';
|
|
1
|
+
import { type ThemeComputeRequest, type ThemeComputeResult } from './types.js';
|
|
2
2
|
/** Generate MD3 tonal palettes and role-mapped tokens for light and dark mode. */
|
|
3
3
|
export declare function computeTheme(req: ThemeComputeRequest): ThemeComputeResult;
|
|
4
4
|
//# sourceMappingURL=compute-theme.d.ts.map
|
package/dist/generate-css.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ThemeComputeResult } from './types';
|
|
1
|
+
import type { ThemeComputeResult } from './types.js';
|
|
2
2
|
/** Format a computed theme as a drop-in CSS file overriding @awc-ui/tokens defaults. */
|
|
3
3
|
export declare function generateCss(result: ThemeComputeResult): string;
|
|
4
4
|
//# sourceMappingURL=generate-css.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { computeTheme } from './compute-theme';
|
|
2
|
-
export { applyThemeRoles, applyThemeStylesheet, clearThemeRoles } from './apply-theme';
|
|
3
|
-
export { applyFontFamily, loadGoogleFont } from './apply-font';
|
|
4
|
-
export { generateCss } from './generate-css';
|
|
5
|
-
export { tokenName } from './token-name';
|
|
6
|
-
export { ROLE_KEYS, DEFAULT_SEED_COLORS, DEFAULT_FONT_FAMILY, TYPESCALE_SLOTS, } from './types';
|
|
7
|
-
export type { PaletteKey, RoleKey, RoleMap, ThemeComputeRequest, ThemeComputeResult, ThemeWorkerRequest, ThemeWorkerResponse, } from './types';
|
|
1
|
+
export { computeTheme } from './compute-theme.js';
|
|
2
|
+
export { applyThemeRoles, applyThemeStylesheet, clearThemeRoles } from './apply-theme.js';
|
|
3
|
+
export { applyFontFamily, loadGoogleFont } from './apply-font.js';
|
|
4
|
+
export { generateCss } from './generate-css.js';
|
|
5
|
+
export { tokenName } from './token-name.js';
|
|
6
|
+
export { ROLE_KEYS, DEFAULT_SEED_COLORS, DEFAULT_FONT_FAMILY, TYPESCALE_SLOTS, } from './types.js';
|
|
7
|
+
export type { PaletteKey, RoleKey, RoleMap, ThemeComputeRequest, ThemeComputeResult, ThemeWorkerRequest, ThemeWorkerResponse, } from './types.js';
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|