@vonage/vivid 3.0.0-next.3 → 3.0.0-next.32

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 (152) hide show
  1. package/README.md +49 -4
  2. package/accordion/index.js +61 -0
  3. package/accordion-item/index.js +133 -0
  4. package/action-group/index.js +49 -0
  5. package/badge/index.js +27 -22
  6. package/banner/index.js +148 -0
  7. package/breadcrumb/index.js +41 -150
  8. package/breadcrumb-item/index.js +18 -8
  9. package/button/index.js +40 -663
  10. package/calendar/index.js +1550 -0
  11. package/calendar-event/index.js +117 -0
  12. package/card/index.js +134 -0
  13. package/checkbox/index.js +176 -0
  14. package/dialog/index.js +277 -0
  15. package/divider/index.js +88 -0
  16. package/elevation/index.js +4 -38
  17. package/fab/index.js +101 -0
  18. package/focus/index.js +20 -3
  19. package/header/index.js +68 -0
  20. package/icon/index.js +40 -5
  21. package/index.d.ts +1 -0
  22. package/index.js +50 -14
  23. package/layout/index.js +5 -5
  24. package/lib/accordion/accordion.d.ts +9 -0
  25. package/lib/accordion/accordion.template.d.ts +4 -0
  26. package/lib/accordion/index.d.ts +2 -0
  27. package/lib/accordion-item/accordion-item.d.ts +13 -0
  28. package/lib/accordion-item/accordion-item.template.d.ts +4 -0
  29. package/lib/accordion-item/index.d.ts +4 -0
  30. package/lib/action-group/action-group.d.ts +10 -0
  31. package/lib/action-group/action-group.template.d.ts +4 -0
  32. package/lib/action-group/index.d.ts +2 -0
  33. package/lib/badge/badge.d.ts +8 -8
  34. package/lib/badge/index.d.ts +1 -1
  35. package/lib/banner/banner.d.ts +20 -0
  36. package/lib/banner/banner.template.d.ts +4 -0
  37. package/lib/banner/index.d.ts +3 -0
  38. package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
  39. package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  40. package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +0 -1
  41. package/lib/breadcrumb-item/index.d.ts +2 -0
  42. package/lib/button/button.d.ts +9 -8
  43. package/lib/button/index.d.ts +2 -19
  44. package/lib/calendar/calendar.d.ts +13 -0
  45. package/lib/calendar/calendar.template.d.ts +4 -0
  46. package/lib/calendar/helpers/calendar.date-functions.d.ts +2 -0
  47. package/lib/calendar/helpers/calendar.event-context.d.ts +6 -0
  48. package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +9 -0
  49. package/lib/calendar/index.d.ts +2 -0
  50. package/lib/calendar-event/calendar-event.d.ts +14 -0
  51. package/lib/calendar-event/calendar-event.template.d.ts +4 -0
  52. package/lib/calendar-event/index.d.ts +2 -0
  53. package/lib/card/card.d.ts +10 -0
  54. package/lib/card/card.template.d.ts +4 -0
  55. package/lib/card/index.d.ts +4 -0
  56. package/lib/checkbox/checkbox.d.ts +5 -0
  57. package/lib/checkbox/checkbox.template.d.ts +4 -0
  58. package/lib/checkbox/index.d.ts +4 -0
  59. package/lib/components.d.ts +23 -5
  60. package/lib/dialog/dialog.d.ts +20 -0
  61. package/lib/dialog/dialog.template.d.ts +4 -0
  62. package/lib/dialog/index.d.ts +5 -0
  63. package/lib/divider/divider.d.ts +3 -0
  64. package/lib/divider/divider.template.d.ts +4 -0
  65. package/lib/divider/index.d.ts +2 -0
  66. package/lib/elevation/elevation.d.ts +2 -1
  67. package/lib/elevation/index.d.ts +1 -1
  68. package/lib/enums.d.ts +14 -7
  69. package/lib/fab/fab.d.ts +13 -0
  70. package/lib/fab/fab.template.d.ts +4 -0
  71. package/lib/fab/index.d.ts +4 -0
  72. package/lib/focus/index.d.ts +1 -1
  73. package/lib/header/header.d.ts +5 -0
  74. package/lib/header/header.template.d.ts +4 -0
  75. package/lib/header/index.d.ts +3 -0
  76. package/lib/icon/icon.d.ts +4 -5
  77. package/lib/layout/index.d.ts +1 -1
  78. package/lib/layout/layout.d.ts +3 -3
  79. package/lib/note/index.d.ts +2 -0
  80. package/lib/note/note.d.ts +10 -0
  81. package/lib/note/note.template.d.ts +5 -0
  82. package/lib/popup/index.d.ts +4 -0
  83. package/lib/popup/popup.d.ts +17 -0
  84. package/lib/popup/popup.template.d.ts +4 -0
  85. package/lib/progress/index.d.ts +2 -0
  86. package/lib/progress/progress.d.ts +9 -0
  87. package/lib/progress/progress.template.d.ts +5 -0
  88. package/lib/progress-ring/index.d.ts +2 -0
  89. package/lib/progress-ring/progress-ring.d.ts +7 -0
  90. package/lib/progress-ring/progress-ring.template.d.ts +4 -0
  91. package/lib/side-drawer/index.d.ts +2 -0
  92. package/lib/side-drawer/side-drawer.d.ts +7 -0
  93. package/lib/side-drawer/side-drawer.template.d.ts +4 -0
  94. package/lib/sidenav/index.d.ts +2 -0
  95. package/lib/sidenav/sidenav.d.ts +3 -0
  96. package/lib/sidenav/sidenav.template.d.ts +4 -0
  97. package/lib/sidenav-item/index.d.ts +1 -0
  98. package/lib/sidenav-item/sidenav-item.d.ts +4 -5
  99. package/lib/text/index.d.ts +2 -0
  100. package/lib/text/text.d.ts +10 -0
  101. package/lib/text/text.template.d.ts +4 -0
  102. package/lib/text-anchor/text-anchor.d.ts +4 -1
  103. package/lib/text-field/index.d.ts +4 -0
  104. package/lib/text-field/text-field.d.ts +23 -0
  105. package/lib/text-field/text-field.template.d.ts +5 -0
  106. package/lib/tooltip/index.d.ts +3 -0
  107. package/lib/tooltip/tooltip.d.ts +8 -0
  108. package/lib/tooltip/tooltip.template.d.ts +4 -0
  109. package/note/index.js +68 -0
  110. package/package.json +39 -6
  111. package/popup/index.js +2118 -0
  112. package/progress/index.js +107 -0
  113. package/progress-ring/index.js +82 -0
  114. package/shared/_has.js +58 -0
  115. package/shared/affix.js +10 -25
  116. package/shared/anchor.js +10 -3
  117. package/shared/aria-global.js +20 -20
  118. package/shared/base-progress.js +70 -0
  119. package/shared/breadcrumb-item.js +2 -2
  120. package/shared/button.js +195 -0
  121. package/shared/calendar-event.js +26 -0
  122. package/shared/dialog-polyfill.esm.js +858 -0
  123. package/shared/enums.js +79 -0
  124. package/shared/es.object.assign.js +69 -0
  125. package/shared/export.js +972 -0
  126. package/shared/focus.js +5 -0
  127. package/shared/focus2.js +11 -0
  128. package/shared/form-associated.js +548 -0
  129. package/shared/icon.js +1389 -0
  130. package/shared/index.js +4940 -1426
  131. package/shared/index2.js +27 -4901
  132. package/shared/iterators.js +61 -0
  133. package/shared/object-keys.js +13 -0
  134. package/shared/patterns/affix.d.ts +3 -4
  135. package/shared/patterns/focus.d.ts +3 -0
  136. package/shared/patterns/index.d.ts +1 -0
  137. package/shared/slotted.js +119 -0
  138. package/shared/text-anchor.js +12 -0
  139. package/shared/text-anchor.template.js +16 -6
  140. package/shared/to-string.js +51 -0
  141. package/shared/web.dom-collections.iterator.js +46 -1059
  142. package/shared/when.js +15 -0
  143. package/side-drawer/index.js +82 -0
  144. package/sidenav/index.js +17 -0
  145. package/sidenav-item/index.js +24 -61
  146. package/styles/themes/dark.css +16 -4
  147. package/styles/themes/light.css +16 -4
  148. package/text/index.js +48 -0
  149. package/text-anchor/index.js +13 -13
  150. package/text-field/index.js +411 -0
  151. package/tooltip/index.js +70 -0
  152. package/shared/index3.js +0 -21
