@vonage/vivid 3.25.0 → 3.26.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 +0 -1
- package/accordion-item/index.js +0 -1
- package/alert/index.js +0 -1
- package/avatar/index.js +0 -1
- package/badge/index.js +0 -1
- package/banner/index.js +0 -1
- package/breadcrumb-item/index.js +0 -1
- package/button/index.js +0 -1
- package/card/index.js +0 -1
- package/checkbox/index.js +0 -1
- package/combobox/index.js +0 -1
- package/custom-elements.json +35 -1
- package/data-grid/index.js +7 -2
- package/dialog/index.js +0 -1
- package/empty-state/index.js +0 -1
- package/fab/index.js +0 -1
- package/icon/index.js +0 -1
- package/index.js +27 -29
- package/lib/components.d.ts +0 -2
- package/lib/data-grid/data-grid-cell.d.ts +14 -1
- package/lib/data-grid/data-grid.options.d.ts +7 -0
- package/listbox/index.js +56 -11
- package/menu/index.js +2 -3
- package/menu-item/index.js +1 -2
- package/nav/index.js +1 -1
- package/nav-disclosure/index.js +1 -2
- package/nav-item/index.js +1 -2
- package/note/index.js +1 -2
- package/number-field/index.js +1 -2
- package/option/index.js +0 -1
- package/package.json +1 -1
- package/pagination/index.js +1 -2
- package/popup/index.js +0 -1
- package/progress/index.js +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.js +1 -1
- package/select/index.js +1 -2
- package/shared/definition.js +1 -1
- package/shared/definition10.js +1 -1
- package/shared/definition11.js +1 -1
- package/shared/definition12.js +1 -1
- package/shared/definition14.js +1 -1
- package/shared/definition15.js +1 -1
- package/shared/definition16.js +2 -2
- package/shared/definition17.js +1 -1
- package/shared/definition18.js +1 -1
- package/shared/definition19.js +1 -1
- package/shared/definition2.js +1 -1
- package/shared/definition21.js +1 -1
- package/shared/definition22.js +68 -21
- package/shared/definition23.js +1 -1
- package/shared/definition24.js +1 -1
- package/shared/definition25.js +1 -1
- package/shared/definition26.js +1 -1
- package/shared/definition27.js +1 -1
- package/shared/definition29.js +368 -48
- package/shared/definition30.js +301 -296
- package/shared/definition31.js +14 -376
- package/shared/definition32.js +70 -13
- package/shared/definition33.js +25 -66
- package/shared/definition34.js +39 -27
- package/shared/definition35.js +431 -31
- package/shared/definition36.js +214 -430
- package/shared/definition37.js +70 -209
- package/shared/definition38.js +33 -81
- package/shared/definition39.js +423 -32
- package/shared/definition4.js +1 -1
- package/shared/definition40.js +586 -358
- package/shared/definition41.js +73 -648
- package/shared/definition42.js +584 -70
- package/shared/definition43.js +81 -538
- package/shared/definition44.js +52 -127
- package/shared/definition45.js +16 -56
- package/shared/definition46.js +485 -17
- package/shared/definition47.js +99 -477
- package/shared/definition48.js +19 -114
- package/shared/definition49.js +276 -19
- package/shared/definition5.js +1 -1
- package/shared/definition50.js +89 -245
- package/shared/definition51.js +627 -118
- package/shared/definition52.js +86 -601
- package/shared/definition53.js +68 -112
- package/shared/definition54.js +294 -69
- package/shared/definition6.js +1 -1
- package/shared/definition7.js +1 -1
- package/shared/definition8.js +1 -1
- package/shared/definition9.js +1 -1
- package/shared/es.object.assign.js +1 -1
- package/shared/es.regexp.to-string.js +1 -1
- package/shared/es.string.includes.js +1 -1
- package/shared/form-elements.js +1 -1
- package/shared/icon.js +17 -13
- package/shared/index.js +1 -1
- package/shared/patterns/form-elements/form-elements.d.ts +4 -4
- package/shared/string-trim.js +1 -1
- package/shared/text-field.js +1 -1
- package/shared/to-string.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 -2
- package/tab/index.js +1 -2
- package/tab-panel/index.js +1 -1
- package/tabs/index.js +3 -4
- package/tag/index.js +1 -2
- package/tag-group/index.js +1 -1
- package/text-anchor/index.js +0 -1
- package/text-area/index.js +1 -2
- package/text-field/index.js +1 -2
- package/toggletip/index.js +1 -2
- package/tooltip/index.js +1 -2
- package/tree-item/index.js +1 -2
- package/tree-view/index.js +1 -1
- package/vivid.api.json +0 -191
- package/shared/definition55.js +0 -305
- package/shared/engine-is-node.js +0 -8
package/shared/definition37.js
CHANGED
|
@@ -1,233 +1,94 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as toString$1 } from './to-string.js';
|
|
4
|
-
import { w as whitespaces$1, s as stringTrim } from './string-trim.js';
|
|
5
|
-
import './es.regexp.to-string.js';
|
|
6
|
-
import './es.string.includes.js';
|
|
7
|
-
import { e as elements } from './node-observation.js';
|
|
8
|
-
import { r as ref } from './ref.js';
|
|
9
|
-
import { r as repeat } from './repeat.js';
|
|
10
|
-
import { c as children } from './children.js';
|
|
11
|
-
import { c as classNames } from './class-names.js';
|
|
1
|
+
import { c as classofRaw, G as _export, k as functionUncurryThis, _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { B as BaseProgress } from './base-progress.js';
|
|
12
3
|
import { w as when } from './when.js';
|
|
4
|
+
import { c as classNames } from './class-names.js';
|
|
13
5
|
|
|
14
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on
|
|
15
|
-
|
|
16
|
-
var global = global$1;
|
|
17
|
-
var fails = fails$1;
|
|
18
|
-
var uncurryThis = functionUncurryThis;
|
|
19
|
-
var toString = toString$1;
|
|
20
|
-
var trim = stringTrim.trim;
|
|
21
|
-
var whitespaces = whitespaces$1;
|
|
6
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Tue, 25 Jul 2023 07:38:24 GMT\n */\n.base {\n height: 6px;\n align-items: center;\n margin: 0;\n outline: none;\n}\n.base:not(.connotation-pacific).connotation-cta {\n /* @cssprop [--vvd-progress-cta-primary=var(--vvd-color-cta-500)] */\n --_connotation-color-primary: var(--vvd-progress-cta-primary, var(--vvd-color-cta-500));\n /* @cssprop [--vvd-progress-cta-soft=var(--vvd-color-cta-100)] */\n --_connotation-color-soft: var(--vvd-progress-cta-soft, var(--vvd-color-cta-100));\n}\n.base:not(.connotation-pacific).connotation-alert {\n /* @cssprop [--vvd-progress-alert-primary=var(--vvd-color-alert-500)] */\n --_connotation-color-primary: var(--vvd-progress-alert-primary, var(--vvd-color-alert-500));\n /* @cssprop [--vvd-progress-alert-soft=var(--vvd-color-alert-100)] */\n --_connotation-color-soft: var(--vvd-progress-alert-soft, var(--vvd-color-alert-100));\n}\n.base:not(.connotation-pacific).connotation-success {\n /* @cssprop [--vvd-progress-success-primary=var(--vvd-color-success-500)] */\n --_connotation-color-primary: var(--vvd-progress-success-primary, var(--vvd-color-success-500));\n /* @cssprop [--vvd-progress-success-soft=var(--vvd-color-success-100)] */\n --_connotation-color-soft: var(--vvd-progress-success-soft, var(--vvd-color-success-100));\n}\n.base:not(.connotation-pacific):not(.connotation-cta, .connotation-alert, .connotation-success) {\n /* @cssprop [--vvd-progress-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-progress-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-progress-accent-soft=var(--vvd-color-neutral-100)] */\n --_connotation-color-soft: var(--vvd-progress-accent-soft, var(--vvd-color-neutral-100));\n}\n.base:not(.connotation-pacific) {\n --_appearance-color-text: var(--_connotation-color-contrast);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transparent;\n}\n.base.connotation-pacific {\n --_connotation-color-primary: linear-gradient(to right, var(--vvd-color-information-200), var(--vvd-color-cta-600));\n}\n\n.progress {\n position: relative;\n display: flex;\n overflow: hidden;\n align-items: center;\n block-size: 100%;\n inline-size: 100%;\n /* Shape */\n}\n.base:not(.connotation-pacific) .progress {\n background-color: var(--_appearance-color-fill);\n}\n.base.connotation-pacific .progress {\n background-color: var(--vvd-color-neutral-100);\n}\n.base:not(.shape-sharp) .progress {\n border-radius: 3px;\n}\n\n.indeterminate {\n display: flex;\n background-color: var(--_connotation-color-primary);\n block-size: 100%;\n border-radius: inherit;\n inline-size: 100%;\n}\n\n.determinate {\n background-color: var(--_connotation-color-primary);\n block-size: 100%;\n border-radius: inherit;\n transition: all 0.2s ease-in-out;\n}\n.connotation-pacific .determinate {\n background-image: var(--_connotation-color-primary);\n}\n.reverse .determinate {\n position: absolute;\n right: 0;\n}\n.paused .determinate {\n background: var(--vvd-color-neutral-300);\n}\n\n.indicator-1 {\n animation: indeterminate-1 2s infinite;\n inline-size: 30%;\n}\n\n.indicator-2 {\n animation: indeterminate-2 2s infinite;\n inline-size: 60%;\n}\n\n.indicator-1,\n.indicator-2 {\n position: absolute;\n animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1);\n background-color: var(--vvd-color-neutral-100);\n block-size: 100%;\n opacity: 0;\n}\n.connotation-pacific .indicator-1,\n.connotation-pacific .indicator-2 {\n background-image: var(--_connotation-color-primary);\n}\n.paused .indicator-1,\n.paused .indicator-2 {\n animation-play-state: paused;\n background-color: var(--_connotation-color-primary);\n}\n.reverse .indicator-1,\n.reverse .indicator-2 {\n animation-direction: reverse;\n}\n\n@keyframes indeterminate-1 {\n 0% {\n opacity: 1;\n transform: translateX(-100%);\n }\n 70% {\n opacity: 1;\n transform: translateX(300%);\n }\n 70.01% {\n opacity: 0;\n }\n 100% {\n opacity: 0;\n transform: translateX(300%);\n }\n}\n@keyframes indeterminate-2 {\n 0% {\n opacity: 0;\n transform: translateX(-150%);\n }\n 29.99% {\n opacity: 0;\n }\n 30% {\n opacity: 1;\n transform: translateX(-150%);\n }\n 100% {\n opacity: 1;\n transform: translateX(166.66%);\n }\n}";
|
|
22
7
|
|
|
23
|
-
var
|
|
24
|
-
var Symbol = global.Symbol;
|
|
25
|
-
var ITERATOR = Symbol && Symbol.iterator;
|
|
26
|
-
var hex = /^[+-]?0x/i;
|
|
27
|
-
var exec = uncurryThis(hex.exec);
|
|
28
|
-
var FORCED = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
|
|
29
|
-
// MS Edge 18- broken with boxed symbols
|
|
30
|
-
|| (ITERATOR && !fails(function () { $parseInt$1(Object(ITERATOR)); }));
|
|
8
|
+
var classof = classofRaw;
|
|
31
9
|
|
|
32
|
-
// `
|
|
33
|
-
// https://tc39.es/ecma262/#sec-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return
|
|
37
|
-
}
|
|
10
|
+
// `IsArray` abstract operation
|
|
11
|
+
// https://tc39.es/ecma262/#sec-isarray
|
|
12
|
+
// eslint-disable-next-line es/no-array-isarray -- safe
|
|
13
|
+
var isArray$1 = Array.isArray || function isArray(argument) {
|
|
14
|
+
return classof(argument) == 'Array';
|
|
15
|
+
};
|
|
38
16
|
|
|
39
17
|
var $ = _export;
|
|
40
|
-
var
|
|
18
|
+
var uncurryThis = functionUncurryThis;
|
|
19
|
+
var isArray = isArray$1;
|
|
41
20
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
21
|
+
var nativeReverse = uncurryThis([].reverse);
|
|
22
|
+
var test = [1, 2];
|
|
23
|
+
|
|
24
|
+
// `Array.prototype.reverse` method
|
|
25
|
+
// https://tc39.es/ecma262/#sec-array.prototype.reverse
|
|
26
|
+
// fix for Safari 12.0 bug
|
|
27
|
+
// https://bugs.webkit.org/show_bug.cgi?id=188794
|
|
28
|
+
$({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
|
|
29
|
+
reverse: function reverse() {
|
|
30
|
+
// eslint-disable-next-line no-self-assign -- dirty hack
|
|
31
|
+
if (isArray(this)) this.length = this.length;
|
|
32
|
+
return nativeReverse(this);
|
|
33
|
+
}
|
|
46
34
|
});
|
|
47
35
|
|
|
48
|
-
|
|
49
|
-
const totalConverter = {
|
|
50
|
-
fromView: value => parseInt(value, 10),
|
|
51
|
-
toView: value => value.toString()
|
|
52
|
-
};
|
|
53
|
-
class Pagination extends FoundationElement {
|
|
36
|
+
class Progress extends BaseProgress {
|
|
54
37
|
constructor() {
|
|
55
|
-
super();
|
|
56
|
-
this.
|
|
57
|
-
this.total = 0;
|
|
58
|
-
this.selectedIndex = 0;
|
|
59
|
-
this.addEventListener('tabpressed', e => {
|
|
60
|
-
const {
|
|
61
|
-
value: currentLabel,
|
|
62
|
-
shiftKey
|
|
63
|
-
} = e.detail;
|
|
64
|
-
const index = this.paginationButtons.findIndex(button => Number(button.label) === currentLabel);
|
|
65
|
-
const focusDirection = shiftKey ? -1 : 1;
|
|
66
|
-
const newIndex = index + focusDirection;
|
|
67
|
-
if (newIndex < 0) {
|
|
68
|
-
return this.prevButton.focus();
|
|
69
|
-
}
|
|
70
|
-
if (newIndex > this.paginationButtons.length - 1) {
|
|
71
|
-
return this.nextButton.focus();
|
|
72
|
-
}
|
|
73
|
-
this.paginationButtons && this.paginationButtons[index + focusDirection].focus();
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
get pagesList() {
|
|
77
|
-
return new Array(this.total < MAX_DIGITS_AND_PLACEHOLDERS ? this.total : MAX_DIGITS_AND_PLACEHOLDERS).fill(0).map((_, i, arr) => {
|
|
78
|
-
if (i === 0) return 1;
|
|
79
|
-
if (i === arr.length - 1) return this.total;
|
|
80
|
-
if (this.selectedIndex !== undefined && this.total > MAX_DIGITS_AND_PLACEHOLDERS) {
|
|
81
|
-
if (this.selectedIndex < 4) {
|
|
82
|
-
if (i === MAX_DIGITS_AND_PLACEHOLDERS - 2) return '...';
|
|
83
|
-
}
|
|
84
|
-
if (this.selectedIndex >= 4 && this.selectedIndex <= this.total - 5) {
|
|
85
|
-
if (i > 1 && i < MAX_DIGITS_AND_PLACEHOLDERS - 2) return this.selectedIndex + (i - 2);
|
|
86
|
-
if (i === 1 || i === MAX_DIGITS_AND_PLACEHOLDERS - 2) return '...';
|
|
87
|
-
}
|
|
88
|
-
if (this.selectedIndex > this.total - 5) {
|
|
89
|
-
if (i > 1) return this.total - (6 - i);
|
|
90
|
-
if (i === 1) return '...';
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return i + 1;
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
totalChanged(_, newValue) {
|
|
97
|
-
if (newValue < 0) {
|
|
98
|
-
this.total = 0;
|
|
99
|
-
}
|
|
100
|
-
this.selectedIndex = 0;
|
|
101
|
-
}
|
|
102
|
-
selectedIndexChanged(oldValue, newValue) {
|
|
103
|
-
if (oldValue === undefined) return;
|
|
104
|
-
this.$emit('pagination-change', {
|
|
105
|
-
selectedIndex: newValue,
|
|
106
|
-
total: this.total,
|
|
107
|
-
oldIndex: oldValue
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
paginationButtonsChanged(_, newValue) {
|
|
111
|
-
newValue.forEach(button => {
|
|
112
|
-
button.shadowRoot.querySelector('button').classList.add('icon-only');
|
|
113
|
-
});
|
|
38
|
+
super(...arguments);
|
|
39
|
+
this.reverse = false;
|
|
114
40
|
}
|
|
115
41
|
}
|
|
116
|
-
__decorate([attr, __metadata("design:type", String)],
|
|
117
|
-
__decorate([
|
|
118
|
-
__decorate([observable, __metadata("design:type", Function)], Pagination.prototype, "prevButton", void 0);
|
|
119
|
-
__decorate([observable, __metadata("design:type", Function)], Pagination.prototype, "nextButton", void 0);
|
|
42
|
+
__decorate([attr(), __metadata("design:type", String)], Progress.prototype, "shape", void 0);
|
|
43
|
+
__decorate([attr(), __metadata("design:type", String)], Progress.prototype, "connotation", void 0);
|
|
120
44
|
__decorate([attr({
|
|
121
|
-
attribute: 'nav-icons',
|
|
122
45
|
mode: 'boolean'
|
|
123
|
-
}), __metadata("design:type", Object)],
|
|
124
|
-
__decorate([volatile, __metadata("design:type", Object), __metadata("design:paramtypes", [])], Pagination.prototype, "pagesList", null);
|
|
125
|
-
__decorate([attr({
|
|
126
|
-
mode: 'reflect',
|
|
127
|
-
converter: totalConverter
|
|
128
|
-
}), __metadata("design:type", Number)], Pagination.prototype, "total", void 0);
|
|
129
|
-
__decorate([attr({
|
|
130
|
-
mode: 'reflect',
|
|
131
|
-
converter: totalConverter,
|
|
132
|
-
attribute: 'selected-index'
|
|
133
|
-
}), __metadata("design:type", Object)], Pagination.prototype, "selectedIndex", void 0);
|
|
46
|
+
}), __metadata("design:type", Object)], Progress.prototype, "reverse", void 0);
|
|
134
47
|
|
|
135
48
|
let _2 = t => t,
|
|
136
49
|
_t,
|
|
137
50
|
_t2,
|
|
138
|
-
_t3
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
parent
|
|
149
|
-
}) => {
|
|
150
|
-
if (event.key === ' ' || event.key === 'Enter') {
|
|
151
|
-
handleSelection(value, {
|
|
152
|
-
parent
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
if (event.key === 'Tab') {
|
|
156
|
-
event.target.dispatchEvent(new CustomEvent('tabpressed', {
|
|
157
|
-
detail: {
|
|
158
|
-
value,
|
|
159
|
-
shiftKey: event.shiftKey
|
|
160
|
-
},
|
|
161
|
-
bubbles: true,
|
|
162
|
-
composed: true
|
|
163
|
-
}));
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
const getClasses = _ => classNames('control');
|
|
167
|
-
function getButtonAppearance(value, {
|
|
168
|
-
parent
|
|
169
|
-
}) {
|
|
170
|
-
return parent.selectedIndex === Number(value) - 1 ? 'filled' : 'ghost';
|
|
51
|
+
_t3;
|
|
52
|
+
const getClasses = ({
|
|
53
|
+
connotation,
|
|
54
|
+
shape,
|
|
55
|
+
reverse,
|
|
56
|
+
paused
|
|
57
|
+
}) => classNames('base', [`connotation-${connotation}`, Boolean(connotation)], [`shape-${shape}`, Boolean(shape)], ['reverse', Boolean(reverse)], ['paused', Boolean(paused)]);
|
|
58
|
+
function determinate() {
|
|
59
|
+
return html(_t || (_t = _2`
|
|
60
|
+
<span class="determinate" style="width: ${0}%"></span>`), x => x.percentComplete);
|
|
171
61
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
};
|
|
195
|
-
const PaginationTemplate = context => {
|
|
196
|
-
const buttonTag = context.tagFor(Button);
|
|
197
|
-
const paginationButtonTemplate = paginationButtonRenderer(buttonTag);
|
|
198
|
-
return html(_t4 || (_t4 = _2`
|
|
199
|
-
<div class="${0}">
|
|
200
|
-
<${0} class="prev-button" ${0}
|
|
201
|
-
label="${0}"
|
|
202
|
-
icon="${0}"
|
|
203
|
-
size="${0}"
|
|
204
|
-
?disabled="${0}"
|
|
205
|
-
@click="${0}"
|
|
206
|
-
></${0}>
|
|
207
|
-
<div id="buttons-wrapper" class="buttons-wrapper" ${0}>
|
|
208
|
-
${0}
|
|
209
|
-
</div>
|
|
210
|
-
<${0} class="next-button" ${0}
|
|
211
|
-
label="${0}"
|
|
212
|
-
icon="${0}"
|
|
213
|
-
size="${0}"
|
|
214
|
-
?disabled="${0}"
|
|
215
|
-
@click="${0}"
|
|
216
|
-
></${0}>
|
|
217
|
-
</div>`), getClasses, buttonTag, ref('prevButton'), x => !x.navIcons ? 'Previous' : null, x => x.navIcons ? 'chevron-left-line' : null, getPaginationSize, x => x.total === 0 || x.selectedIndex === 0, x => x.selectedIndex !== undefined && x.selectedIndex--, buttonTag, children({
|
|
218
|
-
property: 'paginationButtons',
|
|
219
|
-
filter: elements(buttonTag)
|
|
220
|
-
}), repeat(x => x.pagesList, paginationButtonTemplate, {
|
|
221
|
-
positioning: true
|
|
222
|
-
}), buttonTag, ref('nextButton'), x => !x.navIcons ? 'Next' : null, x => x.navIcons ? 'chevron-right-line' : null, getPaginationSize, x => x.total === 0 || x.selectedIndex === x.total - 1, x => x.selectedIndex !== undefined && x.selectedIndex++, buttonTag);
|
|
62
|
+
function indeterminate() {
|
|
63
|
+
return html(_t2 || (_t2 = _2`
|
|
64
|
+
<span class="indeterminate" name="indeterminate">
|
|
65
|
+
<span class="indicator-1"></span>
|
|
66
|
+
<span class="indicator-2"></span>
|
|
67
|
+
</span>`));
|
|
68
|
+
}
|
|
69
|
+
const ProgressTemplate = _ => {
|
|
70
|
+
return html(_t3 || (_t3 = _2`
|
|
71
|
+
<div
|
|
72
|
+
role="progressbar"
|
|
73
|
+
aria-valuenow="${0}"
|
|
74
|
+
aria-valuemin="${0}"
|
|
75
|
+
aria-valuemax="${0}"
|
|
76
|
+
class="${0}"
|
|
77
|
+
>
|
|
78
|
+
<div class="progress">
|
|
79
|
+
${0}
|
|
80
|
+
${0}
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
`), x => x.value, x => x.min, x => x.max, getClasses, when(x => typeof x.value === 'number', determinate()), when(x => typeof x.value !== 'number', indeterminate()));
|
|
223
84
|
};
|
|
224
85
|
|
|
225
|
-
const
|
|
226
|
-
baseName: '
|
|
227
|
-
template:
|
|
86
|
+
const progressDefinition = Progress.compose({
|
|
87
|
+
baseName: 'progress',
|
|
88
|
+
template: ProgressTemplate,
|
|
228
89
|
styles: css_248z
|
|
229
90
|
});
|
|
230
|
-
const
|
|
231
|
-
const
|
|
91
|
+
const progressRegistries = [progressDefinition()];
|
|
92
|
+
const registerProgress = registerFactory(progressRegistries);
|
|
232
93
|
|
|
233
|
-
export {
|
|
94
|
+
export { progressRegistries as a, progressDefinition as p, registerProgress as r };
|
package/shared/definition38.js
CHANGED
|
@@ -1,94 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { f as focusRegistries } from './definition4.js';
|
|
3
|
+
import { R as Radio } from './radio.js';
|
|
4
|
+
import { f as focusTemplateFactory } from './focus2.js';
|
|
3
5
|
import { w as when } from './when.js';
|
|
4
6
|
import { c as classNames } from './class-names.js';
|
|
5
7
|
|
|
6
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on
|
|
8
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Tue, 25 Jul 2023 07:38:24 GMT\n */\n@supports selector(:focus-visible) {\n :host(:focus) {\n outline: none;\n }\n}\n.base {\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n gap: 8px;\n}\n.base.connotation-cta {\n /* @cssprop [--vvd-radio-cta-primary=var(--vvd-color-cta-500)] */\n --_connotation-color-primary: var(--vvd-radio-cta-primary, var(--vvd-color-cta-500));\n /* @cssprop [--vvd-radio-cta-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-radio-cta-primary-text, var(--vvd-color-canvas));\n /* @cssprop [--vvd-radio-cta-primary-increment=var(--vvd-color-cta-600)] */\n --_connotation-color-primary-increment: var(--vvd-radio-cta-primary-increment, var(--vvd-color-cta-600));\n /* @cssprop [--vvd-radio-cta-intermediate=var(--vvd-color-cta-500)] */\n --_connotation-color-intermediate: var(--vvd-radio-cta-intermediate, var(--vvd-color-cta-500));\n /* @cssprop [--vvd-radio-cta-backdrop=var(--vvd-color-cta-50)] */\n --_connotation-color-backdrop: var(--vvd-radio-cta-backdrop, var(--vvd-color-cta-50));\n /* @cssprop [--vvd-radio-cta-firm=var(--vvd-color-cta-600)] */\n --_connotation-color-firm: var(--vvd-radio-cta-firm, var(--vvd-color-cta-600));\n}\n.base:not(.connotation-cta) {\n /* @cssprop [--vvd-radio-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-radio-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-radio-accent-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-radio-accent-primary-text, var(--vvd-color-canvas));\n /* @cssprop [--vvd-radio-accent-primary-increment=var(--vvd-color-neutral-800)] */\n --_connotation-color-primary-increment: var(--vvd-radio-accent-primary-increment, var(--vvd-color-neutral-800));\n /* @cssprop [--vvd-radio-accent-intermediate=var(--vvd-color-neutral-500)] */\n --_connotation-color-intermediate: var(--vvd-radio-accent-intermediate, var(--vvd-color-neutral-500));\n /* @cssprop [--vvd-radio-accent-backdrop=var(--vvd-color-canvas)] */\n --_connotation-color-backdrop: var(--vvd-radio-accent-backdrop, var(--vvd-color-canvas));\n /* @cssprop [--vvd-radio-accent-firm=var(--vvd-color-canvas-text)] */\n --_connotation-color-firm: var(--vvd-radio-accent-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: var(--_connotation-color-primary);\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: var(--vvd-color-neutral-100);\n --_appearance-color-outline: var(--vvd-color-neutral-300);\n}\n.base:where(.readonly):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n@supports (user-select: none) {\n .base {\n user-select: none;\n }\n}\n.base.disabled {\n cursor: not-allowed;\n pointer-events: none;\n}\n\n.control {\n position: relative;\n flex-shrink: 0;\n block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20));\n border-radius: 50%;\n box-shadow: inset 0 0 0 2px var(--_appearance-color-outline);\n inline-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20));\n}\n.base:not(.checked) .control {\n background-color: var(--_appearance-color-fill);\n}\n.control::after {\n position: absolute;\n background-color: var(--_appearance-color-outline);\n border-radius: inherit;\n content: \"\";\n inset: 5px;\n opacity: 1;\n transition: opacity 0.2s;\n}\n.base:not(.checked) .control::after {\n opacity: 0;\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: 50%;\n}\n:host(:not(:focus-visible)) .focus-indicator {\n display: none;\n}";
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
// `IsArray` abstract operation
|
|
11
|
-
// https://tc39.es/ecma262/#sec-isarray
|
|
12
|
-
// eslint-disable-next-line es/no-array-isarray -- safe
|
|
13
|
-
var isArray$1 = Array.isArray || function isArray(argument) {
|
|
14
|
-
return classof(argument) == 'Array';
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
var $ = _export;
|
|
18
|
-
var uncurryThis = functionUncurryThis;
|
|
19
|
-
var isArray = isArray$1;
|
|
20
|
-
|
|
21
|
-
var nativeReverse = uncurryThis([].reverse);
|
|
22
|
-
var test = [1, 2];
|
|
23
|
-
|
|
24
|
-
// `Array.prototype.reverse` method
|
|
25
|
-
// https://tc39.es/ecma262/#sec-array.prototype.reverse
|
|
26
|
-
// fix for Safari 12.0 bug
|
|
27
|
-
// https://bugs.webkit.org/show_bug.cgi?id=188794
|
|
28
|
-
$({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
|
|
29
|
-
reverse: function reverse() {
|
|
30
|
-
// eslint-disable-next-line no-self-assign -- dirty hack
|
|
31
|
-
if (isArray(this)) this.length = this.length;
|
|
32
|
-
return nativeReverse(this);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
class Progress extends BaseProgress {
|
|
37
|
-
constructor() {
|
|
38
|
-
super(...arguments);
|
|
39
|
-
this.reverse = false;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
__decorate([attr(), __metadata("design:type", String)], Progress.prototype, "shape", void 0);
|
|
43
|
-
__decorate([attr(), __metadata("design:type", String)], Progress.prototype, "connotation", void 0);
|
|
44
|
-
__decorate([attr({
|
|
45
|
-
mode: 'boolean'
|
|
46
|
-
}), __metadata("design:type", Object)], Progress.prototype, "reverse", void 0);
|
|
47
|
-
|
|
48
|
-
let _2 = t => t,
|
|
10
|
+
let _ = t => t,
|
|
49
11
|
_t,
|
|
50
|
-
_t2
|
|
51
|
-
_t3;
|
|
12
|
+
_t2;
|
|
52
13
|
const getClasses = ({
|
|
53
14
|
connotation,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}) => classNames('base', [`connotation-${connotation}`, Boolean(connotation)], [
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
aria-valuenow="${0}"
|
|
74
|
-
aria-valuemin="${0}"
|
|
75
|
-
aria-valuemax="${0}"
|
|
76
|
-
class="${0}"
|
|
77
|
-
>
|
|
78
|
-
<div class="progress">
|
|
79
|
-
${0}
|
|
80
|
-
${0}
|
|
81
|
-
</div>
|
|
15
|
+
checked,
|
|
16
|
+
readOnly,
|
|
17
|
+
disabled
|
|
18
|
+
}) => classNames('base', [`connotation-${connotation}`, Boolean(connotation)], ['checked', Boolean(checked)], ['readonly', Boolean(readOnly)], ['disabled', Boolean(disabled)]);
|
|
19
|
+
const RadioTemplate = context => {
|
|
20
|
+
const focusTemplate = focusTemplateFactory(context);
|
|
21
|
+
return html(_t || (_t = _`
|
|
22
|
+
<div class="${0}"
|
|
23
|
+
role="radio"
|
|
24
|
+
aria-checked="${0}"
|
|
25
|
+
aria-required="${0}"
|
|
26
|
+
aria-disabled="${0}"
|
|
27
|
+
@keypress="${0}"
|
|
28
|
+
@click="${0}"
|
|
29
|
+
>
|
|
30
|
+
<div class="control">
|
|
31
|
+
${0}
|
|
32
|
+
</div>
|
|
33
|
+
${0}
|
|
82
34
|
</div>
|
|
83
|
-
|
|
35
|
+
`), getClasses, x => x.checked, x => x.required, x => x.disabled, (x, c) => x.keypressHandler(c.event), (x, c) => x.clickHandler(c.event), () => focusTemplate, when(x => x.label, html(_t2 || (_t2 = _`<label class="label">${0}</label>`), x => x.label)));
|
|
84
36
|
};
|
|
85
37
|
|
|
86
|
-
const
|
|
87
|
-
baseName: '
|
|
88
|
-
template:
|
|
38
|
+
const radioDefinition = Radio.compose({
|
|
39
|
+
baseName: 'radio',
|
|
40
|
+
template: RadioTemplate,
|
|
89
41
|
styles: css_248z
|
|
90
42
|
});
|
|
91
|
-
const
|
|
92
|
-
const
|
|
43
|
+
const radioRegistries = [radioDefinition(), ...focusRegistries];
|
|
44
|
+
const registerRadio = registerFactory(radioRegistries);
|
|
93
45
|
|
|
94
|
-
export {
|
|
46
|
+
export { radioDefinition as a, radioRegistries as b, registerRadio as r };
|