@randstad-uca/design-system 1.0.122 → 1.0.124

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.
Files changed (82) hide show
  1. package/dist/_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js +1 -0
  2. package/dist/_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js +1 -0
  3. package/dist/autoloader.d.ts +21 -0
  4. package/dist/autoloader.js +1 -0
  5. package/dist/components/Accordion.d.ts +1 -0
  6. package/dist/components/Accordion.js +1 -0
  7. package/dist/components/AccordionList.js +1 -0
  8. package/dist/components/Bubble.js +1 -0
  9. package/dist/components/Button.d.ts +1 -0
  10. package/dist/components/Button.js +1 -0
  11. package/dist/components/CalendarOverlay.d.ts +1 -0
  12. package/dist/components/CalendarOverlay.js +1 -0
  13. package/dist/components/Carousel.d.ts +1 -0
  14. package/dist/components/Carousel.js +1 -0
  15. package/dist/components/CarouselCards.d.ts +1 -0
  16. package/dist/components/CarouselCards.js +1 -0
  17. package/dist/components/Checkbox.js +4 -0
  18. package/dist/components/DatePicker.d.ts +1 -0
  19. package/dist/components/DatePicker.js +1 -0
  20. package/dist/components/File.js +1 -0
  21. package/dist/components/FilterBar.js +1 -0
  22. package/dist/components/Form.d.ts +1 -0
  23. package/dist/components/Form.js +1 -0
  24. package/dist/components/FormGroup.js +1 -0
  25. package/dist/components/Icon.js +1 -0
  26. package/dist/components/LineProgress.d.ts +57 -0
  27. package/dist/components/LineProgress.js +1 -0
  28. package/dist/components/MfaModal.js +1 -0
  29. package/dist/components/Modal.d.ts +1 -0
  30. package/dist/components/Modal.js +1 -0
  31. package/dist/components/Navbar.d.ts +1 -0
  32. package/dist/components/Navbar.js +1 -0
  33. package/dist/components/Notice.d.ts +1 -0
  34. package/dist/components/Notice.js +1 -0
  35. package/dist/components/Popup.js +1 -0
  36. package/dist/components/ProgressCard.d.ts +58 -0
  37. package/dist/components/ProgressCard.js +1 -0
  38. package/dist/components/ProgressCircle.js +1 -0
  39. package/dist/components/QrModals.d.ts +78 -0
  40. package/dist/components/QrModals.js +1 -0
  41. package/dist/components/Radio.js +1 -0
  42. package/dist/components/Select.d.ts +1 -0
  43. package/dist/components/Select.js +3 -0
  44. package/dist/components/Snackbar.d.ts +1 -1
  45. package/dist/components/Snackbar.js +1 -0
  46. package/dist/components/SocialMediaInput.js +1 -0
  47. package/dist/components/Stepper.d.ts +1 -0
  48. package/dist/components/Stepper.js +1 -0
  49. package/dist/components/Tabs.d.ts +1 -0
  50. package/dist/components/Tabs.js +1 -0
  51. package/dist/components/Upload.d.ts +1 -0
  52. package/dist/components/Upload.js +1 -0
  53. package/dist/components/icons.js +1 -0
  54. package/dist/helpers/BaseControl.d.ts +1 -0
  55. package/dist/helpers/BaseControl.js +1 -0
  56. package/dist/helpers/BaseUpload.js +1 -0
  57. package/dist/helpers/cssUtils.d.ts +2 -0
  58. package/dist/helpers/cssUtils.js +1 -0
  59. package/dist/helpers/filterBarUtils.js +1 -0
  60. package/dist/helpers/progressUtils.d.ts +46 -0
  61. package/dist/helpers/progressUtils.js +1 -0
  62. package/dist/helpers/qrModalsUtils.d.ts +8 -0
  63. package/dist/helpers/qrModalsUtils.js +1 -0
  64. package/dist/helpers/textUtils.d.ts +1 -0
  65. package/dist/helpers/textUtils.js +1 -0
  66. package/dist/index.d.ts +5 -0
  67. package/dist/index.js +1 -5181
  68. package/dist/package.json +19 -7
  69. package/dist/stories/LineProgress.stories.d.ts +71 -0
  70. package/dist/stories/ProgressCard.stories.d.ts +86 -0
  71. package/dist/stories/QrModals.stories.d.ts +106 -0
  72. package/dist/styles/error.js +1 -0
  73. package/dist/styles/focus.js +1 -0
  74. package/dist/styles/fontStyles.js +1 -0
  75. package/dist/styles/globalStyles.js +26 -0
  76. package/dist/styles/mix.js +1 -0
  77. package/dist/styles/progress-bar-upload.js +1 -0
  78. package/dist/styles/scrollbar.js +1 -0
  79. package/dist/styles/tooltip.js +1 -0
  80. package/dist/utils/file-format.js +1 -0
  81. package/package.json +19 -7
  82. package/dist/index.js.map +0 -1
