@vonage/vivid 4.22.0 → 4.23.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 (213) hide show
  1. package/custom-elements.json +1987 -631
  2. package/lib/accordion-item/accordion-item.d.ts +11 -5
  3. package/lib/action-group/action-group.d.ts +8 -6
  4. package/lib/alert/alert.d.ts +21 -9
  5. package/lib/audio-player/audio-player.d.ts +11 -5
  6. package/lib/badge/badge.d.ts +11 -5
  7. package/lib/banner/banner.d.ts +26 -12
  8. package/lib/breadcrumb/breadcrumb.d.ts +333 -1
  9. package/lib/breadcrumb/breadcrumb.template.d.ts +2 -3
  10. package/lib/breadcrumb-item/breadcrumb-item.d.ts +8 -6
  11. package/lib/button/button.d.ts +11 -5
  12. package/lib/calendar-event/calendar-event.d.ts +333 -1
  13. package/lib/checkbox/checkbox.d.ts +8 -6
  14. package/lib/combobox/combobox.d.ts +11 -5
  15. package/lib/date-picker/date-picker.d.ts +74 -50
  16. package/lib/date-range-picker/date-range-picker.d.ts +38 -26
  17. package/lib/date-time-picker/date-time-picker.d.ts +76 -52
  18. package/lib/dial-pad/dial-pad.d.ts +11 -5
  19. package/lib/dialog/dialog.d.ts +16 -8
  20. package/lib/divider/divider.d.ts +8 -6
  21. package/lib/fab/fab.d.ts +11 -5
  22. package/lib/file-picker/file-picker.d.ts +339 -3
  23. package/lib/header/header.d.ts +333 -1
  24. package/lib/menu/menu.d.ts +16 -8
  25. package/lib/menu-item/menu-item.d.ts +338 -2
  26. package/lib/nav/nav.d.ts +333 -1
  27. package/lib/nav-disclosure/nav-disclosure.d.ts +16 -8
  28. package/lib/nav-item/nav-item.d.ts +11 -5
  29. package/lib/note/note.d.ts +11 -5
  30. package/lib/number-field/number-field.d.ts +26 -12
  31. package/lib/option/option.d.ts +339 -3
  32. package/lib/progress/progress.d.ts +8 -6
  33. package/lib/progress-ring/progress-ring.d.ts +8 -6
  34. package/lib/radio-group/radio-group.d.ts +333 -1
  35. package/lib/range-slider/range-slider.d.ts +11 -5
  36. package/lib/rich-text-editor/facades/prose-mirror-vivid.schema.d.ts +1 -1
  37. package/lib/rich-text-editor/facades/vivid-prose-mirror.facade.d.ts +7 -1
  38. package/lib/rich-text-editor/menubar/consts.d.ts +18 -0
  39. package/lib/rich-text-editor/menubar/menubar.d.ts +3 -0
  40. package/lib/rich-text-editor/rich-text-editor.d.ts +10 -0
  41. package/lib/searchable-select/option-tag.d.ts +11 -5
  42. package/lib/searchable-select/searchable-select.d.ts +349 -7
  43. package/lib/select/select.d.ts +339 -3
  44. package/lib/selectable-box/selectable-box.d.ts +8 -6
  45. package/lib/slider/slider.d.ts +16 -8
  46. package/lib/split-button/split-button.d.ts +26 -12
  47. package/lib/switch/switch.d.ts +8 -6
  48. package/lib/tab/tab.d.ts +349 -7
  49. package/lib/tab-panel/tab-panel.d.ts +333 -1
  50. package/lib/tag/tag.d.ts +338 -2
  51. package/lib/tag-group/tag-group.d.ts +8 -6
  52. package/lib/text-anchor/text-anchor.d.ts +16 -8
  53. package/lib/text-area/text-area.d.ts +8 -6
  54. package/lib/text-field/text-field.d.ts +16 -8
  55. package/lib/time-picker/time-picker.d.ts +38 -26
  56. package/lib/toggletip/toggletip.d.ts +9 -3
  57. package/lib/tooltip/tooltip.d.ts +9 -3
  58. package/lib/tree-item/tree-item.d.ts +338 -2
  59. package/lib/tree-view/tree-view.d.ts +333 -1
  60. package/lib/video-player/video-player.d.ts +11 -5
  61. package/package.json +1 -1
  62. package/shared/affix.js +1 -1
  63. package/shared/aria/aria-change-subscription.d.ts +6 -0
  64. package/shared/aria/aria-mixin.d.ts +338 -0
  65. package/shared/aria/delegate-aria-behavior.d.ts +31 -0
  66. package/shared/aria/delegates-aria.d.ts +14 -9
  67. package/shared/aria/host-semantics-behavior.d.ts +22 -0
  68. package/shared/aria/host-semantics.d.ts +337 -0
  69. package/shared/attribute-binding-behaviour.cjs +41 -0
  70. package/shared/attribute-binding-behaviour.js +39 -0
  71. package/shared/calendar-event.cjs +2 -1
  72. package/shared/calendar-event.js +2 -1
  73. package/shared/definition.js +1 -1
  74. package/shared/definition10.cjs +8 -2
  75. package/shared/definition10.js +9 -3
  76. package/shared/definition11.cjs +4 -28
  77. package/shared/definition11.js +5 -29
  78. package/shared/definition12.cjs +4 -1
  79. package/shared/definition12.js +5 -2
  80. package/shared/definition13.js +1 -1
  81. package/shared/definition14.js +1 -1
  82. package/shared/definition15.cjs +8 -7
  83. package/shared/definition15.js +10 -9
  84. package/shared/definition16.js +1 -1
  85. package/shared/definition17.js +1 -1
  86. package/shared/definition18.js +1 -1
  87. package/shared/definition19.js +1 -1
  88. package/shared/definition2.js +1 -1
  89. package/shared/definition20.js +1 -1
  90. package/shared/definition21.js +1 -1
  91. package/shared/definition22.cjs +3 -2
  92. package/shared/definition22.js +5 -4
  93. package/shared/definition23.cjs +4 -2
  94. package/shared/definition23.js +6 -4
  95. package/shared/definition24.js +1 -1
  96. package/shared/definition25.cjs +2 -14
  97. package/shared/definition25.js +3 -15
  98. package/shared/definition26.cjs +7 -2
  99. package/shared/definition26.js +8 -3
  100. package/shared/definition27.cjs +3 -2
  101. package/shared/definition27.js +4 -3
  102. package/shared/definition28.js +1 -1
  103. package/shared/definition29.js +1 -1
  104. package/shared/definition3.cjs +3 -2
  105. package/shared/definition3.js +5 -4
  106. package/shared/definition30.cjs +33 -34
  107. package/shared/definition30.js +35 -36
  108. package/shared/definition31.cjs +6 -4
  109. package/shared/definition31.js +8 -6
  110. package/shared/definition32.js +1 -1
  111. package/shared/definition33.cjs +7 -2
  112. package/shared/definition33.js +8 -3
  113. package/shared/definition34.js +1 -1
  114. package/shared/definition35.cjs +2 -13
  115. package/shared/definition35.js +4 -15
  116. package/shared/definition36.cjs +8 -5
  117. package/shared/definition36.js +9 -6
  118. package/shared/definition37.js +1 -1
  119. package/shared/definition38.cjs +7 -8
  120. package/shared/definition38.js +9 -10
  121. package/shared/definition39.cjs +7 -8
  122. package/shared/definition39.js +9 -10
  123. package/shared/definition4.js +1 -1
  124. package/shared/definition40.cjs +8 -5
  125. package/shared/definition40.js +9 -6
  126. package/shared/definition41.js +1 -1
  127. package/shared/definition42.js +1 -1
  128. package/shared/definition43.cjs +465 -105
  129. package/shared/definition43.js +457 -97
  130. package/shared/definition44.cjs +9 -6
  131. package/shared/definition44.js +10 -7
  132. package/shared/definition45.cjs +13 -7
  133. package/shared/definition45.js +14 -8
  134. package/shared/definition46.cjs +18 -6
  135. package/shared/definition46.js +20 -8
  136. package/shared/definition47.js +1 -1
  137. package/shared/definition48.js +1 -1
  138. package/shared/definition49.cjs +10 -3
  139. package/shared/definition49.js +12 -5
  140. package/shared/definition5.cjs +7 -2
  141. package/shared/definition5.js +8 -3
  142. package/shared/definition50.cjs +7 -6
  143. package/shared/definition50.js +9 -8
  144. package/shared/definition51.cjs +3 -2
  145. package/shared/definition51.js +4 -3
  146. package/shared/definition52.cjs +8 -4
  147. package/shared/definition52.js +9 -5
  148. package/shared/definition53.js +1 -1
  149. package/shared/definition54.cjs +4 -3
  150. package/shared/definition54.js +6 -5
  151. package/shared/definition55.cjs +7 -4
  152. package/shared/definition55.js +8 -5
  153. package/shared/definition56.cjs +68 -14
  154. package/shared/definition56.js +69 -15
  155. package/shared/definition57.cjs +163 -112
  156. package/shared/definition57.js +165 -114
  157. package/shared/definition58.js +1 -1
  158. package/shared/definition59.js +1 -1
  159. package/shared/definition6.js +1 -1
  160. package/shared/definition60.js +1 -1
  161. package/shared/definition61.cjs +8 -5
  162. package/shared/definition61.js +9 -6
  163. package/shared/definition62.cjs +5 -2
  164. package/shared/definition62.js +6 -3
  165. package/shared/definition63.js +1 -1
  166. package/shared/definition64.js +1 -1
  167. package/shared/definition65.js +1 -1
  168. package/shared/definition7.js +1 -1
  169. package/shared/definition8.cjs +4 -2
  170. package/shared/definition8.js +6 -4
  171. package/shared/definition9.js +1 -1
  172. package/shared/delegates-aria.cjs +106 -56
  173. package/shared/delegates-aria.js +107 -58
  174. package/shared/foundation/button/button.d.ts +8 -6
  175. package/shared/foundation/vivid-element/vivid-element.d.ts +339 -1
  176. package/shared/host-semantics.cjs +65 -0
  177. package/shared/host-semantics.js +62 -0
  178. package/shared/option.cjs +4 -1
  179. package/shared/option.js +4 -1
  180. package/shared/patterns/affix.d.ts +22 -10
  181. package/shared/patterns/anchored.d.ts +18 -6
  182. package/shared/patterns/localized.d.ts +11 -5
  183. package/shared/patterns/trapped-focus.d.ts +11 -5
  184. package/shared/picker-field/mixins/calendar-picker.d.ts +19 -13
  185. package/shared/picker-field/mixins/calendar-picker.template.d.ts +19 -13
  186. package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +11 -5
  187. package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +38 -26
  188. package/shared/picker-field/mixins/single-date-picker.d.ts +55 -37
  189. package/shared/picker-field/mixins/single-value-picker.d.ts +17 -11
  190. package/shared/picker-field/mixins/time-selection-picker.d.ts +38 -26
  191. package/shared/picker-field/mixins/time-selection-picker.template.d.ts +38 -26
  192. package/shared/picker-field/picker-field.d.ts +21 -9
  193. package/shared/picker-field.template.js +1 -1
  194. package/shared/repeat.js +1 -1
  195. package/shared/slider.template.cjs +10 -9
  196. package/shared/slider.template.js +10 -9
  197. package/shared/templating/attribute-binding-behaviour.d.ts +15 -0
  198. package/shared/templating/render-in-light-dom.d.ts +22 -0
  199. package/shared/text-anchor.template.cjs +2 -13
  200. package/shared/text-anchor.template.js +2 -13
  201. package/shared/time-selection-picker.template.js +1 -1
  202. package/shared/vivid-element.cjs +96 -2
  203. package/shared/vivid-element.js +93 -3
  204. package/styles/core/all.css +1 -1
  205. package/styles/core/theme.css +1 -1
  206. package/styles/core/typography.css +1 -1
  207. package/styles/tokens/theme-dark.css +4 -4
  208. package/styles/tokens/theme-light.css +4 -4
  209. package/styles/tokens/vivid-2-compat.css +1 -1
  210. package/text-anchor/index.js +1 -1
  211. package/vivid.api.json +155 -14
  212. package/shared/Reflector.cjs +0 -71
  213. package/shared/Reflector.js +0 -69
