@sebgroup/green-core 3.29.0 → 3.31.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.
Files changed (40) hide show
  1. package/components/calendar/calendar.component.js +2 -0
  2. package/components/coachmark/coachmark.component.js +3 -1
  3. package/components/datepicker/datepicker.component.js +9 -0
  4. package/components/dropdown/dropdown.component.js +4 -6
  5. package/components/index.d.ts +1 -0
  6. package/components/index.js +1 -0
  7. package/components/popover/popover.component.js +16 -2
  8. package/components/progress/progress.component.js +2 -0
  9. package/components/table/table.component.js +24 -15
  10. package/components/table/table.stories.data.js +6 -2
  11. package/components/table/table.styles.js +83 -4
  12. package/components/table/table.types.d.ts +2 -0
  13. package/components/tooltip/index.d.ts +1 -0
  14. package/components/tooltip/index.js +1 -0
  15. package/components/tooltip/tooltip.component.d.ts +52 -0
  16. package/components/tooltip/tooltip.component.js +339 -0
  17. package/components/tooltip/tooltip.d.ts +2 -0
  18. package/components/tooltip/tooltip.js +6 -0
  19. package/components/tooltip/tooltip.styles.d.ts +2 -0
  20. package/components/tooltip/tooltip.styles.js +120 -0
  21. package/custom-elements.json +26257 -25779
  22. package/gds-element.js +1 -1
  23. package/generated/mcp/components.json +13 -1
  24. package/generated/mcp/icons.json +1 -1
  25. package/generated/mcp/index.json +1 -1
  26. package/generated/mcp/tokens.json +1 -1
  27. package/generated/mcp/tooltip/angular.md +25 -0
  28. package/generated/mcp/tooltip/api.md +30 -0
  29. package/generated/mcp/tooltip/index.json +8 -0
  30. package/generated/mcp/tooltip/react.md +25 -0
  31. package/generated/react/index.d.ts +4 -3
  32. package/generated/react/index.js +4 -3
  33. package/generated/react/tooltip/index.d.ts +683 -0
  34. package/generated/react/tooltip/index.js +14 -0
  35. package/package.json +3 -1
  36. package/pure.d.ts +1 -0
  37. package/pure.js +1 -0
  38. package/utils/helpers/custom-element-scoping.js +1 -1
  39. package/utils/localization/localization.d.ts +9 -0
  40. package/utils/localization/localization.js +6 -1
@@ -27,6 +27,7 @@ import { TransitionalStyles } from "../../transitional-styles.js";
27
27
  import { ariaForwarding } from "../../utils/decorators/aria-forwarding.js";
28
28
  import { watch } from "../../utils/decorators/watch.js";
29
29
  import { dateHasChanged } from "../../utils/helpers/has-changed.js";
30
+ import { gdsGetLocale } from "../../utils/localization/localization.js";
30
31
  import CalendarStyles from "./calendar.styles.js";
31
32
  import { renderMonthGridView } from "./functions.js";
