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.
Files changed (138) hide show
  1. package/CHANGELOG.md +7 -5
  2. package/dist/index.d.mts +618 -2
  3. package/dist/index.mjs +1205 -12
  4. package/{src → dist}/styles.css +0 -2
  5. package/{src/lib/styled-props.ts → dist/tv-UUMwNowu.d.mts} +6 -1
  6. package/dist/use-theme-Y_h1DKll.mjs +34 -0
  7. package/dist/wip.d.mts +15 -133
  8. package/dist/wip.mjs +23 -296
  9. package/package.json +4 -4
  10. package/dist/button-CJqMhTPQ.mjs +0 -621
  11. package/dist/index-CpGciYPW.d.mts +0 -267
  12. package/src/components/alert-dialog/alert-dialog.tsx +0 -215
  13. package/src/components/alert-dialog/index.ts +0 -30
  14. package/src/components/avatar/avatar.tsx +0 -375
  15. package/src/components/avatar/index.ts +0 -17
  16. package/src/components/badge/badge.tsx +0 -393
  17. package/src/components/badge/index.ts +0 -2
  18. package/src/components/banner/banner.tsx +0 -269
  19. package/src/components/banner/index.ts +0 -8
  20. package/src/components/bottom-sheet/bottom-sheet.tsx +0 -152
  21. package/src/components/bottom-sheet/index.ts +0 -22
  22. package/src/components/button/button.tsx +0 -499
  23. package/src/components/button/index.ts +0 -2
  24. package/src/components/checkbox/checkbox-indicator.tsx +0 -128
  25. package/src/components/checkbox/checkbox.tsx +0 -350
  26. package/src/components/checkbox/index.ts +0 -2
  27. package/src/components/combobox/combobox.tsx +0 -603
  28. package/src/components/combobox/index.ts +0 -52
  29. package/src/components/context-menu/context-menu.tsx +0 -380
  30. package/src/components/context-menu/index.ts +0 -34
  31. package/src/components/conversation-preview-card/conversation-preview-card.tsx +0 -336
  32. package/src/components/conversation-preview-card/index.ts +0 -32
  33. package/src/components/description-list/description-list.tsx +0 -116
  34. package/src/components/description-list/index.ts +0 -14
  35. package/src/components/dialog/dialog.tsx +0 -152
  36. package/src/components/dialog/index.ts +0 -26
  37. package/src/components/dropdown-menu/dropdown-menu.tsx +0 -405
  38. package/src/components/dropdown-menu/index.ts +0 -38
  39. package/src/components/empty-state/empty-state.tsx +0 -177
  40. package/src/components/empty-state/index.ts +0 -16
  41. package/src/components/field/field.tsx +0 -125
  42. package/src/components/field/index.ts +0 -18
  43. package/src/components/inline-code/index.ts +0 -2
  44. package/src/components/inline-code/inline-code.tsx +0 -35
  45. package/src/components/input/index.ts +0 -2
  46. package/src/components/input/input.tsx +0 -76
  47. package/src/components/input-group/index.ts +0 -7
  48. package/src/components/input-group/input-group.tsx +0 -215
  49. package/src/components/kbd/index.ts +0 -2
  50. package/src/components/kbd/kbd.tsx +0 -43
  51. package/src/components/label/index.ts +0 -2
  52. package/src/components/label/label.tsx +0 -99
  53. package/src/components/lightbox/index.ts +0 -24
  54. package/src/components/lightbox/lightbox.tsx +0 -245
  55. package/src/components/list-item/index.ts +0 -20
  56. package/src/components/list-item/list-item.tsx +0 -263
  57. package/src/components/media-list-item/index.ts +0 -20
  58. package/src/components/media-list-item/media-list-item.tsx +0 -169
  59. package/src/components/notification-center/index.ts +0 -39
  60. package/src/components/notification-center/notification-center.tsx +0 -558
  61. package/src/components/panel-header/index.ts +0 -22
  62. package/src/components/panel-header/panel-header.tsx +0 -199
  63. package/src/components/popover/index.ts +0 -30
  64. package/src/components/popover/popover.tsx +0 -248
  65. package/src/components/preview-shell/index.ts +0 -2
  66. package/src/components/preview-shell/preview-shell.tsx +0 -51
  67. package/src/components/quoted-message-card/index.ts +0 -36
  68. package/src/components/quoted-message-card/quoted-message-card.tsx +0 -391
  69. package/src/components/radio-group/index.ts +0 -2
  70. package/src/components/radio-group/radio-group.tsx +0 -119
  71. package/src/components/section-header/index.ts +0 -16
  72. package/src/components/section-header/section-header.tsx +0 -117
  73. package/src/components/section-label/index.ts +0 -2
  74. package/src/components/section-label/section-label.tsx +0 -38
  75. package/src/components/segmented-control/index.ts +0 -12
  76. package/src/components/segmented-control/segmented-control.tsx +0 -129
  77. package/src/components/select/index.ts +0 -40
  78. package/src/components/select/select.tsx +0 -382
  79. package/src/components/separator/index.ts +0 -2
  80. package/src/components/separator/separator.tsx +0 -40
  81. package/src/components/spinner/index.ts +0 -2
  82. package/src/components/spinner/spinner.tsx +0 -228
  83. package/src/components/status/index.ts +0 -2
  84. package/src/components/status/status.tsx +0 -152
  85. package/src/components/tabs/index.ts +0 -24
  86. package/src/components/tabs/tabs.tsx +0 -451
  87. package/src/components/text/index.ts +0 -2
  88. package/src/components/text/text.tsx +0 -131
  89. package/src/components/textarea/index.ts +0 -2
  90. package/src/components/textarea/textarea.tsx +0 -136
  91. package/src/components/toggle-group/index.ts +0 -7
  92. package/src/components/toggle-group/toggle-group.tsx +0 -111
  93. package/src/components/tooltip/index.ts +0 -8
  94. package/src/components/tooltip/tooltip.tsx +0 -212
  95. package/src/index.ts +0 -429
  96. package/src/legacy/AttentionDot.tsx +0 -28
  97. package/src/legacy/AvatarListRow.tsx +0 -87
  98. package/src/legacy/AvatarSlot.tsx +0 -157
  99. package/src/legacy/Badge.tsx +0 -95
  100. package/src/legacy/Banner.tsx +0 -74
  101. package/src/legacy/BottomSheet.tsx +0 -76
  102. package/src/legacy/CheckMarker.tsx +0 -72
  103. package/src/legacy/Checkbox.tsx +0 -81
  104. package/src/legacy/ConversationPreviewCard.tsx +0 -169
  105. package/src/legacy/DismissBackdrop.tsx +0 -68
  106. package/src/legacy/EmptyState.tsx +0 -63
  107. package/src/legacy/ExperimentalBadge.tsx +0 -19
  108. package/src/legacy/FormField.tsx +0 -106
  109. package/src/legacy/KeyValueRow.tsx +0 -67
  110. package/src/legacy/Lightbox.tsx +0 -119
  111. package/src/legacy/NotificationCenter.tsx +0 -217
  112. package/src/legacy/PanelHeader.tsx +0 -94
  113. package/src/legacy/PreviewShell.tsx +0 -40
  114. package/src/legacy/QuotedMessageCard.tsx +0 -181
  115. package/src/legacy/ReorderablePanelTabs.tsx +0 -156
  116. package/src/legacy/SandboxedPreviewFrame.tsx +0 -59
  117. package/src/legacy/SearchInput.tsx +0 -23
  118. package/src/legacy/SectionEyebrow.tsx +0 -60
  119. package/src/legacy/SectionHeader.tsx +0 -68
  120. package/src/legacy/SegmentedControl.tsx +0 -74
  121. package/src/legacy/SlugInput.tsx +0 -29
  122. package/src/legacy/Spinner.tsx +0 -89
  123. package/src/legacy/StatusDot.tsx +0 -51
  124. package/src/legacy/SurfaceListItem.tsx +0 -32
  125. package/src/legacy/Textarea.tsx +0 -137
  126. package/src/legacy/button.tsx +0 -100
  127. package/src/legacy/context-menu-divider.tsx +0 -12
  128. package/src/legacy/menu-item.tsx +0 -66
  129. package/src/legacy/selection-popover.tsx +0 -212
  130. package/src/legacy/server-switcher-menu.tsx +0 -203
  131. package/src/legacy/source.css +0 -240
  132. package/src/lib/cn.ts +0 -1
  133. package/src/lib/theme/theme-context.ts +0 -28
  134. package/src/lib/theme/theme-provider.tsx +0 -181
  135. package/src/lib/theme/use-theme.ts +0 -12
  136. package/src/lib/tv.ts +0 -29
  137. package/src/lib/without-children.ts +0 -6
  138. package/src/wip.ts +0 -291
