@alexgorbatchev/shadcn 0.0.183 → 0.0.185

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
@@ -296,7 +296,7 @@ Scrolling is intentional: cards, panels, dialogs, sheets, and floating surfaces
296
296
 
297
297
  `ThemeProvider` mounts the development-only `ScrollGuard`. Without a theme provider, mount `<ScrollGuard />` once in your app. Add `data-scroll="none"` to any HTML element to apply the same check. The guard throws a browser error identifying the element, axis, and scroll range when computed `overflow: auto` or `scroll` permits overflowing content to scroll. It checks the marked element itself, including portaled elements in the same document, after content and size changes; nested scroll viewports remain independent. Hidden and clipped overflow do not trigger it. Duplicate mounts share one observer per document, and the final unmount disconnects it. Pass `ownerDocument` to check an iframe's document; shadow roots require their own layout validation. The guard installs no observers when the consuming application's `NODE_ENV` is `"production"`.
298
298
 
299
- Every action shows a visible affordance at rest. Interactive control edges use the `input` token, which keeps 3:1 against the page in both themes; the `border` token is for decorative dividers and cards. A `ghost` Button is borderless only at the icon sizes (`icon`, `icon-xs`, `icon-sm`, `icon-lg`), where its icon identifies it; at the text sizes it keeps an `input` edge, and at `size="inline"` it takes the link colour. Use `variant="link"` for a borderless text action that should read as a link. `ToolbarButton` and `ToolbarLink` default to `variant="outline"`; pass `variant="ghost"` only for icon-only toolbar buttons. In a vertical `Toolbar`, each tool spans its group and starts its label at the shared leading edge, so a list of tools in a side panel lines up. Pressed toggles, toggle group items and toolbar buttons carry a primary edge. The Storybook test suites fail any story that renders a text-labelled Button or toolbar button with no border, no fill and no link styling.
299
+ Every action shows a visible affordance at rest. Interactive control edges use the `input` token, which keeps 3:1 against the page in both themes; the `border` token is for decorative dividers and cards. A `ghost` Button is borderless only at the icon sizes (`icon`, `icon-xs`, `icon-sm`, `icon-lg`), where its icon identifies it; at the text sizes it keeps an `input` edge, and at `size="inline"` it takes the link colour. A sortable `DataGridColumnHeader` is the exception: it keeps the header's colour and weight, and its sort icon identifies it as a control. Use `variant="link"` for a borderless text action that should read as a link. `ToolbarButton` and `ToolbarLink` default to `variant="outline"`; pass `variant="ghost"` only for icon-only toolbar buttons. In a vertical `Toolbar`, each tool spans its group and starts its label at the shared leading edge, so a list of tools in a side panel lines up. Pressed toggles, toggle group items and toolbar buttons carry a primary edge. The Storybook test suites fail any story that renders a text-labelled Button or toolbar button with no border, no fill and no link styling.
300
300
 
301
301
  `PanelHeader` heads a side panel or drawer: one row with the `title` heading (`h2` by default, `headingLevel={3}` for nested panels), an optional muted `count` and icon-button `actions` such as close, then an optional `toolbar` row holding the panel's primary and secondary actions, which wraps as one group. Pass `headingProps` for a ref, `id` or `tabIndex` when focus moves to the panel.
302
302
 
@@ -5706,12 +5706,13 @@ var componentDefinitions2 = {
5706
5706
  },
5707
5707
  Grid: {
5708
5708
  props: object({
5709
- columns: number2().nullable(),
5709
+ columns: number2().nullable().describe("The most columns to show, 1-6."),
5710
+ minColumnWidth: number2().int().min(120).max(600).nullable().optional().describe("The narrowest a column may be, in pixels (default 240). The grid shows fewer columns below it."),
5710
5711
  gap: _enum(["sm", "md", "lg", "xl"]).nullable(),
5711
5712
  className: string2().nullable().describe("Additional CSS classes")
5712
5713
  }),
5713
5714
  slots: ["default"],
5714
- description: "Grid layout (1-6 columns). Fills the width of its parent.",
5715
+ description: "Grid layout of up to 6 columns. Fills the width of its parent and stacks by its own width: it shows only as many columns as fit at minColumnWidth (default 240 px) each, so columns: 3 shows 3 columns at 744 px and wider, 2 from 492 px and 1 below.",
5715
5716
  example: { columns: 3, gap: "md" }
5716
5717
  },
