@seamapi/react 4.6.0 → 4.7.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 (80) hide show
  1. package/README.md +2 -2
  2. package/dist/elements.js +11530 -9343
  3. package/dist/elements.js.map +1 -1
  4. package/dist/index.css +255 -3
  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/icons/Trash.d.ts +2 -0
  9. package/lib/icons/Trash.js +5 -0
  10. package/lib/icons/Trash.js.map +1 -0
  11. package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.js +17 -1
  12. package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.js.map +1 -1
  13. package/lib/seam/thermostats/thermostat-device.d.ts +2 -1
  14. package/lib/seam/thermostats/thermostat-device.js.map +1 -1
  15. package/lib/seam/thermostats/unit-conversion.d.ts +5 -2
  16. package/lib/seam/thermostats/unit-conversion.js +5 -2
  17. package/lib/seam/thermostats/unit-conversion.js.map +1 -1
  18. package/lib/seam/thermostats/use-create-thermostat-climate-preset.d.ts +6 -0
  19. package/lib/seam/thermostats/use-create-thermostat-climate-preset.js +55 -0
  20. package/lib/seam/thermostats/use-create-thermostat-climate-preset.js.map +1 -0
  21. package/lib/seam/thermostats/use-delete-thermostat-climate-preset.d.ts +6 -0
  22. package/lib/seam/thermostats/use-delete-thermostat-climate-preset.js +44 -0
  23. package/lib/seam/thermostats/use-delete-thermostat-climate-preset.js.map +1 -0
  24. package/lib/seam/thermostats/use-update-thermostat-climate-preset.d.ts +6 -0
  25. package/lib/seam/thermostats/use-update-thermostat-climate-preset.js +55 -0
  26. package/lib/seam/thermostats/use-update-thermostat-climate-preset.js.map +1 -0
  27. package/lib/ui/Button.d.ts +3 -2
  28. package/lib/ui/Button.js +12 -4
  29. package/lib/ui/Button.js.map +1 -1
  30. package/lib/ui/IconButton.d.ts +5 -2
  31. package/lib/ui/IconButton.js +2 -2
  32. package/lib/ui/IconButton.js.map +1 -1
  33. package/lib/ui/Popover/Popover.d.ts +17 -0
  34. package/lib/ui/Popover/Popover.js +85 -0
  35. package/lib/ui/Popover/Popover.js.map +1 -0
  36. package/lib/ui/Popover/PopoverContentPrompt.d.ts +11 -0
  37. package/lib/ui/Popover/PopoverContentPrompt.js +12 -0
  38. package/lib/ui/Popover/PopoverContentPrompt.js.map +1 -0
  39. package/lib/ui/thermostat/ClimateModeMenu.d.ts +7 -2
  40. package/lib/ui/thermostat/ClimateModeMenu.js +7 -2
  41. package/lib/ui/thermostat/ClimateModeMenu.js.map +1 -1
  42. package/lib/ui/thermostat/ClimatePreset.d.ts +8 -0
  43. package/lib/ui/thermostat/ClimatePreset.js +141 -0
  44. package/lib/ui/thermostat/ClimatePreset.js.map +1 -0
  45. package/lib/ui/thermostat/ClimatePresets.d.ts +9 -0
  46. package/lib/ui/thermostat/ClimatePresets.js +72 -0
  47. package/lib/ui/thermostat/ClimatePresets.js.map +1 -0
  48. package/lib/ui/thermostat/FanModeMenu.d.ts +3 -1
  49. package/lib/ui/thermostat/FanModeMenu.js +5 -2
  50. package/lib/ui/thermostat/FanModeMenu.js.map +1 -1
  51. package/lib/ui/thermostat/ThermostatCard.d.ts +1 -0
  52. package/lib/ui/thermostat/ThermostatCard.js +4 -2
  53. package/lib/ui/thermostat/ThermostatCard.js.map +1 -1
  54. package/lib/ui/types.d.ts +3 -3
  55. package/lib/version.d.ts +1 -1
  56. package/lib/version.js +1 -1
  57. package/package.json +3 -2
  58. package/src/lib/icons/Trash.tsx +28 -0
  59. package/src/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.tsx +52 -1
  60. package/src/lib/seam/thermostats/thermostat-device.ts +4 -0
  61. package/src/lib/seam/thermostats/unit-conversion.ts +12 -2
  62. package/src/lib/seam/thermostats/use-create-thermostat-climate-preset.ts +101 -0
  63. package/src/lib/seam/thermostats/use-delete-thermostat-climate-preset.ts +84 -0
  64. package/src/lib/seam/thermostats/use-update-thermostat-climate-preset.ts +103 -0
  65. package/src/lib/ui/Button.tsx +20 -3
  66. package/src/lib/ui/IconButton.tsx +19 -2
  67. package/src/lib/ui/Popover/Popover.tsx +168 -0
  68. package/src/lib/ui/Popover/PopoverContentPrompt.tsx +58 -0
  69. package/src/lib/ui/thermostat/ClimateModeMenu.tsx +33 -1
  70. package/src/lib/ui/thermostat/ClimatePreset.tsx +373 -0
  71. package/src/lib/ui/thermostat/ClimatePresets.tsx +235 -0
  72. package/src/lib/ui/thermostat/FanModeMenu.tsx +20 -2
  73. package/src/lib/ui/thermostat/ThermostatCard.tsx +10 -4
  74. package/src/lib/ui/types.ts +3 -3
  75. package/src/lib/version.ts +1 -1
  76. package/src/styles/_buttons.scss +56 -2
  77. package/src/styles/_main.scss +2 -0
  78. package/src/styles/_popover.scss +46 -0
  79. package/src/styles/_spinner.scss +1 -1
  80. package/src/styles/_thermostat.scss +154 -2
