@vonage/vivid 3.14.0 → 3.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/checkbox/index.js +3 -0
  2. package/custom-elements.json +250 -27
  3. package/empty-state/index.js +14 -0
  4. package/fab/index.js +1 -1
  5. package/header/index.js +1 -1
  6. package/index.js +31 -29
  7. package/layout/index.js +1 -1
  8. package/lib/checkbox/checkbox.d.ts +6 -3
  9. package/lib/components.d.ts +2 -0
  10. package/lib/data-grid/data-grid-cell.d.ts +2 -0
  11. package/lib/data-grid/data-grid-row.d.ts +1 -0
  12. package/lib/data-grid/data-grid.d.ts +1 -1
  13. package/lib/empty-state/definition.d.ts +3 -0
  14. package/lib/empty-state/empty-state.d.ts +5 -0
  15. package/lib/empty-state/empty-state.template.d.ts +4 -0
  16. package/lib/empty-state/index.d.ts +1 -0
  17. package/listbox/index.js +1 -1
  18. package/menu/index.js +2 -2
  19. package/menu-item/index.js +1 -1
  20. package/nav/index.js +1 -1
  21. package/nav-disclosure/index.js +1 -1
  22. package/nav-item/index.js +1 -1
  23. package/note/index.js +1 -1
  24. package/number-field/index.js +1 -1
  25. package/package.json +1 -1
  26. package/pagination/index.js +14 -232
  27. package/progress/index.js +1 -1
  28. package/radio/index.js +1 -1
  29. package/radio-group/index.js +1 -1
  30. package/select/index.js +1 -1
  31. package/shared/definition.js +1 -1
  32. package/shared/definition10.js +1 -1
  33. package/shared/definition11.js +1 -1
  34. package/shared/definition12.js +1 -1
  35. package/shared/definition14.js +1 -1
  36. package/shared/definition15.js +1 -1
  37. package/shared/definition16.js +1 -1
  38. package/shared/definition17.js +1 -1
  39. package/shared/definition18.js +23 -8
  40. package/shared/definition19.js +1 -1
  41. package/shared/definition2.js +1 -1
  42. package/shared/definition21.js +1 -1
  43. package/shared/definition22.js +114 -40
  44. package/shared/definition23.js +1 -1
  45. package/shared/definition24.js +1 -1
  46. package/shared/definition25.js +39 -76
  47. package/shared/definition26.js +76 -47
  48. package/shared/definition27.js +46 -36
  49. package/shared/definition28.js +39 -49
  50. package/shared/definition29.js +48 -344
  51. package/shared/definition30.js +272 -291
  52. package/shared/definition31.js +366 -14
  53. package/shared/definition32.js +13 -67
  54. package/shared/definition33.js +66 -21
  55. package/shared/definition34.js +21 -39
  56. package/shared/definition35.js +31 -432
  57. package/shared/definition36.js +432 -76
  58. package/shared/definition37.js +223 -34
  59. package/shared/definition38.js +82 -425
  60. package/shared/definition39.js +30 -635
  61. package/shared/definition4.js +1 -1
  62. package/shared/definition40.js +420 -73
  63. package/shared/definition41.js +530 -484
  64. package/shared/definition42.js +76 -133
  65. package/shared/definition43.js +577 -40
  66. package/shared/definition44.js +135 -20
  67. package/shared/definition45.js +42 -423
  68. package/shared/definition46.js +22 -112
  69. package/shared/definition47.js +440 -18
  70. package/shared/definition48.js +92 -247
  71. package/shared/definition49.js +20 -112
  72. package/shared/definition5.js +1 -1
  73. package/shared/definition50.js +259 -590
  74. package/shared/definition51.js +110 -91
  75. package/shared/definition52.js +626 -67
  76. package/shared/definition53.js +111 -292
  77. package/shared/definition54.js +80 -0
  78. package/shared/definition55.js +305 -0
  79. package/shared/definition6.js +1 -1
  80. package/shared/definition7.js +1 -1
  81. package/shared/definition9.js +1 -1
  82. package/shared/form-elements.js +1 -1
  83. package/shared/icon.js +1 -1
  84. package/shared/patterns/form-elements/form-elements.d.ts +4 -4
  85. package/shared/text-field.js +1 -1
  86. package/side-drawer/index.js +1 -1
  87. package/slider/index.js +1 -1
  88. package/styles/core/all.css +1 -1
  89. package/styles/core/theme.css +1 -1
  90. package/styles/core/typography.css +1 -1
  91. package/styles/tokens/theme-dark.css +4 -4
  92. package/styles/tokens/theme-light.css +4 -4
  93. package/switch/index.js +1 -1
  94. package/tab/index.js +1 -1
  95. package/tab-panel/index.js +1 -1
  96. package/tabs/index.js +3 -3
  97. package/tag/index.js +1 -1
  98. package/tag-group/index.js +1 -1
  99. package/text-area/index.js +1 -1
  100. package/text-field/index.js +1 -1
  101. package/toggletip/index.js +1 -1
  102. package/tooltip/index.js +1 -1
  103. package/tree-item/index.js +1 -1
  104. package/tree-view/index.js +1 -1
  105. package/vivid.api.json +210 -0