@@ -1,267 +0,0 @@
1
- import { Button } from "@base-ui/react/button";
2
- import { VariantProps } from "tailwind-variants/lite";
3
-
4
- //#region src/lib/styled-props.d.ts
5
- /**
6
- * Base UI components type `className` as `string | ((state) => string)`, but our
7
- * tv() recipes only accept a plain string. `StyledProps` narrows a Base UI
8
- * component's props to a string `className` so they can flow into a recipe.
9
- *
10
- * The state-callback form is intentionally dropped: our components express every
11
- * state through `data-*` variants in the recipe, so a caller never needs it.
12
- */
13
- type StyledProps<P> = Omit<P, "className"> & {
14
- className?: string;
15
- };
16
- //#endregion
17
- //#region src/components/button/button.d.ts
18
- declare const buttonVariants: import("tailwind-variants/lite").TVReturnType<{
19
- theme: {
20
- brutal: {
21
- root: string[];
22
- };
23
- elegant: {
24
- root: string[];
25
- };
26
- };
27
- variant: {
28
- primary: {
29
- root: string[];
30
- };
31
- default: {
32
- root: string[];
33
- };
34
- information: {
35
- root: string[];
36
- };
37
- muted: {
38
- root: string[];
39
- };
40
- accent: {
41
- root: string[];
42
- };
43
- warning: {
44
- root: string[];
45
- };
46
- outline: {
47
- root: string[];
48
- };
49
- ghost: {
50
- root: string[];
51
- };
52
- link: {
53
- root: string[];
54
- };
55
- "danger-secondary": {
56
- root: string[];
57
- };
58
- danger: {
59
- root: string[];
60
- };
61
- "danger-outline": {
62
- root: string[];
63
- };
64
- };
65
- size: {
66
- xs: {
67
- root: string[];
68
- };
69
- sm: {
70
- root: string[];
71
- };
72
- md: {
73
- root: string[];
74
- };
75
- lg: {
76
- root: string[];
77
- };
78
- "icon-xs": {
79
- root: string[];
80
- };
81
- "icon-sm": {
82
- root: string[];
83
- };
84
- "icon-md": {
85
- root: string[];
86
- };
87
- "icon-lg": {
88
- root: string[];
89
- };
90
- };
91
- }, {
92
- root: string[];
93
- content: string;
94
- loadingIndicator: string;
95
- }, undefined, {
96
- theme: {
97
- brutal: {
98
- root: string[];
99
- };
100
- elegant: {
101
- root: string[];
102
- };
103
- };
104
- variant: {
105
- primary: {
106
- root: string[];
107
- };
108
- default: {
109
- root: string[];
110
- };
111
- information: {
112
- root: string[];
113
- };
114
- muted: {
115
- root: string[];
116
- };
117
- accent: {
118
- root: string[];
119
- };
120
- warning: {
121
- root: string[];
122
- };
123
- outline: {
124
- root: string[];
125
- };
126
- ghost: {
127
- root: string[];
128
- };
129
- link: {
130
- root: string[];
131
- };
132
- "danger-secondary": {
133
- root: string[];
134
- };
135
- danger: {
136
- root: string[];
137
- };
138
- "danger-outline": {
139
- root: string[];
140
- };
141
- };
142
- size: {
143
- xs: {
144
- root: string[];
145
- };
146
- sm: {
147
- root: string[];
148
- };
149
- md: {
150
- root: string[];
151
- };
152
- lg: {
153
- root: string[];
154
- };
155
- "icon-xs": {
156
- root: string[];
157
- };
158
- "icon-sm": {
159
- root: string[];
160
- };
161
- "icon-md": {
162
- root: string[];
163
- };
164
- "icon-lg": {
165
- root: string[];
166
- };
167
- };
168
- }, {
169
- root: string[];
170
- content: string;
171
- loadingIndicator: string;
172
- }, import("tailwind-variants/lite").TVReturnType<{
173
- theme: {
174
- brutal: {
175
- root: string[];
176
- };
177
- elegant: {
178
- root: string[];
179
- };
180
- };
181
- variant: {
182
- primary: {
183
- root: string[];
184
- };
185
- default: {
186
- root: string[];
187
- };
188
- information: {
189
- root: string[];
190
- };
191
- muted: {
192
- root: string[];
193
- };
194
- accent: {
195
- root: string[];
196
- };
197
- warning: {
198
- root: string[];
199
- };
200
- outline: {
201
- root: string[];
202
- };
203
- ghost: {
204
- root: string[];
205
- };
206
- link: {
207
- root: string[];
208
- };
209
- "danger-secondary": {
210
- root: string[];
211
- };
212
- danger: {
213
- root: string[];
214
- };
215
- "danger-outline": {
216
- root: string[];
217
- };
218
- };
219
- size: {
220
- xs: {
221
- root: string[];
222
- };
223
- sm: {
224
- root: string[];
225
- };
226
- md: {
227
- root: string[];
228
- };
229
- lg: {
230
- root: string[];
231
- };
232
- "icon-xs": {
233
- root: string[];
234
- };
235
- "icon-sm": {
236
- root: string[];
237
- };
238
- "icon-md": {
239
- root: string[];
240
- };
241
- "icon-lg": {
242
- root: string[];
243
- };
244
- };
245
- }, {
246
- root: string[];
247
- content: string;
248
- loadingIndicator: string;
249
- }, undefined, unknown, unknown, undefined>>;
250
- type ButtonProps = StyledProps<Button.Props> & Omit<VariantProps<typeof buttonVariants>, "theme"> & {
251
- loading?: boolean;
252
- loadingLabel?: string;
253
- };
254
- declare function Button$1({
255
- variant,
256
- size,
257
- loading,
258
- loadingLabel,
259
- disabled,
260
- className,
261
- children,
262
- render,
263
- nativeButton,
264
- ...props
265
- }: ButtonProps): import("react").JSX.Element;
266
- //#endregion
267
- export { VariantProps as a, StyledProps as i, ButtonProps as n, buttonVariants as r, Button$1 as t };
@@ -1,215 +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
- import { Button, type ButtonProps } from "../button/index";
7
-
8
- const alertDialog = tv({
9
- slots: {
10
- overlay: [
11
- "fixed inset-0 z-50",
12
- "transition-opacity duration-100",
13
- "data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",
14
- ],
15
- content: [
16
- "fixed top-1/2 left-1/2 z-50 grid w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2",
17
- "outline-none transition-[opacity,transform] duration-100",
18
- "data-[starting-style]:scale-95 data-[starting-style]:opacity-0",
19
- "data-[ending-style]:scale-95 data-[ending-style]:opacity-0",
20
- ],
21
- header: ["grid min-w-0 gap-1"],
22
- media: ["flex size-10 shrink-0 items-center justify-center"],
23
- body: ["min-w-0"],
24
- footer: ["flex items-center justify-end gap-3"],
25
- title: ["m-0 min-w-0 text-foreground-strong"],
26
- description: ["m-0 text-foreground-muted"],
27
- },
28
- variants: {
29
- theme: {
30
- brutal: {
31
- overlay: ["bg-black/60"],
32
- content: ["gap-4 border-2 border-line-strong bg-layer-panel p-6 shadow-xl"],
33
- media: ["border-2 border-line-strong bg-warning-base text-foreground-inverse"],
34
- title: ["font-heading text-lg leading-none font-bold uppercase"],
35
- description: ["font-sans text-sm leading-5 text-foreground/60"],
36
- },
37
- elegant: {
38
- overlay: ["bg-black/20"],
39
- content: [
40
- "gap-5 rounded-lg bg-layer-popover p-5",
41
- "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)]",
42
- ],
43
- media: ["rounded-md bg-danger-lighter text-danger-base"],
44
- title: ["font-sans text-base leading-5 font-medium tracking-[-0.005em]"],
45
- description: [
46
- "font-sans text-sm leading-5 text-[oklch(0.48_0_0)] dark:text-[oklch(0.76_0_0)]",
47
- ],
48
- },
49
- },
50
- size: {
51
- sm: {
52
- content: ["max-w-sm"],
53
- },
54
- md: {
55
- content: ["max-w-md"],
56
- },
57
- },
58
- },
59
- defaultVariants: {
60
- size: "sm",
61
- },
62
- });
63
-
64
- export type AlertDialogProps = BaseDialog.Root.Props;
65
-
66
- export function AlertDialog(props: AlertDialogProps) {
67
- return <BaseDialog.Root data-slot="alert-dialog" {...props} />;
68
- }
69
-
70
- export type AlertDialogTriggerProps = BaseDialog.Trigger.Props;
71
-
72
- export function AlertDialogTrigger(props: AlertDialogTriggerProps) {
73
- return <BaseDialog.Trigger data-slot="alert-dialog-trigger" {...props} />;
74
- }
75
-
76
- export type AlertDialogPortalProps = BaseDialog.Portal.Props;
77
-
78
- export function AlertDialogPortal(props: AlertDialogPortalProps) {
79
- return <BaseDialog.Portal data-slot="alert-dialog-portal" {...props} />;
80
- }
81
-
82
- export type AlertDialogOverlayProps = StyledProps<BaseDialog.Backdrop.Props>;
83
-
84
- export function AlertDialogOverlay({ className, ...props }: AlertDialogOverlayProps) {
85
- const theme = useThemeFamily();
86
- const { overlay } = alertDialog({ theme });
87
-
88
- return (
89
- <BaseDialog.Backdrop
90
- data-slot="alert-dialog-overlay"
91
- className={overlay({ className })}
92
- {...props}
93
- />
94
- );
95
- }
96
-
97
- export type AlertDialogContentProps = StyledProps<BaseDialog.Popup.Props> & {
98
- portalProps?: AlertDialogPortalProps;
99
- overlay?: false | AlertDialogOverlayProps;
100
- size?: "sm" | "md";
101
- };
102
-
103
- export function AlertDialogContent({
104
- className,
105
- children,
106
- portalProps,
107
- overlay,
108
- size,
109
- ...props
110
- }: AlertDialogContentProps) {
111
- const theme = useThemeFamily();
112
- const { content } = alertDialog({ theme, size });
113
-
114
- return (
115
- <AlertDialogPortal {...portalProps}>
116
- {overlay === false ? null : <AlertDialogOverlay {...overlay} />}
117
- <BaseDialog.Popup
118
- data-slot="alert-dialog-content"
119
- className={content({ className })}
120
- {...props}
121
- role="alertdialog"
122
- >
123
- {children}
124
- </BaseDialog.Popup>
125
- </AlertDialogPortal>
126
- );
127
- }
128
-
129
- export type AlertDialogHeaderProps = ComponentPropsWithRef<"div">;
130
-
131
- export function AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps) {
132
- const theme = useThemeFamily();
133
- const { header } = alertDialog({ theme });
134
-
135
- return <div data-slot="alert-dialog-header" className={header({ className })} {...props} />;
136
- }
137
-
138
- export type AlertDialogMediaProps = ComponentPropsWithRef<"div">;
139
-
140
- export function AlertDialogMedia({ className, ...props }: AlertDialogMediaProps) {
141
- const theme = useThemeFamily();
142
- const { media } = alertDialog({ theme });
143
-
144
- return <div data-slot="alert-dialog-media" className={media({ className })} {...props} />;
145
- }
146
-
147
- export type AlertDialogBodyProps = ComponentPropsWithRef<"div">;
148
-
149
- export function AlertDialogBody({ className, ...props }: AlertDialogBodyProps) {
150
- const theme = useThemeFamily();
151
- const { body } = alertDialog({ theme });
152
-
153
- return <div data-slot="alert-dialog-body" className={body({ className })} {...props} />;
154
- }
155
-
156
- export type AlertDialogFooterProps = ComponentPropsWithRef<"div">;
157
-
158
- export function AlertDialogFooter({ className, ...props }: AlertDialogFooterProps) {
159
- const theme = useThemeFamily();
160
- const { footer } = alertDialog({ theme });
161
-
162
- return <div data-slot="alert-dialog-footer" className={footer({ className })} {...props} />;
163
- }
164
-
165
- export type AlertDialogTitleProps = StyledProps<BaseDialog.Title.Props>;
166
-
167
- export function AlertDialogTitle({ className, ...props }: AlertDialogTitleProps) {
168
- const theme = useThemeFamily();
169
- const { title } = alertDialog({ theme });
170
-
171
- return (
172
- <BaseDialog.Title data-slot="alert-dialog-title" className={title({ className })} {...props} />
173
- );
174
- }
175
-
176
- export type AlertDialogDescriptionProps = StyledProps<BaseDialog.Description.Props>;
177
-
178
- export function AlertDialogDescription({ className, ...props }: AlertDialogDescriptionProps) {
179
- const theme = useThemeFamily();
180
- const { description } = alertDialog({ theme });
181
-
182
- return (
183
- <BaseDialog.Description
184
- data-slot="alert-dialog-description"
185
- className={description({ className })}
186
- {...props}
187
- />
188
- );
189
- }
190
-
191
- export type AlertDialogActionProps = ButtonProps;
192
-
193
- export function AlertDialogAction(props: AlertDialogActionProps) {
194
- return <Button data-slot="alert-dialog-action" {...props} />;
195
- }
196
-
197
- export type AlertDialogCancelProps = Omit<BaseDialog.Close.Props, "render"> &
198
- Pick<ButtonProps, "variant" | "size"> & {
199
- className?: string;
200
- };
201
-
202
- export function AlertDialogCancel({
203
- className,
204
- variant = "outline",
205
- size = "sm",
206
- ...props
207
- }: AlertDialogCancelProps) {
208
- return (
209
- <BaseDialog.Close
210
- data-slot="alert-dialog-cancel"
211
- render={<Button className={className} variant={variant} size={size} />}
212
- {...props}
213
- />
214
- );
215
- }
@@ -1,30 +0,0 @@
1
- export {
2
- AlertDialog,
3
- AlertDialogAction,
4
- AlertDialogBody,
5
- AlertDialogCancel,
6
- AlertDialogContent,
7
- AlertDialogDescription,
8
- AlertDialogFooter,
9
- AlertDialogHeader,
10
- AlertDialogMedia,
11
- AlertDialogOverlay,
12
- AlertDialogPortal,
13
- AlertDialogTitle,
14
- AlertDialogTrigger,
15
- } from "./alert-dialog";
16
- export type {
17
- AlertDialogActionProps,
18
- AlertDialogBodyProps,
19
- AlertDialogCancelProps,
20
- AlertDialogContentProps,
21
- AlertDialogDescriptionProps,
22
- AlertDialogFooterProps,
23
- AlertDialogHeaderProps,
24
- AlertDialogMediaProps,
25
- AlertDialogOverlayProps,
26
- AlertDialogPortalProps,
27
- AlertDialogProps,
28
- AlertDialogTitleProps,
29
- AlertDialogTriggerProps,
30
- } from "./alert-dialog";