PageSourceSearch

https://karte.defensivearchitektur.org/assets/Button-hm23hUoM.js

js defensivearchitektur.org collected 2026-10-02 22:59:23 UTC 6,724 bytes, 1 lines download raw bytes

1import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-DiVRNtpo.js";import{i as n,v as r,y as i}from"./useTranslation-BbhNI8og.js";import{t as a}from"./jsx-runtime-BdxMnOeJ.js";import{t as o}from"./classNameConstructor-B_CJRpZB.js";var s,c=new Uint8Array(16);function l(){if(!s&&(s=typeof crypto<`u`&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!s))throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);return s(c)}var u=[];for(let e=0;e<256;++e)u.push((e+256).toString(16).slice(1));function d(e,t=0){return u[e[t+0]]+u[e[t+1]]+u[e[t+2]]+u[e[t+3]]+`-`+u[e[t+4]]+u[e[t+5]]+`-`+u[e[t+6]]+u[e[t+7]]+`-`+u[e[t+8]]+u[e[t+9]]+`-`+u[e[t+10]]+u[e[t+11]]+u[e[t+12]]+u[e[t+13]]+u[e[t+14]]+u[e[t+15]]}var f={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function p(e,t,n){if(f.randomUUID&&!t&&!e)return f.randomUUID();e||={};let r=e.random||(e.rng||l)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n||=0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return d(r)}var m=e(t()),h=a(),g=i({slots:{base:[`group/button pointer-events-auto relative flex w-fit items-center justify-center`,`text-text-default`,`font-semibold text-base leading-none no-underline`,`ring-inset focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-black`,`rounded-xl transition-[color,background-color,box-shadow] duration-200 ease-out`],prefix:[`font-semibold text-text-subdued`,`no-touch:group-hover/button:text-[var(--primary-800)] group-active/button:text-[var(--primary-800)]`,`ms-2`],icon:[`shrink-0 text-inherit`],text:`mx-2`,spinner:[`shrink-0 text-inherit`]},variants:{variant:{basic:`bg-action-secondary-default no-touch:hover:bg-action-secondary-hovered touch-any:active:bg-action-secondary-pressed`,primary:`text-text-on-primary no-touch:hover:text-text-on-primary touch-any:active:text-text-on-primary bg-action-primary-default no-touch:hover:bg-action-primary-hovered touch-any:active:bg-action-primary-pressed font-bold`,white:`bg-surface-default no-touch:hover:bg-action-tertiary-hovered touch-any:active:bg-action-tertiary-pressed`,outline:`bg-transparent no-touch:hover:bg-action-secondary-hovered touch-any:active:bg-action-secondary-pressed ring-1 ring-border-default no-touch:hover:ring-border-hovered touch-any:active:ring-border-pressed`,shapeless:`bg-transparent no-touch:hover:bg-action-secondary-hovered touch-any:active:bg-action-secondary-pressed`,shadow:`bg-white shadow-lg no-touch:hover:shadow-md touch-any:active:shadow no-touch:hover:bg-action-secondary-hovered touch-any:active:bg-action-secondary-pressed ring-inset ring-2 ring-white`},size:{xl:`h-14 p-4`,lg:`h-11 p-3`,md:`h-9 p-2`,sm:`h-7 p-1 text-sm`},square:{true:`aspect-square`},pillShaped:{true:{base:`rounded-full`},false:{base:`rounded-xl`,text:`mx-1.5`}},disabled:{true:{base:`pointer-events-none text-text-disabled`}},critical:{true:{base:`text-text-critical no-touch:hover:text-text-critical touch-any:active:text-text-critical no-touch:hover:bg-surface-critical-subdued-hovered touch-any:active:bg-surface-critical-subdued-pressed font-bold`,icon:`no-touch:hover:text-icon-critical touch-any:active:text-icon-critical`}},width:{max:`w-full`},textSubdued:{true:`text-text-subdued no-touch:hover:text-[var(--primary-800)] touch-any:active:text-[var(--primary-800)]`},isLogo:{true:{},false:{}}},compoundVariants:[{variant:`basic`,critical:!0,class:{base:[`bg-surface-critical-subdued`]}},{variant:`primary`,critical:!0,class:{base:[`text-text-on-critical no-touch:hover:text-text-on-critical touch-any:active:text-text-on-critical`,`bg-action-critical-default no-touch:hover:bg-action-critical-hovered touch-any:active:bg-action-critical-pressed`]}},{variant:`outline`,critical:!0,class:{base:[`text-text-critical`,`no-touch:hover:bg-surface-critical-subdued-hovered touch-any:active:bg-surface-critical-subdued-pressed`,`ring-border-critical-default no-touch:hover:ring-border-critical-default touch-any:active:ring-border-critical-default`],spinner:`text-icon-critical`,icon:`text-icon-critical`}},{variant:`primary`,textSubdued:!0,class:`text-[var(--primary-800)] bg-[var(--primary-200)] n
1o-touch:hover:bg-[var(--primary-300)] touch-any:active:bg-[var(--primary-400)]`},{disabled:!0,textSubdued:!0,class:{base:`text-text-disabled`}},{disabled:!0,critical:!0,class:{base:`text-text-disabled`,icon:`text-icon-disabled`}},{variant:`primary`,disabled:!0,class:{base:`bg-action-primary-disabled`}},{variant:`basic`,disabled:!0,class:{base:`bg-action-secondary-disabled`}},{variant:`outline`,disabled:!0,class:{base:`ring-border-disabled`}},{variant:`primary`,isLogo:!0,class:{base:`[&_path]:fill-current`}}],defaultVariants:{variant:`basic`,pillShaped:!0,square:!1,size:`md`,isLogo:!1}}),_=m.forwardRef(({id:e,trackId:t,className:i,width:a,loading:s,leadingIcon:c,trailingIcon:l,leadingIconProps:u,trailingIconProps:d,pillShaped:f,onClick:_,dataCy:v,tooltipLabel:y,text:b,textLang:x,children:S,variant:C,disabled:w,critical:T,disabledNotice:E,classNameWrapper:D,classNames:O,role:k,square:A=!1,size:j=`md`,tag:M=`button`,prefix:N,tooltipProps:P,textSubdued:F,...I},L)=>{let R=m.useRef(e||t||`tooltip-${p()}`),z=m.useRef(null),B=c&&s?`loading`:c,V=l&&!c&&s?`loading`:l,H=s&&!(B||V),U=m.useCallback(e=>{(e.key===`Enter`||e.key===` `)&&_&&typeof _==`function`&&!w&&(e.preventDefault(),_(e))},[_,w]),W=M,G=g({disabled:!!w,critical:!!T,size:j,square:A||!b&&!S&&!!(c?!l:l),variant:C,pillShaped:f,width:a,textSubdued:!!F,isLogo:B?.toString().includes(`logo/`)}),K=(0,h.jsxs)(W,{"data-cy":v,id:R.current,ref:L||z,type:M===`button`?`button`:void 0,role:M===`button`?k:`button`,tabIndex:0,onKeyDown:U,"aria-label":y??(typeof b==`string`?b:void 0),"aria-disabled":w,disabled:w,className:o(G.base(),i,t&&`button umami--click--${t}`),...I,children:[N&&(0,h.jsx)(`span`,{className:o(G.prefix()),children:N}),B&&(0,h.jsx)(r,{...u,name:B,"aria-hidden":`true`,className:o(G.icon(),u?.className,!!(S||b)&&`translate-x-0.5`,O?.leadingIcon)},typeof B==`string`?B:void 0),S&&(0,h.jsx)(`span`,{className:o(G.text(),O?.children),children:S}),H&&(0,h.jsx)(r,{name:`loading`,className:o(G.spinner(),b?`absolute`:``,O?.spinner)}),b&&(0,h.jsx)(`span`,{lang:x,style:{opacity:+!H},className:o(G.text(),O?.text),children:b}),V&&(0,h.jsx)(r,{...d,name:V,"aria-hidden":`true`,className:o(G.icon(),d?.className,!!(S||b)&&`-translate-x-0.5`,S||b?`ms-auto`:``,B&&!(S||b)&&`ms-1`,O?.trailingIcon)})]});return(0,h.jsx)(n,{critical:!!w&&!!E,disabled:w,primaryContent:w&&E||y,noTooltip:!y&&!w,onClick:_,className:o(D,O?.wrapper,a===`max`&&`w-full`,w&&`cursor-not-allowed`),id:e,tooltipProps:P,children:K})});_.displayName=`Button`;var v=m.memo(_);export{p as n,v as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.