UNPKG

@fntio/infra-client

Version:

Self-hosted AWS access portal: credential vending, target-account trust, and grant-driven private networking as CDK stacks and constructs.

2 lines (1 loc) • 2.58 kB
import{Da as m,Ea as b,Fa as p,Ka as f,Na as h,Oa as v,Pa as y,Wa as r,_ as d,ga as l,qb as s,rb as z,sa as u,ta as g,tb as t,ua as c,xb as x}from"./chunk-FYA6QUPZ.js";var M=["*"];function B(i,o){if(i&1&&p(0,"span"),i&2){let e=h();r(e.spinnerClasses())}}var w=class i{variant=t("primary");size=t("md");type=t("button");disabled=t(!1);loading=t(!1);ariaLabel=t(null);classes=s(()=>{let o="inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand disabled:opacity-50 disabled:cursor-not-allowed",e={sm:"h-6 px-2.5 text-xs rounded-lg",md:"h-8 px-3 text-sm rounded-lg",lg:"h-9 px-4 text-sm rounded-lg",icon:"h-7 w-7 text-sm leading-none rounded-lg","icon-sm":"h-4 w-4 text-xs leading-none rounded"},n={outline:"font-medium",danger:"font-medium"},C={primary:"bg-brand text-brand-foreground hover:bg-brand-hover",secondary:"bg-brand/12 text-brand-muted-foreground ring-1 ring-inset ring-brand/25 hover:bg-brand/18",outline:"bg-transparent text-surface-foreground ring-1 ring-inset ring-border-strong hover:bg-muted",danger:"bg-transparent text-danger ring-1 ring-inset ring-border-strong hover:bg-danger-muted",ghost:"text-muted-foreground hover:bg-muted"},D=this.size()==="sm"?"font-medium":n[this.variant()]??"font-normal",a=C[this.variant()];return this.size()==="icon-sm"&&this.variant()==="outline"&&(a=a.replace("text-surface-foreground","text-muted-foreground hover:text-surface-foreground")),`${o} ${e[this.size()]} ${D} ${a}`});spinnerClasses=s(()=>`${{sm:"h-3 w-3",md:"h-3.5 w-3.5",lg:"h-4 w-4",icon:"h-3.5 w-3.5","icon-sm":"h-2.5 w-2.5"}[this.size()]} animate-spin rounded-full border-2 border-current border-t-transparent`);constructor(){x()&&z(()=>{this.ariaLabel()&&this.size()!=="icon"&&this.size()!=="icon-sm"&&console.warn(`app-button: ariaLabel="${this.ariaLabel()}" with size="${this.size()}" \u2014 icon-only buttons need size="icon" or size="icon-sm" for a square hit target.`)})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=l({type:i,selectors:[["app-button"]],inputs:{variant:[1,"variant"],size:[1,"size"],type:[1,"type"],disabled:[1,"disabled"],loading:[1,"loading"],ariaLabel:[1,"ariaLabel"]},ngContentSelectors:M,decls:3,vars:6,consts:[[3,"type","disabled"],[3,"class"]],template:function(e,n){e&1&&(v(),m(0,"button",0),g(1,B,1,2,"span",1),y(2),b()),e&2&&(r(n.classes()),f("type",n.type())("disabled",n.disabled()||n.loading()),u("aria-label",n.ariaLabel()),d(),c(n.loading()?1:-1))},encapsulation:2})};export{w as a};