recipe-planner-ui 1.1.0 → 1.1.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/dist/cjs/rp-filter-chips_5.cjs.entry.js +7 -1
- package/dist/collection/components/rp-recipe-card/rp-recipe-card.js +7 -1
- package/dist/components/rp-recipe-card.js +1 -1
- package/dist/esm/rp-filter-chips_5.entry.js +7 -1
- package/dist/recipe-planner-ui/{p-d54dbd37.entry.js → p-b98e7093.entry.js} +1 -1
- package/dist/recipe-planner-ui/recipe-planner-ui.esm.js +1 -1
- package/package.json +1 -1
|
@@ -176,7 +176,13 @@ const RecipeCard = class {
|
|
|
176
176
|
this.rpFavoriteToggle.emit({ recipeId: this.recipeId, favorite: !this.favorite });
|
|
177
177
|
};
|
|
178
178
|
render() {
|
|
179
|
-
|
|
179
|
+
// Normalized because a consumer that omits the attribute entirely leaves the prop
|
|
180
|
+
// undefined, and `aria-pressed="undefined"` would be dropped from the DOM, leaving a
|
|
181
|
+
// toggle button with no announced state.
|
|
182
|
+
const isFavorite = this.favorite === true;
|
|
183
|
+
return (index.h(index.Host, { key: '3b80c8e4ebd4e0e25d5aac0b09f39a458f82b0f2' }, index.h("article", { key: '7df757f7135b928eb0df9c5bf62bda72c6694975', class: "card" }, index.h("div", { key: '46d04f584290c5f894da560c4fc464968b51334c', class: "media" }, this.image ? (index.h("img", { src: this.image, alt: "", loading: "lazy", width: "320", height: "240" })) : (index.h("div", { class: "media-fallback", "aria-hidden": "true" })), index.h("div", { key: '8fb20568c256bf52b911d766acb826a78af54738', class: "badges" }, index.h("slot", { key: '7a6ae3d9ea493e89942bf46c414b9b81f9fb287c' })), index.h("button", { key: '252477d86dfb1131b4417e0a3a99810f6b2626a5', type: "button", class: "favorite", onClick: this.toggleFavorite, "aria-pressed": isFavorite ? 'true' : 'false', "aria-label": isFavorite
|
|
184
|
+
? `Remove ${this.recipeTitle} from favorites`
|
|
185
|
+
: `Add ${this.recipeTitle} to favorites` }, index.h("svg", { key: '857ecd2421abd6a5177d0eccbc7f225e019bb4e8', viewBox: "0 0 24 24", width: "20", height: "20", "aria-hidden": "true" }, index.h("path", { key: 'c6f7af10fa1f938ba76c8f5363b5d347eb959f19', 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" })))), index.h("div", { key: 'f09729fe072a150d074b92f3c84f1b337b5e10af', class: "body" }, index.h("h3", { key: '79ce18be5cac3edb6ee23d221eb4eaf61ca910f8', class: "title" }, this.recipeTitle), this.category && index.h("p", { key: '47a0031f26046ea67bc31719fda810f9ccbd48fe', class: "category" }, this.category)), index.h("div", { key: 'cca23a5c5da2e80a58b7714ba53aa55122594b0f', class: "actions" }, index.h("slot", { key: 'cf828d445674da18c9a44545788a5d79685a325a', name: "actions" })))));
|
|
180
186
|
}
|
|
181
187
|
};
|
|
182
188
|
RecipeCard.style = rpRecipeCardCss();
|
|
@@ -34,7 +34,13 @@ export class RecipeCard {
|
|
|
34
34
|
this.rpFavoriteToggle.emit({ recipeId: this.recipeId, favorite: !this.favorite });
|
|
35
35
|
};
|
|
36
36
|
render() {
|
|
37
|
-
|
|
37
|
+
// Normalized because a consumer that omits the attribute entirely leaves the prop
|
|
38
|
+
// undefined, and `aria-pressed="undefined"` would be dropped from the DOM, leaving a
|
|
39
|
+
// toggle button with no announced state.
|
|
40
|
+
const isFavorite = this.favorite === true;
|
|
41
|
+
return (h(Host, { key: '3b80c8e4ebd4e0e25d5aac0b09f39a458f82b0f2' }, h("article", { key: '7df757f7135b928eb0df9c5bf62bda72c6694975', class: "card" }, h("div", { key: '46d04f584290c5f894da560c4fc464968b51334c', class: "media" }, this.image ? (h("img", { src: this.image, alt: "", loading: "lazy", width: "320", height: "240" })) : (h("div", { class: "media-fallback", "aria-hidden": "true" })), h("div", { key: '8fb20568c256bf52b911d766acb826a78af54738', class: "badges" }, h("slot", { key: '7a6ae3d9ea493e89942bf46c414b9b81f9fb287c' })), h("button", { key: '252477d86dfb1131b4417e0a3a99810f6b2626a5', type: "button", class: "favorite", onClick: this.toggleFavorite, "aria-pressed": isFavorite ? 'true' : 'false', "aria-label": isFavorite
|
|
42
|
+
? `Remove ${this.recipeTitle} from favorites`
|
|
43
|
+
: `Add ${this.recipeTitle} to favorites` }, h("svg", { key: '857ecd2421abd6a5177d0eccbc7f225e019bb4e8', viewBox: "0 0 24 24", width: "20", height: "20", "aria-hidden": "true" }, h("path", { key: 'c6f7af10fa1f938ba76c8f5363b5d347eb959f19', 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" })))), h("div", { key: 'f09729fe072a150d074b92f3c84f1b337b5e10af', class: "body" }, h("h3", { key: '79ce18be5cac3edb6ee23d221eb4eaf61ca910f8', class: "title" }, this.recipeTitle), this.category && h("p", { key: '47a0031f26046ea67bc31719fda810f9ccbd48fe', class: "category" }, this.category)), h("div", { key: 'cca23a5c5da2e80a58b7714ba53aa55122594b0f', class: "actions" }, h("slot", { key: 'cf828d445674da18c9a44545788a5d79685a325a', name: "actions" })))));
|
|
38
44
|
}
|
|
39
45
|
static get is() { return "rp-recipe-card"; }
|
|
40
46
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1 +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:"
|
|
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(){const e=!0===this.favorite;return c(i,{key:"3b80c8e4ebd4e0e25d5aac0b09f39a458f82b0f2"},c("article",{key:"7df757f7135b928eb0df9c5bf62bda72c6694975",class:"card"},c("div",{key:"46d04f584290c5f894da560c4fc464968b51334c",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:"8fb20568c256bf52b911d766acb826a78af54738",class:"badges"},c("slot",{key:"7a6ae3d9ea493e89942bf46c414b9b81f9fb287c"})),c("button",{key:"252477d86dfb1131b4417e0a3a99810f6b2626a5",type:"button",class:"favorite",onClick:this.toggleFavorite,"aria-pressed":e?"true":"false","aria-label":e?`Remove ${this.recipeTitle} from favorites`:`Add ${this.recipeTitle} to favorites`},c("svg",{key:"857ecd2421abd6a5177d0eccbc7f225e019bb4e8",viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":"true"},c("path",{key:"c6f7af10fa1f938ba76c8f5363b5d347eb959f19",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:"f09729fe072a150d074b92f3c84f1b337b5e10af",class:"body"},c("h3",{key:"79ce18be5cac3edb6ee23d221eb4eaf61ca910f8",class:"title"},this.recipeTitle),this.category&&c("p",{key:"47a0031f26046ea67bc31719fda810f9ccbd48fe",class:"category"},this.category)),c("div",{key:"cca23a5c5da2e80a58b7714ba53aa55122594b0f",class:"actions"},c("slot",{key:"cf828d445674da18c9a44545788a5d79685a325a",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 o(){"undefined"!=typeof customElements&&["rp-recipe-card"].forEach((e=>{"rp-recipe-card"===e&&(customElements.get(s(e))||customElements.define(s(e),t))}))}o();const d=t,p=o;export{d as RpRecipeCard,p as defineCustomElement}
|
|
@@ -174,7 +174,13 @@ const RecipeCard = class {
|
|
|
174
174
|
this.rpFavoriteToggle.emit({ recipeId: this.recipeId, favorite: !this.favorite });
|
|
175
175
|
};
|
|
176
176
|
render() {
|
|
177
|
-
|
|
177
|
+
// Normalized because a consumer that omits the attribute entirely leaves the prop
|
|
178
|
+
// undefined, and `aria-pressed="undefined"` would be dropped from the DOM, leaving a
|
|
179
|
+
// toggle button with no announced state.
|
|
180
|
+
const isFavorite = this.favorite === true;
|
|
181
|
+
return (h(Host, { key: '3b80c8e4ebd4e0e25d5aac0b09f39a458f82b0f2' }, h("article", { key: '7df757f7135b928eb0df9c5bf62bda72c6694975', class: "card" }, h("div", { key: '46d04f584290c5f894da560c4fc464968b51334c', class: "media" }, this.image ? (h("img", { src: this.image, alt: "", loading: "lazy", width: "320", height: "240" })) : (h("div", { class: "media-fallback", "aria-hidden": "true" })), h("div", { key: '8fb20568c256bf52b911d766acb826a78af54738', class: "badges" }, h("slot", { key: '7a6ae3d9ea493e89942bf46c414b9b81f9fb287c' })), h("button", { key: '252477d86dfb1131b4417e0a3a99810f6b2626a5', type: "button", class: "favorite", onClick: this.toggleFavorite, "aria-pressed": isFavorite ? 'true' : 'false', "aria-label": isFavorite
|
|
182
|
+
? `Remove ${this.recipeTitle} from favorites`
|
|
183
|
+
: `Add ${this.recipeTitle} to favorites` }, h("svg", { key: '857ecd2421abd6a5177d0eccbc7f225e019bb4e8', viewBox: "0 0 24 24", width: "20", height: "20", "aria-hidden": "true" }, h("path", { key: 'c6f7af10fa1f938ba76c8f5363b5d347eb959f19', 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" })))), h("div", { key: 'f09729fe072a150d074b92f3c84f1b337b5e10af', class: "body" }, h("h3", { key: '79ce18be5cac3edb6ee23d221eb4eaf61ca910f8', class: "title" }, this.recipeTitle), this.category && h("p", { key: '47a0031f26046ea67bc31719fda810f9ccbd48fe', class: "category" }, this.category)), h("div", { key: 'cca23a5c5da2e80a58b7714ba53aa55122594b0f', class: "actions" }, h("slot", { key: 'cf828d445674da18c9a44545788a5d79685a325a', name: "actions" })))));
|
|
178
184
|
}
|
|
179
185
|
};
|
|
180
186
|
RecipeCard.style = rpRecipeCardCss();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,c as e,h as a,H as s,g as i}from"./p-B4wAFfci.js";const o=class{constructor(a){r(this,a),this.rpFilterChange=e(this,"rpFilterChange")}options=[];selected=null;label="Filter";rpFilterChange;select(r){this.rpFilterChange.emit(this.selected===r?null:r)}render(){const r=Array.isArray(this.options)?this.options:[];return a(s,{key:"656b969af2e55a7c4313bc0c2c422e000811af53"},a("div",{key:"1da1173fc1d6d10a312a43466a0ea799b625caef",class:"chips",role:"group","aria-label":this.label},r.map((r=>a("button",{key:r,type:"button",class:{chip:!0,"is-selected":this.selected===r},"aria-pressed":String(this.selected===r),onClick:()=>this.select(r)},r)))))}};o.style=".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)}";const c=class{constructor(e){r(this,e)}items=[];render(){const r=Array.isArray(this.items)?this.items:[];return a(s,{key:"22708ae6e60de472b2f8e40fb54b33a2ec691ad1"},a("section",{key:"6f922fc37e3c230511bbdf72e55826dfa73e167e",class:"wrap"},a("slot",{key:"e9f0b16183f5ded825a5c1663caa54dcb6c2d961",name:"heading"},a("h2",{key:"c68ebf97056bc6309d3c4e79d1796d89eede1325",class:"heading"},"Ingredients")),0===r.length?a("p",{class:"empty"},"No ingredients listed for this recipe."):a("ul",{class:"list"},r.map(((r,e)=>a("li",{class:"row",key:`${r.name}-${e}`},a("span",{class:"name"},r.name),a("span",{class:"measure"},r.measure))))),a("div",{key:"28d26e1bbb9f14e5dedfb153ff87e44add5cfbfb",class:"note"},a("slot",{key:"20410e710e3c7dbc2ee9f6ad9493984382693687"}))))}};c.style=".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}";const t='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',d=class{constructor(a){r(this,a),this.rpClose=e(this,"rpClose")}get el(){return i(this)}open=!1;heading="";rpClose;previouslyFocused=null;onOpenChange(r){r?(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 r=this.el.querySelector(t);r?.focus()}onKeydown=r=>{if(this.open)return"Escape"===r.key?(r.preventDefault(),void this.rpClose.emit()):void("Tab"===r.key&&this.trapFocus(r))};trapFocus(r){const e=Array.from(this.el.querySelectorAll(t));if(0===e.length)return;const a=e[0],s=e[e.length-1],i=document.activeElement;r.shiftKey&&i===a?(r.preventDefault(),s.focus()):r.shiftKey||i!==s||(r.preventDefault(),a.focus())}onBackdropClick=r=>{r.target===r.currentTarget&&this.rpClose.emit()};render(){return this.open?a(s,null,a("div",{class:"backdrop",onClick:this.onBackdropClick},a("div",{class:"dialog",role:"dialog","aria-modal":"true","aria-label":this.heading},a("header",{class:"head"},a("h2",{class:"heading"},this.heading),a("button",{type:"button",class:"close",onClick:()=>this.rpClose.emit(),"aria-label":"Close dialog"},"×")),a("div",{class:"body"},a("slot",null)),a("footer",{class:"foot"},a("slot",{name:"footer"}))))):null}static get watchers(){return{open:[{onOpenChange:0}]}}};d.style=".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)}}}";const p=class{constructor(a){r(this,a),this.rpFavoriteToggle=e(this,"rpFavoriteToggle")}get el(){return i(this)}recipeId;recipeTitle;image;category;favorite=!1;rpFavoriteToggle;toggleFavorite=()=>{this.rpFavoriteToggle.emit({recipeId:this.recipeId,favorite:!this.favorite})};render(){return a(s,{key:"7ac4bd65a2fa94815db81c986d17e3dff768334f"},a("article",{key:"b8ab03b01a7305ebac8fa8c7a512cf670afbd7c9",class:"card"},a("div",{key:"ddd9892bf42ed7fdd1300d439449ac4c471f11e3",class:"media"},this.image?a("img",{src:this.image,alt:"",loading:"lazy",width:"320",height:"240"}):a("div",{class:"media-fallback","aria-hidden":"true"}),a("div",{key:"211b2f1621e96b2350ff17598094790809c6fe81",class:"badges"},a("slot",{key:"ab834b8c4ff5c643c35d4f29c7bc9ddab5886e44"})),a("button",{key:"67d76da1db3b7d867d64042260cb69b30ea9fa2f",type:"button",class:"favorite",onClick:this.toggleFavorite,"aria-pressed":String(this.favorite),"aria-label":this.favorite?`Remove ${this.recipeTitle} from favorites`:`Add ${this.recipeTitle} to favorites`},a("svg",{key:"ad94f74c83aba86af030d380d02ca331bf1edd66",viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":"true"},a("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"})))),a("div",{key:"57e619602fb97b1197d1391e1bca37059fad4750",class:"body"},a("h3",{key:"1576688c8d62e883132bb25f7f4f0832e7e102c2",class:"title"},this.recipeTitle),this.category&&a("p",{key:"ca58ac4811bf94d13761ac0fd3fdd63a4b35c057",class:"category"},this.category)),a("div",{key:"fe7531c32eb5b110fe5aea2c4680a020848633bd",class:"actions"},a("slot",{key:"daf97a1324f3d2d08d1900d057cab1968be8c9d7",name:"actions"}))))}};p.style=".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}";const n=class{constructor(a){r(this,a),this.rpSearch=e(this,"rpSearch"),this.rpClear=e(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 a(s,{key:"12550f4e6587473576e211fe1cfa5d075a02399f"},a("form",{key:"e1a61e15c159e8449770b7df63a649d84b136aa2",class:"bar",role:"search",onSubmit:this.onSubmit},a("input",{key:"defae81130bf361beae8a57c15633c6595437493",type:"search",class:"field",value:this.draft,placeholder:this.placeholder,"aria-label":this.label,onInput:this.onInput}),this.draft&&a("button",{key:"4cd2eac81b32f17d18e89c51a90e0a0d9edf7d01",type:"button",class:"clear",onClick:this.onClear,"aria-label":"Clear search"},"×"),a("button",{key:"b07034ed131233623d8edbdd16db3cfd8ffab4b7",type:"submit",class:"submit"},"Search")))}static get watchers(){return{value:[{onValueChange:0}]}}};n.style=".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)}";export{o as rp_filter_chips,c as rp_ingredient_list,d as rp_modal,p as rp_recipe_card,n as rp_search_bar}
|
|
1
|
+
import{r,c as e,h as a,H as s,g as i}from"./p-B4wAFfci.js";const o=class{constructor(a){r(this,a),this.rpFilterChange=e(this,"rpFilterChange")}options=[];selected=null;label="Filter";rpFilterChange;select(r){this.rpFilterChange.emit(this.selected===r?null:r)}render(){const r=Array.isArray(this.options)?this.options:[];return a(s,{key:"656b969af2e55a7c4313bc0c2c422e000811af53"},a("div",{key:"1da1173fc1d6d10a312a43466a0ea799b625caef",class:"chips",role:"group","aria-label":this.label},r.map((r=>a("button",{key:r,type:"button",class:{chip:!0,"is-selected":this.selected===r},"aria-pressed":String(this.selected===r),onClick:()=>this.select(r)},r)))))}};o.style=".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)}";const c=class{constructor(e){r(this,e)}items=[];render(){const r=Array.isArray(this.items)?this.items:[];return a(s,{key:"22708ae6e60de472b2f8e40fb54b33a2ec691ad1"},a("section",{key:"6f922fc37e3c230511bbdf72e55826dfa73e167e",class:"wrap"},a("slot",{key:"e9f0b16183f5ded825a5c1663caa54dcb6c2d961",name:"heading"},a("h2",{key:"c68ebf97056bc6309d3c4e79d1796d89eede1325",class:"heading"},"Ingredients")),0===r.length?a("p",{class:"empty"},"No ingredients listed for this recipe."):a("ul",{class:"list"},r.map(((r,e)=>a("li",{class:"row",key:`${r.name}-${e}`},a("span",{class:"name"},r.name),a("span",{class:"measure"},r.measure))))),a("div",{key:"28d26e1bbb9f14e5dedfb153ff87e44add5cfbfb",class:"note"},a("slot",{key:"20410e710e3c7dbc2ee9f6ad9493984382693687"}))))}};c.style=".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}";const t='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',d=class{constructor(a){r(this,a),this.rpClose=e(this,"rpClose")}get el(){return i(this)}open=!1;heading="";rpClose;previouslyFocused=null;onOpenChange(r){r?(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 r=this.el.querySelector(t);r?.focus()}onKeydown=r=>{if(this.open)return"Escape"===r.key?(r.preventDefault(),void this.rpClose.emit()):void("Tab"===r.key&&this.trapFocus(r))};trapFocus(r){const e=Array.from(this.el.querySelectorAll(t));if(0===e.length)return;const a=e[0],s=e[e.length-1],i=document.activeElement;r.shiftKey&&i===a?(r.preventDefault(),s.focus()):r.shiftKey||i!==s||(r.preventDefault(),a.focus())}onBackdropClick=r=>{r.target===r.currentTarget&&this.rpClose.emit()};render(){return this.open?a(s,null,a("div",{class:"backdrop",onClick:this.onBackdropClick},a("div",{class:"dialog",role:"dialog","aria-modal":"true","aria-label":this.heading},a("header",{class:"head"},a("h2",{class:"heading"},this.heading),a("button",{type:"button",class:"close",onClick:()=>this.rpClose.emit(),"aria-label":"Close dialog"},"×")),a("div",{class:"body"},a("slot",null)),a("footer",{class:"foot"},a("slot",{name:"footer"}))))):null}static get watchers(){return{open:[{onOpenChange:0}]}}};d.style=".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)}}}";const p=class{constructor(a){r(this,a),this.rpFavoriteToggle=e(this,"rpFavoriteToggle")}get el(){return i(this)}recipeId;recipeTitle;image;category;favorite=!1;rpFavoriteToggle;toggleFavorite=()=>{this.rpFavoriteToggle.emit({recipeId:this.recipeId,favorite:!this.favorite})};render(){const r=!0===this.favorite;return a(s,{key:"3b80c8e4ebd4e0e25d5aac0b09f39a458f82b0f2"},a("article",{key:"7df757f7135b928eb0df9c5bf62bda72c6694975",class:"card"},a("div",{key:"46d04f584290c5f894da560c4fc464968b51334c",class:"media"},this.image?a("img",{src:this.image,alt:"",loading:"lazy",width:"320",height:"240"}):a("div",{class:"media-fallback","aria-hidden":"true"}),a("div",{key:"8fb20568c256bf52b911d766acb826a78af54738",class:"badges"},a("slot",{key:"7a6ae3d9ea493e89942bf46c414b9b81f9fb287c"})),a("button",{key:"252477d86dfb1131b4417e0a3a99810f6b2626a5",type:"button",class:"favorite",onClick:this.toggleFavorite,"aria-pressed":r?"true":"false","aria-label":r?`Remove ${this.recipeTitle} from favorites`:`Add ${this.recipeTitle} to favorites`},a("svg",{key:"857ecd2421abd6a5177d0eccbc7f225e019bb4e8",viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":"true"},a("path",{key:"c6f7af10fa1f938ba76c8f5363b5d347eb959f19",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"})))),a("div",{key:"f09729fe072a150d074b92f3c84f1b337b5e10af",class:"body"},a("h3",{key:"79ce18be5cac3edb6ee23d221eb4eaf61ca910f8",class:"title"},this.recipeTitle),this.category&&a("p",{key:"47a0031f26046ea67bc31719fda810f9ccbd48fe",class:"category"},this.category)),a("div",{key:"cca23a5c5da2e80a58b7714ba53aa55122594b0f",class:"actions"},a("slot",{key:"cf828d445674da18c9a44545788a5d79685a325a",name:"actions"}))))}};p.style=".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}";const n=class{constructor(a){r(this,a),this.rpSearch=e(this,"rpSearch"),this.rpClear=e(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 a(s,{key:"12550f4e6587473576e211fe1cfa5d075a02399f"},a("form",{key:"e1a61e15c159e8449770b7df63a649d84b136aa2",class:"bar",role:"search",onSubmit:this.onSubmit},a("input",{key:"defae81130bf361beae8a57c15633c6595437493",type:"search",class:"field",value:this.draft,placeholder:this.placeholder,"aria-label":this.label,onInput:this.onInput}),this.draft&&a("button",{key:"4cd2eac81b32f17d18e89c51a90e0a0d9edf7d01",type:"button",class:"clear",onClick:this.onClear,"aria-label":"Clear search"},"×"),a("button",{key:"b07034ed131233623d8edbdd16db3cfd8ffab4b7",type:"submit",class:"submit"},"Search")))}static get watchers(){return{value:[{onValueChange:0}]}}};n.style=".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)}";export{o as rp_filter_chips,c as rp_ingredient_list,d as rp_modal,p as rp_recipe_card,n as rp_search_bar}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as a}from"./p-B4wAFfci.js";export{s as setNonce}from"./p-B4wAFfci.js";import{g as r}from"./p-DQuL1Twl.js";(()=>{const a=import.meta.url,r={};return""!==a&&(r.resourcesUrl=new URL(".",a).href),e(r)})().then((async e=>(await r(),a([["p-
|
|
1
|
+
import{p as e,b as a}from"./p-B4wAFfci.js";export{s as setNonce}from"./p-B4wAFfci.js";import{g as r}from"./p-DQuL1Twl.js";(()=>{const a=import.meta.url,r={};return""!==a&&(r.resourcesUrl=new URL(".",a).href),e(r)})().then((async e=>(await r(),a([["p-b98e7093",[[514,"rp-filter-chips",{options:[16],selected:[1],label:[1]}],[774,"rp-ingredient-list",{items:[16]}],[774,"rp-modal",{open:[516],heading:[1],focusFirstField:[64]},null,{open:[{onOpenChange:0}]}],[774,"rp-recipe-card",{recipeId:[1,"recipe-id"],recipeTitle:[1,"recipe-title"],image:[1],category:[1],favorite:[516]}],[514,"rp-search-bar",{value:[1],placeholder:[1],label:[1],draft:[32]},null,{value:[{onValueChange:0}]}]]],["p-0c8f7438",[[774,"rp-day-slot",{day:[1],dayLabel:[1,"day-label"],meals:[16],days:[16],dayLabels:[16],normalized:[32]}]]]],e))));
|