@shoper/phoenix_design_system 1.15.11-35 → 1.15.11-36

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.
@@ -27,7 +27,7 @@ class BaseMessage extends phoenix_light_lit_element.PhoenixLightLitElement {
27
27
  this._tooltipRef = ref.createRef();
28
28
  this._handleChildrenAriaAttributes = () => {
29
29
  [...this.children].forEach((child) => {
30
- if (base_message_constants.LIST_OF_MESSAGE_CHILDREN.includes(child.tagName.toLowerCase()))
30
+ if (base_message_constants.LIST_OF_MESSAGE_CHILDREN.includes(child.tagName.toLowerCase()) || this._tooltipRef.value === child)
31
31
  return;
32
32
  child.setAttribute('aria-describedby', `${child.getAttribute('aria-describedby') || ''} ${this._messageId}`);
33
33
  });
@@ -51,11 +51,8 @@ class BaseMessage extends phoenix_light_lit_element.PhoenixLightLitElement {
51
51
  });
52
52
  };
53
53
  this.open = () => {
54
- var _a, _b;
55
54
  this._tooltipOpenTime = Date.now();
56
55
  clearTimeout(this._closeTimeout);
57
- (_a = this._tooltipRef.value) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-hidden', 'true');
58
- (_b = this._tooltipRef.value) === null || _b === void 0 ? void 0 : _b.setAttribute('hidden', '');
59
56
  this._openTimeout = setTimeout(() => {
60
57
  if (this.opened)
61
58
  return;
@@ -70,11 +67,8 @@ class BaseMessage extends phoenix_light_lit_element.PhoenixLightLitElement {
70
67
  this.close();
71
68
  };
72
69
  this.close = () => {
73
- var _a, _b;
74
70
  this._shouldDelayClosing = Date.now() - this._tooltipOpenTime > base_message_constants.MESSAGE_TIME_TO_DELAY_CLOSING_IN_MS;
75
71
  clearTimeout(this._openTimeout);
76
- (_a = this._tooltipRef.value) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-hidden', 'false');
77
- (_b = this._tooltipRef.value) === null || _b === void 0 ? void 0 : _b.removeAttribute('hidden');
78
72
  if (!this.opened)
79
73
  return;
80
74
  this._closeTimeout = setTimeout(() => {
@@ -113,7 +107,7 @@ class BaseMessage extends phoenix_light_lit_element.PhoenixLightLitElement {
113
107
  });
114
108
  this.setAttribute('tabindex', this.tabindex);
115
109
  if (!this._$baseMessageContent)
116
- this._$baseMessageContent = [...this.children].find((child) => base_message_constants.LIST_OF_MESSAGE_CONTENT_ELEMENTS.includes(child.tagName.toLowerCase()));
110
+ this._$baseMessageContent = [...this.children].find((child) => base_message_constants.MESSAGE_CONTENT_ELEMENTS.includes(child.tagName.toLowerCase()));
117
111
  this._setupEventListeners();
118
112
  }
119
113
  firstUpdated(props) {
@@ -138,7 +132,7 @@ class BaseMessage extends phoenix_light_lit_element.PhoenixLightLitElement {
138
132
  var _a;
139
133
  super.render();
140
134
  return lit.html `
141
- <span ${ref.ref(this._tooltipRef)} id="${this._messageId}" class="sr-only" role="tooltip" aria-hidden="false">
135
+ <span ${ref.ref(this._tooltipRef)} id="${this._messageId}" class="sr-only" role="tooltip">
142
136
  ${utilities.DomUtils.stripHTMLTags(((_a = this._$baseMessageContent) === null || _a === void 0 ? void 0 : _a.innerHTML) || '')}
143
137
  </span>
144
138
  <h-portal ?disabled="${!this.opened}" @open="${this._positionMessage}" to="${this.portalTarget}" hidden>
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA,iBAAiB,qDAAyD;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA,iBAAiB,qDAAyD;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -11,16 +11,14 @@ const MESSAGE_CONTENT_SLOT_NAME = 'message-content';
11
11
  const MESSAGE_REMOVED_CLASS_NAME = `removed`;
12
12
  const DEFAULT_MESSAGE_OFFSET = 10;
13
13
  const MESSAGE_CONTENT_ELEMENTS = [tooltip_constants.TOOLTIP_CONTENT_ELEMENT_NAME, hint_constants.HINT_CONTENT_ELEMENT_NAME];
14
+ const LIST_OF_MESSAGE_CHILDREN = [...MESSAGE_CONTENT_ELEMENTS, portal_constants.PORTAL_COMPONENT_NAME];
14
15
  const MESSAGE_SHOW_DELAY_IN_MS = 100;
15
16
  const MESSAGE_TIME_TO_DELAY_CLOSING_IN_MS = 500;
16
- const MESSAGE_CLOSE_DELAY_IN_MS = 500;
17
- const LIST_OF_MESSAGE_CONTENT_ELEMENTS = [tooltip_constants.TOOLTIP_CONTENT_ELEMENT_NAME, hint_constants.HINT_CONTENT_ELEMENT_NAME];
18
- const LIST_OF_MESSAGE_CHILDREN = [...LIST_OF_MESSAGE_CONTENT_ELEMENTS, portal_constants.PORTAL_COMPONENT_NAME];
17
+ const MESSAGE_CLOSE_DELAY_IN_MS = 500;
19
18
 
20
19
  exports.DEFAULT_MESSAGE_OFFSET = DEFAULT_MESSAGE_OFFSET;
21
20
  exports.DEFAULT_MESSAGE_PORTAL_NAME = DEFAULT_MESSAGE_PORTAL_NAME;
22
21
  exports.LIST_OF_MESSAGE_CHILDREN = LIST_OF_MESSAGE_CHILDREN;
23
- exports.LIST_OF_MESSAGE_CONTENT_ELEMENTS = LIST_OF_MESSAGE_CONTENT_ELEMENTS;
24
22
  exports.MESSAGE_CLOSE_DELAY_IN_MS = MESSAGE_CLOSE_DELAY_IN_MS;
25
23
  exports.MESSAGE_CONTENT_ELEMENTS = MESSAGE_CONTENT_ELEMENTS;
26
24
  exports.MESSAGE_CONTENT_SLOT_NAME = MESSAGE_CONTENT_SLOT_NAME;
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -7,7 +7,7 @@ import v4 from '../../../../../external/uuid/dist/esm-browser/v4.js';
7
7
  import { PORTAL_TARGET_COMPONENT_NAME, PORTAL_TARGET_NAME_PROP, PORTAL_TARGET_ATTRIBUTE_NAME } from '../portal/portal_constants.js';
8
8
  import { ClickOutsideController } from '../../controllers/click_outside_controller/click_outside_controller.js';
9
9
  import { RelativePositionController } from '../../controllers/relative_position_controller/relative_position_controller.js';
10
- import { DEFAULT_MESSAGE_PORTAL_NAME, DEFAULT_MESSAGE_OFFSET, LIST_OF_MESSAGE_CHILDREN, MESSAGE_SHOW_DELAY_IN_MS, MESSAGE_TIME_TO_DELAY_CLOSING_IN_MS, MESSAGE_REMOVED_CLASS_NAME, MESSAGE_CLOSE_DELAY_IN_MS, MESSAGE_CONTENT_ELEMENTS, LIST_OF_MESSAGE_CONTENT_ELEMENTS, MESSAGE_CONTENT_SLOT_NAME } from './base_message_constants.js';
10
+ import { DEFAULT_MESSAGE_PORTAL_NAME, DEFAULT_MESSAGE_OFFSET, LIST_OF_MESSAGE_CHILDREN, MESSAGE_SHOW_DELAY_IN_MS, MESSAGE_TIME_TO_DELAY_CLOSING_IN_MS, MESSAGE_REMOVED_CLASS_NAME, MESSAGE_CLOSE_DELAY_IN_MS, MESSAGE_CONTENT_ELEMENTS, MESSAGE_CONTENT_SLOT_NAME } from './base_message_constants.js';
11
11
  import { createRef, ref } from 'lit/directives/ref';
12
12
 
13
13
  class BaseMessage extends PhoenixLightLitElement {
@@ -23,7 +23,7 @@ class BaseMessage extends PhoenixLightLitElement {
23
23
  this._tooltipRef = createRef();
24
24
  this._handleChildrenAriaAttributes = () => {
25
25
  [...this.children].forEach((child) => {
26
- if (LIST_OF_MESSAGE_CHILDREN.includes(child.tagName.toLowerCase()))
26
+ if (LIST_OF_MESSAGE_CHILDREN.includes(child.tagName.toLowerCase()) || this._tooltipRef.value === child)
27
27
  return;
28
28
  child.setAttribute('aria-describedby', `${child.getAttribute('aria-describedby') || ''} ${this._messageId}`);
29
29
  });
@@ -47,11 +47,8 @@ class BaseMessage extends PhoenixLightLitElement {
47
47
  });
48
48
  };
49
49
  this.open = () => {
50
- var _a, _b;
51
50
  this._tooltipOpenTime = Date.now();
52
51
  clearTimeout(this._closeTimeout);
53
- (_a = this._tooltipRef.value) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-hidden', 'true');
54
- (_b = this._tooltipRef.value) === null || _b === void 0 ? void 0 : _b.setAttribute('hidden', '');
55
52
  this._openTimeout = setTimeout(() => {
56
53
  if (this.opened)
57
54
  return;
@@ -66,11 +63,8 @@ class BaseMessage extends PhoenixLightLitElement {
66
63
  this.close();
67
64
  };
68
65
  this.close = () => {
69
- var _a, _b;
70
66
  this._shouldDelayClosing = Date.now() - this._tooltipOpenTime > MESSAGE_TIME_TO_DELAY_CLOSING_IN_MS;
71
67
  clearTimeout(this._openTimeout);
72
- (_a = this._tooltipRef.value) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-hidden', 'false');
73
- (_b = this._tooltipRef.value) === null || _b === void 0 ? void 0 : _b.removeAttribute('hidden');
74
68
  if (!this.opened)
75
69
  return;
76
70
  this._closeTimeout = setTimeout(() => {
@@ -109,7 +103,7 @@ class BaseMessage extends PhoenixLightLitElement {
109
103
  });
110
104
  this.setAttribute('tabindex', this.tabindex);
111
105
  if (!this._$baseMessageContent)
112
- this._$baseMessageContent = [...this.children].find((child) => LIST_OF_MESSAGE_CONTENT_ELEMENTS.includes(child.tagName.toLowerCase()));
106
+ this._$baseMessageContent = [...this.children].find((child) => MESSAGE_CONTENT_ELEMENTS.includes(child.tagName.toLowerCase()));
113
107
  this._setupEventListeners();
114
108
  }
115
109
  firstUpdated(props) {
@@ -134,7 +128,7 @@ class BaseMessage extends PhoenixLightLitElement {
134
128
  var _a;
135
129
  super.render();
136
130
  return html `
137
- <span ${ref(this._tooltipRef)} id="${this._messageId}" class="sr-only" role="tooltip" aria-hidden="false">
131
+ <span ${ref(this._tooltipRef)} id="${this._messageId}" class="sr-only" role="tooltip">
138
132
  ${DomUtils.stripHTMLTags(((_a = this._$baseMessageContent) === null || _a === void 0 ? void 0 : _a.innerHTML) || '')}
139
133
  </span>
140
134
  <h-portal ?disabled="${!this.opened}" @open="${this._positionMessage}" to="${this.portalTarget}" hidden>
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA,eAAe,qDAAyD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA,eAAe,qDAAyD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -4,8 +4,7 @@ export declare const MESSAGE_REMOVED_CLASS_NAME = "removed";
4
4
  export declare const DEFAULT_MESSAGE_OFFSET = 10;
5
5
  export declare const MESSAGE_ELEMENTS: string[];
6
6
  export declare const MESSAGE_CONTENT_ELEMENTS: string[];
7
+ export declare const LIST_OF_MESSAGE_CHILDREN: string[];
7
8
  export declare const MESSAGE_SHOW_DELAY_IN_MS = 100;
8
9
  export declare const MESSAGE_TIME_TO_DELAY_CLOSING_IN_MS = 500;
9
10
  export declare const MESSAGE_CLOSE_DELAY_IN_MS = 500;
10
- export declare const LIST_OF_MESSAGE_CONTENT_ELEMENTS: string[];
11
- export declare const LIST_OF_MESSAGE_CHILDREN: string[];
@@ -7,11 +7,10 @@ const MESSAGE_CONTENT_SLOT_NAME = 'message-content';
7
7
  const MESSAGE_REMOVED_CLASS_NAME = `removed`;
8
8
  const DEFAULT_MESSAGE_OFFSET = 10;
9
9
  const MESSAGE_CONTENT_ELEMENTS = [TOOLTIP_CONTENT_ELEMENT_NAME, HINT_CONTENT_ELEMENT_NAME];
10
+ const LIST_OF_MESSAGE_CHILDREN = [...MESSAGE_CONTENT_ELEMENTS, PORTAL_COMPONENT_NAME];
10
11
  const MESSAGE_SHOW_DELAY_IN_MS = 100;
11
12
  const MESSAGE_TIME_TO_DELAY_CLOSING_IN_MS = 500;
12
- const MESSAGE_CLOSE_DELAY_IN_MS = 500;
13
- const LIST_OF_MESSAGE_CONTENT_ELEMENTS = [TOOLTIP_CONTENT_ELEMENT_NAME, HINT_CONTENT_ELEMENT_NAME];
14
- const LIST_OF_MESSAGE_CHILDREN = [...LIST_OF_MESSAGE_CONTENT_ELEMENTS, PORTAL_COMPONENT_NAME];
13
+ const MESSAGE_CLOSE_DELAY_IN_MS = 500;
15
14
 
16
- export { DEFAULT_MESSAGE_OFFSET, DEFAULT_MESSAGE_PORTAL_NAME, LIST_OF_MESSAGE_CHILDREN, LIST_OF_MESSAGE_CONTENT_ELEMENTS, MESSAGE_CLOSE_DELAY_IN_MS, MESSAGE_CONTENT_ELEMENTS, MESSAGE_CONTENT_SLOT_NAME, MESSAGE_REMOVED_CLASS_NAME, MESSAGE_SHOW_DELAY_IN_MS, MESSAGE_TIME_TO_DELAY_CLOSING_IN_MS };
15
+ export { DEFAULT_MESSAGE_OFFSET, DEFAULT_MESSAGE_PORTAL_NAME, LIST_OF_MESSAGE_CHILDREN, MESSAGE_CLOSE_DELAY_IN_MS, MESSAGE_CONTENT_ELEMENTS, MESSAGE_CONTENT_SLOT_NAME, MESSAGE_REMOVED_CLASS_NAME, MESSAGE_SHOW_DELAY_IN_MS, MESSAGE_TIME_TO_DELAY_CLOSING_IN_MS };
17
16
  //# sourceMappingURL=base_message_constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@shoper/phoenix_design_system",
3
3
  "packageManager": "yarn@3.2.0",
4
4
  "sideEffects": false,
5
- "version": "1.15.11-35",
5
+ "version": "1.15.11-36",
6
6
  "description": "phoenix design system",
7
7
  "author": "zefirek",
8
8
  "license": "MIT",