@@ -0,0 +1 @@
1
+ function e(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}export{e as default};
@@ -0,0 +1 @@
1
+ function e(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)}export{e as default};
@@ -0,0 +1,21 @@
1
+ export declare const COMPONENT_TAG_LOADERS: Readonly<Record<string, () => Promise<unknown>>>;
2
+ /**
3
+ * Dynamically imports and registers the Web Component for the given tag name
4
+ * if it is part of the design system and not yet defined in `customElements`.
5
+ */
6
+ export declare function loadComponent(tagName: string): Promise<void>;
7
+ /**
8
+ * Scans `root` (and any open Shadow Roots within it) for unregistered
9
+ * design-system custom elements and loads their modules in parallel.
10
+ */
11
+ export declare function discover(root?: Element | Document | DocumentFragment): Promise<void>;
12
+ /**
13
+ * Starts a `MutationObserver` on `root` (defaults to `document.documentElement`)
14
+ * that automatically discovers and loads design-system Web Components as they
15
+ * are inserted into the DOM.
16
+ */
17
+ export declare function startAutoloader(root?: Node): MutationObserver | null;
18
+ /**
19
+ * Stops the active `MutationObserver` created by `startAutoloader()`.
20
+ */
21
+ export declare function stopAutoloader(): void;
@@ -0,0 +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`),"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};
@@ -1,4 +1,5 @@
1
1
  import { LitElement, TemplateResult } from 'lit';
2
+ import './Icon';
2
3
  export declare class AccordionPanel extends LitElement {
3
4
  title: string;
4
5
  private isOpen;
@@ -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}from"../styles/fontStyles.js";import{LitElement as r,css as i,html as a}from"lit";import{customElement as o,property as s,state as c}from"lit/decorators.js";const l=`(min-width: 501px)`;let u=class extends r{constructor(...e){super(...e),this.title=``,this.isOpen=!1,this.isDesktop=window.matchMedia(l).matches,this.handleMediaQueryChange=e=>{this.isDesktop=e.matches}}static{this.styles=i`:host{display:flex;flex-direction:column;font-family:'Graphik',sans-serif}.header{position:relative;display:flex;justify-content:space-between;gap:16px;flex-direction:row;align-items:center;cursor:pointer;min-height:25px;padding-bottom:16px}.title{${n}color:var(--secondary-color)}.icon-wrapper{position:absolute;top:-7px;right:0;width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:background-color .5s ease-in-out}.icon{transition:transform .5s ease-in-out}.content{overflow:hidden;height:0;max-height:0;opacity:0}.content.open{max-height:1000px;padding-bottom:16px;height:auto;opacity:1}.content,.content.open{transition:height .5s ease-in-out,opacity .5s ease-in-out,padding-bottom .3s ease-in-out}:host::after{content:'';display:block;height:1px;background-color:var(--secondary-color-20);width:100%}@media (min-width:501px) and (hover:hover) and (pointer:fine){.header:hover .icon-wrapper{background-color:var(--primary-color-10)}}@media (max-width:650px){.title{max-width:90%}}@media (max-width:501px){.title{max-width:90%}}`}connectedCallback(){super.connectedCallback(),this.mediaQueryList=window.matchMedia(l),this.mediaQueryList.addEventListener(`change`,this.handleMediaQueryChange)}disconnectedCallback(){super.disconnectedCallback(),this.mediaQueryList.removeEventListener(`change`,this.handleMediaQueryChange)}toggle(){this.isOpen=!this.isOpen}render(){let e=a`<randstad-icon name="${this.isOpen?`arrow_up`:`arrow_down`}" size="24" .color=${`var( --primary-color )`} ></randstad-icon>`;return a`<div class="header" @click=${this.toggle}><div class="title">${this.title}</div><div class="icon">${this.isDesktop?a`<div class="icon-wrapper">${e}</div>`:e}</div></div><div class="content ${this.isOpen?`open`:``}"><slot></slot></div>`}};t([s({type:String}),e(`design:type`,Object)],u.prototype,`title`,void 0),t([c(),e(`design:type`,Object)],u.prototype,`isOpen`,void 0),t([c(),e(`design:type`,Object)],u.prototype,`isDesktop`,void 0),u=t([o(`accordion-panel`)],u);export{u as AccordionPanel};
@@ -0,0 +1 @@
1
+ import e from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";import{LitElement as t,css as n,html as r}from"lit";import{customElement as i}from"lit/decorators.js";let a=class extends t{static{this.styles=n`:host{display:flex;flex-direction:column;gap:16px}`}render(){return r`<slot></slot>`}};a=e([i(`accordion-list`)],a);export{a as AccordionList};
@@ -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{LitElement as n,css as r,html as i}from"lit";import{customElement as a,property as o,state as s}from"lit/decorators.js";import{classMap as c}from"lit/directives/class-map.js";let l=class extends n{constructor(...e){super(...e),this.message=``,this.position=`top`,this.variant=`bubble`,this.visible=!0,this.arrowAlign=`15px`,this.isAnimating=!1}static{this.styles=r`:host{display:inline-block;position:relative;--arrow-left:15px}.bubble{position:absolute;display:inline-flex;align-items:center;gap:10px;box-sizing:border-box;z-index:10;--bubble-bg:var(--bubble-background,#0F1941);--bubble-color:var(--bubble-text-color,#ffffff);--bubble-font:var(--bubble-font-family,'Graphik',sans-serif);--bubble-arrow-size:8px;background-color:var(--bubble-bg);color:var(--bubble-color);font-family:var(--bubble-font);width:var(--bubble-custom-width,auto);height:var(--bubble-custom-height,auto);font-weight:400;font-size:12px;line-height:100%;padding:12px 16px;border-radius:6px;opacity:0;visibility:hidden;transform:translateY(5px);transition:all 0.3s cubic-bezier(0.4,0,0.2,1)}.bubble.position-bottom{bottom:calc(100%);top:auto !important}.bubble.hidden{display:none}.bubble.visible{opacity:1;visibility:visible;transform:translateY(0)}.bubble::after{content:'';position:absolute;width:0;height:0;border-style:solid}.bubble.position-top::after{top:calc(var(--bubble-arrow-size) * -1);left:var(--arrow-left);border-width:0 var(--bubble-arrow-size) var(--bubble-arrow-size) var(--bubble-arrow-size);border-color:transparent transparent var(--bubble-bg) transparent}.bubble.position-bottom::after{bottom:calc(var(--bubble-arrow-size) * -1);left:var(--arrow-left);border-width:var(--bubble-arrow-size) var(--bubble-arrow-size) 0 var(--bubble-arrow-size);border-color:var(--bubble-bg) transparent transparent transparent}.bubble.circle{border-radius:50%;padding:0;justify-content:center;min-width:32px;min-height:32px}.bubble.circle::after{display:none}.bubble.plain::after{display:none}.bubble-icon ::slotted(*){width:18px;height:18px;display:block}.bubble-message{max-width:250px;word-wrap:break-word}`}disconnectedCallback(){super.disconnectedCallback(),this.clearDurationTimer()}updated(e){super.updated(e),e.has(`visible`)&&(this.visible?this.startDurationTimer():this.clearDurationTimer())}startDurationTimer(){this.clearDurationTimer(),this.duration&&this.duration>0&&(this.hideTimeout=window.setTimeout(()=>this.hide(),this.duration))}clearDurationTimer(){this.hideTimeout&&=(window.clearTimeout(this.hideTimeout),void 0)}show(){this.visible=!0}hide(){this.visible=!1}render(){let e={bubble:!0,visible:this.visible,hidden:!this.visible,[`position-${this.position}`]:!0,[this.variant]:!0},t=[this.position!==`bottom`&&this.top?`top: ${this.top}`:``,this.left?`left: ${this.left}`:``,`--arrow-left: ${this.arrowAlign}`,this.width?`--bubble-custom-width: ${this.width}`:``,this.height?`--bubble-custom-height: ${this.height}`:``,this.backgroundColor?`--bubble-background: ${this.backgroundColor}`:``,this.textColor?`--bubble-text-color: ${this.textColor}`:``,this.fontFamily?`--bubble-font-family: ${this.fontFamily}`:``].filter(Boolean).join(`; `);return i`<div class=${c(e)} style=${t}>${this.icon||this.variant===`circle`?i`<span class="bubble-icon">${this.icon?i`<randstad-icon name="${this.icon}" size="18px"></randstad-icon>`:i`<slot name="icon"></slot>`}</span>`:``} ${this.variant===`circle`?``:i`<span class="bubble-message">${this.message}</span><slot></slot>`}</div>`}};t([o({type:String}),e(`design:type`,Object)],l.prototype,`message`,void 0),t([o({type:Number}),e(`design:type`,Number)],l.prototype,`duration`,void 0),t([o({type:String}),e(`design:type`,String)],l.prototype,`position`,void 0),t([o({type:String}),e(`design:type`,String)],l.prototype,`variant`,void 0),t([o({type:Boolean}),e(`design:type`,Object)],l.prototype,`visible`,void 0),t([o({type:String}),e(`design:type`,String)],l.prototype,`icon`,void 0),t([o({type:String}),e(`design:type`,Object)],l.prototype,`arrowAlign`,void 0),t([o({type:String}),e(`design:type`,String)],l.prototype,`backgroundColor`,void 0),t([o({type:String}),e(`design:type`,String)],l.prototype,`textColor`,void 0),t([o({type:String}),e(`design:type`,String)],l.prototype,`fontFamily`,void 0),t([o({type:String}),e(`design:type`,String)],l.prototype,`width`,void 0),t([o({type:String}),e(`design:type`,String)],l.prototype,`height`,void 0),t([o({type:String}),e(`design:type`,String)],l.prototype,`top`,void 0),t([o({type:String}),e(`design:type`,String)],l.prototype,`left`,void 0),t([s(),e(`design:type`,Object)],l.prototype,`isAnimating`,void 0),l=t([a(`randstad-bubble`)],l);export{l as RandstadBubble};
@@ -1,4 +1,5 @@
1
1
  import { LitElement } from 'lit';
2
+ import './Icon';
2
3
  export declare class RandstadButton extends LitElement {
3
4
  type: 'button' | 'submit' | 'reset';
4
5
  variant: 'button-primary' | 'button-secondary' | 'button-tertiary' | 'button-round' | 'button-card' | 'button-icon' | 'button-danger';
@@ -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{bodyL as n,bodyM as r}from"../styles/fontStyles.js";import{LitElement as i,css as a,html as o}from"lit";import{customElement as s,property as c}from"lit/decorators.js";import{classMap as l}from"lit/directives/class-map.js";let u=class extends i{constructor(...e){super(...e),this.type=`button`,this.variant=`button-primary`,this.size=`md`,this.label=``,this.loader=!1,this.iconPosition=`left`,this.iconName=null,this.disabled=!1,this.idevent=``}static{this.styles=a`:host{display:inline-block;--content-padding:16px}.button{display:flex;align-items:center;justify-content:center;border-radius:4px;cursor:pointer;font-weight:400;padding:0;border:none;transition:background-color 0.2s,color 0.2s,box-shadow 0.2s;gap:4px;width:100%;position:relative;box-sizing:border-box}.content-container{display:flex;align-items:center;justify-content:center;gap:4px;width:100%;padding:var(--content-padding);height:100%}.content-container .label-text{display:flex;align-items:center;justify-content:center;height:100%}.button-lg{${n}min-height:62px}.button-md{${r}min-height:57px}.button-sm{width:62px;height:62px;min-width:62px;min-height:62px;padding:0}.button-primary{background-color:var(--primary-color);color:var(--white)}.button-primary:not([disabled]):hover{background-color:var(--primary-button-hover)}.button-primary:not([disabled]):active{background-color:var(--primary-button-active)}.button-primary:not([disabled]):focus-visible{outline:2px solid var(--primary-button-focus);outline-offset:2px}.button-danger:not([disabled]):focus-visible{outline:2px solid var(--primary-button-focus);outline-offset:2px}.button-primary[disabled]{color:var(--secondary-color-60);background-color:var(--secondary-color-20);cursor:default}.button-secondary{background:none;color:var(--primary-color);border:1px solid var(--primary-color)}.button-secondary:not([disabled]):hover{color:var(--primary-button-hover);border-color:var(--primary-button-hover)}.button-secondary:not([disabled]):active{color:var(--secondary-color-80);border-color:var(--secondary-color-80)}.button-secondary:not([disabled]):focus-visible{outline:2px solid var(--primary-color);outline-offset:2px}.button-secondary[disabled]{color:var(--secondary-color-60);border-color:var(--secondary-color-60);cursor:default}.button-danger{background-color:var(--danger-button,#E00F0F);color:var(--white)}.button-danger:not([disabled]):hover{background-color:var(--danger-button-hover,#C90D0D)}.button-danger:not([disabled]):active{background-color:var(--danger-button-active,#B30C0C)}.button-danger[disabled]{background-color:#CFD1D9;color:var(--secondary-color-60);cursor:default}.button-tertiary{background:none;border:none;color:var(--primary-color)}.button-tertiary:not([disabled]):hover{background:var(--primary-color-5)}.button-tertiary:not([disabled]):active{background-color:var(--primary-color-10)}.button-tertiary:not([disabled]):focus-visible{outline:2px solid var(--primary-color);outline-offset:2px}.button-tertiary[disabled]{color:var(--secondary-color-60);cursor:default}.button-round{width:48px;height:48px;border-radius:50%;background-color:var(--white);box-shadow:0px 2px 5px rgba(0,0,0,0.2);padding:0}.button-round:not([disabled]):hover{background-color:var(--randstad-blue-10)}.button-round:not([disabled]):active{background-color:var(--randstad-blue-40)}.button-round:not([disabled]):focus-visible{outline:2px solid var(--primary-color);outline-offset:2px}.button-round[disabled]{background-color:var(--secondary-color-20);cursor:default}.button-icon-img{width:24px;height:24px;object-fit:contain}.button-round img.button-icon{width:24px;height:24px}.button-icon{background:none;border:none;color:var(--primary-color);padding:4px}.button-icon:not([disabled]):hover{background:var(--primary-color-5)}.button-icon:not([disabled]):active{background-color:var(--primary-color-10)}.button-icon:not([disabled]):focus-visible{outline:2px solid var(--primary-color);outline-offset:2px}.button-icon[disabled]{color:var(--secondary-color-60);cursor:default}.loader,.label-text,.button-icon{line-height:1}.loader{display:flex;align-items:center;justify-content:center;gap:8px}.dot{border-radius:50%;display:inline-block;animation:growAndFade 2.4s infinite ease-in-out}.button-md .dot{width:6px;height:6px}.button-lg .dot{width:8px;height:8px}.dot:nth-child(1){animation-delay:0s}.dot:nth-child(2){animation-delay:0.8s}.dot:nth-child(3){animation-delay:1.6s}@keyframes growAndFade{0%{transform:scale(1)}16.67%{transform:scale(1.5)}33.33%{transform:scale(1.5)}50%{transform:scale(1)}100%{transform:scale(1)}}.button-primary.loader .dot,.button-secondary.loader .dot{background-color:var(--white)}.button-secondary.loader{background-color:var(--primary-color);border:none;color:var(--white)}.button-primary.loader[disabled]{background-color:var(--primary-color) !important;color:var(--white) !important}.button-secondary.loader[disabled]{background-color:var(--primary-color) !important;border-color:var(--primary-color) !important;color:var(--white) !important}.button-tertiary.loader[disabled]{color:var(--primary-color) !important;background-color:transparent !important}.button-round.loader[disabled]{background-color:var(--white) !important}.button-icon.loader[disabled]{color:var(--primary-color) !important;background-color:transparent !important}.button-card{font-family:'Graphik';background-color:var(--primary-color);color:var(--white);border-radius:4px;padding:4px 16px;font-weight:400;font-size:12px;line-height:15px;letter-spacing:0%;text-align:center;vertical-align:middle}.button-card:not([disabled]):hover{background-color:#175197}.button-card:not([disabled]):active{background-color:#124077}.button-card:not([disabled]):focus-visible{outline:2px solid var(--primary-color);outline-offset:2px}.button-card[disabled]{background-color:#CFD1D9;color:#6F758D;cursor:default}`}handleClick(e){if(!this.disabled){if(this.type===`submit`){let e=this.closest(`form`);e&&e.requestSubmit()}else if(this.type===`reset`){let e=this.closest(`form`);e&&e.reset()}else this.idevent&&this.dispatchEvent(new CustomEvent(`randstad-button-click`,{detail:this.idevent,composed:!0,bubbles:!0,cancelable:!1}))}}render(){let e={button:!0,[this.variant]:!0,loader:this.loader,[`button-${this.size}`]:[`button-primary`,`button-secondary`,`button-tertiary`,`button-danger`].includes(this.variant)||this.size===`sm`},t=this.variant===`button-tertiary`?`var(--primary-color)`:`white`,n=o` ${this.iconSrc?o`<img src=${this.iconSrc} alt="icon" class="button-icon-img" part="button-icon"/>`:``} ${this.iconName?o`<randstad-icon name=${this.iconName} size="24px"></randstad-icon>`:``} `;return o`<button part="button" type=${this.type} class=${l(e)} ?disabled=${this.disabled||this.loader} ?aria-busy=${this.loader} @click=${this.handleClick} ><div class="content-container">${this.loader?o`<div class="loader"><span class="dot" style="background-color: ${t};"></span><span class="dot" style="background-color: ${t};"></span><span class="dot" style="background-color: ${t};"></span></div>`:o` ${this.iconPosition===`left`?n:``} ${this.label?o`<span class="label-text" part="label">${this.label}</span>`:o`<slot></slot>`} ${this.iconPosition===`right`?n:``} `}</div></button>`}};t([c({type:String}),e(`design:type`,String)],u.prototype,`type`,void 0),t([c({type:String}),e(`design:type`,String)],u.prototype,`variant`,void 0),t([c({type:String}),e(`design:type`,String)],u.prototype,`size`,void 0),t([c({type:String}),e(`design:type`,Object)],u.prototype,`label`,void 0),t([c({type:Boolean}),e(`design:type`,Object)],u.prototype,`loader`,void 0),t([c({type:String,attribute:`icon-src`}),e(`design:type`,String)],u.prototype,`iconSrc`,void 0),t([c({type:String}),e(`design:type`,String)],u.prototype,`iconPosition`,void 0),t([c({type:String}),e(`design:type`,Object)],u.prototype,`iconName`,void 0),t([c({type:Boolean,reflect:!0}),e(`design:type`,Boolean)],u.prototype,`disabled`,void 0),t([c({type:String}),e(`design:type`,Object)],u.prototype,`idevent`,void 0),u=t([s(`randstad-button`)],u);export{u as RandstadButton};
@@ -1,4 +1,5 @@
1
1
  import { LitElement } from "lit";
2
+ import "./Icon";
2
3
  export declare class CalendarOverlay extends LitElement {
3
4
  /**
4
5
  * La fecha actualmente seleccionada por el usuario.
@@ -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{bodyL as n,bodyM as r,bodyS as i}from"../styles/fontStyles.js";import{focusStyles as a}from"../styles/focus.js";import{scrollbarStyles as o}from"../styles/scrollbar.js";import{LitElement as s,css as c,html as l,nothing as u}from"lit";import{customElement as d,property as f,query as p,state as m}from"lit/decorators.js";import*as h from"date-fns";let g=class extends s{static{this.styles=[o,c`${a}.calendar-container{position:absolute;top:100%;left:0;z-index:10;border:1px solid var(--secondary-color-10,#e7e8ec);background:var(--white,#fff);border-radius:4px;margin-top:8px;padding:16px;box-shadow:0px 4px 8px rgba(0,0,0,0.1);font-family:Graphik;display:flex;flex-direction:column;box-sizing:border-box;min-width:360px}.header{margin-bottom:0}.weekdays-separator{width:100%;height:1px;background-color:var(--secondary-color-10,#e7e8ec);margin-top:0;margin-bottom:16px}.header{display:flex;justify-content:space-between;align-items:center}.nav-button{background:none;border:none;cursor:pointer;padding:8px;color:var(--primary-color,#2175d9);border-radius:50%;transition:background-color 0.2s;gap:8px}.nav-button:hover{background-color:var(--randstad-blue-10,#e8f1fb)}.header-left,.header-right{display:flex;align-items:center;gap:4px}.month-year-button{${i}display:flex;align-items:center;justify-content:center;gap:8px;background:none;border:none;cursor:pointer;transition:background-color 0.2s;color:var(--randstad-blue-80,#3c4257);border-radius:16px;width:auto;height:41px;padding:8px}.month-year-button:hover{background-color:var(--randstad-blue-10,#e8f1fb)}.month-year-button randstad-icon{color:var(--primary-color,#2175d9)}.weekdays{display:grid;place-items:center;grid-template-columns:repeat(7,1fr);text-align:center;color:var(--secondary-dark-blue-60,#6c7387);opacity:1;margin-bottom:8px;font-size:16px;font-style:normal;font-weight:500;margin-top:0}.days-grid{display:grid;place-items:center;grid-template-columns:repeat(7,1fr);gap:8px}.day{${r}display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;cursor:pointer;background-color:transparent;border:none;color:var(--secondary-color-80,#3c4257);padding:0;position:relative}.day:hover{background-color:var(--randstad-blue-10,#e8f1fb)}.day.today{color:var(--primary-color,#2175d9);font-weight:500}.day.today::after{content:'';position:absolute;bottom:0;left:0;right:0;width:100%;height:2px;background-color:var(--primary-color,#2175d9);border-radius:2px}.day.selected{background-color:var(--primary-color,#2175d9);color:var(--secondary-white,#fff);font-weight:500}.day.secondary-selected{background-color:var(--secondary-color-10,#e7e8ec);color:var(--secondary-dark-blue-80,#3c4257);font-weight:500;border:1px solid var(--secondary-color-10,#e7e8ec)}.year-grid,.month-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.year-button,.month-button{${r}background:var(--secondary-white,#fff);border:1px solid transparent;color:var(--secondary-dark-blue-80,#3c4257);cursor:pointer;transition:background-color 0.2s,border-color 0.2s;border-radius:9999px;padding:4px 16px;text-align:center;display:flex;justify-content:center;align-items:center;height:38px}.year-button:hover,.month-button:hover{background-color:var(--randstad-blue-10,#e8f1fb)}.year-button.selected,.month-button.selected{background-color:var(--primary-color,#2175d9);color:var(--secondary-white,#fff);border:1px solid var(--primary-color,#2175d9)}.month-button.secondary-selected{background-color:var(--secondary-color-10,#e7e8ec);color:var(--secondary-dark-blue-80,#3c4257);font-weight:500;border:1px solid var(--secondary-color-10,#e7e8ec)}.year-button.current,.month-button.current{position:relative}.year-button.current::after,.month-button.current::after{content:'';position:absolute;bottom:0;width:100%;height:2px;border-radius:2px;background-color:var(--primary-color,#2175d9)}.nav-button[disabled]{color:var(--secondary-dark-blue-30,#b1b5c4);pointer-events:none}.nav-button[disabled]:hover{background-color:transparent}.day[disabled]{color:var(--secondary-dark-blue-30,#b1b5c4);pointer-events:none;background-color:transparent}.day[disabled]:hover{background-color:transparent}.year-button[disabled],.month-button[disabled]{color:var(--secondary-dark-blue-30,#b1b5c4);pointer-events:none;background-color:transparent}.year-button[disabled]:hover,.month-button[disabled]:hover{background-color:transparent}.mobile-backdrop{position:fixed;inset:0;background-color:rgba(0,0,0,0.4);z-index:999;font-family:Graphik}.mobile-modal{position:fixed;bottom:0;left:0;right:0;background-color:white;z-index:1000;border-radius:12px 12px 0 0;box-shadow:0 -4px 10px rgba(0,0,0,0.15);display:flex;flex-direction:column;padding:24px 16px;animation:slideUp 0.5s ease-out;max-height:80dvh;overflow-y:auto;font-family:Graphik}@keyframes slideUp{from{transform:translateY(100%)}to{transform:translateY(0)}}.mobile-modal .header{margin-bottom:0;position:sticky;top:0;background:white;z-index:10}.mobile-modal .weekdays-separator{margin:0}.mobile-modal .weekdays{place-items:center;margin-top:16px;margin-bottom:8px}.mobile-modal .days-grid{gap:8px;grid-template-columns:repeat(7,1fr);place-items:center}.mobile-modal .month-grid,.mobile-modal .year-grid{gap:16px;margin-top:16px}.mobile-modal .day{${n}font-weight:500;display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;cursor:pointer;background-color:transparent;border:none;color:var(--secondary-dark-blue-80,#3c4257);position:relative}.mobile-modal .day.selected{background-color:var(--primary-color,#2175d9);color:var(--white,#fff);font-weight:500;border-radius:50%}.mobile-modal .day.today{color:var(--primary-color,#2175d9);font-weight:500}.mobile-modal .day.today::after{content:'';position:absolute;bottom:0;width:40px;left:50%;transform:translateX(-50%);height:2px;background-color:var(--primary-color,#2175d9);border-radius:2px}.mobile-modal .year-grid,.mobile-modal .month-grid{grid-template-columns:repeat(3,1fr);gap:8px}.mobile-modal .year-button,.mobile-modal .month-button{width:100%;height:48px;border-radius:9999px;flex:1 1 33.3333%;padding:0}.mobile-modal .day.secondary-selected,.mobile-modal .month-button.secondary-selected{background-color:var(--secondary-color-10,#e7e8ec);color:var(--secondary-dark-blue-80,#3c4257);font-weight:500;border:1px solid var(--secondary-color-10,#e7e8ec)}.mobile-modal .day[disabled],.mobile-modal .month-button[disabled],.mobile-modal .year-button[disabled]{color:var(--secondary-dark-blue-30,#b1b5c4);pointer-events:none;background-color:transparent}.mobile-modal .nav-button[disabled]{color:var(--secondary-dark-blue-30,#b1b5c4);pointer-events:none;background-color:transparent}.mobile-modal .day.today[disabled]::after,.mobile-modal .nav-button[disabled] randstad-icon{color:var(--secondary-dark-blue-30,#b1b5c4)}.day:focus-visible{border-radius:50%}.month-year-button:focus-visible{border-radius:16px}.year-button:focus-visible,.month-button:focus-visible{border-radius:9999px}`]}constructor(){super(),this.selectedDate=null,this.viewDate=/* @__PURE__ */ new Date,this.isMobile=!1,this.calendarWidth=0,this.minDate=null,this.maxDate=null,this.type=`date`,this.lastElement=!1,this.currentView=`days`,this.handleOutsideClick=e=>{let t=this.getRootNode()?.host;t&&!e.composedPath().includes(this)&&!e.composedPath().includes(t)&&this.dispatchEvent(new CustomEvent(`close`,{bubbles:!0,composed:!0}))},this._boundHandleCalendarKeydown=this.handleCalendarKeydown.bind(this),this._boundHandleFocusout=e=>{let t=e.relatedTarget;t&&!this.contains(t)&&this.dispatchEvent(new CustomEvent(`close`,{bubbles:!0,composed:!0}))}}firstUpdated(){this.shadowRoot?.addEventListener(`keydown`,this._boundHandleCalendarKeydown),this.addEventListener(`focusout`,this._boundHandleFocusout)}connectedCallback(){super.connectedCallback(),document.addEventListener(`click`,this.handleOutsideClick),this.addEventListener(`focus-input`,this.handleFocusInput)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(`click`,this.handleOutsideClick),this.shadowRoot?.removeEventListener(`keydown`,this._boundHandleCalendarKeydown),this.removeEventListener(`focusout`,this._boundHandleFocusout)}handleFocusInput(){(this.shadowRoot?.querySelector(`.date-input`))?.focus()}handleHeaderClick(){this.currentView=this.type===`month`?this.currentView===`months`?`years`:`months`:this.currentView===`days`?`years`:`days`}_updateView(e,t=null){this.viewDate=e,t&&(this.currentView=t),this.dispatchEvent(new CustomEvent(`view-date-change`,{detail:{date:this.viewDate}}))}handleNavClick(e){let t=this.viewDate;t=this.currentView===`days`?h.addMonths(this.viewDate,e):this.currentView===`months`?h.addYears(this.viewDate,e):h.addYears(this.viewDate,e*21),this._updateView(t)}handleYearSelect(e){let t=h.setYear(this.viewDate,e);this._updateView(t,`months`),this.updateComplete.then(()=>{(this.shadowRoot?.querySelector(`.month-year-button`))?.focus()})}handleMonthSelect(e){let t=h.setMonth(this.viewDate,e);this.type===`month`?(this.selectedDate=t,this.dispatchEvent(new CustomEvent(`date-selected`,{detail:{date:t},bubbles:!0,composed:!0}))):(this._updateView(t,`days`),this.updateComplete.then(()=>{(this.initialFocusElement||this.shadowRoot?.querySelector(`.month-year-button`))?.focus()}))}handleDayClick(e){this.selectedDate=e,this.dispatchEvent(new CustomEvent(`date-selected`,{detail:{date:e},bubbles:!0,composed:!0}))}getFullMonthNames(){return[`Enero`,`Febrero`,`Marzo`,`Abril`,`Mayo`,`Junio`,`Julio`,`Agosto`,`Septiembre`,`Octubre`,`Noviembre`,`Diciembre`]}getShortMonthNames(){return this.getFullMonthNames().map(e=>e.substring(0,3))}getShortWeekdays(){return[`lu`,`ma`,`mi`,`ju`,`vi`,`sa`,`do`]}focusCalendar(){this.updateComplete.then(()=>{let e=this.shadowRoot?.querySelector(`.month-year-button`);e?e.focus():this.initialFocusElement?.focus()})}focusFirstElement(){this.updateComplete.then(()=>{this.currentView!==`days`&&(this.currentView=`days`),this.updateComplete.then(()=>{(this.shadowRoot?.querySelector(`button:not([disabled])`))?.focus()})})}focusYearsView(){this.updateComplete.then(()=>{this.currentView=`years`;let e=this.shadowRoot?.querySelector(`.year-button:not([disabled])`);e&&e.focus()})}focusMonthsView(){this.updateComplete.then(()=>{this.currentView!==`months`&&(this.currentView=`months`);let e=this.shadowRoot?.querySelector(`.month-button:not([disabled])`);e&&e.focus()})}focusDaysView(){this.updateComplete.then(()=>{this.currentView!==`days`&&(this.currentView=`days`);let e=this.shadowRoot?.querySelector(`.day:not([disabled])`);e&&e.focus()})}_findAndFocusDayButton(e){let t=this.shadowRoot?.activeElement;if(!t||!t.classList.contains(`day`))return;let n=Array.from(this.shadowRoot.querySelectorAll(`.day:not([disabled])`)),r=n.findIndex(e=>e===t);if(r===-1)return;let i=r+e;i<0&&(i=0),i>=n.length&&(i=n.length-1);let a=n[i];a&&a.focus()}_focusDayOfWeekEdge(e){let t=this.shadowRoot?.activeElement;if(!t||!t.classList.contains(`day`)||Array.from(this.shadowRoot.querySelectorAll(`.day:not([disabled])`)).findIndex(e=>e===t)===-1)return;let n=Array.from(this.shadowRoot.querySelectorAll(`.days-grid > *`)).findIndex(e=>e===t);if(n===-1)return;let r=n%7,i=null;if(e===`start`){let e=n-r;i=this.shadowRoot?.querySelector(`.days-grid > :nth-child(${e+1}) .day:not([disabled]), .days-grid > :nth-child(${e+1}).day:not([disabled])`);let t=e;for(;!i&&t<=n;)t++,i=this.shadowRoot?.querySelector(`.days-grid > :nth-child(${t+1}) .day:not([disabled]), .days-grid > :nth-child(${t+1}).day:not([disabled])`)}else{let e=n+(6-r);i=this.shadowRoot?.querySelector(`.days-grid > :nth-child(${e+1}) .day:not([disabled]), .days-grid > :nth-child(${e+1}).day:not([disabled])`);let t=e;for(;!i&&t>=n;)t--,i=this.shadowRoot?.querySelector(`.days-grid > :nth-child(${t+1}) .day:not([disabled]), .days-grid > :nth-child(${t+1}).day:not([disabled])`)}i?.focus()}handleCalendarKeydown(e){let{key:t}=e,n=this.shadowRoot?.activeElement;if(t===`Escape`)e.preventDefault(),this.dispatchEvent(new CustomEvent(`close`));else if(t===`Tab`){let t=Array.from(this.shadowRoot.querySelectorAll(`button:not([disabled])`));if(!t.includes(n))return;if(t.length>0){let r=t[0],i=t[t.length-1];if(e.shiftKey&&n===r){e.preventDefault(),this.dispatchEvent(new CustomEvent(`close`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`focus-input`,{bubbles:!0,composed:!0}));return}!e.shiftKey&&n===i&&this.dispatchEvent(new CustomEvent(`close`,{bubbles:!0,composed:!0}))}}else if(n&&(n.classList.contains(`month-year-button`)||n.classList.contains(`nav-button`))){e.preventDefault();let r=this.shadowRoot?.querySelector(`.month-year-button`),i=this.shadowRoot?.querySelector(`.header-right button:first-child`),a=this.shadowRoot?.querySelector(`.header-right button:last-child`);if(t===`Enter`||t===` `){n===r?this.handleHeaderClick():n===i?this.handleNavClick(-1):n===a&&this.handleNavClick(1),this.updateComplete.then(()=>n.focus());return}switch(t){case`ArrowUp`:e.preventDefault(),this.dispatchEvent(new CustomEvent(`focus-input`,{bubbles:!0,composed:!0}));return;case`ArrowRight`:(n===r||n===i)&&a?.focus();break;case`ArrowLeft`:n===a?i?.focus():n===i&&r?.focus();break;case`ArrowDown`:this.currentView===`days`?(this.initialFocusElement||this.shadowRoot?.querySelector(`.day:not([disabled])`))?.focus():(this.currentView===`months`||this.currentView===`years`)&&(this.shadowRoot?.querySelector(`.${this.currentView===`months`?`month`:`year`}-grid button:not([disabled])`))?.focus()}}else if(n&&n.classList.contains(`day`)&&this.currentView===`days`){e.preventDefault();let r=Array.from(this.shadowRoot.querySelectorAll(`.day:not([disabled])`)).findIndex(e=>e===n),i=this.shadowRoot?.querySelector(`.month-year-button`);switch(t){case`ArrowLeft`:this._findAndFocusDayButton(-1);break;case`ArrowRight`:this._findAndFocusDayButton(1);break;case`ArrowDown`:this._findAndFocusDayButton(7);break;case`ArrowUp`:r-7<0?i?.focus():this._findAndFocusDayButton(-7);break;case`Home`:this._focusDayOfWeekEdge(`start`);break;case`End`:this._focusDayOfWeekEdge(`end`);break;case`Enter`:n.click()}}else if(n&&(n.classList.contains(`month-button`)||n.classList.contains(`year-button`))){e.preventDefault();let r=this.currentView===`months`?`.month-button:not([disabled])`:`.year-button:not([disabled])`,i=Array.from(this.shadowRoot.querySelectorAll(r)),a=i.findIndex(e=>e===n),o=this.shadowRoot?.querySelector(`.month-year-button`);if(a===-1)return;let s=a;switch(t){case`ArrowDown`:s+=3,s>=i.length&&(s=i.length-1);break;case`ArrowUp`:if(s-=3,s<0){o?.focus();return}break;case`ArrowLeft`:--s,s<0&&(s=0);break;case`ArrowRight`:s+=1,s>=i.length&&(s=i.length-1);break;case`Enter`:n.click()}s!==a&&i[s]?.focus()}else(t.startsWith(`Arrow`)||t===`Enter`)&&e.preventDefault()}renderHeader(){let e=this.getFullMonthNames(),t=``,n=!1,r=!1;if(this.currentView===`years`){let e=this.viewDate.getFullYear()-this.viewDate.getFullYear()%21,i=e+20;t=`${e} - ${i}`;let a=this.minDate?this.minDate.getFullYear():-1/0,o=this.maxDate?this.maxDate.getFullYear():1/0;n=e<=a,r=i>=o}else if(this.currentView===`months`){t=`${this.viewDate.getFullYear()}`;let e=this.viewDate.getFullYear(),i=this.minDate?this.minDate.getFullYear():-1/0,a=this.maxDate?this.maxDate.getFullYear():1/0;n=e<=i,r=e>=a}else t=` ${e[this.viewDate.getMonth()]} ${this.viewDate.getFullYear()} `,this.minDate&&(n=h.isSameMonth(h.startOfMonth(this.viewDate),h.startOfMonth(this.minDate))||h.isBefore(this.viewDate,this.minDate)),this.maxDate&&(r=h.isSameMonth(h.startOfMonth(this.viewDate),h.startOfMonth(this.maxDate))||h.isAfter(this.viewDate,this.maxDate));return l`<div class="header"><div class="header-left"><button class="month-year-button" @click=${this.handleHeaderClick}><span>${t}</span><randstad-icon name="${this.currentView===`days`?`arrow_drop_down`:`arrow_drop_up`}" class="select-icon"></randstad-icon></button></div><div class="header-right"><button class="nav-button" @click=${()=>this.handleNavClick(-1)} ?disabled=${n}><randstad-icon name="arrow_left"></randstad-icon></button><button class="nav-button" @click=${()=>this.handleNavClick(1)} ?disabled=${r}><randstad-icon name="arrow_right"></randstad-icon></button></div></div>`}renderYearsView(){let e=this.viewDate.getFullYear()-this.viewDate.getFullYear()%21,t=Array.from({length:21},(t,n)=>e+n),n=this.selectedDate?this.selectedDate.getFullYear():null,r=(/* @__PURE__ */ new Date()).getFullYear(),i=this.minDate?this.minDate.getFullYear():-1/0,a=this.maxDate?this.maxDate.getFullYear():1/0;return l`<div class="year-grid">${t.map(e=>l`<button class="${` year-button ${e===n?`selected`:e===r?`current`:``} `}" @click=${()=>this.handleYearSelect(e)} ?disabled=${e<i||e>a} >${e}</button>`)}</div>`}renderMonthsView(){let e=this.getShortMonthNames(),t=this.selectedDate?.getMonth(),n=(/* @__PURE__ */ new Date()).getMonth(),r=this.viewDate.getFullYear();return l`<div class="month-grid">${e.map((e,i)=>{let a=i===n,o=i===t&&this.selectedDate&&h.isSameYear(this.viewDate,this.selectedDate),s=i===t&&this.selectedDate&&!h.isSameYear(this.viewDate,this.selectedDate),c=!1;return this.minDate&&r===this.minDate.getFullYear()&&(c=i<this.minDate.getMonth()),this.maxDate&&r===this.maxDate.getFullYear()&&(c||=i>this.maxDate.getMonth()),l`<button class="${`month-button ${o?`selected`:s?`secondary-selected`:a?`current`:``}`}" ?disabled=${c} @click=${()=>this.handleMonthSelect(i)} >${e}</button>`})}</div>`}renderDayView(){let e=h.getDaysInMonth(this.viewDate),t=h.startOfMonth(this.viewDate),n=h.getDay(t),r=Array.from({length:n===0?6:n-1},()=>null),i=Array.from({length:e},(e,n)=>h.setDate(t,n+1)),a=this.getShortWeekdays();return l`<div class="weekdays">${a.map(e=>l`<div>${e}</div>`)}</div><div class="days-grid">${r.map(()=>l`<div></div>`)} ${i.map(e=>{let t=h.startOfDay(e),n=this.selectedDate?h.startOfDay(this.selectedDate):null,r=this.minDate&&h.isBefore(t,h.startOfDay(this.minDate))||this.maxDate&&h.isAfter(t,h.startOfDay(this.maxDate)),i=h.isToday(t),a=n&&h.getDate(t)===h.getDate(n),o=a&&n&&h.isSameMonth(t,n)&&h.isSameYear(t,n);return l`<button class="${`day ${i?`today`:``} ${o?`selected`:a&&!o?`secondary-selected`:``}`}" ?disabled=${r} @click=${()=>this.handleDayClick(e)} >${h.format(e,`d`)}</button>`})}</div>`}willUpdate(e){this.type===`month`&&this.currentView===`days`&&(this.currentView=`months`)}render(){let e;e=this.currentView===`days`?this.renderDayView():this.currentView===`months`?this.renderMonthsView():this.renderYearsView();let t=this.currentView===`days`,n=l` ${this.renderHeader()} ${t?l`<div class="weekdays-separator"></div>`:u} ${e} `;return this.isMobile?l`<div class="mobile-backdrop" @click=${()=>this.dispatchEvent(new CustomEvent(`close`))}><div class="mobile-modal" @click=${e=>e.stopPropagation()}>${n}</div></div>`:l`<div class="calendar-container" style="width: ${this.calendarWidth}px;">${n}</div>`}};t([f({type:Object}),e(`design:type`,Object)],g.prototype,`selectedDate`,void 0),t([f({type:Object}),e(`design:type`,typeof Date>`u`?Object:Date)],g.prototype,`viewDate`,void 0),t([f({type:Boolean}),e(`design:type`,Object)],g.prototype,`isMobile`,void 0),t([f({type:Number}),e(`design:type`,Number)],g.prototype,`calendarWidth`,void 0),t([f({type:Object}),e(`design:type`,Object)],g.prototype,`minDate`,void 0),t([f({type:Object}),e(`design:type`,Object)],g.prototype,`maxDate`,void 0),t([f({type:String}),e(`design:type`,String)],g.prototype,`type`,void 0),t([f({type:Boolean}),e(`design:type`,Object)],g.prototype,`lastElement`,void 0),t([m(),e(`design:type`,String)],g.prototype,`currentView`,void 0),t([p(`.day.selected, .day.today:not(.selected)`),e(`design:type`,typeof HTMLButtonElement>`u`?Object:HTMLButtonElement)],g.prototype,`initialFocusElement`,void 0),g=t([d(`calendar-overlay`),e(`design:paramtypes`,[])],g);export{g as CalendarOverlay};
@@ -1,5 +1,6 @@
1
1
  import { LitElement } from 'lit';
2
2
  import "./CarouselCards";
3
+ import "./Icon";
3
4
  export declare class Carousel extends LitElement {
4
5
  cards: any[];
5
6
  cardWidth: string;
@@ -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"./CarouselCards.js";import{LitElement as n,css as r,html as i}from"lit";import{customElement as a,property as o,query as s,state as c}from"lit/decorators.js";import{classMap as l}from"lit/directives/class-map.js";let u=class extends n{constructor(){super(),this.cards=[],this.cardWidth=``,this.cardHeight=``,this.navWidth=112,this.showNavButtons=!0,this.isDynamicWidth=!0,this.isInfiniteScrollPartial=!0,this.autoPlayDelayMs=0,this.showPrevButton=!1,this.showNextButton=!0,this.isDraggingWithButtons=!1,this.isDownWithButtons=!1,this.startXWithButtons=0,this.scrollLeftPositionWithButtons=0,this.isScrollingByButton=!1,this.isDownDrag=!1,this.prevXDrag=0,this.isDraggingDrag=!1,this.scrollLeftDrag=0,this.observer=null,this.scrollTimeout=null,this.autoPlayTimer=null,this.handleResize=()=>{},this.DESKTOP_GAP=40,this.TABLET_GAP=24,this.MOBILE_GAP=24,this.handleMouseDownWithButtons=this.handleMouseDownWithButtons.bind(this),this.handleMouseLeaveWithButtons=this.handleMouseLeaveWithButtons.bind(this),this.handleMouseUpWithButtons=this.handleMouseUpWithButtons.bind(this),this.handleMouseMoveWithButtons=this.handleMouseMoveWithButtons.bind(this),this.handleScrollWithButtons=this.handleScrollWithButtons.bind(this),this.handleMouseDownDrag=this.handleMouseDownDrag.bind(this),this.handleMouseLeaveDrag=this.handleMouseLeaveDrag.bind(this),this.handleMouseUpDrag=this.handleMouseUpDrag.bind(this),this.handleMouseMoveDrag=this.handleMouseMoveDrag.bind(this),this.handleResize=this.resizeHandler.bind(this)}static{this.styles=r`:host{display:block;width:100%;overflow:hidden;user-select:none;position:relative;--nav-width:112px;--carousel-cards-gap:24px}.carousel-wrapper{display:flex;gap:var(--carousel-cards-gap);overflow-x:auto;-webkit-overflow-scrolling:touch;scroll-snap-type:x mandatory;scroll-padding-left:25px;padding-right:0;padding-left:0}.carousel-wrapper.not-ininite-scroll-partial{scroll-padding-left:var(--nav-width);padding-right:0}.carousel-wrapper::-webkit-scrollbar{display:none}.carousel-card-item{flex-shrink:0;scroll-snap-align:start}.nav-button{width:var(--nav-width);display:flex;align-items:center;justify-content:center;position:absolute;top:0;height:100%;border:none;background-color:rgba(15,25,65,0.7);cursor:pointer;z-index:10;transition:opacity 0.3s ease,background-color 0.3s ease}.nav-button:hover,.nav-button:active{background-color:rgba(15,25,65,0.7)}.nav-button.prev{left:0}.nav-button.next{right:0}.nav-button.hidden{opacity:0;pointer-events:none}.nav-button-inner{width:48px;height:48px;border-radius:50%;display:flex;justify-content:center;align-items:center;background-color:transparent;transition:background-color 0.3s ease}.nav-button:hover .nav-button-inner{background-color:rgba(0,215,255,1)}.nav-button:hover .nav-button-inner:active,.nav-button:active .nav-button-inner{background-color:rgba(0,194,230,1)}.nav-button-inner randstad-icon{width:32px;height:32px;--icon-color:white;transition:--icon-color 0.3s ease}.nav-button:hover .nav-button-inner randstad-icon{--icon-color:rgba(15,25,65,1)}.nav-button:hover .nav-button-inner:active randstad-icon{--icon-color:rgba(15,25,65,1)}.carousel-wrapper.drag-mode{scroll-snap-type:none;padding-right:25px !important;padding-left:25px !important}.carousel-wrapper.drag-mode.not-ininite-scroll-partial{scroll-snap-type:none;scroll-padding-left:0 !important}.carousel-wrapper.drag-mode:hover{cursor:grab}.carousel-wrapper.drag-mode.active{cursor:grabbing}.dynamic-width-mode,.static-width-mode{padding-right:15%;scroll-padding-left:var(--nav-width)}.dynamic-width-mode .carousel-card-item{width:85%}@media (min-width:941px){.carousel-wrapper{gap:var(--carousel-cards-gap);scroll-padding-left:100px;scroll-padding-right:100px}.carousel-wrapper.not-ininite-scroll-partial{gap:var(--carousel-cards-gap);scroll-padding-left:0;scroll-padding-right:0}.static-width-mode.carousel-wrapper,.dynamic-width-mode.carousel-wrapper{gap:var(--carousel-cards-gap);padding-right:100px !important;padding-left:100px !important}.static-width-mode.carousel-wrapper.not-ininite-scroll-partial,.dynamic-width-mode.carousel-wrapper.not-ininite-scroll-partial{gap:var(--carousel-cards-gap);padding-right:0 !important;padding-left:0 !important}.carousel-wrapper.drag-mode{padding-left:100px !important;padding-right:100px !important}.carousel-wrapper.drag-mode.not-ininite-scroll-partial{padding-right:0 !important;padding-left:0 !important}.dynamic-width-mode .carousel-card-item{width:calc((100% - (2 * var(--carousel-cards-gap)) + 100px) / 3)}.dynamic-width-mode.not-ininite-scroll-partial .carousel-card-item{width:calc((100% - (2 * var(--carousel-cards-gap))) / 3)}}@media (min-width:501px) and (max-width:940px){.nav-button{display:none}.carousel-wrapper{gap:var(--carousel-cards-gap);scroll-padding-left:50px !important;padding-right:var(--nav-width) !important}.carousel-wrapper.not-ininite-scroll-partial{scroll-padding-left:0 !important}.carousel-wrapper.drag-mode{padding-left:50px !important;padding-right:var(--carousel-cards-gap) !important}.carousel-wrapper.drag-mode.not-ininite-scroll-partial{padding-right:0 !important;padding-left:0 !important}.static-width-mode.carousel-wrapper,.dynamic-width-mode.carousel-wrapper{gap:var(--carousel-cards-gap);padding-left:50px !important;padding-right:var(--carousel-cards-gap) !important}.static-width-mode.carousel-wrapper.not-ininite-scroll-partial,.dynamic-width-mode.carousel-wrapper.not-ininite-scroll-partial{gap:var(--carousel-cards-gap);padding-left:0 !important;padding-right:0 !important}.static-width-mode:not(.drag-mode).carousel-wrapper,.dynamic-width-mode:not(.drag-mode).carousel-wrapper,.static-width-mode:not(.drag-mode).carousel-wrapper.not-ininite-scroll-partial,.dynamic-width-mode:not(.drag-mode).carousel-wrapper.not-ininite-scroll-partial{gap:var(--carousel-cards-gap)}.dynamic-width-mode .carousel-card-item{width:calc(100% - var(--nav-width) - var(--carousel-cards-gap) - 50px)}.dynamic-width-mode.not-ininite-scroll-partial .carousel-card-item{width:calc(100% - var(--nav-width) - var(--carousel-cards-gap) - 50px * 2)}.dynamic-width-mode.drag-mode .carousel-card-item{width:85%}}@media (max-width:500px){.nav-button{display:none}.carousel-wrapper{scroll-padding-left:25px !important;padding-right:15%}.carousel-wrapper.not-ininite-scroll-partial{scroll-padding-left:0 !important}.static-width-mode.carousel-wrapper,.dynamic-width-mode.carousel-wrapper{gap:var(--carousel-cards-gap);padding-left:25px !important;padding-right:var(--carousel-cards-gap) !important}.static-width-mode.carousel-wrapper.not-ininite-scroll-partial,.dynamic-width-mode.carousel-wrapper.not-ininite-scroll-partial{gap:var(--carousel-cards-gap);padding-left:0 !important;padding-right:0 !important}.dynamic-width-mode .carousel-card-item{width:85%}.static-width-mode.drag-mode.carousel-wrapper,.dynamic-width-mode.drag-mode.carousel-wrapper{padding-left:25px !important;padding-right:var(--carousel-cards-gap) !important}.static-width-mode.drag-mode.carousel-wrapper.not-ininite-scroll-partial,.dynamic-width-mode.drag-mode.carousel-wrapper.not-ininite-scroll-partial{padding-right:0 !important;padding-left:0 !important}.static-width-mode:not(.drag-mode).carousel-wrapper.not-ininite-scroll-partial,.dynamic-width-mode:not(.drag-mode).carousel-wrapper.not-ininite-scroll-partial{gap:var(--carousel-cards-gap);padding-right:0 !important}}`}getCarouselGap(){let e,t=window.innerWidth;return e=t>=941?this.DESKTOP_GAP:t>=501?this.TABLET_GAP:this.MOBILE_GAP,e}setCarouselGap(){this.style.setProperty(`--carousel-cards-gap`,`${this.getCarouselGap()}px`)}getNavWidth(){return this.navWidth??112}getInitialPadding(){if(!this.slider||this.showNavButtons===!1)return 0;let e=window.getComputedStyle(this.slider).getPropertyValue(`scroll-padding-left`);return parseFloat(e)||0}updated(e){super.updated(e),e.has(`navWidth`)&&this.style.setProperty(`--nav-width`,`${this.getNavWidth()}px`)}firstUpdated(){this.slider&&(this.setCarouselGap(),this.initAutoPlayConfig(),this.cardWidth||this.isDynamicWidth===!1?this.isDynamicWidth=!1:this.hasAttribute(`isdynamicwidth`)&&this.isDynamicWidth!==void 0||(this.isDynamicWidth=!0),this.initNavModeConfig(),this.slider.addEventListener(`dragstart`,e=>e.preventDefault()),this.cards.length===0&&this.slotElement&&this.loadMutationObserver())}initAutoPlayConfig(){this.autoPlayDelayMs>0&&(this.isDynamicWidth=!0,this.showNavButtons=!1),this.autoPlayDelayMs>0&&this.slider&&(this.slider.addEventListener(`mouseenter`,this.handleMouseEnter.bind(this)),this.slider.addEventListener(`mouseleave`,this.handleMouseLeaveDrag.bind(this)),this.slider.addEventListener(`touchstart`,this.handleMouseEnter.bind(this)),this.slider.addEventListener(`touchend`,this.handleMouseLeaveDrag.bind(this)))}initNavModeConfig(){this.showNavButtons===!1?(this.slider.classList.add(`drag-mode`),this.slider.addEventListener(`mousedown`,this.handleMouseDownDrag),this.slider.addEventListener(`mouseleave`,this.handleMouseLeaveDrag),this.slider.addEventListener(`mouseup`,this.handleMouseUpDrag),this.slider.addEventListener(`mousemove`,this.handleMouseMoveDrag),this.slider.addEventListener(`mouseenter`,this.handleMouseEnter.bind(this))):(this.slider.addEventListener(`mousedown`,this.handleMouseDownWithButtons),this.slider.addEventListener(`mouseleave`,this.handleMouseLeaveWithButtons),this.slider.addEventListener(`mouseup`,this.handleMouseUpWithButtons),this.slider.addEventListener(`mousemove`,this.handleMouseMoveWithButtons),this.slider.addEventListener(`scroll`,this.handleScrollWithButtons),window.requestAnimationFrame(()=>this.handleScrollWithButtons()),this.slider.addEventListener(`mouseenter`,this.handleMouseEnter.bind(this)))}connectedCallback(){super.connectedCallback(),window.addEventListener(`resize`,this.handleResize),this.autoPlayDelayMs>0&&setTimeout(()=>this.startAutoPlay(),100)}disconnectedCallback(){super.disconnectedCallback(),this.slider&&(this.slider.removeEventListener(`mousedown`,this.handleMouseDownWithButtons),this.slider.removeEventListener(`mouseleave`,this.handleMouseLeaveWithButtons),this.slider.removeEventListener(`mouseup`,this.handleMouseUpWithButtons),this.slider.removeEventListener(`mousemove`,this.handleMouseMoveWithButtons),this.slider.removeEventListener(`scroll`,this.handleScrollWithButtons),this.slider.removeEventListener(`mousedown`,this.handleMouseDownDrag),this.slider.removeEventListener(`mouseleave`,this.handleMouseLeaveDrag),this.slider.removeEventListener(`mouseup`,this.handleMouseUpDrag),this.slider.removeEventListener(`mousemove`,this.handleMouseMoveDrag),this.scrollTimeout!==null&&window.clearTimeout(this.scrollTimeout),this.observer&&this.observer.disconnect(),this.stopAutoPlay())}resizeHandler(){this.requestUpdate(),this.setCarouselGap()}loadMutationObserver(){this.observer=new MutationObserver((e,t)=>{e.some(e=>e.addedNodes.length>0)&&setTimeout(()=>{this.handleScrollWithButtons(),this.slider.scrollWidth>this.slider.clientWidth&&t.disconnect()},50)}),this.observer.observe(this,{childList:!0,subtree:!0})}handleMouseEnter(){this.stopAutoPlay()}startAutoPlay(){this.autoPlayDelayMs<=0||!this.slider||this.autoPlayTimer!==null||window.setTimeout(()=>{this.autoPlayTimer===null&&(this.autoPlayTimer=window.setInterval(()=>this.scrollToNext(new Event(`autoplay`)),this.autoPlayDelayMs))},100)}stopAutoPlay(){this.autoPlayTimer!==null&&(window.clearInterval(this.autoPlayTimer),this.autoPlayTimer=null)}handleMouseDownDrag(e){this.slider&&e.button===0&&(this.autoPlayDelayMs>0&&this.stopAutoPlay(),this.isDownDrag=!0,this.isDraggingDrag=!1,this.slider.classList.add(`active`),this.slider.style.scrollBehavior=`auto`,this.prevXDrag=e.pageX,this.scrollLeftDrag=this.slider.scrollLeft)}handleMouseLeaveDrag(){this.slider&&(this.isDownDrag=!1,this.isDraggingDrag=!1,this.slider.classList.remove(`active`),this.autoPlayDelayMs>0&&window.setTimeout(()=>{this.startAutoPlay()},500))}handleMouseUpDrag(){this.slider&&(this.isDownDrag=!1,this.isDraggingDrag=!1,this.slider.classList.remove(`active`))}handleMouseMoveDrag(e){if(e.preventDefault(),!this.isDownDrag||!this.slider)return;this.isDraggingDrag=!0;let t=e.pageX-this.prevXDrag;this.slider.scrollLeft-=t*1.5,this.prevXDrag=e.pageX}shouldPreventDragWithButtons(){return this.slider?this.slider.scrollWidth-this.slider.clientWidth>1:!1}handleMouseDownWithButtons(e){this.slider&&e.button===0&&(this.shouldPreventDragWithButtons()||(this.isDownWithButtons=!0,this.isDraggingWithButtons=!1,this.slider.classList.add(`active`),this.slider.style.scrollBehavior=`auto`,this.startXWithButtons=e.pageX,this.scrollLeftPositionWithButtons=this.slider.scrollLeft))}handleMouseMoveWithButtons(e){if(e.preventDefault(),!this.isDownWithButtons||!this.slider||this.shouldPreventDragWithButtons())return;this.isDraggingWithButtons=!0;let t=(e.pageX-this.startXWithButtons)*1.5;this.slider.scrollLeft=this.scrollLeftPositionWithButtons-t}handleMouseUpWithButtons(){this.slider&&(this.isDownWithButtons=!1,this.isDraggingWithButtons=!1,this.slider.classList.remove(`active`))}handleMouseLeaveWithButtons(){this.isDownWithButtons&&(this.isDownWithButtons=!1,this.isDraggingWithButtons=!1,this.slider.classList.remove(`active`),this.autoPlayDelayMs>0&&this.startAutoPlay())}handleScrollWithButtons(){if(!this.slider)return;if(this.isScrollingByButton){let e=this.slider.scrollWidth-this.slider.clientWidth,t=this.slider.scrollLeft;if(e<=10){this.showPrevButton=!1,this.showNextButton=!1;return}this.showPrevButton=t>10,this.showNextButton=t<e-10;return}this.scrollTimeout!==null&&window.clearTimeout(this.scrollTimeout),this.scrollTimeout=window.setTimeout(()=>{this.slider.style.scrollSnapType=`none`,this.scrollTimeout=null},100);let e=this.slider.scrollWidth-this.slider.clientWidth,t=this.slider.scrollLeft;e<=10?(this.showPrevButton=!1,this.showNextButton=!1):(this.showPrevButton=t>10,this.showNextButton=t<e-10)}getNavButtonWidth(){return this.showNavButtons===!1||this.isDynamicWidth&&window.matchMedia(`( max-width: 500px )`).matches?0:this.getNavWidth()}getScrollAmount(){let e=null;if(this.cards.length>0?e=this.slider.querySelector(`.carousel-card-item`):this.slotElement&&(e=this.slotElement.assignedElements({flatten:!0}).find(e=>e.classList.contains(`carousel-card-item`))||null),!e||e.getBoundingClientRect().width===0){let e=parseFloat(this.cardWidth.replace(`px`,``))||280,t=window.getComputedStyle(this.slider),n=t.getPropertyValue(`gap`)||t.getPropertyValue(`column-gap`);return e+(parseFloat(n)||0)}let t=e.getBoundingClientRect().width,n=window.getComputedStyle(this.slider),r=n.getPropertyValue(`gap`)||n.getPropertyValue(`column-gap`);return t+(parseFloat(r)||0)}getCarouselItems(){return this.cards.length>0?this.slider?Array.from(this.slider.querySelectorAll(`.carousel-card-item`)):[]:this.slotElement?this.slotElement.assignedElements({flatten:!0}):[]}getCardsToCenterCount(){return this.isDynamicWidth&&window.matchMedia(`( min-width: 941px )`).matches?2:1}calculateTargetIndex(e,t,n){let r=this.getCardsToCenterCount();if(n.length===0||r===0)return-1;let i;i=e+5;let a=0;for(let e=0;e<n.length;e++)if(n[e].offsetLeft>=i){a=e;break}if(this.isInfiniteScrollPartial){let t=this.getInitialPadding();a===0&&e>t&&(a=n.length-r)}if(!t&&e<5)return 0;let o,s=n.length-r,c=r===2;return t?(o=e<(this.isInfiniteScrollPartial?this.getInitialPadding():this.getNavButtonWidth())+5?c?2:1:a+1,o=Math.min(o,s)):(o=c&&a<=2?0:a-1,o=Math.max(0,o)),o}getScrollLeftToCenter(e,t){let n=this.getCardsToCenterCount();if(e<0||e>=t.length||n===0)return this.slider.scrollLeft;let r=t[e],i=r.getBoundingClientRect().width;if(i===0)return this.slider.scrollLeft;let a=window.getComputedStyle(this.slider),o=a.getPropertyValue(`gap`)||a.getPropertyValue(`column-gap`),s=parseFloat(o)||0,c=i*n+s*(n-1),l=r.offsetLeft,u=this.slider.clientWidth/2,d=l+c/2-u;d=Math.max(0,d);let f=this.slider.scrollWidth-this.slider.clientWidth;return d=Math.min(d,f),d}scrollToPrev(e){if(e.type!==`autoplay`&&(e.preventDefault(),e.stopPropagation()),!this.slider)return;let t=this.getCarouselItems();if(t.length===0)return;let n;if(this.isDynamicWidth&&window.matchMedia(`( min-width: 501px )`).matches){let e=this.slider.scrollLeft,r=this.calculateTargetIndex(e,!1,t);n=this.getScrollLeftToCenter(r,t)}else{let e=this.slider.scrollLeft;n=0;let r=this.getInitialPadding(),i=this.getNavButtonWidth(),a=this.isInfiniteScrollPartial?r:i;for(let r=t.length-1;r>=0;r--){let i=t[r];if(Math.round(i.offsetLeft-a)<Math.round(e)-1){n=i.offsetLeft-a;break}}}this.slider.style.scrollSnapType=`none`,this.isScrollingByButton=!0,this.slider.scrollTo({left:n,behavior:`smooth`}),window.setTimeout(()=>{this.isScrollingByButton=!1,this.handleScrollWithButtons()},350)}scrollToNext(e){let t=e.type===`autoplay`;if(t||(e.preventDefault(),e.stopPropagation()),!this.slider)return;let n=this.getCarouselItems();if(n.length===0)return;let r;if(this.isDynamicWidth&&window.matchMedia(`( min-width: 501px )`).matches){let e=this.slider.scrollLeft,t=this.calculateTargetIndex(e,!0,n);r=this.getScrollLeftToCenter(t,n)}else{let e=this.slider.scrollLeft;r=-1;let t=this.getInitialPadding(),i=this.getNavButtonWidth(),a=this.isInfiniteScrollPartial?t:i;for(let t=0;t<n.length;t++){let i=n[t];if(Math.round(i.offsetLeft-a)>Math.round(e)+1){r=i.offsetLeft-a;break}}r===-1&&(r=this.slider.scrollWidth-this.slider.clientWidth)}let i=this.slider.scrollWidth-this.slider.clientWidth,a=this.slider.scrollLeft;t&&Math.round(a)>=Math.round(i)?(this.slider.style.scrollBehavior=`auto`,this.slider.scrollTo({left:0,behavior:`auto`}),this.slider.style.scrollBehavior=`smooth`):(this.slider.style.scrollSnapType=`none`,this.isScrollingByButton=!0,this.slider.scrollTo({left:r,behavior:`smooth`}),window.setTimeout(()=>{this.isScrollingByButton=!1,this.handleScrollWithButtons()},350))}getCardCustomDimensionValue(e,t){if(!(e===`width`&&this.isDynamicWidth)){if(e===`width`){let e=window.innerWidth,n=this.getNavButtonWidth()*2;e-=n;let r=this.getCarouselGap();if(e-=r,!t)return`${e}px`;let i=t.match(/^(\d+)px$/);return!i||parseFloat(i[1])>e?`${e}px`:t}{let e=window.innerHeight;if(!t)return;let n=t.match(/^(\d+)px$/);return n&&parseFloat(n[1])>e?`${e}px`:t}}}renderNavButtons(){if(this.showNavButtons===!1)return i``;let e={"nav-button":!0,prev:!0,hidden:!this.showPrevButton},t={"nav-button":!0,next:!0,hidden:!this.showNextButton};return i`<div class="nav-buttons-container"><button class=${l(e)} @click=${this.scrollToPrev} ><div class="nav-button-inner"><randstad-icon name="arrow_prev" size="32px"></randstad-icon></div></button><button class=${l(t)} @click=${this.scrollToNext} ><div class="nav-button-inner"><randstad-icon name="arrow_next" size="32px"></randstad-icon></div></button></div>`}renderContent(){let e=this.getCardCustomDimensionValue(`width`,this.cardWidth),t=this.getCardCustomDimensionValue(`height`,this.cardHeight);return this.cards&&this.cards.length>0?this.cards.map(n=>i`<div class="carousel-card-item"><carousel-card .img=${n.img} .name=${n.name} .title=${n.title} .description=${n.description} .buttonLabel=${n.buttonLabel} .cardId=${n.cardId} .width=${e} .height=${t} .onClick=${n.onClick} ></carousel-card></div>`):i`<slot></slot>`}render(){let e=this.showNavButtons!==!1,t=this.isInfiniteScrollPartial===!1,n={"carousel-wrapper":!0,"drag-mode":!e,"dynamic-width-mode":this.isDynamicWidth,"static-width-mode":!this.isDynamicWidth,"not-ininite-scroll-partial":t};return i`<div class="carousel-container"><div class=${l(n)}>${this.renderContent()}</div>${this.renderNavButtons()}</div>`}};t([o({type:Array}),e(`design:type`,Array)],u.prototype,`cards`,void 0),t([o({type:String}),e(`design:type`,String)],u.prototype,`cardWidth`,void 0),t([o({type:String}),e(`design:type`,String)],u.prototype,`cardHeight`,void 0),t([o({type:Number}),e(`design:type`,Number)],u.prototype,`navWidth`,void 0),t([o({type:Boolean}),e(`design:type`,Boolean)],u.prototype,`showNavButtons`,void 0),t([o({type:Boolean}),e(`design:type`,Boolean)],u.prototype,`isDynamicWidth`,void 0),t([o({type:Boolean}),e(`design:type`,Boolean)],u.prototype,`isInfiniteScrollPartial`,void 0),t([o({type:Number}),e(`design:type`,Number)],u.prototype,`autoPlayDelayMs`,void 0),t([c(),e(`design:type`,Object)],u.prototype,`showPrevButton`,void 0),t([c(),e(`design:type`,Object)],u.prototype,`showNextButton`,void 0),t([s(`.carousel-wrapper`),e(`design:type`,typeof HTMLElement>`u`?Object:HTMLElement)],u.prototype,`slider`,void 0),t([s(`slot`),e(`design:type`,typeof HTMLSlotElement>`u`?Object:HTMLSlotElement)],u.prototype,`slotElement`,void 0),u=t([a(`carousel-component`),e(`design:paramtypes`,[])],u);export{u as Carousel};
@@ -1,4 +1,5 @@
1
1
  import { LitElement } from 'lit';
2
+ import './Button';
2
3
  export declare class CarouselCard extends LitElement {
3
4
  img: string;
4
5
  name: string;
@@ -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{bodyL as n,bodyS as r}from"../styles/fontStyles.js";import"./Button.js";import{LitElement as i,css as a,html as o}from"lit";import{customElement as s,property as c}from"lit/decorators.js";let l=class extends i{constructor(...e){super(...e),this.img=``,this.name=``,this.title=``,this.description=``,this.buttonLabel=``,this.cardId=``,this.width=``,this.height=``}static{this.styles=a`:host{display:inline-block;font-family:"Graphik",sans-serif;user-drag:none;-webkit-user-drag:none}.image-container{position:relative;border-radius:8px;overflow:hidden;background-size:cover;background-position:center;background-repeat:no-repeat;display:flex;align-items:flex-end}.overlay-gradient,.overlay-hover{position:absolute;inset:0;border-radius:8px;transition:opacity 1s ease;z-index:0;pointer-events:none}.overlay-gradient{background:linear-gradient(180deg,rgba(15,25,65,0) 0%,rgba(15,25,65,0.279522) 48.01%,rgba(15,25,65,0.6) 80.13%,rgba(15,25,65,0.6) 100%);opacity:1}.overlay-hover{background:#0F1941CC;opacity:0}.image-container:hover .overlay-hover{opacity:1}.content-container{position:relative;z-index:1;color:#FFFFFF;padding:24px;box-sizing:border-box;width:100%;display:flex;flex-direction:column;padding:24px}.image-container:hover .content-container{gap:24px}.title-wrapper{margin-bottom:0}.title{${n}margin:0}.details{max-height:0;overflow:hidden;opacity:0;transform:translateY(40px);transition:max-height 0.4s ease,opacity 0.4s ease,transform 0.4s ease;transition-duration:.5s}.image-container:hover .details{max-height:240px;opacity:1;transform:translateY(0);overflow:visible;transition-duration:.8s}.description{${r}margin:0}::part(button){color:white;border:1px solid white;background:transparent;text-align:left;margin-top:24px}::part(button):hover{background-color:rgba(255,255,255,0.1)}::part(button):active{background-color:rgba(255,255,255,0.2)}`}handleButtonClick(e){e.stopPropagation(),this.onClick?this.onClick(e):this.dispatchEvent(new CustomEvent(`card-button-click`,{detail:e.detail,bubbles:!0,composed:!0}))}connectedCallback(){super.connectedCallback(),this.addEventListener(`randstad-button-click`,this.handleButtonClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`randstad-button-click`,this.handleButtonClick)}render(){let e=` background-image: url( ${this.img} ); `,t=`${`${this.width?`width: ${this.width};`:``} height: ${this.height??`390px`};`} ${e}`;return o`<div class="image-container" style="${t};"><div class="overlay-gradient"></div><div class="overlay-hover"></div><div class="content-container"><div class="title-wrapper"><h3 class="title">${this.name}</h3></div><div class="details"><p class="description">${this.description}</p>${this.cardId?o`<randstad-button variant="button-tertiary" .label=${this.buttonLabel} idevent=${this.cardId} @randstad-button-click=${this.handleButtonClick} ></randstad-button>`:o`<randstad-button variant="button-tertiary" .label=${this.buttonLabel} @randstad-button-click=${this.handleButtonClick} ></randstad-button>`}</div></div></div>`}};t([c({type:String}),e(`design:type`,Object)],l.prototype,`img`,void 0),t([c({type:String}),e(`design:type`,Object)],l.prototype,`name`,void 0),t([c({type:String}),e(`design:type`,Object)],l.prototype,`title`,void 0),t([c({type:String}),e(`design:type`,Object)],l.prototype,`description`,void 0),t([c({type:String}),e(`design:type`,Object)],l.prototype,`buttonLabel`,void 0),t([c({type:String}),e(`design:type`,Object)],l.prototype,`cardId`,void 0),t([c({type:Object}),e(`design:type`,Object)],l.prototype,`onClick`,void 0),t([c({type:String}),e(`design:type`,String)],l.prototype,`width`,void 0),t([c({type:String}),e(`design:type`,String)],l.prototype,`height`,void 0),l=t([s(`carousel-card`)],l);export{l as CarouselCard};
@@ -0,0 +1,4 @@
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}from"../styles/fontStyles.js";import{LitElement as r,css as i,html as a}from"lit";import{customElement as o,property as s}from"lit/decorators.js";let c=class extends r{constructor(...e){super(...e),this.checked=!1,this.error=!1,this.disabled=!1,this.checkedColor=`var(--primary-color)`,this.checkedBgColor=`transparent`}static{this.styles=i`:host{display:block;max-width:100%}label{${n}display:flex;align-items:center;gap:8px;color:var(--secondary-color)}input[type="checkbox"]{min-width:24px;min-height:24px;cursor:pointer;border-radius:4px;border:1px solid var(--secondary-color-20);appearance:none;position:relative;background-color:var(--_initial-bg,transparent);transition:background-color 0.2s ease}input[type="checkbox"]:checked{background-color:var(--_checked-bg,var(--primary-color));border:1px solid var(--_checked-bg,var(--primary-color))}input[type="checkbox"]:checked::after{content:'';position:absolute;left:8px;top:4px;width:5px;height:11px;border:solid white;border-width:0 1px 1px 0;transform:rotate(45deg)}input[type="checkbox"]:checked:disabled::after{border-color:var(--secondary-color-40)}label.error input[type="checkbox"]:checked:disabled::after{border-color:white}.terms-text{display:inline}.terms-text ::slotted(a){color:var(--primary-color);text-decoration:none;cursor:pointer}input[type="checkbox"].error,label.error input[type="checkbox"]:not(:disabled){border-color:var(--ui-negative)}input[type="checkbox"]:hover:not(:disabled):not(.error){box-shadow:0 0 0 4px var(--secondary-color-10)}label.error input[type="checkbox"]:hover:not(:disabled){box-shadow:0px 0px 0px 4px #E00F0F1A}input[type="checkbox"]:focus-visible:not(:disabled):not(.error),label:not(.error) input[type="checkbox"]:focus-visible:not(:disabled){outline:none;box-shadow:0 0 0 4px var(--secondary-color-10)}label.error input[type="checkbox"]:focus-visible:not(:disabled){outline:none;box-shadow:0 0 0 4px #E00F0F1A}input[type="checkbox"].error:checked,label.error input[type="checkbox"]:checked{background-color:var(--ui-negative);border-color:var(--ui-negative)}input[type="checkbox"]:disabled{background-color:var(--secondary-color-10)!important;border-color:var(--secondary-color-20);color:#9FA3B3;cursor:default}label.disabled{color:#9FA3B3}input[type="checkbox"]:focus-visible:not(:disabled):not(.error),label:not(.error) input[type="checkbox"]:focus-visible:not(:disabled){outline:none;box-shadow:0 0 0 2px rgb(0,215,255),0 0 0 4px var(--secondary-color-10)}`}toggleCheck(e){this.checked=e.target.checked,this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0})),this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0})),this.dispatchEvent(new Event(`click`,{bubbles:!0,composed:!0}))}handleKeyDown(e){if(this.disabled)return;let{key:t}=e;(t===`Enter`||t===` `)&&(e.preventDefault(),this.checked=!this.checked,this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0})),this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0})),this.dispatchEvent(new Event(`click`,{bubbles:!0,composed:!0})))}render(){let e=`
2
+ --_checked-bg: ${this.checkedColor};
3
+ --_initial-bg: ${this.checkedBgColor};
4
+ `;return a`<label class="${this.error?`error`:``} ${this.disabled?`disabled`:``}" style="${e}"><input type="checkbox" role="checkbox" aria-checked=${this.checked?`true`:`false`} .checked=${this.checked} ?disabled=${this.disabled} @change=${this.toggleCheck} @keydown=${this.handleKeyDown} @focus=${()=>this.setAttribute(`focused`,``)} @blur=${()=>this.removeAttribute(`focused`)} /><span class="terms-text"><slot></slot></span></label>`}};t([s({type:Boolean,reflect:!0}),e(`design:type`,Object)],c.prototype,`checked`,void 0),t([s({type:Boolean}),e(`design:type`,Object)],c.prototype,`error`,void 0),t([s({type:Boolean}),e(`design:type`,Object)],c.prototype,`disabled`,void 0),t([s({type:String}),e(`design:type`,Object)],c.prototype,`checkedColor`,void 0),t([s({type:String}),e(`design:type`,Object)],c.prototype,`checkedBgColor`,void 0),c=t([o(`randstad-checkbox`)],c);export{c as Checkbox};
@@ -1,5 +1,6 @@
1
1
  import { BaseControl } from "../helpers/BaseControl";
