@gurpinderjitsingh/recipe-ui 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
  2. package/dist/cjs/app-modal_7.cjs.entry.js +233 -0
  3. package/dist/cjs/app-toast.cjs.entry.js +26 -0
  4. package/dist/cjs/index-CRcwY0Fb.js +1574 -0
  5. package/dist/cjs/index.cjs.js +16 -0
  6. package/dist/cjs/loader.cjs.js +13 -0
  7. package/dist/cjs/recipe-ui.cjs.js +25 -0
  8. package/dist/collection/collection-manifest.json +20 -0
  9. package/dist/collection/components/app-modal/app-modal.css +12 -0
  10. package/dist/collection/components/app-modal/app-modal.js +87 -0
  11. package/dist/collection/components/app-toast/app-toast.css +9 -0
  12. package/dist/collection/components/app-toast/app-toast.js +111 -0
  13. package/dist/collection/components/meal-plan-day/meal-plan-day.css +19 -0
  14. package/dist/collection/components/meal-plan-day/meal-plan-day.js +111 -0
  15. package/dist/collection/components/recipe-card/recipe-card.css +23 -0
  16. package/dist/collection/components/recipe-card/recipe-card.js +149 -0
  17. package/dist/collection/components/recipe-filter-bar/recipe-filter-bar.css +7 -0
  18. package/dist/collection/components/recipe-filter-bar/recipe-filter-bar.js +92 -0
  19. package/dist/collection/components/recipe-form/recipe-form.css +19 -0
  20. package/dist/{recipe-ui/recipe-form-D_DZ8L9Q.js → collection/components/recipe-form/recipe-form.js} +105 -21
  21. package/dist/collection/components/recipe-rating/recipe-rating.css +5 -0
  22. package/dist/collection/components/recipe-rating/recipe-rating.js +107 -0
  23. package/dist/collection/components/recipe-search-bar/recipe-search-bar.css +11 -0
  24. package/dist/collection/components/recipe-search-bar/recipe-search-bar.js +140 -0
  25. package/dist/collection/index.js +12 -0
  26. package/dist/components/app-modal.js +1 -0
  27. package/dist/components/app-toast.js +1 -0
  28. package/dist/components/index.js +1 -0
  29. package/dist/components/meal-plan-day.js +1 -0
  30. package/dist/components/p-B4H61SFd.js +1 -0
  31. package/dist/components/p-BJJZH_Cc.js +1 -0
  32. package/dist/components/p-BJU3HdRm.js +1 -0
  33. package/dist/components/p-BRKGu69u.js +1 -0
  34. package/dist/components/p-BZBToMAv.js +1 -0
  35. package/dist/components/p-BekLK-Pb.js +1 -0
  36. package/dist/components/p-COHQTgKC.js +1 -0
  37. package/dist/components/p-DsyQvPDo.js +1 -0
  38. package/dist/components/p-kbrkhGSm.js +1 -0
  39. package/dist/components/recipe-card.js +1 -0
  40. package/dist/components/recipe-filter-bar.js +1 -0
  41. package/dist/components/recipe-form.js +1 -0
  42. package/dist/components/recipe-rating.js +1 -0
  43. package/dist/components/recipe-search-bar.js +1 -0
  44. package/dist/esm/app-globals-DQuL1Twl.js +3 -0
  45. package/dist/esm/app-modal_7.entry.js +225 -0
  46. package/dist/{recipe-ui/app-toast-DjuZTKj8.js → esm/app-toast.entry.js} +3 -6
  47. package/dist/esm/index-CrZUP9M-.js +1567 -0
  48. package/dist/esm/index.js +3 -0
  49. package/dist/esm/loader.js +11 -0
  50. package/dist/esm/recipe-ui.js +21 -0
  51. package/dist/index.cjs.js +1 -0
  52. package/dist/index.js +1 -0
  53. package/dist/recipe-ui/index.esm.js +1 -17
  54. package/dist/recipe-ui/p-6ef28048.entry.js +1 -0
  55. package/dist/recipe-ui/p-CrZUP9M-.js +3 -0
  56. package/dist/recipe-ui/p-DQuL1Twl.js +1 -0
  57. package/dist/recipe-ui/p-e2f3c9b9.entry.js +1 -0
  58. package/dist/recipe-ui/recipe-ui.esm.js +1 -50
  59. package/package.json +1 -1
  60. package/dist/recipe-ui/app-modal-BL_aVG1A.js +0 -23
  61. package/dist/recipe-ui/app-modal-BL_aVG1A.js.map +0 -1
  62. package/dist/recipe-ui/app-modal.entry.js +0 -5
  63. package/dist/recipe-ui/app-modal.entry.js.map +0 -1
  64. package/dist/recipe-ui/app-toast-DjuZTKj8.js.map +0 -1
  65. package/dist/recipe-ui/app-toast.entry.js +0 -5
  66. package/dist/recipe-ui/app-toast.entry.js.map +0 -1
  67. package/dist/recipe-ui/index-DV5P9Jd8.js +0 -4656
  68. package/dist/recipe-ui/index-DV5P9Jd8.js.map +0 -1
  69. package/dist/recipe-ui/index.esm.js.map +0 -1
  70. package/dist/recipe-ui/meal-plan-day-9rmKiM44.js +0 -23
  71. package/dist/recipe-ui/meal-plan-day-9rmKiM44.js.map +0 -1
  72. package/dist/recipe-ui/meal-plan-day.entry.js +0 -5
  73. package/dist/recipe-ui/meal-plan-day.entry.js.map +0 -1
  74. package/dist/recipe-ui/recipe-card-91fhJAz5.js +0 -28
  75. package/dist/recipe-ui/recipe-card-91fhJAz5.js.map +0 -1
  76. package/dist/recipe-ui/recipe-card.entry.js +0 -5
  77. package/dist/recipe-ui/recipe-card.entry.js.map +0 -1
  78. package/dist/recipe-ui/recipe-filter-bar-DV-B7Ybe.js +0 -25
  79. package/dist/recipe-ui/recipe-filter-bar-DV-B7Ybe.js.map +0 -1
  80. package/dist/recipe-ui/recipe-filter-bar.entry.js +0 -5
  81. package/dist/recipe-ui/recipe-filter-bar.entry.js.map +0 -1
  82. package/dist/recipe-ui/recipe-form-D_DZ8L9Q.js.map +0 -1
  83. package/dist/recipe-ui/recipe-form.entry.js +0 -5
  84. package/dist/recipe-ui/recipe-form.entry.js.map +0 -1
  85. package/dist/recipe-ui/recipe-rating-BZDgwNdK.js +0 -23
  86. package/dist/recipe-ui/recipe-rating-BZDgwNdK.js.map +0 -1
  87. package/dist/recipe-ui/recipe-rating.entry.js +0 -5
  88. package/dist/recipe-ui/recipe-rating.entry.js.map +0 -1
  89. package/dist/recipe-ui/recipe-search-bar-BVbznAHF.js +0 -47
  90. package/dist/recipe-ui/recipe-search-bar-BVbznAHF.js.map +0 -1
  91. package/dist/recipe-ui/recipe-search-bar.entry.js +0 -5
  92. package/dist/recipe-ui/recipe-search-bar.entry.js.map +0 -1
  93. package/dist/recipe-ui/recipe-ui.esm.js.map +0 -1
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ var appModal_mealPlanDay_recipeCard_recipeFilterBar_recipeForm_recipeRating_recipeSearchBar_entry = require('./app-modal.meal-plan-day.recipe-card.recipe-filter-bar.recipe-form.recipe-rating.recipe-search-bar.entry.cjs.js');
4
+ var appToast_entry = require('./app-toast.entry.cjs.js');
5
+ require('./index-CRcwY0Fb.js');
6
+
7
+
8
+
9
+ exports.AppModal = appModal_mealPlanDay_recipeCard_recipeFilterBar_recipeForm_recipeRating_recipeSearchBar_entry.app_modal;
10
+ exports.MealPlanDay = appModal_mealPlanDay_recipeCard_recipeFilterBar_recipeForm_recipeRating_recipeSearchBar_entry.meal_plan_day;
11
+ exports.RecipeCard = appModal_mealPlanDay_recipeCard_recipeFilterBar_recipeForm_recipeRating_recipeSearchBar_entry.recipe_card;
12
+ exports.RecipeFilterBar = appModal_mealPlanDay_recipeCard_recipeFilterBar_recipeForm_recipeRating_recipeSearchBar_entry.recipe_filter_bar;
13
+ exports.RecipeForm = appModal_mealPlanDay_recipeCard_recipeFilterBar_recipeForm_recipeRating_recipeSearchBar_entry.recipe_form;
14
+ exports.RecipeRating = appModal_mealPlanDay_recipeCard_recipeFilterBar_recipeForm_recipeRating_recipeSearchBar_entry.recipe_rating;
15
+ exports.RecipeSearchBar = appModal_mealPlanDay_recipeCard_recipeFilterBar_recipeForm_recipeRating_recipeSearchBar_entry.recipe_search_bar;
16
+ exports.AppToast = appToast_entry.app_toast;
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-CRcwY0Fb.js');
4
+ var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
+
6
+ const defineCustomElements = async (win, options) => {
7
+ if (typeof window === 'undefined') return undefined;
8
+ await appGlobals.globalScripts();
9
+ return index.bootstrapLazy([["app-modal_7.cjs",[[257,"app-modal",{"open":[4],"modalTitle":[1,"modal-title"]}],[1,"meal-plan-day",{"day":[1],"meals":[16]}],[257,"recipe-card",{"recipeTitle":[1,"recipe-title"],"image":[1],"category":[1],"favorite":[4]}],[1,"recipe-filter-bar",{"categories":[16],"active":[1]}],[257,"recipe-form",{"initialData":[1,"initial-data"],"title":[32],"image":[32],"category":[32],"ingredients":[32],"instructions":[32],"errors":[32]},null,{"initialData":[{"onInitialDataChange":0}]}],[1,"recipe-rating",{"value":[2],"readonly":[4],"max":[2]}],[1,"recipe-search-bar",{"placeholder":[1],"value":[1],"debounceMs":[2,"debounce-ms"],"internalValue":[32]},null,{"value":[{"onValuePropChange":0}]}]]],["app-toast.cjs",[[1,"app-toast",{"message":[1],"type":[1],"duration":[2]}]]]], options);
10
+ };
11
+
12
+ exports.setNonce = index.setNonce;
13
+ exports.defineCustomElements = defineCustomElements;
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-CRcwY0Fb.js');
4
+ var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
+
6
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
7
+ /*
8
+ Stencil Client Patch Browser v4.44.0 | MIT Licensed | https://stenciljs.com
9
+ */
10
+
11
+ var patchBrowser = () => {
12
+ const importMeta = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('recipe-ui.cjs.js', document.baseURI).href));
13
+ const opts = {};
14
+ if (importMeta !== "") {
15
+ opts.resourcesUrl = new URL(".", importMeta).href;
16
+ }
17
+ return index.promiseResolve(opts);
18
+ };
19
+
20
+ patchBrowser().then(async (options) => {
21
+ await appGlobals.globalScripts();
22
+ return index.bootstrapLazy([["app-modal_7.cjs",[[257,"app-modal",{"open":[4],"modalTitle":[1,"modal-title"]}],[1,"meal-plan-day",{"day":[1],"meals":[16]}],[257,"recipe-card",{"recipeTitle":[1,"recipe-title"],"image":[1],"category":[1],"favorite":[4]}],[1,"recipe-filter-bar",{"categories":[16],"active":[1]}],[257,"recipe-form",{"initialData":[1,"initial-data"],"title":[32],"image":[32],"category":[32],"ingredients":[32],"instructions":[32],"errors":[32]},null,{"initialData":[{"onInitialDataChange":0}]}],[1,"recipe-rating",{"value":[2],"readonly":[4],"max":[2]}],[1,"recipe-search-bar",{"placeholder":[1],"value":[1],"debounceMs":[2,"debounce-ms"],"internalValue":[32]},null,{"value":[{"onValuePropChange":0}]}]]],["app-toast.cjs",[[1,"app-toast",{"message":[1],"type":[1],"duration":[2]}]]]], options);
23
+ });
24
+
25
+ exports.setNonce = index.setNonce;
@@ -0,0 +1,20 @@
1
+ {
2
+ "entries": [
3
+ "components/meal-plan-day/meal-plan-day.js",
4
+ "components/recipe-form/recipe-form.js",
5
+ "components/recipe-card/recipe-card.js",
6
+ "components/recipe-search-bar/recipe-search-bar.js",
7
+ "components/recipe-filter-bar/recipe-filter-bar.js",
8
+ "components/recipe-rating/recipe-rating.js",
9
+ "components/app-modal/app-modal.js",
10
+ "components/app-toast/app-toast.js"
11
+ ],
12
+ "mixins": [],
13
+ "compiler": {
14
+ "name": "@stencil/core",
15
+ "version": "4.44.0",
16
+ "typescriptVersion": "5.8.3"
17
+ },
18
+ "collections": [],
19
+ "bundles": []
20
+ }
@@ -0,0 +1,12 @@
1
+ :host { font-family: system-ui, sans-serif; }
2
+ .overlay {
3
+ position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45);
4
+ display: flex; align-items: center; justify-content: center; z-index: 1000;
5
+ }
6
+ .dialog {
7
+ background: #fff; border-radius: 12px; min-width: 320px; max-width: 90vw;
8
+ max-height: 85vh; overflow-y: auto; padding: 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.2);
9
+ }
10
+ .header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
11
+ .header h2 { margin: 0; font-size: 18px; }
12
+ .close-btn { border: none; background: none; font-size: 16px; cursor: pointer; color: #666; }
@@ -0,0 +1,87 @@
1
+ import { h } from "@stencil/core";
2
+ /** Generic modal dialog. Body content is provided via the default slot. */
3
+ export class AppModal {
4
+ constructor() {
5
+ this.open = false;
6
+ this.modalTitle = '';
7
+ }
8
+ render() {
9
+ if (!this.open)
10
+ return null;
11
+ return (h("div", { class: "dialog", onClick: (e) => e.stopPropagation() }, h("div", { class: "header" }, h("h2", null, this.modalTitle), h("button", { class: "close-btn", onClick: () => this.close.emit(), "aria-label": "Close" }, "\u2715")), h("div", { class: "body" }, h("slot", null))));
12
+ }
13
+ static get is() { return "app-modal"; }
14
+ static get encapsulation() { return "shadow"; }
15
+ static get originalStyleUrls() {
16
+ return {
17
+ "$": ["app-modal.css"]
18
+ };
19
+ }
20
+ static get styleUrls() {
21
+ return {
22
+ "$": ["app-modal.css"]
23
+ };
24
+ }
25
+ static get properties() {
26
+ return {
27
+ "open": {
28
+ "type": "boolean",
29
+ "mutable": false,
30
+ "complexType": {
31
+ "original": "boolean",
32
+ "resolved": "boolean",
33
+ "references": {}
34
+ },
35
+ "required": false,
36
+ "optional": false,
37
+ "docs": {
38
+ "tags": [],
39
+ "text": ""
40
+ },
41
+ "getter": false,
42
+ "setter": false,
43
+ "reflect": false,
44
+ "attribute": "open",
45
+ "defaultValue": "false"
46
+ },
47
+ "modalTitle": {
48
+ "type": "string",
49
+ "mutable": false,
50
+ "complexType": {
51
+ "original": "string",
52
+ "resolved": "string",
53
+ "references": {}
54
+ },
55
+ "required": false,
56
+ "optional": false,
57
+ "docs": {
58
+ "tags": [],
59
+ "text": ""
60
+ },
61
+ "getter": false,
62
+ "setter": false,
63
+ "reflect": false,
64
+ "attribute": "modal-title",
65
+ "defaultValue": "''"
66
+ }
67
+ };
68
+ }
69
+ static get events() {
70
+ return [{
71
+ "method": "close",
72
+ "name": "close",
73
+ "bubbles": true,
74
+ "cancelable": true,
75
+ "composed": true,
76
+ "docs": {
77
+ "tags": [],
78
+ "text": ""
79
+ },
80
+ "complexType": {
81
+ "original": "void",
82
+ "resolved": "void",
83
+ "references": {}
84
+ }
85
+ }];
86
+ }
87
+ }
@@ -0,0 +1,9 @@
1
+ :host { font-family: system-ui, sans-serif; display: block; }
2
+ .toast {
3
+ display: flex; align-items: center; gap: 10px; padding: 10px 16px;
4
+ border-radius: 8px; color: #fff; font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
5
+ }
6
+ .toast.success { background: #2ecc71; }
7
+ .toast.error { background: #e74c3c; }
8
+ .toast.info { background: #3498db; }
9
+ button { border: none; background: none; color: inherit; cursor: pointer; margin-left: auto; }
@@ -0,0 +1,111 @@
1
+ import { h } from "@stencil/core";
2
+ /** Simple notification toast. Auto-dismisses after `duration` ms if > 0. */
3
+ export class AppToast {
4
+ constructor() {
5
+ this.message = '';
6
+ this.type = 'info';
7
+ this.duration = 3000;
8
+ }
9
+ componentDidLoad() {
10
+ if (this.duration > 0) {
11
+ setTimeout(() => this.dismiss.emit(), this.duration);
12
+ }
13
+ }
14
+ render() {
15
+ return (h("div", { key: 'd9dcb405ffd97bfa44fee10fe49103bd021938a2', class: `toast ${this.type}` }, h("span", { key: '5fd291b9766dc41189f49c11c836654d6663c8d1' }, this.message), h("button", { key: '9f93921f20b17520ce339378c5a1ca66ef6a04bc', onClick: () => this.dismiss.emit(), "aria-label": "Dismiss" }, "\u2715")));
16
+ }
17
+ static get is() { return "app-toast"; }
18
+ static get encapsulation() { return "shadow"; }
19
+ static get originalStyleUrls() {
20
+ return {
21
+ "$": ["app-toast.css"]
22
+ };
23
+ }
24
+ static get styleUrls() {
25
+ return {
26
+ "$": ["app-toast.css"]
27
+ };
28
+ }
29
+ static get properties() {
30
+ return {
31
+ "message": {
32
+ "type": "string",
33
+ "mutable": false,
34
+ "complexType": {
35
+ "original": "string",
36
+ "resolved": "string",
37
+ "references": {}
38
+ },
39
+ "required": false,
40
+ "optional": false,
41
+ "docs": {
42
+ "tags": [],
43
+ "text": ""
44
+ },
45
+ "getter": false,
46
+ "setter": false,
47
+ "reflect": false,
48
+ "attribute": "message",
49
+ "defaultValue": "''"
50
+ },
51
+ "type": {
52
+ "type": "string",
53
+ "mutable": false,
54
+ "complexType": {
55
+ "original": "'success' | 'error' | 'info'",
56
+ "resolved": "\"error\" | \"info\" | \"success\"",
57
+ "references": {}
58
+ },
59
+ "required": false,
60
+ "optional": false,
61
+ "docs": {
62
+ "tags": [],
63
+ "text": ""
64
+ },
65
+ "getter": false,
66
+ "setter": false,
67
+ "reflect": false,
68
+ "attribute": "type",
69
+ "defaultValue": "'info'"
70
+ },
71
+ "duration": {
72
+ "type": "number",
73
+ "mutable": false,
74
+ "complexType": {
75
+ "original": "number",
76
+ "resolved": "number",
77
+ "references": {}
78
+ },
79
+ "required": false,
80
+ "optional": false,
81
+ "docs": {
82
+ "tags": [],
83
+ "text": ""
84
+ },
85
+ "getter": false,
86
+ "setter": false,
87
+ "reflect": false,
88
+ "attribute": "duration",
89
+ "defaultValue": "3000"
90
+ }
91
+ };
92
+ }
93
+ static get events() {
94
+ return [{
95
+ "method": "dismiss",
96
+ "name": "dismiss",
97
+ "bubbles": true,
98
+ "cancelable": true,
99
+ "composed": true,
100
+ "docs": {
101
+ "tags": [],
102
+ "text": ""
103
+ },
104
+ "complexType": {
105
+ "original": "void",
106
+ "resolved": "void",
107
+ "references": {}
108
+ }
109
+ }];
110
+ }
111
+ }
@@ -0,0 +1,19 @@
1
+ :host { display: block; font-family: system-ui, sans-serif; }
2
+ .day-col {
3
+ border: 1px solid #eee; border-radius: 10px; padding: 10px; min-width: 150px;
4
+ display: flex; flex-direction: column; gap: 8px; background: #fafafa;
5
+ }
6
+ h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: #555; }
7
+ .meals { display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
8
+ .meal-chip {
9
+ display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #eee;
10
+ border-radius: 8px; padding: 4px 6px; font-size: 12px;
11
+ }
12
+ .meal-chip img { width: 24px; height: 24px; border-radius: 4px; object-fit: cover; }
13
+ .meal-chip .title { flex: 1; }
14
+ .meal-chip button { border: none; background: none; cursor: pointer; color: #999; }
15
+ .empty { font-size: 12px; color: #aaa; margin: 4px 0; }
16
+ .add-btn {
17
+ border: 1px dashed #ccc; background: none; border-radius: 8px; padding: 6px;
18
+ font-size: 12px; cursor: pointer; color: #666;
19
+ }
@@ -0,0 +1,111 @@
1
+ import { h } from "@stencil/core";
2
+ /**
3
+ * One column of the weekly meal planner, representing a single day.
4
+ * `meals` is the list of recipes currently assigned to this day.
5
+ * Emits `removeMeal` when a meal's remove button is clicked, and
6
+ * `assignMeal` when the "+ Add meal" button is clicked (the parent app
7
+ * is expected to open its own picker/modal and then update `meals`).
8
+ */
9
+ export class MealPlanDay {
10
+ constructor() {
11
+ this.day = '';
12
+ this.meals = [];
13
+ }
14
+ render() {
15
+ const meals = Array.isArray(this.meals) ? this.meals : [];
16
+ return (h("div", { key: '7a0b592fd4b8d9971d7f4912cecb5f9126be11b3', class: "day-col" }, h("h3", { key: 'b0f1f6a717ad409e6339219ea2f71b73d73bb1f3' }, this.day), h("div", { key: '2c978721af3aad27042572dd7825d5f2b5b659fb', class: "meals" }, meals.map((m) => (h("div", { class: "meal-chip" }, m.image && h("img", { src: m.image, alt: m.title }), h("span", { class: "title" }, m.title), h("button", { onClick: () => this.removeMeal.emit({ day: this.day, mealId: m.id }), "aria-label": "Remove meal" }, "\u2715")))), meals.length === 0 && h("p", { key: '326b5f3201df2416f43debc7257918a60a6ab6dd', class: "empty" }, "No meals planned")), h("button", { key: '3532de633a1f6cb83bb70f91a2df8fe1a9fcbc14', class: "add-btn", onClick: () => this.assignMeal.emit({ day: this.day }) }, "+ Add meal")));
17
+ }
18
+ static get is() { return "meal-plan-day"; }
19
+ static get encapsulation() { return "shadow"; }
20
+ static get originalStyleUrls() {
21
+ return {
22
+ "$": ["meal-plan-day.css"]
23
+ };
24
+ }
25
+ static get styleUrls() {
26
+ return {
27
+ "$": ["meal-plan-day.css"]
28
+ };
29
+ }
30
+ static get properties() {
31
+ return {
32
+ "day": {
33
+ "type": "string",
34
+ "mutable": false,
35
+ "complexType": {
36
+ "original": "string",
37
+ "resolved": "string",
38
+ "references": {}
39
+ },
40
+ "required": false,
41
+ "optional": false,
42
+ "docs": {
43
+ "tags": [],
44
+ "text": ""
45
+ },
46
+ "getter": false,
47
+ "setter": false,
48
+ "reflect": false,
49
+ "attribute": "day",
50
+ "defaultValue": "''"
51
+ },
52
+ "meals": {
53
+ "type": "unknown",
54
+ "mutable": false,
55
+ "complexType": {
56
+ "original": "PlannedMeal[]",
57
+ "resolved": "PlannedMeal[]",
58
+ "references": {
59
+ "PlannedMeal": {
60
+ "location": "local",
61
+ "path": "C:/Users/gurpi/Downloads/recipe-finder-project/recipe-finder/packages/recipe-ui/src/components/meal-plan-day/meal-plan-day.tsx",
62
+ "id": "src/components/meal-plan-day/meal-plan-day.tsx::PlannedMeal"
63
+ }
64
+ }
65
+ },
66
+ "required": false,
67
+ "optional": false,
68
+ "docs": {
69
+ "tags": [],
70
+ "text": ""
71
+ },
72
+ "getter": false,
73
+ "setter": false,
74
+ "defaultValue": "[]"
75
+ }
76
+ };
77
+ }
78
+ static get events() {
79
+ return [{
80
+ "method": "assignMeal",
81
+ "name": "assignMeal",
82
+ "bubbles": true,
83
+ "cancelable": true,
84
+ "composed": true,
85
+ "docs": {
86
+ "tags": [],
87
+ "text": ""
88
+ },
89
+ "complexType": {
90
+ "original": "{ day: string }",
91
+ "resolved": "{ day: string; }",
92
+ "references": {}
93
+ }
94
+ }, {
95
+ "method": "removeMeal",
96
+ "name": "removeMeal",
97
+ "bubbles": true,
98
+ "cancelable": true,
99
+ "composed": true,
100
+ "docs": {
101
+ "tags": [],
102
+ "text": ""
103
+ },
104
+ "complexType": {
105
+ "original": "{ day: string; mealId: string }",
106
+ "resolved": "{ day: string; mealId: string; }",
107
+ "references": {}
108
+ }
109
+ }];
110
+ }
111
+ }
@@ -0,0 +1,23 @@
1
+ :host { display: block; font-family: system-ui, sans-serif; }
2
+ .card {
3
+ border: 1px solid #e5e5e5;
4
+ border-radius: 12px;
5
+ overflow: hidden;
6
+ cursor: pointer;
7
+ background: #fff;
8
+ transition: box-shadow 0.15s ease, transform 0.15s ease;
9
+ }
10
+ .card:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08); transform: translateY(-2px); }
11
+ .image-wrap { position: relative; aspect-ratio: 4 / 3; background: #f2f2f2; }
12
+ .image-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
13
+ .placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, #eee, #ddd); }
14
+ .fav-btn {
15
+ position: absolute; top: 8px; right: 8px; border: none;
16
+ background: rgba(255, 255, 255, 0.9); border-radius: 50%;
17
+ width: 32px; height: 32px; font-size: 16px; cursor: pointer; color: #f5a623;
18
+ }
19
+ .fav-btn.active { color: #ff6b35; }
20
+ .body { padding: 12px 14px; }
21
+ h3 { margin: 0 0 4px; font-size: 15px; line-height: 1.3; }
22
+ .category { font-size: 12px; color: #777; text-transform: uppercase; letter-spacing: 0.03em; }
23
+ .actions { margin-top: 8px; }
@@ -0,0 +1,149 @@
1
+ import { h } from "@stencil/core";
2
+ /**
3
+ * Displays a summary of a recipe (image, title, category) inside a card.
4
+ * Emits `cardClick` when the card body is clicked and `favoriteToggle`
5
+ * when the favorite button is pressed. Accepts a named `actions` slot
6
+ * for extra buttons supplied by the consuming app.
7
+ */
8
+ export class RecipeCard {
9
+ constructor() {
10
+ /** Category / cuisine label */
11
+ this.category = '';
12
+ /** Whether this recipe is currently favorited */
13
+ this.favorite = false;
14
+ this.onFavoriteClick = (e) => {
15
+ e.stopPropagation();
16
+ this.favoriteToggle.emit({ favorite: !this.favorite });
17
+ };
18
+ }
19
+ render() {
20
+ return (h("div", { key: 'abd19b1d63409b52cf66f348131f5f6f77bb47a6', class: "card", onClick: () => this.cardClick.emit() }, h("div", { key: '1292c3f6dfe7d3b399943004f764c41a3d072188', class: "image-wrap" }, this.image ? h("img", { src: this.image, alt: this.recipeTitle }) : h("div", { class: "placeholder" }), h("button", { key: '0efdc01af349d011ca0e11c4df5438b79876b467', class: { 'fav-btn': true, active: this.favorite }, onClick: this.onFavoriteClick, "aria-label": "Toggle favorite" }, this.favorite ? '★' : '☆')), h("div", { key: '66c2c4d845d9cc082c07f24f5d827313f6ad51c4', class: "body" }, h("h3", { key: '779fc629c3b97b6158f99440d9bb17fafb708dd3' }, this.recipeTitle), this.category && h("span", { key: '259ec599a43a5c8a279ad5993ba36f8602125b76', class: "category" }, this.category), h("div", { key: '58ab20f9682b4b73b7d027571496641cbfa76d0b', class: "actions" }, h("slot", { key: '28103422d993e58b133c2350e37c06fddf24300f', name: "actions" })))));
21
+ }
22
+ static get is() { return "recipe-card"; }
23
+ static get encapsulation() { return "shadow"; }
24
+ static get originalStyleUrls() {
25
+ return {
26
+ "$": ["recipe-card.css"]
27
+ };
28
+ }
29
+ static get styleUrls() {
30
+ return {
31
+ "$": ["recipe-card.css"]
32
+ };
33
+ }
34
+ static get properties() {
35
+ return {
36
+ "recipeTitle": {
37
+ "type": "string",
38
+ "mutable": false,
39
+ "complexType": {
40
+ "original": "string",
41
+ "resolved": "string",
42
+ "references": {}
43
+ },
44
+ "required": false,
45
+ "optional": false,
46
+ "docs": {
47
+ "tags": [],
48
+ "text": "Recipe title (named recipeTitle, not title, to avoid colliding with\nthe native HTML title/tooltip attribute every element already has)"
49
+ },
50
+ "getter": false,
51
+ "setter": false,
52
+ "reflect": false,
53
+ "attribute": "recipe-title"
54
+ },
55
+ "image": {
56
+ "type": "string",
57
+ "mutable": false,
58
+ "complexType": {
59
+ "original": "string",
60
+ "resolved": "string",
61
+ "references": {}
62
+ },
63
+ "required": false,
64
+ "optional": false,
65
+ "docs": {
66
+ "tags": [],
67
+ "text": "Image URL"
68
+ },
69
+ "getter": false,
70
+ "setter": false,
71
+ "reflect": false,
72
+ "attribute": "image"
73
+ },
74
+ "category": {
75
+ "type": "string",
76
+ "mutable": false,
77
+ "complexType": {
78
+ "original": "string",
79
+ "resolved": "string",
80
+ "references": {}
81
+ },
82
+ "required": false,
83
+ "optional": false,
84
+ "docs": {
85
+ "tags": [],
86
+ "text": "Category / cuisine label"
87
+ },
88
+ "getter": false,
89
+ "setter": false,
90
+ "reflect": false,
91
+ "attribute": "category",
92
+ "defaultValue": "''"
93
+ },
94
+ "favorite": {
95
+ "type": "boolean",
96
+ "mutable": false,
97
+ "complexType": {
98
+ "original": "boolean",
99
+ "resolved": "boolean",
100
+ "references": {}
101
+ },
102
+ "required": false,
103
+ "optional": false,
104
+ "docs": {
105
+ "tags": [],
106
+ "text": "Whether this recipe is currently favorited"
107
+ },
108
+ "getter": false,
109
+ "setter": false,
110
+ "reflect": false,
111
+ "attribute": "favorite",
112
+ "defaultValue": "false"
113
+ }
114
+ };
115
+ }
116
+ static get events() {
117
+ return [{
118
+ "method": "favoriteToggle",
119
+ "name": "favoriteToggle",
120
+ "bubbles": true,
121
+ "cancelable": true,
122
+ "composed": true,
123
+ "docs": {
124
+ "tags": [],
125
+ "text": "Fired when the favorite button is toggled"
126
+ },
127
+ "complexType": {
128
+ "original": "{ favorite: boolean }",
129
+ "resolved": "{ favorite: boolean; }",
130
+ "references": {}
131
+ }
132
+ }, {
133
+ "method": "cardClick",
134
+ "name": "cardClick",
135
+ "bubbles": true,
136
+ "cancelable": true,
137
+ "composed": true,
138
+ "docs": {
139
+ "tags": [],
140
+ "text": "Fired when the card (excluding the favorite button) is clicked"
141
+ },
142
+ "complexType": {
143
+ "original": "void",
144
+ "resolved": "void",
145
+ "references": {}
146
+ }
147
+ }];
148
+ }
149
+ }
@@ -0,0 +1,7 @@
1
+ :host { display: block; font-family: system-ui, sans-serif; }
2
+ .wrap { display: flex; flex-wrap: wrap; gap: 8px; }
3
+ .chip {
4
+ border: 1px solid #ddd; background: #fff; border-radius: 999px;
5
+ padding: 6px 14px; font-size: 13px; cursor: pointer; color: #444;
6
+ }
7
+ .chip.active { background: #ff6b35; border-color: #ff6b35; color: #fff; }