5717
5718
  Separator: {
@@ -10,7 +10,7 @@ import {
10
10
  TableCell2,
11
11
  TableColumnGroup2,
12
12
  TableColumn2
13
- } from "./chunk-qn4a3gg4.js";
13
+ } from "./chunk-rf6x2h3k.js";
14
14
  import {
15
15
  OptionSelect2
16
16
  } from "./chunk-h45mqwpq.js";
@@ -343,8 +343,9 @@ function DataGridColumnHeader2({
343
343
  const sorted = column.getIsSorted();
344
344
  return column.getCanSort() ? /* @__PURE__ */ jsxs(Button2, {
345
345
  type: "button",
346
- variant: "ghost",
346
+ variant: "plain",
347
347
  size: "inline",
348
+ className: "underline-offset-4 hover:underline",
348
349
  onClick: column.getToggleSortingHandler(),
349
350
  children: [
350
351
  children,
@@ -89,7 +89,7 @@ function TableHead2({
89
89
  return /* @__PURE__ */ jsx("th", {
90
90
  "data-density": density,
91
91
  "data-slot": "table-head",
92
- className: cn2("h-control-lg px-control-x align-middle leading-(--ag-cell-leading) font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pe-0", alignmentClasses[textAlign], truncate && "truncate", visibleFrom && visibilityClasses[visibleFrom], className),
92
+ className: cn2("h-control-lg px-control-x align-middle leading-(--ag-cell-leading) font-semibold whitespace-nowrap text-foreground [&:has([role=checkbox])]:pe-0 [&_[data-slot=button]]:font-[weight:inherit]", alignmentClasses[textAlign], truncate && "truncate", visibleFrom && visibilityClasses[visibleFrom], className),
93
93
  ...props
94
94
  });
95
95
  }
@@ -2,7 +2,7 @@ import {
2
2
  Table2,
3
3
  TableHeader2,
4
4
  TableBody2
5
- } from "./chunk-qn4a3gg4.js";
5
+ } from "./chunk-rf6x2h3k.js";
6
6
 
7
7
  // src/components/virtual-table/VirtualTable.tsx
8
8
  import {
@@ -24,7 +24,7 @@ import {
24
24
  TableHead2,
25
25
  TableCell2,
26
26
  TableCaption2
27
- } from "./chunk-qn4a3gg4.js";
27
+ } from "./chunk-rf6x2h3k.js";
28
28
  import {
29
29
  safeHref
30
30
  } from "./chunk-xhtsnwnb.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  DataTable2
3
- } from "../../../chunk-t1xan6pw.js";
3
+ } from "../../../chunk-w868y7p1.js";
4
4
  import"../../../chunk-1wz92wgg.js";
5
- import"../../../chunk-qn4a3gg4.js";
5
+ import"../../../chunk-rf6x2h3k.js";
6
6
  import"../../../chunk-jc3cbwyg.js";
7
7
  import"../../../chunk-m4geb1s5.js";
8
8
  import"../../../chunk-cgj3ade2.js";
@@ -203,8 +203,8 @@ import"../../chunk-1wz92wgg.js";
203
203
  import"../../chunk-cgj3ade2.js";
204
204
  import {
205
205
  DataTable2
206
- } from "../../chunk-t1xan6pw.js";
207
- import"../../chunk-qn4a3gg4.js";
206
+ } from "../../chunk-w868y7p1.js";
207
+ import"../../chunk-rf6x2h3k.js";
208
208
  import {
209
209
  DaySeparator2
210
210
  } from "../../chunk-3j9enr2q.js";
@@ -7,7 +7,7 @@ import {
7
7
  DataGridColumnHeader2,
8
8
  DataGridFilter2,
9
9
  DataGridPagination2
10
- } from "../../chunk-pb7kvbty.js";
10
+ } from "../../chunk-r7ewxac3.js";
11
11
  import"../../chunk-7ny0vyek.js";
12
12
  import"../../chunk-8ssktt4b.js";
13
13
  import"../../chunk-en44w1pn.js";
@@ -17,7 +17,7 @@ import"../../chunk-jpvw9xqy.js";
17
17
  import {
18
18
  Button2
19
19
  } from "../../chunk-n63meq6q.js";
20
- import"../../chunk-qn4a3gg4.js";
20
+ import"../../chunk-rf6x2h3k.js";
21
21
  import"../../chunk-h45mqwpq.js";
22
22
  import"../../chunk-7jpsybag.js";
23
23
  import"../../chunk-t9ms87s9.js";
@@ -28,7 +28,7 @@ import {
28
28
  TableRow2,
29
29
  TableHead2,
30
30
  TableCell2
31
- } from "../../chunk-qn4a3gg4.js";
31
+ } from "../../chunk-rf6x2h3k.js";
32
32
  import"../../chunk-5mydsjp3.js";
