@randstad-uca/design-system 1.0.123 → 1.0.125
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/autoloader.js +1 -1
- package/dist/components/LineProgress.d.ts +57 -0
- package/dist/components/LineProgress.js +1 -0
- package/dist/components/MfaModal.js +1 -1
- package/dist/components/Modal.d.ts +0 -1
- package/dist/components/Modal.js +1 -1
- package/dist/components/Popup.js +1 -1
- package/dist/components/ProgressCard.d.ts +58 -0
- package/dist/components/ProgressCard.js +1 -0
- package/dist/components/QrModals.d.ts +78 -0
- package/dist/components/QrModals.js +1 -0
- package/dist/components/Snackbar.js +1 -1
- package/dist/components/icons.js +1 -1
- package/dist/helpers/cssUtils.d.ts +2 -0
- package/dist/helpers/cssUtils.js +1 -0
- package/dist/helpers/progressUtils.d.ts +46 -0
- package/dist/helpers/progressUtils.js +1 -0
- package/dist/helpers/qrModalsUtils.d.ts +8 -0
- package/dist/helpers/qrModalsUtils.js +1 -0
- package/dist/helpers/textUtils.d.ts +1 -0
- package/dist/helpers/textUtils.js +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +1 -1
- package/dist/package.json +1 -1
- package/dist/randstad-design-system.css +1 -1
- package/dist/stories/LineProgress.stories.d.ts +71 -0
- package/dist/stories/ProgressCard.stories.d.ts +86 -0
- package/dist/stories/QrModals.stories.d.ts +106 -0
- package/package.json +1 -1
package/dist/autoloader.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=()=>import(`./components/FilterBar.js`),t={"accordion-panel":()=>import(`./components/Accordion.js`),"accordion-list":()=>import(`./components/AccordionList.js`),"randstad-bubble":()=>import(`./components/Bubble.js`),"randstad-button":()=>import(`./components/Button.js`),"calendar-overlay":()=>import(`./components/CalendarOverlay.js`),"carousel-component":()=>import(`./components/Carousel.js`),"carousel-card":()=>import(`./components/CarouselCards.js`),"randstad-checkbox":()=>import(`./components/Checkbox.js`),"datepicker-component":()=>import(`./components/DatePicker.js`),"upload-file":()=>import(`./components/File.js`),"randstad-filter-bar":e,"filter-bar":e,"randstad-form":()=>import(`./components/Form.js`),"randstad-form-group":()=>import(`./components/FormGroup.js`),"randstad-icon":()=>import(`./components/Icon.js`),"randstad-mfa-modal":()=>import(`./components/MfaModal.js`),"custom-modal":()=>import(`./components/Modal.js`),"randstad-navbar":()=>import(`./components/Navbar.js`),"randstad-notice":()=>import(`./components/Notice.js`),"custom-popup":()=>import(`./components/Popup.js`),"progress-circle":()=>import(`./components/ProgressCircle.js`),"custom-radio":()=>import(`./components/Radio.js`),"filterable-select":()=>import(`./components/Select.js`),"randstad-snackbar":()=>import(`./components/Snackbar.js`),"randstad-social-input":()=>import(`./components/SocialMediaInput.js`),"custom-stepper":()=>import(`./components/Stepper.js`),"tabs-bar":()=>import(`./components/Tabs.js`),"upload-image":()=>import(`./components/Upload.js`),"base-control":()=>import(`./helpers/BaseControl.js`),"base-upload":()=>import(`./helpers/BaseUpload.js`)},n=/* @__PURE__ */ new Map;let r=null;function i(e){let r=e.toLowerCase(),i=t[r];if(!i||typeof customElements<`u`&&customElements.get(r))return Promise.resolve();let a=n.get(r);if(a)return a;let o=i().then(()=>void 0).finally(()=>{n.delete(r)});return n.set(r,o),o}async function a(e=document){let n=/* @__PURE__ */ new Set,r=e=>{if(typeof Element<`u`&&e instanceof Element){let i=e.tagName.toLowerCase();i in t&&(typeof customElements>`u`||!customElements.get(i))&&n.add(i),e.shadowRoot&&r(e.shadowRoot)}if(typeof e.querySelectorAll==`function`){let i=e.querySelectorAll(`*`);for(let e=0;e<i.length;e++){let a=i[e],o=a.tagName.toLowerCase();o in t&&(typeof customElements>`u`||!customElements.get(o))&&n.add(o),a.shadowRoot&&r(a.shadowRoot)}}};r(e),n.size!==0&&await Promise.all(Array.from(n,e=>i(e)))}function o(e=typeof document<`u`?document.documentElement:null){return r||(typeof MutationObserver>`u`||!e?null:(typeof Element<`u`&&e instanceof Element||typeof Document<`u`&&e instanceof Document||typeof DocumentFragment<`u`&&e instanceof DocumentFragment?a(e):typeof document<`u`&&a(document),r=new MutationObserver(e=>{for(let t=0;t<e.length;t++){let n=e[t].addedNodes;for(let e=0;e<n.length;e++){let t=n[e];(typeof Element<`u`&&t instanceof Element||typeof DocumentFragment<`u`&&t instanceof DocumentFragment)&&a(t)}}}),r.observe(e,{childList:!0,subtree:!0}),r))}function s(){r&&=(r.disconnect(),null),n.clear()}typeof window<`u`&&typeof document<`u`&&document.documentElement&&o(document.documentElement);export{t as COMPONENT_TAG_LOADERS,a as discover,i as loadComponent,o as startAutoloader,s as stopAutoloader};
|
|
1
|
+
const e=()=>import(`./components/FilterBar.js`),t={"accordion-panel":()=>import(`./components/Accordion.js`),"accordion-list":()=>import(`./components/AccordionList.js`),"randstad-bubble":()=>import(`./components/Bubble.js`),"randstad-button":()=>import(`./components/Button.js`),"calendar-overlay":()=>import(`./components/CalendarOverlay.js`),"carousel-component":()=>import(`./components/Carousel.js`),"carousel-card":()=>import(`./components/CarouselCards.js`),"randstad-checkbox":()=>import(`./components/Checkbox.js`),"randstad-qr-modals":()=>import(`./components/QrModals.js`),"datepicker-component":()=>import(`./components/DatePicker.js`),"upload-file":()=>import(`./components/File.js`),"randstad-filter-bar":e,"filter-bar":e,"randstad-form":()=>import(`./components/Form.js`),"randstad-form-group":()=>import(`./components/FormGroup.js`),"randstad-icon":()=>import(`./components/Icon.js`),"randstad-mfa-modal":()=>import(`./components/MfaModal.js`),"custom-modal":()=>import(`./components/Modal.js`),"randstad-navbar":()=>import(`./components/Navbar.js`),"randstad-notice":()=>import(`./components/Notice.js`),"custom-popup":()=>import(`./components/Popup.js`),"randstad-line-progress":()=>import(`./components/LineProgress.js`),"randstad-progress-card":()=>import(`./components/ProgressCard.js`),"progress-circle":()=>import(`./components/ProgressCircle.js`),"custom-radio":()=>import(`./components/Radio.js`),"filterable-select":()=>import(`./components/Select.js`),"randstad-snackbar":()=>import(`./components/Snackbar.js`),"randstad-social-input":()=>import(`./components/SocialMediaInput.js`),"custom-stepper":()=>import(`./components/Stepper.js`),"tabs-bar":()=>import(`./components/Tabs.js`),"upload-image":()=>import(`./components/Upload.js`),"base-control":()=>import(`./helpers/BaseControl.js`),"base-upload":()=>import(`./helpers/BaseUpload.js`)},n=/* @__PURE__ */ new Map;let r=null;function i(e){let r=e.toLowerCase(),i=t[r];if(!i||typeof customElements<`u`&&customElements.get(r))return Promise.resolve();let a=n.get(r);if(a)return a;let o=i().then(()=>void 0).finally(()=>{n.delete(r)});return n.set(r,o),o}async function a(e=document){let n=/* @__PURE__ */ new Set,r=e=>{if(typeof Element<`u`&&e instanceof Element){let i=e.tagName.toLowerCase();i in t&&(typeof customElements>`u`||!customElements.get(i))&&n.add(i),e.shadowRoot&&r(e.shadowRoot)}if(typeof e.querySelectorAll==`function`){let i=e.querySelectorAll(`*`);for(let e=0;e<i.length;e++){let a=i[e],o=a.tagName.toLowerCase();o in t&&(typeof customElements>`u`||!customElements.get(o))&&n.add(o),a.shadowRoot&&r(a.shadowRoot)}}};r(e),n.size!==0&&await Promise.all(Array.from(n,e=>i(e)))}function o(e=typeof document<`u`?document.documentElement:null){return r||(typeof MutationObserver>`u`||!e?null:(typeof Element<`u`&&e instanceof Element||typeof Document<`u`&&e instanceof Document||typeof DocumentFragment<`u`&&e instanceof DocumentFragment?a(e):typeof document<`u`&&a(document),r=new MutationObserver(e=>{for(let t=0;t<e.length;t++){let n=e[t].addedNodes;for(let e=0;e<n.length;e++){let t=n[e];(typeof Element<`u`&&t instanceof Element||typeof DocumentFragment<`u`&&t instanceof DocumentFragment)&&a(t)}}}),r.observe(e,{childList:!0,subtree:!0}),r))}function s(){r&&=(r.disconnect(),null),n.clear()}typeof window<`u`&&typeof document<`u`&&document.documentElement&&o(document.documentElement);export{t as COMPONENT_TAG_LOADERS,a as discover,i as loadComponent,o as startAutoloader,s as stopAutoloader};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import type { PropertyValues, TemplateResult } from 'lit';
|
|
3
|
+
import type { ProgressSource } from '../helpers/progressUtils';
|
|
4
|
+
export interface LineProgressProps {
|
|
5
|
+
readonly value: number;
|
|
6
|
+
readonly max: number;
|
|
7
|
+
readonly progressSource: ProgressSource | null;
|
|
8
|
+
readonly indeterminate: boolean;
|
|
9
|
+
readonly label: string;
|
|
10
|
+
readonly valueText?: string;
|
|
11
|
+
readonly showValue: boolean;
|
|
12
|
+
readonly width: string;
|
|
13
|
+
readonly height: string;
|
|
14
|
+
readonly backgroundColor: string;
|
|
15
|
+
readonly lineColor: string;
|
|
16
|
+
readonly valueColor: string;
|
|
17
|
+
readonly borderRadius: string;
|
|
18
|
+
readonly transitionDuration: string;
|
|
19
|
+
}
|
|
20
|
+
export declare class LineProgress extends LitElement {
|
|
21
|
+
value: number;
|
|
22
|
+
max: number;
|
|
23
|
+
progressSource: ProgressSource | null;
|
|
24
|
+
indeterminate: boolean;
|
|
25
|
+
label: string;
|
|
26
|
+
valueText?: string;
|
|
27
|
+
showValue: boolean;
|
|
28
|
+
width: string;
|
|
29
|
+
height: string;
|
|
30
|
+
backgroundColor: string;
|
|
31
|
+
lineColor: string;
|
|
32
|
+
valueColor: string;
|
|
33
|
+
borderRadius: string;
|
|
34
|
+
transitionDuration: string;
|
|
35
|
+
private sourceValue;
|
|
36
|
+
private sourcePending;
|
|
37
|
+
private sourceVersion;
|
|
38
|
+
private sourceTeardown;
|
|
39
|
+
private completedSource;
|
|
40
|
+
static styles: import("lit").CSSResult;
|
|
41
|
+
connectedCallback(): void;
|
|
42
|
+
disconnectedCallback(): void;
|
|
43
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
44
|
+
private clearProgressSource;
|
|
45
|
+
private activateProgressSource;
|
|
46
|
+
private readPromiseSource;
|
|
47
|
+
private isCurrentSource;
|
|
48
|
+
private applySourceValue;
|
|
49
|
+
private handleSourceError;
|
|
50
|
+
private renderValue;
|
|
51
|
+
render(): TemplateResult;
|
|
52
|
+
}
|
|
53
|
+
declare global {
|
|
54
|
+
interface HTMLElementTagNameMap {
|
|
55
|
+
'randstad-line-progress': LineProgress;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js";import t from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";import{bodyXS as n}from"../styles/fontStyles.js";import{normalizeCssDuration as r,normalizeCssValue as i}from"../helpers/cssUtils.js";import{normalizeText as a}from"../helpers/textUtils.js";import{PROGRESS_DURATION as o,PROGRESS_LINE_COLOR as s,PROGRESS_RADIUS as c,PROGRESS_TRACK_COLOR as l,PROGRESS_VALUE_COLOR as u,isObservableLike as d,isPromiseLike as f,normalizeProgress as p,toProgressError as m}from"../helpers/progressUtils.js";import{LitElement as h,css as g,html as _,nothing as v}from"lit";import{customElement as y,property as b,state as x}from"lit/decorators.js";import{classMap as S}from"lit/directives/class-map.js";import{styleMap as C}from"lit/directives/style-map.js";const w=`Progreso de carga`;let T=class extends h{constructor(...e){super(...e),this.value=0,this.max=100,this.progressSource=null,this.indeterminate=!1,this.label=w,this.showValue=!1,this.width=`100%`,this.height=`8px`,this.backgroundColor=l,this.lineColor=s,this.valueColor=u,this.borderRadius=c,this.transitionDuration=o,this.sourceValue=0,this.sourcePending=!1,this.sourceVersion=0,this.sourceTeardown=null,this.completedSource=!1}static{this.styles=g`:host{display:block;font-family:'Graphik',sans-serif}.line-progress{display:flex;flex-direction:column;gap:6px;width:var(--line-progress-width,100%)}.track{width:100%;height:var(--line-progress-height,8px);border-radius:var(--line-progress-radius,999px);background:var(--line-progress-track-color,var(--primary-light-blue-20,#00D7FF33));overflow:hidden}.fill{width:var(--line-progress-percent,0%);height:100%;border-radius:var(--line-progress-radius,999px);background:var(--line-progress-color,var(--primary-light-blue,#00D7FF));transition:width var(--line-progress-duration,200ms) ease-in-out}.fill.indeterminate{width:35%;animation:line-progress-indeterminate 1.4s infinite ease-in-out}.value{${n}align-self:flex-end;color:var(--line-progress-value-color,var(--secondary-color-80,#404767))}@keyframes line-progress-indeterminate{from{transform:translateX(-100%)}to{transform:translateX(300%)}}@media (prefers-reduced-motion:reduce){.fill{transition:none}.fill.indeterminate{animation:none}}`}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.progressSource!==null&&this.activateProgressSource(this.progressSource)}disconnectedCallback(){this.sourceVersion+=1,this.clearProgressSource(),super.disconnectedCallback()}willUpdate(e){super.willUpdate(e),e.has(`progressSource`)&&this.activateProgressSource(this.progressSource)}clearProgressSource(){if(this.sourceTeardown===null)return;let e=this.sourceTeardown;this.sourceTeardown=null,e()}activateProgressSource(e){let t=++this.sourceVersion;if(this.clearProgressSource(),this.completedSource=!1,this.sourceValue=typeof this.value==`number`&&Number.isFinite(this.value)?this.value:0,this.sourcePending=e!==null,e===null)this.sourcePending=!1;else if(f(e))this.readPromiseSource(e,t);else if(d(e))try{let n=e.subscribe({next:e=>this.applySourceValue(e,t),error:e=>this.handleSourceError(e,t),complete:()=>{this.isCurrentSource(t)&&(this.sourcePending=!1)}});typeof n==`function`?this.sourceTeardown=n:n&&typeof n.unsubscribe==`function`&&(this.sourceTeardown=()=>n.unsubscribe())}catch(e){this.handleSourceError(e,t)}else this.handleSourceError(/* @__PURE__ */ TypeError(`Invalid progress source.`),t)}async readPromiseSource(e,t){try{let n=await e;if(!this.isCurrentSource(t))return;this.sourcePending=!1,this.applySourceValue(n,t)}catch(e){this.handleSourceError(e,t)}}isCurrentSource(e){return e===this.sourceVersion}applySourceValue(e,t){if(!this.isCurrentSource(t))return;if(typeof e!=`number`||!Number.isFinite(e)){this.handleSourceError(/* @__PURE__ */ TypeError(`Progress values must be finite numbers.`),t);return}this.sourcePending=!1,this.sourceValue=e;let n=p(e,this.max);this.dispatchEvent(new CustomEvent(`progress-change`,{detail:n,bubbles:!0,composed:!0})),n.complete&&!this.completedSource&&(this.completedSource=!0,this.dispatchEvent(new CustomEvent(`progress-complete`,{detail:n,bubbles:!0,composed:!0})))}handleSourceError(e,t){this.isCurrentSource(t)&&(this.sourcePending=!1,this.dispatchEvent(new CustomEvent(`progress-error`,{detail:{error:m(e)},bubbles:!0,composed:!0})))}renderValue(e){return!this.showValue||this.indeterminate?v:_`<span class="value" part="value" aria-hidden="true">${e}%</span>`}render(){let e=this.progressSource===null?this.value:this.sourceValue,t=p(e,this.max),n=a(this.label,w),d=a(this.valueText,``),f=!this.indeterminate&&t.maxSteps>0;return _`<div class="line-progress" part="container" style=${C({"--line-progress-width":i(this.width,`100%`),"--line-progress-height":i(this.height,`8px`),"--line-progress-track-color":i(this.backgroundColor,l),"--line-progress-color":i(this.lineColor,s),"--line-progress-value-color":i(this.valueColor,u),"--line-progress-radius":i(this.borderRadius,c),"--line-progress-duration":r(this.transitionDuration,o),"--line-progress-percent":`${t.percent}%`})} >${this.renderValue(t.percent)}<div class="track" part="track" role="progressbar" aria-label=${n} aria-valuemin=${f?`0`:v} aria-valuemax=${f?String(t.maxSteps):v} aria-valuenow=${f?String(t.currentStep):v} aria-valuetext=${f&&d.length>0?d:v} aria-busy=${this.sourcePending?`true`:`false`} ><div class=${S({fill:!0,indeterminate:this.indeterminate})} part="fill" aria-hidden="true" ></div></div></div>`}};t([b({type:Number}),e(`design:type`,Object)],T.prototype,`value`,void 0),t([b({type:Number}),e(`design:type`,Object)],T.prototype,`max`,void 0),t([b({attribute:!1}),e(`design:type`,Object)],T.prototype,`progressSource`,void 0),t([b({type:Boolean,reflect:!0}),e(`design:type`,Object)],T.prototype,`indeterminate`,void 0),t([b({type:String}),e(`design:type`,Object)],T.prototype,`label`,void 0),t([b({type:String}),e(`design:type`,String)],T.prototype,`valueText`,void 0),t([b({type:Boolean}),e(`design:type`,Object)],T.prototype,`showValue`,void 0),t([b({type:String}),e(`design:type`,String)],T.prototype,`width`,void 0),t([b({type:String}),e(`design:type`,String)],T.prototype,`height`,void 0),t([b({type:String}),e(`design:type`,String)],T.prototype,`backgroundColor`,void 0),t([b({type:String}),e(`design:type`,String)],T.prototype,`lineColor`,void 0),t([b({type:String}),e(`design:type`,String)],T.prototype,`valueColor`,void 0),t([b({type:String}),e(`design:type`,String)],T.prototype,`borderRadius`,void 0),t([b({type:String}),e(`design:type`,String)],T.prototype,`transitionDuration`,void 0),t([x(),e(`design:type`,Object)],T.prototype,`sourceValue`,void 0),t([x(),e(`design:type`,Object)],T.prototype,`sourcePending`,void 0),T=t([y(`randstad-line-progress`)],T);export{T as LineProgress};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js";import t from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";import{bodyM as n}from"../styles/fontStyles.js";import"./Button.js";import{focusStyles as r}from"../styles/focus.js";import"./Form.js";import"./FormGroup.js";import"./Notice.js";import"./Modal.js";import{LitElement as i,css as a,html as o}from"lit";import{customElement as s,property as c,state as l}from"lit/decorators.js";let u=class extends i{constructor(...e){super(...e),this.open=!1,this.title=`verificación de seguridad`,this.email=`[correo electrónico]`,this.loading=!1,this.inputMode=`numeric`,this.showError=!1,this.showSuccessNotice=!1,this.successMessage=``,this.helperMessage=``,this.resendCooldown=60,this._resendDisabled=!1,this._resendRemaining=0,this._pinValues=[,,,,,,].fill(``),this.modalWidth=`450px`,this.modalHeight=`auto`,this.maxHeight=`90dvh`}static{this.styles=[r,a`:host{font-family:'Graphik',sans-serif}.mfa-content{display:flex;flex-direction:column;gap:
|
|
1
|
+
import e from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js";import t from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";import{bodyM as n}from"../styles/fontStyles.js";import"./Button.js";import{focusStyles as r}from"../styles/focus.js";import"./Form.js";import"./FormGroup.js";import"./Notice.js";import"./Modal.js";import{LitElement as i,css as a,html as o}from"lit";import{customElement as s,property as c,state as l}from"lit/decorators.js";let u=class extends i{constructor(...e){super(...e),this.open=!1,this.title=`verificación de seguridad`,this.email=`[correo electrónico]`,this.loading=!1,this.inputMode=`numeric`,this.showError=!1,this.showSuccessNotice=!1,this.successMessage=``,this.helperMessage=``,this.resendCooldown=60,this._resendDisabled=!1,this._resendRemaining=0,this._pinValues=[,,,,,,].fill(``),this.modalWidth=`450px`,this.modalHeight=`auto`,this.maxHeight=`90dvh`}static{this.styles=[r,a`:host{font-family:'Graphik',sans-serif}.mfa-content{display:flex;flex-direction:column;gap:24px}.content-wrapper{display:flex;flex-direction:column;gap:8px}.mfa-instruction{${n}color:var(--secondary-color);margin:0}.pin-group{display:flex;gap:8px}.pin-input{width:60.33px;height:62px;text-align:center;font-size:18px;line-height:30px;font-family:'Graphik',sans-serif;font-weight:400;border:1px solid var(--secondary-color-20);border-radius:4px;outline:none;transition:border-color 0.2s,box-shadow 0.2s;color:var(--secondary-color);box-sizing:border-box;caret-color:var(--primary-color)}.pin-input:focus{border-color:var(--primary-color);box-shadow:0px 0px 0px 4px var(--primary-color-20)}.pin-input.error{border-color:var(--ui-negative)}.pin-input.error:focus{box-shadow:0px 0px 0px 4px var(--ui-negative-pink-shadow)}.resend-line{display:flex;justify-content:center;align-items:center;font-family:'Graphik',sans-serif;font-weight:400;font-size:18px;line-height:30px;letter-spacing:0%;color:var(--secondary-color,#0F1941);text-align:center;width:100%;height:62px}.resend-link{color:var(--primary-color,#2175D9);cursor:pointer;text-decoration:none;background:none;border:none;font-family:'Graphik',sans-serif;font-size:inherit;padding:0;line-height:inherit}.resend-link:hover{text-decoration:underline}.content-buton{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px}.confirm-button{width:100%;height:62px}.resend-link:disabled,.resend-link.disabled{color:var(--secondary-color-60);cursor:default;pointer-events:none;opacity:0.6}@media (max-width:940px){.pin-group{gap:8px;width:100%}.pin-input{flex:1;min-width:0;height:62px;font-size:18px}}@media (prefers-reduced-motion:reduce){.pin-input{transition:none}}`]}disconnectedCallback(){super.disconnectedCallback(),this._clearResendTimer()}updated(e){e.has(`open`)&&this.open&&requestAnimationFrame(()=>this._focusInput(0)),(e.has(`loading`)||e.has(`open`))&&requestAnimationFrame(()=>this._syncCloseButtonDisabled())}reset(){this._pinValues=[,,,,,,].fill(``),this.showError=!1,this.showSuccessNotice=!1,this._resendDisabled=!1,this._clearResendTimer(),this.requestUpdate()}focusFirstInput(){this._focusInput(0)}_clearResendTimer(){this._resendTimer!==void 0&&(clearInterval(this._resendTimer),this._resendTimer=void 0)}get _resolvedInputMode(){return this.inputMode===`numeric`?`numeric`:`text`}_sanitizeValue(e){return this.inputMode===`numeric`?e.replace(/[^0-9]/g,``):e.replace(/[^a-zA-Z0-9]/g,``)}_getCloseButton(){return this.renderRoot.querySelector(`custom-modal`)?.shadowRoot?.querySelector(`.modal-close`)}_syncCloseButtonDisabled(){let e=this._getCloseButton();if(!e)return;let t=e.querySelector(`randstad-icon`);this.loading?(e.setAttribute(`disabled`,``),e.setAttribute(`aria-disabled`,`true`),e.style.cursor=`default`,e.style.pointerEvents=`none`,t&&(t.style.filter=`grayscale(1)`,t.style.opacity=`0.5`)):(e.removeAttribute(`disabled`),e.removeAttribute(`aria-disabled`),e.style.cursor=``,e.style.pointerEvents=``,t&&(t.style.filter=``,t.style.opacity=``))}_clearForwardFromIndex(e){for(let t=e+1;t<6;t++)if(this._pinValues[t]){this._pinValues[t]=``,this.requestUpdate(),this._focusInput(t);return}}_getPinInputs(){return this.renderRoot.querySelectorAll(`.pin-input`)}_focusInput(e){let t=this._getPinInputs()?.[e];t&&(t.focus(),t.select())}get _isComplete(){return this._pinValues.every(e=>e!==``)}_onPinInput(e,t){let n=e.target,r=this._sanitizeValue(n.value||``);if(!r)this._pinValues[t]=``;else if(r.length>1){let e=r.split(``);for(let n=t;n<6&&e.length>0;n++)this._pinValues[n]=e.shift();let n=Math.min(5,t+r.length);setTimeout(()=>this._focusInput(n)),this.requestUpdate()}else this._pinValues[t]=r,this.requestUpdate(),t<5&&this._focusInput(t+1)}_onPinKeyDown(e,t){e.key===`Enter`&&this._isComplete?this._onConfirm():e.key===`Backspace`?this._pinValues[t]?(this._pinValues[t]=``,this.requestUpdate(),e.preventDefault()):t>0?(this._pinValues[t-1]=``,this.requestUpdate(),this._focusInput(t-1),e.preventDefault()):(this._clearForwardFromIndex(0),e.preventDefault()):e.key===`Delete`?(this._pinValues[t]?(this._pinValues[t]=``,this.requestUpdate()):this._clearForwardFromIndex(t),e.preventDefault()):e.key.length===1&&!e.ctrlKey&&!e.metaKey&&e.key!==`v`&&(this.inputMode===`numeric`?/\D/.test(e.key):/[^a-zA-Z0-9]/.test(e.key))&&e.preventDefault()}_onPinPaste(e){let t=(e.clipboardData??window.clipboardData)?.getData(`text`)||``,n=this._sanitizeValue(t).slice(0,6).split(``);if(n.length===0)return;for(let e=0;e<6;e++)this._pinValues[e]=n[e]||``;e.preventDefault(),this.requestUpdate();let r=this._pinValues.findIndex(e=>!e);setTimeout(()=>this._focusInput(r>=0?r:5))}_onClose(){this.loading||this.dispatchEvent(new CustomEvent(`mfa-close`))}_onConfirm(){this._isComplete&&!this.loading&&this.dispatchEvent(new CustomEvent(`mfa-confirm`,{detail:{code:this._pinValues.join(``)}}))}_onResend(){this._resendDisabled||(this.dispatchEvent(new CustomEvent(`resend-code`)),this._startResendCountdown())}_startResendCountdown(){this._clearResendTimer(),this._resendDisabled=!0,this._resendRemaining=this.resendCooldown,this._resendTimer=window.setInterval(()=>{--this._resendRemaining,this._resendRemaining<=0&&(this._resendDisabled=!1,this._clearResendTimer()),this.requestUpdate()},1e3)}_renderPinInputs(){return Array.from({length:6},(e,t)=>o`<input class="pin-input ${this.showError?`error`:``}" type="text" inputmode=${this._resolvedInputMode} pattern=${this.inputMode===`numeric`?`\\d*`:`[a-zA-Z0-9]*`} maxlength="1" autocomplete="one-time-code" .value=${this._pinValues[t]} @input=${e=>this._onPinInput(e,t)} @keydown=${e=>this._onPinKeyDown(e,t)} aria-label="Dígito ${t+1} del código" aria-invalid=${this.showError?`true`:`false`} >`)}_renderResendSection(){return o`<div class="resend-line"> ¿no lo recibiste? ${this._resendDisabled?o`<span role="status" aria-live="polite">reenviar en (${this._resendRemaining}s)</span>`:o`<button class="resend-link" @click=${this._onResend} >reenviar ahora</button>`}</div>`}render(){return o`<custom-modal .open=${this.open} title=${this.title} .hideFooter=${!0} modalWidth= ${this.modalWidth}; modalHeight=${this.modalHeight}; maxHeight= ${this.maxHeight}; @modal-close=${this._onClose} ><div slot="content" class="mfa-content" role="status" aria-live="polite" aria-describedby="mfa-notice-message"><div class="content-wrapper"><randstad-notice id="mfa-notice-message" .open=${!0} .type=${this.showSuccessNotice?`success`:`informative`} .icon=${this.showSuccessNotice?`check`:`info`} .message=${this.showSuccessNotice?this.successMessage:this.helperMessage} ></randstad-notice><randstad-form-group label="ingresá el código que recibiste" .error=${this.showError} errorMessage="el código ingresado es incorrecto" ><div class="pin-group" @paste=${this._onPinPaste}>${this._renderPinInputs()}</div></randstad-form-group></div><div class="content-buton"><randstad-button class="confirm-button" variant="button-primary" size="lg" label="actualizar" .loader=${this.loading} .disabled=${!this._isComplete||this.loading} @click=${this._onConfirm} ></randstad-button>${this._renderResendSection()}</div></div></custom-modal>`}};t([c({type:Boolean,reflect:!0}),e(`design:type`,Object)],u.prototype,`open`,void 0),t([c({type:String}),e(`design:type`,Object)],u.prototype,`title`,void 0),t([c({type:String}),e(`design:type`,Object)],u.prototype,`email`,void 0),t([c({type:Boolean,reflect:!0}),e(`design:type`,Object)],u.prototype,`loading`,void 0),t([c({type:String}),e(`design:type`,Object)],u.prototype,`inputMode`,void 0),t([c({type:Boolean}),e(`design:type`,Object)],u.prototype,`showError`,void 0),t([c({type:Boolean}),e(`design:type`,Object)],u.prototype,`showSuccessNotice`,void 0),t([c({type:String}),e(`design:type`,Object)],u.prototype,`successMessage`,void 0),t([c({type:String}),e(`design:type`,Object)],u.prototype,`helperMessage`,void 0),t([c({type:Number}),e(`design:type`,Object)],u.prototype,`resendCooldown`,void 0),t([l(),e(`design:type`,Object)],u.prototype,`_resendDisabled`,void 0),t([l(),e(`design:type`,Object)],u.prototype,`_resendRemaining`,void 0),t([l(),e(`design:type`,Array)],u.prototype,`_pinValues`,void 0),t([c({type:String}),e(`design:type`,Object)],u.prototype,`modalWidth`,void 0),t([c({type:String}),e(`design:type`,Object)],u.prototype,`modalHeight`,void 0),t([c({type:String}),e(`design:type`,Object)],u.prototype,`maxHeight`,void 0),u=t([s(`randstad-mfa-modal`)],u);export{u as MfaModal};
|
package/dist/components/Modal.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js";import t from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";import"./Icon.js";import{bodyM as n,titleS as r}from"../styles/fontStyles.js";import"./Button.js";import{focusStyles as i}from"../styles/focus.js";import{scrollbarStyles as a}from"../styles/scrollbar.js";import"./Notice.js";import{LitElement as o,css as s,html as c,nothing as l}from"lit";import{customElement as u,property as d,state as f}from"lit/decorators.js";let p=class extends o{constructor(...e){super(...e),this.open=!1,this.title=`Título del modal`,this.showNotice=!1,this.noticeType=`informative`,this.noticeMessage=``,this.noticeIcon=`info`,this.showPrimaryButton=!1,this.primaryButtonLabel=`Aceptar`,this.showSecondaryButton=!1,this.secondaryButtonLabel=`Cancelar`,this.isFooterCustom=!1,this.isPrimaryLoader=!1,this.isPrimaryDisabled=!1,this.modalWidth=`500px`,this.modalHeight=`80dvh`,this.maxHeight=`90dvh`,this.hideFooter=!1,this.scrollable=!1,this.hasDropdownOpen=!1,this.hasCalendarOpen=!1,this.handleDropdownOpen=e=>{let t=e.detail;this.hasDropdownOpen=t&&typeof t.open==`boolean`?t.open:!0},this.handleCalendarOpen=e=>{let t=e.detail;this.hasCalendarOpen=t&&typeof t.open==`boolean`?t.open:!0},this.setScrollableMode=()=>{this.scrollable=window.innerWidth>940}}static{this.styles=[a,s`${i}:host{font-family:'Graphik',sans-serif;display:none
|
|
1
|
+
import e from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js";import t from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";import"./Icon.js";import{bodyM as n,titleS as r}from"../styles/fontStyles.js";import"./Button.js";import{focusStyles as i}from"../styles/focus.js";import{scrollbarStyles as a}from"../styles/scrollbar.js";import"./Notice.js";import{LitElement as o,css as s,html as c,nothing as l}from"lit";import{customElement as u,property as d,state as f}from"lit/decorators.js";let p=class extends o{constructor(...e){super(...e),this.open=!1,this.title=`Título del modal`,this.showNotice=!1,this.noticeType=`informative`,this.noticeMessage=``,this.noticeIcon=`info`,this.showPrimaryButton=!1,this.primaryButtonLabel=`Aceptar`,this.showSecondaryButton=!1,this.secondaryButtonLabel=`Cancelar`,this.isFooterCustom=!1,this.isPrimaryLoader=!1,this.isPrimaryDisabled=!1,this.modalWidth=`500px`,this.modalHeight=`80dvh`,this.maxHeight=`90dvh`,this.hideFooter=!1,this.scrollable=!1,this.hasDropdownOpen=!1,this.hasCalendarOpen=!1,this.handleDropdownOpen=e=>{let t=e.detail;this.hasDropdownOpen=t&&typeof t.open==`boolean`?t.open:!0},this.handleCalendarOpen=e=>{let t=e.detail;this.hasCalendarOpen=t&&typeof t.open==`boolean`?t.open:!0},this.setScrollableMode=()=>{this.scrollable=window.innerWidth>940}}static{this.styles=[a,s`${i}:host{font-family:'Graphik',sans-serif;display:none}:host([open]){display:block;z-index:9999}.overlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:9999;display:flex;background:rgba(15,25,65,0.4);justify-content:center;align-items:center}.modal{width:100%;height:var(--modal-height);max-height:var(--modal-max-height);background:var(--brand-off-white);max-width:var(--modal-width);box-shadow:0 4px 12px rgba(0,0,0,0.15);display:flex;flex-direction:column;border-radius:8px;overflow:hidden}.modal-body{overflow-y:auto;flex:1}.modal-footer{justify-content:flex-end}.modal-footer.one-button randstad-button{width:100%}.modal-footer.two-buttons randstad-button{width:50%}@media (max-width:940px){.modal{width:100% !important;height:100% !important;max-width:none !important;max-height:none !important;margin:0 !important;border-radius:0 !important}.modal-header,.modal-body,.modal-footer{padding:0}}.modal-header{display:flex;flex-direction:column;gap:8px;justify-content:space-between;align-items:center;padding:16px;border-bottom:1px solid var(--secondary-color-20)}.modal-header-content{display:flex;gap:32px;width:100%;justify-content:space-between;align-items:center}.titles-container{display:flex;flex-direction:column;gap:8px;flex-grow:1}.modal-title{display:flex;justify-content:space-between;align-items:center;${r}font-style:regular;font-size:24px;line-height:32px;letter-spacing:-1px;margin:0;color:var(--secondary-color)}.modal-subtitle{${n}margin:0;color:var(--secondary-color-60)}.modal-header randstad-notice{width:100%}.modal-close{background:none;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;width:40px;height:40px;border-radius:50%;transition:background-color 0.2s ease}.modal-close:hover{background-color:var(--primary-color-10)}.modal-body{display:flex;flex-direction:column;padding:16px;gap:16px}slot[name="content"].has-dropdown-open{display:block;padding-bottom:40px}slot[name="content"].has-calendar-open{display:block;padding-bottom:160px}slot[name="content"].has-dropdown-open.has-calendar-open{padding-bottom:160px}.modal-footer{display:flex;padding:24px;gap:16px;border-top:1px solid var(--secondary-color-20)}@media (max-width:940px){.modal-close:hover{background-color:transparent}}@media (max-width:500px){.modal-body{padding:16px}}`]}closeModal(){this.dispatchEvent(new CustomEvent(`modal-close`))}connectedCallback(){super.connectedCallback(),this.setScrollableMode(),window.addEventListener(`resize`,this.setScrollableMode),this.addEventListener(`dropdown-toggle`,this.handleDropdownOpen),this.addEventListener(`calendar-toggle`,this.handleDropdownOpen),this.addEventListener(`dropdown-toggle-calendar`,this.handleCalendarOpen)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(`resize`,this.setScrollableMode),this.removeEventListener(`dropdown-toggle`,this.handleDropdownOpen),this.removeEventListener(`calendar-toggle`,this.handleDropdownOpen),this.removeEventListener(`dropdown-toggle-calendar`,this.handleCalendarOpen)}getFooterClass(){return this.isFooterCustom&&!this.showPrimaryButton&&!this.showSecondaryButton?`footer-custom`:this.showPrimaryButton&&this.showSecondaryButton?`two-buttons`:`one-button`}render(){return c`<div class="overlay" role="dialog" aria-modal="true"><div class="modal" style="--modal-width: ${this.modalWidth}; --modal-height: ${this.modalHeight}; --modal-max-height: ${this.maxHeight};"><div class="modal-header"><div class="modal-header-content"><div class="titles-container"><div class="modal-title">${this.title}<button class="modal-close" @click=${this.closeModal} aria-label="Cerrar modal"><randstad-icon name="close" size="24" .color=${`var( --primary-color )`} ></randstad-icon></button></div>${this.subtitle?c`<div class="modal-subtitle">${this.subtitle}</div>`:l}</div></div>${this.showNotice?c`<randstad-notice .open=${!0} .type=${this.noticeType} .icon=${this.noticeIcon} .message=${this.noticeMessage} ></randstad-notice>`:l}</div><div class="modal-body ${this.scrollable?`scrollable`:``}"><slot name="content" class="${this.hasDropdownOpen?`has-dropdown-open`:``} ${this.hasCalendarOpen?`has-calendar-open`:``}"></slot></div>${this.hideFooter?l:c`<div class="modal-footer ${this.getFooterClass()}">${this.isFooterCustom&&!this.showPrimaryButton&&!this.showSecondaryButton?c`<slot name="footer-custom"></slot> `:l} ${this.showSecondaryButton?c`<randstad-button variant="button-secondary" size="md" @click=${()=>this.dispatchEvent(new CustomEvent(`secondary-click`))} label=${this.secondaryButtonLabel} ></randstad-button>`:l} ${this.showPrimaryButton?c`<randstad-button variant="button-primary" size="md" @click=${()=>this.dispatchEvent(new CustomEvent(`primary-click`))} label=${this.primaryButtonLabel} .loader=${this.isPrimaryLoader} .disabled=${this.isPrimaryDisabled} ></randstad-button>`:l}</div>`}</div></div>`}};t([d({type:Boolean,reflect:!0}),e(`design:type`,Object)],p.prototype,`open`,void 0),t([d({type:String}),e(`design:type`,Object)],p.prototype,`title`,void 0),t([d({type:String}),e(`design:type`,String)],p.prototype,`subtitle`,void 0),t([d({type:Boolean}),e(`design:type`,Object)],p.prototype,`showNotice`,void 0),t([d({type:String}),e(`design:type`,String)],p.prototype,`noticeType`,void 0),t([d({type:String}),e(`design:type`,Object)],p.prototype,`noticeMessage`,void 0),t([d({type:String}),e(`design:type`,Object)],p.prototype,`noticeIcon`,void 0),t([d({type:Boolean}),e(`design:type`,Object)],p.prototype,`showPrimaryButton`,void 0),t([d({type:String}),e(`design:type`,Object)],p.prototype,`primaryButtonLabel`,void 0),t([d({type:Boolean}),e(`design:type`,Object)],p.prototype,`showSecondaryButton`,void 0),t([d({type:String}),e(`design:type`,Object)],p.prototype,`secondaryButtonLabel`,void 0),t([d({type:Boolean}),e(`design:type`,Object)],p.prototype,`isFooterCustom`,void 0),t([d({type:Boolean}),e(`design:type`,Object)],p.prototype,`isPrimaryLoader`,void 0),t([d({type:Boolean}),e(`design:type`,Object)],p.prototype,`isPrimaryDisabled`,void 0),t([d({type:String}),e(`design:type`,Object)],p.prototype,`modalWidth`,void 0),t([d({type:String}),e(`design:type`,Object)],p.prototype,`modalHeight`,void 0),t([d({type:String}),e(`design:type`,Object)],p.prototype,`maxHeight`,void 0),t([d({type:Boolean}),e(`design:type`,Object)],p.prototype,`hideFooter`,void 0),t([f(),e(`design:type`,Object)],p.prototype,`scrollable`,void 0),t([f(),e(`design:type`,Object)],p.prototype,`hasDropdownOpen`,void 0),t([f(),e(`design:type`,Object)],p.prototype,`hasCalendarOpen`,void 0),p=t([u(`custom-modal`)],p);export{p as CustomModal};
|
package/dist/components/Popup.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js";import t from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";import"./Icon.js";import{bodyM as n,titleXS as r,titleXXS as i}from"../styles/fontStyles.js";import"./Button.js";import{LitElement as a,css as o,html as s,nothing as c}from"lit";import{customElement as l,property as u}from"lit/decorators.js";let d=class extends a{constructor(...e){super(...e),this.open=!1,this.type=`default`,this.icon=`warning`,this.iconColor=`var(--primary-color)`,this.title=``,this.description=``,this.width=`400px`,this.height=``,this.buttonText=`Aceptar`,this.confirmText=`Sí`,this.cancelText=`No`,this.closeOnOutsideClick=!1,this.stackedActions=[],this._onBackgroundClick=e=>{if(!this.closeOnOutsideClick)return;let t=e.composedPath(),n=this.renderRoot.querySelector(`.popup`);n&&!t.includes(n)&&(this.dispatchEvent(new CustomEvent(`popup-close`,{detail:null})),this.open=!1)}}static{this.styles=o`:host{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.5);justify-content:center;align-items:center;font-family:"Graphik",sans-serif}:host([open]){display:flex}@media (max-width:500px){.popup{width:100%;margin:0px 25px}}@media (min-width:501px){.popup{width:var(--popup-width,358px);min-height:var(--popup-height,auto)}}.popup{background:var(--white);padding:24px;border-radius:16px;text-align:center;animation:fadeIn 0.2s ease-in-out;display:flex;flex-direction:column;gap:24px;align-items:center;box-sizing:border-box;width:var(--popup-width,358px);height:var(--popup-height,auto)}@keyframes fadeIn{from{opacity:0;transform:scale(0.9)}to{opacity:1;transform:scale(1)}}.popup-content{display:flex;flex-direction:column;gap:
|
|
1
|
+
import e from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js";import t from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";import"./Icon.js";import{bodyM as n,titleXS as r,titleXXS as i}from"../styles/fontStyles.js";import"./Button.js";import{LitElement as a,css as o,html as s,nothing as c}from"lit";import{customElement as l,property as u}from"lit/decorators.js";let d=class extends a{constructor(...e){super(...e),this.open=!1,this.type=`default`,this.icon=`warning`,this.iconColor=`var(--primary-color)`,this.title=``,this.description=``,this.width=`400px`,this.height=``,this.buttonText=`Aceptar`,this.confirmText=`Sí`,this.cancelText=`No`,this.closeOnOutsideClick=!1,this.stackedActions=[],this._onBackgroundClick=e=>{if(!this.closeOnOutsideClick)return;let t=e.composedPath(),n=this.renderRoot.querySelector(`.popup`);n&&!t.includes(n)&&(this.dispatchEvent(new CustomEvent(`popup-close`,{detail:null})),this.open=!1)}}static{this.styles=o`:host{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.5);justify-content:center;align-items:center;font-family:"Graphik",sans-serif}:host([open]){display:flex}@media (max-width:500px){.popup{width:100%;margin:0px 25px}}@media (min-width:501px){.popup{width:var(--popup-width,358px);min-height:var(--popup-height,auto)}}.popup{background:var(--white);padding:24px;border-radius:16px;text-align:center;animation:fadeIn 0.2s ease-in-out;display:flex;flex-direction:column;gap:24px;align-items:center;box-sizing:border-box;width:var(--popup-width,358px);height:var(--popup-height,auto)}@keyframes fadeIn{from{opacity:0;transform:scale(0.9)}to{opacity:1;transform:scale(1)}}.popup-content{display:flex;flex-direction:column;gap:8px;width:100%}.titles-container{display:flex;flex-direction:column;gap:8px;align-items:center}.popup-title{${r}margin:0;color:var(--secondary-color-80)}.popup-description{${n}margin:0;color:var(--secondary-color-60)}.buttons-container{display:flex;gap:10px;width:100%}.buttons-container ::slotted(randstad-button),.buttons-container randstad-button{flex:1 1 50%}:host([type="stacked"]) .buttons-container{flex-direction:column;gap:12px}.popup-actions{display:flex;flex-direction:column;width:100%}.action-item{${i};display:flex;align-items:center;gap:16px;cursor:pointer;color:var(--secondary-color);padding:16px;border-radius:8px;transition:background 0.2s}.action-item:hover{background:var(--secondary-color-10,#f0f4ff)}.icon-circle{width:32px;height:32px;background:rgb(from var(--icon-color) r g b / 0.2);border-radius:50%;display:flex;align-items:center;justify-content:center}`}firstUpdated(){if(this.open){let e=this.renderRoot.querySelector(`randstad-button`);e&&e.focus()}this.addEventListener(`click`,this._onBackgroundClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`click`,this._onBackgroundClick)}closePopup(e){this.dispatchEvent(new CustomEvent(`popup-close`,{detail:e})),this.open=!1}render(){let e=this.width||this.height?`--popup-width: ${this.width||`400px`}; --popup-height: ${this.height||`auto`};`:``;return s`<div class="popup" role="dialog" aria-modal="true" style="${e}" ${this.type==="default"?c:s`aria-labelledby="popup-title"`} aria-describedby="popup-description" >${this.type!==`stacked`&&this.icon?s`<randstad-icon name=${this.icon} size="56px" color=${this.iconColor} />`:c}<div class="popup-content">${this.type==="default"?s` ${this.title?s`<h2 id="popup-title" class="popup-title">${this.title}</h2>`:c} ${this.description?s`<p id="popup-description" class="popup-description">${this.description}</p>`:c} `:this.type===`stacked`?s`<div class="popup-actions">${this.stackedActions.map(e=>s`<div class="action-item" @click=${()=>this.closePopup(e.value)} ><div class="icon-circle" style="--icon-color:${e.iconColor}"><randstad-icon name=${e.icon} size="24px" color=${e.iconColor} ></randstad-icon></div><span>${e.label}</span></div>`)}</div>`:s`<div class="titles-container"><h2 id="popup-title" class="popup-title">${this.title}</h2>${this.description?s`<p id="popup-description" class="popup-description">${this.description}</p>`:c}</div>`}</div>${this.type===`stacked`?c:s`<div class="buttons-container">${this.type==="default"?s`<randstad-button variant="button-primary" size="md" @click=${()=>this.closePopup(!0)} label=${this.buttonText} ></randstad-button>`:s`<randstad-button variant="button-secondary" size="md" @click=${()=>this.closePopup(!1)} label=${this.cancelText} ></randstad-button><randstad-button variant="button-primary" size="md" @click=${()=>this.closePopup(!0)} label=${this.confirmText} ></randstad-button>`}</div>`}</div>`}};t([u({type:Boolean,reflect:!0}),e(`design:type`,Object)],d.prototype,`open`,void 0),t([u({type:String}),e(`design:type`,String)],d.prototype,`type`,void 0),t([u({type:String}),e(`design:type`,Object)],d.prototype,`icon`,void 0),t([u({type:String}),e(`design:type`,Object)],d.prototype,`iconColor`,void 0),t([u({type:String}),e(`design:type`,Object)],d.prototype,`title`,void 0),t([u({type:String}),e(`design:type`,Object)],d.prototype,`description`,void 0),t([u({type:String}),e(`design:type`,Object)],d.prototype,`width`,void 0),t([u({type:String}),e(`design:type`,Object)],d.prototype,`height`,void 0),t([u({type:String}),e(`design:type`,Object)],d.prototype,`buttonText`,void 0),t([u({type:String}),e(`design:type`,Object)],d.prototype,`confirmText`,void 0),t([u({type:String}),e(`design:type`,Object)],d.prototype,`cancelText`,void 0),t([u({type:Boolean}),e(`design:type`,Object)],d.prototype,`closeOnOutsideClick`,void 0),t([u({type:Array}),e(`design:type`,Array)],d.prototype,`stackedActions`,void 0),d=t([l(`custom-popup`)],d);export{d as CustomPopup};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import type { TemplateResult } from 'lit';
|
|
3
|
+
import './LineProgress';
|
|
4
|
+
export interface ProgressCardProps {
|
|
5
|
+
readonly currentStep: number;
|
|
6
|
+
readonly maxSteps: number;
|
|
7
|
+
readonly title: string;
|
|
8
|
+
readonly progressLabel: string;
|
|
9
|
+
readonly linkLabel: string;
|
|
10
|
+
readonly description?: string;
|
|
11
|
+
readonly showLink: boolean;
|
|
12
|
+
readonly linkDisabled: boolean;
|
|
13
|
+
readonly width: string;
|
|
14
|
+
readonly padding: string;
|
|
15
|
+
readonly backgroundColor: string;
|
|
16
|
+
readonly borderRadius: string;
|
|
17
|
+
readonly boxShadow: string;
|
|
18
|
+
readonly titleColor: string;
|
|
19
|
+
readonly descriptionColor: string;
|
|
20
|
+
readonly linkColor: string;
|
|
21
|
+
readonly progressBackgroundColor: string;
|
|
22
|
+
readonly progressColor: string;
|
|
23
|
+
readonly progressHeight: string;
|
|
24
|
+
readonly progressBorderRadius: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ProgressCardEventMap {
|
|
27
|
+
readonly linkClick: CustomEvent<void>;
|
|
28
|
+
}
|
|
29
|
+
export declare class ProgressCard extends LitElement {
|
|
30
|
+
currentStep: number;
|
|
31
|
+
maxSteps: number;
|
|
32
|
+
title: string;
|
|
33
|
+
progressLabel: string;
|
|
34
|
+
linkLabel: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
showLink: boolean;
|
|
37
|
+
linkDisabled: boolean;
|
|
38
|
+
width: string;
|
|
39
|
+
padding: string;
|
|
40
|
+
backgroundColor: string;
|
|
41
|
+
borderRadius: string;
|
|
42
|
+
boxShadow: string;
|
|
43
|
+
titleColor: string;
|
|
44
|
+
descriptionColor: string;
|
|
45
|
+
linkColor: string;
|
|
46
|
+
progressBackgroundColor: string;
|
|
47
|
+
progressColor: string;
|
|
48
|
+
progressHeight: string;
|
|
49
|
+
progressBorderRadius: string;
|
|
50
|
+
static styles: import("lit").CSSResult;
|
|
51
|
+
private handleLinkClick;
|
|
52
|
+
render(): TemplateResult;
|
|
53
|
+
}
|
|
54
|
+
declare global {
|
|
55
|
+
interface HTMLElementTagNameMap {
|
|
56
|
+
'randstad-progress-card': ProgressCard;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js";import t from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";import{bodyS as n,bodyXS as r}from"../styles/fontStyles.js";import{normalizeCssValue as i}from"../helpers/cssUtils.js";import{normalizeText as a}from"../helpers/textUtils.js";import{PROGRESS_LINE_COLOR as o,PROGRESS_RADIUS as s,PROGRESS_TRACK_COLOR as c,buildProgressDescription as l,normalizeProgress as u}from"../helpers/progressUtils.js";import"./LineProgress.js";import{LitElement as d,css as f,html as p,nothing as m}from"lit";import{customElement as h,property as g}from"lit/decorators.js";import{styleMap as _}from"lit/directives/style-map.js";const v=`mejorá tu candidatura`,y=`¡descubrí cómo!`,b=`Progreso`,x=`var(--white, #FFFFFF)`,S=`0px 1px 2px 0px rgba(15, 25, 65, 0.3)`;let C=class extends d{constructor(...e){super(...e),this.currentStep=0,this.maxSteps=0,this.title=v,this.progressLabel=b,this.linkLabel=y,this.showLink=!0,this.linkDisabled=!1,this.width=`100%`,this.padding=`16px`,this.backgroundColor=x,this.borderRadius=`16px`,this.boxShadow=S,this.titleColor=`var(--secondary-color-80, #404767)`,this.descriptionColor=`var(--secondary-color-60, #6F758D)`,this.linkColor=`var(--primary-color, #2175D9)`,this.progressBackgroundColor=c,this.progressColor=o,this.progressHeight=`8px`,this.progressBorderRadius=s}static{this.styles=f`:host{display:block;font-family:'Graphik',sans-serif}.progress-card{display:flex;flex-direction:column;gap:4px;width:var(--progress-card-width,100%);padding:var(--progress-card-padding,16px);background:var(--progress-card-background,var(--white,#FFFFFF));border-radius:var(--progress-card-radius,16px);box-shadow:var(--progress-card-shadow,0px 1px 2px 0px rgba(15,25,65,0.3));text-align:left;box-sizing:border-box}.progress-card-title{${n}margin:0;color:var(--progress-card-title-color,var(--secondary-color-80,#404767))}randstad-line-progress{display:block;width:100%}.progress-card-footer{display:flex;align-items:center;justify-content:space-between;gap:12px}.progress-card-description{${r}margin:0;color:var(--progress-card-description-color,var(--secondary-color-60,#6F758D))}.progress-card-link{${r}display:inline-flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;margin:-4px 0;padding:4px 0;border:none;background:none;color:var(--progress-card-link-color,var(--primary-color,#2175D9));text-decoration:none;white-space:nowrap;cursor:pointer;box-sizing:border-box}.progress-card-link:hover:not(:disabled){text-decoration:underline}.progress-card-link:focus-visible{outline:2px solid var(--primary-color,#2175D9);outline-offset:2px;border-radius:2px}.progress-card-link:disabled{color:var(--secondary-color-40,#9FA3B3);cursor:default}@media (max-width:500px){.progress-card-footer{flex-wrap:wrap}}`}handleLinkClick(){this.linkDisabled||this.dispatchEvent(new CustomEvent(`linkClick`,{bubbles:!0,composed:!0}))}render(){let e=a(this.title,v),t=a(this.linkLabel,y),n=a(this.progressLabel,b),r=u(this.currentStep,this.maxSteps),d=l({currentStep:this.currentStep,maxSteps:this.maxSteps}),f=a(this.description,d);return p`<article class="progress-card" part="card" aria-labelledby="progress-card-title" style=${_({"--progress-card-width":i(this.width,`100%`),"--progress-card-padding":i(this.padding,`16px`),"--progress-card-background":i(this.backgroundColor,x),"--progress-card-radius":i(this.borderRadius,`16px`),"--progress-card-shadow":i(this.boxShadow,S),"--progress-card-title-color":i(this.titleColor,`var(--secondary-color-80, #404767)`),"--progress-card-description-color":i(this.descriptionColor,`var(--secondary-color-60, #6F758D)`),"--progress-card-link-color":i(this.linkColor,`var(--primary-color, #2175D9)`)})} ><div class="header-box" part="header"><p class="progress-card-title" part="title" id="progress-card-title">${e}</p><randstad-line-progress part="progress" .value=${r.currentStep} .max=${r.maxSteps} .label=${n} .valueText=${f} .height=${i(this.progressHeight,`8px`)} .backgroundColor=${i(this.progressBackgroundColor,c)} .lineColor=${i(this.progressColor,o)} .borderRadius=${i(this.progressBorderRadius,s)} ></randstad-line-progress></div><div class="progress-card-footer" part="footer"><p class="progress-card-description" part="description">${f}</p>${this.showLink?p`<button type="button" class="progress-card-link" part="link" ?disabled=${this.linkDisabled} @click=${this.handleLinkClick} >${t}</button>`:m}</div></article>`}};t([g({type:Number}),e(`design:type`,Object)],C.prototype,`currentStep`,void 0),t([g({type:Number}),e(`design:type`,Object)],C.prototype,`maxSteps`,void 0),t([g({type:String}),e(`design:type`,String)],C.prototype,`title`,void 0),t([g({type:String}),e(`design:type`,String)],C.prototype,`progressLabel`,void 0),t([g({type:String}),e(`design:type`,String)],C.prototype,`linkLabel`,void 0),t([g({type:String}),e(`design:type`,String)],C.prototype,`description`,void 0),t([g({type:Boolean}),e(`design:type`,Object)],C.prototype,`showLink`,void 0),t([g({type:Boolean,reflect:!0}),e(`design:type`,Object)],C.prototype,`linkDisabled`,void 0),t([g({type:String}),e(`design:type`,String)],C.prototype,`width`,void 0),t([g({type:String}),e(`design:type`,String)],C.prototype,`padding`,void 0),t([g({type:String}),e(`design:type`,String)],C.prototype,`backgroundColor`,void 0),t([g({type:String}),e(`design:type`,String)],C.prototype,`borderRadius`,void 0),t([g({type:String}),e(`design:type`,String)],C.prototype,`boxShadow`,void 0),t([g({type:String}),e(`design:type`,String)],C.prototype,`titleColor`,void 0),t([g({type:String}),e(`design:type`,String)],C.prototype,`descriptionColor`,void 0),t([g({type:String}),e(`design:type`,String)],C.prototype,`linkColor`,void 0),t([g({type:String}),e(`design:type`,String)],C.prototype,`progressBackgroundColor`,void 0),t([g({type:String}),e(`design:type`,String)],C.prototype,`progressColor`,void 0),t([g({type:String}),e(`design:type`,String)],C.prototype,`progressHeight`,void 0),t([g({type:String}),e(`design:type`,String)],C.prototype,`progressBorderRadius`,void 0),C=t([h(`randstad-progress-card`)],C);export{C as ProgressCard};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { LitElement, nothing } from 'lit';
|
|
2
|
+
import type { PropertyValues, TemplateResult } from 'lit';
|
|
3
|
+
import './Icon';
|
|
4
|
+
export interface QrModalsProps {
|
|
5
|
+
readonly open: boolean;
|
|
6
|
+
readonly title: string;
|
|
7
|
+
readonly badgeLabel: string;
|
|
8
|
+
readonly footerText: string;
|
|
9
|
+
readonly closeLabel: string;
|
|
10
|
+
readonly qrAsset: string;
|
|
11
|
+
readonly qrAlt: string;
|
|
12
|
+
readonly dismissOnOutsideClick: boolean;
|
|
13
|
+
readonly dismissOnEscape: boolean;
|
|
14
|
+
readonly hideOnMobile: boolean;
|
|
15
|
+
readonly autoFocus: boolean;
|
|
16
|
+
readonly width: string;
|
|
17
|
+
readonly height: string;
|
|
18
|
+
readonly right: string;
|
|
19
|
+
readonly bottom: string;
|
|
20
|
+
readonly zIndex: number;
|
|
21
|
+
readonly padding: string;
|
|
22
|
+
readonly borderRadius: string;
|
|
23
|
+
readonly background: string;
|
|
24
|
+
readonly badgeBackground: string;
|
|
25
|
+
readonly badgeColor: string;
|
|
26
|
+
readonly titleColor: string;
|
|
27
|
+
readonly qrBackground: string;
|
|
28
|
+
readonly footerColor: string;
|
|
29
|
+
readonly closeColor: string;
|
|
30
|
+
readonly closeBackground: string;
|
|
31
|
+
}
|
|
32
|
+
export declare class QrModals extends LitElement {
|
|
33
|
+
open: boolean;
|
|
34
|
+
title: string;
|
|
35
|
+
badgeLabel: string;
|
|
36
|
+
footerText: string;
|
|
37
|
+
closeLabel: string;
|
|
38
|
+
qrAsset: string;
|
|
39
|
+
qrAlt: string;
|
|
40
|
+
dismissOnOutsideClick: boolean;
|
|
41
|
+
dismissOnEscape: boolean;
|
|
42
|
+
hideOnMobile: boolean;
|
|
43
|
+
autoFocus: boolean;
|
|
44
|
+
width: string;
|
|
45
|
+
height: string;
|
|
46
|
+
right: string;
|
|
47
|
+
bottom: string;
|
|
48
|
+
zIndex: number;
|
|
49
|
+
padding: string;
|
|
50
|
+
borderRadius: string;
|
|
51
|
+
background: string;
|
|
52
|
+
badgeBackground: string;
|
|
53
|
+
badgeColor: string;
|
|
54
|
+
titleColor: string;
|
|
55
|
+
qrBackground: string;
|
|
56
|
+
footerColor: string;
|
|
57
|
+
closeColor: string;
|
|
58
|
+
closeBackground: string;
|
|
59
|
+
private listening;
|
|
60
|
+
private focusOrigin;
|
|
61
|
+
static styles: import("lit").CSSResult;
|
|
62
|
+
connectedCallback(): void;
|
|
63
|
+
disconnectedCallback(): void;
|
|
64
|
+
protected updated(changed: PropertyValues<this>): void;
|
|
65
|
+
private syncDocumentListeners;
|
|
66
|
+
private removeDocumentListeners;
|
|
67
|
+
private handleOpenChange;
|
|
68
|
+
private readFocusOrigin;
|
|
69
|
+
private handleDocumentClick;
|
|
70
|
+
private handleDocumentKeydown;
|
|
71
|
+
private dismiss;
|
|
72
|
+
render(): TemplateResult | typeof nothing;
|
|
73
|
+
}
|
|
74
|
+
declare global {
|
|
75
|
+
interface HTMLElementTagNameMap {
|
|
76
|
+
'randstad-qr-modals': QrModals;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js";import t from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";import"./Icon.js";import{bodyM as n,bodyXS as r}from"../styles/fontStyles.js";import{normalizeCssValue as i}from"../helpers/cssUtils.js";import{normalizeText as a}from"../helpers/textUtils.js";import{normalizeImageSource as o}from"../helpers/qrModalsUtils.js";import{LitElement as s,css as c,html as l,nothing as u}from"lit";import{customElement as d,property as f}from"lit/decorators.js";import{styleMap as p}from"lit/directives/style-map.js";const m=`más herramientas para potenciar tu búsqueda laboral.`,h=`Randstad App`,g=`escaneá y descargá la app`,_=`cerrar`,v=`Código QR para descargar Randstad App`,y=`assets/img/download-app/qr-code.svg`,b=`linear-gradient(78.66deg, #0F1941 0%, #15235B 20%, #1B2D75 60%, #223994 79.81%, #2740A7 100%)`;let x=class extends s{constructor(...e){super(...e),this.open=!1,this.title=m,this.badgeLabel=h,this.footerText=g,this.closeLabel=_,this.qrAsset=y,this.qrAlt=v,this.dismissOnOutsideClick=!0,this.dismissOnEscape=!0,this.hideOnMobile=!0,this.autoFocus=!1,this.width=`284px`,this.height=`386px`,this.right=`100px`,this.bottom=`0px`,this.zIndex=1e3,this.padding=`24px`,this.borderRadius=`16px 16px 0 0`,this.background=b,this.badgeBackground=`var(--primary-light-blue, #00D7FF)`,this.badgeColor=`var(--secondary-color, #0F1941)`,this.titleColor=`var(--white, #FFFFFF)`,this.qrBackground=`var(--white, #FFFFFF)`,this.footerColor=`var(--secondary-color, #0F1941)`,this.closeColor=`var(--white, #FFFFFF)`,this.closeBackground=`rgba(15, 25, 65, 0.2)`,this.listening=!1,this.focusOrigin=null,this.handleDocumentClick=e=>{this.open&&this.dismissOnOutsideClick&&(e.composedPath().includes(this)||this.dismiss(`outside-click`))},this.handleDocumentKeydown=e=>{this.open&&this.dismissOnEscape&&!e.defaultPrevented&&e.key===`Escape`&&this.dismiss(`escape`)}}static{this.styles=c`:host{display:block;font-family:'Graphik',sans-serif}:host(:not([open])){display:none}.qr-modals{position:fixed;right:var(--qr-modals-right,100px);bottom:var(--qr-modals-bottom,0px);z-index:var(--qr-modals-z-index,1000);display:flex;flex-direction:column;gap:8px;width:var(--qr-modals-width,284px);height:var(--qr-modals-height,386px);padding:var(--qr-modals-padding,24px);border-radius:var(--qr-modals-radius,16px 16px 0 0);box-sizing:border-box;background:var(--qr-modals-background,linear-gradient(78.66deg,#0F1941 0%,#15235B 20%,#1B2D75 60%,#223994 79.81%,#2740A7 100%))}.qr-modals-close{position:absolute;top:16px;right:16px;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;padding:8px;border:none;color:var(--qr-modals-close-color,var(--white,#FFFFFF));background:var(--qr-modals-close-background,rgba(15,25,65,0.2));cursor:pointer;box-sizing:border-box}.qr-modals-close:hover{background:var(--qr-modals-close-hover-background,rgba(15,25,65,0.35))}.qr-modals-close:focus-visible{outline:2px solid var(--primary-light-blue,#00D7FF);outline-offset:3px}.qr-modals-badge{${r}align-self:center;flex-shrink:0;padding:5px 12px;border-radius:999px;background:var(--qr-modals-badge-background,var(--primary-light-blue,#00D7FF));color:var(--qr-modals-badge-color,var(--secondary-color,#0F1941))}.qr-modals-title{${n}flex-shrink:0;margin:0;color:var(--qr-modals-title-color,var(--white,#FFFFFF));text-align:center}.content-qr{display:flex;flex:1 1 auto;flex-direction:column;align-items:center;width:100%;max-width:100%;height:auto;min-height:0;border-radius:8px;padding:16px 16px 8px;box-sizing:border-box;background:var(--qr-modals-qr-background,var(--white,#FFFFFF))}.qr-modals-image-wrapper{position:relative;flex:1 1 auto;width:100%;height:100%;min-height:0}.qr-modals-image{position:absolute;inset:0;display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain}.footer-text{${r}flex-shrink:0;margin:0;color:var(--qr-modals-footer-color,var(--secondary-color,#0F1941));text-align:center}@media (max-width:940px){:host([hide-on-mobile]){display:none}}@media (prefers-reduced-motion:reduce){.qr-modals-close{transition:none}}`}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.syncDocumentListeners()}disconnectedCallback(){this.removeDocumentListeners(),super.disconnectedCallback()}updated(e){super.updated(e),(e.has(`open`)||e.has(`dismissOnOutsideClick`)||e.has(`dismissOnEscape`))&&this.syncDocumentListeners(),e.has(`open`)&&this.handleOpenChange()}syncDocumentListeners(){let e=this.isConnected&&this.open&&(this.dismissOnOutsideClick||this.dismissOnEscape);if(e&&!this.listening){let e=this.ownerDocument;if(!e)return;e.addEventListener(`click`,this.handleDocumentClick,!0),e.addEventListener(`keydown`,this.handleDocumentKeydown,!0),this.listening=!0}else e||this.removeDocumentListeners()}removeDocumentListeners(){if(!this.listening)return;let e=this.ownerDocument;e&&(e.removeEventListener(`click`,this.handleDocumentClick,!0),e.removeEventListener(`keydown`,this.handleDocumentKeydown,!0)),this.listening=!1}handleOpenChange(){if(this.open){this.focusOrigin=this.readFocusOrigin(),this.autoFocus&&this.shadowRoot?.querySelector(`.qr-modals-close`)?.focus();return}let e=this.focusOrigin;this.focusOrigin=null,e&&e.isConnected&&typeof e.focus==`function`&&e.focus()}readFocusOrigin(){let e=this.ownerDocument?.activeElement;return e&&typeof e.focus==`function`?e:null}dismiss(e){this.open&&(this.open=!1,this.dispatchEvent(new CustomEvent(`qr-modals-dismiss`,{detail:{reason:e},bubbles:!0,composed:!0})))}render(){if(!this.open)return u;let e=a(this.title,m),t=o(this.qrAsset,y),n=typeof this.zIndex==`number`&&Number.isFinite(this.zIndex)&&this.zIndex>=0?String(Math.trunc(this.zIndex)):`1000`;return l`<aside class="qr-modals" part="dialog" role="dialog" aria-label=${e} style=${p({"--qr-modals-width":i(this.width,`284px`),"--qr-modals-height":i(this.height,`386px`),"--qr-modals-right":i(this.right,`100px`),"--qr-modals-bottom":i(this.bottom,`0px`),"--qr-modals-z-index":n,"--qr-modals-padding":i(this.padding,`24px`),"--qr-modals-radius":i(this.borderRadius,`16px 16px 0 0`),"--qr-modals-background":i(this.background,b),"--qr-modals-badge-background":i(this.badgeBackground,`var(--primary-light-blue, #00D7FF)`),"--qr-modals-badge-color":i(this.badgeColor,`var(--secondary-color, #0F1941)`),"--qr-modals-title-color":i(this.titleColor,`var(--white, #FFFFFF)`),"--qr-modals-qr-background":i(this.qrBackground,`var(--white, #FFFFFF)`),"--qr-modals-footer-color":i(this.footerColor,`var(--secondary-color, #0F1941)`),"--qr-modals-close-color":i(this.closeColor,`var(--white, #FFFFFF)`),"--qr-modals-close-background":i(this.closeBackground,`rgba(15, 25, 65, 0.2)`)})} ><button type="button" class="qr-modals-close" part="close-button" aria-label=${a(this.closeLabel,_)} @click=${()=>this.dismiss(`close-button`)} ><randstad-icon name="close" size="16px" color="currentColor" aria-hidden="true"></randstad-icon></button><span class="qr-modals-badge" part="badge">${a(this.badgeLabel,h)}</span><p class="qr-modals-title" part="title">${e}</p><div class="content-qr" part="qr-container"><div class="qr-modals-image-wrapper" part="qr-wrapper"><img class="qr-modals-image" part="qr-image" src=${t} alt=${a(this.qrAlt,v)} width="164" height="164" decoding="async" /></div><p class="footer-text" part="footer">${a(this.footerText,g)}</p></div></aside>`}};t([f({type:Boolean,reflect:!0}),e(`design:type`,Object)],x.prototype,`open`,void 0),t([f({type:String}),e(`design:type`,String)],x.prototype,`title`,void 0),t([f({type:String}),e(`design:type`,String)],x.prototype,`badgeLabel`,void 0),t([f({type:String}),e(`design:type`,String)],x.prototype,`footerText`,void 0),t([f({type:String}),e(`design:type`,String)],x.prototype,`closeLabel`,void 0),t([f({type:String}),e(`design:type`,String)],x.prototype,`qrAsset`,void 0),t([f({type:String}),e(`design:type`,String)],x.prototype,`qrAlt`,void 0),t([f({type:Boolean}),e(`design:type`,Object)],x.prototype,`dismissOnOutsideClick`,void 0),t([f({type:Boolean}),e(`design:type`,Object)],x.prototype,`dismissOnEscape`,void 0),t([f({type:Boolean,reflect:!0,attribute:`hide-on-mobile`}),e(`design:type`,Object)],x.prototype,`hideOnMobile`,void 0),t([f({type:Boolean}),e(`design:type`,Object)],x.prototype,`autoFocus`,void 0),t([f({type:String}),e(`design:type`,String)],x.prototype,`width`,void 0),t([f({type:String}),e(`design:type`,String)],x.prototype,`height`,void 0),t([f({type:String}),e(`design:type`,String)],x.prototype,`right`,void 0),t([f({type:String}),e(`design:type`,String)],x.prototype,`bottom`,void 0),t([f({type:Number}),e(`design:type`,Object)],x.prototype,`zIndex`,void 0),t([f({type:String}),e(`design:type`,String)],x.prototype,`padding`,void 0),t([f({type:String}),e(`design:type`,String)],x.prototype,`borderRadius`,void 0),t([f({type:String}),e(`design:type`,String)],x.prototype,`background`,void 0),t([f({type:String}),e(`design:type`,String)],x.prototype,`badgeBackground`,void 0),t([f({type:String}),e(`design:type`,String)],x.prototype,`badgeColor`,void 0),t([f({type:String}),e(`design:type`,String)],x.prototype,`titleColor`,void 0),t([f({type:String}),e(`design:type`,String)],x.prototype,`qrBackground`,void 0),t([f({type:String}),e(`design:type`,String)],x.prototype,`footerColor`,void 0),t([f({type:String}),e(`design:type`,String)],x.prototype,`closeColor`,void 0),t([f({type:String}),e(`design:type`,String)],x.prototype,`closeBackground`,void 0),x=t([d(`randstad-qr-modals`)],x);export{x as QrModals};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./Icon.js";import{bodyS as e}from"../styles/fontStyles.js";import t from"../styles/globalStyles.js";import{LitElement as n,css as r,html as i}from"lit";var a=class extends n{static{this.styles=[t,r`:host{display:flex;position:fixed;align-items:center;max-width:100dvw;height:auto;z-index:9997}:host([position="top-left"]){top:16px;left:16px;right:auto;transform:none;justify-content:flex-start}:host([position="top-center"]){top:16px;left:50%;transform:translateX(-50%);justify-content:center}:host([position="top-right"]){top:16px;right:16px;left:auto;transform:none;justify-content:flex-end}:host([position="bottom-left"]){bottom:16px;left:16px;right:auto;transform:none;justify-content:flex-start}:host([position="bottom-center"]){bottom:16px;left:50%;transform:translateX(-50%);justify-content:center}:host([position="bottom-right"]){bottom:16px;right:16px;left:auto;transform:none;justify-content:flex-end}:host(.mobile){bottom:16px !important;top:auto !important;left:50% !important;transform:translateX(-50%) !important;justify-content:center !important;width:100%}:host(.mobile) .container{width:90dvw !important}:host(.navbar-visible)[position="bottom-left"],:host(.navbar-visible)[position="bottom-center"],:host(.navbar-visible)[position="bottom-right"]{bottom:calc(100px)}:host(.navbar-visible.mobile){bottom:calc(100px) !important}.container{${e};display:flex;align-items:center;box-sizing:border-box;min-height:48px;width:401px;border-radius:4px;padding:8px;gap:8px;white-space:nowrap;color:var(--white)}.message{display
|
|
1
|
+
import"./Icon.js";import{bodyS as e}from"../styles/fontStyles.js";import t from"../styles/globalStyles.js";import{LitElement as n,css as r,html as i}from"lit";var a=class extends n{static{this.styles=[t,r`:host{display:flex;position:fixed;align-items:center;max-width:100dvw;height:auto;z-index:9997}:host([position="top-left"]){top:16px;left:16px;right:auto;transform:none;justify-content:flex-start}:host([position="top-center"]){top:16px;left:50%;transform:translateX(-50%);justify-content:center}:host([position="top-right"]){top:16px;right:16px;left:auto;transform:none;justify-content:flex-end}:host([position="bottom-left"]){bottom:16px;left:16px;right:auto;transform:none;justify-content:flex-start}:host([position="bottom-center"]){bottom:16px;left:50%;transform:translateX(-50%);justify-content:center}:host([position="bottom-right"]){bottom:16px;right:16px;left:auto;transform:none;justify-content:flex-end}:host(.mobile){bottom:16px !important;top:auto !important;left:50% !important;transform:translateX(-50%) !important;justify-content:center !important;width:100%}:host(.mobile) .container{width:90dvw !important}:host(.navbar-visible)[position="bottom-left"],:host(.navbar-visible)[position="bottom-center"],:host(.navbar-visible)[position="bottom-right"]{bottom:calc(100px)}:host(.navbar-visible.mobile){bottom:calc(100px) !important}.container{${e};display:flex;align-items:center;box-sizing:border-box;min-height:48px;width:401px;border-radius:4px;padding:8px;gap:8px;white-space:nowrap;color:var(--white)}.message{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;text-overflow:ellipsis;white-space:pre-wrap;max-height:calc(3 * 25px);line-height:25px;word-break:break-word;max-width:100%}.container{color:var(--white)}randstad-icon{color:var(--white)}randstad-icon svg{fill:var(--white)}.icon{font-size:18px}.hidden{display:none}.success{background-color:var(--ui-positive)}.error{background-color:var(--ui-negative)}.warning{background-color:var(--ui-warning)}.informative{background-color:var(--ui-informative)}`]}static get properties(){return{type:{type:String},icon:{type:String},message:{type:String},open:{type:Boolean},position:{type:String,reflect:!0}}}constructor(){super(),this.type=`informative`,this.icon=`info`,this.message=`Este es un mensaje.`,this.open=!1,this.position=`bottom-center`,this.isMobile=!1,this._navbarObserver=null,this.updateResponsiveStyles=this.updateResponsiveStyles.bind(this)}connectedCallback(){super.connectedCallback(),window.addEventListener(`resize`,this.updateResponsiveStyles),this.updateResponsiveStyles(),this.observeNavbar()}disconnectedCallback(){window.removeEventListener(`resize`,this.updateResponsiveStyles),this._navbarObserver&&=(this._navbarObserver.disconnect(),null),super.disconnectedCallback()}updateResponsiveStyles(){this.isMobile=window.innerWidth<=940,this.classList.toggle(`mobile`,this.isMobile),this.updateNavbarPosition()}updated(e){e.has(`position`)&&this.updateNavbarPosition()}isNavbarVisible(){let e=document.querySelector(`randstad-navbar`);return!(!e||e.hasAttribute(`hidden`)||window.innerWidth>940&&!e.hasAttribute(`desktop`))}updateNavbarPosition(){let e=this.isNavbarVisible(),t=this.position.startsWith(`bottom`),n=e&&(t||this.isMobile);this.classList.toggle(`navbar-visible`,n)}observeNavbar(){if(this._navbarObserver)return;let e=document.querySelector(`randstad-navbar`);e&&(this._navbarObserver=new MutationObserver(()=>this.updateNavbarPosition()),this._navbarObserver.observe(e,{attributes:!0,attributeFilter:[`hidden`,`desktop`]}))}render(){let e=this.type===`error`||this.type===`warning`?`alert`:`status`;return i`<div class="container ${this.open?``:`hidden`} ${this.type}" role="${e}" aria-live="polite" ><randstad-icon name=${this.icon} size="24px" color="white"></randstad-icon><span class="message">${this.message}</span></div>`}};customElements.define(`randstad-snackbar`,a);
|