@alexgorbatchev/shadcn 0.0.59 → 0.0.61

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
@@ -275,7 +275,7 @@ The npm package includes the same index at `llms.txt` in its root and its linked
275
275
  | Conversations | Attachment, Bubble, Marker, Message, MessageScroller |
276
276
  | App configuration | DensityProvider, DirectionProvider, ThemeProvider |
277
277
 
278
- Use the composed parts exported from the package root, such as `DialogTrigger`, `DialogContent`, and `DialogTitle`. Storybook provides working compositions, variants, disabled states, and action callbacks. The local preview starts with `bun run storybook` and binds to `127.0.0.1:6006`.
278
+ Use the composed parts exported from the package root, such as `DialogTrigger`, `DialogContent`, and `DialogTitle`. Storybook provides working compositions, variants, disabled states, and action callbacks. The local preview starts with `just storybook` and binds to `127.0.0.1:6006`.
279
279
 
280
280
  Set `wrap` on `ItemTitle` to keep complete titles visible in narrow items, including long names without spaces. The default title presentation remains unchanged.
281
281
 
@@ -329,7 +329,7 @@ Use the Theme toolbar to select light, dark, or system palettes; Docs and exampl
329
329
 
330
330
  `Carousel` supports horizontal, vertical, and right-to-left navigation. Focus its named region to use the arrow keys; arrow keys inside slide inputs retain their input behavior. Supply `opts` and `plugins` for carousel configuration, and `setApi` to receive its API. Reduced-motion preference disables programmatic slide animation.
331
331
 
332
- Compose `ChartContainer`, `ChartTooltip`, and `ChartLegend` with Recharts components. Import the chart parts from `@alexgorbatchev/shadcn/chart` and install its peers listed above. Give the container a height or aspect ratio; `ChartConfig` supplies series labels, icons, and either one color or light/dark colors. Use semantic values such as `var(--primary)` and keep `accessibilityLayer` enabled for keyboard tooltips. Use `labelKey` and `nameKey` for custom tooltip data, and legend content's `nameKey` for custom legend labels. Keep series selection in application state; the tooltip's `defaultIndex` only sets its initial state.
332
+ Compose `ChartContainer`, `ChartTooltip`, and `ChartLegend` with Recharts components. Import the chart parts from `@alexgorbatchev/shadcn/chart` and install its peers listed above. The container keeps a 16:9 aspect ratio by default; give it `height` (such as `192` or `"12rem"`) to fill the available width at that height instead. `ChartConfig` supplies series labels, icons, and either one color or light/dark colors. Use semantic values such as `var(--primary)` and keep `accessibilityLayer` enabled for keyboard tooltips. Use `labelKey` and `nameKey` for custom tooltip data, and legend content's `nameKey` for custom legend labels. Keep series selection in application state; the tooltip's `defaultIndex` only sets its initial state.
333
333
 
