@vonage/vivid 4.14.0 → 4.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/custom-elements.json +152 -197
  2. package/lib/divider/divider.d.ts +1 -1
  3. package/lib/divider/divider.template.d.ts +1 -1
  4. package/lib/elevation/elevation.d.ts +1 -0
  5. package/lib/radio/radio.form-associated.d.ts +2 -0
  6. package/lib/tabs/tabs.d.ts +0 -5
  7. package/lib/text-anchor/text-anchor.d.ts +2 -2
  8. package/lib/tree-item/tree-item.d.ts +2 -2
  9. package/lib/tree-view/tree-view.d.ts +2 -2
  10. package/package.json +1 -1
  11. package/shared/affix.cjs +8 -8
  12. package/shared/affix.js +2 -2
  13. package/shared/anchor.cjs +10 -10
  14. package/shared/anchor.js +1 -1
  15. package/shared/anchored.cjs +6 -6
  16. package/shared/anchored.js +1 -1
  17. package/shared/apply-mixins.cjs +3 -3
  18. package/shared/apply-mixins.js +1 -1
  19. package/shared/apply-mixins2.cjs +3 -3
  20. package/shared/apply-mixins2.js +1 -1
  21. package/shared/applyMixinsWithObservables.cjs +3 -3
  22. package/shared/applyMixinsWithObservables.js +1 -1
  23. package/shared/aria-global.cjs +20 -20
  24. package/shared/aria-global.js +1 -1
  25. package/shared/base-progress.cjs +7 -8
  26. package/shared/base-progress.js +2 -3
  27. package/shared/breadcrumb-item.cjs +2 -3
  28. package/shared/breadcrumb-item.js +1 -2
  29. package/shared/button.cjs +10 -11
  30. package/shared/button.js +1 -2
  31. package/shared/calendar-event.cjs +7 -8
  32. package/shared/calendar-event.js +1 -2
  33. package/shared/children.cjs +2 -2
  34. package/shared/children.js +1 -1
  35. package/shared/definition.cjs +14 -15
  36. package/shared/definition.js +2 -3
  37. package/shared/definition10.cjs +5 -6
  38. package/shared/definition10.js +1 -2
  39. package/shared/definition11.cjs +29 -29
  40. package/shared/definition11.js +2 -2
  41. package/shared/definition12.cjs +6 -6
  42. package/shared/definition12.js +1 -1
  43. package/shared/definition13.cjs +13 -14
  44. package/shared/definition13.js +1 -2
  45. package/shared/definition14.cjs +23 -24
  46. package/shared/definition14.js +1 -2
  47. package/shared/definition15.cjs +15 -16
  48. package/shared/definition15.js +1 -2
  49. package/shared/definition16.cjs +21 -21
  50. package/shared/definition16.js +5 -5
  51. package/shared/definition17.cjs +62 -61
  52. package/shared/definition17.js +10 -9
  53. package/shared/definition18.cjs +4 -4
  54. package/shared/definition18.js +1 -1
  55. package/shared/definition19.cjs +12 -12
  56. package/shared/definition19.js +1 -1
  57. package/shared/definition2.cjs +6 -7
  58. package/shared/definition2.js +1 -2
  59. package/shared/definition20.cjs +20 -21
  60. package/shared/definition20.js +1 -2
  61. package/shared/definition21.cjs +27 -28
  62. package/shared/definition21.js +3 -4
  63. package/shared/definition22.cjs +7 -7
  64. package/shared/definition22.js +3 -3
  65. package/shared/definition23.cjs +10 -11
  66. package/shared/definition23.js +1 -2
  67. package/shared/definition24.cjs +8 -8
  68. package/shared/definition24.js +3 -3
  69. package/shared/definition25.cjs +13 -14
  70. package/shared/definition25.js +1 -2
  71. package/shared/definition26.cjs +5 -6
  72. package/shared/definition26.js +1 -2
  73. package/shared/definition27.cjs +12 -13
  74. package/shared/definition27.js +2 -3
  75. package/shared/definition28.cjs +9 -10
  76. package/shared/definition28.js +2 -3
  77. package/shared/definition29.cjs +44 -45
  78. package/shared/definition29.js +3 -4
  79. package/shared/definition3.cjs +8 -9
  80. package/shared/definition3.js +1 -2
  81. package/shared/definition30.cjs +9 -10
  82. package/shared/definition30.js +2 -3
  83. package/shared/definition31.cjs +5 -5
  84. package/shared/definition31.js +2 -2
  85. package/shared/definition32.cjs +3 -4
  86. package/shared/definition32.js +1 -2
  87. package/shared/definition33.cjs +6 -7
  88. package/shared/definition33.js +2 -3
  89. package/shared/definition34.cjs +112 -45
  90. package/shared/definition34.js +73 -6
  91. package/shared/definition35.cjs +9 -209
  92. package/shared/definition35.js +4 -202
  93. package/shared/definition36.cjs +15 -16
  94. package/shared/definition36.js +1 -2
  95. package/shared/definition37.cjs +9 -9
  96. package/shared/definition37.js +1 -1
  97. package/shared/definition38.cjs +10 -10
  98. package/shared/definition38.js +1 -1
  99. package/shared/definition39.cjs +12 -13
  100. package/shared/definition39.js +1 -2
  101. package/shared/definition4.cjs +19 -20
  102. package/shared/definition4.js +2 -3
  103. package/shared/definition40.cjs +61 -13
  104. package/shared/definition40.js +52 -4
  105. package/shared/definition41.cjs +29 -30
  106. package/shared/definition41.js +1 -2
  107. package/shared/definition42.cjs +52 -53
  108. package/shared/definition42.js +3 -4
  109. package/shared/definition43.cjs +40 -40
  110. package/shared/definition43.js +6 -6
  111. package/shared/definition44.cjs +14 -15
  112. package/shared/definition44.js +1 -2
  113. package/shared/definition45.cjs +9 -10
  114. package/shared/definition45.js +1 -2
  115. package/shared/definition46.cjs +26 -27
  116. package/shared/definition46.js +1 -2
  117. package/shared/definition47.cjs +17 -18
  118. package/shared/definition47.js +2 -3
  119. package/shared/definition48.cjs +9 -10
  120. package/shared/definition48.js +1 -2
  121. package/shared/definition49.cjs +3 -4
  122. package/shared/definition49.js +1 -2
  123. package/shared/definition5.cjs +30 -31
  124. package/shared/definition5.js +1 -2
  125. package/shared/definition50.cjs +12 -13
  126. package/shared/definition50.js +2 -3
  127. package/shared/definition51.cjs +109 -72
  128. package/shared/definition51.js +78 -41
  129. package/shared/definition52.cjs +4 -5
  130. package/shared/definition52.js +1 -2
  131. package/shared/definition53.cjs +15 -16
  132. package/shared/definition53.js +2 -3
  133. package/shared/definition54.cjs +20 -21
  134. package/shared/definition54.js +1 -2
  135. package/shared/definition55.cjs +5 -5
  136. package/shared/definition55.js +1 -1
  137. package/shared/definition56.cjs +18 -19
  138. package/shared/definition56.js +1 -2
  139. package/shared/definition57.cjs +10 -11
  140. package/shared/definition57.js +1 -2
  141. package/shared/definition58.cjs +7 -8
  142. package/shared/definition58.js +1 -2
  143. package/shared/definition59.cjs +16 -17
  144. package/shared/definition59.js +3 -4
  145. package/shared/definition6.cjs +11 -12
  146. package/shared/definition6.js +1 -2
  147. package/shared/definition60.cjs +9 -10
  148. package/shared/definition60.js +2 -3
  149. package/shared/definition61.cjs +27 -30
  150. package/shared/definition61.js +17 -20
  151. package/shared/definition62.cjs +12 -9
  152. package/shared/definition62.js +8 -5
  153. package/shared/definition63.cjs +13 -14
  154. package/shared/definition63.js +1 -2
  155. package/shared/definition7.cjs +9 -10
  156. package/shared/definition7.js +2 -3
  157. package/shared/definition8.cjs +14 -15
  158. package/shared/definition8.js +2 -3
  159. package/shared/definition9.cjs +7 -7
  160. package/shared/definition9.js +1 -1
  161. package/shared/form-associated.cjs +14 -14
  162. package/shared/form-associated.js +1 -1
  163. package/shared/form-associated2.cjs +10 -10
  164. package/shared/form-associated2.js +1 -1
  165. package/shared/form-elements.cjs +13 -13
  166. package/shared/form-elements.js +1 -1
  167. package/shared/foundation/progress/base-progress.d.ts +2 -2
  168. package/shared/foundation-element.cjs +11 -11
  169. package/shared/foundation-element.js +1 -1
  170. package/shared/key-codes2.cjs +0 -56
  171. package/shared/key-codes2.js +1 -53
  172. package/shared/listbox.cjs +15 -16
  173. package/shared/listbox.js +2 -3
  174. package/shared/localized.cjs +2 -2
  175. package/shared/localized.js +1 -1
  176. package/shared/option.cjs +205 -0
  177. package/shared/option.js +202 -0
  178. package/shared/presentationDate.cjs +42 -43
  179. package/shared/presentationDate.js +1 -2
  180. package/shared/ref.cjs +2 -2
  181. package/shared/ref.js +1 -1
  182. package/shared/repeat.cjs +15 -15
  183. package/shared/repeat.js +1 -1
  184. package/shared/slider.template.cjs +4 -4
  185. package/shared/slider.template.js +1 -1
  186. package/shared/slotted.cjs +4 -4
  187. package/shared/slotted.js +1 -1
  188. package/shared/start-end.cjs +52 -0
  189. package/shared/start-end.js +50 -0
  190. package/shared/text-anchor.cjs +5 -6
  191. package/shared/text-anchor.js +3 -4
  192. package/shared/text-anchor.template.cjs +2 -2
  193. package/shared/text-anchor.template.js +1 -1
  194. package/shared/text-field2.cjs +23 -24
  195. package/shared/text-field2.js +2 -3
  196. package/shared/vivid-element.cjs +2610 -2
  197. package/shared/vivid-element.js +2591 -2
  198. package/styles/core/all.css +40 -1
  199. package/styles/core/theme.css +40 -1
  200. package/styles/core/typography.css +1 -1
  201. package/styles/tokens/theme-dark.css +25 -4
  202. package/styles/tokens/theme-light.css +25 -4
  203. package/styles/tokens/vivid-2-compat.css +1 -1
  204. package/text-anchor/index.cjs +3 -3
  205. package/text-anchor/index.js +1 -1
  206. package/lib/listbox/definition.d.ts +0 -2
  207. package/lib/listbox/listbox.d.ts +0 -14
  208. package/lib/listbox/listbox.template.d.ts +0 -2
  209. package/listbox/index.cjs +0 -54
  210. package/listbox/index.js +0 -52
  211. package/shared/aria-global2.cjs +0 -75
  212. package/shared/aria-global2.js +0 -73
  213. package/shared/defineVividComponent.cjs +0 -2612
  214. package/shared/defineVividComponent.js +0 -2592
  215. package/shared/listbox2.cjs +0 -1268
  216. package/shared/listbox2.js +0 -1265
  217. package/shared/strings2.cjs +0 -37
  218. package/shared/strings2.js +0 -33
