@gurpinderjitsingh/recipe-ui 0.2.0 → 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.
Files changed (31) hide show
  1. package/dist/cjs/app-modal_7.cjs.entry.js +7 -5
  2. package/dist/cjs/app-toast.cjs.entry.js +1 -1
  3. package/dist/collection/components/app-toast/app-toast.js +1 -1
  4. package/dist/collection/components/recipe-card/recipe-card.js +1 -1
  5. package/dist/collection/components/recipe-filter-bar/recipe-filter-bar.js +1 -1
  6. package/dist/collection/components/recipe-form/recipe-form.js +3 -1
  7. package/dist/collection/components/recipe-rating/recipe-rating.js +1 -1
  8. package/dist/collection/components/recipe-search-bar/recipe-search-bar.js +1 -1
  9. package/dist/components/app-toast.js +1 -1
  10. package/dist/components/index.js +1 -1
  11. package/dist/components/p-CN2vLHNY.js +1 -0
  12. package/dist/components/{p-BUu-OE2n.js → p-DrDPFXTB.js} +1 -1
  13. package/dist/components/{p-Bj2iIXUo.js → p-Q8V4JgYC.js} +1 -1
  14. package/dist/components/{p-Xf30T5IO.js → p-fNGqqs-I.js} +1 -1
  15. package/dist/components/p-gWE9Vqi0.js +1 -0
  16. package/dist/components/{p-Bi4G3e9f.js → p-snMSuFkY.js} +1 -1
  17. package/dist/components/recipe-card.js +1 -1
  18. package/dist/components/recipe-filter-bar.js +1 -1
  19. package/dist/components/recipe-form.js +1 -1
  20. package/dist/components/recipe-rating.js +1 -1
  21. package/dist/components/recipe-search-bar.js +1 -1
  22. package/dist/esm/app-modal_7.entry.js +7 -5
  23. package/dist/esm/app-toast.entry.js +1 -1
  24. package/dist/recipe-ui/p-268be6b1.entry.js +1 -0
  25. package/dist/recipe-ui/p-97e73b62.entry.js +1 -0
  26. package/dist/recipe-ui/recipe-ui.esm.js +1 -1
  27. package/package.json +1 -1
  28. package/dist/components/p-BqnbT3UL.js +0 -1
  29. package/dist/components/p-DXdnWxeM.js +0 -1
  30. package/dist/recipe-ui/p-531fb6c4.entry.js +0 -1
  31. package/dist/recipe-ui/p-a8cd146e.entry.js +0 -1
@@ -19,7 +19,7 @@ const RecipeCard = class {
19
19
  };
20
20
  }
