@randstad-uca/design-system 1.0.51 → 1.0.52
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/Button.d.ts +2 -2
- package/dist/components/FormGroup.d.ts +1 -1
- package/dist/components/Modal.d.ts +2 -0
- package/dist/index.js +76 -18
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/stories/FormGroup.stories.d.ts +2 -5
- package/dist/stories/Modal.stories.d.ts +3 -3
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import '../styles/buttons.css';
|
|
3
3
|
export declare class RandstadButton extends LitElement {
|
|
4
|
+
type: 'button' | 'submit' | 'reset';
|
|
4
5
|
variant: 'button-primary' | 'button-secondary' | 'button-tertiary' | 'button-round' | 'button-card' | 'button-icon';
|
|
5
6
|
size: 'md' | 'lg';
|
|
6
7
|
label: string;
|
|
7
8
|
loader: boolean;
|
|
8
9
|
iconSrc?: string;
|
|
9
10
|
iconPosition: 'left' | 'right';
|
|
10
|
-
disabled: boolean;
|
|
11
11
|
iconName: string | null;
|
|
12
|
-
|
|
12
|
+
disabled: boolean;
|
|
13
13
|
idevent: string;
|
|
14
14
|
static styles: import("lit").CSSResult;
|
|
15
15
|
private handleClick;
|
|
@@ -14,6 +14,8 @@ export declare class CustomModal extends LitElement {
|
|
|
14
14
|
showSecondaryButton: boolean;
|
|
15
15
|
secondaryButtonLabel: string;
|
|
16
16
|
isFooterCustom: boolean;
|
|
17
|
+
isPrimaryLoader: boolean;
|
|
18
|
+
isPrimaryDisabled: boolean;
|
|
17
19
|
modalWidth: string;
|
|
18
20
|
private scrollable;
|
|
19
21
|
static styles: import("lit").CSSResult;
|
package/dist/index.js
CHANGED
|
@@ -204,7 +204,7 @@ function A(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
204
204
|
flex-direction: column;
|
|
205
205
|
gap: 16px;
|
|
206
206
|
}
|
|
207
|
-
`}render(){return e`<slot></slot>`}};Y=a([d("accordion-list")],Y);let U=class extends t{constructor(){super(...arguments),this.variant="button-primary",this.size="md",this.label="",this.loader=!1,this.iconPosition="left",this.
|
|
207
|
+
`}render(){return e`<slot></slot>`}};Y=a([d("accordion-list")],Y);let U=class extends t{constructor(){super(...arguments),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=o`
|
|
208
208
|
:host {
|
|
209
209
|
display: inline-block;
|
|
210
210
|
}
|
|
@@ -216,11 +216,30 @@ function A(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
216
216
|
border-radius: 4px;
|
|
217
217
|
cursor: pointer;
|
|
218
218
|
font-weight: 400;
|
|
219
|
-
padding:
|
|
219
|
+
padding: 0;
|
|
220
220
|
border: none;
|
|
221
221
|
transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
|
|
222
222
|
gap: 4px;
|
|
223
223
|
width: 100%;
|
|
224
|
+
position: relative;
|
|
225
|
+
box-sizing: border-box;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.content-container {
|
|
229
|
+
display: flex;
|
|
230
|
+
align-items: center;
|
|
231
|
+
justify-content: center;
|
|
232
|
+
gap: 4px;
|
|
233
|
+
width: 100%;
|
|
234
|
+
padding: 16px;
|
|
235
|
+
height: 100%;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.content-container .label-text {
|
|
239
|
+
display: flex;
|
|
240
|
+
align-items: center;
|
|
241
|
+
justify-content: center;
|
|
242
|
+
height: 100%;
|
|
224
243
|
}
|
|
225
244
|
|
|
226
245
|
.button-lg {
|
|
@@ -369,15 +388,17 @@ function A(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
369
388
|
color: var(--secondary-color-60);
|
|
370
389
|
cursor: default;
|
|
371
390
|
}
|
|
372
|
-
|
|
391
|
+
|
|
373
392
|
/* Loader */
|
|
393
|
+
.loader, .label-text, .button-icon {
|
|
394
|
+
line-height: 1;
|
|
395
|
+
}
|
|
396
|
+
|
|
374
397
|
.loader {
|
|
375
398
|
display: flex;
|
|
376
|
-
gap: 8px;
|
|
377
|
-
justify-content: center;
|
|
378
399
|
align-items: center;
|
|
379
|
-
|
|
380
|
-
|
|
400
|
+
justify-content: center;
|
|
401
|
+
gap: 8px;
|
|
381
402
|
}
|
|
382
403
|
|
|
383
404
|
.dot {
|
|
@@ -419,6 +440,33 @@ function A(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
419
440
|
color: var(--white);
|
|
420
441
|
}
|
|
421
442
|
|
|
443
|
+
/* Estilos de sobrescritura para el estado de carga */
|
|
444
|
+
.button-primary.loader[disabled] {
|
|
445
|
+
background-color: var(--primary-color) !important;
|
|
446
|
+
color: var(--white) !important;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.button-secondary.loader[disabled] {
|
|
450
|
+
background-color: var(--primary-color) !important;
|
|
451
|
+
border-color: var(--primary-color) !important;
|
|
452
|
+
color: var(--white) !important;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.button-tertiary.loader[disabled] {
|
|
456
|
+
color: var(--primary-color) !important;
|
|
457
|
+
background-color: transparent !important;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.button-round.loader[disabled] {
|
|
461
|
+
background-color: var(--white) !important;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.button-icon.loader[disabled] {
|
|
465
|
+
color: var(--primary-color) !important;
|
|
466
|
+
background-color: transparent !important;
|
|
467
|
+
}
|
|
468
|
+
/* */
|
|
469
|
+
|
|
422
470
|
.button-card {
|
|
423
471
|
font-family: 'Graphik';
|
|
424
472
|
background-color: var(--primary-color);
|
|
@@ -458,24 +506,31 @@ function A(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
458
506
|
part="button"
|
|
459
507
|
type=${this.type}
|
|
460
508
|
class=${n(t)}
|
|
461
|
-
?disabled=${this.disabled}
|
|
509
|
+
?disabled=${this.disabled||this.loader}
|
|
462
510
|
?aria-busy=${this.loader}
|
|
463
511
|
@click=${this.handleClick}
|
|
464
512
|
>
|
|
465
513
|
${this.loader?e`
|
|
514
|
+
<div class="content-container">
|
|
466
515
|
<div class="loader">
|
|
467
516
|
<span class="dot" style="background-color: ${i};"></span>
|
|
468
517
|
<span class="dot" style="background-color: ${i};"></span>
|
|
469
518
|
<span class="dot" style="background-color: ${i};"></span>
|
|
470
519
|
</div>
|
|
520
|
+
</div>
|
|
471
521
|
`:e`
|
|
522
|
+
<div class="content-container">
|
|
472
523
|
${this.iconSrc&&"button-round"===this.variant?e`<img src=${this.iconSrc} alt="icon" class="button-icon" part="button-icon"/>`:""}
|
|
524
|
+
|
|
473
525
|
${this.iconName&&"button-round"!==this.variant&&"left"===this.iconPosition?e`<randstad-icon name=${this.iconName} size="24px"></randstad-icon>`:""}
|
|
474
|
-
|
|
526
|
+
|
|
527
|
+
${this.label?e`<span class="label-text" part="label">${this.label}</span>`:e`<slot></slot>`}
|
|
528
|
+
|
|
475
529
|
${this.iconName&&"button-round"!==this.variant&&"right"===this.iconPosition?e`<randstad-icon name=${this.iconName} size="24px"></randstad-icon>`:""}
|
|
476
|
-
|
|
530
|
+
</div>
|
|
531
|
+
`}
|
|
477
532
|
</button>
|
|
478
|
-
`}};a([T({type:String}),s("design:type",String)],U.prototype,"
|
|
533
|
+
`}};a([T({type:String}),s("design:type",String)],U.prototype,"type",void 0),a([T({type:String}),s("design:type",String)],U.prototype,"variant",void 0),a([T({type:String}),s("design:type",String)],U.prototype,"size",void 0),a([T({type:String}),s("design:type",Object)],U.prototype,"label",void 0),a([T({type:Boolean}),s("design:type",Object)],U.prototype,"loader",void 0),a([T({type:String,attribute:"icon-src"}),s("design:type",String)],U.prototype,"iconSrc",void 0),a([T({type:String}),s("design:type",String)],U.prototype,"iconPosition",void 0),a([T({type:String}),s("design:type",Object)],U.prototype,"iconName",void 0),a([T({type:Boolean,reflect:!0}),s("design:type",Boolean)],U.prototype,"disabled",void 0),a([T({type:String}),s("design:type",Object)],U.prototype,"idevent",void 0),U=a([d("randstad-button")],U);let H=class extends t{constructor(){super(...arguments),this.img="",this.name="",this.title="",this.description="",this.buttonLabel="Contactanos",this.cardId=""}static{this.styles=o`
|
|
479
534
|
:host {
|
|
480
535
|
display: inline-block;
|
|
481
536
|
font-family: "Graphik", sans-serif;
|
|
@@ -1042,12 +1097,14 @@ function A(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
1042
1097
|
|
|
1043
1098
|
${this.renderHelper()}
|
|
1044
1099
|
</div>
|
|
1045
|
-
`}};a([T({type:String}),s("design:type",String)],J.prototype,"size",void 0),a([T({type:String}),s("design:type",Object)],J.prototype,"icon",void 0),a([T({type:Boolean}),s("design:type",Boolean)],J.prototype,"typing",void 0),a([T({type:String}),s("design:type",String)],J.prototype,"type",void 0),a([T({type:String}),s("design:type",String)],J.prototype,"linkText",void 0),a([T({type:String}),s("design:type",String)],J.prototype,"linkRoute",void 0),a([T({type:Boolean,reflect:!0}),s("design:type",Object)],J.prototype,"isPasswordVisible",void 0),a([T({type:Boolean}),s("design:type",Boolean)],J.prototype,"cleanButton",void 0),a([T({type:Number}),s("design:type",Number)],J.prototype,"maxLength",void 0),a([T({type:String}),s("design:type",String)],J.prototype,"heightTextArea",void 0),a([T({type:String}),s("design:type",String)],J.prototype,"maxHeightTextArea",void 0),J=a([d("randstad-form")],J);let Z=class extends L{constructor(){super(...arguments),this.
|
|
1100
|
+
`}};a([T({type:String}),s("design:type",String)],J.prototype,"size",void 0),a([T({type:String}),s("design:type",Object)],J.prototype,"icon",void 0),a([T({type:Boolean}),s("design:type",Boolean)],J.prototype,"typing",void 0),a([T({type:String}),s("design:type",String)],J.prototype,"type",void 0),a([T({type:String}),s("design:type",String)],J.prototype,"linkText",void 0),a([T({type:String}),s("design:type",String)],J.prototype,"linkRoute",void 0),a([T({type:Boolean,reflect:!0}),s("design:type",Object)],J.prototype,"isPasswordVisible",void 0),a([T({type:Boolean}),s("design:type",Boolean)],J.prototype,"cleanButton",void 0),a([T({type:Number}),s("design:type",Number)],J.prototype,"maxLength",void 0),a([T({type:String}),s("design:type",String)],J.prototype,"heightTextArea",void 0),a([T({type:String}),s("design:type",String)],J.prototype,"maxHeightTextArea",void 0),J=a([d("randstad-form")],J);let Z=class extends L{constructor(){super(...arguments),this.rows=""}static{this.styles=o`
|
|
1046
1101
|
${X}
|
|
1047
1102
|
${Q}
|
|
1048
1103
|
${K}
|
|
1049
1104
|
|
|
1050
1105
|
:host {
|
|
1106
|
+
display: flex;
|
|
1107
|
+
flex-direction: column;
|
|
1051
1108
|
gap: 8px;
|
|
1052
1109
|
}
|
|
1053
1110
|
|
|
@@ -1059,10 +1116,9 @@ function A(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
1059
1116
|
}
|
|
1060
1117
|
|
|
1061
1118
|
.fields {
|
|
1062
|
-
|
|
1063
|
-
gap: 16px;
|
|
1119
|
+
gap: 8px;
|
|
1064
1120
|
}
|
|
1065
|
-
`}render(){const t
|
|
1121
|
+
`}render(){const t=this.rows?`display: grid; grid-template-columns: ${this.rows};`:"display: flex; flex-direction: column;";return e`
|
|
1066
1122
|
<div class="group-container">
|
|
1067
1123
|
${this.renderLabelContainer()}
|
|
1068
1124
|
|
|
@@ -1076,7 +1132,7 @@ function A(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
1076
1132
|
|
|
1077
1133
|
${this.renderHelper()}
|
|
1078
1134
|
</div>
|
|
1079
|
-
`}};a([T({type:String}),s("design:type",String)],Z.prototype,"
|
|
1135
|
+
`}};a([T({type:String}),s("design:type",String)],Z.prototype,"rows",void 0),Z=a([d("randstad-form-group")],Z);class tt extends t{constructor(){super(...arguments),this.name="",this.size="24px"}static{this.styles=o`
|
|
1080
1136
|
:host {
|
|
1081
1137
|
display: inline-flex;
|
|
1082
1138
|
width: var(--icon-size, 24px);
|
|
@@ -1143,7 +1199,7 @@ function A(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
1143
1199
|
<randstad-icon class="icon" name="${this.icon}" size="24px" style="color: var(--icon-color);"></randstad-icon>
|
|
1144
1200
|
<span class="message">${this.message}</span>
|
|
1145
1201
|
</div>
|
|
1146
|
-
`}};a([T({type:String}),s("design:type",String)],et.prototype,"type",void 0),a([T({type:String}),s("design:type",String)],et.prototype,"icon",void 0),a([T({type:String}),s("design:type",String)],et.prototype,"message",void 0),a([T({type:Boolean}),s("design:type",Boolean)],et.prototype,"open",void 0),et=a([d("randstad-notice")],et);let it=class extends t{constructor(){super(...arguments),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.modalWidth="500px",this.scrollable=!1,this.setScrollableMode=()=>{this.scrollable=window.innerWidth>940}}static{this.styles=o`
|
|
1202
|
+
`}};a([T({type:String}),s("design:type",String)],et.prototype,"type",void 0),a([T({type:String}),s("design:type",String)],et.prototype,"icon",void 0),a([T({type:String}),s("design:type",String)],et.prototype,"message",void 0),a([T({type:Boolean}),s("design:type",Boolean)],et.prototype,"open",void 0),et=a([d("randstad-notice")],et);let it=class extends t{constructor(){super(...arguments),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.scrollable=!1,this.setScrollableMode=()=>{this.scrollable=window.innerWidth>940}}static{this.styles=o`
|
|
1147
1203
|
:host {
|
|
1148
1204
|
font-family: 'Graphik', sans-serif;
|
|
1149
1205
|
display: none;
|
|
@@ -1336,13 +1392,15 @@ function A(t,e){return(e,i,o)=>((t,e,i)=>(i.configurable=!0,i.enumerable=!0,Refl
|
|
|
1336
1392
|
size="md"
|
|
1337
1393
|
@click=${()=>this.dispatchEvent(new CustomEvent("primary-click"))}
|
|
1338
1394
|
label=${this.primaryButtonLabel}
|
|
1395
|
+
.loader=${this.isPrimaryLoader}
|
|
1396
|
+
.disabled=${this.isPrimaryDisabled}
|
|
1339
1397
|
>
|
|
1340
1398
|
</randstad-button>
|
|
1341
1399
|
`:i}
|
|
1342
1400
|
</div>
|
|
1343
1401
|
</div>
|
|
1344
1402
|
</div>
|
|
1345
|
-
`}};a([T({type:Boolean,reflect:!0}),s("design:type",Object)],it.prototype,"open",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"title",void 0),a([T({type:String}),s("design:type",String)],it.prototype,"subtitle",void 0),a([T({type:Boolean}),s("design:type",Object)],it.prototype,"showNotice",void 0),a([T({type:String}),s("design:type",String)],it.prototype,"noticeType",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"noticeMessage",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"noticeIcon",void 0),a([T({type:Boolean}),s("design:type",Object)],it.prototype,"showPrimaryButton",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"primaryButtonLabel",void 0),a([T({type:Boolean}),s("design:type",Object)],it.prototype,"showSecondaryButton",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"secondaryButtonLabel",void 0),a([T({type:Boolean}),s("design:type",Object)],it.prototype,"isFooterCustom",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"modalWidth",void 0),a([z(),s("design:type",Object)],it.prototype,"scrollable",void 0),it=a([d("custom-modal")],it);let ot=class extends t{constructor(){super(...arguments),this.open=!1,this.type="default",this.icon="warning",this.title="Título del Popup",this.description="Descripción del popup",this.width="400px",this.buttonText="Aceptar",this.confirmText="Sí",this.cancelText="No",this.stackedActions=[],this._onBackgroundClick=t=>{const e=t.composedPath(),i=this.renderRoot.querySelector(".popup");i&&!e.includes(i)&&(this.dispatchEvent(new CustomEvent("popup-close",{detail:null})),this.open=!1)}}static{this.styles=o`
|
|
1403
|
+
`}};a([T({type:Boolean,reflect:!0}),s("design:type",Object)],it.prototype,"open",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"title",void 0),a([T({type:String}),s("design:type",String)],it.prototype,"subtitle",void 0),a([T({type:Boolean}),s("design:type",Object)],it.prototype,"showNotice",void 0),a([T({type:String}),s("design:type",String)],it.prototype,"noticeType",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"noticeMessage",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"noticeIcon",void 0),a([T({type:Boolean}),s("design:type",Object)],it.prototype,"showPrimaryButton",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"primaryButtonLabel",void 0),a([T({type:Boolean}),s("design:type",Object)],it.prototype,"showSecondaryButton",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"secondaryButtonLabel",void 0),a([T({type:Boolean}),s("design:type",Object)],it.prototype,"isFooterCustom",void 0),a([T({type:Boolean}),s("design:type",Object)],it.prototype,"isPrimaryLoader",void 0),a([T({type:Boolean}),s("design:type",Object)],it.prototype,"isPrimaryDisabled",void 0),a([T({type:String}),s("design:type",Object)],it.prototype,"modalWidth",void 0),a([z(),s("design:type",Object)],it.prototype,"scrollable",void 0),it=a([d("custom-modal")],it);let ot=class extends t{constructor(){super(...arguments),this.open=!1,this.type="default",this.icon="warning",this.title="Título del Popup",this.description="Descripción del popup",this.width="400px",this.buttonText="Aceptar",this.confirmText="Sí",this.cancelText="No",this.stackedActions=[],this._onBackgroundClick=t=>{const e=t.composedPath(),i=this.renderRoot.querySelector(".popup");i&&!e.includes(i)&&(this.dispatchEvent(new CustomEvent("popup-close",{detail:null})),this.open=!1)}}static{this.styles=o`
|
|
1346
1404
|
:host {
|
|
1347
1405
|
display: none;
|
|
1348
1406
|
position: fixed;
|