@access-ci/ui 0.8.0 → 0.9.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.
@@ -0,0 +1,260 @@
1
+ import { u as e, b as g, h as f, A as C, a as w, o as S, T as k, r as A, n as R, Q as I } from "./index-0rhVaqkH.js";
2
+ import { I as h } from "./icon-oSIQXq5R.js";
3
+ const T = {
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
+ "Service / Other": "stars",
16
+ "Storage Resources": "hdd-fill",
17
+ "Virtual Machines": "pc-display-horizontal",
18
+ Cloud: "cloud",
19
+ Storage: "hdd-fill"
20
+ };
21
+ function b({ active: s, tagCategory: o, tagId: a, iconUri: n, name: r, toggleTag: t }) {
22
+ const c = n || T[r] || "tag";
23
+ return /* @__PURE__ */ e(
24
+ "li",
25
+ {
26
+ class: `tag tag-category-${o.name.toLowerCase().replace(/[^a-z]+/g, "-")}${s.tagIds.has(a) ? " active" : ""}`,
27
+ children: /* @__PURE__ */ e(
28
+ "button",
29
+ {
30
+ href: "#",
31
+ disabled: s.disabledTagIds.has(a),
32
+ onClick: (i) => {
33
+ i.preventDefault(), t(a);
34
+ },
35
+ children: [
36
+ c.startsWith("http") ? /* @__PURE__ */ e(h, { alt: r, src: c }) : /* @__PURE__ */ e(h, { name: c }),
37
+ r
38
+ ]
39
+ }
40
+ )
41
+ }
42
+ );
43
+ }
44
+ function v({ children: s }) {
45
+ return /* @__PURE__ */ e("ul", { class: "tags", children: s });
46
+ }
47
+ function E({
48
+ active: s,
49
+ baseUri: o,
50
+ description: a,
51
+ imageType: n,
52
+ imageUri: r,
53
+ name: t,
54
+ infoGroupId: c,
55
+ tags: i,
56
+ toggleTag: l
57
+ }) {
58
+ const u = `${o}/${c}`;
59
+ return /* @__PURE__ */ e("div", { class: "resource-group", children: [
60
+ /* @__PURE__ */ e(
61
+ "a",
62
+ {
63
+ class: `resource-group-image image-type-${n}`,
64
+ href: u,
65
+ children: r ? /* @__PURE__ */ e("img", { src: r }) : /* @__PURE__ */ e(h, { name: "motherboard" })
66
+ }
67
+ ),
68
+ /* @__PURE__ */ e("div", { class: "resource-group-text", children: [
69
+ /* @__PURE__ */ e("h3", { children: /* @__PURE__ */ e("a", { href: u, children: t }) }),
70
+ /* @__PURE__ */ e(v, { children: i.map((p) => /* @__PURE__ */ e(b, { ...p, active: s, toggleTag: l })) }),
71
+ /* @__PURE__ */ e("p", { children: [
72
+ a && a,
73
+ /* @__PURE__ */ e("br", {}),
74
+ /* @__PURE__ */ e("a", { href: u, children: [
75
+ "Learn more about ",
76
+ t,
77
+ " »"
78
+ ] })
79
+ ] })
80
+ ] })
81
+ ] });
82
+ }
83
+ function G({
84
+ active: s,
85
+ baseUri: o,
86
+ name: a,
87
+ resourceGroups: n,
88
+ toggleTag: r
89
+ }) {
90
+ return /* @__PURE__ */ e(g, { children: [
91
+ /* @__PURE__ */ e("h2", { children: a }),
92
+ n.filter(({ infoGroupId: t }) => s.infoGroupIds.has(t)).map((t) => /* @__PURE__ */ e(
93
+ E,
94
+ {
95
+ ...t,
96
+ baseUri: o,
97
+ active: s,
98
+ toggleTag: r
99
+ }
100
+ ))
101
+ ] });
102
+ }
103
+ function O({
104
+ active: s,
105
+ clearTags: o,
106
+ tagCategories: a,
107
+ toggleTag: n
108
+ }) {
109
+ const [r, t] = f(!1), c = C(null);
110
+ return w(() => {
111
+ c.current && (c.current.addEventListener("click", (i) => i.stopPropagation()), document.body.addEventListener("click", () => t(!1)));
112
+ }, [c.current]), /* @__PURE__ */ e("section", { class: "filters-outer", ref: c, children: [
113
+ /* @__PURE__ */ e(
114
+ "button",
115
+ {
116
+ onClick: () => t(!r),
117
+ class: `btn-filters btn ${r ? "active" : ""}`,
118
+ children: [
119
+ /* @__PURE__ */ e(h, { name: "filter" }),
120
+ " Filters",
121
+ s.tagIds.size > 0 ? /* @__PURE__ */ e("span", { class: "active-tag-count", children: s.tagIds.size }) : null
122
+ ]
123
+ }
124
+ ),
125
+ r ? /* @__PURE__ */ e("div", { class: "filters-inner", children: [
126
+ a.map((i) => /* @__PURE__ */ e(g, { children: [
127
+ /* @__PURE__ */ e("h2", { children: i.name }),
128
+ /* @__PURE__ */ e(v, { children: i.tags.map((l) => /* @__PURE__ */ e(b, { ...l, active: s, toggleTag: n })) })
129
+ ] })),
130
+ /* @__PURE__ */ e(
131
+ "button",
132
+ {
133
+ onClick: o,
134
+ disabled: s.tagIds.size == 0,
135
+ class: "btn danger",
136
+ children: [
137
+ /* @__PURE__ */ e(h, { name: "trash" }),
138
+ " Clear Filters"
139
+ ]
140
+ }
141
+ )
142
+ ] }) : null
143
+ ] });
144
+ }
145
+ function $({ setBotOpen: s }) {
146
+ const o = C(null);
147
+ return /* @__PURE__ */ e("section", { id: "resource-pathways", ref: o, children: [
148
+ /* @__PURE__ */ e("p", { class: "intro", children: [
149
+ "ACCESS provides advanced computing resources ",
150
+ /* @__PURE__ */ e("strong", { children: "at no cost" }),
151
+ " ",
152
+ "to researchers and educators."
153
+ ] }),
154
+ /* @__PURE__ */ e("ul", { class: "resource-pathways", children: [
155
+ {
156
+ title: "Browse resources",
157
+ icon: "filter-square",
158
+ description: "Filter resources to find the best match for your research.",
159
+ onClick: (n) => {
160
+ n.preventDefault(), o.current && o.current.nextSibling.scrollIntoView({ bahavior: "smooth" });
161
+ }
162
+ },
163
+ {
164
+ title: "Ask a question",
165
+ icon: "question-circle",
166
+ onClick: (n) => {
167
+ n.preventDefault(), s(!0);
168
+ },
169
+ description: "You have resource questions. Our Q&A bot has answers!",
170
+ login: !0
171
+ },
172
+ {
173
+ title: "Get suggestions",
174
+ icon: "card-checklist",
175
+ href: "https://access-ara.ccs.uky.edu:8080/",
176
+ description: "Fill out a form to get resource recommendations."
177
+ },
178
+ {
179
+ title: "Read news",
180
+ icon: "newspaper",
181
+ href: "https://access-ci.org/tag/resource-providers/",
182
+ description: "See the latest news from resource providers."
183
+ }
184
+ ].map(
185
+ ({ title: n, icon: r, href: t, description: c, login: i, onClick: l }, u) => /* @__PURE__ */ e("li", { class: `resource-pathway-${u}`, children: /* @__PURE__ */ e("a", { href: t || "#", onClick: l, children: [
186
+ r ? /* @__PURE__ */ e(h, { name: r }) : null,
187
+ " ",
188
+ /* @__PURE__ */ e("span", { class: "detail", children: [
189
+ /* @__PURE__ */ e("span", { class: "title", children: n }),
190
+ /* @__PURE__ */ e("span", { class: "description", children: c }),
191
+ i ? /* @__PURE__ */ e("span", { class: "login", children: [
192
+ /* @__PURE__ */ e(h, { name: "key" }),
193
+ " Requires ACCESS Login"
194
+ ] }) : null
195
+ ] })
196
+ ] }) })
197
+ ) })
198
+ ] });
199
+ }
200
+ function P({
201
+ baseUri: s,
202
+ title: o,
203
+ showBreadcrumbs: a = !0,
204
+ showTitle: n = !0
205
+ }) {
206
+ const [r, t] = f([]), [c, i] = f(!1), l = S(), u = k(
207
+ () => l ? A(l, r) : null,
208
+ [l, r]
209
+ ), p = (d) => t(
210
+ r.includes(d) ? r.filter((y) => y != d) : [...r, d]
211
+ ), m = () => t([]);
212
+ return /* @__PURE__ */ e(g, { children: [
213
+ a && /* @__PURE__ */ e(
214
+ R,
215
+ {
216
+ expandWidth: !0,
217
+ items: [{ name: "Resources" }],
218
+ topBorder: !0
219
+ }
220
+ ),
221
+ o && /* @__PURE__ */ e("h1", { class: n ? "" : "visually-hidden", children: o }),
222
+ /* @__PURE__ */ e($, { setBotOpen: i }),
223
+ /* @__PURE__ */ e("div", { id: "browse-resources", children: [
224
+ u ? /* @__PURE__ */ e(
225
+ O,
226
+ {
227
+ tagCategories: l.tagCategories,
228
+ active: u,
229
+ clearTags: m,
230
+ toggleTag: p
231
+ }
232
+ ) : null,
233
+ l ? l.resourceCategories.filter(
234
+ ({ resourceCategoryId: d }) => u.resourceCategoryIds.has(d)
235
+ ).map((d) => /* @__PURE__ */ e(
236
+ G,
237
+ {
238
+ ...d,
239
+ active: u,
240
+ baseUri: s,
241
+ clearTags: m,
242
+ toggleTag: p
243
+ }
244
+ )) : null
245
+ ] }),
246
+ /* @__PURE__ */ e(
247
+ I,
248
+ {
249
+ embedded: !1,
250
+ open: c,
251
+ onOpenChange: i,
252
+ welcome: "Welcome to the ACCESS Q&A Bot!",
253
+ apiKey: "my-api-key"
254
+ }
255
+ )
256
+ ] });
257
+ }
258
+ export {
259
+ P as default
260
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@access-ci/ui",
3
- "version": "0.8.0",
3
+ "version": "0.9.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",
@@ -23,7 +23,8 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@glidejs/glide": "^3.6.1",
26
- "@snf/access-qa-bot": "0.3.0",
26
+ "@preact/compat": "^18.3.1",
27
+ "@snf/access-qa-bot": "^2.3.1-beta.1",
27
28
  "chart.js": "^4.4.6",
28
29
  "fuse.js": "^7.0.0",
29
30
  "preact": "^10.24.1",