@gryt/ui 0.22.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ThemeEditor/ColorField.d.ts +20 -0
- package/dist/components/ThemeEditor/ColorField.d.ts.map +1 -0
- package/dist/components/ThemeEditor/ContrastReport.d.ts +16 -0
- package/dist/components/ThemeEditor/ContrastReport.d.ts.map +1 -0
- package/dist/components/ThemeEditor/CurveEditor.d.ts +20 -0
- package/dist/components/ThemeEditor/CurveEditor.d.ts.map +1 -0
- package/dist/components/ThemeEditor/FontField.d.ts +11 -0
- package/dist/components/ThemeEditor/FontField.d.ts.map +1 -0
- package/dist/components/ThemeEditor/MotionField.d.ts +8 -0
- package/dist/components/ThemeEditor/MotionField.d.ts.map +1 -0
- package/dist/components/ThemeEditor/ScaleStrip.d.ts +15 -0
- package/dist/components/ThemeEditor/ScaleStrip.d.ts.map +1 -0
- package/dist/components/ThemeEditor/ThemeEditor.d.ts +32 -0
- package/dist/components/ThemeEditor/ThemeEditor.d.ts.map +1 -0
- package/dist/components/ThemeEditor/contrast.d.ts +21 -0
- package/dist/components/ThemeEditor/contrast.d.ts.map +1 -0
- package/dist/components/ThemeEditor/draft.d.ts +35 -0
- package/dist/components/ThemeEditor/draft.d.ts.map +1 -0
- package/dist/components/ThemeEditor/fonts.d.ts +25 -0
- package/dist/components/ThemeEditor/fonts.d.ts.map +1 -0
- package/dist/components/ThemeEditor/generate.d.ts +43 -0
- package/dist/components/ThemeEditor/generate.d.ts.map +1 -0
- package/dist/components/ThemeEditor/share.d.ts +17 -0
- package/dist/components/ThemeEditor/share.d.ts.map +1 -0
- package/dist/index.cjs +18 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2099 -910
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme.css +40 -6
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),M=require("@base-ui/react/tooltip"),s=require("react"),c=require("@gryt/theme"),se=require("@base-ui/react/button"),we=require("clsx"),ve=require("tailwind-merge"),_=require("@base-ui/react/field"),P=require("@phosphor-icons/react"),X=require("@base-ui/react/avatar"),K=require("@gryt/owl"),J=require("@base-ui/react/checkbox"),ee=require("@base-ui/react/radio"),je=require("@base-ui/react/radio-group"),te=require("@base-ui/react/switch"),F=require("@base-ui/react/slider"),h=require("@base-ui/react/select"),Pe=require("@base-ui/react/separator"),U=require("@base-ui/react/progress"),C=require("@base-ui/react/dialog"),j=require("@base-ui/react/drawer"),D=require("@base-ui/react/menu"),z=require("@base-ui/react/tabs"),B=require("@base-ui/react/accordion"),T=require("@base-ui/react/context-menu"),N=require("@base-ui/react/popover"),R=require("@base-ui/react/toast"),O=require("@base-ui/react/scroll-area"),Ne=require("@base-ui/react/toggle"),Re=require("@base-ui/react/toggle-group"),q=require("@base-ui/react/meter"),S=require("@base-ui/react/alert-dialog"),m=require("@base-ui/react/autocomplete"),g=require("@base-ui/react/combobox"),Te=require("@base-ui/react/checkbox-group"),W=require("@base-ui/react/collapsible"),Ce=require("@base-ui/react/form"),ie=require("@base-ui/react/fieldset"),Se=require("@base-ui/react/menubar"),w=require("@base-ui/react/navigation-menu"),A=require("@base-ui/react/number-field"),re=require("@base-ui/react/otp-field"),G=require("@base-ui/react/preview-card"),L=require("@base-ui/react/toolbar"),le=s.createContext(void 0);function ce(){return s.useContext(le)}function ke(a){return Object.keys(a).some(e=>e.startsWith("--"))}function Ae({children:a,className:e,theme:t,tooltipDelay:r=400,containOverlays:i=!1}){const l=s.useRef(null),d=t===void 0?void 0:ke(t)?t:c.createGrytTheme(t);return o.jsx("div",{className:e,style:d,ref:l,children:o.jsx(le.Provider,{value:i?l:void 0,children:o.jsx(M.Tooltip.Provider,{delay:r,children:a})})})}function n(...a){return ve.twMerge(we.clsx(a))}const Me={primary:"bg-gryt-accent text-gryt-on-accent hover:not-data-disabled:bg-gryt-accent-light data-disabled:bg-gryt-surface-raised data-disabled:text-gryt-muted",secondary:"bg-gryt-secondary text-gryt-on-secondary hover:not-data-disabled:bg-gryt-secondary-light data-disabled:bg-gryt-surface-raised data-disabled:text-gryt-muted",neutral:"bg-gryt-surface-raised text-gryt-text hover:not-data-disabled:bg-gryt-surface-hover data-disabled:text-gryt-muted",danger:"bg-gryt-danger text-gryt-on-danger hover:not-data-disabled:bg-gryt-danger-light data-disabled:bg-gryt-surface-raised data-disabled:text-gryt-muted",ghost:"bg-transparent text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text"},De={xsmall:"min-h-8 px-3 text-xs",small:"min-h-9 px-4 text-sm",medium:"min-h-10 px-5 text-sm",large:"min-h-12 px-6 text-base"},de=s.forwardRef(function({children:e,className:t,endIcon:r,size:i="medium",startIcon:l,tone:d="primary",...u},p){return o.jsxs(se.Button,{ref:p,className:n("gryt-button","inline-flex cursor-pointer items-center justify-center gap-2 border-0 shadow-none","rounded-(--gryt-radius-full) font-semibold whitespace-nowrap select-none","transition-[scale,background-color,color]","duration-(--gryt-dur-spring) ease-spring","motion-safe:not-[[aria-haspopup]]:hover:not-data-disabled:scale-[1.03]","motion-safe:not-[[aria-haspopup]]:active:not-data-disabled:scale-[0.96]","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light","data-disabled:cursor-not-allowed data-disabled:opacity-60",De[i],Me[d],t),...u,children:[l,e,r]})}),f="focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",Ie="has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-gryt-accent-light",ue=["w-full rounded-(--gryt-radius-xl) border bg-gryt-surface-raised","text-gryt-text outline-none placeholder:text-gryt-muted","transition-colors duration-150 motion-reduce:transition-none","hover:border-gryt-accent-light focus:border-gryt-accent","disabled:cursor-not-allowed disabled:opacity-60"].join(" "),ge={small:"min-h-9 px-3 py-1.5 text-sm",medium:"min-h-11 px-4 py-2.5 text-sm"},I="rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface text-gryt-text",k=["transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0"].join(" "),$="cursor-pointer data-disabled:cursor-not-allowed data-disabled:opacity-50",Ge={primary:"data-checked:bg-gryt-accent data-checked:text-gryt-on-accent",secondary:"data-checked:bg-gryt-secondary data-checked:text-gryt-on-secondary",neutral:"data-checked:bg-gryt-surface-hover data-checked:text-gryt-text",danger:"data-checked:bg-gryt-danger data-checked:text-gryt-on-danger",success:"data-checked:bg-gryt-success data-checked:text-gryt-on-accent",warning:"data-checked:bg-gryt-warning data-checked:text-gryt-on-accent"},ye={primary:"bg-gryt-accent",secondary:"bg-gryt-secondary",neutral:"bg-gryt-surface-hover",danger:"bg-gryt-danger",success:"bg-gryt-success",warning:"bg-gryt-warning"},Le={primary:"data-checked:border-gryt-accent",secondary:"data-checked:border-gryt-secondary",neutral:"data-checked:border-gryt-muted",danger:"data-checked:border-gryt-danger",success:"data-checked:border-gryt-success",warning:"data-checked:border-gryt-warning"},Oe={primary:"data-checked:bg-gryt-accent",secondary:"data-checked:bg-gryt-secondary",neutral:"data-checked:bg-gryt-surface-hover",danger:"data-checked:bg-gryt-danger",success:"data-checked:bg-gryt-success",warning:"data-checked:bg-gryt-warning"},$e={primary:"text-gryt-accent-11 hover:not-data-disabled:bg-gryt-accent-3",secondary:"text-gryt-secondary-11 hover:not-data-disabled:bg-gryt-secondary-3",neutral:"text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text",danger:"text-gryt-danger-11 hover:not-data-disabled:bg-gryt-danger-3",ghost:"text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text"},Fe={xsmall:"h-8 w-8",small:"h-9 w-9",medium:"h-10 w-10",large:"h-12 w-12"},qe=s.forwardRef(function({className:e,size:t="medium",tone:r="neutral",...i},l){return o.jsx(se.Button,{ref:l,className:n("gryt-icon-button","inline-flex shrink-0 items-center justify-center border-0 bg-transparent p-0","rounded-(--gryt-radius-full) select-none","transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring","motion-safe:not-[[aria-haspopup]]:hover:not-data-disabled:scale-[1.06]","motion-safe:not-[[aria-haspopup]]:active:not-data-disabled:scale-[0.94]",f,$,Fe[t],$e[r],e),...i})}),Be=s.forwardRef(function({className:e,elevated:t=!1,...r},i){return o.jsx("div",{ref:i,className:n("gryt-surface rounded-(--gryt-radius-lg) border border-gryt-border p-4 text-gryt-text",t?"bg-gryt-surface-raised":"bg-gryt-surface",e),...r})}),ze=s.forwardRef(function({children:e,className:t,from:r="assistant",...i},l){return o.jsx("div",{ref:l,className:n("gryt-message-bubble",r==="user"&&"ml-auto bg-gryt-accent text-gryt-on-accent",r==="assistant"&&"mr-auto border border-gryt-border bg-gryt-surface text-gryt-text",r==="system"&&"mx-auto border border-dashed border-gryt-border bg-transparent text-gryt-muted",t),...i,children:e})}),Ee=s.forwardRef(function({className:e,error:t=!1,fieldClassName:r,helperText:i,label:l,minRows:d=3,multiline:u=!1,size:p="medium",...x},y){const v=o.jsx(_.Field.Control,{ref:y,render:u?o.jsx("textarea",{rows:d}):void 0,className:n("gryt-text-field-control",ue,u&&"resize-y leading-6",t?"border-gryt-danger":"border-gryt-border",ge[p],e),...x});return o.jsxs(_.Field.Root,{className:n("gryt-text-field flex w-full flex-col gap-1.5",r),children:[l?o.jsx(_.Field.Label,{className:"text-xs font-medium text-gryt-muted",children:l}):null,v,i?o.jsx(_.Field.Description,{className:n("text-xs",t?"text-gryt-danger-11":"text-gryt-muted"),children:i}):null]})}),_e=s.forwardRef(function({className:e,disabled:t=!1,maxRows:r=8,minRows:i=1,onSubmit:l,placeholder:d="Message Gryt",submitLabel:u="Send",...p},x){const y=s.useRef(null),v=s.useCallback(()=>{const b=y.current;if(!b)return;const V=window.getComputedStyle(b),Q=parseFloat(V.lineHeight)||24,Z=parseFloat(V.paddingTop)+parseFloat(V.paddingBottom);b.style.height="auto",b.style.height=`${Math.min(Math.max(b.scrollHeight,Q*i+Z),Q*r+Z)}px`},[r,i]);s.useLayoutEffect(v,[v,p.value]);function E(b){if(!l){b.preventDefault();return}l(b)}return o.jsxs("form",{className:n("gryt-composer",e),onSubmit:E,children:[o.jsx("textarea",{ref:b=>{y.current=b,typeof x=="function"?x(b):x&&(x.current=b)},rows:i,disabled:t,placeholder:d,onInput:v,className:"gryt-composer-textarea disabled:cursor-not-allowed disabled:opacity-60",...p}),o.jsx(de,{type:"submit",disabled:t,size:"small",endIcon:o.jsx(P.PaperPlaneTilt,{size:14,weight:"fill"}),children:u})]})}),Ye={small:"h-8 w-8 text-xs",medium:"h-10 w-10 text-sm",large:"h-12 w-12 text-base"},oe=256,pe=s.forwardRef(function({alt:e,children:t,className:r,fallback:i,seed:l,eggSeed:d,size:u="medium",src:p,...x},y){const v=s.useMemo(()=>l?K.owlAvatarDataUri(l,{size:oe}):void 0,[l]),E=s.useMemo(()=>d?K.eggAvatarDataUri(d,{size:oe}):void 0,[d]),b=v??E;return o.jsxs(X.Avatar.Root,{ref:y,className:n("gryt-avatar inline-flex shrink-0 items-center justify-center overflow-hidden align-middle select-none","rounded-(--gryt-radius-full) bg-gryt-surface-raised font-medium text-gryt-text ring-1 ring-gryt-border",Ye[u],r),...x,children:[p?o.jsx(X.Avatar.Image,{src:p,alt:e,className:"h-full w-full object-cover"}):null,o.jsx(X.Avatar.Fallback,{className:"flex h-full w-full items-center justify-center",children:b?o.jsx("img",{src:b,alt:e,className:"h-full w-full object-cover"}):i??t})]})}),He=s.forwardRef(function({active:e=!1,avatar:t,className:r,subtitle:i,title:l,...d},u){return o.jsxs("button",{ref:u,type:"button",className:n("gryt-conversation-item enabled:cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",e?"bg-gryt-accent text-gryt-on-accent":"text-gryt-text hover:bg-white/5",r),...d,children:[t??o.jsx(pe,{size:"small",className:n(e?"bg-gryt-on-accent text-gryt-accent-9 ring-transparent":"bg-gryt-surface-raised text-gryt-text"),children:l.slice(0,1).toUpperCase()}),o.jsxs("span",{className:"min-w-0 flex-1",children:[o.jsx("span",{className:"block truncate text-sm font-semibold",children:l}),i?o.jsx("span",{className:n("block truncate text-xs",e?"text-gryt-on-accent/85":"text-gryt-muted"),children:i}):null]})]})}),Ve=s.forwardRef(function({badgeContent:e,children:t,className:r,max:i=99,showZero:l=!1,...d},u){const p=typeof e=="number"?e:null,x=p!==null&&p===0&&!l,y=p!==null&&p>i?`${i}+`:e;return o.jsxs("span",{ref:u,className:n("gryt-badge relative inline-flex",r),...d,children:[t,e!==void 0&&!x?o.jsx("span",{className:n("gryt-badge-dot absolute -top-1 -right-1 z-10 inline-flex items-center justify-center","min-w-5 rounded-(--gryt-radius-full) px-1.5 py-0.5","bg-gryt-accent text-[0.65rem] leading-none font-semibold text-gryt-on-accent","ring-2 ring-gryt-bg"),children:y}):null]})}),Xe={neutral:"border-gryt-border bg-gryt-surface-raised text-gryt-text",primary:"border-gryt-accent-6 bg-gryt-accent-3 text-gryt-accent-11",secondary:"border-gryt-secondary-6 bg-gryt-secondary-3 text-gryt-secondary-11",success:"border-gryt-success-6 bg-gryt-success-3 text-gryt-success-11",warning:"border-gryt-warning-6 bg-gryt-warning-3 text-gryt-warning-11",danger:"border-gryt-danger-6 bg-gryt-danger-3 text-gryt-danger-11"},Ue=s.forwardRef(function({children:e,className:t,icon:r,label:i,onDelete:l,tone:d="neutral",...u},p){return o.jsxs("span",{ref:p,className:n("gryt-chip inline-flex items-center gap-1.5 rounded-(--gryt-radius-full) border px-3 py-1 text-xs font-medium",Xe[d],t),...u,children:[r,i??e,l?o.jsx("button",{type:"button","aria-label":"Remove",onClick:l,className:n("-mr-1 inline-flex h-4 w-4 cursor-pointer items-center justify-center rounded-(--gryt-radius-full)","opacity-70 transition-opacity hover:opacity-100",f),children:o.jsx(P.X,{size:10,weight:"bold","aria-hidden":"true"})}):null]})}),Ke=s.forwardRef(function({className:e,tone:t="primary",...r},i){return o.jsx(J.Checkbox.Root,{ref:i,className:n("gryt-checkbox flex h-5 w-5 shrink-0 items-center justify-center","rounded-(--gryt-radius-sm) border border-gryt-border bg-gryt-surface-raised","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","data-checked:border-transparent","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.08]","motion-safe:active:not-data-disabled:scale-[0.92]",f,$,Ge[t],e),...r,children:o.jsx(J.Checkbox.Indicator,{keepMounted:!0,className:n("flex origin-center","transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring","data-unchecked:scale-0 data-unchecked:opacity-0","motion-reduce:transition-none"),children:o.jsx(P.Check,{size:12,weight:"bold"})})})}),We=s.forwardRef(function({className:e,tone:t="primary",...r},i){return o.jsx(ee.Radio.Root,{ref:i,className:n("gryt-radio flex h-5 w-5 shrink-0 items-center justify-center","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.08]","motion-safe:active:not-data-disabled:scale-[0.92]",f,$,Le[t],e),...r,children:o.jsx(ee.Radio.Indicator,{keepMounted:!0,className:n("h-2.5 w-2.5 origin-center rounded-(--gryt-radius-full)","transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring","data-unchecked:scale-0 data-unchecked:opacity-0","motion-reduce:transition-none",ye[t])})})}),Qe=s.forwardRef(function({className:e,...t},r){return o.jsx(je.RadioGroup,{ref:r,className:n("gryt-radio-group flex flex-col gap-2",e),...t})}),Ze=s.forwardRef(function({className:e,tone:t="primary",...r},i){return o.jsx(te.Switch.Root,{ref:i,className:n("gryt-switch relative inline-flex h-6 w-10 shrink-0 items-center","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised p-0.5","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","data-checked:border-transparent","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.05]","motion-safe:active:not-data-disabled:scale-[0.95]",f,$,Oe[t],e),...r,children:o.jsx(te.Switch.Thumb,{className:n("h-4.5 w-4.5 rounded-(--gryt-radius-full) bg-gryt-text","transition-transform duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-checked:translate-x-4 data-checked:bg-gryt-bg")})})}),ae=3;function Je({className:a,tone:e="primary","aria-label":t,...r}){const[i,l]=s.useState(!1),d=s.useRef(null);s.useEffect(()=>{if(!i&&d.current===null)return;const y=()=>{d.current=null,l(!1)};return window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y),()=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y)}},[i]);function u(y){d.current={x:y.clientX,y:y.clientY}}function p(y){const v=d.current;if(v===null||i)return;(Math.abs(y.clientX-v.x)>ae||Math.abs(y.clientY-v.y)>ae)&&l(!0)}const x=i?"transition-none":"duration-(--gryt-dur-spring) ease-spring-tight motion-reduce:transition-none";return o.jsx(F.Slider.Root,{className:n("gryt-slider w-full",a),...r,children:o.jsx(F.Slider.Control,{className:"flex w-full cursor-pointer touch-none items-center py-2 select-none",onPointerDown:u,onPointerMove:p,children:o.jsxs(F.Slider.Track,{className:"h-1.5 w-full rounded-(--gryt-radius-full) bg-gryt-surface-raised select-none",children:[o.jsx(F.Slider.Indicator,{className:n("h-full rounded-(--gryt-radius-full) select-none","transition-[width]",x,ye[e])}),o.jsx(F.Slider.Thumb,{"aria-label":t,className:n("group h-4 w-4 rounded-(--gryt-radius-full) select-none","transition-[inset-inline-start]",x,Ie),children:o.jsx("span",{className:n("block h-full w-full rounded-(--gryt-radius-full) bg-gryt-text","transition-[scale] duration-(--gryt-dur-spring) ease-spring","motion-safe:group-hover:scale-[1.12] motion-safe:group-active:scale-[0.94]","motion-reduce:transition-none")})})]})})})}const et={small:"min-h-9 px-3 text-sm",medium:"min-h-11 px-4 text-sm"};function tt({className:a,label:e,options:t=[],placeholder:r="Select",size:i="medium",...l}){const d=ce();return o.jsxs(h.Select.Root,{items:t,...l,children:[o.jsxs("div",{className:n("gryt-select flex w-full flex-col gap-1.5",a),children:[e?o.jsx(h.Select.Label,{className:"text-xs font-medium text-gryt-muted",children:e}):null,o.jsxs(h.Select.Trigger,{className:n("flex w-full cursor-pointer items-center justify-between gap-2","rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface-raised","text-gryt-text select-none","transition-colors duration-150 hover:border-gryt-accent-light","data-disabled:cursor-not-allowed data-disabled:opacity-60",f,et[i]),children:[o.jsx(h.Select.Value,{placeholder:r}),o.jsx(h.Select.Icon,{className:"shrink-0 text-gryt-muted",children:o.jsx(P.CaretUpDown,{size:16})})]})]}),o.jsx(h.Select.Portal,{container:d,children:o.jsx(h.Select.Positioner,{sideOffset:6,className:"gryt-select-positioner outline-none",children:o.jsx(h.Select.Popup,{className:n("min-w-(--anchor-width) p-1",I,k),children:o.jsx(h.Select.List,{children:t.map(u=>o.jsxs(h.Select.Item,{value:u.value,disabled:u.disabled,className:n("flex cursor-pointer items-center justify-between gap-2","rounded-(--gryt-radius-md) px-3 py-2 text-sm text-gryt-text","outline-none select-none data-highlighted:bg-gryt-surface-raised","data-disabled:cursor-not-allowed data-disabled:opacity-50"),children:[o.jsx(h.Select.ItemText,{children:u.label}),o.jsx(h.Select.ItemIndicator,{className:"text-gryt-accent-11",children:o.jsx(P.Check,{size:14,weight:"bold"})})]},String(u.value)))})})})})]})}function rt({children:a,className:e,side:t="top",sideOffset:r=8,title:i}){const l=ce();return o.jsxs(M.Tooltip.Root,{children:[o.jsx(M.Tooltip.Trigger,{render:a}),o.jsx(M.Tooltip.Portal,{container:l,children:o.jsx(M.Tooltip.Positioner,{side:t,sideOffset:r,className:"gryt-tooltip-positioner",children:o.jsx(M.Tooltip.Popup,{className:n("gryt-tooltip rounded-(--gryt-radius-md) border border-gryt-border bg-gryt-surface-raised","px-2.5 py-1.5 text-xs text-gryt-text",k,e),children:i})})})]})}const ot=M.Tooltip.Provider,at=s.forwardRef(function({className:e,orientation:t="horizontal",...r},i){return o.jsx(Pe.Separator,{ref:i,orientation:t,className:n("gryt-divider bg-gryt-border",t==="vertical"?"h-full w-px":"h-px w-full",e),...r})}),nt=s.forwardRef(function({className:e,...t},r){return o.jsx("div",{ref:r,className:n("gryt-card rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface text-gryt-text",e),...t})});function st({children:a,className:e,subheader:t,title:r,...i}){return o.jsxs("div",{className:n("gryt-card-header flex flex-col gap-1 p-4",e),...i,children:[r?o.jsx("span",{className:"text-base font-semibold text-gryt-text",children:r}):null,t?o.jsx("span",{className:"text-sm text-gryt-muted",children:t}):null,a]})}function it({className:a,...e}){return o.jsx("div",{className:n("gryt-card-content px-4 pb-4 text-sm text-gryt-muted",a),...e})}function lt({className:a,...e}){return o.jsx("div",{className:n("gryt-card-actions flex items-center gap-2 px-4 pb-4",a),...e})}const ct={info:"border-gryt-secondary-6 bg-gryt-secondary-3 text-gryt-secondary-11",success:"border-gryt-success-6 bg-gryt-success-3 text-gryt-success-11",warning:"border-gryt-warning-6 bg-gryt-warning-3 text-gryt-warning-11",error:"border-gryt-danger-6 bg-gryt-danger-3 text-gryt-danger-11"},dt=s.forwardRef(function({className:e,severity:t="info",...r},i){return o.jsx("div",{ref:i,role:"alert",className:n("gryt-alert rounded-(--gryt-radius-lg) border px-4 py-3 text-sm",ct[t],e),...r})});function ut({className:a,value:e=null,...t}){return o.jsx(U.Progress.Root,{value:e,className:n("gryt-progress w-full",a),...t,children:o.jsx(U.Progress.Track,{className:"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised",children:o.jsx(U.Progress.Indicator,{className:n("h-full rounded-(--gryt-radius-full) bg-gryt-accent","transition-[width] duration-300 ease-out motion-reduce:transition-none",e===null&&"gryt-progress-indeterminate")})})})}function gt({className:a,size:e=24,"aria-label":t="Loading"}){return o.jsx(P.CircleNotch,{role:"status","aria-label":t,size:e,weight:"bold",className:n("gryt-spinner text-gryt-accent-11 motion-safe:animate-spin",a)})}const yt={text:"h-4 rounded-(--gryt-radius-sm)",rounded:"rounded-(--gryt-radius-lg)",circular:"rounded-(--gryt-radius-full)",rectangular:"rounded-none"};function pt({className:a,height:e,style:t,variant:r="text",width:i,...l}){const d={width:i,height:e,...t};return o.jsx("div",{"aria-hidden":"true",className:n("gryt-skeleton bg-white/9 motion-safe:animate-pulse",yt[r],a),style:d,...l})}const me="transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none",mt=s.forwardRef(function({className:e,...t},r){return o.jsx(C.Dialog.Backdrop,{ref:r,className:n("gryt-dialog-backdrop fixed inset-0 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)",me,"data-starting-style:opacity-0 data-ending-style:opacity-0",e),...t})}),bt=s.forwardRef(function({className:e,...t},r){return o.jsx(C.Dialog.Popup,{ref:r,className:n("gryt-dialog fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2","flex w-[32rem] max-w-[calc(100vw-3rem)] flex-col gap-4","rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-gryt-text",me,"data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0",e),...t})}),ft=s.forwardRef(function({className:e,...t},r){return o.jsx(C.Dialog.Title,{ref:r,className:n("gryt-dialog-title text-base font-semibold text-gryt-text",e),...t})}),xt=s.forwardRef(function({className:e,...t},r){return o.jsx(C.Dialog.Description,{ref:r,className:n("gryt-dialog-description text-sm text-gryt-muted",e),...t})}),ht=s.forwardRef(function({className:e,...t},r){return o.jsx("div",{ref:r,className:n("gryt-dialog-footer flex justify-end gap-3",e),...t})}),wt={Root:C.Dialog.Root,Trigger:C.Dialog.Trigger,Portal:C.Dialog.Portal,Close:C.Dialog.Close,Backdrop:mt,Popup:bt,Title:ft,Description:xt,Footer:ht},vt=()=>()=>{};function be(a){const e=s.useCallback(r=>{if(typeof window>"u"||!window.matchMedia)return vt();const i=window.matchMedia(a);return i.addEventListener("change",r),()=>i.removeEventListener("change",r)},[a]),t=s.useCallback(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(a).matches,[a]);return s.useSyncExternalStore(e,t,()=>!1)}const jt={left:"left",right:"right",top:"up",bottom:"down"},H=s.createContext("right"),Pt={left:"items-stretch justify-start",right:"items-stretch justify-end",top:"items-start justify-center",bottom:"items-end justify-center"},Nt={left:"rounded-r-(--gryt-radius-xl)",right:"rounded-l-(--gryt-radius-xl)",top:"rounded-b-(--gryt-radius-xl)",bottom:"rounded-t-(--gryt-radius-xl)"},Rt={left:["h-full w-[calc(20rem+var(--gryt-drawer-bleed))] max-w-[calc(85vw+var(--gryt-drawer-bleed))]","-ml-(--gryt-drawer-bleed) border-r py-5 pr-5 pl-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateX(var(--drawer-swipe-movement-x))]","data-starting-style:[transform:translateX(calc(-100%+var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateX(calc(-100%+var(--gryt-drawer-bleed)))]"].join(" "),right:["h-full w-[calc(20rem+var(--gryt-drawer-bleed))] max-w-[calc(85vw+var(--gryt-drawer-bleed))]","-mr-(--gryt-drawer-bleed) border-l py-5 pl-5 pr-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateX(var(--drawer-swipe-movement-x))]","data-starting-style:[transform:translateX(calc(100%-var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateX(calc(100%-var(--gryt-drawer-bleed)))]"].join(" "),top:["w-full max-h-[calc(85vh+var(--gryt-drawer-bleed))]","-mt-(--gryt-drawer-bleed) border-b px-5 pb-5 pt-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateY(var(--drawer-swipe-movement-y))]","data-starting-style:[transform:translateY(calc(-100%+var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateY(calc(-100%+var(--gryt-drawer-bleed)))]"].join(" "),bottom:["w-full max-h-[calc(85vh+var(--gryt-drawer-bleed))]","-mb-(--gryt-drawer-bleed) border-t px-5 pt-5 pb-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateY(var(--drawer-swipe-movement-y))]","data-starting-style:[transform:translateY(calc(100%-var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateY(calc(100%-var(--gryt-drawer-bleed)))]"].join(" ")};function Tt({side:a="right",sheetOnMobile:e=!0,children:t,...r}){const i=be("(max-width: 767px)"),l=e&&i?"bottom":a;return o.jsx(H.Provider,{value:l,children:o.jsx(j.Drawer.Root,{swipeDirection:jt[l],...r,children:t})})}const Ct=s.forwardRef(function({className:e,...t},r){const i=s.useContext(H);return o.jsx(j.Drawer.Viewport,{ref:r,className:n("gryt-drawer-viewport fixed inset-0 z-50 flex",Pt[i],e),...t})}),St=s.forwardRef(function({className:e,...t},r){const i=s.useContext(H);return o.jsx(j.Drawer.Popup,{ref:r,className:n("gryt-drawer flex flex-col gap-4 border-gryt-border bg-gryt-surface text-gryt-text","overflow-y-auto overscroll-contain outline-none","transition-transform duration-(--gryt-dur-spring-soft) ease-spring-tight","data-swiping:duration-0 data-swiping:select-none","motion-reduce:transition-none",Rt[i],Nt[i],e),...t})}),kt=s.forwardRef(function({className:e,...t},r){return o.jsx(j.Drawer.Backdrop,{ref:r,className:n("gryt-drawer-backdrop fixed inset-0 z-50 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)","[opacity:calc(1-var(--drawer-swipe-progress,0))]","transition-opacity duration-(--gryt-dur-spring-soft) ease-spring-tight","data-swiping:duration-0","data-starting-style:opacity-0 data-ending-style:opacity-0","motion-reduce:transition-none",e),...t})});function At({className:a}){const e=s.useContext(H);return e!=="bottom"&&e!=="top"?null:o.jsx("div",{"aria-hidden":!0,className:n("gryt-drawer-grabber mx-auto h-1.5 w-10 shrink-0 rounded-(--gryt-radius-full) bg-gryt-border",e==="top"&&"order-last",a)})}const Mt={Root:Tt,Trigger:j.Drawer.Trigger,Portal:j.Drawer.Portal,Backdrop:kt,Viewport:Ct,Popup:St,Content:j.Drawer.Content,Grabber:At,Close:j.Drawer.Close,Title:j.Drawer.Title,Description:j.Drawer.Description},Dt=s.forwardRef(function({className:e,sideOffset:t=8,...r},i){return o.jsx(D.Menu.Positioner,{ref:i,sideOffset:t,className:n("gryt-menu-positioner outline-none",e),...r})}),It=s.forwardRef(function({className:e,...t},r){return o.jsx(D.Menu.Popup,{ref:r,className:n("gryt-menu min-w-44 p-1 outline-none",I,k,e),...t})}),Gt=s.forwardRef(function({className:e,...t},r){return o.jsx(D.Menu.Item,{ref:r,className:n("gryt-menu-item flex cursor-pointer items-center gap-2 rounded-(--gryt-radius-md)","px-3 py-2 text-sm text-gryt-text outline-none select-none","data-highlighted:bg-gryt-surface-raised","data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...t})}),Lt=s.forwardRef(function({className:e,...t},r){return o.jsx(D.Menu.Separator,{ref:r,className:n("gryt-menu-separator my-1 h-px bg-gryt-border",e),...t})}),Y={Root:D.Menu.Root,Trigger:D.Menu.Trigger,Portal:D.Menu.Portal,Positioner:Dt,Popup:It,Item:Gt,Separator:Lt},Ot=s.forwardRef(function({className:e,...t},r){return o.jsx(z.Tabs.Root,{ref:r,className:n("gryt-tabs","data-[orientation=vertical]:flex data-[orientation=vertical]:items-stretch",e),...t})}),$t=s.forwardRef(function({className:e,...t},r){return o.jsx(z.Tabs.List,{ref:r,className:n("gryt-tabs-list relative inline-flex items-center gap-1 rounded-(--gryt-radius-full) bg-gryt-surface-raised p-1","data-[orientation=vertical]:flex data-[orientation=vertical]:shrink-0","data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch","data-[orientation=vertical]:rounded-(--gryt-radius-lg)",e),...t})}),fe=s.forwardRef(function({className:e,...t},r){return o.jsx(z.Tabs.Tab,{ref:r,className:n("gryt-tab inline-flex min-h-8 cursor-pointer items-center justify-center whitespace-nowrap","rounded-(--gryt-radius-full) border-0 bg-transparent px-4 py-1.5","text-sm font-medium text-gryt-muted select-none","relative z-10 hover:text-gryt-text","transition-[scale,color,background-color] duration-(--gryt-dur-spring) ease-spring","motion-safe:hover:scale-[1.03] motion-safe:active:scale-[0.96]","motion-reduce:transition-colors motion-reduce:duration-150","data-active:text-gryt-on-accent","data-[orientation=vertical]:min-h-9 data-[orientation=vertical]:justify-start","data-[orientation=vertical]:gap-2.5 data-[orientation=vertical]:px-3","data-[orientation=vertical]:rounded-(--gryt-radius-md)","data-disabled:cursor-not-allowed data-disabled:opacity-50",f,e),...t})}),Ft=s.forwardRef(function({className:e,...t},r){return o.jsx(z.Tabs.Indicator,{ref:r,renderBeforeHydration:!0,className:n("gryt-tabs-indicator absolute top-1 left-0 z-0 h-[calc(100%-0.5rem)]","w-(--active-tab-width) translate-x-(--active-tab-left)","rounded-(--gryt-radius-full) bg-gryt-accent","transition-[translate,width] duration-(--gryt-dur-spring) ease-spring","motion-reduce:transition-none","[[data-orientation=vertical]_&]:top-0 [[data-orientation=vertical]_&]:left-1","[[data-orientation=vertical]_&]:h-(--active-tab-height)","[[data-orientation=vertical]_&]:w-[calc(100%-0.5rem)]","[[data-orientation=vertical]_&]:translate-x-0","[[data-orientation=vertical]_&]:translate-y-(--active-tab-top)","[[data-orientation=vertical]_&]:rounded-(--gryt-radius-md)","[[data-orientation=vertical]_&]:transition-[translate,height]",e),...t})}),qt=s.forwardRef(function({className:e,...t},r){return o.jsx(z.Tabs.Panel,{ref:r,className:n("gryt-tabs-panel pt-3 text-sm text-gryt-text","data-[orientation=vertical]:min-w-0 data-[orientation=vertical]:flex-1","data-[orientation=vertical]:pt-0 data-[orientation=vertical]:pl-4",e),...t})}),Bt=Object.assign(Ot,{List:$t,Tab:fe,Panel:qt,Indicator:Ft}),zt=s.forwardRef(function({className:e,...t},r){return o.jsx(B.Accordion.Root,{ref:r,className:n("gryt-accordion flex w-full flex-col gap-2 rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface p-2",e),...t})}),Et=s.forwardRef(function({className:e,...t},r){return o.jsx(B.Accordion.Item,{ref:r,className:n("gryt-accordion-item",e),...t})}),_t=s.forwardRef(function({children:e,className:t,expandIcon:r,...i},l){return o.jsx(B.Accordion.Header,{className:"gryt-accordion-header m-0",children:o.jsxs(B.Accordion.Trigger,{ref:l,className:n("gryt-accordion-trigger flex w-full cursor-pointer items-center justify-between gap-3","rounded-(--gryt-radius-lg) border-0 bg-transparent px-3 py-2.5","text-left text-sm font-medium text-gryt-text select-none","transition-colors duration-150 hover:bg-gryt-surface-raised","data-disabled:cursor-not-allowed data-disabled:opacity-50",f,t),...i,children:[e,r===void 0?o.jsx(P.CaretDown,{size:16,className:"shrink-0 transition-transform duration-(--gryt-dur-spring) ease-spring data-panel-open:rotate-180 motion-reduce:transition-none"}):r]})})}),Yt=s.forwardRef(function({children:e,className:t,...r},i){return o.jsx(B.Accordion.Panel,{ref:i,className:n("gryt-accordion-panel overflow-hidden text-sm text-gryt-muted","h-[var(--accordion-panel-height)] transition-[height] duration-(--gryt-dur-spring-soft) ease-spring","data-starting-style:h-0 data-ending-style:h-0","motion-reduce:transition-none",t),...r,children:o.jsx("div",{className:"px-3 pt-1 pb-3",children:e})})}),Ht=Object.assign(zt,{Item:Et,Trigger:_t,Panel:Yt}),Vt=s.forwardRef(function({className:e,sideOffset:t=2,...r},i){return o.jsx(T.ContextMenu.Positioner,{ref:i,sideOffset:t,className:n("gryt-context-menu-positioner outline-none",e),...r})}),Xt={Root:T.ContextMenu.Root,Trigger:T.ContextMenu.Trigger,Portal:T.ContextMenu.Portal,Positioner:Vt,Popup:Y.Popup,Item:Y.Item,Separator:Y.Separator,Group:T.ContextMenu.Group,GroupLabel:T.ContextMenu.GroupLabel,SubmenuRoot:T.ContextMenu.SubmenuRoot,SubmenuTrigger:T.ContextMenu.SubmenuTrigger},Ut=s.forwardRef(function({className:e,sideOffset:t=8,...r},i){return o.jsx(N.Popover.Positioner,{ref:i,sideOffset:t,className:n("gryt-popover-positioner outline-none",e),...r})}),Kt=s.forwardRef(function({className:e,...t},r){return o.jsx(N.Popover.Popup,{ref:r,className:n("gryt-popover max-w-[min(20rem,calc(100vw-2rem))] p-4 outline-none",I,k,e),...t})}),Wt=s.forwardRef(function({className:e,...t},r){return o.jsx(N.Popover.Title,{ref:r,className:n("gryt-popover-title text-sm font-semibold text-gryt-text",e),...t})}),Qt=s.forwardRef(function({className:e,...t},r){return o.jsx(N.Popover.Description,{ref:r,className:n("gryt-popover-description mt-1 text-sm leading-6 text-gryt-muted",e),...t})}),Zt={Root:N.Popover.Root,Trigger:N.Popover.Trigger,Portal:N.Popover.Portal,Positioner:Ut,Popup:Kt,Title:Wt,Description:Qt,Close:N.Popover.Close,Arrow:N.Popover.Arrow},Jt={neutral:"border-white/8 bg-gryt-surface",info:"border-gryt-secondary-6 bg-gryt-secondary-2",success:"border-gryt-success-6 bg-gryt-success-2",warning:"border-gryt-warning-6 bg-gryt-warning-2",danger:"border-gryt-danger-6 bg-gryt-danger-2"},er=s.forwardRef(function({className:e,...t},r){return o.jsx(R.Toast.Viewport,{ref:r,className:n("gryt-toast-viewport fixed right-4 bottom-4 z-50 flex w-[min(22rem,calc(100vw-2rem))]","flex-col gap-2 outline-none",e),...t})}),tr=s.forwardRef(function({className:e,severity:t="neutral",...r},i){return o.jsx(R.Toast.Root,{ref:i,className:n("gryt-toast relative flex flex-col p-3 pr-9","rounded-(--gryt-radius-xl) border text-gryt-text",Jt[t],"transition-[opacity,transform] duration-(--gryt-dur-spring) ease-spring","data-starting-style:translate-y-2 data-starting-style:opacity-0","data-ending-style:translate-y-2 data-ending-style:opacity-0","motion-reduce:transition-none",e),...r})}),rr=s.forwardRef(function({className:e,...t},r){return o.jsx(R.Toast.Title,{ref:r,className:n("gryt-toast-title text-sm font-semibold text-gryt-text",e),...t})}),or=s.forwardRef(function({className:e,...t},r){return o.jsx(R.Toast.Description,{ref:r,className:n("gryt-toast-description mt-0.5 text-sm leading-6 text-gryt-muted",e),...t})}),ar=s.forwardRef(function({className:e,children:t,...r},i){return o.jsx(R.Toast.Close,{ref:i,"aria-label":"Close",className:n("gryt-toast-close absolute top-2.5 right-2.5 inline-flex h-6 w-6 items-center justify-center","rounded-(--gryt-radius-full) border-0 bg-transparent text-gryt-muted","transition-colors hover:bg-white/8 hover:text-gryt-text motion-reduce:transition-none","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",e),...r,children:t??o.jsx(P.X,{size:14,weight:"bold"})})}),nr=s.forwardRef(function({className:e,...t},r){return o.jsx(R.Toast.Action,{ref:r,className:n("gryt-toast-action mt-2 self-start rounded-(--gryt-radius-full) border-0","bg-gryt-accent px-3 py-1.5 text-sm font-medium text-gryt-on-accent","transition-[scale] duration-(--gryt-dur-spring) ease-spring","motion-safe:hover:scale-[1.04] motion-safe:active:scale-[0.96]","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",e),...t})}),sr={Provider:R.Toast.Provider,Portal:R.Toast.Portal,Viewport:er,Root:tr,Title:rr,Description:or,Close:ar,Action:nr},ir=R.Toast.useToastManager,lr=s.forwardRef(function({className:e,...t},r){return o.jsx(O.ScrollArea.Root,{ref:r,className:n("gryt-scroll-area relative",e),...t})}),cr=s.forwardRef(function({className:e,...t},r){return o.jsx(O.ScrollArea.Viewport,{ref:r,className:n("gryt-scroll-area-viewport h-full w-full overscroll-contain","focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-gryt-accent-light",e),...t})}),dr=s.forwardRef(function({className:e,orientation:t,...r},i){return o.jsx(O.ScrollArea.Scrollbar,{ref:i,orientation:t,className:n("gryt-scroll-area-scrollbar flex touch-none p-0.5 select-none","opacity-0 transition-opacity duration-(--gryt-dur-fast)","data-hovering:opacity-100 data-scrolling:opacity-100","motion-reduce:transition-none",t==="horizontal"?"h-2 flex-col":"w-2",e),...r,children:o.jsx(O.ScrollArea.Thumb,{className:"flex-1 rounded-(--gryt-radius-full) bg-gryt-border transition-colors hover:bg-gryt-muted motion-reduce:transition-none"})})}),ur={Root:lr,Viewport:cr,Scrollbar:dr,Content:O.ScrollArea.Content,Corner:O.ScrollArea.Corner},gr={primary:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-accent data-pressed:text-gryt-on-accent","data-pressed:hover:not-data-disabled:bg-gryt-accent"].join(" "),secondary:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-secondary data-pressed:text-gryt-on-secondary","data-pressed:hover:not-data-disabled:bg-gryt-secondary"].join(" "),neutral:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-surface-hover data-pressed:text-gryt-text"].join(" "),danger:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-danger data-pressed:text-gryt-on-danger","data-pressed:hover:not-data-disabled:bg-gryt-danger"].join(" ")},yr={xsmall:"h-8 min-w-8 px-2 text-xs",small:"h-9 min-w-9 px-2.5 text-sm",medium:"h-10 min-w-10 px-3 text-sm",large:"h-12 min-w-12 px-4 text-base"},pr=s.forwardRef(function({className:e,size:t="medium",tone:r="primary",...i},l){return o.jsx(Ne.Toggle,{ref:l,className:n("gryt-toggle","inline-flex shrink-0 items-center justify-center gap-2 border-0 bg-transparent","rounded-(--gryt-radius-full) font-medium select-none","transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring","motion-safe:hover:not-data-disabled:scale-[1.06]","motion-safe:active:not-data-disabled:scale-[0.94]",f,$,yr[t],gr[r],e),...i})}),mr=s.forwardRef(function({className:e,...t},r){return o.jsx(Re.ToggleGroup,{ref:r,className:n("gryt-toggle-group inline-flex items-center gap-1","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface p-1",e),...t})}),br={primary:"bg-gryt-accent",success:"bg-gryt-success",warning:"bg-gryt-warning",danger:"bg-gryt-danger"};function fr({className:a,value:e,label:t,showValue:r=!1,tone:i="primary",...l}){return o.jsxs(q.Meter.Root,{value:e,className:n("gryt-meter flex w-full flex-col gap-1.5",a),...l,children:[(t||r)&&o.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[t?o.jsx(q.Meter.Label,{className:"text-sm text-gryt-muted",children:t}):o.jsx("span",{}),r&&o.jsx(q.Meter.Value,{className:"font-mono text-xs text-gryt-muted tabular-nums"})]}),o.jsx(q.Meter.Track,{className:"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised",children:o.jsx(q.Meter.Indicator,{className:n("h-full rounded-(--gryt-radius-full)","transition-[width] duration-120 ease-out motion-reduce:transition-none",br[i])})})]})}const xr=s.forwardRef(function({className:e,...t},r){return o.jsx(S.AlertDialog.Popup,{ref:r,className:n("gryt-alert-dialog fixed top-1/2 left-1/2 z-50 -translate-x-1/2 -translate-y-1/2","flex w-[32rem] max-w-[calc(100vw-3rem)] flex-col gap-4","rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-gryt-text","outline-none","transition-[opacity,scale] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0",e),...t})}),hr=s.forwardRef(function({className:e,...t},r){return o.jsx(S.AlertDialog.Backdrop,{ref:r,className:n("gryt-alert-dialog-backdrop fixed inset-0 z-50 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)","transition-opacity duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:opacity-0 data-ending-style:opacity-0",e),...t})}),wr=s.forwardRef(function({className:e,...t},r){return o.jsx(S.AlertDialog.Title,{ref:r,className:n("gryt-alert-dialog-title text-lg font-semibold text-gryt-text",e),...t})}),vr=s.forwardRef(function({className:e,...t},r){return o.jsx(S.AlertDialog.Description,{ref:r,className:n("gryt-alert-dialog-description text-sm leading-6 text-gryt-muted",e),...t})}),jr={Root:S.AlertDialog.Root,Trigger:S.AlertDialog.Trigger,Portal:S.AlertDialog.Portal,Backdrop:hr,Popup:xr,Title:wr,Description:vr,Close:S.AlertDialog.Close},xe=["flex cursor-default items-center gap-2 rounded-(--gryt-radius-md)","px-3 py-2 text-sm text-gryt-text outline-none select-none","data-highlighted:bg-gryt-surface-raised","data-selected:text-gryt-accent-11","data-disabled:cursor-not-allowed data-disabled:opacity-50"].join(" "),he=[ue,ge.medium,"border-gryt-border",f].join(" "),Pr=s.forwardRef(function({className:e,...t},r){return o.jsx(g.Combobox.Input,{ref:r,className:n("gryt-combobox-input",he,e),...t})}),Nr=s.forwardRef(function({className:e,sideOffset:t=6,...r},i){return o.jsx(g.Combobox.Positioner,{ref:i,sideOffset:t,className:n("gryt-combobox-positioner outline-none",e),...r})}),Rr=s.forwardRef(function({className:e,...t},r){return o.jsx(g.Combobox.Popup,{ref:r,className:n("gryt-combobox max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none",I,k,e),...t})}),Tr=s.forwardRef(function({className:e,...t},r){return o.jsx(g.Combobox.Item,{ref:r,className:n("gryt-combobox-item",xe,e),...t})}),Cr=s.forwardRef(function({className:e,...t},r){return o.jsx(g.Combobox.Empty,{ref:r,className:n("gryt-combobox-empty px-3 py-2 text-sm text-gryt-muted",e),...t})}),Sr={Root:g.Combobox.Root,Input:Pr,InputGroup:g.Combobox.InputGroup,Trigger:g.Combobox.Trigger,Icon:g.Combobox.Icon,Clear:g.Combobox.Clear,Value:g.Combobox.Value,Chips:g.Combobox.Chips,Chip:g.Combobox.Chip,ChipRemove:g.Combobox.ChipRemove,Portal:g.Combobox.Portal,Positioner:Nr,Popup:Rr,List:g.Combobox.List,Item:Tr,ItemIndicator:g.Combobox.ItemIndicator,Group:g.Combobox.Group,GroupLabel:g.Combobox.GroupLabel,Empty:Cr,Separator:g.Combobox.Separator},kr=s.forwardRef(function({className:e,...t},r){return o.jsx(m.Autocomplete.Input,{ref:r,className:n("gryt-autocomplete-input",he,e),...t})}),Ar=s.forwardRef(function({className:e,sideOffset:t=6,...r},i){return o.jsx(m.Autocomplete.Positioner,{ref:i,sideOffset:t,className:n("gryt-autocomplete-positioner outline-none",e),...r})}),Mr=s.forwardRef(function({className:e,...t},r){return o.jsx(m.Autocomplete.Popup,{ref:r,className:n("gryt-autocomplete max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none",I,k,e),...t})}),Dr=s.forwardRef(function({className:e,...t},r){return o.jsx(m.Autocomplete.Item,{ref:r,className:n("gryt-autocomplete-item",xe,e),...t})}),Ir=s.forwardRef(function({className:e,...t},r){return o.jsx(m.Autocomplete.Empty,{ref:r,className:n("gryt-autocomplete-empty px-3 py-2 text-sm text-gryt-muted",e),...t})}),Gr={Root:m.Autocomplete.Root,Input:kr,InputGroup:m.Autocomplete.InputGroup,Trigger:m.Autocomplete.Trigger,Icon:m.Autocomplete.Icon,Clear:m.Autocomplete.Clear,Value:m.Autocomplete.Value,Portal:m.Autocomplete.Portal,Positioner:Ar,Popup:Mr,List:m.Autocomplete.List,Item:Dr,Group:m.Autocomplete.Group,GroupLabel:m.Autocomplete.GroupLabel,Empty:Ir,Separator:m.Autocomplete.Separator},Lr=s.forwardRef(function({className:e,...t},r){return o.jsx(Te.CheckboxGroup,{ref:r,className:n("gryt-checkbox-group flex flex-col gap-2",e),...t})}),Or=s.forwardRef(function({className:e,...t},r){return o.jsx(W.Collapsible.Trigger,{ref:r,className:n("gryt-collapsible-trigger flex w-full items-center justify-between gap-2","rounded-(--gryt-radius-md) border-0 bg-transparent px-2 py-2 text-left","text-sm font-medium text-gryt-text select-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none",f,e),...t})}),$r=s.forwardRef(function({className:e,...t},r){return o.jsx(W.Collapsible.Panel,{ref:r,className:n("gryt-collapsible-panel overflow-hidden","h-(--collapsible-panel-height) transition-[height] duration-(--gryt-dur-spring) ease-spring","data-starting-style:h-0 data-ending-style:h-0","motion-reduce:transition-none",e),...t})}),Fr={Root:W.Collapsible.Root,Trigger:Or,Panel:$r},qr=s.forwardRef(function({className:e,...t},r){return o.jsx(Ce.Form,{ref:r,className:n("gryt-form flex flex-col gap-(--gryt-space-lg)",e),...t})}),Br=s.forwardRef(function({className:e,...t},r){return o.jsx(ie.Fieldset.Root,{ref:r,className:n("gryt-fieldset flex min-w-0 flex-col gap-3 border-0 p-0",e),...t})}),zr=s.forwardRef(function({className:e,...t},r){return o.jsx(ie.Fieldset.Legend,{ref:r,className:n("gryt-fieldset-legend text-sm font-semibold text-gryt-text",e),...t})}),Er={Root:Br,Legend:zr},_r=s.forwardRef(function({className:e,...t},r){return o.jsx(Se.Menubar,{ref:r,className:n("gryt-menubar flex items-center gap-1","rounded-(--gryt-radius-md) border border-gryt-border bg-gryt-surface p-1",e),...t})}),Yr=s.forwardRef(function({className:e,...t},r){return o.jsx(w.NavigationMenu.Trigger,{ref:r,className:n("gryt-navigation-menu-trigger flex items-center gap-1.5 rounded-(--gryt-radius-md)","border-0 bg-transparent px-3 py-2 text-sm font-medium text-gryt-text select-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none","data-popup-open:bg-gryt-surface-raised",f,e),...t})}),Hr=s.forwardRef(function({className:e,...t},r){return o.jsx(w.NavigationMenu.Popup,{ref:r,className:n("gryt-navigation-menu-popup outline-none",I,k,e),...t})}),Vr=s.forwardRef(function({className:e,...t},r){return o.jsx(w.NavigationMenu.Positioner,{ref:r,className:n("gryt-navigation-menu-positioner outline-none",e),...t})}),Xr=s.forwardRef(function({className:e,...t},r){return o.jsx(w.NavigationMenu.Viewport,{ref:r,className:n("gryt-navigation-menu-viewport relative overflow-hidden",e),...t})}),Ur=s.forwardRef(function({className:e,...t},r){return o.jsx(w.NavigationMenu.Link,{ref:r,className:n("gryt-navigation-menu-link block rounded-(--gryt-radius-md) px-3 py-2","text-sm text-gryt-text no-underline outline-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none",f,e),...t})}),Kr={Root:w.NavigationMenu.Root,List:w.NavigationMenu.List,Item:w.NavigationMenu.Item,Trigger:Yr,Content:w.NavigationMenu.Content,Portal:w.NavigationMenu.Portal,Positioner:Vr,Viewport:Xr,Popup:Hr,Link:Ur,Icon:w.NavigationMenu.Icon,Arrow:w.NavigationMenu.Arrow},ne="flex h-9 w-9 shrink-0 items-center justify-center border-0 bg-transparent text-gryt-muted transition-colors hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text motion-reduce:transition-none disabled:cursor-not-allowed disabled:opacity-50",Wr=s.forwardRef(function({className:e,label:t,scrubbable:r=!1,...i},l){return o.jsxs(A.NumberField.Root,{ref:l,className:n("gryt-number-field flex flex-col gap-1.5",e),...i,children:[t&&(r?o.jsxs(A.NumberField.ScrubArea,{className:"cursor-ew-resize text-sm text-gryt-muted select-none",children:[t,o.jsx(A.NumberField.ScrubAreaCursor,{})]}):o.jsx("span",{className:"text-sm text-gryt-muted",children:t})),o.jsxs(A.NumberField.Group,{className:n("flex w-fit items-center overflow-hidden rounded-(--gryt-radius-full)","border border-gryt-border bg-gryt-surface-raised","focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-gryt-accent-light",$),children:[o.jsx(A.NumberField.Decrement,{"aria-label":"Decrease",className:n(ne,"rounded-l-(--gryt-radius-full)"),children:o.jsx(P.Minus,{size:14,weight:"bold"})}),o.jsx(A.NumberField.Input,{className:n("w-16 border-0 bg-transparent px-1 py-2 text-center","font-mono text-sm text-gryt-text tabular-nums outline-none",f)}),o.jsx(A.NumberField.Increment,{"aria-label":"Increase",className:n(ne,"rounded-r-(--gryt-radius-full)"),children:o.jsx(P.Plus,{size:14,weight:"bold"})})]})]})}),Qr=s.forwardRef(function({className:e,length:t=6,...r},i){return o.jsx(re.OTPField.Root,{ref:i,length:t,className:n("gryt-otp-field flex gap-2",e),...r,children:Array.from({length:t},(l,d)=>o.jsx(re.OTPField.Input,{className:n("gryt-otp-input h-12 w-10 rounded-(--gryt-radius-md) text-center","border border-gryt-border bg-gryt-surface-raised","font-mono text-lg text-gryt-text tabular-nums outline-none","transition-colors duration-(--gryt-dur-fast) motion-reduce:transition-none","data-filled:border-gryt-accent",f)},d))})}),Zr=s.forwardRef(function({className:e,sideOffset:t=8,...r},i){return o.jsx(G.PreviewCard.Positioner,{ref:i,sideOffset:t,className:n("gryt-preview-card-positioner outline-none",e),...r})}),Jr=s.forwardRef(function({className:e,...t},r){return o.jsx(G.PreviewCard.Popup,{ref:r,className:n("gryt-preview-card w-64 max-w-[calc(100vw-2rem)] p-4 outline-none",I,k,e),...t})}),eo={Root:G.PreviewCard.Root,Trigger:G.PreviewCard.Trigger,Portal:G.PreviewCard.Portal,Positioner:Zr,Popup:Jr,Arrow:G.PreviewCard.Arrow},to=s.forwardRef(function({className:e,...t},r){return o.jsx(L.Toolbar.Root,{ref:r,className:n("gryt-toolbar flex items-center gap-1","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface p-1",e),...t})}),ro=s.forwardRef(function({className:e,...t},r){return o.jsx(L.Toolbar.Separator,{ref:r,className:n("gryt-toolbar-separator mx-1 h-6 w-px bg-gryt-border",e),...t})}),oo={Root:to,Group:L.Toolbar.Group,Button:L.Toolbar.Button,Link:L.Toolbar.Link,Input:L.Toolbar.Input,Separator:ro};Object.defineProperty(exports,"GRYT_HUE_KEYS",{enumerable:!0,get:()=>c.GRYT_HUE_KEYS});Object.defineProperty(exports,"GRYT_NEUTRAL_KEYS",{enumerable:!0,get:()=>c.GRYT_NEUTRAL_KEYS});Object.defineProperty(exports,"GRYT_RADIUS_KEYS",{enumerable:!0,get:()=>c.GRYT_RADIUS_KEYS});Object.defineProperty(exports,"GRYT_THEME_NAME_MAX",{enumerable:!0,get:()=>c.GRYT_THEME_NAME_MAX});Object.defineProperty(exports,"alphaScale",{enumerable:!0,get:()=>c.alphaScale});Object.defineProperty(exports,"cloneGrytTheme",{enumerable:!0,get:()=>c.cloneGrytTheme});Object.defineProperty(exports,"contrast",{enumerable:!0,get:()=>c.contrast});Object.defineProperty(exports,"createGrytTheme",{enumerable:!0,get:()=>c.createGrytTheme});Object.defineProperty(exports,"decodeGrytTheme",{enumerable:!0,get:()=>c.decodeGrytTheme});Object.defineProperty(exports,"encodeGrytTheme",{enumerable:!0,get:()=>c.encodeGrytTheme});Object.defineProperty(exports,"grytAlphaScales",{enumerable:!0,get:()=>c.grytAlphaScales});Object.defineProperty(exports,"grytAlphaScalesLight",{enumerable:!0,get:()=>c.grytAlphaScalesLight});Object.defineProperty(exports,"grytLightTokens",{enumerable:!0,get:()=>c.grytLightTokens});Object.defineProperty(exports,"grytPresets",{enumerable:!0,get:()=>c.grytPresets});Object.defineProperty(exports,"grytPresetsById",{enumerable:!0,get:()=>c.grytPresetsById});Object.defineProperty(exports,"grytScales",{enumerable:!0,get:()=>c.grytScales});Object.defineProperty(exports,"grytScalesLight",{enumerable:!0,get:()=>c.grytScalesLight});Object.defineProperty(exports,"grytTheme",{enumerable:!0,get:()=>c.grytTheme});Object.defineProperty(exports,"grytThemeHues",{enumerable:!0,get:()=>c.grytThemeHues});Object.defineProperty(exports,"grytThemeToOptions",{enumerable:!0,get:()=>c.grytThemeToOptions});Object.defineProperty(exports,"grytTokens",{enumerable:!0,get:()=>c.grytTokens});Object.defineProperty(exports,"hexToOklch",{enumerable:!0,get:()=>c.hexToOklch});Object.defineProperty(exports,"hexToRgb",{enumerable:!0,get:()=>c.hexToRgb});Object.defineProperty(exports,"hueScale",{enumerable:!0,get:()=>c.hueScale});Object.defineProperty(exports,"hueScaleLight",{enumerable:!0,get:()=>c.hueScaleLight});Object.defineProperty(exports,"isHexColor",{enumerable:!0,get:()=>c.isHexColor});Object.defineProperty(exports,"neutralScale",{enumerable:!0,get:()=>c.neutralScale});Object.defineProperty(exports,"neutralScaleLight",{enumerable:!0,get:()=>c.neutralScaleLight});Object.defineProperty(exports,"normalizeHexColor",{enumerable:!0,get:()=>c.normalizeHexColor});Object.defineProperty(exports,"normalizeThemeName",{enumerable:!0,get:()=>c.normalizeThemeName});Object.defineProperty(exports,"oklchToHex",{enumerable:!0,get:()=>c.oklchToHex});Object.defineProperty(exports,"rgbToHex",{enumerable:!0,get:()=>c.rgbToHex});Object.defineProperty(exports,"avatarSeed",{enumerable:!0,get:()=>K.avatarSeed});exports.Accordion=Ht;exports.Alert=dt;exports.AlertDialog=jr;exports.Autocomplete=Gr;exports.Avatar=pe;exports.Badge=Ve;exports.Button=de;exports.Card=nt;exports.CardActions=lt;exports.CardContent=it;exports.CardHeader=st;exports.Checkbox=Ke;exports.CheckboxGroup=Lr;exports.Chip=Ue;exports.Collapsible=Fr;exports.Combobox=Sr;exports.Composer=_e;exports.ContextMenu=Xt;exports.ConversationItem=He;exports.Dialog=wt;exports.Divider=at;exports.Drawer=Mt;exports.Fieldset=Er;exports.Form=qr;exports.GrytProvider=Ae;exports.IconButton=qe;exports.Menu=Y;exports.Menubar=_r;exports.MessageBubble=ze;exports.Meter=fr;exports.NavigationMenu=Kr;exports.NumberField=Wr;exports.OtpField=Qr;exports.Popover=Zt;exports.PreviewCard=eo;exports.Progress=ut;exports.Radio=We;exports.RadioGroup=Qe;exports.ScrollArea=ur;exports.Select=tt;exports.Skeleton=pt;exports.Slider=Je;exports.Spinner=gt;exports.Surface=Be;exports.Switch=Ze;exports.Tab=fe;exports.Tabs=Bt;exports.TextField=Ee;exports.Toast=sr;exports.Toggle=pr;exports.ToggleGroup=mr;exports.Toolbar=oo;exports.Tooltip=rt;exports.TooltipProvider=ot;exports.cn=n;exports.useMediaQuery=be;exports.useToastManager=ir;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),X=require("@base-ui/react/tooltip"),i=require("react"),c=require("@gryt/theme"),st=require("@base-ui/react/button"),$t=require("clsx"),Dt=require("tailwind-merge"),fe=require("@base-ui/react/field"),k=require("@phosphor-icons/react"),Re=require("@base-ui/react/avatar"),Ge=require("@gryt/owl"),Ve=require("@base-ui/react/checkbox"),Ue=require("@base-ui/react/radio"),It=require("@base-ui/react/radio-group"),Xe=require("@base-ui/react/switch"),se=require("@base-ui/react/slider"),$=require("@base-ui/react/select"),Ot=require("@base-ui/react/separator"),ke=require("@base-ui/react/progress"),z=require("@base-ui/react/dialog"),I=require("@base-ui/react/drawer"),W=require("@base-ui/react/menu"),me=require("@base-ui/react/tabs"),ue=require("@base-ui/react/accordion"),E=require("@base-ui/react/context-menu"),G=require("@base-ui/react/popover"),F=require("@base-ui/react/toast"),ne=require("@base-ui/react/scroll-area"),Lt=require("@base-ui/react/toggle"),Gt=require("@base-ui/react/toggle-group"),ie=require("@base-ui/react/meter"),B=require("@base-ui/react/alert-dialog"),R=require("@base-ui/react/autocomplete"),T=require("@base-ui/react/combobox"),Ft=require("@base-ui/react/checkbox-group"),ze=require("@base-ui/react/collapsible"),Ht=require("@base-ui/react/form"),it=require("@base-ui/react/fieldset"),_t=require("@base-ui/react/menubar"),D=require("@base-ui/react/navigation-menu"),V=require("@base-ui/react/number-field"),We=require("@base-ui/react/otp-field"),re=require("@base-ui/react/preview-card"),oe=require("@base-ui/react/toolbar"),lt=i.createContext(void 0);function ct(){return i.useContext(lt)}function Et(n){return Object.keys(n).some(t=>t.startsWith("--"))}function zt({children:n,className:t,theme:e,tooltipDelay:o=400,containOverlays:a=!1}){const d=i.useRef(null),u=e===void 0?void 0:Et(e)?e:c.createGrytTheme(e);return r.jsx("div",{className:t,style:u,ref:d,children:r.jsx(lt.Provider,{value:a?d:void 0,children:r.jsx(X.Tooltip.Provider,{delay:o,children:n})})})}function s(...n){return Dt.twMerge($t.clsx(n))}const Bt={primary:"bg-gryt-accent text-gryt-on-accent hover:not-data-disabled:bg-gryt-accent-light data-disabled:bg-gryt-surface-raised data-disabled:text-gryt-muted",secondary:"bg-gryt-secondary text-gryt-on-secondary hover:not-data-disabled:bg-gryt-secondary-light data-disabled:bg-gryt-surface-raised data-disabled:text-gryt-muted",neutral:"bg-gryt-surface-raised text-gryt-text hover:not-data-disabled:bg-gryt-surface-hover data-disabled:text-gryt-muted",danger:"bg-gryt-danger text-gryt-on-danger hover:not-data-disabled:bg-gryt-danger-light data-disabled:bg-gryt-surface-raised data-disabled:text-gryt-muted",ghost:"bg-transparent text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text"},qt={xsmall:"min-h-8 px-3 text-xs",small:"min-h-9 px-4 text-sm",medium:"min-h-10 px-5 text-sm",large:"min-h-12 px-6 text-base"},ge=i.forwardRef(function({children:t,className:e,endIcon:o,size:a="medium",startIcon:d,tone:u="primary",...p},m){return r.jsxs(st.Button,{ref:m,className:s("gryt-button","inline-flex cursor-pointer items-center justify-center gap-2 border-0 shadow-none","rounded-(--gryt-radius-full) font-semibold whitespace-nowrap select-none","transition-[scale,background-color,color]","duration-(--gryt-dur-spring) ease-spring","motion-safe:not-[[aria-haspopup]]:hover:not-data-disabled:scale-[1.03]","motion-safe:not-[[aria-haspopup]]:active:not-data-disabled:scale-[0.96]","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light","data-disabled:cursor-not-allowed data-disabled:opacity-60",qt[a],Bt[u],e),...p,children:[d,t,o]})}),A="focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",Yt="has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-gryt-accent-light",dt=["w-full rounded-(--gryt-radius-xl) border bg-gryt-surface-raised","text-gryt-text outline-none placeholder:text-gryt-muted","transition-colors duration-150 motion-reduce:transition-none","hover:border-gryt-accent-light focus:border-gryt-accent","disabled:cursor-not-allowed disabled:opacity-60"].join(" "),ut={small:"min-h-9 px-3 py-1.5 text-sm",medium:"min-h-11 px-4 py-2.5 text-sm"},J="rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface text-gryt-text",q=["transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0"].join(" "),ae="cursor-pointer data-disabled:cursor-not-allowed data-disabled:opacity-50",Vt={primary:"data-checked:bg-gryt-accent data-checked:text-gryt-on-accent",secondary:"data-checked:bg-gryt-secondary data-checked:text-gryt-on-secondary",neutral:"data-checked:bg-gryt-surface-hover data-checked:text-gryt-text",danger:"data-checked:bg-gryt-danger data-checked:text-gryt-on-danger",success:"data-checked:bg-gryt-success data-checked:text-gryt-on-accent",warning:"data-checked:bg-gryt-warning data-checked:text-gryt-on-accent"},gt={primary:"bg-gryt-accent",secondary:"bg-gryt-secondary",neutral:"bg-gryt-surface-hover",danger:"bg-gryt-danger",success:"bg-gryt-success",warning:"bg-gryt-warning"},Ut={primary:"data-checked:border-gryt-accent",secondary:"data-checked:border-gryt-secondary",neutral:"data-checked:border-gryt-muted",danger:"data-checked:border-gryt-danger",success:"data-checked:border-gryt-success",warning:"data-checked:border-gryt-warning"},Xt={primary:"data-checked:bg-gryt-accent",secondary:"data-checked:bg-gryt-secondary",neutral:"data-checked:bg-gryt-surface-hover",danger:"data-checked:bg-gryt-danger",success:"data-checked:bg-gryt-success",warning:"data-checked:bg-gryt-warning"},Wt={primary:"text-gryt-accent-11 hover:not-data-disabled:bg-gryt-accent-3",secondary:"text-gryt-secondary-11 hover:not-data-disabled:bg-gryt-secondary-3",neutral:"text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text",danger:"text-gryt-danger-11 hover:not-data-disabled:bg-gryt-danger-3",ghost:"text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text"},Kt={xsmall:"h-8 w-8",small:"h-9 w-9",medium:"h-10 w-10",large:"h-12 w-12"},Jt=i.forwardRef(function({className:t,size:e="medium",tone:o="neutral",...a},d){return r.jsx(st.Button,{ref:d,className:s("gryt-icon-button","inline-flex shrink-0 items-center justify-center border-0 bg-transparent p-0","rounded-(--gryt-radius-full) select-none","transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring","motion-safe:not-[[aria-haspopup]]:hover:not-data-disabled:scale-[1.06]","motion-safe:not-[[aria-haspopup]]:active:not-data-disabled:scale-[0.94]",A,ae,Kt[e],Wt[o],t),...a})}),Qt=i.forwardRef(function({className:t,elevated:e=!1,...o},a){return r.jsx("div",{ref:a,className:s("gryt-surface rounded-(--gryt-radius-lg) border border-gryt-border p-4 text-gryt-text",e?"bg-gryt-surface-raised":"bg-gryt-surface",t),...o})}),Zt=i.forwardRef(function({children:t,className:e,from:o="assistant",...a},d){return r.jsx("div",{ref:d,className:s("gryt-message-bubble",o==="user"&&"ml-auto bg-gryt-accent text-gryt-on-accent",o==="assistant"&&"mr-auto border border-gryt-border bg-gryt-surface text-gryt-text",o==="system"&&"mx-auto border border-dashed border-gryt-border bg-transparent text-gryt-muted",e),...a,children:t})}),we=i.forwardRef(function({className:t,error:e=!1,fieldClassName:o,helperText:a,label:d,minRows:u=3,multiline:p=!1,size:m="medium",...f},x){const y=r.jsx(fe.Field.Control,{ref:x,render:p?r.jsx("textarea",{rows:u}):void 0,className:s("gryt-text-field-control",dt,p&&"resize-y leading-6",e?"border-gryt-danger":"border-gryt-border",ut[m],t),...f});return r.jsxs(fe.Field.Root,{className:s("gryt-text-field flex w-full flex-col gap-1.5",o),children:[d?r.jsx(fe.Field.Label,{className:"text-xs font-medium text-gryt-muted",children:d}):null,y,a?r.jsx(fe.Field.Description,{className:s("text-xs",e?"text-gryt-danger-11":"text-gryt-muted"),children:a}):null]})}),er=i.forwardRef(function({className:t,disabled:e=!1,maxRows:o=8,minRows:a=1,onSubmit:d,placeholder:u="Message Gryt",submitLabel:p="Send",...m},f){const x=i.useRef(null),y=i.useCallback(()=>{const h=x.current;if(!h)return;const w=window.getComputedStyle(h),j=parseFloat(w.lineHeight)||24,P=parseFloat(w.paddingTop)+parseFloat(w.paddingBottom);h.style.height="auto",h.style.height=`${Math.min(Math.max(h.scrollHeight,j*a+P),j*o+P)}px`},[o,a]);i.useLayoutEffect(y,[y,m.value]);function b(h){if(!d){h.preventDefault();return}d(h)}return r.jsxs("form",{className:s("gryt-composer",t),onSubmit:b,children:[r.jsx("textarea",{ref:h=>{x.current=h,typeof f=="function"?f(h):f&&(f.current=h)},rows:a,disabled:e,placeholder:u,onInput:y,className:"gryt-composer-textarea disabled:cursor-not-allowed disabled:opacity-60",...m}),r.jsx(ge,{type:"submit",disabled:e,size:"small",endIcon:r.jsx(k.PaperPlaneTilt,{size:14,weight:"fill"}),children:p})]})}),tr={small:"h-8 w-8 text-xs",medium:"h-10 w-10 text-sm",large:"h-12 w-12 text-base"},Ke=256,mt=i.forwardRef(function({alt:t,children:e,className:o,fallback:a,seed:d,eggSeed:u,size:p="medium",src:m,...f},x){const y=i.useMemo(()=>d?Ge.owlAvatarDataUri(d,{size:Ke}):void 0,[d]),b=i.useMemo(()=>u?Ge.eggAvatarDataUri(u,{size:Ke}):void 0,[u]),h=y??b;return r.jsxs(Re.Avatar.Root,{ref:x,className:s("gryt-avatar inline-flex shrink-0 items-center justify-center overflow-hidden align-middle select-none","rounded-(--gryt-radius-full) bg-gryt-surface-raised font-medium text-gryt-text ring-1 ring-gryt-border",tr[p],o),...f,children:[m?r.jsx(Re.Avatar.Image,{src:m,alt:t,className:"h-full w-full object-cover"}):null,r.jsx(Re.Avatar.Fallback,{className:"flex h-full w-full items-center justify-center",children:h?r.jsx("img",{src:h,alt:t,className:"h-full w-full object-cover"}):a??e})]})}),rr=i.forwardRef(function({active:t=!1,avatar:e,className:o,subtitle:a,title:d,...u},p){return r.jsxs("button",{ref:p,type:"button",className:s("gryt-conversation-item enabled:cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",t?"bg-gryt-accent text-gryt-on-accent":"text-gryt-text hover:bg-white/5",o),...u,children:[e??r.jsx(mt,{size:"small",className:s(t?"bg-gryt-on-accent text-gryt-accent-9 ring-transparent":"bg-gryt-surface-raised text-gryt-text"),children:d.slice(0,1).toUpperCase()}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm font-semibold",children:d}),a?r.jsx("span",{className:s("block truncate text-xs",t?"text-gryt-on-accent/85":"text-gryt-muted"),children:a}):null]})]})}),or=i.forwardRef(function({badgeContent:t,children:e,className:o,max:a=99,showZero:d=!1,...u},p){const m=typeof t=="number"?t:null,f=m!==null&&m===0&&!d,x=m!==null&&m>a?`${a}+`:t;return r.jsxs("span",{ref:p,className:s("gryt-badge relative inline-flex",o),...u,children:[e,t!==void 0&&!f?r.jsx("span",{className:s("gryt-badge-dot absolute -top-1 -right-1 z-10 inline-flex items-center justify-center","min-w-5 rounded-(--gryt-radius-full) px-1.5 py-0.5","bg-gryt-accent text-[0.65rem] leading-none font-semibold text-gryt-on-accent","ring-2 ring-gryt-bg"),children:x}):null]})}),nr={neutral:"border-gryt-border bg-gryt-surface-raised text-gryt-text",primary:"border-gryt-accent-6 bg-gryt-accent-3 text-gryt-accent-11",secondary:"border-gryt-secondary-6 bg-gryt-secondary-3 text-gryt-secondary-11",success:"border-gryt-success-6 bg-gryt-success-3 text-gryt-success-11",warning:"border-gryt-warning-6 bg-gryt-warning-3 text-gryt-warning-11",danger:"border-gryt-danger-6 bg-gryt-danger-3 text-gryt-danger-11"},ar=i.forwardRef(function({children:t,className:e,icon:o,label:a,onDelete:d,tone:u="neutral",...p},m){return r.jsxs("span",{ref:m,className:s("gryt-chip inline-flex items-center gap-1.5 rounded-(--gryt-radius-full) border px-3 py-1 text-xs font-medium",nr[u],e),...p,children:[o,a??t,d?r.jsx("button",{type:"button","aria-label":"Remove",onClick:d,className:s("-mr-1 inline-flex h-4 w-4 cursor-pointer items-center justify-center rounded-(--gryt-radius-full)","opacity-70 transition-opacity hover:opacity-100",A),children:r.jsx(k.X,{size:10,weight:"bold","aria-hidden":"true"})}):null]})}),Fe=i.forwardRef(function({className:t,tone:e="primary",...o},a){return r.jsx(Ve.Checkbox.Root,{ref:a,className:s("gryt-checkbox flex h-5 w-5 shrink-0 items-center justify-center","rounded-(--gryt-radius-sm) border border-gryt-border bg-gryt-surface-raised","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","data-checked:border-transparent","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.08]","motion-safe:active:not-data-disabled:scale-[0.92]",A,ae,Vt[e],t),...o,children:r.jsx(Ve.Checkbox.Indicator,{keepMounted:!0,className:s("flex origin-center","transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring","data-unchecked:scale-0 data-unchecked:opacity-0","motion-reduce:transition-none"),children:r.jsx(k.Check,{size:12,weight:"bold"})})})}),sr=i.forwardRef(function({className:t,tone:e="primary",...o},a){return r.jsx(Ue.Radio.Root,{ref:a,className:s("gryt-radio flex h-5 w-5 shrink-0 items-center justify-center","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.08]","motion-safe:active:not-data-disabled:scale-[0.92]",A,ae,Ut[e],t),...o,children:r.jsx(Ue.Radio.Indicator,{keepMounted:!0,className:s("h-2.5 w-2.5 origin-center rounded-(--gryt-radius-full)","transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring","data-unchecked:scale-0 data-unchecked:opacity-0","motion-reduce:transition-none",gt[e])})})}),ir=i.forwardRef(function({className:t,...e},o){return r.jsx(It.RadioGroup,{ref:o,className:s("gryt-radio-group flex flex-col gap-2",t),...e})}),lr=i.forwardRef(function({className:t,tone:e="primary",...o},a){return r.jsx(Xe.Switch.Root,{ref:a,className:s("gryt-switch relative inline-flex h-6 w-10 shrink-0 items-center","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised p-0.5","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","data-checked:border-transparent","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.05]","motion-safe:active:not-data-disabled:scale-[0.95]",A,ae,Xt[e],t),...o,children:r.jsx(Xe.Switch.Thumb,{className:s("h-4.5 w-4.5 rounded-(--gryt-radius-full) bg-gryt-text","transition-transform duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-checked:translate-x-4 data-checked:bg-gryt-bg")})})}),Je=3;function Be({className:n,tone:t="primary","aria-label":e,...o}){const[a,d]=i.useState(!1),u=i.useRef(null);i.useEffect(()=>{if(!a&&u.current===null)return;const x=()=>{u.current=null,d(!1)};return window.addEventListener("pointerup",x),window.addEventListener("pointercancel",x),()=>{window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",x)}},[a]);function p(x){u.current={x:x.clientX,y:x.clientY}}function m(x){const y=u.current;if(y===null||a)return;(Math.abs(x.clientX-y.x)>Je||Math.abs(x.clientY-y.y)>Je)&&d(!0)}const f=a?"transition-none":"duration-(--gryt-dur-spring) ease-spring-tight motion-reduce:transition-none";return r.jsx(se.Slider.Root,{className:s("gryt-slider w-full",n),...o,children:r.jsx(se.Slider.Control,{className:"flex w-full cursor-pointer touch-none items-center py-2 select-none",onPointerDown:p,onPointerMove:m,children:r.jsxs(se.Slider.Track,{className:"h-1.5 w-full rounded-(--gryt-radius-full) bg-gryt-surface-raised select-none",children:[r.jsx(se.Slider.Indicator,{className:s("h-full rounded-(--gryt-radius-full) select-none","transition-[width]",f,gt[t])}),r.jsx(se.Slider.Thumb,{"aria-label":e,className:s("group h-4 w-4 rounded-(--gryt-radius-full) select-none","transition-[inset-inline-start]",f,Yt),children:r.jsx("span",{className:s("block h-full w-full rounded-(--gryt-radius-full) bg-gryt-text","transition-[scale] duration-(--gryt-dur-spring) ease-spring","motion-safe:group-hover:scale-[1.12] motion-safe:group-active:scale-[0.94]","motion-reduce:transition-none")})})]})})})}const cr={small:"min-h-9 px-3 text-sm",medium:"min-h-11 px-4 text-sm"};function ve({className:n,label:t,options:e=[],placeholder:o="Select",size:a="medium",...d}){const u=ct();return r.jsxs($.Select.Root,{items:e,...d,children:[r.jsxs("div",{className:s("gryt-select flex w-full flex-col gap-1.5",n),children:[t?r.jsx($.Select.Label,{className:"text-xs font-medium text-gryt-muted",children:t}):null,r.jsxs($.Select.Trigger,{className:s("flex w-full cursor-pointer items-center justify-between gap-2","rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface-raised","text-gryt-text select-none","transition-colors duration-150 hover:border-gryt-accent-light","data-disabled:cursor-not-allowed data-disabled:opacity-60",A,cr[a]),children:[r.jsx($.Select.Value,{placeholder:o}),r.jsx($.Select.Icon,{className:"shrink-0 text-gryt-muted",children:r.jsx(k.CaretUpDown,{size:16})})]})]}),r.jsx($.Select.Portal,{container:u,children:r.jsx($.Select.Positioner,{sideOffset:6,className:"gryt-select-positioner outline-none",children:r.jsx($.Select.Popup,{className:s("min-w-(--anchor-width) p-1",J,q),children:r.jsx($.Select.List,{children:e.map(p=>r.jsxs($.Select.Item,{value:p.value,disabled:p.disabled,className:s("flex cursor-pointer items-center justify-between gap-2","rounded-(--gryt-radius-md) px-3 py-2 text-sm text-gryt-text","outline-none select-none data-highlighted:bg-gryt-surface-raised","data-disabled:cursor-not-allowed data-disabled:opacity-50"),children:[r.jsx($.Select.ItemText,{children:p.label}),r.jsx($.Select.ItemIndicator,{className:"text-gryt-accent-11",children:r.jsx(k.Check,{size:14,weight:"bold"})})]},String(p.value)))})})})})]})}function dr({children:n,className:t,side:e="top",sideOffset:o=8,title:a}){const d=ct();return r.jsxs(X.Tooltip.Root,{children:[r.jsx(X.Tooltip.Trigger,{render:n}),r.jsx(X.Tooltip.Portal,{container:d,children:r.jsx(X.Tooltip.Positioner,{side:e,sideOffset:o,className:"gryt-tooltip-positioner",children:r.jsx(X.Tooltip.Popup,{className:s("gryt-tooltip rounded-(--gryt-radius-md) border border-gryt-border bg-gryt-surface-raised","px-2.5 py-1.5 text-xs text-gryt-text",q,t),children:a})})})]})}const ur=X.Tooltip.Provider,gr=i.forwardRef(function({className:t,orientation:e="horizontal",...o},a){return r.jsx(Ot.Separator,{ref:a,orientation:e,className:s("gryt-divider bg-gryt-border",e==="vertical"?"h-full w-px":"h-px w-full",t),...o})}),mr=i.forwardRef(function({className:t,...e},o){return r.jsx("div",{ref:o,className:s("gryt-card rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface text-gryt-text",t),...e})});function pr({children:n,className:t,subheader:e,title:o,...a}){return r.jsxs("div",{className:s("gryt-card-header flex flex-col gap-1 p-4",t),...a,children:[o?r.jsx("span",{className:"text-base font-semibold text-gryt-text",children:o}):null,e?r.jsx("span",{className:"text-sm text-gryt-muted",children:e}):null,n]})}function fr({className:n,...t}){return r.jsx("div",{className:s("gryt-card-content px-4 pb-4 text-sm text-gryt-muted",n),...t})}function xr({className:n,...t}){return r.jsx("div",{className:s("gryt-card-actions flex items-center gap-2 px-4 pb-4",n),...t})}const yr={info:"border-gryt-secondary-6 bg-gryt-secondary-3 text-gryt-secondary-11",success:"border-gryt-success-6 bg-gryt-success-3 text-gryt-success-11",warning:"border-gryt-warning-6 bg-gryt-warning-3 text-gryt-warning-11",error:"border-gryt-danger-6 bg-gryt-danger-3 text-gryt-danger-11"},br=i.forwardRef(function({className:t,severity:e="info",...o},a){return r.jsx("div",{ref:a,role:"alert",className:s("gryt-alert rounded-(--gryt-radius-lg) border px-4 py-3 text-sm",yr[e],t),...o})});function hr({className:n,value:t=null,...e}){return r.jsx(ke.Progress.Root,{value:t,className:s("gryt-progress w-full",n),...e,children:r.jsx(ke.Progress.Track,{className:"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised",children:r.jsx(ke.Progress.Indicator,{className:s("h-full rounded-(--gryt-radius-full) bg-gryt-accent","transition-[width] duration-300 ease-out motion-reduce:transition-none",t===null&&"gryt-progress-indeterminate")})})})}function wr({className:n,size:t=24,"aria-label":e="Loading"}){return r.jsx(k.CircleNotch,{role:"status","aria-label":e,size:t,weight:"bold",className:s("gryt-spinner text-gryt-accent-11 motion-safe:animate-spin",n)})}const vr={text:"h-4 rounded-(--gryt-radius-sm)",rounded:"rounded-(--gryt-radius-lg)",circular:"rounded-(--gryt-radius-full)",rectangular:"rounded-none"};function jr({className:n,height:t,style:e,variant:o="text",width:a,...d}){const u={width:a,height:t,...e};return r.jsx("div",{"aria-hidden":"true",className:s("gryt-skeleton bg-white/9 motion-safe:animate-pulse",vr[o],n),style:u,...d})}const pt="transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none",Nr=i.forwardRef(function({className:t,...e},o){return r.jsx(z.Dialog.Backdrop,{ref:o,className:s("gryt-dialog-backdrop fixed inset-0 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)",pt,"data-starting-style:opacity-0 data-ending-style:opacity-0",t),...e})}),Tr=i.forwardRef(function({className:t,...e},o){return r.jsx(z.Dialog.Popup,{ref:o,className:s("gryt-dialog fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2","flex w-[32rem] max-w-[calc(100vw-3rem)] flex-col gap-4","rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-gryt-text",pt,"data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0",t),...e})}),Sr=i.forwardRef(function({className:t,...e},o){return r.jsx(z.Dialog.Title,{ref:o,className:s("gryt-dialog-title text-base font-semibold text-gryt-text",t),...e})}),Pr=i.forwardRef(function({className:t,...e},o){return r.jsx(z.Dialog.Description,{ref:o,className:s("gryt-dialog-description text-sm text-gryt-muted",t),...e})}),Cr=i.forwardRef(function({className:t,...e},o){return r.jsx("div",{ref:o,className:s("gryt-dialog-footer flex justify-end gap-3",t),...e})}),Rr={Root:z.Dialog.Root,Trigger:z.Dialog.Trigger,Portal:z.Dialog.Portal,Close:z.Dialog.Close,Backdrop:Nr,Popup:Tr,Title:Sr,Description:Pr,Footer:Cr},kr=()=>()=>{};function ft(n){const t=i.useCallback(o=>{if(typeof window>"u"||!window.matchMedia)return kr();const a=window.matchMedia(n);return a.addEventListener("change",o),()=>a.removeEventListener("change",o)},[n]),e=i.useCallback(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(n).matches,[n]);return i.useSyncExternalStore(t,e,()=>!1)}const Ar={left:"left",right:"right",top:"up",bottom:"down"},je=i.createContext("right"),Mr={left:"items-stretch justify-start",right:"items-stretch justify-end",top:"items-start justify-center",bottom:"items-end justify-center"},$r={left:"rounded-r-(--gryt-radius-xl)",right:"rounded-l-(--gryt-radius-xl)",top:"rounded-b-(--gryt-radius-xl)",bottom:"rounded-t-(--gryt-radius-xl)"},Dr={left:["h-full w-[calc(20rem+var(--gryt-drawer-bleed))] max-w-[calc(85vw+var(--gryt-drawer-bleed))]","-ml-(--gryt-drawer-bleed) border-r py-5 pr-5 pl-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateX(var(--drawer-swipe-movement-x))]","data-starting-style:[transform:translateX(calc(-100%+var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateX(calc(-100%+var(--gryt-drawer-bleed)))]"].join(" "),right:["h-full w-[calc(20rem+var(--gryt-drawer-bleed))] max-w-[calc(85vw+var(--gryt-drawer-bleed))]","-mr-(--gryt-drawer-bleed) border-l py-5 pl-5 pr-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateX(var(--drawer-swipe-movement-x))]","data-starting-style:[transform:translateX(calc(100%-var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateX(calc(100%-var(--gryt-drawer-bleed)))]"].join(" "),top:["w-full max-h-[calc(85vh+var(--gryt-drawer-bleed))]","-mt-(--gryt-drawer-bleed) border-b px-5 pb-5 pt-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateY(var(--drawer-swipe-movement-y))]","data-starting-style:[transform:translateY(calc(-100%+var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateY(calc(-100%+var(--gryt-drawer-bleed)))]"].join(" "),bottom:["w-full max-h-[calc(85vh+var(--gryt-drawer-bleed))]","-mb-(--gryt-drawer-bleed) border-t px-5 pt-5 pb-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateY(var(--drawer-swipe-movement-y))]","data-starting-style:[transform:translateY(calc(100%-var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateY(calc(100%-var(--gryt-drawer-bleed)))]"].join(" ")};function Ir({side:n="right",sheetOnMobile:t=!0,children:e,...o}){const a=ft("(max-width: 767px)"),d=t&&a?"bottom":n;return r.jsx(je.Provider,{value:d,children:r.jsx(I.Drawer.Root,{swipeDirection:Ar[d],...o,children:e})})}const Or=i.forwardRef(function({className:t,...e},o){const a=i.useContext(je);return r.jsx(I.Drawer.Viewport,{ref:o,className:s("gryt-drawer-viewport fixed inset-0 z-50 flex",Mr[a],t),...e})}),Lr=i.forwardRef(function({className:t,...e},o){const a=i.useContext(je);return r.jsx(I.Drawer.Popup,{ref:o,className:s("gryt-drawer flex flex-col gap-4 border-gryt-border bg-gryt-surface text-gryt-text","overflow-y-auto overscroll-contain outline-none","transition-transform duration-(--gryt-dur-spring-soft) ease-spring-tight","data-swiping:duration-0 data-swiping:select-none","motion-reduce:transition-none",Dr[a],$r[a],t),...e})}),Gr=i.forwardRef(function({className:t,...e},o){return r.jsx(I.Drawer.Backdrop,{ref:o,className:s("gryt-drawer-backdrop fixed inset-0 z-50 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)","[opacity:calc(1-var(--drawer-swipe-progress,0))]","transition-opacity duration-(--gryt-dur-spring-soft) ease-spring-tight","data-swiping:duration-0","data-starting-style:opacity-0 data-ending-style:opacity-0","motion-reduce:transition-none",t),...e})});function Fr({className:n}){const t=i.useContext(je);return t!=="bottom"&&t!=="top"?null:r.jsx("div",{"aria-hidden":!0,className:s("gryt-drawer-grabber mx-auto h-1.5 w-10 shrink-0 rounded-(--gryt-radius-full) bg-gryt-border",t==="top"&&"order-last",n)})}const Hr={Root:Ir,Trigger:I.Drawer.Trigger,Portal:I.Drawer.Portal,Backdrop:Gr,Viewport:Or,Popup:Lr,Content:I.Drawer.Content,Grabber:Fr,Close:I.Drawer.Close,Title:I.Drawer.Title,Description:I.Drawer.Description},_r=i.forwardRef(function({className:t,sideOffset:e=8,...o},a){return r.jsx(W.Menu.Positioner,{ref:a,sideOffset:e,className:s("gryt-menu-positioner outline-none",t),...o})}),Er=i.forwardRef(function({className:t,...e},o){return r.jsx(W.Menu.Popup,{ref:o,className:s("gryt-menu min-w-44 p-1 outline-none",J,q,t),...e})}),zr=i.forwardRef(function({className:t,...e},o){return r.jsx(W.Menu.Item,{ref:o,className:s("gryt-menu-item flex cursor-pointer items-center gap-2 rounded-(--gryt-radius-md)","px-3 py-2 text-sm text-gryt-text outline-none select-none","data-highlighted:bg-gryt-surface-raised","data-disabled:cursor-not-allowed data-disabled:opacity-50",t),...e})}),Br=i.forwardRef(function({className:t,...e},o){return r.jsx(W.Menu.Separator,{ref:o,className:s("gryt-menu-separator my-1 h-px bg-gryt-border",t),...e})}),be={Root:W.Menu.Root,Trigger:W.Menu.Trigger,Portal:W.Menu.Portal,Positioner:_r,Popup:Er,Item:zr,Separator:Br},qr=i.forwardRef(function({className:t,...e},o){return r.jsx(me.Tabs.Root,{ref:o,className:s("gryt-tabs","data-[orientation=vertical]:flex data-[orientation=vertical]:items-stretch",t),...e})}),Yr=i.forwardRef(function({className:t,...e},o){return r.jsx(me.Tabs.List,{ref:o,className:s("gryt-tabs-list relative inline-flex items-center gap-1 rounded-(--gryt-radius-full) bg-gryt-surface-raised p-1","data-[orientation=vertical]:flex data-[orientation=vertical]:shrink-0","data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch","data-[orientation=vertical]:rounded-(--gryt-radius-lg)",t),...e})}),xt=i.forwardRef(function({className:t,...e},o){return r.jsx(me.Tabs.Tab,{ref:o,className:s("gryt-tab inline-flex min-h-8 cursor-pointer items-center justify-center whitespace-nowrap","rounded-(--gryt-radius-full) border-0 bg-transparent px-4 py-1.5","text-sm font-medium text-gryt-muted select-none","relative z-10 hover:text-gryt-text","transition-[scale,color,background-color] duration-(--gryt-dur-spring) ease-spring","motion-safe:hover:scale-[1.03] motion-safe:active:scale-[0.96]","motion-reduce:transition-colors motion-reduce:duration-150","data-active:text-gryt-on-accent","data-[orientation=vertical]:min-h-9 data-[orientation=vertical]:justify-start","data-[orientation=vertical]:gap-2.5 data-[orientation=vertical]:px-3","data-[orientation=vertical]:rounded-(--gryt-radius-md)","data-disabled:cursor-not-allowed data-disabled:opacity-50",A,t),...e})}),Vr=i.forwardRef(function({className:t,...e},o){return r.jsx(me.Tabs.Indicator,{ref:o,renderBeforeHydration:!0,className:s("gryt-tabs-indicator absolute top-1 left-0 z-0 h-[calc(100%-0.5rem)]","w-(--active-tab-width) translate-x-(--active-tab-left)","rounded-(--gryt-radius-full) bg-gryt-accent","transition-[translate,width] duration-(--gryt-dur-spring) ease-spring","motion-reduce:transition-none","[[data-orientation=vertical]_&]:top-0 [[data-orientation=vertical]_&]:left-1","[[data-orientation=vertical]_&]:h-(--active-tab-height)","[[data-orientation=vertical]_&]:w-[calc(100%-0.5rem)]","[[data-orientation=vertical]_&]:translate-x-0","[[data-orientation=vertical]_&]:translate-y-(--active-tab-top)","[[data-orientation=vertical]_&]:rounded-(--gryt-radius-md)","[[data-orientation=vertical]_&]:transition-[translate,height]",t),...e})}),Ur=i.forwardRef(function({className:t,...e},o){return r.jsx(me.Tabs.Panel,{ref:o,className:s("gryt-tabs-panel pt-3 text-sm text-gryt-text","data-[orientation=vertical]:min-w-0 data-[orientation=vertical]:flex-1","data-[orientation=vertical]:pt-0 data-[orientation=vertical]:pl-4",t),...e})}),Xr=Object.assign(qr,{List:Yr,Tab:xt,Panel:Ur,Indicator:Vr}),Wr=i.forwardRef(function({className:t,...e},o){return r.jsx(ue.Accordion.Root,{ref:o,className:s("gryt-accordion flex w-full flex-col gap-2 rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface p-2",t),...e})}),Kr=i.forwardRef(function({className:t,...e},o){return r.jsx(ue.Accordion.Item,{ref:o,className:s("gryt-accordion-item",t),...e})}),Jr=i.forwardRef(function({children:t,className:e,expandIcon:o,...a},d){return r.jsx(ue.Accordion.Header,{className:"gryt-accordion-header m-0",children:r.jsxs(ue.Accordion.Trigger,{ref:d,className:s("gryt-accordion-trigger flex w-full cursor-pointer items-center justify-between gap-3","rounded-(--gryt-radius-lg) border-0 bg-transparent px-3 py-2.5","text-left text-sm font-medium text-gryt-text select-none","transition-colors duration-150 hover:bg-gryt-surface-raised","data-disabled:cursor-not-allowed data-disabled:opacity-50",A,e),...a,children:[t,o===void 0?r.jsx(k.CaretDown,{size:16,className:"shrink-0 transition-transform duration-(--gryt-dur-spring) ease-spring data-panel-open:rotate-180 motion-reduce:transition-none"}):o]})})}),Qr=i.forwardRef(function({children:t,className:e,...o},a){return r.jsx(ue.Accordion.Panel,{ref:a,className:s("gryt-accordion-panel overflow-hidden text-sm text-gryt-muted","h-[var(--accordion-panel-height)] transition-[height] duration-(--gryt-dur-spring-soft) ease-spring","data-starting-style:h-0 data-ending-style:h-0","motion-reduce:transition-none",e),...o,children:r.jsx("div",{className:"px-3 pt-1 pb-3",children:t})})}),Zr=Object.assign(Wr,{Item:Kr,Trigger:Jr,Panel:Qr}),eo=i.forwardRef(function({className:t,sideOffset:e=2,...o},a){return r.jsx(E.ContextMenu.Positioner,{ref:a,sideOffset:e,className:s("gryt-context-menu-positioner outline-none",t),...o})}),to={Root:E.ContextMenu.Root,Trigger:E.ContextMenu.Trigger,Portal:E.ContextMenu.Portal,Positioner:eo,Popup:be.Popup,Item:be.Item,Separator:be.Separator,Group:E.ContextMenu.Group,GroupLabel:E.ContextMenu.GroupLabel,SubmenuRoot:E.ContextMenu.SubmenuRoot,SubmenuTrigger:E.ContextMenu.SubmenuTrigger},ro=i.forwardRef(function({className:t,sideOffset:e=8,...o},a){return r.jsx(G.Popover.Positioner,{ref:a,sideOffset:e,className:s("gryt-popover-positioner outline-none",t),...o})}),oo=i.forwardRef(function({className:t,...e},o){return r.jsx(G.Popover.Popup,{ref:o,className:s("gryt-popover max-w-[min(20rem,calc(100vw-2rem))] p-4 outline-none",J,q,t),...e})}),no=i.forwardRef(function({className:t,...e},o){return r.jsx(G.Popover.Title,{ref:o,className:s("gryt-popover-title text-sm font-semibold text-gryt-text",t),...e})}),ao=i.forwardRef(function({className:t,...e},o){return r.jsx(G.Popover.Description,{ref:o,className:s("gryt-popover-description mt-1 text-sm leading-6 text-gryt-muted",t),...e})}),so={Root:G.Popover.Root,Trigger:G.Popover.Trigger,Portal:G.Popover.Portal,Positioner:ro,Popup:oo,Title:no,Description:ao,Close:G.Popover.Close,Arrow:G.Popover.Arrow},io={neutral:"border-white/8 bg-gryt-surface",info:"border-gryt-secondary-6 bg-gryt-secondary-2",success:"border-gryt-success-6 bg-gryt-success-2",warning:"border-gryt-warning-6 bg-gryt-warning-2",danger:"border-gryt-danger-6 bg-gryt-danger-2"},lo=i.forwardRef(function({className:t,...e},o){return r.jsx(F.Toast.Viewport,{ref:o,className:s("gryt-toast-viewport fixed right-4 bottom-4 z-50 flex w-[min(22rem,calc(100vw-2rem))]","flex-col gap-2 outline-none",t),...e})}),co=i.forwardRef(function({className:t,severity:e="neutral",...o},a){return r.jsx(F.Toast.Root,{ref:a,className:s("gryt-toast relative flex flex-col p-3 pr-9","rounded-(--gryt-radius-xl) border text-gryt-text",io[e],"transition-[opacity,transform] duration-(--gryt-dur-spring) ease-spring","data-starting-style:translate-y-2 data-starting-style:opacity-0","data-ending-style:translate-y-2 data-ending-style:opacity-0","motion-reduce:transition-none",t),...o})}),uo=i.forwardRef(function({className:t,...e},o){return r.jsx(F.Toast.Title,{ref:o,className:s("gryt-toast-title text-sm font-semibold text-gryt-text",t),...e})}),go=i.forwardRef(function({className:t,...e},o){return r.jsx(F.Toast.Description,{ref:o,className:s("gryt-toast-description mt-0.5 text-sm leading-6 text-gryt-muted",t),...e})}),mo=i.forwardRef(function({className:t,children:e,...o},a){return r.jsx(F.Toast.Close,{ref:a,"aria-label":"Close",className:s("gryt-toast-close absolute top-2.5 right-2.5 inline-flex h-6 w-6 items-center justify-center","rounded-(--gryt-radius-full) border-0 bg-transparent text-gryt-muted","transition-colors hover:bg-white/8 hover:text-gryt-text motion-reduce:transition-none","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",t),...o,children:e??r.jsx(k.X,{size:14,weight:"bold"})})}),po=i.forwardRef(function({className:t,...e},o){return r.jsx(F.Toast.Action,{ref:o,className:s("gryt-toast-action mt-2 self-start rounded-(--gryt-radius-full) border-0","bg-gryt-accent px-3 py-1.5 text-sm font-medium text-gryt-on-accent","transition-[scale] duration-(--gryt-dur-spring) ease-spring","motion-safe:hover:scale-[1.04] motion-safe:active:scale-[0.96]","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",t),...e})}),fo={Provider:F.Toast.Provider,Portal:F.Toast.Portal,Viewport:lo,Root:co,Title:uo,Description:go,Close:mo,Action:po},xo=F.Toast.useToastManager,yo=i.forwardRef(function({className:t,...e},o){return r.jsx(ne.ScrollArea.Root,{ref:o,className:s("gryt-scroll-area relative",t),...e})}),bo=i.forwardRef(function({className:t,...e},o){return r.jsx(ne.ScrollArea.Viewport,{ref:o,className:s("gryt-scroll-area-viewport h-full w-full overscroll-contain","focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-gryt-accent-light",t),...e})}),ho=i.forwardRef(function({className:t,orientation:e,...o},a){return r.jsx(ne.ScrollArea.Scrollbar,{ref:a,orientation:e,className:s("gryt-scroll-area-scrollbar flex touch-none p-0.5 select-none","opacity-0 transition-opacity duration-(--gryt-dur-fast)","data-hovering:opacity-100 data-scrolling:opacity-100","motion-reduce:transition-none",e==="horizontal"?"h-2 flex-col":"w-2",t),...o,children:r.jsx(ne.ScrollArea.Thumb,{className:"flex-1 rounded-(--gryt-radius-full) bg-gryt-border transition-colors hover:bg-gryt-muted motion-reduce:transition-none"})})}),wo={Root:yo,Viewport:bo,Scrollbar:ho,Content:ne.ScrollArea.Content,Corner:ne.ScrollArea.Corner},vo={primary:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-accent data-pressed:text-gryt-on-accent","data-pressed:hover:not-data-disabled:bg-gryt-accent"].join(" "),secondary:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-secondary data-pressed:text-gryt-on-secondary","data-pressed:hover:not-data-disabled:bg-gryt-secondary"].join(" "),neutral:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-surface-hover data-pressed:text-gryt-text"].join(" "),danger:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-danger data-pressed:text-gryt-on-danger","data-pressed:hover:not-data-disabled:bg-gryt-danger"].join(" ")},jo={xsmall:"h-8 min-w-8 px-2 text-xs",small:"h-9 min-w-9 px-2.5 text-sm",medium:"h-10 min-w-10 px-3 text-sm",large:"h-12 min-w-12 px-4 text-base"},He=i.forwardRef(function({className:t,size:e="medium",tone:o="primary",...a},d){return r.jsx(Lt.Toggle,{ref:d,className:s("gryt-toggle","inline-flex shrink-0 items-center justify-center gap-2 border-0 bg-transparent","rounded-(--gryt-radius-full) font-medium select-none","transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring","motion-safe:hover:not-data-disabled:scale-[1.06]","motion-safe:active:not-data-disabled:scale-[0.94]",A,ae,jo[e],vo[o],t),...a})}),yt=i.forwardRef(function({className:t,...e},o){return r.jsx(Gt.ToggleGroup,{ref:o,className:s("gryt-toggle-group inline-flex items-center gap-1","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface p-1",t),...e})}),bt=c.GRYT_RADIUS_KEYS,No=c.grytTheme;function _e(n,t){return t==="light"&&n.lightHue!==null?"lightHue":"hue"}const he=c.grytThemeHues;function ht(n){return{hue:{...n.hue},lightHue:n.lightHue===null?null:{...n.lightHue},dark:{...n.dark},light:{...n.light},radius:{...n.radius}}}function To(n,t){return{...he(n,t),...n[t]}}function wt(n,t){return c.createGrytTheme(c.grytThemeToOptions(n,t))}function L(n,t){const e=n;return Array.from({length:12},(o,a)=>e[`--gryt-${t}-${a+1}`])}function Qe(n){return JSON.stringify(n)}const Ae={accent:"Accent",accentLight:"Accent, light",secondary:"Secondary",secondaryLight:"Secondary, light",success:"Success",danger:"Danger",dangerLight:"Danger, light",warning:"Warning",onAccent:"Text on accent",onSecondary:"Text on secondary",onDanger:"Text on danger"},Ze={bg:"Page",surface:"Surface",surfaceRaised:"Raised surface",surfaceHover:"Surface, hovered",border:"Border",muted:"Muted text",text:"Text"},et={sm:"Small",md:"Medium",lg:"Large",xl:"Extra large",full:"Full"},So={sm:"Chips, swatches, small insets",md:"Menu rows, list items",lg:"Cards and panels",xl:"Dialogs, composers, bubbles",full:"Buttons, fields, avatars"};function le({label:n,value:t,onChange:e,warning:o,disabled:a=!1}){const d=i.useId(),[u,p]=i.useState(t),[m,f]=i.useState(t);t!==m&&(f(t),p(t));function x(y){p(y),c.isHexColor(y)&&e(c.normalizeHexColor(y))}return r.jsxs("div",{className:"min-w-0",children:[r.jsxs("span",{className:"mb-1 flex items-center gap-1.5 text-xs font-medium text-gryt-muted",id:`${d}-label`,children:[r.jsx("span",{className:"truncate",children:n}),o?r.jsx("span",{className:"inline-flex shrink-0 text-gryt-warning-11",title:o,children:r.jsx(k.Warning,{"aria-label":o,size:13})}):null]}),r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx("input",{"aria-label":`${n}, colour picker`,className:"docs-swatch disabled:cursor-not-allowed disabled:opacity-60",disabled:a,onChange:y=>x(y.target.value),type:"color",value:c.normalizeHexColor(t)}),r.jsx(we,{"aria-label":`${n}, hex value`,className:"font-mono",disabled:a,onBlur:()=>p(t),onChange:y=>x(y.target.value),size:"small",spellCheck:!1,value:u})]})]})}const Z="ui-sans-serif, system-ui, sans-serif",Me="ui-serif, Georgia, serif",xe="ui-monospace, Menlo, Consolas, monospace",Ee=[{label:"Atkinson Hyperlegible",stack:`"Atkinson Hyperlegible Next", ${Z}`,remote:!1,note:"What Gryt ships. Drawn so letterforms cannot be confused."},{label:"System",stack:Z,remote:!1,note:"Whatever this machine uses. Nothing to load."},{label:"System serif",stack:Me,remote:!1,note:"The machine's serif. Nothing to load."},{label:"Atkinson Hyperlegible Mono",stack:`"Atkinson Hyperlegible Mono", ${xe}`,remote:!1,note:"The monospace Gryt ships."},{label:"System mono",stack:xe,remote:!1,note:"The machine's monospace. Nothing to load."},{label:"Inter",stack:`"Inter", ${Z}`,remote:!0,note:"The default interface grotesque. Neutral to a fault."},{label:"Geist",stack:`"Geist", ${Z}`,remote:!0,note:"Vercel's. What shadcn/ui is set in."},{label:"IBM Plex Sans",stack:`"IBM Plex Sans", ${Z}`,remote:!0,note:"Technical and a little cold, with a real mono to match."},{label:"Archivo",stack:`"Archivo", ${Z}`,remote:!0,note:"Grotesque with weight. Good for headings that carry."},{label:"Fraunces",stack:`"Fraunces", ${Me}`,remote:!0,note:"A serif with opinions. Headings rather than body."},{label:"Source Serif 4",stack:`"Source Serif 4", ${Me}`,remote:!0,note:"A serif you can read a paragraph in."},{label:"JetBrains Mono",stack:`"JetBrains Mono", ${xe}`,remote:!0,note:"Monospace with a tall x-height. Made for code."},{label:"IBM Plex Mono",stack:`"IBM Plex Mono", ${xe}`,remote:!0,note:"The mono beside IBM Plex Sans."}],Po={body:"Body",display:"Headings",mono:"Code and numbers"},Co={body:"Messages, labels, everything you read.",display:"Headings and titles. Defaults to the body face.",mono:"Code, hex values, timestamps, fingerprints."};function Ro(n){return Ee.find(t=>t.stack===n)}function ko(n){return(n.split(",")[0]?.trim()??"").replace(/^["']|["']$/g,"")}const $e="custom";function Ao({role:n,fonts:t,onChange:e,remoteAllowed:o=!0}){const a=t?.[n]??c.grytFonts[n],d=Ro(a),[u,p]=i.useState(()=>d===void 0?ko(a):""),m=n==="mono"?"ui-monospace, Menlo, Consolas, monospace":"ui-sans-serif, system-ui, sans-serif";function f(b){if(b===$e){const w=u.trim();w!==""&&x(w);return}const h=Ee.find(w=>w.label===b);h!==void 0&&e(h.stack)}function x(b){const h=`"${b}", ${m}`;c.isFontStack(h)&&e(h)}const y=d?.remote===!0&&!o;return r.jsxs("div",{className:"min-w-0 flex flex-col gap-1.5",children:[r.jsx(ve,{label:Po[n],onValueChange:b=>f(String(b)),options:[...Ee.map(b=>({label:b.remote?`${b.label} · fetched`:b.label,value:b.label})),{label:"Something else…",value:$e}],size:"small",value:d?.label??$e}),d===void 0?r.jsx(we,{label:"Family name",onChange:b=>{p(b.target.value);const h=b.target.value.trim();h!==""&&x(h)},placeholder:"Bodoni Moda",size:"small",value:u}):null,r.jsx("p",{className:"m-0 text-[11px] leading-4 text-gryt-muted",children:d?.note??Co[n]}),y?r.jsx("p",{className:"m-0 text-[11px] leading-4 text-gryt-warning-11",children:"This one is fetched from Google, which is off on this machine. It will fall back until you turn it on."}):null,r.jsx("p",{className:"m-0 truncate text-sm text-gryt-text",style:{fontFamily:a},children:"The quick brown fox — 0123456789"})]})}const tt=.45,H={min:-tt,size:1+tt*2};function rt({value:n,onChange:t,reference:e,samples:o}){const a=o!==void 0,d=i.useRef(null),[u,p]=i.useState(null),[m,f,x,y]=n,b=i.useCallback((v,S)=>{const M=d.current?.getBoundingClientRect();if(M===void 0||M.width===0)return null;const O=H.min+(v-M.left)/M.width*H.size,Q=H.min+(M.bottom-S)/M.height*H.size;return{x:O,y:Q}},[]),h=i.useCallback(v=>{if(u===null)return;const S=b(v.clientX,v.clientY);if(S===null)return;const M=Math.min(1,Math.max(0,Number(S.x.toFixed(3)))),O=Number(S.y.toFixed(3));t(u===0?[M,O,x,y]:[m,f,M,O])},[u,t,b,m,f,x,y]),w=v=>v,j=v=>1-v,P=`M 0 ${j(0)} C ${w(m)} ${j(f)}, ${w(x)} ${j(y)}, 1 ${j(1)}`;return r.jsxs("svg",{className:"w-full touch-none rounded-(--gryt-radius-sm) border border-gryt-border bg-gryt-surface-raised",onPointerDown:v=>{if(a)return;const S=b(v.clientX,v.clientY);if(S===null)return;const M=(O,Q)=>(S.x-O)**2+(S.y-Q)**2;p(M(m,f)<=M(x,y)?0:1),v.currentTarget.setPointerCapture(v.pointerId)},onPointerMove:h,onPointerUp:v=>{p(null),v.currentTarget.releasePointerCapture(v.pointerId)},preserveAspectRatio:"none",ref:d,role:a?"img":"application","aria-label":"Timing curve",style:{height:132},viewBox:`${H.min} ${H.min} ${H.size} ${H.size}`,children:[r.jsx("rect",{fill:"none",height:1,stroke:"var(--gryt-border)",strokeWidth:.004,width:1,x:0,y:0}),e!==void 0?r.jsx("polyline",{fill:"none",opacity:.35,points:e.map((v,S)=>`${S/(e.length-1)},${j(v)}`).join(" "),stroke:"var(--gryt-muted)",strokeWidth:.008}):null,a?r.jsx("polyline",{fill:"none",points:o.map((v,S)=>`${S/(o.length-1)},${j(v)}`).join(" "),stroke:"var(--gryt-accent)",strokeWidth:.014}):r.jsxs(r.Fragment,{children:[r.jsx("line",{stroke:"var(--gryt-muted)",strokeWidth:.005,x1:0,x2:w(m),y1:j(0),y2:j(f)}),r.jsx("line",{stroke:"var(--gryt-muted)",strokeWidth:.005,x1:1,x2:w(x),y1:j(1),y2:j(y)}),r.jsx("path",{d:P,fill:"none",stroke:"var(--gryt-accent)",strokeWidth:.014}),r.jsx("circle",{cx:w(m),cy:j(f),fill:"var(--gryt-accent)",r:u===0?.035:.026}),r.jsx("circle",{cx:w(x),cy:j(y),fill:"var(--gryt-accent)",r:u===1?.035:.026})]})]})}const De="custom",Mo=[.22,1,.36,1];function $o({motion:n,onChange:t}){const e=n??c.grytMotion,o=c.isBezier(e.curve)?e.curve:null,[a,d]=i.useState(o??Mo);function u(m){t({...e,curve:m})}const p=e.scale===0;return r.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"mb-1 flex items-baseline justify-between gap-2",children:[r.jsx("span",{className:"text-xs font-medium text-gryt-muted",children:"Speed"}),r.jsx("span",{className:"font-mono text-[11px] text-gryt-muted",children:p?"off":`${e.scale.toFixed(2)}× · ${Math.round(c.grytDurations.spring*e.scale)}ms`})]}),r.jsx(Be,{"aria-label":"Animation speed",max:c.GRYT_MOTION_SCALE_MAX,min:0,onValueChange:m=>t({...e,scale:Number(Number(m).toFixed(2))}),step:.05,value:e.scale}),r.jsx("p",{className:"m-0 pt-1 text-[11px] leading-4 text-gryt-muted",children:p?"Nothing animates. A real choice, not a broken one — some people find movement unpleasant.":"One multiplier over every tier, so a drawer stays slower than a button."})]}),r.jsx("div",{className:"min-w-0",children:r.jsx(ve,{label:"Curve",onValueChange:m=>{const f=String(m);u(f===De?a:f)},options:[{label:"Spring — overshoots and settles",value:"spring"},{label:"Smooth — settles without passing",value:"smooth"},{label:"Linear — no easing at all",value:"linear"},{label:"Draw one…",value:De}],size:"small",value:o===null?e.curve:De})}),o!==null?r.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[r.jsx(rt,{onChange:m=>{d(m),u(m)},reference:c.springSamples,value:o}),r.jsxs("p",{className:"m-0 font-mono text-[11px] text-gryt-muted",children:["cubic-bezier(",o.join(", "),")"]}),r.jsx("p",{className:"m-0 text-[11px] leading-4 text-gryt-muted",children:"The faint line is the shipped spring, to compare against. Anything drawn above the box overshoots — fine on a button, and it throws a drawer outside its own edge, because one curve now does both jobs."})]}):r.jsx(rt,{onChange:u,samples:e.curve==="smooth"?c.springTightSamples:e.curve==="linear"?[0,1]:c.springSamples,value:a}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("span",{className:"text-xs font-medium text-gryt-muted",children:"Preview"}),r.jsx("div",{className:"mt-1 overflow-hidden rounded-(--gryt-radius-sm) border border-gryt-border bg-gryt-surface-raised p-2",children:r.jsx("div",{className:"h-4 w-4 rounded-(--gryt-radius-sm) bg-gryt-accent",style:{animation:p?"none":`gryt-motion-preview ${Math.round(c.grytDurations.springSoft*e.scale)}ms var(--ease-spring) infinite alternate`}},`${e.scale}-${String(e.curve)}`)})]})]})}const Do={pass:k.Check,tight:k.Warning,fail:k.X},ot={pass:"text-gryt-success-11",tight:"text-gryt-warning-11",fail:"text-gryt-danger-11"};function Io({checks:n,onRepair:t}){const e=n.filter(o=>!o.advisory&&o.level==="fail").length;return r.jsxs("section",{className:"min-w-0",children:[r.jsxs("header",{className:"flex items-center justify-between gap-2 pb-2",children:[r.jsx("h2",{className:"m-0 text-[11px] font-semibold uppercase tracking-wider text-gryt-muted",children:"Contrast"}),e>0?r.jsxs("span",{className:"text-xs text-gryt-danger-11",children:[e," of ",n.length]}):r.jsxs("span",{className:"text-xs text-gryt-muted",children:[n.length," checks pass"]})]}),r.jsx("ul",{className:"m-0 list-none space-y-1 p-0",children:n.map(o=>{const a=o.advisory&&o.level==="fail"?"tight":o.level,d=Do[a];return r.jsxs("li",{className:"flex items-center justify-between gap-2 text-xs",children:[r.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[r.jsx(d,{"aria-hidden":"true",className:ot[a],size:12}),r.jsx("span",{className:"truncate text-gryt-muted",children:o.label})]}),r.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-gryt-muted",children:[r.jsx("span",{className:a==="pass"?"text-gryt-text":ot[a],children:o.ratio.toFixed(1)}),r.jsxs("span",{"aria-hidden":"true",children:[" / ",o.min]}),r.jsxs("span",{className:"sr-only",children:[" against a minimum of ",o.min]}),!o.advisory&&o.ratio>=7?r.jsx("span",{className:"pl-1.5 text-[10px] text-gryt-success-11",children:"AAA"}):null]})]},o.id)})}),t?r.jsx("div",{className:"pt-3",children:r.jsx(ge,{onClick:t,size:"small",tone:"neutral",children:"Fix the text colours"})}):null]})}function ee({label:n,steps:t}){return r.jsxs("div",{className:"min-w-0",children:[r.jsx("span",{className:"mb-1 block text-[11px] font-medium tracking-wide text-gryt-muted",children:n}),r.jsx("ol",{className:"m-0 flex list-none gap-px overflow-hidden rounded-(--gryt-radius-sm) border border-gryt-border p-0",children:t.map((e,o)=>r.jsx("li",{className:"h-6 min-w-0 flex-1",style:{backgroundColor:e},title:`${n} ${o+1} · ${e}`},`${n}-${o}`))})]})}const Oo=[{family:"accent",label:"Accent"},{family:"secondary",label:"Secondary"},{family:"success",label:"Success"},{family:"danger",label:"Danger"},{family:"warning",label:"Warning"}];function Lo(n,t){return n<t?"fail":n<t*1.1?"tight":"pass"}function U(n,t,e,o,a,d,u=!1){const p=c.contrast(e,o);return{id:n,label:t,foreground:e,background:o,ratio:p,min:a,level:Lo(p,a),advisory:u,paths:d}}function Go(n,t,e){const o=L(t,"neutral"),a=o[0],d=o[1],u=o[11],p=o[10],m=o[5],f=e,x=_e(n,e),y=he(n,e),b=[U("text-page","Text on the page",u,a,4.5,[`${f}.text`,`${f}.bg`]),U("text-surface","Text on a surface",u,d,4.5,[`${f}.text`,`${f}.surface`]),U("muted-page","Muted text on the page",p,a,4.5,[`${f}.muted`,`${f}.bg`]),U("muted-surface","Muted text on a surface",p,d,4.5,[`${f}.muted`,`${f}.surface`])];for(const{family:w,label:j}of Oo){const P=L(t,w);b.push(U(`${w}-text`,`${j} text on the page`,P[10],a,4.5,[`${x}.${w}`,`${f}.bg`]))}const h=[{family:"accent",on:"onAccent",label:"Label on a filled button"},{family:"secondary",on:"onSecondary",label:"Label on a secondary button"},{family:"danger",on:"onDanger",label:"Label on a danger button"}];for(const{family:w,on:j,label:P}of h)b.push(U(`${j}-fill`,P,y[j],L(t,w)[8],4.5,[`${x}.${j}`,`${x}.${w}`]));return b.push(U("border-page","Border against the page",m,a,1.15,[`${f}.border`,`${f}.bg`],!0)),b}function N(n,t){return n+Math.random()*(t-n)}function Ie(n){return n[Math.floor(Math.random()*n.length)]}const Fo=[{sm:8,md:12,lg:20,xl:28,full:999},{sm:6,md:8,lg:14,xl:18,full:999},{sm:4,md:6,lg:10,xl:14,full:8},{sm:2,md:4,lg:6,xl:8,full:4},{sm:10,md:16,lg:24,xl:32,full:999}];function Ho(){const n=N(0,360),t=Ie([.4,.8,1.4,2.2]),e=n+Ie([-1,1])*N(110,200),o=(b,h,w=n)=>c.oklchToHex({l:b,c:h*t,h:w}),a=N(.15,.21),d={bg:o(a,.011),surface:o(a+.045,.014),surfaceRaised:o(a+.062,.016),surfaceHover:o(a+.125,.022),border:o(a+.125,.024),muted:o(N(.62,.665),.008),text:o(N(.9,.925),.008)},u=N(.95,.968),p={bg:o(u,.006),surface:o(N(.995,1),.001),surfaceRaised:o(u+.016,.004),surfaceHover:o(u-.035,.01),border:o(N(.878,.9),.014),muted:o(N(.46,.5),.014),text:o(N(.23,.27),.014)},m=c.oklchToHex({l:N(.67,.74),c:N(.13,.17),h:n}),f=c.oklchToHex({l:N(.79,.85),c:N(.09,.13),h:e}),x=c.oklchToHex({l:N(.67,.72),c:N(.15,.19),h:N(18,30)}),y={accent:m,accentLight:Oe(m,.085),secondary:f,secondaryLight:Oe(f,.07),success:c.oklchToHex({l:N(.8,.85),c:N(.15,.19),h:N(140,156)}),danger:x,dangerLight:Oe(x,.08),warning:c.oklchToHex({l:N(.82,.86),c:N(.14,.17),h:N(72,90)}),onAccent:"",onSecondary:"",onDanger:""};return y.onAccent=K(m),y.onSecondary=K(f),y.onDanger=K(x),{hue:y,lightHue:null,dark:d,light:p,radius:{...Ie(Fo)}}}function Oe(n,t){const{l:e,c:o,h:a}=c.hexToOklch(n);return c.oklchToHex({l:Math.min(.97,e+t),c:o*.85,h:a})}function K(n){const{c:t,h:e}=c.hexToOklch(n),o=c.oklchToHex({l:.17,c:Math.min(.05,t*.3),h:e}),a=c.oklchToHex({l:.97,c:Math.min(.03,t*.2),h:e}),d=c.contrast(o,n)>=c.contrast(a,n)?o:a;return de(d,n,7)}function ce(n){return{...n,onAccent:K(n.accent),onSecondary:K(n.secondary),onDanger:K(n.danger)}}function te(n){const t=ce(n);return t.onAccent===n.onAccent&&t.onSecondary===n.onSecondary&&t.onDanger===n.onDanger}function de(n,t,e){if(c.contrast(n,t)>=e)return n;const{l:o,c:a,h:d}=c.hexToOklch(n),u=o>=c.hexToOklch(t).l?1:-1;let p=o;for(let m=0;m<120;m++){p=Math.min(1,Math.max(0,p+u*.008));const f=c.oklchToHex({l:p,c:a,h:d});if(c.contrast(f,t)>=e)return f;if(p===0||p===1)break}return u===1?"#ffffff":"#000000"}function _o(n){const t=ht(n);for(const e of["dark","light"])t[e].text=de(t[e].text,t[e].bg,7),t[e].text=de(t[e].text,t[e].surface,7),t[e].muted=de(t[e].muted,t[e].bg,4.5),t[e].muted=de(t[e].muted,t[e].surface,4.5);for(const e of[t.hue,t.lightHue])if(e!==null)for(const[o,a]of[["onAccent","accent"],["onSecondary","secondary"],["onDanger","danger"]]){const d=e[a];c.contrast(e[o],d)<7&&(e[o]=K(d))}return t}function Eo(n){return n==="light"?{...c.grytTokens.color,...c.grytLightTokens}:{...c.grytTokens.color}}function zo(n,t){const e=Eo(t);return Object.entries(To(n,t)).filter(([o,a])=>c.normalizeHexColor(a)!==c.normalizeHexColor(e[o]??""))}function Bo(n){return bt.filter(t=>n.radius[t]!==c.grytTokens.radius[t]).map(t=>[t,n.radius[t]])}function nt(n,t){const e=[];t==="light"&&e.push(' appearance: "light",');const o=zo(n,t);o.length>0&&(e.push(" color: {"),o.forEach(([u,p],m)=>{const f=m===o.length-1?"":",";e.push(` ${u}: "${c.normalizeHexColor(p)}"${f}`)}),e.push(" },"));const a=Bo(n);a.length>0&&e.push(` radius: { ${a.map(([u,p])=>`${u}: ${p}`).join(", ")} }`);const d=e.length-1;return d>=0&&(e[d]=e[d].replace(/,$/,"")),e.length===0?"":`{
|
|
2
|
+
${e.join(`
|
|
3
|
+
`)}
|
|
4
|
+
}`}function qo(n){const t=nt(n,"dark"),e=nt(n,"light");return`import { createGrytTheme, GrytProvider } from "@gryt/ui";
|
|
5
|
+
|
|
6
|
+
// One call per appearance. The scales are regenerated from these anchors, so
|
|
7
|
+
// every component moves with them — not just the tokens named here.
|
|
8
|
+
const dark = createGrytTheme(${t});
|
|
9
|
+
|
|
10
|
+
const light = createGrytTheme(${e});
|
|
11
|
+
|
|
12
|
+
export function App({ appearance }: { appearance: "dark" | "light" }) {
|
|
13
|
+
return (
|
|
14
|
+
<GrytProvider theme={appearance === "light" ? light : dark}>
|
|
15
|
+
{/* your app */}
|
|
16
|
+
</GrytProvider>
|
|
17
|
+
);
|
|
18
|
+
}`}function Yo(n){return JSON.stringify(n,null,2)}function vt(n){const t=n.trim();if(t==="")return{error:"Nothing to import."};const e=c.decodeGrytTheme(t);return e===null?{error:t.startsWith("{")?"No theme in that JSON.":"No theme in that link."}:{draft:e.theme,appearance:e.appearance}}const ye={sm:24,md:32,lg:48,xl:64,full:40},Le=999,Vo=["bg","surface","surfaceRaised","surfaceHover","border"],Uo=["text","muted"];function Xo({value:n,onChange:t,appearance:e,onAppearanceChange:o,remoteFontsAllowed:a=!0,actions:d,footer:u,className:p}){const[m,f]=i.useState(()=>te(n.hue)&&(n.lightHue===null||te(n.lightHue))),[x,y]=i.useState(null);if(x!==null&&x!==n){y(null);const l=te(n.hue)&&(n.lightHue===null||te(n.lightHue));l!==m&&f(l)}const[b,h]=i.useState(""),[w,j]=i.useState(null),P=i.useMemo(()=>wt(n,e),[n,e]),v=i.useMemo(()=>Go(n,P,e),[n,P,e]),S=i.useMemo(()=>{const l=new Map;for(const g of v)if(!(g.advisory||g.level!=="fail"))for(const C of g.paths)l.has(C)||l.set(C,`${g.label}: ${g.ratio.toFixed(1)}, needs ${g.min}`);return l},[v]),M=Qe(n),O=c.grytPresets.find(l=>Qe(l.theme)===M)?.id??"custom",Q=n[e],Ne=_e(n,e),Te=he(n,e),Tt=v.filter(l=>!l.advisory&&l.level==="fail").length;function pe(l){y(l),t(l)}function Y(l){const g=l(n);pe(m?{...g,hue:ce(g.hue),lightHue:g.lightHue===null?null:ce(g.lightHue)}:g)}function Se(l){f(te(l.hue)&&(l.lightHue===null||te(l.lightHue))),pe(l)}function Pe(l,g){Y(C=>{const Ce=_e(C,e);return{...C,[Ce]:{...he(C,e),[l]:g}}})}function St(l){Y(g=>({...g,lightHue:l?{...g.hue}:null}))}function Pt(l){f(l),l&&pe({...n,hue:ce(n.hue),lightHue:n.lightHue===null?null:ce(n.lightHue)})}function qe(l,g){Y(C=>({...C,[e]:{...C[e],[l]:g}}))}function Ct(l){Y(g=>({...g,name:l===""?void 0:l}))}function Rt(l,g){Y(C=>({...C,fonts:{...C.fonts??c.grytFonts,[l]:g}}))}function kt(l){Y(g=>({...g,motion:l}))}function At(l,g){Y(C=>({...C,radius:{...C.radius,[l]:g}}))}function Mt(l){const g=vt(l);if(g.error!==void 0||g.draft===void 0){j(g.error??"That did not look like a theme.");return}Se(g.draft),g.appearance!==void 0&&o(g.appearance),j(null),h("")}return r.jsxs("div",{className:s("flex min-w-0 flex-col gap-(--space-md)",p),children:[r.jsxs("div",{className:"flex flex-wrap items-end gap-3 border-y border-gryt-border py-3",children:[r.jsx("div",{className:"w-52",children:r.jsx(ve,{label:"Preset",onValueChange:l=>{const g=c.grytPresetsById.get(String(l));g&&Se(g.theme)},options:[...c.grytPresets.map(l=>({label:l.name,value:l.id})),...O==="custom"?[{label:"Custom",value:"custom"}]:[]],size:"small",value:O})}),r.jsx("div",{className:"w-48",children:r.jsx(we,{label:"Name",maxLength:c.GRYT_THEME_NAME_MAX,onChange:l=>Ct(l.target.value),placeholder:"Untitled theme",size:"small",value:n.name??""})}),r.jsxs(ge,{onClick:()=>Se(Ho()),size:"small",tone:"neutral",children:[r.jsx(k.ArrowsClockwise,{"aria-hidden":"true",size:15}),"Generate"]}),r.jsxs("div",{className:"ml-auto flex items-end gap-3",children:[r.jsxs(yt,{"aria-label":"Appearance",onValueChange:l=>{const g=l[l.length-1];(g==="dark"||g==="light")&&o(g)},value:[e],children:[r.jsx(He,{size:"small",value:"dark",children:"Dark"}),r.jsx(He,{size:"small",value:"light",children:"Light"})]}),d]})]}),r.jsxs("p",{className:"m-0 text-xs text-gryt-muted",children:["Editing the ",e," half. The neutrals below belong to it",n.lightHue===null?"; the hues are shared, because step 9 is the same colour in both.":" and so do the hues."]}),r.jsxs("div",{className:"flex flex-col gap-2",children:[e==="light"?r.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-gryt-muted",children:[r.jsx(Fe,{checked:n.lightHue!==null,onCheckedChange:St}),"Light has its own hues"]}):null,r.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-gryt-muted",children:[r.jsx(Fe,{checked:m,onCheckedChange:Pt}),"Pick label colours automatically"]})]}),r.jsxs("div",{className:"flex flex-col gap-(--space-md)",children:[r.jsxs(_,{title:"Surfaces",children:[Vo.map(l=>r.jsx(le,{label:Ze[l],onChange:g=>qe(l,g),value:Q[l],warning:S.get(`${e}.${l}`)},l)),r.jsx(ee,{label:"neutral",steps:L(P,"neutral")})]}),r.jsx(_,{title:"Text",children:Uo.map(l=>r.jsx(le,{label:Ze[l],onChange:g=>qe(l,g),value:Q[l],warning:S.get(`${e}.${l}`)},l))}),r.jsxs(_,{title:"Accent",children:[["accent","accentLight","onAccent"].map(l=>r.jsx(le,{disabled:m&&l==="onAccent",label:Ae[l],onChange:g=>Pe(l,g),value:Te[l],warning:S.get(`${Ne}.${l}`)},l)),r.jsx(ee,{label:"accent",steps:L(P,"accent")})]}),r.jsxs(_,{title:"Secondary",children:[["secondary","secondaryLight","onSecondary"].map(l=>r.jsx(le,{disabled:m&&l==="onSecondary",label:Ae[l],onChange:g=>Pe(l,g),value:Te[l],warning:S.get(`${Ne}.${l}`)},l)),r.jsx(ee,{label:"secondary",steps:L(P,"secondary")})]}),r.jsxs(_,{title:"Status",children:[["success","danger","dangerLight","onDanger","warning"].map(l=>r.jsx(le,{disabled:m&&l==="onDanger",label:Ae[l],onChange:g=>Pe(l,g),value:Te[l],warning:S.get(`${Ne}.${l}`)},l)),r.jsx(ee,{label:"success",steps:L(P,"success")}),r.jsx(ee,{label:"danger",steps:L(P,"danger")}),r.jsx(ee,{label:"warning",steps:L(P,"warning")})]}),r.jsx(_,{title:"Type",children:c.GRYT_FONT_KEYS.map(l=>r.jsx(Ao,{fonts:n.fonts,onChange:g=>Rt(l,g),remoteAllowed:a,role:l},l))}),r.jsx(_,{title:"Motion",children:r.jsx($o,{motion:n.motion,onChange:kt})}),r.jsx(_,{title:"Radius",children:bt.map(l=>{const g=n.radius[l],C=l==="full"&&g>=Le?ye.full:g;return r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"mb-1 flex items-baseline justify-between gap-2",children:[r.jsx("span",{className:"text-xs font-medium text-gryt-muted",children:et[l]}),r.jsx("span",{className:"font-mono text-[11px] text-gryt-muted",children:g>=Le?"pill":`${g}px`})]}),r.jsx(Be,{"aria-label":`${et[l]} radius`,max:ye[l],min:0,onValueChange:Ce=>{const Ye=Number(Ce);At(l,l==="full"&&Ye>=ye.full?Le:Ye)},value:Math.min(C,ye[l])}),r.jsx("p",{className:"m-0 pt-1 text-[11px] text-gryt-muted",children:So[l]})]},l)})}),r.jsx(Io,{checks:v,onRepair:Tt>0?()=>pe(_o(n)):void 0}),r.jsxs("section",{className:"min-w-0",children:[r.jsx("h2",{className:"m-0 pb-2 text-[11px] font-semibold uppercase tracking-wider text-gryt-muted",children:"Load one back"}),r.jsx("p",{className:"m-0 pb-2 text-sm text-gryt-muted",children:"Paste a theme’s JSON, or a link somebody sent you."}),r.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[r.jsx("textarea",{"aria-label":"Theme JSON or a shared link",className:"min-h-11 flex-1 rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface-raised px-4 py-2.5 font-mono text-sm text-gryt-text outline-none placeholder:text-gryt-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",onChange:l=>h(l.target.value),placeholder:"{ …",rows:2,spellCheck:!1,value:b}),r.jsx(ge,{onClick:()=>Mt(b),tone:"neutral",children:"Load"})]}),w?r.jsx("p",{className:"m-0 pt-2 text-sm text-gryt-danger-11",children:w}):null]}),u]})]})}function _({title:n,children:t}){return r.jsxs("section",{className:"min-w-0",children:[r.jsx("h2",{className:"m-0 pb-2 text-[11px] font-semibold uppercase tracking-wider text-gryt-muted",children:n}),r.jsx("div",{className:"flex flex-col gap-3",children:t})]})}const Wo={primary:"bg-gryt-accent",success:"bg-gryt-success",warning:"bg-gryt-warning",danger:"bg-gryt-danger"};function Ko({className:n,value:t,label:e,showValue:o=!1,tone:a="primary",...d}){return r.jsxs(ie.Meter.Root,{value:t,className:s("gryt-meter flex w-full flex-col gap-1.5",n),...d,children:[(e||o)&&r.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[e?r.jsx(ie.Meter.Label,{className:"text-sm text-gryt-muted",children:e}):r.jsx("span",{}),o&&r.jsx(ie.Meter.Value,{className:"font-mono text-xs text-gryt-muted tabular-nums"})]}),r.jsx(ie.Meter.Track,{className:"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised",children:r.jsx(ie.Meter.Indicator,{className:s("h-full rounded-(--gryt-radius-full)","transition-[width] duration-120 ease-out motion-reduce:transition-none",Wo[a])})})]})}const Jo=i.forwardRef(function({className:t,...e},o){return r.jsx(B.AlertDialog.Popup,{ref:o,className:s("gryt-alert-dialog fixed top-1/2 left-1/2 z-50 -translate-x-1/2 -translate-y-1/2","flex w-[32rem] max-w-[calc(100vw-3rem)] flex-col gap-4","rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-gryt-text","outline-none","transition-[opacity,scale] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0",t),...e})}),Qo=i.forwardRef(function({className:t,...e},o){return r.jsx(B.AlertDialog.Backdrop,{ref:o,className:s("gryt-alert-dialog-backdrop fixed inset-0 z-50 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)","transition-opacity duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:opacity-0 data-ending-style:opacity-0",t),...e})}),Zo=i.forwardRef(function({className:t,...e},o){return r.jsx(B.AlertDialog.Title,{ref:o,className:s("gryt-alert-dialog-title text-lg font-semibold text-gryt-text",t),...e})}),en=i.forwardRef(function({className:t,...e},o){return r.jsx(B.AlertDialog.Description,{ref:o,className:s("gryt-alert-dialog-description text-sm leading-6 text-gryt-muted",t),...e})}),tn={Root:B.AlertDialog.Root,Trigger:B.AlertDialog.Trigger,Portal:B.AlertDialog.Portal,Backdrop:Qo,Popup:Jo,Title:Zo,Description:en,Close:B.AlertDialog.Close},jt=["flex cursor-default items-center gap-2 rounded-(--gryt-radius-md)","px-3 py-2 text-sm text-gryt-text outline-none select-none","data-highlighted:bg-gryt-surface-raised","data-selected:text-gryt-accent-11","data-disabled:cursor-not-allowed data-disabled:opacity-50"].join(" "),Nt=[dt,ut.medium,"border-gryt-border",A].join(" "),rn=i.forwardRef(function({className:t,...e},o){return r.jsx(T.Combobox.Input,{ref:o,className:s("gryt-combobox-input",Nt,t),...e})}),on=i.forwardRef(function({className:t,sideOffset:e=6,...o},a){return r.jsx(T.Combobox.Positioner,{ref:a,sideOffset:e,className:s("gryt-combobox-positioner outline-none",t),...o})}),nn=i.forwardRef(function({className:t,...e},o){return r.jsx(T.Combobox.Popup,{ref:o,className:s("gryt-combobox max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none",J,q,t),...e})}),an=i.forwardRef(function({className:t,...e},o){return r.jsx(T.Combobox.Item,{ref:o,className:s("gryt-combobox-item",jt,t),...e})}),sn=i.forwardRef(function({className:t,...e},o){return r.jsx(T.Combobox.Empty,{ref:o,className:s("gryt-combobox-empty px-3 py-2 text-sm text-gryt-muted",t),...e})}),ln={Root:T.Combobox.Root,Input:rn,InputGroup:T.Combobox.InputGroup,Trigger:T.Combobox.Trigger,Icon:T.Combobox.Icon,Clear:T.Combobox.Clear,Value:T.Combobox.Value,Chips:T.Combobox.Chips,Chip:T.Combobox.Chip,ChipRemove:T.Combobox.ChipRemove,Portal:T.Combobox.Portal,Positioner:on,Popup:nn,List:T.Combobox.List,Item:an,ItemIndicator:T.Combobox.ItemIndicator,Group:T.Combobox.Group,GroupLabel:T.Combobox.GroupLabel,Empty:sn,Separator:T.Combobox.Separator},cn=i.forwardRef(function({className:t,...e},o){return r.jsx(R.Autocomplete.Input,{ref:o,className:s("gryt-autocomplete-input",Nt,t),...e})}),dn=i.forwardRef(function({className:t,sideOffset:e=6,...o},a){return r.jsx(R.Autocomplete.Positioner,{ref:a,sideOffset:e,className:s("gryt-autocomplete-positioner outline-none",t),...o})}),un=i.forwardRef(function({className:t,...e},o){return r.jsx(R.Autocomplete.Popup,{ref:o,className:s("gryt-autocomplete max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none",J,q,t),...e})}),gn=i.forwardRef(function({className:t,...e},o){return r.jsx(R.Autocomplete.Item,{ref:o,className:s("gryt-autocomplete-item",jt,t),...e})}),mn=i.forwardRef(function({className:t,...e},o){return r.jsx(R.Autocomplete.Empty,{ref:o,className:s("gryt-autocomplete-empty px-3 py-2 text-sm text-gryt-muted",t),...e})}),pn={Root:R.Autocomplete.Root,Input:cn,InputGroup:R.Autocomplete.InputGroup,Trigger:R.Autocomplete.Trigger,Icon:R.Autocomplete.Icon,Clear:R.Autocomplete.Clear,Value:R.Autocomplete.Value,Portal:R.Autocomplete.Portal,Positioner:dn,Popup:un,List:R.Autocomplete.List,Item:gn,Group:R.Autocomplete.Group,GroupLabel:R.Autocomplete.GroupLabel,Empty:mn,Separator:R.Autocomplete.Separator},fn=i.forwardRef(function({className:t,...e},o){return r.jsx(Ft.CheckboxGroup,{ref:o,className:s("gryt-checkbox-group flex flex-col gap-2",t),...e})}),xn=i.forwardRef(function({className:t,...e},o){return r.jsx(ze.Collapsible.Trigger,{ref:o,className:s("gryt-collapsible-trigger flex w-full items-center justify-between gap-2","rounded-(--gryt-radius-md) border-0 bg-transparent px-2 py-2 text-left","text-sm font-medium text-gryt-text select-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none",A,t),...e})}),yn=i.forwardRef(function({className:t,...e},o){return r.jsx(ze.Collapsible.Panel,{ref:o,className:s("gryt-collapsible-panel overflow-hidden","h-(--collapsible-panel-height) transition-[height] duration-(--gryt-dur-spring) ease-spring","data-starting-style:h-0 data-ending-style:h-0","motion-reduce:transition-none",t),...e})}),bn={Root:ze.Collapsible.Root,Trigger:xn,Panel:yn},hn=i.forwardRef(function({className:t,...e},o){return r.jsx(Ht.Form,{ref:o,className:s("gryt-form flex flex-col gap-(--gryt-space-lg)",t),...e})}),wn=i.forwardRef(function({className:t,...e},o){return r.jsx(it.Fieldset.Root,{ref:o,className:s("gryt-fieldset flex min-w-0 flex-col gap-3 border-0 p-0",t),...e})}),vn=i.forwardRef(function({className:t,...e},o){return r.jsx(it.Fieldset.Legend,{ref:o,className:s("gryt-fieldset-legend text-sm font-semibold text-gryt-text",t),...e})}),jn={Root:wn,Legend:vn},Nn=i.forwardRef(function({className:t,...e},o){return r.jsx(_t.Menubar,{ref:o,className:s("gryt-menubar flex items-center gap-1","rounded-(--gryt-radius-md) border border-gryt-border bg-gryt-surface p-1",t),...e})}),Tn=i.forwardRef(function({className:t,...e},o){return r.jsx(D.NavigationMenu.Trigger,{ref:o,className:s("gryt-navigation-menu-trigger flex items-center gap-1.5 rounded-(--gryt-radius-md)","border-0 bg-transparent px-3 py-2 text-sm font-medium text-gryt-text select-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none","data-popup-open:bg-gryt-surface-raised",A,t),...e})}),Sn=i.forwardRef(function({className:t,...e},o){return r.jsx(D.NavigationMenu.Popup,{ref:o,className:s("gryt-navigation-menu-popup outline-none",J,q,t),...e})}),Pn=i.forwardRef(function({className:t,...e},o){return r.jsx(D.NavigationMenu.Positioner,{ref:o,className:s("gryt-navigation-menu-positioner outline-none",t),...e})}),Cn=i.forwardRef(function({className:t,...e},o){return r.jsx(D.NavigationMenu.Viewport,{ref:o,className:s("gryt-navigation-menu-viewport relative overflow-hidden",t),...e})}),Rn=i.forwardRef(function({className:t,...e},o){return r.jsx(D.NavigationMenu.Link,{ref:o,className:s("gryt-navigation-menu-link block rounded-(--gryt-radius-md) px-3 py-2","text-sm text-gryt-text no-underline outline-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none",A,t),...e})}),kn={Root:D.NavigationMenu.Root,List:D.NavigationMenu.List,Item:D.NavigationMenu.Item,Trigger:Tn,Content:D.NavigationMenu.Content,Portal:D.NavigationMenu.Portal,Positioner:Pn,Viewport:Cn,Popup:Sn,Link:Rn,Icon:D.NavigationMenu.Icon,Arrow:D.NavigationMenu.Arrow},at="flex h-9 w-9 shrink-0 items-center justify-center border-0 bg-transparent text-gryt-muted transition-colors hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text motion-reduce:transition-none disabled:cursor-not-allowed disabled:opacity-50",An=i.forwardRef(function({className:t,label:e,scrubbable:o=!1,...a},d){return r.jsxs(V.NumberField.Root,{ref:d,className:s("gryt-number-field flex flex-col gap-1.5",t),...a,children:[e&&(o?r.jsxs(V.NumberField.ScrubArea,{className:"cursor-ew-resize text-sm text-gryt-muted select-none",children:[e,r.jsx(V.NumberField.ScrubAreaCursor,{})]}):r.jsx("span",{className:"text-sm text-gryt-muted",children:e})),r.jsxs(V.NumberField.Group,{className:s("flex w-fit items-center overflow-hidden rounded-(--gryt-radius-full)","border border-gryt-border bg-gryt-surface-raised","focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-gryt-accent-light",ae),children:[r.jsx(V.NumberField.Decrement,{"aria-label":"Decrease",className:s(at,"rounded-l-(--gryt-radius-full)"),children:r.jsx(k.Minus,{size:14,weight:"bold"})}),r.jsx(V.NumberField.Input,{className:s("w-16 border-0 bg-transparent px-1 py-2 text-center","font-mono text-sm text-gryt-text tabular-nums outline-none",A)}),r.jsx(V.NumberField.Increment,{"aria-label":"Increase",className:s(at,"rounded-r-(--gryt-radius-full)"),children:r.jsx(k.Plus,{size:14,weight:"bold"})})]})]})}),Mn=i.forwardRef(function({className:t,length:e=6,...o},a){return r.jsx(We.OTPField.Root,{ref:a,length:e,className:s("gryt-otp-field flex gap-2",t),...o,children:Array.from({length:e},(d,u)=>r.jsx(We.OTPField.Input,{className:s("gryt-otp-input h-12 w-10 rounded-(--gryt-radius-md) text-center","border border-gryt-border bg-gryt-surface-raised","font-mono text-lg text-gryt-text tabular-nums outline-none","transition-colors duration-(--gryt-dur-fast) motion-reduce:transition-none","data-filled:border-gryt-accent",A)},u))})}),$n=i.forwardRef(function({className:t,sideOffset:e=8,...o},a){return r.jsx(re.PreviewCard.Positioner,{ref:a,sideOffset:e,className:s("gryt-preview-card-positioner outline-none",t),...o})}),Dn=i.forwardRef(function({className:t,...e},o){return r.jsx(re.PreviewCard.Popup,{ref:o,className:s("gryt-preview-card w-64 max-w-[calc(100vw-2rem)] p-4 outline-none",J,q,t),...e})}),In={Root:re.PreviewCard.Root,Trigger:re.PreviewCard.Trigger,Portal:re.PreviewCard.Portal,Positioner:$n,Popup:Dn,Arrow:re.PreviewCard.Arrow},On=i.forwardRef(function({className:t,...e},o){return r.jsx(oe.Toolbar.Root,{ref:o,className:s("gryt-toolbar flex items-center gap-1","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface p-1",t),...e})}),Ln=i.forwardRef(function({className:t,...e},o){return r.jsx(oe.Toolbar.Separator,{ref:o,className:s("gryt-toolbar-separator mx-1 h-6 w-px bg-gryt-border",t),...e})}),Gn={Root:On,Group:oe.Toolbar.Group,Button:oe.Toolbar.Button,Link:oe.Toolbar.Link,Input:oe.Toolbar.Input,Separator:Ln};Object.defineProperty(exports,"GRYT_FONT_KEYS",{enumerable:!0,get:()=>c.GRYT_FONT_KEYS});Object.defineProperty(exports,"GRYT_FONT_STACK_MAX",{enumerable:!0,get:()=>c.GRYT_FONT_STACK_MAX});Object.defineProperty(exports,"GRYT_HUE_KEYS",{enumerable:!0,get:()=>c.GRYT_HUE_KEYS});Object.defineProperty(exports,"GRYT_MOTION_CURVES",{enumerable:!0,get:()=>c.GRYT_MOTION_CURVES});Object.defineProperty(exports,"GRYT_MOTION_SCALE_MAX",{enumerable:!0,get:()=>c.GRYT_MOTION_SCALE_MAX});Object.defineProperty(exports,"GRYT_NEUTRAL_KEYS",{enumerable:!0,get:()=>c.GRYT_NEUTRAL_KEYS});Object.defineProperty(exports,"GRYT_RADIUS_KEYS",{enumerable:!0,get:()=>c.GRYT_RADIUS_KEYS});Object.defineProperty(exports,"GRYT_THEME_NAME_MAX",{enumerable:!0,get:()=>c.GRYT_THEME_NAME_MAX});Object.defineProperty(exports,"alphaScale",{enumerable:!0,get:()=>c.alphaScale});Object.defineProperty(exports,"cloneGrytTheme",{enumerable:!0,get:()=>c.cloneGrytTheme});Object.defineProperty(exports,"contrast",{enumerable:!0,get:()=>c.contrast});Object.defineProperty(exports,"createGrytTheme",{enumerable:!0,get:()=>c.createGrytTheme});Object.defineProperty(exports,"decodeGrytTheme",{enumerable:!0,get:()=>c.decodeGrytTheme});Object.defineProperty(exports,"encodeDraft",{enumerable:!0,get:()=>c.encodeGrytTheme});Object.defineProperty(exports,"encodeGrytTheme",{enumerable:!0,get:()=>c.encodeGrytTheme});Object.defineProperty(exports,"grytAlphaScales",{enumerable:!0,get:()=>c.grytAlphaScales});Object.defineProperty(exports,"grytAlphaScalesLight",{enumerable:!0,get:()=>c.grytAlphaScalesLight});Object.defineProperty(exports,"grytFonts",{enumerable:!0,get:()=>c.grytFonts});Object.defineProperty(exports,"grytLightTokens",{enumerable:!0,get:()=>c.grytLightTokens});Object.defineProperty(exports,"grytMotion",{enumerable:!0,get:()=>c.grytMotion});Object.defineProperty(exports,"grytPresets",{enumerable:!0,get:()=>c.grytPresets});Object.defineProperty(exports,"grytPresetsById",{enumerable:!0,get:()=>c.grytPresetsById});Object.defineProperty(exports,"grytScales",{enumerable:!0,get:()=>c.grytScales});Object.defineProperty(exports,"grytScalesLight",{enumerable:!0,get:()=>c.grytScalesLight});Object.defineProperty(exports,"grytTheme",{enumerable:!0,get:()=>c.grytTheme});Object.defineProperty(exports,"grytThemeHues",{enumerable:!0,get:()=>c.grytThemeHues});Object.defineProperty(exports,"grytThemeToOptions",{enumerable:!0,get:()=>c.grytThemeToOptions});Object.defineProperty(exports,"grytTokens",{enumerable:!0,get:()=>c.grytTokens});Object.defineProperty(exports,"hexToOklch",{enumerable:!0,get:()=>c.hexToOklch});Object.defineProperty(exports,"hexToRgb",{enumerable:!0,get:()=>c.hexToRgb});Object.defineProperty(exports,"hueScale",{enumerable:!0,get:()=>c.hueScale});Object.defineProperty(exports,"hueScaleLight",{enumerable:!0,get:()=>c.hueScaleLight});Object.defineProperty(exports,"isBezier",{enumerable:!0,get:()=>c.isBezier});Object.defineProperty(exports,"isFontStack",{enumerable:!0,get:()=>c.isFontStack});Object.defineProperty(exports,"isHexColor",{enumerable:!0,get:()=>c.isHexColor});Object.defineProperty(exports,"isValidBezier",{enumerable:!0,get:()=>c.isValidBezier});Object.defineProperty(exports,"neutralScale",{enumerable:!0,get:()=>c.neutralScale});Object.defineProperty(exports,"neutralScaleLight",{enumerable:!0,get:()=>c.neutralScaleLight});Object.defineProperty(exports,"normalizeHexColor",{enumerable:!0,get:()=>c.normalizeHexColor});Object.defineProperty(exports,"normalizeThemeName",{enumerable:!0,get:()=>c.normalizeThemeName});Object.defineProperty(exports,"oklchToHex",{enumerable:!0,get:()=>c.oklchToHex});Object.defineProperty(exports,"rgbToHex",{enumerable:!0,get:()=>c.rgbToHex});Object.defineProperty(exports,"avatarSeed",{enumerable:!0,get:()=>Ge.avatarSeed});exports.Accordion=Zr;exports.Alert=br;exports.AlertDialog=tn;exports.Autocomplete=pn;exports.Avatar=mt;exports.Badge=or;exports.Button=ge;exports.Card=mr;exports.CardActions=xr;exports.CardContent=fr;exports.CardHeader=pr;exports.Checkbox=Fe;exports.CheckboxGroup=fn;exports.Chip=ar;exports.Collapsible=bn;exports.Combobox=ln;exports.Composer=er;exports.ContextMenu=to;exports.ConversationItem=rr;exports.Dialog=Rr;exports.Divider=gr;exports.Drawer=Hr;exports.Fieldset=jn;exports.Form=hn;exports.GrytProvider=zt;exports.IconButton=Jt;exports.Menu=be;exports.Menubar=Nn;exports.MessageBubble=Zt;exports.Meter=Ko;exports.NavigationMenu=kn;exports.NumberField=An;exports.OtpField=Mn;exports.Popover=so;exports.PreviewCard=In;exports.Progress=hr;exports.Radio=sr;exports.RadioGroup=ir;exports.ScrollArea=wo;exports.Select=ve;exports.Skeleton=jr;exports.Slider=Be;exports.Spinner=wr;exports.Surface=Qt;exports.Switch=lr;exports.Tab=xt;exports.Tabs=Xr;exports.TextField=we;exports.ThemeEditor=Xo;exports.Toast=fo;exports.Toggle=He;exports.ToggleGroup=yt;exports.Toolbar=Gn;exports.Tooltip=dr;exports.TooltipProvider=ur;exports.cloneDraft=ht;exports.cn=s;exports.grytDraft=No;exports.importTheme=vt;exports.themeCode=qo;exports.themeJson=Yo;exports.themeStyle=wt;exports.useMediaQuery=ft;exports.useToastManager=xo;
|
|
2
19
|
//# sourceMappingURL=index.cjs.map
|