@seepmaini/stencil-recipe-components 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/index-BgGiRDlK.js +1502 -0
- package/dist/cjs/index.cjs.js +7 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/my-component.cjs.entry.js +33 -0
- package/dist/cjs/no-recipe-found.cjs.entry.js +25 -0
- package/dist/cjs/recipe-browser.cjs.entry.js +64 -0
- package/dist/cjs/recipe-button.cjs.entry.js +24 -0
- package/dist/cjs/recipe-card.cjs.entry.js +78 -0
- package/dist/cjs/recipe-form-section.cjs.entry.js +20 -0
- package/dist/cjs/recipe-input.cjs.entry.js +24 -0
- package/dist/cjs/recipe-navbar.cjs.entry.js +30 -0
- package/dist/cjs/recipe-textarea.cjs.entry.js +23 -0
- package/dist/cjs/search-food.cjs.entry.js +36 -0
- package/dist/cjs/stencil-recipe-components.cjs.js +25 -0
- package/dist/collection/collection-manifest.json +22 -0
- package/dist/collection/components/my-component/my-component.cmp.test.js +27 -0
- package/dist/collection/components/my-component/my-component.css +3 -0
- package/dist/collection/components/my-component/my-component.js +95 -0
- package/dist/collection/components/no-recipe-found/no-recipe-found.css +76 -0
- package/dist/collection/components/no-recipe-found/no-recipe-found.js +107 -0
- package/dist/collection/components/recipe-browser/recipe-browser.css +183 -0
- package/dist/collection/components/recipe-browser/recipe-browser.js +220 -0
- package/dist/collection/components/recipe-button/recipe-button.css +34 -0
- package/dist/collection/components/recipe-button/recipe-button.js +89 -0
- package/dist/collection/components/recipe-card/recipe-card.css +207 -0
- package/dist/collection/components/recipe-card/recipe-card.js +260 -0
- package/dist/collection/components/recipe-form-section/recipe-form-section.css +54 -0
- package/dist/collection/components/recipe-form-section/recipe-form-section.js +82 -0
- package/dist/collection/components/recipe-input/recipe-input.css +47 -0
- package/dist/collection/components/recipe-input/recipe-input.js +167 -0
- package/dist/collection/components/recipe-navbar/recipe-navbar.css +56 -0
- package/dist/collection/components/recipe-navbar/recipe-navbar.js +55 -0
- package/dist/collection/components/recipe-textarea/recipe-textarea.css +43 -0
- package/dist/collection/components/recipe-textarea/recipe-textarea.js +146 -0
- package/dist/collection/components/search-food/search-food.css +117 -0
- package/dist/collection/components/search-food/search-food.js +92 -0
- package/dist/collection/index.js +10 -0
- package/dist/collection/utils/utils.js +3 -0
- package/dist/collection/utils/utils.unit.test.js +16 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/my-component.d.ts +11 -0
- package/dist/components/my-component.js +1 -0
- package/dist/components/no-recipe-found.d.ts +11 -0
- package/dist/components/no-recipe-found.js +1 -0
- package/dist/components/p-DlkZDAps.js +1 -0
- package/dist/components/recipe-browser.d.ts +11 -0
- package/dist/components/recipe-browser.js +1 -0
- package/dist/components/recipe-button.d.ts +11 -0
- package/dist/components/recipe-button.js +1 -0
- package/dist/components/recipe-card.d.ts +11 -0
- package/dist/components/recipe-card.js +1 -0
- package/dist/components/recipe-form-section.d.ts +11 -0
- package/dist/components/recipe-form-section.js +1 -0
- package/dist/components/recipe-input.d.ts +11 -0
- package/dist/components/recipe-input.js +1 -0
- package/dist/components/recipe-navbar.d.ts +11 -0
- package/dist/components/recipe-navbar.js +1 -0
- package/dist/components/recipe-textarea.d.ts +11 -0
- package/dist/components/recipe-textarea.js +1 -0
- package/dist/components/search-food.d.ts +11 -0
- package/dist/components/search-food.js +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/index-DxpnpZMq.js +1495 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/my-component.entry.js +31 -0
- package/dist/esm/no-recipe-found.entry.js +23 -0
- package/dist/esm/recipe-browser.entry.js +62 -0
- package/dist/esm/recipe-button.entry.js +22 -0
- package/dist/esm/recipe-card.entry.js +76 -0
- package/dist/esm/recipe-form-section.entry.js +18 -0
- package/dist/esm/recipe-input.entry.js +22 -0
- package/dist/esm/recipe-navbar.entry.js +28 -0
- package/dist/esm/recipe-textarea.entry.js +21 -0
- package/dist/esm/search-food.entry.js +34 -0
- package/dist/esm/stencil-recipe-components.js +21 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil-recipe-components/index.esm.js +1 -0
- package/dist/stencil-recipe-components/p-06b59cd5.entry.js +1 -0
- package/dist/stencil-recipe-components/p-2289adb0.entry.js +1 -0
- package/dist/stencil-recipe-components/p-5df4665a.entry.js +1 -0
- package/dist/stencil-recipe-components/p-83e3c89d.entry.js +1 -0
- package/dist/stencil-recipe-components/p-87586541.entry.js +1 -0
- package/dist/stencil-recipe-components/p-969201bf.entry.js +1 -0
- package/dist/stencil-recipe-components/p-DQuL1Twl.js +1 -0
- package/dist/stencil-recipe-components/p-DxpnpZMq.js +3 -0
- package/dist/stencil-recipe-components/p-b5c77a1a.entry.js +1 -0
- package/dist/stencil-recipe-components/p-c8a44beb.entry.js +1 -0
- package/dist/stencil-recipe-components/p-efd4f7bb.entry.js +1 -0
- package/dist/stencil-recipe-components/p-f5524ed4.entry.js +1 -0
- package/dist/stencil-recipe-components/stencil-recipe-components.esm.js +1 -0
- package/dist/types/components/my-component/my-component.cmp.test.d.ts +1 -0
- package/dist/types/components/my-component/my-component.d.ts +16 -0
- package/dist/types/components/no-recipe-found/no-recipe-found.d.ts +9 -0
- package/dist/types/components/recipe-browser/recipe-browser.d.ts +21 -0
- package/dist/types/components/recipe-button/recipe-button.d.ts +6 -0
- package/dist/types/components/recipe-card/recipe-card.d.ts +34 -0
- package/dist/types/components/recipe-form-section/recipe-form-section.d.ts +6 -0
- package/dist/types/components/recipe-input/recipe-input.d.ts +10 -0
- package/dist/types/components/recipe-navbar/recipe-navbar.d.ts +4 -0
- package/dist/types/components/recipe-textarea/recipe-textarea.d.ts +9 -0
- package/dist/types/components/search-food/search-food.d.ts +10 -0
- package/dist/types/components.d.ts +558 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/stencil-public-runtime.d.ts +1872 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/dist/types/utils/utils.unit.test.d.ts +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +82 -0
- package/readme.md +111 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
export class SearchFood {
|
|
3
|
+
search = '';
|
|
4
|
+
searchSubmit;
|
|
5
|
+
searchClear;
|
|
6
|
+
handleInput = (event) => {
|
|
7
|
+
this.search = event.target.value;
|
|
8
|
+
};
|
|
9
|
+
handleSearch = () => {
|
|
10
|
+
const value = this.search.trim();
|
|
11
|
+
if (!value) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
this.searchSubmit.emit(value);
|
|
15
|
+
};
|
|
16
|
+
clearSearch = () => {
|
|
17
|
+
this.search = '';
|
|
18
|
+
this.searchClear.emit();
|
|
19
|
+
};
|
|
20
|
+
render() {
|
|
21
|
+
return (h("div", { key: 'aec6c865acb5f9ebcacc2fd517641085c2339303', class: "search-wrapper" }, h("div", { key: 'f50a9844f4bb84b0ec4e1b04df5d6198e1fe3786', class: "search-box" }, h("span", { key: '013f2674aa34aeca8e8166ccc626299433230bc5', class: "search-icon", "aria-hidden": "true" }, "\uD83D\uDD0D"), h("input", { key: '4b8fad8626692ee6c44cacd05e48b46b00213b20', type: "text", value: this.search, placeholder: "Searching...", "aria-label": "Search for a food", onInput: this.handleInput }), this.search && (h("button", { key: '15af3cda9b0394918e4ca72e313259a006edf54d', type: "button", class: "clear-button", onClick: this.clearSearch, "aria-label": "Clear search" }, "\u00D7")), h("button", { key: '22cd49c7076666d2f560f83bf718eaaf7ceffbf1', type: "button", class: "search-button", onClick: this.handleSearch }, "Search"))));
|
|
22
|
+
}
|
|
23
|
+
static get is() { return "search-food"; }
|
|
24
|
+
static get encapsulation() { return "shadow"; }
|
|
25
|
+
static get originalStyleUrls() {
|
|
26
|
+
return {
|
|
27
|
+
"$": ["search-food.css"]
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
static get styleUrls() {
|
|
31
|
+
return {
|
|
32
|
+
"$": ["search-food.css"]
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
static get properties() {
|
|
36
|
+
return {
|
|
37
|
+
"search": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"mutable": true,
|
|
40
|
+
"complexType": {
|
|
41
|
+
"original": "string",
|
|
42
|
+
"resolved": "string",
|
|
43
|
+
"references": {}
|
|
44
|
+
},
|
|
45
|
+
"required": false,
|
|
46
|
+
"optional": false,
|
|
47
|
+
"docs": {
|
|
48
|
+
"tags": [],
|
|
49
|
+
"text": ""
|
|
50
|
+
},
|
|
51
|
+
"getter": false,
|
|
52
|
+
"setter": false,
|
|
53
|
+
"reflect": false,
|
|
54
|
+
"attribute": "search",
|
|
55
|
+
"defaultValue": "''"
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
static get events() {
|
|
60
|
+
return [{
|
|
61
|
+
"method": "searchSubmit",
|
|
62
|
+
"name": "searchSubmit",
|
|
63
|
+
"bubbles": true,
|
|
64
|
+
"cancelable": true,
|
|
65
|
+
"composed": true,
|
|
66
|
+
"docs": {
|
|
67
|
+
"tags": [],
|
|
68
|
+
"text": ""
|
|
69
|
+
},
|
|
70
|
+
"complexType": {
|
|
71
|
+
"original": "string",
|
|
72
|
+
"resolved": "string",
|
|
73
|
+
"references": {}
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
"method": "searchClear",
|
|
77
|
+
"name": "searchClear",
|
|
78
|
+
"bubbles": true,
|
|
79
|
+
"cancelable": true,
|
|
80
|
+
"composed": true,
|
|
81
|
+
"docs": {
|
|
82
|
+
"tags": [],
|
|
83
|
+
"text": ""
|
|
84
|
+
},
|
|
85
|
+
"complexType": {
|
|
86
|
+
"original": "void",
|
|
87
|
+
"resolved": "void",
|
|
88
|
+
"references": {}
|
|
89
|
+
}
|
|
90
|
+
}];
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview entry point for your component library
|
|
3
|
+
*
|
|
4
|
+
* This is the entry point for your component library. Use this file to export utilities,
|
|
5
|
+
* constants or data structure that accompany your components.
|
|
6
|
+
*
|
|
7
|
+
* DO NOT use this file to export your components. Instead, use the recommended approaches
|
|
8
|
+
* to consume components of this package as outlined in the `README.md`.
|
|
9
|
+
*/
|
|
10
|
+
export { format } from './utils/utils';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { format } from "./utils";
|
|
3
|
+
describe('format', () => {
|
|
4
|
+
it('returns empty string for no names defined', () => {
|
|
5
|
+
expect(format(undefined, undefined, undefined)).toEqual('');
|
|
6
|
+
});
|
|
7
|
+
it('formats just first names', () => {
|
|
8
|
+
expect(format('Joseph', undefined, undefined)).toEqual('Joseph');
|
|
9
|
+
});
|
|
10
|
+
it('formats first and last names', () => {
|
|
11
|
+
expect(format('Joseph', undefined, 'Publique')).toEqual('Joseph Publique');
|
|
12
|
+
});
|
|
13
|
+
it('formats first, middle and last names', () => {
|
|
14
|
+
expect(format('Joseph', 'Quincy', 'Publique')).toEqual('Joseph Quincy Publique');
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -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 @@
|
|
|
1
|
+
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-DlkZDAps.js";function t(s,t,e){return(s||"")+(t?" "+t:"")+(e?" "+e:"")}export{t as format}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface MyComponent extends Components.MyComponent, HTMLElement {}
|
|
4
|
+
export const MyComponent: {
|
|
5
|
+
prototype: MyComponent;
|
|
6
|
+
new (): MyComponent;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,p as e,H as s,h as o}from"./p-DlkZDAps.js";import{format as n}from"./index.js";const m=e(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow()}first;middle;last;getText(){return n(this.first,this.middle,this.last)}render(){return o("div",{key:"edcd595f3b87cfa751442fba79e07a8823826cbc"},"Hello, World! I'm ",this.getText())}static get style(){return":host{display:block}"}},[513,"my-component",{first:[1],middle:[1],last:[1]}]);function r(){"undefined"!=typeof customElements&&["my-component"].forEach((e=>{"my-component"===e&&(customElements.get(t(e))||customElements.define(t(e),m))}))}r();const c=m,i=r;export{c as MyComponent,i as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface NoRecipeFound extends Components.NoRecipeFound, HTMLElement {}
|
|
4
|
+
export const NoRecipeFound: {
|
|
5
|
+
prototype: NoRecipeFound;
|
|
6
|
+
new (): NoRecipeFound;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as t,H as n,c as i,h as a}from"./p-DlkZDAps.js";const o=t(class extends n{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.clear=i(this,"clear")}header="No Recipes Found";message="We couldn’t find any recipes matching your search. Try a different recipe, category, cuisine, or ingredient.";buttonText="Clear Search";clear;handleClear=()=>{this.clear.emit()};render(){return a("section",{key:"8f32c60bdbe3662614a69ed6df89ee3100381f74",class:"empty-state"},a("div",{key:"ab15444f85192f5a0599a8639ee78513359d0489",class:"icon","aria-hidden":"true"},"🍽️"),a("h2",{key:"1a4fac73782ea53e4405b38f28686eea414d1d94"},this.header),a("p",{key:"ee205e4e18009cc93995d717bf9129c265f293f7"},this.message),a("button",{key:"90f4c76d61253e050ae0fc8ff005dfba2e053d98",type:"button",onClick:this.handleClear},this.buttonText))}static get style(){return":host{display:block;font-family:Arial, sans-serif}.icon{width:70px;height:70px;display:flex;align-items:center;justify-content:center;margin-bottom:20px;border-radius:50%;background:#ffffff;font-size:32px}.empty-state{width:min(650px, calc(100% - 40px));margin:50px auto;padding:55px 25px;display:flex;flex-direction:column;align-items:center;text-align:center;background:#ffffff;border:1px solid #eeeeee;border-radius:20px;box-shadow:0 8px 30px rgba(0, 0, 0, 0.08);box-sizing:border-box}h2{margin:0 0 10px;color:#2c2c2c;font-size:28px;font-weight:700}p{max-width:500px;margin:0 0 25px;color:#eeeeee;font-size:15px;line-height:1.6}button{padding:11px 20px;border:none;border-radius:10px;background:#f97316;color:white;font-family:Arial, sans-serif;font-size:14px;font-weight:600;cursor:pointer;transition:background 0.2s ease, transform 0.2s ease}button:hover{background:#ea580c;transform:translateY(-2px)}button:active{transform:translateY(0)}@media (max-width: 600px){.empty-state{width:calc(100% - 24px);margin:35px auto;padding:40px 20px}h2{font-size:24px}p{font-size:14px}}"}},[513,"no-recipe-found",{header:[1],message:[1],buttonText:[1,"button-text"]}]);function r(){"undefined"!=typeof customElements&&["no-recipe-found"].forEach((t=>{"no-recipe-found"===t&&(customElements.get(e(t))||customElements.define(e(t),o))}))}r();const s=o,c=r;export{s as NoRecipeFound,c as defineCustomElement}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t,n){const l="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;e&&e!==l;){const l=Object.getOwnPropertyDescriptor(e,t);if(l&&(!n||l.get))return l;e=Object.getPrototypeOf(e)}}var t,n=(t,n)=>{var l;Object.entries(null!=(l=n.l.t)?l:{}).map((([l,[o]])=>{if(31&o||32&o){const o=t[l],s=e(Object.getPrototypeOf(t),l,!0)||Object.getOwnPropertyDescriptor(t,l);s&&Object.defineProperty(t,l,{get(){return s.get.call(this)},set(e){s.set.call(this,e)},configurable:!0,enumerable:!0}),n.o.has(l)?t[l]=n.o.get(l):void 0!==o&&(t[l]=o)}}))},l=e=>{if(e.__stencil__getHostRef)return e.__stencil__getHostRef()},o=(e,t)=>t in e,s=(e,t)=>(0,console.error)(e,t),i=new Map,r="undefined"!=typeof window?window:{},c=r.HTMLElement||class{},u={i:0,u:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},f=(()=>{try{return!!r.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(e){}return!1})(),a=!!f&&(()=>!!r.document&&Object.getOwnPropertyDescriptor(r.document.adoptedStyleSheets,"length").writable)(),d=!1,p=[],h=[],m=()=>{var e;return(null==(e=r.document)?void 0:e.hidden)?v($):u.raf($)},b=(e,t)=>n=>{e.push(n),d||(d=!0,t&&4&u.i?v($):m())},y=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){s(e)}e.length=0},$=()=>{y(p),y(h),(d=p.length>0)&&m()},v=e=>Promise.resolve(undefined).then(e),w=b(h,!0),g=e=>{const t=new URL(e,u.u);return t.origin!==r.location.origin?t.href:t.pathname},j=e=>u.u=e;function O(){const e=this.attachShadow({mode:"open"});void 0===t&&(t=null),t&&(a?e.adoptedStyleSheets.push(t):e.adoptedStyleSheets=[...e.adoptedStyleSheets,t])}var S,M=new WeakMap,k=e=>"sc-"+e.p,E=e=>"object"==(e=typeof e)||"function"===e,A=(e,t,...n)=>{let l=null,o=null,i=!1,r=!1;const c=[],u=t=>{for(let n=0;n<t.length;n++)if(l=t[n],Array.isArray(l))u(l);else if(null!=l&&"boolean"!=typeof l){if(i="function"!=typeof e&&!E(l))l=String(l);else if("function"!=typeof e&&void 0===l.i){s("Invalid vNode child");continue}i&&r?c[c.length-1].h+=l:c.push(i?C(null,l):l),r=i}};if(u(n),t){t.key&&(o=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const f=C(e,null);return f.m=t,c.length>0&&(f.$=c),f.v=o,f},C=(e,t)=>({i:0,j:e,h:null!=t?t:null,O:null,$:null,m:null,v:null}),N={},x=(e,t)=>null==e||E(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?"string"==typeof e?parseFloat(e):"number"==typeof e?e:NaN:1&t?String(e):e,L=(e,t)=>{const n=e;return{emit:e=>_(n,t,{bubbles:!0,composed:!0,cancelable:!0,detail:e})}},_=(e,t,n)=>{const l=u.ce(t,n);return e.dispatchEvent(l),l},D=(e,t,n,s,i,c)=>{if(n===s)return;let f=o(e,t),a=t.toLowerCase();if("class"===t){const t=e.classList,l=P(n);let o=P(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if("key"===t);else if(e.__lookupSetter__(t)||"o"!==t[0]||"n"!==t[1]){if("a"===t[0]&&t.startsWith("attr:")){const n=t.slice(5);let o;{const t=l(e);if(t&&t.l&&t.l.t){const e=t.l.t[n];e&&e[1]&&(o=e[1])}}return o||(o=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==s||!1===s?!1===s&&""!==e.getAttribute(o)||e.removeAttribute(o):e.setAttribute(o,!0===s?"":s))}if("p"===t[0]&&t.startsWith("prop:")){const n=t.slice(5);try{e[n]=s}catch(e){}return}{const l=E(s);if((f||l&&null!==s)&&!i)try{if(e.tagName.includes("-"))e[t]!==s&&(e[t]=s);else{const l=null==s?"":s;"list"===t?f=!1:null!=n&&e[t]===l||("function"==typeof e.__lookupSetter__(t)?e[t]=l:e.setAttribute(t,l))}}catch(e){}null==s||!1===s?!1===s&&""!==e.getAttribute(t)||e.removeAttribute(t):(!f||4&c||i)&&!l&&1===e.nodeType&&e.setAttribute(t,s=!0===s?"":s)}}else if(t="-"===t[2]?t.slice(3):o(r,a)?a.slice(2):a[2]+t.slice(3),n||s){const l=t.endsWith(R);t=t.replace(U,""),n&&u.rel(e,t,n,l),s&&u.ael(e,t,s,l)}},H=/\s/,P=e=>("object"==typeof e&&e&&"baseVal"in e&&(e=e.baseVal),e&&"string"==typeof e?e.split(H):[]),R="Capture",U=new RegExp(R+"$"),W=(e,t,n)=>{const l=11===t.O.nodeType&&t.O.host?t.O.host:t.O,o=e&&e.m||{},s=t.m||{};for(const e of F(Object.keys(o)))e in s||D(l,e,o[e],void 0,n,t.i);for(const e of F(Object.keys(s)))D(l,e,o[e],s[e],n,t.i)};function F(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var T=!1,V=!1,q=(e,t,n)=>{const l=t.$[n];let o,s,i=0;if(null!=l.h)o=l.O=r.document.createTextNode(l.h);else{if(!r.document)throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(o=l.O=r.document.createElement(l.j),W(null,l,V),l.$){const t="template"===l.j?o.content:o;for(i=0;i<l.$.length;++i)s=q(e,l,i),s&&t.appendChild(s)}}return o["s-hn"]=S,o},z=(e,t,n,l,o,s)=>{let i,r=e;for(r.shadowRoot&&r.tagName===S&&(r=r.shadowRoot),"template"===n.j&&(r=r.content);o<=s;++o)l[o]&&(i=q(null,n,o),i&&(l[o].O=i,B(r,i,t)))},I=(e,t,n)=>{for(let l=t;l<=n;++l){const t=e[l];if(t){const e=t.O;e&&e.remove()}}},Y=(e,t,n=!1)=>e.j===t.j&&(n?(n&&!e.v&&t.v&&(e.v=t.v),!0):e.v===t.v),Z=(e,t,n=!1)=>{const l=t.O=e.O,o=e.$,s=t.$,i=t.h;null==i?("slot"!==t.j||T||e.S!==t.S&&(t.O["s-sn"]=t.S||"",(e=>{u.i|=1;const t=e.closest(S.toLowerCase());if(null!=t){const n=Array.from(t.__childNodes||t.childNodes).find((e=>e["s-cr"])),l=Array.from(e.__childNodes||e.childNodes);for(const e of n?l.reverse():l)null!=e["s-sh"]&&(B(t,e,null!=n?n:null),e["s-sh"]=void 0)}u.i&=-2})(t.O.parentElement)),W(e,t,V),null!==o&&null!==s?((e,t,n,l,o=!1)=>{let s,i,r=0,c=0,u=0,f=0,a=t.length-1,d=t[0],p=t[a],h=l.length-1,m=l[0],b=l[h];const y="template"===n.j?e.content:e;for(;r<=a&&c<=h;)if(null==d)d=t[++r];else if(null==p)p=t[--a];else if(null==m)m=l[++c];else if(null==b)b=l[--h];else if(Y(d,m,o))Z(d,m,o),d=t[++r],m=l[++c];else if(Y(p,b,o))Z(p,b,o),p=t[--a],b=l[--h];else if(Y(d,b,o))Z(d,b,o),B(y,d.O,p.O.nextSibling),d=t[++r],b=l[--h];else if(Y(p,m,o))Z(p,m,o),B(y,p.O,d.O),p=t[--a],m=l[++c];else{for(u=-1,f=r;f<=a;++f)if(t[f]&&null!==t[f].v&&t[f].v===m.v){u=f;break}u>=0?(i=t[u],i.j!==m.j?s=q(t&&t[c],n,u):(Z(i,m,o),t[u]=void 0,s=i.O),m=l[++c]):(s=q(t&&t[c],n,c),m=l[++c]),s&&B(d.O.parentNode,s,d.O)}r>a?z(e,null==l[h+1]?null:l[h+1].O,n,l,c,h):c>h&&I(t,r,a)})(l,o,t,s,n):null!==s?(null!==e.h&&(l.textContent=""),z(l,null,t,s,0,s.length-1)):!n&&null!==o&&I(o,0,o.length-1)):e.h!==i&&(l.data=i)},B=(e,t,n)=>e.__insertBefore?e.__insertBefore(t,n):null==e?void 0:e.insertBefore(t,n),G=(e,t,n=!1)=>{const l=e.$hostElement$,o=e.l,s=e.M||C(null,null);var i;const r=(i=t)&&i.j===N?t:A(null,null,t);if(S=l.tagName,n&&r.m)for(const e of Object.keys(r.m))l.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(r.m[e]=l[e]);r.j=null,r.i|=4,e.M=r,r.O=s.O=l.shadowRoot||l,T=!(!(1&o.i)||128&o.i),Z(s,r,n)},J=(e,t)=>{if(t&&!e.k&&t["s-p"]){const n=t["s-p"].push(new Promise((l=>e.k=()=>{t["s-p"].splice(n-1,1),l()})))}},K=(e,t)=>{if(e.i|=16,4&e.i)return void(e.i|=512);J(e,e.A);const n=()=>Q(e,t);if(!t)return w(n);queueMicrotask((()=>{n()}))},Q=(e,t)=>{const n=e.$hostElement$,l=n;if(!l)throw new Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let o;return o=se(l,t?"componentWillLoad":"componentWillUpdate",void 0,n),o=X(o,(()=>se(l,"componentWillRender",void 0,n))),X(o,(()=>te(e,l,t)))},X=(e,t)=>ee(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),ee=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,te=async(e,t,n)=>{var l;const o=e.$hostElement$,s=o["s-rc"];n&&(e=>{const t=e.l,n=e.$hostElement$,l=t.i,o=((e,t)=>{var n,l,o;const s=k(t),c=i.get(s);if(!r.document)return s;if(e=11===e.nodeType?e:r.document,c)if("string"==typeof c){let o,i=M.get(e=e.head||e);if(i||M.set(e,i=new Set),!i.has(s)){o=r.document.createElement("style"),o.textContent=c;const d=null!=(n=u.C)?n:function(){var e,t,n;return null!=(n=null==(t=null==(e=r.document.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:t.getAttribute("content"))?n:void 0}();if(null!=d&&o.setAttribute("nonce",d),!(1&t.i))if("HEAD"===e.nodeName){const t=e.querySelectorAll("link[rel=preconnect]"),n=t.length>0?t[t.length-1].nextSibling:e.querySelector("style");e.insertBefore(o,(null==n?void 0:n.parentNode)===e?n:null)}else if("host"in e)if(f){const t=new(null!=(l=e.defaultView)?l:e.ownerDocument.defaultView).CSSStyleSheet;t.replaceSync(c),a?e.adoptedStyleSheets.unshift(t):e.adoptedStyleSheets=[t,...e.adoptedStyleSheets]}else{const t=e.querySelector("style");t?t.textContent=c+t.textContent:e.prepend(o)}else e.append(o);1&t.i&&e.insertBefore(o,null),4&t.i&&(o.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),i&&i.add(s)}}else{let t=M.get(e);if(t||M.set(e,t=new Set),!t.has(s)){const n=null!=(o=e.defaultView)?o:e.ownerDocument.defaultView;let l;if(c.constructor===n.CSSStyleSheet)l=c;else{l=new n.CSSStyleSheet;for(let e=0;e<c.cssRules.length;e++)l.insertRule(c.cssRules[e].cssText,e)}a?e.adoptedStyleSheets.push(l):e.adoptedStyleSheets=[...e.adoptedStyleSheets,l],t.add(s)}}return s})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);ne(e,t,o,n),s&&(s.map((e=>e())),o["s-rc"]=void 0);{const t=null!=(l=o["s-p"])?l:[],n=()=>le(e);0===t.length?n():(Promise.all(t).then(n).catch(n),e.i|=4,t.length=0)}},ne=(e,t,n,l)=>{try{t=t.render(),e.i&=-17,e.i|=2,G(e,t,l)}catch(t){s(t,e.$hostElement$)}return null},le=e=>{const t=e.$hostElement$,n=t,l=e.A;se(n,"componentDidRender",void 0,t),64&e.i?se(n,"componentDidUpdate",void 0,t):(e.i|=64,ie(t),se(n,"componentDidLoad",void 0,t),e.N(t),l||oe()),e.k&&(e.k(),e.k=void 0),512&e.i&&v((()=>K(e,!1))),e.i&=-517},oe=()=>{v((()=>_(r,"appload",{detail:{namespace:"stencil-recipe-components"}})))},se=(e,t,n,l)=>{if(e&&e[t])try{return e[t](n)}catch(e){s(e,l)}},ie=e=>e.classList.add("hydrated"),re=(e,t,n,o)=>{const s=l(e);if(!s)return;const i=e,r=s.o.get(t),c=s.i,u=i;n=x(n,o.t[t][0]);const f=Number.isNaN(r)&&Number.isNaN(n);if(n!==r&&!f&&(s.o.set(t,n),2&c)){if(u.componentShouldUpdate&&!1===u.componentShouldUpdate(n,r,t)&&!(16&c))return;16&c||K(s,!1)}},ce=(t,n)=>{var o,s;const i=t.prototype;if(n.t){const r=Object.entries(null!=(o=n.t)?o:{});r.map((([t,[o]])=>{if(31&o||32&o){const{get:s,set:r}=e(i,t)||{};s&&(n.t[t][0]|=2048),r&&(n.t[t][0]|=4096),Object.defineProperty(i,t,{get(){return s?s.apply(this):(e=t,l(this).o.get(e));var e},configurable:!0,enumerable:!0}),Object.defineProperty(i,t,{set(e){const s=l(this);if(s){if(r)return void 0===(32&o?this[t]:s.$hostElement$[t])&&s.o.get(t)&&(e=s.o.get(t)),r.apply(this,[x(e,o)]),void re(this,t,e=32&o?this[t]:s.$hostElement$[t],n);re(this,t,e,n)}}})}}));{const e=new Map;i.attributeChangedCallback=function(t,o,s){u.jmp((()=>{var c;const u=e.get(t),f=l(this);if(this.hasOwnProperty(u),i.hasOwnProperty(u)&&"number"==typeof this[u]&&this[u]==s)return;if(null==u){const e=null==f?void 0:f.i;if(f&&e&&!(8&e)&&s!==o){const l=this,i=null==(c=n.L)?void 0:c[t];null==i||i.forEach((n=>{const[[i,r]]=Object.entries(n);null!=l[i]&&(128&e||1&r)&&l[i].call(l,s,o,t)}))}return}const a=r.find((([e])=>e===u)),d=a&&4&a[1][0],p=d&&null===s&&void 0===this[u];d&&(s=null!==s&&"false"!==s);const h=Object.getOwnPropertyDescriptor(i,u);p||s==this[u]||h.get&&!h.set||(this[u]=s)}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=n.L)?s:{}),...r.filter((([e,t])=>31&t[0])).map((([t,n])=>{const l=n[1]||t;return e.set(l,t),l}))]))}}return t},ue=async(e,t,n)=>{let l;try{if(!(32&t.i)&&(t.i|=32,t.i&=-1025,l=e.constructor,customElements.whenDefined(e.localName).then((()=>t.i|=128)),l&&l.style)){let e;"string"==typeof l.style&&(e=l.style);const t=k(n);if(!i.has(t)){const l=()=>{};((e,t,n)=>{let l=i.get(e);f&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,i.set(e,l)})(t,e,!!(1&n.i)),l()}}const o=t.A,s=()=>K(t,!0);o&&o["s-rc"]?o["s-rc"].push(s):s()}catch(n){s(n,e),t.k&&(t.k(),t.k=void 0),!t.N||1024&t.i||t.N(e)}},fe=(e,t)=>{const o={i:t[0],p:t[1]};try{o.t=t[2];const s=e.prototype.connectedCallback,i=e.prototype.disconnectedCallback;return Object.assign(e.prototype,{__hasHostListenerAttached:!1,__registerHost(){((e,t)=>{const l={i:0,$hostElement$:e,l:t,o:new Map,_:new Map};l.D=new Promise((e=>l.N=e)),e["s-p"]=[],e["s-rc"]=[];const o=l;e.__stencil__getHostRef=()=>o,512&t.i&&n(e,l)})(this,o)},connectedCallback(){if(!this.__hasHostListenerAttached){if(!l(this))return;this.__hasHostListenerAttached=!0}(e=>{if(!(1&u.i)){const t=l(e);if(!t)return;const n=t.l,o=()=>{};if(1&t.i)(null==t?void 0:t.H)||(1024&t.i?setTimeout((()=>ue(e,t,n)),1e3):(null==t?void 0:t.D)&&t.D.then((()=>{})));else{t.i|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){J(t,t.A=n);break}}n.t&&Object.entries(n.t).map((([t,[n]])=>{if(31&n&&Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];delete e[t],e[t]=n}})),ue(e,t,n)}o()}})(this),s&&s.call(this)},disconnectedCallback(){(async e=>{1&u.i||l(e),M.has(e)&&M.delete(e),e.shadowRoot&&M.has(e.shadowRoot)&&M.delete(e.shadowRoot)})(this),i&&i.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw new Error(`Unable to re-use existing shadow root for ${o.p}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else O.call(this,o)}}),Object.defineProperty(e,"is",{value:o.p,configurable:!0}),ce(e,o)}catch(t){return s(t),e}},ae=e=>u.C=e,de=e=>Object.assign(u,e),pe=new WeakMap;function he(e,t){let n=pe.get(t);n||(n={i:0,l:{i:0,p:t.tagName},$hostElement$:t},pe.set(t,n)),G(n,e)}function me(e){return e}export{c as H,ae as a,de as b,L as c,g,A as h,fe as p,he as r,j as s,me as t}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface RecipeBrowser extends Components.RecipeBrowser, HTMLElement {}
|
|
4
|
+
export const RecipeBrowser: {
|
|
5
|
+
prototype: RecipeBrowser;
|
|
6
|
+
new (): RecipeBrowser;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as a,H as t,c,h as r}from"./p-DlkZDAps.js";const i=a(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.browseChange=c(this,"browseChange"),this.browseClear=c(this,"browseClear")}categories=[];areas=[];ingredients=[];selectedCategory="";selectedArea="";selectedIngredient="";browseChange;browseClear;handleCategory=e=>{const a=e.target.value;a&&this.browseChange.emit({type:"category",value:a})};handleArea=e=>{const a=e.target.value;a&&this.browseChange.emit({type:"area",value:a})};handleIngredient=e=>{const a=e.target.value;a&&this.browseChange.emit({type:"ingredient",value:a})};handleClear=()=>{this.browseClear.emit()};render(){const e=""!==this.selectedCategory||""!==this.selectedArea||""!==this.selectedIngredient;return r("section",{key:"1e4b3474c45baf701d6212a58d4cfc465063bc5e",class:"wrapper"},r("div",{key:"165084c65d6e9a4e457c601fc8ce6feb0321544c",class:"header"},r("div",{key:"6fd026ea128dca2e65c3cbdfdc4908ee34ee4bfc",class:"heading"},r("span",{key:"7a110eeebd3835354934bca2e141248142beb8e2",class:"eyebrow"},"✦ BROWSE RECIPES"),r("h2",{key:"74431b3cfda0539b1c639d2f5ec71092dada18d9"},"Find Your Perfect Recipe"),r("p",{key:"d4ca3d04dd15a8f3a74020eafc454770a6d15e17"},"Explore delicious recipes by category, cuisine or ingredient.")),e&&r("button",{key:"c0576d993b85806611797e3b34c52773594b28ca",type:"button",class:"clear-button",onClick:this.handleClear},"Clear Filters")),r("div",{key:"db81e498a63b5ba1ca7fab36bef03ca69337f695",class:"filters"},r("div",{key:"1c4981b68d5ffffb2533a2ba08ed31746d8ed63d",class:"filter-card"},r("div",{key:"5e253ee63f146f9d14404e6d9c00c2132cb32c6e",class:"content"},r("h3",{key:"c803bb45c98d0108babb53c77ec4fe495ebfc475"},"Category"),r("p",{key:"b81b23f23c834ad6e718213e640221e7361e41c4"},"Find recipes by food category."),r("select",{key:"79b2055724ae09bc9ff5810ed85549abdf82025c","aria-label":"Select recipe category",onChange:this.handleCategory},r("option",{key:"2c8426061798f6790b0e6c06e232388aad1f2010",value:""},"All Categories"),this.categories.map((e=>r("option",{value:e,selected:this.selectedCategory===e},e)))))),r("div",{key:"7809c3a73c2f32c5b1bcf318249b7cb71ce6f1d0",class:"filter-card"},r("div",{key:"7353fe2a352af762393d11482ddecbb7de08176b",class:"content"},r("h3",{key:"949566a102ece48164fccfc2805b77c5364152ff"},"Ingredient"),r("p",{key:"060f125190ee29b79cf3e6025f71fd9759ac5e55"},"Find recipes using your favourite ingredients."),r("select",{key:"abff2d33d651b611a60952aba9c59ff5e9bb2ab6","aria-label":"Select recipe ingredient",onChange:this.handleIngredient},r("option",{key:"eaeb17a91f94ba7c81b1a9e074f837a04b2630c6",value:""},"All Ingredients"),this.ingredients.map((e=>r("option",{value:e,selected:this.selectedIngredient===e},e)))))),r("div",{key:"993eadac9b0939bcf6480960cdf46436900d6c0e",class:"filter-card"},r("div",{key:"06f401549f627d20c725353882f625b97df14267",class:"content"},r("h3",{key:"83a457b4b81a96d857edb50919a305ac0eeb0c06"},"Cuisine"),r("p",{key:"9cb3a03bfec4fcb2170439cf7c6ab3d5714c07c0"},"Discover recipes from around the world."),r("select",{key:"b839e0b5570e4d7f7b9bccd12a0a4f7ed13d7181","aria-label":"Select recipe cuisine",onChange:this.handleArea},r("option",{key:"ab8df5981542546ad9c35732327dc8b9d40e7c4a",value:""},"All Cuisines"),this.areas.map((e=>r("option",{value:e,selected:this.selectedArea===e},e))))))))}static get style(){return":host{display:block;font-family:Arial, sans-serif;color:#2c2c2c}.wrapper{width:min(1200px, calc(100% - 40px));margin:0 auto;padding:45px 0}.header{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-bottom:28px}.heading{max-width:650px}.eyebrow{display:block;margin-bottom:8px;font-size:14px;font-weight:700;letter-spacing:0.14em;text-transform:uppercase;color:#f97316}h2{margin:0;font-size:clamp(28px, 4vw, 40px);line-height:1.1;font-weight:700;letter-spacing:-0.03em}.heading p{margin:10px 0 0;font-size:16px;line-height:1.6;color:#777777}.clear-button{flex-shrink:0;padding:10px 17px;border:1px solid #e5e7eb;border-radius:10px;background:white;color:#2c2c2c;font-family:Arial, sans-serif;font-size:14px;font-weight:600;cursor:pointer;transition:background 0.2s ease, color 0.2s ease, border-color 0.2s ease}.clear-button:hover{background:#fff7ed;border-color:#fdba74;color:#ea580c}.filters{display:grid;grid-template-columns:repeat(3, minmax(0, 1fr));gap:18px}.filter-card{display:flex;gap:16px;padding:22px;background:white;border:1px solid #eeeeee;border-radius:18px;box-shadow:0 6px 25px rgba(0, 0, 0, 0.04);transition:transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease}.filter-card:hover{transform:translateY(-3px);border-color:#fed7aa;box-shadow:0 12px 30px rgba(0, 0, 0, 0.08)}.icon{width:46px;height:46px;flex-shrink:0;display:flex;align-items:center;justify-content:center;border-radius:12px;font-size:22px}.category-icon{background:#fff7ed}.cuisine-icon{background:#eff6ff}.ingredient-icon{background:#f0fdf4}.content{flex:1;min-width:0}.content h3{margin:0;font-size:17px;font-weight:700}.content p{margin:6px 0 14px;font-size:13px;line-height:1.5;color:#777}select{display:block;width:100%;height:42px;padding:0 12px;border:1px solid #e5e7eb;border-radius:9px;background:white;color:#2c2c2c;font-family:Arial, sans-serif;font-size:14px;cursor:pointer;outline:none;box-sizing:border-box;transition:border-color 0.2s ease, box-shadow 0.2s ease}select:hover{border-color:#fb923c}select:focus{border-color:#f97316;box-shadow:0 0 0 3px rgba(249, 115, 22, 0.12)}@media (max-width: 900px){.filters{grid-template-columns:repeat(2, minmax(0, 1fr))}.filter-card:last-child{grid-column:span 2}}@media (max-width: 600px){.wrapper{width:calc(100% - 24px);padding:35px 0}.header{align-items:flex-start;flex-direction:column}.clear-button{align-self:flex-start}.filters{grid-template-columns:1fr;gap:14px}.filter-card:last-child{grid-column:auto}.filter-card{padding:18px}}@media (prefers-reduced-motion: reduce){.filter-card,.clear-button,select{transition:none}}"}},[513,"recipe-browser",{categories:[16],areas:[16],ingredients:[16],selectedCategory:[1,"selected-category"],selectedArea:[1,"selected-area"],selectedIngredient:[1,"selected-ingredient"]}]);function s(){"undefined"!=typeof customElements&&["recipe-browser"].forEach((a=>{"recipe-browser"===a&&(customElements.get(e(a))||customElements.define(e(a),i))}))}s();const o=i,d=s;export{o as RecipeBrowser,d as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface RecipeButton extends Components.RecipeButton, HTMLElement {}
|
|
4
|
+
export const RecipeButton: {
|
|
5
|
+
prototype: RecipeButton;
|
|
6
|
+
new (): RecipeButton;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,p as e,H as r,h as o}from"./p-DlkZDAps.js";const s=e(class extends r{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow()}variant="primary";type="button";disabled=!1;render(){return o("button",{key:"69decd9fcbcb01bce1f5c78fdb79ccea94f4369d",type:this.type,class:{button:!0,primary:"primary"===this.variant,secondary:"secondary"===this.variant},disabled:this.disabled},o("slot",{key:"9561dcb8e2f50f8f85ccaacb0ff885b67a5eab1d"}))}static get style(){return":host{display:inline-block}.button{min-width:120px;min-height:44px;padding:0 18px;border-radius:10px;font-size:14px;font-weight:700;cursor:pointer}.primary{border:none;background:#f97316;color:white}.secondary{border:1px solid #ddd;background:white;color:#777777}.primary:hover{background:#ea580c}.button:disabled{opacity:0.6;cursor:not-allowed}"}},[769,"recipe-button",{variant:[1],type:[1],disabled:[4]}]);function n(){"undefined"!=typeof customElements&&["recipe-button"].forEach((e=>{"recipe-button"===e&&(customElements.get(t(e))||customElements.define(t(e),s))}))}n();const i=s,c=n;export{i as RecipeButton,c as defineCustomElement}
|
|
@@ -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 @@
|
|
|
1
|
+
import{t as e,p as a,H as t,c as i,h as d}from"./p-DlkZDAps.js";const o=a(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.favoriteToggle=i(this,"favoriteToggle"),this.recipeClick=i(this,"recipeClick"),this.addToPlanner=i(this,"add-to-planner")}recipeId="";recipeTitle="";image="";category="";cuisine="";favorite=!1;favoriteToggle;recipeClick;addToPlanner;showPlanner=!1;selectedDay="";selectedMeal="";handleViewRecipe=()=>{this.recipeClick.emit({id:this.recipeId})};toggleFavorite=e=>{e.stopPropagation(),this.favoriteToggle.emit({id:this.recipeId})};openPlanner=e=>{e.stopPropagation(),this.selectedDay="",this.selectedMeal="",this.showPlanner=!0};closePlanner=()=>{this.showPlanner=!1,this.selectedDay="",this.selectedMeal=""};handleDayChange=e=>{this.selectedDay=e.target.value};handleMealChange=e=>{this.selectedMeal=e.target.value};confirmPlanner=()=>{this.selectedDay&&this.selectedMeal&&(this.addToPlanner.emit({id:this.recipeId,day:this.selectedDay,mealType:this.selectedMeal}),this.closePlanner())};render(){const e=this.favorite?`Remove ${this.recipeTitle} from favorites`:`Add ${this.recipeTitle} to favorites`,a=""!==this.selectedDay&&""!==this.selectedMeal;return d("article",{key:"e9cac86199c4999118277c301095f0d5fdc0465e",class:"recipe-card"},d("div",{key:"41cc1e4446a23d097181d023e28ef26ec8e1c709",class:"image-container"},d("img",{key:"5f9d485af235d895d5ba410826fe00ead8795420",src:this.image,alt:this.recipeTitle,loading:"lazy",decoding:"async"}),this.category&&d("span",{key:"8f50506474a6ec6d9cb973bec927640fe1bbc14e",class:"category"},this.category),d("button",{key:"cc2b1c5291f30e8fc8cb14591a884cebd3343018",type:"button",class:{favorite:!0,active:this.favorite},onClick:this.toggleFavorite,"aria-label":e,"aria-pressed":this.favorite},this.favorite?"♥":"♡")),d("div",{key:"8cb4a3397069c51ee95baff05662bf9f3aee9c1d",class:"content"},this.cuisine&&d("div",{key:"de5ad5288350fe2f251ffa62cda82fa35bf53f3e",class:"cuisine"},d("span",{key:"87aa4b6d69bd35acf850b5650b8f5a2db28adef0"},"✦"),this.cuisine),d("h3",{key:"332a9140cc9627d02ab1e5621fb0b2f0c0d8f754"},this.recipeTitle),d("div",{key:"7c2962abe8ebb3cb22e91b61acf1362dc6216f81",class:"actions"},d("button",{key:"fc9b769b0198145d8a49dfaf837acbe24eee3f2e",type:"button",class:"view-button",onClick:this.handleViewRecipe},"View Recipe",d("span",{key:"50f0f5e55f9caab5d70f16aaf3585c80c1e5ac7c"},"→")),d("button",{key:"6936bec5da6c7509f51abf2646312cc0315dbe99",type:"button",class:"planner-button",onClick:this.openPlanner},"+ Add to Planner"))),this.showPlanner&&d("div",{key:"a15cc6195d9331cadbec3eae206a9c82737be735",class:"planner-overlay",onClick:this.closePlanner},d("div",{key:"a5b74b52a845f1488e3eeb2356fc6044f1c15912",class:"planner-modal",onClick:e=>e.stopPropagation()},d("div",{key:"572800bf57b24b41cadfacb49da5dccef6a9f132",class:"planner-header"},d("div",{key:"cd7f730b46ef2fad37a22e05bc5bc3e1fdc6d0c6"},d("h4",{key:"c30504584428ffac7a3dfe0a1d5c2c7c895d1665"},"Add to Meal Planner"),d("p",{key:"dbee3ab4e4dc0b0b3c553684e447a931813b7c66"},"Add ",d("strong",{key:"501eee64ac955ccaa7116a7f20f35473ecc2912d"},this.recipeTitle))),d("button",{key:"55ca144a870c33892b1d61051c8b60dab1528bb8",type:"button",class:"close-button",onClick:this.closePlanner},"×")),d("div",{key:"b8e4b435c27e0a5536335897b59386bd9b4b1b1b",class:"field"},d("label",{key:"b26aec673a147830320a92389d6f2da7a4a901e4",htmlFor:"planner-day"},"Day"),d("select",{key:"0b95a3b9b32278534a0157f469281a67e0c0ad9b",id:"planner-day",onChange:this.handleDayChange},d("option",{key:"c2e6e6d89ece44b371ae377b395aa8719935f326",value:""},"Select a day"),d("option",{key:"98c27f6fb8e49de25ecabda4f52436d8c3fac93b",value:"Monday"},"Monday"),d("option",{key:"7e782ca431ad476040a87f4664341e679a435fd0",value:"Tuesday"},"Tuesday"),d("option",{key:"12f03a59c1a6a4c9d087e612259b585ad1609128",value:"Wednesday"},"Wednesday"),d("option",{key:"718c4397a7c13ad5e38603c97f3fe43f5da17fce",value:"Thursday"},"Thursday"),d("option",{key:"bde3aaa5cce683c0be7a07c2ad4514bf1ed259a4",value:"Friday"},"Friday"),d("option",{key:"28adf4b21ed230171a653a173b6f1564fdadbd86",value:"Saturday"},"Saturday"),d("option",{key:"ba10816944f43c0f693d7e8e926d7cf9514b8f1a",value:"Sunday"},"Sunday"))),d("div",{key:"2f2bbf50b1e3e515424770fe183f40321ed4a0ec",class:"field"},d("label",{key:"3dbb417dd46359dbc524ab187a26b5af3001b809",htmlFor:"planner-meal"},"Meal"),d("select",{key:"ce276fce3064936bf7695897803fce10e83e345c",id:"planner-meal",onChange:this.handleMealChange},d("option",{key:"6c05f317d30a94be195c432d926034e0b7d1bcb5",value:""},"Select a meal"),d("option",{key:"1392d0ae0d8922547329790707812474e63fcc3b",value:"Breakfast"},"Breakfast"),d("option",{key:"2cc7682e5108e782220dbda63e403d90c04dbd5e",value:"Lunch"},"Lunch"),d("option",{key:"255117f914a6112ccf9169f52ae35bc99df1c549",value:"Dinner"},"Dinner"))),d("div",{key:"efd8158033d291082b9cb131deee84b09a649411",class:"planner-actions"},d("button",{key:"816d91efb664e45ea8bb49285049995536848ba5",type:"button",class:"cancel-button",onClick:this.closePlanner},"Cancel"),d("button",{key:"d4b72a6d50bfdf116210f34a67c8f15bc9d38a69",type:"button",class:"add-button",disabled:!a,onClick:this.confirmPlanner},"Add to Planner")))))}static get style(){return":host{display:block;font-family:Arial, sans-serif}.recipe-card{position:relative;overflow:hidden;background:#ffffff;border:1px solid #eeeeee;border-radius:18px;box-shadow:0 6px 25px rgba(0, 0, 0, 0.05)}.image-container{position:relative;height:220px;overflow:hidden}.image-container img{width:100%;height:100%;display:block;object-fit:cover}.category{position:absolute;top:14px;left:14px;padding:6px 10px;border-radius:20px;background:rgba(255, 255, 255, 0.94);color:#444444;font-size:12px;font-weight:700}.favorite{position:absolute;top:12px;right:12px;width:38px;height:38px;border:none;border-radius:50%;background:rgba(255, 255, 255, 0.95);color:#777777;font-size:24px;cursor:pointer}.favorite.active{color:#e05252}.content{padding:18px}.cuisine{margin-bottom:8px;color:#f97316;font-size:12px;font-weight:600}.content h3{margin:0 0 16px;color:#2c2c2c;font-size:20px;line-height:1.3}.actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:4px}.view-button,.planner-button{width:100%;min-height:42px;border-radius:9px;font-family:Arial, sans-serif;font-size:13px;font-weight:600;cursor:pointer}.view-button{display:flex;align-items:center;justify-content:center;gap:6px;border:none;background:#f97316;color:white}.view-button:hover{background:#ea580c}.planner-button{border:1px solid #fed7aa;background:#fff7ed;color:#ea580c}.planner-button:hover{background:#ffedd5}.planner-overlay{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(0, 0, 0, 0.45)}.planner-modal{width:min(420px, 100%);padding:24px;border-radius:18px;background:white;box-shadow:0 20px 60px rgba(0, 0, 0, 0.2)}.planner-header{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;margin-bottom:22px}.planner-header h4{margin:0 0 6px;font-size:20px;color:#2c2c2c}.planner-header p{margin:0;color:#777777;font-size:13px;line-height:1.5}.close-button{width:32px;height:32px;border:none;border-radius:50%;background:#f5f5f5;font-size:22px;color:#555555;cursor:pointer}.close-button:hover{background:#eeeeee}.planner-modal label{display:block;margin-bottom:8px;font-size:13px;font-weight:600;color:#444444}.planner-modal select{width:100%;height:44px;padding:0 12px;border:1px solid #dddddd;border-radius:10px;background:white;font-family:Arial, sans-serif;font-size:14px;outline:none;box-sizing:border-box}.planner-actions{display:flex;gap:10px;margin-top:20px}.cancel-button,.add-button{flex:1;height:42px;border-radius:9px;font-family:Arial, sans-serif;font-size:14px;font-weight:700;cursor:pointer}.cancel-button{border:1px solid #dddddd;background:white;color:#555555}.cancel-button:hover{background:#f5f5f5}.add-button{border:none;background:#f97316;color:white}.add-button:hover:not(:disabled){background:#ea580c}.add-button:disabled{opacity:0.5;cursor:not-allowed}.field{padding-top:10px}"}},[513,"recipe-card",{recipeId:[1,"recipe-id"],recipeTitle:[1,"recipe-title"],image:[1],category:[1],cuisine:[1],favorite:[4],showPlanner:[32],selectedDay:[32],selectedMeal:[32]}]);function c(){"undefined"!=typeof customElements&&["recipe-card"].forEach((a=>{"recipe-card"===a&&(customElements.get(e(a))||customElements.define(e(a),o))}))}c();const n=o,r=c;export{n as RecipeCard,r as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface RecipeFormSection extends Components.RecipeFormSection, HTMLElement {}
|
|
4
|
+
export const RecipeFormSection: {
|
|
5
|
+
prototype: RecipeFormSection;
|
|
6
|
+
new (): RecipeFormSection;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as t,H as i,h as s}from"./p-DlkZDAps.js";const c=t(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow()}number;formTitle;description;render(){return s("section",{key:"39aba625964827041a26eaf4e59e95fce101af07",class:"section"},s("div",{key:"7f7ed2a37b09b8efa5bbcbe0087e7b575776e61b",class:"section-heading"},s("span",{key:"ae898bcf907768d9abe73e0ff18c39614b6ae23b"},this.number),s("div",{key:"16c1e35edf0e0bba569ab260a640981419a83d44"},s("h2",{key:"61def6637277c674aa708041c148925595493ad7"},this.formTitle),s("p",{key:"62ab7295b08d2ade90ba9dbcb61e2cfe26929c84"},this.description))),s("div",{key:"e56052a380d5c72190b776ea8c7e80f1099a8442",class:"content"},s("slot",{key:"7735bc4718c0d4c7c0805abd1d176fdf3270faa3"})))}static get style(){return":host{display:block}.section{padding:30px;border:1px solid #e9e5e1;border-radius:22px;background:white}.section-heading{display:flex;gap:14px;margin-bottom:25px}.section-heading>span{width:32px;height:32px;display:flex;flex-shrink:0;align-items:center;justify-content:center;border-radius:50%;background:#f3e9e1;color:#f97316;font-size:16px;font-weight:700}.section-heading h2{margin:0;color:#2c2c2c;font-family:Arial, sans-serif;font-size:24px;font-weight:500}.section-heading p{margin:4px 0 0;color:#999999;font-size:16px}.content{display:block}@media (max-width: 600px){.section{padding:20px}}"}},[769,"recipe-form-section",{number:[1],formTitle:[1,"form-title"],description:[1]}]);function n(){"undefined"!=typeof customElements&&["recipe-form-section"].forEach((t=>{"recipe-form-section"===t&&(customElements.get(e(t))||customElements.define(e(t),c))}))}n();const a=c,o=n;export{a as RecipeFormSection,o as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface RecipeInput extends Components.RecipeInput, HTMLElement {}
|
|
4
|
+
export const RecipeInput: {
|
|
5
|
+
prototype: RecipeInput;
|
|
6
|
+
new (): RecipeInput;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as t,H as i,h as o}from"./p-DlkZDAps.js";const s=t(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow()}label;name;type="text";placeholder="";value="";required=!1;helper="";render(){return o("div",{key:"70a6dc59dc7c4367c091fa1cb69a6f9ab7936108",class:"field"},o("label",{key:"4ac58bf5d0570aeb26333b6056429dd90483fddc",htmlFor:this.name},this.label,this.required?" *":""),o("input",{key:"1146d0d67f77e85ffb058d8c705c739e5f4d8765",id:this.name,name:this.name,type:this.type,placeholder:this.placeholder,value:this.value,required:this.required}),this.helper&&o("small",{key:"1bfde2d7cbffdc08d8d97e011fc08e89619a6926"},this.helper))}static get style(){return":host{display:block}.field{display:flex;flex-direction:column;gap:8px}label{color:#555555;font-size:16px;font-weight:700}input{width:100%;height:44px;padding:12px 13px;border:1px solid #eeeeee;border-radius:10px;outline:none;background:#fafafa;color:#333333;font-family:Arial, sans-serif;font-size:14px;box-sizing:border-box;transition:border-color 0.2s ease, box-shadow 0.2s ease}input:focus{border-color:#f97316;background:white;box-shadow:0 0 0 3px rgba(163, 111, 66, 0.08)}input::placeholder{color:#bbb}small{color:#aaa;font-size:9px}"}},[513,"recipe-input",{label:[1],name:[1],type:[1],placeholder:[1],value:[1],required:[4],helper:[1]}]);function r(){"undefined"!=typeof customElements&&["recipe-input"].forEach((t=>{"recipe-input"===t&&(customElements.get(e(t))||customElements.define(e(t),s))}))}r();const l=s,a=r;export{l as RecipeInput,a as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface RecipeNavbar extends Components.RecipeNavbar, HTMLElement {}
|
|
4
|
+
export const RecipeNavbar: {
|
|
5
|
+
prototype: RecipeNavbar;
|
|
6
|
+
new (): RecipeNavbar;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as a,H as n,h as t}from"./p-DlkZDAps.js";const s=a(class extends n{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow()}currentPage="";render(){return t("nav",{key:"566b7977eb5d49698529bb053851bfd00ae3e6b7",class:"navbar"},t("a",{key:"0486dfb39ffe360a78251520ce19aeeb02f9cbe8",href:"/",class:"logo"},"🍴 Recipe Finder and Meal Planner"),t("div",{key:"3c08b289c5845dfe5845dae53e48736e04c98f73",class:"nav-links"},t("a",{key:"ca549a73243a753de94117ac0a4c1136ec43d4d3",href:"/",class:{"nav-link":!0,active:"home"===this.currentPage}},"Home"),t("a",{key:"d8fc2d2b873d7e7f1eb17e5f3e53a367811124ba",href:"/favorites",class:{"nav-link":!0,active:"favorites"===this.currentPage}},"Favorites"),t("a",{key:"de54d4a21354713ee67e5f28675d8046e8093c0c",href:"/meal-plan",class:{"nav-link":!0,active:"meal-plan"===this.currentPage}},"Meal Planner"),t("a",{key:"98a0114e219316138f9968f9b9f462ab90dc2144",href:"/my-recipes",class:{"nav-link":!0,active:"my-recipes"===this.currentPage}},"My Recipes")))}static get style(){return":host{display:block}.navbar{display:flex;align-items:center;justify-content:space-between;padding:16px 40px;background:#f97316;border-bottom:1px solid #e5e7eb}.logo{color:#ffffff;text-decoration:none;font-size:28px;font-weight:700}.nav-links{display:flex;align-items:center;gap:26px}.nav-link{color:#ffffff;text-decoration:none;font-size:15px;font-weight:600;transition:color 0.2s ease}.nav-link:hover{color:#f9b787}@media (max-width: 700px){.navbar{flex-direction:column;gap:15px;padding:15px 20px}.logo{font-size:22px;text-align:center}.nav-links{gap:15px;flex-wrap:wrap;justify-content:center}}"}},[513,"recipe-navbar",{currentPage:[1,"current-page"]}]);function c(){"undefined"!=typeof customElements&&["recipe-navbar"].forEach((a=>{"recipe-navbar"===a&&(customElements.get(e(a))||customElements.define(e(a),s))}))}c();const i=s,r=c;export{i as RecipeNavbar,r as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface RecipeTextarea extends Components.RecipeTextarea, HTMLElement {}
|
|
4
|
+
export const RecipeTextarea: {
|
|
5
|
+
prototype: RecipeTextarea;
|
|
6
|
+
new (): RecipeTextarea;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as t,H as r,h as a}from"./p-DlkZDAps.js";const o=t(class extends r{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow()}label;name;rows=5;placeholder="";value="";required=!1;render(){return a("div",{key:"65e2378ab0cd0e4d0b255aebf5db8f9dd9b7cd23",class:"field"},a("label",{key:"1806eef424c6305fc8456a9bd3209ac2cd6ccae3",htmlFor:this.name},this.label,this.required?" *":""),a("textarea",{key:"dfa80a318722b204622fc7d0935cf8fb346e2bd0",id:this.name,name:this.name,rows:this.rows,placeholder:this.placeholder,required:this.required},this.value))}static get style(){return":host{display:block}.field{display:flex;flex-direction:column;gap:8px}label{color:#555555;font-size:16px;font-weight:700}textarea{width:100%;padding:12px 13px;border:1px solid #eeeeee;border-radius:10px;outline:none;background:#fafafa;color:#333333;font-family:Arial, sans-serif;font-size:14px;line-height:1.7;resize:vertical;box-sizing:border-box;transition:border-color 0.2s ease, box-shadow 0.2s ease}textarea:focus{border-color:#f97316;background:white;box-shadow:0 0 0 3px rgba(163, 111, 66, 0.08)}textarea::placeholder{color:#bbb}"}},[513,"recipe-textarea",{label:[1],name:[1],rows:[2],placeholder:[1],value:[1],required:[4]}]);function s(){"undefined"!=typeof customElements&&["recipe-textarea"].forEach((t=>{"recipe-textarea"===t&&(customElements.get(e(t))||customElements.define(e(t),o))}))}s();const i=o,l=s;export{i as RecipeTextarea,l as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SearchFood extends Components.SearchFood, HTMLElement {}
|
|
4
|
+
export const SearchFood: {
|
|
5
|
+
prototype: SearchFood;
|
|
6
|
+
new (): SearchFood;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as r,H as a,c as t,h as s}from"./p-DlkZDAps.js";const o=r(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.searchSubmit=t(this,"searchSubmit"),this.searchClear=t(this,"searchClear")}search="";searchSubmit;searchClear;handleInput=e=>{this.search=e.target.value};handleSearch=()=>{const e=this.search.trim();e&&this.searchSubmit.emit(e)};clearSearch=()=>{this.search="",this.searchClear.emit()};render(){return s("div",{key:"aec6c865acb5f9ebcacc2fd517641085c2339303",class:"search-wrapper"},s("div",{key:"f50a9844f4bb84b0ec4e1b04df5d6198e1fe3786",class:"search-box"},s("span",{key:"013f2674aa34aeca8e8166ccc626299433230bc5",class:"search-icon","aria-hidden":"true"},"🔍"),s("input",{key:"4b8fad8626692ee6c44cacd05e48b46b00213b20",type:"text",value:this.search,placeholder:"Searching...","aria-label":"Search for a food",onInput:this.handleInput}),this.search&&s("button",{key:"15af3cda9b0394918e4ca72e313259a006edf54d",type:"button",class:"clear-button",onClick:this.clearSearch,"aria-label":"Clear search"},"×"),s("button",{key:"22cd49c7076666d2f560f83bf718eaaf7ceffbf1",type:"button",class:"search-button",onClick:this.handleSearch},"Search")))}static get style(){return":host{display:block;font-family:Arial, sans-serif}.search-wrapper{width:100%;display:flex;justify-content:center;box-sizing:border-box;padding:24px 16px}.search-box{width:100%;max-width:700px;display:flex;align-items:center;padding:6px;background:#ffffff;border:1px solid #d7d2cd;border-radius:14px;box-shadow:0 6px 20px rgba(0, 0, 0, 0.06);transition:border-color 0.2s ease, box-shadow 0.2s ease}.search-box:focus-within{border-color:#e0700f;box-shadow:0 0 0 3px rgba(163, 111, 66, 0.1), 0 8px 24px rgba(0, 0, 0, 0.07)}.search-icon{flex-shrink:0;margin-left:12px;margin-right:8px;font-size:20px}input{flex:1;min-width:0;padding:13px 8px;border:none;outline:none;background:transparent;color:#2c2c2c;font-family:Arial, sans-serif;font-size:16px}input::placeholder{color:#b7bdca}.clear-button{display:flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border:none;border-radius:50%;background:transparent;color:#999999;font-family:Arial, sans-serif;font-size:24px;cursor:pointer;transition:background-color 0.2s ease, color 0.2s ease}.clear-button:hover{background:#f5f2ef;color:#555555}.search-button{flex-shrink:0;padding:12px 22px;border:none;border-radius:10px;background:#f97316;color:#ffffff;font-family:Arial, sans-serif;font-size:14px;font-weight:600;cursor:pointer;transition:background-color 0.2s ease, transform 0.2s ease}.search-button:hover{background:#f97316;transform:translateY(-1px)}.search-button:active{transform:translateY(0)}@media (max-width: 600px){.search-wrapper{padding:18px 12px}.search-box{border-radius:12px}input{font-size:14px}.search-button{padding:11px 15px;font-size:13px}}@media (prefers-reduced-motion: reduce){.search-box,.clear-button,.search-button{transition:none}}"}},[513,"search-food",{search:[1025]}]);function n(){"undefined"!=typeof customElements&&["search-food"].forEach((r=>{"search-food"===r&&(customElements.get(e(r))||customElements.define(e(r),o))}))}n();const c=o,i=n;export{c as SearchFood,i as defineCustomElement}
|