@vonage/vivid 3.3.0 → 3.4.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 (128) hide show
  1. package/custom-elements.json +337 -1
  2. package/data-grid/index.js +7 -1047
  3. package/dialog/index.js +1 -1
  4. package/divider/index.js +1 -1
  5. package/fab/index.js +1 -1
  6. package/header/index.js +1 -1
  7. package/index.d.ts +1 -0
  8. package/index.js +32 -31
  9. package/layout/index.js +1 -1
  10. package/lib/accordion/definition.d.ts +1 -0
  11. package/lib/action-group/action-group.d.ts +1 -2
  12. package/lib/action-group/definition.d.ts +1 -0
  13. package/lib/avatar/avatar.d.ts +2 -3
  14. package/lib/avatar/definition.d.ts +1 -0
  15. package/lib/badge/badge.d.ts +3 -4
  16. package/lib/badge/definition.d.ts +1 -0
  17. package/lib/banner/definition.d.ts +1 -0
  18. package/lib/button/button.d.ts +3 -4
  19. package/lib/button/definition.d.ts +1 -0
  20. package/lib/calendar-event/calendar-event.d.ts +2 -3
  21. package/lib/calendar-event/definition.d.ts +1 -0
  22. package/lib/combobox/combobox.d.ts +1 -2
  23. package/lib/combobox/definition.d.ts +1 -0
  24. package/lib/components.d.ts +1 -0
  25. package/lib/dialog/definition.d.ts +1 -0
  26. package/lib/dialog/dialog.d.ts +1 -2
  27. package/lib/fab/definition.d.ts +1 -0
  28. package/lib/fab/fab.d.ts +1 -2
  29. package/lib/icon/definition.d.ts +1 -0
  30. package/lib/icon/icon.d.ts +1 -2
  31. package/lib/layout/definition.d.ts +1 -0
  32. package/lib/layout/layout.d.ts +3 -4
  33. package/lib/listbox/definition.d.ts +1 -0
  34. package/lib/menu/definition.d.ts +1 -0
  35. package/lib/note/definition.d.ts +1 -0
  36. package/lib/number-field/definition.d.ts +1 -0
  37. package/lib/number-field/number-field.d.ts +2 -3
  38. package/lib/popup/definition.d.ts +2 -0
  39. package/lib/progress/definition.d.ts +1 -0
  40. package/lib/progress-ring/definition.d.ts +1 -0
  41. package/lib/select/definition.d.ts +1 -0
  42. package/lib/select/select.d.ts +2 -3
  43. package/lib/switch/definition.d.ts +1 -0
  44. package/lib/text-area/definition.d.ts +1 -0
  45. package/lib/text-area/text-area.d.ts +1 -2
  46. package/lib/text-field/definition.d.ts +1 -0
  47. package/lib/text-field/text-field.d.ts +2 -3
  48. package/listbox/index.js +1 -1
  49. package/menu/index.js +2 -2
  50. package/menu-item/index.js +1 -1
  51. package/nav/index.js +1 -1
  52. package/nav-disclosure/index.js +1 -1
  53. package/nav-item/index.js +1 -1
  54. package/note/index.js +1 -1
  55. package/number-field/index.js +2 -2
  56. package/package.json +1 -1
  57. package/progress/index.js +1 -1
  58. package/progress-ring/index.js +1 -1
  59. package/radio/index.js +1 -1
  60. package/radio-group/index.js +1 -1
  61. package/select/index.js +1 -1
  62. package/shared/definition.js +1 -1
  63. package/shared/definition11.js +1 -1
  64. package/shared/definition12.js +1 -1
  65. package/shared/definition13.js +1 -1
  66. package/shared/definition14.js +1 -1
  67. package/shared/definition16.js +1 -1
  68. package/shared/definition17.js +1 -1
  69. package/shared/definition18.js +2 -2
  70. package/shared/definition19.js +1 -1
  71. package/shared/definition2.js +1 -1
  72. package/shared/definition20.js +1035 -203
  73. package/shared/definition21.js +206 -67
  74. package/shared/definition22.js +68 -77
  75. package/shared/definition23.js +76 -47
  76. package/shared/definition24.js +46 -32
  77. package/shared/definition25.js +35 -49
  78. package/shared/definition26.js +48 -338
  79. package/shared/definition27.js +267 -282
  80. package/shared/definition28.js +356 -14
  81. package/shared/definition29.js +13 -67
  82. package/shared/definition30.js +65 -21
  83. package/shared/definition31.js +21 -39
  84. package/shared/definition32.js +31 -432
  85. package/shared/definition33.js +432 -76
  86. package/shared/definition34.js +76 -59
  87. package/shared/definition35.js +67 -35
  88. package/shared/definition36.js +31 -422
  89. package/shared/definition37.js +357 -560
  90. package/shared/definition38.js +624 -74
  91. package/shared/definition39.js +70 -573
  92. package/shared/definition4.js +1 -1
  93. package/shared/definition40.js +527 -81
  94. package/shared/definition41.js +127 -47
  95. package/shared/definition42.js +51 -16
  96. package/shared/definition43.js +17 -425
  97. package/shared/definition44.js +367 -209
  98. package/shared/definition45.js +248 -85
  99. package/shared/definition46.js +110 -68
  100. package/shared/definition47.js +65 -67
  101. package/shared/definition48.js +69 -295
  102. package/shared/definition49.js +305 -0
  103. package/shared/definition5.js +1 -1
  104. package/shared/definition6.js +1 -1
  105. package/shared/definition7.js +1 -1
  106. package/shared/definition8.js +1 -1
  107. package/shared/definition9.js +1 -1
  108. package/shared/enums.js +1 -1
  109. package/shared/form-elements.js +1 -1
  110. package/shared/patterns/form-elements/form-elements.d.ts +2 -2
  111. package/shared/text-field.js +1 -1
  112. package/side-drawer/index.js +1 -1
  113. package/slider/index.js +1 -1
  114. package/styles/core/all.css +1 -1
  115. package/styles/core/theme.css +1 -1
  116. package/styles/core/typography.css +1 -1
  117. package/styles/tokens/theme-dark.css +4 -4
  118. package/styles/tokens/theme-light.css +4 -4
  119. package/switch/index.js +1 -1
  120. package/tab/index.js +1 -1
  121. package/tab-panel/index.js +1 -1
  122. package/tabs/index.js +3 -3
  123. package/text-area/index.js +1 -1
  124. package/text-field/index.js +1 -1
  125. package/tooltip/index.js +1 -1
  126. package/tree-item/index.js +1 -1
  127. package/tree-view/index.js +1 -1
  128. package/vivid.api.json +4526 -336
