@seamapi/react 1.12.0 → 1.13.0

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/elements.js CHANGED
@@ -8077,7 +8077,7 @@ const mm = "https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;60
8077
8077
  const n = globalThis.document.createElement("link");
8078
8078
  n.rel = "stylesheet", n.type = "text/css", n.href = mm, globalThis.document.head.appendChild(n);
8079
8079
  }, [t]);
8080
- }, NE = "1.12.0", HE = "https://react.seam.co", DE = ({
8080
+ }, NE = "1.13.0", HE = "https://react.seam.co", DE = ({
8081
8081
  disabled: t = !1,
8082
8082
  unminified: e = !1
8083
8083
  }) => {
@@ -24640,56 +24640,63 @@ function wT(t) {
24640
24640
  }
24641
24641
  function ET({
24642
24642
  deviceIds: t,
24643
- onBack: e,
24644
- className: n
24643
+ onDeviceClick: e,
24644
+ onBack: n,
24645
+ className: r
24645
24646
  } = {}) {
24646
- const { devices: r, isLoading: i, isError: o, error: s } = wT({
24647
+ const { devices: i, isLoading: o, isError: s, error: l } = wT({
24647
24648
  device_ids: t
24648
- }), [l, c] = k.useState(null), [a, u] = k.useState("");
24649
- if (l != null)
24649
+ }), [c, a] = k.useState(null), [u, p] = k.useState("");
24650
+ if (c != null)
24650
24651
  return /* @__PURE__ */ v.jsx(
24651
24652
  Wf,
24652
24653
  {
24653
- className: n,
24654
- deviceId: l,
24654
+ className: r,
24655
+ deviceId: c,
24655
24656
  onBack: () => {
24656
- c(null);
24657
+ a(null);
24657
24658
  }
24658
24659
  }
24659
24660
  );
24660
- if (i)
24661
- return /* @__PURE__ */ v.jsx("p", { className: n, children: "..." });
24662
24661
  if (o)
24663
- return /* @__PURE__ */ v.jsx("p", { className: n, children: s == null ? void 0 : s.message });
24664
- if (r == null)
24662
+ return /* @__PURE__ */ v.jsx("p", { className: r, children: "..." });
24663
+ if (s)
24664
+ return /* @__PURE__ */ v.jsx("p", { className: r, children: l == null ? void 0 : l.message });
24665
+ if (i == null)
24665
24666
  return null;
24666
- const p = r.length, d = r.filter((f) => a === "" ? !0 : new RegExp(a, "i").test(f.properties.name));
24667
- return /* @__PURE__ */ v.jsxs("div", { className: Re("seam-device-table", n), children: [
24668
- /* @__PURE__ */ v.jsx(nd, { onBack: e }),
24667
+ const d = i.length, f = i.filter((h) => u === "" ? !0 : new RegExp(u, "i").test(h.properties.name));
24668
+ return /* @__PURE__ */ v.jsxs("div", { className: Re("seam-device-table", r), children: [
24669
+ /* @__PURE__ */ v.jsx(nd, { onBack: n }),
24669
24670
  /* @__PURE__ */ v.jsxs(M1, { children: [
24670
24671
  /* @__PURE__ */ v.jsxs(j1, { children: [
24671
24672
  H1.devices,
24672
24673
  " ",
24673
24674
  /* @__PURE__ */ v.jsxs(z1, { children: [
24674
24675
  "(",
24675
- p,
24676
+ d,
24676
24677
  ")"
24677
24678
  ] })
24678
24679
  ] }),
24679
24680
  /* @__PURE__ */ v.jsx(
24680
24681
  Qf,
24681
24682
  {
24682
- value: a,
24683
- onChange: u,
24684
- disabled: p === 0
24683
+ value: u,
24684
+ onChange: p,
24685
+ disabled: d === 0
24685
24686
  }
24686
24687
  )
24687
24688
  ] }),
24688
- /* @__PURE__ */ v.jsx(x1, { children: /* @__PURE__ */ v.jsx(OT, { devices: d, selectDevice: c }) })
24689
+ /* @__PURE__ */ v.jsx(x1, { children: /* @__PURE__ */ v.jsx(
24690
+ OT,
24691
+ {
24692
+ devices: f,
24693
+ onDeviceClick: e ?? a
24694
+ }
24695
+ ) })
24689
24696
  ] });
24690
24697
  }
24691
24698
  function OT(t) {
24692
- const { devices: e, selectDevice: n } = t, [r, i] = k.useState(null);
24699
+ const { devices: e, onDeviceClick: n } = t, [r, i] = k.useState(null);
24693
24700
  if (e.length === 0)
24694
24701
  return /* @__PURE__ */ v.jsx(C1, { children: H1.noDevicesMessage });
24695
24702
  const o = e.filter((s) => r === null ? !0 : r === "device_issues" ? s.errors.length > 0 : !0);
@@ -24719,6 +24726,8 @@ const H1 = {
24719
24726
  unknownLock: "Unknown Lock",
24720
24727
  noDevicesMessage: "Sorry, no devices were found"
24721
24728
  }, IT = "seam-device-table", CT = {
24729
+ deviceIds: "json",
24730
+ onDeviceClick: "function",
24722
24731
  onBack: "function",
24723
24732
  className: "string"
24724
24733
  }, xT = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({