@seamapi/react 1.6.0 → 1.8.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/README.md +18 -5
- package/dist/elements.js +25043 -0
- package/dist/elements.js.map +1 -0
- package/hooks.d.ts +1 -0
- package/hooks.js +2 -0
- package/hooks.js.map +1 -0
- package/index.css +6 -0
- package/index.css.map +1 -1
- package/index.min.css +1 -1
- package/index.min.css.map +1 -1
- package/lib/{sort-by.d.ts → dates.d.ts} +1 -1
- package/lib/{sort-by.js → dates.js} +2 -2
- package/lib/dates.js.map +1 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/{SeamProvider.d.ts → seam/SeamProvider.d.ts} +9 -6
- package/lib/{SeamProvider.js → seam/SeamProvider.js} +29 -30
- package/lib/seam/SeamProvider.js.map +1 -0
- package/lib/seam/access-codes/use-access-codes.js +2 -2
- package/lib/seam/access-codes/use-access-codes.js.map +1 -1
- package/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDetails.d.ts +2 -1
- package/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDetails.js +9 -8
- package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.js.map +1 -0
- package/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDevice.js +7 -7
- package/lib/seam/components/AccessCodeDetails/AccessCodeDevice.js.map +1 -0
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.d.ts +7 -0
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.js +77 -0
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.js.map +1 -0
- package/lib/{ui → seam/components}/AccessCodeTable/CodeDetails.js +3 -3
- package/lib/seam/components/AccessCodeTable/CodeDetails.js.map +1 -0
- package/lib/seam/components/DeviceDetails/DeviceDetails.d.ts +7 -0
- package/lib/seam/components/DeviceDetails/DeviceDetails.js +80 -0
- package/lib/seam/components/DeviceDetails/DeviceDetails.js.map +1 -0
- package/lib/seam/components/DeviceDetails/DeviceModel.js.map +1 -0
- package/lib/{ui → seam/components}/DeviceTable/DeviceHealthBar.d.ts +3 -2
- package/lib/{ui → seam/components}/DeviceTable/DeviceHealthBar.js +4 -4
- package/lib/seam/components/DeviceTable/DeviceHealthBar.js.map +1 -0
- package/lib/{ui → seam/components}/DeviceTable/DeviceRow.d.ts +1 -1
- package/lib/{ui → seam/components}/DeviceTable/DeviceRow.js +9 -9
- package/lib/seam/components/DeviceTable/DeviceRow.js.map +1 -0
- package/lib/seam/components/DeviceTable/DeviceTable.d.ts +9 -0
- package/lib/seam/components/DeviceTable/DeviceTable.js +66 -0
- package/lib/seam/components/DeviceTable/DeviceTable.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.d.ts +20 -0
- package/lib/{ui → seam/components}/SupportedDeviceTable/FilterCategoryMenu.js +8 -5
- package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.d.ts +9 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js +39 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.d.ts +9 -0
- package/lib/{ui → seam/components}/SupportedDeviceTable/SupportedDeviceFilterArea.js +33 -28
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceFilterArea.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceHeader.d.ts +2 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceHeader.js +12 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceHeader.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.d.ts +6 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js +19 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.d.ts +6 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js +17 -0
- package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.js.map +1 -0
- package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.d.ts +7 -0
- package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js +18 -0
- package/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.js.map +1 -0
- package/lib/seam/components/index.js.map +1 -0
- package/lib/seam/device-models/use-device-models.d.ts +5 -0
- package/lib/seam/device-models/use-device-models.js +17 -0
- package/lib/seam/device-models/use-device-models.js.map +1 -0
- package/lib/seam/devices/use-devices.js +3 -3
- package/lib/seam/devices/use-devices.js.map +1 -1
- package/lib/seam/devices/use-toggle-lock.js +1 -1
- package/lib/seam/devices/use-toggle-lock.js.map +1 -1
- package/lib/seam/index.d.ts +1 -0
- package/lib/seam/index.js +1 -0
- package/lib/seam/index.js.map +1 -1
- package/lib/seam/use-seam-client.js +1 -1
- package/lib/seam/use-seam-client.js.map +1 -1
- package/lib/seam/use-seam-font.d.ts +1 -1
- package/lib/seam/use-seam-font.js +1 -1
- package/lib/seam/use-seam-font.js.map +1 -1
- package/lib/seam/use-seam-styles.js.map +1 -1
- package/lib/{capitalize.js → strings.js} +1 -1
- package/lib/strings.js.map +1 -0
- package/lib/ui/Menu/Menu.d.ts +1 -1
- package/lib/ui/Menu/Menu.js.map +1 -1
- package/lib/ui/Menu/MenuItem.d.ts +1 -1
- package/lib/ui/Menu/MoreActionsMenu.d.ts +1 -1
- package/lib/ui/Table/TableFilterBar/TableFilterBar.d.ts +2 -1
- package/lib/ui/Table/TableFilterBar/TableFilterItem.d.ts +2 -1
- package/lib/ui/TextField/SearchTextField.js.map +1 -1
- package/lib/{copy-to-clipboard.js → ui/clipboard.js} +1 -1
- package/lib/ui/clipboard.js.map +1 -0
- package/lib/ui/use-interval.js.map +1 -0
- package/lib/{use-is-date-in-past.js → ui/use-is-date-in-past.js} +1 -1
- package/lib/ui/use-is-date-in-past.js.map +1 -0
- package/lib/ui/use-toggle.js.map +1 -0
- package/lib/version.d.ts +2 -2
- package/lib/version.js +3 -1
- package/lib/version.js.map +1 -1
- package/package.json +21 -8
- package/src/elements.ts +27 -0
- package/src/hooks.ts +1 -0
- package/src/lib/{sort-by.ts → dates.ts} +1 -1
- package/src/lib/element.tsx +86 -0
- package/src/lib/index.ts +2 -2
- package/src/lib/{SeamProvider.tsx → seam/SeamProvider.tsx} +53 -46
- package/src/lib/seam/access-codes/use-access-codes.ts +2 -2
- package/src/lib/seam/components/AccessCodeDetails/AccessCodeDetails.element.ts +12 -0
- package/src/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDetails.tsx +9 -6
- package/src/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDevice.tsx +2 -2
- package/src/lib/seam/components/AccessCodeTable/AccessCodeTable.element.ts +12 -0
- package/src/lib/{ui → seam/components}/AccessCodeTable/AccessCodeTable.tsx +30 -11
- package/src/lib/{ui → seam/components}/AccessCodeTable/CodeDetails.tsx +2 -3
- package/src/lib/seam/components/DeviceDetails/DeviceDetails.element.ts +12 -0
- package/src/lib/{ui → seam/components}/DeviceDetails/DeviceDetails.tsx +22 -12
- package/src/lib/{ui → seam/components}/DeviceTable/DeviceHealthBar.tsx +1 -1
- package/src/lib/{ui → seam/components}/DeviceTable/DeviceRow.tsx +1 -1
- package/src/lib/seam/components/DeviceTable/DeviceTable.element.ts +11 -0
- package/src/lib/{ui → seam/components}/DeviceTable/DeviceTable.tsx +15 -12
- package/src/lib/{ui → seam/components}/SupportedDeviceTable/FilterCategoryMenu.tsx +26 -13
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.tsx +120 -0
- package/src/lib/{ui → seam/components}/SupportedDeviceTable/SupportedDeviceFilterArea.tsx +43 -39
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceHeader.tsx +22 -0
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.tsx +48 -0
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.element.ts +11 -0
- package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.tsx +48 -0
- package/src/lib/seam/components/SupportedDeviceTable/use-filtered-device-models.ts +35 -0
- package/src/lib/seam/components/elements.ts +5 -0
- package/src/lib/seam/device-models/use-device-models.ts +34 -0
- package/src/lib/seam/devices/use-devices.ts +3 -3
- package/src/lib/seam/devices/use-toggle-lock.ts +1 -2
- package/src/lib/seam/index.ts +1 -0
- package/src/lib/seam/use-seam-client.ts +1 -1
- package/src/lib/seam/use-seam-font.ts +5 -1
- package/src/lib/seam/use-seam-styles.ts +1 -1
- package/src/lib/ui/Menu/Menu.tsx +4 -4
- package/src/lib/ui/Menu/MenuItem.tsx +1 -1
- package/src/lib/ui/Menu/MoreActionsMenu.tsx +1 -1
- package/src/lib/ui/Table/TableFilterBar/TableFilterBar.tsx +2 -2
- package/src/lib/ui/Table/TableFilterBar/TableFilterItem.tsx +1 -1
- package/src/lib/ui/TextField/SearchTextField.tsx +3 -3
- package/src/lib/ui/clipboard.ts +3 -0
- package/src/lib/{use-interval.ts → ui/use-interval.ts} +1 -1
- package/src/lib/{use-is-date-in-past.ts → ui/use-is-date-in-past.ts} +1 -1
- package/src/lib/version.ts +3 -1
- package/src/styles/_access-code-table.scss +7 -0
- package/lib/SeamProvider.js.map +0 -1
- package/lib/capitalize.js.map +0 -1
- package/lib/copy-to-clipboard.js.map +0 -1
- package/lib/sort-by.js.map +0 -1
- package/lib/ui/AccessCodeDetails/AccessCodeDetails.js.map +0 -1
- package/lib/ui/AccessCodeDetails/AccessCodeDevice.js.map +0 -1
- package/lib/ui/AccessCodeTable/AccessCodeTable.d.ts +0 -6
- package/lib/ui/AccessCodeTable/AccessCodeTable.js +0 -69
- package/lib/ui/AccessCodeTable/AccessCodeTable.js.map +0 -1
- package/lib/ui/AccessCodeTable/CodeDetails.js.map +0 -1
- package/lib/ui/DeviceDetails/DeviceDetails.d.ts +0 -6
- package/lib/ui/DeviceDetails/DeviceDetails.js +0 -80
- package/lib/ui/DeviceDetails/DeviceDetails.js.map +0 -1
- package/lib/ui/DeviceDetails/DeviceModel.js.map +0 -1
- package/lib/ui/DeviceTable/DeviceHealthBar.js.map +0 -1
- package/lib/ui/DeviceTable/DeviceRow.js.map +0 -1
- package/lib/ui/DeviceTable/DeviceTable.d.ts +0 -8
- package/lib/ui/DeviceTable/DeviceTable.js +0 -65
- package/lib/ui/DeviceTable/DeviceTable.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/FilterCategoryMenu.d.ts +0 -15
- package/lib/ui/SupportedDeviceTable/FilterCategoryMenu.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceContent.d.ts +0 -4
- package/lib/ui/SupportedDeviceTable/SupportedDeviceContent.js +0 -46
- package/lib/ui/SupportedDeviceTable/SupportedDeviceContent.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.d.ts +0 -11
- package/lib/ui/SupportedDeviceTable/SupportedDeviceFilterArea.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.d.ts +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.js +0 -5
- package/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceRow.d.ts +0 -5
- package/lib/ui/SupportedDeviceTable/SupportedDeviceRow.js +0 -12
- package/lib/ui/SupportedDeviceTable/SupportedDeviceRow.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/SupportedDeviceTable.d.ts +0 -3
- package/lib/ui/SupportedDeviceTable/SupportedDeviceTable.js +0 -8
- package/lib/ui/SupportedDeviceTable/SupportedDeviceTable.js.map +0 -1
- package/lib/ui/SupportedDeviceTable/types.d.ts +0 -15
- package/lib/ui/SupportedDeviceTable/types.js +0 -2
- package/lib/ui/SupportedDeviceTable/types.js.map +0 -1
- package/lib/ui/index.js.map +0 -1
- package/lib/use-interval.js.map +0 -1
- package/lib/use-is-date-in-past.js.map +0 -1
- package/lib/use-toggle.js.map +0 -1
- package/src/lib/copy-to-clipboard.ts +0 -3
- package/src/lib/ui/SupportedDeviceTable/SupportedDeviceContent.tsx +0 -135
- package/src/lib/ui/SupportedDeviceTable/SupportedDeviceHeader.tsx +0 -14
- package/src/lib/ui/SupportedDeviceTable/SupportedDeviceRow.tsx +0 -35
- package/src/lib/ui/SupportedDeviceTable/SupportedDeviceTable.tsx +0 -16
- package/src/lib/ui/SupportedDeviceTable/types.ts +0 -16
- /package/lib/{ui → seam/components}/AccessCodeDetails/AccessCodeDevice.d.ts +0 -0
- /package/lib/{ui → seam/components}/AccessCodeTable/CodeDetails.d.ts +0 -0
- /package/lib/{ui → seam/components}/DeviceDetails/DeviceModel.d.ts +0 -0
- /package/lib/{ui → seam/components}/DeviceDetails/DeviceModel.js +0 -0
- /package/lib/{ui → seam/components}/index.d.ts +0 -0
- /package/lib/{ui → seam/components}/index.js +0 -0
- /package/lib/{capitalize.d.ts → strings.d.ts} +0 -0
- /package/lib/{copy-to-clipboard.d.ts → ui/clipboard.d.ts} +0 -0
- /package/lib/{use-interval.d.ts → ui/use-interval.d.ts} +0 -0
- /package/lib/{use-interval.js → ui/use-interval.js} +0 -0
- /package/lib/{use-is-date-in-past.d.ts → ui/use-is-date-in-past.d.ts} +0 -0
- /package/lib/{use-toggle.d.ts → ui/use-toggle.d.ts} +0 -0
- /package/lib/{use-toggle.js → ui/use-toggle.js} +0 -0
- /package/src/lib/{ui → seam/components}/DeviceDetails/DeviceModel.tsx +0 -0
- /package/src/lib/{ui → seam/components}/index.ts +0 -0
- /package/src/lib/{capitalize.ts → strings.ts} +0 -0
- /package/src/lib/{use-toggle.ts → ui/use-toggle.ts} +0 -0
package/README.md
CHANGED
|
@@ -74,6 +74,17 @@ or place the following in the `<head>` tag:
|
|
|
74
74
|
<link rel="stylesheet" href="https://react.seam.co/v/1.0.0/index.min.css" />
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
+
#### Customizing Styles
|
|
78
|
+
|
|
79
|
+
> The `seam-` prefixed CSS class names are not part of the stable API and may change unexpectedly.
|
|
80
|
+
|
|
81
|
+
Each component accepts a `className` prop.
|
|
82
|
+
The class name will be set on the top level container, or if a sub-component is rendered, passed though.
|
|
83
|
+
This makes them compatible with native CSS and most CSS-in-JS systems, e.g., [Emotion] and [styled-components].
|
|
84
|
+
|
|
85
|
+
[Emotion]: https://emotion.sh/
|
|
86
|
+
[styled-components]: https://styled-components.com/
|
|
87
|
+
|
|
77
88
|
### Fonts
|
|
78
89
|
|
|
79
90
|
> Fonts are automatically included unless using `<SeamProvider disableFontInjection />`.
|
|
@@ -101,7 +112,7 @@ Then, load it from Google Fonts by placing the following in the `<head>` tag:
|
|
|
101
112
|
When using the default provider settings, the components are compatible with this CSP:
|
|
102
113
|
|
|
103
114
|
```
|
|
104
|
-
default-src 'self'; connect-src 'self' https://connect.getseam.com
|
|
115
|
+
default-src 'self'; connect-src 'self' https://connect.getseam.com; img-src 'self' https://connect.getseam.com https://seam.co https://www.seam.co; font-src 'self' https://fonts.gstatic.com; style-src 'self' https://fonts.googleapis.com
|
|
105
116
|
```
|
|
106
117
|
|
|
107
118
|
#### Granular CSP
|
|
@@ -112,16 +123,15 @@ By self hosting the styles and recommended fonts (or choosing not to use them),
|
|
|
112
123
|
and proxying the Seam API endpoint, the components are compatible with this strict CSP:
|
|
113
124
|
|
|
114
125
|
```
|
|
115
|
-
default-src 'self';
|
|
126
|
+
default-src 'self'; img-src 'self' https://connect.getseam.com https://seam.co https://www.seam.co
|
|
116
127
|
```
|
|
117
128
|
|
|
118
|
-
The `img-src` is required as some components display device images from the Seam API
|
|
119
|
-
and `connect-src` is required to use components that query the Seam Device Database.
|
|
129
|
+
The `img-src` is required as some components display device images from the Seam API.
|
|
120
130
|
|
|
121
131
|
When using the default endpoint, extend `connect-src` with
|
|
122
132
|
|
|
123
133
|
```
|
|
124
|
-
connect-src 'self' https://connect.getseam.com
|
|
134
|
+
connect-src 'self' https://connect.getseam.com
|
|
125
135
|
```
|
|
126
136
|
|
|
127
137
|
When serving the fonts from Google Fonts, include `font-src` and `style-src` with
|
|
@@ -227,6 +237,9 @@ Edit the seed data for the fake or find relevant ids for testing components here
|
|
|
227
237
|
- [Storybook fake seed](./.storybook/seed-fake.js).
|
|
228
238
|
- [Jest test fake seed](./test/jest/global-setup.cjs).
|
|
229
239
|
|
|
240
|
+
> Note that the Chromatic tests use the fake seed data on the main branch, not the Vercel Preview Deployment.
|
|
241
|
+
> To review UI changes with new seed data, update the seed data on the main branch first.
|
|
242
|
+
|
|
230
243
|
### Previews
|
|
231
244
|
|
|
232
245
|
Every pull request deploys the Storybook with the examples
|