@@ -1,78 +1,217 @@
1
- import { F as FoundationElement, _ as __decorate, a as attr, h as html, r as registerFactory } from './index.js';
2
- import { O as Orientation } from './aria.js';
1
+ import { F as FoundationElement, U as __classPrivateFieldGet, _ as __decorate, a as attr, b as __metadata, a5 as __classPrivateFieldSet, h as html, r as registerFactory } from './index.js';
2
+ import { i as iconRegistries } from './definition3.js';
3
+ import { B as Button, b as buttonRegistries } from './definition9.js';
4
+ import { E as Elevation, e as elevationRegistries } from './definition15.js';
5
+ import { I as Icon } from './icon.js';
6
+ import { w as when } from './when.js';
3
7
  import { c as classNames } from './class-names.js';
4
8
 
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
- };
9
+ var css_248z$1 = "dialog {\n position: absolute;\n left: 0; right: 0;\n width: -moz-fit-content;\n width: -webkit-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: -webkit-fit-content;\n height: fit-content;\n margin: auto;\n border: solid;\n padding: 1em;\n background: white;\n color: black;\n display: block;\n}\n\ndialog:not([open]) {\n display: none;\n}\n\ndialog + .backdrop {\n position: fixed;\n top: 0; right: 0; bottom: 0; left: 0;\n background: rgba(0,0,0,0.1);\n}\n\n._dialog_overlay {\n position: fixed;\n top: 0; right: 0; bottom: 0; left: 0;\n}\n\ndialog.fixed {\n position: fixed;\n top: 50%;\n transform: translate(0, -50%);\n}";
10
+
11
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 16 Mar 2023 08:36:16 GMT\n */\n.base {\n box-sizing: border-box;\n padding: 0;\n border: none;\n background: var(--_elevation-fill);\n border-radius: 6px;\n color: var(--vvd-color-canvas-text);\n max-block-size: var(--dialog-max-block-size, calc(100vh - 64px));\n max-inline-size: var(--dialog-max-inline-size, --_dialog-default-max-inline-size);\n min-inline-size: var(--dialog-min-inline-size, 280px);\n}\n@media not all and (min-width: 600px) {\n .base {\n --_dialog-default-max-inline-size: 90vw;\n }\n}\n@media (min-width: 600px) {\n .base {\n --_dialog-default-max-inline-size: 560px;\n }\n}\n.base:not(.modal) {\n z-index: var(--dialog-z-index, 1);\n}\n.base.modal::backdrop {\n background-color: var(--vvd-color-canvas-text, currentColor);\n opacity: 0.5;\n}\n\n.main-wrapper {\n display: flex;\n flex-direction: column;\n padding: 24px;\n gap: 12px;\n}\n\n.header {\n display: grid;\n align-items: flex-start;\n justify-content: space-between;\n inline-size: 100%;\n}\n.base:not(.icon-placement-side) .header {\n grid-template-columns: 1fr auto;\n grid-template-rows: auto auto auto;\n}\n.base:not(.icon-placement-side) .header .icon {\n font-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8));\n grid-column: 1/2;\n grid-row: 1/2;\n line-height: 1;\n margin-block-end: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n}\n.base.icon-placement-side .header {\n grid-template-columns: auto 1fr auto;\n grid-template-rows: auto auto;\n}\n.base.icon-placement-side .header .icon {\n font-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 12));\n}\n.base.icon-placement-side .header ::slotted(*),\n.base.icon-placement-side .header .icon {\n grid-column: 1/2;\n grid-row: 1/-1;\n margin-inline-end: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8)) / 2);\n}\n\n.dismiss-button {\n flex-shrink: 0;\n grid-column: -2/-1;\n grid-row: 1/-1;\n margin-block-start: -8px;\n margin-inline-end: -8px;\n margin-inline-start: 4px;\n}\n\n.headline {\n font: var(--vvd-typography-heading-4);\n}\n\n.subtitle {\n font: var(--vvd-typography-base);\n}\n\nslot[name=main] {\n display: block;\n overflow: hidden auto;\n max-width: inherit;\n max-height: inherit;\n}";
19
12
 
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;
13
+ var _Dialog_instances, _Dialog_modal, _Dialog_dialogElement, _Dialog_dialog_get, _Dialog_handleScrimClick, _Dialog_handleInternalFormSubmit, _Dialog_handleModal;
14
+ let dialogPolyfill;
15
+ (async () => {
16
+ if (!HTMLDialogElement || !HTMLDialogElement.prototype.showModal) {
17
+ delete window.HTMLDialogElement;
18
+ dialogPolyfill = await import('./dialog-polyfill.esm.js');
19
+ }
20
+ })();
21
+ class Dialog extends FoundationElement {
22
+ constructor() {
23
+ super(...arguments);
24
+ _Dialog_instances.add(this);
25
+ this.open = false;
26
+ this.ariaLabelledBy = null;
27
+ this.ariaLabel = null;
28
+ this.ariaDescribedBy = null;
29
+ _Dialog_modal.set(this, false);
30
+ _Dialog_dialogElement.set(this, void 0);
31
+ _Dialog_handleScrimClick.set(this, event => {
32
+ if (event.target !== __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get)) {
33
+ return;
34
+ }
35
+ const rect = __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).getBoundingClientRect();
36
+ const clickedInDialog = rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width;
37
+ this.open = clickedInDialog;
38
+ });
39
+ _Dialog_handleInternalFormSubmit.set(this, event => {
40
+ if (event.target.method !== 'dialog') {
41
+ return;
42
+ }
43
+ this.open = false;
44
+ });
45
+ }
46
+ set returnValue(value) {
47
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).returnValue = value;
48
+ }
49
+ get returnValue() {
50
+ var _a;
51
+ return (_a = __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get)) === null || _a === void 0 ? void 0 : _a.returnValue;
52
+ }
53
+ get modal() {
54
+ return __classPrivateFieldGet(this, _Dialog_modal, "f");
55
+ }
56
+ openChanged(oldValue, newValue) {
57
+ if (oldValue === undefined) {
58
+ return;
59
+ }
60
+ if (!newValue) {
61
+ this.close();
62
+ } else {
63
+ if (__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get)) {
64
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).open = true;
65
+ }
66
+ }
67
+ }
68
+ close() {
69
+ if (__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).open) {
70
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).close();
71
+ this.$emit('close', this.returnValue, {
72
+ bubbles: false
73
+ });
45
74
  }
