@orangecheck/design 0.27.0 → 0.28.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.
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { clsx } from 'clsx';
2
2
  import { twMerge } from 'tailwind-merge';
3
3
  import * as React2 from 'react';
4
- import { createContext, useRef, useEffect, useState, useCallback, useMemo, useContext, Fragment as Fragment$1, useId } from 'react';
4
+ import { createContext, useRef, useEffect, useState, useCallback, useMemo, useContext, useId, Fragment as Fragment$1 } from 'react';
5
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
6
  import { useTheme } from 'next-themes';
7
7
  import { ChevronDown, Plus, Palette, Check, Sun, Moon, Monitor, Waves, Pause, CheckIcon, CircleIcon, X, XIcon, AlertTriangle, Pencil, ChevronLeft, ChevronRight, ChevronDownIcon, ChevronUpIcon, Maximize2, Copy, HelpCircle, Boxes, CornerDownLeft, Loader2, Menu } from 'lucide-react';
@@ -951,6 +951,100 @@ function OcAppearanceMenu({
951
951
 
952
952
  // src/tokens/index.ts
953
953
  init_scene_tokens();
954
+
955
+ // src/tokens/glyphs.ts
956
+ var OC_GLYPH_CANVAS = 1024;
957
+ var OC_GLYPHS = {
958
+ orangecheck: `<path d="M518 856Q463 820 438.5 785.5Q414 751 414 711Q414 657 462.5 613.0Q511 569 711 473Q766 509 790.5 543.5Q815 578 815 621Q815 702 550 840ZM930 1460V1235Q845 1265 779.0 1279.5Q713 1294 659 1294Q583 1294 540.5 1265.0Q498 1236 498 1184Q498 1109 701 1004Q720 994 729 989Q943 879 1002.0 808.5Q1061 738 1061 637Q1061 548 1013.5 484.0Q966 420 864 373Q934 323 966.5 261.5Q999 200 999 119Q999 -28 894.5 -111.5Q790 -195 604 -195Q515 -195 429.0 -180.5Q343 -166 258 -137V92Q343 62 424.0 46.5Q505 31 578 31Q655 31 696.0 59.5Q737 88 737 141Q737 211 523 326L512 332L486 346Q170 516 170 688Q170 782 222.0 851.5Q274 921 371 954Q300 1004 268.0 1064.0Q236 1124 236 1206Q236 1348 340.0 1434.0Q444 1520 616 1520Q690 1520 768.5 1505.0Q847 1490 930 1460Z" fill="__FG__" transform="translate(225.3457 820.5434) scale(0.465726 -0.465726)"/>`,
959
+ attest: `<g transform="scale(42.666667 42.666667)"><path d="M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z" fill="__FG__" stroke="__FG__" stroke-width="0.5"/><path d="M9 12 l2 2 l4 -4" fill="none" stroke="__INK__" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></g>`,
960
+ docs: `<g transform="scale(42.666667 42.666667)"><rect x="3" y="3" width="18" height="18" fill="__FG__"/><rect x="6" y="6" width="12" height="12" fill="none" stroke="__INK__" stroke-width="1.5"/><rect x="8" y="9" width="8" height="1.25" fill="__INK__"/><rect x="8" y="11.5" width="8" height="1.25" fill="__INK__"/><rect x="8" y="14" width="5" height="1.25" fill="__INK__"/></g>`,
961
+ me: `<g transform="scale(42.666667 42.666667)"><rect x="3" y="3" width="18" height="18" fill="__FG__"/><rect x="6" y="6" width="12" height="12" fill="none" stroke="__INK__" stroke-width="1.5"/><circle cx="12" cy="11" r="2" fill="__INK__"/><path d="M8 16.5 C 8 14.5, 9.5 13.5, 12 13.5 C 14.5 13.5, 16 14.5, 16 16.5" fill="none" stroke="__INK__" stroke-width="1.5" stroke-linecap="square"/></g>`,
962
+ vault: `<g transform="scale(42.666667 42.666667)"><path d="M8 9 L8 6.5 Q8 3.5 12 3.5 Q16 3.5 16 6.5 L16 9" fill="none" stroke="__FG__" stroke-width="2" stroke-linecap="square"/><rect x="4" y="9" width="16" height="12" fill="__FG__" stroke="__FG__" stroke-width="0.75"/><circle cx="12" cy="14.5" r="2.75" fill="none" stroke="__INK__" stroke-width="1.5"/><rect x="11.4" y="14.5" width="1.2" height="3.25" fill="__INK__"/><rect x="5.5" y="19" width="2.25" height="1.5" fill="__INK__"/><rect x="16.25" y="19" width="2.25" height="1.5" fill="__INK__"/></g>`,
963
+ fleet: `<g transform="scale(42.666667 42.666667)"><rect x="3" y="3" width="18" height="18" fill="__FG__"/><rect x="6" y="6" width="12" height="12" fill="none" stroke="__INK__" stroke-width="1.5"/><path d="M8.5 9.5 L11 12 L8.5 14.5" fill="none" stroke="__INK__" stroke-width="1.6" stroke-linejoin="miter" stroke-linecap="square"/><rect x="12" y="14" width="4" height="1.4" fill="__INK__"/></g>`,
964
+ chat: `<g transform="scale(42.666667 42.666667)"><path d="M5 4 H19 A2 2 0 0 1 21 6 V13 A2 2 0 0 1 19 15 H11 L7 19 V15 H5 A2 2 0 0 1 3 13 V6 A2 2 0 0 1 5 4 Z" fill="__FG__" stroke="__FG__" stroke-width="1.6" stroke-linejoin="round"/><circle cx="8" cy="9.5" r="1.15" fill="__INK__"/><circle cx="12" cy="9.5" r="1.15" fill="__INK__"/><circle cx="16" cy="9.5" r="1.15" fill="__INK__"/></g>`,
965
+ cosign: `<g transform="scale(42.666667 42.666667)"><rect x="3" y="3" width="18" height="18" fill="__FG__"/><rect x="6" y="6" width="12" height="12" fill="none" stroke="__INK__" stroke-width="1.5"/><circle cx="9.2" cy="10.4" r="1.65" fill="__INK__"/><circle cx="14.8" cy="10.4" r="1.65" fill="__INK__"/><path d="M6.5 16.6 C 6.5 14.9, 7.6 14.1, 9.2 14.1 C 10.8 14.1, 11.9 14.9, 11.9 16.6" fill="none" stroke="__INK__" stroke-width="1.5" stroke-linecap="square"/><path d="M12.1 16.6 C 12.1 14.9, 13.2 14.1, 14.8 14.1 C 16.4 14.1, 17.5 14.9, 17.5 16.6" fill="none" stroke="__INK__" stroke-width="1.5" stroke-linecap="square"/></g>`,
966
+ lock: `<g transform="scale(42.666667 42.666667)"><path d="M7 11V7.5a5 5 0 0 1 10 0V11" fill="none" stroke="__FG__" stroke-width="2" stroke-linecap="square"/><rect x="4" y="11" width="16" height="10" fill="__FG__" stroke="__FG__" stroke-width="0.75"/><rect x="11" y="14" width="2" height="4" fill="__INK__"/><rect x="10.25" y="14" width="3.5" height="1.5" fill="__INK__"/></g>`,
967
+ vote: `<g transform="scale(42.666667 42.666667)"><rect x="2" y="14" width="4" height="8" fill="__FG__"/><rect x="10" y="8" width="4" height="14" fill="__FG__"/><rect x="18" y="2" width="4" height="20" fill="__FG__"/></g>`,
968
+ stamp: `<g transform="scale(42.666667 42.666667)"><rect x="3" y="3" width="18" height="18" fill="__FG__"/><rect x="6" y="6" width="12" height="12" fill="none" stroke="__INK__" stroke-width="1.5"/><rect x="11.25" y="8.5" width="1.5" height="7" fill="__INK__"/><rect x="9.5" y="10" width="5" height="1.5" fill="__INK__"/><path d="M9 14.5 L12 15.75 L15 14.5" fill="none" stroke="__INK__" stroke-width="1.5" stroke-linejoin="miter" stroke-linecap="square"/></g>`,
969
+ agent: `<g transform="scale(42.666667 42.666667)"><path d="M4 20 L12 4 L20 20 Z" fill="__FG__" stroke="__FG__" stroke-width="1.5" stroke-linejoin="miter"/><rect x="7.5" y="13.5" width="9" height="2" fill="__INK__"/><rect x="11" y="9" width="2" height="2" fill="__INK__"/></g>`,
970
+ pledge: `<g transform="scale(42.666667 42.666667)"><rect x="3" y="3" width="18" height="18" fill="__FG__"/><rect x="6" y="6" width="12" height="12" fill="none" stroke="__INK__" stroke-width="1.5"/><rect x="9.25" y="8.5" width="1.75" height="7" fill="__INK__"/><rect x="9.25" y="8.5" width="4.5" height="1.5" fill="__INK__"/><rect x="12.25" y="8.5" width="1.5" height="3.5" fill="__INK__"/><rect x="9.25" y="10.5" width="4.5" height="1.5" fill="__INK__"/></g>`,
971
+ analytics: `<g transform="scale(42.666667 42.666667)"><rect x="3" y="3" width="18" height="18" fill="__FG__"/><path d="M6 17 L10 12 L14 15 L18 8" fill="none" stroke="__INK__" stroke-width="1.8" stroke-linecap="square" stroke-linejoin="miter"/><rect x="16.6" y="6.6" width="2.8" height="2.8" fill="__INK__"/></g>`,
972
+ btc: `<path d="M373 1414V1676H531V1414ZM670 1414V1676H829V1414ZM373 -186V76H531V-186ZM670 -186V76H829V-186ZM129 0V1490H705Q863 1490 972.50 1441Q1082 1392 1139 1305.50Q1196 1219 1196 1103Q1196 1016 1164 951Q1132 886 1074 843Q1016 800 937 779V774Q1024 765 1095.50 721Q1167 677 1210 600.50Q1253 524 1253 416Q1253 293 1194.50 199Q1136 105 1020 52.50Q904 0 731 0ZM391 217H700Q838 217 910.50 272.50Q983 328 983 428Q983 497 950 547.50Q917 598 855.50 626Q794 654 707 654H391ZM391 858H688Q762 858 817 883.50Q872 909 902 956Q932 1003 932 1068Q932 1161 868 1217.50Q804 1274 689 1274H391Z" fill="__FG__" transform="translate(238.3907 806.9912) scale(0.395961 -0.395961)"/>`
973
+ };
974
+ var LAYERS = [0, 1, 2, 3, 4, 5];
975
+ function sub(markup, fg, ink) {
976
+ return markup.split("__FG__").join(fg).split("__INK__").join(ink).split("__BG__").join("none");
977
+ }
978
+ function OcSigil({ glyph, corner = "bottom-left", parallax = true, className }) {
979
+ const rawId = useId();
980
+ const id = useMemo(() => `oc-sigil-${rawId.replace(/[^a-zA-Z0-9_-]/g, "")}`, [rawId]);
981
+ const parRef = useRef(null);
982
+ const seed = useMemo(() => {
983
+ let h = 0;
984
+ for (const ch of glyph) h = h * 31 + ch.charCodeAt(0) | 0;
985
+ return (h % 7 - 3) * 1.5;
986
+ }, [glyph]);
987
+ const filled = useMemo(() => sub(OC_GLYPHS[glyph], "currentColor", "currentColor"), [glyph]);
988
+ const wire = useMemo(() => sub(OC_GLYPHS[glyph], "none", "currentColor"), [glyph]);
989
+ useEffect(() => {
990
+ if (!parallax) return;
991
+ const el = parRef.current;
992
+ if (!el) return;
993
+ if (!matchMedia("(pointer: fine)").matches) return;
994
+ const prm = matchMedia("(prefers-reduced-motion: reduce)");
995
+ let raf = 0;
996
+ let tx = 0;
997
+ let ty = 0;
998
+ let cx = 0;
999
+ let cy = 0;
1000
+ const allowed = () => !prm.matches && document.documentElement.getAttribute("data-oc-motion") !== "off";
1001
+ const onMove = (e) => {
1002
+ if (!allowed()) return;
1003
+ tx = (e.clientX / innerWidth - 0.5) * 10;
1004
+ ty = (e.clientY / innerHeight - 0.5) * -10;
1005
+ if (!raf) raf = requestAnimationFrame(step);
1006
+ };
1007
+ const step = () => {
1008
+ raf = 0;
1009
+ cx += (tx - cx) * 0.06;
1010
+ cy += (ty - cy) * 0.06;
1011
+ el.style.setProperty("--oc-sigil-ry", `${Math.max(-5, Math.min(5, cx)).toFixed(2)}deg`);
1012
+ el.style.setProperty("--oc-sigil-rx", `${Math.max(-5, Math.min(5, cy)).toFixed(2)}deg`);
1013
+ if (Math.abs(tx - cx) + Math.abs(ty - cy) > 0.05) raf = requestAnimationFrame(step);
1014
+ };
1015
+ const onPrm = () => {
1016
+ if (prm.matches) {
1017
+ el.style.setProperty("--oc-sigil-rx", "0deg");
1018
+ el.style.setProperty("--oc-sigil-ry", "0deg");
1019
+ }
1020
+ };
1021
+ window.addEventListener("pointermove", onMove, { passive: true });
1022
+ prm.addEventListener?.("change", onPrm);
1023
+ return () => {
1024
+ window.removeEventListener("pointermove", onMove);
1025
+ prm.removeEventListener?.("change", onPrm);
1026
+ cancelAnimationFrame(raf);
1027
+ };
1028
+ }, [parallax]);
1029
+ return /* @__PURE__ */ jsxs(
1030
+ "div",
1031
+ {
1032
+ "aria-hidden": "true",
1033
+ className: cn("oc-sigil", `oc-sigil--${corner}`, className),
1034
+ style: { "--oc-sigil-seed": `${seed}deg` },
1035
+ children: [
1036
+ /* @__PURE__ */ jsx("svg", { width: "0", height: "0", style: { position: "absolute" }, "aria-hidden": "true", children: /* @__PURE__ */ jsxs("defs", { children: [
1037
+ /* @__PURE__ */ jsx("g", { id: `${id}-filled`, dangerouslySetInnerHTML: { __html: filled } }),
1038
+ /* @__PURE__ */ jsx("g", { id: `${id}-wire`, dangerouslySetInnerHTML: { __html: wire } })
1039
+ ] }) }),
1040
+ /* @__PURE__ */ jsx("div", { className: "oc-sigil__drift oc-ambient", children: /* @__PURE__ */ jsx("div", { ref: parRef, className: "oc-sigil__par", children: LAYERS.map((n) => /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 1024 1024", className: `oc-sigil__layer oc-sigil__layer-${n}`, children: [
1041
+ /* @__PURE__ */ jsx("use", { className: "oc-sigil__use-filled", href: `#${id}-filled` }),
1042
+ /* @__PURE__ */ jsx("use", { className: "oc-sigil__use-wire", href: `#${id}-wire` })
1043
+ ] }, n)) }) })
1044
+ ]
1045
+ }
1046
+ );
1047
+ }
954
1048
  var buttonVariants = cva(
955
1049
  "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
956
1050
  {
@@ -2536,7 +2630,7 @@ function Sparkline({ data, width = 96, height = 24, area = false, className }) {
2536
2630
  }
2537
2631
  );
2538
2632
  }
