@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,160 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
export class RuiRecipeList {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.recipes = [];
|
|
5
|
+
this.favorites = [];
|
|
6
|
+
this.emptyMessage = 'No recipes found.';
|
|
7
|
+
}
|
|
8
|
+
recipesChanged() { }
|
|
9
|
+
favoritesChanged() { }
|
|
10
|
+
isFav(id) {
|
|
11
|
+
return this.favorites.includes(id);
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
if (!this.recipes || this.recipes.length === 0) {
|
|
15
|
+
return (h(Host, null, h("p", { class: "rui-list__empty" }, this.emptyMessage)));
|
|
16
|
+
}
|
|
17
|
+
return (h(Host, null, h("div", { class: "rui-list" }, this.recipes.map((r) => (h("rui-recipe-card", { recipe: r, isFavorite: this.isFav(r.id), onRuiCardClick: (e) => {
|
|
18
|
+
e.stopPropagation();
|
|
19
|
+
this.ruiSelectRecipe.emit(e.detail);
|
|
20
|
+
}, onRuiFavoriteToggle: (e) => {
|
|
21
|
+
e.stopPropagation();
|
|
22
|
+
this.ruiFavoriteToggle.emit(e.detail);
|
|
23
|
+
} }))))));
|
|
24
|
+
}
|
|
25
|
+
static get is() { return "rui-recipe-list"; }
|
|
26
|
+
static get encapsulation() { return "shadow"; }
|
|
27
|
+
static get originalStyleUrls() {
|
|
28
|
+
return {
|
|
29
|
+
"$": ["rui-recipe-list.css"]
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
static get styleUrls() {
|
|
33
|
+
return {
|
|
34
|
+
"$": ["rui-recipe-list.css"]
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
static get properties() {
|
|
38
|
+
return {
|
|
39
|
+
"recipes": {
|
|
40
|
+
"type": "unknown",
|
|
41
|
+
"mutable": false,
|
|
42
|
+
"complexType": {
|
|
43
|
+
"original": "RecipeSummary[]",
|
|
44
|
+
"resolved": "RecipeSummary[]",
|
|
45
|
+
"references": {
|
|
46
|
+
"RecipeSummary": {
|
|
47
|
+
"location": "import",
|
|
48
|
+
"path": "../rui-recipe-card/rui-recipe-card",
|
|
49
|
+
"id": "src/components/rui-recipe-card/rui-recipe-card.tsx::RecipeSummary",
|
|
50
|
+
"referenceLocation": "RecipeSummary"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"required": false,
|
|
55
|
+
"optional": false,
|
|
56
|
+
"docs": {
|
|
57
|
+
"tags": [],
|
|
58
|
+
"text": "Array of recipe summaries to display."
|
|
59
|
+
},
|
|
60
|
+
"getter": false,
|
|
61
|
+
"setter": false,
|
|
62
|
+
"defaultValue": "[]"
|
|
63
|
+
},
|
|
64
|
+
"favorites": {
|
|
65
|
+
"type": "unknown",
|
|
66
|
+
"mutable": false,
|
|
67
|
+
"complexType": {
|
|
68
|
+
"original": "string[]",
|
|
69
|
+
"resolved": "string[]",
|
|
70
|
+
"references": {}
|
|
71
|
+
},
|
|
72
|
+
"required": false,
|
|
73
|
+
"optional": false,
|
|
74
|
+
"docs": {
|
|
75
|
+
"tags": [],
|
|
76
|
+
"text": "Array of favorite recipe ids (used to mark cards as favorite)."
|
|
77
|
+
},
|
|
78
|
+
"getter": false,
|
|
79
|
+
"setter": false,
|
|
80
|
+
"defaultValue": "[]"
|
|
81
|
+
},
|
|
82
|
+
"emptyMessage": {
|
|
83
|
+
"type": "string",
|
|
84
|
+
"mutable": false,
|
|
85
|
+
"complexType": {
|
|
86
|
+
"original": "string",
|
|
87
|
+
"resolved": "string",
|
|
88
|
+
"references": {}
|
|
89
|
+
},
|
|
90
|
+
"required": false,
|
|
91
|
+
"optional": false,
|
|
92
|
+
"docs": {
|
|
93
|
+
"tags": [],
|
|
94
|
+
"text": "Empty-state message."
|
|
95
|
+
},
|
|
96
|
+
"getter": false,
|
|
97
|
+
"setter": false,
|
|
98
|
+
"reflect": false,
|
|
99
|
+
"attribute": "empty-message",
|
|
100
|
+
"defaultValue": "'No recipes found.'"
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
static get events() {
|
|
105
|
+
return [{
|
|
106
|
+
"method": "ruiSelectRecipe",
|
|
107
|
+
"name": "ruiSelectRecipe",
|
|
108
|
+
"bubbles": true,
|
|
109
|
+
"cancelable": true,
|
|
110
|
+
"composed": true,
|
|
111
|
+
"docs": {
|
|
112
|
+
"tags": [],
|
|
113
|
+
"text": "Emitted when a card is clicked. detail: RecipeSummary."
|
|
114
|
+
},
|
|
115
|
+
"complexType": {
|
|
116
|
+
"original": "RecipeSummary",
|
|
117
|
+
"resolved": "RecipeSummary",
|
|
118
|
+
"references": {
|
|
119
|
+
"RecipeSummary": {
|
|
120
|
+
"location": "import",
|
|
121
|
+
"path": "../rui-recipe-card/rui-recipe-card",
|
|
122
|
+
"id": "src/components/rui-recipe-card/rui-recipe-card.tsx::RecipeSummary",
|
|
123
|
+
"referenceLocation": "RecipeSummary"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}, {
|
|
128
|
+
"method": "ruiFavoriteToggle",
|
|
129
|
+
"name": "ruiFavoriteToggle",
|
|
130
|
+
"bubbles": true,
|
|
131
|
+
"cancelable": true,
|
|
132
|
+
"composed": true,
|
|
133
|
+
"docs": {
|
|
134
|
+
"tags": [],
|
|
135
|
+
"text": "Emitted when a favorite is toggled from a card. detail: { recipe, isFavorite }."
|
|
136
|
+
},
|
|
137
|
+
"complexType": {
|
|
138
|
+
"original": "{ recipe: RecipeSummary; isFavorite: boolean }",
|
|
139
|
+
"resolved": "{ recipe: RecipeSummary; isFavorite: boolean; }",
|
|
140
|
+
"references": {
|
|
141
|
+
"RecipeSummary": {
|
|
142
|
+
"location": "import",
|
|
143
|
+
"path": "../rui-recipe-card/rui-recipe-card",
|
|
144
|
+
"id": "src/components/rui-recipe-card/rui-recipe-card.tsx::RecipeSummary",
|
|
145
|
+
"referenceLocation": "RecipeSummary"
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}];
|
|
150
|
+
}
|
|
151
|
+
static get watchers() {
|
|
152
|
+
return [{
|
|
153
|
+
"propName": "recipes",
|
|
154
|
+
"methodName": "recipesChanged"
|
|
155
|
+
}, {
|
|
156
|
+
"propName": "favorites",
|
|
157
|
+
"methodName": "favoritesChanged"
|
|
158
|
+
}];
|
|
159
|
+
}
|
|
160
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.rui-search {
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: stretch;
|
|
8
|
+
gap: 0.5rem;
|
|
9
|
+
width: 100%;
|
|
10
|
+
max-width: 640px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
.rui-search__input {
|
|
16
|
+
flex: 1;
|
|
17
|
+
min-width: 0;
|
|
18
|
+
padding: 0.6rem 0.85rem;
|
|
19
|
+
font-size: 1rem;
|
|
20
|
+
font-family: var(--rui-font);
|
|
21
|
+
border: 1px solid var(--rui-color-border);
|
|
22
|
+
border-radius: var(--rui-radius);
|
|
23
|
+
outline: none;
|
|
24
|
+
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
|
25
|
+
}
|
|
26
|
+
.rui-search__input:focus {
|
|
27
|
+
border-color: var(--rui-color-primary);
|
|
28
|
+
box-shadow: 0 0 0 3px var(--rui-color-primary-soft);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.rui-search__btn {
|
|
32
|
+
padding: 0.6rem 1.1rem;
|
|
33
|
+
font-size: 0.95rem;
|
|
34
|
+
font-weight: 600;
|
|
35
|
+
font-family: var(--rui-font);
|
|
36
|
+
background: var(--rui-color-primary);
|
|
37
|
+
color: #fff;
|
|
38
|
+
border: none;
|
|
39
|
+
border-radius: var(--rui-radius);
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
transition: background-color 0.15s ease;
|
|
42
|
+
}
|
|
43
|
+
.rui-search__btn:hover {
|
|
44
|
+
background: var(--rui-color-primary-hover);
|
|
45
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
export class RuiSearchBar {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.value = '';
|
|
5
|
+
this.placeholder = 'Search recipes...';
|
|
6
|
+
this.debounceMs = 300;
|
|
7
|
+
this.onInput = (e) => {
|
|
8
|
+
const target = e.target;
|
|
9
|
+
this.value = target.value;
|
|
10
|
+
clearTimeout(this.timer);
|
|
11
|
+
this.timer = setTimeout(() => {
|
|
12
|
+
this.ruiSearchInput.emit(this.value);
|
|
13
|
+
}, this.debounceMs);
|
|
14
|
+
};
|
|
15
|
+
this.onSubmit = (e) => {
|
|
16
|
+
e.preventDefault();
|
|
17
|
+
clearTimeout(this.timer);
|
|
18
|
+
this.ruiSearchSubmit.emit(this.value);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
disconnectedCallback() {
|
|
22
|
+
clearTimeout(this.timer);
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
25
|
+
return (h(Host, { key: '42c4c7437175136a28e810f73417147e4e609870' }, h("form", { key: '7b450f3e9fa9a3c63cda1169b3cecc5e2577ba96', class: "rui-search", onSubmit: this.onSubmit, role: "search" }, h("input", { key: '861e092e1c537cedcbe3bf6b1cd580d00fd8d24d', class: "rui-search__input", type: "search", value: this.value, placeholder: this.placeholder, onInput: this.onInput, "aria-label": this.placeholder }), h("button", { key: 'b6676deed915b99ecb22ca2c5d30851f51f04c74', class: "rui-search__btn", type: "submit", "aria-label": "Search" }, "Search"))));
|
|
26
|
+
}
|
|
27
|
+
static get is() { return "rui-search-bar"; }
|
|
28
|
+
static get encapsulation() { return "shadow"; }
|
|
29
|
+
static get originalStyleUrls() {
|
|
30
|
+
return {
|
|
31
|
+
"$": ["rui-search-bar.css"]
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
static get styleUrls() {
|
|
35
|
+
return {
|
|
36
|
+
"$": ["rui-search-bar.css"]
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
static get properties() {
|
|
40
|
+
return {
|
|
41
|
+
"value": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"mutable": true,
|
|
44
|
+
"complexType": {
|
|
45
|
+
"original": "string",
|
|
46
|
+
"resolved": "string",
|
|
47
|
+
"references": {}
|
|
48
|
+
},
|
|
49
|
+
"required": false,
|
|
50
|
+
"optional": false,
|
|
51
|
+
"docs": {
|
|
52
|
+
"tags": [],
|
|
53
|
+
"text": "Current input value."
|
|
54
|
+
},
|
|
55
|
+
"getter": false,
|
|
56
|
+
"setter": false,
|
|
57
|
+
"reflect": false,
|
|
58
|
+
"attribute": "value",
|
|
59
|
+
"defaultValue": "''"
|
|
60
|
+
},
|
|
61
|
+
"placeholder": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"mutable": false,
|
|
64
|
+
"complexType": {
|
|
65
|
+
"original": "string",
|
|
66
|
+
"resolved": "string",
|
|
67
|
+
"references": {}
|
|
68
|
+
},
|
|
69
|
+
"required": false,
|
|
70
|
+
"optional": false,
|
|
71
|
+
"docs": {
|
|
72
|
+
"tags": [],
|
|
73
|
+
"text": "Placeholder text."
|
|
74
|
+
},
|
|
75
|
+
"getter": false,
|
|
76
|
+
"setter": false,
|
|
77
|
+
"reflect": false,
|
|
78
|
+
"attribute": "placeholder",
|
|
79
|
+
"defaultValue": "'Search recipes...'"
|
|
80
|
+
},
|
|
81
|
+
"debounceMs": {
|
|
82
|
+
"type": "number",
|
|
83
|
+
"mutable": false,
|
|
84
|
+
"complexType": {
|
|
85
|
+
"original": "number",
|
|
86
|
+
"resolved": "number",
|
|
87
|
+
"references": {}
|
|
88
|
+
},
|
|
89
|
+
"required": false,
|
|
90
|
+
"optional": false,
|
|
91
|
+
"docs": {
|
|
92
|
+
"tags": [],
|
|
93
|
+
"text": "Debounce delay in ms for ruiSearchInput."
|
|
94
|
+
},
|
|
95
|
+
"getter": false,
|
|
96
|
+
"setter": false,
|
|
97
|
+
"reflect": false,
|
|
98
|
+
"attribute": "debounce-ms",
|
|
99
|
+
"defaultValue": "300"
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
static get events() {
|
|
104
|
+
return [{
|
|
105
|
+
"method": "ruiSearchInput",
|
|
106
|
+
"name": "ruiSearchInput",
|
|
107
|
+
"bubbles": true,
|
|
108
|
+
"cancelable": true,
|
|
109
|
+
"composed": true,
|
|
110
|
+
"docs": {
|
|
111
|
+
"tags": [],
|
|
112
|
+
"text": "Emitted (debounced) on input. detail: string."
|
|
113
|
+
},
|
|
114
|
+
"complexType": {
|
|
115
|
+
"original": "string",
|
|
116
|
+
"resolved": "string",
|
|
117
|
+
"references": {}
|
|
118
|
+
}
|
|
119
|
+
}, {
|
|
120
|
+
"method": "ruiSearchSubmit",
|
|
121
|
+
"name": "ruiSearchSubmit",
|
|
122
|
+
"bubbles": true,
|
|
123
|
+
"cancelable": true,
|
|
124
|
+
"composed": true,
|
|
125
|
+
"docs": {
|
|
126
|
+
"tags": [],
|
|
127
|
+
"text": "Emitted on submit (Enter or button). detail: string."
|
|
128
|
+
},
|
|
129
|
+
"complexType": {
|
|
130
|
+
"original": "string",
|
|
131
|
+
"resolved": "string",
|
|
132
|
+
"references": {}
|
|
133
|
+
}
|
|
134
|
+
}];
|
|
135
|
+
}
|
|
136
|
+
static get elementRef() { return "el"; }
|
|
137
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the base path to where the assets can be found. Use "setAssetPath(path)"
|
|
3
|
+
* if the path needs to be customized.
|
|
4
|
+
*/
|
|
5
|
+
export declare const getAssetPath: (path: string) => string;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Used to manually set the base path where assets can be found.
|
|
9
|
+
* If the script is used as "module", it's recommended to use "import.meta.url",
|
|
10
|
+
* such as "setAssetPath(import.meta.url)". Other options include
|
|
11
|
+
* "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
|
|
12
|
+
* dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
|
|
13
|
+
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
14
|
+
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
15
|
+
* will have to ensure the static assets are copied to its build directory.
|
|
16
|
+
*/
|
|
17
|
+
export declare const setAssetPath: (path: string) => void;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Used to specify a nonce value that corresponds with an application's CSP.
|
|
21
|
+
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
22
|
+
* Alternatively, the nonce value can be set on a meta tag in the DOM head
|
|
23
|
+
* (<meta name="csp-nonce" content="{ nonce value here }" />) which
|
|
24
|
+
* will result in the same behavior.
|
|
25
|
+
*/
|
|
26
|
+
export declare const setNonce: (nonce: string) => void
|
|
27
|
+
|
|
28
|
+
export interface SetPlatformOptions {
|
|
29
|
+
raf?: (c: FrameRequestCallback) => number;
|
|
30
|
+
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
31
|
+
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
32
|
+
}
|
|
33
|
+
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
34
|
+
|
|
35
|
+
export * from '../types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{getAssetPath,render,setAssetPath,setNonce,setPlatformOptions}from"@stencil/core/internal/client";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface RuiButton extends Components.RuiButton, HTMLElement {}
|
|
4
|
+
export const RuiButton: {
|
|
5
|
+
prototype: RuiButton;
|
|
6
|
+
new (): RuiButton;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement as r,HTMLElement as e,createEvent as o,h as t,Host as i,transformTag as n}from"@stencil/core/internal/client";const a=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.__attachShadow(),this.ruiClick=o(this,"ruiClick",7),this.variant="primary",this.disabled=!1,this.loading=!1,this.type="button",this.handleClick=r=>{if(this.disabled||this.loading)return r.preventDefault(),void r.stopPropagation();this.ruiClick.emit(r)}}render(){return t(i,{key:"0ab23154d1836dfd9d0a691705a0e5cc6f91dae3"},t("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&&t("span",{key:"406a34032a25dd05f986e53075e2c7cf45727c85",class:"rui-btn__spinner","aria-hidden":"true"}),t("span",{key:"7f9ae69c7824227e0b56f2abffb10b95c7a8b92d",class:"rui-btn__label"},t("slot",{key:"1498be76d79baf033b9913f5f61a5b64192b341e"}))))}get el(){return this}static get style(){return":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)}}"}},[257,"rui-button",{variant:[1],disabled:[516],loading:[4],type:[1]}]),s=a,c=function(){"undefined"!=typeof customElements&&["rui-button"].forEach((r=>{"rui-button"===r&&(customElements.get(n(r))||customElements.define(n(r),a))}))};export{s as RuiButton,c as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface RuiFilterChips extends Components.RuiFilterChips, HTMLElement {}
|
|
4
|
+
export const RuiFilterChips: {
|
|
5
|
+
prototype: RuiFilterChips;
|
|
6
|
+
new (): RuiFilterChips;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement as r,HTMLElement as e,createEvent as i,h as o,Host as s,transformTag as t}from"@stencil/core/internal/client";const c=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.__attachShadow(),this.ruiFilterChange=i(this,"ruiFilterChange",7),this.categories=[],this.selected=[],this.toggle=r=>{const e=this.selected.includes(r)?this.selected.filter((e=>e!==r)):[...this.selected,r];this.selected=[...e],this.ruiFilterChange.emit(this.selected)}}render(){return o(s,{key:"628063d481c07e5c80312a9a395ba7ad0ab859dc"},o("div",{key:"d3aa0f87f0e6b6bd55960dc91769f56b70e4ef67",class:"rui-chips",role:"group","aria-label":"Filters"},this.categories.map((r=>{const e=this.selected.includes(r.value);return o("button",{type:"button",class:"rui-chip "+(e?"rui-chip--active":""),"aria-pressed":e?"true":"false",onClick:()=>this.toggle(r.value)},r.label)}))))}static get style(){return":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}"}},[1,"rui-filter-chips",{categories:[16],selected:[16]}]),a=c,l=function(){"undefined"!=typeof customElements&&["rui-filter-chips"].forEach((r=>{"rui-filter-chips"===r&&(customElements.get(t(r))||customElements.define(t(r),c))}))};export{a as RuiFilterChips,l as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface RuiMealPlanner extends Components.RuiMealPlanner, HTMLElement {}
|
|
4
|
+
export const RuiMealPlanner: {
|
|
5
|
+
prototype: RuiMealPlanner;
|
|
6
|
+
new (): RuiMealPlanner;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement as r,HTMLElement as e,createEvent as i,h as a,Host as o,transformTag as n}from"@stencil/core/internal/client";const l=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.__attachShadow(),this.ruiAssignMeal=i(this,"ruiAssignMeal",7),this.ruiRemoveMeal=i(this,"ruiRemoveMeal",7),this.ruiClearDay=i(this,"ruiClearDay",7),this.ruiSelectMeal=i(this,"ruiSelectMeal",7),this.plan={},this.days=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],this.assign=r=>this.ruiAssignMeal.emit({day:r}),this.remove=(r,e)=>this.ruiRemoveMeal.emit({day:r,recipe:e}),this.clear=r=>this.ruiClearDay.emit({day:r}),this.selectMeal=(r,e)=>this.ruiSelectMeal.emit({day:r,recipe:e})}render(){return a(o,{key:"de032b8a71504aa8c7ce9ae269c299974c03e160"},a("div",{key:"178b5fc0a98d94cc2bb9666d7edcd74ca605df98",class:"rui-planner"},this.days.map((r=>{const e=this.plan[r];return a("div",{class:"rui-planner__day"},a("div",{class:"rui-planner__day-head"},a("h4",null,r)),e&&e.recipe?a("div",{class:"rui-planner__meal rui-planner__meal--clickable",onClick:()=>this.selectMeal(r,e.recipe),role:"button",tabindex:0,onKeyDown:i=>{"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),this.selectMeal(r,e.recipe))},title:"View recipe ingredients"},e.recipe.image&&a("img",{src:e.recipe.image,alt:e.recipe.name}),a("div",{class:"rui-planner__meal-info"},a("span",{class:"rui-planner__meal-name"},e.recipe.name),e.recipe.category&&a("span",{class:"rui-planner__meal-cat"},e.recipe.category)),a("div",{class:"rui-planner__meal-actions"},a("button",{type:"button",class:"rui-planner__view",onClick:i=>{i.stopPropagation(),this.selectMeal(r,e.recipe)}},"View"),a("button",{type:"button",onClick:i=>{i.stopPropagation(),this.remove(r,e.recipe)}},"Remove"),a("button",{type:"button",class:"rui-planner__clear",onClick:e=>{e.stopPropagation(),this.clear(r)}},"Clear"))):a("div",{class:"rui-planner__empty"},a("span",null,"No meal planned"),a("button",{type:"button",onClick:()=>this.assign(r)},"+ Assign recipe")))}))))}static get style(){return":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)}"}},[1,"rui-meal-planner",{plan:[16],days:[16]}]),t=l,s=function(){"undefined"!=typeof customElements&&["rui-meal-planner"].forEach((r=>{"rui-meal-planner"===r&&(customElements.get(n(r))||customElements.define(n(r),l))}))};export{t as RuiMealPlanner,s as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface RuiModal extends Components.RuiModal, HTMLElement {}
|
|
4
|
+
export const RuiModal: {
|
|
5
|
+
prototype: RuiModal;
|
|
6
|
+
new (): RuiModal;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as o,createEvent as r,h as a,Host as i,transformTag as d}from"@stencil/core/internal/client";const t=e(class extends o{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.ruiClose=r(this,"ruiClose",7),this.open=!1,this.modalTitle="",this.closeOnBackdrop=!0,this.handleBackdrop=e=>{this.closeOnBackdrop&&e.target===e.currentTarget&&this.requestClose()},this.handleKey=e=>{"Escape"===e.key&&this.open&&this.requestClose()}}requestClose(){this.ruiClose.emit()}openChanged(e){e?document.addEventListener("keydown",this.handleKey):document.removeEventListener("keydown",this.handleKey)}disconnectedCallback(){document.removeEventListener("keydown",this.handleKey)}render(){return a(i,{key:"9bbdb18b18e8c09ec5e8edfd886a44cb4d86cb0b"},this.open&&a("div",{key:"b772df0ce6a04949c1ac0d44449545a35d877adc",class:"rui-modal__backdrop",onClick:this.handleBackdrop},a("div",{key:"4c22489ccd86da08b1a007757b1c42da4023067e",class:"rui-modal__dialog",role:"dialog","aria-modal":"true","aria-label":this.modalTitle},a("header",{key:"5dd1ceca76410c18acbc8b12fc7cb9ca8c6dff27",class:"rui-modal__header"},a("h3",{key:"c131c313193f0ba0fd847426dff141f3c1adc143",class:"rui-modal__title"},this.modalTitle),a("button",{key:"c280b26ea160e5c765b80eb9054dd5ff186e7646",class:"rui-modal__close",type:"button","aria-label":"Close",onClick:()=>this.requestClose()},"×")),a("div",{key:"f4c32d83f83e5e452dc10a368f5f620e3557eedf",class:"rui-modal__body"},a("slot",{key:"a278a93efe24076204c4fce7b0cf44be22df4dc9"})),a("footer",{key:"31bed0da07b6310cdf4684c24f505ede0a220416",class:"rui-modal__footer"},a("slot",{key:"7a5806e2edf0d6aaef25b119c1d2ba8f3684a1f7",name:"footer"})))))}static get watchers(){return{open:[{openChanged:0}]}}static get style(){return":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}"}},[257,"rui-modal",{open:[1540],modalTitle:[1,"modal-title"],closeOnBackdrop:[4,"close-on-backdrop"]},void 0,{open:[{openChanged:0}]}]),l=t,s=function(){"undefined"!=typeof customElements&&["rui-modal"].forEach((e=>{"rui-modal"===e&&(customElements.get(d(e))||customElements.define(d(e),t))}))};export{l as RuiModal,s as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface RuiRecipeCard extends Components.RuiRecipeCard, HTMLElement {}
|
|
4
|
+
export const RuiRecipeCard: {
|
|
5
|
+
prototype: RuiRecipeCard;
|
|
6
|
+
new (): RuiRecipeCard;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{R as r,d as o}from"./rui-recipe-card2.js";const s=r,a=o;export{s as RuiRecipeCard,a as defineCustomElement}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as r,createEvent as a,h as i,Host as s,transformTag as t}from"@stencil/core/internal/client";const o=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.ruiCardClick=a(this,"ruiCardClick",7),this.ruiFavoriteToggle=a(this,"ruiFavoriteToggle",7),this.isFavorite=!1,this.onCardClick=()=>{this.ruiCardClick.emit(this.recipe)},this.onFavClick=e=>{e.stopPropagation(),this.isFavorite=!this.isFavorite,this.ruiFavoriteToggle.emit({recipe:this.recipe,isFavorite:this.isFavorite})}}render(){const e=this.recipe;return i(s,{key:"8ba2647d2fed8b0539287633a5591892109596fb"},i("article",{key:"8a58a35d34d08d0897bc7c68b82773bd361e2dcf",class:"rui-card",onClick:this.onCardClick},i("div",{key:"04b5aa4b9563847aa116bbf477fabd806092f90a",class:"rui-card__media"},e.image?i("img",{src:e.image,alt:e.name,loading:"lazy"}):i("div",{class:"rui-card__placeholder","aria-hidden":"true"},i("span",null,"No image")),i("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?"♥":"♡")),i("div",{key:"2bd65d44934ee52a98cc2be459b770a8fe18dd0f",class:"rui-card__body"},i("h3",{key:"55bd4f5faf4ed06696c6ed22f828d811afa605a5",class:"rui-card__title"},e.name),(e.category||e.area)&&i("p",{key:"5184ee876bdfb90cdef9bc7f529be504ed18bf45",class:"rui-card__meta"},[e.category,e.area].filter(Boolean).join(" · "))),i("div",{key:"5e3fc6c1cc4559bd6260ebf99039908f2e9c82e2",class:"rui-card__footer"},i("slot",{key:"2567811b6ca78e06df4e2c51714dc1210fa65f00"}))))}static get style(){return":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}"}},[257,"rui-recipe-card",{recipe:[16],isFavorite:[516,"is-favorite"]}]);function d(){"undefined"!=typeof customElements&&["rui-recipe-card"].forEach((e=>{"rui-recipe-card"===e&&(customElements.get(t(e))||customElements.define(t(e),o))}))}export{o as R,d}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface RuiRecipeDetail extends Components.RuiRecipeDetail, HTMLElement {}
|
|
4
|
+
export const RuiRecipeDetail: {
|
|
5
|
+
prototype: RuiRecipeDetail;
|
|
6
|
+
new (): RuiRecipeDetail;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as r,createEvent as i,h as a,Host as t,transformTag as d}from"@stencil/core/internal/client";const o=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.ruiAddToPlan=i(this,"ruiAddToPlan",7),this.ruiFavoriteToggle=i(this,"ruiFavoriteToggle",7),this.isFavorite=!1,this.onAddToPlan=()=>{this.ruiAddToPlan.emit(this.recipe)},this.onFavToggle=()=>{this.isFavorite=!this.isFavorite,this.ruiFavoriteToggle.emit({recipe:this.recipe,isFavorite:this.isFavorite})}}render(){const e=this.recipe;return a(t,{key:"3cbe3361e6d88381fbec4fd8d282963933878de4"},a("article",{key:"ef3860f9752829fae37d374684f5b6e5045299e5",class:"rui-detail"},a("header",{key:"a14c496c15e23458956538926449bcecb742fd4c",class:"rui-detail__header"},a("div",{key:"e6766cf5e4d766fcd2b47a946122b0b108de6a73",class:"rui-detail__media"},e.image?a("img",{src:e.image,alt:e.name}):a("div",{class:"rui-detail__placeholder"},"No image")),a("div",{key:"3c0ccb26f0379d9ddd9cd29a05d237a9d377d516",class:"rui-detail__intro"},a("h2",{key:"108020c974704efc52907eb1f945ee3a7584436f",class:"rui-detail__title"},e.name),(e.category||e.area)&&a("p",{key:"fc381751090c3c067076967347db95907e048898",class:"rui-detail__meta"},[e.category,e.area].filter(Boolean).join(" · ")),a("div",{key:"a0084338478d82d0e7c4f738ff7650646805efe9",class:"rui-detail__actions"},a("slot",{key:"ba5ac7fba83204b9c7512837313238771d68a59c",name:"actions"}),a("button",{key:"1b2a17d3d7571e5d484a9a26bb13b69a9ec8d56a",type:"button",class:"rui-detail__fav "+(this.isFavorite?"is-fav":""),"aria-pressed":this.isFavorite?"true":"false",onClick:this.onFavToggle},this.isFavorite?"♥ Favorited":"♡ Add to favorites"),a("button",{key:"1f9e6eec95cf99ef6bad7197d488e4623d9c0381",type:"button",class:"rui-detail__plan",onClick:this.onAddToPlan},"+ Add to meal plan")))),a("section",{key:"8fa48000e6baaf8f22431b413d964c79ce2f9441",class:"rui-detail__section"},a("h3",{key:"44e655db0ee49e4a1f9f2e31a82a23c3c549060a"},"Ingredients"),e.ingredients&&e.ingredients.length>0?(()=>{const r=Math.ceil(e.ingredients.length/2),i=e.ingredients.slice(0,r),t=e.ingredients.slice(r),d=(e,r)=>a("table",{class:"rui-detail__table"},a("thead",null,a("tr",null,a("th",null,"#"),a("th",null,"Ingredient"),a("th",null,"Measure"))),a("tbody",null,e.map(((e,i)=>a("tr",null,a("td",{class:"rui-detail__td--index"},r+i+1),a("td",{class:"rui-detail__ing-name"},e.name),a("td",{class:"rui-detail__ing-measure"},e.measure||"—"))))));return a("div",{class:"rui-detail__tables"},d(i,0),t.length>0&&d(t,r))})():a("p",{class:"rui-detail__empty"},"No ingredients listed."),a("slot",{key:"58d20bb01497af2651f492d9e6520a587d3e21ce",name:"ingredients-extra"})),e.instructions&&a("section",{key:"54176a29fab9b1142b30994d0ae74acd2e881e69",class:"rui-detail__section"},a("h3",{key:"0f0900c1f6abb29cf8601d5d3e6fc44abc344105"},"Instructions"),a("p",{key:"e4f4e185a193ac818bc21e3974c957716a1b8fd6",class:"rui-detail__instructions"},e.instructions)),(e.youtube||e.source)&&a("section",{key:"f8db0b0a526a6e774e83d700325471dbc032170e",class:"rui-detail__section rui-detail__links"},e.youtube&&a("a",{key:"add83e9353e6294219dfb9304c98a49833913200",href:e.youtube,target:"_blank",rel:"noopener noreferrer"},"Watch on YouTube"),e.source&&a("a",{key:"b719435a049b54a4b5ec1500ea9a19da9c10f98d",href:e.source,target:"_blank",rel:"noopener noreferrer"},"Original source"))))}static get style(){return":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}"}},[257,"rui-recipe-detail",{recipe:[16],isFavorite:[516,"is-favorite"]}]),l=o,s=function(){"undefined"!=typeof customElements&&["rui-recipe-detail"].forEach((e=>{"rui-recipe-detail"===e&&(customElements.get(d(e))||customElements.define(d(e),o))}))};export{l as RuiRecipeDetail,s as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface RuiRecipeList extends Components.RuiRecipeList, HTMLElement {}
|
|
4
|
+
export const RuiRecipeList: {
|
|
5
|
+
prototype: RuiRecipeList;
|
|
6
|
+
new (): RuiRecipeList;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as i,createEvent as t,h as r,Host as s,transformTag as c}from"@stencil/core/internal/client";import{d as a}from"./rui-recipe-card2.js";const o=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.ruiSelectRecipe=t(this,"ruiSelectRecipe",7),this.ruiFavoriteToggle=t(this,"ruiFavoriteToggle",7),this.recipes=[],this.favorites=[],this.emptyMessage="No recipes found."}recipesChanged(){}favoritesChanged(){}isFav(e){return this.favorites.includes(e)}render(){return r(s,null,this.recipes&&0!==this.recipes.length?r("div",{class:"rui-list"},this.recipes.map((e=>r("rui-recipe-card",{recipe:e,isFavorite:this.isFav(e.id),onRuiCardClick:e=>{e.stopPropagation(),this.ruiSelectRecipe.emit(e.detail)},onRuiFavoriteToggle:e=>{e.stopPropagation(),this.ruiFavoriteToggle.emit(e.detail)}})))):r("p",{class:"rui-list__empty"},this.emptyMessage))}static get watchers(){return{recipes:[{recipesChanged:0}],favorites:[{favoritesChanged:0}]}}static get style(){return":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}"}},[1,"rui-recipe-list",{recipes:[16],favorites:[16],emptyMessage:[1,"empty-message"]},void 0,{recipes:[{recipesChanged:0}],favorites:[{favoritesChanged:0}]}]),n=o,l=function(){"undefined"!=typeof customElements&&["rui-recipe-list","rui-recipe-card"].forEach((e=>{switch(e){case"rui-recipe-list":customElements.get(c(e))||customElements.define(c(e),o);break;case"rui-recipe-card":customElements.get(c(e))||a()}}))};export{n as RuiRecipeList,l as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface RuiSearchBar extends Components.RuiSearchBar, HTMLElement {}
|
|
4
|
+
export const RuiSearchBar: {
|
|
5
|
+
prototype: RuiSearchBar;
|
|
6
|
+
new (): RuiSearchBar;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement as r,HTMLElement as e,createEvent as s,h as i,Host as t,transformTag as o}from"@stencil/core/internal/client";const a=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.__attachShadow(),this.ruiSearchInput=s(this,"ruiSearchInput",7),this.ruiSearchSubmit=s(this,"ruiSearchSubmit",7),this.value="",this.placeholder="Search recipes...",this.debounceMs=300,this.onInput=r=>{this.value=r.target.value,clearTimeout(this.timer),this.timer=setTimeout((()=>{this.ruiSearchInput.emit(this.value)}),this.debounceMs)},this.onSubmit=r=>{r.preventDefault(),clearTimeout(this.timer),this.ruiSearchSubmit.emit(this.value)}}disconnectedCallback(){clearTimeout(this.timer)}render(){return i(t,{key:"42c4c7437175136a28e810f73417147e4e609870"},i("form",{key:"7b450f3e9fa9a3c63cda1169b3cecc5e2577ba96",class:"rui-search",onSubmit:this.onSubmit,role:"search"},i("input",{key:"861e092e1c537cedcbe3bf6b1cd580d00fd8d24d",class:"rui-search__input",type:"search",value:this.value,placeholder:this.placeholder,onInput:this.onInput,"aria-label":this.placeholder}),i("button",{key:"b6676deed915b99ecb22ca2c5d30851f51f04c74",class:"rui-search__btn",type:"submit","aria-label":"Search"},"Search")))}get el(){return this}static get style(){return":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)}"}},[1,"rui-search-bar",{value:[1025],placeholder:[1],debounceMs:[2,"debounce-ms"]}]),c=a,n=function(){"undefined"!=typeof customElements&&["rui-search-bar"].forEach((r=>{"rui-search-bar"===r&&(customElements.get(o(r))||customElements.define(o(r),a))}))};export{c as RuiSearchBar,n as defineCustomElement}
|