@ordergroove/offers 2.24.1 → 2.24.2-alpha-PR-568-5.12

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/examples/index.js CHANGED
@@ -31,10 +31,11 @@ const settings = {
31
31
 
32
32
  const textCopy = {
33
33
  showTooltip: true,
34
- offerOptInLabel: 'Subscribe and SAVE {{ogIncentive DiscountAmount 10}}',
35
- offerOptOutLabel: 'Purchase one time',
36
- offerEveryLabel: 'Ships Every:',
37
- offerTooltipTrigger: 'Hover for additional info',
34
+ offerOptInLabel: 'Subscribe and Save',
35
+ offerIncentiveText: 'Save {{ogIncentive DiscountPercent}} when you subscribe',
36
+ offerOptOutLabel: 'Deliver one-time only',
37
+ offerEveryLabel: 'Deliver every',
38
+ offerTooltipTrigger: '[?]',
38
39
  offerTooltipContent: 'Seems this is a great subscription offering. Many fun details about this program exist.',
39
40
  optinButtonLabel: '•',
40
41
  optoutButtonLabel: '•',
@@ -325,7 +326,11 @@ Add item to order on
325
326
  {
326
327
  name: 'Tooltip',
327
328
  selector: 'og-offer[location="tooltip-placement"]',
328
- markup: [['top-left', 'top', 'top-right'], ['left', '', 'right'], ['bottom-left', 'bottom', 'bottom-right']]
329
+ markup: [
330
+ ['top-left', 'top', 'top-right'],
331
+ ['left', '', 'right'],
332
+ ['bottom-left', 'bottom', 'bottom-right']
333
+ ]
329
334
  .map(options =>
330
335
  options
331
336
  .map(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ordergroove/offers",
3
- "version": "2.24.1",
3
+ "version": "2.24.2-alpha-PR-568-5.12+8d911f4f",
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.1"
46
+ "@ordergroove/offers-templates": "^0.4.2-alpha-PR-568-5.12+8d911f4f"
47
47
  },
48
- "gitHead": "715c57c1c9faa150d2961bf0b424c790410dfc97"
48
+ "gitHead": "8d911f4fdf6099e66242a1a43c6a0fd7f2a57b5a"
49
49
  }
package/schema.json CHANGED
@@ -274,22 +274,27 @@
274
274
  "properties": {
275
275
  "defaultFrequencyCopy": {
276
276
  "type": "string",
277
- "default": "Recommended",
277
+ "default": "(Most Popular)",
278
278
  "title": "Default frequency copy"
279
279
  },
280
280
  "offerOptInLabel": {
281
281
  "type": "string",
282
- "default": "Subscribe and get 20% off",
283
- "title": "Subscribe option copy"
282
+ "default": "Subscribe and Save",
283
+ "title": "Subscription copy"
284
+ },
285
+ "offerIncentiveText": {
286
+ "type": "string",
287
+ "default": "Save {{ogIncentive DiscountPercent}} when you subscribe",
288
+ "title": "Subscription sub copy"
284
289
  },
285
290
  "offerEveryLabel": {
286
291
  "type": "string",
287
- "default": "Ships Every: ",
292
+ "default": "Deliver Every",
288
293
  "title": "Subscribe frequency label"
289
294
  },
290
295
  "offerOptOutLabel": {
291
296
  "type": "string",
292
- "default": "One-time",
297
+ "default": "Deliver one-time only",
293
298
  "title": "One-time option copy"
294
299
  },
295
300
  "showTooltip": {
@@ -442,7 +447,8 @@
442
447
  },
443
448
  "textCopy": {
444
449
  "defaultFrequencyCopy": "Recommended",
445
- "offerOptInLabel": "Subscribe and get 20% off",
450
+ "offerOptInLabel": "Subscribe and Save",
451
+ "offerIncentiveText": "Save {{ogIncentive DiscountPercent}} when you subscribe",
446
452
  "offerEveryLabel": "Ships Every: ",
447
453
  "offerOptOutLabel": "One-time",
448
454
  "showTooltip": false,
@@ -142,7 +142,7 @@ export class Offer extends TemplateElement {
142
142
  <og-optin-button>
143
143
  <og-text key="offerOptInLabel"></og-text>
144
144
  </og-optin-button>
145
- <og-tooltip placement="top-right">
145
+ <og-tooltip placement="bottom">
146
146
  <div slot="trigger">
147
147
  <og-text key="offerTooltipTrigger"></og-text>
148
148
  </div>
@@ -151,7 +151,7 @@ export class Offer extends TemplateElement {
151
151
  </div>
152
152
  </og-tooltip>
153
153
  </div>
154
- <div style="margin-left: 1.5em">
154
+ <div style="margin-left: 1.9em">
155
155
  <og-text key="offerEveryLabel"></og-text>
156
156
  <og-select-frequency>
157
157
  <option value="3_1" selected>3 Days</option>
@@ -1,4 +1,4 @@
1
- import { html } from 'lit-element';
1
+ import { html, css } from 'lit-element';
2
2
  import { optinProduct } from '../core/actions';
3
3
  import { OptinStatus, mapStateToProps } from './OptinStatus';
4
4
  import { connect } from '../core/connect';
@@ -23,6 +23,8 @@ 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);
26
28
  }
27
29
 
28
30
  :host[hidden] {
@@ -42,6 +44,13 @@ export class OptinStatus extends withProduct(TemplateElement) {
42
44
  color: var(--og-primary-color, black);
43
45
  }
44
46
 
47
+ .radio,
48
+ .checkbox {
49
+ margin: 0 0.5em;
50
+ transform: scale(1.2);
51
+ cursor: pointer;
52
+ }
53
+
45
54
  .radio {
46
55
  text-indent: -9999px;
47
56
  }
@@ -49,6 +58,7 @@ export class OptinStatus extends withProduct(TemplateElement) {
49
58
  .checkbox {
50
59
  border-radius: 3px;
51
60
  }
61
+
52
62
  .checkbox.active::after,
53
63
  .radio.active::after {
54
64
  content: ' ';
@@ -21,9 +21,10 @@ 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 1.8em 0.3em 0.5em);
24
+ padding: var(--og-select-padding, 0.4em 2.8em 0.4em 0.5em);
25
25
  width: 100%;
26
26
  max-width: 100%;
27
+ min-width: 150px;
27
28
  box-sizing: border-box;
28
29
  margin: 0;
29
30
  border: none;
@@ -50,11 +51,10 @@ export class Select extends LitElement {
50
51
  }
51
52
  span {
52
53
  position: absolute;
53
- // background: white;
54
54
  color: inherit;
55
55
  fill: white;
56
56
  pointer-events: none;
57
- right: 0.4em;
57
+ right: 0.3em;
58
58
  top: 50%;
59
59
  z-index: 1;
60
60
  font-size: 1em;
@@ -32,14 +32,15 @@ export class SelectFrequency extends withChildOptions(FrequencyStatus) {
32
32
  static get styles() {
33
33
  return css`
34
34
  :host {
35
- display: inline-block;
35
+ display: table;
36
36
  cursor: pointer;
37
- background-color: var(--og-select-bg-color, #fff);
38
- border: var(--og-select-border, 1px solid #aaa);
37
+ background-color: var(--og-select-bg-color, #f8f8f8);
38
+ border: var(--og-select-border, 1px solid #090909);
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);
43
44
  }
44
45
  `;
45
46
  }
@@ -25,20 +25,24 @@ export class Tooltip extends LitElement {
25
25
 
26
26
  .content {
27
27
  box-sizing: border-box;
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);
28
+ font-family: var(--og-tooltip-family, Roboto, sans-serif);
29
+ font-size: var(--og-tooltip-size, 12px);
30
+ color: var(--og-tooltip-color, #090909);
31
+ background-color: var(--og-tooltip-background, #ffffff);
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);
33
34
  display: block;
34
35
  width: 200px;
35
36
  opacity: 0;
36
- padding: 0.5em;
37
+ padding: 1em;
38
+ border-radius: 5px;
37
39
  pointer-events: none;
38
40
  position: absolute;
39
41
  transform: translateY(10px);
40
42
  transition: transform 0.25s ease-out;
41
43
  z-index: 99999;
44
+ text-align: center;
45
+ line-height: 1.3;
42
46
  }
43
47
 
44
48
  .content:after {
@@ -112,7 +116,7 @@ export class Tooltip extends LitElement {
112
116
  .top-right:after,
113
117
  .top:after {
114
118
  bottom: -10px;
115
- border-top: solid var(--og-tooltip-background, #ececec) 10px;
119
+ border-top: solid var(--og-tooltip-background, #ffffff) 10px;
116
120
  }
117
121
  .bottom-left:after,
118
122
  .top-left:after {
@@ -131,7 +135,7 @@ export class Tooltip extends LitElement {
131
135
  .bottom-right:after,
132
136
  .bottom:after {
133
137
  top: -10px;
134
- border-bottom: solid var(--og-tooltip-background, #ececec) 10px;
138
+ border-bottom: solid var(--og-tooltip-background, #ffffff) 10px;
135
139
  }
136
140
 
137
141
  .left:after,
@@ -143,11 +147,11 @@ export class Tooltip extends LitElement {
143
147
  }
144
148
  .right:after {
145
149
  left: -10px;
146
- border-right: solid var(--og-tooltip-background, #ececec) 10px;
150
+ border-right: solid var(--og-tooltip-background, #ffffff) 10px;
147
151
  }
148
152
  .left:after {
149
153
  right: -10px;
150
- border-left: solid var(--og-tooltip-background, #ececec) 10px;
154
+ border-left: solid var(--og-tooltip-background, #ffffff) 10px;
151
155
  }
152
156
 
153
157
  .tooltip:hover .content {
@@ -183,13 +187,13 @@ export class Tooltip extends LitElement {
183
187
 
184
188
  render() {
185
189
  return html`
186
- <span class="tooltip">
190
+ <span class="tooltip bottom">
187
191
  <span class="trigger">
188
192
  <slot name="trigger">
189
193
  ${this.trigger}
190
194
  </slot>
191
195
  </span>
192
- <div class="content ${this.placement || 'top'}">
196
+ <div class="content ${this.placement || 'bottom'}">
193
197
  <slot name="content">
194
198
  ${this.content}
195
199
  </slot>
@@ -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: '-8px', left: '' }, 'left');
64
+ await checkContentStyles({ top: '-13px', left: '' }, 'left');
65
65
  });
66
66
 
67
67
  it('should set the "top" style property if placement is right', async () => {
68
- await checkContentStyles({ top: '-8px', left: '' }, 'right');
68
+ await checkContentStyles({ top: '-13px', left: '' }, 'right');
69
69
  });
70
70
 
71
71
  it('should not set style properties if placement is top-right', async () => {
@@ -332,10 +332,11 @@ export const environment = (state = {}, action) => {
332
332
 
333
333
  export const locale = (
334
334
  state = {
335
- offerOptInLabel: 'Subscribe',
336
- offerOptOutLabel: 'Purchase one time',
337
- offerEveryLabel: 'Every',
338
- offerTooltipTrigger: 'Hover for additional info',
335
+ offerOptInLabel: 'Subscribe and Save',
336
+ offerIncentiveText: 'Save {{ogIncentive DiscountPercent}} when you subscribe',
337
+ offerOptOutLabel: 'Deliver one-time only',
338
+ offerEveryLabel: 'Delivery Every',
339
+ offerTooltipTrigger: '[?]',
339
340
  offerTooltipContent: 'Seems this is a great subscription offering. Many fun details about this program exist.',
340
341
  optinButtonLabel: '•',
341
342
  optoutButtonLabel: '•',
@@ -350,7 +351,7 @@ export const locale = (
350
351
  upsellModalTitle: 'Impulse Upsell',
351
352
  upsellModalConfirmLabel: 'Ok',
352
353
  upsellModalCancelLabel: 'Cancel',
353
- defaultFrequencyCopy: '(Recommended)',
354
+ defaultFrequencyCopy: '(Most Popular)',
354
355
  frequencyPeriods: {
355
356
  '1': 'day',
356
357
  '2': 'week',