recipe-planner-ui 1.3.0 → 1.4.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/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/recipe-planner-ui.cjs.js +1 -1
- package/dist/cjs/rp-day-slot.cjs.entry.js +2 -2
- package/dist/cjs/rp-filter-chips_5.cjs.entry.js +21 -4
- package/dist/cjs/rp-filter-menu.cjs.entry.js +1 -1
- package/dist/collection/components/rp-day-slot/rp-day-slot.css +2 -2
- package/dist/collection/components/rp-day-slot/rp-day-slot.js +1 -1
- package/dist/collection/components/rp-filter-menu/rp-filter-menu.css +19 -2
- package/dist/collection/components/rp-recipe-card/rp-recipe-card.css +42 -0
- package/dist/collection/components/rp-recipe-card/rp-recipe-card.js +57 -2
- package/dist/collection/components/rp-search-bar/rp-search-bar.js +1 -1
- package/dist/components/rp-day-slot.js +1 -1
- package/dist/components/rp-filter-menu.js +1 -1
- package/dist/components/rp-recipe-card.js +1 -1
- package/dist/components/rp-search-bar.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/recipe-planner-ui.js +1 -1
- package/dist/esm/rp-day-slot.entry.js +2 -2
- package/dist/esm/rp-filter-chips_5.entry.js +21 -4
- package/dist/esm/rp-filter-menu.entry.js +1 -1
- package/dist/recipe-planner-ui/p-179f6d2f.entry.js +1 -0
- package/dist/recipe-planner-ui/{p-811d8206.entry.js → p-8f2706c2.entry.js} +1 -1
- package/dist/recipe-planner-ui/p-a5bf7500.entry.js +1 -0
- package/dist/recipe-planner-ui/recipe-planner-ui.esm.js +1 -1
- package/dist/types/components/rp-recipe-card/rp-recipe-card.d.ts +17 -0
- package/dist/types/components.d.ts +18 -0
- package/package.json +1 -1
- package/dist/recipe-planner-ui/p-9018ce87.entry.js +0 -1
- package/dist/recipe-planner-ui/p-9e84a578.entry.js +0 -1
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
|
6
6
|
const defineCustomElements = async (win, options) => {
|
|
7
7
|
if (typeof window === 'undefined') return undefined;
|
|
8
8
|
await appGlobals.globalScripts();
|
|
9
|
-
return index.bootstrapLazy([["rp-filter-chips_5.cjs",[[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],"area":[1],"minutes":[2],"favorite":[516],"imageLoading":[32],"imageFailed":[32],"pulsing":[32]}],[514,"rp-search-bar",{"value":[1],"placeholder":[1],"label":[1],"draft":[32]},null,{"value":[{"onValueChange":0}]}]]],["rp-day-slot.cjs",[[774,"rp-day-slot",{"day":[1],"dayLabel":[1,"day-label"],"meals":[16],"days":[16],"dayLabels":[16],"normalized":[32],"dropActive":[32],"draggingId":[32]}]]],["rp-filter-menu.cjs",[[514,"rp-filter-menu",{"label":[1],"options":[16],"selected":[1],"searchPlaceholder":[1,"search-placeholder"],"searchable":[4],"open":[1540],"filterText":[32],"activeIndex":[32]},[[5,"pointerdown","onDocumentPointerDown"],[4,"keydown","onDocumentKeydown"]],{"open":[{"onOpenChange":0}]}]]]], options);
|
|
9
|
+
return index.bootstrapLazy([["rp-filter-chips_5.cjs",[[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],"href":[1],"hrefLabel":[1,"href-label"],"area":[1],"minutes":[2],"favorite":[516],"imageLoading":[32],"imageFailed":[32],"pulsing":[32]}],[514,"rp-search-bar",{"value":[1],"placeholder":[1],"label":[1],"draft":[32]},null,{"value":[{"onValueChange":0}]}]]],["rp-day-slot.cjs",[[774,"rp-day-slot",{"day":[1],"dayLabel":[1,"day-label"],"meals":[16],"days":[16],"dayLabels":[16],"normalized":[32],"dropActive":[32],"draggingId":[32]}]]],["rp-filter-menu.cjs",[[514,"rp-filter-menu",{"label":[1],"options":[16],"selected":[1],"searchPlaceholder":[1,"search-placeholder"],"searchable":[4],"open":[1540],"filterText":[32],"activeIndex":[32]},[[5,"pointerdown","onDocumentPointerDown"],[4,"keydown","onDocumentKeydown"]],{"open":[{"onOpenChange":0}]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["rp-filter-chips_5.cjs",[[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],"area":[1],"minutes":[2],"favorite":[516],"imageLoading":[32],"imageFailed":[32],"pulsing":[32]}],[514,"rp-search-bar",{"value":[1],"placeholder":[1],"label":[1],"draft":[32]},null,{"value":[{"onValueChange":0}]}]]],["rp-day-slot.cjs",[[774,"rp-day-slot",{"day":[1],"dayLabel":[1,"day-label"],"meals":[16],"days":[16],"dayLabels":[16],"normalized":[32],"dropActive":[32],"draggingId":[32]}]]],["rp-filter-menu.cjs",[[514,"rp-filter-menu",{"label":[1],"options":[16],"selected":[1],"searchPlaceholder":[1,"search-placeholder"],"searchable":[4],"open":[1540],"filterText":[32],"activeIndex":[32]},[[5,"pointerdown","onDocumentPointerDown"],[4,"keydown","onDocumentKeydown"]],{"open":[{"onOpenChange":0}]}]]]], options);
|
|
22
|
+
return index.bootstrapLazy([["rp-filter-chips_5.cjs",[[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],"href":[1],"hrefLabel":[1,"href-label"],"area":[1],"minutes":[2],"favorite":[516],"imageLoading":[32],"imageFailed":[32],"pulsing":[32]}],[514,"rp-search-bar",{"value":[1],"placeholder":[1],"label":[1],"draft":[32]},null,{"value":[{"onValueChange":0}]}]]],["rp-day-slot.cjs",[[774,"rp-day-slot",{"day":[1],"dayLabel":[1,"day-label"],"meals":[16],"days":[16],"dayLabels":[16],"normalized":[32],"dropActive":[32],"draggingId":[32]}]]],["rp-filter-menu.cjs",[[514,"rp-filter-menu",{"label":[1],"options":[16],"selected":[1],"searchPlaceholder":[1,"search-placeholder"],"searchable":[4],"open":[1540],"filterText":[32],"activeIndex":[32]},[[5,"pointerdown","onDocumentPointerDown"],[4,"keydown","onDocumentKeydown"]],{"open":[{"onOpenChange":0}]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-CrJlwqe_.js');
|
|
4
4
|
|
|
5
|
-
const rpDaySlotCss = () => `.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:200px;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-xs);transition:border-color var(--rp-duration) var(--rp-ease), box-shadow var(--rp-duration) var(--rp-ease), background-color var(--rp-duration) var(--rp-ease)}.slot.is-empty.sc-rp-day-slot{background:var(--rp-color-surface-sunken);border-style:dashed}.slot.is-drop-active.sc-rp-day-slot{background:var(--rp-color-highlight-soft);border-style:solid;border-color:var(--rp-color-highlight);box-shadow:var(--rp-shadow-md), inset 0 0 0 1px var(--rp-color-highlight)}.head.sc-rp-day-slot{display:flex;gap:var(--rp-space-
|
|
5
|
+
const rpDaySlotCss = () => `.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:200px;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-xs);transition:border-color var(--rp-duration) var(--rp-ease), box-shadow var(--rp-duration) var(--rp-ease), background-color var(--rp-duration) var(--rp-ease)}.slot.is-empty.sc-rp-day-slot{background:var(--rp-color-surface-sunken);border-style:dashed}.slot.is-drop-active.sc-rp-day-slot{background:var(--rp-color-highlight-soft);border-style:solid;border-color:var(--rp-color-highlight);box-shadow:var(--rp-shadow-md), inset 0 0 0 1px var(--rp-color-highlight)}.head.sc-rp-day-slot{display:flex;gap:var(--rp-space-1);align-items:center;justify-content:space-between;padding:var(--rp-space-3) var(--rp-space-2) var(--rp-space-3) var(--rp-space-3);border-bottom:1px solid var(--rp-color-border)}.day.sc-rp-day-slot{min-width:0;margin:0;overflow:hidden;font-size:var(--rp-font-size-xs);font-weight:700;letter-spacing:0.08em;text-transform:uppercase;text-overflow:ellipsis;white-space:nowrap;color:var(--rp-color-text-muted)}.head-right.sc-rp-day-slot{display:flex;flex-shrink:0;gap:var(--rp-space-2);align-items:center}.count.sc-rp-day-slot{display:grid;place-items:center;min-width:20px;height:20px;padding:0 6px;font-size:0.6875rem;font-weight:700;font-variant-numeric:tabular-nums;color:var(--rp-caramel-600);background:var(--rp-color-highlight-soft);border-radius:var(--rp-radius-pill)}.add.sc-rp-day-slot{display:grid;place-items:center;width:26px;height:26px;padding:0;cursor:pointer;color:var(--rp-color-accent-contrast);background:var(--rp-color-accent);border:none;border-radius:50%;transition:transform var(--rp-duration-fast) var(--rp-ease), background-color var(--rp-duration-fast) var(--rp-ease)}.add.sc-rp-day-slot svg.sc-rp-day-slot{fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}.add.sc-rp-day-slot:hover{background:var(--rp-color-highlight);transform:rotate(90deg) scale(1.1)}.add.sc-rp-day-slot:active{transform:rotate(90deg) scale(0.92)}.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{position:relative;padding:var(--rp-space-3) var(--rp-space-3) var(--rp-space-2);cursor:grab;background:var(--rp-color-surface-sunken);border:1px solid var(--rp-color-border);border-radius:var(--rp-radius-md);transition:transform var(--rp-duration-fast) var(--rp-ease), box-shadow var(--rp-duration-fast) var(--rp-ease), opacity var(--rp-duration-fast) var(--rp-ease)}.meal.sc-rp-day-slot:hover{background:var(--rp-color-surface);box-shadow:var(--rp-shadow-sm);transform:translateY(-1px)}.meal.sc-rp-day-slot:active{cursor:grabbing}.meal.is-dragging.sc-rp-day-slot{opacity:0.4;box-shadow:none;transform:none}.grip.sc-rp-day-slot{position:absolute;inset-block-start:var(--rp-space-2);inset-inline-end:var(--rp-space-2);display:block;opacity:0;transition:opacity var(--rp-duration-fast) var(--rp-ease)}.grip.sc-rp-day-slot svg.sc-rp-day-slot{display:block;fill:var(--rp-color-text-subtle)}.meal.sc-rp-day-slot:hover .grip.sc-rp-day-slot{opacity:1}.meal-title.sc-rp-day-slot{display:block;padding-inline-end:var(--rp-space-4);font-size:var(--rp-font-size-sm);font-weight:500;line-height:1.35;color:var(--rp-color-text)}.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:3px var(--rp-space-2);font:inherit;font-size:var(--rp-font-size-xs);color:var(--rp-color-text-muted);cursor:pointer;background:var(--rp-color-surface);border:1px solid var(--rp-color-border);border-radius:var(--rp-radius-sm);transition:border-color var(--rp-duration-fast) var(--rp-ease)}.move-select.sc-rp-day-slot:hover{border-color:var(--rp-color-border-strong)}.remove.sc-rp-day-slot{display:grid;place-items:center;width:24px;height:24px;padding:0;color:var(--rp-color-text-subtle);cursor:pointer;background:none;border:none;border-radius:var(--rp-radius-sm);transition:color var(--rp-duration-fast) var(--rp-ease), background-color var(--rp-duration-fast) var(--rp-ease)}.remove.sc-rp-day-slot svg.sc-rp-day-slot{fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}.remove.sc-rp-day-slot:hover{color:var(--rp-color-danger);background:var(--rp-color-danger-soft)}.empty.sc-rp-day-slot{display:flex;flex:1;flex-direction:column;gap:var(--rp-space-2);align-items:center;justify-content:center;padding:var(--rp-space-4) var(--rp-space-3);text-align:center}.empty-icon.sc-rp-day-slot{fill:none;stroke:var(--rp-color-text-subtle);stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}.empty-text.sc-rp-day-slot{margin:0;font-size:var(--rp-font-size-xs);color:var(--rp-color-text-subtle)}.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}@media (prefers-reduced-motion: reduce){.slot.sc-rp-day-slot,.meal.sc-rp-day-slot,.add.sc-rp-day-slot,.grip.sc-rp-day-slot,.remove.sc-rp-day-slot,.move-select.sc-rp-day-slot{transition:none}.meal.sc-rp-day-slot:hover,.add.sc-rp-day-slot:hover,.add.sc-rp-day-slot:active{transform:none}.grip.sc-rp-day-slot{opacity:1}}`;
|
|
6
6
|
|
|
7
7
|
const DaySlot = class {
|
|
8
8
|
constructor(hostRef) {
|
|
@@ -123,7 +123,7 @@ const DaySlot = class {
|
|
|
123
123
|
const days = Array.isArray(this.days) ? this.days : [];
|
|
124
124
|
const labels = this.dayLabels ?? {};
|
|
125
125
|
const meals = this.normalized;
|
|
126
|
-
return (index.h(index.Host, { key: '755cdc190abccb9b0350caf7e4fad05675dd6e0e' }, index.h("section", { key: '927c1e962ce3f918e001965da10bb39b82cab5bc', class: { slot: true, 'is-drop-active': this.dropActive, 'is-empty': meals.length === 0 }, onDragEnter: this.onDragEnter, onDragOver: this.onDragOver, onDragLeave: this.onDragLeave, onDrop: this.onDrop }, index.h("header", { key: '415e9d56f9b190fd291af942c01427cc4b9b66ea', class: "head" }, index.h("h3", { key: 'd0f20de86c70d85da545ec9ec9c57790961b78f0', class: "day" }, this.dayLabel || this.day), index.h("div", { key: '484a1e743a3f251865288f345ead14d87741ff8e', class: "head-right" }, meals.length > 0 && index.h("span", { key: 'ac3324168f0061f4bb173090e21c4b6f2334a168', class: "count" }, meals.length), index.h("button", { key: '
|
|
126
|
+
return (index.h(index.Host, { key: '755cdc190abccb9b0350caf7e4fad05675dd6e0e' }, index.h("section", { key: '927c1e962ce3f918e001965da10bb39b82cab5bc', class: { slot: true, 'is-drop-active': this.dropActive, 'is-empty': meals.length === 0 }, onDragEnter: this.onDragEnter, onDragOver: this.onDragOver, onDragLeave: this.onDragLeave, onDrop: this.onDrop }, index.h("header", { key: '415e9d56f9b190fd291af942c01427cc4b9b66ea', class: "head" }, index.h("h3", { key: 'd0f20de86c70d85da545ec9ec9c57790961b78f0', class: "day" }, this.dayLabel || this.day), index.h("div", { key: '484a1e743a3f251865288f345ead14d87741ff8e', class: "head-right" }, meals.length > 0 && index.h("span", { key: 'ac3324168f0061f4bb173090e21c4b6f2334a168', class: "count" }, meals.length), index.h("button", { key: '39ab0098f8eea2a349a5169f3e3770e73fd425ed', type: "button", class: "add", onClick: () => this.rpAddMeal.emit(this.day), "aria-label": `Add a meal to ${(this.dayLabels ?? {})[this.day] || this.dayLabel || this.day}` }, index.h("svg", { key: '7f4619e9f352a49d98176682b9e811ad282268fb', viewBox: "0 0 24 24", width: "15", height: "15", "aria-hidden": "true" }, index.h("path", { key: '2c4926b901b49b79227db275ae9ccea71b7cb68b', d: "M12 5v14M5 12h14" }))))), meals.length === 0 ? (index.h("div", { class: "empty" }, index.h("slot", null, index.h("svg", { class: "empty-icon", viewBox: "0 0 24 24", width: "26", height: "26", "aria-hidden": "true" }, index.h("path", { d: "M4 4h16v16H4z", opacity: "0.35" }), index.h("path", { d: "M8 2v4M16 2v4M4 10h16" })), index.h("p", { class: "empty-text" }, "No meals planned")))) : (index.h("ul", { class: "meals" }, meals.map((meal) => (index.h("li", { class: { meal: true, 'is-dragging': this.draggingId === meal.id }, key: meal.id, draggable: true, onDragStart: (event) => this.onDragStart(event, meal), onDragEnd: this.onDragEnd }, index.h("span", { class: "grip", "aria-hidden": "true" }, index.h("svg", { viewBox: "0 0 24 24", width: "12", height: "12" }, index.h("circle", { cx: "9", cy: "6", r: "1.4" }), index.h("circle", { cx: "15", cy: "6", r: "1.4" }), index.h("circle", { cx: "9", cy: "12", r: "1.4" }), index.h("circle", { cx: "15", cy: "12", r: "1.4" }), index.h("circle", { cx: "9", cy: "18", r: "1.4" }), index.h("circle", { cx: "15", cy: "18", r: "1.4" }))), index.h("span", { class: "meal-title" }, meal.title), index.h("div", { class: "meal-actions" }, index.h("label", { class: "move" }, index.h("span", { class: "sr-only" }, `Move ${meal.title} to another day`), index.h("select", { class: "move-select", onChange: (event) => this.onMove(event, meal) }, index.h("option", { value: "" }, "Move\u2026"), days
|
|
127
127
|
.filter((day) => day !== this.day)
|
|
128
128
|
.map((day) => (index.h("option", { key: day, value: day }, labels[day] ?? day))))), index.h("button", { type: "button", class: "remove", onClick: () => this.rpRemoveMeal.emit({ id: meal.id, day: this.day }), "aria-label": `Remove ${meal.title}` }, index.h("svg", { viewBox: "0 0 24 24", width: "13", height: "13", "aria-hidden": "true" }, index.h("path", { d: "M6 6l12 12M18 6L6 18" }))))))))))));
|
|
129
129
|
}
|
|
@@ -145,7 +145,7 @@ const Modal = class {
|
|
|
145
145
|
};
|
|
146
146
|
Modal.style = rpModalCss();
|
|
147
147
|
|
|
148
|
-
const rpRecipeCardCss = () => `.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);transition:transform var(--rp-duration) var(--rp-ease), box-shadow var(--rp-duration) var(--rp-ease), border-color var(--rp-duration) var(--rp-ease)}.sc-rp-recipe-card-h:hover .card.sc-rp-recipe-card{border-color:var(--rp-color-border-strong);box-shadow:var(--rp-shadow-lg);transform:translateY(-4px)}.media.sc-rp-recipe-card{position:relative;aspect-ratio:4 / 3;overflow:hidden;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;transition:transform var(--rp-duration-slow) var(--rp-ease), opacity var(--rp-duration) var(--rp-ease)}.sc-rp-recipe-card-h:hover .media.sc-rp-recipe-card img.sc-rp-recipe-card{transform:scale(1.04)}.media.is-loading.sc-rp-recipe-card img.sc-rp-recipe-card{opacity:0}.media-fallback.sc-rp-recipe-card{width:100%;height:100%;background:radial-gradient(circle at 30% 25%, rgb(255 255 255 / 0.55), transparent 55%), linear-gradient(135deg, var(--rp-caramel-100), var(--rp-cream-400))}.scrim.sc-rp-recipe-card{position:absolute;inset:0;pointer-events:none;background:linear-gradient(to bottom, rgb(44 24 16 / 0.18) 0%, transparent 34%)}.badges.sc-rp-recipe-card{position:absolute;inset-block-start:var(--rp-space-3);inset-inline-start:var(--rp-space-3);display:flex;flex-wrap:wrap;gap:var(--rp-space-1)}.favorite.sc-rp-recipe-card{position:absolute;inset-block-start:var(--rp-space-3);inset-inline-end:var(--rp-space-3);display:grid;place-items:center;width:36px;height:36px;padding:0;cursor:pointer;background:rgb(255 255 255 / 0.82);backdrop-filter:blur(8px);border:1px solid rgb(255 255 255 / 0.6);border-radius:50%;box-shadow:var(--rp-shadow-sm);transition:transform var(--rp-duration-fast) var(--rp-ease), background-color var(--rp-duration-fast) var(--rp-ease)}.favorite.sc-rp-recipe-card:hover{background:var(--rp-color-surface);transform:scale(1.08)}.favorite.sc-rp-recipe-card:active{transform:scale(0.94)}.favorite.sc-rp-recipe-card svg.sc-rp-recipe-card{fill:none;stroke:var(--rp-espresso-800);stroke-width:1.9;stroke-linejoin:round;transition:fill var(--rp-duration-fast) var(--rp-ease), stroke var(--rp-duration-fast) var(--rp-ease)}[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-strong)}[favorite].sc-rp-recipe-card-h .favorite.sc-rp-recipe-card:hover svg.sc-rp-recipe-card{fill:var(--rp-color-favorite-strong)}.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-4) var(--rp-space-4) var(--rp-space-3)}.title.sc-rp-recipe-card{margin:0;font-family:var(--rp-font-serif);font-size:1.0625rem;font-weight:600;line-height:1.28;letter-spacing:-0.01em;color:var(--rp-color-text);display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden}.meta.sc-rp-recipe-card{display:flex;flex-wrap:wrap;gap:var(--rp-space-1);margin-top:var(--rp-space-3)}.pill.sc-rp-recipe-card{padding:3px 10px;font-size:var(--rp-font-size-xs);font-weight:500;letter-spacing:0.01em;color:var(--rp-color-text-muted);background:var(--rp-color-surface-sunken);border:1px solid var(--rp-color-border);border-radius:var(--rp-radius-pill);white-space:nowrap}.pill-category.sc-rp-recipe-card{color:var(--rp-caramel-600);background:var(--rp-color-highlight-soft);border-color:transparent}.actions.sc-rp-recipe-card{display:flex;gap:var(--rp-space-3);align-items:center;padding:0 var(--rp-space-4) var(--rp-space-4)}.actions.sc-rp-recipe-card:not(:has(*)){display:none}@media (prefers-reduced-motion: no-preference){.media.is-loading.sc-rp-recipe-card::after{content:'';position:absolute;inset:0;background:linear-gradient( 100deg, transparent 20%, rgb(255 255 255 / 0.7) 50%, transparent 80% );background-size:220% 100%;animation:rp-card-shimmer 1.6s var(--rp-ease) infinite}@keyframes rp-card-shimmer{from{background-position:180% 0}to{background-position:-80% 0}}.favorite.is-pulsing.sc-rp-recipe-card{animation:rp-favorite-pop 400ms var(--rp-ease)}@keyframes rp-favorite-pop{0%{transform:scale(1)}35%{transform:scale(0.86)}70%{transform:scale(1.16)}100%{transform:scale(1)}}.favorite.is-pulsing.sc-rp-recipe-card svg.sc-rp-recipe-card{animation:rp-heart-beat 400ms var(--rp-ease);transform-origin:center}@keyframes rp-heart-beat{0%{transform:scale(1)}30%{transform:scale(0.7)}55%{transform:scale(1.35)}75%{transform:scale(0.94)}100%{transform:scale(1)}}}@media (prefers-reduced-motion: reduce){.card.sc-rp-recipe-card,.media.sc-rp-recipe-card img.sc-rp-recipe-card,.favorite.sc-rp-recipe-card{transition:none}.sc-rp-recipe-card-h:hover .card.sc-rp-recipe-card{transform:none}.sc-rp-recipe-card-h:hover .media.sc-rp-recipe-card img.sc-rp-recipe-card{transform:none}.media.is-loading.sc-rp-recipe-card img.sc-rp-recipe-card{opacity:1}}`;
|
|
148
|
+
const rpRecipeCardCss = () => `.sc-rp-recipe-card-h{display:block;font-family:var(--rp-font-sans);color:var(--rp-color-text)}.card.sc-rp-recipe-card{position:relative;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);transition:transform var(--rp-duration) var(--rp-ease), box-shadow var(--rp-duration) var(--rp-ease), border-color var(--rp-duration) var(--rp-ease)}.cover-link.sc-rp-recipe-card{position:absolute;inset:0;z-index:1;border-radius:inherit}.actions.sc-rp-recipe-card{position:relative}.favorite.sc-rp-recipe-card,.actions.sc-rp-recipe-card,.badges.sc-rp-recipe-card{z-index:2}.cover-link.sc-rp-recipe-card:focus-visible{outline:var(--rp-focus-ring);outline-offset:-2px}.sr-only.sc-rp-recipe-card{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.sc-rp-recipe-card-h:hover .card.sc-rp-recipe-card{border-color:var(--rp-color-border-strong);box-shadow:var(--rp-shadow-lg);transform:translateY(-4px)}.media.sc-rp-recipe-card{position:relative;aspect-ratio:4 / 3;overflow:hidden;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;transition:transform var(--rp-duration-slow) var(--rp-ease), opacity var(--rp-duration) var(--rp-ease)}.sc-rp-recipe-card-h:hover .media.sc-rp-recipe-card img.sc-rp-recipe-card{transform:scale(1.04)}.media.is-loading.sc-rp-recipe-card img.sc-rp-recipe-card{opacity:0}.media-fallback.sc-rp-recipe-card{width:100%;height:100%;background:radial-gradient(circle at 30% 25%, rgb(255 255 255 / 0.55), transparent 55%), linear-gradient(135deg, var(--rp-caramel-100), var(--rp-cream-400))}.scrim.sc-rp-recipe-card{position:absolute;inset:0;pointer-events:none;background:linear-gradient(to bottom, rgb(44 24 16 / 0.18) 0%, transparent 34%)}.badges.sc-rp-recipe-card{position:absolute;inset-block-start:var(--rp-space-3);inset-inline-start:var(--rp-space-3);display:flex;flex-wrap:wrap;gap:var(--rp-space-1)}.favorite.sc-rp-recipe-card{position:absolute;inset-block-start:var(--rp-space-3);inset-inline-end:var(--rp-space-3);display:grid;place-items:center;width:36px;height:36px;padding:0;cursor:pointer;background:rgb(255 255 255 / 0.82);backdrop-filter:blur(8px);border:1px solid rgb(255 255 255 / 0.6);border-radius:50%;box-shadow:var(--rp-shadow-sm);transition:transform var(--rp-duration-fast) var(--rp-ease), background-color var(--rp-duration-fast) var(--rp-ease)}.favorite.sc-rp-recipe-card:hover{background:var(--rp-color-surface);transform:scale(1.08)}.favorite.sc-rp-recipe-card:active{transform:scale(0.94)}.favorite.sc-rp-recipe-card svg.sc-rp-recipe-card{fill:none;stroke:var(--rp-espresso-800);stroke-width:1.9;stroke-linejoin:round;transition:fill var(--rp-duration-fast) var(--rp-ease), stroke var(--rp-duration-fast) var(--rp-ease)}[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-strong)}[favorite].sc-rp-recipe-card-h .favorite.sc-rp-recipe-card:hover svg.sc-rp-recipe-card{fill:var(--rp-color-favorite-strong)}.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-4) var(--rp-space-4) var(--rp-space-3)}.title.sc-rp-recipe-card{margin:0;font-family:var(--rp-font-serif);font-size:1.0625rem;font-weight:600;line-height:1.28;letter-spacing:-0.01em;color:var(--rp-color-text);display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden}.meta.sc-rp-recipe-card{display:flex;flex-wrap:wrap;gap:var(--rp-space-1);margin-top:var(--rp-space-3)}.pill.sc-rp-recipe-card{padding:3px 10px;font-size:var(--rp-font-size-xs);font-weight:500;letter-spacing:0.01em;color:var(--rp-color-text-muted);background:var(--rp-color-surface-sunken);border:1px solid var(--rp-color-border);border-radius:var(--rp-radius-pill);white-space:nowrap}.pill-category.sc-rp-recipe-card{color:var(--rp-caramel-600);background:var(--rp-color-highlight-soft);border-color:transparent}.actions.sc-rp-recipe-card{display:flex;gap:var(--rp-space-3);align-items:center;padding:0 var(--rp-space-4) var(--rp-space-4)}.actions.sc-rp-recipe-card:not(:has(*)){display:none}@media (prefers-reduced-motion: no-preference){.media.is-loading.sc-rp-recipe-card::after{content:'';position:absolute;inset:0;background:linear-gradient( 100deg, transparent 20%, rgb(255 255 255 / 0.7) 50%, transparent 80% );background-size:220% 100%;animation:rp-card-shimmer 1.6s var(--rp-ease) infinite}@keyframes rp-card-shimmer{from{background-position:180% 0}to{background-position:-80% 0}}.favorite.is-pulsing.sc-rp-recipe-card{animation:rp-favorite-pop 400ms var(--rp-ease)}@keyframes rp-favorite-pop{0%{transform:scale(1)}35%{transform:scale(0.86)}70%{transform:scale(1.16)}100%{transform:scale(1)}}.favorite.is-pulsing.sc-rp-recipe-card svg.sc-rp-recipe-card{animation:rp-heart-beat 400ms var(--rp-ease);transform-origin:center}@keyframes rp-heart-beat{0%{transform:scale(1)}30%{transform:scale(0.7)}55%{transform:scale(1.35)}75%{transform:scale(0.94)}100%{transform:scale(1)}}}@media (prefers-reduced-motion: reduce){.card.sc-rp-recipe-card,.media.sc-rp-recipe-card img.sc-rp-recipe-card,.favorite.sc-rp-recipe-card{transition:none}.sc-rp-recipe-card-h:hover .card.sc-rp-recipe-card{transform:none}.sc-rp-recipe-card-h:hover .media.sc-rp-recipe-card img.sc-rp-recipe-card{transform:none}.media.is-loading.sc-rp-recipe-card img.sc-rp-recipe-card{opacity:1}}`;
|
|
149
149
|
|
|
150
150
|
const RecipeCard = class {
|
|
151
151
|
constructor(hostRef) {
|
|
@@ -166,6 +166,23 @@ const RecipeCard = class {
|
|
|
166
166
|
image;
|
|
167
167
|
/** Category label shown under the heading. */
|
|
168
168
|
category;
|
|
169
|
+
/**
|
|
170
|
+
* Destination for the whole card.
|
|
171
|
+
*
|
|
172
|
+
* Given one, the card renders a link that covers its full area, so the tile behaves the
|
|
173
|
+
* way a card is expected to: clicking anywhere opens the recipe. The favorite button and
|
|
174
|
+
* anything in the `actions` slot sit above it and keep their own behaviour.
|
|
175
|
+
*
|
|
176
|
+
* This is still a plain URL, not route knowledge — the component neither builds it nor
|
|
177
|
+
* knows what it points at, so a consumer with no router can pass an ordinary href.
|
|
178
|
+
* Omitting it leaves the card inert, which is what the planner picker wants.
|
|
179
|
+
*/
|
|
180
|
+
href;
|
|
181
|
+
/**
|
|
182
|
+
* Accessible name for that link. Defaults to the recipe title, which is what a link
|
|
183
|
+
* covering a whole card should announce.
|
|
184
|
+
*/
|
|
185
|
+
hrefLabel;
|
|
169
186
|
/** Cuisine or region, shown as a second meta pill when present. */
|
|
170
187
|
area;
|
|
171
188
|
/** Preparation time in minutes, shown as a meta pill when present. */
|
|
@@ -211,9 +228,9 @@ const RecipeCard = class {
|
|
|
211
228
|
// toggle button with no announced state.
|
|
212
229
|
const isFavorite = this.favorite === true;
|
|
213
230
|
const showImage = this.image && !this.imageFailed;
|
|
214
|
-
return (index.h(index.Host, { key: '
|
|
231
|
+
return (index.h(index.Host, { key: 'c459d1443e3e06a5337cdc0cecdc16c3ea56294d' }, index.h("article", { key: '62d9e4e5e294a68317f6342e54a479c55922d688', class: "card" }, index.h("div", { key: 'c9885db03c40942d964e27a8c61f8020f356931f', class: { media: true, 'is-loading': showImage && this.imageLoading } }, showImage ? (index.h("img", { src: this.image, alt: "", loading: "lazy", width: "320", height: "240", ref: this.onImageRef, onLoad: () => (this.imageLoading = false), onError: () => (this.imageFailed = true) })) : (index.h("div", { class: "media-fallback", "aria-hidden": "true" })), index.h("div", { key: 'f5cb1bebf95e477284c26c8b3e1557346a12f1d5', class: "scrim", "aria-hidden": "true" }), index.h("div", { key: '2601c77e1a107a2d0a32b0eec0dbcce486ae8acb', class: "badges" }, index.h("slot", { key: '0fb0cf3b7448bb18be797e1a21d816a97046f1e8' })), index.h("button", { key: '2d1eb62ec0c103f2aac88e287280c4424d919157', type: "button", class: { favorite: true, 'is-pulsing': this.pulsing }, onClick: this.toggleFavorite, "aria-pressed": isFavorite ? 'true' : 'false', "aria-label": isFavorite
|
|
215
232
|
? `Remove ${this.recipeTitle} from favorites`
|
|
216
|
-
: `Add ${this.recipeTitle} to favorites` }, index.h("svg", { key: '
|
|
233
|
+
: `Add ${this.recipeTitle} to favorites` }, index.h("svg", { key: '169b9149fe3656002ff771c3786af517d78ed1f4', viewBox: "0 0 24 24", width: "18", height: "18", "aria-hidden": "true" }, index.h("path", { key: '721c06fe6cb505e8afe1374053e4bf064a951112', 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" })))), this.href && (index.h("a", { key: '35a17b168836bdf269e8d4c89f7fc6eaa0ed856c', class: "cover-link", href: this.href }, index.h("span", { key: '4748b1df3f61d6f66666d3126b085564ff6328ce', class: "sr-only" }, this.hrefLabel ?? this.recipeTitle))), index.h("div", { key: 'af70f7b9378c55a86d00f1f69fe50891c67063fb', class: "body" }, index.h("h3", { key: '1ba153f7411ac15d2e9f46ae392561bb355e9b90', class: "title" }, this.recipeTitle), index.h("div", { key: '42b58a5cca47387b66bc330b392a3040c2180bdb', class: "meta" }, this.category && index.h("span", { key: '6f90d80646df6338b70e9f2a848da1a693378132', class: "pill pill-category" }, this.category), this.area && index.h("span", { key: '7fd3ff865ae448037f9f4ca18e170773ae1c8efd', class: "pill" }, this.area), this.minutes ? index.h("span", { class: "pill" }, this.minutes, " min") : null)), index.h("div", { key: 'e63bc9c212d905ee22c3c68a99d82699b5b6c8a4', class: "actions" }, index.h("slot", { key: '3dfe7aeea9df0384fbeb17a1680a92681d7f13a3', name: "actions" })))));
|
|
217
234
|
}
|
|
218
235
|
};
|
|
219
236
|
RecipeCard.style = rpRecipeCardCss();
|
|
@@ -260,7 +277,7 @@ const SearchBar = class {
|
|
|
260
277
|
this.rpClear.emit();
|
|
261
278
|
};
|
|
262
279
|
render() {
|
|
263
|
-
return (index.h(index.Host, { key: '
|
|
280
|
+
return (index.h(index.Host, { key: '5007c83c2d6a11e509eaac4471ccbd2313a75f10' }, index.h("form", { key: 'c6ea64c0ba0b1616ce3eef310e23611c8ca31581', class: "bar", role: "search", onSubmit: this.onSubmit }, index.h("svg", { key: '5d79ea20bc29076f797230f1d46bb164e72a89d8', class: "icon", viewBox: "0 0 24 24", width: "18", height: "18", "aria-hidden": "true" }, index.h("circle", { key: '755a9241cf956853ea76f0576781d7b7c47172a9', cx: "11", cy: "11", r: "7" }), index.h("path", { key: '4bbb916f1c7a2ac5459a721b0d4bee2f96d0d2c8', d: "m20 20-3.6-3.6" })), index.h("input", { key: 'b6acce26123ea9af546738d213cac6f5ba7af31b', type: "search", class: "field", value: this.draft, placeholder: this.placeholder, "aria-label": this.label, onInput: this.onInput }), this.draft && (index.h("button", { key: 'a8e4e40d7375082175417f6947a77518fb44a804', type: "button", class: "clear", onClick: this.onClear, "aria-label": "Clear search" }, index.h("svg", { key: '638af98be0c5ebba34bd45f1ab1cd25cf488ed7d', viewBox: "0 0 24 24", width: "14", height: "14", "aria-hidden": "true" }, index.h("path", { key: 'e3322a0f0a82f586ac5ce12867ea2ac87760bc9d', d: "M6 6l12 12M18 6L6 18" })))), index.h("button", { key: 'ba6db0b5943c9396926b21bf09a4a1be44acf20b', type: "submit", class: "submit" }, "Search"))));
|
|
264
281
|
}
|
|
265
282
|
static get watchers() { return {
|
|
266
283
|
"value": [{
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-CrJlwqe_.js');
|
|
4
4
|
|
|
5
|
-
const rpFilterMenuCss = () => `.sc-rp-filter-menu-h{display:inline-block;font-family:var(--rp-font-sans)}.wrap.sc-rp-filter-menu{position:relative;display:inline-flex;align-items:center;gap:var(--rp-space-1)}.trigger.sc-rp-filter-menu{display:inline-flex;gap:var(--rp-space-2);align-items:center;padding:8px var(--rp-space-4);font:inherit;font-size:var(--rp-font-size-sm);font-weight:600;color:var(--rp-color-text-body);cursor:pointer;background:var(--rp-color-surface);border:1px solid var(--rp-color-border);border-radius:var(--rp-radius-pill);transition:color var(--rp-duration-fast) var(--rp-ease), background-color var(--rp-duration-fast) var(--rp-ease), border-color var(--rp-duration-fast) var(--rp-ease), box-shadow var(--rp-duration-fast) var(--rp-ease)}.trigger.sc-rp-filter-menu:hover{color:var(--rp-color-text);border-color:var(--rp-color-border-strong);box-shadow:var(--rp-shadow-sm)}.trigger.is-active.sc-rp-filter-menu{color:var(--rp-color-accent-contrast);background:var(--rp-color-accent);border-color:var(--rp-color-accent);box-shadow:var(--rp-shadow-sm)}[open].sc-rp-filter-menu-h .trigger.sc-rp-filter-menu{border-color:var(--rp-color-focus);box-shadow:var(--rp-focus-halo)}.trigger-value.sc-rp-filter-menu{max-width:12ch;overflow:hidden;font-weight:500;text-overflow:ellipsis;white-space:nowrap;opacity:0.85}.trigger-value.sc-rp-filter-menu::before{content:'· ';opacity:0.6}.chevron.sc-rp-filter-menu{flex-shrink:0;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;transition:transform var(--rp-duration-fast) var(--rp-ease)}[open].sc-rp-filter-menu-h .chevron.sc-rp-filter-menu{transform:rotate(180deg)}.clear.sc-rp-filter-menu{display:grid;place-items:center;width:24px;height:24px;padding:0;color:var(--rp-color-text-subtle);cursor:pointer;background:none;border:none;border-radius:50%;transition:color var(--rp-duration-fast) var(--rp-ease), background-color var(--rp-duration-fast) var(--rp-ease)}.clear.sc-rp-filter-menu svg.sc-rp-filter-menu{fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round}.clear.sc-rp-filter-menu:hover{color:var(--rp-color-danger);background:var(--rp-color-danger-soft)}.tray.sc-rp-filter-menu{position:absolute;inset-block-start:calc(100% + var(--rp-space-2));inset-inline-start:0;z-index:30;display:flex;flex-direction:column;width:max(240px, 100%);max-height:340px;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-lg)}.search.sc-rp-filter-menu{display:flex;gap:var(--rp-space-2);align-items:center;flex-shrink:0;padding:var(--rp-space-3);border-bottom:1px solid var(--rp-color-border)}.search-icon.sc-rp-filter-menu{flex-shrink:0;fill:none;stroke:var(--rp-color-text-subtle);stroke-width:2;stroke-linecap:round}.search-field.sc-rp-filter-menu{flex:1;min-width:0;font:inherit;font-size:var(--rp-font-size-sm);color:var(--rp-color-text);background:none;border:none}.search-field.sc-rp-filter-menu::placeholder{color:var(--rp-color-text-subtle)}.search-field.sc-rp-filter-menu:focus{outline:none}.options.sc-rp-filter-menu{flex:1;padding:var(--rp-space-1);overflow-y:auto;overscroll-behavior:contain}.option.sc-rp-filter-menu{display:flex;gap:var(--rp-space-2);align-items:center;justify-content:space-between;width:100%;padding:
|
|
5
|
+
const rpFilterMenuCss = () => `.sc-rp-filter-menu-h{display:inline-block;font-family:var(--rp-font-sans)}.wrap.sc-rp-filter-menu{position:relative;display:inline-flex;align-items:center;gap:var(--rp-space-1)}.trigger.sc-rp-filter-menu{display:inline-flex;gap:var(--rp-space-2);align-items:center;padding:8px var(--rp-space-4);font:inherit;font-size:var(--rp-font-size-sm);font-weight:600;color:var(--rp-color-text-body);cursor:pointer;background:var(--rp-color-surface);border:1px solid var(--rp-color-border);border-radius:var(--rp-radius-pill);transition:color var(--rp-duration-fast) var(--rp-ease), background-color var(--rp-duration-fast) var(--rp-ease), border-color var(--rp-duration-fast) var(--rp-ease), box-shadow var(--rp-duration-fast) var(--rp-ease)}.trigger.sc-rp-filter-menu:hover{color:var(--rp-color-text);border-color:var(--rp-color-border-strong);box-shadow:var(--rp-shadow-sm)}.trigger.is-active.sc-rp-filter-menu{color:var(--rp-color-accent-contrast);background:var(--rp-color-accent);border-color:var(--rp-color-accent);box-shadow:var(--rp-shadow-sm)}[open].sc-rp-filter-menu-h .trigger.sc-rp-filter-menu{border-color:var(--rp-color-focus);box-shadow:var(--rp-focus-halo)}.trigger-value.sc-rp-filter-menu{max-width:12ch;overflow:hidden;font-weight:500;text-overflow:ellipsis;white-space:nowrap;opacity:0.85}.trigger-value.sc-rp-filter-menu::before{content:'· ';opacity:0.6}.chevron.sc-rp-filter-menu{flex-shrink:0;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;transition:transform var(--rp-duration-fast) var(--rp-ease)}[open].sc-rp-filter-menu-h .chevron.sc-rp-filter-menu{transform:rotate(180deg)}.clear.sc-rp-filter-menu{display:grid;place-items:center;width:24px;height:24px;padding:0;color:var(--rp-color-text-subtle);cursor:pointer;background:none;border:none;border-radius:50%;transition:color var(--rp-duration-fast) var(--rp-ease), background-color var(--rp-duration-fast) var(--rp-ease)}.clear.sc-rp-filter-menu svg.sc-rp-filter-menu{fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round}.clear.sc-rp-filter-menu:hover{color:var(--rp-color-danger);background:var(--rp-color-danger-soft)}.tray.sc-rp-filter-menu{position:absolute;inset-block-start:calc(100% + var(--rp-space-2));inset-inline-start:0;z-index:30;display:flex;flex-direction:column;width:max(240px, 100%);max-height:340px;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-lg)}.search.sc-rp-filter-menu{display:flex;gap:var(--rp-space-2);align-items:center;flex-shrink:0;padding:var(--rp-space-3);border-bottom:1px solid var(--rp-color-border)}.search-icon.sc-rp-filter-menu{flex-shrink:0;fill:none;stroke:var(--rp-color-text-subtle);stroke-width:2;stroke-linecap:round}.search-field.sc-rp-filter-menu{flex:1;min-width:0;font:inherit;font-size:var(--rp-font-size-sm);font-weight:500;letter-spacing:-0.005em;color:var(--rp-color-text);background:none;border:none}.search-field.sc-rp-filter-menu::placeholder{font-weight:500;color:var(--rp-color-text-subtle)}.search-field.sc-rp-filter-menu:focus{outline:none}.options.sc-rp-filter-menu{flex:1;padding:var(--rp-space-1);overflow-y:auto;overscroll-behavior:contain}.option.sc-rp-filter-menu{display:flex;gap:var(--rp-space-2);align-items:center;justify-content:space-between;width:100%;padding:9px var(--rp-space-3);font:inherit;font-size:var(--rp-font-size-sm);font-weight:500;letter-spacing:-0.005em;line-height:1.4;color:var(--rp-color-text-body);text-align:start;cursor:pointer;background:none;border:none;border-radius:var(--rp-radius-sm);transition:color var(--rp-duration-fast) var(--rp-ease), background-color var(--rp-duration-fast) var(--rp-ease)}.option.sc-rp-filter-menu svg.sc-rp-filter-menu{flex-shrink:0;fill:none;stroke:var(--rp-color-highlight);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}.option-text.sc-rp-filter-menu{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.option.is-active.sc-rp-filter-menu{color:var(--rp-color-text);background:var(--rp-color-surface-sunken)}.option.is-selected.sc-rp-filter-menu{font-weight:600;color:var(--rp-color-text)}.no-match.sc-rp-filter-menu{margin:0;padding:var(--rp-space-5) var(--rp-space-3);font-size:var(--rp-font-size-sm);font-weight:500;color:var(--rp-color-text-subtle);text-align:center}.tray-foot.sc-rp-filter-menu{flex-shrink:0;padding:var(--rp-space-2);border-top:1px solid var(--rp-color-border)}.reset.sc-rp-filter-menu{width:100%;padding:7px;font:inherit;font-size:var(--rp-font-size-sm);font-weight:600;color:var(--rp-color-danger);cursor:pointer;background:none;border:none;border-radius:var(--rp-radius-sm);transition:background-color var(--rp-duration-fast) var(--rp-ease)}.reset.sc-rp-filter-menu:hover{background:var(--rp-color-danger-soft)}.trigger.sc-rp-filter-menu:focus-visible,.clear.sc-rp-filter-menu:focus-visible,.option.sc-rp-filter-menu:focus-visible,.reset.sc-rp-filter-menu:focus-visible,.search-field.sc-rp-filter-menu:focus-visible{outline:var(--rp-focus-ring);outline-offset:var(--rp-focus-offset)}@media (prefers-reduced-motion: no-preference){.tray.sc-rp-filter-menu{animation:rp-tray-in var(--rp-duration-fast) var(--rp-ease);transform-origin:top}@keyframes rp-tray-in{from{opacity:0;transform:translateY(-6px) scale(0.98)}}}@media (prefers-reduced-motion: reduce){.trigger.sc-rp-filter-menu,.chevron.sc-rp-filter-menu,.clear.sc-rp-filter-menu,.reset.sc-rp-filter-menu{transition:none}}`;
|
|
6
6
|
|
|
7
7
|
const FilterMenu = class {
|
|
8
8
|
constructor(hostRef) {
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
|
|
36
36
|
.head {
|
|
37
37
|
display: flex;
|
|
38
|
-
gap: var(--rp-space-
|
|
38
|
+
gap: var(--rp-space-1);
|
|
39
39
|
align-items: center;
|
|
40
40
|
justify-content: space-between;
|
|
41
|
-
padding: var(--rp-space-3);
|
|
41
|
+
padding: var(--rp-space-3) var(--rp-space-2) var(--rp-space-3) var(--rp-space-3);
|
|
42
42
|
border-bottom: 1px solid var(--rp-color-border);
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -122,7 +122,7 @@ export class DaySlot {
|
|
|
122
122
|
const days = Array.isArray(this.days) ? this.days : [];
|
|
123
123
|
const labels = this.dayLabels ?? {};
|
|
124
124
|
const meals = this.normalized;
|
|
125
|
-
return (h(Host, { key: '755cdc190abccb9b0350caf7e4fad05675dd6e0e' }, h("section", { key: '927c1e962ce3f918e001965da10bb39b82cab5bc', class: { slot: true, 'is-drop-active': this.dropActive, 'is-empty': meals.length === 0 }, onDragEnter: this.onDragEnter, onDragOver: this.onDragOver, onDragLeave: this.onDragLeave, onDrop: this.onDrop }, h("header", { key: '415e9d56f9b190fd291af942c01427cc4b9b66ea', class: "head" }, h("h3", { key: 'd0f20de86c70d85da545ec9ec9c57790961b78f0', class: "day" }, this.dayLabel || this.day), h("div", { key: '484a1e743a3f251865288f345ead14d87741ff8e', class: "head-right" }, meals.length > 0 && h("span", { key: 'ac3324168f0061f4bb173090e21c4b6f2334a168', class: "count" }, meals.length), h("button", { key: '
|
|
125
|
+
return (h(Host, { key: '755cdc190abccb9b0350caf7e4fad05675dd6e0e' }, h("section", { key: '927c1e962ce3f918e001965da10bb39b82cab5bc', class: { slot: true, 'is-drop-active': this.dropActive, 'is-empty': meals.length === 0 }, onDragEnter: this.onDragEnter, onDragOver: this.onDragOver, onDragLeave: this.onDragLeave, onDrop: this.onDrop }, h("header", { key: '415e9d56f9b190fd291af942c01427cc4b9b66ea', class: "head" }, h("h3", { key: 'd0f20de86c70d85da545ec9ec9c57790961b78f0', class: "day" }, this.dayLabel || this.day), h("div", { key: '484a1e743a3f251865288f345ead14d87741ff8e', class: "head-right" }, meals.length > 0 && h("span", { key: 'ac3324168f0061f4bb173090e21c4b6f2334a168', class: "count" }, meals.length), h("button", { key: '39ab0098f8eea2a349a5169f3e3770e73fd425ed', type: "button", class: "add", onClick: () => this.rpAddMeal.emit(this.day), "aria-label": `Add a meal to ${(this.dayLabels ?? {})[this.day] || this.dayLabel || this.day}` }, h("svg", { key: '7f4619e9f352a49d98176682b9e811ad282268fb', viewBox: "0 0 24 24", width: "15", height: "15", "aria-hidden": "true" }, h("path", { key: '2c4926b901b49b79227db275ae9ccea71b7cb68b', d: "M12 5v14M5 12h14" }))))), meals.length === 0 ? (h("div", { class: "empty" }, h("slot", null, h("svg", { class: "empty-icon", viewBox: "0 0 24 24", width: "26", height: "26", "aria-hidden": "true" }, h("path", { d: "M4 4h16v16H4z", opacity: "0.35" }), h("path", { d: "M8 2v4M16 2v4M4 10h16" })), h("p", { class: "empty-text" }, "No meals planned")))) : (h("ul", { class: "meals" }, meals.map((meal) => (h("li", { class: { meal: true, 'is-dragging': this.draggingId === meal.id }, key: meal.id, draggable: true, onDragStart: (event) => this.onDragStart(event, meal), onDragEnd: this.onDragEnd }, h("span", { class: "grip", "aria-hidden": "true" }, h("svg", { viewBox: "0 0 24 24", width: "12", height: "12" }, h("circle", { cx: "9", cy: "6", r: "1.4" }), h("circle", { cx: "15", cy: "6", r: "1.4" }), h("circle", { cx: "9", cy: "12", r: "1.4" }), h("circle", { cx: "15", cy: "12", r: "1.4" }), h("circle", { cx: "9", cy: "18", r: "1.4" }), h("circle", { cx: "15", cy: "18", r: "1.4" }))), h("span", { class: "meal-title" }, meal.title), h("div", { class: "meal-actions" }, h("label", { class: "move" }, h("span", { class: "sr-only" }, `Move ${meal.title} to another day`), h("select", { class: "move-select", onChange: (event) => this.onMove(event, meal) }, h("option", { value: "" }, "Move\u2026"), days
|
|
126
126
|
.filter((day) => day !== this.day)
|
|
127
127
|
.map((day) => (h("option", { key: day, value: day }, labels[day] ?? day))))), h("button", { type: "button", class: "remove", onClick: () => this.rpRemoveMeal.emit({ id: meal.id, day: this.day }), "aria-label": `Remove ${meal.title}` }, h("svg", { viewBox: "0 0 24 24", width: "13", height: "13", "aria-hidden": "true" }, h("path", { d: "M6 6l12 12M18 6L6 18" }))))))))))));
|
|
128
128
|
}
|
|
@@ -138,17 +138,27 @@
|
|
|
138
138
|
stroke-linecap: round;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
/**
|
|
142
|
+
* `font: inherit` resets weight and letter-spacing along with the family, so a control
|
|
143
|
+
* that only sets a size lands at 400 with default tracking. Every other control in this
|
|
144
|
+
* library sits at 500–600, and at 13px the difference is the whole reason the tray read
|
|
145
|
+
* as a plain system menu rather than part of the interface — so the weight is restated
|
|
146
|
+
* here rather than left to the shorthand.
|
|
147
|
+
*/
|
|
141
148
|
.search-field {
|
|
142
149
|
flex: 1;
|
|
143
150
|
min-width: 0;
|
|
144
151
|
font: inherit;
|
|
145
152
|
font-size: var(--rp-font-size-sm);
|
|
153
|
+
font-weight: 500;
|
|
154
|
+
letter-spacing: -0.005em;
|
|
146
155
|
color: var(--rp-color-text);
|
|
147
156
|
background: none;
|
|
148
157
|
border: none;
|
|
149
158
|
}
|
|
150
159
|
|
|
151
160
|
.search-field::placeholder {
|
|
161
|
+
font-weight: 500;
|
|
152
162
|
color: var(--rp-color-text-subtle);
|
|
153
163
|
}
|
|
154
164
|
|
|
@@ -169,15 +179,21 @@
|
|
|
169
179
|
align-items: center;
|
|
170
180
|
justify-content: space-between;
|
|
171
181
|
width: 100%;
|
|
172
|
-
padding:
|
|
182
|
+
padding: 9px var(--rp-space-3);
|
|
173
183
|
font: inherit;
|
|
174
184
|
font-size: var(--rp-font-size-sm);
|
|
185
|
+
font-weight: 500;
|
|
186
|
+
letter-spacing: -0.005em;
|
|
187
|
+
line-height: 1.4;
|
|
175
188
|
color: var(--rp-color-text-body);
|
|
176
189
|
text-align: start;
|
|
177
190
|
cursor: pointer;
|
|
178
191
|
background: none;
|
|
179
192
|
border: none;
|
|
180
193
|
border-radius: var(--rp-radius-sm);
|
|
194
|
+
transition:
|
|
195
|
+
color var(--rp-duration-fast) var(--rp-ease),
|
|
196
|
+
background-color var(--rp-duration-fast) var(--rp-ease);
|
|
181
197
|
}
|
|
182
198
|
|
|
183
199
|
.option svg {
|
|
@@ -209,8 +225,9 @@
|
|
|
209
225
|
|
|
210
226
|
.no-match {
|
|
211
227
|
margin: 0;
|
|
212
|
-
padding: var(--rp-space-
|
|
228
|
+
padding: var(--rp-space-5) var(--rp-space-3);
|
|
213
229
|
font-size: var(--rp-font-size-sm);
|
|
230
|
+
font-weight: 500;
|
|
214
231
|
color: var(--rp-color-text-subtle);
|
|
215
232
|
text-align: center;
|
|
216
233
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.card {
|
|
8
|
+
position: relative;
|
|
8
9
|
display: flex;
|
|
9
10
|
flex-direction: column;
|
|
10
11
|
height: 100%;
|
|
@@ -19,6 +20,47 @@
|
|
|
19
20
|
border-color var(--rp-duration) var(--rp-ease);
|
|
20
21
|
}
|
|
21
22
|
|
|
23
|
+
/**
|
|
24
|
+
* The whole-card link.
|
|
25
|
+
*
|
|
26
|
+
* Stretched over the card rather than wrapping it, so the favorite button and the slotted
|
|
27
|
+
* action links stay outside the anchor — nesting them would be invalid HTML and would take
|
|
28
|
+
* them out of the tab order. Everything interactive is raised above this layer instead.
|
|
29
|
+
*/
|
|
30
|
+
.cover-link {
|
|
31
|
+
position: absolute;
|
|
32
|
+
inset: 0;
|
|
33
|
+
z-index: 1;
|
|
34
|
+
border-radius: inherit;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* `.actions` is in normal flow, so it needs a position for z-index to take effect at
|
|
38
|
+
all; the other two are already absolute. */
|
|
39
|
+
.actions {
|
|
40
|
+
position: relative;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.favorite,
|
|
44
|
+
.actions,
|
|
45
|
+
.badges {
|
|
46
|
+
z-index: 2;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* The link carries no text, so the focus ring has to be drawn on the card it covers. */
|
|
50
|
+
.cover-link:focus-visible {
|
|
51
|
+
outline: var(--rp-focus-ring);
|
|
52
|
+
outline-offset: -2px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.sr-only {
|
|
56
|
+
position: absolute;
|
|
57
|
+
width: 1px;
|
|
58
|
+
height: 1px;
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
clip-path: inset(50%);
|
|
61
|
+
white-space: nowrap;
|
|
62
|
+
}
|
|
63
|
+
|
|
22
64
|
/* Hover is delegated to the host so the lift also fires from the slotted footer links,
|
|
23
65
|
which sit outside .card's own hover region in some consumer layouts. */
|
|
24
66
|
:host(:hover) .card {
|
|
@@ -24,6 +24,23 @@ export class RecipeCard {
|
|
|
24
24
|
image;
|
|
25
25
|
/** Category label shown under the heading. */
|
|
26
26
|
category;
|
|
27
|
+
/**
|
|
28
|
+
* Destination for the whole card.
|
|
29
|
+
*
|
|
30
|
+
* Given one, the card renders a link that covers its full area, so the tile behaves the
|
|
31
|
+
* way a card is expected to: clicking anywhere opens the recipe. The favorite button and
|
|
32
|
+
* anything in the `actions` slot sit above it and keep their own behaviour.
|
|
33
|
+
*
|
|
34
|
+
* This is still a plain URL, not route knowledge — the component neither builds it nor
|
|
35
|
+
* knows what it points at, so a consumer with no router can pass an ordinary href.
|
|
36
|
+
* Omitting it leaves the card inert, which is what the planner picker wants.
|
|
37
|
+
*/
|
|
38
|
+
href;
|
|
39
|
+
/**
|
|
40
|
+
* Accessible name for that link. Defaults to the recipe title, which is what a link
|
|
41
|
+
* covering a whole card should announce.
|
|
42
|
+
*/
|
|
43
|
+
hrefLabel;
|
|
27
44
|
/** Cuisine or region, shown as a second meta pill when present. */
|
|
28
45
|
area;
|
|
29
46
|
/** Preparation time in minutes, shown as a meta pill when present. */
|
|
@@ -69,9 +86,9 @@ export class RecipeCard {
|
|
|
69
86
|
// toggle button with no announced state.
|
|
70
87
|
const isFavorite = this.favorite === true;
|
|
71
88
|
const showImage = this.image && !this.imageFailed;
|
|
72
|
-
return (h(Host, { key: '
|
|
89
|
+
return (h(Host, { key: 'c459d1443e3e06a5337cdc0cecdc16c3ea56294d' }, h("article", { key: '62d9e4e5e294a68317f6342e54a479c55922d688', class: "card" }, h("div", { key: 'c9885db03c40942d964e27a8c61f8020f356931f', class: { media: true, 'is-loading': showImage && this.imageLoading } }, showImage ? (h("img", { src: this.image, alt: "", loading: "lazy", width: "320", height: "240", ref: this.onImageRef, onLoad: () => (this.imageLoading = false), onError: () => (this.imageFailed = true) })) : (h("div", { class: "media-fallback", "aria-hidden": "true" })), h("div", { key: 'f5cb1bebf95e477284c26c8b3e1557346a12f1d5', class: "scrim", "aria-hidden": "true" }), h("div", { key: '2601c77e1a107a2d0a32b0eec0dbcce486ae8acb', class: "badges" }, h("slot", { key: '0fb0cf3b7448bb18be797e1a21d816a97046f1e8' })), h("button", { key: '2d1eb62ec0c103f2aac88e287280c4424d919157', type: "button", class: { favorite: true, 'is-pulsing': this.pulsing }, onClick: this.toggleFavorite, "aria-pressed": isFavorite ? 'true' : 'false', "aria-label": isFavorite
|
|
73
90
|
? `Remove ${this.recipeTitle} from favorites`
|
|
74
|
-
: `Add ${this.recipeTitle} to favorites` }, h("svg", { key: '
|
|
91
|
+
: `Add ${this.recipeTitle} to favorites` }, h("svg", { key: '169b9149fe3656002ff771c3786af517d78ed1f4', viewBox: "0 0 24 24", width: "18", height: "18", "aria-hidden": "true" }, h("path", { key: '721c06fe6cb505e8afe1374053e4bf064a951112', 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" })))), this.href && (h("a", { key: '35a17b168836bdf269e8d4c89f7fc6eaa0ed856c', class: "cover-link", href: this.href }, h("span", { key: '4748b1df3f61d6f66666d3126b085564ff6328ce', class: "sr-only" }, this.hrefLabel ?? this.recipeTitle))), h("div", { key: 'af70f7b9378c55a86d00f1f69fe50891c67063fb', class: "body" }, h("h3", { key: '1ba153f7411ac15d2e9f46ae392561bb355e9b90', class: "title" }, this.recipeTitle), h("div", { key: '42b58a5cca47387b66bc330b392a3040c2180bdb', class: "meta" }, this.category && h("span", { key: '6f90d80646df6338b70e9f2a848da1a693378132', class: "pill pill-category" }, this.category), this.area && h("span", { key: '7fd3ff865ae448037f9f4ca18e170773ae1c8efd', class: "pill" }, this.area), this.minutes ? h("span", { class: "pill" }, this.minutes, " min") : null)), h("div", { key: 'e63bc9c212d905ee22c3c68a99d82699b5b6c8a4', class: "actions" }, h("slot", { key: '3dfe7aeea9df0384fbeb17a1680a92681d7f13a3', name: "actions" })))));
|
|
75
92
|
}
|
|
76
93
|
static get is() { return "rp-recipe-card"; }
|
|
77
94
|
static get encapsulation() { return "scoped"; }
|
|
@@ -163,6 +180,44 @@ export class RecipeCard {
|
|
|
163
180
|
"reflect": false,
|
|
164
181
|
"attribute": "category"
|
|
165
182
|
},
|
|
183
|
+
"href": {
|
|
184
|
+
"type": "string",
|
|
185
|
+
"mutable": false,
|
|
186
|
+
"complexType": {
|
|
187
|
+
"original": "string",
|
|
188
|
+
"resolved": "string",
|
|
189
|
+
"references": {}
|
|
190
|
+
},
|
|
191
|
+
"required": false,
|
|
192
|
+
"optional": true,
|
|
193
|
+
"docs": {
|
|
194
|
+
"tags": [],
|
|
195
|
+
"text": "Destination for the whole card.\n\nGiven one, the card renders a link that covers its full area, so the tile behaves the\nway a card is expected to: clicking anywhere opens the recipe. The favorite button and\nanything in the `actions` slot sit above it and keep their own behaviour.\n\nThis is still a plain URL, not route knowledge \u2014 the component neither builds it nor\nknows what it points at, so a consumer with no router can pass an ordinary href.\nOmitting it leaves the card inert, which is what the planner picker wants."
|
|
196
|
+
},
|
|
197
|
+
"getter": false,
|
|
198
|
+
"setter": false,
|
|
199
|
+
"reflect": false,
|
|
200
|
+
"attribute": "href"
|
|
201
|
+
},
|
|
202
|
+
"hrefLabel": {
|
|
203
|
+
"type": "string",
|
|
204
|
+
"mutable": false,
|
|
205
|
+
"complexType": {
|
|
206
|
+
"original": "string",
|
|
207
|
+
"resolved": "string",
|
|
208
|
+
"references": {}
|
|
209
|
+
},
|
|
210
|
+
"required": false,
|
|
211
|
+
"optional": true,
|
|
212
|
+
"docs": {
|
|
213
|
+
"tags": [],
|
|
214
|
+
"text": "Accessible name for that link. Defaults to the recipe title, which is what a link\ncovering a whole card should announce."
|
|
215
|
+
},
|
|
216
|
+
"getter": false,
|
|
217
|
+
"setter": false,
|
|
218
|
+
"reflect": false,
|
|
219
|
+
"attribute": "href-label"
|
|
220
|
+
},
|
|
166
221
|
"area": {
|
|
167
222
|
"type": "string",
|
|
168
223
|
"mutable": false,
|
|
@@ -41,7 +41,7 @@ export class SearchBar {
|
|
|
41
41
|
this.rpClear.emit();
|
|
42
42
|
};
|
|
43
43
|
render() {
|
|
44
|
-
return (h(Host, { key: '
|
|
44
|
+
return (h(Host, { key: '5007c83c2d6a11e509eaac4471ccbd2313a75f10' }, h("form", { key: 'c6ea64c0ba0b1616ce3eef310e23611c8ca31581', class: "bar", role: "search", onSubmit: this.onSubmit }, h("svg", { key: '5d79ea20bc29076f797230f1d46bb164e72a89d8', class: "icon", viewBox: "0 0 24 24", width: "18", height: "18", "aria-hidden": "true" }, h("circle", { key: '755a9241cf956853ea76f0576781d7b7c47172a9', cx: "11", cy: "11", r: "7" }), h("path", { key: '4bbb916f1c7a2ac5459a721b0d4bee2f96d0d2c8', d: "m20 20-3.6-3.6" })), h("input", { key: 'b6acce26123ea9af546738d213cac6f5ba7af31b', type: "search", class: "field", value: this.draft, placeholder: this.placeholder, "aria-label": this.label, onInput: this.onInput }), this.draft && (h("button", { key: 'a8e4e40d7375082175417f6947a77518fb44a804', type: "button", class: "clear", onClick: this.onClear, "aria-label": "Clear search" }, h("svg", { key: '638af98be0c5ebba34bd45f1ab1cd25cf488ed7d', viewBox: "0 0 24 24", width: "14", height: "14", "aria-hidden": "true" }, h("path", { key: 'e3322a0f0a82f586ac5ce12867ea2ac87760bc9d', d: "M6 6l12 12M18 6L6 18" })))), h("button", { key: 'ba6db0b5943c9396926b21bf09a4a1be44acf20b', type: "submit", class: "submit" }, "Search"))));
|
|
45
45
|
}
|
|
46
46
|
static get is() { return "rp-search-bar"; }
|
|
47
47
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as r,t as a,H as e,c as o,h as s,a as t}from"./index.js";const i=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.rpAddMeal=o(this,"rpAddMeal"),this.rpRemoveMeal=o(this,"rpRemoveMeal"),this.rpMoveMeal=o(this,"rpMoveMeal")}day;dayLabel="";meals=[];days=[];dayLabels={};normalized=[];dropActive=!1;draggingId=null;dragDepth=0;rpAddMeal;rpRemoveMeal;rpMoveMeal;componentWillLoad(){this.normalized=Array.isArray(this.meals)?this.meals:[]}componentWillUpdate(){this.normalized=Array.isArray(this.meals)?this.meals:[]}emitMove(r,a,e){e&&e!==a&&this.rpMoveMeal.emit({id:r,from:a,to:e})}onMove=(r,a)=>{const e=r.target;this.emitMove(a.id,this.day,e.value),e.value=""};onDragStart=(r,a)=>{this.draggingId=a.id,r.dataTransfer?.setData("application/x-rp-meal",JSON.stringify({id:a.id,from:this.day})),r.dataTransfer?.setData("text/plain",a.title),r.dataTransfer&&(r.dataTransfer.effectAllowed="move")};onDragEnd=()=>{this.draggingId=null,this.dragDepth=0,this.dropActive=!1};hasMealPayload(r){return r.dataTransfer?.types.includes("application/x-rp-meal")??!1}onDragEnter=r=>{this.hasMealPayload(r)&&(this.dragDepth+=1,this.dropActive=!0)};onDragOver=r=>{this.hasMealPayload(r)&&(r.preventDefault(),r.dataTransfer&&(r.dataTransfer.dropEffect="move"))};onDragLeave=r=>{this.hasMealPayload(r)&&(this.dragDepth=Math.max(0,this.dragDepth-1),0===this.dragDepth&&(this.dropActive=!1))};onDrop=r=>{const a=r.dataTransfer?.getData("application/x-rp-meal");if(a){r.preventDefault(),this.dragDepth=0,this.dropActive=!1;try{const{id:r,from:e}=JSON.parse(a);this.emitMove(r,e,this.day)}catch{}}};render(){const r=Array.isArray(this.days)?this.days:[],a=this.dayLabels??{},e=this.normalized;return s(t,{key:"755cdc190abccb9b0350caf7e4fad05675dd6e0e"},s("section",{key:"927c1e962ce3f918e001965da10bb39b82cab5bc",class:{slot:!0,"is-drop-active":this.dropActive,"is-empty":0===e.length},onDragEnter:this.onDragEnter,onDragOver:this.onDragOver,onDragLeave:this.onDragLeave,onDrop:this.onDrop},s("header",{key:"415e9d56f9b190fd291af942c01427cc4b9b66ea",class:"head"},s("h3",{key:"d0f20de86c70d85da545ec9ec9c57790961b78f0",class:"day"},this.dayLabel||this.day),s("div",{key:"484a1e743a3f251865288f345ead14d87741ff8e",class:"head-right"},e.length>0&&s("span",{key:"ac3324168f0061f4bb173090e21c4b6f2334a168",class:"count"},e.length),s("button",{key:"5ca123821d1b90cc822bb3036884ce93f8cae19c",type:"button",class:"add",onClick:()=>this.rpAddMeal.emit(this.day),"aria-label":"Add a meal to "+(this.dayLabel||this.day)},s("svg",{key:"e7b09c139cfd3106a83481a1bbb48bf99e82d47c",viewBox:"0 0 24 24",width:"15",height:"15","aria-hidden":"true"},s("path",{key:"06c62bb2b09a4c0676977411644d15d4217361a8",d:"M12 5v14M5 12h14"}))))),0===e.length?s("div",{class:"empty"},s("slot",null,s("svg",{class:"empty-icon",viewBox:"0 0 24 24",width:"26",height:"26","aria-hidden":"true"},s("path",{d:"M4 4h16v16H4z",opacity:"0.35"}),s("path",{d:"M8 2v4M16 2v4M4 10h16"})),s("p",{class:"empty-text"},"No meals planned"))):s("ul",{class:"meals"},e.map((e=>s("li",{class:{meal:!0,"is-dragging":this.draggingId===e.id},key:e.id,draggable:!0,onDragStart:r=>this.onDragStart(r,e),onDragEnd:this.onDragEnd},s("span",{class:"grip","aria-hidden":"true"},s("svg",{viewBox:"0 0 24 24",width:"12",height:"12"},s("circle",{cx:"9",cy:"6",r:"1.4"}),s("circle",{cx:"15",cy:"6",r:"1.4"}),s("circle",{cx:"9",cy:"12",r:"1.4"}),s("circle",{cx:"15",cy:"12",r:"1.4"}),s("circle",{cx:"9",cy:"18",r:"1.4"}),s("circle",{cx:"15",cy:"18",r:"1.4"}))),s("span",{class:"meal-title"},e.title),s("div",{class:"meal-actions"},s("label",{class:"move"},s("span",{class:"sr-only"},`Move ${e.title} to another day`),s("select",{class:"move-select",onChange:r=>this.onMove(r,e)},s("option",{value:""},"Move…"),r.filter((r=>r!==this.day)).map((r=>s("option",{key:r,value:r},a[r]??r))))),s("button",{type:"button",class:"remove",onClick:()=>this.rpRemoveMeal.emit({id:e.id,day:this.day}),"aria-label":"Remove "+e.title},s("svg",{viewBox:"0 0 24 24",width:"13",height:"13","aria-hidden":"true"},s("path",{d:"M6 6l12 12M18 6L6 18"}))))))))))}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:200px;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-xs);transition:border-color var(--rp-duration) var(--rp-ease), box-shadow var(--rp-duration) var(--rp-ease), background-color var(--rp-duration) var(--rp-ease)}.slot.is-empty.sc-rp-day-slot{background:var(--rp-color-surface-sunken);border-style:dashed}.slot.is-drop-active.sc-rp-day-slot{background:var(--rp-color-highlight-soft);border-style:solid;border-color:var(--rp-color-highlight);box-shadow:var(--rp-shadow-md), inset 0 0 0 1px var(--rp-color-highlight)}.head.sc-rp-day-slot{display:flex;gap:var(--rp-space-2);align-items:center;justify-content:space-between;padding:var(--rp-space-3);border-bottom:1px solid var(--rp-color-border)}.day.sc-rp-day-slot{min-width:0;margin:0;overflow:hidden;font-size:var(--rp-font-size-xs);font-weight:700;letter-spacing:0.08em;text-transform:uppercase;text-overflow:ellipsis;white-space:nowrap;color:var(--rp-color-text-muted)}.head-right.sc-rp-day-slot{display:flex;flex-shrink:0;gap:var(--rp-space-2);align-items:center}.count.sc-rp-day-slot{display:grid;place-items:center;min-width:20px;height:20px;padding:0 6px;font-size:0.6875rem;font-weight:700;font-variant-numeric:tabular-nums;color:var(--rp-caramel-600);background:var(--rp-color-highlight-soft);border-radius:var(--rp-radius-pill)}.add.sc-rp-day-slot{display:grid;place-items:center;width:26px;height:26px;padding:0;cursor:pointer;color:var(--rp-color-accent-contrast);background:var(--rp-color-accent);border:none;border-radius:50%;transition:transform var(--rp-duration-fast) var(--rp-ease), background-color var(--rp-duration-fast) var(--rp-ease)}.add.sc-rp-day-slot svg.sc-rp-day-slot{fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}.add.sc-rp-day-slot:hover{background:var(--rp-color-highlight);transform:rotate(90deg) scale(1.1)}.add.sc-rp-day-slot:active{transform:rotate(90deg) scale(0.92)}.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{position:relative;padding:var(--rp-space-3) var(--rp-space-3) var(--rp-space-2);cursor:grab;background:var(--rp-color-surface-sunken);border:1px solid var(--rp-color-border);border-radius:var(--rp-radius-md);transition:transform var(--rp-duration-fast) var(--rp-ease), box-shadow var(--rp-duration-fast) var(--rp-ease), opacity var(--rp-duration-fast) var(--rp-ease)}.meal.sc-rp-day-slot:hover{background:var(--rp-color-surface);box-shadow:var(--rp-shadow-sm);transform:translateY(-1px)}.meal.sc-rp-day-slot:active{cursor:grabbing}.meal.is-dragging.sc-rp-day-slot{opacity:0.4;box-shadow:none;transform:none}.grip.sc-rp-day-slot{position:absolute;inset-block-start:var(--rp-space-2);inset-inline-end:var(--rp-space-2);display:block;opacity:0;transition:opacity var(--rp-duration-fast) var(--rp-ease)}.grip.sc-rp-day-slot svg.sc-rp-day-slot{display:block;fill:var(--rp-color-text-subtle)}.meal.sc-rp-day-slot:hover .grip.sc-rp-day-slot{opacity:1}.meal-title.sc-rp-day-slot{display:block;padding-inline-end:var(--rp-space-4);font-size:var(--rp-font-size-sm);font-weight:500;line-height:1.35;color:var(--rp-color-text)}.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:3px var(--rp-space-2);font:inherit;font-size:var(--rp-font-size-xs);color:var(--rp-color-text-muted);cursor:pointer;background:var(--rp-color-surface);border:1px solid var(--rp-color-border);border-radius:var(--rp-radius-sm);transition:border-color var(--rp-duration-fast) var(--rp-ease)}.move-select.sc-rp-day-slot:hover{border-color:var(--rp-color-border-strong)}.remove.sc-rp-day-slot{display:grid;place-items:center;width:24px;height:24px;padding:0;color:var(--rp-color-text-subtle);cursor:pointer;background:none;border:none;border-radius:var(--rp-radius-sm);transition:color var(--rp-duration-fast) var(--rp-ease), background-color var(--rp-duration-fast) var(--rp-ease)}.remove.sc-rp-day-slot svg.sc-rp-day-slot{fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}.remove.sc-rp-day-slot:hover{color:var(--rp-color-danger);background:var(--rp-color-danger-soft)}.empty.sc-rp-day-slot{display:flex;flex:1;flex-direction:column;gap:var(--rp-space-2);align-items:center;justify-content:center;padding:var(--rp-space-4) var(--rp-space-3);text-align:center}.empty-icon.sc-rp-day-slot{fill:none;stroke:var(--rp-color-text-subtle);stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}.empty-text.sc-rp-day-slot{margin:0;font-size:var(--rp-font-size-xs);color:var(--rp-color-text-subtle)}.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}@media (prefers-reduced-motion: reduce){.slot.sc-rp-day-slot,.meal.sc-rp-day-slot,.add.sc-rp-day-slot,.grip.sc-rp-day-slot,.remove.sc-rp-day-slot,.move-select.sc-rp-day-slot{transition:none}.meal.sc-rp-day-slot:hover,.add.sc-rp-day-slot:hover,.add.sc-rp-day-slot:active{transform:none}.grip.sc-rp-day-slot{opacity:1}}"}},[774,"rp-day-slot",{day:[1],dayLabel:[1,"day-label"],meals:[16],days:[16],dayLabels:[16],normalized:[32],dropActive:[32],draggingId:[32]}]);function c(){"undefined"!=typeof customElements&&["rp-day-slot"].forEach((r=>{"rp-day-slot"===r&&(customElements.get(a(r))||customElements.define(a(r),i))}))}c();const l=i,d=c;export{l as RpDaySlot,d as defineCustomElement}
|
|
1
|
+
import{p as r,t as a,H as e,c as s,h as o,a as t}from"./index.js";const i=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.rpAddMeal=s(this,"rpAddMeal"),this.rpRemoveMeal=s(this,"rpRemoveMeal"),this.rpMoveMeal=s(this,"rpMoveMeal")}day;dayLabel="";meals=[];days=[];dayLabels={};normalized=[];dropActive=!1;draggingId=null;dragDepth=0;rpAddMeal;rpRemoveMeal;rpMoveMeal;componentWillLoad(){this.normalized=Array.isArray(this.meals)?this.meals:[]}componentWillUpdate(){this.normalized=Array.isArray(this.meals)?this.meals:[]}emitMove(r,a,e){e&&e!==a&&this.rpMoveMeal.emit({id:r,from:a,to:e})}onMove=(r,a)=>{const e=r.target;this.emitMove(a.id,this.day,e.value),e.value=""};onDragStart=(r,a)=>{this.draggingId=a.id,r.dataTransfer?.setData("application/x-rp-meal",JSON.stringify({id:a.id,from:this.day})),r.dataTransfer?.setData("text/plain",a.title),r.dataTransfer&&(r.dataTransfer.effectAllowed="move")};onDragEnd=()=>{this.draggingId=null,this.dragDepth=0,this.dropActive=!1};hasMealPayload(r){return r.dataTransfer?.types.includes("application/x-rp-meal")??!1}onDragEnter=r=>{this.hasMealPayload(r)&&(this.dragDepth+=1,this.dropActive=!0)};onDragOver=r=>{this.hasMealPayload(r)&&(r.preventDefault(),r.dataTransfer&&(r.dataTransfer.dropEffect="move"))};onDragLeave=r=>{this.hasMealPayload(r)&&(this.dragDepth=Math.max(0,this.dragDepth-1),0===this.dragDepth&&(this.dropActive=!1))};onDrop=r=>{const a=r.dataTransfer?.getData("application/x-rp-meal");if(a){r.preventDefault(),this.dragDepth=0,this.dropActive=!1;try{const{id:r,from:e}=JSON.parse(a);this.emitMove(r,e,this.day)}catch{}}};render(){const r=Array.isArray(this.days)?this.days:[],a=this.dayLabels??{},e=this.normalized;return o(t,{key:"755cdc190abccb9b0350caf7e4fad05675dd6e0e"},o("section",{key:"927c1e962ce3f918e001965da10bb39b82cab5bc",class:{slot:!0,"is-drop-active":this.dropActive,"is-empty":0===e.length},onDragEnter:this.onDragEnter,onDragOver:this.onDragOver,onDragLeave:this.onDragLeave,onDrop:this.onDrop},o("header",{key:"415e9d56f9b190fd291af942c01427cc4b9b66ea",class:"head"},o("h3",{key:"d0f20de86c70d85da545ec9ec9c57790961b78f0",class:"day"},this.dayLabel||this.day),o("div",{key:"484a1e743a3f251865288f345ead14d87741ff8e",class:"head-right"},e.length>0&&o("span",{key:"ac3324168f0061f4bb173090e21c4b6f2334a168",class:"count"},e.length),o("button",{key:"39ab0098f8eea2a349a5169f3e3770e73fd425ed",type:"button",class:"add",onClick:()=>this.rpAddMeal.emit(this.day),"aria-label":"Add a meal to "+((this.dayLabels??{})[this.day]||this.dayLabel||this.day)},o("svg",{key:"7f4619e9f352a49d98176682b9e811ad282268fb",viewBox:"0 0 24 24",width:"15",height:"15","aria-hidden":"true"},o("path",{key:"2c4926b901b49b79227db275ae9ccea71b7cb68b",d:"M12 5v14M5 12h14"}))))),0===e.length?o("div",{class:"empty"},o("slot",null,o("svg",{class:"empty-icon",viewBox:"0 0 24 24",width:"26",height:"26","aria-hidden":"true"},o("path",{d:"M4 4h16v16H4z",opacity:"0.35"}),o("path",{d:"M8 2v4M16 2v4M4 10h16"})),o("p",{class:"empty-text"},"No meals planned"))):o("ul",{class:"meals"},e.map((e=>o("li",{class:{meal:!0,"is-dragging":this.draggingId===e.id},key:e.id,draggable:!0,onDragStart:r=>this.onDragStart(r,e),onDragEnd:this.onDragEnd},o("span",{class:"grip","aria-hidden":"true"},o("svg",{viewBox:"0 0 24 24",width:"12",height:"12"},o("circle",{cx:"9",cy:"6",r:"1.4"}),o("circle",{cx:"15",cy:"6",r:"1.4"}),o("circle",{cx:"9",cy:"12",r:"1.4"}),o("circle",{cx:"15",cy:"12",r:"1.4"}),o("circle",{cx:"9",cy:"18",r:"1.4"}),o("circle",{cx:"15",cy:"18",r:"1.4"}))),o("span",{class:"meal-title"},e.title),o("div",{class:"meal-actions"},o("label",{class:"move"},o("span",{class:"sr-only"},`Move ${e.title} to another day`),o("select",{class:"move-select",onChange:r=>this.onMove(r,e)},o("option",{value:""},"Move…"),r.filter((r=>r!==this.day)).map((r=>o("option",{key:r,value:r},a[r]??r))))),o("button",{type:"button",class:"remove",onClick:()=>this.rpRemoveMeal.emit({id:e.id,day:this.day}),"aria-label":"Remove "+e.title},o("svg",{viewBox:"0 0 24 24",width:"13",height:"13","aria-hidden":"true"},o("path",{d:"M6 6l12 12M18 6L6 18"}))))))))))}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:200px;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-xs);transition:border-color var(--rp-duration) var(--rp-ease), box-shadow var(--rp-duration) var(--rp-ease), background-color var(--rp-duration) var(--rp-ease)}.slot.is-empty.sc-rp-day-slot{background:var(--rp-color-surface-sunken);border-style:dashed}.slot.is-drop-active.sc-rp-day-slot{background:var(--rp-color-highlight-soft);border-style:solid;border-color:var(--rp-color-highlight);box-shadow:var(--rp-shadow-md), inset 0 0 0 1px var(--rp-color-highlight)}.head.sc-rp-day-slot{display:flex;gap:var(--rp-space-1);align-items:center;justify-content:space-between;padding:var(--rp-space-3) var(--rp-space-2) var(--rp-space-3) var(--rp-space-3);border-bottom:1px solid var(--rp-color-border)}.day.sc-rp-day-slot{min-width:0;margin:0;overflow:hidden;font-size:var(--rp-font-size-xs);font-weight:700;letter-spacing:0.08em;text-transform:uppercase;text-overflow:ellipsis;white-space:nowrap;color:var(--rp-color-text-muted)}.head-right.sc-rp-day-slot{display:flex;flex-shrink:0;gap:var(--rp-space-2);align-items:center}.count.sc-rp-day-slot{display:grid;place-items:center;min-width:20px;height:20px;padding:0 6px;font-size:0.6875rem;font-weight:700;font-variant-numeric:tabular-nums;color:var(--rp-caramel-600);background:var(--rp-color-highlight-soft);border-radius:var(--rp-radius-pill)}.add.sc-rp-day-slot{display:grid;place-items:center;width:26px;height:26px;padding:0;cursor:pointer;color:var(--rp-color-accent-contrast);background:var(--rp-color-accent);border:none;border-radius:50%;transition:transform var(--rp-duration-fast) var(--rp-ease), background-color var(--rp-duration-fast) var(--rp-ease)}.add.sc-rp-day-slot svg.sc-rp-day-slot{fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}.add.sc-rp-day-slot:hover{background:var(--rp-color-highlight);transform:rotate(90deg) scale(1.1)}.add.sc-rp-day-slot:active{transform:rotate(90deg) scale(0.92)}.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{position:relative;padding:var(--rp-space-3) var(--rp-space-3) var(--rp-space-2);cursor:grab;background:var(--rp-color-surface-sunken);border:1px solid var(--rp-color-border);border-radius:var(--rp-radius-md);transition:transform var(--rp-duration-fast) var(--rp-ease), box-shadow var(--rp-duration-fast) var(--rp-ease), opacity var(--rp-duration-fast) var(--rp-ease)}.meal.sc-rp-day-slot:hover{background:var(--rp-color-surface);box-shadow:var(--rp-shadow-sm);transform:translateY(-1px)}.meal.sc-rp-day-slot:active{cursor:grabbing}.meal.is-dragging.sc-rp-day-slot{opacity:0.4;box-shadow:none;transform:none}.grip.sc-rp-day-slot{position:absolute;inset-block-start:var(--rp-space-2);inset-inline-end:var(--rp-space-2);display:block;opacity:0;transition:opacity var(--rp-duration-fast) var(--rp-ease)}.grip.sc-rp-day-slot svg.sc-rp-day-slot{display:block;fill:var(--rp-color-text-subtle)}.meal.sc-rp-day-slot:hover .grip.sc-rp-day-slot{opacity:1}.meal-title.sc-rp-day-slot{display:block;padding-inline-end:var(--rp-space-4);font-size:var(--rp-font-size-sm);font-weight:500;line-height:1.35;color:var(--rp-color-text)}.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:3px var(--rp-space-2);font:inherit;font-size:var(--rp-font-size-xs);color:var(--rp-color-text-muted);cursor:pointer;background:var(--rp-color-surface);border:1px solid var(--rp-color-border);border-radius:var(--rp-radius-sm);transition:border-color var(--rp-duration-fast) var(--rp-ease)}.move-select.sc-rp-day-slot:hover{border-color:var(--rp-color-border-strong)}.remove.sc-rp-day-slot{display:grid;place-items:center;width:24px;height:24px;padding:0;color:var(--rp-color-text-subtle);cursor:pointer;background:none;border:none;border-radius:var(--rp-radius-sm);transition:color var(--rp-duration-fast) var(--rp-ease), background-color var(--rp-duration-fast) var(--rp-ease)}.remove.sc-rp-day-slot svg.sc-rp-day-slot{fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}.remove.sc-rp-day-slot:hover{color:var(--rp-color-danger);background:var(--rp-color-danger-soft)}.empty.sc-rp-day-slot{display:flex;flex:1;flex-direction:column;gap:var(--rp-space-2);align-items:center;justify-content:center;padding:var(--rp-space-4) var(--rp-space-3);text-align:center}.empty-icon.sc-rp-day-slot{fill:none;stroke:var(--rp-color-text-subtle);stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}.empty-text.sc-rp-day-slot{margin:0;font-size:var(--rp-font-size-xs);color:var(--rp-color-text-subtle)}.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}@media (prefers-reduced-motion: reduce){.slot.sc-rp-day-slot,.meal.sc-rp-day-slot,.add.sc-rp-day-slot,.grip.sc-rp-day-slot,.remove.sc-rp-day-slot,.move-select.sc-rp-day-slot{transition:none}.meal.sc-rp-day-slot:hover,.add.sc-rp-day-slot:hover,.add.sc-rp-day-slot:active{transform:none}.grip.sc-rp-day-slot{opacity:1}}"}},[774,"rp-day-slot",{day:[1],dayLabel:[1,"day-label"],meals:[16],days:[16],dayLabels:[16],normalized:[32],dropActive:[32],draggingId:[32]}]);function l(){"undefined"!=typeof customElements&&["rp-day-slot"].forEach((r=>{"rp-day-slot"===r&&(customElements.get(a(r))||customElements.define(a(r),i))}))}l();const c=i,d=l;export{c as RpDaySlot,d as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as r,H as e,c as t,h as o,a,t as i}from"./index.js";const s=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.rpFilterChange=t(this,"rpFilterChange"),this.rpMenuToggle=t(this,"rpMenuToggle")}get el(){return this}label="Filter";options=[];selected=null;searchPlaceholder="Search…";searchable=!0;open=!1;filterText="";activeIndex=-1;rpFilterChange;rpMenuToggle;triggerEl;searchEl;onOpenChange(r){this.rpMenuToggle.emit({label:this.label,open:r}),r&&(this.filterText="",this.activeIndex=-1,requestAnimationFrame((()=>{this.searchable&&this.searchEl?.focus()})))}onDocumentPointerDown(r){this.open&&(this.el.contains(r.target)||(this.open=!1))}onDocumentKeydown(r){this.open&&"Escape"===r.key&&(r.preventDefault(),this.open=!1,this.triggerEl?.focus())}get visibleOptions(){const r=Array.isArray(this.options)?this.options:[],e=this.filterText.trim().toLowerCase();return e?r.filter((r=>r.toLowerCase().includes(e))):r}choose=r=>{this.rpFilterChange.emit(r),this.open=!1,this.triggerEl?.focus()};onTrayKeydown=r=>{const e=this.visibleOptions;if(0!==e.length)if("ArrowDown"!==r.key&&"ArrowUp"!==r.key)"Enter"===r.key&&this.activeIndex>=0&&(r.preventDefault(),this.choose(e[this.activeIndex]));else{r.preventDefault();const t=this.activeIndex+("ArrowDown"===r.key?1:-1);this.activeIndex=t<0?e.length-1:t%e.length}};render(){const r=this.visibleOptions,e=!!this.selected,t="rp-filter-tray-"+this.label.replace(/\s+/g,"-").toLowerCase();return o(a,{key:"b75b5ecc274711c500d7ab6b6da19d62f351cc68"},o("div",{key:"2385440a8c3f8158082072b495e2e222f0c4a1b7",class:"wrap"},o("button",{key:"e7cc93fd2bfc2405f14ac3182161d28665a6d9c2",type:"button",class:{trigger:!0,"is-active":e},ref:r=>this.triggerEl=r,onPointerDown:r=>{r.preventDefault(),this.triggerEl?.focus(),this.open=!this.open},onKeyDown:r=>{"Enter"!==r.key&&" "!==r.key||(r.preventDefault(),this.open=!this.open)},"aria-expanded":this.open?"true":"false","aria-haspopup":"listbox","aria-controls":t},o("span",{key:"017c4c2f64f82dfd7f4cb9b713fb9fafd9607bc7",class:"trigger-label"},this.label),e&&o("span",{key:"5fc7e3e789297cadb7dc888403b18a4593e1bec3",class:"trigger-value"},this.selected),o("svg",{key:"5ec9e4b2469f0032464b028687d98bea933550ff",class:"chevron",viewBox:"0 0 24 24",width:"13",height:"13","aria-hidden":"true"},o("path",{key:"317db24d4eb2413f1a45a5027742491125bae86b",d:"m6 9 6 6 6-6"}))),e&&o("button",{key:"c4334ec227381d5e7bd94217dd46e51f51a009b3",type:"button",class:"clear",onClick:()=>this.choose(null),"aria-label":`Clear ${this.label.toLowerCase()} filter`},o("svg",{key:"169798991ca1e0f22431d3d17590ab83225c4c91",viewBox:"0 0 24 24",width:"12",height:"12","aria-hidden":"true"},o("path",{key:"79799a482f0989f20f1f83604b61014fa2d0b30b",d:"M6 6l12 12M18 6L6 18"}))),this.open&&o("div",{key:"1297345512d4a06ff044ba66d1e99c099ee39d5c",class:"tray",id:t,role:"listbox","aria-label":this.label,onKeyDown:this.onTrayKeydown},this.searchable&&o("div",{key:"d941c5ae2e70ab3779a138d85aebed47110f09c5",class:"search"},o("svg",{key:"5674c55b8f54429acb4c6e71f0449016190d20a5",class:"search-icon",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},o("circle",{key:"46c1015878ce6d8e86fe1bf12c87ef811ab22516",cx:"11",cy:"11",r:"7"}),o("path",{key:"9562775081d6fae4688067c9a55d1bf036cf79fb",d:"m20 20-3.6-3.6"})),o("input",{key:"041d84883328d6b3d13574b1751ee809aea68768",type:"text",class:"search-field",ref:r=>this.searchEl=r,value:this.filterText,placeholder:this.searchPlaceholder,"aria-label":`Search ${this.label.toLowerCase()} options`,onInput:r=>{this.filterText=r.target.value,this.activeIndex=-1}})),o("div",{key:"3d3ee51a876bfc01d25785ce5a4da5a057c51144",class:"options"},0===r.length?o("p",{class:"no-match"},"No matches"):r.map(((r,e)=>o("button",{key:r,type:"button",role:"option","aria-selected":this.selected===r?"true":"false",class:{option:!0,"is-selected":this.selected===r,"is-active":this.activeIndex===e},onClick:()=>this.choose(r),onMouseEnter:()=>this.activeIndex=e},o("span",{class:"option-text"},r),this.selected===r&&o("svg",{viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},o("path",{d:"m5 13 4 4L19 7"})))))),e&&o("div",{key:"9e5de089306361cae946b04d70df76eb9062a482",class:"tray-foot"},o("button",{key:"402c531a240a44a2570217e49ddec556b9d51108",type:"button",class:"reset",onClick:()=>this.choose(null)},"Clear selection")))))}static get watchers(){return{open:[{onOpenChange:0}]}}static get style(){return".sc-rp-filter-menu-h{display:inline-block;font-family:var(--rp-font-sans)}.wrap.sc-rp-filter-menu{position:relative;display:inline-flex;align-items:center;gap:var(--rp-space-1)}.trigger.sc-rp-filter-menu{display:inline-flex;gap:var(--rp-space-2);align-items:center;padding:8px var(--rp-space-4);font:inherit;font-size:var(--rp-font-size-sm);font-weight:600;color:var(--rp-color-text-body);cursor:pointer;background:var(--rp-color-surface);border:1px solid var(--rp-color-border);border-radius:var(--rp-radius-pill);transition:color var(--rp-duration-fast) var(--rp-ease), background-color var(--rp-duration-fast) var(--rp-ease), border-color var(--rp-duration-fast) var(--rp-ease), box-shadow var(--rp-duration-fast) var(--rp-ease)}.trigger.sc-rp-filter-menu:hover{color:var(--rp-color-text);border-color:var(--rp-color-border-strong);box-shadow:var(--rp-shadow-sm)}.trigger.is-active.sc-rp-filter-menu{color:var(--rp-color-accent-contrast);background:var(--rp-color-accent);border-color:var(--rp-color-accent);box-shadow:var(--rp-shadow-sm)}[open].sc-rp-filter-menu-h .trigger.sc-rp-filter-menu{border-color:var(--rp-color-focus);box-shadow:var(--rp-focus-halo)}.trigger-value.sc-rp-filter-menu{max-width:12ch;overflow:hidden;font-weight:500;text-overflow:ellipsis;white-space:nowrap;opacity:0.85}.trigger-value.sc-rp-filter-menu::before{content:'· ';opacity:0.6}.chevron.sc-rp-filter-menu{flex-shrink:0;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;transition:transform var(--rp-duration-fast) var(--rp-ease)}[open].sc-rp-filter-menu-h .chevron.sc-rp-filter-menu{transform:rotate(180deg)}.clear.sc-rp-filter-menu{display:grid;place-items:center;width:24px;height:24px;padding:0;color:var(--rp-color-text-subtle);cursor:pointer;background:none;border:none;border-radius:50%;transition:color var(--rp-duration-fast) var(--rp-ease), background-color var(--rp-duration-fast) var(--rp-ease)}.clear.sc-rp-filter-menu svg.sc-rp-filter-menu{fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round}.clear.sc-rp-filter-menu:hover{color:var(--rp-color-danger);background:var(--rp-color-danger-soft)}.tray.sc-rp-filter-menu{position:absolute;inset-block-start:calc(100% + var(--rp-space-2));inset-inline-start:0;z-index:30;display:flex;flex-direction:column;width:max(240px, 100%);max-height:340px;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-lg)}.search.sc-rp-filter-menu{display:flex;gap:var(--rp-space-2);align-items:center;flex-shrink:0;padding:var(--rp-space-3);border-bottom:1px solid var(--rp-color-border)}.search-icon.sc-rp-filter-menu{flex-shrink:0;fill:none;stroke:var(--rp-color-text-subtle);stroke-width:2;stroke-linecap:round}.search-field.sc-rp-filter-menu{flex:1;min-width:0;font:inherit;font-size:var(--rp-font-size-sm);color:var(--rp-color-text);background:none;border:none}.search-field.sc-rp-filter-menu::placeholder{color:var(--rp-color-text-subtle)}.search-field.sc-rp-filter-menu:focus{outline:none}.options.sc-rp-filter-menu{flex:1;padding:var(--rp-space-1);overflow-y:auto;overscroll-behavior:contain}.option.sc-rp-filter-menu{display:flex;gap:var(--rp-space-2);align-items:center;justify-content:space-between;width:100%;padding:8px var(--rp-space-3);font:inherit;font-size:var(--rp-font-size-sm);color:var(--rp-color-text-body);text-align:start;cursor:pointer;background:none;border:none;border-radius:var(--rp-radius-sm)}.option.sc-rp-filter-menu svg.sc-rp-filter-menu{flex-shrink:0;fill:none;stroke:var(--rp-color-highlight);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}.option-text.sc-rp-filter-menu{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.option.is-active.sc-rp-filter-menu{color:var(--rp-color-text);background:var(--rp-color-surface-sunken)}.option.is-selected.sc-rp-filter-menu{font-weight:600;color:var(--rp-color-text)}.no-match.sc-rp-filter-menu{margin:0;padding:var(--rp-space-4) var(--rp-space-3);font-size:var(--rp-font-size-sm);color:var(--rp-color-text-subtle);text-align:center}.tray-foot.sc-rp-filter-menu{flex-shrink:0;padding:var(--rp-space-2);border-top:1px solid var(--rp-color-border)}.reset.sc-rp-filter-menu{width:100%;padding:7px;font:inherit;font-size:var(--rp-font-size-sm);font-weight:600;color:var(--rp-color-danger);cursor:pointer;background:none;border:none;border-radius:var(--rp-radius-sm);transition:background-color var(--rp-duration-fast) var(--rp-ease)}.reset.sc-rp-filter-menu:hover{background:var(--rp-color-danger-soft)}.trigger.sc-rp-filter-menu:focus-visible,.clear.sc-rp-filter-menu:focus-visible,.option.sc-rp-filter-menu:focus-visible,.reset.sc-rp-filter-menu:focus-visible,.search-field.sc-rp-filter-menu:focus-visible{outline:var(--rp-focus-ring);outline-offset:var(--rp-focus-offset)}@media (prefers-reduced-motion: no-preference){.tray.sc-rp-filter-menu{animation:rp-tray-in var(--rp-duration-fast) var(--rp-ease);transform-origin:top}@keyframes rp-tray-in{from{opacity:0;transform:translateY(-6px) scale(0.98)}}}@media (prefers-reduced-motion: reduce){.trigger.sc-rp-filter-menu,.chevron.sc-rp-filter-menu,.clear.sc-rp-filter-menu,.reset.sc-rp-filter-menu{transition:none}}"}},[514,"rp-filter-menu",{label:[1],options:[16],selected:[1],searchPlaceholder:[1,"search-placeholder"],searchable:[4],open:[1540],filterText:[32],activeIndex:[32]},[[5,"pointerdown","onDocumentPointerDown"],[4,"keydown","onDocumentKeydown"]],{open:[{onOpenChange:0}]}]);function n(){"undefined"!=typeof customElements&&["rp-filter-menu"].forEach((r=>{"rp-filter-menu"===r&&(customElements.get(i(r))||customElements.define(i(r),s))}))}n();const c=s,l=n;export{c as RpFilterMenu,l as defineCustomElement}
|
|
1
|
+
import{p as r,H as e,c as t,h as o,a,t as i}from"./index.js";const s=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.rpFilterChange=t(this,"rpFilterChange"),this.rpMenuToggle=t(this,"rpMenuToggle")}get el(){return this}label="Filter";options=[];selected=null;searchPlaceholder="Search…";searchable=!0;open=!1;filterText="";activeIndex=-1;rpFilterChange;rpMenuToggle;triggerEl;searchEl;onOpenChange(r){this.rpMenuToggle.emit({label:this.label,open:r}),r&&(this.filterText="",this.activeIndex=-1,requestAnimationFrame((()=>{this.searchable&&this.searchEl?.focus()})))}onDocumentPointerDown(r){this.open&&(this.el.contains(r.target)||(this.open=!1))}onDocumentKeydown(r){this.open&&"Escape"===r.key&&(r.preventDefault(),this.open=!1,this.triggerEl?.focus())}get visibleOptions(){const r=Array.isArray(this.options)?this.options:[],e=this.filterText.trim().toLowerCase();return e?r.filter((r=>r.toLowerCase().includes(e))):r}choose=r=>{this.rpFilterChange.emit(r),this.open=!1,this.triggerEl?.focus()};onTrayKeydown=r=>{const e=this.visibleOptions;if(0!==e.length)if("ArrowDown"!==r.key&&"ArrowUp"!==r.key)"Enter"===r.key&&this.activeIndex>=0&&(r.preventDefault(),this.choose(e[this.activeIndex]));else{r.preventDefault();const t=this.activeIndex+("ArrowDown"===r.key?1:-1);this.activeIndex=t<0?e.length-1:t%e.length}};render(){const r=this.visibleOptions,e=!!this.selected,t="rp-filter-tray-"+this.label.replace(/\s+/g,"-").toLowerCase();return o(a,{key:"b75b5ecc274711c500d7ab6b6da19d62f351cc68"},o("div",{key:"2385440a8c3f8158082072b495e2e222f0c4a1b7",class:"wrap"},o("button",{key:"e7cc93fd2bfc2405f14ac3182161d28665a6d9c2",type:"button",class:{trigger:!0,"is-active":e},ref:r=>this.triggerEl=r,onPointerDown:r=>{r.preventDefault(),this.triggerEl?.focus(),this.open=!this.open},onKeyDown:r=>{"Enter"!==r.key&&" "!==r.key||(r.preventDefault(),this.open=!this.open)},"aria-expanded":this.open?"true":"false","aria-haspopup":"listbox","aria-controls":t},o("span",{key:"017c4c2f64f82dfd7f4cb9b713fb9fafd9607bc7",class:"trigger-label"},this.label),e&&o("span",{key:"5fc7e3e789297cadb7dc888403b18a4593e1bec3",class:"trigger-value"},this.selected),o("svg",{key:"5ec9e4b2469f0032464b028687d98bea933550ff",class:"chevron",viewBox:"0 0 24 24",width:"13",height:"13","aria-hidden":"true"},o("path",{key:"317db24d4eb2413f1a45a5027742491125bae86b",d:"m6 9 6 6 6-6"}))),e&&o("button",{key:"c4334ec227381d5e7bd94217dd46e51f51a009b3",type:"button",class:"clear",onClick:()=>this.choose(null),"aria-label":`Clear ${this.label.toLowerCase()} filter`},o("svg",{key:"169798991ca1e0f22431d3d17590ab83225c4c91",viewBox:"0 0 24 24",width:"12",height:"12","aria-hidden":"true"},o("path",{key:"79799a482f0989f20f1f83604b61014fa2d0b30b",d:"M6 6l12 12M18 6L6 18"}))),this.open&&o("div",{key:"1297345512d4a06ff044ba66d1e99c099ee39d5c",class:"tray",id:t,role:"listbox","aria-label":this.label,onKeyDown:this.onTrayKeydown},this.searchable&&o("div",{key:"d941c5ae2e70ab3779a138d85aebed47110f09c5",class:"search"},o("svg",{key:"5674c55b8f54429acb4c6e71f0449016190d20a5",class:"search-icon",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},o("circle",{key:"46c1015878ce6d8e86fe1bf12c87ef811ab22516",cx:"11",cy:"11",r:"7"}),o("path",{key:"9562775081d6fae4688067c9a55d1bf036cf79fb",d:"m20 20-3.6-3.6"})),o("input",{key:"041d84883328d6b3d13574b1751ee809aea68768",type:"text",class:"search-field",ref:r=>this.searchEl=r,value:this.filterText,placeholder:this.searchPlaceholder,"aria-label":`Search ${this.label.toLowerCase()} options`,onInput:r=>{this.filterText=r.target.value,this.activeIndex=-1}})),o("div",{key:"3d3ee51a876bfc01d25785ce5a4da5a057c51144",class:"options"},0===r.length?o("p",{class:"no-match"},"No matches"):r.map(((r,e)=>o("button",{key:r,type:"button",role:"option","aria-selected":this.selected===r?"true":"false",class:{option:!0,"is-selected":this.selected===r,"is-active":this.activeIndex===e},onClick:()=>this.choose(r),onMouseEnter:()=>this.activeIndex=e},o("span",{class:"option-text"},r),this.selected===r&&o("svg",{viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},o("path",{d:"m5 13 4 4L19 7"})))))),e&&o("div",{key:"9e5de089306361cae946b04d70df76eb9062a482",class:"tray-foot"},o("button",{key:"402c531a240a44a2570217e49ddec556b9d51108",type:"button",class:"reset",onClick:()=>this.choose(null)},"Clear selection")))))}static get watchers(){return{open:[{onOpenChange:0}]}}static get style(){return".sc-rp-filter-menu-h{display:inline-block;font-family:var(--rp-font-sans)}.wrap.sc-rp-filter-menu{position:relative;display:inline-flex;align-items:center;gap:var(--rp-space-1)}.trigger.sc-rp-filter-menu{display:inline-flex;gap:var(--rp-space-2);align-items:center;padding:8px var(--rp-space-4);font:inherit;font-size:var(--rp-font-size-sm);font-weight:600;color:var(--rp-color-text-body);cursor:pointer;background:var(--rp-color-surface);border:1px solid var(--rp-color-border);border-radius:var(--rp-radius-pill);transition:color var(--rp-duration-fast) var(--rp-ease), background-color var(--rp-duration-fast) var(--rp-ease), border-color var(--rp-duration-fast) var(--rp-ease), box-shadow var(--rp-duration-fast) var(--rp-ease)}.trigger.sc-rp-filter-menu:hover{color:var(--rp-color-text);border-color:var(--rp-color-border-strong);box-shadow:var(--rp-shadow-sm)}.trigger.is-active.sc-rp-filter-menu{color:var(--rp-color-accent-contrast);background:var(--rp-color-accent);border-color:var(--rp-color-accent);box-shadow:var(--rp-shadow-sm)}[open].sc-rp-filter-menu-h .trigger.sc-rp-filter-menu{border-color:var(--rp-color-focus);box-shadow:var(--rp-focus-halo)}.trigger-value.sc-rp-filter-menu{max-width:12ch;overflow:hidden;font-weight:500;text-overflow:ellipsis;white-space:nowrap;opacity:0.85}.trigger-value.sc-rp-filter-menu::before{content:'· ';opacity:0.6}.chevron.sc-rp-filter-menu{flex-shrink:0;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;transition:transform var(--rp-duration-fast) var(--rp-ease)}[open].sc-rp-filter-menu-h .chevron.sc-rp-filter-menu{transform:rotate(180deg)}.clear.sc-rp-filter-menu{display:grid;place-items:center;width:24px;height:24px;padding:0;color:var(--rp-color-text-subtle);cursor:pointer;background:none;border:none;border-radius:50%;transition:color var(--rp-duration-fast) var(--rp-ease), background-color var(--rp-duration-fast) var(--rp-ease)}.clear.sc-rp-filter-menu svg.sc-rp-filter-menu{fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round}.clear.sc-rp-filter-menu:hover{color:var(--rp-color-danger);background:var(--rp-color-danger-soft)}.tray.sc-rp-filter-menu{position:absolute;inset-block-start:calc(100% + var(--rp-space-2));inset-inline-start:0;z-index:30;display:flex;flex-direction:column;width:max(240px, 100%);max-height:340px;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-lg)}.search.sc-rp-filter-menu{display:flex;gap:var(--rp-space-2);align-items:center;flex-shrink:0;padding:var(--rp-space-3);border-bottom:1px solid var(--rp-color-border)}.search-icon.sc-rp-filter-menu{flex-shrink:0;fill:none;stroke:var(--rp-color-text-subtle);stroke-width:2;stroke-linecap:round}.search-field.sc-rp-filter-menu{flex:1;min-width:0;font:inherit;font-size:var(--rp-font-size-sm);font-weight:500;letter-spacing:-0.005em;color:var(--rp-color-text);background:none;border:none}.search-field.sc-rp-filter-menu::placeholder{font-weight:500;color:var(--rp-color-text-subtle)}.search-field.sc-rp-filter-menu:focus{outline:none}.options.sc-rp-filter-menu{flex:1;padding:var(--rp-space-1);overflow-y:auto;overscroll-behavior:contain}.option.sc-rp-filter-menu{display:flex;gap:var(--rp-space-2);align-items:center;justify-content:space-between;width:100%;padding:9px var(--rp-space-3);font:inherit;font-size:var(--rp-font-size-sm);font-weight:500;letter-spacing:-0.005em;line-height:1.4;color:var(--rp-color-text-body);text-align:start;cursor:pointer;background:none;border:none;border-radius:var(--rp-radius-sm);transition:color var(--rp-duration-fast) var(--rp-ease), background-color var(--rp-duration-fast) var(--rp-ease)}.option.sc-rp-filter-menu svg.sc-rp-filter-menu{flex-shrink:0;fill:none;stroke:var(--rp-color-highlight);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}.option-text.sc-rp-filter-menu{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.option.is-active.sc-rp-filter-menu{color:var(--rp-color-text);background:var(--rp-color-surface-sunken)}.option.is-selected.sc-rp-filter-menu{font-weight:600;color:var(--rp-color-text)}.no-match.sc-rp-filter-menu{margin:0;padding:var(--rp-space-5) var(--rp-space-3);font-size:var(--rp-font-size-sm);font-weight:500;color:var(--rp-color-text-subtle);text-align:center}.tray-foot.sc-rp-filter-menu{flex-shrink:0;padding:var(--rp-space-2);border-top:1px solid var(--rp-color-border)}.reset.sc-rp-filter-menu{width:100%;padding:7px;font:inherit;font-size:var(--rp-font-size-sm);font-weight:600;color:var(--rp-color-danger);cursor:pointer;background:none;border:none;border-radius:var(--rp-radius-sm);transition:background-color var(--rp-duration-fast) var(--rp-ease)}.reset.sc-rp-filter-menu:hover{background:var(--rp-color-danger-soft)}.trigger.sc-rp-filter-menu:focus-visible,.clear.sc-rp-filter-menu:focus-visible,.option.sc-rp-filter-menu:focus-visible,.reset.sc-rp-filter-menu:focus-visible,.search-field.sc-rp-filter-menu:focus-visible{outline:var(--rp-focus-ring);outline-offset:var(--rp-focus-offset)}@media (prefers-reduced-motion: no-preference){.tray.sc-rp-filter-menu{animation:rp-tray-in var(--rp-duration-fast) var(--rp-ease);transform-origin:top}@keyframes rp-tray-in{from{opacity:0;transform:translateY(-6px) scale(0.98)}}}@media (prefers-reduced-motion: reduce){.trigger.sc-rp-filter-menu,.chevron.sc-rp-filter-menu,.clear.sc-rp-filter-menu,.reset.sc-rp-filter-menu{transition:none}}"}},[514,"rp-filter-menu",{label:[1],options:[16],selected:[1],searchPlaceholder:[1,"search-placeholder"],searchable:[4],open:[1540],filterText:[32],activeIndex:[32]},[[5,"pointerdown","onDocumentPointerDown"],[4,"keydown","onDocumentKeydown"]],{open:[{onOpenChange:0}]}]);function n(){"undefined"!=typeof customElements&&["rp-filter-menu"].forEach((r=>{"rp-filter-menu"===r&&(customElements.get(i(r))||customElements.define(i(r),s))}))}n();const c=s,l=n;export{c as RpFilterMenu,l as defineCustomElement}
|