@@ -7,6 +7,7 @@ const definition$2 = require('./definition38.cjs');
7
7
  const vividElement = require('./vivid-element.cjs');
8
8
  const applyMixinsWithObservables = require('./applyMixinsWithObservables.cjs');
9
9
  const scrollIntoView = require('./scrollIntoView.cjs');
10
+ const delegatesAria = require('./delegates-aria.cjs');
10
11
  const formAssociated = require('./form-associated.cjs');
11
12
  const affix = require('./affix.cjs');
12
13
  const localized = require('./localized.cjs');
@@ -55,8 +56,8 @@ const TagGapPx = 8;
55
56
  const InputMinWidthPx = 100;
56
57
  const PageSize = 10;
57
58
  const isFormAssociatedTryingToSetFormValue = (value) => typeof value === "string";
58
- exports.SearchableSelect = class SearchableSelect extends affix.AffixIconWithTrailing(
59
- localized.Localized(FormAssociatedSearchableSelect)
59
+ exports.SearchableSelect = class SearchableSelect extends delegatesAria.DelegatesAria(
60
+ affix.AffixIconWithTrailing(localized.Localized(FormAssociatedSearchableSelect))
60
61
  ) {
61
62
  constructor() {
62
63
  super(...arguments);
@@ -1001,12 +1002,14 @@ function renderFieldset(context) {
1001
1002
  id="control"
1002
1003
  class="control"
1003
1004
  autocomplete="off"
1004
- aria-autocomplete="list"
1005
- aria-expanded="${(x) => x.open}"
1006
- aria-haspopup="listbox"
1007
1005
  aria-controls="listbox"
1006
+ ${delegatesAria.delegateAria({
1007
+ role: "combobox",
1008
+ ariaAutoComplete: "list",
1009
+ ariaHasPopup: "listbox",
1010
+ ariaExpanded: (x) => x.open
1011
+ })}
1008
1012
  placeholder="${(x) => x.multiple && x.values.length ? "" : x.placeholder}"
1009
- role="combobox"
1010
1013
  type="text"
1011
1014
  ?disabled="${(x) => x.disabled}"
1012
1015
  :value="${(x) => x._inputValue}"
@@ -2,9 +2,10 @@ import { B as Button, c as chevronTemplateFactory, b as buttonDefinition } from
2
2
  import { P as Popup, p as popupDefinition } from './definition65.js';
3
3
  import { I as Icon, i as iconDefinition } from './definition28.js';
4
4
  import { P as ProgressRing, p as progressRingDefinition } from './definition38.js';
5
- import { V as VividElement, O as Observable, D as DOM, a as attr, n as nullableNumberConverter, o as observable, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
5
+ import { V as VividElement, O as Observable, D as DOM, a as attr, n as nullableNumberConverter, o as observable, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
6
6
  import { a as applyMixinsWithObservables } from './applyMixinsWithObservables.js';
7
7
  import { s as scrollIntoView } from './scrollIntoView.js';
8
+ import { D as DelegatesAria, d as delegateAria } from './delegates-aria.js';
8
9
  import { F as FormAssociated } from './form-associated.js';
9
10
  import { A as AffixIconWithTrailing, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
10
11
  import { L as Localized } from './localized.js';
@@ -53,8 +54,8 @@ const TagGapPx = 8;
53
54
  const InputMinWidthPx = 100;
54
55
  const PageSize = 10;
55
56
  const isFormAssociatedTryingToSetFormValue = (value) => typeof value === "string";
56
- let SearchableSelect = class extends AffixIconWithTrailing(
57
- Localized(FormAssociatedSearchableSelect)
57
+ let SearchableSelect = class extends DelegatesAria(
58
+ AffixIconWithTrailing(Localized(FormAssociatedSearchableSelect))
58
59
  ) {
59
60
  constructor() {
60
61
  super(...arguments);
@@ -999,12 +1000,14 @@ function renderFieldset(context) {
999
1000
  id="control"
1000
1001
  class="control"
1001
1002
  autocomplete="off"
1002
- aria-autocomplete="list"
1003
- aria-expanded="${(x) => x.open}"
1004
- aria-haspopup="listbox"
1005
1003
  aria-controls="listbox"
1004
+ ${delegateAria({
1005
+ role: "combobox",
1006
+ ariaAutoComplete: "list",
1007
+ ariaHasPopup: "listbox",
1008
+ ariaExpanded: (x) => x.open
1009
+ })}
1006
1010
  placeholder="${(x) => x.multiple && x.values.length ? "" : x.placeholder}"
1007
- role="combobox"
1008
1011
  type="text"
1009
1012
  ?disabled="${(x) => x.disabled}"
1010
1013
  :value="${(x) => x._inputValue}"
@@ -6,15 +6,16 @@ const definition$3 = require('./definition36.cjs');
6
6
  const vividElement = require('./vivid-element.cjs');
7
7
  const applyMixinsWithObservables = require('./applyMixinsWithObservables.cjs');
8
8
  const listbox = require('./listbox.cjs');
9
+ const hostSemantics = require('./host-semantics.cjs');
9
10
  const formAssociated = require('./form-associated.cjs');
10
11
  const numbers = require('./numbers.cjs');
11
12
  const affix = require('./affix.cjs');
12
13
  const strings = require('./strings.cjs');
13
14
  const keyCodes = require('./key-codes.cjs');
14
15
  const formElements = require('./form-elements.cjs');
15
- const index = require('./index.cjs');
16
- const definition$1 = require('./definition11.cjs');
17
16
  const option = require('./option.cjs');
17
+ const definition$1 = require('./definition11.cjs');
18
+ const index = require('./index.cjs');
18
19
  const ref = require('./ref.cjs');
19
20
  const when = require('./when.cjs');
20
21
  const slotted = require('./slotted.cjs');
@@ -41,7 +42,9 @@ var __decorateClass = (decorators, target, key, kind) => {
41
42
  if (kind && result) __defProp(target, key, result);
42
43
  return result;
43
44
  };
44
- exports.Select = class Select extends affix.AffixIconWithTrailing(FormAssociatedSelect) {
45
+ exports.Select = class Select extends hostSemantics.HostSemantics(
46
+ affix.AffixIconWithTrailing(FormAssociatedSelect)
47
+ ) {
45
48
  constructor() {
46
49
  super(...arguments);
47
50
  this.activeIndex = -1;
@@ -852,11 +855,14 @@ const SelectTemplate = (context) => {
852
855
  return vividElement.html`
853
856
  <template
854
857
  class="base"
855
- role="combobox"
856
- aria-haspopup="${(x) => x.collapsible ? "listbox" : "false"}"
858
+ ${hostSemantics.applyHostSemantics({
859
+ role: "combobox",
860
+ ariaLabel: (x) => x.ariaLabel ?? x.label,
861
+ ariaHasPopup: (x) => x.collapsible ? "listbox" : "false",
862
+ ariaExpanded: (x) => x.open,
863
+ ariaDisabled: (x) => x.disabled
864
+ })}
857
865
  aria-controls="${(x) => x.listboxId}"
858
- aria-expanded="${(x) => x.open}"
859
- aria-disabled="${(x) => x.disabled}"
860
866
  aria-activedescendant="${(x) => x._activeDescendant}"
861
867
  tabindex="${(x) => !x.disabled ? "0" : null}"
862
868
  @click="${ifNotFromFeedback((x, e) => x.clickHandler(e))}"
@@ -1,18 +1,19 @@
1
1
  import { P as Popup, p as popupDefinition } from './definition65.js';
2
2
  import { i as iconDefinition } from './definition28.js';
3
3
  import { l as listboxOptionDefinition } from './definition36.js';
4
- import { D as DOM, O as Observable, o as observable, a as attr, v as volatile, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
4
+ import { D as DOM, O as Observable, o as observable, a as attr, v as volatile, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
5
5
  import { a as applyMixinsWithObservables } from './applyMixinsWithObservables.js';
6
6
  import { L as Listbox } from './listbox.js';
7
+ import { H as HostSemantics, a as applyHostSemantics } from './host-semantics.js';
7
8
  import { F as FormAssociated } from './form-associated.js';
8
9
  import { i as inRange } from './numbers.js';
9
10
  import { A as AffixIconWithTrailing, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
10
11
  import { u as uniqueId } from './strings.js';
11
12
  import { a as keySpace, b as keyEscape, c as keyTab, d as keyEnd, e as keyArrowUp, f as keyArrowDown, g as keyHome, k as keyEnter } from './key-codes.js';
12
13
  import { F as FormElementSuccessText, a as FormElementHelperText, e as errorText, f as formElements, g as getFeedbackTemplate } from './form-elements.js';
13
- import { h as handleEscapeKeyAndStopPropogation } from './index.js';
14
- import { c as chevronTemplateFactory } from './definition11.js';
15
14
  import { L as ListboxOption } from './option.js';
15
+ import { c as chevronTemplateFactory } from './definition11.js';
16
+ import { h as handleEscapeKeyAndStopPropogation } from './index.js';
16
17
  import { r as ref } from './ref.js';
17
18
  import { w as when } from './when.js';
18
19
  import { s as slotted } from './slotted.js';
@@ -39,7 +40,9 @@ var __decorateClass = (decorators, target, key, kind) => {
39
40
  if (kind && result) __defProp(target, key, result);
40
41
  return result;
41
42
  };
42
- let Select = class extends AffixIconWithTrailing(FormAssociatedSelect) {
43
+ let Select = class extends HostSemantics(
44
+ AffixIconWithTrailing(FormAssociatedSelect)
45
+ ) {
43
46
  constructor() {
44
47
  super(...arguments);
45
48
  this.activeIndex = -1;
@@ -850,11 +853,14 @@ const SelectTemplate = (context) => {
850
853
  return html`
851
854
  <template
852
855
  class="base"
853
- role="combobox"
854
- aria-haspopup="${(x) => x.collapsible ? "listbox" : "false"}"
856
+ ${applyHostSemantics({
857
+ role: "combobox",
858
+ ariaLabel: (x) => x.ariaLabel ?? x.label,
859
+ ariaHasPopup: (x) => x.collapsible ? "listbox" : "false",
860
+ ariaExpanded: (x) => x.open,
861
+ ariaDisabled: (x) => x.disabled
862
+ })}
855
863
  aria-controls="${(x) => x.listboxId}"
856
- aria-expanded="${(x) => x.open}"
857
- aria-disabled="${(x) => x.disabled}"
858
864
  aria-activedescendant="${(x) => x._activeDescendant}"
859
865
  tabindex="${(x) => !x.disabled ? "0" : null}"
860
866
  @click="${ifNotFromFeedback((x, e) => x.clickHandler(e))}"
@@ -86,7 +86,12 @@ function checkbox(context) {
86
86
  (x) => x.controlType !== "radio",
87
87
  vividElement.html`
88
88
  <${checkboxTag}
89
- aria-label="${(x) => !x.clickableBox && !x.clickable && x.ariaLabel ? x.ariaLabel : null}"
89
+ ${delegatesAria.delegateAria(
90
+ {
91
+ ariaLabel: (x) => !x.clickableBox && !x.clickable && x.ariaLabel ? x.ariaLabel : null
92
+ },
93
+ { onlySpecified: true }
94
+ )}
90
95
  @change="${(x) => handleControlChange(x)}"
91
96
  class="control checkbox"
92
97
  connotation="${(x) => x.connotation === "cta" ? enums.Connotation.CTA : enums.Connotation.Accent}"
@@ -101,7 +106,12 @@ function radio(context) {
101
106
  (x) => x.controlType === "radio",
102
107
  vividElement.html`
103
108
  <${radioTag}
104
- aria-label="${(x) => !x.clickableBox && !x.clickable && x.ariaLabel ? x.ariaLabel : null}"
109
+ ${delegatesAria.delegateAria(
110
+ {
111
+ ariaLabel: (x) => !x.clickableBox && !x.clickable && x.ariaLabel ? x.ariaLabel : null
112
+ },
113
+ { onlySpecified: true }
114
+ )}
105
115
  @change="${(x) => handleControlChange(x)}"
106
116
  class="control radio"
107
117
  connotation="${(x) => x.connotation === "cta" ? enums.Connotation.CTA : enums.Connotation.Accent}"
@@ -111,13 +121,15 @@ function radio(context) {
111
121
  )} `;
112
122
  }
113
123
  const SelectableBoxTemplate = (context) => {
114
- return vividElement.html`<template role="presentation">
124
+ return vividElement.html`<template>
115
125
  <div
116
126
  class="${getClasses}"
117
127
  tabindex="${(x) => x.clickableBox || x.clickable ? "0" : null}"
118
- role="${(x) => x.clickableBox || x.clickable ? "button" : null}"
119
- aria-pressed="${(x) => x.clickableBox || x.clickable ? x.checked ? "true" : "false" : null}"
120
- aria-label="${(x) => x.clickableBox || x.clickable ? x.ariaLabel : null}"
128
+ ${delegatesAria.delegateAria({
129
+ role: (x) => x.clickableBox || x.clickable ? "button" : null,
130
+ ariaPressed: (x) => x.clickableBox || x.clickable ? x.checked ? "true" : "false" : null,
131
+ ariaLabel: (x) => x.clickableBox || x.clickable ? x.ariaLabel : null
132
+ })}
121
133
  @keydown="${(x, c) => x._handleKeydown(c.event)}"
122
134
  @click="${(x) => x.clickableBox || x.clickable ? x._handleCheckedChange() : null}"
123
135
  >
@@ -1,7 +1,7 @@
1
1
  import { C as Checkbox, c as checkboxDefinition } from './definition15.js';
2
2
  import { R as Radio, r as radioDefinition } from './definition41.js';
3
- import { V as VividElement, a as attr, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
4
- import { D as DelegatesAria } from './delegates-aria.js';
3
+ import { V as VividElement, a as attr, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
4
+ import { D as DelegatesAria, d as delegateAria } from './delegates-aria.js';
5
5
  import { C as Connotation } from './enums.js';
6
6
  import { c as classNames } from './class-names.js';
7
7
  import { w as when } from './when.js';
@@ -84,7 +84,12 @@ function checkbox(context) {
84
84
  (x) => x.controlType !== "radio",
85
85
  html`
86
86
  <${checkboxTag}
87
- aria-label="${(x) => !x.clickableBox && !x.clickable && x.ariaLabel ? x.ariaLabel : null}"
87
+ ${delegateAria(
88
+ {
89
+ ariaLabel: (x) => !x.clickableBox && !x.clickable && x.ariaLabel ? x.ariaLabel : null
90
+ },
91
+ { onlySpecified: true }
92
+ )}
88
93
  @change="${(x) => handleControlChange(x)}"
89
94
  class="control checkbox"
90
95
  connotation="${(x) => x.connotation === "cta" ? Connotation.CTA : Connotation.Accent}"
@@ -99,7 +104,12 @@ function radio(context) {
99
104
  (x) => x.controlType === "radio",
100
105
  html`
101
106
  <${radioTag}
102
- aria-label="${(x) => !x.clickableBox && !x.clickable && x.ariaLabel ? x.ariaLabel : null}"
107
+ ${delegateAria(
108
+ {
109
+ ariaLabel: (x) => !x.clickableBox && !x.clickable && x.ariaLabel ? x.ariaLabel : null
110
+ },
111
+ { onlySpecified: true }
112
+ )}
103
113
  @change="${(x) => handleControlChange(x)}"
104
114
  class="control radio"
105
115
  connotation="${(x) => x.connotation === "cta" ? Connotation.CTA : Connotation.Accent}"
@@ -109,13 +119,15 @@ function radio(context) {
109
119
  )} `;
110
120
  }
111
121
  const SelectableBoxTemplate = (context) => {
112
- return html`<template role="presentation">
122
+ return html`<template>
113
123
  <div
114
124
  class="${getClasses}"
115
125
  tabindex="${(x) => x.clickableBox || x.clickable ? "0" : null}"
116
- role="${(x) => x.clickableBox || x.clickable ? "button" : null}"
117
- aria-pressed="${(x) => x.clickableBox || x.clickable ? x.checked ? "true" : "false" : null}"
118
- aria-label="${(x) => x.clickableBox || x.clickable ? x.ariaLabel : null}"
126
+ ${delegateAria({
127
+ role: (x) => x.clickableBox || x.clickable ? "button" : null,
128
+ ariaPressed: (x) => x.clickableBox || x.clickable ? x.checked ? "true" : "false" : null,
129
+ ariaLabel: (x) => x.clickableBox || x.clickable ? x.ariaLabel : null
130
+ })}
119
131
  @keydown="${(x, c) => x._handleKeydown(c.event)}"
120
132
  @click="${(x) => x.clickableBox || x.clickable ? x._handleCheckedChange() : null}"
121
133
  >
@@ -1,4 +1,4 @@
1
- import { V as VividElement, a as attr, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
1
+ import { V as VividElement, a as attr, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
2
2
  import { h as handleEscapeKeyAndStopPropogation } from './index.js';
3
3
  import { c as classNames } from './class-names.js';
4
4
  import { w as when } from './when.js';
@@ -1,5 +1,5 @@
1
1
  import { p as popupDefinition } from './definition65.js';
2
- import { V as VividElement, a as attr, o as observable, n as nullableNumberConverter, v as volatile, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
2
+ import { V as VividElement, a as attr, o as observable, n as nullableNumberConverter, v as volatile, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
3
3
  import { g as keyHome, d as keyEnd, f as keyArrowDown, h as keyArrowLeft, e as keyArrowUp, i as keyArrowRight } from './key-codes.js';
4
4
  import { D as Direction, g as getDirection } from './direction.js';
5
5
  import { i as inverseLerp, l as lerp, r as roundToStepValue, d as defaultToOneConverter, S as SliderTemplate } from './slider.template.js';
@@ -83,7 +83,9 @@ function actionButton(context) {
83
83
  <button
84
84
  ${ref.ref("_action")}
85
85
  class="control ${getClasses}"
86
- aria-label="${(x) => x.ariaLabel}"
86
+ ${delegatesAria.delegateAria({
87
+ ariaExpanded: null
88
+ })}
87
89
  ?disabled="${(x) => x.disabled}"
88
90
  @click="${(x) => x.$emit("action-click", void 0, {
89
91
  bubbles: false
@@ -102,7 +104,12 @@ function indicatorButton(context) {
102
104
  class="indicator ${getClasses}"
103
105
  ?disabled="${(x) => x.disabled}"
104
106
  aria-label="${(x) => x.indicatorAriaLabel || x.locale.splitButton.showMoreActionsLabel}"
105
- aria-expanded="${(x) => x.ariaExpanded}"
107
+ ${delegatesAria.delegateAria(
108
+ {
109
+ ariaExpanded: (x) => x.ariaExpanded
110
+ },
111
+ { onlySpecified: true }
112
+ )}
106
113
  @click="${(x) => x.$emit("indicator-click", void 0, {
107
114
  bubbles: false
108
115
  })}"
@@ -112,7 +119,7 @@ function indicatorButton(context) {
112
119
  `;
113
120
  }
114
121
  const SplitButtonTemplate = (context) => {
115
- return vividElement.html` <template role="presentation">
122
+ return vividElement.html` <template>
116
123
  <div class="base" role="group">
117
124
  ${actionButton(context)} ${indicatorButton(context)}
118
125
  <slot></slot>
@@ -1,7 +1,7 @@
1
1
  import { i as iconDefinition } from './definition28.js';
2
- import { V as VividElement, a as attr, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
2
+ import { V as VividElement, a as attr, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
3
3
  import { b as AffixIcon, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
4
- import { D as DelegatesAria } from './delegates-aria.js';
4
+ import { D as DelegatesAria, d as delegateAria } from './delegates-aria.js';
5
5
  import { L as Localized } from './localized.js';
6
6
  import { r as ref } from './ref.js';
7
7
  import { c as classNames } from './class-names.js';
@@ -81,7 +81,9 @@ function actionButton(context) {
81
81
  <button
82
82
  ${ref("_action")}
83
83
  class="control ${getClasses}"
84
- aria-label="${(x) => x.ariaLabel}"
84
+ ${delegateAria({
85
+ ariaExpanded: null
86
+ })}
85
87
  ?disabled="${(x) => x.disabled}"
86
88
  @click="${(x) => x.$emit("action-click", void 0, {
87
89
  bubbles: false
@@ -100,7 +102,12 @@ function indicatorButton(context) {
100
102
  class="indicator ${getClasses}"
101
103
  ?disabled="${(x) => x.disabled}"
102
104
  aria-label="${(x) => x.indicatorAriaLabel || x.locale.splitButton.showMoreActionsLabel}"
103
- aria-expanded="${(x) => x.ariaExpanded}"
105
+ ${delegateAria(
106
+ {
107
+ ariaExpanded: (x) => x.ariaExpanded
108
+ },
109
+ { onlySpecified: true }
110
+ )}
104
111
  @click="${(x) => x.$emit("indicator-click", void 0, {
105
112
  bubbles: false
106
113
  })}"
@@ -110,7 +117,7 @@ function indicatorButton(context) {
110
117
  `;
111
118
  }
112
119
  const SplitButtonTemplate = (context) => {
113
- return html` <template role="presentation">
120
+ return html` <template>
114
121
  <div class="base" role="group">
115
122
  ${actionButton(context)} ${indicatorButton(context)}
116
123
  <slot></slot>
@@ -287,8 +287,13 @@ function renderSlider(context) {
287
287
  function renderTimestamp() {
288
288
  return vividElement.html` <div class="time-stamp">
289
289
  <span class="current-time">${(x) => formatTime(x.currentTime)}</span>
290
- <span>/</span>
291
- <span class="total-time">${(x) => formatTime(x.duration)}</span>
290
+ ${when.when(
291
+ (x) => x.duration && x.duration !== Infinity,
292
+ vividElement.html`
293
+ <span>/</span>
294
+ <span class="total-time">${(x) => formatTime(x.duration)}</span>
295
+ `
296
+ )}
292
297
  </div>`;
293
298
  }
294
299
  function handlePlaybackRateClick(playbackRate, context) {
@@ -1,7 +1,7 @@
1
1
  import { B as Button, b as buttonDefinition } from './definition11.js';
2
2
  import { S as Slider, s as sliderDefinition } from './definition48.js';
3
3
  import { e as Menu, M as MenuItem, c as menuDefinition, m as menuItemDefinition } from './definition30.js';
4
- import { O as Observable, V as VividElement, a as attr, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
4
+ import { O as Observable, V as VividElement, a as attr, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
5
5
  import { M as MediaSkipBy } from './enums.js';
6
6
  import { L as Localized } from './localized.js';
7
7
  import { g as getPlaybackRatesArray } from './playbackRates.js';
@@ -285,8 +285,13 @@ function renderSlider(context) {
285
285
  function renderTimestamp() {
286
286
  return html` <div class="time-stamp">
287
287
  <span class="current-time">${(x) => formatTime(x.currentTime)}</span>
288
- <span>/</span>
289
- <span class="total-time">${(x) => formatTime(x.duration)}</span>
288
+ ${when(
289
+ (x) => x.duration && x.duration !== Infinity,
290
+ html`
291
+ <span>/</span>
292
+ <span class="total-time">${(x) => formatTime(x.duration)}</span>
293
+ `
294
+ )}
290
295
  </div>`;
291
296
  }
292
297
  function handlePlaybackRateClick(playbackRate, context) {
@@ -105,14 +105,15 @@ const getClasses = (_) => classNames.classNames(
105
105
  ]
106
106
  );
107
107
  const SwitchTemplate = vividElement.html`
108
- <template role="${(x) => x.ariaLabel ? "presentation" : null}">
108
+ <template>
109
109
  <div
110
110
  class="${getClasses}"
111
- role="switch"
112
- aria-label="${(x) => x.ariaLabel}"
113
- aria-checked="${(x) => x.checked}"
114
- aria-disabled="${(x) => x.disabled}"
115
- aria-readonly="${(x) => x.readOnly}"
111
+ ${delegatesAria.delegateAria({
112
+ role: "switch",
113
+ ariaChecked: (x) => x.checked,
114
+ ariaDisabled: (x) => x.disabled,
115
+ ariaReadOnly: (x) => x.readOnly
116
+ })}
116
117
  tabindex="${(x) => x.disabled ? null : 0}"
117
118
  @keypress="${(x, c) => x.keypressHandler(c.event)}"
118
119
  @click="${(x) => x.clickHandler()}"
@@ -1,6 +1,6 @@
1
1
  import { i as iconDefinition } from './definition28.js';
2
- import { V as VividElement, a as attr, o as observable, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
3
- import { D as DelegatesAria } from './delegates-aria.js';
2
+ import { V as VividElement, a as attr, o as observable, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
3
+ import { D as DelegatesAria, d as delegateAria } from './delegates-aria.js';
4
4
  import { C as CheckableFormAssociated } from './form-associated.js';
5
5
  import { a as keySpace, k as keyEnter } from './key-codes.js';
6
6
  import { c as classNames } from './class-names.js';
@@ -103,14 +103,15 @@ const getClasses = (_) => classNames(
103
103
  ]
104
104
  );
105
105
  const SwitchTemplate = html`
106
- <template role="${(x) => x.ariaLabel ? "presentation" : null}">
106
+ <template>
107
107
  <div
108
108
  class="${getClasses}"
109
- role="switch"
110
- aria-label="${(x) => x.ariaLabel}"
111
- aria-checked="${(x) => x.checked}"
112
- aria-disabled="${(x) => x.disabled}"
113
- aria-readonly="${(x) => x.readOnly}"
109
+ ${delegateAria({
110
+ role: "switch",
111
+ ariaChecked: (x) => x.checked,
112
+ ariaDisabled: (x) => x.disabled,
113
+ ariaReadOnly: (x) => x.readOnly
114
+ })}
114
115
  tabindex="${(x) => x.disabled ? null : 0}"
115
116
  @keypress="${(x, c) => x.keypressHandler(c.event)}"
116
117
  @click="${(x) => x.clickHandler()}"
@@ -1,12 +1,13 @@
1
1
  'use strict';
2
2
 
3
3
  const vividElement = require('./vivid-element.cjs');
4
+ const hostSemantics = require('./host-semantics.cjs');
4
5
 
5
- class TabPanel extends vividElement.VividElement {
6
+ class TabPanel extends hostSemantics.HostSemantics(vividElement.VividElement) {
6
7
  }
7
8
 
8
9
  const TabPanelTemplate = vividElement.html`
9
- <template slot="tabpanel" role="tabpanel">
10
+ <template slot="tabpanel" ${hostSemantics.applyHostSemantics({ role: "tabpanel" })}>
10
11
  <slot></slot>
11
12
  </template>
12
13
  `;
@@ -1,10 +1,11 @@
1
- import { V as VividElement, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
1
+ import { V as VividElement, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
2
+ import { H as HostSemantics, a as applyHostSemantics } from './host-semantics.js';
2
3
 
3
- class TabPanel extends VividElement {
4
+ class TabPanel extends HostSemantics(VividElement) {
4
5
  }
5
6
 
6
7
  const TabPanelTemplate = html`
7
- <template slot="tabpanel" role="tabpanel">
8
+ <template slot="tabpanel" ${applyHostSemantics({ role: "tabpanel" })}>
8
9
  <slot></slot>
9
10
  </template>
10
11
  `;
@@ -3,6 +3,7 @@
3
3
  const definition = require('./definition28.cjs');
4
4
  const vividElement = require('./vivid-element.cjs');
5
5
  const affix = require('./affix.cjs');
6
+ const hostSemantics = require('./host-semantics.cjs');
6
7
  const localized = require('./localized.cjs');
7
8
  const classNames = require('./class-names.cjs');
8
9
 
@@ -17,7 +18,9 @@ var __decorateClass = (decorators, target, key, kind) => {
17
18
  if (result) __defProp(target, key, result);
18
19
  return result;
19
20
  };
20
- class Tab extends affix.AffixIconWithTrailing(localized.Localized(vividElement.VividElement)) {
21
+ class Tab extends hostSemantics.HostSemantics(
22
+ affix.AffixIconWithTrailing(localized.Localized(vividElement.VividElement))
23
+ ) {
21
24
  constructor() {
22
25
  super(...arguments);
23
26
  this.removable = false;
@@ -92,9 +95,10 @@ const TabTemplate = (context) => {
92
95
  return vividElement.html`
93
96
  <template
94
97
  slot="tab"
95
- role="tab"
96
- aria-disabled="${(x) => x.disabled}"
97
- aria-selected="${(x) => x.ariaSelected}"
98
+ ${hostSemantics.applyHostSemantics({
99
+ role: "tab",
100
+ ariaDisabled: (x) => x.disabled
101
+ })}
98
102
  @keydown="${(x, c) => x._onKeyDown(c.event)}"
99
103
  >
100
104
  <div class="${getClasses}">
@@ -1,6 +1,7 @@
1
1
  import { i as iconDefinition } from './definition28.js';
2
- import { V as VividElement, a as attr, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
2
+ import { V as VividElement, a as attr, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
3
3
  import { A as AffixIconWithTrailing, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
4
+ import { H as HostSemantics, a as applyHostSemantics } from './host-semantics.js';
4
5
  import { L as Localized } from './localized.js';
5
6
  import { c as classNames } from './class-names.js';
6
7
 
@@ -15,7 +16,9 @@ var __decorateClass = (decorators, target, key, kind) => {
15
16
  if (result) __defProp(target, key, result);
16
17
  return result;
17
18
  };
18
- class Tab extends AffixIconWithTrailing(Localized(VividElement)) {
19
+ class Tab extends HostSemantics(
20
+ AffixIconWithTrailing(Localized(VividElement))
21
+ ) {
19
22
  constructor() {
20
23
  super(...arguments);
21
24
  this.removable = false;
@@ -90,9 +93,10 @@ const TabTemplate = (context) => {
90
93
  return html`
91
94
  <template
92
95
  slot="tab"
93
- role="tab"
94
- aria-disabled="${(x) => x.disabled}"
95
- aria-selected="${(x) => x.ariaSelected}"
96
+ ${applyHostSemantics({
97
+ role: "tab",
98
+ ariaDisabled: (x) => x.disabled
99
+ })}
96
100
  @keydown="${(x, c) => x._onKeyDown(c.event)}"
97
101
  >
98
102
  <div class="${getClasses}">
@@ -1,6 +1,6 @@
1
1
  import { t as tabDefinition } from './definition52.js';
2
2
  import { t as tabPanelDefinition } from './definition51.js';
3
- import { V as VividElement, a as attr, o as observable, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
3
+ import { V as VividElement, a as attr, o as observable, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
4
4
  import { i as keyArrowRight, h as keyArrowLeft, f as keyArrowDown, e as keyArrowUp, d as keyEnd, g as keyHome } from './key-codes.js';
5
5
  import { u as uniqueId } from './strings.js';
6
6
  import { l as limit } from './numbers.js';
@@ -13,9 +13,10 @@ const getClasses = (_) => classNames.classNames("base");
13
13
  const TagGroupTemplate = vividElement.html`
14
14
  <div
15
15
  class="${getClasses}"
16
- role="listbox"
17
- aria-orientation="horizontal"
18
- aria-label="${(x) => x.ariaLabel}"
16
+ ${delegatesAria.delegateAria({
17
+ role: "listbox",
18
+ ariaOrientation: "horizontal"
19
+ })}
19
20
  >
20
21
  <slot></slot>
21
22
  </div>
@@ -1,5 +1,5 @@
1
- import { V as VividElement, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
2
- import { D as DelegatesAria } from './delegates-aria.js';
1
+ import { V as VividElement, h as html, g as createRegisterFunction, i as defineVividComponent } from './vivid-element.js';
2
+ import { D as DelegatesAria, d as delegateAria } from './delegates-aria.js';
3
3
  import { c as classNames } from './class-names.js';
4
4
 
5
5
  const styles = ".base{display:flex;flex-wrap:wrap;gap:8px}";
@@ -11,9 +11,10 @@ const getClasses = (_) => classNames("base");
11
11
  const TagGroupTemplate = html`
12
12
  <div
13
13
  class="${getClasses}"
14
- role="listbox"
15
- aria-orientation="horizontal"
16
- aria-label="${(x) => x.ariaLabel}"
14
+ ${delegateAria({
15
+ role: "listbox",
16
+ ariaOrientation: "horizontal"
17
+ })}
17
18
  >
18
19
  <slot></slot>
19
20
  </div>