@nexub/tokens 6.8.0 → 6.9.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.
@@ -6,7 +6,7 @@ import path from 'node:path';
6
6
  import { fileURLToPath } from 'node:url';
7
7
  import { parseArgs } from 'node:util';
8
8
 
9
- export const RULES = ['legacy-tokens', 'logical-classes', 'tw-animate', 'opacity-modifier', 'deprecated-components', 'tailwind-3-preset', 'keep-5-defaults'];
9
+ export const RULES = ['legacy-tokens', 'logical-classes', 'tw-animate', 'opacity-modifier', 'deprecated-components', 'tailwind-3-preset', 'keep-5-defaults', 'removed-in-7'];
10
10
  // Run only when asked for by --rules: they keep old behaviour instead of moving code forward.
11
11
  const OPT_IN = new Set(['keep-5-defaults']);
12
12
  export const DEFAULT_RULES = RULES.filter((r) => !OPT_IN.has(r));
@@ -450,6 +450,15 @@ export function migrateSource(src, { ext, rules = new Set(DEFAULT_RULES), fix =
450
450
  for (const m of src.matchAll(/['"]@nexub\/tokens\/tailwind['"]/g))
451
451
  items.push({ at: m.index, rule: 'tailwind-3-preset', message: '@nexub/tokens/tailwind (the Tailwind 3 preset) is removed in 4.0: move to Tailwind 4 and @import "@nexub/tokens/tailwind.css" in your CSS' });
452
452
  }
453
+ if (rules.has('removed-in-7') && COMPONENT_EXTS.has(ext)) {
454
+ // Report only: both need a human choice (Stepper's import and props, or a Combobox layout).
455
+ if (/@nexub\/patterns['"]/.test(src))
456
+ for (const m of src.matchAll(/<StepIndicator\b/g))
457
+ items.push({ at: m.index, rule: 'removed-in-7', message: 'StepIndicator (@nexub/patterns) is removed in 7.0: use <Stepper orientation="vertical" current={…}> from @nexub/react (currentStep -> current)' });
458
+ if (/@nexub\/react['"/]/.test(src))
459
+ for (const m of src.matchAll(/<Autocomplete\b[^>]*\bmode=(?:"inline"|'inline'|\{\s*['"]inline['"]\s*\})/g))
460
+ items.push({ at: m.index, rule: 'removed-in-7', message: 'Autocomplete mode="inline" is removed in 7.0: drop mode (popover), or build an always-open list with the Combobox parts' });
461
+ }
453
462
  // Rewrites never add or remove newlines, so offsets in src and text share line numbers.
454
463
  const lineOf = (at) => src.slice(0, at).split('\n').length;
455
464
  const manual = items.map(({ at, line, rule, message }) => ({ line: line ?? lineOf(at), rule, message })).sort((a, b) => a.line - b.line);
@@ -515,6 +524,8 @@ Rules:
515
524
  keep-5-defaults opt-in: keep 5.x behaviour on 6.0 by pinning the defaults it changes:
516
525
  <Autocomplete> gets mode="inline"; <DataTable enableRowSelection>
517
526
  gets selectionColumn={false}
527
+ removed-in-7 report what 7.0 removes: <StepIndicator> (use Stepper) and
528
+ <Autocomplete mode="inline">
518
529
 
519
530
  Ignored: node_modules, dist, build, .next, out, coverage, files over 1 MB.
520
531
  Exit codes: 0 ok, 1 --check found something, 2 usage error.`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexub/tokens",
3
- "version": "6.8.0",
3
+ "version": "6.9.0",
4
4
  "description": "Design tokens for Nexub Design System — colours, typography, spacing, radii, shadows, and motion as CSS variables, a Tailwind 4 theme, Figma variables and native (React Native, SwiftUI, Compose) tokens.",
5
5
  "type": "module",
6
6
  "license": "MIT",