2539
- function StatBlock({ label, value, sub, delta, tone = "default", className }) {
2633
+ function StatBlock({ label, value, sub: sub2, delta, tone = "default", className }) {
2540
2634
  const toneClass = tone === "success" ? "text-success" : tone === "warning" ? "text-warning" : tone === "destructive" ? "text-destructive" : "text-foreground";
2541
2635
  return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1", className), children: [
2542
2636
  /* @__PURE__ */ jsx("span", { className: "label-mono text-muted-foreground text-[10px]", children: label }),
@@ -2551,7 +2645,7 @@ function StatBlock({ label, value, sub, delta, tone = "default", className }) {
2551
2645
  }
2552
2646
  ),
2553
2647
  /* @__PURE__ */ jsxs("div", { className: "flex items-baseline gap-2", children: [
2554
- sub && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground font-mono text-[11px] tracking-wide lowercase", children: sub }),
2648
+ sub2 && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground font-mono text-[11px] tracking-wide lowercase", children: sub2 }),
2555
2649
  delta && /* @__PURE__ */ jsxs(
2556
2650
  "span",
2557
2651
  {
@@ -5487,6 +5581,6 @@ function OcFamilyFooter({
5487
5581
  ] }) });
5488
5582
  }
5489
5583
 
5490
- export { AccentList, AccentNote, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AlertWithAction, AlertWithCountdown, AppShell, AppearanceControls, Badge, Bar, BitcoinAddress, BrandBand, Button, Callout, Card, CheckList, Checkbox, ComparisonTable, ConfirmHost, CopyButton, DEFAULT_OC_THEME, DataRow, DefinitionList, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, EcosystemSwitcher, EmailCapture, EmptyState, ErrorBoundary, FAMILY_PROPERTIES, Faq, FeatureCard, HelpHint, IconBadge, Input, Label, LayoutSubHeader, MarketingHeading, Modal, NumberedStep, OC_DEFAULT_ACCENT, OC_MOTION_COOKIE, OC_SKIN_COOKIE, OC_THEMES, OcAccountMenu, OcAccountMenuView, OcAppBar, OcAppearanceMenu, OcAurora, OcDashboardHub, OcDashboardShell, OcFamilyFooter, OcLogoDropdown, OcPrimaryNav, OcThemeBridge, OcThemePicker, OcThemeProvider, Pagination, Panel, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PromptHost, QrCode, REFERENCE_BTC_USD, RadioGroup, RadioGroupItem, SITE_STATE_LABEL, SatsAmount, Section, SectionHeader, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Sparkline, StatBlock, StatCard, StatGrid, StatTile, StatusPill, StepList, Surface, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeToggle, ThemeToggleLink, Toaster, Tooltip, TwoToneHeading, VerifiedChip, Working, WorkingPanel, accentFor, asOf, badgeVariants, buttonVariants, cn, confirm, explorerUrl, findFamilyProperty, formatSats, formatSatsCompact, getOcThemeInitScript, iconBadgeVariants, isKnownTheme, makeStatusPill, normalizeHue, priceBoth, prompt, readOcSceneTokens, relativeTime, resolveTheme, satsToUsd, shortenAddress, subscribeOcTheme, surfaceVariants, usdToSats, useOcMotion, useOcSkin, useSpotPrice };
5584
+ export { AccentList, AccentNote, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AlertWithAction, AlertWithCountdown, AppShell, AppearanceControls, Badge, Bar, BitcoinAddress, BrandBand, Button, Callout, Card, CheckList, Checkbox, ComparisonTable, ConfirmHost, CopyButton, DEFAULT_OC_THEME, DataRow, DefinitionList, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, EcosystemSwitcher, EmailCapture, EmptyState, ErrorBoundary, FAMILY_PROPERTIES, Faq, FeatureCard, HelpHint, IconBadge, Input, Label, LayoutSubHeader, MarketingHeading, Modal, NumberedStep, OC_DEFAULT_ACCENT, OC_GLYPHS, OC_GLYPH_CANVAS, OC_MOTION_COOKIE, OC_SKIN_COOKIE, OC_THEMES, OcAccountMenu, OcAccountMenuView, OcAppBar, OcAppearanceMenu, OcAurora, OcDashboardHub, OcDashboardShell, OcFamilyFooter, OcLogoDropdown, OcPrimaryNav, OcSigil, OcThemeBridge, OcThemePicker, OcThemeProvider, Pagination, Panel, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PromptHost, QrCode, REFERENCE_BTC_USD, RadioGroup, RadioGroupItem, SITE_STATE_LABEL, SatsAmount, Section, SectionHeader, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Sparkline, StatBlock, StatCard, StatGrid, StatTile, StatusPill, StepList, Surface, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeToggle, ThemeToggleLink, Toaster, Tooltip, TwoToneHeading, VerifiedChip, Working, WorkingPanel, accentFor, asOf, badgeVariants, buttonVariants, cn, confirm, explorerUrl, findFamilyProperty, formatSats, formatSatsCompact, getOcThemeInitScript, iconBadgeVariants, isKnownTheme, makeStatusPill, normalizeHue, priceBoth, prompt, readOcSceneTokens, relativeTime, resolveTheme, satsToUsd, shortenAddress, subscribeOcTheme, surfaceVariants, usdToSats, useOcMotion, useOcSkin, useSpotPrice };
5491
5585
  //# sourceMappingURL=index.mjs.map
5492
5586
  //# sourceMappingURL=index.mjs.map