@orangecheck/design 0.6.1 → 0.7.1

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,6 +17,7 @@ import * as PopoverPrimitive from '@radix-ui/react-popover';
17
17
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
18
18
  import * as SelectPrimitive from '@radix-ui/react-select';
19
19
  import { Toaster as Toaster$1 } from 'sonner';
20
+ import * as TabsPrimitive from '@radix-ui/react-tabs';
20
21
  import QRCode from 'qrcode';
21
22
 
22
23
  // src/primitives/button.tsx
@@ -453,6 +454,7 @@ var ErrorBoundary = class extends React2.Component {
453
454
  }
454
455
  componentDidCatch(error, info) {
455
456
  console.error("[ErrorBoundary]", error, info);
457
+ this.props.onError?.(error, info);
456
458
  }
457
459
  render() {
458
460
  if (this.state.error) {
@@ -460,7 +462,7 @@ var ErrorBoundary = class extends React2.Component {
460
462
  return this.props.fallback(this.state.error, this.reset);
461
463
  }
462
464
  return /* @__PURE__ */ jsx("div", { className: "container py-16", children: /* @__PURE__ */ jsxs("div", { className: "terminal", children: [
463
- /* @__PURE__ */ jsx("div", { className: "terminal-title", children: /* @__PURE__ */ jsx("span", { className: "text-destructive flex items-center gap-1.5", children: "! fatal" }) }),
465
+ /* @__PURE__ */ jsx("div", { className: "terminal-title", children: /* @__PURE__ */ jsx("span", { className: "text-destructive flex items-center gap-1.5", children: this.props.title ?? "! fatal" }) }),
464
466
  /* @__PURE__ */ jsxs("div", { className: "space-y-3 p-5 font-mono text-xs leading-relaxed", children: [
465
467
  /* @__PURE__ */ jsxs("p", { children: [
466
468
  /* @__PURE__ */ jsxs("span", { className: "text-destructive", children: [
@@ -472,7 +474,7 @@ var ErrorBoundary = class extends React2.Component {
472
474
  ] }),
473
475
  /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground", children: [
474
476
  "> ",
475
- "this page crashed. reload to recover."
477
+ this.props.message ?? "this page crashed. reload to recover."
476
478
  ] }),
477
479
  /* @__PURE__ */ jsx(
478
480
  "button",
@@ -1409,7 +1411,37 @@ var TONE = {
1409
1411
  primary: "text-primary",
1410
1412
  info: "text-info"
1411
1413
  };
1412
- function StatusPill({ label, tone = "muted", icon, className }) {
1414
+ var BORDER_TONE = {
1415
+ success: "border-success/40 text-success",
1416
+ warning: "border-warning/40 text-warning",
1417
+ destructive: "border-destructive/40 text-destructive",
1418
+ muted: "border-muted-foreground/40 text-muted-foreground",
1419
+ primary: "border-primary/40 text-primary",
1420
+ info: "border-info/40 text-info"
1421
+ };
1422
+ function StatusPill({
1423
+ label,
1424
+ tone = "muted",
1425
+ variant = "plain",
1426
+ icon,
1427
+ className
1428
+ }) {
1429
+ if (variant === "bordered") {
1430
+ return /* @__PURE__ */ jsxs(
1431
+ "span",
1432
+ {
1433
+ className: cn(
1434
+ "inline-flex items-center gap-1.5 border px-1.5 py-0.5 font-mono text-[9px] tracking-widest uppercase",
1435
+ BORDER_TONE[tone],
1436
+ className
1437
+ ),
1438
+ children: [
1439
+ icon,
1440
+ label
1441
+ ]
1442
+ }
1443
+ );
1444
+ }
1413
1445
  return /* @__PURE__ */ jsxs(
1414
1446
  "span",
1415
1447
  {
@@ -1425,6 +1457,60 @@ function StatusPill({ label, tone = "muted", icon, className }) {
1425
1457
  }
1426
1458
  );
1427
1459
  }
1460
+ function makeStatusPill(map, options) {
1461
+ const variant = options?.variant ?? "plain";
1462
+ const fallbackTone = options?.fallbackTone ?? "muted";
1463
+ function DomainStatusPill({ status, className }) {
1464
+ const spec = map[status];
1465
+ return /* @__PURE__ */ jsx(
1466
+ StatusPill,
1467
+ {
1468
+ tone: spec?.tone ?? fallbackTone,
1469
+ label: spec?.label ?? status,
1470
+ icon: spec?.icon,
1471
+ variant,
1472
+ className
1473
+ }
1474
+ );
1475
+ }
1476
+ return DomainStatusPill;
1477
+ }
1478
+ function Tabs({ ...props }) {
1479
+ return /* @__PURE__ */ jsx(TabsPrimitive.Root, { "data-slot": "tabs", ...props });
1480
+ }
1481
+ function TabsList({ className, ...props }) {
1482
+ return /* @__PURE__ */ jsx(
1483
+ TabsPrimitive.List,
1484
+ {
1485
+ "data-slot": "tabs-list",
1486
+ className: cn("border-border -mb-px flex items-center gap-6 border-b", className),
1487
+ ...props
1488
+ }
1489
+ );
1490
+ }
1491
+ function TabsTrigger({ className, ...props }) {
1492
+ return /* @__PURE__ */ jsx(
1493
+ TabsPrimitive.Trigger,
1494
+ {
1495
+ "data-slot": "tabs-trigger",
1496
+ className: cn(
1497
+ "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",
1498
+ className
1499
+ ),
1500
+ ...props
1501
+ }
1502
+ );
1503
+ }
1504
+ function TabsContent({ className, ...props }) {
1505
+ return /* @__PURE__ */ jsx(
1506
+ TabsPrimitive.Content,
1507
+ {
1508
+ "data-slot": "tabs-content",
1509
+ className: cn("mt-4 outline-none", className),
1510
+ ...props
1511
+ }
1512
+ );
1513
+ }
1428
1514
 
1429
1515
  // src/format/index.ts
1430
1516
  var REFERENCE_BTC_USD = 95e3;
@@ -1562,6 +1648,6 @@ function QrCode({ value, size = 200, label, className }) {
1562
1648
  );
1563
1649
  }
1564
1650
 
1565
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AlertWithAction, AlertWithCountdown, Badge, Bar, BitcoinAddress, Button, Card, Checkbox, ConfirmHost, CopyButton, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, ErrorBoundary, Input, Label, Modal, Pagination, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PromptHost, QrCode, RadioGroup, RadioGroupItem, SatsAmount, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Sparkline, StatBlock, StatusPill, Switch, Textarea, ThemeToggle, ThemeToggleLink, Toaster, Working, WorkingPanel, badgeVariants, buttonVariants, confirm, prompt };
1651
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AlertWithAction, AlertWithCountdown, Badge, Bar, BitcoinAddress, Button, Card, Checkbox, ConfirmHost, CopyButton, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, ErrorBoundary, Input, Label, Modal, Pagination, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PromptHost, QrCode, RadioGroup, RadioGroupItem, SatsAmount, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Sparkline, StatBlock, StatusPill, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeToggle, ThemeToggleLink, Toaster, Working, WorkingPanel, badgeVariants, buttonVariants, confirm, makeStatusPill, prompt };
1566
1652
  //# sourceMappingURL=primitives.mjs.map
1567
1653
  //# sourceMappingURL=primitives.mjs.map