raft-ui 0.0.4 → 0.0.6

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 (114) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +5 -1
  3. package/dist/button-CJqMhTPQ.mjs +621 -0
  4. package/dist/index-CpGciYPW.d.mts +267 -0
  5. package/dist/index.d.mts +90 -254
  6. package/dist/index.mjs +121 -628
  7. package/dist/wip.d.mts +133 -15
  8. package/dist/wip.mjs +289 -16
  9. package/package.json +5 -9
  10. package/src/components/alert-dialog/alert-dialog.tsx +215 -0
  11. package/src/components/alert-dialog/index.ts +30 -0
  12. package/src/components/avatar/avatar.tsx +3 -3
  13. package/src/components/avatar/index.ts +2 -2
  14. package/src/components/badge/badge.tsx +2 -2
  15. package/src/components/badge/index.ts +2 -2
  16. package/src/components/banner/banner.tsx +2 -2
  17. package/src/components/banner/index.ts +2 -2
  18. package/src/components/bottom-sheet/bottom-sheet.tsx +3 -3
  19. package/src/components/bottom-sheet/index.ts +2 -2
  20. package/src/components/button/button.tsx +7 -5
  21. package/src/components/button/index.ts +2 -2
  22. package/src/components/checkbox/checkbox-indicator.tsx +2 -2
  23. package/src/components/checkbox/checkbox.tsx +4 -4
  24. package/src/components/checkbox/index.ts +2 -2
  25. package/src/components/combobox/combobox.tsx +4 -4
  26. package/src/components/combobox/index.ts +1 -1
  27. package/src/components/context-menu/context-menu.tsx +4 -4
  28. package/src/components/context-menu/index.ts +2 -2
  29. package/src/components/conversation-preview-card/conversation-preview-card.tsx +2 -2
  30. package/src/components/conversation-preview-card/index.ts +2 -2
  31. package/src/components/description-list/description-list.tsx +2 -2
  32. package/src/components/description-list/index.ts +2 -2
  33. package/src/components/dialog/dialog.tsx +152 -0
  34. package/src/components/dialog/index.ts +26 -0
  35. package/src/components/dropdown-menu/dropdown-menu.tsx +7 -7
  36. package/src/components/dropdown-menu/index.ts +2 -2
  37. package/src/components/empty-state/empty-state.tsx +2 -2
  38. package/src/components/empty-state/index.ts +2 -2
  39. package/src/components/field/field.tsx +4 -4
  40. package/src/components/field/index.ts +2 -2
  41. package/src/components/inline-code/index.ts +2 -2
  42. package/src/components/inline-code/inline-code.tsx +9 -7
  43. package/src/components/input/index.ts +2 -2
  44. package/src/components/input/input.tsx +4 -4
  45. package/src/components/input-group/index.ts +2 -2
  46. package/src/components/input-group/input-group.tsx +5 -5
  47. package/src/components/kbd/index.ts +2 -2
  48. package/src/components/kbd/kbd.tsx +2 -2
  49. package/src/components/label/index.ts +2 -7
  50. package/src/components/label/label.tsx +2 -2
  51. package/src/components/lightbox/index.ts +2 -2
  52. package/src/components/lightbox/lightbox.tsx +3 -3
  53. package/src/components/list-item/index.ts +2 -2
  54. package/src/components/list-item/list-item.tsx +2 -2
  55. package/src/components/media-list-item/index.ts +2 -2
  56. package/src/components/media-list-item/media-list-item.tsx +4 -4
  57. package/src/components/notification-center/index.ts +2 -2
  58. package/src/components/notification-center/notification-center.tsx +5 -5
  59. package/src/components/panel-header/index.ts +2 -2
  60. package/src/components/panel-header/panel-header.tsx +2 -2
  61. package/src/components/popover/index.ts +2 -2
  62. package/src/components/popover/popover.tsx +3 -3
  63. package/src/components/preview-shell/index.ts +2 -2
  64. package/src/components/preview-shell/preview-shell.tsx +2 -2
  65. package/src/components/quoted-message-card/index.ts +2 -2
  66. package/src/components/quoted-message-card/quoted-message-card.tsx +3 -3
  67. package/src/components/radio-group/index.ts +2 -6
  68. package/src/components/radio-group/radio-group.tsx +4 -4
  69. package/src/components/section-header/index.ts +2 -2
  70. package/src/components/section-header/section-header.tsx +2 -2
  71. package/src/components/section-label/index.ts +2 -2
  72. package/src/components/section-label/section-label.tsx +2 -2
  73. package/src/components/segmented-control/index.ts +2 -2
  74. package/src/components/segmented-control/segmented-control.tsx +3 -3
  75. package/src/components/select/index.ts +2 -2
  76. package/src/components/select/select.tsx +4 -4
  77. package/src/components/separator/index.ts +2 -0
  78. package/src/components/separator/separator.tsx +40 -0
  79. package/src/components/spinner/index.ts +2 -2
  80. package/src/components/spinner/spinner.tsx +3 -3
  81. package/src/components/status/index.ts +2 -2
  82. package/src/components/status/status.tsx +2 -2
  83. package/src/components/tabs/index.ts +2 -2
  84. package/src/components/tabs/tabs.tsx +43 -9
  85. package/src/components/text/index.ts +2 -2
  86. package/src/components/text/text.tsx +2 -1
  87. package/src/components/textarea/index.ts +2 -2
  88. package/src/components/textarea/textarea.tsx +3 -3
  89. package/src/components/toggle-group/index.ts +2 -7
  90. package/src/components/toggle-group/toggle-group.tsx +3 -3
  91. package/src/components/tooltip/index.ts +2 -8
  92. package/src/components/tooltip/tooltip.tsx +42 -16
  93. package/src/index.ts +60 -57
  94. package/src/legacy/AvatarListRow.tsx +1 -1
  95. package/src/legacy/Checkbox.tsx +1 -1
  96. package/src/legacy/ConversationPreviewCard.tsx +1 -1
  97. package/src/legacy/DismissBackdrop.tsx +1 -1
  98. package/src/legacy/ExperimentalBadge.tsx +1 -1
  99. package/src/legacy/NotificationCenter.tsx +2 -2
  100. package/src/legacy/PanelHeader.tsx +1 -1
  101. package/src/legacy/QuotedMessageCard.tsx +1 -1
  102. package/src/legacy/ReorderablePanelTabs.tsx +6 -1
  103. package/src/legacy/SectionHeader.tsx +1 -1
  104. package/src/legacy/Spinner.tsx +1 -1
  105. package/src/legacy/SurfaceListItem.tsx +1 -1
  106. package/src/legacy/selection-popover.tsx +2 -2
  107. package/src/legacy/server-switcher-menu.tsx +2 -2
  108. package/src/lib/theme/theme-provider.tsx +1 -1
  109. package/src/lib/theme/use-theme.ts +1 -1
  110. package/src/styles.css +5 -6
  111. package/src/wip.ts +82 -24
  112. package/dist/styled-props-B3SNekJg.d.mts +0 -16
  113. package/dist/use-theme-Y_h1DKll.mjs +0 -34
  114. package/src/fonts/brutal.css +0 -2
