@newtonedev/components 0.1.5 → 0.1.6

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 (54) hide show
  1. package/dist/composites/actions/Button/Button.d.ts.map +1 -1
  2. package/dist/composites/actions/Button/Button.styles.d.ts +3 -1
  3. package/dist/composites/actions/Button/Button.styles.d.ts.map +1 -1
  4. package/dist/index.cjs +360 -226
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.ts +4 -3
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +357 -228
  9. package/dist/index.js.map +1 -1
  10. package/dist/primitives/Frame/Frame.d.ts +2 -3
  11. package/dist/primitives/Frame/Frame.d.ts.map +1 -1
  12. package/dist/primitives/Frame/Frame.types.d.ts +4 -15
  13. package/dist/primitives/Frame/Frame.types.d.ts.map +1 -1
  14. package/dist/primitives/Text/Text.d.ts.map +1 -1
  15. package/dist/primitives/Text/Text.types.d.ts +9 -4
  16. package/dist/primitives/Text/Text.types.d.ts.map +1 -1
  17. package/dist/primitives/Wrapper/Wrapper.d.ts +1 -1
  18. package/dist/primitives/Wrapper/Wrapper.types.d.ts +1 -1
  19. package/dist/registry/registry.d.ts.map +1 -1
  20. package/dist/theme/FrameContext.d.ts +7 -5
  21. package/dist/theme/FrameContext.d.ts.map +1 -1
  22. package/dist/theme/NewtoneProvider.d.ts +5 -6
  23. package/dist/theme/NewtoneProvider.d.ts.map +1 -1
  24. package/dist/theme/defaults.d.ts.map +1 -1
  25. package/dist/theme/types.d.ts +38 -24
  26. package/dist/theme/types.d.ts.map +1 -1
  27. package/dist/tokens/computeTokens.d.ts +82 -7
  28. package/dist/tokens/computeTokens.d.ts.map +1 -1
  29. package/dist/tokens/types.d.ts +58 -16
  30. package/dist/tokens/types.d.ts.map +1 -1
  31. package/dist/tokens/useTokens.d.ts +2 -23
  32. package/dist/tokens/useTokens.d.ts.map +1 -1
  33. package/package.json +1 -1
  34. package/src/composites/actions/Button/Button.styles.ts +53 -80
  35. package/src/composites/actions/Button/Button.tsx +6 -2
  36. package/src/composites/form-controls/Select/SelectOption.tsx +2 -2
  37. package/src/composites/form-controls/Toggle/Toggle.styles.ts +1 -1
  38. package/src/composites/range-inputs/ColorScaleSlider/ColorScaleSlider.styles.ts +1 -1
  39. package/src/composites/range-inputs/Slider/Slider.styles.ts +2 -2
  40. package/src/index.ts +11 -4
  41. package/src/primitives/Frame/Frame.tsx +10 -18
  42. package/src/primitives/Frame/Frame.types.ts +5 -17
  43. package/src/primitives/Text/Text.tsx +18 -8
  44. package/src/primitives/Text/Text.types.ts +9 -4
  45. package/src/primitives/Wrapper/Wrapper.tsx +1 -1
  46. package/src/primitives/Wrapper/Wrapper.types.ts +1 -1
  47. package/src/registry/registry.ts +28 -7
  48. package/src/theme/FrameContext.tsx +7 -5
  49. package/src/theme/NewtoneProvider.tsx +5 -10
  50. package/src/theme/defaults.ts +0 -9
  51. package/src/theme/types.ts +53 -26
  52. package/src/tokens/computeTokens.ts +338 -116
  53. package/src/tokens/types.ts +74 -16
  54. package/src/tokens/useTokens.ts +16 -33
package/dist/index.cjs CHANGED
@@ -23,16 +23,6 @@ var DEFAULT_THEME_CONFIG = {
23
23
  { hue: newtone.DEFAULT_ERROR_HUE, saturation: newtone.DEFAULT_ERROR_SATURATION }
24
24
  ]
25
25
  },
