@tetsuo-ai/marketplace-react 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.
Files changed (112) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/LICENSE +21 -0
  3. package/README.md +172 -0
  4. package/dist/chunk-5OTKSRHM.js +128 -0
  5. package/dist/chunk-5OTKSRHM.js.map +1 -0
  6. package/dist/chunk-ABS77JB2.js +94 -0
  7. package/dist/chunk-ABS77JB2.js.map +1 -0
  8. package/dist/chunk-GN5DYVN5.js +35 -0
  9. package/dist/chunk-GN5DYVN5.js.map +1 -0
  10. package/dist/chunk-KJMR6OGC.js +1198 -0
  11. package/dist/chunk-KJMR6OGC.js.map +1 -0
  12. package/dist/chunk-YORZNYZZ.js +107 -0
  13. package/dist/chunk-YORZNYZZ.js.map +1 -0
  14. package/dist/components/agenc-components.css +570 -0
  15. package/dist/components/index.cjs +1335 -0
  16. package/dist/components/index.cjs.map +1 -0
  17. package/dist/components/index.d.cts +5 -0
  18. package/dist/components/index.d.ts +5 -0
  19. package/dist/components/index.js +5 -0
  20. package/dist/components/index.js.map +1 -0
  21. package/dist/hooks/index.cjs +493 -0
  22. package/dist/hooks/index.cjs.map +1 -0
  23. package/dist/hooks/index.d.cts +294 -0
  24. package/dist/hooks/index.d.ts +294 -0
  25. package/dist/hooks/index.js +339 -0
  26. package/dist/hooks/index.js.map +1 -0
  27. package/dist/index-BLrlBVj-.d.cts +1129 -0
  28. package/dist/index-CKTYsNPH.d.ts +1129 -0
  29. package/dist/index.cjs +1690 -0
  30. package/dist/index.cjs.map +1 -0
  31. package/dist/index.d.cts +235 -0
  32. package/dist/index.d.ts +235 -0
  33. package/dist/index.js +127 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/signers/index.cjs +166 -0
  36. package/dist/signers/index.cjs.map +1 -0
  37. package/dist/signers/index.d.cts +136 -0
  38. package/dist/signers/index.d.ts +136 -0
  39. package/dist/signers/index.js +4 -0
  40. package/dist/signers/index.js.map +1 -0
  41. package/dist/testing/index.cjs +62 -0
  42. package/dist/testing/index.cjs.map +1 -0
  43. package/dist/testing/index.d.cts +71 -0
  44. package/dist/testing/index.d.ts +71 -0
  45. package/dist/testing/index.js +60 -0
  46. package/dist/testing/index.js.map +1 -0
  47. package/dist/theme/agenc-tailwind-preset.cjs +184 -0
  48. package/dist/theme/agenc-tokens.css +132 -0
  49. package/dist/types-jvISR6bc.d.cts +135 -0
  50. package/dist/types-jvISR6bc.d.ts +135 -0
  51. package/dist/useAgentTrackRecord-BLf1nrbu.d.cts +249 -0
  52. package/dist/useAgentTrackRecord-BLf1nrbu.d.ts +249 -0
  53. package/package.json +139 -0
  54. package/src/components/DisputeBanner.stories.tsx +39 -0
  55. package/src/components/DisputeBanner.tsx +110 -0
  56. package/src/components/HireButton.stories.tsx +72 -0
  57. package/src/components/HireButton.tsx +151 -0
  58. package/src/components/HireCheckoutModal.stories.tsx +107 -0
  59. package/src/components/HireCheckoutModal.tsx +284 -0
  60. package/src/components/ListingCard.stories.tsx +55 -0
  61. package/src/components/ListingCard.tsx +148 -0
  62. package/src/components/ListingGrid.stories.tsx +44 -0
  63. package/src/components/ListingGrid.tsx +137 -0
  64. package/src/components/Modal.tsx +121 -0
  65. package/src/components/PoweredByAgenC.tsx +85 -0
  66. package/src/components/ProviderCard.stories.tsx +61 -0
  67. package/src/components/ProviderCard.tsx +154 -0
  68. package/src/components/ReferrerDisclosure.tsx +67 -0
  69. package/src/components/ReviewPanel.stories.tsx +65 -0
  70. package/src/components/ReviewPanel.tsx +141 -0
  71. package/src/components/TaskTimeline.stories.tsx +43 -0
  72. package/src/components/TaskTimeline.tsx +156 -0
  73. package/src/components/__fixtures__/index.tsx +173 -0
  74. package/src/components/agenc-components.css +570 -0
  75. package/src/components/badges.tsx +115 -0
  76. package/src/components/format.ts +150 -0
  77. package/src/components/index.ts +102 -0
  78. package/src/components/primitives.tsx +236 -0
  79. package/src/components/strings.ts +131 -0
  80. package/src/components/useFocusTrap.ts +122 -0
  81. package/src/hooks/index.ts +90 -0
  82. package/src/hooks/internal.ts +70 -0
  83. package/src/hooks/useAgentTrackRecord.ts +166 -0
  84. package/src/hooks/useDispute.ts +130 -0
  85. package/src/hooks/useHire.ts +198 -0
  86. package/src/hooks/useListing.ts +138 -0
  87. package/src/hooks/useListings.ts +133 -0
  88. package/src/hooks/useReferrerEarnings.ts +134 -0
  89. package/src/hooks/useSubmissionReview.ts +179 -0
  90. package/src/hooks/useTaskStatus.ts +192 -0
  91. package/src/hooks/useWalletSigner.ts +99 -0
  92. package/src/index.ts +170 -0
  93. package/src/provider/AgencProvider.tsx +169 -0
  94. package/src/provider/context.ts +35 -0
  95. package/src/provider/index.ts +17 -0
  96. package/src/provider/network.ts +68 -0
  97. package/src/provider/referrer.ts +97 -0
  98. package/src/signers/README.md +130 -0
  99. package/src/signers/embedded-wallet-mock.ts +158 -0
  100. package/src/signers/embedded-wallet.ts +64 -0
  101. package/src/signers/index.ts +48 -0
  102. package/src/signers/strings.ts +39 -0
  103. package/src/signers/types.ts +158 -0
  104. package/src/signers/wallet-account.ts +128 -0
  105. package/src/signers/wallet-adapter.ts +149 -0
  106. package/src/strings/index.ts +119 -0
  107. package/src/testing/index.ts +24 -0
  108. package/src/theme/agenc-tailwind-preset.cjs +184 -0
  109. package/src/theme/agenc-tokens.css +132 -0
  110. package/src/theme/index.ts +94 -0
  111. package/src/transport/index.ts +164 -0
  112. package/src/types.ts +224 -0