75
+ this.open = false;
76
+ __classPrivateFieldGet(this, _Dialog_instances, "m", _Dialog_handleModal).call(this, false);
77
+ }
78
+ show() {
79
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).show();
80
+ this.open = true;
81
+ }
82
+ showModal() {
83
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).showModal();
84
+ this.open = true;
85
+ __classPrivateFieldGet(this, _Dialog_instances, "m", _Dialog_handleModal).call(this, true);
86
+ }
87
+ connectedCallback() {
88
+ super.connectedCallback();
89
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).addEventListener('click', __classPrivateFieldGet(this, _Dialog_handleScrimClick, "f"));
90
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).addEventListener('submit', __classPrivateFieldGet(this, _Dialog_handleInternalFormSubmit, "f"));
91
+ }
92
+ disconnectedCallback() {
93
+ super.disconnectedCallback();
94
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).removeEventListener('click', __classPrivateFieldGet(this, _Dialog_handleScrimClick, "f"));
95
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).removeEventListener('submit', __classPrivateFieldGet(this, _Dialog_handleInternalFormSubmit, "f"));
96
+ }
46
97
  }
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 Wed, 08 Mar 2023 09:27:51 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 {}
98
+ _Dialog_modal = new WeakMap(), _Dialog_dialogElement = new WeakMap(), _Dialog_handleScrimClick = new WeakMap(), _Dialog_handleInternalFormSubmit = new WeakMap(), _Dialog_instances = new WeakSet(), _Dialog_dialog_get = function _Dialog_dialog_get() {
99
+ if (!__classPrivateFieldGet(this, _Dialog_dialogElement, "f")) {
100
+ __classPrivateFieldSet(this, _Dialog_dialogElement, this.shadowRoot.querySelector('dialog'), "f");
101
+ if (__classPrivateFieldGet(this, _Dialog_dialogElement, "f")) {
102
+ __classPrivateFieldGet(this, _Dialog_dialogElement, "f").open = this.open;
103
+ if (dialogPolyfill) {
104
+ dialogPolyfill.registerDialog(__classPrivateFieldGet(this, _Dialog_dialogElement, "f"));
105
+ }
106
+ }
107
+ }
108
+ return __classPrivateFieldGet(this, _Dialog_dialogElement, "f");
109
+ }, _Dialog_handleModal = function _Dialog_handleModal(show) {
110
+ __classPrivateFieldSet(this, _Dialog_modal, show, "f");
111
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).toggleAttribute('aria-modal', show);
112
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).classList.toggle('modal', show);
113
+ };
114
+ __decorate([attr({
115
+ mode: 'boolean'
116
+ }), __metadata("design:type", Object)], Dialog.prototype, "open", void 0);
117
+ __decorate([attr, __metadata("design:type", String)], Dialog.prototype, "icon", void 0);
118
+ __decorate([attr({
119
+ attribute: 'icon-placement'
120
+ }), __metadata("design:type", String)], Dialog.prototype, "iconPlacement", void 0);
121
+ __decorate([attr, __metadata("design:type", String)], Dialog.prototype, "subtitle", void 0);
122
+ __decorate([attr, __metadata("design:type", String)], Dialog.prototype, "headline", void 0);
123
+ __decorate([attr({
124
+ attribute: 'aria-labelledby'
125
+ }), __metadata("design:type", Object)], Dialog.prototype, "ariaLabelledBy", void 0);
126
+ __decorate([attr({
127
+ attribute: 'aria-label'
128
+ }), __metadata("design:type", Object)], Dialog.prototype, "ariaLabel", void 0);
129
+ __decorate([attr({
130
+ attribute: 'aria-describedby'
131
+ }), __metadata("design:type", Object)], Dialog.prototype, "ariaDescribedBy", void 0);
57
132
 
