raft-ui 0.0.8 → 0.0.9

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/dist/styles.css CHANGED
@@ -1,7 +1,83 @@
1
- @import url("https://fonts.googleapis.com/css2?family=Geist+Mono:wght@300..700&family=Hanken+Grotesk:wght@300..700&display=swap");
2
-
3
1
  /* Pure token contract. No legacy action/surface/destructive/component aliases. */
4
2
 
3
+ [data-vaul-drawer] {
4
+ touch-action: none;
5
+ will-change: transform;
6
+ transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1);
7
+ animation-duration: 0.2s;
8
+ animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1);
9
+ }
10
+
11
+ [data-vaul-drawer][data-vaul-snap-points="false"][data-vaul-drawer-direction="bottom"][data-state="open"] {
12
+ animation-name: slideFromBottom;
13
+ }
14
+
15
+ [data-vaul-drawer][data-vaul-snap-points="false"][data-vaul-drawer-direction="bottom"][data-state="closed"] {
16
+ animation-name: slideToBottom;
17
+ }
18
+
19
+ [data-vaul-overlay][data-vaul-snap-points="false"] {
20
+ animation-duration: 0.2s;
21
+ animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1);
22
+ }
23
+
24
+ [data-vaul-overlay][data-vaul-snap-points="false"][data-state="open"] {
25
+ animation-name: fadeIn;
26
+ }
27
+
28
+ [data-vaul-overlay][data-state="closed"] {
29
+ animation-name: fadeOut;
30
+ }
31
+
32
+ [data-vaul-animate="false"] {
33
+ animation: none !important;
34
+ }
35
+
36
+ [data-vaul-drawer]:not([data-vaul-custom-container="true"])::after {
37
+ content: "";
38
+ position: absolute;
39
+ background: inherit;
40
+ background-color: inherit;
41
+ }
42
+
43
+ [data-vaul-drawer][data-vaul-drawer-direction="bottom"]::after {
44
+ top: 100%;
45
+ bottom: initial;
46
+ left: 0;
47
+ right: 0;
48
+ height: 200%;
49
+ }
50
+
51
+ @keyframes fadeIn {
52
+ from {
53
+ opacity: 0;
54
+ }
55
+ to {
56
+ opacity: 1;
57
+ }
58
+ }
59
+
60
+ @keyframes fadeOut {
61
+ to {
62
+ opacity: 0;
63
+ }
64
+ }
65
+
66
+ @keyframes slideFromBottom {
67
+ from {
68
+ transform: translate3d(0, var(--initial-transform, 100%), 0);
69
+ }
70
+ to {
71
+ transform: translate3d(0, 0, 0);
72
+ }
73
+ }
74
+
75
+ @keyframes slideToBottom {
76
+ to {
77
+ transform: translate3d(0, var(--initial-transform, 100%), 0);
78
+ }
79
+ }
80
+
5
81
  @theme {
6
82
  --shadow-*: initial;
7
83
 
@@ -229,7 +305,7 @@
229
305
  --layer-muted: oklch(0.18 0.006 25 / 0.05);
230
306
  --layer-field: oklch(1 0 0);
231
307
  --layer-popover: oklch(1 0 0);
232
- --layer-backdrop: oklch(0 0 0 / 0.75);
308
+ --layer-backdrop: oklch(0 0 0 / 0.65);
233
309
 
234
310
  --line-strong: oklch(0.18 0.006 25);
235
311
  --line: oklch(0.18 0.006 25);
@@ -318,7 +394,7 @@
318
394
  --layer-muted: oklch(0.967 0.001 286);
319
395
  --layer-field: oklch(1 0 0);
320
396
  --layer-popover: oklch(1 0 0);
321
- --layer-backdrop: oklch(0 0 0 / 0.75);
397
+ --layer-backdrop: oklch(0 0 0 / 0.15);
322
398
 
323
399
  --line-strong: oklch(0.21 0.006 285);
324
400
  --line: oklch(0.84 0.006 285);
package/dist/wip.d.mts CHANGED
@@ -1,9 +1,10 @@
1
- import { n as StyledProps, t as VariantProps } from "./tv-UUMwNowu.mjs";
1
+ import { a as StyledProps, i as VariantProps, n as ButtonProps } from "./index-lPUAF7fl.mjs";
2
2
  import { Dialog } from "@base-ui/react/dialog";
3
- import { ComponentPropsWithRef, ReactNode } from "react";
3
+ import { ComponentProps, ComponentPropsWithRef, ReactElement, ReactNode } from "react";
4
4
  import { useRender } from "@base-ui/react/use-render";
5
5
  import { Toggle } from "@base-ui/react/toggle";
6
6
  import { ToggleGroup as ToggleGroup$1 } from "@base-ui/react/toggle-group";
7
+ import { Drawer } from "vaul";
7
8
 
8
9
  //#region src/components/toggle-group/toggle-group.d.ts
9
10
  declare const toggleGroup: import("tailwind-variants/lite").TVReturnType<{
@@ -877,40 +878,93 @@ declare function LightboxClose({
877
878
  }: LightboxCloseProps): import("react").JSX.Element;
878
879
  //#endregion
879
880
  //#region src/components/bottom-sheet/bottom-sheet.d.ts
880
- type BottomSheetProps = Dialog.Root.Props;
881
- declare function BottomSheet(props: BottomSheetProps): import("react").JSX.Element;
882
- type BottomSheetTriggerProps = Dialog.Trigger.Props;
883
- declare function BottomSheetTrigger(props: BottomSheetTriggerProps): import("react").JSX.Element;
884
- type BottomSheetPortalProps = Dialog.Portal.Props;
885
- declare function BottomSheetPortal(props: BottomSheetPortalProps): import("react").JSX.Element;
886
- type BottomSheetContentProps = StyledProps<Dialog.Popup.Props>;
881
+ type BottomSheetProps = ComponentProps<typeof Drawer.Root>;
882
+ declare function BottomSheet({
883
+ direction,
884
+ ...props
885
+ }: BottomSheetProps): import("react").JSX.Element;
886
+ type BottomSheetTriggerProps = Omit<ComponentProps<typeof Drawer.Trigger>, "asChild"> & {
887
+ render?: ReactElement<{
888
+ children?: ReactNode;
889
+ }>;
890
+ };
891
+ declare function BottomSheetTrigger({
892
+ children,
893
+ render,
894
+ ...props
895
+ }: BottomSheetTriggerProps): import("react").JSX.Element;
896
+ type BottomSheetPortalProps = ComponentProps<typeof Drawer.Portal> & {
897
+ className?: string;
898
+ };
899
+ declare function BottomSheetPortal({
900
+ className,
901
+ children,
902
+ ...props
903
+ }: BottomSheetPortalProps): import("react").JSX.Element;
904
+ type BottomSheetPositionerProps = ComponentPropsWithRef<"div">;
905
+ declare function BottomSheetPositioner({
906
+ className,
907
+ ...props
908
+ }: BottomSheetPositionerProps): import("react").JSX.Element;
909
+ type BottomSheetOverlayProps = StyledProps<ComponentProps<typeof Drawer.Overlay>>;
910
+ declare function BottomSheetOverlay({
911
+ className,
912
+ ...props
913
+ }: BottomSheetOverlayProps): import("react").JSX.Element;
914
+ type BottomSheetContentProps = StyledProps<ComponentProps<typeof Drawer.Content>>;
887
915
  declare function BottomSheetContent({
888
916
  className,
889
917
  ...props
890
918
  }: BottomSheetContentProps): import("react").JSX.Element;
891
- type BottomSheetCloseProps = Dialog.Close.Props;
892
- declare function BottomSheetClose(props: BottomSheetCloseProps): import("react").JSX.Element;
919
+ type BottomSheetCloseProps = Omit<ComponentProps<typeof Drawer.Close>, "asChild"> & Pick<ButtonProps, "variant" | "size"> & {
920
+ className?: string;
921
+ children?: ReactNode;
922
+ render?: ReactElement<{
923
+ children?: ReactNode;
924
+ }>;
925
+ };
926
+ declare function BottomSheetClose({
927
+ className,
928
+ variant,
929
+ size,
930
+ children,
931
+ render,
932
+ ...props
933
+ }: BottomSheetCloseProps): import("react").JSX.Element;
893
934
  type BottomSheetHeaderProps = useRender.ComponentProps<"div">;
894
935
  declare function BottomSheetHeader({
895
936
  className,
896
937
  render,
897
938
  ...props
898
- }: BottomSheetHeaderProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
939
+ }: BottomSheetHeaderProps): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
899
940
  type BottomSheetFooterProps = useRender.ComponentProps<"div">;
900
941
  declare function BottomSheetFooter({
901
942
  className,
902
943
  render,
903
944
  ...props
904
- }: BottomSheetFooterProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
905
- type BottomSheetTitleProps = StyledProps<Dialog.Title.Props>;
945
+ }: BottomSheetFooterProps): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
946
+ type BottomSheetBodyProps = useRender.ComponentProps<"div">;
947
+ declare function BottomSheetBody({
948
+ className,
949
+ render,
950
+ ...props
951
+ }: BottomSheetBodyProps): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
952
+ type BottomSheetActionsProps = useRender.ComponentProps<"div">;
953
+ declare function BottomSheetActions({
954
+ className,
955
+ render,
956
+ children,
957
+ ...props
958
+ }: BottomSheetActionsProps): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
959
+ type BottomSheetTitleProps = StyledProps<ComponentProps<typeof Drawer.Title>>;
906
960
  declare function BottomSheetTitle({
907
961
  className,
908
962
  ...props
909
963
  }: BottomSheetTitleProps): import("react").JSX.Element;
