@redvars/peacock 3.6.3 → 3.8.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 (179) hide show
  1. package/dist/ButtonConstants-D06bY4uy.js +114 -0
  2. package/dist/ButtonConstants-D06bY4uy.js.map +1 -0
  3. package/dist/{BaseHyperlinkMixin-BNuwbiEf.js → NativeHyperlinkMixin-DrYXyfMQ.js} +8 -10
  4. package/dist/NativeHyperlinkMixin-DrYXyfMQ.js.map +1 -0
  5. package/dist/assets/components.css +1 -1
  6. package/dist/assets/components.css.map +1 -1
  7. package/dist/assets/styles.css +1 -1
  8. package/dist/assets/styles.css.map +1 -1
  9. package/dist/{button-colors-Cg6oxiz-.js → button-colors-DSuBHd-i.js} +200 -186
  10. package/dist/button-colors-DSuBHd-i.js.map +1 -0
  11. package/dist/button-group.js +8 -8
  12. package/dist/button-group.js.map +1 -1
  13. package/dist/button.js +224 -124
  14. package/dist/button.js.map +1 -1
  15. package/dist/calendar-column-view.js +0 -1
  16. package/dist/calendar-column-view.js.map +1 -1
  17. package/dist/calendar-month-view.js +0 -1
  18. package/dist/calendar-month-view.js.map +1 -1
  19. package/dist/card-content.js +0 -1
  20. package/dist/card-content.js.map +1 -1
  21. package/dist/card.js +96 -90
  22. package/dist/card.js.map +1 -1
  23. package/dist/cb-compound-expression.js +4 -1
  24. package/dist/cb-compound-expression.js.map +1 -1
  25. package/dist/cb-divider.js +0 -1
  26. package/dist/cb-divider.js.map +1 -1
  27. package/dist/cb-expression.js +0 -2
  28. package/dist/cb-expression.js.map +1 -1
  29. package/dist/cb-predicate.js +0 -1
  30. package/dist/cb-predicate.js.map +1 -1
  31. package/dist/code-highlighter.js +23 -6
  32. package/dist/code-highlighter.js.map +1 -1
  33. package/dist/custom-elements-jsdocs.json +5102 -18408
  34. package/dist/custom-elements.json +19630 -20205
  35. package/dist/fab.js +181 -117
  36. package/dist/fab.js.map +1 -1
  37. package/dist/{flow-designer-node-9Bqyn6qx.js → flow-designer-node-BWrPuxAR.js} +1 -2
  38. package/dist/flow-designer-node-BWrPuxAR.js.map +1 -0
  39. package/dist/flow-designer-node.js +1 -1
  40. package/dist/flow-designer.js +5 -5
  41. package/dist/icon-button-CYqrnMnF.js +318 -0
  42. package/dist/icon-button-CYqrnMnF.js.map +1 -0
  43. package/dist/index.js +8 -8
  44. package/dist/{navigation-rail-DAUuJ_Yp.js → navigation-rail-CM_svs5_.js} +511 -295
  45. package/dist/navigation-rail-CM_svs5_.js.map +1 -0
  46. package/dist/observe-slot-change-D8Xg-kSS.js +60 -0
  47. package/dist/observe-slot-change-D8Xg-kSS.js.map +1 -0
  48. package/dist/peacock-loader.js +7 -7
  49. package/dist/peacock-loader.js.map +1 -1
  50. package/dist/popover-content.js +0 -1
  51. package/dist/popover-content.js.map +1 -1
  52. package/dist/search.js +4 -1
  53. package/dist/search.js.map +1 -1
  54. package/dist/src/__controllers/attachable-controller.d.ts +109 -0
  55. package/dist/src/__mixins/{BaseButtonMixin.d.ts → NativeButtonMixin.d.ts} +3 -3
  56. package/dist/src/__mixins/{BaseHyperlinkMixin.d.ts → NativeHyperlinkMixin.d.ts} +3 -4
  57. package/dist/src/__utils/is-link.d.ts +1 -0
  58. package/dist/src/__utils/observe-slot-change.d.ts +1 -1
  59. package/dist/src/accordion/accordion-item.d.ts +0 -1
  60. package/dist/src/breadcrumb/breadcrumb-item/breadcrumb-item.d.ts +0 -1
  61. package/dist/src/button/ButtonConstants.d.ts +1 -0
  62. package/dist/src/button/GroupButtonInterface.d.ts +4 -0
  63. package/dist/src/button/button/button.d.ts +32 -7
  64. package/dist/src/button/button-group/button-group.d.ts +2 -1
  65. package/dist/src/button/icon-button/icon-button.d.ts +26 -5
  66. package/dist/src/button/index.d.ts +1 -1
  67. package/dist/src/calendar/calendar-column-view.d.ts +0 -1
  68. package/dist/src/calendar/calendar-month-view.d.ts +0 -1
  69. package/dist/src/card/card-content.d.ts +0 -1
  70. package/dist/src/card/card.d.ts +9 -6
  71. package/dist/src/chip/chip/chip.d.ts +22 -3
  72. package/dist/src/condition-builder/cb-compound-expression.d.ts +0 -1
  73. package/dist/src/condition-builder/cb-divider.d.ts +0 -1
  74. package/dist/src/condition-builder/cb-expression.d.ts +0 -1
  75. package/dist/src/condition-builder/cb-predicate.d.ts +0 -1
  76. package/dist/src/fab/fab.d.ts +20 -6
  77. package/dist/src/flow-designer/flow-designer-node.d.ts +0 -1
  78. package/dist/src/focus-ring/focus-ring.d.ts +26 -20
  79. package/dist/src/item/item.d.ts +2 -1
  80. package/dist/src/link/link.d.ts +1 -1
  81. package/dist/src/list/list-item.d.ts +1 -2
  82. package/dist/src/menu/menu-item/menu-item.d.ts +1 -2
  83. package/dist/src/menu/sub-menu/sub-menu.d.ts +0 -1
  84. package/dist/src/navigation-rail/navigation-rail-item.d.ts +0 -2
  85. package/dist/src/popover/popover-content.d.ts +0 -1
  86. package/dist/src/ripple/ripple.d.ts +9 -1
  87. package/dist/src/segmented-button/segmented-button.d.ts +0 -1
  88. package/dist/src/select/option.d.ts +0 -1
  89. package/dist/src/sidebar-menu/sidebar-menu-item.d.ts +0 -1
  90. package/dist/src/sidebar-menu/sidebar-sub-menu.d.ts +0 -1
  91. package/dist/src/tabs/tab-panel.d.ts +0 -1
  92. package/dist/src/tabs/tab.d.ts +4 -6
  93. package/dist/tsconfig.tsbuildinfo +1 -1
  94. package/package.json +4 -2
  95. package/readme.md +2 -2
  96. package/scss/components.scss +0 -1
  97. package/scss/mixin.scss +10 -13
  98. package/scss/styles.scss +1 -3
  99. package/src/__controllers/attachable-controller.ts +198 -0
  100. package/src/__mixins/NativeButtonMixin.ts +87 -0
  101. package/src/__mixins/{BaseHyperlinkMixin.ts → NativeHyperlinkMixin.ts} +15 -15
  102. package/src/__utils/is-link.ts +3 -0
  103. package/src/__utils/observe-slot-change.ts +46 -14
  104. package/src/accordion/accordion-item.scss +1 -1
  105. package/src/accordion/accordion-item.ts +0 -1
  106. package/src/breadcrumb/breadcrumb-item/breadcrumb-item.ts +0 -1
  107. package/src/button/ButtonConstants.ts +1 -0
  108. package/src/button/GroupButtonInterface.ts +4 -0
  109. package/src/button/button/button-colors.scss +2 -2
  110. package/src/button/button/button-layers.scss +124 -0
  111. package/src/button/button/button-sizes.scss +20 -42
  112. package/src/button/button/button.scss +71 -169
  113. package/src/button/button/button.ts +229 -78
  114. package/src/button/button/only-button.scss +13 -0
  115. package/src/button/button-group/button-group.ts +59 -17
  116. package/src/button/icon-button/icon-button-sizes.scss +6 -21
  117. package/src/button/icon-button/icon-button.ts +198 -93
  118. package/src/button/index.ts +1 -1
  119. package/src/calendar/calendar-column-view.ts +0 -1
  120. package/src/calendar/calendar-month-view.ts +0 -1
  121. package/src/card/card-content.ts +2 -3
  122. package/src/card/card.scss +87 -95
  123. package/src/card/card.ts +62 -60
  124. package/src/chip/chip/chip.scss +65 -70
  125. package/src/chip/chip/chip.ts +155 -56
  126. package/src/code-highlighter/code-highlighter.scss +1 -1
  127. package/src/code-highlighter/code-highlighter.ts +20 -5
  128. package/src/condition-builder/cb-compound-expression.scss +4 -0
  129. package/src/condition-builder/cb-compound-expression.ts +0 -1
  130. package/src/condition-builder/cb-divider.ts +0 -1
  131. package/src/condition-builder/cb-expression.scss +0 -1
  132. package/src/condition-builder/cb-expression.ts +0 -1
  133. package/src/condition-builder/cb-predicate.ts +0 -1
  134. package/src/elevation/elevation.scss +5 -1
  135. package/src/fab/fab-colors.scss +2 -2
  136. package/src/fab/fab-sizes.scss +24 -34
  137. package/src/fab/fab.scss +77 -71
  138. package/src/fab/fab.ts +141 -65
  139. package/src/flow-designer/flow-designer-node.ts +0 -1
  140. package/src/focus-ring/focus-ring.ts +81 -72
  141. package/src/item/item.scss +77 -66
  142. package/src/item/item.ts +61 -39
  143. package/src/link/link.scss +1 -10
  144. package/src/link/link.ts +4 -2
  145. package/src/list/list-item.ts +8 -8
  146. package/src/menu/menu-item/menu-item.ts +17 -8
  147. package/src/menu/sub-menu/sub-menu.ts +0 -1
  148. package/src/navigation-rail/navigation-rail-item.scss +5 -0
  149. package/src/navigation-rail/navigation-rail-item.ts +10 -15
  150. package/src/peacock-loader.ts +1 -1
  151. package/src/popover/popover-content.ts +0 -1
  152. package/src/ripple/ripple.ts +52 -20
  153. package/src/search/search.scss +3 -0
  154. package/src/segmented-button/segmented-button.ts +0 -1
  155. package/src/select/option.ts +0 -1
  156. package/src/sidebar-menu/sidebar-menu-item.ts +0 -1
  157. package/src/sidebar-menu/sidebar-sub-menu.ts +0 -1
  158. package/src/skeleton/skeleton.scss +5 -1
  159. package/src/tabs/tab-panel.ts +0 -1
  160. package/src/tabs/tab.ts +60 -70
  161. package/src/text/text.css-component.scss +3 -21
  162. package/src/tooltip/tooltip.scss +5 -8
  163. package/src/tooltip/tooltip.ts +1 -2
  164. package/dist/BaseButton-BNFAYn-S.js +0 -219
  165. package/dist/BaseButton-BNFAYn-S.js.map +0 -1
  166. package/dist/BaseHyperlinkMixin-BNuwbiEf.js.map +0 -1
  167. package/dist/button-colors-Cg6oxiz-.js.map +0 -1
  168. package/dist/flow-designer-node-9Bqyn6qx.js.map +0 -1
  169. package/dist/icon-button-AdJBEoNy.js +0 -251
  170. package/dist/icon-button-AdJBEoNy.js.map +0 -1
  171. package/dist/navigation-rail-DAUuJ_Yp.js.map +0 -1
  172. package/dist/observe-slot-change-BGJfgg2E.js +0 -31
  173. package/dist/observe-slot-change-BGJfgg2E.js.map +0 -1
  174. package/dist/src/button/BaseButton.d.ts +0 -28
  175. package/dist/src/focus-ring/FocusAttachableController.d.ts +0 -8
  176. package/src/__mixins/BaseButtonMixin.ts +0 -83
  177. package/src/button/BaseButton.ts +0 -113
  178. package/src/focus-ring/FocusAttachableController.ts +0 -28
  179. package/src/popover/tooltip.css-component.scss +0 -19