58
133
  let _ = t => t,
59
- _t;
134
+ _t,
135
+ _t2,
136
+ _t3,
137
+ _t4,
138
+ _t5;
60
139
  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);
140
+ iconPlacement
141
+ }) => classNames('base', [`icon-placement-${iconPlacement}`, Boolean(iconPlacement)]);
142
+ function icon(iconTag) {
143
+ return html(_t || (_t = _`
144
+ <${0} class="icon" name="${0}"></${0}>
145
+ `), iconTag, x => x.icon, iconTag);
146
+ }
147
+ function headline() {
148
+ return html(_t2 || (_t2 = _`
149
+ <div class="headline">
150
+ ${0}
151
+ </div>
152
+ `), x => x.headline);
153
+ }
154
+ function subtitle() {
155
+ return html(_t3 || (_t3 = _`
156
+ <div class="subtitle">
157
+ ${0}
158
+ </div>
159
+ `), x => x.subtitle);
160
+ }
161
+ function renderDismissButton(buttonTag) {
162
+ return html(_t4 || (_t4 = _`
163
+ <${0}
164
+ size="condensed"
165
+ class="dismiss-button"
166
+ icon="close-line"
167
+ @click="${0}">
168
+ </${0}>`), buttonTag, x => {
169
+ x.open = false;
170
+ }, buttonTag);
171
+ }
172
+ function handleEscapeKey(dialog, event) {
173
+ if (event.key === 'Escape' && dialog.modal) {
174
+ dialog.open = false;
175
+ }
176
+ return true;
177
+ }
178
+ const DialogTemplate = context => {
179
+ const elevationTag = context.tagFor(Elevation);
180
+ const iconTag = context.tagFor(Icon);
181
+ const buttonTag = context.tagFor(Button);
182
+ return html(_t5 || (_t5 = _`
183
+ <${0} dp="12">
184
+ <dialog class="${0}"
185
+ @keydown="${0}"
186
+ returnValue="${0}"
187
+ aria-labelledby="${0}"
188
+ aria-label="${0}"
189
+ aria-describedby="${0}"
190
+ >
191
+ <slot name="main">
192
+ <div class="main-wrapper">
193
+ <div class="header">
194
+ <slot name="graphic">
195
+ ${0}
196
+ </slot>
197
+ ${0}
198
+ ${0}
199
+ ${0}
200
+ </div>
201
+ <slot name="body"></slot>
202
+ <slot name="footer"></slot>
203
+ </div>
204
+ </slot>
205
+ </dialog>
206
+ </${0}>`), elevationTag, getClasses, (x, c) => handleEscapeKey(x, c.event), x => x.returnValue, x => x.ariaLabelledBy, x => x.ariaLabel, x => x.ariaDescribedBy, when(x => x.icon, icon(iconTag)), when(x => x.headline, headline()), when(x => x.subtitle, subtitle()), renderDismissButton(buttonTag), elevationTag);
207
+ };
69
208
 