910
- type BottomSheetDescriptionProps = StyledProps<Dialog.Description.Props>;
964
+ type BottomSheetDescriptionProps = StyledProps<ComponentProps<typeof Drawer.Description>>;
911
965
  declare function BottomSheetDescription({
912
966
  className,
913
967
  ...props
914
968
  }: BottomSheetDescriptionProps): import("react").JSX.Element;
915
969
  //#endregion
916
- export { BottomSheet, BottomSheetClose, type BottomSheetCloseProps, BottomSheetContent, type BottomSheetContentProps, BottomSheetDescription, type BottomSheetDescriptionProps, BottomSheetFooter, type BottomSheetFooterProps, BottomSheetHeader, type BottomSheetHeaderProps, BottomSheetPortal, type BottomSheetPortalProps, type BottomSheetProps, BottomSheetTitle, type BottomSheetTitleProps, BottomSheetTrigger, type BottomSheetTriggerProps, ConversationPreviewCard, ConversationPreviewCardAction, type ConversationPreviewCardActionProps, ConversationPreviewCardAuthor, ConversationPreviewCardAuthorName, type ConversationPreviewCardAuthorNameProps, type ConversationPreviewCardAuthorProps, ConversationPreviewCardAuthorSubtitle, type ConversationPreviewCardAuthorSubtitleProps, ConversationPreviewCardChannel, type ConversationPreviewCardChannelProps, ConversationPreviewCardContent, type ConversationPreviewCardContentProps, ConversationPreviewCardFooter, type ConversationPreviewCardFooterProps, ConversationPreviewCardMeta, type ConversationPreviewCardMetaProps, ConversationPreviewCardPreview, ConversationPreviewCardPreviewAuthor, type ConversationPreviewCardPreviewAuthorProps, ConversationPreviewCardPreviewLeading, type ConversationPreviewCardPreviewLeadingProps, type ConversationPreviewCardPreviewProps, type ConversationPreviewCardProps, ConversationPreviewCardSecondaryPreview, type ConversationPreviewCardSecondaryPreviewProps, ConversationPreviewCardTimestamp, type ConversationPreviewCardTimestampProps, DescriptionAction, type DescriptionActionProps, DescriptionDetails, type DescriptionDetailsProps, DescriptionItem, type DescriptionItemProps, DescriptionList, type DescriptionListProps, DescriptionTerm, type DescriptionTermProps, Lightbox, LightboxActions, type LightboxActionsProps, LightboxClose, type LightboxCloseProps, LightboxContent, type LightboxContentProps, LightboxHeader, type LightboxHeaderProps, LightboxMedia, type LightboxMediaProps, LightboxPortal, type LightboxPortalProps, type LightboxProps, LightboxStage, type LightboxStageProps, LightboxTitle, type LightboxTitleProps, LightboxTrigger, type LightboxTriggerProps, ListItem, ListItemActionGroup, type ListItemActionGroupProps, ListItemBody, type ListItemBodyProps, ListItemDescription, type ListItemDescriptionProps, ListItemIcon, type ListItemIconProps, ListItemMeta, type ListItemMetaProps, type ListItemProps, ListItemRow, type ListItemRowProps, ListItemTitle, type ListItemTitleProps, MediaListItem, MediaListItemActionGroup, type MediaListItemActionGroupProps, MediaListItemAside, type MediaListItemAsideProps, MediaListItemBody, type MediaListItemBodyProps, type MediaListItemProps, MediaListItemSubtitle, type MediaListItemSubtitleProps, MediaListItemText, type MediaListItemTextProps, MediaListItemTitle, type MediaListItemTitleProps, MediaListItemVisual, type MediaListItemVisualProps, PanelHeader, PanelHeaderActions, type PanelHeaderActionsProps, PanelHeaderContent, type PanelHeaderContentProps, PanelHeaderIcon, type PanelHeaderIconProps, type PanelHeaderProps, PanelHeaderSubtitle, type PanelHeaderSubtitleProps, PanelHeaderSuffix, type PanelHeaderSuffixProps, PanelHeaderTitle, type PanelHeaderTitleProps, PanelHeaderTitleRow, type PanelHeaderTitleRowProps, PanelHeaderVisual, type PanelHeaderVisualProps, PreviewShell, type PreviewShellProps, QuotedMessageCard, QuotedMessageCardAttachments, type QuotedMessageCardAttachmentsProps, QuotedMessageCardAuthor, QuotedMessageCardAuthorName, type QuotedMessageCardAuthorNameProps, type QuotedMessageCardAuthorProps, QuotedMessageCardAuthorSubtitle, type QuotedMessageCardAuthorSubtitleProps, QuotedMessageCardBody, type QuotedMessageCardBodyProps, QuotedMessageCardChannel, type QuotedMessageCardChannelProps, QuotedMessageCardContent, type QuotedMessageCardContentProps, QuotedMessageCardContentWrap, type QuotedMessageCardContentWrapProps, QuotedMessageCardHeader, type QuotedMessageCardHeaderProps, QuotedMessageCardMeta, type QuotedMessageCardMetaProps, type QuotedMessageCardProps, QuotedMessageCardSeparator, type QuotedMessageCardSeparatorProps, QuotedMessageCardTag, type QuotedMessageCardTagProps, QuotedMessageCardThread, type QuotedMessageCardThreadProps, QuotedMessageCardTimestamp, type QuotedMessageCardTimestampProps, QuotedMessageCardUnavailable, type QuotedMessageCardUnavailableProps, SectionHeader, SectionHeaderActions, type SectionHeaderActionsProps, SectionHeaderContent, type SectionHeaderContentProps, SectionHeaderCount, type SectionHeaderCountProps, SectionHeaderIcon, type SectionHeaderIconProps, type SectionHeaderProps, SectionHeaderTitle, type SectionHeaderTitleProps, SectionLabel, type SectionLabelProps, ToggleGroup, ToggleGroupCount, type ToggleGroupCountProps, ToggleGroupItem, type ToggleGroupItemProps, ToggleGroupLabel, type ToggleGroupLabelProps, type ToggleGroupProps };
970
+ export { BottomSheet, BottomSheetActions, type BottomSheetActionsProps, BottomSheetBody, type BottomSheetBodyProps, BottomSheetClose, type BottomSheetCloseProps, BottomSheetContent, type BottomSheetContentProps, BottomSheetDescription, type BottomSheetDescriptionProps, BottomSheetFooter, type BottomSheetFooterProps, BottomSheetHeader, type BottomSheetHeaderProps, BottomSheetOverlay, type BottomSheetOverlayProps, BottomSheetPortal, type BottomSheetPortalProps, BottomSheetPositioner, type BottomSheetPositionerProps, type BottomSheetProps, BottomSheetTitle, type BottomSheetTitleProps, BottomSheetTrigger, type BottomSheetTriggerProps, ConversationPreviewCard, ConversationPreviewCardAction, type ConversationPreviewCardActionProps, ConversationPreviewCardAuthor, ConversationPreviewCardAuthorName, type ConversationPreviewCardAuthorNameProps, type ConversationPreviewCardAuthorProps, ConversationPreviewCardAuthorSubtitle, type ConversationPreviewCardAuthorSubtitleProps, ConversationPreviewCardChannel, type ConversationPreviewCardChannelProps, ConversationPreviewCardContent, type ConversationPreviewCardContentProps, ConversationPreviewCardFooter, type ConversationPreviewCardFooterProps, ConversationPreviewCardMeta, type ConversationPreviewCardMetaProps, ConversationPreviewCardPreview, ConversationPreviewCardPreviewAuthor, type ConversationPreviewCardPreviewAuthorProps, ConversationPreviewCardPreviewLeading, type ConversationPreviewCardPreviewLeadingProps, type ConversationPreviewCardPreviewProps, type ConversationPreviewCardProps, ConversationPreviewCardSecondaryPreview, type ConversationPreviewCardSecondaryPreviewProps, ConversationPreviewCardTimestamp, type ConversationPreviewCardTimestampProps, DescriptionAction, type DescriptionActionProps, DescriptionDetails, type DescriptionDetailsProps, DescriptionItem, type DescriptionItemProps, DescriptionList, type DescriptionListProps, DescriptionTerm, type DescriptionTermProps, Lightbox, LightboxActions, type LightboxActionsProps, LightboxClose, type LightboxCloseProps, LightboxContent, type LightboxContentProps, LightboxHeader, type LightboxHeaderProps, LightboxMedia, type LightboxMediaProps, LightboxPortal, type LightboxPortalProps, type LightboxProps, LightboxStage, type LightboxStageProps, LightboxTitle, type LightboxTitleProps, LightboxTrigger, type LightboxTriggerProps, ListItem, ListItemActionGroup, type ListItemActionGroupProps, ListItemBody, type ListItemBodyProps, ListItemDescription, type ListItemDescriptionProps, ListItemIcon, type ListItemIconProps, ListItemMeta, type ListItemMetaProps, type ListItemProps, ListItemRow, type ListItemRowProps, ListItemTitle, type ListItemTitleProps, MediaListItem, MediaListItemActionGroup, type MediaListItemActionGroupProps, MediaListItemAside, type MediaListItemAsideProps, MediaListItemBody, type MediaListItemBodyProps, type MediaListItemProps, MediaListItemSubtitle, type MediaListItemSubtitleProps, MediaListItemText, type MediaListItemTextProps, MediaListItemTitle, type MediaListItemTitleProps, MediaListItemVisual, type MediaListItemVisualProps, PanelHeader, PanelHeaderActions, type PanelHeaderActionsProps, PanelHeaderContent, type PanelHeaderContentProps, PanelHeaderIcon, type PanelHeaderIconProps, type PanelHeaderProps, PanelHeaderSubtitle, type PanelHeaderSubtitleProps, PanelHeaderSuffix, type PanelHeaderSuffixProps, PanelHeaderTitle, type PanelHeaderTitleProps, PanelHeaderTitleRow, type PanelHeaderTitleRowProps, PanelHeaderVisual, type PanelHeaderVisualProps, PreviewShell, type PreviewShellProps, QuotedMessageCard, QuotedMessageCardAttachments, type QuotedMessageCardAttachmentsProps, QuotedMessageCardAuthor, QuotedMessageCardAuthorName, type QuotedMessageCardAuthorNameProps, type QuotedMessageCardAuthorProps, QuotedMessageCardAuthorSubtitle, type QuotedMessageCardAuthorSubtitleProps, QuotedMessageCardBody, type QuotedMessageCardBodyProps, QuotedMessageCardChannel, type QuotedMessageCardChannelProps, QuotedMessageCardContent, type QuotedMessageCardContentProps, QuotedMessageCardContentWrap, type QuotedMessageCardContentWrapProps, QuotedMessageCardHeader, type QuotedMessageCardHeaderProps, QuotedMessageCardMeta, type QuotedMessageCardMetaProps, type QuotedMessageCardProps, QuotedMessageCardSeparator, type QuotedMessageCardSeparatorProps, QuotedMessageCardTag, type QuotedMessageCardTagProps, QuotedMessageCardThread, type QuotedMessageCardThreadProps, QuotedMessageCardTimestamp, type QuotedMessageCardTimestampProps, QuotedMessageCardUnavailable, type QuotedMessageCardUnavailableProps, SectionHeader, SectionHeaderActions, type SectionHeaderActionsProps, SectionHeaderContent, type SectionHeaderContentProps, SectionHeaderCount, type SectionHeaderCountProps, SectionHeaderIcon, type SectionHeaderIconProps, type SectionHeaderProps, SectionHeaderTitle, type SectionHeaderTitleProps, SectionLabel, type SectionLabelProps, ToggleGroup, ToggleGroupCount, type ToggleGroupCountProps, ToggleGroupItem, type ToggleGroupItemProps, ToggleGroupLabel, type ToggleGroupLabelProps, type ToggleGroupProps };
package/dist/wip.mjs CHANGED
@@ -1,15 +1,16 @@
1
1
  import { cn } from "./cn.mjs";