2
2
  import "./CalendarOverlay.ts";
3
+ import "./Icon";
3
4
  export declare class DatePickerComponent extends BaseControl {
4
5
  width?: string;
5
6
  isRenderClearButton: boolean;
@@ -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{BaseControl as n}from"../helpers/BaseControl.js";import{bodyL as r}from"../styles/fontStyles.js";import{tooltipStyles as i}from"../styles/tooltip.js";import{mixStyles as a}from"../styles/mix.js";import{errorStyles as o}from"../styles/error.js";import"./CalendarOverlay.js";import{css as s,html as c,nothing as l}from"lit";import{customElement as u,property as d,query as f,state as p}from"lit/decorators.js";import{classMap as m}from"lit/directives/class-map.js";import{format as h,isAfter as g,isBefore as _,isValid as v,setDate as y,subYears as b}from"date-fns";let x=class extends n{constructor(...e){super(...e),this.isRenderClearButton=!0,this.readonly=!1,this.type=`date`,this.eighteenOrOlder=!1,this.maxLength=10,this.isOpen=!1,this.selectedDate=null,this.viewDate=/* @__PURE__ */ new Date,this.isMobile=!1,this.calendarWidth=0,this.inputValue=null,this.lastElement=!1,this.handleGlobalOverlayOpen=e=>{e.detail!==this&&this.isOpen&&(this.isOpen=!1,this._emitDropdownToggle(!1))},this.updateResponsiveModeBound=this.updateResponsiveMode.bind(this),this.handleClickOutside=e=>{e.composedPath().includes(this)||(this.isOpen&&(this._emitToggle(!1),this._emitDropdownToggle(!1)),this.isOpen=!1)}}static{this.styles=s`${a}${o}${i}:host{display:block;--datepicker-min-width:100%;--datepicker-max-width:100%;max-width:var(--datepicker-max-width)}.datepicker-container{display:flex;flex-direction:column;gap:8px;width:100%;max-width:var(--datepicker-max-width);transition:margin-bottom 0.2s ease-in-out}calendar-overlay{max-width:100dvw;box-sizing:border-box}.input-wrapper.disabled,.input-wrapper.disabled .date-input{background-color:var(--secondary-color-10);color:#9FA3B3;cursor:default}.input-wrapper.disabled .icon-button,.input-wrapper.disabled .icon-button randstad-icon{color:#9FA3B3;cursor:default}.input-wrapper.readonly .date-input{cursor:pointer}.input-wrapper.readonly .calendar-button{cursor:pointer;color:#2175d9}.input-wrapper{display:flex;align-items:center;border:1px solid var(--md-sys-color-outline,#e0e0e0);border-radius:4px;padding:0 16px;transition:border-color 0.2s;background:white;box-sizing:border-box;min-width:var(--datepicker-min-width);max-width:var(--datepicker-max-width)}.input-wrapper:hover{box-shadow:0px 0px 0px 4px #0f19411a}.input-wrapper.active:hover{box-shadow:0px 0px 0px 4px #0f19411a}.input-wrapper.active{border:1px solid var(--primary-color);box-shadow:none}.date-input{${r}flex-grow:1;border:none;outline:none;padding:16px 0;cursor:text;background:white;color:var(--secondary-color,#49454f);min-width:0}.date-input :-webkit-autofill,.date-input :-webkit-autofill:hover,.date-input :-webkit-autofill:focus,.date-input :-webkit-autofill:active{-webkit-box-shadow:0 0 0px 1000px #ffffff inset;-webkit-text-fill-color:var(--secondary-color);transition:background-color 5000s ease-in-out 0s}.icon-button{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}.input-wrapper:not(.disabled) .icon-button:hover{background-color:var(--primary-color-10)}.clear-button{margin-right:18px;color:#49454f;opacity:0.6}.clear-button randstad-icon{width:18px;height:18px}.calendar-button{color:#2175d9}.calendar-button randstad-icon{font-size:18px}@media (max-width:940px){.icon-button:hover{background-color:transparent}}`}setMessageErrorFormatInvalid(){return`formato de fecha inválido, se esperaba '${this.type===`month`?`MM-yyyy`:`dd-MM-yyyy`}'`}get _currentFormat(){return this.type===`month`?`MM-yyyy`:`dd-MM-yyyy`}handleFocusInput(){(this.shadowRoot?.querySelector(`.date-input`))?.focus()}connectedCallback(){super.connectedCallback(),this.updateResponsiveMode(),window.addEventListener(`resize`,this.updateResponsiveModeBound),document.addEventListener(`click`,this.handleClickOutside),this.addEventListener(`focus-input`,this.handleFocusInput),window.addEventListener(`overlay-opened`,this.handleGlobalOverlayOpen)}disconnectedCallback(){window.removeEventListener(`resize`,this.updateResponsiveModeBound),document.removeEventListener(`click`,this.handleClickOutside),this.removeEventListener(`focus-input`,this.handleFocusInput),window.removeEventListener(`overlay-opened`,this.handleGlobalOverlayOpen),super.disconnectedCallback()}notifyOverlayOpened(){window.dispatchEvent(new CustomEvent(`overlay-opened`,{detail:this}))}firstUpdated(){this.setInitialWidth()}setInitialWidth(){if(!this.inputContainer)return;let e=this.inputContainer.getBoundingClientRect().width;this.calendarWidth!==e&&(this.calendarWidth=e)}updateResponsiveMode(){this.isMobile=window.innerWidth<=940,this.setInitialWidth()}handleInput(e){this.onlyNumericAndDash(e);let t=e.target,n=t.value.substring(0,this.maxLength);t.value!==n&&(t.value=n),this.inputValue=t.value,this._parseAndValidateDate(t.value,!0)}handleCalendarButtonClick(e){this.disabled||(e.stopPropagation(),this.isOpen?(this.isOpen=!1,this._emitToggle(!1),this._emitDropdownToggle(!1),(this.shadowRoot?.querySelector(`.date-input`))?.focus()):(this.notifyOverlayOpened(),this.isOpen=!0,this._emitToggle(!0),this._emitDropdownToggle(!0),this.viewDate=this.selectedDate?this.selectedDate:/* @__PURE__ */ new Date,this.updateComplete.then(()=>{(this.shadowRoot?.querySelector(`.date-input`))?.focus()})))}handleClearDate(){this.inputValue=null,this.selectedDate=null,this.error=!1,this.errorMessage=null,this.closeOverlay(null)}handleDateSelect(e){let t=e.detail.date;if(t){if(this.type===`month`&&(t=y(t,1)),this._validateDate(t)){this.selectedDate=t,this.viewDate=t;let e=h(t,this._currentFormat);this.inputValue=e.replace(/-/g,`/`),this.closeOverlay(e)}else{let e=h(t,this._currentFormat);this.inputValue=e.replace(/-/g,`/`),this.selectedDate=null,this.closeOverlay(null)}}}_emitToggle(e){this.dispatchEvent(new CustomEvent(`calendar-toggle`,{detail:{open:e},bubbles:!0,composed:!0}))}_isLastFocusableInModal(){let e=this.parentElement;if(!e)return!1;let t=e.querySelectorAll(`button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"]), randstad-button:not([disabled]), datepicker-component:not([disabled]), randstad-select:not([disabled])`),n=Array.from(t),r=n.indexOf(this);return r!==-1&&r===n.length-1}_emitDropdownToggle(e){e?this.isOpen&&this.lastElement&&this.updateComplete.then(()=>{this.dispatchEvent(new CustomEvent(`dropdown-toggle-calendar`,{detail:{open:!0},bubbles:!0,composed:!0}))}):this.updateComplete.then(()=>{this.dispatchEvent(new CustomEvent(`dropdown-toggle-calendar`,{detail:{open:!1},bubbles:!0,composed:!0}))})}willUpdate(e){if(e.has(`width`)&&this.style.setProperty(`width`,this.width||`100%`),e.has(`value`)){let t=e.get(`value`);this.value!==t&&this._syncValue(this.value)}e.has(`type`)&&(this.maxLength=this.type===`month`?7:10)}updated(e){(e.has(`isOpen`)||e.has(`value`))&&this.isOpen&&this.updateComplete.then(()=>{this.setInitialWidth()}),super.updated(e)}handleViewDateChange(e){this.viewDate=e.detail.date}closeOverlay(e){this.value=e,this.inputValue=e?e.replace(/-/g,`/`):null,this.dispatchEvent(new CustomEvent(`date-selected`,{detail:{value:e}})),this.isOpen=!1,this._emitToggle(!1),this._emitDropdownToggle(!1),(this.shadowRoot?.querySelector(`.date-input`))?.focus()}_syncValue(e){if(e===``||e===null){(this.selectedDate!==null||this.inputValue!==null)&&(this.selectedDate=null,this.inputValue=null,this.errorMessage=null,this.error=!1);return}let t=this._parseDate(e);t&&this._validateDate(t)?(this.type===`month`&&(t=y(t,1)),this.selectedDate=t,this.viewDate=t,this.error=!1,this.errorMessage=null,this.inputValue=h(t,this._currentFormat).replace(/-/g,`/`)):this.selectedDate=t}_validateDate(e){if(!e)return!1;if(this.error=!1,this.errorMessage=null,this.eighteenOrOlder){let t=b(/* @__PURE__ */ new Date,18);if(g(e,t))return this.error=!0,this.errorMessage=`tenés que ser mayor de 18 años`,!1}return this._isWithinBounds(e)?!0:(this._getValidDateRange(),this.error=!0,!1)}_parseAndValidateDate(e,t){if(this.disabled)return;if(e===``||e===null){this.selectedDate=null,this.error=!1,this.errorMessage=null,t&&this.closeOverlay(null);return}let n=this._parseDate(e);n?this._validateDate(n)?(this.selectedDate=n,this.viewDate=n,this.error=!1,this.errorMessage=null,t&&this.closeOverlay(h(n,this._currentFormat))):(this.error=!0,this.selectedDate=null,t&&this.closeOverlay(null)):(this.error=!0,this.errorMessage=this.setMessageErrorFormatInvalid(),this.selectedDate=null,t&&this.closeOverlay(null))}_parseDate(e){let t=e.split(`-`).map(Number);if(this.type===`month`&&t.length===2){let[e,n]=t;if(e>=1&&e<=12&&n>1e3){let t=new Date(n,e-1,1,12);if(v(t))return t}return null}if(t.length===3){let[n,r,i]=t;if(n&&r&&i&&r>=1&&r<=12&&i>1e3){let t=new Date(i,r-1,n,12);if(v(t)&&h(t,`dd-MM-yyyy`)===e)return t}}let n=e.split(`-`).map(Number);if(n.length===3){let[t,r,i]=n;if(t&&r&&i&&r>=1&&r<=12&&t>1e3){let n=new Date(t,r-1,i,12);if(v(n)&&h(n,`yyyy-MM-dd`)===e)return n}}return null}_parseDateString(e){if(!e)return null;let t=e.split(`-`).map(Number);return t.length===3&&!isNaN(t[0])&&!isNaN(t[1])&&!isNaN(t[2])?new Date(t[0],t[1]-1,t[2],12):null}_getValidDateRange(){let e=this._parseDateString(this.minDate),t=this._parseDateString(this.maxDate);return!e&&!t?{minDate:null,maxDate:null}:e&&t&&g(e,t)?null:{minDate:e,maxDate:t}}_isWithinBounds(e){let t=this._getValidDateRange();return!t||!(t.minDate&&_(e,t.minDate)||t.maxDate&&g(e,t.maxDate))}handleKeyDown(e){if(this.disabled)return;let{key:t}=e,n=this.shadowRoot?.querySelector(`.date-input`);if(t===`Enter`||t===` `)e.preventDefault(),this.isOpen?(this.closeOverlay(this.value),this._emitDropdownToggle(!1)):(this.notifyOverlayOpened(),this.isOpen=!0,this._emitToggle(!0),this._emitDropdownToggle(!0),this.viewDate=this.selectedDate?this.selectedDate:/* @__PURE__ */ new Date);else if(t===`Escape`){if(!this.isOpen)return;e.preventDefault(),this.closeOverlay(this.value),this._emitDropdownToggle(!1)}else t===`ArrowDown`&&(e.preventDefault(),this.isOpen||(this.notifyOverlayOpened(),this.isOpen=!0,this._emitToggle(!0),this._emitDropdownToggle(!0),this.viewDate=this.selectedDate?this.selectedDate:/* @__PURE__ */ new Date),this.updateComplete.then(()=>{let e=this.shadowRoot?.querySelector(`calendar-overlay`);e&&typeof e.focusCalendar==`function`&&e.focusCalendar()}));let r=this.shadowRoot?.querySelector(`.clear-button`),i=this.shadowRoot?.querySelector(`.calendar-button`);t===`ArrowRight`&&(e.preventDefault(),this.shadowRoot?.activeElement===n&&(r?r.focus():i?.focus()))}handleClearButtonKeydown(e){if(this.disabled)return;let{key:t}=e,n=this.shadowRoot?.querySelector(`.date-input`),r=this.shadowRoot?.querySelector(`.calendar-button`);t===`ArrowLeft`?(e.preventDefault(),n?.focus()):t===`ArrowRight`&&(e.preventDefault(),r?.focus())}handleCalendarButtonKeydown(e){if(this.disabled)return;let{key:t}=e,n=this.shadowRoot?.querySelector(`.date-input`),r=this.shadowRoot?.querySelector(`.clear-button`);if(t===`Tab`){if(!e.shiftKey&&!this.isOpen){e.preventDefault(),this.notifyOverlayOpened(),this.isOpen=!0,this._emitToggle(!0),this._emitDropdownToggle(!0),this.viewDate=this.selectedDate?this.selectedDate:/* @__PURE__ */ new Date,this.updateComplete.then(()=>{let e=this.shadowRoot?.querySelector(`calendar-overlay`);e&&typeof e.focusFirstElement==`function`&&e.focusFirstElement()});return}if(this.isOpen){e.preventDefault(),this.closeOverlay(this.value);return}}t===`ArrowLeft`?(e.preventDefault(),r?r.focus():n?.focus()):((t===`Enter`||t===` `)&&e.preventDefault(),this.handleCalendarButtonClick(e))}onlyNumericAndDash(e){let t=e.target;t.value=t.value.replace(/[^0-9-]/g,``)}render(){let e=m({"input-wrapper":!0,active:this.isOpen,error:this.error,disabled:this.disabled,readonly:this.readonly}),t=this._getValidDateRange();return c`<div class="datepicker-container" style="${this.labelColor?` --label-color: ${this.labelColor}`:``}">${this.renderLabelContainer()}<div class="input-container"><div class="${e}"><input type="text" class="date-input" .value="${this.inputValue??``}" placeholder="${this.placeholder}" ?disabled=${this.disabled} ?readonly=${this.readonly} maxlength="${this.maxLength}" inputmode="numeric" @input=${this.readonly?null:this.handleInput} @keydown=${this.readonly?null:this.handleKeyDown} @click=${this.readonly?this.handleCalendarButtonClick:null} />${this.isRenderClearButton&&this.selectedDate&&!this.disabled?c`<button class="icon-button clear-button" tabindex="0" @click=${this.handleClearDate} @keydown=${this.handleClearButtonKeydown} ><randstad-icon name="close"></randstad-icon></button>`:l}<button class="icon-button calendar-button" tabindex="0" @click=${this.handleCalendarButtonClick} @keydown=${this.handleCalendarButtonKeydown} ><randstad-icon name="calendar"></randstad-icon></button></div>${this.isOpen?c`<calendar-overlay .type=${this.type} .isMobile=${this.isMobile} .selectedDate=${this.selectedDate} .viewDate=${this.viewDate} .calendarWidth=${this.calendarWidth} .minDate=${t?.minDate} .maxDate=${t?.maxDate} .lastElement=${this.lastElement} @close=${()=>this.isOpen=!1} @view-date-change=${this.handleViewDateChange} @date-selected=${this.handleDateSelect} ></calendar-overlay>`:l} ${this.renderError()}</div>${this.renderHelper()}</div>`}};t([d({type:String}),e(`design:type`,String)],x.prototype,`width`,void 0),t([d({type:Boolean}),e(`design:type`,Object)],x.prototype,`isRenderClearButton`,void 0),t([d({type:Boolean}),e(`design:type`,Object)],x.prototype,`readonly`,void 0),t([d({type:String}),e(`design:type`,String)],x.prototype,`minDate`,void 0),t([d({type:String}),e(`design:type`,String)],x.prototype,`maxDate`,void 0),t([d({type:String}),e(`design:type`,String)],x.prototype,`type`,void 0),t([d({type:Boolean}),e(`design:type`,Object)],x.prototype,`eighteenOrOlder`,void 0),t([d({type:Number}),e(`design:type`,Number)],x.prototype,`maxLength`,void 0),t([p(),e(`design:type`,Object)],x.prototype,`isOpen`,void 0),t([p(),e(`design:type`,Object)],x.prototype,`selectedDate`,void 0),t([p(),e(`design:type`,typeof Date>`u`?Object:Date)],x.prototype,`viewDate`,void 0),t([p(),e(`design:type`,Object)],x.prototype,`isMobile`,void 0),t([p(),e(`design:type`,Number)],x.prototype,`calendarWidth`,void 0),t([p(),e(`design:type`,Object)],x.prototype,`inputValue`,void 0),t([f(`.input-container`),e(`design:type`,typeof HTMLDivElement>`u`?Object:HTMLDivElement)],x.prototype,`inputContainer`,void 0),t([d({type:Boolean,attribute:`last-element`}),e(`design:type`,Object)],x.prototype,`lastElement`,void 0),x=t([u(`datepicker-component`)],x);export{x as DatePickerComponent};
@@ -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}from"../styles/fontStyles.js";import"./Button.js";import{tooltipStyles as r}from"../styles/tooltip.js";import{mixStyles as i}from"../styles/mix.js";import{errorStyles as a}from"../styles/error.js";import"./Popup.js";import{BaseUpload as o}from"../helpers/BaseUpload.js";import{FILE_TYPE_MAPPING as s}from"../utils/file-format.js";import{progressBarUploadStyles as c}from"../styles/progress-bar-upload.js";import{css as l,html as u,nothing as d}from"lit";import{customElement as f,property as p,state as m}from"lit/decorators.js";let h=class extends o{constructor(...e){super(...e),this.maxFiles=1,this.acceptedFileTypes=[],this.maxFileSize=0,this.buttonText=`Agregar archivo`,this.showDeleteConfirmation=!1,this.showInternalError=!0,this.isRemovePopupOpen=!1,this.fileIndexToRemove=-1,this.fileNameToRemove=``}static{this.styles=l`${i}${a}${r}${c}:host([width]){width:var(--upload-file-width)}.file-container{display:flex;flex-direction:column;gap:8px}input[ type="file" ]{display:none}.file-list-container{width:100%;display:flex;justify-content:flex-end}.file-list{display:flex;flex-direction:column;align-items:flex-end;gap:8px}.file-item{display:flex;align-items:center;gap:8px;color:var(--secondary-color-80,#404767);max-width:100%}.file-name{${n};text-align:right;color:var(--secondary-color-40);vertical-align:middle;leading-trim:NONE;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:250px}.remove-file-button{--primary-color:var(--ui-negative,#E00F0F)}.progress-bar{width:100%}randstad-button::part(button):focus-visible{outline:2px solid rgb(0,215,255) !important;outline-offset:1px}`}getFileConfig(){let e=this.acceptedFileTypes.length>0,t=this.maxFileSize>0;return{baseMaxFiles:this.maxFiles,maxFileSize:this.maxFileSize,acceptedFileTypes:this.acceptedFileTypes,errorMessageType:e&&this.showInternalError?`formato de archivo no válido, se aceptan: ${this.getTextAcceptedFileTypes()}`:``,errorMessageSize:t&&this.showInternalError?`el archivo es demasiado grande, el máximo es de ${this.getTextMaxFileSize()}`:``,typeError:`file`}}getTextAcceptedFileTypes(){return this.getReadableFileTypes(this.acceptedFileTypes,s)}getTextMaxFileSize(){return this.baseGetTextMaxFileSize(this.maxFileSize)}updated(e){super.updated(e),this.applyWidth()}applyWidth(){this.width&&this.style.setProperty(`--upload-file-width`,this.width)}onFileInputChange(e){this.baseOnFileInputChange(e,this.getFileConfig())}willUpdate(e){(e.has(`maxFiles`)||e.size===0)&&(this.isMultiple=this.maxFiles>1)}handleRemoveFile(e,t){this.showDeleteConfirmation?this.confirmRemoveFile(e,t):this.removeFile(e,`file`)}confirmRemoveFile(e,t){this.fileIndexToRemove=e,this.fileNameToRemove=t,this.isRemovePopupOpen=!0}handlePopupClose(e){e.detail===!1&&this.removeFile(this.fileIndexToRemove,`file`),this.isRemovePopupOpen=!1,this.fileIndexToRemove=-1,this.fileNameToRemove=``}render(){let e=this.files.length>=this.maxFiles,t=this.disabled||e,n=u`<randstad-button .label=${this.buttonText} .variant=${`button-primary`} ?disabled=${t} @click=${()=>this.fileInput?.click()} ></randstad-button>`;return u`<div class="file-container" style="${this.labelColor?`--label-color: ${this.labelColor};`:``}">${this.renderLabelContainer()} ${this.renderLoadingContainer(n)}<input type="file" accept=${this.acceptedFileTypes.join(`,`)} ?multiple=${this.isMultiple} ?disabled=${t} @change="${this.onFileInputChange}" />${this.renderError()} ${this.renderHelper()} ${this.files.length>0?u`<div class="file-list-container"><div class="file-list">${this.files.map((e,t)=>u`<div class="file-item"><span class="file-name">${e.name}</span><randstad-button class="remove-file-button" .variant=${`button-icon`} .iconName=${`trash`} @click=${()=>this.handleRemoveFile(t,e.name)} ?disabled=${this.disabled} ></randstad-button></div>`)}</div></div>`:d} ${this.isRemovePopupOpen?u`<custom-popup .open=${this.isRemovePopupOpen} .type=${`other`} .icon=${`trash_circle`} .title=${`¿querés eliminar este ${this.typeTextFile||`archivo`}?`} .description=${void 0} .confirmText=${`cancelar`} .cancelText=${`sí, eliminar`} @popup-close=${this.handlePopupClose} ></custom-popup>`:d}</div>`}};t([p({type:String}),e(`design:type`,String)],h.prototype,`width`,void 0),t([p({type:Number}),e(`design:type`,Object)],h.prototype,`maxFiles`,void 0),t([p({type:Array}),e(`design:type`,Array)],h.prototype,`acceptedFileTypes`,void 0),t([p({type:Number}),e(`design:type`,Object)],h.prototype,`maxFileSize`,void 0),t([p({type:String}),e(`design:type`,Object)],h.prototype,`buttonText`,void 0),t([p({type:Boolean}),e(`design:type`,Object)],h.prototype,`showDeleteConfirmation`,void 0),t([p({type:Boolean}),e(`design:type`,Object)],h.prototype,`showInternalError`,void 0),t([m(),e(`design:type`,Boolean)],h.prototype,`isRemovePopupOpen`,void 0),t([m(),e(`design:type`,Number)],h.prototype,`fileIndexToRemove`,void 0),t([m(),e(`design:type`,String)],h.prototype,`fileNameToRemove`,void 0),h=t([f(`upload-file`)],h);export{h as UploadFile};
@@ -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{bodyS as n,bodyXS as r}from"../styles/fontStyles.js";import"./Button.js";import{coerceSortDirection as i,formatCount as a,normalizeJustifyContent as o,parseFilterItems as s,resolveSelectedValue as c,shouldHideCounts as l,toggleSortDirection as u}from"../helpers/filterBarUtils.js";import{LitElement as d,css as f,html as p,nothing as m}from"lit";import{customElement as h,property as g,state as _}from"lit/decorators.js";import{classMap as v}from"lit/directives/class-map.js";const y=`Filter categories`;let b=class extends d{constructor(...e){super(...e),this.items=[],this.selectedValue=`all`,this.sortDirection=`asc`,this.disabled=!1,this.label=y,this.justifyContent=``,this.sticky=!1,this.validatedItems=[],this.internalSelected=null,this.countsHidden=!1,this.resizeObserver=null,this.pendingFocusValue=null,this.handleSortClick=()=>{if(this.disabled)return;let e=u(i(this.sortDirection));this.sortDirection=e,this.dispatchEvent(new CustomEvent(`sort-change`,{detail:{direction:e},bubbles:!0,composed:!0}))}}static{this.styles=f`:host{display:block;font-family:'Graphik',sans-serif;-webkit-tap-highlight-color:transparent}.container{display:flex;align-items:center;gap:8px}.items{display:flex;align-items:stretch;flex:0 1 auto;min-width:0;height:49px;padding:4px;box-sizing:border-box;border-radius:9999px;border:1px solid var(--secondary-color-10,#E7E8EC);background-color:var(--white,#FFFFFF);overflow:hidden}.items.sticky{box-shadow:12px 12px 28px 0px #D0D3D7,-12px -12px 29px 0px #FFFFFF}.item{${n}display:inline-flex;align-items:center;justify-content:center;gap:4px;flex:0 0 auto;padding:8px 24px;border:none;border-radius:9999px;background:transparent;color:var(--secondary-color-80,#404767);white-space:nowrap;cursor:pointer;transition:background-color 0.2s ease-in-out,color 0.2s ease-in-out}.item:hover:not(:disabled):not(.selected){background-color:var(--randstad-blue-10,#E8F1FB)}.item:focus-visible{background-color:var(--primary-color-20,#D3E3F7);outline:2px solid var(--primary-color,#2175D9);outline-offset:-2px}.item.selected{background-color:var(--primary-color,#2175D9);color:var(--white,#FFFFFF)}.item.selected:hover:not(:disabled){background-color:var(--primary-button-hover,#175197)}.item.selected:focus-visible{background-color:var(--primary-button-active,#124077);outline:2px solid var(--white,#FFFFFF);outline-offset:-2px}.item:disabled{color:var(--secondary-color-40,#9FA3B3);cursor:default}.count{white-space:nowrap}.visually-hidden,.items[data-counts-hidden] .count{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);white-space:nowrap;border:0}randstad-button{flex-shrink:0}randstad-button::part(button){box-shadow:none !important;border:1px solid var(--secondary-color-10,#E7E8EC);-webkit-tap-highlight-color:transparent}randstad-button::part(button):hover:not(:disabled){border-color:var(--primary-color,#2175D9)}randstad-button::part(button):focus-visible{background-color:var(--primary-color-20,#D3E3F7);border-color:var(--primary-color,#2175D9)}@media (max-width:940px){.items{width:100%;flex:1 1 auto;min-width:0;height:39px}.item{${r}padding:8px 4px;flex:1 1 0}randstad-button::part(button){width:40px !important;height:40px !important}}`}willUpdate(e){let t=e.has(`items`),n=e.has(`selectedValue`);if(t&&(this.validatedItems=s(this.items)),t||n){let e=n?this.selectedValue:this.internalSelected??void 0;this.internalSelected=c(this.validatedItems,e)??null}}firstUpdated(e){super.firstUpdated(e),this.measureCounts(),this.observeItems()}connectedCallback(){super.connectedCallback(),this.hasUpdated&&(this.measureCounts(),this.observeItems())}updated(e){if(super.updated(e),this.pendingFocusValue!==null){let e=this.pendingFocusValue;this.pendingFocusValue=null,this.focusItemByValue(e)}this.measureCounts()}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect(),this.resizeObserver=null}observeItems(){if(typeof ResizeObserver>`u`||this.resizeObserver!==null)return;let e=this.renderRoot.querySelector(`.items`);if(e===null)return;this.resizeObserver=new ResizeObserver(()=>this.measureCounts()),this.resizeObserver.observe(e);let t=this.renderRoot.querySelector(`.container`);t!==null&&this.resizeObserver.observe(t)}measureCounts(){let e=this.renderRoot.querySelector(`.items`);e!==null&&(e.removeAttribute(`data-counts-hidden`),this.countsHidden=l(e.scrollWidth,e.clientWidth),this.countsHidden&&e.setAttribute(`data-counts-hidden`,``))}focusItemByValue(e){let t=Array.from(this.renderRoot.querySelectorAll(`.item`));for(let n of t)if(n.dataset.value===e){n.focus();return}}selectItem(e){this.disabled||e.disabled===!0||this.internalSelected!==e.value&&(this.internalSelected=e.value,this.dispatchEvent(new CustomEvent(`filter-change`,{detail:{value:e.value,item:e},bubbles:!0,composed:!0})))}handleItemKeydown(e,t){if(this.disabled||t.disabled===!0)return;let n=e.key;if(n===`Enter`||n===` `){e.preventDefault(),this.selectItem(t);return}let r=this.validatedItems.filter(e=>e.disabled!==!0);if(r.length===0)return;let i=r.findIndex(e=>e.value===t.value),a;switch(n){case`ArrowRight`:case`ArrowDown`:a=i<0?0:(i+1)%r.length;break;case`ArrowLeft`:case`ArrowUp`:a=i<0?r.length-1:(i-1+r.length)%r.length;break;case`Home`:a=0;break;case`End`:a=r.length-1;break;default:return}e.preventDefault();let o=r[a];if(o===void 0)return;let s=this.internalSelected!==o.value;this.selectItem(o),s&&(this.pendingFocusValue=o.value)}renderItem(e){let t=this.internalSelected===e.value,n=this.disabled||e.disabled===!0,r=a(e.count);return p`<button type="button" role="radio" part="item" class=${v({item:!0,selected:t})} data-value=${e.value} aria-checked=${t?`true`:`false`} tabindex=${t?`0`:`-1`} ?disabled=${n} @click=${()=>this.selectItem(e)} @keydown=${t=>this.handleItemKeydown(t,e)} ><span class="label">${e.label}</span>${r===``?m:p`<span class="count" part="count">${r}</span>`}</button>`}renderSortButton(){let e=i(this.sortDirection),t=e===`asc`?`Sort ascending. Activate to sort descending.`:`Sort descending. Activate to sort ascending.`,n=e===`asc`?`up_arrow`:`down_arrow`;return p`<randstad-button variant="button-round" part="sort" type="button" ?disabled=${this.disabled} @click=${this.handleSortClick} ><span class="visually-hidden sort-label">${t}</span><randstad-icon name=${n} size="24px" aria-hidden="true"></randstad-icon></randstad-button>`}render(){let e=typeof this.label==`string`?this.label.trim():``,t=e.length>0?e:y,n=o(this.justifyContent),r=n===``?m:`justify-content: ${n}`;return p`<div class="container" part="container" style=${r}><div class=${v({items:!0,sticky:this.sticky})} part="items" role="radiogroup" aria-label=${t} aria-disabled=${this.disabled?`true`:`false`} ?data-counts-hidden=${this.countsHidden} >${this.validatedItems.map(e=>this.renderItem(e))}</div>${this.renderSortButton()}</div>`}};t([g({type:Array}),e(`design:type`,Array)],b.prototype,`items`,void 0),t([g({type:String,attribute:`selected-value`}),e(`design:type`,String)],b.prototype,`selectedValue`,void 0),t([g({type:String,attribute:`sort-direction`}),e(`design:type`,Object)],b.prototype,`sortDirection`,void 0),t([g({type:Boolean,reflect:!0}),e(`design:type`,Boolean)],b.prototype,`disabled`,void 0),t([g({type:String}),e(`design:type`,String)],b.prototype,`label`,void 0),t([g({type:String,attribute:`justify-content`}),e(`design:type`,String)],b.prototype,`justifyContent`,void 0),t([g({type:Boolean,reflect:!0}),e(`design:type`,Boolean)],b.prototype,`sticky`,void 0),t([_(),e(`design:type`,Array)],b.prototype,`validatedItems`,void 0),t([_(),e(`design:type`,Object)],b.prototype,`internalSelected`,void 0),b=t([h(`randstad-filter-bar`)],b);var x=class extends b{};customElements.get(`filter-bar`)||customElements.define(`filter-bar`,x);export{b as FilterBar,x as LegacyFilterBar};
@@ -1,5 +1,6 @@
1
1
  import { TemplateResult } from 'lit';
