@ssj4kyuubi/recipe-ui-lib 0.1.4
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/README.md +128 -0
- package/dist/cjs/index-CJNMpFY7.js +1609 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +12 -0
- package/dist/cjs/rui-button.cjs.entry.js +31 -0
- package/dist/cjs/rui-filter-chips.cjs.entry.js +30 -0
- package/dist/cjs/rui-meal-planner.cjs.entry.js +52 -0
- package/dist/cjs/rui-modal.cjs.entry.js +52 -0
- package/dist/cjs/rui-recipe-card.cjs.entry.js +29 -0
- package/dist/cjs/rui-recipe-detail.cjs.entry.js +34 -0
- package/dist/cjs/rui-recipe-list.cjs.entry.js +44 -0
- package/dist/cjs/rui-search-bar.cjs.entry.js +39 -0
- package/dist/cjs/rui.cjs.js +24 -0
- package/dist/collection/collection-manifest.json +20 -0
- package/dist/collection/components/index.js +8 -0
- package/dist/collection/components/rui-button/rui-button.css +72 -0
- package/dist/collection/components/rui-button/rui-button.js +140 -0
- package/dist/collection/components/rui-filter-chips/rui-filter-chips.css +30 -0
- package/dist/collection/components/rui-filter-chips/rui-filter-chips.js +96 -0
- package/dist/collection/components/rui-meal-planner/rui-meal-planner.css +130 -0
- package/dist/collection/components/rui-meal-planner/rui-meal-planner.js +174 -0
- package/dist/collection/components/rui-modal/rui-modal.css +79 -0
- package/dist/collection/components/rui-modal/rui-modal.js +137 -0
- package/dist/collection/components/rui-recipe-card/rui-recipe-card.css +100 -0
- package/dist/collection/components/rui-recipe-card/rui-recipe-card.js +122 -0
- package/dist/collection/components/rui-recipe-detail/rui-recipe-detail.css +197 -0
- package/dist/collection/components/rui-recipe-detail/rui-recipe-detail.js +127 -0
- package/dist/collection/components/rui-recipe-list/rui-recipe-list.css +16 -0
- package/dist/collection/components/rui-recipe-list/rui-recipe-list.js +160 -0
- package/dist/collection/components/rui-search-bar/rui-search-bar.css +45 -0
- package/dist/collection/components/rui-search-bar/rui-search-bar.js +137 -0
- package/dist/collection/index.js +1 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/rui-button.d.ts +11 -0
- package/dist/components/rui-button.js +1 -0
- package/dist/components/rui-filter-chips.d.ts +11 -0
- package/dist/components/rui-filter-chips.js +1 -0
- package/dist/components/rui-meal-planner.d.ts +11 -0
- package/dist/components/rui-meal-planner.js +1 -0
- package/dist/components/rui-modal.d.ts +11 -0
- package/dist/components/rui-modal.js +1 -0
- package/dist/components/rui-recipe-card.d.ts +11 -0
- package/dist/components/rui-recipe-card.js +1 -0
- package/dist/components/rui-recipe-card2.js +1 -0
- package/dist/components/rui-recipe-detail.d.ts +11 -0
- package/dist/components/rui-recipe-detail.js +1 -0
- package/dist/components/rui-recipe-list.d.ts +11 -0
- package/dist/components/rui-recipe-list.js +1 -0
- package/dist/components/rui-search-bar.d.ts +11 -0
- package/dist/components/rui-search-bar.js +1 -0
- package/dist/esm/index-Cye74XUb.js +1599 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +10 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/rui-button.entry.js +29 -0
- package/dist/esm/rui-filter-chips.entry.js +28 -0
- package/dist/esm/rui-meal-planner.entry.js +50 -0
- package/dist/esm/rui-modal.entry.js +50 -0
- package/dist/esm/rui-recipe-card.entry.js +27 -0
- package/dist/esm/rui-recipe-detail.entry.js +32 -0
- package/dist/esm/rui-recipe-list.entry.js +42 -0
- package/dist/esm/rui-search-bar.entry.js +37 -0
- package/dist/esm/rui.js +20 -0
- package/dist/esm-es5/index-Cye74XUb.js +64 -0
- package/dist/esm-es5/index.js +0 -0
- package/dist/esm-es5/loader.js +1 -0
- package/dist/esm-es5/rui-button.entry.js +1 -0
- package/dist/esm-es5/rui-filter-chips.entry.js +1 -0
- package/dist/esm-es5/rui-meal-planner.entry.js +1 -0
- package/dist/esm-es5/rui-modal.entry.js +1 -0
- package/dist/esm-es5/rui-recipe-card.entry.js +1 -0
- package/dist/esm-es5/rui-recipe-detail.entry.js +1 -0
- package/dist/esm-es5/rui-recipe-list.entry.js +1 -0
- package/dist/esm-es5/rui-search-bar.entry.js +1 -0
- package/dist/esm-es5/rui.js +4 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/rui/index.esm.js +0 -0
- package/dist/rui/p-044c45e5.entry.js +1 -0
- package/dist/rui/p-0eda7928.system.entry.js +1 -0
- package/dist/rui/p-1a89ad3e.system.entry.js +1 -0
- package/dist/rui/p-1b310317.system.entry.js +1 -0
- package/dist/rui/p-2fc25e59.system.entry.js +1 -0
- package/dist/rui/p-40bf8db2.entry.js +1 -0
- package/dist/rui/p-72d787e7.system.entry.js +1 -0
- package/dist/rui/p-89d06840.system.entry.js +1 -0
- package/dist/rui/p-9e0ffa92.entry.js +1 -0
- package/dist/rui/p-Chuy7yuu.system.js +5 -0
- package/dist/rui/p-Cye74XUb.js +3 -0
- package/dist/rui/p-DMa34l4T.system.js +64 -0
- package/dist/rui/p-YWpyar7R.system.js +1 -0
- package/dist/rui/p-a25c8161.entry.js +1 -0
- package/dist/rui/p-ad0253ac.entry.js +1 -0
- package/dist/rui/p-b5196c19.system.entry.js +1 -0
- package/dist/rui/p-b5d6b297.system.entry.js +1 -0
- package/dist/rui/p-d04fa46b.entry.js +1 -0
- package/dist/rui/p-d34e0888.entry.js +1 -0
- package/dist/rui/p-eac80bd7.entry.js +1 -0
- package/dist/rui/rui.css +1 -0
- package/dist/rui/rui.esm.js +1 -0
- package/dist/rui/rui.js +127 -0
- package/dist/types/components/index.d.ts +8 -0
- package/dist/types/components/rui-button/rui-button.d.ts +11 -0
- package/dist/types/components/rui-filter-chips/rui-filter-chips.d.ts +12 -0
- package/dist/types/components/rui-meal-planner/rui-meal-planner.d.ts +29 -0
- package/dist/types/components/rui-modal/rui-modal.d.ts +13 -0
- package/dist/types/components/rui-recipe-card/rui-recipe-card.d.ts +20 -0
- package/dist/types/components/rui-recipe-detail/rui-recipe-detail.d.ts +28 -0
- package/dist/types/components/rui-recipe-list/rui-recipe-list.d.ts +16 -0
- package/dist/types/components/rui-search-bar/rui-search-bar.d.ts +14 -0
- package/dist/types/components.d.ts +654 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1873 -0
- package/loader/cdn.js +2 -0
- package/loader/index.cjs.js +2 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +2 -0
- package/loader/index.js +3 -0
- package/package.json +58 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CJNMpFY7.js');
|
|
4
|
+
|
|
5
|
+
const defineCustomElements = async (win, options) => {
|
|
6
|
+
if (typeof window === 'undefined') return undefined;
|
|
7
|
+
await index.globalScripts();
|
|
8
|
+
return index.bootstrapLazy([["rui-recipe-list.cjs",[[1,"rui-recipe-list",{"recipes":[16],"favorites":[16],"emptyMessage":[1,"empty-message"]},null,{"recipes":[{"recipesChanged":0}],"favorites":[{"favoritesChanged":0}]}]]],["rui-button.cjs",[[257,"rui-button",{"variant":[1],"disabled":[516],"loading":[4],"type":[1]}]]],["rui-filter-chips.cjs",[[1,"rui-filter-chips",{"categories":[16],"selected":[16]}]]],["rui-meal-planner.cjs",[[1,"rui-meal-planner",{"plan":[16],"days":[16]}]]],["rui-modal.cjs",[[257,"rui-modal",{"open":[1540],"modalTitle":[1,"modal-title"],"closeOnBackdrop":[4,"close-on-backdrop"]},null,{"open":[{"openChanged":0}]}]]],["rui-recipe-detail.cjs",[[257,"rui-recipe-detail",{"recipe":[16],"isFavorite":[516,"is-favorite"]}]]],["rui-search-bar.cjs",[[1,"rui-search-bar",{"value":[1025],"placeholder":[1],"debounceMs":[2,"debounce-ms"]}]]],["rui-recipe-card.cjs",[[257,"rui-recipe-card",{"recipe":[16],"isFavorite":[516,"is-favorite"]}]]]], options);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
exports.setNonce = index.setNonce;
|
|
12
|
+
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CJNMpFY7.js');
|
|
4
|
+
|
|
5
|
+
const ruiButtonCss = () => `:host{display:inline-block}.rui-btn{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;gap:0.5em;font-family:var(--rui-font);font-size:0.95rem;font-weight:600;padding:0.55rem 1.1rem;border-radius:var(--rui-radius);border:1px solid transparent;cursor:pointer;-webkit-transition:background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;transition:background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;line-height:1.2;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.rui-btn:disabled{opacity:0.6;cursor:not-allowed}.rui-btn--primary{background-color:var(--rui-color-primary);color:#fff}.rui-btn--primary:hover:not(:disabled){background-color:var(--rui-color-primary-hover)}.rui-btn--secondary{background-color:var(--rui-color-secondary);color:#fff}.rui-btn--secondary:hover:not(:disabled){background-color:#14538a}.rui-btn--danger{background-color:var(--rui-color-danger);color:#fff}.rui-btn--danger:hover:not(:disabled){background-color:#a52323}.rui-btn--ghost{background-color:transparent;color:var(--rui-color-text);border-color:var(--rui-color-border)}.rui-btn--ghost:hover:not(:disabled){background-color:var(--rui-color-bg-alt)}.rui-btn__spinner{width:1em;height:1em;border:2px solid currentColor;border-top-color:transparent;border-radius:50%;-webkit-animation:rui-spin 0.7s linear infinite;animation:rui-spin 0.7s linear infinite}@-webkit-keyframes rui-spin{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rui-spin{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}`;
|
|
6
|
+
|
|
7
|
+
const RuiButton = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.ruiClick = index.createEvent(this, "ruiClick");
|
|
11
|
+
this.variant = 'primary';
|
|
12
|
+
this.disabled = false;
|
|
13
|
+
this.loading = false;
|
|
14
|
+
this.type = 'button';
|
|
15
|
+
this.handleClick = (e) => {
|
|
16
|
+
if (this.disabled || this.loading) {
|
|
17
|
+
e.preventDefault();
|
|
18
|
+
e.stopPropagation();
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
this.ruiClick.emit(e);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
25
|
+
return (index.h(index.Host, { key: '0ab23154d1836dfd9d0a691705a0e5cc6f91dae3' }, index.h("button", { key: '986e600d39ed91200857739179c2e105207c0ebc', class: `rui-btn rui-btn--${this.variant}`, type: this.type, disabled: this.disabled || this.loading, onClick: this.handleClick, "aria-busy": this.loading ? 'true' : 'false' }, this.loading && index.h("span", { key: '406a34032a25dd05f986e53075e2c7cf45727c85', class: "rui-btn__spinner", "aria-hidden": "true" }), index.h("span", { key: '7f9ae69c7824227e0b56f2abffb10b95c7a8b92d', class: "rui-btn__label" }, index.h("slot", { key: '1498be76d79baf033b9913f5f61a5b64192b341e' })))));
|
|
26
|
+
}
|
|
27
|
+
get el() { return index.getElement(this); }
|
|
28
|
+
};
|
|
29
|
+
RuiButton.style = ruiButtonCss();
|
|
30
|
+
|
|
31
|
+
exports.rui_button = RuiButton;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CJNMpFY7.js');
|
|
4
|
+
|
|
5
|
+
const ruiFilterChipsCss = () => `:host{display:block}.rui-chips{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:0.5rem}.rui-chip{font-family:var(--rui-font);font-size:0.85rem;font-weight:500;padding:0.35rem 0.85rem;border-radius:999px;border:1px solid var(--rui-color-border);background:var(--rui-color-bg);color:var(--rui-color-text);cursor:pointer;-webkit-transition:background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;transition:background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease}.rui-chip:hover{border-color:var(--rui-color-primary)}.rui-chip--active{background:var(--rui-color-primary);border-color:var(--rui-color-primary);color:#fff}`;
|
|
6
|
+
|
|
7
|
+
const RuiFilterChips = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.ruiFilterChange = index.createEvent(this, "ruiFilterChange");
|
|
11
|
+
this.categories = [];
|
|
12
|
+
this.selected = [];
|
|
13
|
+
this.toggle = (value) => {
|
|
14
|
+
const next = this.selected.includes(value)
|
|
15
|
+
? this.selected.filter((v) => v !== value)
|
|
16
|
+
: [...this.selected, value];
|
|
17
|
+
this.selected = [...next];
|
|
18
|
+
this.ruiFilterChange.emit(this.selected);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return (index.h(index.Host, { key: '628063d481c07e5c80312a9a395ba7ad0ab859dc' }, index.h("div", { key: 'd3aa0f87f0e6b6bd55960dc91769f56b70e4ef67', class: "rui-chips", role: "group", "aria-label": "Filters" }, this.categories.map((cat) => {
|
|
23
|
+
const active = this.selected.includes(cat.value);
|
|
24
|
+
return (index.h("button", { type: "button", class: `rui-chip ${active ? 'rui-chip--active' : ''}`, "aria-pressed": active ? 'true' : 'false', onClick: () => this.toggle(cat.value) }, cat.label));
|
|
25
|
+
}))));
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
RuiFilterChips.style = ruiFilterChipsCss();
|
|
29
|
+
|
|
30
|
+
exports.rui_filter_chips = RuiFilterChips;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CJNMpFY7.js');
|
|
4
|
+
|
|
5
|
+
const ruiMealPlannerCss = () => `:host{display:block}.rui-planner{display:grid;grid-template-columns:repeat(auto-fill, minmax(260px, 1fr));gap:1rem}.rui-planner__day{background:var(--rui-color-bg);border:1px solid var(--rui-color-border);border-radius:var(--rui-radius);-webkit-box-shadow:var(--rui-shadow-sm);box-shadow:var(--rui-shadow-sm);overflow:hidden}.rui-planner__day-head{padding:0.6rem 0.85rem;background:var(--rui-color-primary-soft);border-bottom:1px solid var(--rui-color-border)}.rui-planner__day-head h4{margin:0;font-size:0.95rem;font-weight:700;color:var(--rui-color-primary-hover)}.rui-planner__meal{display:-ms-flexbox;display:flex;gap:0.6rem;padding:0.75rem;-ms-flex-align:center;align-items:center}.rui-planner__meal--clickable{cursor:pointer;-webkit-transition:background-color 0.15s ease;transition:background-color 0.15s ease;border-radius:var(--rui-radius)}.rui-planner__meal--clickable:hover{background:var(--rui-color-primary-soft, #dcfce7)}.rui-planner__meal--clickable:focus-visible{outline:2px solid var(--rui-color-primary, #16a34a);outline-offset:-2px}.rui-planner__meal img{width:56px;height:56px;border-radius:var(--rui-radius-sm);-o-object-fit:cover;object-fit:cover;-ms-flex-negative:0;flex-shrink:0}.rui-planner__meal-info{-ms-flex:1;flex:1;min-width:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:0.15rem}.rui-planner__meal-name{font-size:0.9rem;font-weight:600;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.rui-planner__meal-cat{font-size:0.75rem;color:var(--rui-color-muted)}.rui-planner__meal-actions{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:0.25rem}.rui-planner__meal-actions button{font-family:var(--rui-font);font-size:0.75rem;padding:0.25rem 0.5rem;border-radius:var(--rui-radius-sm);border:1px solid var(--rui-color-border);background:var(--rui-color-bg);cursor:pointer}.rui-planner__meal-actions button:hover{border-color:var(--rui-color-primary)}.rui-planner__view{color:var(--rui-color-primary-hover, #15803d);font-weight:600}.rui-planner__view:hover{background:var(--rui-color-primary, #16a34a) !important;color:#fff !important;border-color:var(--rui-color-primary, #16a34a) !important}.rui-planner__clear:hover{color:var(--rui-color-danger);border-color:var(--rui-color-danger) !important}.rui-planner__empty{padding:1rem 0.75rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;gap:0.6rem;color:var(--rui-color-muted);font-size:0.85rem}.rui-planner__empty button{font-family:var(--rui-font);font-size:0.8rem;font-weight:600;padding:0.4rem 0.8rem;border-radius:var(--rui-radius);border:1px dashed var(--rui-color-border);background:var(--rui-color-bg-alt);color:var(--rui-color-primary-hover);cursor:pointer}.rui-planner__empty button:hover{border-color:var(--rui-color-primary);background:var(--rui-color-primary-soft)}`;
|
|
6
|
+
|
|
7
|
+
const RuiMealPlanner = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.ruiAssignMeal = index.createEvent(this, "ruiAssignMeal");
|
|
11
|
+
this.ruiRemoveMeal = index.createEvent(this, "ruiRemoveMeal");
|
|
12
|
+
this.ruiClearDay = index.createEvent(this, "ruiClearDay");
|
|
13
|
+
this.ruiSelectMeal = index.createEvent(this, "ruiSelectMeal");
|
|
14
|
+
this.plan = {};
|
|
15
|
+
this.days = [
|
|
16
|
+
'Monday',
|
|
17
|
+
'Tuesday',
|
|
18
|
+
'Wednesday',
|
|
19
|
+
'Thursday',
|
|
20
|
+
'Friday',
|
|
21
|
+
'Saturday',
|
|
22
|
+
'Sunday',
|
|
23
|
+
];
|
|
24
|
+
this.assign = (day) => this.ruiAssignMeal.emit({ day });
|
|
25
|
+
this.remove = (day, recipe) => this.ruiRemoveMeal.emit({ day, recipe });
|
|
26
|
+
this.clear = (day) => this.ruiClearDay.emit({ day });
|
|
27
|
+
this.selectMeal = (day, recipe) => this.ruiSelectMeal.emit({ day, recipe });
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
return (index.h(index.Host, { key: 'de032b8a71504aa8c7ce9ae269c299974c03e160' }, index.h("div", { key: '178b5fc0a98d94cc2bb9666d7edcd74ca605df98', class: "rui-planner" }, this.days.map((day) => {
|
|
31
|
+
const meal = this.plan[day];
|
|
32
|
+
return (index.h("div", { class: "rui-planner__day" }, index.h("div", { class: "rui-planner__day-head" }, index.h("h4", null, day)), meal && meal.recipe ? (index.h("div", { class: "rui-planner__meal rui-planner__meal--clickable", onClick: () => this.selectMeal(day, meal.recipe), role: "button", tabindex: 0, onKeyDown: (e) => {
|
|
33
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
34
|
+
e.preventDefault();
|
|
35
|
+
this.selectMeal(day, meal.recipe);
|
|
36
|
+
}
|
|
37
|
+
}, title: "View recipe ingredients" }, meal.recipe.image && (index.h("img", { src: meal.recipe.image, alt: meal.recipe.name })), index.h("div", { class: "rui-planner__meal-info" }, index.h("span", { class: "rui-planner__meal-name" }, meal.recipe.name), meal.recipe.category && (index.h("span", { class: "rui-planner__meal-cat" }, meal.recipe.category))), index.h("div", { class: "rui-planner__meal-actions" }, index.h("button", { type: "button", class: "rui-planner__view", onClick: (e) => {
|
|
38
|
+
e.stopPropagation();
|
|
39
|
+
this.selectMeal(day, meal.recipe);
|
|
40
|
+
} }, "View"), index.h("button", { type: "button", onClick: (e) => {
|
|
41
|
+
e.stopPropagation();
|
|
42
|
+
this.remove(day, meal.recipe);
|
|
43
|
+
} }, "Remove"), index.h("button", { type: "button", class: "rui-planner__clear", onClick: (e) => {
|
|
44
|
+
e.stopPropagation();
|
|
45
|
+
this.clear(day);
|
|
46
|
+
} }, "Clear")))) : (index.h("div", { class: "rui-planner__empty" }, index.h("span", null, "No meal planned"), index.h("button", { type: "button", onClick: () => this.assign(day) }, "+ Assign recipe")))));
|
|
47
|
+
}))));
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
RuiMealPlanner.style = ruiMealPlannerCss();
|
|
51
|
+
|
|
52
|
+
exports.rui_meal_planner = RuiMealPlanner;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CJNMpFY7.js');
|
|
4
|
+
|
|
5
|
+
const ruiModalCss = () => `:host{display:block}.rui-modal__backdrop{position:fixed;inset:0;background:rgba(0, 0, 0, 0.5);display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:center;justify-content:center;padding:5vh 1rem 1rem;z-index:1000;overflow-y:auto}.rui-modal__dialog{background:var(--rui-color-bg, #ffffff);border:1px solid var(--rui-color-border, #dee2e6);border-radius:var(--rui-radius, 8px);-webkit-box-shadow:var(--rui-shadow-md, 0 4px 12px rgba(0, 0, 0, 0.12));box-shadow:var(--rui-shadow-md, 0 4px 12px rgba(0, 0, 0, 0.12));width:100%;max-width:560px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:90vh;position:relative}.rui-modal__header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:1rem 1.25rem;border-bottom:1px solid var(--rui-color-border, #dee2e6);background:var(--rui-color-bg, #ffffff);border-radius:var(--rui-radius, 8px) var(--rui-radius, 8px) 0 0}.rui-modal__title{margin:0;font-size:1.15rem;font-weight:700;color:var(--rui-color-text, #212529);font-family:var(--rui-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif)}.rui-modal__close{background:none;border:none;font-size:1.5rem;line-height:1;cursor:pointer;color:var(--rui-color-muted, #868e96);padding:0 0.25rem}.rui-modal__close:hover{color:var(--rui-color-text, #212529)}.rui-modal__body{padding:1.25rem;overflow-y:auto;background:var(--rui-color-bg, #ffffff);color:var(--rui-color-text, #212529)}.rui-modal__footer{padding:1rem 1.25rem;border-top:1px solid var(--rui-color-border, #dee2e6);display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;gap:0.5rem;background:var(--rui-color-bg, #ffffff);border-radius:0 0 var(--rui-radius, 8px) var(--rui-radius, 8px)}.rui-modal__footer:empty{display:none}`;
|
|
6
|
+
|
|
7
|
+
const RuiModal = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.ruiClose = index.createEvent(this, "ruiClose");
|
|
11
|
+
this.open = false;
|
|
12
|
+
this.modalTitle = '';
|
|
13
|
+
this.closeOnBackdrop = true;
|
|
14
|
+
this.handleBackdrop = (e) => {
|
|
15
|
+
if (!this.closeOnBackdrop)
|
|
16
|
+
return;
|
|
17
|
+
if (e.target === e.currentTarget) {
|
|
18
|
+
this.requestClose();
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
this.handleKey = (e) => {
|
|
22
|
+
if (e.key === 'Escape' && this.open) {
|
|
23
|
+
this.requestClose();
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
requestClose() {
|
|
28
|
+
this.ruiClose.emit();
|
|
29
|
+
}
|
|
30
|
+
openChanged(isOpen) {
|
|
31
|
+
if (isOpen) {
|
|
32
|
+
document.addEventListener('keydown', this.handleKey);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
document.removeEventListener('keydown', this.handleKey);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
disconnectedCallback() {
|
|
39
|
+
document.removeEventListener('keydown', this.handleKey);
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
return (index.h(index.Host, { key: '9bbdb18b18e8c09ec5e8edfd886a44cb4d86cb0b' }, this.open && (index.h("div", { key: 'b772df0ce6a04949c1ac0d44449545a35d877adc', class: "rui-modal__backdrop", onClick: this.handleBackdrop }, index.h("div", { key: '4c22489ccd86da08b1a007757b1c42da4023067e', class: "rui-modal__dialog", role: "dialog", "aria-modal": "true", "aria-label": this.modalTitle }, index.h("header", { key: '5dd1ceca76410c18acbc8b12fc7cb9ca8c6dff27', class: "rui-modal__header" }, index.h("h3", { key: 'c131c313193f0ba0fd847426dff141f3c1adc143', class: "rui-modal__title" }, this.modalTitle), index.h("button", { key: 'c280b26ea160e5c765b80eb9054dd5ff186e7646', class: "rui-modal__close", type: "button", "aria-label": "Close", onClick: () => this.requestClose() }, "\u00D7")), index.h("div", { key: 'f4c32d83f83e5e452dc10a368f5f620e3557eedf', class: "rui-modal__body" }, index.h("slot", { key: 'a278a93efe24076204c4fce7b0cf44be22df4dc9' })), index.h("footer", { key: '31bed0da07b6310cdf4684c24f505ede0a220416', class: "rui-modal__footer" }, index.h("slot", { key: '7a5806e2edf0d6aaef25b119c1d2ba8f3684a1f7', name: "footer" })))))));
|
|
43
|
+
}
|
|
44
|
+
static get watchers() { return {
|
|
45
|
+
"open": [{
|
|
46
|
+
"openChanged": 0
|
|
47
|
+
}]
|
|
48
|
+
}; }
|
|
49
|
+
};
|
|
50
|
+
RuiModal.style = ruiModalCss();
|
|
51
|
+
|
|
52
|
+
exports.rui_modal = RuiModal;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CJNMpFY7.js');
|
|
4
|
+
|
|
5
|
+
const ruiRecipeCardCss = () => `:host{display:block}.rui-card{background:var(--rui-color-bg);border:1px solid var(--rui-color-border);border-radius:var(--rui-radius);overflow:hidden;-webkit-box-shadow:var(--rui-shadow-sm);box-shadow:var(--rui-shadow-sm);cursor:pointer;-webkit-transition:-webkit-transform 0.15s ease, -webkit-box-shadow 0.15s ease;transition:-webkit-transform 0.15s ease, -webkit-box-shadow 0.15s ease;transition:transform 0.15s ease, box-shadow 0.15s ease;transition:transform 0.15s ease, box-shadow 0.15s ease, -webkit-transform 0.15s ease, -webkit-box-shadow 0.15s ease;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%}.rui-card:hover{-webkit-transform:translateY(-2px);transform:translateY(-2px);-webkit-box-shadow:var(--rui-shadow-md);box-shadow:var(--rui-shadow-md)}.rui-card__media{position:relative;aspect-ratio:16 / 10;background:var(--rui-color-bg-alt);overflow:hidden}.rui-card__media img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover;display:block}.rui-card__placeholder{width:100%;height:100%;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;color:var(--rui-color-muted);font-size:0.85rem}.rui-card__fav{position:absolute;top:0.5rem;right:0.5rem;width:2rem;height:2rem;border-radius:50%;border:none;background:rgba(255, 255, 255, 0.9);color:var(--rui-color-danger);font-size:1.1rem;line-height:1;cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-transition:background-color 0.15s ease, -webkit-transform 0.1s ease;transition:background-color 0.15s ease, -webkit-transform 0.1s ease;transition:background-color 0.15s ease, transform 0.1s ease;transition:background-color 0.15s ease, transform 0.1s ease, -webkit-transform 0.1s ease}.rui-card__fav:hover{background:#fff;-webkit-transform:scale(1.08);transform:scale(1.08)}.rui-card__fav.is-fav{color:var(--rui-color-danger);background:#fff}.rui-card__body{padding:0.85rem 1rem;-ms-flex:1;flex:1}.rui-card__title{margin:0 0 0.25rem;font-size:1rem;font-weight:600;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.rui-card__meta{margin:0;font-size:0.8rem;color:var(--rui-color-muted)}.rui-card__footer{padding:0 1rem 0.85rem;display:-ms-flexbox;display:flex;gap:0.5rem;-ms-flex-wrap:wrap;flex-wrap:wrap}.rui-card__footer:empty{display:none}`;
|
|
6
|
+
|
|
7
|
+
const RuiRecipeCard = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.ruiCardClick = index.createEvent(this, "ruiCardClick");
|
|
11
|
+
this.ruiFavoriteToggle = index.createEvent(this, "ruiFavoriteToggle");
|
|
12
|
+
this.isFavorite = false;
|
|
13
|
+
this.onCardClick = () => {
|
|
14
|
+
this.ruiCardClick.emit(this.recipe);
|
|
15
|
+
};
|
|
16
|
+
this.onFavClick = (e) => {
|
|
17
|
+
e.stopPropagation();
|
|
18
|
+
this.isFavorite = !this.isFavorite;
|
|
19
|
+
this.ruiFavoriteToggle.emit({ recipe: this.recipe, isFavorite: this.isFavorite });
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
const r = this.recipe;
|
|
24
|
+
return (index.h(index.Host, { key: '8ba2647d2fed8b0539287633a5591892109596fb' }, index.h("article", { key: '8a58a35d34d08d0897bc7c68b82773bd361e2dcf', class: "rui-card", onClick: this.onCardClick }, index.h("div", { key: '04b5aa4b9563847aa116bbf477fabd806092f90a', class: "rui-card__media" }, r.image ? (index.h("img", { src: r.image, alt: r.name, loading: "lazy" })) : (index.h("div", { class: "rui-card__placeholder", "aria-hidden": "true" }, index.h("span", null, "No image"))), index.h("button", { key: 'ea6b5fe33ab2587f28491b75db84e87e3b1d193f', type: "button", class: `rui-card__fav ${this.isFavorite ? 'is-fav' : ''}`, "aria-pressed": this.isFavorite ? 'true' : 'false', "aria-label": this.isFavorite ? 'Remove from favorites' : 'Add to favorites', onClick: this.onFavClick }, this.isFavorite ? '\u2665' : '\u2661')), index.h("div", { key: '2bd65d44934ee52a98cc2be459b770a8fe18dd0f', class: "rui-card__body" }, index.h("h3", { key: '55bd4f5faf4ed06696c6ed22f828d811afa605a5', class: "rui-card__title" }, r.name), (r.category || r.area) && (index.h("p", { key: '5184ee876bdfb90cdef9bc7f529be504ed18bf45', class: "rui-card__meta" }, [r.category, r.area].filter(Boolean).join(' \u00b7 ')))), index.h("div", { key: '5e3fc6c1cc4559bd6260ebf99039908f2e9c82e2', class: "rui-card__footer" }, index.h("slot", { key: '2567811b6ca78e06df4e2c51714dc1210fa65f00' })))));
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
RuiRecipeCard.style = ruiRecipeCardCss();
|
|
28
|
+
|
|
29
|
+
exports.rui_recipe_card = RuiRecipeCard;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CJNMpFY7.js');
|
|
4
|
+
|
|
5
|
+
const ruiRecipeDetailCss = () => `:host{display:block}.rui-detail{background:var(--rui-color-bg);border-radius:var(--rui-radius);-webkit-box-shadow:var(--rui-shadow-sm);box-shadow:var(--rui-shadow-sm);overflow:hidden}.rui-detail__header{display:grid;grid-template-columns:320px 1fr;gap:1.5rem;padding:1.5rem}@media (max-width: 640px){.rui-detail__header{grid-template-columns:1fr}}.rui-detail__media{aspect-ratio:4 / 3;background:var(--rui-color-bg-alt);border-radius:var(--rui-radius);overflow:hidden}.rui-detail__media img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover;display:block}.rui-detail__placeholder{width:100%;height:100%;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;color:var(--rui-color-muted)}.rui-detail__title{margin:0 0 0.35rem;font-size:1.6rem;font-weight:700}.rui-detail__meta{margin:0 0 1rem;color:var(--rui-color-muted);font-size:0.95rem}.rui-detail__actions{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:0.6rem;-ms-flex-align:center;align-items:center}.rui-detail__fav,.rui-detail__plan{font-family:var(--rui-font);font-size:0.9rem;font-weight:600;padding:0.5rem 0.9rem;border-radius:var(--rui-radius);border:1px solid var(--rui-color-border);background:var(--rui-color-bg);cursor:pointer;-webkit-transition:background-color 0.15s ease, border-color 0.15s ease;transition:background-color 0.15s ease, border-color 0.15s ease}.rui-detail__fav:hover,.rui-detail__plan:hover{border-color:var(--rui-color-primary);background:var(--rui-color-primary-soft)}.rui-detail__fav.is-fav{color:var(--rui-color-danger);border-color:var(--rui-color-danger);background:#fff5f5}.rui-detail__section{padding:0 1.5rem 1.5rem}.rui-detail__section h3{margin:0 0 0.75rem;font-size:1.15rem;font-weight:700;border-bottom:2px solid var(--rui-color-primary-soft);padding-bottom:0.35rem}.rui-detail__tables{display:grid;grid-template-columns:1fr 1fr;gap:1rem;-ms-flex-align:start;align-items:start}@media (max-width: 700px){.rui-detail__tables{grid-template-columns:1fr}}.rui-detail__table{width:100%;border-collapse:collapse;font-size:0.9rem;background:var(--rui-color-bg, #ffffff);border:1px solid var(--rui-color-border, #dee2e6);border-radius:var(--rui-radius, 8px);overflow:hidden}.rui-detail__table thead{background:var(--rui-color-bg-alt, #f8f9fa)}.rui-detail__table th{text-align:left;padding:0.6rem 0.75rem;font-weight:700;font-size:0.82rem;text-transform:uppercase;letter-spacing:0.03em;color:var(--rui-color-muted, #868e96);border-bottom:2px solid var(--rui-color-border, #dee2e6)}.rui-detail__table td{padding:0.55rem 0.75rem;border-bottom:1px solid var(--rui-color-border, #dee2e6);vertical-align:middle}.rui-detail__table tbody tr:last-child td{border-bottom:none}.rui-detail__table tbody tr:hover{background:var(--rui-color-primary-soft, #dcfce7)}.rui-detail__td--index{width:36px;text-align:center;color:var(--rui-color-muted, #868e96);font-weight:600}.rui-detail__ing-measure{color:var(--rui-color-muted, #868e96);white-space:nowrap}.rui-detail__ing-name{font-weight:500;color:var(--rui-color-text, #212529)}.rui-detail__empty{color:var(--rui-color-muted, #868e96);font-size:0.9rem;margin:0.5rem 0 0}.rui-detail__ingredients{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill, minmax(220px, 1fr));gap:0.4rem 1rem}.rui-detail__ingredients li{display:-ms-flexbox;display:flex;gap:0.5rem;font-size:0.9rem;padding:0.3rem 0;border-bottom:1px dashed var(--rui-color-border, #dee2e6)}.rui-detail__instructions{white-space:pre-line;line-height:1.6;font-size:0.95rem;margin:0}.rui-detail__links{display:-ms-flexbox;display:flex;gap:1rem}.rui-detail__links a{color:var(--rui-color-secondary);text-decoration:none;font-weight:500}.rui-detail__links a:hover{text-decoration:underline}`;
|
|
6
|
+
|
|
7
|
+
const RuiRecipeDetail = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.ruiAddToPlan = index.createEvent(this, "ruiAddToPlan");
|
|
11
|
+
this.ruiFavoriteToggle = index.createEvent(this, "ruiFavoriteToggle");
|
|
12
|
+
this.isFavorite = false;
|
|
13
|
+
this.onAddToPlan = () => {
|
|
14
|
+
this.ruiAddToPlan.emit(this.recipe);
|
|
15
|
+
};
|
|
16
|
+
this.onFavToggle = () => {
|
|
17
|
+
this.isFavorite = !this.isFavorite;
|
|
18
|
+
this.ruiFavoriteToggle.emit({ recipe: this.recipe, isFavorite: this.isFavorite });
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
const r = this.recipe;
|
|
23
|
+
return (index.h(index.Host, { key: '3cbe3361e6d88381fbec4fd8d282963933878de4' }, index.h("article", { key: 'ef3860f9752829fae37d374684f5b6e5045299e5', class: "rui-detail" }, index.h("header", { key: 'a14c496c15e23458956538926449bcecb742fd4c', class: "rui-detail__header" }, index.h("div", { key: 'e6766cf5e4d766fcd2b47a946122b0b108de6a73', class: "rui-detail__media" }, r.image ? (index.h("img", { src: r.image, alt: r.name })) : (index.h("div", { class: "rui-detail__placeholder" }, "No image"))), index.h("div", { key: '3c0ccb26f0379d9ddd9cd29a05d237a9d377d516', class: "rui-detail__intro" }, index.h("h2", { key: '108020c974704efc52907eb1f945ee3a7584436f', class: "rui-detail__title" }, r.name), (r.category || r.area) && (index.h("p", { key: 'fc381751090c3c067076967347db95907e048898', class: "rui-detail__meta" }, [r.category, r.area].filter(Boolean).join(' \u00b7 '))), index.h("div", { key: 'a0084338478d82d0e7c4f738ff7650646805efe9', class: "rui-detail__actions" }, index.h("slot", { key: 'ba5ac7fba83204b9c7512837313238771d68a59c', name: "actions" }), index.h("button", { key: '1b2a17d3d7571e5d484a9a26bb13b69a9ec8d56a', type: "button", class: `rui-detail__fav ${this.isFavorite ? 'is-fav' : ''}`, "aria-pressed": this.isFavorite ? 'true' : 'false', onClick: this.onFavToggle }, this.isFavorite ? '\u2665 Favorited' : '\u2661 Add to favorites'), index.h("button", { key: '1f9e6eec95cf99ef6bad7197d488e4623d9c0381', type: "button", class: "rui-detail__plan", onClick: this.onAddToPlan }, "+ Add to meal plan")))), index.h("section", { key: '8fa48000e6baaf8f22431b413d964c79ce2f9441', class: "rui-detail__section" }, index.h("h3", { key: '44e655db0ee49e4a1f9f2e31a82a23c3c549060a' }, "Ingredients"), r.ingredients && r.ingredients.length > 0 ? ((() => {
|
|
24
|
+
const mid = Math.ceil(r.ingredients.length / 2);
|
|
25
|
+
const left = r.ingredients.slice(0, mid);
|
|
26
|
+
const right = r.ingredients.slice(mid);
|
|
27
|
+
const renderTable = (rows, offset) => (index.h("table", { class: "rui-detail__table" }, index.h("thead", null, index.h("tr", null, index.h("th", null, "#"), index.h("th", null, "Ingredient"), index.h("th", null, "Measure"))), index.h("tbody", null, rows.map((ing, idx) => (index.h("tr", null, index.h("td", { class: "rui-detail__td--index" }, offset + idx + 1), index.h("td", { class: "rui-detail__ing-name" }, ing.name), index.h("td", { class: "rui-detail__ing-measure" }, ing.measure || '—')))))));
|
|
28
|
+
return (index.h("div", { class: "rui-detail__tables" }, renderTable(left, 0), right.length > 0 && renderTable(right, mid)));
|
|
29
|
+
})()) : (index.h("p", { class: "rui-detail__empty" }, "No ingredients listed.")), index.h("slot", { key: '58d20bb01497af2651f492d9e6520a587d3e21ce', name: "ingredients-extra" })), r.instructions && (index.h("section", { key: '54176a29fab9b1142b30994d0ae74acd2e881e69', class: "rui-detail__section" }, index.h("h3", { key: '0f0900c1f6abb29cf8601d5d3e6fc44abc344105' }, "Instructions"), index.h("p", { key: 'e4f4e185a193ac818bc21e3974c957716a1b8fd6', class: "rui-detail__instructions" }, r.instructions))), (r.youtube || r.source) && (index.h("section", { key: 'f8db0b0a526a6e774e83d700325471dbc032170e', class: "rui-detail__section rui-detail__links" }, r.youtube && (index.h("a", { key: 'add83e9353e6294219dfb9304c98a49833913200', href: r.youtube, target: "_blank", rel: "noopener noreferrer" }, "Watch on YouTube")), r.source && (index.h("a", { key: 'b719435a049b54a4b5ec1500ea9a19da9c10f98d', href: r.source, target: "_blank", rel: "noopener noreferrer" }, "Original source")))))));
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
RuiRecipeDetail.style = ruiRecipeDetailCss();
|
|
33
|
+
|
|
34
|
+
exports.rui_recipe_detail = RuiRecipeDetail;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CJNMpFY7.js');
|
|
4
|
+
|
|
5
|
+
const ruiRecipeListCss = () => `:host{display:block}.rui-list{display:grid;grid-template-columns:repeat(auto-fill, minmax(220px, 1fr));gap:1.25rem}.rui-list__empty{margin:2rem 0;text-align:center;color:var(--rui-color-muted);font-size:1rem}`;
|
|
6
|
+
|
|
7
|
+
const RuiRecipeList = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.ruiSelectRecipe = index.createEvent(this, "ruiSelectRecipe");
|
|
11
|
+
this.ruiFavoriteToggle = index.createEvent(this, "ruiFavoriteToggle");
|
|
12
|
+
this.recipes = [];
|
|
13
|
+
this.favorites = [];
|
|
14
|
+
this.emptyMessage = 'No recipes found.';
|
|
15
|
+
}
|
|
16
|
+
recipesChanged() { }
|
|
17
|
+
favoritesChanged() { }
|
|
18
|
+
isFav(id) {
|
|
19
|
+
return this.favorites.includes(id);
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
if (!this.recipes || this.recipes.length === 0) {
|
|
23
|
+
return (index.h(index.Host, null, index.h("p", { class: "rui-list__empty" }, this.emptyMessage)));
|
|
24
|
+
}
|
|
25
|
+
return (index.h(index.Host, null, index.h("div", { class: "rui-list" }, this.recipes.map((r) => (index.h("rui-recipe-card", { recipe: r, isFavorite: this.isFav(r.id), onRuiCardClick: (e) => {
|
|
26
|
+
e.stopPropagation();
|
|
27
|
+
this.ruiSelectRecipe.emit(e.detail);
|
|
28
|
+
}, onRuiFavoriteToggle: (e) => {
|
|
29
|
+
e.stopPropagation();
|
|
30
|
+
this.ruiFavoriteToggle.emit(e.detail);
|
|
31
|
+
} }))))));
|
|
32
|
+
}
|
|
33
|
+
static get watchers() { return {
|
|
34
|
+
"recipes": [{
|
|
35
|
+
"recipesChanged": 0
|
|
36
|
+
}],
|
|
37
|
+
"favorites": [{
|
|
38
|
+
"favoritesChanged": 0
|
|
39
|
+
}]
|
|
40
|
+
}; }
|
|
41
|
+
};
|
|
42
|
+
RuiRecipeList.style = ruiRecipeListCss();
|
|
43
|
+
|
|
44
|
+
exports.rui_recipe_list = RuiRecipeList;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CJNMpFY7.js');
|
|
4
|
+
|
|
5
|
+
const ruiSearchBarCss = () => `:host{display:block}.rui-search{display:-ms-flexbox;display:flex;-ms-flex-align:stretch;align-items:stretch;gap:0.5rem;width:100%;max-width:640px}.rui-search__input{-ms-flex:1;flex:1;min-width:0;padding:0.6rem 0.85rem;font-size:1rem;font-family:var(--rui-font);border:1px solid var(--rui-color-border);border-radius:var(--rui-radius);outline:none;-webkit-transition:border-color 0.15s ease, -webkit-box-shadow 0.15s ease;transition:border-color 0.15s ease, -webkit-box-shadow 0.15s ease;transition:border-color 0.15s ease, box-shadow 0.15s ease;transition:border-color 0.15s ease, box-shadow 0.15s ease, -webkit-box-shadow 0.15s ease}.rui-search__input:focus{border-color:var(--rui-color-primary);-webkit-box-shadow:0 0 0 3px var(--rui-color-primary-soft);box-shadow:0 0 0 3px var(--rui-color-primary-soft)}.rui-search__btn{padding:0.6rem 1.1rem;font-size:0.95rem;font-weight:600;font-family:var(--rui-font);background:var(--rui-color-primary);color:#fff;border:none;border-radius:var(--rui-radius);cursor:pointer;-webkit-transition:background-color 0.15s ease;transition:background-color 0.15s ease}.rui-search__btn:hover{background:var(--rui-color-primary-hover)}`;
|
|
6
|
+
|
|
7
|
+
const RuiSearchBar = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.ruiSearchInput = index.createEvent(this, "ruiSearchInput");
|
|
11
|
+
this.ruiSearchSubmit = index.createEvent(this, "ruiSearchSubmit");
|
|
12
|
+
this.value = '';
|
|
13
|
+
this.placeholder = 'Search recipes...';
|
|
14
|
+
this.debounceMs = 300;
|
|
15
|
+
this.onInput = (e) => {
|
|
16
|
+
const target = e.target;
|
|
17
|
+
this.value = target.value;
|
|
18
|
+
clearTimeout(this.timer);
|
|
19
|
+
this.timer = setTimeout(() => {
|
|
20
|
+
this.ruiSearchInput.emit(this.value);
|
|
21
|
+
}, this.debounceMs);
|
|
22
|
+
};
|
|
23
|
+
this.onSubmit = (e) => {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
clearTimeout(this.timer);
|
|
26
|
+
this.ruiSearchSubmit.emit(this.value);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
disconnectedCallback() {
|
|
30
|
+
clearTimeout(this.timer);
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
return (index.h(index.Host, { key: '42c4c7437175136a28e810f73417147e4e609870' }, index.h("form", { key: '7b450f3e9fa9a3c63cda1169b3cecc5e2577ba96', class: "rui-search", onSubmit: this.onSubmit, role: "search" }, index.h("input", { key: '861e092e1c537cedcbe3bf6b1cd580d00fd8d24d', class: "rui-search__input", type: "search", value: this.value, placeholder: this.placeholder, onInput: this.onInput, "aria-label": this.placeholder }), index.h("button", { key: 'b6676deed915b99ecb22ca2c5d30851f51f04c74', class: "rui-search__btn", type: "submit", "aria-label": "Search" }, "Search"))));
|
|
34
|
+
}
|
|
35
|
+
get el() { return index.getElement(this); }
|
|
36
|
+
};
|
|
37
|
+
RuiSearchBar.style = ruiSearchBarCss();
|
|
38
|
+
|
|
39
|
+
exports.rui_search_bar = RuiSearchBar;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CJNMpFY7.js');
|
|
4
|
+
|
|
5
|
+
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
6
|
+
/*
|
|
7
|
+
Stencil Client Patch Browser v4.44.2 | MIT Licensed | https://stenciljs.com
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var patchBrowser = () => {
|
|
11
|
+
const importMeta = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('rui.cjs.js', document.baseURI).href));
|
|
12
|
+
const opts = {};
|
|
13
|
+
if (importMeta !== "") {
|
|
14
|
+
opts.resourcesUrl = new URL(".", importMeta).href;
|
|
15
|
+
}
|
|
16
|
+
return index.promiseResolve(opts);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
patchBrowser().then(async (options) => {
|
|
20
|
+
await index.globalScripts();
|
|
21
|
+
return index.bootstrapLazy([["rui-recipe-list.cjs",[[1,"rui-recipe-list",{"recipes":[16],"favorites":[16],"emptyMessage":[1,"empty-message"]},null,{"recipes":[{"recipesChanged":0}],"favorites":[{"favoritesChanged":0}]}]]],["rui-button.cjs",[[257,"rui-button",{"variant":[1],"disabled":[516],"loading":[4],"type":[1]}]]],["rui-filter-chips.cjs",[[1,"rui-filter-chips",{"categories":[16],"selected":[16]}]]],["rui-meal-planner.cjs",[[1,"rui-meal-planner",{"plan":[16],"days":[16]}]]],["rui-modal.cjs",[[257,"rui-modal",{"open":[1540],"modalTitle":[1,"modal-title"],"closeOnBackdrop":[4,"close-on-backdrop"]},null,{"open":[{"openChanged":0}]}]]],["rui-recipe-detail.cjs",[[257,"rui-recipe-detail",{"recipe":[16],"isFavorite":[516,"is-favorite"]}]]],["rui-search-bar.cjs",[[1,"rui-search-bar",{"value":[1025],"placeholder":[1],"debounceMs":[2,"debounce-ms"]}]]],["rui-recipe-card.cjs",[[257,"rui-recipe-card",{"recipe":[16],"isFavorite":[516,"is-favorite"]}]]]], options);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
exports.setNonce = index.setNonce;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entries": [
|
|
3
|
+
"components/rui-filter-chips/rui-filter-chips.js",
|
|
4
|
+
"components/rui-recipe-card/rui-recipe-card.js",
|
|
5
|
+
"components/rui-meal-planner/rui-meal-planner.js",
|
|
6
|
+
"components/rui-recipe-detail/rui-recipe-detail.js",
|
|
7
|
+
"components/rui-button/rui-button.js",
|
|
8
|
+
"components/rui-modal/rui-modal.js",
|
|
9
|
+
"components/rui-search-bar/rui-search-bar.js",
|
|
10
|
+
"components/rui-recipe-list/rui-recipe-list.js"
|
|
11
|
+
],
|
|
12
|
+
"mixins": [],
|
|
13
|
+
"compiler": {
|
|
14
|
+
"name": "@stencil/core",
|
|
15
|
+
"version": "4.44.2",
|
|
16
|
+
"typescriptVersion": "5.8.3"
|
|
17
|
+
},
|
|
18
|
+
"collections": [],
|
|
19
|
+
"bundles": []
|
|
20
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './rui-button/rui-button';
|
|
2
|
+
export * from './rui-modal/rui-modal';
|
|
3
|
+
export * from './rui-search-bar/rui-search-bar';
|
|
4
|
+
export * from './rui-filter-chips/rui-filter-chips';
|
|
5
|
+
export * from './rui-recipe-card/rui-recipe-card';
|
|
6
|
+
export * from './rui-recipe-list/rui-recipe-list';
|
|
7
|
+
export * from './rui-recipe-detail/rui-recipe-detail';
|
|
8
|
+
export * from './rui-meal-planner/rui-meal-planner';
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.rui-btn {
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: 0.5em;
|
|
9
|
+
font-family: var(--rui-font);
|
|
10
|
+
font-size: 0.95rem;
|
|
11
|
+
font-weight: 600;
|
|
12
|
+
padding: 0.55rem 1.1rem;
|
|
13
|
+
border-radius: var(--rui-radius);
|
|
14
|
+
border: 1px solid transparent;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
|
|
17
|
+
line-height: 1.2;
|
|
18
|
+
user-select: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.rui-btn:disabled {
|
|
22
|
+
opacity: 0.6;
|
|
23
|
+
cursor: not-allowed;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.rui-btn--primary {
|
|
27
|
+
background-color: var(--rui-color-primary);
|
|
28
|
+
color: #fff;
|
|
29
|
+
}
|
|
30
|
+
.rui-btn--primary:hover:not(:disabled) {
|
|
31
|
+
background-color: var(--rui-color-primary-hover);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.rui-btn--secondary {
|
|
35
|
+
background-color: var(--rui-color-secondary);
|
|
36
|
+
color: #fff;
|
|
37
|
+
}
|
|
38
|
+
.rui-btn--secondary:hover:not(:disabled) {
|
|
39
|
+
background-color: #14538a;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.rui-btn--danger {
|
|
43
|
+
background-color: var(--rui-color-danger);
|
|
44
|
+
color: #fff;
|
|
45
|
+
}
|
|
46
|
+
.rui-btn--danger:hover:not(:disabled) {
|
|
47
|
+
background-color: #a52323;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.rui-btn--ghost {
|
|
51
|
+
background-color: transparent;
|
|
52
|
+
color: var(--rui-color-text);
|
|
53
|
+
border-color: var(--rui-color-border);
|
|
54
|
+
}
|
|
55
|
+
.rui-btn--ghost:hover:not(:disabled) {
|
|
56
|
+
background-color: var(--rui-color-bg-alt);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.rui-btn__spinner {
|
|
60
|
+
width: 1em;
|
|
61
|
+
height: 1em;
|
|
62
|
+
border: 2px solid currentColor;
|
|
63
|
+
border-top-color: transparent;
|
|
64
|
+
border-radius: 50%;
|
|
65
|
+
animation: rui-spin 0.7s linear infinite;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@keyframes rui-spin {
|
|
69
|
+
to {
|
|
70
|
+
transform: rotate(360deg);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
export class RuiButton {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.variant = 'primary';
|
|
5
|
+
this.disabled = false;
|
|
6
|
+
this.loading = false;
|
|
7
|
+
this.type = 'button';
|
|
8
|
+
this.handleClick = (e) => {
|
|
9
|
+
if (this.disabled || this.loading) {
|
|
10
|
+
e.preventDefault();
|
|
11
|
+
e.stopPropagation();
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
this.ruiClick.emit(e);
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
render() {
|
|
18
|
+
return (h(Host, { key: '0ab23154d1836dfd9d0a691705a0e5cc6f91dae3' }, h("button", { key: '986e600d39ed91200857739179c2e105207c0ebc', class: `rui-btn rui-btn--${this.variant}`, type: this.type, disabled: this.disabled || this.loading, onClick: this.handleClick, "aria-busy": this.loading ? 'true' : 'false' }, this.loading && h("span", { key: '406a34032a25dd05f986e53075e2c7cf45727c85', class: "rui-btn__spinner", "aria-hidden": "true" }), h("span", { key: '7f9ae69c7824227e0b56f2abffb10b95c7a8b92d', class: "rui-btn__label" }, h("slot", { key: '1498be76d79baf033b9913f5f61a5b64192b341e' })))));
|
|
19
|
+
}
|
|
20
|
+
static get is() { return "rui-button"; }
|
|
21
|
+
static get encapsulation() { return "shadow"; }
|
|
22
|
+
static get originalStyleUrls() {
|
|
23
|
+
return {
|
|
24
|
+
"$": ["rui-button.css"]
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
static get styleUrls() {
|
|
28
|
+
return {
|
|
29
|
+
"$": ["rui-button.css"]
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
static get properties() {
|
|
33
|
+
return {
|
|
34
|
+
"variant": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"mutable": false,
|
|
37
|
+
"complexType": {
|
|
38
|
+
"original": "'primary' | 'secondary' | 'danger' | 'ghost'",
|
|
39
|
+
"resolved": "\"danger\" | \"ghost\" | \"primary\" | \"secondary\"",
|
|
40
|
+
"references": {}
|
|
41
|
+
},
|
|
42
|
+
"required": false,
|
|
43
|
+
"optional": false,
|
|
44
|
+
"docs": {
|
|
45
|
+
"tags": [],
|
|
46
|
+
"text": "Button variant."
|
|
47
|
+
},
|
|
48
|
+
"getter": false,
|
|
49
|
+
"setter": false,
|
|
50
|
+
"reflect": false,
|
|
51
|
+
"attribute": "variant",
|
|
52
|
+
"defaultValue": "'primary'"
|
|
53
|
+
},
|
|
54
|
+
"disabled": {
|
|
55
|
+
"type": "boolean",
|
|
56
|
+
"mutable": false,
|
|
57
|
+
"complexType": {
|
|
58
|
+
"original": "boolean",
|
|
59
|
+
"resolved": "boolean",
|
|
60
|
+
"references": {}
|
|
61
|
+
},
|
|
62
|
+
"required": false,
|
|
63
|
+
"optional": false,
|
|
64
|
+
"docs": {
|
|
65
|
+
"tags": [],
|
|
66
|
+
"text": "Disabled state."
|
|
67
|
+
},
|
|
68
|
+
"getter": false,
|
|
69
|
+
"setter": false,
|
|
70
|
+
"reflect": true,
|
|
71
|
+
"attribute": "disabled",
|
|
72
|
+
"defaultValue": "false"
|
|
73
|
+
},
|
|
74
|
+
"loading": {
|
|
75
|
+
"type": "boolean",
|
|
76
|
+
"mutable": false,
|
|
77
|
+
"complexType": {
|
|
78
|
+
"original": "boolean",
|
|
79
|
+
"resolved": "boolean",
|
|
80
|
+
"references": {}
|
|
81
|
+
},
|
|
82
|
+
"required": false,
|
|
83
|
+
"optional": false,
|
|
84
|
+
"docs": {
|
|
85
|
+
"tags": [],
|
|
86
|
+
"text": "Loading state (shows spinner, disables interaction)."
|
|
87
|
+
},
|
|
88
|
+
"getter": false,
|
|
89
|
+
"setter": false,
|
|
90
|
+
"reflect": false,
|
|
91
|
+
"attribute": "loading",
|
|
92
|
+
"defaultValue": "false"
|
|
93
|
+
},
|
|
94
|
+
"type": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"mutable": false,
|
|
97
|
+
"complexType": {
|
|
98
|
+
"original": "'button' | 'submit' | 'reset'",
|
|
99
|
+
"resolved": "\"button\" | \"reset\" | \"submit\"",
|
|
100
|
+
"references": {}
|
|
101
|
+
},
|
|
102
|
+
"required": false,
|
|
103
|
+
"optional": false,
|
|
104
|
+
"docs": {
|
|
105
|
+
"tags": [],
|
|
106
|
+
"text": "Native button type."
|
|
107
|
+
},
|
|
108
|
+
"getter": false,
|
|
109
|
+
"setter": false,
|
|
110
|
+
"reflect": false,
|
|
111
|
+
"attribute": "type",
|
|
112
|
+
"defaultValue": "'button'"
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
static get events() {
|
|
117
|
+
return [{
|
|
118
|
+
"method": "ruiClick",
|
|
119
|
+
"name": "ruiClick",
|
|
120
|
+
"bubbles": true,
|
|
121
|
+
"cancelable": true,
|
|
122
|
+
"composed": true,
|
|
123
|
+
"docs": {
|
|
124
|
+
"tags": [],
|
|
125
|
+
"text": "Emitted on click (bubbles/composed for cross-boundary listening)."
|
|
126
|
+
},
|
|
127
|
+
"complexType": {
|
|
128
|
+
"original": "MouseEvent",
|
|
129
|
+
"resolved": "MouseEvent",
|
|
130
|
+
"references": {
|
|
131
|
+
"MouseEvent": {
|
|
132
|
+
"location": "global",
|
|
133
|
+
"id": "global::MouseEvent"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}];
|
|
138
|
+
}
|
|
139
|
+
static get elementRef() { return "el"; }
|
|
140
|
+
}
|