@@ -6,7 +6,6 @@ import type { MenuItem } from '../menu/menu-item/menu-item.js';
6
6
  * @label Select Option
7
7
  * @tag wc-option
8
8
  * @rawTag option
9
- * @parentRawTag select
10
9
  *
11
10
  * @summary A declarative option element for use inside wc-select.
12
11
  *
@@ -7,7 +7,6 @@ import styles from './sidebar-menu-item.scss';
7
7
  * @label Sidebar Menu Item
8
8
  * @tag wc-sidebar-menu-item
9
9
  * @rawTag sidebar-menu-item
10
- * @parentRawTag sidebar-menu
11
10
  * @summary A sidebar menu item represents a selectable leaf item in the sidebar navigation tree.
12
11
  *
13
12
  * @example
@@ -8,7 +8,6 @@ import styles from './sidebar-sub-menu.scss';
8
8
  * @label Sidebar Sub Menu
9
9
  * @tag wc-sidebar-sub-menu
10
10
  * @rawTag sidebar-sub-menu
11
- * @parentRawTag sidebar-menu
12
11
  * @summary A sidebar sub menu groups sidebar menu items and handles expand/collapse behavior.
13
12
  *
14
13
  * @example
@@ -18,7 +18,11 @@
18
18
  .skeleton::before {
19
19
  inset: 0;
20
20
  position: absolute;
21
- @include mixin.apply-container-shape(skeleton);
21
+ border-start-start-radius: var(--skeleton-container-shape-start-start, var(--skeleton-container-shape));
22
+ border-start-end-radius: var(--skeleton-container-shape-start-end, var(--skeleton-container-shape));
23
+ border-end-start-radius: var(--skeleton-container-shape-end-start, var(--skeleton-container-shape));
24
+ border-end-end-radius: var(--skeleton-container-shape-end-end, var(--skeleton-container-shape));
25
+ corner-shape: var(--skeleton-container-shape-variant);
22
26
  }
