@randstad-uca/design-system 1.0.125 → 1.0.127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/components/Modal.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js";import t from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";import"./Icon.js";import{bodyM as n,titleS as r}from"../styles/fontStyles.js";import"./Button.js";import{focusStyles as i}from"../styles/focus.js";import{scrollbarStyles as a}from"../styles/scrollbar.js";import"./Notice.js";import{LitElement as o,css as s,html as c,nothing as l}from"lit";import{customElement as u,property as d,state as f}from"lit/decorators.js";let p=class extends o{constructor(...e){super(...e),this.open=!1,this.title=`Título del modal`,this.showNotice=!1,this.noticeType=`informative`,this.noticeMessage=``,this.noticeIcon=`info`,this.showPrimaryButton=!1,this.primaryButtonLabel=`Aceptar`,this.showSecondaryButton=!1,this.secondaryButtonLabel=`Cancelar`,this.isFooterCustom=!1,this.isPrimaryLoader=!1,this.isPrimaryDisabled=!1,this.modalWidth=`500px`,this.modalHeight=`80dvh`,this.maxHeight=`90dvh`,this.hideFooter=!1,this.scrollable=!1,this.hasDropdownOpen=!1,this.hasCalendarOpen=!1,this.handleDropdownOpen=e=>{let t=e.detail;this.hasDropdownOpen=t&&typeof t.open==`boolean`?t.open:!0},this.handleCalendarOpen=e=>{let t=e.detail;this.hasCalendarOpen=t&&typeof t.open==`boolean`?t.open:!0},this.setScrollableMode=()=>{this.scrollable=window.innerWidth>940}}static{this.styles=[a,s`${i}:host{font-family:'Graphik',sans-serif;display:none}: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-
|
|
1
|
+
import e from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js";import t from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";import"./Icon.js";import{bodyM as n,titleS as r}from"../styles/fontStyles.js";import"./Button.js";import{focusStyles as i}from"../styles/focus.js";import{scrollbarStyles as a}from"../styles/scrollbar.js";import"./Notice.js";import{LitElement as o,css as s,html as c,nothing as l}from"lit";import{customElement as u,property as d,state as f}from"lit/decorators.js";let p=class extends o{constructor(...e){super(...e),this.open=!1,this.title=`Título del modal`,this.showNotice=!1,this.noticeType=`informative`,this.noticeMessage=``,this.noticeIcon=`info`,this.showPrimaryButton=!1,this.primaryButtonLabel=`Aceptar`,this.showSecondaryButton=!1,this.secondaryButtonLabel=`Cancelar`,this.isFooterCustom=!1,this.isPrimaryLoader=!1,this.isPrimaryDisabled=!1,this.modalWidth=`500px`,this.modalHeight=`80dvh`,this.maxHeight=`90dvh`,this.hideFooter=!1,this.scrollable=!1,this.hasDropdownOpen=!1,this.hasCalendarOpen=!1,this.handleDropdownOpen=e=>{let t=e.detail;this.hasDropdownOpen=t&&typeof t.open==`boolean`?t.open:!0},this.handleCalendarOpen=e=>{let t=e.detail;this.hasCalendarOpen=t&&typeof t.open==`boolean`?t.open:!0},this.setScrollableMode=()=>{this.scrollable=window.innerWidth>940}}static{this.styles=[a,s`${i}:host{font-family:'Graphik',sans-serif;display:none}:host([open]){display:block;z-index:9999}.overlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:9999;display:flex;background:rgba(15,25,65,0.4);justify-content:center;align-items:center}.modal{width:100%;height:var(--modal-height);max-height:var(--modal-max-height);background:var(--brand-off-white);max-width:var(--modal-width);box-shadow:0 4px 12px rgba(0,0,0,0.15);display:flex;flex-direction:column;border-radius:8px;overflow:hidden}.modal-body{overflow-y:auto;flex:1}.modal-footer{justify-content:flex-end}.modal-footer.one-button randstad-button{width:100%}.modal-footer.two-buttons randstad-button{width:50%}@media (max-width:940px){.modal{width:100% !important;height:100% !important;max-width:none !important;max-height:none !important;margin:0 !important;border-radius:0 !important}.modal-header,.modal-body,.modal-footer{padding:0}}.modal-header{display:flex;flex-direction:column;gap:8px;justify-content:space-between;align-items:center;padding:16px;border-bottom:1px solid var(--secondary-color-20)}.modal-header-content{display:flex;gap:32px;width:100%;justify-content:space-between;align-items:center}.titles-container{display:flex;flex-direction:column;gap:8px;flex-grow:1}.modal-title{display:flex;justify-content:space-between;align-items:center;${r}font-style:regular;font-size:24px;line-height:32px;letter-spacing:-1px;margin:0;color:var(--secondary-color)}.modal-subtitle{${n}margin:0;color:var(--secondary-color-80,#404767)}.modal-header randstad-notice{width:100%}.modal-close{background:none;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;width:40px;height:40px;border-radius:50%;transition:background-color 0.2s ease}.modal-close:hover{background-color:var(--primary-color-10)}.modal-body{display:flex;flex-direction:column;padding:16px;gap:16px}slot[name="content"].has-dropdown-open{display:block;padding-bottom:40px}slot[name="content"].has-calendar-open{display:block;padding-bottom:160px}slot[name="content"].has-dropdown-open.has-calendar-open{padding-bottom:160px}.modal-footer{display:flex;padding:24px;gap:16px;border-top:1px solid var(--secondary-color-20)}@media (max-width:940px){.modal-close:hover{background-color:transparent}}@media (max-width:500px){.modal-body{padding:16px}}`]}closeModal(){this.dispatchEvent(new CustomEvent(`modal-close`))}connectedCallback(){super.connectedCallback(),this.setScrollableMode(),window.addEventListener(`resize`,this.setScrollableMode),this.addEventListener(`dropdown-toggle`,this.handleDropdownOpen),this.addEventListener(`calendar-toggle`,this.handleDropdownOpen),this.addEventListener(`dropdown-toggle-calendar`,this.handleCalendarOpen)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(`resize`,this.setScrollableMode),this.removeEventListener(`dropdown-toggle`,this.handleDropdownOpen),this.removeEventListener(`calendar-toggle`,this.handleDropdownOpen),this.removeEventListener(`dropdown-toggle-calendar`,this.handleCalendarOpen)}getFooterClass(){return this.isFooterCustom&&!this.showPrimaryButton&&!this.showSecondaryButton?`footer-custom`:this.showPrimaryButton&&this.showSecondaryButton?`two-buttons`:`one-button`}render(){return c`<div class="overlay" role="dialog" aria-modal="true"><div class="modal" style="--modal-width: ${this.modalWidth}; --modal-height: ${this.modalHeight}; --modal-max-height: ${this.maxHeight};"><div class="modal-header"><div class="modal-header-content"><div class="titles-container"><div class="modal-title">${this.title}<button class="modal-close" @click=${this.closeModal} aria-label="Cerrar modal"><randstad-icon name="close" size="24" .color=${`var( --primary-color )`} ></randstad-icon></button></div>${this.subtitle?c`<div class="modal-subtitle">${this.subtitle}</div>`:l}</div></div>${this.showNotice?c`<randstad-notice .open=${!0} .type=${this.noticeType} .icon=${this.noticeIcon} .message=${this.noticeMessage} ></randstad-notice>`:l}</div><div class="modal-body ${this.scrollable?`scrollable`:``}"><slot name="content" class="${this.hasDropdownOpen?`has-dropdown-open`:``} ${this.hasCalendarOpen?`has-calendar-open`:``}"></slot></div>${this.hideFooter?l:c`<div class="modal-footer ${this.getFooterClass()}">${this.isFooterCustom&&!this.showPrimaryButton&&!this.showSecondaryButton?c`<slot name="footer-custom"></slot> `:l} ${this.showSecondaryButton?c`<randstad-button variant="button-secondary" size="md" @click=${()=>this.dispatchEvent(new CustomEvent(`secondary-click`))} label=${this.secondaryButtonLabel} ></randstad-button>`:l} ${this.showPrimaryButton?c`<randstad-button variant="button-primary" size="md" @click=${()=>this.dispatchEvent(new CustomEvent(`primary-click`))} label=${this.primaryButtonLabel} .loader=${this.isPrimaryLoader} .disabled=${this.isPrimaryDisabled} ></randstad-button>`:l}</div>`}</div></div>`}};t([d({type:Boolean,reflect:!0}),e(`design:type`,Object)],p.prototype,`open`,void 0),t([d({type:String}),e(`design:type`,Object)],p.prototype,`title`,void 0),t([d({type:String}),e(`design:type`,String)],p.prototype,`subtitle`,void 0),t([d({type:Boolean}),e(`design:type`,Object)],p.prototype,`showNotice`,void 0),t([d({type:String}),e(`design:type`,String)],p.prototype,`noticeType`,void 0),t([d({type:String}),e(`design:type`,Object)],p.prototype,`noticeMessage`,void 0),t([d({type:String}),e(`design:type`,Object)],p.prototype,`noticeIcon`,void 0),t([d({type:Boolean}),e(`design:type`,Object)],p.prototype,`showPrimaryButton`,void 0),t([d({type:String}),e(`design:type`,Object)],p.prototype,`primaryButtonLabel`,void 0),t([d({type:Boolean}),e(`design:type`,Object)],p.prototype,`showSecondaryButton`,void 0),t([d({type:String}),e(`design:type`,Object)],p.prototype,`secondaryButtonLabel`,void 0),t([d({type:Boolean}),e(`design:type`,Object)],p.prototype,`isFooterCustom`,void 0),t([d({type:Boolean}),e(`design:type`,Object)],p.prototype,`isPrimaryLoader`,void 0),t([d({type:Boolean}),e(`design:type`,Object)],p.prototype,`isPrimaryDisabled`,void 0),t([d({type:String}),e(`design:type`,Object)],p.prototype,`modalWidth`,void 0),t([d({type:String}),e(`design:type`,Object)],p.prototype,`modalHeight`,void 0),t([d({type:String}),e(`design:type`,Object)],p.prototype,`maxHeight`,void 0),t([d({type:Boolean}),e(`design:type`,Object)],p.prototype,`hideFooter`,void 0),t([f(),e(`design:type`,Object)],p.prototype,`scrollable`,void 0),t([f(),e(`design:type`,Object)],p.prototype,`hasDropdownOpen`,void 0),t([f(),e(`design:type`,Object)],p.prototype,`hasCalendarOpen`,void 0),p=t([u(`custom-modal`)],p);export{p as CustomModal};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
2
|
import './Icon';
|
|
3
3
|
interface TabItem {
|
|
4
4
|
label: string;
|
|
@@ -8,17 +8,23 @@ interface TabItem {
|
|
|
8
8
|
export declare class TabsBar extends LitElement {
|
|
9
9
|
tabs: TabItem[];
|
|
10
10
|
selected: string;
|
|
11
|
+
ariaLabel: string;
|
|
12
|
+
activation: 'auto' | 'manual';
|
|
11
13
|
private internalSelected;
|
|
12
14
|
private showPrev;
|
|
13
15
|
private showNext;
|
|
16
|
+
private focusedIndex;
|
|
14
17
|
private readonly SCROLL_OFFSET;
|
|
15
18
|
static styles: import("lit").CSSResult;
|
|
16
19
|
firstUpdated(): void;
|
|
17
|
-
protected willUpdate(changed:
|
|
20
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
18
21
|
private selectTab;
|
|
19
22
|
private scrollTabsLeft;
|
|
20
23
|
private scrollTabsRight;
|
|
21
24
|
private handleScroll;
|
|
25
|
+
private moveFocus;
|
|
26
|
+
private focusTab;
|
|
27
|
+
private onTabKeydown;
|
|
22
28
|
render(): import("lit-html").TemplateResult<1>;
|
|
23
29
|
}
|
|
24
30
|
export {};
|
package/dist/components/Tabs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorateMetadata.js";import t from"../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";import"./Icon.js";import{bodyM as n,titleXXS 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,state as l}from"lit/decorators.js";let u=class extends i{constructor(...e){super(...e),this.tabs=[],this.selected=``,this.internalSelected=``,this.showPrev=!1,this.showNext=!1,this.SCROLL_OFFSET=56,this.handleScroll=()=>{let e=this.renderRoot.querySelector(`.tab-wrapper`);if(!e)return;let{scrollLeft:t,scrollWidth:n,clientWidth:r}=e;this.showPrev=t>0,this.showNext=t+r<n-1}}static{this.styles=a`:host{display:block;border-bottom:1px solid #E7E8EC;font-family:"Graphik",sans-serif}.tab-wrapper{display:flex;justify-content:flex-start}.tab{${r};display:flex;gap:8px;flex-direction:row;padding:24px;align-items:center;text-align:center;color:#6F758D;cursor:pointer;text-decoration:none;position:relative;flex:0 0 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:background-color 0.2s ease-in-out}.tab:hover{background-color:#E7E8EC}.tab.active{color:#2175D9}.tab.active::after{height:2px;background-color:#2175D9;content:'';position:absolute;bottom:0;left:0;width:100%;pointer-events:none}.tab.active randstad-icon{filter:brightness(0) saturate(100%) invert(28%) sepia(87%) saturate(3514%) hue-rotate(202deg) brightness(92%) contrast(101%)}.scroll-container{position:relative;display:flex;align-items:center;overflow:hidden}.tab-wrapper{display:flex;justify-content:flex-start;gap:0px;overflow-x:auto;scroll-behavior:smooth;scrollbar-width:none;-ms-overflow-style:none;flex:1}.tab-wrapper::-webkit-scrollbar{display:none}.scroll-button{border:none;font-size:24px;cursor:pointer;z-index:1;width:56px;height:100%;display:flex;align-items:center;color:#2175D9;padding:0px}.scroll-button.prev{justify-content:flex-start;position:absolute;left:0;background:linear-gradient(90deg,#FFFFFF 0%,#FFFFFF 50%,rgba(255,255,255,0) 100%)}.scroll-button.next{justify-content:flex-end;position:absolute;right:0;background:linear-gradient(270deg,#FFFFFF 0%,#FFFFFF 50%,rgba(255,255,255,0) 100%)}@media (max-width:940px){.tab{${n};padding:16px}}`}firstUpdated(){this.handleScroll()}willUpdate(e){e.has(`selected`)&&(this.internalSelected=this.selected)}selectTab(e){this.internalSelected=e;let t=this.tabs.find(t=>t.value===e);t&&this.dispatchEvent(new CustomEvent(`tab-change`,{detail:t,bubbles:!0,composed:!0}))}scrollTabsLeft(){let e=this.renderRoot.querySelector(`.tab-wrapper`);if(!e)return;let t=e.scrollLeft,n=Array.from(e.querySelectorAll(`.tab`));for(let r=n.length-1;r>=0;r--){let i=n[r].offsetLeft;if(i<t+this.SCROLL_OFFSET-1){let t=i-this.SCROLL_OFFSET;e.scrollTo({left:t,behavior:`smooth`});break}}setTimeout(()=>this.handleScroll(),300)}scrollTabsRight(){let e=this.renderRoot.querySelector(`.tab-wrapper`);if(!e)return;let t=e.scrollLeft,n=Array.from(e.querySelectorAll(`.tab`));for(let r of n)if(r.offsetLeft>t+this.SCROLL_OFFSET){let t=r.offsetLeft-this.SCROLL_OFFSET;e.scrollTo({left:t,behavior:`smooth`});break}setTimeout(()=>this.handleScroll(),300)}render(){return o`<div class="scroll-container">${this.showPrev?o`<button class="scroll-button prev" @click=${this.scrollTabsLeft}><randstad-icon name="arrow_left" size="36px"></randstad-icon></button>`:null}<div class="tab-wrapper" @scroll=${this.handleScroll}>${this.tabs.map(e=>o`<
|
|
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,titleXXS 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,state as l}from"lit/decorators.js";let u=class extends i{constructor(...e){super(...e),this.tabs=[],this.selected=``,this.ariaLabel=`Pestañas`,this.activation=`auto`,this.internalSelected=``,this.showPrev=!1,this.showNext=!1,this.focusedIndex=0,this.SCROLL_OFFSET=56,this.handleScroll=()=>{let e=this.renderRoot.querySelector(`.tab-wrapper`);if(!e)return;let{scrollLeft:t,scrollWidth:n,clientWidth:r}=e;this.showPrev=t>0,this.showNext=t+r<n-1}}static{this.styles=a`:host{display:block;border-bottom:1px solid #E7E8EC;font-family:"Graphik",sans-serif}.tab-wrapper{display:flex;justify-content:flex-start}.tab{${r};display:flex;gap:8px;flex-direction:row;padding:24px;align-items:center;text-align:center;color:#6F758D;cursor:pointer;text-decoration:none;position:relative;flex:0 0 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:background-color 0.2s ease-in-out;border:0;background:none}.tab:hover{background-color:#E7E8EC}.tab.active{color:#2175D9}.tab.active::after{height:2px;background-color:#2175D9;content:'';position:absolute;bottom:0;left:0;width:100%;pointer-events:none}.tab.active randstad-icon{filter:brightness(0) saturate(100%) invert(28%) sepia(87%) saturate(3514%) hue-rotate(202deg) brightness(92%) contrast(101%)}.scroll-container{position:relative;display:flex;align-items:center;overflow:hidden}.tab-wrapper{display:flex;justify-content:flex-start;gap:0px;overflow-x:auto;scroll-behavior:smooth;scrollbar-width:none;-ms-overflow-style:none;flex:1}.tab-wrapper::-webkit-scrollbar{display:none}.scroll-button{border:none;font-size:24px;cursor:pointer;z-index:1;width:56px;height:100%;display:flex;align-items:center;color:#2175D9;padding:0px}.scroll-button.prev{justify-content:flex-start;position:absolute;left:0;background:linear-gradient(90deg,#FFFFFF 0%,#FFFFFF 50%,rgba(255,255,255,0) 100%)}.scroll-button.next{justify-content:flex-end;position:absolute;right:0;background:linear-gradient(270deg,#FFFFFF 0%,#FFFFFF 50%,rgba(255,255,255,0) 100%)}@media (max-width:940px){.tab{${n};padding:16px}}`}firstUpdated(){this.handleScroll()}willUpdate(e){if(e.has(`selected`)||e.has(`tabs`)){e.has(`selected`)&&(this.internalSelected=this.selected),!this.internalSelected&&this.tabs.length>0&&(this.internalSelected=this.tabs[0].value);let t=this.tabs.findIndex(e=>e.value===this.internalSelected);t>=0&&(this.focusedIndex=t)}}selectTab(e){this.internalSelected=e;let t=this.tabs.find(t=>t.value===e);t&&this.dispatchEvent(new CustomEvent(`tab-change`,{detail:t,bubbles:!0,composed:!0}))}scrollTabsLeft(){let e=this.renderRoot.querySelector(`.tab-wrapper`);if(!e)return;let t=e.scrollLeft,n=Array.from(e.querySelectorAll(`.tab`));for(let r=n.length-1;r>=0;r--){let i=n[r].offsetLeft;if(i<t+this.SCROLL_OFFSET-1){let t=i-this.SCROLL_OFFSET;e.scrollTo({left:t,behavior:`smooth`});break}}setTimeout(()=>this.handleScroll(),300)}scrollTabsRight(){let e=this.renderRoot.querySelector(`.tab-wrapper`);if(!e)return;let t=e.scrollLeft,n=Array.from(e.querySelectorAll(`.tab`));for(let r of n)if(r.offsetLeft>t+this.SCROLL_OFFSET){let t=r.offsetLeft-this.SCROLL_OFFSET;e.scrollTo({left:t,behavior:`smooth`});break}setTimeout(()=>this.handleScroll(),300)}async moveFocus(e){this.tabs.length&&(this.focusedIndex=e,this.activation===`auto`&&this.selectTab(this.tabs[e].value),await this.updateComplete,this.focusTab(e))}focusTab(e){let t=this.renderRoot.querySelectorAll(`.tab`)[e];t&&(t.focus(),t.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`nearest`}))}onTabKeydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=this.tabs.length-1,n=this.focusedIndex,r={ArrowRight:n===t?0:n+1,ArrowLeft:n===0?t:n-1,Home:0,End:t};e.key in r?(e.preventDefault(),this.moveFocus(r[e.key])):this.activation===`manual`&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.selectTab(this.tabs[this.focusedIndex].value))}render(){return o`<div class="scroll-container">${this.showPrev?o`<button role="button" aria-label="Desplazar pestaña a la izquierda" class="scroll-button prev" @click=${this.scrollTabsLeft}><randstad-icon name="arrow_left" size="36px"></randstad-icon></button>`:null}<div role="tablist" aria-label=${this.ariaLabel} class="tab-wrapper" @keydown=${e=>this.onTabKeydown(e)} @scroll=${this.handleScroll}>${this.tabs.map((e,t)=>{let n=this.internalSelected===e.value,r=this.focusedIndex===t;return o`<button type="button" role="tab" id="tab-${t}" aria-selected="${n}" aria-label="${e.label}" aria-controls="panel-${t}" class="tab ${this.internalSelected===e.value?`active`:``}" tabindex="${n||r&&!this.internalSelected?`0`:`-1`}" @click=${()=>this.selectTab(e.value)} @focus=${()=>{this.focusedIndex=t}} ><randstad-icon name=${e.icon} size="24px"></randstad-icon><span>${e.label}</span></button>`})}</div>${this.showNext?o`<button role="button" aria-label="Desplazar pestaña a la derecha" class="scroll-button next" @click=${this.scrollTabsRight}><randstad-icon name="arrow_right" size="36px"></randstad-icon></button>`:null}</div>${this.tabs.map((e,t)=>{let n=this.internalSelected===e.value;return o`<div role="tab-panel" id="panel-${t}" aria-labellebdy="tab-${t}" tabindex="0" ?hidden=${!n}><slot name=${e.label}></slot></div>`})} `}};t([c({type:Array}),e(`design:type`,Array)],u.prototype,`tabs`,void 0),t([c({type:String}),e(`design:type`,String)],u.prototype,`selected`,void 0),t([c({type:String}),e(`design:type`,Object)],u.prototype,`ariaLabel`,void 0),t([c(),e(`design:type`,String)],u.prototype,`activation`,void 0),t([l(),e(`design:type`,String)],u.prototype,`internalSelected`,void 0),t([l(),e(`design:type`,Object)],u.prototype,`showPrev`,void 0),t([l(),e(`design:type`,Object)],u.prototype,`showNext`,void 0),t([l(),e(`design:type`,Object)],u.prototype,`focusedIndex`,void 0),u=t([s(`tabs-bar`)],u);export{u as TabsBar};
|
package/dist/package.json
CHANGED
|
@@ -1 +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)}: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")}
|