33
33
 
34
34
  // src/components/gantt/Gantt.tsx
@@ -1,3 +1,8 @@
1
1
  import { type BaseComponentProps } from "@json-render/react";
2
2
  import { type JsonProps } from "./catalog.js";
3
+ /**
4
+ * A grid of at most `columns` equal columns, each at least `minColumnWidth` pixels wide: the grid shows
5
+ * min(columns, floor(width / minColumnWidth)) columns of its own width, never fewer than one, so it stacks in a narrow
6
+ * container (a phone, or a page column beside an open panel) instead of squeezing its cells.
7
+ */
3
8
  export declare const JsonGrid: ({ props, children }: BaseComponentProps<JsonProps<"Grid">>) => import("react").JSX.Element;
@@ -64,6 +64,7 @@ export declare const componentDefinitions: {
64
64
  Grid: {
65
65
  props: z.ZodObject<{
66
66
  columns: z.ZodNullable<z.ZodNumber>;
67
+ minColumnWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
67
68
  gap: z.ZodNullable<z.ZodEnum<{
68
69
  sm: "sm";
69
70
  lg: "lg";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  componentDefinitions2
3
- } from "../../chunk-h1b1mqnc.js";
3
+ } from "../../chunk-5r6qdwb2.js";
4
4
  export {
5
5
  componentDefinitions2 as componentDefinitions
6
6
  };
@@ -150,7 +150,7 @@ import {
150
150
  TableHead2,
151
151
  TableCell2,
152
152
  TableCaption2
153
- } from "../../chunk-qn4a3gg4.js";
153
+ } from "../../chunk-rf6x2h3k.js";
154
154
  import"../../chunk-yz1ft8hs.js";
155
155
  import"../../chunk-m4geb1s5.js";
156
156
  import"../../chunk-9ecf92s6.js";
@@ -171,7 +171,7 @@ import {
171
171
  } from "../../chunk-607s04df.js";
172
172
  import {
173
173
  componentDefinitions2
174
- } from "../../chunk-h1b1mqnc.js";
174
+ } from "../../chunk-5r6qdwb2.js";
175
175
  import"../../chunk-5mydsjp3.js";
176
176
 
177
177
  // src/components/json-render/JsonCard.tsx
@@ -238,26 +238,17 @@ var JsonStack = ({ props, children }) => {
238
238
 
239
239
  // src/components/json-render/JsonGrid.tsx
240
240
  import { jsx as jsx3 } from "react/jsx-runtime";
241
+ var GAP_STEPS = { sm: 2, md: 3, lg: 4, xl: 6 };
242
+ var DEFAULT_GRID_MIN_COLUMN_WIDTH = 240;
241
243
  var JsonGrid = ({ props, children }) => {
242
- const colsMap = {
243
- 1: "grid-cols-1",
244
- 2: "grid-cols-2",
245
- 3: "grid-cols-3",
246
- 4: "grid-cols-4",
247
- 5: "grid-cols-5",
248
- 6: "grid-cols-6"
249
- };
250
- const gridGapMap = {
251
- sm: "gap-2",
252
- md: "gap-3",
253
- lg: "gap-4",
254
- xl: "gap-6"
255
- };
256
- const n = Math.max(1, Math.min(6, props.columns ?? 1));
257
- const cols = colsMap[n] ?? "grid-cols-1";
258
- const gridGap = gridGapMap[props.gap ?? "md"] ?? "gap-3";
244
+ const columns = Math.max(1, Math.min(6, props.columns ?? 1));
245
+ const minWidth = props.minColumnWidth ?? DEFAULT_GRID_MIN_COLUMN_WIDTH;
246
+ const gap = `calc(var(--spacing) * ${GAP_STEPS[props.gap ?? "md"] ?? 3})`;
247
+ const track = `minmax(min(100%, max(${minWidth}px, (100% - ${columns - 1} * ${gap}) / ${columns})), 1fr)`;
259
248
  return /* @__PURE__ */ jsx3("div", {
260
- className: cn2("grid w-full min-w-0", cols, gridGap, props.className),
249
+ "data-slot": "json-grid",
250
+ className: cn2("grid w-full min-w-0", props.className),
251
+ style: { gap, gridTemplateColumns: `repeat(auto-fill, ${track})` },
261
252
  children
262
253
  });
263
254
  };
@@ -749,6 +740,7 @@ import { jsx as jsx17 } from "react/jsx-runtime";
749
740
  var JsonBadge = ({ props }) => {
750
741
  return /* @__PURE__ */ jsx17(Badge2, {
751
742
  variant: props.variant ?? "default",
743
+ wrap: true,
752
744
  children: props.text
753
745
  });
754
746
  };
@@ -1,7 +1,7 @@
1
1
  import"../../chunk-en44w1pn.js";
2
2
  import {
3
3
  TableRow2
4
- } from "../../chunk-qn4a3gg4.js";
4
+ } from "../../chunk-rf6x2h3k.js";
5
5
  import {
6
6
  DataGridColumnFitContext,
7
7
  getDataGridColumnFit,
@@ -10,7 +10,7 @@ import {
10
10
  DataGridHeaderRows,
11
11
  DataGridCells2,
12
12
  DataGridColumns
13
- } from "../../chunk-pb7kvbty.js";
13
+ } from "../../chunk-r7ewxac3.js";
14
14
  import"../../chunk-7ny0vyek.js";
