@vonage/vivid 3.0.0-next.8 → 3.0.0-next.80
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/README.md +141 -4
- package/accordion/index.js +2 -4
- package/accordion-item/index.js +26 -20
- package/action-group/index.js +47 -0
- package/avatar/index.js +70 -0
- package/badge/index.js +17 -21
- package/banner/index.js +23 -87
- package/breadcrumb/index.js +21 -18
- package/breadcrumb-item/index.js +19 -12
- package/button/index.js +19 -757
- package/calendar/index.js +67 -25
- package/calendar-event/index.js +115 -0
- package/card/index.js +132 -0
- package/checkbox/index.js +184 -0
- package/dialog/index.js +281 -0
- package/divider/index.js +3 -0
- package/elevation/index.js +3 -31
- package/fab/index.js +105 -0
- package/focus/index.js +18 -3
- package/header/index.js +66 -0
- package/icon/index.js +9 -5
- package/index.js +53 -20
- package/layout/index.js +4 -6
- package/lib/accordion-item/accordion-item.d.ts +2 -2
- package/lib/accordion-item/index.d.ts +2 -1
- package/lib/action-group/action-group.d.ts +10 -0
- package/lib/{sidenav-item/sidenav-item.template.d.ts → action-group/action-group.template.d.ts} +2 -2
- package/lib/{sidenav-item → action-group}/index.d.ts +1 -2
- package/lib/avatar/avatar.d.ts +15 -0
- package/lib/avatar/avatar.template.d.ts +4 -0
- package/lib/avatar/index.d.ts +3 -0
- package/lib/badge/badge.d.ts +5 -5
- package/lib/badge/index.d.ts +1 -1
- package/lib/banner/banner.d.ts +1 -1
- package/lib/banner/banner.template.d.ts +0 -2
- package/lib/banner/index.d.ts +1 -0
- package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
- package/lib/breadcrumb-item/index.d.ts +1 -0
- package/lib/button/button.d.ts +6 -5
- package/lib/button/index.d.ts +2 -19
- package/lib/calendar/calendar.d.ts +3 -1
- package/lib/calendar/index.d.ts +0 -1
- package/lib/calendar-event/calendar-event.d.ts +14 -0
- package/lib/calendar-event/calendar-event.template.d.ts +4 -0
- package/lib/calendar-event/index.d.ts +2 -0
- package/lib/card/card.d.ts +10 -0
- package/lib/{text/text.template.d.ts → card/card.template.d.ts} +2 -2
- package/lib/card/index.d.ts +4 -0
- package/lib/checkbox/checkbox.d.ts +5 -0
- package/lib/checkbox/checkbox.template.d.ts +4 -0
- package/lib/checkbox/index.d.ts +4 -0
- package/lib/components.d.ts +27 -10
- package/lib/dialog/dialog.d.ts +20 -0
- package/lib/dialog/dialog.template.d.ts +4 -0
- package/lib/dialog/index.d.ts +5 -0
- package/lib/divider/divider.d.ts +3 -0
- package/lib/divider/divider.template.d.ts +4 -0
- package/lib/divider/index.d.ts +2 -0
- package/lib/elevation/elevation.d.ts +1 -0
- package/lib/elevation/index.d.ts +1 -1
- package/lib/enums.d.ts +11 -6
- package/lib/fab/fab.d.ts +13 -0
- package/lib/fab/fab.template.d.ts +4 -0
- package/lib/fab/index.d.ts +4 -0
- package/lib/focus/index.d.ts +1 -1
- package/lib/header/header.d.ts +5 -0
- package/lib/header/header.template.d.ts +4 -0
- package/lib/header/index.d.ts +3 -0
- package/lib/icon/icon.d.ts +4 -3
- package/lib/layout/index.d.ts +1 -1
- package/lib/layout/layout.d.ts +3 -3
- package/lib/menu/index.d.ts +12 -0
- package/lib/menu/menu.d.ts +10 -0
- package/lib/menu/menu.template.d.ts +3 -0
- package/lib/menu-item/index.d.ts +3 -0
- package/lib/menu-item/menu-item.d.ts +7 -0
- package/lib/menu-item/menu-item.template.d.ts +5 -0
- package/lib/nav/index.d.ts +2 -0
- package/lib/nav/nav.d.ts +3 -0
- package/lib/nav/nav.template.d.ts +4 -0
- package/lib/nav-disclosure/index.d.ts +4 -0
- package/lib/nav-disclosure/nav-disclosure.d.ts +10 -0
- package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -0
- package/lib/nav-item/index.d.ts +4 -0
- package/lib/{sidenav-item/sidenav-item.d.ts → nav-item/nav-item.d.ts} +2 -2
- package/lib/nav-item/nav-item.template.d.ts +4 -0
- package/lib/{text → note}/index.d.ts +1 -1
- package/lib/note/note.d.ts +10 -0
- package/lib/note/note.template.d.ts +5 -0
- package/lib/number-field/index.d.ts +4 -0
- package/lib/number-field/number-field.d.ts +16 -0
- package/lib/number-field/number-field.template.d.ts +4 -0
- package/lib/popup/index.d.ts +1 -1
- package/lib/popup/popup.d.ts +2 -1
- package/lib/progress/progress.d.ts +1 -1
- package/lib/progress-ring/progress-ring.d.ts +2 -1
- package/lib/radio/index.d.ts +3 -0
- package/lib/radio/radio.d.ts +4 -0
- package/lib/radio/radio.template.d.ts +4 -0
- package/lib/side-drawer/index.d.ts +1 -1
- package/lib/side-drawer/side-drawer.d.ts +3 -2
- package/lib/text-anchor/text-anchor.d.ts +1 -1
- package/lib/text-area/index.d.ts +3 -0
- package/lib/text-area/text-area.d.ts +9 -0
- package/lib/text-area/text-area.template.d.ts +4 -0
- package/lib/text-field/index.d.ts +4 -0
- package/lib/text-field/text-field.d.ts +16 -0
- package/lib/text-field/text-field.template.d.ts +5 -0
- package/lib/tooltip/tooltip.d.ts +2 -2
- package/menu/index.js +381 -0
- package/menu-item/index.js +19 -0
- package/nav/index.js +17 -0
- package/nav-disclosure/index.js +88 -0
- package/nav-item/index.js +45 -0
- package/note/index.js +66 -0
- package/number-field/index.js +529 -0
- package/package.json +51 -7
- package/popup/index.js +23 -2061
- package/progress/index.js +35 -28
- package/progress-ring/index.js +9 -5
- package/radio/index.js +174 -0
- package/shared/anchor.js +10 -2
- package/shared/aria-global.js +2 -86
- package/shared/base-progress.js +5 -0
- package/shared/breadcrumb-item.js +1 -1
- package/shared/button.js +200 -0
- package/shared/calendar-event.js +26 -0
- package/shared/dialog-polyfill.esm.js +858 -0
- package/shared/enums.js +79 -0
- package/shared/es.object.assign.js +7 -6
- package/shared/export.js +995 -0
- package/shared/focus.js +5 -0
- package/shared/focus2.js +11 -0
- package/shared/form-associated.js +466 -0
- package/shared/form-elements.js +299 -0
- package/shared/icon.js +533 -520
- package/shared/index.js +71 -55
- package/shared/index2.js +110 -13
- package/shared/index3.js +35 -0
- package/shared/index4.js +86 -0
- package/shared/index5.js +2100 -0
- package/shared/index6.js +371 -0
- package/shared/iterators.js +61 -0
- package/shared/key-codes.js +90 -0
- package/shared/object-keys.js +13 -0
- package/shared/patterns/focus.d.ts +3 -0
- package/shared/patterns/form-elements.d.ts +22 -0
- package/shared/patterns/index.d.ts +1 -0
- package/shared/ref.js +41 -0
- package/shared/regexp-flags.js +21 -0
- package/shared/start-end.js +50 -0
- package/shared/text-anchor.js +2 -11
- package/shared/text-anchor.template.js +5 -2
- package/shared/to-string.js +51 -0
- package/shared/web.dom-collections.iterator.js +78 -1083
- package/side-drawer/index.js +44 -23
- package/styles/core/all.css +75 -0
- package/styles/core/theme.css +11 -0
- package/styles/core/typography.css +69 -0
- package/styles/fonts/SpeziaCompleteVariableItalicWeb.woff2 +0 -0
- package/styles/fonts/SpeziaCompleteVariableUprightWeb.woff2 +0 -0
- package/styles/fonts/SpeziaMonoCompleteVariableWeb.woff2 +0 -0
- package/styles/fonts/spezia.css +9 -12
- package/styles/tokens/theme-dark.css +211 -0
- package/styles/tokens/theme-light.css +211 -0
- package/text-anchor/index.js +9 -1
- package/text-area/index.js +304 -0
- package/text-field/index.js +152 -0
- package/tooltip/index.js +23 -16
- package/lib/text/text.d.ts +0 -10
- package/shared/style-inject.es.js +0 -28
- package/sidenav-item/index.js +0 -38
- package/styles/themes/dark.css +0 -205
- package/styles/themes/light.css +0 -205
- package/text/index.js +0 -45
package/shared/index.js
CHANGED
|
@@ -275,30 +275,6 @@ const DOM = Object.freeze({
|
|
|
275
275
|
},
|
|
276
276
|
});
|
|
277
277
|
|
|
278
|
-
function spilloverSubscribe(subscriber) {
|
|
279
|
-
const spillover = this.spillover;
|
|
280
|
-
const index = spillover.indexOf(subscriber);
|
|
281
|
-
if (index === -1) {
|
|
282
|
-
spillover.push(subscriber);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
function spilloverUnsubscribe(subscriber) {
|
|
286
|
-
const spillover = this.spillover;
|
|
287
|
-
const index = spillover.indexOf(subscriber);
|
|
288
|
-
if (index !== -1) {
|
|
289
|
-
spillover.splice(index, 1);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
function spilloverNotifySubscribers(args) {
|
|
293
|
-
const spillover = this.spillover;
|
|
294
|
-
const source = this.source;
|
|
295
|
-
for (let i = 0, ii = spillover.length; i < ii; ++i) {
|
|
296
|
-
spillover[i].handleChange(source, args);
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
function spilloverHas(subscriber) {
|
|
300
|
-
return this.spillover.indexOf(subscriber) !== -1;
|
|
301
|
-
}
|
|
302
278
|
/**
|
|
303
279
|
* An implementation of {@link Notifier} that efficiently keeps track of
|
|
304
280
|
* subscribers interested in a specific change notification on an
|
|
@@ -328,42 +304,58 @@ class SubscriberSet {
|
|
|
328
304
|
* @param subscriber - The subscriber to test for inclusion in this set.
|
|
329
305
|
*/
|
|
330
306
|
has(subscriber) {
|
|
331
|
-
return this.
|
|
307
|
+
return this.spillover === void 0
|
|
308
|
+
? this.sub1 === subscriber || this.sub2 === subscriber
|
|
309
|
+
: this.spillover.indexOf(subscriber) !== -1;
|
|
332
310
|
}
|
|
333
311
|
/**
|
|
334
312
|
* Subscribes to notification of changes in an object's state.
|
|
335
313
|
* @param subscriber - The object that is subscribing for change notification.
|
|
336
314
|
*/
|
|
337
315
|
subscribe(subscriber) {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
316
|
+
const spillover = this.spillover;
|
|
317
|
+
if (spillover === void 0) {
|
|
318
|
+
if (this.has(subscriber)) {
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
if (this.sub1 === void 0) {
|
|
322
|
+
this.sub1 = subscriber;
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
if (this.sub2 === void 0) {
|
|
326
|
+
this.sub2 = subscriber;
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
this.spillover = [this.sub1, this.sub2, subscriber];
|
|
330
|
+
this.sub1 = void 0;
|
|
331
|
+
this.sub2 = void 0;
|
|
344
332
|
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
333
|
+
else {
|
|
334
|
+
const index = spillover.indexOf(subscriber);
|
|
335
|
+
if (index === -1) {
|
|
336
|
+
spillover.push(subscriber);
|
|
337
|
+
}
|
|
348
338
|
}
|
|
349
|
-
this.spillover = [this.sub1, this.sub2, subscriber];
|
|
350
|
-
this.subscribe = spilloverSubscribe;
|
|
351
|
-
this.unsubscribe = spilloverUnsubscribe;
|
|
352
|
-
this.notify = spilloverNotifySubscribers;
|
|
353
|
-
this.has = spilloverHas;
|
|
354
|
-
this.sub1 = void 0;
|
|
355
|
-
this.sub2 = void 0;
|
|
356
339
|
}
|
|
357
340
|
/**
|
|
358
341
|
* Unsubscribes from notification of changes in an object's state.
|
|
359
342
|
* @param subscriber - The object that is unsubscribing from change notification.
|
|
360
343
|
*/
|
|
361
344
|
unsubscribe(subscriber) {
|
|
362
|
-
|
|
363
|
-
|
|
345
|
+
const spillover = this.spillover;
|
|
346
|
+
if (spillover === void 0) {
|
|
347
|
+
if (this.sub1 === subscriber) {
|
|
348
|
+
this.sub1 = void 0;
|
|
349
|
+
}
|
|
350
|
+
else if (this.sub2 === subscriber) {
|
|
351
|
+
this.sub2 = void 0;
|
|
352
|
+
}
|
|
364
353
|
}
|
|
365
|
-
else
|
|
366
|
-
|
|
354
|
+
else {
|
|
355
|
+
const index = spillover.indexOf(subscriber);
|
|
356
|
+
if (index !== -1) {
|
|
357
|
+
spillover.splice(index, 1);
|
|
358
|
+
}
|
|
367
359
|
}
|
|
368
360
|
}
|
|
369
361
|
/**
|
|
@@ -371,14 +363,22 @@ class SubscriberSet {
|
|
|
371
363
|
* @param args - Data passed along to subscribers during notification.
|
|
372
364
|
*/
|
|
373
365
|
notify(args) {
|
|
374
|
-
const
|
|
375
|
-
const sub2 = this.sub2;
|
|
366
|
+
const spillover = this.spillover;
|
|
376
367
|
const source = this.source;
|
|
377
|
-
if (
|
|
378
|
-
sub1.
|
|
368
|
+
if (spillover === void 0) {
|
|
369
|
+
const sub1 = this.sub1;
|
|
370
|
+
const sub2 = this.sub2;
|
|
371
|
+
if (sub1 !== void 0) {
|
|
372
|
+
sub1.handleChange(source, args);
|
|
373
|
+
}
|
|
374
|
+
if (sub2 !== void 0) {
|
|
375
|
+
sub2.handleChange(source, args);
|
|
376
|
+
}
|
|
379
377
|
}
|
|
380
|
-
|
|
381
|
-
|
|
378
|
+
else {
|
|
379
|
+
for (let i = 0, ii = spillover.length; i < ii; ++i) {
|
|
380
|
+
spillover[i].handleChange(source, args);
|
|
381
|
+
}
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
}
|
|
@@ -424,7 +424,8 @@ class PropertyChangeNotifier {
|
|
|
424
424
|
subscribers.subscribe(subscriber);
|
|
425
425
|
}
|
|
426
426
|
else {
|
|
427
|
-
this.sourceSubscribers =
|
|
427
|
+
this.sourceSubscribers =
|
|
428
|
+
(_a = this.sourceSubscribers) !== null && _a !== void 0 ? _a : new SubscriberSet(this.source);
|
|
428
429
|
this.sourceSubscribers.subscribe(subscriber);
|
|
429
430
|
}
|
|
430
431
|
}
|
|
@@ -568,6 +569,7 @@ const Observable = FAST.getById(2 /* observable */, () => {
|
|
|
568
569
|
watcher = void 0;
|
|
569
570
|
/* eslint-disable-next-line */
|
|
570
571
|
prevValue = prev.propertySource[prev.propertyName];
|
|
572
|
+
/* eslint-disable-next-line @typescript-eslint/no-this-alias */
|
|
571
573
|
watcher = this;
|
|
572
574
|
if (propertySource === prevValue) {
|
|
573
575
|
this.needsRefresh = true;
|
|
@@ -707,6 +709,21 @@ const Observable = FAST.getById(2 /* observable */, () => {
|
|
|
707
709
|
function observable(target, nameOrAccessor) {
|
|
708
710
|
Observable.defineProperty(target, nameOrAccessor);
|
|
709
711
|
}
|
|
712
|
+
/**
|
|
713
|
+
* Decorator: Marks a property getter as having volatile observable dependencies.
|
|
714
|
+
* @param target - The target that the property is defined on.
|
|
715
|
+
* @param name - The property name.
|
|
716
|
+
* @param name - The existing descriptor.
|
|
717
|
+
* @public
|
|
718
|
+
*/
|
|
719
|
+
function volatile(target, name, descriptor) {
|
|
720
|
+
return Object.assign({}, descriptor, {
|
|
721
|
+
get: function () {
|
|
722
|
+
Observable.trackVolatile();
|
|
723
|
+
return descriptor.get.apply(this);
|
|
724
|
+
},
|
|
725
|
+
});
|
|
726
|
+
}
|
|
710
727
|
const contextEvent = FAST.getById(3 /* contextEvent */, () => {
|
|
711
728
|
let current = null;
|
|
712
729
|
return {
|
|
@@ -1128,6 +1145,7 @@ class CompilationContext {
|
|
|
1128
1145
|
this.targetIndex = -1;
|
|
1129
1146
|
}
|
|
1130
1147
|
release() {
|
|
1148
|
+
/* eslint-disable-next-line @typescript-eslint/no-this-alias */
|
|
1131
1149
|
sharedContext = this;
|
|
1132
1150
|
}
|
|
1133
1151
|
static borrow(directives) {
|
|
@@ -1606,8 +1624,6 @@ function html(strings, ...values) {
|
|
|
1606
1624
|
class ElementStyles {
|
|
1607
1625
|
constructor() {
|
|
1608
1626
|
this.targets = new WeakSet();
|
|
1609
|
-
/** @internal */
|
|
1610
|
-
this.behaviors = null;
|
|
1611
1627
|
}
|
|
1612
1628
|
/** @internal */
|
|
1613
1629
|
addStylesTo(target) {
|
|
@@ -4995,4 +5011,4 @@ function provideVividDesignSystem(element) {
|
|
|
4995
5011
|
}
|
|
4996
5012
|
const designSystem = provideVividDesignSystem();
|
|
4997
5013
|
|
|
4998
|
-
export { AttachedBehaviorHTMLDirective as A, DOM as D, FoundationElement as F, HTMLDirective as H, Observable as O, SubscriberSet as S, __decorate as _, attr as a, __metadata as b, __classPrivateFieldGet as c, designSystem as d, emptyArray as e,
|
|
5014
|
+
export { AttachedBehaviorHTMLDirective as A, DOM as D, FoundationElement as F, HTMLDirective as H, Observable as O, SubscriberSet as S, __decorate as _, attr as a, __metadata as b, __classPrivateFieldGet as c, designSystem as d, emptyArray as e, booleanConverter as f, HTMLView as g, html as h, __classPrivateFieldSet as i, nullableNumberConverter as n, observable as o, provideVividDesignSystem as p, volatile as v };
|
package/shared/index2.js
CHANGED
|
@@ -1,21 +1,118 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import '../icon/index.js';
|
|
2
|
+
import '../focus/index.js';
|
|
3
|
+
import { _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from './index.js';
|
|
4
|
+
import './web.dom-collections.iterator.js';
|
|
5
|
+
import { A as AffixIconWithTrailing, a as affixIconTemplateFactory } from './affix.js';
|
|
6
|
+
import { B as Button$1 } from './button.js';
|
|
7
|
+
import { a as applyMixins } from './apply-mixins.js';
|
|
8
|
+
import { f as focusTemplateFactory } from './focus2.js';
|
|
9
|
+
import { r as ref } from './ref.js';
|
|
10
|
+
import { c as classNames } from './class-names.js';
|
|
3
11
|
|
|
4
|
-
class
|
|
12
|
+
class Button extends Button$1 {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.stacked = false;
|
|
16
|
+
}
|
|
5
17
|
|
|
6
|
-
|
|
7
|
-
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
__decorate([attr, __metadata("design:type", String)], Button.prototype, "connotation", void 0);
|
|
21
|
+
|
|
22
|
+
__decorate([attr, __metadata("design:type", String)], Button.prototype, "shape", void 0);
|
|
23
|
+
|
|
24
|
+
__decorate([attr, __metadata("design:type", String)], Button.prototype, "appearance", void 0);
|
|
25
|
+
|
|
26
|
+
__decorate([attr, __metadata("design:type", String)], Button.prototype, "density", void 0);
|
|
27
|
+
|
|
28
|
+
__decorate([attr({
|
|
29
|
+
mode: 'boolean',
|
|
30
|
+
attribute: 'stacked'
|
|
31
|
+
}), __metadata("design:type", Object)], Button.prototype, "stacked", void 0);
|
|
32
|
+
|
|
33
|
+
__decorate([attr, __metadata("design:type", String)], Button.prototype, "label", void 0);
|
|
34
|
+
|
|
35
|
+
applyMixins(Button, AffixIconWithTrailing);
|
|
36
|
+
|
|
37
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 19 Oct 2022 08:48:31 GMT\n */\n:host {\n display: inline-block;\n}\n\n.control {\n position: relative;\n display: inline-flex;\n box-sizing: border-box;\n align-items: center;\n border: 0 none;\n margin: 0;\n background-color: var(--_appearance-color-fill);\n block-size: var(--_button-block-size);\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n gap: var(--_button-icon-gap);\n vertical-align: middle;\n white-space: nowrap;\n /* Size */\n}\n.control.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary-increment: var(--vvd-color-cta-600);\n --_connotation-color-contrast: var(--vvd-color-cta-800);\n --_connotation-color-fierce: var(--vvd-color-cta-700);\n --_connotation-color-firm: var(--vvd-color-cta-600);\n --_connotation-color-soft: var(--vvd-color-cta-100);\n --_connotation-color-faint: var(--vvd-color-cta-50);\n}\n.control.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary-increment: var(--vvd-color-success-600);\n --_connotation-color-contrast: var(--vvd-color-success-800);\n --_connotation-color-fierce: var(--vvd-color-success-700);\n --_connotation-color-firm: var(--vvd-color-success-600);\n --_connotation-color-soft: var(--vvd-color-success-100);\n --_connotation-color-faint: var(--vvd-color-success-50);\n}\n.control.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary-increment: var(--vvd-color-alert-600);\n --_connotation-color-contrast: var(--vvd-color-alert-800);\n --_connotation-color-fierce: var(--vvd-color-alert-700);\n --_connotation-color-firm: var(--vvd-color-alert-600);\n --_connotation-color-soft: var(--vvd-color-alert-100);\n --_connotation-color-faint: var(--vvd-color-alert-50);\n}\n.control:not(.connotation-cta, .connotation-success, .connotation-alert) {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary-increment: var(--vvd-color-neutral-800);\n --_connotation-color-contrast: var(--vvd-color-neutral-800);\n --_connotation-color-fierce: var(--vvd-color-neutral-700);\n --_connotation-color-firm: var(--vvd-color-canvas-text);\n --_connotation-color-soft: var(--vvd-color-neutral-100);\n --_connotation-color-faint: var(--vvd-color-neutral-50);\n}\n.control.appearance-filled {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transparent;\n}\n.control.appearance-outlined {\n --_appearance-color-text: var(--_connotation-color-firm);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.control {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled)).appearance-filled {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary-increment);\n --_appearance-color-outline: transparent;\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled)).appearance-outlined {\n --_appearance-color-text: var(--_connotation-color-firm);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transparent;\n}\n.control:where(:disabled, .disabled).appearance-filled {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\n --_appearance-color-outline: transparent;\n}\n.control:where(:disabled, .disabled).appearance-outlined {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.control:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.control:where(:active, .active):where(:not(:disabled, .disabled)).appearance-filled {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-fierce);\n --_appearance-color-outline: transparent;\n}\n.control:where(:active, .active):where(:not(:disabled, .disabled)).appearance-outlined {\n --_appearance-color-text: var(--_connotation-color-firm);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.control:where(:active, .active):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transparent;\n}\n@supports selector(:focus-visible) {\n .control:focus {\n outline: none;\n }\n}\n@supports (user-select: none) {\n .control {\n user-select: none;\n }\n}\n.control:not(:disabled) {\n cursor: pointer;\n}\n.control:disabled {\n cursor: not-allowed;\n}\n.control.icon-only {\n contain: size;\n padding-inline: 0;\n place-content: center;\n}\n@supports (aspect-ratio: 1) {\n .control.icon-only {\n aspect-ratio: 1;\n }\n}\n@supports not (aspect-ratio: 1) {\n .control.icon-only {\n inline-size: var(--_button-block-size);\n }\n}\n.control:not(.stacked).density-condensed {\n --_button-block-size: 32px;\n font: var(--vvd-font-base-condensed-bold);\n}\n.control:not(.stacked).density-condensed:not(.icon-only) {\n --_button-icon-gap: 8px;\n padding-inline: 12px;\n}\n.control:not(.stacked).density-condensed .icon {\n font-size: 16px;\n}\n.control:not(.stacked).density-extended {\n --_button-block-size: 48px;\n font: var(--vvd-font-base-extended-bold);\n}\n.control:not(.stacked).density-extended:not(.icon-only) {\n --_button-icon-gap: 10px;\n padding-inline: 20px;\n}\n.control:not(.stacked).density-extended .icon {\n font-size: 24px;\n}\n.control:not(.stacked):not(.density-condensed, .density-extended) {\n --_button-block-size: 40px;\n font: var(--vvd-font-base-bold);\n}\n.control:not(.stacked):not(.density-condensed, .density-extended):not(.icon-only) {\n --_button-icon-gap: 8px;\n padding-inline: 16px;\n}\n.control:not(.stacked):not(.density-condensed, .density-extended) .icon {\n font-size: 20px;\n}\n.control.stacked {\n flex-direction: column;\n justify-content: center;\n --_button-block-size: 68px;\n font: var(--vvd-font-base-bold);\n}\n.control.stacked:not(.icon-only) {\n --_button-icon-gap: 10px;\n padding-inline: 16px;\n}\n.control.stacked .icon {\n font-size: 20px;\n}\n\n/* Shape */\n.control:not(.shape-pill:not(.stacked)) {\n border-radius: 6px;\n}\n\n.control.shape-pill:not(.stacked):not(.icon-only) {\n border-radius: 24px;\n}\n.control.shape-pill:not(.stacked).icon-only {\n border-radius: 50%;\n}\n\n/* Icon */\n.icon-trailing .icon {\n order: 1;\n}\n\n:not(:focus-visible) > .focus-indicator {\n display: none;\n}\n.appearance-outlined .focus-indicator, .appearance-ghost .focus-indicator {\n --focus-stroke-gap-color: transparent;\n}";
|
|
8
38
|
|
|
9
39
|
let _ = t => t,
|
|
10
40
|
_t;
|
|
11
|
-
const focusTemplate = () => html(_t || (_t = _`
|
|
12
|
-
<span class="control"></span>`));
|
|
13
41
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
42
|
+
const getAppearanceClassName = (appearance, disabled) => {
|
|
43
|
+
let className = `appearance-${appearance}`;
|
|
44
|
+
disabled && (className += ' disabled');
|
|
45
|
+
return className;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const getClasses = ({
|
|
49
|
+
connotation,
|
|
50
|
+
appearance,
|
|
51
|
+
shape,
|
|
52
|
+
density,
|
|
53
|
+
iconTrailing,
|
|
54
|
+
icon,
|
|
55
|
+
label,
|
|
56
|
+
disabled,
|
|
57
|
+
stacked
|
|
58
|
+
}) => classNames('control', [`connotation-${connotation}`, Boolean(connotation)], [getAppearanceClassName(appearance, disabled), Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], [`density-${density}`, Boolean(density)], ['icon-only', !label && !!icon], ['icon-trailing', iconTrailing], ['stacked', Boolean(stacked)]);
|
|
59
|
+
|
|
60
|
+
const buttonTemplate = context => {
|
|
61
|
+
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
62
|
+
const focusTemplate = focusTemplateFactory(context);
|
|
63
|
+
return html(_t || (_t = _`
|
|
64
|
+
<button
|
|
65
|
+
class="${0}"
|
|
66
|
+
?autofocus="${0}"
|
|
67
|
+
?disabled="${0}"
|
|
68
|
+
form="${0}"
|
|
69
|
+
formaction="${0}"
|
|
70
|
+
formenctype="${0}"
|
|
71
|
+
formmethod="${0}"
|
|
72
|
+
formnovalidate="${0}"
|
|
73
|
+
formtarget="${0}"
|
|
74
|
+
name="${0}"
|
|
75
|
+
type="${0}"
|
|
76
|
+
value="${0}"
|
|
77
|
+
aria-atomic="${0}"
|
|
78
|
+
aria-busy="${0}"
|
|
79
|
+
aria-controls="${0}"
|
|
80
|
+
aria-current="${0}"
|
|
81
|
+
aria-describedby="${0}"
|
|
82
|
+
aria-details="${0}"
|
|
83
|
+
aria-disabled="${0}"
|
|
84
|
+
aria-errormessage="${0}"
|
|
85
|
+
aria-expanded="${0}"
|
|
86
|
+
aria-flowto="${0}"
|
|
87
|
+
aria-haspopup="${0}"
|
|
88
|
+
aria-hidden="${0}"
|
|
89
|
+
aria-invalid="${0}"
|
|
90
|
+
aria-keyshortcuts="${0}"
|
|
91
|
+
aria-label="${0}"
|
|
92
|
+
aria-labelledby="${0}"
|
|
93
|
+
aria-live="${0}"
|
|
94
|
+
aria-owns="${0}"
|
|
95
|
+
aria-pressed="${0}"
|
|
96
|
+
aria-relevant="${0}"
|
|
97
|
+
aria-roledescription="${0}"
|
|
98
|
+
${0}
|
|
99
|
+
>
|
|
100
|
+
${0}
|
|
101
|
+
${0}
|
|
102
|
+
${0}
|
|
103
|
+
</button>
|
|
104
|
+
`), getClasses, x => x.autofocus, x => x.disabled, x => x.formId, x => x.formaction, x => x.formenctype, x => x.formmethod, x => x.formnovalidate, x => x.formtarget, x => x.name, x => x.type, x => x.value, x => x.ariaAtomic, x => x.ariaBusy, x => x.ariaControls, x => x.ariaCurrent, x => x.ariaDescribedby, x => x.ariaDetails, x => x.ariaDisabled, x => x.ariaErrormessage, x => x.ariaExpanded, x => x.ariaFlowto, x => x.ariaHaspopup, x => x.ariaHidden, x => x.ariaInvalid, x => x.ariaKeyshortcuts, x => x.ariaLabel, x => x.ariaLabelledby, x => x.ariaLive, x => x.ariaOwns, x => x.ariaPressed, x => x.ariaRelevant, x => x.ariaRoledescription, ref('control'), () => focusTemplate, x => affixIconTemplate(x.icon), x => x.label);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const vividButton = Button.compose({
|
|
108
|
+
baseName: 'button',
|
|
109
|
+
baseClass: Button$1,
|
|
110
|
+
template: buttonTemplate,
|
|
111
|
+
styles: css_248z,
|
|
112
|
+
shadowOptions: {
|
|
113
|
+
delegatesFocus: true
|
|
114
|
+
}
|
|
18
115
|
});
|
|
19
|
-
designSystem.register(
|
|
116
|
+
designSystem.register(vividButton());
|
|
20
117
|
|
|
21
|
-
export {
|
|
118
|
+
export { Button as B, vividButton as v };
|
package/shared/index3.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from './index.js';
|
|
2
|
+
import { c as classNames } from './class-names.js';
|
|
3
|
+
|
|
4
|
+
class Elevation extends FoundationElement {}
|
|
5
|
+
|
|
6
|
+
__decorate([attr, __metadata("design:type", Number)], Elevation.prototype, "dp", void 0);
|
|
7
|
+
|
|
8
|
+
__decorate([attr({
|
|
9
|
+
attribute: 'no-shadow',
|
|
10
|
+
mode: 'boolean'
|
|
11
|
+
}), __metadata("design:type", Boolean)], Elevation.prototype, "noShadow", void 0);
|
|
12
|
+
|
|
13
|
+
var css_248z = ":host {\n display: contents;\n}\n\n.control {\n display: contents;\n}\n.control.dp-0 {\n --_elevation-fill: var(--vvd-color-surface-0dp);\n --_elevation-shadow: var(--vvd-shadow-surface-0dp);\n}\n.control.dp-4 {\n --_elevation-fill: var(--vvd-color-surface-4dp);\n --_elevation-shadow: var(--vvd-shadow-surface-4dp);\n}\n.control.dp-8 {\n --_elevation-fill: var(--vvd-color-surface-8dp);\n --_elevation-shadow: var(--vvd-shadow-surface-8dp);\n}\n.control.dp-12 {\n --_elevation-fill: var(--vvd-color-surface-12dp);\n --_elevation-shadow: var(--vvd-shadow-surface-12dp);\n}\n.control.dp-16 {\n --_elevation-fill: var(--vvd-color-surface-16dp);\n --_elevation-shadow: var(--vvd-shadow-surface-16dp);\n}\n.control.dp-24 {\n --_elevation-fill: var(--vvd-color-surface-24dp);\n --_elevation-shadow: var(--vvd-shadow-surface-24dp);\n}\n.control:not(.dp-0, .dp-4, .dp-8, .dp-12, .dp-16, .dp-24) {\n --_elevation-fill: var(--vvd-color-surface-2dp);\n --_elevation-shadow: var(--vvd-shadow-surface-2dp);\n}\n.control ::slotted(*) {\n background: var(--_elevation-fill);\n filter: var(--_elevation-shadow);\n transition: background-color 0.15s linear, filter 0.15s linear;\n}\n.control.no-shadow ::slotted(*) {\n filter: none;\n}";
|
|
14
|
+
|
|
15
|
+
let _ = t => t,
|
|
16
|
+
_t;
|
|
17
|
+
|
|
18
|
+
const getClasses = ({
|
|
19
|
+
dp,
|
|
20
|
+
noShadow
|
|
21
|
+
}) => classNames('control', [`dp-${dp}`, Boolean(dp)], ['no-shadow', Boolean(noShadow)]);
|
|
22
|
+
|
|
23
|
+
const elevationTemplate = () => html(_t || (_t = _`
|
|
24
|
+
<div class="${0}" part="base">
|
|
25
|
+
<slot></slot>
|
|
26
|
+
</div>`), getClasses);
|
|
27
|
+
|
|
28
|
+
const vividElevation = Elevation.compose({
|
|
29
|
+
baseName: 'elevation',
|
|
30
|
+
template: elevationTemplate,
|
|
31
|
+
styles: css_248z
|
|
32
|
+
});
|
|
33
|
+
designSystem.register(vividElevation());
|
|
34
|
+
|
|
35
|
+
export { Elevation as E, vividElevation as v };
|
package/shared/index4.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { F as FoundationElement, _ as __decorate, a as attr, h as html, d as designSystem } from './index.js';
|
|
2
|
+
import { c as classNames } from './class-names.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Standard orientation values
|
|
6
|
+
*/
|
|
7
|
+
const Orientation = {
|
|
8
|
+
horizontal: "horizontal",
|
|
9
|
+
vertical: "vertical",
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Divider roles
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
const DividerRole = {
|
|
17
|
+
/**
|
|
18
|
+
* The divider semantically separates content
|
|
19
|
+
*/
|
|
20
|
+
separator: "separator",
|
|
21
|
+
/**
|
|
22
|
+
* The divider has no semantic value and is for visual presentation only.
|
|
23
|
+
*/
|
|
24
|
+
presentation: "presentation",
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A Divider Custom HTML Element.
|
|
29
|
+
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#separator | ARIA separator } or {@link https://www.w3.org/TR/wai-aria-1.1/#presentation | ARIA presentation}.
|
|
30
|
+
*
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
class Divider$1 extends FoundationElement {
|
|
34
|
+
constructor() {
|
|
35
|
+
super(...arguments);
|
|
36
|
+
/**
|
|
37
|
+
* The role of the element.
|
|
38
|
+
*
|
|
39
|
+
* @public
|
|
40
|
+
* @remarks
|
|
41
|
+
* HTML Attribute: role
|
|
42
|
+
*/
|
|
43
|
+
this.role = DividerRole.separator;
|
|
44
|
+
/**
|
|
45
|
+
* The orientation of the divider.
|
|
46
|
+
*
|
|
47
|
+
* @public
|
|
48
|
+
* @remarks
|
|
49
|
+
* HTML Attribute: orientation
|
|
50
|
+
*/
|
|
51
|
+
this.orientation = Orientation.horizontal;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
__decorate([
|
|
55
|
+
attr
|
|
56
|
+
], Divider$1.prototype, "role", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
attr
|
|
59
|
+
], Divider$1.prototype, "orientation", void 0);
|
|
60
|
+
|
|
61
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 19 Oct 2022 08:48:31 GMT\n */\n:host {\n display: block;\n}\n\n.base {\n display: block;\n background-color: var(--vvd-color-neutral-200);\n}\n.base:not(.vertical) {\n block-size: 1px;\n inline-size: 100%;\n}\n.base.vertical {\n block-size: 100%;\n inline-size: 1px;\n}";
|
|
62
|
+
|
|
63
|
+
class Divider extends Divider$1 {}
|
|
64
|
+
|
|
65
|
+
let _ = t => t,
|
|
66
|
+
_t;
|
|
67
|
+
|
|
68
|
+
const getClasses = ({
|
|
69
|
+
orientation
|
|
70
|
+
}) => classNames('base', [`${orientation}`, Boolean(orientation)]);
|
|
71
|
+
|
|
72
|
+
const DividerTemplate = () => html(_t || (_t = _`
|
|
73
|
+
<span
|
|
74
|
+
class="${0}"
|
|
75
|
+
orientation="${0}"
|
|
76
|
+
role="${0}"
|
|
77
|
+
></span>`), getClasses, x => x.orientation, x => x.role);
|
|
78
|
+
|
|
79
|
+
const vividDivider = Divider.compose({
|
|
80
|
+
baseName: 'divider',
|
|
81
|
+
template: DividerTemplate,
|
|
82
|
+
styles: css_248z
|
|
83
|
+
});
|
|
84
|
+
designSystem.register(vividDivider());
|
|
85
|
+
|
|
86
|
+
export { Divider as D, vividDivider as v };
|