@alexgorbatchev/shadcn 0.0.101 → 0.0.103
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-519826kj.js → chunk-77k07x58.js} +1 -1
- package/dist/{chunk-9n0axzd5.js → chunk-bfv4qesg.js} +14 -2
- package/dist/{chunk-pn35mpc0.js → chunk-che2mtt5.js} +1 -1
- package/dist/{chunk-g4s1f61z.js → chunk-n593jqmw.js} +217 -127
- package/dist/{chunk-x9p6qh9d.js → chunk-r4r4qcyx.js} +1 -1
- package/dist/{chunk-rpjkf15t.js → chunk-sdkk4n8d.js} +1 -1
- package/dist/components/Field.d.ts +8 -2
- package/dist/components/FilterChip.d.ts +17 -0
- package/dist/components/Message.d.ts +14 -1
- package/dist/components/assistant-ui/elements/EditMessage.js +2 -2
- package/dist/components/assistant-ui/elements/ElicitationForm.js +2 -2
- package/dist/components/assistant-ui/elements/FeedbackDialog.js +2 -2
- package/dist/components/assistant-ui/elements/ModelPicker.js +2 -2
- package/dist/components/assistant-ui/index.js +5 -5
- package/dist/components/event-calendar/index.js +1 -1
- package/dist/components/image-viewer/index.js +1 -1
- package/dist/components/input-otp/index.js +1 -1
- package/dist/components/json-render/index.js +2 -2
- package/dist/components/sonner/Sonner.d.ts +9 -2
- package/dist/components/sonner/index.js +8 -4
- package/dist/index.d.ts +3 -1
- package/dist/index.js +10 -2
- package/dist/prototype.js +1 -1
- package/llms/components/feedback/Sonner.md +23 -0
- package/llms/components/forms/Field.md +25 -0
- package/llms/components/forms/FilterChip.md +95 -0
- package/llms/components/messaging/Message.md +47 -1
- package/llms.txt +1 -0
- package/package.json +1 -1
|
@@ -19,8 +19,14 @@ type FieldProps = ComponentProps<"div"> & VariantProps<typeof fieldVariants> & I
|
|
|
19
19
|
declare function Field({ density, className, orientation, ...props }: FieldProps): ReactElement;
|
|
20
20
|
type FieldContentProps = ComponentProps<"div"> & IDensityProps;
|
|
21
21
|
declare function FieldContent({ density, className, ...props }: FieldContentProps): ReactElement;
|
|
22
|
-
type FieldLabelProps = ComponentProps<typeof Label> & IDensityProps
|
|
23
|
-
|
|
22
|
+
type FieldLabelProps = ComponentProps<typeof Label> & IDensityProps & {
|
|
23
|
+
/**
|
|
24
|
+
* Lets people select the label's text, for example to quote or copy an option's description. A click that ends a
|
|
25
|
+
* drag selection inside the label then leaves its control alone; a plain click still activates it.
|
|
26
|
+
*/
|
|
27
|
+
selectable?: boolean;
|
|
28
|
+
};
|
|
29
|
+
declare function FieldLabel({ density, className, selectable, onClick, ...props }: FieldLabelProps): ReactElement;
|
|
24
30
|
type FieldTitleProps = ComponentProps<"div"> & IDensityProps;
|
|
25
31
|
declare function FieldTitle({ density, className, ...props }: FieldTitleProps): ReactElement;
|
|
26
32
|
type FieldDescriptionProps = ComponentProps<"p"> & IDensityProps;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IDensityProps } from "../density/types.js";
|
|
2
|
+
import type { ComponentProps, ReactElement, ReactNode } from "react";
|
|
3
|
+
type FilterChipProps = Omit<ComponentProps<"div">, "children"> & IDensityProps & {
|
|
4
|
+
/** What the active filter shows, such as "Showing 1 of 4 threads on ‘type scale’". It names the chip's group. */
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/** The action that clears the filter. */
|
|
7
|
+
clearLabel?: string;
|
|
8
|
+
/** Clears the filter: from the clear button, or Escape while focus is inside the chip. */
|
|
9
|
+
onClear: () => void;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Says that a filter is active and how to clear it, so a filtered list never hides items silently. Escape while focus
|
|
13
|
+
* is inside the chip clears the filter, like its clear button.
|
|
14
|
+
*/
|
|
15
|
+
declare function FilterChip({ density, className, children, clearLabel, onClear, onKeyDown, ...props }: FilterChipProps): ReactElement;
|
|
16
|
+
export { FilterChip };
|
|
17
|
+
export type { FilterChipProps };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ComponentProps, ReactElement } from "react";
|
|
2
2
|
import type { IDensityProps } from "../density/types.js";
|
|
3
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./Collapsible.js";
|
|
3
4
|
type MessageGroupProps = ComponentProps<"div"> & IDensityProps;
|
|
4
5
|
declare function MessageGroup({ density, className, ...props }: MessageGroupProps): ReactElement;
|
|
5
6
|
type MessageProps = ComponentProps<"div"> & IDensityProps & {
|
|
@@ -14,4 +15,16 @@ type MessageHeaderProps = ComponentProps<"div"> & IDensityProps;
|
|
|
14
15
|
declare function MessageHeader({ density, className, ...props }: MessageHeaderProps): ReactElement;
|
|
15
16
|
type MessageFooterProps = ComponentProps<"div"> & IDensityProps;
|
|
16
17
|
declare function MessageFooter({ density, className, ...props }: MessageFooterProps): ReactElement;
|
|
17
|
-
|
|
18
|
+
type MessageThreadProps = ComponentProps<typeof Collapsible> & IDensityProps;
|
|
19
|
+
/**
|
|
20
|
+
* The replies under a message, collapsed to one summary line such as "3 replies · last: your agent, 2 min ago" until
|
|
21
|
+
* the reader expands them. Controlled through `open` and `onOpenChange`, or uncontrolled through `defaultOpen`.
|
|
22
|
+
*/
|
|
23
|
+
declare function MessageThread({ density, className, ...props }: MessageThreadProps): ReactElement;
|
|
24
|
+
type MessageThreadSummaryProps = ComponentProps<typeof CollapsibleTrigger> & IDensityProps;
|
|
25
|
+
/** The summary line that expands or collapses a thread's replies; it reports its state through `aria-expanded`. */
|
|
26
|
+
declare function MessageThreadSummary({ density, className, children, ...props }: MessageThreadSummaryProps): ReactElement;
|
|
27
|
+
type MessageThreadRepliesProps = ComponentProps<typeof CollapsibleContent> & IDensityProps;
|
|
28
|
+
/** The replies a thread summary expands. */
|
|
29
|
+
declare function MessageThreadReplies({ density, className, ...props }: MessageThreadRepliesProps): ReactElement;
|
|
30
|
+
export { MessageGroup, Message, MessageAvatar, MessageContent, MessageFooter, MessageHeader, MessageThread, MessageThreadSummary, MessageThreadReplies, };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EditMessage2
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-77k07x58.js";
|
|
4
4
|
import"../../../chunk-vxvaaptq.js";
|
|
5
|
-
import"../../../chunk-
|
|
5
|
+
import"../../../chunk-bfv4qesg.js";
|
|
6
6
|
import"../../../chunk-r7krv555.js";
|
|
7
7
|
import"../../../chunk-m32ptxf3.js";
|
|
8
8
|
import"../../../chunk-9k5b62qf.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ElicitationForm2
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-sdkk4n8d.js";
|
|
4
4
|
import"../../../chunk-vxvaaptq.js";
|
|
5
5
|
import"../../../chunk-kgqe8gpb.js";
|
|
6
6
|
import"../../../chunk-m98d89xc.js";
|
|
7
|
-
import"../../../chunk-
|
|
7
|
+
import"../../../chunk-bfv4qesg.js";
|
|
8
8
|
import"../../../chunk-r7krv555.js";
|
|
9
9
|
import"../../../chunk-m32ptxf3.js";
|
|
10
10
|
import"../../../chunk-7vg045gd.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FeedbackDialog2
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-che2mtt5.js";
|
|
4
4
|
import"../../../chunk-9n617bte.js";
|
|
5
|
-
import"../../../chunk-
|
|
5
|
+
import"../../../chunk-bfv4qesg.js";
|
|
6
6
|
import"../../../chunk-r7krv555.js";
|
|
7
7
|
import"../../../chunk-m32ptxf3.js";
|
|
8
8
|
import"../../../chunk-9k5b62qf.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ModelPicker2
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-r4r4qcyx.js";
|
|
4
4
|
import"../../../chunk-kgqe8gpb.js";
|
|
5
|
-
import"../../../chunk-
|
|
5
|
+
import"../../../chunk-bfv4qesg.js";
|
|
6
6
|
import"../../../chunk-r7krv555.js";
|
|
7
7
|
import"../../../chunk-9t530p75.js";
|
|
8
8
|
import"../../../chunk-m32ptxf3.js";
|
|
@@ -226,15 +226,15 @@ import {
|
|
|
226
226
|
} from "../../chunk-ybsr621k.js";
|
|
227
227
|
import"../../chunk-m32ptxf3.js";
|
|
228
228
|
import"../../chunk-52aadmkc.js";
|
|
229
|
-
import"../../chunk-
|
|
229
|
+
import"../../chunk-bfv4qesg.js";
|
|
230
230
|
import {
|
|
231
231
|
EditMessage2
|
|
232
|
-
} from "../../chunk-
|
|
232
|
+
} from "../../chunk-77k07x58.js";
|
|
233
233
|
import"../../chunk-kgqe8gpb.js";
|
|
234
234
|
import"../../chunk-m98d89xc.js";
|
|
235
235
|
import {
|
|
236
236
|
ElicitationForm2
|
|
237
|
-
} from "../../chunk-
|
|
237
|
+
} from "../../chunk-sdkk4n8d.js";
|
|
238
238
|
import"../../chunk-4e96tpw0.js";
|
|
239
239
|
import {
|
|
240
240
|
EmptyState2
|
|
@@ -262,7 +262,7 @@ import {
|
|
|
262
262
|
import"../../chunk-9n617bte.js";
|
|
263
263
|
import {
|
|
264
264
|
FeedbackDialog2
|
|
265
|
-
} from "../../chunk-
|
|
265
|
+
} from "../../chunk-che2mtt5.js";
|
|
266
266
|
import {
|
|
267
267
|
FileRoot2,
|
|
268
268
|
FileIconDisplay2,
|
|
@@ -373,7 +373,7 @@ import {
|
|
|
373
373
|
} from "../../chunk-3embwe93.js";
|
|
374
374
|
import {
|
|
375
375
|
ModelPicker2
|
|
376
|
-
} from "../../chunk-
|
|
376
|
+
} from "../../chunk-r4r4qcyx.js";
|
|
377
377
|
import"../../chunk-kp3jgjng.js";
|
|
378
378
|
import {
|
|
379
379
|
ModelSelectorRoot2
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
PaginationPrevious2,
|
|
27
27
|
PaginationNext2,
|
|
28
28
|
PaginationEllipsis2
|
|
29
|
-
} from "../../chunk-
|
|
29
|
+
} from "../../chunk-n593jqmw.js";
|
|
30
30
|
import {
|
|
31
31
|
MenuPopup,
|
|
32
32
|
MenuItem2,
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
import {
|
|
68
68
|
Field2,
|
|
69
69
|
FieldLabel2
|
|
70
|
-
} from "../../chunk-
|
|
70
|
+
} from "../../chunk-bfv4qesg.js";
|
|
71
71
|
import {
|
|
72
72
|
Slider2
|
|
73
73
|
} from "../../chunk-7cq1s2ey.js";
|
|
@@ -2,7 +2,14 @@ import type { IAnalyticsProps } from "../../analytics/types.js";
|
|
|
2
2
|
import type { ReactElement } from "react";
|
|
3
3
|
import type { ToasterProps } from "sonner";
|
|
4
4
|
import type { IDensityProps } from "../../density/types.js";
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
interface ISonnerLiveProps {
|
|
6
|
+
/**
|
|
7
|
+
* Render the notifications section as a polite live region. Defaults to true. Pass false when the
|
|
8
|
+
* application announces each toast through its own live region, so screen readers hear it once.
|
|
9
|
+
*/
|
|
10
|
+
live?: boolean;
|
|
11
|
+
}
|
|
12
|
+
type SonnerProps = Omit<ToasterProps, "containerLive"> & ISonnerLiveProps & IDensityProps & IAnalyticsProps;
|
|
13
|
+
declare function Sonner({ analytics, density, className, toastOptions, icons, theme, dir, expand, live, ...props }: SonnerProps): ReactElement;
|
|
7
14
|
export { Sonner, Sonner as SonnerToaster, Sonner as Toaster };
|
|
8
15
|
export { toast } from "sonner";
|
|
@@ -944,7 +944,7 @@ var Toaster = /* @__PURE__ */ React.forwardRef(function Toaster(props, ref) {
|
|
|
944
944
|
const { id, invert, position = "bottom-right", hotkey = [
|
|
945
945
|
"altKey",
|
|
946
946
|
"KeyT"
|
|
947
|
-
], expand, closeButton, className, offset, mobileOffset, theme = "light", richColors, duration, style, visibleToasts = VISIBLE_TOASTS_AMOUNT, toastOptions, dir = getDocumentDirection(), gap = GAP, icons, customAriaLabel, containerAriaLabel = "Notifications" } = props;
|
|
947
|
+
], expand, closeButton, className, offset, mobileOffset, theme = "light", richColors, duration, style, visibleToasts = VISIBLE_TOASTS_AMOUNT, toastOptions, dir = getDocumentDirection(), gap = GAP, icons, customAriaLabel, containerAriaLabel = "Notifications", containerLive = true } = props;
|
|
948
948
|
const [toasts, setToasts] = React.useState([]);
|
|
949
949
|
const filteredToasts = React.useMemo(() => {
|
|
950
950
|
if (id) {
|
|
@@ -1097,9 +1097,11 @@ var Toaster = /* @__PURE__ */ React.forwardRef(function Toaster(props, ref) {
|
|
|
1097
1097
|
ref,
|
|
1098
1098
|
"aria-label": customAriaLabel != null ? customAriaLabel : `${containerAriaLabel} ${hotkeyLabel}`,
|
|
1099
1099
|
tabIndex: -1,
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1100
|
+
...containerLive ? {
|
|
1101
|
+
"aria-live": "polite",
|
|
1102
|
+
"aria-relevant": "additions text",
|
|
1103
|
+
"aria-atomic": "false"
|
|
1104
|
+
} : {},
|
|
1103
1105
|
suppressHydrationWarning: true,
|
|
1104
1106
|
"data-react-aria-top-layer": true
|
|
1105
1107
|
}, possiblePositions.map((position, index) => {
|
|
@@ -1207,6 +1209,7 @@ function Sonner({
|
|
|
1207
1209
|
theme,
|
|
1208
1210
|
dir,
|
|
1209
1211
|
expand = true,
|
|
1212
|
+
live = true,
|
|
1210
1213
|
...props
|
|
1211
1214
|
}) {
|
|
1212
1215
|
const activate = useAnalyticsCallback("Sonner", analytics, { name: "ui.activate" }, undefined);
|
|
@@ -1225,6 +1228,7 @@ function Sonner({
|
|
|
1225
1228
|
theme: theme ?? resolvedTheme,
|
|
1226
1229
|
dir: dir ?? inheritedDirection,
|
|
1227
1230
|
expand,
|
|
1231
|
+
containerLive: live,
|
|
1228
1232
|
className: cn2("[&[data-sonner-toaster]]:font-mono", "[@media(max-width:600px)]:[&[data-sonner-toaster]]:w-auto!", "[@media(max-width:600px)]:[&[data-sonner-toaster]]:left-[var(--mobile-offset-left)]!", "[@media(max-width:600px)]:[&[data-sonner-toaster]]:right-[var(--mobile-offset-right)]!", "[@media(max-width:600px)]:[&[data-sonner-toaster]_[data-sonner-toast]]:w-full!", className),
|
|
1229
1233
|
icons: {
|
|
1230
1234
|
success: /* @__PURE__ */ jsx("span", {
|
package/dist/index.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ export { Toast, ToastToaster, ToastProvider, ToastPortal, ToastViewport, ToastCo
|
|
|
86
86
|
export { useToastManager } from "./hooks/useToastManager.js";
|
|
87
87
|
export { Marker, MarkerIcon, MarkerContent, markerVariants } from "./components/Marker.js";
|
|
88
88
|
export { Bubble, BubbleGroup, BubbleContent, BubbleReactions } from "./components/Bubble.js";
|
|
89
|
-
export { Message, MessageGroup, MessageAvatar, MessageContent, MessageHeader, MessageFooter, } from "./components/Message.js";
|
|
89
|
+
export { Message, MessageGroup, MessageAvatar, MessageContent, MessageHeader, MessageFooter, MessageThread, MessageThreadSummary, MessageThreadReplies, } from "./components/Message.js";
|
|
90
90
|
export { Attachment, AttachmentGroup, AttachmentMedia, AttachmentContent, AttachmentTitle, AttachmentDescription, AttachmentActions, AttachmentAction, AttachmentTrigger, } from "./components/Attachment.js";
|
|
91
91
|
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, } from "./components/Sidebar.js";
|
|
92
92
|
export { useSidebar } from "./hooks/useSidebar.js";
|
|
@@ -141,6 +141,8 @@ export { SettingsSection } from "./components/SettingsSection.js";
|
|
|
141
141
|
export type { SettingsSectionProps } from "./components/SettingsSection.js";
|
|
142
142
|
export { TagInput } from "./components/TagInput.js";
|
|
143
143
|
export type { TagInputProps } from "./components/TagInput.js";
|
|
144
|
+
export { FilterChip } from "./components/FilterChip.js";
|
|
145
|
+
export type { FilterChipProps } from "./components/FilterChip.js";
|
|
144
146
|
export { FilterBar } from "./components/FilterBar.js";
|
|
145
147
|
export type { FilterBarProps, FilterDefinition } from "./components/FilterBar.js";
|
|
146
148
|
export { Kanban } from "./components/Kanban.js";
|
package/dist/index.js
CHANGED
|
@@ -117,6 +117,9 @@ import {
|
|
|
117
117
|
MessageContent2,
|
|
118
118
|
MessageHeader2,
|
|
119
119
|
MessageFooter2,
|
|
120
|
+
MessageThread2,
|
|
121
|
+
MessageThreadSummary2,
|
|
122
|
+
MessageThreadReplies2,
|
|
120
123
|
Attachment2,
|
|
121
124
|
AttachmentMedia2,
|
|
122
125
|
AttachmentContent2,
|
|
@@ -160,12 +163,13 @@ import {
|
|
|
160
163
|
AuthForm2,
|
|
161
164
|
SettingsSection2,
|
|
162
165
|
TagInput2,
|
|
166
|
+
FilterChip2,
|
|
163
167
|
FilterBar2,
|
|
164
168
|
BarList2,
|
|
165
169
|
StatusTracker2,
|
|
166
170
|
DashboardLayout2,
|
|
167
171
|
BillingUsage2
|
|
168
|
-
} from "./chunk-
|
|
172
|
+
} from "./chunk-n593jqmw.js";
|
|
169
173
|
import {
|
|
170
174
|
Combobox2,
|
|
171
175
|
ComboboxValue2,
|
|
@@ -307,7 +311,7 @@ import {
|
|
|
307
311
|
FieldDescription2,
|
|
308
312
|
FieldSeparator2,
|
|
309
313
|
FieldError2
|
|
310
|
-
} from "./chunk-
|
|
314
|
+
} from "./chunk-bfv4qesg.js";
|
|
311
315
|
import {
|
|
312
316
|
Spinner2
|
|
313
317
|
} from "./chunk-t3p4dn1p.js";
|
|
@@ -643,6 +647,7 @@ export {
|
|
|
643
647
|
FieldSet2 as FieldSet,
|
|
644
648
|
FieldTitle2 as FieldTitle,
|
|
645
649
|
FilterBar2 as FilterBar,
|
|
650
|
+
FilterChip2 as FilterChip,
|
|
646
651
|
FormDialog2 as FormDialog,
|
|
647
652
|
Grid2 as Grid,
|
|
648
653
|
GridItem2 as GridItem,
|
|
@@ -716,6 +721,9 @@ export {
|
|
|
716
721
|
MessageFooter2 as MessageFooter,
|
|
717
722
|
MessageGroup2 as MessageGroup,
|
|
718
723
|
MessageHeader2 as MessageHeader,
|
|
724
|
+
MessageThread2 as MessageThread,
|
|
725
|
+
MessageThreadReplies2 as MessageThreadReplies,
|
|
726
|
+
MessageThreadSummary2 as MessageThreadSummary,
|
|
719
727
|
Meter2 as Meter,
|
|
720
728
|
MeterIndicator2 as MeterIndicator,
|
|
721
729
|
MeterLabel2 as MeterLabel,
|
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.103",
|
|
2055
2055
|
description: "Sharp, monospace React components with compact and comfortable densities.",
|
|
2056
2056
|
license: "MIT",
|
|
2057
2057
|
repository: {
|
|
@@ -323,3 +323,26 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
```
|
|
326
|
+
|
|
327
|
+
### AnnouncedByApplication
|
|
328
|
+
|
|
329
|
+
```tsx
|
|
330
|
+
{
|
|
331
|
+
args: { live: false },
|
|
332
|
+
render: function Render(args) {
|
|
333
|
+
const [announcement, setAnnouncement] = useState("");
|
|
334
|
+
return (<>
|
|
335
|
+
<Sonner {...args}/>
|
|
336
|
+
<div aria-live="polite" data-testid="application-announcer">
|
|
337
|
+
{announcement}
|
|
338
|
+
</div>
|
|
339
|
+
<Button onClick={() => {
|
|
340
|
+
toast("Archived Pricing", { toasterId: args.id, action: { label: "Undo", onClick() { } } });
|
|
341
|
+
setAnnouncement("Archived Pricing. Undo is in Notifications.");
|
|
342
|
+
}}>
|
|
343
|
+
Archive page
|
|
344
|
+
</Button>
|
|
345
|
+
</>);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
```
|
|
@@ -509,3 +509,28 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
509
509
|
render: () => <ReportForm />
|
|
510
510
|
}
|
|
511
511
|
```
|
|
512
|
+
|
|
513
|
+
### SelectableChoiceLabel
|
|
514
|
+
|
|
515
|
+
```tsx
|
|
516
|
+
{
|
|
517
|
+
render: function Render() {
|
|
518
|
+
const storyId = useId();
|
|
519
|
+
const [value, setValue] = useState("bold");
|
|
520
|
+
return (<RadioGroup aria-label="Hero direction" value={value} onValueChange={(next) => setValue(String(next))}>
|
|
521
|
+
{[
|
|
522
|
+
{ value: "bold", title: "Bold", description: "Large type and a strong accent colour." },
|
|
523
|
+
{ value: "quiet", title: "Quiet", description: "Soft neutrals and generous whitespace." },
|
|
524
|
+
].map((option) => (<FieldLabel key={option.value} htmlFor={`${storyId}-${option.value}`} selectable>
|
|
525
|
+
<Field orientation="horizontal">
|
|
526
|
+
<FieldContent>
|
|
527
|
+
<FieldTitle>{option.title}</FieldTitle>
|
|
528
|
+
<FieldDescription>{option.description}</FieldDescription>
|
|
529
|
+
</FieldContent>
|
|
530
|
+
<RadioGroupItem id={`${storyId}-${option.value}`} value={option.value} aria-label={option.title}/>
|
|
531
|
+
</Field>
|
|
532
|
+
</FieldLabel>))}
|
|
533
|
+
</RadioGroup>);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
```
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# FilterChip
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/forms/FilterChip
|
|
4
|
+
Source: src/components/stories/forms/FilterChip.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/forms/FilterChip.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { FilterChip } from "@alexgorbatchev/shadcn";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Supporting imports
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { useState } from "react";
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Default component
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
FilterChip
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Default args
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
{ children: "Showing 1 of 4 threads on ‘type scale and palette’", onClear: fn() }
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Default render
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
(args) => (<div className="w-96">
|
|
36
|
+
<FilterChip {...args}/>
|
|
37
|
+
</div>)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Examples
|
|
41
|
+
|
|
42
|
+
Storybook CSF excerpts. Default args and render apply unless overridden. Local helpers, fixtures, decorators, and providers may be required; these are reference excerpts, not standalone consumer modules. Interaction tests are omitted.
|
|
43
|
+
|
|
44
|
+
### Default
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
{}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### EscapeClears
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
{}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### ConsumerHandlesEscape
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
{
|
|
60
|
+
args: {
|
|
61
|
+
onKeyDown: (event) => {
|
|
62
|
+
if (event.key === "Escape")
|
|
63
|
+
event.preventDefault();
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### CustomClearLabel
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
{
|
|
73
|
+
args: { clearLabel: "Clear filter", children: "Mine · 3 of 12 threads" }
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### FilteredList
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
{
|
|
81
|
+
render: function Render() {
|
|
82
|
+
const items = ["Hero layout", "type scale and palette", "Footer links", "Pricing table"];
|
|
83
|
+
const [filter, setFilter] = useState<string | undefined>("type scale and palette");
|
|
84
|
+
const shown = filter ? items.filter((item) => item === filter) : items;
|
|
85
|
+
return (<div className="flex w-96 flex-col gap-2">
|
|
86
|
+
{filter && (<FilterChip onClear={() => setFilter(undefined)}>
|
|
87
|
+
Showing {shown.length} of {items.length} threads on ‘{filter}’
|
|
88
|
+
</FilterChip>)}
|
|
89
|
+
<ul aria-label="Threads">
|
|
90
|
+
{shown.map((item) => (<li key={item}>{item}</li>))}
|
|
91
|
+
</ul>
|
|
92
|
+
</div>);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
@@ -8,7 +8,7 @@ Source: src/components/stories/messaging/Message.stories.tsx
|
|
|
8
8
|
## Public imports
|
|
9
9
|
|
|
10
10
|
```tsx
|
|
11
|
-
import { Message, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader, Avatar, AvatarFallback, Bubble, BubbleContent, Button, Attachment, AttachmentContent, AttachmentDescription, AttachmentMedia, AttachmentTitle, AttachmentTrigger } from "@alexgorbatchev/shadcn";
|
|
11
|
+
import { Message, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageThread, MessageThreadReplies, MessageThreadSummary, Avatar, AvatarFallback, Bubble, BubbleContent, Button, Attachment, AttachmentContent, AttachmentDescription, AttachmentMedia, AttachmentTitle, AttachmentTrigger } from "@alexgorbatchev/shadcn";
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
## Supporting imports
|
|
@@ -266,3 +266,49 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
266
266
|
</div>)
|
|
267
267
|
}
|
|
268
268
|
```
|
|
269
|
+
|
|
270
|
+
### CollapsedThread
|
|
271
|
+
|
|
272
|
+
```tsx
|
|
273
|
+
{
|
|
274
|
+
render: function Render() {
|
|
275
|
+
const [isOpen, setOpen] = useState(false);
|
|
276
|
+
return (<div className="flex w-96 flex-col gap-2">
|
|
277
|
+
<Message role="article" aria-label="Your comment">
|
|
278
|
+
<MessageContent>
|
|
279
|
+
<Bubble variant="tinted">
|
|
280
|
+
<BubbleContent>Can the More tab hold Settings?</BubbleContent>
|
|
281
|
+
</Bubble>
|
|
282
|
+
</MessageContent>
|
|
283
|
+
</Message>
|
|
284
|
+
<MessageThread open={isOpen} onOpenChange={setOpen}>
|
|
285
|
+
<MessageThreadSummary>3 replies · last: your agent, 2 min ago</MessageThreadSummary>
|
|
286
|
+
<MessageThreadReplies>
|
|
287
|
+
<Message role="article" aria-label="Agent reply">
|
|
288
|
+
<MessageContent>
|
|
289
|
+
<Bubble variant="muted">
|
|
290
|
+
<BubbleContent>Yes, Settings moves under More.</BubbleContent>
|
|
291
|
+
</Bubble>
|
|
292
|
+
</MessageContent>
|
|
293
|
+
</Message>
|
|
294
|
+
</MessageThreadReplies>
|
|
295
|
+
</MessageThread>
|
|
296
|
+
</div>);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### ExpandedThread
|
|
302
|
+
|
|
303
|
+
```tsx
|
|
304
|
+
{
|
|
305
|
+
render: () => (<div className="w-96">
|
|
306
|
+
<MessageThread defaultOpen density="compact">
|
|
307
|
+
<MessageThreadSummary density="compact">1 reply · last: you, 10:38</MessageThreadSummary>
|
|
308
|
+
<MessageThreadReplies density="compact">
|
|
309
|
+
<p>Reply text</p>
|
|
310
|
+
</MessageThreadReplies>
|
|
311
|
+
</MessageThread>
|
|
312
|
+
</div>)
|
|
313
|
+
}
|
|
314
|
+
```
|
package/llms.txt
CHANGED
|
@@ -398,6 +398,7 @@ Generated from the public package exports and Storybook sources.
|
|
|
398
398
|
- [Field](./llms/components/forms/Field.md)
|
|
399
399
|
- [FileUpload](./llms/components/forms/FileUpload.md)
|
|
400
400
|
- [FilterBar](./llms/components/forms/FilterBar.md)
|
|
401
|
+
- [FilterChip](./llms/components/forms/FilterChip.md)
|
|
401
402
|
- [ImageCrop](./llms/components/forms/ImageCrop.md)
|
|
402
403
|
- [ImagePicker](./llms/components/forms/ImagePicker.md)
|
|
403
404
|
- [InlineEdit](./llms/components/forms/InlineEdit.md)
|