@terraware/web-components 3.5.12-rc.7 → 3.5.12

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 (230) hide show
  1. package/components/AntSwitch/index.js +27 -0
  2. package/components/AntSwitch/styles.scss +66 -0
  3. package/components/Autocomplete/Autocomplete.js +131 -0
  4. package/components/Autocomplete/styles.scss +155 -0
  5. package/components/Badge/index.js +32 -0
  6. package/components/BusySpinner/index.js +49 -0
  7. package/components/Button/Button.js +51 -0
  8. package/components/Button/button.test.js +25 -0
  9. package/components/Button/styles.scss +453 -0
  10. package/components/Checkbox.js +70 -0
  11. package/components/Confirm/index.js +94 -0
  12. package/components/DatePicker/DatePicker.js +150 -0
  13. package/components/DatePicker/styles.scss +95 -0
  14. package/components/DialogBox/DialogBox.js +91 -0
  15. package/components/DialogBox/styles.scss +165 -0
  16. package/components/Divisor.js +21 -0
  17. package/components/Dropdown.js +102 -0
  18. package/components/ErrorBox/ErrorBox.js +47 -0
  19. package/components/ErrorBox/styles.scss +63 -0
  20. package/components/FileChooser/index.js +137 -0
  21. package/components/FormBottomBar/index.js +90 -0
  22. package/components/Icon/Icon.js +25 -0
  23. package/components/Icon/icons/index.js +241 -0
  24. package/components/Icon/styles.scss +41 -0
  25. package/components/IconTooltip/index.js +61 -0
  26. package/components/Map/MapBox.d.ts.map +1 -1
  27. package/components/Map/MapBox.js +479 -0
  28. package/components/Map/MapContainer.js +30 -0
  29. package/components/Map/MapDateSliderControl.js +66 -0
  30. package/components/Map/MapDrawer.js +45 -0
  31. package/components/Map/MapLegend.js +172 -0
  32. package/components/Map/MapViewStyleControl.js +74 -0
  33. package/components/Map/ReactMapboxWrapper.d.ts +3 -0
  34. package/components/Map/ReactMapboxWrapper.d.ts.map +1 -0
  35. package/components/Map/ReactMapboxWrapper.js +9 -0
  36. package/components/Map/index.js +190 -0
  37. package/components/Map/styles.scss +130 -0
  38. package/components/Map/types.js +24 -0
  39. package/components/Map/useMaintainLayerOrder.js +32 -0
  40. package/components/Message/Message.js +67 -0
  41. package/components/Message/styles.scss +202 -0
  42. package/components/MultiSelect/MultiSelect.test.js +75 -0
  43. package/components/MultiSelect/index.js +120 -0
  44. package/components/MultiSelect/styles.scss +180 -0
  45. package/components/Navbar/NavFooter.js +17 -0
  46. package/components/Navbar/NavItem.js +73 -0
  47. package/components/Navbar/NavSection.js +22 -0
  48. package/components/Navbar/Navbar.js +46 -0
  49. package/components/Navbar/SubNavbar.js +17 -0
  50. package/components/Navbar/styles.scss +155 -0
  51. package/components/Note.js +25 -0
  52. package/components/PageForm/index.js +43 -0
  53. package/components/PhotoChooser/index.js +137 -0
  54. package/components/Pill/index.js +46 -0
  55. package/components/Pill/styles.scss +50 -0
  56. package/components/PillList/index.js +29 -0
  57. package/components/PillList/styles.scss +12 -0
  58. package/components/PlacementWrapper/index.js +63 -0
  59. package/components/PopoverMenu/Popover.js +88 -0
  60. package/components/PopoverMenu/index.js +59 -0
  61. package/components/PopoverMultiSelect/index.js +62 -0
  62. package/components/PopoverMultiSelect/styles.scss +10 -0
  63. package/components/ProgressCircle/ProgressCircle.js +34 -0
  64. package/components/ProgressCircle/styles.scss +87 -0
  65. package/components/RadioButton.js +25 -0
  66. package/components/Select/Select.js +19 -0
  67. package/components/Select/SelectT.js +245 -0
  68. package/components/Select/styles.scss +307 -0
  69. package/components/Separator/index.js +21 -0
  70. package/components/Size.js +5 -0
  71. package/components/Slider/index.js +60 -0
  72. package/components/SummaryBox.js +73 -0
  73. package/components/Tabs/index.js +111 -0
  74. package/components/TextTruncated/index.js +146 -0
  75. package/components/Textfield/Textfield.js +172 -0
  76. package/components/Textfield/TruncatedTextArea.js +71 -0
  77. package/components/Textfield/styles.scss +271 -0
  78. package/components/Tooltip/Tooltip.js +54 -0
  79. package/components/ViewPhotosDialog/index.js +136 -0
  80. package/components/ViewPhotosDialog/styles.scss +18 -0
  81. package/components/svg/BlobbyGrayIconImage.js +39 -0
  82. package/components/svg/BlobbyGrayIconImport.js +39 -0
  83. package/components/svg/BlobbyGrayIconUploadToTheCloud.js +39 -0
  84. package/components/svg/BlobbyIconCloudChecked.js +156 -0
  85. package/components/svg/BlobbyIconExportOrUploadPhoto.js +156 -0
  86. package/components/svg/BlobbyIconFolder.js +156 -0
  87. package/components/svg/BlobbyIconGraphReport.js +156 -0
  88. package/components/svg/BlobbyIconHappy.js +156 -0
  89. package/components/svg/BlobbyIconHeartMonitor.js +156 -0
  90. package/components/svg/BlobbyIconLeaf.js +156 -0
  91. package/components/svg/BlobbyIconLibrary.js +156 -0
  92. package/components/svg/BlobbyIconNursery.js +158 -0
  93. package/components/svg/BlobbyIconOrganization.js +156 -0
  94. package/components/svg/BlobbyIconParchment.js +156 -0
  95. package/components/svg/BlobbyIconPeople.js +156 -0
  96. package/components/svg/BlobbyIconSeedBank.js +156 -0
  97. package/components/svg/BlobbyIconSeedling.js +156 -0
  98. package/components/svg/BlobbyIconSeeds.js +156 -0
  99. package/components/svg/BlobbyIconSite.js +159 -0
  100. package/components/svg/BlobbyIconSparkles.js +156 -0
  101. package/components/svg/BlobbyIconWrench.js +156 -0
  102. package/components/svg/Bug.js +25 -0
  103. package/components/svg/Calendar.js +25 -0
  104. package/components/svg/CaretDown.js +25 -0
  105. package/components/svg/CaretLeft.js +25 -0
  106. package/components/svg/CaretRight.js +25 -0
  107. package/components/svg/CaretUp.js +25 -0
  108. package/components/svg/ChevronDown.js +25 -0
  109. package/components/svg/ChevronUp.js +25 -0
  110. package/components/svg/Close.js +25 -0
  111. package/components/svg/Critical.js +25 -0
  112. package/components/svg/Edit.js +156 -0
  113. package/components/svg/Error.js +25 -0
  114. package/components/svg/Filter.js +25 -0
  115. package/components/svg/Folder.js +25 -0
  116. package/components/svg/Help.js +25 -0
  117. package/components/svg/Home.js +25 -0
  118. package/components/svg/IconAdd.js +25 -0
  119. package/components/svg/IconArrowRight.js +27 -0
  120. package/components/svg/IconBusinessNetwork.js +25 -0
  121. package/components/svg/IconCancel.js +25 -0
  122. package/components/svg/IconChargingBattery.js +25 -0
  123. package/components/svg/IconCheckmark.js +25 -0
  124. package/components/svg/IconCoinInHand.js +25 -0
  125. package/components/svg/IconColumns.js +25 -0
  126. package/components/svg/IconComment.js +26 -0
  127. package/components/svg/IconDashboard.js +25 -0
  128. package/components/svg/IconDataMigration.js +25 -0
  129. package/components/svg/IconEdit.js +27 -0
  130. package/components/svg/IconExport.js +25 -0
  131. package/components/svg/IconExternalLink.js +25 -0
  132. package/components/svg/IconEye.js +25 -0
  133. package/components/svg/IconEyeOff.js +25 -0
  134. package/components/svg/IconFile.js +25 -0
  135. package/components/svg/IconFolder.js +25 -0
  136. package/components/svg/IconFullScreen.js +26 -0
  137. package/components/svg/IconFutures.js +25 -0
  138. package/components/svg/IconGraphReport.js +25 -0
  139. package/components/svg/IconHeartMonitor.js +25 -0
  140. package/components/svg/IconHelp.js +27 -0
  141. package/components/svg/IconHistory.js +25 -0
  142. package/components/svg/IconImport.js +25 -0
  143. package/components/svg/IconIndex.js +25 -0
  144. package/components/svg/IconLayers.js +25 -0
  145. package/components/svg/IconLibrary.js +26 -0
  146. package/components/svg/IconList.js +25 -0
  147. package/components/svg/IconLivePlant.js +25 -0
  148. package/components/svg/IconLocations.js +25 -0
  149. package/components/svg/IconMail.js +25 -0
  150. package/components/svg/IconManager.js +25 -0
  151. package/components/svg/IconMarker.js +25 -0
  152. package/components/svg/IconMenu.js +25 -0
  153. package/components/svg/IconMenuHorizontal.js +25 -0
  154. package/components/svg/IconModule.js +25 -0
  155. package/components/svg/IconMyLocation.js +25 -0
  156. package/components/svg/IconNote.js +27 -0
  157. package/components/svg/IconNursery.js +27 -0
  158. package/components/svg/IconOrg.js +25 -0
  159. package/components/svg/IconParchment.js +25 -0
  160. package/components/svg/IconPhoto.js +25 -0
  161. package/components/svg/IconRedo.js +25 -0
  162. package/components/svg/IconRestorationSite.js +25 -0
  163. package/components/svg/IconSeedBank.js +25 -0
  164. package/components/svg/IconSeedling.js +25 -0
  165. package/components/svg/IconSettings.js +25 -0
  166. package/components/svg/IconSlice.js +25 -0
  167. package/components/svg/IconSubmit.js +25 -0
  168. package/components/svg/IconSubtract.js +27 -0
  169. package/components/svg/IconSynced.js +25 -0
  170. package/components/svg/IconTrashCan.js +25 -0
  171. package/components/svg/IconTreasureMap.js +25 -0
  172. package/components/svg/IconUndo.js +25 -0
  173. package/components/svg/IconVariable.js +25 -0
  174. package/components/svg/IconWifi.js +25 -0
  175. package/components/svg/Info.js +25 -0
  176. package/components/svg/Key.js +25 -0
  177. package/components/svg/Leaf.js +25 -0
  178. package/components/svg/Lock.js +25 -0
  179. package/components/svg/Logo.js +43 -0
  180. package/components/svg/MenuVertical.js +25 -0
  181. package/components/svg/Notification.js +25 -0
  182. package/components/svg/Person.js +25 -0
  183. package/components/svg/Plus.js +25 -0
  184. package/components/svg/RestorationSite.js +25 -0
  185. package/components/svg/Search.js +25 -0
  186. package/components/svg/Seeds.js +25 -0
  187. package/components/svg/Site.js +25 -0
  188. package/components/svg/Sparkles.js +25 -0
  189. package/components/svg/Species.js +25 -0
  190. package/components/svg/Species2.js +156 -0
  191. package/components/svg/Spinner.js +52 -0
  192. package/components/svg/Success.js +25 -0
  193. package/components/svg/SuccessFilled.js +25 -0
  194. package/components/svg/TerrawareLogoDesktop.js +49 -0
  195. package/components/svg/TerrawareLogoMobile.js +30 -0
  196. package/components/svg/Touchscreen.js +25 -0
  197. package/components/svg/UploadCloud.js +156 -0
  198. package/components/svg/Warning.js +25 -0
  199. package/components/svg/WelcomeClipboard.js +133 -0
  200. package/components/svg/index.js +832 -0
  201. package/components/table/EnhancedTableToolbar.js +76 -0
  202. package/components/table/EnhancedTableToolbarV2.js +49 -0
  203. package/components/table/TableCellRenderer.js +244 -0
  204. package/components/table/TableHeader.js +75 -0
  205. package/components/table/TableHeaderItem.js +100 -0
  206. package/components/table/density.js +28 -0
  207. package/components/table/index.js +346 -0
  208. package/components/table/sort.js +72 -0
  209. package/components/table/sort.test.js +37 -0
  210. package/components/table/types.js +5 -0
  211. package/components/types/index.js +5 -0
  212. package/fonts/Inter.ttf +0 -0
  213. package/index.css +11 -0
  214. package/index.js +377 -0
  215. package/package.json +2 -5
  216. package/setupTests.js +5 -0
  217. package/style-dictionary-dist/TerrawareTheme.js +193 -0
  218. package/style-dictionary-dist/terraware.scss +414 -0
  219. package/theme.js +86 -0
  220. package/utils/date.js +124 -0
  221. package/utils/date.test.js +87 -0
  222. package/utils/index.js +53 -0
  223. package/utils/preventDefaultEvent.js +8 -0
  224. package/utils/text.js +17 -0
  225. package/utils/text.test.js +23 -0
  226. package/utils/useDeviceInfo.js +85 -0
  227. package/index.cjs.js +0 -88606
  228. package/index.cjs.js.map +0 -1
  229. package/index.esm.js +0 -88533
  230. package/index.esm.js.map +0 -1