@@ -1,100 +1,119 @@
1
- import { F as FoundationElement, U as __classPrivateFieldGet, V as __classPrivateFieldSet, _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactory } from './index.js';
2
- import { P as Popup, p as popupRegistries } from './definition20.js';
1
+ import { _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactory } from './index.js';
2
+ import { f as focusRegistries } from './definition4.js';
3
+ import { i as iconRegistries } from './definition3.js';
4
+ import { b as AffixIcon, a as affixIconTemplateFactory } from './affix.js';
5
+ import './focus.js';
6
+ import { e as errorText, f as formElements, F as FormElementSuccessText, a as FormElementHelperText, b as FormElementCharCount, g as getFeedbackTemplate } from './form-elements.js';
7
+ import { T as TextField$1 } from './text-field2.js';
8
+ import { a as applyMixins } from './apply-mixins.js';
9
+ import { c as css_248z } from './text-field.js';
10
+ import { f as focusTemplateFactory } from './focus2.js';
11
+ import { w as when } from './when.js';
12
+ import { r as ref } from './ref.js';
3
13
  import { c as classNames } from './class-names.js';
4
14
 
5
- var css_248z = "/**\n * Do not edit directly\n * Generated on Tue, 30 May 2023 12:49:14 GMT\n */\n.control {\n pointer-events: none;\n}\n\n.tooltip {\n width: var(--tooltip-inline-size, auto);\n}\n.tooltip-text {\n padding: 8px 12px;\n color: var(--vvd-color-canvas-text);\n font: var(--vvd-typography-base-bold);\n}";
6
-
7
- var _Tooltip_instances, _Tooltip_anchorEl, _Tooltip_anchorUpdated, _Tooltip_addEventListener, _Tooltip_removeEventListener, _Tooltip_show, _Tooltip_hide, _Tooltip_closeOnEscape;
8
- class Tooltip extends FoundationElement {
9
- constructor() {
10
- super(...arguments);
11
- _Tooltip_instances.add(this);
12
- _Tooltip_anchorEl.set(this, null);
13
- this.open = false;
14
- _Tooltip_show.set(this, () => {
15
- this.open = true;
16
- });
17
- _Tooltip_hide.set(this, () => {
18
- this.open = false;
19
- });
20
- _Tooltip_closeOnEscape.set(this, e => {
21
- if (e.key === 'Escape') __classPrivateFieldGet(this, _Tooltip_hide, "f").call(this);
22
- });
23
- }
24
- anchorChanged(_, newValue) {
25
- if (__classPrivateFieldGet(this, _Tooltip_anchorEl, "f")) __classPrivateFieldGet(this, _Tooltip_instances, "m", _Tooltip_removeEventListener).call(this);
26
- __classPrivateFieldSet(this, _Tooltip_anchorEl, newValue instanceof HTMLElement ? newValue : document.getElementById(newValue), "f");
27
- if (__classPrivateFieldGet(this, _Tooltip_anchorEl, "f")) __classPrivateFieldGet(this, _Tooltip_instances, "m", _Tooltip_anchorUpdated).call(this);
28
- }
29
- disconnectedCallback() {
30
- super.disconnectedCallback();
31
- __classPrivateFieldGet(this, _Tooltip_instances, "m", _Tooltip_removeEventListener).call(this);
32
- document.removeEventListener('keydown', __classPrivateFieldGet(this, _Tooltip_closeOnEscape, "f"));
33
- }
34
- openChanged(_, newValue) {
35
- if (_ === undefined) return;
36
- if (newValue) {
37
- document.addEventListener('keydown', __classPrivateFieldGet(this, _Tooltip_closeOnEscape, "f"));
38
- } else {
39
- document.removeEventListener('keydown', __classPrivateFieldGet(this, _Tooltip_closeOnEscape, "f"));
40
- }
41
- }
42
- }
43
- _Tooltip_anchorEl = new WeakMap(), _Tooltip_show = new WeakMap(), _Tooltip_hide = new WeakMap(), _Tooltip_closeOnEscape = new WeakMap(), _Tooltip_instances = new WeakSet(), _Tooltip_anchorUpdated = function _Tooltip_anchorUpdated() {
44
- __classPrivateFieldGet(this, _Tooltip_instances, "m", _Tooltip_removeEventListener).call(this);
45
- __classPrivateFieldGet(this, _Tooltip_instances, "m", _Tooltip_addEventListener).call(this);
46
- }, _Tooltip_addEventListener = function _Tooltip_addEventListener() {
47
- if (__classPrivateFieldGet(this, _Tooltip_anchorEl, "f")) {
48
- __classPrivateFieldGet(this, _Tooltip_anchorEl, "f").addEventListener('mouseover', __classPrivateFieldGet(this, _Tooltip_show, "f"));
49
- __classPrivateFieldGet(this, _Tooltip_anchorEl, "f").addEventListener('mouseout', __classPrivateFieldGet(this, _Tooltip_hide, "f"));
50
- __classPrivateFieldGet(this, _Tooltip_anchorEl, "f").addEventListener('focusin', __classPrivateFieldGet(this, _Tooltip_show, "f"));
51
- __classPrivateFieldGet(this, _Tooltip_anchorEl, "f").addEventListener('focusout', __classPrivateFieldGet(this, _Tooltip_hide, "f"));
52
- }
53
- }, _Tooltip_removeEventListener = function _Tooltip_removeEventListener() {
54
- var _a, _b, _c, _d;
55
- (_a = __classPrivateFieldGet(this, _Tooltip_anchorEl, "f")) === null || _a === void 0 ? void 0 : _a.removeEventListener('mouseover', __classPrivateFieldGet(this, _Tooltip_show, "f"));
56
- (_b = __classPrivateFieldGet(this, _Tooltip_anchorEl, "f")) === null || _b === void 0 ? void 0 : _b.removeEventListener('mouseout', __classPrivateFieldGet(this, _Tooltip_hide, "f"));
57
- (_c = __classPrivateFieldGet(this, _Tooltip_anchorEl, "f")) === null || _c === void 0 ? void 0 : _c.removeEventListener('focusin', __classPrivateFieldGet(this, _Tooltip_show, "f"));
58
- (_d = __classPrivateFieldGet(this, _Tooltip_anchorEl, "f")) === null || _d === void 0 ? void 0 : _d.removeEventListener('focusout', __classPrivateFieldGet(this, _Tooltip_hide, "f"));
59
- };
60
- __decorate([attr, __metadata("design:type", String)], Tooltip.prototype, "text", void 0);
61
- __decorate([attr({
62
- mode: 'fromView'
63
- }), __metadata("design:type", String)], Tooltip.prototype, "placement", void 0);
64
- __decorate([attr({
65
- mode: 'boolean'
66
- }), __metadata("design:type", Object)], Tooltip.prototype, "open", void 0);
67
- __decorate([attr({
68
- mode: 'fromView'
69
- }), __metadata("design:type", Object)], Tooltip.prototype, "anchor", void 0);
15
+ let TextField = class TextField extends TextField$1 {};
16
+ __decorate([attr, __metadata("design:type", String)], TextField.prototype, "appearance", void 0);
17
+ __decorate([attr, __metadata("design:type", String)], TextField.prototype, "shape", void 0);
18
+ __decorate([attr, __metadata("design:type", String)], TextField.prototype, "autoComplete", void 0);
19
+ TextField = __decorate([errorText, formElements], TextField);
20
+ applyMixins(TextField, AffixIcon, FormElementCharCount, FormElementHelperText, FormElementSuccessText);
70
21
 
