raft-ui 0.0.1
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 +24 -0
- package/dist/cn.d.mts +2 -0
- package/dist/cn.mjs +2 -0
- package/dist/index.d.mts +2710 -0
- package/dist/index.mjs +4821 -0
- package/dist/label-DWq4ia5I.mjs +115 -0
- package/dist/styled-props-B3SNekJg.d.mts +16 -0
- package/dist/wip.d.mts +1238 -0
- package/dist/wip.mjs +1416 -0
- package/package.json +70 -0
- package/src/components/avatar/avatar.tsx +375 -0
- package/src/components/avatar/index.ts +17 -0
- package/src/components/badge/badge.tsx +393 -0
- package/src/components/badge/index.ts +2 -0
- package/src/components/banner/banner.tsx +269 -0
- package/src/components/banner/index.ts +8 -0
- package/src/components/bottom-sheet/bottom-sheet.tsx +152 -0
- package/src/components/bottom-sheet/index.ts +22 -0
- package/src/components/button/button.tsx +497 -0
- package/src/components/button/index.ts +2 -0
- package/src/components/checkbox/checkbox-indicator.tsx +128 -0
- package/src/components/checkbox/checkbox.tsx +350 -0
- package/src/components/checkbox/index.ts +2 -0
- package/src/components/combobox/combobox.tsx +603 -0
- package/src/components/combobox/index.ts +52 -0
- package/src/components/context-menu/context-menu.tsx +380 -0
- package/src/components/context-menu/index.ts +34 -0
- package/src/components/conversation-preview-card/conversation-preview-card.tsx +336 -0
- package/src/components/conversation-preview-card/index.ts +32 -0
- package/src/components/description-list/description-list.tsx +116 -0
- package/src/components/description-list/index.ts +14 -0
- package/src/components/dropdown-menu/dropdown-menu.tsx +405 -0
- package/src/components/dropdown-menu/index.ts +38 -0
- package/src/components/empty-state/empty-state.tsx +177 -0
- package/src/components/empty-state/index.ts +16 -0
- package/src/components/field/field.tsx +125 -0
- package/src/components/field/index.ts +18 -0
- package/src/components/inline-code/index.ts +2 -0
- package/src/components/inline-code/inline-code.tsx +33 -0
- package/src/components/input/index.ts +2 -0
- package/src/components/input/input.tsx +76 -0
- package/src/components/input-group/index.ts +7 -0
- package/src/components/input-group/input-group.tsx +215 -0
- package/src/components/kbd/index.ts +2 -0
- package/src/components/kbd/kbd.tsx +43 -0
- package/src/components/label/index.ts +7 -0
- package/src/components/label/label.tsx +99 -0
- package/src/components/lightbox/index.ts +24 -0
- package/src/components/lightbox/lightbox.tsx +245 -0
- package/src/components/list-item/index.ts +20 -0
- package/src/components/list-item/list-item.tsx +263 -0
- package/src/components/media-list-item/index.ts +20 -0
- package/src/components/media-list-item/media-list-item.tsx +169 -0
- package/src/components/notification-center/index.ts +39 -0
- package/src/components/notification-center/notification-center.tsx +558 -0
- package/src/components/panel-header/index.ts +22 -0
- package/src/components/panel-header/panel-header.tsx +199 -0
- package/src/components/popover/index.ts +30 -0
- package/src/components/popover/popover.tsx +248 -0
- package/src/components/preview-shell/index.ts +2 -0
- package/src/components/preview-shell/preview-shell.tsx +51 -0
- package/src/components/quoted-message-card/index.ts +36 -0
- package/src/components/quoted-message-card/quoted-message-card.tsx +391 -0
- package/src/components/radio-group/index.ts +6 -0
- package/src/components/radio-group/radio-group.tsx +119 -0
- package/src/components/section-header/index.ts +16 -0
- package/src/components/section-header/section-header.tsx +117 -0
- package/src/components/section-label/index.ts +2 -0
- package/src/components/section-label/section-label.tsx +38 -0
- package/src/components/segmented-control/index.ts +12 -0
- package/src/components/segmented-control/segmented-control.tsx +129 -0
- package/src/components/select/index.ts +40 -0
- package/src/components/select/select.tsx +382 -0
- package/src/components/spinner/index.ts +2 -0
- package/src/components/spinner/spinner.tsx +228 -0
- package/src/components/status/index.ts +2 -0
- package/src/components/status/status.tsx +152 -0
- package/src/components/tabs/index.ts +24 -0
- package/src/components/tabs/tabs.tsx +417 -0
- package/src/components/text/index.ts +2 -0
- package/src/components/text/text.tsx +130 -0
- package/src/components/textarea/index.ts +2 -0
- package/src/components/textarea/textarea.tsx +136 -0
- package/src/components/toggle-group/index.ts +12 -0
- package/src/components/toggle-group/toggle-group.tsx +111 -0
- package/src/components/tooltip/index.ts +14 -0
- package/src/components/tooltip/tooltip.tsx +186 -0
- package/src/fonts/brutal.css +2 -0
- package/src/index.ts +404 -0
- package/src/legacy/AttentionDot.tsx +28 -0
- package/src/legacy/AvatarListRow.tsx +87 -0
- package/src/legacy/AvatarSlot.tsx +157 -0
- package/src/legacy/Badge.tsx +95 -0
- package/src/legacy/Banner.tsx +74 -0
- package/src/legacy/BottomSheet.tsx +76 -0
- package/src/legacy/CheckMarker.tsx +72 -0
- package/src/legacy/Checkbox.tsx +81 -0
- package/src/legacy/ConversationPreviewCard.tsx +169 -0
- package/src/legacy/DismissBackdrop.tsx +68 -0
- package/src/legacy/EmptyState.tsx +63 -0
- package/src/legacy/ExperimentalBadge.tsx +19 -0
- package/src/legacy/FormField.tsx +106 -0
- package/src/legacy/KeyValueRow.tsx +67 -0
- package/src/legacy/Lightbox.tsx +119 -0
- package/src/legacy/NotificationCenter.tsx +217 -0
- package/src/legacy/PanelHeader.tsx +94 -0
- package/src/legacy/PreviewShell.tsx +40 -0
- package/src/legacy/QuotedMessageCard.tsx +181 -0
- package/src/legacy/ReorderablePanelTabs.tsx +151 -0
- package/src/legacy/SandboxedPreviewFrame.tsx +59 -0
- package/src/legacy/SearchInput.tsx +23 -0
- package/src/legacy/SectionEyebrow.tsx +60 -0
- package/src/legacy/SectionHeader.tsx +68 -0
- package/src/legacy/SegmentedControl.tsx +74 -0
- package/src/legacy/SlugInput.tsx +29 -0
- package/src/legacy/Spinner.tsx +89 -0
- package/src/legacy/StatusDot.tsx +51 -0
- package/src/legacy/SurfaceListItem.tsx +32 -0
- package/src/legacy/Textarea.tsx +137 -0
- package/src/legacy/button.tsx +100 -0
- package/src/legacy/context-menu-divider.tsx +12 -0
- package/src/legacy/menu-item.tsx +66 -0
- package/src/legacy/selection-popover.tsx +212 -0
- package/src/legacy/server-switcher-menu.tsx +203 -0
- package/src/legacy/source.css +240 -0
- package/src/lib/cn.ts +1 -0
- package/src/lib/styled-props.ts +11 -0
- package/src/lib/theme/theme-context.ts +28 -0
- package/src/lib/theme/theme-provider.tsx +181 -0
- package/src/lib/theme/use-theme.ts +12 -0
- package/src/lib/tv.ts +29 -0
- package/src/lib/without-children.ts +6 -0
- package/src/styles.css +467 -0
- package/src/wip.ts +255 -0
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import { Button as BaseButton } from "@base-ui/react/button";
|
|
2
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
+
import { tv } from "../../lib/tv.ts";
|
|
5
|
+
import { useThemeFamily } from "../../lib/theme/use-theme.ts";
|
|
6
|
+
|
|
7
|
+
const conversationPreviewCard = tv({
|
|
8
|
+
slots: {
|
|
9
|
+
root: ["relative flex w-full items-start gap-3 border-2 p-3 text-left transition-colors"],
|
|
10
|
+
content: ["min-w-0 flex-1"],
|
|
11
|
+
meta: ["mb-1 flex flex-wrap items-center gap-x-2.5 gap-y-1 text-xs leading-4"],
|
|
12
|
+
channel: ["font-bold"],
|
|
13
|
+
author: ["inline-flex min-w-0 items-center gap-1 font-bold"],
|
|
14
|
+
authorName: ["truncate"],
|
|
15
|
+
authorSubtitle: ["font-mono text-[10px]"],
|
|
16
|
+
timestamp: ["font-mono text-xs leading-4"],
|
|
17
|
+
preview: ["text-sm"],
|
|
18
|
+
previewLeading: ["mr-1 inline-flex align-[-1px]", "[&_svg]:size-[13px] [&_svg]:shrink-0"],
|
|
19
|
+
previewAuthor: ["font-bold"],
|
|
20
|
+
secondaryPreview: ["mt-1 line-clamp-1 text-xs"],
|
|
21
|
+
footer: ["mt-1 flex items-center gap-3"],
|
|
22
|
+
action: ["shrink-0"],
|
|
23
|
+
},
|
|
24
|
+
variants: {
|
|
25
|
+
theme: {
|
|
26
|
+
brutal: {
|
|
27
|
+
root: [
|
|
28
|
+
"border-line-subtle bg-layer-panel hover:border-line-strong hover:shadow-sm",
|
|
29
|
+
"data-[state=active]:border-line-strong data-[state=active]:bg-layer-panel data-[state=active]:shadow-sm",
|
|
30
|
+
"data-[highlighted=true]:border-line-strong data-[highlighted=true]:bg-info-base/25 data-[highlighted=true]:shadow-md",
|
|
31
|
+
],
|
|
32
|
+
channel: "text-foreground/50",
|
|
33
|
+
author: "text-foreground-strong",
|
|
34
|
+
authorSubtitle: "text-foreground/40",
|
|
35
|
+
timestamp: "text-foreground/40",
|
|
36
|
+
previewAuthor: "text-foreground/70",
|
|
37
|
+
secondaryPreview: "text-foreground/45",
|
|
38
|
+
},
|
|
39
|
+
elegant: {},
|
|
40
|
+
},
|
|
41
|
+
interactive: {
|
|
42
|
+
true: {
|
|
43
|
+
root: "active:border-line-strong active:shadow-sm",
|
|
44
|
+
},
|
|
45
|
+
false: {
|
|
46
|
+
root: "cursor-default",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
defaultVariants: {
|
|
51
|
+
interactive: false,
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export type ConversationPreviewCardProps = useRender.ComponentProps<"button"> & {
|
|
56
|
+
testId?: string;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export function ConversationPreviewCard({
|
|
60
|
+
onClick,
|
|
61
|
+
className,
|
|
62
|
+
render,
|
|
63
|
+
testId,
|
|
64
|
+
...props
|
|
65
|
+
}: ConversationPreviewCardProps) {
|
|
66
|
+
const theme = useThemeFamily();
|
|
67
|
+
const interactive = Boolean(onClick);
|
|
68
|
+
const { root } = conversationPreviewCard({ theme, interactive });
|
|
69
|
+
const defaultProps: useRender.ElementProps<"button"> & {
|
|
70
|
+
"data-slot": string;
|
|
71
|
+
"data-testid"?: string;
|
|
72
|
+
} = {
|
|
73
|
+
onClick,
|
|
74
|
+
"data-slot": "conversation-preview-card",
|
|
75
|
+
"data-testid": testId,
|
|
76
|
+
className: root({ className }),
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
return useRender({
|
|
80
|
+
render: render ?? (interactive ? <BaseButton type="button" /> : <div />),
|
|
81
|
+
props: mergeProps<"button">(defaultProps, props),
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type ConversationPreviewCardContentProps = useRender.ComponentProps<"div">;
|
|
86
|
+
|
|
87
|
+
export function ConversationPreviewCardContent({
|
|
88
|
+
className,
|
|
89
|
+
render,
|
|
90
|
+
...props
|
|
91
|
+
}: ConversationPreviewCardContentProps) {
|
|
92
|
+
const { content } = conversationPreviewCard();
|
|
93
|
+
const defaultProps: useRender.ElementProps<"div"> = {
|
|
94
|
+
className: content({ className }),
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
return useRender({
|
|
98
|
+
defaultTagName: "div",
|
|
99
|
+
render,
|
|
100
|
+
props: mergeProps<"div">(defaultProps, props),
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export type ConversationPreviewCardMetaProps = useRender.ComponentProps<"div">;
|
|
105
|
+
|
|
106
|
+
export function ConversationPreviewCardMeta({
|
|
107
|
+
className,
|
|
108
|
+
render,
|
|
109
|
+
...props
|
|
110
|
+
}: ConversationPreviewCardMetaProps) {
|
|
111
|
+
const { meta } = conversationPreviewCard();
|
|
112
|
+
const defaultProps: useRender.ElementProps<"div"> = {
|
|
113
|
+
className: meta({ className }),
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
return useRender({
|
|
117
|
+
defaultTagName: "div",
|
|
118
|
+
render,
|
|
119
|
+
props: mergeProps<"div">(defaultProps, props),
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export type ConversationPreviewCardChannelProps = useRender.ComponentProps<"span">;
|
|
124
|
+
|
|
125
|
+
export function ConversationPreviewCardChannel({
|
|
126
|
+
className,
|
|
127
|
+
render,
|
|
128
|
+
...props
|
|
129
|
+
}: ConversationPreviewCardChannelProps) {
|
|
130
|
+
const theme = useThemeFamily();
|
|
131
|
+
const { channel } = conversationPreviewCard({ theme });
|
|
132
|
+
const defaultProps: useRender.ElementProps<"span"> = {
|
|
133
|
+
className: channel({ className }),
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
return useRender({
|
|
137
|
+
defaultTagName: "span",
|
|
138
|
+
render,
|
|
139
|
+
props: mergeProps<"span">(defaultProps, props),
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export type ConversationPreviewCardAuthorProps = useRender.ComponentProps<"span">;
|
|
144
|
+
|
|
145
|
+
export function ConversationPreviewCardAuthor({
|
|
146
|
+
className,
|
|
147
|
+
render,
|
|
148
|
+
...props
|
|
149
|
+
}: ConversationPreviewCardAuthorProps) {
|
|
150
|
+
const theme = useThemeFamily();
|
|
151
|
+
const { author } = conversationPreviewCard({ theme });
|
|
152
|
+
const defaultProps: useRender.ElementProps<"span"> = {
|
|
153
|
+
className: author({ className }),
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
return useRender({
|
|
157
|
+
defaultTagName: "span",
|
|
158
|
+
render,
|
|
159
|
+
props: mergeProps<"span">(defaultProps, props),
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export type ConversationPreviewCardAuthorNameProps = useRender.ComponentProps<"span">;
|
|
164
|
+
|
|
165
|
+
export function ConversationPreviewCardAuthorName({
|
|
166
|
+
className,
|
|
167
|
+
render,
|
|
168
|
+
...props
|
|
169
|
+
}: ConversationPreviewCardAuthorNameProps) {
|
|
170
|
+
const { authorName } = conversationPreviewCard();
|
|
171
|
+
const defaultProps: useRender.ElementProps<"span"> = {
|
|
172
|
+
className: authorName({ className }),
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
return useRender({
|
|
176
|
+
defaultTagName: "span",
|
|
177
|
+
render,
|
|
178
|
+
props: mergeProps<"span">(defaultProps, props),
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export type ConversationPreviewCardAuthorSubtitleProps = useRender.ComponentProps<"span">;
|
|
183
|
+
|
|
184
|
+
export function ConversationPreviewCardAuthorSubtitle({
|
|
185
|
+
className,
|
|
186
|
+
render,
|
|
187
|
+
...props
|
|
188
|
+
}: ConversationPreviewCardAuthorSubtitleProps) {
|
|
189
|
+
const theme = useThemeFamily();
|
|
190
|
+
const { authorSubtitle } = conversationPreviewCard({ theme });
|
|
191
|
+
const defaultProps: useRender.ElementProps<"span"> = {
|
|
192
|
+
className: authorSubtitle({ className }),
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
return useRender({
|
|
196
|
+
defaultTagName: "span",
|
|
197
|
+
render,
|
|
198
|
+
props: mergeProps<"span">(defaultProps, props),
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export type ConversationPreviewCardTimestampProps = useRender.ComponentProps<"span">;
|
|
203
|
+
|
|
204
|
+
export function ConversationPreviewCardTimestamp({
|
|
205
|
+
className,
|
|
206
|
+
render,
|
|
207
|
+
...props
|
|
208
|
+
}: ConversationPreviewCardTimestampProps) {
|
|
209
|
+
const theme = useThemeFamily();
|
|
210
|
+
const { timestamp } = conversationPreviewCard({ theme });
|
|
211
|
+
const defaultProps: useRender.ElementProps<"span"> = {
|
|
212
|
+
className: timestamp({ className }),
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
return useRender({
|
|
216
|
+
defaultTagName: "span",
|
|
217
|
+
render,
|
|
218
|
+
props: mergeProps<"span">(defaultProps, props),
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export type ConversationPreviewCardPreviewProps = useRender.ComponentProps<"p">;
|
|
223
|
+
|
|
224
|
+
export function ConversationPreviewCardPreview({
|
|
225
|
+
className,
|
|
226
|
+
render,
|
|
227
|
+
...props
|
|
228
|
+
}: ConversationPreviewCardPreviewProps) {
|
|
229
|
+
const { preview } = conversationPreviewCard();
|
|
230
|
+
const defaultProps: useRender.ElementProps<"p"> = {
|
|
231
|
+
className: preview({ className }),
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
return useRender({
|
|
235
|
+
defaultTagName: "p",
|
|
236
|
+
render,
|
|
237
|
+
props: mergeProps<"p">(defaultProps, props),
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export type ConversationPreviewCardPreviewLeadingProps = useRender.ComponentProps<"span">;
|
|
242
|
+
|
|
243
|
+
export function ConversationPreviewCardPreviewLeading({
|
|
244
|
+
className,
|
|
245
|
+
render,
|
|
246
|
+
...props
|
|
247
|
+
}: ConversationPreviewCardPreviewLeadingProps) {
|
|
248
|
+
const { previewLeading } = conversationPreviewCard();
|
|
249
|
+
const defaultProps: useRender.ElementProps<"span"> = {
|
|
250
|
+
className: previewLeading({ className }),
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
return useRender({
|
|
254
|
+
defaultTagName: "span",
|
|
255
|
+
render,
|
|
256
|
+
props: mergeProps<"span">(defaultProps, props),
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export type ConversationPreviewCardPreviewAuthorProps = useRender.ComponentProps<"span">;
|
|
261
|
+
|
|
262
|
+
export function ConversationPreviewCardPreviewAuthor({
|
|
263
|
+
className,
|
|
264
|
+
render,
|
|
265
|
+
...props
|
|
266
|
+
}: ConversationPreviewCardPreviewAuthorProps) {
|
|
267
|
+
const theme = useThemeFamily();
|
|
268
|
+
const { previewAuthor } = conversationPreviewCard({ theme });
|
|
269
|
+
const defaultProps: useRender.ElementProps<"span"> = {
|
|
270
|
+
className: previewAuthor({ className }),
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
return useRender({
|
|
274
|
+
defaultTagName: "span",
|
|
275
|
+
render,
|
|
276
|
+
props: mergeProps<"span">(defaultProps, props),
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export type ConversationPreviewCardSecondaryPreviewProps = useRender.ComponentProps<"p">;
|
|
281
|
+
|
|
282
|
+
export function ConversationPreviewCardSecondaryPreview({
|
|
283
|
+
className,
|
|
284
|
+
render,
|
|
285
|
+
...props
|
|
286
|
+
}: ConversationPreviewCardSecondaryPreviewProps) {
|
|
287
|
+
const theme = useThemeFamily();
|
|
288
|
+
const { secondaryPreview } = conversationPreviewCard({ theme });
|
|
289
|
+
const defaultProps: useRender.ElementProps<"p"> = {
|
|
290
|
+
className: secondaryPreview({ className }),
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
return useRender({
|
|
294
|
+
defaultTagName: "p",
|
|
295
|
+
render,
|
|
296
|
+
props: mergeProps<"p">(defaultProps, props),
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export type ConversationPreviewCardFooterProps = useRender.ComponentProps<"div">;
|
|
301
|
+
|
|
302
|
+
export function ConversationPreviewCardFooter({
|
|
303
|
+
className,
|
|
304
|
+
render,
|
|
305
|
+
...props
|
|
306
|
+
}: ConversationPreviewCardFooterProps) {
|
|
307
|
+
const { footer } = conversationPreviewCard();
|
|
308
|
+
const defaultProps: useRender.ElementProps<"div"> = {
|
|
309
|
+
className: footer({ className }),
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
return useRender({
|
|
313
|
+
defaultTagName: "div",
|
|
314
|
+
render,
|
|
315
|
+
props: mergeProps<"div">(defaultProps, props),
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export type ConversationPreviewCardActionProps = useRender.ComponentProps<"div">;
|
|
320
|
+
|
|
321
|
+
export function ConversationPreviewCardAction({
|
|
322
|
+
className,
|
|
323
|
+
render,
|
|
324
|
+
...props
|
|
325
|
+
}: ConversationPreviewCardActionProps) {
|
|
326
|
+
const { action } = conversationPreviewCard();
|
|
327
|
+
const defaultProps: useRender.ElementProps<"div"> = {
|
|
328
|
+
className: action({ className }),
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
return useRender({
|
|
332
|
+
defaultTagName: "div",
|
|
333
|
+
render,
|
|
334
|
+
props: mergeProps<"div">(defaultProps, props),
|
|
335
|
+
});
|
|
336
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export {
|
|
2
|
+
ConversationPreviewCard,
|
|
3
|
+
ConversationPreviewCardAction,
|
|
4
|
+
ConversationPreviewCardAuthor,
|
|
5
|
+
ConversationPreviewCardAuthorName,
|
|
6
|
+
ConversationPreviewCardAuthorSubtitle,
|
|
7
|
+
ConversationPreviewCardChannel,
|
|
8
|
+
ConversationPreviewCardContent,
|
|
9
|
+
ConversationPreviewCardFooter,
|
|
10
|
+
ConversationPreviewCardMeta,
|
|
11
|
+
ConversationPreviewCardPreview,
|
|
12
|
+
ConversationPreviewCardPreviewAuthor,
|
|
13
|
+
ConversationPreviewCardPreviewLeading,
|
|
14
|
+
ConversationPreviewCardSecondaryPreview,
|
|
15
|
+
ConversationPreviewCardTimestamp,
|
|
16
|
+
} from "./conversation-preview-card.tsx";
|
|
17
|
+
export type {
|
|
18
|
+
ConversationPreviewCardActionProps,
|
|
19
|
+
ConversationPreviewCardAuthorNameProps,
|
|
20
|
+
ConversationPreviewCardAuthorProps,
|
|
21
|
+
ConversationPreviewCardAuthorSubtitleProps,
|
|
22
|
+
ConversationPreviewCardChannelProps,
|
|
23
|
+
ConversationPreviewCardContentProps,
|
|
24
|
+
ConversationPreviewCardFooterProps,
|
|
25
|
+
ConversationPreviewCardMetaProps,
|
|
26
|
+
ConversationPreviewCardPreviewAuthorProps,
|
|
27
|
+
ConversationPreviewCardPreviewLeadingProps,
|
|
28
|
+
ConversationPreviewCardPreviewProps,
|
|
29
|
+
ConversationPreviewCardProps,
|
|
30
|
+
ConversationPreviewCardSecondaryPreviewProps,
|
|
31
|
+
ConversationPreviewCardTimestampProps,
|
|
32
|
+
} from "./conversation-preview-card.tsx";
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
import { tv } from "../../lib/tv.ts";
|
|
4
|
+
import { useThemeFamily } from "../../lib/theme/use-theme.ts";
|
|
5
|
+
|
|
6
|
+
const descriptionList = tv({
|
|
7
|
+
slots: {
|
|
8
|
+
root: ["m-0"],
|
|
9
|
+
item: [""],
|
|
10
|
+
term: ["mb-1 flex items-center gap-2 text-xs"],
|
|
11
|
+
details: ["m-0 text-sm"],
|
|
12
|
+
action: ["inline-flex shrink-0 items-center", "[&_svg]:size-3 [&_svg]:shrink-0"],
|
|
13
|
+
},
|
|
14
|
+
variants: {
|
|
15
|
+
theme: {
|
|
16
|
+
brutal: {
|
|
17
|
+
term: "text-foreground/50",
|
|
18
|
+
details: "text-foreground-strong",
|
|
19
|
+
},
|
|
20
|
+
// Elegant styling is deferred; see the component TODO.
|
|
21
|
+
elegant: {},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export type DescriptionListProps = useRender.ComponentProps<"dl">;
|
|
27
|
+
|
|
28
|
+
export function DescriptionList({ className, render, ...props }: DescriptionListProps) {
|
|
29
|
+
const { root } = descriptionList();
|
|
30
|
+
const defaultProps: useRender.ElementProps<"dl"> = {
|
|
31
|
+
className: root({ className }),
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return useRender({
|
|
35
|
+
defaultTagName: "dl",
|
|
36
|
+
render,
|
|
37
|
+
props: mergeProps<"dl">(defaultProps, props),
|
|
38
|
+
state: {
|
|
39
|
+
slot: "description-list",
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type DescriptionItemProps = useRender.ComponentProps<"div">;
|
|
45
|
+
|
|
46
|
+
export function DescriptionItem({ className, render, ...props }: DescriptionItemProps) {
|
|
47
|
+
const { item } = descriptionList();
|
|
48
|
+
const defaultProps: useRender.ElementProps<"div"> = {
|
|
49
|
+
className: item({ className }),
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return useRender({
|
|
53
|
+
defaultTagName: "div",
|
|
54
|
+
render,
|
|
55
|
+
props: mergeProps<"div">(defaultProps, props),
|
|
56
|
+
state: {
|
|
57
|
+
slot: "description-item",
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export type DescriptionTermProps = useRender.ComponentProps<"dt">;
|
|
63
|
+
|
|
64
|
+
export function DescriptionTerm({ className, render, ...props }: DescriptionTermProps) {
|
|
65
|
+
const theme = useThemeFamily();
|
|
66
|
+
const { term } = descriptionList({ theme });
|
|
67
|
+
const defaultProps: useRender.ElementProps<"dt"> = {
|
|
68
|
+
className: term({ className }),
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
return useRender({
|
|
72
|
+
defaultTagName: "dt",
|
|
73
|
+
render,
|
|
74
|
+
props: mergeProps<"dt">(defaultProps, props),
|
|
75
|
+
state: {
|
|
76
|
+
slot: "description-term",
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type DescriptionDetailsProps = useRender.ComponentProps<"dd">;
|
|
82
|
+
|
|
83
|
+
export function DescriptionDetails({ className, render, ...props }: DescriptionDetailsProps) {
|
|
84
|
+
const theme = useThemeFamily();
|
|
85
|
+
const { details } = descriptionList({ theme });
|
|
86
|
+
const defaultProps: useRender.ElementProps<"dd"> = {
|
|
87
|
+
className: details({ className }),
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
return useRender({
|
|
91
|
+
defaultTagName: "dd",
|
|
92
|
+
render,
|
|
93
|
+
props: mergeProps<"dd">(defaultProps, props),
|
|
94
|
+
state: {
|
|
95
|
+
slot: "description-details",
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export type DescriptionActionProps = useRender.ComponentProps<"span">;
|
|
101
|
+
|
|
102
|
+
export function DescriptionAction({ className, render, ...props }: DescriptionActionProps) {
|
|
103
|
+
const { action } = descriptionList();
|
|
104
|
+
const defaultProps: useRender.ElementProps<"span"> = {
|
|
105
|
+
className: action({ className }),
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
return useRender({
|
|
109
|
+
defaultTagName: "span",
|
|
110
|
+
render,
|
|
111
|
+
props: mergeProps<"span">(defaultProps, props),
|
|
112
|
+
state: {
|
|
113
|
+
slot: "description-action",
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export {
|
|
2
|
+
DescriptionAction,
|
|
3
|
+
DescriptionDetails,
|
|
4
|
+
DescriptionItem,
|
|
5
|
+
DescriptionList,
|
|
6
|
+
DescriptionTerm,
|
|
7
|
+
} from "./description-list.tsx";
|
|
8
|
+
export type {
|
|
9
|
+
DescriptionActionProps,
|
|
10
|
+
DescriptionDetailsProps,
|
|
11
|
+
DescriptionItemProps,
|
|
12
|
+
DescriptionListProps,
|
|
13
|
+
DescriptionTermProps,
|
|
14
|
+
} from "./description-list.tsx";
|