@vonage/vivid 3.0.0-next.8 → 3.0.0-next.80
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.
- package/README.md +141 -4
- package/accordion/index.js +2 -4
- package/accordion-item/index.js +26 -20
- package/action-group/index.js +47 -0
- package/avatar/index.js +70 -0
- package/badge/index.js +17 -21
- package/banner/index.js +23 -87
- package/breadcrumb/index.js +21 -18
- package/breadcrumb-item/index.js +19 -12
- package/button/index.js +19 -757
- package/calendar/index.js +67 -25
- package/calendar-event/index.js +115 -0
- package/card/index.js +132 -0
- package/checkbox/index.js +184 -0
- package/dialog/index.js +281 -0
- package/divider/index.js +3 -0
- package/elevation/index.js +3 -31
- package/fab/index.js +105 -0
- package/focus/index.js +18 -3
- package/header/index.js +66 -0
- package/icon/index.js +9 -5
- package/index.js +53 -20
- package/layout/index.js +4 -6
- package/lib/accordion-item/accordion-item.d.ts +2 -2
- package/lib/accordion-item/index.d.ts +2 -1
- package/lib/action-group/action-group.d.ts +10 -0
- package/lib/{sidenav-item/sidenav-item.template.d.ts → action-group/action-group.template.d.ts} +2 -2
- package/lib/{sidenav-item → action-group}/index.d.ts +1 -2
- package/lib/avatar/avatar.d.ts +15 -0
- package/lib/avatar/avatar.template.d.ts +4 -0
- package/lib/avatar/index.d.ts +3 -0
- package/lib/badge/badge.d.ts +5 -5
- package/lib/badge/index.d.ts +1 -1
- package/lib/banner/banner.d.ts +1 -1
- package/lib/banner/banner.template.d.ts +0 -2
- package/lib/banner/index.d.ts +1 -0
- package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
- package/lib/breadcrumb-item/index.d.ts +1 -0
- package/lib/button/button.d.ts +6 -5
- package/lib/button/index.d.ts +2 -19
- package/lib/calendar/calendar.d.ts +3 -1
- package/lib/calendar/index.d.ts +0 -1
- package/lib/calendar-event/calendar-event.d.ts +14 -0
- package/lib/calendar-event/calendar-event.template.d.ts +4 -0
- package/lib/calendar-event/index.d.ts +2 -0
- package/lib/card/card.d.ts +10 -0
- package/lib/{text/text.template.d.ts → card/card.template.d.ts} +2 -2
- package/lib/card/index.d.ts +4 -0
- package/lib/checkbox/checkbox.d.ts +5 -0
- package/lib/checkbox/checkbox.template.d.ts +4 -0
- package/lib/checkbox/index.d.ts +4 -0
- package/lib/components.d.ts +27 -10
- package/lib/dialog/dialog.d.ts +20 -0
- package/lib/dialog/dialog.template.d.ts +4 -0
- package/lib/dialog/index.d.ts +5 -0
- package/lib/divider/divider.d.ts +3 -0
- package/lib/divider/divider.template.d.ts +4 -0
- package/lib/divider/index.d.ts +2 -0
- package/lib/elevation/elevation.d.ts +1 -0
- package/lib/elevation/index.d.ts +1 -1
- package/lib/enums.d.ts +11 -6
- package/lib/fab/fab.d.ts +13 -0
- package/lib/fab/fab.template.d.ts +4 -0
- package/lib/fab/index.d.ts +4 -0
- package/lib/focus/index.d.ts +1 -1
- package/lib/header/header.d.ts +5 -0
- package/lib/header/header.template.d.ts +4 -0
- package/lib/header/index.d.ts +3 -0
- package/lib/icon/icon.d.ts +4 -3
- package/lib/layout/index.d.ts +1 -1
- package/lib/layout/layout.d.ts +3 -3
- package/lib/menu/index.d.ts +12 -0
- package/lib/menu/menu.d.ts +10 -0
- package/lib/menu/menu.template.d.ts +3 -0
- package/lib/menu-item/index.d.ts +3 -0
- package/lib/menu-item/menu-item.d.ts +7 -0
- package/lib/menu-item/menu-item.template.d.ts +5 -0
- package/lib/nav/index.d.ts +2 -0
- package/lib/nav/nav.d.ts +3 -0
- package/lib/nav/nav.template.d.ts +4 -0
- package/lib/nav-disclosure/index.d.ts +4 -0
- package/lib/nav-disclosure/nav-disclosure.d.ts +10 -0
- package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -0
- package/lib/nav-item/index.d.ts +4 -0
- package/lib/{sidenav-item/sidenav-item.d.ts → nav-item/nav-item.d.ts} +2 -2
- package/lib/nav-item/nav-item.template.d.ts +4 -0
- package/lib/{text → note}/index.d.ts +1 -1
- package/lib/note/note.d.ts +10 -0
- package/lib/note/note.template.d.ts +5 -0
- package/lib/number-field/index.d.ts +4 -0
- package/lib/number-field/number-field.d.ts +16 -0
- package/lib/number-field/number-field.template.d.ts +4 -0
- package/lib/popup/index.d.ts +1 -1
- package/lib/popup/popup.d.ts +2 -1
- package/lib/progress/progress.d.ts +1 -1
- package/lib/progress-ring/progress-ring.d.ts +2 -1
- package/lib/radio/index.d.ts +3 -0
- package/lib/radio/radio.d.ts +4 -0
- package/lib/radio/radio.template.d.ts +4 -0
- package/lib/side-drawer/index.d.ts +1 -1
- package/lib/side-drawer/side-drawer.d.ts +3 -2
- package/lib/text-anchor/text-anchor.d.ts +1 -1
- package/lib/text-area/index.d.ts +3 -0
- package/lib/text-area/text-area.d.ts +9 -0
- package/lib/text-area/text-area.template.d.ts +4 -0
- package/lib/text-field/index.d.ts +4 -0
- package/lib/text-field/text-field.d.ts +16 -0
- package/lib/text-field/text-field.template.d.ts +5 -0
- package/lib/tooltip/tooltip.d.ts +2 -2
- package/menu/index.js +381 -0
- package/menu-item/index.js +19 -0
- package/nav/index.js +17 -0
- package/nav-disclosure/index.js +88 -0
- package/nav-item/index.js +45 -0
- package/note/index.js +66 -0
- package/number-field/index.js +529 -0
- package/package.json +51 -7
- package/popup/index.js +23 -2061
- package/progress/index.js +35 -28
- package/progress-ring/index.js +9 -5
- package/radio/index.js +174 -0
- package/shared/anchor.js +10 -2
- package/shared/aria-global.js +2 -86
- package/shared/base-progress.js +5 -0
- package/shared/breadcrumb-item.js +1 -1
- package/shared/button.js +200 -0
- package/shared/calendar-event.js +26 -0
- package/shared/dialog-polyfill.esm.js +858 -0
- package/shared/enums.js +79 -0
- package/shared/es.object.assign.js +7 -6
- package/shared/export.js +995 -0
- package/shared/focus.js +5 -0
- package/shared/focus2.js +11 -0
- package/shared/form-associated.js +466 -0
- package/shared/form-elements.js +299 -0
- package/shared/icon.js +533 -520
- package/shared/index.js +71 -55
- package/shared/index2.js +110 -13
- package/shared/index3.js +35 -0
- package/shared/index4.js +86 -0
- package/shared/index5.js +2100 -0
- package/shared/index6.js +371 -0
- package/shared/iterators.js +61 -0
- package/shared/key-codes.js +90 -0
- package/shared/object-keys.js +13 -0
- package/shared/patterns/focus.d.ts +3 -0
- package/shared/patterns/form-elements.d.ts +22 -0
- package/shared/patterns/index.d.ts +1 -0
- package/shared/ref.js +41 -0
- package/shared/regexp-flags.js +21 -0
- package/shared/start-end.js +50 -0
- package/shared/text-anchor.js +2 -11
- package/shared/text-anchor.template.js +5 -2
- package/shared/to-string.js +51 -0
- package/shared/web.dom-collections.iterator.js +78 -1083
- package/side-drawer/index.js +44 -23
- package/styles/core/all.css +75 -0
- package/styles/core/theme.css +11 -0
- package/styles/core/typography.css +69 -0
- package/styles/fonts/SpeziaCompleteVariableItalicWeb.woff2 +0 -0
- package/styles/fonts/SpeziaCompleteVariableUprightWeb.woff2 +0 -0
- package/styles/fonts/SpeziaMonoCompleteVariableWeb.woff2 +0 -0
- package/styles/fonts/spezia.css +9 -12
- package/styles/tokens/theme-dark.css +211 -0
- package/styles/tokens/theme-light.css +211 -0
- package/text-anchor/index.js +9 -1
- package/text-area/index.js +304 -0
- package/text-field/index.js +152 -0
- package/tooltip/index.js +23 -16
- package/lib/text/text.d.ts +0 -10
- package/shared/style-inject.es.js +0 -28
- package/sidenav-item/index.js +0 -38
- package/styles/themes/dark.css +0 -205
- package/styles/themes/light.css +0 -205
- package/text/index.js +0 -45
package/button/index.js
CHANGED
|
@@ -1,761 +1,23 @@
|
|
|
1
1
|
import '../icon/index.js';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
import { a as applyMixins } from '../shared/apply-mixins.js';
|
|
7
|
-
import { A as ARIAGlobalStatesAndProperties, S as StartEnd, r as ref } from '../shared/aria-global.js';
|
|
8
|
-
import { s as styleInject } from '../shared/style-inject.es.js';
|
|
9
|
-
import { c as classNames } from '../shared/class-names.js';
|
|
2
|
+
import '../focus/index.js';
|
|
3
|
+
import '../shared/index.js';
|
|
4
|
+
export { v as vividButton } from '../shared/index2.js';
|
|
5
|
+
import '../shared/button.js';
|
|
10
6
|
import '../shared/icon.js';
|
|
7
|
+
import '../shared/export.js';
|
|
8
|
+
import '../shared/iterators.js';
|
|
9
|
+
import '../shared/to-string.js';
|
|
11
10
|
import '../shared/_has.js';
|
|
12
11
|
import '../shared/when.js';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
KeyCodes[KeyCodes["back"] = 8] = "back";
|
|
26
|
-
KeyCodes[KeyCodes["backSlash"] = 220] = "backSlash";
|
|
27
|
-
KeyCodes[KeyCodes["break"] = 19] = "break";
|
|
28
|
-
KeyCodes[KeyCodes["capsLock"] = 20] = "capsLock";
|
|
29
|
-
KeyCodes[KeyCodes["closeBracket"] = 221] = "closeBracket";
|
|
30
|
-
KeyCodes[KeyCodes["colon"] = 186] = "colon";
|
|
31
|
-
KeyCodes[KeyCodes["colon2"] = 59] = "colon2";
|
|
32
|
-
KeyCodes[KeyCodes["comma"] = 188] = "comma";
|
|
33
|
-
KeyCodes[KeyCodes["ctrl"] = 17] = "ctrl";
|
|
34
|
-
KeyCodes[KeyCodes["delete"] = 46] = "delete";
|
|
35
|
-
KeyCodes[KeyCodes["end"] = 35] = "end";
|
|
36
|
-
KeyCodes[KeyCodes["enter"] = 13] = "enter";
|
|
37
|
-
KeyCodes[KeyCodes["equals"] = 187] = "equals";
|
|
38
|
-
KeyCodes[KeyCodes["equals2"] = 61] = "equals2";
|
|
39
|
-
KeyCodes[KeyCodes["equals3"] = 107] = "equals3";
|
|
40
|
-
KeyCodes[KeyCodes["escape"] = 27] = "escape";
|
|
41
|
-
KeyCodes[KeyCodes["forwardSlash"] = 191] = "forwardSlash";
|
|
42
|
-
KeyCodes[KeyCodes["function1"] = 112] = "function1";
|
|
43
|
-
KeyCodes[KeyCodes["function10"] = 121] = "function10";
|
|
44
|
-
KeyCodes[KeyCodes["function11"] = 122] = "function11";
|
|
45
|
-
KeyCodes[KeyCodes["function12"] = 123] = "function12";
|
|
46
|
-
KeyCodes[KeyCodes["function2"] = 113] = "function2";
|
|
47
|
-
KeyCodes[KeyCodes["function3"] = 114] = "function3";
|
|
48
|
-
KeyCodes[KeyCodes["function4"] = 115] = "function4";
|
|
49
|
-
KeyCodes[KeyCodes["function5"] = 116] = "function5";
|
|
50
|
-
KeyCodes[KeyCodes["function6"] = 117] = "function6";
|
|
51
|
-
KeyCodes[KeyCodes["function7"] = 118] = "function7";
|
|
52
|
-
KeyCodes[KeyCodes["function8"] = 119] = "function8";
|
|
53
|
-
KeyCodes[KeyCodes["function9"] = 120] = "function9";
|
|
54
|
-
KeyCodes[KeyCodes["home"] = 36] = "home";
|
|
55
|
-
KeyCodes[KeyCodes["insert"] = 45] = "insert";
|
|
56
|
-
KeyCodes[KeyCodes["menu"] = 93] = "menu";
|
|
57
|
-
KeyCodes[KeyCodes["minus"] = 189] = "minus";
|
|
58
|
-
KeyCodes[KeyCodes["minus2"] = 109] = "minus2";
|
|
59
|
-
KeyCodes[KeyCodes["numLock"] = 144] = "numLock";
|
|
60
|
-
KeyCodes[KeyCodes["numPad0"] = 96] = "numPad0";
|
|
61
|
-
KeyCodes[KeyCodes["numPad1"] = 97] = "numPad1";
|
|
62
|
-
KeyCodes[KeyCodes["numPad2"] = 98] = "numPad2";
|
|
63
|
-
KeyCodes[KeyCodes["numPad3"] = 99] = "numPad3";
|
|
64
|
-
KeyCodes[KeyCodes["numPad4"] = 100] = "numPad4";
|
|
65
|
-
KeyCodes[KeyCodes["numPad5"] = 101] = "numPad5";
|
|
66
|
-
KeyCodes[KeyCodes["numPad6"] = 102] = "numPad6";
|
|
67
|
-
KeyCodes[KeyCodes["numPad7"] = 103] = "numPad7";
|
|
68
|
-
KeyCodes[KeyCodes["numPad8"] = 104] = "numPad8";
|
|
69
|
-
KeyCodes[KeyCodes["numPad9"] = 105] = "numPad9";
|
|
70
|
-
KeyCodes[KeyCodes["numPadDivide"] = 111] = "numPadDivide";
|
|
71
|
-
KeyCodes[KeyCodes["numPadDot"] = 110] = "numPadDot";
|
|
72
|
-
KeyCodes[KeyCodes["numPadMinus"] = 109] = "numPadMinus";
|
|
73
|
-
KeyCodes[KeyCodes["numPadMultiply"] = 106] = "numPadMultiply";
|
|
74
|
-
KeyCodes[KeyCodes["numPadPlus"] = 107] = "numPadPlus";
|
|
75
|
-
KeyCodes[KeyCodes["openBracket"] = 219] = "openBracket";
|
|
76
|
-
KeyCodes[KeyCodes["pageDown"] = 34] = "pageDown";
|
|
77
|
-
KeyCodes[KeyCodes["pageUp"] = 33] = "pageUp";
|
|
78
|
-
KeyCodes[KeyCodes["period"] = 190] = "period";
|
|
79
|
-
KeyCodes[KeyCodes["print"] = 44] = "print";
|
|
80
|
-
KeyCodes[KeyCodes["quote"] = 222] = "quote";
|
|
81
|
-
KeyCodes[KeyCodes["scrollLock"] = 145] = "scrollLock";
|
|
82
|
-
KeyCodes[KeyCodes["shift"] = 16] = "shift";
|
|
83
|
-
KeyCodes[KeyCodes["space"] = 32] = "space";
|
|
84
|
-
KeyCodes[KeyCodes["tab"] = 9] = "tab";
|
|
85
|
-
KeyCodes[KeyCodes["tilde"] = 192] = "tilde";
|
|
86
|
-
KeyCodes[KeyCodes["windowsLeft"] = 91] = "windowsLeft";
|
|
87
|
-
KeyCodes[KeyCodes["windowsOpera"] = 219] = "windowsOpera";
|
|
88
|
-
KeyCodes[KeyCodes["windowsRight"] = 92] = "windowsRight";
|
|
89
|
-
})(KeyCodes || (KeyCodes = {}));
|
|
90
|
-
const keyEnter = "Enter";
|
|
91
|
-
|
|
92
|
-
const proxySlotName = "form-associated-proxy";
|
|
93
|
-
const ElementInternalsKey = "ElementInternals";
|
|
94
|
-
/**
|
|
95
|
-
* @alpha
|
|
96
|
-
*/
|
|
97
|
-
const supportsElementInternals = ElementInternalsKey in window &&
|
|
98
|
-
"setFormValue" in window[ElementInternalsKey].prototype;
|
|
99
|
-
const InternalsMap = new WeakMap();
|
|
100
|
-
/**
|
|
101
|
-
* Base function for providing Custom Element Form Association.
|
|
102
|
-
*
|
|
103
|
-
* @alpha
|
|
104
|
-
*/
|
|
105
|
-
function FormAssociated(BaseCtor) {
|
|
106
|
-
const C = class extends BaseCtor {
|
|
107
|
-
constructor(...args) {
|
|
108
|
-
super(...args);
|
|
109
|
-
/**
|
|
110
|
-
* Track whether the value has been changed from the initial value
|
|
111
|
-
*/
|
|
112
|
-
this.dirtyValue = false;
|
|
113
|
-
/**
|
|
114
|
-
* Sets the element's disabled state. A disabled element will not be included during form submission.
|
|
115
|
-
*
|
|
116
|
-
* @remarks
|
|
117
|
-
* HTML Attribute: disabled
|
|
118
|
-
*/
|
|
119
|
-
this.disabled = false;
|
|
120
|
-
/**
|
|
121
|
-
* These are events that are still fired by the proxy
|
|
122
|
-
* element based on user / programmatic interaction.
|
|
123
|
-
*
|
|
124
|
-
* The proxy implementation should be transparent to
|
|
125
|
-
* the app author, so block these events from emitting.
|
|
126
|
-
*/
|
|
127
|
-
this.proxyEventsToBlock = ["change", "click"];
|
|
128
|
-
this.proxyInitialized = false;
|
|
129
|
-
this.required = false;
|
|
130
|
-
this.initialValue = this.initialValue || "";
|
|
131
|
-
if (!this.elementInternals) {
|
|
132
|
-
// When elementInternals is not supported, formResetCallback is
|
|
133
|
-
// bound to an event listener, so ensure the handler's `this`
|
|
134
|
-
// context is correct.
|
|
135
|
-
this.formResetCallback = this.formResetCallback.bind(this);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Must evaluate to true to enable elementInternals.
|
|
140
|
-
* Feature detects API support and resolve respectively
|
|
141
|
-
*
|
|
142
|
-
* @internal
|
|
143
|
-
*/
|
|
144
|
-
static get formAssociated() {
|
|
145
|
-
return supportsElementInternals;
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Returns the validity state of the element
|
|
149
|
-
*
|
|
150
|
-
* @alpha
|
|
151
|
-
*/
|
|
152
|
-
get validity() {
|
|
153
|
-
return this.elementInternals
|
|
154
|
-
? this.elementInternals.validity
|
|
155
|
-
: this.proxy.validity;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Retrieve a reference to the associated form.
|
|
159
|
-
* Returns null if not associated to any form.
|
|
160
|
-
*
|
|
161
|
-
* @alpha
|
|
162
|
-
*/
|
|
163
|
-
get form() {
|
|
164
|
-
return this.elementInternals ? this.elementInternals.form : this.proxy.form;
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Retrieve the localized validation message,
|
|
168
|
-
* or custom validation message if set.
|
|
169
|
-
*
|
|
170
|
-
* @alpha
|
|
171
|
-
*/
|
|
172
|
-
get validationMessage() {
|
|
173
|
-
return this.elementInternals
|
|
174
|
-
? this.elementInternals.validationMessage
|
|
175
|
-
: this.proxy.validationMessage;
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Whether the element will be validated when the
|
|
179
|
-
* form is submitted
|
|
180
|
-
*/
|
|
181
|
-
get willValidate() {
|
|
182
|
-
return this.elementInternals
|
|
183
|
-
? this.elementInternals.willValidate
|
|
184
|
-
: this.proxy.willValidate;
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* A reference to all associated label elements
|
|
188
|
-
*/
|
|
189
|
-
get labels() {
|
|
190
|
-
if (this.elementInternals) {
|
|
191
|
-
return Object.freeze(Array.from(this.elementInternals.labels));
|
|
192
|
-
}
|
|
193
|
-
else if (this.proxy instanceof HTMLElement &&
|
|
194
|
-
this.proxy.ownerDocument &&
|
|
195
|
-
this.id) {
|
|
196
|
-
// Labels associated by wrapping the element: <label><custom-element></custom-element></label>
|
|
197
|
-
const parentLabels = this.proxy.labels;
|
|
198
|
-
// Labels associated using the `for` attribute
|
|
199
|
-
const forLabels = Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`));
|
|
200
|
-
const labels = parentLabels
|
|
201
|
-
? forLabels.concat(Array.from(parentLabels))
|
|
202
|
-
: forLabels;
|
|
203
|
-
return Object.freeze(labels);
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
206
|
-
return emptyArray;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Invoked when the `value` property changes
|
|
211
|
-
* @param previous - the previous value
|
|
212
|
-
* @param next - the new value
|
|
213
|
-
*
|
|
214
|
-
* @remarks
|
|
215
|
-
* If elements extending `FormAssociated` implement a `valueChanged` method
|
|
216
|
-
* They must be sure to invoke `super.valueChanged(previous, next)` to ensure
|
|
217
|
-
* proper functioning of `FormAssociated`
|
|
218
|
-
*/
|
|
219
|
-
valueChanged(previous, next) {
|
|
220
|
-
this.dirtyValue = true;
|
|
221
|
-
if (this.proxy instanceof HTMLElement) {
|
|
222
|
-
this.proxy.value = this.value;
|
|
223
|
-
}
|
|
224
|
-
this.currentValue = this.value;
|
|
225
|
-
this.setFormValue(this.value);
|
|
226
|
-
this.validate();
|
|
227
|
-
}
|
|
228
|
-
currentValueChanged() {
|
|
229
|
-
this.value = this.currentValue;
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* Invoked when the `initialValue` property changes
|
|
233
|
-
*
|
|
234
|
-
* @param previous - the previous value
|
|
235
|
-
* @param next - the new value
|
|
236
|
-
*
|
|
237
|
-
* @remarks
|
|
238
|
-
* If elements extending `FormAssociated` implement a `initialValueChanged` method
|
|
239
|
-
* They must be sure to invoke `super.initialValueChanged(previous, next)` to ensure
|
|
240
|
-
* proper functioning of `FormAssociated`
|
|
241
|
-
*/
|
|
242
|
-
initialValueChanged(previous, next) {
|
|
243
|
-
// If the value is clean and the component is connected to the DOM
|
|
244
|
-
// then set value equal to the attribute value.
|
|
245
|
-
if (!this.dirtyValue) {
|
|
246
|
-
this.value = this.initialValue;
|
|
247
|
-
this.dirtyValue = false;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Invoked when the `disabled` property changes
|
|
252
|
-
*
|
|
253
|
-
* @param previous - the previous value
|
|
254
|
-
* @param next - the new value
|
|
255
|
-
*
|
|
256
|
-
* @remarks
|
|
257
|
-
* If elements extending `FormAssociated` implement a `disabledChanged` method
|
|
258
|
-
* They must be sure to invoke `super.disabledChanged(previous, next)` to ensure
|
|
259
|
-
* proper functioning of `FormAssociated`
|
|
260
|
-
*/
|
|
261
|
-
disabledChanged(previous, next) {
|
|
262
|
-
if (this.proxy instanceof HTMLElement) {
|
|
263
|
-
this.proxy.disabled = this.disabled;
|
|
264
|
-
}
|
|
265
|
-
DOM.queueUpdate(() => this.classList.toggle("disabled", this.disabled));
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Invoked when the `name` property changes
|
|
269
|
-
*
|
|
270
|
-
* @param previous - the previous value
|
|
271
|
-
* @param next - the new value
|
|
272
|
-
*
|
|
273
|
-
* @remarks
|
|
274
|
-
* If elements extending `FormAssociated` implement a `nameChanged` method
|
|
275
|
-
* They must be sure to invoke `super.nameChanged(previous, next)` to ensure
|
|
276
|
-
* proper functioning of `FormAssociated`
|
|
277
|
-
*/
|
|
278
|
-
nameChanged(previous, next) {
|
|
279
|
-
if (this.proxy instanceof HTMLElement) {
|
|
280
|
-
this.proxy.name = this.name;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
/**
|
|
284
|
-
* Invoked when the `required` property changes
|
|
285
|
-
*
|
|
286
|
-
* @param previous - the previous value
|
|
287
|
-
* @param next - the new value
|
|
288
|
-
*
|
|
289
|
-
* @remarks
|
|
290
|
-
* If elements extending `FormAssociated` implement a `requiredChanged` method
|
|
291
|
-
* They must be sure to invoke `super.requiredChanged(previous, next)` to ensure
|
|
292
|
-
* proper functioning of `FormAssociated`
|
|
293
|
-
*/
|
|
294
|
-
requiredChanged(prev, next) {
|
|
295
|
-
if (this.proxy instanceof HTMLElement) {
|
|
296
|
-
this.proxy.required = this.required;
|
|
297
|
-
}
|
|
298
|
-
DOM.queueUpdate(() => this.classList.toggle("required", this.required));
|
|
299
|
-
this.validate();
|
|
300
|
-
}
|
|
301
|
-
/**
|
|
302
|
-
* The element internals object. Will only exist
|
|
303
|
-
* in browsers supporting the attachInternals API
|
|
304
|
-
*/
|
|
305
|
-
get elementInternals() {
|
|
306
|
-
if (!supportsElementInternals) {
|
|
307
|
-
return null;
|
|
308
|
-
}
|
|
309
|
-
let internals = InternalsMap.get(this);
|
|
310
|
-
if (!internals) {
|
|
311
|
-
internals = this.attachInternals();
|
|
312
|
-
InternalsMap.set(this, internals);
|
|
313
|
-
}
|
|
314
|
-
return internals;
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* @internal
|
|
318
|
-
*/
|
|
319
|
-
connectedCallback() {
|
|
320
|
-
super.connectedCallback();
|
|
321
|
-
this.addEventListener("keypress", this._keypressHandler);
|
|
322
|
-
if (!this.value) {
|
|
323
|
-
this.value = this.initialValue;
|
|
324
|
-
this.dirtyValue = false;
|
|
325
|
-
}
|
|
326
|
-
if (!this.elementInternals) {
|
|
327
|
-
this.attachProxy();
|
|
328
|
-
if (this.form) {
|
|
329
|
-
this.form.addEventListener("reset", this.formResetCallback);
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* @internal
|
|
335
|
-
*/
|
|
336
|
-
disconnectedCallback() {
|
|
337
|
-
this.proxyEventsToBlock.forEach(name => this.proxy.removeEventListener(name, this.stopPropagation));
|
|
338
|
-
if (!this.elementInternals && this.form) {
|
|
339
|
-
this.form.removeEventListener("reset", this.formResetCallback);
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
/**
|
|
343
|
-
* Return the current validity of the element.
|
|
344
|
-
*/
|
|
345
|
-
checkValidity() {
|
|
346
|
-
return this.elementInternals
|
|
347
|
-
? this.elementInternals.checkValidity()
|
|
348
|
-
: this.proxy.checkValidity();
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* Return the current validity of the element.
|
|
352
|
-
* If false, fires an invalid event at the element.
|
|
353
|
-
*/
|
|
354
|
-
reportValidity() {
|
|
355
|
-
return this.elementInternals
|
|
356
|
-
? this.elementInternals.reportValidity()
|
|
357
|
-
: this.proxy.reportValidity();
|
|
358
|
-
}
|
|
359
|
-
/**
|
|
360
|
-
* Set the validity of the control. In cases when the elementInternals object is not
|
|
361
|
-
* available (and the proxy element is used to report validity), this function will
|
|
362
|
-
* do nothing unless a message is provided, at which point the setCustomValidity method
|
|
363
|
-
* of the proxy element will be invoked with the provided message.
|
|
364
|
-
* @param flags - Validity flags
|
|
365
|
-
* @param message - Optional message to supply
|
|
366
|
-
* @param anchor - Optional element used by UA to display an interactive validation UI
|
|
367
|
-
*/
|
|
368
|
-
setValidity(flags, message, anchor) {
|
|
369
|
-
if (this.elementInternals) {
|
|
370
|
-
this.elementInternals.setValidity(flags, message, anchor);
|
|
371
|
-
}
|
|
372
|
-
else if (typeof message === "string") {
|
|
373
|
-
this.proxy.setCustomValidity(message);
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* Invoked when a connected component's form or fieldset has its disabled
|
|
378
|
-
* state changed.
|
|
379
|
-
* @param disabled - the disabled value of the form / fieldset
|
|
380
|
-
*/
|
|
381
|
-
formDisabledCallback(disabled) {
|
|
382
|
-
this.disabled = disabled;
|
|
383
|
-
}
|
|
384
|
-
formResetCallback() {
|
|
385
|
-
this.value = this.initialValue;
|
|
386
|
-
this.dirtyValue = false;
|
|
387
|
-
}
|
|
388
|
-
/**
|
|
389
|
-
* Attach the proxy element to the DOM
|
|
390
|
-
*/
|
|
391
|
-
attachProxy() {
|
|
392
|
-
var _a;
|
|
393
|
-
if (!this.proxyInitialized) {
|
|
394
|
-
this.proxyInitialized = true;
|
|
395
|
-
this.proxy.style.display = "none";
|
|
396
|
-
this.proxyEventsToBlock.forEach(name => this.proxy.addEventListener(name, this.stopPropagation));
|
|
397
|
-
// These are typically mapped to the proxy during
|
|
398
|
-
// property change callbacks, but during initialization
|
|
399
|
-
// on the initial call of the callback, the proxy is
|
|
400
|
-
// still undefined. We should find a better way to address this.
|
|
401
|
-
this.proxy.disabled = this.disabled;
|
|
402
|
-
this.proxy.required = this.required;
|
|
403
|
-
if (typeof this.name === "string") {
|
|
404
|
-
this.proxy.name = this.name;
|
|
405
|
-
}
|
|
406
|
-
if (typeof this.value === "string") {
|
|
407
|
-
this.proxy.value = this.value;
|
|
408
|
-
}
|
|
409
|
-
this.proxy.setAttribute("slot", proxySlotName);
|
|
410
|
-
this.proxySlot = document.createElement("slot");
|
|
411
|
-
this.proxySlot.setAttribute("name", proxySlotName);
|
|
412
|
-
}
|
|
413
|
-
(_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.appendChild(this.proxySlot);
|
|
414
|
-
this.appendChild(this.proxy);
|
|
415
|
-
}
|
|
416
|
-
/**
|
|
417
|
-
* Detach the proxy element from the DOM
|
|
418
|
-
*/
|
|
419
|
-
detachProxy() {
|
|
420
|
-
var _a;
|
|
421
|
-
this.removeChild(this.proxy);
|
|
422
|
-
(_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(this.proxySlot);
|
|
423
|
-
}
|
|
424
|
-
/**
|
|
425
|
-
* Sets the validity of the custom element. By default this uses the proxy element to determine
|
|
426
|
-
* validity, but this can be extended or replaced in implementation.
|
|
427
|
-
*/
|
|
428
|
-
validate() {
|
|
429
|
-
if (this.proxy instanceof HTMLElement) {
|
|
430
|
-
this.setValidity(this.proxy.validity, this.proxy.validationMessage);
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
/**
|
|
434
|
-
* Associates the provided value (and optional state) with the parent form.
|
|
435
|
-
* @param value - The value to set
|
|
436
|
-
* @param state - The state object provided to during session restores and when autofilling.
|
|
437
|
-
*/
|
|
438
|
-
setFormValue(value, state) {
|
|
439
|
-
if (this.elementInternals) {
|
|
440
|
-
this.elementInternals.setFormValue(value, state || value);
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
_keypressHandler(e) {
|
|
444
|
-
switch (e.key) {
|
|
445
|
-
case keyEnter:
|
|
446
|
-
if (this.form instanceof HTMLFormElement) {
|
|
447
|
-
// Implicit submission
|
|
448
|
-
const defaultButton = this.form.querySelector("[type=submit]");
|
|
449
|
-
defaultButton === null || defaultButton === void 0 ? void 0 : defaultButton.click();
|
|
450
|
-
}
|
|
451
|
-
break;
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
/**
|
|
455
|
-
* Used to stop propagation of proxy element events
|
|
456
|
-
* @param e - Event object
|
|
457
|
-
*/
|
|
458
|
-
stopPropagation(e) {
|
|
459
|
-
e.stopPropagation();
|
|
460
|
-
}
|
|
461
|
-
};
|
|
462
|
-
attr({ mode: "boolean" })(C.prototype, "disabled");
|
|
463
|
-
attr({ mode: "fromView", attribute: "value" })(C.prototype, "initialValue");
|
|
464
|
-
attr({ attribute: "current-value" })(C.prototype, "currentValue");
|
|
465
|
-
attr(C.prototype, "name");
|
|
466
|
-
attr({ mode: "boolean" })(C.prototype, "required");
|
|
467
|
-
observable(C.prototype, "value");
|
|
468
|
-
return C;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
class _Button extends FoundationElement {
|
|
472
|
-
}
|
|
473
|
-
/**
|
|
474
|
-
* A form-associated base class for the {@link @microsoft/fast-foundation#(Button:class)} component.
|
|
475
|
-
*
|
|
476
|
-
* @internal
|
|
477
|
-
*/
|
|
478
|
-
class FormAssociatedButton extends FormAssociated(_Button) {
|
|
479
|
-
constructor() {
|
|
480
|
-
super(...arguments);
|
|
481
|
-
this.proxy = document.createElement("input");
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
/**
|
|
486
|
-
* A Button Custom HTML Element.
|
|
487
|
-
* Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | <button> element }.
|
|
488
|
-
*
|
|
489
|
-
* @public
|
|
490
|
-
*/
|
|
491
|
-
class Button$1 extends FormAssociatedButton {
|
|
492
|
-
constructor() {
|
|
493
|
-
super(...arguments);
|
|
494
|
-
/**
|
|
495
|
-
* Prevent events to propagate if disabled and has no slotted content wrapped in HTML elements
|
|
496
|
-
* @internal
|
|
497
|
-
*/
|
|
498
|
-
this.handleClick = (e) => {
|
|
499
|
-
var _a;
|
|
500
|
-
if (this.disabled && ((_a = this.defaultSlottedContent) === null || _a === void 0 ? void 0 : _a.length) <= 1) {
|
|
501
|
-
e.stopPropagation();
|
|
502
|
-
}
|
|
503
|
-
};
|
|
504
|
-
/**
|
|
505
|
-
* Submits the parent form
|
|
506
|
-
*/
|
|
507
|
-
this.handleSubmission = () => {
|
|
508
|
-
if (!this.form) {
|
|
509
|
-
return;
|
|
510
|
-
}
|
|
511
|
-
const attached = this.proxy.isConnected;
|
|
512
|
-
if (!attached) {
|
|
513
|
-
this.attachProxy();
|
|
514
|
-
}
|
|
515
|
-
// Browser support for requestSubmit is not comprehensive
|
|
516
|
-
// so click the proxy if it isn't supported
|
|
517
|
-
typeof this.form.requestSubmit === "function"
|
|
518
|
-
? this.form.requestSubmit(this.proxy)
|
|
519
|
-
: this.proxy.click();
|
|
520
|
-
if (!attached) {
|
|
521
|
-
this.detachProxy();
|
|
522
|
-
}
|
|
523
|
-
};
|
|
524
|
-
/**
|
|
525
|
-
* Resets the parent form
|
|
526
|
-
*/
|
|
527
|
-
this.handleFormReset = () => {
|
|
528
|
-
var _a;
|
|
529
|
-
(_a = this.form) === null || _a === void 0 ? void 0 : _a.reset();
|
|
530
|
-
};
|
|
531
|
-
/**
|
|
532
|
-
* Overrides the focus call for where delegatesFocus is unsupported.
|
|
533
|
-
* This check works for Chrome, Edge Chromium, FireFox, and Safari
|
|
534
|
-
* Relevant PR on the Firefox browser: https://phabricator.services.mozilla.com/D123858
|
|
535
|
-
*/
|
|
536
|
-
this.handleUnsupportedDelegatesFocus = () => {
|
|
537
|
-
var _a;
|
|
538
|
-
// Check to see if delegatesFocus is supported
|
|
539
|
-
if (window.ShadowRoot &&
|
|
540
|
-
!window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") && ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) {
|
|
541
|
-
this.focus = () => {
|
|
542
|
-
this.control.focus();
|
|
543
|
-
};
|
|
544
|
-
}
|
|
545
|
-
};
|
|
546
|
-
}
|
|
547
|
-
formactionChanged() {
|
|
548
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
549
|
-
this.proxy.formAction = this.formaction;
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
formenctypeChanged() {
|
|
553
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
554
|
-
this.proxy.formEnctype = this.formenctype;
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
formmethodChanged() {
|
|
558
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
559
|
-
this.proxy.formMethod = this.formmethod;
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
formnovalidateChanged() {
|
|
563
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
564
|
-
this.proxy.formNoValidate = this.formnovalidate;
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
formtargetChanged() {
|
|
568
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
569
|
-
this.proxy.formTarget = this.formtarget;
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
typeChanged(previous, next) {
|
|
573
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
574
|
-
this.proxy.type = this.type;
|
|
575
|
-
}
|
|
576
|
-
next === "submit" && this.addEventListener("click", this.handleSubmission);
|
|
577
|
-
previous === "submit" && this.removeEventListener("click", this.handleSubmission);
|
|
578
|
-
next === "reset" && this.addEventListener("click", this.handleFormReset);
|
|
579
|
-
previous === "reset" && this.removeEventListener("click", this.handleFormReset);
|
|
580
|
-
}
|
|
581
|
-
/**
|
|
582
|
-
* @internal
|
|
583
|
-
*/
|
|
584
|
-
connectedCallback() {
|
|
585
|
-
var _a;
|
|
586
|
-
super.connectedCallback();
|
|
587
|
-
this.proxy.setAttribute("type", this.type);
|
|
588
|
-
this.handleUnsupportedDelegatesFocus();
|
|
589
|
-
const elements = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children);
|
|
590
|
-
if (elements) {
|
|
591
|
-
elements.forEach((span) => {
|
|
592
|
-
span.addEventListener("click", this.handleClick);
|
|
593
|
-
});
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
/**
|
|
597
|
-
* @internal
|
|
598
|
-
*/
|
|
599
|
-
disconnectedCallback() {
|
|
600
|
-
var _a;
|
|
601
|
-
super.disconnectedCallback();
|
|
602
|
-
const elements = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children);
|
|
603
|
-
if (elements) {
|
|
604
|
-
elements.forEach((span) => {
|
|
605
|
-
span.removeEventListener("click", this.handleClick);
|
|
606
|
-
});
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
__decorate([
|
|
611
|
-
attr({ mode: "boolean" })
|
|
612
|
-
], Button$1.prototype, "autofocus", void 0);
|
|
613
|
-
__decorate([
|
|
614
|
-
attr({ attribute: "form" })
|
|
615
|
-
], Button$1.prototype, "formId", void 0);
|
|
616
|
-
__decorate([
|
|
617
|
-
attr
|
|
618
|
-
], Button$1.prototype, "formaction", void 0);
|
|
619
|
-
__decorate([
|
|
620
|
-
attr
|
|
621
|
-
], Button$1.prototype, "formenctype", void 0);
|
|
622
|
-
__decorate([
|
|
623
|
-
attr
|
|
624
|
-
], Button$1.prototype, "formmethod", void 0);
|
|
625
|
-
__decorate([
|
|
626
|
-
attr({ mode: "boolean" })
|
|
627
|
-
], Button$1.prototype, "formnovalidate", void 0);
|
|
628
|
-
__decorate([
|
|
629
|
-
attr
|
|
630
|
-
], Button$1.prototype, "formtarget", void 0);
|
|
631
|
-
__decorate([
|
|
632
|
-
attr
|
|
633
|
-
], Button$1.prototype, "type", void 0);
|
|
634
|
-
__decorate([
|
|
635
|
-
observable
|
|
636
|
-
], Button$1.prototype, "defaultSlottedContent", void 0);
|
|
637
|
-
/**
|
|
638
|
-
* Includes ARIA states and properties relating to the ARIA button role
|
|
639
|
-
*
|
|
640
|
-
* @public
|
|
641
|
-
*/
|
|
642
|
-
class DelegatesARIAButton {
|
|
643
|
-
}
|
|
644
|
-
__decorate([
|
|
645
|
-
attr({ attribute: "aria-expanded" })
|
|
646
|
-
], DelegatesARIAButton.prototype, "ariaExpanded", void 0);
|
|
647
|
-
__decorate([
|
|
648
|
-
attr({ attribute: "aria-pressed" })
|
|
649
|
-
], DelegatesARIAButton.prototype, "ariaPressed", void 0);
|
|
650
|
-
applyMixins(DelegatesARIAButton, ARIAGlobalStatesAndProperties);
|
|
651
|
-
applyMixins(Button$1, StartEnd, DelegatesARIAButton);
|
|
652
|
-
|
|
653
|
-
class Button extends Button$1 {
|
|
654
|
-
constructor() {
|
|
655
|
-
super(...arguments);
|
|
656
|
-
this.label = '';
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
__decorate([attr, __metadata("design:type", String)], Button.prototype, "connotation", void 0);
|
|
662
|
-
|
|
663
|
-
__decorate([attr, __metadata("design:type", String)], Button.prototype, "shape", void 0);
|
|
664
|
-
|
|
665
|
-
__decorate([attr, __metadata("design:type", String)], Button.prototype, "appearance", void 0);
|
|
666
|
-
|
|
667
|
-
__decorate([attr, __metadata("design:type", String)], Button.prototype, "size", void 0);
|
|
668
|
-
|
|
669
|
-
__decorate([attr({
|
|
670
|
-
mode: 'fromView'
|
|
671
|
-
}), __metadata("design:type", Object)], Button.prototype, "label", void 0);
|
|
672
|
-
|
|
673
|
-
applyMixins(Button, AffixIconWithTrailing);
|
|
674
|
-
|
|
675
|
-
var css_248z = "/*\n Do not edit directly\n Generated on Wed, 27 Apr 2022 11:58:36 GMT\n*/\n:host {\n outline: 0 none;\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 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 cursor: pointer;\n outline: 0 none;\n vertical-align: middle;\n}\n.control:not(.connotation-cta):not(.connotation-success):not(.connotation-alert) {\n --connotation: var(--vvd-color-primary);\n --on-connotation: var(--vvd-color-on-primary);\n --connotation-basis: var(--vvd-color-neutral);\n --connotation-basis-increment: var(--vvd-color-neutral-90);\n --connotation-contrast: var(--vvd-color-neutral-90);\n --connotation-fierce: var(--vvd-color-neutral-80);\n --connotation-firm: var(--vvd-color-primary);\n --connotation-soft: var(--vvd-color-neutral-20);\n --connotation-pale: var(--vvd-color-neutral-10);\n}\n\n.control.connotation-cta {\n --connotation: var(--vvd-color-cta);\n --on-connotation: var(--vvd-color-on-cta);\n --connotation-basis: var(--vvd-color-cta);\n --connotation-basis-increment: var(--vvd-color-cta-70);\n --connotation-contrast: var(--vvd-color-cta-90);\n --connotation-fierce: var(--vvd-color-cta-80);\n --connotation-firm: var(--vvd-color-cta-70);\n --connotation-soft: var(--vvd-color-cta-20);\n --connotation-pale: var(--vvd-color-cta-10);\n}\n\n.control.connotation-success {\n --connotation: var(--vvd-color-success);\n --on-connotation: var(--vvd-color-on-success);\n --connotation-basis: var(--vvd-color-success);\n --connotation-basis-increment: var(--vvd-color-success-70);\n --connotation-contrast: var(--vvd-color-success-90);\n --connotation-fierce: var(--vvd-color-success-80);\n --connotation-firm: var(--vvd-color-success-70);\n --connotation-soft: var(--vvd-color-success-20);\n --connotation-pale: var(--vvd-color-success-10);\n}\n\n.control.connotation-alert {\n --connotation: var(--vvd-color-alert);\n --on-connotation: var(--vvd-color-on-alert);\n --connotation-basis: var(--vvd-color-alert);\n --connotation-basis-increment: var(--vvd-color-alert-70);\n --connotation-contrast: var(--vvd-color-alert-90);\n --connotation-fierce: var(--vvd-color-alert-80);\n --connotation-firm: var(--vvd-color-alert-70);\n --connotation-soft: var(--vvd-color-alert-20);\n --connotation-pale: var(--vvd-color-alert-10);\n}\n\n.control.appearance-filled {\n --_appearance-color-text: var(--on-connotation);\n --_appearance-color-fill: var(--connotation);\n --_appearance-color-outline: transaprent;\n}\n.control.appearance-outlined {\n --_appearance-color-text: var(--connotation-firm);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: var(--connotation-firm);\n}\n.control {\n --_appearance-color-text: var(--connotation);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.control:hover:not(:disabled, .disabled).appearance-filled, .control.hovered:not(:disabled, .disabled).appearance-filled {\n --_appearance-color-text: var(--on-connotation);\n --_appearance-color-fill: var(--connotation-basis-increment);\n --_appearance-color-outline: transaprent;\n}\n.control:hover:not(:disabled, .disabled).appearance-outlined, .control.hovered:not(:disabled, .disabled).appearance-outlined {\n --_appearance-color-text: var(--connotation-firm);\n --_appearance-color-fill: var(--connotation-pale);\n --_appearance-color-outline: var(--connotation-firm);\n}\n.control:hover:not(:disabled, .disabled), .control.hovered:not(:disabled, .disabled) {\n --_appearance-color-text: var(--connotation);\n --_appearance-color-fill: var(--connotation-pale);\n --_appearance-color-outline: transaprent;\n}\n.control:disabled.appearance-filled, .control.disabled.appearance-filled {\n --_appearance-color-text: var(--vvd-color-neutral-50);\n --_appearance-color-fill: var(--vvd-color-neutral-30);\n --_appearance-color-outline: transaprent;\n}\n.control:disabled.appearance-outlined, .control.disabled.appearance-outlined {\n --_appearance-color-text: var(--vvd-color-neutral-50);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: var(--vvd-color-neutral-50);\n}\n.control:disabled, .control.disabled {\n --_appearance-color-text: var(--vvd-color-neutral-50);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.control:active:not(:disabled, .disabled).appearance-filled, .control.active:not(:disabled, .disabled).appearance-filled {\n --_appearance-color-text: var(--on-connotation);\n --_appearance-color-fill: var(--connotation-fierce);\n --_appearance-color-outline: transaprent;\n}\n.control:active:not(:disabled, .disabled).appearance-outlined, .control.active:not(:disabled, .disabled).appearance-outlined {\n --_appearance-color-text: var(--connotation-firm);\n --_appearance-color-fill: var(--connotation-soft);\n --_appearance-color-outline: var(--connotation-firm);\n}\n.control:active:not(:disabled, .disabled), .control.active:not(:disabled, .disabled) {\n --_appearance-color-text: var(--connotation);\n --_appearance-color-fill: var(--connotation-soft);\n --_appearance-color-outline: transaprent;\n}\n.control.icon-only {\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\n/* Size */\n.control.size-base-small {\n --button-block-size: 32px;\n font: 600 ultra-condensed 12px / 16px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n}\n.control.size-base-small:not(.icon-only) {\n --button-icon-gap: 8px;\n padding-inline: 12px;\n}\n.control.size-base-small .icon {\n font-size: 16px;\n}\n\n.control.size-base-large {\n --button-block-size: 48px;\n font: 600 ultra-condensed 16px / 24px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n}\n.control.size-base-large:not(.icon-only) {\n --button-icon-gap: 10px;\n padding-inline: 20px;\n}\n.control.size-base-large .icon {\n font-size: 24px;\n}\n\n.control:not(.size-base-small):not(.size-base-large) {\n --button-block-size: 40px;\n font: 600 ultra-condensed 14px / 100% SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n}\n.control:not(.size-base-small):not(.size-base-large):not(.icon-only) {\n --button-icon-gap: 8px;\n padding-inline: 16px;\n}\n.control:not(.size-base-small):not(.size-base-large) .icon {\n font-size: 20px;\n}\n\n/* Shape */\n.control:not(.shape-pill) {\n border-radius: 6px;\n}\n\n.control.shape-pill:not(.icon-only) {\n border-radius: 24px;\n}\n.control.shape-pill.icon-only {\n border-radius: 50%;\n}\n\n/* Icon */\n:not(.icon-trailing) .icon {\n margin-inline-end: var(--button-icon-gap);\n}\n.icon-trailing .icon {\n order: 1;\n margin-inline-start: var(--button-icon-gap);\n}\n\n:not(:focus) .focus-indicator {\n display: none;\n}\n.appearance-outlined .focus-indicator, .appearance-ghost .focus-indicator {\n --focus-stroke-gap-color: transparent;\n}";
|
|
676
|
-
styleInject(css_248z);
|
|
677
|
-
|
|
678
|
-
let _ = t => t,
|
|
679
|
-
_t,
|
|
680
|
-
_t2;
|
|
681
|
-
|
|
682
|
-
const getAppearanceClassName = (appearance, disabled) => {
|
|
683
|
-
let className = `appearance-${appearance}`;
|
|
684
|
-
disabled && (className += ' disabled');
|
|
685
|
-
return className;
|
|
686
|
-
};
|
|
687
|
-
|
|
688
|
-
const getClasses = ({
|
|
689
|
-
connotation,
|
|
690
|
-
appearance,
|
|
691
|
-
shape,
|
|
692
|
-
size,
|
|
693
|
-
icon,
|
|
694
|
-
label,
|
|
695
|
-
disabled,
|
|
696
|
-
iconTrailing
|
|
697
|
-
}) => classNames('control', [`connotation-${connotation}`, Boolean(connotation)], [getAppearanceClassName(appearance, disabled), Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], [`size-${size}`, Boolean(size)], ['icon-only', !label && !!icon], ['icon-trailing', iconTrailing]);
|
|
698
|
-
|
|
699
|
-
const focusTemplate = context => {
|
|
700
|
-
const focusTag = context.tagFor(Focus);
|
|
701
|
-
return html(_t || (_t = _`<${0} class="focus-indicator"></${0}>`), focusTag, focusTag);
|
|
702
|
-
};
|
|
703
|
-
|
|
704
|
-
const buttonTemplate = context => {
|
|
705
|
-
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
706
|
-
return html(_t2 || (_t2 = _`
|
|
707
|
-
<button
|
|
708
|
-
class="${0}"
|
|
709
|
-
?autofocus="${0}"
|
|
710
|
-
?disabled="${0}"
|
|
711
|
-
form="${0}"
|
|
712
|
-
formaction="${0}"
|
|
713
|
-
formenctype="${0}"
|
|
714
|
-
formmethod="${0}"
|
|
715
|
-
formnovalidate="${0}"
|
|
716
|
-
formtarget="${0}"
|
|
717
|
-
name="${0}"
|
|
718
|
-
type="${0}"
|
|
719
|
-
value="${0}"
|
|
720
|
-
aria-atomic="${0}"
|
|
721
|
-
aria-busy="${0}"
|
|
722
|
-
aria-controls="${0}"
|
|
723
|
-
aria-current="${0}"
|
|
724
|
-
aria-describedby="${0}"
|
|
725
|
-
aria-details="${0}"
|
|
726
|
-
aria-disabled="${0}"
|
|
727
|
-
aria-errormessage="${0}"
|
|
728
|
-
aria-expanded="${0}"
|
|
729
|
-
aria-flowto="${0}"
|
|
730
|
-
aria-haspopup="${0}"
|
|
731
|
-
aria-hidden="${0}"
|
|
732
|
-
aria-invalid="${0}"
|
|
733
|
-
aria-keyshortcuts="${0}"
|
|
734
|
-
aria-label="${0}"
|
|
735
|
-
aria-labelledby="${0}"
|
|
736
|
-
aria-live="${0}"
|
|
737
|
-
aria-owns="${0}"
|
|
738
|
-
aria-pressed="${0}"
|
|
739
|
-
aria-relevant="${0}"
|
|
740
|
-
aria-roledescription="${0}"
|
|
741
|
-
${0}
|
|
742
|
-
>
|
|
743
|
-
${0}
|
|
744
|
-
${0}
|
|
745
|
-
${0}
|
|
746
|
-
</button>
|
|
747
|
-
`), 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(context), x => affixIconTemplate(x.icon), x => x.label);
|
|
748
|
-
};
|
|
749
|
-
|
|
750
|
-
const vividButton = Button.compose({
|
|
751
|
-
baseName: 'button',
|
|
752
|
-
baseClass: Button$1,
|
|
753
|
-
template: buttonTemplate,
|
|
754
|
-
styles: css_248z,
|
|
755
|
-
shadowOptions: {
|
|
756
|
-
delegatesFocus: true
|
|
757
|
-
}
|
|
758
|
-
});
|
|
759
|
-
designSystem.register(vividButton());
|
|
760
|
-
|
|
761
|
-
export { vividButton };
|
|
12
|
+
import '../shared/class-names.js';
|
|
13
|
+
import '../shared/focus.js';
|
|
14
|
+
import '../shared/web.dom-collections.iterator.js';
|
|
15
|
+
import '../shared/object-keys.js';
|
|
16
|
+
import '../shared/affix.js';
|
|
17
|
+
import '../shared/apply-mixins.js';
|
|
18
|
+
import '../shared/focus2.js';
|
|
19
|
+
import '../shared/ref.js';
|
|
20
|
+
import '../shared/form-associated.js';
|
|
21
|
+
import '../shared/key-codes.js';
|
|
22
|
+
import '../shared/aria-global.js';
|
|
23
|
+
import '../shared/start-end.js';
|