70
- const dividerDefinition = Divider.compose({
71
- baseName: 'divider',
72
- template: DividerTemplate,
73
- styles: css_248z
209
+ const dialogDefinition = Dialog.compose({
210
+ baseName: 'dialog',
211
+ template: DialogTemplate,
212
+ styles: [css_248z, css_248z$1]
74
213
  });
75
- const dividerRegistries = [dividerDefinition()];
76
- const registerDivider = registerFactory(dividerRegistries);
214
+ const dialogRegistries = [dialogDefinition(), ...iconRegistries, ...buttonRegistries, ...elevationRegistries];
215
+ const registerDialog = registerFactory(dialogRegistries);
77
216
 
78
- export { Divider as D, dividerDefinition as a, dividerRegistries as d, registerDivider as r };
217
+ export { dialogRegistries as a, dialogDefinition as d, registerDialog as r };
@@ -1,87 +1,78 @@
1
- import { _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactory } from './index.js';
2
- import { i as iconRegistries } from './definition3.js';
3
- import { f as focusRegistries } from './definition4.js';
4
- import { A as AffixIconWithTrailing, a as affixIconTemplateFactory } from './affix.js';
5
- import { B as Button } from './button.js';
6
- import { a as applyMixins } from './apply-mixins.js';
7
- import { f as focusTemplateFactory } from './focus2.js';
8
- import { r as ref } from './ref.js';
1
+ import { F as FoundationElement, _ as __decorate, a as attr, h as html, r as registerFactory } from './index.js';
2
+ import { O as Orientation } from './aria.js';
9
3
  import { c as classNames } from './class-names.js';
10
4
 
11
- var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 08 Mar 2023 09:27:51 GMT\n */\n.control {\n position: relative;\n display: inline-flex;\n box-sizing: border-box;\n align-items: center;\n border: 0 none;\n background: var(--_appearance-color-fill, var(--_elevation-fill));\n block-size: var(--_fab-block-size);\n border-radius: var(--_fab-border-radius);\n color: var(--_appearance-color-text, var(--vvd-color-canvas-text));\n column-gap: var(--fab-icon-gap);\n filter: var(--_elevation-shadow);\n font: var(--vvd-typography-base-bold);\n transition: background-color 0.15s linear, filter 0.15s linear;\n vertical-align: middle;\n /* Size */\n}\n.control.connotation-accent {\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}\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}\n.control {\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:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\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(:disabled, .disabled) {\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(:active, .active):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-fierce);\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.size-expanded {\n --_fab-border-radius: 30px;\n --_fab-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 16));\n}\n.control:not(.size-expanded) {\n --_fab-border-radius: 24px;\n --_fab-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}\n.control.icon-only {\n border-radius: 50%;\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(--_fab-block-size);\n }\n}\n.control:not(.icon-only) {\n --fab-icon-gap: 10px;\n padding-inline: 20px;\n}\n.control:disabled {\n --_elevation-fill: var(--vvd-color-surface-0dp);\n --_elevation-shadow: var(--vvd-shadow-surface-0dp);\n cursor: not-allowed;\n}\n.control:not(:disabled) {\n --_elevation-fill: var(--vvd-color-surface-4dp);\n --_elevation-shadow: var(--vvd-shadow-surface-4dp);\n cursor: pointer;\n}\n.control:not(:disabled):hover {\n --_elevation-fill: var(--vvd-color-surface-12dp);\n --_elevation-shadow: var(--vvd-shadow-surface-12dp);\n}\n.control:not(:disabled):active {\n --_elevation-fill: var(--vvd-color-surface-24dp);\n --_elevation-shadow: var(--vvd-shadow-surface-24dp);\n}\n\n/* Icon */\n.icon {\n line-height: 1;\n}\n.icon-trailing .icon {\n order: 1;\n}\n.control.size-extended .icon {\n font-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 16)) / 2.3333);\n}\n.control:not(.size-extended) .icon {\n font-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) / 2);\n}\n\n:not(:focus-visible) .focus-indicator {\n display: none;\n}";
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);
12
53
 
