@warp-ds/elements 2.10.0-next.22 → 2.10.0-next.24
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/custom-elements.json +100 -18
- package/dist/docs/modal/api.md +3 -1
- package/dist/docs/modal/modal.md +82 -9
- package/dist/docs/modal/styling.md +75 -0
- package/dist/docs/modal/usage.md +4 -8
- package/dist/index.d.ts +134 -4
- package/dist/packages/modal/modal.d.ts +17 -2
- package/dist/packages/modal/modal.js +176 -129
- package/dist/packages/modal/modal.js.map +4 -4
- package/dist/packages/modal/modal.stories.d.ts +5 -4
- package/dist/packages/modal/modal.stories.js +41 -38
- package/dist/packages/modal/styles.d.ts +1 -0
- package/dist/packages/modal/styles.js +171 -0
- package/dist/packages/modal-footer/modal-footer.d.ts +5 -1
- package/dist/packages/modal-footer/modal-footer.js +25 -22
- package/dist/packages/modal-footer/modal-footer.js.map +4 -4
- package/dist/packages/modal-footer/styles.d.ts +1 -0
- package/dist/packages/modal-footer/styles.js +22 -0
- package/dist/packages/modal-header/modal-header.d.ts +12 -5
- package/dist/packages/modal-header/modal-header.js +149 -141
- package/dist/packages/modal-header/modal-header.js.map +4 -4
- package/dist/packages/modal-header/styles.d.ts +1 -0
- package/dist/packages/modal-header/styles.js +96 -0
- package/dist/packages/textarea/react.d.ts +1 -1
- package/dist/packages/textarea/textarea.d.ts +2 -4
- package/dist/packages/textarea/textarea.js.map +2 -2
- package/dist/packages/textarea/textarea.react.stories.d.ts +19 -2
- package/dist/packages/textarea/textarea.react.stories.js +17 -0
- package/dist/packages/textfield/textfield.react.stories.d.ts +30 -0
- package/dist/packages/textfield/textfield.react.stories.js +32 -0
- package/dist/web-types.json +50 -4
- package/eik/index.js +16 -16
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var pe=Object.defineProperty;var be=Object.getOwnPropertyDescriptor;var d=(o,e,r,t)=>{for(var a=t>1?void 0:t?be(e,r):e,s=o.length-1,i;s>=0;s--)(i=o[s])&&(a=(t?i(e,r,a):i(a))||a);return t&&a&&pe(e,r,a),a};var R=(o,e)=>({dx:o.left-e.left,dy:o.top-e.top,dw:o.width/e.width,dh:o.height/e.height,first:o,last:e}),B=({dx:o,dy:e})=>[{transform:`translate(${o}px, ${e}px)`},{transform:"none"}],I={easing:"ease",duration:300};var L=!1,ge=typeof window<"u";if(ge){let o=window.matchMedia("(prefers-reduced-motion: reduce)"),e=({matches:r})=>L=r;o.addEventListener&&o.addEventListener("change",e),e(o)}var k=class{first;last;el;constructor(e,{animation:r={},keyframes:t,respectReduceMotion:a=!0}={}){this.el=e,this.first={},this.last={},this.userAnimationOptions=r,this.keyframeGenerator=t||B,this.shouldReduceMotion=a}async when(e){this.prep();let r=await e();return await this.play(),r}prep(){this.first=this.el.getBoundingClientRect()}async play(){if(this.last=this.el.getBoundingClientRect(),!this.el.animate)return;await this.el.animate(this.keyframes,this.animationOptions).finished}get keyframes(){return this.keyframeGenerator(R(this.first,this.last))}get defaults(){return I}get mergedOptions(){return{...this.defaults,...this.userAnimationOptions}}get animationOptions(){return this.shouldReduceMotion?L?{...this.mergedOptions,duration:0}:this.mergedOptions:this.mergedOptions}};var b=o=>typeof o=="string",he=o=>typeof o=="function",X=new Map,V="en";function O(o){return[...Array.isArray(o)?o:[o],V]}function P(o,e,r){let t=O(o);r||(r="default");let a;if(typeof r=="string")switch(a={day:"numeric",month:"short",year:"numeric"},r){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=r;return y(()=>_("date",t,r),()=>new Intl.DateTimeFormat(t,a)).format(b(e)?new Date(e):e)}function ue(o,e,r){let t;if(r||(r="default"),typeof r=="string")switch(t={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":t.timeZoneName="short";break;case"short":delete t.second}else t=r;return P(o,e,t)}function M(o,e,r){let t=O(o);return y(()=>_("number",t,r),()=>new Intl.NumberFormat(t,r)).format(e)}function Z(o,e,r,{offset:t=0,...a}){let s=O(o),i=e?y(()=>_("plural-ordinal",s),()=>new Intl.PluralRules(s,{type:"ordinal"})):y(()=>_("plural-cardinal",s),()=>new Intl.PluralRules(s,{type:"cardinal"}));return a[r]??a[i.select(r-t)]??a.other}function y(o,e){let r=o(),t=X.get(r);return t||(t=e(),X.set(r,t)),t}function _(o,e,r){let t=e.join("-");return`${o}-${t}-${JSON.stringify(r)}`}var G=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,q=o=>o.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(e,r,t)=>{if(r){let a=parseInt(r,16);return String.fromCharCode(a)}else{let a=parseInt(t,16);return String.fromCharCode(a)}}),J="%__lingui_octothorpe__%",me=(o,e,r={})=>{let t=e||o,a=i=>typeof i=="object"?i:r[i],s=(i,n)=>{let l=Object.keys(r).length?a("number"):void 0,h=M(t,i,l);return n.replace(new RegExp(J,"g"),h)};return{plural:(i,n)=>{let{offset:l=0}=n,h=Z(t,!1,i,n);return s(i-l,h)},selectordinal:(i,n)=>{let{offset:l=0}=n,h=Z(t,!0,i,n);return s(i-l,h)},select:ve,number:(i,n)=>M(t,i,a(n)||{style:n}),date:(i,n)=>P(t,i,a(n)||n),time:(i,n)=>ue(t,i,a(n)||n)}},ve=(o,e)=>e[o]??e.other;function we(o,e,r){return(t={},a)=>{let s=me(e,r,a),i=(l,h=!1)=>Array.isArray(l)?l.reduce((w,f)=>{if(f==="#"&&h)return w+J;if(b(f))return w+f;let[N,u,A]=f,E={};u==="plural"||u==="selectordinal"||u==="select"?Object.entries(A).forEach(([C,de])=>{E[C]=i(de,u==="plural"||u==="selectordinal")}):E=A;let x;if(u){let C=s[u];x=C(t[N],E)}else x=t[N];return x==null?w:w+x},""):l,n=i(o);return b(n)&&G.test(n)?q(n):b(n)?n:n?String(n):""}}var fe=Object.defineProperty,xe=(o,e,r)=>e in o?fe(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,ke=(o,e,r)=>(xe(o,typeof e!="symbol"?e+"":e,r),r),T=class{constructor(){ke(this,"_events",{})}on(e,r){var t;return(t=this._events)[e]??(t[e]=[]),this._events[e].push(r),()=>this.removeListener(e,r)}removeListener(e,r){let t=this._getListeners(e);if(!t)return;let a=t.indexOf(r);~a&&t.splice(a,1)}emit(e,...r){let t=this._getListeners(e);t&&t.map(a=>a.apply(this,r))}_getListeners(e){let r=this._events[e];return Array.isArray(r)?r:!1}},ye=Object.defineProperty,_e=(o,e,r)=>e in o?ye(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,m=(o,e,r)=>(_e(o,typeof e!="symbol"?e+"":e,r),r),S=class extends T{constructor(e){super(),m(this,"_locale",""),m(this,"_locales"),m(this,"_localeData",{}),m(this,"_messages",{}),m(this,"_missing"),m(this,"_messageCompiler"),m(this,"t",this._.bind(this)),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),e.localeData!=null&&this.loadLocaleData(e.localeData),(typeof e.locale=="string"||e.locales)&&this.activate(e.locale??V,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(e,r){let t=this._localeData[e];t?Object.assign(t,r):this._localeData[e]=r}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,r){typeof e=="string"?this._loadLocaleData(e,r):Object.keys(e).forEach(t=>this._loadLocaleData(t,e[t])),this.emit("change")}_load(e,r){let t=this._messages[e];t?Object.assign(t,r):this._messages[e]=r}load(e,r){typeof e=="string"&&typeof r=="object"?this._load(e,r):Object.entries(e).forEach(([t,a])=>this._load(t,a)),this.emit("change")}loadAndActivate({locale:e,locales:r,messages:t}){this._locale=e,this._locales=r||void 0,this._messages[this._locale]=t,this.emit("change")}activate(e,r){this._locale=e,this._locales=r,this.emit("change")}_(e,r,t){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let a=t?.message;e||(e=""),b(e)||(r=e.values||r,a=e.message,e=e.id);let s=this.messages[e],i=s===void 0,n=this._missing;if(n&&i)return he(n)?n(this._locale,e):n;i&&this.emit("missing",{id:e,locale:this._locale});let l=s||a||e;return b(l)&&(this._messageCompiler?l=this._messageCompiler(l):console.warn(`Uncompiled message detected! Message:
|
|
2
2
|
|
|
3
3
|
> ${l}
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ That means you use raw catalog or your catalog doesn't have a translation for th
|
|
|
6
6
|
ICU features such as interpolation and plurals will not work properly for that message.
|
|
7
7
|
|
|
8
8
|
Please compile your catalog first.
|
|
9
|
-
`)),
|
|
9
|
+
`)),b(l)&&G.test(l)?q(l):b(l)?l:we(l,this._locale,this._locales)(r,t?.formats)}date(e,r){return P(this._locales||this._locale,e,r)}number(e,r){return M(this._locales||this._locale,e,r)}};function ze(o={}){return new S(o)}var c=ze();import{html as F,LitElement as Re,nothing as ce}from"lit";import{property as j,query as Be,state as Ie}from"lit/decorators.js";import{html as Ce,LitElement as Le}from"lit";import{property as $,state as Me}from"lit/decorators.js";import{classMap as Te}from"lit/directives/class-map.js";import{css as Ee}from"lit";var U=Ee`
|
|
10
10
|
:host {
|
|
11
11
|
display: inline-block;
|
|
12
12
|
}
|
|
@@ -30,13 +30,13 @@ Please compile your catalog first.
|
|
|
30
30
|
.w-icon--l {
|
|
31
31
|
--w-icon-size: 32px;
|
|
32
32
|
}
|
|
33
|
-
`;var
|
|
34
|
-
class="${
|
|
33
|
+
`;var D=new Map,Se='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>';function Oe(o,e={}){let r=e.responseParser??(t=>t.text());return D.has(o)||D.set(o,fetch(o).then(r)),D.get(o)}var g=class extends Le{constructor(){super(...arguments);this.locale=document.documentElement.lang||"en";this.svg=null}async fetchIcon(r){let t=`https://assets.finn.no/pkg/eikons/~1/${this.locale}/${r}.svg`;try{let a=await Oe(t);return new DOMParser().parseFromString(a,"text/html").body.querySelector("svg")}catch{return null}}firstUpdated(){this.loadIcon()}updated(r){(r.has("name")||r.has("locale"))&&this.loadIcon()}async loadIcon(){if(!this.name){this.svg=null;return}let r=await this.fetchIcon(this.name);r||(r=new DOMParser().parseFromString(Se,"text/html").body.firstElementChild),this.svg=r}render(){let r=this.size||"medium",t=this.name||"",a={"w-icon":!0,"w-icon--s":r==="small","w-icon--m":r==="medium","w-icon--l":r==="large"},s=typeof r=="string"&&r.endsWith("px")?`--w-icon-size: ${r};`:"";return Ce`<div
|
|
34
|
+
class="${Te(a)}"
|
|
35
35
|
style="${s}"
|
|
36
36
|
part="w-${t.toLowerCase()}"
|
|
37
37
|
>
|
|
38
38
|
${this.svg}
|
|
39
|
-
</div>`}};g.styles=[U],d([$({type:String,reflect:!0})],g.prototype,"name",2),d([$({type:String,reflect:!0})],g.prototype,"size",2),d([$({type:String,reflect:!0,useDefault:!0})],g.prototype,"locale",2),d([
|
|
39
|
+
</div>`}};g.styles=[U],d([$({type:String,reflect:!0})],g.prototype,"name",2),d([$({type:String,reflect:!0})],g.prototype,"size",2),d([$({type:String,reflect:!0,useDefault:!0})],g.prototype,"locale",2),d([Me()],g.prototype,"svg",2);customElements.get("w-icon")||customElements.define("w-icon",g);var Pe=["en","nb","fi","da","sv"],Y="en",z=o=>Pe.find(e=>o===e||o.toLowerCase().includes(e))||Y;function v(){if(typeof window>"u"){let o=process.env.NMP_LANGUAGE||Intl.DateTimeFormat().resolvedOptions().locale;return z(o)}try{let o=K(document);if(o)return z(o);let e=Fe();if(e)return z(e);let r=K(ee());return r?z(r):Y}catch(o){return console.warn("could not detect locale, falling back to source locale",o),Y}}var Q=(o,e,r,t,a)=>{c.load("en",o),c.load("nb",e),c.load("fi",r),c.load("da",t),c.load("sv",a);let s=v();c.activate(s),W(),De()},$e="warp-i18n-change";function W(){typeof window>"u"||window.dispatchEvent(new Event($e))}var H=!1;function De(){if(H||typeof window>"u"||!document?.documentElement)return;H=!0;let o=()=>{let a=v();c.locale!==a&&(c.activate(a),W())},e=new MutationObserver(a=>{for(let s of a)if(s.type==="attributes"&&s.attributeName==="lang"){o();break}});e.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]});let r=ee();r&&r.documentElement&&r!==document&&e.observe(r.documentElement,{attributes:!0,attributeFilter:["lang"]});let t=Ye();t&&e.observe(t,{attributes:!0,attributeFilter:["lang"]})}function ee(){try{return window.parent?.document??null}catch{return null}}function K(o){try{return o?.documentElement?.lang??""}catch{return""}}function Ye(){try{return window.frameElement??null}catch{return null}}function Fe(){try{return window.frameElement?.getAttribute?.("lang")??""}catch{return""}}var re=JSON.parse('{"modal.aria.back":["Tilbage"],"modal.aria.close":["Luk"]}');var oe=JSON.parse('{"modal.aria.back":["Back"],"modal.aria.close":["Close"]}');var te=JSON.parse('{"modal.aria.back":["Takaisin"],"modal.aria.close":["Sulje"]}');var ae=JSON.parse('{"modal.aria.back":["Tilbake"],"modal.aria.close":["Lukk"]}');var ie=JSON.parse('{"modal.aria.back":["Tillbaka"],"modal.aria.close":["St\xE4ng"]}');var ne=o=>class extends o{constructor(){super(...arguments);this.patchClose=!0;this._close=null}close(){this._close()}};import{css as je}from"lit";import{unsafeCSS as Ne}from"lit";var se=je`
|
|
40
40
|
*,
|
|
41
41
|
:before,
|
|
42
42
|
:after {
|
|
@@ -309,7 +309,7 @@ Please compile your catalog first.
|
|
|
309
309
|
svg {
|
|
310
310
|
pointer-events: none;
|
|
311
311
|
}
|
|
312
|
-
`,
|
|
312
|
+
`,vr=Ne(`*, :before, :after {
|
|
313
313
|
--w-rotate: 0;
|
|
314
314
|
--w-rotate-x: 0;
|
|
315
315
|
--w-rotate-y: 0;
|
|
@@ -2475,140 +2475,148 @@ Please compile your catalog first.
|
|
|
2475
2475
|
display: none
|
|
2476
2476
|
}
|
|
2477
2477
|
}
|
|
2478
|
-
`);
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2478
|
+
`);import{css as Ae}from"lit";var le=Ae`
|
|
2479
|
+
:host {
|
|
2480
|
+
--_font-size: var(--w-c-modal-header-font-size, var(--w-font-size-l));
|
|
2481
|
+
--_line-height: var(--w-c-modal-header-line-height, var(--w-line-height-l));
|
|
2482
|
+
--_title-margin: 0 0 6px 0;
|
|
2483
|
+
--_title-padding: 22px 0 0 16px;
|
|
2484
|
+
--_close-button-top: 14px;
|
|
2485
|
+
--_close-button-right: 0px;
|
|
2486
|
+
--_header-margin-bottom: var(--w-c-modal-header-margin-bottom, 8px);
|
|
2487
|
+
}
|
|
2488
|
+
|
|
2489
|
+
@media (min-width: 480px) {
|
|
2490
|
+
:host {
|
|
2491
|
+
--_title-padding: 22px 0 0 32px;
|
|
2492
|
+
--_close-button-right: 14px;
|
|
2493
|
+
}
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
[part="header"] {
|
|
2497
|
+
display: grid;
|
|
2498
|
+
grid-template:
|
|
2499
|
+
"top top top"
|
|
2500
|
+
"title title title";
|
|
2501
|
+
margin-bottom: var(--_header-margin-bottom);
|
|
2502
|
+
}
|
|
2503
|
+
|
|
2504
|
+
[part="header"][show-back]:not([show-close]) {
|
|
2505
|
+
grid-template:
|
|
2506
|
+
"top top top"
|
|
2507
|
+
"back title title";
|
|
2508
|
+
}
|
|
2509
|
+
|
|
2510
|
+
[part="header"][show-close]:not([show-back]) {
|
|
2511
|
+
grid-template:
|
|
2512
|
+
"top top top"
|
|
2513
|
+
"title title close";
|
|
2514
|
+
}
|
|
2515
|
+
|
|
2516
|
+
[part="header"][show-back][show-close] {
|
|
2517
|
+
grid-template:
|
|
2518
|
+
"top top top"
|
|
2519
|
+
"back title close" / 44px 1fr 44px;
|
|
2520
|
+
}
|
|
2521
|
+
|
|
2522
|
+
[part="top"]::slotted(*) {
|
|
2523
|
+
grid-area: top;
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2526
|
+
[part="title"] {
|
|
2527
|
+
grid-area: title;
|
|
2528
|
+
|
|
2529
|
+
margin: var(--_title-margin);
|
|
2530
|
+
padding: var(--_title-padding);
|
|
2531
|
+
|
|
2532
|
+
/* t3 */
|
|
2533
|
+
font-weight: 700;
|
|
2534
|
+
font-size: var(--_font-size);
|
|
2535
|
+
line-height: var(--_line-height);
|
|
2536
|
+
}
|
|
2537
|
+
|
|
2538
|
+
[part="header"][show-back] [part="title"] {
|
|
2539
|
+
text-align: center;
|
|
2540
|
+
}
|
|
2541
|
+
|
|
2542
|
+
[part="back"] {
|
|
2543
|
+
grid-area: back;
|
|
2544
|
+
|
|
2545
|
+
margin-block-end: -2px; /* align the touch target with the close button which is _slightly_ lower than the title */
|
|
2546
|
+
padding-block-start: 14px; /* same vertical position as the close button */
|
|
2547
|
+
padding-inline-start: 18px; /* 32px (left padding of title) - 14px (left padding of button) so icon aligns with text */
|
|
2548
|
+
}
|
|
2549
|
+
|
|
2550
|
+
[part="header"][show-back] [part="title"] {
|
|
2551
|
+
padding-inline-start: 0;
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
[part="close"] {
|
|
2555
|
+
grid-area: close;
|
|
2556
|
+
|
|
2557
|
+
position: absolute; /* so we can place it on top of the [part="top"] image */
|
|
2558
|
+
top: var(--_close-button-top);
|
|
2559
|
+
right: var(--_close-button-right);
|
|
2560
|
+
}
|
|
2561
|
+
|
|
2562
|
+
[part="header"][show-top] [part="close"] {
|
|
2563
|
+
/* Invert the button colors on images */
|
|
2564
|
+
--w-c-button-color: var(--w-s-color-icon-inverted-static);
|
|
2565
|
+
--w-c-button-color-hover: var(--w-s-color-icon-inverted-static);
|
|
2566
|
+
--w-c-button-color-active: var(--w-s-color-icon-inverted-static);
|
|
2567
|
+
|
|
2568
|
+
--w-c-button-bg: rgba(var(--w-rgb-black), 0.7);
|
|
2569
|
+
--w-c-button-bg-hover: rgba(var(--w-rgb-black), 0.85);
|
|
2570
|
+
--w-c-button-bg-active: rgba(var(--w-rgb-black), 1);
|
|
2571
|
+
}
|
|
2572
|
+
`;var p=class extends ne(Re){constructor(){super();this.back=!1;this.noClose=!1;this._hasTopContent=!1;Q(oe,ae,te,re,ie)}async willUpdate(r){if(r.has("back")){if(!this.titleEl)return;new k(this.titleEl).when(async()=>{await this.updateComplete})}}emitBack(){this.dispatchEvent(new CustomEvent("backClicked",{bubbles:!0,composed:!0}))}handleTopSlotChange(r){let t=r.target.assignedElements({flatten:!0});this._hasTopContent=!!t.length}render(){let r=this.back&&!this._hasTopContent,t=!this.noClose;return F`
|
|
2573
|
+
<div
|
|
2574
|
+
part="header"
|
|
2575
|
+
?show-top=${this._hasTopContent}
|
|
2576
|
+
?show-back=${r}
|
|
2577
|
+
?show-close=${t}
|
|
2509
2578
|
>
|
|
2510
|
-
<
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
background-clip: padding-box;
|
|
2554
|
-
}
|
|
2555
|
-
.header-button:focus,
|
|
2556
|
-
.header-button:focus-visible {
|
|
2557
|
-
outline: 2px solid var(--w-s-color-border-focus);
|
|
2558
|
-
outline-offset: var(--w-outline-offset, 1px);
|
|
2559
|
-
}
|
|
2560
|
-
.header-button:not(:focus-visible) {
|
|
2561
|
-
outline: none;
|
|
2562
|
-
}
|
|
2563
|
-
.header-button {
|
|
2564
|
-
border-width: 0;
|
|
2565
|
-
border-radius: 9999px;
|
|
2566
|
-
display: inline-flex;
|
|
2567
|
-
align-items: center;
|
|
2568
|
-
justify-content: center;
|
|
2569
|
-
min-height: 40px;
|
|
2570
|
-
min-width: 40px;
|
|
2571
|
-
padding: 0.4rem;
|
|
2572
|
-
font-weight: 700;
|
|
2573
|
-
transition-property:
|
|
2574
|
-
color, background-color, border-color, text-decoration-color, fill,
|
|
2575
|
-
stroke;
|
|
2576
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
2577
|
-
transition-duration: 150ms;
|
|
2578
|
-
font-size: var(--w-font-size-m);
|
|
2579
|
-
line-height: var(--w-line-height-m);
|
|
2580
|
-
line-height: 2.4rem;
|
|
2581
|
-
}
|
|
2582
|
-
.header-button-left {
|
|
2583
|
-
background-color: transparent;
|
|
2584
|
-
color: var(--w-s-color-icon);
|
|
2585
|
-
margin-left: -0.8rem;
|
|
2586
|
-
}
|
|
2587
|
-
.header-button-left:hover {
|
|
2588
|
-
background-color: var(--w-color-button-pill-background-hover);
|
|
2589
|
-
}
|
|
2590
|
-
.header-button-left:active {
|
|
2591
|
-
background-color: var(--w-color-button-pill-background-active);
|
|
2592
|
-
}
|
|
2593
|
-
.header-close-button-container {
|
|
2594
|
-
position: absolute;
|
|
2595
|
-
right: 2rem;
|
|
2596
|
-
top: 2.4rem;
|
|
2597
|
-
}
|
|
2598
|
-
@media (min-width: 480px) {
|
|
2599
|
-
.header-title-bar {
|
|
2600
|
-
padding-left: 3.2rem;
|
|
2601
|
-
padding-right: 3.2rem;
|
|
2602
|
-
padding-top: 2.4rem;
|
|
2603
|
-
}
|
|
2604
|
-
.header-title-with-top-area {
|
|
2605
|
-
padding-left: 3.2rem;
|
|
2606
|
-
padding-right: 3.2rem;
|
|
2607
|
-
}
|
|
2608
|
-
.header-button {
|
|
2609
|
-
min-height: 32px;
|
|
2610
|
-
min-width: 32px;
|
|
2611
|
-
}
|
|
2612
|
-
}
|
|
2613
|
-
`],d([F({type:String})],b.prototype,"title",2),d([F({type:Boolean})],b.prototype,"back",2),d([F({type:Boolean,attribute:"no-close"})],b.prototype,"noClose",2),d([Be()],b.prototype,"_hasTopContent",2),d([Re(".title-el")],b.prototype,"titleEl",2);var Pr=b;customElements.get("w-modal-header")||customElements.define("w-modal-header",b);export{Pr as ModalHeader,b as WarpModalHeader};
|
|
2579
|
+
<slot
|
|
2580
|
+
part="top"
|
|
2581
|
+
name="top"
|
|
2582
|
+
@slotchange=${this.handleTopSlotChange}
|
|
2583
|
+
></slot>
|
|
2584
|
+
|
|
2585
|
+
${r?F`<w-button
|
|
2586
|
+
type="button"
|
|
2587
|
+
part="back"
|
|
2588
|
+
title=""
|
|
2589
|
+
aria-label="${c._({id:"modal.aria.back",message:"Back",comment:"Aria label for the back button in modal"})}"
|
|
2590
|
+
variant="pill"
|
|
2591
|
+
icon-only
|
|
2592
|
+
@click="${this.emitBack}"
|
|
2593
|
+
>
|
|
2594
|
+
<w-icon
|
|
2595
|
+
name="ArrowLeft"
|
|
2596
|
+
size="small"
|
|
2597
|
+
locale="${v()}"
|
|
2598
|
+
></w-icon>
|
|
2599
|
+
</w-button>`:ce}
|
|
2600
|
+
|
|
2601
|
+
<p part="title">${this.title}</p>
|
|
2602
|
+
|
|
2603
|
+
${t?F`<w-button
|
|
2604
|
+
type="button"
|
|
2605
|
+
part="close"
|
|
2606
|
+
title=""
|
|
2607
|
+
aria-label="${c._({id:"modal.aria.close",message:"Close",comment:"Aria label for the close button in modal"})}"
|
|
2608
|
+
variant="pill"
|
|
2609
|
+
icon-only
|
|
2610
|
+
@click="${this.close}"
|
|
2611
|
+
>
|
|
2612
|
+
<w-icon
|
|
2613
|
+
name="Close"
|
|
2614
|
+
size="small"
|
|
2615
|
+
locale="${v()}"
|
|
2616
|
+
style="height: 16px;"
|
|
2617
|
+
class="flex"
|
|
2618
|
+
></w-icon>
|
|
2619
|
+
</w-button>`:ce}
|
|
2620
|
+
</div>
|
|
2621
|
+
`}};p.styles=[se,le],d([j({type:String})],p.prototype,"title",2),d([j({type:Boolean})],p.prototype,"back",2),d([j({type:Boolean,attribute:"no-close"})],p.prototype,"noClose",2),d([Ie()],p.prototype,"_hasTopContent",2),d([Be('[part="title"]')],p.prototype,"titleEl",2);var Fr=p;customElements.get("w-modal-header")||customElements.define("w-modal-header",p);export{Fr as ModalHeader,p as WarpModalHeader};
|
|
2614
2622
|
//# sourceMappingURL=modal-header.js.map
|