@@ -0,0 +1,271 @@
1
+ @use 'sass:math';
2
+
3
+ @import '../../style-dictionary-dist/terraware.scss';
4
+
5
+ @font-face {
6
+ font-family: 'Inter';
7
+ src: local('Inter'), url(../../fonts/Inter.ttf) format('truetype');
8
+ }
9
+
10
+ .textfield {
11
+ display: flex;
12
+ flex-flow: row wrap;
13
+
14
+ .textfield-label {
15
+ font-family: $tw-fnt-frm-fld-label-font-family;
16
+ font-size: $tw-fnt-frm-fld-label-font-size;
17
+ font-weight: $tw-fnt-frm-fld-label-font-weight;
18
+ line-height: $tw-fnt-frm-fld-label-line-height;
19
+ color: $tw-clr-txt-secondary;
20
+ margin-bottom: $tw-spc-base-xx-small;
21
+ display: block;
22
+ width: 100%;
23
+ max-width: 100%;
24
+ }
25
+
26
+ .textfield-help-text {
27
+ font-family: $tw-fnt-frm-fld-help-text-font-family;
28
+ font-size: $tw-fnt-frm-fld-help-text-font-size;
29
+ font-weight: $tw-fnt-frm-fld-help-text-font-weight;
30
+ line-height: $tw-fnt-frm-fld-help-text-line-height;
31
+ color: $tw-clr-txt-secondary;
32
+ display: block;
33
+ width: 100%;
34
+ max-width: 100%;
35
+ margin-top: $tw-spc-base-xx-small;
36
+ }
37
+
38
+ textarea {
39
+ font-family: $tw-fnt-frm-fld-text-value-font-family;
40
+ font-size: $tw-fnt-frm-fld-text-value-font-size;
41
+ font-weight: $tw-fnt-frm-fld-text-value-font-weight;
42
+ line-height: $tw-fnt-frm-fld-text-value-line-height;
43
+ color: $tw-clr-txt;
44
+ padding-top: 0;
45
+ padding-bottom: 0;
46
+ &::placeholder {
47
+ font-family: $tw-fnt-frm-fld-text-placeholder-font-family;
48
+ font-size: $tw-fnt-frm-fld-text-placeholder-font-size;
49
+ font-weight: $tw-fnt-frm-fld-text-placeholder-font-weight;
50
+ line-height: $tw-fnt-frm-fld-text-placeholder-line-height;
51
+ color: $tw-clr-txt-tertiary;
52
+ }
53
+ &:focus-visible {
54
+ outline: none;
55
+ }
56
+ }
57
+
58
+ .textfield-value {
59
+ background-color: $tw-clr-bg;
60
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-brdr-secondary;
61
+ padding: #{$tw-spc-base-x-small - $tw-sz-frm-fld-text-input-stroke};
62
+ border-radius: $tw-sz-base-x-small;
63
+ width: 100%;
64
+ max-width: 100%;
65
+ display: flex;
66
+
67
+ &:hover {
68
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-brdr-hover;
69
+ }
70
+
71
+ &:active {
72
+ padding: #{$tw-spc-base-x-small - $tw-sz-frm-fld-text-input-stroke-active};
73
+ border: $tw-sz-frm-fld-text-input-stroke-active solid $tw-clr-brdr-hover;
74
+ outline: $tw-sz-frm-fld-text-input-stroke-active solid $tw-clr-brdr-active;
75
+ }
76
+
77
+ &:focus-within {
78
+ padding: #{$tw-spc-base-x-small - $tw-sz-frm-fld-text-input-stroke-active};
79
+ border: $tw-sz-frm-fld-text-input-stroke-active solid $tw-clr-brdr-hover;
80
+ outline: $tw-sz-frm-fld-text-input-stroke-active solid $tw-clr-brdr-active;
81
+ outline-offset: -$tw-sz-frm-fld-text-input-stroke-active;
82
+ }
83
+
84
+ input {
85
+ border: none;
86
+ width: 100%;
87
+ font-family: $tw-fnt-frm-fld-text-value-font-family;
88
+ font-size: $tw-fnt-frm-fld-text-value-font-size;
89
+ font-weight: $tw-fnt-frm-fld-text-value-font-weight;
90
+ line-height: $tw-fnt-frm-fld-text-value-line-height;
91
+ color: $tw-clr-txt;
92
+ background: transparent;
93
+ padding-top: 0;
94
+ padding-bottom: 0;
95
+ &::placeholder {
96
+ font-family: $tw-fnt-frm-fld-text-placeholder-font-family;
97
+ font-size: $tw-fnt-frm-fld-text-placeholder-font-size;
98
+ font-weight: $tw-fnt-frm-fld-text-placeholder-font-weight;
99
+ line-height: $tw-fnt-frm-fld-text-placeholder-line-height;
100
+ color: $tw-clr-txt-tertiary;
101
+ }
102
+ &:focus-visible {
103
+ outline: none;
104
+ }
105
+ }
106
+
107
+ &--display {
108
+ font-family: $tw-fnt-frm-fld-text-value-font-family;
109
+ font-size: $tw-fnt-frm-fld-text-value-font-size;
110
+ font-weight: $tw-fnt-frm-fld-text-value-font-weight;
111
+ line-height: $tw-fnt-frm-fld-text-value-line-height;
112
+ padding: $tw-spc-base-x-small 0;
113
+ margin: 0;
114
+
115
+ &.preserve-newlines {
116
+ white-space: pre-line;
117
+ }
118
+ }
119
+
120
+ &--disabled {
121
+ opacity: $tw-opcty-semantic-off;
122
+
123
+ &:hover {
124
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-brdr-secondary;
125
+ }
126
+
127
+ &:active {
128
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-brdr-secondary;
129
+ outline: 0;
130
+ padding: #{$tw-spc-base-x-small - $tw-sz-frm-fld-text-input-stroke};
131
+ }
132
+
133
+ &:focus-within {
134
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-brdr-secondary;
135
+ outline: 0;
136
+ }
137
+ }
138
+
139
+ &--icon-container {
140
+ background: none;
141
+ border: 0;
142
+ padding: 0;
143
+ }
144
+
145
+ &--icon-right {
146
+ width: $tw-fnt-frm-fld-text-value-line-height;
147
+ height: $tw-fnt-frm-fld-text-value-line-height;
148
+ fill: $tw-clr-icn-secondary;
149
+ margin-left: $tw-spc-base-x-small;
150
+ vertical-align: top;
151
+
152
+ &--cancel {
153
+ width: $tw-sz-base-small;
154
+ height: $tw-sz-base-small;
155
+ fill: $tw-clr-icn-secondary;
156
+ margin-left: $tw-spc-base-x-small;
157
+ margin-right: $tw-spc-base-xx-small;
158
+ vertical-align: top;
159
+ }
160
+ }
161
+
162
+ &--icon-left {
163
+ width: $tw-fnt-frm-fld-text-value-line-height;
164
+ height: $tw-fnt-frm-fld-text-value-line-height;
165
+ fill: $tw-clr-icn-secondary;
166
+ margin-right: $tw-spc-base-x-small;
167
+ flex-shrink: 0;
168
+ }
169
+
170
+ &--error {
171
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-brdr-danger;
172
+ background-color: $tw-clr-bg-danger-tertiary;
173
+
174
+ &:hover {
175
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-brdr-danger-hover;
176
+ }
177
+
178
+ &:active {
179
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-brdr-danger-active;
180
+ outline: $tw-sz-frm-fld-text-input-stroke-active solid $tw-clr-brdr-danger-active;
181
+ }
182
+
183
+ &:focus-within {
184
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-brdr-danger-active;
185
+ outline: $tw-sz-frm-fld-text-input-stroke-active solid $tw-clr-brdr-danger-active;
186
+ outline-offset: -$tw-sz-frm-fld-text-input-stroke;
187
+ }
188
+ }
189
+
190
+ &--warning {
191
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-brdr-warning;
192
+ background-color: $tw-clr-bg-warning-tertiary;
193
+
194
+ &:hover {
195
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-brdr-warning-hover;
196
+ }
197
+
198
+ &:active {
199
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-brdr-warning-active;
200
+ outline: $tw-sz-frm-fld-text-input-stroke-active solid $tw-clr-brdr-warning-active;
201
+ }
202
+
203
+ &:focus-within {
204
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-brdr-warning-active;
205
+ outline: $tw-sz-frm-fld-text-input-stroke-active solid $tw-clr-brdr-warning-active;
206
+ outline-offset: -$tw-sz-frm-fld-text-input-stroke;
207
+ }
208
+ }
209
+
210
+ &--readonly {
211
+ background-color: $tw-clr-bg-secondary;
212
+
213
+ &:hover {
214
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-brdr-secondary;
215
+ }
216
+
217
+ &:active {
218
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-brdr-secondary;
219
+ outline: 0;
220
+ padding: #{$tw-spc-base-x-small - $tw-sz-frm-fld-text-input-stroke};
221
+ }
222
+
223
+ &:focus-within {
224
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-brdr-secondary;
225
+ outline: 0;
226
+ }
227
+ }
228
+ }
229
+
230
+ .textfield-label-container {
231
+ display: flex;
232
+ width: 100%;
233
+ margin-top: $tw-spc-base-xx-small;
234
+ }
235
+
236
+ .textfield-error-text {
237
+ font-family: $tw-fnt-frm-fld-error-text-font-family;
238
+ font-size: $tw-fnt-frm-fld-error-text-font-size;
239
+ font-weight: $tw-fnt-frm-fld-error-text-font-weight;
240
+ line-height: $tw-fnt-frm-fld-error-text-line-height;
241
+ color: $tw-clr-txt-danger;
242
+ display: block;
243
+ width: 100%;
244
+ max-width: 100%;
245
+
246
+ &--icon {
247
+ fill: $tw-clr-icn-danger;
248
+ width: $tw-fnt-frm-fld-error-text-line-height;
249
+ height: $tw-fnt-frm-fld-error-text-line-height;
250
+ margin-right: $tw-spc-base-x-small;
251
+ }
252
+ }
253
+
254
+ .textfield-warning-text {
255
+ font-family: $tw-fnt-frm-fld-warning-text-font-family;
256
+ font-size: $tw-fnt-frm-fld-warning-text-font-size;
257
+ font-weight: $tw-fnt-frm-fld-warning-text-font-weight;
258
+ line-height: $tw-fnt-frm-fld-warning-text-line-height;
259
+ color: $tw-clr-txt-warning;
260
+ display: block;
261
+ width: 100%;
262
+ max-width: 100%;
263
+
264
+ &--icon {
265
+ fill: $tw-clr-icn-warning;
266
+ width: $tw-fnt-frm-fld-error-text-line-height;
267
+ height: $tw-fnt-frm-fld-error-text-line-height;
268
+ margin-right: $tw-spc-base-x-small;
269
+ }
270
+ }
271
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = Tooltip;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _material = require("@mui/material");
10
+ var _utils = require("../../utils");
11
+ function Tooltip(_ref) {
12
+ let {
13
+ placement = 'top-start',
14
+ title,
15
+ children
16
+ } = _ref;
17
+ const [open, setOpen] = _react.default.useState(false);
18
+ const {
19
+ isMobile
20
+ } = (0, _utils.useDeviceInfo)();
21
+ const theme = (0, _material.useTheme)();
22
+ const handleTooltipClose = () => {
23
+ setOpen(false);
24
+ };
25
+ const handleTooltipOpen = event => {
26
+ if (event.type === 'click' || event.type === 'mouseover' && !isMobile) {
27
+ setOpen(true);
28
+ }
29
+ };
30
+ return /*#__PURE__*/_react.default.createElement(_material.Tooltip, {
31
+ arrow: true,
32
+ onOpen: handleTooltipOpen,
33
+ onClose: handleTooltipClose,
34
+ open: open,
35
+ placement: placement,
36
+ sx: {
37
+ maxWidth: isMobile ? '342px' : '464px',
38
+ '& .MuiTooltip-arrow': {
39
+ color: theme.palette.TwClrBaseGray800
40
+ },
41
+ '& .MuiTooltip-tooltip': {
42
+ backgroundColor: theme.palette.TwClrBaseGray800,
43
+ color: theme.palette.TwClrBaseWhite,
44
+ padding: '8px',
45
+ '& a': {
46
+ color: theme.palette.TwClrBaseWhite
47
+ }
48
+ }
49
+ },
50
+ title: title
51
+ }, /*#__PURE__*/_react.default.createElement("span", {
52
+ onClick: handleTooltipOpen
53
+ }, children));
54
+ }
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = ViewPhotosDialog;
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _reactMultiCarousel = _interopRequireDefault(require("react-multi-carousel"));
11
+ require("react-multi-carousel/lib/styles.css");
12
+ var _material = require("@mui/material");
13
+ var _BusySpinner = _interopRequireDefault(require("../BusySpinner"));
14
+ var _Button = _interopRequireDefault(require("../Button/Button"));
15
+ var _DialogBox = _interopRequireDefault(require("../DialogBox/DialogBox"));
16
+ require("./styles.scss");
17
+ function ViewPhotosDialog(props) {
18
+ const {
19
+ onClose,
20
+ open,
21
+ photos,
22
+ initialSelectedSlide,
23
+ nextButtonLabel,
24
+ prevButtonLabel,
25
+ title,
26
+ numbered,
27
+ dots
28
+ } = props;
29
+ const [isPreviousDisabled, setIsPreviousDisabled] = (0, _react.useState)(false);
30
+ const [isNextDisabled, setIsNextDisabled] = (0, _react.useState)(false);
31
+ const [isLoading, setIsLoading] = (0, _react.useState)([]);
32
+ const [selectedSlide, setSelectedSlide] = (0, _react.useState)(initialSelectedSlide);
33
+ const myCarousel = (0, _react.useRef)(null);
34
+ const responsive = {
35
+ mobile: {
36
+ breakpoint: {
37
+ max: 4000,
38
+ min: 0
39
+ },
40
+ items: 1
41
+ }
42
+ };
43
+ const handleChange = (0, _react.useCallback)(args => {
44
+ if (myCarousel.current) {
45
+ if (myCarousel.current.state.currentSlide + 1 >= photos.length) {
46
+ setIsNextDisabled(true);
47
+ } else {
48
+ setIsNextDisabled(false);
49
+ }
50
+ if (myCarousel.current.state.currentSlide - 1 < 0) {
51
+ setIsPreviousDisabled(true);
52
+ } else {
53
+ setIsPreviousDisabled(false);
54
+ }
55
+ if (args !== undefined) {
56
+ // if we came from the carousel component's call of handleChange, do the right thing
57
+ // don't set this slide if we came from useEffect on open
58
+ setSelectedSlide(myCarousel.current.state.currentSlide);
59
+ } else {
60
+ // we need to reinitialize to last state
61
+ if (selectedSlide === initialSelectedSlide) {
62
+ // explicitly go to slide, the useEffect won't be triggered
63
+ myCarousel.current.goToSlide(selectedSlide);
64
+ }
65
+ }
66
+ }
67
+ }, [photos.length, selectedSlide, initialSelectedSlide, selectedSlide]);
68
+ (0, _react.useEffect)(() => {
69
+ setIsLoading(new Array(photos.length).fill(true));
70
+ }, [photos.length]);
71
+ (0, _react.useEffect)(() => {
72
+ setSelectedSlide(initialSelectedSlide);
73
+ }, [initialSelectedSlide]);
74
+ (0, _react.useEffect)(() => {
75
+ handleChange();
76
+ }, [open, handleChange]);
77
+ (0, _react.useEffect)(() => {
78
+ if (myCarousel.current) {
79
+ myCarousel.current.goToSlide(selectedSlide);
80
+ }
81
+ }, [selectedSlide]);
82
+ const finishLoading = index => {
83
+ const newIsLoading = [...isLoading];
84
+ newIsLoading[index] = false;
85
+ setIsLoading(newIsLoading);
86
+ };
87
+ return /*#__PURE__*/_react.default.createElement(_DialogBox.default, {
88
+ onClose: onClose,
89
+ open: open,
90
+ title: title,
91
+ size: "large",
92
+ scrolled: true,
93
+ middleButtons: [/*#__PURE__*/_react.default.createElement(_Button.default, {
94
+ label: prevButtonLabel,
95
+ priority: "secondary",
96
+ onClick: () => setSelectedSlide(slide => Math.max(0, slide - 1)),
97
+ key: "button-1",
98
+ disabled: isPreviousDisabled,
99
+ icon: "caretLeft"
100
+ }), /*#__PURE__*/_react.default.createElement(_Button.default, {
101
+ label: nextButtonLabel,
102
+ onClick: () => setSelectedSlide(slide => Math.min(photos.length - 1, slide + 1)),
103
+ key: "button-2",
104
+ disabled: isNextDisabled,
105
+ rightIcon: "caretRight"
106
+ })]
107
+ }, /*#__PURE__*/_react.default.createElement(_material.Box, {
108
+ sx: {
109
+ '& .react-multi-carousel-list': {
110
+ paddingBottom: '20px'
111
+ }
112
+ }
113
+ }, /*#__PURE__*/_react.default.createElement(_reactMultiCarousel.default, {
114
+ responsive: responsive,
115
+ ref: myCarousel,
116
+ showDots: dots !== null && dots !== void 0 ? dots : true,
117
+ arrows: false,
118
+ ssr: true,
119
+ afterChange: handleChange
120
+ }, photos.map((p, i) => /*#__PURE__*/_react.default.createElement("div", {
121
+ key: "photo-".concat(i, "-container"),
122
+ className: "view-photos-dialog-container"
123
+ }, isLoading[i] ? /*#__PURE__*/_react.default.createElement(_BusySpinner.default, {
124
+ noBackground: true
125
+ }) : undefined, /*#__PURE__*/_react.default.createElement("a", {
126
+ href: p.url,
127
+ target: "blank"
128
+ }, /*#__PURE__*/_react.default.createElement("img", {
129
+ className: "view-photos-dialog-image",
130
+ src: p.url,
131
+ alt: p.alt,
132
+ onLoad: () => finishLoading(i)
133
+ }))))), numbered ? /*#__PURE__*/_react.default.createElement(_material.Typography, {
134
+ className: "photo-numbering"
135
+ }, "".concat(selectedSlide + 1, "/").concat(photos.length)) : undefined, photos[selectedSlide] && photos[selectedSlide].decoration));
136
+ }
@@ -0,0 +1,18 @@
1
+ @import '../../style-dictionary-dist/terraware.scss';
2
+
3
+ .view-photos-dialog-container {
4
+ min-height: 200px;
5
+ background: $tw-clr-bg;
6
+ }
7
+
8
+ .view-photos-dialog-image {
9
+ object-fit: contain;
10
+ margin: auto;
11
+ height: 400px;
12
+ width: 100%;
13
+ }
14
+
15
+ .photo-numbering {
16
+ font-size: 12px;
17
+ color: $tw-clr-txt-info;
18
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var React = _interopRequireWildcard(require("react"));
9
+ const SvgBlobbyGrayIconImage = _ref => {
10
+ let {
11
+ title,
12
+ titleId,
13
+ ...props
14
+ } = _ref;
15
+ return /*#__PURE__*/React.createElement("svg", Object.assign({
16
+ xmlns: "http://www.w3.org/2000/svg",
17
+ fill: "none",
18
+ viewBox: "0 0 200 128",
19
+ "aria-labelledby": titleId
20
+ }, props), title ? /*#__PURE__*/React.createElement("title", {
21
+ id: titleId
22
+ }, title) : null, /*#__PURE__*/React.createElement("g", {
23
+ clipPath: "url(#blobby-gray-icon-image_svg__a)"
24
+ }, /*#__PURE__*/React.createElement("path", {
25
+ fill: "#F1F0EC",
26
+ fillRule: "evenodd",
27
+ d: "M113.962 6.222c26.535 2.074 38.447 30.862 44.693 56.735 4.621 19.146-2.901 38.537-18.932 49.978-15.595 11.131-35.55 10.486-51.986.639C63.732 99.19 34.311 80.943 40.954 53.757c7.619-31.19 41-50.037 73.009-47.535",
28
+ clipRule: "evenodd"
29
+ }), /*#__PURE__*/React.createElement("path", {
30
+ fill: "#7F775B",
31
+ d: "M83.333 40C79.307 40 76 43.307 76 47.333v33.334C76 84.693 79.307 88 83.333 88h33.334c4.026 0 7.333-3.307 7.333-7.333V47.333c0-4.026-3.307-7.333-7.333-7.333zm0 4h33.334A3.304 3.304 0 0 1 120 47.333v27.274l-8.016-7.755-.002-.003a5.4 5.4 0 0 0-3.75-1.516 5.4 5.4 0 0 0-3.75 1.519l-2.732 2.643-8.24-7.972A5.4 5.4 0 0 0 89.758 60a5.4 5.4 0 0 0-3.75 1.52l-.003.003L80 67.333v-20A3.304 3.304 0 0 1 83.333 44m25.334 5.333c-1.834 0-3.462.76-4.495 1.922-1.033 1.163-1.505 2.634-1.505 4.078s.472 2.916 1.505 4.078 2.661 1.922 4.495 1.922c1.833 0 3.461-.76 4.494-1.922 1.034-1.162 1.506-2.633 1.506-4.078 0-1.444-.472-2.915-1.506-4.078-1.033-1.162-2.661-1.922-4.494-1.922m0 4c.833 0 1.205.24 1.505.578s.495.867.495 1.422c0 .556-.195 1.085-.495 1.422-.3.338-.672.578-1.505.578-.834 0-1.205-.24-1.506-.578s-.494-.866-.494-1.422.194-1.084.494-1.422c.301-.337.672-.578 1.506-.578M89.757 64a1.37 1.37 0 0 1 .972.398l8.143 7.878L86.752 84h-3.419A3.304 3.304 0 0 1 80 80.667v-7.769l8.787-8.5c.283-.274.626-.398.97-.398m18.475 5.333c.353 0 .691.123.971.394L120 80.172v.495A3.304 3.304 0 0 1 116.667 84h-24.16l14.756-14.273c.277-.268.618-.394.969-.394"
32
+ })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
33
+ id: "blobby-gray-icon-image_svg__a"
34
+ }, /*#__PURE__*/React.createElement("path", {
35
+ fill: "#fff",
36
+ d: "M0 0h200v128H0z"
37
+ }))));
38
+ };
39
+ var _default = exports.default = SvgBlobbyGrayIconImage;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var React = _interopRequireWildcard(require("react"));
9
+ const SvgBlobbyGrayIconImport = _ref => {
10
+ let {
11
+ title,
12
+ titleId,
13
+ ...props
14
+ } = _ref;
15
+ return /*#__PURE__*/React.createElement("svg", Object.assign({
16
+ xmlns: "http://www.w3.org/2000/svg",
17
+ fill: "none",
18
+ viewBox: "0 0 200 128",
19
+ "aria-labelledby": titleId
20
+ }, props), title ? /*#__PURE__*/React.createElement("title", {
21
+ id: titleId
22
+ }, title) : null, /*#__PURE__*/React.createElement("g", {
23
+ clipPath: "url(#blobby-gray-icon-import_svg__a)"
24
+ }, /*#__PURE__*/React.createElement("path", {
25
+ fill: "#F1F0EC",
26
+ fillRule: "evenodd",
27
+ d: "M97.492 4.026c24.033-.76 45.335 14.966 53.284 37.66 8.572 24.47 4.488 52.73-16.101 68.491-22.132 16.943-53.93 19.23-75.615 1.718C39.75 96.3 45.34 68.141 53.67 44.76c7.4-20.77 21.784-40.036 43.822-40.734",
28
+ clipRule: "evenodd"
29
+ }), /*#__PURE__*/React.createElement("path", {
30
+ fill: "#7F775B",
31
+ d: "M84.667 37.333c-3.29 0-6 2.71-6 6v41.334c0 3.29 2.71 6 6 6h30.666c3.29 0 6-2.71 6-6v-28c0-.53-.21-1.04-.586-1.414l-.02-.021-17.313-17.313a2 2 0 0 0-1.414-.586zm0 4H100v11.334c0 3.29 2.71 6 6 6h11.333v26c0 1.128-.871 2-2 2H84.667c-1.129 0-2-.872-2-2V43.333c0-1.128.871-2 2-2M104 44.161l10.505 10.506H106c-1.129 0-2-.872-2-2zM99.971 60a2 2 0 0 0-1.385.586l-5.333 5.333a2 2 0 1 0 2.828 2.828L98 66.828V74A2 2 0 1 0 102 74v-7.172l1.919 1.92a2.002 2.002 0 0 0 3.295-.63 1.99 1.99 0 0 0-.016-1.55 2 2 0 0 0-.451-.649l-5.333-5.333A2 2 0 0 0 99.971 60m-8.638 18.667a2.002 2.002 0 0 0-1.873 2.772 2 2 0 0 0 1.873 1.228h17.334a2 2 0 1 0 0-4z"
32
+ })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
33
+ id: "blobby-gray-icon-import_svg__a"
34
+ }, /*#__PURE__*/React.createElement("path", {
35
+ fill: "#fff",
36
+ d: "M0 0h200v128H0z"
37
+ }))));
38
+ };
39
+ var _default = exports.default = SvgBlobbyGrayIconImport;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var React = _interopRequireWildcard(require("react"));
9
+ const SvgBlobbyGrayIconUploadToTheCloud = _ref => {
10
+ let {
11
+ title,
12
+ titleId,
13
+ ...props
14
+ } = _ref;
15
+ return /*#__PURE__*/React.createElement("svg", Object.assign({
16
+ xmlns: "http://www.w3.org/2000/svg",
17
+ fill: "none",
18
+ viewBox: "0 0 200 128",
19
+ "aria-labelledby": titleId
20
+ }, props), title ? /*#__PURE__*/React.createElement("title", {
21
+ id: titleId
22
+ }, title) : null, /*#__PURE__*/React.createElement("g", {
23
+ clipPath: "url(#blobby-gray-icon-upload-to-the-cloud_svg__a)"
24
+ }, /*#__PURE__*/React.createElement("path", {
25
+ fill: "#F1F0EC",
26
+ fillRule: "evenodd",
27
+ d: "M97.492 4.026c24.033-.76 45.335 14.966 53.284 37.66 8.572 24.47 4.488 52.73-16.101 68.491-22.132 16.943-53.93 19.23-75.615 1.718C39.75 96.3 45.34 68.141 53.67 44.76c7.4-20.77 21.784-40.036 43.822-40.734",
28
+ clipRule: "evenodd"
29
+ }), /*#__PURE__*/React.createElement("path", {
30
+ fill: "#7F775B",
31
+ d: "M100 45.333c-8.373 0-15.264 6.467-15.943 14.667h-.724C77.084 60 72 65.084 72 71.333s5.084 11.334 11.333 11.334h12v-4h-12c-4.044 0-7.333-3.29-7.333-7.334S79.29 64 83.333 64H86a2 2 0 0 0 2-2v-.667c0-6.616 5.384-12 12-12s12 5.384 12 12V62a2 2 0 0 0 2 2h2.667c4.044 0 7.333 3.29 7.333 7.333s-3.289 7.334-7.333 7.334h-12v4h12c6.249 0 11.333-5.084 11.333-11.334C128 65.084 122.916 60 116.667 60h-.724c-.679-8.2-7.57-14.667-15.943-14.667m-.031 18.638a2 2 0 0 0-1.565.797l-5.818 5.818a2 2 0 1 0 2.828 2.828L98 70.828V86a2.002 2.002 0 0 0 2.772 1.874A2 2 0 0 0 102 86V70.828l2.586 2.586a1.998 1.998 0 0 0 3.295-.63 2.005 2.005 0 0 0-.467-2.198l-5.828-5.828a2 2 0 0 0-1.617-.787"
32
+ })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
33
+ id: "blobby-gray-icon-upload-to-the-cloud_svg__a"
34
+ }, /*#__PURE__*/React.createElement("path", {
35
+ fill: "#fff",
36
+ d: "M0 0h200v128H0z"
37
+ }))));
38
+ };
39
+ var _default = exports.default = SvgBlobbyGrayIconUploadToTheCloud;