@@ -0,0 +1,61 @@
1
+ import { i as isCallable$1, f as functionUncurryThis, j as anObject$1, o as objectDefineProperty, w as wellKnownSymbol$1, p as hasOwnProperty_1, a as getBuiltIn$1 } from './export.js';
2
+
3
+ var isCallable = isCallable$1;
4
+
5
+ var $String = String;
6
+ var $TypeError = TypeError;
7
+
8
+ var aPossiblePrototype$1 = function (argument) {
9
+ if (typeof argument == 'object' || isCallable(argument)) return argument;
10
+ throw $TypeError("Can't set " + $String(argument) + ' as a prototype');
11
+ };
12
+
13
+ /* eslint-disable no-proto -- safe */
14
+
15
+ var uncurryThis = functionUncurryThis;
16
+ var anObject = anObject$1;
17
+ var aPossiblePrototype = aPossiblePrototype$1;
18
+
19
+ // `Object.setPrototypeOf` method
20
+ // https://tc39.es/ecma262/#sec-object.setprototypeof
21
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
22
+ // eslint-disable-next-line es-x/no-object-setprototypeof -- safe
23
+ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
24
+ var CORRECT_SETTER = false;
25
+ var test = {};
26
+ var setter;
27
+ try {
28
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
29
+ setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
30
+ setter(test, []);
31
+ CORRECT_SETTER = test instanceof Array;
32
+ } catch (error) { /* empty */ }
33
+ return function setPrototypeOf(O, proto) {
34
+ anObject(O);
35
+ aPossiblePrototype(proto);
36
+ if (CORRECT_SETTER) setter(O, proto);
37
+ else O.__proto__ = proto;
38
+ return O;
39
+ };
40
+ }() : undefined);
41
+
42
+ var defineProperty = objectDefineProperty.f;
43
+ var hasOwn = hasOwnProperty_1;
44
+ var wellKnownSymbol = wellKnownSymbol$1;
45
+
46
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
47
+
48
+ var setToStringTag = function (target, TAG, STATIC) {
49
+ if (target && !STATIC) target = target.prototype;
50
+ if (target && !hasOwn(target, TO_STRING_TAG)) {
51
+ defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
52
+ }
53
+ };
54
+
55
+ var getBuiltIn = getBuiltIn$1;
56
+
57
+ var html = getBuiltIn('document', 'documentElement');
58
+
59
+ var iterators = {};
60
+
61
+ export { html as h, iterators as i, objectSetPrototypeOf as o, setToStringTag as s };
@@ -0,0 +1,13 @@
1
+ import { L as objectKeysInternal, H as enumBugKeys$1 } from './export.js';
2
+
3
+ var internalObjectKeys = objectKeysInternal;
4
+ var enumBugKeys = enumBugKeys$1;
5
+
6
+ // `Object.keys` method
7
+ // https://tc39.es/ecma262/#sec-object.keys
8
+ // eslint-disable-next-line es-x/no-object-keys -- safe
9
+ var objectKeys = Object.keys || function keys(O) {
10
+ return internalObjectKeys(O, enumBugKeys);
11
+ };
12
+
13
+ export { objectKeys as o };
@@ -1,10 +1,9 @@
1
1
  import type { ViewTemplate } from '@microsoft/fast-element';
