@seamapi/react 4.14.2 → 5.1.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 (191) hide show
  1. package/README.md +111 -3
  2. package/dist/ecosystem.js +45 -0
  3. package/dist/ecosystem.js.map +1 -0
  4. package/dist/elements.js +11464 -11007
  5. package/dist/elements.js.map +1 -1
  6. package/dist/index.css +469 -345
  7. package/dist/index.css.map +1 -1
  8. package/dist/index.min.css +1 -1
  9. package/dist/index.min.css.map +1 -1
  10. package/lib/seam/SeamProvider.d.ts +10 -3
  11. package/lib/seam/SeamProvider.js +5 -3
  12. package/lib/seam/SeamProvider.js.map +1 -1
  13. package/lib/seam/components/CompatibleApps/CompatibleApps.d.ts +26 -0
  14. package/lib/seam/components/CompatibleApps/CompatibleApps.js +126 -0
  15. package/lib/seam/components/CompatibleApps/CompatibleApps.js.map +1 -0
  16. package/lib/seam/components/SupportedDevices/DeviceModelRow.d.ts +8 -0
  17. package/lib/seam/components/SupportedDevices/DeviceModelRow.js +31 -0
  18. package/lib/seam/components/SupportedDevices/DeviceModelRow.js.map +1 -0
  19. package/lib/seam/components/SupportedDevices/FilterSelect.d.ts +12 -0
  20. package/lib/seam/components/SupportedDevices/FilterSelect.js +9 -0
  21. package/lib/seam/components/SupportedDevices/FilterSelect.js.map +1 -0
  22. package/lib/seam/components/SupportedDevices/ManufacturerSection.d.ts +10 -0
  23. package/lib/seam/components/SupportedDevices/ManufacturerSection.js +35 -0
  24. package/lib/seam/components/SupportedDevices/ManufacturerSection.js.map +1 -0
  25. package/lib/seam/components/SupportedDevices/SupportedDevices.d.ts +24 -0
  26. package/lib/seam/components/SupportedDevices/SupportedDevices.js +151 -0
  27. package/lib/seam/components/SupportedDevices/SupportedDevices.js.map +1 -0
  28. package/lib/seam/components/SupportedDevices/device-models.d.ts +47 -0
  29. package/lib/seam/components/SupportedDevices/device-models.js +217 -0
  30. package/lib/seam/components/SupportedDevices/device-models.js.map +1 -0
  31. package/lib/seam/components/index.d.ts +2 -2
  32. package/lib/seam/components/index.js +2 -2
  33. package/lib/seam/components/index.js.map +1 -1
  34. package/lib/seam/ecosystem/EcosystemProvider.d.ts +37 -0
  35. package/lib/seam/ecosystem/EcosystemProvider.js +56 -0
  36. package/lib/seam/ecosystem/EcosystemProvider.js.map +1 -0
  37. package/lib/seam/ecosystem/client.d.ts +28 -0
  38. package/lib/seam/ecosystem/client.js +74 -0
  39. package/lib/seam/ecosystem/client.js.map +1 -0
  40. package/lib/seam/ecosystem/index.d.ts +9 -0
  41. package/lib/seam/ecosystem/index.js +8 -0
  42. package/lib/seam/ecosystem/index.js.map +1 -0
  43. package/lib/seam/ecosystem/types.d.ts +253 -0
  44. package/lib/seam/ecosystem/types.js +10 -0
  45. package/lib/seam/ecosystem/types.js.map +1 -0
  46. package/lib/seam/ecosystem/use-compatible-partners.d.ts +21 -0
  47. package/lib/seam/ecosystem/use-compatible-partners.js +36 -0
  48. package/lib/seam/ecosystem/use-compatible-partners.js.map +1 -0
  49. package/lib/seam/ecosystem/use-ecosystem-device-models.d.ts +20 -0
  50. package/lib/seam/ecosystem/use-ecosystem-device-models.js +51 -0
  51. package/lib/seam/ecosystem/use-ecosystem-device-models.js.map +1 -0
  52. package/lib/seam/ecosystem/use-ecosystem-manufacturers.d.ts +11 -0
  53. package/lib/seam/ecosystem/use-ecosystem-manufacturers.js +49 -0
  54. package/lib/seam/ecosystem/use-ecosystem-manufacturers.js.map +1 -0
  55. package/lib/seam/ecosystem/use-ecosystem-query-result.d.ts +7 -0
  56. package/lib/seam/ecosystem/use-ecosystem-query-result.js +7 -0
  57. package/lib/seam/ecosystem/use-ecosystem-query-result.js.map +1 -0
  58. package/lib/seam/ecosystem/use-embed-key-resolution.d.ts +20 -0
  59. package/lib/seam/ecosystem/use-embed-key-resolution.js +51 -0
  60. package/lib/seam/ecosystem/use-embed-key-resolution.js.map +1 -0
  61. package/lib/seam/index.d.ts +1 -0
  62. package/lib/seam/index.js +1 -0
  63. package/lib/seam/index.js.map +1 -1
  64. package/lib/seam/seam-components-class-name.d.ts +1 -0
  65. package/lib/seam/seam-components-class-name.js +2 -0
  66. package/lib/seam/seam-components-class-name.js.map +1 -0
  67. package/lib/ui/ecosystem/SearchField.d.ts +9 -0
  68. package/lib/ui/ecosystem/SearchField.js +8 -0
  69. package/lib/ui/ecosystem/SearchField.js.map +1 -0
  70. package/lib/ui/ecosystem/StateMessage.d.ts +8 -0
  71. package/lib/ui/ecosystem/StateMessage.js +5 -0
  72. package/lib/ui/ecosystem/StateMessage.js.map +1 -0
  73. package/lib/ui/ecosystem/errors.d.ts +5 -0
  74. package/lib/ui/ecosystem/errors.js +25 -0
  75. package/lib/ui/ecosystem/errors.js.map +1 -0
  76. package/lib/ui/ecosystem/storybook.d.ts +15 -0
  77. package/lib/ui/ecosystem/storybook.js +16 -0
  78. package/lib/ui/ecosystem/storybook.js.map +1 -0
  79. package/lib/ui/ecosystem/theme.d.ts +6 -0
  80. package/lib/ui/ecosystem/theme.js +11 -0
  81. package/lib/ui/ecosystem/theme.js.map +1 -0
  82. package/lib/version.d.ts +1 -1
  83. package/lib/version.js +1 -1
  84. package/lib/version.js.map +1 -1
  85. package/package.json +11 -3
  86. package/src/ecosystem.d.ts +2 -0
  87. package/src/ecosystem.ts +12 -0
  88. package/src/elements.ts +4 -0
  89. package/src/lib/ecosystem-element.tsx +154 -0
  90. package/src/lib/element.tsx +6 -0
  91. package/src/lib/seam/SeamProvider.tsx +18 -2
  92. package/src/lib/seam/components/CompatibleApps/CompatibleApps.element.ts +19 -0
  93. package/src/lib/seam/components/CompatibleApps/CompatibleApps.tsx +344 -0
  94. package/src/lib/seam/components/SupportedDevices/DeviceModelRow.tsx +105 -0
  95. package/src/lib/seam/components/SupportedDevices/FilterSelect.tsx +43 -0
  96. package/src/lib/seam/components/SupportedDevices/ManufacturerSection.tsx +114 -0
  97. package/src/lib/seam/components/SupportedDevices/SupportedDevices.element.ts +17 -0
  98. package/src/lib/seam/components/SupportedDevices/SupportedDevices.tsx +382 -0
  99. package/src/lib/seam/components/SupportedDevices/device-models.ts +326 -0
  100. package/src/lib/seam/components/ecosystem-elements.ts +2 -0
  101. package/src/lib/seam/components/elements.ts +0 -2
  102. package/src/lib/seam/components/index.ts +2 -2
  103. package/src/lib/seam/ecosystem/EcosystemProvider.tsx +133 -0
  104. package/src/lib/seam/ecosystem/client.ts +116 -0
  105. package/src/lib/seam/ecosystem/index.ts +19 -0
  106. package/src/lib/seam/ecosystem/types.ts +334 -0
  107. package/src/lib/seam/ecosystem/use-compatible-partners.ts +80 -0
  108. package/src/lib/seam/ecosystem/use-ecosystem-device-models.ts +96 -0
  109. package/src/lib/seam/ecosystem/use-ecosystem-manufacturers.ts +86 -0
  110. package/src/lib/seam/ecosystem/use-ecosystem-query-result.ts +19 -0
  111. package/src/lib/seam/ecosystem/use-embed-key-resolution.ts +80 -0
  112. package/src/lib/seam/index.ts +1 -0
  113. package/src/lib/seam/seam-components-class-name.ts +1 -0
  114. package/src/lib/ui/ecosystem/SearchField.tsx +32 -0
  115. package/src/lib/ui/ecosystem/StateMessage.tsx +29 -0
  116. package/src/lib/ui/ecosystem/errors.ts +30 -0
  117. package/src/lib/ui/ecosystem/storybook.tsx +40 -0
  118. package/src/lib/ui/ecosystem/theme.ts +14 -0
  119. package/src/lib/version.ts +1 -1
  120. package/src/styles/_compatible-apps.scss +102 -0
  121. package/src/styles/_ecosystem.scss +295 -0
  122. package/src/styles/_main.scss +6 -4
  123. package/src/styles/_supported-devices.scss +153 -0
  124. package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.d.ts +0 -20
  125. package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.js +0 -22
  126. package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.js.map +0 -1
  127. package/lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.d.ts +0 -6
  128. package/lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.js +0 -8
  129. package/lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.js.map +0 -1
  130. package/lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.d.ts +0 -9
  131. package/lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.js +0 -14
  132. package/lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.js.map +0 -1
  133. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.d.ts +0 -13
  134. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js +0 -58
  135. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js.map +0 -1
  136. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.d.ts +0 -7
  137. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.js +0 -6
  138. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.js.map +0 -1
  139. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.d.ts +0 -12
  140. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js +0 -58
  141. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js.map +0 -1
  142. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.d.ts +0 -8
  143. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.js +0 -39
  144. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.js.map +0 -1
  145. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.d.ts +0 -10
  146. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js +0 -35
  147. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js.map +0 -1
  148. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.d.ts +0 -11
  149. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js +0 -20
  150. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js.map +0 -1
  151. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.d.ts +0 -6
  152. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.js +0 -21
  153. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.js.map +0 -1
  154. package/lib/seam/components/SupportedDeviceTable/use-device-model.d.ts +0 -7
  155. package/lib/seam/components/SupportedDeviceTable/use-device-model.js +0 -21
  156. package/lib/seam/components/SupportedDeviceTable/use-device-model.js.map +0 -1
  157. package/lib/seam/components/SupportedDeviceTable/use-device-models.d.ts +0 -7
  158. package/lib/seam/components/SupportedDeviceTable/use-device-models.js +0 -30
  159. package/lib/seam/components/SupportedDeviceTable/use-device-models.js.map +0 -1
  160. package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.d.ts +0 -15
  161. package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js +0 -45
  162. package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js.map +0 -1
  163. package/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.d.ts +0 -10
  164. package/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.js +0 -42
  165. package/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.js.map +0 -1
  166. package/lib/seam/components/SupportedDeviceTable/use-manufacturer.d.ts +0 -7
  167. package/lib/seam/components/SupportedDeviceTable/use-manufacturer.js +0 -17
  168. package/lib/seam/components/SupportedDeviceTable/use-manufacturer.js.map +0 -1
  169. package/lib/seam/components/SupportedDeviceTable/use-manufacturers.d.ts +0 -7
  170. package/lib/seam/components/SupportedDeviceTable/use-manufacturers.js +0 -26
  171. package/lib/seam/components/SupportedDeviceTable/use-manufacturers.js.map +0 -1
  172. package/src/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.tsx +0 -78
  173. package/src/lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.tsx +0 -13
  174. package/src/lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.tsx +0 -32
  175. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.tsx +0 -161
  176. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.tsx +0 -22
  177. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.tsx +0 -145
  178. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.tsx +0 -109
  179. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.tsx +0 -93
  180. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.element.ts +0 -15
  181. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.tsx +0 -70
  182. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.element.ts +0 -9
  183. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.tsx +0 -64
  184. package/src/lib/seam/components/SupportedDeviceTable/use-device-model.ts +0 -44
  185. package/src/lib/seam/components/SupportedDeviceTable/use-device-models.ts +0 -57
  186. package/src/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.ts +0 -88
  187. package/src/lib/seam/components/SupportedDeviceTable/use-filtered-manufacturers.ts +0 -69
  188. package/src/lib/seam/components/SupportedDeviceTable/use-manufacturer.ts +0 -40
  189. package/src/lib/seam/components/SupportedDeviceTable/use-manufacturers.ts +0 -53
  190. package/src/styles/_supported-device-table-manufacturer-keys.scss +0 -20
  191. package/src/styles/_supported-device-table.scss +0 -412