@@ -0,0 +1,215 @@
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
+ }
@@ -0,0 +1,30 @@
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";
@@ -1,8 +1,8 @@
1
1
  import type { ComponentPropsWithRef } from "react";
2
2
  import { Avatar as AvatarPrimitive } from "@base-ui/react";
3
- import { tv, type VariantProps } from "../../lib/tv.ts";
4
- import { useThemeFamily } from "../../lib/theme/use-theme.ts";
5
- import type { StyledProps } from "../../lib/styled-props.ts";
3
+ import { tv, type VariantProps } from "../../lib/tv";
4
+ import { useThemeFamily } from "../../lib/theme/use-theme";
5
+ import type { StyledProps } from "../../lib/styled-props";
6
6
 
7
7
  // Avatar family built on Base UI's Avatar primitive. Compose `<AvatarImage>`,
8
8
  // `<AvatarFallback>`, and `<AvatarBadge>` as children; with no children a
@@ -6,7 +6,7 @@ export {
6
6
  AvatarBadge,
7
7
  AvatarGroup,
8
8
  AvatarGroupCount,
9
- } from "./avatar.tsx";
9
+ } from "./avatar";
10
10
  export type {
11
11
  AvatarProps,
12
12
  AvatarImageProps,
@@ -14,4 +14,4 @@ export type {
14
14
  AvatarBadgeProps,
15
15
  AvatarGroupProps,
16
16
  AvatarGroupCountProps,
17
- } from "./avatar.tsx";
17
+ } from "./avatar";
@@ -1,7 +1,7 @@
1
1
  import { mergeProps } from "@base-ui/react/merge-props";
