@orangecheck/design 0.7.6 → 0.9.0

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.
@@ -17,8 +17,8 @@ import { ToasterProps } from 'sonner';
17
17
  import * as TabsPrimitive from '@radix-ui/react-tabs';
18
18
 
19
19
  declare const buttonVariants: (props?: ({
20
- variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
21
- size?: "default" | "sm" | "lg" | "icon" | null | undefined;
20
+ variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
21
+ size?: "default" | "icon" | "sm" | "lg" | null | undefined;
22
22
  } & class_variance_authority_types.ClassProp) | undefined) => string;
23
23
  declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
24
24
  asChild?: boolean;
@@ -111,7 +111,7 @@ declare class ErrorBoundary extends React.Component<Props, State> {
111
111
  static getDerivedStateFromError(error: Error): State;
112
112
  componentDidCatch(error: Error, info: React.ErrorInfo): void;
113
113
  reset: () => void;
114
- render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
114
+ render(): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
115
115
  }
116
116
 
117
117
  interface SkeletonProps {
@@ -198,6 +198,22 @@ declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof Popove
198
198
  declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): react_jsx_runtime.JSX.Element;
199
199
  declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): react_jsx_runtime.JSX.Element;
200
200
 
201
+ interface TooltipProps {
202
+ content: React.ReactNode;
203
+ children: React.ReactElement;
204
+ side?: 'top' | 'right' | 'bottom' | 'left';
205
+ align?: 'start' | 'center' | 'end';
206
+ sideOffset?: number;
207
+ collisionPadding?: number;
208
+ openDelay?: number;
209
+ closeDelay?: number;
210
+ disabled?: boolean;
211
+ portal?: boolean;
212
+ zIndexClassName?: string;
213
+ contentClassName?: string;
214
+ }
215
+ declare function Tooltip({ content, children, side, align, sideOffset, collisionPadding, openDelay, closeDelay, disabled, portal, zIndexClassName, contentClassName, }: TooltipProps): react_jsx_runtime.JSX.Element;
216
+
201
217
  declare const Accordion: React.ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & React.RefAttributes<HTMLDivElement>>;
202
218
  declare const AccordionItem: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
203
219
  declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
@@ -330,4 +346,4 @@ interface QrCodeProps {
330
346
  }
331
347
  declare function QrCode({ value, size, label, className }: QrCodeProps): react_jsx_runtime.JSX.Element;
332
348
 
333
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AlertWithAction, type AlertWithActionProps, AlertWithCountdown, type AlertWithCountdownProps, Badge, Bar, type BarProps, BitcoinAddress, type BitcoinAddressProps, Button, Card, type CardProps, Checkbox, ConfirmHost, type ConfirmOptions, CopyButton, type CopyButtonProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, ErrorBoundary, Input, Label, Modal, type ModalProps, Pagination, type PaginationProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PromptHost, type PromptOptions, QrCode, type QrCodeProps, RadioGroup, RadioGroupItem, SatsAmount, type SatsAmountProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, type SkeletonProps, Sparkline, type SparklineProps, StatBlock, type StatBlockProps, StatusPill, type StatusPillProps, type StatusPillSpec, type StatusPillVariant, type StatusTone, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeToggle, ThemeToggleLink, Toaster, Working, WorkingPanel, type WorkingProps, badgeVariants, buttonVariants, confirm, makeStatusPill, prompt };
349
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AlertWithAction, type AlertWithActionProps, AlertWithCountdown, type AlertWithCountdownProps, Badge, Bar, type BarProps, BitcoinAddress, type BitcoinAddressProps, Button, Card, type CardProps, Checkbox, ConfirmHost, type ConfirmOptions, CopyButton, type CopyButtonProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, ErrorBoundary, Input, Label, Modal, type ModalProps, Pagination, type PaginationProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PromptHost, type PromptOptions, QrCode, type QrCodeProps, RadioGroup, RadioGroupItem, SatsAmount, type SatsAmountProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, type SkeletonProps, Sparkline, type SparklineProps, StatBlock, type StatBlockProps, StatusPill, type StatusPillProps, type StatusPillSpec, type StatusPillVariant, type StatusTone, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeToggle, ThemeToggleLink, Toaster, Tooltip, type TooltipProps, Working, WorkingPanel, type WorkingProps, badgeVariants, buttonVariants, confirm, makeStatusPill, prompt };
@@ -17,8 +17,8 @@ import { ToasterProps } from 'sonner';
17
17
  import * as TabsPrimitive from '@radix-ui/react-tabs';