@@ -1,10 +1,11 @@
1
1
  @use './typography';
2
2
  @use './colors';
3
+ @use 'sass:color';
3
4
 
4
5
  @mixin icon-button {
5
6
  .seam-icon-btn {
6
7
  border-radius: 6px;
7
- border: 1px solid rgb(0 122 252 / 50%);
8
+ border: 1px solid rgba(colors.$primary, 50%);
8
9
  cursor: pointer;
9
10
  background: colors.$white;
10
11
  padding: 2px;
@@ -19,7 +20,19 @@
19
20
  }
20
21
 
21
22
  &:hover {
22
- background: rgb(0 122 252 / 8%);
23
+ background: rgba(colors.$primary, 0.08);
24
+ }
25
+
26
+ &.seam-icon-btn-disabled,
27
+ &:disabled {
28
+ color: colors.$text-gray-2-5;
29
+ border-color: colors.$text-gray-3;
30
+ background: colors.$white;
31
+ cursor: not-allowed;
32
+
33
+ path {
34
+ fill: colors.$text-gray-2-5;
35
+ }
23
36
  }
24
37
  }
25
38
  }
@@ -101,6 +114,23 @@
101
114
  }
102
115
  }
103
116
 
117
+ &.seam-btn-danger {
118
+ color: colors.$status-red;
119
+ border: 1px solid colors.$status-red;
120
+ background: transparent;
121
+
122
+ &:hover {
123
+ color: color.scale(colors.$status-red, $lightness: 30%);
124
+ border-color: color.scale(colors.$status-red, $lightness: 30%);
125
+ }
126
+
127
+ &.seam-btn-disabled,
128
+ &:disabled {
129
+ color: colors.$text-gray-2-5;
130
+ border-color: colors.$text-gray-2-5;
131
+ }
132
+ }
133
+
104
134
  &.seam-btn-neutral {
105
135
  color: colors.$text-gray-1;
106
136
  border: 1px solid colors.$text-gray-2-5;
@@ -125,6 +155,7 @@
125
155
  @include button-size;
126
156
  @include button-variant;
127
157
 
158
+ position: relative;
128
159
  font-weight: 600;
129
160
  cursor: pointer;
130
161
 
@@ -132,6 +163,29 @@
132
163
  &:disabled {
133
164
  cursor: not-allowed;
134
165
  }
166
+
167
+ .seam-btn-loading {
168
+ position: absolute;
169
+ top: 0;
170
+ left: 0;
171
+ width: 100%;
172
+ height: 100%;
173
+ display: flex;
174
+ justify-content: center;
175
+ align-items: center;
176
+
177
+ --spinner-color: currentcolor;
178
+ }
179
+
180
+ .seam-btn-content {
181
+ display: contents;
182
+ }
183
+
184
+ &.seam-btn-loading {
185
+ .seam-btn-content {
186
+ visibility: hidden;
187
+ }
188
+ }
135
189
  }
136
190
  }
137
191
 
@@ -30,6 +30,7 @@
30
30
  @use './tab-set';