2
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";
3
+ import { tv, type VariantProps } from "../../lib/tv";
4
+ import { useThemeFamily } from "../../lib/theme/use-theme";
5
5
 
6
6
  export const badge = tv({
7
7
  slots: {
@@ -1,2 +1,2 @@
1
- export { Badge } from "./badge.tsx";
2
- export type { BadgeProps } from "./badge.tsx";
1
+ export { Badge } from "./badge";
2
+ export type { BadgeProps } from "./badge";
@@ -1,7 +1,7 @@
1
1
  import { mergeProps } from "@base-ui/react/merge-props";
2
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";
3
+ import { tv, type VariantProps } from "../../lib/tv";
4
+ import { useThemeFamily } from "../../lib/theme/use-theme";
5
5
 
6
6
  const banner = tv({
7
7
  slots: {
@@ -1,8 +1,8 @@
1
- export { Banner, BannerAction, BannerDescription, BannerTitle } from "./banner.tsx";
1
+ export { Banner, BannerAction, BannerDescription, BannerTitle } from "./banner";
2
2
  export type {
3
3
  BannerActionProps,
4
4
  BannerDescriptionProps,
5
5
  BannerProps,
6
6
  BannerStatus,
7
7
  BannerTitleProps,
8
- } from "./banner.tsx";
8
+ } from "./banner";
@@ -1,9 +1,9 @@
1
1
  import { Dialog } from "@base-ui/react/dialog";
2
2
  import { mergeProps } from "@base-ui/react/merge-props";
3
3
  import { useRender } from "@base-ui/react/use-render";
4
- import { tv } from "../../lib/tv.ts";
5
- import type { StyledProps } from "../../lib/styled-props.ts";
6
- import { useThemeFamily } from "../../lib/theme/use-theme.ts";
4
+ import { tv } from "../../lib/tv";
5
+ import type { StyledProps } from "../../lib/styled-props";
6
+ import { useThemeFamily } from "../../lib/theme/use-theme";
7
7
 
8
8
  // Mobile bottom sheet, composed from base-ui Dialog parts and slot parts
9
9
  // (`BottomSheetTrigger`, `BottomSheetContent`, `BottomSheetHeader`,
@@ -8,7 +8,7 @@ export {
8
8
  BottomSheetFooter,
9
9
  BottomSheetTitle,
10
10
  BottomSheetDescription,
11
- } from "./bottom-sheet.tsx";
11
+ } from "./bottom-sheet";
12
12
  export type {
13
13
  BottomSheetProps,
14
14
  BottomSheetTriggerProps,
@@ -19,4 +19,4 @@ export type {
19
19
  BottomSheetFooterProps,
20
20
  BottomSheetTitleProps,
21
21
  BottomSheetDescriptionProps,
22
- } from "./bottom-sheet.tsx";
22
+ } from "./bottom-sheet";
@@ -1,9 +1,9 @@
1
1
  import { Button as BaseButton } from "@base-ui/react/button";
2
2
  import type { ReactElement } from "react";
3
- import { tv, type VariantProps } from "../../lib/tv.ts";
4
- import type { StyledProps } from "../../lib/styled-props.ts";
5
- import { useThemeFamily } from "../../lib/theme/use-theme.ts";
6
- import { Spinner } from "../spinner/index.ts";
3
+ import { tv, type VariantProps } from "../../lib/tv";
4
+ import type { StyledProps } from "../../lib/styled-props";
5
+ import { useThemeFamily } from "../../lib/theme/use-theme";
6
+ import { Spinner } from "../spinner/index";
7
7
 
8
8
  export const buttonVariants = tv({
9
9
  slots: {
@@ -195,7 +195,9 @@ export const buttonVariants = tv({
195
195
  {
196
196
  theme: "brutal",
197
197
  variant: "warning",
198
- class: { root: "bg-warning-base text-black hover:bg-warning-base" },
198
+ class: {
199
+ root: "bg-[oklch(0.785_0.123_50.11)] text-black hover:bg-[oklch(0.785_0.123_50.11)]",
200
+ },
199
201
  },
200
202
  {
201
203
  theme: "brutal",
@@ -1,2 +1,2 @@
1
- export { Button, buttonVariants } from "./button.tsx";
2
- export type { ButtonProps } from "./button.tsx";
1
+ export { Button, buttonVariants } from "./button";
2
+ export type { ButtonProps } from "./button";
@@ -1,7 +1,7 @@
1
1
  import { Check, Minus } from "lucide-react";
2
2
  import type { ComponentPropsWithRef } from "react";
3
- import { tv, type VariantProps } from "../../lib/tv.ts";
4
- import { useThemeFamily } from "../../lib/theme/use-theme.ts";
3
+ import { tv, type VariantProps } from "../../lib/tv";
4
+ import { useThemeFamily } from "../../lib/theme/use-theme";
5
5
 
6
6
  const checkboxIndicator = tv({
7
7
  slots: {
@@ -1,9 +1,9 @@
1
1
  import { useId } from "react";
2
2
  import { Checkbox as BaseCheckbox } from "@base-ui/react/checkbox";
3
- import { tv, type VariantProps } from "../../lib/tv.ts";
4
- import { CheckboxIndicator } from "./checkbox-indicator.tsx";
5
- import type { StyledProps } from "../../lib/styled-props.ts";
6
- import { useThemeFamily } from "../../lib/theme/use-theme.ts";
3
+ import { tv, type VariantProps } from "../../lib/tv";
4
+ import { CheckboxIndicator } from "./checkbox-indicator";
5
+ import type { StyledProps } from "../../lib/styled-props";
6
+ import { useThemeFamily } from "../../lib/theme/use-theme";
7
7
 
8
8
  const checkbox = tv({
9
9
  slots: {
@@ -1,2 +1,2 @@
1
- export { Checkbox } from "./checkbox.tsx";
2
- export type { CheckboxProps } from "./checkbox.tsx";
1
+ export { Checkbox } from "./checkbox";
2
+ export type { CheckboxProps } from "./checkbox";
@@ -1,10 +1,10 @@
1
1
  import { createContext, use, useState, type ComponentPropsWithRef } from "react";
2
2
  import { Combobox as BaseCombobox } from "@base-ui/react/combobox";
3
3
  import { Check, X } from "lucide-react";
4
- import { tv } from "../../lib/tv.ts";
5
- import type { StyledProps } from "../../lib/styled-props.ts";
6
- import { useThemeFamily } from "../../lib/theme/use-theme.ts";
7
- import { Button } from "../button/index.ts";
4
+ import { tv } from "../../lib/tv";
5
+ import type { StyledProps } from "../../lib/styled-props";
6
+ import { useThemeFamily } from "../../lib/theme/use-theme";
7
+ import { Button } from "../button/index";
8
8
 
9
9
  const combobox = tv({
10
10
  slots: {
@@ -49,4 +49,4 @@ export {
49
49
  type ComboboxTriggerIndicatorProps,
50
50
  type ComboboxTriggerProps,
51
51
  type ComboboxValueProps,
52
- } from "./combobox.tsx";
52
+ } from "./combobox";
@@ -1,9 +1,9 @@
1
1
  import { ContextMenu as BaseContextMenu } from "@base-ui/react";
2
2
  import type { ComponentPropsWithRef } from "react";
3
- import { tv } from "../../lib/tv.ts";
4
- import { Kbd, type KbdProps } from "../kbd/index.ts";
5
- import type { StyledProps } from "../../lib/styled-props.ts";
6
- import { useThemeFamily } from "../../lib/theme/use-theme.ts";
3
+ import { tv } from "../../lib/tv";
4
+ import { Kbd, type KbdProps } from "../kbd/index";
5
+ import type { StyledProps } from "../../lib/styled-props";
6
+ import { useThemeFamily } from "../../lib/theme/use-theme";
7
7
 
8
8
  const contextMenu = tv({
9
9
  slots: {
@@ -14,7 +14,7 @@ export {
14
14
  ContextMenuSubmenu,
15
15
  ContextMenuSubmenuTrigger,
16
16
  ContextMenuTrigger,
17
- } from "./context-menu.tsx";
17
+ } from "./context-menu";
18
18
  export type {
19
19
  ContextMenuCheckboxItemIndicatorProps,
20
20
  ContextMenuCheckboxItemProps,
@@ -31,4 +31,4 @@ export type {
31
31
  ContextMenuSubmenuProps,
32
32
  ContextMenuSubmenuTriggerProps,
33
33
  ContextMenuTriggerProps,
34
- } from "./context-menu.tsx";
34
+ } from "./context-menu";
@@ -1,8 +1,8 @@
1
1
  import { Button as BaseButton } from "@base-ui/react/button";
2
2
  import { mergeProps } from "@base-ui/react/merge-props";
3
3
  import { useRender } from "@base-ui/react/use-render";
4
- import { tv } from "../../lib/tv.ts";
5
- import { useThemeFamily } from "../../lib/theme/use-theme.ts";
4
+ import { tv } from "../../lib/tv";
5
+ import { useThemeFamily } from "../../lib/theme/use-theme";
6
6
 
7
7
  const conversationPreviewCard = tv({
8
8
  slots: {
@@ -13,7 +13,7 @@ export {
13
13
  ConversationPreviewCardPreviewLeading,
14
14
  ConversationPreviewCardSecondaryPreview,
15
15
  ConversationPreviewCardTimestamp,
16
- } from "./conversation-preview-card.tsx";
16
+ } from "./conversation-preview-card";
17
17
  export type {
18
18
  ConversationPreviewCardActionProps,
19
19
  ConversationPreviewCardAuthorNameProps,
@@ -29,4 +29,4 @@ export type {
29
29
  ConversationPreviewCardProps,
30
30
  ConversationPreviewCardSecondaryPreviewProps,
31
31
  ConversationPreviewCardTimestampProps,
32
- } from "./conversation-preview-card.tsx";
32
+ } from "./conversation-preview-card";
@@ -1,7 +1,7 @@
1
1
  import { mergeProps } from "@base-ui/react/merge-props";
2
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";
3
+ import { tv } from "../../lib/tv";
4
+ import { useThemeFamily } from "../../lib/theme/use-theme";
5
5
 
6
6
  const descriptionList = tv({
7
7
  slots: {
@@ -4,11 +4,11 @@ export {
4
4
  DescriptionItem,
5
5
  DescriptionList,
6
6
  DescriptionTerm,
7
- } from "./description-list.tsx";
7
+ } from "./description-list";
8
8
  export type {
9
9
  DescriptionActionProps,
10
10
  DescriptionDetailsProps,
11
11
  DescriptionItemProps,
12
12
  DescriptionListProps,
13
13
  DescriptionTermProps,
14
- } from "./description-list.tsx";
14
+ } from "./description-list";
@@ -0,0 +1,152 @@
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
+ }