@schemavaults/theme 0.25.9 → 0.26.1

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 CHANGED
@@ -19,7 +19,17 @@ import "@schemavaults/theme/globals.css"
19
19
 
20
20
  ### Import and run the TailwindCSS Config Factory from your `tailwind.config.mjs` or `tailwind.config.ts`
21
21
 
22
- #### Simple Example
22
+ #### Simple example using withSchemaVaultsTailwindTheme
23
+ ```typescript
24
+ import { withSchemaVaultsTailwindTheme } from "@schemavaults/theme";
25
+ const config = withSchemaVaultsTailwindTheme({
26
+ "./src/**/*.tsx|jsx|js|ts",
27
+ "@schemavaults/ui", // resolved and converted to an absolute path to the schemavaults package in the node_modules folder
28
+ });
29
+ export default config;
30
+ ````
31
+
32
+ #### Simple example using SchemaVaultsTailwindConfigFactory
23
33
  ```typescript
24
34
  // tailwind.config.ts
25
35
  import { SchemaVaultsTailwindConfigFactory } from "@schemavaults/theme";
@@ -32,7 +42,7 @@ const config = new SchemaVaultsTailwindConfigFactory().createConfig({
32
42
  export default config;
33
43
  ```
34
44
 
35
- #### More complex example
45
+ #### More complex example using SchemaVaultsTailwindConfigFactory
36
46
  ```typescript
37
47
  // tailwind.config.ts
38
48
 
@@ -7,6 +7,12 @@ export const brandColors = {
7
7
  "schemavaults-brand-red": "var(--schemavaults-brand-red)",
8
8
  };
9
9
  export function getSchemaVaultsBrandColor(colorName) {
10
- return brandColors[colorName];
10
+ const brandColorCssValue = brandColors[colorName];
11
+ if (typeof brandColorCssValue !== "string") {
12
+ throw new Error(`Failed to find CSS value for brand color! Are you using a valid key (${SCHEMAVAULTS_COLOR_KEYS.map((k) => `'${k}'`).join(", ")})?`, {
13
+ cause: `Bad color name: '${colorName}'`,
14
+ });
15
+ }
16
+ return brandColorCssValue;
11
17
  }
12
18
  //# sourceMappingURL=brand_colors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"brand_colors.js","sourceRoot":"","sources":["../src/brand_colors.ts"],"names":[],"mappings":"AAAA,MAAM,uBAAuB,GAAG;IAC9B,yBAAyB;IACzB,wBAAwB;CACY,CAAC;AAIvC,MAAM,CAAC,MAAM,WAAW,GAA2C;IACjE,yBAAyB,EAAE,gCAAgC;IAC3D,wBAAwB,EAAE,+BAA+B;CAC1D,CAAC;AAEF,MAAM,UAAU,yBAAyB,CACvC,SAAiC;IAEjC,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC;AAChC,CAAC"}
1
+ {"version":3,"file":"brand_colors.js","sourceRoot":"","sources":["../src/brand_colors.ts"],"names":[],"mappings":"AAAA,MAAM,uBAAuB,GAAG;IAC9B,yBAAyB;IACzB,wBAAwB;CACY,CAAC;AAIvC,MAAM,CAAC,MAAM,WAAW,GAA2C;IACjE,yBAAyB,EAAE,gCAAgC;IAC3D,wBAAwB,EAAE,+BAA+B;CAC1D,CAAC;AAEF,MAAM,UAAU,yBAAyB,CACvC,SAAiC;IAEjC,MAAM,kBAAkB,GAAW,WAAW,CAAC,SAAS,CAAC,CAAC;IAC1D,IAAI,OAAO,kBAAkB,KAAK,QAAQ,EAAE,CAAC;QAC3C,MAAM,IAAI,KAAK,CACb,wEAAwE,uBAAuB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EACnI;YACE,KAAK,EAAE,oBAAoB,SAAS,GAAG;SACxC,CACF,CAAC;IACJ,CAAC;IACD,OAAO,kBAAkB,CAAC;AAC5B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { SchemaVaultsTailwindConfigFactory, SchemaVaultsTailwindConfigFactory as default, } from "./TailwindConfigFactory";
2
+ export { default as withSchemaVaultsTailwindTheme } from "./withSchemaVaultsTailwindTheme";
2
3
  export type { SchemaVaultsBrandColor } from "./brand_colors";
3
4
  export { getSchemaVaultsBrandColor, brandColors } from "./brand_colors";
4
5
  export { getScreenBreakpoint, listScreenBreakpoints, isValidScreenBreakpoint, } from "./ScreenBreakpoints";
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export { SchemaVaultsTailwindConfigFactory, SchemaVaultsTailwindConfigFactory as default, } from "./TailwindConfigFactory";
2
+ export { default as withSchemaVaultsTailwindTheme } from "./withSchemaVaultsTailwindTheme";
2
3
  export { getSchemaVaultsBrandColor, brandColors } from "./brand_colors";
3
4
  export { getScreenBreakpoint, listScreenBreakpoints, isValidScreenBreakpoint, } from "./ScreenBreakpoints";
4
5
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EACjC,iCAAiC,IAAI,OAAO,GAC7C,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAExE,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EACjC,iCAAiC,IAAI,OAAO,GAC7C,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,OAAO,IAAI,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAG3F,OAAO,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAExE,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { type ISchemaVaultsTailwindConfigFactoryInitOptions, type ISchemaVaultsTailwindConfigCreationOptions } from "./TailwindConfigFactory";
2
+ import type { Config as TailwindConfig } from "tailwindcss";
3
+ /**
4
+ * @see SchemaVaultsTailwindConfigFactory
5
+ * @param configOpts ISchemaVaultsTailwindConfigCreationOptions
6
+ * @returns TailwindConfig
7
+ */
8
+ export default function withSchemaVaultsTailwindTheme(configOpts: ISchemaVaultsTailwindConfigCreationOptions, configFactoryOpts?: ISchemaVaultsTailwindConfigFactoryInitOptions): TailwindConfig;
@@ -0,0 +1,13 @@
1
+ // withSchemaVaultsTailwindTheme.ts
2
+ import SchemaVaultsTailwindConfigFactory from "./TailwindConfigFactory";
3
+ /**
4
+ * @see SchemaVaultsTailwindConfigFactory
5
+ * @param configOpts ISchemaVaultsTailwindConfigCreationOptions
6
+ * @returns TailwindConfig
7
+ */
8
+ export default function withSchemaVaultsTailwindTheme(configOpts, configFactoryOpts) {
9
+ const theme_factory = new SchemaVaultsTailwindConfigFactory(configFactoryOpts);
10
+ const config = theme_factory.createConfig(configOpts);
11
+ return config;
12
+ }
13
+ //# sourceMappingURL=withSchemaVaultsTailwindTheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withSchemaVaultsTailwindTheme.js","sourceRoot":"","sources":["../src/withSchemaVaultsTailwindTheme.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC,OAAO,iCAGN,MAAM,yBAAyB,CAAC;AAGjC;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,6BAA6B,CACnD,UAAsD,EACtD,iBAAiE;IAEjE,MAAM,aAAa,GAAG,IAAI,iCAAiC,CACzD,iBAAiB,CAClB,CAAC;IAEF,MAAM,MAAM,GAAmB,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IAEtE,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@schemavaults/theme",
3
3
  "description": "TailwindCSS theme shared by different SchemaVaults applications",
4
- "version": "0.25.9",
4
+ "version": "0.26.1",
5
5
  "private": false,
6
6
  "license": "UNLICENSED",
7
7
  "repository": {
@@ -15,7 +15,7 @@
15
15
  "devDependencies": {
16
16
  "@types/resolve": "1.20.6",
17
17
  "tsc-alias": "1.8.16",
18
- "bun-types": "1.3.11",
18
+ "bun-types": "1.3.14",
19
19
  "typescript": "5.9.3",
20
20
  "tailwindcss": "3.4.17"
21
21
  },
@@ -51,6 +51,12 @@
51
51
  "node": "./dist/ScreenBreakpoints.js",
52
52
  "import": "./dist/ScreenBreakpoints.js"
53
53
  },
54
+ "./brand_colors": {
55
+ "types": "./dist/brand_colors.d.ts",
56
+ "require": "./dist/brand_colors.js",
57
+ "node": "./dist/brand_colors.js",
58
+ "import": "./dist/brand_colors.js"
59
+ },
54
60
  ".": {
55
61
  "types": "./dist/index.d.ts",
56
62
  "require": "./dist/index.js",
@@ -77,5 +83,5 @@
77
83
  "publishConfig": {
78
84
  "access": "public"
79
85
  },
80
- "packageManager": "bun@1.3.11"
86
+ "packageManager": "bun@1.3.14"
81
87
  }