15
15
  import"../../chunk-8ssktt4b.js";
16
16
  import"../../chunk-e6hk39ev.js";
@@ -22,7 +22,7 @@ import"../../chunk-7jpsybag.js";
22
22
  import"../../chunk-t9ms87s9.js";
23
23
  import {
24
24
  VirtualTable2
25
- } from "../../chunk-wnkxd9km.js";
25
+ } from "../../chunk-scd23ktw.js";
26
26
  import"../../chunk-5mydsjp3.js";
27
27
 
28
28
  // src/components/virtual-data-grid/VirtualDataGrid.tsx
@@ -1,8 +1,8 @@
1
1
  import"../../chunk-en44w1pn.js";
2
- import"../../chunk-qn4a3gg4.js";
2
+ import"../../chunk-rf6x2h3k.js";
3
3
  import {
4
4
  VirtualTable2
5
- } from "../../chunk-wnkxd9km.js";
5
+ } from "../../chunk-scd23ktw.js";
6
6
  export {
7
7
  VirtualTable2 as VirtualTable
8
8
  };
package/dist/index.js CHANGED
@@ -287,7 +287,7 @@ import {
287
287
  TableColumnGroup2,
288
288
  TableColumn2,
289
289
  TableCaption2
290
- } from "./chunk-qn4a3gg4.js";
290
+ } from "./chunk-rf6x2h3k.js";
291
291
  import {
292
292
  ScrollArea2,
293
293
  ScrollBar2
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.183",
2054
+ version: "0.0.185",
2055
2055
  description: "Sharp, monospace React components with compact, comfortable, and touch densities.",
2056
2056
  license: "MIT",
2057
2057
  repository: {
@@ -50,6 +50,14 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
50
50
  }
51
51
  ```
52
52
 
53
+ ### SortableHeaderMatchesPlainHeader
54
+
55
+ ```tsx
56
+ {
57
+ render: () => <Example pagination={false}/>
58
+ }
59
+ ```
60
+
53
61
  ### FilteredSelection
54
62
 
55
63
  ```tsx
@@ -571,3 +571,11 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
571
571
  }
572
572
  }
573
573
  ```
574
+
575
+ ### GridReflow
576
+
577
+ ```tsx
578
+ {
579
+ render: () => <GridReflowExample />
580
+ }
581
+ ```
@@ -10,7 +10,7 @@ Source: src/components/stories/forms/ControlBoundaries.stories.tsx
10
10
  ## Public imports
11
11
 
12
12
  ```tsx
