raft-ui 0.0.10 → 0.0.11

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.
@@ -0,0 +1,16 @@
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 };
@@ -0,0 +1,34 @@
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 };
package/dist/wip.d.mts CHANGED
@@ -1,10 +1,8 @@
1
- import { a as StyledProps, i as VariantProps, n as ButtonProps } from "./index-lPUAF7fl.mjs";
2
- import { Dialog } from "@base-ui/react/dialog";
3
- import { ComponentProps, ComponentPropsWithRef, ReactElement, ReactNode } from "react";
1
+ import { n as StyledProps, t as VariantProps } from "./tv-UUMwNowu.mjs";
2
+ import { ComponentPropsWithRef } from "react";
4
3
  import { useRender } from "@base-ui/react/use-render";
5
4
  import { Toggle } from "@base-ui/react/toggle";
6
5
  import { ToggleGroup as ToggleGroup$1 } from "@base-ui/react/toggle-group";
7
- import { Drawer } from "vaul";
8
6
 
9
7
  //#region src/components/toggle-group/toggle-group.d.ts
10
8
  declare const toggleGroup: import("tailwind-variants/lite").TVReturnType<{
@@ -816,185 +814,4 @@ declare function DescriptionAction({
816
814
  ...props
817
815
  }: DescriptionActionProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
818
816
  //#endregion
819
- //#region src/components/lightbox/lightbox.d.ts
820
- type LightboxProps<Payload = unknown> = Omit<Dialog.Root.Props<Payload>, "actionsRef" | "children" | "handle"> & {
821
- children?: ReactNode;
822
- closeOnModW?: boolean;
823
- };
824
- declare function Lightbox<Payload = unknown>({
825
- closeOnModW,
826
- defaultOpen,
827
- modal,
828
- onOpenChange,
829
- open,
830
- children,
831
- ...props
832
- }: LightboxProps<Payload>): import("react").JSX.Element;
833
- type LightboxTriggerProps = Dialog.Trigger.Props;
834
- declare function LightboxTrigger(props: LightboxTriggerProps): import("react").JSX.Element;
835
- type LightboxPortalProps = Dialog.Portal.Props;
836
- declare function LightboxPortal(props: LightboxPortalProps): import("react").JSX.Element;
837
- type LightboxContentProps = StyledProps<Dialog.Popup.Props>;
838
- declare function LightboxContent({
839
- className,
840
- initialFocus,
841
- finalFocus,
842
- ...props
843
- }: LightboxContentProps): import("react").JSX.Element;
844
- type LightboxHeaderProps = useRender.ComponentProps<"div">;
845
- declare function LightboxHeader({
846
- render,
847
- className,
848
- ...props
849
- }: LightboxHeaderProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
850
- type LightboxTitleProps = useRender.ComponentProps<"div">;
851
- declare function LightboxTitle({
852
- render,
853
- className,
854
- ...props
855
- }: LightboxTitleProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
856
- type LightboxActionsProps = useRender.ComponentProps<"div">;
857
- declare function LightboxActions({
858
- render,
859
- className,
860
- ...props
861
- }: LightboxActionsProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
862
- type LightboxStageProps = useRender.ComponentProps<"div">;
863
- declare function LightboxStage({
864
- render,
865
- className,
866
- ...props
867
- }: LightboxStageProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
868
- type LightboxMediaProps = useRender.ComponentProps<"div">;
869
- declare function LightboxMedia({
870
- render,
871
- className,
872
- ...props
873
- }: LightboxMediaProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
874
- type LightboxNavigationButtonProps = Omit<ButtonProps, "disabled" | "loading" | "size" | "variant"> & {
875
- direction: "next" | "previous";
876
- disabled?: boolean;
877
- };
878
- declare function LightboxNavigationButton({
879
- className,
880
- direction,
881
- disabled,
882
- onClick,
883
- type,
884
- ...props
885
- }: LightboxNavigationButtonProps): import("react").JSX.Element;
886
- type LightboxInfoBarProps = useRender.ComponentProps<"div">;
887
- declare function LightboxInfoBar({
888
- render,
889
- className,
890
- ...props
891
- }: LightboxInfoBarProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
892
- type LightboxInfoTitleProps = useRender.ComponentProps<"div">;
893
- declare function LightboxInfoTitle({
894
- render,
895
- className,
896
- ...props
897
- }: LightboxInfoTitleProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
898
- type LightboxInfoActionsProps = useRender.ComponentProps<"div">;
899
- declare function LightboxInfoActions({
900
- render,
901
- className,
902
- ...props
903
- }: LightboxInfoActionsProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
904
- type LightboxCloseProps = StyledProps<Dialog.Close.Props>;
905
- declare function LightboxClose({
906
- className,
907
- ...props
908
- }: LightboxCloseProps): import("react").JSX.Element;
909
- //#endregion
910
- //#region src/components/bottom-sheet/bottom-sheet.d.ts
911
- type BottomSheetProps = ComponentProps<typeof Drawer.Root>;
912
- declare function BottomSheet({
913
- direction,
914
- ...props
915
- }: BottomSheetProps): import("react").JSX.Element;
916
- type BottomSheetTriggerProps = Omit<ComponentProps<typeof Drawer.Trigger>, "asChild"> & {
917
- render?: ReactElement<{
918
- children?: ReactNode;
919
- }>;
920
- };
921
- declare function BottomSheetTrigger({
922
- children,
923
- render,
924
- ...props
925
- }: BottomSheetTriggerProps): import("react").JSX.Element;
926
- type BottomSheetPortalProps = ComponentProps<typeof Drawer.Portal> & {
927
- className?: string;
928
- };
929
- declare function BottomSheetPortal({
930
- className,
931
- children,
932
- ...props
933
- }: BottomSheetPortalProps): import("react").JSX.Element;
934
- type BottomSheetPositionerProps = ComponentPropsWithRef<"div">;
935
- declare function BottomSheetPositioner({
936
- className,
937
- ...props
938
- }: BottomSheetPositionerProps): import("react").JSX.Element;
939
- type BottomSheetOverlayProps = StyledProps<ComponentProps<typeof Drawer.Overlay>>;
940
- declare function BottomSheetOverlay({
941
- className,
942
- ...props
943
- }: BottomSheetOverlayProps): import("react").JSX.Element;
944
- type BottomSheetContentProps = StyledProps<ComponentProps<typeof Drawer.Content>>;
945
- declare function BottomSheetContent({
946
- className,
947
- ...props
948
- }: BottomSheetContentProps): import("react").JSX.Element;
949
- type BottomSheetCloseProps = Omit<ComponentProps<typeof Drawer.Close>, "asChild"> & Pick<ButtonProps, "variant" | "size"> & {
950
- className?: string;
951
- children?: ReactNode;
952
- render?: ReactElement<{
953
- children?: ReactNode;
954
- }>;
955
- };
956
- declare function BottomSheetClose({
957
- className,
958
- variant,
959
- size,
960
- children,
961
- render,
962
- ...props
963
- }: BottomSheetCloseProps): import("react").JSX.Element;
964
- type BottomSheetHeaderProps = useRender.ComponentProps<"div">;
965
- declare function BottomSheetHeader({
966
- className,
967
- render,
968
- ...props
969
- }: BottomSheetHeaderProps): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
970
- type BottomSheetFooterProps = useRender.ComponentProps<"div">;
971
- declare function BottomSheetFooter({
972
- className,
973
- render,
974
- ...props
975
- }: BottomSheetFooterProps): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
976
- type BottomSheetBodyProps = useRender.ComponentProps<"div">;
977
- declare function BottomSheetBody({
978
- className,
979
- render,
980
- ...props
981
- }: BottomSheetBodyProps): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
982
- type BottomSheetActionsProps = useRender.ComponentProps<"div">;
983
- declare function BottomSheetActions({
984
- className,
985
- render,
986
- children,
987
- ...props
988
- }: BottomSheetActionsProps): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
989
- type BottomSheetTitleProps = StyledProps<ComponentProps<typeof Drawer.Title>>;
990
- declare function BottomSheetTitle({
991
- className,
992
- ...props
993
- }: BottomSheetTitleProps): import("react").JSX.Element;
994
- type BottomSheetDescriptionProps = StyledProps<ComponentProps<typeof Drawer.Description>>;
995
- declare function BottomSheetDescription({
996
- className,
997
- ...props
998
- }: BottomSheetDescriptionProps): import("react").JSX.Element;
999
- //#endregion
1000
- 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, LightboxInfoActions, type LightboxInfoActionsProps, LightboxInfoBar, type LightboxInfoBarProps, LightboxInfoTitle, type LightboxInfoTitleProps, LightboxMedia, type LightboxMediaProps, LightboxNavigationButton, type LightboxNavigationButtonProps, 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 };
817
+ export { 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, 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 };