@alexgorbatchev/shadcn 0.0.91 → 0.0.93

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.
@@ -5701,7 +5701,7 @@ var componentDefinitions2 = {
5701
5701
  className: string2().nullable().describe("Additional CSS classes")
5702
5702
  }),
5703
5703
  slots: ["default"],
5704
- description: "Flex container for layouts",
5704
+ description: "Flex container for layouts. Fills the width of its parent.",
5705
5705
  example: { direction: "vertical", gap: "md" }
5706
5706
  },
5707
5707
  Grid: {
@@ -5711,7 +5711,7 @@ var componentDefinitions2 = {
5711
5711
  className: string2().nullable().describe("Additional CSS classes")
5712
5712
  }),
5713
5713
  slots: ["default"],
5714
- description: "Grid layout (1-6 columns)",
5714
+ description: "Grid layout (1-6 columns). Fills the width of its parent.",
5715
5715
  example: { columns: 3, gap: "md" }
5716
5716
  },
5717
5717
  Separator: {
@@ -5731,7 +5731,7 @@ var componentDefinitions2 = {
5731
5731
  }),
5732
5732
  slots: ["default"],
5733
5733
  events: ["change"],
5734
- description: "Tab navigation. Use { $bindState } on value for active tab binding."
5734
+ description: "Tabs with panels. Child i is the panel of tab i: only the active tab's panel shows, and inactive panels stay mounted but hidden. Children beyond the tab count render below the panels. Use { $bindState } on value for active tab binding."
5735
5735
  },
5736
5736
  Accordion: {
5737
5737
  props: object({
@@ -5741,7 +5741,7 @@ var componentDefinitions2 = {
5741
5741
  })),
5742
5742
  type: _enum(["single", "multiple"]).nullable()
5743
5743
  }),
5744
- description: "Collapsible sections. Items as [{title, content}]. Type 'single' (default) or 'multiple'."
5744
+ description: "Collapsible text sections. Items as [{title, content}] with plain-text content; children are not rendered (use Collapsible to hide other components). Type 'single' (default) or 'multiple'."
5745
5745
  },
5746
5746
  Collapsible: {
5747
5747
  props: object({
@@ -74,7 +74,7 @@ function ToolbarGroup2({ density, className, wrap = false, ...props }) {
74
74
  "data-density": density,
75
75
  "data-slot": "toolbar-group",
76
76
  "data-wrap": wrap ? "" : undefined,
77
- className: (state) => cn2("flex items-center gap-control-gap data-[orientation=vertical]:flex-col", wrap && "flex-wrap", typeof className === "function" ? className(state) : className),
77
+ className: (state) => cn2("flex items-center gap-control-gap data-[orientation=vertical]:flex-col", wrap && "flex-wrap justify-start data-[orientation=vertical]:flex-row", typeof className === "function" ? className(state) : className),
78
78
  ...props
79
79
  });
80
80
  }
@@ -11,7 +11,10 @@ declare function ToolbarButton({ analytics, density, className, ...props }: Tool
11
11
  declare function ToolbarLink({ analytics, density, className, ...props }: ToolbarPrimitive.Link.Props & IDensityProps & IAnalyticsProps): ReactElement;
12
12
  declare function ToolbarInput({ analytics, density, className, ...props }: ToolbarPrimitive.Input.Props & IDensityProps & IAnalyticsProps): ReactElement;
13
13
  type ToolbarGroupProps = ToolbarPrimitive.Group.Props & IDensityProps & {
14
- /** Lets the group's controls wrap onto further lines instead of overflowing, as a set of chips does. */
14
+ /**
15
+ * Lets the group's controls wrap onto further lines instead of overflowing, as a set of chips does. They run in
16
+ * rows even inside a vertical toolbar, whose arrow keys still move through them in order.
17
+ */
15
18
  wrap?: boolean;
16
19
  };
17
20
  declare function ToolbarGroup({ density, className, wrap, ...props }: ToolbarGroupProps): ReactElement;
@@ -15,7 +15,7 @@ import {
15
15
  ToolbarButton2,
16
16
  ToolbarGroup2,
17
17
  ToolbarSeparator2
18
- } from "../../chunk-s5820zky.js";
18
+ } from "../../chunk-tcbjvdem.js";
19
19
  import"../../chunk-5mydsjp3.js";
20
20
 
21
21
  // src/components/editor/RichTextEditor.tsx
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  componentDefinitions2
3
- } from "../../chunk-tch86q2w.js";
3
+ } from "../../chunk-p8bdmafq.js";
4
4
  export {
5
5
  componentDefinitions2 as componentDefinitions
6
6
  };
