@vonage/vivid 3.0.0-next.12 → 3.0.0-next.120
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 +170 -4
- package/accordion/index.js +4 -60
- package/accordion-item/index.js +14 -118
- package/action-group/index.js +5 -0
- package/avatar/index.js +11 -0
- package/badge/index.js +9 -53
- package/banner/index.js +20 -210
- package/breadcrumb/index.js +7 -96
- package/breadcrumb-item/index.js +15 -46
- package/button/index.js +19 -751
- package/calendar/index.js +5 -1520
- package/calendar-event/index.js +9 -0
- package/card/index.js +13 -0
- package/checkbox/index.js +16 -0
- package/custom-elements.json +5784 -0
- package/dialog/index.js +24 -0
- package/divider/index.js +6 -0
- package/elevation/index.js +4 -30
- package/fab/index.js +22 -0
- package/focus/index.js +4 -2
- package/header/index.js +58 -0
- package/icon/index.js +8 -36
- package/index.js +65 -26
- package/layout/index.js +4 -52
- package/lib/accordion/definition.d.ts +3 -0
- package/lib/accordion/index.d.ts +1 -2
- package/lib/accordion-item/definition.d.ts +3 -0
- package/lib/accordion-item/index.d.ts +1 -3
- 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/action-group/definition.d.ts +3 -0
- package/lib/action-group/index.d.ts +1 -0
- package/lib/avatar/avatar.d.ts +15 -0
- package/lib/avatar/avatar.template.d.ts +4 -0
- package/lib/avatar/definition.d.ts +3 -0
- package/lib/avatar/index.d.ts +1 -0
- package/lib/badge/badge.d.ts +2 -4
- package/lib/badge/definition.d.ts +3 -0
- package/lib/badge/index.d.ts +1 -3
- package/lib/banner/banner.d.ts +1 -1
- package/lib/banner/banner.template.d.ts +0 -2
- package/lib/banner/definition.d.ts +3 -0
- package/lib/banner/index.d.ts +1 -2
- package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
- package/lib/breadcrumb/definition.d.ts +3 -0
- package/lib/breadcrumb/index.d.ts +1 -2
- package/lib/breadcrumb-item/definition.d.ts +3 -0
- package/lib/breadcrumb-item/index.d.ts +1 -3
- package/lib/button/button.d.ts +3 -2
- package/lib/button/definition.d.ts +3 -0
- package/lib/button/index.d.ts +1 -21
- package/lib/calendar/calendar.d.ts +3 -1
- package/lib/calendar/definition.d.ts +3 -0
- package/lib/calendar/index.d.ts +1 -3
- 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/definition.d.ts +3 -0
- package/lib/calendar-event/index.d.ts +1 -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/definition.d.ts +3 -0
- package/lib/card/index.d.ts +1 -0
- package/lib/checkbox/checkbox.d.ts +5 -0
- package/lib/checkbox/checkbox.template.d.ts +4 -0
- package/lib/checkbox/definition.d.ts +3 -0
- package/lib/checkbox/index.d.ts +1 -0
- package/lib/components.d.ts +38 -16
- package/lib/dialog/definition.d.ts +3 -0
- package/lib/dialog/dialog.d.ts +23 -0
- package/lib/dialog/dialog.template.d.ts +4 -0
- package/lib/dialog/index.d.ts +1 -0
- package/lib/divider/definition.d.ts +3 -0
- package/lib/divider/divider.d.ts +3 -0
- package/lib/divider/divider.template.d.ts +4 -0
- package/lib/divider/index.d.ts +1 -0
- package/lib/elevation/definition.d.ts +3 -0
- package/lib/elevation/elevation.d.ts +1 -0
- package/lib/elevation/index.d.ts +1 -2
- package/lib/enums.d.ts +19 -6
- package/lib/fab/definition.d.ts +3 -0
- package/lib/fab/fab.d.ts +13 -0
- package/lib/fab/fab.template.d.ts +4 -0
- package/lib/fab/index.d.ts +1 -0
- package/lib/focus/definition.d.ts +3 -0
- package/lib/focus/index.d.ts +1 -2
- package/lib/header/definition.d.ts +3 -0
- package/lib/header/header.d.ts +5 -0
- package/lib/header/header.template.d.ts +4 -0
- package/lib/header/index.d.ts +1 -0
- package/lib/icon/definition.d.ts +3 -0
- package/lib/icon/icon.d.ts +5 -6
- package/lib/icon/index.d.ts +1 -2
- package/lib/layout/definition.d.ts +3 -0
- package/lib/layout/index.d.ts +1 -2
- package/lib/layout/layout.d.ts +4 -4
- package/lib/listbox/definition.d.ts +3 -0
- package/lib/listbox/index.d.ts +1 -0
- package/lib/listbox/listbox.d.ts +9 -0
- package/lib/listbox/listbox.template.d.ts +4 -0
- package/lib/menu/definition.d.ts +7 -0
- package/lib/menu/index.d.ts +1 -0
- package/lib/menu/menu.d.ts +10 -0
- package/lib/menu/menu.template.d.ts +3 -0
- package/lib/menu-item/definition.d.ts +3 -0
- package/lib/menu-item/index.d.ts +1 -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/definition.d.ts +3 -0
- package/lib/nav/index.d.ts +1 -0
- package/lib/nav/nav.d.ts +3 -0
- package/lib/nav/nav.template.d.ts +4 -0
- package/lib/nav-disclosure/definition.d.ts +3 -0
- package/lib/nav-disclosure/index.d.ts +1 -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/definition.d.ts +3 -0
- package/lib/nav-item/index.d.ts +1 -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/note/definition.d.ts +3 -0
- package/lib/note/index.d.ts +1 -0
- package/lib/note/note.d.ts +10 -0
- package/lib/note/note.template.d.ts +4 -0
- package/lib/number-field/definition.d.ts +3 -0
- package/lib/number-field/index.d.ts +1 -0
- package/lib/number-field/number-field.d.ts +14 -0
- package/lib/number-field/number-field.template.d.ts +4 -0
- package/lib/option/definition.d.ts +3 -0
- package/lib/option/index.d.ts +1 -0
- package/lib/option/option.d.ts +9 -0
- package/lib/option/option.template.d.ts +4 -0
- package/lib/popup/definition.d.ts +4 -0
- package/lib/popup/index.d.ts +1 -4
- package/lib/popup/popup.d.ts +6 -4
- package/lib/progress/definition.d.ts +3 -0
- package/lib/progress/index.d.ts +1 -2
- package/lib/progress/progress.d.ts +1 -1
- package/lib/progress-ring/definition.d.ts +3 -0
- package/lib/progress-ring/index.d.ts +1 -2
- package/lib/progress-ring/progress-ring.d.ts +2 -1
- package/lib/radio/definition.d.ts +3 -0
- package/lib/radio/index.d.ts +1 -0
- package/lib/radio/radio.d.ts +4 -0
- package/lib/radio/radio.template.d.ts +4 -0
- package/lib/radio-group/definition.d.ts +7 -0
- package/lib/radio-group/index.d.ts +1 -0
- package/lib/radio-group/radio-group.d.ts +4 -0
- package/lib/radio-group/radio-group.template.d.ts +4 -0
- package/lib/side-drawer/definition.d.ts +3 -0
- package/lib/side-drawer/index.d.ts +1 -2
- package/lib/side-drawer/side-drawer.d.ts +3 -2
- package/lib/slider/definition.d.ts +3 -0
- package/lib/slider/index.d.ts +1 -0
- package/lib/slider/slider.d.ts +4 -0
- package/lib/slider/slider.template.d.ts +4 -0
- package/lib/switch/definition.d.ts +3 -0
- package/lib/switch/index.d.ts +1 -0
- package/lib/switch/switch.d.ts +7 -0
- package/lib/switch/switch.template.d.ts +4 -0
- package/lib/text-anchor/definition.d.ts +3 -0
- package/lib/text-anchor/index.d.ts +1 -2
- package/lib/text-area/definition.d.ts +3 -0
- package/lib/text-area/index.d.ts +1 -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/definition.d.ts +3 -0
- package/lib/text-field/index.d.ts +1 -0
- package/lib/text-field/text-field.d.ts +14 -0
- package/lib/text-field/text-field.template.d.ts +4 -0
- package/lib/tooltip/definition.d.ts +3 -0
- package/lib/tooltip/index.d.ts +1 -3
- package/lib/tooltip/tooltip.d.ts +6 -6
- package/listbox/index.js +24 -0
- package/menu/index.js +30 -0
- package/menu-item/index.js +20 -0
- package/nav/index.js +4 -0
- package/nav-disclosure/index.js +17 -0
- package/nav-item/index.js +22 -0
- package/note/index.js +15 -0
- package/number-field/index.js +458 -0
- package/option/index.js +20 -0
- package/package.json +62 -10
- package/popup/index.js +21 -2062
- package/progress/index.js +6 -98
- package/progress-ring/index.js +6 -75
- package/radio/index.js +12 -0
- package/radio-group/index.js +11 -0
- package/shared/affix.js +2 -8
- package/shared/anchor.js +11 -3
- package/shared/apply-mixins.js +5 -4
- package/shared/aria-global.js +2 -86
- package/shared/aria.js +9 -0
- package/shared/base-progress.js +6 -1
- package/shared/breadcrumb-item.js +2 -2
- package/shared/button.js +200 -0
- package/shared/calendar-event.js +19 -0
- package/shared/definition.js +53 -0
- package/shared/definition10.js +99 -0
- package/shared/definition11.js +48 -0
- package/shared/definition12.js +1523 -0
- package/shared/definition13.js +111 -0
- package/shared/definition14.js +114 -0
- package/shared/definition15.js +32 -0
- package/shared/definition16.js +172 -0
- package/shared/definition17.js +223 -0
- package/shared/definition18.js +78 -0
- package/shared/definition19.js +87 -0
- package/shared/definition2.js +106 -0
- package/shared/definition20.js +44 -0
- package/shared/definition21.js +1078 -0
- package/shared/definition22.js +261 -0
- package/shared/definition23.js +348 -0
- package/shared/definition24.js +1529 -0
- package/shared/definition25.js +351 -0
- package/shared/definition26.js +18 -0
- package/shared/definition27.js +75 -0
- package/shared/definition28.js +31 -0
- package/shared/definition29.js +56 -0
- package/shared/definition3.js +29 -0
- package/shared/definition30.js +94 -0
- package/shared/definition31.js +77 -0
- package/shared/definition32.js +45 -0
- package/shared/definition33.js +435 -0
- package/shared/definition34.js +86 -0
- package/shared/definition35.js +592 -0
- package/shared/definition36.js +147 -0
- package/shared/definition37.js +279 -0
- package/shared/definition38.js +119 -0
- package/shared/definition39.js +77 -0
- package/shared/definition4.js +19 -0
- package/shared/definition5.js +38 -0
- package/shared/definition6.js +60 -0
- package/shared/definition7.js +45 -0
- package/shared/definition8.js +113 -0
- package/shared/definition9.js +107 -0
- package/shared/design-system/index.d.ts +1 -2
- package/shared/dialog-polyfill.esm.js +858 -0
- package/shared/direction.js +20 -0
- package/shared/dom.js +8 -0
- package/shared/enums.js +70 -0
- package/shared/es.object.assign.js +2 -3
- package/shared/es.regexp.to-string.js +59 -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 +343 -0
- package/shared/icon.js +538 -567
- package/shared/index.js +1664 -83
- package/shared/key-codes.js +97 -0
- package/shared/numbers.js +25 -0
- package/shared/patterns/affix.d.ts +1 -1
- package/shared/patterns/focus.d.ts +3 -0
- package/shared/patterns/form-elements/form-elements.d.ts +31 -0
- package/shared/patterns/form-elements/index.d.ts +1 -0
- package/shared/patterns/index.d.ts +2 -0
- package/shared/radio.js +127 -0
- package/shared/ref.js +41 -0
- package/shared/slotted.js +1 -1
- package/shared/start-end.js +50 -0
- package/shared/string-trim.js +40 -0
- package/shared/text-anchor.js +0 -2
- package/shared/text-anchor.template.js +6 -5
- package/shared/to-string.js +51 -0
- package/side-drawer/index.js +5 -81
- package/slider/index.js +17 -0
- package/styles/core/all.css +86 -0
- package/styles/core/theme.css +11 -0
- package/styles/core/typography.css +80 -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 +230 -0
- package/styles/tokens/theme-light.css +230 -0
- package/switch/index.js +17 -0
- package/text-anchor/index.js +12 -7
- package/text-area/index.js +22 -0
- package/text-field/index.js +22 -0
- package/tooltip/index.js +18 -55
- package/vivid.api.json +3769 -0
- package/lib/sidenav-item/index.d.ts +0 -3
- package/lib/text/index.d.ts +0 -2
- package/lib/text/text.d.ts +0 -10
- package/shared/index2.js +0 -21
- package/shared/object-set-prototype-of.js +0 -1009
- package/shared/style-inject.es.js +0 -28
- package/shared/web.dom-collections.iterator.js +0 -473
- package/sidenav-item/index.js +0 -39
- package/styles/themes/dark.css +0 -205
- package/styles/themes/light.css +0 -205
- package/text/index.js +0 -46
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { B as _export, e as descriptors, g as global$1, i as functionUncurryThis, x as hasOwnProperty_1, k as isCallable$1, o as objectDefineProperty, a4 as copyConstructorProperties$1, f as objectIsPrototypeOf, h as html, r as registerFactorial } from './index.js';
|
|
2
|
+
import { C as CalendarEvent } from './calendar-event.js';
|
|
3
|
+
import './es.object.assign.js';
|
|
4
|
+
import { t as toString$1 } from './to-string.js';
|
|
5
|
+
import { w as when } from './when.js';
|
|
6
|
+
import { c as classNames } from './class-names.js';
|
|
7
|
+
|
|
8
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 14 Dec 2022 16:38:57 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-300);\n --_connotation-color-primary-text: var(--vvd-color-canvas-text);\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}";
|
|
9
|
+
|
|
10
|
+
var $ = _export;
|
|
11
|
+
var DESCRIPTORS = descriptors;
|
|
12
|
+
var global = global$1;
|
|
13
|
+
var uncurryThis = functionUncurryThis;
|
|
14
|
+
var hasOwn = hasOwnProperty_1;
|
|
15
|
+
var isCallable = isCallable$1;
|
|
16
|
+
var isPrototypeOf = objectIsPrototypeOf;
|
|
17
|
+
var toString = toString$1;
|
|
18
|
+
var defineProperty = objectDefineProperty.f;
|
|
19
|
+
var copyConstructorProperties = copyConstructorProperties$1;
|
|
20
|
+
|
|
21
|
+
var NativeSymbol = global.Symbol;
|
|
22
|
+
var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
|
|
23
|
+
|
|
24
|
+
if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||
|
|
25
|
+
// Safari 12 bug
|
|
26
|
+
NativeSymbol().description !== undefined
|
|
27
|
+
)) {
|
|
28
|
+
var EmptyStringDescriptionStore = {};
|
|
29
|
+
// wrap Symbol constructor for correct work with undefined description
|
|
30
|
+
var SymbolWrapper = function Symbol() {
|
|
31
|
+
var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);
|
|
32
|
+
var result = isPrototypeOf(SymbolPrototype, this)
|
|
33
|
+
? new NativeSymbol(description)
|
|
34
|
+
// in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
|
|
35
|
+
: description === undefined ? NativeSymbol() : NativeSymbol(description);
|
|
36
|
+
if (description === '') EmptyStringDescriptionStore[result] = true;
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
copyConstructorProperties(SymbolWrapper, NativeSymbol);
|
|
41
|
+
SymbolWrapper.prototype = SymbolPrototype;
|
|
42
|
+
SymbolPrototype.constructor = SymbolWrapper;
|
|
43
|
+
|
|
44
|
+
var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)';
|
|
45
|
+
var thisSymbolValue = uncurryThis(SymbolPrototype.valueOf);
|
|
46
|
+
var symbolDescriptiveString = uncurryThis(SymbolPrototype.toString);
|
|
47
|
+
var regexp = /^Symbol\((.*)\)[^)]+$/;
|
|
48
|
+
var replace = uncurryThis(''.replace);
|
|
49
|
+
var stringSlice = uncurryThis(''.slice);
|
|
50
|
+
|
|
51
|
+
defineProperty(SymbolPrototype, 'description', {
|
|
52
|
+
configurable: true,
|
|
53
|
+
get: function description() {
|
|
54
|
+
var symbol = thisSymbolValue(this);
|
|
55
|
+
if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';
|
|
56
|
+
var string = symbolDescriptiveString(symbol);
|
|
57
|
+
var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');
|
|
58
|
+
return desc === '' ? undefined : desc;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
$({ global: true, constructor: true, forced: true }, {
|
|
63
|
+
Symbol: SymbolWrapper
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
let _ = t => t,
|
|
68
|
+
_t,
|
|
69
|
+
_t2,
|
|
70
|
+
_t3;
|
|
71
|
+
const getClasses = ({
|
|
72
|
+
connotation,
|
|
73
|
+
appearance
|
|
74
|
+
}) => classNames('base', [`connotation-${connotation}`, Boolean(connotation)], [`appearance-${appearance}`, Boolean(appearance)]);
|
|
75
|
+
const getStyles = ({
|
|
76
|
+
start,
|
|
77
|
+
duration,
|
|
78
|
+
overlapCount
|
|
79
|
+
}) => {
|
|
80
|
+
const stylesObj = Object.assign(Object.assign(Object.assign({}, overlapCount && {
|
|
81
|
+
'--vvd-calendar-event--overlap-count': overlapCount
|
|
82
|
+
}), start && {
|
|
83
|
+
'--vvd-calendar-event--start': start
|
|
84
|
+
}), duration && {
|
|
85
|
+
'--vvd-calendar-event--duration': duration
|
|
86
|
+
});
|
|
87
|
+
return Object.entries(stylesObj).map(entry => entry.join(':')).join(';');
|
|
88
|
+
};
|
|
89
|
+
const CalendarEventTemplate = () => html(_t || (_t = _`
|
|
90
|
+
<div
|
|
91
|
+
style="${0}"
|
|
92
|
+
class="${0}"
|
|
93
|
+
role="button"
|
|
94
|
+
tabindex="0"
|
|
95
|
+
>
|
|
96
|
+
${0}
|
|
97
|
+
${0}
|
|
98
|
+
</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)));
|
|
99
|
+
|
|
100
|
+
const calendarEvent = CalendarEvent.compose({
|
|
101
|
+
baseName: 'calendar-event',
|
|
102
|
+
template: CalendarEventTemplate,
|
|
103
|
+
styles: css_248z,
|
|
104
|
+
shadowOptions: {
|
|
105
|
+
delegatesFocus: true
|
|
106
|
+
}
|
|
107
|
+
})();
|
|
108
|
+
const calendarEventElements = [calendarEvent];
|
|
109
|
+
const registerCalendarEvent = registerFactorial(calendarEventElements);
|
|
110
|
+
|
|
111
|
+
export { calendarEventElements as a, calendarEvent as c, registerCalendarEvent as r };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, N as observable, h as html, r as registerFactorial } from './index.js';
|
|
2
|
+
import { i as iconElements } from './definition3.js';
|
|
3
|
+
import { E as Elevation, e as elevationElements } from './definition15.js';
|
|
4
|
+
import { I as Icon } from './icon.js';
|
|
5
|
+
import { s as slotted } from './slotted.js';
|
|
6
|
+
import { w as when } from './when.js';
|
|
7
|
+
import { c as classNames } from './class-names.js';
|
|
8
|
+
|
|
9
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 14 Dec 2022 16:38:57 GMT\n */\n:host {\n display: flex;\n}\n\n.base {\n border-radius: 6px;\n inline-size: 100%;\n text-align: start;\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}";
|
|
10
|
+
|
|
11
|
+
class Card extends FoundationElement {}
|
|
12
|
+
__decorate([attr, __metadata("design:type", String)], Card.prototype, "headline", void 0);
|
|
13
|
+
__decorate([attr, __metadata("design:type", String)], Card.prototype, "subtitle", void 0);
|
|
14
|
+
__decorate([attr, __metadata("design:type", String)], Card.prototype, "text", void 0);
|
|
15
|
+
__decorate([attr, __metadata("design:type", String)], Card.prototype, "icon", void 0);
|
|
16
|
+
__decorate([attr, __metadata("design:type", Number)], Card.prototype, "elevation", void 0);
|
|
17
|
+
__decorate([observable, __metadata("design:type", Array)], Card.prototype, "footerSlottedContent", void 0);
|
|
18
|
+
__decorate([observable, __metadata("design:type", Array)], Card.prototype, "graphicSlottedContent", void 0);
|
|
19
|
+
__decorate([observable, __metadata("design:type", Array)], Card.prototype, "hasMetaSlottedContent", void 0);
|
|
20
|
+
|
|
21
|
+
let _2 = t => t,
|
|
22
|
+
_t,
|
|
23
|
+
_t2,
|
|
24
|
+
_t3,
|
|
25
|
+
_t4,
|
|
26
|
+
_t5,
|
|
27
|
+
_t6,
|
|
28
|
+
_t7,
|
|
29
|
+
_t8;
|
|
30
|
+
const getClasses = _ => classNames('base', ['hide-footer', !_.footerSlottedContent || !_.footerSlottedContent.length], ['hide-header', shouldHideHeader(_)]);
|
|
31
|
+
function renderHeaderIcon(iconTag) {
|
|
32
|
+
return html(_t || (_t = _2`
|
|
33
|
+
<${0} class="icon" inline name="${0}"></${0}>`), iconTag, x => x.icon, iconTag);
|
|
34
|
+
}
|
|
35
|
+
function Headline() {
|
|
36
|
+
return html(_t2 || (_t2 = _2`
|
|
37
|
+
<div class="header-headline">${0}</div>
|
|
38
|
+
`), x => x.headline);
|
|
39
|
+
}
|
|
40
|
+
function Subtitle() {
|
|
41
|
+
return html(_t3 || (_t3 = _2`
|
|
42
|
+
<div class="header-subtitle">${0}</div>
|
|
43
|
+
`), x => x.subtitle);
|
|
44
|
+
}
|
|
45
|
+
function headerContent() {
|
|
46
|
+
return html(_t4 || (_t4 = _2`
|
|
47
|
+
<div class="header-content">
|
|
48
|
+
${0}
|
|
49
|
+
${0}
|
|
50
|
+
</div>
|
|
51
|
+
`), when(x => x.headline, Headline()), when(x => x.subtitle, Subtitle()));
|
|
52
|
+
}
|
|
53
|
+
function renderHeader(iconTag) {
|
|
54
|
+
return html(_t5 || (_t5 = _2`
|
|
55
|
+
<header class="header">
|
|
56
|
+
<slot name="graphic" ${0}>${0}</slot>
|
|
57
|
+
${0}
|
|
58
|
+
</header>`), slotted('graphicSlottedContent'), when(x => x.icon, renderHeaderIcon(iconTag)), when(x => x.headline || x.subtitle, headerContent()));
|
|
59
|
+
}
|
|
60
|
+
function shouldHideHeader(card) {
|
|
61
|
+
return !card.headline && !card.subtitle && !card.icon && (!card.graphicSlottedContent || !card.graphicSlottedContent.length);
|
|
62
|
+
}
|
|
63
|
+
function renderMetaSlot() {
|
|
64
|
+
return html(_t6 || (_t6 = _2`
|
|
65
|
+
<slot name="meta" ${0}></slot>
|
|
66
|
+
`), slotted('metaSlottedContent'));
|
|
67
|
+
}
|
|
68
|
+
function text() {
|
|
69
|
+
return html(_t7 || (_t7 = _2`
|
|
70
|
+
<div class="text">${0}</div>
|
|
71
|
+
`), x => x.text);
|
|
72
|
+
}
|
|
73
|
+
const CardTemplate = context => {
|
|
74
|
+
const elevationTag = context.tagFor(Elevation);
|
|
75
|
+
const iconTag = context.tagFor(Icon);
|
|
76
|
+
return html(_t8 || (_t8 = _2`
|
|
77
|
+
<${0} dp=${0}>
|
|
78
|
+
|
|
79
|
+
<div class="${0}">
|
|
80
|
+
<div class="wrapper">
|
|
81
|
+
<div class="vwc-card-media">
|
|
82
|
+
<slot name="media"></slot>
|
|
83
|
+
</div>
|
|
84
|
+
<slot name="main">
|
|
85
|
+
<div class="main-content">
|
|
86
|
+
<div class="header-wrapper">
|
|
87
|
+
${0}
|
|
88
|
+
${0}
|
|
89
|
+
</div>
|
|
90
|
+
${0}
|
|
91
|
+
</div>
|
|
92
|
+
</slot>
|
|
93
|
+
<div class="footer">
|
|
94
|
+
<slot name="footer" ${0}></slot>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
</${0}>
|
|
100
|
+
`), elevationTag, x => {
|
|
101
|
+
var _a;
|
|
102
|
+
return (_a = x.elevation) !== null && _a !== void 0 ? _a : '4';
|
|
103
|
+
}, getClasses, renderHeader(iconTag), renderMetaSlot(), when(x => x.text, text()), slotted('footerSlottedContent'), elevationTag);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const card = Card.compose({
|
|
107
|
+
baseName: 'card',
|
|
108
|
+
template: CardTemplate,
|
|
109
|
+
styles: css_248z
|
|
110
|
+
})();
|
|
111
|
+
const cardElements = [card, ...iconElements, ...elevationElements];
|
|
112
|
+
const registerCard = registerFactorial(cardElements);
|
|
113
|
+
|
|
114
|
+
export { cardElements as a, card as c, registerCard as r };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactorial } from './index.js';
|
|
2
|
+
import { c as classNames } from './class-names.js';
|
|
3
|
+
|
|
4
|
+
class Elevation extends FoundationElement {}
|
|
5
|
+
__decorate([attr, __metadata("design:type", Number)], Elevation.prototype, "dp", void 0);
|
|
6
|
+
__decorate([attr({
|
|
7
|
+
attribute: 'no-shadow',
|
|
8
|
+
mode: 'boolean'
|
|
9
|
+
}), __metadata("design:type", Boolean)], Elevation.prototype, "noShadow", void 0);
|
|
10
|
+
|
|
11
|
+
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}";
|
|
12
|
+
|
|
13
|
+
let _ = t => t,
|
|
14
|
+
_t;
|
|
15
|
+
const getClasses = ({
|
|
16
|
+
dp,
|
|
17
|
+
noShadow
|
|
18
|
+
}) => classNames('control', [`dp-${dp}`, Boolean(dp)], ['no-shadow', Boolean(noShadow)]);
|
|
19
|
+
const elevationTemplate = () => html(_t || (_t = _`
|
|
20
|
+
<div class="${0}" part="base">
|
|
21
|
+
<slot></slot>
|
|
22
|
+
</div>`), getClasses);
|
|
23
|
+
|
|
24
|
+
const elevation = Elevation.compose({
|
|
25
|
+
baseName: 'elevation',
|
|
26
|
+
template: elevationTemplate,
|
|
27
|
+
styles: css_248z
|
|
28
|
+
})();
|
|
29
|
+
const elevationElements = [elevation];
|
|
30
|
+
const registerElevation = registerFactorial(elevationElements);
|
|
31
|
+
|
|
32
|
+
export { Elevation as E, elevation as a, elevationElements as e, registerElevation as r };
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { F as FoundationElement, _ as __decorate, a as attr, N as observable, b as __metadata, h as html, r as registerFactorial } from './index.js';
|
|
2
|
+
import { i as iconElements } from './definition3.js';
|
|
3
|
+
import { f as focusElements } from './definition4.js';
|
|
4
|
+
import { C as CheckableFormAssociated } from './form-associated.js';
|
|
5
|
+
import { a as keySpace$1 } from './key-codes.js';
|
|
6
|
+
import { f as focusTemplateFactory } from './focus2.js';
|
|
7
|
+
import { I as Icon } from './icon.js';
|
|
8
|
+
import { w as when } from './when.js';
|
|
9
|
+
import { c as classNames } from './class-names.js';
|
|
10
|
+
|
|
11
|
+
class _Checkbox extends FoundationElement {
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A form-associated base class for the {@link @microsoft/fast-foundation#(Checkbox:class)} component.
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
class FormAssociatedCheckbox extends CheckableFormAssociated(_Checkbox) {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
this.proxy = document.createElement("input");
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* A Checkbox Custom HTML Element.
|
|
27
|
+
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#checkbox | ARIA checkbox }.
|
|
28
|
+
*
|
|
29
|
+
* @slot checked-indicator - The checked indicator
|
|
30
|
+
* @slot indeterminate-indicator - The indeterminate indicator
|
|
31
|
+
* @slot - The default slot for the label
|
|
32
|
+
* @csspart control - The element representing the visual checkbox control
|
|
33
|
+
* @csspart label - The label
|
|
34
|
+
* @fires change - Emits a custom change event when the checked state changes
|
|
35
|
+
*
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
class Checkbox$1 extends FormAssociatedCheckbox {
|
|
39
|
+
constructor() {
|
|
40
|
+
super();
|
|
41
|
+
/**
|
|
42
|
+
* The element's value to be included in form submission when checked.
|
|
43
|
+
* Default to "on" to reach parity with input[type="checkbox"]
|
|
44
|
+
*
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
this.initialValue = "on";
|
|
48
|
+
/**
|
|
49
|
+
* The indeterminate state of the control
|
|
50
|
+
*/
|
|
51
|
+
this.indeterminate = false;
|
|
52
|
+
/**
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
this.keypressHandler = (e) => {
|
|
56
|
+
if (this.readOnly) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
switch (e.key) {
|
|
60
|
+
case keySpace$1:
|
|
61
|
+
if (this.indeterminate) {
|
|
62
|
+
this.indeterminate = false;
|
|
63
|
+
}
|
|
64
|
+
this.checked = !this.checked;
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
this.clickHandler = (e) => {
|
|
72
|
+
if (!this.disabled && !this.readOnly) {
|
|
73
|
+
if (this.indeterminate) {
|
|
74
|
+
this.indeterminate = false;
|
|
75
|
+
}
|
|
76
|
+
this.checked = !this.checked;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
this.proxy.setAttribute("type", "checkbox");
|
|
80
|
+
}
|
|
81
|
+
readOnlyChanged() {
|
|
82
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
83
|
+
this.proxy.readOnly = this.readOnly;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
__decorate([
|
|
88
|
+
attr({ attribute: "readonly", mode: "boolean" })
|
|
89
|
+
], Checkbox$1.prototype, "readOnly", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
observable
|
|
92
|
+
], Checkbox$1.prototype, "defaultSlottedNodes", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
observable
|
|
95
|
+
], Checkbox$1.prototype, "indeterminate", void 0);
|
|
96
|
+
|
|
97
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 14 Dec 2022 16:38:57 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 --_connotation-color-primary-increment: var(--vvd-color-neutral-800);\n --_connotation-color-intermediate: var(--vvd-color-neutral-500);\n --_connotation-color-backdrop: var(--vvd-color-canvas);\n --_connotation-color-firm: var(--vvd-color-canvas-text);\n}\n.base {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-intermediate);\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-firm);\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(:checked, .checked):where(:hover, .hover) {\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.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.base:where(.readonly):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-neutral-800);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\n --_appearance-color-outline: var(--vvd-color-neutral-500);\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}";
|
|
98
|
+
|
|
99
|
+
const keySpace = ' ';
|
|
100
|
+
class Checkbox extends Checkbox$1 {
|
|
101
|
+
constructor() {
|
|
102
|
+
super(...arguments);
|
|
103
|
+
this.keypressHandler = e => {
|
|
104
|
+
switch (e.key) {
|
|
105
|
+
case keySpace:
|
|
106
|
+
if (this.indeterminate) {
|
|
107
|
+
this.indeterminate = false;
|
|
108
|
+
}
|
|
109
|
+
this.checked = !this.checked;
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
this.clickHandler = () => {
|
|
114
|
+
if (!this.disabled && !this.readOnly) {
|
|
115
|
+
if (this.indeterminate) {
|
|
116
|
+
this.indeterminate = false;
|
|
117
|
+
}
|
|
118
|
+
this.checked = !this.checked;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
__decorate([attr, __metadata("design:type", String)], Checkbox.prototype, "label", void 0);
|
|
124
|
+
|
|
125
|
+
let _ = t => t,
|
|
126
|
+
_t,
|
|
127
|
+
_t2,
|
|
128
|
+
_t3,
|
|
129
|
+
_t4;
|
|
130
|
+
const getClasses = ({
|
|
131
|
+
readOnly,
|
|
132
|
+
checked,
|
|
133
|
+
disabled,
|
|
134
|
+
indeterminate
|
|
135
|
+
}) => classNames('base', ['readonly', Boolean(readOnly)], ['checked', Boolean(checked) || Boolean(indeterminate)], ['disabled', Boolean(disabled)]);
|
|
136
|
+
const CheckboxTemplate = context => {
|
|
137
|
+
const focusTemplate = focusTemplateFactory(context);
|
|
138
|
+
const iconTag = context.tagFor(Icon);
|
|
139
|
+
return html(_t || (_t = _`<span
|
|
140
|
+
role="checkbox"
|
|
141
|
+
aria-checked="${0}"
|
|
142
|
+
aria-required="${0}"
|
|
143
|
+
aria-disabled="${0}"
|
|
144
|
+
aria-readonly="${0}"
|
|
145
|
+
tabindex="${0}"
|
|
146
|
+
@keypress="${0}"
|
|
147
|
+
@click="${0}"
|
|
148
|
+
class="${0}"
|
|
149
|
+
>
|
|
150
|
+
<div class="control">
|
|
151
|
+
${0}
|
|
152
|
+
${0}
|
|
153
|
+
${0}
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
${0}
|
|
157
|
+
|
|
158
|
+
</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, when(x => x.checked, html(_t2 || (_t2 = _`<${0} name="check-solid"></${0}>`), iconTag, iconTag)), when(x => x.indeterminate, html(_t3 || (_t3 = _`<${0} name="minus-solid"></${0}>`), iconTag, iconTag)), () => focusTemplate, when(x => x.label, html(_t4 || (_t4 = _`<label>${0}</label>`), x => x.label)));
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const checkbox = Checkbox.compose({
|
|
162
|
+
baseName: 'checkbox',
|
|
163
|
+
template: CheckboxTemplate,
|
|
164
|
+
styles: css_248z,
|
|
165
|
+
shadowOptions: {
|
|
166
|
+
delegatesFocus: true
|
|
167
|
+
}
|
|
168
|
+
})();
|
|
169
|
+
const checkboxElements = [checkbox, ...iconElements, ...focusElements];
|
|
170
|
+
const registerCheckbox = registerFactorial(checkboxElements);
|
|
171
|
+
|
|
172
|
+
export { checkboxElements as a, checkbox as c, registerCheckbox as r };
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { F as FoundationElement, Q as __classPrivateFieldGet, _ as __decorate, a as attr, b as __metadata, a5 as __classPrivateFieldSet, h as html, r as registerFactorial } from './index.js';
|
|
2
|
+
import { i as iconElements } from './definition3.js';
|
|
3
|
+
import { B as Button, b as buttonElements } from './definition9.js';
|
|
4
|
+
import { E as Elevation, e as elevationElements } from './definition15.js';
|
|
5
|
+
import { I as Icon } from './icon.js';
|
|
6
|
+
import { w as when } from './when.js';
|
|
7
|
+
import { c as classNames } from './class-names.js';
|
|
8
|
+
|
|
9
|
+
var css_248z$1 = "dialog {\n position: absolute;\n left: 0; right: 0;\n width: -moz-fit-content;\n width: -webkit-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: -webkit-fit-content;\n height: fit-content;\n margin: auto;\n border: solid;\n padding: 1em;\n background: white;\n color: black;\n display: block;\n}\n\ndialog:not([open]) {\n display: none;\n}\n\ndialog + .backdrop {\n position: fixed;\n top: 0; right: 0; bottom: 0; left: 0;\n background: rgba(0,0,0,0.1);\n}\n\n._dialog_overlay {\n position: fixed;\n top: 0; right: 0; bottom: 0; left: 0;\n}\n\ndialog.fixed {\n position: fixed;\n top: 50%;\n transform: translate(0, -50%);\n}";
|
|
10
|
+
|
|
11
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 14 Dec 2022 16:38:57 GMT\n */\n.base {\n box-sizing: border-box;\n padding: 0;\n border: none;\n background: var(--_elevation-fill);\n border-radius: 6px;\n color: var(--vvd-color-canvas-text);\n max-block-size: var(--dialog-max-block-size, calc(100vh - 64px));\n max-inline-size: var(--dialog-max-inline-size);\n min-inline-size: var(--dialog-min-inline-size, 280px);\n overflow-x: hidden;\n overflow-y: auto;\n}\n@media not all and (min-width: 600px) {\n .base {\n --dialog-max-inline-size: 90vw;\n }\n}\n@media (min-width: 600px) {\n .base {\n --dialog-max-inline-size: 560px;\n }\n}\n.base:not(.modal) {\n z-index: var(--dialog-z-index, 1);\n}\n\n.main-wrapper {\n display: flex;\n flex-direction: column;\n padding: 24px;\n gap: 8px;\n}\n\n.header {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: 4px;\n inline-size: 100%;\n}\n\n.dismiss-button {\n flex-shrink: 0;\n margin-top: -8px;\n margin-right: -8px;\n}\n\n.headline {\n font: var(--vvd-typography-heading-4);\n}\n.headline-wrapper {\n display: flex;\n align-items: flex-start;\n}\n.base:not(.icon-placement-side) .headline-wrapper {\n flex-direction: column;\n row-gap: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n}\n.base:not(.icon-placement-side) .headline-wrapper .icon {\n font-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8));\n}\n.base.icon-placement-side .headline-wrapper {\n column-gap: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8)) - calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16)));\n}\n.base.icon-placement-side .headline-wrapper .icon {\n font-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 12));\n}\n\n.content {\n font: var(--vvd-typography-base);\n}";
|
|
12
|
+
|
|
13
|
+
var _Dialog_instances, _Dialog_modal, _Dialog_dialogElement, _Dialog_dialog_get, _Dialog_handleScrimClick, _Dialog_handleInternalFormSubmit, _Dialog_handleModal;
|
|
14
|
+
let dialogPolyfill;
|
|
15
|
+
(async () => {
|
|
16
|
+
if (!HTMLDialogElement || !HTMLDialogElement.prototype.showModal) {
|
|
17
|
+
delete window.HTMLDialogElement;
|
|
18
|
+
dialogPolyfill = await import('./dialog-polyfill.esm.js');
|
|
19
|
+
}
|
|
20
|
+
})();
|
|
21
|
+
class Dialog extends FoundationElement {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
_Dialog_instances.add(this);
|
|
25
|
+
this.open = false;
|
|
26
|
+
this.ariaLabelledBy = null;
|
|
27
|
+
this.ariaLabel = null;
|
|
28
|
+
this.ariaDescribedBy = null;
|
|
29
|
+
_Dialog_modal.set(this, false);
|
|
30
|
+
_Dialog_dialogElement.set(this, void 0);
|
|
31
|
+
_Dialog_handleScrimClick.set(this, event => {
|
|
32
|
+
if (event.target !== __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get)) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const rect = __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).getBoundingClientRect();
|
|
36
|
+
const clickedInDialog = rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width;
|
|
37
|
+
this.open = clickedInDialog;
|
|
38
|
+
});
|
|
39
|
+
_Dialog_handleInternalFormSubmit.set(this, event => {
|
|
40
|
+
if (event.target.method !== 'dialog') {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this.open = false;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
set returnValue(value) {
|
|
47
|
+
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).returnValue = value;
|
|
48
|
+
}
|
|
49
|
+
get returnValue() {
|
|
50
|
+
var _a;
|
|
51
|
+
return (_a = __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get)) === null || _a === void 0 ? void 0 : _a.returnValue;
|
|
52
|
+
}
|
|
53
|
+
get modal() {
|
|
54
|
+
return __classPrivateFieldGet(this, _Dialog_modal, "f");
|
|
55
|
+
}
|
|
56
|
+
openChanged(oldValue, newValue) {
|
|
57
|
+
if (oldValue === undefined) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (!newValue) {
|
|
61
|
+
this.close();
|
|
62
|
+
} else {
|
|
63
|
+
if (__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get)) {
|
|
64
|
+
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).open = true;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
close() {
|
|
69
|
+
if (__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).open) {
|
|
70
|
+
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).close();
|
|
71
|
+
this.dispatchEvent(new CustomEvent('close', {
|
|
72
|
+
bubbles: true,
|
|
73
|
+
composed: true,
|
|
74
|
+
detail: this.returnValue
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
this.open = false;
|
|
78
|
+
__classPrivateFieldGet(this, _Dialog_instances, "m", _Dialog_handleModal).call(this, false);
|
|
79
|
+
}
|
|
80
|
+
show() {
|
|
81
|
+
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).show();
|
|
82
|
+
this.open = true;
|
|
83
|
+
}
|
|
84
|
+
showModal() {
|
|
85
|
+
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).showModal();
|
|
86
|
+
this.open = true;
|
|
87
|
+
__classPrivateFieldGet(this, _Dialog_instances, "m", _Dialog_handleModal).call(this, true);
|
|
88
|
+
}
|
|
89
|
+
connectedCallback() {
|
|
90
|
+
super.connectedCallback();
|
|
91
|
+
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).addEventListener('click', __classPrivateFieldGet(this, _Dialog_handleScrimClick, "f"));
|
|
92
|
+
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).addEventListener('submit', __classPrivateFieldGet(this, _Dialog_handleInternalFormSubmit, "f"));
|
|
93
|
+
}
|
|
94
|
+
disconnectedCallback() {
|
|
95
|
+
super.disconnectedCallback();
|
|
96
|
+
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).removeEventListener('click', __classPrivateFieldGet(this, _Dialog_handleScrimClick, "f"));
|
|
97
|
+
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).removeEventListener('submit', __classPrivateFieldGet(this, _Dialog_handleInternalFormSubmit, "f"));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
_Dialog_modal = new WeakMap(), _Dialog_dialogElement = new WeakMap(), _Dialog_handleScrimClick = new WeakMap(), _Dialog_handleInternalFormSubmit = new WeakMap(), _Dialog_instances = new WeakSet(), _Dialog_dialog_get = function _Dialog_dialog_get() {
|
|
101
|
+
if (!__classPrivateFieldGet(this, _Dialog_dialogElement, "f")) {
|
|
102
|
+
__classPrivateFieldSet(this, _Dialog_dialogElement, this.shadowRoot.querySelector('dialog'), "f");
|
|
103
|
+
if (__classPrivateFieldGet(this, _Dialog_dialogElement, "f")) {
|
|
104
|
+
__classPrivateFieldGet(this, _Dialog_dialogElement, "f").open = this.open;
|
|
105
|
+
if (dialogPolyfill) {
|
|
106
|
+
dialogPolyfill.registerDialog(__classPrivateFieldGet(this, _Dialog_dialogElement, "f"));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return __classPrivateFieldGet(this, _Dialog_dialogElement, "f");
|
|
111
|
+
}, _Dialog_handleModal = function _Dialog_handleModal(show) {
|
|
112
|
+
__classPrivateFieldSet(this, _Dialog_modal, show, "f");
|
|
113
|
+
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).toggleAttribute('aria-modal', show);
|
|
114
|
+
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).classList.toggle('modal', show);
|
|
115
|
+
};
|
|
116
|
+
__decorate([attr({
|
|
117
|
+
mode: 'boolean'
|
|
118
|
+
}), __metadata("design:type", Object)], Dialog.prototype, "open", void 0);
|
|
119
|
+
__decorate([attr, __metadata("design:type", String)], Dialog.prototype, "icon", void 0);
|
|
120
|
+
__decorate([attr({
|
|
121
|
+
attribute: 'icon-placement'
|
|
122
|
+
}), __metadata("design:type", String)], Dialog.prototype, "iconPlacement", void 0);
|
|
123
|
+
__decorate([attr, __metadata("design:type", String)], Dialog.prototype, "text", void 0);
|
|
124
|
+
__decorate([attr, __metadata("design:type", String)], Dialog.prototype, "headline", void 0);
|
|
125
|
+
__decorate([attr({
|
|
126
|
+
attribute: 'aria-labelledby'
|
|
127
|
+
}), __metadata("design:type", Object)], Dialog.prototype, "ariaLabelledBy", void 0);
|
|
128
|
+
__decorate([attr({
|
|
129
|
+
attribute: 'aria-label'
|
|
130
|
+
}), __metadata("design:type", Object)], Dialog.prototype, "ariaLabel", void 0);
|
|
131
|
+
__decorate([attr({
|
|
132
|
+
attribute: 'aria-describedby'
|
|
133
|
+
}), __metadata("design:type", Object)], Dialog.prototype, "ariaDescribedBy", void 0);
|
|
134
|
+
|
|
135
|
+
let _ = t => t,
|
|
136
|
+
_t,
|
|
137
|
+
_t2,
|
|
138
|
+
_t3,
|
|
139
|
+
_t4,
|
|
140
|
+
_t5;
|
|
141
|
+
const getClasses = ({
|
|
142
|
+
iconPlacement
|
|
143
|
+
}) => classNames('base', [`icon-placement-${iconPlacement}`, Boolean(iconPlacement)]);
|
|
144
|
+
function icon(iconTag) {
|
|
145
|
+
return html(_t || (_t = _`
|
|
146
|
+
<${0} class="icon" name="${0}"></${0}>
|
|
147
|
+
`), iconTag, x => x.icon, iconTag);
|
|
148
|
+
}
|
|
149
|
+
function headline() {
|
|
150
|
+
return html(_t2 || (_t2 = _`
|
|
151
|
+
<div class="headline">
|
|
152
|
+
${0}
|
|
153
|
+
</div>
|
|
154
|
+
`), x => x.headline);
|
|
155
|
+
}
|
|
156
|
+
function renderDismissButton(buttonTag) {
|
|
157
|
+
return html(_t3 || (_t3 = _`
|
|
158
|
+
<${0}
|
|
159
|
+
size="condensed"
|
|
160
|
+
class="dismiss-button"
|
|
161
|
+
icon="close-line"
|
|
162
|
+
@click="${0}">
|
|
163
|
+
</${0}>`), buttonTag, x => {
|
|
164
|
+
x.open = false;
|
|
165
|
+
}, buttonTag);
|
|
166
|
+
}
|
|
167
|
+
function handleEscapeKey(dialog, event) {
|
|
168
|
+
if (event.key === 'Escape' && dialog.modal) {
|
|
169
|
+
dialog.open = false;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
function content() {
|
|
173
|
+
return html(_t4 || (_t4 = _`
|
|
174
|
+
<div class="content">
|
|
175
|
+
${0}
|
|
176
|
+
</div>
|
|
177
|
+
`), x => x.text);
|
|
178
|
+
}
|
|
179
|
+
const DialogTemplate = context => {
|
|
180
|
+
const elevationTag = context.tagFor(Elevation);
|
|
181
|
+
const iconTag = context.tagFor(Icon);
|
|
182
|
+
const buttonTag = context.tagFor(Button);
|
|
183
|
+
return html(_t5 || (_t5 = _`
|
|
184
|
+
<${0} dp="12">
|
|
185
|
+
<div>
|
|
186
|
+
<dialog class="${0}"
|
|
187
|
+
@keydown="${0}"
|
|
188
|
+
returnValue="${0}"
|
|
189
|
+
aria-labelledby="${0}"
|
|
190
|
+
aria-label="${0}"
|
|
191
|
+
aria-describedby="${0}"
|
|
192
|
+
>
|
|
193
|
+
<slot name="main">
|
|
194
|
+
<div class="main-wrapper">
|
|
195
|
+
<div class="header">
|
|
196
|
+
<div class="headline-wrapper">
|
|
197
|
+
<slot name="graphic">
|
|
198
|
+
${0}
|
|
199
|
+
</slot>
|
|
200
|
+
${0}
|
|
201
|
+
</div>
|
|
202
|
+
${0}
|
|
203
|
+
</div>
|
|
204
|
+
<slot name="content">
|
|
205
|
+
${0}
|
|
206
|
+
</slot>
|
|
207
|
+
<slot name="footer"></slot>
|
|
208
|
+
</div>
|
|
209
|
+
</slot>
|
|
210
|
+
</dialog>
|
|
211
|
+
</div>
|
|
212
|
+
</${0}>`), elevationTag, getClasses, (x, c) => handleEscapeKey(x, c.event), x => x.returnValue, x => x.ariaLabelledBy, x => x.ariaLabel, x => x.ariaDescribedBy, when(x => x.icon, icon(iconTag)), when(x => x.headline, headline()), renderDismissButton(buttonTag), when(x => x.text, content()), elevationTag);
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const dialog = Dialog.compose({
|
|
216
|
+
baseName: 'dialog',
|
|
217
|
+
template: DialogTemplate,
|
|
218
|
+
styles: [css_248z, css_248z$1]
|
|
219
|
+
})();
|
|
220
|
+
const dialogElements = [dialog, ...iconElements, ...buttonElements, ...elevationElements];
|
|
221
|
+
const registerDialog = registerFactorial(dialogElements);
|
|
222
|
+
|
|
223
|
+
export { dialogElements as a, dialog as d, registerDialog as r };
|