@ed.yakovich/example-component-library-equipment-summary 1.0.5 → 1.0.6
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/component/index.js +31 -31
- package/package.json +2 -2
package/dist/component/index.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
2
|
import { useEquipmentSummaryContext as $ } from "./context/index.js";
|
|
3
3
|
import { createContext as w, useContext as A } from "react";
|
|
4
|
-
const S = w({}), z = () => A(S), H = (
|
|
5
|
-
const { isHidden: s, componentId: t = "", icon: c = "" } =
|
|
4
|
+
const S = w({}), z = () => A(S), H = (a) => {
|
|
5
|
+
const { isHidden: s, componentId: t = "", icon: c = "" } = a, d = z(), r = d == null ? void 0 : d.isHidden, m = (d == null ? void 0 : d.icon) || "", n = () => ({
|
|
6
6
|
isHiddenVal: r || s,
|
|
7
7
|
iconVal: m || c
|
|
8
|
-
}), { isHiddenVal: p, iconVal:
|
|
9
|
-
return p ? null : /* @__PURE__ */ e("span", { "data-component-id": `Icon--${t}`, children: /* @__PURE__ */ e("i", { className: `fas ${
|
|
10
|
-
}, j = w({}), I = () => A(j), E = (
|
|
11
|
-
const { children: s, isHidden: t, componentId: c = "", label:
|
|
8
|
+
}), { isHiddenVal: p, iconVal: i } = n();
|
|
9
|
+
return p ? null : /* @__PURE__ */ e("span", { "data-component-id": `Icon--${t}`, children: /* @__PURE__ */ e("i", { className: `fas ${i}` }) });
|
|
10
|
+
}, j = w({}), I = () => A(j), E = (a) => {
|
|
11
|
+
const { children: s, isHidden: t, componentId: c = "", label: d = "", description: r = "", labelSecondary: m = "", onClick: n, open: p = !1 } = a, i = I(), v = i == null ? void 0 : i.isHidden, h = (i == null ? void 0 : i.label) || "", V = (i == null ? void 0 : i.description) || "", x = (i == null ? void 0 : i.labelSecondary) || "", f = (i == null ? void 0 : i.onClick) || "", y = i == null ? void 0 : i.open, N = () => ({
|
|
12
12
|
isHiddenVal: v || t,
|
|
13
|
-
labelVal: h ||
|
|
13
|
+
labelVal: h || d,
|
|
14
14
|
descriptionVal: V || r,
|
|
15
|
-
labelSecondaryVal:
|
|
16
|
-
onClickVal:
|
|
17
|
-
|
|
18
|
-
}), { isHiddenVal: k, labelVal: b, descriptionVal: C, labelSecondaryVal:
|
|
15
|
+
labelSecondaryVal: x || m,
|
|
16
|
+
onClickVal: f || n,
|
|
17
|
+
openVal: !!(y || p)
|
|
18
|
+
}), { isHiddenVal: k, labelVal: b, descriptionVal: C, labelSecondaryVal: l, onClickVal: u, openVal: g } = N();
|
|
19
19
|
return k ? null : /* @__PURE__ */ e(
|
|
20
20
|
"div",
|
|
21
21
|
{
|
|
22
22
|
"data-component-id": `Accordion-Parent--${c}`,
|
|
23
23
|
className: "@container/accordion",
|
|
24
|
-
children: /* @__PURE__ */
|
|
24
|
+
children: /* @__PURE__ */ o(
|
|
25
25
|
"details",
|
|
26
26
|
{
|
|
27
|
-
|
|
27
|
+
...g && { open: !0 },
|
|
28
28
|
"data-component-id": "Accordion",
|
|
29
29
|
className: "rounded-lg border-solid border-3 border-blue-500",
|
|
30
30
|
children: [
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */ o("summary", { onClick: u, "data-component-id": "Accordion--trigger", className: "cursor-pointer p-6", children: [
|
|
32
|
+
/* @__PURE__ */ o("div", { className: "flex justify-between", children: [
|
|
33
33
|
/* @__PURE__ */ e("div", { className: "text-xl font-bold", children: b }),
|
|
34
|
-
|
|
34
|
+
l && /* @__PURE__ */ e("div", { className: "text-sm", children: l })
|
|
35
35
|
] }),
|
|
36
36
|
/* @__PURE__ */ e("div", { className: "text-xs", children: C })
|
|
37
37
|
] }),
|
|
@@ -49,22 +49,22 @@ const S = w({}), z = () => A(S), H = (o) => {
|
|
|
49
49
|
)
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
|
-
}, F = (
|
|
52
|
+
}, F = (a) => {
|
|
53
53
|
const {
|
|
54
54
|
isHidden: s,
|
|
55
55
|
componentId: t = "",
|
|
56
56
|
heading: c = "",
|
|
57
|
-
description:
|
|
57
|
+
description: d = "",
|
|
58
58
|
isLoading: r = !1,
|
|
59
59
|
equipmentList: m = []
|
|
60
|
-
} =
|
|
60
|
+
} = a, n = $(), p = n == null ? void 0 : n.isHidden, i = (n == null ? void 0 : n.heading) || "", v = (n == null ? void 0 : n.description) || "", h = (n == null ? void 0 : n.equipmentList) || [], V = (n == null ? void 0 : n.isLoading) || "", x = () => ({
|
|
61
61
|
isHiddenVal: p || s,
|
|
62
|
-
headingVal:
|
|
63
|
-
descriptionVal: v ||
|
|
62
|
+
headingVal: i || c,
|
|
63
|
+
descriptionVal: v || d,
|
|
64
64
|
isLoadingVal: V || r,
|
|
65
65
|
equipmentListVal: h.length > 0 ? h : m
|
|
66
|
-
}), { isHiddenVal:
|
|
67
|
-
switch (
|
|
66
|
+
}), { isHiddenVal: f, headingVal: y, descriptionVal: N, isLoadingVal: k, equipmentListVal: b } = x(), C = (l) => {
|
|
67
|
+
switch (l) {
|
|
68
68
|
case "return":
|
|
69
69
|
return "bg-[#bd0000]";
|
|
70
70
|
case "keep":
|
|
@@ -73,7 +73,7 @@ const S = w({}), z = () => A(S), H = (o) => {
|
|
|
73
73
|
return "bg-[#cc7700]";
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
-
return
|
|
76
|
+
return f ? null : /* @__PURE__ */ e(
|
|
77
77
|
"div",
|
|
78
78
|
{
|
|
79
79
|
"data-component-id": `EquipmentSummary--${t}`,
|
|
@@ -83,14 +83,14 @@ const S = w({}), z = () => A(S), H = (o) => {
|
|
|
83
83
|
{
|
|
84
84
|
label: y,
|
|
85
85
|
description: N,
|
|
86
|
-
|
|
87
|
-
children: /* @__PURE__ */ e("div", { children: k ? /* @__PURE__ */ e("div", { className: "w-full mx-auto text-center", children: /* @__PURE__ */ e(H, { icon: "fa-spinner fa-pulse fa-lg" }) }) : /* @__PURE__ */ e("div", { children: b.length > 0 && /* @__PURE__ */ e("ul", { className: "space-y-4", children: b.map(({ icon:
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
|
|
86
|
+
open: !0,
|
|
87
|
+
children: /* @__PURE__ */ e("div", { children: k ? /* @__PURE__ */ e("div", { className: "w-full mx-auto text-center", children: /* @__PURE__ */ e(H, { icon: "fa-spinner fa-pulse fa-lg" }) }) : /* @__PURE__ */ e("div", { children: b.length > 0 && /* @__PURE__ */ e("ul", { className: "space-y-4", children: b.map(({ icon: l, title: u, description: g, actionType: q }, L) => /* @__PURE__ */ o("li", { children: [
|
|
88
|
+
/* @__PURE__ */ o("div", { className: "@xs/equipmentsummary:flex @xs/equipmentsummary:justify-between", children: [
|
|
89
|
+
/* @__PURE__ */ o("div", { className: "flex gap-2", children: [
|
|
90
|
+
l && /* @__PURE__ */ e(H, { icon: l }),
|
|
91
91
|
u && /* @__PURE__ */ e("span", { children: u })
|
|
92
92
|
] }),
|
|
93
|
-
q && /* @__PURE__ */ e("div", { className: "ml-8 mb-2 @xs/equipmentsummary:ml-0 @xs/equipmentsummary:mb-0", children: /* @__PURE__ */
|
|
93
|
+
q && /* @__PURE__ */ e("div", { className: "ml-8 mb-2 @xs/equipmentsummary:ml-0 @xs/equipmentsummary:mb-0", children: /* @__PURE__ */ o("div", { className: "flex gap-1 items-center", children: [
|
|
94
94
|
/* @__PURE__ */ e("div", { className: `w-[12px] h-[12px] rounded-full ${C(q)}` }),
|
|
95
95
|
/* @__PURE__ */ e("div", { children: q })
|
|
96
96
|
] }) })
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@ed.yakovich/example-component-library-equipment-summary",
|
|
3
3
|
"author": "Ed Yakovich",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.6",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
@@ -45,6 +45,6 @@
|
|
|
45
45
|
"vite-plugin-dts": "^4.2.1",
|
|
46
46
|
"vite-plugin-lib-inject-css": "^2.1.1",
|
|
47
47
|
"@ed.yakovich/example-component-library-icon": "^1.0.3",
|
|
48
|
-
"@ed.yakovich/example-component-library-accordion": "^1.0.
|
|
48
|
+
"@ed.yakovich/example-component-library-accordion": "^1.0.4"
|
|
49
49
|
}
|
|
50
50
|
}
|