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.
Files changed (134) hide show
  1. package/README.md +24 -0
  2. package/dist/cn.d.mts +2 -0
  3. package/dist/cn.mjs +2 -0
  4. package/dist/index.d.mts +2710 -0
  5. package/dist/index.mjs +4821 -0
  6. package/dist/label-DWq4ia5I.mjs +115 -0
  7. package/dist/styled-props-B3SNekJg.d.mts +16 -0
  8. package/dist/wip.d.mts +1238 -0
  9. package/dist/wip.mjs +1416 -0
  10. package/package.json +70 -0
  11. package/src/components/avatar/avatar.tsx +375 -0
  12. package/src/components/avatar/index.ts +17 -0
  13. package/src/components/badge/badge.tsx +393 -0
  14. package/src/components/badge/index.ts +2 -0
  15. package/src/components/banner/banner.tsx +269 -0
  16. package/src/components/banner/index.ts +8 -0
  17. package/src/components/bottom-sheet/bottom-sheet.tsx +152 -0
  18. package/src/components/bottom-sheet/index.ts +22 -0
  19. package/src/components/button/button.tsx +497 -0
  20. package/src/components/button/index.ts +2 -0
  21. package/src/components/checkbox/checkbox-indicator.tsx +128 -0
  22. package/src/components/checkbox/checkbox.tsx +350 -0
  23. package/src/components/checkbox/index.ts +2 -0
  24. package/src/components/combobox/combobox.tsx +603 -0
  25. package/src/components/combobox/index.ts +52 -0
  26. package/src/components/context-menu/context-menu.tsx +380 -0
  27. package/src/components/context-menu/index.ts +34 -0
  28. package/src/components/conversation-preview-card/conversation-preview-card.tsx +336 -0
  29. package/src/components/conversation-preview-card/index.ts +32 -0
  30. package/src/components/description-list/description-list.tsx +116 -0
  31. package/src/components/description-list/index.ts +14 -0
  32. package/src/components/dropdown-menu/dropdown-menu.tsx +405 -0
  33. package/src/components/dropdown-menu/index.ts +38 -0
  34. package/src/components/empty-state/empty-state.tsx +177 -0
  35. package/src/components/empty-state/index.ts +16 -0
  36. package/src/components/field/field.tsx +125 -0
  37. package/src/components/field/index.ts +18 -0
  38. package/src/components/inline-code/index.ts +2 -0
  39. package/src/components/inline-code/inline-code.tsx +33 -0
  40. package/src/components/input/index.ts +2 -0
  41. package/src/components/input/input.tsx +76 -0
  42. package/src/components/input-group/index.ts +7 -0
  43. package/src/components/input-group/input-group.tsx +215 -0
  44. package/src/components/kbd/index.ts +2 -0
  45. package/src/components/kbd/kbd.tsx +43 -0
  46. package/src/components/label/index.ts +7 -0
  47. package/src/components/label/label.tsx +99 -0
  48. package/src/components/lightbox/index.ts +24 -0
  49. package/src/components/lightbox/lightbox.tsx +245 -0
  50. package/src/components/list-item/index.ts +20 -0
  51. package/src/components/list-item/list-item.tsx +263 -0
  52. package/src/components/media-list-item/index.ts +20 -0
  53. package/src/components/media-list-item/media-list-item.tsx +169 -0
  54. package/src/components/notification-center/index.ts +39 -0
  55. package/src/components/notification-center/notification-center.tsx +558 -0
  56. package/src/components/panel-header/index.ts +22 -0
  57. package/src/components/panel-header/panel-header.tsx +199 -0
  58. package/src/components/popover/index.ts +30 -0
  59. package/src/components/popover/popover.tsx +248 -0
  60. package/src/components/preview-shell/index.ts +2 -0
  61. package/src/components/preview-shell/preview-shell.tsx +51 -0
  62. package/src/components/quoted-message-card/index.ts +36 -0
  63. package/src/components/quoted-message-card/quoted-message-card.tsx +391 -0
  64. package/src/components/radio-group/index.ts +6 -0
  65. package/src/components/radio-group/radio-group.tsx +119 -0
  66. package/src/components/section-header/index.ts +16 -0
  67. package/src/components/section-header/section-header.tsx +117 -0
  68. package/src/components/section-label/index.ts +2 -0
  69. package/src/components/section-label/section-label.tsx +38 -0
  70. package/src/components/segmented-control/index.ts +12 -0
  71. package/src/components/segmented-control/segmented-control.tsx +129 -0
  72. package/src/components/select/index.ts +40 -0
  73. package/src/components/select/select.tsx +382 -0
  74. package/src/components/spinner/index.ts +2 -0
  75. package/src/components/spinner/spinner.tsx +228 -0
  76. package/src/components/status/index.ts +2 -0
  77. package/src/components/status/status.tsx +152 -0
  78. package/src/components/tabs/index.ts +24 -0
  79. package/src/components/tabs/tabs.tsx +417 -0
  80. package/src/components/text/index.ts +2 -0
  81. package/src/components/text/text.tsx +130 -0
  82. package/src/components/textarea/index.ts +2 -0
  83. package/src/components/textarea/textarea.tsx +136 -0
  84. package/src/components/toggle-group/index.ts +12 -0
  85. package/src/components/toggle-group/toggle-group.tsx +111 -0
  86. package/src/components/tooltip/index.ts +14 -0
  87. package/src/components/tooltip/tooltip.tsx +186 -0
  88. package/src/fonts/brutal.css +2 -0
  89. package/src/index.ts +404 -0
  90. package/src/legacy/AttentionDot.tsx +28 -0
  91. package/src/legacy/AvatarListRow.tsx +87 -0
  92. package/src/legacy/AvatarSlot.tsx +157 -0
  93. package/src/legacy/Badge.tsx +95 -0
  94. package/src/legacy/Banner.tsx +74 -0
  95. package/src/legacy/BottomSheet.tsx +76 -0
  96. package/src/legacy/CheckMarker.tsx +72 -0
  97. package/src/legacy/Checkbox.tsx +81 -0
  98. package/src/legacy/ConversationPreviewCard.tsx +169 -0
  99. package/src/legacy/DismissBackdrop.tsx +68 -0
  100. package/src/legacy/EmptyState.tsx +63 -0
  101. package/src/legacy/ExperimentalBadge.tsx +19 -0
  102. package/src/legacy/FormField.tsx +106 -0
  103. package/src/legacy/KeyValueRow.tsx +67 -0
  104. package/src/legacy/Lightbox.tsx +119 -0
  105. package/src/legacy/NotificationCenter.tsx +217 -0
  106. package/src/legacy/PanelHeader.tsx +94 -0
  107. package/src/legacy/PreviewShell.tsx +40 -0
  108. package/src/legacy/QuotedMessageCard.tsx +181 -0
  109. package/src/legacy/ReorderablePanelTabs.tsx +151 -0
  110. package/src/legacy/SandboxedPreviewFrame.tsx +59 -0
  111. package/src/legacy/SearchInput.tsx +23 -0
  112. package/src/legacy/SectionEyebrow.tsx +60 -0
  113. package/src/legacy/SectionHeader.tsx +68 -0
  114. package/src/legacy/SegmentedControl.tsx +74 -0
  115. package/src/legacy/SlugInput.tsx +29 -0
  116. package/src/legacy/Spinner.tsx +89 -0
  117. package/src/legacy/StatusDot.tsx +51 -0
  118. package/src/legacy/SurfaceListItem.tsx +32 -0
  119. package/src/legacy/Textarea.tsx +137 -0
  120. package/src/legacy/button.tsx +100 -0
  121. package/src/legacy/context-menu-divider.tsx +12 -0
  122. package/src/legacy/menu-item.tsx +66 -0
  123. package/src/legacy/selection-popover.tsx +212 -0
  124. package/src/legacy/server-switcher-menu.tsx +203 -0
  125. package/src/legacy/source.css +240 -0
  126. package/src/lib/cn.ts +1 -0
  127. package/src/lib/styled-props.ts +11 -0
  128. package/src/lib/theme/theme-context.ts +28 -0
  129. package/src/lib/theme/theme-provider.tsx +181 -0
  130. package/src/lib/theme/use-theme.ts +12 -0
  131. package/src/lib/tv.ts +29 -0
  132. package/src/lib/without-children.ts +6 -0
  133. package/src/styles.css +467 -0
  134. package/src/wip.ts +255 -0
