@vonage/vivid 3.0.0-next.11 → 3.0.0-next.110
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 +165 -4
- package/accordion/index.js +5 -14
- package/accordion-item/index.js +34 -41
- package/action-group/index.js +37 -0
- package/avatar/index.js +61 -0
- package/badge/index.js +23 -35
- package/banner/index.js +20 -115
- package/breadcrumb/index.js +22 -19
- package/breadcrumb-item/index.js +28 -25
- package/button/index.js +29 -690
- package/calendar/index.js +70 -69
- package/calendar-event/index.js +109 -0
- package/card/index.js +112 -0
- package/checkbox/index.js +178 -0
- package/custom-elements.json +3941 -0
- package/dialog/index.js +214 -0
- package/divider/index.js +27 -0
- package/elevation/index.js +10 -16
- package/fab/index.js +98 -0
- package/focus/index.js +18 -3
- package/header/index.js +63 -0
- package/icon/index.js +9 -12
- package/index.js +68 -22
- package/layout/index.js +6 -16
- package/lib/accordion-item/accordion-item.d.ts +2 -2
- package/lib/accordion-item/index.d.ts +0 -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 +2 -0
- package/lib/badge/badge.d.ts +3 -5
- package/lib/badge/index.d.ts +1 -2
- package/lib/banner/banner.d.ts +1 -1
- package/lib/banner/banner.template.d.ts +0 -2
- 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 +0 -1
- package/lib/button/button.d.ts +4 -3
- package/lib/button/index.d.ts +1 -21
- 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/{text → card}/index.d.ts +1 -1
- package/lib/checkbox/checkbox.d.ts +5 -0
- package/lib/checkbox/checkbox.template.d.ts +4 -0
- package/lib/checkbox/index.d.ts +2 -0
- package/lib/components.d.ts +32 -10
- package/lib/dialog/dialog.d.ts +20 -0
- package/lib/dialog/dialog.template.d.ts +4 -0
- package/lib/dialog/index.d.ts +2 -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 +19 -6
- package/lib/fab/fab.d.ts +13 -0
- package/lib/fab/fab.template.d.ts +4 -0
- package/lib/fab/index.d.ts +2 -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 +2 -0
- package/lib/icon/icon.d.ts +5 -6
- package/lib/layout/index.d.ts +1 -1
- package/lib/layout/layout.d.ts +4 -4
- package/lib/listbox/index.d.ts +1 -0
- package/lib/listbox/listbox.d.ts +9 -0
- package/lib/listbox/listbox.template.d.ts +4 -0
- package/lib/menu/index.d.ts +10 -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 +2 -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 +2 -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 +2 -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/note/index.d.ts +2 -0
- package/lib/note/note.d.ts +10 -0
- package/lib/note/note.template.d.ts +4 -0
- package/lib/number-field/index.d.ts +2 -0
- package/lib/number-field/number-field.d.ts +14 -0
- package/lib/number-field/number-field.template.d.ts +4 -0
- package/lib/option/index.d.ts +2 -0
- package/lib/option/option.d.ts +9 -0
- package/lib/option/option.template.d.ts +4 -0
- package/lib/popup/index.d.ts +1 -3
- package/lib/popup/popup.d.ts +3 -2
- package/lib/progress/progress.d.ts +1 -1
- package/lib/progress-ring/progress-ring.d.ts +2 -1
- package/lib/radio/index.d.ts +2 -0
- package/lib/radio/radio.d.ts +4 -0
- package/lib/radio/radio.template.d.ts +4 -0
- package/lib/radio-group/index.d.ts +10 -0
- package/lib/radio-group/radio-group.d.ts +4 -0
- package/lib/radio-group/radio-group.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/slider/index.d.ts +2 -0
- package/lib/slider/slider.d.ts +4 -0
- package/lib/slider/slider.template.d.ts +4 -0
- package/lib/switch/index.d.ts +2 -0
- package/lib/switch/switch.d.ts +7 -0
- package/lib/switch/switch.template.d.ts +4 -0
- package/lib/text-anchor/text-anchor.d.ts +1 -1
- package/lib/text-area/index.d.ts +2 -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 +2 -0
- package/lib/text-field/text-field.d.ts +14 -0
- package/lib/text-field/text-field.template.d.ts +4 -0
- package/lib/tooltip/index.d.ts +0 -1
- package/lib/tooltip/tooltip.d.ts +7 -7
- package/listbox/index.js +1086 -0
- package/menu/index.js +357 -0
- package/menu-item/index.js +90 -0
- package/nav/index.js +17 -0
- package/nav-disclosure/index.js +80 -0
- package/nav-item/index.js +44 -0
- package/note/index.js +59 -0
- package/number-field/index.js +460 -0
- package/option/index.js +75 -0
- package/package.json +62 -10
- package/popup/index.js +35 -2036
- package/progress/index.js +33 -38
- package/progress-ring/index.js +13 -13
- package/radio/index.js +52 -0
- package/radio-group/index.js +435 -0
- package/shared/affix.js +2 -8
- package/shared/anchor.js +11 -3
- package/shared/apply-mixins.js +5 -4
- package/shared/aria-global.js +2 -86
- package/shared/aria.js +9 -0
- package/shared/base-progress.js +6 -1
- package/shared/breadcrumb-item.js +2 -2
- package/shared/button.js +23 -0
- package/shared/button2.js +200 -0
- package/shared/calendar-event.js +19 -0
- package/shared/design-system/index.d.ts +1 -1
- package/shared/dialog-polyfill.esm.js +858 -0
- package/shared/direction.js +20 -0
- package/shared/divider.js +55 -0
- package/shared/dom.js +8 -0
- package/shared/elevation.js +10 -0
- package/shared/enums.js +70 -0
- package/shared/es.object.assign.js +2 -59
- package/shared/es.promise.resolve.js +944 -0
- package/shared/es.regexp.to-string.js +58 -0
- package/shared/focus.js +11 -0
- package/shared/focus2.js +5 -0
- package/shared/form-associated.js +466 -0
- package/shared/form-elements.js +343 -0
- package/shared/icon.js +32 -1153
- package/shared/index.js +3780 -83
- package/shared/index2.js +7 -19
- package/shared/key-codes.js +97 -0
- package/shared/listbox-option.js +201 -0
- package/shared/menu-item.js +277 -0
- package/shared/numbers.js +25 -0
- package/shared/patterns/focus.d.ts +3 -0
- package/shared/patterns/form-elements/form-elements.d.ts +31 -0
- package/shared/patterns/form-elements/index.d.ts +1 -0
- package/shared/patterns/index.d.ts +2 -0
- package/shared/popup.js +1484 -0
- package/shared/radio.js +127 -0
- package/shared/ref.js +41 -0
- package/shared/slotted.js +1 -1
- package/shared/start-end.js +50 -0
- package/shared/string-trim.js +39 -0
- package/shared/text-anchor.js +2 -13
- package/shared/text-anchor.template.js +6 -5
- package/shared/utils/index.d.ts +1 -0
- package/side-drawer/index.js +38 -34
- package/slider/index.js +596 -0
- package/styles/core/all.css +86 -0
- package/styles/core/theme.css +11 -0
- package/styles/core/typography.css +80 -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 +230 -0
- package/styles/tokens/theme-light.css +230 -0
- package/switch/index.js +153 -0
- package/text-anchor/index.js +8 -3
- package/text-area/index.js +288 -0
- package/text-field/index.js +129 -0
- package/tooltip/index.js +59 -43
- package/vivid.api.json +2979 -0
- package/lib/text/text.d.ts +0 -10
- package/shared/style-inject.es.js +0 -28
- package/shared/web.dom-collections.iterator.js +0 -1479
- 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
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import '../shared/es.promise.resolve.js';
|
|
2
|
+
import { F as FoundationElement, _ as __decorate, a as attr, V as observable, b as __metadata, h as html, g as getPrefix, d as designSystem } from '../shared/index.js';
|
|
3
|
+
import { l as loadComponentsModules } from '../shared/index2.js';
|
|
4
|
+
import { C as CheckableFormAssociated } from '../shared/form-associated.js';
|
|
5
|
+
import { a as keySpace$1 } from '../shared/key-codes.js';
|
|
6
|
+
import { f as focusTemplateFactory } from '../shared/focus.js';
|
|
7
|
+
import { I as Icon } from '../shared/icon.js';
|
|
8
|
+
import { w as when } from '../shared/when.js';
|
|
9
|
+
import { c as classNames } from '../shared/class-names.js';
|
|
10
|
+
import '../shared/focus2.js';
|
|
11
|
+
import '../shared/string-trim.js';
|
|
12
|
+
import '../shared/_has.js';
|
|
13
|
+
|
|
14
|
+
class _Checkbox extends FoundationElement {
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A form-associated base class for the {@link @microsoft/fast-foundation#(Checkbox:class)} component.
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
class FormAssociatedCheckbox extends CheckableFormAssociated(_Checkbox) {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.proxy = document.createElement("input");
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A Checkbox Custom HTML Element.
|
|
30
|
+
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#checkbox | ARIA checkbox }.
|
|
31
|
+
*
|
|
32
|
+
* @slot checked-indicator - The checked indicator
|
|
33
|
+
* @slot indeterminate-indicator - The indeterminate indicator
|
|
34
|
+
* @slot - The default slot for the label
|
|
35
|
+
* @csspart control - The element representing the visual checkbox control
|
|
36
|
+
* @csspart label - The label
|
|
37
|
+
* @fires change - Emits a custom change event when the checked state changes
|
|
38
|
+
*
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
class Checkbox$1 extends FormAssociatedCheckbox {
|
|
42
|
+
constructor() {
|
|
43
|
+
super();
|
|
44
|
+
/**
|
|
45
|
+
* The element's value to be included in form submission when checked.
|
|
46
|
+
* Default to "on" to reach parity with input[type="checkbox"]
|
|
47
|
+
*
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
this.initialValue = "on";
|
|
51
|
+
/**
|
|
52
|
+
* The indeterminate state of the control
|
|
53
|
+
*/
|
|
54
|
+
this.indeterminate = false;
|
|
55
|
+
/**
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
this.keypressHandler = (e) => {
|
|
59
|
+
if (this.readOnly) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
switch (e.key) {
|
|
63
|
+
case keySpace$1:
|
|
64
|
+
if (this.indeterminate) {
|
|
65
|
+
this.indeterminate = false;
|
|
66
|
+
}
|
|
67
|
+
this.checked = !this.checked;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* @internal
|
|
73
|
+
*/
|
|
74
|
+
this.clickHandler = (e) => {
|
|
75
|
+
if (!this.disabled && !this.readOnly) {
|
|
76
|
+
if (this.indeterminate) {
|
|
77
|
+
this.indeterminate = false;
|
|
78
|
+
}
|
|
79
|
+
this.checked = !this.checked;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
this.proxy.setAttribute("type", "checkbox");
|
|
83
|
+
}
|
|
84
|
+
readOnlyChanged() {
|
|
85
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
86
|
+
this.proxy.readOnly = this.readOnly;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
__decorate([
|
|
91
|
+
attr({ attribute: "readonly", mode: "boolean" })
|
|
92
|
+
], Checkbox$1.prototype, "readOnly", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
observable
|
|
95
|
+
], Checkbox$1.prototype, "defaultSlottedNodes", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
observable
|
|
98
|
+
], Checkbox$1.prototype, "indeterminate", void 0);
|
|
99
|
+
|
|
100
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Sun, 04 Dec 2022 15:37:45 GMT\n */\n.base {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n vertical-align: middle;\n}\n.base {\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-intermediate: var(--vvd-color-neutral-500);\n --_connotation-color-backdrop: var(--vvd-color-canvas);\n --_connotation-color-firm: var(--vvd-color-canvas-text);\n}\n.base {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-intermediate);\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.base:where(:checked, .checked):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: var(--_connotation-color-primary);\n}\n.base:where(:checked, .checked):where(:hover, .hover) {\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.base: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: var(--vvd-color-neutral-400);\n}\n.base:where(.readonly):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-neutral-800);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\n --_appearance-color-outline: var(--vvd-color-neutral-500);\n}\n@supports selector(:focus-visible) {\n .base:focus {\n outline: none;\n }\n}\n@supports (user-select: none) {\n .base {\n user-select: none;\n }\n}\n.base:not(.disabled) {\n cursor: pointer;\n}\n.base.disabled {\n cursor: not-allowed;\n}\n\n.control {\n position: relative;\n display: flex;\n width: 20px;\n height: 20px;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n background-color: var(--_appearance-color-fill);\n border-radius: 3px;\n box-shadow: inset 0 0 0 2px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n}\n\n.indicator {\n font-size: 16px;\n}\n.base:not(.checked) .indicator.checkmark {\n display: none;\n}\n\n.base:not(.indeterminate) .indicator.minus, .base.checked .indicator.minus {\n display: none;\n}\n\nlabel {\n color: var(--vvd-color-canvas-text);\n cursor: pointer;\n font: var(--vvd-typography-base);\n}\n\n.focus-indicator {\n --focus-inset: -3px;\n --focus-stroke-gap-color: transparent;\n border-radius: 6px;\n}\n.base:not(:focus-visible) .focus-indicator {\n display: none;\n}";
|
|
101
|
+
|
|
102
|
+
const keySpace = ' ';
|
|
103
|
+
class Checkbox extends Checkbox$1 {
|
|
104
|
+
constructor() {
|
|
105
|
+
super(...arguments);
|
|
106
|
+
this.keypressHandler = e => {
|
|
107
|
+
switch (e.key) {
|
|
108
|
+
case keySpace:
|
|
109
|
+
if (this.indeterminate) {
|
|
110
|
+
this.indeterminate = false;
|
|
111
|
+
}
|
|
112
|
+
this.checked = !this.checked;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
this.clickHandler = () => {
|
|
117
|
+
if (!this.disabled && !this.readOnly) {
|
|
118
|
+
if (this.indeterminate) {
|
|
119
|
+
this.indeterminate = false;
|
|
120
|
+
}
|
|
121
|
+
this.checked = !this.checked;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
__decorate([attr, __metadata("design:type", String)], Checkbox.prototype, "label", void 0);
|
|
127
|
+
|
|
128
|
+
let _ = t => t,
|
|
129
|
+
_t,
|
|
130
|
+
_t2,
|
|
131
|
+
_t3,
|
|
132
|
+
_t4;
|
|
133
|
+
const getClasses = ({
|
|
134
|
+
readOnly,
|
|
135
|
+
checked,
|
|
136
|
+
disabled,
|
|
137
|
+
indeterminate
|
|
138
|
+
}) => classNames('base', ['readonly', Boolean(readOnly)], ['checked', Boolean(checked) || Boolean(indeterminate)], ['disabled', Boolean(disabled)]);
|
|
139
|
+
const CheckboxTemplate = context => {
|
|
140
|
+
const focusTemplate = focusTemplateFactory(context);
|
|
141
|
+
const iconTag = context.tagFor(Icon);
|
|
142
|
+
return html(_t || (_t = _`<span
|
|
143
|
+
role="checkbox"
|
|
144
|
+
aria-checked="${0}"
|
|
145
|
+
aria-required="${0}"
|
|
146
|
+
aria-disabled="${0}"
|
|
147
|
+
aria-readonly="${0}"
|
|
148
|
+
tabindex="${0}"
|
|
149
|
+
@keypress="${0}"
|
|
150
|
+
@click="${0}"
|
|
151
|
+
class="${0}"
|
|
152
|
+
>
|
|
153
|
+
<div class="control">
|
|
154
|
+
${0}
|
|
155
|
+
${0}
|
|
156
|
+
${0}
|
|
157
|
+
</div>
|
|
158
|
+
|
|
159
|
+
${0}
|
|
160
|
+
|
|
161
|
+
</span>`), x => x.checked, x => x.required, x => x.disabled, x => x.readOnly, x => x.disabled ? null : 0, (x, c) => x.keypressHandler(c.event), x => x.clickHandler(), getClasses, when(x => x.checked, html(_t2 || (_t2 = _`<${0} name="check-solid"></${0}>`), iconTag, iconTag)), when(x => x.indeterminate, html(_t3 || (_t3 = _`<${0} name="minus-solid"></${0}>`), iconTag, iconTag)), () => focusTemplate, when(x => x.label, html(_t4 || (_t4 = _`<label>${0}</label>`), x => x.label)));
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const prefix = getPrefix(import.meta.url);
|
|
165
|
+
const vividCheckbox = Checkbox.compose({
|
|
166
|
+
baseName: 'checkbox',
|
|
167
|
+
template: CheckboxTemplate,
|
|
168
|
+
styles: css_248z,
|
|
169
|
+
shadowOptions: {
|
|
170
|
+
delegatesFocus: true
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
(async () => {
|
|
174
|
+
await loadComponentsModules(['icon', 'focus'], prefix);
|
|
175
|
+
designSystem.withPrefix(prefix).register(vividCheckbox());
|
|
176
|
+
})();
|
|
177
|
+
|
|
178
|
+
export { vividCheckbox };
|