@access-ci/ui 0.4.0 → 0.5.0-beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access-ci-ui.bundle.js +21 -1
- package/dist/access-ci-ui.js +11 -807
- package/dist/access-ci-ui.umd.cjs +43 -1
- package/dist/icon-Bnee6DXz.js +7 -0
- package/dist/index-ClapqXAT.js +1208 -0
- package/dist/resource-group-detail-D6IpF4Dt.js +12482 -0
- package/dist/resource-home-B3KqRwTH.js +227 -0
- package/package.json +7 -2
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { u as e, c as p, h as f, A as b, _ as w, a as C, i as v, T as y, j as k } from "./index-ClapqXAT.js";
|
|
2
|
+
import { I as u } from "./icon-Bnee6DXz.js";
|
|
3
|
+
const R = {
|
|
4
|
+
"ACCESS Pegasus": "https://pegasus.isi.edu/wordpress/wp-content/uploads/2016/01/favicon.ico",
|
|
5
|
+
"ACCESS OnDemand": "https://openondemand.org/themes/fire/theme/assets/media/favicons/favicon.ico",
|
|
6
|
+
"Advance reservations": "calendar-check",
|
|
7
|
+
"Composable hardware fabric": "boxes",
|
|
8
|
+
"Compute Resources": "cpu-fill",
|
|
9
|
+
"CPU Compute": "cpu-fill",
|
|
10
|
+
"GPU Compute": "cpu",
|
|
11
|
+
"Innovative / Novel Compute": "lightbulb",
|
|
12
|
+
"Large Memory Nodes": "arrows-fullscreen",
|
|
13
|
+
Preemption: "clock-history",
|
|
14
|
+
"Science Gateway support": "globe",
|
|
15
|
+
"Storage Resources": "hdd-fill",
|
|
16
|
+
"Virtual Machines": "pc-display-horizontal",
|
|
17
|
+
Cloud: "cloud",
|
|
18
|
+
Storage: "hdd-fill"
|
|
19
|
+
};
|
|
20
|
+
function g({ active: r, tagCategory: c, tagId: n, iconUri: t, name: a, toggleTag: s }) {
|
|
21
|
+
const i = t || R[a] || "tag";
|
|
22
|
+
return /* @__PURE__ */ e(
|
|
23
|
+
"li",
|
|
24
|
+
{
|
|
25
|
+
class: `tag tag-category-${c.name.toLowerCase().replace(/[^a-z]+/g, "-")}${r.tagIds.has(n) ? " active" : ""}`,
|
|
26
|
+
children: /* @__PURE__ */ e(
|
|
27
|
+
"button",
|
|
28
|
+
{
|
|
29
|
+
href: "#",
|
|
30
|
+
disabled: r.disabledTagIds.has(n),
|
|
31
|
+
onClick: (o) => {
|
|
32
|
+
o.preventDefault(), s(n);
|
|
33
|
+
},
|
|
34
|
+
children: [
|
|
35
|
+
i.startsWith("http") ? /* @__PURE__ */ e(u, { alt: a, src: i }) : /* @__PURE__ */ e(u, { name: i }),
|
|
36
|
+
a
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
function m({ children: r }) {
|
|
44
|
+
return /* @__PURE__ */ e("ul", { class: "tags", children: r });
|
|
45
|
+
}
|
|
46
|
+
function I({
|
|
47
|
+
active: r,
|
|
48
|
+
baseUri: c,
|
|
49
|
+
description: n,
|
|
50
|
+
imageType: t,
|
|
51
|
+
imageUri: a,
|
|
52
|
+
name: s,
|
|
53
|
+
infoGroupId: i,
|
|
54
|
+
tags: o,
|
|
55
|
+
toggleTag: d
|
|
56
|
+
}) {
|
|
57
|
+
const l = `${c}/${i}`;
|
|
58
|
+
return /* @__PURE__ */ e("div", { class: "resource-group", children: [
|
|
59
|
+
/* @__PURE__ */ e(
|
|
60
|
+
"a",
|
|
61
|
+
{
|
|
62
|
+
class: `resource-group-image image-type-${t}`,
|
|
63
|
+
href: l,
|
|
64
|
+
children: a ? /* @__PURE__ */ e("img", { src: a }) : /* @__PURE__ */ e(u, { name: "motherboard" })
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ e("div", { class: "resource-group-text", children: [
|
|
68
|
+
/* @__PURE__ */ e("h3", { children: /* @__PURE__ */ e("a", { href: l, children: s }) }),
|
|
69
|
+
/* @__PURE__ */ e(m, { children: o.map((h) => /* @__PURE__ */ e(g, { ...h, active: r, toggleTag: d })) }),
|
|
70
|
+
/* @__PURE__ */ e("p", { children: [
|
|
71
|
+
n && n,
|
|
72
|
+
" ",
|
|
73
|
+
/* @__PURE__ */ e("a", { href: l, children: [
|
|
74
|
+
"Learn more about ",
|
|
75
|
+
s,
|
|
76
|
+
" »"
|
|
77
|
+
] })
|
|
78
|
+
] })
|
|
79
|
+
] })
|
|
80
|
+
] });
|
|
81
|
+
}
|
|
82
|
+
function S({
|
|
83
|
+
active: r,
|
|
84
|
+
baseUri: c,
|
|
85
|
+
name: n,
|
|
86
|
+
resourceGroups: t,
|
|
87
|
+
toggleTag: a
|
|
88
|
+
}) {
|
|
89
|
+
return /* @__PURE__ */ e(p, { children: [
|
|
90
|
+
/* @__PURE__ */ e("h2", { children: n }),
|
|
91
|
+
t.filter(({ infoGroupId: s }) => r.infoGroupIds.has(s)).map((s) => /* @__PURE__ */ e(
|
|
92
|
+
I,
|
|
93
|
+
{
|
|
94
|
+
...s,
|
|
95
|
+
baseUri: c,
|
|
96
|
+
active: r,
|
|
97
|
+
toggleTag: a
|
|
98
|
+
}
|
|
99
|
+
))
|
|
100
|
+
] });
|
|
101
|
+
}
|
|
102
|
+
function A({
|
|
103
|
+
active: r,
|
|
104
|
+
clearTags: c,
|
|
105
|
+
tagCategories: n,
|
|
106
|
+
toggleTag: t
|
|
107
|
+
}) {
|
|
108
|
+
const [a, s] = f(!1), i = b(null);
|
|
109
|
+
return w(() => {
|
|
110
|
+
i.current && (i.current.addEventListener("click", (o) => o.stopPropagation()), document.body.addEventListener("click", () => s(!1)));
|
|
111
|
+
}, [i.current]), /* @__PURE__ */ e("section", { class: "filters-outer", ref: i, children: [
|
|
112
|
+
/* @__PURE__ */ e(
|
|
113
|
+
"button",
|
|
114
|
+
{
|
|
115
|
+
onClick: () => s(!a),
|
|
116
|
+
class: `btn-filters btn ${a ? "active" : ""}`,
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ e(u, { name: "filter" }),
|
|
119
|
+
" Filters",
|
|
120
|
+
r.tagIds.size > 0 ? /* @__PURE__ */ e("span", { class: "active-tag-count", children: r.tagIds.size }) : null
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
a ? /* @__PURE__ */ e("div", { class: "filters-inner", children: [
|
|
125
|
+
n.map((o) => /* @__PURE__ */ e(p, { children: [
|
|
126
|
+
/* @__PURE__ */ e("h2", { children: o.name }),
|
|
127
|
+
/* @__PURE__ */ e(m, { children: o.tags.map((d) => /* @__PURE__ */ e(g, { ...d, active: r, toggleTag: t })) })
|
|
128
|
+
] })),
|
|
129
|
+
/* @__PURE__ */ e(
|
|
130
|
+
"button",
|
|
131
|
+
{
|
|
132
|
+
onClick: c,
|
|
133
|
+
disabled: r.tagIds.size == 0,
|
|
134
|
+
class: "btn danger",
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ e(u, { name: "trash" }),
|
|
137
|
+
" Clear Filters"
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
] }) : null
|
|
142
|
+
] });
|
|
143
|
+
}
|
|
144
|
+
function T() {
|
|
145
|
+
return /* @__PURE__ */ e("section", { id: "resource-pathways", children: /* @__PURE__ */ e("ul", { class: "resource-pathways", children: [
|
|
146
|
+
{
|
|
147
|
+
title: "Browse resources",
|
|
148
|
+
icon: "filter-square",
|
|
149
|
+
href: "#browse-resources",
|
|
150
|
+
description: "Filter resources to find the best match for your research."
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
title: "Ask a question",
|
|
154
|
+
icon: "question-circle",
|
|
155
|
+
href: "https://support.access-ci.org/",
|
|
156
|
+
description: "You have resource questions. Our Q&A bot has answers!",
|
|
157
|
+
login: !0
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
title: "Get suggestions",
|
|
161
|
+
icon: "card-checklist",
|
|
162
|
+
href: "https://access-ara.ccs.uky.edu:8080/",
|
|
163
|
+
description: "Fill out a form to get resource recommendations."
|
|
164
|
+
}
|
|
165
|
+
].map(({ title: c, icon: n, href: t, description: a, login: s }, i) => /* @__PURE__ */ e("li", { class: `resource-pathway-${i}`, children: /* @__PURE__ */ e("a", { href: t, children: [
|
|
166
|
+
n ? /* @__PURE__ */ e(u, { name: n }) : null,
|
|
167
|
+
/* @__PURE__ */ e("span", { class: "detail", children: [
|
|
168
|
+
/* @__PURE__ */ e("span", { class: "title", children: c }),
|
|
169
|
+
/* @__PURE__ */ e("span", { class: "description", children: a }),
|
|
170
|
+
s ? /* @__PURE__ */ e("span", { class: "login", children: [
|
|
171
|
+
/* @__PURE__ */ e(u, { name: "key" }),
|
|
172
|
+
" Requires ACCESS Login"
|
|
173
|
+
] }) : null
|
|
174
|
+
] })
|
|
175
|
+
] }) })) }) });
|
|
176
|
+
}
|
|
177
|
+
function G({ maxItems: r = 2 }) {
|
|
178
|
+
const c = C("https://support.access-ci.org/access_news/api", {
|
|
179
|
+
defaultValue: []
|
|
180
|
+
});
|
|
181
|
+
if (!(!c || c.error || !c.length))
|
|
182
|
+
return /* @__PURE__ */ e("section", { id: "resource-news", children: [
|
|
183
|
+
/* @__PURE__ */ e("h2", { children: "Resource News" }),
|
|
184
|
+
/* @__PURE__ */ e("ul", { class: "resource-news", children: c.slice(0, r).map(({ title: n, linkUrl: t }) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e("a", { href: t, class: "news-link", children: n.replace("&", "&").replace(" ", " ") }) })) })
|
|
185
|
+
] });
|
|
186
|
+
}
|
|
187
|
+
function P({ baseUri: r, title: c, showTitle: n }) {
|
|
188
|
+
const [t, a] = f([]), s = v(), i = y(
|
|
189
|
+
() => s ? k(s, t) : null,
|
|
190
|
+
[s, t]
|
|
191
|
+
), o = (l) => a(
|
|
192
|
+
t.includes(l) ? t.filter((h) => h != l) : [...t, l]
|
|
193
|
+
), d = () => a([]);
|
|
194
|
+
return /* @__PURE__ */ e(p, { children: [
|
|
195
|
+
c && /* @__PURE__ */ e("h1", { class: n ? "" : "visually-hidden", children: c }),
|
|
196
|
+
/* @__PURE__ */ e("div", { id: "resource-navigation", children: [
|
|
197
|
+
/* @__PURE__ */ e(T, {}),
|
|
198
|
+
/* @__PURE__ */ e(G, {})
|
|
199
|
+
] }),
|
|
200
|
+
/* @__PURE__ */ e("div", { id: "browse-resources", children: [
|
|
201
|
+
i ? /* @__PURE__ */ e(
|
|
202
|
+
A,
|
|
203
|
+
{
|
|
204
|
+
tagCategories: s.tagCategories,
|
|
205
|
+
active: i,
|
|
206
|
+
clearTags: d,
|
|
207
|
+
toggleTag: o
|
|
208
|
+
}
|
|
209
|
+
) : null,
|
|
210
|
+
s ? s.resourceCategories.filter(
|
|
211
|
+
({ resourceCategoryId: l }) => i.resourceCategoryIds.has(l)
|
|
212
|
+
).map((l) => /* @__PURE__ */ e(
|
|
213
|
+
S,
|
|
214
|
+
{
|
|
215
|
+
...l,
|
|
216
|
+
active: i,
|
|
217
|
+
baseUri: r,
|
|
218
|
+
clearTags: d,
|
|
219
|
+
toggleTag: o
|
|
220
|
+
}
|
|
221
|
+
)) : null
|
|
222
|
+
] })
|
|
223
|
+
] });
|
|
224
|
+
}
|
|
225
|
+
export {
|
|
226
|
+
P as default
|
|
227
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@access-ci/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0-beta2",
|
|
4
4
|
"description": "User interface components for ACCESS CI",
|
|
5
5
|
"repository": "github:access-ci-org/access-ci-ui",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -22,7 +22,12 @@
|
|
|
22
22
|
"preview": "vite preview"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"
|
|
25
|
+
"@glidejs/glide": "^3.6.1",
|
|
26
|
+
"chart.js": "^4.4.6",
|
|
27
|
+
"fuse.js": "^7.0.0",
|
|
28
|
+
"preact": "^10.24.1",
|
|
29
|
+
"preact-iso": "^2.6.3",
|
|
30
|
+
"tippy.js": "^6.3.7"
|
|
26
31
|
},
|
|
27
32
|
"devDependencies": {
|
|
28
33
|
"@preact/preset-vite": "^2.9.1",
|