@warp-ds/elements 2.0.2 → 2.1.0-next.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.
Files changed (35) hide show
  1. package/dist/index.js +356 -151
  2. package/dist/index.js.map +4 -4
  3. package/dist/packages/affix/index.js +26 -22
  4. package/dist/packages/affix/index.js.map +3 -3
  5. package/dist/packages/alert/index.js +44 -36
  6. package/dist/packages/alert/index.js.map +3 -3
  7. package/dist/packages/attention/index.js +208 -46
  8. package/dist/packages/attention/index.js.map +4 -4
  9. package/dist/packages/attention/locales/sv/messages.d.mts +1 -0
  10. package/dist/packages/breadcrumbs/index.js +19 -15
  11. package/dist/packages/breadcrumbs/index.js.map +4 -4
  12. package/dist/packages/breadcrumbs/locales/sv/messages.d.mts +1 -0
  13. package/dist/packages/button/index.js +18 -14
  14. package/dist/packages/button/index.js.map +4 -4
  15. package/dist/packages/button/locales/sv/messages.d.mts +1 -0
  16. package/dist/packages/card/index.js +18 -14
  17. package/dist/packages/card/index.js.map +4 -4
  18. package/dist/packages/card/locales/sv/messages.d.mts +1 -0
  19. package/dist/packages/expandable/index.js +26 -22
  20. package/dist/packages/expandable/index.js.map +3 -3
  21. package/dist/packages/i18n.d.ts +4 -4
  22. package/dist/packages/modal/index.js +39 -31
  23. package/dist/packages/modal/index.js.map +4 -4
  24. package/dist/packages/modal/locales/sv/messages.d.mts +1 -0
  25. package/dist/packages/pill/index.js +31 -25
  26. package/dist/packages/pill/index.js.map +4 -4
  27. package/dist/packages/pill/locales/sv/messages.d.mts +1 -0
  28. package/dist/packages/select/index.d.ts +3 -0
  29. package/dist/packages/select/index.js +34 -22
  30. package/dist/packages/select/index.js.map +4 -4
  31. package/dist/packages/select/locales/sv/messages.d.mts +1 -0
  32. package/dist/packages/toast/index.js +57 -45
  33. package/dist/packages/toast/index.js.map +4 -4
  34. package/dist/packages/toast/locales/sv/messages.d.mts +1 -0
  35. package/package.json +6 -3
