@vonage/vivid 3.0.0-next.9 → 3.0.0-next.91

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 (190) hide show
  1. package/README.md +141 -4
  2. package/accordion/index.js +3 -12
  3. package/accordion-item/index.js +30 -38
  4. package/action-group/index.js +41 -0
  5. package/avatar/index.js +60 -0
  6. package/badge/index.js +16 -30
  7. package/banner/index.js +25 -111
  8. package/breadcrumb/index.js +21 -18
  9. package/breadcrumb-item/index.js +23 -20
  10. package/button/index.js +19 -757
  11. package/calendar/index.js +72 -67
  12. package/calendar-event/index.js +112 -0
  13. package/card/index.js +113 -0
  14. package/checkbox/index.js +176 -0
  15. package/dialog/index.js +229 -0
  16. package/divider/index.js +4 -0
  17. package/elevation/index.js +3 -31
  18. package/fab/index.js +99 -0
  19. package/focus/index.js +18 -3
  20. package/header/index.js +61 -0
  21. package/icon/index.js +10 -9
  22. package/index.js +57 -20
  23. package/layout/index.js +5 -15
  24. package/lib/accordion-item/accordion-item.d.ts +2 -2
  25. package/lib/accordion-item/index.d.ts +2 -1
  26. package/lib/action-group/action-group.d.ts +10 -0
  27. package/lib/{sidenav-item/sidenav-item.template.d.ts → action-group/action-group.template.d.ts} +2 -2
  28. package/lib/{sidenav-item → action-group}/index.d.ts +1 -2
  29. package/lib/avatar/avatar.d.ts +15 -0
  30. package/lib/avatar/avatar.template.d.ts +4 -0
  31. package/lib/avatar/index.d.ts +3 -0
  32. package/lib/badge/badge.d.ts +3 -5
  33. package/lib/badge/index.d.ts +1 -1
  34. package/lib/banner/banner.d.ts +1 -1
  35. package/lib/banner/banner.template.d.ts +0 -2
  36. package/lib/banner/index.d.ts +1 -0
  37. package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
  38. package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  39. package/lib/breadcrumb-item/index.d.ts +1 -0
  40. package/lib/button/button.d.ts +6 -5
  41. package/lib/button/index.d.ts +2 -19
  42. package/lib/calendar/calendar.d.ts +3 -1
  43. package/lib/calendar/index.d.ts +0 -1
  44. package/lib/calendar-event/calendar-event.d.ts +14 -0
  45. package/lib/calendar-event/calendar-event.template.d.ts +4 -0
  46. package/lib/calendar-event/index.d.ts +2 -0
  47. package/lib/card/card.d.ts +10 -0
  48. package/lib/{text/text.template.d.ts → card/card.template.d.ts} +2 -2
  49. package/lib/card/index.d.ts +4 -0
  50. package/lib/checkbox/checkbox.d.ts +5 -0
  51. package/lib/checkbox/checkbox.template.d.ts +4 -0
  52. package/lib/checkbox/index.d.ts +4 -0
  53. package/lib/components.d.ts +29 -10
  54. package/lib/dialog/dialog.d.ts +20 -0
  55. package/lib/dialog/dialog.template.d.ts +4 -0
  56. package/lib/dialog/index.d.ts +5 -0
  57. package/lib/divider/divider.d.ts +3 -0
  58. package/lib/divider/divider.template.d.ts +4 -0
  59. package/lib/divider/index.d.ts +2 -0
  60. package/lib/elevation/elevation.d.ts +1 -0
  61. package/lib/elevation/index.d.ts +1 -1
  62. package/lib/enums.d.ts +11 -6
  63. package/lib/fab/fab.d.ts +13 -0
  64. package/lib/fab/fab.template.d.ts +4 -0
  65. package/lib/fab/index.d.ts +4 -0
  66. package/lib/focus/index.d.ts +1 -1
  67. package/lib/header/header.d.ts +5 -0
  68. package/lib/header/header.template.d.ts +4 -0
  69. package/lib/header/index.d.ts +3 -0
  70. package/lib/icon/icon.d.ts +4 -3
  71. package/lib/layout/index.d.ts +1 -1
  72. package/lib/layout/layout.d.ts +3 -3
  73. package/lib/listbox-option/index.d.ts +4 -0
  74. package/lib/listbox-option/listbox-option.d.ts +7 -0
  75. package/lib/listbox-option/listbox-option.template.d.ts +4 -0
  76. package/lib/menu/index.d.ts +12 -0
  77. package/lib/menu/menu.d.ts +10 -0
  78. package/lib/menu/menu.template.d.ts +3 -0
  79. package/lib/menu-item/index.d.ts +3 -0
  80. package/lib/menu-item/menu-item.d.ts +7 -0
  81. package/lib/menu-item/menu-item.template.d.ts +5 -0
  82. package/lib/nav/index.d.ts +2 -0
  83. package/lib/nav/nav.d.ts +3 -0
  84. package/lib/nav/nav.template.d.ts +4 -0
  85. package/lib/nav-disclosure/index.d.ts +4 -0
  86. package/lib/nav-disclosure/nav-disclosure.d.ts +10 -0
  87. package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -0
  88. package/lib/nav-item/index.d.ts +4 -0
  89. package/lib/{sidenav-item/sidenav-item.d.ts → nav-item/nav-item.d.ts} +2 -2
  90. package/lib/nav-item/nav-item.template.d.ts +4 -0
  91. package/lib/{text → note}/index.d.ts +1 -1
  92. package/lib/note/note.d.ts +10 -0
  93. package/lib/note/note.template.d.ts +5 -0
  94. package/lib/number-field/index.d.ts +4 -0
  95. package/lib/number-field/number-field.d.ts +14 -0
  96. package/lib/number-field/number-field.template.d.ts +4 -0
  97. package/lib/popup/index.d.ts +1 -1
  98. package/lib/popup/popup.d.ts +2 -1
  99. package/lib/progress/progress.d.ts +1 -1
  100. package/lib/progress-ring/progress-ring.d.ts +2 -1
  101. package/lib/radio/index.d.ts +3 -0
  102. package/lib/radio/radio.d.ts +4 -0
  103. package/lib/radio/radio.template.d.ts +4 -0
  104. package/lib/radio-group/index.d.ts +10 -0
  105. package/lib/radio-group/radio-group.d.ts +4 -0
  106. package/lib/radio-group/radio-group.template.d.ts +4 -0
  107. package/lib/side-drawer/index.d.ts +1 -1
  108. package/lib/side-drawer/side-drawer.d.ts +3 -2
  109. package/lib/text-anchor/text-anchor.d.ts +1 -1
  110. package/lib/text-area/index.d.ts +4 -0
  111. package/lib/text-area/text-area.d.ts +9 -0
  112. package/lib/text-area/text-area.template.d.ts +4 -0
  113. package/lib/text-field/index.d.ts +4 -0
  114. package/lib/text-field/text-field.d.ts +14 -0
  115. package/lib/text-field/text-field.template.d.ts +5 -0
  116. package/lib/tooltip/tooltip.d.ts +2 -2
  117. package/listbox-option/index.js +248 -0
  118. package/menu/index.js +376 -0
  119. package/menu-item/index.js +20 -0
  120. package/nav/index.js +17 -0
  121. package/nav-disclosure/index.js +81 -0
  122. package/nav-item/index.js +45 -0
  123. package/note/index.js +58 -0
  124. package/number-field/index.js +516 -0
  125. package/package.json +58 -10
  126. package/popup/index.js +22 -2061
  127. package/progress/index.js +35 -36
  128. package/progress-ring/index.js +11 -11
  129. package/radio/index.js +50 -0
  130. package/radio-group/index.js +435 -0
  131. package/shared/affix.js +1 -6
  132. package/shared/anchor.js +10 -2
  133. package/shared/apply-mixins.js +5 -4
  134. package/shared/aria-global.js +2 -86
  135. package/shared/aria.js +9 -0
  136. package/shared/base-progress.js +5 -0
  137. package/shared/breadcrumb-item.js +1 -1
  138. package/shared/button.js +200 -0
  139. package/shared/calendar-event.js +19 -0
  140. package/shared/dialog-polyfill.esm.js +858 -0
  141. package/shared/direction.js +20 -0
  142. package/shared/enums.js +62 -0
  143. package/shared/es.object.assign.js +3 -2
  144. package/shared/export.js +1017 -0
  145. package/shared/focus.js +5 -0
  146. package/shared/focus2.js +11 -0
  147. package/shared/form-associated.js +466 -0
  148. package/shared/form-elements.js +331 -0
  149. package/shared/icon.js +534 -531
  150. package/shared/index.js +108 -79
  151. package/shared/index2.js +100 -14
  152. package/shared/index3.js +31 -0
  153. package/shared/index4.js +77 -0
  154. package/shared/index5.js +1525 -0
  155. package/shared/index6.js +349 -0
  156. package/shared/iterators.js +61 -0
  157. package/shared/key-codes.js +96 -0
  158. package/shared/object-keys.js +13 -0
  159. package/shared/patterns/focus.d.ts +3 -0
  160. package/shared/patterns/form-elements/form-elements.d.ts +28 -0
  161. package/shared/patterns/form-elements/index.d.ts +1 -0
  162. package/shared/patterns/index.d.ts +2 -0
  163. package/shared/radio.js +127 -0
  164. package/shared/ref.js +41 -0
  165. package/shared/slotted.js +1 -1
  166. package/shared/start-end.js +50 -0
  167. package/shared/text-anchor.js +2 -13
  168. package/shared/text-anchor.template.js +6 -5
  169. package/shared/to-string.js +51 -0
  170. package/shared/web.dom-collections.iterator.js +74 -1081
  171. package/side-drawer/index.js +41 -33
  172. package/styles/core/all.css +75 -0
  173. package/styles/core/theme.css +11 -0
  174. package/styles/core/typography.css +69 -0
  175. package/styles/fonts/SpeziaCompleteVariableItalicWeb.woff2 +0 -0
  176. package/styles/fonts/SpeziaCompleteVariableUprightWeb.woff2 +0 -0
  177. package/styles/fonts/SpeziaMonoCompleteVariableWeb.woff2 +0 -0
  178. package/styles/fonts/spezia.css +9 -12
  179. package/styles/tokens/theme-dark.css +230 -0
  180. package/styles/tokens/theme-light.css +230 -0
  181. package/text-anchor/index.js +9 -1
  182. package/text-area/index.js +288 -0
  183. package/text-field/index.js +129 -0
  184. package/tooltip/index.js +23 -24
  185. package/lib/text/text.d.ts +0 -10
  186. package/shared/style-inject.es.js +0 -28
  187. package/sidenav-item/index.js +0 -38
  188. package/styles/themes/dark.css +0 -205
  189. package/styles/themes/light.css +0 -205
  190. package/text/index.js +0 -45
