veryfi-lens-wasm 3.3.3 → 3.4.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 +27 -6
- package/components/captureButton.js +6 -7
- package/components/desktopModeModal.js +11 -6
- package/components/exitButton.js +6 -7
- package/components/liquid-glass.js +38 -0
- package/components/mirrorButton.js +6 -6
- package/components/modalBase.js +24 -7
- package/components/prescriptionLabelGuide.js +3 -2
- package/components/prescriptionOverlayToggleButton.js +9 -6
- package/components/reviewGallery.js +815 -0
- package/components/submitButton.js +3 -3
- package/components/switchCameraButton.js +6 -6
- package/components/torchButton.js +6 -6
- package/core/api.js +17 -8
- package/core/camera.js +14 -9
- package/core/capture/document.js +6 -82
- package/core/capture/index.js +0 -1
- package/core/capture/prescription_label.js +113 -307
- package/core/capture-store.js +174 -0
- package/core/constants.js +13 -2
- package/core/crop-field-detection.js +60 -2
- package/core/lifecycle.js +5 -3
- package/core/overlay-controls.js +0 -4
- package/core/review-flow.js +251 -0
- package/core/state.js +41 -8
- package/core/ui-renderer.js +24 -10
- package/flavors/anydocs.js +9 -2
- package/flavors/document.js +7 -0
- package/flavors/prescription_label.js +12 -1
- package/package.json +1 -1
- package/veryfi-lens.js +14 -0
- package/components/anydocPageControls.js +0 -263
- package/components/gallery.js +0 -136
- package/components/multiCaptureModal.js +0 -23
- package/core/capture/anydoc.js +0 -98
- package/core/multi-submission.js +0 -90
package/README.md
CHANGED
|
@@ -195,18 +195,33 @@ VeryfiLens.onFailure((error) => { /* error occurred */ });
|
|
|
195
195
|
|---|---|---|---|
|
|
196
196
|
| `enableLongReceiptPreview` | `boolean` | `false` | Show stitching preview panel |
|
|
197
197
|
|
|
198
|
+
### Review Gallery Settings
|
|
199
|
+
|
|
200
|
+
After each accepted capture, the `document`, `anydocs`, and `prescription_label` flavors show a unified **review gallery** where the user can review, retake, delete, add pages/documents, and submit. For single-document/single-page captures it collapses to a simple Retake / Submit preview. On submit, one package (a zip of its pages) is uploaded per document via `/api/document`, then `finishBatch()` runs.
|
|
201
|
+
|
|
202
|
+
| Option | Type | Default | Description |
|
|
203
|
+
|---|---|---|---|
|
|
204
|
+
| `maxPagesPerDocument` | `number\|null` | flavor-specific | Max pages per document (`null` = unlimited). `1` hides "Add Page". Defaults: document `1`, anydocs `null`, prescription boxes = box max sides |
|
|
205
|
+
| `maxDocuments` | `number\|null` | `1` (or `null` when `multiSubmission`) | Max documents per session. `1` hides "Add Document" |
|
|
206
|
+
| `reviewGalleryTitle` | `string` | `"Review"` | Gallery title |
|
|
207
|
+
| `reviewAddPageText` | `string` | `"Add Page"` | Add page action text |
|
|
208
|
+
| `reviewAddDocumentText` | `string` | `"Add Document"` | Add document action text |
|
|
209
|
+
| `reviewSubmitText` | `string` | `"Submit"` | Submit action text |
|
|
210
|
+
| `reviewDoneText` | `string` | `"Done"` | Done action text |
|
|
211
|
+
| `reviewRetakeText` | `string` | `"Retake"` | Retake action text |
|
|
212
|
+
| `reviewDeleteText` | `string` | `"Delete"` | Delete action text |
|
|
213
|
+
|
|
198
214
|
### Anydocs Multi-Page Settings
|
|
199
215
|
|
|
200
216
|
| Option | Type | Default | Description |
|
|
201
217
|
|---|---|---|---|
|
|
202
218
|
| `enableBlueprintsModal` | `boolean` | `false` | Show blueprints selection modal |
|
|
203
219
|
| `selectedBlueprint` | `string` | — | Pre-selected blueprint (skips modal) |
|
|
204
|
-
| `anydocMaxPages` | `number\|null` | `null` |
|
|
205
|
-
| `anydocAddPageText` | `string` | `"Add Page"` |
|
|
206
|
-
| `anydocSubmitText` | `string` | `"Submit"` |
|
|
207
|
-
| `
|
|
208
|
-
| `
|
|
209
|
-
| `anydocFlipContinueText` | `string` | `"Continue"` | Continue button text |
|
|
220
|
+
| `anydocMaxPages` | `number\|null` | `null` | _Deprecated:_ alias for `maxPagesPerDocument` |
|
|
221
|
+
| `anydocAddPageText` | `string` | `"Add Page"` | _Deprecated:_ alias for `reviewAddPageText` |
|
|
222
|
+
| `anydocSubmitText` | `string` | `"Submit"` | _Deprecated:_ alias for `reviewSubmitText` |
|
|
223
|
+
| `anydocShowGuide` | `boolean` | `false` | Show a dismissible on-screen text guide explaining how to capture. Auto-hides after each page capture and reappears when the camera restarts for the next page |
|
|
224
|
+
| `anydocGuideText` | `string` | `"Position the document within the frame..."` | Guide text shown for anydocs capture. Use `\n` for line breaks |
|
|
210
225
|
|
|
211
226
|
### Bottle Cap Settings (`caps` flavor)
|
|
212
227
|
|
|
@@ -240,6 +255,12 @@ VeryfiLens.onFailure((error) => { /* error occurred */ });
|
|
|
240
255
|
| `prescriptionLabelShowOverlayToggle` | `boolean` | `true` | Show a toggle that lets the user switch between the bottle and box overlays during capture. The **bottle** overlay records a video; the **box** overlay captures a still image |
|
|
241
256
|
| `prescriptionLabelBottleLabel` | `string` | `"Bottle"` | Label for the bottle (video) segment of the overlay toggle |
|
|
242
257
|
| `prescriptionLabelBoxLabel` | `string` | `"Box"` | Label for the box (image) segment of the overlay toggle |
|
|
258
|
+
| `prescriptionLabelBoxMultiSide` | `boolean` | `true` | When capturing with the box overlay, allow multiple sides of the same box. Sides become pages of one document, managed in the review gallery ("Add Page"). Sets the default `maxPagesPerDocument` to `prescriptionLabelBoxMaxSides` |
|
|
259
|
+
| `prescriptionLabelBoxMaxSides` | `number` | `4` | Maximum number of sides (pages) that can be captured for a single box (feeds `maxPagesPerDocument`) |
|
|
260
|
+
| `prescriptionLabelBoxSideMessage` | `string` | `"Capture another side of the box?"` | _Deprecated:_ the review gallery replaced the "another side" prompt |
|
|
261
|
+
| `prescriptionLabelBoxSideAddText` | `string` | `"Capture another side"` | _Deprecated:_ use `reviewAddPageText` |
|
|
262
|
+
| `prescriptionLabelBoxSideSubmitText` | `string` | `"Submit"` | _Deprecated:_ use `reviewSubmitText` |
|
|
263
|
+
| `prescriptionLabelMaxVideoDuration` | `number` | `12` | Maximum length, in seconds, of a bottle (video) capture. When reached, recording stops automatically. An on-screen countdown is shown while recording. Set to `0` to disable the limit |
|
|
243
264
|
|
|
244
265
|
### Upload Settings (`upload` flavor)
|
|
245
266
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { LIQUID_GLASS, liquidGlassStyles } from './liquid-glass.js';
|
|
2
|
+
|
|
1
3
|
export const createCaptureButton = (container, onCapture, onStopStitching) => {
|
|
2
4
|
const button = document.createElement('button');
|
|
3
5
|
button.id = 'veryfi-capture-button';
|
|
@@ -10,17 +12,14 @@ export const createCaptureButton = (container, onCapture, onStopStitching) => {
|
|
|
10
12
|
width: '4rem',
|
|
11
13
|
height: '4rem',
|
|
12
14
|
borderRadius: '50%',
|
|
13
|
-
border: '3px solid rgba(255, 255, 255, 0.4)',
|
|
14
|
-
backgroundColor: 'rgba(255, 255, 255, 0.15)',
|
|
15
15
|
cursor: 'pointer',
|
|
16
16
|
zIndex: '1000',
|
|
17
|
-
transition: 'background-color 0.3s ease',
|
|
17
|
+
transition: 'background-color 0.3s ease, box-shadow 0.3s ease',
|
|
18
18
|
padding: '0',
|
|
19
19
|
outline: 'none',
|
|
20
20
|
pointerEvents: 'auto',
|
|
21
|
-
backdropFilter: 'blur(2px)',
|
|
22
|
-
WebkitBackdropFilter: 'blur(2px)',
|
|
23
21
|
boxSizing: 'border-box',
|
|
22
|
+
...liquidGlassStyles({ border: '3px solid rgba(255, 255, 255, 0.55)' }),
|
|
24
23
|
};
|
|
25
24
|
|
|
26
25
|
Object.entries(defaultStyles).forEach(([key, value]) => {
|
|
@@ -47,11 +46,11 @@ export const createCaptureButton = (container, onCapture, onStopStitching) => {
|
|
|
47
46
|
|
|
48
47
|
// Add hover effect
|
|
49
48
|
button.addEventListener('mouseenter', () => {
|
|
50
|
-
button.style.backgroundColor =
|
|
49
|
+
button.style.backgroundColor = `var(--capture-button-hover-background-color, ${LIQUID_GLASS.hoverBackgroundColor})`;
|
|
51
50
|
});
|
|
52
51
|
|
|
53
52
|
button.addEventListener('mouseleave', () => {
|
|
54
|
-
button.style.backgroundColor =
|
|
53
|
+
button.style.backgroundColor = `var(--capture-button-background-color, ${LIQUID_GLASS.backgroundColor})`;
|
|
55
54
|
});
|
|
56
55
|
|
|
57
56
|
let isStitching = false;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { LIQUID_GLASS } from './liquid-glass.js';
|
|
2
|
+
|
|
1
3
|
const WIDE_VIEWPORT_THRESHOLD = 900;
|
|
2
4
|
const MODAL_ID = 'veryfi-desktop-mode-modal';
|
|
3
5
|
const STYLE_ID = 'veryfi-desktop-mode-modal-styles';
|
|
@@ -61,11 +63,13 @@ const ensureStyles = () => {
|
|
|
61
63
|
position: relative;
|
|
62
64
|
width: 100%;
|
|
63
65
|
max-width: 420px;
|
|
64
|
-
background:
|
|
66
|
+
background: ${LIQUID_GLASS.darkPanelBackground};
|
|
67
|
+
backdrop-filter: ${LIQUID_GLASS.blur};
|
|
68
|
+
-webkit-backdrop-filter: ${LIQUID_GLASS.blur};
|
|
65
69
|
color: #ffffff;
|
|
66
|
-
border-radius:
|
|
67
|
-
border:
|
|
68
|
-
box-shadow:
|
|
70
|
+
border-radius: 20px;
|
|
71
|
+
border: ${LIQUID_GLASS.darkBorder};
|
|
72
|
+
box-shadow: ${LIQUID_GLASS.darkPanelBoxShadow};
|
|
69
73
|
padding: 24px;
|
|
70
74
|
box-sizing: border-box;
|
|
71
75
|
}
|
|
@@ -118,12 +122,13 @@ const ensureStyles = () => {
|
|
|
118
122
|
#${MODAL_ID} .veryfi-dm-reload {
|
|
119
123
|
width: 100%;
|
|
120
124
|
padding: 12px 16px;
|
|
121
|
-
border-radius:
|
|
125
|
+
border-radius: 12px;
|
|
122
126
|
background: #10b981;
|
|
123
127
|
color: #0f172a;
|
|
124
128
|
font-weight: 600;
|
|
125
129
|
font-size: 14px;
|
|
126
|
-
border:
|
|
130
|
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
131
|
+
box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.5);
|
|
127
132
|
cursor: pointer;
|
|
128
133
|
transition: background-color 0.15s;
|
|
129
134
|
}
|
package/components/exitButton.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { LIQUID_GLASS, liquidGlassStyles } from './liquid-glass.js';
|
|
2
|
+
|
|
1
3
|
export const createExitButton = (container, options, removeOverlay) => {
|
|
2
4
|
const { setter, redirectUrl, lensFlavor } = options;
|
|
3
5
|
|
|
@@ -9,14 +11,13 @@ export const createExitButton = (container, options, removeOverlay) => {
|
|
|
9
11
|
position: 'absolute',
|
|
10
12
|
bottom: '50px',
|
|
11
13
|
left: '115px',
|
|
12
|
-
backgroundColor: 'rgba(255, 255, 255, 0.15)',
|
|
13
14
|
color: 'white',
|
|
14
15
|
fontWeight: 'bold',
|
|
15
16
|
borderRadius: '50%',
|
|
16
17
|
textDecoration: 'none',
|
|
17
18
|
zIndex: '1000',
|
|
18
19
|
cursor: 'pointer',
|
|
19
|
-
transition: 'background-color 0.3s ease',
|
|
20
|
+
transition: 'background-color 0.3s ease, box-shadow 0.3s ease',
|
|
20
21
|
width: '40px',
|
|
21
22
|
height: '40px',
|
|
22
23
|
display: 'flex',
|
|
@@ -24,7 +25,6 @@ export const createExitButton = (container, options, removeOverlay) => {
|
|
|
24
25
|
alignItems: 'center',
|
|
25
26
|
justifyContent: 'center',
|
|
26
27
|
pointerEvents: 'auto',
|
|
27
|
-
border: '1px solid rgba(255, 255, 255, 0.4)',
|
|
28
28
|
outline: 'none',
|
|
29
29
|
boxSizing: 'border-box',
|
|
30
30
|
margin: '0',
|
|
@@ -33,8 +33,7 @@ export const createExitButton = (container, options, removeOverlay) => {
|
|
|
33
33
|
minHeight: '40px',
|
|
34
34
|
maxWidth: '40px',
|
|
35
35
|
maxHeight: '40px',
|
|
36
|
-
|
|
37
|
-
WebkitBackdropFilter: 'blur(8px)',
|
|
36
|
+
...liquidGlassStyles(),
|
|
38
37
|
};
|
|
39
38
|
|
|
40
39
|
Object.entries(defaultStyles).forEach(([key, value]) => {
|
|
@@ -70,11 +69,11 @@ export const createExitButton = (container, options, removeOverlay) => {
|
|
|
70
69
|
}
|
|
71
70
|
|
|
72
71
|
button.addEventListener('mouseenter', () => {
|
|
73
|
-
button.style.backgroundColor =
|
|
72
|
+
button.style.backgroundColor = LIQUID_GLASS.hoverBackgroundColor;
|
|
74
73
|
});
|
|
75
74
|
|
|
76
75
|
button.addEventListener('mouseleave', () => {
|
|
77
|
-
button.style.backgroundColor =
|
|
76
|
+
button.style.backgroundColor = LIQUID_GLASS.backgroundColor;
|
|
78
77
|
});
|
|
79
78
|
|
|
80
79
|
button.addEventListener('click', (e) => {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Shared "liquid glass" design tokens for every glassy surface in the SDK
|
|
2
|
+
// (on-camera control buttons, segmented toggles and modal panels). Centralized
|
|
3
|
+
// so the look stays consistent and can be tuned from a single place.
|
|
4
|
+
|
|
5
|
+
export const LIQUID_GLASS = {
|
|
6
|
+
// Translucent fill for dark-on-camera controls (idle / hover / active).
|
|
7
|
+
backgroundColor: 'rgba(255, 255, 255, 0.12)',
|
|
8
|
+
hoverBackgroundColor: 'rgba(255, 255, 255, 0.24)',
|
|
9
|
+
activeBackgroundColor: 'rgba(255, 255, 255, 0.34)',
|
|
10
|
+
// Frosted panel fill for light modals (dark content sits on top).
|
|
11
|
+
panelBackground: 'rgba(250, 250, 252, 0.72)',
|
|
12
|
+
// Dark frosted panel fill for warning / system modals.
|
|
13
|
+
darkPanelBackground: 'rgba(30, 41, 59, 0.72)',
|
|
14
|
+
// Heavy blur + saturation is what produces the "liquid" refraction.
|
|
15
|
+
blur: 'blur(18px) saturate(180%)',
|
|
16
|
+
// Bright hairline edge.
|
|
17
|
+
border: '1px solid rgba(255, 255, 255, 0.5)',
|
|
18
|
+
darkBorder: '1px solid rgba(255, 255, 255, 0.14)',
|
|
19
|
+
// Outer float shadow + inner specular highlights (bright top, soft bottom).
|
|
20
|
+
boxShadow:
|
|
21
|
+
'0 8px 32px rgba(0, 0, 0, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.65), inset 0 -2px 6px rgba(255, 255, 255, 0.12)',
|
|
22
|
+
panelBoxShadow:
|
|
23
|
+
'0 16px 48px rgba(0, 0, 0, 0.28), inset 0 1px 1px rgba(255, 255, 255, 0.85), inset 0 -2px 8px rgba(255, 255, 255, 0.22)',
|
|
24
|
+
darkPanelBoxShadow:
|
|
25
|
+
'0 16px 48px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.22), inset 0 -2px 8px rgba(0, 0, 0, 0.25)',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// Inline-style fragment for on-camera glass controls (buttons, toggles).
|
|
29
|
+
// Spread into a component's defaultStyles; pass overrides (e.g. a thicker
|
|
30
|
+
// border for the capture ring) to customize per control.
|
|
31
|
+
export const liquidGlassStyles = (overrides = {}) => ({
|
|
32
|
+
backgroundColor: LIQUID_GLASS.backgroundColor,
|
|
33
|
+
backdropFilter: LIQUID_GLASS.blur,
|
|
34
|
+
WebkitBackdropFilter: LIQUID_GLASS.blur,
|
|
35
|
+
border: LIQUID_GLASS.border,
|
|
36
|
+
boxShadow: LIQUID_GLASS.boxShadow,
|
|
37
|
+
...overrides,
|
|
38
|
+
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { LIQUID_GLASS, liquidGlassStyles } from './liquid-glass.js';
|
|
2
|
+
|
|
1
3
|
export const createMirrorButton = (container, toggleCallback) => {
|
|
2
4
|
const button = document.createElement('button');
|
|
3
5
|
button.id = 'veryfi-mirror-button';
|
|
@@ -5,7 +7,6 @@ export const createMirrorButton = (container, toggleCallback) => {
|
|
|
5
7
|
const defaultStyles = {
|
|
6
8
|
width: '40px',
|
|
7
9
|
height: '40px',
|
|
8
|
-
backgroundColor: 'rgba(255, 255, 255, 0.15)',
|
|
9
10
|
color: '#FFFFFF',
|
|
10
11
|
borderRadius: '50%',
|
|
11
12
|
position: 'absolute',
|
|
@@ -18,7 +19,6 @@ export const createMirrorButton = (container, toggleCallback) => {
|
|
|
18
19
|
padding: '0',
|
|
19
20
|
cursor: 'pointer',
|
|
20
21
|
pointerEvents: 'auto',
|
|
21
|
-
border: '1px solid rgba(255, 255, 255, 0.4)',
|
|
22
22
|
outline: 'none',
|
|
23
23
|
boxSizing: 'border-box',
|
|
24
24
|
margin: '0',
|
|
@@ -26,8 +26,8 @@ export const createMirrorButton = (container, toggleCallback) => {
|
|
|
26
26
|
minHeight: '40px',
|
|
27
27
|
maxWidth: '40px',
|
|
28
28
|
maxHeight: '40px',
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
transition: 'background-color 0.3s ease, box-shadow 0.3s ease',
|
|
30
|
+
...liquidGlassStyles(),
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
Object.entries(defaultStyles).forEach(([key, value]) => {
|
|
@@ -35,10 +35,10 @@ export const createMirrorButton = (container, toggleCallback) => {
|
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
button.addEventListener('mouseover', () => {
|
|
38
|
-
button.style.backgroundColor =
|
|
38
|
+
button.style.backgroundColor = LIQUID_GLASS.hoverBackgroundColor;
|
|
39
39
|
});
|
|
40
40
|
button.addEventListener('mouseout', () => {
|
|
41
|
-
button.style.backgroundColor =
|
|
41
|
+
button.style.backgroundColor = LIQUID_GLASS.backgroundColor;
|
|
42
42
|
});
|
|
43
43
|
|
|
44
44
|
button.addEventListener('click', toggleCallback);
|
package/components/modalBase.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { LIQUID_GLASS } from './liquid-glass.js';
|
|
2
|
+
|
|
1
3
|
const DEFAULT_STYLES = {
|
|
2
4
|
position: 'fixed',
|
|
3
5
|
width: '300px',
|
|
@@ -6,8 +8,8 @@ const DEFAULT_STYLES = {
|
|
|
6
8
|
justifyContent: 'center',
|
|
7
9
|
alignItems: 'center',
|
|
8
10
|
zIndex: '1000',
|
|
9
|
-
backgroundColor:
|
|
10
|
-
borderRadius: '
|
|
11
|
+
backgroundColor: LIQUID_GLASS.panelBackground,
|
|
12
|
+
borderRadius: '20px',
|
|
11
13
|
padding: '24px 28px',
|
|
12
14
|
maxWidth: '300px',
|
|
13
15
|
textColor: '#1e293b',
|
|
@@ -21,9 +23,13 @@ const DEFAULT_STYLES = {
|
|
|
21
23
|
buttonFontWeight: '700',
|
|
22
24
|
primaryButtonBackground: '#00AA00',
|
|
23
25
|
primaryButtonColor: 'white',
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
primaryButtonBoxShadow: LIQUID_GLASS.boxShadow,
|
|
27
|
+
secondaryButtonBackground: 'rgba(255, 255, 255, 0.45)',
|
|
28
|
+
secondaryButtonBorder: '1px solid rgba(0, 0, 0, 0.12)',
|
|
29
|
+
secondaryButtonColor: '#1e293b',
|
|
30
|
+
panelBackdropFilter: LIQUID_GLASS.blur,
|
|
31
|
+
panelBorder: '1px solid rgba(255, 255, 255, 0.6)',
|
|
32
|
+
panelBoxShadow: LIQUID_GLASS.panelBoxShadow,
|
|
27
33
|
};
|
|
28
34
|
|
|
29
35
|
export const createModal = (container, {
|
|
@@ -86,6 +92,13 @@ export const createModal = (container, {
|
|
|
86
92
|
modal.style.transform = `var(--modal-transform, ${s.transform})`;
|
|
87
93
|
}
|
|
88
94
|
|
|
95
|
+
const glassPanelStyle = `
|
|
96
|
+
backdrop-filter: var(--${cssPrefix}-panel-backdrop-filter, ${s.panelBackdropFilter});
|
|
97
|
+
-webkit-backdrop-filter: var(--${cssPrefix}-panel-backdrop-filter, ${s.panelBackdropFilter});
|
|
98
|
+
border: var(--${cssPrefix}-panel-border, ${s.panelBorder});
|
|
99
|
+
box-shadow: var(--${cssPrefix}-panel-box-shadow, ${s.panelBoxShadow});
|
|
100
|
+
`;
|
|
101
|
+
|
|
89
102
|
const contentStyle = useBackdrop ? `
|
|
90
103
|
background-color: var(--${cssPrefix}-background-color, ${s.backgroundColor});
|
|
91
104
|
border-radius: var(--${cssPrefix}-border-radius, ${s.borderRadius});
|
|
@@ -97,13 +110,14 @@ export const createModal = (container, {
|
|
|
97
110
|
display: flex;
|
|
98
111
|
flex-direction: column;
|
|
99
112
|
align-items: stretch;
|
|
100
|
-
|
|
113
|
+
${glassPanelStyle}
|
|
101
114
|
` : `
|
|
102
115
|
background-color: var(--${cssPrefix}-background-color, ${s.backgroundColor});
|
|
103
116
|
border-radius: var(--${cssPrefix}-border-radius, ${s.borderRadius});
|
|
104
117
|
padding: var(--${cssPrefix}-padding, ${s.padding});
|
|
105
118
|
width: var(--${cssPrefix}-width, ${s.width});
|
|
106
119
|
max-width: var(--${cssPrefix}-max-width, ${s.maxWidth});
|
|
120
|
+
${glassPanelStyle}
|
|
107
121
|
`;
|
|
108
122
|
|
|
109
123
|
const btnWidth = useBackdrop ? 'width: 100%;' : `width: var(--${cssPrefix}-button-width, ${s.buttonWidth});`;
|
|
@@ -130,7 +144,8 @@ export const createModal = (container, {
|
|
|
130
144
|
border-radius: var(--${cssPrefix}-button-border-radius, ${s.buttonBorderRadius});
|
|
131
145
|
background-color: var(--${cssPrefix}-primary-button-background, ${s.primaryButtonBackground});
|
|
132
146
|
color: var(--${cssPrefix}-primary-button-color, ${s.primaryButtonColor});
|
|
133
|
-
border:
|
|
147
|
+
border: var(--${cssPrefix}-primary-button-border, ${LIQUID_GLASS.border});
|
|
148
|
+
box-shadow: var(--${cssPrefix}-primary-button-box-shadow, ${s.primaryButtonBoxShadow});
|
|
134
149
|
cursor: pointer;
|
|
135
150
|
font-weight: var(--${cssPrefix}-button-font-weight, ${s.buttonFontWeight});
|
|
136
151
|
font-family: var(--${cssPrefix}-button-font-family, ${s.buttonFontFamily});
|
|
@@ -149,6 +164,8 @@ export const createModal = (container, {
|
|
|
149
164
|
background-color: var(--${cssPrefix}-secondary-button-background, ${s.secondaryButtonBackground});
|
|
150
165
|
color: var(--${cssPrefix}-secondary-button-color, ${s.secondaryButtonColor});
|
|
151
166
|
border: var(--${cssPrefix}-secondary-button-border, ${s.secondaryButtonBorder});
|
|
167
|
+
backdrop-filter: blur(8px);
|
|
168
|
+
-webkit-backdrop-filter: blur(8px);
|
|
152
169
|
cursor: pointer;
|
|
153
170
|
font-weight: var(--${cssPrefix}-button-font-weight, ${s.buttonFontWeight});
|
|
154
171
|
font-family: var(--${cssPrefix}-button-font-family, ${s.buttonFontFamily});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export const createPrescriptionLabelGuide = (container, options = {}) => {
|
|
2
2
|
const text = options.text || '';
|
|
3
|
+
const id = options.id || 'veryfi-prescription-label-guide';
|
|
3
4
|
|
|
4
5
|
const guide = document.createElement('div');
|
|
5
|
-
guide.id =
|
|
6
|
+
guide.id = id;
|
|
6
7
|
|
|
7
8
|
Object.assign(guide.style, {
|
|
8
9
|
position: 'absolute',
|
|
@@ -33,7 +34,7 @@ export const createPrescriptionLabelGuide = (container, options = {}) => {
|
|
|
33
34
|
guide.appendChild(textEl);
|
|
34
35
|
|
|
35
36
|
const closeButton = document.createElement('button');
|
|
36
|
-
closeButton.id =
|
|
37
|
+
closeButton.id = `${id}-close`;
|
|
37
38
|
closeButton.setAttribute('aria-label', 'Close guide');
|
|
38
39
|
closeButton.textContent = '\u00D7';
|
|
39
40
|
Object.assign(closeButton.style, {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { LIQUID_GLASS, liquidGlassStyles } from './liquid-glass.js';
|
|
2
|
+
|
|
1
3
|
export const createPrescriptionOverlayToggleButton = (container, options = {}) => {
|
|
2
4
|
const bottleLabel = options.bottleLabel || 'Bottle';
|
|
3
5
|
const boxLabel = options.boxLabel || 'Box';
|
|
@@ -14,13 +16,10 @@ export const createPrescriptionOverlayToggleButton = (container, options = {}) =
|
|
|
14
16
|
display: 'flex',
|
|
15
17
|
gap: '4px',
|
|
16
18
|
padding: '4px',
|
|
17
|
-
backgroundColor: 'rgba(255, 255, 255, 0.15)',
|
|
18
|
-
border: '1px solid rgba(255, 255, 255, 0.4)',
|
|
19
19
|
borderRadius: '25px',
|
|
20
|
-
backdropFilter: 'blur(8px)',
|
|
21
|
-
WebkitBackdropFilter: 'blur(8px)',
|
|
22
20
|
zIndex: '1004',
|
|
23
21
|
pointerEvents: 'auto',
|
|
22
|
+
...liquidGlassStyles(),
|
|
24
23
|
});
|
|
25
24
|
|
|
26
25
|
const makeSegment = (label, type) => {
|
|
@@ -39,7 +38,7 @@ export const createPrescriptionOverlayToggleButton = (container, options = {}) =
|
|
|
39
38
|
fontFamily: "system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",
|
|
40
39
|
color: 'white',
|
|
41
40
|
backgroundColor: 'transparent',
|
|
42
|
-
transition: 'background-color 0.2s ease',
|
|
41
|
+
transition: 'background-color 0.2s ease, box-shadow 0.2s ease',
|
|
43
42
|
});
|
|
44
43
|
btn.addEventListener('click', () => {
|
|
45
44
|
if (active === type) return;
|
|
@@ -55,7 +54,11 @@ export const createPrescriptionOverlayToggleButton = (container, options = {}) =
|
|
|
55
54
|
|
|
56
55
|
const updateSegments = () => {
|
|
57
56
|
[[bottleBtn, 'bottle'], [boxBtn, 'box']].forEach(([btn, type]) => {
|
|
58
|
-
|
|
57
|
+
const isActive = active === type;
|
|
58
|
+
btn.style.backgroundColor = isActive ? LIQUID_GLASS.activeBackgroundColor : 'transparent';
|
|
59
|
+
btn.style.boxShadow = isActive
|
|
60
|
+
? 'inset 0 1px 1px rgba(255, 255, 255, 0.6), 0 2px 8px rgba(0, 0, 0, 0.12)'
|
|
61
|
+
: 'none';
|
|
59
62
|
});
|
|
60
63
|
};
|
|
61
64
|
|