@vonage/vivid 3.9.0 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/index.js +1 -0
- package/alert/index.js +28 -0
- package/avatar/index.js +1 -1
- package/badge/index.js +1 -1
- package/banner/index.js +3 -3
- package/breadcrumb/index.js +2 -1
- package/breadcrumb-item/index.js +1 -1
- package/button/index.js +2 -2
- package/calendar/index.js +1 -1
- package/calendar-event/index.js +1 -1
- package/card/index.js +3 -2
- package/checkbox/index.js +1 -1
- package/combobox/index.js +7 -6
- package/custom-elements.json +589 -377
- package/data-grid/index.js +3 -2
- package/dialog/index.js +5 -4
- package/divider/index.js +1 -1
- package/elevation/index.js +1 -1
- package/fab/index.js +1 -1
- package/header/index.js +2 -2
- package/index.js +54 -52
- package/layout/index.js +1 -1
- package/lib/alert/alert.d.ts +24 -0
- package/lib/alert/alert.template.d.ts +4 -0
- package/lib/alert/definition.d.ts +2 -0
- package/lib/alert/index.d.ts +1 -0
- package/lib/components.d.ts +1 -0
- package/lib/enums.d.ts +10 -9
- package/lib/layout/layout.d.ts +2 -0
- package/lib/pagination/definition.d.ts +3 -0
- package/lib/pagination/index.d.ts +1 -0
- package/lib/pagination/pagination.d.ts +18 -0
- package/lib/pagination/pagination.template.d.ts +4 -0
- package/lib/popup/popup.d.ts +2 -2
- package/lib/text-area/text-area.d.ts +2 -1
- package/lib/tooltip/tooltip.d.ts +10 -4
- package/listbox/index.js +3 -2
- package/menu/index.js +7 -6
- package/menu-item/index.js +1 -1
- package/nav/index.js +1 -1
- package/nav-disclosure/index.js +1 -1
- package/nav-item/index.js +1 -1
- package/note/index.js +1 -1
- package/number-field/index.js +4 -4
- package/option/index.js +1 -1
- package/package.json +1 -1
- package/pagination/index.js +329 -0
- package/popup/index.js +4 -4
- package/progress/index.js +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.js +3 -2
- package/select/index.js +7 -6
- package/shared/children.js +1 -1
- package/shared/definition.js +3 -2
- package/shared/definition10.js +46 -63
- package/shared/definition11.js +38 -92
- package/shared/definition12.js +96 -31
- package/shared/definition13.js +85 -757
- package/shared/definition14.js +32 -95
- package/shared/definition15.js +758 -100
- package/shared/definition16.js +103 -24
- package/shared/definition17.js +96 -154
- package/shared/definition18.js +108 -663
- package/shared/definition19.js +667 -1532
- package/shared/definition2.js +1 -1
- package/shared/definition20.js +1532 -223
- package/shared/definition21.js +183 -964
- package/shared/definition22.js +1034 -218
- package/shared/definition23.js +226 -67
- package/shared/definition24.js +68 -77
- package/shared/definition25.js +76 -47
- package/shared/definition26.js +46 -32
- package/shared/definition27.js +39 -49
- package/shared/definition28.js +48 -344
- package/shared/definition29.js +273 -282
- package/shared/definition30.js +356 -14
- package/shared/definition31.js +13 -67
- package/shared/definition32.js +65 -21
- package/shared/definition33.js +21 -39
- package/shared/definition34.js +31 -432
- package/shared/definition35.js +432 -76
- package/shared/definition36.js +82 -33
- package/shared/definition37.js +31 -422
- package/shared/definition38.js +358 -564
- package/shared/definition39.js +628 -75
- package/shared/definition4.js +1 -1
- package/shared/definition40.js +70 -573
- package/shared/definition41.js +538 -81
- package/shared/definition42.js +127 -47
- package/shared/definition43.js +51 -16
- package/shared/definition44.js +17 -425
- package/shared/definition45.js +421 -103
- package/shared/definition46.js +114 -19
- package/shared/definition47.js +19 -269
- package/shared/definition48.js +244 -86
- package/shared/definition49.js +110 -70
- package/shared/definition5.js +1 -1
- package/shared/definition50.js +88 -67
- package/shared/definition51.js +69 -294
- package/shared/definition52.js +305 -0
- package/shared/definition6.js +142 -45
- package/shared/definition7.js +97 -24
- package/shared/definition8.js +22 -103
- package/shared/definition9.js +62 -102
- package/shared/enums.js +10 -9
- package/shared/es.object.assign.js +1 -1
- package/shared/form-associated.js +1 -1
- package/shared/form-elements.js +2 -2
- package/shared/index.js +1 -1
- package/shared/listbox.js +2 -2
- package/shared/node-observation.js +74 -0
- package/shared/patterns/form-elements/form-elements.d.ts +4 -4
- package/shared/repeat.js +1 -1
- package/shared/slotted.js +3 -73
- package/shared/text-field.js +1 -1
- package/shared/text-field2.js +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.js +1 -1
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/switch/index.js +1 -1
- package/tab/index.js +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.js +4 -3
- package/tag/index.js +1 -1
- package/tag-group/index.js +1 -1
- package/text-area/index.js +1 -1
- package/text-field/index.js +1 -1
- package/tooltip/index.js +5 -5
- package/tree-item/index.js +2 -1
- package/tree-view/index.js +2 -1
- package/vivid.api.json +128 -16
package/shared/definition42.js
CHANGED
|
@@ -1,67 +1,147 @@
|
|
|
1
|
-
import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactory } from './index.js';
|
|
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
2
|
import { i as iconRegistries } from './definition3.js';
|
|
3
3
|
import { f as focusRegistries } from './definition4.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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';
|
|
6
7
|
import { f as focusTemplateFactory } from './focus2.js';
|
|
8
|
+
import './form-elements.js';
|
|
9
|
+
import { w as when } from './when.js';
|
|
7
10
|
import { c as classNames } from './class-names.js';
|
|
8
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
|
+
|
|
9
26
|
/**
|
|
10
|
-
* A
|
|
27
|
+
* A Switch Custom HTML Element.
|
|
28
|
+
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#switch | ARIA switch }.
|
|
11
29
|
*
|
|
12
|
-
* @slot - The
|
|
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
|
|
13
39
|
*
|
|
14
40
|
* @public
|
|
15
41
|
*/
|
|
16
|
-
class
|
|
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
|
+
}
|
|
17
94
|
}
|
|
18
95
|
__decorate([
|
|
19
|
-
attr({ mode: "boolean" })
|
|
20
|
-
],
|
|
96
|
+
attr({ attribute: "readonly", mode: "boolean" })
|
|
97
|
+
], Switch$1.prototype, "readOnly", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
observable
|
|
100
|
+
], Switch$1.prototype, "defaultSlottedNodes", void 0);
|
|
21
101
|
|
|
22
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon,
|
|
102
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 08 May 2023 11:40:49 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}";
|
|
23
103
|
|
|
24
|
-
class
|
|
25
|
-
|
|
26
|
-
|
|
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);
|
|
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);
|
|
39
107
|
|
|
40
|
-
let
|
|
41
|
-
_t
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}) => classNames('base', ['disabled', Boolean(disabled)], ['selected', ariaSelected === 'true']);
|
|
46
|
-
function TabTemplate(context) {
|
|
47
|
-
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
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 => {
|
|
48
113
|
const focusTemplate = focusTemplateFactory(context);
|
|
49
|
-
return html(_t || (_t =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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}
|
|
55
130
|
</div>
|
|
56
|
-
|
|
57
|
-
}
|
|
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
|
+
};
|
|
58
135
|
|
|
59
|
-
const
|
|
60
|
-
baseName: '
|
|
61
|
-
template:
|
|
62
|
-
styles: css_248z
|
|
136
|
+
const switchDefinition = Switch.compose({
|
|
137
|
+
baseName: 'switch',
|
|
138
|
+
template: SwitchTemplate,
|
|
139
|
+
styles: css_248z,
|
|
140
|
+
shadowOptions: {
|
|
141
|
+
delegatesFocus: true
|
|
142
|
+
}
|
|
63
143
|
});
|
|
64
|
-
const
|
|
65
|
-
const
|
|
144
|
+
const switchRegistries = [switchDefinition(), ...iconRegistries, ...focusRegistries];
|
|
145
|
+
const registerSwitch = registerFactory(switchRegistries);
|
|
66
146
|
|
|
67
|
-
export {
|
|
147
|
+
export { switchRegistries as a, registerSwitch as r, switchDefinition as s };
|
package/shared/definition43.js
CHANGED
|
@@ -1,32 +1,67 @@
|
|
|
1
|
-
import { F as FoundationElement, h as html, r as registerFactory } from './index.js';
|
|
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';
|
|
2
8
|
|
|
3
9
|
/**
|
|
4
|
-
* A
|
|
10
|
+
* A Tab Component to be used with {@link @microsoft/fast-foundation#(Tabs:class)}
|
|
5
11
|
*
|
|
6
|
-
* @slot - The default slot for the
|
|
12
|
+
* @slot - The default slot for the tab content
|
|
7
13
|
*
|
|
8
14
|
* @public
|
|
9
15
|
*/
|
|
10
|
-
class
|
|
16
|
+
class Tab$1 extends FoundationElement {
|
|
11
17
|
}
|
|
18
|
+
__decorate([
|
|
19
|
+
attr({ mode: "boolean" })
|
|
20
|
+
], Tab$1.prototype, "disabled", void 0);
|
|
12
21
|
|
|
13
|
-
|
|
22
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 08 May 2023 11:40:49 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 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: 0;\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);
|
|
14
39
|
|
|
15
40
|
let _ = t => t,
|
|
16
41
|
_t;
|
|
17
|
-
|
|
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);
|
|
18
49
|
return html(_t || (_t = _`
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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);
|
|
23
57
|
}
|
|
24
58
|
|
|
25
|
-
const
|
|
26
|
-
baseName: 'tab
|
|
27
|
-
template:
|
|
59
|
+
const tabDefinition = Tab.compose({
|
|
60
|
+
baseName: 'tab',
|
|
61
|
+
template: TabTemplate,
|
|
62
|
+
styles: css_248z
|
|
28
63
|
});
|
|
29
|
-
const
|
|
30
|
-
const
|
|
64
|
+
const tabRegistries = [tabDefinition(), ...iconRegistries, ...focusRegistries];
|
|
65
|
+
const registerTab = registerFactory(tabRegistries);
|
|
31
66
|
|
|
32
|
-
export {
|
|
67
|
+
export { tabDefinition as a, registerTab as r, tabRegistries as t };
|