@ordergroove/offers 2.24.2-alpha-PR-565-16.12 → 2.24.3
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/CHANGELOG.md +16 -0
- package/dist/bundle-report.html +25 -25
- package/dist/examples.js +150 -104
- package/dist/examples.js.map +2 -2
- package/dist/offers.js +72 -85
- package/dist/offers.js.map +2 -2
- package/package.json +3 -3
- package/schema.json +4 -4
- package/src/components/Offer.js +1 -1
- package/src/components/OptinButton.js +1 -1
- package/src/components/OptinStatus.js +3 -13
- package/src/components/Select.js +2 -2
- package/src/components/SelectFrequency.js +3 -4
- package/src/components/Tooltip.js +13 -15
- package/src/components/__tests__/Tooltip.spec.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ordergroove/offers",
|
|
3
|
-
"version": "2.24.
|
|
3
|
+
"version": "2.24.3",
|
|
4
4
|
"description": "offer state component",
|
|
5
5
|
"author": "Eugenio Lattanzio <eugenio63@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/ordergroove/plush-toys#readme",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"throttle-debounce": "^2.1.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@ordergroove/offers-templates": "^0.4.
|
|
46
|
+
"@ordergroove/offers-templates": "^0.4.3"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "34d771e75cc0a0a2261d0e8c2ef7eb86aa7e7d3b"
|
|
49
49
|
}
|
package/schema.json
CHANGED
|
@@ -299,7 +299,7 @@
|
|
|
299
299
|
},
|
|
300
300
|
"showTooltip": {
|
|
301
301
|
"type": "boolean",
|
|
302
|
-
"default":
|
|
302
|
+
"default": true,
|
|
303
303
|
"title": "Add a tool tip"
|
|
304
304
|
}
|
|
305
305
|
},
|
|
@@ -369,7 +369,7 @@
|
|
|
369
369
|
},
|
|
370
370
|
"tooltipPlacement": {
|
|
371
371
|
"type": "string",
|
|
372
|
-
"default": "
|
|
372
|
+
"default": "bottom",
|
|
373
373
|
"enum": ["top", "top-left", "top-right", "bottom", "bottom-left", "bottom-right", "right", "left"]
|
|
374
374
|
}
|
|
375
375
|
}
|
|
@@ -446,12 +446,12 @@
|
|
|
446
446
|
"offerType": "radio"
|
|
447
447
|
},
|
|
448
448
|
"textCopy": {
|
|
449
|
-
"defaultFrequencyCopy": "
|
|
449
|
+
"defaultFrequencyCopy": "(Most Popular)",
|
|
450
450
|
"offerOptInLabel": "Subscribe and Save",
|
|
451
451
|
"offerIncentiveText": "Save {{ogIncentive DiscountPercent}} when you subscribe",
|
|
452
452
|
"offerEveryLabel": "Ships Every: ",
|
|
453
453
|
"offerOptOutLabel": "One-time",
|
|
454
|
-
"showTooltip":
|
|
454
|
+
"showTooltip": true,
|
|
455
455
|
"upsellButtonLabel": "Add to upcoming subscription order and receive 20% off",
|
|
456
456
|
"upsellButtonContent": "Add to Next Order on ",
|
|
457
457
|
"upsellModalContent": "Subscribe to this product and have it conveniently delivered to you at the frequency you choose! Read the FAQ here. Promotion subject to change.",
|
package/src/components/Offer.js
CHANGED
|
@@ -151,7 +151,7 @@ export class Offer extends TemplateElement {
|
|
|
151
151
|
</div>
|
|
152
152
|
</og-tooltip>
|
|
153
153
|
</div>
|
|
154
|
-
<div style="margin-left:
|
|
154
|
+
<div style="margin-left: 2.2em">
|
|
155
155
|
<og-text key="offerEveryLabel"></og-text>
|
|
156
156
|
<og-select-frequency>
|
|
157
157
|
<option value="3_1" selected>3 Days</option>
|
|
@@ -23,8 +23,6 @@ export class OptinStatus extends withProduct(TemplateElement) {
|
|
|
23
23
|
:host {
|
|
24
24
|
cursor: default;
|
|
25
25
|
display: inline-block;
|
|
26
|
-
font-family: var(--og-global-family, Roboto, sans-serif);
|
|
27
|
-
color: var(--og-global-color, #090909);
|
|
28
26
|
}
|
|
29
27
|
|
|
30
28
|
:host[hidden] {
|
|
@@ -33,9 +31,9 @@ export class OptinStatus extends withProduct(TemplateElement) {
|
|
|
33
31
|
|
|
34
32
|
.btn {
|
|
35
33
|
position: relative;
|
|
36
|
-
width: 1.4em;
|
|
37
|
-
height: 1.4em;
|
|
38
|
-
margin: 0;
|
|
34
|
+
width: var(--og-radio-width, 1.4em);
|
|
35
|
+
height: var(--og-radio-height, 1.4em);
|
|
36
|
+
margin: var(--og-radio-margin, 0);
|
|
39
37
|
padding: 0;
|
|
40
38
|
border: 1px solid var(--og-primary-color, black);
|
|
41
39
|
background: #fff;
|
|
@@ -44,13 +42,6 @@ export class OptinStatus extends withProduct(TemplateElement) {
|
|
|
44
42
|
color: var(--og-primary-color, black);
|
|
45
43
|
}
|
|
46
44
|
|
|
47
|
-
.radio,
|
|
48
|
-
.checkbox {
|
|
49
|
-
margin: 0 0.5em;
|
|
50
|
-
transform: scale(1.2);
|
|
51
|
-
cursor: pointer;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
45
|
.radio {
|
|
55
46
|
text-indent: -9999px;
|
|
56
47
|
}
|
|
@@ -58,7 +49,6 @@ export class OptinStatus extends withProduct(TemplateElement) {
|
|
|
58
49
|
.checkbox {
|
|
59
50
|
border-radius: 3px;
|
|
60
51
|
}
|
|
61
|
-
|
|
62
52
|
.checkbox.active::after,
|
|
63
53
|
.radio.active::after {
|
|
64
54
|
content: ' ';
|
package/src/components/Select.js
CHANGED
|
@@ -21,10 +21,9 @@ export class Select extends LitElement {
|
|
|
21
21
|
font-family: inherit;
|
|
22
22
|
font-size: 1em;
|
|
23
23
|
line-height: 1.3;
|
|
24
|
-
padding: var(--og-select-padding, 0.4em
|
|
24
|
+
padding: var(--og-select-padding, 0.4em 1.8em 0.3em 0.5em);
|
|
25
25
|
width: 100%;
|
|
26
26
|
max-width: 100%;
|
|
27
|
-
min-width: 150px;
|
|
28
27
|
box-sizing: border-box;
|
|
29
28
|
margin: 0;
|
|
30
29
|
border: none;
|
|
@@ -51,6 +50,7 @@ export class Select extends LitElement {
|
|
|
51
50
|
}
|
|
52
51
|
span {
|
|
53
52
|
position: absolute;
|
|
53
|
+
// background: white;
|
|
54
54
|
color: inherit;
|
|
55
55
|
fill: white;
|
|
56
56
|
pointer-events: none;
|
|
@@ -32,15 +32,14 @@ export class SelectFrequency extends withChildOptions(FrequencyStatus) {
|
|
|
32
32
|
static get styles() {
|
|
33
33
|
return css`
|
|
34
34
|
:host {
|
|
35
|
-
display:
|
|
35
|
+
display: inline-block;
|
|
36
36
|
cursor: pointer;
|
|
37
|
-
background-color: var(--og-select-bg-color, #
|
|
38
|
-
border: var(--og-select-border, 1px solid #
|
|
37
|
+
background-color: var(--og-select-bg-color, #fff);
|
|
38
|
+
border: var(--og-select-border, 1px solid #aaa);
|
|
39
39
|
border-radius: var(--og-select-border-radius, 0.5em);
|
|
40
40
|
border-width: var(--og-select-border-width, 1px);
|
|
41
41
|
box-shadow: 0 1px 0 1px rgba(0, 0, 0, 0.04);
|
|
42
42
|
z-index: 1;
|
|
43
|
-
font-size: var(--og-select-font-size, 12px);
|
|
44
43
|
}
|
|
45
44
|
`;
|
|
46
45
|
}
|
|
@@ -3,7 +3,7 @@ import { LitElement, html, css } from 'lit-element';
|
|
|
3
3
|
export class Tooltip extends LitElement {
|
|
4
4
|
static get properties() {
|
|
5
5
|
return {
|
|
6
|
-
placement: { type: String, default: '
|
|
6
|
+
placement: { type: String, default: 'bottom' }
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -25,24 +25,22 @@ export class Tooltip extends LitElement {
|
|
|
25
25
|
|
|
26
26
|
.content {
|
|
27
27
|
box-sizing: border-box;
|
|
28
|
-
font-family: var(--og-tooltip-family,
|
|
29
|
-
font-size: var(--og-tooltip-size,
|
|
30
|
-
color: var(--og-tooltip-color,
|
|
31
|
-
background-color: var(--og-tooltip-background, #
|
|
28
|
+
font-family: var(--og-tooltip-family, inherit);
|
|
29
|
+
font-size: var(--og-tooltip-size, inherit);
|
|
30
|
+
color: var(--og-tooltip-color, inherit);
|
|
31
|
+
background-color: var(--og-tooltip-background, #ececec);
|
|
32
32
|
box-shadow: var(--og-tooltip-box-shadow, 2px 2px 6px rgba(0, 0, 0, 0.28));
|
|
33
|
-
border: var(--og-tooltop-border, 1px solid #cdcdcd);
|
|
34
33
|
display: block;
|
|
35
34
|
width: 200px;
|
|
36
35
|
opacity: 0;
|
|
37
|
-
padding:
|
|
38
|
-
|
|
36
|
+
padding: var(--og-tooltip-padding, 0.5em);
|
|
37
|
+
text-align: var(--og-tooltip-text-align, left);
|
|
39
38
|
pointer-events: none;
|
|
40
39
|
position: absolute;
|
|
41
40
|
transform: translateY(10px);
|
|
42
41
|
transition: transform 0.25s ease-out;
|
|
43
42
|
z-index: 99999;
|
|
44
|
-
|
|
45
|
-
line-height: 1.3;
|
|
43
|
+
border-radius: var(--og-tooltip-border-radius, 0);
|
|
46
44
|
}
|
|
47
45
|
|
|
48
46
|
.content:after {
|
|
@@ -116,7 +114,7 @@ export class Tooltip extends LitElement {
|
|
|
116
114
|
.top-right:after,
|
|
117
115
|
.top:after {
|
|
118
116
|
bottom: -10px;
|
|
119
|
-
border-top: solid var(--og-tooltip-background, #
|
|
117
|
+
border-top: solid var(--og-tooltip-background, #ececec) 10px;
|
|
120
118
|
}
|
|
121
119
|
.bottom-left:after,
|
|
122
120
|
.top-left:after {
|
|
@@ -135,7 +133,7 @@ export class Tooltip extends LitElement {
|
|
|
135
133
|
.bottom-right:after,
|
|
136
134
|
.bottom:after {
|
|
137
135
|
top: -10px;
|
|
138
|
-
border-bottom: solid var(--og-tooltip-background, #
|
|
136
|
+
border-bottom: solid var(--og-tooltip-background, #ececec) 10px;
|
|
139
137
|
}
|
|
140
138
|
|
|
141
139
|
.left:after,
|
|
@@ -147,11 +145,11 @@ export class Tooltip extends LitElement {
|
|
|
147
145
|
}
|
|
148
146
|
.right:after {
|
|
149
147
|
left: -10px;
|
|
150
|
-
border-right: solid var(--og-tooltip-background, #
|
|
148
|
+
border-right: solid var(--og-tooltip-background, #ececec) 10px;
|
|
151
149
|
}
|
|
152
150
|
.left:after {
|
|
153
151
|
right: -10px;
|
|
154
|
-
border-left: solid var(--og-tooltip-background, #
|
|
152
|
+
border-left: solid var(--og-tooltip-background, #ececec) 10px;
|
|
155
153
|
}
|
|
156
154
|
|
|
157
155
|
.tooltip:hover .content {
|
|
@@ -187,7 +185,7 @@ export class Tooltip extends LitElement {
|
|
|
187
185
|
|
|
188
186
|
render() {
|
|
189
187
|
return html`
|
|
190
|
-
<span class="tooltip
|
|
188
|
+
<span class="tooltip">
|
|
191
189
|
<span class="trigger">
|
|
192
190
|
<slot name="trigger">
|
|
193
191
|
${this.trigger}
|
|
@@ -61,11 +61,11 @@ describe('Tooltip', () => {
|
|
|
61
61
|
});
|
|
62
62
|
|
|
63
63
|
it('should set the "top" style property if placement is left', async () => {
|
|
64
|
-
await checkContentStyles({ top: '-
|
|
64
|
+
await checkContentStyles({ top: '-8px', left: '' }, 'left');
|
|
65
65
|
});
|
|
66
66
|
|
|
67
67
|
it('should set the "top" style property if placement is right', async () => {
|
|
68
|
-
await checkContentStyles({ top: '-
|
|
68
|
+
await checkContentStyles({ top: '-8px', left: '' }, 'right');
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
it('should not set style properties if placement is top-right', async () => {
|