71
22
  let _ = t => t,
72
- _t;
73
- const getClasses = ({
74
- open
75
- }) => classNames('control', ['open', Boolean(open)]);
76
- const TooltipTemplate = context => {
77
- const popupTag = context.tagFor(Popup);
23
+ _t,
24
+ _t2,
25
+ _t3;
26
+ const getStateClasses = ({
27
+ errorValidationMessage,
28
+ disabled,
29
+ value,
30
+ readOnly,
31
+ placeholder,
32
+ appearance,
33
+ shape,
34
+ label,
35
+ successText
36
+ }) => classNames(['error connotation-alert', Boolean(errorValidationMessage)], ['disabled', disabled], ['has-value', Boolean(value)], ['readonly', readOnly], ['placeholder', Boolean(placeholder)], [`appearance-${appearance}`, Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], ['no-label', !label], ['success connotation-success', Boolean(successText)]);
37
+ function renderLabel() {
78
38
  return html(_t || (_t = _`
79
- <${0} class="${0}" arrow alternate
80
- :placement=${0}
81
- :anchor="${0}"
82
- :open=${0}
83
- exportparts="vvd-theme-alternate">
84
- <div class="tooltip" role="tooltip">
85
- <header part="vvd-theme-alternate" class="tooltip-header">
86
- <div class="tooltip-text">${0}</div>
87
- </header>
88
- </div>
89
- </${0}>`), popupTag, getClasses, x => x.placement, x => x.anchor, x => x.open, x => x.text, popupTag);
39
+ <label for="control" class="label">
40
+ ${0}
41
+ </label>`), x => x.label);
42
+ }
43
+ function renderCharCount() {
44
+ return html(_t2 || (_t2 = _`
45
+ <span class="char-count">${0} / ${0}</span>
46
+ `), x => x.value ? x.value.length : 0, x => x.maxlength);
47
+ }
48
+ const TextfieldTemplate = context => {
49
+ const affixIconTemplate = affixIconTemplateFactory(context);
50
+ const focusTemplate = focusTemplateFactory(context);
51
+ return html(_t3 || (_t3 = _`
52
+ <div class="base ${0}">
53
+ ${0}
54
+ ${0}
55
+ <div class="fieldset">
56
+ ${0}
57
+ <input class="control"
58
+ id="control"
59
+ @input="${0}"
60
+ @change="${0}"
61
+ ?autofocus="${0}"
62
+ ?disabled="${0}"
63
+ list="${0}"
64
+ maxlength="${0}"
65
+ minlength="${0}"
66
+ pattern="${0}"
67
+ placeholder="${0}"
68
+ ?readonly="${0}"
69
+ ?required="${0}"
70
+ size="${0}"
71
+ autocomplete="${0}"
72
+ name="${0}"
73
+ ?spellcheck="${0}"
74
+ :value="${0}"
75
+ type="${0}"
76
+ aria-atomic="${0}"
77
+ aria-busy="${0}"
78
+ aria-controls="${0}"
79
+ aria-current="${0}"
80
+ aria-describedby="${0}"
81
+ aria-details="${0}"
82
+ aria-disabled="${0}"
83
+ aria-errormessage="${0}"
84
+ aria-flowto="${0}"
85
+ aria-haspopup="${0}"
86
+ aria-hidden="${0}"
87
+ aria-invalid="${0}"
88
+ aria-keyshortcuts="${0}"
89
+ aria-label="${0}"
90
+ aria-labelledby="${0}"
91
+ aria-live="${0}"
92
+ aria-owns="${0}"
93
+ aria-relevant="${0}"
94
+ aria-roledescription="${0}"
95
+ ${0}
96
+ />
97
+ ${0}
98
+ </div>
99
+ ${0}
100
+ ${0}
101
+ ${0}
102
+ </div>`), getStateClasses, when(x => x.charCount && x.maxlength, renderCharCount()), when(x => x.label, renderLabel()), x => affixIconTemplate(x.icon), x => x.handleTextInput(), x => x.handleChange(), x => x.autofocus, x => x.disabled, x => x.list, x => x.maxlength, x => x.minlength, x => x.pattern, x => x.placeholder, x => x.readOnly, x => x.required, x => x.size, x => x.autoComplete, x => x.name, x => x.spellcheck, x => x.value, 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.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, when(x => {
103
+ var _a;
104
+ return !x.successText && !x.errorValidationMessage && ((_a = x.helperText) === null || _a === void 0 ? void 0 : _a.length);
105
+ }, getFeedbackTemplate('helper', context)), when(x => !x.successText && x.errorValidationMessage, getFeedbackTemplate('error', context)), when(x => x.successText, getFeedbackTemplate('success', context)));
90
106
  };
91
107
 
92
- const tooltipDefinition = Tooltip.compose({
93
- baseName: 'tooltip',
94
- template: TooltipTemplate,
95
- styles: css_248z
108
+ const textFieldDefinition = TextField.compose({
109
+ baseName: 'text-field',
110
+ template: TextfieldTemplate,
111
+ styles: css_248z,
112
+ shadowOptions: {
113
+ delegatesFocus: true
114
+ }
96
115
  });
97
- const tooltipRegistries = [tooltipDefinition(), ...popupRegistries];
98
- const registerTooltip = registerFactory(tooltipRegistries);
116
+ const textFieldRegistries = [textFieldDefinition(), ...iconRegistries, ...focusRegistries];
117
+ const registerTextField = registerFactory(textFieldRegistries);
99
118
 
100
- export { tooltipRegistries as a, registerTooltip as r, tooltipDefinition as t };
119
+ export { textFieldRegistries as a, registerTextField as r, textFieldDefinition as t };