23
27
 
24
28
  .skeleton {
@@ -6,7 +6,6 @@ import styles from './tab-panel.scss';
6
6
  * @label Tab Panel
7
7
  * @tag wc-tab-panel
8
8
  * @rawTag tab-panel
9
- * @parentRawTag tab-group
10
9
  *
11
10
  * @summary Content panel for tabs.
12
11
  * @overview
package/src/tabs/tab.ts CHANGED
@@ -2,9 +2,13 @@ import { html, LitElement, nothing } from 'lit';
2
2
  import { property, query, state } from 'lit/decorators.js';
3
3
  import { classMap } from 'lit/directives/class-map.js';
4
4
 
5
- import { dispatchActivationClick, isActivationClick } from '@/__utils/dispatch-event-utils.js';
5
+ import {
6
+ dispatchActivationClick,
7
+ isActivationClick,
8
+ } from '@/__utils/dispatch-event-utils.js';
6
9
  import { observerSlotChangesWithCallback } from '@/__utils/observe-slot-change.js';
7
10
  import { throttle } from '@/__utils/throttle.js';
11
+ import { isLink } from '@/__utils/is-link.js';
8
12
  import { spread } from '@/__directive/spread.js';
9
13
 
10
14
  import styles from './tab.scss';
@@ -14,7 +18,6 @@ import type { Tabs } from './tabs.js';
14
18
  * @label Tab
15
19
  * @tag wc-tab
16
20
  * @rawTag tab
17
- * @parentRawTag tabs
18
21
  *
19
22
  * @summary A tab component for use within tabs.
20
23
  * @overview
@@ -27,13 +30,12 @@ import type { Tabs } from './tabs.js';
27
30
  * @tags navigation
28
31
  */
29
32
  export class Tab extends LitElement {
30
-
31
33
  #id = crypto.randomUUID();
32
34
 
33
35
  static styles = [styles];
34
36
 
35
37
  @property({ type: Boolean, reflect: true }) active = false;
36
-
38
+
37
39
  @property({ type: Boolean, reflect: true }) disabled = false;
38
40
 
39
41
  @property({ type: String }) disabledReason = '';
@@ -43,7 +45,7 @@ export class Tab extends LitElement {
43
45
  @property({ reflect: true })
44
46
  configAria?: { [key: string]: any };
45
47
 
46
- /**
48
+ /**
47
49
  * Sets or retrieves the window or frame at which to target content.
48
50
  */
49
51
  @property() target: string = '_self';
@@ -63,11 +65,11 @@ export class Tab extends LitElement {
63
65
 
64
66
  @state() slotHasBadge = false;
65
67
 
66
- /**
67
- * States
68
- */
69
- @state()
70
- isPressed = false;
68
+ /**
69
+ * States
70
+ */
71
+ @state()
72
+ isPressed = false;
71
73
 
72
74
  private _tabindex = 0;
73
75
 
@@ -81,7 +83,6 @@ export class Tab extends LitElement {
81
83
  this.tabElement?.blur();
82
84
  }
83
85
 
84
-
85
86
  constructor() {
86
87
  super();
87
88
  this._tabindex = 0;
@@ -118,28 +119,28 @@ export class Tab extends LitElement {
118
119
  }
119
120
 
120
121
  __dispatchClickWithThrottle: (event: MouseEvent | KeyboardEvent) => void =
121
- event => {
122
- this.__dispatchClick(event);
123
- };
124
-
125
- __dispatchClick = (event: MouseEvent | KeyboardEvent) => {
126
- // If the button is soft-disabled or a disabled link, we need to explicitly
127
- // prevent the click from propagating to other event listeners as well as
128
- // prevent the default action.
129
- if (this.disabled && this.href) {
130
- event.stopImmediatePropagation();
131
- event.preventDefault();
132
- return;
133
- }
134
-
135
- if (!isActivationClick(event) || !this.tabElement) {
136
- return;
137
- }
138
-
139
- this.focus();
140
- dispatchActivationClick(this.tabElement);
122
+ event => {
123
+ this.__dispatchClick(event);
141
124
  };
142
125
 
126
+ __dispatchClick = (event: MouseEvent | KeyboardEvent) => {
127
+ // If the button is soft-disabled or a disabled link, we need to explicitly
128
+ // prevent the click from propagating to other event listeners as well as
129
+ // prevent the default action.
130
+ if (this.disabled && this.href) {
131
+ event.stopImmediatePropagation();
132
+ event.preventDefault();
133
+ return;
134
+ }
135
+
136
+ if (!isActivationClick(event) || !this.tabElement) {
137
+ return;
138
+ }
139
+
140
+ this.focus();
141
+ dispatchActivationClick(this.tabElement);
142
+ };
143
+
143
144
  __handlePress = (event: KeyboardEvent | MouseEvent) => {
144
145
  if (this.disabled) return;
145
146
  if (
@@ -155,10 +156,6 @@ export class Tab extends LitElement {
155
156
  }
156
157
  };
157
158
 
158
- __isLink() {
159
- return !!this.href;
160
- }
161
-
162
159
  __getParentTabsVariant(): Tabs['variant'] {
163
160
  return (this.closest('wc-tabs') as Tabs | null)?.variant ?? 'primary';
164
161
  }
@@ -172,10 +169,7 @@ export class Tab extends LitElement {
172
169
  // }
173
170
  // }
174
171
 
175
-
176
172
  render() {
177
-
178
- const isLink = this.__isLink();
179
173
  const variant = this.__getParentTabsVariant();
180
174
 
181
175
  const cssClasses = {
@@ -190,40 +184,39 @@ export class Tab extends LitElement {
190
184
  'has-badge': this.slotHasBadge,
191
185
  };
192
186
 
193
-
194
- if (!isLink) {
195
- return html`<button
196
- id="button"
197
- class=${classMap(cssClasses)}
198
- tabindex="0"
199
- @mousedown=${this.__handlePress}
200
- @keydown=${this.__handlePress}
201
- @keyup=${this.__handlePress}
202
- ?aria-describedby=${this.__getDisabledReasonID()}
203
- aria-disabled=${`${this.disabled}`}
204
- ?disabled=${this.disabled}
205
- ${spread(this.configAria)}
206
- >
207
- ${this.renderTabContent(variant)}
208
- </button>`;
209
- }
210
-
211
- return html`<a
212
- class=${classMap(cssClasses)}
187
+ if (!isLink(this)) {
188
+ return html`<button
213
189
  id="button"
190
+ class=${classMap(cssClasses)}
214
191
  tabindex="0"
215
- href=${this.href}
216
- target=${this.target}
217
192
  @mousedown=${this.__handlePress}
218
193
  @keydown=${this.__handlePress}
219
194
  @keyup=${this.__handlePress}
220
- role="button"
221
195
  ?aria-describedby=${this.__getDisabledReasonID()}
222
196
  aria-disabled=${`${this.disabled}`}
197
+ ?disabled=${this.disabled}
223
198
  ${spread(this.configAria)}
224
199
  >
225
200
  ${this.renderTabContent(variant)}
226
- </a>`;
201
+ </button>`;
202
+ }
203
+
204
+ return html`<a
205
+ class=${classMap(cssClasses)}
206
+ id="button"
207
+ tabindex="0"
208
+ href=${this.href}
209
+ target=${this.target}
210
+ @mousedown=${this.__handlePress}
211
+ @keydown=${this.__handlePress}
212
+ @keyup=${this.__handlePress}
213
+ role="button"
214
+ ?aria-describedby=${this.__getDisabledReasonID()}
215
+ aria-disabled=${`${this.disabled}`}
216
+ ${spread(this.configAria)}
217
+ >
218
+ ${this.renderTabContent(variant)}
219
+ </a>`;
227
220
  }
228
221
 
229
222
  renderTabContent(variant: Tabs['variant']) {
@@ -242,14 +235,13 @@ export class Tab extends LitElement {
242
235
 
243
236
  renderPrimaryTabContent() {
244
237
  return html`
245
- <wc-focus-ring class="focus-ring" for='button'></wc-focus-ring>
238
+ <wc-focus-ring class="focus-ring" for="button"></wc-focus-ring>
246
239
  <wc-elevation class="elevation"></wc-elevation>
247
240
  <div class="background"></div>
248
241
  <div class="outline"></div>
249
242
  <wc-ripple class="ripple"></wc-ripple>
250
-
251
- <div class="tab-content">
252
243
 
244
+ <div class="tab-content">
253
245
  <div class="icon-section">
254
246
  <slot name="badge"></slot>
255
247
  <slot name="icon"></slot>
@@ -259,7 +251,6 @@ export class Tab extends LitElement {
259
251
  </div>
260
252
 
261
253
  <div class="indicator"></div>
262
-
263
254
  </div>
264
255
 
265
256
  ${this.__renderDisabledReason()}
@@ -268,14 +259,13 @@ export class Tab extends LitElement {
268
259
 
269
260
  renderSecondaryTabContent() {
270
261
  return html`
271
- <wc-focus-ring class="focus-ring" for='button'></wc-focus-ring>
262
+ <wc-focus-ring class="focus-ring" for="button"></wc-focus-ring>
272
263
  <wc-elevation class="elevation"></wc-elevation>
273
264
  <div class="background"></div>
274
265
  <div class="outline"></div>
275
266
  <wc-ripple class="ripple"></wc-ripple>
276
-
277
- <div class="tab-content">
278
267
 
268
+ <div class="tab-content">
279
269
  <slot name="icon"></slot>
280
270
 
281
271
  <div class="slot-container">
@@ -301,7 +291,7 @@ export class Tab extends LitElement {
301
291
 
302
292
  renderSegmentedTabContent() {
303
293
  return html`
304
- <wc-focus-ring class="focus-ring" for='button'></wc-focus-ring>
294
+ <wc-focus-ring class="focus-ring" for="button"></wc-focus-ring>
305
295
  <wc-elevation class="elevation"></wc-elevation>
306
296
  <div class="background"></div>
307
297
  <div class="outline"></div>
@@ -1,35 +1,17 @@
1
1
  @use "../../scss/mixin";
2
- @use "sass:string";
3
2
 
4
3
  @include mixin.base-styles;
5
4
 
6
- @mixin _apply-typography($value-type) {
7
- @include mixin.get-typography(#{$value-type});
8
- @if string.index($value-type, "body") {
9
- margin-block-end: var(--spacing-200);
10
- }
11
- @if string.index($value-type, "headline") {
12
- margin-block-end: var(--spacing-200);
13
- }
14
- @if string.index($value-type, "display") {
15
- margin-block-end: var(--spacing-400);
16
- }
17
- @if string.index($value-type, "title") {
18
- margin-block-end: var(--spacing-400);
19
- }
20
- }
21
-
22
5
  /// Mixin to define text classes for a specific type and value-type
23
6
  /// @param {String} $type - The type name to be used in the class name (e.g., .text-#{$type})
24
- /// @param {String} $value-type - The value-type name to be passed to get-typography and get-margin-end
25
- /// @param {Boolean} $important [true] - Whether to use !important in typography properties
7
+ /// @param {String} $value-type - The value-type name to be passed to get-typography
26
8
  @mixin define-text-classes($type, $value-type) {
27
9
  .text-#{$type} {
28
- @include _apply-typography($value-type);
10
+ @include mixin.get-typography(#{$value-type});
29
11
  }
30
12
 
31
13
  .text-#{$type}-emphasized {
32
- @include _apply-typography(#{$value-type}-emphasized);
14
+ @include mixin.get-typography(#{$value-type}-emphasized);
33
15
  }
34
16
  }
35
17
 
@@ -8,15 +8,12 @@
8
8
  position: absolute;
9
9
  top: 0;
10
10
  left: 0;
11
+ pointer-events: none;
12
+ transition: transform var(--duration-short2) ease-in-out, opacity var(--duration-short2) ease-in-out;
13
+ transform: scale(0);
14
+ opacity: 0;
11
15
 
12
- .tooltip {
13
- pointer-events: none;
14
- transition: transform var(--duration-short2) ease-in-out, opacity var(--duration-short2) ease-in-out;
15
- transform: scale(0);
16
- opacity: 0;
17
- }
18
-
19
- .tooltip.open {
16
+ &:host([open]) {
20
17
  pointer-events: auto;
21
18
  transform: scale(1);
22
19
  opacity: 1;
@@ -71,7 +71,7 @@ export class Tooltip extends LitElement {
71
71
  set forElement(value: HTMLElement | null) {
72
72
  if (value) {
73
73
  this._focusTarget = value;
74
- } else {
74
+ } else {
75
75
  this._focusTarget = undefined;
76
76
  }
77
77
  }
@@ -153,7 +153,6 @@ export class Tooltip extends LitElement {
153
153
  return html` <div
154
154
  class=${classMap({
155
155
  tooltip: true,
156
- open: this.open,
157
156
  [`variant-${this.variant}`]: true,
158
157
  })}
159
158
  id="tooltip"
@@ -1,219 +0,0 @@
1
- import { A, _ as __decorate, b, i as i$1 } from './IndividualComponent-DUINtMGK.js';
2
- import { e, i, t } from './directive-ZPhl09Yt.js';
3
- import { n } from './property-1psGvXOq.js';
4
- import { r } from './state-DwbEjqVk.js';
5
- import { e as e$1 } from './query-QBcUV-L_.js';
6
- import { i as isActivationClick, d as dispatchActivationClick } from './dispatch-event-utils-CuEqjlPT.js';
7
- import { B as BaseHyperlinkMixin } from './BaseHyperlinkMixin-BNuwbiEf.js';
8
-
9
- /**
10
- * @license
11
- * Copyright 2018 Google LLC
12
- * SPDX-License-Identifier: BSD-3-Clause
13
- */const o=o=>o??A;
14
-
15
- class SpreadDirective extends i {
16
- constructor(partInfo) {
17
- super(partInfo);
18
- if (partInfo.type !== t.ELEMENT) {
19
- throw new Error('spread() can only be used on elements');
20
- }
21
- }
22
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
23
- render(_props) {
24
- return '';
25
- }
26
- update(part, [props]) {
27
- if (!props)
28
- return;
29
- // eslint-disable-next-line guard-for-in,no-restricted-syntax
30
- for (const key in props) {
31
- const value = props[key];
32
- if (value === undefined || value === null) {
33
- part.element.removeAttribute(key);
34
- }
35
- else {
36
- part.element.setAttribute(key, value);
37
- }
38
- }
39
- }
40
- }
41
- const spread = e(SpreadDirective);
42
-
43
- /**
44
- * 2. Apply the type annotation to the variable.
45
- */
46
- const BaseButtonMixin = (superclass) => {
47
- // Naming the class (BaseButtonElement) instead of using 'Mixin' or anonymous
48
- // prevents the "__childPart" visibility error.
49
- class BaseButtonElement extends superclass {
50
- constructor() {
51
- super(...arguments);
52
- /**
53
- * The type of the underlying `<button>` element. Maps to the native `type` attribute.
54
- * Possible values are `"button"`, `"submit"`, `"reset"`. Defaults to `"button"`.
55
- */
56
- this.htmlType = 'button';
57
- /**
58
- * When `true`, the button is disabled and cannot be interacted with. Reflects to the `disabled` attribute. Defaults to `false`.
59
- */
60
- this.disabled = false;
61
- /**
62
- * When `true`, the button is visually styled as disabled and cannot be interacted with, but remains focusable.
63
- * Use this in combination with `disabledReason` to communicate why the button is unavailable.
64
- * Reflects to the `soft-disabled` attribute. Defaults to `false`.
65
- */
66
- this.softDisabled = false;
67
- /**
68
- * A human-readable explanation of why the button is disabled or soft-disabled.
69
- * Rendered as a visually hidden tooltip and linked via `aria-describedby` for accessibility.
70
- * Maps to the `disabled-reason` attribute.
71
- */
72
- this.disabledReason = '';
73
- /**
74
- * The `id` of the `<form>` element to associate the button with.
75
- * If omitted, the button is associated with its nearest ancestor form.
76
- * Maps to the native `form` attribute.
77
- */
78
- this.form = '';
79
- /**
80
- * The name of the button, submitted as part of a name/value pair when the associated form is submitted.
81
- * Maps to the native `name` attribute.
82
- */
83
- this.name = '';
84
- /**
85
- * The value of the button, submitted as part of a name/value pair when the associated form is submitted.
86
- * Maps to the native `value` attribute.
87
- */
88
- this.value = '';
89
- }
90
- }
91
- __decorate([
92
- n({ type: String })
93
- ], BaseButtonElement.prototype, "htmlType", void 0);
94
- __decorate([
95
- n({ type: Boolean, reflect: true })
96
- ], BaseButtonElement.prototype, "disabled", void 0);
97
- __decorate([
98
- n({ type: Boolean, reflect: true, attribute: 'soft-disabled' })
99
- ], BaseButtonElement.prototype, "softDisabled", void 0);
100
- __decorate([
101
- n({ attribute: 'disabled-reason' })
102
- ], BaseButtonElement.prototype, "disabledReason", void 0);
103
- __decorate([
104
- n()
105
- ], BaseButtonElement.prototype, "form", void 0);
106
- __decorate([
107
- n()
108
- ], BaseButtonElement.prototype, "name", void 0);
109
- __decorate([
110
- n()
111
- ], BaseButtonElement.prototype, "value", void 0);
112
- return BaseButtonElement;
113
- };
114
-
115
- class BaseButton extends BaseButtonMixin(BaseHyperlinkMixin(i$1)) {
116
- constructor() {
117
- super(...arguments);
118
- this.skeleton = false;
119
- this.toggle = false;
120
- this.selected = false;
121
- /**
122
- * Sets the delay for throttle in milliseconds. Defaults to 200 milliseconds.
123
- */
124
- this.throttleDelay = 200;
125
- /**
126
- * States
127
- */
128
- this.isPressed = false;
129
- this.__handlePress = (event) => {
130
- if (this.disabled || this.skeleton || this.softDisabled)
131
- return;
132
- if (event instanceof KeyboardEvent &&
133
- event.type === 'keydown' &&
134
- (event.key === 'Enter' || event.key === ' ')) {
135
- this.isPressed = true;
136
- }
137
- else if (event.type === 'mousedown') {
138
- this.isPressed = true;
139
- }
140
- else {
141
- this.isPressed = false;
142
- }
143
- };
144
- this.__dispatchClickWithThrottle = event => {
145
- this.__dispatchClick(event);
146
- };
147
- this.__dispatchClick = (event) => {
148
- // If the button is soft-disabled or a disabled link, we need to explicitly
149
- // prevent the click from propagating to other event listeners as well as
150
- // prevent the default action.
151
- if (this.softDisabled || (this.disabled && this.href) || this.skeleton) {
152
- event.stopImmediatePropagation();
153
- event.preventDefault();
154
- return;
155
- }
156
- if (!isActivationClick(event) || !this.buttonElement) {
157
- return;
158
- }
159
- if (this.toggle) {
160
- this.selected = !this.selected;
161
- }
162
- this.focus();
163
- dispatchActivationClick(this.buttonElement);
164
- };
165
- }
166
- connectedCallback() {
167
- super.connectedCallback();
168
- this.addEventListener('click', this.__dispatchClickWithThrottle);
169
- window.addEventListener('mouseup', this.__handlePress);
170
- }
171
- disconnectedCallback() {
172
- window.removeEventListener('mouseup', this.__handlePress);
173
- this.removeEventListener('click', this.__dispatchClickWithThrottle);
174
- super.disconnectedCallback();
175
- }
176
- __renderDisabledReason(softDisabled) {
177
- if (softDisabled)
178
- return b `<div
179
- id=${BaseButton.DISABLED_REASON_ID}
180
- role="tooltip"
181
- aria-label=${this.disabledReason}
182
- class="screen-reader-only"
183
- >
184
- ${this.disabledReason}
185
- </div>`;
186
- return A;
187
- }
188
- __renderTooltip() {
189
- if (this.tooltip) {
190
- return b `<wc-tooltip for="button">${this.tooltip}</wc-tooltip>`;
191
- }
192
- return A;
193
- }
194
- }
195
- BaseButton.DISABLED_REASON_ID = 'disabled-reason';
196
- __decorate([
197
- n({ type: Boolean, reflect: true })
198
- ], BaseButton.prototype, "skeleton", void 0);
199
- __decorate([
200
- n({ type: Boolean, reflect: true })
201
- ], BaseButton.prototype, "toggle", void 0);
202
- __decorate([
203
- n({ type: Boolean, reflect: true })
204
- ], BaseButton.prototype, "selected", void 0);
205
- __decorate([
206
- n()
207
- ], BaseButton.prototype, "throttleDelay", void 0);
208
- __decorate([
209
- n()
210
- ], BaseButton.prototype, "tooltip", void 0);
211
- __decorate([
212
- r()
213
- ], BaseButton.prototype, "isPressed", void 0);
214
- __decorate([
215
- e$1('.button')
216
- ], BaseButton.prototype, "buttonElement", void 0);
217
-
218
- export { BaseButton as B, BaseButtonMixin as a, o, spread as s };
219
- //# sourceMappingURL=BaseButton-BNFAYn-S.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseButton-BNFAYn-S.js","sources":["../node_modules/lit-html/directives/if-defined.js","../../src/__directive/spread.ts","../../src/__mixins/BaseButtonMixin.ts","../../src/button/BaseButton.ts"],"sourcesContent":["import{nothing as t}from\"../lit-html.js\";\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o=o=>o??t;export{o as ifDefined};\n//# sourceMappingURL=if-defined.js.map\n","import {\n directive,\n Directive,\n ElementPart,\n PartInfo,\n PartType,\n} from 'lit/directive.js';\n\nclass SpreadDirective extends Directive {\n constructor(partInfo: PartInfo) {\n super(partInfo);\n if (partInfo.type !== PartType.ELEMENT) {\n throw new Error('spread() can only be used on elements');\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n render(_props: { [key: string]: any } | undefined) {\n return '';\n }\n\n update(part: ElementPart, [props]: [{ [key: string]: any } | undefined]) {\n if (!props) return;\n // eslint-disable-next-line guard-for-in,no-restricted-syntax\n for (const key in props) {\n const value = props[key];\n if (value === undefined || value === null) {\n part.element.removeAttribute(key);\n } else {\n part.element.setAttribute(key, value);\n }\n }\n }\n}\n\nexport const spread = directive(SpreadDirective);\n","import { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport type { MixinConstructor } from './MixinConstructor.js';\n\n\n/**\n * 1. Define an interface for the members the mixin adds.\n * This makes the type annotation much cleaner.\n */\nexport interface BaseButtonInterface {\n htmlType: 'button' | 'submit' | 'reset';\n disabled: boolean;\n softDisabled: boolean;\n disabledReason: string;\n form: string;\n name: string;\n value: string;\n}\n\n/**\n * 2. Apply the type annotation to the variable.\n */\nconst BaseButtonMixin: <T extends MixinConstructor<LitElement>>(superclass: T) => T & MixinConstructor<BaseButtonInterface> = <T extends MixinConstructor<LitElement>>(superclass: T) => {\n // Naming the class (BaseButtonElement) instead of using 'Mixin' or anonymous \n // prevents the \"__childPart\" visibility error.\n class BaseButtonElement extends superclass implements BaseButtonInterface {\n\n /**\n * The type of the underlying `<button>` element. Maps to the native `type` attribute.\n * Possible values are `\"button\"`, `\"submit\"`, `\"reset\"`. Defaults to `\"button\"`.\n */\n @property({ type: String }) htmlType: 'button' | 'submit' | 'reset' =\n 'button';\n\n /**\n * When `true`, the button is disabled and cannot be interacted with. Reflects to the `disabled` attribute. Defaults to `false`.\n */\n @property({ type: Boolean, reflect: true })\n disabled: boolean = false;\n\n /**\n * When `true`, the button is visually styled as disabled and cannot be interacted with, but remains focusable.\n * Use this in combination with `disabledReason` to communicate why the button is unavailable.\n * Reflects to the `soft-disabled` attribute. Defaults to `false`.\n */\n @property({ type: Boolean, reflect: true, attribute: 'soft-disabled' })\n softDisabled: boolean = false;\n\n /**\n * A human-readable explanation of why the button is disabled or soft-disabled.\n * Rendered as a visually hidden tooltip and linked via `aria-describedby` for accessibility.\n * Maps to the `disabled-reason` attribute.\n */\n @property({ attribute: 'disabled-reason' })\n disabledReason: string = '';\n\n /**\n * The `id` of the `<form>` element to associate the button with.\n * If omitted, the button is associated with its nearest ancestor form.\n * Maps to the native `form` attribute.\n */\n @property()\n form: string = '';\n\n /**\n * The name of the button, submitted as part of a name/value pair when the associated form is submitted.\n * Maps to the native `name` attribute.\n */\n @property()\n name: string = '';\n\n /**\n * The value of the button, submitted as part of a name/value pair when the associated form is submitted.\n * Maps to the native `value` attribute.\n */\n @property()\n value: string = '';\n }\n\n return BaseButtonElement as T & MixinConstructor<BaseButtonInterface>;\n};\n\nexport default BaseButtonMixin;","import { html, LitElement, nothing } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { dispatchActivationClick, isActivationClick } from '../__utils/dispatch-event-utils.js';\nimport BaseHyperlinkMixin from '@/__mixins/BaseHyperlinkMixin.js';\nimport BaseButtonMixin from '@/__mixins/BaseButtonMixin.js';\n\n\n\nexport class BaseButton extends BaseButtonMixin(BaseHyperlinkMixin(LitElement)) {\n protected static readonly DISABLED_REASON_ID = 'disabled-reason';\n\n \n color?: string;\n\n variant?: string;\n\n @property({ type: Boolean, reflect: true }) skeleton: boolean = false;\n \n @property({ type: Boolean, reflect: true }) toggle: boolean = false;\n\n @property({ type: Boolean, reflect: true }) selected: boolean = false;\n\n /**\n * Sets the delay for throttle in milliseconds. Defaults to 200 milliseconds.\n */\n @property() throttleDelay = 200;\n\n @property() tooltip?: string;\n\n /**\n * States\n */\n @state()\n isPressed = false;\n\n @query('.button') readonly buttonElement!: HTMLElement | null;\n\n override connectedCallback() {\n super.connectedCallback();\n this.addEventListener('click', this.__dispatchClickWithThrottle);\n window.addEventListener('mouseup', this.__handlePress);\n }\n\n override disconnectedCallback() {\n window.removeEventListener('mouseup', this.__handlePress);\n this.removeEventListener('click', this.__dispatchClickWithThrottle);\n super.disconnectedCallback();\n }\n\n __handlePress = (event: KeyboardEvent | MouseEvent) => {\n if (this.disabled || this.skeleton || this.softDisabled) return;\n if (\n event instanceof KeyboardEvent &&\n event.type === 'keydown' &&\n (event.key === 'Enter' || event.key === ' ')\n ) {\n this.isPressed = true;\n } else if (event.type === 'mousedown') {\n this.isPressed = true;\n } else {\n this.isPressed = false;\n }\n };\n\n __dispatchClickWithThrottle: (event: MouseEvent | KeyboardEvent) => void =\n event => {\n this.__dispatchClick(event);\n };\n\n __dispatchClick = (event: MouseEvent | KeyboardEvent) => {\n // If the button is soft-disabled or a disabled link, we need to explicitly\n // prevent the click from propagating to other event listeners as well as\n // prevent the default action.\n if (this.softDisabled || (this.disabled && this.href) || this.skeleton) {\n event.stopImmediatePropagation();\n event.preventDefault();\n return;\n }\n\n if (!isActivationClick(event) || !this.buttonElement) {\n return;\n }\n\n if (this.toggle) {\n this.selected = !this.selected;\n }\n\n this.focus();\n dispatchActivationClick(this.buttonElement);\n };\n\n \n\n __renderDisabledReason(softDisabled: boolean) {\n if (softDisabled)\n return html`<div\n id=${BaseButton.DISABLED_REASON_ID}\n role=\"tooltip\"\n aria-label=${this.disabledReason}\n class=\"screen-reader-only\"\n >\n ${this.disabledReason}\n </div>`;\n return nothing;\n }\n\n __renderTooltip() {\n if (this.tooltip) {\n return html`<wc-tooltip for=\"button\">${this.tooltip}</wc-tooltip>`;\n }\n return nothing;\n }\n}\n"],"names":["t","Directive","PartType","directive","property","LitElement","html","nothing","state","query"],"mappings":";;;;;;;;AACA;AACA;AACA;AACA;AACA,GAAQ,MAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAEA;;ACGjB,MAAM,eAAgB,SAAQC,CAAS,CAAA;AACrC,IAAA,WAAA,CAAY,QAAkB,EAAA;QAC5B,KAAK,CAAC,QAAQ,CAAC;QACf,IAAI,QAAQ,CAAC,IAAI,KAAKC,CAAQ,CAAC,OAAO,EAAE;AACtC,YAAA,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC;QAC1D;IACF;;AAGA,IAAA,MAAM,CAAC,MAA0C,EAAA;AAC/C,QAAA,OAAO,EAAE;IACX;AAEA,IAAA,MAAM,CAAC,IAAiB,EAAE,CAAC,KAAK,CAAuC,EAAA;AACrE,QAAA,IAAI,CAAC,KAAK;YAAE;;AAEZ,QAAA,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;AACvB,YAAA,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC;YACxB,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE;AACzC,gBAAA,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC;YACnC;iBAAO;gBACL,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC;YACvC;QACF;IACF;AACD;MAEY,MAAM,GAAGC,CAAS,CAAC,eAAe;;AChB/C;;AAEG;AACH,MAAM,eAAe,GAAyG,CAAyC,UAAa,KAAI;;;IAGpL,MAAM,iBAAkB,SAAQ,UAAU,CAAA;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,CAAI,CAAA,CAAA,yBAAA,EAA4B,IAAI,CAAC,OAAO,eAAe;QACpE;AACA,QAAA,OAAOC,CAAO;IAChB;;AAtG0B,UAAA,CAAA,kBAAkB,GAAG,iBAAH;AAOA,UAAA,CAAA;IAA3CH,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAA4B,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAE1B,UAAA,CAAA;IAA3CA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAA0B,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,QAAA,EAAA,MAAA,CAAA;AAExB,UAAA,CAAA;IAA3CA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAA4B,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAK1D,UAAA,CAAA;AAAX,IAAAA,CAAQ;AAAuB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,eAAA,EAAA,MAAA,CAAA;AAEpB,UAAA,CAAA;AAAX,IAAAA,CAAQ;AAAoB,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAM7B,UAAA,CAAA;AADC,IAAAI,CAAK;AACY,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;AAES,UAAA,CAAA;IAA1BC,GAAK,CAAC,SAAS;AAA8C,CAAA,EAAA,UAAA,CAAA,SAAA,EAAA,eAAA,EAAA,MAAA,CAAA;;;;","x_google_ignoreList":[0]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseHyperlinkMixin-BNuwbiEf.js","sources":["../../src/__utils/throttle.ts","../../src/__mixins/BaseHyperlinkMixin.ts"],"sourcesContent":["export function throttle(\n func: Function,\n delay: number,\n options = { leading: true, trailing: true },\n) {\n let timerId: any;\n let lastExec = 0;\n\n return function (...args: any[]) {\n // @ts-ignore\n const context = this;\n const now = Date.now();\n\n const shouldCallNow = options.leading && now - lastExec >= delay;\n\n if (shouldCallNow) {\n func.apply(context, args);\n lastExec = now;\n } else if (options.trailing && !timerId) {\n timerId = setTimeout(() => {\n func.apply(context, args);\n lastExec = Date.now();\n timerId = null;\n }, delay);\n }\n };\n}","import { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport type { MixinConstructor } from './MixinConstructor.js';\n\n\n/**\n * 1. Define an interface for the members the mixin adds.\n * This makes the type annotation much cleaner.\n */\nexport interface BaseHyperlinkInterface {\n href?: string;\n target: '_self' | '_parent' | '_blank' | '_top' | string;\n rel?: string;\n download?: string;\n __isLink(): boolean;\n}\n\n/**\n * 2. Apply the type annotation to the variable.\n */\nconst BaseHyperlinkMixin: <T extends MixinConstructor<LitElement>>(superclass: T) => T & MixinConstructor<BaseHyperlinkInterface> = <T extends MixinConstructor<LitElement>>(superclass: T) => {\n // Naming the class (BaseHyperlinkElement) instead of using 'Mixin' or anonymous \n // prevents the \"__childPart\" visibility error.\n class BaseHyperlinkElement extends superclass implements BaseHyperlinkInterface {\n /**\n * The URL that the hyperlink points to. When set, the component renders as an `<a>` element.\n * Maps to the native `href` attribute.\n */\n @property({ reflect: true })\n href?: string;\n\n /**\n * Where to display the linked URL. Maps to the native `target` attribute.\n * Possible values are `\"_self\"`, `\"_blank\"`, `\"_parent\"`, `\"_top\"`, or a custom frame name.\n * When using `\"_blank\"`, consider setting `rel=\"noopener noreferrer\"` for security. Defaults to `\"_self\"`.\n */\n @property()\n target: '_self' | '_parent' | '_blank' | '_top' | string = '_self';\n\n /**\n * The relationship between the current document and the linked URL.\n * Maps to the native `rel` attribute on the rendered `<a>` element.\n * When `target=\"_blank\"`, use `\"noopener noreferrer\"` to prevent tab-napping attacks.\n */\n @property()\n rel?: string;\n\n /**\n * Causes the browser to download the linked URL instead of navigating to it.\n * If a string value is provided, it is used as the suggested filename.\n * Omit or leave undefined to preserve normal navigation behaviour.\n * Maps to the native `download` attribute. Only applies when `href` is set.\n */\n @property()\n download?: string;\n\n /**\n * Returns `true` when `href` is set, indicating the component should render as a link.\n */\n __isLink(): boolean {\n return !!this.href;\n }\n }\n\n return BaseHyperlinkElement as T & MixinConstructor<BaseHyperlinkInterface>;\n};\n\nexport default BaseHyperlinkMixin;"],"names":["property"],"mappings":";;;SAAgB,QAAQ,CACtB,IAAc,EACd,KAAa,EACb,OAAO,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAA;AAE3C,IAAA,IAAI,OAAY;IAChB,IAAI,QAAQ,GAAG,CAAC;IAEhB,OAAO,UAAU,GAAG,IAAW,EAAA;;QAE7B,MAAM,OAAO,GAAG,IAAI;AACpB,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE;QAEtB,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,IAAI,GAAG,GAAG,QAAQ,IAAI,KAAK;QAEhE,IAAI,aAAa,EAAE;AACjB,YAAA,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;YACzB,QAAQ,GAAG,GAAG;QAChB;AAAO,aAAA,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,OAAO,EAAE;AACvC,YAAA,OAAO,GAAG,UAAU,CAAC,MAAK;AACxB,gBAAA,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;AACzB,gBAAA,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE;gBACrB,OAAO,GAAG,IAAI;YAChB,CAAC,EAAE,KAAK,CAAC;QACX;AACF,IAAA,CAAC;AACH;;ACTA;;AAEG;AACH,MAAM,kBAAkB,GAA4G,CAAyC,UAAa,KAAI;;;IAG5L,MAAM,oBAAqB,SAAQ,UAAU,CAAA;AAA7C,QAAA,WAAA,GAAA;;AAQE;;;;AAIG;YAEH,IAAA,CAAA,MA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