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,199 @@
|
|
|
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 panelHeader = tv({
|
|
7
|
+
slots: {
|
|
8
|
+
root: ["flex h-[62px] items-center gap-3 px-5", "[@media(max-height:600px)]:h-12"],
|
|
9
|
+
icon: [
|
|
10
|
+
"hidden size-9 shrink-0 items-center justify-center border-2 md:flex",
|
|
11
|
+
"[&_svg]:size-[18px]",
|
|
12
|
+
],
|
|
13
|
+
visual: ["hidden shrink-0 md:flex"],
|
|
14
|
+
content: ["min-w-0 flex-1"],
|
|
15
|
+
titleRow: ["flex min-w-0 items-center gap-2"],
|
|
16
|
+
title: ["truncate text-base font-bold leading-tight"],
|
|
17
|
+
suffix: ["shrink-0"],
|
|
18
|
+
subtitle: ["truncate font-mono text-xs"],
|
|
19
|
+
actions: ["flex shrink-0 items-center gap-1.5"],
|
|
20
|
+
},
|
|
21
|
+
variants: {
|
|
22
|
+
theme: {
|
|
23
|
+
brutal: {
|
|
24
|
+
root: "border-b-2 border-line-strong bg-layer-panel",
|
|
25
|
+
icon: "border-line-strong",
|
|
26
|
+
title: "text-foreground-strong",
|
|
27
|
+
subtitle: "text-foreground/50",
|
|
28
|
+
},
|
|
29
|
+
// Elegant styling is deferred; see the component TODO.
|
|
30
|
+
elegant: {},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export type PanelHeaderProps = useRender.ComponentProps<"div">;
|
|
36
|
+
|
|
37
|
+
export function PanelHeader({ className, render, ...props }: PanelHeaderProps) {
|
|
38
|
+
const theme = useThemeFamily();
|
|
39
|
+
const { root } = panelHeader({ theme });
|
|
40
|
+
const defaultProps: useRender.ElementProps<"div"> = {
|
|
41
|
+
className: root({ className }),
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return useRender({
|
|
45
|
+
defaultTagName: "div",
|
|
46
|
+
render,
|
|
47
|
+
props: mergeProps<"div">(defaultProps, props),
|
|
48
|
+
state: {
|
|
49
|
+
slot: "panel-header",
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export type PanelHeaderIconProps = useRender.ComponentProps<"div">;
|
|
55
|
+
|
|
56
|
+
export function PanelHeaderIcon({ className, render, ...props }: PanelHeaderIconProps) {
|
|
57
|
+
const theme = useThemeFamily();
|
|
58
|
+
const { icon } = panelHeader({ theme });
|
|
59
|
+
const defaultProps: useRender.ElementProps<"div"> = {
|
|
60
|
+
className: icon({ className }),
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return useRender({
|
|
64
|
+
defaultTagName: "div",
|
|
65
|
+
render,
|
|
66
|
+
props: mergeProps<"div">(defaultProps, props),
|
|
67
|
+
state: {
|
|
68
|
+
slot: "panel-header-icon",
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export type PanelHeaderVisualProps = useRender.ComponentProps<"div">;
|
|
74
|
+
|
|
75
|
+
export function PanelHeaderVisual({ className, render, ...props }: PanelHeaderVisualProps) {
|
|
76
|
+
const { visual } = panelHeader();
|
|
77
|
+
const defaultProps: useRender.ElementProps<"div"> = {
|
|
78
|
+
className: visual({ className }),
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
return useRender({
|
|
82
|
+
defaultTagName: "div",
|
|
83
|
+
render,
|
|
84
|
+
props: mergeProps<"div">(defaultProps, props),
|
|
85
|
+
state: {
|
|
86
|
+
slot: "panel-header-visual",
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export type PanelHeaderContentProps = useRender.ComponentProps<"div">;
|
|
92
|
+
|
|
93
|
+
export function PanelHeaderContent({ className, render, ...props }: PanelHeaderContentProps) {
|
|
94
|
+
const { content } = panelHeader();
|
|
95
|
+
const defaultProps: useRender.ElementProps<"div"> = {
|
|
96
|
+
className: content({ className }),
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
return useRender({
|
|
100
|
+
defaultTagName: "div",
|
|
101
|
+
render,
|
|
102
|
+
props: mergeProps<"div">(defaultProps, props),
|
|
103
|
+
state: {
|
|
104
|
+
slot: "panel-header-content",
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export type PanelHeaderTitleRowProps = useRender.ComponentProps<"div">;
|
|
110
|
+
|
|
111
|
+
export function PanelHeaderTitleRow({ className, render, ...props }: PanelHeaderTitleRowProps) {
|
|
112
|
+
const { titleRow } = panelHeader();
|
|
113
|
+
const defaultProps: useRender.ElementProps<"div"> = {
|
|
114
|
+
className: titleRow({ className }),
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
return useRender({
|
|
118
|
+
defaultTagName: "div",
|
|
119
|
+
render,
|
|
120
|
+
props: mergeProps<"div">(defaultProps, props),
|
|
121
|
+
state: {
|
|
122
|
+
slot: "panel-header-title-row",
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export type PanelHeaderTitleProps = useRender.ComponentProps<"h2">;
|
|
128
|
+
|
|
129
|
+
export function PanelHeaderTitle({ className, render, ...props }: PanelHeaderTitleProps) {
|
|
130
|
+
const theme = useThemeFamily();
|
|
131
|
+
const { title } = panelHeader({ theme });
|
|
132
|
+
const defaultProps: useRender.ElementProps<"h2"> = {
|
|
133
|
+
className: title({ className }),
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
return useRender({
|
|
137
|
+
defaultTagName: "h2",
|
|
138
|
+
render,
|
|
139
|
+
props: mergeProps<"h2">(defaultProps, props),
|
|
140
|
+
state: {
|
|
141
|
+
slot: "panel-header-title",
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export type PanelHeaderSuffixProps = useRender.ComponentProps<"div">;
|
|
147
|
+
|
|
148
|
+
export function PanelHeaderSuffix({ className, render, ...props }: PanelHeaderSuffixProps) {
|
|
149
|
+
const { suffix } = panelHeader();
|
|
150
|
+
const defaultProps: useRender.ElementProps<"div"> = {
|
|
151
|
+
className: suffix({ className }),
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
return useRender({
|
|
155
|
+
defaultTagName: "div",
|
|
156
|
+
render,
|
|
157
|
+
props: mergeProps<"div">(defaultProps, props),
|
|
158
|
+
state: {
|
|
159
|
+
slot: "panel-header-suffix",
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export type PanelHeaderSubtitleProps = useRender.ComponentProps<"p">;
|
|
165
|
+
|
|
166
|
+
export function PanelHeaderSubtitle({ className, render, ...props }: PanelHeaderSubtitleProps) {
|
|
167
|
+
const theme = useThemeFamily();
|
|
168
|
+
const { subtitle } = panelHeader({ theme });
|
|
169
|
+
const defaultProps: useRender.ElementProps<"p"> = {
|
|
170
|
+
className: subtitle({ className }),
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
return useRender({
|
|
174
|
+
defaultTagName: "p",
|
|
175
|
+
render,
|
|
176
|
+
props: mergeProps<"p">(defaultProps, props),
|
|
177
|
+
state: {
|
|
178
|
+
slot: "panel-header-subtitle",
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export type PanelHeaderActionsProps = useRender.ComponentProps<"div">;
|
|
184
|
+
|
|
185
|
+
export function PanelHeaderActions({ className, render, ...props }: PanelHeaderActionsProps) {
|
|
186
|
+
const { actions } = panelHeader();
|
|
187
|
+
const defaultProps: useRender.ElementProps<"div"> = {
|
|
188
|
+
className: actions({ className }),
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
return useRender({
|
|
192
|
+
defaultTagName: "div",
|
|
193
|
+
render,
|
|
194
|
+
props: mergeProps<"div">(defaultProps, props),
|
|
195
|
+
state: {
|
|
196
|
+
slot: "panel-header-actions",
|
|
197
|
+
},
|
|
198
|
+
});
|
|
199
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export {
|
|
2
|
+
Popover,
|
|
3
|
+
PopoverArrow,
|
|
4
|
+
PopoverBackdrop,
|
|
5
|
+
PopoverClose,
|
|
6
|
+
PopoverContent,
|
|
7
|
+
PopoverDescription,
|
|
8
|
+
PopoverHeader,
|
|
9
|
+
PopoverPortal,
|
|
10
|
+
PopoverPopup,
|
|
11
|
+
PopoverSeparator,
|
|
12
|
+
PopoverTitle,
|
|
13
|
+
PopoverTrigger,
|
|
14
|
+
PopoverViewport,
|
|
15
|
+
} from "./popover.tsx";
|
|
16
|
+
export type {
|
|
17
|
+
PopoverArrowProps,
|
|
18
|
+
PopoverBackdropProps,
|
|
19
|
+
PopoverCloseProps,
|
|
20
|
+
PopoverContentProps,
|
|
21
|
+
PopoverDescriptionProps,
|
|
22
|
+
PopoverHeaderProps,
|
|
23
|
+
PopoverPortalProps,
|
|
24
|
+
PopoverProps,
|
|
25
|
+
PopoverPopupProps,
|
|
26
|
+
PopoverSeparatorProps,
|
|
27
|
+
PopoverTitleProps,
|
|
28
|
+
PopoverTriggerProps,
|
|
29
|
+
PopoverViewportProps,
|
|
30
|
+
} from "./popover.tsx";
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
import { Popover as BasePopover } from "@base-ui/react/popover";
|
|
3
|
+
import { tv } from "../../lib/tv.ts";
|
|
4
|
+
import type { StyledProps } from "../../lib/styled-props.ts";
|
|
5
|
+
import { useThemeFamily } from "../../lib/theme/use-theme.ts";
|
|
6
|
+
|
|
7
|
+
const popover = tv({
|
|
8
|
+
slots: {
|
|
9
|
+
trigger: ["select-none"],
|
|
10
|
+
positioner: ["isolate z-50 outline-none"],
|
|
11
|
+
content: [
|
|
12
|
+
"max-h-[var(--available-height)] min-w-[220px] overflow-hidden bg-layer-panel",
|
|
13
|
+
"outline-none",
|
|
14
|
+
],
|
|
15
|
+
header: ["flex items-center justify-between px-3 py-2"],
|
|
16
|
+
separator: ["border-t"],
|
|
17
|
+
title: ["m-0 text-[10px] font-bold leading-none"],
|
|
18
|
+
description: ["m-0 text-xs leading-5"],
|
|
19
|
+
close: [
|
|
20
|
+
"inline-flex items-center justify-center",
|
|
21
|
+
"text-[10px] font-bold",
|
|
22
|
+
"outline-none transition-colors",
|
|
23
|
+
],
|
|
24
|
+
arrow: ["size-2 rotate-45"],
|
|
25
|
+
backdrop: ["fixed inset-0"],
|
|
26
|
+
viewport: ["block"],
|
|
27
|
+
},
|
|
28
|
+
variants: {
|
|
29
|
+
theme: {
|
|
30
|
+
brutal: {
|
|
31
|
+
content: ["border-2 border-black bg-white shadow-lg"],
|
|
32
|
+
separator: ["border-black"],
|
|
33
|
+
title: ["font-sans uppercase tracking-wide text-black/60"],
|
|
34
|
+
description: ["font-sans text-black"],
|
|
35
|
+
close: ["font-sans uppercase tracking-wide text-black/60 hover:text-black"],
|
|
36
|
+
arrow: ["border-l-2 border-t-2 border-black bg-white"],
|
|
37
|
+
backdrop: ["bg-transparent"],
|
|
38
|
+
},
|
|
39
|
+
elegant: {
|
|
40
|
+
content: ["rounded-md bg-layer-popover", "shadow-xl"],
|
|
41
|
+
separator: ["border-line-muted"],
|
|
42
|
+
title: ["text-[11px] font-medium tracking-[-0.005em] text-foreground/45"],
|
|
43
|
+
description: ["text-xs leading-5 text-foreground-muted"],
|
|
44
|
+
close: [
|
|
45
|
+
"text-[11px] font-medium tracking-[-0.005em]",
|
|
46
|
+
"text-foreground-muted transition-colors duration-150 hover:text-foreground-strong",
|
|
47
|
+
],
|
|
48
|
+
arrow: ["border-l border-t border-line-muted bg-layer-popover"],
|
|
49
|
+
backdrop: ["bg-black/20"],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export type PopoverProps = BasePopover.Root.Props;
|
|
56
|
+
|
|
57
|
+
export function Popover(props: PopoverProps) {
|
|
58
|
+
return <BasePopover.Root data-slot="popover" {...props} />;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export type PopoverTriggerProps = StyledProps<BasePopover.Trigger.Props>;
|
|
62
|
+
|
|
63
|
+
export function PopoverTrigger({ className, ...props }: PopoverTriggerProps) {
|
|
64
|
+
const theme = useThemeFamily();
|
|
65
|
+
const { trigger } = popover({ theme });
|
|
66
|
+
return (
|
|
67
|
+
<BasePopover.Trigger
|
|
68
|
+
data-slot="popover-trigger"
|
|
69
|
+
className={trigger({ className })}
|
|
70
|
+
{...props}
|
|
71
|
+
/>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type PopoverPortalProps = BasePopover.Portal.Props;
|
|
76
|
+
|
|
77
|
+
export function PopoverPortal(props: PopoverPortalProps) {
|
|
78
|
+
return <BasePopover.Portal data-slot="popover-portal" {...props} />;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type PopoverPopupProps = ComponentPropsWithRef<"div">;
|
|
82
|
+
|
|
83
|
+
export function PopoverPopup({ className, ...props }: PopoverPopupProps) {
|
|
84
|
+
const theme = useThemeFamily();
|
|
85
|
+
const { content } = popover({ theme });
|
|
86
|
+
return <div data-slot="popover-content" className={content({ className })} {...props} />;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type PopoverContentProps = StyledProps<BasePopover.Popup.Props> &
|
|
90
|
+
Pick<
|
|
91
|
+
BasePopover.Positioner.Props,
|
|
92
|
+
| "align"
|
|
93
|
+
| "alignOffset"
|
|
94
|
+
| "anchor"
|
|
95
|
+
| "arrowPadding"
|
|
96
|
+
| "collisionAvoidance"
|
|
97
|
+
| "collisionBoundary"
|
|
98
|
+
| "collisionPadding"
|
|
99
|
+
| "disableAnchorTracking"
|
|
100
|
+
| "positionMethod"
|
|
101
|
+
| "side"
|
|
102
|
+
| "sideOffset"
|
|
103
|
+
| "sticky"
|
|
104
|
+
> & {
|
|
105
|
+
portalProps?: PopoverPortalProps;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export function PopoverContent({
|
|
109
|
+
align = "start",
|
|
110
|
+
alignOffset = 0,
|
|
111
|
+
anchor,
|
|
112
|
+
arrowPadding,
|
|
113
|
+
collisionAvoidance,
|
|
114
|
+
collisionBoundary,
|
|
115
|
+
collisionPadding,
|
|
116
|
+
disableAnchorTracking = true,
|
|
117
|
+
positionMethod = "fixed",
|
|
118
|
+
side = "bottom",
|
|
119
|
+
sideOffset = 4,
|
|
120
|
+
sticky,
|
|
121
|
+
portalProps,
|
|
122
|
+
className,
|
|
123
|
+
...props
|
|
124
|
+
}: PopoverContentProps) {
|
|
125
|
+
const theme = useThemeFamily();
|
|
126
|
+
const { positioner, content } = popover({ theme });
|
|
127
|
+
return (
|
|
128
|
+
<BasePopover.Portal {...portalProps}>
|
|
129
|
+
<BasePopover.Positioner
|
|
130
|
+
align={align}
|
|
131
|
+
alignOffset={alignOffset}
|
|
132
|
+
anchor={anchor}
|
|
133
|
+
arrowPadding={arrowPadding}
|
|
134
|
+
collisionAvoidance={collisionAvoidance}
|
|
135
|
+
collisionBoundary={collisionBoundary}
|
|
136
|
+
collisionPadding={collisionPadding}
|
|
137
|
+
disableAnchorTracking={disableAnchorTracking}
|
|
138
|
+
positionMethod={positionMethod}
|
|
139
|
+
side={side}
|
|
140
|
+
sideOffset={sideOffset}
|
|
141
|
+
sticky={sticky}
|
|
142
|
+
className={positioner()}
|
|
143
|
+
>
|
|
144
|
+
<BasePopover.Popup
|
|
145
|
+
data-slot="popover-content"
|
|
146
|
+
className={content({ className })}
|
|
147
|
+
{...props}
|
|
148
|
+
/>
|
|
149
|
+
</BasePopover.Positioner>
|
|
150
|
+
</BasePopover.Portal>
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export type PopoverViewportProps = StyledProps<BasePopover.Viewport.Props>;
|
|
155
|
+
|
|
156
|
+
export function PopoverViewport({ className, ...props }: PopoverViewportProps) {
|
|
157
|
+
const theme = useThemeFamily();
|
|
158
|
+
const { viewport } = popover({ theme });
|
|
159
|
+
return (
|
|
160
|
+
<BasePopover.Viewport
|
|
161
|
+
data-slot="popover-viewport"
|
|
162
|
+
className={viewport({ className })}
|
|
163
|
+
{...props}
|
|
164
|
+
/>
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export type PopoverHeaderProps = ComponentPropsWithRef<"div">;
|
|
169
|
+
|
|
170
|
+
export function PopoverHeader({ className, ...props }: PopoverHeaderProps) {
|
|
171
|
+
const theme = useThemeFamily();
|
|
172
|
+
const { header } = popover({ theme });
|
|
173
|
+
return <div data-slot="popover-header" className={header({ className })} {...props} />;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export type PopoverSeparatorProps = StyledProps<ComponentPropsWithRef<"div">>;
|
|
177
|
+
|
|
178
|
+
export function PopoverSeparator({ className, ...props }: PopoverSeparatorProps) {
|
|
179
|
+
const theme = useThemeFamily();
|
|
180
|
+
const { separator } = popover({ theme });
|
|
181
|
+
return (
|
|
182
|
+
<div
|
|
183
|
+
role="separator"
|
|
184
|
+
aria-orientation="horizontal"
|
|
185
|
+
data-slot="popover-separator"
|
|
186
|
+
className={separator({ className })}
|
|
187
|
+
{...props}
|
|
188
|
+
/>
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export type PopoverTitleProps = StyledProps<BasePopover.Title.Props>;
|
|
193
|
+
|
|
194
|
+
export function PopoverTitle({ className, ...props }: PopoverTitleProps) {
|
|
195
|
+
const theme = useThemeFamily();
|
|
196
|
+
const { title } = popover({ theme });
|
|
197
|
+
return (
|
|
198
|
+
<BasePopover.Title data-slot="popover-title" className={title({ className })} {...props} />
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export type PopoverDescriptionProps = StyledProps<BasePopover.Description.Props>;
|
|
203
|
+
|
|
204
|
+
export function PopoverDescription({ className, ...props }: PopoverDescriptionProps) {
|
|
205
|
+
const theme = useThemeFamily();
|
|
206
|
+
const { description } = popover({ theme });
|
|
207
|
+
return (
|
|
208
|
+
<BasePopover.Description
|
|
209
|
+
data-slot="popover-description"
|
|
210
|
+
className={description({ className })}
|
|
211
|
+
{...props}
|
|
212
|
+
/>
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export type PopoverCloseProps = StyledProps<BasePopover.Close.Props>;
|
|
217
|
+
|
|
218
|
+
export function PopoverClose({ className, ...props }: PopoverCloseProps) {
|
|
219
|
+
const theme = useThemeFamily();
|
|
220
|
+
const { close } = popover({ theme });
|
|
221
|
+
return (
|
|
222
|
+
<BasePopover.Close data-slot="popover-close" className={close({ className })} {...props} />
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export type PopoverArrowProps = StyledProps<BasePopover.Arrow.Props>;
|
|
227
|
+
|
|
228
|
+
export function PopoverArrow({ className, ...props }: PopoverArrowProps) {
|
|
229
|
+
const theme = useThemeFamily();
|
|
230
|
+
const { arrow } = popover({ theme });
|
|
231
|
+
return (
|
|
232
|
+
<BasePopover.Arrow data-slot="popover-arrow" className={arrow({ className })} {...props} />
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export type PopoverBackdropProps = StyledProps<BasePopover.Backdrop.Props>;
|
|
237
|
+
|
|
238
|
+
export function PopoverBackdrop({ className, ...props }: PopoverBackdropProps) {
|
|
239
|
+
const theme = useThemeFamily();
|
|
240
|
+
const { backdrop } = popover({ theme });
|
|
241
|
+
return (
|
|
242
|
+
<BasePopover.Backdrop
|
|
243
|
+
data-slot="popover-backdrop"
|
|
244
|
+
className={backdrop({ className })}
|
|
245
|
+
{...props}
|
|
246
|
+
/>
|
|
247
|
+
);
|
|
248
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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 previewShell = tv({
|
|
7
|
+
slots: {
|
|
8
|
+
root: [],
|
|
9
|
+
},
|
|
10
|
+
variants: {
|
|
11
|
+
theme: {
|
|
12
|
+
brutal: {},
|
|
13
|
+
// Elegant styling is deferred; see the component TODO.
|
|
14
|
+
elegant: {},
|
|
15
|
+
},
|
|
16
|
+
variant: {
|
|
17
|
+
default: {
|
|
18
|
+
root: "border border-line-muted bg-layer-panel hover:border-line-subtle hover:bg-layer-muted",
|
|
19
|
+
},
|
|
20
|
+
muted: {
|
|
21
|
+
root: "border-2 border-line-subtle bg-layer-muted italic text-foreground/40 hover:shadow-sm",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
variant: "default",
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export type PreviewShellProps = useRender.ComponentProps<"div"> &
|
|
31
|
+
Omit<VariantProps<typeof previewShell>, "theme"> & {
|
|
32
|
+
"data-testid"?: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export function PreviewShell({ variant, className, render, ...props }: PreviewShellProps) {
|
|
36
|
+
const theme = useThemeFamily();
|
|
37
|
+
const { root } = previewShell({ theme, variant });
|
|
38
|
+
const defaultProps: useRender.ElementProps<"div"> = {
|
|
39
|
+
className: root({ className }),
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return useRender({
|
|
43
|
+
defaultTagName: "div",
|
|
44
|
+
render,
|
|
45
|
+
props: mergeProps<"div">(defaultProps, props),
|
|
46
|
+
state: {
|
|
47
|
+
slot: "preview-shell",
|
|
48
|
+
variant,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export {
|
|
2
|
+
QuotedMessageCard,
|
|
3
|
+
QuotedMessageCardAttachments,
|
|
4
|
+
QuotedMessageCardAuthor,
|
|
5
|
+
QuotedMessageCardAuthorName,
|
|
6
|
+
QuotedMessageCardAuthorSubtitle,
|
|
7
|
+
QuotedMessageCardBody,
|
|
8
|
+
QuotedMessageCardChannel,
|
|
9
|
+
QuotedMessageCardContent,
|
|
10
|
+
QuotedMessageCardContentWrap,
|
|
11
|
+
QuotedMessageCardHeader,
|
|
12
|
+
QuotedMessageCardMeta,
|
|
13
|
+
QuotedMessageCardSeparator,
|
|
14
|
+
QuotedMessageCardTag,
|
|
15
|
+
QuotedMessageCardThread,
|
|
16
|
+
QuotedMessageCardTimestamp,
|
|
17
|
+
QuotedMessageCardUnavailable,
|
|
18
|
+
} from "./quoted-message-card.tsx";
|
|
19
|
+
export type {
|
|
20
|
+
QuotedMessageCardAttachmentsProps,
|
|
21
|
+
QuotedMessageCardAuthorNameProps,
|
|
22
|
+
QuotedMessageCardAuthorProps,
|
|
23
|
+
QuotedMessageCardAuthorSubtitleProps,
|
|
24
|
+
QuotedMessageCardBodyProps,
|
|
25
|
+
QuotedMessageCardChannelProps,
|
|
26
|
+
QuotedMessageCardContentProps,
|
|
27
|
+
QuotedMessageCardContentWrapProps,
|
|
28
|
+
QuotedMessageCardHeaderProps,
|
|
29
|
+
QuotedMessageCardMetaProps,
|
|
30
|
+
QuotedMessageCardProps,
|
|
31
|
+
QuotedMessageCardSeparatorProps,
|
|
32
|
+
QuotedMessageCardTagProps,
|
|
33
|
+
QuotedMessageCardThreadProps,
|
|
34
|
+
QuotedMessageCardTimestampProps,
|
|
35
|
+
QuotedMessageCardUnavailableProps,
|
|
36
|
+
} from "./quoted-message-card.tsx";
|