@descope/web-components-ui 1.0.53 → 1.0.55

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/index.esm.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import '@vaadin/button';
2
+ import '@vaadin/checkbox';
2
3
  import '@vaadin/text-field';
3
- import '@vaadin/number-field';
4
+ import '@vaadin/date-picker';
4
5
  import '@vaadin/email-field';
6
+ import '@vaadin/number-field';
5
7
  import '@vaadin/password-field';
6
8
  import '@vaadin/text-area';
7
- import '@vaadin/date-picker';
8
- import '@vaadin/checkbox';
9
9
  import merge from 'lodash.merge';
10
10
  import set from 'lodash.set';
11
11
  import Color from 'color';
@@ -249,6 +249,30 @@ const draggableMixin = (superclass) =>
249
249
 
250
250
  class DescopeBaseClass extends HTMLElement {}
251
251
 
252
+ const hoverableMixin =
253
+ (relativeSelector = '') =>
254
+ (superclass) =>
255
+ class HovrerableMixinClass extends superclass {
256
+ connectedCallback() {
257
+ super.connectedCallback?.();
258
+
259
+ const onMouseOver = (e) => {
260
+ this.shadowRoot.host.setAttribute('hover', 'true');
261
+ e.target.addEventListener(
262
+ 'mouseleave',
263
+ () => this.shadowRoot.host.removeAttribute('hover'),
264
+ { once: true }
265
+ );
266
+ };
267
+
268
+ const baseElement = this.shadowRoot.querySelector(
269
+ this.baseSelector + relativeSelector
270
+ );
271
+
272
+ baseElement.addEventListener('mouseover', onMouseOver);
273
+ }
274
+ };
275
+
252
276
  const observeAttributes = (
253
277
  ele,
254
278
  callback,
@@ -270,7 +294,7 @@ const observeAttributes = (
270
294
  if (
271
295
  mutation.type === 'attributes' &&
272
296
  !excludeAttrs.includes(mutation.attributeName) &&
273
- (!includeAttrs.length || includeAttrs.includes(attr.name))
297
+ (!includeAttrs.length || includeAttrs.includes(mutation.attributeName))
274
298
  ) {
275
299
  callback([mutation.attributeName]);
276
300
  }
@@ -281,16 +305,17 @@ const observeAttributes = (
281
305
  };
282
306
 
283
307
  const createSyncAttrsCb =
284
- (srcEle, targetEle) =>
308
+ (srcEle, targetEle, mapAttrs = {}) =>
285
309
  (...attrNames) => {
286
310
  attrNames.forEach((attrName) => {
311
+ const targetAttrName = mapAttrs[attrName] || attrName;
287
312
  const srcAttrVal = srcEle.getAttribute(attrName);
288
313
  if (srcAttrVal !== null) {
289
- if (targetEle.getAttribute(attrName) !== srcAttrVal) {
290
- targetEle.setAttribute(attrName, srcAttrVal);
314
+ if (targetEle.getAttribute(targetAttrName) !== srcAttrVal) {
315
+ targetEle.setAttribute(targetAttrName, srcAttrVal);
291
316
  }
292
317
  } else {
293
- targetEle.removeAttribute(attrName);
318
+ targetEle.removeAttribute(targetAttrName);
294
319
  }
295
320
  });
296
321
  };
@@ -300,8 +325,12 @@ const syncAttrs = (ele1, ele2, options) => {
300
325
  observeAttributes(ele2, createSyncAttrsCb(ele2, ele1), options);
301
326
  };
302
327
 
303
- const forwardAttrs = (source, dest, options) => {
304
- observeAttributes(source, createSyncAttrsCb(source, dest), options);
328
+ const forwardAttrs = (source, dest, options = {}) => {
329
+ observeAttributes(
330
+ source,
331
+ createSyncAttrsCb(source, dest, options.mapAttrs),
332
+ options
333
+ );
305
334
  };
306
335
 
307
336
  const createProxy = ({
@@ -354,19 +383,9 @@ const createProxy = ({
354
383
  }
355
384
  };
356
385
 
357
- this.mouseoverCbRef = () => {
358
- this.proxyElement.setAttribute('hover', '');
359
- this.proxyElement.addEventListener(
360
- 'mouseleave',
361
- () => this.proxyElement.removeAttribute('hover'),
362
- { once: true }
363
- );
364
- };
365
-
366
- this.proxyElement.addEventListener('mouseover', this.mouseoverCbRef);
367
-
368
386
  // sync events
369
- this.addEventListener = (...args) => this.proxyElement.addEventListener(...args);
387
+ this.addEventListener = (...args) =>
388
+ this.proxyElement.addEventListener(...args);
370
389
 
371
390
  syncAttrs(this.proxyElement, this.hostElement, {
372
391
  excludeAttrs: excludeAttrsSync
@@ -385,7 +404,7 @@ const createProxy = ({
385
404
  }
386
405
  }
387
406
 
388
- return ProxyElement;
407
+ return compose(hoverableMixin())(ProxyElement);
389
408
  };
390
409
 
391
410
  const attrs = {
@@ -516,7 +535,7 @@ const compose =
516
535
  (val) =>
517
536
  fns.reduceRight((res, fn) => fn(res), val);
518
537
 
519
- const componentName$f = getComponentName('button');
538
+ const componentName$g = getComponentName('button');
520
539
 
521
540
  const editorOverrides = `vaadin-button::part(label) { pointer-events: none; }`;
522
541
  const resetStyles = `
@@ -539,7 +558,7 @@ const iconStyles = `
539
558
  }
540
559
  `;
541
560
 
542
- const selectors$3 = {
561
+ const selectors$4 = {
543
562
  label: '::part(label)'
544
563
  };
545
564
 
@@ -548,7 +567,7 @@ const Button = compose(
548
567
  mappings: {
549
568
  backgroundColor: {},
550
569
  borderRadius: {},
551
- color: { selector: selectors$3.label },
570
+ color: { selector: selectors$4.label },
552
571
  borderColor: {},
553
572
  borderStyle: {},
554
573
  borderWidth: {},
@@ -556,8 +575,8 @@ const Button = compose(
556
575
  height: {},
557
576
  width: matchHostStyle(),
558
577
  cursor: {},
559
- padding: [{ selector: selectors$3.label }],
560
- textDecoration: { selector: selectors$3.label }
578
+ padding: [{ selector: selectors$4.label }],
579
+ textDecoration: { selector: selectors$4.label }
561
580
  }
562
581
  }),
563
582
  draggableMixin,
@@ -569,7 +588,7 @@ const Button = compose(
569
588
  style: () =>
570
589
  `${resetStyles} ${editorOverrides} ${iconStyles} ${loadingIndicatorStyles}`,
571
590
  excludeAttrsSync: ['tabindex'],
572
- componentName: componentName$f
591
+ componentName: componentName$g
573
592
  })
574
593
  );
575
594
 
@@ -602,9 +621,37 @@ const loadingIndicatorStyles = `
602
621
  }
603
622
  `;
604
623
 
605
- customElements.define(componentName$f, Button);
624
+ customElements.define(componentName$g, Button);
606
625
 
607
- const selectors$2 = {
626
+ const componentName$f = getComponentName('checkbox');
627
+
628
+ const Checkbox = compose(
629
+ createStyleMixin({
630
+ mappings: {
631
+ width: matchHostStyle(),
632
+ cursor: [{}, { selector: '> label' }]
633
+ }
634
+ }),
635
+ draggableMixin,
636
+ inputMixin,
637
+ componentNameValidationMixin
638
+ )(
639
+ createProxy({
640
+ slots: [],
641
+ wrappedEleName: 'vaadin-checkbox',
642
+ style: `
643
+ :host {
644
+ display: inline-block;
645
+ }
646
+ `,
647
+ excludeAttrsSync: ['tabindex'],
648
+ componentName: componentName$f
649
+ })
650
+ );
651
+
652
+ customElements.define(componentName$f, Checkbox);
653
+
654
+ const selectors$3 = {
608
655
  label: '::part(label)',
609
656
  input: '::part(input-field)',
610
657
  readOnlyInput: '[readonly]::part(input-field)::after',
@@ -612,31 +659,31 @@ const selectors$2 = {
612
659
  };
613
660
 
614
661
  var textFieldMappings = {
615
- color: { selector: selectors$2.input },
616
- backgroundColor: { selector: selectors$2.input },
617
- color: { selector: selectors$2.input },
662
+ color: { selector: selectors$3.input },
663
+ backgroundColor: { selector: selectors$3.input },
664
+ color: { selector: selectors$3.input },
618
665
  width: matchHostStyle({}),
619
666
  borderColor: [
620
- { selector: selectors$2.input },
621
- { selector: selectors$2.readOnlyInput }
667
+ { selector: selectors$3.input },
668
+ { selector: selectors$3.readOnlyInput }
622
669
  ],
623
670
  borderWidth: [
624
- { selector: selectors$2.input },
625
- { selector: selectors$2.readOnlyInput }
671
+ { selector: selectors$3.input },
672
+ { selector: selectors$3.readOnlyInput }
626
673
  ],
627
674
  borderStyle: [
628
- { selector: selectors$2.input },
629
- { selector: selectors$2.readOnlyInput }
675
+ { selector: selectors$3.input },
676
+ { selector: selectors$3.readOnlyInput }
630
677
  ],
631
- borderRadius: { selector: selectors$2.input },
632
- boxShadow: { selector: selectors$2.input },
678
+ borderRadius: { selector: selectors$3.input },
679
+ boxShadow: { selector: selectors$3.input },
633
680
  fontSize: {},
634
- height: { selector: selectors$2.input },
635
- padding: { selector: selectors$2.input },
636
- outline: { selector: selectors$2.input },
637
- outlineOffset: { selector: selectors$2.input },
681
+ height: { selector: selectors$3.input },
682
+ padding: { selector: selectors$3.input },
683
+ outline: { selector: selectors$3.input },
684
+ outlineOffset: { selector: selectors$3.input },
638
685
 
639
- placeholderColor: { selector: selectors$2.placeholder, property: 'color' }
686
+ placeholderColor: { selector: selectors$3.placeholder, property: 'color' }
640
687
  };
641
688
 
642
689
  const componentName$e = getComponentName('text-field');
@@ -724,390 +771,83 @@ class Combo extends DescopeBaseClass {
724
771
 
725
772
  customElements.define(componentName$d, Combo);
726
773
 
727
- const componentName$c = getComponentName('number-field');
774
+ const componentName$c = getComponentName('container');
728
775
 
729
- let overrides$5 = ``;
776
+ class RawContainer extends DescopeBaseClass {
777
+ static get componentName() {
778
+ return componentName$c;
779
+ }
780
+ constructor() {
781
+ super();
782
+ const template = document.createElement('template');
783
+ template.innerHTML = `
784
+ <style>
785
+ :host > slot {
786
+ box-sizing: border-box;
787
+ }
788
+ </style>
789
+ <slot></slot>
790
+ `;
730
791
 
731
- const NumberField = compose(
792
+ this.attachShadow({ mode: 'open' });
793
+ this.shadowRoot.appendChild(template.content.cloneNode(true));
794
+
795
+ this.baseSelector = ':host > slot';
796
+ }
797
+ }
798
+
799
+ const Container = compose(
732
800
  createStyleMixin({
733
801
  mappings: {
734
- ...textFieldMappings
735
- }
736
- }),
737
- draggableMixin,
738
- inputMixin,
739
- componentNameValidationMixin
740
- )(
741
- createProxy({
742
- slots: ['prefix', 'suffix'],
743
- wrappedEleName: 'vaadin-number-field',
744
- style: () => overrides$5,
745
- excludeAttrsSync: ['tabindex'],
746
- componentName: componentName$c
747
- })
748
- );
802
+ height: matchHostStyle(),
803
+ width: matchHostStyle(),
749
804
 
750
- overrides$5 = `
751
- :host {
752
- display: inline-block;
753
- }
754
- vaadin-number-field {
755
- margin: 0;
756
- padding: 0;
757
- }
758
- vaadin-number-field::part(input-field) {
759
- overflow: hidden;
760
- }
761
- vaadin-number-field[readonly] > input:placeholder-shown {
762
- opacity: 1;
763
- }
764
- vaadin-number-field input:-webkit-autofill,
765
- vaadin-number-field input:-webkit-autofill::first-line,
766
- vaadin-number-field input:-webkit-autofill:hover,
767
- vaadin-number-field input:-webkit-autofill:active,
768
- vaadin-number-field input:-webkit-autofill:focus {
769
- -webkit-text-fill-color: var(${NumberField.cssVarList.color});
770
- box-shadow: 0 0 0 var(${NumberField.cssVarList.height}) var(${NumberField.cssVarList.backgroundColor}) inset;
771
- }
772
- vaadin-number-field > label,
773
- vaadin-number-field::part(input-field) {
774
- cursor: pointer;
775
- color: var(${NumberField.cssVarList.color});
776
- }
777
- vaadin-number-field::part(input-field):focus {
778
- cursor: text;
779
- }
780
- vaadin-number-field[required]::part(required-indicator)::after {
781
- font-size: "12px";
782
- content: "*";
783
- color: var(${NumberField.cssVarList.color});
784
- }
785
- vaadin-number-field[readonly]::part(input-field)::after {
786
- border: 0 solid;
787
- }
788
- `;
805
+ verticalPadding: [
806
+ { property: 'padding-top' },
807
+ { property: 'padding-bottom' }
808
+ ],
809
+ horizontalPadding: [
810
+ { property: 'padding-left' },
811
+ { property: 'padding-right' }
812
+ ],
789
813
 
790
- customElements.define(componentName$c, NumberField);
814
+ display: {}, // maybe this should be hardcoded to flex
815
+ flexDirection: {},
816
+ justifyContent: {},
817
+ alignItems: {},
818
+ gap: {},
791
819
 
792
- const componentName$b = getComponentName('email-field');
820
+ backgroundColor: {},
821
+ borderRadius: {},
793
822
 
794
- let overrides$4 = ``;
823
+ borderColor: {},
824
+ borderStyle: {},
825
+ borderWidth: {},
795
826
 
796
- const EmailField = compose(
797
- createStyleMixin({
798
- mappings: {
799
- ...textFieldMappings
827
+ boxShadow: {}
800
828
  }
801
829
  }),
802
830
  draggableMixin,
803
- inputMixin,
804
831
  componentNameValidationMixin
805
- )(
806
- createProxy({
807
- slots: ['suffix'],
808
- wrappedEleName: 'vaadin-email-field',
809
- style: () => overrides$4,
810
- excludeAttrsSync: ['tabindex'],
811
- componentName: componentName$b
812
- })
813
- );
814
-
815
- overrides$4 = `
816
- :host {
817
- display: inline-block;
818
- }
819
- vaadin-email-field {
820
- margin: 0;
821
- padding: 0;
822
- }
823
- vaadin-email-field::part(input-field) {
824
- overflow: hidden;
825
- }
826
- vaadin-email-field[readonly] > input:placeholder-shown {
827
- opacity: 1;
828
- }
829
- vaadin-email-field input:-webkit-autofill,
830
- vaadin-email-field input:-webkit-autofill::first-line,
831
- vaadin-email-field input:-webkit-autofill:hover,
832
- vaadin-email-field input:-webkit-autofill:active,
833
- vaadin-email-field input:-webkit-autofill:focus {
834
- -webkit-text-fill-color: var(${EmailField.cssVarList.color});
835
- box-shadow: 0 0 0 var(${EmailField.cssVarList.height}) var(${EmailField.cssVarList.backgroundColor}) inset;
836
- }
837
- vaadin-email-field > label,
838
- vaadin-email-field::part(input-field) {
839
- cursor: pointer;
840
- color: var(${EmailField.cssVarList.color});
841
- }
842
- vaadin-email-field::part(input-field):focus {
843
- cursor: text;
844
- }
845
- vaadin-email-field[required]::part(required-indicator)::after {
846
- font-size: "12px";
847
- content: "*";
848
- color: var(${EmailField.cssVarList.color});
849
- }
850
- vaadin-email-field[readonly]::part(input-field)::after {
851
- border: 0 solid;
852
- }
853
- `;
854
-
855
- customElements.define(componentName$b, EmailField);
832
+ )(RawContainer);
856
833
 
857
- const componentName$a = getComponentName('password-field');
834
+ customElements.define(componentName$c, Container);
858
835
 
859
- let overrides$3 = ``;
836
+ const componentName$b = getComponentName('date-picker');
860
837
 
861
- const PasswordField = compose(
862
- createStyleMixin({
863
- mappings: {
864
- ...textFieldMappings,
865
- revealCursor: [
866
- {
867
- selector: '::part(reveal-button)::before',
868
- property: 'cursor'
869
- }
870
- ]
871
- }
872
- }),
838
+ const DatePicker = compose(
873
839
  draggableMixin,
874
- inputMixin,
875
840
  componentNameValidationMixin
876
841
  )(
877
842
  createProxy({
878
- slots: ['suffix'],
879
- wrappedEleName: 'vaadin-password-field',
880
- style: () => overrides$3,
881
- excludeAttrsSync: ['tabindex'],
882
- componentName: componentName$a
843
+ componentName: componentName$b,
844
+ slots: ['prefix', 'suffix'],
845
+ wrappedEleName: 'vaadin-date-picker',
846
+ style: ``
883
847
  })
884
848
  );
885
849
 
886
- overrides$3 = `
887
- :host {
888
- display: inline-block;
889
- }
890
- vaadin-password-field {
891
- margin: 0;
892
- padding: 0;
893
- }
894
- vaadin-password-field::part(input-field) {
895
- overflow: hidden;
896
- }
897
- vaadin-password-field[readonly] > input:placeholder-shown {
898
- opacity: 1;
899
- }
900
- vaadin-password-field input:-webkit-autofill,
901
- vaadin-password-field input:-webkit-autofill::first-line,
902
- vaadin-password-field input:-webkit-autofill:hover,
903
- vaadin-password-field input:-webkit-autofill:active,
904
- vaadin-password-field input:-webkit-autofill:focus {
905
- -webkit-text-fill-color: var(${PasswordField.cssVarList.color});
906
- box-shadow: 0 0 0 var(${PasswordField.cssVarList.height}) var(${PasswordField.cssVarList.backgroundColor}) inset;
907
- }
908
- vaadin-password-field > label,
909
- vaadin-password-field::part(input-field) {
910
- cursor: pointer;
911
- color: var(${PasswordField.cssVarList.color});
912
- }
913
- vaadin-password-field::part(input-field):focus {
914
- cursor: text;
915
- }
916
- vaadin-password-field[required]::part(required-indicator)::after {
917
- font-size: "12px";
918
- content: "*";
919
- color: var(${PasswordField.cssVarList.color});
920
- }
921
- vaadin-password-field[readonly]::part(input-field)::after {
922
- border: 0 solid;
923
- }
924
- `;
925
-
926
- customElements.define(componentName$a, PasswordField);
927
-
928
- const componentName$9 = getComponentName('text-area');
929
-
930
- const selectors$1 = {
931
- label: '::part(label)',
932
- input: '::part(input-field)',
933
- required: '::part(required-indicator)::after'
934
- };
935
-
936
- let overrides$2 = ``;
937
-
938
- const TextArea = compose(
939
- createStyleMixin({
940
- mappings: {
941
- resize: { selector: '> textarea' },
942
- color: { selector: selectors$1.label },
943
- cursor: {},
944
- width: matchHostStyle(),
945
- backgroundColor: { selector: selectors$1.input },
946
- borderWidth: { selector: selectors$1.input },
947
- borderStyle: { selector: selectors$1.input },
948
- borderColor: { selector: selectors$1.input },
949
- borderRadius: { selector: selectors$1.input },
950
- outline: { selector: selectors$1.input },
951
- outlineOffset: { selector: selectors$1.input }
952
- }
953
- }),
954
- draggableMixin,
955
- inputMixin,
956
- componentNameValidationMixin
957
- )(
958
- createProxy({
959
- slots: [],
960
- wrappedEleName: 'vaadin-text-area',
961
- style: () => overrides$2,
962
- excludeAttrsSync: ['tabindex'],
963
- componentName: componentName$9
964
- })
965
- );
966
-
967
- overrides$2 = `
968
- :host {
969
- display: inline-block;
970
- }
971
-
972
- vaadin-text-area {
973
- margin: 0;
974
- }
975
- vaadin-text-area > label,
976
- vaadin-text-area::part(input-field) {
977
- cursor: pointer;
978
- }
979
- vaadin-text-area[focused]::part(input-field) {
980
- cursor: text;
981
- }
982
- vaadin-text-area::part(required-indicator)::after {
983
- font-size: "12px";
984
- content: "*";
985
- }
986
- `;
987
-
988
- customElements.define(componentName$9, TextArea);
989
-
990
- const componentName$8 = getComponentName('date-picker');
991
-
992
- const DatePicker = compose(
993
- draggableMixin,
994
- componentNameValidationMixin
995
- )(
996
- createProxy({
997
- componentName: componentName$8,
998
- slots: ['prefix', 'suffix'],
999
- wrappedEleName: 'vaadin-date-picker',
1000
- style: ``
1001
- })
1002
- );
1003
-
1004
- customElements.define(componentName$8, DatePicker);
1005
-
1006
- const componentName$7 = getComponentName('container');
1007
-
1008
- class RawContainer extends DescopeBaseClass {
1009
- static get componentName() {
1010
- return componentName$7;
1011
- }
1012
- constructor() {
1013
- super();
1014
- const template = document.createElement('template');
1015
- template.innerHTML = `
1016
- <style>
1017
- :host > slot {
1018
- box-sizing: border-box;
1019
- }
1020
- </style>
1021
- <slot></slot>
1022
- `;
1023
-
1024
- this.attachShadow({ mode: 'open' });
1025
- this.shadowRoot.appendChild(template.content.cloneNode(true));
1026
-
1027
- this.baseSelector = ':host > slot';
1028
- }
1029
- }
1030
-
1031
- const Container = compose(
1032
- createStyleMixin({
1033
- mappings: {
1034
- height: matchHostStyle(),
1035
- width: matchHostStyle(),
1036
-
1037
- verticalPadding: [
1038
- { property: 'padding-top' },
1039
- { property: 'padding-bottom' }
1040
- ],
1041
- horizontalPadding: [
1042
- { property: 'padding-left' },
1043
- { property: 'padding-right' }
1044
- ],
1045
-
1046
- display: {}, // maybe this should be hardcoded to flex
1047
- flexDirection: {},
1048
- justifyContent: {},
1049
- alignItems: {},
1050
- gap: {},
1051
-
1052
- backgroundColor: {},
1053
- borderRadius: {},
1054
-
1055
- borderColor: {},
1056
- borderStyle: {},
1057
- borderWidth: {},
1058
-
1059
- boxShadow: {}
1060
- }
1061
- }),
1062
- draggableMixin,
1063
- componentNameValidationMixin
1064
- )(RawContainer);
1065
-
1066
- customElements.define(componentName$7, Container);
1067
-
1068
- const componentName$6 = getComponentName('text');
1069
-
1070
- class RawText extends DescopeBaseClass {
1071
- static get componentName() {
1072
- return componentName$6;
1073
- }
1074
- constructor() {
1075
- super();
1076
- const template = document.createElement('template');
1077
- template.innerHTML = `<slot></slot>`;
1078
-
1079
- this.attachShadow({ mode: 'open' });
1080
- this.shadowRoot.appendChild(template.content.cloneNode(true));
1081
-
1082
- this.baseSelector = ':host > slot';
1083
- }
1084
- }
1085
-
1086
- const Text = compose(
1087
- createStyleMixin({
1088
- mappings: {
1089
- fontFamily: {},
1090
- lineHeight: {},
1091
- fontStyle: {},
1092
- fontSize: {},
1093
- fontWeight: {},
1094
- width: {},
1095
- color: {},
1096
- letterSpacing: {},
1097
- textShadow: {},
1098
- borderWidth: {},
1099
- borderStyle: {},
1100
- borderColor: {},
1101
- textTransform: {},
1102
- textAlign: matchHostStyle(),
1103
- display: matchHostStyle()
1104
- }
1105
- }),
1106
- draggableMixin,
1107
- componentNameValidationMixin
1108
- )(RawText);
1109
-
1110
- customElements.define(componentName$6, Text);
850
+ customElements.define(componentName$b, DatePicker);
1111
851
 
1112
852
  const getChildObserver = (callback) => {
1113
853
  return new MutationObserver((mutationsList) => {
@@ -1203,10 +943,10 @@ const enforceNestingElementsStylesMixin =
1203
943
  };
1204
944
  };
1205
945
 
1206
- const componentName$5 = getComponentName('divider');
946
+ const componentName$a = getComponentName('divider');
1207
947
  class RawDivider extends DescopeBaseClass {
1208
948
  static get componentName() {
1209
- return componentName$5;
949
+ return componentName$a;
1210
950
  }
1211
951
  constructor() {
1212
952
  super();
@@ -1240,14 +980,14 @@ class RawDivider extends DescopeBaseClass {
1240
980
  }
1241
981
  }
1242
982
 
1243
- const selectors = {
983
+ const selectors$2 = {
1244
984
  root: { selector: '' },
1245
985
  before: { selector: '::before' },
1246
986
  after: { selector: '::after' },
1247
987
  slotted: { selector: () => '::slotted(*)' }
1248
988
  };
1249
989
 
1250
- const { root, before, after, slotted } = selectors;
990
+ const { root, before, after, slotted } = selectors$2;
1251
991
 
1252
992
  const Divider = compose(
1253
993
  enforceNestingElementsStylesMixin({
@@ -1276,65 +1016,60 @@ const Divider = compose(
1276
1016
  componentNameValidationMixin
1277
1017
  )(RawDivider);
1278
1018
 
1279
- customElements.define(componentName$5, Divider);
1280
-
1281
- const componentName$4 = getComponentName('logo');
1282
-
1283
- let style;
1284
- const getStyle = () => style;
1019
+ const componentName$9 = getComponentName('text');
1285
1020
 
1286
- class RawLogo extends DescopeBaseClass {
1021
+ class RawText extends DescopeBaseClass {
1287
1022
  static get componentName() {
1288
- return componentName$4;
1023
+ return componentName$9;
1289
1024
  }
1290
1025
  constructor() {
1291
1026
  super();
1292
1027
  const template = document.createElement('template');
1293
- template.innerHTML = `
1294
- <style>
1295
- ${getStyle()}
1296
- </style>
1297
- <div></div>`;
1028
+ template.innerHTML = `<slot></slot>`;
1298
1029
 
1299
1030
  this.attachShadow({ mode: 'open' });
1300
1031
  this.shadowRoot.appendChild(template.content.cloneNode(true));
1301
1032
 
1302
- this.baseSelector = ':host > div';
1033
+ this.baseSelector = ':host > slot';
1303
1034
  }
1304
1035
  }
1305
1036
 
1306
- const Logo = compose(
1037
+ const Text = compose(
1307
1038
  createStyleMixin({
1308
1039
  mappings: {
1309
- height: {},
1040
+ fontFamily: {},
1041
+ lineHeight: {},
1042
+ fontStyle: {},
1043
+ fontSize: {},
1044
+ fontWeight: {},
1310
1045
  width: {},
1311
- url: {},
1312
- fallbackUrl: {}
1046
+ color: {},
1047
+ letterSpacing: {},
1048
+ textShadow: {},
1049
+ borderWidth: {},
1050
+ borderStyle: {},
1051
+ borderColor: {},
1052
+ textTransform: {},
1053
+ textAlign: matchHostStyle(),
1054
+ display: matchHostStyle()
1313
1055
  }
1314
1056
  }),
1315
1057
  draggableMixin,
1316
1058
  componentNameValidationMixin
1317
- )(RawLogo);
1059
+ )(RawText);
1318
1060
 
1319
- style = `
1320
- :host {
1321
- display: inline-block;
1322
- }
1323
- :host > div {
1324
- display: inline-block;
1325
- content: var(${Logo.cssVarList.url}, var(${Logo.cssVarList.fallbackUrl}));
1326
- }
1327
- `;
1061
+ customElements.define(componentName$9, Text);
1328
1062
 
1329
- customElements.define(componentName$4, Logo);
1063
+ customElements.define(componentName$a, Divider);
1330
1064
 
1331
- const componentName$3 = getComponentName('checkbox');
1065
+ const componentName$8 = getComponentName('email-field');
1332
1066
 
1333
- const Checkbox = compose(
1067
+ let overrides$5 = ``;
1068
+
1069
+ const EmailField = compose(
1334
1070
  createStyleMixin({
1335
1071
  mappings: {
1336
- width: matchHostStyle(),
1337
- cursor: [{}, { selector: '> label' }]
1072
+ ...textFieldMappings
1338
1073
  }
1339
1074
  }),
1340
1075
  draggableMixin,
@@ -1342,19 +1077,809 @@ const Checkbox = compose(
1342
1077
  componentNameValidationMixin
1343
1078
  )(
1344
1079
  createProxy({
1345
- slots: [],
1346
- wrappedEleName: 'vaadin-checkbox',
1347
- style: `
1348
- :host {
1349
- display: inline-block;
1350
- }
1351
- `,
1080
+ slots: ['suffix'],
1081
+ wrappedEleName: 'vaadin-email-field',
1082
+ style: () => overrides$5,
1352
1083
  excludeAttrsSync: ['tabindex'],
1353
- componentName: componentName$3
1084
+ componentName: componentName$8
1354
1085
  })
1355
1086
  );
1356
1087
 
1357
- customElements.define(componentName$3, Checkbox);
1088
+ overrides$5 = `
1089
+ :host {
1090
+ display: inline-block;
1091
+ }
1092
+ vaadin-email-field {
1093
+ margin: 0;
1094
+ padding: 0;
1095
+ }
1096
+ vaadin-email-field::part(input-field) {
1097
+ overflow: hidden;
1098
+ }
1099
+ vaadin-email-field[readonly] > input:placeholder-shown {
1100
+ opacity: 1;
1101
+ }
1102
+ vaadin-email-field input:-webkit-autofill,
1103
+ vaadin-email-field input:-webkit-autofill::first-line,
1104
+ vaadin-email-field input:-webkit-autofill:hover,
1105
+ vaadin-email-field input:-webkit-autofill:active,
1106
+ vaadin-email-field input:-webkit-autofill:focus {
1107
+ -webkit-text-fill-color: var(${EmailField.cssVarList.color});
1108
+ box-shadow: 0 0 0 var(${EmailField.cssVarList.height}) var(${EmailField.cssVarList.backgroundColor}) inset;
1109
+ }
1110
+ vaadin-email-field > label,
1111
+ vaadin-email-field::part(input-field) {
1112
+ cursor: pointer;
1113
+ color: var(${EmailField.cssVarList.color});
1114
+ }
1115
+ vaadin-email-field::part(input-field):focus {
1116
+ cursor: text;
1117
+ }
1118
+ vaadin-email-field[required]::part(required-indicator)::after {
1119
+ font-size: "12px";
1120
+ content: "*";
1121
+ color: var(${EmailField.cssVarList.color});
1122
+ }
1123
+ vaadin-email-field[readonly]::part(input-field)::after {
1124
+ border: 0 solid;
1125
+ }
1126
+ `;
1127
+
1128
+ customElements.define(componentName$8, EmailField);
1129
+
1130
+ const componentName$7 = getComponentName('link');
1131
+ class RawLink extends DescopeBaseClass {
1132
+ static get componentName() {
1133
+ return componentName$7;
1134
+ }
1135
+ constructor() {
1136
+ super();
1137
+ const template = document.createElement('template');
1138
+
1139
+ template.innerHTML = `
1140
+ <style>
1141
+ :host {
1142
+ display: inline-block;
1143
+ }
1144
+ :host a {
1145
+ display: inline-block;
1146
+ }
1147
+ </style>
1148
+ <div>
1149
+ <a>
1150
+ <slot name="text"></slot>
1151
+ </a>
1152
+ </div>
1153
+ `;
1154
+
1155
+ this.attachShadow({ mode: 'open' });
1156
+ this.shadowRoot.appendChild(template.content.cloneNode(true));
1157
+
1158
+ forwardAttrs(this.shadowRoot.host, this.shadowRoot.querySelector('a'), {
1159
+ includeAttrs: ['href', 'target', 'tooltip'],
1160
+ mapAttrs: {
1161
+ tooltip: 'title'
1162
+ }
1163
+ });
1164
+
1165
+ this.baseSelector = ':host > div';
1166
+ }
1167
+ }
1168
+
1169
+ const selectors$1 = {
1170
+ anchor: { selector: '> a' }
1171
+ };
1172
+
1173
+ const { anchor } = selectors$1;
1174
+
1175
+ const Link = compose(
1176
+ enforceNestingElementsStylesMixin({
1177
+ nestingElementTagName: 'descope-text',
1178
+ nestingElementDestSlotName: 'text',
1179
+ forwardAttrOptions: {
1180
+ includeAttrs: ['variant', 'italic', 'uppercase', 'lowercase']
1181
+ }
1182
+ }),
1183
+ createStyleMixin({
1184
+ mappings: {
1185
+ width: matchHostStyle(),
1186
+ textAlign: {},
1187
+ color: anchor,
1188
+ cursor: anchor,
1189
+ borderBottomWidth: anchor,
1190
+ borderBottomStyle: anchor,
1191
+ borderBottomColor: anchor
1192
+ },
1193
+ nestedMappings: {
1194
+ color: {
1195
+ selector: ` ${Text.componentName}`,
1196
+ property: Text.cssVarList.color
1197
+ }
1198
+ }
1199
+ }),
1200
+ hoverableMixin(anchor.selector),
1201
+ draggableMixin,
1202
+ componentNameValidationMixin
1203
+ )(RawLink);
1204
+
1205
+ customElements.define(componentName$7, Link);
1206
+
1207
+ const componentName$6 = getComponentName('logo');
1208
+
1209
+ let style;
1210
+ const getStyle = () => style;
1211
+
1212
+ class RawLogo extends DescopeBaseClass {
1213
+ static get componentName() {
1214
+ return componentName$6;
1215
+ }
1216
+ constructor() {
1217
+ super();
1218
+ const template = document.createElement('template');
1219
+ template.innerHTML = `
1220
+ <style>
1221
+ ${getStyle()}
1222
+ </style>
1223
+ <div></div>`;
1224
+
1225
+ this.attachShadow({ mode: 'open' });
1226
+ this.shadowRoot.appendChild(template.content.cloneNode(true));
1227
+
1228
+ this.baseSelector = ':host > div';
1229
+ }
1230
+ }
1231
+
1232
+ const Logo = compose(
1233
+ createStyleMixin({
1234
+ mappings: {
1235
+ height: {},
1236
+ width: {},
1237
+ url: {},
1238
+ fallbackUrl: {}
1239
+ }
1240
+ }),
1241
+ draggableMixin,
1242
+ componentNameValidationMixin
1243
+ )(RawLogo);
1244
+
1245
+ style = `
1246
+ :host {
1247
+ display: inline-block;
1248
+ }
1249
+ :host > div {
1250
+ display: inline-block;
1251
+ content: var(${Logo.cssVarList.url}, var(${Logo.cssVarList.fallbackUrl}));
1252
+ }
1253
+ `;
1254
+
1255
+ customElements.define(componentName$6, Logo);
1256
+
1257
+ const componentName$5 = getComponentName('number-field');
1258
+
1259
+ let overrides$4 = ``;
1260
+
1261
+ const NumberField = compose(
1262
+ createStyleMixin({
1263
+ mappings: {
1264
+ ...textFieldMappings
1265
+ }
1266
+ }),
1267
+ draggableMixin,
1268
+ inputMixin,
1269
+ componentNameValidationMixin
1270
+ )(
1271
+ createProxy({
1272
+ slots: ['prefix', 'suffix'],
1273
+ wrappedEleName: 'vaadin-number-field',
1274
+ style: () => overrides$4,
1275
+ excludeAttrsSync: ['tabindex'],
1276
+ componentName: componentName$5
1277
+ })
1278
+ );
1279
+
1280
+ overrides$4 = `
1281
+ :host {
1282
+ display: inline-block;
1283
+ }
1284
+ vaadin-number-field {
1285
+ margin: 0;
1286
+ padding: 0;
1287
+ }
1288
+ vaadin-number-field::part(input-field) {
1289
+ overflow: hidden;
1290
+ }
1291
+ vaadin-number-field[readonly] > input:placeholder-shown {
1292
+ opacity: 1;
1293
+ }
1294
+ vaadin-number-field input:-webkit-autofill,
1295
+ vaadin-number-field input:-webkit-autofill::first-line,
1296
+ vaadin-number-field input:-webkit-autofill:hover,
1297
+ vaadin-number-field input:-webkit-autofill:active,
1298
+ vaadin-number-field input:-webkit-autofill:focus {
1299
+ -webkit-text-fill-color: var(${NumberField.cssVarList.color});
1300
+ box-shadow: 0 0 0 var(${NumberField.cssVarList.height}) var(${NumberField.cssVarList.backgroundColor}) inset;
1301
+ }
1302
+ vaadin-number-field > label,
1303
+ vaadin-number-field::part(input-field) {
1304
+ cursor: pointer;
1305
+ color: var(${NumberField.cssVarList.color});
1306
+ }
1307
+ vaadin-number-field::part(input-field):focus {
1308
+ cursor: text;
1309
+ }
1310
+ vaadin-number-field[required]::part(required-indicator)::after {
1311
+ font-size: "12px";
1312
+ content: "*";
1313
+ color: var(${NumberField.cssVarList.color});
1314
+ }
1315
+ vaadin-number-field[readonly]::part(input-field)::after {
1316
+ border: 0 solid;
1317
+ }
1318
+ `;
1319
+
1320
+ customElements.define(componentName$5, NumberField);
1321
+
1322
+ const focusElement = (ele) => {
1323
+ ele?.focus();
1324
+ ele?.setSelectionRange(1, 1);
1325
+ };
1326
+
1327
+ const getSanitizedCharacters = (str) => {
1328
+ const pin = str.replace(/\s/g, ''); // sanitize string
1329
+
1330
+ // accept only numbers
1331
+ if (!pin.match(/^\d+$/)) return [];
1332
+
1333
+ return [...pin]; // creating array of chars
1334
+ };
1335
+
1336
+ const componentName$4 = getComponentName('passcode-internal');
1337
+
1338
+ class PasscodeInternal extends HTMLElement {
1339
+ static get observedAttributes() {
1340
+ return [
1341
+ 'disabled',
1342
+ 'bordered',
1343
+ 'size'
1344
+ ];
1345
+ }
1346
+
1347
+ static get componentName() {
1348
+ return componentName$4;
1349
+ }
1350
+
1351
+ static get formAssociated() {
1352
+ return true;
1353
+ }
1354
+
1355
+ #internals
1356
+
1357
+ constructor() {
1358
+ super();
1359
+ const template = document.createElement('template');
1360
+
1361
+ const inputs = [...Array(this.digits).keys()].map((idx) => `
1362
+ <descope-text-field
1363
+ st-width="35px"
1364
+ data-id=${idx}
1365
+ type="tel"
1366
+ autocomplete="none"
1367
+ ></descope-text-field>
1368
+ `);
1369
+
1370
+ template.innerHTML = `
1371
+ <div>
1372
+ ${inputs.join('')}
1373
+ </div>
1374
+ `;
1375
+
1376
+ this.appendChild(template.content.cloneNode(true));
1377
+
1378
+ this.baseSelector = ':host > div';
1379
+
1380
+ this.#internals = this.attachInternals();
1381
+
1382
+ this.inputs = Array.from(this.querySelectorAll('descope-text-field'));
1383
+ }
1384
+
1385
+ checkValidity() {
1386
+ // we need to toggle the has-error-message so the text inside the digits will become red when there is an error
1387
+ if (this.#internals.validity.valid) {
1388
+ this.inputs.forEach(input => input.removeAttribute('has-error-message'));
1389
+ } else {
1390
+ this.inputs.forEach(input => input.setAttribute('has-error-message', 'true'));
1391
+ // we need to call it so the has-error-message with have the correct format (="true")
1392
+ this.oninvalid?.();
1393
+ }
1394
+ return this.#internals.validity.valid
1395
+ }
1396
+
1397
+ get digits() {
1398
+ return Number.parseInt(this.getAttribute('digits')) || 6
1399
+ }
1400
+
1401
+ get value() {
1402
+ return this.inputs.map(({ value }) => value).join('')
1403
+ }
1404
+
1405
+ set value(val) { }
1406
+
1407
+ get isRequired() {
1408
+ return this.hasAttribute('required') && this.getAttribute('required') !== 'false'
1409
+ }
1410
+
1411
+ get pattern() {
1412
+ return `^$|^\\d{${this.digits},}$`
1413
+ }
1414
+
1415
+ get valueMissingErrMsg() {
1416
+ return 'Please fill out this field.'
1417
+ }
1418
+
1419
+ get patternMismatchErrMsg() {
1420
+ return `Must be a ${this.digits} digits number.`
1421
+ }
1422
+
1423
+ get validity() {
1424
+ return this.#internals.validity;
1425
+ }
1426
+
1427
+ get validationMessage() {
1428
+ return this.#internals.validationMessage;
1429
+ }
1430
+
1431
+ reportValidity() {
1432
+ this.#internals.reportValidity();
1433
+ }
1434
+
1435
+ formAssociatedCallback() {
1436
+ this.setValidity?.();
1437
+ }
1438
+
1439
+ setValidity = () => {
1440
+ if (this.isRequired && !this.value) {
1441
+ this.#internals.setValidity({ valueMissing: true }, this.valueMissingErrMsg);
1442
+ }
1443
+ else if (this.pattern && !new RegExp(this.pattern).test(this.value)) {
1444
+ this.#internals.setValidity({ patternMismatch: true }, this.patternMismatchErrMsg);
1445
+ }
1446
+ else {
1447
+ this.#internals.setValidity({});
1448
+ }
1449
+ };
1450
+
1451
+ async connectedCallback() {
1452
+ this.setValidity();
1453
+ this.initInputs();
1454
+
1455
+ this.onfocus = () => {
1456
+ this.inputs[0].focus();
1457
+ };
1458
+ }
1459
+
1460
+ getInputIdx(inputEle) {
1461
+ return Number.parseInt(inputEle.getAttribute('data-id'), 10)
1462
+ }
1463
+
1464
+ getNextInput(currInput) {
1465
+ const currentIdx = this.getInputIdx(currInput);
1466
+ const newIdx = Math.min(currentIdx + 1, this.inputs.length - 1);
1467
+ return this.inputs[newIdx]
1468
+ }
1469
+
1470
+ getPrevInput(currInput) {
1471
+ const currentIdx = this.getInputIdx(currInput);
1472
+ const newIdx = Math.max(currentIdx - 1, 0);
1473
+ return this.inputs[newIdx]
1474
+ }
1475
+
1476
+ fillDigits(charArr, currentInput) {
1477
+ for (let i = 0; i < charArr.length; i += 1) {
1478
+ currentInput.value = charArr[i] ?? '';
1479
+
1480
+ const nextInput = this.getNextInput(currentInput);
1481
+ if (nextInput === currentInput) break;
1482
+ currentInput = nextInput;
1483
+ }
1484
+
1485
+ !currentInput.hasAttribute('focused') && focusElement(currentInput);
1486
+ };
1487
+
1488
+ initInputs() {
1489
+ this.inputs.forEach((input) => {
1490
+
1491
+ // in order to simulate blur on the input
1492
+ // we are checking if focus on one of the digits happened immediately after blur on another digit
1493
+ // if not, the component is no longer focused and we should simulate blur
1494
+ input.addEventListener('blur', () => {
1495
+ const timerId = setTimeout(() => {
1496
+ this.dispatchEvent(new Event('blur'));
1497
+ });
1498
+
1499
+ this.inputs.forEach((ele) =>
1500
+ ele.addEventListener('focus', () => clearTimeout(timerId), { once: true })
1501
+ );
1502
+ });
1503
+
1504
+ input.oninput = (e) => {
1505
+ const charArr = getSanitizedCharacters(input.value);
1506
+
1507
+ if (!charArr.length) input.value = ''; // if we got an invalid value we want to clear the input
1508
+ else this.fillDigits(charArr, input);
1509
+
1510
+ this.setValidity();
1511
+ };
1512
+
1513
+ input.onkeydown = ({ key }) => {
1514
+ if (key === 'Backspace') {
1515
+ input.value = '';
1516
+
1517
+ // if the user deleted the digit we want to focus the previous digit
1518
+ const prevInput = this.getPrevInput(input);
1519
+
1520
+ !prevInput.hasAttribute('focused') && setTimeout(() => {
1521
+ focusElement(prevInput);
1522
+ });
1523
+ } else if (key.match(/^(\d)$/g)) { // if input is a digit
1524
+ input.value = ''; // we are clearing the previous value so we can override it with the new value
1525
+ }
1526
+
1527
+ this.setValidity();
1528
+ };
1529
+ });
1530
+ }
1531
+
1532
+ attributeChangedCallback(
1533
+ attrName,
1534
+ oldValue,
1535
+ newValue
1536
+ ) {
1537
+ if (oldValue !== newValue &&
1538
+ PasscodeInternal.observedAttributes.includes(attrName)) {
1539
+ this.inputs.forEach((input) => input.setAttribute(attrName, newValue));
1540
+ }
1541
+ }
1542
+ }
1543
+
1544
+ const componentName$3 = getComponentName('passcode');
1545
+
1546
+ const customMixin = (superclass) =>
1547
+ class DraggableMixinClass extends superclass {
1548
+ constructor() {
1549
+ super();
1550
+ }
1551
+
1552
+ get digits() {
1553
+ return Number.parseInt(this.getAttribute('digits')) || 6
1554
+ }
1555
+
1556
+ connectedCallback() {
1557
+ super.connectedCallback?.();
1558
+ const template = document.createElement('template');
1559
+
1560
+ //forward required & pattern TODO use forwardAttrs
1561
+ template.innerHTML = `
1562
+ <${componentName$4}
1563
+ bordered="true"
1564
+ name="code"
1565
+ tabindex="0"
1566
+ slot="input"
1567
+ required="${this.shadowRoot.host.getAttribute('required')}"
1568
+ pattern="${this.shadowRoot.host.getAttribute('pattern')}"
1569
+ ></${componentName$4}>
1570
+ `;
1571
+
1572
+ // we are adding a slot under vaadin-text-field, it should reflect all descope-passcode children to be under vaadin-text-field, this is why it has a name & slot
1573
+ const slotEle = Object.assign(document.createElement('slot'), { name: 'input', slot: 'input', part: 'input' });
1574
+ this.proxyElement.appendChild(slotEle);
1575
+
1576
+ // we want to control when the element is out of focus
1577
+ // so the validations will be triggered blur event is dispatched from descope-passcode internal (and not every time focusing a digit)
1578
+ this.proxyElement._setFocused = () => { };
1579
+
1580
+ this.shadowRoot.host.appendChild(template.content.cloneNode(true));
1581
+ this.inputElement = this.querySelector(componentName$4);
1582
+
1583
+ // we want to trigger validation only when dispatching a blur event from the descope-passcode-internal
1584
+ this.inputElement.addEventListener('blur', () => {
1585
+ this.proxyElement.validate();
1586
+ });
1587
+ }
1588
+ };
1589
+
1590
+ const { borderStyle, borderWidth, ...restTextFieldMappings } = textFieldMappings;
1591
+
1592
+ const Passcode = compose(
1593
+ createStyleMixin({
1594
+ mappings: {
1595
+ ...restTextFieldMappings,
1596
+ },
1597
+ nestedMappings: {
1598
+ borderColor: {
1599
+ selector: ` ${TextField.componentName}`,
1600
+ property: TextField.cssVarList.borderColor
1601
+ }
1602
+ }
1603
+ }),
1604
+ draggableMixin,
1605
+ inputMixin,
1606
+ componentNameValidationMixin,
1607
+ customMixin
1608
+ )(
1609
+ createProxy({
1610
+ slots: [],
1611
+ wrappedEleName: 'vaadin-text-field',
1612
+ style: () => `
1613
+ :host {
1614
+ --vaadin-field-default-width: auto;
1615
+ }
1616
+
1617
+ ::slotted([slot='input']) {
1618
+ -webkit-mask-image: none;
1619
+ display: flex;
1620
+ gap: 2px;
1621
+ align-items: center;
1622
+ padding: 0;
1623
+ }
1624
+
1625
+ vaadin-text-field::part(input-field) {
1626
+ background-color: transparent;
1627
+ padding: 0;
1628
+ }
1629
+
1630
+ ${overrides$3}
1631
+ `,
1632
+ excludeAttrsSync: ['tabindex'],
1633
+ componentName: componentName$3
1634
+ })
1635
+ );
1636
+
1637
+ const overrides$3 = `
1638
+ :host {
1639
+ display: inline-block;
1640
+ }
1641
+
1642
+ vaadin-text-field {
1643
+ margin: 0;
1644
+ padding: 0;
1645
+ }
1646
+ vaadin-text-field::part(input-field) {
1647
+ overflow: hidden;
1648
+ }
1649
+ vaadin-text-field[readonly] > input:placeholder-shown {
1650
+ opacity: 1;
1651
+ }
1652
+
1653
+ vaadin-text-field > label,
1654
+ vaadin-text-field::part(input-field) {
1655
+ cursor: pointer;
1656
+ color: var(${Passcode.cssVarList.color});
1657
+ }
1658
+ vaadin-text-field::part(input-field):focus {
1659
+ cursor: text;
1660
+ }
1661
+ vaadin-text-field[required]::part(required-indicator)::after {
1662
+ font-size: "12px";
1663
+ content: "*";
1664
+ color: var(${Passcode.cssVarList.color});
1665
+ }
1666
+ vaadin-text-field[readonly]::part(input-field)::after {
1667
+ border: 0 solid;
1668
+ }
1669
+ `;
1670
+
1671
+ customElements.define(componentName$4, PasscodeInternal);
1672
+
1673
+ customElements.define(componentName$3, Passcode);
1674
+
1675
+ const componentName$2 = getComponentName('password-field');
1676
+
1677
+ let overrides$2 = ``;
1678
+
1679
+ const PasswordField = compose(
1680
+ createStyleMixin({
1681
+ mappings: {
1682
+ ...textFieldMappings,
1683
+ revealCursor: [
1684
+ {
1685
+ selector: '::part(reveal-button)::before',
1686
+ property: 'cursor'
1687
+ }
1688
+ ]
1689
+ }
1690
+ }),
1691
+ draggableMixin,
1692
+ inputMixin,
1693
+ componentNameValidationMixin
1694
+ )(
1695
+ createProxy({
1696
+ slots: ['suffix'],
1697
+ wrappedEleName: 'vaadin-password-field',
1698
+ style: () => overrides$2,
1699
+ excludeAttrsSync: ['tabindex'],
1700
+ componentName: componentName$2
1701
+ })
1702
+ );
1703
+
1704
+ overrides$2 = `
1705
+ :host {
1706
+ display: inline-block;
1707
+ }
1708
+ vaadin-password-field {
1709
+ margin: 0;
1710
+ padding: 0;
1711
+ }
1712
+ vaadin-password-field::part(input-field) {
1713
+ overflow: hidden;
1714
+ }
1715
+ vaadin-password-field[readonly] > input:placeholder-shown {
1716
+ opacity: 1;
1717
+ }
1718
+ vaadin-password-field input:-webkit-autofill,
1719
+ vaadin-password-field input:-webkit-autofill::first-line,
1720
+ vaadin-password-field input:-webkit-autofill:hover,
1721
+ vaadin-password-field input:-webkit-autofill:active,
1722
+ vaadin-password-field input:-webkit-autofill:focus {
1723
+ -webkit-text-fill-color: var(${PasswordField.cssVarList.color});
1724
+ box-shadow: 0 0 0 var(${PasswordField.cssVarList.height}) var(${PasswordField.cssVarList.backgroundColor}) inset;
1725
+ }
1726
+ vaadin-password-field > label,
1727
+ vaadin-password-field::part(input-field) {
1728
+ cursor: pointer;
1729
+ color: var(${PasswordField.cssVarList.color});
1730
+ }
1731
+ vaadin-password-field::part(input-field):focus {
1732
+ cursor: text;
1733
+ }
1734
+ vaadin-password-field[required]::part(required-indicator)::after {
1735
+ font-size: "12px";
1736
+ content: "*";
1737
+ color: var(${PasswordField.cssVarList.color});
1738
+ }
1739
+ vaadin-password-field[readonly]::part(input-field)::after {
1740
+ border: 0 solid;
1741
+ }
1742
+ `;
1743
+
1744
+ customElements.define(componentName$2, PasswordField);
1745
+
1746
+ const componentName$1 = getComponentName('switch-toggle');
1747
+
1748
+ let overrides$1 = ``;
1749
+
1750
+ const SwitchToggle = compose(
1751
+ createStyleMixin({
1752
+ mappings: {
1753
+ width: matchHostStyle(),
1754
+ cursor: [{}, { selector: '> label' }]
1755
+ }
1756
+ }),
1757
+ draggableMixin,
1758
+ inputMixin,
1759
+ componentNameValidationMixin
1760
+ )(
1761
+ createProxy({
1762
+ slots: [],
1763
+ wrappedEleName: 'vaadin-checkbox',
1764
+ style: () => overrides$1,
1765
+ excludeAttrsSync: ['tabindex'],
1766
+ componentName: componentName$1
1767
+ })
1768
+ );
1769
+
1770
+ overrides$1 = `
1771
+ :host {
1772
+ display: inline-block;
1773
+ }
1774
+
1775
+ :host {
1776
+ --margin: 7px;
1777
+ --width: var(${SwitchToggle.cssVarList.width});
1778
+ --height: calc(var(--width) / 2);
1779
+ --radius: var(--height);
1780
+ --knobSize: calc(var(--height) - 5px);
1781
+ --bgColor: #fff;
1782
+ --knobBgColor: #000;
1783
+ }
1784
+ vaadin-checkbox>label {
1785
+ cursor: pointer;
1786
+ border: 1px solid;
1787
+ text-indent: -99999px;
1788
+ display: block;
1789
+ position: relative;
1790
+ width: var(--width);
1791
+ height: var(--height);
1792
+ background: var(--bgColor);
1793
+ border-radius: var(--radius);
1794
+ }
1795
+ vaadin-checkbox>label::after {
1796
+ content: '';
1797
+ position: absolute;
1798
+ transition: 0.3s;
1799
+ top: var(--margin);
1800
+ left: var(--margin);
1801
+ width: var(--knobSize);
1802
+ height: var(--knobSize);
1803
+ background: var(--knobBgColor);
1804
+ border-radius: var(--knobSize);
1805
+ }
1806
+ vaadin-checkbox::part(checkbox) {
1807
+ height: 0;
1808
+ width: 0;
1809
+ visibility: hidden;
1810
+ }
1811
+ vaadin-checkbox[checked]>label::after {
1812
+ transform: translateX(-100%);
1813
+ left: calc(100% - var(--margin));
1814
+ }
1815
+ vaadin-checkbox[active]>label::after {
1816
+ width: calc(var(--knobSize) + 15px);
1817
+ }
1818
+ `;
1819
+
1820
+ customElements.define(componentName$1, SwitchToggle);
1821
+
1822
+ const componentName = getComponentName('text-area');
1823
+
1824
+ const selectors = {
1825
+ label: '::part(label)',
1826
+ input: '::part(input-field)',
1827
+ required: '::part(required-indicator)::after'
1828
+ };
1829
+
1830
+ let overrides = ``;
1831
+
1832
+ const TextArea = compose(
1833
+ createStyleMixin({
1834
+ mappings: {
1835
+ resize: { selector: '> textarea' },
1836
+ color: { selector: selectors.label },
1837
+ cursor: {},
1838
+ width: matchHostStyle(),
1839
+ backgroundColor: { selector: selectors.input },
1840
+ borderWidth: { selector: selectors.input },
1841
+ borderStyle: { selector: selectors.input },
1842
+ borderColor: { selector: selectors.input },
1843
+ borderRadius: { selector: selectors.input },
1844
+ outline: { selector: selectors.input },
1845
+ outlineOffset: { selector: selectors.input }
1846
+ }
1847
+ }),
1848
+ draggableMixin,
1849
+ inputMixin,
1850
+ componentNameValidationMixin
1851
+ )(
1852
+ createProxy({
1853
+ slots: [],
1854
+ wrappedEleName: 'vaadin-text-area',
1855
+ style: () => overrides,
1856
+ excludeAttrsSync: ['tabindex'],
1857
+ componentName
1858
+ })
1859
+ );
1860
+
1861
+ overrides = `
1862
+ :host {
1863
+ display: inline-block;
1864
+ }
1865
+
1866
+ vaadin-text-area {
1867
+ margin: 0;
1868
+ }
1869
+ vaadin-text-area > label,
1870
+ vaadin-text-area::part(input-field) {
1871
+ cursor: pointer;
1872
+ }
1873
+ vaadin-text-area[focused]::part(input-field) {
1874
+ cursor: text;
1875
+ }
1876
+ vaadin-text-area::part(required-indicator)::after {
1877
+ font-size: "12px";
1878
+ content: "*";
1879
+ }
1880
+ `;
1881
+
1882
+ customElements.define(componentName, TextArea);
1358
1883
 
1359
1884
  const getVarName = (path) => getCssVarName(DESCOPE_PREFIX, ...path);
1360
1885
 
@@ -1594,150 +2119,150 @@ var globals = {
1594
2119
  fonts
1595
2120
  };
1596
2121
 
1597
- const globalRefs$4 = getThemeRefs(globals);
1598
- const vars$9 = Button.cssVarList;
2122
+ const globalRefs$5 = getThemeRefs(globals);
2123
+ const vars$a = Button.cssVarList;
1599
2124
 
1600
2125
  const mode = {
1601
- primary: globalRefs$4.colors.primary,
1602
- secondary: globalRefs$4.colors.secondary,
1603
- success: globalRefs$4.colors.success,
1604
- error: globalRefs$4.colors.error,
1605
- surface: globalRefs$4.colors.surface
2126
+ primary: globalRefs$5.colors.primary,
2127
+ secondary: globalRefs$5.colors.secondary,
2128
+ success: globalRefs$5.colors.success,
2129
+ error: globalRefs$5.colors.error,
2130
+ surface: globalRefs$5.colors.surface
1606
2131
  };
1607
2132
 
1608
- const [helperTheme$1, helperRefs$1] = createHelperVars({ mode }, componentName$f);
2133
+ const [helperTheme$1, helperRefs$1] = createHelperVars({ mode }, componentName$g);
1609
2134
 
1610
2135
  const button = {
1611
2136
  ...helperTheme$1,
1612
2137
 
1613
2138
  size: {
1614
2139
  xs: {
1615
- [vars$9.height]: '10px',
1616
- [vars$9.fontSize]: '10px',
1617
- [vars$9.padding]: `0 ${globalRefs$4.spacing.xs}`
2140
+ [vars$a.height]: '10px',
2141
+ [vars$a.fontSize]: '10px',
2142
+ [vars$a.padding]: `0 ${globalRefs$5.spacing.xs}`
1618
2143
  },
1619
2144
  sm: {
1620
- [vars$9.height]: '20px',
1621
- [vars$9.fontSize]: '10px',
1622
- [vars$9.padding]: `0 ${globalRefs$4.spacing.sm}`
2145
+ [vars$a.height]: '20px',
2146
+ [vars$a.fontSize]: '10px',
2147
+ [vars$a.padding]: `0 ${globalRefs$5.spacing.sm}`
1623
2148
  },
1624
2149
  md: {
1625
- [vars$9.height]: '30px',
1626
- [vars$9.fontSize]: '14px',
1627
- [vars$9.padding]: `0 ${globalRefs$4.spacing.md}`
2150
+ [vars$a.height]: '30px',
2151
+ [vars$a.fontSize]: '14px',
2152
+ [vars$a.padding]: `0 ${globalRefs$5.spacing.md}`
1628
2153
  },
1629
2154
  lg: {
1630
- [vars$9.height]: '40px',
1631
- [vars$9.fontSize]: '20px',
1632
- [vars$9.padding]: `0 ${globalRefs$4.spacing.lg}`
2155
+ [vars$a.height]: '40px',
2156
+ [vars$a.fontSize]: '20px',
2157
+ [vars$a.padding]: `0 ${globalRefs$5.spacing.lg}`
1633
2158
  },
1634
2159
  xl: {
1635
- [vars$9.height]: '50px',
1636
- [vars$9.fontSize]: '25px',
1637
- [vars$9.padding]: `0 ${globalRefs$4.spacing.xl}`
2160
+ [vars$a.height]: '50px',
2161
+ [vars$a.fontSize]: '25px',
2162
+ [vars$a.padding]: `0 ${globalRefs$5.spacing.xl}`
1638
2163
  }
1639
2164
  },
1640
2165
 
1641
- [vars$9.borderRadius]: globalRefs$4.radius.lg,
1642
- [vars$9.cursor]: 'pointer',
1643
- [vars$9.borderWidth]: '2px',
1644
- [vars$9.borderStyle]: 'solid',
1645
- [vars$9.borderColor]: 'transparent',
2166
+ [vars$a.borderRadius]: globalRefs$5.radius.lg,
2167
+ [vars$a.cursor]: 'pointer',
2168
+ [vars$a.borderWidth]: '2px',
2169
+ [vars$a.borderStyle]: 'solid',
2170
+ [vars$a.borderColor]: 'transparent',
1646
2171
 
1647
2172
  _fullWidth: {
1648
- [vars$9.width]: '100%'
2173
+ [vars$a.width]: '100%'
1649
2174
  },
1650
2175
  _loading: {
1651
- [vars$9.cursor]: 'wait'
2176
+ [vars$a.cursor]: 'wait'
1652
2177
  },
1653
2178
 
1654
2179
  variant: {
1655
2180
  contained: {
1656
- [vars$9.color]: helperRefs$1.contrast,
1657
- [vars$9.backgroundColor]: helperRefs$1.main,
2181
+ [vars$a.color]: helperRefs$1.contrast,
2182
+ [vars$a.backgroundColor]: helperRefs$1.main,
1658
2183
  _hover: {
1659
- [vars$9.backgroundColor]: helperRefs$1.dark
2184
+ [vars$a.backgroundColor]: helperRefs$1.dark
1660
2185
  },
1661
2186
  _loading: {
1662
- [vars$9.backgroundColor]: helperRefs$1.main
2187
+ [vars$a.backgroundColor]: helperRefs$1.main
1663
2188
  }
1664
2189
  },
1665
2190
  outline: {
1666
- [vars$9.color]: helperRefs$1.main,
1667
- [vars$9.borderColor]: helperRefs$1.main,
2191
+ [vars$a.color]: helperRefs$1.main,
2192
+ [vars$a.borderColor]: helperRefs$1.main,
1668
2193
  _hover: {
1669
- [vars$9.color]: helperRefs$1.dark,
1670
- [vars$9.borderColor]: helperRefs$1.dark,
2194
+ [vars$a.color]: helperRefs$1.dark,
2195
+ [vars$a.borderColor]: helperRefs$1.dark,
1671
2196
  _error: {
1672
- [vars$9.color]: helperRefs$1.error
2197
+ [vars$a.color]: helperRefs$1.error
1673
2198
  }
1674
2199
  }
1675
2200
  },
1676
2201
  link: {
1677
- [vars$9.color]: helperRefs$1.main,
1678
- [vars$9.padding]: 0,
1679
- [vars$9.margin]: 0,
1680
- [vars$9.lineHeight]: helperRefs$1.height,
1681
- [vars$9.borderRadius]: 0,
2202
+ [vars$a.color]: helperRefs$1.main,
2203
+ [vars$a.padding]: 0,
2204
+ [vars$a.margin]: 0,
2205
+ [vars$a.lineHeight]: helperRefs$1.height,
2206
+ [vars$a.borderRadius]: 0,
1682
2207
  _hover: {
1683
- [vars$9.color]: helperRefs$1.main,
1684
- [vars$9.textDecoration]: 'underline'
2208
+ [vars$a.color]: helperRefs$1.main,
2209
+ [vars$a.textDecoration]: 'underline'
1685
2210
  }
1686
2211
  }
1687
2212
  }
1688
2213
  };
1689
2214
 
1690
- const globalRefs$3 = getThemeRefs(globals);
2215
+ const globalRefs$4 = getThemeRefs(globals);
1691
2216
 
1692
- const vars$8 = TextField.cssVarList;
2217
+ const vars$9 = TextField.cssVarList;
1693
2218
 
1694
2219
  const textField = (vars) => ({
1695
2220
  size: {
1696
2221
  xs: {
1697
2222
  [vars.height]: '14px',
1698
2223
  [vars.fontSize]: '8px',
1699
- [vars.padding]: `0 ${globalRefs$3.spacing.xs}`
2224
+ [vars.padding]: `0 ${globalRefs$4.spacing.xs}`
1700
2225
  },
1701
2226
  sm: {
1702
2227
  [vars.height]: '20px',
1703
2228
  [vars.fontSize]: '10px',
1704
- [vars.padding]: `0 ${globalRefs$3.spacing.sm}`
2229
+ [vars.padding]: `0 ${globalRefs$4.spacing.sm}`
1705
2230
  },
1706
2231
  md: {
1707
2232
  [vars.height]: '30px',
1708
2233
  [vars.fontSize]: '14px',
1709
- [vars.padding]: `0 ${globalRefs$3.spacing.md}`
2234
+ [vars.padding]: `0 ${globalRefs$4.spacing.md}`
1710
2235
  },
1711
2236
  lg: {
1712
2237
  [vars.height]: '40px',
1713
2238
  [vars.fontSize]: '16px',
1714
- [vars.padding]: `0 ${globalRefs$3.spacing.lg}`
2239
+ [vars.padding]: `0 ${globalRefs$4.spacing.lg}`
1715
2240
  },
1716
2241
  xl: {
1717
2242
  [vars.height]: '50px',
1718
2243
  [vars.fontSize]: '25px',
1719
- [vars.padding]: `0 ${globalRefs$3.spacing.xl}`
2244
+ [vars.padding]: `0 ${globalRefs$4.spacing.xl}`
1720
2245
  }
1721
2246
  },
1722
2247
 
1723
- [vars.color]: globalRefs$3.colors.surface.contrast,
1724
- [vars.placeholderColor]: globalRefs$3.colors.surface.contrast,
2248
+ [vars.color]: globalRefs$4.colors.surface.contrast,
2249
+ [vars.placeholderColor]: globalRefs$4.colors.surface.contrast,
1725
2250
 
1726
- [vars.backgroundColor]: globalRefs$3.colors.surface.light,
2251
+ [vars.backgroundColor]: globalRefs$4.colors.surface.light,
1727
2252
 
1728
2253
  [vars.borderWidth]: '1px',
1729
2254
  [vars.borderStyle]: 'solid',
1730
2255
  [vars.borderColor]: 'transparent',
1731
- [vars.borderRadius]: globalRefs$3.radius.sm,
2256
+ [vars.borderRadius]: globalRefs$4.radius.sm,
1732
2257
 
1733
2258
  _borderOffset: {
1734
2259
  [vars.outlineOffset]: '2px'
1735
2260
  },
1736
2261
 
1737
2262
  _disabled: {
1738
- [vars.color]: globalRefs$3.colors.surface.dark,
1739
- [vars.placeholderColor]: globalRefs$3.colors.surface.light,
1740
- [vars.backgroundColor]: globalRefs$3.colors.surface.main
2263
+ [vars.color]: globalRefs$4.colors.surface.dark,
2264
+ [vars.placeholderColor]: globalRefs$4.colors.surface.light,
2265
+ [vars.backgroundColor]: globalRefs$4.colors.surface.main
1741
2266
  },
1742
2267
 
1743
2268
  _fullWidth: {
@@ -1745,27 +2270,27 @@ const textField = (vars) => ({
1745
2270
  },
1746
2271
 
1747
2272
  _focused: {
1748
- [vars.outline]: `2px solid ${globalRefs$3.colors.surface.main}`
2273
+ [vars.outline]: `2px solid ${globalRefs$4.colors.surface.main}`
1749
2274
  },
1750
2275
 
1751
2276
  _bordered: {
1752
- [vars.borderColor]: globalRefs$3.colors.surface.main
2277
+ [vars.borderColor]: globalRefs$4.colors.surface.main
1753
2278
  },
1754
2279
 
1755
2280
  _hasErrorMessage: {
1756
- [vars.borderColor]: globalRefs$3.colors.error.main,
1757
- [vars.color]: globalRefs$3.colors.error.main,
1758
- [vars.placeholderColor]: globalRefs$3.colors.error.light
2281
+ [vars.borderColor]: globalRefs$4.colors.error.main,
2282
+ [vars.color]: globalRefs$4.colors.error.main,
2283
+ [vars.placeholderColor]: globalRefs$4.colors.error.light
1759
2284
  }
1760
2285
  });
1761
2286
 
1762
- var textField$1 = textField(vars$8);
2287
+ var textField$1 = textField(vars$9);
1763
2288
 
1764
- const vars$7 = PasswordField.cssVarList;
2289
+ const vars$8 = PasswordField.cssVarList;
1765
2290
 
1766
2291
  const passwordField = {
1767
- ...textField(vars$7),
1768
- [vars$7.revealCursor]: 'pointer'
2292
+ ...textField(vars$8),
2293
+ [vars$8.revealCursor]: 'pointer'
1769
2294
  };
1770
2295
 
1771
2296
  const numberField = {
@@ -1776,134 +2301,60 @@ const emailField = {
1776
2301
  ...textField(EmailField.cssVarList)
1777
2302
  };
1778
2303
 
1779
- const globalRefs$2 = getThemeRefs(globals);
1780
- const vars$6 = TextArea.cssVarList;
2304
+ const globalRefs$3 = getThemeRefs(globals);
2305
+ const vars$7 = TextArea.cssVarList;
1781
2306
 
1782
2307
  const textArea = {
1783
- [vars$6.color]: globalRefs$2.colors.primary.main,
1784
- [vars$6.backgroundColor]: globalRefs$2.colors.surface.light,
1785
- [vars$6.resize]: 'vertical',
2308
+ [vars$7.color]: globalRefs$3.colors.primary.main,
2309
+ [vars$7.backgroundColor]: globalRefs$3.colors.surface.light,
2310
+ [vars$7.resize]: 'vertical',
1786
2311
 
1787
- [vars$6.borderRadius]: globalRefs$2.radius.sm,
1788
- [vars$6.borderWidth]: '1px',
1789
- [vars$6.borderStyle]: 'solid',
1790
- [vars$6.borderColor]: 'transparent',
2312
+ [vars$7.borderRadius]: globalRefs$3.radius.sm,
2313
+ [vars$7.borderWidth]: '1px',
2314
+ [vars$7.borderStyle]: 'solid',
2315
+ [vars$7.borderColor]: 'transparent',
1791
2316
 
1792
2317
  _borderOffset: {
1793
- [vars$6.outlineOffset]: '2px'
2318
+ [vars$7.outlineOffset]: '2px'
1794
2319
  },
1795
2320
 
1796
2321
  _bordered: {
1797
- [vars$6.borderColor]: globalRefs$2.colors.surface.main
2322
+ [vars$7.borderColor]: globalRefs$3.colors.surface.main
1798
2323
  },
1799
2324
 
1800
2325
  _focused: {
1801
- [vars$6.outline]: `2px solid ${globalRefs$2.colors.surface.main}`
2326
+ [vars$7.outline]: `2px solid ${globalRefs$3.colors.surface.main}`
1802
2327
  },
1803
2328
 
1804
2329
  _fullWidth: {
1805
- [vars$6.width]: '100%'
2330
+ [vars$7.width]: '100%'
1806
2331
  },
1807
2332
 
1808
2333
  _disabled: {
1809
- [vars$6.cursor]: 'not-allowed'
2334
+ [vars$7.cursor]: 'not-allowed'
1810
2335
  },
1811
2336
 
1812
2337
  _invalid: {
1813
- [vars$6.outline]: `2px solid ${globalRefs$2.colors.error.main}`
2338
+ [vars$7.outline]: `2px solid ${globalRefs$3.colors.error.main}`
1814
2339
  }
1815
2340
  };
1816
2341
 
1817
- const vars$5 = Checkbox.cssVarList;
2342
+ const vars$6 = Checkbox.cssVarList;
1818
2343
 
1819
2344
  const checkbox = {
1820
- [vars$5.cursor]: 'pointer'
2345
+ [vars$6.cursor]: 'pointer'
1821
2346
  };
1822
2347
 
1823
- const componentName$2 = getComponentName('switch-toggle');
1824
-
1825
- let overrides$1 = ``;
1826
-
1827
- const SwitchToggle = compose(
1828
- createStyleMixin({
1829
- mappings: {
1830
- width: matchHostStyle(),
1831
- cursor: [{}, { selector: '> label' }]
1832
- }
1833
- }),
1834
- draggableMixin,
1835
- inputMixin,
1836
- componentNameValidationMixin
1837
- )(
1838
- createProxy({
1839
- slots: [],
1840
- wrappedEleName: 'vaadin-checkbox',
1841
- style: () => overrides$1,
1842
- excludeAttrsSync: ['tabindex'],
1843
- componentName: componentName$2
1844
- })
1845
- );
1846
-
1847
- overrides$1 = `
1848
- :host {
1849
- display: inline-block;
1850
- }
1851
-
1852
- :host {
1853
- --margin: 7px;
1854
- --width: var(${SwitchToggle.cssVarList.width});
1855
- --height: calc(var(--width) / 2);
1856
- --radius: var(--height);
1857
- --knobSize: calc(var(--height) - 5px);
1858
- --bgColor: #fff;
1859
- --knobBgColor: #000;
1860
- }
1861
- vaadin-checkbox>label {
1862
- cursor: pointer;
1863
- border: 1px solid;
1864
- text-indent: -99999px;
1865
- display: block;
1866
- position: relative;
1867
- width: var(--width);
1868
- height: var(--height);
1869
- background: var(--bgColor);
1870
- border-radius: var(--radius);
1871
- }
1872
- vaadin-checkbox>label::after {
1873
- content: '';
1874
- position: absolute;
1875
- transition: 0.3s;
1876
- top: var(--margin);
1877
- left: var(--margin);
1878
- width: var(--knobSize);
1879
- height: var(--knobSize);
1880
- background: var(--knobBgColor);
1881
- border-radius: var(--knobSize);
1882
- }
1883
- vaadin-checkbox::part(checkbox) {
1884
- height: 0;
1885
- width: 0;
1886
- visibility: hidden;
1887
- }
1888
- vaadin-checkbox[checked]>label::after {
1889
- transform: translateX(-100%);
1890
- left: calc(100% - var(--margin));
1891
- }
1892
- vaadin-checkbox[active]>label::after {
1893
- width: calc(var(--knobSize) + 15px);
1894
- }
1895
- `;
1896
-
1897
- const vars$4 = SwitchToggle.cssVarList;
2348
+ const vars$5 = SwitchToggle.cssVarList;
1898
2349
 
1899
2350
  const swtichToggle = {
1900
- [vars$4.width]: '70px',
1901
- [vars$4.cursor]: [{}, { selector: '> label' }]
2351
+ [vars$5.width]: '70px',
2352
+ [vars$5.cursor]: [{}, { selector: '> label' }]
1902
2353
  };
1903
2354
 
1904
- const globalRefs$1 = getThemeRefs(globals);
2355
+ const globalRefs$2 = getThemeRefs(globals);
1905
2356
 
1906
- const vars$3 = Container.cssVarList;
2357
+ const vars$4 = Container.cssVarList;
1907
2358
 
1908
2359
  const verticalAlignment = {
1909
2360
  start: { verticalAlignment: 'start' },
@@ -1926,31 +2377,31 @@ const [helperTheme, helperRefs, helperVars] =
1926
2377
 
1927
2378
  const container = {
1928
2379
  ...helperTheme,
1929
- [vars$3.display]: 'flex',
2380
+ [vars$4.display]: 'flex',
1930
2381
  verticalPadding: {
1931
- sm: { [vars$3.verticalPadding]: '5px' },
1932
- md: { [vars$3.verticalPadding]: '10px' },
1933
- lg: { [vars$3.verticalPadding]: '20px' },
2382
+ sm: { [vars$4.verticalPadding]: '5px' },
2383
+ md: { [vars$4.verticalPadding]: '10px' },
2384
+ lg: { [vars$4.verticalPadding]: '20px' },
1934
2385
  },
1935
2386
  horizontalPadding: {
1936
- sm: { [vars$3.horizontalPadding]: '5px' },
1937
- md: { [vars$3.horizontalPadding]: '10px' },
1938
- lg: { [vars$3.horizontalPadding]: '20px' },
2387
+ sm: { [vars$4.horizontalPadding]: '5px' },
2388
+ md: { [vars$4.horizontalPadding]: '10px' },
2389
+ lg: { [vars$4.horizontalPadding]: '20px' },
1939
2390
  },
1940
2391
  direction: {
1941
2392
  row: {
1942
- [vars$3.flexDirection]: 'row',
1943
- [vars$3.alignItems]: helperRefs.verticalAlignment,
1944
- [vars$3.justifyContent]: helperRefs.horizontalAlignment,
2393
+ [vars$4.flexDirection]: 'row',
2394
+ [vars$4.alignItems]: helperRefs.verticalAlignment,
2395
+ [vars$4.justifyContent]: helperRefs.horizontalAlignment,
1945
2396
  horizontalAlignment: {
1946
2397
  spaceBetween: { [helperVars.horizontalAlignment]: 'space-between' },
1947
2398
  }
1948
2399
  },
1949
2400
 
1950
2401
  column: {
1951
- [vars$3.flexDirection]: 'column',
1952
- [vars$3.alignItems]: helperRefs.horizontalAlignment,
1953
- [vars$3.justifyContent]: helperRefs.verticalAlignment,
2402
+ [vars$4.flexDirection]: 'column',
2403
+ [vars$4.alignItems]: helperRefs.horizontalAlignment,
2404
+ [vars$4.justifyContent]: helperRefs.verticalAlignment,
1954
2405
  verticalAlignment: {
1955
2406
  spaceBetween: { [helperVars.verticalAlignment]: 'space-between' }
1956
2407
  }
@@ -1959,131 +2410,183 @@ const container = {
1959
2410
 
1960
2411
  spaceBetween: {
1961
2412
  sm: {
1962
- [vars$3.gap]: '10px'
2413
+ [vars$4.gap]: '10px'
1963
2414
  },
1964
2415
  md: {
1965
- [vars$3.gap]: '20px'
2416
+ [vars$4.gap]: '20px'
1966
2417
  },
1967
2418
  lg: {
1968
- [vars$3.gap]: '30px'
2419
+ [vars$4.gap]: '30px'
1969
2420
  }
1970
2421
  },
1971
2422
 
1972
2423
  shadow: {
1973
2424
  sm: {
1974
- [vars$3.boxShadow]: `${globalRefs$1.shadow.wide.sm} ${helperRefs.shadowColor}, ${globalRefs$1.shadow.narrow.sm} ${helperRefs.shadowColor}`
2425
+ [vars$4.boxShadow]: `${globalRefs$2.shadow.wide.sm} ${helperRefs.shadowColor}, ${globalRefs$2.shadow.narrow.sm} ${helperRefs.shadowColor}`
1975
2426
  },
1976
2427
  md: {
1977
- [vars$3.boxShadow]: `${globalRefs$1.shadow.wide.md} ${helperRefs.shadowColor}, ${globalRefs$1.shadow.narrow.md} ${helperRefs.shadowColor}`
2428
+ [vars$4.boxShadow]: `${globalRefs$2.shadow.wide.md} ${helperRefs.shadowColor}, ${globalRefs$2.shadow.narrow.md} ${helperRefs.shadowColor}`
1978
2429
  },
1979
2430
  lg: {
1980
- [vars$3.boxShadow]: `${globalRefs$1.shadow.wide.lg} ${helperRefs.shadowColor}, ${globalRefs$1.shadow.narrow.lg} ${helperRefs.shadowColor}`
2431
+ [vars$4.boxShadow]: `${globalRefs$2.shadow.wide.lg} ${helperRefs.shadowColor}, ${globalRefs$2.shadow.narrow.lg} ${helperRefs.shadowColor}`
1981
2432
  },
1982
2433
  xl: {
1983
- [vars$3.boxShadow]: `${globalRefs$1.shadow.wide.xl} ${helperRefs.shadowColor}, ${globalRefs$1.shadow.narrow.xl} ${helperRefs.shadowColor}`
2434
+ [vars$4.boxShadow]: `${globalRefs$2.shadow.wide.xl} ${helperRefs.shadowColor}, ${globalRefs$2.shadow.narrow.xl} ${helperRefs.shadowColor}`
1984
2435
  },
1985
2436
  '2xl': {
1986
2437
  [helperVars.shadowColor]: '#00000050',
1987
- [vars$3.boxShadow]: `${globalRefs$1.shadow.wide['2xl']} ${helperRefs.shadowColor}`
2438
+ [vars$4.boxShadow]: `${globalRefs$2.shadow.wide['2xl']} ${helperRefs.shadowColor}`
1988
2439
  },
1989
2440
  },
1990
2441
 
1991
2442
  borderRadius: {
1992
2443
  sm: {
1993
- [vars$3.borderRadius]: globalRefs$1.radius.sm
2444
+ [vars$4.borderRadius]: globalRefs$2.radius.sm
1994
2445
  },
1995
2446
  md: {
1996
- [vars$3.borderRadius]: globalRefs$1.radius.md
2447
+ [vars$4.borderRadius]: globalRefs$2.radius.md
1997
2448
  },
1998
2449
  lg: {
1999
- [vars$3.borderRadius]: globalRefs$1.radius.lg
2450
+ [vars$4.borderRadius]: globalRefs$2.radius.lg
2000
2451
  },
2001
2452
  }
2002
2453
  };
2003
2454
 
2004
- const vars$2 = Logo.cssVarList;
2455
+ const vars$3 = Logo.cssVarList;
2005
2456
 
2006
2457
  const logo = {
2007
- [vars$2.fallbackUrl]: 'url(https://content.app.descope.com/assets/flows/noLogoPlaceholder.svg)'
2458
+ [vars$3.fallbackUrl]: 'url(https://content.app.descope.com/assets/flows/noLogoPlaceholder.svg)'
2008
2459
  };
2009
2460
 
2010
- const globalRefs = getThemeRefs(globals);
2461
+ const globalRefs$1 = getThemeRefs(globals);
2011
2462
 
2012
- const vars$1 = Text.cssVarList;
2463
+ const vars$2 = Text.cssVarList;
2013
2464
 
2014
2465
  const text = {
2015
- [vars$1.lineHeight]: '1em',
2016
- [vars$1.display]: 'inline-block',
2017
- [vars$1.textAlign]: 'left',
2018
- [vars$1.color]: globalRefs.colors.surface.dark,
2466
+ [vars$2.lineHeight]: '1em',
2467
+ [vars$2.display]: 'inline-block',
2468
+ [vars$2.textAlign]: 'left',
2469
+ [vars$2.color]: globalRefs$1.colors.surface.dark,
2019
2470
  variant: {
2020
2471
  h1: {
2021
- [vars$1.fontSize]: globalRefs.typography.h1.size,
2022
- [vars$1.fontWeight]: globalRefs.typography.h1.weight,
2023
- [vars$1.fontFamily]: globalRefs.typography.h1.font
2472
+ [vars$2.fontSize]: globalRefs$1.typography.h1.size,
2473
+ [vars$2.fontWeight]: globalRefs$1.typography.h1.weight,
2474
+ [vars$2.fontFamily]: globalRefs$1.typography.h1.font
2024
2475
  },
2025
2476
  h2: {
2026
- [vars$1.fontSize]: globalRefs.typography.h2.size,
2027
- [vars$1.fontWeight]: globalRefs.typography.h2.weight,
2028
- [vars$1.fontFamily]: globalRefs.typography.h2.font
2477
+ [vars$2.fontSize]: globalRefs$1.typography.h2.size,
2478
+ [vars$2.fontWeight]: globalRefs$1.typography.h2.weight,
2479
+ [vars$2.fontFamily]: globalRefs$1.typography.h2.font
2029
2480
  },
2030
2481
  h3: {
2031
- [vars$1.fontSize]: globalRefs.typography.h3.size,
2032
- [vars$1.fontWeight]: globalRefs.typography.h3.weight,
2033
- [vars$1.fontFamily]: globalRefs.typography.h3.font
2482
+ [vars$2.fontSize]: globalRefs$1.typography.h3.size,
2483
+ [vars$2.fontWeight]: globalRefs$1.typography.h3.weight,
2484
+ [vars$2.fontFamily]: globalRefs$1.typography.h3.font
2034
2485
  },
2035
2486
  subtitle1: {
2036
- [vars$1.fontSize]: globalRefs.typography.subtitle1.size,
2037
- [vars$1.fontWeight]: globalRefs.typography.subtitle1.weight,
2038
- [vars$1.fontFamily]: globalRefs.typography.subtitle1.font
2487
+ [vars$2.fontSize]: globalRefs$1.typography.subtitle1.size,
2488
+ [vars$2.fontWeight]: globalRefs$1.typography.subtitle1.weight,
2489
+ [vars$2.fontFamily]: globalRefs$1.typography.subtitle1.font
2039
2490
  },
2040
2491
  subtitle2: {
2041
- [vars$1.fontSize]: globalRefs.typography.subtitle2.size,
2042
- [vars$1.fontWeight]: globalRefs.typography.subtitle2.weight,
2043
- [vars$1.fontFamily]: globalRefs.typography.subtitle2.font
2492
+ [vars$2.fontSize]: globalRefs$1.typography.subtitle2.size,
2493
+ [vars$2.fontWeight]: globalRefs$1.typography.subtitle2.weight,
2494
+ [vars$2.fontFamily]: globalRefs$1.typography.subtitle2.font
2044
2495
  },
2045
2496
  body1: {
2046
- [vars$1.fontSize]: globalRefs.typography.body1.size,
2047
- [vars$1.fontWeight]: globalRefs.typography.body1.weight,
2048
- [vars$1.fontFamily]: globalRefs.typography.body1.font
2497
+ [vars$2.fontSize]: globalRefs$1.typography.body1.size,
2498
+ [vars$2.fontWeight]: globalRefs$1.typography.body1.weight,
2499
+ [vars$2.fontFamily]: globalRefs$1.typography.body1.font
2049
2500
  },
2050
2501
  body2: {
2051
- [vars$1.fontSize]: globalRefs.typography.body2.size,
2052
- [vars$1.fontWeight]: globalRefs.typography.body2.weight,
2053
- [vars$1.fontFamily]: globalRefs.typography.body2.font
2502
+ [vars$2.fontSize]: globalRefs$1.typography.body2.size,
2503
+ [vars$2.fontWeight]: globalRefs$1.typography.body2.weight,
2504
+ [vars$2.fontFamily]: globalRefs$1.typography.body2.font
2054
2505
  }
2055
2506
  },
2056
2507
  mode: {
2057
2508
  primary: {
2058
- [vars$1.color]: globalRefs.colors.primary.main
2509
+ [vars$2.color]: globalRefs$1.colors.primary.main
2059
2510
  },
2060
2511
  secondary: {
2061
- [vars$1.color]: globalRefs.colors.secondary.main
2512
+ [vars$2.color]: globalRefs$1.colors.secondary.main
2062
2513
  },
2063
2514
  error: {
2064
- [vars$1.color]: globalRefs.colors.error.main
2515
+ [vars$2.color]: globalRefs$1.colors.error.main
2065
2516
  },
2066
2517
  success: {
2067
- [vars$1.color]: globalRefs.colors.success.main
2518
+ [vars$2.color]: globalRefs$1.colors.success.main
2068
2519
  }
2069
2520
  },
2070
2521
  textAlign: {
2071
- right: { [vars$1.textAlign]: 'right' },
2072
- left: { [vars$1.textAlign]: 'left' },
2073
- center: { [vars$1.textAlign]: 'center' }
2522
+ right: { [vars$2.textAlign]: 'right' },
2523
+ left: { [vars$2.textAlign]: 'left' },
2524
+ center: { [vars$2.textAlign]: 'center' }
2074
2525
  },
2075
2526
  _fullWidth: {
2076
- [vars$1.width]: '100%',
2077
- [vars$1.display]: 'block'
2527
+ [vars$2.width]: '100%',
2528
+ [vars$2.display]: 'block'
2078
2529
  },
2079
2530
  _italic: {
2080
- [vars$1.fontStyle]: 'italic'
2531
+ [vars$2.fontStyle]: 'italic'
2081
2532
  },
2082
2533
  _uppercase: {
2083
- [vars$1.textTransform]: 'uppercase'
2534
+ [vars$2.textTransform]: 'uppercase'
2084
2535
  },
2085
2536
  _lowercase: {
2086
- [vars$1.textTransform]: 'lowercase'
2537
+ [vars$2.textTransform]: 'lowercase'
2538
+ }
2539
+ };
2540
+
2541
+ const globalRefs = getThemeRefs(globals);
2542
+ const vars$1 = Link.cssVarList;
2543
+
2544
+ const link = {
2545
+ [vars$1.cursor]: 'pointer',
2546
+ [vars$1.borderBottomWidth]: '2px',
2547
+ [vars$1.borderBottomStyle]: 'solid',
2548
+ [vars$1.borderBottomColor]: 'transparent',
2549
+ [vars$1.color]: globalRefs.colors.primary.main,
2550
+
2551
+ _hover: {
2552
+ [vars$1.borderBottomColor]: globalRefs.colors.primary.main
2553
+ },
2554
+
2555
+ textAlign: {
2556
+ right: { [vars$1.textAlign]: 'right' },
2557
+ left: { [vars$1.textAlign]: 'left' },
2558
+ center: { [vars$1.textAlign]: 'center' }
2559
+ },
2560
+
2561
+ _fullWidth: {
2562
+ [vars$1.width]: '100%'
2563
+ },
2564
+
2565
+ mode: {
2566
+ primary: {
2567
+ [vars$1.color]: globalRefs.colors.primary.main,
2568
+ _hover: {
2569
+ [vars$1.borderBottomColor]: globalRefs.colors.primary.main
2570
+ }
2571
+ },
2572
+ secondary: {
2573
+ [vars$1.color]: globalRefs.colors.secondary.main,
2574
+ _hover: {
2575
+ [vars$1.borderBottomColor]: globalRefs.colors.secondary.main
2576
+ }
2577
+ },
2578
+ error: {
2579
+ [vars$1.color]: globalRefs.colors.error.main,
2580
+ _hover: {
2581
+ [vars$1.borderBottomColor]: globalRefs.colors.error.main
2582
+ }
2583
+ },
2584
+ success: {
2585
+ [vars$1.color]: globalRefs.colors.success.main,
2586
+ _hover: {
2587
+ [vars$1.borderBottomColor]: globalRefs.colors.success.main
2588
+ }
2589
+ }
2087
2590
  }
2088
2591
  };
2089
2592
 
@@ -2108,135 +2611,6 @@ const divider = {
2108
2611
  }
2109
2612
  };
2110
2613
 
2111
- const componentName$1 = getComponentName('passcode-internal');
2112
-
2113
- const componentName = getComponentName('passcode');
2114
-
2115
- const customMixin = (superclass) =>
2116
- class DraggableMixinClass extends superclass {
2117
- constructor() {
2118
- super();
2119
- }
2120
-
2121
- get digits() {
2122
- return Number.parseInt(this.getAttribute('digits')) || 6
2123
- }
2124
-
2125
- connectedCallback() {
2126
- super.connectedCallback?.();
2127
- const template = document.createElement('template');
2128
-
2129
- //forward required & pattern TODO use forwardAttrs
2130
- template.innerHTML = `
2131
- <${componentName$1}
2132
- bordered="true"
2133
- name="code"
2134
- tabindex="0"
2135
- slot="input"
2136
- required="${this.shadowRoot.host.getAttribute('required')}"
2137
- pattern="${this.shadowRoot.host.getAttribute('pattern')}"
2138
- ></${componentName$1}>
2139
- `;
2140
-
2141
- // we are adding a slot under vaadin-text-field, it should reflect all descope-passcode children to be under vaadin-text-field, this is why it has a name & slot
2142
- const slotEle = Object.assign(document.createElement('slot'), { name: 'input', slot: 'input', part: 'input' });
2143
- this.proxyElement.appendChild(slotEle);
2144
-
2145
- // we want to control when the element is out of focus
2146
- // so the validations will be triggered blur event is dispatched from descope-passcode internal (and not every time focusing a digit)
2147
- this.proxyElement._setFocused = () => { };
2148
-
2149
- this.shadowRoot.host.appendChild(template.content.cloneNode(true));
2150
- this.inputElement = this.querySelector(componentName$1);
2151
-
2152
- // we want to trigger validation only when dispatching a blur event from the descope-passcode-internal
2153
- this.inputElement.addEventListener('blur', () => {
2154
- this.proxyElement.validate();
2155
- });
2156
- }
2157
- };
2158
-
2159
- const { borderStyle, borderWidth, ...restTextFieldMappings } = textFieldMappings;
2160
-
2161
- const Passcode = compose(
2162
- createStyleMixin({
2163
- mappings: {
2164
- ...restTextFieldMappings,
2165
- },
2166
- nestedMappings: {
2167
- borderColor: {
2168
- selector: ` ${TextField.componentName}`,
2169
- property: TextField.cssVarList.borderColor
2170
- }
2171
- }
2172
- }),
2173
- draggableMixin,
2174
- inputMixin,
2175
- componentNameValidationMixin,
2176
- customMixin
2177
- )(
2178
- createProxy({
2179
- slots: [],
2180
- wrappedEleName: 'vaadin-text-field',
2181
- style: () => `
2182
- :host {
2183
- --vaadin-field-default-width: auto;
2184
- }
2185
-
2186
- ::slotted([slot='input']) {
2187
- -webkit-mask-image: none;
2188
- display: flex;
2189
- gap: 2px;
2190
- align-items: center;
2191
- padding: 0;
2192
- }
2193
-
2194
- vaadin-text-field::part(input-field) {
2195
- background-color: transparent;
2196
- padding: 0;
2197
- }
2198
-
2199
- ${overrides}
2200
- `,
2201
- excludeAttrsSync: ['tabindex'],
2202
- componentName
2203
- })
2204
- );
2205
-
2206
- const overrides = `
2207
- :host {
2208
- display: inline-block;
2209
- }
2210
-
2211
- vaadin-text-field {
2212
- margin: 0;
2213
- padding: 0;
2214
- }
2215
- vaadin-text-field::part(input-field) {
2216
- overflow: hidden;
2217
- }
2218
- vaadin-text-field[readonly] > input:placeholder-shown {
2219
- opacity: 1;
2220
- }
2221
-
2222
- vaadin-text-field > label,
2223
- vaadin-text-field::part(input-field) {
2224
- cursor: pointer;
2225
- color: var(${Passcode.cssVarList.color});
2226
- }
2227
- vaadin-text-field::part(input-field):focus {
2228
- cursor: text;
2229
- }
2230
- vaadin-text-field[required]::part(required-indicator)::after {
2231
- font-size: "12px";
2232
- content: "*";
2233
- color: var(${Passcode.cssVarList.color});
2234
- }
2235
- vaadin-text-field[readonly]::part(input-field)::after {
2236
- border: 0 solid;
2237
- }
2238
- `;
2239
-
2240
2614
  const passcode = {
2241
2615
  ...textField(Passcode.cssVarList),
2242
2616
  };
@@ -2253,6 +2627,7 @@ var components = {
2253
2627
  container,
2254
2628
  logo,
2255
2629
  text,
2630
+ link,
2256
2631
  divider,
2257
2632
  passcode
2258
2633
  };