@italia/toggle 1.0.0-beta.6 → 1.0.0-beta.8
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/src/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __decorate, a as __metadata } from '../tslib.es6-
|
|
1
|
+
import { _ as __decorate, a as __metadata } from '../tslib.es6-f5Mxvu5d.js';
|
|
2
2
|
import { queryAssignedElements, customElement } from 'lit/decorators.js';
|
|
3
3
|
import { ItCheckboxGroupBase } from '@italia/checkbox/it-checkbox-group-base.js';
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"it-toggle-group.js","sources":["../../../src/it-toggle-group.ts"],"sourcesContent":["import { customElement, queryAssignedElements } from 'lit/decorators.js';\nimport { ItCheckboxGroupBase } from '@italia/checkbox/it-checkbox-group-base.js';\nimport { ItToggle } from '@italia/toggle';\n\n// import styles from './toggle.scss';\n\n/**\n * @element it-toggle\n */\n@customElement('it-toggle-group')\nexport class ItToggleGroup extends ItCheckboxGroupBase {\n // static override styles = [ItCheckboxGroupBase.styles, styles];\n\n // Query per le checkbox assegnate nello slot\n @queryAssignedElements({ selector: 'it-toggle' })\n checkboxes!: ItToggle[];\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-toggle-group': ItToggleGroup;\n }\n}\n"],"names":[],"mappings":";;;;AAUO,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,mBAAmB,CAAA;;AAKpD,UAAA,CAAA;AADC,IAAA,qBAAqB,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;;AACzB,CAAA,EAAA,aAAA,CAAA,SAAA,EAAA,YAAA,EAAA,MAAA,CAAA;AALb,aAAa,GAAA,UAAA,CAAA;IADzB,aAAa,CAAC,iBAAiB;AACnB,CAAA,EAAA,aAAa,CAMzB
|
|
1
|
+
{"version":3,"file":"it-toggle-group.js","sources":["../../../src/it-toggle-group.ts"],"sourcesContent":["import { customElement, queryAssignedElements } from 'lit/decorators.js';\nimport { ItCheckboxGroupBase } from '@italia/checkbox/it-checkbox-group-base.js';\nimport { ItToggle } from '@italia/toggle';\n\n// import styles from './toggle.scss';\n\n/**\n * @element it-toggle\n */\n@customElement('it-toggle-group')\nexport class ItToggleGroup extends ItCheckboxGroupBase {\n // static override styles = [ItCheckboxGroupBase.styles, styles];\n\n // Query per le checkbox assegnate nello slot\n @queryAssignedElements({ selector: 'it-toggle' })\n checkboxes!: ItToggle[];\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-toggle-group': ItToggleGroup;\n }\n}\n"],"names":[],"mappings":";;;;AAUO,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,mBAAmB,CAAA;;AAKpD,UAAA,CAAA;AADC,IAAA,qBAAqB,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;;AACzB,CAAA,EAAA,aAAA,CAAA,SAAA,EAAA,YAAA,EAAA,MAAA,CAAA;AALb,aAAa,GAAA,UAAA,CAAA;IADzB,aAAa,CAAC,iBAAiB;AACnB,CAAA,EAAA,aAAa,CAMzB;;"}
|
package/dist/src/it-toggle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __decorate } from '../tslib.es6-
|
|
1
|
+
import { _ as __decorate } from '../tslib.es6-f5Mxvu5d.js';
|
|
2
2
|
import { customElement } from 'lit/decorators.js';
|
|
3
3
|
import { css, html } from 'lit';
|
|
4
4
|
import { ItCheckboxBase } from '@italia/checkbox/it-checkbox-base.js';
|
|
@@ -319,6 +319,7 @@ progress {
|
|
|
319
319
|
--bsi-form-control-label-color: var(--bsi-color-text-base);
|
|
320
320
|
--bsi-form-control-text-color: var(--bsi-color-text-secondary);
|
|
321
321
|
--bsi-form-control-font-size: var(--bsi-body-font-size);
|
|
322
|
+
--bsi-form-select-indicator: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='hsl%280, 0%, 32%%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
|
|
322
323
|
--bsi-form-group-spacing-y: var(--bsi-spacing-m);
|
|
323
324
|
--bsi-form-checkbox-border-color: var(--bsi-color-border-secondary);
|
|
324
325
|
--bsi-form-checkbox-border-radius: var(--bsi-radius-smooth);
|
|
@@ -345,6 +346,7 @@ select {
|
|
|
345
346
|
background-color: var(--bsi-form-control-background-color);
|
|
346
347
|
color: var(--bsi-form-control-text-color);
|
|
347
348
|
font-size: var(--bsi-form-control-font-size);
|
|
349
|
+
line-height: var(--bsi-font-leading-2);
|
|
348
350
|
}
|
|
349
351
|
input.disabled, input:disabled,
|
|
350
352
|
textarea.disabled,
|
|
@@ -357,48 +359,44 @@ select:disabled {
|
|
|
357
359
|
color: var(--bsi-color-text-disabled);
|
|
358
360
|
}
|
|
359
361
|
|
|
362
|
+
input,
|
|
363
|
+
select {
|
|
364
|
+
padding-block: var(--bsi-spacing-3xs);
|
|
365
|
+
}
|
|
366
|
+
|
|
360
367
|
/* stylelint-disable-next-line no-duplicate-selectors */
|
|
361
368
|
input:focus,
|
|
362
369
|
textarea:focus {
|
|
363
|
-
outline:
|
|
370
|
+
outline: var(--bsi-focus-outer-width) solid transparent;
|
|
364
371
|
outline-offset: 3px;
|
|
365
|
-
box-shadow: 0 0 0
|
|
372
|
+
box-shadow: 0 0 0 var(--bsi-focus-inner-width) var(--bsi-focus-inner-color), 0 0 0 calc(var(--bsi-focus-inner-width) + var(--bsi-focus-outer-width)) var(--bsi-focus-outer-color) !important;
|
|
366
373
|
}
|
|
367
374
|
|
|
368
375
|
input::file-selector-button {
|
|
369
|
-
margin:
|
|
370
|
-
padding: 0
|
|
371
|
-
|
|
372
|
-
border
|
|
376
|
+
margin: 0;
|
|
377
|
+
padding: 0;
|
|
378
|
+
padding-inline-end: var(--bsi-spacing-m);
|
|
379
|
+
border: 0;
|
|
373
380
|
border-radius: 0;
|
|
374
|
-
|
|
375
|
-
color:
|
|
381
|
+
color: var(--bsi-color-text-base);
|
|
382
|
+
background-color: transparent;
|
|
376
383
|
pointer-events: none;
|
|
377
|
-
margin-inline-end: 0.75rem;
|
|
378
|
-
border-inline-end-width: 0;
|
|
379
|
-
background-color: hsl(0, 0%, 100%);
|
|
380
|
-
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
381
|
-
}
|
|
382
|
-
@media (prefers-reduced-motion: reduce) {
|
|
383
|
-
input::file-selector-button {
|
|
384
|
-
transition: none;
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
input:hover:not(:disabled):not([readonly])::file-selector-button {
|
|
388
|
-
background-color: rgb(242.25, 242.25, 242.25);
|
|
389
384
|
}
|
|
390
385
|
input[type=file] {
|
|
391
386
|
overflow: hidden;
|
|
387
|
+
padding-block: max(0px, (var(--bsi-form-control-height) - 1lh - 2px) / 2);
|
|
392
388
|
}
|
|
393
389
|
input[type=file]:not(:disabled):not([readonly]) {
|
|
394
390
|
cursor: pointer;
|
|
395
391
|
}
|
|
396
392
|
input::-webkit-date-and-time-value {
|
|
397
|
-
height:
|
|
393
|
+
height: 1lh;
|
|
394
|
+
padding-block: max(0px, (var(--bsi-form-control-height) - 2px - 2 * var(--bsi-spacing-3xs) - 1lh) / 2);
|
|
395
|
+
text-align: start;
|
|
398
396
|
}
|
|
399
397
|
|
|
400
398
|
select {
|
|
401
|
-
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='hsl%280, 0%, 32%%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
|
|
399
|
+
background-image: var(--bsi-form-select-indicator, url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='hsl%280, 0%, 32%%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"));
|
|
402
400
|
background-repeat: no-repeat;
|
|
403
401
|
background-position: right var(--bsi-form-control-spacing) center;
|
|
404
402
|
background-size: 16px 12px;
|
|
@@ -407,7 +405,7 @@ select {
|
|
|
407
405
|
select:focus {
|
|
408
406
|
border-color: hsl(210, 17%, 44%);
|
|
409
407
|
outline: 0;
|
|
410
|
-
box-shadow: 0 0 0 0.25rem rgba(0
|
|
408
|
+
box-shadow: 0 0 0 0.25rem rgba(0%, 40%, 80%, 0.25);
|
|
411
409
|
}
|
|
412
410
|
select[multiple], select[size]:not([size="1"]) {
|
|
413
411
|
padding-right: 0.75rem;
|
|
@@ -569,9 +567,9 @@ input::-webkit-datetime-edit {
|
|
|
569
567
|
}
|
|
570
568
|
.form-check [type=checkbox]:focus + label,
|
|
571
569
|
.form-check [type=radio]:focus + label {
|
|
572
|
-
border-color:
|
|
573
|
-
box-shadow: 0 0 0
|
|
574
|
-
outline:
|
|
570
|
+
border-color: var(--bsi-focus-outer-color) !important;
|
|
571
|
+
box-shadow: 0 0 0 var(--bsi-focus-inner-width) var(--bsi-focus-inner-color), 0 0 0 calc(var(--bsi-focus-inner-width) + var(--bsi-focus-outer-width)) var(--bsi-focus-outer-color) !important;
|
|
572
|
+
outline: var(--bsi-focus-outer-width) solid transparent !important;
|
|
575
573
|
outline-offset: 3px !important;
|
|
576
574
|
}
|
|
577
575
|
.form-check [type=checkbox]:focus[data-focus-mouse=true] + label,
|
|
@@ -592,12 +590,14 @@ input::-webkit-datetime-edit {
|
|
|
592
590
|
}
|
|
593
591
|
.form-check input[type=checkbox] + label::after {
|
|
594
592
|
top: 0;
|
|
593
|
+
top: max(0px, (1lh - 20px) / 2);
|
|
595
594
|
width: 20px;
|
|
596
595
|
height: 20px;
|
|
597
596
|
border-radius: var(--bsi-form-checkbox-border-radius);
|
|
598
597
|
}
|
|
599
598
|
.form-check input[type=checkbox]:checked + label::before {
|
|
600
599
|
top: 3px;
|
|
600
|
+
top: calc(3px + max(0px, (1lh - 20px) / 2));
|
|
601
601
|
left: 3px;
|
|
602
602
|
width: 6px;
|
|
603
603
|
height: 12px;
|
|
@@ -621,6 +621,7 @@ input::-webkit-datetime-edit {
|
|
|
621
621
|
}
|
|
622
622
|
.form-check input[type=checkbox]:not(:checked) + label::before {
|
|
623
623
|
top: 10px;
|
|
624
|
+
top: calc(10px + max(0px, (1lh - 20px) / 2));
|
|
624
625
|
left: 6px;
|
|
625
626
|
width: 0;
|
|
626
627
|
height: 0;
|
|
@@ -644,6 +645,7 @@ input::-webkit-datetime-edit {
|
|
|
644
645
|
.form-check input[type=radio] + label::after, .form-check input[type=radio] + label::before {
|
|
645
646
|
position: absolute;
|
|
646
647
|
top: 0;
|
|
648
|
+
top: max(0px, (1lh - 20px) / 2);
|
|
647
649
|
left: 0;
|
|
648
650
|
z-index: 0;
|
|
649
651
|
content: "";
|
|
@@ -654,6 +656,14 @@ input::-webkit-datetime-edit {
|
|
|
654
656
|
border-radius: var(--bsi-radius-rounded);
|
|
655
657
|
transition: all var(--bsi-transition-instant) ease-out;
|
|
656
658
|
}
|
|
659
|
+
.form-check input[type=radio] + label::after {
|
|
660
|
+
top: 4px;
|
|
661
|
+
top: calc(4px + max(0px, (1lh - 20px) / 2));
|
|
662
|
+
left: 4px;
|
|
663
|
+
width: 12px;
|
|
664
|
+
height: 12px;
|
|
665
|
+
border-width: 0;
|
|
666
|
+
}
|
|
657
667
|
.form-check input[type=radio]:not(:checked) + label::after, .form-check input[type=radio]:not(:checked) + label::before {
|
|
658
668
|
border-color: var(--bsi-form-checkbox-border-color);
|
|
659
669
|
}
|
|
@@ -665,7 +675,7 @@ input::-webkit-datetime-edit {
|
|
|
665
675
|
z-index: 0;
|
|
666
676
|
border-color: var(--bsi-form-checked-color);
|
|
667
677
|
background-color: var(--bsi-form-checked-color);
|
|
668
|
-
transform:
|
|
678
|
+
transform: none;
|
|
669
679
|
}
|
|
670
680
|
.form-check input[type=radio]:checked + label::before {
|
|
671
681
|
border-color: var(--bsi-form-checked-color);
|
|
@@ -714,12 +724,16 @@ input::-webkit-datetime-edit {
|
|
|
714
724
|
.form-check.form-check-group input[type=radio]:checked + label::before {
|
|
715
725
|
right: 0;
|
|
716
726
|
}
|
|
727
|
+
.form-check.form-check-group input[type=radio] + label::after {
|
|
728
|
+
right: 4px;
|
|
729
|
+
}
|
|
717
730
|
.form-check.form-check-group input.semi-checked:not(:checked) + label::before {
|
|
718
731
|
right: 4px;
|
|
719
732
|
left: auto;
|
|
720
733
|
}
|
|
721
734
|
.form-check input.semi-checked:not(:checked) + label::before {
|
|
722
735
|
top: 12px;
|
|
736
|
+
top: calc(12px + max(0px, (1lh - 20px) / 2));
|
|
723
737
|
left: 4px;
|
|
724
738
|
width: 12px;
|
|
725
739
|
height: 2px;
|
|
@@ -790,163 +804,12 @@ input::-webkit-datetime-edit {
|
|
|
790
804
|
--bsi-form-control-spacing: var(--bsi-spacing-xxs) var(--bsi-spacing-3xs);
|
|
791
805
|
--bsi-form-control-font-size: var(--bsi-label-font-size);
|
|
792
806
|
}
|
|
793
|
-
.form-control-sm::file-selector-button {
|
|
794
|
-
padding: 0.25rem 0.5rem;
|
|
795
|
-
margin: -0.25rem -0.5rem;
|
|
796
|
-
margin-inline-end: 0.5rem;
|
|
797
|
-
}
|
|
798
807
|
|
|
799
808
|
.form-control-lg {
|
|
800
809
|
--bsi-form-control-font-size: var(--bsi-lead-font-size);
|
|
801
810
|
}
|
|
802
|
-
.form-control-lg
|
|
803
|
-
|
|
804
|
-
margin: -0.5rem -1rem;
|
|
805
|
-
margin-inline-end: 1rem;
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
textarea.form-control {
|
|
809
|
-
min-height: 2.5rem;
|
|
810
|
-
border: 1px solid hsl(210, 17%, 44%);
|
|
811
|
-
}
|
|
812
|
-
textarea.form-control-sm {
|
|
813
|
-
min-height: calc(1.5em + 0.5rem);
|
|
814
|
-
}
|
|
815
|
-
textarea.form-control-lg {
|
|
816
|
-
min-height: calc(1.5em + 1rem);
|
|
817
|
-
}
|
|
818
|
-
|
|
819
|
-
.form-control-color {
|
|
820
|
-
width: 3rem;
|
|
821
|
-
height: 2.5rem;
|
|
822
|
-
padding: 0.375rem;
|
|
823
|
-
}
|
|
824
|
-
.form-control-color:not(:disabled):not([readonly]) {
|
|
825
|
-
cursor: pointer;
|
|
826
|
-
}
|
|
827
|
-
.form-control-color::-moz-color-swatch {
|
|
828
|
-
border: 0 !important;
|
|
829
|
-
border-radius: 0;
|
|
830
|
-
}
|
|
831
|
-
.form-control-color::-webkit-color-swatch {
|
|
832
|
-
border-radius: 0;
|
|
833
|
-
}
|
|
834
|
-
.form-control-color.form-control-sm {
|
|
835
|
-
height: calc(1.5em + 0.5rem);
|
|
836
|
-
}
|
|
837
|
-
.form-control-color.form-control-lg {
|
|
838
|
-
height: calc(1.5em + 1rem);
|
|
839
|
-
}
|
|
840
|
-
|
|
841
|
-
.form-check-reverse {
|
|
842
|
-
padding-right: 1.5em;
|
|
843
|
-
padding-left: 0;
|
|
844
|
-
text-align: right;
|
|
845
|
-
}
|
|
846
|
-
.form-check-reverse .form-check-input {
|
|
847
|
-
float: right;
|
|
848
|
-
margin-right: -1.5em;
|
|
849
|
-
margin-left: 0;
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
.form-check-input {
|
|
853
|
-
width: 1em;
|
|
854
|
-
height: 1em;
|
|
855
|
-
margin-top: 0.25em;
|
|
856
|
-
vertical-align: top;
|
|
857
|
-
background-color: hsl(0, 0%, 100%);
|
|
858
|
-
background-repeat: no-repeat;
|
|
859
|
-
background-position: center;
|
|
860
|
-
background-size: contain;
|
|
861
|
-
border: 1px solid rgba(0, 0, 0, 0.25);
|
|
862
|
-
appearance: none;
|
|
863
|
-
print-color-adjust: exact;
|
|
864
|
-
}
|
|
865
|
-
.form-check-input[type=checkbox] {
|
|
866
|
-
border-radius: 0.25em;
|
|
867
|
-
}
|
|
868
|
-
.form-check-input[type=radio] {
|
|
869
|
-
border-radius: 50%;
|
|
870
|
-
}
|
|
871
|
-
.form-check-input:active {
|
|
872
|
-
filter: brightness(90%);
|
|
873
|
-
}
|
|
874
|
-
.form-check-input:focus {
|
|
875
|
-
border-color: hsl(210, 17%, 44%);
|
|
876
|
-
outline: 0;
|
|
877
|
-
box-shadow: 0 0 0 0.25rem rgba(0, 102, 204, 0.25);
|
|
878
|
-
}
|
|
879
|
-
.form-check-input:checked {
|
|
880
|
-
background-color: hsl(210, 100%, 40%);
|
|
881
|
-
border-color: hsl(210, 100%, 40%);
|
|
882
|
-
}
|
|
883
|
-
.form-check-input:checked[type=checkbox] {
|
|
884
|
-
background-image: escape-svg(url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='none' stroke='hsl(0, 0%, 100%)' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/></svg>"));
|
|
885
|
-
}
|
|
886
|
-
.form-check-input:checked[type=radio] {
|
|
887
|
-
background-image: escape-svg(url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'><circle r='2' fill='hsl(0, 0%, 100%)'/></svg>"));
|
|
888
|
-
}
|
|
889
|
-
.form-check-input[type=checkbox]:indeterminate {
|
|
890
|
-
background-color: hsl(210, 100%, 40%);
|
|
891
|
-
border-color: hsl(210, 100%, 40%);
|
|
892
|
-
background-image: escape-svg(url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='none' stroke='hsl(0, 0%, 100%)' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/></svg>"));
|
|
893
|
-
}
|
|
894
|
-
.form-check-input:disabled {
|
|
895
|
-
pointer-events: none;
|
|
896
|
-
filter: none;
|
|
897
|
-
opacity: 0.5;
|
|
898
|
-
}
|
|
899
|
-
.form-check-input[disabled] ~ .form-check-label, .form-check-input:disabled ~ .form-check-label {
|
|
900
|
-
cursor: default;
|
|
901
|
-
opacity: 0.5;
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
.form-switch {
|
|
905
|
-
padding-left: 2.5em;
|
|
906
|
-
}
|
|
907
|
-
.form-switch .form-check-input {
|
|
908
|
-
width: 2em;
|
|
909
|
-
margin-left: -2.5em;
|
|
910
|
-
background-image: escape-svg(url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'><circle r='3' fill='rgba(0, 0, 0, 0.25)'/></svg>"));
|
|
911
|
-
background-position: left center;
|
|
912
|
-
border-radius: 2em;
|
|
913
|
-
transition: background-position 0.15s ease-in-out;
|
|
914
|
-
}
|
|
915
|
-
@media (prefers-reduced-motion: reduce) {
|
|
916
|
-
.form-switch .form-check-input {
|
|
917
|
-
transition: none;
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
.form-switch .form-check-input:focus {
|
|
921
|
-
background-image: escape-svg(url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'><circle r='3' fill='hsl(210, 17%, 44%)'/></svg>"));
|
|
922
|
-
}
|
|
923
|
-
.form-switch .form-check-input:checked {
|
|
924
|
-
background-position: right center;
|
|
925
|
-
background-image: escape-svg(url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'><circle r='3' fill='hsl(0, 0%, 100%)'/></svg>"));
|
|
926
|
-
}
|
|
927
|
-
.form-switch.form-check-reverse {
|
|
928
|
-
padding-right: 2.5em;
|
|
929
|
-
padding-left: 0;
|
|
930
|
-
}
|
|
931
|
-
.form-switch.form-check-reverse .form-check-input {
|
|
932
|
-
margin-right: -2.5em;
|
|
933
|
-
margin-left: 0;
|
|
934
|
-
}
|
|
935
|
-
|
|
936
|
-
.form-check-inline {
|
|
937
|
-
display: inline-block;
|
|
938
|
-
margin-right: 1rem;
|
|
939
|
-
}
|
|
940
|
-
|
|
941
|
-
.btn-check {
|
|
942
|
-
position: absolute;
|
|
943
|
-
clip: rect(0, 0, 0, 0);
|
|
944
|
-
pointer-events: none;
|
|
945
|
-
}
|
|
946
|
-
.btn-check[disabled] + .btn, .btn-check:disabled + .btn {
|
|
947
|
-
pointer-events: none;
|
|
948
|
-
filter: none;
|
|
949
|
-
opacity: 0.65;
|
|
811
|
+
.form-control-lg, .form-control-lg + .password-icon {
|
|
812
|
+
--bsi-form-control-height: 3rem;
|
|
950
813
|
}
|
|
951
814
|
|
|
952
815
|
.toggles {
|
|
@@ -954,10 +817,10 @@ textarea.form-control-lg {
|
|
|
954
817
|
--bsi-toggle-track-height: 32px;
|
|
955
818
|
--bsi-toggle-track-border-radius: var(--bsi-radius-rounded);
|
|
956
819
|
--bsi-toggle-track-background: var(--bsi-color-background-secondary-light);
|
|
957
|
-
--bsi-toggle-track-background
|
|
820
|
+
--bsi-toggle-track-checked-background: var(
|
|
958
821
|
--bsi-color-background-primary
|
|
959
822
|
);
|
|
960
|
-
--bsi-toggle-track-background
|
|
823
|
+
--bsi-toggle-track-disabled-background: var(
|
|
961
824
|
--bsi-color-background-disabled
|
|
962
825
|
);
|
|
963
826
|
--bsi-toggle-track-transition: background 0.3s ease;
|
|
@@ -966,10 +829,10 @@ textarea.form-control-lg {
|
|
|
966
829
|
--bsi-toggle-knob-border-radius: 50%;
|
|
967
830
|
--bsi-toggle-knob-background: var(--bsi-color-background-inverse);
|
|
968
831
|
--bsi-toggle-knob-shadow-color: hsla(210, 100%, 40%, 0.15);
|
|
969
|
-
--bsi-toggle-knob-background
|
|
832
|
+
--bsi-toggle-knob-disabled-background: var(
|
|
970
833
|
--bsi-color-background-secondary
|
|
971
834
|
);
|
|
972
|
-
--bsi-toggle-knob-offset
|
|
835
|
+
--bsi-toggle-knob-checked-offset: 28px;
|
|
973
836
|
--bsi-toggle-knob-transition: left 0.3s ease, background 0.1s ease, transform 0.1s ease;
|
|
974
837
|
--bsi-toggle-label-spacing: var(--bsi-spacing-xs);
|
|
975
838
|
}
|
|
@@ -998,9 +861,9 @@ textarea.form-control-lg {
|
|
|
998
861
|
left: 0;
|
|
999
862
|
}
|
|
1000
863
|
.toggles label input[type=checkbox]:focus + .lever {
|
|
1001
|
-
border-color:
|
|
1002
|
-
box-shadow: 0 0 0
|
|
1003
|
-
outline:
|
|
864
|
+
border-color: var(--bsi-focus-outer-color) !important;
|
|
865
|
+
box-shadow: 0 0 0 var(--bsi-focus-inner-width) var(--bsi-focus-inner-color), 0 0 0 calc(var(--bsi-focus-inner-width) + var(--bsi-focus-outer-width)) var(--bsi-focus-outer-color) !important;
|
|
866
|
+
outline: var(--bsi-focus-outer-width) solid transparent !important;
|
|
1004
867
|
outline-offset: 3px !important;
|
|
1005
868
|
}
|
|
1006
869
|
.toggles label input[type=checkbox]:focus[data-focus-mouse=true] + .lever {
|
|
@@ -1036,20 +899,20 @@ textarea.form-control-lg {
|
|
|
1036
899
|
background-color: var(--bsi-toggle-knob-background);
|
|
1037
900
|
}
|
|
1038
901
|
.toggles label input[type=checkbox]:checked + .lever {
|
|
1039
|
-
background-color: var(--bsi-toggle-track-background
|
|
902
|
+
background-color: var(--bsi-toggle-track-checked-background);
|
|
1040
903
|
}
|
|
1041
904
|
.toggles label input[type=checkbox]:checked + .lever:before, .toggles label input[type=checkbox]:checked + .lever:after {
|
|
1042
|
-
left: var(--bsi-toggle-knob-offset
|
|
905
|
+
left: var(--bsi-toggle-knob-checked-offset);
|
|
1043
906
|
}
|
|
1044
907
|
[disabled] .toggles label input[type=checkbox] + .lever, .toggles label input[type=checkbox][disabled] + .lever {
|
|
1045
|
-
background-color: var(--bsi-toggle-track-background
|
|
908
|
+
background-color: var(--bsi-toggle-track-disabled-background);
|
|
1046
909
|
cursor: default;
|
|
1047
910
|
}
|
|
1048
911
|
[disabled] .toggles label input[type=checkbox] + .lever:after, .toggles label input[type=checkbox][disabled] + .lever:after {
|
|
1049
|
-
background-color: var(--bsi-toggle-knob-background
|
|
912
|
+
background-color: var(--bsi-toggle-knob-disabled-background);
|
|
1050
913
|
}
|
|
1051
914
|
[disabled] .toggles label input[type=checkbox]:checked + .lever:after, .toggles label input[type=checkbox][disabled]:checked + .lever:after {
|
|
1052
|
-
background-color: var(--bsi-toggle-knob-background
|
|
915
|
+
background-color: var(--bsi-toggle-knob-disabled-background);
|
|
1053
916
|
}
|
|
1054
917
|
|
|
1055
918
|
.form-feedback {
|
|
@@ -1058,21 +921,26 @@ textarea.form-control-lg {
|
|
|
1058
921
|
font-size: 0.75rem;
|
|
1059
922
|
}
|
|
1060
923
|
|
|
1061
|
-
.input-group-text:has(~ [data-focus-mouse=true]:not(.btn)),
|
|
1062
|
-
[data-focus-mouse=true]:not(.btn) ~ .input-group-text,
|
|
1063
|
-
button:has(~ [data-focus-mouse=true]:not(.btn)),
|
|
1064
|
-
[data-focus-mouse=true]:not(.btn) + button {
|
|
924
|
+
.input-group .input-group-text:has(~ [data-focus-mouse=true]:not(.btn)),
|
|
925
|
+
.input-group [data-focus-mouse=true]:not(.btn) ~ .input-group-text,
|
|
926
|
+
.input-group button:has(~ [data-focus-mouse=true]:not(.btn)),
|
|
927
|
+
.input-group [data-focus-mouse=true]:not(.btn) + button {
|
|
1065
928
|
border-color: inherit !important;
|
|
1066
929
|
box-shadow: none !important;
|
|
1067
930
|
outline: none !important;
|
|
1068
931
|
}
|
|
1069
|
-
|
|
1070
|
-
.input-group-
|
|
1071
|
-
.
|
|
1072
|
-
|
|
1073
|
-
.is-invalid + button {
|
|
932
|
+
.input-group .input-group-text:has(~ .is-invalid),
|
|
933
|
+
.input-group .is-invalid ~ .input-group-text,
|
|
934
|
+
.input-group button:has(~ .is-invalid),
|
|
935
|
+
.input-group .is-invalid + button {
|
|
1074
936
|
border-color: var(--bsi-color-border-danger) !important;
|
|
1075
937
|
}
|
|
938
|
+
.input-group .input-group-text:has(~ .is-valid),
|
|
939
|
+
.input-group .is-valid ~ .input-group-text,
|
|
940
|
+
.input-group button:has(~ .is-valid),
|
|
941
|
+
.input-group .is-valid + button {
|
|
942
|
+
border-color: var(--bsi-color-border-success);
|
|
943
|
+
}
|
|
1076
944
|
|
|
1077
945
|
.sr-only-justvalidate-bi {
|
|
1078
946
|
display: none;
|
|
@@ -1087,17 +955,20 @@ button:has(~ .is-invalid),
|
|
|
1087
955
|
padding-right: calc(1.5em + 0.75rem + var(--bsi-form-control-spacing) + 1rem) !important;
|
|
1088
956
|
}
|
|
1089
957
|
|
|
1090
|
-
.was-validated
|
|
958
|
+
.was-validated .form-control:valid,
|
|
959
|
+
.was-validated select:valid,
|
|
1091
960
|
.is-valid {
|
|
1092
961
|
border-color: var(--bsi-color-border-success) !important;
|
|
1093
962
|
background-image: url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="%23008055" xmlns="http://www.w3.org/2000/svg"><path d="M9.6,16.9L4,11.4l0.8-0.7l4.8,4.8l8.5-8.4l0.7,0.7L9.6,16.9z" /></svg>');
|
|
1094
963
|
}
|
|
1095
|
-
.was-validated
|
|
964
|
+
.was-validated .form-control:valid ~ .warning-feedback,
|
|
965
|
+
.was-validated select:valid ~ .warning-feedback,
|
|
1096
966
|
.is-valid ~ .warning-feedback {
|
|
1097
967
|
display: block;
|
|
1098
968
|
}
|
|
1099
969
|
|
|
1100
|
-
.was-validated
|
|
970
|
+
.was-validated .form-control:invalid,
|
|
971
|
+
.was-validated select:invalid,
|
|
1101
972
|
.is-invalid {
|
|
1102
973
|
border-color: var(--bsi-color-border-danger) !important;
|
|
1103
974
|
background-image: url('data:image/svg+xml,<svg width="24" fill="%23cc334d" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.7,12l6.7,6.6l-0.8,0.8L12,12.7l-6.6,6.7l-0.8-0.8l6.7-6.6L4.6,5.4l0.8-0.8l6.6,6.7l6.6-6.7l0.8,0.8L12.7,12z" /></svg>');
|
|
@@ -1108,13 +979,6 @@ button:has(~ .is-invalid),
|
|
|
1108
979
|
background-image: url('data:image/svg+xml,<svg width="24" height="24" fill="%23995c00" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.5,17h-1V2h1V17z M12.5,20h-1v2h1V20z" /></svg>');
|
|
1109
980
|
}
|
|
1110
981
|
|
|
1111
|
-
.input-group-text:has(~ .is-valid),
|
|
1112
|
-
.is-valid ~ .input-group-text,
|
|
1113
|
-
button:has(~ .is-valid),
|
|
1114
|
-
.is-valid + button {
|
|
1115
|
-
border-color: var(--bsi-color-border-success);
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1118
982
|
.is-valid + .input-group-text.align-buttons,
|
|
1119
983
|
.is-invalid + .input-group-text.align-buttons {
|
|
1120
984
|
right: 30px;
|
|
@@ -1150,9 +1014,9 @@ textarea.form-control {
|
|
|
1150
1014
|
outline: none !important;
|
|
1151
1015
|
}
|
|
1152
1016
|
.toggles label:has(input[type=checkbox]:focus-visible) {
|
|
1153
|
-
border-color:
|
|
1154
|
-
box-shadow: 0 0 0
|
|
1155
|
-
outline:
|
|
1017
|
+
border-color: var(--bsi-focus-outer-color) !important;
|
|
1018
|
+
box-shadow: 0 0 0 var(--bsi-focus-inner-width) var(--bsi-focus-inner-color), 0 0 0 calc(var(--bsi-focus-inner-width) + var(--bsi-focus-outer-width)) var(--bsi-focus-outer-color) !important;
|
|
1019
|
+
outline: var(--bsi-focus-outer-width) solid transparent !important;
|
|
1156
1020
|
outline-offset: 3px !important;
|
|
1157
1021
|
}
|
|
1158
1022
|
.toggles label:has(input[type=checkbox]:focus-visible) input,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"it-toggle.js","sources":["../../../src/it-toggle.ts"],"sourcesContent":["import { customElement } from 'lit/decorators.js';\nimport { html } from 'lit';\nimport { ItCheckboxBase } from '@italia/checkbox/it-checkbox-base.js';\n\nimport styles from './toggle.scss';\n\n/**\n * @element it-toggle\n */\n@customElement('it-toggle')\nexport class ItToggle extends ItCheckboxBase {\n static override styles = [ItCheckboxBase.styles, styles];\n\n type = 'checkbox'; // Toggle is still a checkbox input type\n\n override render() {\n const supportTextId = `${this._id}-support-text`;\n\n const supportTextRender = this.getSupportTextRender(supportTextId);\n\n const showValidation = this.formControlController.submittedOnce || this.customValidation; // true; // this._touched || this.customValidation ;\n const validityMessage = (showValidation ? (this.validationMessage ?? '') : '') ?? '';\n\n const invalid =\n validityMessage?.length > 0 || (!this.customValidation && this.inputElement?.checkValidity() === false);\n\n const validityMessageRender = this.getValidityMessageRender(validityMessage);\n\n const wrapperClasses = this.getWrapperClasses();\n return html`\n <div class=\"${wrapperClasses}\" part=\"toggle-wrapper input-wrapper\">\n <div class=\"toggles\">\n <label for=\"${this._id}\" part=\"label focusable\">\n <slot name=\"label\"></slot>\n ${this._renderInput(supportTextId, invalid, validityMessage)}\n <span class=\"lever\"></span>\n </label>\n </div>\n ${validityMessageRender} ${supportTextRender}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-toggle': ItToggle;\n }\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"it-toggle.js","sources":["../../../src/it-toggle.ts"],"sourcesContent":["import { customElement } from 'lit/decorators.js';\nimport { html } from 'lit';\nimport { ItCheckboxBase } from '@italia/checkbox/it-checkbox-base.js';\n\nimport styles from './toggle.scss';\n\n/**\n * @element it-toggle\n */\n@customElement('it-toggle')\nexport class ItToggle extends ItCheckboxBase {\n static override styles = [ItCheckboxBase.styles, styles];\n\n type = 'checkbox'; // Toggle is still a checkbox input type\n\n override render() {\n const supportTextId = `${this._id}-support-text`;\n\n const supportTextRender = this.getSupportTextRender(supportTextId);\n\n const showValidation = this.formControlController.submittedOnce || this.customValidation; // true; // this._touched || this.customValidation ;\n const validityMessage = (showValidation ? (this.validationMessage ?? '') : '') ?? '';\n\n const invalid =\n validityMessage?.length > 0 || (!this.customValidation && this.inputElement?.checkValidity() === false);\n\n const validityMessageRender = this.getValidityMessageRender(validityMessage);\n\n const wrapperClasses = this.getWrapperClasses();\n return html`\n <div class=\"${wrapperClasses}\" part=\"toggle-wrapper input-wrapper\">\n <div class=\"toggles\">\n <label for=\"${this._id}\" part=\"label focusable\">\n <slot name=\"label\"></slot>\n ${this._renderInput(supportTextId, invalid, validityMessage)}\n <span class=\"lever\"></span>\n </label>\n </div>\n ${validityMessageRender} ${supportTextRender}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-toggle': ItToggle;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUO,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,cAAc,CAAA;AAArC,IAAA,WAAA,GAAA;;QAGL,IAAA,CAAA,IAAI,GAAG,UAAU;IA6BnB;IA3BW,MAAM,GAAA;AACb,QAAA,MAAM,aAAa,GAAG,CAAA,EAAG,IAAI,CAAC,GAAG,eAAe;QAEhD,MAAM,iBAAiB,GAAG,IAAI,CAAC,oBAAoB,CAAC,aAAa,CAAC;QAElE,MAAM,cAAc,GAAG,IAAI,CAAC,qBAAqB,CAAC,aAAa,IAAI,IAAI,CAAC,gBAAgB;QACxF,MAAM,eAAe,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,iBAAiB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE;QAEpF,MAAM,OAAO,GACX,eAAe,EAAE,MAAM,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,YAAY,EAAE,aAAa,EAAE,KAAK,KAAK,CAAC;QAEzG,MAAM,qBAAqB,GAAG,IAAI,CAAC,wBAAwB,CAAC,eAAe,CAAC;AAE5E,QAAA,MAAM,cAAc,GAAG,IAAI,CAAC,iBAAiB,EAAE;AAC/C,QAAA,OAAO,IAAI,CAAA;oBACK,cAAc,CAAA;;AAEV,sBAAA,EAAA,IAAI,CAAC,GAAG,CAAA;;cAElB,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,OAAO,EAAE,eAAe,CAAC;;;;AAI9D,QAAA,EAAA,qBAAqB,IAAI,iBAAiB;;KAE/C;IACH;;AA9BgB,QAAA,CAAA,MAAM,GAAG,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAjC;AADX,QAAQ,GAAA,UAAA,CAAA;IADpB,aAAa,CAAC,WAAW;AACb,CAAA,EAAA,QAAQ,CAgCpB;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@italia/toggle",
|
|
3
3
|
"description": "Web component it-toggle del Design system .italia",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.8",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"styles"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"bootstrap-italia": "3.0.0-beta.
|
|
38
|
+
"bootstrap-italia": "3.0.0-beta.9",
|
|
39
39
|
"lit": "^3.3.0",
|
|
40
|
-
"@italia/checkbox": "^1.0.0-beta.
|
|
41
|
-
"@italia/globals": "^1.0.0-beta.
|
|
42
|
-
"@italia/i18n": "^1.0.0-beta.
|
|
40
|
+
"@italia/checkbox": "^1.0.0-beta.8",
|
|
41
|
+
"@italia/globals": "^1.0.0-beta.8",
|
|
42
|
+
"@italia/i18n": "^1.0.0-beta.8"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@custom-elements-manifest/analyzer": "^0.10.3",
|