2
- import { a as tv, n as useThemeFamily } from "./use-theme-Y_h1DKll.mjs";
2
+ import { a as useThemeFamily, c as tv, t as Button$1 } from "./button-jUlaK4eN.mjs";
3
3
  import { Dialog } from "@base-ui/react/dialog";
4
- import { MessageSquare } from "lucide-react";
5
- import { useCallback, useRef, useState } from "react";
4
+ import { MessageSquare, X } from "lucide-react";
5
+ import { Children, Fragment, cloneElement, isValidElement, useCallback, useRef, useState } from "react";
6
6
  import { Button } from "@base-ui/react/button";
7
7
  import { mergeProps } from "@base-ui/react/merge-props";
8
8
  import { useRender } from "@base-ui/react/use-render";
9
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
10
  import { Toggle } from "@base-ui/react/toggle";
11
11
  import { ToggleGroup as ToggleGroup$1 } from "@base-ui/react/toggle-group";
12
12
  import { useHotkey } from "@tanstack/react-hotkeys";
13
+ import { Drawer } from "vaul";
13
14
  //#region src/components/toggle-group/toggle-group.tsx
14
15
  const toggleGroup = tv({
15
16
  slots: {
@@ -638,7 +639,7 @@ function QuotedMessageCardThread({ className, render, children = "Thread", ...pr
638
639
  render,
639
640
  props: mergeProps({
640
641
  className: thread({ className }),
641
- children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MessageSquare, {}), children] })
642
+ children: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(MessageSquare, {}), children] })
642
643
  }, props),
