@orangecheck/design 0.6.1 → 0.7.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.
@@ -14,6 +14,7 @@ import * as PopoverPrimitive from '@radix-ui/react-popover';
14
14
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
15
15
  import * as SelectPrimitive from '@radix-ui/react-select';
16
16
  import { ToasterProps } from 'sonner';
17
+ import * as TabsPrimitive from '@radix-ui/react-tabs';
17
18
 
18
19
  declare const buttonVariants: (props?: ({
19
20
  variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
@@ -98,6 +99,9 @@ declare function WorkingPanel({ text, progress }: Pick<WorkingProps, 'text' | 'p
98
99
  interface Props {
99
100
  children: React.ReactNode;
100
101
  fallback?: (error: Error, reset: () => void) => React.ReactNode;
102
+ title?: string;
103
+ message?: string;
104
+ onError?: (error: Error, info: React.ErrorInfo) => void;
101
105
  }
102
106
  interface State {
103
107
  error: Error | null;
@@ -266,6 +270,20 @@ interface StatusPillProps {
266
270
  className?: string;
267
271
  }
268
272
  declare function StatusPill({ label, tone, icon, className }: StatusPillProps): react_jsx_runtime.JSX.Element;
273
+ interface StatusPillSpec {
274
+ tone: StatusTone;
275
+ label?: string;
276
+ icon?: ReactNode;
277
+ }
278
+ declare function makeStatusPill<S extends string>(map: Record<S, StatusPillSpec>): (props: {
279
+ status: S;
280
+ className?: string;
281
+ }) => ReactNode;
282
+
283
+ declare function Tabs({ ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): react_jsx_runtime.JSX.Element;
284
+ declare function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>): react_jsx_runtime.JSX.Element;
285
+ declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
286
+ declare function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>): react_jsx_runtime.JSX.Element;
269
287
 
270
288
  interface SatsAmountProps {
271
289
  sats: number;
@@ -305,4 +323,4 @@ interface QrCodeProps {
305
323
  }
306
324
  declare function QrCode({ value, size, label, className }: QrCodeProps): react_jsx_runtime.JSX.Element;
307
325
 
308
- 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 StatusTone, Switch, Textarea, ThemeToggle, ThemeToggleLink, Toaster, Working, WorkingPanel, type WorkingProps, badgeVariants, buttonVariants, confirm, prompt };
326
+ 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 StatusTone, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeToggle, ThemeToggleLink, Toaster, Working, WorkingPanel, type WorkingProps, badgeVariants, buttonVariants, confirm, makeStatusPill, prompt };
@@ -14,6 +14,7 @@ import * as PopoverPrimitive from '@radix-ui/react-popover';
14
14
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
15
15
  import * as SelectPrimitive from '@radix-ui/react-select';
16
16
  import { ToasterProps } from 'sonner';
17
+ import * as TabsPrimitive from '@radix-ui/react-tabs';
17
18
 
18
19
  declare const buttonVariants: (props?: ({
19
20
  variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
@@ -98,6 +99,9 @@ declare function WorkingPanel({ text, progress }: Pick<WorkingProps, 'text' | 'p
98
99
  interface Props {
99
100
  children: React.ReactNode;
100
101
  fallback?: (error: Error, reset: () => void) => React.ReactNode;
102
+ title?: string;
103
+ message?: string;
104
+ onError?: (error: Error, info: React.ErrorInfo) => void;
101
105
  }
102
106
  interface State {
103
107
  error: Error | null;
@@ -266,6 +270,20 @@ interface StatusPillProps {
266
270
  className?: string;
267
271
  }
268
272
  declare function StatusPill({ label, tone, icon, className }: StatusPillProps): react_jsx_runtime.JSX.Element;
273
+ interface StatusPillSpec {
274
+ tone: StatusTone;
275
+ label?: string;
276
+ icon?: ReactNode;
277
+ }
278
+ declare function makeStatusPill<S extends string>(map: Record<S, StatusPillSpec>): (props: {
279
+ status: S;
280
+ className?: string;
281
+ }) => ReactNode;
282
+
283
+ declare function Tabs({ ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): react_jsx_runtime.JSX.Element;
284
+ declare function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>): react_jsx_runtime.JSX.Element;
285
+ declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
286
+ declare function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>): react_jsx_runtime.JSX.Element;
269
287
 
270
288
  interface SatsAmountProps {
271
289
  sats: number;
@@ -305,4 +323,4 @@ interface QrCodeProps {
305
323
  }
306
324
  declare function QrCode({ value, size, label, className }: QrCodeProps): react_jsx_runtime.JSX.Element;
307
325
 
308
- 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 StatusTone, Switch, Textarea, ThemeToggle, ThemeToggleLink, Toaster, Working, WorkingPanel, type WorkingProps, badgeVariants, buttonVariants, confirm, prompt };
326
+ 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 StatusTone, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeToggle, ThemeToggleLink, Toaster, Working, WorkingPanel, type WorkingProps, badgeVariants, buttonVariants, confirm, makeStatusPill, prompt };
@@ -18,6 +18,7 @@ var PopoverPrimitive = require('@radix-ui/react-popover');
18
18
  var AccordionPrimitive = require('@radix-ui/react-accordion');
19
19
  var SelectPrimitive = require('@radix-ui/react-select');
20
20
  var sonner = require('sonner');
21
+ var TabsPrimitive = require('@radix-ui/react-tabs');
21
22
  var QRCode = require('qrcode');
22
23
 
23
24
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -50,6 +51,7 @@ var SheetPrimitive__namespace = /*#__PURE__*/_interopNamespace(SheetPrimitive);
50
51
  var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitive);
51
52
  var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
52
53
  var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
54
+ var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
53
55
  var QRCode__default = /*#__PURE__*/_interopDefault(QRCode);
54
56
 
55
57
  // src/primitives/button.tsx
@@ -486,6 +488,7 @@ var ErrorBoundary = class extends React2__namespace.Component {
486
488
  }
487
489
  componentDidCatch(error, info) {
488
490
  console.error("[ErrorBoundary]", error, info);
491
+ this.props.onError?.(error, info);
489
492
  }
490
493
  render() {
491
494
  if (this.state.error) {
@@ -493,7 +496,7 @@ var ErrorBoundary = class extends React2__namespace.Component {
493
496
  return this.props.fallback(this.state.error, this.reset);
494
497
  }
495
498
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container py-16", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "terminal", children: [
496
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "terminal-title", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive flex items-center gap-1.5", children: "! fatal" }) }),
499
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "terminal-title", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive flex items-center gap-1.5", children: this.props.title ?? "! fatal" }) }),
497
500
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3 p-5 font-mono text-xs leading-relaxed", children: [
498
501
  /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
499
502
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-destructive", children: [
@@ -505,7 +508,7 @@ var ErrorBoundary = class extends React2__namespace.Component {
505
508
  ] }),
506
509
  /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-muted-foreground", children: [
507
510
  "> ",
508
- "this page crashed. reload to recover."
511
+ this.props.message ?? "this page crashed. reload to recover."
509
512
  ] }),
510
513
  /* @__PURE__ */ jsxRuntime.jsx(
511
514
  "button",
@@ -1458,6 +1461,57 @@ function StatusPill({ label, tone = "muted", icon, className }) {
1458
1461
  }
1459
1462
  );
1460
1463
  }
1464
+ function makeStatusPill(map) {
1465
+ function DomainStatusPill({ status, className }) {
1466
+ const spec = map[status];
1467
+ return /* @__PURE__ */ jsxRuntime.jsx(
1468
+ StatusPill,
1469
+ {
1470
+ tone: spec?.tone ?? "muted",
1471
+ label: spec?.label ?? status,
1472
+ icon: spec?.icon,
1473
+ className
1474
+ }
1475
+ );
1476
+ }
1477
+ return DomainStatusPill;
1478
+ }
1479
+ function Tabs({ ...props }) {
1480
+ return /* @__PURE__ */ jsxRuntime.jsx(TabsPrimitive__namespace.Root, { "data-slot": "tabs", ...props });
1481
+ }
1482
+ function TabsList({ className, ...props }) {
1483
+ return /* @__PURE__ */ jsxRuntime.jsx(
1484
+ TabsPrimitive__namespace.List,
1485
+ {
1486
+ "data-slot": "tabs-list",
1487
+ className: cn("border-border -mb-px flex items-center gap-6 border-b", className),
1488
+ ...props
1489
+ }
1490
+ );
1491
+ }
1492
+ function TabsTrigger({ className, ...props }) {
1493
+ return /* @__PURE__ */ jsxRuntime.jsx(
1494
+ TabsPrimitive__namespace.Trigger,
1495
+ {
1496
+ "data-slot": "tabs-trigger",
1497
+ className: cn(
1498
+ "text-muted-foreground hover:text-foreground data-[state=active]:text-primary data-[state=active]:border-primary -mb-px border-b-2 border-transparent py-2 font-mono text-[11px] tracking-widest uppercase transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
1499
+ className
1500
+ ),
1501
+ ...props
1502
+ }
1503
+ );
1504
+ }
1505
+ function TabsContent({ className, ...props }) {
1506
+ return /* @__PURE__ */ jsxRuntime.jsx(
1507
+ TabsPrimitive__namespace.Content,
1508
+ {
1509
+ "data-slot": "tabs-content",
1510
+ className: cn("mt-4 outline-none", className),
1511
+ ...props
1512
+ }
1513
+ );
1514
+ }
1461
1515
 
1462
1516
  // src/format/index.ts
1463
1517
  var REFERENCE_BTC_USD = 95e3;
@@ -1662,6 +1716,10 @@ exports.Sparkline = Sparkline;
1662
1716
  exports.StatBlock = StatBlock;
1663
1717
  exports.StatusPill = StatusPill;
1664
1718
  exports.Switch = Switch;
1719
+ exports.Tabs = Tabs;
1720
+ exports.TabsContent = TabsContent;
1721
+ exports.TabsList = TabsList;
1722
+ exports.TabsTrigger = TabsTrigger;
1665
1723
  exports.Textarea = Textarea;
1666
1724
  exports.ThemeToggle = ThemeToggle;
1667
1725
  exports.ThemeToggleLink = ThemeToggleLink;
@@ -1671,6 +1729,7 @@ exports.WorkingPanel = WorkingPanel;
1671
1729
  exports.badgeVariants = badgeVariants;
1672
1730
  exports.buttonVariants = buttonVariants;
1673
1731
  exports.confirm = confirm;
1732
+ exports.makeStatusPill = makeStatusPill;
1674
1733
  exports.prompt = prompt;
1675
1734
  //# sourceMappingURL=primitives.js.map
1676
1735
  //# sourceMappingURL=primitives.js.map