@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,30 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.rui-chips {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-wrap: wrap;
|
|
8
|
+
gap: 0.5rem;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.rui-chip {
|
|
12
|
+
font-family: var(--rui-font);
|
|
13
|
+
font-size: 0.85rem;
|
|
14
|
+
font-weight: 500;
|
|
15
|
+
padding: 0.35rem 0.85rem;
|
|
16
|
+
border-radius: 999px;
|
|
17
|
+
border: 1px solid var(--rui-color-border);
|
|
18
|
+
background: var(--rui-color-bg);
|
|
19
|
+
color: var(--rui-color-text);
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
|
|
22
|
+
}
|
|
23
|
+
.rui-chip:hover {
|
|
24
|
+
border-color: var(--rui-color-primary);
|
|
25
|
+
}
|
|
26
|
+
.rui-chip--active {
|
|
27
|
+
background: var(--rui-color-primary);
|
|
28
|
+
border-color: var(--rui-color-primary);
|
|
29
|
+
color: #fff;
|
|
30
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
export class RuiFilterChips {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.categories = [];
|
|
5
|
+
this.selected = [];
|
|
6
|
+
this.toggle = (value) => {
|
|
7
|
+
const next = this.selected.includes(value)
|
|
8
|
+
? this.selected.filter((v) => v !== value)
|
|
9
|
+
: [...this.selected, value];
|
|
10
|
+
this.selected = [...next];
|
|
11
|
+
this.ruiFilterChange.emit(this.selected);
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
render() {
|
|
15
|
+
return (h(Host, { key: '628063d481c07e5c80312a9a395ba7ad0ab859dc' }, h("div", { key: 'd3aa0f87f0e6b6bd55960dc91769f56b70e4ef67', class: "rui-chips", role: "group", "aria-label": "Filters" }, this.categories.map((cat) => {
|
|
16
|
+
const active = this.selected.includes(cat.value);
|
|
17
|
+
return (h("button", { type: "button", class: `rui-chip ${active ? 'rui-chip--active' : ''}`, "aria-pressed": active ? 'true' : 'false', onClick: () => this.toggle(cat.value) }, cat.label));
|
|
18
|
+
}))));
|
|
19
|
+
}
|
|
20
|
+
static get is() { return "rui-filter-chips"; }
|
|
21
|
+
static get encapsulation() { return "shadow"; }
|
|
22
|
+
static get originalStyleUrls() {
|
|
23
|
+
return {
|
|
24
|
+
"$": ["rui-filter-chips.css"]
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
static get styleUrls() {
|
|
28
|
+
return {
|
|
29
|
+
"$": ["rui-filter-chips.css"]
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
static get properties() {
|
|
33
|
+
return {
|
|
34
|
+
"categories": {
|
|
35
|
+
"type": "unknown",
|
|
36
|
+
"mutable": false,
|
|
37
|
+
"complexType": {
|
|
38
|
+
"original": "FilterCategory[]",
|
|
39
|
+
"resolved": "FilterCategory[]",
|
|
40
|
+
"references": {
|
|
41
|
+
"FilterCategory": {
|
|
42
|
+
"location": "local",
|
|
43
|
+
"path": "F:/Projects/RecipeFinder/recipe-ui-lib/src/components/rui-filter-chips/rui-filter-chips.tsx",
|
|
44
|
+
"id": "src/components/rui-filter-chips/rui-filter-chips.tsx::FilterCategory"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"required": false,
|
|
49
|
+
"optional": false,
|
|
50
|
+
"docs": {
|
|
51
|
+
"tags": [],
|
|
52
|
+
"text": "Available categories."
|
|
53
|
+
},
|
|
54
|
+
"getter": false,
|
|
55
|
+
"setter": false,
|
|
56
|
+
"defaultValue": "[]"
|
|
57
|
+
},
|
|
58
|
+
"selected": {
|
|
59
|
+
"type": "unknown",
|
|
60
|
+
"mutable": false,
|
|
61
|
+
"complexType": {
|
|
62
|
+
"original": "string[]",
|
|
63
|
+
"resolved": "string[]",
|
|
64
|
+
"references": {}
|
|
65
|
+
},
|
|
66
|
+
"required": false,
|
|
67
|
+
"optional": false,
|
|
68
|
+
"docs": {
|
|
69
|
+
"tags": [],
|
|
70
|
+
"text": "Currently selected category values."
|
|
71
|
+
},
|
|
72
|
+
"getter": false,
|
|
73
|
+
"setter": false,
|
|
74
|
+
"defaultValue": "[]"
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
static get events() {
|
|
79
|
+
return [{
|
|
80
|
+
"method": "ruiFilterChange",
|
|
81
|
+
"name": "ruiFilterChange",
|
|
82
|
+
"bubbles": true,
|
|
83
|
+
"cancelable": true,
|
|
84
|
+
"composed": true,
|
|
85
|
+
"docs": {
|
|
86
|
+
"tags": [],
|
|
87
|
+
"text": "Emitted when the selection changes. detail: string[] (selected values)."
|
|
88
|
+
},
|
|
89
|
+
"complexType": {
|
|
90
|
+
"original": "string[]",
|
|
91
|
+
"resolved": "string[]",
|
|
92
|
+
"references": {}
|
|
93
|
+
}
|
|
94
|
+
}];
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.rui-planner {
|
|
6
|
+
display: grid;
|
|
7
|
+
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
|
|
8
|
+
gap: 1rem;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.rui-planner__day {
|
|
12
|
+
background: var(--rui-color-bg);
|
|
13
|
+
border: 1px solid var(--rui-color-border);
|
|
14
|
+
border-radius: var(--rui-radius);
|
|
15
|
+
box-shadow: var(--rui-shadow-sm);
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.rui-planner__day-head {
|
|
20
|
+
padding: 0.6rem 0.85rem;
|
|
21
|
+
background: var(--rui-color-primary-soft);
|
|
22
|
+
border-bottom: 1px solid var(--rui-color-border);
|
|
23
|
+
}
|
|
24
|
+
.rui-planner__day-head h4 {
|
|
25
|
+
margin: 0;
|
|
26
|
+
font-size: 0.95rem;
|
|
27
|
+
font-weight: 700;
|
|
28
|
+
color: var(--rui-color-primary-hover);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.rui-planner__meal {
|
|
32
|
+
display: flex;
|
|
33
|
+
gap: 0.6rem;
|
|
34
|
+
padding: 0.75rem;
|
|
35
|
+
align-items: center;
|
|
36
|
+
}
|
|
37
|
+
.rui-planner__meal--clickable {
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
transition: background-color 0.15s ease;
|
|
40
|
+
border-radius: var(--rui-radius);
|
|
41
|
+
}
|
|
42
|
+
.rui-planner__meal--clickable:hover {
|
|
43
|
+
background: var(--rui-color-primary-soft, #dcfce7);
|
|
44
|
+
}
|
|
45
|
+
.rui-planner__meal--clickable:focus-visible {
|
|
46
|
+
outline: 2px solid var(--rui-color-primary, #16a34a);
|
|
47
|
+
outline-offset: -2px;
|
|
48
|
+
}
|
|
49
|
+
.rui-planner__meal img {
|
|
50
|
+
width: 56px;
|
|
51
|
+
height: 56px;
|
|
52
|
+
border-radius: var(--rui-radius-sm);
|
|
53
|
+
object-fit: cover;
|
|
54
|
+
flex-shrink: 0;
|
|
55
|
+
}
|
|
56
|
+
.rui-planner__meal-info {
|
|
57
|
+
flex: 1;
|
|
58
|
+
min-width: 0;
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
gap: 0.15rem;
|
|
62
|
+
}
|
|
63
|
+
.rui-planner__meal-name {
|
|
64
|
+
font-size: 0.9rem;
|
|
65
|
+
font-weight: 600;
|
|
66
|
+
line-height: 1.3;
|
|
67
|
+
display: -webkit-box;
|
|
68
|
+
-webkit-line-clamp: 2;
|
|
69
|
+
-webkit-box-orient: vertical;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
}
|
|
72
|
+
.rui-planner__meal-cat {
|
|
73
|
+
font-size: 0.75rem;
|
|
74
|
+
color: var(--rui-color-muted);
|
|
75
|
+
}
|
|
76
|
+
.rui-planner__meal-actions {
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
gap: 0.25rem;
|
|
80
|
+
}
|
|
81
|
+
.rui-planner__meal-actions button {
|
|
82
|
+
font-family: var(--rui-font);
|
|
83
|
+
font-size: 0.75rem;
|
|
84
|
+
padding: 0.25rem 0.5rem;
|
|
85
|
+
border-radius: var(--rui-radius-sm);
|
|
86
|
+
border: 1px solid var(--rui-color-border);
|
|
87
|
+
background: var(--rui-color-bg);
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
}
|
|
90
|
+
.rui-planner__meal-actions button:hover {
|
|
91
|
+
border-color: var(--rui-color-primary);
|
|
92
|
+
}
|
|
93
|
+
.rui-planner__view {
|
|
94
|
+
color: var(--rui-color-primary-hover, #15803d);
|
|
95
|
+
font-weight: 600;
|
|
96
|
+
}
|
|
97
|
+
.rui-planner__view:hover {
|
|
98
|
+
background: var(--rui-color-primary, #16a34a) !important;
|
|
99
|
+
color: #fff !important;
|
|
100
|
+
border-color: var(--rui-color-primary, #16a34a) !important;
|
|
101
|
+
}
|
|
102
|
+
.rui-planner__clear:hover {
|
|
103
|
+
color: var(--rui-color-danger);
|
|
104
|
+
border-color: var(--rui-color-danger) !important;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.rui-planner__empty {
|
|
108
|
+
padding: 1rem 0.75rem;
|
|
109
|
+
display: flex;
|
|
110
|
+
flex-direction: column;
|
|
111
|
+
align-items: center;
|
|
112
|
+
gap: 0.6rem;
|
|
113
|
+
color: var(--rui-color-muted);
|
|
114
|
+
font-size: 0.85rem;
|
|
115
|
+
}
|
|
116
|
+
.rui-planner__empty button {
|
|
117
|
+
font-family: var(--rui-font);
|
|
118
|
+
font-size: 0.8rem;
|
|
119
|
+
font-weight: 600;
|
|
120
|
+
padding: 0.4rem 0.8rem;
|
|
121
|
+
border-radius: var(--rui-radius);
|
|
122
|
+
border: 1px dashed var(--rui-color-border);
|
|
123
|
+
background: var(--rui-color-bg-alt);
|
|
124
|
+
color: var(--rui-color-primary-hover);
|
|
125
|
+
cursor: pointer;
|
|
126
|
+
}
|
|
127
|
+
.rui-planner__empty button:hover {
|
|
128
|
+
border-color: var(--rui-color-primary);
|
|
129
|
+
background: var(--rui-color-primary-soft);
|
|
130
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
export class RuiMealPlanner {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.plan = {};
|
|
5
|
+
this.days = [
|
|
6
|
+
'Monday',
|
|
7
|
+
'Tuesday',
|
|
8
|
+
'Wednesday',
|
|
9
|
+
'Thursday',
|
|
10
|
+
'Friday',
|
|
11
|
+
'Saturday',
|
|
12
|
+
'Sunday',
|
|
13
|
+
];
|
|
14
|
+
this.assign = (day) => this.ruiAssignMeal.emit({ day });
|
|
15
|
+
this.remove = (day, recipe) => this.ruiRemoveMeal.emit({ day, recipe });
|
|
16
|
+
this.clear = (day) => this.ruiClearDay.emit({ day });
|
|
17
|
+
this.selectMeal = (day, recipe) => this.ruiSelectMeal.emit({ day, recipe });
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
return (h(Host, { key: 'de032b8a71504aa8c7ce9ae269c299974c03e160' }, h("div", { key: '178b5fc0a98d94cc2bb9666d7edcd74ca605df98', class: "rui-planner" }, this.days.map((day) => {
|
|
21
|
+
const meal = this.plan[day];
|
|
22
|
+
return (h("div", { class: "rui-planner__day" }, h("div", { class: "rui-planner__day-head" }, h("h4", null, day)), meal && meal.recipe ? (h("div", { class: "rui-planner__meal rui-planner__meal--clickable", onClick: () => this.selectMeal(day, meal.recipe), role: "button", tabindex: 0, onKeyDown: (e) => {
|
|
23
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
this.selectMeal(day, meal.recipe);
|
|
26
|
+
}
|
|
27
|
+
}, title: "View recipe ingredients" }, meal.recipe.image && (h("img", { src: meal.recipe.image, alt: meal.recipe.name })), h("div", { class: "rui-planner__meal-info" }, h("span", { class: "rui-planner__meal-name" }, meal.recipe.name), meal.recipe.category && (h("span", { class: "rui-planner__meal-cat" }, meal.recipe.category))), h("div", { class: "rui-planner__meal-actions" }, h("button", { type: "button", class: "rui-planner__view", onClick: (e) => {
|
|
28
|
+
e.stopPropagation();
|
|
29
|
+
this.selectMeal(day, meal.recipe);
|
|
30
|
+
} }, "View"), h("button", { type: "button", onClick: (e) => {
|
|
31
|
+
e.stopPropagation();
|
|
32
|
+
this.remove(day, meal.recipe);
|
|
33
|
+
} }, "Remove"), h("button", { type: "button", class: "rui-planner__clear", onClick: (e) => {
|
|
34
|
+
e.stopPropagation();
|
|
35
|
+
this.clear(day);
|
|
36
|
+
} }, "Clear")))) : (h("div", { class: "rui-planner__empty" }, h("span", null, "No meal planned"), h("button", { type: "button", onClick: () => this.assign(day) }, "+ Assign recipe")))));
|
|
37
|
+
}))));
|
|
38
|
+
}
|
|
39
|
+
static get is() { return "rui-meal-planner"; }
|
|
40
|
+
static get encapsulation() { return "shadow"; }
|
|
41
|
+
static get originalStyleUrls() {
|
|
42
|
+
return {
|
|
43
|
+
"$": ["rui-meal-planner.css"]
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
static get styleUrls() {
|
|
47
|
+
return {
|
|
48
|
+
"$": ["rui-meal-planner.css"]
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
static get properties() {
|
|
52
|
+
return {
|
|
53
|
+
"plan": {
|
|
54
|
+
"type": "unknown",
|
|
55
|
+
"mutable": false,
|
|
56
|
+
"complexType": {
|
|
57
|
+
"original": "MealPlan",
|
|
58
|
+
"resolved": "{ [x: string]: PlannedMeal | null; }",
|
|
59
|
+
"references": {
|
|
60
|
+
"MealPlan": {
|
|
61
|
+
"location": "local",
|
|
62
|
+
"path": "F:/Projects/RecipeFinder/recipe-ui-lib/src/components/rui-meal-planner/rui-meal-planner.tsx",
|
|
63
|
+
"id": "src/components/rui-meal-planner/rui-meal-planner.tsx::MealPlan"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"required": false,
|
|
68
|
+
"optional": false,
|
|
69
|
+
"docs": {
|
|
70
|
+
"tags": [],
|
|
71
|
+
"text": "Map of day -> PlannedMeal (or null when empty)."
|
|
72
|
+
},
|
|
73
|
+
"getter": false,
|
|
74
|
+
"setter": false,
|
|
75
|
+
"defaultValue": "{}"
|
|
76
|
+
},
|
|
77
|
+
"days": {
|
|
78
|
+
"type": "unknown",
|
|
79
|
+
"mutable": false,
|
|
80
|
+
"complexType": {
|
|
81
|
+
"original": "string[]",
|
|
82
|
+
"resolved": "string[]",
|
|
83
|
+
"references": {}
|
|
84
|
+
},
|
|
85
|
+
"required": false,
|
|
86
|
+
"optional": false,
|
|
87
|
+
"docs": {
|
|
88
|
+
"tags": [],
|
|
89
|
+
"text": "Days of the week to render."
|
|
90
|
+
},
|
|
91
|
+
"getter": false,
|
|
92
|
+
"setter": false,
|
|
93
|
+
"defaultValue": "[\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday',\n 'Sunday',\n ]"
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
static get events() {
|
|
98
|
+
return [{
|
|
99
|
+
"method": "ruiAssignMeal",
|
|
100
|
+
"name": "ruiAssignMeal",
|
|
101
|
+
"bubbles": true,
|
|
102
|
+
"cancelable": true,
|
|
103
|
+
"composed": true,
|
|
104
|
+
"docs": {
|
|
105
|
+
"tags": [],
|
|
106
|
+
"text": "Emitted when \"Assign\" is clicked. detail: { day }."
|
|
107
|
+
},
|
|
108
|
+
"complexType": {
|
|
109
|
+
"original": "{ day: string }",
|
|
110
|
+
"resolved": "{ day: string; }",
|
|
111
|
+
"references": {}
|
|
112
|
+
}
|
|
113
|
+
}, {
|
|
114
|
+
"method": "ruiRemoveMeal",
|
|
115
|
+
"name": "ruiRemoveMeal",
|
|
116
|
+
"bubbles": true,
|
|
117
|
+
"cancelable": true,
|
|
118
|
+
"composed": true,
|
|
119
|
+
"docs": {
|
|
120
|
+
"tags": [],
|
|
121
|
+
"text": "Emitted when \"Remove\" is clicked on a planned meal. detail: { day, recipe }."
|
|
122
|
+
},
|
|
123
|
+
"complexType": {
|
|
124
|
+
"original": "{ day: string; recipe: RecipeSummary }",
|
|
125
|
+
"resolved": "{ day: string; recipe: RecipeSummary; }",
|
|
126
|
+
"references": {
|
|
127
|
+
"RecipeSummary": {
|
|
128
|
+
"location": "import",
|
|
129
|
+
"path": "../rui-recipe-card/rui-recipe-card",
|
|
130
|
+
"id": "src/components/rui-recipe-card/rui-recipe-card.tsx::RecipeSummary",
|
|
131
|
+
"referenceLocation": "RecipeSummary"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}, {
|
|
136
|
+
"method": "ruiClearDay",
|
|
137
|
+
"name": "ruiClearDay",
|
|
138
|
+
"bubbles": true,
|
|
139
|
+
"cancelable": true,
|
|
140
|
+
"composed": true,
|
|
141
|
+
"docs": {
|
|
142
|
+
"tags": [],
|
|
143
|
+
"text": "Emitted when \"Clear\" is clicked for a day. detail: { day }."
|
|
144
|
+
},
|
|
145
|
+
"complexType": {
|
|
146
|
+
"original": "{ day: string }",
|
|
147
|
+
"resolved": "{ day: string; }",
|
|
148
|
+
"references": {}
|
|
149
|
+
}
|
|
150
|
+
}, {
|
|
151
|
+
"method": "ruiSelectMeal",
|
|
152
|
+
"name": "ruiSelectMeal",
|
|
153
|
+
"bubbles": true,
|
|
154
|
+
"cancelable": true,
|
|
155
|
+
"composed": true,
|
|
156
|
+
"docs": {
|
|
157
|
+
"tags": [],
|
|
158
|
+
"text": "Emitted when a planned meal is clicked to view recipe. detail: { day, recipe }."
|
|
159
|
+
},
|
|
160
|
+
"complexType": {
|
|
161
|
+
"original": "{ day: string; recipe: RecipeSummary }",
|
|
162
|
+
"resolved": "{ day: string; recipe: RecipeSummary; }",
|
|
163
|
+
"references": {
|
|
164
|
+
"RecipeSummary": {
|
|
165
|
+
"location": "import",
|
|
166
|
+
"path": "../rui-recipe-card/rui-recipe-card",
|
|
167
|
+
"id": "src/components/rui-recipe-card/rui-recipe-card.tsx::RecipeSummary",
|
|
168
|
+
"referenceLocation": "RecipeSummary"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}];
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.rui-modal__backdrop {
|
|
6
|
+
position: fixed;
|
|
7
|
+
inset: 0;
|
|
8
|
+
background: rgba(0, 0, 0, 0.5);
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: flex-start;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
padding: 5vh 1rem 1rem;
|
|
13
|
+
z-index: 1000;
|
|
14
|
+
overflow-y: auto;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.rui-modal__dialog {
|
|
18
|
+
background: var(--rui-color-bg, #ffffff);
|
|
19
|
+
border: 1px solid var(--rui-color-border, #dee2e6);
|
|
20
|
+
border-radius: var(--rui-radius, 8px);
|
|
21
|
+
box-shadow: var(--rui-shadow-md, 0 4px 12px rgba(0, 0, 0, 0.12));
|
|
22
|
+
width: 100%;
|
|
23
|
+
max-width: 560px;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
max-height: 90vh;
|
|
27
|
+
position: relative;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.rui-modal__header {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: space-between;
|
|
34
|
+
padding: 1rem 1.25rem;
|
|
35
|
+
border-bottom: 1px solid var(--rui-color-border, #dee2e6);
|
|
36
|
+
background: var(--rui-color-bg, #ffffff);
|
|
37
|
+
border-radius: var(--rui-radius, 8px) var(--rui-radius, 8px) 0 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.rui-modal__title {
|
|
41
|
+
margin: 0;
|
|
42
|
+
font-size: 1.15rem;
|
|
43
|
+
font-weight: 700;
|
|
44
|
+
color: var(--rui-color-text, #212529);
|
|
45
|
+
font-family: var(--rui-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.rui-modal__close {
|
|
49
|
+
background: none;
|
|
50
|
+
border: none;
|
|
51
|
+
font-size: 1.5rem;
|
|
52
|
+
line-height: 1;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
color: var(--rui-color-muted, #868e96);
|
|
55
|
+
padding: 0 0.25rem;
|
|
56
|
+
}
|
|
57
|
+
.rui-modal__close:hover {
|
|
58
|
+
color: var(--rui-color-text, #212529);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.rui-modal__body {
|
|
62
|
+
padding: 1.25rem;
|
|
63
|
+
overflow-y: auto;
|
|
64
|
+
background: var(--rui-color-bg, #ffffff);
|
|
65
|
+
color: var(--rui-color-text, #212529);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.rui-modal__footer {
|
|
69
|
+
padding: 1rem 1.25rem;
|
|
70
|
+
border-top: 1px solid var(--rui-color-border, #dee2e6);
|
|
71
|
+
display: flex;
|
|
72
|
+
justify-content: flex-end;
|
|
73
|
+
gap: 0.5rem;
|
|
74
|
+
background: var(--rui-color-bg, #ffffff);
|
|
75
|
+
border-radius: 0 0 var(--rui-radius, 8px) var(--rui-radius, 8px);
|
|
76
|
+
}
|
|
77
|
+
.rui-modal__footer:empty {
|
|
78
|
+
display: none;
|
|
79
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
export class RuiModal {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.open = false;
|
|
5
|
+
this.modalTitle = '';
|
|
6
|
+
this.closeOnBackdrop = true;
|
|
7
|
+
this.handleBackdrop = (e) => {
|
|
8
|
+
if (!this.closeOnBackdrop)
|
|
9
|
+
return;
|
|
10
|
+
if (e.target === e.currentTarget) {
|
|
11
|
+
this.requestClose();
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
this.handleKey = (e) => {
|
|
15
|
+
if (e.key === 'Escape' && this.open) {
|
|
16
|
+
this.requestClose();
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
requestClose() {
|
|
21
|
+
this.ruiClose.emit();
|
|
22
|
+
}
|
|
23
|
+
openChanged(isOpen) {
|
|
24
|
+
if (isOpen) {
|
|
25
|
+
document.addEventListener('keydown', this.handleKey);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
document.removeEventListener('keydown', this.handleKey);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
disconnectedCallback() {
|
|
32
|
+
document.removeEventListener('keydown', this.handleKey);
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
return (h(Host, { key: '9bbdb18b18e8c09ec5e8edfd886a44cb4d86cb0b' }, this.open && (h("div", { key: 'b772df0ce6a04949c1ac0d44449545a35d877adc', class: "rui-modal__backdrop", onClick: this.handleBackdrop }, h("div", { key: '4c22489ccd86da08b1a007757b1c42da4023067e', class: "rui-modal__dialog", role: "dialog", "aria-modal": "true", "aria-label": this.modalTitle }, h("header", { key: '5dd1ceca76410c18acbc8b12fc7cb9ca8c6dff27', class: "rui-modal__header" }, h("h3", { key: 'c131c313193f0ba0fd847426dff141f3c1adc143', class: "rui-modal__title" }, this.modalTitle), h("button", { key: 'c280b26ea160e5c765b80eb9054dd5ff186e7646', class: "rui-modal__close", type: "button", "aria-label": "Close", onClick: () => this.requestClose() }, "\u00D7")), h("div", { key: 'f4c32d83f83e5e452dc10a368f5f620e3557eedf', class: "rui-modal__body" }, h("slot", { key: 'a278a93efe24076204c4fce7b0cf44be22df4dc9' })), h("footer", { key: '31bed0da07b6310cdf4684c24f505ede0a220416', class: "rui-modal__footer" }, h("slot", { key: '7a5806e2edf0d6aaef25b119c1d2ba8f3684a1f7', name: "footer" })))))));
|
|
36
|
+
}
|
|
37
|
+
static get is() { return "rui-modal"; }
|
|
38
|
+
static get encapsulation() { return "shadow"; }
|
|
39
|
+
static get originalStyleUrls() {
|
|
40
|
+
return {
|
|
41
|
+
"$": ["rui-modal.css"]
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
static get styleUrls() {
|
|
45
|
+
return {
|
|
46
|
+
"$": ["rui-modal.css"]
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
static get properties() {
|
|
50
|
+
return {
|
|
51
|
+
"open": {
|
|
52
|
+
"type": "boolean",
|
|
53
|
+
"mutable": true,
|
|
54
|
+
"complexType": {
|
|
55
|
+
"original": "boolean",
|
|
56
|
+
"resolved": "boolean",
|
|
57
|
+
"references": {}
|
|
58
|
+
},
|
|
59
|
+
"required": false,
|
|
60
|
+
"optional": false,
|
|
61
|
+
"docs": {
|
|
62
|
+
"tags": [],
|
|
63
|
+
"text": "Whether the modal is open."
|
|
64
|
+
},
|
|
65
|
+
"getter": false,
|
|
66
|
+
"setter": false,
|
|
67
|
+
"reflect": true,
|
|
68
|
+
"attribute": "open",
|
|
69
|
+
"defaultValue": "false"
|
|
70
|
+
},
|
|
71
|
+
"modalTitle": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"mutable": false,
|
|
74
|
+
"complexType": {
|
|
75
|
+
"original": "string",
|
|
76
|
+
"resolved": "string",
|
|
77
|
+
"references": {}
|
|
78
|
+
},
|
|
79
|
+
"required": false,
|
|
80
|
+
"optional": false,
|
|
81
|
+
"docs": {
|
|
82
|
+
"tags": [],
|
|
83
|
+
"text": "Modal title."
|
|
84
|
+
},
|
|
85
|
+
"getter": false,
|
|
86
|
+
"setter": false,
|
|
87
|
+
"reflect": false,
|
|
88
|
+
"attribute": "modal-title",
|
|
89
|
+
"defaultValue": "''"
|
|
90
|
+
},
|
|
91
|
+
"closeOnBackdrop": {
|
|
92
|
+
"type": "boolean",
|
|
93
|
+
"mutable": false,
|
|
94
|
+
"complexType": {
|
|
95
|
+
"original": "boolean",
|
|
96
|
+
"resolved": "boolean",
|
|
97
|
+
"references": {}
|
|
98
|
+
},
|
|
99
|
+
"required": false,
|
|
100
|
+
"optional": false,
|
|
101
|
+
"docs": {
|
|
102
|
+
"tags": [],
|
|
103
|
+
"text": "Close on backdrop click."
|
|
104
|
+
},
|
|
105
|
+
"getter": false,
|
|
106
|
+
"setter": false,
|
|
107
|
+
"reflect": false,
|
|
108
|
+
"attribute": "close-on-backdrop",
|
|
109
|
+
"defaultValue": "true"
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
static get events() {
|
|
114
|
+
return [{
|
|
115
|
+
"method": "ruiClose",
|
|
116
|
+
"name": "ruiClose",
|
|
117
|
+
"bubbles": true,
|
|
118
|
+
"cancelable": true,
|
|
119
|
+
"composed": true,
|
|
120
|
+
"docs": {
|
|
121
|
+
"tags": [],
|
|
122
|
+
"text": "Emitted when the modal requests to close (X button, backdrop, Escape)."
|
|
123
|
+
},
|
|
124
|
+
"complexType": {
|
|
125
|
+
"original": "void",
|
|
126
|
+
"resolved": "void",
|
|
127
|
+
"references": {}
|
|
128
|
+
}
|
|
129
|
+
}];
|
|
130
|
+
}
|
|
131
|
+
static get watchers() {
|
|
132
|
+
return [{
|
|
133
|
+
"propName": "open",
|
|
134
|
+
"methodName": "openChanged"
|
|
135
|
+
}];
|
|
136
|
+
}
|
|
137
|
+
}
|