recipe-planner-ui 1.0.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.
- package/LICENSE +21 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/index-B6uIqnrk.js +2043 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/recipe-planner-ui.cjs.js +25 -0
- package/dist/cjs/rp-day-slot.cjs.entry.js +57 -0
- package/dist/cjs/rp-filter-chips_5.cjs.entry.js +240 -0
- package/dist/collection/collection-manifest.json +18 -0
- package/dist/collection/components/rp-day-slot/rp-day-slot.css +131 -0
- package/dist/collection/components/rp-day-slot/rp-day-slot.js +201 -0
- package/dist/collection/components/rp-filter-chips/rp-filter-chips.css +36 -0
- package/dist/collection/components/rp-filter-chips/rp-filter-chips.js +123 -0
- package/dist/collection/components/rp-ingredient-list/rp-ingredient-list.css +53 -0
- package/dist/collection/components/rp-ingredient-list/rp-ingredient-list.js +57 -0
- package/dist/collection/components/rp-modal/rp-modal.css +94 -0
- package/dist/collection/components/rp-modal/rp-modal.js +196 -0
- package/dist/collection/components/rp-recipe-card/rp-recipe-card.css +106 -0
- package/dist/collection/components/rp-recipe-card/rp-recipe-card.js +170 -0
- package/dist/collection/components/rp-search-bar/rp-search-bar.css +65 -0
- package/dist/collection/components/rp-search-bar/rp-search-bar.js +166 -0
- package/dist/collection/index.js +1 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/rp-day-slot.d.ts +11 -0
- package/dist/components/rp-day-slot.js +1 -0
- package/dist/components/rp-filter-chips.d.ts +11 -0
- package/dist/components/rp-filter-chips.js +1 -0
- package/dist/components/rp-ingredient-list.d.ts +11 -0
- package/dist/components/rp-ingredient-list.js +1 -0
- package/dist/components/rp-modal.d.ts +11 -0
- package/dist/components/rp-modal.js +1 -0
- package/dist/components/rp-recipe-card.d.ts +11 -0
- package/dist/components/rp-recipe-card.js +1 -0
- package/dist/components/rp-search-bar.d.ts +11 -0
- package/dist/components/rp-search-bar.js +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/index-B4wAFfci.js +2034 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/recipe-planner-ui.js +21 -0
- package/dist/esm/rp-day-slot.entry.js +55 -0
- package/dist/esm/rp-filter-chips_5.entry.js +234 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/recipe-planner-ui/index.esm.js +0 -0
- package/dist/recipe-planner-ui/p-66ba2983.entry.js +1 -0
- package/dist/recipe-planner-ui/p-B4wAFfci.js +3 -0
- package/dist/recipe-planner-ui/p-DQuL1Twl.js +1 -0
- package/dist/recipe-planner-ui/p-d54dbd37.entry.js +1 -0
- package/dist/recipe-planner-ui/recipe-planner-ui.css +1 -0
- package/dist/recipe-planner-ui/recipe-planner-ui.esm.js +1 -0
- package/dist/types/components/rp-day-slot/rp-day-slot.d.ts +41 -0
- package/dist/types/components/rp-filter-chips/rp-filter-chips.d.ts +24 -0
- package/dist/types/components/rp-ingredient-list/rp-ingredient-list.d.ts +14 -0
- package/dist/types/components/rp-modal/rp-modal.d.ts +34 -0
- package/dist/types/components/rp-recipe-card/rp-recipe-card.d.ts +36 -0
- package/dist/types/components/rp-search-bar/rp-search-bar.d.ts +31 -0
- package/dist/types/components.d.ts +536 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/stencil-public-runtime.d.ts +1873 -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 +72 -0
- package/readme.md +131 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* A search input that emits on submit rather than on every keystroke.
|
|
4
|
+
*
|
|
5
|
+
* Per-keystroke events would race the consumer's own navigation: each one triggers a
|
|
6
|
+
* server round trip, and a slow response can land after the user has typed more,
|
|
7
|
+
* overwriting the field. Submitting explicitly keeps the interaction deterministic.
|
|
8
|
+
*/
|
|
9
|
+
export class SearchBar {
|
|
10
|
+
/** Initial query text. Changing it externally resets the field. */
|
|
11
|
+
value = '';
|
|
12
|
+
/** Placeholder shown when the field is empty. */
|
|
13
|
+
placeholder = 'Search recipes';
|
|
14
|
+
/** Accessible label for the input. */
|
|
15
|
+
label = 'Search recipes';
|
|
16
|
+
/**
|
|
17
|
+
* Live field contents. Held internally so typing does not require a round trip
|
|
18
|
+
* through the consumer, while `value` remains the externally controlled seed.
|
|
19
|
+
*/
|
|
20
|
+
draft = '';
|
|
21
|
+
/** Fired on submit with the trimmed query. */
|
|
22
|
+
rpSearch;
|
|
23
|
+
/** Fired when the user clears a non-empty field. */
|
|
24
|
+
rpClear;
|
|
25
|
+
onValueChange(next) {
|
|
26
|
+
this.draft = next ?? '';
|
|
27
|
+
}
|
|
28
|
+
componentWillLoad() {
|
|
29
|
+
this.draft = this.value ?? '';
|
|
30
|
+
}
|
|
31
|
+
onSubmit = (event) => {
|
|
32
|
+
// The host page owns navigation, so the native GET submission must not fire.
|
|
33
|
+
event.preventDefault();
|
|
34
|
+
this.rpSearch.emit(this.draft.trim());
|
|
35
|
+
};
|
|
36
|
+
onInput = (event) => {
|
|
37
|
+
this.draft = event.target.value;
|
|
38
|
+
};
|
|
39
|
+
onClear = () => {
|
|
40
|
+
this.draft = '';
|
|
41
|
+
this.rpClear.emit();
|
|
42
|
+
};
|
|
43
|
+
render() {
|
|
44
|
+
return (h(Host, { key: '12550f4e6587473576e211fe1cfa5d075a02399f' }, h("form", { key: 'e1a61e15c159e8449770b7df63a649d84b136aa2', class: "bar", role: "search", onSubmit: this.onSubmit }, h("input", { key: 'defae81130bf361beae8a57c15633c6595437493', type: "search", class: "field", value: this.draft, placeholder: this.placeholder, "aria-label": this.label, onInput: this.onInput }), this.draft && (h("button", { key: '4cd2eac81b32f17d18e89c51a90e0a0d9edf7d01', type: "button", class: "clear", onClick: this.onClear, "aria-label": "Clear search" }, "\u00D7")), h("button", { key: 'b07034ed131233623d8edbdd16db3cfd8ffab4b7', type: "submit", class: "submit" }, "Search"))));
|
|
45
|
+
}
|
|
46
|
+
static get is() { return "rp-search-bar"; }
|
|
47
|
+
static get encapsulation() { return "scoped"; }
|
|
48
|
+
static get originalStyleUrls() {
|
|
49
|
+
return {
|
|
50
|
+
"$": ["rp-search-bar.css"]
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
static get styleUrls() {
|
|
54
|
+
return {
|
|
55
|
+
"$": ["rp-search-bar.css"]
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
static get properties() {
|
|
59
|
+
return {
|
|
60
|
+
"value": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"mutable": false,
|
|
63
|
+
"complexType": {
|
|
64
|
+
"original": "string",
|
|
65
|
+
"resolved": "string",
|
|
66
|
+
"references": {}
|
|
67
|
+
},
|
|
68
|
+
"required": false,
|
|
69
|
+
"optional": false,
|
|
70
|
+
"docs": {
|
|
71
|
+
"tags": [],
|
|
72
|
+
"text": "Initial query text. Changing it externally resets the field."
|
|
73
|
+
},
|
|
74
|
+
"getter": false,
|
|
75
|
+
"setter": false,
|
|
76
|
+
"reflect": false,
|
|
77
|
+
"attribute": "value",
|
|
78
|
+
"defaultValue": "''"
|
|
79
|
+
},
|
|
80
|
+
"placeholder": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"mutable": false,
|
|
83
|
+
"complexType": {
|
|
84
|
+
"original": "string",
|
|
85
|
+
"resolved": "string",
|
|
86
|
+
"references": {}
|
|
87
|
+
},
|
|
88
|
+
"required": false,
|
|
89
|
+
"optional": false,
|
|
90
|
+
"docs": {
|
|
91
|
+
"tags": [],
|
|
92
|
+
"text": "Placeholder shown when the field is empty."
|
|
93
|
+
},
|
|
94
|
+
"getter": false,
|
|
95
|
+
"setter": false,
|
|
96
|
+
"reflect": false,
|
|
97
|
+
"attribute": "placeholder",
|
|
98
|
+
"defaultValue": "'Search recipes'"
|
|
99
|
+
},
|
|
100
|
+
"label": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"mutable": false,
|
|
103
|
+
"complexType": {
|
|
104
|
+
"original": "string",
|
|
105
|
+
"resolved": "string",
|
|
106
|
+
"references": {}
|
|
107
|
+
},
|
|
108
|
+
"required": false,
|
|
109
|
+
"optional": false,
|
|
110
|
+
"docs": {
|
|
111
|
+
"tags": [],
|
|
112
|
+
"text": "Accessible label for the input."
|
|
113
|
+
},
|
|
114
|
+
"getter": false,
|
|
115
|
+
"setter": false,
|
|
116
|
+
"reflect": false,
|
|
117
|
+
"attribute": "label",
|
|
118
|
+
"defaultValue": "'Search recipes'"
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
static get states() {
|
|
123
|
+
return {
|
|
124
|
+
"draft": {}
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
static get events() {
|
|
128
|
+
return [{
|
|
129
|
+
"method": "rpSearch",
|
|
130
|
+
"name": "rpSearch",
|
|
131
|
+
"bubbles": true,
|
|
132
|
+
"cancelable": true,
|
|
133
|
+
"composed": true,
|
|
134
|
+
"docs": {
|
|
135
|
+
"tags": [],
|
|
136
|
+
"text": "Fired on submit with the trimmed query."
|
|
137
|
+
},
|
|
138
|
+
"complexType": {
|
|
139
|
+
"original": "string",
|
|
140
|
+
"resolved": "string",
|
|
141
|
+
"references": {}
|
|
142
|
+
}
|
|
143
|
+
}, {
|
|
144
|
+
"method": "rpClear",
|
|
145
|
+
"name": "rpClear",
|
|
146
|
+
"bubbles": true,
|
|
147
|
+
"cancelable": true,
|
|
148
|
+
"composed": true,
|
|
149
|
+
"docs": {
|
|
150
|
+
"tags": [],
|
|
151
|
+
"text": "Fired when the user clears a non-empty field."
|
|
152
|
+
},
|
|
153
|
+
"complexType": {
|
|
154
|
+
"original": "void",
|
|
155
|
+
"resolved": "void",
|
|
156
|
+
"references": {}
|
|
157
|
+
}
|
|
158
|
+
}];
|
|
159
|
+
}
|
|
160
|
+
static get watchers() {
|
|
161
|
+
return [{
|
|
162
|
+
"propName": "value",
|
|
163
|
+
"methodName": "onValueChange"
|
|
164
|
+
}];
|
|
165
|
+
}
|
|
166
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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
|
+
function t(t,e,n){const o="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==o;){const o=Object.getOwnPropertyDescriptor(t,e);if(o&&(!n||o.get))return o;t=Object.getPrototypeOf(t)}}var e=(e,n)=>{var o;Object.entries(null!=(o=n.o.t)?o:{}).map((([o,[l]])=>{if(31&l||32&l){const l=e[o],s=t(Object.getPrototypeOf(e),o,!0)||Object.getOwnPropertyDescriptor(e,o);s&&Object.defineProperty(e,o,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),n.l.has(o)?e[o]=n.l.get(o):void 0!==l&&(e[o]=l)}}))},n=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},o=(t,e)=>e in t,l=(t,e)=>(0,console.error)(t,e),s=new Map,i="undefined"!=typeof window?window:{},r=i.HTMLElement||class{},c={i:0,u:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},f=(()=>{try{return!!i.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),u=!!f&&(()=>!!i.document&&Object.getOwnPropertyDescriptor(i.document.adoptedStyleSheets,"length").writable)(),a=!1,d=[],p=[],h=()=>{var t;return(null==(t=i.document)?void 0:t.hidden)?y(m):c.raf(m)},v=(t,e)=>n=>{t.push(n),a||(a=!0,e&&4&c.i?y(m):h())},b=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){l(t)}t.length=0},m=()=>{b(d),b(p),(a=d.length>0)&&h()},y=t=>Promise.resolve(void 0).then(t),$=v(p,!0),g=t=>{const e=new URL(t,c.u);return e.origin!==i.location.origin?e.href:e.pathname},w=t=>c.u=t,j=t=>{const e=M(t,"childNodes");t.tagName&&t.tagName.includes("-")&&t["s-cr"]&&"SLOT-FB"!==t.tagName&&O(e,t.tagName).forEach((t=>{1===t.nodeType&&"SLOT-FB"===t.tagName&&(t.hidden=!!S(t,N(t),!1).length)}));let n=0;for(n=0;n<e.length;n++){const t=e[n];1===t.nodeType&&M(t,"childNodes").length&&j(t)}};function O(t,e,n){let o,l=0,s=[];for(;l<t.length;l++){if(o=t[l],o["s-sr"]&&(!e||o["s-hn"]===e)&&(void 0===n||N(o)===n)&&(s.push(o),void 0!==n))return s;s=[...s,...O(M(o,"childNodes"),e,n)]}return s}var S=(t,e,n=!0)=>{const o=[];(n&&t["s-sr"]||!t["s-sr"])&&o.push(t);let l=t;for(;l=l.nextSibling;)N(l)!==e||!n&&l["s-sr"]||o.push(l);return o},k=(t,e)=>1===t.nodeType?null===t.getAttribute("slot")&&""===e||t.getAttribute("slot")===e:t["s-sn"]===e||""===e,N=t=>"string"==typeof t["s-sn"]?t["s-sn"]:1===t.nodeType&&t.getAttribute("slot")||void 0;function M(t,e){if("__"+e in t){const n=t["__"+e];return"function"!=typeof n?n:n.bind(t)}return"function"!=typeof t[e]?t[e]:t[e].bind(t)}var E,_,A,C=new WeakMap,L=t=>"sc-"+t.p,R=t=>"object"==(t=typeof t)||"function"===t,T=(t,e,...n)=>{let o=null,s=null,i=null,r=!1,c=!1;const f=[],u=e=>{for(let n=0;n<e.length;n++)if(o=e[n],Array.isArray(o))u(o);else if(null!=o&&"boolean"!=typeof o){if(r="function"!=typeof t&&!R(o))o+="";else if("function"!=typeof t&&void 0===o.i){l("Invalid vNode child");continue}r&&c?f[f.length-1].h+=o:f.push(r?x(null,o):o),c=r}};if(u(n),e){e.key&&(s=e.key),e.name&&(i=e.name);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}const a=x(t,null);return a.v=e,f.length>0&&(a.m=f),a.$=s,a.j=i,a},x=(t,e)=>({i:0,O:t,h:null!=e?e:null,S:null,m:null,v:null,$:null,j:null}),F={},D=t=>{if(!t)return;const e=Object.keys(t);if(0===e.length)return;let n=!1;for(const o of e){if(n)break;for(const e of t[o])if("string"==typeof e){n=!0;break}}if(!n)return t;const o={};for(const n of e)o[n]=t[n].map((t=>"string"==typeof t?{[t]:0}:t));return o},H=(t,e)=>null==t||R(t)?t:4&e?"false"!==t&&(""===t||!!t):1&e?t+"":t,P=(t,e)=>{const n=t;return{emit:t=>W(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},W=(t,e,n)=>{const o=c.ce(e,n);return t.dispatchEvent(o),o},U=(t,e,l,s,r,f)=>{if(l===s)return;let u=o(t,e),a=e.toLowerCase();if("class"===e){const e=t.classList,n=z(l);let o=z(s);e.remove(...n.filter((t=>t&&!o.includes(t)))),e.add(...o.filter((t=>t&&!n.includes(t))))}else if("key"===e);else if(t.__lookupSetter__(e)||"o"!==e[0]||"n"!==e[1]){if("a"===e[0]&&e.startsWith("attr:")){const o=e.slice(5);let l;{const e=n(t);if(e&&e.o&&e.o.t){const t=e.o.t[o];t&&t[1]&&(l=t[1])}}return l||(l=o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==s||!1===s?!1===s&&""!==t.getAttribute(l)||t.removeAttribute(l):t.setAttribute(l,!0===s?"":s))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=s}catch(t){}return}{const n=R(s);if((u||n&&null!==s)&&!r)try{if(t.tagName.includes("-"))t[e]!==s&&(t[e]=s);else{const n=null==s?"":s;"list"===e?u=!1:null!=l&&t[e]===n||("function"==typeof t.__lookupSetter__(e)?t[e]=n:t.setAttribute(e,n))}}catch(t){}null==s||!1===s?(!1!==s||""===t.getAttribute(e)||4&f&&!V(e))&&t.removeAttribute(e):(!u||4&f||r)&&!n&&1===t.nodeType&&t.setAttribute(e,s=!0===s?"":s)}}else if(e="-"===e[2]?e.slice(3):o(i,a)?a.slice(2):a[2]+e.slice(3),l||s){const n=e.endsWith(I);e=e.replace(Y,""),l&&c.rel(t,e,l,n),s&&c.ael(t,e,s,n)}},B=new Set(["draggable","contenteditable","spellcheck"]),V=t=>B.has(t)||t.startsWith("aria-"),q=/\s/,z=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(q):[]),I="Capture",Y=RegExp(I+"$"),Z=(t,e,n)=>{const o=11===e.S.nodeType&&e.S.host?e.S.host:e.S,l=t&&t.v||{},s=e.v||{};for(const t of G(Object.keys(l)))t in s||U(o,t,l[t],void 0,n,e.i);for(const t of G(Object.keys(s)))U(o,t,l[t],s[t],n,e.i)};function G(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var J=!1,K=!1,Q=!1,X=!1,tt=(t,e,n)=>{var o;const l=e.m[n];let s,r,c,f=0;if(J||(Q=!0,"slot"===l.O&&(l.i|=l.m?2:1)),null!=l.h)s=l.S=i.document.createTextNode(l.h);else if(1&l.i)s=l.S=i.document.createTextNode(""),Z(null,l,X);else{if(X||(X="svg"===l.O),!i.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(s=l.S=i.document.createElementNS(X?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",!J&&2&l.i?"slot-fb":l.O),X&&"foreignObject"===l.O&&(X=!1),Z(null,l,X),null!=E&&void 0!==E&&s["s-si"]!==E&&s.classList.add(s["s-si"]=E),l.m){const e="template"===l.O?s.content:s;for(f=0;f<l.m.length;++f)r=tt(t,l,f),r&&e.appendChild(r)}"svg"===l.O?X=!1:"foreignObject"===s.tagName&&(X=!0)}return s["s-hn"]=A,3&l.i&&(s["s-sr"]=!0,s["s-cr"]=_,s["s-sn"]=l.j||"",s["s-rf"]=null==(o=l.v)?void 0:o.ref,function(t){if(t.assignedElements||t.assignedNodes||!t["s-sr"])return;const e=e=>function(t){const n=[],o=this["s-sn"];(null==t?void 0:t.flatten)&&console.error("\n Flattening is not supported for Stencil non-shadow slots.\n You can use `.childNodes` to nested slot fallback content.\n If you have a particular use case, please open an issue on the Stencil repo.\n ");const l=this["s-cr"].parentElement;return(l.__childNodes?l.childNodes:(t=>{const e=[];for(let n=0;n<t.length;n++){const o=t[n]["s-nr"]||void 0;o&&o.isConnected&&e.push(o)}return e})(l.childNodes)).forEach((t=>{o===N(t)&&n.push(t)})),e?n.filter((t=>1===t.nodeType)):n}.bind(t);t.assignedElements=e(!0),t.assignedNodes=e(!1)}(s),c=t&&t.m&&t.m[n],c&&c.O===l.O&&t.S&&et(t.S),at(_,s,e.S,null==t?void 0:t.S)),s},et=t=>{c.i|=1;const e=t.closest(A.toLowerCase());if(null!=e){const n=Array.from(e.__childNodes||e.childNodes).find((t=>t["s-cr"])),o=Array.from(t.__childNodes||t.childNodes);for(const t of n?o.reverse():o)null!=t["s-sh"]&&(ut(e,t,null!=n?n:null),t["s-sh"]=void 0,Q=!0)}c.i&=-2},nt=(t,e)=>{c.i|=1;const n=Array.from(t.__childNodes||t.childNodes);if(t["s-sr"]){let e=t;for(;e=e.nextSibling;)e&&e["s-sn"]===t["s-sn"]&&e["s-sh"]===A&&n.push(e)}for(let t=n.length-1;t>=0;t--){const o=n[t];o["s-hn"]!==A&&o["s-ol"]&&(ut(it(o).parentNode,o,it(o)),o["s-ol"].remove(),o["s-ol"]=void 0,o["s-sh"]=void 0,Q=!0),e&&nt(o,e)}c.i&=-2},ot=(t,e,n,o,l,s)=>{let i,r=t["s-cr"]&&t["s-cr"].parentNode||t;for("template"===n.O&&(r=r.content);l<=s;++l)o[l]&&(i=tt(null,n,l),i&&(o[l].S=i,ut(r,i,it(e))))},lt=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.S;t&&(K=!0,t["s-ol"]?t["s-ol"].remove():nt(t,!0),t.remove())}}},st=(t,e,n=!1)=>t.O===e.O&&("slot"===t.O?t.j===e.j:n?(n&&!t.$&&e.$&&(t.$=e.$),!0):t.$===e.$),it=t=>t&&t["s-ol"]||t,rt=(t,e,n=!1)=>{const o=e.S=t.S,l=t.m,s=e.m,i=e.O,r=e.h;let c;null==r?(X="svg"===i||"foreignObject"!==i&&X,"slot"!==i||J||t.j!==e.j&&(e.S["s-sn"]=e.j||"",et(e.S.parentElement)),Z(t,e,X),null!==l&&null!==s?((t,e,n,o,l=!1)=>{let s,i,r=0,c=0,f=0,u=0,a=e.length-1,d=e[0],p=e[a],h=o.length-1,v=o[0],b=o[h];const m="template"===n.O?t.content:t;for(;r<=a&&c<=h;)if(null==d)d=e[++r];else if(null==p)p=e[--a];else if(null==v)v=o[++c];else if(null==b)b=o[--h];else if(st(d,v,l))rt(d,v,l),d=e[++r],v=o[++c];else if(st(p,b,l))rt(p,b,l),p=e[--a],b=o[--h];else if(st(d,b,l))"slot"!==d.O&&"slot"!==b.O||nt(d.S.parentNode,!1),rt(d,b,l),ut(m,d.S,p.S.nextSibling),d=e[++r],b=o[--h];else if(st(p,v,l))"slot"!==d.O&&"slot"!==b.O||nt(p.S.parentNode,!1),rt(p,v,l),ut(m,p.S,d.S),p=e[--a],v=o[++c];else{for(f=-1,u=r;u<=a;++u)if(e[u]&&null!==e[u].$&&e[u].$===v.$){f=u;break}f>=0?(i=e[f],i.O!==v.O?s=tt(e&&e[c],n,f):(rt(i,v,l),e[f]=void 0,s=i.S),v=o[++c]):(s=tt(e&&e[c],n,c),v=o[++c]),s&&ut(it(d.S).parentNode,s,it(d.S))}r>a?ot(t,null==o[h+1]?null:o[h+1].S,n,o,c,h):c>h&<(e,r,a)})(o,l,e,s,n):null!==s?(null!==t.h&&(o.textContent=""),ot(o,null,e,s,0,s.length-1)):!n&&null!==l&<(l,0,l.length-1),X&&"svg"===i&&(X=!1)):(c=o["s-cr"])?c.parentNode.textContent=r:t.h!==r&&(o.data=r)},ct=[],ft=t=>{let e,n,o;const l=t.__childNodes||t.childNodes;for(const t of l){if(t["s-sr"]&&(e=t["s-cr"])&&e.parentNode){n=e.parentNode.__childNodes||e.parentNode.childNodes;const l=t["s-sn"];for(o=n.length-1;o>=0;o--)if(e=n[o],!e["s-cn"]&&!e["s-nr"]&&e["s-hn"]!==t["s-hn"]&&(!e["s-sh"]||e["s-sh"]!==t["s-hn"]||""!==l&&N(e)===l))if(k(e,l)){let n=ct.find((t=>t.k===e));K=!0,e["s-sn"]=e["s-sn"]||l,n?(n.k["s-sh"]=t["s-hn"],n.N=t):(e["s-sh"]=t["s-hn"],ct.push({N:t,k:e})),e["s-sr"]&&ct.map((t=>{k(t.k,e["s-sn"])&&(n=ct.find((t=>t.k===e)),n&&!t.N&&(t.N=n.N))}))}else ct.some((t=>t.k===e))||ct.push({k:e})}1===t.nodeType&&ft(t)}},ut=(t,e,n,o)=>{if("string"==typeof e["s-sn"]&&e["s-sr"]&&e["s-cr"])at(e["s-cr"],e,t,e.parentElement);else if("string"==typeof e["s-sn"]){t.insertBefore(e,n);const{slotNode:l}=function(t,e){var n;if(!(e=e||(null==(n=t["s-ol"])?void 0:n.parentElement)))return{slotNode:null,slotName:""};const o=t["s-sn"]=N(t)||"";return{slotNode:O(M(e,"childNodes"),e.tagName,o)[0],slotName:o}}(e);return l&&!o&&function(t){t.dispatchEvent(new CustomEvent("slotchange",{bubbles:!1,cancelable:!1,composed:!1}))}(l),e}return(null==t?void 0:t.__insertBefore)?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n)};function at(t,e,n,o){var l,s;let i;if(t&&"string"==typeof e["s-sn"]&&e["s-sr"]&&t.parentNode&&t.parentNode["s-sc"]&&(i=e["s-si"]||t.parentNode["s-sc"])){const t=e["s-sn"],r=e["s-hn"];if(null==(l=n.classList)||l.add(i+"-s"),o&&(null==(s=o.classList)?void 0:s.contains(i+"-s"))){let e=(o.__childNodes||o.childNodes)[0],n=!1;for(;e;){if(e["s-sn"]!==t&&e["s-hn"]===r&&e["s-sr"]){n=!0;break}e=e.nextSibling}n||o.classList.remove(i+"-s")}}}var dt=(t,e,n=!1)=>{var o,l,s,r,f;const u=t.$hostElement$,a=t.o,d=t.M||x(null,null),p=(t=>t&&t.O===F)(e)?e:T(null,null,e);if(A=u.tagName,a._&&(p.v=p.v||{},a._.forEach((([t,e])=>{p.v[e]=u[t]}))),n&&p.v)for(const t of Object.keys(p.v))u.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(p.v[t]=u[t]);if(p.O=null,p.i|=4,t.M=p,p.S=d.S=u,E=u["s-sc"],J=false,_=u["s-cr"],K=!1,rt(d,p,n),c.i|=1,Q){ft(p.S);for(const t of ct){const e=t.k;if(!e["s-ol"]&&i.document){const t=i.document.createTextNode("");t["s-nr"]=e,ut(e.parentNode,e["s-ol"]=t,e,n)}}for(const t of ct){const e=t.k,c=t.N;if(1===e.nodeType&&n&&(e["s-ih"]=null!=(o=e.hidden)&&o),c){const t=c.parentNode;let o=c.nextSibling;if(o&&1===o.nodeType){let n=null==(l=e["s-ol"])?void 0:l.previousSibling;for(;n;){let l=null!=(s=n["s-nr"])?s:null;if(l&&l["s-sn"]===e["s-sn"]&&t===(l.__parentNode||l.parentNode)){for(l=l.nextSibling;l===e||(null==l?void 0:l["s-sr"]);)l=null==l?void 0:l.nextSibling;if(!l||!l["s-nr"]){o=l;break}}n=n.previousSibling}}if((!o&&t!==(e.__parentNode||e.parentNode)||(e.__nextSibling||e.nextSibling)!==o)&&e!==o){if(ut(t,e,o,n),8===e.nodeType&&e.nodeValue.startsWith("s-nt-")){const t=i.document.createTextNode(e.nodeValue.replace(/^s-nt-/,""));t["s-hn"]=e["s-hn"],t["s-sn"]=e["s-sn"],t["s-sh"]=e["s-sh"],t["s-sr"]=e["s-sr"],t["s-ol"]=e["s-ol"],t["s-ol"]["s-nr"]=t,ut(e.parentNode,t,e,n),e.parentNode.removeChild(e)}1===e.nodeType&&"SLOT-FB"!==e.tagName&&(e.hidden=null!=(r=e["s-ih"])&&r)}e&&"function"==typeof c["s-rf"]&&c["s-rf"](c)}else 1===e.nodeType&&(e.hidden=!0)}}if(K&&j(p.S),c.i&=-2,ct.length=0,!J&&!(1&a.i)&&u["s-cr"]){const t=p.S.__childNodes||p.S.childNodes;for(const e of t)if(e["s-hn"]!==A&&!e["s-sh"])if(n&&null==e["s-ih"]&&(e["s-ih"]=null!=(f=e.hidden)&&f),1===e.nodeType)e.hidden=!0;else if(3===e.nodeType&&e.nodeValue.trim()){const t=i.document.createComment("s-nt-"+e.nodeValue);t["s-sn"]=e["s-sn"],ut(e.parentNode,t,e,n),e.parentNode.removeChild(e)}}_=void 0},pt=(t,e)=>{if(e&&!t.A&&e["s-p"]){const n=e["s-p"].push(new Promise((o=>t.A=()=>{e["s-p"].splice(n-1,1),o()})))}},ht=(t,e)=>{if(t.i|=16,4&t.i)return void(t.i|=512);pt(t,t.C);const n=()=>vt(t,e);if(!e)return $(n);queueMicrotask((()=>{n()}))},vt=(t,e)=>{const n=t.$hostElement$,o=n;if(!o)throw 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 l;return l=jt(o,e?"componentWillLoad":"componentWillUpdate",void 0,n),l=bt(l,(()=>jt(o,"componentWillRender",void 0,n))),bt(l,(()=>yt(t,o,e)))},bt=(t,e)=>mt(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),mt=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,yt=async(t,e,n)=>{var o;const l=t.$hostElement$,r=l["s-rc"];n&&(t=>{const e=t.o,n=t.$hostElement$,o=e.i,l=((t,e)=>{var n,o,l;const r=L(e),a=s.get(r);if(!i.document)return r;if(t=11===t.nodeType?t:i.document,a)if("string"==typeof a){let l,s=C.get(t=t.head||t);if(s||C.set(t,s=new Set),!s.has(r)){l=i.document.createElement("style"),l.textContent=a;const d=null!=(n=c.L)?n:function(){var t,e,n;return null!=(n=null==(e=null==(t=i.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:e.getAttribute("content"))?n:void 0}();if(null!=d&&l.setAttribute("nonce",d),!(1&e.i))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(l,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(f){const e=new(null!=(o=t.defaultView)?o:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(a),u?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=a+e.textContent:t.prepend(l)}else t.append(l);1&e.i&&t.insertBefore(l,null),4&e.i&&(l.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),s&&s.add(r)}}else{let e=C.get(t);if(e||C.set(t,e=new Set),!e.has(r)){const n=null!=(l=t.defaultView)?l:t.ownerDocument.defaultView;let o;if(a.constructor===n.CSSStyleSheet)o=a;else{o=new n.CSSStyleSheet;for(let t=0;t<a.cssRules.length;t++)o.insertRule(a.cssRules[t].cssText,t)}u?t.adoptedStyleSheets.push(o):t.adoptedStyleSheets=[...t.adoptedStyleSheets,o],e.add(r)}}return r})(n.getRootNode(),e);10&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);$t(t,e,l,n),r&&(r.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>gt(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.i|=4,e.length=0)}},$t=(t,e,n,o)=>{try{e=e.render(),t.i&=-17,t.i|=2,dt(t,e,o)}catch(e){l(e,t.$hostElement$)}return null},gt=t=>{const e=t.$hostElement$,n=e,o=t.C;jt(n,"componentDidRender",void 0,e),64&t.i?jt(n,"componentDidUpdate",void 0,e):(t.i|=64,Ot(e),jt(n,"componentDidLoad",void 0,e),t.R(e),o||wt()),t.A&&(t.A(),t.A=void 0),512&t.i&&y((()=>ht(t,!1))),t.i&=-517},wt=()=>{y((()=>W(i,"appload",{detail:{namespace:"recipe-planner-ui"}})))},jt=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){l(t,o)}},Ot=t=>t.classList.add("hydrated"),St=(t,e,o,s)=>{const i=n(t);if(!i)return;const r=t,c=i.l.get(e),f=i.i,u=r;if(!((o=H(o,s.t[e][0]))===c||Number.isNaN(c)&&Number.isNaN(o))){if(i.l.set(e,o),s.T){const t=s.T[e];t&&t.map((t=>{try{const[[n,l]]=Object.entries(t);(128&f||1&l)&&(u?u[n](o,c,e):i.F.push((()=>{i.D[n](o,c,e)})))}catch(t){l(t,r)}}))}if(2&f){if(u.componentShouldUpdate&&!1===u.componentShouldUpdate(o,c,e)&&!(16&f))return;16&f||ht(i,!1)}}},kt=(e,o)=>{var l,s;const i=e.prototype;{e.watchers&&!o.T&&(o.T=D(e.watchers)),e.deserializers&&!o.H&&(o.H=e.deserializers),e.serializers&&!o.P&&(o.P=e.serializers);const r=Object.entries(null!=(l=o.t)?l:{});r.map((([e,[l]])=>{if(31&l||32&l){const{get:s,set:r}=t(i,e)||{};s&&(o.t[e][0]|=2048),r&&(o.t[e][0]|=4096),Object.defineProperty(i,e,{get(){return s?s.apply(this):((t,e)=>n(this).l.get(e))(0,e)},configurable:!0,enumerable:!0}),Object.defineProperty(i,e,{set(t){const s=n(this);if(s){if(r)return void 0===(32&l?this[e]:s.$hostElement$[e])&&s.l.get(e)&&(t=s.l.get(e)),r.call(this,H(t,l)),void St(this,e,t=32&l?this[e]:s.$hostElement$[e],o);St(this,e,t,o)}}})}}));{const t=new Map;i.attributeChangedCallback=function(e,l,s){c.jmp((()=>{var c;const f=t.get(e),u=n(this);if(this.hasOwnProperty(f),i.hasOwnProperty(f)&&"number"==typeof this[f]&&this[f]==s)return;if(null==f){const t=null==u?void 0:u.i;if(u&&t&&!(8&t)&&s!==l){const n=this,i=null==(c=o.T)?void 0:c[e];null==i||i.forEach((o=>{const[[i,r]]=Object.entries(o);null!=n[i]&&(128&t||1&r)&&n[i].call(n,s,l,e)}))}return}const a=r.find((([t])=>t===f)),d=a&&4&a[1][0],p=d&&null===s&&void 0===this[f];d&&(s=null!==s&&"false"!==s);const h=Object.getOwnPropertyDescriptor(i,f);p||s==this[f]||h.get&&!h.set||(this[f]=s)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=o.T)?s:{}),...r.filter((([t,e])=>31&e[0])).map((([e,n])=>{var l;const s=n[1]||e;return t.set(s,e),512&n[0]&&(null==(l=o._)||l.push([e,s])),s}))]))}}return e},Nt=async(t,e,n)=>{let o;try{if(!(32&e.i)&&(e.i|=32,e.i&=-1025,o=t.constructor,customElements.whenDefined(t.localName).then((()=>e.i|=128)),o&&o.style)){let t;"string"==typeof o.style&&(t=o.style);const e=L(n);if(!s.has(e)){const o=()=>{};((t,e,n)=>{let o=s.get(t);f&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,s.set(t,o)})(e,t,!!(1&n.i)),o()}}const l=e.C,i=()=>ht(e,!0);l&&l["s-rc"]?l["s-rc"].push(i):i()}catch(n){l(n,t),e.A&&(e.A(),e.A=void 0),!e.R||1024&e.i||e.R(t)}},Mt=(t,o)=>{const s={i:o[0],p:o[1]};try{s.t=o[2],s.T=D(t.T),s.H=t.H,s.P=t.P,s._=[];const l=t.prototype.connectedCallback,r=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){((t,n)=>{const o={i:0,$hostElement$:t,o:n,l:new Map,W:new Map};o.U=new Promise((t=>o.R=t)),t["s-p"]=[],t["s-rc"]=[];const l=o;t.__stencil__getHostRef=()=>l,512&n.i&&e(t,o)})(this,s)},connectedCallback(){if(!this.__hasHostListenerAttached){if(!n(this))return;this.__hasHostListenerAttached=!0}(t=>{if(!(1&c.i)){const e=n(t);if(!e)return;const o=e.o,l=()=>{};if(1&e.i)(null==e?void 0:e.D)||(1024&e.i?setTimeout((()=>Nt(t,e,o)),1e3):(null==e?void 0:e.U)&&e.U.then((()=>{})));else{e.i|=1,12&o.i&&(t=>{if(!i.document)return;const e=t["s-cr"]=i.document.createComment("");e["s-cn"]=!0,ut(t,e,t.firstChild)})(t);{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){pt(e,e.C=n);break}}o.t&&Object.entries(o.t).map((([e,[n]])=>{if(31&n&&Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];delete t[e],t[e]=n}})),Nt(t,e,o)}l()}})(this),l&&l.call(this)},disconnectedCallback(){(async t=>{C.has(t)&&C.delete(t),t.shadowRoot&&C.has(t.shadowRoot)&&C.delete(t.shadowRoot)})(this),r&&r.call(this)},__attachShadow(){this.shadowRoot=this}}),Object.defineProperty(t,"is",{value:s.p,configurable:!0}),kt(t,s)}catch(e){return l(e),t}},Et=t=>c.L=t,_t=t=>Object.assign(c,t),At=new WeakMap;function Ct(t,e){let n=At.get(e);n||(n={i:0,o:{i:0,p:e.tagName},$hostElement$:e},At.set(e,n)),dt(n,t)}function Lt(t){return t}export{r as H,F as a,P as c,g as getAssetPath,T as h,Mt as p,Ct as render,w as setAssetPath,Et as setNonce,_t as setPlatformOptions,Lt as t}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface RpDaySlot extends Components.RpDaySlot, HTMLElement {}
|
|
4
|
+
export const RpDaySlot: {
|
|
5
|
+
prototype: RpDaySlot;
|
|
6
|
+
new (): RpDaySlot;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,t as a,H as s,c as r,h as t,a as o}from"./index.js";const l=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.rpAddMeal=r(this,"rpAddMeal"),this.rpRemoveMeal=r(this,"rpRemoveMeal"),this.rpMoveMeal=r(this,"rpMoveMeal")}day;dayLabel="";meals=[];days=[];normalized=[];rpAddMeal;rpRemoveMeal;rpMoveMeal;componentWillLoad(){this.normalized=Array.isArray(this.meals)?this.meals:[]}componentWillUpdate(){this.normalized=Array.isArray(this.meals)?this.meals:[]}onMove=(e,a)=>{const s=e.target,r=s.value;r&&r!==this.day&&(this.rpMoveMeal.emit({id:a.id,from:this.day,to:r}),s.value="")};render(){const e=Array.isArray(this.days)?this.days:[],a=this.normalized;return t(o,{key:"689cfc71ca7fc7106e29278d027ce1c36b3830c0"},t("section",{key:"d15ed9ae6f800be9962c4c1258397ff1043fef76",class:"slot"},t("header",{key:"7f3ce1dcd4e94af5699b378ab1e461a34792acd8",class:"head"},t("h3",{key:"b62fe42a27f0072370e59a101452f77de8527ae0",class:"day"},this.dayLabel||this.day),t("button",{key:"658191328f041bc2dd7534a3f5614746f26c0f28",type:"button",class:"add",onClick:()=>this.rpAddMeal.emit(this.day),"aria-label":"Add a meal to "+(this.dayLabel||this.day)},"+")),0===a.length?t("div",{class:"empty"},t("slot",null,t("p",{class:"empty-text"},"No meals planned"))):t("ul",{class:"meals"},a.map((a=>t("li",{class:"meal",key:a.id},t("span",{class:"meal-title"},a.title),t("div",{class:"meal-actions"},t("label",{class:"move"},t("span",{class:"sr-only"},`Move ${a.title} to another day`),t("select",{class:"move-select",onChange:e=>this.onMove(e,a)},t("option",{value:""},"Move…"),e.filter((e=>e!==this.day)).map((e=>t("option",{key:e,value:e},e))))),t("button",{type:"button",class:"remove",onClick:()=>this.rpRemoveMeal.emit({id:a.id,day:this.day}),"aria-label":"Remove "+a.title},"×"))))))))}static get style(){return".sc-rp-day-slot-h{display:block;font-family:var(--rp-font-sans);color:var(--rp-color-text)}.slot.sc-rp-day-slot{display:flex;flex-direction:column;height:100%;min-height:160px;background:var(--rp-color-surface);border:1px solid var(--rp-color-border);border-radius:var(--rp-radius-md)}.head.sc-rp-day-slot{display:flex;gap:var(--rp-space-2);align-items:center;justify-content:space-between;padding:var(--rp-space-2) var(--rp-space-3);border-bottom:1px solid var(--rp-color-border)}.day.sc-rp-day-slot{margin:0;font-size:var(--rp-font-size-md);text-transform:capitalize}.add.sc-rp-day-slot{display:grid;place-items:center;width:28px;height:28px;padding:0;font-size:1.125rem;line-height:1;color:var(--rp-color-accent-contrast);cursor:pointer;background:var(--rp-color-accent);border:none;border-radius:50%}.meals.sc-rp-day-slot{flex:1;margin:0;padding:var(--rp-space-2);list-style:none;display:flex;flex-direction:column;gap:var(--rp-space-2)}.meal.sc-rp-day-slot{padding:var(--rp-space-2);background:var(--rp-color-surface-sunken);border-radius:var(--rp-radius-sm)}.meal-title.sc-rp-day-slot{display:block;font-size:var(--rp-font-size-sm);line-height:1.35}.meal-actions.sc-rp-day-slot{display:flex;gap:var(--rp-space-1);align-items:center;justify-content:space-between;margin-top:var(--rp-space-2)}.move-select.sc-rp-day-slot{max-width:100%;padding:2px var(--rp-space-1);font:inherit;font-size:var(--rp-font-size-sm);color:var(--rp-color-text-muted);background:var(--rp-color-surface);border:1px solid var(--rp-color-border);border-radius:var(--rp-radius-sm);text-transform:capitalize}.remove.sc-rp-day-slot{display:grid;place-items:center;width:24px;height:24px;padding:0;font-size:1.125rem;line-height:1;color:var(--rp-color-danger);cursor:pointer;background:none;border:none;border-radius:var(--rp-radius-sm)}.empty.sc-rp-day-slot{display:grid;flex:1;place-items:center;padding:var(--rp-space-3)}.empty-text.sc-rp-day-slot{margin:0;font-size:var(--rp-font-size-sm);color:var(--rp-color-text-muted)}.add.sc-rp-day-slot:focus-visible,.remove.sc-rp-day-slot:focus-visible,.move-select.sc-rp-day-slot:focus-visible{outline:var(--rp-focus-ring);outline-offset:var(--rp-focus-offset)}.sr-only.sc-rp-day-slot{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}"}},[774,"rp-day-slot",{day:[1],dayLabel:[1,"day-label"],meals:[16],days:[16],normalized:[32]}]);function i(){"undefined"!=typeof customElements&&["rp-day-slot"].forEach((e=>{"rp-day-slot"===e&&(customElements.get(a(e))||customElements.define(a(e),l))}))}i();const c=l,d=i;export{c as RpDaySlot,d as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface RpFilterChips extends Components.RpFilterChips, HTMLElement {}
|
|
4
|
+
export const RpFilterChips: {
|
|
5
|
+
prototype: RpFilterChips;
|
|
6
|
+
new (): RpFilterChips;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as r,H as e,c as s,h as c,a as t,t as i}from"./index.js";const o=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.rpFilterChange=s(this,"rpFilterChange")}options=[];selected=null;label="Filter";rpFilterChange;select(r){this.rpFilterChange.emit(this.selected===r?null:r)}render(){return c(t,{key:"656b969af2e55a7c4313bc0c2c422e000811af53"},c("div",{key:"1da1173fc1d6d10a312a43466a0ea799b625caef",class:"chips",role:"group","aria-label":this.label},(Array.isArray(this.options)?this.options:[]).map((r=>c("button",{key:r,type:"button",class:{chip:!0,"is-selected":this.selected===r},"aria-pressed":(this.selected===r)+"",onClick:()=>this.select(r)},r)))))}static get style(){return".sc-rp-filter-chips-h{display:block;font-family:var(--rp-font-sans)}.chips.sc-rp-filter-chips{display:flex;flex-wrap:wrap;gap:var(--rp-space-2)}.chip.sc-rp-filter-chips{padding:var(--rp-space-1) var(--rp-space-3);font:inherit;font-size:var(--rp-font-size-sm);color:var(--rp-color-text);cursor:pointer;background:var(--rp-color-surface);border:1px solid var(--rp-color-border);border-radius:999px}.chip.sc-rp-filter-chips:hover{background:var(--rp-color-surface-sunken)}.chip.is-selected.sc-rp-filter-chips{color:var(--rp-color-accent-contrast);background:var(--rp-color-accent);border-color:var(--rp-color-accent)}.chip.sc-rp-filter-chips:focus-visible{outline:var(--rp-focus-ring);outline-offset:var(--rp-focus-offset)}"}},[514,"rp-filter-chips",{options:[16],selected:[1],label:[1]}]);function a(){"undefined"!=typeof customElements&&["rp-filter-chips"].forEach((r=>{"rp-filter-chips"===r&&(customElements.get(i(r))||customElements.define(i(r),o))}))}a();const p=o,l=a;export{p as RpFilterChips,l as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface RpIngredientList extends Components.RpIngredientList, HTMLElement {}
|
|
4
|
+
export const RpIngredientList: {
|
|
5
|
+
prototype: RpIngredientList;
|
|
6
|
+
new (): RpIngredientList;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,H as r,h as s,a as t,t as n}from"./index.js";const i=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost()}items=[];render(){const e=Array.isArray(this.items)?this.items:[];return s(t,{key:"22708ae6e60de472b2f8e40fb54b33a2ec691ad1"},s("section",{key:"6f922fc37e3c230511bbdf72e55826dfa73e167e",class:"wrap"},s("slot",{key:"e9f0b16183f5ded825a5c1663caa54dcb6c2d961",name:"heading"},s("h2",{key:"c68ebf97056bc6309d3c4e79d1796d89eede1325",class:"heading"},"Ingredients")),0===e.length?s("p",{class:"empty"},"No ingredients listed for this recipe."):s("ul",{class:"list"},e.map(((e,r)=>s("li",{class:"row",key:`${e.name}-${r}`},s("span",{class:"name"},e.name),s("span",{class:"measure"},e.measure))))),s("div",{key:"28d26e1bbb9f14e5dedfb153ff87e44add5cfbfb",class:"note"},s("slot",{key:"20410e710e3c7dbc2ee9f6ad9493984382693687"}))))}static get style(){return".sc-rp-ingredient-list-h{display:block;font-family:var(--rp-font-sans);color:var(--rp-color-text)}.heading.sc-rp-ingredient-list{margin:0 0 var(--rp-space-3);font-size:var(--rp-font-size-lg)}.list.sc-rp-ingredient-list{margin:0;padding:0;list-style:none;border:1px solid var(--rp-color-border);border-radius:var(--rp-radius-md);overflow:hidden}.row.sc-rp-ingredient-list{display:flex;justify-content:space-between;gap:var(--rp-space-4);padding:var(--rp-space-2) var(--rp-space-3);font-size:var(--rp-font-size-md)}.row.sc-rp-ingredient-list:nth-child(odd){background:var(--rp-color-surface-sunken)}.measure.sc-rp-ingredient-list{flex-shrink:0;color:var(--rp-color-text-muted);font-variant-numeric:tabular-nums}.empty.sc-rp-ingredient-list{margin:0;font-size:var(--rp-font-size-md);color:var(--rp-color-text-muted)}.note.sc-rp-ingredient-list{margin-top:var(--rp-space-2);font-size:var(--rp-font-size-sm);color:var(--rp-color-text-muted)}.note.sc-rp-ingredient-list:not(:has(*)){display:none}"}},[774,"rp-ingredient-list",{items:[16]}]);function a(){"undefined"!=typeof customElements&&["rp-ingredient-list"].forEach((e=>{"rp-ingredient-list"===e&&(customElements.get(n(e))||customElements.define(n(e),i))}))}a();const o=i,d=a;export{o as RpIngredientList,d as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface RpModal extends Components.RpModal, HTMLElement {}
|
|
4
|
+
export const RpModal: {
|
|
5
|
+
prototype: RpModal;
|
|
6
|
+
new (): RpModal;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as o,H as e,c as r,h as s,a,t}from"./index.js";const n='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',i=o(class extends e{constructor(o){super(),!1!==o&&this.__registerHost(),this.rpClose=r(this,"rpClose")}get el(){return this}open=!1;heading="";rpClose;previouslyFocused=null;onOpenChange(o){o?(this.previouslyFocused=document.activeElement,document.addEventListener("keydown",this.onKeydown),requestAnimationFrame((()=>this.focusFirstField()))):(document.removeEventListener("keydown",this.onKeydown),this.previouslyFocused?.focus(),this.previouslyFocused=null)}componentDidLoad(){this.open&&this.onOpenChange(!0)}disconnectedCallback(){document.removeEventListener("keydown",this.onKeydown)}async focusFirstField(){const o=this.el.querySelector(n);o?.focus()}onKeydown=o=>{if(this.open)return"Escape"===o.key?(o.preventDefault(),void this.rpClose.emit()):void("Tab"===o.key&&this.trapFocus(o))};trapFocus(o){const e=Array.from(this.el.querySelectorAll(n));if(0===e.length)return;const r=e[0],s=e[e.length-1],a=document.activeElement;o.shiftKey&&a===r?(o.preventDefault(),s.focus()):o.shiftKey||a!==s||(o.preventDefault(),r.focus())}onBackdropClick=o=>{o.target===o.currentTarget&&this.rpClose.emit()};render(){return this.open?s(a,null,s("div",{class:"backdrop",onClick:this.onBackdropClick},s("div",{class:"dialog",role:"dialog","aria-modal":"true","aria-label":this.heading},s("header",{class:"head"},s("h2",{class:"heading"},this.heading),s("button",{type:"button",class:"close",onClick:()=>this.rpClose.emit(),"aria-label":"Close dialog"},"×")),s("div",{class:"body"},s("slot",null)),s("footer",{class:"foot"},s("slot",{name:"footer"}))))):null}static get watchers(){return{open:[{onOpenChange:0}]}}static get style(){return".sc-rp-modal-h{display:contents;font-family:var(--rp-font-sans)}.backdrop.sc-rp-modal{position:fixed;inset:0;z-index:100;display:grid;place-items:center;padding:var(--rp-space-4);background:rgb(0 0 0 / 0.5)}.dialog.sc-rp-modal{display:flex;flex-direction:column;width:min(560px, 100%);max-height:min(80vh, 640px);color:var(--rp-color-text);background:var(--rp-color-surface);border-radius:var(--rp-radius-lg);box-shadow:var(--rp-shadow-lg)}.head.sc-rp-modal{display:flex;gap:var(--rp-space-3);align-items:center;justify-content:space-between;padding:var(--rp-space-4);border-bottom:1px solid var(--rp-color-border)}.heading.sc-rp-modal{margin:0;font-size:var(--rp-font-size-lg)}.close.sc-rp-modal{display:grid;place-items:center;width:32px;height:32px;padding:0;font-size:1.5rem;line-height:1;color:var(--rp-color-text-muted);cursor:pointer;background:none;border:none;border-radius:var(--rp-radius-sm)}.close.sc-rp-modal:hover{background:var(--rp-color-surface-sunken)}.close.sc-rp-modal:focus-visible{outline:var(--rp-focus-ring);outline-offset:var(--rp-focus-offset)}.body.sc-rp-modal{flex:1;padding:var(--rp-space-4);overflow-y:auto}.foot.sc-rp-modal{display:flex;gap:var(--rp-space-2);justify-content:flex-end;padding:var(--rp-space-4);border-top:1px solid var(--rp-color-border)}.foot.sc-rp-modal:not(:has(*)){display:none}@media (prefers-reduced-motion: no-preference){.dialog.sc-rp-modal{animation:rp-modal-in 120ms ease-out}@keyframes rp-modal-in{from{opacity:0;transform:translateY(8px)}}}"}},[774,"rp-modal",{open:[516],heading:[1],focusFirstField:[64]},void 0,{open:[{onOpenChange:0}]}]);function d(){"undefined"!=typeof customElements&&["rp-modal"].forEach((o=>{"rp-modal"===o&&(customElements.get(t(o))||customElements.define(t(o),i))}))}d();const l=i,c=d;export{l as RpModal,c as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface RpRecipeCard extends Components.RpRecipeCard, HTMLElement {}
|
|
4
|
+
export const RpRecipeCard: {
|
|
5
|
+
prototype: RpRecipeCard;
|
|
6
|
+
new (): RpRecipeCard;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,H as r,c as a,h as c,a as i,t as s}from"./index.js";const t=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost(),this.rpFavoriteToggle=a(this,"rpFavoriteToggle")}get el(){return this}recipeId;recipeTitle;image;category;favorite=!1;rpFavoriteToggle;toggleFavorite=()=>{this.rpFavoriteToggle.emit({recipeId:this.recipeId,favorite:!this.favorite})};render(){return c(i,{key:"7ac4bd65a2fa94815db81c986d17e3dff768334f"},c("article",{key:"b8ab03b01a7305ebac8fa8c7a512cf670afbd7c9",class:"card"},c("div",{key:"ddd9892bf42ed7fdd1300d439449ac4c471f11e3",class:"media"},this.image?c("img",{src:this.image,alt:"",loading:"lazy",width:"320",height:"240"}):c("div",{class:"media-fallback","aria-hidden":"true"}),c("div",{key:"211b2f1621e96b2350ff17598094790809c6fe81",class:"badges"},c("slot",{key:"ab834b8c4ff5c643c35d4f29c7bc9ddab5886e44"})),c("button",{key:"67d76da1db3b7d867d64042260cb69b30ea9fa2f",type:"button",class:"favorite",onClick:this.toggleFavorite,"aria-pressed":this.favorite+"","aria-label":this.favorite?`Remove ${this.recipeTitle} from favorites`:`Add ${this.recipeTitle} to favorites`},c("svg",{key:"ad94f74c83aba86af030d380d02ca331bf1edd66",viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":"true"},c("path",{key:"cec837ac8a9e440730ed83f5746fba9833722d43",d:"M12 21s-7.5-4.7-9.3-9A5.2 5.2 0 0 1 12 6.5 5.2 5.2 0 0 1 21.3 12c-1.8 4.3-9.3 9-9.3 9z"})))),c("div",{key:"57e619602fb97b1197d1391e1bca37059fad4750",class:"body"},c("h3",{key:"1576688c8d62e883132bb25f7f4f0832e7e102c2",class:"title"},this.recipeTitle),this.category&&c("p",{key:"ca58ac4811bf94d13761ac0fd3fdd63a4b35c057",class:"category"},this.category)),c("div",{key:"fe7531c32eb5b110fe5aea2c4680a020848633bd",class:"actions"},c("slot",{key:"daf97a1324f3d2d08d1900d057cab1968be8c9d7",name:"actions"}))))}static get style(){return".sc-rp-recipe-card-h{display:block;font-family:var(--rp-font-sans);color:var(--rp-color-text)}.card.sc-rp-recipe-card{display:flex;flex-direction:column;height:100%;overflow:hidden;background:var(--rp-color-surface);border:1px solid var(--rp-color-border);border-radius:var(--rp-radius-lg);box-shadow:var(--rp-shadow-sm)}.media.sc-rp-recipe-card{position:relative;aspect-ratio:4 / 3;background:var(--rp-color-surface-sunken)}.media.sc-rp-recipe-card img.sc-rp-recipe-card{display:block;width:100%;height:100%;object-fit:cover}.media-fallback.sc-rp-recipe-card{width:100%;height:100%;background:linear-gradient(135deg, var(--rp-color-surface-sunken), var(--rp-color-border))}.badges.sc-rp-recipe-card{position:absolute;inset-block-start:var(--rp-space-2);inset-inline-start:var(--rp-space-2);display:flex;flex-wrap:wrap;gap:var(--rp-space-1)}.favorite.sc-rp-recipe-card{position:absolute;inset-block-start:var(--rp-space-2);inset-inline-end:var(--rp-space-2);display:grid;place-items:center;width:36px;height:36px;padding:0;cursor:pointer;background:var(--rp-color-surface);border:1px solid var(--rp-color-border);border-radius:50%;box-shadow:var(--rp-shadow-sm)}.favorite.sc-rp-recipe-card svg.sc-rp-recipe-card{fill:none;stroke:var(--rp-color-text-muted);stroke-width:1.8}[favorite].sc-rp-recipe-card-h .favorite.sc-rp-recipe-card svg.sc-rp-recipe-card{fill:var(--rp-color-favorite);stroke:var(--rp-color-favorite)}.favorite.sc-rp-recipe-card:focus-visible{outline:var(--rp-focus-ring);outline-offset:var(--rp-focus-offset)}.body.sc-rp-recipe-card{flex:1;padding:var(--rp-space-3) var(--rp-space-4)}.title.sc-rp-recipe-card{margin:0;font-size:var(--rp-font-size-lg);line-height:1.3}.category.sc-rp-recipe-card{margin:var(--rp-space-1) 0 0;font-size:var(--rp-font-size-sm);color:var(--rp-color-text-muted)}.actions.sc-rp-recipe-card{display:flex;gap:var(--rp-space-2);align-items:center;padding:0 var(--rp-space-4) var(--rp-space-4)}.actions.sc-rp-recipe-card:not(:has(*)){display:none}"}},[774,"rp-recipe-card",{recipeId:[1,"recipe-id"],recipeTitle:[1,"recipe-title"],image:[1],category:[1],favorite:[516]}]);function d(){"undefined"!=typeof customElements&&["rp-recipe-card"].forEach((e=>{"rp-recipe-card"===e&&(customElements.get(s(e))||customElements.define(s(e),t))}))}d();const o=t,p=d;export{o as RpRecipeCard,p as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface RpSearchBar extends Components.RpSearchBar, HTMLElement {}
|
|
4
|
+
export const RpSearchBar: {
|
|
5
|
+
prototype: RpSearchBar;
|
|
6
|
+
new (): RpSearchBar;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as r,H as e,c as a,h as s,a as c,t}from"./index.js";const o=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.rpSearch=a(this,"rpSearch"),this.rpClear=a(this,"rpClear")}value="";placeholder="Search recipes";label="Search recipes";draft="";rpSearch;rpClear;onValueChange(r){this.draft=r??""}componentWillLoad(){this.draft=this.value??""}onSubmit=r=>{r.preventDefault(),this.rpSearch.emit(this.draft.trim())};onInput=r=>{this.draft=r.target.value};onClear=()=>{this.draft="",this.rpClear.emit()};render(){return s(c,{key:"12550f4e6587473576e211fe1cfa5d075a02399f"},s("form",{key:"e1a61e15c159e8449770b7df63a649d84b136aa2",class:"bar",role:"search",onSubmit:this.onSubmit},s("input",{key:"defae81130bf361beae8a57c15633c6595437493",type:"search",class:"field",value:this.draft,placeholder:this.placeholder,"aria-label":this.label,onInput:this.onInput}),this.draft&&s("button",{key:"4cd2eac81b32f17d18e89c51a90e0a0d9edf7d01",type:"button",class:"clear",onClick:this.onClear,"aria-label":"Clear search"},"×"),s("button",{key:"b07034ed131233623d8edbdd16db3cfd8ffab4b7",type:"submit",class:"submit"},"Search")))}static get watchers(){return{value:[{onValueChange:0}]}}static get style(){return".sc-rp-search-bar-h{display:block;font-family:var(--rp-font-sans)}.bar.sc-rp-search-bar{display:flex;gap:var(--rp-space-2);align-items:center}.field.sc-rp-search-bar{flex:1;min-width:0;padding:var(--rp-space-2) var(--rp-space-3);font:inherit;font-size:var(--rp-font-size-md);color:var(--rp-color-text);background:var(--rp-color-surface);border:1px solid var(--rp-color-border);border-radius:var(--rp-radius-md)}.field.sc-rp-search-bar::-webkit-search-cancel-button{display:none}.field.sc-rp-search-bar:focus-visible,.submit.sc-rp-search-bar:focus-visible,.clear.sc-rp-search-bar:focus-visible{outline:var(--rp-focus-ring);outline-offset:var(--rp-focus-offset)}.clear.sc-rp-search-bar{display:grid;place-items:center;width:32px;height:32px;padding:0;font-size:1.25rem;line-height:1;color:var(--rp-color-text-muted);cursor:pointer;background:none;border:none;border-radius:50%}.clear.sc-rp-search-bar:hover{background:var(--rp-color-surface-sunken)}.submit.sc-rp-search-bar{padding:var(--rp-space-2) var(--rp-space-4);font:inherit;font-size:var(--rp-font-size-md);font-weight:600;color:var(--rp-color-accent-contrast);cursor:pointer;background:var(--rp-color-accent);border:none;border-radius:var(--rp-radius-md)}"}},[514,"rp-search-bar",{value:[1],placeholder:[1],label:[1],draft:[32]},void 0,{value:[{onValueChange:0}]}]);function i(){"undefined"!=typeof customElements&&["rp-search-bar"].forEach((r=>{"rp-search-bar"===r&&(customElements.get(t(r))||customElements.define(t(r),o))}))}i();const n=o,l=i;export{n as RpSearchBar,l as defineCustomElement}
|