@vonage/vivid 3.30.0 → 3.32.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/alert/index.js +2 -1
- package/checkbox/index.js +2 -1
- package/combobox/index.js +2 -1
- package/custom-elements.json +811 -18
- package/date-picker/index.js +35 -0
- package/dialog/index.js +1 -1
- package/divider/index.js +1 -1
- package/empty-state/index.js +1 -1
- package/fab/index.js +1 -1
- package/file-picker/index.js +3 -2
- package/header/index.js +1 -1
- package/index.d.ts +1 -0
- package/index.js +48 -46
- package/layout/index.js +1 -1
- package/lib/button/button.d.ts +2 -0
- package/lib/components.d.ts +20 -19
- package/lib/date-picker/calendar/calendarGrid.d.ts +17 -0
- package/lib/date-picker/calendar/dateStr.d.ts +6 -0
- package/lib/date-picker/calendar/month.d.ts +11 -0
- package/lib/date-picker/calendar/monthPickerGrid.d.ts +10 -0
- package/lib/date-picker/calendar/presentationDate.d.ts +4 -0
- package/lib/date-picker/date-picker.d.ts +16 -0
- package/lib/date-picker/date-picker.template.d.ts +4 -0
- package/lib/date-picker/definition.d.ts +3 -0
- package/lib/date-picker/index.d.ts +1 -0
- package/lib/date-picker/locale.d.ts +21 -0
- package/lib/nav-disclosure/nav-disclosure.d.ts +1 -0
- package/lib/pagination/definition.d.ts +1 -0
- package/lib/pagination/pagination.d.ts +3 -1
- package/lib/select/select.d.ts +4 -2
- package/listbox/index.js +3 -2
- package/locales/en-GB.d.ts +3 -0
- package/locales/en-GB.js +25 -0
- package/locales/en-US.d.ts +3 -0
- package/locales/en-US.js +25 -0
- package/locales/ja-JP.d.ts +3 -0
- package/locales/ja-JP.js +25 -0
- package/locales/zh-CN.d.ts +3 -0
- package/locales/zh-CN.js +25 -0
- package/menu/index.js +2 -2
- 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 +3 -2
- package/number-field/index.js +4 -3
- package/option/index.js +2 -1
- package/package.json +2 -1
- package/pagination/index.js +1 -1
- package/progress/index.js +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.js +1 -1
- package/select/index.js +3 -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 +1 -1
- package/shared/definition17.js +1 -1
- package/shared/definition18.js +2 -2
- package/shared/definition19.js +2 -2
- package/shared/definition2.js +1 -1
- package/shared/definition21.js +3 -3
- package/shared/definition22.js +2 -2
- package/shared/definition23.js +5750 -189
- package/shared/definition24.js +116 -68
- package/shared/definition25.js +68 -38
- package/shared/definition26.js +222 -74
- package/shared/definition27.js +33 -2282
- package/shared/definition28.js +76 -47
- package/shared/definition29.js +2287 -38
- package/shared/definition30.js +39 -417
- package/shared/definition31.js +38 -364
- package/shared/definition32.js +427 -12
- package/shared/definition33.js +351 -53
- package/shared/definition34.js +12 -26
- package/shared/definition35.js +67 -31
- package/shared/definition36.js +20 -431
- package/shared/definition37.js +34 -181
- package/shared/definition38.js +427 -45
- package/shared/definition39.js +195 -33
- package/shared/definition4.js +1 -1
- package/shared/definition40.js +53 -425
- package/shared/definition41.js +29 -645
- package/shared/definition42.js +420 -73
- package/shared/definition43.js +549 -444
- package/shared/definition44.js +68 -90
- package/shared/definition45.js +501 -79
- package/shared/definition46.js +84 -45
- package/shared/definition47.js +131 -17
- package/shared/definition48.js +44 -471
- package/shared/definition49.js +21 -108
- package/shared/definition5.js +1 -1
- package/shared/definition50.js +487 -15
- package/shared/definition51.js +92 -255
- package/shared/definition52.js +16 -115
- package/shared/definition53.js +264 -115
- package/shared/definition54.js +91 -82
- package/shared/definition55.js +111 -65
- package/shared/definition56.js +64 -291
- package/shared/definition57.js +303 -0
- package/shared/definition6.js +2 -2
- package/shared/definition7.js +10 -3
- package/shared/definition9.js +1 -1
- package/shared/{form-elements.js → index2.js} +14 -2
- package/shared/localization/Locale.d.ts +4 -0
- package/shared/localization/index.d.ts +7 -0
- package/shared/patterns/form-elements/form-elements.d.ts +4 -4
- package/shared/patterns/index.d.ts +1 -0
- package/shared/patterns/localized.d.ts +4 -0
- package/shared/text-field.js +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.js +1 -1
- package/split-button/index.js +1 -1
- package/styles/core/all.css +25 -3
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +25 -3
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +14 -0
- package/switch/index.js +3 -2
- package/tab/index.js +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.js +3 -3
- package/tag/index.js +1 -1
- package/tag-group/index.js +1 -1
- package/text-area/index.js +3 -2
- package/text-field/index.js +3 -2
- package/toggletip/index.js +1 -1
- package/tooltip/index.js +1 -1
- package/tree-item/index.js +1 -1
- package/tree-view/index.js +1 -1
- package/vivid.api.json +262 -0
package/shared/definition37.js
CHANGED
|
@@ -1,192 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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 { b as AffixIcon } from './affix.js';
|
|
4
|
+
import './focus.js';
|
|
5
|
+
import './index2.js';
|
|
6
|
+
import { a as applyMixins } from './apply-mixins.js';
|
|
7
|
+
import { I as Icon } from './icon.js';
|
|
8
8
|
import { w as when } from './when.js';
|
|
9
|
+
import { c as classNames } from './class-names.js';
|
|
9
10
|
|
|
10
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on
|
|
11
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Tue, 22 Aug 2023 13:37:39 GMT\n */\n.base {\n display: flex;\n align-items: flex-start;\n padding: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20));\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 column-gap: 16px;\n}\n.base.connotation-success {\n /* @cssprop [--vvd-note-success-primary=var(--vvd-color-success-500)] */\n --_connotation-color-primary: var(--vvd-note-success-primary, var(--vvd-color-success-500));\n /* @cssprop [--vvd-note-success-intermediate=var(--vvd-color-success-500)] */\n --_connotation-color-intermediate: var(--vvd-note-success-intermediate, var(--vvd-color-success-500));\n /* @cssprop [--vvd-note-success-backdrop=var(--vvd-color-success-50)] */\n --_connotation-color-backdrop: var(--vvd-note-success-backdrop, var(--vvd-color-success-50));\n}\n.base.connotation-information {\n /* @cssprop [--vvd-note-information-primary=var(--vvd-color-information-500)] */\n --_connotation-color-primary: var(--vvd-note-information-primary, var(--vvd-color-information-500));\n /* @cssprop [--vvd-note-information-intermediate=var(--vvd-color-information-500)] */\n --_connotation-color-intermediate: var(--vvd-note-information-intermediate, var(--vvd-color-information-500));\n /* @cssprop [--vvd-note-information-backdrop=var(--vvd-color-information-50)] */\n --_connotation-color-backdrop: var(--vvd-note-information-backdrop, var(--vvd-color-information-50));\n}\n.base.connotation-alert {\n /* @cssprop [--vvd-note-alert-primary=var(--vvd-color-alert-500)] */\n --_connotation-color-primary: var(--vvd-note-alert-primary, var(--vvd-color-alert-500));\n /* @cssprop [--vvd-note-alert-intermediate=var(--vvd-color-alert-500)] */\n --_connotation-color-intermediate: var(--vvd-note-alert-intermediate, var(--vvd-color-alert-500));\n /* @cssprop [--vvd-note-alert-backdrop=var(--vvd-color-alert-50)] */\n --_connotation-color-backdrop: var(--vvd-note-alert-backdrop, var(--vvd-color-alert-50));\n}\n.base.connotation-warning {\n /* @cssprop [--vvd-note-warning-primary=var(--vvd-color-warning-300)] */\n --_connotation-color-primary: var(--vvd-note-warning-primary, var(--vvd-color-warning-300));\n /* @cssprop [--vvd-note-warning-intermediate=var(--vvd-color-warning-300)] */\n --_connotation-color-intermediate: var(--vvd-note-warning-intermediate, var(--vvd-color-warning-300));\n /* @cssprop [--vvd-note-warning-backdrop=var(--vvd-color-warning-50)] */\n --_connotation-color-backdrop: var(--vvd-note-warning-backdrop, var(--vvd-color-warning-50));\n}\n.base:not(.connotation-success, .connotation-information, .connotation-alert, .connotation-warning) {\n /* @cssprop [--vvd-note-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-note-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-note-accent-intermediate=var(--vvd-color-neutral-500)] */\n --_connotation-color-intermediate: var(--vvd-note-accent-intermediate, var(--vvd-color-neutral-500));\n /* @cssprop [--vvd-note-accent-backdrop=var(--vvd-color-canvas)] */\n --_connotation-color-backdrop: var(--vvd-note-accent-backdrop, var(--vvd-color-canvas));\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@supports (contain: content) {\n .base {\n contain: content;\n }\n}\n@supports not (contain: content) {\n .base {\n overflow: hidden;\n }\n}\n\n.icon {\n color: var(--_appearance-color-outline);\n font-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n}\n\n.text {\n display: flex;\n min-height: 24px;\n flex-direction: column;\n flex-grow: 1;\n align-items: flex-start;\n justify-content: center;\n gap: 4px;\n text-align: start;\n}\n.text .headline {\n font: var(--vvd-typography-base-bold);\n}\n.text .message {\n font: var(--vvd-typography-base);\n}";
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
class Pagination extends FoundationElement {
|
|
18
|
-
get pagesList() {
|
|
19
|
-
return new Array(this.total < MAX_DIGITS_AND_PLACEHOLDERS ? this.total : MAX_DIGITS_AND_PLACEHOLDERS).fill(0).map((_, i, arr) => {
|
|
20
|
-
if (i === 0) return 1;
|
|
21
|
-
if (i === arr.length - 1) return this.total;
|
|
22
|
-
if (this.selectedIndex !== undefined && this.total > MAX_DIGITS_AND_PLACEHOLDERS) {
|
|
23
|
-
if (this.selectedIndex < 4) {
|
|
24
|
-
if (i === MAX_DIGITS_AND_PLACEHOLDERS - 2) return '...';
|
|
25
|
-
}
|
|
26
|
-
if (this.selectedIndex >= 4 && this.selectedIndex <= this.total - 5) {
|
|
27
|
-
if (i > 1 && i < MAX_DIGITS_AND_PLACEHOLDERS - 2) return this.selectedIndex + (i - 2);
|
|
28
|
-
if (i === 1 || i === MAX_DIGITS_AND_PLACEHOLDERS - 2) return '...';
|
|
29
|
-
}
|
|
30
|
-
if (this.selectedIndex > this.total - 5) {
|
|
31
|
-
if (i > 1) return this.total - (6 - i);
|
|
32
|
-
if (i === 1) return '...';
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return i + 1;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
constructor() {
|
|
39
|
-
super();
|
|
40
|
-
this.navIcons = false;
|
|
41
|
-
this.total = 0;
|
|
42
|
-
this.selectedIndex = 0;
|
|
43
|
-
this.addEventListener('tabpressed', e => {
|
|
44
|
-
const {
|
|
45
|
-
value: currentLabel,
|
|
46
|
-
shiftKey
|
|
47
|
-
} = e.detail;
|
|
48
|
-
const index = this.paginationButtons.findIndex(button => Number(button.label) === currentLabel);
|
|
49
|
-
const focusDirection = shiftKey ? -1 : 1;
|
|
50
|
-
const newIndex = index + focusDirection;
|
|
51
|
-
if (newIndex < 0) {
|
|
52
|
-
return this.prevButton.focus();
|
|
53
|
-
}
|
|
54
|
-
if (newIndex > this.paginationButtons.length - 1) {
|
|
55
|
-
return this.nextButton.focus();
|
|
56
|
-
}
|
|
57
|
-
this.paginationButtons && this.paginationButtons[index + focusDirection].focus();
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
totalChanged(_, newValue) {
|
|
61
|
-
if (newValue < 0) {
|
|
62
|
-
this.total = 0;
|
|
63
|
-
}
|
|
64
|
-
this.selectedIndex = 0;
|
|
65
|
-
}
|
|
66
|
-
selectedIndexChanged(oldValue, newValue) {
|
|
67
|
-
if (oldValue === undefined) return;
|
|
68
|
-
this.$emit('pagination-change', {
|
|
69
|
-
selectedIndex: newValue,
|
|
70
|
-
total: this.total,
|
|
71
|
-
oldIndex: oldValue
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
paginationButtonsChanged(_, newValue) {
|
|
75
|
-
newValue.forEach(button => {
|
|
76
|
-
button.shadowRoot.querySelector('button').classList.add('icon-only');
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
__decorate([attr, __metadata("design:type", String)], Pagination.prototype, "size", void 0);
|
|
81
|
-
__decorate([observable, __metadata("design:type", Array)], Pagination.prototype, "paginationButtons", void 0);
|
|
82
|
-
__decorate([observable, __metadata("design:type", Function)], Pagination.prototype, "prevButton", void 0);
|
|
83
|
-
__decorate([observable, __metadata("design:type", Function)], Pagination.prototype, "nextButton", void 0);
|
|
84
|
-
__decorate([attr({
|
|
85
|
-
attribute: 'nav-icons',
|
|
86
|
-
mode: 'boolean'
|
|
87
|
-
}), __metadata("design:type", Object)], Pagination.prototype, "navIcons", void 0);
|
|
88
|
-
__decorate([volatile, __metadata("design:type", Object), __metadata("design:paramtypes", [])], Pagination.prototype, "pagesList", null);
|
|
89
|
-
__decorate([attr({
|
|
90
|
-
mode: 'reflect',
|
|
91
|
-
converter: totalConverter
|
|
92
|
-
}), __metadata("design:type", Number)], Pagination.prototype, "total", void 0);
|
|
93
|
-
__decorate([attr({
|
|
94
|
-
mode: 'reflect',
|
|
95
|
-
converter: totalConverter,
|
|
96
|
-
attribute: 'selected-index'
|
|
97
|
-
}), __metadata("design:type", Object)], Pagination.prototype, "selectedIndex", void 0);
|
|
13
|
+
class Note extends FoundationElement {}
|
|
14
|
+
__decorate([attr, __metadata("design:type", String)], Note.prototype, "headline", void 0);
|
|
15
|
+
__decorate([attr, __metadata("design:type", String)], Note.prototype, "connotation", void 0);
|
|
16
|
+
applyMixins(Note, AffixIcon);
|
|
98
17
|
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
return
|
|
104
|
-
};
|
|
105
|
-
const handleKeyDown = (value, {
|
|
106
|
-
event,
|
|
107
|
-
parent
|
|
108
|
-
}) => {
|
|
109
|
-
if (event.key === ' ' || event.key === 'Enter') {
|
|
110
|
-
handleSelection(value, {
|
|
111
|
-
parent
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
if (event.key === 'Tab') {
|
|
115
|
-
event.target.dispatchEvent(new CustomEvent('tabpressed', {
|
|
116
|
-
detail: {
|
|
117
|
-
value,
|
|
118
|
-
shiftKey: event.shiftKey
|
|
119
|
-
},
|
|
120
|
-
bubbles: true,
|
|
121
|
-
composed: true
|
|
122
|
-
}));
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
const getClasses = _ => classNames('control');
|
|
126
|
-
function getButtonAppearance(value, {
|
|
127
|
-
parent
|
|
128
|
-
}) {
|
|
129
|
-
return parent.selectedIndex === Number(value) - 1 ? 'filled' : 'ghost';
|
|
18
|
+
const getClasses = ({
|
|
19
|
+
connotation
|
|
20
|
+
}) => classNames('base', `connotation-${connotation}`);
|
|
21
|
+
function getHeaderTemplate() {
|
|
22
|
+
return html`<div class="headline">${x => x.headline}</div>`;
|
|
130
23
|
}
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
<${buttonTag} class="vwc-pagination-button"
|
|
134
|
-
label="${value => value}"
|
|
135
|
-
appearance="${getButtonAppearance}"
|
|
136
|
-
size="${(_, {
|
|
137
|
-
parent: x
|
|
138
|
-
}) => getPaginationSize(x)}"
|
|
139
|
-
tabindex="0"
|
|
140
|
-
aria-pressed="${(value, {
|
|
141
|
-
parent
|
|
142
|
-
}) => parent.selectedIndex === Number(value) - 1}"
|
|
143
|
-
@click="${handleSelection}"
|
|
144
|
-
@keydown="${handleKeyDown}"
|
|
145
|
-
</${buttonTag}>
|
|
146
|
-
`)}
|
|
147
|
-
${when(value => value === '...', html`<div class="dots size-${getPaginationSize}">...</div>`)}`;
|
|
148
|
-
const getPaginationSize = x => {
|
|
149
|
-
if (!x.size || !ALLOWED_SIZES.includes(x.size)) {
|
|
150
|
-
return Size.SuperCondensed;
|
|
151
|
-
}
|
|
152
|
-
return x.size;
|
|
153
|
-
};
|
|
154
|
-
const PaginationTemplate = context => {
|
|
155
|
-
const buttonTag = context.tagFor(Button);
|
|
156
|
-
const paginationButtonTemplate = paginationButtonRenderer(buttonTag);
|
|
24
|
+
const NoteTemplate = context => {
|
|
25
|
+
const iconTag = context.tagFor(Icon);
|
|
157
26
|
return html`
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
<div id="buttons-wrapper" class="buttons-wrapper" ${children({
|
|
167
|
-
property: 'paginationButtons',
|
|
168
|
-
filter: elements(buttonTag)
|
|
169
|
-
})}>
|
|
170
|
-
${repeat(x => x.pagesList, paginationButtonTemplate, {
|
|
171
|
-
positioning: true
|
|
172
|
-
})}
|
|
173
|
-
</div>
|
|
174
|
-
<${buttonTag} class="next-button" ${ref('nextButton')}
|
|
175
|
-
label="${x => !x.navIcons ? 'Next' : null}"
|
|
176
|
-
icon="${x => x.navIcons ? 'chevron-right-line' : null}"
|
|
177
|
-
size="${getPaginationSize}"
|
|
178
|
-
?disabled="${x => x.total === 0 || x.selectedIndex === x.total - 1}"
|
|
179
|
-
@click="${x => x.selectedIndex !== undefined && x.selectedIndex++}"
|
|
180
|
-
></${buttonTag}>
|
|
181
|
-
</div>`;
|
|
27
|
+
<div class="${getClasses}">
|
|
28
|
+
${when(x => x.icon, html`<${iconTag} class="icon" name="${x => x.icon}"></${iconTag}>`)}
|
|
29
|
+
<div class="text">
|
|
30
|
+
${when(x => x.headline, getHeaderTemplate())}
|
|
31
|
+
<slot class="message"></slot>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
`;
|
|
182
35
|
};
|
|
183
36
|
|
|
184
|
-
const
|
|
185
|
-
baseName: '
|
|
186
|
-
template:
|
|
37
|
+
const noteDefinition = Note.compose({
|
|
38
|
+
baseName: 'note',
|
|
39
|
+
template: NoteTemplate,
|
|
187
40
|
styles: css_248z
|
|
188
41
|
});
|
|
189
|
-
const
|
|
190
|
-
const
|
|
42
|
+
const noteRegistries = [noteDefinition(), ...iconRegistries];
|
|
43
|
+
const registerNote = registerFactory(noteRegistries);
|
|
191
44
|
|
|
192
|
-
export {
|
|
45
|
+
export { noteRegistries as a, noteDefinition as n, registerNote as r };
|