@seamapi/react 2.8.7 → 2.10.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 +2 -2
- package/dist/elements.js +7998 -7317
- package/dist/elements.js.map +1 -1
- package/dist/index.css +31 -2
- package/dist/index.css.map +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.min.css.map +1 -1
- package/lib/debounce.d.ts +6 -0
- package/lib/debounce.js +20 -0
- package/lib/debounce.js.map +1 -0
- package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.d.ts +1 -1
- package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.js +2 -2
- package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.js.map +1 -1
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.d.ts +1 -1
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.js +4 -4
- package/lib/seam/components/AccessCodeTable/AccessCodeTable.js.map +1 -1
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.d.ts +1 -1
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.js +2 -2
- package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.js.map +1 -1
- package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.d.ts +1 -1
- package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.js +2 -2
- package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.js.map +1 -1
- package/lib/seam/components/DeviceDetails/DeviceDetails.d.ts +1 -1
- package/lib/seam/components/DeviceDetails/DeviceDetails.js +2 -1
- package/lib/seam/components/DeviceDetails/DeviceDetails.js.map +1 -1
- package/lib/seam/components/DeviceDetails/LockDeviceDetails.js +2 -2
- package/lib/seam/components/DeviceDetails/LockDeviceDetails.js.map +1 -1
- package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.d.ts +1 -1
- package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.js +99 -5
- package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.js.map +1 -1
- package/lib/seam/components/DeviceTable/DeviceTable.d.ts +1 -1
- package/lib/seam/components/DeviceTable/DeviceTable.js +2 -2
- package/lib/seam/components/DeviceTable/DeviceTable.js.map +1 -1
- package/lib/seam/components/common-props.d.ts +1 -0
- package/lib/seam/components/common-props.js.map +1 -1
- package/lib/temperature-bounds.d.ts +2 -1
- package/lib/temperature-bounds.js +16 -0
- package/lib/temperature-bounds.js.map +1 -1
- package/lib/ui/layout/AccordionRow.d.ts +2 -1
- package/lib/ui/layout/AccordionRow.js +2 -2
- package/lib/ui/layout/AccordionRow.js.map +1 -1
- package/lib/ui/thermostat/ClimateModeMenu.d.ts +2 -1
- package/lib/ui/thermostat/ClimateModeMenu.js +2 -3
- package/lib/ui/thermostat/ClimateModeMenu.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +3 -3
- package/src/lib/debounce.ts +33 -0
- package/src/lib/element.tsx +1 -0
- package/src/lib/seam/components/AccessCodeDetails/AccessCodeDetails.tsx +2 -0
- package/src/lib/seam/components/AccessCodeTable/AccessCodeTable.tsx +4 -0
- package/src/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.tsx +2 -0
- package/src/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.tsx +2 -0
- package/src/lib/seam/components/DeviceDetails/DeviceDetails.tsx +3 -1
- package/src/lib/seam/components/DeviceDetails/LockDeviceDetails.tsx +2 -0
- package/src/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.tsx +222 -26
- package/src/lib/seam/components/DeviceTable/DeviceTable.tsx +2 -0
- package/src/lib/seam/components/common-props.tsx +1 -0
- package/src/lib/temperature-bounds.ts +23 -1
- package/src/lib/ui/layout/AccordionRow.tsx +6 -1
- package/src/lib/ui/thermostat/ClimateModeMenu.tsx +3 -3
- package/src/lib/version.ts +1 -1
- package/src/styles/_layout.scss +13 -2
- package/src/styles/_thermostat.scss +26 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HvacModeSetting } from 'seamapi'
|
|
1
|
+
import type { HvacModeSetting, ThermostatDevice } from 'seamapi'
|
|
2
2
|
|
|
3
3
|
export interface ControlBounds {
|
|
4
4
|
mode: Exclude<HvacModeSetting, 'off'>
|
|
@@ -51,3 +51,25 @@ export const getTemperatureBounds = (
|
|
|
51
51
|
heat: getHeatBounds(controlBounds),
|
|
52
52
|
cool: getCoolBounds(controlBounds),
|
|
53
53
|
})
|
|
54
|
+
|
|
55
|
+
export const getSupportedThermostatModes = (
|
|
56
|
+
device: ThermostatDevice
|
|
57
|
+
): HvacModeSetting[] => {
|
|
58
|
+
const allModes: HvacModeSetting[] = ['heat', 'cool', 'heat_cool', 'off']
|
|
59
|
+
|
|
60
|
+
return allModes.filter((mode) => {
|
|
61
|
+
switch (mode) {
|
|
62
|
+
case 'cool':
|
|
63
|
+
return device.properties.is_cooling_available
|
|
64
|
+
case 'heat':
|
|
65
|
+
return device.properties.is_heating_available
|
|
66
|
+
case 'heat_cool':
|
|
67
|
+
return (
|
|
68
|
+
device.properties.is_heating_available &&
|
|
69
|
+
device.properties.is_cooling_available
|
|
70
|
+
)
|
|
71
|
+
default:
|
|
72
|
+
return true
|
|
73
|
+
}
|
|
74
|
+
})
|
|
75
|
+
}
|
|
@@ -5,11 +5,13 @@ import { useToggle } from 'lib/ui/use-toggle.js'
|
|
|
5
5
|
|
|
6
6
|
interface AccordionRowProps extends PropsWithChildren {
|
|
7
7
|
label: string
|
|
8
|
+
leftContent?: JSX.Element
|
|
8
9
|
rightCollapsedContent?: JSX.Element
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export function AccordionRow({
|
|
12
13
|
label,
|
|
14
|
+
leftContent,
|
|
13
15
|
rightCollapsedContent,
|
|
14
16
|
children,
|
|
15
17
|
}: AccordionRowProps): JSX.Element {
|
|
@@ -18,7 +20,10 @@ export function AccordionRow({
|
|
|
18
20
|
return (
|
|
19
21
|
<div className='seam-accordion-row' aria-expanded={isExpanded}>
|
|
20
22
|
<button className='seam-accordion-row-trigger' onClick={toggle}>
|
|
21
|
-
<
|
|
23
|
+
<div className='seam-row-inner-wrap'>
|
|
24
|
+
<p className='seam-row-label'>{label}</p>
|
|
25
|
+
<div className='seam-row-trigger-left-content'>{leftContent}</div>
|
|
26
|
+
</div>
|
|
22
27
|
<div className='seam-row-inner-wrap'>
|
|
23
28
|
<div className='seam-row-trigger-right-content'>
|
|
24
29
|
{rightCollapsedContent}
|
|
@@ -8,16 +8,16 @@ import { ThermostatHeatCoolIcon } from 'lib/icons/ThermostatHeatCool.js'
|
|
|
8
8
|
import { Menu } from 'lib/ui/Menu/Menu.js'
|
|
9
9
|
import { ThermoModeMenuOption } from 'lib/ui/thermostat/ThermoModeMenuOption.js'
|
|
10
10
|
|
|
11
|
-
const modes: HvacModeSetting[] = ['heat', 'cool', 'heat_cool', 'off']
|
|
12
|
-
|
|
13
11
|
interface ClimateModeMenuProps {
|
|
14
12
|
mode: HvacModeSetting
|
|
15
13
|
onChange: (mode: HvacModeSetting) => void
|
|
14
|
+
supportedModes?: HvacModeSetting[]
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
export function ClimateModeMenu({
|
|
19
18
|
mode,
|
|
20
19
|
onChange,
|
|
20
|
+
supportedModes = ['heat', 'cool', 'heat_cool', 'off'],
|
|
21
21
|
}: ClimateModeMenuProps): JSX.Element {
|
|
22
22
|
return (
|
|
23
23
|
<Menu
|
|
@@ -35,7 +35,7 @@ export function ClimateModeMenu({
|
|
|
35
35
|
className: 'seam-thermo-mode-menu',
|
|
36
36
|
}}
|
|
37
37
|
>
|
|
38
|
-
{
|
|
38
|
+
{supportedModes.map((m) => (
|
|
39
39
|
<ThermoModeMenuOption
|
|
40
40
|
key={m}
|
|
41
41
|
label={t[m]}
|
package/src/lib/version.ts
CHANGED
package/src/styles/_layout.scss
CHANGED
|
@@ -126,6 +126,16 @@
|
|
|
126
126
|
gap: 8px;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
.seam-detail-row-end-alignment {
|
|
130
|
+
width: 100%;
|
|
131
|
+
display: flex;
|
|
132
|
+
justify-content: flex-end;
|
|
133
|
+
align-items: flex-start;
|
|
134
|
+
flex-direction: row;
|
|
135
|
+
gap: 24px;
|
|
136
|
+
padding-top: 12px;
|
|
137
|
+
}
|
|
138
|
+
|
|
129
139
|
.seam-detail-row-rotated-icon {
|
|
130
140
|
transform: rotate(-90deg);
|
|
131
141
|
}
|
|
@@ -168,7 +178,7 @@
|
|
|
168
178
|
|
|
169
179
|
&[aria-expanded='true'] {
|
|
170
180
|
.seam-accordion-row-content {
|
|
171
|
-
max-height:
|
|
181
|
+
max-height: 128px;
|
|
172
182
|
opacity: 1;
|
|
173
183
|
}
|
|
174
184
|
|
|
@@ -183,7 +193,8 @@
|
|
|
183
193
|
}
|
|
184
194
|
|
|
185
195
|
.seam-accordion-row-inner-content {
|
|
186
|
-
|
|
196
|
+
width: 100%;
|
|
197
|
+
height: 128px;
|
|
187
198
|
padding: 0 16px;
|
|
188
199
|
overflow: hidden;
|
|
189
200
|
}
|
|
@@ -703,6 +703,31 @@
|
|
|
703
703
|
}
|
|
704
704
|
}
|
|
705
705
|
|
|
706
|
+
@mixin status {
|
|
707
|
+
.seam-thermostat-mutation-status {
|
|
708
|
+
display: flex;
|
|
709
|
+
justify-content: center;
|
|
710
|
+
align-items: center;
|
|
711
|
+
flex-direction: row;
|
|
712
|
+
gap: 4px;
|
|
713
|
+
opacity: 0;
|
|
714
|
+
transition: 0.2s ease-in-out;
|
|
715
|
+
|
|
716
|
+
&.is-visible {
|
|
717
|
+
opacity: 1;
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
.seam-thermostat-mutation-status-icon {
|
|
722
|
+
opacity: 0.25;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
.seam-thermostat-mutation-status-label {
|
|
726
|
+
font-size: 14px;
|
|
727
|
+
color: colors.$text-gray-2-5;
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
|
|
706
731
|
@mixin all {
|
|
707
732
|
@include climate-setting-control-group;
|
|
708
733
|
@include temperature-control-group;
|
|
@@ -712,4 +737,5 @@
|
|
|
712
737
|
@include mode-menu-common;
|
|
713
738
|
@include fan-mode-menu;
|
|
714
739
|
@include climate-mode-menu;
|
|
740
|
+
@include status;
|
|
715
741
|
}
|