@@ -101,7 +101,8 @@ import"../../chunk-kmqx7c48.js";
101
101
  import {
102
102
  Tabs2,
103
103
  TabsList2,
104
- TabsTrigger2
104
+ TabsTrigger2,
105
+ TabsContent2
105
106
  } from "../../chunk-t0t1c3a7.js";
106
107
  import"../../chunk-4e96tpw0.js";
107
108
  import {
@@ -151,7 +152,7 @@ import"../../chunk-m4geb1s5.js";
151
152
  import"../../chunk-9ecf92s6.js";
152
153
  import"../../chunk-fe33dx54.js";
153
154
  import"../../chunk-tcefvfr8.js";
154
- import"../../chunk-s5820zky.js";
155
+ import"../../chunk-tcbjvdem.js";
155
156
  import {
156
157
  Carousel2,
157
158
  CarouselContent2,
@@ -161,7 +162,7 @@ import {
161
162
  } from "../../chunk-xfz7r7dk.js";
162
163
  import {
163
164
  componentDefinitions2
164
- } from "../../chunk-tch86q2w.js";
165
+ } from "../../chunk-p8bdmafq.js";
165
166
  import"../../chunk-5mydsjp3.js";
166
167
 
167
168
  // src/components/json-render/JsonCard.tsx
@@ -218,7 +219,7 @@ var JsonStack = ({ props, children }) => {
218
219
  const alignClass = alignMap[props.align ?? "start"] ?? "items-start";
219
220
  const justifyClass = justifyMap[props.justify ?? ""] ?? "";
220
221
  return /* @__PURE__ */ jsx2("div", {
221
- className: cn2("flex", isHorizontal ? "flex-row flex-wrap" : "flex-col", gapClass, alignClass, justifyClass, props.className),
222
+ className: cn2("flex w-full min-w-0", isHorizontal ? "flex-row flex-wrap" : "flex-col", gapClass, alignClass, justifyClass, props.className),
222
223
  children
223
224
  });
224
225
  };
@@ -244,7 +245,7 @@ var JsonGrid = ({ props, children }) => {
244
245
  const cols = colsMap[n] ?? "grid-cols-1";
245
246
  const gridGap = gridGapMap[props.gap ?? "md"] ?? "gap-3";
246
247
  return /* @__PURE__ */ jsx3("div", {
247
- className: cn2("grid", cols, gridGap, props.className),
248
+ className: cn2("grid w-full min-w-0", cols, gridGap, props.className),
248
249
  children
249
250
  });
250
251
  };
@@ -262,6 +263,11 @@ var JsonSeparator = ({ props }) => {
262
263
  import { useState } from "react";
263
264
  import { useBoundProp } from "@json-render/react";
264
265
  import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
266
+ function toChildList(children) {
267
+ if (Array.isArray(children))
268
+ return children;
269
+ return children === undefined || children === null ? [] : [children];
270
+ }
265
271
  var JsonTabs = ({ props, children, bindings, emit }) => {
266
272
  const tabs = props.tabs ?? [];
267
273
  const [boundValue, setBoundValue] = useBoundProp(props.value ?? undefined, bindings?.value);
@@ -269,6 +275,9 @@ var JsonTabs = ({ props, children, bindings, emit }) => {
269
275
  const isBound = !!bindings?.value;
270
276
  const value = isBound ? boundValue ?? tabs[0]?.value ?? "" : localValue;
271
277
  const setValue = isBound ? setBoundValue : setLocalValue;
278
+ const childList = toChildList(children);
279
+ const hasPanels = childList.length > 0;
280
+ const extraChildren = childList.slice(tabs.length);
272
281
  return /* @__PURE__ */ jsxs2(Tabs2, {
273
282
  value,
274
283
  onValueChange: (v) => {
@@ -282,7 +291,12 @@ var JsonTabs = ({ props, children, bindings, emit }) => {
282
291
  children: tab.label
283
292
  }, tab.value))
284
293
  }),
285
- children
294
+ hasPanels && tabs.map((tab, index) => /* @__PURE__ */ jsx5(TabsContent2, {
295
+ value: tab.value,
296
+ keepMounted: true,
297
+ children: childList[index]
298
+ }, tab.value)),
299
+ extraChildren
286
300
  ]
287
301
  });
