astryx-dracula 0.3.0 → 0.3.1

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/USAGE.md CHANGED
@@ -145,11 +145,12 @@ README. Not required for this kit.
145
145
  - Never override `--color-*` in app `:root`. Brand changes live in `astryx-theme.ts` via `defineTheme`, then `bun run theme:build`.
146
146
  - Tokens for every value: `var(--color-*|--space-*|--radius-*)`. No raw hex or px in components.
147
147
  - Component styling: props first, then theme `components` overrides in `astryx-theme.ts`. No per-app CSS wars.
148
- - A chart mark takes a `--color-data-*` role token, never a `--dracula-*` primitive. The `chart-hues` / `chart-legend` / `data-bar` types reject anything else at compile time.
148
+ - A chart mark takes a `--color-data-*` role token, never a `--dracula-*` primitive. The `chart-hues` / `chart-legend` / `data-bar` types reject anything else at compile time, and `bun run audit` tree-walks the chart modules. Values are byte-identical to the primitives, so this is vocabulary, not appearance. Scene ART is exempt and deliberately so: `SCENE_HUES` is a separate remit where purple is banned as a series identity but legitimate as pigment.
149
149
  - `--dracula-comment` is legal on a **graphical** mark (3.36:1 clears WCAG 1.4.11) and illegal on **text** (fails 4.5:1). Any `fillOpacity` under 0.9 makes it worse. Text in a scene uses `--color-text-paragraph`.
150
150
  - A `Layout height="fill"` needs `style={{height: '100dvh'}}` or it silently degrades to document scroll. `minHeight: '100%'` computes to 0 against an indefinite parent, so it is a no-op.
151
151
  - Derive any count a page prints from its data. Hardcoded numerals are how `documentation.tsx` came to say "twenty-eight components" over 31 entries.
152
152
  - A `.tsx` exports components only; shared data lives in a sibling `.ts`, so React Fast Refresh works.
153
+ - **Do not add your own Tooltip override.** Core's `useTooltip` paints `background-color: var(--color-text-primary)` with `color: var(--color-background-surface)` — an inversion that only reads correctly on a light theme, and on dark it is a near-white box with light-grey text. This theme already overrides it (`components.tooltip.base` in `astryx-theme.ts`, shipping as `.astryx-tooltip` in `theme.css`) onto the popover tier with `--shadow-low`, at 9.06:1. Core renders the Tooltip internally, so this reaches `Selector`, `TimeInput`, `Typeahead`, `CheckboxInput`, `CheckboxList`, `Tokenizer`, `DateRangeInput` and `Tooltip` whether or not you use one. If you are carrying your own `.astryx-tooltip` rule, it is computing the same two values and can be deleted.
153
154
 
154
155
  ## Release checklist
155
156
 
package/package.json CHANGED
@@ -106,5 +106,5 @@
106
106
  "@astryxdesign/cli"
107
107
  ],
108
108
  "type": "module",
109
- "version": "0.3.0"
109
+ "version": "0.3.1"
110
110
  }
@@ -6,6 +6,7 @@
6
6
 
7
7
  import type {CSSProperties} from 'react';
8
8
  import {CHART_PANEL_STYLE} from 'astryx-dracula/shared/chart-panel-style';
9
+ import {CHART_HUES} from 'astryx-dracula/shared/chart-hues';
9
10
  import {VStack, HStack} from '@astryxdesign/core/Layout';
10
11
  import {Text} from '@astryxdesign/core/Text';
11
12
  import {Card} from '@astryxdesign/core/Card';