@@ -1,210 +1,12 @@
1
1
  'use strict';
2
2
 
3
3
  const definition = require('./definition27.cjs');
4
- const defineVividComponent = require('./defineVividComponent.cjs');
5
- const applyMixins = require('./apply-mixins.cjs');
6
- const affix = require('./affix.cjs');
7
- const ariaGlobal = require('./aria-global.cjs');
8
4
  const vividElement = require('./vivid-element.cjs');
9
- const dom = require('./dom.cjs');
5
+ const option = require('./option.cjs');
6
+ const affix = require('./affix.cjs');
10
7
  const when = require('./when.cjs');
11
8
  const classNames = require('./class-names.cjs');
12
9
 
13
- var __defProp = Object.defineProperty;
14
- var __decorateClass = (decorators, target, key, kind) => {
15
- var result = void 0 ;
16
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
17
- if (decorator = decorators[i])
18
- result = (decorator(target, key, result) ) || result;
19
- if (result) __defProp(target, key, result);
20
- return result;
21
- };
22
- function isListboxOption(el) {
23
- return dom.isHTMLElement(el) && (el.getAttribute("role") === "option" || el instanceof HTMLOptionElement);
24
- }
25
- class ListboxOption extends vividElement.VividElement {
26
- constructor(text, value, defaultSelected, selected) {
27
- super();
28
- this.defaultSelected = false;
29
- /**
30
- * Tracks whether the "selected" property has been changed.
31
- * @internal
32
- */
33
- this.dirtySelected = false;
34
- this.selected = this.defaultSelected;
35
- /**
36
- * Track whether the value has been changed from the initial value
37
- */
38
- this.dirtyValue = false;
39
- this._highlighted = false;
40
- this._displayCheckmark = false;
41
- this._matchedRange = null;
42
- if (text) {
43
- this.text = text;
44
- }
45
- if (value) {
46
- this.initialValue = value;
47
- }
48
- if (defaultSelected) {
49
- this.defaultSelected = defaultSelected;
50
- }
51
- if (selected) {
52
- this.selected = selected;
53
- }
54
- this.proxy = new Option(
55
- this.text,
56
- // @ts-expect-error Propery is used before it is assigned
57
- this.initialValue,
58
- this.defaultSelected,
59
- this.selected
60
- );
61
- this.proxy.disabled = this.disabled;
62
- }
63
- /**
64
- * Updates the ariaChecked property when the checked property changes.
65
- *
66
- * @param _ - the previous checked value
67
- * @param next - the current checked value
68
- *
69
- * @public
70
- */
71
- checkedChanged(_, next) {
72
- if (typeof next === "boolean") {
73
- this.ariaChecked = next ? "true" : "false";
74
- return;
75
- }
76
- this.ariaChecked = null;
77
- }
78
- defaultSelectedChanged() {
79
- if (!this.dirtySelected) {
80
- this.selected = this.defaultSelected;
81
- if (this.proxy instanceof HTMLOptionElement) {
82
- this.proxy.selected = this.defaultSelected;
83
- }
84
- }
85
- }
86
- disabledChanged() {
87
- this.ariaDisabled = this.disabled ? "true" : "false";
88
- if (this.proxy instanceof HTMLOptionElement) {
89
- this.proxy.disabled = this.disabled;
90
- }
91
- }
92
- selectedAttributeChanged() {
93
- this.defaultSelected = this.selectedAttribute;
94
- if (this.proxy instanceof HTMLOptionElement) {
95
- this.proxy.defaultSelected = this.defaultSelected;
96
- }
97
- }
98
- selectedChanged() {
99
- this.ariaSelected = this.selected ? "true" : "false";
100
- if (!this.dirtySelected) {
101
- this.dirtySelected = true;
102
- }
103
- if (this.proxy instanceof HTMLOptionElement) {
104
- this.proxy.selected = this.selected;
105
- }
106
- }
107
- initialValueChanged() {
108
- if (!this.dirtyValue) {
109
- this.value = this.initialValue;
110
- this.dirtyValue = false;
111
- }
112
- }
113
- get label() {
114
- return this._label ?? this.text;
115
- }
116
- set label(value) {
117
- this._label = value;
118
- }
119
- set text(value) {
120
- this._text = value;
121
- }
122
- get text() {
123
- return this._text ?? "";
124
- }
125
- set value(next) {
126
- const newValue = `${next ?? ""}`;
127
- this._value = newValue;
128
- this.dirtyValue = true;
129
- if (this.proxy instanceof HTMLOptionElement) {
130
- this.proxy.value = newValue;
131
- }
132
- defineVividComponent.Observable.notify(this, "value");
133
- }
134
- get value() {
135
- defineVividComponent.Observable.track(this, "value");
136
- return this._value ?? this.text;
137
- }
138
- get form() {
139
- return null;
140
- }
141
- /**
142
- * @internal
143
- */
144
- get _matchedRangeSafe() {
145
- return this._matchedRange ?? { from: 0, to: 0 };
146
- }
147
- }
148
- __decorateClass([
149
- defineVividComponent.observable
150
- ], ListboxOption.prototype, "checked");
151
- __decorateClass([
152
- defineVividComponent.observable
153
- ], ListboxOption.prototype, "defaultSelected");
154
- // @ts-expect-error Type is incorrectly non-optional
155
- __decorateClass([
156
- defineVividComponent.attr({ mode: "boolean" })
157
- ], ListboxOption.prototype, "disabled");
158
- // @ts-expect-error Type is incorrectly non-optional
159
- __decorateClass([
160
- defineVividComponent.attr({ attribute: "selected", mode: "boolean" })
161
- ], ListboxOption.prototype, "selectedAttribute");
162
- __decorateClass([
163
- defineVividComponent.observable
164
- ], ListboxOption.prototype, "selected");
165
- __decorateClass([
166
- defineVividComponent.attr({ attribute: "value", mode: "fromView" })
167
- ], ListboxOption.prototype, "initialValue");
168
- __decorateClass([
169
- defineVividComponent.attr({
170
- attribute: "label"
171
- })
172
- ], ListboxOption.prototype, "_label");
173
- __decorateClass([
174
- defineVividComponent.attr({
175
- attribute: "text"
176
- })
177
- ], ListboxOption.prototype, "_text");
178
- __decorateClass([
179
- defineVividComponent.observable
180
- ], ListboxOption.prototype, "_highlighted");
181
- __decorateClass([
182
- defineVividComponent.observable
183
- ], ListboxOption.prototype, "_displayCheckmark");
184
- __decorateClass([
185
- defineVividComponent.observable
186
- ], ListboxOption.prototype, "_matchedRange");
187
- class DelegatesARIAListboxOption {
188
- }
189
- // @ts-expect-error Type is incorrectly non-optional
190
- __decorateClass([
191
- defineVividComponent.observable
192
- ], DelegatesARIAListboxOption.prototype, "ariaChecked");
193
- // @ts-expect-error Type is incorrectly non-optional
194
- __decorateClass([
195
- defineVividComponent.observable
196
- ], DelegatesARIAListboxOption.prototype, "ariaPosInSet");
197
- // @ts-expect-error Type is incorrectly non-optional
198
- __decorateClass([
199
- defineVividComponent.observable
200
- ], DelegatesARIAListboxOption.prototype, "ariaSelected");
201
- // @ts-expect-error Type is incorrectly non-optional
202
- __decorateClass([
203
- defineVividComponent.observable
204
- ], DelegatesARIAListboxOption.prototype, "ariaSetSize");
205
- applyMixins.applyMixins(DelegatesARIAListboxOption, ariaGlobal.ARIAGlobalStatesAndProperties);
206
- applyMixins.applyMixins(ListboxOption, affix.AffixIconWithTrailing, DelegatesARIAListboxOption);
207
-
208
10
  const getClasses = (x) => classNames.classNames(
209
11
  "base",
210
12
  ["disabled", x.disabled],
@@ -216,7 +18,7 @@ const getClasses = (x) => classNames.classNames(
216
18
  const ListboxOptionTemplate = (context) => {
217
19
  const affixIconTemplate = affix.affixIconTemplateFactory(context);
218
20
  const iconTag = context.tagFor(definition.Icon);
219
- return defineVividComponent.html`
21
+ return vividElement.html`
220
22
  <template
221
23
  aria-checked="${(x) => x.ariaChecked}"
222
24
  aria-disabled="${(x) => x.ariaDisabled}"
@@ -229,10 +31,10 @@ const ListboxOptionTemplate = (context) => {
229
31
  ${(x) => affixIconTemplate(x.icon, affix.IconWrapper.Slot)}
230
32
  ${when.when(
231
33
  (x) => x.text,
232
- defineVividComponent.html`<div class="text">
34
+ vividElement.html`<div class="text">
233
35
  ${when.when(
234
36
  (x) => x._matchedRange,
235
- defineVividComponent.html`${(x) => x.text.slice(0, x._matchedRangeSafe.from)}<span class="match"
37
+ vividElement.html`${(x) => x.text.slice(0, x._matchedRangeSafe.from)}<span class="match"
236
38
  >${(x) => x.text.slice(
237
39
  x._matchedRangeSafe.from,
238
40
  x._matchedRangeSafe.to
@@ -243,7 +45,7 @@ const ListboxOptionTemplate = (context) => {
243
45
  )}
244
46
  ${when.when(
245
47
  (x) => x._displayCheckmark && x.selected,
246
- defineVividComponent.html`<${iconTag} class="checkmark" name="check-line"></${iconTag}>`
48
+ vividElement.html`<${iconTag} class="checkmark" name="check-line"></${iconTag}>`
247
49
  )}
248
50
  </div>
249
51
  </template>
@@ -252,18 +54,16 @@ const ListboxOptionTemplate = (context) => {
252
54
 
253
55
  const styles = ":host([disabled]){cursor:not-allowed}.base{--_connotation-color-primary: var(--vvd-option-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-option-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-option-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-firm: var(--vvd-option-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-faint: var(--vvd-option-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-option-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-pale: var(--vvd-option-accent-pale, var(--vvd-color-neutral-300));--_connotation-color-dim: var(--vvd-option-accent-dim, var(--vvd-color-neutral-200))}.base{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.base:where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.active,:active):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.base:where(.selected):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.base:where(.selected):where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.base{display:flex;box-sizing:border-box;align-items:center;border-radius:8px;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--_option-appearance-color-text, var(--_appearance-color-text));font:var(--vvd-typography-base);gap:var(--_option-gap);hyphens:auto;inline-size:100%;min-block-size:var(--_option-min-block-size);padding-inline:var(--_option-padding-inline);vertical-align:middle;word-break:break-word}.base{--_option-min-block-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;--_option-padding-inline: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))*.4) ;--_option-gap: calc( calc(1px*(36 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) / 3);--_option-icon-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))/2) }@supports (user-select: none){.base{user-select:none}}.base:not(.disabled){cursor:pointer}.base.disabled{pointer-events:none}:host([scale=condensed]) .base{--_option-min-block-size: calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;--_option-padding-inline: calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))/2) ;--_option-gap: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))/5) ;--_option-icon-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))*.4) }:host([aria-checked=true]) .base{--focus-stroke-color: var(--vvd-color-neutral-500);--focus-stroke-gap-color: transparent;box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px))}.text{font:var(--vvd-typography-base)}.match{color:var(--vvd-color-cta-600);font:var(--vvd-typography-base-bold)}slot[name=icon]{font-size:var(--_option-icon-size);line-height:1}.base:not(.disabled,.selected) slot[name=icon]{color:var(--vvd-color-neutral-600)}.checkmark{margin-left:auto;font-size:var(--_option-icon-size)}";
254
56
 
255
- const listboxOptionDefinition = defineVividComponent.defineVividComponent(
57
+ const listboxOptionDefinition = vividElement.defineVividComponent(
256
58
  "option",
257
- ListboxOption,
59
+ option.ListboxOption,
258
60
  ListboxOptionTemplate,
259
61
  [definition.iconDefinition],
260
62
  {
261
63
  styles
262
64
  }
263
65
  );
264
- const registerOption = defineVividComponent.createRegisterFunction(listboxOptionDefinition);
66
+ const registerOption = vividElement.createRegisterFunction(listboxOptionDefinition);
265
67
 
266
- exports.ListboxOption = ListboxOption;
267
- exports.isListboxOption = isListboxOption;
268
68
  exports.listboxOptionDefinition = listboxOptionDefinition;
269
69
  exports.registerOption = registerOption;
@@ -1,208 +1,10 @@
1
1
  import { I as Icon, i as iconDefinition } from './definition27.js';
2
- import { O as Observable, o as observable, a as attr, h as html, d as defineVividComponent, f as createRegisterFunction } from './defineVividComponent.js';
3
- import { a as applyMixins } from './apply-mixins.js';
4
- import { b as AffixIconWithTrailing, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
5
- import { A as ARIAGlobalStatesAndProperties } from './aria-global.js';
6
- import { V as VividElement } from './vivid-element.js';
7
- import { i as isHTMLElement } from './dom.js';
2
+ import { h as html, d as defineVividComponent, f as createRegisterFunction } from './vivid-element.js';
3
+ import { L as ListboxOption } from './option.js';
4
+ import { a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
8
5
  import { w as when } from './when.js';
9
6
  import { c as classNames } from './class-names.js';
10
7
 
11
- var __defProp = Object.defineProperty;
12
- var __decorateClass = (decorators, target, key, kind) => {
13
- var result = void 0 ;
14
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
15
- if (decorator = decorators[i])
16
- result = (decorator(target, key, result) ) || result;
17
- if (result) __defProp(target, key, result);
18
- return result;
19
- };
20
- function isListboxOption(el) {
21
- return isHTMLElement(el) && (el.getAttribute("role") === "option" || el instanceof HTMLOptionElement);
22
- }
23
- class ListboxOption extends VividElement {
24
- constructor(text, value, defaultSelected, selected) {
25
- super();
26
- this.defaultSelected = false;
27
- /**
28
- * Tracks whether the "selected" property has been changed.
29
- * @internal
30
- */
31
- this.dirtySelected = false;
32
- this.selected = this.defaultSelected;
33
- /**
34
- * Track whether the value has been changed from the initial value
35
- */
36
- this.dirtyValue = false;
37
- this._highlighted = false;
38
- this._displayCheckmark = false;
39
- this._matchedRange = null;
40
- if (text) {
41
- this.text = text;
42
- }
43
- if (value) {
44
- this.initialValue = value;
45
- }
46
- if (defaultSelected) {
47
- this.defaultSelected = defaultSelected;
48
- }
49
- if (selected) {
50
- this.selected = selected;
51
- }
52
- this.proxy = new Option(
53
- this.text,
54
- // @ts-expect-error Propery is used before it is assigned
55
- this.initialValue,
56
- this.defaultSelected,
57
- this.selected
58
- );
59
- this.proxy.disabled = this.disabled;
60
- }
61
- /**
62
- * Updates the ariaChecked property when the checked property changes.
63
- *
64
- * @param _ - the previous checked value
65
- * @param next - the current checked value
66
- *
67
- * @public
68
- */
69
- checkedChanged(_, next) {
70
- if (typeof next === "boolean") {
71
- this.ariaChecked = next ? "true" : "false";
72
- return;
73
- }
74
- this.ariaChecked = null;
75
- }
76
- defaultSelectedChanged() {
77
- if (!this.dirtySelected) {
78
- this.selected = this.defaultSelected;
79
- if (this.proxy instanceof HTMLOptionElement) {
80
- this.proxy.selected = this.defaultSelected;
81
- }
82
- }
83
- }
84
- disabledChanged() {
85
- this.ariaDisabled = this.disabled ? "true" : "false";
86
- if (this.proxy instanceof HTMLOptionElement) {
87
- this.proxy.disabled = this.disabled;
88
- }
89
- }
90
- selectedAttributeChanged() {
91
- this.defaultSelected = this.selectedAttribute;
92
- if (this.proxy instanceof HTMLOptionElement) {
93
- this.proxy.defaultSelected = this.defaultSelected;
94
- }
95
- }
96
- selectedChanged() {
97
- this.ariaSelected = this.selected ? "true" : "false";
98
- if (!this.dirtySelected) {
99
- this.dirtySelected = true;
100
- }
101
- if (this.proxy instanceof HTMLOptionElement) {
102
- this.proxy.selected = this.selected;
103
- }
104
- }
105
- initialValueChanged() {
106
- if (!this.dirtyValue) {
107
- this.value = this.initialValue;
108
- this.dirtyValue = false;
109
- }
110
- }
111
- get label() {
112
- return this._label ?? this.text;
113
- }
114
- set label(value) {
115
- this._label = value;
116
- }
117
- set text(value) {
118
- this._text = value;
119
- }
120
- get text() {
121
- return this._text ?? "";
122
- }
123
- set value(next) {
124
- const newValue = `${next ?? ""}`;
125
- this._value = newValue;
126
- this.dirtyValue = true;
127
- if (this.proxy instanceof HTMLOptionElement) {
128
- this.proxy.value = newValue;
129
- }
130
- Observable.notify(this, "value");
131
- }
132
- get value() {
133
- Observable.track(this, "value");
134
- return this._value ?? this.text;
135
- }
136
- get form() {
137
- return null;
138
- }
139
- /**
140
- * @internal
141
- */
142
- get _matchedRangeSafe() {
143
- return this._matchedRange ?? { from: 0, to: 0 };
144
- }
145
- }
146
- __decorateClass([
147
- observable
148
- ], ListboxOption.prototype, "checked");
149
- __decorateClass([
150
- observable
151
- ], ListboxOption.prototype, "defaultSelected");
152
- // @ts-expect-error Type is incorrectly non-optional
153
- __decorateClass([
154
- attr({ mode: "boolean" })
155
- ], ListboxOption.prototype, "disabled");
156
- // @ts-expect-error Type is incorrectly non-optional
157
- __decorateClass([
158
- attr({ attribute: "selected", mode: "boolean" })
159
- ], ListboxOption.prototype, "selectedAttribute");
160
- __decorateClass([
161
- observable
162
- ], ListboxOption.prototype, "selected");
163
- __decorateClass([
164
- attr({ attribute: "value", mode: "fromView" })
165
- ], ListboxOption.prototype, "initialValue");
166
- __decorateClass([
167
- attr({
168
- attribute: "label"
169
- })
170
- ], ListboxOption.prototype, "_label");
171
- __decorateClass([
172
- attr({
173
- attribute: "text"
174
- })
175
- ], ListboxOption.prototype, "_text");
176
- __decorateClass([
177
- observable
178
- ], ListboxOption.prototype, "_highlighted");
179
- __decorateClass([
180
- observable
181
- ], ListboxOption.prototype, "_displayCheckmark");
182
- __decorateClass([
183
- observable
184
- ], ListboxOption.prototype, "_matchedRange");
185
- class DelegatesARIAListboxOption {
186
- }
187
- // @ts-expect-error Type is incorrectly non-optional
188
- __decorateClass([
189
- observable
190
- ], DelegatesARIAListboxOption.prototype, "ariaChecked");
191
- // @ts-expect-error Type is incorrectly non-optional
192
- __decorateClass([
193
- observable
194
- ], DelegatesARIAListboxOption.prototype, "ariaPosInSet");
195
- // @ts-expect-error Type is incorrectly non-optional
196
- __decorateClass([
197
- observable
198
- ], DelegatesARIAListboxOption.prototype, "ariaSelected");
199
- // @ts-expect-error Type is incorrectly non-optional
200
- __decorateClass([
201
- observable
202
- ], DelegatesARIAListboxOption.prototype, "ariaSetSize");
203
- applyMixins(DelegatesARIAListboxOption, ARIAGlobalStatesAndProperties);
204
- applyMixins(ListboxOption, AffixIconWithTrailing, DelegatesARIAListboxOption);
205
-
206
8
  const getClasses = (x) => classNames(
207
9
  "base",
208
10
  ["disabled", x.disabled],
@@ -261,4 +63,4 @@ const listboxOptionDefinition = defineVividComponent(
261
63
  );
262
64
  const registerOption = createRegisterFunction(listboxOptionDefinition);
263
65
 
264
- export { ListboxOption as L, isListboxOption as i, listboxOptionDefinition as l, registerOption as r };
66
+ export { listboxOptionDefinition as l, registerOption as r };
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  const definition = require('./definition11.cjs');
4
- const defineVividComponent = require('./defineVividComponent.cjs');
5
4
  const vividElement = require('./vivid-element.cjs');
6
5
  const enums = require('./enums.cjs');
7
6
  const slotted = require('./slotted.cjs');
@@ -94,31 +93,31 @@ class Pagination extends vividElement.VividElement {
94
93
  }
95
94
  }
96
95
  __decorateClass([
97
- defineVividComponent.attr
96
+ vividElement.attr
98
97
  ], Pagination.prototype, "size", 2);
99
98
  __decorateClass([
100
- defineVividComponent.attr
99
+ vividElement.attr
101
100
  ], Pagination.prototype, "shape", 2);
102
101
  __decorateClass([
103
- defineVividComponent.observable
102
+ vividElement.observable
104
103
  ], Pagination.prototype, "paginationButtons", 2);
105
104
  __decorateClass([
106
- defineVividComponent.observable
105
+ vividElement.observable
107
106
  ], Pagination.prototype, "prevButton", 2);
108
107
  __decorateClass([
109
- defineVividComponent.observable
108
+ vividElement.observable
110
109
  ], Pagination.prototype, "nextButton", 2);
111
110
  __decorateClass([
112
- defineVividComponent.attr({ attribute: "nav-icons", mode: "boolean" })
111
+ vividElement.attr({ attribute: "nav-icons", mode: "boolean" })
113
112
  ], Pagination.prototype, "navIcons", 2);
114
113
  __decorateClass([
115
- defineVividComponent.volatile
114
+ vividElement.volatile
116
115
  ], Pagination.prototype, "pagesList", 1);
117
116
  __decorateClass([
118
- defineVividComponent.attr({ mode: "reflect", converter: totalConverter })
117
+ vividElement.attr({ mode: "reflect", converter: totalConverter })
119
118
  ], Pagination.prototype, "total", 2);
120
119
  __decorateClass([
121
- defineVividComponent.attr({
120
+ vividElement.attr({
122
121
  mode: "reflect",
123
122
  converter: totalConverter,
124
123
  attribute: "selected-index"
@@ -148,9 +147,9 @@ const getClasses = (_) => classNames.classNames("control");
148
147
  function getButtonAppearance(value, { parent }) {
149
148
  return parent.selectedIndex === Number(value) - 1 ? "filled" : "ghost";
150
149
  }
151
- const paginationButtonRenderer = (buttonTag) => defineVividComponent.html` ${when.when(
150
+ const paginationButtonRenderer = (buttonTag) => vividElement.html` ${when.when(
152
151
  (value) => value !== "...",
153
- defineVividComponent.html`
152
+ vividElement.html`
154
153
  <${buttonTag} class="vwc-pagination-button"
155
154
  label="${(value) => value}"
156
155
  appearance="${getButtonAppearance}"
@@ -166,7 +165,7 @@ const paginationButtonRenderer = (buttonTag) => defineVividComponent.html` ${whe
166
165
  )}
167
166
  ${when.when(
168
167
  (value) => value === "...",
169
- defineVividComponent.html` <div class="dots size-${(_, { parent: x }) => getPaginationSize(x)}">
168
+ vividElement.html` <div class="dots size-${(_, { parent: x }) => getPaginationSize(x)}">
170
169
  ...
171
170
  </div>`
172
171
  )}`;
@@ -188,7 +187,7 @@ const getPaginationButtonWidth = (value) => {
188
187
  const PaginationTemplate = (context) => {
189
188
  const buttonTag = context.tagFor(definition.Button);
190
189
  const paginationButtonTemplate = paginationButtonRenderer(buttonTag);
191
- return defineVividComponent.html`
190
+ return vividElement.html`
192
191
  <div class="${getClasses}">
193
192
  <${buttonTag} class="prev-button" ${ref.ref("prevButton")}
194
193
  label="${(x) => !x.navIcons ? "Previous" : null}"
@@ -215,7 +214,7 @@ const PaginationTemplate = (context) => {
215
214
  </div>`;
216
215
  };
217
216
 
218
- const paginationDefinition = defineVividComponent.defineVividComponent(
217
+ const paginationDefinition = vividElement.defineVividComponent(
219
218
  "pagination",
220
219
  Pagination,
221
220
  PaginationTemplate,
@@ -224,7 +223,7 @@ const paginationDefinition = defineVividComponent.defineVividComponent(
224
223
  styles
225
224
  }
226
225
  );
227
- const registerPagination = defineVividComponent.createRegisterFunction(paginationDefinition);
226
+ const registerPagination = vividElement.createRegisterFunction(paginationDefinition);
228
227
 
229
228
  exports.paginationDefinition = paginationDefinition;
230
229
  exports.registerPagination = registerPagination;
@@ -1,6 +1,5 @@
1
1
  import { B as Button, b as buttonDefinition } from './definition11.js';
2
- import { a as attr, o as observable, v as volatile, h as html, d as defineVividComponent, f as createRegisterFunction } from './defineVividComponent.js';
3
- import { V as VividElement } from './vivid-element.js';
2
+ import { V as VividElement, a as attr, o as observable, v as volatile, h as html, d as defineVividComponent, f as createRegisterFunction } from './vivid-element.js';
4
3
  import { b as Size, S as Shape } from './enums.js';
5
4
  import { e as elements } from './slotted.js';
6
5
  import { r as ref } from './ref.js';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const defineVividComponent = require('./defineVividComponent.cjs');
3
+ const vividElement = require('./vivid-element.cjs');
4
4
  const baseProgress = require('./base-progress.cjs');
5
5
  const when = require('./when.cjs');
6
6
  const classNames = require('./class-names.cjs');
@@ -23,13 +23,13 @@ class ProgressRing extends baseProgress.BaseProgress {
23
23
  }
24
24
  }
25
25
  __decorateClass([
26
- defineVividComponent.attr({ attribute: "aria-label" })
26
+ vividElement.attr({ attribute: "aria-label" })
27
27
  ], ProgressRing.prototype, "ariaLabel");
28
28
  __decorateClass([
29
- defineVividComponent.attr
29
+ vividElement.attr
30
30
  ], ProgressRing.prototype, "connotation");
31
31
  __decorateClass([
32
- defineVividComponent.attr
32
+ vividElement.attr
33
33
  ], ProgressRing.prototype, "size");
34
34
 
35
35
  const getClasses = ({ connotation, size, paused }) => classNames.classNames(
@@ -39,7 +39,7 @@ const getClasses = ({ connotation, size, paused }) => classNames.classNames(
39
39
  [`size-${size}`, !!size]
40
40
  );
41
41
  const progressSegments = 44;
42
- const ProgressRingTemplate = defineVividComponent.html`<template
42
+ const ProgressRingTemplate = vividElement.html`<template
43
43
  role="${(x) => x.ariaLabel ? "presentation" : null}"
44
44
  >
45
45
  <div
@@ -52,7 +52,7 @@ const ProgressRingTemplate = defineVividComponent.html`<template
52
52
  >
53
53
  ${when.when(
54
54
  (x) => typeof x.value === "number",
55
- defineVividComponent.html`
55
+ vividElement.html`
56
56
  <svg class="progress" viewBox="0 0 16 16">
57
57
  <circle class="background" cx="8px" cy="8px" r="7px"></circle>
58
58
  <circle
@@ -67,7 +67,7 @@ const ProgressRingTemplate = defineVividComponent.html`<template
67
67
  )}
68
68
  ${when.when(
69
69
  (x) => typeof x.value !== "number",
70
- defineVividComponent.html`
70
+ vividElement.html`
71
71
  <svg class="progress" viewBox="0 0 16 16">
72
72
  <circle class="background" cx="8px" cy="8px" r="7px"></circle>
73
73
  <circle
@@ -82,7 +82,7 @@ const ProgressRingTemplate = defineVividComponent.html`<template
82
82
  </div>
83
83
  </template>`;
84
84
 
85
- const progressRingDefinition = defineVividComponent.defineVividComponent(
85
+ const progressRingDefinition = vividElement.defineVividComponent(
86
86
  "progress-ring",
87
87
  ProgressRing,
88
88
  ProgressRingTemplate,
@@ -91,7 +91,7 @@ const progressRingDefinition = defineVividComponent.defineVividComponent(
91
91
  styles
92
92
  }
93
93
  );
94
- const registerProgressRing = defineVividComponent.createRegisterFunction(
94
+ const registerProgressRing = vividElement.createRegisterFunction(
95
95
  progressRingDefinition
96
96
  );
97
97
 
@@ -1,4 +1,4 @@
1
- import { a as attr, h as html, d as defineVividComponent, f as createRegisterFunction } from './defineVividComponent.js';
1
+ import { a as attr, h as html, d as defineVividComponent, f as createRegisterFunction } from './vivid-element.js';
2
2
  import { B as BaseProgress } from './base-progress.js';
3
3
  import { w as when } from './when.js';
4
4
  import { c as classNames } from './class-names.js';