@gurpinderjitsingh/recipe-ui 0.1.0 → 0.1.2
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-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/app-modal_7.cjs.entry.js +233 -0
- package/dist/cjs/app-toast.cjs.entry.js +26 -0
- package/dist/cjs/index-CRcwY0Fb.js +1574 -0
- package/dist/cjs/index.cjs.js +16 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/recipe-ui.cjs.js +25 -0
- package/dist/collection/collection-manifest.json +20 -0
- package/dist/collection/components/app-modal/app-modal.css +12 -0
- package/dist/collection/components/app-modal/app-modal.js +87 -0
- package/dist/collection/components/app-toast/app-toast.css +9 -0
- package/dist/collection/components/app-toast/app-toast.js +111 -0
- package/dist/collection/components/meal-plan-day/meal-plan-day.css +19 -0
- package/dist/collection/components/meal-plan-day/meal-plan-day.js +111 -0
- package/dist/collection/components/recipe-card/recipe-card.css +23 -0
- package/dist/collection/components/recipe-card/recipe-card.js +149 -0
- package/dist/collection/components/recipe-filter-bar/recipe-filter-bar.css +7 -0
- package/dist/collection/components/recipe-filter-bar/recipe-filter-bar.js +92 -0
- package/dist/collection/components/recipe-form/recipe-form.css +19 -0
- package/dist/{recipe-ui/recipe-form-D_DZ8L9Q.js → collection/components/recipe-form/recipe-form.js} +105 -21
- package/dist/collection/components/recipe-rating/recipe-rating.css +5 -0
- package/dist/collection/components/recipe-rating/recipe-rating.js +107 -0
- package/dist/collection/components/recipe-search-bar/recipe-search-bar.css +11 -0
- package/dist/collection/components/recipe-search-bar/recipe-search-bar.js +140 -0
- package/dist/collection/index.js +12 -0
- package/dist/components/app-modal.js +1 -0
- package/dist/components/app-toast.js +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/meal-plan-day.js +1 -0
- package/dist/components/p-B4H61SFd.js +1 -0
- package/dist/components/p-BJJZH_Cc.js +1 -0
- package/dist/components/p-BJU3HdRm.js +1 -0
- package/dist/components/p-BRKGu69u.js +1 -0
- package/dist/components/p-BZBToMAv.js +1 -0
- package/dist/components/p-BekLK-Pb.js +1 -0
- package/dist/components/p-COHQTgKC.js +1 -0
- package/dist/components/p-DsyQvPDo.js +1 -0
- package/dist/components/p-kbrkhGSm.js +1 -0
- package/dist/components/recipe-card.js +1 -0
- package/dist/components/recipe-filter-bar.js +1 -0
- package/dist/components/recipe-form.js +1 -0
- package/dist/components/recipe-rating.js +1 -0
- package/dist/components/recipe-search-bar.js +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/app-modal_7.entry.js +225 -0
- package/dist/{recipe-ui/app-toast-DjuZTKj8.js → esm/app-toast.entry.js} +3 -6
- package/dist/esm/index-CrZUP9M-.js +1567 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/recipe-ui.js +21 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/recipe-ui/index.esm.js +1 -17
- package/dist/recipe-ui/p-6ef28048.entry.js +1 -0
- package/dist/recipe-ui/p-CrZUP9M-.js +3 -0
- package/dist/recipe-ui/p-DQuL1Twl.js +1 -0
- package/dist/recipe-ui/p-e2f3c9b9.entry.js +1 -0
- package/dist/recipe-ui/recipe-ui.esm.js +1 -50
- package/package.json +1 -1
- package/dist/recipe-ui/app-modal-BL_aVG1A.js +0 -23
- package/dist/recipe-ui/app-modal-BL_aVG1A.js.map +0 -1
- package/dist/recipe-ui/app-modal.entry.js +0 -5
- package/dist/recipe-ui/app-modal.entry.js.map +0 -1
- package/dist/recipe-ui/app-toast-DjuZTKj8.js.map +0 -1
- package/dist/recipe-ui/app-toast.entry.js +0 -5
- package/dist/recipe-ui/app-toast.entry.js.map +0 -1
- package/dist/recipe-ui/index-DV5P9Jd8.js +0 -4656
- package/dist/recipe-ui/index-DV5P9Jd8.js.map +0 -1
- package/dist/recipe-ui/index.esm.js.map +0 -1
- package/dist/recipe-ui/meal-plan-day-9rmKiM44.js +0 -23
- package/dist/recipe-ui/meal-plan-day-9rmKiM44.js.map +0 -1
- package/dist/recipe-ui/meal-plan-day.entry.js +0 -5
- package/dist/recipe-ui/meal-plan-day.entry.js.map +0 -1
- package/dist/recipe-ui/recipe-card-91fhJAz5.js +0 -28
- package/dist/recipe-ui/recipe-card-91fhJAz5.js.map +0 -1
- package/dist/recipe-ui/recipe-card.entry.js +0 -5
- package/dist/recipe-ui/recipe-card.entry.js.map +0 -1
- package/dist/recipe-ui/recipe-filter-bar-DV-B7Ybe.js +0 -25
- package/dist/recipe-ui/recipe-filter-bar-DV-B7Ybe.js.map +0 -1
- package/dist/recipe-ui/recipe-filter-bar.entry.js +0 -5
- package/dist/recipe-ui/recipe-filter-bar.entry.js.map +0 -1
- package/dist/recipe-ui/recipe-form-D_DZ8L9Q.js.map +0 -1
- package/dist/recipe-ui/recipe-form.entry.js +0 -5
- package/dist/recipe-ui/recipe-form.entry.js.map +0 -1
- package/dist/recipe-ui/recipe-rating-BZDgwNdK.js +0 -23
- package/dist/recipe-ui/recipe-rating-BZDgwNdK.js.map +0 -1
- package/dist/recipe-ui/recipe-rating.entry.js +0 -5
- package/dist/recipe-ui/recipe-rating.entry.js.map +0 -1
- package/dist/recipe-ui/recipe-search-bar-BVbznAHF.js +0 -47
- package/dist/recipe-ui/recipe-search-bar-BVbznAHF.js.map +0 -1
- package/dist/recipe-ui/recipe-search-bar.entry.js +0 -5
- package/dist/recipe-ui/recipe-search-bar.entry.js.map +0 -1
- package/dist/recipe-ui/recipe-ui.esm.js.map +0 -1
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CRcwY0Fb.js');
|
|
4
|
+
|
|
5
|
+
const recipeCardCss = () => `: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}`;
|
|
6
|
+
|
|
7
|
+
const RecipeCard = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.favoriteToggle = index.createEvent(this, "favoriteToggle");
|
|
11
|
+
this.cardClick = index.createEvent(this, "cardClick");
|
|
12
|
+
/** Category / cuisine label */
|
|
13
|
+
this.category = '';
|
|
14
|
+
/** Whether this recipe is currently favorited */
|
|
15
|
+
this.favorite = false;
|
|
16
|
+
this.onFavoriteClick = (e) => {
|
|
17
|
+
e.stopPropagation();
|
|
18
|
+
this.favoriteToggle.emit({ favorite: !this.favorite });
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return (index.h("div", { key: 'abd19b1d63409b52cf66f348131f5f6f77bb47a6', class: "card", onClick: () => this.cardClick.emit() }, index.h("div", { key: '1292c3f6dfe7d3b399943004f764c41a3d072188', class: "image-wrap" }, this.image ? index.h("img", { src: this.image, alt: this.recipeTitle }) : index.h("div", { class: "placeholder" }), index.h("button", { key: '0efdc01af349d011ca0e11c4df5438b79876b467', class: { 'fav-btn': true, active: this.favorite }, onClick: this.onFavoriteClick, "aria-label": "Toggle favorite" }, this.favorite ? '★' : '☆')), index.h("div", { key: '66c2c4d845d9cc082c07f24f5d827313f6ad51c4', class: "body" }, index.h("h3", { key: '779fc629c3b97b6158f99440d9bb17fafb708dd3' }, this.recipeTitle), this.category && index.h("span", { key: '259ec599a43a5c8a279ad5993ba36f8602125b76', class: "category" }, this.category), index.h("div", { key: '58ab20f9682b4b73b7d027571496641cbfa76d0b', class: "actions" }, index.h("slot", { key: '28103422d993e58b133c2350e37c06fddf24300f', name: "actions" })))));
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
RecipeCard.style = recipeCardCss();
|
|
26
|
+
|
|
27
|
+
const recipeSearchBarCss = () => `: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}`;
|
|
28
|
+
|
|
29
|
+
const RecipeSearchBar = class {
|
|
30
|
+
constructor(hostRef) {
|
|
31
|
+
index.registerInstance(this, hostRef);
|
|
32
|
+
this.search = index.createEvent(this, "search");
|
|
33
|
+
this.placeholder = 'Search recipes...';
|
|
34
|
+
this.value = '';
|
|
35
|
+
this.debounceMs = 350;
|
|
36
|
+
this.internalValue = '';
|
|
37
|
+
this.onInput = (e) => {
|
|
38
|
+
this.internalValue = e.target.value;
|
|
39
|
+
clearTimeout(this.timer);
|
|
40
|
+
this.timer = setTimeout(() => {
|
|
41
|
+
this.search.emit({ value: this.internalValue });
|
|
42
|
+
}, this.debounceMs);
|
|
43
|
+
};
|
|
44
|
+
this.onKeyDown = (e) => {
|
|
45
|
+
if (e.key === 'Enter') {
|
|
46
|
+
clearTimeout(this.timer);
|
|
47
|
+
this.search.emit({ value: this.internalValue });
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
componentWillLoad() {
|
|
52
|
+
this.internalValue = this.value;
|
|
53
|
+
}
|
|
54
|
+
onValuePropChange(newVal) {
|
|
55
|
+
this.internalValue = newVal;
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
return (index.h("div", { key: 'fe5eb2928308fb2496badd784e684b19df52501a', class: "wrap" }, index.h("input", { key: '3d4abb23a1155075a8889e015819b37a8569f6f5', type: "search", placeholder: this.placeholder, value: this.internalValue, onInput: this.onInput, onKeyDown: this.onKeyDown }), index.h("button", { key: 'f33f95b5bfcad9146903a2eb4448932a1d68edb7', onClick: () => this.search.emit({ value: this.internalValue }), "aria-label": "Search" }, "\uD83D\uDD0D")));
|
|
59
|
+
}
|
|
60
|
+
static get watchers() { return {
|
|
61
|
+
"value": [{
|
|
62
|
+
"onValuePropChange": 0
|
|
63
|
+
}]
|
|
64
|
+
}; }
|
|
65
|
+
};
|
|
66
|
+
RecipeSearchBar.style = recipeSearchBarCss();
|
|
67
|
+
|
|
68
|
+
const recipeFilterBarCss = () => `: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}`;
|
|
69
|
+
|
|
70
|
+
const RecipeFilterBar = class {
|
|
71
|
+
constructor(hostRef) {
|
|
72
|
+
index.registerInstance(this, hostRef);
|
|
73
|
+
this.filterChange = index.createEvent(this, "filterChange");
|
|
74
|
+
this.categories = [];
|
|
75
|
+
this.active = '';
|
|
76
|
+
}
|
|
77
|
+
select(value) {
|
|
78
|
+
this.filterChange.emit({ value });
|
|
79
|
+
}
|
|
80
|
+
render() {
|
|
81
|
+
const cats = Array.isArray(this.categories) ? this.categories : [];
|
|
82
|
+
return (index.h("div", { key: '13bc63f39ebfc55c0f05c035b63036121f7b3930', class: "wrap" }, index.h("button", { key: '8aeb99775268204433a8f9831eca9873066c7b9e', 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
|
+
}
|
|
84
|
+
};
|
|
85
|
+
RecipeFilterBar.style = recipeFilterBarCss();
|
|
86
|
+
|
|
87
|
+
const recipeRatingCss = () => `: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}`;
|
|
88
|
+
|
|
89
|
+
const RecipeRating = class {
|
|
90
|
+
constructor(hostRef) {
|
|
91
|
+
index.registerInstance(this, hostRef);
|
|
92
|
+
this.ratingChange = index.createEvent(this, "ratingChange");
|
|
93
|
+
this.value = 0;
|
|
94
|
+
this.readonly = false;
|
|
95
|
+
this.max = 5;
|
|
96
|
+
}
|
|
97
|
+
render() {
|
|
98
|
+
const stars = Array.from({ length: this.max }, (_, i) => i + 1);
|
|
99
|
+
return (index.h("div", { key: '1e1c67012185e7aaecfcc89671532946262a6957', 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
|
+
}
|
|
101
|
+
};
|
|
102
|
+
RecipeRating.style = recipeRatingCss();
|
|
103
|
+
|
|
104
|
+
const recipeFormCss = () => `: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}`;
|
|
105
|
+
|
|
106
|
+
const RecipeForm = class {
|
|
107
|
+
constructor(hostRef) {
|
|
108
|
+
index.registerInstance(this, hostRef);
|
|
109
|
+
this.save = index.createEvent(this, "save");
|
|
110
|
+
this.cancel = index.createEvent(this, "cancel");
|
|
111
|
+
this.title = '';
|
|
112
|
+
this.image = '';
|
|
113
|
+
this.category = '';
|
|
114
|
+
this.ingredients = [''];
|
|
115
|
+
this.instructions = '';
|
|
116
|
+
this.errors = {};
|
|
117
|
+
this.onSubmit = (e) => {
|
|
118
|
+
e.preventDefault();
|
|
119
|
+
if (!this.validate())
|
|
120
|
+
return;
|
|
121
|
+
const data = {
|
|
122
|
+
id: this.initialData?.id,
|
|
123
|
+
title: this.title.trim(),
|
|
124
|
+
image: this.image.trim(),
|
|
125
|
+
category: this.category.trim(),
|
|
126
|
+
ingredients: this.ingredients.map((i) => i.trim()).filter(Boolean),
|
|
127
|
+
instructions: this.instructions.trim(),
|
|
128
|
+
};
|
|
129
|
+
this.save.emit(data);
|
|
130
|
+
};
|
|
131
|
+
this.addIngredient = () => {
|
|
132
|
+
this.ingredients = [...this.ingredients, ''];
|
|
133
|
+
};
|
|
134
|
+
this.removeIngredient = (index) => {
|
|
135
|
+
this.ingredients = this.ingredients.filter((_, i) => i !== index);
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
componentWillLoad() {
|
|
139
|
+
this.loadInitialData();
|
|
140
|
+
}
|
|
141
|
+
onInitialDataChange() {
|
|
142
|
+
this.loadInitialData();
|
|
143
|
+
}
|
|
144
|
+
loadInitialData() {
|
|
145
|
+
let data;
|
|
146
|
+
if (typeof this.initialData === 'string' && this.initialData) {
|
|
147
|
+
try {
|
|
148
|
+
data = JSON.parse(this.initialData);
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
data = undefined;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
else if (this.initialData && typeof this.initialData === 'object') {
|
|
155
|
+
data = this.initialData;
|
|
156
|
+
}
|
|
157
|
+
if (data) {
|
|
158
|
+
this.title = data.title ?? '';
|
|
159
|
+
this.image = data.image ?? '';
|
|
160
|
+
this.category = data.category ?? '';
|
|
161
|
+
this.ingredients = data.ingredients?.length ? [...data.ingredients] : [''];
|
|
162
|
+
this.instructions = data.instructions ?? '';
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
validate() {
|
|
166
|
+
const errors = {};
|
|
167
|
+
if (!this.title.trim())
|
|
168
|
+
errors.title = 'Title is required.';
|
|
169
|
+
const cleanIngredients = this.ingredients.map((i) => i.trim()).filter(Boolean);
|
|
170
|
+
if (cleanIngredients.length === 0)
|
|
171
|
+
errors.ingredients = 'Add at least one ingredient.';
|
|
172
|
+
if (!this.instructions.trim())
|
|
173
|
+
errors.instructions = 'Instructions are required.';
|
|
174
|
+
this.errors = errors;
|
|
175
|
+
return Object.keys(errors).length === 0;
|
|
176
|
+
}
|
|
177
|
+
updateIngredient(index, value) {
|
|
178
|
+
const next = [...this.ingredients];
|
|
179
|
+
next[index] = value;
|
|
180
|
+
this.ingredients = next;
|
|
181
|
+
}
|
|
182
|
+
render() {
|
|
183
|
+
return (index.h("form", { key: 'bb5c6c7f1b421b55515994f0256c5b39ea781632', onSubmit: this.onSubmit }, index.h("slot", { key: '16940e4c8368aa6b546254ff8db7b28885a4409b', name: "header" }), index.h("label", { key: '7e3d6ba3231039ecdcca6a4c4314cf27038e1732' }, "Title", index.h("input", { key: 'f86056de021f040b8bbf3bf67a0d40ba526ad754', type: "text", value: this.title, onInput: (e) => (this.title = e.target.value) }), this.errors.title && index.h("span", { key: '54d552a15e037f54b2c6f0fd13cb4b685c25c76c', class: "error" }, this.errors.title)), index.h("label", { key: '376da4904e7919b5540ee8dabf494f6aab053523' }, "Image URL", index.h("input", { key: '761b64f0e5153ca0e2bf61a7db4c4106ae2f79ef', type: "text", value: this.image, onInput: (e) => (this.image = e.target.value) })), index.h("label", { key: '0b7ff19b8718540b08921bb7f301be5cacf0df36' }, "Category", index.h("input", { key: '4f1bae8316d588e93006a12e0d824579ddbece43', type: "text", value: this.category, onInput: (e) => (this.category = e.target.value) })), index.h("div", { key: '280d98b91621defa547dbcc35c0cb6da55a67b5f', class: "field" }, index.h("span", { key: '96a015e055b434441eba85dcb89470823d0ebcc8' }, "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: '697cda22eb5bdf42e50ac40669619fbc04140405', type: "button", class: "add-btn", onClick: this.addIngredient }, "+ Add ingredient"), this.errors.ingredients && index.h("span", { key: '6a46c393bdd9af8e1e1255792d5532daf433f25b', class: "error" }, this.errors.ingredients)), index.h("label", { key: '6abdbe72d381c3a0a56c46560a92b1e533fcce2a' }, "Instructions", index.h("textarea", { key: '1d3b62d6543e42a4cd0755522f657c13e2d1e4a7', rows: 5, onInput: (e) => (this.instructions = e.target.value) }, this.instructions), this.errors.instructions && index.h("span", { key: 'b5845bb5cd0ddd40de21f074307513d376a05f56', class: "error" }, this.errors.instructions)), index.h("div", { key: '778adeff176e2d2b080aad59602db6e92a69ea1c', class: "footer" }, index.h("slot", { key: 'c9584d6606ed33f616eb8f3035aa4a0fd5086af3', name: "footer" }), index.h("button", { key: 'b2e17dfb528996a1e6a8a1f8aac36b36e3b07c3a', type: "button", class: "cancel-btn", onClick: () => this.cancel.emit() }, "Cancel"), index.h("button", { key: 'a9e91907aa44c8587a2c492f869d0cb5daa942fe', type: "submit", class: "save-btn" }, "Save Recipe"))));
|
|
184
|
+
}
|
|
185
|
+
static get watchers() { return {
|
|
186
|
+
"initialData": [{
|
|
187
|
+
"onInitialDataChange": 0
|
|
188
|
+
}]
|
|
189
|
+
}; }
|
|
190
|
+
};
|
|
191
|
+
RecipeForm.style = recipeFormCss();
|
|
192
|
+
|
|
193
|
+
const mealPlanDayCss = () => `: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}`;
|
|
194
|
+
|
|
195
|
+
const MealPlanDay = class {
|
|
196
|
+
constructor(hostRef) {
|
|
197
|
+
index.registerInstance(this, hostRef);
|
|
198
|
+
this.assignMeal = index.createEvent(this, "assignMeal");
|
|
199
|
+
this.removeMeal = index.createEvent(this, "removeMeal");
|
|
200
|
+
this.day = '';
|
|
201
|
+
this.meals = [];
|
|
202
|
+
}
|
|
203
|
+
render() {
|
|
204
|
+
const meals = Array.isArray(this.meals) ? this.meals : [];
|
|
205
|
+
return (index.h("div", { key: '7a0b592fd4b8d9971d7f4912cecb5f9126be11b3', class: "day-col" }, index.h("h3", { key: 'b0f1f6a717ad409e6339219ea2f71b73d73bb1f3' }, this.day), index.h("div", { key: '2c978721af3aad27042572dd7825d5f2b5b659fb', class: "meals" }, meals.map((m) => (index.h("div", { class: "meal-chip" }, m.image && index.h("img", { src: m.image, alt: m.title }), index.h("span", { class: "title" }, m.title), index.h("button", { onClick: () => this.removeMeal.emit({ day: this.day, mealId: m.id }), "aria-label": "Remove meal" }, "\u2715")))), meals.length === 0 && index.h("p", { key: '326b5f3201df2416f43debc7257918a60a6ab6dd', class: "empty" }, "No meals planned")), index.h("button", { key: '3532de633a1f6cb83bb70f91a2df8fe1a9fcbc14', class: "add-btn", onClick: () => this.assignMeal.emit({ day: this.day }) }, "+ Add meal")));
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
MealPlanDay.style = mealPlanDayCss();
|
|
209
|
+
|
|
210
|
+
const appModalCss = () => `: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}`;
|
|
211
|
+
|
|
212
|
+
const AppModal = class {
|
|
213
|
+
constructor(hostRef) {
|
|
214
|
+
index.registerInstance(this, hostRef);
|
|
215
|
+
this.close = index.createEvent(this, "close");
|
|
216
|
+
this.open = false;
|
|
217
|
+
this.modalTitle = '';
|
|
218
|
+
}
|
|
219
|
+
render() {
|
|
220
|
+
if (!this.open)
|
|
221
|
+
return null;
|
|
222
|
+
return (index.h("div", { class: "dialog", onClick: (e) => e.stopPropagation() }, index.h("div", { class: "header" }, index.h("h2", null, this.modalTitle), index.h("button", { class: "close-btn", onClick: () => this.close.emit(), "aria-label": "Close" }, "\u2715")), index.h("div", { class: "body" }, index.h("slot", null))));
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
AppModal.style = appModalCss();
|
|
226
|
+
|
|
227
|
+
exports.app_modal = AppModal;
|
|
228
|
+
exports.meal_plan_day = MealPlanDay;
|
|
229
|
+
exports.recipe_card = RecipeCard;
|
|
230
|
+
exports.recipe_filter_bar = RecipeFilterBar;
|
|
231
|
+
exports.recipe_form = RecipeForm;
|
|
232
|
+
exports.recipe_rating = RecipeRating;
|
|
233
|
+
exports.recipe_search_bar = RecipeSearchBar;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CRcwY0Fb.js');
|
|
4
|
+
|
|
5
|
+
const appToastCss = () => `: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}`;
|
|
6
|
+
|
|
7
|
+
const AppToast = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.dismiss = index.createEvent(this, "dismiss");
|
|
11
|
+
this.message = '';
|
|
12
|
+
this.type = 'info';
|
|
13
|
+
this.duration = 3000;
|
|
14
|
+
}
|
|
15
|
+
componentDidLoad() {
|
|
16
|
+
if (this.duration > 0) {
|
|
17
|
+
setTimeout(() => this.dismiss.emit(), this.duration);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
return (index.h("div", { key: 'd9dcb405ffd97bfa44fee10fe49103bd021938a2', class: `toast ${this.type}` }, index.h("span", { key: '5fd291b9766dc41189f49c11c836654d6663c8d1' }, this.message), index.h("button", { key: '9f93921f20b17520ce339378c5a1ca66ef6a04bc', onClick: () => this.dismiss.emit(), "aria-label": "Dismiss" }, "\u2715")));
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
AppToast.style = appToastCss();
|
|
25
|
+
|
|
26
|
+
exports.app_toast = AppToast;
|