334
334
  Supply HTML attributes and refs to tooltip or legend content through `htmlProps`; Recharts injects its own chart props into those content components, so those props do not go to the DOM. An `onClick` legend callback renders keyboard-accessible buttons. Omit the tooltip's `portal` prop for native floating positioning; custom portal targets own their positioning through the native `wrapperStyle` API. Tooltip and legend content preserve chart density, direction and configured colors through portals. A container's `dir` overrides DirectionProvider context, and content's `htmlProps.dir` overrides the chart direction. Reverse Recharts' `XAxis` explicitly for RTL data ordering; native keyboard movement follows that axis. See the [Chart guide](https://ui.shadcn.com/docs/components/base/chart).
335
335
 
@@ -74,6 +74,8 @@ function Chart3({
74
74
  children,
75
75
  config,
76
76
  initialDimension = { width: 320, height: 200 },
77
+ height,
78
+ style,
77
79
  ...props
78
80
  }) {
79
81
  const uniqueId = useId();
@@ -89,7 +91,8 @@ function Chart3({
89
91
  "data-density": resolvedDensity,
90
92
  "data-slot": "chart",
91
93
  "data-chart": chartId,
92
- 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", className),
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),
95
+ style: height === undefined ? style : { ...style, height },
93
96
  ...props,
94
97
  children: [
95
98
  /* @__PURE__ */ jsx2(ChartStyle2, {
@@ -12,7 +12,7 @@ import {
12
12
  Chart3,
13
13
  ChartTooltipContent2,
14
14
  ChartTooltip2
15
- } from "./chunk-ddbc17b4.js";
15
+ } from "./chunk-6fvcqd48.js";
16
16
  import {
17
17
  take
18
18
  } from "./chunk-v8ks0cfq.js";
@@ -4151,9 +4151,10 @@ function BarList2({
4151
4151
  value: item.value,
4152
4152
  "aria-label": item.label,
4153
4153
  format: { maximumFractionDigits: 2 },
4154
+ className: "gap-y-1",
4154
4155
  children: [
4155
4156
  /* @__PURE__ */ jsxs29("div", {
4156
- className: "mb-1 flex items-center justify-between gap-3 text-sm",
4157
+ className: "flex w-full items-center justify-between gap-3 text-sm",
4157
4158
  children: [
4158
4159
  /* @__PURE__ */ jsx44(MeterLabel2, {
4159
4160
  children: onItemSelect ? /* @__PURE__ */ jsx44(Button2, {
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  Chart2
3
- } from "../../../chunk-nrdc4t48.js";
3
+ } from "../../../chunk-6grp5fhy.js";
4
4
  import"../../../chunk-k1f35j55.js";
5
- import"../../../chunk-ddbc17b4.js";
5
+ import"../../../chunk-6fvcqd48.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-424xrf3x.js";
55
55
  import"../../chunk-tcefvfr8.js";
56
- import"../../chunk-ddbc17b4.js";
56
+ import"../../chunk-6fvcqd48.js";
57
57
  import {
58
58
  Chart2
59
- } from "../../chunk-nrdc4t48.js";
59
+ } from "../../chunk-6grp5fhy.js";
60
60
  import"../../chunk-7vg045gd.js";
61
61
  import"../../chunk-er6e5fj8.js";
62
62
  import"../../chunk-rxjxb4vy.js";
@@ -2,7 +2,7 @@ import type { ReactElement } from "react";
2
2
  import type { ChartProps, ChartTooltipContentProps, ChartLegendContentProps } from "./types.js";
3
3
  import { Tooltip } from "recharts";
4
4
  import { ChartStyle } from "./ChartStyle.js";
5
- declare function Chart({ id, dir, density, className, children, config, initialDimension, ...props }: ChartProps): ReactElement;
5
+ declare function Chart({ id, dir, density, className, children, config, initialDimension, height, style, ...props }: ChartProps): ReactElement;
6
6
  declare function ChartTooltipContent({ density, active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, valueFormatter, labelClassName, formatter, color, nameKey, labelKey, htmlProps, contentStyle, itemStyle, labelStyle, wrapperClassName, itemSorter, }: ChartTooltipContentProps): ReactElement | null;
7
7
  declare function ChartLegendContent({ density, className, hideIcon, payload, verticalAlign, nameKey, onClick, onMouseEnter, onMouseLeave, formatter, htmlProps, labelStyle, inactiveColor, }: ChartLegendContentProps): ReactElement | null;
8
8
  declare const ChartTooltip: typeof Tooltip;
@@ -9,7 +9,7 @@ import {
9
9
  ChartLegendContent2,
10
10
  ChartTooltip2,
11
11
  ChartLegend2
12
- } from "../../chunk-ddbc17b4.js";
12
+ } from "../../chunk-6fvcqd48.js";
13
13
  import"../../chunk-e6hk39ev.js";
14
14
  import"../../chunk-en44w1pn.js";
15
15
  import"../../chunk-jpvw9xqy.js";
@@ -22,6 +22,8 @@ export type ChartProps = ComponentProps<"div"> & IDensityProps & {
22
22
  config: ChartConfig;
23
23
  children: ComponentProps<typeof ResponsiveContainer>["children"];
24
24
  initialDimension?: ComponentProps<typeof ResponsiveContainer>["initialDimension"];
25
+ /** A fixed height, such as `192` or `"12rem"`; the chart then fills the available width instead of keeping 16:9. */
26
+ height?: CSSProperties["height"];
25
27
  };
26
28
  export type ChartStyleProps = {
27
29
  id: string;
@@ -31,7 +31,7 @@ import {
31
31
  DrawerHeader2,
32
32
  DrawerTitle2,
33
33
  DrawerDescription2
34
- } from "../../chunk-zwnba1pb.js";
34
+ } from "../../chunk-hz08pzsc.js";
35
35
  import {
36
36
  MenuPopup,
37
37
  MenuItem2,
package/dist/index.js CHANGED
@@ -171,7 +171,7 @@ import {
171
171
  StatusTracker2,
172
172
  DashboardLayout2,
173
173
  BillingUsage2
174
- } from "./chunk-zwnba1pb.js";
174
+ } from "./chunk-hz08pzsc.js";
175
175
  import {
176
176
  Tabs2,
177
177
  tabsListVariants2,
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.59",
2054
+ version: "0.0.61",
2055
2055
  description: "Sharp, monospace React components with compact and comfortable densities.",
2056
2056
  license: "MIT",
2057
2057
  repository: {
@@ -3105,26 +3105,6 @@ var package_default = {
3105
3105
  access: "public",
3106
3106
  registry: "https://registry.npmjs.org/"
3107
3107
  },
3108
- scripts: {
3109
- test: "vitest run --config .storybook/vitest.config.ts && bun run test:native && bun run test:package",
3110
- "test:package": "NODE_DISABLE_COMPILE_CACHE=1 bun scripts/runTestSuite.ts package",
3111
- "test:preview": "NODE_DISABLE_COMPILE_CACHE=1 bun scripts/runTestSuite.ts preview",
3112
- "test:prototype": "NODE_DISABLE_COMPILE_CACHE=1 bun scripts/runTestSuite.ts prototype",
3113
- "test:cli": "NODE_DISABLE_COMPILE_CACHE=1 bun scripts/runTestSuite.ts cli",
3114
- "test:native": "vitest run --config .storybook/vitest.native.config.ts",
3115
- "test:coverage": "vitest run --config .storybook/vitest.coverage.config.ts --coverage",
3116
- "test:contrast": "vitest run --config .storybook/vitest.contrast.config.ts",
3117
- build: "bun scripts/build.ts",
3118
- typecheck: "tsc --noEmit",
3119
- lint: "oxlint --deny-warnings src .storybook scripts cli templates/prototype/src templates/prototype/vite.config.ts && oxfmt --check . && bun run lint:unused",
3120
- "lint:unused": "ts-unused check tsconfig.json",
3121
- storybook: "bun scripts/buildLlmDocs.ts && storybook dev --host 127.0.0.1 -p 6006 --no-open",
3122
- "build-storybook": "NODE_DISABLE_COMPILE_CACHE=1 bun scripts/runTestSuite.ts storybook",
3123
- prepack: "bun run build",
3124
- "test:reduced-motion": "vitest run --config .storybook/vitest.reduced-motion.config.ts",
3125
- "test:visual": "vitest run --config .storybook/vitest.visual.config.ts Button.stories.tsx Badge.stories.tsx Card.stories.tsx Input.stories.tsx ScrollArea.stories.tsx",
3126
- "test:visual:update": "bun run test:visual --update"
3127
- },
3128
3108
  devDependencies: {
3129
3109
  "@assistant-ui/ai-sdk": "0.0.14",
3130
3110
  "@assistant-ui/generative-ui": "0.0.6",
@@ -3197,7 +3177,7 @@ var package_default = {
3197
3177
  oxfmt: "^0.72.0",
3198
3178
  oxlint: "^1.87.0",
3199
3179
  "parse-diff": "0.12.0",
3200
- playwright: "^1.64.0",
3180
+ playwright: "1.64.1",
3201
3181
  "react-big-calendar": "1.20.0",
3202
3182
  "react-colorful": "5.8.1",
3203
3183
  "react-dropzone": "20.1.4",
@@ -41,6 +41,14 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
41
41
  }
42
42
  ```
43
43
 
44
+ ### Layout
45
+
46
+ ```tsx
47
+ {
48
+ args: { onItemSelect: undefined }
49
+ }
50
+ ```
51
+
44
52
  ### Empty
45
53
 
46
54
  ```tsx
@@ -113,6 +113,27 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
113
113
  }
114
114
  ```
115
115
 
116
+ ### FixedHeight
117
+
118
+ ```tsx
119
+ {
120
+ args: { className: undefined, height: 192 },
121
+ render: function Render(args) {
122
+ const [isWide, setWide] = useState(false);
123
+ return (<>
124
+ <Button onClick={() => setWide(!isWide)}>Resize chart</Button>
125
+ <div className={isWide ? "w-96" : "w-64"}>
126
+ <ChartContainer {...args}>
127
+ <BarChart accessibilityLayer data={data}>
128
+ <Bar dataKey="desktop" fill="var(--color-desktop)" isAnimationActive={false}/>
129
+ </BarChart>
130
+ </ChartContainer>
131
+ </div>
132
+ </>);
133
+ }
134
+ }
135
+ ```
136
+
116
137
  ### ResponsiveGrid
117
138
 
118
139
  ```tsx
package/llms/setup.md CHANGED
@@ -275,7 +275,7 @@ The npm package includes the same index at `llms.txt` in its root and its linked
275
275
  | Conversations | Attachment, Bubble, Marker, Message, MessageScroller |
276
276
  | App configuration | DensityProvider, DirectionProvider, ThemeProvider |
277
277
 
278
- Use the composed parts exported from the package root, such as `DialogTrigger`, `DialogContent`, and `DialogTitle`. Storybook provides working compositions, variants, disabled states, and action callbacks. The local preview starts with `bun run storybook` and binds to `127.0.0.1:6006`.
278
+ Use the composed parts exported from the package root, such as `DialogTrigger`, `DialogContent`, and `DialogTitle`. Storybook provides working compositions, variants, disabled states, and action callbacks. The local preview starts with `just storybook` and binds to `127.0.0.1:6006`.
279
279
 
280
280
  Set `wrap` on `ItemTitle` to keep complete titles visible in narrow items, including long names without spaces. The default title presentation remains unchanged.
281
281
 
@@ -329,7 +329,7 @@ Use the Theme toolbar to select light, dark, or system palettes; Docs and exampl
329
329
 
330
330
  `Carousel` supports horizontal, vertical, and right-to-left navigation. Focus its named region to use the arrow keys; arrow keys inside slide inputs retain their input behavior. Supply `opts` and `plugins` for carousel configuration, and `setApi` to receive its API. Reduced-motion preference disables programmatic slide animation.
331
331
 
332
- Compose `ChartContainer`, `ChartTooltip`, and `ChartLegend` with Recharts components. Import the chart parts from `@alexgorbatchev/shadcn/chart` and install its peers listed above. Give the container a height or aspect ratio; `ChartConfig` supplies series labels, icons, and either one color or light/dark colors. Use semantic values such as `var(--primary)` and keep `accessibilityLayer` enabled for keyboard tooltips. Use `labelKey` and `nameKey` for custom tooltip data, and legend content's `nameKey` for custom legend labels. Keep series selection in application state; the tooltip's `defaultIndex` only sets its initial state.
332
+ Compose `ChartContainer`, `ChartTooltip`, and `ChartLegend` with Recharts components. Import the chart parts from `@alexgorbatchev/shadcn/chart` and install its peers listed above. The container keeps a 16:9 aspect ratio by default; give it `height` (such as `192` or `"12rem"`) to fill the available width at that height instead. `ChartConfig` supplies series labels, icons, and either one color or light/dark colors. Use semantic values such as `var(--primary)` and keep `accessibilityLayer` enabled for keyboard tooltips. Use `labelKey` and `nameKey` for custom tooltip data, and legend content's `nameKey` for custom legend labels. Keep series selection in application state; the tooltip's `defaultIndex` only sets its initial state.
333
333
 
334
334
  Supply HTML attributes and refs to tooltip or legend content through `htmlProps`; Recharts injects its own chart props into those content components, so those props do not go to the DOM. An `onClick` legend callback renders keyboard-accessible buttons. Omit the tooltip's `portal` prop for native floating positioning; custom portal targets own their positioning through the native `wrapperStyle` API. Tooltip and legend content preserve chart density, direction and configured colors through portals. A container's `dir` overrides DirectionProvider context, and content's `htmlProps.dir` overrides the chart direction. Reverse Recharts' `XAxis` explicitly for RTL data ordering; native keyboard movement follows that axis. See the [Chart guide](https://ui.shadcn.com/docs/components/base/chart).
335
335
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexgorbatchev/shadcn",
3
- "version": "0.0.59",
3
+ "version": "0.0.61",
4
4
  "description": "Sharp, monospace React components with compact and comfortable densities.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1054,26 +1054,6 @@
1054
1054
  "access": "public",
1055
1055
  "registry": "https://registry.npmjs.org/"
1056
1056
  },
1057
- "scripts": {
1058
- "test": "vitest run --config .storybook/vitest.config.ts && bun run test:native && bun run test:package",
1059
- "test:package": "NODE_DISABLE_COMPILE_CACHE=1 bun scripts/runTestSuite.ts package",
1060
- "test:preview": "NODE_DISABLE_COMPILE_CACHE=1 bun scripts/runTestSuite.ts preview",
1061
- "test:prototype": "NODE_DISABLE_COMPILE_CACHE=1 bun scripts/runTestSuite.ts prototype",
1062
- "test:cli": "NODE_DISABLE_COMPILE_CACHE=1 bun scripts/runTestSuite.ts cli",
1063
- "test:native": "vitest run --config .storybook/vitest.native.config.ts",
1064
- "test:coverage": "vitest run --config .storybook/vitest.coverage.config.ts --coverage",
1065
- "test:contrast": "vitest run --config .storybook/vitest.contrast.config.ts",
1066
- "build": "bun scripts/build.ts",
1067
- "typecheck": "tsc --noEmit",
1068
- "lint": "oxlint --deny-warnings src .storybook scripts cli templates/prototype/src templates/prototype/vite.config.ts && oxfmt --check . && bun run lint:unused",
1069
- "lint:unused": "ts-unused check tsconfig.json",
1070
- "storybook": "bun scripts/buildLlmDocs.ts && storybook dev --host 127.0.0.1 -p 6006 --no-open",
1071
- "build-storybook": "NODE_DISABLE_COMPILE_CACHE=1 bun scripts/runTestSuite.ts storybook",
1072
- "prepack": "bun run build",
1073
- "test:reduced-motion": "vitest run --config .storybook/vitest.reduced-motion.config.ts",
1074
- "test:visual": "vitest run --config .storybook/vitest.visual.config.ts Button.stories.tsx Badge.stories.tsx Card.stories.tsx Input.stories.tsx ScrollArea.stories.tsx",
1075
- "test:visual:update": "bun run test:visual --update"
1076
- },
1077
1057
  "devDependencies": {
1078
1058
  "@assistant-ui/ai-sdk": "0.0.14",
1079
1059
  "@assistant-ui/generative-ui": "0.0.6",
@@ -1146,7 +1126,7 @@
1146
1126
  "oxfmt": "^0.72.0",
1147
1127
  "oxlint": "^1.87.0",
1148
1128
  "parse-diff": "0.12.0",
1149
- "playwright": "^1.64.0",
1129
+ "playwright": "1.64.1",
1150
1130
  "react-big-calendar": "1.20.0",
1151
1131
  "react-colorful": "5.8.1",
1152
1132
  "react-dropzone": "20.1.4",