18
18
 
19
19
  declare const buttonVariants: (props?: ({
20
- variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
21
- size?: "default" | "sm" | "lg" | "icon" | null | undefined;
20
+ variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
21
+ size?: "default" | "icon" | "sm" | "lg" | null | undefined;
22
22
  } & class_variance_authority_types.ClassProp) | undefined) => string;
23
23
  declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
24
24
  asChild?: boolean;
@@ -111,7 +111,7 @@ declare class ErrorBoundary extends React.Component<Props, State> {
111
111
  static getDerivedStateFromError(error: Error): State;
112
112
  componentDidCatch(error: Error, info: React.ErrorInfo): void;
113
113
  reset: () => void;
114
- render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
114
+ render(): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
115
115
  }
116
116
 
117
117
  interface SkeletonProps {
@@ -198,6 +198,22 @@ declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof Popove
198
198
  declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): react_jsx_runtime.JSX.Element;
199
199
  declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): react_jsx_runtime.JSX.Element;
200
200
 
201
+ interface TooltipProps {
202
+ content: React.ReactNode;
203
+ children: React.ReactElement;
204
+ side?: 'top' | 'right' | 'bottom' | 'left';
205
+ align?: 'start' | 'center' | 'end';
206
+ sideOffset?: number;
207
+ collisionPadding?: number;
208
+ openDelay?: number;
209
+ closeDelay?: number;
210
+ disabled?: boolean;
211
+ portal?: boolean;
212
+ zIndexClassName?: string;
213
+ contentClassName?: string;
214
+ }
215
+ declare function Tooltip({ content, children, side, align, sideOffset, collisionPadding, openDelay, closeDelay, disabled, portal, zIndexClassName, contentClassName, }: TooltipProps): react_jsx_runtime.JSX.Element;
216
+
201
217
  declare const Accordion: React.ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & React.RefAttributes<HTMLDivElement>>;
202
218
  declare const AccordionItem: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
203
219
  declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
@@ -330,4 +346,4 @@ interface QrCodeProps {
330
346
  }
331
347
  declare function QrCode({ value, size, label, className }: QrCodeProps): react_jsx_runtime.JSX.Element;
332
348
 
