@seamapi/react 0.16.1 → 0.18.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 +28 -2
- package/index.css +294 -69
- package/index.css.map +1 -1
- package/index.min.css +1 -1
- package/index.min.css.map +1 -1
- package/lib/icons/LockLocked.d.ts +2 -0
- package/lib/icons/LockLocked.js +5 -0
- package/lib/icons/LockLocked.js.map +1 -0
- package/lib/icons/LockUnlocked.d.ts +2 -0
- package/lib/icons/LockUnlocked.js +5 -0
- package/lib/icons/LockUnlocked.js.map +1 -0
- package/lib/seam/access-codes/use-access-code.d.ts +4 -0
- package/lib/seam/access-codes/use-access-code.js +16 -0
- package/lib/seam/access-codes/use-access-code.js.map +1 -0
- package/lib/seam/access-codes/use-access-codes.d.ts +9 -0
- package/lib/seam/access-codes/use-access-codes.js +18 -0
- package/lib/seam/access-codes/use-access-codes.js.map +1 -0
- package/lib/seam/devices/types.d.ts +2 -0
- package/lib/seam/devices/types.js +2 -0
- package/lib/seam/devices/types.js.map +1 -0
- package/lib/seam/devices/use-device.d.ts +9 -0
- package/lib/seam/devices/use-device.js +56 -0
- package/lib/seam/devices/use-device.js.map +1 -0
- package/lib/seam/devices/use-devices.d.ts +4 -9
- package/lib/seam/devices/use-devices.js +2 -1
- package/lib/seam/devices/use-devices.js.map +1 -1
- package/lib/seam/index.d.ts +4 -1
- package/lib/seam/index.js +4 -1
- package/lib/seam/index.js.map +1 -1
- package/lib/seam/use-seam-client.js +3 -3
- package/lib/seam/use-seam-client.js.map +1 -1
- package/lib/seam/use-seam-query-result.js.map +1 -0
- package/lib/ui/AccessCodeDetails/AccessCodeDetails.d.ts +6 -0
- package/lib/ui/AccessCodeDetails/AccessCodeDetails.js +64 -0
- package/lib/ui/AccessCodeDetails/AccessCodeDetails.js.map +1 -0
- package/lib/ui/AccessCodeDetails/AccessCodeDevice.d.ts +5 -0
- package/lib/ui/AccessCodeDetails/AccessCodeDevice.js +23 -0
- package/lib/ui/AccessCodeDetails/AccessCodeDevice.js.map +1 -0
- package/lib/ui/AccessCodeTable/AccessCodeTable.d.ts +1 -1
- package/lib/ui/AccessCodeTable/AccessCodeTable.js +19 -5
- package/lib/ui/AccessCodeTable/AccessCodeTable.js.map +1 -1
- package/lib/ui/AccessCodeTable/AccessCodeTableContent.d.ts +1 -1
- package/lib/ui/AccessCodeTable/AccessCodeTableContent.js +7 -3
- package/lib/ui/AccessCodeTable/AccessCodeTableContent.js.map +1 -1
- package/lib/ui/AccessCodeTable/CodeDetails.js +1 -1
- package/lib/ui/AccessCodeTable/CodeDetails.js.map +1 -1
- package/lib/ui/Button.d.ts +8 -0
- package/lib/ui/Button.js +8 -0
- package/lib/ui/Button.js.map +1 -0
- package/lib/ui/DeviceDetails/DeviceDetails.d.ts +4 -3
- package/lib/ui/DeviceDetails/DeviceDetails.js +25 -9
- package/lib/ui/DeviceDetails/DeviceDetails.js.map +1 -1
- package/lib/ui/DeviceDetails/DeviceModel.d.ts +7 -0
- package/lib/ui/DeviceDetails/DeviceModel.js +18 -0
- package/lib/ui/DeviceDetails/DeviceModel.js.map +1 -0
- package/lib/ui/DeviceTable/DeviceTable.d.ts +7 -0
- package/lib/ui/DeviceTable/DeviceTable.js +49 -0
- package/lib/ui/DeviceTable/DeviceTable.js.map +1 -0
- package/lib/ui/IconButton.js +1 -1
- package/lib/ui/IconButton.js.map +1 -1
- package/lib/ui/Table/TableRow.d.ts +3 -1
- package/lib/ui/Table/TableRow.js +1 -1
- package/lib/ui/Table/TableRow.js.map +1 -1
- package/lib/ui/TextButton.d.ts +7 -0
- package/lib/ui/TextButton.js +5 -0
- package/lib/ui/TextButton.js.map +1 -0
- package/lib/ui/TextField/SearchTextField.d.ts +1 -1
- package/lib/ui/TextField/SearchTextField.js +1 -1
- package/lib/ui/TextField/SearchTextField.js.map +1 -1
- package/lib/ui/device/BatteryStatus.d.ts +5 -0
- package/lib/ui/{DeviceDetails → device}/BatteryStatus.js +5 -6
- package/lib/ui/device/BatteryStatus.js.map +1 -0
- package/lib/ui/{DeviceDetails → device}/DeviceImage.d.ts +2 -1
- package/lib/ui/{DeviceDetails → device}/DeviceImage.js +2 -2
- package/lib/ui/device/DeviceImage.js.map +1 -0
- package/lib/ui/device/LockStatus.d.ts +5 -0
- package/lib/ui/device/LockStatus.js +19 -0
- package/lib/ui/device/LockStatus.js.map +1 -0
- package/lib/ui/device/OnlineStatus.d.ts +5 -0
- package/lib/ui/{DeviceDetails → device}/OnlineStatus.js +4 -5
- package/lib/ui/device/OnlineStatus.js.map +1 -0
- package/lib/ui/index.d.ts +3 -1
- package/lib/ui/index.js +3 -1
- package/lib/ui/index.js.map +1 -1
- package/lib/ui/layout/ContentHeader.d.ts +2 -2
- package/lib/ui/layout/ContentHeader.js +5 -1
- package/lib/ui/layout/ContentHeader.js.map +1 -1
- package/package.json +4 -5
- package/src/icons/lock-locked.svg +8 -0
- package/src/icons/lock-unlocked.svg +9 -0
- package/src/lib/icons/LockLocked.tsx +32 -0
- package/src/lib/icons/LockUnlocked.tsx +34 -0
- package/src/lib/seam/access-codes/use-access-code.ts +24 -0
- package/src/lib/seam/access-codes/use-access-codes.ts +39 -0
- package/src/lib/seam/devices/types.ts +5 -0
- package/src/lib/seam/devices/use-device.ts +79 -0
- package/src/lib/seam/devices/use-devices.ts +13 -8
- package/src/lib/seam/index.ts +4 -1
- package/src/lib/seam/use-seam-client.ts +3 -3
- package/src/lib/ui/AccessCodeDetails/AccessCodeDetails.tsx +154 -0
- package/src/lib/ui/AccessCodeDetails/AccessCodeDevice.tsx +49 -0
- package/src/lib/ui/AccessCodeTable/AccessCodeTable.tsx +33 -12
- package/src/lib/ui/AccessCodeTable/AccessCodeTableContent.tsx +8 -11
- package/src/lib/ui/AccessCodeTable/CodeDetails.tsx +1 -1
- package/src/lib/ui/Button.tsx +26 -0
- package/src/lib/ui/DeviceDetails/DeviceDetails.tsx +49 -22
- package/src/lib/ui/DeviceDetails/DeviceModel.tsx +34 -0
- package/src/lib/ui/DeviceTable/DeviceTable.tsx +110 -0
- package/src/lib/ui/IconButton.tsx +1 -1
- package/src/lib/ui/Table/TableRow.tsx +8 -2
- package/src/lib/ui/TextButton.tsx +15 -0
- package/src/lib/ui/TextField/SearchTextField.tsx +1 -1
- package/src/lib/ui/{DeviceDetails → device}/BatteryStatus.tsx +12 -14
- package/src/lib/ui/device/DeviceImage.tsx +15 -0
- package/src/lib/ui/device/LockStatus.tsx +46 -0
- package/src/lib/ui/{DeviceDetails → device}/OnlineStatus.tsx +15 -11
- package/src/lib/ui/index.ts +3 -1
- package/src/lib/ui/layout/ContentHeader.tsx +9 -4
- package/src/styles/_access-code-details.scss +121 -0
- package/src/styles/_access-code-table.scss +34 -38
- package/src/styles/_buttons.scss +125 -8
- package/src/styles/_colors.scss +30 -0
- package/src/styles/_device-details.scss +21 -10
- package/src/styles/_device-table.scss +63 -0
- package/src/styles/_icons.scss +9 -0
- package/src/styles/_inputs.scss +3 -1
- package/src/styles/_layout.scss +5 -1
- package/src/styles/_main.scss +8 -14
- package/src/styles/_tables.scss +6 -0
- package/src/styles/_typography.scss +18 -2
- package/lib/hooks/use-access-codes.d.ts +0 -5
- package/lib/hooks/use-access-codes.js +0 -16
- package/lib/hooks/use-access-codes.js.map +0 -1
- package/lib/hooks/use-device.d.ts +0 -5
- package/lib/hooks/use-device.js +0 -17
- package/lib/hooks/use-device.js.map +0 -1
- package/lib/hooks/use-devices.d.ts +0 -1
- package/lib/hooks/use-devices.js +0 -2
- package/lib/hooks/use-devices.js.map +0 -1
- package/lib/hooks/use-seam-client.d.ts +0 -1
- package/lib/hooks/use-seam-client.js +0 -2
- package/lib/hooks/use-seam-client.js.map +0 -1
- package/lib/seam/devices/index.d.ts +0 -1
- package/lib/seam/devices/index.js +0 -2
- package/lib/seam/devices/index.js.map +0 -1
- package/lib/types/use-seam-query-result.js.map +0 -1
- package/lib/ui/AccessCodeTable/index.d.ts +0 -2
- package/lib/ui/AccessCodeTable/index.js +0 -3
- package/lib/ui/AccessCodeTable/index.js.map +0 -1
- package/lib/ui/DeviceDetails/BatteryStatus.d.ts +0 -4
- package/lib/ui/DeviceDetails/BatteryStatus.js.map +0 -1
- package/lib/ui/DeviceDetails/DeviceImage.js.map +0 -1
- package/lib/ui/DeviceDetails/ModelStatus.d.ts +0 -4
- package/lib/ui/DeviceDetails/ModelStatus.js +0 -13
- package/lib/ui/DeviceDetails/ModelStatus.js.map +0 -1
- package/lib/ui/DeviceDetails/OnlineStatus.d.ts +0 -4
- package/lib/ui/DeviceDetails/OnlineStatus.js.map +0 -1
- package/lib/ui/DeviceDetails/index.d.ts +0 -5
- package/lib/ui/DeviceDetails/index.js +0 -6
- package/lib/ui/DeviceDetails/index.js.map +0 -1
- package/lib/ui/DeviceManager/DeviceManager.d.ts +0 -6
- package/lib/ui/DeviceManager/DeviceManager.js +0 -24
- package/lib/ui/DeviceManager/DeviceManager.js.map +0 -1
- package/lib/ui/DeviceManager/index.d.ts +0 -1
- package/lib/ui/DeviceManager/index.js +0 -2
- package/lib/ui/DeviceManager/index.js.map +0 -1
- package/lib/ui/Table/index.d.ts +0 -5
- package/lib/ui/Table/index.js +0 -6
- package/lib/ui/Table/index.js.map +0 -1
- package/lib/ui/TextField/index.d.ts +0 -2
- package/lib/ui/TextField/index.js +0 -3
- package/lib/ui/TextField/index.js.map +0 -1
- package/src/lib/hooks/use-access-codes.ts +0 -21
- package/src/lib/hooks/use-device.ts +0 -26
- package/src/lib/hooks/use-devices.ts +0 -1
- package/src/lib/hooks/use-seam-client.ts +0 -1
- package/src/lib/seam/devices/index.ts +0 -1
- package/src/lib/ui/AccessCodeTable/index.ts +0 -2
- package/src/lib/ui/DeviceDetails/DeviceImage.tsx +0 -12
- package/src/lib/ui/DeviceDetails/ModelStatus.tsx +0 -25
- package/src/lib/ui/DeviceDetails/index.ts +0 -5
- package/src/lib/ui/DeviceManager/DeviceManager.tsx +0 -52
- package/src/lib/ui/DeviceManager/index.ts +0 -1
- package/src/lib/ui/Table/index.ts +0 -5
- package/src/lib/ui/TextField/index.ts +0 -2
- /package/lib/{types → seam}/use-seam-query-result.d.ts +0 -0
- /package/lib/{types → seam}/use-seam-query-result.js +0 -0
- /package/src/lib/{types → seam}/use-seam-query-result.ts +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@use 'sass:color';
|
|
2
|
+
|
|
3
|
+
$primary: #007afc !default;
|
|
4
|
+
$primary-50: color.scale($primary, $lightness: 50%);
|
|
5
|
+
$primary-30: color.scale($primary, $lightness: 70%);
|
|
6
|
+
$primary-15: color.scale($primary, $lightness: 85%);
|
|
7
|
+
$primary-8: color.scale($primary, $lightness: 92%);
|
|
8
|
+
$primary-5: color.scale($primary, $lightness: 95%);
|
|
9
|
+
$primary-dark: color.scale($primary, $lightness: -10%);
|
|
10
|
+
$primary-dim: color.scale($primary-15, $lightness: -5%);
|
|
11
|
+
$text-default: #232b3a;
|
|
12
|
+
$text-gray-1: #6e7179;
|
|
13
|
+
$text-gray-2: #9da1a9;
|
|
14
|
+
$text-gray-2-5: #b9bec5;
|
|
15
|
+
$text-gray-3: #d5d8dc;
|
|
16
|
+
$divider-stroke-light: #eee;
|
|
17
|
+
$bg-d: #cbd0d3;
|
|
18
|
+
$bg-c: #dde0e2;
|
|
19
|
+
$bg-b: #e9edef;
|
|
20
|
+
$bg-a: #f1f3f4;
|
|
21
|
+
$status-red: #e36857;
|
|
22
|
+
$status-orange: #f3980f;
|
|
23
|
+
$status-green: #27ae60;
|
|
24
|
+
$alert-error-dark: #cb7d7d;
|
|
25
|
+
$alert-error-line: #f1d4d4;
|
|
26
|
+
$alert-error-fill: #ffefef;
|
|
27
|
+
$alert-warn-dark: #ca8852;
|
|
28
|
+
$alert-warn-line: #f8d8be;
|
|
29
|
+
$alert-warn-fill: #fff2e0;
|
|
30
|
+
$item-hover-bg: #f4f6f8;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
@use './colors';
|
|
2
|
+
|
|
1
3
|
@mixin all {
|
|
2
4
|
.seam-device-details {
|
|
3
|
-
padding: 0 24px 24px;
|
|
4
|
-
|
|
5
5
|
.seam-body {
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-direction: column;
|
|
8
8
|
gap: 16px;
|
|
9
|
+
margin: 0 24px 24px;
|
|
9
10
|
|
|
10
11
|
.seam-box {
|
|
11
|
-
border: 1px solid
|
|
12
|
+
border: 1px solid colors.$text-gray-3;
|
|
12
13
|
border-radius: 8px;
|
|
13
14
|
|
|
14
15
|
.seam-content {
|
|
@@ -22,18 +23,28 @@
|
|
|
22
23
|
cursor: pointer;
|
|
23
24
|
|
|
24
25
|
&:hover {
|
|
25
|
-
background:
|
|
26
|
+
background: colors.$item-hover-bg;
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
&.seam-access-code-length {
|
|
30
|
-
border-top: 1px solid
|
|
31
|
+
border-top: 1px solid colors.$text-gray-3;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&.seam-lock-status {
|
|
35
|
+
display: flex;
|
|
36
|
+
justify-content: space-between;
|
|
37
|
+
|
|
38
|
+
> .seam-right {
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
}
|
|
31
42
|
}
|
|
32
43
|
|
|
33
44
|
.seam-label {
|
|
34
45
|
font-size: 14px;
|
|
35
46
|
line-height: 134%;
|
|
36
|
-
color:
|
|
47
|
+
color: colors.$text-gray-1;
|
|
37
48
|
}
|
|
38
49
|
|
|
39
50
|
.seam-value {
|
|
@@ -48,7 +59,7 @@
|
|
|
48
59
|
.seam-summary {
|
|
49
60
|
padding: 24px 16px;
|
|
50
61
|
border-radius: 16px;
|
|
51
|
-
background:
|
|
62
|
+
background: colors.$bg-a;
|
|
52
63
|
|
|
53
64
|
.seam-content {
|
|
54
65
|
display: flex;
|
|
@@ -68,7 +79,7 @@
|
|
|
68
79
|
|
|
69
80
|
.seam-info {
|
|
70
81
|
> .seam-label {
|
|
71
|
-
color:
|
|
82
|
+
color: colors.$text-gray-1;
|
|
72
83
|
font-weight: 600;
|
|
73
84
|
font-size: 14px;
|
|
74
85
|
line-height: 134%;
|
|
@@ -92,11 +103,11 @@
|
|
|
92
103
|
column-gap: 28px;
|
|
93
104
|
|
|
94
105
|
.seam-label {
|
|
95
|
-
color:
|
|
106
|
+
color: colors.$text-gray-2;
|
|
96
107
|
}
|
|
97
108
|
|
|
98
109
|
.seam-status-text {
|
|
99
|
-
color:
|
|
110
|
+
color: colors.$text-gray-1;
|
|
100
111
|
}
|
|
101
112
|
|
|
102
113
|
svg {
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
@use './colors';
|
|
2
|
+
|
|
3
|
+
@mixin all {
|
|
4
|
+
.seam-device-table {
|
|
5
|
+
.seam-table-row {
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
|
|
8
|
+
.seam-image-cell {
|
|
9
|
+
width: 64px;
|
|
10
|
+
height: 64px;
|
|
11
|
+
padding: 4px;
|
|
12
|
+
|
|
13
|
+
img {
|
|
14
|
+
width: 100%;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.seam-body-cell {
|
|
19
|
+
flex: 1;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
align-items: flex-start;
|
|
23
|
+
gap: 2px;
|
|
24
|
+
|
|
25
|
+
.seam-bottom {
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
align-items: center;
|
|
29
|
+
width: 100%;
|
|
30
|
+
|
|
31
|
+
.seam-device-model {
|
|
32
|
+
font-weight: 400;
|
|
33
|
+
font-size: 14px;
|
|
34
|
+
line-height: 134%;
|
|
35
|
+
color: colors.$text-gray-1;
|
|
36
|
+
flex: 0 1 190px;
|
|
37
|
+
white-space: nowrap;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
text-overflow: ellipsis;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.seam-device-statuses {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
color: colors.$text-gray-1;
|
|
46
|
+
font-size: 14px;
|
|
47
|
+
line-height: 134%;
|
|
48
|
+
|
|
49
|
+
> div {
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
margin-right: 16px;
|
|
53
|
+
|
|
54
|
+
svg {
|
|
55
|
+
scale: 0.75;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
package/src/styles/_inputs.scss
CHANGED
package/src/styles/_layout.scss
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use './colors';
|
|
2
|
+
|
|
1
3
|
@mixin header {
|
|
2
4
|
.seam-content-header {
|
|
3
5
|
height: 56px;
|
|
@@ -5,11 +7,12 @@
|
|
|
5
7
|
align-items: center;
|
|
6
8
|
position: relative;
|
|
7
9
|
justify-content: center;
|
|
10
|
+
margin: 0 16px;
|
|
8
11
|
|
|
9
12
|
.seam-back-icon {
|
|
10
13
|
position: absolute;
|
|
11
14
|
top: 50%;
|
|
12
|
-
transform: translate(
|
|
15
|
+
transform: translate(4px, -25%);
|
|
13
16
|
left: 0;
|
|
14
17
|
cursor: pointer;
|
|
15
18
|
}
|
|
@@ -17,6 +20,7 @@
|
|
|
17
20
|
.seam-title {
|
|
18
21
|
font-size: 16px;
|
|
19
22
|
line-height: 134%;
|
|
23
|
+
color: colors.$text-gray-1;
|
|
20
24
|
}
|
|
21
25
|
}
|
|
22
26
|
}
|
package/src/styles/_main.scss
CHANGED
|
@@ -5,22 +5,13 @@
|
|
|
5
5
|
@use './buttons';
|
|
6
6
|
@use './layout';
|
|
7
7
|
@use './access-code-table';
|
|
8
|
+
@use './colors';
|
|
9
|
+
@use './icons';
|
|
8
10
|
@use './device-details';
|
|
11
|
+
@use './device-table';
|
|
12
|
+
@use './access-code-details';
|
|
9
13
|
|
|
10
14
|
.seam-components {
|
|
11
|
-
font-family: 'Source Sans Pro', system-ui, -apple-system, BlinkMacSystemFont,
|
|
12
|
-
'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue',
|
|
13
|
-
sans-serif;
|
|
14
|
-
|
|
15
|
-
--primary: #007afc;
|
|
16
|
-
--text-gray-1: #6e7179;
|
|
17
|
-
--text-gray-2: #9da1a9;
|
|
18
|
-
--text-gray-3: #d5d8dc;
|
|
19
|
-
--input-border: #d5d8dc;
|
|
20
|
-
--bg-a: #f1f3f4;
|
|
21
|
-
--status-red-alert: #e36857;
|
|
22
|
-
--item-hover-bg: #f4f6f8;
|
|
23
|
-
|
|
24
15
|
// Reset
|
|
25
16
|
@include reset.all;
|
|
26
17
|
|
|
@@ -30,8 +21,11 @@
|
|
|
30
21
|
@include inputs.all;
|
|
31
22
|
@include buttons.all;
|
|
32
23
|
@include layout.all;
|
|
24
|
+
@include icons.all;
|
|
33
25
|
|
|
34
26
|
// Components
|
|
35
|
-
@include access-code-table.all;
|
|
36
27
|
@include device-details.all;
|
|
28
|
+
@include device-table.all;
|
|
29
|
+
@include access-code-table.all;
|
|
30
|
+
@include access-code-details.all;
|
|
37
31
|
}
|
package/src/styles/_tables.scss
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
@use './colors';
|
|
2
|
+
|
|
1
3
|
@mixin header {
|
|
2
4
|
.seam-table-header {
|
|
3
5
|
display: flex;
|
|
4
6
|
justify-content: space-between;
|
|
5
7
|
align-items: center;
|
|
8
|
+
height: 56px;
|
|
9
|
+
padding: 0 16px;
|
|
6
10
|
}
|
|
7
11
|
|
|
8
12
|
.seam-table-title {
|
|
@@ -21,6 +25,7 @@
|
|
|
21
25
|
display: flex;
|
|
22
26
|
padding: 4px;
|
|
23
27
|
height: 72px;
|
|
28
|
+
border-bottom: 1px solid colors.$divider-stroke-light;
|
|
24
29
|
|
|
25
30
|
&:hover {
|
|
26
31
|
background: rgb(244 246 248 / 100%);
|
|
@@ -29,6 +34,7 @@
|
|
|
29
34
|
.seam-title {
|
|
30
35
|
font-weight: 600;
|
|
31
36
|
font-size: 18px;
|
|
37
|
+
line-height: 132%;
|
|
32
38
|
}
|
|
33
39
|
}
|
|
34
40
|
}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
@use './colors';
|
|
2
|
+
|
|
3
|
+
@mixin font-family {
|
|
4
|
+
font-family: 'Source Sans Pro', system-ui, -apple-system, BlinkMacSystemFont,
|
|
5
|
+
'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue',
|
|
6
|
+
sans-serif;
|
|
7
|
+
}
|
|
8
|
+
|
|
1
9
|
@mixin headers {
|
|
2
10
|
h1,
|
|
3
11
|
h2,
|
|
@@ -11,13 +19,19 @@
|
|
|
11
19
|
|
|
12
20
|
@mixin caption {
|
|
13
21
|
.seam-caption {
|
|
14
|
-
color:
|
|
22
|
+
color: colors.$text-gray-2;
|
|
15
23
|
}
|
|
16
24
|
}
|
|
17
25
|
|
|
18
26
|
@mixin danger-text {
|
|
19
27
|
.seam-text-danger {
|
|
20
|
-
color:
|
|
28
|
+
color: colors.$status-red;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@mixin defaults {
|
|
33
|
+
html {
|
|
34
|
+
color: colors.$text-default;
|
|
21
35
|
}
|
|
22
36
|
}
|
|
23
37
|
|
|
@@ -25,4 +39,6 @@
|
|
|
25
39
|
@include headers;
|
|
26
40
|
@include caption;
|
|
27
41
|
@include danger-text;
|
|
42
|
+
@include font-family;
|
|
43
|
+
@include defaults;
|
|
28
44
|
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useQuery } from '@tanstack/react-query';
|
|
2
|
-
import { useSeamClient } from '../../lib/seam/use-seam-client.js';
|
|
3
|
-
export function useAccessCodes(params) {
|
|
4
|
-
const { client } = useSeamClient();
|
|
5
|
-
const { data, ...rest } = useQuery({
|
|
6
|
-
enabled: client != null,
|
|
7
|
-
queryKey: ['access_codes', 'list', params],
|
|
8
|
-
queryFn: async () => {
|
|
9
|
-
if (client == null)
|
|
10
|
-
return [];
|
|
11
|
-
return await client?.accessCodes.list(params);
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
return { ...rest, accessCodes: data };
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=use-access-codes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-access-codes.js","sourceRoot":"","sources":["../../src/lib/hooks/use-access-codes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAGhD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAG3D,MAAM,UAAU,cAAc,CAAC,MAE9B;IACC,MAAM,EAAE,MAAM,EAAE,GAAG,aAAa,EAAE,CAAA;IAClC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,CAAiB;QACjD,OAAO,EAAE,MAAM,IAAI,IAAI;QACvB,QAAQ,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC;QAC1C,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,IAAI,MAAM,IAAI,IAAI;gBAAE,OAAO,EAAE,CAAA;YAC7B,OAAO,MAAM,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC/C,CAAC;KACF,CAAC,CAAA;IAEF,OAAO,EAAE,GAAG,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAA;AACvC,CAAC"}
|
package/lib/hooks/use-device.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useQuery } from '@tanstack/react-query';
|
|
2
|
-
import { useSeamClient } from '../../lib/seam/use-seam-client.js';
|
|
3
|
-
export function useDevice(params) {
|
|
4
|
-
const objParams = typeof params === 'string' ? { device_id: params } : params;
|
|
5
|
-
const { client } = useSeamClient();
|
|
6
|
-
const { data, ...rest } = useQuery({
|
|
7
|
-
enabled: client != null,
|
|
8
|
-
queryKey: ['devices', 'get', params],
|
|
9
|
-
queryFn: async () => {
|
|
10
|
-
if (client == null)
|
|
11
|
-
return [];
|
|
12
|
-
return await client?.devices.get(objParams);
|
|
13
|
-
},
|
|
14
|
-
});
|
|
15
|
-
return { ...rest, device: data };
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=use-device.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-device.js","sourceRoot":"","sources":["../../src/lib/hooks/use-device.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAGhD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAG3D,MAAM,UAAU,SAAS,CACvB,MAIU;IAEV,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAA;IAC7E,MAAM,EAAE,MAAM,EAAE,GAAG,aAAa,EAAE,CAAA;IAClC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,CAAiB;QACjD,OAAO,EAAE,MAAM,IAAI,IAAI;QACvB,QAAQ,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC;QACpC,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,IAAI,MAAM,IAAI,IAAI;gBAAE,OAAO,EAAE,CAAA;YAC7B,OAAO,MAAM,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;QAC7C,CAAC;KACF,CAAC,CAAA;IAEF,OAAO,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAA;AAClC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useDevices } from '../../lib/seam/devices/use-devices.js';
|
package/lib/hooks/use-devices.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-devices.js","sourceRoot":"","sources":["../../src/lib/hooks/use-devices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useSeamClient } from '../../lib/seam/use-seam-client.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-seam-client.js","sourceRoot":"","sources":["../../src/lib/hooks/use-seam-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './use-devices.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/seam/devices/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-seam-query-result.js","sourceRoot":"","sources":["../../src/lib/types/use-seam-query-result.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/ui/AccessCodeTable/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BatteryStatus.js","sourceRoot":"","sources":["../../../src/lib/ui/DeviceDetails/BatteryStatus.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAA;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAElE,MAAM,UAAU,aAAa,CAAC,KAE7B;IACC,MAAM,EACJ,MAAM,EAAE,EACN,UAAU,EAAE,EAAE,aAAa,EAAE,YAAY,EAAE,GAC5C,GACF,GAAG,KAAK,CAAA;IAET,IAAI,YAAY,IAAI,IAAI,EAAE;QACxB,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,CACL,8BACE,gBAAM,SAAS,EAAC,YAAY,aAAE,CAAC,CAAC,KAAK,SAAS,EAAC,GAAG,EAClD,cAAK,SAAS,EAAC,qBAAqB,YAClC,KAAC,MAAM,IAAC,YAAY,EAAE,YAAY,GAAI,GAClC,IACL,CACJ,CAAA;AACH,CAAC;AAED,SAAS,MAAM,CAAC,KAA+B;IAC7C,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAA;IAE9B,IAAI,YAAY,GAAG,gBAAgB,CAAC,IAAI,EAAE;QACxC,OAAO,CACL,8BACE,KAAC,oBAAoB,KAAG,EACxB,eAAM,SAAS,EAAC,kBAAkB,YAAE,CAAC,CAAC,IAAI,GAAQ,IACjD,CACJ,CAAA;KACF;IAED,IAAI,YAAY,GAAG,gBAAgB,CAAC,IAAI,EAAE;QACxC,OAAO,CACL,8BACE,KAAC,oBAAoB,KAAG,EACxB,eAAM,SAAS,EAAC,kBAAkB,YAAE,CAAC,CAAC,IAAI,GAAQ,IACjD,CACJ,CAAA;KACF;IAED,IAAI,YAAY,GAAG,gBAAgB,CAAC,GAAG,EAAE;QACvC,OAAO,CACL,8BACE,KAAC,mBAAmB,KAAG,EACvB,eAAM,SAAS,EAAC,kBAAkB,YAAE,CAAC,CAAC,GAAG,GAAQ,IAChD,CACJ,CAAA;KACF;IAED,OAAO,CACL,8BACE,KAAC,wBAAwB,KAAG,EAC5B,eAAM,SAAS,EAAC,kBAAkB,YAAE,CAAC,CAAC,QAAQ,GAAQ,IACrD,CACJ,CAAA;AACH,CAAC;AAED,MAAM,gBAAgB,GAAG;IACvB,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,GAAG;IACT,GAAG,EAAE,GAAG;CACT,CAAA;AAED,MAAM,CAAC,GAAG;IACR,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,QAAQ,EAAE,MAAM;CACjB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceImage.js","sourceRoot":"","sources":["../../../src/lib/ui/DeviceDetails/DeviceImage.tsx"],"names":[],"mappings":";AAEA,MAAM,UAAU,WAAW,CAAC,KAA6B;IACvD,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAA;IAExB,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,SAAS,IAAI,gBAAgB,CAAA;IAE3D,OAAO,cAAK,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI,GAAI,CAAA;AACvD,CAAC;AAED,MAAM,gBAAgB,GACpB,oEAAoE,CAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
export function ModelStatus(props) {
|
|
3
|
-
const { device: { properties }, } = props;
|
|
4
|
-
const model = properties?.august_metadata?.model ?? properties?.schlage_metadata?.model;
|
|
5
|
-
if (model == null) {
|
|
6
|
-
return null;
|
|
7
|
-
}
|
|
8
|
-
return (_jsxs(_Fragment, { children: [_jsxs("span", { className: 'seam-label', children: [t.model, ":"] }), ' ', _jsx("div", { className: 'seam-device-model', children: model })] }));
|
|
9
|
-
}
|
|
10
|
-
const t = {
|
|
11
|
-
model: 'Model',
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=ModelStatus.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModelStatus.js","sourceRoot":"","sources":["../../../src/lib/ui/DeviceDetails/ModelStatus.tsx"],"names":[],"mappings":";AAEA,MAAM,UAAU,WAAW,CAAC,KAA6B;IACvD,MAAM,EACJ,MAAM,EAAE,EAAE,UAAU,EAAE,GACvB,GAAG,KAAK,CAAA;IAET,MAAM,KAAK,GACT,UAAU,EAAE,eAAe,EAAE,KAAK,IAAI,UAAU,EAAE,gBAAgB,EAAE,KAAK,CAAA;IAE3E,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,CACL,8BACE,gBAAM,SAAS,EAAC,YAAY,aAAE,CAAC,CAAC,KAAK,SAAS,EAAC,GAAG,EAClD,cAAK,SAAS,EAAC,mBAAmB,YAAE,KAAK,GAAO,IAC/C,CACJ,CAAA;AACH,CAAC;AAED,MAAM,CAAC,GAAG;IACR,KAAK,EAAE,OAAO;CACf,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OnlineStatus.js","sourceRoot":"","sources":["../../../src/lib/ui/DeviceDetails/OnlineStatus.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAA;AACtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAA;AAExE,MAAM,UAAU,YAAY,CAAC,KAA6B;IACxD,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAA;IACxB,OAAO,CACL,8BACE,gBAAM,SAAS,EAAC,YAAY,aAAE,CAAC,CAAC,MAAM,SAAS,EAAC,GAAG,EACnD,cAAK,SAAS,EAAC,oBAAoB,YACjC,KAAC,MAAM,IAAC,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC,MAAM,GAAI,GAC1C,IACL,CACJ,CAAA;AACH,CAAC;AAED,SAAS,MAAM,CAAC,KAA4B;IAC1C,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAA;IAE1B,IAAI,QAAQ,EAAE;QACZ,OAAO,CACL,8BACE,KAAC,sBAAsB,KAAG,EAC1B,eAAM,SAAS,EAAC,kBAAkB,YAAE,CAAC,CAAC,MAAM,GAAQ,IACnD,CACJ,CAAA;KACF;IAED,yCAAyC;IAEzC,OAAO,CACL,8BACE,KAAC,6BAA6B,KAAG,EACjC,eAAM,SAAS,EAAC,kBAAkB,YAAE,CAAC,CAAC,aAAa,GAAQ,IAC1D,CACJ,CAAA;AACH,CAAC;AAED,MAAM,CAAC,GAAG;IACR,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,aAAa,EAAE,gBAAgB;CAChC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/ui/DeviceDetails/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useDevices, } from '../../../lib/seam/devices/use-devices.js';
|
|
3
|
-
/**
|
|
4
|
-
* Fetch, list, and manage devices.
|
|
5
|
-
*/
|
|
6
|
-
export const DeviceManager = (props) => {
|
|
7
|
-
const { devices, isLoading, isError, error } = useDevices(props);
|
|
8
|
-
if (isLoading)
|
|
9
|
-
return _jsx("p", { role: 'loading', children: t.loading });
|
|
10
|
-
if (isError)
|
|
11
|
-
return _jsx("p", { children: error?.message });
|
|
12
|
-
return (_jsx("ul", { children: devices
|
|
13
|
-
?.sort((a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime())
|
|
14
|
-
?.map((device) => (_jsx(DeviceManagerItem, { ...device }, device.device_id))) }));
|
|
15
|
-
};
|
|
16
|
-
const DeviceManagerItem = (props) => {
|
|
17
|
-
return (_jsxs("li", { children: [_jsxs("p", { children: [t.device_id, ": ", props.device_id] }), _jsxs("p", { children: [t.name, ": ", props.properties.name] })] }));
|
|
18
|
-
};
|
|
19
|
-
const t = {
|
|
20
|
-
loading: 'Loading devices',
|
|
21
|
-
device_id: 'Device ID',
|
|
22
|
-
name: 'Device name',
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=DeviceManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceManager.js","sourceRoot":"","sources":["../../../src/lib/ui/DeviceManager/DeviceManager.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,UAAU,GAEX,MAAM,iCAAiC,CAAA;AAIxC;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAyB,EAAe,EAAE;IACtE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;IAEhE,IAAI,SAAS;QAAE,OAAO,YAAG,IAAI,EAAC,SAAS,YAAE,CAAC,CAAC,OAAO,GAAK,CAAA;IACvD,IAAI,OAAO;QAAE,OAAO,sBAAI,KAAK,EAAE,OAAO,GAAK,CAAA;IAE3C,OAAO,CACL,uBACG,OAAO;YACN,EAAE,IAAI,CACJ,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACP,IAAI,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CACtE;YACD,EAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAChB,KAAC,iBAAiB,OAA4B,MAAM,IAA5B,MAAM,CAAC,SAAS,CAAgB,CACzD,CAAC,GACD,CACN,CAAA;AACH,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,CACxB,KAAqC,EACxB,EAAE;IACf,OAAO,CACL,yBACE,wBACG,CAAC,CAAC,SAAS,QAAI,KAAK,CAAC,SAAS,IAC7B,EACJ,wBACG,CAAC,CAAC,IAAI,QAAI,KAAK,CAAC,UAAU,CAAC,IAAI,IAC9B,IACD,CACN,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,GAAG;IACR,OAAO,EAAE,iBAAiB;IAC1B,SAAS,EAAE,WAAW;IACtB,IAAI,EAAE,aAAa;CACpB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './DeviceManager.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/ui/DeviceManager/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
|
package/lib/ui/Table/index.d.ts
DELETED
package/lib/ui/Table/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/ui/Table/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/ui/TextField/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,gBAAgB,CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { useQuery } from '@tanstack/react-query'
|
|
2
|
-
import type { AccessCode, SeamError } from 'seamapi'
|
|
3
|
-
|
|
4
|
-
import { useSeamClient } from 'lib/seam/use-seam-client.js'
|
|
5
|
-
import type { UseSeamQueryResult } from 'lib/types/use-seam-query-result.js'
|
|
6
|
-
|
|
7
|
-
export function useAccessCodes(params: {
|
|
8
|
-
device_id: string
|
|
9
|
-
}): UseSeamQueryResult<'accessCodes', AccessCode[]> {
|
|
10
|
-
const { client } = useSeamClient()
|
|
11
|
-
const { data, ...rest } = useQuery<any, SeamError>({
|
|
12
|
-
enabled: client != null,
|
|
13
|
-
queryKey: ['access_codes', 'list', params],
|
|
14
|
-
queryFn: async () => {
|
|
15
|
-
if (client == null) return []
|
|
16
|
-
return await client?.accessCodes.list(params)
|
|
17
|
-
},
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
return { ...rest, accessCodes: data }
|
|
21
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { useQuery } from '@tanstack/react-query'
|
|
2
|
-
import type { Device, SeamError } from 'seamapi'
|
|
3
|
-
|
|
4
|
-
import { useSeamClient } from 'lib/seam/use-seam-client.js'
|
|
5
|
-
import type { UseSeamQueryResult } from 'lib/types/use-seam-query-result.js'
|
|
6
|
-
|
|
7
|
-
export function useDevice(
|
|
8
|
-
params:
|
|
9
|
-
| {
|
|
10
|
-
device_id: string
|
|
11
|
-
}
|
|
12
|
-
| string
|
|
13
|
-
): UseSeamQueryResult<'device', Device<any>> {
|
|
14
|
-
const objParams = typeof params === 'string' ? { device_id: params } : params
|
|
15
|
-
const { client } = useSeamClient()
|
|
16
|
-
const { data, ...rest } = useQuery<any, SeamError>({
|
|
17
|
-
enabled: client != null,
|
|
18
|
-
queryKey: ['devices', 'get', params],
|
|
19
|
-
queryFn: async () => {
|
|
20
|
-
if (client == null) return []
|
|
21
|
-
return await client?.devices.get(objParams)
|
|
22
|
-
},
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
return { ...rest, device: data }
|
|
26
|
-
}
|