@@ -0,0 +1,119 @@
1
+ /**
2
+ * Minimal English string catalog + a `t(id, vars?)` resolver.
3
+ *
4
+ * Every user-facing string in this package and its downstream hooks/components
5
+ * routes through this module so a future `{ locale }` can resolve translations
6
+ * **without an API break** (PLAN_2 Part A design constraint). v1 ships English
7
+ * only; the resolver signature is already locale-shaped.
8
+ *
9
+ * ## Why a catalog and not inline literals
10
+ *
11
+ * Components published to third parties cannot assume the host's language. By
12
+ * keying every literal here:
13
+ * - adding a locale is a data change (a new {@link StringCatalog}), not a code
14
+ * change to every component;
15
+ * - the message ids are a stable contract the components agent binds to;
16
+ * - `{var}` interpolation is centralized and SSR-safe (pure string ops, no
17
+ * `Intl` global assumptions at module scope).
18
+ *
19
+ * @module strings
20
+ */
21
+
22
+ /**
23
+ * The catalog shape: every message id maps to an English template. `{name}`
24
+ * placeholders are filled by {@link t} from the `vars` argument.
25
+ */
26
+ export interface StringCatalog {
27
+ readonly [id: string]: string;
28
+ }
29
+
30
+ /**
31
+ * Default English catalog. Keep ids namespaced by surface
32
+ * (`provider.*`, `referrer.*`, `transport.*`, `hire.*`, ...) so the components
33
+ * agent can extend it without collisions.
34
+ */
35
+ export const EN_STRINGS = {
36
+ // Provider / context wiring errors (developer-facing, but routed for parity).
37
+ "provider.missingContext":
38
+ "useAgencContext must be used within <AgencProvider>.",
39
+ "provider.missingWriteClient":
40
+ "No write client is configured. Pass config.client, or config.rpcUrl + config.signer, to <AgencProvider> before using a mutating hook.",
41
+ "provider.missingSigner":
42
+ "No signer is configured on <AgencProvider>. Connect a wallet or pass config.signer.",
43
+
44
+ // Referrer config validation (the P6.2 gate surface).
45
+ "referrer.invalidWallet":
46
+ "Referrer wallet is not a valid base58 Solana address: {wallet}.",
47
+ "referrer.invalidFeeBps":
48
+ "Referrer feeBps must be an integer between {min} and {max} (basis points); got {feeBps}.",
49
+ "referrer.notLive":
50
+ "This site earns a referral fee (pending protocol support).",
51
+ "referrer.notLiveReason":
52
+ "Referral settlement is not yet deployed on this cluster (PLAN.md P6.2). Referrer config is accepted and validated but not injected into hires.",
53
+
54
+ // Read transport.
55
+ "transport.noReadSource":
56
+ "No read source is configured. Pass an indexer baseUrl, an rpc/queryTransport, to <AgencProvider> or createReadTransport().",
57
+
58
+ // Generic loading / empty / error states (components extend these).
59
+ "state.loading": "Loading…",
60
+ "state.empty": "Nothing to show yet.",
61
+ "state.error": "Something went wrong.",
62
+
63
+ // Hire flow shells (components fill out the rest).
64
+ "hire.cta": "Hire",
65
+ "hire.pending": "Confirming…",
66
+ "hire.funded": "Escrow funded.",
67
+ } as const satisfies StringCatalog;
68
+
69
+ /** A message id present in the default English catalog. */
70
+ export type StringId = keyof typeof EN_STRINGS;
71
+
72
+ /** Interpolation variables for {@link t}: `{name}` → `vars.name`. */
73
+ export type StringVars = Record<string, string | number | bigint>;
74
+
75
+ /**
76
+ * Options for {@link t}. `locale` is accepted today (English-only) so adding
77
+ * real locales later does not break the call signature; `catalog` lets a host
78
+ * inject an override/extension catalog.
79
+ */
80
+ export interface TranslateOptions {
81
+ /** BCP-47 locale tag. v1 resolves everything to English regardless. */
82
+ locale?: string;
83
+ /** Override catalog (e.g. a future locale, or host-supplied copy). */
84
+ catalog?: StringCatalog;
85
+ }
86
+
87
+ /**
88
+ * Resolve a message id to its localized string with `{var}` interpolation.
89
+ *
90
+ * Unknown ids and unmatched placeholders are returned verbatim (the id itself,
91
+ * or the `{placeholder}` left intact) rather than throwing — a missing string
92
+ * must never crash a money-handling UI.
93
+ *
94
+ * @param id - The message id (a {@link StringId}, or any string for host
95
+ * catalogs).
96
+ * @param vars - Values for `{name}` placeholders in the template.
97
+ * @param options - Optional `locale` (forward-compatible) and `catalog`
98
+ * override.
99
+ * @returns The interpolated string.
100
+ *
101
+ * @example
102
+ * ```ts
103
+ * t("referrer.invalidFeeBps", { min: 0, max: 10000, feeBps: 99999 });
104
+ * // -> "Referrer feeBps must be an integer between 0 and 10000 ...; got 99999."
105
+ * ```
106
+ */
107
+ export function t(
108
+ id: StringId | (string & {}),
109
+ vars?: StringVars,
110
+ options?: TranslateOptions,
111
+ ): string {
112
+ const catalog: StringCatalog = options?.catalog ?? EN_STRINGS;
113
+ const template = catalog[id] ?? id;
114
+ if (vars === undefined) return template;
115
+ return template.replace(/\{(\w+)\}/g, (match, key: string) => {
116
+ const value = vars[key];
117
+ return value === undefined ? match : String(value);
118
+ });
119
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * `@tetsuo-ai/marketplace-react/testing` — TEST-ONLY helpers.
3
+ *
4
+ * This subpath isolates helpers that must NEVER ship to production from the
5
+ * package root + `./signers` barrels. Currently it exposes the local-keypair
6
+ * MOCK embedded wallet, which holds a private key IN-PROCESS to stand in for a
7
+ * real vendor (Privy / Dynamic / Web3Auth) during tests and the walletless
8
+ * Done-when. Importing it requires the explicit `/testing` subpath, and it
9
+ * warns once if invoked under `NODE_ENV === "production"`.
10
+ *
11
+ * Do NOT import anything from here in production code. Use
12
+ * {@link signerFromEmbeddedWallet} (from the root or `./signers`) with a real
13
+ * vendor adapter instead.
14
+ *
15
+ * @module testing
16
+ */
17
+
18
+ // Local-keypair MOCK embedded-wallet adapter (the walletless test seam).
19
+ export {
20
+ createMockEmbeddedWallet,
21
+ type MockEmbeddedWalletConnection,
22
+ type MockEmbeddedWalletOptions,
23
+ type MockEmbeddedWalletProvider,
24
+ } from "../signers/embedded-wallet-mock.js";
@@ -0,0 +1,184 @@
1
+ /* ============================================================================
2
+ * VENDORED — do not hand-edit for brand changes; re-sync from source.
3
+ *
4
+ * Source repo: agenc-ui-design-skill (sibling repo, NOT importable in CI)
5
+ * Source path: tokens/tailwind.config.cjs
6
+ * Source commit: c842bba8eb9e8d029a13fbfd111686f831cd566f (2026-04-29)
7
+ * Vendored into: packages/marketplace-react/src/theme/agenc-tailwind-preset.cjs
8
+ * Reason: cross-repo imports are impossible in CI; consumers read the
9
+ * AgenC Tailwind preset FROM this package via
10
+ * "@tetsuo-ai/marketplace-react/tailwind-preset".
11
+ * Resync: copy tokens/tailwind.config.cjs from agenc-ui-design-skill
12
+ * HEAD and update the commit line above.
13
+ * ============================================================================
14
+ */
15
+
16
+ /**
17
+ * Tetsuo.ai / AgenC Tailwind config fragment.
18
+ *
19
+ * Drop-in extension for an existing Tailwind v3+ project (works alongside
20
+ * shadcn/ui's default config). Colors are sRGB hex.
21
+ *
22
+ * Usage in your tailwind.config.{js,cjs,ts}:
23
+ *
24
+ * const tetsuo = require('./path/to/tokens/tailwind.config.cjs');
25
+ * module.exports = {
26
+ * content: [...],
27
+ * theme: {
28
+ * extend: {
29
+ * ...tetsuo.theme.extend,
30
+ * },
31
+ * },
32
+ * plugins: [tetsuo.plugin],
33
+ * };
34
+ */
35
+
36
+ const plugin = require('tailwindcss/plugin');
37
+
38
+ const colors = {
39
+ // AgenC neon (canonical product palette)
40
+ agenc: {
41
+ void: '#0A0612',
42
+ surface: '#16102A',
43
+ 'surface-2': '#221638',
44
+ 'surface-3': '#2E1A4A',
45
+ violet: '#7B3FFF',
46
+ magenta: '#FF2E93',
47
+ orange: '#FF6B1A',
48
+ cyan: '#48C8EF',
49
+ grid: '#3A1F66',
50
+ text: '#F5F0FF',
51
+ 'text-muted': '#B8A8D9',
52
+ 'text-dim': '#6E5C8F',
53
+ success: '#3FFFA0',
54
+ warning: '#FFC53F',
55
+ danger: '#FF3D3D',
56
+ border: '#2E1A4A',
57
+ 'border-strong': '#4A2E7A',
58
+ },
59
+ // Tetsuo.ai noir (marketing / community)
60
+ tetsuo: {
61
+ noir: '#0A0A0A',
62
+ 'noir-2': '#141414',
63
+ paper: '#F8F5E9',
64
+ 'akira-red': '#E30426',
65
+ 'akira-red-bright': '#FA1232',
66
+ blood: '#7A0000',
67
+ cyan: '#48C8EF',
68
+ magenta: '#D01D7D',
69
+ 'synth-pink': '#EF5EC2',
70
+ 'synth-pink-soft': '#F3A8CE',
71
+ 'synth-purple': '#7B3FFF',
72
+ 'synth-eggplant': '#441535',
73
+ },
74
+ };
75
+
76
+ const backgroundImage = {
77
+ 'agenc-gradient': 'linear-gradient(135deg, #7B3FFF 0%, #FF2E93 60%, #FF6B1A 100%)',
78
+ 'agenc-gradient-cool': 'linear-gradient(135deg, #48C8EF 0%, #7B3FFF 100%)',
79
+ 'agenc-gradient-text': 'linear-gradient(90deg, #7B3FFF 0%, #FF2E93 50%, #FF6B1A 100%)',
80
+ 'tetsuo-gradient-glitch': 'linear-gradient(90deg, #48C8EF 0%, #D01D7D 100%)',
81
+ 'tetsuo-gradient-synth':
82
+ 'linear-gradient(135deg, #441535 0%, #D01D7D 50%, #EF5EC2 100%)',
83
+ // Synthwave grid floor — pair with a perspective transform on a child
84
+ 'agenc-grid-floor':
85
+ 'linear-gradient(transparent 95%, #3A1F66 95%), linear-gradient(90deg, transparent 95%, #3A1F66 95%)',
86
+ };
87
+
88
+ const boxShadow = {
89
+ 'glow-violet': '0 0 24px rgba(123, 63, 255, 0.4), 0 0 48px rgba(123, 63, 255, 0.2)',
90
+ 'glow-magenta': '0 0 24px rgba(255, 46, 147, 0.4), 0 0 48px rgba(255, 46, 147, 0.2)',
91
+ 'glow-cyan': '0 0 24px rgba(72, 200, 239, 0.4), 0 0 48px rgba(72, 200, 239, 0.2)',
92
+ 'glow-orange': '0 0 24px rgba(255, 107, 26, 0.4), 0 0 48px rgba(255, 107, 26, 0.2)',
93
+ 'glow-akira': '0 0 24px rgba(227, 4, 38, 0.5), 0 0 64px rgba(227, 4, 38, 0.25)',
94
+ };
95
+
96
+ const fontFamily = {
97
+ // Display: jagged / glitch / cyberpunk. Pick one and load via @font-face.
98
+ 'agenc-display': ['"Audiowide"', '"Major Mono Display"', 'system-ui', 'sans-serif'],
99
+ // Body: clean geometric sans
100
+ 'agenc-body': ['"Geist"', '"Inter"', 'system-ui', 'sans-serif'],
101
+ // Mono: for HUD / status / readouts
102
+ 'agenc-mono': ['"JetBrains Mono"', '"IBM Plex Mono"', 'ui-monospace', 'monospace'],
103
+ };
104
+
105
+ const fontSize = {
106
+ // Display scale skews dramatic — these are AgenC-specific overrides.
107
+ 'display-xs': ['2rem', { lineHeight: '1.05', letterSpacing: '-0.02em' }],
108
+ 'display-sm': ['2.5rem', { lineHeight: '1.05', letterSpacing: '-0.02em' }],
109
+ 'display-md': ['3.5rem', { lineHeight: '1.0', letterSpacing: '-0.03em' }],
110
+ 'display-lg': ['5rem', { lineHeight: '0.95', letterSpacing: '-0.04em' }],
111
+ 'display-xl': ['7rem', { lineHeight: '0.9', letterSpacing: '-0.04em' }],
112
+ };
113
+
114
+ // Plugin: utilities that aren't trivially expressible as theme extensions.
115
+ const tetsuoPlugin = plugin(function ({ addUtilities, addComponents }) {
116
+ addUtilities({
117
+ // Chromatic aberration glitch text — drop on any text element.
118
+ '.text-glitch': {
119
+ position: 'relative',
120
+ color: '#F8F5E9',
121
+ textShadow: '2px 0 0 #48C8EF, -2px 0 0 #D01D7D',
122
+ },
123
+ '.text-glitch-strong': {
124
+ position: 'relative',
125
+ color: '#F8F5E9',
126
+ textShadow: '3px 0 0 #48C8EF, -3px 0 0 #D01D7D, 0 0 8px rgba(255,255,255,0.15)',
127
+ },
128
+ // Neon-stroked outline text
129
+ '.text-neon-stroke': {
130
+ color: 'transparent',
131
+ WebkitTextStroke: '1.5px #FF2E93',
132
+ textShadow: '0 0 12px rgba(255, 46, 147, 0.6)',
133
+ },
134
+ // Scanline overlay — apply to a positioned container.
135
+ '.bg-scanlines': {
136
+ backgroundImage:
137
+ 'repeating-linear-gradient(0deg, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px, rgba(0,0,0,0.18) 2px, rgba(0,0,0,0.18) 3px)',
138
+ },
139
+ // CRT vignette
140
+ '.bg-vignette': {
141
+ backgroundImage:
142
+ 'radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.55) 100%)',
143
+ },
144
+ });
145
+
146
+ addComponents({
147
+ // HUD frame: corner brackets only, transparent middle.
148
+ '.hud-frame': {
149
+ position: 'relative',
150
+ padding: '24px',
151
+ '&::before, &::after': {
152
+ content: '""',
153
+ position: 'absolute',
154
+ width: '24px',
155
+ height: '24px',
156
+ borderColor: '#7B3FFF',
157
+ borderStyle: 'solid',
158
+ },
159
+ '&::before': {
160
+ top: '0',
161
+ left: '0',
162
+ borderWidth: '2px 0 0 2px',
163
+ },
164
+ '&::after': {
165
+ bottom: '0',
166
+ right: '0',
167
+ borderWidth: '0 2px 2px 0',
168
+ },
169
+ },
170
+ });
171
+ });
172
+
173
+ module.exports = {
174
+ theme: {
175
+ extend: {
176
+ colors,
177
+ backgroundImage,
178
+ boxShadow,
179
+ fontFamily,
180
+ fontSize,
181
+ },
182
+ },
183
+ plugin: tetsuoPlugin,
184
+ };
@@ -0,0 +1,132 @@
1
+ /* ============================================================================
2
+ * VENDORED — do not hand-edit for brand changes; re-sync from source.
3
+ *
4
+ * Source repo: agenc-ui-design-skill (sibling repo, NOT importable in CI)
5
+ * Source path: tokens/colors.css
6
+ * Source commit: c842bba8eb9e8d029a13fbfd111686f831cd566f (2026-04-29)
7
+ * Vendored into: packages/marketplace-react/src/theme/agenc-tokens.css
8
+ * Reason: cross-repo imports are impossible in CI; store-core and every
9
+ * downstream consumer reads the AgenC theme FROM this package,
10
+ * never from the design-skill repo directly.
11
+ * Resync: copy tokens/colors.css from agenc-ui-design-skill HEAD and
12
+ * update the commit line above.
13
+ * ============================================================================
14
+ */
15
+
16
+ /* Tetsuo.ai / AgenC color tokens.
17
+ *
18
+ * All values are 8-bit sRGB hex. Sampled from official brand assets
19
+ * (mood-board/) where possible; the AgenC neon palette is derived from the
20
+ * AgenC "prompt cache > giant agent bills" infographic.
21
+ *
22
+ * Two modes:
23
+ * - .agenc → AgenC framework UI (canonical for product surfaces)
24
+ * - .tetsuo-noir → Tetsuo.ai marketing/community surfaces (Akira homage)
25
+ *
26
+ * Default :root applies the AgenC neon mode. Add `class="tetsuo-noir"` to a
27
+ * surface root to switch into the noir palette.
28
+ */
29
+
30
+ :root,
31
+ .agenc {
32
+ /* Surfaces */
33
+ --agenc-void: #0A0612; /* deepest layer, page background */
34
+ --agenc-surface: #16102A; /* card / panel */
35
+ --agenc-surface-2: #221638; /* raised surface, modal */
36
+ --agenc-surface-3: #2E1A4A; /* hover / elevated */
37
+
38
+ /* Brand accents */
39
+ --agenc-violet: #7B3FFF; /* primary brand purple */
40
+ --agenc-magenta: #FF2E93; /* secondary accent */
41
+ --agenc-orange: #FF6B1A; /* highlight only */
42
+ --agenc-cyan: #48C8EF; /* HUD / readout accent */
43
+ --agenc-grid: #3A1F66; /* circuit lines, grid floor */
44
+
45
+ /* Text */
46
+ --agenc-text: #F5F0FF; /* primary on dark */
47
+ --agenc-text-muted: #B8A8D9; /* secondary on dark */
48
+ --agenc-text-dim: #6E5C8F; /* tertiary / disabled */
49
+
50
+ /* Semantic */
51
+ --agenc-success: #3FFFA0;
52
+ --agenc-warning: #FFC53F;
53
+ --agenc-danger: #FF3D3D;
54
+
55
+ /* Gradients */
56
+ --agenc-gradient-primary:
57
+ linear-gradient(135deg, #7B3FFF 0%, #FF2E93 60%, #FF6B1A 100%);
58
+ --agenc-gradient-cool:
59
+ linear-gradient(135deg, #48C8EF 0%, #7B3FFF 100%);
60
+ --agenc-gradient-text:
61
+ linear-gradient(90deg, #7B3FFF 0%, #FF2E93 50%, #FF6B1A 100%);
62
+
63
+ /* Glows (use as box-shadow / filter drop-shadow) */
64
+ --agenc-glow-violet: 0 0 24px #7B3FFF66, 0 0 48px #7B3FFF33;
65
+ --agenc-glow-magenta: 0 0 24px #FF2E9366, 0 0 48px #FF2E9333;
66
+ --agenc-glow-cyan: 0 0 24px #48C8EF66, 0 0 48px #48C8EF33;
67
+
68
+ /* Strokes */
69
+ --agenc-border: #2E1A4A;
70
+ --agenc-border-strong: #4A2E7A;
71
+
72
+ /* Radii (pixel-honest, not over-rounded) */
73
+ --agenc-radius-sm: 4px;
74
+ --agenc-radius: 8px;
75
+ --agenc-radius-lg: 12px;
76
+ --agenc-radius-pill: 9999px;
77
+
78
+ /* Spacing (4px base) */
79
+ --agenc-space-1: 4px;
80
+ --agenc-space-2: 8px;
81
+ --agenc-space-3: 12px;
82
+ --agenc-space-4: 16px;
83
+ --agenc-space-6: 24px;
84
+ --agenc-space-8: 32px;
85
+ --agenc-space-12: 48px;
86
+ --agenc-space-16: 64px;
87
+ }
88
+
89
+ .tetsuo-noir {
90
+ /* Tetsuo.ai marketing/community palette. Akira homage + manga off-white. */
91
+
92
+ /* Surfaces */
93
+ --tetsuo-noir: #0A0A0A; /* true black background */
94
+ --tetsuo-noir-2: #141414; /* card */
95
+ --tetsuo-paper: #F8F5E9; /* manga off-white (sampled from circle logo) */
96
+
97
+ /* Reds (Akira) */
98
+ --tetsuo-akira-red: #E30426; /* primary red — sampled from banner */
99
+ --tetsuo-akira-red-bright: #FA1232;
100
+ --tetsuo-blood: #7A0000; /* deep red shadow (sampled from malware art) */
101
+
102
+ /* TETSUO.AI logo + $TETSUO synthwave */
103
+ --tetsuo-cyan: #48C8EF; /* sampled from logo */
104
+ --tetsuo-magenta: #D01D7D; /* sampled drop shadow */
105
+ --tetsuo-synth-pink: #EF5EC2; /* sampled from $TETSUO Solana banner */
106
+ --tetsuo-synth-pink-soft: #F3A8CE;
107
+ --tetsuo-synth-purple: #7B3FFF; /* matches AgenC violet — brand-consistent */
108
+ --tetsuo-synth-eggplant: #441535;
109
+
110
+ /* Text */
111
+ --tetsuo-text: #F8F5E9; /* paper on noir */
112
+ --tetsuo-text-muted: #C8BFAA;
113
+ --tetsuo-text-on-paper: #0A0A0A;
114
+
115
+ /* Glitch (chromatic aberration: use cyan + magenta offsets) */
116
+ --tetsuo-glitch-cyan: #48C8EF;
117
+ --tetsuo-glitch-magenta: #D01D7D;
118
+ }
119
+
120
+ /* Convenience: when a surface is the noir mode, redefine the AgenC tokens to
121
+ * the noir equivalents so component recipes that target --agenc-* still work
122
+ * without rewriting. Use sparingly — most marketing pages should stay on
123
+ * .tetsuo-noir directly. */
124
+ .tetsuo-noir.bridge-tokens {
125
+ --agenc-void: var(--tetsuo-noir);
126
+ --agenc-surface: var(--tetsuo-noir-2);
127
+ --agenc-text: var(--tetsuo-text);
128
+ --agenc-text-muted: var(--tetsuo-text-muted);
129
+ --agenc-violet: var(--tetsuo-synth-purple);
130
+ --agenc-magenta: var(--tetsuo-magenta);
131
+ --agenc-cyan: var(--tetsuo-cyan);
132
+ }
@@ -0,0 +1,94 @@
1
+ /**
2
+ * AgenC theme — the `--agenc-*` CSS custom-property contract.
3
+ *
4
+ * ## How theming works (no CSS-in-JS runtime)
5
+ *
6
+ * Every prebuilt component (shipped by the components agent) styles itself
7
+ * **only** through CSS custom properties named `--agenc-*` (e.g.
8
+ * `--agenc-violet`, `--agenc-surface`, `--agenc-radius`). They are declared in
9
+ * the vendored {@link AGENC_TOKENS_CSS_PATH} stylesheet under `:root, .agenc`.
10
+ * To restyle, override any of those variables on an ancestor element — no
11
+ * recompile, no Tailwind, no JS.
12
+ *
13
+ * ## Three ways to load the tokens
14
+ *
15
+ * 1. **Side-effect CSS import** (recommended for bundler apps):
16
+ * ```ts
17
+ * import "@tetsuo-ai/marketplace-react/theme.css";
18
+ * ```
19
+ * Pulls in the full vendored token sheet as a side effect. This is the only
20
+ * CSS this package ships, and it is fully optional: headless hook usage
21
+ * needs no CSS at all.
22
+ *
23
+ * 2. **`<link>` / framework asset pipeline:** point at the resolved package
24
+ * path `@tetsuo-ai/marketplace-react/theme.css`.
25
+ *
26
+ * 3. **Inline injection** via {@link agencThemeStyleTag} — returns the token
27
+ * CSS as a string you can drop into a `<style>` tag (handy for the embed
28
+ * widget / iframe where a separate stylesheet request is undesirable).
29
+ * NOTE: this returns only the small base token set, not the full vendored
30
+ * sheet; prefer (1) or (2) for the canonical theme.
31
+ *
32
+ * ## The `unstyled` escape hatch (white-label)
33
+ *
34
+ * Per PLAN_2 A3, every prebuilt component accepts an `unstyled` prop. When set,
35
+ * the component renders semantic markup and ARIA wiring but emits **none** of
36
+ * the default `--agenc-*`-driven classes, so a host app can style it from
37
+ * scratch. This module owns the convention so components stay consistent:
38
+ * - the default class root is {@link AGENC_THEME_CLASS} (`"agenc"`), the scope
39
+ * under which `--agenc-*` tokens are defined;
40
+ * - {@link resolveThemeClassName} returns `undefined` when `unstyled` is true,
41
+ * so a component can spread it onto its root without branching.
42
+ *
43
+ * @module theme
44
+ */
45
+
46
+ /**
47
+ * The root class scope under which the vendored sheet declares `--agenc-*`
48
+ * tokens (`:root, .agenc`). Components default their outermost element to this
49
+ * class so the tokens resolve even when the sheet is scoped rather than global.
50
+ */
51
+ export const AGENC_THEME_CLASS = "agenc";
52
+
53
+ /**
54
+ * Package-relative specifier for the vendored token stylesheet, exposed for
55
+ * documentation/tooling. Import it for its side effect via the package's
56
+ * `./theme.css` export: `import "@tetsuo-ai/marketplace-react/theme.css"`.
57
+ */
58
+ export const AGENC_TOKENS_CSS_PATH = "@tetsuo-ai/marketplace-react/theme.css";
59
+
60
+ /**
61
+ * Resolve the class name a themable component should put on its root element.
62
+ *
63
+ * @param unstyled - When true (white-label mode), returns `undefined` so the
64
+ * component emits no default theme class.
65
+ * @param extra - An optional caller-supplied `className` to append.
66
+ * @returns The composed class string, or `undefined` when there is nothing to
67
+ * apply.
68
+ */
69
+ export function resolveThemeClassName(
70
+ unstyled?: boolean,
71
+ extra?: string,
72
+ ): string | undefined {
73
+ if (unstyled) {
74
+ return extra && extra.trim() !== "" ? extra : undefined;
75
+ }
76
+ const composed = [AGENC_THEME_CLASS, extra]
77
+ .filter((part): part is string => Boolean(part && part.trim() !== ""))
78
+ .join(" ");
79
+ return composed === "" ? undefined : composed;
80
+ }
81
+
82
+ /**
83
+ * The minimal base `--agenc-*` token set as inline CSS text, for the embed /
84
+ * iframe surface where a separate stylesheet request is undesirable. This is a
85
+ * SUBSET of the full vendored sheet (the most load-bearing surface, brand,
86
+ * text, semantic, and radius tokens) — for the canonical, complete theme
87
+ * import `@tetsuo-ai/marketplace-react/theme.css` instead.
88
+ *
89
+ * SSR-safe: returns a string and never touches `document`. The caller decides
90
+ * how to inject it (a `<style>` element, a `dangerouslySetInnerHTML`, etc.).
91
+ */
92
+ export function agencThemeStyleTag(): string {
93
+ return `:root,.${AGENC_THEME_CLASS}{--agenc-void:#0A0612;--agenc-surface:#16102A;--agenc-surface-2:#221638;--agenc-surface-3:#2E1A4A;--agenc-violet:#7B3FFF;--agenc-magenta:#FF2E93;--agenc-orange:#FF6B1A;--agenc-cyan:#48C8EF;--agenc-text:#F5F0FF;--agenc-text-muted:#B8A8D9;--agenc-text-dim:#6E5C8F;--agenc-success:#3FFFA0;--agenc-warning:#FFC53F;--agenc-danger:#FF3D3D;--agenc-border:#2E1A4A;--agenc-border-strong:#4A2E7A;--agenc-radius-sm:4px;--agenc-radius:8px;--agenc-radius-lg:12px;--agenc-radius-pill:9999px;}`;
94
+ }