13
- class Fab extends Button {}
14
- __decorate([attr, __metadata("design:type", String)], Fab.prototype, "connotation", void 0);
15
- __decorate([attr, __metadata("design:type", String)], Fab.prototype, "size", void 0);
16
- __decorate([attr, __metadata("design:type", String)], Fab.prototype, "label", void 0);
17
- applyMixins(Fab, AffixIconWithTrailing);
54
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 16 Mar 2023 08:36:16 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 {}
18
57
 
19
58
  let _ = t => t,
20
59
  _t;
21
60
  const getClasses = ({
22
- connotation,
23
- size,
24
- icon,
25
- label,
26
- iconTrailing,
27
- disabled
28
- }) => classNames('control', [`connotation-${connotation}`, Boolean(connotation)], [`size-${size}`, Boolean(size)], ['icon-only', !label && !!icon], ['icon-trailing', iconTrailing], ['disabled', disabled]);
29
- const FabTemplate = context => {
30
- const affixIconTemplate = affixIconTemplateFactory(context);
31
- const focusTemplate = focusTemplateFactory(context);
32
- return html(_t || (_t = _`
33
- <button
34
- class="${0} "
35
- ?autofocus="${0}"
36
- ?disabled="${0}"
37
- form="${0}"
38
- formaction="${0}"
39
- formenctype="${0}"
40
- formmethod="${0}"
41
- formnovalidate="${0}"
42
- formtarget="${0}"
43
- name="${0}"
44
- type="${0}"
45
- value="${0}"
46
- aria-atomic="${0}"
47
- aria-busy="${0}"
48
- aria-controls="${0}"
49
- aria-current="${0}"
50
- aria-describedby="${0}"
51
- aria-details="${0}"
52
- aria-disabled="${0}"
53
- aria-errormessage="${0}"
54
- aria-expanded="${0}"
55
- aria-flowto="${0}"
56
- aria-haspopup="${0}"
57
- aria-hidden="${0}"
58
- aria-invalid="${0}"
59
- aria-keyshortcuts="${0}"
60
- aria-label="${0}"
61
- aria-labelledby="${0}"
62
- aria-live="${0}"
63
- aria-owns="${0}"
64
- aria-pressed="${0}"
65
- aria-relevant="${0}"
66
- aria-roledescription="${0}"
67
- ${0}
68
- >
69
- ${0}
70
- ${0}
71
- ${0}
72
- </button>
73
- `), 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);
74
- };
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);
75
69
 
