@ed.yakovich/example-component-library-equipment-summary 1.0.4 → 1.0.5

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.
@@ -1,37 +1,37 @@
1
- import { jsx as e, jsxs as o } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as a } 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 = (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) || "", i = () => ({
4
+ const S = w({}), z = () => A(S), H = (o) => {
5
+ const { isHidden: s, componentId: t = "", icon: c = "" } = o, l = z(), r = l == null ? void 0 : l.isHidden, m = (l == null ? void 0 : l.icon) || "", i = () => ({
6
6
  isHiddenVal: r || s,
7
7
  iconVal: m || c
8
8
  }), { isHiddenVal: p, iconVal: n } = i();
9
9
  return p ? null : /* @__PURE__ */ e("span", { "data-component-id": `Icon--${t}`, children: /* @__PURE__ */ e("i", { className: `fas ${n}` }) });
10
- }, j = w({}), I = () => A(j), E = (a) => {
11
- const { children: s, isHidden: t, componentId: c = "", label: d = "", description: r = "", labelSecondary: m = "", onClick: i, collapsed: p = !1 } = a, n = I(), v = n == null ? void 0 : n.isHidden, h = (n == null ? void 0 : n.label) || "", V = (n == null ? void 0 : n.description) || "", f = (n == null ? void 0 : n.labelSecondary) || "", x = (n == null ? void 0 : n.onClick) || "", y = n == null ? void 0 : n.collapsed, N = () => ({
10
+ }, j = w({}), I = () => A(j), E = (o) => {
11
+ const { children: s, isHidden: t, componentId: c = "", label: l = "", description: r = "", labelSecondary: m = "", onClick: i, collapsed: p = !1 } = o, n = I(), v = n == null ? void 0 : n.isHidden, h = (n == null ? void 0 : n.label) || "", V = (n == null ? void 0 : n.description) || "", f = (n == null ? void 0 : n.labelSecondary) || "", x = (n == null ? void 0 : n.onClick) || "", y = n == null ? void 0 : n.collapsed, N = () => ({
12
12
  isHiddenVal: v || t,
13
- labelVal: h || d,
13
+ labelVal: h || l,
14
14
  descriptionVal: V || r,
15
15
  labelSecondaryVal: f || m,
16
16
  onClickVal: x || i,
17
17
  collapsedVal: !!(y || p)
18
- }), { isHiddenVal: k, labelVal: b, descriptionVal: C, labelSecondaryVal: l, onClickVal: u, collapsedVal: g } = N();
18
+ }), { isHiddenVal: k, labelVal: b, descriptionVal: C, labelSecondaryVal: d, onClickVal: u, collapsedVal: 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__ */ o(
24
+ children: /* @__PURE__ */ a(
25
25
  "details",
26
26
  {
27
27
  ...!g && open,
28
28
  "data-component-id": "Accordion",
29
29
  className: "rounded-lg border-solid border-3 border-blue-500",
30
30
  children: [
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: [
31
+ /* @__PURE__ */ a("summary", { onClick: u, "data-component-id": "Accordion--trigger", className: "cursor-pointer p-6", children: [
32
+ /* @__PURE__ */ a("div", { className: "flex justify-between", children: [
33
33
  /* @__PURE__ */ e("div", { className: "text-xl font-bold", children: b }),
34
- l && /* @__PURE__ */ e("div", { className: "text-sm", children: l })
34
+ d && /* @__PURE__ */ e("div", { className: "text-sm", children: d })
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 = (a) => {
49
49
  )
50
50
  }
51
51
  );
52
- }, F = (a) => {
52
+ }, F = (o) => {
53
53
  const {
54
54
  isHidden: s,
55
55
  componentId: t = "",
56
56
  heading: c = "",
57
- description: d = "",
57
+ description: l = "",
58
58
  isLoading: r = !1,
59
59
  equipmentList: m = []
60
- } = a, i = $(), p = i == null ? void 0 : i.isHidden, n = (i == null ? void 0 : i.heading) || "", v = (i == null ? void 0 : i.description) || "", h = (i == null ? void 0 : i.equipmentList) || [], V = (i == null ? void 0 : i.isLoading) || "", f = () => ({
60
+ } = o, i = $(), p = i == null ? void 0 : i.isHidden, n = (i == null ? void 0 : i.heading) || "", v = (i == null ? void 0 : i.description) || "", h = (i == null ? void 0 : i.equipmentList) || [], V = (i == null ? void 0 : i.isLoading) || "", f = () => ({
61
61
  isHiddenVal: p || s,
62
62
  headingVal: n || c,
63
- descriptionVal: v || d,
63
+ descriptionVal: v || l,
64
64
  isLoadingVal: V || r,
65
65
  equipmentListVal: h.length > 0 ? h : m
66
- }), { isHiddenVal: x, headingVal: y, descriptionVal: N, isLoadingVal: k, equipmentListVal: b } = f(), C = (l) => {
67
- switch (l) {
66
+ }), { isHiddenVal: x, headingVal: y, descriptionVal: N, isLoadingVal: k, equipmentListVal: b } = f(), C = (d) => {
67
+ switch (d) {
68
68
  case "return":
69
69
  return "bg-[#bd0000]";
70
70
  case "keep":
@@ -77,20 +77,20 @@ const S = w({}), z = () => A(S), H = (a) => {
77
77
  "div",
78
78
  {
79
79
  "data-component-id": `EquipmentSummary--${t}`,
80
- className: "border-3 border-blue-500 border-solid rounded-lg p-2 @container/equipmentsummary",
80
+ className: "@container/equipmentsummary",
81
81
  children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
82
82
  E,
83
83
  {
84
84
  label: y,
85
85
  description: N,
86
86
  collapsed: !1,
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 }),
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: d, title: u, description: g, actionType: q }, L) => /* @__PURE__ */ a("li", { children: [
88
+ /* @__PURE__ */ a("div", { className: "@xs/equipmentsummary:flex @xs/equipmentsummary:justify-between", children: [
89
+ /* @__PURE__ */ a("div", { className: "flex gap-2", children: [
90
+ d && /* @__PURE__ */ e(H, { icon: d }),
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__ */ o("div", { className: "flex gap-1 items-center", children: [
93
+ q && /* @__PURE__ */ e("div", { className: "ml-8 mb-2 @xs/equipmentsummary:ml-0 @xs/equipmentsummary:mb-0", children: /* @__PURE__ */ a("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.4",
5
+ "version": "1.0.5",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  ".": {