raft-ui 0.0.6 → 0.0.7
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/CHANGELOG.md +2 -8
- package/{src → dist}/styles.css +0 -2
- package/package.json +3 -4
- package/src/components/alert-dialog/alert-dialog.tsx +0 -215
- package/src/components/alert-dialog/index.ts +0 -30
- package/src/components/avatar/avatar.tsx +0 -375
- package/src/components/avatar/index.ts +0 -17
- package/src/components/badge/badge.tsx +0 -393
- package/src/components/badge/index.ts +0 -2
- package/src/components/banner/banner.tsx +0 -269
- package/src/components/banner/index.ts +0 -8
- package/src/components/bottom-sheet/bottom-sheet.tsx +0 -152
- package/src/components/bottom-sheet/index.ts +0 -22
- package/src/components/button/button.tsx +0 -499
- package/src/components/button/index.ts +0 -2
- package/src/components/checkbox/checkbox-indicator.tsx +0 -128
- package/src/components/checkbox/checkbox.tsx +0 -350
- package/src/components/checkbox/index.ts +0 -2
- package/src/components/combobox/combobox.tsx +0 -603
- package/src/components/combobox/index.ts +0 -52
- package/src/components/context-menu/context-menu.tsx +0 -380
- package/src/components/context-menu/index.ts +0 -34
- package/src/components/conversation-preview-card/conversation-preview-card.tsx +0 -336
- package/src/components/conversation-preview-card/index.ts +0 -32
- package/src/components/description-list/description-list.tsx +0 -116
- package/src/components/description-list/index.ts +0 -14
- package/src/components/dialog/dialog.tsx +0 -152
- package/src/components/dialog/index.ts +0 -26
- package/src/components/dropdown-menu/dropdown-menu.tsx +0 -405
- package/src/components/dropdown-menu/index.ts +0 -38
- package/src/components/empty-state/empty-state.tsx +0 -177
- package/src/components/empty-state/index.ts +0 -16
- package/src/components/field/field.tsx +0 -125
- package/src/components/field/index.ts +0 -18
- package/src/components/inline-code/index.ts +0 -2
- package/src/components/inline-code/inline-code.tsx +0 -35
- package/src/components/input/index.ts +0 -2
- package/src/components/input/input.tsx +0 -76
- package/src/components/input-group/index.ts +0 -7
- package/src/components/input-group/input-group.tsx +0 -215
- package/src/components/kbd/index.ts +0 -2
- package/src/components/kbd/kbd.tsx +0 -43
- package/src/components/label/index.ts +0 -2
- package/src/components/label/label.tsx +0 -99
- package/src/components/lightbox/index.ts +0 -24
- package/src/components/lightbox/lightbox.tsx +0 -245
- package/src/components/list-item/index.ts +0 -20
- package/src/components/list-item/list-item.tsx +0 -263
- package/src/components/media-list-item/index.ts +0 -20
- package/src/components/media-list-item/media-list-item.tsx +0 -169
- package/src/components/notification-center/index.ts +0 -39
- package/src/components/notification-center/notification-center.tsx +0 -558
- package/src/components/panel-header/index.ts +0 -22
- package/src/components/panel-header/panel-header.tsx +0 -199
- package/src/components/popover/index.ts +0 -30
- package/src/components/popover/popover.tsx +0 -248
- package/src/components/preview-shell/index.ts +0 -2
- package/src/components/preview-shell/preview-shell.tsx +0 -51
- package/src/components/quoted-message-card/index.ts +0 -36
- package/src/components/quoted-message-card/quoted-message-card.tsx +0 -391
- package/src/components/radio-group/index.ts +0 -2
- package/src/components/radio-group/radio-group.tsx +0 -119
- package/src/components/section-header/index.ts +0 -16
- package/src/components/section-header/section-header.tsx +0 -117
- package/src/components/section-label/index.ts +0 -2
- package/src/components/section-label/section-label.tsx +0 -38
- package/src/components/segmented-control/index.ts +0 -12
- package/src/components/segmented-control/segmented-control.tsx +0 -129
- package/src/components/select/index.ts +0 -40
- package/src/components/select/select.tsx +0 -382
- package/src/components/separator/index.ts +0 -2
- package/src/components/separator/separator.tsx +0 -40
- package/src/components/spinner/index.ts +0 -2
- package/src/components/spinner/spinner.tsx +0 -228
- package/src/components/status/index.ts +0 -2
- package/src/components/status/status.tsx +0 -152
- package/src/components/tabs/index.ts +0 -24
- package/src/components/tabs/tabs.tsx +0 -451
- package/src/components/text/index.ts +0 -2
- package/src/components/text/text.tsx +0 -131
- package/src/components/textarea/index.ts +0 -2
- package/src/components/textarea/textarea.tsx +0 -136
- package/src/components/toggle-group/index.ts +0 -7
- package/src/components/toggle-group/toggle-group.tsx +0 -111
- package/src/components/tooltip/index.ts +0 -8
- package/src/components/tooltip/tooltip.tsx +0 -212
- package/src/index.ts +0 -429
- package/src/legacy/AttentionDot.tsx +0 -28
- package/src/legacy/AvatarListRow.tsx +0 -87
- package/src/legacy/AvatarSlot.tsx +0 -157
- package/src/legacy/Badge.tsx +0 -95
- package/src/legacy/Banner.tsx +0 -74
- package/src/legacy/BottomSheet.tsx +0 -76
- package/src/legacy/CheckMarker.tsx +0 -72
- package/src/legacy/Checkbox.tsx +0 -81
- package/src/legacy/ConversationPreviewCard.tsx +0 -169
- package/src/legacy/DismissBackdrop.tsx +0 -68
- package/src/legacy/EmptyState.tsx +0 -63
- package/src/legacy/ExperimentalBadge.tsx +0 -19
- package/src/legacy/FormField.tsx +0 -106
- package/src/legacy/KeyValueRow.tsx +0 -67
- package/src/legacy/Lightbox.tsx +0 -119
- package/src/legacy/NotificationCenter.tsx +0 -217
- package/src/legacy/PanelHeader.tsx +0 -94
- package/src/legacy/PreviewShell.tsx +0 -40
- package/src/legacy/QuotedMessageCard.tsx +0 -181
- package/src/legacy/ReorderablePanelTabs.tsx +0 -156
- package/src/legacy/SandboxedPreviewFrame.tsx +0 -59
- package/src/legacy/SearchInput.tsx +0 -23
- package/src/legacy/SectionEyebrow.tsx +0 -60
- package/src/legacy/SectionHeader.tsx +0 -68
- package/src/legacy/SegmentedControl.tsx +0 -74
- package/src/legacy/SlugInput.tsx +0 -29
- package/src/legacy/Spinner.tsx +0 -89
- package/src/legacy/StatusDot.tsx +0 -51
- package/src/legacy/SurfaceListItem.tsx +0 -32
- package/src/legacy/Textarea.tsx +0 -137
- package/src/legacy/button.tsx +0 -100
- package/src/legacy/context-menu-divider.tsx +0 -12
- package/src/legacy/menu-item.tsx +0 -66
- package/src/legacy/selection-popover.tsx +0 -212
- package/src/legacy/server-switcher-menu.tsx +0 -203
- package/src/legacy/source.css +0 -240
- package/src/lib/cn.ts +0 -1
- package/src/lib/styled-props.ts +0 -11
- package/src/lib/theme/theme-context.ts +0 -28
- package/src/lib/theme/theme-provider.tsx +0 -181
- package/src/lib/theme/use-theme.ts +0 -12
- package/src/lib/tv.ts +0 -29
- package/src/lib/without-children.ts +0 -6
- package/src/wip.ts +0 -291
|
@@ -1,336 +0,0 @@
|
|
|
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";
|
|
5
|
-
import { useThemeFamily } from "../../lib/theme/use-theme";
|
|
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
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
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";
|
|
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";
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { mergeProps } from "@base-ui/react/merge-props";
|
|
2
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
-
import { tv } from "../../lib/tv";
|
|
4
|
-
import { useThemeFamily } from "../../lib/theme/use-theme";
|
|
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
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
DescriptionAction,
|
|
3
|
-
DescriptionDetails,
|
|
4
|
-
DescriptionItem,
|
|
5
|
-
DescriptionList,
|
|
6
|
-
DescriptionTerm,
|
|
7
|
-
} from "./description-list";
|
|
8
|
-
export type {
|
|
9
|
-
DescriptionActionProps,
|
|
10
|
-
DescriptionDetailsProps,
|
|
11
|
-
DescriptionItemProps,
|
|
12
|
-
DescriptionListProps,
|
|
13
|
-
DescriptionTermProps,
|
|
14
|
-
} from "./description-list";
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { Dialog as BaseDialog } from "@base-ui/react/dialog";
|
|
2
|
-
import type { ComponentPropsWithRef } from "react";
|
|
3
|
-
import { tv } from "../../lib/tv";
|
|
4
|
-
import type { StyledProps } from "../../lib/styled-props";
|
|
5
|
-
import { useThemeFamily } from "../../lib/theme/use-theme";
|
|
6
|
-
|
|
7
|
-
const dialog = tv({
|
|
8
|
-
slots: {
|
|
9
|
-
overlay: [
|
|
10
|
-
"fixed inset-0 z-50",
|
|
11
|
-
"transition-opacity duration-100",
|
|
12
|
-
"data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",
|
|
13
|
-
],
|
|
14
|
-
content: [
|
|
15
|
-
"fixed top-1/2 left-1/2 z-50 grid w-[calc(100%-2rem)] max-w-md -translate-x-1/2 -translate-y-1/2",
|
|
16
|
-
"outline-none transition-[opacity,transform] duration-100",
|
|
17
|
-
"data-[starting-style]:scale-95 data-[starting-style]:opacity-0",
|
|
18
|
-
"data-[ending-style]:scale-95 data-[ending-style]:opacity-0",
|
|
19
|
-
],
|
|
20
|
-
header: ["flex min-w-0 flex-col gap-1"],
|
|
21
|
-
body: ["min-w-0"],
|
|
22
|
-
footer: ["flex items-center justify-end gap-3"],
|
|
23
|
-
title: ["m-0 min-w-0 text-foreground-strong"],
|
|
24
|
-
description: ["m-0 text-foreground-muted"],
|
|
25
|
-
},
|
|
26
|
-
variants: {
|
|
27
|
-
theme: {
|
|
28
|
-
brutal: {
|
|
29
|
-
overlay: ["bg-black/60"],
|
|
30
|
-
content: ["gap-4 border-2 border-line-strong bg-layer-panel p-6 shadow-xl"],
|
|
31
|
-
title: ["font-heading text-lg leading-none font-bold uppercase"],
|
|
32
|
-
description: ["font-sans text-sm leading-5 text-foreground/60"],
|
|
33
|
-
},
|
|
34
|
-
elegant: {
|
|
35
|
-
overlay: ["bg-black/20"],
|
|
36
|
-
content: [
|
|
37
|
-
"gap-5 rounded-lg bg-layer-popover p-5",
|
|
38
|
-
"shadow-[0_24px_48px_-24px_oklch(0.21_0.006_285_/_0.30),0_0_0_1px_oklch(0.21_0.006_285_/_0.08),0_1px_2px_oklch(0.21_0.006_285_/_0.08)]",
|
|
39
|
-
],
|
|
40
|
-
title: ["font-sans text-base leading-5 font-medium tracking-[-0.005em]"],
|
|
41
|
-
description: [
|
|
42
|
-
"font-sans text-sm leading-5 text-[oklch(0.48_0_0)] dark:text-[oklch(0.76_0_0)]",
|
|
43
|
-
],
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
export type DialogProps = BaseDialog.Root.Props;
|
|
50
|
-
|
|
51
|
-
export function Dialog(props: DialogProps) {
|
|
52
|
-
return <BaseDialog.Root data-slot="dialog" {...props} />;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export type DialogTriggerProps = BaseDialog.Trigger.Props;
|
|
56
|
-
|
|
57
|
-
export function DialogTrigger(props: DialogTriggerProps) {
|
|
58
|
-
return <BaseDialog.Trigger data-slot="dialog-trigger" {...props} />;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export type DialogPortalProps = BaseDialog.Portal.Props;
|
|
62
|
-
|
|
63
|
-
export function DialogPortal(props: DialogPortalProps) {
|
|
64
|
-
return <BaseDialog.Portal data-slot="dialog-portal" {...props} />;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export type DialogOverlayProps = StyledProps<BaseDialog.Backdrop.Props>;
|
|
68
|
-
|
|
69
|
-
export function DialogOverlay({ className, ...props }: DialogOverlayProps) {
|
|
70
|
-
const theme = useThemeFamily();
|
|
71
|
-
const { overlay } = dialog({ theme });
|
|
72
|
-
return (
|
|
73
|
-
<BaseDialog.Backdrop data-slot="dialog-overlay" className={overlay({ className })} {...props} />
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export type DialogContentProps = StyledProps<BaseDialog.Popup.Props> & {
|
|
78
|
-
portalProps?: DialogPortalProps;
|
|
79
|
-
overlay?: false | DialogOverlayProps;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export function DialogContent({
|
|
83
|
-
className,
|
|
84
|
-
children,
|
|
85
|
-
portalProps,
|
|
86
|
-
overlay,
|
|
87
|
-
...props
|
|
88
|
-
}: DialogContentProps) {
|
|
89
|
-
const theme = useThemeFamily();
|
|
90
|
-
const { content } = dialog({ theme });
|
|
91
|
-
|
|
92
|
-
return (
|
|
93
|
-
<DialogPortal {...portalProps}>
|
|
94
|
-
{overlay === false ? null : <DialogOverlay {...overlay} />}
|
|
95
|
-
<BaseDialog.Popup data-slot="dialog-content" className={content({ className })} {...props}>
|
|
96
|
-
{children}
|
|
97
|
-
</BaseDialog.Popup>
|
|
98
|
-
</DialogPortal>
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export type DialogCloseProps = BaseDialog.Close.Props;
|
|
103
|
-
|
|
104
|
-
export function DialogClose(props: DialogCloseProps) {
|
|
105
|
-
return <BaseDialog.Close data-slot="dialog-close" {...props} />;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export type DialogHeaderProps = ComponentPropsWithRef<"div">;
|
|
109
|
-
|
|
110
|
-
export function DialogHeader({ className, ...props }: DialogHeaderProps) {
|
|
111
|
-
const theme = useThemeFamily();
|
|
112
|
-
const { header } = dialog({ theme });
|
|
113
|
-
return <div data-slot="dialog-header" className={header({ className })} {...props} />;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export type DialogBodyProps = ComponentPropsWithRef<"div">;
|
|
117
|
-
|
|
118
|
-
export function DialogBody({ className, ...props }: DialogBodyProps) {
|
|
119
|
-
const theme = useThemeFamily();
|
|
120
|
-
const { body } = dialog({ theme });
|
|
121
|
-
return <div data-slot="dialog-body" className={body({ className })} {...props} />;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export type DialogFooterProps = ComponentPropsWithRef<"div">;
|
|
125
|
-
|
|
126
|
-
export function DialogFooter({ className, ...props }: DialogFooterProps) {
|
|
127
|
-
const theme = useThemeFamily();
|
|
128
|
-
const { footer } = dialog({ theme });
|
|
129
|
-
return <div data-slot="dialog-footer" className={footer({ className })} {...props} />;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export type DialogTitleProps = StyledProps<BaseDialog.Title.Props>;
|
|
133
|
-
|
|
134
|
-
export function DialogTitle({ className, ...props }: DialogTitleProps) {
|
|
135
|
-
const theme = useThemeFamily();
|
|
136
|
-
const { title } = dialog({ theme });
|
|
137
|
-
return <BaseDialog.Title data-slot="dialog-title" className={title({ className })} {...props} />;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export type DialogDescriptionProps = StyledProps<BaseDialog.Description.Props>;
|
|
141
|
-
|
|
142
|
-
export function DialogDescription({ className, ...props }: DialogDescriptionProps) {
|
|
143
|
-
const theme = useThemeFamily();
|
|
144
|
-
const { description } = dialog({ theme });
|
|
145
|
-
return (
|
|
146
|
-
<BaseDialog.Description
|
|
147
|
-
data-slot="dialog-description"
|
|
148
|
-
className={description({ className })}
|
|
149
|
-
{...props}
|
|
150
|
-
/>
|
|
151
|
-
);
|
|
152
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
Dialog,
|
|
3
|
-
DialogBody,
|
|
4
|
-
DialogClose,
|
|
5
|
-
DialogContent,
|
|
6
|
-
DialogDescription,
|
|
7
|
-
DialogFooter,
|
|
8
|
-
DialogHeader,
|
|
9
|
-
DialogOverlay,
|
|
10
|
-
DialogPortal,
|
|
11
|
-
DialogTitle,
|
|
12
|
-
DialogTrigger,
|
|
13
|
-
} from "./dialog";
|
|
14
|
-
export type {
|
|
15
|
-
DialogBodyProps,
|
|
16
|
-
DialogCloseProps,
|
|
17
|
-
DialogContentProps,
|
|
18
|
-
DialogDescriptionProps,
|
|
19
|
-
DialogFooterProps,
|
|
20
|
-
DialogHeaderProps,
|
|
21
|
-
DialogOverlayProps,
|
|
22
|
-
DialogPortalProps,
|
|
23
|
-
DialogProps,
|
|
24
|
-
DialogTitleProps,
|
|
25
|
-
DialogTriggerProps,
|
|
26
|
-
} from "./dialog";
|