@axiom-core/ssr-utils 0.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.
@@ -0,0 +1,2 @@
1
+ export type { RenderAxiomStylesOptions, RenderedAxiomStyles } from './types.js';
2
+ export { renderAxiomStyles } from './render.js';
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { renderAxiomStyles } from './render.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ResolvedTheme } from '@axiom-core/css-bridge';
2
+ import type { RenderAxiomStylesOptions, RenderedAxiomStyles } from './types.js';
3
+ export declare function renderAxiomStyles(resolvedTheme: ResolvedTheme, options?: RenderAxiomStylesOptions): RenderedAxiomStyles;
package/dist/render.js ADDED
@@ -0,0 +1,16 @@
1
+ import { emitCssVariables, generateCssText } from '@axiom-core/css-bridge';
2
+ const DEFAULT_SELECTOR = ':root';
3
+ const DEFAULT_MODE = 'prod';
4
+ const DEFAULT_ID = 'axiom-theme';
5
+ const DEFAULT_PREFIX = 'ax';
6
+ export function renderAxiomStyles(resolvedTheme, options) {
7
+ const selector = options?.selector ?? DEFAULT_SELECTOR;
8
+ const mode = options?.bridgeMode ?? DEFAULT_MODE;
9
+ const id = options?.id ?? DEFAULT_ID;
10
+ const prefix = options?.prefix ?? DEFAULT_PREFIX;
11
+ const vars = emitCssVariables(resolvedTheme, { mode, prefix });
12
+ const cssText = generateCssText(vars, selector);
13
+ const attributes = { 'data-axiom-ssr': '1' };
14
+ return { id, cssText, attributes };
15
+ }
16
+ //# sourceMappingURL=render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.js","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAI3E,MAAM,gBAAgB,GAAG,OAAO,CAAC;AACjC,MAAM,YAAY,GAAmB,MAAM,CAAC;AAC5C,MAAM,UAAU,GAAG,aAAa,CAAC;AACjC,MAAM,cAAc,GAAG,IAAI,CAAC;AAE5B,MAAM,UAAU,iBAAiB,CAC/B,aAA4B,EAC5B,OAAkC;IAElC,MAAM,QAAQ,GAAG,OAAO,EAAE,QAAQ,IAAI,gBAAgB,CAAC;IACvD,MAAM,IAAI,GAAG,OAAO,EAAE,UAAU,IAAI,YAAY,CAAC;IACjD,MAAM,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,UAAU,CAAC;IACrC,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,IAAI,cAAc,CAAC;IAEjD,MAAM,IAAI,GAAG,gBAAgB,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAEhD,MAAM,UAAU,GAA2B,EAAE,gBAAgB,EAAE,GAAG,EAAE,CAAC;IAErE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AACrC,CAAC"}
@@ -0,0 +1,11 @@
1
+ export interface RenderAxiomStylesOptions {
2
+ selector?: string;
3
+ bridgeMode?: 'dev' | 'prod';
4
+ id?: string;
5
+ prefix?: string;
6
+ }
7
+ export interface RenderedAxiomStyles {
8
+ id: string;
9
+ cssText: string;
10
+ attributes: Record<string, string>;
11
+ }
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@axiom-core/ssr-utils",
3
+ "version": "0.1.0",
4
+ "description": "Axiom Core — SSR style tag generation utilities",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "sideEffects": false,
13
+ "exports": {
14
+ "./package.json": "./package.json",
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.js"
18
+ }
19
+ },
20
+ "dependencies": {
21
+ "@axiom-core/css-bridge": "0.1.0"
22
+ },
23
+ "license": "MIT",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://github.com/Haneefe/Axiom-Core.git"
27
+ },
28
+ "homepage": "https://github.com/Haneefe/Axiom-Core",
29
+ "bugs": {
30
+ "url": "https://github.com/Haneefe/Axiom-Core/issues"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public"
34
+ }
35
+ }