package/shared/index.js CHANGED
@@ -67,6 +67,27 @@ if (FAST.getById === void 0) {
67
67
  * @internal
68
68
  */
69
69
  const emptyArray = Object.freeze([]);
70
+ /**
71
+ * Creates a function capable of locating metadata associated with a type.
72
+ * @returns A metadata locator function.
73
+ * @internal
74
+ */
75
+ function createMetadataLocator() {
76
+ const metadataLookup = new WeakMap();
77
+ return function (target) {
78
+ let metadata = metadataLookup.get(target);
79
+ if (metadata === void 0) {
80
+ let currentTarget = Reflect.getPrototypeOf(target);
81
+ while (metadata === void 0 && currentTarget !== null) {
82
+ metadata = metadataLookup.get(currentTarget);
83
+ currentTarget = Reflect.getPrototypeOf(currentTarget);
84
+ }
85
+ metadata = metadata === void 0 ? [] : metadata.slice(0);
86
+ metadataLookup.set(target, metadata);
87
+ }
88
+ return metadata;
89
+ };
90
+ }
70
91
 
71
92
  const updateQueue = $global.FAST.getById(1 /* updateQueue */, () => {
72
93
  const tasks = [];
@@ -275,30 +296,6 @@ const DOM = Object.freeze({
275
296
  },
276
297
  });
277
298
 
278
- function spilloverSubscribe(subscriber) {
279
- const spillover = this.spillover;
280
- const index = spillover.indexOf(subscriber);
281
- if (index === -1) {
282
- spillover.push(subscriber);
283
- }
284
- }
285
- function spilloverUnsubscribe(subscriber) {
286
- const spillover = this.spillover;
287
- const index = spillover.indexOf(subscriber);
288
- if (index !== -1) {
289
- spillover.splice(index, 1);
290
- }
291
- }
292
- function spilloverNotifySubscribers(args) {
293
- const spillover = this.spillover;
294
- const source = this.source;
295
- for (let i = 0, ii = spillover.length; i < ii; ++i) {
296
- spillover[i].handleChange(source, args);
297
- }
298
- }
299
- function spilloverHas(subscriber) {
300
- return this.spillover.indexOf(subscriber) !== -1;
301
- }
302
299
  /**
303
300
  * An implementation of {@link Notifier} that efficiently keeps track of
304
301
  * subscribers interested in a specific change notification on an
@@ -328,42 +325,58 @@ class SubscriberSet {
328
325
  * @param subscriber - The subscriber to test for inclusion in this set.
329
326
  */
330
327
  has(subscriber) {
331
- return this.sub1 === subscriber || this.sub2 === subscriber;
328
+ return this.spillover === void 0
329
+ ? this.sub1 === subscriber || this.sub2 === subscriber
330
+ : this.spillover.indexOf(subscriber) !== -1;
332
331
  }
333
332
  /**
334
333
  * Subscribes to notification of changes in an object's state.
335
334
  * @param subscriber - The object that is subscribing for change notification.
336
335
  */
337
336
  subscribe(subscriber) {
338
- if (this.has(subscriber)) {
339
- return;
340
- }
341
- if (this.sub1 === void 0) {
342
- this.sub1 = subscriber;
343
- return;
337
+ const spillover = this.spillover;
338
+ if (spillover === void 0) {
339
+ if (this.has(subscriber)) {
340
+ return;
341
+ }
342
+ if (this.sub1 === void 0) {
343
+ this.sub1 = subscriber;
344
+ return;
345
+ }
346
+ if (this.sub2 === void 0) {
347
+ this.sub2 = subscriber;
348
+ return;
349
+ }
350
+ this.spillover = [this.sub1, this.sub2, subscriber];
351
+ this.sub1 = void 0;
352
+ this.sub2 = void 0;
344
353
  }
345
- if (this.sub2 === void 0) {
346
- this.sub2 = subscriber;
347
- return;
354
+ else {
355
+ const index = spillover.indexOf(subscriber);
356
+ if (index === -1) {
357
+ spillover.push(subscriber);
358
+ }
348
359
  }
349
- this.spillover = [this.sub1, this.sub2, subscriber];
350
- this.subscribe = spilloverSubscribe;
351
- this.unsubscribe = spilloverUnsubscribe;
352
- this.notify = spilloverNotifySubscribers;
353
- this.has = spilloverHas;
354
- this.sub1 = void 0;
355
- this.sub2 = void 0;
356
360
  }
357
361
  /**
358
362
  * Unsubscribes from notification of changes in an object's state.
359
363
  * @param subscriber - The object that is unsubscribing from change notification.
360
364
  */
361
365
  unsubscribe(subscriber) {
362
- if (this.sub1 === subscriber) {
363
- this.sub1 = void 0;
366
+ const spillover = this.spillover;
367
+ if (spillover === void 0) {
368
+ if (this.sub1 === subscriber) {
369
+ this.sub1 = void 0;
370
+ }
371
+ else if (this.sub2 === subscriber) {
372
+ this.sub2 = void 0;
373
+ }
364
374
  }
365
- else if (this.sub2 === subscriber) {
366
- this.sub2 = void 0;
375
+ else {
376
+ const index = spillover.indexOf(subscriber);
377
+ if (index !== -1) {
378
+ spillover.splice(index, 1);
379
+ }
367
380
  }
368
381
  }
369
382
  /**
@@ -371,14 +384,22 @@ class SubscriberSet {
371
384
  * @param args - Data passed along to subscribers during notification.
372
385
  */
373
386
  notify(args) {
374
- const sub1 = this.sub1;
375
- const sub2 = this.sub2;
387
+ const spillover = this.spillover;
376
388
  const source = this.source;
377
- if (sub1 !== void 0) {
378
- sub1.handleChange(source, args);
389
+ if (spillover === void 0) {
390
+ const sub1 = this.sub1;
391
+ const sub2 = this.sub2;
392
+ if (sub1 !== void 0) {
393
+ sub1.handleChange(source, args);
394
+ }
395
+ if (sub2 !== void 0) {
396
+ sub2.handleChange(source, args);
397
+ }
379
398
  }
380
- if (sub2 !== void 0) {
381
- sub2.handleChange(source, args);
399
+ else {
400
+ for (let i = 0, ii = spillover.length; i < ii; ++i) {
401
+ spillover[i].handleChange(source, args);
402
+ }
382
403
  }
383
404
  }
384
405
  }
@@ -424,7 +445,8 @@ class PropertyChangeNotifier {
424
445
  subscribers.subscribe(subscriber);
425
446
  }
426
447
  else {
427
- this.sourceSubscribers = (_a = this.sourceSubscribers) !== null && _a !== void 0 ? _a : new SubscriberSet(this.source);
448
+ this.sourceSubscribers =
449
+ (_a = this.sourceSubscribers) !== null && _a !== void 0 ? _a : new SubscriberSet(this.source);
428
450
  this.sourceSubscribers.subscribe(subscriber);
429
451
  }
430
452
  }
@@ -454,7 +476,6 @@ class PropertyChangeNotifier {
454
476
  const Observable = FAST.getById(2 /* observable */, () => {
455
477
  const volatileRegex = /(:|&&|\|\||if)/;
456
478
  const notifierLookup = new WeakMap();
457
- const accessorLookup = new WeakMap();
458
479
  const queueUpdate = DOM.queueUpdate;
459
480
  let watcher = void 0;
460
481
  let createArrayObserver = (array) => {
@@ -472,24 +493,7 @@ const Observable = FAST.getById(2 /* observable */, () => {
472
493
  }
473
494
  return found;
474
495
  }
475
- function getAccessors(target) {
476
- let accessors = accessorLookup.get(target);
477
- if (accessors === void 0) {
478
- let currentTarget = Reflect.getPrototypeOf(target);
479
- while (accessors === void 0 && currentTarget !== null) {
480
- accessors = accessorLookup.get(currentTarget);
481
- currentTarget = Reflect.getPrototypeOf(currentTarget);
482
- }
483
- if (accessors === void 0) {
484
- accessors = [];
485
- }
486
- else {
487
- accessors = accessors.slice(0);
488
- }
489
- accessorLookup.set(target, accessors);
490
- }
491
- return accessors;
492
- }
496
+ const getAccessors = createMetadataLocator();
493
497
  class DefaultObservableAccessor {
494
498
  constructor(name) {
495
499
  this.name = name;
@@ -568,6 +572,7 @@ const Observable = FAST.getById(2 /* observable */, () => {
568
572
  watcher = void 0;
569
573
  /* eslint-disable-next-line */
570
574
  prevValue = prev.propertySource[prev.propertyName];
575
+ /* eslint-disable-next-line @typescript-eslint/no-this-alias */
571
576
  watcher = this;
572
577
  if (propertySource === prevValue) {
573
578
  this.needsRefresh = true;
@@ -707,6 +712,21 @@ const Observable = FAST.getById(2 /* observable */, () => {
707
712
  function observable(target, nameOrAccessor) {
708
713
  Observable.defineProperty(target, nameOrAccessor);
709
714
  }
715
+ /**
716
+ * Decorator: Marks a property getter as having volatile observable dependencies.
717
+ * @param target - The target that the property is defined on.
718
+ * @param name - The property name.
719
+ * @param name - The existing descriptor.
720
+ * @public
721
+ */
722
+ function volatile(target, name, descriptor) {
723
+ return Object.assign({}, descriptor, {
724
+ get: function () {
725
+ Observable.trackVolatile();
726
+ return descriptor.get.apply(this);
727
+ },
728
+ });
729
+ }
710
730
  const contextEvent = FAST.getById(3 /* contextEvent */, () => {
711
731
  let current = null;
712
732
  return {
@@ -1128,6 +1148,7 @@ class CompilationContext {
1128
1148
  this.targetIndex = -1;
1129
1149
  }
1130
1150
  release() {
1151
+ /* eslint-disable-next-line @typescript-eslint/no-this-alias */
1131
1152
  sharedContext = this;
1132
1153
  }
1133
1154
  static borrow(directives) {
@@ -1340,8 +1361,10 @@ class HTMLView {
1340
1361
  node.parentNode.insertBefore(this.fragment, node);
1341
1362
  }
1342
1363
  else {
1343
- const parentNode = node.parentNode;
1344
1364
  const end = this.lastChild;
1365
+ if (node.previousSibling === end)
1366
+ return;
1367
+ const parentNode = node.parentNode;
1345
1368
  let current = this.firstChild;
1346
1369
  let next;
1347
1370
  while (current !== end) {
@@ -1606,8 +1629,6 @@ function html(strings, ...values) {
1606
1629
  class ElementStyles {
1607
1630
  constructor() {
1608
1631
  this.targets = new WeakSet();
1609
- /** @internal */
1610
- this.behaviors = null;
1611
1632
  }
1612
1633
  /** @internal */
1613
1634
  addStylesTo(target) {
@@ -1749,6 +1770,16 @@ class StyleElementStyles extends ElementStyles {
1749
1770
  }
1750
1771
  }
1751
1772
 
1773
+ /**
1774
+ * Metadata used to configure a custom attribute's behavior.
1775
+ * @public
1776
+ */
1777
+ const AttributeConfiguration = Object.freeze({
1778
+ /**
1779
+ * Locates all attribute configurations associated with a type.
1780
+ */
1781
+ locate: createMetadataLocator(),
1782
+ });
1752
1783
  /**
1753
1784
  * A {@link ValueConverter} that converts to and from `boolean` values.
1754
1785
  * @remarks
@@ -1889,7 +1920,7 @@ class AttributeDefinition {
1889
1920
  */
1890
1921
  static collect(Owner, ...attributeLists) {
1891
1922
  const attributes = [];
1892
- attributeLists.push(Owner.attributes);
1923
+ attributeLists.push(AttributeConfiguration.locate(Owner));
1893
1924
  for (let i = 0, ii = attributeLists.length; i < ii; ++i) {
1894
1925
  const list = attributeLists[i];
1895
1926
  if (list === void 0) {
@@ -1919,9 +1950,7 @@ function attr(configOrTarget, prop) {
1919
1950
  // - @attr({...opts})
1920
1951
  config.property = $prop;
1921
1952
  }
1922
- const attributes = $target.constructor.attributes ||
1923
- ($target.constructor.attributes = []);
1924
- attributes.push(config);
1953
+ AttributeConfiguration.locate($target.constructor).push(config);
1925
1954
  }
1926
1955
  if (arguments.length > 1) {
1927
1956
  // Non invocation:
@@ -4995,4 +5024,4 @@ function provideVividDesignSystem(element) {
4995
5024
  }
4996
5025
  const designSystem = provideVividDesignSystem();
4997
5026
 
4998
- export { AttachedBehaviorHTMLDirective as A, DOM as D, FoundationElement as F, HTMLDirective as H, Observable as O, SubscriberSet as S, __decorate as _, attr as a, __metadata as b, __classPrivateFieldGet as c, designSystem as d, emptyArray as e, HTMLView as f, __classPrivateFieldSet as g, html as h, nullableNumberConverter as n, observable as o, provideVividDesignSystem as p };
5027
+ export { AttributeConfiguration as A, DOM as D, FoundationElement as F, HTMLDirective as H, Observable as O, SubscriberSet as S, __decorate as _, attr as a, __metadata as b, __classPrivateFieldGet as c, designSystem as d, AttachedBehaviorHTMLDirective as e, booleanConverter as f, emptyArray as g, html as h, HTMLView as i, __classPrivateFieldSet as j, nullableNumberConverter as n, observable as o, provideVividDesignSystem as p, volatile as v };
package/shared/index2.js CHANGED
@@ -1,21 +1,107 @@
1
- import { F as FoundationElement, h as html, d as designSystem } from './index.js';
2
- import { s as styleInject } from './style-inject.es.js';
1
+ import '../icon/index.js';
2
+ import '../focus/index.js';
3
+ import { _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from './index.js';
4
+ import './web.dom-collections.iterator.js';
5
+ import { A as AffixIconWithTrailing, a as affixIconTemplateFactory } from './affix.js';
6
+ import { B as Button$1 } from './button.js';
7
+ import { a as applyMixins } from './apply-mixins.js';
8
+ import { f as focusTemplateFactory } from './focus2.js';
9
+ import { r as ref } from './ref.js';
10
+ import { c as classNames } from './class-names.js';
3
11
 
4
- class Focus extends FoundationElement {}
12
+ class Button extends Button$1 {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.stacked = false;
16
+ }
17
+ }
18
+ __decorate([attr, __metadata("design:type", String)], Button.prototype, "connotation", void 0);
19
+ __decorate([attr, __metadata("design:type", String)], Button.prototype, "shape", void 0);
20
+ __decorate([attr, __metadata("design:type", String)], Button.prototype, "appearance", void 0);
21
+ __decorate([attr, __metadata("design:type", String)], Button.prototype, "density", void 0);
22
+ __decorate([attr({
23
+ mode: 'boolean',
24
+ attribute: 'stacked'
25
+ }), __metadata("design:type", Object)], Button.prototype, "stacked", void 0);
26
+ __decorate([attr, __metadata("design:type", String)], Button.prototype, "label", void 0);
27
+ applyMixins(Button, AffixIconWithTrailing);
5
28
 
6
- var css_248z = ":host {\n display: contents;\n border-radius: inherit;\n}\n\n.control {\n position: absolute;\n box-sizing: border-box;\n border-radius: inherit;\n box-shadow: inset 0 0 0 2px var(--focus-stroke-color, var(--vvd-color-on-canvas)), inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);\n inset: 0;\n}";
7
- styleInject(css_248z);
29
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 03 Nov 2022 17:26:06 GMT\n */\n:host {\n display: inline-block;\n}\n\n.control {\n position: relative;\n display: inline-flex;\n box-sizing: border-box;\n align-items: center;\n border: 0 none;\n margin: 0;\n background-color: var(--_appearance-color-fill);\n block-size: var(--_button-block-size);\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n gap: var(--_button-icon-gap);\n vertical-align: middle;\n white-space: nowrap;\n /* Size */\n}\n.control.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary-increment: var(--vvd-color-cta-600);\n --_connotation-color-contrast: var(--vvd-color-cta-800);\n --_connotation-color-fierce: var(--vvd-color-cta-700);\n --_connotation-color-firm: var(--vvd-color-cta-600);\n --_connotation-color-soft: var(--vvd-color-cta-100);\n --_connotation-color-faint: var(--vvd-color-cta-50);\n}\n.control.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary-increment: var(--vvd-color-success-600);\n --_connotation-color-contrast: var(--vvd-color-success-800);\n --_connotation-color-fierce: var(--vvd-color-success-700);\n --_connotation-color-firm: var(--vvd-color-success-600);\n --_connotation-color-soft: var(--vvd-color-success-100);\n --_connotation-color-faint: var(--vvd-color-success-50);\n}\n.control.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary-increment: var(--vvd-color-alert-600);\n --_connotation-color-contrast: var(--vvd-color-alert-800);\n --_connotation-color-fierce: var(--vvd-color-alert-700);\n --_connotation-color-firm: var(--vvd-color-alert-600);\n --_connotation-color-soft: var(--vvd-color-alert-100);\n --_connotation-color-faint: var(--vvd-color-alert-50);\n}\n.control:not(.connotation-cta, .connotation-success, .connotation-alert) {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary-increment: var(--vvd-color-neutral-800);\n --_connotation-color-contrast: var(--vvd-color-neutral-800);\n --_connotation-color-fierce: var(--vvd-color-neutral-700);\n --_connotation-color-firm: var(--vvd-color-canvas-text);\n --_connotation-color-soft: var(--vvd-color-neutral-100);\n --_connotation-color-faint: var(--vvd-color-neutral-50);\n}\n.control.appearance-filled {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transparent;\n}\n.control.appearance-outlined {\n --_appearance-color-text: var(--_connotation-color-firm);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.control {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled)).appearance-filled {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary-increment);\n --_appearance-color-outline: transparent;\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled)).appearance-outlined {\n --_appearance-color-text: var(--_connotation-color-firm);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transparent;\n}\n.control:where(:disabled, .disabled).appearance-filled {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\n --_appearance-color-outline: transparent;\n}\n.control:where(:disabled, .disabled).appearance-outlined {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.control:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.control:where(:active, .active):where(:not(:disabled, .disabled)).appearance-filled {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-fierce);\n --_appearance-color-outline: transparent;\n}\n.control:where(:active, .active):where(:not(:disabled, .disabled)).appearance-outlined {\n --_appearance-color-text: var(--_connotation-color-firm);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.control:where(:active, .active):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transparent;\n}\n@supports selector(:focus-visible) {\n .control:focus {\n outline: none;\n }\n}\n@supports (user-select: none) {\n .control {\n user-select: none;\n }\n}\n.control:not(:disabled) {\n cursor: pointer;\n}\n.control:disabled {\n cursor: not-allowed;\n}\n.control.icon-only {\n contain: size;\n padding-inline: 0;\n place-content: center;\n}\n@supports (aspect-ratio: 1) {\n .control.icon-only {\n aspect-ratio: 1;\n }\n}\n@supports not (aspect-ratio: 1) {\n .control.icon-only {\n inline-size: var(--_button-block-size);\n }\n}\n.control:not(.stacked).density-condensed {\n --_button-block-size: calc(1px * (40 + 8 * clamp(-1, var(--vvd-size-density, 0), 1) - 8));\n font: var(--vvd-typography-base-condensed-bold);\n}\n.control:not(.stacked).density-condensed:not(.icon-only) {\n --_button-icon-gap: 8px;\n padding-inline: 12px;\n}\n.control:not(.stacked).density-condensed .icon {\n font-size: 16px;\n}\n.control:not(.stacked).density-extended {\n --_button-block-size: calc(1px * (40 + 8 * clamp(-1, var(--vvd-size-density, 0), 1) + 8));\n font: var(--vvd-typography-base-extended-bold);\n}\n.control:not(.stacked).density-extended:not(.icon-only) {\n --_button-icon-gap: 10px;\n padding-inline: 20px;\n}\n.control:not(.stacked).density-extended .icon {\n font-size: 24px;\n}\n.control:not(.stacked):not(.density-condensed, .density-extended) {\n --_button-block-size: calc(1px * (40 + 8 * clamp(-1, var(--vvd-size-density, 0), 1)));\n font: var(--vvd-typography-base-bold);\n}\n.control:not(.stacked):not(.density-condensed, .density-extended):not(.icon-only) {\n --_button-icon-gap: 8px;\n padding-inline: 16px;\n}\n.control:not(.stacked):not(.density-condensed, .density-extended) .icon {\n font-size: 20px;\n}\n.control.stacked {\n flex-direction: column;\n justify-content: center;\n --_button-block-size: calc(calc(1px * (40 + 8 * clamp(-1, var(--vvd-size-density, 0), 1) + 8)) + calc(1px * (40 + 8 * clamp(-1, var(--vvd-size-density, 0), 1) - 20)));\n font: var(--vvd-typography-base-bold);\n}\n.control.stacked:not(.icon-only) {\n --_button-icon-gap: 10px;\n padding-inline: 16px;\n}\n.control.stacked .icon {\n font-size: 20px;\n}\n\n/* Shape */\n.control:not(.shape-pill:not(.stacked)) {\n border-radius: 6px;\n}\n\n.control.shape-pill:not(.stacked):not(.icon-only) {\n border-radius: 24px;\n}\n.control.shape-pill:not(.stacked).icon-only {\n border-radius: 50%;\n}\n\n/* Icon */\n.icon-trailing .icon {\n order: 1;\n}\n\n:not(:focus-visible) > .focus-indicator {\n display: none;\n}\n.appearance-outlined .focus-indicator, .appearance-ghost .focus-indicator {\n --focus-stroke-gap-color: transparent;\n}";
8
30
 
9
31
  let _ = t => t,
10
- _t;
11
- const focusTemplate = () => html(_t || (_t = _`
12
- <span class="control"></span>`));
32
+ _t;
33
+ const getAppearanceClassName = (appearance, disabled) => {
34
+ let className = `appearance-${appearance}`;
35
+ disabled && (className += ' disabled');
36
+ return className;
37
+ };
38
+ const getClasses = ({
39
+ connotation,
40
+ appearance,
41
+ shape,
42
+ density,
43
+ iconTrailing,
44
+ icon,
45
+ label,
46
+ disabled,
47
+ stacked
48
+ }) => classNames('control', [`connotation-${connotation}`, Boolean(connotation)], [getAppearanceClassName(appearance, disabled), Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], [`density-${density}`, Boolean(density)], ['icon-only', !label && !!icon], ['icon-trailing', iconTrailing], ['stacked', Boolean(stacked)]);
49
+ const buttonTemplate = context => {
50
+ const affixIconTemplate = affixIconTemplateFactory(context);
51
+ const focusTemplate = focusTemplateFactory(context);
52
+ return html(_t || (_t = _`
53
+ <button
54
+ class="${0}"
55
+ ?autofocus="${0}"
56
+ ?disabled="${0}"
57
+ form="${0}"
58
+ formaction="${0}"
59
+ formenctype="${0}"
60
+ formmethod="${0}"
61
+ formnovalidate="${0}"
62
+ formtarget="${0}"
63
+ name="${0}"
64
+ type="${0}"
65
+ value="${0}"
66
+ aria-atomic="${0}"
67
+ aria-busy="${0}"
68
+ aria-controls="${0}"
69
+ aria-current="${0}"
70
+ aria-describedby="${0}"
71
+ aria-details="${0}"
72
+ aria-disabled="${0}"
73
+ aria-errormessage="${0}"
74
+ aria-expanded="${0}"
75
+ aria-flowto="${0}"
76
+ aria-haspopup="${0}"
77
+ aria-hidden="${0}"
78
+ aria-invalid="${0}"
79
+ aria-keyshortcuts="${0}"
80
+ aria-label="${0}"
81
+ aria-labelledby="${0}"
82
+ aria-live="${0}"
83
+ aria-owns="${0}"
84
+ aria-pressed="${0}"
85
+ aria-relevant="${0}"
86
+ aria-roledescription="${0}"
87
+ ${0}
88
+ >
89
+ ${0}
90
+ ${0}
91
+ ${0}
92
+ </button>
93
+ `), getClasses, x => x.autofocus, x => x.disabled, x => x.formId, x => x.formaction, x => x.formenctype, x => x.formmethod, x => x.formnovalidate, x => x.formtarget, x => x.name, x => x.type, x => x.value, x => x.ariaAtomic, x => x.ariaBusy, x => x.ariaControls, x => x.ariaCurrent, x => x.ariaDescribedby, x => x.ariaDetails, x => x.ariaDisabled, x => x.ariaErrormessage, x => x.ariaExpanded, x => x.ariaFlowto, x => x.ariaHaspopup, x => x.ariaHidden, x => x.ariaInvalid, x => x.ariaKeyshortcuts, x => x.ariaLabel, x => x.ariaLabelledby, x => x.ariaLive, x => x.ariaOwns, x => x.ariaPressed, x => x.ariaRelevant, x => x.ariaRoledescription, ref('control'), () => focusTemplate, x => affixIconTemplate(x.icon), x => x.label);
94
+ };
13
95
 
14
- const VIVIDFocus = Focus.compose({
15
- baseName: 'focus',
16
- template: focusTemplate,
17
- styles: css_248z
96
+ const vividButton = Button.compose({
97
+ baseName: 'button',
98
+ baseClass: Button$1,
99
+ template: buttonTemplate,
100
+ styles: css_248z,
101
+ shadowOptions: {
102
+ delegatesFocus: true
103
+ }
18
104
  });
19
- designSystem.register(VIVIDFocus());
105
+ designSystem.register(vividButton());
20
106
 
21
- export { Focus as F, VIVIDFocus as V };
107
+ export { Button as B, vividButton as v };
@@ -0,0 +1,31 @@
1
+ import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from './index.js';
2
+ import { c as classNames } from './class-names.js';
3
+
4
+ class Elevation extends FoundationElement {}
5
+ __decorate([attr, __metadata("design:type", Number)], Elevation.prototype, "dp", void 0);
6
+ __decorate([attr({
7
+ attribute: 'no-shadow',
8
+ mode: 'boolean'
9
+ }), __metadata("design:type", Boolean)], Elevation.prototype, "noShadow", void 0);
10
+
11
+ var css_248z = ":host {\n display: contents;\n}\n\n.control {\n display: contents;\n}\n.control.dp-0 {\n --_elevation-fill: var(--vvd-color-surface-0dp);\n --_elevation-shadow: var(--vvd-shadow-surface-0dp);\n}\n.control.dp-4 {\n --_elevation-fill: var(--vvd-color-surface-4dp);\n --_elevation-shadow: var(--vvd-shadow-surface-4dp);\n}\n.control.dp-8 {\n --_elevation-fill: var(--vvd-color-surface-8dp);\n --_elevation-shadow: var(--vvd-shadow-surface-8dp);\n}\n.control.dp-12 {\n --_elevation-fill: var(--vvd-color-surface-12dp);\n --_elevation-shadow: var(--vvd-shadow-surface-12dp);\n}\n.control.dp-16 {\n --_elevation-fill: var(--vvd-color-surface-16dp);\n --_elevation-shadow: var(--vvd-shadow-surface-16dp);\n}\n.control.dp-24 {\n --_elevation-fill: var(--vvd-color-surface-24dp);\n --_elevation-shadow: var(--vvd-shadow-surface-24dp);\n}\n.control:not(.dp-0, .dp-4, .dp-8, .dp-12, .dp-16, .dp-24) {\n --_elevation-fill: var(--vvd-color-surface-2dp);\n --_elevation-shadow: var(--vvd-shadow-surface-2dp);\n}\n.control ::slotted(*) {\n background: var(--_elevation-fill);\n filter: var(--_elevation-shadow);\n transition: background-color 0.15s linear, filter 0.15s linear;\n}\n.control.no-shadow ::slotted(*) {\n filter: none;\n}";
12
+
13
+ let _ = t => t,
14
+ _t;
15
+ const getClasses = ({
16
+ dp,
17
+ noShadow
18
+ }) => classNames('control', [`dp-${dp}`, Boolean(dp)], ['no-shadow', Boolean(noShadow)]);
19
+ const elevationTemplate = () => html(_t || (_t = _`
20
+ <div class="${0}" part="base">
21
+ <slot></slot>
22
+ </div>`), getClasses);
23
+
24
+ const vividElevation = Elevation.compose({
25
+ baseName: 'elevation',
26
+ template: elevationTemplate,
27
+ styles: css_248z
28
+ });
29
+ designSystem.register(vividElevation());
30
+
31
+ export { Elevation as E, vividElevation as v };
@@ -0,0 +1,77 @@
1
+ import { F as FoundationElement, _ as __decorate, a as attr, h as html, d as designSystem } from './index.js';
2
+ import { O as Orientation } from './aria.js';
3
+ import { c as classNames } from './class-names.js';
4
+
5
+ /**
6
+ * Divider roles
7
+ * @public
8
+ */
9
+ const DividerRole = {
10
+ /**
11
+ * The divider semantically separates content
12
+ */
13
+ separator: "separator",
14
+ /**
15
+ * The divider has no semantic value and is for visual presentation only.
16
+ */
17
+ presentation: "presentation",
18
+ };
19
+
20
+ /**
21
+ * A Divider Custom HTML Element.
22
+ * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#separator | ARIA separator } or {@link https://www.w3.org/TR/wai-aria-1.1/#presentation | ARIA presentation}.
23
+ *
24
+ * @public
25
+ */
26
+ class Divider$1 extends FoundationElement {
27
+ constructor() {
28
+ super(...arguments);
29
+ /**
30
+ * The role of the element.
31
+ *
32
+ * @public
33
+ * @remarks
34
+ * HTML Attribute: role
35
+ */
36
+ this.role = DividerRole.separator;
37
+ /**
38
+ * The orientation of the divider.
39
+ *
40
+ * @public
41
+ * @remarks
42
+ * HTML Attribute: orientation
43
+ */
44
+ this.orientation = Orientation.horizontal;
45
+ }
46
+ }
47
+ __decorate([
48
+ attr
49
+ ], Divider$1.prototype, "role", void 0);
50
+ __decorate([
51
+ attr
52
+ ], Divider$1.prototype, "orientation", void 0);
53
+
54
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 03 Nov 2022 17:26:06 GMT\n */\n:host {\n display: block;\n}\n\n.base {\n display: block;\n background-color: var(--vvd-color-neutral-200);\n}\n.base:not(.vertical) {\n block-size: 1px;\n inline-size: 100%;\n}\n.base.vertical {\n block-size: 100%;\n inline-size: 1px;\n}";
55
+
56
+ class Divider extends Divider$1 {}
57
+
58
+ let _ = t => t,
59
+ _t;
60
+ const getClasses = ({
61
+ orientation
62
+ }) => classNames('base', [`${orientation}`, Boolean(orientation)]);
63
+ const DividerTemplate = () => html(_t || (_t = _`
64
+ <span
65
+ class="${0}"
66
+ orientation="${0}"
67
+ role="${0}"
68
+ ></span>`), getClasses, x => x.orientation, x => x.role);
69
+
70
+ const vividDivider = Divider.compose({
71
+ baseName: 'divider',
72
+ template: DividerTemplate,
73
+ styles: css_248z
74
+ });
75
+ designSystem.register(vividDivider());
76
+
77
+ export { Divider as D, vividDivider as v };