@gurpinderjitsingh/recipe-ui 0.1.5 → 0.2.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/dist/cjs/app-modal_7.cjs.entry.js +11 -7
- package/dist/cjs/app-toast.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/recipe-ui.cjs.js +1 -1
- package/dist/collection/components/app-toast/app-toast.js +1 -1
- package/dist/collection/components/meal-plan-day/meal-plan-day.css +149 -13
- package/dist/collection/components/meal-plan-day/meal-plan-day.js +23 -8
- package/dist/collection/components/recipe-card/recipe-card.js +1 -1
- package/dist/collection/components/recipe-filter-bar/recipe-filter-bar.js +1 -1
- package/dist/collection/components/recipe-form/recipe-form.js +3 -1
- package/dist/collection/components/recipe-rating/recipe-rating.js +1 -1
- package/dist/collection/components/recipe-search-bar/recipe-search-bar.js +1 -1
- package/dist/components/app-toast.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/meal-plan-day.js +1 -1
- package/dist/components/p-CN2vLHNY.js +1 -0
- package/dist/components/{p-BRKGu69u.js → p-DrDPFXTB.js} +1 -1
- package/dist/components/{p-BekLK-Pb.js → p-Q8V4JgYC.js} +1 -1
- package/dist/components/p-S4266va_.js +1 -0
- package/dist/components/{p-COHQTgKC.js → p-fNGqqs-I.js} +1 -1
- package/dist/components/{p-kbrkhGSm.js → p-gWE9Vqi0.js} +1 -1
- package/dist/components/{p-B4H61SFd.js → p-snMSuFkY.js} +1 -1
- package/dist/components/recipe-card.js +1 -1
- package/dist/components/recipe-filter-bar.js +1 -1
- package/dist/components/recipe-form.js +1 -1
- package/dist/components/recipe-rating.js +1 -1
- package/dist/components/recipe-search-bar.js +1 -1
- package/dist/esm/app-modal_7.entry.js +11 -7
- package/dist/esm/app-toast.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/recipe-ui.js +1 -1
- package/dist/recipe-ui/p-268be6b1.entry.js +1 -0
- package/dist/recipe-ui/p-97e73b62.entry.js +1 -0
- package/dist/recipe-ui/recipe-ui.esm.js +1 -1
- package/dist/types/components/meal-plan-day/meal-plan-day.d.ts +2 -7
- package/dist/types/components.d.ts +11 -28
- package/package.json +1 -1
- package/dist/components/p-BZBToMAv.js +0 -1
- package/dist/components/p-DsyQvPDo.js +0 -1
- package/dist/recipe-ui/p-697b1175.entry.js +0 -1
- package/dist/recipe-ui/p-6ef28048.entry.js +0 -1
|
@@ -19,7 +19,7 @@ const RecipeCard = class {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
return (index.h("div", { key: '
|
|
22
|
+
return (index.h("div", { key: 'c9dc0d8c98899cf188fc46c72b5e809831332f24', class: "card", onClick: () => this.cardClick.emit() }, index.h("div", { key: '12e0512dc7ee78f46843f81483c5f7bf1fbc3616', class: "image-wrap" }, this.image ? index.h("img", { src: this.image, alt: this.recipeTitle }) : index.h("div", { class: "placeholder" }), index.h("button", { key: '95ab4db232ee878d61e272ce7a4814a48790c01d', class: { 'fav-btn': true, active: this.favorite }, onClick: this.onFavoriteClick, "aria-label": "Toggle favorite" }, this.favorite ? '★' : '☆')), index.h("div", { key: 'a2906c670d693a473b87042ff6b0ada03627205b', class: "body" }, index.h("h3", { key: '2b0f4afecfdfd9cc996dcec29bd86957687667e3' }, this.recipeTitle), this.category && index.h("span", { key: '1b9c31d2723d2c87d51021569271366bac550a2f', class: "category" }, this.category), index.h("div", { key: 'd79b1cc33dcced145c3551874f69b581b4734297', class: "actions" }, index.h("slot", { key: '9a43cf770ea8fa189564fbe14f4f135a4d8e9551', name: "actions" })))));
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
RecipeCard.style = recipeCardCss();
|
|
@@ -55,7 +55,7 @@ const RecipeSearchBar = class {
|
|
|
55
55
|
this.internalValue = newVal;
|
|
56
56
|
}
|
|
57
57
|
render() {
|
|
58
|
-
return (index.h("div", { key: '
|
|
58
|
+
return (index.h("div", { key: 'b55c496d5c2968b4b79c40b9333c62ed4653e76d', class: "wrap" }, index.h("input", { key: '081ae0dfde47acca677c746bc88cda1864eac851', type: "search", placeholder: this.placeholder, value: this.internalValue, onInput: this.onInput, onKeyDown: this.onKeyDown }), index.h("button", { key: '44cde335aec87330bb4486883c9cf836a6855ad0', onClick: () => this.search.emit({ value: this.internalValue }), "aria-label": "Search" }, "\uD83D\uDD0D")));
|
|
59
59
|
}
|
|
60
60
|
static get watchers() { return {
|
|
61
61
|
"value": [{
|
|
@@ -79,7 +79,7 @@ const RecipeFilterBar = class {
|
|
|
79
79
|
}
|
|
80
80
|
render() {
|
|
81
81
|
const cats = Array.isArray(this.categories) ? this.categories : [];
|
|
82
|
-
return (index.h("div", { key: '
|
|
82
|
+
return (index.h("div", { key: '90b26633c07d813221b1cc44705c5fe510de994f', class: "wrap" }, index.h("button", { key: 'a41696529d8611f283460da1efe9205bd0b36260', class: { chip: true, active: this.active === '' }, onClick: () => this.select('') }, "All"), cats.map((c) => (index.h("button", { class: { chip: true, active: this.active === c }, onClick: () => this.select(c) }, c)))));
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
85
|
RecipeFilterBar.style = recipeFilterBarCss();
|
|
@@ -96,7 +96,7 @@ const RecipeRating = class {
|
|
|
96
96
|
}
|
|
97
97
|
render() {
|
|
98
98
|
const stars = Array.from({ length: this.max }, (_, i) => i + 1);
|
|
99
|
-
return (index.h("div", { key: '
|
|
99
|
+
return (index.h("div", { key: '2d5251ae7d3a24d613b759e89ba78de1568426d8', class: "wrap", role: this.readonly ? undefined : 'radiogroup' }, stars.map((s) => (index.h("span", { class: { star: true, filled: s <= this.value, clickable: !this.readonly }, onClick: () => !this.readonly && this.ratingChange.emit({ value: s }) }, "\u2605")))));
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
102
|
RecipeRating.style = recipeRatingCss();
|
|
@@ -166,6 +166,8 @@ const RecipeForm = class {
|
|
|
166
166
|
const errors = {};
|
|
167
167
|
if (!this.title.trim())
|
|
168
168
|
errors.title = 'Title is required.';
|
|
169
|
+
if (!this.category.trim())
|
|
170
|
+
errors.category = 'Category is required.';
|
|
169
171
|
const cleanIngredients = this.ingredients.map((i) => i.trim()).filter(Boolean);
|
|
170
172
|
if (cleanIngredients.length === 0)
|
|
171
173
|
errors.ingredients = 'Add at least one ingredient.';
|
|
@@ -180,7 +182,7 @@ const RecipeForm = class {
|
|
|
180
182
|
this.ingredients = next;
|
|
181
183
|
}
|
|
182
184
|
render() {
|
|
183
|
-
return (index.h("form", { key: '
|
|
185
|
+
return (index.h("form", { key: 'd7bf28b14b5d445221c52595bd827f49eed9306b', onSubmit: this.onSubmit }, index.h("slot", { key: '0ffc3f7fd2e5a15771ae36629365c53b1c44d934', name: "header" }), index.h("label", { key: '617617d1d4e5b9cbfc506340f3ffcab0364bb402' }, "Title", index.h("input", { key: '9be17e32164005466bf208323380603e33e43f6e', type: "text", value: this.title, onInput: (e) => (this.title = e.target.value) }), this.errors.title && index.h("span", { key: 'e1ecebe7af1b6b13a392f4ceb99651c6f87aea43', class: "error" }, this.errors.title)), index.h("label", { key: '6ce777cc37e11e9c063e43e301d9c93fa7ddf4b4' }, "Image URL", index.h("input", { key: '37839fabadb556def7f240e8116629315ca1ad73', type: "text", value: this.image, onInput: (e) => (this.image = e.target.value) })), index.h("label", { key: 'c870efae293faecf06e5d9481d302779c77aac39' }, "Category", index.h("input", { key: '1cc8a5a113ac6a215dc0c53b43c1f9167afd69f4', type: "text", value: this.category, onInput: (e) => (this.category = e.target.value) }), this.errors.category && index.h("span", { key: 'ed78cadd9df6f24e700aebc6f85ce993c3d4746b', class: "error" }, this.errors.category)), index.h("div", { key: '0cbed02ba6b4b021d7cce4ffd9fb3e041452db00', class: "field" }, index.h("span", { key: '6e8023d7fa1c3a345ac8a1ffca9de1b57af25e8c' }, "Ingredients"), this.ingredients.map((ing, i) => (index.h("div", { class: "ingredient-row" }, index.h("input", { type: "text", value: ing, onInput: (e) => this.updateIngredient(i, e.target.value) }), index.h("button", { type: "button", onClick: () => this.removeIngredient(i), "aria-label": "Remove" }, "\u2715")))), index.h("button", { key: 'c6fe3f2daad8c3f19daa3570c6e593c6b089aa57', type: "button", class: "add-btn", onClick: this.addIngredient }, "+ Add ingredient"), this.errors.ingredients && index.h("span", { key: 'bfec646ff34633a03d6b3368c5fb095bc3066025', class: "error" }, this.errors.ingredients)), index.h("label", { key: 'd3487e03e2c26afe9b3807a9d1f1240dabb30373' }, "Instructions", index.h("textarea", { key: 'ade48aaca40198665a1fb1525834c27ec0ad0350', rows: 5, onInput: (e) => (this.instructions = e.target.value) }, this.instructions), this.errors.instructions && index.h("span", { key: 'c90068359e0448b350af5e8b15e50cce682a1615', class: "error" }, this.errors.instructions)), index.h("div", { key: '2621aec625328743a60c79e49275384017000ccb', class: "footer" }, index.h("slot", { key: '5d1466af5beba19e66612a7343727ab71e44455f', name: "footer" }), index.h("button", { key: '5a4883d864051e8081b6a7e1f5c1fb10e7bc5c1a', type: "button", class: "cancel-btn", onClick: () => this.cancel.emit() }, "Cancel"), index.h("button", { key: '64d4c7e5cad53b1376dce3e73860fc3d4b4d9ff2', type: "submit", class: "save-btn" }, "Save Recipe"))));
|
|
184
186
|
}
|
|
185
187
|
static get watchers() { return {
|
|
186
188
|
"initialData": [{
|
|
@@ -190,7 +192,7 @@ const RecipeForm = class {
|
|
|
190
192
|
};
|
|
191
193
|
RecipeForm.style = recipeFormCss();
|
|
192
194
|
|
|
193
|
-
const mealPlanDayCss = () => `:host{display:block;font-family
|
|
195
|
+
const mealPlanDayCss = () => `:host{display:block;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif}.day-col{background:#ffffff;border:1px solid #e8eaed;border-radius:12px;padding:14px;min-width:160px;display:flex;flex-direction:column;gap:10px;box-shadow:0 1px 2px rgba(16, 24, 40, 0.04);transition:box-shadow 0.15s ease, border-color 0.15s ease}.day-col:hover{box-shadow:0 4px 12px rgba(16, 24, 40, 0.08);border-color:#d8dce1}.col-header{display:flex;align-items:center;gap:6px;padding-bottom:8px;border-bottom:1px solid #f0f1f3}.col-header .icon{font-size:15px;line-height:1}.col-header h3{margin:0;font-size:12.5px;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;color:#4b5563;flex:1}.count-badge{background:#eef2ff;color:#4338ca;font-size:10.5px;font-weight:700;padding:1px 7px;border-radius:999px;line-height:1.5}.meals{display:flex;flex-direction:column;gap:6px;min-height:44px}.meal-chip{display:flex;align-items:center;gap:8px;background:#f9fafb;border:1px solid #eef0f2;border-radius:9px;padding:6px 8px;font-size:12.5px;transition:background 0.12s ease}.meal-chip:hover{background:#f3f4f6}.thumb{width:28px;height:28px;border-radius:6px;overflow:hidden;flex-shrink:0;background:#e5e7eb}.thumb img{width:100%;height:100%;object-fit:cover;display:block}.meal-chip .title{flex:1;color:#1f2937;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.remove-btn{border:none;background:none;cursor:pointer;color:#9ca3af;font-size:11px;line-height:1;padding:3px;border-radius:5px;transition:color 0.12s ease, background 0.12s ease}.remove-btn:hover{color:#dc2626;background:#fef2f2}.empty{font-size:12px;color:#9ca3af;margin:6px 0;text-align:center;font-style:italic}.add-btn{display:flex;align-items:center;justify-content:center;gap:4px;border:1.5px dashed #d1d5db;background:none;border-radius:9px;padding:7px;font-size:12px;font-weight:600;cursor:pointer;color:#6b7280;transition:border-color 0.12s ease, color 0.12s ease, background 0.12s ease}.add-btn:hover{border-color:#6366f1;color:#4f46e5;background:#f5f5ff}.plus{font-size:14px;line-height:1}`;
|
|
194
196
|
|
|
195
197
|
const MealPlanDay = class {
|
|
196
198
|
constructor(hostRef) {
|
|
@@ -199,10 +201,12 @@ const MealPlanDay = class {
|
|
|
199
201
|
this.removeMeal = index.createEvent(this, "removeMeal");
|
|
200
202
|
this.day = '';
|
|
201
203
|
this.meals = [];
|
|
204
|
+
/** Optional emoji/icon shown next to the label, e.g. "🌅" */
|
|
205
|
+
this.icon = '';
|
|
202
206
|
}
|
|
203
207
|
render() {
|
|
204
208
|
const meals = Array.isArray(this.meals) ? this.meals : [];
|
|
205
|
-
return (index.h("div", { key: '
|
|
209
|
+
return (index.h("div", { key: 'cd4f194f1eeb5f53a029f380c40aa0b4ec2f32f4', class: "day-col" }, index.h("div", { key: 'd88966142d5101fc522d5de89b6d4cab72cbbbf3', class: "col-header" }, this.icon && index.h("span", { key: '5a9a27a3a1909bcf7295ec7eeccf309e5e2d1ae0', class: "icon" }, this.icon), index.h("h3", { key: 'fd1fa2f1274cc1f6bd8917959015722cb69002ba' }, this.day), meals.length > 0 && index.h("span", { key: 'feff3bc91b52203dba19f7a87c56d3813fc95cdd', class: "count-badge" }, meals.length)), index.h("div", { key: '4afee9ce77bf1447bf9e32efc7e2f9b9571873e7', class: "meals" }, meals.map((m) => (index.h("div", { class: "meal-chip" }, index.h("div", { class: "thumb" }, m.image && index.h("img", { src: m.image, alt: m.title })), index.h("span", { class: "title" }, m.title), index.h("button", { class: "remove-btn", onClick: () => this.removeMeal.emit({ day: this.day, mealId: m.id }), "aria-label": `Remove ${m.title}` }, "\u2715")))), meals.length === 0 && index.h("p", { key: '9a4002b1b4516fc5ff6ef8f9a2e0a7f5e8465cbd', class: "empty" }, "No meal planned")), index.h("button", { key: '2cef3c5f7d0e89303cb8989f78eefb95c426683f', class: "add-btn", onClick: () => this.assignMeal.emit({ day: this.day }) }, index.h("span", { key: 'ae54b56f8f0b01f45029e36919764ae31f3a38b9', class: "plus" }, "+"), " Add meal")));
|
|
206
210
|
}
|
|
207
211
|
};
|
|
208
212
|
MealPlanDay.style = mealPlanDayCss();
|
|
@@ -18,7 +18,7 @@ const AppToast = class {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
render() {
|
|
21
|
-
return (index.h("div", { key: '
|
|
21
|
+
return (index.h("div", { key: '41fc3560c508b3b36863417af6d8f0aa2ad26004', class: `toast ${this.type}` }, index.h("span", { key: 'b29ea7dbe53aa72524039f1ce0fea5c50406d1f0' }, this.message), index.h("button", { key: '3b42fc8485a5d438bb29b5eab2e3ba5ab831731b', onClick: () => this.dismiss.emit(), "aria-label": "Dismiss" }, "\u2715")));
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
AppToast.style = appToastCss();
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
|
6
6
|
const defineCustomElements = async (win, options) => {
|
|
7
7
|
if (typeof window === 'undefined') return undefined;
|
|
8
8
|
await appGlobals.globalScripts();
|
|
9
|
-
return index.bootstrapLazy([["app-modal_7.cjs",[[257,"app-modal",{"open":[4],"modalTitle":[1,"modal-title"]}],[1,"meal-plan-day",{"day":[1],"meals":[16]}],[257,"recipe-card",{"recipeTitle":[1,"recipe-title"],"image":[1],"category":[1],"favorite":[4]}],[1,"recipe-filter-bar",{"categories":[16],"active":[1]}],[257,"recipe-form",{"initialData":[1,"initial-data"],"title":[32],"image":[32],"category":[32],"ingredients":[32],"instructions":[32],"errors":[32]},null,{"initialData":[{"onInitialDataChange":0}]}],[1,"recipe-rating",{"value":[2],"readonly":[4],"max":[2]}],[1,"recipe-search-bar",{"placeholder":[1],"value":[1],"debounceMs":[2,"debounce-ms"],"internalValue":[32]},null,{"value":[{"onValuePropChange":0}]}]]],["app-toast.cjs",[[1,"app-toast",{"message":[1],"type":[1],"duration":[2]}]]]], options);
|
|
9
|
+
return index.bootstrapLazy([["app-modal_7.cjs",[[257,"app-modal",{"open":[4],"modalTitle":[1,"modal-title"]}],[1,"meal-plan-day",{"day":[1],"meals":[16],"icon":[1]}],[257,"recipe-card",{"recipeTitle":[1,"recipe-title"],"image":[1],"category":[1],"favorite":[4]}],[1,"recipe-filter-bar",{"categories":[16],"active":[1]}],[257,"recipe-form",{"initialData":[1,"initial-data"],"title":[32],"image":[32],"category":[32],"ingredients":[32],"instructions":[32],"errors":[32]},null,{"initialData":[{"onInitialDataChange":0}]}],[1,"recipe-rating",{"value":[2],"readonly":[4],"max":[2]}],[1,"recipe-search-bar",{"placeholder":[1],"value":[1],"debounceMs":[2,"debounce-ms"],"internalValue":[32]},null,{"value":[{"onValuePropChange":0}]}]]],["app-toast.cjs",[[1,"app-toast",{"message":[1],"type":[1],"duration":[2]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["app-modal_7.cjs",[[257,"app-modal",{"open":[4],"modalTitle":[1,"modal-title"]}],[1,"meal-plan-day",{"day":[1],"meals":[16]}],[257,"recipe-card",{"recipeTitle":[1,"recipe-title"],"image":[1],"category":[1],"favorite":[4]}],[1,"recipe-filter-bar",{"categories":[16],"active":[1]}],[257,"recipe-form",{"initialData":[1,"initial-data"],"title":[32],"image":[32],"category":[32],"ingredients":[32],"instructions":[32],"errors":[32]},null,{"initialData":[{"onInitialDataChange":0}]}],[1,"recipe-rating",{"value":[2],"readonly":[4],"max":[2]}],[1,"recipe-search-bar",{"placeholder":[1],"value":[1],"debounceMs":[2,"debounce-ms"],"internalValue":[32]},null,{"value":[{"onValuePropChange":0}]}]]],["app-toast.cjs",[[1,"app-toast",{"message":[1],"type":[1],"duration":[2]}]]]], options);
|
|
22
|
+
return index.bootstrapLazy([["app-modal_7.cjs",[[257,"app-modal",{"open":[4],"modalTitle":[1,"modal-title"]}],[1,"meal-plan-day",{"day":[1],"meals":[16],"icon":[1]}],[257,"recipe-card",{"recipeTitle":[1,"recipe-title"],"image":[1],"category":[1],"favorite":[4]}],[1,"recipe-filter-bar",{"categories":[16],"active":[1]}],[257,"recipe-form",{"initialData":[1,"initial-data"],"title":[32],"image":[32],"category":[32],"ingredients":[32],"instructions":[32],"errors":[32]},null,{"initialData":[{"onInitialDataChange":0}]}],[1,"recipe-rating",{"value":[2],"readonly":[4],"max":[2]}],[1,"recipe-search-bar",{"placeholder":[1],"value":[1],"debounceMs":[2,"debounce-ms"],"internalValue":[32]},null,{"value":[{"onValuePropChange":0}]}]]],["app-toast.cjs",[[1,"app-toast",{"message":[1],"type":[1],"duration":[2]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -12,7 +12,7 @@ export class AppToast {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
render() {
|
|
15
|
-
return (h("div", { key: '
|
|
15
|
+
return (h("div", { key: '41fc3560c508b3b36863417af6d8f0aa2ad26004', class: `toast ${this.type}` }, h("span", { key: 'b29ea7dbe53aa72524039f1ce0fea5c50406d1f0' }, this.message), h("button", { key: '3b42fc8485a5d438bb29b5eab2e3ba5ab831731b', onClick: () => this.dismiss.emit(), "aria-label": "Dismiss" }, "\u2715")));
|
|
16
16
|
}
|
|
17
17
|
static get is() { return "app-toast"; }
|
|
18
18
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,19 +1,155 @@
|
|
|
1
|
-
:host {
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
|
|
4
|
+
}
|
|
5
|
+
|
|
2
6
|
.day-col {
|
|
3
|
-
|
|
4
|
-
|
|
7
|
+
background: #ffffff;
|
|
8
|
+
border: 1px solid #e8eaed;
|
|
9
|
+
border-radius: 12px;
|
|
10
|
+
padding: 14px;
|
|
11
|
+
min-width: 160px;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: 10px;
|
|
15
|
+
box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
|
|
16
|
+
transition: box-shadow 0.15s ease, border-color 0.15s ease;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.day-col:hover {
|
|
20
|
+
box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
|
|
21
|
+
border-color: #d8dce1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.col-header {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
gap: 6px;
|
|
28
|
+
padding-bottom: 8px;
|
|
29
|
+
border-bottom: 1px solid #f0f1f3;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.col-header .icon {
|
|
33
|
+
font-size: 15px;
|
|
34
|
+
line-height: 1;
|
|
5
35
|
}
|
|
6
|
-
|
|
7
|
-
.
|
|
36
|
+
|
|
37
|
+
.col-header h3 {
|
|
38
|
+
margin: 0;
|
|
39
|
+
font-size: 12.5px;
|
|
40
|
+
font-weight: 700;
|
|
41
|
+
text-transform: uppercase;
|
|
42
|
+
letter-spacing: 0.05em;
|
|
43
|
+
color: #4b5563;
|
|
44
|
+
flex: 1;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.count-badge {
|
|
48
|
+
background: #eef2ff;
|
|
49
|
+
color: #4338ca;
|
|
50
|
+
font-size: 10.5px;
|
|
51
|
+
font-weight: 700;
|
|
52
|
+
padding: 1px 7px;
|
|
53
|
+
border-radius: 999px;
|
|
54
|
+
line-height: 1.5;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.meals {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
gap: 6px;
|
|
61
|
+
min-height: 44px;
|
|
62
|
+
}
|
|
63
|
+
|
|
8
64
|
.meal-chip {
|
|
9
|
-
display: flex;
|
|
10
|
-
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
gap: 8px;
|
|
68
|
+
background: #f9fafb;
|
|
69
|
+
border: 1px solid #eef0f2;
|
|
70
|
+
border-radius: 9px;
|
|
71
|
+
padding: 6px 8px;
|
|
72
|
+
font-size: 12.5px;
|
|
73
|
+
transition: background 0.12s ease;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.meal-chip:hover {
|
|
77
|
+
background: #f3f4f6;
|
|
11
78
|
}
|
|
12
|
-
|
|
13
|
-
.
|
|
14
|
-
|
|
15
|
-
|
|
79
|
+
|
|
80
|
+
.thumb {
|
|
81
|
+
width: 28px;
|
|
82
|
+
height: 28px;
|
|
83
|
+
border-radius: 6px;
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
flex-shrink: 0;
|
|
86
|
+
background: #e5e7eb;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.thumb img {
|
|
90
|
+
width: 100%;
|
|
91
|
+
height: 100%;
|
|
92
|
+
object-fit: cover;
|
|
93
|
+
display: block;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.meal-chip .title {
|
|
97
|
+
flex: 1;
|
|
98
|
+
color: #1f2937;
|
|
99
|
+
font-weight: 500;
|
|
100
|
+
white-space: nowrap;
|
|
101
|
+
overflow: hidden;
|
|
102
|
+
text-overflow: ellipsis;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.remove-btn {
|
|
106
|
+
border: none;
|
|
107
|
+
background: none;
|
|
108
|
+
cursor: pointer;
|
|
109
|
+
color: #9ca3af;
|
|
110
|
+
font-size: 11px;
|
|
111
|
+
line-height: 1;
|
|
112
|
+
padding: 3px;
|
|
113
|
+
border-radius: 5px;
|
|
114
|
+
transition: color 0.12s ease, background 0.12s ease;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.remove-btn:hover {
|
|
118
|
+
color: #dc2626;
|
|
119
|
+
background: #fef2f2;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.empty {
|
|
123
|
+
font-size: 12px;
|
|
124
|
+
color: #9ca3af;
|
|
125
|
+
margin: 6px 0;
|
|
126
|
+
text-align: center;
|
|
127
|
+
font-style: italic;
|
|
128
|
+
}
|
|
129
|
+
|
|
16
130
|
.add-btn {
|
|
17
|
-
|
|
18
|
-
|
|
131
|
+
display: flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
justify-content: center;
|
|
134
|
+
gap: 4px;
|
|
135
|
+
border: 1.5px dashed #d1d5db;
|
|
136
|
+
background: none;
|
|
137
|
+
border-radius: 9px;
|
|
138
|
+
padding: 7px;
|
|
139
|
+
font-size: 12px;
|
|
140
|
+
font-weight: 600;
|
|
141
|
+
cursor: pointer;
|
|
142
|
+
color: #6b7280;
|
|
143
|
+
transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.add-btn:hover {
|
|
147
|
+
border-color: #6366f1;
|
|
148
|
+
color: #4f46e5;
|
|
149
|
+
background: #f5f5ff;
|
|
19
150
|
}
|
|
151
|
+
|
|
152
|
+
.plus {
|
|
153
|
+
font-size: 14px;
|
|
154
|
+
line-height: 1;
|
|
155
|
+
}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
/**
|
|
3
|
-
* One column of the weekly meal planner, representing a single day.
|
|
4
|
-
* `meals` is the list of recipes currently assigned to this day.
|
|
5
|
-
* Emits `removeMeal` when a meal's remove button is clicked, and
|
|
6
|
-
* `assignMeal` when the "+ Add meal" button is clicked (the parent app
|
|
7
|
-
* is expected to open its own picker/modal and then update `meals`).
|
|
8
|
-
*/
|
|
9
2
|
export class MealPlanDay {
|
|
10
3
|
constructor() {
|
|
11
4
|
this.day = '';
|
|
12
5
|
this.meals = [];
|
|
6
|
+
/** Optional emoji/icon shown next to the label, e.g. "🌅" */
|
|
7
|
+
this.icon = '';
|
|
13
8
|
}
|
|
14
9
|
render() {
|
|
15
10
|
const meals = Array.isArray(this.meals) ? this.meals : [];
|
|
16
|
-
return (h("div", { key: '
|
|
11
|
+
return (h("div", { key: 'cd4f194f1eeb5f53a029f380c40aa0b4ec2f32f4', class: "day-col" }, h("div", { key: 'd88966142d5101fc522d5de89b6d4cab72cbbbf3', class: "col-header" }, this.icon && h("span", { key: '5a9a27a3a1909bcf7295ec7eeccf309e5e2d1ae0', class: "icon" }, this.icon), h("h3", { key: 'fd1fa2f1274cc1f6bd8917959015722cb69002ba' }, this.day), meals.length > 0 && h("span", { key: 'feff3bc91b52203dba19f7a87c56d3813fc95cdd', class: "count-badge" }, meals.length)), h("div", { key: '4afee9ce77bf1447bf9e32efc7e2f9b9571873e7', class: "meals" }, meals.map((m) => (h("div", { class: "meal-chip" }, h("div", { class: "thumb" }, m.image && h("img", { src: m.image, alt: m.title })), h("span", { class: "title" }, m.title), h("button", { class: "remove-btn", onClick: () => this.removeMeal.emit({ day: this.day, mealId: m.id }), "aria-label": `Remove ${m.title}` }, "\u2715")))), meals.length === 0 && h("p", { key: '9a4002b1b4516fc5ff6ef8f9a2e0a7f5e8465cbd', class: "empty" }, "No meal planned")), h("button", { key: '2cef3c5f7d0e89303cb8989f78eefb95c426683f', class: "add-btn", onClick: () => this.assignMeal.emit({ day: this.day }) }, h("span", { key: 'ae54b56f8f0b01f45029e36919764ae31f3a38b9', class: "plus" }, "+"), " Add meal")));
|
|
17
12
|
}
|
|
18
13
|
static get is() { return "meal-plan-day"; }
|
|
19
14
|
static get encapsulation() { return "shadow"; }
|
|
@@ -72,6 +67,26 @@ export class MealPlanDay {
|
|
|
72
67
|
"getter": false,
|
|
73
68
|
"setter": false,
|
|
74
69
|
"defaultValue": "[]"
|
|
70
|
+
},
|
|
71
|
+
"icon": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"mutable": false,
|
|
74
|
+
"complexType": {
|
|
75
|
+
"original": "string",
|
|
76
|
+
"resolved": "string",
|
|
77
|
+
"references": {}
|
|
78
|
+
},
|
|
79
|
+
"required": false,
|
|
80
|
+
"optional": false,
|
|
81
|
+
"docs": {
|
|
82
|
+
"tags": [],
|
|
83
|
+
"text": "Optional emoji/icon shown next to the label, e.g. \"\uD83C\uDF05\""
|
|
84
|
+
},
|
|
85
|
+
"getter": false,
|
|
86
|
+
"setter": false,
|
|
87
|
+
"reflect": false,
|
|
88
|
+
"attribute": "icon",
|
|
89
|
+
"defaultValue": "''"
|
|
75
90
|
}
|
|
76
91
|
};
|
|
77
92
|
}
|
|
@@ -17,7 +17,7 @@ export class RecipeCard {
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
|
-
return (h("div", { key: '
|
|
20
|
+
return (h("div", { key: 'c9dc0d8c98899cf188fc46c72b5e809831332f24', class: "card", onClick: () => this.cardClick.emit() }, h("div", { key: '12e0512dc7ee78f46843f81483c5f7bf1fbc3616', class: "image-wrap" }, this.image ? h("img", { src: this.image, alt: this.recipeTitle }) : h("div", { class: "placeholder" }), h("button", { key: '95ab4db232ee878d61e272ce7a4814a48790c01d', class: { 'fav-btn': true, active: this.favorite }, onClick: this.onFavoriteClick, "aria-label": "Toggle favorite" }, this.favorite ? '★' : '☆')), h("div", { key: 'a2906c670d693a473b87042ff6b0ada03627205b', class: "body" }, h("h3", { key: '2b0f4afecfdfd9cc996dcec29bd86957687667e3' }, this.recipeTitle), this.category && h("span", { key: '1b9c31d2723d2c87d51021569271366bac550a2f', class: "category" }, this.category), h("div", { key: 'd79b1cc33dcced145c3551874f69b581b4734297', class: "actions" }, h("slot", { key: '9a43cf770ea8fa189564fbe14f4f135a4d8e9551', name: "actions" })))));
|
|
21
21
|
}
|
|
22
22
|
static get is() { return "recipe-card"; }
|
|
23
23
|
static get encapsulation() { return "shadow"; }
|
|
@@ -15,7 +15,7 @@ export class RecipeFilterBar {
|
|
|
15
15
|
}
|
|
16
16
|
render() {
|
|
17
17
|
const cats = Array.isArray(this.categories) ? this.categories : [];
|
|
18
|
-
return (h("div", { key: '
|
|
18
|
+
return (h("div", { key: '90b26633c07d813221b1cc44705c5fe510de994f', class: "wrap" }, h("button", { key: 'a41696529d8611f283460da1efe9205bd0b36260', class: { chip: true, active: this.active === '' }, onClick: () => this.select('') }, "All"), cats.map((c) => (h("button", { class: { chip: true, active: this.active === c }, onClick: () => this.select(c) }, c)))));
|
|
19
19
|
}
|
|
20
20
|
static get is() { return "recipe-filter-bar"; }
|
|
21
21
|
static get encapsulation() { return "shadow"; }
|
|
@@ -64,6 +64,8 @@ export class RecipeForm {
|
|
|
64
64
|
const errors = {};
|
|
65
65
|
if (!this.title.trim())
|
|
66
66
|
errors.title = 'Title is required.';
|
|
67
|
+
if (!this.category.trim())
|
|
68
|
+
errors.category = 'Category is required.';
|
|
67
69
|
const cleanIngredients = this.ingredients.map((i) => i.trim()).filter(Boolean);
|
|
68
70
|
if (cleanIngredients.length === 0)
|
|
69
71
|
errors.ingredients = 'Add at least one ingredient.';
|
|
@@ -78,7 +80,7 @@ export class RecipeForm {
|
|
|
78
80
|
this.ingredients = next;
|
|
79
81
|
}
|
|
80
82
|
render() {
|
|
81
|
-
return (h("form", { key: '
|
|
83
|
+
return (h("form", { key: 'd7bf28b14b5d445221c52595bd827f49eed9306b', onSubmit: this.onSubmit }, h("slot", { key: '0ffc3f7fd2e5a15771ae36629365c53b1c44d934', name: "header" }), h("label", { key: '617617d1d4e5b9cbfc506340f3ffcab0364bb402' }, "Title", h("input", { key: '9be17e32164005466bf208323380603e33e43f6e', type: "text", value: this.title, onInput: (e) => (this.title = e.target.value) }), this.errors.title && h("span", { key: 'e1ecebe7af1b6b13a392f4ceb99651c6f87aea43', class: "error" }, this.errors.title)), h("label", { key: '6ce777cc37e11e9c063e43e301d9c93fa7ddf4b4' }, "Image URL", h("input", { key: '37839fabadb556def7f240e8116629315ca1ad73', type: "text", value: this.image, onInput: (e) => (this.image = e.target.value) })), h("label", { key: 'c870efae293faecf06e5d9481d302779c77aac39' }, "Category", h("input", { key: '1cc8a5a113ac6a215dc0c53b43c1f9167afd69f4', type: "text", value: this.category, onInput: (e) => (this.category = e.target.value) }), this.errors.category && h("span", { key: 'ed78cadd9df6f24e700aebc6f85ce993c3d4746b', class: "error" }, this.errors.category)), h("div", { key: '0cbed02ba6b4b021d7cce4ffd9fb3e041452db00', class: "field" }, h("span", { key: '6e8023d7fa1c3a345ac8a1ffca9de1b57af25e8c' }, "Ingredients"), this.ingredients.map((ing, i) => (h("div", { class: "ingredient-row" }, h("input", { type: "text", value: ing, onInput: (e) => this.updateIngredient(i, e.target.value) }), h("button", { type: "button", onClick: () => this.removeIngredient(i), "aria-label": "Remove" }, "\u2715")))), h("button", { key: 'c6fe3f2daad8c3f19daa3570c6e593c6b089aa57', type: "button", class: "add-btn", onClick: this.addIngredient }, "+ Add ingredient"), this.errors.ingredients && h("span", { key: 'bfec646ff34633a03d6b3368c5fb095bc3066025', class: "error" }, this.errors.ingredients)), h("label", { key: 'd3487e03e2c26afe9b3807a9d1f1240dabb30373' }, "Instructions", h("textarea", { key: 'ade48aaca40198665a1fb1525834c27ec0ad0350', rows: 5, onInput: (e) => (this.instructions = e.target.value) }, this.instructions), this.errors.instructions && h("span", { key: 'c90068359e0448b350af5e8b15e50cce682a1615', class: "error" }, this.errors.instructions)), h("div", { key: '2621aec625328743a60c79e49275384017000ccb', class: "footer" }, h("slot", { key: '5d1466af5beba19e66612a7343727ab71e44455f', name: "footer" }), h("button", { key: '5a4883d864051e8081b6a7e1f5c1fb10e7bc5c1a', type: "button", class: "cancel-btn", onClick: () => this.cancel.emit() }, "Cancel"), h("button", { key: '64d4c7e5cad53b1376dce3e73860fc3d4b4d9ff2', type: "submit", class: "save-btn" }, "Save Recipe"))));
|
|
82
84
|
}
|
|
83
85
|
static get is() { return "recipe-form"; }
|
|
84
86
|
static get encapsulation() { return "shadow"; }
|
|
@@ -8,7 +8,7 @@ export class RecipeRating {
|
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
10
|
const stars = Array.from({ length: this.max }, (_, i) => i + 1);
|
|
11
|
-
return (h("div", { key: '
|
|
11
|
+
return (h("div", { key: '2d5251ae7d3a24d613b759e89ba78de1568426d8', class: "wrap", role: this.readonly ? undefined : 'radiogroup' }, stars.map((s) => (h("span", { class: { star: true, filled: s <= this.value, clickable: !this.readonly }, onClick: () => !this.readonly && this.ratingChange.emit({ value: s }) }, "\u2605")))));
|
|
12
12
|
}
|
|
13
13
|
static get is() { return "recipe-rating"; }
|
|
14
14
|
static get encapsulation() { return "shadow"; }
|
|
@@ -30,7 +30,7 @@ export class RecipeSearchBar {
|
|
|
30
30
|
this.internalValue = newVal;
|
|
31
31
|
}
|
|
32
32
|
render() {
|
|
33
|
-
return (h("div", { key: '
|
|
33
|
+
return (h("div", { key: 'b55c496d5c2968b4b79c40b9333c62ed4653e76d', class: "wrap" }, h("input", { key: '081ae0dfde47acca677c746bc88cda1864eac851', type: "search", placeholder: this.placeholder, value: this.internalValue, onInput: this.onInput, onKeyDown: this.onKeyDown }), h("button", { key: '44cde335aec87330bb4486883c9cf836a6855ad0', onClick: () => this.search.emit({ value: this.internalValue }), "aria-label": "Search" }, "\uD83D\uDD0D")));
|
|
34
34
|
}
|
|
35
35
|
static get is() { return "recipe-search-bar"; }
|
|
36
36
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as o,d as s}from"./p-
|
|
1
|
+
import{A as o,d as s}from"./p-Q8V4JgYC.js";const p=o,r=s;export{p as AppToast,r as defineCustomElement}
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-BJU3HdRm.js";export{R as RecipeCard}from"./p-
|
|
1
|
+
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-BJU3HdRm.js";export{R as RecipeCard}from"./p-snMSuFkY.js";export{R as RecipeSearchBar}from"./p-fNGqqs-I.js";export{R as RecipeFilterBar}from"./p-gWE9Vqi0.js";export{R as RecipeRating}from"./p-DrDPFXTB.js";export{R as RecipeForm}from"./p-CN2vLHNY.js";export{M as MealPlanDay}from"./p-S4266va_.js";export{A as AppModal}from"./p-Dp1sKtrN.js";export{A as AppToast}from"./p-Q8V4JgYC.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{M as o,d as s}from"./p-
|
|
1
|
+
import{M as o,d as s}from"./p-S4266va_.js";const a=o,p=s;export{a as MealPlanDay,p as defineCustomElement}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as t,H as i,c as a,h as s}from"./p-BJU3HdRm.js";const n=t(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.save=a(this,"save"),this.cancel=a(this,"cancel"),this.title="",this.image="",this.category="",this.ingredients=[""],this.instructions="",this.errors={},this.onSubmit=e=>{if(e.preventDefault(),!this.validate())return;const t={id:this.initialData?.id,title:this.title.trim(),image:this.image.trim(),category:this.category.trim(),ingredients:this.ingredients.map((e=>e.trim())).filter(Boolean),instructions:this.instructions.trim()};this.save.emit(t)},this.addIngredient=()=>{this.ingredients=[...this.ingredients,""]},this.removeIngredient=e=>{this.ingredients=this.ingredients.filter(((t,i)=>i!==e))}}componentWillLoad(){this.loadInitialData()}onInitialDataChange(){this.loadInitialData()}loadInitialData(){let e;if("string"==typeof this.initialData&&this.initialData)try{e=JSON.parse(this.initialData)}catch{e=void 0}else this.initialData&&"object"==typeof this.initialData&&(e=this.initialData);e&&(this.title=e.title??"",this.image=e.image??"",this.category=e.category??"",this.ingredients=e.ingredients?.length?[...e.ingredients]:[""],this.instructions=e.instructions??"")}validate(){const e={};return this.title.trim()||(e.title="Title is required."),this.category.trim()||(e.category="Category is required."),0===this.ingredients.map((e=>e.trim())).filter(Boolean).length&&(e.ingredients="Add at least one ingredient."),this.instructions.trim()||(e.instructions="Instructions are required."),this.errors=e,0===Object.keys(e).length}updateIngredient(e,t){const i=[...this.ingredients];i[e]=t,this.ingredients=i}render(){return s("form",{key:"d7bf28b14b5d445221c52595bd827f49eed9306b",onSubmit:this.onSubmit},s("slot",{key:"0ffc3f7fd2e5a15771ae36629365c53b1c44d934",name:"header"}),s("label",{key:"617617d1d4e5b9cbfc506340f3ffcab0364bb402"},"Title",s("input",{key:"9be17e32164005466bf208323380603e33e43f6e",type:"text",value:this.title,onInput:e=>this.title=e.target.value}),this.errors.title&&s("span",{key:"e1ecebe7af1b6b13a392f4ceb99651c6f87aea43",class:"error"},this.errors.title)),s("label",{key:"6ce777cc37e11e9c063e43e301d9c93fa7ddf4b4"},"Image URL",s("input",{key:"37839fabadb556def7f240e8116629315ca1ad73",type:"text",value:this.image,onInput:e=>this.image=e.target.value})),s("label",{key:"c870efae293faecf06e5d9481d302779c77aac39"},"Category",s("input",{key:"1cc8a5a113ac6a215dc0c53b43c1f9167afd69f4",type:"text",value:this.category,onInput:e=>this.category=e.target.value}),this.errors.category&&s("span",{key:"ed78cadd9df6f24e700aebc6f85ce993c3d4746b",class:"error"},this.errors.category)),s("div",{key:"0cbed02ba6b4b021d7cce4ffd9fb3e041452db00",class:"field"},s("span",{key:"6e8023d7fa1c3a345ac8a1ffca9de1b57af25e8c"},"Ingredients"),this.ingredients.map(((e,t)=>s("div",{class:"ingredient-row"},s("input",{type:"text",value:e,onInput:e=>this.updateIngredient(t,e.target.value)}),s("button",{type:"button",onClick:()=>this.removeIngredient(t),"aria-label":"Remove"},"✕")))),s("button",{key:"c6fe3f2daad8c3f19daa3570c6e593c6b089aa57",type:"button",class:"add-btn",onClick:this.addIngredient},"+ Add ingredient"),this.errors.ingredients&&s("span",{key:"bfec646ff34633a03d6b3368c5fb095bc3066025",class:"error"},this.errors.ingredients)),s("label",{key:"d3487e03e2c26afe9b3807a9d1f1240dabb30373"},"Instructions",s("textarea",{key:"ade48aaca40198665a1fb1525834c27ec0ad0350",rows:5,onInput:e=>this.instructions=e.target.value},this.instructions),this.errors.instructions&&s("span",{key:"c90068359e0448b350af5e8b15e50cce682a1615",class:"error"},this.errors.instructions)),s("div",{key:"2621aec625328743a60c79e49275384017000ccb",class:"footer"},s("slot",{key:"5d1466af5beba19e66612a7343727ab71e44455f",name:"footer"}),s("button",{key:"5a4883d864051e8081b6a7e1f5c1fb10e7bc5c1a",type:"button",class:"cancel-btn",onClick:()=>this.cancel.emit()},"Cancel"),s("button",{key:"64d4c7e5cad53b1376dce3e73860fc3d4b4d9ff2",type:"submit",class:"save-btn"},"Save Recipe")))}static get watchers(){return{initialData:[{onInitialDataChange:0}]}}static get style(){return":host{display:block;font-family:system-ui, sans-serif}form{display:flex;flex-direction:column;gap:14px}label{display:flex;flex-direction:column;gap:4px;font-size:13px;color:#333;font-weight:600}input,textarea{font-weight:400;padding:8px 10px;border:1px solid #ddd;border-radius:6px;font-size:14px;font-family:inherit}.field{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:600}.ingredient-row{display:flex;gap:6px}.ingredient-row input{flex:1}.ingredient-row button{border:none;background:#f4f4f4;border-radius:6px;cursor:pointer;width:30px}.add-btn{align-self:flex-start;border:1px dashed #bbb;background:none;border-radius:6px;padding:6px 10px;cursor:pointer;font-size:13px;color:#555}.error{color:#e74c3c;font-size:12px;font-weight:400}.footer{display:flex;justify-content:flex-end;gap:10px;margin-top:6px}.cancel-btn{border:1px solid #ddd;background:#fff;border-radius:8px;padding:8px 16px;cursor:pointer}.save-btn{border:none;background:#ff6b35;color:#fff;border-radius:8px;padding:8px 18px;cursor:pointer;font-weight:600}"}},[257,"recipe-form",{initialData:[1,"initial-data"],title:[32],image:[32],category:[32],ingredients:[32],instructions:[32],errors:[32]},void 0,{initialData:[{onInitialDataChange:0}]}]);function o(){"undefined"!=typeof customElements&&["recipe-form"].forEach((t=>{"recipe-form"===t&&(customElements.get(e(t))||customElements.define(e(t),n))}))}o();export{n as R,o as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as s,p as t,H as e,c as i,h as a}from"./p-BJU3HdRm.js";const r=t(class extends e{constructor(s){super(),!1!==s&&this.__registerHost(),this.__attachShadow(),this.ratingChange=i(this,"ratingChange"),this.value=0,this.readonly=!1,this.max=5}render(){const s=Array.from({length:this.max},((s,t)=>t+1));return a("div",{key:"
|
|
1
|
+
import{t as s,p as t,H as e,c as i,h as a}from"./p-BJU3HdRm.js";const r=t(class extends e{constructor(s){super(),!1!==s&&this.__registerHost(),this.__attachShadow(),this.ratingChange=i(this,"ratingChange"),this.value=0,this.readonly=!1,this.max=5}render(){const s=Array.from({length:this.max},((s,t)=>t+1));return a("div",{key:"2d5251ae7d3a24d613b759e89ba78de1568426d8",class:"wrap",role:this.readonly?void 0:"radiogroup"},s.map((s=>a("span",{class:{star:!0,filled:s<=this.value,clickable:!this.readonly},onClick:()=>!this.readonly&&this.ratingChange.emit({value:s})},"★"))))}static get style(){return":host{display:inline-block;font-family:system-ui, sans-serif}.wrap{display:flex;gap:2px}.star{font-size:18px;color:#ddd}.star.filled{color:#f5a623}.star.clickable{cursor:pointer}"}},[1,"recipe-rating",{value:[2],readonly:[4],max:[2]}]);function l(){"undefined"!=typeof customElements&&["recipe-rating"].forEach((t=>{"recipe-rating"===t&&(customElements.get(s(t))||customElements.define(s(t),r))}))}l();export{r as R,l as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as s,p as t,H as
|
|
1
|
+
import{t as s,p as t,H as a,c as e,h as o}from"./p-BJU3HdRm.js";const i=t(class extends a{constructor(s){super(),!1!==s&&this.__registerHost(),this.__attachShadow(),this.dismiss=e(this,"dismiss"),this.message="",this.type="info",this.duration=3e3}componentDidLoad(){this.duration>0&&setTimeout((()=>this.dismiss.emit()),this.duration)}render(){return o("div",{key:"41fc3560c508b3b36863417af6d8f0aa2ad26004",class:`toast ${this.type}`},o("span",{key:"b29ea7dbe53aa72524039f1ce0fea5c50406d1f0"},this.message),o("button",{key:"3b42fc8485a5d438bb29b5eab2e3ba5ab831731b",onClick:()=>this.dismiss.emit(),"aria-label":"Dismiss"},"✕"))}static get style(){return":host{font-family:system-ui, sans-serif;display:block}.toast{display:flex;align-items:center;gap:10px;padding:10px 16px;border-radius:8px;color:#fff;font-size:14px;box-shadow:0 4px 12px rgba(0,0,0,0.15)}.toast.success{background:#2ecc71}.toast.error{background:#e74c3c}.toast.info{background:#3498db}button{border:none;background:none;color:inherit;cursor:pointer;margin-left:auto}"}},[1,"app-toast",{message:[1],type:[1],duration:[2]}]);function n(){"undefined"!=typeof customElements&&["app-toast"].forEach((t=>{"app-toast"===t&&(customElements.get(s(t))||customElements.define(s(t),i))}))}n();export{i as A,n as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as a,H as o,c as s,h as t}from"./p-BJU3HdRm.js";const i=a(class extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.assignMeal=s(this,"assignMeal"),this.removeMeal=s(this,"removeMeal"),this.day="",this.meals=[],this.icon=""}render(){const e=Array.isArray(this.meals)?this.meals:[];return t("div",{key:"cd4f194f1eeb5f53a029f380c40aa0b4ec2f32f4",class:"day-col"},t("div",{key:"d88966142d5101fc522d5de89b6d4cab72cbbbf3",class:"col-header"},this.icon&&t("span",{key:"5a9a27a3a1909bcf7295ec7eeccf309e5e2d1ae0",class:"icon"},this.icon),t("h3",{key:"fd1fa2f1274cc1f6bd8917959015722cb69002ba"},this.day),e.length>0&&t("span",{key:"feff3bc91b52203dba19f7a87c56d3813fc95cdd",class:"count-badge"},e.length)),t("div",{key:"4afee9ce77bf1447bf9e32efc7e2f9b9571873e7",class:"meals"},e.map((e=>t("div",{class:"meal-chip"},t("div",{class:"thumb"},e.image&&t("img",{src:e.image,alt:e.title})),t("span",{class:"title"},e.title),t("button",{class:"remove-btn",onClick:()=>this.removeMeal.emit({day:this.day,mealId:e.id}),"aria-label":`Remove ${e.title}`},"✕")))),0===e.length&&t("p",{key:"9a4002b1b4516fc5ff6ef8f9a2e0a7f5e8465cbd",class:"empty"},"No meal planned")),t("button",{key:"2cef3c5f7d0e89303cb8989f78eefb95c426683f",class:"add-btn",onClick:()=>this.assignMeal.emit({day:this.day})},t("span",{key:"ae54b56f8f0b01f45029e36919764ae31f3a38b9",class:"plus"},"+")," Add meal"))}static get style(){return":host{display:block;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif}.day-col{background:#ffffff;border:1px solid #e8eaed;border-radius:12px;padding:14px;min-width:160px;display:flex;flex-direction:column;gap:10px;box-shadow:0 1px 2px rgba(16, 24, 40, 0.04);transition:box-shadow 0.15s ease, border-color 0.15s ease}.day-col:hover{box-shadow:0 4px 12px rgba(16, 24, 40, 0.08);border-color:#d8dce1}.col-header{display:flex;align-items:center;gap:6px;padding-bottom:8px;border-bottom:1px solid #f0f1f3}.col-header .icon{font-size:15px;line-height:1}.col-header h3{margin:0;font-size:12.5px;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;color:#4b5563;flex:1}.count-badge{background:#eef2ff;color:#4338ca;font-size:10.5px;font-weight:700;padding:1px 7px;border-radius:999px;line-height:1.5}.meals{display:flex;flex-direction:column;gap:6px;min-height:44px}.meal-chip{display:flex;align-items:center;gap:8px;background:#f9fafb;border:1px solid #eef0f2;border-radius:9px;padding:6px 8px;font-size:12.5px;transition:background 0.12s ease}.meal-chip:hover{background:#f3f4f6}.thumb{width:28px;height:28px;border-radius:6px;overflow:hidden;flex-shrink:0;background:#e5e7eb}.thumb img{width:100%;height:100%;object-fit:cover;display:block}.meal-chip .title{flex:1;color:#1f2937;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.remove-btn{border:none;background:none;cursor:pointer;color:#9ca3af;font-size:11px;line-height:1;padding:3px;border-radius:5px;transition:color 0.12s ease, background 0.12s ease}.remove-btn:hover{color:#dc2626;background:#fef2f2}.empty{font-size:12px;color:#9ca3af;margin:6px 0;text-align:center;font-style:italic}.add-btn{display:flex;align-items:center;justify-content:center;gap:4px;border:1.5px dashed #d1d5db;background:none;border-radius:9px;padding:7px;font-size:12px;font-weight:600;cursor:pointer;color:#6b7280;transition:border-color 0.12s ease, color 0.12s ease, background 0.12s ease}.add-btn:hover{border-color:#6366f1;color:#4f46e5;background:#f5f5ff}.plus{font-size:14px;line-height:1}"}},[1,"meal-plan-day",{day:[1],meals:[16],icon:[1]}]);function d(){"undefined"!=typeof customElements&&["meal-plan-day"].forEach((a=>{"meal-plan-day"===a&&(customElements.get(e(a))||customElements.define(e(a),i))}))}d();export{i as M,d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as t,H as s,c as a,h as i}from"./p-BJU3HdRm.js";const r=t(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.search=a(this,"search"),this.placeholder="Search recipes...",this.value="",this.debounceMs=350,this.internalValue="",this.onInput=e=>{this.internalValue=e.target.value,clearTimeout(this.timer),this.timer=setTimeout((()=>{this.search.emit({value:this.internalValue})}),this.debounceMs)},this.onKeyDown=e=>{"Enter"===e.key&&(clearTimeout(this.timer),this.search.emit({value:this.internalValue}))}}componentWillLoad(){this.internalValue=this.value}onValuePropChange(e){this.internalValue=e}render(){return i("div",{key:"
|
|
1
|
+
import{t as e,p as t,H as s,c as a,h as i}from"./p-BJU3HdRm.js";const r=t(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.search=a(this,"search"),this.placeholder="Search recipes...",this.value="",this.debounceMs=350,this.internalValue="",this.onInput=e=>{this.internalValue=e.target.value,clearTimeout(this.timer),this.timer=setTimeout((()=>{this.search.emit({value:this.internalValue})}),this.debounceMs)},this.onKeyDown=e=>{"Enter"===e.key&&(clearTimeout(this.timer),this.search.emit({value:this.internalValue}))}}componentWillLoad(){this.internalValue=this.value}onValuePropChange(e){this.internalValue=e}render(){return i("div",{key:"b55c496d5c2968b4b79c40b9333c62ed4653e76d",class:"wrap"},i("input",{key:"081ae0dfde47acca677c746bc88cda1864eac851",type:"search",placeholder:this.placeholder,value:this.internalValue,onInput:this.onInput,onKeyDown:this.onKeyDown}),i("button",{key:"44cde335aec87330bb4486883c9cf836a6855ad0",onClick:()=>this.search.emit({value:this.internalValue}),"aria-label":"Search"},"🔍"))}static get watchers(){return{value:[{onValuePropChange:0}]}}static get style(){return":host{display:block;font-family:system-ui, sans-serif}.wrap{display:flex;gap:6px}input{flex:1;padding:10px 14px;border-radius:8px;border:1px solid #ddd;font-size:14px;outline:none}input:focus{border-color:#ff6b35}button{border:none;background:#ff6b35;color:#fff;border-radius:8px;padding:0 16px;cursor:pointer;font-size:15px}"}},[1,"recipe-search-bar",{placeholder:[1],value:[1],debounceMs:[2,"debounce-ms"],internalValue:[32]},void 0,{value:[{onValuePropChange:0}]}]);function o(){"undefined"!=typeof customElements&&["recipe-search-bar"].forEach((t=>{"recipe-search-bar"===t&&(customElements.get(e(t))||customElements.define(e(t),r))}))}o();export{r as R,o as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as s,H as t,c as i,h as r}from"./p-BJU3HdRm.js";const c=s(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.filterChange=i(this,"filterChange"),this.categories=[],this.active=""}select(e){this.filterChange.emit({value:e})}render(){const e=Array.isArray(this.categories)?this.categories:[];return r("div",{key:"
|
|
1
|
+
import{t as e,p as s,H as t,c as i,h as r}from"./p-BJU3HdRm.js";const c=s(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.filterChange=i(this,"filterChange"),this.categories=[],this.active=""}select(e){this.filterChange.emit({value:e})}render(){const e=Array.isArray(this.categories)?this.categories:[];return r("div",{key:"90b26633c07d813221b1cc44705c5fe510de994f",class:"wrap"},r("button",{key:"a41696529d8611f283460da1efe9205bd0b36260",class:{chip:!0,active:""===this.active},onClick:()=>this.select("")},"All"),e.map((e=>r("button",{class:{chip:!0,active:this.active===e},onClick:()=>this.select(e)},e))))}static get style(){return":host{display:block;font-family:system-ui, sans-serif}.wrap{display:flex;flex-wrap:wrap;gap:8px}.chip{border:1px solid #ddd;background:#fff;border-radius:999px;padding:6px 14px;font-size:13px;cursor:pointer;color:#444}.chip.active{background:#ff6b35;border-color:#ff6b35;color:#fff}"}},[1,"recipe-filter-bar",{categories:[16],active:[1]}]);function a(){"undefined"!=typeof customElements&&["recipe-filter-bar"].forEach((s=>{"recipe-filter-bar"===s&&(customElements.get(e(s))||customElements.define(e(s),c))}))}a();export{c as R,a as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as t,H as a,c as i,h as s}from"./p-BJU3HdRm.js";const
|
|
1
|
+
import{t as e,p as t,H as a,c as i,h as s}from"./p-BJU3HdRm.js";const c=t(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.favoriteToggle=i(this,"favoriteToggle"),this.cardClick=i(this,"cardClick"),this.category="",this.favorite=!1,this.onFavoriteClick=e=>{e.stopPropagation(),this.favoriteToggle.emit({favorite:!this.favorite})}}render(){return s("div",{key:"c9dc0d8c98899cf188fc46c72b5e809831332f24",class:"card",onClick:()=>this.cardClick.emit()},s("div",{key:"12e0512dc7ee78f46843f81483c5f7bf1fbc3616",class:"image-wrap"},this.image?s("img",{src:this.image,alt:this.recipeTitle}):s("div",{class:"placeholder"}),s("button",{key:"95ab4db232ee878d61e272ce7a4814a48790c01d",class:{"fav-btn":!0,active:this.favorite},onClick:this.onFavoriteClick,"aria-label":"Toggle favorite"},this.favorite?"★":"☆")),s("div",{key:"a2906c670d693a473b87042ff6b0ada03627205b",class:"body"},s("h3",{key:"2b0f4afecfdfd9cc996dcec29bd86957687667e3"},this.recipeTitle),this.category&&s("span",{key:"1b9c31d2723d2c87d51021569271366bac550a2f",class:"category"},this.category),s("div",{key:"d79b1cc33dcced145c3551874f69b581b4734297",class:"actions"},s("slot",{key:"9a43cf770ea8fa189564fbe14f4f135a4d8e9551",name:"actions"}))))}static get style(){return":host{display:block;font-family:system-ui, sans-serif}.card{border:1px solid #e5e5e5;border-radius:12px;overflow:hidden;cursor:pointer;background:#fff;transition:box-shadow 0.15s ease, transform 0.15s ease}.card:hover{box-shadow:0 4px 16px rgba(0, 0, 0, 0.08);transform:translateY(-2px)}.image-wrap{position:relative;aspect-ratio:4 / 3;background:#f2f2f2}.image-wrap img{width:100%;height:100%;object-fit:cover;display:block}.placeholder{width:100%;height:100%;background:linear-gradient(135deg, #eee, #ddd)}.fav-btn{position:absolute;top:8px;right:8px;border:none;background:rgba(255, 255, 255, 0.9);border-radius:50%;width:32px;height:32px;font-size:16px;cursor:pointer;color:#f5a623}.fav-btn.active{color:#ff6b35}.body{padding:12px 14px}h3{margin:0 0 4px;font-size:15px;line-height:1.3}.category{font-size:12px;color:#777;text-transform:uppercase;letter-spacing:0.03em}.actions{margin-top:8px}"}},[257,"recipe-card",{recipeTitle:[1,"recipe-title"],image:[1],category:[1],favorite:[4]}]);function r(){"undefined"!=typeof customElements&&["recipe-card"].forEach((t=>{"recipe-card"===t&&(customElements.get(e(t))||customElements.define(e(t),c))}))}r();export{c as R,r as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{R as
|
|
1
|
+
import{R as s,d as o}from"./p-snMSuFkY.js";const p=s,r=o;export{p as RecipeCard,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{R as o,d as
|
|
1
|
+
import{R as o,d as s}from"./p-gWE9Vqi0.js";const p=o,r=s;export{p as RecipeFilterBar,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{R as o,d as s}from"./p-
|
|
1
|
+
import{R as o,d as s}from"./p-CN2vLHNY.js";const p=o,r=s;export{p as RecipeForm,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{R as o,d as
|
|
1
|
+
import{R as o,d as r}from"./p-DrDPFXTB.js";const s=o,p=r;export{s as RecipeRating,p as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{R as
|
|
1
|
+
import{R as s,d as o}from"./p-fNGqqs-I.js";const p=s,r=o;export{p as RecipeSearchBar,r as defineCustomElement}
|
|
@@ -17,7 +17,7 @@ const RecipeCard = class {
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
|
-
return (h("div", { key: '
|
|
20
|
+
return (h("div", { key: 'c9dc0d8c98899cf188fc46c72b5e809831332f24', class: "card", onClick: () => this.cardClick.emit() }, h("div", { key: '12e0512dc7ee78f46843f81483c5f7bf1fbc3616', class: "image-wrap" }, this.image ? h("img", { src: this.image, alt: this.recipeTitle }) : h("div", { class: "placeholder" }), h("button", { key: '95ab4db232ee878d61e272ce7a4814a48790c01d', class: { 'fav-btn': true, active: this.favorite }, onClick: this.onFavoriteClick, "aria-label": "Toggle favorite" }, this.favorite ? '★' : '☆')), h("div", { key: 'a2906c670d693a473b87042ff6b0ada03627205b', class: "body" }, h("h3", { key: '2b0f4afecfdfd9cc996dcec29bd86957687667e3' }, this.recipeTitle), this.category && h("span", { key: '1b9c31d2723d2c87d51021569271366bac550a2f', class: "category" }, this.category), h("div", { key: 'd79b1cc33dcced145c3551874f69b581b4734297', class: "actions" }, h("slot", { key: '9a43cf770ea8fa189564fbe14f4f135a4d8e9551', name: "actions" })))));
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
RecipeCard.style = recipeCardCss();
|
|
@@ -53,7 +53,7 @@ const RecipeSearchBar = class {
|
|
|
53
53
|
this.internalValue = newVal;
|
|
54
54
|
}
|
|
55
55
|
render() {
|
|
56
|
-
return (h("div", { key: '
|
|
56
|
+
return (h("div", { key: 'b55c496d5c2968b4b79c40b9333c62ed4653e76d', class: "wrap" }, h("input", { key: '081ae0dfde47acca677c746bc88cda1864eac851', type: "search", placeholder: this.placeholder, value: this.internalValue, onInput: this.onInput, onKeyDown: this.onKeyDown }), h("button", { key: '44cde335aec87330bb4486883c9cf836a6855ad0', onClick: () => this.search.emit({ value: this.internalValue }), "aria-label": "Search" }, "\uD83D\uDD0D")));
|
|
57
57
|
}
|
|
58
58
|
static get watchers() { return {
|
|
59
59
|
"value": [{
|
|
@@ -77,7 +77,7 @@ const RecipeFilterBar = class {
|
|
|
77
77
|
}
|
|
78
78
|
render() {
|
|
79
79
|
const cats = Array.isArray(this.categories) ? this.categories : [];
|
|
80
|
-
return (h("div", { key: '
|
|
80
|
+
return (h("div", { key: '90b26633c07d813221b1cc44705c5fe510de994f', class: "wrap" }, h("button", { key: 'a41696529d8611f283460da1efe9205bd0b36260', class: { chip: true, active: this.active === '' }, onClick: () => this.select('') }, "All"), cats.map((c) => (h("button", { class: { chip: true, active: this.active === c }, onClick: () => this.select(c) }, c)))));
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
83
|
RecipeFilterBar.style = recipeFilterBarCss();
|
|
@@ -94,7 +94,7 @@ const RecipeRating = class {
|
|
|
94
94
|
}
|
|
95
95
|
render() {
|
|
96
96
|
const stars = Array.from({ length: this.max }, (_, i) => i + 1);
|
|
97
|
-
return (h("div", { key: '
|
|
97
|
+
return (h("div", { key: '2d5251ae7d3a24d613b759e89ba78de1568426d8', class: "wrap", role: this.readonly ? undefined : 'radiogroup' }, stars.map((s) => (h("span", { class: { star: true, filled: s <= this.value, clickable: !this.readonly }, onClick: () => !this.readonly && this.ratingChange.emit({ value: s }) }, "\u2605")))));
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
100
|
RecipeRating.style = recipeRatingCss();
|
|
@@ -164,6 +164,8 @@ const RecipeForm = class {
|
|
|
164
164
|
const errors = {};
|
|
165
165
|
if (!this.title.trim())
|
|
166
166
|
errors.title = 'Title is required.';
|
|
167
|
+
if (!this.category.trim())
|
|
168
|
+
errors.category = 'Category is required.';
|
|
167
169
|
const cleanIngredients = this.ingredients.map((i) => i.trim()).filter(Boolean);
|
|
168
170
|
if (cleanIngredients.length === 0)
|
|
169
171
|
errors.ingredients = 'Add at least one ingredient.';
|
|
@@ -178,7 +180,7 @@ const RecipeForm = class {
|
|
|
178
180
|
this.ingredients = next;
|
|
179
181
|
}
|
|
180
182
|
render() {
|
|
181
|
-
return (h("form", { key: '
|
|
183
|
+
return (h("form", { key: 'd7bf28b14b5d445221c52595bd827f49eed9306b', onSubmit: this.onSubmit }, h("slot", { key: '0ffc3f7fd2e5a15771ae36629365c53b1c44d934', name: "header" }), h("label", { key: '617617d1d4e5b9cbfc506340f3ffcab0364bb402' }, "Title", h("input", { key: '9be17e32164005466bf208323380603e33e43f6e', type: "text", value: this.title, onInput: (e) => (this.title = e.target.value) }), this.errors.title && h("span", { key: 'e1ecebe7af1b6b13a392f4ceb99651c6f87aea43', class: "error" }, this.errors.title)), h("label", { key: '6ce777cc37e11e9c063e43e301d9c93fa7ddf4b4' }, "Image URL", h("input", { key: '37839fabadb556def7f240e8116629315ca1ad73', type: "text", value: this.image, onInput: (e) => (this.image = e.target.value) })), h("label", { key: 'c870efae293faecf06e5d9481d302779c77aac39' }, "Category", h("input", { key: '1cc8a5a113ac6a215dc0c53b43c1f9167afd69f4', type: "text", value: this.category, onInput: (e) => (this.category = e.target.value) }), this.errors.category && h("span", { key: 'ed78cadd9df6f24e700aebc6f85ce993c3d4746b', class: "error" }, this.errors.category)), h("div", { key: '0cbed02ba6b4b021d7cce4ffd9fb3e041452db00', class: "field" }, h("span", { key: '6e8023d7fa1c3a345ac8a1ffca9de1b57af25e8c' }, "Ingredients"), this.ingredients.map((ing, i) => (h("div", { class: "ingredient-row" }, h("input", { type: "text", value: ing, onInput: (e) => this.updateIngredient(i, e.target.value) }), h("button", { type: "button", onClick: () => this.removeIngredient(i), "aria-label": "Remove" }, "\u2715")))), h("button", { key: 'c6fe3f2daad8c3f19daa3570c6e593c6b089aa57', type: "button", class: "add-btn", onClick: this.addIngredient }, "+ Add ingredient"), this.errors.ingredients && h("span", { key: 'bfec646ff34633a03d6b3368c5fb095bc3066025', class: "error" }, this.errors.ingredients)), h("label", { key: 'd3487e03e2c26afe9b3807a9d1f1240dabb30373' }, "Instructions", h("textarea", { key: 'ade48aaca40198665a1fb1525834c27ec0ad0350', rows: 5, onInput: (e) => (this.instructions = e.target.value) }, this.instructions), this.errors.instructions && h("span", { key: 'c90068359e0448b350af5e8b15e50cce682a1615', class: "error" }, this.errors.instructions)), h("div", { key: '2621aec625328743a60c79e49275384017000ccb', class: "footer" }, h("slot", { key: '5d1466af5beba19e66612a7343727ab71e44455f', name: "footer" }), h("button", { key: '5a4883d864051e8081b6a7e1f5c1fb10e7bc5c1a', type: "button", class: "cancel-btn", onClick: () => this.cancel.emit() }, "Cancel"), h("button", { key: '64d4c7e5cad53b1376dce3e73860fc3d4b4d9ff2', type: "submit", class: "save-btn" }, "Save Recipe"))));
|
|
182
184
|
}
|
|
183
185
|
static get watchers() { return {
|
|
184
186
|
"initialData": [{
|
|
@@ -188,7 +190,7 @@ const RecipeForm = class {
|
|
|
188
190
|
};
|
|
189
191
|
RecipeForm.style = recipeFormCss();
|
|
190
192
|
|
|
191
|
-
const mealPlanDayCss = () => `:host{display:block;font-family
|
|
193
|
+
const mealPlanDayCss = () => `:host{display:block;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif}.day-col{background:#ffffff;border:1px solid #e8eaed;border-radius:12px;padding:14px;min-width:160px;display:flex;flex-direction:column;gap:10px;box-shadow:0 1px 2px rgba(16, 24, 40, 0.04);transition:box-shadow 0.15s ease, border-color 0.15s ease}.day-col:hover{box-shadow:0 4px 12px rgba(16, 24, 40, 0.08);border-color:#d8dce1}.col-header{display:flex;align-items:center;gap:6px;padding-bottom:8px;border-bottom:1px solid #f0f1f3}.col-header .icon{font-size:15px;line-height:1}.col-header h3{margin:0;font-size:12.5px;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;color:#4b5563;flex:1}.count-badge{background:#eef2ff;color:#4338ca;font-size:10.5px;font-weight:700;padding:1px 7px;border-radius:999px;line-height:1.5}.meals{display:flex;flex-direction:column;gap:6px;min-height:44px}.meal-chip{display:flex;align-items:center;gap:8px;background:#f9fafb;border:1px solid #eef0f2;border-radius:9px;padding:6px 8px;font-size:12.5px;transition:background 0.12s ease}.meal-chip:hover{background:#f3f4f6}.thumb{width:28px;height:28px;border-radius:6px;overflow:hidden;flex-shrink:0;background:#e5e7eb}.thumb img{width:100%;height:100%;object-fit:cover;display:block}.meal-chip .title{flex:1;color:#1f2937;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.remove-btn{border:none;background:none;cursor:pointer;color:#9ca3af;font-size:11px;line-height:1;padding:3px;border-radius:5px;transition:color 0.12s ease, background 0.12s ease}.remove-btn:hover{color:#dc2626;background:#fef2f2}.empty{font-size:12px;color:#9ca3af;margin:6px 0;text-align:center;font-style:italic}.add-btn{display:flex;align-items:center;justify-content:center;gap:4px;border:1.5px dashed #d1d5db;background:none;border-radius:9px;padding:7px;font-size:12px;font-weight:600;cursor:pointer;color:#6b7280;transition:border-color 0.12s ease, color 0.12s ease, background 0.12s ease}.add-btn:hover{border-color:#6366f1;color:#4f46e5;background:#f5f5ff}.plus{font-size:14px;line-height:1}`;
|
|
192
194
|
|
|
193
195
|
const MealPlanDay = class {
|
|
194
196
|
constructor(hostRef) {
|
|
@@ -197,10 +199,12 @@ const MealPlanDay = class {
|
|
|
197
199
|
this.removeMeal = createEvent(this, "removeMeal");
|
|
198
200
|
this.day = '';
|
|
199
201
|
this.meals = [];
|
|
202
|
+
/** Optional emoji/icon shown next to the label, e.g. "🌅" */
|
|
203
|
+
this.icon = '';
|
|
200
204
|
}
|
|
201
205
|
render() {
|
|
202
206
|
const meals = Array.isArray(this.meals) ? this.meals : [];
|
|
203
|
-
return (h("div", { key: '
|
|
207
|
+
return (h("div", { key: 'cd4f194f1eeb5f53a029f380c40aa0b4ec2f32f4', class: "day-col" }, h("div", { key: 'd88966142d5101fc522d5de89b6d4cab72cbbbf3', class: "col-header" }, this.icon && h("span", { key: '5a9a27a3a1909bcf7295ec7eeccf309e5e2d1ae0', class: "icon" }, this.icon), h("h3", { key: 'fd1fa2f1274cc1f6bd8917959015722cb69002ba' }, this.day), meals.length > 0 && h("span", { key: 'feff3bc91b52203dba19f7a87c56d3813fc95cdd', class: "count-badge" }, meals.length)), h("div", { key: '4afee9ce77bf1447bf9e32efc7e2f9b9571873e7', class: "meals" }, meals.map((m) => (h("div", { class: "meal-chip" }, h("div", { class: "thumb" }, m.image && h("img", { src: m.image, alt: m.title })), h("span", { class: "title" }, m.title), h("button", { class: "remove-btn", onClick: () => this.removeMeal.emit({ day: this.day, mealId: m.id }), "aria-label": `Remove ${m.title}` }, "\u2715")))), meals.length === 0 && h("p", { key: '9a4002b1b4516fc5ff6ef8f9a2e0a7f5e8465cbd', class: "empty" }, "No meal planned")), h("button", { key: '2cef3c5f7d0e89303cb8989f78eefb95c426683f', class: "add-btn", onClick: () => this.assignMeal.emit({ day: this.day }) }, h("span", { key: 'ae54b56f8f0b01f45029e36919764ae31f3a38b9', class: "plus" }, "+"), " Add meal")));
|
|
204
208
|
}
|
|
205
209
|
};
|
|
206
210
|
MealPlanDay.style = mealPlanDayCss();
|
|
@@ -16,7 +16,7 @@ const AppToast = class {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return (h("div", { key: '
|
|
19
|
+
return (h("div", { key: '41fc3560c508b3b36863417af6d8f0aa2ad26004', class: `toast ${this.type}` }, h("span", { key: 'b29ea7dbe53aa72524039f1ce0fea5c50406d1f0' }, this.message), h("button", { key: '3b42fc8485a5d438bb29b5eab2e3ba5ab831731b', onClick: () => this.dismiss.emit(), "aria-label": "Dismiss" }, "\u2715")));
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
AppToast.style = appToastCss();
|
package/dist/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-DQuL1Twl.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["app-modal_7",[[257,"app-modal",{"open":[4],"modalTitle":[1,"modal-title"]}],[1,"meal-plan-day",{"day":[1],"meals":[16]}],[257,"recipe-card",{"recipeTitle":[1,"recipe-title"],"image":[1],"category":[1],"favorite":[4]}],[1,"recipe-filter-bar",{"categories":[16],"active":[1]}],[257,"recipe-form",{"initialData":[1,"initial-data"],"title":[32],"image":[32],"category":[32],"ingredients":[32],"instructions":[32],"errors":[32]},null,{"initialData":[{"onInitialDataChange":0}]}],[1,"recipe-rating",{"value":[2],"readonly":[4],"max":[2]}],[1,"recipe-search-bar",{"placeholder":[1],"value":[1],"debounceMs":[2,"debounce-ms"],"internalValue":[32]},null,{"value":[{"onValuePropChange":0}]}]]],["app-toast",[[1,"app-toast",{"message":[1],"type":[1],"duration":[2]}]]]], options);
|
|
8
|
+
return bootstrapLazy([["app-modal_7",[[257,"app-modal",{"open":[4],"modalTitle":[1,"modal-title"]}],[1,"meal-plan-day",{"day":[1],"meals":[16],"icon":[1]}],[257,"recipe-card",{"recipeTitle":[1,"recipe-title"],"image":[1],"category":[1],"favorite":[4]}],[1,"recipe-filter-bar",{"categories":[16],"active":[1]}],[257,"recipe-form",{"initialData":[1,"initial-data"],"title":[32],"image":[32],"category":[32],"ingredients":[32],"instructions":[32],"errors":[32]},null,{"initialData":[{"onInitialDataChange":0}]}],[1,"recipe-rating",{"value":[2],"readonly":[4],"max":[2]}],[1,"recipe-search-bar",{"placeholder":[1],"value":[1],"debounceMs":[2,"debounce-ms"],"internalValue":[32]},null,{"value":[{"onValuePropChange":0}]}]]],["app-toast",[[1,"app-toast",{"message":[1],"type":[1],"duration":[2]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
package/dist/esm/recipe-ui.js
CHANGED
|
@@ -17,5 +17,5 @@ var patchBrowser = () => {
|
|
|
17
17
|
|
|
18
18
|
patchBrowser().then(async (options) => {
|
|
19
19
|
await globalScripts();
|
|
20
|
-
return bootstrapLazy([["app-modal_7",[[257,"app-modal",{"open":[4],"modalTitle":[1,"modal-title"]}],[1,"meal-plan-day",{"day":[1],"meals":[16]}],[257,"recipe-card",{"recipeTitle":[1,"recipe-title"],"image":[1],"category":[1],"favorite":[4]}],[1,"recipe-filter-bar",{"categories":[16],"active":[1]}],[257,"recipe-form",{"initialData":[1,"initial-data"],"title":[32],"image":[32],"category":[32],"ingredients":[32],"instructions":[32],"errors":[32]},null,{"initialData":[{"onInitialDataChange":0}]}],[1,"recipe-rating",{"value":[2],"readonly":[4],"max":[2]}],[1,"recipe-search-bar",{"placeholder":[1],"value":[1],"debounceMs":[2,"debounce-ms"],"internalValue":[32]},null,{"value":[{"onValuePropChange":0}]}]]],["app-toast",[[1,"app-toast",{"message":[1],"type":[1],"duration":[2]}]]]], options);
|
|
20
|
+
return bootstrapLazy([["app-modal_7",[[257,"app-modal",{"open":[4],"modalTitle":[1,"modal-title"]}],[1,"meal-plan-day",{"day":[1],"meals":[16],"icon":[1]}],[257,"recipe-card",{"recipeTitle":[1,"recipe-title"],"image":[1],"category":[1],"favorite":[4]}],[1,"recipe-filter-bar",{"categories":[16],"active":[1]}],[257,"recipe-form",{"initialData":[1,"initial-data"],"title":[32],"image":[32],"category":[32],"ingredients":[32],"instructions":[32],"errors":[32]},null,{"initialData":[{"onInitialDataChange":0}]}],[1,"recipe-rating",{"value":[2],"readonly":[4],"max":[2]}],[1,"recipe-search-bar",{"placeholder":[1],"value":[1],"debounceMs":[2,"debounce-ms"],"internalValue":[32]},null,{"value":[{"onValuePropChange":0}]}]]],["app-toast",[[1,"app-toast",{"message":[1],"type":[1],"duration":[2]}]]]], options);
|
|
21
21
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,c as t,h as a}from"./p-CrZUP9M-.js";const o=class{constructor(a){s(this,a),this.dismiss=t(this,"dismiss"),this.message="",this.type="info",this.duration=3e3}componentDidLoad(){this.duration>0&&setTimeout((()=>this.dismiss.emit()),this.duration)}render(){return a("div",{key:"41fc3560c508b3b36863417af6d8f0aa2ad26004",class:`toast ${this.type}`},a("span",{key:"b29ea7dbe53aa72524039f1ce0fea5c50406d1f0"},this.message),a("button",{key:"3b42fc8485a5d438bb29b5eab2e3ba5ab831731b",onClick:()=>this.dismiss.emit(),"aria-label":"Dismiss"},"✕"))}};o.style=":host{font-family:system-ui, sans-serif;display:block}.toast{display:flex;align-items:center;gap:10px;padding:10px 16px;border-radius:8px;color:#fff;font-size:14px;box-shadow:0 4px 12px rgba(0,0,0,0.15)}.toast.success{background:#2ecc71}.toast.error{background:#e74c3c}.toast.info{background:#3498db}button{border:none;background:none;color:inherit;cursor:pointer;margin-left:auto}";export{o as app_toast}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as t,h as i}from"./p-CrZUP9M-.js";const a=class{constructor(i){e(this,i),this.favoriteToggle=t(this,"favoriteToggle"),this.cardClick=t(this,"cardClick"),this.category="",this.favorite=!1,this.onFavoriteClick=e=>{e.stopPropagation(),this.favoriteToggle.emit({favorite:!this.favorite})}}render(){return i("div",{key:"c9dc0d8c98899cf188fc46c72b5e809831332f24",class:"card",onClick:()=>this.cardClick.emit()},i("div",{key:"12e0512dc7ee78f46843f81483c5f7bf1fbc3616",class:"image-wrap"},this.image?i("img",{src:this.image,alt:this.recipeTitle}):i("div",{class:"placeholder"}),i("button",{key:"95ab4db232ee878d61e272ce7a4814a48790c01d",class:{"fav-btn":!0,active:this.favorite},onClick:this.onFavoriteClick,"aria-label":"Toggle favorite"},this.favorite?"★":"☆")),i("div",{key:"a2906c670d693a473b87042ff6b0ada03627205b",class:"body"},i("h3",{key:"2b0f4afecfdfd9cc996dcec29bd86957687667e3"},this.recipeTitle),this.category&&i("span",{key:"1b9c31d2723d2c87d51021569271366bac550a2f",class:"category"},this.category),i("div",{key:"d79b1cc33dcced145c3551874f69b581b4734297",class:"actions"},i("slot",{key:"9a43cf770ea8fa189564fbe14f4f135a4d8e9551",name:"actions"}))))}};a.style=":host{display:block;font-family:system-ui, sans-serif}.card{border:1px solid #e5e5e5;border-radius:12px;overflow:hidden;cursor:pointer;background:#fff;transition:box-shadow 0.15s ease, transform 0.15s ease}.card:hover{box-shadow:0 4px 16px rgba(0, 0, 0, 0.08);transform:translateY(-2px)}.image-wrap{position:relative;aspect-ratio:4 / 3;background:#f2f2f2}.image-wrap img{width:100%;height:100%;object-fit:cover;display:block}.placeholder{width:100%;height:100%;background:linear-gradient(135deg, #eee, #ddd)}.fav-btn{position:absolute;top:8px;right:8px;border:none;background:rgba(255, 255, 255, 0.9);border-radius:50%;width:32px;height:32px;font-size:16px;cursor:pointer;color:#f5a623}.fav-btn.active{color:#ff6b35}.body{padding:12px 14px}h3{margin:0 0 4px;font-size:15px;line-height:1.3}.category{font-size:12px;color:#777;text-transform:uppercase;letter-spacing:0.03em}.actions{margin-top:8px}";const s=class{constructor(i){e(this,i),this.search=t(this,"search"),this.placeholder="Search recipes...",this.value="",this.debounceMs=350,this.internalValue="",this.onInput=e=>{this.internalValue=e.target.value,clearTimeout(this.timer),this.timer=setTimeout((()=>{this.search.emit({value:this.internalValue})}),this.debounceMs)},this.onKeyDown=e=>{"Enter"===e.key&&(clearTimeout(this.timer),this.search.emit({value:this.internalValue}))}}componentWillLoad(){this.internalValue=this.value}onValuePropChange(e){this.internalValue=e}render(){return i("div",{key:"b55c496d5c2968b4b79c40b9333c62ed4653e76d",class:"wrap"},i("input",{key:"081ae0dfde47acca677c746bc88cda1864eac851",type:"search",placeholder:this.placeholder,value:this.internalValue,onInput:this.onInput,onKeyDown:this.onKeyDown}),i("button",{key:"44cde335aec87330bb4486883c9cf836a6855ad0",onClick:()=>this.search.emit({value:this.internalValue}),"aria-label":"Search"},"🔍"))}static get watchers(){return{value:[{onValuePropChange:0}]}}};s.style=":host{display:block;font-family:system-ui, sans-serif}.wrap{display:flex;gap:6px}input{flex:1;padding:10px 14px;border-radius:8px;border:1px solid #ddd;font-size:14px;outline:none}input:focus{border-color:#ff6b35}button{border:none;background:#ff6b35;color:#fff;border-radius:8px;padding:0 16px;cursor:pointer;font-size:15px}";const o=class{constructor(i){e(this,i),this.filterChange=t(this,"filterChange"),this.categories=[],this.active=""}select(e){this.filterChange.emit({value:e})}render(){const e=Array.isArray(this.categories)?this.categories:[];return i("div",{key:"90b26633c07d813221b1cc44705c5fe510de994f",class:"wrap"},i("button",{key:"a41696529d8611f283460da1efe9205bd0b36260",class:{chip:!0,active:""===this.active},onClick:()=>this.select("")},"All"),e.map((e=>i("button",{class:{chip:!0,active:this.active===e},onClick:()=>this.select(e)},e))))}};o.style=":host{display:block;font-family:system-ui, sans-serif}.wrap{display:flex;flex-wrap:wrap;gap:8px}.chip{border:1px solid #ddd;background:#fff;border-radius:999px;padding:6px 14px;font-size:13px;cursor:pointer;color:#444}.chip.active{background:#ff6b35;border-color:#ff6b35;color:#fff}";const r=class{constructor(i){e(this,i),this.ratingChange=t(this,"ratingChange"),this.value=0,this.readonly=!1,this.max=5}render(){const e=Array.from({length:this.max},((e,t)=>t+1));return i("div",{key:"2d5251ae7d3a24d613b759e89ba78de1568426d8",class:"wrap",role:this.readonly?void 0:"radiogroup"},e.map((e=>i("span",{class:{star:!0,filled:e<=this.value,clickable:!this.readonly},onClick:()=>!this.readonly&&this.ratingChange.emit({value:e})},"★"))))}};r.style=":host{display:inline-block;font-family:system-ui, sans-serif}.wrap{display:flex;gap:2px}.star{font-size:18px;color:#ddd}.star.filled{color:#f5a623}.star.clickable{cursor:pointer}";const c=class{constructor(i){e(this,i),this.save=t(this,"save"),this.cancel=t(this,"cancel"),this.title="",this.image="",this.category="",this.ingredients=[""],this.instructions="",this.errors={},this.onSubmit=e=>{if(e.preventDefault(),!this.validate())return;const t={id:this.initialData?.id,title:this.title.trim(),image:this.image.trim(),category:this.category.trim(),ingredients:this.ingredients.map((e=>e.trim())).filter(Boolean),instructions:this.instructions.trim()};this.save.emit(t)},this.addIngredient=()=>{this.ingredients=[...this.ingredients,""]},this.removeIngredient=e=>{this.ingredients=this.ingredients.filter(((t,i)=>i!==e))}}componentWillLoad(){this.loadInitialData()}onInitialDataChange(){this.loadInitialData()}loadInitialData(){let e;if("string"==typeof this.initialData&&this.initialData)try{e=JSON.parse(this.initialData)}catch{e=void 0}else this.initialData&&"object"==typeof this.initialData&&(e=this.initialData);e&&(this.title=e.title??"",this.image=e.image??"",this.category=e.category??"",this.ingredients=e.ingredients?.length?[...e.ingredients]:[""],this.instructions=e.instructions??"")}validate(){const e={};return this.title.trim()||(e.title="Title is required."),this.category.trim()||(e.category="Category is required."),0===this.ingredients.map((e=>e.trim())).filter(Boolean).length&&(e.ingredients="Add at least one ingredient."),this.instructions.trim()||(e.instructions="Instructions are required."),this.errors=e,0===Object.keys(e).length}updateIngredient(e,t){const i=[...this.ingredients];i[e]=t,this.ingredients=i}render(){return i("form",{key:"d7bf28b14b5d445221c52595bd827f49eed9306b",onSubmit:this.onSubmit},i("slot",{key:"0ffc3f7fd2e5a15771ae36629365c53b1c44d934",name:"header"}),i("label",{key:"617617d1d4e5b9cbfc506340f3ffcab0364bb402"},"Title",i("input",{key:"9be17e32164005466bf208323380603e33e43f6e",type:"text",value:this.title,onInput:e=>this.title=e.target.value}),this.errors.title&&i("span",{key:"e1ecebe7af1b6b13a392f4ceb99651c6f87aea43",class:"error"},this.errors.title)),i("label",{key:"6ce777cc37e11e9c063e43e301d9c93fa7ddf4b4"},"Image URL",i("input",{key:"37839fabadb556def7f240e8116629315ca1ad73",type:"text",value:this.image,onInput:e=>this.image=e.target.value})),i("label",{key:"c870efae293faecf06e5d9481d302779c77aac39"},"Category",i("input",{key:"1cc8a5a113ac6a215dc0c53b43c1f9167afd69f4",type:"text",value:this.category,onInput:e=>this.category=e.target.value}),this.errors.category&&i("span",{key:"ed78cadd9df6f24e700aebc6f85ce993c3d4746b",class:"error"},this.errors.category)),i("div",{key:"0cbed02ba6b4b021d7cce4ffd9fb3e041452db00",class:"field"},i("span",{key:"6e8023d7fa1c3a345ac8a1ffca9de1b57af25e8c"},"Ingredients"),this.ingredients.map(((e,t)=>i("div",{class:"ingredient-row"},i("input",{type:"text",value:e,onInput:e=>this.updateIngredient(t,e.target.value)}),i("button",{type:"button",onClick:()=>this.removeIngredient(t),"aria-label":"Remove"},"✕")))),i("button",{key:"c6fe3f2daad8c3f19daa3570c6e593c6b089aa57",type:"button",class:"add-btn",onClick:this.addIngredient},"+ Add ingredient"),this.errors.ingredients&&i("span",{key:"bfec646ff34633a03d6b3368c5fb095bc3066025",class:"error"},this.errors.ingredients)),i("label",{key:"d3487e03e2c26afe9b3807a9d1f1240dabb30373"},"Instructions",i("textarea",{key:"ade48aaca40198665a1fb1525834c27ec0ad0350",rows:5,onInput:e=>this.instructions=e.target.value},this.instructions),this.errors.instructions&&i("span",{key:"c90068359e0448b350af5e8b15e50cce682a1615",class:"error"},this.errors.instructions)),i("div",{key:"2621aec625328743a60c79e49275384017000ccb",class:"footer"},i("slot",{key:"5d1466af5beba19e66612a7343727ab71e44455f",name:"footer"}),i("button",{key:"5a4883d864051e8081b6a7e1f5c1fb10e7bc5c1a",type:"button",class:"cancel-btn",onClick:()=>this.cancel.emit()},"Cancel"),i("button",{key:"64d4c7e5cad53b1376dce3e73860fc3d4b4d9ff2",type:"submit",class:"save-btn"},"Save Recipe")))}static get watchers(){return{initialData:[{onInitialDataChange:0}]}}};c.style=":host{display:block;font-family:system-ui, sans-serif}form{display:flex;flex-direction:column;gap:14px}label{display:flex;flex-direction:column;gap:4px;font-size:13px;color:#333;font-weight:600}input,textarea{font-weight:400;padding:8px 10px;border:1px solid #ddd;border-radius:6px;font-size:14px;font-family:inherit}.field{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:600}.ingredient-row{display:flex;gap:6px}.ingredient-row input{flex:1}.ingredient-row button{border:none;background:#f4f4f4;border-radius:6px;cursor:pointer;width:30px}.add-btn{align-self:flex-start;border:1px dashed #bbb;background:none;border-radius:6px;padding:6px 10px;cursor:pointer;font-size:13px;color:#555}.error{color:#e74c3c;font-size:12px;font-weight:400}.footer{display:flex;justify-content:flex-end;gap:10px;margin-top:6px}.cancel-btn{border:1px solid #ddd;background:#fff;border-radius:8px;padding:8px 16px;cursor:pointer}.save-btn{border:none;background:#ff6b35;color:#fff;border-radius:8px;padding:8px 18px;cursor:pointer;font-weight:600}";const d=class{constructor(i){e(this,i),this.assignMeal=t(this,"assignMeal"),this.removeMeal=t(this,"removeMeal"),this.day="",this.meals=[],this.icon=""}render(){const e=Array.isArray(this.meals)?this.meals:[];return i("div",{key:"cd4f194f1eeb5f53a029f380c40aa0b4ec2f32f4",class:"day-col"},i("div",{key:"d88966142d5101fc522d5de89b6d4cab72cbbbf3",class:"col-header"},this.icon&&i("span",{key:"5a9a27a3a1909bcf7295ec7eeccf309e5e2d1ae0",class:"icon"},this.icon),i("h3",{key:"fd1fa2f1274cc1f6bd8917959015722cb69002ba"},this.day),e.length>0&&i("span",{key:"feff3bc91b52203dba19f7a87c56d3813fc95cdd",class:"count-badge"},e.length)),i("div",{key:"4afee9ce77bf1447bf9e32efc7e2f9b9571873e7",class:"meals"},e.map((e=>i("div",{class:"meal-chip"},i("div",{class:"thumb"},e.image&&i("img",{src:e.image,alt:e.title})),i("span",{class:"title"},e.title),i("button",{class:"remove-btn",onClick:()=>this.removeMeal.emit({day:this.day,mealId:e.id}),"aria-label":`Remove ${e.title}`},"✕")))),0===e.length&&i("p",{key:"9a4002b1b4516fc5ff6ef8f9a2e0a7f5e8465cbd",class:"empty"},"No meal planned")),i("button",{key:"2cef3c5f7d0e89303cb8989f78eefb95c426683f",class:"add-btn",onClick:()=>this.assignMeal.emit({day:this.day})},i("span",{key:"ae54b56f8f0b01f45029e36919764ae31f3a38b9",class:"plus"},"+")," Add meal"))}};d.style=":host{display:block;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif}.day-col{background:#ffffff;border:1px solid #e8eaed;border-radius:12px;padding:14px;min-width:160px;display:flex;flex-direction:column;gap:10px;box-shadow:0 1px 2px rgba(16, 24, 40, 0.04);transition:box-shadow 0.15s ease, border-color 0.15s ease}.day-col:hover{box-shadow:0 4px 12px rgba(16, 24, 40, 0.08);border-color:#d8dce1}.col-header{display:flex;align-items:center;gap:6px;padding-bottom:8px;border-bottom:1px solid #f0f1f3}.col-header .icon{font-size:15px;line-height:1}.col-header h3{margin:0;font-size:12.5px;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;color:#4b5563;flex:1}.count-badge{background:#eef2ff;color:#4338ca;font-size:10.5px;font-weight:700;padding:1px 7px;border-radius:999px;line-height:1.5}.meals{display:flex;flex-direction:column;gap:6px;min-height:44px}.meal-chip{display:flex;align-items:center;gap:8px;background:#f9fafb;border:1px solid #eef0f2;border-radius:9px;padding:6px 8px;font-size:12.5px;transition:background 0.12s ease}.meal-chip:hover{background:#f3f4f6}.thumb{width:28px;height:28px;border-radius:6px;overflow:hidden;flex-shrink:0;background:#e5e7eb}.thumb img{width:100%;height:100%;object-fit:cover;display:block}.meal-chip .title{flex:1;color:#1f2937;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.remove-btn{border:none;background:none;cursor:pointer;color:#9ca3af;font-size:11px;line-height:1;padding:3px;border-radius:5px;transition:color 0.12s ease, background 0.12s ease}.remove-btn:hover{color:#dc2626;background:#fef2f2}.empty{font-size:12px;color:#9ca3af;margin:6px 0;text-align:center;font-style:italic}.add-btn{display:flex;align-items:center;justify-content:center;gap:4px;border:1.5px dashed #d1d5db;background:none;border-radius:9px;padding:7px;font-size:12px;font-weight:600;cursor:pointer;color:#6b7280;transition:border-color 0.12s ease, color 0.12s ease, background 0.12s ease}.add-btn:hover{border-color:#6366f1;color:#4f46e5;background:#f5f5ff}.plus{font-size:14px;line-height:1}";const n=class{constructor(i){e(this,i),this.close=t(this,"close"),this.open=!1,this.modalTitle=""}render(){return this.open?i("div",{class:"overlay",onClick:()=>this.close.emit()},i("div",{class:"dialog",onClick:e=>e.stopPropagation()},i("div",{class:"header"},i("h2",null,this.modalTitle),i("button",{class:"close-btn",onClick:()=>this.close.emit(),"aria-label":"Close"},"✕")),i("div",{class:"body"},i("slot",null)))):null}};n.style=":host{font-family:system-ui, sans-serif}.overlay{position:fixed;inset:0;background:rgba(0, 0, 0, 0.45);display:flex;align-items:center;justify-content:center;z-index:1000}.dialog{background:#fff;border-radius:12px;min-width:320px;max-width:90vw;max-height:85vh;overflow-y:auto;padding:20px;box-shadow:0 10px 40px rgba(0,0,0,0.2)}.header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.header h2{margin:0;font-size:18px}.close-btn{border:none;background:none;font-size:16px;cursor:pointer;color:#666}";export{n as app_modal,d as meal_plan_day,a as recipe_card,o as recipe_filter_bar,c as recipe_form,r as recipe_rating,s as recipe_search_bar}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as a}from"./p-CrZUP9M-.js";export{s as setNonce}from"./p-CrZUP9M-.js";import{g as i}from"./p-DQuL1Twl.js";(()=>{const a=import.meta.url,i={};return""!==a&&(i.resourcesUrl=new URL(".",a).href),e(i)})().then((async e=>(await i(),a([["p-
|
|
1
|
+
import{p as e,b as a}from"./p-CrZUP9M-.js";export{s as setNonce}from"./p-CrZUP9M-.js";import{g as i}from"./p-DQuL1Twl.js";(()=>{const a=import.meta.url,i={};return""!==a&&(i.resourcesUrl=new URL(".",a).href),e(i)})().then((async e=>(await i(),a([["p-97e73b62",[[257,"app-modal",{open:[4],modalTitle:[1,"modal-title"]}],[1,"meal-plan-day",{day:[1],meals:[16],icon:[1]}],[257,"recipe-card",{recipeTitle:[1,"recipe-title"],image:[1],category:[1],favorite:[4]}],[1,"recipe-filter-bar",{categories:[16],active:[1]}],[257,"recipe-form",{initialData:[1,"initial-data"],title:[32],image:[32],category:[32],ingredients:[32],instructions:[32],errors:[32]},null,{initialData:[{onInitialDataChange:0}]}],[1,"recipe-rating",{value:[2],readonly:[4],max:[2]}],[1,"recipe-search-bar",{placeholder:[1],value:[1],debounceMs:[2,"debounce-ms"],internalValue:[32]},null,{value:[{onValuePropChange:0}]}]]],["p-268be6b1",[[1,"app-toast",{message:[1],type:[1],duration:[2]}]]]],e))));
|
|
@@ -4,16 +4,11 @@ export interface PlannedMeal {
|
|
|
4
4
|
title: string;
|
|
5
5
|
image?: string;
|
|
6
6
|
}
|
|
7
|
-
/**
|
|
8
|
-
* One column of the weekly meal planner, representing a single day.
|
|
9
|
-
* `meals` is the list of recipes currently assigned to this day.
|
|
10
|
-
* Emits `removeMeal` when a meal's remove button is clicked, and
|
|
11
|
-
* `assignMeal` when the "+ Add meal" button is clicked (the parent app
|
|
12
|
-
* is expected to open its own picker/modal and then update `meals`).
|
|
13
|
-
*/
|
|
14
7
|
export declare class MealPlanDay {
|
|
15
8
|
day: string;
|
|
16
9
|
meals: PlannedMeal[];
|
|
10
|
+
/** Optional emoji/icon shown next to the label, e.g. "🌅" */
|
|
11
|
+
icon: string;
|
|
17
12
|
assignMeal: EventEmitter<{
|
|
18
13
|
day: string;
|
|
19
14
|
}>;
|
|
@@ -40,18 +40,16 @@ export namespace Components {
|
|
|
40
40
|
*/
|
|
41
41
|
"type": 'success' | 'error' | 'info';
|
|
42
42
|
}
|
|
43
|
-
/**
|
|
44
|
-
* One column of the weekly meal planner, representing a single day.
|
|
45
|
-
* `meals` is the list of recipes currently assigned to this day.
|
|
46
|
-
* Emits `removeMeal` when a meal's remove button is clicked, and
|
|
47
|
-
* `assignMeal` when the "+ Add meal" button is clicked (the parent app
|
|
48
|
-
* is expected to open its own picker/modal and then update `meals`).
|
|
49
|
-
*/
|
|
50
43
|
interface MealPlanDay {
|
|
51
44
|
/**
|
|
52
45
|
* @default ''
|
|
53
46
|
*/
|
|
54
47
|
"day": string;
|
|
48
|
+
/**
|
|
49
|
+
* Optional emoji/icon shown next to the label, e.g. "🌅"
|
|
50
|
+
* @default ''
|
|
51
|
+
*/
|
|
52
|
+
"icon": string;
|
|
55
53
|
/**
|
|
56
54
|
* @default []
|
|
57
55
|
*/
|
|
@@ -223,13 +221,6 @@ declare global {
|
|
|
223
221
|
"assignMeal": { day: string };
|
|
224
222
|
"removeMeal": { day: string; mealId: string };
|
|
225
223
|
}
|
|
226
|
-
/**
|
|
227
|
-
* One column of the weekly meal planner, representing a single day.
|
|
228
|
-
* `meals` is the list of recipes currently assigned to this day.
|
|
229
|
-
* Emits `removeMeal` when a meal's remove button is clicked, and
|
|
230
|
-
* `assignMeal` when the "+ Add meal" button is clicked (the parent app
|
|
231
|
-
* is expected to open its own picker/modal and then update `meals`).
|
|
232
|
-
*/
|
|
233
224
|
interface HTMLMealPlanDayElement extends Components.MealPlanDay, HTMLStencilElement {
|
|
234
225
|
addEventListener<K extends keyof HTMLMealPlanDayElementEventMap>(type: K, listener: (this: HTMLMealPlanDayElement, ev: MealPlanDayCustomEvent<HTMLMealPlanDayElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
235
226
|
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -399,18 +390,16 @@ declare namespace LocalJSX {
|
|
|
399
390
|
*/
|
|
400
391
|
"type"?: 'success' | 'error' | 'info';
|
|
401
392
|
}
|
|
402
|
-
/**
|
|
403
|
-
* One column of the weekly meal planner, representing a single day.
|
|
404
|
-
* `meals` is the list of recipes currently assigned to this day.
|
|
405
|
-
* Emits `removeMeal` when a meal's remove button is clicked, and
|
|
406
|
-
* `assignMeal` when the "+ Add meal" button is clicked (the parent app
|
|
407
|
-
* is expected to open its own picker/modal and then update `meals`).
|
|
408
|
-
*/
|
|
409
393
|
interface MealPlanDay {
|
|
410
394
|
/**
|
|
411
395
|
* @default ''
|
|
412
396
|
*/
|
|
413
397
|
"day"?: string;
|
|
398
|
+
/**
|
|
399
|
+
* Optional emoji/icon shown next to the label, e.g. "🌅"
|
|
400
|
+
* @default ''
|
|
401
|
+
*/
|
|
402
|
+
"icon"?: string;
|
|
414
403
|
/**
|
|
415
404
|
* @default []
|
|
416
405
|
*/
|
|
@@ -531,6 +520,7 @@ declare namespace LocalJSX {
|
|
|
531
520
|
}
|
|
532
521
|
interface MealPlanDayAttributes {
|
|
533
522
|
"day": string;
|
|
523
|
+
"icon": string;
|
|
534
524
|
}
|
|
535
525
|
interface RecipeCardAttributes {
|
|
536
526
|
"recipeTitle": string;
|
|
@@ -578,13 +568,6 @@ declare module "@stencil/core" {
|
|
|
578
568
|
* Simple notification toast. Auto-dismisses after `duration` ms if > 0.
|
|
579
569
|
*/
|
|
580
570
|
"app-toast": LocalJSX.IntrinsicElements["app-toast"] & JSXBase.HTMLAttributes<HTMLAppToastElement>;
|
|
581
|
-
/**
|
|
582
|
-
* One column of the weekly meal planner, representing a single day.
|
|
583
|
-
* `meals` is the list of recipes currently assigned to this day.
|
|
584
|
-
* Emits `removeMeal` when a meal's remove button is clicked, and
|
|
585
|
-
* `assignMeal` when the "+ Add meal" button is clicked (the parent app
|
|
586
|
-
* is expected to open its own picker/modal and then update `meals`).
|
|
587
|
-
*/
|
|
588
571
|
"meal-plan-day": LocalJSX.IntrinsicElements["meal-plan-day"] & JSXBase.HTMLAttributes<HTMLMealPlanDayElement>;
|
|
589
572
|
/**
|
|
590
573
|
* Displays a summary of a recipe (image, title, category) inside a card.
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e,p as a,H as s,c as t,h as d}from"./p-BJU3HdRm.js";const i=a(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.assignMeal=t(this,"assignMeal"),this.removeMeal=t(this,"removeMeal"),this.day="",this.meals=[]}render(){const e=Array.isArray(this.meals)?this.meals:[];return d("div",{key:"7a0b592fd4b8d9971d7f4912cecb5f9126be11b3",class:"day-col"},d("h3",{key:"b0f1f6a717ad409e6339219ea2f71b73d73bb1f3"},this.day),d("div",{key:"2c978721af3aad27042572dd7825d5f2b5b659fb",class:"meals"},e.map((e=>d("div",{class:"meal-chip"},e.image&&d("img",{src:e.image,alt:e.title}),d("span",{class:"title"},e.title),d("button",{onClick:()=>this.removeMeal.emit({day:this.day,mealId:e.id}),"aria-label":"Remove meal"},"✕")))),0===e.length&&d("p",{key:"326b5f3201df2416f43debc7257918a60a6ab6dd",class:"empty"},"No meals planned")),d("button",{key:"3532de633a1f6cb83bb70f91a2df8fe1a9fcbc14",class:"add-btn",onClick:()=>this.assignMeal.emit({day:this.day})},"+ Add meal"))}static get style(){return":host{display:block;font-family:system-ui, sans-serif}.day-col{border:1px solid #eee;border-radius:10px;padding:10px;min-width:150px;display:flex;flex-direction:column;gap:8px;background:#fafafa}h3{margin:0;font-size:13px;text-transform:uppercase;letter-spacing:0.04em;color:#555}.meals{display:flex;flex-direction:column;gap:6px;min-height:40px}.meal-chip{display:flex;align-items:center;gap:6px;background:#fff;border:1px solid #eee;border-radius:8px;padding:4px 6px;font-size:12px}.meal-chip img{width:24px;height:24px;border-radius:4px;object-fit:cover}.meal-chip .title{flex:1}.meal-chip button{border:none;background:none;cursor:pointer;color:#999}.empty{font-size:12px;color:#aaa;margin:4px 0}.add-btn{border:1px dashed #ccc;background:none;border-radius:8px;padding:6px;font-size:12px;cursor:pointer;color:#666}"}},[1,"meal-plan-day",{day:[1],meals:[16]}]);function o(){"undefined"!=typeof customElements&&["meal-plan-day"].forEach((a=>{"meal-plan-day"===a&&(customElements.get(e(a))||customElements.define(e(a),i))}))}o();export{i as M,o as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e,p as t,H as i,c as a,h as s}from"./p-BJU3HdRm.js";const n=t(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.save=a(this,"save"),this.cancel=a(this,"cancel"),this.title="",this.image="",this.category="",this.ingredients=[""],this.instructions="",this.errors={},this.onSubmit=e=>{if(e.preventDefault(),!this.validate())return;const t={id:this.initialData?.id,title:this.title.trim(),image:this.image.trim(),category:this.category.trim(),ingredients:this.ingredients.map((e=>e.trim())).filter(Boolean),instructions:this.instructions.trim()};this.save.emit(t)},this.addIngredient=()=>{this.ingredients=[...this.ingredients,""]},this.removeIngredient=e=>{this.ingredients=this.ingredients.filter(((t,i)=>i!==e))}}componentWillLoad(){this.loadInitialData()}onInitialDataChange(){this.loadInitialData()}loadInitialData(){let e;if("string"==typeof this.initialData&&this.initialData)try{e=JSON.parse(this.initialData)}catch{e=void 0}else this.initialData&&"object"==typeof this.initialData&&(e=this.initialData);e&&(this.title=e.title??"",this.image=e.image??"",this.category=e.category??"",this.ingredients=e.ingredients?.length?[...e.ingredients]:[""],this.instructions=e.instructions??"")}validate(){const e={};return this.title.trim()||(e.title="Title is required."),0===this.ingredients.map((e=>e.trim())).filter(Boolean).length&&(e.ingredients="Add at least one ingredient."),this.instructions.trim()||(e.instructions="Instructions are required."),this.errors=e,0===Object.keys(e).length}updateIngredient(e,t){const i=[...this.ingredients];i[e]=t,this.ingredients=i}render(){return s("form",{key:"bb5c6c7f1b421b55515994f0256c5b39ea781632",onSubmit:this.onSubmit},s("slot",{key:"16940e4c8368aa6b546254ff8db7b28885a4409b",name:"header"}),s("label",{key:"7e3d6ba3231039ecdcca6a4c4314cf27038e1732"},"Title",s("input",{key:"f86056de021f040b8bbf3bf67a0d40ba526ad754",type:"text",value:this.title,onInput:e=>this.title=e.target.value}),this.errors.title&&s("span",{key:"54d552a15e037f54b2c6f0fd13cb4b685c25c76c",class:"error"},this.errors.title)),s("label",{key:"376da4904e7919b5540ee8dabf494f6aab053523"},"Image URL",s("input",{key:"761b64f0e5153ca0e2bf61a7db4c4106ae2f79ef",type:"text",value:this.image,onInput:e=>this.image=e.target.value})),s("label",{key:"0b7ff19b8718540b08921bb7f301be5cacf0df36"},"Category",s("input",{key:"4f1bae8316d588e93006a12e0d824579ddbece43",type:"text",value:this.category,onInput:e=>this.category=e.target.value})),s("div",{key:"280d98b91621defa547dbcc35c0cb6da55a67b5f",class:"field"},s("span",{key:"96a015e055b434441eba85dcb89470823d0ebcc8"},"Ingredients"),this.ingredients.map(((e,t)=>s("div",{class:"ingredient-row"},s("input",{type:"text",value:e,onInput:e=>this.updateIngredient(t,e.target.value)}),s("button",{type:"button",onClick:()=>this.removeIngredient(t),"aria-label":"Remove"},"✕")))),s("button",{key:"697cda22eb5bdf42e50ac40669619fbc04140405",type:"button",class:"add-btn",onClick:this.addIngredient},"+ Add ingredient"),this.errors.ingredients&&s("span",{key:"6a46c393bdd9af8e1e1255792d5532daf433f25b",class:"error"},this.errors.ingredients)),s("label",{key:"6abdbe72d381c3a0a56c46560a92b1e533fcce2a"},"Instructions",s("textarea",{key:"1d3b62d6543e42a4cd0755522f657c13e2d1e4a7",rows:5,onInput:e=>this.instructions=e.target.value},this.instructions),this.errors.instructions&&s("span",{key:"b5845bb5cd0ddd40de21f074307513d376a05f56",class:"error"},this.errors.instructions)),s("div",{key:"778adeff176e2d2b080aad59602db6e92a69ea1c",class:"footer"},s("slot",{key:"c9584d6606ed33f616eb8f3035aa4a0fd5086af3",name:"footer"}),s("button",{key:"b2e17dfb528996a1e6a8a1f8aac36b36e3b07c3a",type:"button",class:"cancel-btn",onClick:()=>this.cancel.emit()},"Cancel"),s("button",{key:"a9e91907aa44c8587a2c492f869d0cb5daa942fe",type:"submit",class:"save-btn"},"Save Recipe")))}static get watchers(){return{initialData:[{onInitialDataChange:0}]}}static get style(){return":host{display:block;font-family:system-ui, sans-serif}form{display:flex;flex-direction:column;gap:14px}label{display:flex;flex-direction:column;gap:4px;font-size:13px;color:#333;font-weight:600}input,textarea{font-weight:400;padding:8px 10px;border:1px solid #ddd;border-radius:6px;font-size:14px;font-family:inherit}.field{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:600}.ingredient-row{display:flex;gap:6px}.ingredient-row input{flex:1}.ingredient-row button{border:none;background:#f4f4f4;border-radius:6px;cursor:pointer;width:30px}.add-btn{align-self:flex-start;border:1px dashed #bbb;background:none;border-radius:6px;padding:6px 10px;cursor:pointer;font-size:13px;color:#555}.error{color:#e74c3c;font-size:12px;font-weight:400}.footer{display:flex;justify-content:flex-end;gap:10px;margin-top:6px}.cancel-btn{border:1px solid #ddd;background:#fff;border-radius:8px;padding:8px 16px;cursor:pointer}.save-btn{border:none;background:#ff6b35;color:#fff;border-radius:8px;padding:8px 18px;cursor:pointer;font-weight:600}"}},[257,"recipe-form",{initialData:[1,"initial-data"],title:[32],image:[32],category:[32],ingredients:[32],instructions:[32],errors:[32]},void 0,{initialData:[{onInitialDataChange:0}]}]);function d(){"undefined"!=typeof customElements&&["recipe-form"].forEach((t=>{"recipe-form"===t&&(customElements.get(e(t))||customElements.define(e(t),n))}))}d();export{n as R,d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as i}from"./p-CrZUP9M-.js";const a=class{constructor(i){e(this,i),this.favoriteToggle=t(this,"favoriteToggle"),this.cardClick=t(this,"cardClick"),this.category="",this.favorite=!1,this.onFavoriteClick=e=>{e.stopPropagation(),this.favoriteToggle.emit({favorite:!this.favorite})}}render(){return i("div",{key:"abd19b1d63409b52cf66f348131f5f6f77bb47a6",class:"card",onClick:()=>this.cardClick.emit()},i("div",{key:"1292c3f6dfe7d3b399943004f764c41a3d072188",class:"image-wrap"},this.image?i("img",{src:this.image,alt:this.recipeTitle}):i("div",{class:"placeholder"}),i("button",{key:"0efdc01af349d011ca0e11c4df5438b79876b467",class:{"fav-btn":!0,active:this.favorite},onClick:this.onFavoriteClick,"aria-label":"Toggle favorite"},this.favorite?"★":"☆")),i("div",{key:"66c2c4d845d9cc082c07f24f5d827313f6ad51c4",class:"body"},i("h3",{key:"779fc629c3b97b6158f99440d9bb17fafb708dd3"},this.recipeTitle),this.category&&i("span",{key:"259ec599a43a5c8a279ad5993ba36f8602125b76",class:"category"},this.category),i("div",{key:"58ab20f9682b4b73b7d027571496641cbfa76d0b",class:"actions"},i("slot",{key:"28103422d993e58b133c2350e37c06fddf24300f",name:"actions"}))))}};a.style=":host{display:block;font-family:system-ui, sans-serif}.card{border:1px solid #e5e5e5;border-radius:12px;overflow:hidden;cursor:pointer;background:#fff;transition:box-shadow 0.15s ease, transform 0.15s ease}.card:hover{box-shadow:0 4px 16px rgba(0, 0, 0, 0.08);transform:translateY(-2px)}.image-wrap{position:relative;aspect-ratio:4 / 3;background:#f2f2f2}.image-wrap img{width:100%;height:100%;object-fit:cover;display:block}.placeholder{width:100%;height:100%;background:linear-gradient(135deg, #eee, #ddd)}.fav-btn{position:absolute;top:8px;right:8px;border:none;background:rgba(255, 255, 255, 0.9);border-radius:50%;width:32px;height:32px;font-size:16px;cursor:pointer;color:#f5a623}.fav-btn.active{color:#ff6b35}.body{padding:12px 14px}h3{margin:0 0 4px;font-size:15px;line-height:1.3}.category{font-size:12px;color:#777;text-transform:uppercase;letter-spacing:0.03em}.actions{margin-top:8px}";const s=class{constructor(i){e(this,i),this.search=t(this,"search"),this.placeholder="Search recipes...",this.value="",this.debounceMs=350,this.internalValue="",this.onInput=e=>{this.internalValue=e.target.value,clearTimeout(this.timer),this.timer=setTimeout((()=>{this.search.emit({value:this.internalValue})}),this.debounceMs)},this.onKeyDown=e=>{"Enter"===e.key&&(clearTimeout(this.timer),this.search.emit({value:this.internalValue}))}}componentWillLoad(){this.internalValue=this.value}onValuePropChange(e){this.internalValue=e}render(){return i("div",{key:"fe5eb2928308fb2496badd784e684b19df52501a",class:"wrap"},i("input",{key:"3d4abb23a1155075a8889e015819b37a8569f6f5",type:"search",placeholder:this.placeholder,value:this.internalValue,onInput:this.onInput,onKeyDown:this.onKeyDown}),i("button",{key:"f33f95b5bfcad9146903a2eb4448932a1d68edb7",onClick:()=>this.search.emit({value:this.internalValue}),"aria-label":"Search"},"🔍"))}static get watchers(){return{value:[{onValuePropChange:0}]}}};s.style=":host{display:block;font-family:system-ui, sans-serif}.wrap{display:flex;gap:6px}input{flex:1;padding:10px 14px;border-radius:8px;border:1px solid #ddd;font-size:14px;outline:none}input:focus{border-color:#ff6b35}button{border:none;background:#ff6b35;color:#fff;border-radius:8px;padding:0 16px;cursor:pointer;font-size:15px}";const o=class{constructor(i){e(this,i),this.filterChange=t(this,"filterChange"),this.categories=[],this.active=""}select(e){this.filterChange.emit({value:e})}render(){const e=Array.isArray(this.categories)?this.categories:[];return i("div",{key:"13bc63f39ebfc55c0f05c035b63036121f7b3930",class:"wrap"},i("button",{key:"8aeb99775268204433a8f9831eca9873066c7b9e",class:{chip:!0,active:""===this.active},onClick:()=>this.select("")},"All"),e.map((e=>i("button",{class:{chip:!0,active:this.active===e},onClick:()=>this.select(e)},e))))}};o.style=":host{display:block;font-family:system-ui, sans-serif}.wrap{display:flex;flex-wrap:wrap;gap:8px}.chip{border:1px solid #ddd;background:#fff;border-radius:999px;padding:6px 14px;font-size:13px;cursor:pointer;color:#444}.chip.active{background:#ff6b35;border-color:#ff6b35;color:#fff}";const r=class{constructor(i){e(this,i),this.ratingChange=t(this,"ratingChange"),this.value=0,this.readonly=!1,this.max=5}render(){const e=Array.from({length:this.max},((e,t)=>t+1));return i("div",{key:"1e1c67012185e7aaecfcc89671532946262a6957",class:"wrap",role:this.readonly?void 0:"radiogroup"},e.map((e=>i("span",{class:{star:!0,filled:e<=this.value,clickable:!this.readonly},onClick:()=>!this.readonly&&this.ratingChange.emit({value:e})},"★"))))}};r.style=":host{display:inline-block;font-family:system-ui, sans-serif}.wrap{display:flex;gap:2px}.star{font-size:18px;color:#ddd}.star.filled{color:#f5a623}.star.clickable{cursor:pointer}";const d=class{constructor(i){e(this,i),this.save=t(this,"save"),this.cancel=t(this,"cancel"),this.title="",this.image="",this.category="",this.ingredients=[""],this.instructions="",this.errors={},this.onSubmit=e=>{if(e.preventDefault(),!this.validate())return;const t={id:this.initialData?.id,title:this.title.trim(),image:this.image.trim(),category:this.category.trim(),ingredients:this.ingredients.map((e=>e.trim())).filter(Boolean),instructions:this.instructions.trim()};this.save.emit(t)},this.addIngredient=()=>{this.ingredients=[...this.ingredients,""]},this.removeIngredient=e=>{this.ingredients=this.ingredients.filter(((t,i)=>i!==e))}}componentWillLoad(){this.loadInitialData()}onInitialDataChange(){this.loadInitialData()}loadInitialData(){let e;if("string"==typeof this.initialData&&this.initialData)try{e=JSON.parse(this.initialData)}catch{e=void 0}else this.initialData&&"object"==typeof this.initialData&&(e=this.initialData);e&&(this.title=e.title??"",this.image=e.image??"",this.category=e.category??"",this.ingredients=e.ingredients?.length?[...e.ingredients]:[""],this.instructions=e.instructions??"")}validate(){const e={};return this.title.trim()||(e.title="Title is required."),0===this.ingredients.map((e=>e.trim())).filter(Boolean).length&&(e.ingredients="Add at least one ingredient."),this.instructions.trim()||(e.instructions="Instructions are required."),this.errors=e,0===Object.keys(e).length}updateIngredient(e,t){const i=[...this.ingredients];i[e]=t,this.ingredients=i}render(){return i("form",{key:"bb5c6c7f1b421b55515994f0256c5b39ea781632",onSubmit:this.onSubmit},i("slot",{key:"16940e4c8368aa6b546254ff8db7b28885a4409b",name:"header"}),i("label",{key:"7e3d6ba3231039ecdcca6a4c4314cf27038e1732"},"Title",i("input",{key:"f86056de021f040b8bbf3bf67a0d40ba526ad754",type:"text",value:this.title,onInput:e=>this.title=e.target.value}),this.errors.title&&i("span",{key:"54d552a15e037f54b2c6f0fd13cb4b685c25c76c",class:"error"},this.errors.title)),i("label",{key:"376da4904e7919b5540ee8dabf494f6aab053523"},"Image URL",i("input",{key:"761b64f0e5153ca0e2bf61a7db4c4106ae2f79ef",type:"text",value:this.image,onInput:e=>this.image=e.target.value})),i("label",{key:"0b7ff19b8718540b08921bb7f301be5cacf0df36"},"Category",i("input",{key:"4f1bae8316d588e93006a12e0d824579ddbece43",type:"text",value:this.category,onInput:e=>this.category=e.target.value})),i("div",{key:"280d98b91621defa547dbcc35c0cb6da55a67b5f",class:"field"},i("span",{key:"96a015e055b434441eba85dcb89470823d0ebcc8"},"Ingredients"),this.ingredients.map(((e,t)=>i("div",{class:"ingredient-row"},i("input",{type:"text",value:e,onInput:e=>this.updateIngredient(t,e.target.value)}),i("button",{type:"button",onClick:()=>this.removeIngredient(t),"aria-label":"Remove"},"✕")))),i("button",{key:"697cda22eb5bdf42e50ac40669619fbc04140405",type:"button",class:"add-btn",onClick:this.addIngredient},"+ Add ingredient"),this.errors.ingredients&&i("span",{key:"6a46c393bdd9af8e1e1255792d5532daf433f25b",class:"error"},this.errors.ingredients)),i("label",{key:"6abdbe72d381c3a0a56c46560a92b1e533fcce2a"},"Instructions",i("textarea",{key:"1d3b62d6543e42a4cd0755522f657c13e2d1e4a7",rows:5,onInput:e=>this.instructions=e.target.value},this.instructions),this.errors.instructions&&i("span",{key:"b5845bb5cd0ddd40de21f074307513d376a05f56",class:"error"},this.errors.instructions)),i("div",{key:"778adeff176e2d2b080aad59602db6e92a69ea1c",class:"footer"},i("slot",{key:"c9584d6606ed33f616eb8f3035aa4a0fd5086af3",name:"footer"}),i("button",{key:"b2e17dfb528996a1e6a8a1f8aac36b36e3b07c3a",type:"button",class:"cancel-btn",onClick:()=>this.cancel.emit()},"Cancel"),i("button",{key:"a9e91907aa44c8587a2c492f869d0cb5daa942fe",type:"submit",class:"save-btn"},"Save Recipe")))}static get watchers(){return{initialData:[{onInitialDataChange:0}]}}};d.style=":host{display:block;font-family:system-ui, sans-serif}form{display:flex;flex-direction:column;gap:14px}label{display:flex;flex-direction:column;gap:4px;font-size:13px;color:#333;font-weight:600}input,textarea{font-weight:400;padding:8px 10px;border:1px solid #ddd;border-radius:6px;font-size:14px;font-family:inherit}.field{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:600}.ingredient-row{display:flex;gap:6px}.ingredient-row input{flex:1}.ingredient-row button{border:none;background:#f4f4f4;border-radius:6px;cursor:pointer;width:30px}.add-btn{align-self:flex-start;border:1px dashed #bbb;background:none;border-radius:6px;padding:6px 10px;cursor:pointer;font-size:13px;color:#555}.error{color:#e74c3c;font-size:12px;font-weight:400}.footer{display:flex;justify-content:flex-end;gap:10px;margin-top:6px}.cancel-btn{border:1px solid #ddd;background:#fff;border-radius:8px;padding:8px 16px;cursor:pointer}.save-btn{border:none;background:#ff6b35;color:#fff;border-radius:8px;padding:8px 18px;cursor:pointer;font-weight:600}";const n=class{constructor(i){e(this,i),this.assignMeal=t(this,"assignMeal"),this.removeMeal=t(this,"removeMeal"),this.day="",this.meals=[]}render(){const e=Array.isArray(this.meals)?this.meals:[];return i("div",{key:"7a0b592fd4b8d9971d7f4912cecb5f9126be11b3",class:"day-col"},i("h3",{key:"b0f1f6a717ad409e6339219ea2f71b73d73bb1f3"},this.day),i("div",{key:"2c978721af3aad27042572dd7825d5f2b5b659fb",class:"meals"},e.map((e=>i("div",{class:"meal-chip"},e.image&&i("img",{src:e.image,alt:e.title}),i("span",{class:"title"},e.title),i("button",{onClick:()=>this.removeMeal.emit({day:this.day,mealId:e.id}),"aria-label":"Remove meal"},"✕")))),0===e.length&&i("p",{key:"326b5f3201df2416f43debc7257918a60a6ab6dd",class:"empty"},"No meals planned")),i("button",{key:"3532de633a1f6cb83bb70f91a2df8fe1a9fcbc14",class:"add-btn",onClick:()=>this.assignMeal.emit({day:this.day})},"+ Add meal"))}};n.style=":host{display:block;font-family:system-ui, sans-serif}.day-col{border:1px solid #eee;border-radius:10px;padding:10px;min-width:150px;display:flex;flex-direction:column;gap:8px;background:#fafafa}h3{margin:0;font-size:13px;text-transform:uppercase;letter-spacing:0.04em;color:#555}.meals{display:flex;flex-direction:column;gap:6px;min-height:40px}.meal-chip{display:flex;align-items:center;gap:6px;background:#fff;border:1px solid #eee;border-radius:8px;padding:4px 6px;font-size:12px}.meal-chip img{width:24px;height:24px;border-radius:4px;object-fit:cover}.meal-chip .title{flex:1}.meal-chip button{border:none;background:none;cursor:pointer;color:#999}.empty{font-size:12px;color:#aaa;margin:4px 0}.add-btn{border:1px dashed #ccc;background:none;border-radius:8px;padding:6px;font-size:12px;cursor:pointer;color:#666}";const c=class{constructor(i){e(this,i),this.close=t(this,"close"),this.open=!1,this.modalTitle=""}render(){return this.open?i("div",{class:"overlay",onClick:()=>this.close.emit()},i("div",{class:"dialog",onClick:e=>e.stopPropagation()},i("div",{class:"header"},i("h2",null,this.modalTitle),i("button",{class:"close-btn",onClick:()=>this.close.emit(),"aria-label":"Close"},"✕")),i("div",{class:"body"},i("slot",null)))):null}};c.style=":host{font-family:system-ui, sans-serif}.overlay{position:fixed;inset:0;background:rgba(0, 0, 0, 0.45);display:flex;align-items:center;justify-content:center;z-index:1000}.dialog{background:#fff;border-radius:12px;min-width:320px;max-width:90vw;max-height:85vh;overflow-y:auto;padding:20px;box-shadow:0 10px 40px rgba(0,0,0,0.2)}.header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.header h2{margin:0;font-size:18px}.close-btn{border:none;background:none;font-size:16px;cursor:pointer;color:#666}";export{c as app_modal,n as meal_plan_day,a as recipe_card,o as recipe_filter_bar,d as recipe_form,r as recipe_rating,s as recipe_search_bar}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,c as t,h as o}from"./p-CrZUP9M-.js";const a=class{constructor(o){s(this,o),this.dismiss=t(this,"dismiss"),this.message="",this.type="info",this.duration=3e3}componentDidLoad(){this.duration>0&&setTimeout((()=>this.dismiss.emit()),this.duration)}render(){return o("div",{key:"d9dcb405ffd97bfa44fee10fe49103bd021938a2",class:`toast ${this.type}`},o("span",{key:"5fd291b9766dc41189f49c11c836654d6663c8d1"},this.message),o("button",{key:"9f93921f20b17520ce339378c5a1ca66ef6a04bc",onClick:()=>this.dismiss.emit(),"aria-label":"Dismiss"},"✕"))}};a.style=":host{font-family:system-ui, sans-serif;display:block}.toast{display:flex;align-items:center;gap:10px;padding:10px 16px;border-radius:8px;color:#fff;font-size:14px;box-shadow:0 4px 12px rgba(0,0,0,0.15)}.toast.success{background:#2ecc71}.toast.error{background:#e74c3c}.toast.info{background:#3498db}button{border:none;background:none;color:inherit;cursor:pointer;margin-left:auto}";export{a as app_toast}
|