288
302
  };
@@ -449,7 +463,7 @@ var JsonTable = ({ props }) => {
449
463
  const columns = props.columns ?? [];
450
464
  const rows = (props.rows ?? []).map((row) => row.map(String));
451
465
  return /* @__PURE__ */ jsx11("div", {
452
- className: "rounded-md border border-border overflow-hidden",
466
+ className: "w-full min-w-0 rounded-md border border-border overflow-hidden",
453
467
  children: /* @__PURE__ */ jsxs8(Table2, {
454
468
  children: [
455
469
  props.caption && /* @__PURE__ */ jsx11(TableCaption2, {
package/dist/index.js CHANGED
@@ -224,7 +224,7 @@ import {
224
224
  ToolbarInput2,
225
225
  ToolbarGroup2,
226
226
  ToolbarSeparator2
227
- } from "./chunk-s5820zky.js";
227
+ } from "./chunk-tcbjvdem.js";
228
228
  import {
229
229
  Slider2
230
230
  } from "./chunk-7cq1s2ey.js";
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.91",
2054
+ version: "0.0.93",
2055
2055
  description: "Sharp, monospace React components with compact and comfortable densities.",
2056
2056
  license: "MIT",
2057
2057
  repository: {
@@ -491,3 +491,83 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
491
491
  }
492
492
  }
493
493
  ```
494
+
495
+ ### TableInStack
496
+
497
+ ```tsx
498
+ {
499
+ args: {
500
+ spec: {
501
+ root: "root",
502
+ elements: {
503
+ root: {
504
+ type: "Stack",
505
+ props: { direction: null, gap: null, align: null, justify: null, className: null },
506
+ children: [...tableAlignments.map((alignment) => `stack-${alignment}`), "wide-stack"],
507
+ },
508
+ ...Object.fromEntries(tableAlignments.flatMap((alignment) => [
509
+ [
510
+ `stack-${alignment}`,
511
+ {
512
+ type: "Stack",
513
+ props: { align: alignment === "default" ? null : alignment },
514
+ children: [`table-${alignment}`],
515
+ },
516
+ ],
517
+ [
518
+ `table-${alignment}`,
519
+ {
520
+ type: "Table",
521
+ props: {
522
+ caption: `Benchmarks aligned ${alignment}`,
523
+ columns: ["Option", "Latency", "Cost"],
524
+ rows: [
525
+ ["Blue-green", "120 ms", "$40"],
526
+ ["Canary", "95 ms", "$55"],
527
+ ],
528
+ },
529
+ },
530
+ ],
531
+ ])),
532
+ "wide-stack": { type: "Stack", props: { align: null }, children: ["wide-table"] },
533
+ "wide-table": {
534
+ type: "Table",
535
+ props: {
536
+ caption: "Wide benchmarks",
537
+ columns: wideColumns,
538
+ rows: [wideColumns.map((_, index) => `measured value ${index + 1}`)],
539
+ },
540
+ },
541
+ },
542
+ },
543
+ }
544
+ }
545
+ ```
546
+
547
+ ### TabsWithPanels
548
+
549
+ ```tsx
550
+ {
551
+ args: {
552
+ spec: {
553
+ root: "tabs",
554
+ elements: {
555
+ tabs: {
556
+ type: "Tabs",
557
+ props: {
558
+ tabs: [
559
+ { value: "summary", label: "Summary" },
560
+ { value: "risks", label: "Risks" },
561
+ ],
562
+ },
563
+ children: ["summary", "risks", "footer"],
564
+ },
565
+ summary: { type: "Text", props: { text: "Summary panel content" } },
566
+ risks: { type: "Collapsible", props: { title: "Risk details", defaultOpen: true }, children: ["risk-text"] },
567
+ "risk-text": { type: "Text", props: { text: "Risks panel content" } },
568
+ footer: { type: "Text", props: { text: "Shown under every tab" } },
569
+ },
570
+ },
571
+ }
572
+ }
573
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexgorbatchev/shadcn",
3
- "version": "0.0.91",
3
+ "version": "0.0.93",
4
4
  "description": "Sharp, monospace React components with compact and comfortable densities.",
5
5
  "license": "MIT",
6
6
  "repository": {