@randstad-uca/design-system 1.0.127 → 1.0.128
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js";import t from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";import"./Icon.js";import{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
|
+
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),this.ownerDocument.querySelector(`randstad-snackbar`)?.classList.remove(`navbar-visible`)}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};
|
package/dist/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.button{align-items:center;border:none;border-radius:4px;cursor:pointer;display:flex;font-family:Graphik,sans-serif;font-weight:400;gap:4px;justify-content:center;padding:16px;transition:background-color .2s,color .2s,box-shadow .2s}.button-lg{font-size:18px;line-height:30px;min-width:48px}.button-md{font-size:14px;line-height:25px}.button-sm{height:62px;padding:0;width:62px}.button-primary{background-color:var(--primary-color);color:var(--white)}.button-danger{background-color:var(--danger-button,#e00f0f);color:var(--white)}.button-danger.hover{background-color:var(--danger-button-hover,#c90d0d)}.button-danger.active{background-color:var(--danger-button-active,#b30c0c)}.button-danger.focus{background-color:var(--danger-button-focus,#e00f0f)}.button-danger.disabled{background-color:#cfd1d9;color:var(--secondary-color-60)}.button-icon-img{height:24px;-o-object-fit:contain;object-fit:contain;width:24px}.button.button-danger randstad-icon{color:var(--white)}.button-primary.hover{background-color:var(--primary-button-hover)}.button-primary.active{background-color:var(--primary-button-active)}.button-primary.focus-visible{background-color:var(--primary-button-focus)}.button-primary.disabled{background-color:var(--secondary-color-20);color:var(--secondary-color-60)}.button-secondary{background:none;border:1px solid var(--primary-color);color:var(--primary-color)}.button-secondary.hover{border:1px solid var(#175197);color:var(#175197)}.button-secondary.active{border:1px solid var(--secondary-color-80);color:var(--secondary-color-80)}.button-secondary.focus-visible{border:1px solid var(--primary-color);color:var(--primary-color)}.button-secondary.disabled{border:1px solid var(--secondary-color-60);color:var(--secondary-color-60)}.button-tertiary{background:none;border:none;color:var(--primary-color)}.button-tertiary.hover{background:#2175d90d}.button-tertiary.active{background-color:#2175d91a}.button-tertiary.focus-visible{border:1px solid var(--primary-color)}.button-tertiary.disabled{color:#6f758d}.button-icon-left>.icon,.button-icon-right>.icon{display:inline-block;height:1rem;width:1rem}.button-icon-left>.icon{margin-right:.5rem}.button-icon-right>.icon{margin-left:.5rem}.button-round{align-items:center;background-color:var(--white);border:none;border-radius:50%;box-shadow:0 2px 5px rgba(0,0,0,.2);cursor:pointer;display:flex;height:48px;justify-content:center;padding:0;width:48px}.button-round img.button-icon{height:24px;-o-object-fit:contain;object-fit:contain;width:24px}.button randstad-icon,.button.button-primary randstad-icon{color:var(--white)}.button.button-secondary randstad-icon,.button.button-tertiary randstad-icon{color:var(--primary-color)}.loader{align-items:center;display:flex;gap:6px;justify-content:center}.dot{animation:growAndFade 1.2s ease-in-out infinite;border-radius:50%;display:inline-block;height:10px;width:10px}.dot:first-child{animation-delay:0s}.dot:nth-child(2){animation-delay:.2s}.dot:nth-child(3){animation-delay:.4s}@keyframes growAndFade{0%{opacity:.3;transform:scale(.9)}50%{opacity:1;transform:scale(1.4)}to{opacity:.3;transform:scale(.9)}}.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)}
|
|
1
|
+
:root{--primary-color:#2175d9;--primary-color-80:#4e90e1;--primary-color-60:#7aace8;--primary-color-40:#a6c8f0;--primary-color-20:#d3e3f7;--primary-color-10:#2175d91a;--primary-color-5:#2175d90d;--secondary-color:#0f1941;--secondary-color-80:#404767;--secondary-color-60:#6f758d;--secondary-color-40:#9fa3b3;--secondary-color-20:#cfd1d9;--secondary-color-10:#e7e8ec;--brand-randstad-blue:#2175d9;--randstad-blue-10:#e8f1fb;--randstad-blue-40:#a6c8f0;--brand-dark-blue:#0f1941;--brand-light-blue:#00d7ff;--brand-off-white:#f7f5f0;--ui-negative:#e00f0f;--ui-negative-5:#fdf3f3;--ui-negative-pink-shadow:#e00f0f1a;--ui-positive:#257156;--ui-positve-5:#f4f8f6;--ui-warning:#e9a204;--ui-warning-10:#fcf5e5;--ui-informative:#4e90e1;--ui-informative-10:#e8f1fb;--tertiary-shade:#dedcd8;--tertiary-tint:#f9f7f3;--gray-20:#d7d7d7;--gray-10:#f7f7f7;--white:#fff;--primary-button-hover:#175197;--primary-button-active:#124077;--primary-button-focus:#2175d9;--danger-button:#e00f0f;--danger-button-hover:#c90d0d;--danger-button-active:#b30c0c;--danger-button-focus:#e00f0f;--form-hover-shadow:#d1d3db;--randstad-dark-blue-40:#262626;--primary-light-blue:#00d7ff;--primary-light-blue-20:#00d7ff33}@font-face{font-family:Graphik;font-style:normal;font-weight:400;src:url(/src/assets/font/Graphik-Regular.woff2) format("woff2"),url(/src/assets/font/Graphik-Regular.woff) format("woff"),url(/src/assets/font/Graphik-Regular.eot) format("embedded-opentype")}.button{align-items:center;border:none;border-radius:4px;cursor:pointer;display:flex;font-family:Graphik,sans-serif;font-weight:400;gap:4px;justify-content:center;padding:16px;transition:background-color .2s,color .2s,box-shadow .2s}.button-lg{font-size:18px;line-height:30px;min-width:48px}.button-md{font-size:14px;line-height:25px}.button-sm{height:62px;padding:0;width:62px}.button-primary{background-color:var(--primary-color);color:var(--white)}.button-danger{background-color:var(--danger-button,#e00f0f);color:var(--white)}.button-danger.hover{background-color:var(--danger-button-hover,#c90d0d)}.button-danger.active{background-color:var(--danger-button-active,#b30c0c)}.button-danger.focus{background-color:var(--danger-button-focus,#e00f0f)}.button-danger.disabled{background-color:#cfd1d9;color:var(--secondary-color-60)}.button-icon-img{height:24px;-o-object-fit:contain;object-fit:contain;width:24px}.button.button-danger randstad-icon{color:var(--white)}.button-primary.hover{background-color:var(--primary-button-hover)}.button-primary.active{background-color:var(--primary-button-active)}.button-primary.focus-visible{background-color:var(--primary-button-focus)}.button-primary.disabled{background-color:var(--secondary-color-20);color:var(--secondary-color-60)}.button-secondary{background:none;border:1px solid var(--primary-color);color:var(--primary-color)}.button-secondary.hover{border:1px solid var(#175197);color:var(#175197)}.button-secondary.active{border:1px solid var(--secondary-color-80);color:var(--secondary-color-80)}.button-secondary.focus-visible{border:1px solid var(--primary-color);color:var(--primary-color)}.button-secondary.disabled{border:1px solid var(--secondary-color-60);color:var(--secondary-color-60)}.button-tertiary{background:none;border:none;color:var(--primary-color)}.button-tertiary.hover{background:#2175d90d}.button-tertiary.active{background-color:#2175d91a}.button-tertiary.focus-visible{border:1px solid var(--primary-color)}.button-tertiary.disabled{color:#6f758d}.button-icon-left>.icon,.button-icon-right>.icon{display:inline-block;height:1rem;width:1rem}.button-icon-left>.icon{margin-right:.5rem}.button-icon-right>.icon{margin-left:.5rem}.button-round{align-items:center;background-color:var(--white);border:none;border-radius:50%;box-shadow:0 2px 5px rgba(0,0,0,.2);cursor:pointer;display:flex;height:48px;justify-content:center;padding:0;width:48px}.button-round img.button-icon{height:24px;-o-object-fit:contain;object-fit:contain;width:24px}.button randstad-icon,.button.button-primary randstad-icon{color:var(--white)}.button.button-secondary randstad-icon,.button.button-tertiary randstad-icon{color:var(--primary-color)}.loader{align-items:center;display:flex;gap:6px;justify-content:center}.dot{animation:growAndFade 1.2s ease-in-out infinite;border-radius:50%;display:inline-block;height:10px;width:10px}.dot:first-child{animation-delay:0s}.dot:nth-child(2){animation-delay:.2s}.dot:nth-child(3){animation-delay:.4s}@keyframes growAndFade{0%{opacity:.3;transform:scale(.9)}50%{opacity:1;transform:scale(1.4)}to{opacity:.3;transform:scale(.9)}}.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)}
|