@seamapi/react 1.44.0 → 1.45.1

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.
Files changed (34) hide show
  1. package/README.md +1 -1
  2. package/dist/elements.js +79 -75
  3. package/dist/elements.js.map +1 -1
  4. package/dist/index.css +16 -0
  5. package/dist/index.css.map +1 -1
  6. package/dist/index.min.css +1 -1
  7. package/dist/index.min.css.map +1 -1
  8. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.d.ts +2 -1
  9. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js +2 -1
  10. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js.map +1 -1
  11. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.d.ts +2 -1
  12. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js +12 -11
  13. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js.map +1 -1
  14. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.d.ts +2 -1
  15. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js +3 -3
  16. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js.map +1 -1
  17. package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.d.ts +2 -1
  18. package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js +11 -6
  19. package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js.map +1 -1
  20. package/lib/ui/thermostat/ClimateSettingStatus.d.ts +9 -0
  21. package/lib/ui/thermostat/ClimateSettingStatus.js +33 -0
  22. package/lib/ui/thermostat/ClimateSettingStatus.js.map +1 -0
  23. package/lib/version.d.ts +1 -1
  24. package/lib/version.js +1 -1
  25. package/package.json +1 -1
  26. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.tsx +3 -0
  27. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.tsx +18 -13
  28. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.element.ts +1 -0
  29. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.tsx +4 -0
  30. package/src/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.ts +11 -8
  31. package/src/lib/ui/thermostat/ClimateSettingStatus.tsx +88 -0
  32. package/src/lib/version.ts +1 -1
  33. package/src/styles/_main.scss +2 -0
  34. package/src/styles/_thermostat.scss +21 -0
