@penskemediacorp/larva-patterns 0.7.0 → 0.7.1
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/components/c-input/c-input.prototype.js +9 -0
- package/components/c-input/c-input.twig +13 -0
- package/modules/age-gate/age-gate.prototype.js +23 -23
- package/modules/age-gate/age-gate.twig +8 -8
- package/objects/o-input-group/o-input-group.prototype.js +14 -0
- package/objects/o-input-group/o-input-group.twig +6 -0
- package/package.json +3 -3
- package/components/c-text-input/c-text-input.prototype.js +0 -8
- package/components/c-text-input/c-text-input.twig +0 -13
- package/objects/o-text-input-group/o-text-input-group.prototype.js +0 -11
- package/objects/o-text-input-group/o-text-input-group.twig +0 -5
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
c_input_type_attr: 'text',
|
|
3
|
+
c_input_id_attr: 'inputExample',
|
|
4
|
+
c_input_label_class: 'lrv-a-screen-reader-only',
|
|
5
|
+
c_input_label_text: 'Input Example',
|
|
6
|
+
c_input_class: '',
|
|
7
|
+
c_input_name: 'input_example',
|
|
8
|
+
c_input_placeholder_attr: 'Enter text.',
|
|
9
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<label class="c-input" for="{{ id_attr }}">
|
|
2
|
+
<span class="{{ c_input_label_class }}">{{ c_input_label_text }}</span>
|
|
3
|
+
<input
|
|
4
|
+
type="{{ c_input_type_attr }}"
|
|
5
|
+
class="{{ c_input_class }}"
|
|
6
|
+
name="{{ c_input_name }}"
|
|
7
|
+
placeholder="{{ c_input_placeholder_attr }}"
|
|
8
|
+
aria-invalid="{{ c_input_aria_invalid_attr }}"
|
|
9
|
+
data-error="{{ c_input_error_attr }}"
|
|
10
|
+
size="{{ c_input_size_attr }}"
|
|
11
|
+
maxlength="{{ c_input_maxlength_attr }}"
|
|
12
|
+
/>
|
|
13
|
+
</label>
|
|
@@ -2,7 +2,7 @@ const clonedeep = require('lodash.clonedeep');
|
|
|
2
2
|
|
|
3
3
|
const c_svg = clonedeep(require('@penskemediacorp/larva-patterns/components/c-svg/c-svg.prototype'));
|
|
4
4
|
const c_heading = clonedeep(require('@penskemediacorp/larva-patterns/components/c-heading/c-heading.prototype'));
|
|
5
|
-
const
|
|
5
|
+
const o_input_group = clonedeep(require('@penskemediacorp/larva-patterns/objects/o-input-group/o-input-group.prototype'));
|
|
6
6
|
const c_button = clonedeep(require('@penskemediacorp/larva-patterns/components/c-button/c-button.prototype'));
|
|
7
7
|
const c_dek = clonedeep(require('@penskemediacorp/larva-patterns/components/c-dek/c-dek.prototype'));
|
|
8
8
|
|
|
@@ -12,24 +12,24 @@ c_svg.c_svg_classes = 'lrv-u-width-150 lrv-u-margin-lr-auto lrv-u-margin-b-2';
|
|
|
12
12
|
c_heading.c_heading_classes += ' lrv-u-margin-b-2';
|
|
13
13
|
c_heading.c_heading_text = 'You must be 21 to enter.';
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
o_input_group.o_input_group_class = 'lrv-u-margin-b-2';
|
|
16
|
+
o_input_group_item = clonedeep( o_input_group.o_input_group_items[0] );
|
|
17
|
+
o_input_group_item.c_input_class = 'lrv-u-font-size-32 lrv-u-color-white lrv-u-background-color-grey-darkest lrv-u-padding-lr-050 lrv-u-padding-tb-150 lrv-u-width-100 lrv-u-text-align-center';
|
|
18
|
+
o_input_group_item.c_input_size_attr = 2;
|
|
19
|
+
o_input_group_item.c_input_maxlength_attr = 4;
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
o_input_day_item = clonedeep( o_input_group_item );
|
|
22
|
+
o_input_month_item = clonedeep( o_input_group_item );
|
|
23
|
+
o_input_year_item = clonedeep( o_input_group_item );
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
o_input_day_item.c_input_placeholder_attr = 'DD';
|
|
26
|
+
o_input_month_item.c_input_placeholder_attr = 'MM';
|
|
27
|
+
o_input_year_item.c_input_placeholder_attr = 'YYYY';
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
o_input_group.o_input_group_items = [
|
|
30
|
+
o_input_day_item,
|
|
31
|
+
o_input_month_item,
|
|
32
|
+
o_input_year_item
|
|
33
33
|
];
|
|
34
34
|
|
|
35
35
|
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-u-font-size-32 lrv-u-font-size-18@mobile-max';
|
|
@@ -37,15 +37,15 @@ c_button.c_button_classes = ' lrv-u-color-white lrv-u-background-color-brand-pri
|
|
|
37
37
|
c_dek.c_dek_text = 'Legal text.'
|
|
38
38
|
|
|
39
39
|
module.exports = {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
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',
|
|
41
|
+
age_gate_inner_class: 'lrv-u-max-width-1000 lrv-u-margin-lr-auto',
|
|
42
|
+
age_gate_form_class: 'lrv-u-border-b-1',
|
|
43
|
+
age_gate_error_class: '',
|
|
44
|
+
form_wrapper_class: '',
|
|
45
|
+
age_gate_footer_class: 'lrv-u-border-t-1 lrv-u-margin-t-025',
|
|
46
46
|
c_heading,
|
|
47
47
|
c_svg,
|
|
48
|
-
|
|
48
|
+
o_input_group,
|
|
49
49
|
c_button,
|
|
50
50
|
c_dek
|
|
51
51
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
<div class="age-gate // js-AgeGate {{
|
|
2
|
-
<div class="age-gate-inner // {{
|
|
3
|
-
<div class="age-gate-header // {{
|
|
1
|
+
<div class="age-gate // js-AgeGate {{ age_gate_class }}">
|
|
2
|
+
<div class="age-gate-inner // {{ age_gate_inner_class }}">
|
|
3
|
+
<div class="age-gate-header // {{ age_gate_header_class }}">
|
|
4
4
|
{% include "@larva/components/c-svg/c-svg.twig" with c_svg %}
|
|
5
5
|
{% if c_heading %}
|
|
6
6
|
{% include "@larva/components/c-heading/c-heading.twig" with c_heading %}
|
|
7
7
|
{% endif %}
|
|
8
8
|
</div>
|
|
9
|
-
<div class="age-gate-form // {{
|
|
9
|
+
<div class="age-gate-form // {{ age_gate_form_class }}">
|
|
10
10
|
<form class="js-AgeGateForm">
|
|
11
|
-
{% if
|
|
12
|
-
{% include "@larva/objects/o-
|
|
11
|
+
{% if o_input_group %}
|
|
12
|
+
{% include "@larva/objects/o-input-group/o-input-group.twig" with o_input_group %}
|
|
13
13
|
{% endif %}
|
|
14
|
-
<div class="age-gate-error // {{
|
|
14
|
+
<div class="age-gate-error // {{ age_gate_error_class }}"></div>
|
|
15
15
|
<div class="age-gate-button-wrapper">
|
|
16
16
|
{% include "@larva/components/c-button/c-button.twig" with c_button %}
|
|
17
17
|
</div>
|
|
18
18
|
</form>
|
|
19
19
|
</div>
|
|
20
|
-
<div class="age-gate-footer // {{
|
|
20
|
+
<div class="age-gate-footer // {{ age_gate_footer_class }}">
|
|
21
21
|
{% if c_dek %}
|
|
22
22
|
{% include "@larva/components/c-dek/c-dek.twig" with c_dek %}
|
|
23
23
|
{% endif %}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Properties intentionally not prefixed with module name to avoid twig-to-php parser issues.
|
|
3
|
+
*/
|
|
4
|
+
const clonedeep = require( 'lodash.clonedeep' );
|
|
5
|
+
const c_input = clonedeep(require('@penskemediacorp/larva-patterns/components/c-input/c-input.prototype'));
|
|
6
|
+
|
|
7
|
+
module.exports = {
|
|
8
|
+
o_input_group_class: '',
|
|
9
|
+
o_input_group_items: [
|
|
10
|
+
c_input,
|
|
11
|
+
c_input,
|
|
12
|
+
c_input
|
|
13
|
+
]
|
|
14
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{# Properties intentionally not prefixed with module name to avoid twig-to-php parser issues. #}
|
|
2
|
+
<div class="o-input-group {{ o_input_group_class }}">
|
|
3
|
+
{% for item in o_input_group_items %}
|
|
4
|
+
{% include "@larva/components/c-input/c-input.twig" with item %}
|
|
5
|
+
{% endfor %}
|
|
6
|
+
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@penskemediacorp/larva-patterns",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
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": "^0.7.
|
|
23
|
+
"@penskemediacorp/larva-css": "^0.7.1",
|
|
24
24
|
"@penskemediacorp/larva-js": "^0.7.0",
|
|
25
25
|
"@penskemediacorp/larva-svg": "^0.7.0",
|
|
26
26
|
"lodash.clonedeep": "^4.5.0"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "c67261fe638b9c40d03875515249d147221d0a08"
|
|
29
29
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
c_text_input_id: 'inputExample',
|
|
3
|
-
c_text_input_label_classes: 'lrv-a-screen-reader-only',
|
|
4
|
-
c_text_input_label_text: 'Input Example',
|
|
5
|
-
c_text_input_classes: '',
|
|
6
|
-
c_text_input_name: 'input_example',
|
|
7
|
-
c_text_input_placeholder: 'Enter text.',
|
|
8
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<label class="c-text-input" for="{{ c_text_input_id }}">
|
|
2
|
-
<span class="{{ c_text_input_label_classes }}">{{ c_text_input_label_text }}</span>
|
|
3
|
-
<input
|
|
4
|
-
type="text"
|
|
5
|
-
class="{{ c_text_input_classes }}"
|
|
6
|
-
name="{{ c_text_input_name }}"
|
|
7
|
-
placeholder="{{ c_text_input_placeholder }}"
|
|
8
|
-
aria-invalid="{{ c_text_input_aria_invalid }}"
|
|
9
|
-
data-error="{{ c_text_input_error }}"
|
|
10
|
-
size="{{ c_text_input_size }}"
|
|
11
|
-
maxlength="{{ c_text_input_maxlength }}"
|
|
12
|
-
/>
|
|
13
|
-
</label>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const clonedeep = require( 'lodash.clonedeep' );
|
|
2
|
-
const c_text_input = clonedeep(require('@penskemediacorp/larva-patterns/components/c-text-input/c-text-input.prototype'));
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
o_text_input_group_classes: '',
|
|
6
|
-
o_text_input_group_items: [
|
|
7
|
-
c_text_input,
|
|
8
|
-
c_text_input,
|
|
9
|
-
c_text_input
|
|
10
|
-
]
|
|
11
|
-
};
|