@@ -0,0 +1,245 @@
1
+ import { Dialog } from "@base-ui/react/dialog";
2
+ import { mergeProps } from "@base-ui/react/merge-props";
3
+ import { useRender } from "@base-ui/react/use-render";
4
+ import { useHotkey } from "@tanstack/react-hotkeys";
5
+ import { useCallback, useRef, useState, type ReactNode, type RefObject } from "react";
6
+ import { tv } from "../../lib/tv.ts";
7
+ import type { StyledProps } from "../../lib/styled-props.ts";
8
+ import { useThemeFamily } from "../../lib/theme/use-theme.ts";
9
+
10
+ const lightbox = tv({
11
+ slots: {
12
+ backdrop: ["fixed inset-0 z-[70] bg-layer-backdrop data-[closed]:hidden"],
13
+ content: ["pointer-events-none fixed inset-0 z-[71] data-[closed]:hidden"],
14
+ header: ["safe-top safe-left safe-right pointer-events-auto shrink-0"],
15
+ title: ["min-w-0 flex-1 truncate font-heading text-sm font-bold"],
16
+ actions: ["flex shrink-0 items-center gap-1.5"],
17
+ stage: [
18
+ "pointer-events-none relative flex min-h-0 flex-1 items-center justify-center overflow-hidden",
19
+ ],
20
+ media: ["pointer-events-auto max-h-[80vh] max-w-[86vw] border-2"],
21
+ close: [],
22
+ },
23
+ variants: {
24
+ theme: {
25
+ brutal: {
26
+ header: ["border-b-2 border-line-strong bg-layer-panel"],
27
+ title: ["text-foreground-strong"],
28
+ media: ["border-line-strong bg-layer-panel shadow-xl"],
29
+ },
30
+ elegant: {},
31
+ },
32
+ },
33
+ });
34
+
35
+ export type LightboxProps<Payload = unknown> = Omit<
36
+ Dialog.Root.Props<Payload>,
37
+ "actionsRef" | "children" | "handle"
38
+ > & {
39
+ children?: ReactNode;
40
+ closeOnModW?: boolean;
41
+ };
42
+
43
+ export function Lightbox<Payload = unknown>({
44
+ closeOnModW = true,
45
+ defaultOpen = false,
46
+ modal = true,
47
+ onOpenChange,
48
+ open,
49
+ children,
50
+ ...props
51
+ }: LightboxProps<Payload>) {
52
+ const dialogRef = useRef<Dialog.Root.Actions>(null);
53
+ const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
54
+ const effectiveOpen = open ?? uncontrolledOpen;
55
+
56
+ const handleOpenChange = useCallback<NonNullable<Dialog.Root.Props<Payload>["onOpenChange"]>>(
57
+ (nextOpen, eventDetails) => {
58
+ if (open === undefined) {
59
+ setUncontrolledOpen(nextOpen);
60
+ }
61
+ onOpenChange?.(nextOpen, eventDetails);
62
+ },
63
+ [onOpenChange, open],
64
+ );
65
+
66
+ const modWClose =
67
+ closeOnModW && effectiveOpen ? <LightboxModWClose dialogRef={dialogRef} /> : null;
68
+
69
+ return (
70
+ <Dialog.Root
71
+ actionsRef={dialogRef}
72
+ defaultOpen={defaultOpen}
73
+ modal={modal}
74
+ onOpenChange={handleOpenChange}
75
+ open={open}
76
+ {...props}
77
+ >
78
+ {modWClose}
79
+ {children}
80
+ </Dialog.Root>
81
+ );
82
+ }
83
+
84
+ type LightboxModWCloseProps = {
85
+ dialogRef: RefObject<Dialog.Root.Actions | null>;
86
+ };
87
+
88
+ function LightboxModWClose({ dialogRef }: LightboxModWCloseProps) {
89
+ useHotkey(
90
+ "Mod+W",
91
+ (event) => {
92
+ event.preventDefault();
93
+ event.stopPropagation();
94
+ dialogRef.current?.close();
95
+ },
96
+ {
97
+ meta: {
98
+ name: "Close lightbox",
99
+ description: "Close the active lightbox before the browser closes the tab.",
100
+ },
101
+ },
102
+ );
103
+
104
+ return null;
105
+ }
106
+
107
+ export type LightboxTriggerProps = Dialog.Trigger.Props;
108
+
109
+ export function LightboxTrigger(props: LightboxTriggerProps) {
110
+ return <Dialog.Trigger data-slot="lightbox-trigger" {...props} />;
111
+ }
112
+
113
+ export type LightboxPortalProps = Dialog.Portal.Props;
114
+
115
+ export function LightboxPortal(props: LightboxPortalProps) {
116
+ return <Dialog.Portal data-slot="lightbox-portal" {...props} />;
117
+ }
118
+
119
+ export type LightboxContentProps = StyledProps<Dialog.Popup.Props>;
120
+
121
+ export function LightboxContent({
122
+ className,
123
+ initialFocus = false,
124
+ finalFocus = false,
125
+ ...props
126
+ }: LightboxContentProps) {
127
+ const theme = useThemeFamily();
128
+ const { backdrop, content } = lightbox({ theme });
129
+ return (
130
+ <LightboxPortal>
131
+ <Dialog.Backdrop data-slot="lightbox-backdrop" className={backdrop()} />
132
+ <Dialog.Popup
133
+ data-slot="lightbox-content"
134
+ initialFocus={initialFocus}
135
+ finalFocus={finalFocus}
136
+ className={content({ className })}
137
+ {...props}
138
+ />
139
+ </LightboxPortal>
140
+ );
141
+ }
142
+
143
+ export type LightboxHeaderProps = useRender.ComponentProps<"div">;
144
+
145
+ export function LightboxHeader({ render, className, ...props }: LightboxHeaderProps) {
146
+ const theme = useThemeFamily();
147
+ const { header } = lightbox({ theme });
148
+ const defaultProps: useRender.ElementProps<"div"> = {
149
+ className: header({ className }),
150
+ };
151
+
152
+ return useRender({
153
+ defaultTagName: "div",
154
+ render,
155
+ props: mergeProps<"div">(defaultProps, props),
156
+ state: {
157
+ slot: "lightbox-header",
158
+ },
159
+ });
160
+ }
161
+
162
+ export type LightboxTitleProps = useRender.ComponentProps<"div">;
163
+
164
+ export function LightboxTitle({ render, className, ...props }: LightboxTitleProps) {
165
+ const theme = useThemeFamily();
166
+ const { title } = lightbox({ theme });
167
+ const defaultProps: useRender.ElementProps<"div"> = {
168
+ className: title({ className }),
169
+ };
170
+
171
+ return useRender({
172
+ defaultTagName: "div",
173
+ render,
174
+ props: mergeProps<"div">(defaultProps, props),
175
+ state: {
176
+ slot: "lightbox-title",
177
+ },
178
+ });
179
+ }
180
+
181
+ export type LightboxActionsProps = useRender.ComponentProps<"div">;
182
+
183
+ export function LightboxActions({ render, className, ...props }: LightboxActionsProps) {
184
+ const theme = useThemeFamily();
185
+ const { actions } = lightbox({ theme });
186
+ const defaultProps: useRender.ElementProps<"div"> = {
187
+ className: actions({ className }),
188
+ };
189
+
190
+ return useRender({
191
+ defaultTagName: "div",
192
+ render,
193
+ props: mergeProps<"div">(defaultProps, props),
194
+ state: {
195
+ slot: "lightbox-actions",
196
+ },
197
+ });
198
+ }
199
+
200
+ export type LightboxStageProps = useRender.ComponentProps<"div">;
201
+
202
+ export function LightboxStage({ render, className, ...props }: LightboxStageProps) {
203
+ const theme = useThemeFamily();
204
+ const { stage } = lightbox({ theme });
205
+ const defaultProps: useRender.ElementProps<"div"> = {
206
+ className: stage({ className }),
207
+ };
208
+
209
+ return useRender({
210
+ defaultTagName: "div",
211
+ render,
212
+ props: mergeProps<"div">(defaultProps, props),
213
+ state: {
214
+ slot: "lightbox-stage",
215
+ },
216
+ });
217
+ }
218
+
219
+ export type LightboxMediaProps = useRender.ComponentProps<"div">;
220
+
221
+ export function LightboxMedia({ render, className, ...props }: LightboxMediaProps) {
222
+ const theme = useThemeFamily();
223
+ const { media } = lightbox({ theme });
224
+ const defaultProps: useRender.ElementProps<"div"> = {
225
+ className: media({ className }),
226
+ };
227
+
228
+ return useRender({
229
+ defaultTagName: "div",
230
+ render,
231
+ props: mergeProps<"div">(defaultProps, props),
232
+ state: {
233
+ slot: "lightbox-media",
234
+ },
235
+ });
236
+ }
237
+
238
+ export type LightboxCloseProps = StyledProps<Dialog.Close.Props>;
239
+
240
+ export function LightboxClose({ className, ...props }: LightboxCloseProps) {
241
+ const theme = useThemeFamily();
242
+ const { close } = lightbox({ theme });
243
+
244
+ return <Dialog.Close data-slot="lightbox-close" className={close({ className })} {...props} />;
245
+ }
@@ -0,0 +1,20 @@
1
+ export {
2
+ ListItem,
3
+ ListItemActionGroup,
4
+ ListItemBody,
5
+ ListItemDescription,
6
+ ListItemIcon,
7
+ ListItemRow,
8
+ ListItemMeta,
9
+ ListItemTitle,
10
+ } from "./list-item.tsx";
11
+ export type {
12
+ ListItemActionGroupProps,
13
+ ListItemBodyProps,
14
+ ListItemDescriptionProps,
15
+ ListItemIconProps,
16
+ ListItemRowProps,
17
+ ListItemMetaProps,
18
+ ListItemProps,
19
+ ListItemTitleProps,
20
+ } from "./list-item.tsx";
@@ -0,0 +1,263 @@
1
+ import { mergeProps } from "@base-ui/react/merge-props";
2
+ import { useRender } from "@base-ui/react/use-render";
3
+ import { tv, type VariantProps } from "../../lib/tv.ts";
4
+ import { useThemeFamily } from "../../lib/theme/use-theme.ts";
5
+
6
+ const listItem = tv({
7
+ slots: {
8
+ root: ["px-4 py-3 transition-colors"],
9
+ body: [
10
+ "min-w-0",
11
+ "grid grid-cols-[minmax(0,1fr)]",
12
+ "has-[>[data-slot=list-item-icon]]:grid-cols-[auto_minmax(0,1fr)]",
13
+ "has-[>[data-slot=list-item-icon]]:items-start",
14
+ "has-[>[data-slot=list-item-icon]]:gap-x-2",
15
+ "has-[>[data-slot=list-item-icon]]:[&>[data-slot=list-item-icon]]:col-start-1",
16
+ "has-[>[data-slot=list-item-icon]]:[&>[data-slot=list-item-icon]]:row-start-1",
17
+ "has-[>[data-slot=list-item-icon]]:[&>[data-slot=list-item-row]]:col-start-2",
18
+ "has-[>[data-slot=list-item-icon]]:[&>[data-slot=list-item-description]]:col-span-2",
19
+ "has-[>[data-slot=list-item-icon]]:[&>[data-slot=list-item-description]]:col-start-1",
20
+ "has-[>[data-slot=list-item-icon]]:[&>[data-slot=list-item-description]]:row-start-2",
21
+ "has-[>[data-slot=list-item-icon]]:[&>[data-slot=list-item-meta]]:col-start-2",
22
+ "has-[>[data-slot=list-item-icon]]:[&>[data-slot=list-item-action-group]]:col-start-2",
23
+ ],
24
+ icon: ["shrink-0 self-start", "[&_svg]:size-3.5 [&_svg]:shrink-0"],
25
+ row: ["flex min-w-0 flex-wrap items-center gap-2", "[&_svg]:size-3.5 [&_svg]:shrink-0"],
26
+ title: ["break-words text-sm font-bold"],
27
+ description: ["mt-1 text-xs"],
28
+ meta: [
29
+ "mt-1 flex min-w-0 flex-wrap items-center gap-2 text-xs",
30
+ "[&_svg]:size-3 [&_svg]:shrink-0",
31
+ ],
32
+ actionGroup: ["mt-2 flex flex-wrap items-center gap-2", "[&_svg]:size-3 [&_svg]:shrink-0"],
33
+ },
34
+ variants: {
35
+ theme: {
36
+ brutal: {
37
+ root: ["border-2"],
38
+ icon: ["mt-0.5 text-foreground/50"],
39
+ title: "text-foreground-strong",
40
+ description: "text-foreground/60",
41
+ meta: "text-foreground/50",
42
+ },
43
+ elegant: {
44
+ root: [
45
+ "rounded-sm border",
46
+ "border-line-muted bg-layer-panel",
47
+ "outline-none",
48
+ "transition-[background-color,border-color] duration-150",
49
+ "focus-visible:ring-2 focus-visible:ring-line-focus",
50
+ ],
51
+ icon: ["mt-0.5 text-foreground-muted"],
52
+ row: ["items-center gap-2"],
53
+ title: ["text-sm font-medium leading-snug tracking-[-0.005em]", "text-foreground-strong"],
54
+ description: ["mt-1 text-[0.8125rem] font-normal leading-normal", "text-foreground-muted"],
55
+ meta: ["text-foreground-muted"],
56
+ actionGroup: ["mt-2 gap-2"],
57
+ },
58
+ },
59
+ selected: {
60
+ true: {
61
+ root: "",
62
+ },
63
+ false: {
64
+ root: "",
65
+ },
66
+ },
67
+ interactive: {
68
+ true: {
69
+ root: "",
70
+ },
71
+ false: {
72
+ root: "",
73
+ },
74
+ },
75
+ },
76
+ compoundVariants: [
77
+ {
78
+ theme: "brutal",
79
+ selected: true,
80
+ class: {
81
+ root: "border-line-strong bg-info-base/15 shadow-sm",
82
+ },
83
+ },
84
+ { theme: "brutal", selected: false, class: { root: "border-line-subtle bg-layer-panel" } },
85
+ {
86
+ theme: "brutal",
87
+ selected: false,
88
+ interactive: true,
89
+ class: { root: "hover:border-line-strong hover:shadow-sm" },
90
+ },
91
+ {
92
+ theme: "elegant",
93
+ selected: true,
94
+ class: {
95
+ root: ["border-info-light", "bg-info-lighter"],
96
+ },
97
+ },
98
+ {
99
+ theme: "elegant",
100
+ selected: false,
101
+ interactive: true,
102
+ class: {
103
+ root: "hover:bg-layer-muted",
104
+ },
105
+ },
106
+ ],
107
+ defaultVariants: {
108
+ selected: false,
109
+ interactive: true,
110
+ },
111
+ });
112
+
113
+ export type ListItemProps = useRender.ComponentProps<"div"> &
114
+ Omit<VariantProps<typeof listItem>, "theme">;
115
+
116
+ export function ListItem({ selected, interactive, className, render, ...props }: ListItemProps) {
117
+ const theme = useThemeFamily();
118
+ const { root } = listItem({ theme, selected, interactive });
119
+ const defaultProps: useRender.ElementProps<"div"> = {
120
+ className: root({ className }),
121
+ };
122
+
123
+ return useRender({
124
+ defaultTagName: "div",
125
+ render,
126
+ props: mergeProps<"div">(defaultProps, props),
127
+ state: {
128
+ slot: "list-item",
129
+ },
130
+ });
131
+ }
132
+
133
+ export type ListItemBodyProps = useRender.ComponentProps<"div">;
134
+
135
+ export function ListItemBody({ className, render, ...props }: ListItemBodyProps) {
136
+ const { body } = listItem();
137
+ const defaultProps: useRender.ElementProps<"div"> = {
138
+ className: body({ className }),
139
+ };
140
+
141
+ return useRender({
142
+ defaultTagName: "div",
143
+ render,
144
+ props: mergeProps<"div">(defaultProps, props),
145
+ state: {
146
+ slot: "list-item-body",
147
+ },
148
+ });
149
+ }
150
+
151
+ export type ListItemIconProps = useRender.ComponentProps<"div">;
152
+
153
+ export function ListItemIcon({ className, render, ...props }: ListItemIconProps) {
154
+ const theme = useThemeFamily();
155
+ const { icon } = listItem({ theme });
156
+ const defaultProps: useRender.ElementProps<"div"> = {
157
+ className: icon({ className }),
158
+ };
159
+
160
+ return useRender({
161
+ defaultTagName: "div",
162
+ render,
163
+ props: mergeProps<"div">(defaultProps, props),
164
+ state: {
165
+ slot: "list-item-icon",
166
+ },
167
+ });
168
+ }
169
+
170
+ export type ListItemRowProps = useRender.ComponentProps<"div">;
171
+
172
+ export function ListItemRow({ className, render, ...props }: ListItemRowProps) {
173
+ const theme = useThemeFamily();
174
+ const { row } = listItem({ theme });
175
+ const defaultProps: useRender.ElementProps<"div"> = {
176
+ className: row({ className }),
177
+ };
178
+
179
+ return useRender({
180
+ defaultTagName: "div",
181
+ render,
182
+ props: mergeProps<"div">(defaultProps, props),
183
+ state: {
184
+ slot: "list-item-row",
185
+ },
186
+ });
187
+ }
188
+
189
+ export type ListItemTitleProps = useRender.ComponentProps<"div">;
190
+
191
+ export function ListItemTitle({ className, render, ...props }: ListItemTitleProps) {
192
+ const theme = useThemeFamily();
193
+ const { title } = listItem({ theme });
194
+ const defaultProps: useRender.ElementProps<"div"> = {
195
+ className: title({ className }),
196
+ };
197
+
198
+ return useRender({
199
+ defaultTagName: "div",
200
+ render,
201
+ props: mergeProps<"div">(defaultProps, props),
202
+ state: {
203
+ slot: "list-item-title",
204
+ },
205
+ });
206
+ }
207
+
208
+ export type ListItemDescriptionProps = useRender.ComponentProps<"p">;
209
+
210
+ export function ListItemDescription({ className, render, ...props }: ListItemDescriptionProps) {
211
+ const theme = useThemeFamily();
212
+ const { description } = listItem({ theme });
213
+ const defaultProps: useRender.ElementProps<"p"> = {
214
+ className: description({ className }),
215
+ };
216
+
217
+ return useRender({
218
+ defaultTagName: "p",
219
+ render,
220
+ props: mergeProps<"p">(defaultProps, props),
221
+ state: {
222
+ slot: "list-item-description",
223
+ },
224
+ });
225
+ }
226
+
227
+ export type ListItemMetaProps = useRender.ComponentProps<"div">;
228
+
229
+ export function ListItemMeta({ className, render, ...props }: ListItemMetaProps) {
230
+ const theme = useThemeFamily();
231
+ const { meta } = listItem({ theme });
232
+ const defaultProps: useRender.ElementProps<"div"> = {
233
+ className: meta({ className }),
234
+ };
235
+
236
+ return useRender({
237
+ defaultTagName: "div",
238
+ render,
239
+ props: mergeProps<"div">(defaultProps, props),
240
+ state: {
241
+ slot: "list-item-meta",
242
+ },
243
+ });
244
+ }
245
+
246
+ export type ListItemActionGroupProps = useRender.ComponentProps<"div">;
247
+
248
+ export function ListItemActionGroup({ className, render, ...props }: ListItemActionGroupProps) {
249
+ const theme = useThemeFamily();
250
+ const { actionGroup } = listItem({ theme });
251
+ const defaultProps: useRender.ElementProps<"div"> = {
252
+ className: actionGroup({ className }),
253
+ };
254
+
255
+ return useRender({
256
+ defaultTagName: "div",
257
+ render,
258
+ props: mergeProps<"div">(defaultProps, props),
259
+ state: {
260
+ slot: "list-item-action-group",
261
+ },
262
+ });
263
+ }
@@ -0,0 +1,20 @@
1
+ export {
2
+ MediaListItem,
3
+ MediaListItemActionGroup,
4
+ MediaListItemBody,
5
+ MediaListItemText,
6
+ MediaListItemTitle,
7
+ MediaListItemSubtitle,
8
+ MediaListItemAside,
9
+ MediaListItemVisual,
10
+ } from "./media-list-item.tsx";
11
+ export type {
12
+ MediaListItemProps,
13
+ MediaListItemActionGroupProps,
14
+ MediaListItemBodyProps,
15
+ MediaListItemTextProps,
16
+ MediaListItemTitleProps,
17
+ MediaListItemSubtitleProps,
18
+ MediaListItemAsideProps,
19
+ MediaListItemVisualProps,
20
+ } from "./media-list-item.tsx";