@vonage/vivid 3.0.0-next.3 → 3.0.0-next.32
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 +49 -4
- package/accordion/index.js +61 -0
- package/accordion-item/index.js +133 -0
- package/action-group/index.js +49 -0
- package/badge/index.js +27 -22
- package/banner/index.js +148 -0
- package/breadcrumb/index.js +41 -150
- package/breadcrumb-item/index.js +18 -8
- package/button/index.js +40 -663
- package/calendar/index.js +1550 -0
- package/calendar-event/index.js +117 -0
- package/card/index.js +134 -0
- package/checkbox/index.js +176 -0
- package/dialog/index.js +277 -0
- package/divider/index.js +88 -0
- package/elevation/index.js +4 -38
- package/fab/index.js +101 -0
- package/focus/index.js +20 -3
- package/header/index.js +68 -0
- package/icon/index.js +40 -5
- package/index.d.ts +1 -0
- package/index.js +50 -14
- package/layout/index.js +5 -5
- package/lib/accordion/accordion.d.ts +9 -0
- package/lib/accordion/accordion.template.d.ts +4 -0
- package/lib/accordion/index.d.ts +2 -0
- package/lib/accordion-item/accordion-item.d.ts +13 -0
- package/lib/accordion-item/accordion-item.template.d.ts +4 -0
- package/lib/accordion-item/index.d.ts +4 -0
- package/lib/action-group/action-group.d.ts +10 -0
- package/lib/action-group/action-group.template.d.ts +4 -0
- package/lib/action-group/index.d.ts +2 -0
- package/lib/badge/badge.d.ts +8 -8
- package/lib/badge/index.d.ts +1 -1
- package/lib/banner/banner.d.ts +20 -0
- package/lib/banner/banner.template.d.ts +4 -0
- package/lib/banner/index.d.ts +3 -0
- package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
- package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +0 -1
- package/lib/breadcrumb-item/index.d.ts +2 -0
- package/lib/button/button.d.ts +9 -8
- package/lib/button/index.d.ts +2 -19
- package/lib/calendar/calendar.d.ts +13 -0
- package/lib/calendar/calendar.template.d.ts +4 -0
- package/lib/calendar/helpers/calendar.date-functions.d.ts +2 -0
- package/lib/calendar/helpers/calendar.event-context.d.ts +6 -0
- package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +9 -0
- package/lib/calendar/index.d.ts +2 -0
- 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/card/card.template.d.ts +4 -0
- 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 +23 -5
- 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 +2 -1
- package/lib/elevation/index.d.ts +1 -1
- package/lib/enums.d.ts +14 -7
- 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 -5
- package/lib/layout/index.d.ts +1 -1
- package/lib/layout/layout.d.ts +3 -3
- package/lib/note/index.d.ts +2 -0
- package/lib/note/note.d.ts +10 -0
- package/lib/note/note.template.d.ts +5 -0
- package/lib/popup/index.d.ts +4 -0
- package/lib/popup/popup.d.ts +17 -0
- package/lib/popup/popup.template.d.ts +4 -0
- package/lib/progress/index.d.ts +2 -0
- package/lib/progress/progress.d.ts +9 -0
- package/lib/progress/progress.template.d.ts +5 -0
- package/lib/progress-ring/index.d.ts +2 -0
- package/lib/progress-ring/progress-ring.d.ts +7 -0
- package/lib/progress-ring/progress-ring.template.d.ts +4 -0
- package/lib/side-drawer/index.d.ts +2 -0
- package/lib/side-drawer/side-drawer.d.ts +7 -0
- package/lib/side-drawer/side-drawer.template.d.ts +4 -0
- package/lib/sidenav/index.d.ts +2 -0
- package/lib/sidenav/sidenav.d.ts +3 -0
- package/lib/sidenav/sidenav.template.d.ts +4 -0
- package/lib/sidenav-item/index.d.ts +1 -0
- package/lib/sidenav-item/sidenav-item.d.ts +4 -5
- package/lib/text/index.d.ts +2 -0
- package/lib/text/text.d.ts +10 -0
- package/lib/text/text.template.d.ts +4 -0
- package/lib/text-anchor/text-anchor.d.ts +4 -1
- package/lib/text-field/index.d.ts +4 -0
- package/lib/text-field/text-field.d.ts +23 -0
- package/lib/text-field/text-field.template.d.ts +5 -0
- package/lib/tooltip/index.d.ts +3 -0
- package/lib/tooltip/tooltip.d.ts +8 -0
- package/lib/tooltip/tooltip.template.d.ts +4 -0
- package/note/index.js +68 -0
- package/package.json +39 -6
- package/popup/index.js +2118 -0
- package/progress/index.js +107 -0
- package/progress-ring/index.js +82 -0
- package/shared/_has.js +58 -0
- package/shared/affix.js +10 -25
- package/shared/anchor.js +10 -3
- package/shared/aria-global.js +20 -20
- package/shared/base-progress.js +70 -0
- package/shared/breadcrumb-item.js +2 -2
- package/shared/button.js +195 -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 +69 -0
- package/shared/export.js +972 -0
- package/shared/focus.js +5 -0
- package/shared/focus2.js +11 -0
- package/shared/form-associated.js +548 -0
- package/shared/icon.js +1389 -0
- package/shared/index.js +4940 -1426
- package/shared/index2.js +27 -4901
- package/shared/iterators.js +61 -0
- package/shared/object-keys.js +13 -0
- package/shared/patterns/affix.d.ts +3 -4
- package/shared/patterns/focus.d.ts +3 -0
- package/shared/patterns/index.d.ts +1 -0
- package/shared/slotted.js +119 -0
- package/shared/text-anchor.js +12 -0
- package/shared/text-anchor.template.js +16 -6
- package/shared/to-string.js +51 -0
- package/shared/web.dom-collections.iterator.js +46 -1059
- package/shared/when.js +15 -0
- package/side-drawer/index.js +82 -0
- package/sidenav/index.js +17 -0
- package/sidenav-item/index.js +24 -61
- package/styles/themes/dark.css +16 -4
- package/styles/themes/light.css +16 -4
- package/text/index.js +48 -0
- package/text-anchor/index.js +13 -13
- package/text-field/index.js +411 -0
- package/tooltip/index.js +70 -0
- package/shared/index3.js +0 -21
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { h as html, d as designSystem } from '../shared/index.js';
|
|
2
|
+
import { s as styleInject } from '../shared/style-inject.es.js';
|
|
3
|
+
import { C as CalendarEvent } from '../shared/calendar-event.js';
|
|
4
|
+
import '../shared/es.object.assign.js';
|
|
5
|
+
import { _ as _export, d as descriptors, g as global$1, f as functionUncurryThis, p as hasOwnProperty_1, i as isCallable$1, o as objectDefineProperty, P as copyConstructorProperties$1, b as objectIsPrototypeOf } from '../shared/export.js';
|
|
6
|
+
import { t as toString$1 } from '../shared/to-string.js';
|
|
7
|
+
import { w as when } from '../shared/when.js';
|
|
8
|
+
import { c as classNames } from '../shared/class-names.js';
|
|
9
|
+
import '../shared/object-keys.js';
|
|
10
|
+
|
|
11
|
+
var css_248z = "/*\n Do not edit directly\n Generated on Wed, 27 Apr 2022 11:58:36 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-on-canvas);\n --_connotation-color-on-primary: var(--vvd-color-canvas);\n --_connotation-color-contrast: var(--vvd-color-neutral-90);\n --_connotation-color-soft: var(--vvd-color-neutral-20);\n}\n.base.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta);\n --_connotation-color-on-primary: var(--vvd-color-on-cta);\n --_connotation-color-contrast: var(--vvd-color-cta-90);\n --_connotation-color-soft: var(--vvd-color-cta-20);\n}\n.base.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success);\n --_connotation-color-on-primary: var(--vvd-color-on-success);\n --_connotation-color-contrast: var(--vvd-color-success-90);\n --_connotation-color-soft: var(--vvd-color-success-20);\n}\n.base.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert);\n --_connotation-color-on-primary: var(--vvd-color-on-alert);\n --_connotation-color-contrast: var(--vvd-color-alert-90);\n --_connotation-color-soft: var(--vvd-color-alert-20);\n}\n.base.connotation-warning {\n --_connotation-color-primary: var(--vvd-color-warning);\n --_connotation-color-on-primary: var(--vvd-color-on-warning);\n --_connotation-color-contrast: var(--vvd-color-warning-90);\n --_connotation-color-soft: var(--vvd-color-warning-20);\n}\n.base.connotation-announcement {\n --_connotation-color-primary: var(--vvd-color-announcement);\n --_connotation-color-on-primary: var(--vvd-color-on-announcement);\n --_connotation-color-contrast: var(--vvd-color-announcement-90);\n --_connotation-color-soft: var(--vvd-color-announcement-20);\n}\n.base:not(.connotation-accent, .connotation-cta, .connotation-success, .connotation-alert, .connotation-warning, .connotation-announcement) {\n --_connotation-color-primary: var(--vvd-color-info);\n --_connotation-color-on-primary: var(--vvd-color-on-info);\n --_connotation-color-contrast: var(--vvd-color-info-90);\n --_connotation-color-soft: var(--vvd-color-info-20);\n}\n.base {\n --_appearance-color-text: var(--_connotation-color-on-primary);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transaprent;\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: transaprent;\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 font: 600 ultra-condensed 12px / 16px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n margin: 0;\n}\nh2 > strong {\n font: inherit;\n}\n\np {\n font: 400 ultra-condensed 12px / 16px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n margin: 0;\n}";
|
|
12
|
+
styleInject(css_248z);
|
|
13
|
+
|
|
14
|
+
var $ = _export;
|
|
15
|
+
var DESCRIPTORS = descriptors;
|
|
16
|
+
var global = global$1;
|
|
17
|
+
var uncurryThis = functionUncurryThis;
|
|
18
|
+
var hasOwn = hasOwnProperty_1;
|
|
19
|
+
var isCallable = isCallable$1;
|
|
20
|
+
var isPrototypeOf = objectIsPrototypeOf;
|
|
21
|
+
var toString = toString$1;
|
|
22
|
+
var defineProperty = objectDefineProperty.f;
|
|
23
|
+
var copyConstructorProperties = copyConstructorProperties$1;
|
|
24
|
+
|
|
25
|
+
var NativeSymbol = global.Symbol;
|
|
26
|
+
var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
|
|
27
|
+
|
|
28
|
+
if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||
|
|
29
|
+
// Safari 12 bug
|
|
30
|
+
NativeSymbol().description !== undefined
|
|
31
|
+
)) {
|
|
32
|
+
var EmptyStringDescriptionStore = {};
|
|
33
|
+
// wrap Symbol constructor for correct work with undefined description
|
|
34
|
+
var SymbolWrapper = function Symbol() {
|
|
35
|
+
var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);
|
|
36
|
+
var result = isPrototypeOf(SymbolPrototype, this)
|
|
37
|
+
? new NativeSymbol(description)
|
|
38
|
+
// in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
|
|
39
|
+
: description === undefined ? NativeSymbol() : NativeSymbol(description);
|
|
40
|
+
if (description === '') EmptyStringDescriptionStore[result] = true;
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
copyConstructorProperties(SymbolWrapper, NativeSymbol);
|
|
45
|
+
SymbolWrapper.prototype = SymbolPrototype;
|
|
46
|
+
SymbolPrototype.constructor = SymbolWrapper;
|
|
47
|
+
|
|
48
|
+
var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)';
|
|
49
|
+
var symbolToString = uncurryThis(SymbolPrototype.toString);
|
|
50
|
+
var symbolValueOf = uncurryThis(SymbolPrototype.valueOf);
|
|
51
|
+
var regexp = /^Symbol\((.*)\)[^)]+$/;
|
|
52
|
+
var replace = uncurryThis(''.replace);
|
|
53
|
+
var stringSlice = uncurryThis(''.slice);
|
|
54
|
+
|
|
55
|
+
defineProperty(SymbolPrototype, 'description', {
|
|
56
|
+
configurable: true,
|
|
57
|
+
get: function description() {
|
|
58
|
+
var symbol = symbolValueOf(this);
|
|
59
|
+
var string = symbolToString(symbol);
|
|
60
|
+
if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';
|
|
61
|
+
var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');
|
|
62
|
+
return desc === '' ? undefined : desc;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
$({ global: true, constructor: true, forced: true }, {
|
|
67
|
+
Symbol: SymbolWrapper
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
let _ = t => t,
|
|
72
|
+
_t,
|
|
73
|
+
_t2,
|
|
74
|
+
_t3;
|
|
75
|
+
|
|
76
|
+
const getClasses = ({
|
|
77
|
+
connotation,
|
|
78
|
+
appearance
|
|
79
|
+
}) => classNames('base', [`connotation-${connotation}`, Boolean(connotation)], [`appearance-${appearance}`, Boolean(appearance)]);
|
|
80
|
+
|
|
81
|
+
const getStyles = ({
|
|
82
|
+
start,
|
|
83
|
+
duration,
|
|
84
|
+
overlapCount
|
|
85
|
+
}) => {
|
|
86
|
+
const stylesObj = Object.assign(Object.assign(Object.assign({}, overlapCount && {
|
|
87
|
+
'--vvd-calendar-event--overlap-count': overlapCount
|
|
88
|
+
}), start && {
|
|
89
|
+
'--vvd-calendar-event--start': start
|
|
90
|
+
}), duration && {
|
|
91
|
+
'--vvd-calendar-event--duration': duration
|
|
92
|
+
});
|
|
93
|
+
return Object.entries(stylesObj).map(entry => entry.join(':')).join(';');
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const CalendarEventTemplate = () => html(_t || (_t = _`
|
|
97
|
+
<div
|
|
98
|
+
style="${0}"
|
|
99
|
+
class="${0}"
|
|
100
|
+
role="button"
|
|
101
|
+
tabindex="0"
|
|
102
|
+
>
|
|
103
|
+
${0}
|
|
104
|
+
${0}
|
|
105
|
+
</div>`), getStyles, getClasses, when(x => x.heading, html(_t2 || (_t2 = _`<h2><strong>${0}</strong></h2>`), x => x.heading)), when(x => x.description, html(_t3 || (_t3 = _`<p>${0}</p>`), x => x.description)));
|
|
106
|
+
|
|
107
|
+
const vividCalendarEvent = CalendarEvent.compose({
|
|
108
|
+
baseName: 'calendar-event',
|
|
109
|
+
template: CalendarEventTemplate,
|
|
110
|
+
styles: css_248z,
|
|
111
|
+
shadowOptions: {
|
|
112
|
+
delegatesFocus: true
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
designSystem.register(vividCalendarEvent());
|
|
116
|
+
|
|
117
|
+
export { vividCalendarEvent };
|
package/card/index.js
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import '../shared/index2.js';
|
|
2
|
+
import '../icon/index.js';
|
|
3
|
+
import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, o as observable, h as html, d as designSystem } from '../shared/index.js';
|
|
4
|
+
import { s as styleInject } from '../shared/style-inject.es.js';
|
|
5
|
+
import { s as slotted } from '../shared/slotted.js';
|
|
6
|
+
import { w as when } from '../shared/when.js';
|
|
7
|
+
import { c as classNames } from '../shared/class-names.js';
|
|
8
|
+
import '../shared/icon.js';
|
|
9
|
+
import '../shared/export.js';
|
|
10
|
+
import '../shared/iterators.js';
|
|
11
|
+
import '../shared/to-string.js';
|
|
12
|
+
import '../shared/_has.js';
|
|
13
|
+
|
|
14
|
+
var css_248z = "/*\n Do not edit directly\n Generated on Wed, 27 Apr 2022 11:58:36 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-on-canvas);\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-title, .header-subheading {\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-title {\n font: 500 condensed 20px / 28px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n -webkit-line-clamp: var(--heading-line-clamp);\n}\n.header-subheading {\n font: 400 ultra-condensed 14px / 20px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n -webkit-line-clamp: var(--subheading-line-clamp);\n}\n.hide-header .header {\n display: none;\n}\n\n.header-subheading,\n.text {\n font: 400 ultra-condensed 14px / 20px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n color: var(--vvd-color-neutral-70);\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}";
|
|
15
|
+
styleInject(css_248z);
|
|
16
|
+
|
|
17
|
+
class Card extends FoundationElement {}
|
|
18
|
+
|
|
19
|
+
__decorate([attr, __metadata("design:type", String)], Card.prototype, "heading", void 0);
|
|
20
|
+
|
|
21
|
+
__decorate([attr, __metadata("design:type", String)], Card.prototype, "subheading", void 0);
|
|
22
|
+
|
|
23
|
+
__decorate([attr, __metadata("design:type", String)], Card.prototype, "text", void 0);
|
|
24
|
+
|
|
25
|
+
__decorate([attr, __metadata("design:type", String)], Card.prototype, "icon", void 0);
|
|
26
|
+
|
|
27
|
+
__decorate([attr, __metadata("design:type", Number)], Card.prototype, "elevation", void 0);
|
|
28
|
+
|
|
29
|
+
__decorate([observable, __metadata("design:type", Array)], Card.prototype, "footerSlottedContent", void 0);
|
|
30
|
+
|
|
31
|
+
__decorate([observable, __metadata("design:type", Array)], Card.prototype, "graphicSlottedContent", void 0);
|
|
32
|
+
|
|
33
|
+
__decorate([observable, __metadata("design:type", Array)], Card.prototype, "hasMetaSlottedContent", void 0);
|
|
34
|
+
|
|
35
|
+
let _2 = t => t,
|
|
36
|
+
_t,
|
|
37
|
+
_t2,
|
|
38
|
+
_t3,
|
|
39
|
+
_t4,
|
|
40
|
+
_t5,
|
|
41
|
+
_t6,
|
|
42
|
+
_t7,
|
|
43
|
+
_t8;
|
|
44
|
+
|
|
45
|
+
const getClasses = _ => classNames('base', ['hide-footer', !_.footerSlottedContent || !_.footerSlottedContent.length], ['hide-header', shouldHideHeader(_)]);
|
|
46
|
+
|
|
47
|
+
function renderHeaderIcon() {
|
|
48
|
+
return html(_t || (_t = _2`
|
|
49
|
+
<vwc-icon class="icon" inline type="${0}"></vwc-icon>`), x => x.icon);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function heading() {
|
|
53
|
+
return html(_t2 || (_t2 = _2`
|
|
54
|
+
<div class="header-title">${0}</div>
|
|
55
|
+
`), x => x.heading);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function subheading() {
|
|
59
|
+
return html(_t3 || (_t3 = _2`
|
|
60
|
+
<div class="header-subheading">${0}</div>
|
|
61
|
+
`), x => x.subheading);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function headerContent() {
|
|
65
|
+
return html(_t4 || (_t4 = _2`
|
|
66
|
+
<div class="header-content">
|
|
67
|
+
${0}
|
|
68
|
+
${0}
|
|
69
|
+
</div>
|
|
70
|
+
`), when(x => x.heading, heading()), when(x => x.subheading, subheading()));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function renderHeader() {
|
|
74
|
+
return html(_t5 || (_t5 = _2`
|
|
75
|
+
<header class="header">
|
|
76
|
+
<slot name="graphic" ${0}>${0}</slot>
|
|
77
|
+
${0}
|
|
78
|
+
</header>`), slotted('graphicSlottedContent'), when(x => x.icon, renderHeaderIcon()), when(x => x.heading || x.subheading, headerContent()));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function shouldHideHeader(card) {
|
|
82
|
+
return !card.heading && !card.subheading && !card.icon && (!card.graphicSlottedContent || !card.graphicSlottedContent.length);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function renderMetaSlot() {
|
|
86
|
+
return html(_t6 || (_t6 = _2`
|
|
87
|
+
<slot name="meta" ${0}></slot>
|
|
88
|
+
`), slotted('metaSlottedContent'));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function text() {
|
|
92
|
+
return html(_t7 || (_t7 = _2`
|
|
93
|
+
<div class="text">${0}</div>
|
|
94
|
+
`), x => x.text);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const CardTemplate = () => html(_t8 || (_t8 = _2`
|
|
98
|
+
<vwc-elevation dp=${0}>
|
|
99
|
+
|
|
100
|
+
<div class="${0}">
|
|
101
|
+
<div class="wrapper">
|
|
102
|
+
<div class="vwc-card-media">
|
|
103
|
+
<slot name="media"></slot>
|
|
104
|
+
</div>
|
|
105
|
+
<slot name="main">
|
|
106
|
+
<div class="main-content">
|
|
107
|
+
<div class="header-wrapper">
|
|
108
|
+
${0}
|
|
109
|
+
${0}
|
|
110
|
+
</div>
|
|
111
|
+
${0}
|
|
112
|
+
</div>
|
|
113
|
+
</slot>
|
|
114
|
+
<div class="footer">
|
|
115
|
+
<slot name="footer" ${0}></slot>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
</vwc-elevation>
|
|
121
|
+
`), x => {
|
|
122
|
+
var _a;
|
|
123
|
+
|
|
124
|
+
return (_a = x.elevation) !== null && _a !== void 0 ? _a : '4';
|
|
125
|
+
}, getClasses, renderHeader(), renderMetaSlot(), when(x => x.text, text()), slotted('footerSlottedContent'));
|
|
126
|
+
|
|
127
|
+
const vividCard = Card.compose({
|
|
128
|
+
baseName: 'card',
|
|
129
|
+
template: CardTemplate,
|
|
130
|
+
styles: css_248z
|
|
131
|
+
});
|
|
132
|
+
designSystem.register(vividCard());
|
|
133
|
+
|
|
134
|
+
export { vividCard };
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import '../icon/index.js';
|
|
2
|
+
import '../focus/index.js';
|
|
3
|
+
import { F as FoundationElement, _ as __decorate, a as attr, o as observable, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
|
|
4
|
+
import { s as styleInject } from '../shared/style-inject.es.js';
|
|
5
|
+
import '../shared/web.dom-collections.iterator.js';
|
|
6
|
+
import { C as CheckableFormAssociated, k as keySpace$1 } from '../shared/form-associated.js';
|
|
7
|
+
import { f as focusTemplateFactory } from '../shared/focus2.js';
|
|
8
|
+
import { I as Icon } from '../shared/icon.js';
|
|
9
|
+
import { w as when } from '../shared/when.js';
|
|
10
|
+
import { c as classNames } from '../shared/class-names.js';
|
|
11
|
+
import '../shared/export.js';
|
|
12
|
+
import '../shared/iterators.js';
|
|
13
|
+
import '../shared/to-string.js';
|
|
14
|
+
import '../shared/_has.js';
|
|
15
|
+
import '../shared/focus.js';
|
|
16
|
+
import '../shared/object-keys.js';
|
|
17
|
+
|
|
18
|
+
class _Checkbox extends FoundationElement {
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A form-associated base class for the {@link @microsoft/fast-foundation#(Checkbox:class)} component.
|
|
22
|
+
*
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
class FormAssociatedCheckbox extends CheckableFormAssociated(_Checkbox) {
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
this.proxy = document.createElement("input");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* A Checkbox Custom HTML Element.
|
|
34
|
+
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#checkbox | ARIA checkbox }.
|
|
35
|
+
*
|
|
36
|
+
* @slot checked-indicator - The checked indicator
|
|
37
|
+
* @slot indeterminate-indicator - The indeterminate indicator
|
|
38
|
+
* @slot - The default slot for the label
|
|
39
|
+
* @csspart control - The element representing the visual checkbox control
|
|
40
|
+
* @csspart label - The label
|
|
41
|
+
* @fires change - Emits a custom change event when the checked state changes
|
|
42
|
+
*
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
class Checkbox$1 extends FormAssociatedCheckbox {
|
|
46
|
+
constructor() {
|
|
47
|
+
super();
|
|
48
|
+
/**
|
|
49
|
+
* The element's value to be included in form submission when checked.
|
|
50
|
+
* Default to "on" to reach parity with input[type="checkbox"]
|
|
51
|
+
*
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
this.initialValue = "on";
|
|
55
|
+
/**
|
|
56
|
+
* The indeterminate state of the control
|
|
57
|
+
*/
|
|
58
|
+
this.indeterminate = false;
|
|
59
|
+
/**
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
this.keypressHandler = (e) => {
|
|
63
|
+
switch (e.key) {
|
|
64
|
+
case keySpace$1:
|
|
65
|
+
this.checked = !this.checked;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
72
|
+
this.clickHandler = (e) => {
|
|
73
|
+
if (!this.disabled && !this.readOnly) {
|
|
74
|
+
this.checked = !this.checked;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
this.proxy.setAttribute("type", "checkbox");
|
|
78
|
+
}
|
|
79
|
+
readOnlyChanged() {
|
|
80
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
81
|
+
this.proxy.readOnly = this.readOnly;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
__decorate([
|
|
86
|
+
attr({ attribute: "readonly", mode: "boolean" })
|
|
87
|
+
], Checkbox$1.prototype, "readOnly", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
observable
|
|
90
|
+
], Checkbox$1.prototype, "defaultSlottedNodes", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
observable
|
|
93
|
+
], Checkbox$1.prototype, "indeterminate", void 0);
|
|
94
|
+
|
|
95
|
+
var css_248z = "/*\n Do not edit directly\n Generated on Wed, 27 Apr 2022 11:58:36 GMT\n*/\n.base {\n display: inline-flex;\n align-items: center;\n gap: 12px;\n}\n.base {\n --_connotation-color-primary: var(--vvd-color-on-canvas);\n --_connotation-color-on-primary: var(--vvd-color-canvas);\n}\n.base {\n --_appearance-color-text: var(--vvd-color-on-canvas);\n --_appearance-color-fill: var(--vvd-color-canvas);\n --_appearance-color-outline: var(--vvd-color-neutral-50);\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-on-canvas);\n --_appearance-color-fill: var(--vvd-color-canvas);\n --_appearance-color-outline: var(--vvd-color-on-canvas);\n}\n.base:where(:checked, .checked):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-on-primary);\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-50);\n --_appearance-color-fill: var(--vvd-color-neutral-20);\n --_appearance-color-outline: var(--vvd-color-neutral-50);\n}\n.base:where(:readonly, .readonly):where(:not(:disabled, .disabled, :hover, .hover, :active, .active)) {\n --_appearance-color-text: var(--vvd-color-on-canvas);\n --_appearance-color-fill: var(--vvd-color-neutral-20);\n --_appearance-color-outline: var(--vvd-color-neutral-50);\n}\n.base:where(:indeterminate, .indeterminate):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-on-primary);\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 ((-webkit-user-select: none) or (user-select: none)) {\n .base {\n -webkit-user-select: none;\n user-select: none;\n }\n}\n\n.control {\n position: relative;\n display: inline-flex;\n width: 24px;\n height: 24px;\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 cursor: pointer;\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 font: 400 ultra-condensed 14px / 20px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n color: var(--vvd-color-on-canvas);\n cursor: pointer;\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}";
|
|
96
|
+
styleInject(css_248z);
|
|
97
|
+
|
|
98
|
+
const keySpace = ' ';
|
|
99
|
+
class Checkbox extends Checkbox$1 {
|
|
100
|
+
constructor() {
|
|
101
|
+
super(...arguments);
|
|
102
|
+
|
|
103
|
+
this.keypressHandler = e => {
|
|
104
|
+
switch (e.key) {
|
|
105
|
+
case keySpace:
|
|
106
|
+
if (this.indeterminate) {
|
|
107
|
+
this.indeterminate = false;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
this.checked = !this.checked;
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
this.clickHandler = () => {
|
|
116
|
+
if (!this.disabled && !this.readOnly) {
|
|
117
|
+
if (this.indeterminate) {
|
|
118
|
+
this.indeterminate = false;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
this.checked = !this.checked;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
__decorate([attr, __metadata("design:type", String)], Checkbox.prototype, "label", void 0);
|
|
129
|
+
|
|
130
|
+
let _ = t => t,
|
|
131
|
+
_t,
|
|
132
|
+
_t2;
|
|
133
|
+
|
|
134
|
+
const getClasses = ({
|
|
135
|
+
readOnly,
|
|
136
|
+
checked,
|
|
137
|
+
disabled,
|
|
138
|
+
indeterminate
|
|
139
|
+
}) => classNames('base', ['readonly', Boolean(readOnly)], ['checked', Boolean(checked)], ['disabled', Boolean(disabled)], ['indeterminate', Boolean(indeterminate)]);
|
|
140
|
+
|
|
141
|
+
const CheckboxTemplate = context => {
|
|
142
|
+
const focusTemplate = focusTemplateFactory(context);
|
|
143
|
+
const iconTag = context.tagFor(Icon);
|
|
144
|
+
return html(_t || (_t = _`<span
|
|
145
|
+
role="checkbox"
|
|
146
|
+
aria-checked="${0}"
|
|
147
|
+
aria-required="${0}"
|
|
148
|
+
aria-disabled="${0}"
|
|
149
|
+
aria-readonly="${0}"
|
|
150
|
+
tabindex="${0}"
|
|
151
|
+
@keypress="${0}"
|
|
152
|
+
@click="${0}"
|
|
153
|
+
class="${0}"
|
|
154
|
+
>
|
|
155
|
+
<div class="control">
|
|
156
|
+
<${0} class="indicator checkmark" type="check-solid"></${0}>
|
|
157
|
+
<${0} class="indicator minus" type="minus-solid"></${0}>
|
|
158
|
+
${0}
|
|
159
|
+
</div>
|
|
160
|
+
|
|
161
|
+
${0}
|
|
162
|
+
|
|
163
|
+
</span>`), x => x.checked, x => x.required, x => x.disabled, x => x.readOnly, x => x.disabled ? null : 0, (x, c) => x.keypressHandler(c.event), x => x.clickHandler(), getClasses, iconTag, iconTag, iconTag, iconTag, () => focusTemplate, when(x => x.label, html(_t2 || (_t2 = _`<label>${0}</label>`), x => x.label)));
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const vividCheckbox = Checkbox.compose({
|
|
167
|
+
baseName: 'checkbox',
|
|
168
|
+
template: CheckboxTemplate,
|
|
169
|
+
styles: css_248z,
|
|
170
|
+
shadowOptions: {
|
|
171
|
+
delegatesFocus: true
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
designSystem.register(vividCheckbox());
|
|
175
|
+
|
|
176
|
+
export { vividCheckbox };
|