@penskemediacorp/larva-patterns 1.1.2 → 1.2.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/modules/age-gate/README.md +1 -1
- package/modules/age-gate/age-gate.prototype.js +2 -2
- package/modules/age-gate/age-gate.twig +1 -1
- package/modules/buy-now/buy-now.prototype.js +36 -0
- package/modules/buy-now/buy-now.twig +23 -0
- package/objects/o-icon-button/o-icon-button.prototype.js +3 -0
- package/objects/o-icon-button/o-icon-button.twig +1 -1
- package/package.json +4 -4
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
# age-gate
|
|
2
2
|
|
|
3
|
-
This module is relied heavily upon in the `pmc-age-gate` plugin and contains `js-` classes in the twig file that are important to its functionality.
|
|
3
|
+
This module is relied heavily upon in the `pmc-age-gate` plugin and contains `js-` classes in the twig file that are important to its functionality. Custom JS and CSS (to handle pop-up modal in which the age gate module will appear) are handled in the aforementioned plugin.
|
|
@@ -48,7 +48,7 @@ o_input_group.o_input_group_items = [
|
|
|
48
48
|
];
|
|
49
49
|
|
|
50
50
|
c_button.c_button_text = 'View';
|
|
51
|
-
c_button.c_button_classes = ' lrv-u-color-white lrv-u-background-color-brand-primary lrv-u-padding-lr-2 lrv-u-padding-tb-075 lrv-u-margin-b-2 lrv-u-text-align-center lrv-u-text-transform-uppercase lrv-a-font-primary-m';
|
|
51
|
+
c_button.c_button_classes = ' lrv-u-margin-t-2 lrv-u-color-white lrv-u-background-color-brand-primary lrv-u-padding-lr-2 lrv-u-padding-tb-075 lrv-u-margin-b-2 lrv-u-text-align-center lrv-u-text-transform-uppercase lrv-a-font-primary-m';
|
|
52
52
|
|
|
53
53
|
c_dek.c_dek_classes = 'lrv-a-font-primary-xs';
|
|
54
54
|
c_dek.c_dek_text = 'Legal text.'
|
|
@@ -57,7 +57,7 @@ module.exports = {
|
|
|
57
57
|
age_gate_class: 'lrv-u-height-100p lrv-u-padding-t-2 lrv-u-background-color-black lrv-u-text-align-center lrv-u-color-white',
|
|
58
58
|
age_gate_inner_class: 'lrv-u-max-width-1000 lrv-u-margin-lr-auto',
|
|
59
59
|
age_gate_form_class: 'lrv-u-border-b-1',
|
|
60
|
-
age_gate_error_class: '',
|
|
60
|
+
age_gate_error_class: 'lrv-a-font-primary-s',
|
|
61
61
|
form_wrapper_class: '',
|
|
62
62
|
age_gate_footer_class: 'lrv-u-border-t-1 lrv-u-margin-t-025',
|
|
63
63
|
c_heading,
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
{% if o_input_group %}
|
|
17
17
|
{% include "@larva/objects/o-input-group/o-input-group.twig" with o_input_group %}
|
|
18
18
|
{% endif %}
|
|
19
|
-
<div class="age-gate-error // {{ age_gate_error_class }}"></div>
|
|
19
|
+
<div class="age-gate-error // js-AgeGateError {{ age_gate_error_class }}"></div>
|
|
20
20
|
<div class="age-gate-button-wrapper">
|
|
21
21
|
{% include "@larva/components/c-button/c-button.twig" with c_button %}
|
|
22
22
|
</div>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const clonedeep = require( 'lodash.clonedeep' );
|
|
2
|
+
|
|
3
|
+
// Image
|
|
4
|
+
const c_lazy_image_prototype = require( '@penskemediacorp/larva-patterns/components/c-lazy-image/c-lazy-image.prototype' );
|
|
5
|
+
|
|
6
|
+
const c_lazy_image = clonedeep( c_lazy_image_prototype );
|
|
7
|
+
|
|
8
|
+
c_lazy_image.c_lazy_image_srcset_attr = false;
|
|
9
|
+
c_lazy_image.c_lazy_image_sizes_attr = false;
|
|
10
|
+
c_lazy_image.c_lazy_image_crop_class = 'lrv-a-crop-1x1';
|
|
11
|
+
|
|
12
|
+
// Icon Button
|
|
13
|
+
const c_icon_button = clonedeep( require( '../../objects/o-icon-button/o-icon-button.prototype' ) );
|
|
14
|
+
|
|
15
|
+
c_icon_button.o_icon_button_url = true;
|
|
16
|
+
c_icon_button.o_button_url = '#';
|
|
17
|
+
c_icon_button.o_icon_button_classes += ' lrv-a-buy-now__button lrv-u-font-size-14 lrv-u-font-weight-bold lrv-u-text-transform-uppercase lrv-u-border-t-3 lrv-u-border-r-1 lrv-u-border-b-3 lrv-u-border-l-1 lrv-u-padding-tb-050 lrv-u-padding-lr-1 lrv-u-background-color-white lrv-u-color-black lrv-u-border-color-currentColor';
|
|
18
|
+
c_icon_button.o_icon_button_target_attr = '_blank';
|
|
19
|
+
c_icon_button.o_icon_button_rel_attr = 'nofollow';
|
|
20
|
+
|
|
21
|
+
c_icon_button.c_icon.c_icon_name = 'triangle-right';
|
|
22
|
+
c_icon_button.c_icon.c_icon_screen_reader_text = '';
|
|
23
|
+
c_icon_button.c_span.c_span_text = 'Buy Now';
|
|
24
|
+
|
|
25
|
+
// Export
|
|
26
|
+
module.exports = {
|
|
27
|
+
buy_now_div_classes: 'lrv-a-buy-now lrv-u-font-family-basic',
|
|
28
|
+
buy_now_hr_top_classes: 'lrv-a-buy-now__hr lrv-a-buy-now__hr--top',
|
|
29
|
+
buy_now_img_classes: 'lrv-a-buy-now__image',
|
|
30
|
+
buy_now_hr_bottom_classes: 'lrv-a-buy-now__hr lrv-a-buy-now__hr--bottom',
|
|
31
|
+
buy_now_p_classes: 'lrv-a-buy-now__p lrv-u-font-family-basic lrv-u-font-size-14',
|
|
32
|
+
buy_now_span_classes: 'lrv-a-buy-now__span lrv-u-font-weight-bold lrv-u-text-transform-uppercase lrv-u-color-grey lrv-u-font-size-10',
|
|
33
|
+
buy_now_store_credit_text: '', // 'Amazon' for example
|
|
34
|
+
c_lazy_image,
|
|
35
|
+
c_icon_button,
|
|
36
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{% if c_lazy_image %}
|
|
2
|
+
<div class="{{ buy_now_div_classes }}">
|
|
3
|
+
<hr class="{{ buy_now_hr_top_classes }}">
|
|
4
|
+
|
|
5
|
+
<div class="{{ buy_now_img_classes }}">
|
|
6
|
+
{% include "@larva/components/c-lazy-image/c-lazy-image.twig" with c_lazy_image %}
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
{% include "@larva/objects/o-icon-button/o-icon-button.twig" with c_icon_button %}
|
|
10
|
+
|
|
11
|
+
<hr class="{{ buy_now_hr_bottom_classes }}">
|
|
12
|
+
|
|
13
|
+
{% if buy_now_store_credit_text %}
|
|
14
|
+
<span class="{{ buy_now_span_classes }}">
|
|
15
|
+
{{ buy_now_store_credit_text }}
|
|
16
|
+
</span>
|
|
17
|
+
{% endif %}
|
|
18
|
+
</div>
|
|
19
|
+
{% else %}
|
|
20
|
+
<p class="{{ buy_now_p_classes }}">
|
|
21
|
+
{% include "@larva/objects/o-icon-button/o-icon-button.twig" with c_icon_button %}
|
|
22
|
+
</p>
|
|
23
|
+
{% endif %}
|
|
@@ -12,7 +12,10 @@ c_span.c_span_url = false;
|
|
|
12
12
|
|
|
13
13
|
module.exports = {
|
|
14
14
|
o_icon_button_classes: 'lrv-a-unstyle-button lrv-a-unstyle-link lrv-u-cursor-pointer lrv-u-flex',
|
|
15
|
+
o_icon_button_ga_tracking: {}, // by default we do not want to enable any ga tracking
|
|
16
|
+
o_icon_button_rel_attr: '',
|
|
15
17
|
o_icon_button_screen_reader_text: '',
|
|
18
|
+
o_icon_button_target_attr: '',
|
|
16
19
|
c_icon: c_icon,
|
|
17
20
|
c_span: c_span,
|
|
18
21
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{% if o_icon_button_url %}
|
|
2
|
-
<a href="{{ o_button_url }}" class="{{ o_icon_button_classes }}">
|
|
2
|
+
<a href="{{ o_button_url }}" class="{{ o_icon_button_classes }}" target="{{ o_icon_button_target_attr }}" rel="{{ o_icon_button_rel_attr }}" data-pmc-sp-product="{{ o_icon_button_guid_attr }}" data-category-name="{{ o_icon_button_category_attr }}" {{ wp_action( 'pmc_do_render_custom_ga_tracking_attr', o_icon_button_ga_tracking ) }}>
|
|
3
3
|
{% else %}
|
|
4
4
|
<button class="o-icon-button {{ o_icon_button_classes }}">
|
|
5
5
|
{% endif %}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@penskemediacorp/larva-patterns",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Larva markup patterns.",
|
|
5
5
|
"author": "laras126 <laras126@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/Penske-Media-Corp/pmc-larva/tree/master/packages/patterns#readme",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"url": "https://github.com/Penske-Media-Corp/pmc-larva/issues"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@penskemediacorp/larva-css": "^1.
|
|
23
|
+
"@penskemediacorp/larva-css": "^1.2.0",
|
|
24
24
|
"@penskemediacorp/larva-js": "^1.0.0",
|
|
25
|
-
"@penskemediacorp/larva-svg": "^1.
|
|
25
|
+
"@penskemediacorp/larva-svg": "^1.1.3",
|
|
26
26
|
"lodash.clonedeep": "^4.5.0"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "65f0eb85b8371be9b4471000cfcda33fd7c578ef"
|
|
29
29
|
}
|