@spencerboucher/switchyard 0.9.0 → 0.10.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 +2 -2
- package/dist/switchyard.mjs +7073 -5396
- package/dist/terminal/holder.js +30 -4
- package/package.json +1 -1
- package/web-dist/assets/AutomationView-BsTwLnMp.js +2 -0
- package/web-dist/assets/{AutomationView-D7Syv1En.js.map → AutomationView-BsTwLnMp.js.map} +1 -1
- package/web-dist/assets/Card-CAFxHoHd.js +2 -0
- package/web-dist/assets/Card-CAFxHoHd.js.map +1 -0
- package/web-dist/assets/Checkbox-rDvnQnxc.js +2 -0
- package/web-dist/assets/Checkbox-rDvnQnxc.js.map +1 -0
- package/web-dist/assets/Copy-D8xhl7eJ.js +2 -0
- package/web-dist/assets/{Copy-B6XSAIUd.js.map → Copy-D8xhl7eJ.js.map} +1 -1
- package/web-dist/assets/DangerZone-og55TRug.js +2 -0
- package/web-dist/assets/DangerZone-og55TRug.js.map +1 -0
- package/web-dist/assets/{Field-D-Ty7fKT.js → Field-Dbg_8KTt.js} +2 -2
- package/web-dist/assets/{Field-D-Ty7fKT.js.map → Field-Dbg_8KTt.js.map} +1 -1
- package/web-dist/assets/{InteractionCard-DF1EcSpm.js → InteractionCard-Yu5wgLC3.js} +4 -4
- package/web-dist/assets/{InteractionCard-DF1EcSpm.js.map → InteractionCard-Yu5wgLC3.js.map} +1 -1
- package/web-dist/assets/Menu-euseM8yR.js +2 -0
- package/web-dist/assets/Menu-euseM8yR.js.map +1 -0
- package/web-dist/assets/Overlay-BNPvMjLX.js +2 -0
- package/web-dist/assets/{Overlay-DUQwh6_b.js.map → Overlay-BNPvMjLX.js.map} +1 -1
- package/web-dist/assets/Priority-Ca1B2yFr.js +2 -0
- package/web-dist/assets/{Priority-CHmzfoHg.js.map → Priority-Ca1B2yFr.js.map} +1 -1
- package/web-dist/assets/{SegmentedControl-C_hEVQMB.js → SegmentedControl-D2d-NEr-.js} +2 -2
- package/web-dist/assets/{SegmentedControl-C_hEVQMB.js.map → SegmentedControl-D2d-NEr-.js.map} +1 -1
- package/web-dist/assets/{Select-Cfql4Nwu.js → Select-C9L1HKMm.js} +2 -2
- package/web-dist/assets/{Select-Cfql4Nwu.js.map → Select-C9L1HKMm.js.map} +1 -1
- package/web-dist/assets/StatusChip-BYuVxYS7.js +2 -0
- package/web-dist/assets/StatusChip-BYuVxYS7.js.map +1 -0
- package/web-dist/assets/{Switch-DBfzmqkm.js → Switch-DAcUcSbH.js} +2 -2
- package/web-dist/assets/{Switch-DBfzmqkm.js.map → Switch-DAcUcSbH.js.map} +1 -1
- package/web-dist/assets/{Tabs-BNuL3_Et.js → Tabs-xtagjtA5.js} +2 -2
- package/web-dist/assets/{Tabs-BNuL3_Et.js.map → Tabs-xtagjtA5.js.map} +1 -1
- package/web-dist/assets/{TextArea-CKybrQyn.js → TextArea-CKGHwURx.js} +2 -2
- package/web-dist/assets/{TextArea-CKybrQyn.js.map → TextArea-CKGHwURx.js.map} +1 -1
- package/web-dist/assets/{TextLink-OzzyP2-p.js → TextLink-Bub7sMxr.js} +2 -2
- package/web-dist/assets/{TextLink-OzzyP2-p.js.map → TextLink-Bub7sMxr.js.map} +1 -1
- package/web-dist/assets/attention-CI4dHY81.js +2 -0
- package/web-dist/assets/{attention-V86Gye3I.js.map → attention-CI4dHY81.js.map} +1 -1
- package/web-dist/assets/auth-308hUVgi.js +2 -0
- package/web-dist/assets/auth-308hUVgi.js.map +1 -0
- package/web-dist/assets/automations-BzpsJoa3.js +2 -0
- package/web-dist/assets/{automations-Cw5Gacgm.js.map → automations-BzpsJoa3.js.map} +1 -1
- package/web-dist/assets/bell-DSwa2PAb.js +2 -0
- package/web-dist/assets/bell-DSwa2PAb.js.map +1 -0
- package/web-dist/assets/board-CeJxBVHC.js +10 -0
- package/web-dist/assets/board-CeJxBVHC.js.map +1 -0
- package/web-dist/assets/code-DkNQvMI9.js +12 -0
- package/web-dist/assets/code-DkNQvMI9.js.map +1 -0
- package/web-dist/assets/describe-CVXeUClF.js +5 -0
- package/web-dist/assets/{describe-D6KLGKWa.js.map → describe-CVXeUClF.js.map} +1 -1
- package/web-dist/assets/enroll-jnKygG4L.js +2 -0
- package/web-dist/assets/{enroll-DwT7AcuS.js.map → enroll-jnKygG4L.js.map} +1 -1
- package/web-dist/assets/index-BHGZTS2e.js +16 -0
- package/web-dist/assets/index-BHGZTS2e.js.map +1 -0
- package/web-dist/assets/index-D2ml031z.css +2 -0
- package/web-dist/assets/{more-DQR5uu1c.js → more-DvKHMdBk.js} +2 -2
- package/web-dist/assets/{more-DQR5uu1c.js.map → more-DvKHMdBk.js.map} +1 -1
- package/web-dist/assets/queue-B2Vl0uSh.js +2 -0
- package/web-dist/assets/{queue-DUg1rS8t.js.map → queue-B2Vl0uSh.js.map} +1 -1
- package/web-dist/assets/repo-BDS8RBxq.js +2 -0
- package/web-dist/assets/repo-BDS8RBxq.js.map +1 -0
- package/web-dist/assets/settings-CLt7x9u8.js +8 -0
- package/web-dist/assets/settings-CLt7x9u8.js.map +1 -0
- package/web-dist/assets/states-C773NlHo.js +56 -0
- package/web-dist/assets/states-C773NlHo.js.map +1 -0
- package/web-dist/assets/{terminal-login-S5CAd5xA.js → terminal-login-BK5UjUir.js} +2 -2
- package/web-dist/assets/{terminal-login-S5CAd5xA.js.map → terminal-login-BK5UjUir.js.map} +1 -1
- package/web-dist/assets/useBreakpoint-BphHBrzF.js +2 -0
- package/web-dist/assets/useBreakpoint-BphHBrzF.js.map +1 -0
- package/web-dist/assets/useNow-Cm-tdyod.js +2 -0
- package/web-dist/assets/{useNow-Dj7oEiwn.js.map → useNow-Cm-tdyod.js.map} +1 -1
- package/web-dist/assets/{useResource-CDGSq2At.js → useResource-BBqCoY2q.js} +2 -2
- package/web-dist/assets/{useResource-CDGSq2At.js.map → useResource-BBqCoY2q.js.map} +1 -1
- package/web-dist/index.html +7 -3
- package/web-dist/sw.js +1 -1
- package/web-dist/sw.js.map +1 -1
- package/web-dist/assets/AutomationView-D7Syv1En.js +0 -2
- package/web-dist/assets/Checkbox-D6tRfEeI.js +0 -2
- package/web-dist/assets/Checkbox-D6tRfEeI.js.map +0 -1
- package/web-dist/assets/Copy-B6XSAIUd.js +0 -2
- package/web-dist/assets/DangerZone-DfYlxDC1.js +0 -2
- package/web-dist/assets/DangerZone-DfYlxDC1.js.map +0 -1
- package/web-dist/assets/Menu-BfOszNC4.js +0 -2
- package/web-dist/assets/Menu-BfOszNC4.js.map +0 -1
- package/web-dist/assets/Overlay-DUQwh6_b.js +0 -2
- package/web-dist/assets/Priority-CHmzfoHg.js +0 -2
- package/web-dist/assets/attention-V86Gye3I.js +0 -2
- package/web-dist/assets/automations-Cw5Gacgm.js +0 -2
- package/web-dist/assets/board-B8X7TYYR.js +0 -10
- package/web-dist/assets/board-B8X7TYYR.js.map +0 -1
- package/web-dist/assets/code-BKroYJmR.js +0 -12
- package/web-dist/assets/code-BKroYJmR.js.map +0 -1
- package/web-dist/assets/describe-D6KLGKWa.js +0 -5
- package/web-dist/assets/enroll-DwT7AcuS.js +0 -2
- package/web-dist/assets/index-B3F7WcYf.css +0 -2
- package/web-dist/assets/index-hxvDvCS7.js +0 -12
- package/web-dist/assets/index-hxvDvCS7.js.map +0 -1
- package/web-dist/assets/queue-DUg1rS8t.js +0 -2
- package/web-dist/assets/repo-XzzzEI0d.js +0 -2
- package/web-dist/assets/repo-XzzzEI0d.js.map +0 -1
- package/web-dist/assets/search-C6cn5WOo.js +0 -2
- package/web-dist/assets/search-C6cn5WOo.js.map +0 -1
- package/web-dist/assets/settings-DyUu0tJM.js +0 -8
- package/web-dist/assets/settings-DyUu0tJM.js.map +0 -1
- package/web-dist/assets/states-ZhrxQa3K.js +0 -56
- package/web-dist/assets/states-ZhrxQa3K.js.map +0 -1
- package/web-dist/assets/useNow-Dj7oEiwn.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_ as e,m as t,t as n}from"./jsx-runtime-D13aM9HY.js";import{S as r}from"./StatusChip-BYuVxYS7.js";import{_ as i,a,d as o,n as s,yt as c}from"./states-C773NlHo.js";import{a as l}from"./useBreakpoint-BphHBrzF.js";var u=r(),d=e(t(),1),f=n(),p=(0,d.forwardRef)(function({label:e,icon:t,variant:n=`ghost`,size:r=`md`,className:a,type:o,...s},c){return(0,f.jsx)(`button`,{ref:c,type:o??`button`,"aria-label":e,title:e,className:i(`tap inline-flex shrink-0 items-center justify-center rounded-md border transition-colors`,`disabled:opacity-55 disabled:pointer-events-none`,r===`sm`?`size-8`:`size-9`,n===`ghost`&&`border-transparent text-muted hover:bg-surface-2 hover:text-text`,n===`secondary`&&`border-border bg-surface text-text hover:bg-surface-2`,n===`danger`&&`border-transparent text-danger hover:bg-danger-soft`,a),...s,children:t})}),m=`a[href], area[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), iframe, [tabindex]:not([tabindex="-1"]), [contenteditable="true"]`;function h(e){return[...e.querySelectorAll(m)].filter(e=>!e.hasAttribute(`inert`)&&e.getClientRects().length>0)}function g(e,t,n,r){let i=(0,d.useRef)(n);i.current=n;let a=(0,d.useRef)(null),o=(0,d.useRef)(!1);t&&!o.current&&typeof document<`u`&&(a.current=document.activeElement),o.current=t,(0,d.useEffect)(()=>{if(!t)return;let n=e.current;if(!n)return;let o=a.current,s=o&&!n.contains(o)?o:document.activeElement,c=r?.current??h(n)[0]??n,l=requestAnimationFrame(()=>{(r?.current||!n.contains(document.activeElement))&&c.focus({preventScroll:!0})}),u=e=>{if(e.key===`Escape`&&i.current){e.stopPropagation(),i.current();return}if(e.key!==`Tab`)return;let t=h(n);if(t.length===0){e.preventDefault(),n.focus();return}let r=t[0],a=t[t.length-1],o=document.activeElement;e.shiftKey&&(o===r||!n.contains(o))?(e.preventDefault(),a.focus()):e.shiftKey||o!==a&&n.contains(o)||(e.preventDefault(),r.focus())};return n.addEventListener(`keydown`,u),()=>{cancelAnimationFrame(l),n.removeEventListener(`keydown`,u),s&&document.contains(s)&&s.focus({preventScroll:!0})}},[t,e,r])}function _(e){(0,d.useEffect)(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=t}},[e])}function v({placement:e,open:t,onClose:n,title:r,description:a,children:o,footer:s,initialFocus:c,dismissOnBackdrop:m=!0,headerActions:h,className:v,flush:y,bodyClassName:b,fullHeight:x,style:S}){let C=(0,d.useRef)(null),w=(0,d.useId)(),T=(0,d.useId)();return g(C,t,n,c),_(t),t?(0,u.createPortal)((0,f.jsxs)(`div`,{className:i(`fixed inset-0 z-50 flex`,e===`right`&&`justify-end`,e===`bottom`&&`items-end`,e===`center`&&`items-center justify-center p-4`),children:[(0,f.jsx)(`div`,{className:`absolute inset-0 bg-overlay`,"aria-hidden":!0,onClick:m?n:void 0}),(0,f.jsxs)(`div`,{ref:C,role:`dialog`,"aria-modal":`true`,"aria-labelledby":w,"aria-describedby":a?T:void 0,tabIndex:-1,style:S,className:i(`relative flex flex-col bg-surface text-text shadow-pop outline-none`,e===`right`&&`h-full max-w-full border-l border-border safe-pt safe-pb`,e===`bottom`&&(x?`h-dvh w-full safe-pt safe-pb`:`max-h-[90dvh] w-full rounded-t-xl border-t border-border safe-pb`),e===`center`&&`max-h-[min(90dvh,720px)] w-full max-w-lg rounded-xl border border-border`,v),children:[e===`bottom`&&!x&&(0,f.jsx)(`div`,{className:`flex justify-center pt-2`,"aria-hidden":!0,children:(0,f.jsx)(`div`,{className:`h-1 w-10 rounded-full bg-border-strong`})}),(0,f.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-border px-4 py-3`,children:[(0,f.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,f.jsx)(`h2`,{id:w,className:`text-base font-semibold leading-6`,children:r}),a&&(0,f.jsx)(`p`,{id:T,className:`text-sm text-muted`,children:a})]}),h,(0,f.jsx)(p,{label:`Close`,icon:(0,f.jsx)(l,{className:`size-4`}),onClick:n})]}),(0,f.jsx)(`div`,{className:i(`min-h-0 flex-1 overflow-y-auto overscroll-contain`,!y&&`px-4 py-3`,b),children:o}),s&&(0,f.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2 border-t border-border px-4 py-3`,children:s})]})]}),document.body):null}function y({width:e=520,...t}){return(0,f.jsx)(v,{...t,placement:`right`,style:{width:`min(${e}px, 100vw)`}})}function b(e){return(0,f.jsx)(v,{...e,placement:`bottom`})}function x(e){return(0,f.jsx)(v,{...e,placement:`center`})}function S({open:e,onClose:t,title:n,description:r,confirmLabel:i,onConfirm:l,busy:u,error:d,errorTitle:p,danger:m=!0,confirmIcon:h,confirmDisabled:g,disabledReason:_,children:v}){return(0,f.jsx)(x,{open:e,onClose:u?()=>void 0:t,dismissOnBackdrop:!u,title:n,description:r,footer:(0,f.jsxs)(f.Fragment,{children:[g&&_&&(0,f.jsx)(`p`,{className:`mr-auto min-w-0 flex-1 basis-full text-xs text-muted sm:basis-auto`,children:_}),(0,f.jsx)(o,{onClick:t,disabled:u,children:`Cancel`}),(0,f.jsx)(o,{variant:m?`danger`:`primary`,icon:h,busy:u,disabled:g,onClick:l,children:i})]}),children:(0,f.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[v,p?!!d&&(0,f.jsx)(s,{compact:!0,title:p,error:c(d)}):(0,f.jsx)(a,{error:d})]})})}export{g as a,b as i,x as n,p as o,y as r,S as t};
|
|
2
|
+
//# sourceMappingURL=Overlay-BNPvMjLX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Overlay-DUQwh6_b.js","names":["forwardRef","useRef","useRef","useId","createPortal","_Fragment","__toESM","require_react","require_jsx_runtime","cn","InlineError","Button","ErrorState","errorMessage","X","require_react_dom","import_react_dom","import_react","import_jsx_runtime","IconButton","rest","type","label","size","variant","className","icon","FOCUSABLE","focusableWithin","root","el","useFocusTrap","escRef","onEscape","triggerRef","wasActive","active","ref","captured","previous","target","initialFocus","raf","onKey","items","first","last","activeEl","useScrollLock","prev","Surface","titleId","descId","open","onClose","placement","dismissOnBackdrop","description","fullHeight","title","headerActions","flush","bodyClassName","footer","Drawer","props","width","Sheet","Dialog","ConfirmDialog","busy","confirmDisabled","disabledReason","danger","confirmIcon","onConfirm","confirmLabel","children","errorTitle","error"],"sources":["../../src/components/ui/IconButton.tsx","../../src/components/ui/useFocusTrap.ts","../../src/components/ui/Overlay.tsx"],"sourcesContent":["import { type ButtonHTMLAttributes, forwardRef, type ReactNode } from \"react\";\nimport { cn } from \"../../lib/cn\";\n\nexport interface IconButtonProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"aria-label\"> {\n /** Accessible name (also the tooltip). Required: icon-only controls need a label. */\n label: string;\n icon: ReactNode;\n variant?: \"ghost\" | \"secondary\" | \"danger\";\n size?: \"sm\" | \"md\";\n}\n\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n { label, icon, variant = \"ghost\", size = \"md\", className, type, ...rest },\n ref,\n) {\n return (\n <button\n ref={ref}\n type={type ?? \"button\"}\n aria-label={label}\n title={label}\n className={cn(\n \"tap inline-flex shrink-0 items-center justify-center rounded-md border transition-colors\",\n \"disabled:opacity-55 disabled:pointer-events-none\",\n size === \"sm\" ? \"size-8\" : \"size-9\",\n variant === \"ghost\" && \"border-transparent text-muted hover:bg-surface-2 hover:text-text\",\n variant === \"secondary\" && \"border-border bg-surface text-text hover:bg-surface-2\",\n variant === \"danger\" && \"border-transparent text-danger hover:bg-danger-soft\",\n className,\n )}\n {...rest}\n >\n {icon}\n </button>\n );\n});\n","import { type RefObject, useEffect, useRef } from \"react\";\n\nconst FOCUSABLE =\n 'a[href], area[href], button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), textarea:not([disabled]), iframe, [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"]';\n\nexport function focusableWithin(root: HTMLElement): HTMLElement[] {\n return [...root.querySelectorAll<HTMLElement>(FOCUSABLE)].filter(\n (el) => !el.hasAttribute(\"inert\") && el.getClientRects().length > 0,\n );\n}\n\n/**\n * Modal focus management: moves focus into `ref` when `active`, keeps Tab\n * inside it, closes on Escape, and returns focus to the element that had it\n * (the trigger) when deactivated.\n */\nexport function useFocusTrap(\n ref: RefObject<HTMLElement | null>,\n active: boolean,\n onEscape?: () => void,\n initialFocus?: RefObject<HTMLElement | null>,\n): void {\n const escRef = useRef(onEscape);\n escRef.current = onEscape;\n // Remember the trigger while rendering the opening frame: by the time effects run, an\n // `autoFocus` field inside the surface has already taken focus.\n const triggerRef = useRef<HTMLElement | null>(null);\n const wasActive = useRef(false);\n if (active && !wasActive.current && typeof document !== \"undefined\") {\n triggerRef.current = document.activeElement as HTMLElement | null;\n }\n wasActive.current = active;\n useEffect(() => {\n if (!active) return;\n const root = ref.current;\n if (!root) return;\n const captured = triggerRef.current;\n const previous =\n captured && !root.contains(captured)\n ? captured\n : (document.activeElement as HTMLElement | null);\n const target = initialFocus?.current ?? focusableWithin(root)[0] ?? root;\n // Defer so the element is laid out (portals, transitions).\n // An `autoFocus` field inside keeps its focus unless an explicit initial focus was given.\n const raf = requestAnimationFrame(() => {\n if (!initialFocus?.current && root.contains(document.activeElement)) return;\n target.focus({ preventScroll: true });\n });\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Escape\" && escRef.current) {\n e.stopPropagation();\n escRef.current();\n return;\n }\n if (e.key !== \"Tab\") return;\n const items = focusableWithin(root);\n if (items.length === 0) {\n e.preventDefault();\n root.focus();\n return;\n }\n const first = items[0]!;\n const last = items[items.length - 1]!;\n const activeEl = document.activeElement;\n if (e.shiftKey && (activeEl === first || !root.contains(activeEl))) {\n e.preventDefault();\n last.focus();\n } else if (!e.shiftKey && (activeEl === last || !root.contains(activeEl))) {\n e.preventDefault();\n first.focus();\n }\n };\n root.addEventListener(\"keydown\", onKey);\n return () => {\n cancelAnimationFrame(raf);\n root.removeEventListener(\"keydown\", onKey);\n if (previous && document.contains(previous)) previous.focus({ preventScroll: true });\n };\n }, [active, ref, initialFocus]);\n}\n\n/** Lock body scroll while a modal surface is open. */\nexport function useScrollLock(active: boolean): void {\n useEffect(() => {\n if (!active) return;\n const prev = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n return () => {\n document.body.style.overflow = prev;\n };\n }, [active]);\n}\n","import { X } from \"lucide-react\";\nimport { type ReactNode, type RefObject, useId, useRef } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { cn } from \"../../lib/cn\";\nimport { errorMessage } from \"../../sync/api\";\nimport { Button } from \"./Button\";\nimport { IconButton } from \"./IconButton\";\nimport { ErrorState, InlineError } from \"./states\";\nimport { useFocusTrap, useScrollLock } from \"./useFocusTrap\";\n\nexport interface OverlayProps {\n open: boolean;\n onClose: () => void;\n /** Visible heading; also the accessible name. */\n title: ReactNode;\n /** Accessible description shown under the title. */\n description?: ReactNode;\n children?: ReactNode;\n /** Sticky footer (actions). */\n footer?: ReactNode;\n /** Element to focus first (defaults to the first focusable). */\n initialFocus?: RefObject<HTMLElement | null>;\n /** Close when the backdrop is clicked (default true). */\n dismissOnBackdrop?: boolean;\n /** Extra header controls before the close button. */\n headerActions?: ReactNode;\n className?: string;\n /** No padding around the body (for content that draws its own edges). */\n flush?: boolean;\n /** Extra body classes. Additive only: it cannot override the padding, use `flush`. */\n bodyClassName?: string;\n /** Bottom sheet only: fill the viewport height. */\n fullHeight?: boolean;\n}\n\ntype Placement = \"right\" | \"bottom\" | \"center\";\n\nfunction Surface({\n placement,\n open,\n onClose,\n title,\n description,\n children,\n footer,\n initialFocus,\n dismissOnBackdrop = true,\n headerActions,\n className,\n flush,\n bodyClassName,\n fullHeight,\n style,\n}: OverlayProps & { placement: Placement; style?: React.CSSProperties }) {\n const ref = useRef<HTMLDivElement>(null);\n const titleId = useId();\n const descId = useId();\n useFocusTrap(ref, open, onClose, initialFocus);\n useScrollLock(open);\n if (!open) return null;\n return createPortal(\n <div\n className={cn(\n \"fixed inset-0 z-50 flex\",\n placement === \"right\" && \"justify-end\",\n placement === \"bottom\" && \"items-end\",\n placement === \"center\" && \"items-center justify-center p-4\",\n )}\n >\n <div\n className=\"absolute inset-0 bg-overlay\"\n aria-hidden\n onClick={dismissOnBackdrop ? onClose : undefined}\n />\n <div\n ref={ref}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId}\n aria-describedby={description ? descId : undefined}\n tabIndex={-1}\n style={style}\n className={cn(\n \"relative flex flex-col bg-surface text-text shadow-pop outline-none\",\n placement === \"right\" && \"h-full max-w-full border-l border-border safe-pt safe-pb\",\n placement === \"bottom\" &&\n (fullHeight\n ? \"h-dvh w-full safe-pt safe-pb\"\n : \"max-h-[90dvh] w-full rounded-t-xl border-t border-border safe-pb\"),\n placement === \"center\" &&\n \"max-h-[min(90dvh,720px)] w-full max-w-lg rounded-xl border border-border\",\n className,\n )}\n >\n {placement === \"bottom\" && !fullHeight && (\n <div className=\"flex justify-center pt-2\" aria-hidden>\n <div className=\"h-1 w-10 rounded-full bg-border-strong\" />\n </div>\n )}\n <div className=\"flex items-start gap-2 border-b border-border px-4 py-3\">\n <div className=\"min-w-0 flex-1\">\n <h2 id={titleId} className=\"text-base font-semibold leading-6\">\n {title}\n </h2>\n {description && (\n <p id={descId} className=\"text-sm text-muted\">\n {description}\n </p>\n )}\n </div>\n {headerActions}\n <IconButton label=\"Close\" icon={<X className=\"size-4\" />} onClick={onClose} />\n </div>\n <div\n className={cn(\n \"min-h-0 flex-1 overflow-y-auto overscroll-contain\",\n !flush && \"px-4 py-3\",\n bodyClassName,\n )}\n >\n {children}\n </div>\n {footer && (\n <div className=\"flex flex-wrap items-center justify-end gap-2 border-t border-border px-4 py-3\">\n {footer}\n </div>\n )}\n </div>\n </div>,\n document.body,\n );\n}\n\nexport interface DrawerProps extends OverlayProps {\n /** Width in px (default 520, the task drawer width). Never wider than the viewport. */\n width?: number;\n}\n\n/** Right-side drawer with focus trap, Escape to close, and focus returned to the trigger. */\nexport function Drawer({ width = 520, ...props }: DrawerProps) {\n return <Surface {...props} placement=\"right\" style={{ width: `min(${width}px, 100vw)` }} />;\n}\n\n/** Bottom sheet for mobile; same accessibility behavior as Drawer. */\nexport function Sheet(props: OverlayProps) {\n return <Surface {...props} placement=\"bottom\" />;\n}\n\n/** Centered modal dialog. */\nexport function Dialog(props: OverlayProps) {\n return <Surface {...props} placement=\"center\" />;\n}\n\nexport interface ConfirmDialogProps {\n open: boolean;\n onClose: () => void;\n title: ReactNode;\n description?: ReactNode;\n confirmLabel: string;\n onConfirm: () => void;\n busy?: boolean;\n error?: unknown;\n /** Heading for the error; renders a titled error panel instead of the plain message. */\n errorTitle?: string;\n danger?: boolean;\n /** Icon before the confirm label. */\n confirmIcon?: ReactNode;\n confirmDisabled?: boolean;\n /** Shown next to the actions when the confirm button is disabled. */\n disabledReason?: ReactNode;\n children?: ReactNode;\n}\n\n/**\n * Confirmation dialog. Never closes on its own: the caller closes it after the\n * server acknowledges (no optimistic success). It cannot be dismissed while busy.\n */\nexport function ConfirmDialog({\n open,\n onClose,\n title,\n description,\n confirmLabel,\n onConfirm,\n busy,\n error,\n errorTitle,\n danger = true,\n confirmIcon,\n confirmDisabled,\n disabledReason,\n children,\n}: ConfirmDialogProps) {\n return (\n <Dialog\n open={open}\n onClose={busy ? () => undefined : onClose}\n dismissOnBackdrop={!busy}\n title={title}\n description={description}\n footer={\n <>\n {confirmDisabled && disabledReason && (\n <p className=\"mr-auto min-w-0 flex-1 basis-full text-xs text-muted sm:basis-auto\">\n {disabledReason}\n </p>\n )}\n <Button onClick={onClose} disabled={busy}>\n Cancel\n </Button>\n <Button\n variant={danger ? \"danger\" : \"primary\"}\n icon={confirmIcon}\n busy={busy}\n disabled={confirmDisabled}\n onClick={onConfirm}\n >\n {confirmLabel}\n </Button>\n </>\n }\n >\n <div className=\"flex flex-col gap-3\">\n {children}\n {errorTitle ? (\n !!error && <ErrorState compact title={errorTitle} error={errorMessage(error)} />\n ) : (\n <InlineError error={error} />\n )}\n </div>\n </Dialog>\n );\n}\n"],"mappings":"A,6MAYamB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EAAD,CACE,QAAS8D,EAAS,SAAW,UAC7B,KAAMC,EACA,OACN,SAAUH,EACV,QAASI,EAER,SAAAC,CACK,CAAA,CACR,CAAA,CAAA,EAGJ,UAAA,EAAA1D,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,sBAAf,SAAA,CACG2D,EACAC,EACC,CAAC,CAACC,IAAS,EAAA7D,EAAA,IAAA,CAACN,EAAD,CAAY,QAAA,GAAQ,MAAOkE,EAAY,MAAOjE,EAAakE,CAAK,CAAI,CAAA,GAE/E,EAAA7D,EAAA,IAAA,CAACR,EAAD,CAAoB,OAAQ,CAAA,CAE3B,C,EACC,CAAA,CAEZ,C"}
|
|
1
|
+
{"version":3,"file":"Overlay-BNPvMjLX.js","names":["forwardRef","useRef","useRef","useId","createPortal","_Fragment","__toESM","require_react","require_jsx_runtime","require_react_dom","cn","Button","ErrorState","errorMessage","X","import_react_dom","import_react","import_jsx_runtime","IconButton","rest","type","label","size","variant","className","icon","FOCUSABLE","focusableWithin","root","el","useFocusTrap","escRef","onEscape","triggerRef","wasActive","active","ref","captured","previous","target","initialFocus","raf","onKey","items","first","last","activeEl","useScrollLock","prev","Surface","titleId","descId","open","onClose","placement","dismissOnBackdrop","description","fullHeight","title","headerActions","flush","bodyClassName","footer","Drawer","props","width","Sheet","Dialog","ConfirmDialog","busy","confirmDisabled","disabledReason","danger","confirmIcon","onConfirm","confirmLabel","children","errorTitle","error","InlineError"],"sources":["../../src/components/ui/IconButton.tsx","../../src/components/ui/useFocusTrap.ts","../../src/components/ui/Overlay.tsx"],"sourcesContent":["import { type ButtonHTMLAttributes, forwardRef, type ReactNode } from \"react\";\nimport { cn } from \"../../lib/cn\";\n\nexport interface IconButtonProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"aria-label\"> {\n /** Accessible name (also the tooltip). Required: icon-only controls need a label. */\n label: string;\n icon: ReactNode;\n variant?: \"ghost\" | \"secondary\" | \"danger\";\n size?: \"sm\" | \"md\";\n}\n\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n { label, icon, variant = \"ghost\", size = \"md\", className, type, ...rest },\n ref,\n) {\n return (\n <button\n ref={ref}\n type={type ?? \"button\"}\n aria-label={label}\n title={label}\n className={cn(\n \"tap inline-flex shrink-0 items-center justify-center rounded-md border transition-colors\",\n \"disabled:opacity-55 disabled:pointer-events-none\",\n size === \"sm\" ? \"size-8\" : \"size-9\",\n variant === \"ghost\" && \"border-transparent text-muted hover:bg-surface-2 hover:text-text\",\n variant === \"secondary\" && \"border-border bg-surface text-text hover:bg-surface-2\",\n variant === \"danger\" && \"border-transparent text-danger hover:bg-danger-soft\",\n className,\n )}\n {...rest}\n >\n {icon}\n </button>\n );\n});\n","import { type RefObject, useEffect, useRef } from \"react\";\n\nconst FOCUSABLE =\n 'a[href], area[href], button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), textarea:not([disabled]), iframe, [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"]';\n\nexport function focusableWithin(root: HTMLElement): HTMLElement[] {\n return [...root.querySelectorAll<HTMLElement>(FOCUSABLE)].filter(\n (el) => !el.hasAttribute(\"inert\") && el.getClientRects().length > 0,\n );\n}\n\n/**\n * Modal focus management: moves focus into `ref` when `active`, keeps Tab\n * inside it, closes on Escape, and returns focus to the element that had it\n * (the trigger) when deactivated.\n */\nexport function useFocusTrap(\n ref: RefObject<HTMLElement | null>,\n active: boolean,\n onEscape?: () => void,\n initialFocus?: RefObject<HTMLElement | null>,\n): void {\n const escRef = useRef(onEscape);\n escRef.current = onEscape;\n // Remember the trigger while rendering the opening frame: by the time effects run, an\n // `autoFocus` field inside the surface has already taken focus.\n const triggerRef = useRef<HTMLElement | null>(null);\n const wasActive = useRef(false);\n if (active && !wasActive.current && typeof document !== \"undefined\") {\n triggerRef.current = document.activeElement as HTMLElement | null;\n }\n wasActive.current = active;\n useEffect(() => {\n if (!active) return;\n const root = ref.current;\n if (!root) return;\n const captured = triggerRef.current;\n const previous =\n captured && !root.contains(captured)\n ? captured\n : (document.activeElement as HTMLElement | null);\n const target = initialFocus?.current ?? focusableWithin(root)[0] ?? root;\n // Defer so the element is laid out (portals, transitions).\n // An `autoFocus` field inside keeps its focus unless an explicit initial focus was given.\n const raf = requestAnimationFrame(() => {\n if (!initialFocus?.current && root.contains(document.activeElement)) return;\n target.focus({ preventScroll: true });\n });\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Escape\" && escRef.current) {\n e.stopPropagation();\n escRef.current();\n return;\n }\n if (e.key !== \"Tab\") return;\n const items = focusableWithin(root);\n if (items.length === 0) {\n e.preventDefault();\n root.focus();\n return;\n }\n const first = items[0]!;\n const last = items[items.length - 1]!;\n const activeEl = document.activeElement;\n if (e.shiftKey && (activeEl === first || !root.contains(activeEl))) {\n e.preventDefault();\n last.focus();\n } else if (!e.shiftKey && (activeEl === last || !root.contains(activeEl))) {\n e.preventDefault();\n first.focus();\n }\n };\n root.addEventListener(\"keydown\", onKey);\n return () => {\n cancelAnimationFrame(raf);\n root.removeEventListener(\"keydown\", onKey);\n if (previous && document.contains(previous)) previous.focus({ preventScroll: true });\n };\n }, [active, ref, initialFocus]);\n}\n\n/** Lock body scroll while a modal surface is open. */\nexport function useScrollLock(active: boolean): void {\n useEffect(() => {\n if (!active) return;\n const prev = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n return () => {\n document.body.style.overflow = prev;\n };\n }, [active]);\n}\n","import { X } from \"lucide-react\";\nimport { type ReactNode, type RefObject, useId, useRef } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { cn } from \"../../lib/cn\";\nimport { errorMessage } from \"../../sync/api\";\nimport { Button } from \"./Button\";\nimport { IconButton } from \"./IconButton\";\nimport { ErrorState, InlineError } from \"./states\";\nimport { useFocusTrap, useScrollLock } from \"./useFocusTrap\";\n\nexport interface OverlayProps {\n open: boolean;\n onClose: () => void;\n /** Visible heading; also the accessible name. */\n title: ReactNode;\n /** Accessible description shown under the title. */\n description?: ReactNode;\n children?: ReactNode;\n /** Sticky footer (actions). */\n footer?: ReactNode;\n /** Element to focus first (defaults to the first focusable). */\n initialFocus?: RefObject<HTMLElement | null>;\n /** Close when the backdrop is clicked (default true). */\n dismissOnBackdrop?: boolean;\n /** Extra header controls before the close button. */\n headerActions?: ReactNode;\n className?: string;\n /** No padding around the body (for content that draws its own edges). */\n flush?: boolean;\n /** Extra body classes. Additive only: it cannot override the padding, use `flush`. */\n bodyClassName?: string;\n /** Bottom sheet only: fill the viewport height. */\n fullHeight?: boolean;\n}\n\ntype Placement = \"right\" | \"bottom\" | \"center\";\n\nfunction Surface({\n placement,\n open,\n onClose,\n title,\n description,\n children,\n footer,\n initialFocus,\n dismissOnBackdrop = true,\n headerActions,\n className,\n flush,\n bodyClassName,\n fullHeight,\n style,\n}: OverlayProps & { placement: Placement; style?: React.CSSProperties }) {\n const ref = useRef<HTMLDivElement>(null);\n const titleId = useId();\n const descId = useId();\n useFocusTrap(ref, open, onClose, initialFocus);\n useScrollLock(open);\n if (!open) return null;\n return createPortal(\n <div\n className={cn(\n \"fixed inset-0 z-50 flex\",\n placement === \"right\" && \"justify-end\",\n placement === \"bottom\" && \"items-end\",\n placement === \"center\" && \"items-center justify-center p-4\",\n )}\n >\n <div\n className=\"absolute inset-0 bg-overlay\"\n aria-hidden\n onClick={dismissOnBackdrop ? onClose : undefined}\n />\n <div\n ref={ref}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId}\n aria-describedby={description ? descId : undefined}\n tabIndex={-1}\n style={style}\n className={cn(\n \"relative flex flex-col bg-surface text-text shadow-pop outline-none\",\n placement === \"right\" && \"h-full max-w-full border-l border-border safe-pt safe-pb\",\n placement === \"bottom\" &&\n (fullHeight\n ? \"h-dvh w-full safe-pt safe-pb\"\n : \"max-h-[90dvh] w-full rounded-t-xl border-t border-border safe-pb\"),\n placement === \"center\" &&\n \"max-h-[min(90dvh,720px)] w-full max-w-lg rounded-xl border border-border\",\n className,\n )}\n >\n {placement === \"bottom\" && !fullHeight && (\n <div className=\"flex justify-center pt-2\" aria-hidden>\n <div className=\"h-1 w-10 rounded-full bg-border-strong\" />\n </div>\n )}\n <div className=\"flex items-start gap-2 border-b border-border px-4 py-3\">\n <div className=\"min-w-0 flex-1\">\n <h2 id={titleId} className=\"text-base font-semibold leading-6\">\n {title}\n </h2>\n {description && (\n <p id={descId} className=\"text-sm text-muted\">\n {description}\n </p>\n )}\n </div>\n {headerActions}\n <IconButton label=\"Close\" icon={<X className=\"size-4\" />} onClick={onClose} />\n </div>\n <div\n className={cn(\n \"min-h-0 flex-1 overflow-y-auto overscroll-contain\",\n !flush && \"px-4 py-3\",\n bodyClassName,\n )}\n >\n {children}\n </div>\n {footer && (\n <div className=\"flex flex-wrap items-center justify-end gap-2 border-t border-border px-4 py-3\">\n {footer}\n </div>\n )}\n </div>\n </div>,\n document.body,\n );\n}\n\nexport interface DrawerProps extends OverlayProps {\n /** Width in px (default 520, the task drawer width). Never wider than the viewport. */\n width?: number;\n}\n\n/** Right-side drawer with focus trap, Escape to close, and focus returned to the trigger. */\nexport function Drawer({ width = 520, ...props }: DrawerProps) {\n return <Surface {...props} placement=\"right\" style={{ width: `min(${width}px, 100vw)` }} />;\n}\n\n/** Bottom sheet for mobile; same accessibility behavior as Drawer. */\nexport function Sheet(props: OverlayProps) {\n return <Surface {...props} placement=\"bottom\" />;\n}\n\n/** Centered modal dialog. */\nexport function Dialog(props: OverlayProps) {\n return <Surface {...props} placement=\"center\" />;\n}\n\nexport interface ConfirmDialogProps {\n open: boolean;\n onClose: () => void;\n title: ReactNode;\n description?: ReactNode;\n confirmLabel: string;\n onConfirm: () => void;\n busy?: boolean;\n error?: unknown;\n /** Heading for the error; renders a titled error panel instead of the plain message. */\n errorTitle?: string;\n danger?: boolean;\n /** Icon before the confirm label. */\n confirmIcon?: ReactNode;\n confirmDisabled?: boolean;\n /** Shown next to the actions when the confirm button is disabled. */\n disabledReason?: ReactNode;\n children?: ReactNode;\n}\n\n/**\n * Confirmation dialog. Never closes on its own: the caller closes it after the\n * server acknowledges (no optimistic success). It cannot be dismissed while busy.\n */\nexport function ConfirmDialog({\n open,\n onClose,\n title,\n description,\n confirmLabel,\n onConfirm,\n busy,\n error,\n errorTitle,\n danger = true,\n confirmIcon,\n confirmDisabled,\n disabledReason,\n children,\n}: ConfirmDialogProps) {\n return (\n <Dialog\n open={open}\n onClose={busy ? () => undefined : onClose}\n dismissOnBackdrop={!busy}\n title={title}\n description={description}\n footer={\n <>\n {confirmDisabled && disabledReason && (\n <p className=\"mr-auto min-w-0 flex-1 basis-full text-xs text-muted sm:basis-auto\">\n {disabledReason}\n </p>\n )}\n <Button onClick={onClose} disabled={busy}>\n Cancel\n </Button>\n <Button\n variant={danger ? \"danger\" : \"primary\"}\n icon={confirmIcon}\n busy={busy}\n disabled={confirmDisabled}\n onClick={onConfirm}\n >\n {confirmLabel}\n </Button>\n </>\n }\n >\n <div className=\"flex flex-col gap-3\">\n {children}\n {errorTitle ? (\n !!error && <ErrorState compact title={errorTitle} error={errorMessage(error)} />\n ) : (\n <InlineError error={error} />\n )}\n </div>\n </Dialog>\n );\n}\n"],"mappings":"A,qPAYakB,GAAA,EAAalB,EAAAA,WAAAA,CAA+C,SACvE,CAAE,QAAO,OAAM,UAAU,QAAS,OAAO,KAAM,YAAW,OAAM,GAAGmB,GACnE,EACA,CACA,OACE,EAAAF,EAAA,IAAA,CAAC,SAAD,CACO,MACL,KAAMG,GAAQ,SACd,aAAYC,EACZ,MAAOA,EACP,UAAWX,EACT,2FACA,mDACAY,IAAS,KAAO,SAAW,SAC3BC,IAAY,SAAW,mEACvBA,IAAY,aAAe,wDAC3BA,IAAY,UAAY,sDACxBC,CACF,EACA,GAAIL,EAEH,SAAAM,CACK,CAAA,CAEZ,CAAC,EClCKC,EACJ,+MAEF,SAAgBC,EAAgB,EAAkC,CAChE,MAAO,CAAC,GAAGC,EAAK,iBAA8BF,CAAS,CAAC,CAAC,CAAC,OACvD,GAAO,CAACG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Chip-BYuVxYS7.js";import{_ as r,lt as i}from"./states-C773NlHo.js";import{t as a}from"./arrow-down-C-iLrN8I.js";import{t as o}from"./arrow-up-Dj-VTKx4.js";import{t as s}from"./Select-C9L1HKMm.js";var c={name:`chevrons-up`,size:24,node:[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]};c.node;var l=e(c),u={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};u.node;var d=e(u),f=t(),p={0:{label:i[0],icon:l,tone:`danger`},1:{label:i[1],icon:o,tone:`warning`},2:{label:i[2],icon:d,tone:`neutral`},3:{label:i[3],icon:a,tone:`neutral`}};function m({priority:e,className:t,colored:i=!0}){let a=p[e]??p[2],o=a.icon;return(0,f.jsx)(o,{"aria-hidden":!0,className:r(`shrink-0`,i&&n[a.tone],t??`size-4`)})}function h({priority:e,className:t,suffix:i,muted:a}){let o=p[e]??p[2];return(0,f.jsxs)(`span`,{className:r(`inline-flex items-center gap-1`,a?`text-muted`:n[o.tone],t),children:[(0,f.jsx)(m,{priority:e,className:`size-3.5`}),o.label,i]})}function g({value:e,onChange:t,...n}){return(0,f.jsx)(s,{...n,value:e,onChange:e=>t(Number(e.target.value)),children:i.map((e,t)=>(0,f.jsx)(`option`,{value:t,children:e},e))})}export{h as n,g as r,m as t};
|
|
2
|
+
//# sourceMappingURL=Priority-Ca1B2yFr.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Priority-
|
|
1
|
+
{"version":3,"file":"Priority-Ca1B2yFr.js","names":["__iconData","createLucideIcon","TONE_TEXT","cn","PRIORITY_LABELS","ArrowDown","ArrowUp","Select","__iconData$1","ChevronsUp","__iconData","Minus","import_jsx_runtime","require_jsx_runtime","PRIORITY_INFO","PriorityIcon","info","priority","Icon","colored","className","PriorityLabel","muted","suffix","PrioritySelect","rest","onChange","i","label"],"sources":["../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/chevrons-up.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/minus.mjs","../../src/components/ui/Priority.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"chevrons-up\",\n size: 24,\n node: [\n [\"path\", { d: \"m17 11-5-5-5 5\", key: \"e8nh98\" }],\n [\"path\", { d: \"m17 18-5-5-5 5\", key: \"2avn1x\" }]\n ]\n};\n__iconData.node;\nconst ChevronsUp = createLucideIcon(__iconData);\n\nexport { __iconData, ChevronsUp as default };\n//# sourceMappingURL=chevrons-up.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"minus\",\n size: 24,\n node: [[\"path\", { d: \"M5 12h14\", key: \"1ays0h\" }]]\n};\n__iconData.node;\nconst Minus = createLucideIcon(__iconData);\n\nexport { __iconData, Minus as default };\n//# sourceMappingURL=minus.mjs.map\n","import type { Priority } from \"@switchyard/protocol\";\nimport { PRIORITY_LABELS } from \"@switchyard/protocol\";\nimport { ArrowDown, ArrowUp, ChevronsUp, Minus } from \"lucide-react\";\nimport { cn } from \"../../lib/cn\";\nimport { TONE_TEXT } from \"./Badge\";\nimport { Select, type SelectProps } from \"./Select\";\nimport type { StatusInfo } from \"./StatusChip\";\n\nexport const PRIORITY_INFO: Record<Priority, StatusInfo> = {\n 0: { label: PRIORITY_LABELS[0], icon: ChevronsUp, tone: \"danger\" },\n 1: { label: PRIORITY_LABELS[1], icon: ArrowUp, tone: \"warning\" },\n 2: { label: PRIORITY_LABELS[2], icon: Minus, tone: \"neutral\" },\n 3: { label: PRIORITY_LABELS[3], icon: ArrowDown, tone: \"neutral\" },\n};\n\n/** The priority's icon. `className` replaces the default size (size-4). */\nexport function PriorityIcon({\n priority,\n className,\n colored = true,\n}: {\n priority: Priority;\n className?: string;\n /** Tint with the priority's tone (default true). */\n colored?: boolean;\n}) {\n const info = PRIORITY_INFO[priority] ?? PRIORITY_INFO[2];\n const Icon = info.icon;\n return (\n <Icon\n aria-hidden\n className={cn(\"shrink-0\", colored && TONE_TEXT[info.tone], className ?? \"size-4\")}\n />\n );\n}\n\n/** Icon plus label. The text takes the tone unless `muted`; the icon always does. */\nexport function PriorityLabel({\n priority,\n className,\n suffix,\n muted,\n}: {\n priority: Priority;\n className?: string;\n /** Appended to the label, e.g. \" priority\". */\n suffix?: string;\n muted?: boolean;\n}) {\n const info = PRIORITY_INFO[priority] ?? PRIORITY_INFO[2];\n return (\n <span\n className={cn(\n \"inline-flex items-center gap-1\",\n muted ? \"text-muted\" : TONE_TEXT[info.tone],\n className,\n )}\n >\n <PriorityIcon priority={priority} className=\"size-3.5\" />\n {info.label}\n {suffix}\n </span>\n );\n}\n\n/** Select of the four priorities. Give it a label with Field or a <label>. */\nexport function PrioritySelect({\n value,\n onChange,\n ...rest\n}: Omit<SelectProps, \"value\" | \"onChange\" | \"children\"> & {\n value: Priority;\n onChange(p: Priority): void;\n}) {\n return (\n <Select {...rest} value={value} onChange={(e) => onChange(Number(e.target.value) as Priority)}>\n {PRIORITY_LABELS.map((label, i) => (\n <option key={label} value={i}>\n {label}\n </option>\n ))}\n </Select>\n );\n}\n"],"ignoreList":[0,1],"mappings":"A,+QASA,IAAMA,EAAa,CACjB,KAAM,cACN,KAAM,GACN,KAAM,CACJ,CAAC,OAAQ,CAAE,EAAG,iBAAkB,IAAK,QAAS,CAAC,EAC/C,CAAC,OAAQ,CAAE,EAAG,iBAAkB,IAAK,QAAS,CAAC,CACjD,CACF,EACAA,EAAW,KACX,IAAMS,EAAaR,EAAi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AAA,CAAC,SAAD,CAAoB,MAAOe,EACxB,SAAAC,CACK,EAFKA,CAEL,CACT,CACK,CAAA,CAEZ,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-D13aM9HY.js";import{_ as t}from"./states-
|
|
2
|
-
//# sourceMappingURL=SegmentedControl-
|
|
1
|
+
import{t as e}from"./jsx-runtime-D13aM9HY.js";import{_ as t}from"./states-C773NlHo.js";var n=e();function r({options:e,value:r,onChange:i,label:a,className:o,block:s}){let c=e.findIndex(e=>e.value===r);return(0,n.jsx)(`div`,{role:`radiogroup`,"aria-label":a,className:t(`inline-flex rounded-lg border border-border bg-surface-2 p-0.5`,s&&`flex w-full`,o),onKeyDown:t=>{let n=-1;t.key===`ArrowRight`||t.key===`ArrowDown`?n=(c+1)%e.length:(t.key===`ArrowLeft`||t.key===`ArrowUp`)&&(n=(c-1+e.length)%e.length),!(n<0)&&(t.preventDefault(),i(e[n].value),t.currentTarget.querySelectorAll(`[role="radio"]`)[n]?.focus())},children:e.map(e=>{let a=e.value===r;return(0,n.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":a,tabIndex:a?0:-1,onClick:()=>i(e.value),className:t(`tap inline-flex min-h-8 flex-1 items-center justify-center gap-1.5 rounded-md px-3 text-sm font-medium whitespace-nowrap`,a?`bg-surface text-text shadow-sm border border-border`:`text-muted hover:text-text border border-transparent`),children:[e.icon,e.label,e.badge]},e.value)})})}export{r as t};
|
|
2
|
+
//# sourceMappingURL=SegmentedControl-D2d-NEr-.js.map
|
package/web-dist/assets/{SegmentedControl-C_hEVQMB.js.map → SegmentedControl-D2d-NEr-.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl-
|
|
1
|
+
{"version":3,"file":"SegmentedControl-D2d-NEr-.js","names":["require_jsx_runtime","cn","import_jsx_runtime","SegmentedControl","idx","options","o","value","label","block","className","next","e","onChange","selected"],"sources":["../../src/components/ui/SegmentedControl.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { cn } from \"../../lib/cn\";\n\nexport interface SegmentOption<T extends string> {\n value: T;\n label: ReactNode;\n icon?: ReactNode;\n badge?: ReactNode;\n}\n\nexport interface SegmentedControlProps<T extends string> {\n options: SegmentOption<T>[];\n value: T;\n onChange: (value: T) => void;\n /** Accessible name. */\n label: string;\n className?: string;\n block?: boolean;\n}\n\n/** Radio-group style switcher (e.g. mobile Chat / Changes / Details). */\nexport function SegmentedControl<T extends string>({\n options,\n value,\n onChange,\n label,\n className,\n block,\n}: SegmentedControlProps<T>) {\n const idx = options.findIndex((o) => o.value === value);\n return (\n <div\n role=\"radiogroup\"\n aria-label={label}\n className={cn(\n \"inline-flex rounded-lg border border-border bg-surface-2 p-0.5\",\n block && \"flex w-full\",\n className,\n )}\n onKeyDown={(e) => {\n let next = -1;\n if (e.key === \"ArrowRight\" || e.key === \"ArrowDown\") next = (idx + 1) % options.length;\n else if (e.key === \"ArrowLeft\" || e.key === \"ArrowUp\")\n next = (idx - 1 + options.length) % options.length;\n if (next < 0) return;\n e.preventDefault();\n onChange(options[next]!.value);\n const btns = e.currentTarget.querySelectorAll<HTMLElement>('[role=\"radio\"]');\n btns[next]?.focus();\n }}\n >\n {options.map((o) => {\n const selected = o.value === value;\n return (\n // biome-ignore lint/a11y/useSemanticElements: button-based radio group (WAI-ARIA radio pattern)\n <button\n key={o.value}\n type=\"button\"\n role=\"radio\"\n aria-checked={selected}\n tabIndex={selected ? 0 : -1}\n onClick={() => onChange(o.value)}\n className={cn(\n \"tap inline-flex min-h-8 flex-1 items-center justify-center gap-1.5 rounded-md px-3 text-sm font-medium whitespace-nowrap\",\n selected\n ? \"bg-surface text-text shadow-sm border border-border\"\n : \"text-muted hover:text-text border border-transparent\",\n )}\n >\n {o.icon}\n {o.label}\n {o.badge}\n </button>\n );\n })}\n </div>\n );\n}\n"],"mappings":"A,iGAqBA,SAAgBG,EAAmC,CACjD,UACA,QACA,WACA,QACA,YACA,SAC2B,CAC3B,IAAMC,EAAMC,EAAQ,UAAW,GAAMC,EAAE,QAAUC,CAAK,EACtD,OACE,EAAAL,EAAA,IAAA,CAAC,MAAD,CACE,KAAK,aACL,aAAYM,EACZ,UAAWP,EACT,iEACAQ,GAAS,cACTC,CACF,EACA,UAAY,GAAM,CAChB,IAAIC,EAAO,GACPC,EAAE,MAAQ,cAAgBA,EAAE,MAAQ,YAAa,GAAQR,EAAM,GAAKC,EAAQ,QACvEO,EAAE,MAAQ,aAAeA,EAAE,MAAQ,aAC1C,GAAQR,EAAM,EAAIC,EAAQ,QAAUA,EAAQ,QAC1C,IAAO,KACXO,EAAE,eAAe,EACjBC,EAASR,EAAQM,EAAK,CAAE,KAAK,EAE7BC,EADe,cAAc,iBAA8B,gBAC3D,CAAA,CAAKD,EAAK,EAAE,MAAM,EACpB,EAEC,SAAAN,EAAQ,IAAK,GAAM,CAClB,IAAMS,EAAWR,EAAE,QAAUC,EAC7B,OAEE,EAAAL,EAAA,KAAA,CAAC,SAAD,CAEE,KAAK,SACL,KAAK,QACL,eAAcY,EACd,SAAUA,EAAW,EAAI,GACzB,YAAeD,EAASP,EAAE,KAAK,EAC/B,UAAWL,EACT,2HACAa,EACI,sDACA,sDACN,EAZF,SAAA,CAcGR,EAAE,KACFA,EAAE,MACFA,EAAE,KACG,CAhBD,EAAAA,EAAE,KAgBD,CAEZ,CAAC,CACE,CAAA,CAET,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as e,m as t,t as n}from"./jsx-runtime-D13aM9HY.js";import{_ as r}from"./states-
|
|
2
|
-
//# sourceMappingURL=Select-
|
|
1
|
+
import{_ as e,m as t,t as n}from"./jsx-runtime-D13aM9HY.js";import{_ as r}from"./states-C773NlHo.js";import{t as i}from"./TextArea-CKGHwURx.js";var a=e(t(),1),o=n(),s=(0,a.forwardRef)(function({className:e,width:t=`full`,children:n,...a},s){return(0,o.jsx)(`select`,{ref:s,className:r(`tap block h-9 min-w-0 px-2.5`,t===`auto`?`w-auto`:`w-full`,i,e),...a,children:n})});export{s as t};
|
|
2
|
+
//# sourceMappingURL=Select-C9L1HKMm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select-
|
|
1
|
+
{"version":3,"file":"Select-C9L1HKMm.js","names":["forwardRef","__toESM","require_react","require_jsx_runtime","cn","CONTROL_CLASSES","import_react","import_jsx_runtime","Select","rest","width","className"],"sources":["../../src/components/ui/Select.tsx"],"sourcesContent":["import { forwardRef, type SelectHTMLAttributes } from \"react\";\nimport { cn } from \"../../lib/cn\";\nimport { CONTROL_CLASSES } from \"./TextArea\";\n\nexport interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {\n /** \"full\" (default) fills its container; \"auto\" sizes to content for inline toolbars. */\n width?: \"full\" | \"auto\";\n}\n\n/** Native select with the same look, focus ring and invalid state as TextInput. */\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(function Select(\n { className, width = \"full\", children, ...rest },\n ref,\n) {\n return (\n <select\n ref={ref}\n className={cn(\n \"tap block h-9 min-w-0 px-2.5\",\n width === \"auto\" ? \"w-auto\" : \"w-full\",\n CONTROL_CLASSES,\n className,\n )}\n {...rest}\n >\n {children}\n </select>\n );\n});\n"],"mappings":"A,qKAUaQ,GAAA,EAASR,EAAAA,WAAAA,CAA2C,SAC/D,CAAE,YAAW,QAAQ,OAAQ,WAAU,GAAGS,GAC1C,EACA,CACA,OACE,EAAAF,EAAA,IAAA,CAAC,SAAD,CACO,MACL,UAAWH,EACT,+BACAM,IAAU,OAAS,SAAW,SAC9BL,EACAM,CACF,EACA,GAAIF,EAEH,UACK,CAAA,CAEZ,CAAC,E"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{h as e,m as t,n,t as r}from"./jsx-runtime-D13aM9HY.js";import{C as i,T as a,_ as o,ct as s,p as c,v as l,w as u,x as d}from"./states-C773NlHo.js";import{c as f,l as p,o as m,u as h}from"./useBreakpoint-BphHBrzF.js";var ee=e((e=>{var n=t();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return l(e,t,null,n)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.1`})),te=e(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=ee()})),g={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};g.node;var _=n(g),v={name:`ban`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]};v.node;var y=n(v),b={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};b.node;var x=n(b),S={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};S.node;var C=n(S),w={name:`circle-pause`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]],aliases:[`pause-circle`]};w.node;var T=n(w),E={name:`circle-play`,size:24,node:[[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]],aliases:[`play-circle`]};E.node;var D=n(E),O={name:`circle-slash`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]};O.node;var k=n(O),A={name:`cloud-off`,size:24,node:[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};A.node;var ne=n(A),j={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};j.node;var M=n(j),N={name:`hourglass`,size:24,node:[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]};N.node;var P=n(N),F={name:`list-checks`,size:24,node:[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]};F.node;var I=n(F),L={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};L.node;var R=n(L),z={name:`repeat`,size:24,node:[[`path`,{d:`m17 2 4 4-4 4`,key:`nntrym`}],[`path`,{d:`M3 11v-1a4 4 0 0 1 4-4h14`,key:`84bu3i`}],[`path`,{d:`m7 22-4-4 4-4`,key:`1wqhfi`}],[`path`,{d:`M21 13v1a4 4 0 0 1-4 4H3`,key:`1rx37r`}]]};z.node;var B=n(z),V={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};V.node;var H=n(V),U={name:`wifi`,size:24,node:[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]};U.node;var W=n(U),G=r(),K={neutral:`bg-surface-2 text-muted border-border`,info:`bg-info-soft text-info border-transparent`,success:`bg-success-soft text-success border-transparent`,warning:`bg-warning-soft text-warning border-transparent`,danger:`bg-danger-soft text-danger border-transparent`,accent:`bg-accent text-accent-fg border-transparent`},re={neutral:`text-muted`,info:`text-info`,success:`text-success`,warning:`text-warning`,danger:`text-danger`,accent:`text-accent`};function q({children:e,tone:t=`neutral`,label:n,className:r}){return(0,G.jsxs)(`span`,{className:o(`inline-flex min-w-5 items-center justify-center rounded-full border px-1.5 text-xs leading-5 font-medium tabular-nums`,K[t],r),title:n,children:[(0,G.jsx)(`span`,{"aria-hidden":n?!0:void 0,children:e}),n&&(0,G.jsx)(`span`,{className:`sr-only`,children:n})]})}function ie({count:e,label:t,tone:n=`danger`,className:r}){return e<=0?null:(0,G.jsx)(q,{tone:n,label:`${e} ${t}`,className:r,children:e>99?`99+`:e})}var J={starting:{label:`Starting…`,icon:R,tone:`info`,spin:!0},idle:{label:`Idle`,icon:C,tone:`neutral`},running:{label:`Running`,icon:_,tone:`info`,pulse:!0},waiting_input:{label:`Needs input`,icon:i,tone:`warning`},interrupted:{label:`Interrupted`,icon:T,tone:`warning`},failed:{label:`Failed`,icon:p,tone:`danger`},stopped:{label:`Stopped`,icon:H,tone:`neutral`}},ae={label:`Ready to review`,icon:M,tone:`success`},Y={backlog:{label:`Backlog`,icon:u,tone:`neutral`},ready:{label:`Ready`,icon:D,tone:`info`},in_progress:{label:`In progress`,icon:R,tone:`info`},review:{label:`Review`,icon:M,tone:`warning`},done:{label:`Done`,icon:h,tone:`success`},canceled:{label:`Canceled`,icon:y,tone:`neutral`}},X={queued:{label:`Queued`,icon:f,tone:`neutral`},dispatching:{label:`Dispatching…`,icon:R,tone:`info`,spin:!0},uncertain:{label:`Awaiting host confirmation`,icon:P,tone:`warning`},running:{label:`Running`,icon:_,tone:`info`,pulse:!0},waiting_input:{label:`Needs input`,icon:i,tone:`warning`},checking:{label:`Running checks`,icon:I,tone:`info`,spin:!1},succeeded:{label:`Succeeded`,icon:h,tone:`success`},failed:{label:`Failed`,icon:p,tone:`danger`},interrupted:{label:`Interrupted`,icon:T,tone:`warning`},canceled:{label:`Canceled`,icon:y,tone:`neutral`}},oe={connected:{label:`Connected`,icon:W,tone:`success`},reconnecting:{label:`Reconnecting…`,icon:d,tone:`warning`,spin:!0},unreachable:{label:`Unreachable`,icon:m,tone:`danger`}},se={connecting:{label:`Connecting…`,icon:R,tone:`info`,spin:!0},live:{label:`Live`,icon:W,tone:`success`},reconnecting:{label:`Reconnecting…`,icon:d,tone:`warning`,spin:!0},offline:{label:`Offline`,icon:ne,tone:`danger`}},ce={pending:{label:`Needs input`,icon:i,tone:`warning`},resolved:{label:`Answered`,icon:h,tone:`success`},expired:{label:`Expired`,icon:P,tone:`neutral`},canceled:{label:`Canceled`,icon:k,tone:`neutral`},unsupported:{label:`Unsupported here`,icon:l,tone:`warning`}},Z={needs_input:{label:`Needs input`,icon:i,tone:`warning`},failed:{label:`Failed`,icon:p,tone:`danger`},ready_for_review:{label:`Ready for review`,icon:M,tone:`info`},unsupported_interaction:{label:`Unsupported interaction`,icon:l,tone:`warning`},host_unreachable:{label:`Host unreachable`,icon:m,tone:`danger`}},le={fired:{label:`Fired`,icon:D,tone:`info`},skipped_overlap:{label:`Skipped (overlap)`,icon:k,tone:`neutral`},skipped_missed:{label:`Skipped (missed)`,icon:k,tone:`neutral`},queued:{label:`Queued`,icon:f,tone:`neutral`},appended:{label:`Appended`,icon:B,tone:`info`},failed:{label:`Failed`,icon:p,tone:`danger`},filtered:{label:`Filtered out`,icon:x,tone:`neutral`}},Q={label:`Unknown`,icon:a,tone:`neutral`};function $(e){switch(e.kind){case`runtime`:return J[e.value]??Q;case`task`:return Y[e.value]??Q;case`run`:return X[e.value]??Q;case`host`:return oe[e.value]??Q;case`connection`:return se[e.value]??Q;case`interaction`:{let t=s.safeParse(e.value);return t.success?ce[t.data]:Q}case`attention`:return Z[e.value]??Q;case`occurrence`:return le[e.value]??Q;case`custom`:return e.status}}function ue(e){let t=$(e),n=t.icon,r=e.size===`sm`;return(0,G.jsxs)(`span`,{"data-status-chip":e.kind,className:o(`inline-flex max-w-full items-center gap-1 rounded-full border font-medium whitespace-nowrap`,r?`px-1.5 text-xs leading-5`:`px-2 text-xs leading-6`,K[t.tone],e.className),children:[t.spin?(0,G.jsx)(c,{className:r?`size-3`:`size-3.5`}):(0,G.jsx)(n,{"aria-hidden":!0,className:o(r?`size-3`:`size-3.5`,`shrink-0`,t.pulse&&`animate-pulse`)}),(0,G.jsx)(`span`,{className:`truncate`,children:e.label??t.label})]})}function de({icon:e,label:t,tone:n=`neutral`,spin:r,className:i}){return(0,G.jsxs)(`span`,{className:o(`inline-flex max-w-full items-center gap-1 rounded-full border px-2 text-xs leading-6 font-medium`,K[n],i),children:[r?(0,G.jsx)(c,{className:`size-3.5`}):(0,G.jsx)(e,{"aria-hidden":!0,className:`size-3.5 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 truncate`,children:t})]})}export{te as S,k as _,X as a,C as b,$ as c,K as d,re as f,M as g,I as h,J as i,q as l,R as m,de as n,ue as o,H as p,ae as r,Y as s,Z as t,ie as u,D as v,x,T as y};
|
|
2
|
+
//# sourceMappingURL=StatusChip-BYuVxYS7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusChip-BYuVxYS7.js","names":["__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","__iconData","MessageCircleQuestion","__commonJSMin","require_react","require_jsx_runtime","MessageCircleQuestionMark","CircleAlert","cn","InteractionState","Spinner","TriangleAlert","Inbox","RefreshCw","Clock","CircleX","WifiOff","CircleCheck","require_react_dom_production","React","formatProdErrorMessage","url","code","i","noop","Internals","REACT_PORTAL_TYPE","REACT_RECOVERABLE_TYPE","REACT_OPTIMISTIC_KEY","createPortal$1","key","ReactSharedInternals","getCrossOriginStringAs","as","input","reason","container","children","previousTransition","previousUpdatePriority","fn","href","options","crossOrigin","integrity","fetchPriority","form","a","action","initialState","permalink","require_react_dom","checkDCE","err","__iconData$14","Activity","createLucideIcon","__iconData$13","Ban","__iconData$12","CircleDashed","__iconData$11","CircleDot","__iconData$10","CirclePause","__iconData$9","CirclePlay","__iconData$8","CircleSlash","__iconData$7","CloudOff","__iconData$6","Eye","__iconData$5","Hourglass","__iconData$4","ListChecks","__iconData$3","LoaderCircle","__iconData$2","Repeat","__iconData$1","Square","__iconData","Wifi","import_jsx_runtime","TONE_CLASSES","TONE_TEXT","Badge","tone","className","label","CountBadge","count","RUNTIME_STATUS","REVIEW_STATUS","TASK_STATUS","RUN_STATUS","HOST_STATUS","CONNECTION_STATUS","INTERACTION_STATUS","ATTENTION_STATUS","OCCURRENCE_STATUS","FALLBACK","statusInfo","props","s","StatusChip","info","Icon","sm","InlineStatus","spin"],"sources":["../../../../node_modules/.pnpm/react-dom@19.3.1_react@19.3.1/node_modules/react-dom/cjs/react-dom.production.js","../../../../node_modules/.pnpm/react-dom@19.3.1_react@19.3.1/node_modules/react-dom/index.js","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/activity.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/ban.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/circle-dashed.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/circle-dot.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/circle-pause.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/circle-play.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/circle-slash.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/cloud-off.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/eye.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/hourglass.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/list-checks.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/loader-circle.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/repeat.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/square.mjs","../../../../node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.1/node_modules/lucide-react/dist/esm/icons/wifi.mjs","../../src/components/ui/Badge.tsx","../../src/components/ui/StatusChip.tsx"],"sourcesContent":["/**\n * @license React\n * react-dom.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction formatProdErrorMessage(code) {\n var url = \"https://react.dev/errors/\" + code;\n if (1 < arguments.length) {\n url += \"?args[]=\" + encodeURIComponent(arguments[1]);\n for (var i = 2; i < arguments.length; i++)\n url += \"&args[]=\" + encodeURIComponent(arguments[i]);\n }\n return (\n \"Minified React error #\" +\n code +\n \"; visit \" +\n url +\n \" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"\n );\n}\nfunction noop() {}\nvar Internals = {\n d: {\n f: noop,\n r: function () {\n throw Error(formatProdErrorMessage(522));\n },\n D: noop,\n C: noop,\n L: noop,\n m: noop,\n X: noop,\n S: noop,\n M: noop\n },\n p: 0,\n findDOMNode: null\n },\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_RECOVERABLE_TYPE = Symbol.for(\"react.recoverable\"),\n REACT_OPTIMISTIC_KEY = Symbol.for(\"react.optimistic_key\");\nfunction createPortal$1(children, containerInfo, implementation) {\n var key =\n 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;\n return {\n $$typeof: REACT_PORTAL_TYPE,\n key:\n null == key\n ? null\n : key === REACT_OPTIMISTIC_KEY\n ? REACT_OPTIMISTIC_KEY\n : \"\" + key,\n children: children,\n containerInfo: containerInfo,\n implementation: implementation\n };\n}\nvar ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\nfunction getCrossOriginStringAs(as, input) {\n if (\"font\" === as) return \"\";\n if (\"string\" === typeof input)\n return \"use-credentials\" === input ? input : \"\";\n}\nexports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n Internals;\nexports.browser = function (reason) {\n return { $$typeof: REACT_RECOVERABLE_TYPE, _reason: reason };\n};\nexports.createPortal = function (children, container) {\n var key =\n 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;\n if (\n !container ||\n (1 !== container.nodeType &&\n 9 !== container.nodeType &&\n 11 !== container.nodeType)\n )\n throw Error(formatProdErrorMessage(299));\n return createPortal$1(children, container, null, key);\n};\nexports.flushSync = function (fn) {\n var previousTransition = ReactSharedInternals.T,\n previousUpdatePriority = Internals.p;\n try {\n if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn();\n } finally {\n (ReactSharedInternals.T = previousTransition),\n (Internals.p = previousUpdatePriority),\n Internals.d.f();\n }\n};\nexports.preconnect = function (href, options) {\n \"string\" === typeof href &&\n (options\n ? ((options = options.crossOrigin),\n (options =\n \"string\" === typeof options\n ? \"use-credentials\" === options\n ? options\n : \"\"\n : void 0))\n : (options = null),\n Internals.d.C(href, options));\n};\nexports.prefetchDNS = function (href) {\n \"string\" === typeof href && Internals.d.D(href);\n};\nexports.preinit = function (href, options) {\n if (\"string\" === typeof href && options && \"string\" === typeof options.as) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),\n integrity =\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n fetchPriority =\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0;\n \"style\" === as\n ? Internals.d.S(\n href,\n \"string\" === typeof options.precedence ? options.precedence : void 0,\n {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority\n }\n )\n : \"script\" === as &&\n Internals.d.X(href, {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n};\nexports.preinitModule = function (href, options) {\n if (\"string\" === typeof href)\n if (\"object\" === typeof options && null !== options) {\n if (null == options.as || \"script\" === options.as) {\n var crossOrigin = getCrossOriginStringAs(\n options.as,\n options.crossOrigin\n );\n Internals.d.M(href, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0\n });\n }\n } else null == options && Internals.d.M(href);\n};\nexports.preload = function (href, options) {\n if (\n \"string\" === typeof href &&\n \"object\" === typeof options &&\n null !== options &&\n \"string\" === typeof options.as\n ) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);\n Internals.d.L(href, as, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n type: \"string\" === typeof options.type ? options.type : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0,\n referrerPolicy:\n \"string\" === typeof options.referrerPolicy\n ? options.referrerPolicy\n : void 0,\n imageSrcSet:\n \"string\" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,\n imageSizes:\n \"string\" === typeof options.imageSizes ? options.imageSizes : void 0,\n media: \"string\" === typeof options.media ? options.media : void 0\n });\n }\n};\nexports.preloadModule = function (href, options) {\n if (\"string\" === typeof href)\n if (options) {\n var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);\n Internals.d.m(href, {\n as:\n \"string\" === typeof options.as && \"script\" !== options.as\n ? options.as\n : void 0,\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0\n });\n } else Internals.d.m(href);\n};\nexports.requestFormReset = function (form) {\n Internals.d.r(form);\n};\nexports.unstable_batchedUpdates = function (fn, a) {\n return fn(a);\n};\nexports.useFormState = function (action, initialState, permalink) {\n return ReactSharedInternals.H.useFormState(action, initialState, permalink);\n};\nexports.useFormStatus = function () {\n return ReactSharedInternals.H.useHostTransitionStatus();\n};\nexports.version = \"19.3.1\";\n","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom.production.js');\n} else {\n module.exports = require('./cjs/react-dom.development.js');\n}\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"activity\",\n size: 24,\n node: [\n [\n \"path\",\n {\n d: \"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2\",\n key: \"169zse\"\n }\n ]\n ]\n};\n__iconData.node;\nconst Activity = createLucideIcon(__iconData);\n\nexport { __iconData, Activity as default };\n//# sourceMappingURL=activity.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"ban\",\n size: 24,\n node: [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"M4.929 4.929 19.07 19.071\", key: \"196cmz\" }]\n ]\n};\n__iconData.node;\nconst Ban = createLucideIcon(__iconData);\n\nexport { __iconData, Ban as default };\n//# sourceMappingURL=ban.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"circle-dashed\",\n size: 24,\n node: [\n [\"path\", { d: \"M10.1 2.182a10 10 0 0 1 3.8 0\", key: \"5ilxe3\" }],\n [\"path\", { d: \"M13.9 21.818a10 10 0 0 1-3.8 0\", key: \"11zvb9\" }],\n [\"path\", { d: \"M17.609 3.721a10 10 0 0 1 2.69 2.7\", key: \"1iw5b2\" }],\n [\"path\", { d: \"M2.182 13.9a10 10 0 0 1 0-3.8\", key: \"c0bmvh\" }],\n [\"path\", { d: \"M20.279 17.609a10 10 0 0 1-2.7 2.69\", key: \"1ruxm7\" }],\n [\"path\", { d: \"M21.818 10.1a10 10 0 0 1 0 3.8\", key: \"qkgqxc\" }],\n [\"path\", { d: \"M3.721 6.391a10 10 0 0 1 2.7-2.69\", key: \"1mcia2\" }],\n [\"path\", { d: \"M6.391 20.279a10 10 0 0 1-2.69-2.7\", key: \"1fvljs\" }]\n ]\n};\n__iconData.node;\nconst CircleDashed = createLucideIcon(__iconData);\n\nexport { __iconData, CircleDashed as default };\n//# sourceMappingURL=circle-dashed.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"circle-dot\",\n size: 24,\n node: [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"1\", key: \"41hilf\" }],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }]\n ]\n};\n__iconData.node;\nconst CircleDot = createLucideIcon(__iconData);\n\nexport { __iconData, CircleDot as default };\n//# sourceMappingURL=circle-dot.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"circle-pause\",\n size: 24,\n node: [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"line\", { x1: \"10\", x2: \"10\", y1: \"15\", y2: \"9\", key: \"c1nkhi\" }],\n [\"line\", { x1: \"14\", x2: \"14\", y1: \"15\", y2: \"9\", key: \"h65svq\" }]\n ],\n aliases: [\"pause-circle\"]\n};\n__iconData.node;\nconst CirclePause = createLucideIcon(__iconData);\n\nexport { __iconData, CirclePause as default };\n//# sourceMappingURL=circle-pause.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"circle-play\",\n size: 24,\n node: [\n [\n \"path\",\n {\n d: \"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z\",\n key: \"kmsa83\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }]\n ],\n aliases: [\"play-circle\"]\n};\n__iconData.node;\nconst CirclePlay = createLucideIcon(__iconData);\n\nexport { __iconData, CirclePlay as default };\n//# sourceMappingURL=circle-play.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"circle-slash\",\n size: 24,\n node: [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"line\", { x1: \"9\", x2: \"15\", y1: \"15\", y2: \"9\", key: \"1dfufj\" }]\n ]\n};\n__iconData.node;\nconst CircleSlash = createLucideIcon(__iconData);\n\nexport { __iconData, CircleSlash as default };\n//# sourceMappingURL=circle-slash.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"cloud-off\",\n size: 24,\n node: [\n [\n \"path\",\n { d: \"M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057\", key: \"1uxyv8\" }\n ],\n [\"path\", { d: \"M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78\", key: \"99tcn7\" }],\n [\"path\", { d: \"m2 2 20 20\", key: \"1ooewy\" }]\n ]\n};\n__iconData.node;\nconst CloudOff = createLucideIcon(__iconData);\n\nexport { __iconData, CloudOff as default };\n//# sourceMappingURL=cloud-off.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"eye\",\n size: 24,\n node: [\n [\n \"path\",\n {\n d: \"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\",\n key: \"1nclc0\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }]\n ]\n};\n__iconData.node;\nconst Eye = createLucideIcon(__iconData);\n\nexport { __iconData, Eye as default };\n//# sourceMappingURL=eye.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"hourglass\",\n size: 24,\n node: [\n [\"path\", { d: \"M5 22h14\", key: \"ehvnwv\" }],\n [\"path\", { d: \"M5 2h14\", key: \"pdyrp9\" }],\n [\n \"path\",\n {\n d: \"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22\",\n key: \"1d314k\"\n }\n ],\n [\n \"path\",\n {\n d: \"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2\",\n key: \"1vvvr6\"\n }\n ]\n ]\n};\n__iconData.node;\nconst Hourglass = createLucideIcon(__iconData);\n\nexport { __iconData, Hourglass as default };\n//# sourceMappingURL=hourglass.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"list-checks\",\n size: 24,\n node: [\n [\"path\", { d: \"M13 5h8\", key: \"a7qcls\" }],\n [\"path\", { d: \"M13 12h8\", key: \"h98zly\" }],\n [\"path\", { d: \"M13 19h8\", key: \"c3s6r1\" }],\n [\"path\", { d: \"m3 17 2 2 4-4\", key: \"1jhpwq\" }],\n [\"path\", { d: \"m3 7 2 2 4-4\", key: \"1obspn\" }]\n ]\n};\n__iconData.node;\nconst ListChecks = createLucideIcon(__iconData);\n\nexport { __iconData, ListChecks as default };\n//# sourceMappingURL=list-checks.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"loader-circle\",\n size: 24,\n node: [[\"path\", { d: \"M21 12a9 9 0 1 1-6.219-8.56\", key: \"13zald\" }]],\n aliases: [\"loader-2\"]\n};\n__iconData.node;\nconst LoaderCircle = createLucideIcon(__iconData);\n\nexport { __iconData, LoaderCircle as default };\n//# sourceMappingURL=loader-circle.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"repeat\",\n size: 24,\n node: [\n [\"path\", { d: \"m17 2 4 4-4 4\", key: \"nntrym\" }],\n [\"path\", { d: \"M3 11v-1a4 4 0 0 1 4-4h14\", key: \"84bu3i\" }],\n [\"path\", { d: \"m7 22-4-4 4-4\", key: \"1wqhfi\" }],\n [\"path\", { d: \"M21 13v1a4 4 0 0 1-4 4H3\", key: \"1rx37r\" }]\n ]\n};\n__iconData.node;\nconst Repeat = createLucideIcon(__iconData);\n\nexport { __iconData, Repeat as default };\n//# sourceMappingURL=repeat.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"square\",\n size: 24,\n node: [[\"rect\", { width: \"18\", height: \"18\", x: \"3\", y: \"3\", rx: \"2\", key: \"afitv7\" }]]\n};\n__iconData.node;\nconst Square = createLucideIcon(__iconData);\n\nexport { __iconData, Square as default };\n//# sourceMappingURL=square.mjs.map\n","/**\n * @license lucide-react v1.61.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"wifi\",\n size: 24,\n node: [\n [\"path\", { d: \"M12 20h.01\", key: \"zekei9\" }],\n [\"path\", { d: \"M2 8.82a15 15 0 0 1 20 0\", key: \"dnpr2z\" }],\n [\"path\", { d: \"M5 12.859a10 10 0 0 1 14 0\", key: \"1x1e6c\" }],\n [\"path\", { d: \"M8.5 16.429a5 5 0 0 1 7 0\", key: \"1bycff\" }]\n ]\n};\n__iconData.node;\nconst Wifi = createLucideIcon(__iconData);\n\nexport { __iconData, Wifi as default };\n//# sourceMappingURL=wifi.mjs.map\n","import type { ReactNode } from \"react\";\nimport { cn } from \"../../lib/cn\";\n\nexport type Tone = \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\" | \"accent\";\n\nexport const TONE_CLASSES: Record<Tone, string> = {\n neutral: \"bg-surface-2 text-muted border-border\",\n info: \"bg-info-soft text-info border-transparent\",\n success: \"bg-success-soft text-success border-transparent\",\n warning: \"bg-warning-soft text-warning border-transparent\",\n danger: \"bg-danger-soft text-danger border-transparent\",\n accent: \"bg-accent text-accent-fg border-transparent\",\n};\n\n/** Text colour for each tone (the Badge classes colour the background too). */\nexport const TONE_TEXT: Record<Tone, string> = {\n neutral: \"text-muted\",\n info: \"text-info\",\n success: \"text-success\",\n warning: \"text-warning\",\n danger: \"text-danger\",\n accent: \"text-accent\",\n};\n\nexport interface BadgeProps {\n children: ReactNode;\n tone?: Tone;\n /** Accessible text when the visible content is terse (e.g. a count). */\n label?: string;\n className?: string;\n}\n\n/** Small pill for counts and tags. */\nexport function Badge({ children, tone = \"neutral\", label, className }: BadgeProps) {\n return (\n <span\n className={cn(\n \"inline-flex min-w-5 items-center justify-center rounded-full border px-1.5 text-xs leading-5 font-medium tabular-nums\",\n TONE_CLASSES[tone],\n className,\n )}\n title={label}\n >\n <span aria-hidden={label ? true : undefined}>{children}</span>\n {label && <span className=\"sr-only\">{label}</span>}\n </span>\n );\n}\n\n/** Count badge; renders nothing at zero. Caps at 99+. */\nexport function CountBadge({\n count,\n label,\n tone = \"danger\",\n className,\n}: {\n count: number;\n label: string;\n tone?: Tone;\n className?: string;\n}) {\n if (count <= 0) return null;\n return (\n <Badge tone={tone} label={`${count} ${label}`} className={className}>\n {count > 99 ? \"99+\" : count}\n </Badge>\n );\n}\n","import type {\n AttentionReason,\n Connectivity,\n OccurrenceState,\n RunState,\n RuntimeState,\n TaskState,\n} from \"@switchyard/protocol\";\nimport { InteractionState } from \"@switchyard/protocol\";\nimport {\n Activity,\n Ban,\n CircleAlert,\n CircleCheck,\n CircleDashed,\n CircleDot,\n CirclePause,\n CirclePlay,\n CircleSlash,\n CircleX,\n Clock,\n CloudOff,\n Eye,\n Hourglass,\n Inbox,\n ListChecks,\n LoaderCircle,\n type LucideIcon,\n MessageCircleQuestion,\n RefreshCw,\n Repeat,\n Square,\n TriangleAlert,\n Wifi,\n WifiOff,\n} from \"lucide-react\";\nimport type { ReactNode } from \"react\";\nimport { cn } from \"../../lib/cn\";\nimport type { ConnectionState } from \"../../sync/store\";\nimport { TONE_CLASSES, type Tone } from \"./Badge\";\nimport { Spinner } from \"./Spinner\";\n\n/** A status presentation: always an icon plus a text label (never color alone). */\nexport interface StatusInfo {\n label: string;\n icon: LucideIcon;\n tone: Tone;\n /** Spin the icon (in-flight states). */\n spin?: boolean;\n /** Pulse the icon (ongoing, not transitional). */\n pulse?: boolean;\n}\n\nexport const RUNTIME_STATUS: Record<RuntimeState, StatusInfo> = {\n starting: { label: \"Starting…\", icon: LoaderCircle, tone: \"info\", spin: true },\n idle: { label: \"Idle\", icon: CircleDot, tone: \"neutral\" },\n running: { label: \"Running\", icon: Activity, tone: \"info\", pulse: true },\n waiting_input: { label: \"Needs input\", icon: MessageCircleQuestion, tone: \"warning\" },\n interrupted: { label: \"Interrupted\", icon: CirclePause, tone: \"warning\" },\n failed: { label: \"Failed\", icon: CircleX, tone: \"danger\" },\n stopped: { label: \"Stopped\", icon: Square, tone: \"neutral\" },\n};\n\n/** A finished session nobody has looked at yet. */\nexport const REVIEW_STATUS: StatusInfo = { label: \"Ready to review\", icon: Eye, tone: \"success\" };\n\nexport const TASK_STATUS: Record<TaskState, StatusInfo> = {\n backlog: { label: \"Backlog\", icon: Inbox, tone: \"neutral\" },\n ready: { label: \"Ready\", icon: CirclePlay, tone: \"info\" },\n in_progress: { label: \"In progress\", icon: LoaderCircle, tone: \"info\" },\n review: { label: \"Review\", icon: Eye, tone: \"warning\" },\n done: { label: \"Done\", icon: CircleCheck, tone: \"success\" },\n canceled: { label: \"Canceled\", icon: Ban, tone: \"neutral\" },\n};\n\nexport const RUN_STATUS: Record<RunState, StatusInfo> = {\n queued: { label: \"Queued\", icon: Clock, tone: \"neutral\" },\n dispatching: { label: \"Dispatching…\", icon: LoaderCircle, tone: \"info\", spin: true },\n uncertain: { label: \"Awaiting host confirmation\", icon: Hourglass, tone: \"warning\" },\n running: { label: \"Running\", icon: Activity, tone: \"info\", pulse: true },\n waiting_input: { label: \"Needs input\", icon: MessageCircleQuestion, tone: \"warning\" },\n checking: { label: \"Running checks\", icon: ListChecks, tone: \"info\", spin: false },\n succeeded: { label: \"Succeeded\", icon: CircleCheck, tone: \"success\" },\n failed: { label: \"Failed\", icon: CircleX, tone: \"danger\" },\n interrupted: { label: \"Interrupted\", icon: CirclePause, tone: \"warning\" },\n canceled: { label: \"Canceled\", icon: Ban, tone: \"neutral\" },\n};\n\n/** Host connectivity. */\nexport const HOST_STATUS: Record<Connectivity, StatusInfo> = {\n connected: { label: \"Connected\", icon: Wifi, tone: \"success\" },\n reconnecting: { label: \"Reconnecting…\", icon: RefreshCw, tone: \"warning\", spin: true },\n unreachable: { label: \"Unreachable\", icon: WifiOff, tone: \"danger\" },\n};\n\n/** This client's link to the coordinator. */\nexport const CONNECTION_STATUS: Record<ConnectionState, StatusInfo> = {\n connecting: { label: \"Connecting…\", icon: LoaderCircle, tone: \"info\", spin: true },\n live: { label: \"Live\", icon: Wifi, tone: \"success\" },\n reconnecting: { label: \"Reconnecting…\", icon: RefreshCw, tone: \"warning\", spin: true },\n offline: { label: \"Offline\", icon: CloudOff, tone: \"danger\" },\n};\n\nexport const INTERACTION_STATUS: Record<InteractionState, StatusInfo> = {\n pending: { label: \"Needs input\", icon: MessageCircleQuestion, tone: \"warning\" },\n resolved: { label: \"Answered\", icon: CircleCheck, tone: \"success\" },\n expired: { label: \"Expired\", icon: Hourglass, tone: \"neutral\" },\n canceled: { label: \"Canceled\", icon: CircleSlash, tone: \"neutral\" },\n unsupported: { label: \"Unsupported here\", icon: TriangleAlert, tone: \"warning\" },\n};\n\nexport const ATTENTION_STATUS: Record<AttentionReason, StatusInfo> = {\n needs_input: { label: \"Needs input\", icon: MessageCircleQuestion, tone: \"warning\" },\n failed: { label: \"Failed\", icon: CircleX, tone: \"danger\" },\n ready_for_review: { label: \"Ready for review\", icon: Eye, tone: \"info\" },\n unsupported_interaction: {\n label: \"Unsupported interaction\",\n icon: TriangleAlert,\n tone: \"warning\",\n },\n host_unreachable: { label: \"Host unreachable\", icon: WifiOff, tone: \"danger\" },\n};\n\nexport const OCCURRENCE_STATUS: Record<OccurrenceState, StatusInfo> = {\n fired: { label: \"Fired\", icon: CirclePlay, tone: \"info\" },\n skipped_overlap: { label: \"Skipped (overlap)\", icon: CircleSlash, tone: \"neutral\" },\n skipped_missed: { label: \"Skipped (missed)\", icon: CircleSlash, tone: \"neutral\" },\n queued: { label: \"Queued\", icon: Clock, tone: \"neutral\" },\n appended: { label: \"Appended\", icon: Repeat, tone: \"info\" },\n failed: { label: \"Failed\", icon: CircleX, tone: \"danger\" },\n filtered: { label: \"Filtered out\", icon: CircleDashed, tone: \"neutral\" },\n};\n\nexport type StatusChipProps =\n | { kind: \"runtime\"; value: RuntimeState; label?: string; className?: string; size?: \"sm\" | \"md\" }\n | { kind: \"task\"; value: TaskState; label?: string; className?: string; size?: \"sm\" | \"md\" }\n | { kind: \"run\"; value: RunState; label?: string; className?: string; size?: \"sm\" | \"md\" }\n | { kind: \"host\"; value: Connectivity; label?: string; className?: string; size?: \"sm\" | \"md\" }\n | {\n kind: \"connection\";\n value: ConnectionState;\n label?: string;\n className?: string;\n size?: \"sm\" | \"md\";\n }\n | {\n kind: \"interaction\";\n value: InteractionState;\n label?: string;\n className?: string;\n size?: \"sm\" | \"md\";\n }\n | {\n kind: \"attention\";\n value: AttentionReason;\n label?: string;\n className?: string;\n size?: \"sm\" | \"md\";\n }\n | {\n kind: \"occurrence\";\n value: OccurrenceState;\n label?: string;\n className?: string;\n size?: \"sm\" | \"md\";\n }\n | { kind: \"custom\"; status: StatusInfo; label?: string; className?: string; size?: \"sm\" | \"md\" };\n\nconst FALLBACK: StatusInfo = { label: \"Unknown\", icon: CircleAlert, tone: \"neutral\" };\n\nexport function statusInfo(props: StatusChipProps): StatusInfo {\n switch (props.kind) {\n case \"runtime\":\n return RUNTIME_STATUS[props.value] ?? FALLBACK;\n case \"task\":\n return TASK_STATUS[props.value] ?? FALLBACK;\n case \"run\":\n return RUN_STATUS[props.value] ?? FALLBACK;\n case \"host\":\n return HOST_STATUS[props.value] ?? FALLBACK;\n case \"connection\":\n return CONNECTION_STATUS[props.value] ?? FALLBACK;\n case \"interaction\": {\n // Offline-cache values may still carry the pre-0.9 spelling.\n const s = InteractionState.safeParse(props.value);\n return s.success ? INTERACTION_STATUS[s.data] : FALLBACK;\n }\n case \"attention\":\n return ATTENTION_STATUS[props.value] ?? FALLBACK;\n case \"occurrence\":\n return OCCURRENCE_STATUS[props.value] ?? FALLBACK;\n case \"custom\":\n return props.status;\n }\n}\n\n/** Status pill: icon + text label, tone only reinforces. `label` overrides the text. */\nexport function StatusChip(props: StatusChipProps) {\n const info = statusInfo(props);\n const Icon = info.icon;\n const sm = props.size === \"sm\";\n return (\n <span\n data-status-chip={props.kind}\n className={cn(\n \"inline-flex max-w-full items-center gap-1 rounded-full border font-medium whitespace-nowrap\",\n sm ? \"px-1.5 text-xs leading-5\" : \"px-2 text-xs leading-6\",\n TONE_CLASSES[info.tone],\n props.className,\n )}\n >\n {info.spin ? (\n <Spinner className={sm ? \"size-3\" : \"size-3.5\"} />\n ) : (\n <Icon\n aria-hidden\n className={cn(sm ? \"size-3\" : \"size-3.5\", \"shrink-0\", info.pulse && \"animate-pulse\")}\n />\n )}\n <span className=\"truncate\">{props.label ?? info.label}</span>\n </span>\n );\n}\n\n/** Icon plus text status, the tone only reinforces. */\nexport function InlineStatus({\n icon: Icon,\n label,\n tone = \"neutral\",\n spin,\n className,\n}: {\n icon: LucideIcon;\n label: ReactNode;\n tone?: Tone;\n spin?: boolean;\n className?: string;\n}) {\n return (\n <span\n className={cn(\n \"inline-flex max-w-full items-center gap-1 rounded-full border px-2 text-xs leading-6 font-medium\",\n TONE_CLASSES[tone],\n className,\n )}\n >\n {spin ? <Spinner className=\"size-3.5\" /> : <Icon aria-hidden className=\"size-3.5 shrink-0\" />}\n <span className=\"min-w-0 truncate\">{label}</span>\n </span>\n );\n}\n"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],"mappings":"A,4OAWA,IAAI+B,EAAAf,EAAA,EACJ,SAASgB,EAAuB,EAAM,CACpC,IAAIC,EAAM,4BAA8BC,EACxC,GAAI,EAAI,UAAU,OAAQ,CACxB,GAAO,WAAa,mBAAmB,UAAU,EAAE,EACnD,IAAK,IAAIC,EAAI,EAAGA,EAAI,UAAU,OAAQ,IACpC,GAAO,WAAa,mBAAmB,UAAUA,EAAE,CACvD,CACA,MACE,yBACAD,EACA,WACAD,EACA,gHAEJ,CACA,SAASG,GAAO,CAAC,CACjB,IAAIC,EAAY,CACZ,EAAG,CACD,EAAGD,EACH,EAAG,UAAY,CACb,MAAM,MAAMJ,EAAuB,GAAG,CAAC,CACzC,EACA,EAAG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AD,CAAS,UAAWoG,EAAK,SAAW,UAAa,CAAA,GAEjD,EAAAzB,EAAA,IAAA,CAACwB,EAAD,CACE,cAAA,GACA,UAAWrG,EAAGsG,EAAK,SAAW,WAAY,WAAYF,EAAK,OAAS,eAAe,CACpF,CAAA,GAEH,EAAAvB,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,WAAY,SAAAoB,EAAM,OAASG,EAAK,KAAY,CAAA,CACxD,C,EAEV,CAGA,SAAgBG,GAAa,CAC3B,KAAMF,EACN,QACA,OAAO,UACP,OACA,aAOC,CACD,OACE,EAAAxB,EAAA,KAAA,CAAC,OAAD,CACE,UAAW7E,EACT,mGACA8E,EAAaG,GACbC,CACF,EALF,SAAA,CAOGsB,GAAO,EAAA3B,EAAA,IAAA,CAAC3E,EAAD,CAAS,UAAU,UAAY,CAAA,GAAI,EAAA2E,EAAA,IAAA,CAACwB,EAAD,CAAM,cAAA,GAAY,UAAU,mBAAqB,CAAA,GAC5F,EAAAxB,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,mBAAoB,SAAAM,CAAY,CAAA,CAC5C,C,EAEV,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as e,m as t,t as n}from"./jsx-runtime-D13aM9HY.js";import{_ as r,p as i}from"./states-
|
|
2
|
-
//# sourceMappingURL=Switch-
|
|
1
|
+
import{_ as e,m as t,t as n}from"./jsx-runtime-D13aM9HY.js";import{_ as r,p as i}from"./states-C773NlHo.js";var a=e(t(),1),o=n();function s({checked:e}){return(0,o.jsx)(`span`,{"aria-hidden":!0,className:r(`relative inline-flex h-6 w-10 shrink-0 items-center rounded-full border transition-colors`,e?`border-accent bg-accent`:`border-border-strong bg-surface-2`),children:(0,o.jsx)(`span`,{className:r(`absolute size-4 rounded-full shadow-sm transition-transform`,e?`translate-x-5 bg-accent-fg`:`translate-x-1 bg-muted`)})})}function c({checked:e,onChange:t,label:n,onText:a=`On`,offText:c=`Off`,busy:l,disabled:u,id:d,className:f,...p}){return(0,o.jsxs)(`button`,{id:d,type:`button`,role:`switch`,"aria-checked":e,"aria-label":n,"aria-busy":l||void 0,"aria-invalid":p[`aria-invalid`],"aria-describedby":p[`aria-describedby`],disabled:u||l,onClick:()=>t(!e),className:r(`tap inline-flex min-h-9 shrink-0 items-center gap-2 rounded-md px-1.5 text-sm`,`hover:bg-surface-2 disabled:opacity-60`,f),children:[(0,o.jsx)(s,{checked:e}),l?(0,o.jsx)(i,{className:`size-3.5`}):null,(0,o.jsx)(`span`,{className:e?`text-text`:`text-muted`,children:e?a:c})]})}function l({checked:e,onChange:t,label:n,description:i,busy:c,disabled:l,id:u,className:d,...f}){let p=(0,a.useId)(),m=u??p,h=`${m}-desc`,g=[i?h:null,f[`aria-describedby`]].filter(Boolean).join(` `),_=l||c;return(0,o.jsxs)(`div`,{className:r(`flex min-w-0 items-start gap-3`,d),children:[(0,o.jsx)(`button`,{id:m,type:`button`,role:`switch`,"aria-checked":e,"aria-busy":c||void 0,"aria-invalid":f[`aria-invalid`],"aria-describedby":g||void 0,disabled:_,onClick:()=>t(!e),className:r(`tap mt-0.5 rounded-full`,_&&`cursor-not-allowed opacity-60`),children:(0,o.jsx)(s,{checked:e})}),(0,o.jsxs)(`label`,{htmlFor:m,className:r(`min-w-0 flex-1`,_?`cursor-not-allowed opacity-60`:`cursor-pointer`),children:[(0,o.jsxs)(`span`,{className:`block text-sm font-medium`,children:[n,` `,(0,o.jsxs)(`span`,{"aria-hidden":!0,className:`font-normal text-muted`,children:[`(`,e?`On`:`Off`,`)`]})]}),i&&(0,o.jsx)(`span`,{id:h,className:`block text-sm text-muted`,children:i})]})]})}export{l as n,c as t};
|
|
2
|
+
//# sourceMappingURL=Switch-DAcUcSbH.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch-
|
|
1
|
+
{"version":3,"file":"Switch-DAcUcSbH.js","names":["useId","__toESM","require_react","require_jsx_runtime","cn","Spinner","import_react","import_jsx_runtime","SwitchTrack","checked","Switch","aria","label","busy","disabled","onChange","className","onText","offText","SwitchRow","generated","switchId","id","descId","describedBy","description","off"],"sources":["../../src/components/ui/Switch.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { useId } from \"react\";\nimport { cn } from \"../../lib/cn\";\nimport { Spinner } from \"./Spinner\";\n\ninterface SwitchBase {\n checked: boolean;\n onChange(next: boolean): void;\n busy?: boolean;\n disabled?: boolean;\n id?: string;\n \"aria-invalid\"?: true;\n \"aria-describedby\"?: string;\n className?: string;\n}\n\nfunction SwitchTrack({ checked }: { checked: boolean }) {\n return (\n <span\n aria-hidden\n className={cn(\n \"relative inline-flex h-6 w-10 shrink-0 items-center rounded-full border transition-colors\",\n checked ? \"border-accent bg-accent\" : \"border-border-strong bg-surface-2\",\n )}\n >\n <span\n className={cn(\n \"absolute size-4 rounded-full shadow-sm transition-transform\",\n checked ? \"translate-x-5 bg-accent-fg\" : \"translate-x-1 bg-muted\",\n )}\n />\n </span>\n );\n}\n\n/** Compact on/off switch: the track plus text that states the current value. */\nexport function Switch({\n checked,\n onChange,\n label,\n onText = \"On\",\n offText = \"Off\",\n busy,\n disabled,\n id,\n className,\n ...aria\n}: SwitchBase & {\n /** Accessible name. */\n label: string;\n onText?: string;\n offText?: string;\n}) {\n return (\n <button\n id={id}\n type=\"button\"\n role=\"switch\"\n aria-checked={checked}\n aria-label={label}\n aria-busy={busy || undefined}\n aria-invalid={aria[\"aria-invalid\"]}\n aria-describedby={aria[\"aria-describedby\"]}\n disabled={disabled || busy}\n onClick={() => onChange(!checked)}\n className={cn(\n \"tap inline-flex min-h-9 shrink-0 items-center gap-2 rounded-md px-1.5 text-sm\",\n \"hover:bg-surface-2 disabled:opacity-60\",\n className,\n )}\n >\n <SwitchTrack checked={checked} />\n {busy ? <Spinner className=\"size-3.5\" /> : null}\n <span className={checked ? \"text-text\" : \"text-muted\"}>{checked ? onText : offText}</span>\n </button>\n );\n}\n\n/** Switch row: the track, a visible label with \"(On)/(Off)\" and a description; the whole row is clickable. */\nexport function SwitchRow({\n checked,\n onChange,\n label,\n description,\n busy,\n disabled,\n id,\n className,\n ...aria\n}: SwitchBase & { label: ReactNode; description?: ReactNode }) {\n const generated = useId();\n const switchId = id ?? generated;\n const descId = `${switchId}-desc`;\n const describedBy = [description ? descId : null, aria[\"aria-describedby\"]]\n .filter(Boolean)\n .join(\" \");\n const off = disabled || busy;\n return (\n <div className={cn(\"flex min-w-0 items-start gap-3\", className)}>\n <button\n id={switchId}\n type=\"button\"\n role=\"switch\"\n aria-checked={checked}\n aria-busy={busy || undefined}\n aria-invalid={aria[\"aria-invalid\"]}\n aria-describedby={describedBy || undefined}\n disabled={off}\n onClick={() => onChange(!checked)}\n className={cn(\"tap mt-0.5 rounded-full\", off && \"cursor-not-allowed opacity-60\")}\n >\n <SwitchTrack checked={checked} />\n </button>\n <label\n htmlFor={switchId}\n className={cn(\"min-w-0 flex-1\", off ? \"cursor-not-allowed opacity-60\" : \"cursor-pointer\")}\n >\n <span className=\"block text-sm font-medium\">\n {label}{\" \"}\n <span aria-hidden className=\"font-normal text-muted\">\n ({checked ? \"On\" : \"Off\"})\n </span>\n </span>\n {description && (\n <span id={descId} className=\"block text-sm text-muted\">\n {description}\n </span>\n )}\n </label>\n </div>\n );\n}\n"],"mappings":"A,iIAgBA,SAASQ,EAAY,CAAE,WAAiC,CACtD,OACE,EAAAD,EAAA,IAAA,CAAC,OAAD,CACE,cAAA,GACA,UAAWH,EACT,4FACAK,EAAU,0BAA4B,mCACxC,EAEA,UAAA,EAAAF,EAAA,IAAA,CAAC,OAAD,CACE,UAAWH,EACT,8DACAK,EAAU,6BAA+B,wBAC3C,CACD,CAAA,CACG,CAAA,CAEV,CAGA,SAAgBC,EAAO,CACrB,UACA,WACA,QACA,SAAS,KACT,UAAU,MACV,OACA,WACA,KACA,YACA,GAAGC,GAMF,CACD,OACE,EAAAJ,EAAA,KAAA,CAAC,SAAD,CACM,KACJ,KAAK,SACL,KAAK,SACL,eAAcE,EACd,aA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