@orangecheck/auth-client 2.41.0 → 2.42.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/README.md +12 -5
- package/dist/bond.mjs +3 -2
- package/dist/{chunk-47DAA4BV.mjs → chunk-CVK452X3.mjs} +8 -13
- package/dist/chunk-CVK452X3.mjs.map +1 -0
- package/dist/{chunk-Y2PA7VC5.mjs → chunk-M2VUFCZU.mjs} +1 -1
- package/dist/{chunk-Y2PA7VC5.mjs.map → chunk-M2VUFCZU.mjs.map} +1 -1
- package/dist/{chunk-UBDRTV5O.mjs → chunk-MK45WO7U.mjs} +11 -8
- package/dist/chunk-MK45WO7U.mjs.map +1 -0
- package/dist/chunk-OKHAVNEU.mjs +48 -0
- package/dist/chunk-OKHAVNEU.mjs.map +1 -0
- package/dist/{chunk-PYQTVOVH.mjs → chunk-VQY7IYHV.mjs} +2 -2
- package/dist/chunk-VQY7IYHV.mjs.map +1 -0
- package/dist/components.mjs +1 -1
- package/dist/controls.mjs +9 -0
- package/dist/controls.mjs.map +1 -0
- package/dist/index.js +46 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -5
- package/dist/signin.mjs +3 -2
- package/dist/webauthn.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-47DAA4BV.mjs.map +0 -1
- package/dist/chunk-PYQTVOVH.mjs.map +0 -1
- package/dist/chunk-UBDRTV5O.mjs.map +0 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// src/controls.tsx
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
var WRAP = { position: "relative", display: "inline-flex", flexShrink: 0, width: 20, height: 20 };
|
|
4
|
+
var FORCED = [
|
|
5
|
+
"@media (forced-colors: active){",
|
|
6
|
+
"[data-oc-control] input{border-color:CanvasText!important;background:Canvas!important}",
|
|
7
|
+
"[data-oc-control] input[type=checkbox]:checked{border-color:Highlight!important;background:Highlight!important}",
|
|
8
|
+
"[data-oc-control] input[type=radio]:checked{border-color:Highlight!important}",
|
|
9
|
+
"[data-oc-control] svg[data-oc-check]{color:HighlightText!important}",
|
|
10
|
+
"[data-oc-control] svg[data-oc-dot]{color:Highlight!important}",
|
|
11
|
+
"[data-oc-control] input:disabled{border-color:GrayText!important}",
|
|
12
|
+
"}"
|
|
13
|
+
].join("");
|
|
14
|
+
function boxStyle(kind, checked, disabled) {
|
|
15
|
+
return {
|
|
16
|
+
appearance: "none",
|
|
17
|
+
WebkitAppearance: "none",
|
|
18
|
+
margin: 0,
|
|
19
|
+
width: 20,
|
|
20
|
+
height: 20,
|
|
21
|
+
borderRadius: kind === "radio" ? "50%" : 0,
|
|
22
|
+
border: checked ? "1px solid var(--primary, #f97316)" : "1px solid var(--input, var(--border, #52525b))",
|
|
23
|
+
background: checked && kind === "checkbox" ? "var(--primary, #f97316)" : "var(--oca-surface, var(--background, transparent))",
|
|
24
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
25
|
+
opacity: disabled ? 0.5 : 1
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
var MARK = { position: "absolute", inset: 3, width: 14, height: 14, pointerEvents: "none" };
|
|
29
|
+
function DesignCheckbox({ checked, disabled, ...props }) {
|
|
30
|
+
return /* @__PURE__ */ jsxs("span", { "data-oc-control": "", style: WRAP, children: [
|
|
31
|
+
/* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: FORCED } }),
|
|
32
|
+
/* @__PURE__ */ jsx("input", { ...props, type: "checkbox", checked, disabled, style: boxStyle("checkbox", checked, Boolean(disabled)) }),
|
|
33
|
+
checked ? /* @__PURE__ */ jsx("svg", { "data-oc-check": "", "aria-hidden": "true", viewBox: "0 0 24 24", style: { ...MARK, color: "var(--primary-foreground, #ffffff)" }, children: /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5", fill: "none", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "square" }) }) : null
|
|
34
|
+
] });
|
|
35
|
+
}
|
|
36
|
+
function DesignRadio({ checked, disabled, ...props }) {
|
|
37
|
+
return /* @__PURE__ */ jsxs("span", { "data-oc-control": "", style: WRAP, children: [
|
|
38
|
+
/* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: FORCED } }),
|
|
39
|
+
/* @__PURE__ */ jsx("input", { ...props, type: "radio", checked, disabled, style: boxStyle("radio", checked, Boolean(disabled)) }),
|
|
40
|
+
checked ? /* @__PURE__ */ jsx("svg", { "data-oc-dot": "", "aria-hidden": "true", viewBox: "0 0 14 14", style: { ...MARK, color: "var(--primary, #f97316)" }, children: /* @__PURE__ */ jsx("circle", { cx: "7", cy: "7", r: "4", fill: "currentColor" }) }) : null
|
|
41
|
+
] });
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export {
|
|
45
|
+
DesignCheckbox,
|
|
46
|
+
DesignRadio
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=chunk-OKHAVNEU.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/controls.tsx"],"sourcesContent":["import * as React from 'react';\n\n/*\n * app-design 2.0's checkbox and radio, for the ceremonies here that style\n * themselves inline: a real input (its label, keyboard and form behaviour\n * unchanged), drawn 20px from the page's tokens instead of the platform's\n * control and its accent-color. The checkbox is square; the radio is round,\n * as app-design's own is, since a square radio reads as a checkbox.\n *\n * Under forced colors the fill gives way to the system's Canvas but an SVG\n * keeps its own colour, so a checked box's white mark vanished on a white\n * Canvas. A small stylesheet draws them as native controls do there: a\n * checked checkbox in Highlight with its mark in HighlightText, a chosen\n * radio's border and dot in Highlight, the rest in CanvasText. Inline styles\n * cannot say forced-colors.\n */\n\ntype BoxProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'style' | 'checked'> & { checked: boolean };\n\nconst WRAP: React.CSSProperties = { position: 'relative', display: 'inline-flex', flexShrink: 0, width: 20, height: 20 };\n\nconst FORCED = [\n '@media (forced-colors: active){',\n '[data-oc-control] input{border-color:CanvasText!important;background:Canvas!important}',\n '[data-oc-control] input[type=checkbox]:checked{border-color:Highlight!important;background:Highlight!important}',\n '[data-oc-control] input[type=radio]:checked{border-color:Highlight!important}',\n '[data-oc-control] svg[data-oc-check]{color:HighlightText!important}',\n '[data-oc-control] svg[data-oc-dot]{color:Highlight!important}',\n '[data-oc-control] input:disabled{border-color:GrayText!important}',\n '}',\n].join('');\n\nfunction boxStyle(kind: 'checkbox' | 'radio', checked: boolean, disabled: boolean): React.CSSProperties {\n return {\n appearance: 'none',\n WebkitAppearance: 'none',\n margin: 0,\n width: 20,\n height: 20,\n borderRadius: kind === 'radio' ? '50%' : 0,\n border: checked ? '1px solid var(--primary, #f97316)' : '1px solid var(--input, var(--border, #52525b))',\n background: checked && kind === 'checkbox' ? 'var(--primary, #f97316)' : 'var(--oca-surface, var(--background, transparent))',\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.5 : 1,\n };\n}\n\nconst MARK: React.CSSProperties = { position: 'absolute', inset: 3, width: 14, height: 14, pointerEvents: 'none' };\n\n/** The design checkbox: filled with --primary when checked, its mark in --primary-foreground. */\nexport function DesignCheckbox({ checked, disabled, ...props }: BoxProps) {\n return (\n <span data-oc-control=\"\" style={WRAP}>\n <style dangerouslySetInnerHTML={{ __html: FORCED }} />\n <input {...props} type=\"checkbox\" checked={checked} disabled={disabled} style={boxStyle('checkbox', checked, Boolean(disabled))} />\n {checked ? (\n <svg data-oc-check=\"\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" style={{ ...MARK, color: 'var(--primary-foreground, #ffffff)' }}>\n <path d=\"M20 6 9 17l-5-5\" fill=\"none\" stroke=\"currentColor\" strokeWidth={3} strokeLinecap=\"square\" />\n </svg>\n ) : null}\n </span>\n );\n}\n\n/** The design radio: round, as app-design's RadioGroupItem is, with a dot in --primary when chosen. */\nexport function DesignRadio({ checked, disabled, ...props }: BoxProps) {\n return (\n <span data-oc-control=\"\" style={WRAP}>\n <style dangerouslySetInnerHTML={{ __html: FORCED }} />\n <input {...props} type=\"radio\" checked={checked} disabled={disabled} style={boxStyle('radio', checked, Boolean(disabled))} />\n {checked ? (\n <svg data-oc-dot=\"\" aria-hidden=\"true\" viewBox=\"0 0 14 14\" style={{ ...MARK, color: 'var(--primary, #f97316)' }}>\n <circle cx=\"7\" cy=\"7\" r=\"4\" fill=\"currentColor\" />\n </svg>\n ) : null}\n </span>\n );\n}\n"],"mappings":";AAoDQ,SACI,KADJ;AAjCR,IAAM,OAA4B,EAAE,UAAU,YAAY,SAAS,eAAe,YAAY,GAAG,OAAO,IAAI,QAAQ,GAAG;AAEvH,IAAM,SAAS;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,EAAE,KAAK,EAAE;AAET,SAAS,SAAS,MAA4B,SAAkB,UAAwC;AACpG,SAAO;AAAA,IACH,YAAY;AAAA,IACZ,kBAAkB;AAAA,IAClB,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,cAAc,SAAS,UAAU,QAAQ;AAAA,IACzC,QAAQ,UAAU,sCAAsC;AAAA,IACxD,YAAY,WAAW,SAAS,aAAa,4BAA4B;AAAA,IACzE,QAAQ,WAAW,gBAAgB;AAAA,IACnC,SAAS,WAAW,MAAM;AAAA,EAC9B;AACJ;AAEA,IAAM,OAA4B,EAAE,UAAU,YAAY,OAAO,GAAG,OAAO,IAAI,QAAQ,IAAI,eAAe,OAAO;AAG1G,SAAS,eAAe,EAAE,SAAS,UAAU,GAAG,MAAM,GAAa;AACtE,SACI,qBAAC,UAAK,mBAAgB,IAAG,OAAO,MAC5B;AAAA,wBAAC,WAAM,yBAAyB,EAAE,QAAQ,OAAO,GAAG;AAAA,IACpD,oBAAC,WAAO,GAAG,OAAO,MAAK,YAAW,SAAkB,UAAoB,OAAO,SAAS,YAAY,SAAS,QAAQ,QAAQ,CAAC,GAAG;AAAA,IAChI,UACG,oBAAC,SAAI,iBAAc,IAAG,eAAY,QAAO,SAAQ,aAAY,OAAO,EAAE,GAAG,MAAM,OAAO,qCAAqC,GACvH,8BAAC,UAAK,GAAE,mBAAkB,MAAK,QAAO,QAAO,gBAAe,aAAa,GAAG,eAAc,UAAS,GACvG,IACA;AAAA,KACR;AAER;AAGO,SAAS,YAAY,EAAE,SAAS,UAAU,GAAG,MAAM,GAAa;AACnE,SACI,qBAAC,UAAK,mBAAgB,IAAG,OAAO,MAC5B;AAAA,wBAAC,WAAM,yBAAyB,EAAE,QAAQ,OAAO,GAAG;AAAA,IACpD,oBAAC,WAAO,GAAG,OAAO,MAAK,SAAQ,SAAkB,UAAoB,OAAO,SAAS,SAAS,SAAS,QAAQ,QAAQ,CAAC,GAAG;AAAA,IAC1H,UACG,oBAAC,SAAI,eAAY,IAAG,eAAY,QAAO,SAAQ,aAAY,OAAO,EAAE,GAAG,MAAM,OAAO,0BAA0B,GAC1G,8BAAC,YAAO,IAAG,KAAI,IAAG,KAAI,GAAE,KAAI,MAAK,gBAAe,GACpD,IACA;AAAA,KACR;AAER;","names":[]}
|
|
@@ -22,7 +22,7 @@ function useUniqueId(prefix) {
|
|
|
22
22
|
return id;
|
|
23
23
|
}
|
|
24
24
|
function OcAccountChip({
|
|
25
|
-
dashboardUrl = "https://ochk.
|
|
25
|
+
dashboardUrl = "https://ochk.app/me/account",
|
|
26
26
|
signInUrl: signInUrlOverride,
|
|
27
27
|
signInLabel = "sign in",
|
|
28
28
|
className,
|
|
@@ -666,4 +666,4 @@ export {
|
|
|
666
666
|
useOcAddressSuggestion,
|
|
667
667
|
OcAddressInput
|
|
668
668
|
};
|
|
669
|
-
//# sourceMappingURL=chunk-
|
|
669
|
+
//# sourceMappingURL=chunk-VQY7IYHV.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { useOcSession } from './provider';\nimport type { OcAccount } from './types';\n\nfunction shortenAddress(addr: string): string {\n if (addr.length <= 12) return addr;\n return `${addr.slice(0, 6)}…${addr.slice(-4)}`;\n}\n\nfunction shortenAddressMid(addr: string): string {\n if (addr.length <= 16) return addr;\n return `${addr.slice(0, 8)}…${addr.slice(-6)}`;\n}\n\nfunction isPrefixOf(value: string, target: string): boolean {\n return target.toLowerCase().startsWith(value.toLowerCase());\n}\n\nlet listboxIdCounter = 0;\nfunction useUniqueId(prefix: string): string {\n const [id] = React.useState(() => `${prefix}-${++listboxIdCounter}`);\n return id;\n}\n\nexport interface OcAccountChipProps {\n /**\n * URL to the user's account page. Defaults to `https://ochk.app/me/account`,\n * the family's account page (ochk.io/dashboard only redirects there).\n */\n dashboardUrl?: string;\n /**\n * Override the sign-in URL shown to anonymous visitors. Defaults to\n * the session's `signInUrl` (which points at the auth host's\n * /signin?return_to=… page). Set this to a local path like `'/signin'`\n * when the consumer site mounts its own in-place `<OcSignIn />` —\n * skips the redirect-bounce entirely.\n */\n signInUrl?: string;\n /**\n * Label for the sign-in link shown to anonymous visitors.\n * Defaults to `sign in`.\n */\n signInLabel?: string;\n /** className for the wrapper `<div>`. */\n className?: string;\n /** className for the trigger pill button. */\n triggerClassName?: string;\n /** className for the dropdown popover. */\n popoverClassName?: string;\n /** className for menu items (dashboard link + sign-out button). */\n menuItemClassName?: string;\n}\n\n/**\n * Single header-account affordance for every ochk.io subdomain.\n *\n * anonymous → \"sign in\" link\n * signed in → pill `bc1q…7ke3 ▾` that opens a popover with:\n * • § signed in (label)\n * • full address (monospace, break-all)\n * • → dashboard\n * • → sign out\n *\n * The popover closes on outside click or Escape. Reasonable inline styles\n * cover the dark-mode default; override per-part via the className props\n * or via the `[data-oc-account-chip-*]` data attributes.\n */\nexport function OcAccountChip({\n dashboardUrl = 'https://ochk.app/me/account',\n signInUrl: signInUrlOverride,\n signInLabel = 'sign in',\n className,\n triggerClassName,\n popoverClassName,\n menuItemClassName,\n}: OcAccountChipProps): React.ReactElement | null {\n const { status, account, signInUrl: sessionSignInUrl, trySignOut } = useOcSession();\n const signInUrl = signInUrlOverride ?? sessionSignInUrl;\n const [open, setOpen] = React.useState(false);\n // The auth host did not end the session: say so, and keep showing the account.\n const [signOutFailed, setSignOutFailed] = React.useState(false);\n const wrapRef = React.useRef<HTMLDivElement | null>(null);\n\n React.useEffect(() => {\n if (!open) return;\n function handleClickOutside(e: MouseEvent) {\n if (wrapRef.current && !wrapRef.current.contains(e.target as Node)) {\n setOpen(false);\n }\n }\n function handleEscape(e: KeyboardEvent) {\n if (e.key === 'Escape') setOpen(false);\n }\n document.addEventListener('mousedown', handleClickOutside);\n document.addEventListener('keydown', handleEscape);\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n document.removeEventListener('keydown', handleEscape);\n };\n }, [open]);\n\n if (status === 'loading') return null;\n\n if (status !== 'authenticated' || !account) {\n return (\n <a\n href={signInUrl}\n className={triggerClassName ?? className}\n data-oc-account-chip-signin=\"\"\n >\n {signInLabel}\n </a>\n );\n }\n\n return (\n <div\n ref={wrapRef}\n className={className}\n data-oc-account-chip=\"\"\n style={{ position: 'relative', display: 'inline-block' }}\n >\n <button\n type=\"button\"\n onClick={() => setOpen((v) => !v)}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n aria-label={`Signed in as ${account.didOc}. Open account menu.`}\n className={triggerClassName}\n data-oc-account-chip-trigger=\"\"\n style={\n triggerClassName\n ? undefined\n : {\n display: 'inline-flex',\n alignItems: 'center',\n gap: '0.4rem',\n padding: '0.25rem 0.625rem',\n borderRadius: '9999px',\n border: '1px solid var(--border, #27272a)',\n background:\n 'color-mix(in oklch, var(--muted, #27272a) 40%, transparent)',\n color: 'var(--foreground, #fafafa)',\n fontFamily: 'ui-monospace, SFMono-Regular, monospace',\n fontSize: 12,\n cursor: 'pointer',\n }\n }\n >\n <span aria-hidden=\"true\" style={{ color: '#22c55e', fontSize: 8 }}>\n ●\n </span>\n <span>{account.displayName ?? shortenAddress(account.didOc)}</span>\n <svg\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 10 10\"\n aria-hidden=\"true\"\n style={{\n transition: 'transform 120ms',\n transform: open ? 'rotate(180deg)' : 'rotate(0)',\n opacity: 0.6,\n }}\n >\n <path\n d=\"M2 4 L5 7 L8 4\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n fill=\"none\"\n strokeLinecap=\"round\"\n />\n </svg>\n </button>\n\n {open && (\n <div\n role=\"menu\"\n aria-label=\"Account menu\"\n className={popoverClassName}\n data-oc-account-chip-popover=\"\"\n style={\n popoverClassName\n ? { position: 'absolute', zIndex: 50, top: 'calc(100% + 6px)', right: 0 }\n : {\n position: 'absolute',\n zIndex: 50,\n top: 'calc(100% + 6px)',\n right: 0,\n minWidth: 240,\n background: 'var(--popover, #0a0a0a)',\n color: 'var(--popover-foreground, #fafafa)',\n border: '1px solid var(--border, #27272a)',\n boxShadow: '0 10px 32px -4px rgba(0,0,0,0.35)',\n fontFamily: 'ui-monospace, SFMono-Regular, monospace',\n }\n }\n >\n <div\n data-oc-account-chip-header=\"\"\n style={{\n padding: '0.75rem 0.75rem 0.625rem',\n borderBottom: '1px solid var(--border, #27272a)',\n }}\n >\n <div\n data-oc-account-chip-label=\"\"\n style={{\n color: 'var(--primary, #f97316)',\n fontSize: 10,\n letterSpacing: '0.18em',\n textTransform: 'uppercase',\n marginBottom: 4,\n }}\n >\n § signed in\n </div>\n <div\n data-oc-account-chip-address=\"\"\n style={{\n color: 'var(--popover-foreground, #fafafa)',\n fontSize: 11,\n wordBreak: 'break-all',\n lineHeight: 1.35,\n }}\n >\n {account.didOc}\n </div>\n {account.displayName ? (\n <div\n style={{\n color: 'var(--muted-foreground, #a1a1aa)',\n fontSize: 10,\n marginTop: 4,\n letterSpacing: '0.06em',\n }}\n >\n {account.displayName}\n </div>\n ) : null}\n </div>\n <div role=\"none\" style={{ padding: '0.25rem' }}>\n {dashboardUrl ? (\n <a\n role=\"menuitem\"\n href={dashboardUrl}\n onClick={() => setOpen(false)}\n className={menuItemClassName}\n data-oc-account-chip-item=\"\"\n style={\n menuItemClassName\n ? undefined\n : {\n display: 'flex',\n alignItems: 'center',\n gap: '0.5rem',\n padding: '0.5rem 0.625rem',\n fontSize: 12,\n color: 'var(--popover-foreground, #fafafa)',\n textDecoration: 'none',\n cursor: 'pointer',\n }\n }\n >\n <span\n aria-hidden=\"true\"\n style={{ color: 'var(--muted-foreground, #a1a1aa)' }}\n >\n →\n </span>\n <span style={{ flex: 1 }}>dashboard</span>\n <span\n style={{\n color: 'var(--muted-foreground, #a1a1aa)',\n fontSize: 10,\n }}\n >\n ↗\n </span>\n </a>\n ) : null}\n <button\n type=\"button\"\n role=\"menuitem\"\n onClick={() => {\n setOpen(false);\n setSignOutFailed(false);\n void trySignOut().then((r) => setSignOutFailed(!r.ok));\n }}\n className={menuItemClassName}\n data-oc-account-chip-item=\"\"\n data-oc-account-chip-signout=\"\"\n style={\n menuItemClassName\n ? undefined\n : {\n display: 'flex',\n alignItems: 'center',\n gap: '0.5rem',\n width: '100%',\n padding: '0.5rem 0.625rem',\n fontSize: 12,\n color: 'var(--popover-foreground, #fafafa)',\n background: 'transparent',\n border: 0,\n fontFamily: 'inherit',\n textAlign: 'left',\n cursor: 'pointer',\n }\n }\n >\n <span\n aria-hidden=\"true\"\n style={{ color: 'var(--muted-foreground, #a1a1aa)' }}\n >\n →\n </span>\n <span style={{ flex: 1 }}>sign out</span>\n </button>\n </div>\n </div>\n )}\n {signOutFailed ? <SignOutFailed /> : null}\n </div>\n );\n}\n\n/** Said when the auth host did not end the session, so the person is still signed in. */\nfunction SignOutFailed(): React.ReactElement {\n return (\n <span\n role=\"alert\"\n data-oc-signout-failed=\"\"\n style={{ display: 'block', marginTop: 4, fontSize: 12, color: 'var(--destructive, #dc2626)' }}\n >\n Couldn’t sign out. You’re still signed in; try again.\n </span>\n );\n}\n\nexport interface OcSignInButtonProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n /** Label shown when no user is signed in. Defaults to `sign in`. */\n label?: string;\n /**\n * When `true`, render an `<a>` even while the session is loading, to\n * avoid layout shift. Defaults to `false` (renders nothing while loading).\n */\n eager?: boolean;\n /**\n * Override the destination URL. Defaults to the session's `signInUrl`\n * (the auth host's redirect-style /signin). Set this to a local path\n * like `'/signin'` when the consumer site has its own in-place\n * `<OcSignIn />` page — keeps the user in-tab.\n */\n signInUrl?: string;\n}\n\n/**\n * Drop-in sign-in button. Renders an anchor that points at either:\n *\n * - the consumer's local `/signin` page (when `signInUrl` prop is set\n * — recommended; works with `<OcSignIn />`), or\n * - the auth host's `/signin?return_to=…` (default fallback)\n *\n * When the user is already authenticated it renders nothing.\n */\nexport function OcSignInButton({\n label = 'sign in',\n eager = false,\n className,\n signInUrl: signInUrlOverride,\n ...rest\n}: OcSignInButtonProps): React.ReactElement | null {\n const { status, signInUrl: sessionSignInUrl } = useOcSession();\n const href = signInUrlOverride ?? sessionSignInUrl;\n if (status === 'authenticated') return null;\n if (!eager && status === 'loading') return null;\n\n return (\n <a\n {...rest}\n href={href}\n className={className}\n data-oc-sign-in-button=\"\"\n >\n {label}\n </a>\n );\n}\n\nexport interface OcAccountPillProps extends React.HTMLAttributes<HTMLDivElement> {\n /** URL to link the address to. With none, the label is plain text. */\n dashboardUrl?: string;\n /** Override the display text. Defaults to the shortened address. */\n render?: (account: { address: string; displayName?: string | null }) => React.ReactNode;\n}\n\n/**\n * Shows the signed-in user as a short pill: `bc1q…abcd sign out`.\n *\n * Renders nothing while loading or when no user is signed in — pair with\n * `<OcSignInButton>` for the anonymous case.\n */\nexport function OcAccountPill({\n dashboardUrl,\n render,\n className,\n ...rest\n}: OcAccountPillProps): React.ReactElement | null {\n const { status, account, trySignOut } = useOcSession();\n // The auth host did not end the session: say so, and keep showing the account.\n const [signOutFailed, setSignOutFailed] = React.useState(false);\n\n if (status !== 'authenticated' || !account) return null;\n\n const label = render\n ? render({ address: account.didOc, displayName: account.displayName })\n : (account.displayName ?? shortenAddress(account.didOc));\n\n return (\n <div\n {...rest}\n className={className}\n data-oc-account-pill=\"\"\n style={{ display: 'inline-flex', alignItems: 'center', gap: '0.5rem', ...(rest.style ?? {}) }}\n >\n {dashboardUrl ? (\n <a href={dashboardUrl}>{label}</a>\n ) : (\n <span>{label}</span>\n )}\n <button\n type=\"button\"\n onClick={() => {\n setSignOutFailed(false);\n void trySignOut().then((r) => setSignOutFailed(!r.ok));\n }}\n aria-label=\"Sign out\"\n style={{\n background: 'none',\n border: 'none',\n cursor: 'pointer',\n color: 'inherit',\n font: 'inherit',\n padding: 0,\n }}\n >\n sign out\n </button>\n {signOutFailed ? <SignOutFailed /> : null}\n </div>\n );\n}\n\nexport interface OcAddressInputProps\n extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange'> {\n /** Controlled value. */\n value: string;\n /** Called when value changes — typed by the user OR selected from the popover. */\n onValueChange: (value: string) => void;\n /** Label shown above the suggested address in the popover. Defaults to `use your address`. */\n suggestionLabel?: string;\n /** className applied to the wrapper `<div>`. */\n wrapperClassName?: string;\n /** className applied to the suggestion popover. Style with `[data-oc-address-popover]` otherwise. */\n popoverClassName?: string;\n /** className applied to the suggestion button. Style with `[data-oc-address-suggestion]` otherwise. */\n suggestionClassName?: string;\n}\n\n/**\n * Bitcoin-address `<input>` that, when the user is signed in via `oc_session`,\n * surfaces their address as a one-click suggestion on focus.\n *\n * Behaviour:\n * - On focus, if logged-in AND the typed value is a prefix of the session\n * address (or empty), show a small popover with `bc1q…7ke3` as a clickable\n * suggestion.\n * - Click / Enter on the suggestion fills the field with the full address.\n * - Down-arrow from the input highlights the suggestion; Up-arrow clears the\n * highlight; Escape closes the popover; clicking outside closes the popover.\n * - When the user types something that's no longer a prefix of the session\n * address, the popover hides itself out of the way.\n * - When the field already contains the session address exactly, no popover.\n *\n * Style-agnostic: minimal inline styles for positioning only. Style the parts\n * via `wrapperClassName` / `popoverClassName` / `suggestionClassName`, or via\n * the `[data-oc-address-input]`, `[data-oc-address-popover]`, and\n * `[data-oc-address-suggestion]` data attributes.\n */\nexport interface UseOcAddressSuggestionOptions {\n /** Current value of the input. */\n value: string;\n /** Called when the user selects the suggestion (or you may also call it from the input's onChange). */\n onValueChange: (value: string) => void;\n /** Label shown above the suggested address in the popover. Defaults to `use your address`. */\n suggestionLabel?: string;\n /** className applied to the suggestion popover. Style with `[data-oc-address-popover]` otherwise. */\n popoverClassName?: string;\n /** className applied to the suggestion button. Style with `[data-oc-address-suggestion]` otherwise. */\n suggestionClassName?: string;\n}\n\nexport interface UseOcAddressSuggestionReturn {\n /**\n * Props to spread onto your `<input>` element. Adds focus/blur/keydown\n * handlers and the combobox ARIA attributes. Combine with your existing\n * `value`/`onChange` props — this hook does NOT control them.\n */\n inputProps: {\n onFocus: (e: React.FocusEvent<HTMLInputElement>) => void;\n onBlur: (e: React.FocusEvent<HTMLInputElement>) => void;\n onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void;\n role: 'combobox';\n 'aria-haspopup': 'listbox';\n 'aria-expanded': boolean;\n 'aria-controls': string | undefined;\n 'aria-activedescendant': string | undefined;\n autoComplete: 'off';\n spellCheck: false;\n };\n /**\n * The suggestion popover. Render directly after your `<input>`, inside a\n * `position: relative` container so the popover anchors below the input.\n * Returns `null` when there's no suggestion to show.\n */\n popover: React.ReactNode;\n}\n\n/**\n * Hook variant of `OcAddressInput`. Use when you want to keep your existing\n * styled `<input>` (e.g. shadcn `<Input>`) and just bolt on the\n * session-address suggestion behaviour.\n *\n * Wrap your input in a `position: relative` container, spread `inputProps`\n * onto the input, and render `{popover}` immediately after. The hook's\n * focus / blur / keydown handlers are composed via `inputProps` — they call\n * any handlers you've already passed to your input only when you wire them\n * yourself in addition to spreading `inputProps`.\n *\n * Example:\n * ```tsx\n * const { inputProps, popover } = useOcAddressSuggestion({\n * value: addr,\n * onValueChange: setAddr,\n * });\n * return (\n * <div className=\"relative\">\n * <Input\n * value={addr}\n * onChange={(e) => setAddr(e.target.value)}\n * {...inputProps}\n * placeholder=\"bc1q…\"\n * />\n * {popover}\n * </div>\n * );\n * ```\n */\n/**\n * The address to offer: the account's primary one, else the Bitcoin address it\n * shows. Consumer sites verify the session locally and have no primary address\n * (`primary_btc` is null), but a wallet sign-in shows its address.\n */\nfunction accountAddress(account: OcAccount | null | undefined): string | null {\n if (account?.primaryBtc) return account.primaryBtc;\n return account?.displayIdentity?.kind === 'btc' ? account.displayIdentity.value : null;\n}\n\nexport function useOcAddressSuggestion(\n options: UseOcAddressSuggestionOptions\n): UseOcAddressSuggestionReturn {\n const {\n value,\n onValueChange,\n suggestionLabel = 'use your address',\n popoverClassName,\n suggestionClassName,\n } = options;\n\n const { status, account } = useOcSession();\n const sessionAddress = status === 'authenticated' ? accountAddress(account) : null;\n\n const [open, setOpen] = React.useState(false);\n const [highlighted, setHighlighted] = React.useState(false);\n const blurTimer = React.useRef<number | null>(null);\n\n const listboxId = useUniqueId('oc-addr-listbox');\n const optionId = `${listboxId}-opt`;\n\n const valueMatchesSession =\n sessionAddress != null && value.toLowerCase() === sessionAddress.toLowerCase();\n const canSuggest =\n sessionAddress != null &&\n sessionAddress.length > 0 &&\n !valueMatchesSession &&\n isPrefixOf(value, sessionAddress);\n const showPopover = open && canSuggest;\n\n function selectSuggestion() {\n if (!sessionAddress) return;\n onValueChange(sessionAddress);\n setOpen(false);\n setHighlighted(false);\n }\n\n React.useEffect(() => {\n return () => {\n if (blurTimer.current != null) window.clearTimeout(blurTimer.current);\n };\n }, []);\n\n const inputProps: UseOcAddressSuggestionReturn['inputProps'] = {\n onFocus: () => {\n if (blurTimer.current != null) {\n window.clearTimeout(blurTimer.current);\n blurTimer.current = null;\n }\n setOpen(true);\n },\n onBlur: () => {\n blurTimer.current = window.setTimeout(() => {\n setOpen(false);\n setHighlighted(false);\n }, 120);\n },\n onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (!showPopover) return;\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n setHighlighted(true);\n } else if (e.key === 'ArrowUp') {\n e.preventDefault();\n setHighlighted(false);\n } else if (e.key === 'Escape') {\n e.preventDefault();\n setOpen(false);\n setHighlighted(false);\n } else if (e.key === 'Enter' && highlighted) {\n e.preventDefault();\n selectSuggestion();\n }\n },\n role: 'combobox',\n 'aria-haspopup': 'listbox',\n 'aria-expanded': showPopover,\n 'aria-controls': showPopover ? listboxId : undefined,\n 'aria-activedescendant': highlighted ? optionId : undefined,\n autoComplete: 'off',\n spellCheck: false,\n };\n\n const popover = showPopover && sessionAddress ? (\n <div\n id={listboxId}\n role=\"listbox\"\n data-oc-address-popover=\"\"\n className={popoverClassName}\n style={{\n position: 'absolute',\n zIndex: 50,\n top: 'calc(100% + 4px)',\n left: 0,\n right: 0,\n }}\n onMouseDown={(e) => e.preventDefault()}\n >\n <button\n type=\"button\"\n id={optionId}\n role=\"option\"\n aria-selected={highlighted}\n data-oc-address-suggestion=\"\"\n data-highlighted={highlighted ? '' : undefined}\n className={suggestionClassName}\n onClick={selectSuggestion}\n onMouseEnter={() => setHighlighted(true)}\n onMouseLeave={() => setHighlighted(false)}\n style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: '0.75rem',\n width: '100%',\n textAlign: 'left',\n cursor: 'pointer',\n font: 'inherit',\n background: 'inherit',\n color: 'inherit',\n border: 0,\n padding: 'inherit',\n }}\n >\n <span data-oc-address-suggestion-label=\"\">{suggestionLabel}</span>\n <span\n data-oc-address-suggestion-value=\"\"\n style={{ fontFamily: 'ui-monospace, monospace' }}\n >\n {shortenAddressMid(sessionAddress)}\n </span>\n </button>\n </div>\n ) : null;\n\n return { inputProps, popover };\n}\n\nexport const OcAddressInput = React.forwardRef<HTMLInputElement, OcAddressInputProps>(\n function OcAddressInput(\n {\n value,\n onValueChange,\n suggestionLabel = 'use your address',\n wrapperClassName,\n popoverClassName,\n suggestionClassName,\n onFocus,\n onBlur,\n onKeyDown,\n ...rest\n },\n forwardedRef\n ): React.ReactElement {\n const { status, account } = useOcSession();\n const sessionAddress = status === 'authenticated' ? accountAddress(account) : null;\n\n const [open, setOpen] = React.useState(false);\n const [highlighted, setHighlighted] = React.useState(false);\n\n const innerRef = React.useRef<HTMLInputElement | null>(null);\n const setRef = (node: HTMLInputElement | null) => {\n innerRef.current = node;\n if (typeof forwardedRef === 'function') forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n };\n const blurTimer = React.useRef<number | null>(null);\n\n const listboxId = useUniqueId('oc-addr-listbox');\n const optionId = `${listboxId}-opt`;\n\n const valueMatchesSession =\n sessionAddress != null && value.toLowerCase() === sessionAddress.toLowerCase();\n const canSuggest =\n sessionAddress != null &&\n sessionAddress.length > 0 &&\n !valueMatchesSession &&\n isPrefixOf(value, sessionAddress);\n const showPopover = open && canSuggest;\n\n function selectSuggestion() {\n if (!sessionAddress) return;\n onValueChange(sessionAddress);\n setOpen(false);\n setHighlighted(false);\n // Re-focus so the next Tab moves on naturally.\n innerRef.current?.focus();\n }\n\n function handleFocus(e: React.FocusEvent<HTMLInputElement>) {\n if (blurTimer.current != null) {\n window.clearTimeout(blurTimer.current);\n blurTimer.current = null;\n }\n setOpen(true);\n onFocus?.(e);\n }\n\n function handleBlur(e: React.FocusEvent<HTMLInputElement>) {\n // Defer close so a click on the suggestion can register first.\n blurTimer.current = window.setTimeout(() => {\n setOpen(false);\n setHighlighted(false);\n }, 120);\n onBlur?.(e);\n }\n\n function handleKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {\n if (showPopover) {\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n setHighlighted(true);\n } else if (e.key === 'ArrowUp') {\n e.preventDefault();\n setHighlighted(false);\n } else if (e.key === 'Escape') {\n e.preventDefault();\n setOpen(false);\n setHighlighted(false);\n } else if (e.key === 'Enter' && highlighted) {\n e.preventDefault();\n selectSuggestion();\n }\n }\n onKeyDown?.(e);\n }\n\n React.useEffect(() => {\n return () => {\n if (blurTimer.current != null) window.clearTimeout(blurTimer.current);\n };\n }, []);\n\n return (\n <div\n data-oc-address-input=\"\"\n className={wrapperClassName}\n style={{ position: 'relative' }}\n >\n <input\n {...rest}\n ref={setRef}\n value={value}\n onChange={(e) => onValueChange(e.target.value)}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-expanded={showPopover}\n aria-controls={showPopover ? listboxId : undefined}\n aria-activedescendant={highlighted ? optionId : undefined}\n autoComplete=\"off\"\n spellCheck={false}\n />\n {showPopover && sessionAddress && (\n <div\n id={listboxId}\n role=\"listbox\"\n data-oc-address-popover=\"\"\n className={popoverClassName}\n style={{\n position: 'absolute',\n zIndex: 50,\n top: 'calc(100% + 4px)',\n left: 0,\n right: 0,\n }}\n // Prevent the input from blurring before the click on the suggestion lands.\n onMouseDown={(e) => e.preventDefault()}\n >\n <button\n type=\"button\"\n id={optionId}\n role=\"option\"\n aria-selected={highlighted}\n data-oc-address-suggestion=\"\"\n data-highlighted={highlighted ? '' : undefined}\n className={suggestionClassName}\n onClick={selectSuggestion}\n onMouseEnter={() => setHighlighted(true)}\n onMouseLeave={() => setHighlighted(false)}\n style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: '0.75rem',\n width: '100%',\n textAlign: 'left',\n cursor: 'pointer',\n font: 'inherit',\n background: 'inherit',\n color: 'inherit',\n border: 'inherit',\n padding: 'inherit',\n }}\n >\n <span data-oc-address-suggestion-label=\"\">{suggestionLabel}</span>\n <span\n data-oc-address-suggestion-value=\"\"\n style={{ fontFamily: 'ui-monospace, monospace' }}\n >\n {shortenAddressMid(sessionAddress)}\n </span>\n </button>\n </div>\n )}\n </div>\n );\n }\n);\n"],"mappings":";;;;;AAAA,YAAY,WAAW;AA0GX,cAiBA,YAjBA;AArGZ,SAAS,eAAe,MAAsB;AAC1C,MAAI,KAAK,UAAU,GAAI,QAAO;AAC9B,SAAO,GAAG,KAAK,MAAM,GAAG,CAAC,CAAC,SAAI,KAAK,MAAM,EAAE,CAAC;AAChD;AAEA,SAAS,kBAAkB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aAAa,CAAC,MAAM,EAAE,eAAe;AAAA,cAErC;AAAA,gBAAC;AAAA;AAAA,kBACG,MAAK;AAAA,kBACL,IAAI;AAAA,kBACJ,MAAK;AAAA,kBACL,iBAAe;AAAA,kBACf,8BAA2B;AAAA,kBAC3B,oBAAkB,cAAc,KAAK;AAAA,kBACrC,WAAW;AAAA,kBACX,SAAS;AAAA,kBACT,cAAc,MAAM,eAAe,IAAI;AAAA,kBACvC,cAAc,MAAM,eAAe,KAAK;AAAA,kBACxC,OAAO;AAAA,oBACH,SAAS;AAAA,oBACT,YAAY;AAAA,oBACZ,gBAAgB;AAAA,oBAChB,KAAK;AAAA,oBACL,OAAO;AAAA,oBACP,WAAW;AAAA,oBACX,QAAQ;AAAA,oBACR,MAAM;AAAA,oBACN,YAAY;AAAA,oBACZ,OAAO;AAAA,oBACP,QAAQ;AAAA,oBACR,SAAS;AAAA,kBACb;AAAA,kBAEA;AAAA,wCAAC,UAAK,oCAAiC,IAAI,2BAAgB;AAAA,oBAC3D;AAAA,sBAAC;AAAA;AAAA,wBACG,oCAAiC;AAAA,wBACjC,OAAO,EAAE,YAAY,0BAA0B;AAAA,wBAE9C,4BAAkB,cAAc;AAAA;AAAA,oBACrC;AAAA;AAAA;AAAA,cACJ;AAAA;AAAA,UACJ;AAAA;AAAA;AAAA,IAER;AAAA,EAER;AACJ;","names":["OcAddressInput"]}
|
package/dist/components.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/index.js
CHANGED
|
@@ -693,7 +693,7 @@ function useUniqueId(prefix) {
|
|
|
693
693
|
return id;
|
|
694
694
|
}
|
|
695
695
|
function OcAccountChip({
|
|
696
|
-
dashboardUrl = "https://ochk.
|
|
696
|
+
dashboardUrl = "https://ochk.app/me/account",
|
|
697
697
|
signInUrl: signInUrlOverride,
|
|
698
698
|
signInLabel = "sign in",
|
|
699
699
|
className,
|
|
@@ -1370,6 +1370,46 @@ function capText(reason, retryAt, alternative = "sign in another way") {
|
|
|
1370
1370
|
return null;
|
|
1371
1371
|
}
|
|
1372
1372
|
}
|
|
1373
|
+
var WRAP = { position: "relative", display: "inline-flex", flexShrink: 0, width: 20, height: 20 };
|
|
1374
|
+
var FORCED = [
|
|
1375
|
+
"@media (forced-colors: active){",
|
|
1376
|
+
"[data-oc-control] input{border-color:CanvasText!important;background:Canvas!important}",
|
|
1377
|
+
"[data-oc-control] input[type=checkbox]:checked{border-color:Highlight!important;background:Highlight!important}",
|
|
1378
|
+
"[data-oc-control] input[type=radio]:checked{border-color:Highlight!important}",
|
|
1379
|
+
"[data-oc-control] svg[data-oc-check]{color:HighlightText!important}",
|
|
1380
|
+
"[data-oc-control] svg[data-oc-dot]{color:Highlight!important}",
|
|
1381
|
+
"[data-oc-control] input:disabled{border-color:GrayText!important}",
|
|
1382
|
+
"}"
|
|
1383
|
+
].join("");
|
|
1384
|
+
function boxStyle(kind, checked, disabled) {
|
|
1385
|
+
return {
|
|
1386
|
+
appearance: "none",
|
|
1387
|
+
WebkitAppearance: "none",
|
|
1388
|
+
margin: 0,
|
|
1389
|
+
width: 20,
|
|
1390
|
+
height: 20,
|
|
1391
|
+
borderRadius: kind === "radio" ? "50%" : 0,
|
|
1392
|
+
border: checked ? "1px solid var(--primary, #f97316)" : "1px solid var(--input, var(--border, #52525b))",
|
|
1393
|
+
background: checked && kind === "checkbox" ? "var(--primary, #f97316)" : "var(--oca-surface, var(--background, transparent))",
|
|
1394
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
1395
|
+
opacity: disabled ? 0.5 : 1
|
|
1396
|
+
};
|
|
1397
|
+
}
|
|
1398
|
+
var MARK = { position: "absolute", inset: 3, width: 14, height: 14, pointerEvents: "none" };
|
|
1399
|
+
function DesignCheckbox({ checked, disabled, ...props }) {
|
|
1400
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-oc-control": "", style: WRAP, children: [
|
|
1401
|
+
/* @__PURE__ */ jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: FORCED } }),
|
|
1402
|
+
/* @__PURE__ */ jsxRuntime.jsx("input", { ...props, type: "checkbox", checked, disabled, style: boxStyle("checkbox", checked, Boolean(disabled)) }),
|
|
1403
|
+
checked ? /* @__PURE__ */ jsxRuntime.jsx("svg", { "data-oc-check": "", "aria-hidden": "true", viewBox: "0 0 24 24", style: { ...MARK, color: "var(--primary-foreground, #ffffff)" }, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 6 9 17l-5-5", fill: "none", stroke: "currentColor", strokeWidth: 3, strokeLinecap: "square" }) }) : null
|
|
1404
|
+
] });
|
|
1405
|
+
}
|
|
1406
|
+
function DesignRadio({ checked, disabled, ...props }) {
|
|
1407
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-oc-control": "", style: WRAP, children: [
|
|
1408
|
+
/* @__PURE__ */ jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: FORCED } }),
|
|
1409
|
+
/* @__PURE__ */ jsxRuntime.jsx("input", { ...props, type: "radio", checked, disabled, style: boxStyle("radio", checked, Boolean(disabled)) }),
|
|
1410
|
+
checked ? /* @__PURE__ */ jsxRuntime.jsx("svg", { "data-oc-dot": "", "aria-hidden": "true", viewBox: "0 0 14 14", style: { ...MARK, color: "var(--primary, #f97316)" }, children: /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "7", cy: "7", r: "4", fill: "currentColor" }) }) : null
|
|
1411
|
+
] });
|
|
1412
|
+
}
|
|
1373
1413
|
|
|
1374
1414
|
// src/sudo.tsx
|
|
1375
1415
|
function redirectToSudo(args = {}) {
|
|
@@ -2695,15 +2735,7 @@ function OcSignIn({
|
|
|
2695
2735
|
}
|
|
2696
2736
|
),
|
|
2697
2737
|
linkPrompt && /* @__PURE__ */ jsxRuntime.jsxs("label", { "data-oc-signin-linkalso": "", style: linkAlsoStyle, children: [
|
|
2698
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2699
|
-
"input",
|
|
2700
|
-
{
|
|
2701
|
-
type: "checkbox",
|
|
2702
|
-
checked: linkAlso,
|
|
2703
|
-
onChange: (e) => setLinkAlso(e.target.checked),
|
|
2704
|
-
style: { margin: 0, accentColor: "var(--primary, #f97316)" }
|
|
2705
|
-
}
|
|
2706
|
-
),
|
|
2738
|
+
/* @__PURE__ */ jsxRuntime.jsx(DesignCheckbox, { checked: linkAlso, onChange: (e) => setLinkAlso(e.target.checked) }),
|
|
2707
2739
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
2708
2740
|
"After signing in, also link",
|
|
2709
2741
|
" ",
|
|
@@ -3531,6 +3563,8 @@ function coinStyle(picked, young) {
|
|
|
3531
3563
|
background: V.card,
|
|
3532
3564
|
border: `1px ${young ? "dashed" : "solid"} ${picked ? V.primary : V.border}`,
|
|
3533
3565
|
padding: "0.75rem",
|
|
3566
|
+
// The whole row is the radio's target.
|
|
3567
|
+
minHeight: 44,
|
|
3534
3568
|
display: "flex",
|
|
3535
3569
|
gap: 10,
|
|
3536
3570
|
alignItems: "flex-start",
|
|
@@ -3817,15 +3851,13 @@ function BondForm({
|
|
|
3817
3851
|
style: coinStyle(chosen === c.outpoint, young),
|
|
3818
3852
|
children: [
|
|
3819
3853
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3820
|
-
|
|
3854
|
+
DesignRadio,
|
|
3821
3855
|
{
|
|
3822
|
-
type: "radio",
|
|
3823
3856
|
name: "oc-bond-coin",
|
|
3824
3857
|
value: c.outpoint,
|
|
3825
3858
|
checked: chosen === c.outpoint,
|
|
3826
3859
|
disabled: young,
|
|
3827
|
-
onChange: () => setChosen(c.outpoint)
|
|
3828
|
-
style: { accentColor: V.primary, margin: "2px 0 0" }
|
|
3860
|
+
onChange: () => setChosen(c.outpoint)
|
|
3829
3861
|
}
|
|
3830
3862
|
),
|
|
3831
3863
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "grid", gap: 2, minWidth: 0 }, children: [
|