solid-ui 3.0.6 → 3.1.1-test.0
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 +146 -2
- package/dist/acl/access-groups.js +1 -1
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/button/index.esm.js +546 -0
- package/dist/components/button/index.esm.js.map +1 -0
- package/dist/components/button/index.esm.min.js +268 -0
- package/dist/components/button/index.esm.min.js.map +1 -0
- package/dist/components/button/index.js +428 -0
- package/dist/components/button/index.js.map +1 -0
- package/dist/components/button/index.min.js +257 -0
- package/dist/components/button/index.min.js.map +1 -0
- package/dist/components/combobox/index.d.ts +1 -0
- package/dist/components/combobox/index.esm.js +953 -0
- package/dist/components/combobox/index.esm.js.map +1 -0
- package/dist/components/combobox/index.esm.min.js +339 -0
- package/dist/components/combobox/index.esm.min.js.map +1 -0
- package/dist/components/combobox/index.js +782 -0
- package/dist/components/combobox/index.js.map +1 -0
- package/dist/components/combobox/index.min.js +328 -0
- package/dist/components/combobox/index.min.js.map +1 -0
- package/dist/components/footer/index.d.ts +1 -0
- package/dist/components/footer/index.esm.js +24406 -0
- package/dist/components/footer/index.esm.js.map +1 -0
- package/dist/components/footer/index.esm.min.js +137 -0
- package/dist/components/footer/index.esm.min.js.map +1 -0
- package/dist/components/footer/index.js +23303 -0
- package/dist/components/footer/index.js.map +1 -0
- package/dist/components/footer/index.min.js +125 -0
- package/dist/components/footer/index.min.js.map +1 -0
- package/dist/components/header/index.d.ts +1 -0
- package/dist/components/header/index.esm.js +1936 -0
- package/dist/components/header/index.esm.js.map +1 -0
- package/dist/components/header/index.esm.min.js +1125 -0
- package/dist/components/header/index.esm.min.js.map +1 -0
- package/dist/components/header/index.js +1897 -0
- package/dist/components/header/index.js.map +1 -0
- package/dist/components/header/index.min.js +1126 -0
- package/dist/components/header/index.min.js.map +1 -0
- package/dist/components/loginButton/index.d.ts +1 -0
- package/dist/components/loginButton/index.esm.js +761 -0
- package/dist/components/loginButton/index.esm.js.map +1 -0
- package/dist/components/loginButton/index.esm.min.js +444 -0
- package/dist/components/loginButton/index.esm.min.js.map +1 -0
- package/dist/components/loginButton/index.js +743 -0
- package/dist/components/loginButton/index.js.map +1 -0
- package/dist/components/loginButton/index.min.js +444 -0
- package/dist/components/loginButton/index.min.js.map +1 -0
- package/dist/components/photoCapture/index.d.ts +1 -0
- package/dist/components/photoCapture/index.esm.js +966 -0
- package/dist/components/photoCapture/index.esm.js.map +1 -0
- package/dist/components/photoCapture/index.esm.min.js +304 -0
- package/dist/components/photoCapture/index.esm.min.js.map +1 -0
- package/dist/components/photoCapture/index.js +848 -0
- package/dist/components/photoCapture/index.js.map +1 -0
- package/dist/components/photoCapture/index.min.js +293 -0
- package/dist/components/photoCapture/index.min.js.map +1 -0
- package/dist/components/select/index.d.ts +1 -0
- package/dist/components/select/index.esm.js +939 -0
- package/dist/components/select/index.esm.js.map +1 -0
- package/dist/components/select/index.esm.min.js +370 -0
- package/dist/components/select/index.esm.min.js.map +1 -0
- package/dist/components/select/index.js +771 -0
- package/dist/components/select/index.js.map +1 -0
- package/dist/components/select/index.min.js +359 -0
- package/dist/components/select/index.min.js.map +1 -0
- package/dist/components/signupButton/index.d.ts +1 -0
- package/dist/components/signupButton/index.esm.js +270 -0
- package/dist/components/signupButton/index.esm.js.map +1 -0
- package/dist/components/signupButton/index.esm.min.js +82 -0
- package/dist/components/signupButton/index.esm.min.js.map +1 -0
- package/dist/components/signupButton/index.js +264 -0
- package/dist/components/signupButton/index.js.map +1 -0
- package/dist/components/signupButton/index.min.js +82 -0
- package/dist/components/signupButton/index.min.js.map +1 -0
- package/dist/footer/index.d.ts.map +1 -1
- package/dist/footer/index.js +8 -4
- package/dist/footer/index.js.map +1 -1
- package/dist/icons/v2/icons-svg/contactIcons.d.ts +3 -0
- package/dist/icons/v2/icons-svg/contactIcons.d.ts.map +1 -0
- package/dist/icons/v2/icons-svg/contactIcons.js +27 -0
- package/dist/icons/v2/icons-svg/contactIcons.js.map +1 -0
- package/dist/icons/v2/icons-svg/headerIcons.d.ts +18 -0
- package/dist/icons/v2/icons-svg/headerIcons.d.ts.map +1 -0
- package/dist/icons/v2/icons-svg/headerIcons.js +245 -0
- package/dist/icons/v2/icons-svg/headerIcons.js.map +1 -0
- package/dist/icons/v2/icons-svg/pngIcons.d.ts +3 -0
- package/dist/icons/v2/icons-svg/pngIcons.d.ts.map +1 -0
- package/dist/icons/v2/icons-svg/pngIcons.js +4 -0
- package/dist/icons/v2/icons-svg/pngIcons.js.map +1 -0
- package/dist/icons/v2/icons-svg/profileIcons.d.ts +23 -0
- package/dist/icons/v2/icons-svg/profileIcons.d.ts.map +1 -0
- package/dist/icons/v2/icons-svg/profileIcons.js +317 -0
- package/dist/icons/v2/icons-svg/profileIcons.js.map +1 -0
- package/dist/login/login.d.ts.map +1 -1
- package/dist/login/login.js +12 -2
- package/dist/login/login.js.map +1 -1
- package/dist/matrix/matrix.js.map +1 -1
- package/dist/pad.d.ts.map +1 -1
- package/dist/pad.js +13 -13
- package/dist/pad.js.map +1 -1
- package/dist/solid-ui.esm.js +9627 -12206
- package/dist/solid-ui.esm.js.map +1 -1
- package/dist/solid-ui.esm.min.js +15 -14
- package/dist/solid-ui.esm.min.js.map +1 -1
- package/dist/solid-ui.js +12621 -14833
- package/dist/solid-ui.js.map +1 -1
- package/dist/solid-ui.min.js +23 -22
- package/dist/solid-ui.min.js.map +1 -1
- package/dist/tabs.js +2 -2
- package/dist/tabs.js.map +1 -1
- package/dist/utils/headerFooterHelpers.d.ts.map +1 -1
- package/dist/utils/headerFooterHelpers.js +11 -2
- package/dist/utils/headerFooterHelpers.js.map +1 -1
- package/dist/v2/components/actions/button/Button.d.ts +97 -0
- package/dist/v2/components/actions/button/Button.d.ts.map +1 -0
- package/dist/v2/components/actions/button/Button.js +325 -0
- package/dist/v2/components/actions/button/Button.js.map +1 -0
- package/dist/v2/components/actions/button/Button.test.d.ts +2 -0
- package/dist/v2/components/actions/button/Button.test.d.ts.map +1 -0
- package/dist/v2/components/actions/button/Button.test.js +117 -0
- package/dist/v2/components/actions/button/Button.test.js.map +1 -0
- package/dist/v2/components/actions/button/index.d.ts +8 -0
- package/dist/v2/components/actions/button/index.d.ts.map +1 -0
- package/dist/v2/components/actions/button/index.js +7 -0
- package/dist/v2/components/actions/button/index.js.map +1 -0
- package/dist/v2/components/auth/loginButton/LoginButton.d.ts +62 -0
- package/dist/v2/components/auth/loginButton/LoginButton.d.ts.map +1 -0
- package/dist/v2/components/auth/loginButton/LoginButton.js +539 -0
- package/dist/v2/components/auth/loginButton/LoginButton.js.map +1 -0
- package/dist/v2/components/auth/loginButton/LoginButton.test.d.ts +2 -0
- package/dist/v2/components/auth/loginButton/LoginButton.test.d.ts.map +1 -0
- package/dist/v2/components/auth/loginButton/LoginButton.test.js +53 -0
- package/dist/v2/components/auth/loginButton/LoginButton.test.js.map +1 -0
- package/dist/v2/components/auth/loginButton/downArrow.d.ts +2 -0
- package/dist/v2/components/auth/loginButton/downArrow.d.ts.map +1 -0
- package/dist/v2/components/auth/loginButton/downArrow.js +10 -0
- package/dist/v2/components/auth/loginButton/downArrow.js.map +1 -0
- package/dist/v2/components/auth/loginButton/index.d.ts +3 -0
- package/dist/v2/components/auth/loginButton/index.d.ts.map +1 -0
- package/dist/v2/components/auth/loginButton/index.js +7 -0
- package/dist/v2/components/auth/loginButton/index.js.map +1 -0
- package/dist/v2/components/auth/signupButton/SignupButton.d.ts +36 -0
- package/dist/v2/components/auth/signupButton/SignupButton.d.ts.map +1 -0
- package/dist/v2/components/auth/signupButton/SignupButton.js +84 -0
- package/dist/v2/components/auth/signupButton/SignupButton.js.map +1 -0
- package/dist/v2/components/auth/signupButton/SignupButton.test.d.ts +2 -0
- package/dist/v2/components/auth/signupButton/SignupButton.test.d.ts.map +1 -0
- package/dist/v2/components/auth/signupButton/SignupButton.test.js +49 -0
- package/dist/v2/components/auth/signupButton/SignupButton.test.js.map +1 -0
- package/dist/v2/components/auth/signupButton/index.d.ts +3 -0
- package/dist/v2/components/auth/signupButton/index.d.ts.map +1 -0
- package/dist/v2/components/auth/signupButton/index.js +7 -0
- package/dist/v2/components/auth/signupButton/index.js.map +1 -0
- package/dist/v2/components/forms/combobox/Combobox.d.ts +82 -0
- package/dist/v2/components/forms/combobox/Combobox.d.ts.map +1 -0
- package/dist/v2/components/forms/combobox/Combobox.js +506 -0
- package/dist/v2/components/forms/combobox/Combobox.js.map +1 -0
- package/dist/v2/components/forms/combobox/Combobox.test.d.ts +2 -0
- package/dist/v2/components/forms/combobox/Combobox.test.d.ts.map +1 -0
- package/dist/v2/components/forms/combobox/Combobox.test.js +201 -0
- package/dist/v2/components/forms/combobox/Combobox.test.js.map +1 -0
- package/dist/v2/components/forms/combobox/comboboxTypes.d.ts +6 -0
- package/dist/v2/components/forms/combobox/comboboxTypes.d.ts.map +1 -0
- package/dist/v2/components/forms/combobox/comboboxTypes.js +2 -0
- package/dist/v2/components/forms/combobox/comboboxTypes.js.map +1 -0
- package/dist/v2/components/forms/combobox/index.d.ts +3 -0
- package/dist/v2/components/forms/combobox/index.d.ts.map +1 -0
- package/dist/v2/components/forms/combobox/index.js +7 -0
- package/dist/v2/components/forms/combobox/index.js.map +1 -0
- package/dist/v2/components/forms/select/Select.d.ts +68 -0
- package/dist/v2/components/forms/select/Select.d.ts.map +1 -0
- package/dist/v2/components/forms/select/Select.js +499 -0
- package/dist/v2/components/forms/select/Select.js.map +1 -0
- package/dist/v2/components/forms/select/Select.test.d.ts +2 -0
- package/dist/v2/components/forms/select/Select.test.d.ts.map +1 -0
- package/dist/v2/components/forms/select/Select.test.js +168 -0
- package/dist/v2/components/forms/select/Select.test.js.map +1 -0
- package/dist/v2/components/forms/select/index.d.ts +3 -0
- package/dist/v2/components/forms/select/index.d.ts.map +1 -0
- package/dist/v2/components/forms/select/index.js +7 -0
- package/dist/v2/components/forms/select/index.js.map +1 -0
- package/dist/v2/components/forms/shared/downArrow.d.ts +2 -0
- package/dist/v2/components/forms/shared/downArrow.d.ts.map +1 -0
- package/dist/v2/components/forms/shared/downArrow.js +10 -0
- package/dist/v2/components/forms/shared/downArrow.js.map +1 -0
- package/dist/v2/components/forms/shared/keyboard.d.ts +7 -0
- package/dist/v2/components/forms/shared/keyboard.d.ts.map +1 -0
- package/dist/v2/components/forms/shared/keyboard.js +56 -0
- package/dist/v2/components/forms/shared/keyboard.js.map +1 -0
- package/dist/v2/components/forms/shared/listboxStyles.d.ts +2 -0
- package/dist/v2/components/forms/shared/listboxStyles.d.ts.map +1 -0
- package/dist/v2/components/forms/shared/listboxStyles.js +96 -0
- package/dist/v2/components/forms/shared/listboxStyles.js.map +1 -0
- package/dist/v2/components/forms/shared/listboxTemplate.d.ts +11 -0
- package/dist/v2/components/forms/shared/listboxTemplate.d.ts.map +1 -0
- package/dist/v2/components/forms/shared/listboxTemplate.js +37 -0
- package/dist/v2/components/forms/shared/listboxTemplate.js.map +1 -0
- package/dist/v2/components/forms/shared/optionTypes.d.ts +6 -0
- package/dist/v2/components/forms/shared/optionTypes.d.ts.map +1 -0
- package/dist/v2/components/forms/shared/optionTypes.js +2 -0
- package/dist/v2/components/forms/shared/optionTypes.js.map +1 -0
- package/dist/v2/components/layout/footer/Footer.d.ts +60 -0
- package/dist/v2/components/layout/footer/Footer.d.ts.map +1 -0
- package/dist/v2/components/layout/footer/Footer.js +148 -0
- package/dist/v2/components/layout/footer/Footer.js.map +1 -0
- package/dist/v2/components/layout/footer/Footer.test.d.ts +2 -0
- package/dist/v2/components/layout/footer/Footer.test.d.ts.map +1 -0
- package/dist/v2/components/layout/footer/Footer.test.js +53 -0
- package/dist/v2/components/layout/footer/Footer.test.js.map +1 -0
- package/dist/v2/components/layout/footer/index.d.ts +3 -0
- package/dist/v2/components/layout/footer/index.d.ts.map +1 -0
- package/dist/v2/components/layout/footer/index.js +7 -0
- package/dist/v2/components/layout/footer/index.js.map +1 -0
- package/dist/v2/components/layout/header/Header.d.ts +155 -0
- package/dist/v2/components/layout/header/Header.d.ts.map +1 -0
- package/dist/v2/components/layout/header/Header.js +845 -0
- package/dist/v2/components/layout/header/Header.js.map +1 -0
- package/dist/v2/components/layout/header/header.test.d.ts +2 -0
- package/dist/v2/components/layout/header/header.test.d.ts.map +1 -0
- package/dist/v2/components/layout/header/header.test.js +242 -0
- package/dist/v2/components/layout/header/header.test.js.map +1 -0
- package/dist/v2/components/layout/header/index.d.ts +4 -0
- package/dist/v2/components/layout/header/index.d.ts.map +1 -0
- package/dist/v2/components/layout/header/index.js +7 -0
- package/dist/v2/components/layout/header/index.js.map +1 -0
- package/dist/v2/components/media/photoCapture/PhotoCapture.d.ts +200 -0
- package/dist/v2/components/media/photoCapture/PhotoCapture.d.ts.map +1 -0
- package/dist/v2/components/media/photoCapture/PhotoCapture.js +723 -0
- package/dist/v2/components/media/photoCapture/PhotoCapture.js.map +1 -0
- package/dist/v2/components/media/photoCapture/PhotoCapture.test.d.ts +2 -0
- package/dist/v2/components/media/photoCapture/PhotoCapture.test.d.ts.map +1 -0
- package/dist/v2/components/media/photoCapture/PhotoCapture.test.js +157 -0
- package/dist/v2/components/media/photoCapture/PhotoCapture.test.js.map +1 -0
- package/dist/v2/components/media/photoCapture/index.d.ts +3 -0
- package/dist/v2/components/media/photoCapture/index.d.ts.map +1 -0
- package/dist/v2/components/media/photoCapture/index.js +7 -0
- package/dist/v2/components/media/photoCapture/index.js.map +1 -0
- package/dist/versionInfo.js +15 -15
- package/dist/widgets/buttons.d.ts +10 -3
- package/dist/widgets/buttons.d.ts.map +1 -1
- package/dist/widgets/buttons.js +81 -7
- package/dist/widgets/buttons.js.map +1 -1
- package/package.json +139 -46
|
@@ -0,0 +1,723 @@
|
|
|
1
|
+
import { LitElement, css, html, nothing } from 'lit';
|
|
2
|
+
const DEFAULT_CAPTURE_FORMAT = 'image/png';
|
|
3
|
+
export class PhotoCapture extends LitElement {
|
|
4
|
+
get _supportsFormInternals() {
|
|
5
|
+
return !!this._internals && typeof this._internals.setFormValue === 'function';
|
|
6
|
+
}
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this._value = null;
|
|
10
|
+
this._stream = null;
|
|
11
|
+
this._associatedForm = null;
|
|
12
|
+
this._handleFormData = (event) => {
|
|
13
|
+
const formData = event.formData;
|
|
14
|
+
if (!formData || !this.name || !this.value || this.disabled)
|
|
15
|
+
return;
|
|
16
|
+
formData.append(this.name, this.value, this.value.name);
|
|
17
|
+
};
|
|
18
|
+
this._handleFormReset = () => {
|
|
19
|
+
this._clearValue({ emitEvents: false });
|
|
20
|
+
if (this.open) {
|
|
21
|
+
this._queuePreviewStart();
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
this.label = 'Take Photo';
|
|
25
|
+
this.heading = 'Take a photo';
|
|
26
|
+
this.captureLabel = 'Take Photo';
|
|
27
|
+
this.confirmLabel = 'Use Photo';
|
|
28
|
+
this.retakeLabel = 'Retake';
|
|
29
|
+
this.cancelLabel = 'Cancel';
|
|
30
|
+
this.presentation = 'inline';
|
|
31
|
+
this.theme = 'light';
|
|
32
|
+
this.facingMode = 'user';
|
|
33
|
+
this.constraints = '';
|
|
34
|
+
this.captureFormat = DEFAULT_CAPTURE_FORMAT;
|
|
35
|
+
this.captureQuality = undefined;
|
|
36
|
+
this.open = false;
|
|
37
|
+
this.disabled = false;
|
|
38
|
+
this.name = '';
|
|
39
|
+
this.required = false;
|
|
40
|
+
this.showTrigger = false;
|
|
41
|
+
this.showCancelButton = true;
|
|
42
|
+
this.autoCloseOnCapture = false;
|
|
43
|
+
this.fileNamePrefix = '';
|
|
44
|
+
this.mediaConstraints = undefined;
|
|
45
|
+
this._errorMessage = '';
|
|
46
|
+
this._previewUrl = '';
|
|
47
|
+
this._startingPreview = false;
|
|
48
|
+
this._internals = typeof this.attachInternals === 'function' ? this.attachInternals() : null;
|
|
49
|
+
}
|
|
50
|
+
get value() {
|
|
51
|
+
return this._value;
|
|
52
|
+
}
|
|
53
|
+
set value(nextValue) {
|
|
54
|
+
const normalizedValue = nextValue instanceof File ? nextValue : null;
|
|
55
|
+
const previousValue = this._value;
|
|
56
|
+
if (previousValue === normalizedValue)
|
|
57
|
+
return;
|
|
58
|
+
this._value = normalizedValue;
|
|
59
|
+
this._syncPreviewFromValue(normalizedValue);
|
|
60
|
+
this._syncFormValue();
|
|
61
|
+
this._syncValidity();
|
|
62
|
+
this.requestUpdate('value', previousValue);
|
|
63
|
+
}
|
|
64
|
+
get form() {
|
|
65
|
+
var _a, _b;
|
|
66
|
+
return (_b = (this._supportsFormInternals ? (_a = this._internals) === null || _a === void 0 ? void 0 : _a.form : null)) !== null && _b !== void 0 ? _b : this._associatedForm;
|
|
67
|
+
}
|
|
68
|
+
get validationMessage() {
|
|
69
|
+
var _a;
|
|
70
|
+
return (typeof ((_a = this._internals) === null || _a === void 0 ? void 0 : _a.validationMessage) === 'string' ? this._internals.validationMessage : '') || (this.required && !this.value ? 'Please capture a photo.' : '');
|
|
71
|
+
}
|
|
72
|
+
get willValidate() {
|
|
73
|
+
var _a;
|
|
74
|
+
return typeof ((_a = this._internals) === null || _a === void 0 ? void 0 : _a.willValidate) === 'boolean' ? this._internals.willValidate : !this.disabled;
|
|
75
|
+
}
|
|
76
|
+
checkValidity() {
|
|
77
|
+
if (this._internals && typeof this._internals.checkValidity === 'function') {
|
|
78
|
+
return this._internals.checkValidity();
|
|
79
|
+
}
|
|
80
|
+
return !(this.required && !this.value);
|
|
81
|
+
}
|
|
82
|
+
reportValidity() {
|
|
83
|
+
if (this._internals && typeof this._internals.reportValidity === 'function') {
|
|
84
|
+
return this._internals.reportValidity();
|
|
85
|
+
}
|
|
86
|
+
return this.checkValidity();
|
|
87
|
+
}
|
|
88
|
+
connectedCallback() {
|
|
89
|
+
super.connectedCallback();
|
|
90
|
+
this._syncAssociatedForm();
|
|
91
|
+
this._syncFormValue();
|
|
92
|
+
this._syncValidity();
|
|
93
|
+
}
|
|
94
|
+
disconnectedCallback() {
|
|
95
|
+
this._syncAssociatedForm(null);
|
|
96
|
+
this._stopStream();
|
|
97
|
+
this._revokePreviewUrl();
|
|
98
|
+
super.disconnectedCallback();
|
|
99
|
+
}
|
|
100
|
+
formResetCallback() {
|
|
101
|
+
this._handleFormReset();
|
|
102
|
+
}
|
|
103
|
+
formDisabledCallback(disabled) {
|
|
104
|
+
this.disabled = disabled;
|
|
105
|
+
}
|
|
106
|
+
updated(changed) {
|
|
107
|
+
var _a, _b;
|
|
108
|
+
this._syncAssociatedForm();
|
|
109
|
+
if (this.presentation === 'dialog') {
|
|
110
|
+
const dialog = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('dialog');
|
|
111
|
+
if (dialog) {
|
|
112
|
+
if (this.open && !dialog.open) {
|
|
113
|
+
dialog.showModal();
|
|
114
|
+
}
|
|
115
|
+
else if (!this.open && dialog.open) {
|
|
116
|
+
dialog.close();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (changed.has('open') && !this.open) {
|
|
121
|
+
this._stopStream();
|
|
122
|
+
}
|
|
123
|
+
if (this.open &&
|
|
124
|
+
!this.value &&
|
|
125
|
+
!this._stream &&
|
|
126
|
+
!this._startingPreview &&
|
|
127
|
+
(changed.has('open') || changed.has('presentation') || changed.has('_previewUrl') || changed.has('value'))) {
|
|
128
|
+
this._queuePreviewStart();
|
|
129
|
+
}
|
|
130
|
+
if (changed.has('name') || changed.has('disabled') || changed.has('value')) {
|
|
131
|
+
this._syncFormValue();
|
|
132
|
+
}
|
|
133
|
+
if (changed.has('required') || changed.has('disabled') || changed.has('value')) {
|
|
134
|
+
this._syncValidity();
|
|
135
|
+
}
|
|
136
|
+
if (this._stream) {
|
|
137
|
+
const video = (_b = this.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('video.capture-preview');
|
|
138
|
+
if (video && video.srcObject !== this._stream) {
|
|
139
|
+
video.srcObject = this._stream;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
_setOpen(open) {
|
|
144
|
+
if (this.open === open)
|
|
145
|
+
return;
|
|
146
|
+
this.open = open;
|
|
147
|
+
this.dispatchEvent(new CustomEvent('open-change', {
|
|
148
|
+
detail: { open },
|
|
149
|
+
bubbles: true,
|
|
150
|
+
composed: true
|
|
151
|
+
}));
|
|
152
|
+
}
|
|
153
|
+
_emitError(error, message = 'Unable to access the camera') {
|
|
154
|
+
this._errorMessage = message;
|
|
155
|
+
this.dispatchEvent(new CustomEvent('error', {
|
|
156
|
+
detail: { error, message },
|
|
157
|
+
bubbles: true,
|
|
158
|
+
composed: true
|
|
159
|
+
}));
|
|
160
|
+
}
|
|
161
|
+
_syncAssociatedForm(nextForm = this.closest('form')) {
|
|
162
|
+
if (this._associatedForm === nextForm)
|
|
163
|
+
return;
|
|
164
|
+
if (this._associatedForm) {
|
|
165
|
+
this._associatedForm.removeEventListener('formdata', this._handleFormData);
|
|
166
|
+
this._associatedForm.removeEventListener('reset', this._handleFormReset);
|
|
167
|
+
}
|
|
168
|
+
this._associatedForm = nextForm;
|
|
169
|
+
if (this._associatedForm && !this._supportsFormInternals) {
|
|
170
|
+
this._associatedForm.addEventListener('formdata', this._handleFormData);
|
|
171
|
+
this._associatedForm.addEventListener('reset', this._handleFormReset);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
_syncFormValue() {
|
|
175
|
+
if (!this._supportsFormInternals)
|
|
176
|
+
return;
|
|
177
|
+
const internals = this._internals;
|
|
178
|
+
if (!internals)
|
|
179
|
+
return;
|
|
180
|
+
if (this.disabled || !this.name || !this.value) {
|
|
181
|
+
internals.setFormValue(null);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
internals.setFormValue(this.value);
|
|
185
|
+
}
|
|
186
|
+
_syncValidity() {
|
|
187
|
+
if (!this._internals || !this._supportsFormInternals || typeof this._internals.setValidity !== 'function')
|
|
188
|
+
return;
|
|
189
|
+
if (this.disabled || !this.required || this.value) {
|
|
190
|
+
this._internals.setValidity({});
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
this._internals.setValidity({ valueMissing: true }, 'Please capture a photo.');
|
|
194
|
+
}
|
|
195
|
+
_syncPreviewFromValue(file) {
|
|
196
|
+
this._revokePreviewUrl();
|
|
197
|
+
if (!file)
|
|
198
|
+
return;
|
|
199
|
+
this._stopStream();
|
|
200
|
+
this._previewUrl = URL.createObjectURL(file);
|
|
201
|
+
}
|
|
202
|
+
_clearValue(options) {
|
|
203
|
+
this.value = null;
|
|
204
|
+
this._errorMessage = '';
|
|
205
|
+
if (options.emitEvents) {
|
|
206
|
+
this._dispatchValueEvents();
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
_dispatchValueEvents() {
|
|
210
|
+
const detail = { value: this.value };
|
|
211
|
+
this.dispatchEvent(new CustomEvent('input', {
|
|
212
|
+
detail,
|
|
213
|
+
bubbles: true,
|
|
214
|
+
composed: true
|
|
215
|
+
}));
|
|
216
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
217
|
+
detail,
|
|
218
|
+
bubbles: true,
|
|
219
|
+
composed: true
|
|
220
|
+
}));
|
|
221
|
+
}
|
|
222
|
+
_fileExtensionForMimeType(mimeType) {
|
|
223
|
+
switch (mimeType) {
|
|
224
|
+
case 'image/jpeg':
|
|
225
|
+
return 'jpg';
|
|
226
|
+
case 'image/webp':
|
|
227
|
+
return 'webp';
|
|
228
|
+
case 'image/gif':
|
|
229
|
+
return 'gif';
|
|
230
|
+
default:
|
|
231
|
+
return 'png';
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
_createFileFromBlob(blob) {
|
|
235
|
+
const contentType = blob.type || this.captureFormat || DEFAULT_CAPTURE_FORMAT;
|
|
236
|
+
const extension = this._fileExtensionForMimeType(contentType);
|
|
237
|
+
const safePrefix = (this.fileNamePrefix || this.name || 'photo').trim() || 'photo';
|
|
238
|
+
return new File([blob], `${safePrefix}-${Date.now()}.${extension}`, { type: contentType });
|
|
239
|
+
}
|
|
240
|
+
_queuePreviewStart() {
|
|
241
|
+
this._startPreview().catch(() => undefined);
|
|
242
|
+
}
|
|
243
|
+
_resolveMediaConstraints() {
|
|
244
|
+
if (this.mediaConstraints) {
|
|
245
|
+
return this.mediaConstraints;
|
|
246
|
+
}
|
|
247
|
+
if (this.constraints) {
|
|
248
|
+
try {
|
|
249
|
+
return JSON.parse(this.constraints);
|
|
250
|
+
}
|
|
251
|
+
catch (error) {
|
|
252
|
+
throw new Error(`Invalid constraints JSON: ${error.message}`);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return {
|
|
256
|
+
video: this.facingMode
|
|
257
|
+
? { facingMode: { ideal: this.facingMode } }
|
|
258
|
+
: true
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
async _startPreview() {
|
|
262
|
+
var _a, _b, _c;
|
|
263
|
+
if (!this.open || this.value || this._startingPreview)
|
|
264
|
+
return;
|
|
265
|
+
if (!((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.getUserMedia)) {
|
|
266
|
+
this._emitError(new Error('navigator.mediaDevices.getUserMedia not available'), 'Camera access is not available in this browser');
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
this._startingPreview = true;
|
|
270
|
+
this._errorMessage = '';
|
|
271
|
+
try {
|
|
272
|
+
const stream = await navigator.mediaDevices.getUserMedia(this._resolveMediaConstraints());
|
|
273
|
+
if (!this.open) {
|
|
274
|
+
stream.getTracks().forEach(track => track.stop());
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
this._stream = stream;
|
|
278
|
+
this.requestUpdate();
|
|
279
|
+
await this.updateComplete;
|
|
280
|
+
const video = (_b = this.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('video.capture-preview');
|
|
281
|
+
if (video) {
|
|
282
|
+
video.srcObject = stream;
|
|
283
|
+
await ((_c = video.play) === null || _c === void 0 ? void 0 : _c.call(video).catch(() => undefined));
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
catch (error) {
|
|
287
|
+
this._emitError(error, (error === null || error === void 0 ? void 0 : error.message) || 'Unable to start the camera preview');
|
|
288
|
+
}
|
|
289
|
+
finally {
|
|
290
|
+
this._startingPreview = false;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
_stopStream() {
|
|
294
|
+
var _a;
|
|
295
|
+
if (!this._stream)
|
|
296
|
+
return;
|
|
297
|
+
this._stream.getTracks().forEach(track => track.stop());
|
|
298
|
+
this._stream = null;
|
|
299
|
+
const video = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('video.capture-preview');
|
|
300
|
+
if (video) {
|
|
301
|
+
video.srcObject = null;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
_revokePreviewUrl() {
|
|
305
|
+
if (this._previewUrl) {
|
|
306
|
+
URL.revokeObjectURL(this._previewUrl);
|
|
307
|
+
}
|
|
308
|
+
this._previewUrl = '';
|
|
309
|
+
}
|
|
310
|
+
async _captureSnapshot() {
|
|
311
|
+
var _a;
|
|
312
|
+
const video = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('video.capture-preview');
|
|
313
|
+
if (!video)
|
|
314
|
+
return;
|
|
315
|
+
const width = video.videoWidth || video.clientWidth || 640;
|
|
316
|
+
const height = video.videoHeight || video.clientHeight || 480;
|
|
317
|
+
const canvas = document.createElement('canvas');
|
|
318
|
+
canvas.width = width;
|
|
319
|
+
canvas.height = height;
|
|
320
|
+
const context = canvas.getContext('2d');
|
|
321
|
+
if (!context) {
|
|
322
|
+
this._emitError(new Error('Canvas 2D context unavailable'), 'Unable to capture a photo in this browser');
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
context.drawImage(video, 0, 0, width, height);
|
|
326
|
+
const blob = await new Promise(resolve => {
|
|
327
|
+
canvas.toBlob(resolve, this.captureFormat || DEFAULT_CAPTURE_FORMAT, this.captureQuality);
|
|
328
|
+
});
|
|
329
|
+
if (!blob) {
|
|
330
|
+
this._emitError(new Error('Camera snapshot failed'), 'Unable to create an image from the current camera frame');
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
this.value = this._createFileFromBlob(blob);
|
|
334
|
+
this._errorMessage = '';
|
|
335
|
+
}
|
|
336
|
+
async _retakePhoto() {
|
|
337
|
+
this._clearValue({ emitEvents: true });
|
|
338
|
+
await this._startPreview();
|
|
339
|
+
}
|
|
340
|
+
_confirmPhoto() {
|
|
341
|
+
if (!this.value || !this._previewUrl)
|
|
342
|
+
return;
|
|
343
|
+
this._dispatchValueEvents();
|
|
344
|
+
this.dispatchEvent(new CustomEvent('photo-captured', {
|
|
345
|
+
detail: {
|
|
346
|
+
file: this.value,
|
|
347
|
+
blob: this.value,
|
|
348
|
+
objectUrl: this._previewUrl,
|
|
349
|
+
contentType: this.value.type || this.captureFormat || DEFAULT_CAPTURE_FORMAT
|
|
350
|
+
},
|
|
351
|
+
bubbles: true,
|
|
352
|
+
composed: true
|
|
353
|
+
}));
|
|
354
|
+
if (this.autoCloseOnCapture) {
|
|
355
|
+
this._setOpen(false);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
_handleCancel() {
|
|
359
|
+
this._stopStream();
|
|
360
|
+
this._clearValue({ emitEvents: false });
|
|
361
|
+
this._setOpen(false);
|
|
362
|
+
this.dispatchEvent(new CustomEvent('cancel', {
|
|
363
|
+
bubbles: true,
|
|
364
|
+
composed: true
|
|
365
|
+
}));
|
|
366
|
+
}
|
|
367
|
+
_openCapture() {
|
|
368
|
+
if (this.disabled)
|
|
369
|
+
return;
|
|
370
|
+
this._setOpen(true);
|
|
371
|
+
}
|
|
372
|
+
_renderViewport() {
|
|
373
|
+
if (this._previewUrl) {
|
|
374
|
+
return html `<img class="capture-preview" part="preview-image" src="${this._previewUrl}" alt="Captured photo preview" />`;
|
|
375
|
+
}
|
|
376
|
+
return html `<video class="capture-preview" part="preview-video" autoplay playsinline muted></video>`;
|
|
377
|
+
}
|
|
378
|
+
_renderStatus() {
|
|
379
|
+
if (this._errorMessage) {
|
|
380
|
+
return html `<div class="status error" part="error-message">${this._errorMessage}</div>`;
|
|
381
|
+
}
|
|
382
|
+
if (this._startingPreview) {
|
|
383
|
+
return html `<div class="status" part="status-message">Opening camera…</div>`;
|
|
384
|
+
}
|
|
385
|
+
if (!this.value) {
|
|
386
|
+
return html `<div class="status" part="status-message">Preview the camera and take a photo when ready.</div>`;
|
|
387
|
+
}
|
|
388
|
+
return html `<div class="status" part="status-message">Review the photo before confirming it.</div>`;
|
|
389
|
+
}
|
|
390
|
+
_renderActions() {
|
|
391
|
+
return html `
|
|
392
|
+
<div class="actions" part="actions">
|
|
393
|
+
${this.showCancelButton
|
|
394
|
+
? html `
|
|
395
|
+
<button
|
|
396
|
+
class="cancel-button"
|
|
397
|
+
part="cancel-button"
|
|
398
|
+
type="button"
|
|
399
|
+
@click="${this._handleCancel}"
|
|
400
|
+
>${this.cancelLabel}</button>
|
|
401
|
+
`
|
|
402
|
+
: nothing}
|
|
403
|
+
|
|
404
|
+
${this.value
|
|
405
|
+
? html `
|
|
406
|
+
<button
|
|
407
|
+
class="action-button"
|
|
408
|
+
part="retake-button"
|
|
409
|
+
type="button"
|
|
410
|
+
@click="${this._retakePhoto}"
|
|
411
|
+
>${this.retakeLabel}</button>
|
|
412
|
+
<button
|
|
413
|
+
class="action-button action-button--primary"
|
|
414
|
+
part="confirm-button"
|
|
415
|
+
type="button"
|
|
416
|
+
@click="${this._confirmPhoto}"
|
|
417
|
+
>${this.confirmLabel}</button>
|
|
418
|
+
`
|
|
419
|
+
: html `
|
|
420
|
+
<button
|
|
421
|
+
class="action-button action-button--primary"
|
|
422
|
+
part="capture-button"
|
|
423
|
+
type="button"
|
|
424
|
+
?disabled="${this._startingPreview || !this._stream}"
|
|
425
|
+
@click="${this._captureSnapshot}"
|
|
426
|
+
>${this.captureLabel}</button>
|
|
427
|
+
`}
|
|
428
|
+
</div>
|
|
429
|
+
`;
|
|
430
|
+
}
|
|
431
|
+
_renderPanel() {
|
|
432
|
+
return html `
|
|
433
|
+
<div class="panel" part="panel">
|
|
434
|
+
<div class="panel-header" part="header">
|
|
435
|
+
<h2 class="panel-heading" part="heading"><slot name="heading">${this.heading}</slot></h2>
|
|
436
|
+
${this.showCancelButton
|
|
437
|
+
? html `
|
|
438
|
+
<button
|
|
439
|
+
class="close-button"
|
|
440
|
+
part="close-button"
|
|
441
|
+
type="button"
|
|
442
|
+
aria-label="${this.cancelLabel}"
|
|
443
|
+
@click="${this._handleCancel}"
|
|
444
|
+
>×</button>
|
|
445
|
+
`
|
|
446
|
+
: nothing}
|
|
447
|
+
</div>
|
|
448
|
+
<div class="viewport" part="viewport">${this._renderViewport()}</div>
|
|
449
|
+
${this._renderStatus()}
|
|
450
|
+
${this._renderActions()}
|
|
451
|
+
</div>
|
|
452
|
+
`;
|
|
453
|
+
}
|
|
454
|
+
render() {
|
|
455
|
+
const trigger = this.showTrigger || this.presentation === 'dialog';
|
|
456
|
+
return html `
|
|
457
|
+
${trigger
|
|
458
|
+
? html `
|
|
459
|
+
<button
|
|
460
|
+
class="trigger-button"
|
|
461
|
+
part="trigger-button"
|
|
462
|
+
type="button"
|
|
463
|
+
?disabled="${this.disabled}"
|
|
464
|
+
@click="${this._openCapture}"
|
|
465
|
+
><slot>${this.label}</slot></button>
|
|
466
|
+
`
|
|
467
|
+
: nothing}
|
|
468
|
+
|
|
469
|
+
${this.presentation === 'dialog'
|
|
470
|
+
? html `
|
|
471
|
+
<dialog
|
|
472
|
+
class="dialog"
|
|
473
|
+
part="dialog"
|
|
474
|
+
aria-modal="true"
|
|
475
|
+
aria-label="${this.heading}"
|
|
476
|
+
@cancel="${(event) => { event.preventDefault(); this._handleCancel(); }}"
|
|
477
|
+
@click="${(event) => {
|
|
478
|
+
if (event.target === event.currentTarget) {
|
|
479
|
+
this._handleCancel();
|
|
480
|
+
}
|
|
481
|
+
}}"
|
|
482
|
+
>
|
|
483
|
+
${this.open ? this._renderPanel() : nothing}
|
|
484
|
+
</dialog>
|
|
485
|
+
`
|
|
486
|
+
: html `
|
|
487
|
+
<div class="inline-root" part="inline-root" ?hidden="${!this.open}">
|
|
488
|
+
${this.open ? this._renderPanel() : nothing}
|
|
489
|
+
</div>
|
|
490
|
+
`}
|
|
491
|
+
`;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
PhotoCapture.formAssociated = true;
|
|
495
|
+
PhotoCapture.properties = {
|
|
496
|
+
label: { type: String, reflect: true },
|
|
497
|
+
heading: { type: String, reflect: true },
|
|
498
|
+
captureLabel: { type: String, attribute: 'capture-label', reflect: true },
|
|
499
|
+
confirmLabel: { type: String, attribute: 'confirm-label', reflect: true },
|
|
500
|
+
retakeLabel: { type: String, attribute: 'retake-label', reflect: true },
|
|
501
|
+
cancelLabel: { type: String, attribute: 'cancel-label', reflect: true },
|
|
502
|
+
presentation: { type: String, reflect: true },
|
|
503
|
+
theme: { type: String, reflect: true },
|
|
504
|
+
facingMode: { type: String, attribute: 'facing-mode', reflect: true },
|
|
505
|
+
constraints: { type: String, reflect: true },
|
|
506
|
+
captureFormat: { type: String, attribute: 'capture-format', reflect: true },
|
|
507
|
+
captureQuality: { type: Number, attribute: 'capture-quality' },
|
|
508
|
+
open: { type: Boolean, reflect: true },
|
|
509
|
+
disabled: { type: Boolean, reflect: true },
|
|
510
|
+
name: { type: String, reflect: true },
|
|
511
|
+
required: { type: Boolean, reflect: true },
|
|
512
|
+
showTrigger: { type: Boolean, attribute: 'show-trigger', reflect: true },
|
|
513
|
+
showCancelButton: { type: Boolean, attribute: 'show-cancel-button', reflect: true },
|
|
514
|
+
autoCloseOnCapture: { type: Boolean, attribute: 'auto-close-on-capture' },
|
|
515
|
+
fileNamePrefix: { type: String, attribute: 'file-name-prefix', reflect: true },
|
|
516
|
+
value: { attribute: false },
|
|
517
|
+
mediaConstraints: { attribute: false },
|
|
518
|
+
_errorMessage: { state: true },
|
|
519
|
+
_previewUrl: { state: true },
|
|
520
|
+
_startingPreview: { state: true }
|
|
521
|
+
};
|
|
522
|
+
PhotoCapture.styles = css `
|
|
523
|
+
:host {
|
|
524
|
+
display: block;
|
|
525
|
+
--photo-capture-trigger-background: var(--lavender-900, #7c4cff);
|
|
526
|
+
--photo-capture-trigger-text: var(--color-header-text, #ffffff);
|
|
527
|
+
--photo-capture-surface: var(--color-background, #ffffff);
|
|
528
|
+
--photo-capture-text: var(--gray-900, #101828);
|
|
529
|
+
--photo-capture-muted-text: var(--gray-600, #4a5565);
|
|
530
|
+
--photo-capture-border: var(--gray-200, #e5e7eb);
|
|
531
|
+
--photo-capture-hover: var(--gray-100, #f3f4f6);
|
|
532
|
+
--photo-capture-shadow: var(--box-shadow-sm, 0 1px 4px rgba(0, 0, 0, 0.12));
|
|
533
|
+
--photo-capture-overlay: rgba(0, 0, 0, 0.6);
|
|
534
|
+
--photo-capture-frame-max-width: 260px;
|
|
535
|
+
--photo-capture-radius: 8px;
|
|
536
|
+
--photo-capture-button-radius: var(--border-radius-base, 0.3125rem);
|
|
537
|
+
--photo-capture-gap: var(--spacing-2xs, 0.625rem);
|
|
538
|
+
color: var(--photo-capture-text);
|
|
539
|
+
box-sizing: border-box;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
:host([theme='dark']) {
|
|
543
|
+
--photo-capture-surface: var(--gray-900, #111827);
|
|
544
|
+
--photo-capture-text: var(--white, #ffffff);
|
|
545
|
+
--photo-capture-muted-text: var(--gray-300, #d1d5dc);
|
|
546
|
+
--photo-capture-border: var(--gray-700, #364153);
|
|
547
|
+
--photo-capture-hover: rgba(255, 255, 255, 0.08);
|
|
548
|
+
--photo-capture-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
*, *::before, *::after {
|
|
552
|
+
box-sizing: border-box;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
.trigger-button,
|
|
556
|
+
.action-button,
|
|
557
|
+
.cancel-button,
|
|
558
|
+
.close-button {
|
|
559
|
+
font: inherit;
|
|
560
|
+
cursor: pointer;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
.trigger-button {
|
|
564
|
+
display: inline-flex;
|
|
565
|
+
align-items: center;
|
|
566
|
+
justify-content: center;
|
|
567
|
+
min-height: 35px;
|
|
568
|
+
padding: 0.5rem 0.9rem;
|
|
569
|
+
border: none;
|
|
570
|
+
border-radius: var(--photo-capture-button-radius);
|
|
571
|
+
background: var(--photo-capture-trigger-background);
|
|
572
|
+
color: var(--photo-capture-trigger-text);
|
|
573
|
+
transition: transform 0.2s ease;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
.trigger-button:active {
|
|
577
|
+
transform: translateY(1px);
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
.trigger-button:disabled,
|
|
581
|
+
.action-button:disabled,
|
|
582
|
+
.cancel-button:disabled {
|
|
583
|
+
opacity: 0.55;
|
|
584
|
+
cursor: not-allowed;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
.inline-root[hidden] {
|
|
588
|
+
display: none;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
.dialog {
|
|
592
|
+
border: none;
|
|
593
|
+
padding: 0;
|
|
594
|
+
background: transparent;
|
|
595
|
+
outline: none;
|
|
596
|
+
overflow: visible;
|
|
597
|
+
max-width: none;
|
|
598
|
+
max-height: none;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.dialog::backdrop {
|
|
602
|
+
background: var(--photo-capture-overlay);
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
.panel {
|
|
606
|
+
position: relative;
|
|
607
|
+
display: flex;
|
|
608
|
+
flex-direction: column;
|
|
609
|
+
align-items: center;
|
|
610
|
+
gap: var(--photo-capture-gap);
|
|
611
|
+
width: min(100%, 340px);
|
|
612
|
+
padding: 1rem;
|
|
613
|
+
border: 1px solid var(--photo-capture-border);
|
|
614
|
+
border-radius: var(--photo-capture-radius);
|
|
615
|
+
background: var(--photo-capture-surface);
|
|
616
|
+
color: var(--photo-capture-text);
|
|
617
|
+
box-shadow: var(--photo-capture-shadow);
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
.panel-header {
|
|
621
|
+
display: flex;
|
|
622
|
+
align-items: center;
|
|
623
|
+
justify-content: space-between;
|
|
624
|
+
gap: 0.5rem;
|
|
625
|
+
width: 100%;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
.panel-heading {
|
|
629
|
+
margin: 0;
|
|
630
|
+
font-size: 1rem;
|
|
631
|
+
font-weight: 700;
|
|
632
|
+
line-height: 1.4;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
.close-button {
|
|
636
|
+
display: inline-flex;
|
|
637
|
+
align-items: center;
|
|
638
|
+
justify-content: center;
|
|
639
|
+
width: 1.75rem;
|
|
640
|
+
height: 1.75rem;
|
|
641
|
+
padding: 0;
|
|
642
|
+
border: none;
|
|
643
|
+
border-radius: 999px;
|
|
644
|
+
background: transparent;
|
|
645
|
+
color: var(--photo-capture-muted-text);
|
|
646
|
+
font-size: 1.125rem;
|
|
647
|
+
line-height: 1;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
.close-button:hover,
|
|
651
|
+
.close-button:focus-visible,
|
|
652
|
+
.action-button:hover,
|
|
653
|
+
.action-button:focus-visible,
|
|
654
|
+
.cancel-button:hover,
|
|
655
|
+
.cancel-button:focus-visible {
|
|
656
|
+
background: var(--photo-capture-hover);
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
.viewport {
|
|
660
|
+
display: flex;
|
|
661
|
+
align-items: center;
|
|
662
|
+
justify-content: center;
|
|
663
|
+
width: 100%;
|
|
664
|
+
min-height: 200px;
|
|
665
|
+
border-radius: 0.5rem;
|
|
666
|
+
overflow: hidden;
|
|
667
|
+
background: color-mix(in srgb, var(--photo-capture-surface) 92%, #000 8%);
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
.viewport video,
|
|
671
|
+
.viewport img {
|
|
672
|
+
display: block;
|
|
673
|
+
width: 100%;
|
|
674
|
+
max-width: var(--photo-capture-frame-max-width);
|
|
675
|
+
height: auto;
|
|
676
|
+
border-radius: 0.5rem;
|
|
677
|
+
margin: 0 auto;
|
|
678
|
+
object-fit: cover;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
.status {
|
|
682
|
+
width: 100%;
|
|
683
|
+
text-align: center;
|
|
684
|
+
color: var(--photo-capture-muted-text);
|
|
685
|
+
font-size: 0.875rem;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
.status.error {
|
|
689
|
+
color: var(--color-error, #b00020);
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
.actions {
|
|
693
|
+
display: flex;
|
|
694
|
+
align-items: center;
|
|
695
|
+
justify-content: center;
|
|
696
|
+
flex-wrap: wrap;
|
|
697
|
+
gap: var(--photo-capture-gap);
|
|
698
|
+
width: 100%;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
.action-button,
|
|
702
|
+
.cancel-button {
|
|
703
|
+
display: inline-flex;
|
|
704
|
+
align-items: center;
|
|
705
|
+
justify-content: center;
|
|
706
|
+
min-height: 2.25rem;
|
|
707
|
+
padding: 0.45rem 0.85rem;
|
|
708
|
+
border-radius: var(--photo-capture-button-radius);
|
|
709
|
+
border: 1px solid var(--photo-capture-border);
|
|
710
|
+
background: var(--photo-capture-surface);
|
|
711
|
+
color: var(--photo-capture-text);
|
|
712
|
+
font-size: var(--font-size-xxs, 0.75rem);
|
|
713
|
+
font-weight: var(--font-weight-xbold, 700);
|
|
714
|
+
line-height: 1.5;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
.action-button--primary {
|
|
718
|
+
background: var(--photo-capture-trigger-background);
|
|
719
|
+
color: var(--photo-capture-trigger-text);
|
|
720
|
+
border-color: transparent;
|
|
721
|
+
}
|
|
722
|
+
`;
|
|
723
|
+
//# sourceMappingURL=PhotoCapture.js.map
|