@sebgroup/green-core 2.28.1 → 2.28.2

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.
@@ -148,7 +148,7 @@ let GdsCalendar = class extends GdsElement {
148
148
  );
149
149
  const isOutsideMinMax = (day < this.min || day > this.max) && !isSameDay(day, this.min) && !isSameDay(day, this.max);
150
150
  const isWeekend = day.getDay() === 0 || day.getDay() === 6;
151
- const isDisabled = displayOptions.disabled || isOutsideCurrentMonth || isOutsideMinMax || this.disabledWeekends && isWeekend;
151
+ const isDisabled = displayOptions.disabled || isOutsideMinMax || this.disabledWeekends && isWeekend;
152
152
  const shouldRenderBlank = this.hideExtraneousDays && isOutsideCurrentMonth;
153
153
  return shouldRenderBlank ? html`<td inert></td>` : html`
154
154
  <td
@@ -159,7 +159,8 @@ let GdsCalendar = class extends GdsElement {
159
159
  small: Boolean(this.size === "small"),
160
160
  "custom-date": Boolean(customization),
161
161
  disabled: Boolean(isDisabled),
162
- today: isSameDay(currentDate, day)
162
+ today: isSameDay(currentDate, day),
163
+ "outside-month": isOutsideCurrentMonth
163
164
  })}"
164
165
  ?disabled=${isDisabled}
165
166
  tabindex="${isSameDay(this.focusedDate, day) ? 0 : -1}"
@@ -136,6 +136,10 @@ const style = css`
136
136
  cursor: default;
137
137
  }
138
138
 
139
+ &.outside-month:not(.disabled) {
140
+ color: var(--gds-sys-color-content-neutral-02);
141
+ }
142
+
139
143
  &[aria-selected='false']:active:not(.disabled) {
140
144
  background: color-mix(
141
145
  in srgb,
@@ -446,6 +446,7 @@ let Dropdown = class extends GdsFormControlElement {
446
446
  this.options[0] && (this.options[0].selected = true);
447
447
  this.value = this.options[0]?.value;
448
448
  }
449
+ this._handleValueChange();
449
450
  }
450
451
  _handleValueChange() {
451
452
  this._elListbox.then((listbox) => {
@@ -498,11 +498,16 @@ renderColumnHeader_fn = function(column) {
498
498
  "sort-asc": isSorted && sortDirection === "asc",
499
499
  "sort-desc": isSorted && sortDirection === "desc",
500
500
  [`align-${column.align}`]: !!column.align,
501
- [`justify-${column.justify}`]: !!column.justify
501
+ [`justify-${column.justify}`]: !!column.justify,
502
+ wrap: Boolean(column.width)
503
+ });
504
+ const style = styleMap({
505
+ "--cell-width": column.width
502
506
  });
503
507
  return html`
504
508
  <th
505
509
  class=${classes}
510
+ style=${style}
506
511
  aria-sort="${isSorted ? sortDirection === "asc" ? "ascending" : "descending" : "none"}"
507
512
  @click=${column.sortable ? () => __privateMethod(this, _GdsTable_instances, handleSort_fn).call(this, column.key) : null}
508
513
  >
@@ -740,7 +745,7 @@ renderTable_fn = function() {
740
745
  loading: this._loading,
741
746
  loaded: !this._loading && !this._loaded
742
747
  });
743
- const caption = `${this.summary}, ${msg("Data table with")} ${this._total} ${msg("rows")}`;
748
+ const caption = `${this.summary ? this.summary + ", " : ""}${msg("Data table with")} ${this._total} ${msg("rows")}`;
744
749
  return html`
745
750
  <gds-card
746
751
  variant="${this.variant}"
@@ -109,6 +109,7 @@ const Users = {
109
109
  key: "status",
110
110
  label: "Status",
111
111
  sortable: true,
112
+ justify: "end",
112
113
  cell: {
113
114
  value: {
114
115
  type: "badge",
@@ -316,8 +316,9 @@ const TableStyles = css`
316
316
  overflow-wrap: break-word;
317
317
  }
318
318
 
319
- td.wrap {
320
- max-width: var(--cell-width);
319
+ td.wrap,
320
+ th.wrap {
321
+ width: var(--cell-width);
321
322
  }
322
323
 
323
324
  /* Justify utilities */
@@ -342,6 +343,11 @@ const TableStyles = css`
342
343
  justify-content: flex-end;
343
344
  }
344
345
 
346
+ .justify-end:not(.sortable) .column-header {
347
+ text-align: right;
348
+ justify-content: flex-end;
349
+ }
350
+
345
351
  .sortable.justify-end .column-header {
346
352
  flex-direction: row-reverse;
347
353
  }
@@ -591,13 +597,14 @@ const TableStyles = css`
591
597
  width: 60%;
592
598
  }
593
599
 
594
- /* Visually hidden */
600
+ /* Visually hidden - screen reader only without layout impact */
595
601
  .visually-hidden {
596
- position: absolute;
597
- opacity: 0;
598
- width: 0;
599
- height: 0;
600
- pointer-events: none;
602
+ clip: rect(0 0 0 0);
603
+ clip-path: inset(50%);
604
+ overflow: hidden;
605
+ white-space: nowrap;
606
+ height: 0px;
607
+ width: 0px;
601
608
  }
602
609
 
603
610
  /* Scroll driven animation */