@alexgorbatchev/shadcn 0.0.201 → 0.0.203

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/README.md CHANGED
@@ -211,7 +211,7 @@ Use `<DensityProvider density="desktop" touchOnMobile>` for 17px base text, 15px
211
211
 
212
212
  `useTheme()` returns `theme`, `resolvedTheme`, `setTheme`, and `preset`. Call `setTheme("light")`, `setTheme("dark")`, or `setTheme("system")` from a component inside the provider.
213
213
 
214
- Use `<ThemeProvider preset="shadcn" defaultTheme="system">` for the [default shadcn Neutral palette](https://ui.shadcn.com/docs/theming), system sans-serif text, and its rounded corner scale. The default `devhost` preset uses the package's monospace design and sharp corners. Both presets support light, dark, and system modes, including portaled content. Code retains the monospace font. Density, component composition, and package-specific status colors remain independent of the preset.
214
+ Use `<ThemeProvider preset="shadcn" defaultTheme="system">` for the [default shadcn Neutral palette](https://ui.shadcn.com/docs/theming), system sans-serif text, and its rounded corner scale. The default `devhost` preset uses the package's monospace design and sharp corners. Both presets support light, dark, and system modes, including portaled content. The Neutral preset follows upstream's token values with one exception: its light focus ring is `oklch(0.556 0 0)` instead of upstream's `oklch(0.708 0 0)`, because upstream's measures about 2.6:1 on white and a focus indicator needs at least 3:1 (WCAG 2.2 SC 1.4.11). Code retains the monospace font. Density, component composition, and package-specific status colors remain independent of the preset.
215
215
 
216
216
  The preset is controlled by the prop; changing it updates the document without changing the saved color-mode preference. Persist that prop in your application if needed. Storybook exposes the same choice in its **Design** toolbar. For a page styled before React mounts, set `data-theme-preset="shadcn"` and `data-theme="light"` or `"dark"` on `<html>` to match the provider. The existing `theme.css` import and `@source` setup cover both presets.
217
217
 
@@ -91,7 +91,7 @@ function Chart3({
91
91
  "data-density": resolvedDensity,
92
92
  "data-slot": "chart",
93
93
  "data-chart": chartId,
94
- className: cn2("flex aspect-video min-w-0 justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", height !== undefined && "aspect-auto w-full", className),
94
+ className: cn2("flex aspect-video min-w-0 justify-center text-xs [&_.recharts-cartesian-axis-tick-value]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", height !== undefined && "aspect-auto w-full", className),
95
95
  style: height === undefined ? style : { ...style, height },
96
96
  ...props,
97
97
  children: [
@@ -3710,6 +3710,45 @@ function ToolbarToggleChip2({
3710
3710
  if (!spaceActivates && event.key === " ")
3711
3711
  event.preventDefault();
3712
3712
  };
3713
+ const swatchMark = swatch && /* @__PURE__ */ jsx37("span", {
3714
+ "aria-hidden": "true",
3715
+ className: cn2("inline-block size-3 shrink-0 overflow-hidden", !hideLabel && "me-1.5 align-[calc(0.5cap-0.375rem)]"),
3716
+ children: /* @__PURE__ */ jsxs24("span", {
3717
+ "data-slot": "toolbar-toggle-chip-swatch",
3718
+ className: "relative block size-full rounded-sm border border-media-edge",
3719
+ style: { backgroundColor: swatch },
3720
+ children: [
3721
+ pressed === true && /* @__PURE__ */ jsxs24("span", {
3722
+ "data-slot": "toolbar-toggle-chip-check",
3723
+ className: "absolute -inset-px grid place-items-center",
3724
+ children: [
3725
+ /* @__PURE__ */ jsx37(CheckIcon3, {
3726
+ strokeWidth: 6,
3727
+ className: "col-start-1 row-start-1 size-3 text-background"
3728
+ }),
3729
+ /* @__PURE__ */ jsx37(CheckIcon3, {
3730
+ strokeWidth: 3,
3731
+ className: "col-start-1 row-start-1 size-3 text-foreground"
3732
+ })
3733
+ ]
3734
+ }),
3735
+ pressed === "mixed" && /* @__PURE__ */ jsxs24("span", {
3736
+ "data-slot": "toolbar-toggle-chip-mixed",
3737
+ className: "absolute -inset-px grid place-items-center",
3738
+ children: [
3739
+ /* @__PURE__ */ jsx37(MinusIcon, {
3740
+ strokeWidth: 6,
3741
+ className: "col-start-1 row-start-1 size-3 text-background"
3742
+ }),
3743
+ /* @__PURE__ */ jsx37(MinusIcon, {
3744
+ strokeWidth: 3,
3745
+ className: "col-start-1 row-start-1 size-3 text-foreground"
3746
+ })
3747
+ ]
3748
+ })
3749
+ ]
3750
+ })
3751
+ });
3713
3752
  const button = /* @__PURE__ */ jsxs24(ToolbarPrimitive.Button, {
3714
3753
  "data-density": density,
3715
3754
  "data-slot": "toolbar-toggle-chip",
@@ -3729,34 +3768,36 @@ function ToolbarToggleChip2({
3729
3768
  trackedChange(pressed !== true);
3730
3769
  },
3731
3770
  children: [
3732
- !swatch && !hideLabel && /* @__PURE__ */ jsxs24("span", {
3733
- "aria-hidden": "true",
3734
- className: "grid size-3.5 shrink-0 place-items-center",
3771
+ hideLabel && swatchMark,
3772
+ /* @__PURE__ */ jsxs24("span", {
3773
+ className: hideLabel ? "sr-only" : "min-w-0 truncate",
3735
3774
  children: [
3736
- pressed === true && /* @__PURE__ */ jsx37(CheckIcon3, {
3737
- "data-slot": "toolbar-toggle-chip-check",
3738
- className: "size-3.5"
3739
- }),
3740
- pressed === "mixed" && /* @__PURE__ */ jsx37(MinusIcon, {
3741
- "data-slot": "toolbar-toggle-chip-mixed",
3742
- className: "size-3.5"
3775
+ !hideLabel && swatchMark,
3776
+ !swatch && !hideLabel && /* @__PURE__ */ jsx37("span", {
3777
+ "aria-hidden": "true",
3778
+ "data-slot": "toolbar-toggle-chip-state",
3779
+ className: "me-1.5 inline-block size-3.5 overflow-hidden align-[calc(0.5cap-0.4375rem)]",
3780
+ children: /* @__PURE__ */ jsxs24("span", {
3781
+ className: "grid size-full place-items-center",
3782
+ children: [
3783
+ pressed === true && /* @__PURE__ */ jsx37(CheckIcon3, {
3784
+ "data-slot": "toolbar-toggle-chip-check",
3785
+ className: "size-3.5"
3786
+ }),
3787
+ pressed === "mixed" && /* @__PURE__ */ jsx37(MinusIcon, {
3788
+ "data-slot": "toolbar-toggle-chip-mixed",
3789
+ className: "size-3.5"
3790
+ }),
3791
+ pressed === false && /* @__PURE__ */ jsx37("span", {
3792
+ "data-slot": "toolbar-toggle-chip-indicator",
3793
+ className: "size-2.5 rounded-full border border-current/70"
3794
+ })
3795
+ ]
3796
+ })
3743
3797
  }),
3744
- pressed === false && /* @__PURE__ */ jsx37("span", {
3745
- "data-slot": "toolbar-toggle-chip-indicator",
3746
- className: "size-2.5 rounded-full border border-current/70"
3747
- })
3798
+ children
3748
3799
  ]
3749
3800
  }),
3750
- swatch && /* @__PURE__ */ jsx37("span", {
3751
- "aria-hidden": "true",
3752
- "data-slot": "toolbar-toggle-chip-swatch",
3753
- className: "size-3 shrink-0 rounded-sm border border-border",
3754
- style: { backgroundColor: swatch }
3755
- }),
3756
- /* @__PURE__ */ jsx37("span", {
3757
- className: hideLabel ? "sr-only" : "min-w-0 truncate",
3758
- children
3759
- }),
3760
3801
  detail !== undefined && /* @__PURE__ */ jsxs24("span", {
3761
3802
  "data-slot": "toolbar-toggle-chip-detail",
3762
3803
  className: "text-xs text-muted-foreground",
@@ -12,7 +12,7 @@ import {
12
12
  Chart3,
13
13
  ChartTooltipContent2,
14
14
  ChartTooltip2
15
- } from "./chunk-6fvcqd48.js";
15
+ } from "./chunk-1pm10n0c.js";
16
16
  import {
17
17
  take
18
18
  } from "./chunk-v8ks0cfq.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  Chart2
3
- } from "../../../chunk-mwgnsjac.js";
3
+ } from "../../../chunk-wn906bmh.js";
4
4
  import"../../../chunk-jc3cbwyg.js";
5
- import"../../../chunk-6fvcqd48.js";
5
+ import"../../../chunk-1pm10n0c.js";
6
6
  import"../../../chunk-tcefvfr8.js";
7
7
  import"../../../chunk-jpvw9xqy.js";
8
8
  import"../../../chunk-e6hk39ev.js";
@@ -53,10 +53,10 @@ import {
53
53
  CanvasSplitLine2
54
54
  } from "../../chunk-mbsfhffg.js";
55
55
  import"../../chunk-tcefvfr8.js";
56
- import"../../chunk-6fvcqd48.js";
56
+ import"../../chunk-1pm10n0c.js";
57
57
  import {
58
58
  Chart2
59
- } from "../../chunk-mwgnsjac.js";
59
+ } from "../../chunk-wn906bmh.js";
60
60
  import"../../chunk-t9ms87s9.js";
61
61
  import"../../chunk-vfgp11y4.js";
62
62
  import"../../chunk-zg00dqe8.js";
@@ -13,8 +13,13 @@ type AnalyticsChartProps = IDensityProps & {
13
13
  index: string;
14
14
  series: readonly AnalyticsSeries[];
15
15
  valueFormatter?: (value: number) => string;
16
+ /**
17
+ * Where the value axis starts. `"zero"` (the default) suits bars and totals; `"data"` fits the axis to the values, so a
18
+ * change of a few units in a series far from zero stays visible. A chart with a bar series always starts at zero.
19
+ */
20
+ baseline?: "zero" | "data";
16
21
  };
17
- declare function AnalyticsChart({ label, data, index, series, valueFormatter, showDots, density, }: AnalyticsChartProps): ReactElement;
22
+ declare function AnalyticsChart({ label, data, index, series, valueFormatter, showDots, baseline, density, }: AnalyticsChartProps): ReactElement;
18
23
  type SparklineProps = IDensityProps & {
19
24
  label: string;
20
25
  values: readonly number[];
@@ -9,14 +9,55 @@ import {
9
9
  ChartLegendContent2,
10
10
  ChartTooltip2,
11
11
  ChartLegend2
12
- } from "../../chunk-6fvcqd48.js";
12
+ } from "../../chunk-1pm10n0c.js";
13
13
  import"../../chunk-e6hk39ev.js";
14
14
  import"../../chunk-en44w1pn.js";
15
15
  import"../../chunk-jpvw9xqy.js";
16
16
  import"../../chunk-5mydsjp3.js";
17
17
  // src/components/chart/AnalyticsChart.tsx
18
- import { Area, Bar, CartesianGrid, ComposedChart, Line, XAxis, YAxis } from "recharts";
18
+ import { Area, Bar, CartesianGrid, ComposedChart, Line, XAxis, YAxis, usePlotArea } from "recharts";
19
19
  import { jsx, jsxs } from "react/jsx-runtime";
20
+ var INDEX_TICK_MARGIN = 10;
21
+ var INDEX_TICK_GAP = 16;
22
+ function niceStep(rough) {
23
+ const power = 10 ** Math.floor(Math.log10(rough));
24
+ return ([1, 2, 5, 10].find((multiple) => multiple * power >= rough) ?? 10) * power;
25
+ }
26
+ function fitValueAxis(data, keys) {
27
+ const values = data.flatMap((row) => keys.map((key) => row[key]).filter((value) => typeof value === "number"));
28
+ if (!values.length)
29
+ return;
30
+ const [low, high] = [Math.min(...values), Math.max(...values)];
31
+ const margin = (high - low) / 4 || Math.abs(high) / 10 || 1;
32
+ const step = niceStep((high - low + 2 * margin) / 4);
33
+ const [start, end] = [Math.floor((low - margin) / step) * step, Math.ceil((high + margin) / step) * step];
34
+ const ticks = Array.from({ length: Math.round((end - start) / step) + 1 }, (_, i) => start + i * step);
35
+ return { domain: [start, end], ticks };
36
+ }
37
+ function usePointSpacing(count) {
38
+ const area = usePlotArea();
39
+ return area && count > 1 ? area.width / (count - 1) : Number.POSITIVE_INFINITY;
40
+ }
41
+ function SeriesMarks({ item, color, showDots, count }) {
42
+ const spacing = usePointSpacing(count);
43
+ const dot = showDots && { r: Math.min(3, Math.max(1.5, spacing / 4)) };
44
+ return item.type === "area" ? /* @__PURE__ */ jsx(Area, {
45
+ dataKey: item.key,
46
+ stroke: color,
47
+ fill: color,
48
+ fillOpacity: 0.15,
49
+ dot,
50
+ connectNulls: false,
51
+ stackId: item.stackId,
52
+ isAnimationActive: false
53
+ }) : /* @__PURE__ */ jsx(Line, {
54
+ dataKey: item.key,
55
+ stroke: color,
56
+ dot,
57
+ connectNulls: false,
58
+ isAnimationActive: false
59
+ });
60
+ }
20
61
  function AnalyticsChart({
21
62
  label,
22
63
  data,
@@ -24,9 +65,12 @@ function AnalyticsChart({
24
65
  series,
25
66
  valueFormatter,
26
67
  showDots = false,
68
+ baseline = "zero",
27
69
  density
28
70
  }) {
29
71
  const config = Object.fromEntries(series.map((item) => [item.key, { label: item.label }]));
72
+ const hasBars = series.some((item) => item.type === "bar");
73
+ const valueAxis = baseline === "data" && !hasBars ? fitValueAxis(data, series.map((item) => item.key)) : undefined;
30
74
  return /* @__PURE__ */ jsx(Chart3, {
31
75
  role: "region",
32
76
  "aria-label": label,
@@ -43,19 +87,24 @@ function AnalyticsChart({
43
87
  /* @__PURE__ */ jsx(XAxis, {
44
88
  dataKey: index,
45
89
  tickLine: false,
46
- axisLine: false
90
+ axisLine: false,
91
+ interval: "equidistantPreserveStart",
92
+ minTickGap: INDEX_TICK_GAP,
93
+ tickMargin: INDEX_TICK_MARGIN
47
94
  }),
48
95
  /* @__PURE__ */ jsx(YAxis, {
49
96
  tickLine: false,
50
97
  axisLine: false,
51
- tickFormatter: valueFormatter
98
+ tickFormatter: valueFormatter,
99
+ domain: valueAxis?.domain,
100
+ ticks: valueAxis?.ticks
52
101
  }),
53
102
  /* @__PURE__ */ jsx(ChartTooltip2, {
54
103
  content: /* @__PURE__ */ jsx(ChartTooltipContent2, {
55
104
  valueFormatter
56
105
  })
57
106
  }),
58
- /* @__PURE__ */ jsx(ChartLegend2, {
107
+ series.length > 1 && /* @__PURE__ */ jsx(ChartLegend2, {
59
108
  content: /* @__PURE__ */ jsx(ChartLegendContent2, {})
60
109
  }),
61
110
  series.map((item, i) => item.type === "bar" ? /* @__PURE__ */ jsx(Bar, {
@@ -63,21 +112,11 @@ function AnalyticsChart({
63
112
  fill: `var(--chart-${i % 5 + 1})`,
64
113
  stackId: item.stackId,
65
114
  isAnimationActive: false
66
- }, item.key) : item.type === "area" ? /* @__PURE__ */ jsx(Area, {
67
- dataKey: item.key,
68
- stroke: `var(--chart-${i % 5 + 1})`,
69
- fill: `var(--chart-${i % 5 + 1})`,
70
- fillOpacity: 0.15,
71
- dot: showDots,
72
- connectNulls: false,
73
- stackId: item.stackId,
74
- isAnimationActive: false
75
- }, item.key) : /* @__PURE__ */ jsx(Line, {
76
- dataKey: item.key,
77
- stroke: `var(--chart-${i % 5 + 1})`,
78
- dot: showDots,
79
- connectNulls: false,
80
- isAnimationActive: false
115
+ }, item.key) : /* @__PURE__ */ jsx(SeriesMarks, {
116
+ item,
117
+ color: `var(--chart-${i % 5 + 1})`,
118
+ showDots,
119
+ count: data.length
81
120
  }, item.key))
82
121
  ]
83
122
  })
@@ -26,7 +26,7 @@ import {
26
26
  PaginationPrevious2,
27
27
  PaginationNext2,
28
28
  PaginationEllipsis2
29
- } from "../../chunk-3d6ctgyx.js";
29
+ } from "../../chunk-hcptnha3.js";
30
30
  import {
31
31
  MenuPopup,
32
32
  MenuItem2,
package/dist/index.js CHANGED
@@ -188,7 +188,7 @@ import {
188
188
  DashboardLayout2,
189
189
  BillingUsage2,
190
190
  SelectionAction2
191
- } from "./chunk-3d6ctgyx.js";
191
+ } from "./chunk-hcptnha3.js";
192
192
  import {
193
193
  statusDotVariants2,
194
194
  StatusDot2
package/dist/prototype.js CHANGED
@@ -2051,7 +2051,7 @@ var program = new Command;
2051
2051
  // package.json
2052
2052
  var package_default = {
2053
2053
  name: "@alexgorbatchev/shadcn",
2054
- version: "0.0.201",
2054
+ version: "0.0.203",
2055
2055
  description: "Sharp, monospace React components with compact, comfortable, and touch densities.",
2056
2056
  license: "MIT",
2057
2057
  repository: {
package/dist/theme.css CHANGED
@@ -336,7 +336,9 @@
336
336
  --destructive-foreground: oklch(1 0 0);
337
337
  --border: oklch(0.922 0 0);
338
338
  --input: oklch(0.922 0 0);
339
- --ring: oklch(0.708 0 0);
339
+ /* Upstream uses oklch(0.708 0 0), about 2.6:1 on white; a focus indicator needs 3:1 (WCAG 2.2 SC 1.4.11), so this
340
+ takes the darkest upstream neutral step that clears it, about 4.7:1 (README, design presets). */
341
+ --ring: oklch(0.556 0 0);
340
342
  --chart-1: oklch(0.646 0.222 41.116);
341
343
  --chart-2: oklch(0.6 0.118 184.704);
342
344
  --chart-3: oklch(0.398 0.07 227.392);
@@ -349,7 +351,7 @@
349
351
  --sidebar-accent: oklch(0.97 0 0);
350
352
  --sidebar-accent-foreground: oklch(0.205 0 0);
351
353
  --sidebar-border: oklch(0.922 0 0);
352
- --sidebar-ring: oklch(0.708 0 0);
354
+ --sidebar-ring: oklch(0.556 0 0);
353
355
  }
354
356
 
355
357
  /* With Increase contrast (prefers-contrast: more), dividers and card and table borders take the input border colour,
@@ -560,3 +560,29 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
560
560
  </div>)
561
561
  }
562
562
  ```
563
+
564
+ ### FocusIndicatorNeutralDark
565
+
566
+ ```tsx
567
+ {
568
+ globals: { theme: "dark", density: "comfortable", preset: "shadcn" },
569
+ render: () => (<div className="flex flex-wrap items-center gap-4 p-panel">
570
+ {filledVariants.map((variant) => (<Button key={variant} variant={variant}>
571
+ {`Focus ${variant}`}
572
+ </Button>))}
573
+ </div>)
574
+ }
575
+ ```
576
+
577
+ ### FocusIndicatorNeutralLight
578
+
579
+ ```tsx
580
+ {
581
+ globals: { theme: "light", density: "comfortable", preset: "shadcn" },
582
+ render: () => (<div className="flex flex-wrap items-center gap-4 p-panel">
583
+ {filledVariants.map((variant) => (<Button key={variant} variant={variant}>
584
+ {`Focus ${variant}`}
585
+ </Button>))}
586
+ </div>)
587
+ }
588
+ ```
@@ -141,6 +141,37 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
141
141
  }
142
142
  ```
143
143
 
144
+ ### SwatchStates
145
+
146
+ ```tsx
147
+ {
148
+ render: function Example(): ReactElement {
149
+ return (<Toolbar aria-label="Colors">
150
+ <ControlledChip label="Red" swatch="#e5484d" hideLabel/>
151
+ <ControlledChip label="Yellow" swatch="#ffe629" hideLabel/>
152
+ <ControlledChip label="Navy" swatch="#1b2a4a"/>
153
+ </Toolbar>);
154
+ }
155
+ }
156
+ ```
157
+
158
+ ### IndicatorOnCaps
159
+
160
+ ```tsx
161
+ {
162
+ render: () => alignedChips
163
+ }
164
+ ```
165
+
166
+ ### IndicatorOnCapsNeutral
167
+
168
+ ```tsx
169
+ {
170
+ globals: { preset: "shadcn" },
171
+ render: () => alignedChips
172
+ }
173
+ ```
174
+
144
175
  ### StableAcrossStates
145
176
 
146
177
  ```tsx
@@ -80,3 +80,41 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
80
80
  }
81
81
  }
82
82
  ```
83
+
84
+ ### DatedSeries
85
+
86
+ ```tsx
87
+ {
88
+ args: {
89
+ label: "Sleep duration",
90
+ index: "date",
91
+ data: nights,
92
+ series: [{ key: "minutes", label: "Sleep duration" }],
93
+ showDots: true,
94
+ baseline: "data",
95
+ valueFormatter: (value) => `${Math.round(value)} min`,
96
+ },
97
+ render: (args) => (<div style={{ width: 448 }}>
98
+ <AnalyticsChart {...args}/>
99
+ </div>)
100
+ }
101
+ ```
102
+
103
+ ### DatedSeriesOnPhone
104
+
105
+ ```tsx
106
+ {
107
+ args: {
108
+ label: "Sleep duration",
109
+ index: "date",
110
+ data: nights,
111
+ series: [{ key: "minutes", label: "Sleep duration" }],
112
+ showDots: true,
113
+ baseline: "data",
114
+ valueFormatter: (value) => `${Math.round(value)} min`,
115
+ },
116
+ render: (args) => (<div style={{ width: 310 }}>
117
+ <AnalyticsChart {...args}/>
118
+ </div>)
119
+ }
120
+ ```
package/llms/setup.md CHANGED
@@ -211,7 +211,7 @@ Use `<DensityProvider density="desktop" touchOnMobile>` for 17px base text, 15px
211
211
 
212
212
  `useTheme()` returns `theme`, `resolvedTheme`, `setTheme`, and `preset`. Call `setTheme("light")`, `setTheme("dark")`, or `setTheme("system")` from a component inside the provider.
213
213
 
214
- Use `<ThemeProvider preset="shadcn" defaultTheme="system">` for the [default shadcn Neutral palette](https://ui.shadcn.com/docs/theming), system sans-serif text, and its rounded corner scale. The default `devhost` preset uses the package's monospace design and sharp corners. Both presets support light, dark, and system modes, including portaled content. Code retains the monospace font. Density, component composition, and package-specific status colors remain independent of the preset.
214
+ Use `<ThemeProvider preset="shadcn" defaultTheme="system">` for the [default shadcn Neutral palette](https://ui.shadcn.com/docs/theming), system sans-serif text, and its rounded corner scale. The default `devhost` preset uses the package's monospace design and sharp corners. Both presets support light, dark, and system modes, including portaled content. The Neutral preset follows upstream's token values with one exception: its light focus ring is `oklch(0.556 0 0)` instead of upstream's `oklch(0.708 0 0)`, because upstream's measures about 2.6:1 on white and a focus indicator needs at least 3:1 (WCAG 2.2 SC 1.4.11). Code retains the monospace font. Density, component composition, and package-specific status colors remain independent of the preset.
215
215
 
216
216
  The preset is controlled by the prop; changing it updates the document without changing the saved color-mode preference. Persist that prop in your application if needed. Storybook exposes the same choice in its **Design** toolbar. For a page styled before React mounts, set `data-theme-preset="shadcn"` and `data-theme="light"` or `"dark"` on `<html>` to match the provider. The existing `theme.css` import and `@source` setup cover both presets.
217
217
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexgorbatchev/shadcn",
3
- "version": "0.0.201",
3
+ "version": "0.0.203",
4
4
  "description": "Sharp, monospace React components with compact, comfortable, and touch densities.",
5
5
  "license": "MIT",
6
6
  "repository": {