@@ -645,13 +645,13 @@ var require_moo = __commonJS({
645
645
  line: this.line,
646
646
  col: this.col
647
647
  };
648
- var size2 = text.length;
649
- this.index += size2;
648
+ var size3 = text.length;
649
+ this.index += size3;
650
650
  this.line += lineBreaks;
651
651
  if (lineBreaks !== 0) {
652
- this.col = size2 - nl + 1;
652
+ this.col = size3 - nl + 1;
653
653
  } else {
654
- this.col += size2;
654
+ this.col += size3;
655
655
  }
656
656
  if (group.shouldThrow) {
657
657
  var err = new Error(this.formatError(token, "invalid syntax"));
@@ -1306,17 +1306,17 @@ var I18n = class extends EventEmitter {
1306
1306
  }
1307
1307
  this.emit("change");
1308
1308
  }
1309
- _load(locale, messages6) {
1309
+ _load(locale, messages7) {
1310
1310
  const maybeMessages = this._messages[locale];
1311
1311
  if (!maybeMessages) {
1312
- this._messages[locale] = messages6;
1312
+ this._messages[locale] = messages7;
1313
1313
  } else {
1314
- Object.assign(maybeMessages, messages6);
1314
+ Object.assign(maybeMessages, messages7);
1315
1315
  }
1316
1316
  }
1317
- load(localeOrMessages, messages6) {
1318
- if (typeof localeOrMessages == "string" && typeof messages6 === "object") {
1319
- this._load(localeOrMessages, messages6);
1317
+ load(localeOrMessages, messages7) {
1318
+ if (typeof localeOrMessages == "string" && typeof messages7 === "object") {
1319
+ this._load(localeOrMessages, messages7);
1320
1320
  } else {
1321
1321
  Object.entries(localeOrMessages).forEach(
1322
1322
  ([locale, messages23]) => this._load(locale, messages23)
@@ -1327,10 +1327,10 @@ var I18n = class extends EventEmitter {
1327
1327
  /**
1328
1328
  * @param options {@link LoadAndActivateOptions}
1329
1329
  */
1330
- loadAndActivate({ locale, locales, messages: messages6 }) {
1330
+ loadAndActivate({ locale, locales, messages: messages7 }) {
1331
1331
  this._locale = locale;
1332
1332
  this._locales = locales || void 0;
1333
- this._messages[this._locale] = messages6;
1333
+ this._messages[this._locale] = messages7;
1334
1334
  this.emit("change");
1335
1335
  }
1336
1336
  activate(locale, locales) {
@@ -2004,6 +2004,151 @@ var offset = function(options) {
2004
2004
  }
2005
2005
  };
2006
2006
  };
2007
+ var shift = function(options) {
2008
+ if (options === void 0) {
2009
+ options = {};
2010
+ }
2011
+ return {
2012
+ name: "shift",
2013
+ options,
2014
+ async fn(state) {
2015
+ const {
2016
+ x,
2017
+ y,
2018
+ placement
2019
+ } = state;
2020
+ const _a = evaluate(options, state), {
2021
+ mainAxis: checkMainAxis = true,
2022
+ crossAxis: checkCrossAxis = false,
2023
+ limiter = {
2024
+ fn: (_ref) => {
2025
+ let {
2026
+ x: x2,
2027
+ y: y2
2028
+ } = _ref;
2029
+ return {
2030
+ x: x2,
2031
+ y: y2
2032
+ };
2033
+ }
2034
+ }
2035
+ } = _a, detectOverflowOptions = __objRest(_a, [
2036
+ "mainAxis",
2037
+ "crossAxis",
2038
+ "limiter"
2039
+ ]);
2040
+ const coords = {
2041
+ x,
2042
+ y
2043
+ };
2044
+ const overflow = await detectOverflow(state, detectOverflowOptions);
2045
+ const crossAxis = getSideAxis(getSide(placement));
2046
+ const mainAxis = getOppositeAxis(crossAxis);
2047
+ let mainAxisCoord = coords[mainAxis];
2048
+ let crossAxisCoord = coords[crossAxis];
2049
+ if (checkMainAxis) {
2050
+ const minSide = mainAxis === "y" ? "top" : "left";
2051
+ const maxSide = mainAxis === "y" ? "bottom" : "right";
2052
+ const min2 = mainAxisCoord + overflow[minSide];
2053
+ const max2 = mainAxisCoord - overflow[maxSide];
2054
+ mainAxisCoord = clamp(min2, mainAxisCoord, max2);
2055
+ }
2056
+ if (checkCrossAxis) {
2057
+ const minSide = crossAxis === "y" ? "top" : "left";
2058
+ const maxSide = crossAxis === "y" ? "bottom" : "right";
2059
+ const min2 = crossAxisCoord + overflow[minSide];
2060
+ const max2 = crossAxisCoord - overflow[maxSide];
2061
+ crossAxisCoord = clamp(min2, crossAxisCoord, max2);
2062
+ }
2063
+ const limitedCoords = limiter.fn(__spreadProps(__spreadValues({}, state), {
2064
+ [mainAxis]: mainAxisCoord,
2065
+ [crossAxis]: crossAxisCoord
2066
+ }));
2067
+ return __spreadProps(__spreadValues({}, limitedCoords), {
2068
+ data: {
2069
+ x: limitedCoords.x - x,
2070
+ y: limitedCoords.y - y
2071
+ }
2072
+ });
2073
+ }
2074
+ };
2075
+ };
2076
+ var size = function(options) {
2077
+ if (options === void 0) {
2078
+ options = {};
2079
+ }
2080
+ return {
2081
+ name: "size",
2082
+ options,
2083
+ async fn(state) {
2084
+ const {
2085
+ placement,
2086
+ rects,
2087
+ platform: platform2,
2088
+ elements
2089
+ } = state;
2090
+ const _a = evaluate(options, state), {
2091
+ apply = () => {
2092
+ }
2093
+ } = _a, detectOverflowOptions = __objRest(_a, [
2094
+ "apply"
2095
+ ]);
2096
+ const overflow = await detectOverflow(state, detectOverflowOptions);
2097
+ const side2 = getSide(placement);
2098
+ const alignment = getAlignment(placement);
2099
+ const isYAxis = getSideAxis(placement) === "y";
2100
+ const {
2101
+ width,
2102
+ height
2103
+ } = rects.floating;
2104
+ let heightSide;
2105
+ let widthSide;
2106
+ if (side2 === "top" || side2 === "bottom") {
2107
+ heightSide = side2;
2108
+ widthSide = alignment === (await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
2109
+ } else {
2110
+ widthSide = side2;
2111
+ heightSide = alignment === "end" ? "top" : "bottom";
2112
+ }
2113
+ const maximumClippingHeight = height - overflow.top - overflow.bottom;
2114
+ const maximumClippingWidth = width - overflow.left - overflow.right;
2115
+ const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
2116
+ const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
2117
+ const noShift = !state.middlewareData.shift;
2118
+ let availableHeight = overflowAvailableHeight;
2119
+ let availableWidth = overflowAvailableWidth;
2120
+ if (isYAxis) {
2121
+ availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
2122
+ } else {
2123
+ availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
2124
+ }
2125
+ if (noShift && !alignment) {
2126
+ const xMin = max(overflow.left, 0);
2127
+ const xMax = max(overflow.right, 0);
2128
+ const yMin = max(overflow.top, 0);
2129
+ const yMax = max(overflow.bottom, 0);
2130
+ if (isYAxis) {
2131
+ availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
2132
+ } else {
2133
+ availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
2134
+ }
2135
+ }
2136
+ await apply(__spreadProps(__spreadValues({}, state), {
2137
+ availableWidth,
2138
+ availableHeight
2139
+ }));
2140
+ const nextDimensions = await platform2.getDimensions(elements.floating);
2141
+ if (width !== nextDimensions.width || height !== nextDimensions.height) {
2142
+ return {
2143
+ reset: {
2144
+ rects: true
2145
+ }
2146
+ };
2147
+ }
2148
+ return {};
2149
+ }
2150
+ };
2151
+ };
2007
2152
 
2008
2153
  // node_modules/.pnpm/@floating-ui+utils@0.2.7/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
2009
2154
  function getNodeName(node) {
@@ -2541,7 +2686,9 @@ var platform = {
2541
2686
  isRTL
2542
2687
  };
2543
2688
  var offset2 = offset;
2689
+ var shift2 = shift;
2544
2690
  var flip2 = flip;
2691
+ var size2 = size;
2545
2692
  var hide2 = hide;
2546
2693
  var arrow2 = arrow;
2547
2694
  var computePosition2 = (reference, floating, options) => {
@@ -2557,7 +2704,7 @@ var computePosition2 = (reference, floating, options) => {
2557
2704
  }));
2558
2705
  };
2559
2706
 
2560
- // node_modules/.pnpm/@warp-ds+core@1.1.5_@floating-ui+dom@1.6.10/node_modules/@warp-ds/core/dist/attention/utils/helpers.js
2707
+ // node_modules/.pnpm/@warp-ds+core@1.1.8_@floating-ui+dom@1.6.10/node_modules/@warp-ds/core/dist/attention/utils/helpers.js
2561
2708
  var TOP_START = "top-start";
2562
2709
  var TOP = "top";
2563
2710
  var TOP_END = "top-end";
@@ -2634,6 +2781,8 @@ var applyArrowStyles = (arrowEl, arrowRotation2, dir) => {
2634
2781
  transform: `rotate(${arrowRotation2}deg)`
2635
2782
  });
2636
2783
  };
2784
+ var ELEMENT_PADDING = 8;
2785
+ var ARROW_OFFSET = 24;
2637
2786
  async function useRecompute(state) {
2638
2787
  var _a, _b, _c;
2639
2788
  if (!(state == null ? void 0 : state.isShowing))
@@ -2656,9 +2805,19 @@ async function useRecompute(state) {
2656
2805
  // checks overflow to trigger a flip. When disabled, it will ignore overflow
2657
2806
  fallbackPlacements: state == null ? void 0 : state.fallbackPlacements
2658
2807
  }),
2808
+ (state == null ? void 0 : state.flip) && shift2({ crossAxis: true }),
2809
+ // shifts the attentionEl to make sure that it stays in view
2659
2810
  !(state == null ? void 0 : state.noArrow) && (state == null ? void 0 : state.arrowEl) && arrow2({ element: state == null ? void 0 : state.arrowEl }),
2660
- hide2()
2811
+ hide2(),
2661
2812
  // will hide the attentionEl when it appears detached from the targetEl. Can be called multiple times in the middleware-array if you want to use several strategies. Default strategy is 'referenceHidden'.
2813
+ size2({
2814
+ apply() {
2815
+ Object.assign(attentionEl.style, {
2816
+ paddingRight: `${ELEMENT_PADDING}px`,
2817
+ paddingLeft: `${ELEMENT_PADDING}px`
2818
+ });
2819
+ }
2820
+ })
2662
2821
  ]
2663
2822
  }).then(({ x, y, middlewareData, placement }) => {
2664
2823
  state.actualDirection = placement;
@@ -2674,25 +2833,22 @@ async function useRecompute(state) {
2674
2833
  visibility: referenceHidden ? "hidden" : ""
2675
2834
  });
2676
2835
  }
2677
- const isRtl = window.getComputedStyle(attentionEl).direction === "rtl";
2678
- const arrowPlacement = arrowDirection(placement).split("-")[1];
2679
2836
  if ((middlewareData == null ? void 0 : middlewareData.arrow) && (state == null ? void 0 : state.arrowEl)) {
2680
2837
  const arrowEl = state == null ? void 0 : state.arrowEl;
2681
2838
  const { x: arrowX, y: arrowY } = middlewareData.arrow;
2682
- let top = "";
2683
- let right = "";
2684
- let bottom = "";
2685
- let left = "";
2839
+ const isRtl = window.getComputedStyle(attentionEl).direction === "rtl";
2840
+ const arrowPlacement = arrowDirection(placement).split("-")[1];
2841
+ let top = "", right = "", bottom = "", left = "";
2686
2842
  if (arrowPlacement === "start") {
2687
- const value = typeof arrowX === "number" ? `calc(24px - ${arrowEl.offsetWidth / 2}px)` : "";
2688
- top = typeof arrowY === "number" ? `calc(24px - ${arrowEl.offsetWidth / 2}px)` : "";
2843
+ const value = typeof arrowX === "number" ? `calc(${ARROW_OFFSET}px - ${arrowEl.offsetWidth / 2}px)` : "";
2844
+ top = typeof arrowY === "number" ? `calc(${ARROW_OFFSET}px - ${arrowEl.offsetWidth / 2}px)` : "";
2689
2845
  right = isRtl ? value : "";
2690
2846
  left = isRtl ? "" : value;
2691
2847
  } else if (arrowPlacement === "end") {
2692
- const value = typeof arrowX === "number" ? `calc(24px - ${arrowEl.offsetWidth / 2}px)` : "";
2848
+ const value = typeof arrowX === "number" ? `calc(${ARROW_OFFSET}px - ${arrowEl.offsetWidth / 2}px)` : "";
2693
2849
  right = isRtl ? "" : value;
2694
2850
  left = isRtl ? value : "";
2695
- bottom = typeof arrowY === "number" ? `calc(24px - ${arrowEl.offsetWidth / 2}px)` : "";
2851
+ bottom = typeof arrowY === "number" ? `calc(${ARROW_OFFSET}px - ${arrowEl.offsetWidth / 2}px)` : "";
2696
2852
  } else {
2697
2853
  left = typeof arrowX === "number" ? `${arrowX}px` : "";
2698
2854
  top = typeof arrowY === "number" ? `${arrowY}px` : "";
@@ -2943,7 +3099,7 @@ import WarpElement from "@warp-ds/elements-core";
2943
3099
  import { ifDefined } from "lit/directives/if-defined.js";
2944
3100
 
2945
3101
  // packages/i18n.ts
2946
- var supportedLocales = ["en", "nb", "fi", "da"];
3102
+ var supportedLocales = ["en", "nb", "fi", "da", "sv"];
2947
3103
  var defaultLocale2 = "en";
2948
3104
  var getSupportedLocale = (usedLocale) => {
2949
3105
  return supportedLocales.find(
@@ -2963,16 +3119,17 @@ function detectLocale() {
2963
3119
  return defaultLocale2;
2964
3120
  }
2965
3121
  }
2966
- var getMessages = (locale, enMsg, nbMsg, fiMsg, daMsg) => {
3122
+ var getMessages = (locale, enMsg, nbMsg, fiMsg, daMsg, svMsg) => {
2967
3123
  if (locale === "nb") return nbMsg;
2968
3124
  if (locale === "fi") return fiMsg;
2969
3125
  if (locale === "da") return daMsg;
3126
+ if (locale === "sv") return svMsg;
2970
3127
  return enMsg;
2971
3128
  };
2972
- var activateI18n = (enMessages, nbMessages, fiMessages, daMessages) => {
3129
+ var activateI18n = (enMessages, nbMessages, fiMessages, daMessages, svMessages) => {
2973
3130
  const locale = detectLocale();
2974
- const messages6 = getMessages(locale, enMessages, nbMessages, fiMessages, daMessages);
2975
- i18n.load(locale, messages6);
3131
+ const messages7 = getMessages(locale, enMessages, nbMessages, fiMessages, daMessages, svMessages);
3132
+ i18n.load(locale, messages7);
2976
3133
  i18n.activate(locale);
2977
3134
  };
2978
3135
 
@@ -3008,13 +3165,17 @@ var messages3 = JSON.parse('{"attention.aria.callout":"Vihre\xE4 puhekupla, joka
3008
3165
  // packages/attention/locales/nb/messages.mjs
3009
3166
  var messages4 = JSON.parse('{"attention.aria.callout":"Gr\xF8nn taleboble som introduserer noe nytt","attention.aria.close":"Lukk","attention.aria.highlight":"En uthevet taleboble med viktig informasjon","attention.aria.pointingDown":"peker ned","attention.aria.pointingLeft":"peker til venstre","attention.aria.pointingRight":"peker til h\xF8yre","attention.aria.pointingUp":"peker opp","attention.aria.popover":"En hvit taleboble som gir tilleggsinformasjon","attention.aria.tooltip":"En svart taleboble som forklarer konteksten"}');
3010
3167
 
3011
- // node_modules/.pnpm/@warp-ds+icons@2.1.0/node_modules/@warp-ds/icons/dist/elements/close-16.js
3168
+ // packages/attention/locales/sv/messages.mjs
3169
+ var messages5 = JSON.parse('{"attention.aria.callout":"En gr\xF6n pratbubbla som introducerar n\xE5got nytt","attention.aria.close":"St\xE4ng","attention.aria.highlight":"En pratbubbla med viktig information","attention.aria.pointingDown":"pekar ned","attention.aria.pointingLeft":"pekar v\xE4nster","attention.aria.pointingRight":"pekar h\xF6ger","attention.aria.pointingUp":"pekar upp","attention.aria.popover":"En vit pratbubbla som ger ytterligare information","attention.aria.tooltip":"En svart pratbubbla som ger kompletterande information"}');
3170
+
3171
+ // node_modules/.pnpm/@warp-ds+icons@2.4.0/node_modules/@warp-ds/icons/dist/elements/close-16.js
3012
3172
  import { LitElement } from "lit";
3013
3173
  import { unsafeStatic, html } from "lit/static-html.js";
3014
- var messages5 = JSON.parse('{"icon.title.close":"Kryss"}');
3174
+ var messages6 = JSON.parse('{"icon.title.close":"Kryss"}');
3015
3175
  var messages22 = JSON.parse('{"icon.title.close":"Cross"}');
3016
3176
  var messages32 = JSON.parse('{"icon.title.close":"Rasti"}');
3017
3177
  var messages42 = JSON.parse('{"icon.title.close":"Kryds"}');
3178
+ var messages52 = JSON.parse('{"icon.title.close":"Kryss"}');
3018
3179
  var supportedLocales2 = ["en", "nb", "fi", "da", "sv"];
3019
3180
  var defaultLocale3 = "en";
3020
3181
  var detectByBrand = () => {
@@ -3077,19 +3238,20 @@ function detectLocale2() {
3077
3238
  return defaultLocale3;
3078
3239
  }
3079
3240
  }
3080
- var getMessages2 = (locale, enMsg, nbMsg, fiMsg, daMsg) => {
3241
+ var getMessages2 = (locale, enMsg, nbMsg, fiMsg, daMsg, svMsg) => {
3081
3242
  if (locale === "nb") return nbMsg;
3082
3243
  if (locale === "fi") return fiMsg;
3083
3244
  if (locale === "da") return daMsg;
3245
+ if (locale === "sv") return svMsg;
3084
3246
  return enMsg;
3085
3247
  };
3086
- var activateI18n2 = (enMessages, nbMessages, fiMessages, daMessages) => {
3248
+ var activateI18n2 = (enMessages, nbMessages, fiMessages, daMessages, svMessages) => {
3087
3249
  const locale = detectLocale2();
3088
- const messages52 = getMessages2(locale, enMessages, nbMessages, fiMessages, daMessages);
3089
- i18n.load(locale, messages52);
3250
+ const messages62 = getMessages2(locale, enMessages, nbMessages, fiMessages, daMessages, svMessages);
3251
+ i18n.load(locale, messages62);
3090
3252
  i18n.activate(locale);
3091
3253
  };
3092
- activateI18n2(messages22, messages5, messages32, messages42);
3254
+ activateI18n2(messages22, messages6, messages32, messages42, messages52);
3093
3255
  var IconClose16 = class extends LitElement {
3094
3256
  render() {
3095
3257
  const title = i18n.t({ message: `Cross`, id: "icon.title.close", comment: "Title for close icon" });
@@ -3104,7 +3266,7 @@ if (!customElements.get("w-icon-close-16")) {
3104
3266
  var WarpAttention = class extends kebabCaseAttributes(WarpElement) {
3105
3267
  constructor() {
3106
3268
  super();
3107
- activateI18n(messages2, messages4, messages3, messages);
3269
+ activateI18n(messages2, messages4, messages3, messages, messages5);
3108
3270
  this.handleDone = this.handleDone.bind(this);
3109
3271
  this.show = false;
3110
3272
  this.placement = "bottom";
@@ -3133,7 +3295,10 @@ ${JSON.stringify(Object.keys(opposites))}`);
3133
3295
  ${JSON.stringify(directions)}`
3134
3296
  );
3135
3297
  }
3136
- setTimeout(() => this.requestUpdate(), 0);
3298
+ setTimeout(() => {
3299
+ this.requestUpdate();
3300
+ this.handleDone();
3301
+ }, 0);
3137
3302
  if (!this.callout) {
3138
3303
  window.addEventListener("click", this.handleDone);
3139
3304
  window.addEventListener("scroll", this.handleDone);
@@ -3185,7 +3350,7 @@ ${JSON.stringify(directions)}`
3185
3350
  ]);
3186
3351
  }
3187
3352
  get _arrowHtml() {
3188
- return this.noArrow ? "" : html2`<div id="arrow" role="img" class="${this._arrowClasses}"></div>`;
3353
+ return this.noArrow ? "" : html2`<div id="arrow" class="${this._arrowClasses}"></div>`;
3189
3354
  }
3190
3355
  get _activeVariantClasses() {
3191
3356
  const variantProps = {
@@ -3358,19 +3523,16 @@ ${JSON.stringify(directions)}`
3358
3523
  ${this.placement === "right-start" || this.placement === "right" || this.placement === "right-end" || this.placement === "bottom-start" || this.placement === "bottom" || this.placement === "bottom-end" ? html2`
3359
3524
  <slot name="target"></slot>
3360
3525
 
3361
- <div
3362
- id="attention"
3363
- role="${this.tooltip ? "tooltip" : "img"}"
3364
- aria-label="${this.defaultAriaLabel()}"
3365
- class="${this._wrapperClasses}">
3366
- ${this._arrowHtml}
3526
+ <div id="attention" class="${this._wrapperClasses}">
3527
+ <div role="${this.tooltip ? "tooltip" : "img"}" aria-label="${this.defaultAriaLabel()}">${this._arrowHtml}</div>
3367
3528
  <slot name="message"></slot>
3368
3529
  ${this.canClose ? this._closeBtnHtml : nothing}
3369
3530
  </div>
3370
3531
  ` : html2`
3371
3532
  <div id="attention" class="${this._wrapperClasses}">
3372
3533
  <slot name="message"></slot>
3373
- ${this._arrowHtml} ${this.canClose ? this._closeBtnHtml : nothing}
3534
+ <div role="${this.tooltip ? "tooltip" : "img"}" aria-label="${this.defaultAriaLabel()}">${this._arrowHtml}</div>
3535
+ ${this.canClose ? this._closeBtnHtml : nothing}
3374
3536
  </div>
3375
3537
  <slot name="target"></slot>
3376
3538
  `}