76
- const fabDefinition = Fab.compose({
77
- baseName: 'fab',
78
- template: FabTemplate,
79
- styles: css_248z,
80
- shadowOptions: {
81
- delegatesFocus: true
82
- }
70
+ const dividerDefinition = Divider.compose({
71
+ baseName: 'divider',
72
+ template: DividerTemplate,
73
+ styles: css_248z
83
74
  });
84
- const fabRegistries = [fabDefinition(), ...iconRegistries, ...focusRegistries];
85
- const registerFab = registerFactory(fabRegistries);
75
+ const dividerRegistries = [dividerDefinition()];
76
+ const registerDivider = registerFactory(dividerRegistries);
86
77
 
87
- export { fabRegistries as a, fabDefinition as f, registerFab as r };
78
+ export { Divider as D, dividerDefinition as a, dividerRegistries as d, registerDivider as r };
@@ -1,58 +1,87 @@
1
- import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactory } from './index.js';
2
- import { E as Elevation, e as elevationRegistries } from './definition15.js';
1
+ import { _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactory } from './index.js';
2
+ import { i as iconRegistries } from './definition3.js';
3
+ import { f as focusRegistries } from './definition4.js';
4
+ import { A as AffixIconWithTrailing, a as affixIconTemplateFactory } from './affix.js';
5
+ import { B as Button } from './button.js';
6
+ import { a as applyMixins } from './apply-mixins.js';
7
+ import { f as focusTemplateFactory } from './focus2.js';
8
+ import { r as ref } from './ref.js';
3
9
  import { c as classNames } from './class-names.js';
4
10
 
5
- var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 08 Mar 2023 09:27:51 GMT\n */\n.base {\n z-index: 1;\n block-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) + calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16)));\n font: var(--vvd-typography-heading-4);\n inline-size: 100%;\n}\n.base .header-content {\n display: inline-flex;\n align-items: center;\n column-gap: 4px;\n}\n\n.container {\n display: flex;\n box-sizing: border-box;\n justify-content: space-between;\n block-size: inherit;\n color: var(--vvd-color-canvas-text);\n column-gap: 12px;\n padding-block: 8px;\n padding-inline: 16px;\n}\n.container[part~=vvd-theme-alternate] {\n background-color: var(--vvd-color-canvas);\n color: var(--vvd-color-canvas-text);\n color-scheme: var(--vvd-color-scheme);\n}\n\n.app-content {\n --vvd-header-block-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) + calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16)));\n}";
11
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 16 Mar 2023 08:36:16 GMT\n */\n.control {\n position: relative;\n display: inline-flex;\n box-sizing: border-box;\n align-items: center;\n border: 0 none;\n background: var(--_appearance-color-fill, var(--_elevation-fill));\n block-size: var(--_fab-block-size);\n border-radius: var(--_fab-border-radius);\n color: var(--_appearance-color-text, var(--vvd-color-canvas-text));\n column-gap: var(--fab-icon-gap);\n filter: var(--_elevation-shadow);\n font: var(--vvd-typography-base-bold);\n transition: background-color 0.15s linear, filter 0.15s linear;\n vertical-align: middle;\n /* Size */\n}\n.control.connotation-accent {\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}\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}\n.control {\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:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\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(:disabled, .disabled) {\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(:active, .active):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-fierce);\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.size-expanded {\n --_fab-border-radius: 30px;\n --_fab-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 16));\n}\n.control:not(.size-expanded) {\n --_fab-border-radius: 24px;\n --_fab-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}\n.control.icon-only {\n border-radius: 50%;\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(--_fab-block-size);\n }\n}\n.control:not(.icon-only) {\n --fab-icon-gap: 10px;\n padding-inline: 20px;\n}\n.control:disabled {\n --_elevation-fill: var(--vvd-color-surface-0dp);\n --_elevation-shadow: var(--vvd-shadow-surface-0dp);\n cursor: not-allowed;\n}\n.control:not(:disabled) {\n --_elevation-fill: var(--vvd-color-surface-4dp);\n --_elevation-shadow: var(--vvd-shadow-surface-4dp);\n cursor: pointer;\n}\n.control:not(:disabled):hover {\n --_elevation-fill: var(--vvd-color-surface-12dp);\n --_elevation-shadow: var(--vvd-shadow-surface-12dp);\n}\n.control:not(:disabled):active {\n --_elevation-fill: var(--vvd-color-surface-24dp);\n --_elevation-shadow: var(--vvd-shadow-surface-24dp);\n}\n\n/* Icon */\n.icon {\n line-height: 1;\n}\n.icon-trailing .icon {\n order: 1;\n}\n.control.size-extended .icon {\n font-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 16)) / 2.3333);\n}\n.control:not(.size-extended) .icon {\n font-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) / 2);\n}\n\n:not(:focus-visible) .focus-indicator {\n display: none;\n}";
6
12
 
