@inkeep/cxkit-theme 0.0.0-dev-20250221234142

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 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./generate-theme-variables.cjs"),g="ikp";function S(c){const t={};for(const[r,a]of Object.entries(c)){const n=y.themeMappings[r]||r,o=(i,l=[])=>{for(const[u,e]of Object.entries(i)){const s=[...l,u];if(typeof e=="object"&&e!==null)o(e,s);else{const b=s.map(p=>p.replace(/([A-Z])/g,"-$1").toLowerCase()).join("-"),f=`--${g}-${n}-${b}`;t[f]=e}}};o(a)}return t}exports.createCSSVariables=S;
@@ -0,0 +1,2 @@
1
+ import { IkpTheme } from '@inkeep/cxkit-types';
2
+ export declare function createCSSVariables(theme: IkpTheme): Record<string, any>;
@@ -0,0 +1,2 @@
1
+ import { IkpTheme } from '@inkeep/cxkit-types';
2
+ export declare function createCSSVariables(theme: IkpTheme): Record<string, any>;
@@ -0,0 +1,23 @@
1
+ import { themeMappings as b } from "./generate-theme-variables.js";
2
+ const g = "ikp";
3
+ function j(s) {
4
+ const t = {};
5
+ for (const [o, n] of Object.entries(s)) {
6
+ const a = b[o] || o, r = (i, f = []) => {
7
+ for (const [p, e] of Object.entries(i)) {
8
+ const c = [...f, p];
9
+ if (typeof e == "object" && e !== null)
10
+ r(e, c);
11
+ else {
12
+ const l = c.map((y) => y.replace(/([A-Z])/g, "-$1").toLowerCase()).join("-"), u = `--${g}-${a}-${l}`;
13
+ t[u] = e;
14
+ }
15
+ }
16
+ };
17
+ r(n);
18
+ }
19
+ return t;
20
+ }
21
+ export {
22
+ j as createCSSVariables
23
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p="ikp",f={colors:"color",fontFamily:"font-family",fontSize:"font-size",zIndex:"z-index"};function n(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}function y(t){const s={};for(const[o,l]of Object.entries(t)){const u=n(f[o]||o),a=(r,c=[])=>{if(typeof r!="object"||r===null){const e=c.map(n).join("-");return`var(--${p}-${u}-${e})`}const i={};for(const[e,g]of Object.entries(r))i[n(e)]=a(g,[...c,e]);return i};s[o]=a(l)}return s}exports.generateThemeVariables=y;exports.themeMappings=f;
@@ -0,0 +1,3 @@
1
+ import { IkpTheme, IkpThemeCategory } from '@inkeep/cxkit-types';
2
+ export declare const themeMappings: Record<IkpThemeCategory, string>;
3
+ export declare function generateThemeVariables(theme: IkpTheme): Record<string, any>;
@@ -0,0 +1,3 @@
1
+ import { IkpTheme, IkpThemeCategory } from '@inkeep/cxkit-types';
2
+ export declare const themeMappings: Record<IkpThemeCategory, string>;
3
+ export declare function generateThemeVariables(theme: IkpTheme): Record<string, any>;
@@ -0,0 +1,33 @@
1
+ const p = "ikp", y = {
2
+ colors: "color",
3
+ fontFamily: "font-family",
4
+ fontSize: "font-size",
5
+ zIndex: "z-index"
6
+ };
7
+ function r(t) {
8
+ return t.replace(/([A-Z])/g, "-$1").toLowerCase();
9
+ }
10
+ function g(t) {
11
+ const c = {};
12
+ for (const [o, f] of Object.entries(t)) {
13
+ const l = r(y[o] || o), s = (n, a = []) => {
14
+ if (typeof n != "object" || n === null) {
15
+ const e = a.map(r).join("-");
16
+ return `var(--${p}-${l}-${e})`;
17
+ }
18
+ const i = {};
19
+ for (const [e, u] of Object.entries(n))
20
+ i[r(e)] = s(u, [
21
+ ...a,
22
+ e
23
+ ]);
24
+ return i;
25
+ };
26
+ c[o] = s(f);
27
+ }
28
+ return c;
29
+ }
30
+ export {
31
+ g as generateThemeVariables,
32
+ y as themeMappings
33
+ };
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@inkeep/cxkit-theme",
3
+ "version": "0.0.0-dev-20250221234142",
4
+ "description": "",
5
+ "license": "Inkeep, Inc. Customer License (IICL) v1.1",
6
+ "homepage": "",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/inkeep/widget",
10
+ "directory": "packages/theme"
11
+ },
12
+ "type": "module",
13
+ "main": "dist/index.cjs",
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "clean-package": "../../clean-package.config.json",
18
+ "publishConfig": {
19
+ "access": "public"
20
+ },
21
+ "sideEffects": false,
22
+ "devDependencies": {
23
+ "@biomejs/biome": "1.9.4",
24
+ "clean-package": "2.2.0",
25
+ "globby": "14.0.2",
26
+ "typescript": "5.7.3",
27
+ "vite": "5.4.11",
28
+ "vite-plugin-dts": "4.4.0",
29
+ "@inkeep/cxkit-types": "0.0.0-dev-20250221234142"
30
+ },
31
+ "dependencies": {
32
+ "colorjs.io": "0.5.2"
33
+ },
34
+ "module": "dist/index.js",
35
+ "types": "dist/index.d.ts",
36
+ "exports": {
37
+ ".": {
38
+ "source": "./src/index.ts",
39
+ "import": {
40
+ "types": "./dist/index.d.ts",
41
+ "default": "./dist/index.js"
42
+ },
43
+ "require": {
44
+ "types": "./dist/index.d.cts",
45
+ "default": "./dist/index.cjs"
46
+ }
47
+ },
48
+ "./package.json": "./package.json"
49
+ },
50
+ "scripts": {
51
+ "build": "vite build",
52
+ "lint": "biome lint ./src",
53
+ "typecheck": "tsc"
54
+ }
55
+ }