@seepmaini/stencil-recipe-components 0.0.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/LICENSE +21 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/index-BgGiRDlK.js +1502 -0
- package/dist/cjs/index.cjs.js +7 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/my-component.cjs.entry.js +33 -0
- package/dist/cjs/no-recipe-found.cjs.entry.js +25 -0
- package/dist/cjs/recipe-browser.cjs.entry.js +64 -0
- package/dist/cjs/recipe-button.cjs.entry.js +24 -0
- package/dist/cjs/recipe-card.cjs.entry.js +78 -0
- package/dist/cjs/recipe-form-section.cjs.entry.js +20 -0
- package/dist/cjs/recipe-input.cjs.entry.js +24 -0
- package/dist/cjs/recipe-navbar.cjs.entry.js +30 -0
- package/dist/cjs/recipe-textarea.cjs.entry.js +23 -0
- package/dist/cjs/search-food.cjs.entry.js +36 -0
- package/dist/cjs/stencil-recipe-components.cjs.js +25 -0
- package/dist/collection/collection-manifest.json +22 -0
- package/dist/collection/components/my-component/my-component.cmp.test.js +27 -0
- package/dist/collection/components/my-component/my-component.css +3 -0
- package/dist/collection/components/my-component/my-component.js +95 -0
- package/dist/collection/components/no-recipe-found/no-recipe-found.css +76 -0
- package/dist/collection/components/no-recipe-found/no-recipe-found.js +107 -0
- package/dist/collection/components/recipe-browser/recipe-browser.css +183 -0
- package/dist/collection/components/recipe-browser/recipe-browser.js +220 -0
- package/dist/collection/components/recipe-button/recipe-button.css +34 -0
- package/dist/collection/components/recipe-button/recipe-button.js +89 -0
- package/dist/collection/components/recipe-card/recipe-card.css +207 -0
- package/dist/collection/components/recipe-card/recipe-card.js +260 -0
- package/dist/collection/components/recipe-form-section/recipe-form-section.css +54 -0
- package/dist/collection/components/recipe-form-section/recipe-form-section.js +82 -0
- package/dist/collection/components/recipe-input/recipe-input.css +47 -0
- package/dist/collection/components/recipe-input/recipe-input.js +167 -0
- package/dist/collection/components/recipe-navbar/recipe-navbar.css +56 -0
- package/dist/collection/components/recipe-navbar/recipe-navbar.js +55 -0
- package/dist/collection/components/recipe-textarea/recipe-textarea.css +43 -0
- package/dist/collection/components/recipe-textarea/recipe-textarea.js +146 -0
- package/dist/collection/components/search-food/search-food.css +117 -0
- package/dist/collection/components/search-food/search-food.js +92 -0
- package/dist/collection/index.js +10 -0
- package/dist/collection/utils/utils.js +3 -0
- package/dist/collection/utils/utils.unit.test.js +16 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/my-component.d.ts +11 -0
- package/dist/components/my-component.js +1 -0
- package/dist/components/no-recipe-found.d.ts +11 -0
- package/dist/components/no-recipe-found.js +1 -0
- package/dist/components/p-DlkZDAps.js +1 -0
- package/dist/components/recipe-browser.d.ts +11 -0
- package/dist/components/recipe-browser.js +1 -0
- package/dist/components/recipe-button.d.ts +11 -0
- package/dist/components/recipe-button.js +1 -0
- package/dist/components/recipe-card.d.ts +11 -0
- package/dist/components/recipe-card.js +1 -0
- package/dist/components/recipe-form-section.d.ts +11 -0
- package/dist/components/recipe-form-section.js +1 -0
- package/dist/components/recipe-input.d.ts +11 -0
- package/dist/components/recipe-input.js +1 -0
- package/dist/components/recipe-navbar.d.ts +11 -0
- package/dist/components/recipe-navbar.js +1 -0
- package/dist/components/recipe-textarea.d.ts +11 -0
- package/dist/components/recipe-textarea.js +1 -0
- package/dist/components/search-food.d.ts +11 -0
- package/dist/components/search-food.js +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/index-DxpnpZMq.js +1495 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/my-component.entry.js +31 -0
- package/dist/esm/no-recipe-found.entry.js +23 -0
- package/dist/esm/recipe-browser.entry.js +62 -0
- package/dist/esm/recipe-button.entry.js +22 -0
- package/dist/esm/recipe-card.entry.js +76 -0
- package/dist/esm/recipe-form-section.entry.js +18 -0
- package/dist/esm/recipe-input.entry.js +22 -0
- package/dist/esm/recipe-navbar.entry.js +28 -0
- package/dist/esm/recipe-textarea.entry.js +21 -0
- package/dist/esm/search-food.entry.js +34 -0
- package/dist/esm/stencil-recipe-components.js +21 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil-recipe-components/index.esm.js +1 -0
- package/dist/stencil-recipe-components/p-06b59cd5.entry.js +1 -0
- package/dist/stencil-recipe-components/p-2289adb0.entry.js +1 -0
- package/dist/stencil-recipe-components/p-5df4665a.entry.js +1 -0
- package/dist/stencil-recipe-components/p-83e3c89d.entry.js +1 -0
- package/dist/stencil-recipe-components/p-87586541.entry.js +1 -0
- package/dist/stencil-recipe-components/p-969201bf.entry.js +1 -0
- package/dist/stencil-recipe-components/p-DQuL1Twl.js +1 -0
- package/dist/stencil-recipe-components/p-DxpnpZMq.js +3 -0
- package/dist/stencil-recipe-components/p-b5c77a1a.entry.js +1 -0
- package/dist/stencil-recipe-components/p-c8a44beb.entry.js +1 -0
- package/dist/stencil-recipe-components/p-efd4f7bb.entry.js +1 -0
- package/dist/stencil-recipe-components/p-f5524ed4.entry.js +1 -0
- package/dist/stencil-recipe-components/stencil-recipe-components.esm.js +1 -0
- package/dist/types/components/my-component/my-component.cmp.test.d.ts +1 -0
- package/dist/types/components/my-component/my-component.d.ts +16 -0
- package/dist/types/components/no-recipe-found/no-recipe-found.d.ts +9 -0
- package/dist/types/components/recipe-browser/recipe-browser.d.ts +21 -0
- package/dist/types/components/recipe-button/recipe-button.d.ts +6 -0
- package/dist/types/components/recipe-card/recipe-card.d.ts +34 -0
- package/dist/types/components/recipe-form-section/recipe-form-section.d.ts +6 -0
- package/dist/types/components/recipe-input/recipe-input.d.ts +10 -0
- package/dist/types/components/recipe-navbar/recipe-navbar.d.ts +4 -0
- package/dist/types/components/recipe-textarea/recipe-textarea.d.ts +9 -0
- package/dist/types/components/search-food/search-food.d.ts +10 -0
- package/dist/types/components.d.ts +558 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/stencil-public-runtime.d.ts +1872 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/dist/types/utils/utils.unit.test.d.ts +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +82 -0
- package/readme.md +111 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
export class RecipeButton {
|
|
3
|
+
variant = 'primary';
|
|
4
|
+
type = 'button';
|
|
5
|
+
disabled = false;
|
|
6
|
+
render() {
|
|
7
|
+
return (h("button", { key: '69decd9fcbcb01bce1f5c78fdb79ccea94f4369d', type: this.type, class: {
|
|
8
|
+
button: true,
|
|
9
|
+
primary: this.variant === 'primary',
|
|
10
|
+
secondary: this.variant === 'secondary',
|
|
11
|
+
}, disabled: this.disabled }, h("slot", { key: '9561dcb8e2f50f8f85ccaacb0ff885b67a5eab1d' })));
|
|
12
|
+
}
|
|
13
|
+
static get is() { return "recipe-button"; }
|
|
14
|
+
static get encapsulation() { return "shadow"; }
|
|
15
|
+
static get originalStyleUrls() {
|
|
16
|
+
return {
|
|
17
|
+
"$": ["recipe-button.css"]
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
static get styleUrls() {
|
|
21
|
+
return {
|
|
22
|
+
"$": ["recipe-button.css"]
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
static get properties() {
|
|
26
|
+
return {
|
|
27
|
+
"variant": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"mutable": false,
|
|
30
|
+
"complexType": {
|
|
31
|
+
"original": "'primary' | 'secondary'",
|
|
32
|
+
"resolved": "\"primary\" | \"secondary\"",
|
|
33
|
+
"references": {}
|
|
34
|
+
},
|
|
35
|
+
"required": false,
|
|
36
|
+
"optional": false,
|
|
37
|
+
"docs": {
|
|
38
|
+
"tags": [],
|
|
39
|
+
"text": ""
|
|
40
|
+
},
|
|
41
|
+
"getter": false,
|
|
42
|
+
"setter": false,
|
|
43
|
+
"reflect": false,
|
|
44
|
+
"attribute": "variant",
|
|
45
|
+
"defaultValue": "'primary'"
|
|
46
|
+
},
|
|
47
|
+
"type": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"mutable": false,
|
|
50
|
+
"complexType": {
|
|
51
|
+
"original": "'button' | 'submit'",
|
|
52
|
+
"resolved": "\"button\" | \"submit\"",
|
|
53
|
+
"references": {}
|
|
54
|
+
},
|
|
55
|
+
"required": false,
|
|
56
|
+
"optional": false,
|
|
57
|
+
"docs": {
|
|
58
|
+
"tags": [],
|
|
59
|
+
"text": ""
|
|
60
|
+
},
|
|
61
|
+
"getter": false,
|
|
62
|
+
"setter": false,
|
|
63
|
+
"reflect": false,
|
|
64
|
+
"attribute": "type",
|
|
65
|
+
"defaultValue": "'button'"
|
|
66
|
+
},
|
|
67
|
+
"disabled": {
|
|
68
|
+
"type": "boolean",
|
|
69
|
+
"mutable": false,
|
|
70
|
+
"complexType": {
|
|
71
|
+
"original": "boolean",
|
|
72
|
+
"resolved": "boolean",
|
|
73
|
+
"references": {}
|
|
74
|
+
},
|
|
75
|
+
"required": false,
|
|
76
|
+
"optional": false,
|
|
77
|
+
"docs": {
|
|
78
|
+
"tags": [],
|
|
79
|
+
"text": ""
|
|
80
|
+
},
|
|
81
|
+
"getter": false,
|
|
82
|
+
"setter": false,
|
|
83
|
+
"reflect": false,
|
|
84
|
+
"attribute": "disabled",
|
|
85
|
+
"defaultValue": "false"
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
font-family: Arial, sans-serif;
|
|
4
|
+
}
|
|
5
|
+
.recipe-card {
|
|
6
|
+
position: relative;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
background: #ffffff;
|
|
9
|
+
border: 1px solid #eeeeee;
|
|
10
|
+
border-radius: 18px;
|
|
11
|
+
box-shadow: 0 6px 25px rgba(0, 0, 0, 0.05);
|
|
12
|
+
}
|
|
13
|
+
.image-container {
|
|
14
|
+
position: relative;
|
|
15
|
+
height: 220px;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
}
|
|
18
|
+
.image-container img {
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
display: block;
|
|
22
|
+
object-fit: cover;
|
|
23
|
+
}
|
|
24
|
+
.category {
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: 14px;
|
|
27
|
+
left: 14px;
|
|
28
|
+
padding: 6px 10px;
|
|
29
|
+
border-radius: 20px;
|
|
30
|
+
background: rgba(255, 255, 255, 0.94);
|
|
31
|
+
color: #444444;
|
|
32
|
+
font-size: 12px;
|
|
33
|
+
font-weight: 700;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.favorite {
|
|
37
|
+
position: absolute;
|
|
38
|
+
top: 12px;
|
|
39
|
+
right: 12px;
|
|
40
|
+
width: 38px;
|
|
41
|
+
height: 38px;
|
|
42
|
+
border: none;
|
|
43
|
+
border-radius: 50%;
|
|
44
|
+
background: rgba(255, 255, 255, 0.95);
|
|
45
|
+
color: #777777;
|
|
46
|
+
font-size: 24px;
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
}
|
|
49
|
+
.favorite.active {
|
|
50
|
+
color: #e05252;
|
|
51
|
+
}
|
|
52
|
+
.content {
|
|
53
|
+
padding: 18px;
|
|
54
|
+
}
|
|
55
|
+
.cuisine {
|
|
56
|
+
margin-bottom: 8px;
|
|
57
|
+
color: #f97316;
|
|
58
|
+
font-size: 12px;
|
|
59
|
+
font-weight: 600;
|
|
60
|
+
}
|
|
61
|
+
.content h3 {
|
|
62
|
+
margin: 0 0 16px;
|
|
63
|
+
color: #2c2c2c;
|
|
64
|
+
font-size: 20px;
|
|
65
|
+
line-height: 1.3;
|
|
66
|
+
}
|
|
67
|
+
.actions {
|
|
68
|
+
display: grid;
|
|
69
|
+
grid-template-columns: 1fr 1fr;
|
|
70
|
+
gap: 10px;
|
|
71
|
+
margin-top: 4px;
|
|
72
|
+
}
|
|
73
|
+
.view-button,
|
|
74
|
+
.planner-button {
|
|
75
|
+
width: 100%;
|
|
76
|
+
min-height: 42px;
|
|
77
|
+
border-radius: 9px;
|
|
78
|
+
font-family: Arial, sans-serif;
|
|
79
|
+
font-size: 13px;
|
|
80
|
+
font-weight: 600;
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
}
|
|
83
|
+
.view-button {
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
gap: 6px;
|
|
88
|
+
border: none;
|
|
89
|
+
background: #f97316;
|
|
90
|
+
color: white;
|
|
91
|
+
}
|
|
92
|
+
.view-button:hover {
|
|
93
|
+
background: #ea580c;
|
|
94
|
+
}
|
|
95
|
+
.planner-button {
|
|
96
|
+
border: 1px solid #fed7aa;
|
|
97
|
+
background: #fff7ed;
|
|
98
|
+
color: #ea580c;
|
|
99
|
+
}
|
|
100
|
+
.planner-button:hover {
|
|
101
|
+
background: #ffedd5;
|
|
102
|
+
}
|
|
103
|
+
.planner-overlay {
|
|
104
|
+
position: fixed;
|
|
105
|
+
inset: 0;
|
|
106
|
+
z-index: 9999;
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
padding: 20px;
|
|
111
|
+
background: rgba(0, 0, 0, 0.45);
|
|
112
|
+
}
|
|
113
|
+
.planner-modal {
|
|
114
|
+
width: min(420px, 100%);
|
|
115
|
+
padding: 24px;
|
|
116
|
+
border-radius: 18px;
|
|
117
|
+
background: white;
|
|
118
|
+
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
|
|
119
|
+
}
|
|
120
|
+
.planner-header {
|
|
121
|
+
display: flex;
|
|
122
|
+
align-items: flex-start;
|
|
123
|
+
justify-content: space-between;
|
|
124
|
+
gap: 15px;
|
|
125
|
+
margin-bottom: 22px;
|
|
126
|
+
}
|
|
127
|
+
.planner-header h4 {
|
|
128
|
+
margin: 0 0 6px;
|
|
129
|
+
font-size: 20px;
|
|
130
|
+
color: #2c2c2c;
|
|
131
|
+
}
|
|
132
|
+
.planner-header p {
|
|
133
|
+
margin: 0;
|
|
134
|
+
color: #777777;
|
|
135
|
+
font-size: 13px;
|
|
136
|
+
line-height: 1.5;
|
|
137
|
+
}
|
|
138
|
+
.close-button {
|
|
139
|
+
width: 32px;
|
|
140
|
+
height: 32px;
|
|
141
|
+
border: none;
|
|
142
|
+
border-radius: 50%;
|
|
143
|
+
background: #f5f5f5;
|
|
144
|
+
font-size: 22px;
|
|
145
|
+
color: #555555;
|
|
146
|
+
cursor: pointer;
|
|
147
|
+
}
|
|
148
|
+
.close-button:hover {
|
|
149
|
+
background: #eeeeee;
|
|
150
|
+
}
|
|
151
|
+
.planner-modal label {
|
|
152
|
+
display: block;
|
|
153
|
+
margin-bottom: 8px;
|
|
154
|
+
font-size: 13px;
|
|
155
|
+
font-weight: 600;
|
|
156
|
+
color: #444444;
|
|
157
|
+
}
|
|
158
|
+
.planner-modal select {
|
|
159
|
+
width: 100%;
|
|
160
|
+
height: 44px;
|
|
161
|
+
padding: 0 12px;
|
|
162
|
+
border: 1px solid #dddddd;
|
|
163
|
+
border-radius: 10px;
|
|
164
|
+
background: white;
|
|
165
|
+
font-family: Arial, sans-serif;
|
|
166
|
+
font-size: 14px;
|
|
167
|
+
outline: none;
|
|
168
|
+
box-sizing: border-box;
|
|
169
|
+
}
|
|
170
|
+
.planner-actions {
|
|
171
|
+
display: flex;
|
|
172
|
+
gap: 10px;
|
|
173
|
+
margin-top: 20px;
|
|
174
|
+
}
|
|
175
|
+
.cancel-button,
|
|
176
|
+
.add-button {
|
|
177
|
+
flex: 1;
|
|
178
|
+
height: 42px;
|
|
179
|
+
border-radius: 9px;
|
|
180
|
+
font-family: Arial, sans-serif;
|
|
181
|
+
font-size: 14px;
|
|
182
|
+
font-weight: 700;
|
|
183
|
+
cursor: pointer;
|
|
184
|
+
}
|
|
185
|
+
.cancel-button {
|
|
186
|
+
border: 1px solid #dddddd;
|
|
187
|
+
background: white;
|
|
188
|
+
color: #555555;
|
|
189
|
+
}
|
|
190
|
+
.cancel-button:hover {
|
|
191
|
+
background: #f5f5f5;
|
|
192
|
+
}
|
|
193
|
+
.add-button {
|
|
194
|
+
border: none;
|
|
195
|
+
background: #f97316;
|
|
196
|
+
color: white;
|
|
197
|
+
}
|
|
198
|
+
.add-button:hover:not(:disabled) {
|
|
199
|
+
background: #ea580c;
|
|
200
|
+
}
|
|
201
|
+
.add-button:disabled {
|
|
202
|
+
opacity: 0.5;
|
|
203
|
+
cursor: not-allowed;
|
|
204
|
+
}
|
|
205
|
+
.field {
|
|
206
|
+
padding-top: 10px;
|
|
207
|
+
}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
export class RecipeCard {
|
|
3
|
+
recipeId = '';
|
|
4
|
+
recipeTitle = '';
|
|
5
|
+
image = '';
|
|
6
|
+
category = '';
|
|
7
|
+
cuisine = '';
|
|
8
|
+
favorite = false;
|
|
9
|
+
favoriteToggle;
|
|
10
|
+
recipeClick;
|
|
11
|
+
addToPlanner;
|
|
12
|
+
showPlanner = false;
|
|
13
|
+
selectedDay = '';
|
|
14
|
+
selectedMeal = '';
|
|
15
|
+
handleViewRecipe = () => {
|
|
16
|
+
this.recipeClick.emit({
|
|
17
|
+
id: this.recipeId,
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
toggleFavorite = (event) => {
|
|
21
|
+
event.stopPropagation();
|
|
22
|
+
this.favoriteToggle.emit({
|
|
23
|
+
id: this.recipeId,
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
openPlanner = (event) => {
|
|
27
|
+
event.stopPropagation();
|
|
28
|
+
this.selectedDay = '';
|
|
29
|
+
this.selectedMeal = '';
|
|
30
|
+
this.showPlanner = true;
|
|
31
|
+
};
|
|
32
|
+
closePlanner = () => {
|
|
33
|
+
this.showPlanner = false;
|
|
34
|
+
this.selectedDay = '';
|
|
35
|
+
this.selectedMeal = '';
|
|
36
|
+
};
|
|
37
|
+
handleDayChange = (event) => {
|
|
38
|
+
const select = event.target;
|
|
39
|
+
this.selectedDay = select.value;
|
|
40
|
+
};
|
|
41
|
+
handleMealChange = (event) => {
|
|
42
|
+
const select = event.target;
|
|
43
|
+
this.selectedMeal = select.value;
|
|
44
|
+
};
|
|
45
|
+
confirmPlanner = () => {
|
|
46
|
+
if (!this.selectedDay || !this.selectedMeal) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
this.addToPlanner.emit({
|
|
50
|
+
id: this.recipeId,
|
|
51
|
+
day: this.selectedDay,
|
|
52
|
+
mealType: this.selectedMeal,
|
|
53
|
+
});
|
|
54
|
+
this.closePlanner();
|
|
55
|
+
};
|
|
56
|
+
render() {
|
|
57
|
+
const favoriteLabel = this.favorite ? `Remove ${this.recipeTitle} from favorites` : `Add ${this.recipeTitle} to favorites`;
|
|
58
|
+
const canAdd = this.selectedDay !== '' && this.selectedMeal !== '';
|
|
59
|
+
return (h("article", { key: 'e9cac86199c4999118277c301095f0d5fdc0465e', class: "recipe-card" }, h("div", { key: '41cc1e4446a23d097181d023e28ef26ec8e1c709', class: "image-container" }, h("img", { key: '5f9d485af235d895d5ba410826fe00ead8795420', src: this.image, alt: this.recipeTitle, loading: "lazy", decoding: "async" }), this.category && h("span", { key: '8f50506474a6ec6d9cb973bec927640fe1bbc14e', class: "category" }, this.category), h("button", { key: 'cc2b1c5291f30e8fc8cb14591a884cebd3343018', type: "button", class: {
|
|
60
|
+
favorite: true,
|
|
61
|
+
active: this.favorite,
|
|
62
|
+
}, onClick: this.toggleFavorite, "aria-label": favoriteLabel, "aria-pressed": this.favorite }, this.favorite ? '♥' : '♡')), h("div", { key: '8cb4a3397069c51ee95baff05662bf9f3aee9c1d', class: "content" }, this.cuisine && (h("div", { key: 'de5ad5288350fe2f251ffa62cda82fa35bf53f3e', class: "cuisine" }, h("span", { key: '87aa4b6d69bd35acf850b5650b8f5a2db28adef0' }, "\u2726"), this.cuisine)), h("h3", { key: '332a9140cc9627d02ab1e5621fb0b2f0c0d8f754' }, this.recipeTitle), h("div", { key: '7c2962abe8ebb3cb22e91b61acf1362dc6216f81', class: "actions" }, h("button", { key: 'fc9b769b0198145d8a49dfaf837acbe24eee3f2e', type: "button", class: "view-button", onClick: this.handleViewRecipe }, "View Recipe", h("span", { key: '50f0f5e55f9caab5d70f16aaf3585c80c1e5ac7c' }, "\u2192")), h("button", { key: '6936bec5da6c7509f51abf2646312cc0315dbe99', type: "button", class: "planner-button", onClick: this.openPlanner }, "\uFF0B Add to Planner"))), this.showPlanner && (h("div", { key: 'a15cc6195d9331cadbec3eae206a9c82737be735', class: "planner-overlay", onClick: this.closePlanner }, h("div", { key: 'a5b74b52a845f1488e3eeb2356fc6044f1c15912', class: "planner-modal", onClick: event => event.stopPropagation() }, h("div", { key: '572800bf57b24b41cadfacb49da5dccef6a9f132', class: "planner-header" }, h("div", { key: 'cd7f730b46ef2fad37a22e05bc5bc3e1fdc6d0c6' }, h("h4", { key: 'c30504584428ffac7a3dfe0a1d5c2c7c895d1665' }, "Add to Meal Planner"), h("p", { key: 'dbee3ab4e4dc0b0b3c553684e447a931813b7c66' }, "Add ", h("strong", { key: '501eee64ac955ccaa7116a7f20f35473ecc2912d' }, this.recipeTitle))), h("button", { key: '55ca144a870c33892b1d61051c8b60dab1528bb8', type: "button", class: "close-button", onClick: this.closePlanner }, "\u00D7")), h("div", { key: 'b8e4b435c27e0a5536335897b59386bd9b4b1b1b', class: "field" }, h("label", { key: 'b26aec673a147830320a92389d6f2da7a4a901e4', htmlFor: "planner-day" }, "Day"), h("select", { key: '0b95a3b9b32278534a0157f469281a67e0c0ad9b', id: "planner-day", onChange: this.handleDayChange }, h("option", { key: 'c2e6e6d89ece44b371ae377b395aa8719935f326', value: "" }, "Select a day"), h("option", { key: '98c27f6fb8e49de25ecabda4f52436d8c3fac93b', value: "Monday" }, "Monday"), h("option", { key: '7e782ca431ad476040a87f4664341e679a435fd0', value: "Tuesday" }, "Tuesday"), h("option", { key: '12f03a59c1a6a4c9d087e612259b585ad1609128', value: "Wednesday" }, "Wednesday"), h("option", { key: '718c4397a7c13ad5e38603c97f3fe43f5da17fce', value: "Thursday" }, "Thursday"), h("option", { key: 'bde3aaa5cce683c0be7a07c2ad4514bf1ed259a4', value: "Friday" }, "Friday"), h("option", { key: '28adf4b21ed230171a653a173b6f1564fdadbd86', value: "Saturday" }, "Saturday"), h("option", { key: 'ba10816944f43c0f693d7e8e926d7cf9514b8f1a', value: "Sunday" }, "Sunday"))), h("div", { key: '2f2bbf50b1e3e515424770fe183f40321ed4a0ec', class: "field" }, h("label", { key: '3dbb417dd46359dbc524ab187a26b5af3001b809', htmlFor: "planner-meal" }, "Meal"), h("select", { key: 'ce276fce3064936bf7695897803fce10e83e345c', id: "planner-meal", onChange: this.handleMealChange }, h("option", { key: '6c05f317d30a94be195c432d926034e0b7d1bcb5', value: "" }, "Select a meal"), h("option", { key: '1392d0ae0d8922547329790707812474e63fcc3b', value: "Breakfast" }, "Breakfast"), h("option", { key: '2cc7682e5108e782220dbda63e403d90c04dbd5e', value: "Lunch" }, "Lunch"), h("option", { key: '255117f914a6112ccf9169f52ae35bc99df1c549', value: "Dinner" }, "Dinner"))), h("div", { key: 'efd8158033d291082b9cb131deee84b09a649411', class: "planner-actions" }, h("button", { key: '816d91efb664e45ea8bb49285049995536848ba5', type: "button", class: "cancel-button", onClick: this.closePlanner }, "Cancel"), h("button", { key: 'd4b72a6d50bfdf116210f34a67c8f15bc9d38a69', type: "button", class: "add-button", disabled: !canAdd, onClick: this.confirmPlanner }, "Add to Planner")))))));
|
|
63
|
+
}
|
|
64
|
+
static get is() { return "recipe-card"; }
|
|
65
|
+
static get encapsulation() { return "shadow"; }
|
|
66
|
+
static get originalStyleUrls() {
|
|
67
|
+
return {
|
|
68
|
+
"$": ["recipe-card.css"]
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
static get styleUrls() {
|
|
72
|
+
return {
|
|
73
|
+
"$": ["recipe-card.css"]
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
static get properties() {
|
|
77
|
+
return {
|
|
78
|
+
"recipeId": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"mutable": false,
|
|
81
|
+
"complexType": {
|
|
82
|
+
"original": "string",
|
|
83
|
+
"resolved": "string",
|
|
84
|
+
"references": {}
|
|
85
|
+
},
|
|
86
|
+
"required": false,
|
|
87
|
+
"optional": false,
|
|
88
|
+
"docs": {
|
|
89
|
+
"tags": [],
|
|
90
|
+
"text": ""
|
|
91
|
+
},
|
|
92
|
+
"getter": false,
|
|
93
|
+
"setter": false,
|
|
94
|
+
"reflect": false,
|
|
95
|
+
"attribute": "recipe-id",
|
|
96
|
+
"defaultValue": "''"
|
|
97
|
+
},
|
|
98
|
+
"recipeTitle": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"mutable": false,
|
|
101
|
+
"complexType": {
|
|
102
|
+
"original": "string",
|
|
103
|
+
"resolved": "string",
|
|
104
|
+
"references": {}
|
|
105
|
+
},
|
|
106
|
+
"required": false,
|
|
107
|
+
"optional": false,
|
|
108
|
+
"docs": {
|
|
109
|
+
"tags": [],
|
|
110
|
+
"text": ""
|
|
111
|
+
},
|
|
112
|
+
"getter": false,
|
|
113
|
+
"setter": false,
|
|
114
|
+
"reflect": false,
|
|
115
|
+
"attribute": "recipe-title",
|
|
116
|
+
"defaultValue": "''"
|
|
117
|
+
},
|
|
118
|
+
"image": {
|
|
119
|
+
"type": "string",
|
|
120
|
+
"mutable": false,
|
|
121
|
+
"complexType": {
|
|
122
|
+
"original": "string",
|
|
123
|
+
"resolved": "string",
|
|
124
|
+
"references": {}
|
|
125
|
+
},
|
|
126
|
+
"required": false,
|
|
127
|
+
"optional": false,
|
|
128
|
+
"docs": {
|
|
129
|
+
"tags": [],
|
|
130
|
+
"text": ""
|
|
131
|
+
},
|
|
132
|
+
"getter": false,
|
|
133
|
+
"setter": false,
|
|
134
|
+
"reflect": false,
|
|
135
|
+
"attribute": "image",
|
|
136
|
+
"defaultValue": "''"
|
|
137
|
+
},
|
|
138
|
+
"category": {
|
|
139
|
+
"type": "string",
|
|
140
|
+
"mutable": false,
|
|
141
|
+
"complexType": {
|
|
142
|
+
"original": "string",
|
|
143
|
+
"resolved": "string",
|
|
144
|
+
"references": {}
|
|
145
|
+
},
|
|
146
|
+
"required": false,
|
|
147
|
+
"optional": false,
|
|
148
|
+
"docs": {
|
|
149
|
+
"tags": [],
|
|
150
|
+
"text": ""
|
|
151
|
+
},
|
|
152
|
+
"getter": false,
|
|
153
|
+
"setter": false,
|
|
154
|
+
"reflect": false,
|
|
155
|
+
"attribute": "category",
|
|
156
|
+
"defaultValue": "''"
|
|
157
|
+
},
|
|
158
|
+
"cuisine": {
|
|
159
|
+
"type": "string",
|
|
160
|
+
"mutable": false,
|
|
161
|
+
"complexType": {
|
|
162
|
+
"original": "string",
|
|
163
|
+
"resolved": "string",
|
|
164
|
+
"references": {}
|
|
165
|
+
},
|
|
166
|
+
"required": false,
|
|
167
|
+
"optional": false,
|
|
168
|
+
"docs": {
|
|
169
|
+
"tags": [],
|
|
170
|
+
"text": ""
|
|
171
|
+
},
|
|
172
|
+
"getter": false,
|
|
173
|
+
"setter": false,
|
|
174
|
+
"reflect": false,
|
|
175
|
+
"attribute": "cuisine",
|
|
176
|
+
"defaultValue": "''"
|
|
177
|
+
},
|
|
178
|
+
"favorite": {
|
|
179
|
+
"type": "boolean",
|
|
180
|
+
"mutable": false,
|
|
181
|
+
"complexType": {
|
|
182
|
+
"original": "boolean",
|
|
183
|
+
"resolved": "boolean",
|
|
184
|
+
"references": {}
|
|
185
|
+
},
|
|
186
|
+
"required": false,
|
|
187
|
+
"optional": false,
|
|
188
|
+
"docs": {
|
|
189
|
+
"tags": [],
|
|
190
|
+
"text": ""
|
|
191
|
+
},
|
|
192
|
+
"getter": false,
|
|
193
|
+
"setter": false,
|
|
194
|
+
"reflect": false,
|
|
195
|
+
"attribute": "favorite",
|
|
196
|
+
"defaultValue": "false"
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
static get states() {
|
|
201
|
+
return {
|
|
202
|
+
"showPlanner": {},
|
|
203
|
+
"selectedDay": {},
|
|
204
|
+
"selectedMeal": {}
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
static get events() {
|
|
208
|
+
return [{
|
|
209
|
+
"method": "favoriteToggle",
|
|
210
|
+
"name": "favoriteToggle",
|
|
211
|
+
"bubbles": true,
|
|
212
|
+
"cancelable": true,
|
|
213
|
+
"composed": true,
|
|
214
|
+
"docs": {
|
|
215
|
+
"tags": [],
|
|
216
|
+
"text": ""
|
|
217
|
+
},
|
|
218
|
+
"complexType": {
|
|
219
|
+
"original": "{ id: string }",
|
|
220
|
+
"resolved": "{ id: string; }",
|
|
221
|
+
"references": {}
|
|
222
|
+
}
|
|
223
|
+
}, {
|
|
224
|
+
"method": "recipeClick",
|
|
225
|
+
"name": "recipeClick",
|
|
226
|
+
"bubbles": true,
|
|
227
|
+
"cancelable": true,
|
|
228
|
+
"composed": true,
|
|
229
|
+
"docs": {
|
|
230
|
+
"tags": [],
|
|
231
|
+
"text": ""
|
|
232
|
+
},
|
|
233
|
+
"complexType": {
|
|
234
|
+
"original": "{ id: string }",
|
|
235
|
+
"resolved": "{ id: string; }",
|
|
236
|
+
"references": {}
|
|
237
|
+
}
|
|
238
|
+
}, {
|
|
239
|
+
"method": "addToPlanner",
|
|
240
|
+
"name": "add-to-planner",
|
|
241
|
+
"bubbles": true,
|
|
242
|
+
"cancelable": true,
|
|
243
|
+
"composed": true,
|
|
244
|
+
"docs": {
|
|
245
|
+
"tags": [],
|
|
246
|
+
"text": ""
|
|
247
|
+
},
|
|
248
|
+
"complexType": {
|
|
249
|
+
"original": "PlannerEvent",
|
|
250
|
+
"resolved": "{ id: string; day: \"Monday\" | \"Tuesday\" | \"Wednesday\" | \"Thursday\" | \"Friday\" | \"Saturday\" | \"Sunday\"; mealType: MealType; }",
|
|
251
|
+
"references": {
|
|
252
|
+
"PlannerEvent": {
|
|
253
|
+
"location": "global",
|
|
254
|
+
"id": "global::PlannerEvent"
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}];
|
|
259
|
+
}
|
|
260
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.section {
|
|
6
|
+
padding: 30px;
|
|
7
|
+
border: 1px solid #e9e5e1;
|
|
8
|
+
border-radius: 22px;
|
|
9
|
+
background: white;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.section-heading {
|
|
13
|
+
display: flex;
|
|
14
|
+
gap: 14px;
|
|
15
|
+
margin-bottom: 25px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.section-heading > span {
|
|
19
|
+
width: 32px;
|
|
20
|
+
height: 32px;
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-shrink: 0;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
border-radius: 50%;
|
|
26
|
+
background: #f3e9e1;
|
|
27
|
+
color: #f97316;
|
|
28
|
+
font-size: 16px;
|
|
29
|
+
font-weight: 700;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.section-heading h2 {
|
|
33
|
+
margin: 0;
|
|
34
|
+
color: #2c2c2c;
|
|
35
|
+
font-family: Arial, sans-serif;
|
|
36
|
+
font-size: 24px;
|
|
37
|
+
font-weight: 500;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.section-heading p {
|
|
41
|
+
margin: 4px 0 0;
|
|
42
|
+
color: #999999;
|
|
43
|
+
font-size: 16px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.content {
|
|
47
|
+
display: block;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@media (max-width: 600px) {
|
|
51
|
+
.section {
|
|
52
|
+
padding: 20px;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
export class RecipeFormSection {
|
|
3
|
+
number;
|
|
4
|
+
formTitle;
|
|
5
|
+
description;
|
|
6
|
+
render() {
|
|
7
|
+
return (h("section", { key: '39aba625964827041a26eaf4e59e95fce101af07', class: "section" }, h("div", { key: '7f7ed2a37b09b8efa5bbcbe0087e7b575776e61b', class: "section-heading" }, h("span", { key: 'ae898bcf907768d9abe73e0ff18c39614b6ae23b' }, this.number), h("div", { key: '16c1e35edf0e0bba569ab260a640981419a83d44' }, h("h2", { key: '61def6637277c674aa708041c148925595493ad7' }, this.formTitle), h("p", { key: '62ab7295b08d2ade90ba9dbcb61e2cfe26929c84' }, this.description))), h("div", { key: 'e56052a380d5c72190b776ea8c7e80f1099a8442', class: "content" }, h("slot", { key: '7735bc4718c0d4c7c0805abd1d176fdf3270faa3' }))));
|
|
8
|
+
}
|
|
9
|
+
static get is() { return "recipe-form-section"; }
|
|
10
|
+
static get encapsulation() { return "shadow"; }
|
|
11
|
+
static get originalStyleUrls() {
|
|
12
|
+
return {
|
|
13
|
+
"$": ["recipe-form-section.css"]
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
static get styleUrls() {
|
|
17
|
+
return {
|
|
18
|
+
"$": ["recipe-form-section.css"]
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
static get properties() {
|
|
22
|
+
return {
|
|
23
|
+
"number": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"mutable": false,
|
|
26
|
+
"complexType": {
|
|
27
|
+
"original": "string",
|
|
28
|
+
"resolved": "string",
|
|
29
|
+
"references": {}
|
|
30
|
+
},
|
|
31
|
+
"required": true,
|
|
32
|
+
"optional": false,
|
|
33
|
+
"docs": {
|
|
34
|
+
"tags": [],
|
|
35
|
+
"text": ""
|
|
36
|
+
},
|
|
37
|
+
"getter": false,
|
|
38
|
+
"setter": false,
|
|
39
|
+
"reflect": false,
|
|
40
|
+
"attribute": "number"
|
|
41
|
+
},
|
|
42
|
+
"formTitle": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"mutable": false,
|
|
45
|
+
"complexType": {
|
|
46
|
+
"original": "string",
|
|
47
|
+
"resolved": "string",
|
|
48
|
+
"references": {}
|
|
49
|
+
},
|
|
50
|
+
"required": true,
|
|
51
|
+
"optional": false,
|
|
52
|
+
"docs": {
|
|
53
|
+
"tags": [],
|
|
54
|
+
"text": ""
|
|
55
|
+
},
|
|
56
|
+
"getter": false,
|
|
57
|
+
"setter": false,
|
|
58
|
+
"reflect": false,
|
|
59
|
+
"attribute": "form-title"
|
|
60
|
+
},
|
|
61
|
+
"description": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"mutable": false,
|
|
64
|
+
"complexType": {
|
|
65
|
+
"original": "string",
|
|
66
|
+
"resolved": "string",
|
|
67
|
+
"references": {}
|
|
68
|
+
},
|
|
69
|
+
"required": true,
|
|
70
|
+
"optional": false,
|
|
71
|
+
"docs": {
|
|
72
|
+
"tags": [],
|
|
73
|
+
"text": ""
|
|
74
|
+
},
|
|
75
|
+
"getter": false,
|
|
76
|
+
"setter": false,
|
|
77
|
+
"reflect": false,
|
|
78
|
+
"attribute": "description"
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|