31
31
  @use './noise-sensor';
32
32
  @use './seam-editable-device-name';
33
+ @use './popover';
33
34
 
34
35
  .seam-components {
35
36
  // Reset
@@ -68,4 +69,5 @@
68
69
  @include thermostat.all;
69
70
  @include seam-table.all;
70
71
  @include noise-sensor.all;
72
+ @include popover.all;
71
73
  }
@@ -0,0 +1,46 @@
1
+ @use './colors';
2
+
3
+ @mixin popover {
4
+ .seam-popover {
5
+ display: inline-block;
6
+ border-radius: 8px;
7
+ overflow: hidden;
8
+ box-shadow: 0 2px 10px -2px rgb(0 0 0 / 20%);
9
+ background-color: colors.$bg-a;
10
+ border: 1px solid colors.$bg-c;
11
+ }
12
+ }
13
+
14
+ @mixin popover-content-prompt {
15
+ .seam-popover-content-prompt {
16
+ display: inline-flex;
17
+ flex-flow: column nowrap;
18
+ padding: 12px;
19
+ gap: 12px;
20
+ background-color: colors.$bg-a;
21
+ }
22
+
23
+ .seam-popover-content-prompt-text {
24
+ font-weight: 600;
25
+ text-align: center;
26
+ }
27
+
28
+ .seam-popover-content-prompt-description {
29
+ font-weight: 400;
30
+ text-align: center;
31
+ color: colors.$text-gray-2;
32
+ font-size: 12px;
33
+ }
34
+
35
+ .seam-popover-content-prompt-buttons {
36
+ display: flex;
37
+ flex-flow: row nowrap;
38
+ gap: 6px;
39
+ justify-content: flex-end;
40
+ }
41
+ }
42
+
43
+ @mixin all {
44
+ @include popover;
45
+ @include popover-content-prompt;
46
+ }
@@ -17,7 +17,7 @@
17
17
  .seam-spinner {
18
18
  width: $default-size;
19
19
  height: $default-size;
20
- border: $default-border-width solid colors.$primary;
20
+ border: $default-border-width solid var(--spinner-color, colors.$primary);
21
21
  border-top: $default-border-width solid transparent;
22
22
  display: inline-block;
23
23
  border-radius: 50%;
@@ -1,4 +1,6 @@
1
1
  @use './colors';
2
+ @use 'sass:color';
3
+ @use './access-code-form' as acf;
2
4
 
3
5
  @mixin climate-setting-control-group {
4
6
  .seam-climate-setting-control-group {
@@ -542,7 +544,6 @@
542
544
  @mixin fan-mode-menu {
543
545
  .seam-fan-mode-menu-button {
544
546
  width: 130px;
545
- height: 32px;
546
547
  display: flex;
547
548
  justify-content: space-between;
548
549
  align-items: center;
@@ -554,6 +555,14 @@
554
555
  cursor: pointer;
555
556
  transition: 0.2s ease;
556
557
 
558
+ &.seam-fan-mode-menu-button-size-regular {
559
+ height: 32px;
560
+ }
561
+
562
+ &.seam-fan-mode-menu-button-size-large {
563
+ height: 48px;
564
+ }
565
+
557
566
  svg {
558
567
  font-size: 20px;
559
568
  }
@@ -579,6 +588,10 @@
579
588
  }
580
589
  }
581
590
 
591
+ &.seam-fan-mode-menu-button-block-sized {
592
+ width: 100%;
593
+ }
594
+
582
595
  .seam-fan-mode-menu-button-text {
583
596
  color: colors.$text-gray-1;
584
597
  font-size: 16px;
@@ -597,12 +610,23 @@
597
610
  border: 1px solid colors.$text-gray-3;
598
611
  background: colors.$white;
599
612
  display: flex;
600
- justify-content: space-between;
601
613
  align-items: center;
602
614
  flex-direction: row;
603
615
  cursor: pointer;
604
616
  transition: 0.2s ease;
605
617
 
618
+ &.seam-climate-mode-menu-button-regular {
619
+ height: 32px;
620
+ }
621
+
622
+ &.seam-climate-mode-menu-button-large {
623
+ height: 48px;
624
+ }
625
+
626
+ &.seam-climate-mode-menu-button-block {
627
+ width: 100%;
628
+ }
629
+
606
630
  &:hover {
607
631
  border-color: colors.$text-gray-2;
608
632
  }
@@ -618,6 +642,12 @@
618
642
 
619
643
  .seam-climate-mode-menu-button-chevron {
620
644
  font-size: 20px;
645
+ margin-left: auto;
646
+ }
647
+
648
+ .seam-climate-mode-menu-button-text {
649
+ font-size: 14px;
650
+ margin-left: 6px;
621
651
  }
622
652
  }
623
653
 
@@ -656,6 +686,126 @@
656
686
  }
657
687
  }
658
688
 
689
+ @mixin climate-presets {
690
+ .seam-thermostat-climate-presets-body {
691
+ margin: 0 24px 24px;
692
+ display: flex;
693
+ flex-flow: column nowrap;
694
+ gap: 10px;
695
+ justify-content: center;
696
+ }
697
+
698
+ .seam-thermostat-climate-presets-cards {
699
+ display: flex;
700
+ flex-flow: row wrap;
701
+ gap: 10px;
702
+ justify-content: center;
703
+ }
704
+
705
+ .seam-climate-presets-add-button {
706
+ margin: 0 auto;
707
+ display: inline-flex !important;
708
+ align-items: center;
709
+ gap: 6px;
710
+
711
+ svg {
712
+ font-size: 20px;
713
+ }
714
+
715
+ svg,
716
+ path {
717
+ fill: currentcolor;
718
+ }
719
+ }
720
+
721
+ .seam-thermostat-climate-presets-card {
722
+ border-radius: 12px;
723
+ background-color: colors.$bg-a;
724
+ width: 100%;
725
+ max-width: 250px;
726
+ overflow: hidden;
727
+
728
+ .seam-thermostat-climate-presets-card-top {
729
+ display: flex;
730
+ flex-flow: row nowrap;
731
+ align-items: center;
732
+ gap: 8px;
733
+ width: 100%;
734
+ justify-content: space-between;
735
+ border-bottom: 1px solid color.scale(colors.$bg-a, $lightness: -5%);
736
+ padding: 8px;
737
+ background-color: colors.$bg-b;
738
+
739
+ .seam-thermostat-climate-presets-card-name {
740
+ font-size: 16px;
741
+ font-weight: 600;
742
+ line-height: 118%;
743
+ white-space: nowrap;
744
+ }
745
+
746
+ .seam-thermostat-climate-presets-card-name-key {
747
+ font-size: 12px;
748
+ font-weight: 400;
749
+ line-height: 118%;
750
+ white-space: nowrap;
751
+ color: colors.$text-gray-2;
752
+ }
753
+
754
+ .seam-thermostat-climate-presets-card-buttons {
755
+ display: flex;
756
+ flex-flow: row nowrap;
757
+ gap: 4px;
758
+ justify-content: flex-end;
759
+ }
760
+ }
761
+
762
+ .seam-thermostat-climate-presets-card-body {
763
+ display: flex;
764
+ flex-flow: row wrap;
765
+ align-items: center;
766
+ gap: 10px;
767
+ width: 100%;
768
+ padding: 8px;
769
+ justify-content: space-around;
770
+ }
771
+
772
+ .seam-thermostat-climate-preset-chip {
773
+ display: inline-flex;
774
+ flex-flow: row nowrap;
775
+ gap: 4px;
776
+ align-items: center;
777
+ justify-content: space-between;
778
+ width: max-content;
779
+
780
+ .seam-thermostat-climate-preset-chip-icon {
781
+ color: colors.$text-gray-1;
782
+ font-weight: 600;
783
+
784
+ svg {
785
+ position: relative;
786
+ top: 2px;
787
+ }
788
+ }
789
+
790
+ .seam-thermostat-climate-preset-chip-value {
791
+ font-weight: 600;
792
+ }
793
+ }
794
+ }
795
+ }
796
+
797
+ @mixin climate-preset {
798
+ .seam-thermostat-climate-preset {
799
+ @include acf.main;
800
+
801
+ .seam-climate-preset-buttons {
802
+ display: flex;
803
+ flex-flow: row nowrap;
804
+ gap: 8px;
805
+ }
806
+ }
807
+ }
808
+
659
809
  @mixin all {
660
810
  @include climate-setting-control-group;
661
811
  @include temperature-control-group;
@@ -666,4 +816,6 @@
666
816
  @include fan-mode-menu;
667
817
  @include climate-mode-menu;
668
818
  @include status;
819
+ @include climate-presets;
820
+ @include climate-preset;
669
821
  }