@@ -40,7 +41,10 @@ export function ProductSwatch({
40
41
  style={swatchStyle}
41
42
  role="img"
42
43
  aria-label={`${label} swatch`}>
43
- <rect width={36} height={36} rx={5} fill="var(--dracula-bg-light)" />
44
+ {/* A surface, not a data mark: the plate behind a product swatch wears the
45
+ card tier. --color-background-card is byte-identical to the old
46
+ --dracula-bg-light (#343746). */}
47
+ <rect width={36} height={36} rx={5} fill="var(--color-background-card)" />
44
48
  <rect
45
49
  x={1}
46
50
  y={1}
@@ -64,7 +68,10 @@ export function ProductSwatch({
64
68
 
65
69
  // ============= REVENUE CHART =============
66
70
 
67
- const REVENUE_LINE = 'var(--dracula-cyan)';
71
+ // Role token, not a --dracula-* primitive. Byte-identical (--color-data-
72
+ // categorical-cyan IS #8BE9FD) and routed through chart-hues.ts so the line
73
+ // colour is the sanctioned vocabulary rather than a literal decided here.
74
+ const REVENUE_LINE = CHART_HUES.cyan;
68
75
  const CHART_W = 540;
69
76
  const CHART_H = 200;
70
77
  const CHART_PAD_LEFT = 44;
@@ -2,6 +2,8 @@
2
2
  // geometry and the portfolio range-normalized step geometry behind one mode
3
3
  // switch. Purple stays out of the chart so it keeps meaning "interactive".
4
4
 
5
+ import {CHART_HUES} from 'astryx-dracula/shared/chart-hues';
6
+
5
7
  export interface SparkPoint {
6
8
  id: string;
7
9
  value: number;
@@ -28,7 +30,13 @@ export function Sparkline({
28
30
  mode = 'max',
29
31
  isCompact = false,
30
32
  }: SparklineProps) {
31
- const fill = positive ? 'var(--dracula-green)' : 'var(--dracula-red)';
33
+ // Role tokens, not --dracula-* primitives. Byte-identical values
34
+ // (--color-data-categorical-green IS #50FA7B), so this is a vocabulary
35
+ // change with no visual delta -- it just means the sparkline agrees with
36
+ // chart-hues.ts instead of being the one chart module that decided alone.
37
+ // Reported by a consumer whose test asserted their sparkline fill equalled
38
+ // their CHART_HUES.green and stopped agreeing across a version bump.
39
+ const fill = positive ? CHART_HUES.green : CHART_HUES.red;
32
40
  if (mode === 'range') {
33
41
  const values = data.map(point => point.value);
34
42
  const max = Math.max(...values);
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
  // XLE (canonical structure, validated with `bunx astryx layout check`):
3
- // L > LC[p=6] > V[g=10] > ((V[g=6 a=center] > (V[g=3 a=center] > Hd"Small joys for creatures of the night"[level=1 t=display-2] + Tx"Sometimes all it takes is one small ritual to turn the whole night around."[t=body] + Tx"astryx-dracula v0.3.0"[t=supporting]) + (H[j=center g=3] > B.primary"Embrace the night" + B.secondary"Read the lore")) + (S.transparent[p=0] > AR[ratio=16/9]))
3
+ // L > LC[p=6] > V[g=10] > ((V[g=6 a=center] > (V[g=3 a=center] > Hd"Small joys for creatures of the night"[level=1 t=display-2] + Tx"Sometimes all it takes is one small ritual to turn the whole night around."[t=body] + Tx"astryx-dracula v0.3.1"[t=supporting]) + (H[j=center g=3] > B.primary"Embrace the night" + B.secondary"Read the lore")) + (S.transparent[p=0] > AR[ratio=16/9]))
4
4
 
5
5
  import type {CSSProperties} from 'react';
6
6
  import {VStack, HStack, Layout, LayoutContent} from '@astryxdesign/core/Layout';
@@ -52,7 +52,7 @@ export default function CenteredHero() {
52
52
  color="secondary"
53
53
  justify="center"
54
54
  hasTabularNumbers>
55
- astryx-dracula v0.3.0
55
+ astryx-dracula v0.3.1
56
56
  </Text>
57
57
  </VStack>
58
58
  <HStack gap={3} wrap="wrap" justify="center">
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
  // XLE (canonical structure, validated with `bunx astryx layout check`):
3
- // A[cp=0 @sideNav=(SN > (SNS"Getting started" > (SNI"Introduction"! + SNI"Install")) + (SNS"The brand" > (SNI"Palette" + SNI"Type and shape")) + (SNS"In practice" > (SNI"Components" + SNI"Templates")) + (SNS"Reference" > (SNI"Tokens" + SNI"Migrating")))] > L[h=auto] > (LC[p=8 !scroll] > V[g=8] > (V[g=2] > (H[g=2 a=center] > MNT + Tx[t=supporting]) + Hd"Introduction"[level=1 t=display-2] + Tx"v0.3.0"[t=supporting]) + Tx"Intro"[t=large] + AR + (V[g=8] > (V[g=3] > Hd"What it is"[level=2] + Tx"Body"[t=body] + UL + Cd)*2) + D + (H[j=between] > B.secondary"Previous" + B.secondary"Next")) + (LP[!scroll] > Outline)
3
+ // A[cp=0 @sideNav=(SN > (SNS"Getting started" > (SNI"Introduction"! + SNI"Install")) + (SNS"The brand" > (SNI"Palette" + SNI"Type and shape")) + (SNS"In practice" > (SNI"Components" + SNI"Templates")) + (SNS"Reference" > (SNI"Tokens" + SNI"Migrating")))] > L[h=auto] > (LC[p=8 !scroll] > V[g=8] > (V[g=2] > (H[g=2 a=center] > MNT + Tx[t=supporting]) + Hd"Introduction"[level=1 t=display-2] + Tx"v0.3.1"[t=supporting]) + Tx"Intro"[t=large] + AR + (V[g=8] > (V[g=3] > Hd"What it is"[level=2] + Tx"Body"[t=body] + UL + Cd)*2) + D + (H[j=between] > B.secondary"Previous" + B.secondary"Next")) + (LP[!scroll] > Outline)
4
4
 
5
5
  /**
6
6
  * Product Tour — a chaptered walkthrough of this theme.
@@ -909,7 +909,7 @@ export default function ProductTour() {
909
909
  railHref={SELF_HASH}
910
910
  railIcon={<Icon icon={Sparkles} size="sm" />}
911
911
  eyebrow="Documentation"
912
- badge={() => 'astryx-dracula v0.3.0'}
912
+ badge={() => 'astryx-dracula v0.3.1'}
913
913
  art={chapterId => <ChapterArt chapterId={chapterId} />}
914
914
  />
915
915
  );
package/tokens.css CHANGED
@@ -344,13 +344,21 @@ body {
344
344
  --color-tag-yellow: #F1FA8C;
345
345
  --color-tag-green: #50FA7B;
346
346
  --color-tag-purple: #BD93F9;
347
- /* The token was named `tag-blue` and held purple. Dracula has no blue; the
348
- * closest is Comment/Comment-dim, and Purple is what the rest of the kit
349
- * already uses for a fourth accent -- so the VALUE was right and the NAME
350
- * was the lie. Renamed, not repinned: a `blue` tag that paints purple is
351
- * wrong in a way no contrast number catches, and a future author adding a
352
- * real blue tag would have found the slot occupied. Verify no consumer
353
- * returned with `grep -rn "tag-blue"` before shipping a rename. */
347
+ /* Renamed in 0.3.0 from `tag-blue`, which held this same #BD93F9. Dracula
348
+ * has no blue; Purple is what the rest of the kit already uses for a fourth
349
+ * accent, so the VALUE was right and the NAME was the lie. Renamed rather
350
+ * than repinned, because a `blue` tag that paints purple is wrong in a way
351
+ * no contrast number catches, and a future author adding a real blue tag
352
+ * would have found the slot occupied.
353
+ *
354
+ * Migrating: s/--color-tag-blue/--color-tag-purple/ in your own CSS. The
355
+ * rename is silent -- a stale reference resolves to nothing rather than
356
+ * erroring -- and it ships with no deprecated alias, so nothing falls back
357
+ * for you. Note that `blue` is also the name of six OTHER tokens that really
358
+ * are Comment #6272A4 (--color-background-blue, -border-, -icon-, -text-,
359
+ * --color-data-categorical-blue, and the --color-data-blue-1..5 ramp), so a
360
+ * repo-wide replace on "blue" repoints all six at Purple. Target the tag
361
+ * token by name. */
354
362
  }
355
363
 
356
364
  /* Dracula scrollbars. The spec defines no scrollbar token, so these follow its