@randstad-uca/design-system 1.0.5 → 1.0.7
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.d.ts +1 -7
- package/dist/index.js +89 -75
- package/dist/index.js.map +1 -1
- package/dist/package.json +5 -3
- package/dist/stories/Modal.stories.d.ts +4 -17
- package/package.json +5 -3
- package/readme.md +15 -0
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
export declare class CustomModal extends LitElement {
|
|
3
3
|
open: boolean;
|
|
4
|
-
type: string;
|
|
5
4
|
title: string;
|
|
6
|
-
description: string;
|
|
7
|
-
width: string;
|
|
8
|
-
buttonText: string;
|
|
9
|
-
confirmText: string;
|
|
10
|
-
cancelText: string;
|
|
11
5
|
static styles: import("lit").CSSResult;
|
|
12
|
-
closeModal
|
|
6
|
+
private closeModal;
|
|
13
7
|
render(): import("lit-html").TemplateResult<1>;
|
|
14
8
|
}
|
package/dist/index.js
CHANGED
|
@@ -149,7 +149,7 @@ function N(t,e){return(e,o,i)=>((t,e,o)=>(o.configurable=!0,o.enumerable=!0,Refl
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
.button-round {
|
|
152
|
-
width: 48px;
|
|
152
|
+
width: 48px !important;
|
|
153
153
|
height: 48px;
|
|
154
154
|
border-radius: 50%;
|
|
155
155
|
background-color: var(--white);
|
|
@@ -221,7 +221,7 @@ function N(t,e){return(e,o,i)=>((t,e,o)=>(o.configurable=!0,o.enumerable=!0,Refl
|
|
|
221
221
|
border: none;
|
|
222
222
|
color: var(--white);
|
|
223
223
|
}
|
|
224
|
-
`}handleClick(t){this.disabled||this.dispatchEvent(new CustomEvent("button-click",{bubbles:!0,composed:!0}))}render(){const t=`button button-${this.size} ${this.variant} ${this.loader?"loader":""}`,e="button-tertiary"===this.variant?"#2175D9":"white";return o`
|
|
224
|
+
`}handleClick(t){this.disabled||this.dispatchEvent(new CustomEvent("button-click",{bubbles:!0,composed:!0}))}render(){const t=`button ${"button-round"===this.variant?"":`button-${this.size}`} ${this.variant} ${this.loader?"loader":""}`,e="button-tertiary"===this.variant?"#2175D9":"white";return o`
|
|
225
225
|
<button
|
|
226
226
|
type="button"
|
|
227
227
|
class=${t}
|
|
@@ -237,7 +237,7 @@ function N(t,e){return(e,o,i)=>((t,e,o)=>(o.configurable=!0,o.enumerable=!0,Refl
|
|
|
237
237
|
`:o`
|
|
238
238
|
${this.iconSrc&&"button-round"===this.variant?o`<img src=${this.iconSrc} alt="icon" class="button-icon" />`:""}
|
|
239
239
|
${this.iconName&&"button-round"!==this.variant&&"left"===this.iconPosition?o`<randstad-icon name=${this.iconName} size="24px"></randstad-icon>`:""}
|
|
240
|
-
|
|
240
|
+
<slot>${this.label}</slot>
|
|
241
241
|
${this.iconName&&"button-round"!==this.variant&&"right"===this.iconPosition?o`<randstad-icon name=${this.iconName} size="24px"></randstad-icon>`:""}
|
|
242
242
|
`}
|
|
243
243
|
</button>
|
|
@@ -253,7 +253,7 @@ function N(t,e){return(e,o,i)=>((t,e,o)=>(o.configurable=!0,o.enumerable=!0,Refl
|
|
|
253
253
|
gap: 8px;
|
|
254
254
|
font-family: Graphik, sans-serif;
|
|
255
255
|
font-size: 14px;
|
|
256
|
-
line-height:
|
|
256
|
+
line-height: 25px;
|
|
257
257
|
color: #0F1941;
|
|
258
258
|
}
|
|
259
259
|
|
|
@@ -294,7 +294,7 @@ function N(t,e){return(e,o,i)=>((t,e,o)=>(o.configurable=!0,o.enumerable=!0,Refl
|
|
|
294
294
|
|
|
295
295
|
.terms-link {
|
|
296
296
|
color: #2175D9;
|
|
297
|
-
text-decoration:
|
|
297
|
+
text-decoration: none;
|
|
298
298
|
cursor: pointer;
|
|
299
299
|
}
|
|
300
300
|
`}toggleCheck(t){this.checked=t.target.checked,this.dispatchEvent(new CustomEvent("change",{detail:{checked:this.checked},bubbles:!0,composed:!0}))}renderClause(t,e){return e?o`<a class="terms-link" href="${e}" target="_blank" rel="noopener" @click=${this.stopPropagation}>${t}</a>`:o`${t}`}stopPropagation(t){t.stopPropagation()}render(){return o`
|
|
@@ -308,7 +308,7 @@ function N(t,e){return(e,o,i)=>((t,e,o)=>(o.configurable=!0,o.enumerable=!0,Refl
|
|
|
308
308
|
${this.prefix}
|
|
309
309
|
${this.renderClause(this.clause1Text,this.clause1Url)},
|
|
310
310
|
${this.connector}
|
|
311
|
-
${this.renderClause(this.clause2Text,this.clause2Url)}
|
|
311
|
+
${this.renderClause(this.clause2Text,this.clause2Url)}
|
|
312
312
|
</span>
|
|
313
313
|
</label>
|
|
314
314
|
`}};n([I({type:String}),a("design:type",Object)],M.prototype,"prefix",void 0),n([I({type:String}),a("design:type",Object)],M.prototype,"clause1Text",void 0),n([I({type:String}),a("design:type",String)],M.prototype,"clause1Url",void 0),n([I({type:String}),a("design:type",Object)],M.prototype,"connector",void 0),n([I({type:String}),a("design:type",Object)],M.prototype,"clause2Text",void 0),n([I({type:String}),a("design:type",String)],M.prototype,"clause2Url",void 0),n([I({type:Boolean,reflect:!0}),a("design:type",Object)],M.prototype,"checked",void 0),M=n([l("randstad-checkbox")],M);
|
|
@@ -4041,7 +4041,7 @@ console.warn('WARNING: Since Vaadin 23.2, "@vaadin/vaadin-date-picker" is deprec
|
|
|
4041
4041
|
outline: none;
|
|
4042
4042
|
transition: border-color 0.3s ease, box-shadow 0.3s ease;
|
|
4043
4043
|
width: 100%;
|
|
4044
|
-
color: #0F1941;
|
|
4044
|
+
color: #0F1941 !important;
|
|
4045
4045
|
}
|
|
4046
4046
|
|
|
4047
4047
|
.form.error .form-input {
|
|
@@ -4161,7 +4161,7 @@ console.warn('WARNING: Since Vaadin 23.2, "@vaadin/vaadin-date-picker" is deprec
|
|
|
4161
4161
|
}
|
|
4162
4162
|
|
|
4163
4163
|
.link-text:hover {
|
|
4164
|
-
|
|
4164
|
+
text-decoration: underline;
|
|
4165
4165
|
}
|
|
4166
4166
|
|
|
4167
4167
|
.tooltip-wrapper randstad-icon {
|
|
@@ -4176,6 +4176,13 @@ console.warn('WARNING: Since Vaadin 23.2, "@vaadin/vaadin-date-picker" is deprec
|
|
|
4176
4176
|
.toggle-password randstad-icon svg {
|
|
4177
4177
|
fill: #2175D9 !important;
|
|
4178
4178
|
}
|
|
4179
|
+
|
|
4180
|
+
input:-webkit-autofill,
|
|
4181
|
+
textarea:-webkit-autofill {
|
|
4182
|
+
box-shadow: 0 0 0px 1000px white inset !important;
|
|
4183
|
+
-webkit-text-fill-color: #0F1941 !important;
|
|
4184
|
+
transition: background-color 5000s ease-in-out 0s;
|
|
4185
|
+
}
|
|
4179
4186
|
`}togglePassword(t){this.isPasswordVisible=!this.isPasswordVisible;const e=t.currentTarget.parentElement?.querySelector("input");e&&(e.type=this.isPasswordVisible?"text":"password"),this.requestUpdate()}handleInput(t){const e=t.target;this.value=e.value,this.dispatchEvent(new CustomEvent("valueChanged",{detail:this.value})),this.dispatchEvent(new Event("input",{bubbles:!0}))}handleLinkClick(t){t.preventDefault(),this.linkRoute&&this.dispatchEvent(new CustomEvent("linkClicked",{detail:this.linkRoute,bubbles:!0,composed:!0}))}render(){return o`
|
|
4180
4187
|
<div
|
|
4181
4188
|
class="form ${this.error?"error":""} ${this.success?"success":""} ${this.disabled?"disabled":""}"
|
|
@@ -4233,7 +4240,11 @@ console.warn('WARNING: Since Vaadin 23.2, "@vaadin/vaadin-date-picker" is deprec
|
|
|
4233
4240
|
${this.errorMessage?this.errorMessage:o`<slot name="error-extended"></slot>`}
|
|
4234
4241
|
</p>
|
|
4235
4242
|
`:r}
|
|
4236
|
-
${this.linkText&&this.linkRoute?o
|
|
4243
|
+
${this.linkText&&this.linkRoute?o`
|
|
4244
|
+
<div style="text-align: right;">
|
|
4245
|
+
<a class="link-text" href="#" @click=${this.handleLinkClick}>${this.linkText}</a>
|
|
4246
|
+
</div>
|
|
4247
|
+
`:r}
|
|
4237
4248
|
|
|
4238
4249
|
${this.helper?o`<p class="helper-description">${this.helper}</p>`:r}
|
|
4239
4250
|
</div>
|
|
@@ -4250,94 +4261,86 @@ console.warn('WARNING: Since Vaadin 23.2, "@vaadin/vaadin-date-picker" is deprec
|
|
|
4250
4261
|
height: var(--icon-size, 24px); /* Tamaño fijo basado en size */
|
|
4251
4262
|
fill: var(--icon-color, currentColor);
|
|
4252
4263
|
}
|
|
4253
|
-
`}constructor(){super(),this.name="",this.size="24px",this.color=""}connectedCallback(){super.connectedCallback(),this.name&&this.loadIcon()}updated(t){t.has("name")&&this.name&&this.loadIcon(),t.has("size")&&this.style.setProperty("--icon-size",this.size),t.has("color")&&this.style.setProperty("--icon-color",this.color)}async loadIcon(){if(this.name)try{const t=await fetch(`/assets/icons/${this.name}.svg`);if(!t.ok)throw new Error("Icon not found");const e=await t.text(),o=new DOMParser,i=o.parseFromString(e,"image/svg+xml").querySelector("svg");if(!i)throw new Error("No se encontró un elemento SVG válido");i.removeAttribute("fill"),i.setAttribute("width",this.size||"24px"),i.setAttribute("height",this.size||"24px"),this.renderRoot.innerHTML="",this.renderRoot.appendChild(i)}catch(t){console.error(`❌ Error cargando icono ${this.name}:`,t),this.renderRoot.innerHTML="<span>⚠️</span>"}else this.renderRoot.innerHTML=""}render(){return null}}n([I({type:String}),a("design:type",String)],Cs.prototype,"name",void 0),n([I({type:String}),a("design:type",String)],Cs.prototype,"size",void 0),n([I({type:String}),a("design:type",String)],Cs.prototype,"color",void 0),customElements.define("randstad-icon",Cs);let ks=class extends t{constructor(){super(...arguments),this.open=!1,this.
|
|
4264
|
+
`}constructor(){super(),this.name="",this.size="24px",this.color=""}connectedCallback(){super.connectedCallback(),this.name&&this.loadIcon()}updated(t){t.has("name")&&this.name&&this.loadIcon(),t.has("size")&&this.style.setProperty("--icon-size",this.size),t.has("color")&&this.style.setProperty("--icon-color",this.color)}async loadIcon(){if(this.name)try{const t=await fetch(`/assets/icons/${this.name}.svg`);if(!t.ok)throw new Error("Icon not found");const e=await t.text(),o=new DOMParser,i=o.parseFromString(e,"image/svg+xml").querySelector("svg");if(!i)throw new Error("No se encontró un elemento SVG válido");i.removeAttribute("fill"),i.setAttribute("width",this.size||"24px"),i.setAttribute("height",this.size||"24px"),this.renderRoot.innerHTML="",this.renderRoot.appendChild(i)}catch(t){console.error(`❌ Error cargando icono ${this.name}:`,t),this.renderRoot.innerHTML="<span>⚠️</span>"}else this.renderRoot.innerHTML=""}render(){return null}}n([I({type:String}),a("design:type",String)],Cs.prototype,"name",void 0),n([I({type:String}),a("design:type",String)],Cs.prototype,"size",void 0),n([I({type:String}),a("design:type",String)],Cs.prototype,"color",void 0),customElements.define("randstad-icon",Cs);let ks=class extends t{constructor(){super(...arguments),this.open=!1,this.title="Título del modal"}static{this.styles=e`
|
|
4254
4265
|
:host {
|
|
4255
4266
|
display: none;
|
|
4256
4267
|
position: fixed;
|
|
4257
4268
|
z-index: 9999;
|
|
4258
4269
|
top: 0;
|
|
4259
4270
|
left: 0;
|
|
4260
|
-
width:
|
|
4261
|
-
height:
|
|
4271
|
+
width: 100vw;
|
|
4272
|
+
height: 100vh;
|
|
4262
4273
|
background: rgba(0, 0, 0, 0.5);
|
|
4263
4274
|
justify-content: center;
|
|
4264
4275
|
align-items: center;
|
|
4265
4276
|
font-family: "Graphik", sans-serif;
|
|
4266
4277
|
}
|
|
4278
|
+
|
|
4267
4279
|
:host([open]) {
|
|
4268
4280
|
display: flex;
|
|
4269
4281
|
}
|
|
4282
|
+
|
|
4270
4283
|
.modal {
|
|
4271
|
-
background:
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
box-shadow:
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4284
|
+
background: #f7f5f0;
|
|
4285
|
+
width: 90%;
|
|
4286
|
+
max-width: 500px;
|
|
4287
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
4288
|
+
display: flex;
|
|
4289
|
+
flex-direction: column;
|
|
4290
|
+
position: relative;
|
|
4278
4291
|
}
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4292
|
+
|
|
4293
|
+
.modal-header {
|
|
4294
|
+
display: flex;
|
|
4295
|
+
justify-content: space-between;
|
|
4296
|
+
align-items: center;
|
|
4297
|
+
padding: 25px;
|
|
4298
|
+
border-bottom: 1px solid #E0E0E0;
|
|
4282
4299
|
}
|
|
4283
|
-
|
|
4300
|
+
|
|
4301
|
+
h3 {
|
|
4302
|
+
margin: 0;
|
|
4284
4303
|
font-family: Graphik;
|
|
4285
4304
|
font-weight: 400;
|
|
4286
4305
|
font-size: 20px;
|
|
4287
|
-
line-height:
|
|
4288
|
-
|
|
4289
|
-
text-align: center;
|
|
4290
|
-
color: #404767;
|
|
4291
|
-
}
|
|
4292
|
-
p {
|
|
4293
|
-
font-family: Graphik;
|
|
4294
|
-
font-weight: 400;
|
|
4295
|
-
font-size: 16px;
|
|
4296
|
-
line-height: 17.6px;
|
|
4297
|
-
letter-spacing: 0%;
|
|
4298
|
-
text-align: center;
|
|
4299
|
-
color: #6F758D;
|
|
4300
|
-
}
|
|
4301
|
-
.buttons {
|
|
4302
|
-
margin-top: 12px;
|
|
4303
|
-
display: flex;
|
|
4304
|
-
justify-content: space-around;
|
|
4305
|
-
gap: 10px;
|
|
4306
|
+
line-height: 30px;
|
|
4307
|
+
color: #0F1941;
|
|
4306
4308
|
}
|
|
4307
|
-
|
|
4309
|
+
|
|
4310
|
+
.modal-close {
|
|
4311
|
+
background: none;
|
|
4308
4312
|
border: none;
|
|
4309
4313
|
cursor: pointer;
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
height: 57;
|
|
4315
|
-
border-radius: 4px;
|
|
4316
|
-
padding: 16px;
|
|
4317
|
-
font-family: Graphik;
|
|
4314
|
+
display: flex;
|
|
4315
|
+
align-items: center;
|
|
4316
|
+
justify-content: center;
|
|
4317
|
+
padding: 0;
|
|
4318
4318
|
}
|
|
4319
|
-
|
|
4320
|
-
.
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
<
|
|
4332
|
-
<
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4319
|
+
|
|
4320
|
+
.modal-body {
|
|
4321
|
+
flex: 1;
|
|
4322
|
+
}
|
|
4323
|
+
|
|
4324
|
+
.modal-footer {
|
|
4325
|
+
display: flex;
|
|
4326
|
+
justify-content: flex-end;
|
|
4327
|
+
}
|
|
4328
|
+
`}closeModal(){this.dispatchEvent(new CustomEvent("modal-close",{detail:null})),this.open=!1}render(){return o`
|
|
4329
|
+
<div class="modal">
|
|
4330
|
+
<div class="modal-header">
|
|
4331
|
+
<h3>${this.title}</h3>
|
|
4332
|
+
<button class="modal-close" @click="${this.closeModal}" aria-label="Cerrar modal">
|
|
4333
|
+
<randstad-icon name="close" size="24px"></randstad-icon>
|
|
4334
|
+
</button>
|
|
4335
|
+
</div>
|
|
4336
|
+
<div class="modal-body">
|
|
4337
|
+
<slot name="content"></slot>
|
|
4338
|
+
</div>
|
|
4339
|
+
<div class="modal-footer">
|
|
4340
|
+
<slot name="confirm-button"></slot>
|
|
4341
|
+
</div>
|
|
4339
4342
|
</div>
|
|
4340
|
-
`}};n([I({type:Boolean,reflect:!0}),a("design:type",Object)],ks.prototype,"open",void 0),n([I({type:String}),a("design:type",Object)],ks.prototype,"
|
|
4343
|
+
`}};n([I({type:Boolean,reflect:!0}),a("design:type",Object)],ks.prototype,"open",void 0),n([I({type:String}),a("design:type",Object)],ks.prototype,"title",void 0),ks=n([l("custom-modal")],ks);class As extends t{static{this.styles=e`
|
|
4341
4344
|
:host {
|
|
4342
4345
|
display: block;
|
|
4343
4346
|
border-radius: 4px;
|
|
@@ -4345,7 +4348,6 @@ console.warn('WARNING: Since Vaadin 23.2, "@vaadin/vaadin-date-picker" is deprec
|
|
|
4345
4348
|
line-height: 25px;
|
|
4346
4349
|
font-weight: 400;
|
|
4347
4350
|
color: white;
|
|
4348
|
-
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
|
|
4349
4351
|
font-family: 'Graphik', sans-serif;
|
|
4350
4352
|
}
|
|
4351
4353
|
.container {
|
|
@@ -4853,6 +4855,7 @@ const ha=e`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
4853
4855
|
background: white;
|
|
4854
4856
|
cursor: pointer;
|
|
4855
4857
|
transition: background-color 0.3s ease;
|
|
4858
|
+
color: #0F1941 !important;
|
|
4856
4859
|
}
|
|
4857
4860
|
|
|
4858
4861
|
.input-container:hover .filter-input {
|
|
@@ -5152,8 +5155,8 @@ const ha=e`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
5152
5155
|
align-items: center;
|
|
5153
5156
|
box-sizing: border-box;
|
|
5154
5157
|
min-height: 48px;
|
|
5155
|
-
min-width:
|
|
5156
|
-
max-width:
|
|
5158
|
+
min-width: 380px;
|
|
5159
|
+
max-width: 380px;
|
|
5157
5160
|
border-radius: 4px;
|
|
5158
5161
|
padding: 8px;
|
|
5159
5162
|
gap: 8px;
|
|
@@ -5207,6 +5210,17 @@ const ha=e`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20p
|
|
|
5207
5210
|
.informative {
|
|
5208
5211
|
background-color: var(--ui-informative);
|
|
5209
5212
|
}
|
|
5213
|
+
|
|
5214
|
+
@media (max-width: 940px) {
|
|
5215
|
+
:host {
|
|
5216
|
+
bottom: 16px !important;
|
|
5217
|
+
left: 50% !important;
|
|
5218
|
+
right: auto !important;
|
|
5219
|
+
top: auto !important;
|
|
5220
|
+
transform: translateX(-50%) !important;
|
|
5221
|
+
justify-content: center !important;
|
|
5222
|
+
}
|
|
5223
|
+
}
|
|
5210
5224
|
`]}constructor(){super(),this.type="informative",this.icon="info",this.message="Este es un mensaje.",this.open=!1,this.position="bottom-center"}static get properties(){return{type:{type:String},icon:{type:String},message:{type:String},open:{type:Boolean},position:{type:String,reflect:!0}}}render(){const t="error"===this.type||"warning"===this.type?"alert":"status";return o`
|
|
5211
5225
|
<div
|
|
5212
5226
|
class="container ${this.open?"":"hidden"} ${this.type}"
|