@consciousclouds/tokens 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/CHANGELOG.md ADDED
@@ -0,0 +1,24 @@
1
+ # Changelog — @consciousclouds/tokens
2
+
3
+ Versioned on the independent frontend-SDK lifecycle (NOT `contract_version`).
4
+
5
+ ## [0.1.0] — 2026-07-04
6
+
7
+ ### Added
8
+
9
+ - **Token vocabulary** (Frontend Platform Layer 1): the semantic role names —
10
+ surface/content/interactive/status roles plus radius, spacing, and typography
11
+ scales — as TypeScript types and CSS custom properties. Roles are the only
12
+ vocabulary upper layers may consume; raw values never leak upward.
13
+ - **House theme CSS** (`styles/`): the default light/dark theme expressed as
14
+ values for the token roles (Tailwind v4 `@theme` compatible).
15
+ - **`ThemeProvider` / mode handling** over `next-themes` — light/dark/system,
16
+ no flash of wrong mode.
17
+
18
+ ### Notes
19
+
20
+ - Brands restyle by overriding token *values* (see `@consciousclouds/brand`
21
+ `tokenOverrides`), never by introducing new role names.
22
+ - Prepared-publishable per the assistant-surface packaging template; publish
23
+ order when the gate opens: conductor-sdk → conductor-react → operator-shell
24
+ (tokens/ui/brand have no workspace deps and may go first in any order).
package/LICENSE ADDED
@@ -0,0 +1,171 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship made available under
36
+ the License, as indicated by a copyright notice that is included in
37
+ or attached to the work (an example is provided in the Appendix below).
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object
40
+ form, that is based on (or derived from) the Work and for which the
41
+ editorial revisions, annotations, elaborations, or other modifications
42
+ represent, as a whole, an original work of authorship. For the purposes
43
+ of this License, Derivative Works shall not include works that remain
44
+ separable from, or merely link (or bind by name) to the interfaces of,
45
+ the Work and Derivative Works thereof.
46
+
47
+ "Contribution" shall mean, as submitted to the Licensor for inclusion
48
+ in the Work by the copyright owner or by an individual or Legal Entity
49
+ authorized to submit on behalf of the copyright owner. For the purposes
50
+ of this definition, "submitted" means any form of electronic, verbal,
51
+ or written communication sent to the Licensor or its representatives,
52
+ including but not limited to communication on electronic mailing lists,
53
+ source code control systems, and issue tracking systems that are managed
54
+ by, or on behalf of, the Licensor for the purpose of discussing and
55
+ improving the Work, but excluding communication that is conspicuously
56
+ marked or designated in writing by the copyright owner as "Not a
57
+ Contribution."
58
+
59
+ "Contributor" shall mean Licensor and any Legal Entity on behalf of
60
+ whom a Contribution has been received by the Licensor and included
61
+ within the Work.
62
+
63
+ 2. Grant of Copyright License. Subject to the terms and conditions of
64
+ this License, each Contributor hereby grants to You a perpetual,
65
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
66
+ copyright license to reproduce, prepare Derivative Works of,
67
+ publicly display, publicly perform, sublicense, and distribute the
68
+ Work and such Derivative Works in Source or Object form.
69
+
70
+ 3. Grant of Patent License. Subject to the terms and conditions of
71
+ this License, each Contributor hereby grants to You a perpetual,
72
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
73
+ (except as stated in this section) patent license to make, have made,
74
+ use, offer to sell, sell, import, and otherwise transfer the Work,
75
+ where such license applies only to those patent claims licensable
76
+ by such Contributor that are necessarily infringed by their
77
+ Contribution(s) alone or by the combination of their Contribution(s)
78
+ with the Work to which such Contribution(s) was submitted. If You
79
+ institute patent litigation against any entity (including a cross-claim
80
+ or counterclaim in a lawsuit) alleging that the Work or any
81
+ Contribution embodied within the Work constitutes direct or contributory
82
+ patent infringement, then any patent licenses granted to You under
83
+ this License for that Work shall terminate as of the date such
84
+ litigation is filed.
85
+
86
+ 4. Redistribution. You may reproduce and distribute copies of the
87
+ Work or Derivative Works thereof in any medium, with or without
88
+ modifications, and in Source or Object form, provided that You
89
+ meet the following conditions:
90
+
91
+ (a) You must give any other recipients of the Work or Derivative Works
92
+ a copy of this License; and
93
+
94
+ (b) You must cause any modified files to carry prominent notices
95
+ stating that You changed the files; and
96
+
97
+ (c) You must retain, in the Source form of any Derivative Works that
98
+ You distribute, all copyright, patent, trademark, and attribution
99
+ notices from the Source form of the Work, excluding those notices
100
+ that do not pertain to any part of the Derivative Works; and
101
+
102
+ (d) If the Work includes a "NOTICE" text file as part of its
103
+ distribution, You must include a readable copy of the attribution
104
+ notices contained within such NOTICE file, in at least one of the
105
+ following places: within a NOTICE text provided as part of the
106
+ Derivative Works; within the Source form or documentation, if
107
+ provided along with the Derivative Works; or, within a display
108
+ generated by the Derivative Works, if and wherever such third-party
109
+ notices normally appear. The contents of the NOTICE file are for
110
+ informational purposes only and do not modify the License. You may
111
+ add Your own attribution notices within Derivative Works that You
112
+ distribute, alongside or in addition to the NOTICE text from the
113
+ Work, provided that such additional attribution notices cannot be
114
+ construed as modifying the License.
115
+
116
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
117
+ any Contribution intentionally submitted for inclusion in the Work by
118
+ You to the Licensor shall be under the terms and conditions of this
119
+ License, without any additional terms or conditions.
120
+
121
+ 6. Trademarks. This License does not grant permission to use the trade
122
+ names, trademarks, service marks, or product names of the Licensor,
123
+ except as required for reasonable and customary use in describing the
124
+ origin of the Work and reproducing the content of the NOTICE file.
125
+
126
+ 7. Disclaimer of Warranty. Unless required by applicable law or
127
+ agreed to in writing, Licensor provides the Work (and each
128
+ Contributor provides its Contributions) on an "AS IS" BASIS,
129
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
130
+ implied, including, without limitation, any conditions of TITLE,
131
+ MERCHANTIBILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely
132
+ responsible for determining the appropriateness of using or
133
+ redistributing the Work and assume any risks associated with Your
134
+ exercise of permissions under this License.
135
+
136
+ 8. Limitation of Liability. In no event and under no legal theory,
137
+ whether in tort (including negligence), contract, or otherwise,
138
+ unless required by applicable law (such as deliberate and grossly
139
+ negligent acts) or agreed to in writing, shall any Contributor be
140
+ liable to You for damages, including any direct, indirect, special,
141
+ incidental, or exemplary damages of any character arising as a result
142
+ of this License or out of the use or inability to use the Work
143
+ (including but not limited to damages for loss of goodwill, work
144
+ stoppage, computer failure or malfunction, or all other commercial
145
+ damages or losses), even if such Contributor has been advised of the
146
+ possibility of such damages.
147
+
148
+ 9. Accepting Warranty or Liability. While redistributing the Work or
149
+ Derivative Works thereof, You may choose to offer, and charge a fee
150
+ for, acceptance of support, warranty, indemnity, or other liability
151
+ obligations and/or rights consistent with this License. However, in
152
+ accepting such obligations, You may offer such obligations only on
153
+ Your own behalf and on Your sole responsibility, not on behalf of any
154
+ other Contributor, and only if You agree to indemnify, defend, and
155
+ hold each Contributor harmless for any liability incurred by, or
156
+ claims asserted against, such Contributor by reason of your accepting
157
+ any such warranty or additional liability.
158
+
159
+ Copyright 2024 Conscious Clouds
160
+
161
+ Licensed under the Apache License, Version 2.0 (the "License");
162
+ you may not use this file except in compliance with the License.
163
+ You may obtain a copy of the License at
164
+
165
+ http://www.apache.org/licenses/LICENSE-2.0
166
+
167
+ Unless required by applicable law or agreed to in writing, software
168
+ distributed under the License is distributed on an "AS IS" BASIS,
169
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
170
+ See the License for the specific language governing permissions and
171
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,52 @@
1
+ # @consciousclouds/tokens
2
+
3
+ The **ConsciousClouds Token System** — Layer 1 of the Frontend Platform. It owns:
4
+
5
+ - **The vocabulary** (`src/schema.ts`): the 27 color token roles (19 core
6
+ shadcn roles + the 8-role sidebar set) plus the `radius` role. Every
7
+ surface, primitive, and Brand speaks these names; a Brand may override
8
+ *values*, never invent roles.
9
+ - **The house values** (`styles/house.css`): the `:root` / `.dark` blocks and
10
+ the Tailwind v4 `@theme inline` mapping that resolves utilities to them.
11
+ - **Theme state** (`ThemeProvider` / `useTheme`): a thin next-themes wrapper
12
+ with the house posture baked in (class attribute, system default, no
13
+ transition flash). Theme state is token machinery — which mode's values apply.
14
+
15
+ It carries **no components, no brand meaning, no product** (membrane gate: a token
16
+ holds no logo, no product value, no endpoint — a *Brand* re-values roles through
17
+ `@consciousclouds/brand`, which depends on this package type-only).
18
+
19
+ Schema exports for machinery that speaks the vocabulary: `TOKEN_ROLES` /
20
+ `COLOR_TOKEN_ROLES` / `RADIUS_TOKEN_ROLE`, `tokenCssVariable(role)`, and the types
21
+ `TokenRole` / `TokenValues` / `TokenMode` / `TokenModeValues` (what a Brand's
22
+ `tokenOverrides` are typed against).
23
+
24
+ ## Usage — step 1 of the second product's path
25
+
26
+ In the app's Tailwind entry stylesheet, after Tailwind itself:
27
+
28
+ ```css
29
+ @import "tailwindcss";
30
+ @import "@consciousclouds/tokens/styles/house.css";
31
+ ```
32
+
33
+ In the root layout (keep `suppressHydrationWarning` on `<html>` — next-themes
34
+ mutates it pre-hydration):
35
+
36
+ ```tsx
37
+ import { ThemeProvider } from "@consciousclouds/tokens";
38
+
39
+ <html lang="en" suppressHydrationWarning>
40
+ <body>
41
+ <ThemeProvider>{children}</ThemeProvider>
42
+ </body>
43
+ </html>
44
+ ```
45
+
46
+ Note for shell consumers: `@consciousclouds/operator-shell` takes this package as a
47
+ runtime **peer** — the app mounts ONE `ThemeProvider` (here) and the shell's theme toggle
48
+ reads that same instance through `useTheme`.
49
+
50
+ Governed by `docs/design/frontend-platform-doctrine.md` and
51
+ `docs/design/operator-platform-contracts.md` (§6 package graph). Platform overview + the
52
+ full adoption path: [`platform/frontend/README.md`](../README.md).
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @consciousclouds/tokens — Token System (Layer 1 of the Frontend Platform).
3
+ *
4
+ * The universal design-token vocabulary (the 27 color roles including the
5
+ * sidebar set, plus radius), typed role/value shapes, the CSS-variable
6
+ * naming rule (tokenCssVariable), and theme state (ThemeProvider/useTheme
7
+ * over next-themes). The house theme VALUES ship as CSS
8
+ * (./styles/house.css) — this module carries vocabulary and behavior only:
9
+ * no components, no brand meaning, no product.
10
+ */
11
+ export { COLOR_TOKEN_ROLES, RADIUS_TOKEN_ROLE, TOKEN_ROLES, tokenCssVariable, } from "./schema.js";
12
+ export type { ColorTokenRole, RadiusTokenRole, TokenRole, TokenValues, TokenMode, TokenModeValues, } from "./schema.js";
13
+ export { ThemeProvider, useTheme } from "./theme-provider.js";
14
+ export type { ThemeProviderProps } from "./theme-provider.js";
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,cAAc,EACd,eAAe,EACf,SAAS,EACT,WAAW,EACX,SAAS,EACT,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC9D,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @consciousclouds/tokens — Token System (Layer 1 of the Frontend Platform).
3
+ *
4
+ * The universal design-token vocabulary (the 27 color roles including the
5
+ * sidebar set, plus radius), typed role/value shapes, the CSS-variable
6
+ * naming rule (tokenCssVariable), and theme state (ThemeProvider/useTheme
7
+ * over next-themes). The house theme VALUES ship as CSS
8
+ * (./styles/house.css) — this module carries vocabulary and behavior only:
9
+ * no components, no brand meaning, no product.
10
+ */
11
+ export { COLOR_TOKEN_ROLES, RADIUS_TOKEN_ROLE, TOKEN_ROLES, tokenCssVariable, } from "./schema.js";
12
+ export { ThemeProvider, useTheme } from "./theme-provider.js";
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAUrB,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * The ConsciousClouds Token System vocabulary.
3
+ *
4
+ * Token roles are the universal *names* every surface, primitive, and Brand
5
+ * speaks. The house values live in `styles/house.css` (`:root` / `.dark`);
6
+ * a Brand may override *values* (typed against these role names) but never
7
+ * invents new roles. Color roles hold HSL channel triples (e.g.
8
+ * `"243 75% 59%"`) so `hsl(var(--role))` composes; the radius role holds a
9
+ * CSS length (e.g. `"0.625rem"`).
10
+ */
11
+ /** The 27 color token roles: the 19 core shadcn roles + the 8-role sidebar set. */
12
+ export declare const COLOR_TOKEN_ROLES: readonly ["background", "foreground", "card", "card-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "secondary", "secondary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "destructive-foreground", "border", "input", "ring", "sidebar-background", "sidebar-foreground", "sidebar-primary", "sidebar-primary-foreground", "sidebar-accent", "sidebar-accent-foreground", "sidebar-border", "sidebar-ring"];
13
+ /** A color token role name (CSS variable name without the `--` prefix). */
14
+ export type ColorTokenRole = (typeof COLOR_TOKEN_ROLES)[number];
15
+ /** The radius token role — a CSS length; `sm`/`md`/`lg` derive from it. */
16
+ export declare const RADIUS_TOKEN_ROLE: "radius";
17
+ export type RadiusTokenRole = typeof RADIUS_TOKEN_ROLE;
18
+ /** Every token role a theme (or a Brand override) may assign a value to. */
19
+ export type TokenRole = ColorTokenRole | RadiusTokenRole;
20
+ /** All token roles, in declaration order (colors first, then radius). */
21
+ export declare const TOKEN_ROLES: readonly ["background", "foreground", "card", "card-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "secondary", "secondary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "destructive-foreground", "border", "input", "ring", "sidebar-background", "sidebar-foreground", "sidebar-primary", "sidebar-primary-foreground", "sidebar-accent", "sidebar-accent-foreground", "sidebar-border", "sidebar-ring", "radius"];
22
+ /**
23
+ * A partial assignment of values to token roles — the shape of a Brand's
24
+ * token overrides. Color values are HSL channel triples; radius is a length.
25
+ */
26
+ export type TokenValues = Partial<Record<TokenRole, string>>;
27
+ /** The display modes a theme resolves to (`system` resolves to one of these). */
28
+ export type TokenMode = "light" | "dark";
29
+ /** Token values per mode — a full theme (or override) across light and dark. */
30
+ export type TokenModeValues = Partial<Record<TokenMode, TokenValues>>;
31
+ /** The CSS custom-property name for a token role (e.g. `--sidebar-border`). */
32
+ export declare function tokenCssVariable(role: TokenRole): `--${TokenRole}`;
33
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,mFAAmF;AACnF,eAAO,MAAM,iBAAiB,udA8BpB,CAAC;AAEX,2EAA2E;AAC3E,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,2EAA2E;AAC3E,eAAO,MAAM,iBAAiB,EAAG,QAAiB,CAAC;AAEnD,MAAM,MAAM,eAAe,GAAG,OAAO,iBAAiB,CAAC;AAEvD,4EAA4E;AAC5E,MAAM,MAAM,SAAS,GAAG,cAAc,GAAG,eAAe,CAAC;AAEzD,yEAAyE;AACzE,eAAO,MAAM,WAAW,ieAAqD,CAAC;AAE9E;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;AAE7D,iFAAiF;AACjF,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEzC,gFAAgF;AAChF,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;AAEtE,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,KAAK,SAAS,EAAE,CAElE"}
package/dist/schema.js ADDED
@@ -0,0 +1,51 @@
1
+ /**
2
+ * The ConsciousClouds Token System vocabulary.
3
+ *
4
+ * Token roles are the universal *names* every surface, primitive, and Brand
5
+ * speaks. The house values live in `styles/house.css` (`:root` / `.dark`);
6
+ * a Brand may override *values* (typed against these role names) but never
7
+ * invents new roles. Color roles hold HSL channel triples (e.g.
8
+ * `"243 75% 59%"`) so `hsl(var(--role))` composes; the radius role holds a
9
+ * CSS length (e.g. `"0.625rem"`).
10
+ */
11
+ /** The 27 color token roles: the 19 core shadcn roles + the 8-role sidebar set. */
12
+ export const COLOR_TOKEN_ROLES = [
13
+ // Core surface + semantic roles.
14
+ "background",
15
+ "foreground",
16
+ "card",
17
+ "card-foreground",
18
+ "popover",
19
+ "popover-foreground",
20
+ "primary",
21
+ "primary-foreground",
22
+ "secondary",
23
+ "secondary-foreground",
24
+ "muted",
25
+ "muted-foreground",
26
+ "accent",
27
+ "accent-foreground",
28
+ "destructive",
29
+ "destructive-foreground",
30
+ "border",
31
+ "input",
32
+ "ring",
33
+ // Sidebar set (the operator chrome).
34
+ "sidebar-background",
35
+ "sidebar-foreground",
36
+ "sidebar-primary",
37
+ "sidebar-primary-foreground",
38
+ "sidebar-accent",
39
+ "sidebar-accent-foreground",
40
+ "sidebar-border",
41
+ "sidebar-ring",
42
+ ];
43
+ /** The radius token role — a CSS length; `sm`/`md`/`lg` derive from it. */
44
+ export const RADIUS_TOKEN_ROLE = "radius";
45
+ /** All token roles, in declaration order (colors first, then radius). */
46
+ export const TOKEN_ROLES = [...COLOR_TOKEN_ROLES, RADIUS_TOKEN_ROLE];
47
+ /** The CSS custom-property name for a token role (e.g. `--sidebar-border`). */
48
+ export function tokenCssVariable(role) {
49
+ return `--${role}`;
50
+ }
51
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,mFAAmF;AACnF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,iCAAiC;IACjC,YAAY;IACZ,YAAY;IACZ,MAAM;IACN,iBAAiB;IACjB,SAAS;IACT,oBAAoB;IACpB,SAAS;IACT,oBAAoB;IACpB,WAAW;IACX,sBAAsB;IACtB,OAAO;IACP,kBAAkB;IAClB,QAAQ;IACR,mBAAmB;IACnB,aAAa;IACb,wBAAwB;IACxB,QAAQ;IACR,OAAO;IACP,MAAM;IACN,qCAAqC;IACrC,oBAAoB;IACpB,oBAAoB;IACpB,iBAAiB;IACjB,4BAA4B;IAC5B,gBAAgB;IAChB,2BAA2B;IAC3B,gBAAgB;IAChB,cAAc;CACN,CAAC;AAKX,2EAA2E;AAC3E,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAiB,CAAC;AAOnD,yEAAyE;AACzE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAG,iBAAiB,EAAE,iBAAiB,CAAU,CAAC;AAc9E,+EAA+E;AAC/E,MAAM,UAAU,gBAAgB,CAAC,IAAe;IAC9C,OAAO,KAAK,IAAI,EAAE,CAAC;AACrB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Theme state is token machinery: the Token System owns which mode's values
3
+ * apply. A thin wrapper over next-themes with the house posture baked in —
4
+ * class-attribute switching (matches `styles/house.css`'s `.dark` block),
5
+ * system default, no transition flash. Consumers keep
6
+ * `suppressHydrationWarning` on `<html>` (next-themes mutates it pre-hydration).
7
+ */
8
+ import * as React from "react";
9
+ import { ThemeProvider as NextThemesProvider, useTheme } from "next-themes";
10
+ export type ThemeProviderProps = React.ComponentProps<typeof NextThemesProvider>;
11
+ export declare function ThemeProvider({ children, ...props }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
12
+ /** Re-exported so consumers never import next-themes directly. */
13
+ export { useTheme };
14
+ //# sourceMappingURL=theme-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-provider.d.ts","sourceRoot":"","sources":["../src/theme-provider.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,IAAI,kBAAkB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5E,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEjF,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,2CAYvE;AAED,kEAAkE;AAClE,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { ThemeProvider as NextThemesProvider, useTheme } from "next-themes";
4
+ export function ThemeProvider({ children, ...props }) {
5
+ return (_jsx(NextThemesProvider, { attribute: "class", defaultTheme: "system", enableSystem: true, disableTransitionOnChange: true, ...props, children: children }));
6
+ }
7
+ /** Re-exported so consumers never import next-themes directly. */
8
+ export { useTheme };
9
+ //# sourceMappingURL=theme-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-provider.js","sourceRoot":"","sources":["../src/theme-provider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAWb,OAAO,EAAE,aAAa,IAAI,kBAAkB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI5E,MAAM,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAsB;IACtE,OAAO,CACL,KAAC,kBAAkB,IACjB,SAAS,EAAC,OAAO,EACjB,YAAY,EAAC,QAAQ,EACrB,YAAY,QACZ,yBAAyB,WACrB,KAAK,YAER,QAAQ,GACU,CACtB,CAAC;AACJ,CAAC;AAED,kEAAkE;AAClE,OAAO,EAAE,QAAQ,EAAE,CAAC"}
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@consciousclouds/tokens",
3
+ "version": "0.1.0",
4
+ "description": "ConsciousClouds Token System — the universal design-token vocabulary (27 color roles incl. the sidebar set, plus radius), the house theme values, and theme state (ThemeProvider over next-themes). Layer 1 of the Frontend Platform; carries no components, no brand meaning, no product.",
5
+ "license": "Apache-2.0",
6
+ "type": "module",
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ },
14
+ "./styles/house.css": "./styles/house.css"
15
+ },
16
+ "files": ["dist", "styles", "README.md", "CHANGELOG.md", "LICENSE"],
17
+ "scripts": {
18
+ "build": "tsc -p tsconfig.build.json",
19
+ "clean": "rm -rf dist",
20
+ "type-check": "tsc --noEmit",
21
+ "prepublishOnly": "bun run clean && bun run build && bun run type-check"
22
+ },
23
+ "dependencies": {
24
+ "next-themes": "^0.4.6"
25
+ },
26
+ "peerDependencies": {
27
+ "react": ">=18.0.0"
28
+ },
29
+ "devDependencies": {
30
+ "@types/react": "^19.2.7",
31
+ "react": "19.2.4",
32
+ "typescript": "^5.7.2"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "engines": {
38
+ "bun": ">=1.0.0",
39
+ "node": ">=18.0.0"
40
+ }
41
+ }
@@ -0,0 +1,154 @@
1
+ /*
2
+ * @consciousclouds/tokens — the house theme.
3
+ *
4
+ * The universal token roles (see src/schema.ts) with the ConsciousClouds
5
+ * house values, plus the Tailwind v4 `@theme inline` mapping that resolves
6
+ * utilities to them. Import from an app's Tailwind entry stylesheet, after
7
+ * Tailwind itself:
8
+ *
9
+ * @import "tailwindcss";
10
+ * @import "@consciousclouds/tokens/styles/house.css";
11
+ *
12
+ * Dark mode is class-driven (`.dark` on <html>), toggled by this package's
13
+ * ThemeProvider. Vars stay HSL channel triples so hsl(var(--role)) composes.
14
+ */
15
+
16
+ @custom-variant dark (&:is(.dark *));
17
+
18
+ /* Tailwind v4 theme mapping — utilities resolve to the token variables below. */
19
+ @theme inline {
20
+ --color-background: hsl(var(--background));
21
+ --color-foreground: hsl(var(--foreground));
22
+ --color-card: hsl(var(--card));
23
+ --color-card-foreground: hsl(var(--card-foreground));
24
+ --color-popover: hsl(var(--popover));
25
+ --color-popover-foreground: hsl(var(--popover-foreground));
26
+ --color-primary: hsl(var(--primary));
27
+ --color-primary-foreground: hsl(var(--primary-foreground));
28
+ --color-secondary: hsl(var(--secondary));
29
+ --color-secondary-foreground: hsl(var(--secondary-foreground));
30
+ --color-muted: hsl(var(--muted));
31
+ --color-muted-foreground: hsl(var(--muted-foreground));
32
+ --color-accent: hsl(var(--accent));
33
+ --color-accent-foreground: hsl(var(--accent-foreground));
34
+ --color-destructive: hsl(var(--destructive));
35
+ --color-destructive-foreground: hsl(var(--destructive-foreground));
36
+ --color-border: hsl(var(--border));
37
+ --color-input: hsl(var(--input));
38
+ --color-ring: hsl(var(--ring));
39
+
40
+ --color-sidebar: hsl(var(--sidebar-background));
41
+ --color-sidebar-foreground: hsl(var(--sidebar-foreground));
42
+ --color-sidebar-primary: hsl(var(--sidebar-primary));
43
+ --color-sidebar-primary-foreground: hsl(var(--sidebar-primary-foreground));
44
+ --color-sidebar-accent: hsl(var(--sidebar-accent));
45
+ --color-sidebar-accent-foreground: hsl(var(--sidebar-accent-foreground));
46
+ --color-sidebar-border: hsl(var(--sidebar-border));
47
+ --color-sidebar-ring: hsl(var(--sidebar-ring));
48
+
49
+ --radius-sm: calc(var(--radius) - 4px);
50
+ --radius-md: calc(var(--radius) - 2px);
51
+ --radius-lg: var(--radius);
52
+
53
+ --animate-accordion-down: accordion-down 0.2s ease-out;
54
+ --animate-accordion-up: accordion-up 0.2s ease-out;
55
+
56
+ @keyframes accordion-down {
57
+ from {
58
+ height: 0;
59
+ }
60
+ to {
61
+ height: var(--radix-accordion-content-height);
62
+ }
63
+ }
64
+ @keyframes accordion-up {
65
+ from {
66
+ height: var(--radix-accordion-content-height);
67
+ }
68
+ to {
69
+ height: 0;
70
+ }
71
+ }
72
+ }
73
+
74
+ /* ConsciousClouds house theme tokens (shadcn HSL variables). The platform owns
75
+ * theming; products own content. House accent: indigo/violet (the factory). */
76
+ :root {
77
+ --background: 0 0% 100%;
78
+ --foreground: 240 10% 3.9%;
79
+ --card: 0 0% 100%;
80
+ --card-foreground: 240 10% 3.9%;
81
+ --popover: 0 0% 100%;
82
+ --popover-foreground: 240 10% 3.9%;
83
+ --primary: 243 75% 59%;
84
+ --primary-foreground: 0 0% 98%;
85
+ --secondary: 240 4.8% 95.9%;
86
+ --secondary-foreground: 240 5.9% 10%;
87
+ --muted: 240 4.8% 95.9%;
88
+ --muted-foreground: 240 3.8% 46.1%;
89
+ --accent: 243 30% 96%;
90
+ --accent-foreground: 243 75% 45%;
91
+ --destructive: 0 84.2% 60.2%;
92
+ --destructive-foreground: 0 0% 98%;
93
+ --border: 240 5.9% 90%;
94
+ --input: 240 5.9% 90%;
95
+ --ring: 243 75% 59%;
96
+ --radius: 0.625rem;
97
+
98
+ --sidebar-background: 240 5% 98%;
99
+ --sidebar-foreground: 240 5.3% 26.1%;
100
+ --sidebar-primary: 243 75% 59%;
101
+ --sidebar-primary-foreground: 0 0% 98%;
102
+ --sidebar-accent: 243 30% 96%;
103
+ --sidebar-accent-foreground: 243 75% 45%;
104
+ --sidebar-border: 240 5.9% 90%;
105
+ --sidebar-ring: 243 75% 59%;
106
+ }
107
+
108
+ .dark {
109
+ --background: 240 10% 5%;
110
+ --foreground: 0 0% 98%;
111
+ --card: 240 10% 7%;
112
+ --card-foreground: 0 0% 98%;
113
+ --popover: 240 10% 7%;
114
+ --popover-foreground: 0 0% 98%;
115
+ --primary: 243 75% 64%;
116
+ --primary-foreground: 0 0% 100%;
117
+ --secondary: 240 6% 14%;
118
+ --secondary-foreground: 0 0% 98%;
119
+ --muted: 240 6% 14%;
120
+ --muted-foreground: 240 5% 64.9%;
121
+ --accent: 243 25% 16%;
122
+ --accent-foreground: 243 80% 78%;
123
+ --destructive: 0 62.8% 45%;
124
+ --destructive-foreground: 0 0% 98%;
125
+ --border: 240 6% 18%;
126
+ --input: 240 6% 18%;
127
+ --ring: 243 75% 64%;
128
+
129
+ --sidebar-background: 240 8% 9%;
130
+ --sidebar-foreground: 240 4.8% 90%;
131
+ --sidebar-primary: 243 75% 64%;
132
+ --sidebar-primary-foreground: 0 0% 100%;
133
+ --sidebar-accent: 243 25% 16%;
134
+ --sidebar-accent-foreground: 243 80% 78%;
135
+ --sidebar-border: 240 6% 18%;
136
+ --sidebar-ring: 243 75% 64%;
137
+ }
138
+
139
+ @layer base {
140
+ /* Tailwind v4 defaults border-color to currentColor; keep the v3/shadcn
141
+ * behavior of theming every border explicitly. */
142
+ *,
143
+ ::after,
144
+ ::before,
145
+ ::backdrop,
146
+ ::file-selector-button {
147
+ border-color: hsl(var(--border));
148
+ }
149
+ body {
150
+ background-color: hsl(var(--background));
151
+ color: hsl(var(--foreground));
152
+ font-feature-settings: "rlig" 1, "calt" 1;
153
+ }
154
+ }