@vonage/vivid 3.0.0 → 3.0.1
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 +176 -4
- package/accordion/index.js +22 -61
- package/accordion-item/index.js +16 -118
- package/action-group/index.js +5 -0
- package/avatar/index.js +11 -0
- package/badge/index.js +9 -53
- package/banner/index.js +20 -210
- package/breadcrumb/index.js +7 -96
- package/breadcrumb-item/index.js +15 -46
- package/button/index.js +19 -751
- package/calendar/index.js +5 -1520
- package/calendar-event/index.js +9 -0
- package/card/index.js +10 -133
- package/checkbox/index.js +16 -0
- package/combobox/index.js +35 -0
- package/dialog/index.js +24 -0
- package/divider/index.js +6 -0
- package/elevation/index.js +4 -30
- package/fab/index.js +22 -0
- package/focus/index.js +4 -2
- package/header/index.js +6 -0
- package/icon/index.js +8 -36
- package/index.js +76 -26
- package/layout/index.js +4 -52
- package/lib/accordion/accordion.d.ts +3 -7
- package/lib/accordion/accordion.template.d.ts +1 -2
- package/lib/accordion/definition.d.ts +1 -0
- package/lib/accordion/index.d.ts +1 -2
- package/lib/accordion-item/accordion-item.d.ts +2 -6
- package/lib/accordion-item/accordion-item.template.d.ts +4 -4
- package/lib/accordion-item/definition.d.ts +1 -0
- package/lib/accordion-item/index.d.ts +1 -3
- 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/action-group/definition.d.ts +1 -0
- package/lib/action-group/index.d.ts +1 -0
- package/lib/avatar/avatar.d.ts +15 -0
- package/lib/avatar/avatar.template.d.ts +4 -0
- package/lib/avatar/definition.d.ts +1 -0
- package/lib/avatar/index.d.ts +1 -0
- package/lib/badge/badge.d.ts +2 -4
- package/lib/badge/definition.d.ts +3 -0
- package/lib/badge/index.d.ts +1 -3
- package/lib/banner/banner.d.ts +1 -1
- package/lib/banner/banner.template.d.ts +0 -2
- package/lib/banner/definition.d.ts +1 -0
- package/lib/banner/index.d.ts +1 -2
- package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
- package/lib/breadcrumb/definition.d.ts +1 -0
- package/lib/breadcrumb/index.d.ts +1 -2
- package/lib/breadcrumb-item/definition.d.ts +1 -0
- package/lib/breadcrumb-item/index.d.ts +1 -3
- package/lib/button/button.d.ts +3 -2
- package/lib/button/definition.d.ts +1 -0
- package/lib/button/index.d.ts +1 -21
- package/lib/calendar/calendar.d.ts +3 -1
- package/lib/calendar/definition.d.ts +1 -0
- package/lib/calendar/index.d.ts +1 -3
- 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/definition.d.ts +1 -0
- package/lib/calendar-event/index.d.ts +1 -0
- package/lib/card/card.d.ts +2 -2
- package/lib/card/definition.d.ts +1 -0
- package/lib/card/index.d.ts +1 -5
- package/lib/checkbox/checkbox.d.ts +5 -0
- package/lib/checkbox/checkbox.template.d.ts +4 -0
- package/lib/checkbox/definition.d.ts +1 -0
- package/lib/checkbox/index.d.ts +1 -0
- package/lib/combobox/combobox.d.ts +14 -0
- package/lib/combobox/combobox.template.d.ts +4 -0
- package/lib/combobox/definition.d.ts +3 -0
- package/lib/combobox/index.d.ts +1 -0
- package/lib/components.d.ts +44 -16
- package/lib/dialog/definition.d.ts +1 -0
- package/lib/dialog/dialog.d.ts +23 -0
- package/lib/dialog/dialog.template.d.ts +4 -0
- package/lib/dialog/index.d.ts +1 -0
- package/lib/divider/definition.d.ts +1 -0
- package/lib/divider/divider.d.ts +3 -0
- package/lib/divider/divider.template.d.ts +4 -0
- package/lib/divider/index.d.ts +1 -0
- package/lib/elevation/definition.d.ts +1 -0
- package/lib/elevation/elevation.d.ts +1 -0
- package/lib/elevation/index.d.ts +1 -2
- package/lib/enums.d.ts +19 -6
- package/lib/fab/definition.d.ts +3 -0
- package/lib/fab/fab.d.ts +13 -0
- package/lib/fab/fab.template.d.ts +4 -0
- package/lib/fab/index.d.ts +1 -0
- package/lib/focus/definition.d.ts +3 -0
- package/lib/focus/index.d.ts +1 -2
- package/lib/{sidenav-item/index.d.ts → header/definition.d.ts} +2 -2
- package/lib/header/header.d.ts +5 -0
- package/lib/header/header.template.d.ts +4 -0
- package/lib/header/index.d.ts +1 -0
- package/lib/icon/definition.d.ts +3 -0
- package/lib/icon/icon.d.ts +5 -6
- package/lib/icon/index.d.ts +1 -2
- package/lib/layout/definition.d.ts +3 -0
- package/lib/layout/index.d.ts +1 -2
- package/lib/layout/layout.d.ts +4 -4
- package/lib/listbox/definition.d.ts +3 -0
- package/lib/listbox/index.d.ts +1 -0
- package/lib/listbox/listbox.d.ts +6 -0
- package/lib/listbox/listbox.template.d.ts +4 -0
- package/lib/menu/definition.d.ts +11 -0
- package/lib/menu/index.d.ts +1 -0
- package/lib/menu/menu.d.ts +10 -0
- package/lib/menu/menu.template.d.ts +3 -0
- package/lib/menu-item/definition.d.ts +3 -0
- package/lib/menu-item/index.d.ts +1 -0
- package/lib/menu-item/menu-item.d.ts +8 -0
- package/lib/menu-item/menu-item.template.d.ts +5 -0
- package/lib/nav/definition.d.ts +3 -0
- package/lib/nav/index.d.ts +1 -0
- package/lib/nav/nav.d.ts +3 -0
- package/lib/nav/nav.template.d.ts +4 -0
- package/lib/nav-disclosure/definition.d.ts +3 -0
- package/lib/nav-disclosure/index.d.ts +1 -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/definition.d.ts +3 -0
- package/lib/nav-item/index.d.ts +1 -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/definition.d.ts +3 -0
- package/lib/note/index.d.ts +1 -0
- package/lib/note/note.d.ts +10 -0
- package/lib/{text/text.template.d.ts → note/note.template.d.ts} +2 -2
- package/lib/number-field/definition.d.ts +4 -0
- package/lib/number-field/index.d.ts +1 -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/definition.d.ts +3 -0
- package/lib/option/index.d.ts +1 -0
- package/lib/option/option.d.ts +9 -0
- package/lib/option/option.template.d.ts +4 -0
- package/lib/popup/definition.d.ts +4 -0
- package/lib/popup/index.d.ts +1 -4
- package/lib/popup/popup.d.ts +8 -4
- package/lib/progress/definition.d.ts +3 -0
- package/lib/progress/index.d.ts +1 -2
- package/lib/progress/progress.d.ts +1 -1
- package/lib/progress-ring/definition.d.ts +3 -0
- package/lib/progress-ring/index.d.ts +1 -2
- package/lib/progress-ring/progress-ring.d.ts +2 -1
- package/lib/radio/definition.d.ts +3 -0
- package/lib/radio/index.d.ts +1 -0
- package/lib/radio/radio.d.ts +4 -0
- package/lib/radio/radio.template.d.ts +4 -0
- package/lib/radio-group/definition.d.ts +11 -0
- package/lib/radio-group/index.d.ts +1 -0
- package/lib/radio-group/radio-group.d.ts +4 -0
- package/lib/radio-group/radio-group.template.d.ts +4 -0
- package/lib/select/definition.d.ts +3 -0
- package/lib/select/index.d.ts +1 -0
- package/lib/select/select.d.ts +17 -0
- package/lib/select/select.template.d.ts +4 -0
- package/lib/side-drawer/definition.d.ts +3 -0
- package/lib/side-drawer/index.d.ts +1 -2
- package/lib/side-drawer/side-drawer.d.ts +3 -2
- package/lib/slider/definition.d.ts +3 -0
- package/lib/slider/index.d.ts +1 -0
- package/lib/slider/slider.d.ts +4 -0
- package/lib/slider/slider.template.d.ts +4 -0
- package/lib/switch/definition.d.ts +3 -0
- package/lib/switch/index.d.ts +1 -0
- package/lib/switch/switch.d.ts +7 -0
- package/lib/switch/switch.template.d.ts +4 -0
- package/lib/tab/definition.d.ts +3 -0
- package/lib/tab/index.d.ts +1 -0
- package/lib/tab/tab.d.ts +9 -0
- package/lib/tab/tab.template.d.ts +3 -0
- package/lib/tab-panel/definition.d.ts +3 -0
- package/lib/tab-panel/index.d.ts +1 -0
- package/lib/tab-panel/tab-panel.d.ts +3 -0
- package/lib/tab-panel/tab-panel.template.d.ts +2 -0
- package/lib/tabs/definition.d.ts +3 -0
- package/lib/tabs/index.d.ts +1 -0
- package/lib/tabs/tabs.d.ts +10 -0
- package/lib/tabs/tabs.template.d.ts +2 -0
- package/lib/text-anchor/definition.d.ts +3 -0
- package/lib/text-anchor/index.d.ts +1 -2
- package/lib/text-area/definition.d.ts +3 -0
- package/lib/text-area/index.d.ts +1 -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/definition.d.ts +3 -0
- package/lib/text-field/index.d.ts +1 -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/definition.d.ts +3 -0
- package/lib/tooltip/index.d.ts +1 -3
- package/lib/tooltip/tooltip.d.ts +6 -6
- package/listbox/index.js +27 -0
- package/menu/index.js +30 -0
- package/menu-item/index.js +20 -0
- package/nav/index.js +4 -0
- package/nav-disclosure/index.js +17 -0
- package/nav-item/index.js +22 -0
- package/note/index.js +15 -0
- package/number-field/index.js +459 -0
- package/option/index.js +21 -0
- package/package.json +29 -18
- package/popup/index.js +21 -2062
- package/progress/index.js +6 -98
- package/progress-ring/index.js +6 -75
- package/radio/index.js +12 -0
- package/radio-group/index.js +11 -0
- package/select/index.js +34 -0
- package/shared/affix.js +2 -8
- package/shared/anchor.js +10 -2
- 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 +5 -0
- package/shared/breadcrumb-item.js +1 -1
- package/shared/button.js +200 -0
- package/shared/calendar-event.js +19 -0
- package/shared/definition.js +225 -0
- package/shared/definition10.js +99 -0
- package/shared/definition11.js +48 -0
- package/shared/definition12.js +1523 -0
- package/shared/definition13.js +111 -0
- package/shared/definition14.js +114 -0
- package/shared/definition15.js +32 -0
- package/shared/definition16.js +172 -0
- package/shared/definition17.js +727 -0
- package/shared/definition18.js +1842 -0
- package/shared/definition19.js +261 -0
- package/shared/definition2.js +150 -0
- package/shared/definition20.js +221 -0
- package/shared/definition21.js +78 -0
- package/shared/definition22.js +87 -0
- package/shared/definition23.js +58 -0
- package/shared/definition24.js +44 -0
- package/shared/definition25.js +58 -0
- package/shared/definition26.js +348 -0
- package/shared/definition27.js +363 -0
- package/shared/definition28.js +21 -0
- package/shared/definition29.js +75 -0
- package/shared/definition3.js +29 -0
- package/shared/definition30.js +31 -0
- package/shared/definition31.js +49 -0
- package/shared/definition32.js +94 -0
- package/shared/definition33.js +77 -0
- package/shared/definition34.js +45 -0
- package/shared/definition35.js +435 -0
- package/shared/definition36.js +634 -0
- package/shared/definition37.js +86 -0
- package/shared/definition38.js +592 -0
- package/shared/definition39.js +147 -0
- package/shared/definition4.js +19 -0
- package/shared/definition40.js +67 -0
- package/shared/definition41.js +32 -0
- package/shared/definition42.js +440 -0
- package/shared/definition43.js +282 -0
- package/shared/definition44.js +119 -0
- package/shared/definition45.js +77 -0
- package/shared/definition5.js +38 -0
- package/shared/definition6.js +60 -0
- package/shared/definition7.js +45 -0
- package/shared/definition8.js +113 -0
- package/shared/definition9.js +107 -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/dom.js +8 -0
- package/shared/enums.js +70 -0
- package/shared/es.object.assign.js +2 -3
- package/shared/es.regexp.to-string.js +59 -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 +127 -0
- package/shared/icon.js +538 -567
- package/shared/index.js +1664 -83
- package/shared/key-codes.js +97 -0
- package/shared/listbox.js +995 -0
- package/shared/numbers.js +34 -0
- package/shared/patterns/affix.d.ts +1 -1
- package/shared/patterns/focus.d.ts +3 -0
- package/shared/patterns/form-elements/form-elements.d.ts +43 -0
- package/shared/patterns/form-elements/index.d.ts +1 -0
- package/shared/patterns/index.d.ts +2 -0
- package/shared/radio.js +127 -0
- package/shared/ref.js +41 -0
- package/shared/select.options.js +10 -0
- package/shared/start-end.js +50 -0
- package/shared/string-trim.js +40 -0
- package/shared/strings.js +9 -0
- package/shared/text-anchor.js +0 -2
- package/shared/text-anchor.template.js +6 -5
- package/shared/text-field.js +3 -0
- package/shared/text-field2.js +225 -0
- package/shared/to-string.js +51 -0
- package/side-drawer/index.js +5 -81
- package/slider/index.js +17 -0
- package/styles/core/all.css +83 -0
- package/styles/core/theme.css +11 -0
- package/styles/core/typography.css +77 -0
- package/styles/tokens/theme-dark.css +228 -0
- package/styles/tokens/theme-light.css +228 -0
- package/switch/index.js +18 -0
- package/tab/index.js +16 -0
- package/tab-panel/index.js +4 -0
- package/tabs/index.js +24 -0
- package/text-anchor/index.js +11 -6
- package/text-area/index.js +23 -0
- package/text-field/index.js +24 -0
- package/tooltip/index.js +18 -55
- package/lib/text/index.d.ts +0 -2
- package/lib/text/text.d.ts +0 -10
- package/shared/index2.js +0 -21
- package/shared/object-set-prototype-of.js +0 -1009
- package/shared/style-inject.es.js +0 -28
- package/shared/web.dom-collections.iterator.js +0 -473
- package/sidenav-item/index.js +0 -39
- package/styles/fonts/spezia.css +0 -23
- package/styles/themes/dark.css +0 -205
- package/styles/themes/light.css +0 -205
- package/text/index.js +0 -46
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { F as FoundationElement, _ as __decorate, a as attr, o as observable, 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 { C as CheckableFormAssociated } from './form-associated.js';
|
|
5
|
+
import { e as keySpace, d as keyEnter } from './key-codes.js';
|
|
6
|
+
import './affix.js';
|
|
7
|
+
import { f as focusTemplateFactory } from './focus2.js';
|
|
8
|
+
import './form-elements.js';
|
|
9
|
+
import { w as when } from './when.js';
|
|
10
|
+
import { c as classNames } from './class-names.js';
|
|
11
|
+
|
|
12
|
+
class _Switch extends FoundationElement {
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A form-associated base class for the {@link @microsoft/fast-foundation#(Switch:class)} component.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
class FormAssociatedSwitch extends CheckableFormAssociated(_Switch) {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.proxy = document.createElement("input");
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* A Switch Custom HTML Element.
|
|
28
|
+
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#switch | ARIA switch }.
|
|
29
|
+
*
|
|
30
|
+
* @slot - The deafult slot for the label
|
|
31
|
+
* @slot checked-message - The message when in a checked state
|
|
32
|
+
* @slot unchecked-message - The message when in an unchecked state
|
|
33
|
+
* @csspart label - The label
|
|
34
|
+
* @csspart switch - The element representing the switch, which wraps the indicator
|
|
35
|
+
* @csspart status-message - The wrapper for the status messages
|
|
36
|
+
* @csspart checked-message - The checked message
|
|
37
|
+
* @csspart unchecked-message - The unchecked message
|
|
38
|
+
* @fires change - Emits a custom change event when the checked state changes
|
|
39
|
+
*
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
class Switch$1 extends FormAssociatedSwitch {
|
|
43
|
+
constructor() {
|
|
44
|
+
super();
|
|
45
|
+
/**
|
|
46
|
+
* The element's value to be included in form submission when checked.
|
|
47
|
+
* Default to "on" to reach parity with input[type="checkbox"]
|
|
48
|
+
*
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
this.initialValue = "on";
|
|
52
|
+
/**
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
this.keypressHandler = (e) => {
|
|
56
|
+
if (this.readOnly) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
switch (e.key) {
|
|
60
|
+
case keyEnter:
|
|
61
|
+
case keySpace:
|
|
62
|
+
this.checked = !this.checked;
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* @internal
|
|
68
|
+
*/
|
|
69
|
+
this.clickHandler = (e) => {
|
|
70
|
+
if (!this.disabled && !this.readOnly) {
|
|
71
|
+
this.checked = !this.checked;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
this.proxy.setAttribute("type", "checkbox");
|
|
75
|
+
}
|
|
76
|
+
readOnlyChanged() {
|
|
77
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
78
|
+
this.proxy.readOnly = this.readOnly;
|
|
79
|
+
}
|
|
80
|
+
this.readOnly
|
|
81
|
+
? this.classList.add("readonly")
|
|
82
|
+
: this.classList.remove("readonly");
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
87
|
+
checkedChanged(prev, next) {
|
|
88
|
+
super.checkedChanged(prev, next);
|
|
89
|
+
/**
|
|
90
|
+
* @deprecated - this behavior already exists in the template and should not exist in the class.
|
|
91
|
+
*/
|
|
92
|
+
this.checked ? this.classList.add("checked") : this.classList.remove("checked");
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
__decorate([
|
|
96
|
+
attr({ attribute: "readonly", mode: "boolean" })
|
|
97
|
+
], Switch$1.prototype, "readOnly", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
observable
|
|
100
|
+
], Switch$1.prototype, "defaultSlottedNodes", void 0);
|
|
101
|
+
|
|
102
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 30 Jan 2023 11:28:31 GMT\n */\n.control {\n display: inline-flex;\n gap: 8px;\n}\n.control.connotation-cta {\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary: var(--vvd-color-cta-500);\n --_connotation-color-primary-increment: var(--vvd-color-cta-600);\n --_connotation-color-backdrop: var(--vvd-color-cta-50);\n --_connotation-color-firm: var(--vvd-color-cta-600);\n --_connotation-color-intermediate: var(--vvd-color-cta-500);\n}\n.control.connotation-alert {\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary: var(--vvd-color-alert-500);\n --_connotation-color-primary-increment: var(--vvd-color-alert-600);\n --_connotation-color-backdrop: var(--vvd-color-alert-50);\n --_connotation-color-firm: var(--vvd-color-alert-600);\n --_connotation-color-intermediate: var(--vvd-color-alert-500);\n}\n.control.connotation-success {\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary: var(--vvd-color-success-500);\n --_connotation-color-primary-increment: var(--vvd-color-success-600);\n --_connotation-color-backdrop: var(--vvd-color-success-50);\n --_connotation-color-firm: var(--vvd-color-success-600);\n --_connotation-color-intermediate: var(--vvd-color-success-500);\n}\n.control:not(.connotation-cta, .connotation-alert, .connotation-success) {\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-primary-increment: var(--vvd-color-neutral-800);\n --_connotation-color-backdrop: var(--vvd-color-canvas);\n --_connotation-color-firm: var(--vvd-color-canvas-text);\n --_connotation-color-intermediate: var(--vvd-color-neutral-500);\n}\n.control {\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.control.appearance-filled {\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(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)).appearance-filled {\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: var(--vvd-color-neutral-400);\n}\n.control:where(:disabled, .disabled).appearance-filled {\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(.readonly):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-neutral-100);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.control:where(.readonly):where(:not(:disabled, .disabled)).appearance-filled {\n --_appearance-color-text: var(--vvd-color-neutral-800);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\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:not(.disabled) {\n cursor: pointer;\n}\n.control.disabled {\n cursor: not-allowed;\n pointer-events: none;\n}\n\n.switch {\n --_switch-inline-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20)) * 1.8);\n position: relative;\n display: flex;\n box-sizing: border-box;\n align-items: center;\n background-color: var(--_appearance-color-fill);\n block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20));\n border-radius: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20)) / .5);\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n inline-size: var(--_switch-inline-size);\n transition: all 0.2s ease-in-out 0s;\n}\n\n.checked-indicator {\n --_switch-checked-indicator-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20)) / 1.6667);\n --_switch-gutter: calc(var(--_switch-checked-indicator-size) / 3);\n block-size: var(--_switch-checked-indicator-size);\n border-radius: inherit;\n inline-size: var(--_switch-checked-indicator-size);\n margin-inline-start: auto;\n transition: all 0.2s ease-in-out 0s;\n}\n.control.appearance-filled .checked-indicator {\n background-color: var(--vvd-color-neutral-100);\n}\n.control:not(.appearance-filled) .checked-indicator {\n background-color: var(--_appearance-color-outline);\n}\n.control:not(.checked) .checked-indicator {\n transform: translateX(calc(-1 * var(--_switch-inline-size) + var(--_switch-checked-indicator-size) + var(--_switch-gutter)));\n}\n.control.checked .checked-indicator {\n transform: translateX(calc(-1 * var(--_switch-gutter)));\n}\n\n.label {\n color: var(--vvd-color-canvas-text);\n cursor: pointer;\n font: var(--vvd-typography-base);\n}\n\n.focus-indicator {\n --focus-inset: -4px;\n --focus-stroke-gap-color: transparent;\n border-radius: 14px;\n}\n.control:not(:focus-visible) .focus-indicator {\n display: none;\n}";
|
|
103
|
+
|
|
104
|
+
class Switch extends Switch$1 {}
|
|
105
|
+
__decorate([attr, __metadata("design:type", String)], Switch.prototype, "label", void 0);
|
|
106
|
+
__decorate([attr, __metadata("design:type", String)], Switch.prototype, "connotation", void 0);
|
|
107
|
+
|
|
108
|
+
let _2 = t => t,
|
|
109
|
+
_t,
|
|
110
|
+
_t2;
|
|
111
|
+
const getClasses = _ => classNames('control', ['appearance-filled', _.checked && !_.disabled && !_.readOnly], ['checked', _.checked], ['disabled', _.disabled], ['readonly', _.readOnly], [`connotation-${_.connotation}`, Boolean(_.checked) && Boolean(_.connotation)]);
|
|
112
|
+
const SwitchTemplate = context => {
|
|
113
|
+
const focusTemplate = focusTemplateFactory(context);
|
|
114
|
+
return html(_t || (_t = _2`
|
|
115
|
+
<div
|
|
116
|
+
class="${0}"
|
|
117
|
+
role="switch"
|
|
118
|
+
aria-checked="${0}"
|
|
119
|
+
aria-disabled="${0}"
|
|
120
|
+
aria-readonly="${0}"
|
|
121
|
+
tabindex="${0}"
|
|
122
|
+
@keypress="${0}"
|
|
123
|
+
@click="${0}"
|
|
124
|
+
>
|
|
125
|
+
<div class="switch">
|
|
126
|
+
<span class="checked-indicator"></span>
|
|
127
|
+
${0}
|
|
128
|
+
</div>
|
|
129
|
+
${0}
|
|
130
|
+
</div>
|
|
131
|
+
`), getClasses, x => x.checked, x => x.disabled, x => x.readOnly, x => x.disabled ? null : 0, (x, c) => x.keypressHandler(c.event), (x, c) => x.clickHandler(c.event), () => focusTemplate, when(x => x.label, html(_t2 || (_t2 = _2`<div class="label">
|
|
132
|
+
${0}
|
|
133
|
+
</div>`), x => x.label)));
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const switchDefinition = Switch.compose({
|
|
137
|
+
baseName: 'switch',
|
|
138
|
+
template: SwitchTemplate,
|
|
139
|
+
styles: css_248z,
|
|
140
|
+
shadowOptions: {
|
|
141
|
+
delegatesFocus: true
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
const switchRegistries = [switchDefinition(), ...iconRegistries, ...focusRegistries];
|
|
145
|
+
const registerSwitch = registerFactory(switchRegistries);
|
|
146
|
+
|
|
147
|
+
export { switchRegistries as a, registerSwitch as r, switchDefinition as s };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { F as Focus } from './focus.js';
|
|
3
|
+
|
|
4
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 30 Jan 2023 11:28:31 GMT\n */\n:host {\n display: contents;\n border-radius: inherit;\n}\n\n.control {\n position: absolute;\n z-index: 1;\n box-sizing: border-box;\n border-radius: inherit;\n box-shadow: inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);\n inset: var(--focus-inset, 0);\n outline: 2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));\n outline-offset: -2px;\n}";
|
|
5
|
+
|
|
6
|
+
let _ = t => t,
|
|
7
|
+
_t;
|
|
8
|
+
const focusTemplate = () => html(_t || (_t = _`
|
|
9
|
+
<span class="control"></span>`));
|
|
10
|
+
|
|
11
|
+
const focusDefinition = Focus.compose({
|
|
12
|
+
baseName: 'focus',
|
|
13
|
+
template: focusTemplate,
|
|
14
|
+
styles: css_248z
|
|
15
|
+
});
|
|
16
|
+
const focusRegistries = [focusDefinition()];
|
|
17
|
+
const registerFocus = registerFactory(focusRegistries);
|
|
18
|
+
|
|
19
|
+
export { focusRegistries as f, registerFocus as r };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { F as FoundationElement, _ 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 { b as AffixIcon, a as affixIconTemplateFactory } from './affix.js';
|
|
5
|
+
import { a as applyMixins } from './apply-mixins.js';
|
|
6
|
+
import { f as focusTemplateFactory } from './focus2.js';
|
|
7
|
+
import { c as classNames } from './class-names.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A Tab Component to be used with {@link @microsoft/fast-foundation#(Tabs:class)}
|
|
11
|
+
*
|
|
12
|
+
* @slot - The default slot for the tab content
|
|
13
|
+
*
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
class Tab$1 extends FoundationElement {
|
|
17
|
+
}
|
|
18
|
+
__decorate([
|
|
19
|
+
attr({ mode: "boolean" })
|
|
20
|
+
], Tab$1.prototype, "disabled", void 0);
|
|
21
|
+
|
|
22
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 30 Jan 2023 11:28:31 GMT\n */\n@supports selector(:focus-visible) {\n :host(:focus) {\n outline: none;\n }\n}\n:host(.vertical) {\n justify-content: end;\n grid-column: 1/auto;\n}\n\n.base {\n position: relative;\n display: flex;\n box-sizing: border-box;\n align-items: center;\n padding: var(--_tabs-tablist-gutter);\n background-color: var(--_appearance-color-fill);\n border-radius: 6px;\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n font: var(--vvd-typography-base);\n gap: var(--_tabs-tablist-gutter);\n min-block-size: 48px;\n vertical-align: middle;\n white-space: nowrap;\n}\n.base {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transparent;\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(:active, .active):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transparent;\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 pointer-events: none;\n}\n:host(.vertical) .base {\n padding-inline-start: calc(var(--_tabs-active-indicator-stroke-width) + var(--_tabs-tablist-gutter));\n}\n\n:host(:not(:focus-visible)) .focus-indicator {\n display: none;\n}\n\n.icon {\n font-size: 20px;\n}\n\n:host(:not(.vertical)) .base::after {\n position: absolute;\n background: currentColor;\n block-size: 2px;\n content: \"\";\n inline-size: calc(100% + var(--_tabs-tablist-gutter) * 2);\n inset-block-end: calc(var(--_tabs-tablist-gutter) * -2);\n margin-inline: calc(var(--_tabs-tablist-gutter) * -2);\n pointer-events: none;\n transition-property: opacity;\n}\n:host(:not(.vertical)):host([aria-selected=true]) .base::after {\n transition-delay: 0.2s;\n}\n:host(:not(.vertical)):host(:not([aria-selected=true])) .base::after {\n opacity: 0;\n}";
|
|
23
|
+
|
|
24
|
+
class Tab extends Tab$1 {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
this.tabIndex = '-1';
|
|
28
|
+
this.ariaSelected = null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
__decorate([attr, __metadata("design:type", String)], Tab.prototype, "label", void 0);
|
|
32
|
+
__decorate([attr({
|
|
33
|
+
mode: 'fromView'
|
|
34
|
+
}), __metadata("design:type", Object)], Tab.prototype, "tabIndex", void 0);
|
|
35
|
+
__decorate([attr({
|
|
36
|
+
attribute: 'aria-selected'
|
|
37
|
+
}), __metadata("design:type", Object)], Tab.prototype, "ariaSelected", void 0);
|
|
38
|
+
applyMixins(Tab, AffixIcon);
|
|
39
|
+
|
|
40
|
+
let _ = t => t,
|
|
41
|
+
_t;
|
|
42
|
+
const getClasses = ({
|
|
43
|
+
disabled,
|
|
44
|
+
ariaSelected
|
|
45
|
+
}) => classNames('base', ['disabled', Boolean(disabled)], ['selected', ariaSelected === 'true']);
|
|
46
|
+
function TabTemplate(context) {
|
|
47
|
+
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
48
|
+
const focusTemplate = focusTemplateFactory(context);
|
|
49
|
+
return html(_t || (_t = _`
|
|
50
|
+
<template slot="tab" role="tab" aria-disabled="${0}" aria-selected="${0}">
|
|
51
|
+
<div class="${0}">
|
|
52
|
+
${0}
|
|
53
|
+
${0}
|
|
54
|
+
${0}
|
|
55
|
+
</div>
|
|
56
|
+
</template>`), x => x.disabled, x => x.ariaSelected, getClasses, () => focusTemplate, x => affixIconTemplate(x.icon), x => x.label);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const tabDefinition = Tab.compose({
|
|
60
|
+
baseName: 'tab',
|
|
61
|
+
template: TabTemplate,
|
|
62
|
+
styles: css_248z
|
|
63
|
+
});
|
|
64
|
+
const tabRegistries = [tabDefinition(), ...iconRegistries, ...focusRegistries];
|
|
65
|
+
const registerTab = registerFactory(tabRegistries);
|
|
66
|
+
|
|
67
|
+
export { tabDefinition as a, registerTab as r, tabRegistries as t };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { F as FoundationElement, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A TabPanel Component to be used with {@link @microsoft/fast-foundation#(Tabs:class)}
|
|
5
|
+
*
|
|
6
|
+
* @slot - The default slot for the tabpanel content
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
class TabPanel$1 extends FoundationElement {
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
class TabPanel extends TabPanel$1 {}
|
|
14
|
+
|
|
15
|
+
let _ = t => t,
|
|
16
|
+
_t;
|
|
17
|
+
function TabPanelTemplate() {
|
|
18
|
+
return html(_t || (_t = _`
|
|
19
|
+
<template slot="tabpanel" role="tabpanel">
|
|
20
|
+
<slot></slot>
|
|
21
|
+
</template>
|
|
22
|
+
`));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const tabPanelDefinition = TabPanel.compose({
|
|
26
|
+
baseName: 'tab-panel',
|
|
27
|
+
template: TabPanelTemplate
|
|
28
|
+
});
|
|
29
|
+
const tabPanelRegistries = [tabPanelDefinition()];
|
|
30
|
+
const registerTabPanel = registerFactory(tabPanelRegistries);
|
|
31
|
+
|
|
32
|
+
export { tabPanelDefinition as a, registerTabPanel as r, tabPanelRegistries as t };
|