13
- import { Button, ButtonGroup, Checkbox, Input, OptionCard, OptionCardGroup, RadioGroup, RadioGroupItem, Textarea, Toggle, ToggleGroup, ToggleGroupItem, Toolbar, ToolbarButton, ToolbarGroup, ToolbarLink } from "@alexgorbatchev/shadcn";
13
+ import { Button, ButtonGroup, Checkbox, Input, OptionCard, OptionCardGroup, RadioGroup, RadioGroupItem, Table, TableHead, TableHeader, TableRow, Textarea, Toggle, ToggleGroup, ToggleGroupItem, Toolbar, ToolbarButton, ToolbarGroup, ToolbarLink } from "@alexgorbatchev/shadcn";
14
14
  ```
15
15
 
16
16
  ## Supporting imports
@@ -18,7 +18,7 @@ import { Button, ButtonGroup, Checkbox, Input, OptionCard, OptionCardGroup, Radi
18
18
  ```tsx
19
19
  import { useState } from "react";
20
20
  import type { ReactElement } from "react";
21
- import { EllipsisIcon } from "lucide-react";
21
+ import { ChevronsUpDownIcon, EllipsisIcon } from "lucide-react";
22
22
  ```
23
23
 
24
24
  ## Default component
package/llms/setup.md CHANGED
@@ -296,7 +296,7 @@ Scrolling is intentional: cards, panels, dialogs, sheets, and floating surfaces
296
296
 
297
297
  `ThemeProvider` mounts the development-only `ScrollGuard`. Without a theme provider, mount `<ScrollGuard />` once in your app. Add `data-scroll="none"` to any HTML element to apply the same check. The guard throws a browser error identifying the element, axis, and scroll range when computed `overflow: auto` or `scroll` permits overflowing content to scroll. It checks the marked element itself, including portaled elements in the same document, after content and size changes; nested scroll viewports remain independent. Hidden and clipped overflow do not trigger it. Duplicate mounts share one observer per document, and the final unmount disconnects it. Pass `ownerDocument` to check an iframe's document; shadow roots require their own layout validation. The guard installs no observers when the consuming application's `NODE_ENV` is `"production"`.
298
298
 
299
- Every action shows a visible affordance at rest. Interactive control edges use the `input` token, which keeps 3:1 against the page in both themes; the `border` token is for decorative dividers and cards. A `ghost` Button is borderless only at the icon sizes (`icon`, `icon-xs`, `icon-sm`, `icon-lg`), where its icon identifies it; at the text sizes it keeps an `input` edge, and at `size="inline"` it takes the link colour. Use `variant="link"` for a borderless text action that should read as a link. `ToolbarButton` and `ToolbarLink` default to `variant="outline"`; pass `variant="ghost"` only for icon-only toolbar buttons. In a vertical `Toolbar`, each tool spans its group and starts its label at the shared leading edge, so a list of tools in a side panel lines up. Pressed toggles, toggle group items and toolbar buttons carry a primary edge. The Storybook test suites fail any story that renders a text-labelled Button or toolbar button with no border, no fill and no link styling.
299
+ Every action shows a visible affordance at rest. Interactive control edges use the `input` token, which keeps 3:1 against the page in both themes; the `border` token is for decorative dividers and cards. A `ghost` Button is borderless only at the icon sizes (`icon`, `icon-xs`, `icon-sm`, `icon-lg`), where its icon identifies it; at the text sizes it keeps an `input` edge, and at `size="inline"` it takes the link colour. A sortable `DataGridColumnHeader` is the exception: it keeps the header's colour and weight, and its sort icon identifies it as a control. Use `variant="link"` for a borderless text action that should read as a link. `ToolbarButton` and `ToolbarLink` default to `variant="outline"`; pass `variant="ghost"` only for icon-only toolbar buttons. In a vertical `Toolbar`, each tool spans its group and starts its label at the shared leading edge, so a list of tools in a side panel lines up. Pressed toggles, toggle group items and toolbar buttons carry a primary edge. The Storybook test suites fail any story that renders a text-labelled Button or toolbar button with no border, no fill and no link styling.
300
300
 
301
301
  `PanelHeader` heads a side panel or drawer: one row with the `title` heading (`h2` by default, `headingLevel={3}` for nested panels), an optional muted `count` and icon-button `actions` such as close, then an optional `toolbar` row holding the panel's primary and secondary actions, which wraps as one group. Pass `headingProps` for a ref, `id` or `tabIndex` when focus moves to the panel.
302
302
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexgorbatchev/shadcn",
3
- "version": "0.0.183",
3
+ "version": "0.0.185",
4
4
  "description": "Sharp, monospace React components with compact, comfortable, and touch densities.",
5
5
  "license": "MIT",
6
6
  "repository": {