@rojaostudio/ds-core 1.1.0-next.11 → 1.1.0-next.12

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.
@@ -913,7 +913,7 @@ var ROLES = [
913
913
  ["text/on/accent", "d", "d"],
914
914
  ["text/on/tint", "d", "b"],
915
915
  ["colors/state/error", "l", "l"],
916
- ["colors/state/error-strong", "d", "d"],
916
+ ["colors/state/error-strong", "p", "p"],
917
917
  ["surface/tint/strong", "d", "b"],
918
918
  ["text/on/error", "l", "l"],
919
919
  ["surface/action/default", "d", "b"],
@@ -1198,7 +1198,6 @@ function generateRdsTheme(def, opts = {}) {
1198
1198
  "text/on/action-tonal": readableFrom(P.scale[200], P.scale, [L[900]], "lighter", WHITE),
1199
1199
  "surface/lift/action": P.scale[800],
1200
1200
  "surface/lift/action-strong": P.scale[700],
1201
- "colors/state/error-strong": red[400],
1202
1201
  "colors/state/success-strong": green[300],
1203
1202
  "colors/state/warning-strong": orange[400],
1204
1203
  "surface/error": red[900],
@@ -1257,7 +1256,6 @@ function generateRdsTheme(def, opts = {}) {
1257
1256
  [d["colors/accent/hover"]] = stateFills(A.scale, d["colors/accent/default"], d["text/on/accent"], [d["colors/accent/hover"]]);
1258
1257
  d["border/error"] = readableFrom(red[400], red, [d["surface/card"]], awayFrom(d["surface/card"]), WHITE, NON_TEXT);
1259
1258
  d["chart/series/1"] = readableFrom(P.scale[400], P.scale, [d["surface/card"]], awayFrom(d["surface/card"]), WHITE, NON_TEXT);
1260
- d["colors/state/error-strong"] = carry(red, l["colors/state/error"], l["text/on/error"], d["colors/state/error-strong"]);
1261
1259
  const ink0 = on(P.base);
1262
1260
  const plate = contrastRatio(ink0, P.base) >= PLATE_MIN ? P.base : readableFrom(P.base, P.scale, [ink0], ink0 === WHITE ? "darker" : "lighter", ink0 === WHITE ? BLACK : WHITE, PLATE_MIN);
1263
1261
  const ink = on(plate);
@@ -1340,11 +1338,13 @@ function generateRdsTheme(def, opts = {}) {
1340
1338
  }
1341
1339
  plateOwn["colors/accent/highlight"] = (_d = [d["colors/accent/highlight"], l["colors/accent/highlight"]].find((c) => contrastRatio(ink, c) >= AA)) != null ? _d : readableFrom(l["colors/accent/highlight"], A.scale, [ink], lightPlate ? "lighter" : "darker", ink === WHITE ? BLACK : WHITE);
1342
1340
  plateOwn["chart/series/1"] = readableFrom(d["chart/series/1"], P.scale, plateBgs, awayFrom(plate), ink, NON_TEXT);
1341
+ plateOwn["colors/state/neutral-strong"] = readableFrom(d["colors/state/neutral-strong"], N, plateBgs, awayFrom(plate), ink, NON_TEXT);
1343
1342
  for (const logo of ["logo/primary", "logo/signature", "logo/accent", "logo/mono", "social/ink"]) plateOwn[logo] = ink;
1343
+ const fixed = { "colors/state/error-strong": red[700] };
1344
1344
  const out = { light: {}, dark: {}, brand: {} };
1345
1345
  const pick = (src, role) => {
1346
1346
  var _a2;
1347
- const table = src === "l" ? l : src === "d" ? d : br;
1347
+ const table = src === "l" ? l : src === "d" ? d : src === "p" ? fixed : br;
1348
1348
  const v = (_a2 = table[role]) != null ? _a2 : l[role];
1349
1349
  if (v === void 0) throw new Error(`rdsTheme: no value for "${role}"`);
1350
1350
  return v;
@@ -1448,7 +1448,7 @@ var RDS_CONTRAST_PAIRS = [
1448
1448
  ["text/on/neutral", "colors/state/neutral"],
1449
1449
  ["text/error", "surface/error"],
1450
1450
  // The pairs the components join (packages/ds, styles/rds/components.css): the label of the neutral Button and
1451
- // Badge on its fill and hovers, the inverse label (colors/primary/default) on the card, the pressed outline Button,
1451
+ // Badge on its fill and hovers, the brand ink as text (colors/primary/default) on the card, the pressed outline Button,
1452
1452
  // the Badge highlight, the selected entry, quiet text and state text where they are placed.
1453
1453
  ["text/on/primary-strong", "colors/primary/default"],
1454
1454
  ["text/on/primary-strong", "colors/primary/light"],
@@ -1484,7 +1484,9 @@ var RDS_NON_TEXT_PAIRS = [
1484
1484
  ["logo/primary", "surface/page"],
1485
1485
  ["logo/primary", "surface/panel"],
1486
1486
  ["chart/series/1", "surface/card"],
1487
- ["chart/series/1", "surface/page"]
1487
+ ["chart/series/1", "surface/page"],
1488
+ ["colors/state/neutral-strong", "surface/panel"],
1489
+ ["colors/state/neutral-strong", "surface/card"]
1488
1490
  ];
1489
1491
  function rdsContrastReport(theme) {
1490
1492
  const out = [];
@@ -14,9 +14,10 @@ type RdsThemeOptions = {
14
14
  /**
15
15
  * Roles of the [RDS] theme collection, in Figma order: [name, dark source, brand source].
16
16
  * The light mode always reads the plain base token. In dark and brand, Figma points either to the
17
- * mode's own variant (`d` = base dark/…, `b` = base brand/…) or back to another one (`l` = plain).
17
+ * mode's own variant (`d` = base dark/…, `b` = base brand/…) or back to another one (`l` = plain), or straight
18
+ * to a primitive of the [RDS] Primitives library (`p`: the same colour for every brand, see FIXED in the generator).
18
19
  */
19
- declare const ROLES: ReadonlyArray<readonly [string, "l" | "d", "l" | "d" | "b"]>;
20
+ declare const ROLES: ReadonlyArray<readonly [string, "l" | "d" | "p", "l" | "d" | "b" | "p"]>;
20
21
  /** CSS custom property of a role: the Figma path with hyphens (the [RDS] codeSyntax rule). */
21
22
  declare const roleVar: (role: string) => string;
22
23
  declare function generateRdsTheme(def: BrandDef, opts?: RdsThemeOptions): RdsTheme;
package/dist/generate.js CHANGED
@@ -1,3 +1,3 @@
1
- export { RDS_CONTRAST_PAIRS, RDS_NON_TEXT_PAIRS, ROLES as RDS_ROLES, RDS_SCOPE_SELECTORS, RDS_TOKEN_SCOPE, RdsValidationError, SCALE_STEPS, brandTones, buildScale, contrastRatio, emitClaudeMd, emitCss, emitRdsCss, generateRdsTheme, generateTheme, hexToHsl, hslToHex, isHex, isNeutralBrand, isSafeColor, isSafeFont, isSafeVarName, onColor, rdsContrast, rdsContrastReport, rdsThemeFromTable, refToHex, relativeLuminance, resolveTheme, roleVar } from './chunk-D6HJEVJK.js';
1
+ export { RDS_CONTRAST_PAIRS, RDS_NON_TEXT_PAIRS, ROLES as RDS_ROLES, RDS_SCOPE_SELECTORS, RDS_TOKEN_SCOPE, RdsValidationError, SCALE_STEPS, brandTones, buildScale, contrastRatio, emitClaudeMd, emitCss, emitRdsCss, generateRdsTheme, generateTheme, hexToHsl, hslToHex, isHex, isNeutralBrand, isSafeColor, isSafeFont, isSafeVarName, onColor, rdsContrast, rdsContrastReport, rdsThemeFromTable, refToHex, relativeLuminance, resolveTheme, roleVar } from './chunk-NVYJME6V.js';
2
2
  import './chunk-FRWRLCYM.js';
3
3
  import './chunk-ORMEWXMH.js';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  export { recipes } from './chunk-PV6GFEAM.js';
2
- export { RDS_CONTRAST_PAIRS, RDS_NON_TEXT_PAIRS, ROLES as RDS_ROLES, RDS_SCOPE_SELECTORS, RDS_TOKEN_SCOPE, RdsValidationError, SCALE_STEPS, brandTones, buildScale, contrastRatio, emitClaudeMd, emitCss, emitRdsCss, generateRdsTheme, generateTheme, hexToHsl, hslToHex, isHex, isNeutralBrand, isSafeColor, isSafeFont, isSafeVarName, onColor, rdsContrast, rdsContrastReport, rdsThemeFromTable, refToHex, relativeLuminance, resolveTheme, roleVar } from './chunk-D6HJEVJK.js';
2
+ export { RDS_CONTRAST_PAIRS, RDS_NON_TEXT_PAIRS, ROLES as RDS_ROLES, RDS_SCOPE_SELECTORS, RDS_TOKEN_SCOPE, RdsValidationError, SCALE_STEPS, brandTones, buildScale, contrastRatio, emitClaudeMd, emitCss, emitRdsCss, generateRdsTheme, generateTheme, hexToHsl, hslToHex, isHex, isNeutralBrand, isSafeColor, isSafeFont, isSafeVarName, onColor, rdsContrast, rdsContrastReport, rdsThemeFromTable, refToHex, relativeLuminance, resolveTheme, roleVar } from './chunk-NVYJME6V.js';
3
3
  export { primitives, tokens } from './chunk-FRWRLCYM.js';
4
4
  import './chunk-ORMEWXMH.js';
package/dist/themes.js CHANGED
@@ -1,4 +1,4 @@
1
- import { generateTheme } from './chunk-D6HJEVJK.js';
1
+ import { generateTheme } from './chunk-NVYJME6V.js';
2
2
  import './chunk-FRWRLCYM.js';
3
3
  import { __spreadValues, __objRest } from './chunk-ORMEWXMH.js';
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rojaostudio/ds-core",
3
- "version": "1.1.0-next.11",
3
+ "version": "1.1.0-next.12",
4
4
  "description": "O motor do Rojão DS — tokens, derivação de tema e emissores. Sem React, sem Tailwind, sem CSS.",
5
5
  "license": "MIT",
6
6
  "author": "Rojão Studio (https://rojao.studio)",