@nebutra/tokens 0.1.2 → 0.1.3
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/brands/gsap/brand.json +17 -64
- package/brands/linear/brand.json +18 -57
- package/brands/notion/brand.json +18 -62
- package/brands/raycast/brand.json +17 -64
- package/brands/stripe/brand.json +16 -72
- package/brands/vanta/brand.json +16 -63
- package/brands/vercel/brand.json +16 -50
- package/dist/brand-package/index.d.ts +123 -0
- package/dist/brand-package/index.js +61 -0
- package/dist/brand-package/index.js.map +1 -0
- package/dist/brand-package/use-brand.d.ts +2 -0
- package/dist/brand-package/use-brand.js +12 -0
- package/dist/brand-package/use-brand.js.map +1 -0
- package/dist/chunk-ALJTP5HL.js +881 -0
- package/dist/chunk-ALJTP5HL.js.map +1 -0
- package/dist/chunk-RGUJQOLH.js +1582 -0
- package/dist/chunk-RGUJQOLH.js.map +1 -0
- package/dist/index.d.ts +81 -0
- package/dist/index.js +187 -0
- package/dist/index.js.map +1 -0
- package/dist/use-brand-C8d4DPqE.d.ts +371 -0
- package/package.json +34 -9
- package/recipe.css +322 -1
- package/skins/README.md +2 -4
- package/skins/gsap.css +31 -119
- package/skins/linear.css +33 -117
- package/skins/notion.css +27 -117
- package/skins/raycast.css +32 -119
- package/skins/stripe.css +27 -129
- package/skins/vanta.css +27 -122
- package/skins/vercel.css +30 -111
- package/styles.css +388 -113
- package/.turbo/turbo-build.log +0 -8
- package/.turbo/turbo-typecheck.log +0 -4
- package/AGENTS.md +0 -45
- package/DESIGN.md +0 -357
- package/scripts/compile-brand-run.ts +0 -79
- package/scripts/compile-brand.mjs +0 -25
- package/scripts/emit-skins-run.ts +0 -62
- package/scripts/emit-skins.mjs +0 -31
- package/scripts/sync-styles.mjs +0 -29
- package/src/brand-package/__tests__/compile-refero.test.ts +0 -427
- package/src/brand-package/__tests__/emit-css.test.ts +0 -130
- package/src/brand-package/apply-brand.ts +0 -92
- package/src/brand-package/compile-helpers.ts +0 -170
- package/src/brand-package/compile-refero.ts +0 -69
- package/src/brand-package/emit-css.ts +0 -468
- package/src/brand-package/hex-to-hsl.ts +0 -100
- package/src/brand-package/index.ts +0 -71
- package/src/brand-package/infer-recipe.ts +0 -198
- package/src/brand-package/normalize.ts +0 -295
- package/src/brand-package/presets/context.ts +0 -17
- package/src/brand-package/presets/generic.ts +0 -214
- package/src/brand-package/presets/gsap.ts +0 -146
- package/src/brand-package/presets/index.ts +0 -31
- package/src/brand-package/presets/linear.ts +0 -183
- package/src/brand-package/presets/notion.ts +0 -208
- package/src/brand-package/presets/raycast.ts +0 -138
- package/src/brand-package/presets/recipe.ts +0 -61
- package/src/brand-package/presets/stripe.ts +0 -207
- package/src/brand-package/presets/vanta.ts +0 -220
- package/src/brand-package/presets/vercel.ts +0 -187
- package/src/brand-package/types.ts +0 -285
- package/src/brand-package/use-brand.ts +0 -207
- package/src/brand-package/validate.ts +0 -108
- package/src/index.ts +0 -67
- package/src/theme-provider.tsx +0 -246
- package/tsconfig.json +0 -11
- package/turbo.json +0 -15
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Brand Package — Create Center carrier contract.
|
|
5
|
+
*
|
|
6
|
+
* This is a *host* for third-party design languages (Linear, GSAP, Raycast, Vercel…),
|
|
7
|
+
* not a list of brand presets. Presets only demonstrate the contract.
|
|
8
|
+
*
|
|
9
|
+
* Layers:
|
|
10
|
+
* 1. roles — color meaning (action vs brand-mark vs surface…)
|
|
11
|
+
* 2. recipe — control language (button/badge fill, radii slots, free elev CSS)
|
|
12
|
+
* 3. typography / fonts
|
|
13
|
+
* 4. semantic — shadcn/Tailwind bridge (derived from roles; components keep using --primary)
|
|
14
|
+
*
|
|
15
|
+
* @see packages/design/ARCHITECTURE.md
|
|
16
|
+
*/
|
|
17
|
+
/** HSL channel triple without `hsl()` wrapper, e.g. "66 89% 54%" */
|
|
18
|
+
type HslChannels = string;
|
|
19
|
+
/** Full CSS color (hex / rgb / hsl / oklch / gradient) */
|
|
20
|
+
type CssColor = string;
|
|
21
|
+
type ButtonDefaultStyle = "solid" | "outline" | "gradient-stroke";
|
|
22
|
+
/**
|
|
23
|
+
* Elevation *presets* are only shortcuts that expand to free CSS box-shadow tokens.
|
|
24
|
+
* Carriers should prefer `recipe.elevationTokens` with arbitrary shadow stacks.
|
|
25
|
+
*/
|
|
26
|
+
type ElevationStyle = "none" | "soft" | "raised" | "key" | "hairline";
|
|
27
|
+
type Density = "compact" | "comfortable" | "spacious";
|
|
28
|
+
/** Badge fill language (may diverge from action CTA) */
|
|
29
|
+
type BadgeDefaultStyle = "match-action" | "match-primary" | "muted" | "outline" | "brand";
|
|
30
|
+
/**
|
|
31
|
+
* First-class color roles — what Create Center fills.
|
|
32
|
+
* Maps onto CSS vars and into shadcn semantic for component compatibility.
|
|
33
|
+
*/
|
|
34
|
+
interface BrandColorRoles {
|
|
35
|
+
/** Page canvas */
|
|
36
|
+
canvas: HslChannels;
|
|
37
|
+
canvasForeground: HslChannels;
|
|
38
|
+
/** Contained surfaces (cards, panels) */
|
|
39
|
+
surface: HslChannels;
|
|
40
|
+
surfaceForeground: HslChannels;
|
|
41
|
+
/**
|
|
42
|
+
* Product *action* fill (default Button / primary chrome).
|
|
43
|
+
* Must be readable as a CTA — not necessarily the brand mark color.
|
|
44
|
+
*/
|
|
45
|
+
action: HslChannels;
|
|
46
|
+
actionForeground: HslChannels;
|
|
47
|
+
/**
|
|
48
|
+
* Brand mark only (logo accent, AI diamond, VI-adjacent product accent).
|
|
49
|
+
* NEVER used for default form CTAs unless Create Center explicitly maps action ← brand.
|
|
50
|
+
*/
|
|
51
|
+
brand?: HslChannels;
|
|
52
|
+
brandForeground?: HslChannels;
|
|
53
|
+
/** Quiet fills (secondary, badges muted) */
|
|
54
|
+
quiet: HslChannels;
|
|
55
|
+
quietForeground: HslChannels;
|
|
56
|
+
muted: HslChannels;
|
|
57
|
+
mutedForeground: HslChannels;
|
|
58
|
+
border: HslChannels;
|
|
59
|
+
input: HslChannels;
|
|
60
|
+
ring: HslChannels;
|
|
61
|
+
destructive: HslChannels;
|
|
62
|
+
destructiveForeground: HslChannels;
|
|
63
|
+
success?: HslChannels;
|
|
64
|
+
successForeground?: HslChannels;
|
|
65
|
+
warning?: HslChannels;
|
|
66
|
+
warningForeground?: HslChannels;
|
|
67
|
+
info?: HslChannels;
|
|
68
|
+
infoForeground?: HslChannels;
|
|
69
|
+
}
|
|
70
|
+
/** Shape slots — components bind per role, not one global radius */
|
|
71
|
+
interface BrandRadii {
|
|
72
|
+
button: string;
|
|
73
|
+
card: string;
|
|
74
|
+
badge?: string;
|
|
75
|
+
input?: string;
|
|
76
|
+
pill?: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Free-form elevation — any CSS box-shadow string the brand requires.
|
|
80
|
+
* Components only read --elevation-card / control / raised.
|
|
81
|
+
*/
|
|
82
|
+
interface BrandElevationTokens {
|
|
83
|
+
card: string;
|
|
84
|
+
control?: string;
|
|
85
|
+
raised?: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* shadcn/Tailwind bridge. Prefer editing `roles`; semantic is kept in sync by normalize().
|
|
89
|
+
* Components continue to use bg-primary etc. which map to action.
|
|
90
|
+
*/
|
|
91
|
+
interface BrandSemanticColors {
|
|
92
|
+
background: HslChannels;
|
|
93
|
+
foreground: HslChannels;
|
|
94
|
+
card: HslChannels;
|
|
95
|
+
cardForeground: HslChannels;
|
|
96
|
+
popover: HslChannels;
|
|
97
|
+
popoverForeground: HslChannels;
|
|
98
|
+
/** = roles.action (product CTA) */
|
|
99
|
+
primary: HslChannels;
|
|
100
|
+
primaryForeground: HslChannels;
|
|
101
|
+
secondary: HslChannels;
|
|
102
|
+
secondaryForeground: HslChannels;
|
|
103
|
+
muted: HslChannels;
|
|
104
|
+
mutedForeground: HslChannels;
|
|
105
|
+
accent: HslChannels;
|
|
106
|
+
accentForeground: HslChannels;
|
|
107
|
+
destructive: HslChannels;
|
|
108
|
+
destructiveForeground: HslChannels;
|
|
109
|
+
border: HslChannels;
|
|
110
|
+
input: HslChannels;
|
|
111
|
+
ring: HslChannels;
|
|
112
|
+
success?: HslChannels;
|
|
113
|
+
successForeground?: HslChannels;
|
|
114
|
+
warning?: HslChannels;
|
|
115
|
+
warningForeground?: HslChannels;
|
|
116
|
+
info?: HslChannels;
|
|
117
|
+
infoForeground?: HslChannels;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Canonical product-chrome recipe (post-normalize).
|
|
121
|
+
* Free radii + free elevation tokens only — no buttonRadius/elevation aliases.
|
|
122
|
+
*/
|
|
123
|
+
interface BrandRecipe {
|
|
124
|
+
buttonDefault: ButtonDefaultStyle;
|
|
125
|
+
density: Density;
|
|
126
|
+
radii: BrandRadii;
|
|
127
|
+
elevationTokens: BrandElevationTokens;
|
|
128
|
+
primaryStrokeGradient?: string;
|
|
129
|
+
outlineBorder?: CssColor;
|
|
130
|
+
badgeDefault?: BadgeDefaultStyle;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Loose recipe accepted by normalize/compile before canonicalization.
|
|
134
|
+
* Legacy keys (buttonRadius, elevation preset, cardShadow) are input-only.
|
|
135
|
+
*/
|
|
136
|
+
type BrandRecipeInput = {
|
|
137
|
+
buttonDefault: ButtonDefaultStyle;
|
|
138
|
+
density?: Density;
|
|
139
|
+
radii?: BrandRadii;
|
|
140
|
+
elevationTokens?: BrandElevationTokens;
|
|
141
|
+
/** @deprecated input-only — expanded to elevationTokens */
|
|
142
|
+
elevation?: ElevationStyle;
|
|
143
|
+
primaryStrokeGradient?: string;
|
|
144
|
+
outlineBorder?: CssColor;
|
|
145
|
+
badgeDefault?: BadgeDefaultStyle;
|
|
146
|
+
/** @deprecated input-only — use radii.button */
|
|
147
|
+
buttonRadius?: string;
|
|
148
|
+
/** @deprecated input-only — use radii.card */
|
|
149
|
+
cardRadius?: string;
|
|
150
|
+
/** @deprecated input-only — use radii.badge */
|
|
151
|
+
badgeRadius?: string;
|
|
152
|
+
/** @deprecated input-only — use radii.input */
|
|
153
|
+
inputRadius?: string;
|
|
154
|
+
/** @deprecated input-only — use elevationTokens.card */
|
|
155
|
+
cardShadow?: string;
|
|
156
|
+
};
|
|
157
|
+
interface BrandFontSource {
|
|
158
|
+
url: string;
|
|
159
|
+
format?: "woff2" | "woff" | "truetype" | "opentype" | "svg";
|
|
160
|
+
}
|
|
161
|
+
interface BrandFontFace {
|
|
162
|
+
family: string;
|
|
163
|
+
src: BrandFontSource[];
|
|
164
|
+
weight?: number | string;
|
|
165
|
+
style?: "normal" | "italic" | "oblique";
|
|
166
|
+
display?: "auto" | "block" | "swap" | "fallback" | "optional";
|
|
167
|
+
unicodeRange?: string;
|
|
168
|
+
}
|
|
169
|
+
interface BrandTypography {
|
|
170
|
+
fontSans: string;
|
|
171
|
+
fontMono?: string;
|
|
172
|
+
fontDisplay?: string;
|
|
173
|
+
headingWeight?: number | string;
|
|
174
|
+
faces?: BrandFontFace[];
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* How a design language moves.
|
|
178
|
+
*
|
|
179
|
+
* Motion is a dimension of a language, not a constant: Linear resolves almost
|
|
180
|
+
* before you notice, Notion settles, GSAP performs. Until this existed the
|
|
181
|
+
* durations and curves were declared once in the shared token sheet and no skin
|
|
182
|
+
* could override them, so switching brand changed every colour, radius, face and
|
|
183
|
+
* type scale on the page — and left the timing identical.
|
|
184
|
+
*
|
|
185
|
+
* Durations are milliseconds and carry the same four names the token sheet
|
|
186
|
+
* already ships, so a component written against `--duration-flow` picks up the
|
|
187
|
+
* language it is under without changing.
|
|
188
|
+
*/
|
|
189
|
+
interface BrandMotion {
|
|
190
|
+
/** Entering — decelerates into place. */
|
|
191
|
+
easeOut?: string;
|
|
192
|
+
/** Moving between two on-screen states. */
|
|
193
|
+
easeInOut?: string;
|
|
194
|
+
/** Overshoots and settles. Omit for languages that never overshoot. */
|
|
195
|
+
easeSpring?: string;
|
|
196
|
+
/** State flips the eye should not have to wait for: hover, press, check. */
|
|
197
|
+
micro?: number;
|
|
198
|
+
/** Something moving across the surface: a drawer, a tab indicator. */
|
|
199
|
+
flow?: number;
|
|
200
|
+
/** Something arriving that was not there: a panel, a toast. */
|
|
201
|
+
reveal?: number;
|
|
202
|
+
/** Deliberately slow, for a single focal moment. Never for chrome. */
|
|
203
|
+
cinematic?: number;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* How much room a language leaves around its content.
|
|
207
|
+
*
|
|
208
|
+
* Spacing is a dimension of a language the same way motion is: Linear and
|
|
209
|
+
* Raycast sit close to the content they chrome, Notion and Vanta give it room
|
|
210
|
+
* to breathe. Before this existed, Tailwind's numeric scale (`p-4`, `gap-2`)
|
|
211
|
+
* was the only spacing vocabulary in the repo, and it is a fixed arithmetic
|
|
212
|
+
* multiplier (`--spacing: 0.25rem`) shared by width, height and line-height —
|
|
213
|
+
* repointing it per brand would rescale icons and text along with padding.
|
|
214
|
+
*
|
|
215
|
+
* This is a second, narrower, opt-in scale emitted as `--space-source-*`.
|
|
216
|
+
* Components read those vars directly. Never bridge them into `@theme` as
|
|
217
|
+
* `--spacing-sm` / `--spacing-md` / etc.: Tailwind v4 treats those keys as
|
|
218
|
+
* size tokens, which hijacks `max-w-sm` through `max-w-2xl`.
|
|
219
|
+
*
|
|
220
|
+
* Values are full CSS lengths (e.g. `"1rem"`), not multiples. Only the keys a
|
|
221
|
+
* language declares are emitted; an omitted step inherits the shared default
|
|
222
|
+
* rather than being reset to it.
|
|
223
|
+
*/
|
|
224
|
+
interface BrandSpacing {
|
|
225
|
+
xs?: string;
|
|
226
|
+
sm?: string;
|
|
227
|
+
md?: string;
|
|
228
|
+
lg?: string;
|
|
229
|
+
xl?: string;
|
|
230
|
+
"2xl"?: string;
|
|
231
|
+
}
|
|
232
|
+
interface BrandExtensions {
|
|
233
|
+
/** Taxonomy / category accents (GSAP disciplines, etc.) — product chrome may ignore */
|
|
234
|
+
categories?: Record<string, CssColor>;
|
|
235
|
+
/** Marketing-only decorative gradients (spectrum, hero floor) — never product CTA */
|
|
236
|
+
decorative?: Record<string, string>;
|
|
237
|
+
displaySizePx?: number;
|
|
238
|
+
sourceUrl?: string;
|
|
239
|
+
notes?: string[];
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* One appearance mode’s colors (light or dark).
|
|
243
|
+
* Prefer roles; semantic is the shadcn bridge (derived when omitted).
|
|
244
|
+
*/
|
|
245
|
+
interface BrandModePalette {
|
|
246
|
+
roles?: BrandColorRoles;
|
|
247
|
+
semantic?: BrandSemanticColors;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Optional dual-mode colors. When both light and dark are set, emit binds:
|
|
251
|
+
* light → :root / html[data-brand]
|
|
252
|
+
* dark → .dark / html.dark[data-brand]
|
|
253
|
+
* Single-mode packs omit this and use top-level semantic + darkDefault selector rules.
|
|
254
|
+
*/
|
|
255
|
+
interface BrandModes {
|
|
256
|
+
light?: BrandModePalette;
|
|
257
|
+
dark?: BrandModePalette;
|
|
258
|
+
}
|
|
259
|
+
interface BrandPackage {
|
|
260
|
+
id: string;
|
|
261
|
+
name: string;
|
|
262
|
+
darkDefault: boolean;
|
|
263
|
+
version: string;
|
|
264
|
+
/**
|
|
265
|
+
* Canonical color roles for the **default** mode (see darkDefault).
|
|
266
|
+
* If omitted, derived from semantic on normalize().
|
|
267
|
+
*/
|
|
268
|
+
roles?: BrandColorRoles;
|
|
269
|
+
/**
|
|
270
|
+
* shadcn bridge for the default mode — always present after normalize().
|
|
271
|
+
*/
|
|
272
|
+
semantic: BrandSemanticColors;
|
|
273
|
+
/**
|
|
274
|
+
* Dual light/dark palettes (optional). When present after normalize, both modes
|
|
275
|
+
* are fully specified and emitBrandCss writes separate light/dark color blocks.
|
|
276
|
+
*/
|
|
277
|
+
modes?: BrandModes;
|
|
278
|
+
/** Always canonical after normalizeBrandPackage(). */
|
|
279
|
+
recipe: BrandRecipe;
|
|
280
|
+
typography: BrandTypography;
|
|
281
|
+
/** How the language moves. Falls back to the shared ramp when omitted. */
|
|
282
|
+
motion?: BrandMotion;
|
|
283
|
+
/** How much room the language leaves around content. Falls back to the shared scale when omitted. */
|
|
284
|
+
spacing?: BrandSpacing;
|
|
285
|
+
extensions?: BrandExtensions;
|
|
286
|
+
}
|
|
287
|
+
/** Pre-normalize package (recipe may still use legacy keys). */
|
|
288
|
+
type BrandPackageInput = Omit<BrandPackage, "recipe"> & {
|
|
289
|
+
recipe: BrandRecipeInput;
|
|
290
|
+
modes?: BrandModes;
|
|
291
|
+
};
|
|
292
|
+
interface CompileResult {
|
|
293
|
+
brand: BrandPackage;
|
|
294
|
+
css: string;
|
|
295
|
+
warnings: string[];
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
declare const BRAND_STYLE_ELEMENT_ID = "nebutra-brand-skin";
|
|
299
|
+
declare const BRAND_STORAGE_KEY = "nebutra-brand-package";
|
|
300
|
+
interface ApplyBrandOptions {
|
|
301
|
+
/** Persist package JSON to localStorage for Create Center preview reload */
|
|
302
|
+
persist?: boolean;
|
|
303
|
+
/** Target document (iframe preview support) */
|
|
304
|
+
doc?: Document;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Inject brand skin CSS at runtime (Create Center preview / tenant switch).
|
|
308
|
+
* Does not require rebuilding app CSS — overrides semantic + recipe vars.
|
|
309
|
+
*/
|
|
310
|
+
declare function applyBrandCss(css: string, brandId?: string, options?: ApplyBrandOptions): void;
|
|
311
|
+
/** Apply a full Brand Package (emit CSS + optional persist). */
|
|
312
|
+
declare function applyBrandPackage(brand: BrandPackage, options?: ApplyBrandOptions): void;
|
|
313
|
+
/** Remove runtime brand skin and restore default Nebutra tokens. */
|
|
314
|
+
declare function clearBrand(options?: ApplyBrandOptions): void;
|
|
315
|
+
/** Restore brand package previously persisted by applyBrandPackage({ persist: true }). */
|
|
316
|
+
declare function restorePersistedBrand(options?: ApplyBrandOptions): BrandPackage | null;
|
|
317
|
+
declare function getActiveBrandId(doc?: Document): string | null;
|
|
318
|
+
|
|
319
|
+
interface UseBrandOptions {
|
|
320
|
+
/** Restore from localStorage on mount */
|
|
321
|
+
autoRestore?: boolean;
|
|
322
|
+
/** Persist apply/clear to localStorage */
|
|
323
|
+
persist?: boolean;
|
|
324
|
+
}
|
|
325
|
+
interface UseBrandResult {
|
|
326
|
+
brand: BrandPackage | null;
|
|
327
|
+
brandId: string | null;
|
|
328
|
+
apply: (brand: BrandPackage) => void;
|
|
329
|
+
clear: () => void;
|
|
330
|
+
restore: () => BrandPackage | null;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Create Center / app-level brand state for the host document.
|
|
334
|
+
*/
|
|
335
|
+
declare function useBrand(options?: UseBrandOptions): UseBrandResult;
|
|
336
|
+
interface BrandIframePreviewOptions {
|
|
337
|
+
/**
|
|
338
|
+
* Stylesheets the iframe must load before the brand skin
|
|
339
|
+
* (e.g. app CSS URL that already includes tokens + recipe).
|
|
340
|
+
*/
|
|
341
|
+
baseStylesheetHrefs?: string[];
|
|
342
|
+
/** Extra head HTML (fonts CDN, etc.) */
|
|
343
|
+
headHtml?: string;
|
|
344
|
+
/** Minimal body wrapper class */
|
|
345
|
+
bodyClassName?: string;
|
|
346
|
+
/** Called after brand CSS is injected into the iframe */
|
|
347
|
+
onApplied?: (brand: BrandPackage | null) => void;
|
|
348
|
+
}
|
|
349
|
+
interface UseBrandIframePreviewResult {
|
|
350
|
+
iframeRef: RefObject<HTMLIFrameElement | null>;
|
|
351
|
+
brand: BrandPackage | null;
|
|
352
|
+
/** Write/update brand inside the iframe document */
|
|
353
|
+
apply: (brand: BrandPackage) => void;
|
|
354
|
+
clear: () => void;
|
|
355
|
+
/**
|
|
356
|
+
* Optional: write a self-contained preview document.
|
|
357
|
+
* Use when the iframe has no host app styles yet.
|
|
358
|
+
*/
|
|
359
|
+
writePreviewDocument: (brand: BrandPackage, bodyHtml?: string) => void;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Multi-tenant / Create Center iframe preview.
|
|
363
|
+
* Applies Brand Packages into the iframe's document without touching the host shell.
|
|
364
|
+
*/
|
|
365
|
+
declare function useBrandIframePreview(options?: BrandIframePreviewOptions): UseBrandIframePreviewResult;
|
|
366
|
+
/** Imperative helper for non-hook call sites */
|
|
367
|
+
declare function applyBrandToIframe(iframe: HTMLIFrameElement, brand: BrandPackage, options?: ApplyBrandOptions & {
|
|
368
|
+
baseStylesheetHrefs?: string[];
|
|
369
|
+
}): void;
|
|
370
|
+
|
|
371
|
+
export { type ApplyBrandOptions as A, BRAND_STORAGE_KEY as B, type CompileResult as C, type Density as D, type ElevationStyle as E, type CssColor as F, type UseBrandOptions as G, type HslChannels as H, type UseBrandResult as I, type UseBrandIframePreviewResult as U, type BrandColorRoles as a, type BrandElevationTokens as b, type BrandFontFace as c, type BrandPackage as d, type BrandRadii as e, type BrandRecipe as f, applyBrandCss as g, applyBrandPackage as h, applyBrandToIframe as i, clearBrand as j, getActiveBrandId as k, useBrandIframePreview as l, type ButtonDefaultStyle as m, type BrandPackageInput as n, type BrandSemanticColors as o, type BrandModePalette as p, BRAND_STYLE_ELEMENT_ID as q, restorePersistedBrand as r, type BadgeDefaultStyle as s, type BrandExtensions as t, useBrand as u, type BrandFontSource as v, type BrandIframePreviewOptions as w, type BrandModes as x, type BrandRecipeInput as y, type BrandTypography as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nebutra/tokens",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Unified theme tokens and theme-provider entry for Nebutra apps",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,16 +10,28 @@
|
|
|
10
10
|
"./recipe.css",
|
|
11
11
|
"./skins/*.css"
|
|
12
12
|
],
|
|
13
|
-
"main": "./
|
|
14
|
-
"types": "./
|
|
13
|
+
"main": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
15
|
"exports": {
|
|
16
|
-
".":
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js",
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
|
+
},
|
|
17
21
|
"./styles.css": "./styles.css",
|
|
18
22
|
"./recipe.css": "./recipe.css",
|
|
19
23
|
"./skins/*": "./skins/*",
|
|
20
24
|
"./brands/*": "./brands/*",
|
|
21
|
-
"./brand-package":
|
|
22
|
-
|
|
25
|
+
"./brand-package": {
|
|
26
|
+
"types": "./dist/brand-package/index.d.ts",
|
|
27
|
+
"import": "./dist/brand-package/index.js",
|
|
28
|
+
"default": "./dist/brand-package/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./use-brand": {
|
|
31
|
+
"types": "./dist/brand-package/use-brand.d.ts",
|
|
32
|
+
"import": "./dist/brand-package/use-brand.js",
|
|
33
|
+
"default": "./dist/brand-package/use-brand.js"
|
|
34
|
+
}
|
|
23
35
|
},
|
|
24
36
|
"dependencies": {
|
|
25
37
|
"@nebutra/design-tokens": "0.1.2"
|
|
@@ -28,8 +40,11 @@
|
|
|
28
40
|
"react": "^19"
|
|
29
41
|
},
|
|
30
42
|
"devDependencies": {
|
|
43
|
+
"@types/node": "^25.9.1",
|
|
31
44
|
"@types/react": "^19.2.14",
|
|
32
|
-
"
|
|
45
|
+
"tsx": "^4.21.0",
|
|
46
|
+
"typescript": "^5.9.3",
|
|
47
|
+
"tsup": "^8.5.1"
|
|
33
48
|
},
|
|
34
49
|
"homepage": "https://github.com/Nebutra/Nebutra-Sailor/tree/main/packages/design/tokens#readme",
|
|
35
50
|
"repository": {
|
|
@@ -43,12 +58,22 @@
|
|
|
43
58
|
"publishConfig": {
|
|
44
59
|
"access": "public"
|
|
45
60
|
},
|
|
61
|
+
"files": [
|
|
62
|
+
"dist",
|
|
63
|
+
"styles.css",
|
|
64
|
+
"recipe.css",
|
|
65
|
+
"skins",
|
|
66
|
+
"brands",
|
|
67
|
+
"README.md",
|
|
68
|
+
"LICENSE",
|
|
69
|
+
"CHANGELOG.md"
|
|
70
|
+
],
|
|
46
71
|
"scripts": {
|
|
47
|
-
"build": "node scripts/sync-styles.mjs && node scripts/emit-skins.mjs",
|
|
72
|
+
"build": "node scripts/sync-styles.mjs && node scripts/emit-skins.mjs && tsup",
|
|
48
73
|
"sync": "node scripts/sync-styles.mjs",
|
|
49
74
|
"emit-skins": "node scripts/emit-skins.mjs",
|
|
50
75
|
"compile-brand": "node scripts/compile-brand.mjs",
|
|
51
76
|
"typecheck": "tsc --noEmit",
|
|
52
|
-
"test": "
|
|
77
|
+
"test": "tsx --test src/brand-package/__tests__/*.test.ts"
|
|
53
78
|
}
|
|
54
79
|
}
|