@ed.yakovich/example-component-library-equipment-summary 1.0.4 → 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.
@@ -2,20 +2,20 @@ 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
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 = () => ({
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: n } = i();
9
- return p ? null : /* @__PURE__ */ e("span", { "data-component-id": `Icon--${t}`, children: /* @__PURE__ */ e("i", { className: `fas ${n}` }) });
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
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 = () => ({
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
13
  labelVal: h || d,
14
14
  descriptionVal: V || r,
15
- labelSecondaryVal: f || m,
16
- onClickVal: x || i,
17
- collapsedVal: !!(y || p)
18
- }), { isHiddenVal: k, labelVal: b, descriptionVal: C, labelSecondaryVal: l, onClickVal: u, collapsedVal: g } = N();
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
  {
@@ -24,7 +24,7 @@ const S = w({}), z = () => A(S), H = (a) => {
24
24
  children: /* @__PURE__ */ o(
25
25
  "details",
26
26
  {
27
- ...!g && open,
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: [
@@ -57,13 +57,13 @@ const S = w({}), z = () => A(S), H = (a) => {
57
57
  description: d = "",
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
+ } = 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: n || c,
62
+ headingVal: i || c,
63
63
  descriptionVal: v || d,
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) => {
66
+ }), { isHiddenVal: f, headingVal: y, descriptionVal: N, isLoadingVal: k, equipmentListVal: b } = x(), C = (l) => {
67
67
  switch (l) {
68
68
  case "return":
69
69
  return "bg-[#bd0000]";
@@ -73,17 +73,17 @@ const S = w({}), z = () => A(S), H = (a) => {
73
73
  return "bg-[#cc7700]";
74
74
  }
75
75
  };
76
- return x ? null : /* @__PURE__ */ e(
76
+ return f ? null : /* @__PURE__ */ e(
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
- collapsed: !1,
86
+ open: !0,
87
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
88
  /* @__PURE__ */ o("div", { className: "@xs/equipmentsummary:flex @xs/equipmentsummary:justify-between", children: [
89
89
  /* @__PURE__ */ o("div", { className: "flex gap-2", children: [
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.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.3"
48
+ "@ed.yakovich/example-component-library-accordion": "^1.0.4"
49
49
  }
50
50
  }