643
644
  state: { slot: "quoted-message-card-thread" }
644
645
  });
@@ -1020,7 +1021,7 @@ const lightbox = tv({
1020
1021
  title: ["text-foreground-strong"],
1021
1022
  media: ["border-line-strong bg-layer-panel shadow-xl"]
1022
1023
  },
1023
- elegant: {}
1024
+ elegant: { backdrop: ["backdrop-blur-[2px]"] }
1024
1025
  } }
1025
1026
  });
1026
1027
  function Lightbox({ closeOnModW = true, defaultOpen = false, modal = true, onOpenChange, open, children, ...props }) {
@@ -1066,9 +1067,11 @@ function LightboxPortal(props) {
1066
1067
  });
1067
1068
  }
1068
1069
  function LightboxContent({ className, initialFocus = false, finalFocus = false, ...props }) {
1069
- const { backdrop, content } = lightbox({ theme: useThemeFamily() });
1070
+ const theme = useThemeFamily();
1071
+ const { backdrop, content } = lightbox({ theme });
1070
1072
  return /* @__PURE__ */ jsxs(LightboxPortal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, {
1071
1073
  "data-slot": "lightbox-backdrop",
1074
+ "data-theme": theme,
1072
1075
  className: backdrop()
1073
1076
  }), /* @__PURE__ */ jsx(Dialog.Popup, {
1074
1077
  "data-slot": "lightbox-content",
@@ -1135,45 +1138,133 @@ function LightboxClose({ className, ...props }) {
1135
1138
  //#region src/components/bottom-sheet/bottom-sheet.tsx
1136
1139
  const bottomSheet = tv({
1137
1140
  slots: {
1138
- content: ["fixed inset-x-3 bottom-[max(12px,env(safe-area-inset-bottom))] z-50 mx-auto max-w-md"],
1139
- header: ["flex flex-col gap-1 p-4"],
1140
- footer: ["mt-auto flex flex-col gap-2 p-4"],
1141
- title: ["text-base font-bold text-foreground-strong"],
1142
- description: ["text-sm text-foreground/60"]
1141
+ portal: [],
1142
+ overlay: ["fixed inset-0 z-50", "![animation-duration:0.2s]"],
1143
+ positioner: ["contents"],
1144
+ content: [
1145
+ "fixed z-50 flex h-auto flex-col outline-none",
1146
+ "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 md:data-[vaul-drawer-direction=bottom]:inset-x-3",
1147
+ "data-[vaul-drawer-direction=bottom]:mx-auto data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:min-h-64 data-[vaul-drawer-direction=bottom]:max-h-[82vh] data-[vaul-drawer-direction=bottom]:max-w-lg md:data-[vaul-drawer-direction=bottom]:max-w-md",
1148
+ "data-[vaul-drawer-direction=top]:inset-x-3 data-[vaul-drawer-direction=top]:top-3",
1149
+ "data-[vaul-drawer-direction=top]:mx-auto data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:max-w-md",
1150
+ "data-[vaul-drawer-direction=left]:inset-y-3 data-[vaul-drawer-direction=left]:left-3 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:max-w-sm",
1151
+ "data-[vaul-drawer-direction=right]:inset-y-3 data-[vaul-drawer-direction=right]:right-3 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:max-w-sm",
1152
+ "!duration-200 ![animation-duration:0.2s]"
1153
+ ],
1154
+ header: ["flex flex-col items-center px-6 pt-8 pb-2 text-center"],
1155
+ body: ["flex flex-1 flex-col items-center px-6 pt-4 pb-6 text-center"],
1156
+ footer: ["mt-auto px-6 py-5 md:pb-11"],
1157
+ actions: ["mx-auto w-full items-center justify-center gap-2.5", "[&_[data-slot=button]]:w-full"],
1158
+ title: ["max-w-sm text-pretty text-center text-2xl leading-8 text-foreground-strong"],
1159
+ description: ["max-w-sm text-pretty text-center text-sm leading-5 text-foreground/60"]
1143
1160
  },
1144
1161
  variants: { theme: {
1145
- brutal: { content: ["border-2 border-black bg-white text-black shadow-xl"] },
1146
- elegant: {}
1162
+ brutal: {
1163
+ overlay: ["bg-layer-backdrop"],
1164
+ title: ["font-bold"],
1165
+ content: [
1166
+ "border-2 border-black bg-white text-black shadow-[var(--shadow-lg)]",
1167
+ "data-[vaul-drawer-direction=bottom]:border-x-0 md:data-[vaul-drawer-direction=bottom]:border-x-2",
1168
+ "data-[vaul-drawer-direction=bottom]:border-b-0 md:data-[vaul-drawer-direction=bottom]:border-b-2"
1169
+ ]
1170
+ },
1171
+ elegant: {
1172
+ overlay: ["bg-layer-backdrop backdrop-blur-[2px]"],
1173
+ content: [
1174
+ "overflow-clip rounded-lg bg-layer-popover text-foreground shadow-xl md:rounded-xl",
1175
+ "data-[vaul-drawer-direction=bottom]:rounded-b-none",
1176
+ "md:data-[vaul-drawer-direction=bottom]:max-w-md",
1177
+ "md:data-[vaul-drawer-direction=top]:max-w-md",
1178
+ "md:data-[vaul-drawer-direction=left]:max-w-md",
1179
+ "md:data-[vaul-drawer-direction=right]:max-w-md"
1180
+ ],
1181
+ header: ["bg-white px-8 pt-9 pb-2"],
1182
+ body: ["bg-white px-8 pt-4 pb-7"],
1183
+ footer: ["mt-0 px-8 py-5 md:pb-11"],
1184
+ actions: ["flex w-fit max-w-none flex-row justify-center", "[&_[data-slot=button]]:w-auto"],
1185
+ title: ["font-sans text-2xl leading-8 font-semibold text-[oklch(0.22_0_0)]"],
1186
+ description: ["font-sans text-sm leading-5 text-[oklch(0.48_0_0)]"]
1187
+ }
1147
1188
  } }
1148
1189
  });
1149
- function BottomSheet(props) {
1150
- return /* @__PURE__ */ jsx(Dialog.Root, { ...props });
1190
+ function BottomSheet({ direction = "bottom", ...props }) {
1191
+ return /* @__PURE__ */ jsx(Drawer.Root, {
1192
+ direction,
1193
+ ...props
1194
+ });
1151
1195
  }
1152
- function BottomSheetTrigger(props) {
1153
- return /* @__PURE__ */ jsx(Dialog.Trigger, {
1196
+ function BottomSheetTrigger({ children, render, ...props }) {
1197
+ if (render) return /* @__PURE__ */ jsx(Drawer.Trigger, {
1198
+ "data-slot": "bottom-sheet-trigger",
1199
+ asChild: true,
1200
+ ...props,
1201
+ children: cloneElement(render, void 0, children ?? render.props.children)
1202
+ });
1203
+ return /* @__PURE__ */ jsx(Drawer.Trigger, {
1154
1204
  "data-slot": "bottom-sheet-trigger",
1205
+ ...props,
1206
+ children
1207
+ });
1208
+ }
1209
+ function BottomSheetPortal({ className, children, ...props }) {
1210
+ const portalChildren = Children.map(children, (child) => {
1211
+ if (isValidElement(child) && child.type === BottomSheetPositioner) return Children.map(child.props.children, (positionerChild) => withPortalClassName(positionerChild, className));
1212
+ return withPortalClassName(child, className);
1213
+ });
1214
+ return /* @__PURE__ */ jsx(Drawer.Portal, {
1215
+ ...props,
1216
+ children: portalChildren
1217
+ });
1218
+ }
1219
+ function withPortalClassName(child, className) {
1220
+ if (!className || !isValidElement(child)) return child;
1221
+ return cloneElement(child, { className: cn(child.props.className, className) });
1222
+ }
1223
+ function BottomSheetPositioner({ className, ...props }) {
1224
+ const { positioner } = bottomSheet({ theme: useThemeFamily() });
1225
+ return /* @__PURE__ */ jsx("div", {
1226
+ "data-slot": "bottom-sheet-positioner",
1227
+ className: positioner({ className }),
1155
1228
  ...props
1156
1229
  });
1157
1230
  }
1158
- function BottomSheetPortal(props) {
1159
- return /* @__PURE__ */ jsx(Dialog.Portal, {
1160
- "data-slot": "bottom-sheet-portal",
1231
+ function BottomSheetOverlay({ className, ...props }) {
1232
+ const theme = useThemeFamily();
1233
+ const { overlay } = bottomSheet({ theme });
1234
+ return /* @__PURE__ */ jsx(Drawer.Overlay, {
1235
+ "data-slot": "bottom-sheet-overlay",
1236
+ "data-theme": theme,
1237
+ className: overlay({ className }),
1161
1238
  ...props
1162
1239
  });
1163
1240
  }
1164
1241
  function BottomSheetContent({ className, ...props }) {
1165
1242
  const { content } = bottomSheet({ theme: useThemeFamily() });
1166
- return /* @__PURE__ */ jsx(BottomSheetPortal, { children: /* @__PURE__ */ jsx(Dialog.Popup, {
1243
+ return /* @__PURE__ */ jsx(Drawer.Content, {
1167
1244
  "data-slot": "bottom-sheet-content",
1168
- "data-side": "bottom",
1169
1245
  className: content({ className }),
1170
1246
  ...props
1171
- }) });
1247
+ });
1172
1248
  }
1173
- function BottomSheetClose(props) {
1174
- return /* @__PURE__ */ jsx(Dialog.Close, {
1249
+ function BottomSheetClose({ className, variant, size, children, render, ...props }) {
1250
+ const isBrutal = useThemeFamily() === "brutal";
1251
+ if (render) return /* @__PURE__ */ jsx(Drawer.Close, {
1175
1252
  "data-slot": "bottom-sheet-close",
1176
- ...props
1253
+ asChild: true,
1254
+ ...props,
1255
+ children: cloneElement(render, void 0, children ?? render.props.children)
1256
+ });
1257
+ return /* @__PURE__ */ jsx(Drawer.Close, {
1258
+ "data-slot": "bottom-sheet-close",
1259
+ asChild: true,
1260
+ ...props,
1261
+ children: /* @__PURE__ */ jsx(Button$1, {
1262
+ variant: variant ?? (isBrutal ? "outline" : "ghost"),
1263
+ size: size ?? (isBrutal ? "icon-sm" : "icon-sm"),
1264
+ "aria-label": "Close",
1265
+ className: cn(isBrutal ? "absolute top-3 right-3" : "absolute top-4 right-6", isBrutal ? "bg-white" : "p-0 text-foreground-placeholder hover:bg-transparent hover:text-foreground", className),
1266
+ children: children ?? /* @__PURE__ */ jsx(X, { className: "size-4" })
1267
+ })
1177
1268
  });
1178
1269
  }
1179
1270
  function BottomSheetHeader({ className, render, ...props }) {
@@ -1194,9 +1285,38 @@ function BottomSheetFooter({ className, render, ...props }) {
1194
1285
  state: { slot: "bottom-sheet-footer" }
1195
1286
  });
1196
1287
  }
1288
+ function BottomSheetBody({ className, render, ...props }) {
1289
+ const { body } = bottomSheet({ theme: useThemeFamily() });
1290
+ return useRender({
1291
+ defaultTagName: "div",
1292
+ render,
1293
+ props: mergeProps({ className: body({ className }) }, props),
1294
+ state: { slot: "bottom-sheet-body" }
1295
+ });
1296
+ }
1297
+ function BottomSheetActions({ className, render, children, ...props }) {
1298
+ const theme = useThemeFamily();
1299
+ const { actions } = bottomSheet({ theme });
1300
+ const count = Math.min(3, countActionChildren(children));
1301
+ return useRender({
1302
+ defaultTagName: "div",
1303
+ render,
1304
+ props: mergeProps({
1305
+ className: actions({ className: cn(theme === "elegant" ? "flex-row" : count <= 1 ? "flex max-w-64 flex-col" : count === 2 ? "flex max-w-64 flex-col-reverse" : "grid max-w-[32rem] grid-cols-3", className) }),
1306
+ children
1307
+ }, props),
1308
+ state: { slot: "bottom-sheet-actions" }
1309
+ });
1310
+ }
1311
+ function countActionChildren(children) {
1312
+ return Children.toArray(children).reduce((count, child) => {
1313
+ if (isValidElement(child) && child.type === Fragment) return count + countActionChildren(child.props.children);
1314
+ return count + 1;
1315
+ }, 0);
1316
+ }
1197
1317
  function BottomSheetTitle({ className, ...props }) {
1198
1318
  const { title } = bottomSheet({ theme: useThemeFamily() });
1199
- return /* @__PURE__ */ jsx(Dialog.Title, {
1319
+ return /* @__PURE__ */ jsx(Drawer.Title, {
1200
1320
  "data-slot": "bottom-sheet-title",
1201
1321
  className: title({ className }),
1202
1322
  ...props
@@ -1204,11 +1324,11 @@ function BottomSheetTitle({ className, ...props }) {
1204
1324
  }
1205
1325
  function BottomSheetDescription({ className, ...props }) {
1206
1326
  const { description } = bottomSheet({ theme: useThemeFamily() });
1207
- return /* @__PURE__ */ jsx(Dialog.Description, {
1327
+ return /* @__PURE__ */ jsx(Drawer.Description, {
1208
1328
  "data-slot": "bottom-sheet-description",
1209
1329
  className: description({ className }),
1210
1330
  ...props
1211
1331
  });
1212
1332
  }
1213
1333
  //#endregion
1214
- export { BottomSheet, BottomSheetClose, BottomSheetContent, BottomSheetDescription, BottomSheetFooter, BottomSheetHeader, BottomSheetPortal, BottomSheetTitle, BottomSheetTrigger, ConversationPreviewCard, ConversationPreviewCardAction, ConversationPreviewCardAuthor, ConversationPreviewCardAuthorName, ConversationPreviewCardAuthorSubtitle, ConversationPreviewCardChannel, ConversationPreviewCardContent, ConversationPreviewCardFooter, ConversationPreviewCardMeta, ConversationPreviewCardPreview, ConversationPreviewCardPreviewAuthor, ConversationPreviewCardPreviewLeading, ConversationPreviewCardSecondaryPreview, ConversationPreviewCardTimestamp, DescriptionAction, DescriptionDetails, DescriptionItem, DescriptionList, DescriptionTerm, Lightbox, LightboxActions, LightboxClose, LightboxContent, LightboxHeader, LightboxMedia, LightboxPortal, LightboxStage, LightboxTitle, LightboxTrigger, ListItem, ListItemActionGroup, ListItemBody, ListItemDescription, ListItemIcon, ListItemMeta, ListItemRow, ListItemTitle, MediaListItem, MediaListItemActionGroup, MediaListItemAside, MediaListItemBody, MediaListItemSubtitle, MediaListItemText, MediaListItemTitle, MediaListItemVisual, PanelHeader, PanelHeaderActions, PanelHeaderContent, PanelHeaderIcon, PanelHeaderSubtitle, PanelHeaderSuffix, PanelHeaderTitle, PanelHeaderTitleRow, PanelHeaderVisual, PreviewShell, QuotedMessageCard, QuotedMessageCardAttachments, QuotedMessageCardAuthor, QuotedMessageCardAuthorName, QuotedMessageCardAuthorSubtitle, QuotedMessageCardBody, QuotedMessageCardChannel, QuotedMessageCardContent, QuotedMessageCardContentWrap, QuotedMessageCardHeader, QuotedMessageCardMeta, QuotedMessageCardSeparator, QuotedMessageCardTag, QuotedMessageCardThread, QuotedMessageCardTimestamp, QuotedMessageCardUnavailable, SectionHeader, SectionHeaderActions, SectionHeaderContent, SectionHeaderCount, SectionHeaderIcon, SectionHeaderTitle, SectionLabel, ToggleGroup, ToggleGroupCount, ToggleGroupItem, ToggleGroupLabel };
1334
+ export { BottomSheet, BottomSheetActions, BottomSheetBody, BottomSheetClose, BottomSheetContent, BottomSheetDescription, BottomSheetFooter, BottomSheetHeader, BottomSheetOverlay, BottomSheetPortal, BottomSheetPositioner, BottomSheetTitle, BottomSheetTrigger, ConversationPreviewCard, ConversationPreviewCardAction, ConversationPreviewCardAuthor, ConversationPreviewCardAuthorName, ConversationPreviewCardAuthorSubtitle, ConversationPreviewCardChannel, ConversationPreviewCardContent, ConversationPreviewCardFooter, ConversationPreviewCardMeta, ConversationPreviewCardPreview, ConversationPreviewCardPreviewAuthor, ConversationPreviewCardPreviewLeading, ConversationPreviewCardSecondaryPreview, ConversationPreviewCardTimestamp, DescriptionAction, DescriptionDetails, DescriptionItem, DescriptionList, DescriptionTerm, Lightbox, LightboxActions, LightboxClose, LightboxContent, LightboxHeader, LightboxMedia, LightboxPortal, LightboxStage, LightboxTitle, LightboxTrigger, ListItem, ListItemActionGroup, ListItemBody, ListItemDescription, ListItemIcon, ListItemMeta, ListItemRow, ListItemTitle, MediaListItem, MediaListItemActionGroup, MediaListItemAside, MediaListItemBody, MediaListItemSubtitle, MediaListItemText, MediaListItemTitle, MediaListItemVisual, PanelHeader, PanelHeaderActions, PanelHeaderContent, PanelHeaderIcon, PanelHeaderSubtitle, PanelHeaderSuffix, PanelHeaderTitle, PanelHeaderTitleRow, PanelHeaderVisual, PreviewShell, QuotedMessageCard, QuotedMessageCardAttachments, QuotedMessageCardAuthor, QuotedMessageCardAuthorName, QuotedMessageCardAuthorSubtitle, QuotedMessageCardBody, QuotedMessageCardChannel, QuotedMessageCardContent, QuotedMessageCardContentWrap, QuotedMessageCardHeader, QuotedMessageCardMeta, QuotedMessageCardSeparator, QuotedMessageCardTag, QuotedMessageCardThread, QuotedMessageCardTimestamp, QuotedMessageCardUnavailable, SectionHeader, SectionHeaderActions, SectionHeaderContent, SectionHeaderCount, SectionHeaderIcon, SectionHeaderTitle, SectionLabel, ToggleGroup, ToggleGroupCount, ToggleGroupItem, ToggleGroupLabel };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "raft-ui",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "React UI components for Raft.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -41,7 +41,8 @@
41
41
  "cnfast": "^0.0.7",
42
42
  "foxact": "^0.3.7",
43
43
  "lucide-react": "^1.21.0",
44
- "tailwind-variants": "^3.2.2"
44
+ "tailwind-variants": "^3.2.2",
45
+ "vaul": "^1.1.2"
45
46
  },
46
47
  "devDependencies": {
47
48
  "@types/node": "^26.0.0",
@@ -1,16 +0,0 @@
1
- import { VariantProps } from "tailwind-variants/lite";
2
-
3
- //#region src/lib/styled-props.d.ts
4
- /**
5
- * Base UI components type `className` as `string | ((state) => string)`, but our
6
- * tv() recipes only accept a plain string. `StyledProps` narrows a Base UI
7
- * component's props to a string `className` so they can flow into a recipe.
8
- *
9
- * The state-callback form is intentionally dropped: our components express every
10
- * state through `data-*` variants in the recipe, so a caller never needs it.
11
- */
12
- type StyledProps<P> = Omit<P, "className"> & {
13
- className?: string;
14
- };
15
- //#endregion
16
- export { StyledProps as n, VariantProps as t };
@@ -1,34 +0,0 @@
1
- import { cn } from "cnfast";
2
- import { tv } from "tailwind-variants/lite";
3
- import { createContext, use } from "react";
4
- //#region src/lib/tv.ts
5
- const tv$1 = ((options) => {
6
- const recipe = tv(options);
7
- const wrappedRecipe = ((props) => {
8
- const result = recipe(props);
9
- if (typeof result === "string") return cn(result);
10
- return Object.fromEntries(Object.entries(result).map(([slotName, slot]) => [slotName, (slotProps) => cn(slot(slotProps))]));
11
- });
12
- return Object.assign(wrappedRecipe, recipe);
13
- });
14
- //#endregion
15
- //#region src/lib/theme/theme-context.ts
16
- const ThemeContext = createContext("brutal");
17
- const ThemeStateContext = createContext({
18
- theme: "brutal",
19
- setTheme: () => void 0,
20
- mode: "light",
21
- resolvedMode: "light"
22
- });
23
- //#endregion
24
- //#region src/lib/theme/use-theme.ts
25
- /** Read the active style family for theme-aware component recipes. */
26
- function useThemeFamily() {
27
- return use(ThemeContext);
28
- }
29
- /** Read and update the application-level RUI theme selection. */
30
- function useTheme() {
31
- return use(ThemeStateContext);
32
- }
33
- //#endregion
34
- export { tv$1 as a, ThemeStateContext as i, useThemeFamily as n, ThemeContext as r, useTheme as t };