2
2
  import type { ElementDefinitionContext } from '@microsoft/fast-foundation';
3
- export declare class Prefix {
3
+ export declare class AffixIcon {
4
4
  icon?: string;
5
5
  }
6
- export declare class PrefixOrSuffix extends Prefix {
6
+ export declare class AffixIconWithTrailing extends AffixIcon {
7
7
  iconTrailing: boolean;
8
8
  }
9
- export declare const prefixTemplate: (context: ElementDefinitionContext) => ViewTemplate<Prefix>;
10
- export declare const prefixOrSuffixTemplate: (context: ElementDefinitionContext) => ViewTemplate<PrefixOrSuffix>;
9
+ export declare const affixIconTemplateFactory: (context: ElementDefinitionContext) => (icon?: string) => ViewTemplate<AffixIcon> | null;
@@ -0,0 +1,3 @@
1
+ import type { ViewTemplate } from '@microsoft/fast-element';
2
+ import type { ElementDefinitionContext } from '@microsoft/fast-foundation';
3
+ export declare const focusTemplateFactory: (context: ElementDefinitionContext) => ViewTemplate | null;
@@ -1 +1,2 @@
1
1
  export * from './affix';
2
+ export * from './focus';
@@ -0,0 +1,119 @@
1
+ import { O as Observable, e as emptyArray, A as AttachedBehaviorHTMLDirective } from './index.js';
2
+
3
+ /**
4
+ * Creates a function that can be used to filter a Node array, selecting only elements.
5
+ * @param selector - An optional selector to restrict the filter to.
6
+ * @public
7
+ */
8
+ function elements(selector) {
9
+ if (selector) {
10
+ return function (value, index, array) {
11
+ return value.nodeType === 1 && value.matches(selector);
12
+ };
13
+ }
14
+ return function (value, index, array) {
15
+ return value.nodeType === 1;
16
+ };
17
+ }
18
+ /**
19
+ * A base class for node observation.
20
+ * @internal
21
+ */
22
+ class NodeObservationBehavior {
23
+ /**
24
+ * Creates an instance of NodeObservationBehavior.
25
+ * @param target - The target to assign the nodes property on.
26
+ * @param options - The options to use in configuring node observation.
27
+ */
28
+ constructor(target, options) {
29
+ this.target = target;
30
+ this.options = options;
31
+ this.source = null;
32
+ }
33
+ /**
34
+ * Bind this behavior to the source.
35
+ * @param source - The source to bind to.
36
+ * @param context - The execution context that the binding is operating within.
37
+ */
38
+ bind(source) {
39
+ const name = this.options.property;
40
+ this.shouldUpdate = Observable.getAccessors(source).some((x) => x.name === name);
41
+ this.source = source;
42
+ this.updateTarget(this.computeNodes());
43
+ if (this.shouldUpdate) {
44
+ this.observe();
45
+ }
46
+ }
47
+ /**
48
+ * Unbinds this behavior from the source.
49
+ * @param source - The source to unbind from.
50
+ */
51
+ unbind() {
52
+ this.updateTarget(emptyArray);
53
+ this.source = null;
54
+ if (this.shouldUpdate) {
55
+ this.disconnect();
56
+ }
57
+ }
58
+ /** @internal */
59
+ handleEvent() {
60
+ this.updateTarget(this.computeNodes());
61
+ }
62
+ computeNodes() {
63
+ let nodes = this.getNodes();
64
+ if (this.options.filter !== void 0) {
65
+ nodes = nodes.filter(this.options.filter);
66
+ }
67
+ return nodes;
68
+ }
69
+ updateTarget(value) {
70
+ this.source[this.options.property] = value;
71
+ }
72
+ }
73
+
74
+ /**
75
+ * The runtime behavior for slotted node observation.
76
+ * @public
77
+ */
78
+ class SlottedBehavior extends NodeObservationBehavior {
79
+ /**
80
+ * Creates an instance of SlottedBehavior.
81
+ * @param target - The slot element target to observe.
82
+ * @param options - The options to use when observing the slot.
83
+ */
84
+ constructor(target, options) {
85
+ super(target, options);
86
+ }
87
+ /**
88
+ * Begins observation of the nodes.
89
+ */
90
+ observe() {
91
+ this.target.addEventListener("slotchange", this);
92
+ }
93
+ /**
94
+ * Disconnects observation of the nodes.
95
+ */
96
+ disconnect() {
97
+ this.target.removeEventListener("slotchange", this);
98
+ }
99
+ /**
100
+ * Retrieves the nodes that should be assigned to the target.
101
+ */
102
+ getNodes() {
103
+ return this.target.assignedNodes(this.options);
104
+ }
105
+ }
106
+ /**
107
+ * A directive that observes the `assignedNodes()` of a slot and updates a property
108
+ * whenever they change.
109
+ * @param propertyOrOptions - The options used to configure slotted node observation.
110
+ * @public
111
+ */
112
+ function slotted(propertyOrOptions) {
113
+ if (typeof propertyOrOptions === "string") {
114
+ propertyOrOptions = { property: propertyOrOptions };
115
+ }
116
+ return new AttachedBehaviorHTMLDirective("fast-slotted", SlottedBehavior, propertyOrOptions);
117
+ }
118
+
119
+ export { elements as e, slotted as s };
@@ -0,0 +1,12 @@
1
+ import { _ as __decorate, a as attr, b as __metadata } from './index.js';
2
+ import { b as AffixIcon } from './affix.js';
3
+ import { A as Anchor } from './anchor.js';
4
+ import { a as applyMixins } from './apply-mixins.js';
5
+
6
+ class TextAnchor extends Anchor {}
7
+
8
+ __decorate([attr, __metadata("design:type", String)], TextAnchor.prototype, "text", void 0);
9
+
10
+ applyMixins(TextAnchor, AffixIcon);
11
+
12
+ export { TextAnchor as T };
@@ -1,14 +1,21 @@
1
- import { h as html } from './index2.js';
1
+ import { a as affixIconTemplateFactory } from './affix.js';
2
+ import { f as focusTemplateFactory } from './focus2.js';
3
+ import { h as html } from './index.js';
2
4
  import { r as ref } from './aria-global.js';
3
5
  import { c as classNames } from './class-names.js';
4
6
 
5
- let _2 = t => t,
7
+ let _ = t => t,
6
8
  _t;
7
9
 
8
- const getClasses = _ => classNames('control');
10
+ const getClasses = ({
11
+ text,
12
+ icon
13
+ }) => classNames('control', ['icon-only', !text && !!icon]);
9
14
 
10
- const textAnchorTemplate = () => html(_t || (_t = _2`
11
- <a
15
+ const textAnchorTemplate = context => {
16
+ const affixIconTemplate = affixIconTemplateFactory(context);
17
+ const focusTemplate = focusTemplateFactory(context);
18
+ return html(_t || (_t = _`<a
12
19
  class="${0}"
13
20
  download="${0}"
14
21
  href="${0}"
@@ -41,7 +48,10 @@ const textAnchorTemplate = () => html(_t || (_t = _2`
41
48
  ${0}
42
49
  >
43
50
  ${0}
51
+ ${0}
52
+ ${0}
44
53
  </a>
45
- `), getClasses, x => x.download, x => x.href, x => x.hreflang, x => x.ping, x => x.referrerpolicy, x => x.rel, x => x.target, x => x.type, 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.ariaRelevant, x => x.ariaRoledescription, ref('control'), x => x.text);
54
+ `), getClasses, x => x.download, x => x.href, x => x.hreflang, x => x.ping, x => x.referrerpolicy, x => x.rel, x => x.target, x => x.type, 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.ariaRelevant, x => x.ariaRoledescription, ref('control'), () => focusTemplate, x => affixIconTemplate(x.icon), x => x.text);
55
+ };
46
56
 
47
57
  export { textAnchorTemplate as t };
@@ -0,0 +1,51 @@
1
+ import { w as wellKnownSymbol$2, c as classofRaw$1, i as isCallable$1 } from './export.js';
2
+
3
+ var wellKnownSymbol$1 = wellKnownSymbol$2;
4
+
5
+ var TO_STRING_TAG$1 = wellKnownSymbol$1('toStringTag');
6
+ var test = {};
7
+
8
+ test[TO_STRING_TAG$1] = 'z';
9
+
10
+ var toStringTagSupport = String(test) === '[object z]';
11
+
12
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
13
+ var isCallable = isCallable$1;
14
+ var classofRaw = classofRaw$1;
15
+ var wellKnownSymbol = wellKnownSymbol$2;
16
+
17
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
18
+ var $Object = Object;
19
+
20
+ // ES3 wrong here
21
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
22
+
23
+ // fallback for IE11 Script Access Denied error
24
+ var tryGet = function (it, key) {
25
+ try {
26
+ return it[key];
27
+ } catch (error) { /* empty */ }
28
+ };
29
+
30
+ // getting tag from ES6+ `Object.prototype.toString`
31
+ var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
32
+ var O, tag, result;
33
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
34
+ // @@toStringTag case
35
+ : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
36
+ // builtinTag case
37
+ : CORRECT_ARGUMENTS ? classofRaw(O)
38
+ // ES3 arguments fallback
39
+ : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
40
+ };
41
+
42
+ var classof = classof$1;
43
+
44
+ var $String = String;
45
+
46
+ var toString = function (argument) {
47
+ if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
48
+ return $String(argument);
49
+ };
50
+
51
+ export { classof$1 as c, toString as t };