333
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AlertWithAction, type AlertWithActionProps, AlertWithCountdown, type AlertWithCountdownProps, Badge, Bar, type BarProps, BitcoinAddress, type BitcoinAddressProps, Button, Card, type CardProps, Checkbox, ConfirmHost, type ConfirmOptions, CopyButton, type CopyButtonProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, ErrorBoundary, Input, Label, Modal, type ModalProps, Pagination, type PaginationProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PromptHost, type PromptOptions, QrCode, type QrCodeProps, RadioGroup, RadioGroupItem, SatsAmount, type SatsAmountProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, type SkeletonProps, Sparkline, type SparklineProps, StatBlock, type StatBlockProps, StatusPill, type StatusPillProps, type StatusPillSpec, type StatusPillVariant, type StatusTone, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeToggle, ThemeToggleLink, Toaster, Working, WorkingPanel, type WorkingProps, badgeVariants, buttonVariants, confirm, makeStatusPill, prompt };
349
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AlertWithAction, type AlertWithActionProps, AlertWithCountdown, type AlertWithCountdownProps, Badge, Bar, type BarProps, BitcoinAddress, type BitcoinAddressProps, Button, Card, type CardProps, Checkbox, ConfirmHost, type ConfirmOptions, CopyButton, type CopyButtonProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, ErrorBoundary, Input, Label, Modal, type ModalProps, Pagination, type PaginationProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PromptHost, type PromptOptions, QrCode, type QrCodeProps, RadioGroup, RadioGroupItem, SatsAmount, type SatsAmountProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, type SkeletonProps, Sparkline, type SparklineProps, StatBlock, type StatBlockProps, StatusPill, type StatusPillProps, type StatusPillSpec, type StatusPillVariant, type StatusTone, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeToggle, ThemeToggleLink, Toaster, Tooltip, type TooltipProps, Working, WorkingPanel, type WorkingProps, badgeVariants, buttonVariants, confirm, makeStatusPill, prompt };
@@ -1084,6 +1084,141 @@ function PopoverContent({
1084
1084
  function PopoverAnchor({ ...props }) {
1085
1085
  return /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Anchor, { "data-slot": "popover-anchor", ...props });
1086
1086
  }
1087
+ var TOOLTIP_SURFACE_CLASS = "bg-popover text-popover-foreground border-border rounded-md border p-2.5 shadow-md";
1088
+ var TOOLTIP_MOTION_CLASS = "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-1 data-[side=top]:slide-in-from-bottom-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 origin-(--radix-popover-content-transform-origin) duration-150 ease-out";
1089
+ function compose(theirs, ours) {
1090
+ return (e) => {
1091
+ theirs?.(e);
1092
+ ours(e);
1093
+ };
1094
+ }
1095
+ var lastInputWasKeyboard = false;
1096
+ var modalityInstalled = false;
1097
+ function installModalityTracking() {
1098
+ if (modalityInstalled || typeof window === "undefined") return;
1099
+ modalityInstalled = true;
1100
+ window.addEventListener("keydown", () => lastInputWasKeyboard = true, true);
1101
+ window.addEventListener("pointerdown", () => lastInputWasKeyboard = false, true);
1102
+ }
1103
+ function Tooltip({
1104
+ content,
1105
+ children,
1106
+ side = "bottom",
1107
+ align = "start",
1108
+ sideOffset = 8,
1109
+ collisionPadding = 12,
1110
+ openDelay = 300,
1111
+ closeDelay = 90,
1112
+ disabled = false,
1113
+ portal = true,
1114
+ zIndexClassName = "z-50",
1115
+ contentClassName
1116
+ }) {
1117
+ const [hovering, setHovering] = React2__namespace.useState(false);
1118
+ const [focusing, setFocusing] = React2__namespace.useState(false);
1119
+ const [isFinePointer, setIsFinePointer] = React2__namespace.useState(false);
1120
+ const openTimer = React2__namespace.useRef(null);
1121
+ const closeTimer = React2__namespace.useRef(null);
1122
+ React2__namespace.useEffect(() => {
1123
+ installModalityTracking();
1124
+ const mq = window.matchMedia("(hover: hover) and (pointer: fine)");
1125
+ const apply = () => setIsFinePointer(mq.matches);
1126
+ apply();
1127
+ mq.addEventListener("change", apply);
1128
+ return () => mq.removeEventListener("change", apply);
1129
+ }, []);
1130
+ const clearTimers = React2__namespace.useCallback(() => {
1131
+ if (openTimer.current) clearTimeout(openTimer.current);
1132
+ if (closeTimer.current) clearTimeout(closeTimer.current);
1133
+ }, []);
1134
+ React2__namespace.useEffect(() => clearTimers, [clearTimers]);
1135
+ React2__namespace.useEffect(() => {
1136
+ if (disabled) {
1137
+ clearTimers();
1138
+ setHovering(false);
1139
+ }
1140
+ }, [disabled, clearTimers]);
1141
+ const handlePointerEnter = () => {
1142
+ if (!isFinePointer) return;
1143
+ if (closeTimer.current) clearTimeout(closeTimer.current);
1144
+ openTimer.current = setTimeout(() => setHovering(true), openDelay);
1145
+ };
1146
+ const handlePointerLeave = () => {
1147
+ if (openTimer.current) clearTimeout(openTimer.current);
1148
+ closeTimer.current = setTimeout(() => setHovering(false), closeDelay);
1149
+ };
1150
+ const handlePointerDown = () => {
1151
+ clearTimers();
1152
+ setHovering(false);
1153
+ setFocusing(false);
1154
+ };
1155
+ const handleFocus = () => {
1156
+ if (lastInputWasKeyboard) {
1157
+ clearTimers();
1158
+ setFocusing(true);
1159
+ }
1160
+ };
1161
+ const handleBlur = () => {
1162
+ clearTimers();
1163
+ setFocusing(false);
1164
+ };
1165
+ const handleKeyDown = (e) => {
1166
+ if (e.key === "Escape") {
1167
+ clearTimers();
1168
+ setHovering(false);
1169
+ setFocusing(false);
1170
+ }
1171
+ };
1172
+ const effectiveOpen = !disabled && (isFinePointer && hovering || focusing);
1173
+ const extra = {};
1174
+ const childProps = children.props;
1175
+ extra.onPointerEnter = compose(childProps.onPointerEnter, handlePointerEnter);
1176
+ extra.onPointerLeave = compose(childProps.onPointerLeave, handlePointerLeave);
1177
+ extra.onPointerDown = compose(childProps.onPointerDown, handlePointerDown);
1178
+ extra.onFocus = compose(childProps.onFocus, handleFocus);
1179
+ extra.onBlur = compose(childProps.onBlur, handleBlur);
1180
+ extra.onKeyDown = compose(childProps.onKeyDown, handleKeyDown);
1181
+ const trigger = React2__namespace.cloneElement(children, extra);
1182
+ const contentEl = /* @__PURE__ */ jsxRuntime.jsx(
1183
+ PopoverPrimitive__namespace.Content,
1184
+ {
1185
+ side,
1186
+ align,
1187
+ sideOffset,
1188
+ collisionPadding,
1189
+ "aria-hidden": true,
1190
+ onOpenAutoFocus: (e) => e.preventDefault(),
1191
+ onCloseAutoFocus: (e) => e.preventDefault(),
1192
+ onFocusOutside: (e) => e.preventDefault(),
1193
+ className: cn(
1194
+ TOOLTIP_SURFACE_CLASS,
1195
+ TOOLTIP_MOTION_CLASS,
1196
+ "pointer-events-none",
1197
+ zIndexClassName,
1198
+ contentClassName
1199
+ ),
1200
+ children: content
1201
+ }
1202
+ );
1203
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1204
+ PopoverPrimitive__namespace.Root,
1205
+ {
1206
+ open: effectiveOpen,
1207
+ onOpenChange: (o) => {
1208
+ if (!o) {
1209
+ clearTimers();
1210
+ setHovering(false);
1211
+ setFocusing(false);
1212
+ }
1213
+ },
1214
+ modal: false,
1215
+ children: [
1216
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Anchor, { asChild: true, children: trigger }),
1217
+ portal ? /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: contentEl }) : contentEl
1218
+ ]
1219
+ }
1220
+ );
1221
+ }
1087
1222
  var Accordion = AccordionPrimitive__namespace.Root;
1088
1223
  var AccordionItem = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Item, { ref, className: cn("border-b", className), ...props }));
1089
1224
  AccordionItem.displayName = "AccordionItem";
@@ -1778,6 +1913,7 @@ exports.Textarea = Textarea;
1778
1913
  exports.ThemeToggle = ThemeToggle;
1779
1914
  exports.ThemeToggleLink = ThemeToggleLink;
1780
1915
  exports.Toaster = Toaster;
1916
+ exports.Tooltip = Tooltip;
1781
1917
  exports.Working = Working;
1782
1918
  exports.WorkingPanel = WorkingPanel;
1783
1919
  exports.badgeVariants = badgeVariants;