@sebgroup/green-core 2.27.0 → 2.28.0

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.
@@ -11,6 +11,10 @@ declare class CheckboxGroup extends GdsFormControlElement<string[]> {
11
11
  * The direction in which checkbox buttons are displayed.
12
12
  */
13
13
  direction: 'row' | 'column';
14
+ /**
15
+ * Whether to hide the label for the checkbox group. Usable if you want a single checkbox to act as the label.
16
+ */
17
+ hideLabel: boolean;
14
18
  /**
15
19
  * The supporting text displayed between the label and the field.
16
20
  * This text provides additional context or information to the user.
@@ -26,6 +26,7 @@ let CheckboxGroup = class extends GdsFormControlElement {
26
26
  __privateAdd(this, _CheckboxGroup_instances);
27
27
  this.size = "large";
28
28
  this.direction = "column";
29
+ this.hideLabel = false;
29
30
  this.supportingText = "";
30
31
  this.showExtendedSupportingText = false;
31
32
  __privateAdd(this, _syncCheckboxes, () => {
@@ -103,7 +104,12 @@ renderCheckboxGroupContents_fn = function() {
103
104
  };
104
105
  renderFieldControlHeader_fn = function() {
105
106
  if (this.label) {
106
- return html`<gds-form-control-header class="size-${this.size}">
107
+ return html`<gds-form-control-header
108
+ class=${classMap({
109
+ [`size-${this.size}`]: true,
110
+ "visually-hidden": this.hideLabel
111
+ })}
112
+ >
107
113
  <label id="group-label" slot="label">${this.label}</label>
108
114
  <span slot="supporting-text" id="supporting-text">
109
115
  ${this.supportingText}
@@ -155,6 +161,9 @@ __decorateClass([
155
161
  __decorateClass([
156
162
  property()
157
163
  ], CheckboxGroup.prototype, "direction", 2);
164
+ __decorateClass([
165
+ property({ type: Boolean, attribute: "hide-label" })
166
+ ], CheckboxGroup.prototype, "hideLabel", 2);
158
167
  __decorateClass([
159
168
  property({ attribute: "supporting-text" })
160
169
  ], CheckboxGroup.prototype, "supportingText", 2);
@@ -61,6 +61,17 @@ const styles = css`
61
61
  :host([size='small']) .direction-row .content {
62
62
  gap: var(--gds-sys-space-xs) var(--gds-sys-space-m);
63
63
  }
64
+
65
+ .visually-hidden {
66
+ border: 0;
67
+ clip: rect(0 0 0 0);
68
+ height: 1px;
69
+ margin: -1px;
70
+ overflow: hidden;
71
+ padding: 0;
72
+ position: absolute;
73
+ width: 1px;
74
+ }
64
75
  `;
65
76
  export {
66
77
  styles