@vonage/vivid 3.32.0 → 3.34.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 +5 -5
- package/accordion-item/index.js +4 -4
- package/action-group/index.js +1 -1
- package/alert/index.js +6 -6
- package/avatar/index.js +2 -2
- package/badge/index.js +2 -2
- package/banner/index.js +5 -5
- package/breadcrumb/index.js +1 -1
- package/breadcrumb-item/index.js +3 -3
- package/button/index.js +4 -4
- package/calendar/index.js +1 -1
- package/calendar-event/index.js +1 -1
- package/card/index.js +3 -3
- package/checkbox/index.js +5 -3
- package/combobox/index.js +8 -8
- package/custom-elements.json +246 -16
- package/data-grid/index.js +2 -2
- package/date-picker/index.js +9 -9
- package/dialog/index.js +6 -6
- package/divider/index.js +1 -1
- package/elevation/index.js +1 -1
- package/empty-state/index.js +2 -2
- package/fab/index.js +4 -4
- package/file-picker/index.js +5 -5
- package/focus/index.js +1 -1
- package/header/index.js +2 -2
- package/icon/index.js +1 -1
- package/index.js +59 -59
- package/layout/index.js +1 -1
- package/lib/calendar/calendar.d.ts +1 -1
- package/lib/date-picker/calendar/dateStr.d.ts +1 -0
- package/lib/date-picker/calendar/month.d.ts +1 -0
- package/lib/date-picker/calendar/year.d.ts +2 -0
- package/lib/date-picker/date-picker.d.ts +2 -0
- package/lib/icon/icon.d.ts +0 -1
- package/lib/listbox/listbox.d.ts +9 -1
- package/lib/text-field/text-field.d.ts +1 -0
- package/listbox/index.js +20 -16
- package/locales/en-GB.js +48 -14
- package/locales/en-US.js +48 -14
- package/locales/ja-JP.js +48 -14
- package/locales/zh-CN.js +48 -14
- package/menu/index.js +8 -8
- package/menu-item/index.js +4 -4
- package/nav/index.js +1 -1
- package/nav-disclosure/index.js +3 -3
- package/nav-item/index.js +3 -3
- package/note/index.js +2 -3
- package/number-field/index.js +6 -6
- package/option/index.js +3 -3
- package/package.json +2 -16
- package/pagination/index.js +5 -5
- package/popup/index.js +6 -6
- package/progress/index.js +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.js +2 -2
- package/radio-group/index.js +1 -1
- package/select/index.js +8 -8
- package/shared/affix.js +25 -9
- package/shared/apply-mixins.js +1 -1
- package/shared/breadcrumb-item.js +5 -5
- package/shared/button.js +13 -13
- package/shared/calendar-event.js +36 -16
- package/shared/definition.js +133 -194
- package/shared/definition10.js +225 -40
- package/shared/definition11.js +36 -32
- package/shared/definition12.js +763 -98
- package/shared/definition13.js +125 -89
- package/shared/definition14.js +207 -27
- package/shared/definition15.js +710 -731
- package/shared/definition16.js +1289 -47
- package/shared/definition17.js +6113 -93
- package/shared/definition18.js +242 -164
- package/shared/definition19.js +47 -692
- package/shared/definition2.js +199 -117
- package/shared/definition20.js +59 -1671
- package/shared/definition21.js +95 -255
- package/shared/definition22.js +2218 -1167
- package/shared/definition23.js +61 -5784
- package/shared/definition24.js +28 -117
- package/shared/definition25.js +52 -66
- package/shared/definition26.js +391 -214
- package/shared/definition27.js +441 -34
- package/shared/definition28.js +85 -73
- package/shared/definition29.js +21 -2283
- package/shared/definition3.js +61 -24
- package/shared/definition30.js +13 -49
- package/shared/definition31.js +54 -39
- package/shared/definition32.js +413 -375
- package/shared/definition33.js +223 -304
- package/shared/definition34.js +197 -13
- package/shared/definition35.js +88 -73
- package/shared/definition36.js +75 -25
- package/shared/definition37.js +434 -34
- package/shared/definition38.js +32 -432
- package/shared/definition39.js +677 -187
- package/shared/definition4.js +157 -12
- package/shared/definition40.js +95 -48
- package/shared/definition41.js +577 -31
- package/shared/definition42.js +126 -424
- package/shared/definition43.js +114 -618
- package/shared/definition44.js +24 -80
- package/shared/definition45.js +71 -543
- package/shared/definition46.js +499 -92
- package/shared/definition47.js +19 -133
- package/shared/definition48.js +129 -52
- package/shared/definition49.js +281 -17
- package/shared/definition5.js +71 -36
- package/shared/definition50.js +153 -484
- package/shared/definition51.js +131 -98
- package/shared/definition52.js +131 -16
- package/shared/definition53.js +80 -264
- package/shared/definition54.js +293 -118
- package/shared/definition55.js +12 -117
- package/shared/definition56.js +39 -68
- package/shared/definition57.js +166 -288
- package/shared/definition6.js +56 -111
- package/shared/definition7.js +120 -195
- package/shared/definition8.js +58 -23
- package/shared/definition9.js +92 -66
- package/shared/focus.js +2 -1
- package/shared/focus2.js +1 -1
- package/shared/form-associated.js +2 -2
- package/shared/icon.js +48 -27
- package/shared/index.js +7 -27
- package/shared/index2.js +108 -80
- package/shared/key-codes.js +1 -1
- package/shared/listbox.js +88 -11
- package/shared/patterns/form-elements/form-elements.d.ts +4 -4
- package/shared/radio.js +23 -7
- package/shared/repeat.js +1 -1
- package/shared/text-anchor.js +21 -4
- package/shared/text-anchor.template.js +37 -40
- package/shared/text-field.js +2 -2
- package/shared/text-field2.js +15 -15
- package/shared/tree-item.js +12 -12
- package/side-drawer/index.js +1 -1
- package/slider/index.js +2 -2
- package/split-button/index.js +3 -3
- package/style.css +6097 -0
- 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/styles/tokens/vivid-2-compat.css +1 -1
- package/switch/index.js +3 -3
- package/tab/index.js +3 -3
- package/tab-panel/index.js +1 -1
- package/tabs/index.js +5 -5
- package/tag/index.js +3 -3
- package/tag-group/index.js +1 -1
- package/text-anchor/index.js +1 -1
- package/text-area/index.js +3 -3
- package/text-field/index.js +3 -3
- package/toggletip/index.js +7 -7
- package/tooltip/index.js +7 -7
- package/tree-item/index.js +3 -3
- package/tree-view/index.js +1 -1
- package/lib/accordion/index.d.ts +0 -1
- package/lib/accordion-item/index.d.ts +0 -1
- package/lib/action-group/index.d.ts +0 -1
- package/lib/alert/index.d.ts +0 -1
- package/lib/avatar/index.d.ts +0 -1
- package/lib/badge/index.d.ts +0 -1
- package/lib/banner/index.d.ts +0 -1
- package/lib/breadcrumb/index.d.ts +0 -1
- package/lib/breadcrumb-item/index.d.ts +0 -1
- package/lib/button/index.d.ts +0 -1
- package/lib/calendar/index.d.ts +0 -1
- package/lib/calendar-event/index.d.ts +0 -1
- package/lib/card/index.d.ts +0 -1
- package/lib/checkbox/index.d.ts +0 -1
- package/lib/combobox/index.d.ts +0 -1
- package/lib/data-grid/index.d.ts +0 -1
- package/lib/date-picker/index.d.ts +0 -1
- package/lib/dialog/index.d.ts +0 -1
- package/lib/divider/index.d.ts +0 -1
- package/lib/elevation/index.d.ts +0 -1
- package/lib/empty-state/index.d.ts +0 -1
- package/lib/fab/index.d.ts +0 -1
- package/lib/file-picker/index.d.ts +0 -1
- package/lib/focus/index.d.ts +0 -1
- package/lib/header/index.d.ts +0 -1
- package/lib/icon/index.d.ts +0 -1
- package/lib/layout/index.d.ts +0 -1
- package/lib/listbox/index.d.ts +0 -1
- package/lib/menu/index.d.ts +0 -1
- package/lib/menu-item/index.d.ts +0 -1
- package/lib/nav/index.d.ts +0 -1
- package/lib/nav-disclosure/index.d.ts +0 -1
- package/lib/nav-item/index.d.ts +0 -1
- package/lib/note/index.d.ts +0 -1
- package/lib/number-field/index.d.ts +0 -1
- package/lib/option/index.d.ts +0 -1
- package/lib/pagination/index.d.ts +0 -1
- package/lib/popup/index.d.ts +0 -1
- package/lib/progress/index.d.ts +0 -1
- package/lib/progress-ring/index.d.ts +0 -1
- package/lib/radio/index.d.ts +0 -1
- package/lib/radio-group/index.d.ts +0 -1
- package/lib/select/index.d.ts +0 -1
- package/lib/side-drawer/index.d.ts +0 -1
- package/lib/slider/index.d.ts +0 -1
- package/lib/split-button/index.d.ts +0 -1
- package/lib/switch/index.d.ts +0 -1
- package/lib/tab/index.d.ts +0 -1
- package/lib/tab-panel/index.d.ts +0 -1
- package/lib/tabs/index.d.ts +0 -1
- package/lib/tag/index.d.ts +0 -1
- package/lib/tag-group/index.d.ts +0 -1
- package/lib/text-anchor/index.d.ts +0 -1
- package/lib/text-area/index.d.ts +0 -1
- package/lib/text-field/index.d.ts +0 -1
- package/lib/toggletip/index.d.ts +0 -1
- package/lib/tooltip/index.d.ts +0 -1
- package/lib/tree-item/index.d.ts +0 -1
- package/lib/tree-view/index.d.ts +0 -1
package/shared/definition34.js
CHANGED
|
@@ -1,19 +1,203 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as Size, S as Shape, B as Button, a as buttonRegistries } from './definition10.js';
|
|
2
|
+
import { a as attr, F as FoundationElement, o as observable, v as volatile, h as html, r as registerFactory } from './index.js';
|
|
3
|
+
import { e as elements } from './node-observation.js';
|
|
4
|
+
import { r as ref } from './ref.js';
|
|
5
|
+
import { c as children } from './children.js';
|
|
6
|
+
import { r as repeat } from './repeat.js';
|
|
7
|
+
import { c as classNames } from './class-names.js';
|
|
8
|
+
import { w as when } from './when.js';
|
|
2
9
|
|
|
3
|
-
|
|
10
|
+
const styles = "/**\n * Do not edit directly\n * Generated on Mon, 04 Sep 2023 12:44:18 GMT\n */\n.control {\n display: inline-flex;\n justify-content: space-between;\n}\n.control:not(.shape-pill) {\n border-radius: 4px;\n}\n.control.shape-pill {\n border-radius: 14px;\n}\n\n.buttons-wrapper {\n display: flex;\n column-gap: 4px;\n}\n\n.dots {\n align-self: center;\n text-align: center;\n}\n.dots:not(.size-super-condensed) {\n font: var(--vvd-typography-base-bold);\n}\n.dots.size-super-condensed {\n font: var(--vvd-typography-base-condensed-bold);\n inline-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n}\n.dots.size-condensed {\n inline-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8));\n}\n.dots.size-normal {\n inline-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}";
|
|
4
11
|
|
|
5
|
-
|
|
12
|
+
var __defProp = Object.defineProperty;
|
|
13
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
14
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
15
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
16
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
17
|
+
if (decorator = decorators[i])
|
|
18
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
19
|
+
if (kind && result)
|
|
20
|
+
__defProp(target, key, result);
|
|
21
|
+
return result;
|
|
22
|
+
};
|
|
23
|
+
const MAX_DIGITS_AND_PLACEHOLDERS = 7;
|
|
24
|
+
const totalConverter = {
|
|
25
|
+
fromView: (value) => parseInt(value, 10),
|
|
26
|
+
toView: (value) => value.toString()
|
|
27
|
+
};
|
|
28
|
+
class Pagination extends FoundationElement {
|
|
29
|
+
constructor() {
|
|
30
|
+
super();
|
|
31
|
+
this.navIcons = false;
|
|
32
|
+
this.total = 0;
|
|
33
|
+
this.selectedIndex = 0;
|
|
34
|
+
this.addEventListener("tabpressed", (e) => {
|
|
35
|
+
const { value: currentLabel, shiftKey } = e.detail;
|
|
36
|
+
const index = this.paginationButtons.findIndex((button) => Number(button.label) === currentLabel);
|
|
37
|
+
const focusDirection = shiftKey ? -1 : 1;
|
|
38
|
+
const newIndex = index + focusDirection;
|
|
39
|
+
if (newIndex < 0) {
|
|
40
|
+
return this.prevButton.focus();
|
|
41
|
+
}
|
|
42
|
+
if (newIndex > this.paginationButtons.length - 1) {
|
|
43
|
+
return this.nextButton.focus();
|
|
44
|
+
}
|
|
45
|
+
this.paginationButtons && this.paginationButtons[index + focusDirection].focus();
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
get pagesList() {
|
|
49
|
+
return new Array(this.total < MAX_DIGITS_AND_PLACEHOLDERS ? this.total : MAX_DIGITS_AND_PLACEHOLDERS).fill(0).map((_, i, arr) => {
|
|
50
|
+
if (i === 0)
|
|
51
|
+
return 1;
|
|
52
|
+
if (i === arr.length - 1)
|
|
53
|
+
return this.total;
|
|
54
|
+
if (this.selectedIndex !== void 0 && this.total > MAX_DIGITS_AND_PLACEHOLDERS) {
|
|
55
|
+
if (this.selectedIndex < 4) {
|
|
56
|
+
if (i === MAX_DIGITS_AND_PLACEHOLDERS - 2)
|
|
57
|
+
return "...";
|
|
58
|
+
}
|
|
59
|
+
if (this.selectedIndex >= 4 && this.selectedIndex <= this.total - 5) {
|
|
60
|
+
if (i > 1 && i < MAX_DIGITS_AND_PLACEHOLDERS - 2)
|
|
61
|
+
return this.selectedIndex + (i - 2);
|
|
62
|
+
if (i === 1 || i === MAX_DIGITS_AND_PLACEHOLDERS - 2)
|
|
63
|
+
return "...";
|
|
64
|
+
}
|
|
65
|
+
if (this.selectedIndex > this.total - 5) {
|
|
66
|
+
if (i > 1)
|
|
67
|
+
return this.total - (6 - i);
|
|
68
|
+
if (i === 1)
|
|
69
|
+
return "...";
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return i + 1;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
totalChanged(_, newValue) {
|
|
76
|
+
if (newValue < 0) {
|
|
77
|
+
this.total = 0;
|
|
78
|
+
}
|
|
79
|
+
this.selectedIndex = 0;
|
|
80
|
+
}
|
|
81
|
+
selectedIndexChanged(oldValue, newValue) {
|
|
82
|
+
if (oldValue === void 0)
|
|
83
|
+
return;
|
|
84
|
+
this.$emit("pagination-change", { selectedIndex: newValue, total: this.total, oldIndex: oldValue });
|
|
85
|
+
}
|
|
86
|
+
paginationButtonsChanged(_, newValue) {
|
|
87
|
+
newValue.forEach((button) => {
|
|
88
|
+
button.shadowRoot.querySelector("button").classList.add("icon-only");
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
__decorateClass([
|
|
93
|
+
attr
|
|
94
|
+
], Pagination.prototype, "size", 2);
|
|
95
|
+
__decorateClass([
|
|
96
|
+
attr
|
|
97
|
+
], Pagination.prototype, "shape", 2);
|
|
98
|
+
__decorateClass([
|
|
99
|
+
observable
|
|
100
|
+
], Pagination.prototype, "paginationButtons", 2);
|
|
101
|
+
__decorateClass([
|
|
102
|
+
observable
|
|
103
|
+
], Pagination.prototype, "prevButton", 2);
|
|
104
|
+
__decorateClass([
|
|
105
|
+
observable
|
|
106
|
+
], Pagination.prototype, "nextButton", 2);
|
|
107
|
+
__decorateClass([
|
|
108
|
+
attr({ attribute: "nav-icons", mode: "boolean" })
|
|
109
|
+
], Pagination.prototype, "navIcons", 2);
|
|
110
|
+
__decorateClass([
|
|
111
|
+
volatile
|
|
112
|
+
], Pagination.prototype, "pagesList", 1);
|
|
113
|
+
__decorateClass([
|
|
114
|
+
attr({ mode: "reflect", converter: totalConverter })
|
|
115
|
+
], Pagination.prototype, "total", 2);
|
|
116
|
+
__decorateClass([
|
|
117
|
+
attr({ mode: "reflect", converter: totalConverter, attribute: "selected-index" })
|
|
118
|
+
], Pagination.prototype, "selectedIndex", 2);
|
|
6
119
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
120
|
+
const ALLOWED_SIZES = [Size.SuperCondensed, Size.Condensed, Size.Normal];
|
|
121
|
+
const ALLOWED_SHAPES = [Shape.Rounded, Shape.Pill];
|
|
122
|
+
const handleSelection = (value, { parent: x }) => {
|
|
123
|
+
return x.selectedIndex = Number(value) - 1;
|
|
124
|
+
};
|
|
125
|
+
const handleKeyDown = (value, { event, parent }) => {
|
|
126
|
+
if (event.key === " " || event.key === "Enter") {
|
|
127
|
+
handleSelection(value, { parent });
|
|
128
|
+
}
|
|
129
|
+
if (event.key === "Tab") {
|
|
130
|
+
event.target.dispatchEvent(
|
|
131
|
+
new CustomEvent("tabpressed", { detail: { value, shiftKey: event.shiftKey }, bubbles: true, composed: true })
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
const getClasses = (_) => classNames("control");
|
|
136
|
+
function getButtonAppearance(value, { parent }) {
|
|
137
|
+
return parent.selectedIndex === Number(value) - 1 ? "filled" : "ghost";
|
|
138
|
+
}
|
|
139
|
+
const paginationButtonRenderer = (buttonTag) => html`
|
|
140
|
+
${when(
|
|
141
|
+
(value) => value !== "...",
|
|
142
|
+
html`
|
|
143
|
+
<${buttonTag} class="vwc-pagination-button"
|
|
144
|
+
label="${(value) => value}"
|
|
145
|
+
appearance="${getButtonAppearance}"
|
|
146
|
+
size="${(_, { parent: x }) => getPaginationSize(x)}"
|
|
147
|
+
shape="${(_, { parent: x }) => getPaginationShape(x)}"
|
|
148
|
+
tabindex="0"
|
|
149
|
+
aria-pressed="${(value, { parent }) => parent.selectedIndex === Number(value) - 1}"
|
|
150
|
+
@click="${handleSelection}"
|
|
151
|
+
@keydown="${handleKeyDown}"
|
|
152
|
+
</${buttonTag}>
|
|
153
|
+
`
|
|
154
|
+
)}
|
|
155
|
+
${when((value) => value === "...", html`<div class="dots size-${getPaginationSize} shape-${getPaginationShape}">...</div>`)}`;
|
|
156
|
+
const getPaginationSize = (x) => {
|
|
157
|
+
if (!x.size || !ALLOWED_SIZES.includes(x.size)) {
|
|
158
|
+
return Size.SuperCondensed;
|
|
159
|
+
}
|
|
160
|
+
return x.size;
|
|
161
|
+
};
|
|
162
|
+
const getPaginationShape = (x) => {
|
|
163
|
+
if (!x.shape || !ALLOWED_SHAPES.includes(x.shape)) {
|
|
164
|
+
return Shape.Rounded;
|
|
165
|
+
}
|
|
166
|
+
return x.shape;
|
|
167
|
+
};
|
|
168
|
+
const PaginationTemplate = (context) => {
|
|
169
|
+
const buttonTag = context.tagFor(Button);
|
|
170
|
+
const paginationButtonTemplate = paginationButtonRenderer(buttonTag);
|
|
171
|
+
return html`
|
|
172
|
+
<div class="${getClasses}">
|
|
173
|
+
<${buttonTag} class="prev-button" ${ref("prevButton")}
|
|
174
|
+
label="${(x) => !x.navIcons ? "Previous" : null}"
|
|
175
|
+
icon="${(x) => x.navIcons ? "chevron-left-line" : null}"
|
|
176
|
+
size="${getPaginationSize}"
|
|
177
|
+
shape="${getPaginationShape}"
|
|
178
|
+
?disabled="${(x) => x.total === 0 || x.selectedIndex === 0}"
|
|
179
|
+
@click="${(x) => x.selectedIndex !== void 0 && x.selectedIndex--}"
|
|
180
|
+
></${buttonTag}>
|
|
181
|
+
<div id="buttons-wrapper" class="buttons-wrapper" ${children({ property: "paginationButtons", filter: elements(buttonTag) })}>
|
|
182
|
+
${repeat((x) => x.pagesList, paginationButtonTemplate, { positioning: true })}
|
|
183
|
+
</div>
|
|
184
|
+
<${buttonTag} class="next-button" ${ref("nextButton")}
|
|
185
|
+
label="${(x) => !x.navIcons ? "Next" : null}"
|
|
186
|
+
icon="${(x) => x.navIcons ? "chevron-right-line" : null}"
|
|
187
|
+
size="${getPaginationSize}"
|
|
188
|
+
shape="${getPaginationShape}"
|
|
189
|
+
?disabled="${(x) => x.total === 0 || x.selectedIndex === x.total - 1}"
|
|
190
|
+
@click="${(x) => x.selectedIndex !== void 0 && x.selectedIndex++}"
|
|
191
|
+
></${buttonTag}>
|
|
192
|
+
</div>`;
|
|
193
|
+
};
|
|
10
194
|
|
|
11
|
-
const
|
|
12
|
-
baseName:
|
|
13
|
-
template:
|
|
14
|
-
styles
|
|
195
|
+
const paginationDefinition = Pagination.compose({
|
|
196
|
+
baseName: "pagination",
|
|
197
|
+
template: PaginationTemplate,
|
|
198
|
+
styles
|
|
15
199
|
});
|
|
16
|
-
const
|
|
17
|
-
const
|
|
200
|
+
const paginationRegistries = [paginationDefinition(), buttonRegistries];
|
|
201
|
+
const registerPagination = registerFactory(paginationRegistries);
|
|
18
202
|
|
|
19
|
-
export {
|
|
203
|
+
export { paginationRegistries as a, paginationDefinition as p, registerPagination as r };
|
package/shared/definition35.js
CHANGED
|
@@ -1,81 +1,96 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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 { I as Icon } from './icon.js';
|
|
7
|
-
import { f as focusTemplateFactory } from './focus2.js';
|
|
8
|
-
import { r as ref } from './ref.js';
|
|
1
|
+
import { a as attr, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { B as BaseProgress } from './base-progress.js';
|
|
9
3
|
import { w as when } from './when.js';
|
|
4
|
+
import { c as classNames } from './class-names.js';
|
|
10
5
|
|
|
11
|
-
|
|
6
|
+
const styles = "/**\n * Do not edit directly\n * Generated on Mon, 04 Sep 2023 12:44:18 GMT\n */\n.base {\n align-items: center;\n block-size: var(--_size);\n color: var(--_appearance-color-text);\n inline-size: var(--_size);\n outline: none;\n}\n.base.connotation-cta {\n /* @cssprop [--vvd-progress-ring-cta-primary=var(--vvd-color-cta-500)] */\n --_connotation-color-primary: var(--vvd-progress-ring-cta-primary, var(--vvd-color-cta-500));\n}\n.base.connotation-alert {\n /* @cssprop [--vvd-progress-ring-alert-primary=var(--vvd-color-alert-500)] */\n --_connotation-color-primary: var(--vvd-progress-ring-alert-primary, var(--vvd-color-alert-500));\n}\n.base.connotation-success {\n /* @cssprop [--vvd-progress-ring-success-primary=var(--vvd-color-success-500)] */\n --_connotation-color-primary: var(--vvd-progress-ring-success-primary, var(--vvd-color-success-500));\n}\n.base:not(.connotation-cta, .connotation-alert, .connotation-success) {\n /* @cssprop [--vvd-progress-ring-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-progress-ring-accent-primary, var(--vvd-color-canvas-text));\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(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base.size--6 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)) - 1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n}\n.base.size--5 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20));\n}\n.base.size--4 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n}\n.base.size--3 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 12));\n}\n.base.size--2 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8));\n}\n.base.size--1 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 4));\n}\n.base.size-1 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 4));\n}\n.base.size-2 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 8));\n}\n.base.size-3 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 12));\n}\n.base.size-4 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 16));\n}\n.base.size-5 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 20));\n}\n.base:not(.size--6, .size--5, .size--4, .size--3, .size--2, .size--1, .size-1, .size-2, .size-3, .size-4, .size-5) {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}\n\n.progress {\n width: 100%;\n height: 100%;\n}\n\n.background {\n fill: none;\n stroke: transparent;\n stroke-width: 1px;\n}\n\n.determinate {\n fill: none;\n stroke: currentColor;\n stroke-linecap: round;\n stroke-width: 1px;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n transition: all 0.2s ease-in-out;\n}\n\n.indeterminate-indicator-1 {\n animation: spin-infinite 2s linear infinite;\n fill: none;\n stroke: currentColor;\n stroke-linecap: round;\n stroke-width: 1px;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n transition: all 0.2s ease-in-out;\n}\n\n.base.paused .indeterminate-indicator-1 {\n animation-play-state: paused;\n}\n\n@keyframes spin-infinite {\n 0% {\n stroke-dasharray: 0.01px 43.97px;\n transform: rotate(0deg);\n }\n 50% {\n stroke-dasharray: 21.99px 21.99px;\n transform: rotate(450deg);\n }\n 100% {\n stroke-dasharray: 0.01px 43.97px;\n transform: rotate(1080deg);\n }\n}";
|
|
12
7
|
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
connectedCallback() {
|
|
27
|
-
super.connectedCallback();
|
|
28
|
-
this.details.addEventListener('toggle', __classPrivateFieldGet(this, _NavDisclosure_onToggle, "f"));
|
|
29
|
-
this.details.open = this.open;
|
|
30
|
-
}
|
|
31
|
-
disconnectedCallback() {
|
|
32
|
-
super.disconnectedCallback();
|
|
33
|
-
this.details.removeEventListener('toggle', __classPrivateFieldGet(this, _NavDisclosure_onToggle, "f"));
|
|
34
|
-
}
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
11
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
12
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
13
|
+
if (decorator = decorators[i])
|
|
14
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
15
|
+
if (kind && result)
|
|
16
|
+
__defProp(target, key, result);
|
|
17
|
+
return result;
|
|
18
|
+
};
|
|
19
|
+
class ProgressRing extends BaseProgress {
|
|
35
20
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
attribute: 'aria-current'
|
|
43
|
-
}), __metadata("design:type", Object)], NavDisclosure.prototype, "ariaCurrent", void 0);
|
|
44
|
-
applyMixins(NavDisclosure, AffixIcon);
|
|
21
|
+
__decorateClass([
|
|
22
|
+
attr
|
|
23
|
+
], ProgressRing.prototype, "connotation", 2);
|
|
24
|
+
__decorateClass([
|
|
25
|
+
attr
|
|
26
|
+
], ProgressRing.prototype, "size", 2);
|
|
45
27
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
28
|
+
const getClasses = ({ connotation, size, paused }) => classNames(
|
|
29
|
+
"base",
|
|
30
|
+
["disabled", !!paused],
|
|
31
|
+
[`connotation-${connotation}`, !!connotation],
|
|
32
|
+
[`size-${size}`, !!size]
|
|
33
|
+
);
|
|
34
|
+
const progressSegments = 44;
|
|
35
|
+
const ProgressRingTemplate = (_) => html`
|
|
36
|
+
<div
|
|
37
|
+
role="progressbar"
|
|
38
|
+
aria-valuenow="${(x) => x.value}"
|
|
39
|
+
aria-valuemin="${(x) => x.min}"
|
|
40
|
+
aria-valuemax="${(x) => x.max}"
|
|
41
|
+
class="${(x) => x.paused ? "paused" : ""} ${getClasses}"
|
|
42
|
+
>
|
|
43
|
+
${when(
|
|
44
|
+
(x) => typeof x.value === "number",
|
|
45
|
+
html`
|
|
46
|
+
<svg
|
|
47
|
+
class="progress"
|
|
48
|
+
viewBox="0 0 16 16"
|
|
49
|
+
>
|
|
50
|
+
<circle
|
|
51
|
+
class="background"
|
|
52
|
+
cx="8px"
|
|
53
|
+
cy="8px"
|
|
54
|
+
r="7px"
|
|
55
|
+
></circle>
|
|
56
|
+
<circle
|
|
57
|
+
class="determinate"
|
|
58
|
+
style="stroke-dasharray: ${(x) => progressSegments * x.percentComplete / 100}px ${progressSegments}px"
|
|
59
|
+
cx="8px"
|
|
60
|
+
cy="8px"
|
|
61
|
+
r="7px"
|
|
62
|
+
></circle>
|
|
63
|
+
</svg>
|
|
64
|
+
`
|
|
65
|
+
)}
|
|
66
|
+
${when(
|
|
67
|
+
(x) => typeof x.value !== "number",
|
|
68
|
+
html`
|
|
69
|
+
<svg class="progress" viewBox="0 0 16 16">
|
|
70
|
+
<circle
|
|
71
|
+
class="background"
|
|
72
|
+
cx="8px"
|
|
73
|
+
cy="8px"
|
|
74
|
+
r="7px"
|
|
75
|
+
></circle>
|
|
76
|
+
<circle
|
|
77
|
+
class="indeterminate-indicator-1"
|
|
78
|
+
cx="8px"
|
|
79
|
+
cy="8px"
|
|
80
|
+
r="7px"
|
|
81
|
+
></circle>
|
|
82
|
+
</svg>
|
|
83
|
+
`
|
|
84
|
+
)}
|
|
85
|
+
</div>
|
|
86
|
+
`;
|
|
72
87
|
|
|
73
|
-
const
|
|
74
|
-
baseName:
|
|
75
|
-
template:
|
|
76
|
-
styles
|
|
88
|
+
const progressRingDefinition = ProgressRing.compose({
|
|
89
|
+
baseName: "progress-ring",
|
|
90
|
+
template: ProgressRingTemplate,
|
|
91
|
+
styles
|
|
77
92
|
});
|
|
78
|
-
const
|
|
79
|
-
const
|
|
93
|
+
const progressRingRegistries = [progressRingDefinition()];
|
|
94
|
+
const registerProgressRing = registerFactory(progressRingRegistries);
|
|
80
95
|
|
|
81
|
-
export {
|
|
96
|
+
export { ProgressRing as P, progressRingRegistries as a, progressRingDefinition as p, registerProgressRing as r };
|
package/shared/definition36.js
CHANGED
|
@@ -1,33 +1,83 @@
|
|
|
1
|
-
import { h as html, r as registerFactory } from './index.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { T as TextAnchor } from './text-anchor.js';
|
|
6
|
-
import { a as applyMixins } from './apply-mixins.js';
|
|
7
|
-
import { t as textAnchorTemplate } from './text-anchor.template.js';
|
|
1
|
+
import { a as attr, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { B as BaseProgress } from './base-progress.js';
|
|
3
|
+
import { w as when } from './when.js';
|
|
4
|
+
import { c as classNames } from './class-names.js';
|
|
8
5
|
|
|
9
|
-
|
|
6
|
+
const styles = "/**\n * Do not edit directly\n * Generated on Mon, 04 Sep 2023 12:44:18 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}";
|
|
10
7
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
11
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
12
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
13
|
+
if (decorator = decorators[i])
|
|
14
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
15
|
+
if (kind && result)
|
|
16
|
+
__defProp(target, key, result);
|
|
17
|
+
return result;
|
|
18
|
+
};
|
|
19
|
+
class Progress extends BaseProgress {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.reverse = false;
|
|
14
23
|
}
|
|
15
24
|
}
|
|
16
|
-
|
|
25
|
+
__decorateClass([
|
|
26
|
+
attr()
|
|
27
|
+
], Progress.prototype, "shape", 2);
|
|
28
|
+
__decorateClass([
|
|
29
|
+
attr()
|
|
30
|
+
], Progress.prototype, "connotation", 2);
|
|
31
|
+
__decorateClass([
|
|
32
|
+
attr({ mode: "boolean" })
|
|
33
|
+
], Progress.prototype, "reverse", 2);
|
|
17
34
|
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
35
|
+
const getClasses = ({
|
|
36
|
+
connotation,
|
|
37
|
+
shape,
|
|
38
|
+
reverse,
|
|
39
|
+
paused
|
|
40
|
+
}) => classNames(
|
|
41
|
+
"base",
|
|
42
|
+
[`connotation-${connotation}`, Boolean(connotation)],
|
|
43
|
+
[`shape-${shape}`, Boolean(shape)],
|
|
44
|
+
["reverse", Boolean(reverse)],
|
|
45
|
+
["paused", Boolean(paused)]
|
|
46
|
+
);
|
|
47
|
+
function determinate() {
|
|
48
|
+
return html`
|
|
49
|
+
<span class="determinate" style="width: ${(x) => x.percentComplete}%"></span>`;
|
|
50
|
+
}
|
|
51
|
+
function indeterminate() {
|
|
52
|
+
return html`
|
|
53
|
+
<span class="indeterminate" name="indeterminate">
|
|
54
|
+
<span class="indicator-1"></span>
|
|
55
|
+
<span class="indicator-2"></span>
|
|
56
|
+
</span>`;
|
|
57
|
+
}
|
|
58
|
+
const ProgressTemplate = (_) => {
|
|
59
|
+
return html`
|
|
60
|
+
<div
|
|
61
|
+
role="progressbar"
|
|
62
|
+
aria-valuenow="${(x) => x.value}"
|
|
63
|
+
aria-valuemin="${(x) => x.min}"
|
|
64
|
+
aria-valuemax="${(x) => x.max}"
|
|
65
|
+
class="${getClasses}"
|
|
66
|
+
>
|
|
67
|
+
<div class="progress">
|
|
68
|
+
${when((x) => typeof x.value === "number", determinate())}
|
|
69
|
+
${when((x) => typeof x.value !== "number", indeterminate())}
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
`;
|
|
73
|
+
};
|
|
21
74
|
|
|
22
|
-
const
|
|
23
|
-
baseName:
|
|
24
|
-
template:
|
|
25
|
-
styles
|
|
26
|
-
shadowOptions: {
|
|
27
|
-
delegatesFocus: true
|
|
28
|
-
}
|
|
75
|
+
const progressDefinition = Progress.compose({
|
|
76
|
+
baseName: "progress",
|
|
77
|
+
template: ProgressTemplate,
|
|
78
|
+
styles
|
|
29
79
|
});
|
|
30
|
-
const
|
|
31
|
-
const
|
|
80
|
+
const progressRegistries = [progressDefinition()];
|
|
81
|
+
const registerProgress = registerFactory(progressRegistries);
|
|
32
82
|
|
|
33
|
-
export {
|
|
83
|
+
export { progressRegistries as a, progressDefinition as p, registerProgress as r };
|