@hex-core/themes 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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Hex UI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # @hex-core/themes
2
+
3
+ Premium theme catalog for Hex UI — preset palettes that consume the same `Theme` shape as `@hex-core/tokens`.
4
+
5
+ ## Why this is its own package
6
+
7
+ `@hex-core/tokens` keeps a single canonical default theme + the transformer functions (`themeToCss`, `themeToScopedRuntimeCss`, etc.). `@hex-core/themes` is the publish/version surface for everything else. Adding or revising a theme bumps **only** this package, so consumers who pin a theme don't get pulled forward by an unrelated transformer change.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ pnpm add @hex-core/themes @hex-core/tokens
13
+ ```
14
+
15
+ `@hex-core/tokens` is the implicit peer dep — every theme is a `Theme` instance from `@hex-core/registry`, applied by `tokens`' transformers.
16
+
17
+ ## Use
18
+
19
+ ```ts
20
+ import { midnightTheme, emberTheme, listPremiumThemes } from "@hex-core/themes";
21
+ import { themeToScopedRuntimeCss } from "@hex-core/tokens";
22
+
23
+ // Apply a theme via runtime override (no globals.css round-trip):
24
+ const css = themeToScopedRuntimeCss(midnightTheme, {
25
+ scope: ".theme-midnight",
26
+ mode: "dark",
27
+ });
28
+
29
+ // Drive a theme switcher UI from the catalog:
30
+ for (const { name, displayName, description } of listPremiumThemes()) {
31
+ // …render a chip per theme
32
+ }
33
+ ```
34
+
35
+ ## Catalog (today)
36
+
37
+ | Name | Display name | Notes |
38
+ |---|---|---|
39
+ | `midnight` | Midnight | Dark canvas, indigo accents. Re-exported from `@hex-core/tokens`. |
40
+ | `ember` | Ember | Warm dark canvas with amber primary. Re-exported from `@hex-core/tokens`. |
41
+
42
+ Future premium presets (`fintech-dark`, `editorial-warm`, `data-dense`, `pastel-soft`, `monochrome-strict`) ship here directly.
43
+
44
+ ## License
45
+
46
+ MIT
@@ -0,0 +1,59 @@
1
+ import { Theme } from '@hex-core/registry';
2
+ export { emberTheme, midnightTheme } from '@hex-core/tokens';
3
+
4
+ /**
5
+ * @hex-core/themes — premium theme catalog and convenience re-exports.
6
+ *
7
+ * This package establishes a separate publish/version surface for theme
8
+ * presets so the bundled `@hex-core/tokens` package can stay focused on the
9
+ * single canonical default theme + the transformer functions.
10
+ *
11
+ * Today: re-exports `midnightTheme` and `emberTheme` from `@hex-core/tokens`
12
+ * so consumers have a single import location for "the catalog of themes",
13
+ * and adds a `listPremiumThemes()` helper. Future premium themes
14
+ * (`fintech-dark`, `editorial-warm`, `data-dense`, `pastel-soft`,
15
+ * `monochrome-strict`) will land here directly without bumping `tokens`.
16
+ *
17
+ * The default theme remains in `@hex-core/tokens` since it is the canonical
18
+ * baseline that the transformers (themeToCss, themeToScopedRuntimeCss,
19
+ * themeToFlatJson, themeToTailwindConfig, generateGlobalsCss) operate on.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * import { midnightTheme, emberTheme, listPremiumThemes } from "@hex-core/themes";
24
+ * import { themeToScopedRuntimeCss } from "@hex-core/tokens";
25
+ *
26
+ * const css = themeToScopedRuntimeCss(midnightTheme, { mode: "dark" });
27
+ * console.log(listPremiumThemes().map(t => t.name));
28
+ * ```
29
+ */
30
+
31
+ /**
32
+ * The full set of premium themes shipped by this package, keyed by name.
33
+ * Future premium themes added here are picked up automatically by
34
+ * {@link listPremiumThemes} and {@link getPremiumTheme}.
35
+ */
36
+ declare const premiumThemes: Record<string, Theme>;
37
+ /**
38
+ * Retrieve a premium theme by name.
39
+ *
40
+ * @param name - The theme identifier (e.g. `"midnight"`, `"ember"`).
41
+ * @returns The matching Theme object, or `undefined` if the name is unknown.
42
+ */
43
+ declare function getPremiumTheme(name: string): Theme | undefined;
44
+ /**
45
+ * List metadata for every premium theme in the catalog.
46
+ *
47
+ * Mirrors the shape of `listThemes()` from `@hex-core/tokens` so studios and
48
+ * theme switchers can drive both catalogs through the same UI without
49
+ * adapter code.
50
+ *
51
+ * @returns Array of `{ name, displayName, description }` summaries.
52
+ */
53
+ declare function listPremiumThemes(): Array<{
54
+ name: string;
55
+ displayName: string;
56
+ description: string;
57
+ }>;
58
+
59
+ export { getPremiumTheme, listPremiumThemes, premiumThemes };
package/dist/index.js ADDED
@@ -0,0 +1,24 @@
1
+ // src/index.ts
2
+ import { emberTheme, midnightTheme } from "@hex-core/tokens";
3
+ var premiumThemes = {
4
+ midnight: midnightTheme,
5
+ ember: emberTheme
6
+ };
7
+ function getPremiumTheme(name) {
8
+ return premiumThemes[name];
9
+ }
10
+ function listPremiumThemes() {
11
+ return Object.values(premiumThemes).map((t) => ({
12
+ name: t.name,
13
+ displayName: t.displayName,
14
+ description: t.description
15
+ }));
16
+ }
17
+ export {
18
+ emberTheme,
19
+ getPremiumTheme,
20
+ listPremiumThemes,
21
+ midnightTheme,
22
+ premiumThemes
23
+ };
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @hex-core/themes — premium theme catalog and convenience re-exports.\n *\n * This package establishes a separate publish/version surface for theme\n * presets so the bundled `@hex-core/tokens` package can stay focused on the\n * single canonical default theme + the transformer functions.\n *\n * Today: re-exports `midnightTheme` and `emberTheme` from `@hex-core/tokens`\n * so consumers have a single import location for \"the catalog of themes\",\n * and adds a `listPremiumThemes()` helper. Future premium themes\n * (`fintech-dark`, `editorial-warm`, `data-dense`, `pastel-soft`,\n * `monochrome-strict`) will land here directly without bumping `tokens`.\n *\n * The default theme remains in `@hex-core/tokens` since it is the canonical\n * baseline that the transformers (themeToCss, themeToScopedRuntimeCss,\n * themeToFlatJson, themeToTailwindConfig, generateGlobalsCss) operate on.\n *\n * @example\n * ```ts\n * import { midnightTheme, emberTheme, listPremiumThemes } from \"@hex-core/themes\";\n * import { themeToScopedRuntimeCss } from \"@hex-core/tokens\";\n *\n * const css = themeToScopedRuntimeCss(midnightTheme, { mode: \"dark\" });\n * console.log(listPremiumThemes().map(t => t.name));\n * ```\n */\nimport type { Theme } from \"@hex-core/registry\";\nimport { emberTheme, midnightTheme } from \"@hex-core/tokens\";\n\nexport { emberTheme, midnightTheme };\n\n/**\n * The full set of premium themes shipped by this package, keyed by name.\n * Future premium themes added here are picked up automatically by\n * {@link listPremiumThemes} and {@link getPremiumTheme}.\n */\nexport const premiumThemes: Record<string, Theme> = {\n\tmidnight: midnightTheme,\n\tember: emberTheme,\n};\n\n/**\n * Retrieve a premium theme by name.\n *\n * @param name - The theme identifier (e.g. `\"midnight\"`, `\"ember\"`).\n * @returns The matching Theme object, or `undefined` if the name is unknown.\n */\nexport function getPremiumTheme(name: string): Theme | undefined {\n\treturn premiumThemes[name];\n}\n\n/**\n * List metadata for every premium theme in the catalog.\n *\n * Mirrors the shape of `listThemes()` from `@hex-core/tokens` so studios and\n * theme switchers can drive both catalogs through the same UI without\n * adapter code.\n *\n * @returns Array of `{ name, displayName, description }` summaries.\n */\nexport function listPremiumThemes(): Array<{\n\tname: string;\n\tdisplayName: string;\n\tdescription: string;\n}> {\n\treturn Object.values(premiumThemes).map((t) => ({\n\t\tname: t.name,\n\t\tdisplayName: t.displayName,\n\t\tdescription: t.description,\n\t}));\n}\n"],"mappings":";AA2BA,SAAS,YAAY,qBAAqB;AASnC,IAAM,gBAAuC;AAAA,EACnD,UAAU;AAAA,EACV,OAAO;AACR;AAQO,SAAS,gBAAgB,MAAiC;AAChE,SAAO,cAAc,IAAI;AAC1B;AAWO,SAAS,oBAIb;AACF,SAAO,OAAO,OAAO,aAAa,EAAE,IAAI,CAAC,OAAO;AAAA,IAC/C,MAAM,EAAE;AAAA,IACR,aAAa,EAAE;AAAA,IACf,aAAa,EAAE;AAAA,EAChB,EAAE;AACH;","names":[]}
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@hex-core/themes",
3
+ "version": "0.1.0",
4
+ "description": "Theme catalog for Hex UI — premium presets and convenience re-exports built on @hex-core/tokens.",
5
+ "keywords": [
6
+ "hex-ui",
7
+ "themes",
8
+ "design-tokens",
9
+ "theme-catalog"
10
+ ],
11
+ "license": "MIT",
12
+ "author": "Oscar Corona <oabc4004@gmail.com>",
13
+ "homepage": "https://hex-core.dev",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/oscarabcorona/hex-core.git",
17
+ "directory": "packages/themes"
18
+ },
19
+ "bugs": {
20
+ "url": "https://github.com/oscarabcorona/hex-core/issues"
21
+ },
22
+ "type": "module",
23
+ "main": "dist/index.js",
24
+ "types": "dist/index.d.ts",
25
+ "exports": {
26
+ ".": {
27
+ "import": "./dist/index.js",
28
+ "types": "./dist/index.d.ts"
29
+ }
30
+ },
31
+ "files": [
32
+ "dist",
33
+ "README.md",
34
+ "LICENSE"
35
+ ],
36
+ "publishConfig": {
37
+ "access": "public"
38
+ },
39
+ "dependencies": {
40
+ "@hex-core/registry": "^0.2.1",
41
+ "@hex-core/tokens": "^1.2.0"
42
+ },
43
+ "devDependencies": {
44
+ "tsup": "^8.3.0",
45
+ "typescript": "^6.0.3",
46
+ "vitest": "^4.1.5"
47
+ },
48
+ "scripts": {
49
+ "build": "tsup",
50
+ "clean": "rm -rf dist",
51
+ "test": "vitest run"
52
+ }
53
+ }