@vonage/vivid 3.0.0-next.9 → 3.0.0-next.91
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 +3 -12
- package/accordion-item/index.js +30 -38
- package/action-group/index.js +41 -0
- package/avatar/index.js +60 -0
- package/badge/index.js +16 -30
- package/banner/index.js +25 -111
- package/breadcrumb/index.js +21 -18
- package/breadcrumb-item/index.js +23 -20
- package/button/index.js +19 -757
- package/calendar/index.js +72 -67
- package/calendar-event/index.js +112 -0
- package/card/index.js +113 -0
- package/checkbox/index.js +176 -0
- package/dialog/index.js +229 -0
- package/divider/index.js +4 -0
- package/elevation/index.js +3 -31
- package/fab/index.js +99 -0
- package/focus/index.js +18 -3
- package/header/index.js +61 -0
- package/icon/index.js +10 -9
- package/index.js +57 -20
- package/layout/index.js +5 -15
- 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 +3 -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 +29 -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/listbox-option/index.d.ts +4 -0
- package/lib/listbox-option/listbox-option.d.ts +7 -0
- package/lib/listbox-option/listbox-option.template.d.ts +4 -0
- package/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 +14 -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/radio-group/index.d.ts +10 -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/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 +4 -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 +14 -0
- package/lib/text-field/text-field.template.d.ts +5 -0
- package/lib/tooltip/tooltip.d.ts +2 -2
- package/listbox-option/index.js +248 -0
- package/menu/index.js +376 -0
- package/menu-item/index.js +20 -0
- package/nav/index.js +17 -0
- package/nav-disclosure/index.js +81 -0
- package/nav-item/index.js +45 -0
- package/note/index.js +58 -0
- package/number-field/index.js +516 -0
- package/package.json +58 -10
- package/popup/index.js +22 -2061
- package/progress/index.js +35 -36
- package/progress-ring/index.js +11 -11
- package/radio/index.js +50 -0
- package/radio-group/index.js +435 -0
- package/shared/affix.js +1 -6
- package/shared/anchor.js +10 -2
- 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 +5 -0
- package/shared/breadcrumb-item.js +1 -1
- package/shared/button.js +200 -0
- package/shared/calendar-event.js +19 -0
- package/shared/dialog-polyfill.esm.js +858 -0
- package/shared/direction.js +20 -0
- package/shared/enums.js +62 -0
- package/shared/es.object.assign.js +3 -2
- package/shared/export.js +1017 -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 +331 -0
- package/shared/icon.js +534 -531
- package/shared/index.js +108 -79
- package/shared/index2.js +100 -14
- package/shared/index3.js +31 -0
- package/shared/index4.js +77 -0
- package/shared/index5.js +1525 -0
- package/shared/index6.js +349 -0
- package/shared/iterators.js +61 -0
- package/shared/key-codes.js +96 -0
- package/shared/object-keys.js +13 -0
- package/shared/patterns/focus.d.ts +3 -0
- package/shared/patterns/form-elements/form-elements.d.ts +28 -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/text-anchor.js +2 -13
- package/shared/text-anchor.template.js +6 -5
- package/shared/to-string.js +51 -0
- package/shared/web.dom-collections.iterator.js +74 -1081
- package/side-drawer/index.js +41 -33
- 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 +230 -0
- package/styles/tokens/theme-light.css +230 -0
- package/text-anchor/index.js +9 -1
- package/text-area/index.js +288 -0
- package/text-field/index.js +129 -0
- package/tooltip/index.js +23 -24
- 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
|
@@ -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 '../shared/web.dom-collections.iterator.js';
|
|
5
|
+
import { C as CheckableFormAssociated } from '../shared/form-associated.js';
|
|
6
|
+
import { a as keySpace$1 } from '../shared/key-codes.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
|
+
if (this.readOnly) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
switch (e.key) {
|
|
67
|
+
case keySpace$1:
|
|
68
|
+
if (this.indeterminate) {
|
|
69
|
+
this.indeterminate = false;
|
|
70
|
+
}
|
|
71
|
+
this.checked = !this.checked;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* @internal
|
|
77
|
+
*/
|
|
78
|
+
this.clickHandler = (e) => {
|
|
79
|
+
if (!this.disabled && !this.readOnly) {
|
|
80
|
+
if (this.indeterminate) {
|
|
81
|
+
this.indeterminate = false;
|
|
82
|
+
}
|
|
83
|
+
this.checked = !this.checked;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
this.proxy.setAttribute("type", "checkbox");
|
|
87
|
+
}
|
|
88
|
+
readOnlyChanged() {
|
|
89
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
90
|
+
this.proxy.readOnly = this.readOnly;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
__decorate([
|
|
95
|
+
attr({ attribute: "readonly", mode: "boolean" })
|
|
96
|
+
], Checkbox$1.prototype, "readOnly", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
observable
|
|
99
|
+
], Checkbox$1.prototype, "defaultSlottedNodes", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
observable
|
|
102
|
+
], Checkbox$1.prototype, "indeterminate", void 0);
|
|
103
|
+
|
|
104
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 03 Nov 2022 17:26:06 GMT\n */\n.base {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n vertical-align: middle;\n}\n.base {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n}\n.base {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-canvas);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-canvas);\n --_appearance-color-outline: var(--vvd-color-canvas-text);\n}\n.base:where(:checked, .checked):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: var(--_connotation-color-primary);\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: var(--vvd-color-neutral-100);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.base:where(:readonly, .readonly):where(:not(:disabled, .disabled, :hover, .hover, :active, .active)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-neutral-100);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.base:where(:indeterminate, .indeterminate):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: var(--_connotation-color-primary);\n}\n@supports selector(:focus-visible) {\n .base:focus {\n outline: none;\n }\n}\n@supports (user-select: none) {\n .base {\n user-select: none;\n }\n}\n.base:not(.disabled) {\n cursor: pointer;\n}\n.base.disabled {\n cursor: not-allowed;\n}\n\n.control {\n position: relative;\n display: flex;\n width: 20px;\n height: 20px;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n background-color: var(--_appearance-color-fill);\n border-radius: 3px;\n box-shadow: inset 0 0 0 2px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n}\n\n.indicator {\n font-size: 16px;\n}\n.base:not(.checked) .indicator.checkmark {\n display: none;\n}\n\n.base:not(.indeterminate) .indicator.minus, .base.checked .indicator.minus {\n display: none;\n}\n\nlabel {\n color: var(--vvd-color-canvas-text);\n cursor: pointer;\n font: var(--vvd-typography-base);\n}\n\n.focus-indicator {\n --focus-inset: -3px;\n --focus-stroke-gap-color: transparent;\n border-radius: 6px;\n}\n.base:not(:focus-visible) .focus-indicator {\n display: none;\n}";
|
|
105
|
+
|
|
106
|
+
const keySpace = ' ';
|
|
107
|
+
class Checkbox extends Checkbox$1 {
|
|
108
|
+
constructor() {
|
|
109
|
+
super(...arguments);
|
|
110
|
+
this.keypressHandler = e => {
|
|
111
|
+
switch (e.key) {
|
|
112
|
+
case keySpace:
|
|
113
|
+
if (this.indeterminate) {
|
|
114
|
+
this.indeterminate = false;
|
|
115
|
+
}
|
|
116
|
+
this.checked = !this.checked;
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
this.clickHandler = () => {
|
|
121
|
+
if (!this.disabled && !this.readOnly) {
|
|
122
|
+
if (this.indeterminate) {
|
|
123
|
+
this.indeterminate = false;
|
|
124
|
+
}
|
|
125
|
+
this.checked = !this.checked;
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
__decorate([attr, __metadata("design:type", String)], Checkbox.prototype, "label", void 0);
|
|
131
|
+
|
|
132
|
+
let _ = t => t,
|
|
133
|
+
_t,
|
|
134
|
+
_t2;
|
|
135
|
+
const getClasses = ({
|
|
136
|
+
readOnly,
|
|
137
|
+
checked,
|
|
138
|
+
disabled,
|
|
139
|
+
indeterminate
|
|
140
|
+
}) => classNames('base', ['readonly', Boolean(readOnly)], ['checked', Boolean(checked)], ['disabled', Boolean(disabled)], ['indeterminate', Boolean(indeterminate)]);
|
|
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 };
|
package/dialog/index.js
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import '../icon/index.js';
|
|
2
|
+
import '../shared/index2.js';
|
|
3
|
+
import '../shared/index3.js';
|
|
4
|
+
import { F as FoundationElement, c as __classPrivateFieldGet, _ as __decorate, a as attr, b as __metadata, j as __classPrivateFieldSet, h as html, d as designSystem } from '../shared/index.js';
|
|
5
|
+
import '../shared/icon.js';
|
|
6
|
+
import '../shared/web.dom-collections.iterator.js';
|
|
7
|
+
import { w as when } from '../shared/when.js';
|
|
8
|
+
import { c as classNames } from '../shared/class-names.js';
|
|
9
|
+
import '../shared/export.js';
|
|
10
|
+
import '../shared/iterators.js';
|
|
11
|
+
import '../shared/to-string.js';
|
|
12
|
+
import '../shared/_has.js';
|
|
13
|
+
import '../focus/index.js';
|
|
14
|
+
import '../shared/focus.js';
|
|
15
|
+
import '../shared/affix.js';
|
|
16
|
+
import '../shared/button.js';
|
|
17
|
+
import '../shared/apply-mixins.js';
|
|
18
|
+
import '../shared/form-associated.js';
|
|
19
|
+
import '../shared/key-codes.js';
|
|
20
|
+
import '../shared/aria-global.js';
|
|
21
|
+
import '../shared/start-end.js';
|
|
22
|
+
import '../shared/ref.js';
|
|
23
|
+
import '../shared/focus2.js';
|
|
24
|
+
import '../shared/object-keys.js';
|
|
25
|
+
|
|
26
|
+
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}";
|
|
27
|
+
|
|
28
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 03 Nov 2022 17:26:06 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 flex-direction: column;\n align-items: flex-start;\n row-gap: 24px;\n}\n\n.content {\n font: var(--vvd-typography-base);\n}";
|
|
29
|
+
|
|
30
|
+
var _Dialog_instances, _Dialog_modal, _Dialog_dialogElement, _Dialog_dialog_get, _Dialog_handleScrimClick, _Dialog_handleInternalFormSubmit, _Dialog_handleModal;
|
|
31
|
+
let dialogPolyfill;
|
|
32
|
+
(async () => {
|
|
33
|
+
if (!HTMLDialogElement || !HTMLDialogElement.prototype.showModal) {
|
|
34
|
+
delete window.HTMLDialogElement;
|
|
35
|
+
dialogPolyfill = await import('../shared/dialog-polyfill.esm.js');
|
|
36
|
+
}
|
|
37
|
+
})();
|
|
38
|
+
class Dialog extends FoundationElement {
|
|
39
|
+
constructor() {
|
|
40
|
+
super(...arguments);
|
|
41
|
+
_Dialog_instances.add(this);
|
|
42
|
+
this.open = false;
|
|
43
|
+
this.ariaLabelledBy = null;
|
|
44
|
+
this.ariaLabel = null;
|
|
45
|
+
this.ariaDescribedBy = null;
|
|
46
|
+
_Dialog_modal.set(this, false);
|
|
47
|
+
_Dialog_dialogElement.set(this, void 0);
|
|
48
|
+
_Dialog_handleScrimClick.set(this, event => {
|
|
49
|
+
if (event.target !== __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get)) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const rect = __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).getBoundingClientRect();
|
|
53
|
+
const clickedInDialog = rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width;
|
|
54
|
+
this.open = clickedInDialog;
|
|
55
|
+
});
|
|
56
|
+
_Dialog_handleInternalFormSubmit.set(this, event => {
|
|
57
|
+
if (event.target.method !== 'dialog') {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
this.open = false;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
set returnValue(value) {
|
|
64
|
+
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).returnValue = value;
|
|
65
|
+
}
|
|
66
|
+
get returnValue() {
|
|
67
|
+
var _a;
|
|
68
|
+
return (_a = __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get)) === null || _a === void 0 ? void 0 : _a.returnValue;
|
|
69
|
+
}
|
|
70
|
+
get modal() {
|
|
71
|
+
return __classPrivateFieldGet(this, _Dialog_modal, "f");
|
|
72
|
+
}
|
|
73
|
+
openChanged(oldValue, newValue) {
|
|
74
|
+
if (oldValue === undefined) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (!newValue) {
|
|
78
|
+
this.close();
|
|
79
|
+
} else {
|
|
80
|
+
if (__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get)) {
|
|
81
|
+
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).open = true;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
close() {
|
|
86
|
+
if (__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).open) {
|
|
87
|
+
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).close();
|
|
88
|
+
this.dispatchEvent(new CustomEvent('close', {
|
|
89
|
+
bubbles: true,
|
|
90
|
+
composed: true,
|
|
91
|
+
detail: this.returnValue
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
this.open = false;
|
|
95
|
+
__classPrivateFieldGet(this, _Dialog_instances, "m", _Dialog_handleModal).call(this, false);
|
|
96
|
+
}
|
|
97
|
+
show() {
|
|
98
|
+
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).show();
|
|
99
|
+
this.open = true;
|
|
100
|
+
}
|
|
101
|
+
showModal() {
|
|
102
|
+
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).showModal();
|
|
103
|
+
this.open = true;
|
|
104
|
+
__classPrivateFieldGet(this, _Dialog_instances, "m", _Dialog_handleModal).call(this, true);
|
|
105
|
+
}
|
|
106
|
+
connectedCallback() {
|
|
107
|
+
super.connectedCallback();
|
|
108
|
+
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).addEventListener('click', __classPrivateFieldGet(this, _Dialog_handleScrimClick, "f"));
|
|
109
|
+
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).addEventListener('submit', __classPrivateFieldGet(this, _Dialog_handleInternalFormSubmit, "f"));
|
|
110
|
+
}
|
|
111
|
+
disconnectedCallback() {
|
|
112
|
+
super.disconnectedCallback();
|
|
113
|
+
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).removeEventListener('click', __classPrivateFieldGet(this, _Dialog_handleScrimClick, "f"));
|
|
114
|
+
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).removeEventListener('submit', __classPrivateFieldGet(this, _Dialog_handleInternalFormSubmit, "f"));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
_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() {
|
|
118
|
+
if (!__classPrivateFieldGet(this, _Dialog_dialogElement, "f")) {
|
|
119
|
+
__classPrivateFieldSet(this, _Dialog_dialogElement, this.shadowRoot.querySelector('dialog'), "f");
|
|
120
|
+
if (__classPrivateFieldGet(this, _Dialog_dialogElement, "f")) {
|
|
121
|
+
__classPrivateFieldGet(this, _Dialog_dialogElement, "f").open = this.open;
|
|
122
|
+
if (dialogPolyfill) {
|
|
123
|
+
dialogPolyfill.registerDialog(__classPrivateFieldGet(this, _Dialog_dialogElement, "f"));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return __classPrivateFieldGet(this, _Dialog_dialogElement, "f");
|
|
128
|
+
}, _Dialog_handleModal = function _Dialog_handleModal(show) {
|
|
129
|
+
__classPrivateFieldSet(this, _Dialog_modal, show, "f");
|
|
130
|
+
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).toggleAttribute('aria-modal', show);
|
|
131
|
+
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).classList.toggle('modal', show);
|
|
132
|
+
};
|
|
133
|
+
__decorate([attr({
|
|
134
|
+
mode: 'boolean'
|
|
135
|
+
}), __metadata("design:type", Object)], Dialog.prototype, "open", void 0);
|
|
136
|
+
__decorate([attr, __metadata("design:type", String)], Dialog.prototype, "icon", void 0);
|
|
137
|
+
__decorate([attr, __metadata("design:type", String)], Dialog.prototype, "text", void 0);
|
|
138
|
+
__decorate([attr, __metadata("design:type", String)], Dialog.prototype, "headline", void 0);
|
|
139
|
+
__decorate([attr({
|
|
140
|
+
attribute: 'aria-labelledby'
|
|
141
|
+
}), __metadata("design:type", Object)], Dialog.prototype, "ariaLabelledBy", void 0);
|
|
142
|
+
__decorate([attr({
|
|
143
|
+
attribute: 'aria-label'
|
|
144
|
+
}), __metadata("design:type", Object)], Dialog.prototype, "ariaLabel", void 0);
|
|
145
|
+
__decorate([attr({
|
|
146
|
+
attribute: 'aria-describedby'
|
|
147
|
+
}), __metadata("design:type", Object)], Dialog.prototype, "ariaDescribedBy", void 0);
|
|
148
|
+
|
|
149
|
+
let _2 = t => t,
|
|
150
|
+
_t,
|
|
151
|
+
_t2,
|
|
152
|
+
_t3,
|
|
153
|
+
_t4,
|
|
154
|
+
_t5;
|
|
155
|
+
const getClasses = _ => classNames('base');
|
|
156
|
+
function icon() {
|
|
157
|
+
return html(_t || (_t = _2`
|
|
158
|
+
<vwc-icon class="icon" size="large" type="${0}"></vwc-icon>
|
|
159
|
+
`), x => x.icon);
|
|
160
|
+
}
|
|
161
|
+
function headline() {
|
|
162
|
+
return html(_t2 || (_t2 = _2`
|
|
163
|
+
<div class="headline">
|
|
164
|
+
${0}
|
|
165
|
+
</div>
|
|
166
|
+
`), x => x.headline);
|
|
167
|
+
}
|
|
168
|
+
function renderDismissButton() {
|
|
169
|
+
return html(_t3 || (_t3 = _2`
|
|
170
|
+
<vwc-button
|
|
171
|
+
density="condensed"
|
|
172
|
+
class="dismiss-button"
|
|
173
|
+
icon="close-line"
|
|
174
|
+
@click="${0}">
|
|
175
|
+
</vwc-button>`), x => {
|
|
176
|
+
x.open = false;
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
function handleEscapeKey(dialog, event) {
|
|
180
|
+
if (event.key === 'Escape' && dialog.modal) {
|
|
181
|
+
dialog.open = false;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
function content() {
|
|
185
|
+
return html(_t4 || (_t4 = _2`
|
|
186
|
+
<div class="content">
|
|
187
|
+
${0}
|
|
188
|
+
</div>
|
|
189
|
+
`), x => x.text);
|
|
190
|
+
}
|
|
191
|
+
const DialogTemplate = () => html(_t5 || (_t5 = _2`
|
|
192
|
+
<vwc-elevation dp="12">
|
|
193
|
+
<div>
|
|
194
|
+
<dialog class="${0}"
|
|
195
|
+
@keydown="${0}"
|
|
196
|
+
returnValue="${0}"
|
|
197
|
+
aria-labelledby="${0}"
|
|
198
|
+
aria-label="${0}"
|
|
199
|
+
aria-describedby="${0}"
|
|
200
|
+
>
|
|
201
|
+
<slot name="main">
|
|
202
|
+
<div class="main-wrapper">
|
|
203
|
+
<div class="header">
|
|
204
|
+
<div class="headline-wrapper">
|
|
205
|
+
<slot name="graphic">
|
|
206
|
+
${0}
|
|
207
|
+
</slot>
|
|
208
|
+
${0}
|
|
209
|
+
</div>
|
|
210
|
+
${0}
|
|
211
|
+
</div>
|
|
212
|
+
<slot name="content">
|
|
213
|
+
${0}
|
|
214
|
+
</slot>
|
|
215
|
+
<slot name="footer"></slot>
|
|
216
|
+
</div>
|
|
217
|
+
</slot>
|
|
218
|
+
</dialog>
|
|
219
|
+
</div>
|
|
220
|
+
</vwc-elevation>`), getClasses, (x, c) => handleEscapeKey(x, c.event), x => x.returnValue, x => x.ariaLabelledBy, x => x.ariaLabel, x => x.ariaDescribedBy, when(x => x.icon, icon()), when(x => x.headline, headline()), renderDismissButton(), when(x => x.text, content()));
|
|
221
|
+
|
|
222
|
+
const vividDialog = Dialog.compose({
|
|
223
|
+
baseName: 'dialog',
|
|
224
|
+
template: DialogTemplate,
|
|
225
|
+
styles: [css_248z, css_248z$1]
|
|
226
|
+
});
|
|
227
|
+
designSystem.register(vividDialog());
|
|
228
|
+
|
|
229
|
+
export { vividDialog };
|
package/divider/index.js
ADDED
package/elevation/index.js
CHANGED
|
@@ -1,31 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
class Elevation extends FoundationElement {}
|
|
6
|
-
|
|
7
|
-
__decorate([attr, __metadata("design:type", Number)], Elevation.prototype, "dp", void 0);
|
|
8
|
-
|
|
9
|
-
var css_248z = ".control.dp-0 ::slotted(*) {\n background-color: var(--vvd-color-surface-0dp);\n filter: var(--vvd-shadow-surface-0dp);\n}\n.control.dp-2 ::slotted(*) {\n background-color: var(--vvd-color-surface-2dp);\n filter: var(--vvd-shadow-surface-2dp);\n}\n.control.dp-4 ::slotted(*) {\n background-color: var(--vvd-color-surface-4dp);\n filter: var(--vvd-shadow-surface-4dp);\n}\n.control.dp-8 ::slotted(*) {\n background-color: var(--vvd-color-surface-8dp);\n filter: var(--vvd-shadow-surface-8dp);\n}\n.control.dp-12 ::slotted(*) {\n background-color: var(--vvd-color-surface-12dp);\n filter: var(--vvd-shadow-surface-12dp);\n}\n.control.dp-16 ::slotted(*) {\n background-color: var(--vvd-color-surface-16dp);\n filter: var(--vvd-shadow-surface-16dp);\n}\n.control.dp-24 ::slotted(*) {\n background-color: var(--vvd-color-surface-24dp);\n filter: var(--vvd-shadow-surface-24dp);\n}\n.control:not(.dp-0, .dp-4, .dp-8, .dp-12, .dp-16, .dp-24) ::slotted(*) {\n background-color: var(--vvd-color-surface-2dp);\n filter: var(--vvd-shadow-surface-2dp);\n}";
|
|
10
|
-
styleInject(css_248z);
|
|
11
|
-
|
|
12
|
-
let _ = t => t,
|
|
13
|
-
_t;
|
|
14
|
-
|
|
15
|
-
const getClasses = ({
|
|
16
|
-
dp
|
|
17
|
-
}) => classNames('control', [`dp-${dp}`, Boolean(dp)]);
|
|
18
|
-
|
|
19
|
-
const elevationTemplate = () => html(_t || (_t = _`
|
|
20
|
-
<div class="${0}" part="base">
|
|
21
|
-
<slot></slot>
|
|
22
|
-
</div>`), getClasses);
|
|
23
|
-
|
|
24
|
-
const VIVIDElevation = Elevation.compose({
|
|
25
|
-
baseName: 'elevation',
|
|
26
|
-
template: elevationTemplate,
|
|
27
|
-
styles: css_248z
|
|
28
|
-
});
|
|
29
|
-
designSystem.register(VIVIDElevation());
|
|
30
|
-
|
|
31
|
-
export { VIVIDElevation };
|
|
1
|
+
import '../shared/index.js';
|
|
2
|
+
export { v as vividElevation } from '../shared/index3.js';
|
|
3
|
+
import '../shared/class-names.js';
|
package/fab/index.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
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 '../shared/index.js';
|
|
4
|
+
import { A as AffixIconWithTrailing, a as affixIconTemplateFactory } from '../shared/affix.js';
|
|
5
|
+
import { B as Button } from '../shared/button.js';
|
|
6
|
+
import { a as applyMixins } from '../shared/apply-mixins.js';
|
|
7
|
+
import { f as focusTemplateFactory } from '../shared/focus2.js';
|
|
8
|
+
import { r as ref } from '../shared/ref.js';
|
|
9
|
+
import { c as classNames } from '../shared/class-names.js';
|
|
10
|
+
import '../shared/icon.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/when.js';
|
|
16
|
+
import '../shared/focus.js';
|
|
17
|
+
import '../shared/web.dom-collections.iterator.js';
|
|
18
|
+
import '../shared/object-keys.js';
|
|
19
|
+
import '../shared/form-associated.js';
|
|
20
|
+
import '../shared/key-codes.js';
|
|
21
|
+
import '../shared/aria-global.js';
|
|
22
|
+
import '../shared/start-end.js';
|
|
23
|
+
|
|
24
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 03 Nov 2022 17:26:06 GMT\n */\n.control {\n position: relative;\n display: inline-flex;\n box-sizing: border-box;\n align-items: center;\n border: 0 none;\n background: var(--_appearance-color-fill, var(--_elevation-fill));\n block-size: var(--_fab-block-size);\n border-radius: var(--_fab-border-radius);\n color: var(--_appearance-color-text, var(--vvd-color-canvas-text));\n column-gap: var(--fab-icon-gap);\n filter: var(--_elevation-shadow);\n font: var(--vvd-typography-base-bold);\n transition: background-color 0.15s linear, filter 0.15s linear;\n vertical-align: middle;\n /* Size */\n}\n.control.connotation-accent {\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}\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}\n.control {\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:where(:hover, .hover):where(:not(:disabled, .disabled)) {\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(:disabled, .disabled) {\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(:active, .active):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-fierce);\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.density-extended {\n --_fab-border-radius: 30px;\n --_fab-block-size: calc(1px * (40 + 8 * clamp(-1, var(--vvd-size-density, 0), 1) + 16));\n}\n.control:not(.density-extended) {\n --_fab-border-radius: 24px;\n --_fab-block-size: calc(1px * (40 + 8 * clamp(-1, var(--vvd-size-density, 0), 1)));\n}\n.control.icon-only {\n border-radius: 50%;\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(--_fab-block-size);\n }\n}\n.control:not(.icon-only) {\n --fab-icon-gap: 10px;\n padding-inline: 20px;\n}\n.control:disabled {\n --_elevation-fill: var(--vvd-color-surface-0dp);\n --_elevation-shadow: var(--vvd-shadow-surface-0dp);\n cursor: not-allowed;\n}\n.control:not(:disabled) {\n --_elevation-fill: var(--vvd-color-surface-4dp);\n --_elevation-shadow: var(--vvd-shadow-surface-4dp);\n cursor: pointer;\n}\n.control:not(:disabled):hover {\n --_elevation-fill: var(--vvd-color-surface-12dp);\n --_elevation-shadow: var(--vvd-shadow-surface-12dp);\n}\n.control:not(:disabled):active {\n --_elevation-fill: var(--vvd-color-surface-24dp);\n --_elevation-shadow: var(--vvd-shadow-surface-24dp);\n}\n\n/* Icon */\n.icon-trailing .icon {\n order: 1;\n}\n.density-extended .icon {\n font-size: 24px;\n}\n.icon:not(.density-extended) .icon {\n font-size: 20px;\n}\n\n:not(:focus-visible) .focus-indicator {\n display: none;\n}";
|
|
25
|
+
|
|
26
|
+
class Fab extends Button {}
|
|
27
|
+
__decorate([attr, __metadata("design:type", String)], Fab.prototype, "connotation", void 0);
|
|
28
|
+
__decorate([attr, __metadata("design:type", String)], Fab.prototype, "density", void 0);
|
|
29
|
+
__decorate([attr, __metadata("design:type", String)], Fab.prototype, "label", void 0);
|
|
30
|
+
applyMixins(Fab, AffixIconWithTrailing);
|
|
31
|
+
|
|
32
|
+
let _ = t => t,
|
|
33
|
+
_t;
|
|
34
|
+
const getClasses = ({
|
|
35
|
+
connotation,
|
|
36
|
+
density,
|
|
37
|
+
icon,
|
|
38
|
+
label,
|
|
39
|
+
iconTrailing,
|
|
40
|
+
disabled
|
|
41
|
+
}) => classNames('control', [`connotation-${connotation}`, Boolean(connotation)], [`density-${density}`, Boolean(density)], ['icon-only', !label && !!icon], ['icon-trailing', iconTrailing], ['disabled', disabled]);
|
|
42
|
+
const FabTemplate = context => {
|
|
43
|
+
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
44
|
+
const focusTemplate = focusTemplateFactory(context);
|
|
45
|
+
return html(_t || (_t = _`
|
|
46
|
+
<button
|
|
47
|
+
class="${0} "
|
|
48
|
+
?autofocus="${0}"
|
|
49
|
+
?disabled="${0}"
|
|
50
|
+
form="${0}"
|
|
51
|
+
formaction="${0}"
|
|
52
|
+
formenctype="${0}"
|
|
53
|
+
formmethod="${0}"
|
|
54
|
+
formnovalidate="${0}"
|
|
55
|
+
formtarget="${0}"
|
|
56
|
+
name="${0}"
|
|
57
|
+
type="${0}"
|
|
58
|
+
value="${0}"
|
|
59
|
+
aria-atomic="${0}"
|
|
60
|
+
aria-busy="${0}"
|
|
61
|
+
aria-controls="${0}"
|
|
62
|
+
aria-current="${0}"
|
|
63
|
+
aria-describedby="${0}"
|
|
64
|
+
aria-details="${0}"
|
|
65
|
+
aria-disabled="${0}"
|
|
66
|
+
aria-errormessage="${0}"
|
|
67
|
+
aria-expanded="${0}"
|
|
68
|
+
aria-flowto="${0}"
|
|
69
|
+
aria-haspopup="${0}"
|
|
70
|
+
aria-hidden="${0}"
|
|
71
|
+
aria-invalid="${0}"
|
|
72
|
+
aria-keyshortcuts="${0}"
|
|
73
|
+
aria-label="${0}"
|
|
74
|
+
aria-labelledby="${0}"
|
|
75
|
+
aria-live="${0}"
|
|
76
|
+
aria-owns="${0}"
|
|
77
|
+
aria-pressed="${0}"
|
|
78
|
+
aria-relevant="${0}"
|
|
79
|
+
aria-roledescription="${0}"
|
|
80
|
+
${0}
|
|
81
|
+
>
|
|
82
|
+
${0}
|
|
83
|
+
${0}
|
|
84
|
+
${0}
|
|
85
|
+
</button>
|
|
86
|
+
`), 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);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const vividFab = Fab.compose({
|
|
90
|
+
baseName: 'fab',
|
|
91
|
+
template: FabTemplate,
|
|
92
|
+
styles: css_248z,
|
|
93
|
+
shadowOptions: {
|
|
94
|
+
delegatesFocus: true
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
designSystem.register(vividFab());
|
|
98
|
+
|
|
99
|
+
export { vividFab };
|
package/focus/index.js
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
import '../shared/index.js';
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { h as html, d as designSystem } from '../shared/index.js';
|
|
2
|
+
import { F as Focus } from '../shared/focus.js';
|
|
3
|
+
|
|
4
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 03 Nov 2022 17:26:06 GMT\n */\n:host {\n display: contents;\n border-radius: inherit;\n}\n\n.control {\n position: absolute;\n z-index: 1;\n box-sizing: border-box;\n border-radius: inherit;\n box-shadow: inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);\n inset: var(--focus-inset, 0);\n outline: 2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));\n outline-offset: -2px;\n}";
|
|
5
|
+
|
|
6
|
+
let _ = t => t,
|
|
7
|
+
_t;
|
|
8
|
+
const focusTemplate = () => html(_t || (_t = _`
|
|
9
|
+
<span class="control"></span>`));
|
|
10
|
+
|
|
11
|
+
const vividFocus = Focus.compose({
|
|
12
|
+
baseName: 'focus',
|
|
13
|
+
template: focusTemplate,
|
|
14
|
+
styles: css_248z
|
|
15
|
+
});
|
|
16
|
+
designSystem.register(vividFocus());
|
|
17
|
+
|
|
18
|
+
export { vividFocus };
|
package/header/index.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { E as Elevation } from '../shared/index3.js';
|
|
2
|
+
import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
|
|
3
|
+
import '../shared/web.dom-collections.iterator.js';
|
|
4
|
+
import { c as classNames } from '../shared/class-names.js';
|
|
5
|
+
import '../shared/export.js';
|
|
6
|
+
import '../shared/object-keys.js';
|
|
7
|
+
import '../shared/iterators.js';
|
|
8
|
+
|
|
9
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 03 Nov 2022 17:26:06 GMT\n */\n.base {\n z-index: 1;\n block-size: calc(calc(1px * (40 + 8 * clamp(-1, var(--vvd-size-density, 0), 1))) + calc(1px * (40 + 8 * clamp(-1, var(--vvd-size-density, 0), 1) - 16)));\n font: var(--vvd-typography-heading-4);\n inline-size: 100%;\n}\n.base .header-content {\n display: inline-flex;\n align-items: center;\n column-gap: 4px;\n}\n\n.container {\n display: flex;\n box-sizing: border-box;\n justify-content: space-between;\n block-size: inherit;\n color: var(--vvd-color-canvas-text);\n column-gap: 12px;\n padding-block: 8px;\n padding-inline: 16px;\n}\n.container[part~=vvd-theme-alternate] {\n background-color: var(--vvd-color-canvas);\n color: var(--vvd-color-canvas-text);\n color-scheme: var(--vvd-color-scheme);\n}\n\n.app-content {\n --vvd-header-block-size: calc(calc(1px * (40 + 8 * clamp(-1, var(--vvd-size-density, 0), 1))) + calc(1px * (40 + 8 * clamp(-1, var(--vvd-size-density, 0), 1) - 16)));\n}";
|
|
10
|
+
|
|
11
|
+
class Header extends FoundationElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.elevationShadow = false;
|
|
15
|
+
this.alternate = false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
__decorate([attr({
|
|
19
|
+
attribute: 'elevation-shadow',
|
|
20
|
+
mode: 'boolean'
|
|
21
|
+
}), __metadata("design:type", Object)], Header.prototype, "elevationShadow", void 0);
|
|
22
|
+
__decorate([attr({
|
|
23
|
+
mode: 'boolean'
|
|
24
|
+
}), __metadata("design:type", Object)], Header.prototype, "alternate", void 0);
|
|
25
|
+
|
|
26
|
+
let _ = t => t,
|
|
27
|
+
_t;
|
|
28
|
+
const getPartAlternate = ({
|
|
29
|
+
alternate
|
|
30
|
+
}) => classNames(['vvd-theme-alternate', Boolean(alternate)]);
|
|
31
|
+
const headerTemplate = context => {
|
|
32
|
+
const elevationTag = context.tagFor(Elevation);
|
|
33
|
+
return html(_t || (_t = _`
|
|
34
|
+
<${0} dp="4" ?no-shadow=${0}>
|
|
35
|
+
<header class="base" part="base">
|
|
36
|
+
<!-- a container is needed to distinguish the surface background color of the
|
|
37
|
+
element from its shadow when applying elevation with alternate -->
|
|
38
|
+
<div class="container" part="${0}">
|
|
39
|
+
<section class="header-content">
|
|
40
|
+
<slot></slot>
|
|
41
|
+
</section>
|
|
42
|
+
<section class="header-content">
|
|
43
|
+
<slot name="action-items"></slot>
|
|
44
|
+
</section>
|
|
45
|
+
</div>
|
|
46
|
+
</header>
|
|
47
|
+
</${0}>
|
|
48
|
+
<div class="app-content">
|
|
49
|
+
<slot name="app-content"></slot>
|
|
50
|
+
</div>
|
|
51
|
+
`), elevationTag, x => !x.elevationShadow, getPartAlternate, elevationTag);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const vividHeader = Header.compose({
|
|
55
|
+
baseName: 'header',
|
|
56
|
+
template: headerTemplate,
|
|
57
|
+
styles: css_248z
|
|
58
|
+
});
|
|
59
|
+
designSystem.register(vividHeader());
|
|
60
|
+
|
|
61
|
+
export { vividHeader };
|