@nordhealth/components
Advanced tools
Comparing version 1.0.0-alpha.39 to 1.0.0-alpha.40
@@ -1,2 +0,2 @@ | ||
import{r as t,D as o,p as n,_ as r,n as e,s as a}from"./DraftComponentMixin-4bb26f5d.js";import{e as s}from"./property-03f59dce.js";import{l as i}from"./directive-40a31ee2.js";import{n as l}from"./ref-857246ae.js";import{I as c,F as d}from"./InputMixin-3e737480.js";const b=t`:host{all:initial;display:inline-block}*,::after,::before{box-sizing:border-box;margin:0;padding:0}.n-button{-webkit-appearance:none;align-items:center;appearance:none;background:var(--n-button-background-color,var(--n-color-button));border-radius:var(--n-button-border-radius,var(--n-border-radius-s));border:1px var(--n-button-border-style,solid) var(--n-button-border-color,var(--n-color-border-strong));box-shadow:var(--n-button-box-shadow,var(--n-box-shadow));color:var(--n-button-color,var(--n-color-text));cursor:pointer;display:flex;gap:var(--n-button-gap,var(--n-space-s));font-family:var(--n-font-family);font-feature-settings:var(--n-font-features);font-size:var(--n-button-font-size,var(--n-font-size-m));font-weight:var(--n-button-font-weight,var(--n-font-weight));line-height:var(--n-line-height-form);margin:0;min-block-size:var(--n-button-min-height,var(--n-space-xl));padding:var(--n-button-padding-y,calc(var(--n-space-s)/ 1.6)) var(--n-button-padding-x,calc(var(--n-space-m)/ 1.2));text-align:var(--n-button-text-align,center);text-decoration:none;transition:all .1s ease;-webkit-user-select:none;user-select:none;inline-size:var(--n-button-width,fit-content)}:host([expand]){--n-button-width:100%;display:block}.n-content{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(:hover){--n-button-background-color:var(--n-color-button-hover);--n-button-border-color:var(--n-color-border-hover)}:host([disabled]){--n-button-background-color:var(--n-color-border);--n-button-box-shadow:none;--n-button-border-color:var(--n-button-background-color);--n-button-color:var(--n-color-text-weaker);opacity:.5;pointer-events:none}.n-button:focus{--n-button-border-color:var(--n-color-primary);--n-button-border-style:solid;--n-button-box-shadow:0 0 0 1px var(--n-button-border-color);outline:0}.n-button:active{opacity:.8;transform:translateY(1px);transition:none}:host([variant=primary]){--n-button-background-color:var(--n-color-primary);--n-button-border-color:transparent;--n-button-box-shadow:none;--n-button-color:var(--n-color-text-inverse);--n-button-font-weight:var(--n-font-weight-active)}:host([variant=primary]:hover){--n-button-background-color:var(--n-color-primary-strong)}:host([variant=dashed]){--n-button-color:var(--n-color-text-weaker);--n-button-border-color:var(--n-color-border-hover);--n-button-border-style:dashed;--n-button-box-shadow:none}:host([variant=dashed]:hover){--n-button-color:var(--n-color-text)}:host([variant=plain]){--n-button-border-color:transparent;--n-button-box-shadow:none}:host([variant=danger]){--n-button-border-color:var(--n-color-status-danger);--n-button-color:var(--n-color-text-error);--n-button-font-weight:var(--n-font-weight-active)}:host([size="s"]){--n-button-font-size:var(--n-font-size-s);--n-button-min-height:var(--n-space-l);--n-button-padding-y:calc(var(--n-space-s) / 1.5);--n-button-padding-x:var(--n-space-s);--n-button-gap:calc(var(--n-space-s) / 2)}:host([size="s"]) .n-button{line-height:var(--n-line-height-tight)}:host([size="l"]){--n-button-border-radius:var(--n-border-radius);--n-button-font-size:var(--n-font-size-l);--n-button-min-height:calc(var(--n-space-xxl) - var(--n-space-l));--n-button-padding-x:calc(var(--n-space-l) / 1.3);--n-button-font-weight:var(--n-font-weight-active)}::slotted(*){color:inherit;pointer-events:none}::slotted(svg){color:var(--n-color-icon)}::slotted(button[slot=proxy]){display:none}`;let u=class extends(c(d(o(a)))){constructor(){super(...arguments),this._proxyButton=document.createElement("button"),this.variant="default",this.type="submit",this.size="m",this.download=!1,this.target="_self",this.expand=!1}connectedCallback(){super.connectedCallback(),this.syncProxyButton()}disconnectedCallback(){super.disconnectedCallback(),this.cleanupProxyButton()}updated(){this.syncProxyButton()}render(){const t=n`<slot name="before"></slot><div class="n-content"><slot></slot></div><slot name="after"></slot>`;return this.href?n`<a ${l(this.focusableRef)} class="n-button" target="${this.target}" ?download="${this.download}" href="${this.href}">${t}</a>`:n`<slot name="proxy"></slot><button ${l(this.focusableRef)} class="n-button" ?disabled="${this.disabled}" name="${i(this.name)}" value="${i(this.value)}" @click="${this.handleClick}">${t}</button>`}handleClick(){this._proxyButton.click()}get isFormAssociated(){return!this.href&&this.form}syncProxyButton(){const t=this._proxyButton;t.slot="proxy",t.className="n-button-proxy",t.disabled=this.disabled,t.type=this.type,this.name?t.name=this.name:t.removeAttribute("name"),this.value?t.value=this.value:t.removeAttribute("value"),this.isFormAssociated?this.appendChild(t):this.cleanupProxyButton()}cleanupProxyButton(){this._proxyButton.remove()}};u.styles=b,r([s({reflect:!0})],u.prototype,"variant",void 0),r([s({reflect:!0})],u.prototype,"type",void 0),r([s({reflect:!0})],u.prototype,"size",void 0),r([s({reflect:!0})],u.prototype,"href",void 0),r([s({type:Boolean})],u.prototype,"download",void 0),r([s({reflect:!0})],u.prototype,"target",void 0),r([s({reflect:!0,type:Boolean})],u.prototype,"expand",void 0),u=r([e("nord-button")],u);var v=u;export{v as default}; | ||
import{r as t,D as o,p as n,_ as r,n as e,s as a}from"./DraftComponentMixin-4bb26f5d.js";import{e as s}from"./property-03f59dce.js";import{l as i}from"./if-defined-617ae549.js";import{n as l}from"./ref-65ef7607.js";import{I as c,F as d}from"./InputMixin-6c108de4.js";import"./directive-e9ce14b4.js";const b=t`:host{all:initial;display:inline-block}*,::after,::before{box-sizing:border-box;margin:0;padding:0}.n-button{-webkit-appearance:none;align-items:center;appearance:none;background:var(--n-button-background-color,var(--n-color-button));border-radius:var(--n-button-border-radius,var(--n-border-radius-s));border:1px var(--n-button-border-style,solid) var(--n-button-border-color,var(--n-color-border-strong));box-shadow:var(--n-button-box-shadow,var(--n-box-shadow));color:var(--n-button-color,var(--n-color-text));cursor:pointer;display:flex;gap:var(--n-button-gap,var(--n-space-s));font-family:var(--n-font-family);font-feature-settings:var(--n-font-features);font-size:var(--n-button-font-size,var(--n-font-size-m));font-weight:var(--n-button-font-weight,var(--n-font-weight));line-height:var(--n-line-height-form);margin:0;min-block-size:var(--n-button-min-height,var(--n-space-xl));padding:var(--n-button-padding-y,calc(var(--n-space-s)/ 1.6)) var(--n-button-padding-x,calc(var(--n-space-m)/ 1.2));text-align:var(--n-button-text-align,center);text-decoration:none;transition:all .1s ease;-webkit-user-select:none;user-select:none;inline-size:var(--n-button-width,fit-content)}:host([expand]){--n-button-width:100%;display:block}.n-content{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;position:relative}:host(:hover){--n-button-background-color:var(--n-color-button-hover);--n-button-border-color:var(--n-color-border-hover)}:host([disabled]){--n-button-background-color:var(--n-color-border);--n-button-box-shadow:none;--n-button-border-color:var(--n-button-background-color);--n-button-color:var(--n-color-text-weaker);opacity:.5;pointer-events:none}.n-button:focus{--n-button-border-color:var(--n-color-primary);--n-button-border-style:solid;--n-button-box-shadow:0 0 0 1px var(--n-button-border-color);outline:0}.n-button:active{opacity:.8;transform:translateY(1px);transition:none}:host([variant=primary]){--n-button-background-color:var(--n-color-primary);--n-button-border-color:transparent;--n-button-box-shadow:none;--n-button-color:var(--n-color-text-inverse);--n-button-font-weight:var(--n-font-weight-active)}:host([variant=primary]:hover){--n-button-background-color:var(--n-color-primary-strong)}:host([variant=dashed]){--n-button-color:var(--n-color-text-weaker);--n-button-border-color:var(--n-color-border-hover);--n-button-border-style:dashed;--n-button-box-shadow:none}:host([variant=dashed]:hover){--n-button-color:var(--n-color-text)}:host([variant=plain]){--n-button-border-color:transparent;--n-button-box-shadow:none}:host([variant=danger]){--n-button-border-color:var(--n-color-status-danger);--n-button-color:var(--n-color-text-error);--n-button-font-weight:var(--n-font-weight-active)}:host([size="s"]){--n-button-font-size:var(--n-font-size-s);--n-button-min-height:var(--n-space-l);--n-button-padding-y:calc(var(--n-space-s) / 1.5);--n-button-padding-x:var(--n-space-s);--n-button-gap:calc(var(--n-space-s) / 2)}:host([size="s"]) .n-button{line-height:var(--n-line-height-tight)}:host([size="l"]){--n-button-border-radius:var(--n-border-radius);--n-button-font-size:var(--n-font-size-l);--n-button-min-height:calc(var(--n-space-xxl) - var(--n-space-l));--n-button-padding-x:calc(var(--n-space-l) / 1.3);--n-button-font-weight:var(--n-font-weight-active)}::slotted(*){color:inherit;pointer-events:none}::slotted(svg){color:var(--n-color-icon)}::slotted(button[slot=proxy]){display:none}`;let u=class extends(c(d(o(a)))){constructor(){super(...arguments),this._proxyButton=document.createElement("button"),this.variant="default",this.type="submit",this.size="m",this.download=!1,this.target="_self",this.expand=!1}connectedCallback(){super.connectedCallback(),this.syncProxyButton()}disconnectedCallback(){super.disconnectedCallback(),this.cleanupProxyButton()}updated(){this.syncProxyButton()}render(){const t=n`<slot name="before"></slot><div class="n-content"><slot></slot></div><slot name="after"></slot>`;return this.href?n`<a ${l(this.focusableRef)} class="n-button" target="${this.target}" ?download="${this.download}" href="${this.href}">${t}</a>`:n`<slot name="proxy"></slot><button ${l(this.focusableRef)} class="n-button" ?disabled="${this.disabled}" name="${i(this.name)}" value="${i(this.value)}" @click="${this.handleClick}">${t}</button>`}handleClick(){this._proxyButton.click()}get isFormAssociated(){return!this.href&&this.form}syncProxyButton(){const t=this._proxyButton;t.slot="proxy",t.className="n-button-proxy",t.disabled=this.disabled,t.type=this.type,this.name?t.name=this.name:t.removeAttribute("name"),this.value?t.value=this.value:t.removeAttribute("value"),this.isFormAssociated?this.appendChild(t):this.cleanupProxyButton()}cleanupProxyButton(){this._proxyButton.remove()}};u.styles=b,r([s({reflect:!0})],u.prototype,"variant",void 0),r([s({reflect:!0})],u.prototype,"type",void 0),r([s({reflect:!0})],u.prototype,"size",void 0),r([s({reflect:!0})],u.prototype,"href",void 0),r([s({type:Boolean})],u.prototype,"download",void 0),r([s({reflect:!0})],u.prototype,"target",void 0),r([s({reflect:!0,type:Boolean})],u.prototype,"expand",void 0),u=r([e("nord-button")],u);var v=u;export{v as default}; | ||
//# sourceMappingURL=Button.js.map |
@@ -1,2 +0,2 @@ | ||
import{b as e,r as t,D as o,p as s,T as n,_ as i,n as r,s as a}from"./DraftComponentMixin-4bb26f5d.js";import{e as l}from"./property-03f59dce.js";import{I as d,t as c}from"./Icon-f6f1c764.js";import{e as p,i as h,t as m,l as u}from"./directive-40a31ee2.js";import{a as v,c as f,u as b,m as g,s as x,e as y,n as w}from"./ref-857246ae.js";import{o as k}from"./CommandMenuAction-879382c7.js";import{N as C}from"./events-731d0007.js";import{S as z,K as $}from"./KeyboardController-28c7135b.js";import"./VisuallyHidden.js";import{SelectEvent as E}from"./events.js";import"./unsafe-html-7028f0a1.js"; | ||
import{b as e,r as t,D as o,p as s,T as n,_ as i,n as r,s as a}from"./DraftComponentMixin-4bb26f5d.js";import{e as l}from"./property-03f59dce.js";import{I as d,t as c}from"./Icon-559d954d.js";import{e as p,i as h,t as m}from"./directive-e9ce14b4.js";import{a as u,c as v,u as f,m as b,s as g,e as x,n as y}from"./ref-65ef7607.js";import{o as w}from"./CommandMenuAction-b286bcbb.js";import{l as k}from"./if-defined-617ae549.js";import{N as C}from"./events-731d0007.js";import{S as z,K as $}from"./KeyboardController-28c7135b.js";import"./VisuallyHidden.js";import{SelectEvent as E}from"./events.js";import"./unsafe-html-21f62902.js"; | ||
/** | ||
@@ -6,3 +6,3 @@ * @license | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/const I=(e,t,o)=>{const s=new Map;for(let n=t;n<=o;n++)s.set(e[n],n);return s},j=p(class extends h{constructor(e){if(super(e),e.type!==m.CHILD)throw Error("repeat() can only be used in text expressions")}dt(e,t,o){let s;void 0===o?o=t:void 0!==t&&(s=t);const n=[],i=[];let r=0;for(const t of e)n[r]=s?s(t,r):r,i[r]=o(t,r),r++;return{values:i,keys:n}}render(e,t,o){return this.dt(e,t,o).values}update(t,[o,s,n]){var i;const r=v(t),{values:a,keys:l}=this.dt(o,s,n);if(!Array.isArray(r))return this.ct=l,a;const d=null!==(i=this.ct)&&void 0!==i?i:this.ct=[],c=[];let p,h,m=0,u=r.length-1,y=0,w=a.length-1;for(;m<=u&&y<=w;)if(null===r[m])m++;else if(null===r[u])u--;else if(d[m]===l[y])c[y]=f(r[m],a[y]),m++,y++;else if(d[u]===l[w])c[w]=f(r[u],a[w]),u--,w--;else if(d[m]===l[w])c[w]=f(r[m],a[w]),b(t,c[w+1],r[m]),m++,w--;else if(d[u]===l[y])c[y]=f(r[u],a[y]),b(t,r[m],r[u]),u--,y++;else if(void 0===p&&(p=I(l,y,w),h=I(d,m,u)),p.has(d[m]))if(p.has(d[u])){const e=h.get(l[y]),o=void 0!==e?r[e]:null;if(null===o){const e=b(t,r[m]);f(e,a[y]),c[y]=e}else c[y]=f(o,a[y]),b(t,r[m],o),r[e]=null;y++}else g(r[u]),u--;else g(r[m]),m++;for(;y<=w;){const e=b(t,c[w+1]);f(e,a[y]),c[y++]=e}for(;m<=u;){const e=r[m++];null!==e&&g(e)}return this.ct=l,x(t,c),e}});const L="keyboard-arrow-up-down";var _=Object.freeze({__proto__:null,default:'<svg viewBox="0 0 140 140" xmlns="http://www.w3.org/2000/svg"><path d="M105.833 24v93m0-93L80 49.833M105.833 24l25.834 25.833M34.167 117V24m0 93L60 91.167M34.167 117 8.333 91.167" fill="none" stroke="currentColor" stroke-width="14" stroke-linecap="round" stroke-linejoin="round"/></svg>',title:L,tags:"nordicon keyboard keys arrow up down shortcut"});var M=Object.freeze({__proto__:null,default:'<svg viewBox="0 0 140 140" xmlns="http://www.w3.org/2000/svg"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="14"><path d="M35 133 7 105l28-28"/><path d="M7 105h112a14 14 0 0 0 14-14V21a14 14 0 0 0-14-14H77"/></g></svg>',title:"keyboard-return",tags:"nordicon keyboard return key shortcut"});const O="keyboard-backspace";var R=Object.freeze({__proto__:null,default:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill="currentColor" fill-rule="evenodd" d="M6.707 4.879A3 3 0 0 1 8.828 4H15a3 3 0 0 1 3 3v6a3 3 0 0 1-3 3H8.828a3 3 0 0 1-2.12-.879l-4.415-4.414a1 1 0 0 1 0-1.414l4.414-4.414zm4 2.414a1 1 0 0 0-1.414 1.414L10.586 10l-1.293 1.293a1 1 0 1 0 1.414 1.414L12 11.414l1.293 1.293a1 1 0 0 0 1.414-1.414L13.414 10l1.293-1.293a1 1 0 0 0-1.414-1.414L12 8.586l-1.293-1.293z" clip-rule="evenodd"/></svg>',title:O,tags:"nordicon keyboard backspace back delete key shortcut"});function S(e,t,o){return e>o?t:e<t?o:e}function B(e){var t;return(null===(t=e.activeElement)||void 0===t?void 0:t.shadowRoot)?B(e.activeElement.shadowRoot):e.activeElement||void 0}class A{constructor(e,t){this.handleEsc=e=>{this.options.isOpen()&&this.options.onDismiss(e)},this.handleClickOut=e=>{if(!this.options.isOpen())return;const t=e.target;!this.host.contains(t)&&this.options.onDismiss(e)},this.host=e,e.addController(this),this.options=t,this.shortcut=new z(this.host,{Escape:this.handleEsc})}hostConnected(){document.addEventListener("click",this.handleClickOut,!0)}hostDisconnected(){document.removeEventListener("click",this.handleClickOut,!0)}}const D=t`:host{--n-command-menu-width:640px;--n-command-menu-top:16%;--n-command-menu-height:290px;all:initial;font-family:var(--n-font-family);line-height:var(--n-line-height);font-feature-settings:var(--n-font-features)}.n-modal{display:none;position:fixed;pointer-events:none;z-index:var(--n-index-modal);inset-inline-start:0;inset-block-start:0;inline-size:100%;block-size:100%;overflow:auto}.n-modal.n-visible{display:block}.n-modal-content{position:relative;pointer-events:all;inset-block-start:var(--n-command-menu-top);margin:auto;display:flex;flex-direction:column;min-inline-size:0;background:var(--n-color-surface);border-radius:var(--n-border-radius);box-shadow:var(--n-box-shadow-modal);max-inline-size:var(--n-command-menu-width);overflow:hidden}.n-bump{animation:zoom-in-zoom-out var(--n-transition-slowly)}@keyframes zoom-in-zoom-out{0%{transform:translateY(-10px) scale(.97);opacity:0}100%{transform:translateY(0) scale(1.0001);opacity:1}}.n-modal-footer{display:flex;gap:var(--n-space-s);padding:var(--n-space-s) var(--n-space-m);font-size:calc(var(--n-font-size-s) - 1px);color:var(--n-color-text-weaker)}.n-help{display:flex;align-items:center;gap:2px}.n-help+.n-help{padding-inline-start:var(--n-space-s);border-inline-start:1px solid var(--n-color-border-strong)}.n-help nord-icon{--n-icon-size:10px;color:currentColor;padding:3px 4px}.n-help.n-backspace nord-icon{--n-icon-size:12px}.n-search-wrapper{display:flex;border-block-end:1px solid var(--n-color-border)}[role=combobox]{flex:1;font-size:var(--n-font-size-l);font-weight:var(--n-font-weight);font-family:inherit;background:0 0;color:var(--n-color-text);border:none;border-radius:0;appearance:none;outline:0;margin:0;padding:var(--n-space-m)}[role=combobox]::-webkit-input-placeholder{color:var(--n-color-text-weaker);opacity:.6!important}[role=combobox]::-moz-placeholder{color:var(--n-color-text-weaker);opacity:.6!important}[role=combobox]:-ms-input-placeholder{color:var(--n-color-text-weaker);opacity:.6!important}[role=listbox]{max-block-size:var(--n-command-menu-height);overflow:auto;margin:0;padding:0}.n-group-header{line-height:var(--n-line-height);border-block-end:1px solid var(--n-color-border);padding:calc(var(--n-space-s)/ 1.4) var(--n-space-m);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;font-size:var(--n-font-size-s);background:var(--n-color-surface-raised);font-weight:var(--n-font-weight-active);color:var(--n-color-text-weaker)}.n-command-empty{display:flex;flex:1;flex-direction:column;border-inline-start:2px solid transparent;align-items:flex-start;color:var(--n-color-text);border-block-end:1px solid var(--n-color-border);padding:calc(var(--n-space-m)/ 1.5) var(--n-space-m)}.n-command-empty .n-title{flex:1;margin-block-start:var(--n-space-s);margin-inline-end:calc(var(--n-space-s)/ 2);max-inline-size:100%;font-size:var(--n-font-size-m);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.n-command-empty .n-tip{flex:1;margin-block-start:var(--n-space-s);margin-block-end:var(--n-space-m);font-size:var(--n-font-size-s);color:var(--n-color-text-weaker)}`;d.registerIcon(_),d.registerIcon(M),d.registerIcon(R);let H=class extends(o(a)){constructor(){super(...arguments),this.inputRef=y(),this.listRef=y(),this.dismissController=new A(this,{isOpen:()=>this.open,onDismiss:()=>this.close()}),this.keyboardController=new $(this,{trigger:()=>this.select(),goBack:()=>this.goBack(),end:()=>this.end(),start:()=>this.start(),next:()=>this.next(),previous:()=>this.previous(),toggleOpen:()=>this.toggleOpen()}),this.open=!1,this.placeholder="Type a command or search...",this.commands=[],this.search="",this.bump=!0,this.selectedIndex=0,this.filteredCommands=[]}get selected(){return this.filteredCommands[this.selectedIndex]}show(e={}){this.open=!0,this.setParent(e.parent),this.dispatchEvent(new C("open"))}close(){var e;this.open=!1,null===(e=this.previousFocus)||void 0===e||e.focus(),this.previousFocus=void 0,this.dispatchEvent(new C("close"))}toggleOpen(){this.open?this.close():this.show()}focus(){var e;null===(e=this.inputRef.value)||void 0===e||e.focus()}willUpdate(e){e.has("commands")&&this.keyboardController.registerCommandShortcuts(),e.has("open")&&this.open&&(this.bump=!0),(e.has("search")||e.has("parent")||e.has("commands"))&&this.filterCommands()}updated(e){e.has("open")&&this.open&&(this.previousFocus=B(document),this.focus(),this.listRef.value&&(this.listRef.value.scrollTop=0))}render(){var e;const t=function(e,t){var o;const s=new Map;for(const n of e){const e=n[t],i=null!==(o=s.get(e))&&void 0!==o?o:[];s.has(e)||s.set(e,[]),i.push(n),s.set(e,i)}return s}(this.filteredCommands,"section"),o=0===this.filteredCommands.length?"no-results":null===(e=this.selected)||void 0===e?void 0:e.id;return s`<div class="${k({"n-visible":this.open,"n-modal":!0})}"><div @animationend="${this.handleAnimationEnd}" class="${k({"n-bump":this.bump,"n-modal-content":!0})}"><div class="n-search-wrapper"><nord-visually-hidden id="instructions">Press 'Enter' to confirm your input or 'Escape' to cancel</nord-visually-hidden><input type="text" id="search" @input="${this.handleInput}" @blur="${this.handleBlur}" ${w(this.inputRef)} placeholder="${this.placeholder}" .value="${this.search}" spellcheck="false" autocomplete="off" autocapitalize="off" aria-label="Type the name of a command to run." aria-autocomplete="list" aria-haspopup="listbox" role="combobox" aria-controls="list" aria-expanded="true" aria-activedescendant="${u(o)}" aria-describedby="instructions"></div><div class="n-modal-body"><div id="list" ${w(this.listRef)} role="listbox">${0===this.filteredCommands.length?this.renderNoResults():Array.from(t,(([e,t])=>this.renderSection(e,t)))}</div></div><slot name="footer"><div class="n-modal-footer" slot="footer"><span class="n-help"><nord-icon label="Arrow keys" name="${L}"></nord-icon>Navigate</span> <span class="n-help"><nord-icon label="Enter key" name="${"keyboard-return"}"></nord-icon>Select</span> <span class="n-help">Esc to dismiss</span> <span class="n-help n-backspace"><nord-icon label="Backspace key" name="${O}"></nord-icon>Move to parent</span></div></slot></div></div>`}renderNoResults(){return s`<div id="no-results" class="n-command-empty" role="option" aria-selected="true"><div class="n-title">No results for “${this.search}”</div><div class="n-tip">Search tips: some search terms require exact match. Try typing the entire command name, or use a different word or phrase.</div></div>`}renderSection(e,t){const o=`section-${e}`;return s`<div role="group" aria-labelledby="${u(e?o:void 0)}">${e?s`<div class="n-group-header" role="presentation" id="${u(o)}">${e}</div>`:n} ${j(t,(e=>e.id),(e=>{var t,o;return s`<nord-command-menu-action id="${e.id}" .command="${e}" ?selected="${e.id===(null===(t=this.selected)||void 0===t?void 0:t.id)}" @click="${()=>this.select(e)}" role="option" aria-selected="${u(e.id===(null===(o=this.selected)||void 0===o?void 0:o.id)||void 0)}"></nord-command-menu-action>`}))}</div>`}handleAnimationEnd(){this.bump=!1}handleBlur(){this.open&&this.focus()}handleInput(e){const t=e.target;this.setSearch(t.value)}select(e=this.selected){var t;this.commands.some((t=>t.parent===e.id))?(this.setParent(e.id),this.bump=!0,this.focus()):this.close(),this.setSearch(""),null===(t=e.handler)||void 0===t||t.call(e,this);const o=new E(e);this.dispatchEvent(o)}start(){this.selectedIndex=0}end(){this.selectedIndex=this.filteredCommands.length-1}next(){this.selectedIndex=S(this.selectedIndex+1,0,this.filteredCommands.length-1)}previous(){this.selectedIndex=S(this.selectedIndex-1,0,this.filteredCommands.length-1)}goBack(){if(!this.search&&this.parent){const e=this.commands.find((e=>e.id===this.parent));this.setParent(null==e?void 0:e.parent)}}setParent(e){this.parent=e,this.setSearch("")}setSearch(e){this.search=e,this.selectedIndex=0}filterCommands(){const e=this.search.toLocaleLowerCase().split(/\s+/);this.filteredCommands=this.commands.filter((({title:t,keywords:o="",parent:s})=>{const n=`${t} ${o}`.toLocaleLowerCase(),i=e.every((e=>n.includes(e)));return(!this.parent&&this.search||s===this.parent)&&i}))}};H.styles=D,i([l({type:Boolean})],H.prototype,"open",void 0),i([l({type:String})],H.prototype,"placeholder",void 0),i([l({type:Array,attribute:!1})],H.prototype,"commands",void 0),i([c()],H.prototype,"parent",void 0),i([c()],H.prototype,"search",void 0),i([c()],H.prototype,"bump",void 0),i([c()],H.prototype,"selectedIndex",void 0),i([c()],H.prototype,"filteredCommands",void 0),H=i([r("nord-command-menu")],H);var N=H;export{N as default}; | ||
*/const I=(e,t,o)=>{const s=new Map;for(let n=t;n<=o;n++)s.set(e[n],n);return s},j=p(class extends h{constructor(e){if(super(e),e.type!==m.CHILD)throw Error("repeat() can only be used in text expressions")}dt(e,t,o){let s;void 0===o?o=t:void 0!==t&&(s=t);const n=[],i=[];let r=0;for(const t of e)n[r]=s?s(t,r):r,i[r]=o(t,r),r++;return{values:i,keys:n}}render(e,t,o){return this.dt(e,t,o).values}update(t,[o,s,n]){var i;const r=u(t),{values:a,keys:l}=this.dt(o,s,n);if(!Array.isArray(r))return this.ct=l,a;const d=null!==(i=this.ct)&&void 0!==i?i:this.ct=[],c=[];let p,h,m=0,x=r.length-1,y=0,w=a.length-1;for(;m<=x&&y<=w;)if(null===r[m])m++;else if(null===r[x])x--;else if(d[m]===l[y])c[y]=v(r[m],a[y]),m++,y++;else if(d[x]===l[w])c[w]=v(r[x],a[w]),x--,w--;else if(d[m]===l[w])c[w]=v(r[m],a[w]),f(t,c[w+1],r[m]),m++,w--;else if(d[x]===l[y])c[y]=v(r[x],a[y]),f(t,r[m],r[x]),x--,y++;else if(void 0===p&&(p=I(l,y,w),h=I(d,m,x)),p.has(d[m]))if(p.has(d[x])){const e=h.get(l[y]),o=void 0!==e?r[e]:null;if(null===o){const e=f(t,r[m]);v(e,a[y]),c[y]=e}else c[y]=v(o,a[y]),f(t,r[m],o),r[e]=null;y++}else b(r[x]),x--;else b(r[m]),m++;for(;y<=w;){const e=f(t,c[w+1]);v(e,a[y]),c[y++]=e}for(;m<=x;){const e=r[m++];null!==e&&b(e)}return this.ct=l,g(t,c),e}});const L="keyboard-arrow-up-down";var _=Object.freeze({__proto__:null,default:'<svg viewBox="0 0 140 140" xmlns="http://www.w3.org/2000/svg"><path d="M105.833 24v93m0-93L80 49.833M105.833 24l25.834 25.833M34.167 117V24m0 93L60 91.167M34.167 117 8.333 91.167" fill="none" stroke="currentColor" stroke-width="14" stroke-linecap="round" stroke-linejoin="round"/></svg>',title:L,tags:"nordicon keyboard keys arrow up down shortcut"});var M=Object.freeze({__proto__:null,default:'<svg viewBox="0 0 140 140" xmlns="http://www.w3.org/2000/svg"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="14"><path d="M35 133 7 105l28-28"/><path d="M7 105h112a14 14 0 0 0 14-14V21a14 14 0 0 0-14-14H77"/></g></svg>',title:"keyboard-return",tags:"nordicon keyboard return key shortcut"});const O="keyboard-backspace";var R=Object.freeze({__proto__:null,default:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill="currentColor" fill-rule="evenodd" d="M6.707 4.879A3 3 0 0 1 8.828 4H15a3 3 0 0 1 3 3v6a3 3 0 0 1-3 3H8.828a3 3 0 0 1-2.12-.879l-4.415-4.414a1 1 0 0 1 0-1.414l4.414-4.414zm4 2.414a1 1 0 0 0-1.414 1.414L10.586 10l-1.293 1.293a1 1 0 1 0 1.414 1.414L12 11.414l1.293 1.293a1 1 0 0 0 1.414-1.414L13.414 10l1.293-1.293a1 1 0 0 0-1.414-1.414L12 8.586l-1.293-1.293z" clip-rule="evenodd"/></svg>',title:O,tags:"nordicon keyboard backspace back delete key shortcut"});function S(e,t,o){return e>o?t:e<t?o:e}function B(e){var t;return(null===(t=e.activeElement)||void 0===t?void 0:t.shadowRoot)?B(e.activeElement.shadowRoot):e.activeElement||void 0}class A{constructor(e,t){this.handleEsc=e=>{this.options.isOpen()&&this.options.onDismiss(e)},this.handleClickOut=e=>{if(!this.options.isOpen())return;const t=e.target;!this.host.contains(t)&&this.options.onDismiss(e)},this.host=e,e.addController(this),this.options=t,this.shortcut=new z(this.host,{Escape:this.handleEsc})}hostConnected(){document.addEventListener("click",this.handleClickOut,!0)}hostDisconnected(){document.removeEventListener("click",this.handleClickOut,!0)}}const D=t`:host{--n-command-menu-width:640px;--n-command-menu-top:16%;--n-command-menu-height:290px;all:initial;font-family:var(--n-font-family);line-height:var(--n-line-height);font-feature-settings:var(--n-font-features)}.n-modal{display:none;position:fixed;pointer-events:none;z-index:var(--n-index-modal);inset-inline-start:0;inset-block-start:0;inline-size:100%;block-size:100%;overflow:auto}.n-modal.n-visible{display:block}.n-modal-content{position:relative;pointer-events:all;inset-block-start:var(--n-command-menu-top);margin:auto;display:flex;flex-direction:column;min-inline-size:0;background:var(--n-color-surface);border-radius:var(--n-border-radius);box-shadow:var(--n-box-shadow-modal);max-inline-size:var(--n-command-menu-width);overflow:hidden}.n-bump{animation:zoom-in-zoom-out var(--n-transition-slowly)}@keyframes zoom-in-zoom-out{0%{transform:translateY(-10px) scale(.97);opacity:0}100%{transform:translateY(0) scale(1.0001);opacity:1}}.n-modal-footer{display:flex;gap:var(--n-space-s);padding:var(--n-space-s) var(--n-space-m);font-size:calc(var(--n-font-size-s) - 1px);color:var(--n-color-text-weaker)}.n-help{display:flex;align-items:center;gap:2px}.n-help+.n-help{padding-inline-start:var(--n-space-s);border-inline-start:1px solid var(--n-color-border-strong)}.n-help nord-icon{--n-icon-size:10px;color:currentColor;padding:3px 4px}.n-help.n-backspace nord-icon{--n-icon-size:12px}.n-search-wrapper{display:flex;border-block-end:1px solid var(--n-color-border)}[role=combobox]{flex:1;font-size:var(--n-font-size-l);font-weight:var(--n-font-weight);font-family:inherit;background:0 0;color:var(--n-color-text);border:none;border-radius:0;appearance:none;outline:0;margin:0;padding:var(--n-space-m)}[role=combobox]::-webkit-input-placeholder{color:var(--n-color-text-weaker);opacity:.6!important}[role=combobox]::-moz-placeholder{color:var(--n-color-text-weaker);opacity:.6!important}[role=combobox]:-ms-input-placeholder{color:var(--n-color-text-weaker);opacity:.6!important}[role=listbox]{max-block-size:var(--n-command-menu-height);overflow:auto;margin:0;padding:0}.n-group-header{line-height:var(--n-line-height);border-block-end:1px solid var(--n-color-border);padding:calc(var(--n-space-s)/ 1.4) var(--n-space-m);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;font-size:var(--n-font-size-s);background:var(--n-color-surface-raised);font-weight:var(--n-font-weight-active);color:var(--n-color-text-weaker)}.n-command-empty{display:flex;flex:1;flex-direction:column;border-inline-start:2px solid transparent;align-items:flex-start;color:var(--n-color-text);border-block-end:1px solid var(--n-color-border);padding:calc(var(--n-space-m)/ 1.5) var(--n-space-m)}.n-command-empty .n-title{flex:1;margin-block-start:var(--n-space-s);margin-inline-end:calc(var(--n-space-s)/ 2);max-inline-size:100%;font-size:var(--n-font-size-m);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.n-command-empty .n-tip{flex:1;margin-block-start:var(--n-space-s);margin-block-end:var(--n-space-m);font-size:var(--n-font-size-s);color:var(--n-color-text-weaker)}`;d.registerIcon(_),d.registerIcon(M),d.registerIcon(R);let H=class extends(o(a)){constructor(){super(...arguments),this.inputRef=x(),this.listRef=x(),this.dismissController=new A(this,{isOpen:()=>this.open,onDismiss:()=>this.close()}),this.keyboardController=new $(this,{trigger:()=>this.select(),goBack:()=>this.goBack(),end:()=>this.end(),start:()=>this.start(),next:()=>this.next(),previous:()=>this.previous(),toggleOpen:()=>this.toggleOpen()}),this.open=!1,this.placeholder="Type a command or search...",this.commands=[],this.search="",this.bump=!0,this.selectedIndex=0,this.filteredCommands=[]}get selected(){return this.filteredCommands[this.selectedIndex]}show(e={}){this.open=!0,this.setParent(e.parent),this.dispatchEvent(new C("open"))}close(){var e;this.open=!1,null===(e=this.previousFocus)||void 0===e||e.focus(),this.previousFocus=void 0,this.dispatchEvent(new C("close"))}toggleOpen(){this.open?this.close():this.show()}focus(){var e;null===(e=this.inputRef.value)||void 0===e||e.focus()}willUpdate(e){e.has("commands")&&this.keyboardController.registerCommandShortcuts(),e.has("open")&&this.open&&(this.bump=!0),(e.has("search")||e.has("parent")||e.has("commands"))&&this.filterCommands()}updated(e){e.has("open")&&this.open&&(this.previousFocus=B(document),this.focus(),this.listRef.value&&(this.listRef.value.scrollTop=0))}render(){var e;const t=function(e,t){var o;const s=new Map;for(const n of e){const e=n[t],i=null!==(o=s.get(e))&&void 0!==o?o:[];s.has(e)||s.set(e,[]),i.push(n),s.set(e,i)}return s}(this.filteredCommands,"section"),o=0===this.filteredCommands.length?"no-results":null===(e=this.selected)||void 0===e?void 0:e.id;return s`<div class="${w({"n-visible":this.open,"n-modal":!0})}"><div @animationend="${this.handleAnimationEnd}" class="${w({"n-bump":this.bump,"n-modal-content":!0})}"><div class="n-search-wrapper"><nord-visually-hidden id="instructions">Press 'Enter' to confirm your input or 'Escape' to cancel</nord-visually-hidden><input type="text" id="search" @input="${this.handleInput}" @blur="${this.handleBlur}" ${y(this.inputRef)} placeholder="${this.placeholder}" .value="${this.search}" spellcheck="false" autocomplete="off" autocapitalize="off" aria-label="Type the name of a command to run." aria-autocomplete="list" aria-haspopup="listbox" role="combobox" aria-controls="list" aria-expanded="true" aria-activedescendant="${k(o)}" aria-describedby="instructions"></div><div class="n-modal-body"><div id="list" ${y(this.listRef)} role="listbox">${0===this.filteredCommands.length?this.renderNoResults():Array.from(t,(([e,t])=>this.renderSection(e,t)))}</div></div><slot name="footer"><div class="n-modal-footer" slot="footer"><span class="n-help"><nord-icon label="Arrow keys" name="${L}"></nord-icon>Navigate</span> <span class="n-help"><nord-icon label="Enter key" name="${"keyboard-return"}"></nord-icon>Select</span> <span class="n-help">Esc to dismiss</span> <span class="n-help n-backspace"><nord-icon label="Backspace key" name="${O}"></nord-icon>Move to parent</span></div></slot></div></div>`}renderNoResults(){return s`<div id="no-results" class="n-command-empty" role="option" aria-selected="true"><div class="n-title">No results for “${this.search}”</div><div class="n-tip">Search tips: some search terms require exact match. Try typing the entire command name, or use a different word or phrase.</div></div>`}renderSection(e,t){const o=`section-${e}`;return s`<div role="group" aria-labelledby="${k(e?o:void 0)}">${e?s`<div class="n-group-header" role="presentation" id="${k(o)}">${e}</div>`:n} ${j(t,(e=>e.id),(e=>{var t,o;return s`<nord-command-menu-action id="${e.id}" .command="${e}" ?selected="${e.id===(null===(t=this.selected)||void 0===t?void 0:t.id)}" @click="${()=>this.select(e)}" role="option" aria-selected="${k(e.id===(null===(o=this.selected)||void 0===o?void 0:o.id)||void 0)}"></nord-command-menu-action>`}))}</div>`}handleAnimationEnd(){this.bump=!1}handleBlur(){this.open&&this.focus()}handleInput(e){const t=e.target;this.setSearch(t.value)}select(e=this.selected){var t;this.commands.some((t=>t.parent===e.id))?(this.setParent(e.id),this.bump=!0,this.focus()):this.close(),this.setSearch(""),null===(t=e.handler)||void 0===t||t.call(e,this);const o=new E(e);this.dispatchEvent(o)}start(){this.selectedIndex=0}end(){this.selectedIndex=this.filteredCommands.length-1}next(){this.selectedIndex=S(this.selectedIndex+1,0,this.filteredCommands.length-1)}previous(){this.selectedIndex=S(this.selectedIndex-1,0,this.filteredCommands.length-1)}goBack(){if(!this.search&&this.parent){const e=this.commands.find((e=>e.id===this.parent));this.setParent(null==e?void 0:e.parent)}}setParent(e){this.parent=e,this.setSearch("")}setSearch(e){this.search=e,this.selectedIndex=0}filterCommands(){const e=this.search.toLocaleLowerCase().split(/\s+/);this.filteredCommands=this.commands.filter((({title:t,keywords:o="",parent:s})=>{const n=`${t} ${o}`.toLocaleLowerCase(),i=e.every((e=>n.includes(e)));return(!this.parent&&this.search||s===this.parent)&&i}))}};H.styles=D,i([l({type:Boolean})],H.prototype,"open",void 0),i([l({type:String})],H.prototype,"placeholder",void 0),i([l({type:Array,attribute:!1})],H.prototype,"commands",void 0),i([c()],H.prototype,"parent",void 0),i([c()],H.prototype,"search",void 0),i([c()],H.prototype,"bump",void 0),i([c()],H.prototype,"selectedIndex",void 0),i([c()],H.prototype,"filteredCommands",void 0),H=i([r("nord-command-menu")],H);var N=H;export{N as default}; | ||
//# sourceMappingURL=CommandMenu.js.map |
@@ -1,2 +0,2 @@ | ||
import"./DraftComponentMixin-4bb26f5d.js";import"./property-03f59dce.js";export{C as default}from"./CommandMenuAction-879382c7.js";import"./Icon-f6f1c764.js";import"./VisuallyHidden.js";import"./directive-40a31ee2.js";import"./unsafe-html-7028f0a1.js"; | ||
import"./DraftComponentMixin-4bb26f5d.js";import"./property-03f59dce.js";export{C as default}from"./CommandMenuAction-b286bcbb.js";import"./Icon-559d954d.js";import"./VisuallyHidden.js";import"./directive-e9ce14b4.js";import"./if-defined-617ae549.js";import"./unsafe-html-21f62902.js"; | ||
//# sourceMappingURL=CommandMenuAction.js.map |
@@ -1,2 +0,2 @@ | ||
import"./DraftComponentMixin-4bb26f5d.js";import"./property-03f59dce.js";export{I as default}from"./Icon-f6f1c764.js";import"./directive-40a31ee2.js";import"./unsafe-html-7028f0a1.js"; | ||
import"./DraftComponentMixin-4bb26f5d.js";import"./property-03f59dce.js";export{I as default}from"./Icon-559d954d.js";import"./if-defined-617ae549.js";import"./unsafe-html-21f62902.js";import"./directive-e9ce14b4.js"; | ||
//# sourceMappingURL=Icon.js.map |
@@ -1,2 +0,2 @@ | ||
export{default as Badge}from"./Badge.js";export{default as Button}from"./Button.js";export{default as Card}from"./Card.js";export{default as Input}from"./Input.js";export{I as Icon}from"./Icon-f6f1c764.js";export{default as CommandMenu}from"./CommandMenu.js";export{C as CommandMenuAction}from"./CommandMenuAction-879382c7.js";export{default as Select}from"./Select.js";export{default as Stack}from"./Stack.js";export{default as Table}from"./Table.js";export{default as VisuallyHidden}from"./VisuallyHidden.js";export{default as Textarea}from"./Textarea.js";import"./DraftComponentMixin-4bb26f5d.js";import"./property-03f59dce.js";import"./directive-40a31ee2.js";import"./ref-857246ae.js";import"./InputMixin-3e737480.js";import"./SlotController-fda28afb.js";import"./unsafe-html-7028f0a1.js";import"./FormField-02dd3b4f.js";import"./events-731d0007.js";import"./TextField-bfdc253c.js";import"./KeyboardController-28c7135b.js";import"./events.js"; | ||
export{default as Badge}from"./Badge.js";export{default as Button}from"./Button.js";export{default as Card}from"./Card.js";export{default as Input}from"./Input.js";export{I as Icon}from"./Icon-559d954d.js";export{default as CommandMenu}from"./CommandMenu.js";export{C as CommandMenuAction}from"./CommandMenuAction-b286bcbb.js";export{default as Select}from"./Select.js";export{default as Stack}from"./Stack.js";export{default as Spinner}from"./Spinner.js";export{default as Table}from"./Table.js";export{default as VisuallyHidden}from"./VisuallyHidden.js";export{default as Textarea}from"./Textarea.js";import"./DraftComponentMixin-4bb26f5d.js";import"./property-03f59dce.js";import"./if-defined-617ae549.js";import"./ref-65ef7607.js";import"./directive-e9ce14b4.js";import"./InputMixin-6c108de4.js";import"./SlotController-fda28afb.js";import"./unsafe-html-21f62902.js";import"./FormField-02dd3b4f.js";import"./events-731d0007.js";import"./TextField-bfdc253c.js";import"./KeyboardController-28c7135b.js";import"./events.js"; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import{r as e,D as t,T as s,p as i,_ as r,n,s as o}from"./DraftComponentMixin-4bb26f5d.js";import{e as a}from"./property-03f59dce.js";import{l}from"./directive-40a31ee2.js";import{n as p}from"./ref-857246ae.js";import{o as d}from"./unsafe-html-7028f0a1.js";import{I as c,F as m}from"./InputMixin-3e737480.js";import{F as h,s as u}from"./FormField-02dd3b4f.js";import"./VisuallyHidden.js";import{s as f}from"./TextField-bfdc253c.js";import"./SlotController-fda28afb.js";import"./events-731d0007.js";const v=e`.n-input::-webkit-search-cancel-button,.n-input::-webkit-search-decoration{-webkit-appearance:none;appearance:none}slot[name=before]{display:flex;align-items:center;position:absolute;margin-inline-start:var(--n-space-m);block-size:100%;pointer-events:none;color:var(--n-color-icon)}slot[name=before]+.n-input{padding-inline-start:var(--n-space-xl)}::slotted(svg),svg{block-size:var(--n-size-icon-s);inline-size:var(--n-size-icon-s)}`;let b=class extends(h(c(m(t(o))))){constructor(){super(...arguments),this.type="text"}render(){var e;const t="search"===this.type||this.slots.hasSlottedContent("before"),r="number"===this.type,n="search"===this.type?d('<svg viewBox="0 0 140 140" xmlns="http://www.w3.org/2000/svg"><path d="M7 59.5a52.5 52.5 0 1 0 105 0 52.5 52.5 0 1 0-105 0zM133 133 96.628 96.628" stroke-width="14" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/></svg>'):s;return i`${this.renderLabel()}<div class="n-input-container">${t?i`<slot name="before">${n}</slot>`:s} <input ${p(this.focusableRef)} id="${this.inputId}" class="n-input" type="${r?"text":this.type}" inputmode="${l(r?"numeric":void 0)}" pattern="${l(r?"[0-9]*":void 0)}" ?disabled="${this.disabled}" ?required="${this.required}" name="${l(this.name)}" .value="${null!==(e=this.value)&&void 0!==e?e:""}" placeholder="${l(this.placeholder)}" @change="${this.handleChange}" aria-describedby="${l(this.getDescribedBy())}" aria-invalid="${l(this.getInvalid())}" spellcheck="false"></div>${this.renderError()}`}};b.styles=[u,f,v],r([a()],b.prototype,"type",void 0),b=r([n("nord-input")],b);var $=b;export{$ as default}; | ||
import{r as e,D as t,T as i,p as s,_ as r,n,s as o}from"./DraftComponentMixin-4bb26f5d.js";import{e as a}from"./property-03f59dce.js";import{l}from"./if-defined-617ae549.js";import{n as d}from"./ref-65ef7607.js";import{o as p}from"./unsafe-html-21f62902.js";import{I as c,F as m}from"./InputMixin-6c108de4.js";import{F as h,s as f}from"./FormField-02dd3b4f.js";import"./VisuallyHidden.js";import{s as u}from"./TextField-bfdc253c.js";import"./directive-e9ce14b4.js";import"./SlotController-fda28afb.js";import"./events-731d0007.js";const v=e`.n-input::-webkit-search-cancel-button,.n-input::-webkit-search-decoration{-webkit-appearance:none;appearance:none}slot[name=before]{display:flex;align-items:center;position:absolute;margin-inline-start:var(--n-space-m);block-size:100%;pointer-events:none;color:var(--n-color-icon)}slot[name=before]+.n-input{padding-inline-start:var(--n-space-xl)}::slotted(svg),svg{block-size:var(--n-size-icon-s);inline-size:var(--n-size-icon-s)}`;let b=class extends(h(c(m(t(o))))){constructor(){super(...arguments),this.type="text"}render(){var e;const t="search"===this.type||this.slots.hasSlottedContent("before"),r="number"===this.type,n="search"===this.type?p('<svg viewBox="0 0 140 140" xmlns="http://www.w3.org/2000/svg"><path d="M7 59.5a52.5 52.5 0 1 0 105 0 52.5 52.5 0 1 0-105 0zM133 133 96.628 96.628" stroke-width="14" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/></svg>'):i;return s`${this.renderLabel()}<div class="n-input-container">${t?s`<slot name="before">${n}</slot>`:i} <input ${d(this.focusableRef)} id="${this.inputId}" class="n-input" type="${r?"text":this.type}" inputmode="${l(r?"numeric":void 0)}" pattern="${l(r?"[0-9]*":void 0)}" ?disabled="${this.disabled}" ?required="${this.required}" name="${l(this.name)}" .value="${null!==(e=this.value)&&void 0!==e?e:""}" placeholder="${l(this.placeholder)}" @change="${this.handleChange}" aria-describedby="${l(this.getDescribedBy())}" aria-invalid="${l(this.getInvalid())}" spellcheck="false"></div>${this.renderError()}`}};b.styles=[f,u,v],r([a()],b.prototype,"type",void 0),b=r([n("nord-input")],b);var $=b;export{$ as default}; | ||
//# sourceMappingURL=Input.js.map |
@@ -1,2 +0,2 @@ | ||
import{r as e,D as t,p as o,_ as n,n as r,s as i}from"./DraftComponentMixin-4bb26f5d.js";import{l as s}from"./directive-40a31ee2.js";import{n as a}from"./ref-857246ae.js";import{o as l}from"./unsafe-html-7028f0a1.js";import"./Button.js";import"./VisuallyHidden.js";import{I as d,F as c}from"./InputMixin-3e737480.js";import{F as p,s as u}from"./FormField-02dd3b4f.js";import"./property-03f59dce.js";import"./SlotController-fda28afb.js";import"./events-731d0007.js";const b=e`.n-select-container{position:relative;inline-size:fit-content}:host([expand]) .n-select-container{inline-size:100%}select{-webkit-appearance:none;appearance:none;position:absolute;font-size:var(--n-font-size-m);font-family:var(--n-font-family);color:var(--n-color-text);inline-size:100%;opacity:.0001;cursor:pointer;background:0 0;border:0;block-size:var(--n-space-xl);inset-block-end:0;inset-inline-start:0;z-index:2}nord-button{--n-button-text-align:start}.n-label-container:hover+.n-select-container nord-button,select:hover+nord-button{--n-button-background-color:var(--n-color-button-hover);--n-button-border-color:var(--n-color-border-hover)}.n-label-container:hover+.n-select-container nord-button svg,select:hover+nord-button svg{color:var(--n-color-icon-hover)}select:focus+nord-button{--n-button-border-color:var(--n-color-primary);--n-button-box-shadow:0 0 0 1px var(--n-button-border-color)}:host([disabled]){cursor:auto;pointer-events:none}::slotted(:not([slot])){display:none}[slot=after] svg{color:var(--n-color-icon);margin-inline-start:var(--n-space-m);margin-inline-end:calc(var(--n-space-s)/ -2);min-inline-size:calc(var(--n-space-l)/ 2.2)}::slotted([slot=before]){margin-inline-start:calc(var(--n-space-s) * -1);margin-inline-end:var(--n-space-s)}select[aria-invalid=true]+nord-button{--n-button-border-color:var(--n-color-status-danger)}`;let v=class extends(p(d(c(t(i))))){constructor(){super(...arguments),this.inputId="select"}render(){const e=this.options,t=this.getButtonText(e);return o`<slot></slot>${this.renderLabel()}<div class="n-select-container"><select ${a(this.focusableRef)} id="${this.inputId}" ?disabled="${this.disabled}" ?required="${this.required}" name="${s(this.name)}" @change="${this.handleChange}" aria-describedby="${s(this.getDescribedBy())}" aria-invalid="${s(this.getInvalid())}">${this.placeholder&&o`<option value="" disabled="disabled" ?selected="${!this.value}">${this.placeholder}</option>`} ${e.map((e=>this.renderOption(e)))}</select><nord-button tabindex="-1" ?disabled="${this.disabled}" ?expand="${this.expand}" aria-hidden="true" type="button"><slot slot="before" name="before"></slot>${t}<div slot="after">${l('<svg viewBox="0 0 140 140" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M105 56a10.416 10.416 0 0 1-7.42-3.08L72.478 27.818a3.528 3.528 0 0 0-4.956 0L42.42 52.92a10.5 10.5 0 0 1-14.84-14.84l35-35a10.486 10.486 0 0 1 14.84 0l35 35A10.5 10.5 0 0 1 105 56zm-35 84a10.416 10.416 0 0 1-7.42-3.08l-35-35a10.5 10.5 0 0 1 14.84-14.84l25.102 25.102a3.528 3.528 0 0 0 4.956 0L97.58 87.08a10.5 10.5 0 1 1 14.84 14.84l-35 35A10.416 10.416 0 0 1 70 140z"/></svg>')}</div></nord-button></div>${this.renderError()}`}get options(){return Array.from(this.querySelectorAll("option"))}getButtonText(e){const t=e.find((e=>e.value===this.value));return t?t.text:this.placeholder?this.placeholder:e[0]?e[0].text:""}renderOption(e){return o`<option value="${s(e.value)}" ?disabled="${e.disabled}" ?selected="${e.value===this.value}">${e.text}</option>`}};v.styles=[u,b],v=n([r("nord-select")],v);var h=v;export{h as default}; | ||
import{r as e,D as t,p as o,_ as n,n as r,s as i}from"./DraftComponentMixin-4bb26f5d.js";import{l as s}from"./if-defined-617ae549.js";import{n as a}from"./ref-65ef7607.js";import{o as l}from"./unsafe-html-21f62902.js";import"./Button.js";import"./VisuallyHidden.js";import{I as d,F as c}from"./InputMixin-6c108de4.js";import{F as p,s as b}from"./FormField-02dd3b4f.js";import"./directive-e9ce14b4.js";import"./property-03f59dce.js";import"./SlotController-fda28afb.js";import"./events-731d0007.js";const u=e`.n-select-container{position:relative;inline-size:fit-content}:host([expand]) .n-select-container{inline-size:100%}select{-webkit-appearance:none;appearance:none;position:absolute;font-size:var(--n-font-size-m);font-family:var(--n-font-family);color:var(--n-color-text);inline-size:100%;opacity:.0001;cursor:pointer;background:0 0;border:0;block-size:var(--n-space-xl);inset-block-end:0;inset-inline-start:0;z-index:2}nord-button{--n-button-text-align:start}.n-label-container:hover+.n-select-container nord-button,select:hover+nord-button{--n-button-background-color:var(--n-color-button-hover);--n-button-border-color:var(--n-color-border-hover)}.n-label-container:hover+.n-select-container nord-button svg,select:hover+nord-button svg{color:var(--n-color-icon-hover)}select:focus+nord-button{--n-button-border-color:var(--n-color-primary);--n-button-box-shadow:0 0 0 1px var(--n-button-border-color)}:host([disabled]){cursor:auto;pointer-events:none}::slotted(:not([slot])){display:none}[slot=after] svg{color:var(--n-color-icon);margin-inline-start:var(--n-space-m);margin-inline-end:calc(var(--n-space-s)/ -2);min-inline-size:calc(var(--n-space-l)/ 2.2)}::slotted([slot=before]){margin-inline-start:calc(var(--n-space-s) * -1);margin-inline-end:var(--n-space-s)}select[aria-invalid=true]+nord-button{--n-button-border-color:var(--n-color-status-danger)}`;let v=class extends(p(d(c(t(i))))){constructor(){super(...arguments),this.inputId="select"}render(){const e=this.options,t=this.getButtonText(e);return o`<slot></slot>${this.renderLabel()}<div class="n-select-container"><select ${a(this.focusableRef)} id="${this.inputId}" ?disabled="${this.disabled}" ?required="${this.required}" name="${s(this.name)}" @change="${this.handleChange}" aria-describedby="${s(this.getDescribedBy())}" aria-invalid="${s(this.getInvalid())}">${this.placeholder&&o`<option value="" disabled="disabled" ?selected="${!this.value}">${this.placeholder}</option>`} ${e.map((e=>this.renderOption(e)))}</select><nord-button tabindex="-1" ?disabled="${this.disabled}" ?expand="${this.expand}" aria-hidden="true" type="button"><slot slot="before" name="before"></slot>${t}<div slot="after">${l('<svg viewBox="0 0 140 140" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M105 56a10.416 10.416 0 0 1-7.42-3.08L72.478 27.818a3.528 3.528 0 0 0-4.956 0L42.42 52.92a10.5 10.5 0 0 1-14.84-14.84l35-35a10.486 10.486 0 0 1 14.84 0l35 35A10.5 10.5 0 0 1 105 56zm-35 84a10.416 10.416 0 0 1-7.42-3.08l-35-35a10.5 10.5 0 0 1 14.84-14.84l25.102 25.102a3.528 3.528 0 0 0 4.956 0L97.58 87.08a10.5 10.5 0 1 1 14.84 14.84l-35 35A10.416 10.416 0 0 1 70 140z"/></svg>')}</div></nord-button></div>${this.renderError()}`}get options(){return Array.from(this.querySelectorAll("option"))}getButtonText(e){const t=e.find((e=>e.value===this.value));return t?t.text:this.placeholder?this.placeholder:e[0]?e[0].text:""}renderOption(e){return o`<option value="${s(e.value)}" ?disabled="${e.disabled}" ?selected="${e.value===this.value}">${e.text}</option>`}};v.styles=[b,u],v=n([r("nord-select")],v);var h=v;export{h as default}; | ||
//# sourceMappingURL=Select.js.map |
@@ -10,4 +10,5 @@ export { default as Badge } from "./badge/Badge.js"; | ||
export { default as Stack } from "./stack/Stack.js"; | ||
export { default as Spinner } from "./spinner/Spinner.js"; | ||
export { default as Table } from "./table/Table.js"; | ||
export { default as VisuallyHidden } from "./visually-hidden/VisuallyHidden.js"; | ||
export { default as Textarea } from "./textarea/Textarea.js"; |
@@ -1,2 +0,2 @@ | ||
import{r as e,D as t,p as i,_ as s,n as r,s as a}from"./DraftComponentMixin-4bb26f5d.js";import{e as o}from"./property-03f59dce.js";import{l as n}from"./directive-40a31ee2.js";import{n as l}from"./ref-857246ae.js";import{I as d,F as h}from"./InputMixin-3e737480.js";import{F as p,s as u}from"./FormField-02dd3b4f.js";import"./VisuallyHidden.js";import{s as c}from"./TextField-bfdc253c.js";import"./SlotController-fda28afb.js";import"./events-731d0007.js";const f=e`.n-input{resize:none;min-block-size:var(--n-textarea-height,76px);transition:border var(--n-transition-slowly),box-shadow var(--n-transition-slowly),background var(--n-transition-slowly);display:block}:host([resize=vertical]) .n-input{resize:vertical}:host([resize=auto]) .n-input{overflow:hidden}`;let m=class extends(p(d(h(t(a))))){constructor(){super(...arguments),this.inputId="textarea",this.resize="vertical"}updated(e){(e.has("resize")||e.has("value"))&&this.resizeToFitContent()}render(){var e;return i`${this.renderLabel()}<div class="n-input-container"><textarea ${l(this.focusableRef)} id="${this.inputId}" class="n-input" ?disabled="${this.disabled}" ?required="${this.required}" name="${n(this.name)}" .value="${null!==(e=this.value)&&void 0!==e?e:""}" placeholder="${n(this.placeholder)}" @change="${this.handleChange}" @input="${this.resizeToFitContent}" aria-describedby="${n(this.getDescribedBy())}" aria-invalid="${n(this.getInvalid())}"></textarea></div>${this.renderError()}`}resizeToFitContent(){const e=this.focusableRef.value;e&&("auto"===this.resize?(e.style.height="auto",e.style.height=`${e.scrollHeight}px`):e.style.height=null)}};m.styles=[u,c,f],s([o({reflect:!0})],m.prototype,"resize",void 0),m=s([r("nord-textarea")],m);var v=m;export{v as default}; | ||
import{r as e,D as t,p as i,_ as s,n as r,s as a}from"./DraftComponentMixin-4bb26f5d.js";import{e as o}from"./property-03f59dce.js";import{l as n}from"./if-defined-617ae549.js";import{n as l}from"./ref-65ef7607.js";import{I as d,F as h}from"./InputMixin-6c108de4.js";import{F as p,s as c}from"./FormField-02dd3b4f.js";import"./VisuallyHidden.js";import{s as u}from"./TextField-bfdc253c.js";import"./directive-e9ce14b4.js";import"./SlotController-fda28afb.js";import"./events-731d0007.js";const f=e`.n-input{resize:none;min-block-size:var(--n-textarea-height,76px);transition:border var(--n-transition-slowly),box-shadow var(--n-transition-slowly),background var(--n-transition-slowly);display:block}:host([resize=vertical]) .n-input{resize:vertical}:host([resize=auto]) .n-input{overflow:hidden}`;let m=class extends(p(d(h(t(a))))){constructor(){super(...arguments),this.inputId="textarea",this.resize="vertical"}updated(e){(e.has("resize")||e.has("value"))&&this.resizeToFitContent()}render(){var e;return i`${this.renderLabel()}<div class="n-input-container"><textarea ${l(this.focusableRef)} id="${this.inputId}" class="n-input" ?disabled="${this.disabled}" ?required="${this.required}" name="${n(this.name)}" .value="${null!==(e=this.value)&&void 0!==e?e:""}" placeholder="${n(this.placeholder)}" @change="${this.handleChange}" @input="${this.resizeToFitContent}" aria-describedby="${n(this.getDescribedBy())}" aria-invalid="${n(this.getInvalid())}"></textarea></div>${this.renderError()}`}resizeToFitContent(){const e=this.focusableRef.value;e&&("auto"===this.resize?(e.style.height="auto",e.style.height=`${e.scrollHeight}px`):e.style.height=null)}};m.styles=[c,u,f],s([o({reflect:!0})],m.prototype,"resize",void 0),m=s([r("nord-textarea")],m);var v=m;export{v as default}; | ||
//# sourceMappingURL=Textarea.js.map |
{ | ||
"name": "@nordhealth/components", | ||
"version": "1.0.0-alpha.39", | ||
"version": "1.0.0-alpha.40", | ||
"description": "This package includes Nord Design System web components", | ||
@@ -140,3 +140,3 @@ "author": "Nordhealth <info@nordhealth.com>", | ||
}, | ||
"gitHead": "cb6356b6f7298342706acb9579bca63544383daa" | ||
"gitHead": "a6c37c39ab3a73ac59c8245fc79e97e5c08f4948" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
418153
108
5766