raft-ui 0.0.6 → 0.0.8
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 +7 -5
- package/dist/index.d.mts +618 -2
- package/dist/index.mjs +1205 -12
- package/{src → dist}/styles.css +0 -2
- package/{src/lib/styled-props.ts → dist/tv-UUMwNowu.d.mts} +6 -1
- package/dist/use-theme-Y_h1DKll.mjs +34 -0
- package/dist/wip.d.mts +15 -133
- package/dist/wip.mjs +23 -296
- package/package.json +4 -4
- package/dist/button-CJqMhTPQ.mjs +0 -621
- package/dist/index-CpGciYPW.d.mts +0 -267
- 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/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,169 +0,0 @@
|
|
|
1
|
-
import type { ComponentPropsWithRef } from "react";
|
|
2
|
-
import { Button as BaseButton } from "@base-ui/react/button";
|
|
3
|
-
import { mergeProps } from "@base-ui/react/merge-props";
|
|
4
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
-
import { tv, type VariantProps } from "../../lib/tv";
|
|
6
|
-
import { cn } from "../../lib/cn";
|
|
7
|
-
import { useThemeFamily } from "../../lib/theme/use-theme";
|
|
8
|
-
import { ListItem, type ListItemProps } from "../list-item/list-item";
|
|
9
|
-
|
|
10
|
-
const mediaItem = tv({
|
|
11
|
-
slots: {
|
|
12
|
-
row: ["group/media-item flex w-full min-w-0 gap-3"],
|
|
13
|
-
body: [
|
|
14
|
-
"flex min-w-0 flex-1 gap-3",
|
|
15
|
-
"items-center group-data-[align=start]/media-item:items-start",
|
|
16
|
-
],
|
|
17
|
-
text: ["min-w-0 flex-1"],
|
|
18
|
-
textInner: [
|
|
19
|
-
"flex min-w-0 flex-wrap items-baseline gap-x-2",
|
|
20
|
-
"group-data-[align=start]/media-item:flex-col group-data-[align=start]/media-item:flex-nowrap group-data-[align=start]/media-item:items-stretch group-data-[align=start]/media-item:gap-x-1 group-data-[align=start]/media-item:gap-y-1",
|
|
21
|
-
],
|
|
22
|
-
visual: ["shrink-0"],
|
|
23
|
-
title: ["truncate text-sm font-bold"],
|
|
24
|
-
subtitle: [
|
|
25
|
-
"font-mono text-xs",
|
|
26
|
-
"[&_svg]:size-3 [&_svg]:shrink-0",
|
|
27
|
-
"group-data-[align=start]/media-item:flex group-data-[align=start]/media-item:min-w-0 group-data-[align=start]/media-item:flex-wrap group-data-[align=start]/media-item:items-center group-data-[align=start]/media-item:gap-x-2 group-data-[align=start]/media-item:gap-y-1",
|
|
28
|
-
],
|
|
29
|
-
aside: ["flex shrink-0 items-center gap-1.5 self-center", "[&_svg]:size-3.5 [&_svg]:shrink-0"],
|
|
30
|
-
actionGroup: [
|
|
31
|
-
"flex shrink-0 items-center gap-1.5 self-center",
|
|
32
|
-
"[&_svg]:size-3.5 [&_svg]:shrink-0",
|
|
33
|
-
],
|
|
34
|
-
},
|
|
35
|
-
variants: {
|
|
36
|
-
theme: {
|
|
37
|
-
brutal: {
|
|
38
|
-
title: "text-foreground-strong",
|
|
39
|
-
subtitle: "text-foreground/50",
|
|
40
|
-
},
|
|
41
|
-
// Elegant styling is deferred; see the component TODO.
|
|
42
|
-
elegant: {},
|
|
43
|
-
},
|
|
44
|
-
align: {
|
|
45
|
-
start: { row: "items-start" },
|
|
46
|
-
center: { row: "items-center" },
|
|
47
|
-
},
|
|
48
|
-
// The button case only: counteract the `<button>` UA `text-align: center`.
|
|
49
|
-
interactive: {
|
|
50
|
-
true: { body: "text-left" },
|
|
51
|
-
false: { body: "" },
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
defaultVariants: {
|
|
55
|
-
align: "center",
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
export type MediaListItemProps = Pick<VariantProps<typeof mediaItem>, "align"> &
|
|
60
|
-
Pick<ListItemProps, "selected" | "interactive"> &
|
|
61
|
-
ComponentPropsWithRef<"div">;
|
|
62
|
-
|
|
63
|
-
export function MediaListItem({
|
|
64
|
-
align = "center",
|
|
65
|
-
selected,
|
|
66
|
-
interactive,
|
|
67
|
-
className,
|
|
68
|
-
children,
|
|
69
|
-
...props
|
|
70
|
-
}: MediaListItemProps) {
|
|
71
|
-
const { row } = mediaItem({ align });
|
|
72
|
-
return (
|
|
73
|
-
<ListItem
|
|
74
|
-
data-slot="media-list-item"
|
|
75
|
-
selected={selected}
|
|
76
|
-
interactive={interactive ?? false}
|
|
77
|
-
className={cn(
|
|
78
|
-
"group px-3 py-2 has-[[data-interactive=true]]:hover:border-line-strong has-[[data-interactive=true]]:hover:shadow-sm",
|
|
79
|
-
className,
|
|
80
|
-
)}
|
|
81
|
-
>
|
|
82
|
-
<div data-align={align} className={row()} {...props}>
|
|
83
|
-
{children}
|
|
84
|
-
</div>
|
|
85
|
-
</ListItem>
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export type MediaListItemBodyProps = useRender.ComponentProps<"button">;
|
|
90
|
-
|
|
91
|
-
export function MediaListItemBody({
|
|
92
|
-
render,
|
|
93
|
-
onClick,
|
|
94
|
-
className,
|
|
95
|
-
...props
|
|
96
|
-
}: MediaListItemBodyProps) {
|
|
97
|
-
const interactive = onClick !== undefined;
|
|
98
|
-
const { body } = mediaItem({ interactive });
|
|
99
|
-
const defaultProps: useRender.ElementProps<"button"> & {
|
|
100
|
-
"data-slot": string;
|
|
101
|
-
"data-interactive"?: string;
|
|
102
|
-
} = {
|
|
103
|
-
"data-slot": "media-list-item-body",
|
|
104
|
-
"data-interactive": interactive ? "true" : undefined,
|
|
105
|
-
onClick,
|
|
106
|
-
className: body({ className }),
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
return useRender({
|
|
110
|
-
render: render ?? (interactive ? <BaseButton type="button" /> : <div />),
|
|
111
|
-
props: mergeProps<"button">(defaultProps, props),
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export type MediaListItemTextProps = ComponentPropsWithRef<"div">;
|
|
116
|
-
|
|
117
|
-
export function MediaListItemText({ className, children, ...props }: MediaListItemTextProps) {
|
|
118
|
-
const { text, textInner } = mediaItem();
|
|
119
|
-
return (
|
|
120
|
-
<div data-slot="media-list-item-text" className={text({ className })} {...props}>
|
|
121
|
-
<div className={textInner()}>{children}</div>
|
|
122
|
-
</div>
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export type MediaListItemVisualProps = ComponentPropsWithRef<"div">;
|
|
127
|
-
|
|
128
|
-
export function MediaListItemVisual({ className, ...props }: MediaListItemVisualProps) {
|
|
129
|
-
const { visual } = mediaItem();
|
|
130
|
-
return <div data-slot="media-list-item-visual" className={visual({ className })} {...props} />;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export type MediaListItemTitleProps = ComponentPropsWithRef<"span">;
|
|
134
|
-
|
|
135
|
-
export function MediaListItemTitle({ className, ...props }: MediaListItemTitleProps) {
|
|
136
|
-
const theme = useThemeFamily();
|
|
137
|
-
const { title } = mediaItem({ theme });
|
|
138
|
-
return <span data-slot="media-list-item-title" className={title({ className })} {...props} />;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export type MediaListItemSubtitleProps = ComponentPropsWithRef<"span">;
|
|
142
|
-
|
|
143
|
-
export function MediaListItemSubtitle({ className, ...props }: MediaListItemSubtitleProps) {
|
|
144
|
-
const theme = useThemeFamily();
|
|
145
|
-
const { subtitle } = mediaItem({ theme });
|
|
146
|
-
return (
|
|
147
|
-
<span data-slot="media-list-item-subtitle" className={subtitle({ className })} {...props} />
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export type MediaListItemAsideProps = ComponentPropsWithRef<"div">;
|
|
152
|
-
|
|
153
|
-
export function MediaListItemAside({ className, ...props }: MediaListItemAsideProps) {
|
|
154
|
-
const { aside } = mediaItem();
|
|
155
|
-
return <div data-slot="media-list-item-aside" className={aside({ className })} {...props} />;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
export type MediaListItemActionGroupProps = ComponentPropsWithRef<"div">;
|
|
159
|
-
|
|
160
|
-
export function MediaListItemActionGroup({ className, ...props }: MediaListItemActionGroupProps) {
|
|
161
|
-
const { actionGroup } = mediaItem();
|
|
162
|
-
return (
|
|
163
|
-
<div
|
|
164
|
-
data-slot="media-list-item-action-group"
|
|
165
|
-
className={actionGroup({ className })}
|
|
166
|
-
{...props}
|
|
167
|
-
/>
|
|
168
|
-
);
|
|
169
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
NotificationCenterActionButtonProps,
|
|
3
|
-
NotificationCenterCountProps,
|
|
4
|
-
NotificationCenterEmptyStateProps,
|
|
5
|
-
NotificationCenterHeaderProps,
|
|
6
|
-
NotificationCenterItemActionsProps,
|
|
7
|
-
NotificationCenterItemBodyProps,
|
|
8
|
-
NotificationCenterItemContentProps,
|
|
9
|
-
NotificationCenterItemIconProps,
|
|
10
|
-
NotificationCenterItemRowProps,
|
|
11
|
-
NotificationCenterItemProps,
|
|
12
|
-
NotificationCenterItemTitleProps,
|
|
13
|
-
NotificationCenterListProps,
|
|
14
|
-
NotificationCenterPopupProps,
|
|
15
|
-
NotificationCenterPortalProps,
|
|
16
|
-
NotificationCenterProps,
|
|
17
|
-
NotificationCenterScrollerProps,
|
|
18
|
-
NotificationCenterTitleProps,
|
|
19
|
-
NotificationCenterTriggerProps,
|
|
20
|
-
} from "./notification-center";
|
|
21
|
-
export {
|
|
22
|
-
NotificationCenter,
|
|
23
|
-
NotificationCenterActionButton,
|
|
24
|
-
NotificationCenterCount,
|
|
25
|
-
NotificationCenterEmptyState,
|
|
26
|
-
NotificationCenterHeader,
|
|
27
|
-
NotificationCenterItem,
|
|
28
|
-
NotificationCenterItemActions,
|
|
29
|
-
NotificationCenterItemBody,
|
|
30
|
-
NotificationCenterItemContent,
|
|
31
|
-
NotificationCenterItemIcon,
|
|
32
|
-
NotificationCenterItemRow,
|
|
33
|
-
NotificationCenterItemTitle,
|
|
34
|
-
NotificationCenterList,
|
|
35
|
-
NotificationCenterPopup,
|
|
36
|
-
NotificationCenterScroller,
|
|
37
|
-
NotificationCenterTitle,
|
|
38
|
-
NotificationCenterTrigger,
|
|
39
|
-
} from "./notification-center";
|