@alexgorbatchev/shadcn 0.0.152 → 0.0.154
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/dist/{chunk-rf70907h.js → chunk-a08meqj4.js} +16 -14
- package/dist/{chunk-9tyf36w5.js → chunk-dthve8hk.js} +1 -1
- package/dist/{chunk-32ah7jyp.js → chunk-pbyj8rja.js} +1 -1
- package/dist/{chunk-0kbbxpsq.js → chunk-saftvg12.js} +1 -1
- package/dist/{chunk-fbajrfv6.js → chunk-v64bc7ky.js} +1 -1
- package/dist/components/assistant-ui/elements/FeedbackDialog.js +2 -2
- package/dist/components/assistant-ui/elements/MessageActions.js +2 -2
- package/dist/components/assistant-ui/elements/ReasoningEffort.js +2 -2
- package/dist/components/assistant-ui/index.js +4 -4
- package/dist/components/image-viewer/index.js +1 -1
- package/dist/components/json-render/index.js +2 -2
- package/dist/components/tree/index.js +1 -1
- package/dist/index.js +2 -2
- package/dist/prototype.js +1 -1
- package/llms/components/actions/ToggleGroup.md +16 -0
- package/llms/components/data-display/Item.md +19 -0
- package/llms/components/overlays/FormDialog.md +8 -0
- package/package.json +1 -1
|
@@ -348,10 +348,12 @@ function FormDialog2({
|
|
|
348
348
|
error,
|
|
349
349
|
children
|
|
350
350
|
}) {
|
|
351
|
+
const isFullscreen = size === "fullscreen";
|
|
351
352
|
const body = /* @__PURE__ */ jsxs2(Fragment, {
|
|
352
353
|
children: [
|
|
353
354
|
/* @__PURE__ */ jsxs2(ScrollArea2, {
|
|
354
355
|
density,
|
|
356
|
+
grow: isFullscreen,
|
|
355
357
|
children: [
|
|
356
358
|
children,
|
|
357
359
|
error && /* @__PURE__ */ jsx4(Alert2, {
|
|
@@ -411,7 +413,7 @@ function FormDialog2({
|
|
|
411
413
|
]
|
|
412
414
|
}),
|
|
413
415
|
onSubmit ? /* @__PURE__ */ jsx4("form", {
|
|
414
|
-
className: "flex min-h-0 flex-col gap-panel",
|
|
416
|
+
className: cn2("flex min-h-0 flex-col gap-panel", isFullscreen && "flex-1"),
|
|
415
417
|
onSubmit: (event) => {
|
|
416
418
|
if (isBusy)
|
|
417
419
|
event.preventDefault();
|
|
@@ -497,7 +499,7 @@ import { CheckIcon } from "lucide-react";
|
|
|
497
499
|
import { jsx as jsx6, jsxs as jsxs4, Fragment as Fragment2 } from "react/jsx-runtime";
|
|
498
500
|
"use client";
|
|
499
501
|
function getGroupClass(layout) {
|
|
500
|
-
return
|
|
502
|
+
return layout === "row" ? "flex w-full flex-wrap gap-2 [&>[data-slot=option-card-item]:not([data-span=full])]:min-w-[min(100%,14rem)] [&>[data-slot=option-card-item]:not([data-span=full])]:flex-1 [&>[data-slot=option-card-item][data-span=full]]:basis-full" : "grid w-full gap-2";
|
|
501
503
|
}
|
|
502
504
|
function OptionCardGroup2({
|
|
503
505
|
analytics,
|
|
@@ -533,7 +535,7 @@ function OptionCheckboxGroup2({
|
|
|
533
535
|
onValueChange: trackedOnValueChange
|
|
534
536
|
});
|
|
535
537
|
}
|
|
536
|
-
var CARD_CLASS = "group/option-card grid h-full w-full cursor-pointer grid-cols-[1.25rem_minmax(0,1fr)] items-start gap-x-2 rounded-md border border-input bg-card p-panel-sm text-start text-sm text-card-foreground transition-colors outline-none hover:bg-muted/40 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid data-checked:border-primary data-checked:ring-1 data-checked:ring-primary forced-colors:data-checked:border-[color:Highlight] aria-invalid:not-data-checked:border-destructive data-disabled:cursor-not-allowed data-disabled:opacity-50 data-disabled:hover:bg-card data-readonly:cursor-default data-folding:pb-10";
|
|
538
|
+
var CARD_CLASS = "group/option-card grid h-full w-full cursor-pointer grid-cols-[1.25rem_minmax(0,1fr)] content-start items-start gap-x-2 rounded-md border border-input bg-card p-panel-sm text-start text-sm text-card-foreground transition-colors outline-none hover:bg-muted/40 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring focus-visible:outline-solid data-checked:border-primary data-checked:ring-1 data-checked:ring-primary forced-colors:data-checked:border-[color:Highlight] aria-invalid:not-data-checked:border-destructive data-disabled:cursor-not-allowed data-disabled:opacity-50 data-disabled:hover:bg-card data-readonly:cursor-default data-folding:pb-10";
|
|
537
539
|
var CARD_CONTROL_SELECTOR = '[data-slot="option-card"], [data-slot="option-checkbox-card"]';
|
|
538
540
|
function useFold(lines) {
|
|
539
541
|
const ref = useRef(null);
|
|
@@ -586,6 +588,11 @@ function OptionCardContent({
|
|
|
586
588
|
const isFolded = descriptionLines !== undefined && !fold.isOpen;
|
|
587
589
|
return /* @__PURE__ */ jsxs4(Fragment2, {
|
|
588
590
|
children: [
|
|
591
|
+
image !== undefined && /* @__PURE__ */ jsx6("span", {
|
|
592
|
+
"data-slot": "option-card-image",
|
|
593
|
+
className: "col-span-full mb-2 block overflow-hidden rounded-sm border border-border",
|
|
594
|
+
children: image
|
|
595
|
+
}),
|
|
589
596
|
/* @__PURE__ */ jsx6("span", {
|
|
590
597
|
"data-slot": "option-card-marker",
|
|
591
598
|
"aria-hidden": "true",
|
|
@@ -595,11 +602,6 @@ function OptionCardContent({
|
|
|
595
602
|
/* @__PURE__ */ jsxs4("span", {
|
|
596
603
|
className: "flex min-w-0 flex-col gap-1",
|
|
597
604
|
children: [
|
|
598
|
-
image !== undefined && /* @__PURE__ */ jsx6("span", {
|
|
599
|
-
"data-slot": "option-card-image",
|
|
600
|
-
className: "mb-1 block overflow-hidden rounded-sm border border-border",
|
|
601
|
-
children: image
|
|
602
|
-
}),
|
|
603
605
|
/* @__PURE__ */ jsxs4("span", {
|
|
604
606
|
className: "flex flex-wrap items-center gap-x-2 gap-y-1",
|
|
605
607
|
children: [
|
|
@@ -1680,7 +1682,7 @@ function BreadcrumbLink2({ analytics, density, className, render, ...props }) {
|
|
|
1680
1682
|
return useRender3({
|
|
1681
1683
|
defaultTagName: "a",
|
|
1682
1684
|
props: mergeProps3({
|
|
1683
|
-
className: cn2("transition-colors hover:text-foreground", className)
|
|
1685
|
+
className: cn2("inline-block cursor-pointer border-b border-input leading-6 transition-colors hover:border-foreground hover:text-foreground", className)
|
|
1684
1686
|
}, { ...props, onClick }),
|
|
1685
1687
|
render,
|
|
1686
1688
|
state: {
|
|
@@ -1696,7 +1698,7 @@ function BreadcrumbPage2({ density, className, ...props }) {
|
|
|
1696
1698
|
role: "link",
|
|
1697
1699
|
"aria-disabled": "true",
|
|
1698
1700
|
"aria-current": "page",
|
|
1699
|
-
className: cn2("font-normal text-foreground", className),
|
|
1701
|
+
className: cn2("inline-block border-b border-transparent leading-6 font-normal text-foreground", className),
|
|
1700
1702
|
...props
|
|
1701
1703
|
});
|
|
1702
1704
|
}
|
|
@@ -1867,11 +1869,11 @@ function ItemSeparator2({ density, className, ...props }) {
|
|
|
1867
1869
|
...props
|
|
1868
1870
|
});
|
|
1869
1871
|
}
|
|
1870
|
-
var itemVariants = cva2("group/item flex w-full flex-wrap items-center rounded-sm border text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring [a]:transition-colors [a]:hover:bg-muted", {
|
|
1872
|
+
var itemVariants = cva2("group/item flex w-full flex-wrap items-center rounded-sm border text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring [&:is(a,button)]:cursor-pointer [&:is(a,button)]:transition-colors [&:is(a,button)]:hover:bg-muted aria-[current=true]:border-primary aria-[current=true]:bg-muted/60", {
|
|
1871
1873
|
variants: {
|
|
1872
1874
|
variant: {
|
|
1873
1875
|
default: "border-transparent",
|
|
1874
|
-
outline: "border-border",
|
|
1876
|
+
outline: "border-border [&:is(button)]:border-input",
|
|
1875
1877
|
muted: "border-transparent bg-muted/50"
|
|
1876
1878
|
},
|
|
1877
1879
|
size: {
|
|
@@ -4308,8 +4310,8 @@ function ReadMore2({ maxHeight, density, className, style, children, ...props })
|
|
|
4308
4310
|
}),
|
|
4309
4311
|
isOverflowing && isFolded && /* @__PURE__ */ jsx41(Button2, {
|
|
4310
4312
|
type: "button",
|
|
4311
|
-
variant: "
|
|
4312
|
-
size: "
|
|
4313
|
+
variant: "outline",
|
|
4314
|
+
size: "xs",
|
|
4313
4315
|
"data-slot": "read-more-toggle",
|
|
4314
4316
|
"aria-expanded": false,
|
|
4315
4317
|
"aria-controls": `${id}-content`,
|
|
@@ -79,7 +79,7 @@ function ToggleGroup2({
|
|
|
79
79
|
gap: `calc(var(--spacing) * ${spacing})`,
|
|
80
80
|
...typeof style === "function" ? style(state) : style
|
|
81
81
|
}),
|
|
82
|
-
className: (state) => cn2("group/toggle-group flex w-fit flex-row items-center rounded-sm data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch", layout === "fill" && "w-full", typeof className === "function" ? className(state) : className),
|
|
82
|
+
className: (state) => cn2("group/toggle-group flex w-fit flex-row items-center rounded-sm data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch", layout === "fill" ? "w-full" : spacing > 0 && orientation === "horizontal" && "max-w-full flex-wrap", typeof className === "function" ? className(state) : className),
|
|
83
83
|
...props,
|
|
84
84
|
onValueChange: (value, details) => {
|
|
85
85
|
if (required && value.length === 0) {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
ToggleGroup2,
|
|
6
6
|
ToggleGroupItem2
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-pbyj8rja.js";
|
|
8
8
|
|
|
9
9
|
// src/components/assistant-ui/elements/MessageActions.tsx
|
|
10
10
|
import { CheckIcon, CopyIcon, EllipsisIcon, RefreshCwIcon, ThumbsDownIcon, ThumbsUpIcon } from "lucide-react";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FeedbackDialog2
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import"../../../chunk-
|
|
3
|
+
} from "../../../chunk-v64bc7ky.js";
|
|
4
|
+
import"../../../chunk-pbyj8rja.js";
|
|
5
5
|
import"../../../chunk-9e1yb90r.js";
|
|
6
6
|
import"../../../chunk-jc3cbwyg.js";
|
|
7
7
|
import"../../../chunk-4m2x9jfb.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MessageActions2
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import"../../../chunk-
|
|
3
|
+
} from "../../../chunk-saftvg12.js";
|
|
4
|
+
import"../../../chunk-pbyj8rja.js";
|
|
5
5
|
import"../../../chunk-2sx8m8b2.js";
|
|
6
6
|
import"../../../chunk-x90xmrba.js";
|
|
7
7
|
import"../../../chunk-jpvw9xqy.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ReasoningEffort2
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import"../../../chunk-
|
|
3
|
+
} from "../../../chunk-dthve8hk.js";
|
|
4
|
+
import"../../../chunk-pbyj8rja.js";
|
|
5
5
|
import"../../../chunk-bcwbh20z.js";
|
|
6
6
|
import"../../../chunk-5mydsjp3.js";
|
|
7
7
|
import"../../../chunk-8ssktt4b.js";
|
|
@@ -259,10 +259,10 @@ import"../../chunk-ctp5jhpj.js";
|
|
|
259
259
|
import {
|
|
260
260
|
EveAskQuestion2
|
|
261
261
|
} from "../../chunk-1m0afwnr.js";
|
|
262
|
-
import"../../chunk-
|
|
262
|
+
import"../../chunk-pbyj8rja.js";
|
|
263
263
|
import {
|
|
264
264
|
FeedbackDialog2
|
|
265
|
-
} from "../../chunk-
|
|
265
|
+
} from "../../chunk-v64bc7ky.js";
|
|
266
266
|
import {
|
|
267
267
|
FileRoot2,
|
|
268
268
|
FileIconDisplay2,
|
|
@@ -352,7 +352,7 @@ import {
|
|
|
352
352
|
} from "../../chunk-40jpafh1.js";
|
|
353
353
|
import {
|
|
354
354
|
MessageActions2
|
|
355
|
-
} from "../../chunk-
|
|
355
|
+
} from "../../chunk-saftvg12.js";
|
|
356
356
|
import {
|
|
357
357
|
MessageAttachments2
|
|
358
358
|
} from "../../chunk-pp819k6p.js";
|
|
@@ -462,7 +462,7 @@ import {
|
|
|
462
462
|
} from "../../chunk-x0p3g392.js";
|
|
463
463
|
import {
|
|
464
464
|
ReasoningEffort2
|
|
465
|
-
} from "../../chunk-
|
|
465
|
+
} from "../../chunk-dthve8hk.js";
|
|
466
466
|
import {
|
|
467
467
|
SwapLabel2
|
|
468
468
|
} from "../../chunk-39q6906v.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
PaginationPrevious2,
|
|
27
27
|
PaginationNext2,
|
|
28
28
|
PaginationEllipsis2
|
|
29
|
-
} from "../../chunk-
|
|
29
|
+
} from "../../chunk-a08meqj4.js";
|
|
30
30
|
import {
|
|
31
31
|
MenuPopup,
|
|
32
32
|
MenuItem2,
|
|
@@ -124,7 +124,7 @@ import {
|
|
|
124
124
|
Toggle2,
|
|
125
125
|
ToggleGroup2,
|
|
126
126
|
ToggleGroupItem2
|
|
127
|
-
} from "../../chunk-
|
|
127
|
+
} from "../../chunk-pbyj8rja.js";
|
|
128
128
|
import {
|
|
129
129
|
Avatar2,
|
|
130
130
|
AvatarImage2,
|
|
@@ -193,7 +193,7 @@ function TreeItem({
|
|
|
193
193
|
props: mergeProps({
|
|
194
194
|
...nativeProps,
|
|
195
195
|
ref: undefined,
|
|
196
|
-
className: cn2("flex min-w-0 flex-1 items-center gap-2 outline-none focus-visible:ring-2 focus-visible:ring-ring", faded),
|
|
196
|
+
className: cn2("flex min-w-0 flex-1 items-center gap-2 self-stretch -my-1 py-1 outline-none focus-visible:ring-2 focus-visible:ring-ring", faded),
|
|
197
197
|
children: label,
|
|
198
198
|
onFocus: () => item.setFocused(),
|
|
199
199
|
onClick: (event) => {
|
package/dist/index.js
CHANGED
|
@@ -188,7 +188,7 @@ import {
|
|
|
188
188
|
DashboardLayout2,
|
|
189
189
|
BillingUsage2,
|
|
190
190
|
SelectionAction2
|
|
191
|
-
} from "./chunk-
|
|
191
|
+
} from "./chunk-a08meqj4.js";
|
|
192
192
|
import {
|
|
193
193
|
statusDotVariants2,
|
|
194
194
|
StatusDot2
|
|
@@ -301,7 +301,7 @@ import {
|
|
|
301
301
|
Toggle2,
|
|
302
302
|
ToggleGroup2,
|
|
303
303
|
ToggleGroupItem2
|
|
304
|
-
} from "./chunk-
|
|
304
|
+
} from "./chunk-pbyj8rja.js";
|
|
305
305
|
import {
|
|
306
306
|
Checkbox2
|
|
307
307
|
} from "./chunk-b5s5y5wq.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.
|
|
2054
|
+
version: "0.0.154",
|
|
2055
2055
|
description: "Sharp, monospace React components with compact, comfortable, and touch densities.",
|
|
2056
2056
|
license: "MIT",
|
|
2057
2057
|
repository: {
|
|
@@ -233,3 +233,19 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
233
233
|
</DirectionProvider>)
|
|
234
234
|
}
|
|
235
235
|
```
|
|
236
|
+
|
|
237
|
+
### WrapsWhenNarrow
|
|
238
|
+
|
|
239
|
+
```tsx
|
|
240
|
+
{
|
|
241
|
+
args: { multiple: true, variant: "outline", spacing: 2, defaultValue: ["email"] },
|
|
242
|
+
render: (args) => (<div data-testid="narrow-toggle-container" className="w-44">
|
|
243
|
+
<ToggleGroup {...args}>
|
|
244
|
+
<ToggleGroupItem value="email">Email</ToggleGroupItem>
|
|
245
|
+
<ToggleGroupItem value="chat">Chat</ToggleGroupItem>
|
|
246
|
+
<ToggleGroupItem value="phone">Phone</ToggleGroupItem>
|
|
247
|
+
<ToggleGroupItem value="forum">Forum</ToggleGroupItem>
|
|
248
|
+
</ToggleGroup>
|
|
249
|
+
</div>)
|
|
250
|
+
}
|
|
251
|
+
```
|
|
@@ -530,6 +530,25 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
530
530
|
}
|
|
531
531
|
```
|
|
532
532
|
|
|
533
|
+
### InteractiveCurrent
|
|
534
|
+
|
|
535
|
+
```tsx
|
|
536
|
+
{
|
|
537
|
+
render: function Render() {
|
|
538
|
+
const [current, setCurrent] = useState("first");
|
|
539
|
+
return (<ItemGroup aria-label="Queue decisions">
|
|
540
|
+
{(["first", "second"] as const).map((id) => (<div key={id} role="listitem">
|
|
541
|
+
<Item size="xs" variant="outline" aria-current={current === id ? "true" : undefined} render={<button type="button" onClick={() => setCurrent(id)}/>}>
|
|
542
|
+
<ItemContent>
|
|
543
|
+
<ItemTitle>{id === "first" ? "First decision" : "Second decision"}</ItemTitle>
|
|
544
|
+
</ItemContent>
|
|
545
|
+
</Item>
|
|
546
|
+
</div>))}
|
|
547
|
+
</ItemGroup>);
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
```
|
|
551
|
+
|
|
533
552
|
### InDropdown
|
|
534
553
|
|
|
535
554
|
```tsx
|