@gurpinderjitsingh/recipe-ui 0.1.0

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 (65) hide show
  1. package/README.md +38 -0
  2. package/dist/components/app-modal.d.ts +11 -0
  3. package/dist/components/app-toast.d.ts +11 -0
  4. package/dist/components/index.d.ts +35 -0
  5. package/dist/components/meal-plan-day.d.ts +11 -0
  6. package/dist/components/recipe-card.d.ts +11 -0
  7. package/dist/components/recipe-filter-bar.d.ts +11 -0
  8. package/dist/components/recipe-form.d.ts +11 -0
  9. package/dist/components/recipe-rating.d.ts +11 -0
  10. package/dist/components/recipe-search-bar.d.ts +11 -0
  11. package/dist/recipe-ui/app-modal-BL_aVG1A.js +23 -0
  12. package/dist/recipe-ui/app-modal-BL_aVG1A.js.map +1 -0
  13. package/dist/recipe-ui/app-modal.entry.js +5 -0
  14. package/dist/recipe-ui/app-modal.entry.js.map +1 -0
  15. package/dist/recipe-ui/app-toast-DjuZTKj8.js +27 -0
  16. package/dist/recipe-ui/app-toast-DjuZTKj8.js.map +1 -0
  17. package/dist/recipe-ui/app-toast.entry.js +5 -0
  18. package/dist/recipe-ui/app-toast.entry.js.map +1 -0
  19. package/dist/recipe-ui/index-DV5P9Jd8.js +4656 -0
  20. package/dist/recipe-ui/index-DV5P9Jd8.js.map +1 -0
  21. package/dist/recipe-ui/index.esm.js +17 -0
  22. package/dist/recipe-ui/index.esm.js.map +1 -0
  23. package/dist/recipe-ui/meal-plan-day-9rmKiM44.js +23 -0
  24. package/dist/recipe-ui/meal-plan-day-9rmKiM44.js.map +1 -0
  25. package/dist/recipe-ui/meal-plan-day.entry.js +5 -0
  26. package/dist/recipe-ui/meal-plan-day.entry.js.map +1 -0
  27. package/dist/recipe-ui/recipe-card-91fhJAz5.js +28 -0
  28. package/dist/recipe-ui/recipe-card-91fhJAz5.js.map +1 -0
  29. package/dist/recipe-ui/recipe-card.entry.js +5 -0
  30. package/dist/recipe-ui/recipe-card.entry.js.map +1 -0
  31. package/dist/recipe-ui/recipe-filter-bar-DV-B7Ybe.js +25 -0
  32. package/dist/recipe-ui/recipe-filter-bar-DV-B7Ybe.js.map +1 -0
  33. package/dist/recipe-ui/recipe-filter-bar.entry.js +5 -0
  34. package/dist/recipe-ui/recipe-filter-bar.entry.js.map +1 -0
  35. package/dist/recipe-ui/recipe-form-D_DZ8L9Q.js +95 -0
  36. package/dist/recipe-ui/recipe-form-D_DZ8L9Q.js.map +1 -0
  37. package/dist/recipe-ui/recipe-form.entry.js +5 -0
  38. package/dist/recipe-ui/recipe-form.entry.js.map +1 -0
  39. package/dist/recipe-ui/recipe-rating-BZDgwNdK.js +23 -0
  40. package/dist/recipe-ui/recipe-rating-BZDgwNdK.js.map +1 -0
  41. package/dist/recipe-ui/recipe-rating.entry.js +5 -0
  42. package/dist/recipe-ui/recipe-rating.entry.js.map +1 -0
  43. package/dist/recipe-ui/recipe-search-bar-BVbznAHF.js +47 -0
  44. package/dist/recipe-ui/recipe-search-bar-BVbznAHF.js.map +1 -0
  45. package/dist/recipe-ui/recipe-search-bar.entry.js +5 -0
  46. package/dist/recipe-ui/recipe-search-bar.entry.js.map +1 -0
  47. package/dist/recipe-ui/recipe-ui.esm.js +50 -0
  48. package/dist/recipe-ui/recipe-ui.esm.js.map +1 -0
  49. package/dist/types/components/app-modal/app-modal.d.ts +8 -0
  50. package/dist/types/components/app-toast/app-toast.d.ts +10 -0
  51. package/dist/types/components/meal-plan-day/meal-plan-day.d.ts +25 -0
  52. package/dist/types/components/recipe-card/recipe-card.d.ts +26 -0
  53. package/dist/types/components/recipe-filter-bar/recipe-filter-bar.d.ts +16 -0
  54. package/dist/types/components/recipe-form/recipe-form.d.ts +35 -0
  55. package/dist/types/components/recipe-rating/recipe-rating.d.ts +11 -0
  56. package/dist/types/components/recipe-search-bar/recipe-search-bar.d.ts +20 -0
  57. package/dist/types/components.d.ts +620 -0
  58. package/dist/types/index.d.ts +8 -0
  59. package/dist/types/stencil-public-runtime.d.ts +1872 -0
  60. package/loader/cdn.js +1 -0
  61. package/loader/index.cjs.js +1 -0
  62. package/loader/index.d.ts +24 -0
  63. package/loader/index.es2017.js +1 -0
  64. package/loader/index.js +2 -0
  65. package/package.json +38 -0
