@italia/checkbox 1.0.0-beta.0 → 1.0.0-beta.1

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/README.md CHANGED
@@ -1,75 +1,11 @@
1
- # \<it-checkbox>
1
+ # <it-checkbox>
2
2
 
3
- This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
3
+ This package is part of [dev-kit-italia](https://italia.github.io/dev-kit-italia), a Web Components kit for the **.italia** design-system.
4
4
 
5
- ## Installation
5
+ ## Installation and usage
6
6
 
7
- ```bash
8
- npm i @italia/checkbox
9
- ```
7
+ Most users want to install the full kit by installing [`@italia/dev-kit-italia`](https://npmjs.com/package/@italia/dev-kit-italia), but you have the option of installing this single Web Component separately if needed. Please find detailed installation and usage instructions in the [official documentation](https://italia.github.io/dev-kit-italia/?path=/docs/introduzione--documentazione).
10
8
 
11
- ## Usage
9
+ ## Documentation
12
10
 
13
- ```html
14
- <script type="module">
15
- import '@italia/checkbox';
16
- </script>
17
-
18
- <it-checkbox></it-checkbox>
19
- ```
20
-
21
- ## Linting and formatting
22
-
23
- To scan the project for linting and formatting errors, run
24
-
25
- ```bash
26
- npm run lint
27
- ```
28
-
29
- To automatically fix linting and formatting errors, run
30
-
31
- ```bash
32
- npm run format
33
- ```
34
-
35
- ## Testing with Web Test Runner
36
-
37
- To execute a single test run:
38
-
39
- ```bash
40
- npm run test
41
- ```
42
-
43
- To run the tests in interactive watch mode run:
44
-
45
- ```bash
46
- npm run test:watch
47
- ```
48
-
49
- ## Demoing with Storybook
50
-
51
- To run a local instance of Storybook for your component, run
52
-
53
- ```bash
54
- npm run storybook
55
- ```
56
-
57
- To build a production version of Storybook, run
58
-
59
- ```bash
60
- npm run storybook:build
61
- ```
62
-
63
- ## Tooling configs
64
-
65
- For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
66
-
67
- If you customize the configuration a lot, you can consider moving them to individual files.
68
-
69
- ## Local Demo with `web-dev-server`
70
-
71
- ```bash
72
- npm start
73
- ```
74
-
75
- To run a local development server that serves the basic demo located in `demo/index.html`
11
+ Find the usage instructions for this specific component in its [dedicated documentation page](https://italia.github.io/dev-kit-italia/?path=/docs/componenti-form-checkbox--documentazione).
package/dist/src/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export { ItCheckbox } from './it-checkbox.js';
2
2
  export { ItCheckboxGroup } from './it-checkbox-group.js';
3
3
  import './it-checkbox-base.js';
4
- import '../index-B5nLzYdF.js';
4
+ import '../index-BEse4_RX.js';
5
5
  import 'lit/directive.js';
6
6
  import 'lit';
7
7
  import 'lit/decorators.js';
@@ -1,4 +1,4 @@
1
- import { _ as __decorate, a as __metadata, F as FormControl, b as FormControlController, s as setAttributes } from '../index-B5nLzYdF.js';
1
+ import { _ as __decorate, a as __metadata, F as FormControl, b as FormControlController, s as setAttributes } from '../index-BEse4_RX.js';
2
2
  import { css, html } from 'lit';
3
3
  import { property, queryAssignedElements } from 'lit/decorators.js';
4
4
  import { ifDefined } from 'lit/directives/if-defined.js';
@@ -546,8 +546,8 @@ input::-webkit-datetime-edit {
546
546
  .form-check [type=checkbox],
547
547
  .form-check [type=radio] {
548
548
  position: absolute;
549
- top: 9px;
550
- left: 9px;
549
+ top: 0;
550
+ left: 0;
551
551
  width: auto;
552
552
  margin-top: 0;
553
553
  margin-left: 0;
@@ -628,6 +628,9 @@ input::-webkit-datetime-edit {
628
628
  height: 0;
629
629
  border-color: transparent;
630
630
  }
631
+ .form-check input[type=checkbox] + label:hover::after {
632
+ border-color: var(--bsi-color-border-secondary-hover);
633
+ }
631
634
  .form-check input[type=checkbox]:disabled + label {
632
635
  opacity: 1;
633
636
  cursor: not-allowed;
@@ -669,6 +672,9 @@ input::-webkit-datetime-edit {
669
672
  .form-check input[type=radio]:checked + label::before {
670
673
  border-color: var(--bsi-form-checked-color);
671
674
  }
675
+ .form-check input[type=radio] + label:hover::before {
676
+ border-color: var(--bsi-color-border-secondary-hover);
677
+ }
672
678
  .form-check input[type=radio]:disabled + label {
673
679
  cursor: not-allowed;
674
680
  }
@@ -773,7 +779,7 @@ input::-webkit-datetime-edit {
773
779
  .form-control {
774
780
  background-repeat: no-repeat;
775
781
  background-position: center right;
776
- background-size: 45px 30%;
782
+ background-size: 45px 20px;
777
783
  }
778
784
  .form-control:disabled {
779
785
  cursor: not-allowed;
@@ -781,20 +787,6 @@ input::-webkit-datetime-edit {
781
787
  border: 0;
782
788
  color: var(--bsi-color-text-disabled);
783
789
  }
784
- .was-validated .form-control:valid, .form-control.is-valid {
785
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23008055' viewBox='0 0 192 512'%3E%3Cpath d='M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z'/%3E%3C/svg%3E");
786
- }
787
- .was-validated .form-control:invalid, .form-control.is-invalid {
788
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23cc334d' viewBox='0 0 384 512'%3E%3Cpath d='M231.6 256l130.1-130.1c4.7-4.7 4.7-12.3 0-17l-22.6-22.6c-4.7-4.7-12.3-4.7-17 0L192 216.4 61.9 86.3c-4.7-4.7-12.3-4.7-17 0l-22.6 22.6c-4.7 4.7-4.7 12.3 0 17L152.4 256 22.3 386.1c-4.7 4.7-4.7 12.3 0 17l22.6 22.6c4.7 4.7 12.3 4.7 17 0L192 295.6l130.1 130.1c4.7 4.7 12.3 4.7 17 0l22.6-22.6c4.7-4.7 4.7-12.3 0-17L231.6 256z'/%3E%3C/svg%3E");
789
- border-color: var(--bsi-color-border-danger);
790
- }
791
- .form-control.warning {
792
- background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M2%2012C2%206.47715%206.47715%202%2012%202C14.6522%202%2017.1957%203.05357%2019.0711%204.92893C20.9464%206.8043%2022%209.34784%2022%2012C22%2017.5228%2017.5228%2022%2012%2022C6.47715%2022%202%2017.5228%202%2012ZM3%2012C3%2016.9706%207.02944%2021%2012%2021C16.9706%2021%2021%2016.9706%2021%2012C21%207.02944%2016.9706%203%2012%203C7.02944%203%203%207.02944%203%2012ZM11.5%2014.2V5.7H12.7V14.2H11.5ZM12.6%2018.3V16.5H11.4V18.3H12.6Z%22/%3E%0A%3C/svg%3E") no-repeat;
793
- border-color: var(--bsi-color-border-warning);
794
- }
795
- .form-control.is-valid ~ .warning-feedback {
796
- display: block;
797
- }
798
790
 
799
791
  .form-control-sm {
800
792
  --bsi-form-control-spacing: var(--bsi-spacing-xxs) var(--bsi-spacing-3xs);
@@ -964,9 +956,6 @@ textarea.form-control-lg {
964
956
  margin-top: 0.25rem;
965
957
  font-size: 0.75rem;
966
958
  }
967
- .form-feedback.just-validate-error-label {
968
- color: var(--bsi-color-text-danger);
969
- }
970
959
 
971
960
  .input-group-text:has(~ [data-focus-mouse=true]:not(.btn)),
972
961
  [data-focus-mouse=true]:not(.btn) ~ .input-group-text,
@@ -988,20 +977,44 @@ button:has(~ .is-invalid),
988
977
  display: none;
989
978
  }
990
979
 
991
- .just-validate-success-field {
992
- border-color: var(--bsi-color-border-success) !important;
980
+ .is-valid,
981
+ .is-invalid {
993
982
  padding-right: calc(1.5em + 0.75rem) !important;
994
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23008055' viewBox='0 0 192 512'%3E%3Cpath d='M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z'/%3E%3C/svg%3E");
983
+ }
984
+ .is-valid[type=number],
985
+ .is-invalid[type=number] {
986
+ padding-right: calc(1.5em + 0.75rem + var(--bsi-form-control-spacing) + 1rem) !important;
995
987
  }
996
988
 
997
- .input-group-text:has(~ .just-validate-success-field),
998
- .just-validate-success-field ~ .input-group-text,
999
- button:has(~ .just-validate-success-field),
1000
- .just-validate-success-field + button {
989
+ .was-validated &:valid,
990
+ .is-valid {
991
+ border-color: var(--bsi-color-border-success) !important;
992
+ 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>');
993
+ }
994
+ .was-validated &:valid ~ .warning-feedback,
995
+ .is-valid ~ .warning-feedback {
996
+ display: block;
997
+ }
998
+
999
+ .was-validated &:invalid,
1000
+ .is-invalid {
1001
+ border-color: var(--bsi-color-border-danger) !important;
1002
+ 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>');
1003
+ }
1004
+
1005
+ .form-control.warning {
1006
+ border-color: var(--bsi-color-border-warning) !important;
1007
+ 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>');
1008
+ }
1009
+
1010
+ .input-group-text:has(~ .is-valid),
1011
+ .is-valid ~ .input-group-text,
1012
+ button:has(~ .is-valid),
1013
+ .is-valid + button {
1001
1014
  border-color: var(--bsi-color-border-success);
1002
1015
  }
1003
1016
 
1004
- .just-validate-success-field + .input-group-text.align-buttons,
1017
+ .is-valid + .input-group-text.align-buttons,
1005
1018
  .is-invalid + .input-group-text.align-buttons {
1006
1019
  right: 30px;
1007
1020
  }
@@ -1010,33 +1023,132 @@ button:has(~ .just-validate-success-field),
1010
1023
  bottom: 22px;
1011
1024
  }
1012
1025
 
1013
- .autocomplete__wrapper .form-feedback.just-validate-error-label {
1026
+ .autocomplete__wrapper .form-feedback {
1014
1027
  position: absolute;
1015
1028
  }
1016
1029
 
1017
1030
  textarea.form-control {
1018
- background-position: top 0.3em right 0.3em !important;
1019
- background-size: 37px 30% !important;
1031
+ background-position: top 0.5em right !important;
1032
+ }
1033
+
1034
+ .text-primary {
1035
+ --bsi-text-opacity: 1;
1036
+ color: rgba(var(--bsi-primary-rgb), var(--bsi-text-opacity)) !important;
1037
+ }
1038
+
1039
+ .text-secondary {
1040
+ --bsi-text-opacity: 1;
1041
+ color: hsl(210, 33%, 28%) !important;
1042
+ }
1043
+
1044
+ .text-success {
1045
+ --bsi-text-opacity: 1;
1046
+ color: rgba(var(--bsi-success-rgb), var(--bsi-text-opacity)) !important;
1020
1047
  }
1021
- textarea.is-invalid {
1022
- border-bottom-style: solid;
1023
- border-bottom-width: 1px;
1048
+
1049
+ .text-info {
1050
+ --bsi-text-opacity: 1;
1051
+ color: rgba(var(--bsi-info-rgb), var(--bsi-text-opacity)) !important;
1024
1052
  }
1025
- textarea.just-validate-success-field {
1026
- border-bottom-style: solid;
1027
- border-bottom-width: 1px;
1053
+
1054
+ .text-warning {
1055
+ --bsi-text-opacity: 1;
1056
+ color: rgba(var(--bsi-warning-rgb), var(--bsi-text-opacity)) !important;
1028
1057
  }
1029
1058
 
1030
- input[type=checkbox].is-invalid,
1031
- input[type=radio].is-invalid {
1032
- --bsi-form-checkbox-border-color: var(--bsi-color-border-danger);
1059
+ .text-danger {
1060
+ --bsi-text-opacity: 1;
1061
+ color: rgba(var(--bsi-danger-rgb), var(--bsi-text-opacity)) !important;
1033
1062
  }
1034
1063
 
1035
- select.is-invalid {
1036
- border: 1px solid var(--bsi-color-border-danger);
1064
+ .text-light {
1065
+ --bsi-text-opacity: 1;
1066
+ color: rgba(var(--bsi-light-rgb), var(--bsi-text-opacity)) !important;
1037
1067
  }
1038
- select.just-validate-success-field {
1039
- border: 1px solid var(--bsi-color-border-success);
1068
+
1069
+ .text-dark {
1070
+ --bsi-text-opacity: 1;
1071
+ color: rgba(var(--bsi-dark-rgb), var(--bsi-text-opacity)) !important;
1072
+ }
1073
+
1074
+ .text-black {
1075
+ --bsi-text-opacity: 1;
1076
+ color: rgba(var(--bsi-black-rgb), var(--bsi-text-opacity)) !important;
1077
+ }
1078
+
1079
+ .text-white {
1080
+ --bsi-text-opacity: 1;
1081
+ color: rgba(var(--bsi-white-rgb), var(--bsi-text-opacity)) !important;
1082
+ }
1083
+
1084
+ .text-100 {
1085
+ --bsi-text-opacity: 1;
1086
+ color: rgba(var(--bsi-100-rgb), var(--bsi-text-opacity)) !important;
1087
+ }
1088
+
1089
+ .text-200 {
1090
+ --bsi-text-opacity: 1;
1091
+ color: rgba(var(--bsi-200-rgb), var(--bsi-text-opacity)) !important;
1092
+ }
1093
+
1094
+ .text-300 {
1095
+ --bsi-text-opacity: 1;
1096
+ color: rgba(var(--bsi-300-rgb), var(--bsi-text-opacity)) !important;
1097
+ }
1098
+
1099
+ .text-400 {
1100
+ --bsi-text-opacity: 1;
1101
+ color: rgba(var(--bsi-400-rgb), var(--bsi-text-opacity)) !important;
1102
+ }
1103
+
1104
+ .text-500 {
1105
+ --bsi-text-opacity: 1;
1106
+ color: rgba(var(--bsi-500-rgb), var(--bsi-text-opacity)) !important;
1107
+ }
1108
+
1109
+ .text-600 {
1110
+ --bsi-text-opacity: 1;
1111
+ color: rgba(var(--bsi-600-rgb), var(--bsi-text-opacity)) !important;
1112
+ }
1113
+
1114
+ .text-700 {
1115
+ --bsi-text-opacity: 1;
1116
+ color: rgba(var(--bsi-700-rgb), var(--bsi-text-opacity)) !important;
1117
+ }
1118
+
1119
+ .text-800 {
1120
+ --bsi-text-opacity: 1;
1121
+ color: rgba(var(--bsi-800-rgb), var(--bsi-text-opacity)) !important;
1122
+ }
1123
+
1124
+ .text-900 {
1125
+ --bsi-text-opacity: 1;
1126
+ color: rgba(var(--bsi-900-rgb), var(--bsi-text-opacity)) !important;
1127
+ }
1128
+
1129
+ .text-body {
1130
+ --bsi-text-opacity: 1;
1131
+ color: rgba(var(--bsi-body-color-rgb), var(--bsi-text-opacity)) !important;
1132
+ }
1133
+
1134
+ .text-muted {
1135
+ --bsi-text-opacity: 1;
1136
+ color: hsl(210, 17%, 44%) !important;
1137
+ }
1138
+
1139
+ .text-black-50 {
1140
+ --bsi-text-opacity: 1;
1141
+ color: rgba(0, 0, 0, 0.5) !important;
1142
+ }
1143
+
1144
+ .text-white-50 {
1145
+ --bsi-text-opacity: 1;
1146
+ color: rgba(255, 255, 255, 0.5) !important;
1147
+ }
1148
+
1149
+ .text-reset {
1150
+ --bsi-text-opacity: 1;
1151
+ color: inherit !important;
1040
1152
  }
1041
1153
 
1042
1154
  .form-check input:focus:not(:focus-visible) + label {
@@ -1112,7 +1224,7 @@ class ItCheckboxBase extends FormControl {
1112
1224
  }
1113
1225
  _renderInput(supportTextId, invalid, validityMessage) {
1114
1226
  const ariaDescribedBy = this.composeClass(this.supportText?.length > 0 ? supportTextId : '', this._ariaAttributes['aria-describedby']?.length > 0 ? this._ariaAttributes['aria-describedby'] : '', validityMessage?.length > 0 ? `invalid-feedback-${this._id}` : '');
1115
- const inputClasses = this.composeClass('it-form__control', invalid ? 'is-invalid' : '', !invalid && this._touched ? 'just-validate-success-field' : '', this.indeterminate ? 'semi-checked' : '');
1227
+ const inputClasses = this.composeClass('it-form__control', invalid ? 'is-invalid' : '', !invalid && this._touched ? 'is-valid' : '', this.indeterminate ? 'semi-checked' : '');
1116
1228
  const inputIsRequired = this.required && !this.isInGroup; // Disabilita il 'required' nativo se siamo in un gruppo
1117
1229
  const inputRender = html `
1118
1230
  <input
@@ -1149,7 +1261,7 @@ class ItCheckboxBase extends FormControl {
1149
1261
  return html `<div
1150
1262
  role="alert"
1151
1263
  id="invalid-feedback-${this._id}"
1152
- class="invalid-feedback form-feedback form-text form-feedback just-validate-error-label"
1264
+ class="form-feedback text-danger"
1153
1265
  ?hidden=${!(validityMessage?.length > 0)}
1154
1266
  >
1155
1267
  <span class="visually-hidden"><slot name="label"></slot>: </span>${validityMessage}
@@ -1 +1 @@
1
- {"version":3,"file":"it-checkbox-base.js","sources":["../../../src/it-checkbox-base.ts"],"sourcesContent":["import { setAttributes, FormControl, FormControlController } from '@italia/globals';\n\n// import { registerTranslation } from '@italia/i18n';\nimport { html } from 'lit';\nimport { property, queryAssignedElements } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { when } from 'lit/directives/when.js';\nimport { live } from 'lit/directives/live.js';\n\nimport styles from './checkbox.scss';\n\nexport class ItCheckboxBase extends FormControl {\n static styles = styles;\n\n protected readonly formControlController: FormControlController = new FormControlController(this, {\n value: (control: FormControl) =>\n (control as ItCheckboxBase).checked ? (control as ItCheckboxBase).value || 'true' : undefined,\n setValue: (control: FormControl, value: unknown) => {\n const checkbox = control as ItCheckboxBase;\n checkbox.checked = Boolean(value);\n },\n });\n\n /**\n * The type of input. Works the same as a native `<input>` element, but only a subset of types are supported. Defaults\n * to `text`.\n */\n type = 'checkbox';\n\n /** Draws the checkbox in a checked state. */\n @property({ type: Boolean, reflect: true })\n checked = false;\n\n /** Draws checkboxes inline, side by side. */\n @property({ type: Boolean, reflect: true })\n inline = false;\n\n /** Draws checkboxes in groups. */\n @property({ type: Boolean, reflect: true })\n group = false;\n\n /**\n * Draws the checkbox in an indeterminate state. This is usually applied to checkboxes that represents a \"select\n * all/none\" behavior when associated checkboxes have a mix of checked and unchecked states.\n */\n @property({ type: Boolean, reflect: true }) indeterminate = false;\n\n @queryAssignedElements({ slot: 'label' })\n labelElements!: HTMLElement[];\n\n get label(): string {\n if (this.labelElements.length > 0) {\n return this.labelElements[0].innerText.trim();\n }\n return '';\n }\n\n /** The input's help text. */\n @property({ type: String, attribute: 'support-text' })\n supportText = '';\n\n /** Simulates a click on the checkbox. */\n click() {\n this.inputElement.click();\n }\n\n override connectedCallback() {\n super.connectedCallback?.();\n this._handleReady();\n // 🔍 Verifica se il parent è un it-checkbox-group\n this.isInGroup = !!this.closest('it-checkbox-group');\n }\n\n override updated(changedProperties: Map<string | number | symbol, unknown>) {\n super.updated?.(changedProperties);\n\n // logger\n if (!this.label || this.label?.length === 0) {\n this.logger.warn(\n `Label is required to ensure accessibility. Please, define a label for <it-checkbox name=\"${this.name}\" ... /> .`,\n );\n }\n }\n\n protected override _handleClick(e: Event): void {\n this.checked = !this.checked;\n this.indeterminate = false;\n super._handleClick(e);\n this._handleChange(e);\n // ✅ Evento standard per compatibilità\n this.dispatchEvent(new Event('change', { bubbles: true }));\n }\n\n protected _renderInput(supportTextId: string, invalid: boolean, validityMessage: string) {\n const ariaDescribedBy = this.composeClass(\n this.supportText?.length > 0 ? supportTextId : '',\n this._ariaAttributes['aria-describedby']?.length > 0 ? this._ariaAttributes['aria-describedby'] : '',\n validityMessage?.length > 0 ? `invalid-feedback-${this._id}` : '',\n );\n\n const inputClasses = this.composeClass(\n 'it-form__control',\n invalid ? 'is-invalid' : '',\n !invalid && this._touched ? 'just-validate-success-field' : '',\n this.indeterminate ? 'semi-checked' : '',\n );\n\n const inputIsRequired = this.required && !this.isInGroup; // Disabilita il 'required' nativo se siamo in un gruppo\n\n const inputRender = html`\n <input\n part=\"checkbox focusable\"\n ${setAttributes(this._ariaAttributes)}\n aria-describedby=${ifDefined(ariaDescribedBy || undefined)}\n aria-invalid=${ifDefined(invalid ? 'true' : undefined)}\n @input=\"${this._handleInput}\"\n @blur=${this._handleBlur}\n @focus=${this._handleFocus}\n @click=${this._handleClick}\n @invalid=${this._handleInvalid}\n type=\"${this.type}\"\n id=\"${this._id}\"\n name=\"${this.name}\"\n .checked=${live(this.checked)}\n .indeterminate=${live(this.indeterminate)}\n .disabled=${this.disabled}\n .required=${inputIsRequired}\n ?formNoValidate=${this.customValidation}\n .value=\"${live(this.value)}\"\n class=\"${inputClasses}\"\n />\n `;\n\n return inputRender;\n }\n\n protected getWrapperClasses() {\n return this.composeClass(\n 'form-check',\n this.inline ? 'form-check-inline' : '',\n this.group ? 'form-check-group' : '',\n );\n }\n\n protected getSupportTextRender(supportTextId: string) {\n return html` ${when(\n this.supportText,\n () => html` <small class=\"form-text\" id=\"${supportTextId}\">${this.supportText}</small> `,\n )}`;\n }\n\n protected getValidityMessageRender(validityMessage: string) {\n return html`<div\n role=\"alert\"\n id=\"invalid-feedback-${this._id}\"\n class=\"invalid-feedback form-feedback form-text form-feedback just-validate-error-label\"\n ?hidden=${!(validityMessage?.length > 0)}\n >\n <span class=\"visually-hidden\"><slot name=\"label\"></slot>: </span>${validityMessage}\n </div>`;\n }\n\n // Render the UI as a function of component state\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\n const labelClasses = this.composeClass(this.disabled ? 'disabled' : '');\n\n return html`\n <div class=\"${wrapperClasses}\" part=\"input-wrapper\">\n ${this._renderInput(supportTextId, invalid, validityMessage)}\n <label for=\"${ifDefined(this._id || undefined)}\" part=\"label\" class=\"${labelClasses}\"\n ><slot name=\"label\"></slot\n ></label>\n ${validityMessageRender} ${supportTextRender}\n </div>\n `;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,CAAC,yBAAyB,YAAY,CAAA;;;AAGjF,QAAA,EAAA,qBAAqB,IAAI,iBAAiB;;KAE/C;IACH;;AAjLO,cAAA,CAAA,MAAM,GAAG,MAAH;AAmBb,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAC3B,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAIhB,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAC5B,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAIf,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAC7B,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAM8B,UAAA,CAAA;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAAuB,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,eAAA,EAAA,MAAA,CAAA;AAGlE,UAAA,CAAA;AADC,IAAA,qBAAqB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;AACX,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,eAAA,EAAA,MAAA,CAAA;AAW9B,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;;AACrC,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;;;;"}
1
+ {"version":3,"file":"it-checkbox-base.js","sources":["../../../src/it-checkbox-base.ts"],"sourcesContent":["import { setAttributes, FormControl, FormControlController } from '@italia/globals';\n\n// import { registerTranslation } from '@italia/i18n';\nimport { html } from 'lit';\nimport { property, queryAssignedElements } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { when } from 'lit/directives/when.js';\nimport { live } from 'lit/directives/live.js';\n\nimport styles from './checkbox.scss';\n\nexport class ItCheckboxBase extends FormControl {\n static styles = styles;\n\n protected readonly formControlController: FormControlController = new FormControlController(this, {\n value: (control: FormControl) =>\n (control as ItCheckboxBase).checked ? (control as ItCheckboxBase).value || 'true' : undefined,\n setValue: (control: FormControl, value: unknown) => {\n const checkbox = control as ItCheckboxBase;\n checkbox.checked = Boolean(value);\n },\n });\n\n /**\n * The type of input. Works the same as a native `<input>` element, but only a subset of types are supported. Defaults\n * to `text`.\n */\n type = 'checkbox';\n\n /** Draws the checkbox in a checked state. */\n @property({ type: Boolean, reflect: true })\n checked = false;\n\n /** Draws checkboxes inline, side by side. */\n @property({ type: Boolean, reflect: true })\n inline = false;\n\n /** Draws checkboxes in groups. */\n @property({ type: Boolean, reflect: true })\n group = false;\n\n /**\n * Draws the checkbox in an indeterminate state. This is usually applied to checkboxes that represents a \"select\n * all/none\" behavior when associated checkboxes have a mix of checked and unchecked states.\n */\n @property({ type: Boolean, reflect: true }) indeterminate = false;\n\n @queryAssignedElements({ slot: 'label' })\n labelElements!: HTMLElement[];\n\n get label(): string {\n if (this.labelElements.length > 0) {\n return this.labelElements[0].innerText.trim();\n }\n return '';\n }\n\n /** The input's help text. */\n @property({ type: String, attribute: 'support-text' })\n supportText = '';\n\n /** Simulates a click on the checkbox. */\n click() {\n this.inputElement.click();\n }\n\n override connectedCallback() {\n super.connectedCallback?.();\n this._handleReady();\n // 🔍 Verifica se il parent è un it-checkbox-group\n this.isInGroup = !!this.closest('it-checkbox-group');\n }\n\n override updated(changedProperties: Map<string | number | symbol, unknown>) {\n super.updated?.(changedProperties);\n\n // logger\n if (!this.label || this.label?.length === 0) {\n this.logger.warn(\n `Label is required to ensure accessibility. Please, define a label for <it-checkbox name=\"${this.name}\" ... /> .`,\n );\n }\n }\n\n protected override _handleClick(e: Event): void {\n this.checked = !this.checked;\n this.indeterminate = false;\n super._handleClick(e);\n this._handleChange(e);\n // ✅ Evento standard per compatibilità\n this.dispatchEvent(new Event('change', { bubbles: true }));\n }\n\n protected _renderInput(supportTextId: string, invalid: boolean, validityMessage: string) {\n const ariaDescribedBy = this.composeClass(\n this.supportText?.length > 0 ? supportTextId : '',\n this._ariaAttributes['aria-describedby']?.length > 0 ? this._ariaAttributes['aria-describedby'] : '',\n validityMessage?.length > 0 ? `invalid-feedback-${this._id}` : '',\n );\n\n const inputClasses = this.composeClass(\n 'it-form__control',\n invalid ? 'is-invalid' : '',\n !invalid && this._touched ? 'is-valid' : '',\n this.indeterminate ? 'semi-checked' : '',\n );\n\n const inputIsRequired = this.required && !this.isInGroup; // Disabilita il 'required' nativo se siamo in un gruppo\n\n const inputRender = html`\n <input\n part=\"checkbox focusable\"\n ${setAttributes(this._ariaAttributes)}\n aria-describedby=${ifDefined(ariaDescribedBy || undefined)}\n aria-invalid=${ifDefined(invalid ? 'true' : undefined)}\n @input=\"${this._handleInput}\"\n @blur=${this._handleBlur}\n @focus=${this._handleFocus}\n @click=${this._handleClick}\n @invalid=${this._handleInvalid}\n type=\"${this.type}\"\n id=\"${this._id}\"\n name=\"${this.name}\"\n .checked=${live(this.checked)}\n .indeterminate=${live(this.indeterminate)}\n .disabled=${this.disabled}\n .required=${inputIsRequired}\n ?formNoValidate=${this.customValidation}\n .value=\"${live(this.value)}\"\n class=\"${inputClasses}\"\n />\n `;\n\n return inputRender;\n }\n\n protected getWrapperClasses() {\n return this.composeClass(\n 'form-check',\n this.inline ? 'form-check-inline' : '',\n this.group ? 'form-check-group' : '',\n );\n }\n\n protected getSupportTextRender(supportTextId: string) {\n return html` ${when(\n this.supportText,\n () => html` <small class=\"form-text\" id=\"${supportTextId}\">${this.supportText}</small> `,\n )}`;\n }\n\n protected getValidityMessageRender(validityMessage: string) {\n return html`<div\n role=\"alert\"\n id=\"invalid-feedback-${this._id}\"\n class=\"form-feedback text-danger\"\n ?hidden=${!(validityMessage?.length > 0)}\n >\n <span class=\"visually-hidden\"><slot name=\"label\"></slot>: </span>${validityMessage}\n </div>`;\n }\n\n // Render the UI as a function of component state\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\n const labelClasses = this.composeClass(this.disabled ? 'disabled' : '');\n\n return html`\n <div class=\"${wrapperClasses}\" part=\"input-wrapper\">\n ${this._renderInput(supportTextId, invalid, validityMessage)}\n <label for=\"${ifDefined(this._id || undefined)}\" part=\"label\" class=\"${labelClasses}\"\n ><slot name=\"label\"></slot\n ></label>\n ${validityMessageRender} ${supportTextRender}\n </div>\n `;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAIf,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAC7B,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAM8B,UAAA,CAAA;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAAuB,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,eAAA,EAAA,MAAA,CAAA;AAGlE,UAAA,CAAA;AADC,IAAA,qBAAqB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;AACX,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,eAAA,EAAA,MAAA,CAAA;AAW9B,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;;AACrC,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;;;;"}
@@ -1,4 +1,4 @@
1
- import { _ as __decorate, a as __metadata, F as FormControl, b as FormControlController } from '../index-B5nLzYdF.js';
1
+ import { _ as __decorate, a as __metadata, F as FormControl, b as FormControlController } from '../index-BEse4_RX.js';
2
2
  import { css, html } from 'lit';
3
3
  import { property, queryAssignedElements, state } from 'lit/decorators.js';
4
4
  import { when } from 'lit/directives/when.js';
@@ -545,8 +545,8 @@ input::-webkit-datetime-edit {
545
545
  .form-check [type=checkbox],
546
546
  .form-check [type=radio] {
547
547
  position: absolute;
548
- top: 9px;
549
- left: 9px;
548
+ top: 0;
549
+ left: 0;
550
550
  width: auto;
551
551
  margin-top: 0;
552
552
  margin-left: 0;
@@ -627,6 +627,9 @@ input::-webkit-datetime-edit {
627
627
  height: 0;
628
628
  border-color: transparent;
629
629
  }
630
+ .form-check input[type=checkbox] + label:hover::after {
631
+ border-color: var(--bsi-color-border-secondary-hover);
632
+ }
630
633
  .form-check input[type=checkbox]:disabled + label {
631
634
  opacity: 1;
632
635
  cursor: not-allowed;
@@ -668,6 +671,9 @@ input::-webkit-datetime-edit {
668
671
  .form-check input[type=radio]:checked + label::before {
669
672
  border-color: var(--bsi-form-checked-color);
670
673
  }
674
+ .form-check input[type=radio] + label:hover::before {
675
+ border-color: var(--bsi-color-border-secondary-hover);
676
+ }
671
677
  .form-check input[type=radio]:disabled + label {
672
678
  cursor: not-allowed;
673
679
  }
@@ -772,7 +778,7 @@ input::-webkit-datetime-edit {
772
778
  .form-control {
773
779
  background-repeat: no-repeat;
774
780
  background-position: center right;
775
- background-size: 45px 30%;
781
+ background-size: 45px 20px;
776
782
  }
777
783
  .form-control:disabled {
778
784
  cursor: not-allowed;
@@ -780,20 +786,6 @@ input::-webkit-datetime-edit {
780
786
  border: 0;
781
787
  color: var(--bsi-color-text-disabled);
782
788
  }
783
- .was-validated .form-control:valid, .form-control.is-valid {
784
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23008055' viewBox='0 0 192 512'%3E%3Cpath d='M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z'/%3E%3C/svg%3E");
785
- }
786
- .was-validated .form-control:invalid, .form-control.is-invalid {
787
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23cc334d' viewBox='0 0 384 512'%3E%3Cpath d='M231.6 256l130.1-130.1c4.7-4.7 4.7-12.3 0-17l-22.6-22.6c-4.7-4.7-12.3-4.7-17 0L192 216.4 61.9 86.3c-4.7-4.7-12.3-4.7-17 0l-22.6 22.6c-4.7 4.7-4.7 12.3 0 17L152.4 256 22.3 386.1c-4.7 4.7-4.7 12.3 0 17l22.6 22.6c4.7 4.7 12.3 4.7 17 0L192 295.6l130.1 130.1c4.7 4.7 12.3 4.7 17 0l22.6-22.6c4.7-4.7 4.7-12.3 0-17L231.6 256z'/%3E%3C/svg%3E");
788
- border-color: var(--bsi-color-border-danger);
789
- }
790
- .form-control.warning {
791
- background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M2%2012C2%206.47715%206.47715%202%2012%202C14.6522%202%2017.1957%203.05357%2019.0711%204.92893C20.9464%206.8043%2022%209.34784%2022%2012C22%2017.5228%2017.5228%2022%2012%2022C6.47715%2022%202%2017.5228%202%2012ZM3%2012C3%2016.9706%207.02944%2021%2012%2021C16.9706%2021%2021%2016.9706%2021%2012C21%207.02944%2016.9706%203%2012%203C7.02944%203%203%207.02944%203%2012ZM11.5%2014.2V5.7H12.7V14.2H11.5ZM12.6%2018.3V16.5H11.4V18.3H12.6Z%22/%3E%0A%3C/svg%3E") no-repeat;
792
- border-color: var(--bsi-color-border-warning);
793
- }
794
- .form-control.is-valid ~ .warning-feedback {
795
- display: block;
796
- }
797
789
 
798
790
  .form-control-sm {
799
791
  --bsi-form-control-spacing: var(--bsi-spacing-xxs) var(--bsi-spacing-3xs);
@@ -852,9 +844,6 @@ textarea.form-control-lg {
852
844
  margin-top: 0.25rem;
853
845
  font-size: 0.75rem;
854
846
  }
855
- .form-feedback.just-validate-error-label {
856
- color: var(--bsi-color-text-danger);
857
- }
858
847
 
859
848
  .input-group-text:has(~ [data-focus-mouse=true]:not(.btn)),
860
849
  [data-focus-mouse=true]:not(.btn) ~ .input-group-text,
@@ -876,20 +865,44 @@ button:has(~ .is-invalid),
876
865
  display: none;
877
866
  }
878
867
 
879
- .just-validate-success-field {
880
- border-color: var(--bsi-color-border-success) !important;
868
+ .is-valid,
869
+ .is-invalid {
881
870
  padding-right: calc(1.5em + 0.75rem) !important;
882
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23008055' viewBox='0 0 192 512'%3E%3Cpath d='M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z'/%3E%3C/svg%3E");
871
+ }
872
+ .is-valid[type=number],
873
+ .is-invalid[type=number] {
874
+ padding-right: calc(1.5em + 0.75rem + var(--bsi-form-control-spacing) + 1rem) !important;
883
875
  }
884
876
 
885
- .input-group-text:has(~ .just-validate-success-field),
886
- .just-validate-success-field ~ .input-group-text,
887
- button:has(~ .just-validate-success-field),
888
- .just-validate-success-field + button {
877
+ .was-validated &:valid,
878
+ .is-valid {
879
+ border-color: var(--bsi-color-border-success) !important;
880
+ 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>');
881
+ }
882
+ .was-validated &:valid ~ .warning-feedback,
883
+ .is-valid ~ .warning-feedback {
884
+ display: block;
885
+ }
886
+
887
+ .was-validated &:invalid,
888
+ .is-invalid {
889
+ border-color: var(--bsi-color-border-danger) !important;
890
+ 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>');
891
+ }
892
+
893
+ .form-control.warning {
894
+ border-color: var(--bsi-color-border-warning) !important;
895
+ 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>');
896
+ }
897
+
898
+ .input-group-text:has(~ .is-valid),
899
+ .is-valid ~ .input-group-text,
900
+ button:has(~ .is-valid),
901
+ .is-valid + button {
889
902
  border-color: var(--bsi-color-border-success);
890
903
  }
891
904
 
892
- .just-validate-success-field + .input-group-text.align-buttons,
905
+ .is-valid + .input-group-text.align-buttons,
893
906
  .is-invalid + .input-group-text.align-buttons {
894
907
  right: 30px;
895
908
  }
@@ -898,33 +911,132 @@ button:has(~ .just-validate-success-field),
898
911
  bottom: 22px;
899
912
  }
900
913
 
901
- .autocomplete__wrapper .form-feedback.just-validate-error-label {
914
+ .autocomplete__wrapper .form-feedback {
902
915
  position: absolute;
903
916
  }
904
917
 
905
918
  textarea.form-control {
906
- background-position: top 0.3em right 0.3em !important;
907
- background-size: 37px 30% !important;
919
+ background-position: top 0.5em right !important;
920
+ }
921
+
922
+ .text-primary {
923
+ --bsi-text-opacity: 1;
924
+ color: rgba(var(--bsi-primary-rgb), var(--bsi-text-opacity)) !important;
925
+ }
926
+
927
+ .text-secondary {
928
+ --bsi-text-opacity: 1;
929
+ color: hsl(210, 33%, 28%) !important;
930
+ }
931
+
932
+ .text-success {
933
+ --bsi-text-opacity: 1;
934
+ color: rgba(var(--bsi-success-rgb), var(--bsi-text-opacity)) !important;
908
935
  }
909
- textarea.is-invalid {
910
- border-bottom-style: solid;
911
- border-bottom-width: 1px;
936
+
937
+ .text-info {
938
+ --bsi-text-opacity: 1;
939
+ color: rgba(var(--bsi-info-rgb), var(--bsi-text-opacity)) !important;
912
940
  }
913
- textarea.just-validate-success-field {
914
- border-bottom-style: solid;
915
- border-bottom-width: 1px;
941
+
942
+ .text-warning {
943
+ --bsi-text-opacity: 1;
944
+ color: rgba(var(--bsi-warning-rgb), var(--bsi-text-opacity)) !important;
916
945
  }
917
946
 
918
- input[type=checkbox].is-invalid,
919
- input[type=radio].is-invalid {
920
- --bsi-form-checkbox-border-color: var(--bsi-color-border-danger);
947
+ .text-danger {
948
+ --bsi-text-opacity: 1;
949
+ color: rgba(var(--bsi-danger-rgb), var(--bsi-text-opacity)) !important;
921
950
  }
922
951
 
923
- select.is-invalid {
924
- border: 1px solid var(--bsi-color-border-danger);
952
+ .text-light {
953
+ --bsi-text-opacity: 1;
954
+ color: rgba(var(--bsi-light-rgb), var(--bsi-text-opacity)) !important;
925
955
  }
926
- select.just-validate-success-field {
927
- border: 1px solid var(--bsi-color-border-success);
956
+
957
+ .text-dark {
958
+ --bsi-text-opacity: 1;
959
+ color: rgba(var(--bsi-dark-rgb), var(--bsi-text-opacity)) !important;
960
+ }
961
+
962
+ .text-black {
963
+ --bsi-text-opacity: 1;
964
+ color: rgba(var(--bsi-black-rgb), var(--bsi-text-opacity)) !important;
965
+ }
966
+
967
+ .text-white {
968
+ --bsi-text-opacity: 1;
969
+ color: rgba(var(--bsi-white-rgb), var(--bsi-text-opacity)) !important;
970
+ }
971
+
972
+ .text-100 {
973
+ --bsi-text-opacity: 1;
974
+ color: rgba(var(--bsi-100-rgb), var(--bsi-text-opacity)) !important;
975
+ }
976
+
977
+ .text-200 {
978
+ --bsi-text-opacity: 1;
979
+ color: rgba(var(--bsi-200-rgb), var(--bsi-text-opacity)) !important;
980
+ }
981
+
982
+ .text-300 {
983
+ --bsi-text-opacity: 1;
984
+ color: rgba(var(--bsi-300-rgb), var(--bsi-text-opacity)) !important;
985
+ }
986
+
987
+ .text-400 {
988
+ --bsi-text-opacity: 1;
989
+ color: rgba(var(--bsi-400-rgb), var(--bsi-text-opacity)) !important;
990
+ }
991
+
992
+ .text-500 {
993
+ --bsi-text-opacity: 1;
994
+ color: rgba(var(--bsi-500-rgb), var(--bsi-text-opacity)) !important;
995
+ }
996
+
997
+ .text-600 {
998
+ --bsi-text-opacity: 1;
999
+ color: rgba(var(--bsi-600-rgb), var(--bsi-text-opacity)) !important;
1000
+ }
1001
+
1002
+ .text-700 {
1003
+ --bsi-text-opacity: 1;
1004
+ color: rgba(var(--bsi-700-rgb), var(--bsi-text-opacity)) !important;
1005
+ }
1006
+
1007
+ .text-800 {
1008
+ --bsi-text-opacity: 1;
1009
+ color: rgba(var(--bsi-800-rgb), var(--bsi-text-opacity)) !important;
1010
+ }
1011
+
1012
+ .text-900 {
1013
+ --bsi-text-opacity: 1;
1014
+ color: rgba(var(--bsi-900-rgb), var(--bsi-text-opacity)) !important;
1015
+ }
1016
+
1017
+ .text-body {
1018
+ --bsi-text-opacity: 1;
1019
+ color: rgba(var(--bsi-body-color-rgb), var(--bsi-text-opacity)) !important;
1020
+ }
1021
+
1022
+ .text-muted {
1023
+ --bsi-text-opacity: 1;
1024
+ color: hsl(210, 17%, 44%) !important;
1025
+ }
1026
+
1027
+ .text-black-50 {
1028
+ --bsi-text-opacity: 1;
1029
+ color: rgba(0, 0, 0, 0.5) !important;
1030
+ }
1031
+
1032
+ .text-white-50 {
1033
+ --bsi-text-opacity: 1;
1034
+ color: rgba(255, 255, 255, 0.5) !important;
1035
+ }
1036
+
1037
+ .text-reset {
1038
+ --bsi-text-opacity: 1;
1039
+ color: inherit !important;
928
1040
  }
929
1041
 
930
1042
  :host {
@@ -1106,7 +1218,7 @@ class ItCheckboxGroupBase extends FormControl {
1106
1218
  const validityMessageRender = html `<div
1107
1219
  role="alert"
1108
1220
  id="${errorId}"
1109
- class="form-feedback just-validate-error-label"
1221
+ class="form-feedback text-danger"
1110
1222
  ?hidden=${!(validityMessage?.length > 0)}
1111
1223
  >
1112
1224
  <span class="visually-hidden">${this._label?.[0]?.textContent || ''}: </span>
@@ -1 +1 @@
1
- {"version":3,"file":"it-checkbox-group-base.js","sources":["../../../src/it-checkbox-group-base.ts"],"sourcesContent":["import { FormControl, FormControlController } from '@italia/globals';\nimport { html, PropertyValues } from 'lit';\nimport { property, queryAssignedElements, state } from 'lit/decorators.js';\nimport { when } from 'lit/directives/when.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { ItCheckboxBase } from './it-checkbox-base.js';\nimport styles from './checkbox-group.scss';\n\nexport class ItCheckboxGroupBase extends FormControl {\n static styles = styles;\n\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /** Draws checkboxes inline, side by side. */\n @property({ type: Boolean, reflect: true })\n inline = false;\n\n /** Draws checkboxes in groups. */\n @property({ type: Boolean, reflect: true })\n group = false;\n\n @property({ type: String, reflect: true })\n name = ''; // Il name del gruppo\n\n // Query per le checkbox assegnate nello slot\n @queryAssignedElements({ selector: 'it-checkbox' })\n checkboxes!: ItCheckboxBase[];\n\n @queryAssignedElements({ slot: 'legend' })\n private _label!: HTMLElement[];\n\n // Override del controller per usare le funzioni di validazione di gruppo\n protected override readonly formControlController: FormControlController = new FormControlController(this, {\n // Il valore è un array dei valori delle checkbox selezionate\n value: (control: FormControl) =>\n (control as ItCheckboxGroupBase).checkboxes.filter((cb) => cb.checked).map((cb) => cb.value || 'true'),\n // Il name è quello del gruppo\n name: (control: FormControl) => (control as ItCheckboxGroupBase).name,\n // La validità è gestita da noi con checkValidity di gruppo\n checkValidity: (control: FormControl) => (control as ItCheckboxGroupBase).checkValidity(),\n reportValidity: (control: FormControl) => (control as ItCheckboxGroupBase).reportValidity(),\n // Non implementiamo setValue qui, gestito dalle singole checkbox\n setValue: () => {},\n // Ascoltiamo l'input su tutti i cambi di stato delle checkbox\n assumeInteractionOn: ['it-change'],\n });\n\n // Questo state servirà per forzare il re-render del messaggio di errore\n @state()\n private _groupValid = true;\n\n get selectedValues(): string[] {\n if (!this.value) return [];\n try {\n return JSON.parse(this.value);\n } catch {\n return [];\n }\n }\n\n set selectedValues(vals: string[]) {\n this.value = JSON.stringify(vals);\n }\n\n public has(v: string) {\n return this.selectedValues.indexOf(v) >= 0;\n }\n\n override connectedCallback() {\n super.connectedCallback?.();\n this.addEventListener('it-change', this._handleGroupChange);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback?.();\n this.removeEventListener('it-change', this._handleGroupChange);\n }\n\n /**\n * Override: Custom validity check for radio group\n */\n override get validity(): ValidityState {\n // Fallback: create a custom ValidityState-like object\n const valid = !this.required || !!this.value;\n return {\n valid,\n valueMissing: this.required && !this.value,\n typeMismatch: false,\n patternMismatch: false,\n tooLong: false,\n tooShort: false,\n rangeUnderflow: false,\n rangeOverflow: false,\n stepMismatch: false,\n badInput: false,\n customError: this.customValidation && this.validationText?.length > 0,\n } as ValidityState;\n }\n\n // Ascolta gli 'it-change' bubblati dalle singole checkbox\n private _handleGroupChange() {\n // Aggiorna this.value con l'array corrente delle checkbox selezionate\n const selected = this.checkboxes.filter((cb) => cb.checked).map((cb) => cb.value || 'true');\n\n this.value = JSON.stringify(selected);\n\n // Quando qualcosa cambia, ricalcola la validità\n this.handleValidationMessages();\n this.requestUpdate(); // Aggiorna la vista\n }\n\n /**\n * Override di checkValidity per la logica di gruppo.\n */\n override checkValidity(): boolean {\n if (!this.required) {\n return true; // Non è obbligatorio\n }\n\n // Almeno una checkbox deve essere selezionata\n const atLeastOneChecked = this.checkboxes.some((cb) => cb.checked);\n\n // Aggiorna lo stato di validità del gruppo\n this._groupValid = atLeastOneChecked;\n\n return atLeastOneChecked;\n }\n\n /**\n * Override di reportValidity per mostrare l'errore a livello di gruppo.\n */\n override reportValidity(): boolean {\n // Chiama la logica di validazione personalizzata\n const isValid = this.checkValidity();\n\n // Aggiorna il messaggio di validazione se invalido\n if (!isValid) {\n this.validationMessage = this.$t('validityGroupRequired'); // Usa la tua chiave di traduzione per \"Campo obbligatorio\"\n } else {\n this.validationMessage = '';\n }\n\n // Forzare l'aggiornamento di FormControlController che gestirà data-invalid/data-valid\n this.formControlController.updateValidity();\n this.requestUpdate();\n\n return isValid;\n }\n\n /**\n * Il tuo FormControl ha già un handleValidationMessages che\n * setta this.validationMessage. Aggiorniamolo per la logica di gruppo.\n */\n protected override handleValidationMessages() {\n if (!this.customValidation && this.formControlController.submittedOnce) {\n this.validationMessage = this.checkValidity() ? '' : this.$t('validityGroupRequired');\n }\n if (this.customValidation) {\n this.validationMessage = this.inputElement.validationMessage;\n }\n }\n\n /**\n * Sync group state (name, grouped, inline, required, disabled, checked) to child checkboxes\n * This replaces the need for requestUpdate() calls\n */\n private _syncGroupStateToChildren() {\n if (!this.checkboxes || this.checkboxes.length === 0) {\n return;\n }\n\n this.checkboxes.forEach((cb) => {\n // eslint-disable-next-line no-param-reassign\n cb.name = this.name;\n // eslint-disable-next-line no-param-reassign\n cb.group = this.group || !this.inline;\n // eslint-disable-next-line no-param-reassign\n cb.inline = this.inline;\n // eslint-disable-next-line no-param-reassign\n cb.required = this.required;\n\n if (this.disabled) {\n // eslint-disable-next-line no-param-reassign\n cb.disabled = this.disabled;\n }\n if (!cb.hasAttribute('checked')) {\n // eslint-disable-next-line no-param-reassign\n cb.checked = this.has(cb.value);\n }\n });\n }\n\n updated(changed: PropertyValues) {\n super.updated(changed);\n\n // Update radios when value or name changes\n if (changed.has('value') || (changed.has('validationText') && this.customValidation)) {\n // Re-validate after value change (for native validation) only if validation was already triggered\n\n this.handleValidationMessages();\n }\n\n // If relevant group properties changed, sync to child checkboxes\n const relevant = ['group', 'inline', 'name', 'required', 'disabled', 'value'];\n const hasChanged = Array.from(changed.keys()).some((k) => relevant.includes(String(k)));\n if (hasChanged && this.checkboxes?.length) {\n this._syncGroupStateToChildren();\n }\n }\n\n // Render per mostrare l'errore (usa la tua logica di rendering dell'errore)\n // All'interno di ItCheckboxGroup (metodo render)\n\n override render() {\n const showValidation = this.formControlController.submittedOnce || this.customValidation; // true; // this._touched || this.customValidation;\n const validityMessage = (showValidation ? this.validationMessage : '') ?? '';\n\n // Determina lo stato di invalidità in base alla validazione di gruppo\n const invalid = validityMessage?.length > 0 || !this._groupValid;\n\n const errorId = `invalid-feedback-${this._id}`;\n\n // Messaggio di validazione per il gruppo\n const validityMessageRender = html`<div\n role=\"alert\"\n id=\"${errorId}\"\n class=\"form-feedback just-validate-error-label\"\n ?hidden=${!(validityMessage?.length > 0)}\n >\n <span class=\"visually-hidden\">${this._label?.[0]?.textContent || ''}: </span>\n ${validityMessage}\n </div>`;\n\n // il pattern per errori nel form è stato preso da qui https://design-system.w3.org/styles/form-errors.html\n return html`\n <fieldset\n class=\"it-checkbox-group it-form__control\"\n id=\"${this._id}\"\n aria-describedby=${ifDefined(invalid ? errorId : undefined)}\n aria-required=${ifDefined(this.required ? 'true' : undefined)}\n part=\"fieldset\"\n >\n <legend part=\"legend\">\n <slot name=\"legend\"></slot>\n </legend>\n\n <slot @slotchange=${this._handleSlotChange}></slot>\n ${when(invalid, () => validityMessageRender)}\n </fieldset>\n `;\n }\n\n public override setCustomValidity(message: string) {\n if (!this.customValidation) {\n this.inputElement.setCustomValidity(message);\n this.validationMessage = this.inputElement.validationMessage;\n } else {\n this.validationMessage = message;\n }\n this.formControlController.updateValidity();\n }\n\n // Metodo per gestire l'assegnazione iniziale e re-assegnazione delle checkbox\n private _handleSlotChange() {\n // Dopo l'assegnazione, forziamo un controllo di validità per inizializzare _groupValid\n this.handleValidationMessages();\n this.requestUpdate();\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAC7B,CAAA,EAAA,mBAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AAGd,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;AAChC,CAAA,EAAA,mBAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAIV,UAAA,CAAA;AADC,IAAA,qBAAqB,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;;AACrB,CAAA,EAAA,mBAAA,CAAA,SAAA,EAAA,YAAA,EAAA,MAAA,CAAA;AAGtB,UAAA,CAAA;AADP,IAAA,qBAAqB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;;AACX,CAAA,EAAA,mBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAoBvB,UAAA,CAAA;AADP,IAAA,KAAK,EAAE;;AACmB,CAAA,EAAA,mBAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;;;;"}
1
+ {"version":3,"file":"it-checkbox-group-base.js","sources":["../../../src/it-checkbox-group-base.ts"],"sourcesContent":["import { FormControl, FormControlController } from '@italia/globals';\nimport { html, PropertyValues } from 'lit';\nimport { property, queryAssignedElements, state } from 'lit/decorators.js';\nimport { when } from 'lit/directives/when.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { ItCheckboxBase } from './it-checkbox-base.js';\nimport styles from './checkbox-group.scss';\n\nexport class ItCheckboxGroupBase extends FormControl {\n static styles = styles;\n\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /** Draws checkboxes inline, side by side. */\n @property({ type: Boolean, reflect: true })\n inline = false;\n\n /** Draws checkboxes in groups. */\n @property({ type: Boolean, reflect: true })\n group = false;\n\n @property({ type: String, reflect: true })\n name = ''; // Il name del gruppo\n\n // Query per le checkbox assegnate nello slot\n @queryAssignedElements({ selector: 'it-checkbox' })\n checkboxes!: ItCheckboxBase[];\n\n @queryAssignedElements({ slot: 'legend' })\n private _label!: HTMLElement[];\n\n // Override del controller per usare le funzioni di validazione di gruppo\n protected override readonly formControlController: FormControlController = new FormControlController(this, {\n // Il valore è un array dei valori delle checkbox selezionate\n value: (control: FormControl) =>\n (control as ItCheckboxGroupBase).checkboxes.filter((cb) => cb.checked).map((cb) => cb.value || 'true'),\n // Il name è quello del gruppo\n name: (control: FormControl) => (control as ItCheckboxGroupBase).name,\n // La validità è gestita da noi con checkValidity di gruppo\n checkValidity: (control: FormControl) => (control as ItCheckboxGroupBase).checkValidity(),\n reportValidity: (control: FormControl) => (control as ItCheckboxGroupBase).reportValidity(),\n // Non implementiamo setValue qui, gestito dalle singole checkbox\n setValue: () => {},\n // Ascoltiamo l'input su tutti i cambi di stato delle checkbox\n assumeInteractionOn: ['it-change'],\n });\n\n // Questo state servirà per forzare il re-render del messaggio di errore\n @state()\n private _groupValid = true;\n\n get selectedValues(): string[] {\n if (!this.value) return [];\n try {\n return JSON.parse(this.value);\n } catch {\n return [];\n }\n }\n\n set selectedValues(vals: string[]) {\n this.value = JSON.stringify(vals);\n }\n\n public has(v: string) {\n return this.selectedValues.indexOf(v) >= 0;\n }\n\n override connectedCallback() {\n super.connectedCallback?.();\n this.addEventListener('it-change', this._handleGroupChange);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback?.();\n this.removeEventListener('it-change', this._handleGroupChange);\n }\n\n /**\n * Override: Custom validity check for radio group\n */\n override get validity(): ValidityState {\n // Fallback: create a custom ValidityState-like object\n const valid = !this.required || !!this.value;\n return {\n valid,\n valueMissing: this.required && !this.value,\n typeMismatch: false,\n patternMismatch: false,\n tooLong: false,\n tooShort: false,\n rangeUnderflow: false,\n rangeOverflow: false,\n stepMismatch: false,\n badInput: false,\n customError: this.customValidation && this.validationText?.length > 0,\n } as ValidityState;\n }\n\n // Ascolta gli 'it-change' bubblati dalle singole checkbox\n private _handleGroupChange() {\n // Aggiorna this.value con l'array corrente delle checkbox selezionate\n const selected = this.checkboxes.filter((cb) => cb.checked).map((cb) => cb.value || 'true');\n\n this.value = JSON.stringify(selected);\n\n // Quando qualcosa cambia, ricalcola la validità\n this.handleValidationMessages();\n this.requestUpdate(); // Aggiorna la vista\n }\n\n /**\n * Override di checkValidity per la logica di gruppo.\n */\n override checkValidity(): boolean {\n if (!this.required) {\n return true; // Non è obbligatorio\n }\n\n // Almeno una checkbox deve essere selezionata\n const atLeastOneChecked = this.checkboxes.some((cb) => cb.checked);\n\n // Aggiorna lo stato di validità del gruppo\n this._groupValid = atLeastOneChecked;\n\n return atLeastOneChecked;\n }\n\n /**\n * Override di reportValidity per mostrare l'errore a livello di gruppo.\n */\n override reportValidity(): boolean {\n // Chiama la logica di validazione personalizzata\n const isValid = this.checkValidity();\n\n // Aggiorna il messaggio di validazione se invalido\n if (!isValid) {\n this.validationMessage = this.$t('validityGroupRequired'); // Usa la tua chiave di traduzione per \"Campo obbligatorio\"\n } else {\n this.validationMessage = '';\n }\n\n // Forzare l'aggiornamento di FormControlController che gestirà data-invalid/data-valid\n this.formControlController.updateValidity();\n this.requestUpdate();\n\n return isValid;\n }\n\n /**\n * Il tuo FormControl ha già un handleValidationMessages che\n * setta this.validationMessage. Aggiorniamolo per la logica di gruppo.\n */\n protected override handleValidationMessages() {\n if (!this.customValidation && this.formControlController.submittedOnce) {\n this.validationMessage = this.checkValidity() ? '' : this.$t('validityGroupRequired');\n }\n if (this.customValidation) {\n this.validationMessage = this.inputElement.validationMessage;\n }\n }\n\n /**\n * Sync group state (name, grouped, inline, required, disabled, checked) to child checkboxes\n * This replaces the need for requestUpdate() calls\n */\n private _syncGroupStateToChildren() {\n if (!this.checkboxes || this.checkboxes.length === 0) {\n return;\n }\n\n this.checkboxes.forEach((cb) => {\n // eslint-disable-next-line no-param-reassign\n cb.name = this.name;\n // eslint-disable-next-line no-param-reassign\n cb.group = this.group || !this.inline;\n // eslint-disable-next-line no-param-reassign\n cb.inline = this.inline;\n // eslint-disable-next-line no-param-reassign\n cb.required = this.required;\n\n if (this.disabled) {\n // eslint-disable-next-line no-param-reassign\n cb.disabled = this.disabled;\n }\n if (!cb.hasAttribute('checked')) {\n // eslint-disable-next-line no-param-reassign\n cb.checked = this.has(cb.value);\n }\n });\n }\n\n updated(changed: PropertyValues) {\n super.updated(changed);\n\n // Update radios when value or name changes\n if (changed.has('value') || (changed.has('validationText') && this.customValidation)) {\n // Re-validate after value change (for native validation) only if validation was already triggered\n\n this.handleValidationMessages();\n }\n\n // If relevant group properties changed, sync to child checkboxes\n const relevant = ['group', 'inline', 'name', 'required', 'disabled', 'value'];\n const hasChanged = Array.from(changed.keys()).some((k) => relevant.includes(String(k)));\n if (hasChanged && this.checkboxes?.length) {\n this._syncGroupStateToChildren();\n }\n }\n\n // Render per mostrare l'errore (usa la tua logica di rendering dell'errore)\n // All'interno di ItCheckboxGroup (metodo render)\n\n override render() {\n const showValidation = this.formControlController.submittedOnce || this.customValidation; // true; // this._touched || this.customValidation;\n const validityMessage = (showValidation ? this.validationMessage : '') ?? '';\n\n // Determina lo stato di invalidità in base alla validazione di gruppo\n const invalid = validityMessage?.length > 0 || !this._groupValid;\n\n const errorId = `invalid-feedback-${this._id}`;\n\n // Messaggio di validazione per il gruppo\n const validityMessageRender = html`<div\n role=\"alert\"\n id=\"${errorId}\"\n class=\"form-feedback text-danger\"\n ?hidden=${!(validityMessage?.length > 0)}\n >\n <span class=\"visually-hidden\">${this._label?.[0]?.textContent || ''}: </span>\n ${validityMessage}\n </div>`;\n\n // il pattern per errori nel form è stato preso da qui https://design-system.w3.org/styles/form-errors.html\n return html`\n <fieldset\n class=\"it-checkbox-group it-form__control\"\n id=\"${this._id}\"\n aria-describedby=${ifDefined(invalid ? errorId : undefined)}\n aria-required=${ifDefined(this.required ? 'true' : undefined)}\n part=\"fieldset\"\n >\n <legend part=\"legend\">\n <slot name=\"legend\"></slot>\n </legend>\n\n <slot @slotchange=${this._handleSlotChange}></slot>\n ${when(invalid, () => validityMessageRender)}\n </fieldset>\n `;\n }\n\n public override setCustomValidity(message: string) {\n if (!this.customValidation) {\n this.inputElement.setCustomValidity(message);\n this.validationMessage = this.inputElement.validationMessage;\n } else {\n this.validationMessage = message;\n }\n this.formControlController.updateValidity();\n }\n\n // Metodo per gestire l'assegnazione iniziale e re-assegnazione delle checkbox\n private _handleSlotChange() {\n // Dopo l'assegnazione, forziamo un controllo di validità per inizializzare _groupValid\n this.handleValidationMessages();\n this.requestUpdate();\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;;AACrB,CAAA,EAAA,mBAAA,CAAA,SAAA,EAAA,YAAA,EAAA,MAAA,CAAA;AAGtB,UAAA,CAAA;AADP,IAAA,qBAAqB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;;AACX,CAAA,EAAA,mBAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAoBvB,UAAA,CAAA;AADP,IAAA,KAAK,EAAE;;AACmB,CAAA,EAAA,mBAAA,CAAA,SAAA,EAAA,aAAA,EAAA,MAAA,CAAA;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { ItCheckboxGroupBase } from './it-checkbox-group-base.js';
2
- import '../index-B5nLzYdF.js';
2
+ import '../index-BEse4_RX.js';
3
3
  import 'lit/directive.js';
4
4
  import 'lit';
5
5
  import 'lit/decorators.js';
@@ -1,5 +1,5 @@
1
1
  import { ItCheckboxBase } from './it-checkbox-base.js';
2
- import '../index-B5nLzYdF.js';
2
+ import '../index-BEse4_RX.js';
3
3
  import 'lit/directive.js';
4
4
  import 'lit';
5
5
  import 'lit/decorators.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@italia/checkbox",
3
3
  "description": "Web component it-checkbox del Design system .italia",
4
- "version": "1.0.0-beta.0",
4
+ "version": "1.0.0-beta.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -36,36 +36,36 @@
36
36
  "custom-elements.json",
37
37
  "styles"
38
38
  ],
39
+ "scripts": {
40
+ "analyze": "cem analyze --litelement --exclude dist",
41
+ "build": "rollup --config rollup.config.js",
42
+ "clean": "rimraf node_modules .turbo .rollup.cache dist coverage",
43
+ "prepublish": "pnpm build",
44
+ "lint": "eslint --ext .ts \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" && stylelint \"src/**/*.scss\" && prettier \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" --check",
45
+ "format": "eslint --ext .ts \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" --fix && stylelint \"src/**/*.scss\" --fix && prettier \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" --write",
46
+ "test": "wtr --coverage --node-resolve --config web-test-runner.config.js"
47
+ },
39
48
  "dependencies": {
40
- "bootstrap-italia": "3.0.0-beta.1",
41
- "lit": "^3.3.0",
42
- "@italia/globals": "^1.0.0-beta.0",
43
- "@italia/i18n": "^1.0.0-beta.0"
49
+ "@italia/globals": "workspace:^",
50
+ "@italia/i18n": "workspace:^",
51
+ "bootstrap-italia": "catalog:",
52
+ "lit": "catalog:"
44
53
  },
45
54
  "devDependencies": {
46
55
  "@custom-elements-manifest/analyzer": "^0.10.3",
47
- "@open-wc/testing": "^4.0.0",
56
+ "@italia/test-config": "workspace:^",
57
+ "@italia/typescript-config": "workspace:^",
58
+ "@open-wc/testing": "catalog:",
48
59
  "@rollup/plugin-node-resolve": "^16.0.1",
49
60
  "@rollup/plugin-typescript": "^12.1.2",
50
- "@types/mocha": "^10.0.10",
51
- "@web/test-runner": "^0.18.2",
61
+ "@types/mocha": "catalog:",
62
+ "@web/test-runner": "catalog:",
52
63
  "rimraf": "^6.0.1",
53
64
  "rollup": "^4.42.0",
54
65
  "rollup-plugin-scss-lit": "^2.1.0",
55
- "sass": "^1.89.0",
66
+ "sass": "catalog:",
56
67
  "tslib": "^2.6.3",
57
- "typescript": "^5.5.3",
58
- "@italia/test-config": "^1.0.0-beta.0",
59
- "@italia/typescript-config": "^1.0.0-beta.0"
68
+ "typescript": "catalog:"
60
69
  },
61
- "customElements": "custom-elements.json",
62
- "scripts": {
63
- "analyze": "cem analyze --litelement --exclude dist",
64
- "build": "rollup --config rollup.config.js",
65
- "clean": "rimraf node_modules .turbo .rollup.cache dist coverage",
66
- "prepublish": "pnpm build",
67
- "lint": "eslint --ext .ts \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" && stylelint \"src/**/*.scss\" && prettier \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" --check",
68
- "format": "eslint --ext .ts \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" --fix && stylelint \"src/**/*.scss\" --fix && prettier \"src/**/*.ts\" \"stories/**/*.ts\" \"test/**/*.ts\" --write",
69
- "test": "wtr --coverage --node-resolve --config web-test-runner.config.js"
70
- }
71
- }
70
+ "customElements": "custom-elements.json"
71
+ }