2
2
  import { BaseControl } from '../helpers/BaseControl';
3
+ import './Icon';
3
4
  export declare class RandstadForm extends BaseControl {
4
5
  keydown: 'number' | 'text' | 'alfanumeric' | undefined;
5
6
  keydownRegex?: string;
@@ -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{BaseControl as n}from"../helpers/BaseControl.js";import{bodyL as r,bodyM as i}from"../styles/fontStyles.js";import{tooltipStyles as a}from"../styles/tooltip.js";import{mixStyles as o}from"../styles/mix.js";import{errorStyles as s}from"../styles/error.js";import{scrollbarStyles as c}from"../styles/scrollbar.js";import{css as l,html as u,nothing as d}from"lit";import{customElement as f,property as p}from"lit/decorators.js";const m=/[\p{Extended_Pictographic}\u{FE0F}\u{1F3FB}-\u{1F3FF}\u{1F9B0}-\u{1F9B3}\u{200D}]/gu;let h=class extends n{constructor(...e){super(...e),this.keydown=void 0,this.size=`md`,this.icon=null,this.typing=!1,this.type=`text`,this.isPasswordVisible=!1,this.cleanButton=!1}static{this.styles=[c,l`${o}${s}${a}.form{display:flex;flex-direction:column;gap:8px;width:100%}.form-input{${r}padding:16px;border:1px solid var(--secondary-color-10);border-radius:4px;outline:none;transition:border-color 0.3s ease,box-shadow 0.3s ease;width:100%;color:var(--secondary-color)}.form-input:-webkit-autofill,.form-input:-webkit-autofill:hover,.form-input:-webkit-autofill:focus,.form-input:-webkit-autofill:active{-webkit-box-shadow:0 0 0px 1000px #ffffff inset;-webkit-text-fill-color:var(--secondary-color);transition:background-color 5000s ease-in-out 0s}.form:not(.error):not(:focus-within) .form-input:hover{box-shadow:0px 0px 0px 4px var(--form-hover-shadow)}.form.error:not(:focus-within) .form-input:hover{box-shadow:0px 0px 0px 4px var(--ui-negative-pink-shadow)}.form-input:focus{border:2px solid var(--primary-color)}.form.disabled .form-input,.form.disabled .toggle-password randstad-icon,.form.disabled .clean-button randstad-icon{background-color:var(--secondary-color-10);color:#9FA3B3;cursor:default}.form.disabled .toggle-password,.form.disabled .clean-button{cursor:default}.input-with-button{display:flex;align-items:center;width:100%;position:relative}.input-with-button input{width:100%}.input-with-button input[type="password"]{padding-right:40px}.input-with-button button{position:absolute;right:10px;top:50%;transform:translateY(-50%);background:transparent;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;width:40px;height:40px}.toggle-password randstad-icon{width:100%;height:100%;max-width:32px;max-height:32px}textarea{${r}resize:none}textarea.form-input{min-height:30px;width:100%}.form.disabled textarea.form-input{background-color:var(--secondary-color-10);color:#9FA3B3;cursor:default}.link-text{${i}color:var(--primary-color);cursor:pointer;text-align:end;text-decoration:none;vertical-align:middle;display:inline;padding:0;margin:0;line-height:normal}.link-text:hover{color:var(--secondary-color);text-decoration:underline}.clean-button{position:absolute;right:10px;top:50%;transform:translateY(-50%);background:transparent;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;width:40px;height:40px}.clean-button randstad-icon{width:24px;height:24px;color:var(--primary-color)}`]}togglePassword(e){this.isPasswordVisible=!this.isPasswordVisible;let t=e.currentTarget.parentElement?.querySelector(`input`);t&&(t.type=this.isPasswordVisible?`text`:`password`),this.requestUpdate()}handleInput(e){this.handleInputCustom(e);let t=e.target.value;this.value=this.maxLength!==void 0&&this.type!==`textarea`?t.slice(0,this.maxLength):t,this.dispatchEvent(new CustomEvent(`valueChanged`,{detail:this.value})),this.dispatchEvent(new Event(`input`,{bubbles:!0})),this.requestUpdate()}handleClear(){this.value=``,this.dispatchEvent(new CustomEvent(`valueChanged`,{detail:this.value})),this.dispatchEvent(new Event(`input`,{bubbles:!0})),this.requestUpdate()}handleLinkClick(e){e.preventDefault(),this.linkRoute&&this.dispatchEvent(new CustomEvent(`linkClicked`,{detail:this.linkRoute,bubbles:!0,composed:!0}))}_updateValueWithCursor(e,t,n){let r=e.value;if(r!==t){n.preventDefault();let i=e.selectionStart,a=e.selectionEnd;if(e.value=t,i!==null&&a!==null){let n=r.length-t.length,o=Math.max(0,i-n),s=Math.max(0,a-n);e.setSelectionRange(o,s)}}}handleInputCustom(e){let t=e.target,n=!1;if(this.keydown===`number`||this.keydown===`text`||this.keydown===`alfanumeric`)n=!0;else if(this.keydownRegex)try{n=!new RegExp(this.keydownRegex).test(`😀`)}catch{n=!0}if(n){let n=t.value.replace(m,``);this._updateValueWithCursor(t,n,e)}this.keydown===`number`?this.onlyNumeric(e):this.keydown===`text`?this.onlyText(e):this.keydown===`alfanumeric`?this.onlyAlphanumeric(e):this.keydownRegex&&this.onlyRegex(e)}onlyNumeric(e){let t=e.target,n=t.value.replace(/[^0-9]/g,``);this._updateValueWithCursor(t,n,e)}onlyText(e){let t=e.target,n=t.value.replace(/[^a-zA-Z\sáéíóúüñÁÉÍÓÚÑÜ]/g,``).trimStart();this._updateValueWithCursor(t,n,e)}onlyAlphanumeric(e){let t=e.target,n=t.value.replace(/[^a-zA-Z0-9]/g,``).trimStart();this._updateValueWithCursor(t,n,e)}onlyRegex(e){if(!this.keydownRegex)return;let t=e.target,n=t.value,r=this.keydownRegex.match(/\[\^?[^\]]+\]/g);r||=[`[${this.keydownRegex}]`];let i=``,a=r.length>=2,o=new RegExp(r[0]),s=a?new RegExp(r[1]):o,c=n.split(``);for(let e=0;e<c.length;e++){let t=c[e];e===0?o.test(t)&&(i+=t):s.test(t)&&(i+=t)}let l=i.trimStart();this._updateValueWithCursor(t,l,e)}handleInputKeyDown(e){this.handleKeyDown(e),this.handleInputArrowKey(e)}get _isCleanButtonVisible(){return this.cleanButton&&!!this.value&&this.type!==`password`&&this.type!==`textarea`}handleKeyDown(e){if(e.key!==`Enter`)return;let t=new Event(`submit`,{bubbles:!0,composed:!0,cancelable:!0}),n=this.closest(`form`);n&&n.dispatchEvent(t)}get _inputMode(){return this.type===`password`?`text`:this.keydown===`number`?`numeric`:`text`}handleInputArrowKey(e){if(e.key!==`ArrowRight`)return;let t=e.target;(this.type===`password`||this._isCleanButtonVisible)&&t.selectionStart===t.value.length&&(e.preventDefault(),(this.shadowRoot?.querySelector(`.toggle-password, .clean-button`))?.focus())}handleButtonArrowKey(e){if(e.key!==`ArrowLeft`)return;e.preventDefault();let t=this.shadowRoot?.querySelector(`.form-input`);t&&(t.focus(),t.selectionStart=t.selectionEnd=t.value.length)}render(){let e=this.type===`textarea`?` height: ${this.heightTextArea??`30px`}; max-height: ${this.maxHeightTextArea??`30px`}; overflow-y: auto; `:``,t=this.labelColor?`--label-color: ${this.labelColor};`:``,n=u`<randstad-icon name="${this.isPasswordVisible?`eye_crossed`:`eye`}" size="24px" ></randstad-icon>`;return u`<div class="form ${this.error?`error`:``} ${this.disabled?`disabled`:``}" style="${t}" >${this.renderLabelContainer()}<div class="form-container">${this.icon===`left`?u`<span class="icon left"></span>`:d}<div class="input-with-button">${this.type===`textarea`?u`<textarea class="form-input" placeholder=${this.placeholder||``} .value=${this.value} ?disabled=${this.disabled} @input=${this.handleInput} @keydown=${this.handleKeyDown} maxlength=${this.maxLength??d} style="${e}" ></textarea>`:u`<input class="form-input" type=${this.type===`password`&&!this.isPasswordVisible?`password`:`text`} placeholder=${this.placeholder||``} .value=${this.value} ?disabled=${this.disabled} @input=${this.handleInput} maxlength=${this.maxLength??d} @keydown=${this.handleInputKeyDown} inputmode=${this._inputMode} />${this.type===`password`?u`<button type="button" class="toggle-password" @click=${this.togglePassword} ?disabled=${this.disabled} @keydown=${this.handleButtonArrowKey} aria-label="${this.isPasswordVisible?`Hide password`:`Show password`}" >${n}</button>`:d} ${this._isCleanButtonVisible?u`<button type="button" class="clean-button" @click=${this.handleClear} ?disabled=${this.disabled} @keydown=${this.handleButtonArrowKey} aria-label="Clear input" ><randstad-icon name="close" size="24px" ></randstad-icon></button>`:d} `}</div>${this.icon===`right`?u`<span class="icon right"></span>`:d} ${this.renderError()}</div>${this.linkText&&this.linkRoute?u`<div style="text-align: end;"><a class="link-text" @click=${this.handleLinkClick}>${this.linkText}</a></div>`:d} ${this.renderHelper()}</div>`}};t([p({type:String}),e(`design:type`,Object)],h.prototype,`keydown`,void 0),t([p({type:String}),e(`design:type`,String)],h.prototype,`keydownRegex`,void 0),t([p({type:String}),e(`design:type`,String)],h.prototype,`size`,void 0),t([p({type:String}),e(`design:type`,Object)],h.prototype,`icon`,void 0),t([p({type:Boolean}),e(`design:type`,Boolean)],h.prototype,`typing`,void 0),t([p({type:String}),e(`design:type`,String)],h.prototype,`type`,void 0),t([p({type:String}),e(`design:type`,String)],h.prototype,`linkText`,void 0),t([p({type:String}),e(`design:type`,String)],h.prototype,`linkRoute`,void 0),t([p({type:Boolean,reflect:!0}),e(`design:type`,Object)],h.prototype,`isPasswordVisible`,void 0),t([p({type:Boolean}),e(`design:type`,Boolean)],h.prototype,`cleanButton`,void 0),t([p({type:Number}),e(`design:type`,Number)],h.prototype,`maxLength`,void 0),t([p({type:String}),e(`design:type`,String)],h.prototype,`heightTextArea`,void 0),t([p({type:String}),e(`design:type`,String)],h.prototype,`maxHeightTextArea`,void 0),h=t([f(`randstad-form`)],h);export{h as RandstadForm};
@@ -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{BaseControl as n}from"../helpers/BaseControl.js";import{tooltipStyles as r}from"../styles/tooltip.js";import{mixStyles as i}from"../styles/mix.js";import{errorStyles as a}from"../styles/error.js";import{css as o,html as s}from"lit";import{customElement as c,property as l}from"lit/decorators.js";let u=class extends n{constructor(...e){super(...e),this.rows=``}static{this.styles=o`${i}${a}${r}:host{display:flex;flex-direction:column;gap:8px}.group-container{display:flex;flex-direction:column;gap:8px;width:100%}.fields{gap:8px}`}render(){let e=this.rows?`display: grid; grid-template-columns: ${this.rows};`:`display: flex; flex-direction: column;`;return s`<div class="group-container">${this.renderLabelContainer()}<div class="input-container"><div class="fields" style="${e};"><slot></slot></div>${this.renderError()}</div>${this.renderHelper()}</div>`}};t([l({type:String}),e(`design:type`,String)],u.prototype,`rows`,void 0),u=t([c(`randstad-form-group`)],u);export{u as FormGroup};
@@ -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{LitElement as n,css as r,html as i}from"lit";import{property as a,state as o}from"lit/decorators.js";let s=null,c=null;function l(){return s?Promise.resolve(s):(c||=import(`./icons.js`).then(e=>(s=e.ICONS,s)),c)}var u=class extends n{constructor(...e){super(...e),this.name=``,this.size=`24px`,this.color=``,this.svgTemplate=null}static{this.styles=r`:host{display:inline-flex;width:var(--icon-size,24px);height:var(--icon-size,24px);align-items:center;justify-content:center}svg{width:var(--icon-size,24px);height:var(--icon-size,24px);fill:var(--icon-color,currentColor)}.custom-icon{display:flex;justify-content:center;align-items:center;width:100%;height:100%}`}updated(e){super.updated(e),e.has(`size`)&&this.style.setProperty(`--icon-size`,this.size),e.has(`color`)&&this.style.setProperty(`--icon-color`,this.color),e.has(`name`)&&this.name&&this.loadIcon()}async loadIcon(){try{let e=(s??await l())[this.name];if(!e)throw Error(`Icon not found`);e=e.replace(/fill="[^"]*"/g,``),e=e.replace(/fill='[^']*'/g,``);let t=new DOMParser().parseFromString(e,`image/svg+xml`).documentElement;this.svgTemplate=i` ${t} `}catch(e){console.error(`❌ Error cargando icono ${this.name}:`,e),this.innerHTML=` <span>⚠️</span> `}}render(){return this.svgTemplate?i`<div class="custom-icon" style="color: ${this.color};">${this.svgTemplate}</div>`:i``}};t([a({type:String}),e(`design:type`,Object)],u.prototype,`name`,void 0),t([a({type:String}),e(`design:type`,Object)],u.prototype,`size`,void 0),t([a({type:String}),e(`design:type`,Object)],u.prototype,`color`,void 0),t([o(),e(`design:type`,Object)],u.prototype,`svgTemplate`,void 0),customElements.define(`randstad-icon`,u);export{u as IconComponent};
@@ -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};
@@ -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{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:16px}.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{${n}color:var(--secondary-color-60);margin:8px 0 0;text-align:center}.resend-link{color:var(--primary-color);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}.resend-link:disabled,.resend-link.disabled{color:var(--secondary-color-60);cursor:default;pointer-events:none;opacity:0.6}.confirm-button{margin-top:8px}@media (max-width:940px){.pin-group{gap:8px;width:100%}.pin-input{flex:1;min-width:0;height:62px;font-size:18px}}:host{--modal-body-padding:24px}@media (min-width:501px) and (max-width:940px){:host{--modal-body-padding:50px}}@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`<p class="resend-line"> ¿no lo recibiste?&nbsp; ${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>`}</p>`}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><randstad-button class="confirm-button" variant="button-primary" size="md" label="actualizar" .loader=${this.loading} .disabled=${!this._isComplete||this.loading} @click=${this._onConfirm} ></randstad-button>${this._renderResendSection()}</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};
@@ -1,6 +1,7 @@
1
1
  import { LitElement } from 'lit';
2
2
  import '../components/Notice';
3
3
  import '../components/Button';
4
+ import './Icon';
4
5
  export declare class CustomModal extends LitElement {
5
6
  open: boolean;
6
7
  title: string;
@@ -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,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;--modal-body-padding:24px}: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:var(--modal-body-padding,24px);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([d({type:String}),e(`design:type`,String)],p.prototype,`paddingModalBody`,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};
@@ -1,4 +1,5 @@
1
1
  import { LitElement, TemplateResult } from 'lit';
2
+ import './Icon';
2
3
  export interface NavItem {
3
4
  readonly icon: string;
4
5
  readonly label: string;
@@ -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{LitElement as n,css as r,html as i,nothing as a}from"lit";import{customElement as o,property as s}from"lit/decorators.js";import{classMap as c}from"lit/directives/class-map.js";let l=class extends n{constructor(){super(),this.centerIcon=`search`,this.centerLabel=``,this.hidden=!1,this.desktop=!1,this.selectedIndex=-1,this._rafId=null,this.handleScroll=()=>{let e=window.innerHeight+window.scrollY,t=document.documentElement.scrollHeight;this.hidden=e>=t-50},this.handleScrollThrottled=()=>{this._rafId??=requestAnimationFrame(()=>{this._rafId=null,this.handleScroll()})},this.items=[{icon:`home`,label:`Home`},{icon:`postulation`,label:`Applications`},{icon:`user`,label:`Users`},{icon:`settings`,label:`Settings`}]}connectedCallback(){super.connectedCallback(),window.addEventListener(`scroll`,this.handleScrollThrottled,{passive:!0}),this.handleScroll()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(`scroll`,this.handleScrollThrottled),this._rafId!=null&&(cancelAnimationFrame(this._rafId),this._rafId=null)}handleItemClick(e,t){this.selectedIndex=e,this.dispatchEvent(new CustomEvent(`nav-item-click`,{detail:{index:e,item:t},bubbles:!0,composed:!0}))}handleCenterClick(){this.dispatchEvent(new CustomEvent(`center-click`,{bubbles:!0,composed:!0}))}static{this.styles=r`:host{display:none;position:fixed;bottom:0;left:0;right:0;z-index:9998;font-family:'Graphik',sans-serif;transition:transform 0.3s ease,opacity 0.3s ease}:host([hidden]){transform:translateY(100%);opacity:0}@media (max-width:940px){:host{display:block}}@media (prefers-reduced-motion:reduce){:host{transition:none}}@media (min-width:941px){:host([desktop]){display:block}}.navbar{display:flex;align-items:center;justify-content:center;height:71px;background:var(--white,#ffffff);border-radius:16px 16px 0 0;box-shadow:0px -1px 16px 1px rgba(15,25,65,0.15),0px -1px 16px 0px rgba(15,25,65,0.3);padding:0 16px}.side-item{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:34px;height:51px;text-decoration:none;cursor:pointer;gap:8px;flex:1}.side-item .item-icon{width:24px;height:24px;display:flex;align-items:center;justify-content:center}.side-item .item-icon randstad-icon{--icon-color:var(--secondary-color-80,#404767)}.side-item.active .item-icon randstad-icon{--icon-color:var(--primary-color,#2175d9)}.side-item .item-label{font-family:'Graphik',sans-serif;font-weight:400;font-size:10px;line-height:12px;letter-spacing:0%;color:var(--secondary-color-80,#404767);text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.side-item.active .item-label{color:var(--primary-color,#2175d9)}.center-button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;cursor:pointer;background:none;border:none;padding:0;margin:0 12px;flex-shrink:0}.center-circle{width:60px;height:60px;border-radius:100px;background:var(--primary-color,#2175d9);border:4px solid rgba(211,227,247,1);display:flex;align-items:center;justify-content:center;transform:translateY(-12px)}.center-circle randstad-icon{--icon-color:var(--white,#ffffff)}.center-label{font-family:'Graphik',sans-serif;font-weight:400;font-size:10px;line-height:12px;letter-spacing:0%;color:var(--secondary-color,#0f1941);text-align:center}@media (max-width:940px){.center-button{margin:0}.side-item{min-width:unset}}}`}render(){let e=this.items.slice(0,2),t=this.items.slice(2,4),n=(e,t)=>{let n=t===this.selectedIndex,r=c({"side-item":!0,active:n});return i`<a class=${r} href=${e.href||`#`} @click=${n=>{e.href||n.preventDefault(),this.handleItemClick(t,e)}} aria-label=${e.label} aria-current=${n?`page`:a} ><span class="item-icon"><randstad-icon name=${e.icon} size="24" aria-hidden="true"></randstad-icon></span><span class="item-label">${e.label}</span></a>`};return i`<nav class="navbar" role="navigation" aria-label="Navegación principal">${e.map((e,t)=>n(e,t))}<button class="center-button" @click=${this.handleCenterClick} aria-label="Abrir menú"><span class="center-circle"><randstad-icon name=${this.centerIcon} size="28" aria-hidden="true"></randstad-icon></span>${this.centerLabel?i`<span class="center-label">${this.centerLabel}</span>`:a}</button>${t.map((e,t)=>n(e,t+2))}</nav>`}};t([s({type:Array}),e(`design:type`,Array)],l.prototype,`items`,void 0),t([s({type:String}),e(`design:type`,Object)],l.prototype,`centerIcon`,void 0),t([s({type:String}),e(`design:type`,Object)],l.prototype,`centerLabel`,void 0),t([s({type:Boolean,reflect:!0}),e(`design:type`,Object)],l.prototype,`hidden`,void 0),t([s({type:Boolean,reflect:!0}),e(`design:type`,Object)],l.prototype,`desktop`,void 0),t([s({type:Number}),e(`design:type`,Object)],l.prototype,`selectedIndex`,void 0),l=t([o(`randstad-navbar`),e(`design:paramtypes`,[])],l);export{l as RandstadNavbar};
@@ -1,4 +1,5 @@
1
1
  import { LitElement } from 'lit';
2
+ import './Icon';
2
3
  export declare class RandstadNotice extends LitElement {
3
4
  type: string;
4
5
  icon: string;
@@ -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}from"../styles/fontStyles.js";import{LitElement as r,css as i,html as a}from"lit";import{customElement as o,property as s}from"lit/decorators.js";let c=class extends r{constructor(...e){super(...e),this.type=`informative`,this.icon=`info`,this.message=`Este es un mensaje.`,this.open=!1}static{this.styles=i`:host{display:block;font-family:'Graphik',sans-serif}.container{${n}display:flex;align-items:flex-start;gap:8px;border-radius:8px;padding:16px;color:var(--secondary-color)}.icon{font-size:34px;flex-shrink:0}.hidden{display:none}.success{border:1px solid var(--ui-positive);background:var(--ui-positive-5);--icon-color:var(--ui-positive)}.error{border:1px solid var(--ui-negative);background:var(--ui-negative-5);--icon-color:var(--ui-negative)}.warning{border:1px solid var(--ui-warning);background:var(--ui-warning-10);--icon-color:var(--ui-warning)}.informative{border:1px solid var(--ui-informative);background:var(--ui-informative-10);--icon-color:var(--ui-informative)}@media (max-width:500px){.container{padding:8px;font-size:14px;gap:5px}.icon-box{width:16px;display:flex;align-items:center;justify-content:center;height:24px}randstad-icon{--icon-size:16px !important}}`}render(){return a`<div class="container ${this.open?``:`hidden`} ${this.type}"><div class="icon-box"><randstad-icon name="${this.icon}" ></randstad-icon></div><span class="message">${this.message}</span></div>`}};t([s({type:String}),e(`design:type`,String)],c.prototype,`type`,void 0),t([s({type:String}),e(`design:type`,String)],c.prototype,`icon`,void 0),t([s({type:String}),e(`design:type`,String)],c.prototype,`message`,void 0),t([s({type:Boolean}),e(`design:type`,Boolean)],c.prototype,`open`,void 0),c=t([o(`randstad-notice`)],c);export{c as RandstadNotice};
@@ -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,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:24px;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{margin-top:12px;display:flex;gap:10px}.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}<div class="buttons-container"><randstad-button variant="button-primary" size="md" @click=${()=>this.closePopup(!0)} label=${this.buttonText} ></randstad-button></div>`: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 class="buttons-container"><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></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};