26
- themes: {
27
- neutral: { paletteIndex: 0, lightModeNv: 0.95, darkModeNv: 0.1 },
28
- primary: { paletteIndex: 1, lightModeNv: 0.95, darkModeNv: 0.1 },
29
- secondary: { paletteIndex: 1, lightModeNv: 0.85, darkModeNv: 0.15 },
30
- strong: { paletteIndex: 0, lightModeNv: 0.1, darkModeNv: 0.95 }
31
- },
32
- elevation: {
33
- offsets: [-0.02, 0, 0.04]
34
- // [sunken, default, elevated]
35
- },
36
26
  spacing: {
37
27
  "00": 0,
38
28
  // base * 0
@@ -196,20 +186,16 @@ var ThemeContext = React13.createContext(null);
196
186
  function NewtoneProvider({
197
187
  config = DEFAULT_THEME_CONFIG,
198
188
  initialMode = "light",
199
- initialTheme = "neutral",
200
189
  children
201
190
  }) {
202
191
  const [mode, setMode] = React13.useState(initialMode);
203
- const [theme, setTheme] = React13.useState(initialTheme);
204
192
  const value = React13.useMemo(
205
193
  () => ({
206
194
  config,
207
195
  mode,
208
- theme,
209
- setMode,
210
- setTheme
196
+ setMode
211
197
  }),
212
- [config, mode, theme]
198
+ [config, mode]
213
199
  );
214
200
  return /* @__PURE__ */ React13__default.default.createElement(ThemeContext.Provider, { value }, /* @__PURE__ */ React13__default.default.createElement(GoogleFontLoader, { fonts: config.typography.fonts }), /* @__PURE__ */ React13__default.default.createElement(IconFontLoader, { icons: config.icons }), children);
215
201
  }
@@ -224,19 +210,160 @@ var FrameContext = React13.createContext(null);
224
210
  function useFrameContext() {
225
211
  return React13.useContext(FrameContext);
226
212
  }
213
+ var NEUTRAL_DEFAULTS = {
214
+ light: {
215
+ background: { elevated: 0, ground: 0.03, sunken: 0.06 },
216
+ text: { primary: 0.9, secondary: 0.7, tertiary: 0.5, disabled: 0.3 },
217
+ action: { enabled: 0.04, hovered: 0.06, pressed: 0.08 },
218
+ border: { enabled: 0.08, focused: 0.16, filled: 0.24 }
219
+ },
220
+ dark: {
221
+ background: { elevated: 0.24, ground: 0.2, sunken: 0.16 },
222
+ text: { primary: 1, secondary: 0.85, tertiary: 0.7, disabled: 0.55 },
223
+ action: { enabled: 0.04, hovered: 0.06, pressed: 0.08 },
224
+ border: { enabled: 0.08, focused: 0.16, filled: 0.24 }
225
+ }
226
+ };
227
+ var ACCENT_DEFAULTS = {
228
+ light: {
229
+ background: { elevated: 0, ground: 0.03, sunken: 0.06 },
230
+ text: { primary: 0.9, secondary: 0.7, tertiary: 0.5, disabled: 0.3 },
231
+ action: { enabled: 0.04, hovered: 0.06, pressed: 0.08 },
232
+ border: { enabled: 0.08, focused: 0.16, filled: 0.24 }
233
+ },
234
+ dark: {
235
+ background: { elevated: 0.24, ground: 0.2, sunken: 0.16 },
236
+ text: { primary: 1, secondary: 0.85, tertiary: 0.7, disabled: 0.55 },
237
+ action: { enabled: 0.04, hovered: 0.06, pressed: 0.08 },
238
+ border: { enabled: 0.08, focused: 0.16, filled: 0.24 }
239
+ }
240
+ };
241
+ var SUCCESS_DEFAULTS = {
242
+ light: {
243
+ background: { elevated: 0, ground: 0.03, sunken: 0.06 },
244
+ text: { primary: 0.9, secondary: 0.7, tertiary: 0.5, disabled: 0.3 },
245
+ action: { enabled: 0.04, hovered: 0.06, pressed: 0.08 },
246
+ border: { enabled: 0.08, focused: 0.16, filled: 0.24 }
247
+ },
248
+ dark: {
249
+ background: { elevated: 0.24, ground: 0.2, sunken: 0.16 },
250
+ text: { primary: 1, secondary: 0.85, tertiary: 0.7, disabled: 0.55 },
251
+ action: { enabled: 0.04, hovered: 0.06, pressed: 0.08 },
252
+ border: { enabled: 0.08, focused: 0.16, filled: 0.24 }
253
+ }
254
+ };
255
+ var WARNING_DEFAULTS = {
256
+ light: {
257
+ background: { elevated: 0, ground: 0.03, sunken: 0.06 },
258
+ text: { primary: 0.9, secondary: 0.7, tertiary: 0.5, disabled: 0.3 },
259
+ action: { enabled: 0.04, hovered: 0.06, pressed: 0.08 },
260
+ border: { enabled: 0.08, focused: 0.16, filled: 0.24 }
261
+ },
262
+ dark: {
263
+ background: { elevated: 0.24, ground: 0.2, sunken: 0.16 },
264
+ text: { primary: 1, secondary: 0.85, tertiary: 0.7, disabled: 0.55 },
265
+ action: { enabled: 0.04, hovered: 0.06, pressed: 0.08 },
266
+ border: { enabled: 0.08, focused: 0.16, filled: 0.24 }
267
+ }
268
+ };
269
+ var ERROR_DEFAULTS = {
270
+ light: {
271
+ background: { elevated: 0, ground: 0.03, sunken: 0.06 },
272
+ text: { primary: 0.9, secondary: 0.7, tertiary: 0.5, disabled: 0.3 },
273
+ action: { enabled: 0.04, hovered: 0.06, pressed: 0.08 },
274
+ border: { enabled: 0.08, focused: 0.16, filled: 0.24 }
275
+ },
276
+ dark: {
277
+ background: { elevated: 0.24, ground: 0.2, sunken: 0.16 },
278
+ text: { primary: 1, secondary: 0.85, tertiary: 0.7, disabled: 0.55 },
279
+ action: { enabled: 0.04, hovered: 0.06, pressed: 0.08 },
280
+ border: { enabled: 0.08, focused: 0.16, filled: 0.24 }
281
+ }
282
+ };
227
283
  function fontConfigToFamily(font) {
228
284
  const family = font.family.includes(" ") ? `"${font.family}"` : font.family;
229
285
  return `${family}, ${font.fallback}`;
230
286
  }
231
- function computeTokens(config, mode, themeMapping, elevation, elevationOffsets, spacing, radius, typography, icons) {
287
+ var clamp = (n) => Math.max(0, Math.min(1, n));
288
+ function computePaletteTokens(palette, defaults, mode, elevation, dynamicRange, elevationDelta, effectiveTextMode, autoAccentNv, neutralTextPrimary, neutralBgElevated) {
289
+ const modeDefaults = defaults[mode];
290
+ const toEngineNv = (nv) => mode === "light" ? 1 - nv : nv;
291
+ const textToEngineNv = (nv) => effectiveTextMode === "light" ? 1 - nv : nv;
292
+ const colorAt = (engineNv) => newtone.getColor(
293
+ palette.hue,
294
+ palette.saturation,
295
+ dynamicRange,
296
+ clamp(engineNv),
297
+ palette.desaturation,
298
+ palette.paletteHueGrading
299
+ );
300
+ const resolveKeyNv = (p) => mode === "dark" ? p.keyNormalizedValueDark : p.keyNormalizedValue;
301
+ const keyNv = resolveKeyNv(palette);
302
+ const fillBaseNv = keyNv ?? autoAccentNv;
303
+ const fillNv = clamp(fillBaseNv + elevationDelta);
304
+ const fill = colorAt(fillNv);
305
+ const hoverDir = effectiveTextMode === "light" ? -modeDefaults.action.hovered : modeDefaults.action.hovered;
306
+ const activeDir = effectiveTextMode === "light" ? -modeDefaults.action.pressed : modeDefaults.action.pressed;
307
+ const fillHover = colorAt(clamp(fillNv + hoverDir));
308
+ const fillActive = colorAt(clamp(fillNv + activeDir));
309
+ const onFill = fill.oklch.L > 0.6 ? neutralTextPrimary : neutralBgElevated;
310
+ const bgNormalized = elevation === 2 ? modeDefaults.background.elevated : elevation === 1 ? modeDefaults.background.ground : modeDefaults.background.sunken;
311
+ const bgNv = clamp(toEngineNv(bgNormalized));
312
+ const background = colorAt(bgNv);
313
+ const backgroundElevated = colorAt(clamp(toEngineNv(modeDefaults.background.elevated)));
314
+ const backgroundSunken = colorAt(clamp(toEngineNv(modeDefaults.background.sunken)));
315
+ const interactiveOffset = modeDefaults.action.enabled;
316
+ const interactiveNv = clamp(bgNv + (effectiveTextMode === "light" ? -interactiveOffset : interactiveOffset));
317
+ const backgroundInteractive = colorAt(interactiveNv);
318
+ const hoverShift = modeDefaults.action.hovered;
319
+ const activeShift = modeDefaults.action.pressed;
320
+ const backgroundInteractiveHover = colorAt(clamp(interactiveNv + (effectiveTextMode === "light" ? -hoverShift : hoverShift)));
321
+ const backgroundInteractiveActive = colorAt(clamp(interactiveNv + (effectiveTextMode === "light" ? -activeShift : activeShift)));
322
+ const textPrimary = colorAt(clamp(textToEngineNv(modeDefaults.text.primary) + elevationDelta));
323
+ const textSecondary = colorAt(clamp(textToEngineNv(modeDefaults.text.secondary) + elevationDelta));
324
+ const textTertiary = colorAt(clamp(textToEngineNv(modeDefaults.text.tertiary) + elevationDelta));
325
+ const textDisabled = colorAt(clamp(textToEngineNv(modeDefaults.text.disabled) + elevationDelta));
326
+ const borderOffset = modeDefaults.border.enabled;
327
+ const borderNv = effectiveTextMode === "light" ? bgNv - borderOffset : bgNv + borderOffset;
328
+ const border = colorAt(clamp(borderNv));
329
+ return {
330
+ fill,
331
+ fillHover,
332
+ fillActive,
333
+ onFill,
334
+ background,
335
+ backgroundElevated,
336
+ backgroundSunken,
337
+ backgroundInteractive,
338
+ backgroundInteractiveHover,
339
+ backgroundInteractiveActive,
340
+ textPrimary,
341
+ textSecondary,
342
+ textTertiary,
343
+ textDisabled,
344
+ border
345
+ };
346
+ }
347
+ function computeTokens(config, mode, elevation, spacing, radius, typography, icons, tokenOverrides) {
232
348
  const { dynamicRange, palettes } = config;
233
- const palette = palettes[themeMapping.paletteIndex];
349
+ const palette = palettes[0];
234
350
  if (!palette) {
235
- throw new Error(`Palette at index ${themeMapping.paletteIndex} not found`);
351
+ throw new Error("Neutral palette (index 0) not found");
236
352
  }
237
- const baseNv = mode === "light" ? themeMapping.lightModeNv : themeMapping.darkModeNv;
238
- const elevationOffset = elevationOffsets[elevation];
239
- const backgroundNv = Math.max(0, Math.min(1, baseNv + elevationOffset));
353
+ const neutralDefaults = NEUTRAL_DEFAULTS[mode];
354
+ const toEngineNv = (nv) => mode === "light" ? 1 - nv : nv;
355
+ const bgElevatedNorm = mode === "light" ? tokenOverrides?.backgroundElevated : tokenOverrides?.backgroundElevatedDark;
356
+ const bgDefaultNorm = mode === "light" ? tokenOverrides?.backgroundDefault : tokenOverrides?.backgroundDefaultDark;
357
+ const bgSunkenNorm = mode === "light" ? tokenOverrides?.backgroundSunken : tokenOverrides?.backgroundSunkenDark;
358
+ const textPrimaryNorm = mode === "light" ? tokenOverrides?.textPrimaryNormalized : tokenOverrides?.textPrimaryNormalizedDark;
359
+ const textSecondaryNorm = mode === "light" ? tokenOverrides?.textSecondaryNormalized : tokenOverrides?.textSecondaryNormalizedDark;
360
+ const textTertiaryNorm = mode === "light" ? tokenOverrides?.textTertiaryNormalized : tokenOverrides?.textTertiaryNormalizedDark;
361
+ const textDisabledNorm = mode === "light" ? tokenOverrides?.textDisabledNormalized : tokenOverrides?.textDisabledNormalizedDark;
362
+ const bgNormalized = elevation === 2 ? bgElevatedNorm ?? neutralDefaults.background.elevated : elevation === 1 ? bgDefaultNorm ?? neutralDefaults.background.ground : bgSunkenNorm ?? neutralDefaults.background.sunken;
363
+ const backgroundNv = clamp(toEngineNv(bgNormalized));
364
+ const elevatedNv = clamp(toEngineNv(bgElevatedNorm ?? neutralDefaults.background.elevated));
365
+ const sunkenNv = clamp(toEngineNv(bgSunkenNorm ?? neutralDefaults.background.sunken));
366
+ const elevationDelta = backgroundNv - elevatedNv;
240
367
  const effectiveTextMode = backgroundNv >= 0.5 ? "light" : "dark";
241
368
  const background = newtone.getColor(
242
369
  palette.hue,
@@ -246,7 +373,6 @@ function computeTokens(config, mode, themeMapping, elevation, elevationOffsets,
246
373
  palette.desaturation,
247
374
  palette.paletteHueGrading
248
375
  );
249
- const elevatedNv = Math.max(0, Math.min(1, baseNv + elevationOffsets[2]));
250
376
  const backgroundElevated = newtone.getColor(
251
377
  palette.hue,
252
378
  palette.saturation,
@@ -255,7 +381,6 @@ function computeTokens(config, mode, themeMapping, elevation, elevationOffsets,
255
381
  palette.desaturation,
256
382
  palette.paletteHueGrading
257
383
  );
258
- const sunkenNv = Math.max(0, Math.min(1, baseNv + elevationOffsets[0]));
259
384
  const backgroundSunken = newtone.getColor(
260
385
  palette.hue,
261
386
  palette.saturation,
@@ -264,8 +389,11 @@ function computeTokens(config, mode, themeMapping, elevation, elevationOffsets,
264
389
  palette.desaturation,
265
390
  palette.paletteHueGrading
266
391
  );
267
- const INTERACTIVE_COMPONENT_OFFSET = -0.035;
268
- const interactiveComponentNv = Math.max(0, Math.min(1, backgroundNv + INTERACTIVE_COMPONENT_OFFSET));
392
+ const INTERACTIVE_COMPONENT_OFFSET = mode === "light" ? tokenOverrides?.interactiveComponentOffset ?? neutralDefaults.action.enabled : tokenOverrides?.interactiveComponentOffsetDark ?? neutralDefaults.action.enabled;
393
+ const HOVER_SHIFT = mode === "light" ? tokenOverrides?.hoverShift ?? neutralDefaults.action.hovered : tokenOverrides?.hoverShiftDark ?? neutralDefaults.action.hovered;
394
+ const ACTIVE_SHIFT = mode === "light" ? tokenOverrides?.activeShift ?? neutralDefaults.action.pressed : tokenOverrides?.activeShiftDark ?? neutralDefaults.action.pressed;
395
+ const BORDER_OFFSET = mode === "light" ? tokenOverrides?.borderOffset ?? neutralDefaults.border.enabled : tokenOverrides?.borderOffsetDark ?? neutralDefaults.border.enabled;
396
+ const interactiveComponentNv = clamp(backgroundNv + (effectiveTextMode === "light" ? -INTERACTIVE_COMPONENT_OFFSET : INTERACTIVE_COMPONENT_OFFSET));
269
397
  const backgroundInteractive = newtone.getColor(
270
398
  palette.hue,
271
399
  palette.saturation,
@@ -274,143 +402,135 @@ function computeTokens(config, mode, themeMapping, elevation, elevationOffsets,
274
402
  palette.desaturation,
275
403
  palette.paletteHueGrading
276
404
  );
277
- const textPrimary = newtone.getColorByContrast(
405
+ const neutralHoverNv = clamp(interactiveComponentNv + (effectiveTextMode === "light" ? -HOVER_SHIFT : HOVER_SHIFT));
406
+ const backgroundInteractiveHover = newtone.getColor(
278
407
  palette.hue,
279
408
  palette.saturation,
280
409
  dynamicRange,
281
- 4.5,
282
- effectiveTextMode,
410
+ neutralHoverNv,
283
411
  palette.desaturation,
284
- palette.paletteHueGrading,
285
- background
412
+ palette.paletteHueGrading
286
413
  );
287
- const textSecondary = newtone.getColorByContrast(
414
+ const neutralActiveNv = clamp(interactiveComponentNv + (effectiveTextMode === "light" ? -ACTIVE_SHIFT : ACTIVE_SHIFT));
415
+ const backgroundInteractiveActive = newtone.getColor(
288
416
  palette.hue,
289
417
  palette.saturation,
290
418
  dynamicRange,
291
- 3,
292
- effectiveTextMode,
419
+ neutralActiveNv,
293
420
  palette.desaturation,
294
- palette.paletteHueGrading,
295
- background
421
+ palette.paletteHueGrading
296
422
  );
297
- const accentPalette = palettes[1];
298
- if (!accentPalette) {
299
- throw new Error("Accent palette (index 1) not found");
300
- }
301
- const resolveKeyNv = (p) => mode === "dark" ? p.keyNormalizedValueDark : p.keyNormalizedValue;
302
- const accentKeyNv = resolveKeyNv(accentPalette);
303
- const interactive = accentKeyNv !== void 0 ? newtone.getColor(
304
- accentPalette.hue,
305
- accentPalette.saturation,
423
+ const textToEngineNv = (nv) => effectiveTextMode === "light" ? 1 - nv : nv;
424
+ const textPrimary = newtone.getColor(
425
+ palette.hue,
426
+ palette.saturation,
306
427
  dynamicRange,
307
- accentKeyNv,
308
- accentPalette.desaturation,
309
- accentPalette.paletteHueGrading
310
- ) : newtone.getColorByContrast(
311
- accentPalette.hue,
312
- accentPalette.saturation,
428
+ clamp(textToEngineNv(textPrimaryNorm ?? neutralDefaults.text.primary) + elevationDelta),
429
+ palette.desaturation,
430
+ palette.paletteHueGrading
431
+ );
432
+ const textSecondary = newtone.getColor(
433
+ palette.hue,
434
+ palette.saturation,
313
435
  dynamicRange,
314
- 4.5,
315
- effectiveTextMode,
316
- accentPalette.desaturation,
317
- accentPalette.paletteHueGrading,
318
- background
436
+ clamp(textToEngineNv(textSecondaryNorm ?? neutralDefaults.text.secondary) + elevationDelta),
437
+ palette.desaturation,
438
+ palette.paletteHueGrading
319
439
  );
320
- const interactiveNv = accentKeyNv ?? (effectiveTextMode === "light" ? 0.3 : 0.7);
321
- const interactiveHover = newtone.getColor(
322
- accentPalette.hue,
323
- accentPalette.saturation,
440
+ const textTertiary = newtone.getColor(
441
+ palette.hue,
442
+ palette.saturation,
324
443
  dynamicRange,
325
- interactiveNv + (effectiveTextMode === "light" ? -0.05 : 0.05),
326
- accentPalette.desaturation,
327
- accentPalette.paletteHueGrading
444
+ clamp(textToEngineNv(textTertiaryNorm ?? neutralDefaults.text.tertiary) + elevationDelta),
445
+ palette.desaturation,
446
+ palette.paletteHueGrading
328
447
  );
329
- const interactiveActive = newtone.getColor(
330
- accentPalette.hue,
331
- accentPalette.saturation,
448
+ const textDisabled = newtone.getColor(
449
+ palette.hue,
450
+ palette.saturation,
332
451
  dynamicRange,
333
- interactiveNv + (effectiveTextMode === "light" ? -0.1 : 0.1),
334
- accentPalette.desaturation,
335
- accentPalette.paletteHueGrading
452
+ clamp(textToEngineNv(textDisabledNorm ?? neutralDefaults.text.disabled) + elevationDelta),
453
+ palette.desaturation,
454
+ palette.paletteHueGrading
336
455
  );
337
- const borderNv = effectiveTextMode === "light" ? backgroundNv - 0.1 : backgroundNv + 0.1;
456
+ const borderNv = effectiveTextMode === "light" ? backgroundNv - BORDER_OFFSET : backgroundNv + BORDER_OFFSET;
338
457
  const border = newtone.getColor(
339
458
  palette.hue,
340
459
  palette.saturation,
341
460
  dynamicRange,
342
- Math.max(0, Math.min(1, borderNv)),
461
+ clamp(borderNv),
343
462
  palette.desaturation,
344
463
  palette.paletteHueGrading
345
464
  );
465
+ const autoAccentNv = clamp(textToEngineNv(textPrimaryNorm ?? neutralDefaults.text.primary));
466
+ const accentPalette = palettes[1];
467
+ if (!accentPalette) {
468
+ throw new Error("Accent palette (index 1) not found");
469
+ }
470
+ const accent = computePaletteTokens(
471
+ accentPalette,
472
+ ACCENT_DEFAULTS,
473
+ mode,
474
+ elevation,
475
+ dynamicRange,
476
+ elevationDelta,
477
+ effectiveTextMode,
478
+ autoAccentNv,
479
+ textPrimary,
480
+ backgroundElevated
481
+ );
346
482
  const successPalette = palettes[2];
347
483
  const warningPalette = palettes[3];
348
484
  const errorPalette = palettes[4];
349
- const successKeyNv = successPalette ? resolveKeyNv(successPalette) : void 0;
350
- const success = successPalette ? successKeyNv !== void 0 ? newtone.getColor(
351
- successPalette.hue,
352
- successPalette.saturation,
485
+ const success = successPalette ? computePaletteTokens(
486
+ successPalette,
487
+ SUCCESS_DEFAULTS,
488
+ mode,
489
+ elevation,
353
490
  dynamicRange,
354
- successKeyNv,
355
- successPalette.desaturation,
356
- successPalette.paletteHueGrading
357
- ) : newtone.getColorByContrast(
358
- successPalette.hue,
359
- successPalette.saturation,
360
- dynamicRange,
361
- 4.5,
491
+ elevationDelta,
362
492
  effectiveTextMode,
363
- successPalette.desaturation,
364
- successPalette.paletteHueGrading,
365
- background
366
- ) : interactive;
367
- const warningKeyNv = warningPalette ? resolveKeyNv(warningPalette) : void 0;
368
- const warning = warningPalette ? warningKeyNv !== void 0 ? newtone.getColor(
369
- warningPalette.hue,
370
- warningPalette.saturation,
371
- dynamicRange,
372
- warningKeyNv,
373
- warningPalette.desaturation,
374
- warningPalette.paletteHueGrading
375
- ) : newtone.getColorByContrast(
376
- warningPalette.hue,
377
- warningPalette.saturation,
493
+ autoAccentNv,
494
+ textPrimary,
495
+ backgroundElevated
496
+ ) : accent;
497
+ const warning = warningPalette ? computePaletteTokens(
498
+ warningPalette,
499
+ WARNING_DEFAULTS,
500
+ mode,
501
+ elevation,
378
502
  dynamicRange,
379
- 4.5,
503
+ elevationDelta,
380
504
  effectiveTextMode,
381
- warningPalette.desaturation,
382
- warningPalette.paletteHueGrading,
383
- background
384
- ) : interactive;
385
- const errorKeyNv = errorPalette ? resolveKeyNv(errorPalette) : void 0;
386
- const error = errorPalette ? errorKeyNv !== void 0 ? newtone.getColor(
387
- errorPalette.hue,
388
- errorPalette.saturation,
389
- dynamicRange,
390
- errorKeyNv,
391
- errorPalette.desaturation,
392
- errorPalette.paletteHueGrading
393
- ) : newtone.getColorByContrast(
394
- errorPalette.hue,
395
- errorPalette.saturation,
505
+ autoAccentNv,
506
+ textPrimary,
507
+ backgroundElevated
508
+ ) : accent;
509
+ const error = errorPalette ? computePaletteTokens(
510
+ errorPalette,
511
+ ERROR_DEFAULTS,
512
+ mode,
513
+ elevation,
396
514
  dynamicRange,
397
- 4.5,
515
+ elevationDelta,
398
516
  effectiveTextMode,
399
- errorPalette.desaturation,
400
- errorPalette.paletteHueGrading,
401
- background
402
- ) : interactive;
517
+ autoAccentNv,
518
+ textPrimary,
519
+ backgroundElevated
520
+ ) : accent;
403
521
  return {
404
522
  background,
405
523
  backgroundElevated,
406
524
  backgroundSunken,
407
525
  backgroundInteractive,
526
+ backgroundInteractiveHover,
527
+ backgroundInteractiveActive,
408
528
  textPrimary,
409
529
  textSecondary,
410
- interactive,
411
- interactiveHover,
412
- interactiveActive,
530
+ textTertiary,
531
+ textDisabled,
413
532
  border,
533
+ accent,
414
534
  success,
415
535
  warning,
416
536
  error,
@@ -436,29 +556,26 @@ function computeTokens(config, mode, themeMapping, elevation, elevationOffsets,
436
556
 
437
557
  // src/tokens/useTokens.ts
438
558
  function useTokens(elevation) {
439
- const { config, mode, theme: providerTheme } = useNewtoneTheme();
559
+ const { config, mode } = useNewtoneTheme();
440
560
  const frameCtx = useFrameContext();
441
- const resolvedTheme = frameCtx?.theme ?? providerTheme;
442
561
  const resolvedElevation = elevation ?? frameCtx?.elevation ?? 1;
562
+ const canReuse = frameCtx !== null && elevation === void 0 && frameCtx.elevation === resolvedElevation;
443
563
  return React13.useMemo(() => {
444
- const themeMapping = config.themes[resolvedTheme];
564
+ if (canReuse) {
565
+ return { ...frameCtx.tokens, elevation: resolvedElevation };
566
+ }
445
567
  const tokens = computeTokens(
446
568
  config.colorSystem,
447
569
  mode,
448
- themeMapping,
449
570
  resolvedElevation,
450
- config.elevation.offsets,
451
571
  config.spacing,
452
572
  config.radius,
453
573
  config.typography,
454
- config.icons
574
+ config.icons,
575
+ config.tokenOverrides
455
576
  );
456
577
  return { ...tokens, elevation: resolvedElevation };
457
- }, [config, mode, resolvedTheme, resolvedElevation]);
458
- }
459
- function withOpacity(hexColor, opacity) {
460
- const alpha = Math.round(opacity * 255).toString(16).padStart(2, "0");
461
- return `${hexColor}${alpha}`;
578
+ }, [config, mode, resolvedElevation, canReuse, frameCtx?.tokens]);
462
579
  }
463
580
  function computeButtonPadding(size, hasIcon, hasText, iconPosition) {
464
581
  const basePadding = {
@@ -508,8 +625,19 @@ function computeButtonPadding(size, hasIcon, hasText, iconPosition) {
508
625
  paddingBottom: base
509
626
  };
510
627
  }
511
- function getNeutralPrimaryBg(tokens) {
512
- return newtone.srgbToHex(tokens.backgroundInteractive.srgb);
628
+ function getPaletteTokens(semantic, tokens) {
629
+ switch (semantic) {
630
+ case "accent":
631
+ return tokens.accent;
632
+ case "success":
633
+ return tokens.success;
634
+ case "error":
635
+ return tokens.error;
636
+ case "warning":
637
+ return tokens.warning;
638
+ default:
639
+ return void 0;
640
+ }
513
641
  }
514
642
  function getButtonConfig(variant, semantic, size, disabled, tokens) {
515
643
  const sizeConfig = getSizeConfig(size, tokens);
@@ -557,10 +685,12 @@ function getSizeConfig(size, tokens) {
557
685
  function getVariantColors(variant, semantic, disabled, tokens) {
558
686
  if (disabled) {
559
687
  const baseColors = getVariantColorsForState(variant, semantic, tokens);
688
+ const disabledBg = newtone.srgbToHex(tokens.backgroundSunken.srgb);
560
689
  return {
561
690
  ...baseColors,
562
- bg: newtone.srgbToHex(tokens.backgroundSunken.srgb),
563
- pressedBg: newtone.srgbToHex(tokens.backgroundSunken.srgb),
691
+ bg: disabledBg,
692
+ hoveredBg: disabledBg,
693
+ pressedBg: disabledBg,
564
694
  textColor: newtone.srgbToHex(tokens.textSecondary.srgb),
565
695
  iconColor: newtone.srgbToHex(tokens.textSecondary.srgb)
566
696
  };
@@ -568,109 +698,76 @@ function getVariantColors(variant, semantic, disabled, tokens) {
568
698
  return getVariantColorsForState(variant, semantic, tokens);
569
699
  }
570
700
  function getVariantColorsForState(variant, semantic, tokens) {
571
- const getSemanticColor = () => {
572
- switch (semantic) {
573
- case "accent":
574
- return newtone.srgbToHex(tokens.interactive.srgb);
575
- case "success":
576
- return newtone.srgbToHex(tokens.success.srgb);
577
- case "error":
578
- return newtone.srgbToHex(tokens.error.srgb);
579
- case "warning":
580
- return newtone.srgbToHex(tokens.warning.srgb);
581
- default:
582
- return newtone.srgbToHex(tokens.textPrimary.srgb);
583
- }
584
- };
701
+ const paletteTokens = getPaletteTokens(semantic, tokens);
585
702
  if (variant === "primary") {
586
703
  if (semantic === "neutral") {
587
- const bg = getNeutralPrimaryBg(tokens);
588
704
  return {
589
- bg,
590
- pressedBg: withOpacity(bg, 0.8),
591
- // Slightly darker on press
705
+ bg: newtone.srgbToHex(tokens.backgroundInteractive.srgb),
706
+ hoveredBg: newtone.srgbToHex(tokens.backgroundInteractiveHover.srgb),
707
+ pressedBg: newtone.srgbToHex(tokens.backgroundInteractiveActive.srgb),
592
708
  textColor: newtone.srgbToHex(tokens.textPrimary.srgb),
593
709
  iconColor: newtone.srgbToHex(tokens.textPrimary.srgb),
594
710
  borderWidth: 1,
595
711
  borderColor: "transparent"
596
- // Invisible border for consistent sizing
597
712
  };
598
713
  }
599
- if (semantic === "accent") {
600
- return {
601
- bg: newtone.srgbToHex(tokens.interactive.srgb),
602
- pressedBg: newtone.srgbToHex(tokens.interactiveActive.srgb),
603
- textColor: newtone.srgbToHex(tokens.background.srgb),
604
- // Contrast inversion
605
- iconColor: newtone.srgbToHex(tokens.background.srgb),
606
- borderWidth: 1,
607
- borderColor: "transparent"
608
- // Invisible border for consistent sizing
609
- };
610
- }
611
- const semanticColor = getSemanticColor();
612
714
  return {
613
- bg: semanticColor,
614
- pressedBg: withOpacity(semanticColor, 0.8),
615
- // Darken on press
616
- textColor: newtone.srgbToHex(tokens.background.srgb),
617
- // Contrast text
618
- iconColor: newtone.srgbToHex(tokens.background.srgb),
715
+ bg: newtone.srgbToHex(paletteTokens.fill.srgb),
716
+ hoveredBg: newtone.srgbToHex(paletteTokens.fillHover.srgb),
717
+ pressedBg: newtone.srgbToHex(paletteTokens.fillActive.srgb),
718
+ textColor: newtone.srgbToHex(paletteTokens.onFill.srgb),
719
+ iconColor: newtone.srgbToHex(paletteTokens.onFill.srgb),
619
720
  borderWidth: 1,
620
721
  borderColor: "transparent"
621
- // Invisible border for consistent sizing
622
722
  };
623
723
  }
624
724
  if (variant === "secondary") {
625
725
  if (semantic === "neutral") {
626
726
  return {
627
727
  bg: "transparent",
628
- pressedBg: newtone.srgbToHex(tokens.backgroundSunken.srgb),
728
+ hoveredBg: newtone.srgbToHex(tokens.backgroundInteractive.srgb),
729
+ pressedBg: newtone.srgbToHex(tokens.backgroundInteractiveHover.srgb),
629
730
  textColor: newtone.srgbToHex(tokens.textPrimary.srgb),
630
731
  iconColor: newtone.srgbToHex(tokens.textPrimary.srgb),
631
732
  borderWidth: 1,
632
733
  borderColor: newtone.srgbToHex(tokens.border.srgb)
633
734
  };
634
735
  }
635
- const semanticColor = getSemanticColor();
636
736
  return {
637
- bg: withOpacity(semanticColor, 0.1),
638
- // Light background tint
639
- pressedBg: withOpacity(semanticColor, 0.15),
640
- // Slightly darker on press
641
- textColor: semanticColor,
642
- iconColor: semanticColor,
737
+ bg: newtone.srgbToHex(paletteTokens.background.srgb),
738
+ hoveredBg: newtone.srgbToHex(paletteTokens.backgroundInteractive.srgb),
739
+ pressedBg: newtone.srgbToHex(paletteTokens.backgroundInteractiveHover.srgb),
740
+ textColor: newtone.srgbToHex(paletteTokens.fill.srgb),
741
+ iconColor: newtone.srgbToHex(paletteTokens.fill.srgb),
643
742
  borderWidth: 1,
644
743
  borderColor: "transparent"
645
- // Invisible border for consistent sizing
646
744
  };
647
745
  }
648
746
  if (variant === "tertiary") {
649
747
  if (semantic === "neutral") {
650
748
  return {
651
749
  bg: "transparent",
652
- pressedBg: newtone.srgbToHex(tokens.backgroundSunken.srgb),
750
+ hoveredBg: newtone.srgbToHex(tokens.backgroundInteractive.srgb),
751
+ pressedBg: newtone.srgbToHex(tokens.backgroundInteractiveHover.srgb),
653
752
  textColor: newtone.srgbToHex(tokens.textPrimary.srgb),
654
753
  iconColor: newtone.srgbToHex(tokens.textPrimary.srgb),
655
754
  borderWidth: 1,
656
755
  borderColor: "transparent"
657
- // Invisible border for consistent sizing
658
756
  };
659
757
  }
660
- const semanticColor = getSemanticColor();
661
758
  return {
662
759
  bg: "transparent",
663
- pressedBg: withOpacity(semanticColor, 0.1),
664
- // Subtle background tint
665
- textColor: semanticColor,
666
- iconColor: semanticColor,
760
+ hoveredBg: newtone.srgbToHex(paletteTokens.background.srgb),
761
+ pressedBg: newtone.srgbToHex(paletteTokens.backgroundInteractive.srgb),
762
+ textColor: newtone.srgbToHex(paletteTokens.fill.srgb),
763
+ iconColor: newtone.srgbToHex(paletteTokens.fill.srgb),
667
764
  borderWidth: 1,
668
765
  borderColor: "transparent"
669
- // Invisible border for consistent sizing
670
766
  };
671
767
  }
672
768
  return {
673
769
  bg: "transparent",
770
+ hoveredBg: "transparent",
674
771
  pressedBg: "transparent",
675
772
  textColor: newtone.srgbToHex(tokens.textPrimary.srgb),
676
773
  iconColor: newtone.srgbToHex(tokens.textPrimary.srgb),
@@ -737,11 +834,26 @@ function Icon({
737
834
  name
738
835
  );
739
836
  }
740
- var COLOR_MAP = {
741
- primary: "textPrimary",
742
- secondary: "textSecondary",
743
- interactive: "interactive"
744
- };
837
+ function resolveTextColor(color, tokens) {
838
+ switch (color) {
839
+ case "primary":
840
+ return newtone.srgbToHex(tokens.textPrimary.srgb);
841
+ case "secondary":
842
+ return newtone.srgbToHex(tokens.textSecondary.srgb);
843
+ case "tertiary":
844
+ return newtone.srgbToHex(tokens.textTertiary.srgb);
845
+ case "disabled":
846
+ return newtone.srgbToHex(tokens.textDisabled.srgb);
847
+ case "accent":
848
+ return newtone.srgbToHex(tokens.accent.fill.srgb);
849
+ case "success":
850
+ return newtone.srgbToHex(tokens.success.fill.srgb);
851
+ case "warning":
852
+ return newtone.srgbToHex(tokens.warning.fill.srgb);
853
+ case "error":
854
+ return newtone.srgbToHex(tokens.error.fill.srgb);
855
+ }
856
+ }
745
857
  function Text2({
746
858
  children,
747
859
  size = "base",
@@ -770,7 +882,7 @@ function Text2({
770
882
  // Font weight is stored as a number (e.g. 400, 600) but React Native expects a string.
771
883
  fontWeight: String(tokens.typography.weight[weight]),
772
884
  // Convert the theme color from internal sRGB format to a hex string (e.g. '#1a1a1a').
773
- color: newtone.srgbToHex(tokens[COLOR_MAP[color]].srgb),
885
+ color: resolveTextColor(color, tokens),
774
886
  // Line height = font size × multiplier (e.g. 16px × 1.5 = 24px line height).
775
887
  lineHeight: fontSize * tokens.typography.lineHeight[lineHeight],
776
888
  textAlign: align
@@ -1027,7 +1139,7 @@ function Button({
1027
1139
  () => computeButtonPadding(size, !!icon, !!children, iconPosition),
1028
1140
  [size, icon, children, iconPosition]
1029
1141
  );
1030
- return /* @__PURE__ */ React13__default.default.createElement(reactNative.Pressable, { disabled, ...pressableProps }, ({ pressed }) => (
1142
+ return /* @__PURE__ */ React13__default.default.createElement(reactNative.Pressable, { disabled, ...pressableProps }, ({ pressed, hovered }) => (
1031
1143
  // Wrapper handles layout: direction, gap, alignment (padding via style)
1032
1144
  /* @__PURE__ */ React13__default.default.createElement(
1033
1145
  Wrapper,
@@ -1040,7 +1152,7 @@ function Button({
1040
1152
  {
1041
1153
  ...padding,
1042
1154
  // Asymmetric horizontal padding for text optical balance
1043
- backgroundColor: pressed && !disabled ? variantColors.pressedBg : variantColors.bg,
1155
+ backgroundColor: pressed && !disabled ? variantColors.pressedBg : hovered && !disabled ? variantColors.hoveredBg : variantColors.bg,
1044
1156
  borderRadius: sizeTokens.borderRadius,
1045
1157
  borderWidth: variantColors.borderWidth,
1046
1158
  // Always 1 for consistent sizing
@@ -1258,8 +1370,7 @@ function toElevationLevel(frameElevation) {
1258
1370
  }
1259
1371
  function Frame({
1260
1372
  children,
1261
- // Theme & elevation
1262
- theme,
1373
+ // Elevation
1263
1374
  elevation,
1264
1375
  // Layout
1265
1376
  layout,
@@ -1298,25 +1409,22 @@ function Frame({
1298
1409
  // Style override
1299
1410
  style
1300
1411
  }) {
1301
- const { config, mode, theme: providerTheme } = useNewtoneTheme();
1412
+ const { config, mode } = useNewtoneTheme();
1302
1413
  const parentFrameCtx = useFrameContext();
1303
- const resolvedTheme = theme ?? parentFrameCtx?.theme ?? providerTheme;
1304
1414
  const resolvedFrameElevation = elevation ?? 0;
1305
1415
  const resolvedElevation = elevation !== void 0 ? toElevationLevel(elevation) : parentFrameCtx?.elevation ?? 1;
1306
1416
  const tokens = React13.useMemo(() => {
1307
- const themeMapping = config.themes[resolvedTheme];
1308
1417
  return computeTokens(
1309
1418
  config.colorSystem,
1310
1419
  mode,
1311
- themeMapping,
1312
1420
  resolvedElevation,
1313
- config.elevation.offsets,
1314
1421
  config.spacing,
1315
1422
  config.radius,
1316
1423
  config.typography,
1317
- config.icons
1424
+ config.icons,
1425
+ config.tokenOverrides
1318
1426
  );
1319
- }, [config, mode, resolvedTheme, resolvedElevation]);
1427
+ }, [config, mode, resolvedElevation]);
1320
1428
  const styles = React13.useMemo(
1321
1429
  () => getFrameStyles({
1322
1430
  tokens,
@@ -1366,8 +1474,8 @@ function Frame({
1366
1474
  ]
1367
1475
  );
1368
1476
  const contextValue = React13.useMemo(
1369
- () => ({ theme: resolvedTheme, elevation: resolvedElevation }),
1370
- [resolvedTheme, resolvedElevation]
1477
+ () => ({ elevation: resolvedElevation, tokens }),
1478
+ [resolvedElevation, tokens]
1371
1479
  );
1372
1480
  const webOverrides = [];
1373
1481
  if (styles.gridWebStyle) {
@@ -1382,7 +1490,7 @@ function Frame({
1382
1490
  const focusRingStyle = isFocusVisible && !disabled ? {
1383
1491
  outlineWidth: 2,
1384
1492
  outlineStyle: "solid",
1385
- outlineColor: newtone.srgbToHex(tokens.interactive.srgb),
1493
+ outlineColor: newtone.srgbToHex(tokens.accent.fill.srgb),
1386
1494
  outlineOffset: 2
1387
1495
  } : void 0;
1388
1496
  const webFocusProps = isInteractive ? focusProps : {};
@@ -1837,7 +1945,7 @@ function SelectOptionRow({
1837
1945
  },
1838
1946
  isSelected && {
1839
1947
  fontWeight: tokens.typography.weight.semibold,
1840
- color: newtone.srgbToHex(tokens.interactive.srgb)
1948
+ color: newtone.srgbToHex(tokens.accent.fill.srgb)
1841
1949
  },
1842
1950
  option.disabled && {
1843
1951
  color: newtone.srgbToHex(tokens.textSecondary.srgb)
@@ -1852,7 +1960,7 @@ function SelectOptionRow({
1852
1960
  {
1853
1961
  name: "check",
1854
1962
  size: fontSize,
1855
- color: newtone.srgbToHex(tokens.interactive.srgb)
1963
+ color: newtone.srgbToHex(tokens.accent.fill.srgb)
1856
1964
  }
1857
1965
  ))
1858
1966
  );
@@ -1995,7 +2103,7 @@ function getToggleStyles(tokens, value, disabled) {
1995
2103
  width: TRACK_WIDTH,
1996
2104
  height: TRACK_HEIGHT,
1997
2105
  borderRadius: TRACK_HEIGHT / 2,
1998
- backgroundColor: value ? newtone.srgbToHex(tokens.interactive.srgb) : newtone.srgbToHex(tokens.border.srgb),
2106
+ backgroundColor: value ? newtone.srgbToHex(tokens.accent.fill.srgb) : newtone.srgbToHex(tokens.border.srgb),
1999
2107
  justifyContent: "center",
2000
2108
  paddingHorizontal: THUMB_OFFSET
2001
2109
  },
@@ -2095,14 +2203,14 @@ function getSliderStyles(tokens, disabled) {
2095
2203
  left: 0,
2096
2204
  height: TRACK_HEIGHT2,
2097
2205
  borderRadius: TRACK_HEIGHT2 / 2,
2098
- backgroundColor: newtone.srgbToHex(tokens.interactive.srgb)
2206
+ backgroundColor: newtone.srgbToHex(tokens.accent.fill.srgb)
2099
2207
  },
2100
2208
  thumb: {
2101
2209
  position: "absolute",
2102
2210
  width: THUMB_SIZE2,
2103
2211
  height: THUMB_SIZE2,
2104
2212
  borderRadius: THUMB_SIZE2 / 2,
2105
- backgroundColor: newtone.srgbToHex(tokens.interactive.srgb)
2213
+ backgroundColor: newtone.srgbToHex(tokens.accent.fill.srgb)
2106
2214
  }
2107
2215
  });
2108
2216
  }
@@ -2477,7 +2585,7 @@ function getColorScaleSliderStyles(tokens, disabled) {
2477
2585
  fontFamily: tokens.typography.fonts.default,
2478
2586
  fontSize: tokens.typography.size.xs,
2479
2587
  fontWeight: tokens.typography.weight.medium,
2480
- color: newtone.srgbToHex(tokens.error.srgb)
2588
+ color: newtone.srgbToHex(tokens.error.fill.srgb)
2481
2589
  }
2482
2590
  });
2483
2591
  }
@@ -2726,13 +2834,17 @@ var COMPONENTS = [
2726
2834
  variants: [
2727
2835
  { id: "primary-md", label: "Primary", props: { variant: "primary", size: "md" } },
2728
2836
  { id: "secondary-md", label: "Secondary", props: { variant: "secondary", size: "md" } },
2729
- { id: "ghost-md", label: "Ghost", props: { variant: "ghost", size: "md" } },
2730
- { id: "outline-md", label: "Outline", props: { variant: "outline", size: "md" } },
2837
+ { id: "tertiary-md", label: "Tertiary", props: { variant: "tertiary", size: "md" } },
2731
2838
  { id: "primary-sm", label: "Primary Small", props: { variant: "primary", size: "sm" } },
2732
2839
  { id: "primary-lg", label: "Primary Large", props: { variant: "primary", size: "lg" } },
2840
+ { id: "accent-primary", label: "Accent Primary", props: { variant: "primary", size: "md", semantic: "accent" } },
2841
+ { id: "accent-secondary", label: "Accent Secondary", props: { variant: "secondary", size: "md", semantic: "accent" } },
2842
+ { id: "success-primary", label: "Success Primary", props: { variant: "primary", size: "md", semantic: "success" } },
2843
+ { id: "error-primary", label: "Error Primary", props: { variant: "primary", size: "md", semantic: "error" } },
2844
+ { id: "warning-primary", label: "Warning Primary", props: { variant: "primary", size: "md", semantic: "warning" } },
2733
2845
  { id: "icon-left", label: "Icon Left", props: { variant: "primary", size: "md", icon: "add" } },
2734
2846
  { id: "icon-right", label: "Icon Right", props: { variant: "primary", size: "md", icon: "arrow_forward", iconPosition: "right" } },
2735
- { id: "icon-only", label: "Icon Only", props: { variant: "ghost", size: "md", icon: "settings" } }
2847
+ { id: "icon-only", label: "Icon Only", props: { variant: "tertiary", size: "md", icon: "settings" } }
2736
2848
  ],
2737
2849
  editableProps: [
2738
2850
  {
@@ -2742,11 +2854,23 @@ var COMPONENTS = [
2742
2854
  options: [
2743
2855
  { label: "Primary", value: "primary" },
2744
2856
  { label: "Secondary", value: "secondary" },
2745
- { label: "Ghost", value: "ghost" },
2746
- { label: "Outline", value: "outline" }
2857
+ { label: "Tertiary", value: "tertiary" }
2747
2858
  ],
2748
2859
  defaultValue: "primary"
2749
2860
  },
2861
+ {
2862
+ name: "semantic",
2863
+ label: "Semantic",
2864
+ control: "select",
2865
+ options: [
2866
+ { label: "Neutral", value: "neutral" },
2867
+ { label: "Accent", value: "accent" },
2868
+ { label: "Success", value: "success" },
2869
+ { label: "Warning", value: "warning" },
2870
+ { label: "Error", value: "error" }
2871
+ ],
2872
+ defaultValue: "neutral"
2873
+ },
2750
2874
  {
2751
2875
  name: "size",
2752
2876
  label: "Size",
@@ -3109,7 +3233,7 @@ var COMPONENTS = [
3109
3233
  { id: "subheading", label: "Subheading", props: { size: "lg", weight: "semibold" } },
3110
3234
  { id: "body", label: "Body", props: { size: "base" } },
3111
3235
  { id: "caption", label: "Caption", props: { size: "sm", color: "secondary" } },
3112
- { id: "link", label: "Link", props: { color: "interactive", weight: "medium" } },
3236
+ { id: "accent", label: "Accent", props: { color: "accent", weight: "medium" } },
3113
3237
  { id: "mono", label: "Monospace", props: { font: "mono", size: "sm" } }
3114
3238
  ],
3115
3239
  editableProps: [
@@ -3147,7 +3271,12 @@ var COMPONENTS = [
3147
3271
  options: [
3148
3272
  { label: "Primary", value: "primary" },
3149
3273
  { label: "Secondary", value: "secondary" },
3150
- { label: "Interactive", value: "interactive" }
3274
+ { label: "Tertiary", value: "tertiary" },
3275
+ { label: "Disabled", value: "disabled" },
3276
+ { label: "Accent", value: "accent" },
3277
+ { label: "Success", value: "success" },
3278
+ { label: "Warning", value: "warning" },
3279
+ { label: "Error", value: "error" }
3151
3280
  ],
3152
3281
  defaultValue: "primary"
3153
3282
  },
@@ -3472,6 +3601,7 @@ var SYSTEM_FONTS = [
3472
3601
  }
3473
3602
  ];
3474
3603
 
3604
+ exports.ACCENT_DEFAULTS = ACCENT_DEFAULTS;
3475
3605
  exports.AppShell = AppShell;
3476
3606
  exports.Button = Button;
3477
3607
  exports.CATEGORIES = CATEGORIES;
@@ -3479,13 +3609,16 @@ exports.COMPONENTS = COMPONENTS;
3479
3609
  exports.Card = Card;
3480
3610
  exports.ColorScaleSlider = ColorScaleSlider;
3481
3611
  exports.DEFAULT_THEME_CONFIG = DEFAULT_THEME_CONFIG;
3612
+ exports.ERROR_DEFAULTS = ERROR_DEFAULTS;
3482
3613
  exports.Frame = Frame;
3483
3614
  exports.GOOGLE_FONTS = GOOGLE_FONTS;
3484
3615
  exports.HueSlider = HueSlider;
3485
3616
  exports.Icon = Icon;
3617
+ exports.NEUTRAL_DEFAULTS = NEUTRAL_DEFAULTS;
3486
3618
  exports.Navbar = Navbar;
3487
3619
  exports.NewtoneProvider = NewtoneProvider;
3488
3620
  exports.Popover = Popover;
3621
+ exports.SUCCESS_DEFAULTS = SUCCESS_DEFAULTS;
3489
3622
  exports.SYSTEM_FONTS = SYSTEM_FONTS;
3490
3623
  exports.Select = Select;
3491
3624
  exports.Sidebar = Sidebar;
@@ -3493,6 +3626,7 @@ exports.Slider = Slider;
3493
3626
  exports.Text = Text2;
3494
3627
  exports.TextInput = TextInput;
3495
3628
  exports.Toggle = Toggle;
3629
+ exports.WARNING_DEFAULTS = WARNING_DEFAULTS;
3496
3630
  exports.Wrapper = Wrapper;
3497
3631
  exports.buildGoogleFontsUrl = buildGoogleFontsUrl;
3498
3632
  exports.computeTokens = computeTokens;