package/README.md CHANGED
@@ -21,7 +21,6 @@ refreshing data, and performing actions.
21
21
  - [Get started with Angular](https://docs.seam.co/latest/seam-components/overview/angular).
22
22
  - [Get started with Vue](https://docs.seam.co/latest/seam-components/overview/vue).
23
23
  - [Get started with Client Sessions](https://docs.seam.co/latest/seam-components/get-started-with-react-components-and-client-session-tokens).
24
- - [Make a Supported Devices Page](https://docs.seam.co/latest/seam-components/make-a-supported-devices-page).
25
24
  - Reference the [Component API](https://docs.seam.co/latest/seam-components/react-components).
26
25
  - Find developer specific technical documentation in the [README](https://github.com/seamapi/react/).
27
26
  - Play with the components live in the interactive [Storybook](https://react.seam.co/)!
@@ -87,7 +86,7 @@ export function App() {
87
86
  <seam-device-table publishable-key="your_publishable_key"></seam-device-table>
88
87
  <script
89
88
  type="module"
90
- src="https://react.seam.co/v/4.14.2/dist/elements.js"
89
+ src="https://react.seam.co/v/5.1.0/dist/elements.js"
91
90
  ></script>
92
91
  </body>
93
92
  ```
@@ -141,6 +140,98 @@ globalThis.customElements.whenDefined('seam-device-table').then(() => {
141
140
 
142
141
  [Seam Console]: https://console.seam.co/
143
142
 
143
+ ### Seam Ecosystem Components
144
+
145
+ Two components show [Seam Ecosystem] data on any website,
146
+ e.g., a manufacturer's product page or a partner's integrations page:
147
+
148
+ - `<seam-compatible-apps>` (`CompatibleApps`):
149
+ the apps (Seam partners) that work with a device type, manufacturer, provider or capability through Seam.
150
+ A partner is listed only where Seam or the partner has declared support.
151
+ - `<seam-supported-devices>` (`SupportedDevices`):
152
+ the device models that work with Seam, grouped by manufacturer,
153
+ with device type and capability badges, search and filters.
154
+
155
+ These components use an Ecosystem embed key (`eco_live_…`) instead of a publishable key.
156
+ The page origin must be one of the key's allowed origins.
157
+ With a manufacturer key, `<seam-supported-devices>` defaults to that manufacturer.
158
+ With a partner key, it hides what the partner declared unsupported.
159
+
160
+ Load the lightweight `ecosystem.js` bundle, which only contains these two elements
161
+ (the full `elements.js` bundle defines them too):
162
+
163
+ ```html
164
+ <body>
165
+ <seam-compatible-apps
166
+ embed-key="your_embed_key"
167
+ device-type="smartlock"
168
+ manufacturer="schlage"
169
+ ></seam-compatible-apps>
170
+ <seam-supported-devices
171
+ embed-key="your_embed_key"
172
+ manufacturer="schlage"
173
+ ></seam-supported-devices>
174
+ <script
175
+ type="module"
176
+ src="https://react.seam.co/v/5.1.0/dist/ecosystem.js"
177
+ ></script>
178
+ </body>
179
+ ```
180
+
181
+ `<seam-compatible-apps>` attributes:
182
+
183
+ | Attribute | Description |
184
+ | -------------- | ----------------------------------------------------------------------------------- |
185
+ | `device-type` | Required. Device category, e.g., `smartlock`, `thermostat`, `sensor` or `intercom`. |
186
+ | `manufacturer` | DeviceDB manufacturer slug, e.g., `schlage`. |
187
+ | `provider` | DeviceDB provider slug, e.g., `salto-ks`. Shows each app's support note. |
188
+ | `capability` | DeviceDB capability, e.g., `can_provision_mobile_keys`. Shows each app's note. |
189
+ | `industry` | Industry slug, e.g., `short-term-rental`. |
190
+ | `max-visible` | Apps shown before the show more button. Defaults to 24. |
191
+ | `hide-search` | Hide the search field. |
192
+ | `hide-title` | Hide the title. |
193
+
194
+ `<seam-supported-devices>` attributes:
195
+
196
+ | Attribute | Description |
197
+ | -------------- | ------------------------------------------------------------------------------------- |
198
+ | `manufacturer` | DeviceDB manufacturer slug. Defaults to the manufacturer of a manufacturer embed key. |
199
+ | `device-type` | DeviceDB device type slug, e.g., `smartlock` or `thermostat`. |
200
+ | `capability` | Only devices supporting this capability, e.g., `can_program_online_access_codes`. |
201
+ | `hide-search` | Hide the search field. |
202
+ | `hide-filters` | Hide the manufacturer, device type and capability filters. |
203
+ | `hide-title` | Hide the title. |
204
+
205
+ Both elements also accept `embed-key`, `theme` (`light`, `dark` or `auto` to follow the visitor's color scheme),
206
+ `ecosystem-endpoint` (defaults to `https://ecosystem.seam.co/v1/`),
207
+ `class-name`, `disable-css-injection`, `disable-font-injection` and `unminifiy-css`.
208
+ Boolean attributes may be set without a value, e.g., `<seam-compatible-apps hide-search>`.
209
+
210
+ With React, wrap the components in an `EcosystemProvider`,
211
+ or pass `embedKey` to an existing `SeamProvider`:
212
+
213
+ ```tsx
214
+ import {
215
+ CompatibleApps,
216
+ EcosystemProvider,
217
+ SupportedDevices,
218
+ } from '@seamapi/react'
219
+
220
+ export function ProductPage() {
221
+ return (
222
+ <EcosystemProvider embedKey='your_embed_key'>
223
+ <SupportedDevices manufacturer='schlage' />
224
+ <CompatibleApps deviceType='smartlock' manufacturer='schlage' />
225
+ </EcosystemProvider>
226
+ )
227
+ }
228
+ ```
229
+
230
+ The data is also available with the `useCompatiblePartners`, `useEcosystemDeviceModels`,
231
+ `useEcosystemManufacturers` and `useEmbedKeyResolution` hooks.
232
+
233
+ [Seam Ecosystem]: https://ecosystem.seam.co/
234
+
144
235
  ### React Hooks
145
236
 
146
237
  All components interact with the Seam API via a set of React Hooks.
@@ -215,7 +306,7 @@ or place the following in the `<head>` tag:
215
306
  ```html
216
307
  <link
217
308
  rel="stylesheet"
218
- href="https://react.seam.co/v/4.14.2/dist/index.min.css"
309
+ href="https://react.seam.co/v/5.1.0/dist/index.min.css"
219
310
  />
220
311
  ```
221
312
 
@@ -340,6 +431,15 @@ When serving the CSS styles from the default CDN, extend `style-src` with
340
431
  style-src https://react.seam.co
341
432
  ```
342
433
 
434
+ #### Seam Ecosystem Components CSP
435
+
436
+ The Ecosystem components call the Ecosystem API and show logos and device images from its media storage.
437
+ Extend the CSP with
438
+
439
+ ```
440
+ connect-src https://ecosystem.seam.co; img-src https://seam-ecosystem-media.fly.storage.tigris.dev
441
+ ```
442
+
343
443
  ### Telemetry
344
444
 
345
445
  By default, this library reports basic usage telemetry to the Seam API.
@@ -483,6 +583,14 @@ The tests use the [default seed](https://github.com/seamapi/fake-seam-connect/bl
483
583
  Edit the Storybook seed data for the fake or find relevant ids for testing components here:
484
584
  [Storybook fake seed](./.storybook/seed-fake.js).
485
585
 
586
+ ### Fake Seam Ecosystem
587
+
588
+ The Ecosystem components are developed and tested against a fake of the public Seam Ecosystem API
589
+ with fictional partners and sample device models: [.storybook/fake-ecosystem.js](./.storybook/fake-ecosystem.js).
590
+ Storybook serves it at `/api/ecosystem` (locally via the Storybook middleware, and on react.seam.co via `api/fake-ecosystem.ts`),
591
+ so neither the Storybook nor the tests use a real embed key or production data.
592
+ It accepts the embed keys exported from that file.
593
+
486
594
  ### Fake Devicedb
487
595
 
488
596
  Fake Seam Connect optionally depends on a [fake version of the Seam Devicedb](https://github.com/seamapi/fake-devicedb).