@duyluonganduin/acl-web-components 0.0.24 → 0.0.26
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/acl-web-components.cjs +1 -1
- package/dist/acl-web-components.d.ts +1 -1
- package/dist/acl-web-components.iife.js +67 -56
- package/dist/acl-web-components.js +1 -1
- package/dist/{anduin-suggestion-Dm0pHzzk.cjs → anduin-suggestion-ChXDlWeZ.cjs} +76 -65
- package/dist/{anduin-suggestion-BcQlCfVG.js → anduin-suggestion-D3Sl4vcX.js} +11 -0
- package/dist/jsx.d.ts +2 -2
- package/dist/react.cjs +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +2 -2
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const q1=globalThis,y2=q1.ShadowRoot&&(q1.ShadyCSS===void 0||q1.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Z2=Symbol(),k5=new WeakMap;let K5=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Z2)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(y2&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=k5.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&k5.set(t,e))}return e}toString(){return this.cssText}};const R4=l=>new K5(typeof l=="string"?l:l+"",void 0,Z2),
|
|
5
|
+
*/const q1=globalThis,y2=q1.ShadowRoot&&(q1.ShadyCSS===void 0||q1.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Z2=Symbol(),k5=new WeakMap;let K5=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Z2)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(y2&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=k5.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&k5.set(t,e))}return e}toString(){return this.cssText}};const R4=l=>new K5(typeof l=="string"?l:l+"",void 0,Z2),g=(l,...e)=>{const t=l.length===1?l[0]:e.reduce((i,o,r)=>i+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+l[r+1],l[0]);return new K5(t,l,Z2)},k4=(l,e)=>{if(y2)l.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),o=q1.litNonce;o!==void 0&&i.setAttribute("nonce",o),i.textContent=t.cssText,l.appendChild(i)}},E5=y2?l=>l:l=>l instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return R4(t)})(l):l;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
13
|
*/const $1=globalThis,B5=l=>l,X1=$1.trustedTypes,z5=X1?X1.createPolicy("lit-html",{createHTML:l=>l}):void 0,J5="$lit$",U=`lit$${Math.random().toFixed(9).slice(2)}$`,Q5="?"+U,P4=`<${Q5}>`,t1=document,A1=()=>t1.createComment(""),B1=l=>l===null||typeof l!="object"&&typeof l!="function",x2=Array.isArray,F4=l=>x2(l)||typeof(l==null?void 0:l[Symbol.iterator])=="function",u2=`[
|
|
14
14
|
\f\r]`,k1=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,S5=/-->/g,O5=/>/g,J=RegExp(`>|${u2}(?:([^\\s"'>=/]+)(${u2}*=${u2}*(?:[^
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),P5=/'/g,F5=/"/g,e4=/^(?:script|style|textarea|title)$/i,t4=l=>(e,...t)=>({_$litType$:l,strings:e,values:t}),s=t4(1),K1=t4(2),o1=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),D5=new WeakMap,Q=t1.createTreeWalker(t1,129);function o4(l,e){if(!x2(l)||!l.hasOwnProperty("raw"))throw Error("invalid template strings array");return z5!==void 0?z5.createHTML(e):e}const D4=(l,e)=>{const t=l.length-1,i=[];let o,r=e===2?"<svg>":e===3?"<math>":"",n=k1;for(let a=0;a<t;a++){const d=l[a];let p,u,
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),P5=/'/g,F5=/"/g,e4=/^(?:script|style|textarea|title)$/i,t4=l=>(e,...t)=>({_$litType$:l,strings:e,values:t}),s=t4(1),K1=t4(2),o1=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),D5=new WeakMap,Q=t1.createTreeWalker(t1,129);function o4(l,e){if(!x2(l)||!l.hasOwnProperty("raw"))throw Error("invalid template strings array");return z5!==void 0?z5.createHTML(e):e}const D4=(l,e)=>{const t=l.length-1,i=[];let o,r=e===2?"<svg>":e===3?"<math>":"",n=k1;for(let a=0;a<t;a++){const d=l[a];let p,u,v=-1,H=0;for(;H<d.length&&(n.lastIndex=H,u=n.exec(d),u!==null);)H=n.lastIndex,n===k1?u[1]==="!--"?n=S5:u[1]!==void 0?n=O5:u[2]!==void 0?(e4.test(u[2])&&(o=RegExp("</"+u[2],"g")),n=J):u[3]!==void 0&&(n=J):n===J?u[0]===">"?(n=o??k1,v=-1):u[1]===void 0?v=-2:(v=n.lastIndex-u[2].length,p=u[1],n=u[3]===void 0?J:u[3]==='"'?F5:P5):n===F5||n===P5?n=J:n===S5||n===O5?n=k1:(n=J,o=void 0);const f=n===J&&l[a+1].startsWith("/>")?" ":"";r+=n===k1?d+P4:v>=0?(i.push(p),d.slice(0,v)+J5+d.slice(v)+U+f):d+U+(v===-2?a:f)}return[o4(l,r+(l[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class z1{constructor({strings:e,_$litType$:t},i){let o;this.parts=[];let r=0,n=0;const a=e.length-1,d=this.parts,[p,u]=D4(e,t);if(this.el=z1.createElement(p,i),Q.currentNode=this.el.content,t===2||t===3){const v=this.el.content.firstChild;v.replaceWith(...v.childNodes)}for(;(o=Q.nextNode())!==null&&d.length<a;){if(o.nodeType===1){if(o.hasAttributes())for(const v of o.getAttributeNames())if(v.endsWith(J5)){const H=u[n++],f=o.getAttribute(v).split(U),Z=/([.?@])?(.*)/.exec(H);d.push({type:1,index:r,name:Z[2],strings:f,ctor:Z[1]==="."?T4:Z[1]==="?"?N4:Z[1]==="@"?U4:d2}),o.removeAttribute(v)}else v.startsWith(U)&&(d.push({type:6,index:r}),o.removeAttribute(v));if(e4.test(o.tagName)){const v=o.textContent.split(U),H=v.length-1;if(H>0){o.textContent=X1?X1.emptyScript:"";for(let f=0;f<H;f++)o.append(v[f],A1()),Q.nextNode(),d.push({type:2,index:++r});o.append(v[H],A1())}}}else if(o.nodeType===8)if(o.data===Q5)d.push({type:2,index:r});else{let v=-1;for(;(v=o.data.indexOf(U,v+1))!==-1;)d.push({type:7,index:r}),v+=U.length-1}r++}}static createElement(e,t){const i=t1.createElement("template");return i.innerHTML=e,i}}function v1(l,e,t=l,i){var n,a;if(e===o1)return e;let o=i!==void 0?(n=t._$Co)==null?void 0:n[i]:t._$Cl;const r=B1(e)?void 0:e._$litDirective$;return(o==null?void 0:o.constructor)!==r&&((a=o==null?void 0:o._$AO)==null||a.call(o,!1),r===void 0?o=void 0:(o=new r(l),o._$AT(l,t,i)),i!==void 0?(t._$Co??(t._$Co=[]))[i]=o:t._$Cl=o),o!==void 0&&(e=v1(l,o._$AS(l,e.values),o,i)),e}class I4{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:i}=this._$AD,o=((e==null?void 0:e.creationScope)??t1).importNode(t,!0);Q.currentNode=o;let r=Q.nextNode(),n=0,a=0,d=i[0];for(;d!==void 0;){if(n===d.index){let p;d.type===2?p=new T1(r,r.nextSibling,this,e):d.type===1?p=new d.ctor(r,d.name,d.strings,this,e):d.type===6&&(p=new j4(r,this,e)),this._$AV.push(p),d=i[++a]}n!==(d==null?void 0:d.index)&&(r=Q.nextNode(),n++)}return Q.currentNode=t1,o}p(e){let t=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class T1{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,i,o){this.type=2,this._$AH=c,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=o,this._$Cv=(o==null?void 0:o.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=v1(this,e,t),B1(e)?e===c||e==null||e===""?(this._$AH!==c&&this._$AR(),this._$AH=c):e!==this._$AH&&e!==o1&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):F4(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==c&&B1(this._$AH)?this._$AA.nextSibling.data=e:this.T(t1.createTextNode(e)),this._$AH=e}$(e){var r;const{values:t,_$litType$:i}=e,o=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=z1.createElement(o4(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)==null?void 0:r._$AD)===o)this._$AH.p(t);else{const n=new I4(o,this),a=n.u(this.options);n.p(t),this.T(a),this._$AH=n}}_$AC(e){let t=D5.get(e.strings);return t===void 0&&D5.set(e.strings,t=new z1(e)),t}k(e){x2(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let i,o=0;for(const r of e)o===t.length?t.push(i=new T1(this.O(A1()),this.O(A1()),this,this.options)):i=t[o],i._$AI(r),o++;o<t.length&&(this._$AR(i&&i._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,t);e!==this._$AB;){const o=B5(e).nextSibling;B5(e).remove(),e=o}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}}class d2{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,o,r){this.type=1,this._$AH=c,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=c}_$AI(e,t=this,i,o){const r=this.strings;let n=!1;if(r===void 0)e=v1(this,e,t,0),n=!B1(e)||e!==this._$AH&&e!==o1,n&&(this._$AH=e);else{const a=e;let d,p;for(e=r[0],d=0;d<r.length-1;d++)p=v1(this,a[i+d],t,d),p===o1&&(p=this._$AH[d]),n||(n=!B1(p)||p!==this._$AH[d]),p===c?e=c:e!==c&&(e+=(p??"")+r[d+1]),this._$AH[d]=p}n&&!o&&this.j(e)}j(e){e===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class T4 extends d2{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===c?void 0:e}}class N4 extends d2{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==c)}}class U4 extends d2{constructor(e,t,i,o,r){super(e,t,i,o,r),this.type=5}_$AI(e,t=this){if((e=v1(this,e,t,0)??c)===o1)return;const i=this._$AH,o=e===c&&i!==c||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,r=e!==c&&(i===c||o);o&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}class j4{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){v1(this,e)}}const h2=$1.litHtmlPolyfillSupport;h2==null||h2(z1,T1),($1.litHtmlVersions??($1.litHtmlVersions=[])).push("3.3.2");const G4=(l,e,t)=>{const i=(t==null?void 0:t.renderBefore)??e;let o=i._$litPart$;if(o===void 0){const r=(t==null?void 0:t.renderBefore)??null;i._$litPart$=o=new T1(e.insertBefore(A1(),r),r,void 0,t??{})}return o._$AI(l),o};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/const e1=globalThis;let h=class extends u1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=G4(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return o1}};var X5;h._$litElement$=!0,h.finalized=!0,(X5=e1.litElementHydrateSupport)==null||X5.call(e1,{LitElement:h});const
|
|
19
|
+
*/const e1=globalThis;let h=class extends u1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=G4(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return o1}};var X5;h._$litElement$=!0,h.finalized=!0,(X5=e1.litElementHydrateSupport)==null||X5.call(e1,{LitElement:h});const v2=e1.litElementPolyfillSupport;v2==null||v2({LitElement:h});(e1.litElementVersions??(e1.litElementVersions=[])).push("4.2.2");/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -63,11 +63,11 @@
|
|
|
63
63
|
stroke-dashoffset="${o}"
|
|
64
64
|
/>
|
|
65
65
|
</svg>
|
|
66
|
-
`}};F2.styles=
|
|
66
|
+
`}};F2.styles=g`
|
|
67
67
|
:host { display: inline-block; line-height: 0; font-family: var(--font-sans); }
|
|
68
68
|
.spinner { animation: circle 0.6s linear infinite; }
|
|
69
69
|
@keyframes circle { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
|
|
70
|
-
`;let
|
|
70
|
+
`;let g1=F2;i4([C()],g1.prototype,"size");i4([C()],g1.prototype,"percent");customElements.get("anduin-spinner")||customElements.define("anduin-spinner",g1);var K4=Object.defineProperty,l4=(l,e,t,i)=>{for(var o=void 0,r=l.length-1,n;r>=0;r--)(n=l[r])&&(o=n(e,t,o)||o);return o&&K4(e,t,o),o};const I5="M7.23359 3.5336C7.49685 2.82213 8.50314 2.82213 8.76641 3.5336L9.63534 5.88184C9.71811 6.10553 9.89447 6.28189 10.1182 6.36466L12.4664 7.23359C13.1779 7.49685 13.1779 8.50314 12.4664 8.76641L10.1182 9.63534C9.89447 9.71811 9.71811 9.89447 9.63534 10.1182L8.76641 12.4664C8.50314 13.1779 7.49685 13.1779 7.23359 12.4664L6.36466 10.1182C6.28189 9.89447 6.10553 9.71811 5.88185 9.63534L3.5336 8.76641C2.82213 8.50314 2.82213 7.49685 3.5336 7.23359L5.88184 6.36466C6.10553 6.28189 6.28189 6.10553 6.36466 5.88185L7.23359 3.5336Z",J4={small:16,medium:24,large:32},D2=class D2 extends h{constructor(){super(...arguments),this.size="small",this.color="default"}render(){const e=J4[this.size]??16;return K1`
|
|
71
71
|
<svg
|
|
72
72
|
xmlns="http://www.w3.org/2000/svg"
|
|
73
73
|
width="${e}"
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
<path class="star" d="${I5}"/>
|
|
80
80
|
<path class="star star-2" d="${I5}"/>
|
|
81
81
|
</svg>
|
|
82
|
-
`}};D2.styles=
|
|
82
|
+
`}};D2.styles=g`
|
|
83
83
|
:host { display: inline-block; line-height: 0; }
|
|
84
84
|
|
|
85
85
|
/* ── Colors ─────────────────────────────────────────────────── */
|
|
@@ -134,10 +134,10 @@
|
|
|
134
134
|
clip-rule="${i.clipRule??c}"
|
|
135
135
|
/>`)}
|
|
136
136
|
</svg>
|
|
137
|
-
`}};I2.styles=
|
|
137
|
+
`}};I2.styles=g`
|
|
138
138
|
:host { display: block; line-height: 0; font-family: var(--font-sans); }
|
|
139
139
|
.icon--hidden { display: none; }
|
|
140
|
-
`;let H1=I2;r4([C()],H1.prototype,"name");r4([C({type:Number})],H1.prototype,"size");customElements.get("anduin-icon")||customElements.define("anduin-icon",H1);var e3=Object.defineProperty,t3=(l,e,t,i)=>{for(var o=void 0,r=l.length-1,n;r>=0;r--)(n=l[r])&&(o=n(e,t,o)||o);return o&&e3(e,t,o),o};const w2=
|
|
140
|
+
`;let H1=I2;r4([C()],H1.prototype,"name");r4([C({type:Number})],H1.prototype,"size");customElements.get("anduin-icon")||customElements.define("anduin-icon",H1);var e3=Object.defineProperty,t3=(l,e,t,i)=>{for(var o=void 0,r=l.length-1,n;r>=0;r--)(n=l[r])&&(o=n(e,t,o)||o);return o&&e3(e,t,o),o};const w2=g`
|
|
141
141
|
:host { display: inline-block; font-family: var(--font-sans); }
|
|
142
142
|
.badge {
|
|
143
143
|
border-radius: 9999px;
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
?disabled="${this.disabled}"
|
|
187
187
|
aria-label="${this.label||c}"
|
|
188
188
|
>${o}</button>
|
|
189
|
-
`}};U2.styles=
|
|
189
|
+
`}};U2.styles=g`
|
|
190
190
|
:host { display: inline-block; font-family: var(--font-sans); }
|
|
191
191
|
:host([full-width]) { display: block; width: 100%; }
|
|
192
192
|
.button {
|
|
@@ -231,6 +231,9 @@
|
|
|
231
231
|
.button--filled.button--warning { color: var(--color-gray-8); border-color: transparent; background-color: var(--color-warning-3); }
|
|
232
232
|
.button--filled.button--warning:hover { background-color: var(--color-warning-2); }
|
|
233
233
|
.button--filled.button--warning:active { background-color: var(--color-warning-4); }
|
|
234
|
+
.button--filled.button--purple { color: var(--color-gray-0); border-color: transparent; background-color: var(--color-purple-600); }
|
|
235
|
+
.button--filled.button--purple:hover { background-color: var(--color-purple-500); }
|
|
236
|
+
.button--filled.button--purple:active { background-color: var(--color-purple-700); }
|
|
234
237
|
.button--outlined.button--gray9 { border-color: var(--color-gray-4); color: var(--color-gray-7); background-color: transparent; }
|
|
235
238
|
.button--outlined.button--gray9:hover { background-color: var(--color-gray-3); }
|
|
236
239
|
.button--outlined.button--gray9:active { background-color: var(--color-gray-4); }
|
|
@@ -249,6 +252,9 @@
|
|
|
249
252
|
.button--outlined.button--warning { border-color: var(--color-warning-3); color: var(--color-warning-5); background-color: transparent; }
|
|
250
253
|
.button--outlined.button--warning:hover { background-color: var(--color-warning-1); }
|
|
251
254
|
.button--outlined.button--warning:active { background-color: var(--color-warning-2); }
|
|
255
|
+
.button--outlined.button--purple { border-color: var(--color-purple-300); color: var(--color-purple-500); background-color: transparent; }
|
|
256
|
+
.button--outlined.button--purple:hover { background-color: var(--color-purple-50); }
|
|
257
|
+
.button--outlined.button--purple:active { background-color: var(--color-purple-100); }
|
|
252
258
|
.button--plain.button--gray9 { border-color: transparent; color: var(--color-gray-7); background-color: transparent; }
|
|
253
259
|
.button--plain.button--gray9:hover { background-color: var(--color-gray-3); }
|
|
254
260
|
.button--plain.button--gray9:active { background-color: var(--color-gray-4); }
|
|
@@ -267,6 +273,9 @@
|
|
|
267
273
|
.button--plain.button--warning { border-color: transparent; color: var(--color-warning-5); background-color: transparent; }
|
|
268
274
|
.button--plain.button--warning:hover { background-color: var(--color-warning-1); }
|
|
269
275
|
.button--plain.button--warning:active { background-color: var(--color-warning-2); }
|
|
276
|
+
.button--plain.button--purple { border-color: transparent; color: var(--color-purple-500); background-color: transparent; }
|
|
277
|
+
.button--plain.button--purple:hover { background-color: var(--color-purple-50); }
|
|
278
|
+
.button--plain.button--purple:active { background-color: var(--color-purple-100); }
|
|
270
279
|
.button--text { border: none; background: none; padding: 0; height: auto; width: auto; display: inline-flex; align-items: center; vertical-align: bottom; }
|
|
271
280
|
.button--text:hover { text-decoration: underline; }
|
|
272
281
|
.button--text .button__content { display: inline-flex; align-items: center; gap: 4px; height: auto; }
|
|
@@ -276,12 +285,14 @@
|
|
|
276
285
|
.button--text.button--success { color: var(--color-success-5); }
|
|
277
286
|
.button--text.button--danger { color: var(--color-danger-5); }
|
|
278
287
|
.button--text.button--warning { color: var(--color-warning-5); }
|
|
288
|
+
.button--text.button--purple { color: var(--color-purple-600); }
|
|
279
289
|
.button--selected.button--filled.button--gray0 { background-color: var(--color-gray-4); }
|
|
280
290
|
.button--selected.button--filled.button--gray9 { background-color: var(--color-gray-8); }
|
|
281
291
|
.button--selected.button--filled.button--primary { background-color: var(--color-primary-5); }
|
|
282
292
|
.button--selected.button--filled.button--danger { background-color: var(--color-danger-5); }
|
|
283
293
|
.button--selected.button--filled.button--success { background-color: var(--color-success-5); }
|
|
284
294
|
.button--selected.button--filled.button--warning { background-color: var(--color-warning-4); }
|
|
295
|
+
.button--selected.button--filled.button--purple { background-color: var(--color-purple-600); }
|
|
285
296
|
.button--icon-only.button--tiny { width: 16px; min-width: 16px; padding-left: 0; padding-right: 0; }
|
|
286
297
|
.button--icon-only.button--extra-small { width: 20px; min-width: 20px; padding-left: 0; padding-right: 0; }
|
|
287
298
|
.button--icon-only.button--small { width: 24px; min-width: 24px; padding-left: 0; padding-right: 0; }
|
|
@@ -292,7 +303,7 @@
|
|
|
292
303
|
<slot name="icon"></slot>
|
|
293
304
|
<div><slot></slot></div>
|
|
294
305
|
</div>
|
|
295
|
-
`}};j2.styles=
|
|
306
|
+
`}};j2.styles=g`
|
|
296
307
|
:host { display: block; font-family: var(--font-sans); }
|
|
297
308
|
.callout {
|
|
298
309
|
display: flex; align-items: center; justify-content: center;
|
|
@@ -313,7 +324,7 @@
|
|
|
313
324
|
<div class="divider__line--horizontal"></div>
|
|
314
325
|
<div><slot @slotchange=${this.onSlotChange}></slot></div>
|
|
315
326
|
<div class="divider__line--horizontal"></div>
|
|
316
|
-
</div>`:s`<div class="divider--horizontal divider--horizontal-empty"><slot @slotchange=${this.onSlotChange}></slot></div>`}};G2.styles=
|
|
327
|
+
</div>`:s`<div class="divider--horizontal divider--horizontal-empty"><slot @slotchange=${this.onSlotChange}></slot></div>`}};G2.styles=g`
|
|
317
328
|
:host { display: block; width: 100%; font-family: var(--font-sans); }
|
|
318
329
|
:host([direction="vertical"]) { width: auto; height: 100%; }
|
|
319
330
|
.divider--horizontal { margin-top: 8px; margin-bottom: 8px; width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; column-gap: 8px; text-align: center; }
|
|
@@ -322,7 +333,7 @@
|
|
|
322
333
|
.divider--vertical { margin-left: 8px; margin-right: 8px; height: 100%; display: grid; grid-template-rows: 1fr auto 1fr; row-gap: 8px; text-align: center; }
|
|
323
334
|
.divider--vertical-empty { background-color: var(--color-gray-3); width: 1px; }
|
|
324
335
|
.divider__line--vertical { border-left: 1px solid var(--color-gray-3); justify-self: center; }
|
|
325
|
-
`;let L1=G2;C4([C({reflect:!0})],L1.prototype,"direction");C4([M()],L1.prototype,"hasContent");customElements.get("anduin-divider")||customElements.define("anduin-divider",L1);var a3=Object.defineProperty,s3=(l,e,t,i)=>{for(var o=void 0,r=l.length-1,n;r>=0;r--)(n=l[r])&&(o=n(e,t,o)||o);return o&&a3(e,t,o),o};const q2=class q2 extends h{constructor(){super(...arguments),this.variant="gray"}render(){return s`<div class="dot dot--${this.variant}" part="dot"></div>`}};q2.styles=
|
|
336
|
+
`;let L1=G2;C4([C({reflect:!0})],L1.prototype,"direction");C4([M()],L1.prototype,"hasContent");customElements.get("anduin-divider")||customElements.define("anduin-divider",L1);var a3=Object.defineProperty,s3=(l,e,t,i)=>{for(var o=void 0,r=l.length-1,n;r>=0;r--)(n=l[r])&&(o=n(e,t,o)||o);return o&&a3(e,t,o),o};const q2=class q2 extends h{constructor(){super(...arguments),this.variant="gray"}render(){return s`<div class="dot dot--${this.variant}" part="dot"></div>`}};q2.styles=g`
|
|
326
337
|
:host { display: inline-block; font-family: var(--font-sans); }
|
|
327
338
|
.dot { width: 10px; height: 10px; border-radius: 9999px; }
|
|
328
339
|
.dot--gray { background-color: var(--color-semantic-gray-6); color: var(--color-semantic-gray-0); }
|
|
@@ -335,7 +346,7 @@
|
|
|
335
346
|
<div class="${o.join(" ")}" style="${i}"></div>
|
|
336
347
|
<div class="progress__background"></div>
|
|
337
348
|
</div>
|
|
338
|
-
`}};W2.styles=
|
|
349
|
+
`}};W2.styles=g`
|
|
339
350
|
:host { display: block; font-family: var(--font-sans); }
|
|
340
351
|
.progress { overflow-x: hidden; position: relative; border-radius: 9999px; }
|
|
341
352
|
.progress__fill {
|
|
@@ -354,7 +365,7 @@
|
|
|
354
365
|
<div class="${e}" style="${t} ${i} ${o}" part="skeleton">
|
|
355
366
|
${this.effect==="wave"?s`<div class="skeleton__wave" style="animation: skeleton-wave ${this.duration}ms linear infinite;"></div>`:""}
|
|
356
367
|
</div>
|
|
357
|
-
`}};Y2.styles=
|
|
368
|
+
`}};Y2.styles=g`
|
|
358
369
|
:host { display: block; height: 100%; font-family: var(--font-sans); }
|
|
359
370
|
.skeleton { background-color: var(--color-gray-3); position: relative; overflow: hidden; }
|
|
360
371
|
.skeleton--circle { border-radius: 9999px; }
|
|
@@ -379,7 +390,7 @@
|
|
|
379
390
|
</div>
|
|
380
391
|
<slot class="loading-state__content"></slot>
|
|
381
392
|
</div>
|
|
382
|
-
`}};X2.styles=
|
|
393
|
+
`}};X2.styles=g`
|
|
383
394
|
:host { display: block; height: 100%; font-family: var(--font-sans); }
|
|
384
395
|
.loading-state { display: flex; flex-direction: column; justify-content: center; align-items: center; }
|
|
385
396
|
.loading-state__indicator { color: var(--color-primary-4); }
|
|
@@ -388,7 +399,7 @@
|
|
|
388
399
|
<div class="field ${e?"field--horizontal":"field--vertical"}" part="field">
|
|
389
400
|
<slot></slot>
|
|
390
401
|
</div>
|
|
391
|
-
`}};K2.styles=
|
|
402
|
+
`}};K2.styles=g`
|
|
392
403
|
:host { display: block; font-family: var(--font-sans); }
|
|
393
404
|
.field { display: flex; flex-wrap: wrap; }
|
|
394
405
|
.field--vertical { flex-direction: column; row-gap: 4px; }
|
|
@@ -402,20 +413,20 @@
|
|
|
402
413
|
>
|
|
403
414
|
<slot></slot>${this.required?s`<span class="field-label__required"> *</span>`:""}
|
|
404
415
|
</label>
|
|
405
|
-
`}};J2.styles=
|
|
416
|
+
`}};J2.styles=g`
|
|
406
417
|
:host { display: inline-block; font-family: var(--font-sans); }
|
|
407
418
|
.field-label { font-size: 13px; line-height: 20px; font-weight: 600; cursor: default; color: var(--color-gray-8, #101828); }
|
|
408
419
|
.field-label__required { color: var(--color-danger-5); }
|
|
409
|
-
`;let m1=J2;k2([C()],m1.prototype,"htmlfor");k2([C({type:Boolean})],m1.prototype,"required");const Q2=class Q2 extends h{render(){return s`<div class="field-description" part="description"><slot></slot></div>`}};Q2.styles=
|
|
420
|
+
`;let m1=J2;k2([C()],m1.prototype,"htmlfor");k2([C({type:Boolean})],m1.prototype,"required");const Q2=class Q2 extends h{render(){return s`<div class="field-description" part="description"><slot></slot></div>`}};Q2.styles=g`
|
|
410
421
|
:host { display: inline-block; font-family: var(--font-sans); }
|
|
411
422
|
.field-description { display: block; line-height: 16px; font-size: 11px; color: var(--color-gray-7); }
|
|
412
|
-
`;let J1=Q2;const e5=class e5 extends h{render(){return s`<div class="field-error" part="error"><slot></slot></div>`}};e5.styles=
|
|
423
|
+
`;let J1=Q2;const e5=class e5 extends h{render(){return s`<div class="field-error" part="error"><slot></slot></div>`}};e5.styles=g`
|
|
413
424
|
:host { display: block; font-family: var(--font-sans); }
|
|
414
425
|
.field-error { color: var(--color-danger-4); }
|
|
415
|
-
`;let Q1=e5;const t5=class t5 extends h{render(){return s`<div class="field-group" part="group"><slot></slot></div>`}};t5.styles=
|
|
426
|
+
`;let Q1=e5;const t5=class t5 extends h{render(){return s`<div class="field-group" part="group"><slot></slot></div>`}};t5.styles=g`
|
|
416
427
|
:host { display: block; font-family: var(--font-sans); }
|
|
417
428
|
.field-group { display: flex; flex-direction: column; row-gap: 24px; }
|
|
418
|
-
`;let e2=t5;customElements.get("anduin-field")||customElements.define("anduin-field",D1);customElements.get("anduin-field-label")||customElements.define("anduin-field-label",m1);customElements.get("anduin-field-description")||customElements.define("anduin-field-description",J1);customElements.get("anduin-field-error")||customElements.define("anduin-field-error",Q1);customElements.get("anduin-field-group")||customElements.define("anduin-field-group",e2);var
|
|
429
|
+
`;let e2=t5;customElements.get("anduin-field")||customElements.define("anduin-field",D1);customElements.get("anduin-field-label")||customElements.define("anduin-field-label",m1);customElements.get("anduin-field-description")||customElements.define("anduin-field-description",J1);customElements.get("anduin-field-error")||customElements.define("anduin-field-error",Q1);customElements.get("anduin-field-group")||customElements.define("anduin-field-group",e2);var v3=Object.defineProperty,N1=(l,e,t,i)=>{for(var o=void 0,r=l.length-1,n;r>=0;r--)(n=l[r])&&(o=n(e,t,o)||o);return o&&v3(e,t,o),o};const s4="anduin-checkbox:change",o5=class o5 extends h{constructor(){super(...arguments),this.checked=!1,this.disabled=!1,this.indeterminate=!1,this.readonly=!1,this.inputid=""}connectedCallback(){super.connectedCallback();const e=this.closest("anduin-field");e&&e.addEventListener(C1,t=>{const i=t;this.inputid&&this.inputid===i.detail&&!this.disabled&&!this.readonly&&this.toggle()})}toggle(){this.checked=!this.checked,this.dispatchEvent(new CustomEvent(s4,{detail:this.checked,bubbles:!0,composed:!0}))}onInputChange(){this.toggle()}render(){const e=["checkbox__box",this.indeterminate||this.checked?"checkbox__box--checked":"",this.readonly&&!this.indeterminate&&!this.checked?"checkbox__box--readonly":"",this.disabled&&!this.indeterminate&&!this.checked?"checkbox__box--disabled":"",!this.indeterminate&&!this.checked&&!this.readonly&&!this.disabled?"checkbox__box--unchecked":""].filter(Boolean).join(" "),t=this.indeterminate?"minusBold":this.checked?"checkBold":"",i=!this.disabled&&!this.readonly,o=i?0:-1;return s`
|
|
419
430
|
<label class="${this.disabled?"is-disabled":""}">
|
|
420
431
|
<div
|
|
421
432
|
class="checkbox ${i?"checkbox--interactive":""} ${this.disabled?"checkbox--disabled":""}"
|
|
@@ -436,7 +447,7 @@
|
|
|
436
447
|
</div>
|
|
437
448
|
<span class="checkbox__label"><slot></slot></span>
|
|
438
449
|
</label>
|
|
439
|
-
`}};o5.styles=
|
|
450
|
+
`}};o5.styles=g`
|
|
440
451
|
:host { display: inline-flex; font-family: var(--font-sans); }
|
|
441
452
|
|
|
442
453
|
label {
|
|
@@ -473,7 +484,7 @@
|
|
|
473
484
|
.checkbox__box--unchecked:active { background-color: var(--color-gray-2); }
|
|
474
485
|
.checkbox__icon { position: absolute; inset: 0; pointer-events: none; color: var(--color-gray-4); display: flex; align-items: center; justify-content: center; }
|
|
475
486
|
.checkbox__icon--visible { color: var(--color-gray-0); }
|
|
476
|
-
`;let D=o5;N1([C({type:Boolean})],D.prototype,"checked");N1([C({type:Boolean})],D.prototype,"disabled");N1([C({type:Boolean})],D.prototype,"indeterminate");N1([C({type:Boolean})],D.prototype,"readonly");N1([C()],D.prototype,"inputid");customElements.get("anduin-checkbox")||customElements.define("anduin-checkbox",D);var
|
|
487
|
+
`;let D=o5;N1([C({type:Boolean})],D.prototype,"checked");N1([C({type:Boolean})],D.prototype,"disabled");N1([C({type:Boolean})],D.prototype,"indeterminate");N1([C({type:Boolean})],D.prototype,"readonly");N1([C()],D.prototype,"inputid");customElements.get("anduin-checkbox")||customElements.define("anduin-checkbox",D);var g3=Object.defineProperty,z=(l,e,t,i)=>{for(var o=void 0,r=l.length-1,n;r>=0;r--)(n=l[r])&&(o=n(e,t,o)||o);return o&&g3(e,t,o),o};const V2="anduin-input:change",d4="anduin-input:clear",i5=class i5 extends h{constructor(){super(...arguments),this.value="",this.size="default",this.disabled=!1,this.readonly=!1,this.placeholder="",this.inputid="",this.status="",this.startIcon="",this.endIcon="",this.clearable=!1}connectedCallback(){super.connectedCallback();const e=this.closest("anduin-field");e&&e.addEventListener(C1,t=>{var o;const i=t;this.inputid&&this.inputid===i.detail&&((o=this.inputEl)==null||o.focus())})}updated(){this.inputEl&&this.inputEl.value!==this.value&&(this.inputEl.value=this.value)}onInput(){this.value=this.inputEl.value,this.dispatchEvent(new CustomEvent(V2,{detail:this.value,bubbles:!0,composed:!0}))}onClear(){var e;this.value="",this.inputEl&&(this.inputEl.value=""),this.dispatchEvent(new CustomEvent(V2,{detail:"",bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(d4,{bubbles:!0,composed:!0})),(e=this.inputEl)==null||e.focus()}render(){const e=this.size==="small"?"input--small":this.size==="large"?"input--large":"input--default",t=this.status?`input--${this.status}`:"",i=!!this.startIcon,o=!!this.endIcon||this.clearable&&!!this.value,r=this.clearable&&!!this.value&&!this.disabled&&!this.readonly,n=this.size==="small"?"12":this.size==="large"?"20":"16",a=this.size==="small"?"10":this.size==="large"?"16":"14";return s`
|
|
477
488
|
<div class="input-wrapper">
|
|
478
489
|
${i?s`
|
|
479
490
|
<span class="input__start">
|
|
@@ -510,7 +521,7 @@
|
|
|
510
521
|
</span>
|
|
511
522
|
`:c}
|
|
512
523
|
</div>
|
|
513
|
-
`}};i5.styles=
|
|
524
|
+
`}};i5.styles=g`
|
|
514
525
|
:host { display: block; font-family: var(--font-sans); }
|
|
515
526
|
|
|
516
527
|
.input-wrapper { position: relative; display: flex; align-items: center; }
|
|
@@ -577,7 +588,7 @@
|
|
|
577
588
|
part="textarea"
|
|
578
589
|
@input=${this.onInput}
|
|
579
590
|
></textarea>
|
|
580
|
-
`}};l5.styles=
|
|
591
|
+
`}};l5.styles=g`
|
|
581
592
|
:host { display: block; font-family: var(--font-sans); }
|
|
582
593
|
|
|
583
594
|
.textarea {
|
|
@@ -593,7 +604,7 @@
|
|
|
593
604
|
.textarea--invalid { border-color: var(--color-danger-4); }
|
|
594
605
|
.textarea--warning { border-color: var(--color-warning-4); }
|
|
595
606
|
.textarea--loading { border-color: var(--color-gray-4); }
|
|
596
|
-
`;let E=l5;W([C()],E.prototype,"value");W([C({type:Boolean})],E.prototype,"disabled");W([C({type:Boolean})],E.prototype,"readonly");W([C()],E.prototype,"placeholder");W([C()],E.prototype,"inputid");W([C({type:Number})],E.prototype,"rows");W([C()],E.prototype,"status");W([R("textarea")],E.prototype,"textareaEl");customElements.get("anduin-textarea")||customElements.define("anduin-textarea",E);var H3=Object.defineProperty,k=(l,e,t,i)=>{for(var o=void 0,r=l.length-1,n;r>=0;r--)(n=l[r])&&(o=n(e,t,o)||o);return o&&H3(e,t,o),o};const $2="anduin-tab:trigger-click",U1="anduin-tab:value-changed",p4="anduin-tab:change",r5=class r5 extends h{constructor(){super(...arguments),this.defaultValue="",this.value="",this.fill=!1}connectedCallback(){super.connectedCallback(),this.addEventListener($2,e=>{e.stopPropagation();const t=e;this.value=t.detail,this.broadcastValueChanged(t.detail),this.dispatchEvent(new CustomEvent(p4,{detail:t.detail,bubbles:!0,composed:!0}))}),requestAnimationFrame(()=>{const e=this.value||this.defaultValue;e&&(this.value||(this.value=e),this.broadcastValueChanged(e))})}updated(e){e.has("value")&&this.value&&this.broadcastValueChanged(this.value)}broadcastValueChanged(e){this.dispatchEvent(new CustomEvent(U1,{detail:e,bubbles:!1,composed:!1}))}render(){return s`<div class="tabs" part="tabs"><slot></slot></div>`}};r5.styles=
|
|
607
|
+
`;let E=l5;W([C()],E.prototype,"value");W([C({type:Boolean})],E.prototype,"disabled");W([C({type:Boolean})],E.prototype,"readonly");W([C()],E.prototype,"placeholder");W([C()],E.prototype,"inputid");W([C({type:Number})],E.prototype,"rows");W([C()],E.prototype,"status");W([R("textarea")],E.prototype,"textareaEl");customElements.get("anduin-textarea")||customElements.define("anduin-textarea",E);var H3=Object.defineProperty,k=(l,e,t,i)=>{for(var o=void 0,r=l.length-1,n;r>=0;r--)(n=l[r])&&(o=n(e,t,o)||o);return o&&H3(e,t,o),o};const $2="anduin-tab:trigger-click",U1="anduin-tab:value-changed",p4="anduin-tab:change",r5=class r5 extends h{constructor(){super(...arguments),this.defaultValue="",this.value="",this.fill=!1}connectedCallback(){super.connectedCallback(),this.addEventListener($2,e=>{e.stopPropagation();const t=e;this.value=t.detail,this.broadcastValueChanged(t.detail),this.dispatchEvent(new CustomEvent(p4,{detail:t.detail,bubbles:!0,composed:!0}))}),requestAnimationFrame(()=>{const e=this.value||this.defaultValue;e&&(this.value||(this.value=e),this.broadcastValueChanged(e))})}updated(e){e.has("value")&&this.value&&this.broadcastValueChanged(this.value)}broadcastValueChanged(e){this.dispatchEvent(new CustomEvent(U1,{detail:e,bubbles:!1,composed:!1}))}render(){return s`<div class="tabs" part="tabs"><slot></slot></div>`}};r5.styles=g`
|
|
597
608
|
:host { display: flex; flex-direction: column; font-family: var(--font-sans); }
|
|
598
609
|
:host([fill]) { flex: 1; min-height: 0; --_tab-fill-flex: 1; --_tab-fill-height: 100%; }
|
|
599
610
|
.tabs { display: flex; flex-direction: column; width: 100%; }
|
|
@@ -603,7 +614,7 @@
|
|
|
603
614
|
<slot></slot>
|
|
604
615
|
<div class="tabs-list__indicator"></div>
|
|
605
616
|
</div>
|
|
606
|
-
`}};n5.styles=
|
|
617
|
+
`}};n5.styles=g`
|
|
607
618
|
:host { display: block; font-family: var(--font-sans); }
|
|
608
619
|
.tabs-list {
|
|
609
620
|
display: flex; background-color: var(--color-gray-0);
|
|
@@ -632,7 +643,7 @@
|
|
|
632
643
|
${this.showBadge?s`<span class="tab-trigger__badge">${this.badgeCount}</span>`:c}
|
|
633
644
|
</div>
|
|
634
645
|
</button>
|
|
635
|
-
`}};C5.styles=
|
|
646
|
+
`}};C5.styles=g`
|
|
636
647
|
:host { display: inline-block; font-family: var(--font-sans); }
|
|
637
648
|
.tab-trigger {
|
|
638
649
|
cursor: pointer; background: none; border: none; display: block;
|
|
@@ -658,7 +669,7 @@
|
|
|
658
669
|
<div class="tab-content" role="tabpanel" tabindex="0" part="tab-content">
|
|
659
670
|
<slot></slot>
|
|
660
671
|
</div>
|
|
661
|
-
`}};a5.styles=
|
|
672
|
+
`}};a5.styles=g`
|
|
662
673
|
:host { display: block; font-family: var(--font-sans); flex: var(--_tab-fill-flex, 0 0 auto); min-height: 0; }
|
|
663
674
|
:host(:not([active])) { display: none; }
|
|
664
675
|
.tab-content { width: 100%; height: var(--_tab-fill-height, auto); overflow-x: hidden; overflow-y: auto; }
|
|
@@ -668,7 +679,7 @@
|
|
|
668
679
|
<div class="tag__label"><slot></slot></div>
|
|
669
680
|
<slot name="closeButton" class="tag__close"></slot>
|
|
670
681
|
</div>
|
|
671
|
-
`}};s5.styles=
|
|
682
|
+
`}};s5.styles=g`
|
|
672
683
|
:host { display: inline-flex; max-width: 100%; font-family: var(--font-sans); }
|
|
673
684
|
.tag {
|
|
674
685
|
font-weight: 500; font-size: 11px; height: 20px; padding-left: 6px; padding-right: 6px;
|
|
@@ -719,7 +730,7 @@
|
|
|
719
730
|
<button class="tag-close__button" part="tag-close" @click=${this.onClick}>
|
|
720
731
|
<anduin-icon name="crossSmall" size="12"></anduin-icon>
|
|
721
732
|
</button>
|
|
722
|
-
`}};d5.styles=
|
|
733
|
+
`}};d5.styles=g`
|
|
723
734
|
:host { display: inline-block; font-family: var(--font-sans); }
|
|
724
735
|
.tag-close__button {
|
|
725
736
|
flex: none; width: 16px; height: 16px; display: flex; align-items: center;
|
|
@@ -728,13 +739,13 @@
|
|
|
728
739
|
}
|
|
729
740
|
.tag-close__button:hover { opacity: 0.7; }
|
|
730
741
|
.tag-close__button:active { opacity: 0.5; }
|
|
731
|
-
`;let t2=d5;customElements.get("anduin-tag")||customElements.define("anduin-tag",l1);customElements.get("anduin-tag-close")||customElements.define("anduin-tag-close",t2);var m3=Object.defineProperty,h4=(l,e,t,i)=>{for(var o=void 0,r=l.length-1,n;r>=0;r--)(n=l[r])&&(o=n(e,t,o)||o);return o&&m3(e,t,o),o};const B2="anduin-tooltip:show",c2="anduin-tooltip:hide",z2="anduin-tooltip:trigger-mounted",S2="anduin-tooltip:content-popup-mounted",O2="anduin-tooltip:content-popup-unmounted",P2="anduin-tooltip:visibility-changed",M3=["top-start","top-center","top-end","right-start","right-center","right-end","bottom-start","bottom-center","bottom-end","left-start","left-center","left-end"];function N5(l,e,t,i,o){switch(i){case"top-start":return{left:l.left,top:l.top-t-o};case"top-center":return{left:l.left+l.width/2-e/2,top:l.top-t-o};case"top-end":return{left:l.left+l.width-e,top:l.top-t-o};case"right-start":return{left:l.right+o,top:l.top};case"right-center":return{left:l.right+o,top:l.top+l.height/2-t/2};case"right-end":return{left:l.right+o,top:l.top+l.height-t};case"bottom-start":return{left:l.left,top:l.bottom+o};case"bottom-center":return{left:l.left+l.width/2-e/2,top:l.bottom+o};case"bottom-end":return{left:l.left+l.width-e,top:l.bottom+o};case"left-start":return{left:l.left-e-o,top:l.top};case"left-center":return{left:l.left-e-o,top:l.top+l.height/2-t/2};case"left-end":return{left:l.left-e-o,top:l.top+l.height-t};default:return{left:0,top:0}}}function U5(l,e){return e.right>=l.left&&e.left<=l.right&&e.top<=l.bottom&&e.bottom>=l.top}function j5(l,e){const t=Math.max(l.left,e.left),i=Math.max(l.top,e.top),o=Math.min(l.right,e.right),r=Math.min(l.bottom,e.bottom);return o<t||r<i?0:(o-t)*(r-i)}function y3(l,e,t,i=8){const o=window.innerWidth,r=window.innerHeight,n={left:0,top:0,right:o,bottom:r},a=e.width,d=e.height;if(!U5({left:l.left,top:l.top,right:l.right,bottom:l.bottom},n))return null;const p=N5(l,a,d,t,i),u=M3.map(f=>({p:f,off:N5(l,a,d,f,i)})).filter(({off:f})=>U5({left:f.left,top:f.top,right:f.left+a,bottom:f.top+d},n));if(u.length===0)return{placement:t,left:Math.round(Math.min(Math.max(p.left,0),o-a)),top:Math.round(Math.min(Math.max(p.top,0),r-d))};u.sort((f,Z)=>{const N={left:f.off.left,top:f.off.top,right:f.off.left+a,bottom:f.off.top+d},w={left:Z.off.left,top:Z.off.top,right:Z.off.left+a,bottom:Z.off.top+d},F=j5(N,n),K=j5(w,n);if(K!==F)return K-F;const j1=Math.abs(f.off.left-p.left)+Math.abs(f.off.top-p.top),G1=Math.abs(Z.off.left-p.left)+Math.abs(Z.off.top-p.top);return j1-G1});const{p:
|
|
742
|
+
`;let t2=d5;customElements.get("anduin-tag")||customElements.define("anduin-tag",l1);customElements.get("anduin-tag-close")||customElements.define("anduin-tag-close",t2);var m3=Object.defineProperty,h4=(l,e,t,i)=>{for(var o=void 0,r=l.length-1,n;r>=0;r--)(n=l[r])&&(o=n(e,t,o)||o);return o&&m3(e,t,o),o};const B2="anduin-tooltip:show",c2="anduin-tooltip:hide",z2="anduin-tooltip:trigger-mounted",S2="anduin-tooltip:content-popup-mounted",O2="anduin-tooltip:content-popup-unmounted",P2="anduin-tooltip:visibility-changed",M3=["top-start","top-center","top-end","right-start","right-center","right-end","bottom-start","bottom-center","bottom-end","left-start","left-center","left-end"];function N5(l,e,t,i,o){switch(i){case"top-start":return{left:l.left,top:l.top-t-o};case"top-center":return{left:l.left+l.width/2-e/2,top:l.top-t-o};case"top-end":return{left:l.left+l.width-e,top:l.top-t-o};case"right-start":return{left:l.right+o,top:l.top};case"right-center":return{left:l.right+o,top:l.top+l.height/2-t/2};case"right-end":return{left:l.right+o,top:l.top+l.height-t};case"bottom-start":return{left:l.left,top:l.bottom+o};case"bottom-center":return{left:l.left+l.width/2-e/2,top:l.bottom+o};case"bottom-end":return{left:l.left+l.width-e,top:l.bottom+o};case"left-start":return{left:l.left-e-o,top:l.top};case"left-center":return{left:l.left-e-o,top:l.top+l.height/2-t/2};case"left-end":return{left:l.left-e-o,top:l.top+l.height-t};default:return{left:0,top:0}}}function U5(l,e){return e.right>=l.left&&e.left<=l.right&&e.top<=l.bottom&&e.bottom>=l.top}function j5(l,e){const t=Math.max(l.left,e.left),i=Math.max(l.top,e.top),o=Math.min(l.right,e.right),r=Math.min(l.bottom,e.bottom);return o<t||r<i?0:(o-t)*(r-i)}function y3(l,e,t,i=8){const o=window.innerWidth,r=window.innerHeight,n={left:0,top:0,right:o,bottom:r},a=e.width,d=e.height;if(!U5({left:l.left,top:l.top,right:l.right,bottom:l.bottom},n))return null;const p=N5(l,a,d,t,i),u=M3.map(f=>({p:f,off:N5(l,a,d,f,i)})).filter(({off:f})=>U5({left:f.left,top:f.top,right:f.left+a,bottom:f.top+d},n));if(u.length===0)return{placement:t,left:Math.round(Math.min(Math.max(p.left,0),o-a)),top:Math.round(Math.min(Math.max(p.top,0),r-d))};u.sort((f,Z)=>{const N={left:f.off.left,top:f.off.top,right:f.off.left+a,bottom:f.off.top+d},w={left:Z.off.left,top:Z.off.top,right:Z.off.left+a,bottom:Z.off.top+d},F=j5(N,n),K=j5(w,n);if(K!==F)return K-F;const j1=Math.abs(f.off.left-p.left)+Math.abs(f.off.top-p.top),G1=Math.abs(Z.off.left-p.left)+Math.abs(Z.off.top-p.top);return j1-G1});const{p:v,off:H}=u[0];return{placement:v,left:Math.round(Math.min(Math.max(H.left,0),o-a)),top:Math.round(Math.min(Math.max(H.top,0),r-d))}}function L2(l){return l.split("-")[0]||"top"}function Z3(l,e,t){let i=!1,o=t.length-1;for(let r=0;r<t.length;r++){const n=t[r][0],a=t[r][1],d=t[o][0],p=t[o][1];a>e!=p>e&&l<(d-n)*(e-a)/(p-a)+n&&(i=!i),o=r}return i}const c5=class c5 extends h{constructor(){super(...arguments),this.disabled=!1,this.placement="top-center",this.triggerElement=null,this.contentPopupElement=null,this.containingBlockLeft=0,this.containingBlockTop=0,this.rafId=0,this.prevTriggerTop=NaN,this.prevTriggerLeft=NaN,this.isVisible=!1}connectedCallback(){super.connectedCallback(),this.addEventListener(z2,e=>{e.stopPropagation(),this.triggerElement=e.detail,this.maybeStartPositionLoop()}),this.addEventListener(S2,e=>{e.stopPropagation(),this.contentPopupElement=e.detail,this.computeContainingBlockOffset(this.contentPopupElement),this.maybeStartPositionLoop()}),this.addEventListener(O2,e=>{e.stopPropagation(),this.stopPositionLoop(),this.contentPopupElement=null}),this.addEventListener(B2,e=>{e.stopPropagation(),!this.disabled&&(this.isVisible=!0,this.broadcastVisibilityChanged(`show:${this.placement}`))}),this.addEventListener(c2,e=>{e.stopPropagation(),this.isVisible=!1,this.stopPositionLoop(),this.broadcastVisibilityChanged("hide")})}updated(e){e.has("disabled")&&this.disabled&&this.isVisible&&(this.isVisible=!1,this.stopPositionLoop(),this.broadcastVisibilityChanged("hide"))}disconnectedCallback(){super.disconnectedCallback(),this.stopPositionLoop(),this.triggerElement=null,this.contentPopupElement=null}maybeStartPositionLoop(){this.isVisible&&this.triggerElement&&this.contentPopupElement&&this.startPositionLoop()}startPositionLoop(){this.stopPositionLoop(),this.prevTriggerTop=NaN,this.prevTriggerLeft=NaN;const e=this.triggerElement,t=this.contentPopupElement,i=this.placement,o=()=>{const r=e.getBoundingClientRect();(r.top!==this.prevTriggerTop||r.left!==this.prevTriggerLeft)&&(this.prevTriggerTop=r.top,this.prevTriggerLeft=r.left,this.positionPopup(t,e,i)),this.rafId=requestAnimationFrame(o)};this.rafId=requestAnimationFrame(o)}stopPositionLoop(){this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=0),this.prevTriggerTop=NaN,this.prevTriggerLeft=NaN}computeContainingBlockOffset(e){const t=e,i=t.style.transform;t.style.transform="none";const o=e.getBoundingClientRect();this.containingBlockLeft=o.left,this.containingBlockTop=o.top,t.style.transform=i}positionPopup(e,t,i){const o=t.getBoundingClientRect(),r=e.getBoundingClientRect(),n=y3(o,r,i,8);if(n){const a=e;a.style.transform=`translate(${n.left-this.containingBlockLeft}px, ${n.top-this.containingBlockTop}px)`;const d=L2(n.placement),p=L2(i);if(d!==p){const u=e.querySelector(".tooltip-arrow");u&&(u.classList.remove(`tooltip-arrow--${p}`),u.classList.add(`tooltip-arrow--${d}`))}}}broadcastVisibilityChanged(e){this.dispatchEvent(new CustomEvent(P2,{detail:e,bubbles:!1,composed:!1}))}render(){return s`<div class="tooltip-root" part="tooltip"><slot></slot></div>`}};c5.styles=g`
|
|
732
743
|
:host { display: inline-block; position: relative; max-width: 100%; font-family: var(--font-sans); }
|
|
733
744
|
.tooltip-root { display: inline-block; position: relative; max-width: 100%; }
|
|
734
|
-
`;let Z1=c5;h4([C({type:Boolean})],Z1.prototype,"disabled");h4([C()],Z1.prototype,"placement");const p5=class p5 extends h{firstUpdated(){requestAnimationFrame(()=>{this.dispatchEvent(new CustomEvent(z2,{detail:this,bubbles:!0,composed:!0}))}),this.addEventListener("pointerenter",()=>{this.dispatchEvent(new CustomEvent(B2,{bubbles:!0,composed:!0}))}),this.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent(c2,{bubbles:!0,composed:!0}))})}render(){return s`<span class="tooltip-trigger" part="tooltip-trigger"><slot></slot></span>`}};p5.styles=
|
|
745
|
+
`;let Z1=c5;h4([C({type:Boolean})],Z1.prototype,"disabled");h4([C()],Z1.prototype,"placement");const p5=class p5 extends h{firstUpdated(){requestAnimationFrame(()=>{this.dispatchEvent(new CustomEvent(z2,{detail:this,bubbles:!0,composed:!0}))}),this.addEventListener("pointerenter",()=>{this.dispatchEvent(new CustomEvent(B2,{bubbles:!0,composed:!0}))}),this.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent(c2,{bubbles:!0,composed:!0}))})}render(){return s`<span class="tooltip-trigger" part="tooltip-trigger"><slot></slot></span>`}};p5.styles=g`
|
|
735
746
|
:host { display: inline-block; max-width: 100%; font-family: var(--font-sans); }
|
|
736
747
|
.tooltip-trigger { display: flex; align-items: center; max-width: 100%; }
|
|
737
|
-
`;let o2=p5;const u5=class u5 extends h{constructor(){super(...arguments),this.graceArea=null,this.triggerEl=null,this.popupEl=null,this.handlePointerMove=e=>{var r,n;if(!this.graceArea)return;const t=e.target,i=((r=this.triggerEl)==null?void 0:r.contains(t))??!1,o=((n=this.popupEl)==null?void 0:n.contains(t))??!1;i||o?this.graceArea=null:Z3(e.clientX,e.clientY,this.graceArea)||(this.graceArea=null,this.dispatchEvent(new CustomEvent(c2,{bubbles:!0,composed:!0})))},this.handleTriggerLeave=e=>{this.triggerEl&&this.popupEl&&this.createGraceArea(this.triggerEl,this.popupEl,e)},this.handleContentLeave=e=>{this.triggerEl&&this.popupEl&&this.createGraceArea(this.popupEl,this.triggerEl,e)}}connectedCallback(){super.connectedCallback();const e=this.closest("anduin-tooltip");e&&e.addEventListener(P2,t=>{const i=t.detail;i.startsWith("show:")?this.showPopup(i.slice(5)):this.hidePopup()})}disconnectedCallback(){super.disconnectedCallback(),this.hidePopup()}createGraceArea(e,t,i){const o=t.getBoundingClientRect(),r=i.clientX,n=i.clientY;this.graceArea=[[r,n],[o.left,o.top],[o.right,o.top],[o.right,o.bottom],[o.left,o.bottom]]}setupGraceAreaListeners(e,t){this.cleanupGraceAreaListeners(),this.triggerEl=e,this.popupEl=t,e.addEventListener("pointerleave",this.handleTriggerLeave),t.addEventListener("pointerleave",this.handleContentLeave),document.addEventListener("pointermove",this.handlePointerMove)}cleanupGraceAreaListeners(){this.triggerEl&&this.triggerEl.removeEventListener("pointerleave",this.handleTriggerLeave),this.popupEl&&this.popupEl.removeEventListener("pointerleave",this.handleContentLeave),document.removeEventListener("pointermove",this.handlePointerMove),this.graceArea=null,this.triggerEl=null,this.popupEl=null}showPopup(e){this.hidePopup();const t=L2(e),i=document.createElement("div");i.className="tooltip-popup",i.setAttribute("role","tooltip");const o=document.createElement("div");o.className=`tooltip-arrow tooltip-arrow--${t}`;const r=document.createElement("div");r.className="tooltip-body",r.appendChild(document.createElement("slot")),i.appendChild(o),i.appendChild(r);const n=this.shadowRoot.querySelector(".tooltip-content-wrapper");n&&n.appendChild(i),this.popupEl=i;const a=this.closest("anduin-tooltip");if(a){const d=a.querySelector("anduin-tooltip-trigger");d&&this.setupGraceAreaListeners(d,i)}this.dispatchEvent(new CustomEvent(S2,{detail:i,bubbles:!0,composed:!0}))}hidePopup(){this.popupEl&&(this.popupEl.remove(),this.popupEl=null,this.dispatchEvent(new CustomEvent(O2,{bubbles:!0,composed:!0}))),this.cleanupGraceAreaListeners()}render(){return s`<div class="tooltip-content-wrapper"></div>`}};u5.styles=
|
|
748
|
+
`;let o2=p5;const u5=class u5 extends h{constructor(){super(...arguments),this.graceArea=null,this.triggerEl=null,this.popupEl=null,this.handlePointerMove=e=>{var r,n;if(!this.graceArea)return;const t=e.target,i=((r=this.triggerEl)==null?void 0:r.contains(t))??!1,o=((n=this.popupEl)==null?void 0:n.contains(t))??!1;i||o?this.graceArea=null:Z3(e.clientX,e.clientY,this.graceArea)||(this.graceArea=null,this.dispatchEvent(new CustomEvent(c2,{bubbles:!0,composed:!0})))},this.handleTriggerLeave=e=>{this.triggerEl&&this.popupEl&&this.createGraceArea(this.triggerEl,this.popupEl,e)},this.handleContentLeave=e=>{this.triggerEl&&this.popupEl&&this.createGraceArea(this.popupEl,this.triggerEl,e)}}connectedCallback(){super.connectedCallback();const e=this.closest("anduin-tooltip");e&&e.addEventListener(P2,t=>{const i=t.detail;i.startsWith("show:")?this.showPopup(i.slice(5)):this.hidePopup()})}disconnectedCallback(){super.disconnectedCallback(),this.hidePopup()}createGraceArea(e,t,i){const o=t.getBoundingClientRect(),r=i.clientX,n=i.clientY;this.graceArea=[[r,n],[o.left,o.top],[o.right,o.top],[o.right,o.bottom],[o.left,o.bottom]]}setupGraceAreaListeners(e,t){this.cleanupGraceAreaListeners(),this.triggerEl=e,this.popupEl=t,e.addEventListener("pointerleave",this.handleTriggerLeave),t.addEventListener("pointerleave",this.handleContentLeave),document.addEventListener("pointermove",this.handlePointerMove)}cleanupGraceAreaListeners(){this.triggerEl&&this.triggerEl.removeEventListener("pointerleave",this.handleTriggerLeave),this.popupEl&&this.popupEl.removeEventListener("pointerleave",this.handleContentLeave),document.removeEventListener("pointermove",this.handlePointerMove),this.graceArea=null,this.triggerEl=null,this.popupEl=null}showPopup(e){this.hidePopup();const t=L2(e),i=document.createElement("div");i.className="tooltip-popup",i.setAttribute("role","tooltip");const o=document.createElement("div");o.className=`tooltip-arrow tooltip-arrow--${t}`;const r=document.createElement("div");r.className="tooltip-body",r.appendChild(document.createElement("slot")),i.appendChild(o),i.appendChild(r);const n=this.shadowRoot.querySelector(".tooltip-content-wrapper");n&&n.appendChild(i),this.popupEl=i;const a=this.closest("anduin-tooltip");if(a){const d=a.querySelector("anduin-tooltip-trigger");d&&this.setupGraceAreaListeners(d,i)}this.dispatchEvent(new CustomEvent(S2,{detail:i,bubbles:!0,composed:!0}))}hidePopup(){this.popupEl&&(this.popupEl.remove(),this.popupEl=null,this.dispatchEvent(new CustomEvent(O2,{bubbles:!0,composed:!0}))),this.cleanupGraceAreaListeners()}render(){return s`<div class="tooltip-content-wrapper"></div>`}};u5.styles=g`
|
|
738
749
|
:host {
|
|
739
750
|
display: contents;
|
|
740
751
|
--tooltip-bg: var(--anduin-tooltip-content-background, var(--color-gray-9));
|
|
@@ -757,7 +768,7 @@
|
|
|
757
768
|
.tooltip-arrow--bottom { top: -4px; left: 50%; transform: translateX(-50%); border-bottom-color: var(--tooltip-bg); border-top: none; }
|
|
758
769
|
.tooltip-arrow--left { right: -4px; top: 50%; transform: translateY(-50%); border-left-color: var(--tooltip-bg); border-right: none; }
|
|
759
770
|
.tooltip-arrow--right { left: -4px; top: 50%; transform: translateY(-50%); border-right-color: var(--tooltip-bg); border-left: none; }
|
|
760
|
-
`;let i2=u5;customElements.get("anduin-tooltip")||customElements.define("anduin-tooltip",Z1);customElements.get("anduin-tooltip-trigger")||customElements.define("anduin-tooltip-trigger",o2);customElements.get("anduin-tooltip-content")||customElements.define("anduin-tooltip-content",i2);var _3=Object.defineProperty,x3=(l,e,t,i)=>{for(var o=void 0,r=l.length-1,n;r>=0;r--)(n=l[r])&&(o=n(e,t,o)||o);return o&&_3(e,t,o),o};const
|
|
771
|
+
`;let i2=u5;customElements.get("anduin-tooltip")||customElements.define("anduin-tooltip",Z1);customElements.get("anduin-tooltip-trigger")||customElements.define("anduin-tooltip-trigger",o2);customElements.get("anduin-tooltip-content")||customElements.define("anduin-tooltip-content",i2);var _3=Object.defineProperty,x3=(l,e,t,i)=>{for(var o=void 0,r=l.length-1,n;r>=0;r--)(n=l[r])&&(o=n(e,t,o)||o);return o&&_3(e,t,o),o};const v4="anduin-well-close:click",h5=class h5 extends h{constructor(){super(...arguments),this.variant="gray"}render(){return s`
|
|
761
772
|
<div class="well well--${this.variant}" part="well">
|
|
762
773
|
<div class="well__icon well__icon--${this.variant}">
|
|
763
774
|
<slot name="icon"></slot>
|
|
@@ -768,7 +779,7 @@
|
|
|
768
779
|
</div>
|
|
769
780
|
<slot name="closeButton" class="well__close"></slot>
|
|
770
781
|
</div>
|
|
771
|
-
`}};h5.styles=
|
|
782
|
+
`}};h5.styles=g`
|
|
772
783
|
:host {
|
|
773
784
|
display: block;
|
|
774
785
|
font-family: var(--font-sans);
|
|
@@ -832,7 +843,7 @@
|
|
|
832
843
|
.well__icon--warning {
|
|
833
844
|
color: var(--color-warning-4);
|
|
834
845
|
}
|
|
835
|
-
`;let I1=h5;x3([C()],I1.prototype,"variant");const
|
|
846
|
+
`;let I1=h5;x3([C()],I1.prototype,"variant");const v5=class v5 extends h{onClick(){this.dispatchEvent(new CustomEvent(v4,{bubbles:!0,composed:!0}))}render(){return s`
|
|
836
847
|
<button
|
|
837
848
|
class="well-close__button"
|
|
838
849
|
part="well-close"
|
|
@@ -840,7 +851,7 @@
|
|
|
840
851
|
>
|
|
841
852
|
<anduin-icon name="cross" size="16"></anduin-icon>
|
|
842
853
|
</button>
|
|
843
|
-
`}};
|
|
854
|
+
`}};v5.styles=g`
|
|
844
855
|
:host {
|
|
845
856
|
display: inline-block;
|
|
846
857
|
font-family: var(--font-sans);
|
|
@@ -864,7 +875,7 @@
|
|
|
864
875
|
.well-close__button:active {
|
|
865
876
|
background-color: var(--color-gray-3);
|
|
866
877
|
}
|
|
867
|
-
`;let l2=
|
|
878
|
+
`;let l2=v5;customElements.get("anduin-well")||customElements.define("anduin-well",I1);customElements.get("anduin-well-close")||customElements.define("anduin-well-close",l2);var w3=Object.defineProperty,a1=(l,e,t,i)=>{for(var o=void 0,r=l.length-1,n;r>=0;r--)(n=l[r])&&(o=n(e,t,o)||o);return o&&w3(e,t,o),o};const r2="anduin-popover:close",g5=class g5 extends h{constructor(){super(...arguments),this.open=!1,this.placement="bottom-start",this.fullWidth=!1,this._visible=!1,this._closing=!1,this._closeTransitionEndHandler=null,this._onOutsideClick=e=>{var t;!this.contains(e.target)&&!((t=this.shadowRoot)!=null&&t.contains(e.target))&&(this.open=!1)},this._onScrollOrResize=()=>{this.open&&this._updatePosition()},this._onPopoverClose=()=>{this.open=!1}}_onTriggerClick(){this.open=!this.open}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._onOutsideClick),window.addEventListener("scroll",this._onScrollOrResize,{passive:!0,capture:!0}),window.addEventListener("resize",this._onScrollOrResize),this.addEventListener(r2,this._onPopoverClose)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._onOutsideClick),window.removeEventListener("scroll",this._onScrollOrResize,{capture:!0}),window.removeEventListener("resize",this._onScrollOrResize),this.removeEventListener(r2,this._onPopoverClose)}updated(e){e.has("open")&&(this.open?(this._cancelCloseAnimation(),this._closing=!1,this._visible=!0,requestAnimationFrame(()=>this._updatePosition())):this._startCloseAnimation())}_cancelCloseAnimation(){this._closeTransitionEndHandler&&this._panelEl&&(this._panelEl.removeEventListener("transitionend",this._closeTransitionEndHandler),this._closeTransitionEndHandler=null),this._closing=!1}_startCloseAnimation(){if(!this._visible)return;this._closing=!0;const e=t=>{var i;t.propertyName==="opacity"&&((i=this._panelEl)==null||i.removeEventListener("transitionend",e),this._closeTransitionEndHandler=null,this._closing=!1,this._visible=!1)};this._closeTransitionEndHandler=e,requestAnimationFrame(()=>{var t;return(t=this._panelEl)==null?void 0:t.addEventListener("transitionend",e)})}_updatePosition(){const e=this._triggerEl,t=this._panelEl;if(!e||!t)return;const i=e.getBoundingClientRect(),o=t.style.transform;t.style.transform="none";const r=t.getBoundingClientRect();t.style.transform=o;const n=t.getBoundingClientRect(),a=4,d=window.innerWidth,p=window.innerHeight,u=8;let v=0,H=0,f="bottom";const Z=!this.placement.startsWith("top"),N=p-i.bottom-a,w=i.top-a,F=N>=n.height,K=w>=n.height,j1=Z?F||N>=w:!K&&F;f=j1?"bottom":"top",H=j1?i.bottom+a:i.top-n.height-a;const G1=this.placement.endsWith("end")?"end":this.placement.endsWith("start")?"start":"center";G1==="start"?v=i.left:G1==="end"?v=i.right-n.width:v=i.left+i.width/2-n.width/2,v=Math.max(u,Math.min(v,d-n.width-u)),H=Math.max(u,Math.min(H,p-n.height-u)),t.style.transform=`translate(${Math.round(v-r.left)}px, ${Math.round(H-r.top)}px)`,t.dataset.side=f}render(){return s`
|
|
868
879
|
<div class="popover__trigger" @click=${this._onTriggerClick} part="trigger">
|
|
869
880
|
<slot name="trigger"></slot>
|
|
870
881
|
</div>
|
|
@@ -873,7 +884,7 @@
|
|
|
873
884
|
<slot></slot>
|
|
874
885
|
</div>
|
|
875
886
|
</div>
|
|
876
|
-
`}};
|
|
887
|
+
`}};g5.styles=g`
|
|
877
888
|
:host { display: inline-block; font-family: var(--font-sans); }
|
|
878
889
|
:host([full-width]) { display: block; width: 100%; }
|
|
879
890
|
|
|
@@ -925,7 +936,7 @@
|
|
|
925
936
|
.popover__panel--open[data-side="top"] .popover__inner {
|
|
926
937
|
transform: none;
|
|
927
938
|
}
|
|
928
|
-
`;let A=
|
|
939
|
+
`;let A=g5;a1([C({type:Boolean,reflect:!0})],A.prototype,"open");a1([C()],A.prototype,"placement");a1([C({type:Boolean,attribute:"full-width",reflect:!0})],A.prototype,"fullWidth");a1([M()],A.prototype,"_visible");a1([M()],A.prototype,"_closing");a1([R(".popover__trigger")],A.prototype,"_triggerEl");a1([R(".popover__panel")],A.prototype,"_panelEl");customElements.get("anduin-popover")||customElements.define("anduin-popover",A);const f5=class f5 extends h{_onClick(){this.dispatchEvent(new CustomEvent(r2,{bubbles:!0,composed:!0}))}render(){return s`<span @click=${this._onClick}><slot></slot></span>`}};f5.styles=g`:host { display: contents; }`;let n2=f5;customElements.get("anduin-popover-close")||customElements.define("anduin-popover-close",n2);var R3=Object.defineProperty,s1=(l,e,t,i)=>{for(var o=void 0,r=l.length-1,n;r>=0;r--)(n=l[r])&&(o=n(e,t,o)||o);return o&&R3(e,t,o),o};const C2="anduin-menu-item:click",H5=class H5 extends h{constructor(){super(...arguments),this.open=!1,this.placement="bottom-start",this._onOutsideClick=e=>{var t;!this.contains(e.target)&&!((t=this.shadowRoot)!=null&&t.contains(e.target))&&(this.open=!1)},this._onItemClick=()=>{this.open=!1},this._onScrollOrResize=()=>{this.open&&this._updatePosition()}}_onTriggerClick(){this.open=!this.open}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._onOutsideClick),this.addEventListener(C2,this._onItemClick),window.addEventListener("scroll",this._onScrollOrResize,{passive:!0,capture:!0}),window.addEventListener("resize",this._onScrollOrResize)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._onOutsideClick),this.removeEventListener(C2,this._onItemClick),window.removeEventListener("scroll",this._onScrollOrResize,{capture:!0}),window.removeEventListener("resize",this._onScrollOrResize)}updated(e){e.has("open")&&this.open&&requestAnimationFrame(()=>this._updatePosition())}_updatePosition(){const e=this._triggerEl,t=this._panelEl;if(!e||!t)return;const i=e.getBoundingClientRect(),o=t.style.transform;t.style.transform="none";const r=t.getBoundingClientRect();t.style.transform=o;const n=t.getBoundingClientRect(),a=4;let d=0,p=0,u="bottom";switch(this.placement){case"bottom-start":d=i.left,p=i.bottom+a,u="bottom";break;case"bottom-end":d=i.right-n.width,p=i.bottom+a,u="bottom";break;case"bottom":d=i.left+i.width/2-n.width/2,p=i.bottom+a,u="bottom";break;case"top-start":d=i.left,p=i.top-n.height-a,u="top";break;case"top-end":d=i.right-n.width,p=i.top-n.height-a,u="top";break;case"top":d=i.left+i.width/2-n.width/2,p=i.top-n.height-a,u="top";break}t.style.transform=`translate(${Math.round(d-r.left)}px, ${Math.round(p-r.top)}px)`,t.dataset.side=u}render(){return s`
|
|
929
940
|
<div class="menu__trigger" @click=${this._onTriggerClick} part="trigger">
|
|
930
941
|
<slot name="trigger"></slot>
|
|
931
942
|
</div>
|
|
@@ -934,7 +945,7 @@
|
|
|
934
945
|
<slot></slot>
|
|
935
946
|
</div>
|
|
936
947
|
</div>
|
|
937
|
-
`}};H5.styles=
|
|
948
|
+
`}};H5.styles=g`
|
|
938
949
|
:host { display: inline-block; font-family: var(--font-sans); }
|
|
939
950
|
|
|
940
951
|
.menu__trigger { display: inline-block; }
|
|
@@ -987,7 +998,7 @@
|
|
|
987
998
|
${this.icon?s`<anduin-icon name="${this.icon}" size="16"></anduin-icon>`:c}
|
|
988
999
|
<span class="menu-item__label"><slot></slot></span>
|
|
989
1000
|
</button>
|
|
990
|
-
`}};V5.styles=
|
|
1001
|
+
`}};V5.styles=g`
|
|
991
1002
|
:host { display: block; width: 100%; font-family: var(--font-sans); }
|
|
992
1003
|
.menu-item {
|
|
993
1004
|
display: flex;
|
|
@@ -1016,7 +1027,7 @@
|
|
|
1016
1027
|
.menu-item__label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
1017
1028
|
anduin-icon { color: var(--color-gray-7); }
|
|
1018
1029
|
.menu-item--danger anduin-icon { color: var(--color-danger-4); }
|
|
1019
|
-
`;let r1=V5;s1([C()],r1.prototype,"icon");s1([C()],r1.prototype,"variant");s1([C({type:Boolean})],r1.prototype,"disabled");customElements.get("anduin-menu")||customElements.define("anduin-menu",q);customElements.get("anduin-menu-item")||customElements.define("anduin-menu-item",r1);var k3=Object.defineProperty,d1=(l,e,t,i)=>{for(var o=void 0,r=l.length-1,n;r>=0;r--)(n=l[r])&&(o=n(e,t,o)||o);return o&&k3(e,t,o),o};const h1="anduin-close",
|
|
1030
|
+
`;let r1=V5;s1([C()],r1.prototype,"icon");s1([C()],r1.prototype,"variant");s1([C({type:Boolean})],r1.prototype,"disabled");customElements.get("anduin-menu")||customElements.define("anduin-menu",q);customElements.get("anduin-menu-item")||customElements.define("anduin-menu-item",r1);var k3=Object.defineProperty,d1=(l,e,t,i)=>{for(var o=void 0,r=l.length-1,n;r>=0;r--)(n=l[r])&&(o=n(e,t,o)||o);return o&&k3(e,t,o),o};const h1="anduin-close",g4="anduin-after-close",g2=300,f2=200,G5=250;var G;const Y=(G=class extends h{constructor(){super(...arguments),this.open=!1,this.heading="",this.hideHeader=!1,this.hideFooter=!1,this.maxWidth="480",this.fullscreen=!1,this._leaving=!1,this.onAnduinClose=e=>{e.target!==this&&e.stopPropagation()}}updated(e){if(e.has("maxWidth")){const t=this.maxWidth,i=G._PRESETS.has(t)?`${t}px`:t;this.style.setProperty("--_modal-width",i)}e.has("open")&&(this.open?(this._leaving=!1,this.classList.add("is-shown")):this.classList.contains("is-shown")&&(this._leaving=!0,setTimeout(()=>{this._leaving=!1,this.classList.remove("is-shown"),this.dispatchEvent(new CustomEvent(g4,{bubbles:!0,composed:!0}))},Math.max(f2,G5))))}dispatch(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))}onOverlayClick(){this.dispatch(h1)}onClose(){this.dispatch(h1)}connectedCallback(){super.connectedCallback(),this.addEventListener(h1,this.onAnduinClose)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(h1,this.onAnduinClose)}render(){const e=this._leaving,t=this.fullscreen;return s`
|
|
1020
1031
|
<div
|
|
1021
1032
|
class=${`overlay${e?" is-leaving":""}`}
|
|
1022
1033
|
@click=${this.onOverlayClick}
|
|
@@ -1052,7 +1063,7 @@
|
|
|
1052
1063
|
${this.hideFooter?c:s`<div class="footer"><slot name="footer"></slot></div>`}
|
|
1053
1064
|
</div>
|
|
1054
1065
|
</div>
|
|
1055
|
-
`}},G.styles=
|
|
1066
|
+
`}},G.styles=g`
|
|
1056
1067
|
:host {
|
|
1057
1068
|
display: none;
|
|
1058
1069
|
font-family: var(--font-sans);
|
|
@@ -1124,7 +1135,7 @@
|
|
|
1124
1135
|
inset: 0;
|
|
1125
1136
|
background: rgba(50, 60, 77, 0.6);
|
|
1126
1137
|
cursor: default;
|
|
1127
|
-
animation: overlayIn ${
|
|
1138
|
+
animation: overlayIn ${g2}ms cubic-bezier(0.2, 0, 0, 1)
|
|
1128
1139
|
forwards;
|
|
1129
1140
|
}
|
|
1130
1141
|
.overlay.is-leaving {
|
|
@@ -1154,7 +1165,7 @@
|
|
|
1154
1165
|
0 8px 24px 0 rgba(29, 41, 57, 0.12),
|
|
1155
1166
|
0 2px 8px 0 rgba(29, 41, 57, 0.08);
|
|
1156
1167
|
flex-shrink: 0;
|
|
1157
|
-
animation: modalIn ${
|
|
1168
|
+
animation: modalIn ${g2}ms cubic-bezier(0.05, 0.7, 0.1, 1)
|
|
1158
1169
|
forwards;
|
|
1159
1170
|
}
|
|
1160
1171
|
.modal.is-leaving {
|
|
@@ -1188,7 +1199,7 @@
|
|
|
1188
1199
|
max-height: 100%;
|
|
1189
1200
|
height: 100%;
|
|
1190
1201
|
box-shadow: none;
|
|
1191
|
-
animation: modalFullscreenIn ${
|
|
1202
|
+
animation: modalFullscreenIn ${g2}ms
|
|
1192
1203
|
cubic-bezier(0.05, 0.7, 0.1, 1) forwards;
|
|
1193
1204
|
}
|
|
1194
1205
|
.modal--fullscreen.is-leaving {
|
|
@@ -1259,7 +1270,7 @@
|
|
|
1259
1270
|
</div>
|
|
1260
1271
|
<span class="radio__label"><slot></slot></span>
|
|
1261
1272
|
</label>
|
|
1262
|
-
`}};L5.styles=
|
|
1273
|
+
`}};L5.styles=g`
|
|
1263
1274
|
:host { display: inline-flex; font-family: var(--font-sans); }
|
|
1264
1275
|
|
|
1265
1276
|
label {
|
|
@@ -1333,7 +1344,7 @@
|
|
|
1333
1344
|
<div class="group group--${this.orientation}" role="radiogroup" part="group">
|
|
1334
1345
|
<slot></slot>
|
|
1335
1346
|
</div>
|
|
1336
|
-
`}};b5.styles=
|
|
1347
|
+
`}};b5.styles=g`
|
|
1337
1348
|
:host { display: block; font-family: var(--font-sans); }
|
|
1338
1349
|
|
|
1339
1350
|
.group {
|
|
@@ -1356,7 +1367,7 @@
|
|
|
1356
1367
|
</svg>
|
|
1357
1368
|
</span>`}
|
|
1358
1369
|
</div>
|
|
1359
|
-
`}};m5.styles=
|
|
1370
|
+
`}};m5.styles=g`
|
|
1360
1371
|
:host { display: inline-flex; }
|
|
1361
1372
|
|
|
1362
1373
|
.avatar {
|
|
@@ -1561,7 +1572,7 @@
|
|
|
1561
1572
|
>
|
|
1562
1573
|
${P3(e.paths)}
|
|
1563
1574
|
</svg>
|
|
1564
|
-
`:c}};M5.styles=
|
|
1575
|
+
`:c}};M5.styles=g`
|
|
1565
1576
|
:host { display: inline-flex; align-items: center; justify-content: center; }
|
|
1566
1577
|
svg { display: block; }
|
|
1567
1578
|
`;let _1=M5;m4([C()],_1.prototype,"type");m4([C({type:Number})],_1.prototype,"size");customElements.get("anduin-file-icon")||customElements.define("anduin-file-icon",_1);var I3=Object.defineProperty,p1=(l,e,t,i)=>{for(var o=void 0,r=l.length-1,n;r>=0;r--)(n=l[r])&&(o=n(e,t,o)||o);return o&&I3(e,t,o),o};const W5={gray:"info",primary:"infoCircleLine",success:"checkCircle",warning:"warning",danger:"error"},T3="anduin-toast:dismiss",y5=class y5 extends h{constructor(){super(...arguments),this.variant="gray",this.heading="",this.description="",this._dismissing=!1}dismiss(){var t;if(this._dismissing)return;this._dismissing=!0;const e=i=>{var o;i.propertyName==="opacity"&&((o=this._toastEl)==null||o.removeEventListener("transitionend",e),this.dispatchEvent(new CustomEvent(T3,{bubbles:!0,composed:!0})))};(t=this._toastEl)==null||t.addEventListener("transitionend",e)}_onClose(){this.dismiss()}render(){const e=W5[this.variant]??W5.gray;return s`
|
|
@@ -1586,7 +1597,7 @@
|
|
|
1586
1597
|
<anduin-icon name="crossSmall" size="16"></anduin-icon>
|
|
1587
1598
|
</button>
|
|
1588
1599
|
</div>
|
|
1589
|
-
`}};y5.styles=
|
|
1600
|
+
`}};y5.styles=g`
|
|
1590
1601
|
:host {
|
|
1591
1602
|
display: block;
|
|
1592
1603
|
font-family: var(--font-sans);
|
|
@@ -1725,7 +1736,7 @@
|
|
|
1725
1736
|
></anduin-toast>
|
|
1726
1737
|
`)}
|
|
1727
1738
|
</div>
|
|
1728
|
-
`}};Z5.styles=
|
|
1739
|
+
`}};Z5.styles=g`
|
|
1729
1740
|
:host {
|
|
1730
1741
|
display: contents;
|
|
1731
1742
|
pointer-events: none;
|
|
@@ -1785,7 +1796,7 @@
|
|
|
1785
1796
|
</div>
|
|
1786
1797
|
<span class="switcher__label"><slot></slot></span>
|
|
1787
1798
|
</label>
|
|
1788
|
-
`}};_5.styles=
|
|
1799
|
+
`}};_5.styles=g`
|
|
1789
1800
|
:host { display: inline-flex; font-family: var(--font-sans); }
|
|
1790
1801
|
|
|
1791
1802
|
label {
|
|
@@ -1848,7 +1859,7 @@
|
|
|
1848
1859
|
color: var(--color-gray-8, #101828);
|
|
1849
1860
|
line-height: 20px;
|
|
1850
1861
|
}
|
|
1851
|
-
`;let w1=_5;M4([C({type:Boolean})],w1.prototype,"checked");M4([C({type:Boolean})],w1.prototype,"disabled");customElements.get("anduin-switcher")||customElements.define("anduin-switcher",w1);var G3=Object.defineProperty,y=(l,e,t,i)=>{for(var o=void 0,r=l.length-1,n;r>=0;r--)(n=l[r])&&(o=n(e,t,o)||o);return o&&G3(e,t,o),o};const M2="anduin-dropdown:change",x5=class x5 extends h{constructor(){super(...arguments),this.value="",this.placeholder="Select...",this.options=[],this.icon="",this.searchable=!0,this.disabled=!1,this.placement="bottom-start",this.appearance="filled",this.variant="gray0",this.size="default",this.fullWidth=!1,this._open=!1,this._query="",this._onOutsideClick=e=>{var t;!this.contains(e.target)&&!((t=this.shadowRoot)!=null&&t.contains(e.target))&&(this._open=!1,this._query="")},this._onScrollOrResize=()=>{this._open&&this._updatePosition()}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._onOutsideClick),window.addEventListener("scroll",this._onScrollOrResize,{passive:!0,capture:!0}),window.addEventListener("resize",this._onScrollOrResize)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._onOutsideClick),window.removeEventListener("scroll",this._onScrollOrResize,{capture:!0}),window.removeEventListener("resize",this._onScrollOrResize)}updated(e){e.has("_open")&&this._open&&requestAnimationFrame(()=>{var t,i;if(this._updatePosition(),this.searchable){const o=(i=(t=this._searchEl)==null?void 0:t.shadowRoot)==null?void 0:i.querySelector("input");o==null||o.focus()}})}_onTriggerClick(){this.disabled||(this._open=!this._open,this._open||(this._query=""))}_onKeyDown(e){var t;e.key==="Escape"&&(this._open=!1,this._query="",(t=this._triggerEl)==null||t.focus())}_onClear(e){e.stopPropagation(),this.value="",this.dispatchEvent(new CustomEvent(M2,{detail:"",bubbles:!0,composed:!0}))}_selectOption(e){this.value=e.value,this._open=!1,this._query="",this.dispatchEvent(new CustomEvent(M2,{detail:e.value,bubbles:!0,composed:!0}))}_updatePosition(){const e=this._triggerEl,t=this._panelEl;if(!e||!t)return;const i=e.getBoundingClientRect(),o=t.style.transform;t.style.transform="none";const r=t.getBoundingClientRect();t.style.transform=o;const n=t.querySelector(".panel__inner");n&&(n.style.minWidth=`${i.width}px`);const a=t.getBoundingClientRect(),d=4,p=window.innerWidth,u=window.innerHeight,
|
|
1862
|
+
`;let w1=_5;M4([C({type:Boolean})],w1.prototype,"checked");M4([C({type:Boolean})],w1.prototype,"disabled");customElements.get("anduin-switcher")||customElements.define("anduin-switcher",w1);var G3=Object.defineProperty,y=(l,e,t,i)=>{for(var o=void 0,r=l.length-1,n;r>=0;r--)(n=l[r])&&(o=n(e,t,o)||o);return o&&G3(e,t,o),o};const M2="anduin-dropdown:change",x5=class x5 extends h{constructor(){super(...arguments),this.value="",this.placeholder="Select...",this.options=[],this.icon="",this.searchable=!0,this.disabled=!1,this.placement="bottom-start",this.appearance="filled",this.variant="gray0",this.size="default",this.fullWidth=!1,this._open=!1,this._query="",this._onOutsideClick=e=>{var t;!this.contains(e.target)&&!((t=this.shadowRoot)!=null&&t.contains(e.target))&&(this._open=!1,this._query="")},this._onScrollOrResize=()=>{this._open&&this._updatePosition()}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._onOutsideClick),window.addEventListener("scroll",this._onScrollOrResize,{passive:!0,capture:!0}),window.addEventListener("resize",this._onScrollOrResize)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._onOutsideClick),window.removeEventListener("scroll",this._onScrollOrResize,{capture:!0}),window.removeEventListener("resize",this._onScrollOrResize)}updated(e){e.has("_open")&&this._open&&requestAnimationFrame(()=>{var t,i;if(this._updatePosition(),this.searchable){const o=(i=(t=this._searchEl)==null?void 0:t.shadowRoot)==null?void 0:i.querySelector("input");o==null||o.focus()}})}_onTriggerClick(){this.disabled||(this._open=!this._open,this._open||(this._query=""))}_onKeyDown(e){var t;e.key==="Escape"&&(this._open=!1,this._query="",(t=this._triggerEl)==null||t.focus())}_onClear(e){e.stopPropagation(),this.value="",this.dispatchEvent(new CustomEvent(M2,{detail:"",bubbles:!0,composed:!0}))}_selectOption(e){this.value=e.value,this._open=!1,this._query="",this.dispatchEvent(new CustomEvent(M2,{detail:e.value,bubbles:!0,composed:!0}))}_updatePosition(){const e=this._triggerEl,t=this._panelEl;if(!e||!t)return;const i=e.getBoundingClientRect(),o=t.style.transform;t.style.transform="none";const r=t.getBoundingClientRect();t.style.transform=o;const n=t.querySelector(".panel__inner");n&&(n.style.minWidth=`${i.width}px`);const a=t.getBoundingClientRect(),d=4,p=window.innerWidth,u=window.innerHeight,v=8,H=u-i.bottom-d,f=i.top-d,N=a.height<=H||H>=f?i.bottom+d:i.top-a.height-d;let w=i.left;this.placement==="bottom-end"?w=i.right-a.width:this.placement==="bottom"&&(w=i.left+i.width/2-a.width/2),w=Math.max(v,Math.min(w,p-a.width-v));const F=Math.max(v,Math.min(N,u-a.height-v));t.style.transform=`translate(${Math.round(w-r.left)}px, ${Math.round(F-r.top)}px)`}get _filteredOptions(){if(!this._query)return this.options;const e=this._query.toLowerCase();return this.options.filter(t=>t.label.toLowerCase().includes(e))}render(){const e=this.options.find(r=>r.value===this.value),t=(e==null?void 0:e.label)??"",i=e?e.icon??"":this.icon,o=this._filteredOptions;return s`
|
|
1852
1863
|
<button
|
|
1853
1864
|
class="trigger trigger--${this.appearance} trigger--${this.variant}${this.size==="small"?" trigger--small":""}${this.value?" has-value":""}"
|
|
1854
1865
|
part="trigger"
|
|
@@ -1901,7 +1912,7 @@
|
|
|
1901
1912
|
</div>
|
|
1902
1913
|
</div>
|
|
1903
1914
|
</div>
|
|
1904
|
-
`}};x5.styles=
|
|
1915
|
+
`}};x5.styles=g`
|
|
1905
1916
|
:host { display: inline-block; font-family: var(--font-sans); }
|
|
1906
1917
|
:host([full-width]) { display: block; width: 100%; }
|
|
1907
1918
|
:host([full-width]) .trigger { width: 100%; }
|
|
@@ -2116,7 +2127,7 @@
|
|
|
2116
2127
|
</div>
|
|
2117
2128
|
${this.hideFooter?c:s`<div class="footer"><slot name="footer"></slot></div>`}
|
|
2118
2129
|
</div>
|
|
2119
|
-
`}};w5.styles=
|
|
2130
|
+
`}};w5.styles=g`
|
|
2120
2131
|
:host {
|
|
2121
2132
|
display: none;
|
|
2122
2133
|
font-family: var(--font-sans);
|
|
@@ -2233,7 +2244,7 @@
|
|
|
2233
2244
|
padding: 16px 20px;
|
|
2234
2245
|
border-top: 1px solid var(--color-gray-3, #e4e7ec);
|
|
2235
2246
|
}
|
|
2236
|
-
`;let $=w5;X([C({type:Boolean,reflect:!0})],$.prototype,"open");X([C()],$.prototype,"heading");X([C({type:Boolean,attribute:"hide-header"})],$.prototype,"hideHeader");X([C({type:Boolean,attribute:"hide-footer"})],$.prototype,"hideFooter");X([C({attribute:"default-width"})],$.prototype,"defaultWidth");X([C({type:Boolean,attribute:"allow-interact-outside"})],$.prototype,"allowInteractOutside");X([M()],$.prototype,"_leaving");X([M()],$.prototype,"_width");customElements.get("anduin-drawer")||customElements.define("anduin-drawer",$);class _4 extends HTMLElement{constructor(){super(...arguments),this._onClick=()=>{this.dispatchEvent(new CustomEvent(s2,{bubbles:!0,composed:!0}))}}connectedCallback(){this.style.display="contents",this.addEventListener("click",this._onClick)}disconnectedCallback(){this.removeEventListener("click",this._onClick)}}customElements.get("anduin-drawer-close")||customElements.define("anduin-drawer-close",_4);var X3=Object.defineProperty,m=(l,e,t,i)=>{for(var o=void 0,r=l.length-1,n;r>=0;r--)(n=l[r])&&(o=n(e,t,o)||o);return o&&X3(e,t,o),o};const W1="anduin-suggestion:change",x4="anduin-suggestion:select",w4="anduin-suggestion:clear",R5=class R5 extends h{constructor(){super(...arguments),this.value="",this.size="default",this.disabled=!1,this.readonly=!1,this.placeholder="",this.inputid="",this.status="",this.startIcon="",this.endIcon="",this.clearable=!1,this.suggestions=[],this.filter=!1,this.hideWhenEmpty=!1,this.emptyText="No suggestions",this._open=!1,this._activeIndex=-1,this._onDocumentMouseDown=e=>{var t;!this.contains(e.target)&&!((t=this.shadowRoot)!=null&&t.contains(e.target))&&(this._open=!1)},this._onScrollOrResize=()=>{this._open&&this._updatePosition()}}connectedCallback(){super.connectedCallback(),document.addEventListener("mousedown",this._onDocumentMouseDown),window.addEventListener("scroll",this._onScrollOrResize,{passive:!0,capture:!0}),window.addEventListener("resize",this._onScrollOrResize);const e=this.closest("anduin-field");e&&e.addEventListener(C1,t=>{var o;const i=t;this.inputid&&this.inputid===i.detail&&((o=this._inputEl)==null||o.focus())})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("mousedown",this._onDocumentMouseDown),window.removeEventListener("scroll",this._onScrollOrResize,{capture:!0}),window.removeEventListener("resize",this._onScrollOrResize)}updated(e){this._inputEl&&this._inputEl.value!==this.value&&(this._inputEl.value=this.value),this._open&&(e.has("_open")||e.has("value"))&&requestAnimationFrame(()=>this._updatePosition())}_normalized(){return this.suggestions.map(e=>typeof e=="string"?{value:e,label:e}:{label:e.value,...e})}get _filteredSuggestions(){const e=this._normalized();if(!this.filter||!this.value)return e;const t=this.value.toLowerCase();return e.filter(i=>(i.label??i.value).toLowerCase().includes(t))}_openPanel(){this.disabled||this.readonly||(this._open=!0,this._activeIndex=-1)}_onFocus(){this._openPanel()}_onInput(){this.value=this._inputEl.value,this._open||this._openPanel(),this._activeIndex=-1,this.dispatchEvent(new CustomEvent(W1,{detail:this.value,bubbles:!0,composed:!0}))}_onKeyDown(e){const t=this._filteredSuggestions;if(e.key==="ArrowDown"){if(e.preventDefault(),!this._open){this._openPanel();return}if(t.length===0)return;this._activeIndex=(this._activeIndex+1)%t.length,this._scrollActiveIntoView()}else if(e.key==="ArrowUp"){if(e.preventDefault(),!this._open){this._openPanel();return}if(t.length===0)return;this._activeIndex=this._activeIndex<=0?t.length-1:this._activeIndex-1,this._scrollActiveIntoView()}else e.key==="Enter"?this._open&&this._activeIndex>=0&&this._activeIndex<t.length&&(e.preventDefault(),this._selectSuggestion(t[this._activeIndex])):e.key==="Escape"&&this._open&&(e.preventDefault(),this._open=!1)}_scrollActiveIntoView(){requestAnimationFrame(()=>{var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector(".option--active");e==null||e.scrollIntoView({block:"nearest"})})}_selectSuggestion(e){var t;this.value=e.value,this._inputEl&&(this._inputEl.value=e.value),this._open=!1,this.dispatchEvent(new CustomEvent(W1,{detail:this.value,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(x4,{detail:e,bubbles:!0,composed:!0})),(t=this._inputEl)==null||t.focus()}_onClear(){var e;this.value="",this._inputEl&&(this._inputEl.value=""),this._activeIndex=-1,this.dispatchEvent(new CustomEvent(W1,{detail:"",bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(w4,{bubbles:!0,composed:!0})),(e=this._inputEl)==null||e.focus()}_updatePosition(){var K;const e=(K=this.shadowRoot)==null?void 0:K.querySelector(".input-wrapper"),t=this._panelEl;if(!e||!t)return;const i=e.getBoundingClientRect(),o=t.style.transform;t.style.transform="none";const r=t.getBoundingClientRect();t.style.transform=o;const n=t.querySelector(".panel__inner");n&&(n.style.minWidth=`${i.width}px`);const a=t.getBoundingClientRect(),d=4,p=window.innerWidth,u=window.innerHeight,
|
|
2247
|
+
`;let $=w5;X([C({type:Boolean,reflect:!0})],$.prototype,"open");X([C()],$.prototype,"heading");X([C({type:Boolean,attribute:"hide-header"})],$.prototype,"hideHeader");X([C({type:Boolean,attribute:"hide-footer"})],$.prototype,"hideFooter");X([C({attribute:"default-width"})],$.prototype,"defaultWidth");X([C({type:Boolean,attribute:"allow-interact-outside"})],$.prototype,"allowInteractOutside");X([M()],$.prototype,"_leaving");X([M()],$.prototype,"_width");customElements.get("anduin-drawer")||customElements.define("anduin-drawer",$);class _4 extends HTMLElement{constructor(){super(...arguments),this._onClick=()=>{this.dispatchEvent(new CustomEvent(s2,{bubbles:!0,composed:!0}))}}connectedCallback(){this.style.display="contents",this.addEventListener("click",this._onClick)}disconnectedCallback(){this.removeEventListener("click",this._onClick)}}customElements.get("anduin-drawer-close")||customElements.define("anduin-drawer-close",_4);var X3=Object.defineProperty,m=(l,e,t,i)=>{for(var o=void 0,r=l.length-1,n;r>=0;r--)(n=l[r])&&(o=n(e,t,o)||o);return o&&X3(e,t,o),o};const W1="anduin-suggestion:change",x4="anduin-suggestion:select",w4="anduin-suggestion:clear",R5=class R5 extends h{constructor(){super(...arguments),this.value="",this.size="default",this.disabled=!1,this.readonly=!1,this.placeholder="",this.inputid="",this.status="",this.startIcon="",this.endIcon="",this.clearable=!1,this.suggestions=[],this.filter=!1,this.hideWhenEmpty=!1,this.emptyText="No suggestions",this._open=!1,this._activeIndex=-1,this._onDocumentMouseDown=e=>{var t;!this.contains(e.target)&&!((t=this.shadowRoot)!=null&&t.contains(e.target))&&(this._open=!1)},this._onScrollOrResize=()=>{this._open&&this._updatePosition()}}connectedCallback(){super.connectedCallback(),document.addEventListener("mousedown",this._onDocumentMouseDown),window.addEventListener("scroll",this._onScrollOrResize,{passive:!0,capture:!0}),window.addEventListener("resize",this._onScrollOrResize);const e=this.closest("anduin-field");e&&e.addEventListener(C1,t=>{var o;const i=t;this.inputid&&this.inputid===i.detail&&((o=this._inputEl)==null||o.focus())})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("mousedown",this._onDocumentMouseDown),window.removeEventListener("scroll",this._onScrollOrResize,{capture:!0}),window.removeEventListener("resize",this._onScrollOrResize)}updated(e){this._inputEl&&this._inputEl.value!==this.value&&(this._inputEl.value=this.value),this._open&&(e.has("_open")||e.has("value"))&&requestAnimationFrame(()=>this._updatePosition())}_normalized(){return this.suggestions.map(e=>typeof e=="string"?{value:e,label:e}:{label:e.value,...e})}get _filteredSuggestions(){const e=this._normalized();if(!this.filter||!this.value)return e;const t=this.value.toLowerCase();return e.filter(i=>(i.label??i.value).toLowerCase().includes(t))}_openPanel(){this.disabled||this.readonly||(this._open=!0,this._activeIndex=-1)}_onFocus(){this._openPanel()}_onInput(){this.value=this._inputEl.value,this._open||this._openPanel(),this._activeIndex=-1,this.dispatchEvent(new CustomEvent(W1,{detail:this.value,bubbles:!0,composed:!0}))}_onKeyDown(e){const t=this._filteredSuggestions;if(e.key==="ArrowDown"){if(e.preventDefault(),!this._open){this._openPanel();return}if(t.length===0)return;this._activeIndex=(this._activeIndex+1)%t.length,this._scrollActiveIntoView()}else if(e.key==="ArrowUp"){if(e.preventDefault(),!this._open){this._openPanel();return}if(t.length===0)return;this._activeIndex=this._activeIndex<=0?t.length-1:this._activeIndex-1,this._scrollActiveIntoView()}else e.key==="Enter"?this._open&&this._activeIndex>=0&&this._activeIndex<t.length&&(e.preventDefault(),this._selectSuggestion(t[this._activeIndex])):e.key==="Escape"&&this._open&&(e.preventDefault(),this._open=!1)}_scrollActiveIntoView(){requestAnimationFrame(()=>{var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector(".option--active");e==null||e.scrollIntoView({block:"nearest"})})}_selectSuggestion(e){var t;this.value=e.value,this._inputEl&&(this._inputEl.value=e.value),this._open=!1,this.dispatchEvent(new CustomEvent(W1,{detail:this.value,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(x4,{detail:e,bubbles:!0,composed:!0})),(t=this._inputEl)==null||t.focus()}_onClear(){var e;this.value="",this._inputEl&&(this._inputEl.value=""),this._activeIndex=-1,this.dispatchEvent(new CustomEvent(W1,{detail:"",bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(w4,{bubbles:!0,composed:!0})),(e=this._inputEl)==null||e.focus()}_updatePosition(){var K;const e=(K=this.shadowRoot)==null?void 0:K.querySelector(".input-wrapper"),t=this._panelEl;if(!e||!t)return;const i=e.getBoundingClientRect(),o=t.style.transform;t.style.transform="none";const r=t.getBoundingClientRect();t.style.transform=o;const n=t.querySelector(".panel__inner");n&&(n.style.minWidth=`${i.width}px`);const a=t.getBoundingClientRect(),d=4,p=window.innerWidth,u=window.innerHeight,v=8,H=u-i.bottom-d,f=i.top-d,N=a.height<=H||H>=f?i.bottom+d:i.top-a.height-d;let w=i.left;w=Math.max(v,Math.min(w,p-a.width-v));const F=Math.max(v,Math.min(N,u-a.height-v));t.style.transform=`translate(${Math.round(w-r.left)}px, ${Math.round(F-r.top)}px)`}render(){const e=this.size==="small"?"input--small":this.size==="large"?"input--large":"input--default",t=this.status?`input--${this.status}`:"",i=!!this.startIcon,o=!!this.endIcon||this.clearable&&!!this.value,r=this.clearable&&!!this.value&&!this.disabled&&!this.readonly,n=this.size==="small"?"12":this.size==="large"?"20":"16",a=this.size==="small"?"10":this.size==="large"?"16":"14",d=this._filteredSuggestions,p=this._open&&(!this.hideWhenEmpty||d.length>0);return s`
|
|
2237
2248
|
<div class="input-wrapper">
|
|
2238
2249
|
${i?s`
|
|
2239
2250
|
<span class="input__start">
|
|
@@ -2279,12 +2290,12 @@
|
|
|
2279
2290
|
<div class="panel${p?" panel--open":""}" part="panel">
|
|
2280
2291
|
<div class="panel__inner" role="listbox">
|
|
2281
2292
|
<div class="options">
|
|
2282
|
-
${d.length?d.map((u,
|
|
2293
|
+
${d.length?d.map((u,v)=>s`
|
|
2283
2294
|
<div
|
|
2284
|
-
class="option${
|
|
2295
|
+
class="option${v===this._activeIndex?" option--active":""}"
|
|
2285
2296
|
role="option"
|
|
2286
|
-
aria-selected=${
|
|
2287
|
-
@mouseenter=${()=>{this._activeIndex=
|
|
2297
|
+
aria-selected=${v===this._activeIndex}
|
|
2298
|
+
@mouseenter=${()=>{this._activeIndex=v}}
|
|
2288
2299
|
@mousedown=${H=>{H.preventDefault(),this._selectSuggestion(u)}}
|
|
2289
2300
|
>
|
|
2290
2301
|
${u.icon?s`<anduin-icon name=${u.icon} size="16"></anduin-icon>`:c}
|
|
@@ -2294,7 +2305,7 @@
|
|
|
2294
2305
|
</div>
|
|
2295
2306
|
</div>
|
|
2296
2307
|
</div>
|
|
2297
|
-
`}};R5.styles=
|
|
2308
|
+
`}};R5.styles=g`
|
|
2298
2309
|
:host { display: block; font-family: var(--font-sans); position: relative; }
|
|
2299
2310
|
|
|
2300
2311
|
.input-wrapper { position: relative; display: flex; align-items: center; }
|
|
@@ -2406,4 +2417,4 @@
|
|
|
2406
2417
|
color: var(--color-gray-5, #98a1b2);
|
|
2407
2418
|
text-align: center;
|
|
2408
2419
|
}
|
|
2409
|
-
`;let V=R5;m([C()],V.prototype,"value");m([C()],V.prototype,"size");m([C({type:Boolean})],V.prototype,"disabled");m([C({type:Boolean})],V.prototype,"readonly");m([C()],V.prototype,"placeholder");m([C()],V.prototype,"inputid");m([C()],V.prototype,"status");m([C({attribute:"start-icon"})],V.prototype,"startIcon");m([C({attribute:"end-icon"})],V.prototype,"endIcon");m([C({type:Boolean})],V.prototype,"clearable");m([C({attribute:!1})],V.prototype,"suggestions");m([C({type:Boolean})],V.prototype,"filter");m([C({type:Boolean,attribute:"hide-when-empty"})],V.prototype,"hideWhenEmpty");m([C({attribute:"empty-text"})],V.prototype,"emptyText");m([M()],V.prototype,"_open");m([M()],V.prototype,"_activeIndex");m([R("input")],V.prototype,"_inputEl");m([R(".panel")],V.prototype,"_panelEl");customElements.get("anduin-suggestion")||customElements.define("anduin-suggestion",V);exports.AnduinAvatar=B;exports.AnduinBadge=S1;exports.AnduinBadgeCount=V1;exports.AnduinButton=b;exports.AnduinCallout=O1;exports.AnduinCheckbox=D;exports.AnduinDivider=L1;exports.AnduinDot=P1;exports.AnduinDrawer=$;exports.AnduinDrawerClose=_4;exports.AnduinDropdown=L;exports.AnduinField=D1;exports.AnduinFieldDescription=J1;exports.AnduinFieldError=Q1;exports.AnduinFieldGroup=e2;exports.AnduinFieldLabel=m1;exports.AnduinFileIcon=_1;exports.AnduinIcon=H1;exports.AnduinInput=_;exports.AnduinLoadingState=F1;exports.AnduinMenu=q;exports.AnduinMenuItem=r1;exports.AnduinModal=f4;exports.AnduinModalClose=H4;exports.AnduinPopover=A;exports.AnduinPopoverClose=n2;exports.AnduinProgress=b1;exports.AnduinRadio=P;exports.AnduinRadioGroup=n1;exports.AnduinSkeleton=S;exports.AnduinSparkleSpinner=f1;exports.AnduinSpinner=
|
|
2420
|
+
`;let V=R5;m([C()],V.prototype,"value");m([C()],V.prototype,"size");m([C({type:Boolean})],V.prototype,"disabled");m([C({type:Boolean})],V.prototype,"readonly");m([C()],V.prototype,"placeholder");m([C()],V.prototype,"inputid");m([C()],V.prototype,"status");m([C({attribute:"start-icon"})],V.prototype,"startIcon");m([C({attribute:"end-icon"})],V.prototype,"endIcon");m([C({type:Boolean})],V.prototype,"clearable");m([C({attribute:!1})],V.prototype,"suggestions");m([C({type:Boolean})],V.prototype,"filter");m([C({type:Boolean,attribute:"hide-when-empty"})],V.prototype,"hideWhenEmpty");m([C({attribute:"empty-text"})],V.prototype,"emptyText");m([M()],V.prototype,"_open");m([M()],V.prototype,"_activeIndex");m([R("input")],V.prototype,"_inputEl");m([R(".panel")],V.prototype,"_panelEl");customElements.get("anduin-suggestion")||customElements.define("anduin-suggestion",V);exports.AnduinAvatar=B;exports.AnduinBadge=S1;exports.AnduinBadgeCount=V1;exports.AnduinButton=b;exports.AnduinCallout=O1;exports.AnduinCheckbox=D;exports.AnduinDivider=L1;exports.AnduinDot=P1;exports.AnduinDrawer=$;exports.AnduinDrawerClose=_4;exports.AnduinDropdown=L;exports.AnduinField=D1;exports.AnduinFieldDescription=J1;exports.AnduinFieldError=Q1;exports.AnduinFieldGroup=e2;exports.AnduinFieldLabel=m1;exports.AnduinFileIcon=_1;exports.AnduinIcon=H1;exports.AnduinInput=_;exports.AnduinLoadingState=F1;exports.AnduinMenu=q;exports.AnduinMenuItem=r1;exports.AnduinModal=f4;exports.AnduinModalClose=H4;exports.AnduinPopover=A;exports.AnduinPopoverClose=n2;exports.AnduinProgress=b1;exports.AnduinRadio=P;exports.AnduinRadioGroup=n1;exports.AnduinSkeleton=S;exports.AnduinSparkleSpinner=f1;exports.AnduinSpinner=g1;exports.AnduinSuggestion=V;exports.AnduinSwitcher=w1;exports.AnduinTabContent=y1;exports.AnduinTabTrigger=O;exports.AnduinTabs=i1;exports.AnduinTabsList=M1;exports.AnduinTag=l1;exports.AnduinTagClose=t2;exports.AnduinTextarea=E;exports.AnduinToast=I;exports.AnduinToaster=x1;exports.AnduinTooltip=Z1;exports.AnduinTooltipContent=i2;exports.AnduinTooltipTrigger=o2;exports.AnduinWell=I1;exports.AnduinWellClose=l2;exports.BADGE_STYLES=w2;exports.CHECKBOX_CHANGE=s4;exports.DRAWER_AFTER_CLOSE_EVENT=Z4;exports.DRAWER_CLOSE_EVENT=s2;exports.DROPDOWN_CHANGE=M2;exports.FIELD_LABEL_CLICK=E2;exports.FIELD_LABEL_CLICK_COORDINATED=C1;exports.FILE_ICONS=L4;exports.INPUT_CHANGE=V2;exports.INPUT_CLEAR=d4;exports.MENU_ITEM_CLICK=C2;exports.MODAL_AFTER_CLOSE_EVENT=g4;exports.MODAL_CLOSE_EVENT=h1;exports.POPOVER_CLOSE=r2;exports.RADIO_CHANGE=a2;exports.RADIO_GROUP_CHANGE=V4;exports.SUGGESTION_CHANGE=W1;exports.SUGGESTION_CLEAR=w4;exports.SUGGESTION_SELECT=x4;exports.SWITCHER_CHANGE=y4;exports.TAB_CHANGE=p4;exports.TAB_TRIGGER_CLICK=$2;exports.TAB_VALUE_CHANGED=U1;exports.TAG_CLOSE_CLICK=u4;exports.TEXTAREA_CHANGE=c4;exports.TOOLTIP_CONTENT_POPUP_MOUNTED=S2;exports.TOOLTIP_CONTENT_POPUP_UNMOUNTED=O2;exports.TOOLTIP_HIDE=c2;exports.TOOLTIP_SHOW=B2;exports.TOOLTIP_TRIGGER_MOUNTED=z2;exports.TOOLTIP_VISIBILITY_CHANGED=P2;exports.WELL_CLOSE_CLICK=v4;exports.getBadgeVariantClass=R2;exports.resolveFileIcon=b4;exports.toast=N3;
|