7
- class Header extends FoundationElement {
8
- constructor() {
9
- super(...arguments);
10
- this.elevationShadow = false;
11
- this.alternate = false;
12
- }
13
- }
14
- __decorate([attr({
15
- attribute: 'elevation-shadow',
16
- mode: 'boolean'
17
- }), __metadata("design:type", Object)], Header.prototype, "elevationShadow", void 0);
18
- __decorate([attr({
19
- mode: 'boolean'
20
- }), __metadata("design:type", Object)], Header.prototype, "alternate", void 0);
13
+ class Fab extends Button {}
14
+ __decorate([attr, __metadata("design:type", String)], Fab.prototype, "connotation", void 0);
15
+ __decorate([attr, __metadata("design:type", String)], Fab.prototype, "size", void 0);
16
+ __decorate([attr, __metadata("design:type", String)], Fab.prototype, "label", void 0);
17
+ applyMixins(Fab, AffixIconWithTrailing);
21
18
 
22
19
  let _ = t => t,
23
20
  _t;
24
- const getPartAlternate = ({
25
- alternate
26
- }) => classNames(['vvd-theme-alternate', Boolean(alternate)]);
27
- const headerTemplate = context => {
28
- const elevationTag = context.tagFor(Elevation);
21
+ const getClasses = ({
22
+ connotation,
23
+ size,
24
+ icon,
25
+ label,
26
+ iconTrailing,
27
+ disabled
28
+ }) => classNames('control', [`connotation-${connotation}`, Boolean(connotation)], [`size-${size}`, Boolean(size)], ['icon-only', !label && !!icon], ['icon-trailing', iconTrailing], ['disabled', disabled]);
29
+ const FabTemplate = context => {
30
+ const affixIconTemplate = affixIconTemplateFactory(context);
31
+ const focusTemplate = focusTemplateFactory(context);
29
32
  return html(_t || (_t = _`
30
- <${0} dp="4" ?no-shadow=${0}>
31
- <header class="base" part="base">
32
- <!-- a container is needed to distinguish the surface background color of the
33
- element from its shadow when applying elevation with alternate -->
34
- <div class="container" part="${0}">
35
- <section class="header-content">
36
- <slot></slot>
37
- </section>
38
- <section class="header-content">
39
- <slot name="action-items"></slot>
40
- </section>
41
- </div>
42
- </header>
43
- </${0}>
44
- <div class="app-content">
45
- <slot name="app-content"></slot>
46
- </div>
47
- `), elevationTag, x => !x.elevationShadow, getPartAlternate, elevationTag);
33
+ <button
34
+ class="${0} "
35
+ ?autofocus="${0}"
36
+ ?disabled="${0}"
37
+ form="${0}"
38
+ formaction="${0}"
39
+ formenctype="${0}"
40
+ formmethod="${0}"
41
+ formnovalidate="${0}"
42
+ formtarget="${0}"
43
+ name="${0}"
44
+ type="${0}"
45
+ value="${0}"
46
+ aria-atomic="${0}"
47
+ aria-busy="${0}"
48
+ aria-controls="${0}"
49
+ aria-current="${0}"
50
+ aria-describedby="${0}"
51
+ aria-details="${0}"
52
+ aria-disabled="${0}"
53
+ aria-errormessage="${0}"
54
+ aria-expanded="${0}"
55
+ aria-flowto="${0}"
56
+ aria-haspopup="${0}"
57
+ aria-hidden="${0}"
58
+ aria-invalid="${0}"
59
+ aria-keyshortcuts="${0}"
60
+ aria-label="${0}"
61
+ aria-labelledby="${0}"
62
+ aria-live="${0}"
63
+ aria-owns="${0}"
64
+ aria-pressed="${0}"
65
+ aria-relevant="${0}"
66
+ aria-roledescription="${0}"
67
+ ${0}
68
+ >
69
+ ${0}
70
+ ${0}
71
+ ${0}
72
+ </button>
73
+ `), 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);
48
74
  };
49
75
 
50
- const headerDefinition = Header.compose({
51
- baseName: 'header',
52
- template: headerTemplate,
53
- styles: css_248z
76
+ const fabDefinition = Fab.compose({
77
+ baseName: 'fab',
78
+ template: FabTemplate,
79
+ styles: css_248z,
80
+ shadowOptions: {
81
+ delegatesFocus: true
82
+ }
54
83
  });
55
- const headerRegistries = [headerDefinition(), ...elevationRegistries];
56
- const registerHeader = registerFactory(headerRegistries);
84
+ const fabRegistries = [fabDefinition(), ...iconRegistries, ...focusRegistries];
85
+ const registerFab = registerFactory(fabRegistries);
57
86
 
58
- export { headerRegistries as a, headerDefinition as h, registerHeader as r };
87
+ export { fabRegistries as a, fabDefinition as f, registerFab as r };