@seamapi/react 1.44.0 → 1.45.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.
Files changed (34) hide show
  1. package/README.md +1 -1
  2. package/dist/elements.js +80 -74
  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 +10 -12
  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 +3 -3
  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 +16 -14
  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 +5 -3
  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.0/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.0", xO = "https://react.seam.co", CO = ({
8102
8102
  disabled: t = !1,
8103
8103
  unminified: e = !1
8104
8104
  }) => {
@@ -26371,16 +26371,17 @@ 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)
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 n === null ? o : {
26382
+ ...o,
26383
+ deviceModels: (s = o.deviceModels) == null ? void 0 : s.filter(
26384
+ ({ brand: l }) => n.includes(l) && !r.includes(l)
26384
26385
  )
26385
26386
  };
26386
26387
  };
@@ -26388,16 +26389,18 @@ function pz({
26388
26389
  resetFilterValue: t,
26389
26390
  filterValue: e,
26390
26391
  filters: n,
26391
- brands: r
26392
+ brands: r,
26393
+ excludedBrands: i
26392
26394
  }) {
26393
- const { deviceModels: i, isLoading: o, isError: s, refetch: l } = cz(
26395
+ const { deviceModels: o, isLoading: s, isError: l, refetch: c } = cz(
26394
26396
  {
26395
26397
  filterValue: e,
26396
26398
  filters: n,
26397
- brands: r
26399
+ brands: r,
26400
+ excludedBrands: i
26398
26401
  }
26399
26402
  );
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: [
26403
+ 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
26404
  /* @__PURE__ */ f.jsx("p", { children: si.error }),
26402
26405
  /* @__PURE__ */ f.jsx(
26403
26406
  Dt,
@@ -26405,37 +26408,37 @@ function pz({
26405
26408
  variant: "solid",
26406
26409
  size: "small",
26407
26410
  onClick: () => {
26408
- l();
26411
+ c();
26409
26412
  },
26410
26413
  children: si.retry
26411
26414
  }
26412
26415
  )
26413
- ] }) : i == null ? null : i.length === 0 ? /* @__PURE__ */ f.jsx("div", { className: "seam-supported-device-table-content", children: /* @__PURE__ */ f.jsx(
26416
+ ] }) : o == null ? null : o.length === 0 ? /* @__PURE__ */ f.jsx("div", { className: "seam-supported-device-table-content", children: /* @__PURE__ */ f.jsx(
26414
26417
  fz,
26415
26418
  {
26416
26419
  filterValue: e,
26417
26420
  resetFilterValue: t
26418
26421
  }
26419
- ) }) : e.trim() !== "" || n.brand !== null ? /* @__PURE__ */ f.jsx("div", { className: "seam-supported-device-table-content", children: i.map((u, p) => /* @__PURE__ */ f.jsx(
26422
+ ) }) : e.trim() !== "" || n.brand !== null ? /* @__PURE__ */ f.jsx("div", { className: "seam-supported-device-table-content", children: o.map((p, d) => /* @__PURE__ */ f.jsx(
26420
26423
  uz,
26421
26424
  {
26422
- deviceModel: u
26425
+ deviceModel: p
26423
26426
  },
26424
26427
  [
26425
- u.main_category,
26426
- u.brand,
26427
- u.model_name,
26428
- u.manufacturer_model_id,
26429
- p
26428
+ p.main_category,
26429
+ p.brand,
26430
+ p.model_name,
26431
+ p.manufacturer_model_id,
26432
+ d
26430
26433
  ].join(":")
26431
- )) }) : /* @__PURE__ */ f.jsx(f.Fragment, { children: Object.entries(hz(i)).map(
26432
- ([u, p]) => /* @__PURE__ */ f.jsx(
26434
+ )) }) : /* @__PURE__ */ f.jsx(f.Fragment, { children: Object.entries(hz(o)).map(
26435
+ ([p, d]) => /* @__PURE__ */ f.jsx(
26433
26436
  sz,
26434
26437
  {
26435
- brand: u,
26436
- deviceModels: p
26438
+ brand: p,
26439
+ deviceModels: d
26437
26440
  },
26438
- u
26441
+ p
26439
26442
  )
26440
26443
  ) });
26441
26444
  }
@@ -26537,52 +26540,53 @@ function bz({
26537
26540
  setFilterValue: e,
26538
26541
  filters: n,
26539
26542
  setFilters: r,
26540
- brands: i
26543
+ brands: i,
26544
+ excludedBrands: o
26541
26545
  }) {
26542
- const o = Sz(n), s = Az(i), l = (u) => {
26543
- r((p) => ({
26544
- ...p,
26545
- [u]: null
26546
+ const s = Sz(n), l = Az(i, o), c = (p) => {
26547
+ r((d) => ({
26548
+ ...d,
26549
+ [p]: null
26546
26550
  }));
26547
- }, c = o > 0 ? `${ea.filters} (${o})` : ea.filter, a = ea.all;
26551
+ }, a = s > 0 ? `${ea.filters} (${s})` : ea.filter, u = ea.all;
26548
26552
  return /* @__PURE__ */ f.jsxs("div", { className: "seam-supported-device-table-filter-area", children: [
26549
26553
  /* @__PURE__ */ f.jsx("div", { className: "seam-deliberate-block" }),
26550
26554
  /* @__PURE__ */ f.jsxs("div", { className: "seam-filters-wrap", children: [
26551
26555
  /* @__PURE__ */ f.jsx(
26552
26556
  vh,
26553
26557
  {
26554
- renderButton: ({ onOpen: u }) => /* @__PURE__ */ f.jsx(
26558
+ renderButton: ({ onOpen: p }) => /* @__PURE__ */ f.jsx(
26555
26559
  Dt,
26556
26560
  {
26557
26561
  variant: "outline",
26558
26562
  className: "seam-filters-button",
26559
- onClick: u,
26560
- children: c
26563
+ onClick: p,
26564
+ children: a
26561
26565
  }
26562
26566
  ),
26563
26567
  children: /* @__PURE__ */ f.jsxs(
26564
26568
  "div",
26565
26569
  {
26566
26570
  className: "seam-supported-device-table-filter-menu",
26567
- onClick: (u) => {
26568
- u.stopPropagation();
26571
+ onClick: (p) => {
26572
+ p.stopPropagation();
26569
26573
  },
26570
26574
  children: [
26571
26575
  /* @__PURE__ */ f.jsx("div", { className: "seam-filter-menu-row", children: /* @__PURE__ */ f.jsx(
26572
26576
  yz,
26573
26577
  {
26574
26578
  label: ea.brand,
26575
- allLabel: a,
26576
- options: s,
26577
- onSelect: (u) => {
26578
- r((p) => ({
26579
- ...p,
26580
- brand: u
26579
+ allLabel: u,
26580
+ options: l,
26581
+ onSelect: (p) => {
26582
+ r((d) => ({
26583
+ ...d,
26584
+ brand: p
26581
26585
  }));
26582
26586
  },
26583
- buttonLabel: n.brand ?? a,
26587
+ buttonLabel: n.brand ?? u,
26584
26588
  onAllOptionSelect: () => {
26585
- l("brand");
26589
+ c("brand");
26586
26590
  }
26587
26591
  }
26588
26592
  ) }),
@@ -26601,10 +26605,10 @@ function bz({
26601
26605
  type: "checkbox",
26602
26606
  className: "seam-filter-checkbox",
26603
26607
  checked: n.supportedOnly,
26604
- onChange: (u) => {
26605
- r((p) => ({
26606
- ...p,
26607
- supportedOnly: u.target.checked
26608
+ onChange: (p) => {
26609
+ r((d) => ({
26610
+ ...d,
26611
+ supportedOnly: p.target.checked
26608
26612
  }));
26609
26613
  }
26610
26614
  }
@@ -26621,8 +26625,8 @@ function bz({
26621
26625
  bh,
26622
26626
  {
26623
26627
  value: t,
26624
- onChange: (u) => {
26625
- e(u);
26628
+ onChange: (p) => {
26629
+ e(p);
26626
26630
  },
26627
26631
  className: "seam-supported-device-table-filter-area-search-bar"
26628
26632
  }
@@ -26633,14 +26637,12 @@ function bz({
26633
26637
  const Sz = (t) => {
26634
26638
  let e = 0;
26635
26639
  return t.brand !== null && e++, t.supportedOnly || e++, e;
26636
- }, Az = (t) => {
26637
- const { deviceModels: e } = OS();
26638
- if (e == null)
26640
+ }, Az = (t, e) => {
26641
+ const { deviceModels: n } = OS();
26642
+ if (n == null)
26639
26643
  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));
26644
+ const r = n.map(({ brand: i }) => i.trim()).filter((i) => i !== "").filter((i) => t === null ? !0 : t.includes(i) && !e.includes(i)).map((i) => vz(i));
26645
+ return Array.from(new Set(r));
26644
26646
  }, ea = {
26645
26647
  all: "All",
26646
26648
  brand: "Brand",
@@ -26652,39 +26654,42 @@ function wz({
26652
26654
  disableFilter: t = !1,
26653
26655
  cannotFilter: e,
26654
26656
  brands: n = null,
26655
- className: r
26657
+ excludedBrands: r = [],
26658
+ className: i
26656
26659
  } = {}) {
26657
- const [i, o] = P.useState(""), [s, l] = P.useState({
26660
+ const [o, s] = P.useState(""), [l, c] = P.useState({
26658
26661
  supportedOnly: !0,
26659
26662
  brand: null
26660
- }), c = e ?? t;
26663
+ }), a = e ?? t;
26661
26664
  return /* @__PURE__ */ f.jsxs(
26662
26665
  "div",
26663
26666
  {
26664
26667
  className: J(
26665
26668
  "seam-supported-device-table-content-wrap",
26666
- r
26669
+ i
26667
26670
  ),
26668
26671
  children: [
26669
- !c && /* @__PURE__ */ f.jsx(
26672
+ !a && /* @__PURE__ */ f.jsx(
26670
26673
  bz,
26671
26674
  {
26672
- filterValue: i,
26673
- setFilterValue: o,
26674
- filters: s,
26675
- setFilters: l,
26676
- brands: n
26675
+ filterValue: o,
26676
+ setFilterValue: s,
26677
+ filters: l,
26678
+ setFilters: c,
26679
+ brands: n,
26680
+ excludedBrands: r
26677
26681
  }
26678
26682
  ),
26679
26683
  /* @__PURE__ */ f.jsx(
26680
26684
  pz,
26681
26685
  {
26682
26686
  resetFilterValue: () => {
26683
- o("");
26687
+ s("");
26684
26688
  },
26685
- filterValue: i,
26686
- filters: s,
26687
- brands: n
26689
+ filterValue: o,
26690
+ filters: l,
26691
+ brands: n,
26692
+ excludedBrands: r
26688
26693
  }
26689
26694
  )
26690
26695
  ]
@@ -26695,6 +26700,7 @@ const Ez = "seam-supported-device-table", Oz = {
26695
26700
  cannotFilter: "boolean",
26696
26701
  disableFilter: "boolean",
26697
26702
  brands: "array",
26703
+ excludedBrands: "array",
26698
26704
  className: "string"
26699
26705
  }, xz = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
26700
26706
  __proto__: null,