32
33
  let GdsCalendar = class extends GdsElement {
@@ -79,6 +80,7 @@ let GdsCalendar = class extends GdsElement {
79
80
  connectedCallback() {
80
81
  super.connectedCallback();
81
82
  TransitionalStyles.instance.apply(this, "gds-calendar");
83
+ this._currentLocale = gdsGetLocale();
82
84
  this.addEventListener("keydown", __privateMethod(this, _GdsCalendar_instances, handleKeyDown_fn));
83
85
  window.addEventListener("lit-localize-status", (e) => {
84
86
  if (e.detail.status === "ready")
@@ -43,7 +43,9 @@ let GdsCoachmark = class extends GdsElement {
43
43
  }
44
44
  connectedCallback() {
45
45
  super.connectedCallback();
46
- document.addEventListener("click", () => {
46
+ document.addEventListener("click", (event) => {
47
+ const clickedOtherCoachmark = event.composedPath().some((node) => node instanceof GdsCoachmark && node !== this);
48
+ if (clickedOtherCoachmark) return;
47
49
  setTimeout(() => {
48
50
  __privateMethod(this, _GdsCoachmark_instances, updateCoachmarks_fn).call(this);
49
51
  __privateMethod(this, _GdsCoachmark_instances, closeCoachMark_fn).call(this);
@@ -29,6 +29,7 @@ import {
29
29
  dateConverter
30
30
  } from "../../utils/helpers/attribute-converters.js";
31
31
  import { dateHasChanged } from "../../utils/helpers/has-changed.js";
32
+ import { gdsGetLocale } from "../../utils/localization/localization.js";
32
33
  import {
33
34
  withLayoutChildProps,
34
35
  withMarginProps,
@@ -280,6 +281,14 @@ let Datepicker = class extends GdsFormControlElement {
280
281
  connectedCallback() {
281
282
  super.connectedCallback();
282
283
  TransitionalStyles.instance.apply(this, "gds-datepicker");
284
+ this._currentLocale = gdsGetLocale();
285
+ if (!this.value) {
286
+ __privateSet(this, _spinnerState, {
287
+ year: __privateMethod(this, _Datepicker_instances, getLocalizedPlaceholder_fn).call(this, "year"),
288
+ month: __privateMethod(this, _Datepicker_instances, getLocalizedPlaceholder_fn).call(this, "month"),
289
+ day: __privateMethod(this, _Datepicker_instances, getLocalizedPlaceholder_fn).call(this, "day")
290
+ });
291
+ }
283
292
  window.addEventListener("lit-localize-status", (e) => {
284
293
  if (e.detail.status === "ready") {
285
294
  this._currentLocale = e.detail.readyLocale;
@@ -309,20 +309,18 @@ let Dropdown = class extends GdsFormControlElement {
309
309
  */
310
310
  get displayValue() {
311
311
  if (this.value === void 0) {
312
- return this.placeholder?.innerText || "";
312
+ return this.placeholder?.textContent?.trim() || "";
313
313
  }
314
314
  let displayValue;
315
315
  if (Array.isArray(this.value)) {
316
316
  displayValue = this.value.slice(0, 5).reduce(
317
- (acc, cur) => acc + this.options.find((v) => this.compareWith(v.value, cur))?.innerText + ", ",
317
+ (acc, cur) => acc + this.options.find((v) => this.compareWith(v.value, cur))?.textContent?.trim() + ", ",
318
318
  ""
319
319
  ).slice(0, -2).replace(/(.{25})(.*)/, "$1...");
320
320
  } else {
321
- displayValue = this.options.find(
322
- (v) => this.compareWith(v.value, this.value)
323
- )?.innerText;
321
+ displayValue = this.options.find((v) => this.compareWith(v.value, this.value))?.textContent?.trim();
324
322
  }
325
- return displayValue || this.placeholder?.innerText || "";
323
+ return displayValue || this.placeholder?.textContent?.trim() || "";
326
324
  }
327
325
  /**
328
326
  * Moves focus to this element.
@@ -48,4 +48,5 @@ export * from './tabs';
48
48
  export * from './table';
49
49
  export * from './textarea';
50
50
  export * from './theme';
51
+ export * from './tooltip';
51
52
  export * from './video';
@@ -48,4 +48,5 @@ export * from "./tabs/index.js";
48
48
  export * from "./table/index.js";
49
49
  export * from "./textarea/index.js";
50
50
  export * from "./theme/index.js";
51
+ export * from "./tooltip/index.js";
51
52
  export * from "./video/index.js";
@@ -5,7 +5,7 @@ import {
5
5
  __privateMethod,
6
6
  __privateSet
7
7
  } from "../../chunks/chunk.H2T4A5YY.js";
8
- var _GdsPopover_instances, handleTriggerSlotChange_fn, _autoPositionCleanupFn, _isMobileViewport, _backdropEl, _clickOutsideTarget, registerClickOutside_fn, unregisterClickOutside_fn, _handleCancel, _dispatchUiStateEvent, _handleCloseButton, registerTriggerEvents_fn, unregisterTriggerEvents_fn, setupTriggerAttributes_fn, registerAutoPositioning_fn, _handleTriggerKeyDown, _handleTriggerClick, _focusFirstSlottedChild, _handleClickOutside, _handlePageScroll;
8
+ var _GdsPopover_instances, handleTriggerSlotChange_fn, _autoPositionCleanupFn, _isMobileViewport, _backdropEl, _clickOutsideTarget, _hideVirtKbAfterGesture, cancelPendingVirtKbHide_fn, registerClickOutside_fn, unregisterClickOutside_fn, _handleCancel, _dispatchUiStateEvent, _handleCloseButton, registerTriggerEvents_fn, unregisterTriggerEvents_fn, setupTriggerAttributes_fn, registerAutoPositioning_fn, _handleTriggerKeyDown, _handleTriggerClick, _focusFirstSlottedChild, _handleClickOutside, _handlePageScroll;
9
9
  import { localized, msg } from "@lit/localize";
10
10
  import { property, query, state } from "lit/decorators.js";
11
11
  import { classMap } from "lit/directives/class-map.js";
@@ -67,6 +67,9 @@ let GdsPopover = class extends GdsElement {
67
67
  // The node the click outside listener is currently attached to. Kept so that removal always
68
68
  // targets the same node it was added to, even if the resolved target would differ by then.
69
69
  __privateAdd(this, _clickOutsideTarget);
70
+ __privateAdd(this, _hideVirtKbAfterGesture, () => {
71
+ this._isVirtKbVisible = false;
72
+ });
70
73
  __privateAdd(this, _handleCancel, () => {
71
74
  if (__privateGet(this, _dispatchUiStateEvent).call(this, "cancel")) this.open = false;
72
75
  });
@@ -165,9 +168,15 @@ let GdsPopover = class extends GdsElement {
165
168
  const t = e.target;
166
169
  if (t === this) return;
167
170
  if (t.tagName === "INPUT" || t.tagName === "TEXTAREA") {
171
+ __privateMethod(this, _GdsPopover_instances, cancelPendingVirtKbHide_fn).call(this);
168
172
  this._isVirtKbVisible = true;
169
173
  } else {
170
- this._isVirtKbVisible = false;
174
+ __privateMethod(this, _GdsPopover_instances, cancelPendingVirtKbHide_fn).call(this);
175
+ window.addEventListener(
176
+ "pointerup",
177
+ __privateGet(this, _hideVirtKbAfterGesture),
178
+ { once: true }
179
+ );
171
180
  }
172
181
  });
173
182
  this.addEventListener("blurin", (_) => {
@@ -178,6 +187,7 @@ let GdsPopover = class extends GdsElement {
178
187
  super.disconnectedCallback();
179
188
  __privateMethod(this, _GdsPopover_instances, unregisterTriggerEvents_fn).call(this);
180
189
  __privateMethod(this, _GdsPopover_instances, unregisterClickOutside_fn).call(this);
190
+ __privateMethod(this, _GdsPopover_instances, cancelPendingVirtKbHide_fn).call(this);
181
191
  window.removeEventListener("scroll", __privateGet(this, _handlePageScroll));
182
192
  }
183
193
  render() {
@@ -270,6 +280,10 @@ _autoPositionCleanupFn = new WeakMap();
270
280
  _isMobileViewport = new WeakMap();
271
281
  _backdropEl = new WeakMap();
272
282
  _clickOutsideTarget = new WeakMap();
283
+ _hideVirtKbAfterGesture = new WeakMap();
284
+ cancelPendingVirtKbHide_fn = function() {
285
+ window.removeEventListener("pointerup", __privateGet(this, _hideVirtKbAfterGesture));
286
+ };
273
287
  registerClickOutside_fn = function() {
274
288
  if (!this.open || !this.isConnected) return;
275
289
  __privateMethod(this, _GdsPopover_instances, unregisterClickOutside_fn).call(this);
@@ -14,6 +14,7 @@ import { gdsCustomElement, html } from "../../scoping.js";
14
14
  import { tokens } from "../../tokens.style.js";
15
15
  import { ariaForwarding } from "../../utils/decorators/aria-forwarding.js";
16
16
  import { styleExpressionProperty } from "../../utils/decorators/style-expression-property.js";
17
+ import { gdsGetLocale } from "../../utils/localization/localization.js";
17
18
  import {
18
19
  withLayoutChildProps,
19
20
  withMarginProps,
@@ -42,6 +43,7 @@ let Progress = class extends GdsElement {
42
43
  }
43
44
  connectedCallback() {
44
45
  super.connectedCallback();
46
+ this._currentLocale = gdsGetLocale();
45
47
  window.addEventListener("lit-localize-status", __privateGet(this, _handleLocaleStatus));
46
48
  }
47
49
  disconnectedCallback() {
@@ -236,7 +236,7 @@ isExpandableEnabled_get = function() {
236
236
  return !__privateGet(this, _GdsTable_instances, isResponsiveStacked_get) && __privateGet(this, _GdsTable_instances, expandableIndices_get).length > 0;
237
237
  };
238
238
  isSelectableEnabled_get = function() {
239
- return this.selectable && !__privateGet(this, _GdsTable_instances, isResponsiveStacked_get);
239
+ return this.selectable;
240
240
  };
241
241
  Density_get = function() {
242
242
  return Types.DENSITY_CONFIG[this.density];
@@ -835,16 +835,22 @@ renderExpandableCell_fn = function(row, index) {
835
835
  </td>
836
836
  `;
837
837
  };
838
- renderSelectableCell_fn = function(index) {
838
+ renderSelectableCell_fn = function(row, index) {
839
839
  if (!__privateGet(this, _GdsTable_instances, isSelectableEnabled_get)) return null;
840
- const selectRowLabel = `${msg("Select row")} ${index + 1}`;
840
+ const selectRowLabel = row.selectLabel || `${msg("Select row")} ${index + 1}`;
841
+ const isMobile = this._isMobile && this.responsive;
842
+ const inputId = `select-row-${index}`;
841
843
  return html`
842
844
  <td class="checkbox-cell">
845
+ ${isMobile ? html`<label class="column-label" aria-hidden="true" for=${inputId}
846
+ >${selectRowLabel}</label
847
+ >` : null}
843
848
  <div class="cell-center" role="presentation">
844
849
  ${__privateMethod(this, _GdsTable_instances, renderCheckbox_fn).call(this, {
845
850
  checked: this._selected.has(index),
846
851
  indeterminate: false,
847
852
  ariaLabel: selectRowLabel,
853
+ inputId,
848
854
  onToggle: () => __privateMethod(this, _GdsTable_instances, handleRowSelect_fn).call(this, index, {
849
855
  detail: { checked: !this._selected.has(index) }
850
856
  })
@@ -1031,7 +1037,7 @@ renderTableRow_fn = function(row, index) {
1031
1037
  >
1032
1038
  ${[
1033
1039
  __privateMethod(this, _GdsTable_instances, renderExpandableCell_fn).call(this, row, index),
1034
- __privateMethod(this, _GdsTable_instances, renderSelectableCell_fn).call(this, index),
1040
+ __privateMethod(this, _GdsTable_instances, renderSelectableCell_fn).call(this, row, index),
1035
1041
  __privateMethod(this, _GdsTable_instances, renderRowCells_fn).call(this, row, index)
1036
1042
  ]}
1037
1043
  </tr>
@@ -1047,7 +1053,8 @@ renderCheckbox_fn = function({
1047
1053
  disabled = false,
1048
1054
  ariaLabel,
1049
1055
  onToggle,
1050
- skip = false
1056
+ skip = false,
1057
+ inputId
1051
1058
  }) {
1052
1059
  if (skip) return null;
1053
1060
  const toggle = (e) => {
@@ -1062,6 +1069,16 @@ renderCheckbox_fn = function({
1062
1069
  }
1063
1070
  };
1064
1071
  return html`
1072
+ <input
1073
+ id=${ifDefined(inputId)}
1074
+ type="checkbox"
1075
+ class="visually-hidden-checkbox"
1076
+ .checked=${checked}
1077
+ .indeterminate=${indeterminate}
1078
+ ?disabled=${disabled}
1079
+ aria-hidden="true"
1080
+ @change=${toggle}
1081
+ />
1065
1082
  <div
1066
1083
  class="rbcb-wrapper"
1067
1084
  role="checkbox"
@@ -1070,15 +1087,6 @@ renderCheckbox_fn = function({
1070
1087
  @click=${toggle}
1071
1088
  @keydown=${onKey}
1072
1089
  >
1073
- <input
1074
- type="checkbox"
1075
- class="visually-hidden-checkbox"
1076
- .checked=${checked}
1077
- .indeterminate=${indeterminate}
1078
- ?disabled=${disabled}
1079
- aria-hidden="true"
1080
- @change=${toggle}
1081
- />
1082
1090
  ${Table.Checkbox({
1083
1091
  checked,
1084
1092
  indeterminate,
@@ -1146,7 +1154,8 @@ renderTableBody_fn = function() {
1146
1154
  this._expanding.has(index),
1147
1155
  this._completingExpansion.has(index),
1148
1156
  this._expandedRowsCache.get(index),
1149
- this._expandedFullContentResolved.has(index)
1157
+ this._expandedFullContentResolved.has(index),
1158
+ __privateGet(this, _GdsTable_instances, isResponsiveStacked_get)
1150
1159
  ],
1151
1160
  () => __privateMethod(this, _GdsTable_instances, renderTableRow_fn).call(this, row, index)
1152
1161
  )
@@ -16,7 +16,9 @@ const defineSlots = (row) => ({
16
16
  account: Slot(row.account, ["main"]),
17
17
  login: Slot(row.lastLogin, ["main"]),
18
18
  download: Slot(row.download ?? "#", ["main"]),
19
- actions: Slot(void 0, ["main"])
19
+ actions: Slot(void 0, ["main"]),
20
+ // Demonstrates the per-row `selectLabel` override, derived from the row's own name.
21
+ selectLabel: `Select ${String(row.name).split(" ")[0]}`
20
22
  });
21
23
  let usersRawCache = null;
22
24
  let usersRawPromise = null;
@@ -604,7 +606,9 @@ const financeRows = financeBaseRows.map((row) => ({
604
606
  available: Slot(row.available, ["available-value", "available-currency"]),
605
607
  status: Slot(row.status, ["status"]),
606
608
  accountNumberDisplay: Slot(row.accountNumber, ["main"]),
607
- actions: Slot(void 0, ["main"])
609
+ actions: Slot(void 0, ["main"]),
610
+ // Demonstrates the per-row `selectLabel` override, derived from the row's own account name.
611
+ selectLabel: `Select: ${row.account}`
608
612
  }));
609
613
  const financeExpandableData = async (request) => {
610
614
  let data = [...financeRows];
@@ -349,6 +349,12 @@ const TableStyles = css`
349
349
  height: 100%;
350
350
  }
351
351
 
352
+ /* The input sits beside the wrapper (not inside) so label clicks don't toggle twice. */
353
+ .visually-hidden-checkbox:focus-visible + .rbcb-wrapper .rbcb__perimeter {
354
+ outline-width: var(--gds-sys-space-4xs);
355
+ scale: 1;
356
+ }
357
+
352
358
  /* Expanded */
353
359
 
354
360
  .expander-cell {
@@ -784,11 +790,13 @@ const TableStyles = css`
784
790
  .responsive tbody tr {
785
791
  display: flex;
786
792
  flex-direction: column;
787
- padding: var(--table-cell-padding-x);
788
793
  border: var(--gds-sys-space-5xs) solid
789
794
  var(--gds-sys-color-border-neutral-02);
790
795
  border-radius: var(--gds-sys-space-s);
791
796
  margin: 0;
797
+ /* No card padding: each cell carries its own, so a sticky cell's
798
+ divider/background can reach the card edge without negative margins. */
799
+ overflow: hidden;
792
800
  }
793
801
 
794
802
  .responsive tbody tr:hover,
@@ -807,7 +815,6 @@ const TableStyles = css`
807
815
  display: flex;
808
816
  justify-content: flex-start;
809
817
  align-items: center;
810
- padding: var(--gds-sys-space-xs) 0;
811
818
  border: none;
812
819
  }
813
820
 
@@ -815,8 +822,63 @@ const TableStyles = css`
815
822
  .responsive td.checkbox-cell {
816
823
  width: auto;
817
824
  max-width: none;
818
- padding-top: 0;
819
- padding-bottom: var(--gds-sys-space-xs);
825
+ }
826
+
827
+ .responsive td.sticky-left,
828
+ .responsive td.sticky-right {
829
+ position: static;
830
+ z-index: auto;
831
+ }
832
+
833
+ /* Leading cells sit above the rest of the card; the divider goes under
834
+ whichever is the outermost one (mirrors the desktop sticky divider
835
+ logic), with margin to compensate for the card's own padding being
836
+ removed. */
837
+ .responsive.is-selectable:not(.has-sticky-left) td.checkbox-cell,
838
+ .responsive.is-expandable:not(.is-selectable):not(.has-sticky-left)
839
+ td.expander-cell,
840
+ .responsive.has-sticky-left td.sticky-left-last {
841
+ border-bottom: var(--gds-sys-space-5xs) solid
842
+ var(--gds-sys-color-border-neutral-02);
843
+ margin-bottom: var(--table-cell-padding-x);
844
+ }
845
+
846
+ /* Trailing sticky-right cells (e.g. actions) sit below the rest of the card. */
847
+ .responsive.has-sticky-right td.sticky-right {
848
+ border-top: var(--gds-sys-space-5xs) solid
849
+ var(--gds-sys-color-border-neutral-02);
850
+ margin-top: var(--table-cell-padding-x);
851
+ }
852
+
853
+ /* Whole cell gets the header-matching highlight on mobile, not just the control. */
854
+ .responsive td.checkbox-cell {
855
+ margin: var(--gds-sys-space-2xs);
856
+ background: var(--_table-header-bg);
857
+ border-radius: var(--gds-sys-radius-s);
858
+ }
859
+
860
+ /* Reset width so the label's flex: 1 pushes the checkbox flush right. */
861
+ .responsive td.checkbox-cell .cell-center {
862
+ width: auto;
863
+ flex: 0 0 auto;
864
+ }
865
+
866
+ /* Cells stack into a card, not a row, so the desktop hover/selected
867
+ edge-rounding (first/last column) doesn't apply here. */
868
+ .responsive tbody tr:hover td:first-child,
869
+ .responsive tbody tr:hover td:last-child,
870
+ .responsive tbody tr.selected td:first-child,
871
+ .responsive tbody tr.selected td:last-child,
872
+ .responsive.striped tbody tr td:first-child,
873
+ .responsive.striped tbody tr td:last-child {
874
+ border-radius: 0;
875
+ }
876
+
877
+ /* The checkbox-cell keeps its own fixed pill radius regardless of hover/selected state. */
878
+ .responsive tbody tr:hover td.checkbox-cell,
879
+ .responsive tbody tr.selected td.checkbox-cell,
880
+ .responsive.striped tbody tr td.checkbox-cell {
881
+ border-radius: var(--gds-sys-radius-s);
820
882
  }
821
883
 
822
884
  .responsive .expand-toggle {
@@ -847,6 +909,23 @@ const TableStyles = css`
847
909
  }
848
910
  }
849
911
 
912
+ /* Narrow screens: stack label above content, except the select column.
913
+ Wrap (not column-direction) so multi-slot content (e.g. value + currency
914
+ badge) stays on one line together, after the full-width label forces a break. */
915
+ @media (max-width: 400px) {
916
+ .responsive td:not(.checkbox-cell) .cell-content {
917
+ flex-wrap: wrap;
918
+ align-items: center;
919
+ row-gap: var(--gds-sys-space-4xs);
920
+ column-gap: var(--gds-sys-space-s);
921
+ }
922
+
923
+ .responsive td:not(.checkbox-cell) .column-label {
924
+ flex: initial;
925
+ width: 100%;
926
+ }
927
+ }
928
+
850
929
  /* Medium screens: input and dropdown side by side */
851
930
  @media (max-width: 760px) and (min-width: 480px) {
852
931
  .header {
@@ -55,6 +55,8 @@ export type RowMeta<T extends Record<string, unknown> = Record<string, unknown>>
55
55
  expandLabel?: string;
56
56
  /** Optional per-row label for expanded state toggle action. */
57
57
  collapseLabel?: string;
58
+ /** Optional per-row label for the row-selection checkbox, replacing the default "Select row N". */
59
+ selectLabel?: string;
58
60
  /**
59
61
  * Async readiness signal for slotted full-width expanded content.
60
62
  * Called when the row is expanded. The table shows a loading skeleton
@@ -0,0 +1 @@
1
+ export * from './tooltip';
@@ -0,0 +1 @@
1
+ export * from "./tooltip.js";
@@ -0,0 +1,52 @@
1
+ import { Placement } from '@floating-ui/dom';
2
+ import { GdsElement } from '../../gds-element';
3
+ export type TooltipUIStateChangeReason = 'show' | 'close' | 'cancel';
4
+ /**
5
+ * @element gds-tooltip
6
+ *
7
+ * A tooltip shows short, supplementary text about an element on hover or keyboard focus.
8
+ *
9
+ * Point the tooltip at its trigger with the `for` attribute, using the id of the trigger element.
10
+ * The tooltip is linked to the trigger through `aria-describedby`, so it does not replace the
11
+ * accessible name of the trigger. An icon-only button still needs its own label.
12
+ *
13
+ * Use a popover instead when the content is interactive or needs to stay open.
14
+ *
15
+ * @event gds-ui-state - Fired when the tooltip is about to open or close. Can be cancelled to prevent the state change. The `detail` object contains the `open` boolean for the resulting state, and the `reason` string, which is one of `show`, `close` or `cancel`.
16
+ *
17
+ * @slot - The tooltip text.
18
+ *
19
+ * @status beta
20
+ */
21
+ export declare class GdsTooltip extends GdsElement {
22
+ #private;
23
+ static styles: (import("lit").CSSResult | import("lit").CSSResult[])[];
24
+ /**
25
+ * Whether the tooltip is visible.
26
+ */
27
+ open: boolean;
28
+ /**
29
+ * The id of the trigger element. The id is resolved in the same document or shadow root as the tooltip.
30
+ */
31
+ for?: string;
32
+ /**
33
+ * The preferred placement of the tooltip relative to the trigger. The tooltip flips and shifts
34
+ * automatically when there is not enough space.
35
+ * Accepts any of the placements supported by Floating UI.
36
+ */
37
+ placement: Placement;
38
+ /**
39
+ * Delay in milliseconds before the tooltip opens on hover. Keyboard focus opens it without delay,
40
+ * and so does hovering another trigger right after a tooltip was shown.
41
+ */
42
+ delay: number;
43
+ private _side?;
44
+ private _multiline;
45
+ private _elContainer;
46
+ connectedCallback(): void;
47
+ disconnectedCallback(): void;
48
+ render(): any;
49
+ private _handleForChange;
50
+ private _handleOpenChange;
51
+ private _handlePlacementChange;
52
+ }