@vonage/vivid 3.0.0-next.83 → 3.0.0-next.85
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 +2 -9
- package/accordion-item/index.js +8 -22
- package/action-group/index.js +2 -8
- package/avatar/index.js +4 -14
- package/badge/index.js +3 -13
- package/banner/index.js +3 -26
- package/breadcrumb/index.js +1 -1
- package/breadcrumb-item/index.js +5 -9
- package/calendar/index.js +12 -49
- package/calendar-event/index.js +4 -7
- package/card/index.js +9 -28
- package/checkbox/index.js +3 -11
- package/dialog/index.js +7 -59
- package/fab/index.js +2 -8
- package/focus/index.js +2 -2
- package/header/index.js +2 -7
- package/icon/index.js +2 -5
- package/index.js +1 -1
- package/layout/index.js +1 -9
- package/lib/badge/badge.d.ts +1 -3
- package/lib/components.d.ts +1 -0
- package/lib/listbox-option/index.d.ts +4 -0
- package/lib/listbox-option/listbox-option.d.ts +7 -0
- package/lib/listbox-option/listbox-option.template.d.ts +4 -0
- package/listbox-option/index.js +248 -0
- package/menu/index.js +1 -7
- package/nav/index.js +1 -1
- package/nav-disclosure/index.js +4 -11
- package/nav-item/index.js +2 -2
- package/note/index.js +4 -12
- package/number-field/index.js +24 -21
- package/package.json +12 -9
- package/popup/index.js +0 -1
- package/progress/index.js +5 -13
- package/progress-ring/index.js +4 -8
- package/radio/index.js +3 -5
- package/radio-group/index.js +3 -4
- package/shared/affix.js +1 -6
- package/shared/apply-mixins.js +5 -4
- package/shared/calendar-event.js +0 -7
- package/shared/enums.js +0 -17
- package/shared/es.object.assign.js +4 -4
- package/shared/export.js +79 -57
- package/shared/focus2.js +1 -1
- package/shared/form-associated.js +1 -1
- package/shared/form-elements.js +5 -27
- package/shared/icon.js +8 -18
- package/shared/index.js +38 -25
- package/shared/index2.js +2 -13
- package/shared/index3.js +1 -5
- package/shared/index4.js +2 -4
- package/shared/index5.js +6 -581
- package/shared/index6.js +6 -10
- package/shared/iterators.js +3 -3
- package/shared/object-keys.js +2 -2
- package/shared/patterns/form-elements/form-elements.d.ts +1 -1
- package/shared/radio.js +0 -1
- package/shared/ref.js +1 -1
- package/shared/slotted.js +1 -1
- package/shared/text-anchor.js +0 -2
- package/shared/text-anchor.template.js +1 -3
- package/shared/web.dom-collections.iterator.js +6 -8
- package/side-drawer/index.js +3 -16
- 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 +29 -23
- package/styles/tokens/theme-light.css +29 -23
- package/text-area/index.js +3 -9
- package/text-field/index.js +4 -14
- package/tooltip/index.js +2 -10
- package/shared/regexp-flags.js +0 -21
package/calendar/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as emptyArray, O as Observable, S as SubscriberSet, D as DOM, H as HTMLDirective, i as HTMLView, F as FoundationElement, c as __classPrivateFieldGet, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
|
|
2
2
|
import '../shared/web.dom-collections.iterator.js';
|
|
3
3
|
import { C as CalendarEvent } from '../shared/calendar-event.js';
|
|
4
4
|
import '../shared/es.object.assign.js';
|
|
@@ -629,13 +629,14 @@ class RepeatBehavior {
|
|
|
629
629
|
let addIndex = splice.index;
|
|
630
630
|
const end = addIndex + splice.addedCount;
|
|
631
631
|
const removedViews = views.splice(splice.index, removed.length);
|
|
632
|
-
|
|
632
|
+
const totalAvailableViews = (availableViews =
|
|
633
|
+
leftoverViews.length + removedViews.length);
|
|
633
634
|
for (; addIndex < end; ++addIndex) {
|
|
634
635
|
const neighbor = views[addIndex];
|
|
635
636
|
const location = neighbor ? neighbor.firstChild : this.location;
|
|
636
637
|
let view;
|
|
637
638
|
if (recycle && availableViews > 0) {
|
|
638
|
-
if (removeIndex <=
|
|
639
|
+
if (removeIndex <= totalAvailableViews && removedViews.length > 0) {
|
|
639
640
|
view = removedViews[removeIndex];
|
|
640
641
|
removeIndex++;
|
|
641
642
|
}
|
|
@@ -1260,7 +1261,7 @@ _curry1(function isEmpty(x) {
|
|
|
1260
1261
|
|
|
1261
1262
|
var isEmpty$1 = isEmpty;
|
|
1262
1263
|
|
|
1263
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on
|
|
1264
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 02 Nov 2022 12:59:38 GMT\n */\nol {\n padding: 0;\n margin: 0;\n list-style: none;\n}\n\n[role=grid i] {\n position: relative;\n z-index: 0;\n display: grid;\n margin: auto;\n grid-template-areas: \". column-headers\" \"row-headers calendar\";\n grid-template-columns: min-content auto;\n inline-size: max(100%, 500px);\n min-inline-size: 880px;\n}\n\n.row-headers {\n display: grid;\n grid-area: row-headers;\n grid-template-rows: repeat(24, 1fr);\n margin-inline-end: 2px;\n}\n.row-headers > [role=rowheader i] {\n display: flex;\n align-items: flex-end;\n justify-content: flex-end;\n}\n.row-headers > [role=rowheader i] > time {\n font: var(--vvd-typography-base-condensed);\n font-size: small;\n line-height: 1;\n text-transform: uppercase;\n white-space: nowrap;\n}\n\n.calendar-row {\n display: contents;\n}\n\n.calendar-grid-presentation {\n display: grid;\n overflow: hidden;\n background-color: var(--vvd-color-surface-2dp);\n border-radius: 6px;\n counter-reset: listing;\n filter: var(--vvd-shadow-surface-2dp);\n gap: 1px;\n grid-area: calendar;\n grid-auto-flow: column;\n grid-template: repeat(24, 1fr)/repeat(7, 1fr);\n}\n\n.hours {\n display: contents;\n}\n.hours > [role=listitem i] {\n position: relative;\n grid-column: 1/8;\n grid-row: var(--row);\n min-block-size: 48px;\n pointer-events: none;\n}\n.hours > [role=listitem i]:not(:first-child)::after {\n position: absolute;\n border-block-end: var(--vvd-color-neutral-100) 1px solid;\n content: \"\";\n inline-size: 100%;\n margin-block-start: -1px;\n}\n.hours > [role=listitem i]:nth-child(24n+1) {\n --row: 1;\n}\n.hours > [role=listitem i]:nth-child(24n+2) {\n --row: 2;\n}\n.hours > [role=listitem i]:nth-child(24n+3) {\n --row: 3;\n}\n.hours > [role=listitem i]:nth-child(24n+4) {\n --row: 4;\n}\n.hours > [role=listitem i]:nth-child(24n+5) {\n --row: 5;\n}\n.hours > [role=listitem i]:nth-child(24n+6) {\n --row: 6;\n}\n.hours > [role=listitem i]:nth-child(24n+7) {\n --row: 7;\n}\n.hours > [role=listitem i]:nth-child(24n+8) {\n --row: 8;\n}\n.hours > [role=listitem i]:nth-child(24n+9) {\n --row: 9;\n}\n.hours > [role=listitem i]:nth-child(24n+10) {\n --row: 10;\n}\n.hours > [role=listitem i]:nth-child(24n+11) {\n --row: 11;\n}\n.hours > [role=listitem i]:nth-child(24n+12) {\n --row: 12;\n}\n.hours > [role=listitem i]:nth-child(24n+13) {\n --row: 13;\n}\n.hours > [role=listitem i]:nth-child(24n+14) {\n --row: 14;\n}\n.hours > [role=listitem i]:nth-child(24n+15) {\n --row: 15;\n}\n.hours > [role=listitem i]:nth-child(24n+16) {\n --row: 16;\n}\n.hours > [role=listitem i]:nth-child(24n+17) {\n --row: 17;\n}\n.hours > [role=listitem i]:nth-child(24n+18) {\n --row: 18;\n}\n.hours > [role=listitem i]:nth-child(24n+19) {\n --row: 19;\n}\n.hours > [role=listitem i]:nth-child(24n+20) {\n --row: 20;\n}\n.hours > [role=listitem i]:nth-child(24n+21) {\n --row: 21;\n}\n.hours > [role=listitem i]:nth-child(24n+22) {\n --row: 22;\n}\n.hours > [role=listitem i]:nth-child(24n+23) {\n --row: 23;\n}\n.hours > [role=listitem i]:nth-child(24n+24) {\n --row: 24;\n}\n\n[role=gridcell i] {\n display: grid;\n gap: 1px;\n grid-auto-flow: column;\n}\n\n[role=gridcell i],\n[role=columnheader i],\n[role=columnheader i] [role=button i] {\n position: relative;\n}\n[role=gridcell i]::before,\n[role=columnheader i]::before,\n[role=columnheader i] [role=button i]::before {\n position: absolute;\n z-index: -1;\n background-color: var(--vvd-color-information-400);\n content: \"\";\n}\n@supports (inset: 0) {\n [role=gridcell i]::before,\n[role=columnheader i]::before,\n[role=columnheader i] [role=button i]::before {\n inset: 0;\n }\n}\n@supports not (inset: 0) {\n [role=gridcell i]::before,\n[role=columnheader i]::before,\n[role=columnheader i] [role=button i]::before {\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n }\n}\n[role=gridcell i]:focus,\n[role=columnheader i]:focus,\n[role=columnheader i] [role=button i]:focus {\n outline: none;\n}\n[role=gridcell i]:not(:focus-visible)::before,\n[role=columnheader i]:not(:focus-visible)::before,\n[role=columnheader i] [role=button i]:not(:focus-visible)::before {\n display: none;\n}\n\n.columns {\n display: contents;\n}\n.columns > [role=gridcell i] {\n position: relative;\n grid-column: var(--column);\n grid-row: 1/25;\n}\n.columns > [role=gridcell i]:nth-child(1) {\n --column: 1;\n}\n.columns > [role=gridcell i]:nth-child(2) {\n --column: 2;\n}\n.columns > [role=gridcell i]:nth-child(3) {\n --column: 3;\n}\n.columns > [role=gridcell i]:nth-child(4) {\n --column: 4;\n}\n.columns > [role=gridcell i]:nth-child(5) {\n --column: 5;\n}\n.columns > [role=gridcell i]:nth-child(6) {\n --column: 6;\n}\n.columns > [role=gridcell i]:nth-child(7) {\n --column: 7;\n}\n.columns > [role=gridcell i]:not(:first-child)::after {\n position: absolute;\n block-size: 100%;\n border-inline-end: var(--vvd-color-neutral-100) 1px solid;\n content: \"\";\n margin-inline-start: -1px;\n}\n\n.column-headers {\n display: grid;\n grid-area: column-headers;\n grid-template-columns: repeat(7, 1fr);\n}\n.column-headers [role=columnheader i] h2 {\n display: grid;\n align-items: baseline;\n margin: 0;\n font: var(--vvd-typography-heading-4);\n grid-template-columns: 1fr auto 1fr;\n}\n.column-headers [role=columnheader i] h2 > em {\n font: inherit;\n inline-size: min-content;\n}\n@supports (inset: 0) {\n .column-headers [role=columnheader i] h2 > em {\n inset-inline-start: 0;\n }\n}\n@supports not (inset: 0) {\n .column-headers [role=columnheader i] h2 > em {\n left: 0;\n }\n}\n.column-headers [role=columnheader i] h2 > small {\n font: var(--vvd-typography-base-condensed);\n text-transform: uppercase;\n}";
|
|
1264
1265
|
|
|
1265
1266
|
const ARROW_UP = 'ArrowUp';
|
|
1266
1267
|
const ARROW_RIGHT = 'ArrowRight';
|
|
@@ -1269,18 +1270,14 @@ const ARROW_LEFT = 'ArrowLeft';
|
|
|
1269
1270
|
function isCellOrHeader(el) {
|
|
1270
1271
|
return el instanceof HTMLElement && (el.matches('[role="gridcell"i]') || el.matches('[role="columnheader"i]'));
|
|
1271
1272
|
}
|
|
1272
|
-
|
|
1273
1273
|
const getCellOrHeader = f => f.matches('[role="columnheader"i]') ? '[role="gridcell"i]' : '[role="columnheader"i]';
|
|
1274
|
-
|
|
1275
1274
|
function getNextFocusableGridElement(key, activeElement) {
|
|
1276
1275
|
if (activeElement.parentNode instanceof HTMLElement) {
|
|
1277
1276
|
switch (key) {
|
|
1278
1277
|
case ARROW_RIGHT:
|
|
1279
1278
|
return activeElement.nextElementSibling || activeElement.parentNode.firstElementChild;
|
|
1280
|
-
|
|
1281
1279
|
case ARROW_LEFT:
|
|
1282
1280
|
return activeElement.previousElementSibling || activeElement.parentNode.lastElementChild;
|
|
1283
|
-
|
|
1284
1281
|
case ARROW_UP:
|
|
1285
1282
|
case ARROW_DOWN:
|
|
1286
1283
|
{
|
|
@@ -1297,7 +1294,6 @@ function getHeaderDescendantGridCell(key, activeElement) {
|
|
|
1297
1294
|
if (key !== ARROW_DOWN) {
|
|
1298
1295
|
return;
|
|
1299
1296
|
}
|
|
1300
|
-
|
|
1301
1297
|
const header = activeElement.closest('[role="columnheader"i]');
|
|
1302
1298
|
const columnHeaders = this.shadowRoot.querySelectorAll('[role="columnheader"i]');
|
|
1303
1299
|
const i = Array.from(columnHeaders).indexOf(header);
|
|
@@ -1306,21 +1302,17 @@ function getHeaderDescendantGridCell(key, activeElement) {
|
|
|
1306
1302
|
|
|
1307
1303
|
function getDay(el) {
|
|
1308
1304
|
const cellOrHeader = el.closest('[role="gridcell"i], [role="columnheader"i]');
|
|
1309
|
-
|
|
1310
1305
|
if (cellOrHeader) {
|
|
1311
1306
|
const {
|
|
1312
1307
|
parentElement
|
|
1313
1308
|
} = cellOrHeader;
|
|
1314
|
-
|
|
1315
1309
|
if (parentElement) {
|
|
1316
1310
|
return parentElement.children && Array.from(parentElement.children).indexOf(cellOrHeader);
|
|
1317
1311
|
}
|
|
1318
1312
|
}
|
|
1319
1313
|
}
|
|
1320
|
-
|
|
1321
1314
|
function getHour(e, el, hours) {
|
|
1322
1315
|
const rowHeaderOrCell = el.closest('[role="rowheader"], [role="gridcell"i]');
|
|
1323
|
-
|
|
1324
1316
|
if (rowHeaderOrCell) {
|
|
1325
1317
|
const DOMRect = rowHeaderOrCell.getBoundingClientRect();
|
|
1326
1318
|
const offsetY = e.clientY - DOMRect.y;
|
|
@@ -1329,25 +1321,19 @@ function getHour(e, el, hours) {
|
|
|
1329
1321
|
return Math.round((hour + Number.EPSILON) * 100) / 100;
|
|
1330
1322
|
}
|
|
1331
1323
|
}
|
|
1332
|
-
|
|
1333
1324
|
const getEventContext = function getEventContext(e) {
|
|
1334
1325
|
if (!(e instanceof KeyboardEvent || e instanceof MouseEvent)) {
|
|
1335
1326
|
throw new Error('Invalid event. Event must be instance of KeyboardEvent or MouseEvent');
|
|
1336
1327
|
}
|
|
1337
|
-
|
|
1338
1328
|
const [el] = e.composedPath();
|
|
1339
|
-
|
|
1340
1329
|
if (!(el && el instanceof HTMLElement && this.shadowRoot.contains(el))) {
|
|
1341
1330
|
throw new Error('Invalid event. Event must contain a target object which is a direct descendant of calendar');
|
|
1342
1331
|
}
|
|
1343
|
-
|
|
1344
1332
|
const day = getDay(el);
|
|
1345
1333
|
let hour;
|
|
1346
|
-
|
|
1347
1334
|
if (e instanceof MouseEvent) {
|
|
1348
1335
|
hour = getHour(e, el, this._hours);
|
|
1349
1336
|
}
|
|
1350
|
-
|
|
1351
1337
|
const context = Object.assign(Object.assign({}, day != undefined && {
|
|
1352
1338
|
day
|
|
1353
1339
|
}), hour != undefined && {
|
|
@@ -1360,41 +1346,33 @@ var _Calendar_instances, _Calendar_activeCalendarEvent_get;
|
|
|
1360
1346
|
class Calendar extends FoundationElement {
|
|
1361
1347
|
constructor() {
|
|
1362
1348
|
super(...arguments);
|
|
1363
|
-
|
|
1364
1349
|
_Calendar_instances.add(this);
|
|
1365
|
-
|
|
1366
1350
|
this.hour12 = false;
|
|
1367
1351
|
this._hours = 24;
|
|
1368
1352
|
this._days = 7;
|
|
1369
1353
|
this.hoursAsDatetime = Array.from({
|
|
1370
1354
|
length: this._hours - 1
|
|
1371
1355
|
}).fill(new Date(new Date().setHours(0, 0, 0))).map((d, i) => new Date(d.setHours(++i)));
|
|
1372
|
-
|
|
1373
1356
|
this._generateDaysArr = dateArr => {
|
|
1374
1357
|
if (dateArr.length == this._days) {
|
|
1375
1358
|
return dateArr;
|
|
1376
1359
|
}
|
|
1377
|
-
|
|
1378
1360
|
const lastDate = new Date(dateArr[dateArr.length - 1]);
|
|
1379
1361
|
lastDate.setDate(lastDate.getDate() + 1);
|
|
1380
1362
|
return this._generateDaysArr([...dateArr, lastDate]);
|
|
1381
1363
|
};
|
|
1382
|
-
|
|
1383
1364
|
this.getEventContext = getEventContext;
|
|
1384
1365
|
}
|
|
1385
|
-
|
|
1386
1366
|
getCalendarEventContainingCell(calendarEvent) {
|
|
1387
1367
|
const slotName = calendarEvent.getAttribute('slot');
|
|
1388
1368
|
const gridCell = this.shadowRoot.querySelector(`slot[name="${slotName}"i]`);
|
|
1389
1369
|
return gridCell.parentElement;
|
|
1390
1370
|
}
|
|
1391
|
-
|
|
1392
1371
|
arrowKeysInteractions(key) {
|
|
1393
1372
|
const {
|
|
1394
1373
|
activeElement
|
|
1395
1374
|
} = this.shadowRoot;
|
|
1396
1375
|
let focusNext;
|
|
1397
|
-
|
|
1398
1376
|
if (isCellOrHeader(activeElement)) {
|
|
1399
1377
|
focusNext = getNextFocusableGridElement.call(this, key, activeElement);
|
|
1400
1378
|
} else if (__classPrivateFieldGet(this, _Calendar_instances, "a", _Calendar_activeCalendarEvent_get)) {
|
|
@@ -1404,34 +1382,27 @@ class Calendar extends FoundationElement {
|
|
|
1404
1382
|
} else {
|
|
1405
1383
|
focusNext = this.shadowRoot.querySelector('[role="columnheader"i]');
|
|
1406
1384
|
}
|
|
1407
|
-
|
|
1408
1385
|
this.activateElement(focusNext);
|
|
1409
1386
|
}
|
|
1410
|
-
|
|
1411
1387
|
activateElement(el) {
|
|
1412
1388
|
const onBlur = ({
|
|
1413
1389
|
target
|
|
1414
1390
|
}) => target.setAttribute('tabindex', '-1');
|
|
1415
|
-
|
|
1416
1391
|
el === null || el === void 0 ? void 0 : el.addEventListener('blur', onBlur, {
|
|
1417
1392
|
once: true
|
|
1418
1393
|
});
|
|
1419
1394
|
el === null || el === void 0 ? void 0 : el.setAttribute('tabindex', '0');
|
|
1420
1395
|
el === null || el === void 0 ? void 0 : el.focus();
|
|
1421
1396
|
}
|
|
1422
|
-
|
|
1423
1397
|
onKeydown({
|
|
1424
1398
|
key
|
|
1425
1399
|
}) {
|
|
1426
1400
|
const isArrow = [ARROW_UP, ARROW_RIGHT, ARROW_DOWN, ARROW_LEFT].some(predefinedKey => predefinedKey == key);
|
|
1427
|
-
|
|
1428
1401
|
if (isArrow) {
|
|
1429
1402
|
this.arrowKeysInteractions(key);
|
|
1430
1403
|
}
|
|
1431
|
-
|
|
1432
1404
|
return !isArrow;
|
|
1433
1405
|
}
|
|
1434
|
-
|
|
1435
1406
|
}
|
|
1436
1407
|
_Calendar_instances = new WeakSet(), _Calendar_activeCalendarEvent_get = function _Calendar_activeCalendarEvent_get() {
|
|
1437
1408
|
const {
|
|
@@ -1439,22 +1410,17 @@ _Calendar_instances = new WeakSet(), _Calendar_activeCalendarEvent_get = functio
|
|
|
1439
1410
|
} = document;
|
|
1440
1411
|
return activeElement instanceof CalendarEvent ? activeElement : null;
|
|
1441
1412
|
};
|
|
1442
|
-
|
|
1443
1413
|
__decorate([attr, __metadata("design:type", Object)], Calendar.prototype, "datetime", void 0);
|
|
1444
|
-
|
|
1445
1414
|
__decorate([attr({
|
|
1446
1415
|
attribute: 'start-day'
|
|
1447
1416
|
}), __metadata("design:type", String)], Calendar.prototype, "startDay", void 0);
|
|
1448
|
-
|
|
1449
1417
|
__decorate([attr, __metadata("design:type", Object)], Calendar.prototype, "locales", void 0);
|
|
1450
|
-
|
|
1451
1418
|
__decorate([attr({
|
|
1452
1419
|
mode: 'boolean'
|
|
1453
1420
|
}), __metadata("design:type", Object)], Calendar.prototype, "hour12", void 0);
|
|
1454
1421
|
|
|
1455
1422
|
function getValidDateString(date) {
|
|
1456
1423
|
const twoDigit = num => `0${num}`.slice(-2);
|
|
1457
|
-
|
|
1458
1424
|
return `${date.getFullYear()}-${twoDigit(date.getMonth() + 1)}-${twoDigit(date.getDate())}`;
|
|
1459
1425
|
}
|
|
1460
1426
|
const weekdaysMap = new Map([['sunday', 0], ['monday', 1]]);
|
|
@@ -1467,14 +1433,13 @@ function getFirstDateOfTheWeek(date = new Date(), startDay) {
|
|
|
1467
1433
|
}
|
|
1468
1434
|
|
|
1469
1435
|
let _2 = t => t,
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1436
|
+
_t,
|
|
1437
|
+
_t2,
|
|
1438
|
+
_t3,
|
|
1439
|
+
_t4,
|
|
1440
|
+
_t5,
|
|
1441
|
+
_t6,
|
|
1442
|
+
_t7;
|
|
1478
1443
|
const HoursTemplate = () => {
|
|
1479
1444
|
return html(_t || (_t = _2`
|
|
1480
1445
|
<div class="row-headers" role="presentation">
|
|
@@ -1492,7 +1457,6 @@ const HoursTemplate = () => {
|
|
|
1492
1457
|
hour12: c.parent.hour12
|
|
1493
1458
|
}).format(x))));
|
|
1494
1459
|
};
|
|
1495
|
-
|
|
1496
1460
|
const DaysTemplate = () => {
|
|
1497
1461
|
return html(_t3 || (_t3 = _2`
|
|
1498
1462
|
<div class="column-headers" role="row">
|
|
@@ -1521,7 +1485,6 @@ const DaysTemplate = () => {
|
|
|
1521
1485
|
weekday: 'short'
|
|
1522
1486
|
}).format(x))));
|
|
1523
1487
|
};
|
|
1524
|
-
|
|
1525
1488
|
const ColumnTemplate = html(_t5 || (_t5 = _2`
|
|
1526
1489
|
<div role="gridcell" tabindex="-1">
|
|
1527
1490
|
<slot name="day-${0}"></slot>
|
package/calendar-event/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { w as when } from '../shared/when.js';
|
|
|
7
7
|
import { c as classNames } from '../shared/class-names.js';
|
|
8
8
|
import '../shared/object-keys.js';
|
|
9
9
|
|
|
10
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on
|
|
10
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 02 Nov 2022 12:59:38 GMT\n */\n:host {\n display: contents;\n}\n\n.base {\n /* 4 as the indentation limit */\n /* per cell divider */\n /* per cell divider */\n --vvd-calendar-event--indent: calc(0px + var(--vvd-calendar-event--overlap-count, 0) * 8px);\n position: absolute;\n z-index: var(--vvd-calendar-event--overlap-count);\n top: calc(var(--vvd-calendar-event--start, 0) * (100% - 23px) / 24 + calc(1px * var(--vvd-calendar-event--start, 0)));\n overflow: hidden;\n box-sizing: border-box;\n padding: 4px 8px;\n background-color: var(--_appearance-color-fill);\n block-size: calc(var(--vvd-calendar-event--duration, 1) * calc((100% - 23px) / 24) + calc(1px * (var(--vvd-calendar-event--duration, 1) - 1)) - 4px);\n border-radius: 6px;\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n inline-size: calc(100% - 8px - min(var(--vvd-calendar-event--indent), 32px));\n margin-block-start: 2px;\n margin-inline-end: 8px;\n margin-inline-start: min(var(--vvd-calendar-event--indent), 32px);\n max-block-size: calc(100% - calc(var(--vvd-calendar-event--start, 0) * (100% - 23px) / 24 + calc(1px * var(--vvd-calendar-event--start, 0))) - 4px);\n}\n.base.connotation-accent {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-contrast: var(--vvd-color-neutral-800);\n --_connotation-color-soft: var(--vvd-color-neutral-100);\n}\n.base.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-contrast: var(--vvd-color-cta-800);\n --_connotation-color-soft: var(--vvd-color-cta-100);\n}\n.base.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-contrast: var(--vvd-color-success-800);\n --_connotation-color-soft: var(--vvd-color-success-100);\n}\n.base.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-contrast: var(--vvd-color-alert-800);\n --_connotation-color-soft: var(--vvd-color-alert-100);\n}\n.base.connotation-warning {\n --_connotation-color-primary: var(--vvd-color-warning-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-contrast: var(--vvd-color-warning-800);\n --_connotation-color-soft: var(--vvd-color-warning-100);\n}\n.base.connotation-announcement {\n --_connotation-color-primary: var(--vvd-color-announcement-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-contrast: var(--vvd-color-announcement-800);\n --_connotation-color-soft: var(--vvd-color-announcement-100);\n}\n.base:not(.connotation-accent, .connotation-cta, .connotation-success, .connotation-alert, .connotation-warning, .connotation-announcement) {\n --_connotation-color-primary: var(--vvd-color-information-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-contrast: var(--vvd-color-information-800);\n --_connotation-color-soft: var(--vvd-color-information-100);\n}\n.base {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transparent;\n}\n.base.appearance-subtle {\n --_appearance-color-text: var(--_connotation-color-contrast);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transparent;\n}\n@supports (contain: content) {\n .base {\n contain: strict;\n }\n}\n@supports not (contain: content) {\n .base {\n overflow: hidden;\n }\n}\n.base:focus {\n z-index: 2000;\n filter: var(--vvd-shadow-surface-8dp);\n outline: none;\n}\n\nh2 {\n margin: 0;\n font: var(--vvd-typography-base-condensed-bold);\n}\nh2 > strong {\n font: inherit;\n}\n\np {\n margin: 0;\n font: var(--vvd-typography-base-condensed);\n}";
|
|
11
11
|
|
|
12
12
|
var $ = _export;
|
|
13
13
|
var DESCRIPTORS = descriptors;
|
|
@@ -67,15 +67,13 @@ if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototy
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
let _ = t => t,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
_t,
|
|
71
|
+
_t2,
|
|
72
|
+
_t3;
|
|
74
73
|
const getClasses = ({
|
|
75
74
|
connotation,
|
|
76
75
|
appearance
|
|
77
76
|
}) => classNames('base', [`connotation-${connotation}`, Boolean(connotation)], [`appearance-${appearance}`, Boolean(appearance)]);
|
|
78
|
-
|
|
79
77
|
const getStyles = ({
|
|
80
78
|
start,
|
|
81
79
|
duration,
|
|
@@ -90,7 +88,6 @@ const getStyles = ({
|
|
|
90
88
|
});
|
|
91
89
|
return Object.entries(stylesObj).map(entry => entry.join(':')).join(';');
|
|
92
90
|
};
|
|
93
|
-
|
|
94
91
|
const CalendarEventTemplate = () => html(_t || (_t = _`
|
|
95
92
|
<div
|
|
96
93
|
style="${0}"
|
package/card/index.js
CHANGED
|
@@ -10,55 +10,42 @@ import '../shared/iterators.js';
|
|
|
10
10
|
import '../shared/to-string.js';
|
|
11
11
|
import '../shared/_has.js';
|
|
12
12
|
|
|
13
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on
|
|
13
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 02 Nov 2022 12:59:38 GMT\n */\n:host {\n display: flex;\n}\n\n.base {\n border-radius: 6px;\n inline-size: 100%;\n}\n\n.wrapper {\n display: flex;\n overflow: hidden;\n flex-flow: column;\n block-size: inherit;\n border-radius: inherit;\n color: var(--vvd-color-canvas-text);\n}\n\n.main-content {\n display: flex;\n flex-flow: column;\n padding: 24px;\n}\n\n.header {\n display: flex;\n flex: 1;\n align-items: flex-start;\n gap: 8px;\n}\n.header-content {\n flex: 1;\n}\n.header-wrapper {\n display: flex;\n gap: 8px;\n}\n.header-headline, .header-subtitle {\n /* stylelint-disable value-no-vendor-prefix */\n display: -webkit-box;\n /* stylelint-enable value-no-vendor-prefix */\n overflow: hidden;\n -webkit-box-orient: vertical;\n}\n.header-headline {\n font: var(--vvd-typography-heading-4);\n -webkit-line-clamp: var(--headline-line-clamp);\n}\n.header-subtitle {\n font: var(--vvd-typography-base);\n -webkit-line-clamp: var(--subtitle-line-clamp);\n}\n.hide-header .header {\n display: none;\n}\n\n.header-subtitle,\n.text {\n color: var(--vvd-color-neutral-600);\n font: var(--vvd-typography-base);\n}\n\n.text {\n padding-right: 8px;\n margin-top: 12px;\n}\n\n.footer {\n display: inline-flex;\n flex-direction: column;\n align-items: flex-end;\n padding-bottom: 24px;\n margin-top: auto;\n padding-inline: 24px;\n}\n.hide-footer .footer {\n display: none;\n}\n\n::slotted([slot=graphic i]),\n.icon {\n flex-shrink: 0;\n align-self: baseline;\n margin-block-start: 4px;\n}\n\n.icon {\n font-size: 20px;\n}\n\n::slotted([slot=meta i]) {\n flex-shrink: 0;\n align-self: flex-start;\n margin-block-start: -8px;\n margin-inline-end: -8px;\n margin-inline-start: auto;\n}";
|
|
14
14
|
|
|
15
15
|
class Card extends FoundationElement {}
|
|
16
|
-
|
|
17
16
|
__decorate([attr, __metadata("design:type", String)], Card.prototype, "headline", void 0);
|
|
18
|
-
|
|
19
17
|
__decorate([attr, __metadata("design:type", String)], Card.prototype, "subtitle", void 0);
|
|
20
|
-
|
|
21
18
|
__decorate([attr, __metadata("design:type", String)], Card.prototype, "text", void 0);
|
|
22
|
-
|
|
23
19
|
__decorate([attr, __metadata("design:type", String)], Card.prototype, "icon", void 0);
|
|
24
|
-
|
|
25
20
|
__decorate([attr, __metadata("design:type", Number)], Card.prototype, "elevation", void 0);
|
|
26
|
-
|
|
27
21
|
__decorate([observable, __metadata("design:type", Array)], Card.prototype, "footerSlottedContent", void 0);
|
|
28
|
-
|
|
29
22
|
__decorate([observable, __metadata("design:type", Array)], Card.prototype, "graphicSlottedContent", void 0);
|
|
30
|
-
|
|
31
23
|
__decorate([observable, __metadata("design:type", Array)], Card.prototype, "hasMetaSlottedContent", void 0);
|
|
32
24
|
|
|
33
25
|
let _2 = t => t,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
26
|
+
_t,
|
|
27
|
+
_t2,
|
|
28
|
+
_t3,
|
|
29
|
+
_t4,
|
|
30
|
+
_t5,
|
|
31
|
+
_t6,
|
|
32
|
+
_t7,
|
|
33
|
+
_t8;
|
|
43
34
|
const getClasses = _ => classNames('base', ['hide-footer', !_.footerSlottedContent || !_.footerSlottedContent.length], ['hide-header', shouldHideHeader(_)]);
|
|
44
|
-
|
|
45
35
|
function renderHeaderIcon() {
|
|
46
36
|
return html(_t || (_t = _2`
|
|
47
37
|
<vwc-icon class="icon" inline type="${0}"></vwc-icon>`), x => x.icon);
|
|
48
38
|
}
|
|
49
|
-
|
|
50
39
|
function Headline() {
|
|
51
40
|
return html(_t2 || (_t2 = _2`
|
|
52
41
|
<div class="header-headline">${0}</div>
|
|
53
42
|
`), x => x.headline);
|
|
54
43
|
}
|
|
55
|
-
|
|
56
44
|
function Subtitle() {
|
|
57
45
|
return html(_t3 || (_t3 = _2`
|
|
58
46
|
<div class="header-subtitle">${0}</div>
|
|
59
47
|
`), x => x.subtitle);
|
|
60
48
|
}
|
|
61
|
-
|
|
62
49
|
function headerContent() {
|
|
63
50
|
return html(_t4 || (_t4 = _2`
|
|
64
51
|
<div class="header-content">
|
|
@@ -67,7 +54,6 @@ function headerContent() {
|
|
|
67
54
|
</div>
|
|
68
55
|
`), when(x => x.headline, Headline()), when(x => x.subtitle, Subtitle()));
|
|
69
56
|
}
|
|
70
|
-
|
|
71
57
|
function renderHeader() {
|
|
72
58
|
return html(_t5 || (_t5 = _2`
|
|
73
59
|
<header class="header">
|
|
@@ -75,23 +61,19 @@ function renderHeader() {
|
|
|
75
61
|
${0}
|
|
76
62
|
</header>`), slotted('graphicSlottedContent'), when(x => x.icon, renderHeaderIcon()), when(x => x.headline || x.subtitle, headerContent()));
|
|
77
63
|
}
|
|
78
|
-
|
|
79
64
|
function shouldHideHeader(card) {
|
|
80
65
|
return !card.headline && !card.subtitle && !card.icon && (!card.graphicSlottedContent || !card.graphicSlottedContent.length);
|
|
81
66
|
}
|
|
82
|
-
|
|
83
67
|
function renderMetaSlot() {
|
|
84
68
|
return html(_t6 || (_t6 = _2`
|
|
85
69
|
<slot name="meta" ${0}></slot>
|
|
86
70
|
`), slotted('metaSlottedContent'));
|
|
87
71
|
}
|
|
88
|
-
|
|
89
72
|
function text() {
|
|
90
73
|
return html(_t7 || (_t7 = _2`
|
|
91
74
|
<div class="text">${0}</div>
|
|
92
75
|
`), x => x.text);
|
|
93
76
|
}
|
|
94
|
-
|
|
95
77
|
const CardTemplate = () => html(_t8 || (_t8 = _2`
|
|
96
78
|
<vwc-elevation dp=${0}>
|
|
97
79
|
|
|
@@ -118,7 +100,6 @@ const CardTemplate = () => html(_t8 || (_t8 = _2`
|
|
|
118
100
|
</vwc-elevation>
|
|
119
101
|
`), x => {
|
|
120
102
|
var _a;
|
|
121
|
-
|
|
122
103
|
return (_a = x.elevation) !== null && _a !== void 0 ? _a : '4';
|
|
123
104
|
}, getClasses, renderHeader(), renderMetaSlot(), when(x => x.text, text()), slotted('footerSlottedContent'));
|
|
124
105
|
|
package/checkbox/index.js
CHANGED
|
@@ -101,51 +101,43 @@ __decorate([
|
|
|
101
101
|
observable
|
|
102
102
|
], Checkbox$1.prototype, "indeterminate", void 0);
|
|
103
103
|
|
|
104
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on
|
|
104
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 02 Nov 2022 12:59:38 GMT\n */\n.base {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n vertical-align: middle;\n}\n.base {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n}\n.base {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-canvas);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-canvas);\n --_appearance-color-outline: var(--vvd-color-canvas-text);\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(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: var(--vvd-color-neutral-100);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.base:where(:readonly, .readonly):where(:not(:disabled, .disabled, :hover, .hover, :active, .active)) {\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.base:where(:indeterminate, .indeterminate):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@supports selector(:focus-visible) {\n .base:focus {\n outline: none;\n }\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}\n\n.control {\n position: relative;\n display: flex;\n width: 20px;\n height: 20px;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n background-color: var(--_appearance-color-fill);\n border-radius: 3px;\n box-shadow: inset 0 0 0 2px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n}\n\n.indicator {\n font-size: 16px;\n}\n.base:not(.checked) .indicator.checkmark {\n display: none;\n}\n\n.base:not(.indeterminate) .indicator.minus, .base.checked .indicator.minus {\n display: none;\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: 6px;\n}\n.base:not(:focus-visible) .focus-indicator {\n display: none;\n}";
|
|
105
105
|
|
|
106
106
|
const keySpace = ' ';
|
|
107
107
|
class Checkbox extends Checkbox$1 {
|
|
108
108
|
constructor() {
|
|
109
109
|
super(...arguments);
|
|
110
|
-
|
|
111
110
|
this.keypressHandler = e => {
|
|
112
111
|
switch (e.key) {
|
|
113
112
|
case keySpace:
|
|
114
113
|
if (this.indeterminate) {
|
|
115
114
|
this.indeterminate = false;
|
|
116
115
|
}
|
|
117
|
-
|
|
118
116
|
this.checked = !this.checked;
|
|
119
117
|
break;
|
|
120
118
|
}
|
|
121
119
|
};
|
|
122
|
-
|
|
123
120
|
this.clickHandler = () => {
|
|
124
121
|
if (!this.disabled && !this.readOnly) {
|
|
125
122
|
if (this.indeterminate) {
|
|
126
123
|
this.indeterminate = false;
|
|
127
124
|
}
|
|
128
|
-
|
|
129
125
|
this.checked = !this.checked;
|
|
130
126
|
}
|
|
131
127
|
};
|
|
132
128
|
}
|
|
133
|
-
|
|
134
129
|
}
|
|
135
|
-
|
|
136
130
|
__decorate([attr, __metadata("design:type", String)], Checkbox.prototype, "label", void 0);
|
|
137
131
|
|
|
138
132
|
let _ = t => t,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
133
|
+
_t,
|
|
134
|
+
_t2;
|
|
142
135
|
const getClasses = ({
|
|
143
136
|
readOnly,
|
|
144
137
|
checked,
|
|
145
138
|
disabled,
|
|
146
139
|
indeterminate
|
|
147
140
|
}) => classNames('base', ['readonly', Boolean(readOnly)], ['checked', Boolean(checked)], ['disabled', Boolean(disabled)], ['indeterminate', Boolean(indeterminate)]);
|
|
148
|
-
|
|
149
141
|
const CheckboxTemplate = context => {
|
|
150
142
|
const focusTemplate = focusTemplateFactory(context);
|
|
151
143
|
const iconTag = context.tagFor(Icon);
|