21
21
  render() {
22
- return (index.h("div", { key: 'ab4f6e822f8b961d15c49d488af4e9b617ae71d2', class: "card", onClick: () => this.cardClick.emit() }, index.h("div", { key: 'f57fc00e484283bd223f7e8557af7e76de33217e', class: "image-wrap" }, this.image ? index.h("img", { src: this.image, alt: this.recipeTitle }) : index.h("div", { class: "placeholder" }), index.h("button", { key: '2f05b10aa6de8f6d51e0a216567a65900011a198', class: { 'fav-btn': true, active: this.favorite }, onClick: this.onFavoriteClick, "aria-label": "Toggle favorite" }, this.favorite ? '★' : '☆')), index.h("div", { key: 'bb120c622bef2e7ae8abfedf31ba988a66d393c3', class: "body" }, index.h("h3", { key: '2b0115c0ae28b302e35a00e0ed1a70d0b20712ab' }, this.recipeTitle), this.category && index.h("span", { key: '388a88c469547f04e7af2b1da0d303a28f499481', class: "category" }, this.category), index.h("div", { key: 'ff8e56f5a2ce08736ec9cef2a17bbcc2aad4b946', class: "actions" }, index.h("slot", { key: '8952391cb6163493dc5ab27b690c4375ef535ac4', name: "actions" })))));
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: 'eb622258d322ed13168a4e4da4f6fecc67c5e3ea', class: "wrap" }, index.h("input", { key: '5594cf8585234e21e4529a069ad9621631c9e103', type: "search", placeholder: this.placeholder, value: this.internalValue, onInput: this.onInput, onKeyDown: this.onKeyDown }), index.h("button", { key: '7540e7232d5071a65360c8196deda3461bfa8308', onClick: () => this.search.emit({ value: this.internalValue }), "aria-label": "Search" }, "\uD83D\uDD0D")));
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: '084a1e0d79a1916d07277e1c080ff779aba1aa79', class: "wrap" }, index.h("button", { key: 'f0b9b529d1dca7f98621404b174837b5b21163e7', 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)))));
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: '19cb1bd17a6dc207c7e556ae026a4f343a784f50', 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")))));
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: '6699f62ff8027114e5a0e3d154f8743048cf4d96', onSubmit: this.onSubmit }, index.h("slot", { key: '8de0f7e758feb4fc6f1ea877c4acd7c41cbe13ed', name: "header" }), index.h("label", { key: '881275928734c4eabfee6d22b35cddad1af03853' }, "Title", index.h("input", { key: 'a55ae352c35cec0b2391061d48153151a7dc5e6b', type: "text", value: this.title, onInput: (e) => (this.title = e.target.value) }), this.errors.title && index.h("span", { key: 'dbace66ddaab5ab5096acb39822c7cd3a18923be', class: "error" }, this.errors.title)), index.h("label", { key: 'ae1bcdb323ccaa03307b6a283fcc395ef49954c5' }, "Image URL", index.h("input", { key: '6ee9483689e0304c0ae28ab755dc93e117d4952e', type: "text", value: this.image, onInput: (e) => (this.image = e.target.value) })), index.h("label", { key: '751b54959a8e2c85e98f2b192a4d8aa83d8ebafe' }, "Category", index.h("input", { key: '83f852c74727b86a1a8a6c9a0d93e9ffdb3f33f3', type: "text", value: this.category, onInput: (e) => (this.category = e.target.value) })), index.h("div", { key: '6a7c99a86d601ed51ece26c85b4b45766a2dafdf', class: "field" }, index.h("span", { key: 'ee082917bb3b90ec45ce1feea234c374f7fc35a0' }, "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: '4f81107c94bf8810dfc14aa58d5afcf55d8e126d', type: "button", class: "add-btn", onClick: this.addIngredient }, "+ Add ingredient"), this.errors.ingredients && index.h("span", { key: 'd87cc375b194c187b64def1ef9840797dab1d456', class: "error" }, this.errors.ingredients)), index.h("label", { key: 'dc6c04a5a2b5cc7d1912f535b8904125ce74af56' }, "Instructions", index.h("textarea", { key: '0c9c4b09da5b3f24addb66c18fccad7c900bebcb', rows: 5, onInput: (e) => (this.instructions = e.target.value) }, this.instructions), this.errors.instructions && index.h("span", { key: 'f430772f46e5298b2a2522aaef2822a59df61a08', class: "error" }, this.errors.instructions)), index.h("div", { key: '337abce7c4f93a9fbb90917e6b407dfb5b95039d', class: "footer" }, index.h("slot", { key: 'b8b610485f592592afb6cef682faeb13d52da6ea', name: "footer" }), index.h("button", { key: 'faf249c9be390b5d574300d0ff24bcd0c5603a3c', type: "button", class: "cancel-btn", onClick: () => this.cancel.emit() }, "Cancel"), index.h("button", { key: '527146d147778940c28e5357c100d1809cbcd6df', type: "submit", class: "save-btn" }, "Save Recipe"))));
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": [{
@@ -18,7 +18,7 @@ const AppToast = class {
18
18
  }
19
19
  }
20
20
  render() {
21
- return (index.h("div", { key: '73ab8ea44ad155052616ffbc424e1d8f13b8116f', class: `toast ${this.type}` }, index.h("span", { key: '301487550c2f4f50cdcc6d0a138b9e968cde385f' }, this.message), index.h("button", { key: '4e9de348002a397a25450142d9fa1fa07ca84d54', onClick: () => this.dismiss.emit(), "aria-label": "Dismiss" }, "\u2715")));
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();
@@ -12,7 +12,7 @@ export class AppToast {
12
12
  }
13
13
  }
14
14
  render() {
15
- return (h("div", { key: '73ab8ea44ad155052616ffbc424e1d8f13b8116f', class: `toast ${this.type}` }, h("span", { key: '301487550c2f4f50cdcc6d0a138b9e968cde385f' }, this.message), h("button", { key: '4e9de348002a397a25450142d9fa1fa07ca84d54', onClick: () => this.dismiss.emit(), "aria-label": "Dismiss" }, "\u2715")));
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"; }
@@ -17,7 +17,7 @@ export class RecipeCard {
17
17
  };
18
18
  }
19
19
  render() {
20
- return (h("div", { key: 'ab4f6e822f8b961d15c49d488af4e9b617ae71d2', class: "card", onClick: () => this.cardClick.emit() }, h("div", { key: 'f57fc00e484283bd223f7e8557af7e76de33217e', class: "image-wrap" }, this.image ? h("img", { src: this.image, alt: this.recipeTitle }) : h("div", { class: "placeholder" }), h("button", { key: '2f05b10aa6de8f6d51e0a216567a65900011a198', class: { 'fav-btn': true, active: this.favorite }, onClick: this.onFavoriteClick, "aria-label": "Toggle favorite" }, this.favorite ? '★' : '☆')), h("div", { key: 'bb120c622bef2e7ae8abfedf31ba988a66d393c3', class: "body" }, h("h3", { key: '2b0115c0ae28b302e35a00e0ed1a70d0b20712ab' }, this.recipeTitle), this.category && h("span", { key: '388a88c469547f04e7af2b1da0d303a28f499481', class: "category" }, this.category), h("div", { key: 'ff8e56f5a2ce08736ec9cef2a17bbcc2aad4b946', class: "actions" }, h("slot", { key: '8952391cb6163493dc5ab27b690c4375ef535ac4', name: "actions" })))));
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: '084a1e0d79a1916d07277e1c080ff779aba1aa79', class: "wrap" }, h("button", { key: 'f0b9b529d1dca7f98621404b174837b5b21163e7', 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)))));
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: '6699f62ff8027114e5a0e3d154f8743048cf4d96', onSubmit: this.onSubmit }, h("slot", { key: '8de0f7e758feb4fc6f1ea877c4acd7c41cbe13ed', name: "header" }), h("label", { key: '881275928734c4eabfee6d22b35cddad1af03853' }, "Title", h("input", { key: 'a55ae352c35cec0b2391061d48153151a7dc5e6b', type: "text", value: this.title, onInput: (e) => (this.title = e.target.value) }), this.errors.title && h("span", { key: 'dbace66ddaab5ab5096acb39822c7cd3a18923be', class: "error" }, this.errors.title)), h("label", { key: 'ae1bcdb323ccaa03307b6a283fcc395ef49954c5' }, "Image URL", h("input", { key: '6ee9483689e0304c0ae28ab755dc93e117d4952e', type: "text", value: this.image, onInput: (e) => (this.image = e.target.value) })), h("label", { key: '751b54959a8e2c85e98f2b192a4d8aa83d8ebafe' }, "Category", h("input", { key: '83f852c74727b86a1a8a6c9a0d93e9ffdb3f33f3', type: "text", value: this.category, onInput: (e) => (this.category = e.target.value) })), h("div", { key: '6a7c99a86d601ed51ece26c85b4b45766a2dafdf', class: "field" }, h("span", { key: 'ee082917bb3b90ec45ce1feea234c374f7fc35a0' }, "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: '4f81107c94bf8810dfc14aa58d5afcf55d8e126d', type: "button", class: "add-btn", onClick: this.addIngredient }, "+ Add ingredient"), this.errors.ingredients && h("span", { key: 'd87cc375b194c187b64def1ef9840797dab1d456', class: "error" }, this.errors.ingredients)), h("label", { key: 'dc6c04a5a2b5cc7d1912f535b8904125ce74af56' }, "Instructions", h("textarea", { key: '0c9c4b09da5b3f24addb66c18fccad7c900bebcb', rows: 5, onInput: (e) => (this.instructions = e.target.value) }, this.instructions), this.errors.instructions && h("span", { key: 'f430772f46e5298b2a2522aaef2822a59df61a08', class: "error" }, this.errors.instructions)), h("div", { key: '337abce7c4f93a9fbb90917e6b407dfb5b95039d', class: "footer" }, h("slot", { key: 'b8b610485f592592afb6cef682faeb13d52da6ea', name: "footer" }), h("button", { key: 'faf249c9be390b5d574300d0ff24bcd0c5603a3c', type: "button", class: "cancel-btn", onClick: () => this.cancel.emit() }, "Cancel"), h("button", { key: '527146d147778940c28e5357c100d1809cbcd6df', type: "submit", class: "save-btn" }, "Save Recipe"))));
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: '19cb1bd17a6dc207c7e556ae026a4f343a784f50', 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")))));
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: 'eb622258d322ed13168a4e4da4f6fecc67c5e3ea', class: "wrap" }, h("input", { key: '5594cf8585234e21e4529a069ad9621631c9e103', type: "search", placeholder: this.placeholder, value: this.internalValue, onInput: this.onInput, onKeyDown: this.onKeyDown }), h("button", { key: '7540e7232d5071a65360c8196deda3461bfa8308', onClick: () => this.search.emit({ value: this.internalValue }), "aria-label": "Search" }, "\uD83D\uDD0D")));
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-Bj2iIXUo.js";const p=o,r=s;export{p as AppToast,r as defineCustomElement}
1
+ import{A as o,d as s}from"./p-Q8V4JgYC.js";const p=o,r=s;export{p as AppToast,r as defineCustomElement}
@@ -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-Bi4G3e9f.js";export{R as RecipeSearchBar}from"./p-Xf30T5IO.js";export{R as RecipeFilterBar}from"./p-BqnbT3UL.js";export{R as RecipeRating}from"./p-BUu-OE2n.js";export{R as RecipeForm}from"./p-DXdnWxeM.js";export{M as MealPlanDay}from"./p-S4266va_.js";export{A as AppModal}from"./p-Dp1sKtrN.js";export{A as AppToast}from"./p-Bj2iIXUo.js";
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";
@@ -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:"19cb1bd17a6dc207c7e556ae026a4f343a784f50",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
+ 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 e,c as a,h as o}from"./p-BJU3HdRm.js";const i=t(class extends e{constructor(s){super(),!1!==s&&this.__registerHost(),this.__attachShadow(),this.dismiss=a(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:"73ab8ea44ad155052616ffbc424e1d8f13b8116f",class:`toast ${this.type}`},o("span",{key:"301487550c2f4f50cdcc6d0a138b9e968cde385f"},this.message),o("button",{key:"4e9de348002a397a25450142d9fa1fa07ca84d54",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}
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}
@@ -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:"eb622258d322ed13168a4e4da4f6fecc67c5e3ea",class:"wrap"},i("input",{key:"5594cf8585234e21e4529a069ad9621631c9e103",type:"search",placeholder:this.placeholder,value:this.internalValue,onInput:this.onInput,onKeyDown:this.onKeyDown}),i("button",{key:"7540e7232d5071a65360c8196deda3461bfa8308",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
+ 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}
@@ -0,0 +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:"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 a,H as t,c as i,h as s}from"./p-BJU3HdRm.js";const r=a(class extends t{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:"ab4f6e822f8b961d15c49d488af4e9b617ae71d2",class:"card",onClick:()=>this.cardClick.emit()},s("div",{key:"f57fc00e484283bd223f7e8557af7e76de33217e",class:"image-wrap"},this.image?s("img",{src:this.image,alt:this.recipeTitle}):s("div",{class:"placeholder"}),s("button",{key:"2f05b10aa6de8f6d51e0a216567a65900011a198",class:{"fav-btn":!0,active:this.favorite},onClick:this.onFavoriteClick,"aria-label":"Toggle favorite"},this.favorite?"★":"☆")),s("div",{key:"bb120c622bef2e7ae8abfedf31ba988a66d393c3",class:"body"},s("h3",{key:"2b0115c0ae28b302e35a00e0ed1a70d0b20712ab"},this.recipeTitle),this.category&&s("span",{key:"388a88c469547f04e7af2b1da0d303a28f499481",class:"category"},this.category),s("div",{key:"ff8e56f5a2ce08736ec9cef2a17bbcc2aad4b946",class:"actions"},s("slot",{key:"8952391cb6163493dc5ab27b690c4375ef535ac4",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 o(){"undefined"!=typeof customElements&&["recipe-card"].forEach((a=>{"recipe-card"===a&&(customElements.get(e(a))||customElements.define(e(a),r))}))}o();export{r as R,o as d}
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 o,d as s}from"./p-Bi4G3e9f.js";const p=o,r=s;export{p as RecipeCard,r as defineCustomElement}
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 s}from"./p-BqnbT3UL.js";const p=o,r=s;export{p as RecipeFilterBar,r as defineCustomElement}
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-DXdnWxeM.js";const p=o,r=s;export{p as RecipeForm,r as defineCustomElement}
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 s}from"./p-BUu-OE2n.js";const p=o,r=s;export{p as RecipeRating,r as defineCustomElement}
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 o,d as s}from"./p-Xf30T5IO.js";const p=o,r=s;export{p as RecipeSearchBar,r as defineCustomElement}
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: 'ab4f6e822f8b961d15c49d488af4e9b617ae71d2', class: "card", onClick: () => this.cardClick.emit() }, h("div", { key: 'f57fc00e484283bd223f7e8557af7e76de33217e', class: "image-wrap" }, this.image ? h("img", { src: this.image, alt: this.recipeTitle }) : h("div", { class: "placeholder" }), h("button", { key: '2f05b10aa6de8f6d51e0a216567a65900011a198', class: { 'fav-btn': true, active: this.favorite }, onClick: this.onFavoriteClick, "aria-label": "Toggle favorite" }, this.favorite ? '★' : '☆')), h("div", { key: 'bb120c622bef2e7ae8abfedf31ba988a66d393c3', class: "body" }, h("h3", { key: '2b0115c0ae28b302e35a00e0ed1a70d0b20712ab' }, this.recipeTitle), this.category && h("span", { key: '388a88c469547f04e7af2b1da0d303a28f499481', class: "category" }, this.category), h("div", { key: 'ff8e56f5a2ce08736ec9cef2a17bbcc2aad4b946', class: "actions" }, h("slot", { key: '8952391cb6163493dc5ab27b690c4375ef535ac4', name: "actions" })))));
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: 'eb622258d322ed13168a4e4da4f6fecc67c5e3ea', class: "wrap" }, h("input", { key: '5594cf8585234e21e4529a069ad9621631c9e103', type: "search", placeholder: this.placeholder, value: this.internalValue, onInput: this.onInput, onKeyDown: this.onKeyDown }), h("button", { key: '7540e7232d5071a65360c8196deda3461bfa8308', onClick: () => this.search.emit({ value: this.internalValue }), "aria-label": "Search" }, "\uD83D\uDD0D")));
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: '084a1e0d79a1916d07277e1c080ff779aba1aa79', class: "wrap" }, h("button", { key: 'f0b9b529d1dca7f98621404b174837b5b21163e7', 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)))));
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: '19cb1bd17a6dc207c7e556ae026a4f343a784f50', 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")))));
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: '6699f62ff8027114e5a0e3d154f8743048cf4d96', onSubmit: this.onSubmit }, h("slot", { key: '8de0f7e758feb4fc6f1ea877c4acd7c41cbe13ed', name: "header" }), h("label", { key: '881275928734c4eabfee6d22b35cddad1af03853' }, "Title", h("input", { key: 'a55ae352c35cec0b2391061d48153151a7dc5e6b', type: "text", value: this.title, onInput: (e) => (this.title = e.target.value) }), this.errors.title && h("span", { key: 'dbace66ddaab5ab5096acb39822c7cd3a18923be', class: "error" }, this.errors.title)), h("label", { key: 'ae1bcdb323ccaa03307b6a283fcc395ef49954c5' }, "Image URL", h("input", { key: '6ee9483689e0304c0ae28ab755dc93e117d4952e', type: "text", value: this.image, onInput: (e) => (this.image = e.target.value) })), h("label", { key: '751b54959a8e2c85e98f2b192a4d8aa83d8ebafe' }, "Category", h("input", { key: '83f852c74727b86a1a8a6c9a0d93e9ffdb3f33f3', type: "text", value: this.category, onInput: (e) => (this.category = e.target.value) })), h("div", { key: '6a7c99a86d601ed51ece26c85b4b45766a2dafdf', class: "field" }, h("span", { key: 'ee082917bb3b90ec45ce1feea234c374f7fc35a0' }, "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: '4f81107c94bf8810dfc14aa58d5afcf55d8e126d', type: "button", class: "add-btn", onClick: this.addIngredient }, "+ Add ingredient"), this.errors.ingredients && h("span", { key: 'd87cc375b194c187b64def1ef9840797dab1d456', class: "error" }, this.errors.ingredients)), h("label", { key: 'dc6c04a5a2b5cc7d1912f535b8904125ce74af56' }, "Instructions", h("textarea", { key: '0c9c4b09da5b3f24addb66c18fccad7c900bebcb', rows: 5, onInput: (e) => (this.instructions = e.target.value) }, this.instructions), this.errors.instructions && h("span", { key: 'f430772f46e5298b2a2522aaef2822a59df61a08', class: "error" }, this.errors.instructions)), h("div", { key: '337abce7c4f93a9fbb90917e6b407dfb5b95039d', class: "footer" }, h("slot", { key: 'b8b610485f592592afb6cef682faeb13d52da6ea', name: "footer" }), h("button", { key: 'faf249c9be390b5d574300d0ff24bcd0c5603a3c', type: "button", class: "cancel-btn", onClick: () => this.cancel.emit() }, "Cancel"), h("button", { key: '527146d147778940c28e5357c100d1809cbcd6df', type: "submit", class: "save-btn" }, "Save Recipe"))));
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": [{
@@ -16,7 +16,7 @@ const AppToast = class {
16
16
  }
17
17
  }
18
18
  render() {
19
- return (h("div", { key: '73ab8ea44ad155052616ffbc424e1d8f13b8116f', class: `toast ${this.type}` }, h("span", { key: '301487550c2f4f50cdcc6d0a138b9e968cde385f' }, this.message), h("button", { key: '4e9de348002a397a25450142d9fa1fa07ca84d54', onClick: () => this.dismiss.emit(), "aria-label": "Dismiss" }, "\u2715")));
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();
@@ -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-a8cd146e",[[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-531fb6c4",[[1,"app-toast",{message:[1],type:[1],duration:[2]}]]]],e))));
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))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gurpinderjitsingh/recipe-ui",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Reusable web component library for the Recipe Finder & Meal Planner app, built with StencilJS.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- import{t as s,p as t,H as e,c as i,h as r}from"./p-BJU3HdRm.js";const a=t(class extends e{constructor(s){super(),!1!==s&&this.__registerHost(),this.__attachShadow(),this.filterChange=i(this,"filterChange"),this.categories=[],this.active=""}select(s){this.filterChange.emit({value:s})}render(){const s=Array.isArray(this.categories)?this.categories:[];return r("div",{key:"084a1e0d79a1916d07277e1c080ff779aba1aa79",class:"wrap"},r("button",{key:"f0b9b529d1dca7f98621404b174837b5b21163e7",class:{chip:!0,active:""===this.active},onClick:()=>this.select("")},"All"),s.map((s=>r("button",{class:{chip:!0,active:this.active===s},onClick:()=>this.select(s)},s))))}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 c(){"undefined"!=typeof customElements&&["recipe-filter-bar"].forEach((t=>{"recipe-filter-bar"===t&&(customElements.get(s(t))||customElements.define(s(t),a))}))}c();export{a as R,c 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:"6699f62ff8027114e5a0e3d154f8743048cf4d96",onSubmit:this.onSubmit},s("slot",{key:"8de0f7e758feb4fc6f1ea877c4acd7c41cbe13ed",name:"header"}),s("label",{key:"881275928734c4eabfee6d22b35cddad1af03853"},"Title",s("input",{key:"a55ae352c35cec0b2391061d48153151a7dc5e6b",type:"text",value:this.title,onInput:e=>this.title=e.target.value}),this.errors.title&&s("span",{key:"dbace66ddaab5ab5096acb39822c7cd3a18923be",class:"error"},this.errors.title)),s("label",{key:"ae1bcdb323ccaa03307b6a283fcc395ef49954c5"},"Image URL",s("input",{key:"6ee9483689e0304c0ae28ab755dc93e117d4952e",type:"text",value:this.image,onInput:e=>this.image=e.target.value})),s("label",{key:"751b54959a8e2c85e98f2b192a4d8aa83d8ebafe"},"Category",s("input",{key:"83f852c74727b86a1a8a6c9a0d93e9ffdb3f33f3",type:"text",value:this.category,onInput:e=>this.category=e.target.value})),s("div",{key:"6a7c99a86d601ed51ece26c85b4b45766a2dafdf",class:"field"},s("span",{key:"ee082917bb3b90ec45ce1feea234c374f7fc35a0"},"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:"4f81107c94bf8810dfc14aa58d5afcf55d8e126d",type:"button",class:"add-btn",onClick:this.addIngredient},"+ Add ingredient"),this.errors.ingredients&&s("span",{key:"d87cc375b194c187b64def1ef9840797dab1d456",class:"error"},this.errors.ingredients)),s("label",{key:"dc6c04a5a2b5cc7d1912f535b8904125ce74af56"},"Instructions",s("textarea",{key:"0c9c4b09da5b3f24addb66c18fccad7c900bebcb",rows:5,onInput:e=>this.instructions=e.target.value},this.instructions),this.errors.instructions&&s("span",{key:"f430772f46e5298b2a2522aaef2822a59df61a08",class:"error"},this.errors.instructions)),s("div",{key:"337abce7c4f93a9fbb90917e6b407dfb5b95039d",class:"footer"},s("slot",{key:"b8b610485f592592afb6cef682faeb13d52da6ea",name:"footer"}),s("button",{key:"faf249c9be390b5d574300d0ff24bcd0c5603a3c",type:"button",class:"cancel-btn",onClick:()=>this.cancel.emit()},"Cancel"),s("button",{key:"527146d147778940c28e5357c100d1809cbcd6df",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 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:"73ab8ea44ad155052616ffbc424e1d8f13b8116f",class:`toast ${this.type}`},o("span",{key:"301487550c2f4f50cdcc6d0a138b9e968cde385f"},this.message),o("button",{key:"4e9de348002a397a25450142d9fa1fa07ca84d54",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}
@@ -1 +0,0 @@
1
- import{r as e,c as t,h as a}from"./p-CrZUP9M-.js";const i=class{constructor(a){e(this,a),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 a("div",{key:"ab4f6e822f8b961d15c49d488af4e9b617ae71d2",class:"card",onClick:()=>this.cardClick.emit()},a("div",{key:"f57fc00e484283bd223f7e8557af7e76de33217e",class:"image-wrap"},this.image?a("img",{src:this.image,alt:this.recipeTitle}):a("div",{class:"placeholder"}),a("button",{key:"2f05b10aa6de8f6d51e0a216567a65900011a198",class:{"fav-btn":!0,active:this.favorite},onClick:this.onFavoriteClick,"aria-label":"Toggle favorite"},this.favorite?"★":"☆")),a("div",{key:"bb120c622bef2e7ae8abfedf31ba988a66d393c3",class:"body"},a("h3",{key:"2b0115c0ae28b302e35a00e0ed1a70d0b20712ab"},this.recipeTitle),this.category&&a("span",{key:"388a88c469547f04e7af2b1da0d303a28f499481",class:"category"},this.category),a("div",{key:"ff8e56f5a2ce08736ec9cef2a17bbcc2aad4b946",class:"actions"},a("slot",{key:"8952391cb6163493dc5ab27b690c4375ef535ac4",name:"actions"}))))}};i.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(a){e(this,a),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 a("div",{key:"eb622258d322ed13168a4e4da4f6fecc67c5e3ea",class:"wrap"},a("input",{key:"5594cf8585234e21e4529a069ad9621631c9e103",type:"search",placeholder:this.placeholder,value:this.internalValue,onInput:this.onInput,onKeyDown:this.onKeyDown}),a("button",{key:"7540e7232d5071a65360c8196deda3461bfa8308",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(a){e(this,a),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 a("div",{key:"084a1e0d79a1916d07277e1c080ff779aba1aa79",class:"wrap"},a("button",{key:"f0b9b529d1dca7f98621404b174837b5b21163e7",class:{chip:!0,active:""===this.active},onClick:()=>this.select("")},"All"),e.map((e=>a("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(a){e(this,a),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 a("div",{key:"19cb1bd17a6dc207c7e556ae026a4f343a784f50",class:"wrap",role:this.readonly?void 0:"radiogroup"},e.map((e=>a("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(a){e(this,a),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,a)=>a!==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 a=[...this.ingredients];a[e]=t,this.ingredients=a}render(){return a("form",{key:"6699f62ff8027114e5a0e3d154f8743048cf4d96",onSubmit:this.onSubmit},a("slot",{key:"8de0f7e758feb4fc6f1ea877c4acd7c41cbe13ed",name:"header"}),a("label",{key:"881275928734c4eabfee6d22b35cddad1af03853"},"Title",a("input",{key:"a55ae352c35cec0b2391061d48153151a7dc5e6b",type:"text",value:this.title,onInput:e=>this.title=e.target.value}),this.errors.title&&a("span",{key:"dbace66ddaab5ab5096acb39822c7cd3a18923be",class:"error"},this.errors.title)),a("label",{key:"ae1bcdb323ccaa03307b6a283fcc395ef49954c5"},"Image URL",a("input",{key:"6ee9483689e0304c0ae28ab755dc93e117d4952e",type:"text",value:this.image,onInput:e=>this.image=e.target.value})),a("label",{key:"751b54959a8e2c85e98f2b192a4d8aa83d8ebafe"},"Category",a("input",{key:"83f852c74727b86a1a8a6c9a0d93e9ffdb3f33f3",type:"text",value:this.category,onInput:e=>this.category=e.target.value})),a("div",{key:"6a7c99a86d601ed51ece26c85b4b45766a2dafdf",class:"field"},a("span",{key:"ee082917bb3b90ec45ce1feea234c374f7fc35a0"},"Ingredients"),this.ingredients.map(((e,t)=>a("div",{class:"ingredient-row"},a("input",{type:"text",value:e,onInput:e=>this.updateIngredient(t,e.target.value)}),a("button",{type:"button",onClick:()=>this.removeIngredient(t),"aria-label":"Remove"},"✕")))),a("button",{key:"4f81107c94bf8810dfc14aa58d5afcf55d8e126d",type:"button",class:"add-btn",onClick:this.addIngredient},"+ Add ingredient"),this.errors.ingredients&&a("span",{key:"d87cc375b194c187b64def1ef9840797dab1d456",class:"error"},this.errors.ingredients)),a("label",{key:"dc6c04a5a2b5cc7d1912f535b8904125ce74af56"},"Instructions",a("textarea",{key:"0c9c4b09da5b3f24addb66c18fccad7c900bebcb",rows:5,onInput:e=>this.instructions=e.target.value},this.instructions),this.errors.instructions&&a("span",{key:"f430772f46e5298b2a2522aaef2822a59df61a08",class:"error"},this.errors.instructions)),a("div",{key:"337abce7c4f93a9fbb90917e6b407dfb5b95039d",class:"footer"},a("slot",{key:"b8b610485f592592afb6cef682faeb13d52da6ea",name:"footer"}),a("button",{key:"faf249c9be390b5d574300d0ff24bcd0c5603a3c",type:"button",class:"cancel-btn",onClick:()=>this.cancel.emit()},"Cancel"),a("button",{key:"527146d147778940c28e5357c100d1809cbcd6df",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(a){e(this,a),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 a("div",{key:"cd4f194f1eeb5f53a029f380c40aa0b4ec2f32f4",class:"day-col"},a("div",{key:"d88966142d5101fc522d5de89b6d4cab72cbbbf3",class:"col-header"},this.icon&&a("span",{key:"5a9a27a3a1909bcf7295ec7eeccf309e5e2d1ae0",class:"icon"},this.icon),a("h3",{key:"fd1fa2f1274cc1f6bd8917959015722cb69002ba"},this.day),e.length>0&&a("span",{key:"feff3bc91b52203dba19f7a87c56d3813fc95cdd",class:"count-badge"},e.length)),a("div",{key:"4afee9ce77bf1447bf9e32efc7e2f9b9571873e7",class:"meals"},e.map((e=>a("div",{class:"meal-chip"},a("div",{class:"thumb"},e.image&&a("img",{src:e.image,alt:e.title})),a("span",{class:"title"},e.title),a("button",{class:"remove-btn",onClick:()=>this.removeMeal.emit({day:this.day,mealId:e.id}),"aria-label":`Remove ${e.title}`},"✕")))),0===e.length&&a("p",{key:"9a4002b1b4516fc5ff6ef8f9a2e0a7f5e8465cbd",class:"empty"},"No meal planned")),a("button",{key:"2cef3c5f7d0e89303cb8989f78eefb95c426683f",class:"add-btn",onClick:()=>this.assignMeal.emit({day:this.day})},a("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(a){e(this,a),this.close=t(this,"close"),this.open=!1,this.modalTitle=""}render(){return this.open?a("div",{class:"overlay",onClick:()=>this.close.emit()},a("div",{class:"dialog",onClick:e=>e.stopPropagation()},a("div",{class:"header"},a("h2",null,this.modalTitle),a("button",{class:"close-btn",onClick:()=>this.close.emit(),"aria-label":"Close"},"✕")),a("div",{class:"body"},a("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,i as recipe_card,o as recipe_filter_bar,c as recipe_form,r as recipe_rating,s as recipe_search_bar}