package/README.md CHANGED
@@ -78,7 +78,7 @@ export function App() {
78
78
  <seam-device-table publishable-key="your_publishable_key"></seam-device-table>
79
79
  <script
80
80
  type="module"
81
- src="https://react.seam.co/v/1.44.0/dist/elements.js"
81
+ src="https://react.seam.co/v/1.45.1/dist/elements.js"
82
82
  ></script>
83
83
  </body>
84
84
  ```
package/dist/elements.js CHANGED
@@ -8098,7 +8098,7 @@ const Fm = "https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;60
8098
8098
  const n = globalThis.document.createElement("link");
8099
8099
  n.rel = "stylesheet", n.type = "text/css", n.href = Fm, globalThis.document.head.appendChild(n);
8100
8100
  }, [t]);
8101
- }, OO = "1.44.0", xO = "https://react.seam.co", CO = ({
8101
+ }, OO = "1.45.1", xO = "https://react.seam.co", CO = ({
8102
8102
  disabled: t = !1,
8103
8103
  unminified: e = !1
8104
8104
  }) => {
@@ -26371,33 +26371,34 @@ function OS(t) {
26371
26371
  const cz = ({
26372
26372
  filterValue: t,
26373
26373
  filters: e,
26374
- brands: n
26374
+ brands: n,
26375
+ excludedBrands: r
26375
26376
  }) => {
26376
- var o;
26377
- const r = {};
26378
- t.trim() !== "" && (r.text_search = t.trim()), e.supportedOnly && (r.support_level = "live"), e.brand !== null && (r.brand = e.brand);
26379
- const i = OS(r);
26380
- return n === null ? i : {
26381
- ...i,
26382
- deviceModels: (o = i.deviceModels) == null ? void 0 : o.filter(
26383
- (s) => n.includes(s.brand)
26384
- )
26377
+ var s;
26378
+ const i = {};
26379
+ t.trim() !== "" && (i.text_search = t.trim()), e.supportedOnly && (i.support_level = "live"), e.brand !== null && (i.brand = e.brand);
26380
+ const o = OS(i);
26381
+ return {
26382
+ ...o,
26383
+ deviceModels: (s = o.deviceModels) == null ? void 0 : s.filter(({ brand: l }) => n === null ? !0 : n.includes(l)).filter(({ brand: l }) => !r.includes(l))
26385
26384
  };
26386
26385
  };
26387
26386
  function pz({
26388
26387
  resetFilterValue: t,
26389
26388
  filterValue: e,
26390
26389
  filters: n,
26391
- brands: r
26390
+ brands: r,
26391
+ excludedBrands: i
26392
26392
  }) {
26393
- const { deviceModels: i, isLoading: o, isError: s, refetch: l } = cz(
26393
+ const { deviceModels: o, isLoading: s, isError: l, refetch: c } = cz(
26394
26394
  {
26395
26395
  filterValue: e,
26396
26396
  filters: n,
26397
- brands: r
26397
+ brands: r,
26398
+ excludedBrands: i
26398
26399
  }
26399
26400
  );
26400
- return o ? /* @__PURE__ */ f.jsx("div", { className: "seam-supported-device-table-content-state-block", children: /* @__PURE__ */ f.jsx("p", { children: si.loading }) }) : s ? /* @__PURE__ */ f.jsxs("div", { className: "seam-supported-device-table-content-state-block", children: [
26401
+ return s ? /* @__PURE__ */ f.jsx("div", { className: "seam-supported-device-table-content-state-block", children: /* @__PURE__ */ f.jsx("p", { children: si.loading }) }) : l ? /* @__PURE__ */ f.jsxs("div", { className: "seam-supported-device-table-content-state-block", children: [
26401
26402
  /* @__PURE__ */ f.jsx("p", { children: si.error }),
26402
26403
  /* @__PURE__ */ f.jsx(
26403
26404
  Dt,
@@ -26405,37 +26406,37 @@ function pz({
26405
26406
  variant: "solid",
26406
26407
  size: "small",
26407
26408
  onClick: () => {
26408
- l();
26409
+ c();
26409
26410
  },
26410
26411
  children: si.retry
26411
26412
  }
26412
26413
  )
26413
- ] }) : i == null ? null : i.length === 0 ? /* @__PURE__ */ f.jsx("div", { className: "seam-supported-device-table-content", children: /* @__PURE__ */ f.jsx(
26414
+ ] }) : o == null ? null : o.length === 0 ? /* @__PURE__ */ f.jsx("div", { className: "seam-supported-device-table-content", children: /* @__PURE__ */ f.jsx(
26414
26415
  fz,
26415
26416
  {
26416
26417
  filterValue: e,
26417
26418
  resetFilterValue: t
26418
26419
  }
26419
- ) }) : e.trim() !== "" || n.brand !== null ? /* @__PURE__ */ f.jsx("div", { className: "seam-supported-device-table-content", children: i.map((u, p) => /* @__PURE__ */ f.jsx(
26420
+ ) }) : e.trim() !== "" || n.brand !== null ? /* @__PURE__ */ f.jsx("div", { className: "seam-supported-device-table-content", children: o.map((p, d) => /* @__PURE__ */ f.jsx(
26420
26421
  uz,
26421
26422
  {
26422
- deviceModel: u
26423
+ deviceModel: p
26423
26424
  },
26424
26425
  [
26425
- u.main_category,
26426
- u.brand,
26427
- u.model_name,
26428
- u.manufacturer_model_id,
26429
- p
26426
+ p.main_category,
26427
+ p.brand,
26428
+ p.model_name,
26429
+ p.manufacturer_model_id,
26430
+ d
26430
26431
  ].join(":")
26431
- )) }) : /* @__PURE__ */ f.jsx(f.Fragment, { children: Object.entries(hz(i)).map(
26432
- ([u, p]) => /* @__PURE__ */ f.jsx(
26432
+ )) }) : /* @__PURE__ */ f.jsx(f.Fragment, { children: Object.entries(hz(o)).map(
26433
+ ([p, d]) => /* @__PURE__ */ f.jsx(
26433
26434
  sz,
26434
26435
  {
26435
- brand: u,
26436
- deviceModels: p
26436
+ brand: p,
26437
+ deviceModels: d
26437
26438
  },
26438
- u
26439
+ p
26439
26440
  )
26440
26441
  ) });
26441
26442
  }
@@ -26537,52 +26538,53 @@ function bz({
26537
26538
  setFilterValue: e,
26538
26539
  filters: n,
26539
26540
  setFilters: r,
26540
- brands: i
26541
+ brands: i,
26542
+ excludedBrands: o
26541
26543
  }) {
26542
- const o = Sz(n), s = Az(i), l = (u) => {
26543
- r((p) => ({
26544
- ...p,
26545
- [u]: null
26544
+ const s = Sz(n), l = Az(i, o), c = (p) => {
26545
+ r((d) => ({
26546
+ ...d,
26547
+ [p]: null
26546
26548
  }));
26547
- }, c = o > 0 ? `${ea.filters} (${o})` : ea.filter, a = ea.all;
26549
+ }, a = s > 0 ? `${ea.filters} (${s})` : ea.filter, u = ea.all;
26548
26550
  return /* @__PURE__ */ f.jsxs("div", { className: "seam-supported-device-table-filter-area", children: [
26549
26551
  /* @__PURE__ */ f.jsx("div", { className: "seam-deliberate-block" }),
26550
26552
  /* @__PURE__ */ f.jsxs("div", { className: "seam-filters-wrap", children: [
26551
26553
  /* @__PURE__ */ f.jsx(
26552
26554
  vh,
26553
26555
  {
26554
- renderButton: ({ onOpen: u }) => /* @__PURE__ */ f.jsx(
26556
+ renderButton: ({ onOpen: p }) => /* @__PURE__ */ f.jsx(
26555
26557
  Dt,
26556
26558
  {
26557
26559
  variant: "outline",
26558
26560
  className: "seam-filters-button",
26559
- onClick: u,
26560
- children: c
26561
+ onClick: p,
26562
+ children: a
26561
26563
  }
26562
26564
  ),
26563
26565
  children: /* @__PURE__ */ f.jsxs(
26564
26566
  "div",
26565
26567
  {
26566
26568
  className: "seam-supported-device-table-filter-menu",
26567
- onClick: (u) => {
26568
- u.stopPropagation();
26569
+ onClick: (p) => {
26570
+ p.stopPropagation();
26569
26571
  },
26570
26572
  children: [
26571
26573
  /* @__PURE__ */ f.jsx("div", { className: "seam-filter-menu-row", children: /* @__PURE__ */ f.jsx(
26572
26574
  yz,
26573
26575
  {
26574
26576
  label: ea.brand,
26575
- allLabel: a,
26576
- options: s,
26577
- onSelect: (u) => {
26578
- r((p) => ({
26579
- ...p,
26580
- brand: u
26577
+ allLabel: u,
26578
+ options: l,
26579
+ onSelect: (p) => {
26580
+ r((d) => ({
26581
+ ...d,
26582
+ brand: p
26581
26583
  }));
26582
26584
  },
26583
- buttonLabel: n.brand ?? a,
26585
+ buttonLabel: n.brand ?? u,
26584
26586
  onAllOptionSelect: () => {
26585
- l("brand");
26587
+ c("brand");
26586
26588
  }
26587
26589
  }
26588
26590
  ) }),
@@ -26601,10 +26603,10 @@ function bz({
26601
26603
  type: "checkbox",
26602
26604
  className: "seam-filter-checkbox",
26603
26605
  checked: n.supportedOnly,
26604
- onChange: (u) => {
26605
- r((p) => ({
26606
- ...p,
26607
- supportedOnly: u.target.checked
26606
+ onChange: (p) => {
26607
+ r((d) => ({
26608
+ ...d,
26609
+ supportedOnly: p.target.checked
26608
26610
  }));
26609
26611
  }
26610
26612
  }
@@ -26621,8 +26623,8 @@ function bz({
26621
26623
  bh,
26622
26624
  {
26623
26625
  value: t,
26624
- onChange: (u) => {
26625
- e(u);
26626
+ onChange: (p) => {
26627
+ e(p);
26626
26628
  },
26627
26629
  className: "seam-supported-device-table-filter-area-search-bar"
26628
26630
  }
@@ -26633,14 +26635,12 @@ function bz({
26633
26635
  const Sz = (t) => {
26634
26636
  let e = 0;
26635
26637
  return t.brand !== null && e++, t.supportedOnly || e++, e;
26636
- }, Az = (t) => {
26637
- const { deviceModels: e } = OS();
26638
- if (e == null)
26638
+ }, Az = (t, e) => {
26639
+ const { deviceModels: n } = OS();
26640
+ if (n == null)
26639
26641
  return [];
26640
- const n = /* @__PURE__ */ new Set();
26641
- for (const r of e)
26642
- r.brand.trim() !== "" && n.add(r.brand);
26643
- return Array.from(n).filter((r) => t === null ? !0 : t.includes(r)).map((r) => vz(r));
26642
+ const r = n.map(({ brand: i }) => i.trim()).filter((i) => i !== "").filter((i) => t === null ? !0 : t.includes(i)).filter((i) => !e.includes(i)).map((i) => vz(i));
26643
+ return Array.from(new Set(r));
26644
26644
  }, ea = {
26645
26645
  all: "All",
26646
26646
  brand: "Brand",
@@ -26652,39 +26652,42 @@ function wz({
26652
26652
  disableFilter: t = !1,
26653
26653
  cannotFilter: e,
26654
26654
  brands: n = null,
26655
- className: r
26655
+ excludedBrands: r = [],
26656
+ className: i
26656
26657
  } = {}) {
26657
- const [i, o] = P.useState(""), [s, l] = P.useState({
26658
+ const [o, s] = P.useState(""), [l, c] = P.useState({
26658
26659
  supportedOnly: !0,
26659
26660
  brand: null
26660
- }), c = e ?? t;
26661
+ }), a = e ?? t;
26661
26662
  return /* @__PURE__ */ f.jsxs(
26662
26663
  "div",
26663
26664
  {
26664
26665
  className: J(
26665
26666
  "seam-supported-device-table-content-wrap",
26666
- r
26667
+ i
26667
26668
  ),
26668
26669
  children: [
26669
- !c && /* @__PURE__ */ f.jsx(
26670
+ !a && /* @__PURE__ */ f.jsx(
26670
26671
  bz,
26671
26672
  {
26672
- filterValue: i,
26673
- setFilterValue: o,
26674
- filters: s,
26675
- setFilters: l,
26676
- brands: n
26673
+ filterValue: o,
26674
+ setFilterValue: s,
26675
+ filters: l,
26676
+ setFilters: c,
26677
+ brands: n,
26678
+ excludedBrands: r
26677
26679
  }
26678
26680
  ),
26679
26681
  /* @__PURE__ */ f.jsx(
26680
26682
  pz,
26681
26683
  {
26682
26684
  resetFilterValue: () => {
26683
- o("");
26685
+ s("");
26684
26686
  },
26685
- filterValue: i,
26686
- filters: s,
26687
- brands: n
26687
+ filterValue: o,
26688
+ filters: l,
26689
+ brands: n,
26690
+ excludedBrands: r
26688
26691
  }
26689
26692
  )
26690
26693
  ]
@@ -26695,6 +26698,7 @@ const Ez = "seam-supported-device-table", Oz = {
26695
26698
  cannotFilter: "boolean",
26696
26699
  disableFilter: "boolean",
26697
26700
  brands: "array",
26701
+ excludedBrands: "array",
26698
26702
  className: "string"
26699
26703
  }, xz = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
26700
26704
  __proto__: null,