UNPKG

@liveblocks/react-ui

Version:

A set of React pre-built components for the Liveblocks products. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.

157 lines (102 loc) 7.54 kB
import * as react from 'react'; import { ComponentProps, ReactNode, ElementType, ComponentPropsWithoutRef, Ref, RefCallback } from 'react'; import * as TooltipPrimitive from '@radix-ui/react-tooltip'; export { TooltipProvider } from '@radix-ui/react-tooltip'; import * as react_jsx_runtime from 'react/jsx-runtime'; interface ButtonProps extends ComponentProps<"button"> { variant?: "default" | "toolbar" | "outline" | "primary" | "secondary"; size?: "default" | "large"; disableable?: boolean; icon?: ReactNode; } declare const Button: react.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>; declare const SelectButton: react.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>; type SlotProp = { /** * Replace the rendered element by the one passed as a child. */ asChild?: boolean; }; type ComponentPropsWithSlot<TElement extends ElementType<any>> = ComponentPropsWithoutRef<TElement> & SlotProp; interface ListProps extends ComponentPropsWithSlot<"span"> { values: ReactNode[]; formatRemaining?: (amount: number) => string; truncate?: number; locale?: string; } declare const List: react.ForwardRefExoticComponent<ListProps & react.RefAttributes<HTMLSpanElement>>; interface TooltipProps extends Pick<TooltipPrimitive.TooltipTriggerProps, "children">, Omit<TooltipPrimitive.TooltipContentProps, "content"> { content: ReactNode; multiline?: boolean; } interface ShortcutTooltipProps extends TooltipProps { shortcut?: string; } declare const Tooltip: react.ForwardRefExoticComponent<TooltipProps & react.RefAttributes<HTMLButtonElement>>; declare const ShortcutTooltip: react.ForwardRefExoticComponent<ShortcutTooltipProps & react.RefAttributes<HTMLButtonElement>>; interface UserProps extends ComponentProps<"span"> { /** * The user ID to display the user name for. */ userId: string; /** * Whether to replace the user name with "you" ($.USER_SELF) for the current user. */ replaceSelf?: boolean; } declare function User({ userId, replaceSelf, className, ...props }: UserProps): react_jsx_runtime.JSX.Element; declare function ArrowCornerDownRightIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function ArrowCornerUpRightIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function ArrowDownIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function ArrowUpIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function AttachmentIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function BlockquoteIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function BoldIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function CheckIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function ChevronDownIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function ChevronLeftIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function ChevronRightIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function ChevronUpIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function CodeIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function CommentIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function CrossIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function DeleteIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function EditIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function EllipsisIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function EmojiIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function EmojiPlusIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function H1Icon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function H2Icon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function H3Icon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function ItalicIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function LengthenIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function ListOrderedIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function ListUnorderedIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function MentionIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function QuestionMarkIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function RedoIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function ResolveIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function ResolvedIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function RestoreIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function SearchIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function SendIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function ShortenIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function SparklesIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function SparklesTextIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function SpinnerIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function StrikethroughIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function TextIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function TranslateIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function UnderlineIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function UndoIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function WarningIcon(props: ComponentProps<"svg">): react_jsx_runtime.JSX.Element; declare function capitalize(string: string): string; /** * "Freezes" a given value, so that it will return the same value/instance on * each subsequent render. This can be used to freeze "initial" values for * custom hooks, much like how `useState(initialState)` or * `useRef(initialValue)` works. */ declare function useInitial<T>(value: T | (() => T)): T; declare function useRefs<T>(...refs: Ref<T>[]): RefCallback<T>; export { ArrowCornerDownRightIcon, ArrowCornerUpRightIcon, ArrowDownIcon, ArrowUpIcon, AttachmentIcon, BlockquoteIcon, BoldIcon, Button, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CodeIcon, CommentIcon, CrossIcon, DeleteIcon, EditIcon, EllipsisIcon, EmojiIcon, EmojiPlusIcon, H1Icon, H2Icon, H3Icon, ItalicIcon, LengthenIcon, List, ListOrderedIcon, ListUnorderedIcon, MentionIcon, QuestionMarkIcon, RedoIcon, ResolveIcon, ResolvedIcon, RestoreIcon, SearchIcon, SelectButton, SendIcon, ShortcutTooltip, ShortenIcon, SparklesIcon, SparklesTextIcon, SpinnerIcon, StrikethroughIcon, TextIcon, Tooltip, TranslateIcon, UnderlineIcon, UndoIcon, User, WarningIcon, capitalize, useInitial, useRefs };