package/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # @yourscope/recipe-ui
2
+
3
+ Reusable StencilJS web-component library for the Recipe Finder & Meal Planner app.
4
+ Works in any framework (Svelte, React, Vue, plain HTML) because it compiles to
5
+ standard Custom Elements.
6
+
7
+ ## Components
8
+ - `<recipe-card>` – recipe summary card
9
+ - `<recipe-search-bar>` – debounced search input
10
+ - `<recipe-filter-bar>` – category/cuisine filter chips
11
+ - `<recipe-rating>` – star rating, read-only or interactive
12
+ - `<recipe-form>` – add/edit recipe form with built-in validation
13
+ - `<meal-plan-day>` – one day column of the weekly planner
14
+ - `<app-modal>` – generic modal dialog (uses default slot)
15
+ - `<app-toast>` – notification toast
16
+
17
+ ## Local development
18
+ ```bash
19
+ npm install
20
+ npm start # stencil dev server + playground at localhost:3333
21
+ ```
22
+
23
+ ## Build & publish
24
+ ```bash
25
+ npm run build
26
+ npm version patch|minor|major
27
+ npm publish --access public
28
+ ```
29
+
30
+ ## Consuming in SvelteKit
31
+ ```bash
32
+ npm install @yourscope/recipe-ui
33
+ ```
34
+ ```ts
35
+ // call once, client-side only (e.g. in +layout.svelte onMount)
36
+ import { defineCustomElements } from '@yourscope/recipe-ui/loader';
37
+ defineCustomElements();
38
+ ```
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface AppModal extends Components.AppModal, HTMLElement {}
4
+ export const AppModal: {
5
+ prototype: AppModal;
6
+ new (): AppModal;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface AppToast extends Components.AppToast, HTMLElement {}
4
+ export const AppToast: {
5
+ prototype: AppToast;
6
+ new (): AppToast;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Get the base path to where the assets can be found. Use "setAssetPath(path)"
3
+ * if the path needs to be customized.
4
+ */
5
+ export declare const getAssetPath: (path: string) => string;
6
+
7
+ /**
8
+ * Used to manually set the base path where assets can be found.
9
+ * If the script is used as "module", it's recommended to use "import.meta.url",
10
+ * such as "setAssetPath(import.meta.url)". Other options include
11
+ * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
12
+ * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
13
+ * But do note that this configuration depends on how your script is bundled, or lack of
14
+ * bundling, and where your assets can be loaded from. Additionally custom bundling
15
+ * will have to ensure the static assets are copied to its build directory.
16
+ */
17
+ export declare const setAssetPath: (path: string) => void;
18
+
19
+ /**
20
+ * Used to specify a nonce value that corresponds with an application's CSP.
21
+ * When set, the nonce will be added to all dynamically created script and style tags at runtime.
22
+ * Alternatively, the nonce value can be set on a meta tag in the DOM head
23
+ * (<meta name="csp-nonce" content="{ nonce value here }" />) which
24
+ * will result in the same behavior.
25
+ */
26
+ export declare const setNonce: (nonce: string) => void
27
+
28
+ export interface SetPlatformOptions {
29
+ raf?: (c: FrameRequestCallback) => number;
30
+ ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
31
+ rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
32
+ }
33
+ export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
34
+
35
+ export * from '../types';
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface MealPlanDay extends Components.MealPlanDay, HTMLElement {}
4
+ export const MealPlanDay: {
5
+ prototype: MealPlanDay;
6
+ new (): MealPlanDay;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface RecipeCard extends Components.RecipeCard, HTMLElement {}
4
+ export const RecipeCard: {
5
+ prototype: RecipeCard;
6
+ new (): RecipeCard;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface RecipeFilterBar extends Components.RecipeFilterBar, HTMLElement {}
4
+ export const RecipeFilterBar: {
5
+ prototype: RecipeFilterBar;
6
+ new (): RecipeFilterBar;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface RecipeForm extends Components.RecipeForm, HTMLElement {}
4
+ export const RecipeForm: {
5
+ prototype: RecipeForm;
6
+ new (): RecipeForm;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface RecipeRating extends Components.RecipeRating, HTMLElement {}
4
+ export const RecipeRating: {
5
+ prototype: RecipeRating;
6
+ new (): RecipeRating;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface RecipeSearchBar extends Components.RecipeSearchBar, HTMLElement {}
4
+ export const RecipeSearchBar: {
5
+ prototype: RecipeSearchBar;
6
+ new (): RecipeSearchBar;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,23 @@
1
+ import { r as registerInstance, a as createEvent, h } from './index-DV5P9Jd8.js';
2
+
3
+ const appModalCss = () => `:host{font-family:system-ui, sans-serif}.overlay{position:fixed;inset:0;background:rgba(0, 0, 0, 0.45);display:flex;align-items:center;justify-content:center;z-index:1000}.dialog{background:#fff;border-radius:12px;min-width:320px;max-width:90vw;max-height:85vh;overflow-y:auto;padding:20px;box-shadow:0 10px 40px rgba(0,0,0,0.2)}.header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.header h2{margin:0;font-size:18px}.close-btn{border:none;background:none;font-size:16px;cursor:pointer;color:#666}`;
4
+
5
+ const AppModal = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.close = createEvent(this, "close", 7);
9
+ this.open = false;
10
+ this.modalTitle = '';
11
+ }
12
+ render() {
13
+ if (!this.open)
14
+ return null;
15
+ return (h("div", { class: "overlay", onClick: () => this.close.emit() }, 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)))));
16
+ }
17
+ };
18
+ AppModal.style = appModalCss();
19
+
20
+ export { AppModal as A };
21
+ //# sourceMappingURL=app-modal-BL_aVG1A.js.map
22
+
23
+ //# sourceMappingURL=app-modal-BL_aVG1A.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-modal-BL_aVG1A.js","sources":["src/components/app-modal/app-modal.css?tag=app-modal&encapsulation=shadow","src/components/app-modal/app-modal.tsx"],"sourcesContent":[":host { font-family: system-ui, sans-serif; }\n.overlay {\n position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45);\n display: flex; align-items: center; justify-content: center; z-index: 1000;\n}\n.dialog {\n background: #fff; border-radius: 12px; min-width: 320px; max-width: 90vw;\n max-height: 85vh; overflow-y: auto; padding: 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.2);\n}\n.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }\n.header h2 { margin: 0; font-size: 18px; }\n.close-btn { border: none; background: none; font-size: 16px; cursor: pointer; color: #666; }\n","import { Component, Prop, Event, EventEmitter, h } from '@stencil/core';\n\n/** Generic modal dialog. Body content is provided via the default slot. */\n@Component({\n tag: 'app-modal',\n styleUrl: 'app-modal.css',\n shadow: true,\n})\nexport class AppModal {\n @Prop() open: boolean = false;\n @Prop() modalTitle: string = '';\n\n @Event() close: EventEmitter<void>;\n\n render() {\n if (!this.open) return null;\n return (\n <div class=\"overlay\" onClick={() => this.close.emit()}>\n <div class=\"dialog\" onClick={(e) => e.stopPropagation()}>\n <div class=\"header\">\n <h2>{this.modalTitle}</h2>\n <button class=\"close-btn\" onClick={() => this.close.emit()} aria-label=\"Close\">\n ✕\n </button>\n </div>\n <div class=\"body\">\n <slot></slot>\n </div>\n </div>\n </div>\n );\n }\n}\n"],"names":[],"mappings":";;AAAA,MAAM,WAAW,GAAG,MAAM,CAAC,qhBAAqhB,CAAC;;MCQpiB,QAAQ,GAAA,MAAA;AALrB,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAMU,QAAA,IAAA,CAAA,IAAI,GAAY,KAAK;AACrB,QAAA,IAAA,CAAA,UAAU,GAAW,EAAE;AAsBhC;IAlBC,MAAM,GAAA;QACJ,IAAI,CAAC,IAAI,CAAC,IAAI;AAAE,YAAA,OAAO,IAAI;QAC3B,QACE,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,SAAS,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAA,EACnD,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,eAAe,EAAE,EAAA,EACrD,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,QAAQ,EAAA,EACjB,CAAA,CAAA,IAAA,EAAA,IAAA,EAAK,IAAI,CAAC,UAAU,CAAM,EAC1B,CAAA,CAAA,QAAA,EAAA,EAAQ,KAAK,EAAC,WAAW,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAA,YAAA,EAAa,OAAO,aAErE,CACL,EACN,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,MAAM,EAAA,EACf,CAAA,CAAA,MAAA,EAAA,IAAA,CAAa,CACT,CACF,CACF;;;;;;;"}
@@ -0,0 +1,5 @@
1
+ export { A as app_modal } from './app-modal-BL_aVG1A.js';
2
+ import './index-DV5P9Jd8.js';
3
+ //# sourceMappingURL=app-modal.entry.esm.js.map
4
+
5
+ //# sourceMappingURL=app-modal.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"app-modal.entry.js","mappings":";","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -0,0 +1,27 @@
1
+ import { r as registerInstance, a as createEvent, h } from './index-DV5P9Jd8.js';
2
+
3
+ const appToastCss = () => `:host{font-family:system-ui, sans-serif;display:block}.toast{display:flex;align-items:center;gap:10px;padding:10px 16px;border-radius:8px;color:#fff;font-size:14px;box-shadow:0 4px 12px rgba(0,0,0,0.15)}.toast.success{background:#2ecc71}.toast.error{background:#e74c3c}.toast.info{background:#3498db}button{border:none;background:none;color:inherit;cursor:pointer;margin-left:auto}`;
4
+
5
+ const AppToast = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.dismiss = createEvent(this, "dismiss", 7);
9
+ this.message = '';
10
+ this.type = 'info';
11
+ this.duration = 3000;
12
+ }
13
+ componentDidLoad() {
14
+ if (this.duration > 0) {
15
+ setTimeout(() => this.dismiss.emit(), this.duration);
16
+ }
17
+ }
18
+ render() {
19
+ 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")));
20
+ }
21
+ };
22
+ AppToast.style = appToastCss();
23
+
24
+ export { AppToast as A };
25
+ //# sourceMappingURL=app-toast-DjuZTKj8.js.map
26
+
27
+ //# sourceMappingURL=app-toast-DjuZTKj8.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-toast-DjuZTKj8.js","sources":["src/components/app-toast/app-toast.css?tag=app-toast&encapsulation=shadow","src/components/app-toast/app-toast.tsx"],"sourcesContent":[":host { font-family: system-ui, sans-serif; display: block; }\n.toast {\n display: flex; align-items: center; gap: 10px; padding: 10px 16px;\n border-radius: 8px; color: #fff; font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.15);\n}\n.toast.success { background: #2ecc71; }\n.toast.error { background: #e74c3c; }\n.toast.info { background: #3498db; }\nbutton { border: none; background: none; color: inherit; cursor: pointer; margin-left: auto; }\n","import { Component, Prop, Event, EventEmitter, h } from '@stencil/core';\n\n/** Simple notification toast. Auto-dismisses after `duration` ms if > 0. */\n@Component({\n tag: 'app-toast',\n styleUrl: 'app-toast.css',\n shadow: true,\n})\nexport class AppToast {\n @Prop() message: string = '';\n @Prop() type: 'success' | 'error' | 'info' = 'info';\n @Prop() duration: number = 3000;\n\n @Event() dismiss: EventEmitter<void>;\n\n componentDidLoad() {\n if (this.duration > 0) {\n setTimeout(() => this.dismiss.emit(), this.duration);\n }\n }\n\n render() {\n return (\n <div class={`toast ${this.type}`}>\n <span>{this.message}</span>\n <button onClick={() => this.dismiss.emit()} aria-label=\"Dismiss\">✕</button>\n </div>\n );\n }\n}\n"],"names":[],"mappings":";;AAAA,MAAM,WAAW,GAAG,MAAM,CAAC,6XAA6X,CAAC;;MCQ5Y,QAAQ,GAAA,MAAA;AALrB,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAMU,QAAA,IAAA,CAAA,OAAO,GAAW,EAAE;AACpB,QAAA,IAAA,CAAA,IAAI,GAAiC,MAAM;AAC3C,QAAA,IAAA,CAAA,QAAQ,GAAW,IAAI;AAkBhC;IAdC,gBAAgB,GAAA;AACd,QAAA,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,EAAE;AACrB,YAAA,UAAU,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC;;;IAIxD,MAAM,GAAA;AACJ,QAAA,QACE,4DAAK,KAAK,EAAE,SAAS,IAAI,CAAC,IAAI,CAAA,CAAE,EAAA,EAC9B,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EAAO,IAAI,CAAC,OAAO,CAAQ,EAC3B,CAAA,CAAA,QAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAQ,OAAO,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAA,YAAA,EAAa,SAAS,EAAA,EAAA,QAAA,CAAW,CACvE;;;;;;;"}
@@ -0,0 +1,5 @@
1
+ export { A as app_toast } from './app-toast-DjuZTKj8.js';
2
+ import './index-DV5P9Jd8.js';
3
+ //# sourceMappingURL=app-toast.entry.esm.js.map
4
+
5
+ //# sourceMappingURL=app-toast.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"app-toast.entry.js","mappings":";","names":[],"sources":[],"sourcesContent":[],"version":3}