@terraware/web-components 4.2.12 → 4.2.14-rc.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 (304) hide show
  1. package/components/AntSwitch/index.js +8 -14
  2. package/components/Autocomplete/Autocomplete.js +67 -70
  3. package/components/Badge/index.js +16 -20
  4. package/components/BusySpinner/index.js +30 -35
  5. package/components/Button/Button.js +23 -27
  6. package/components/Button/button.test.js +8 -10
  7. package/components/Checkbox.js +10 -19
  8. package/components/Confirm/index.js +44 -51
  9. package/components/DatePicker/DatePicker.js +116 -117
  10. package/components/DialogBox/DialogBox.js +76 -66
  11. package/components/Divisor.js +15 -20
  12. package/components/Dropdown.js +54 -61
  13. package/components/EditableTable/index.js +129 -135
  14. package/components/ErrorBox/ErrorBox.js +37 -36
  15. package/components/FileChooser/index.js +73 -77
  16. package/components/FormBottomBar/index.js +63 -69
  17. package/components/Icon/Icon.js +14 -21
  18. package/components/Icon/icons/index.d.ts +1 -1
  19. package/components/Icon/icons/index.d.ts.map +1 -1
  20. package/components/Icon/icons/index.js +251 -255
  21. package/components/IconTooltip/index.js +29 -34
  22. package/components/Map/MapBox.js +199 -220
  23. package/components/Map/MapContainer.js +14 -18
  24. package/components/Map/MapDateSliderControl.js +44 -46
  25. package/components/Map/MapDrawer.js +32 -33
  26. package/components/Map/MapLegend.js +96 -95
  27. package/components/Map/MapViewStyleControl.js +38 -48
  28. package/components/Map/ReactMapboxWrapper.js +2 -9
  29. package/components/Map/index.js +47 -55
  30. package/components/Map/types.js +2 -8
  31. package/components/Map/useMaintainLayerOrder.js +4 -11
  32. package/components/Markdown/index.js +14 -21
  33. package/components/Message/Message.js +59 -51
  34. package/components/MultiSelect/MultiSelect.test.js +22 -24
  35. package/components/MultiSelect/index.js +73 -69
  36. package/components/Navbar/NavFooter.js +8 -13
  37. package/components/Navbar/NavItem.js +43 -37
  38. package/components/Navbar/NavSection.js +13 -17
  39. package/components/Navbar/Navbar.js +35 -38
  40. package/components/Navbar/SubNavbar.js +8 -13
  41. package/components/Note.js +14 -19
  42. package/components/OverlayModal/OverlayModal.js +36 -37
  43. package/components/PageForm/index.js +30 -35
  44. package/components/PhotoChooser/index.js +93 -98
  45. package/components/Pill/index.js +29 -31
  46. package/components/PillList/index.js +16 -22
  47. package/components/PlacementWrapper/index.js +20 -25
  48. package/components/PopoverMenu/Popover.js +33 -37
  49. package/components/PopoverMenu/index.js +41 -46
  50. package/components/PopoverMultiSelect/index.js +18 -21
  51. package/components/ProgressCircle/ProgressCircle.js +23 -26
  52. package/components/RadioButton.js +7 -14
  53. package/components/Select/Select.js +8 -13
  54. package/components/Select/SelectT.js +110 -108
  55. package/components/Separator/index.js +8 -14
  56. package/components/Size.js +1 -5
  57. package/components/Slider/index.js +7 -13
  58. package/components/SummaryBox.js +36 -39
  59. package/components/Tabs/index.js +75 -77
  60. package/components/TextTruncated/index.js +64 -65
  61. package/components/Textfield/Textfield.js +100 -95
  62. package/components/Textfield/TruncatedTextArea.js +44 -46
  63. package/components/TimelineSlider/TimelineMarker.js +24 -28
  64. package/components/TimelineSlider/TimelineRail.js +5 -11
  65. package/components/TimelineSlider/index.js +47 -51
  66. package/components/Tooltip/Tooltip.js +21 -26
  67. package/components/ViewPhotosDialog/index.js +58 -62
  68. package/components/VirtualWalkthrough/Annotation.d.ts +41 -0
  69. package/components/VirtualWalkthrough/Annotation.d.ts.map +1 -0
  70. package/components/VirtualWalkthrough/Annotation.js +197 -0
  71. package/components/VirtualWalkthrough/AnnotationEditPane.d.ts +20 -0
  72. package/components/VirtualWalkthrough/AnnotationEditPane.d.ts.map +1 -0
  73. package/components/VirtualWalkthrough/AnnotationEditPane.js +136 -0
  74. package/components/VirtualWalkthrough/AnnotationPanel.d.ts +13 -0
  75. package/components/VirtualWalkthrough/AnnotationPanel.d.ts.map +1 -0
  76. package/components/VirtualWalkthrough/AnnotationPanel.js +196 -0
  77. package/components/VirtualWalkthrough/Application.d.ts +9 -0
  78. package/components/VirtualWalkthrough/Application.d.ts.map +1 -0
  79. package/components/VirtualWalkthrough/Application.js +32 -0
  80. package/components/VirtualWalkthrough/AutoRotator.d.ts +109 -0
  81. package/components/VirtualWalkthrough/AutoRotator.d.ts.map +1 -0
  82. package/components/VirtualWalkthrough/AutoRotator.js +217 -0
  83. package/components/VirtualWalkthrough/BlockingSpinner.d.ts +3 -0
  84. package/components/VirtualWalkthrough/BlockingSpinner.d.ts.map +1 -0
  85. package/components/VirtualWalkthrough/BlockingSpinner.js +27 -0
  86. package/components/VirtualWalkthrough/BoundaryRing.d.ts +9 -0
  87. package/components/VirtualWalkthrough/BoundaryRing.d.ts.map +1 -0
  88. package/components/VirtualWalkthrough/BoundaryRing.js +33 -0
  89. package/components/VirtualWalkthrough/CameraInfo.d.ts +16 -0
  90. package/components/VirtualWalkthrough/CameraInfo.d.ts.map +1 -0
  91. package/components/VirtualWalkthrough/CameraInfo.js +88 -0
  92. package/components/VirtualWalkthrough/ControlsInfoPane.d.ts +37 -0
  93. package/components/VirtualWalkthrough/ControlsInfoPane.d.ts.map +1 -0
  94. package/components/VirtualWalkthrough/ControlsInfoPane.js +196 -0
  95. package/components/VirtualWalkthrough/GradientSky.d.ts +9 -0
  96. package/components/VirtualWalkthrough/GradientSky.d.ts.map +1 -0
  97. package/components/VirtualWalkthrough/GradientSky.js +73 -0
  98. package/components/VirtualWalkthrough/SplatControls.d.ts +50 -0
  99. package/components/VirtualWalkthrough/SplatControls.d.ts.map +1 -0
  100. package/components/VirtualWalkthrough/SplatControls.js +252 -0
  101. package/components/VirtualWalkthrough/SplatCrop.d.ts +8 -0
  102. package/components/VirtualWalkthrough/SplatCrop.d.ts.map +1 -0
  103. package/components/VirtualWalkthrough/SplatCrop.js +18 -0
  104. package/components/VirtualWalkthrough/SplatFadeCrop.d.ts +8 -0
  105. package/components/VirtualWalkthrough/SplatFadeCrop.d.ts.map +1 -0
  106. package/components/VirtualWalkthrough/SplatFadeCrop.js +18 -0
  107. package/components/VirtualWalkthrough/SplatModel.d.ts +15 -0
  108. package/components/VirtualWalkthrough/SplatModel.d.ts.map +1 -0
  109. package/components/VirtualWalkthrough/SplatModel.js +60 -0
  110. package/components/VirtualWalkthrough/SplatRevealRain.d.ts +18 -0
  111. package/components/VirtualWalkthrough/SplatRevealRain.d.ts.map +1 -0
  112. package/components/VirtualWalkthrough/SplatRevealRain.js +38 -0
  113. package/components/VirtualWalkthrough/TfAnnotationManager.d.ts +110 -0
  114. package/components/VirtualWalkthrough/TfAnnotationManager.d.ts.map +1 -0
  115. package/components/VirtualWalkthrough/TfAnnotationManager.js +368 -0
  116. package/components/VirtualWalkthrough/TfXrNavigation.d.ts +15 -0
  117. package/components/VirtualWalkthrough/TfXrNavigation.d.ts.map +1 -0
  118. package/components/VirtualWalkthrough/TfXrNavigation.js +24 -0
  119. package/components/VirtualWalkthrough/annotation-styles.css +5 -0
  120. package/components/VirtualWalkthrough/application-styles.css +4 -0
  121. package/components/VirtualWalkthrough/boundary-ring.d.ts +47 -0
  122. package/components/VirtualWalkthrough/boundary-ring.d.ts.map +1 -0
  123. package/components/VirtualWalkthrough/boundary-ring.js +125 -0
  124. package/components/VirtualWalkthrough/boundary-ring.test.js +109 -0
  125. package/components/VirtualWalkthrough/groundPlane.d.ts +14 -0
  126. package/components/VirtualWalkthrough/groundPlane.d.ts.map +1 -0
  127. package/components/VirtualWalkthrough/groundPlane.js +47 -0
  128. package/components/VirtualWalkthrough/groundPlane.test.js +45 -0
  129. package/components/VirtualWalkthrough/gsplat-fade-crop-effect.d.ts +19 -0
  130. package/components/VirtualWalkthrough/gsplat-fade-crop-effect.d.ts.map +1 -0
  131. package/components/VirtualWalkthrough/gsplat-fade-crop-effect.js +119 -0
  132. package/components/VirtualWalkthrough/walkthrough-camera.d.ts +77 -0
  133. package/components/VirtualWalkthrough/walkthrough-camera.d.ts.map +1 -0
  134. package/components/VirtualWalkthrough/walkthrough-camera.js +320 -0
  135. package/components/svg/BlobbyGrayIconImage.js +36 -41
  136. package/components/svg/BlobbyGrayIconImport.js +36 -41
  137. package/components/svg/BlobbyGrayIconUploadToTheCloud.js +36 -41
  138. package/components/svg/BlobbyIconCloudChecked.js +161 -158
  139. package/components/svg/BlobbyIconExportOrUploadPhoto.js +161 -158
  140. package/components/svg/BlobbyIconFolder.js +161 -158
  141. package/components/svg/BlobbyIconGraphReport.js +161 -158
  142. package/components/svg/BlobbyIconHappy.js +161 -158
  143. package/components/svg/BlobbyIconHeartMonitor.js +161 -158
  144. package/components/svg/BlobbyIconLeaf.js +161 -158
  145. package/components/svg/BlobbyIconLibrary.js +161 -158
  146. package/components/svg/BlobbyIconNursery.js +163 -160
  147. package/components/svg/BlobbyIconOrganization.js +161 -158
  148. package/components/svg/BlobbyIconParchment.js +161 -158
  149. package/components/svg/BlobbyIconPeople.js +161 -158
  150. package/components/svg/BlobbyIconSeedBank.js +161 -158
  151. package/components/svg/BlobbyIconSeedling.js +161 -158
  152. package/components/svg/BlobbyIconSeeds.js +161 -158
  153. package/components/svg/BlobbyIconSite.js +164 -161
  154. package/components/svg/BlobbyIconSparkles.js +161 -158
  155. package/components/svg/BlobbyIconWrench.js +161 -158
  156. package/components/svg/Bug.js +18 -27
  157. package/components/svg/Calendar.js +18 -27
  158. package/components/svg/CaretDown.js +18 -27
  159. package/components/svg/CaretLeft.js +18 -27
  160. package/components/svg/CaretRight.js +18 -27
  161. package/components/svg/CaretUp.js +18 -27
  162. package/components/svg/ChevronDown.js +18 -27
  163. package/components/svg/ChevronUp.js +18 -27
  164. package/components/svg/Close.js +18 -27
  165. package/components/svg/Critical.js +18 -27
  166. package/components/svg/Edit.js +161 -158
  167. package/components/svg/Error.js +18 -27
  168. package/components/svg/Filter.js +18 -27
  169. package/components/svg/Folder.js +18 -27
  170. package/components/svg/Help.js +18 -27
  171. package/components/svg/Home.js +18 -27
  172. package/components/svg/IconAdd.js +18 -27
  173. package/components/svg/IconArrowRight.js +19 -28
  174. package/components/svg/IconBusinessNetwork.js +18 -27
  175. package/components/svg/IconCalendar.d.ts +1 -1
  176. package/components/svg/IconCalendar.d.ts.map +1 -1
  177. package/components/svg/IconCalendar.js +18 -27
  178. package/components/svg/IconCancel.js +18 -27
  179. package/components/svg/IconChargingBattery.js +18 -27
  180. package/components/svg/IconChecklist.js +19 -28
  181. package/components/svg/IconCheckmark.js +18 -27
  182. package/components/svg/IconCoinInHand.js +18 -27
  183. package/components/svg/IconColumns.js +18 -27
  184. package/components/svg/IconComment.js +18 -27
  185. package/components/svg/IconDashboard.js +18 -27
  186. package/components/svg/IconDataMigration.js +18 -27
  187. package/components/svg/IconDocument.d.ts +8 -0
  188. package/components/svg/IconDocument.d.ts.map +1 -0
  189. package/components/svg/IconDocument.js +21 -0
  190. package/components/svg/IconDownloadFromTheCloud.js +19 -28
  191. package/components/svg/IconEdit.js +19 -28
  192. package/components/svg/IconExpand.js +19 -28
  193. package/components/svg/IconExport.js +18 -27
  194. package/components/svg/IconExternalLink.js +18 -27
  195. package/components/svg/IconEye.js +18 -27
  196. package/components/svg/IconEyeOff.js +18 -27
  197. package/components/svg/IconFile.js +18 -27
  198. package/components/svg/IconFolder.js +18 -27
  199. package/components/svg/IconFullScreen.js +18 -27
  200. package/components/svg/IconFutures.js +18 -27
  201. package/components/svg/IconGraphReport.js +18 -27
  202. package/components/svg/IconHeartMonitor.js +18 -27
  203. package/components/svg/IconHelp.js +19 -28
  204. package/components/svg/IconHistory.js +18 -27
  205. package/components/svg/IconImport.js +18 -27
  206. package/components/svg/IconIndex.js +18 -27
  207. package/components/svg/IconLayers.js +18 -27
  208. package/components/svg/IconLibrary.js +18 -27
  209. package/components/svg/IconList.js +18 -27
  210. package/components/svg/IconLivePlant.js +18 -27
  211. package/components/svg/IconLocations.js +18 -27
  212. package/components/svg/IconMail.js +18 -27
  213. package/components/svg/IconManager.js +18 -27
  214. package/components/svg/IconMarker.js +18 -27
  215. package/components/svg/IconMenu.js +18 -27
  216. package/components/svg/IconMenuHorizontal.js +18 -27
  217. package/components/svg/IconModule.js +18 -27
  218. package/components/svg/IconMyLocation.js +18 -27
  219. package/components/svg/IconNote.js +19 -28
  220. package/components/svg/IconNursery.js +18 -27
  221. package/components/svg/IconOrg.js +18 -27
  222. package/components/svg/IconParchment.js +18 -27
  223. package/components/svg/IconPhoto.js +18 -27
  224. package/components/svg/IconPlantsFilled.js +18 -27
  225. package/components/svg/IconRedo.js +18 -27
  226. package/components/svg/IconRestorationSite.js +18 -27
  227. package/components/svg/IconSeedBank.js +18 -27
  228. package/components/svg/IconSeedling.js +18 -27
  229. package/components/svg/IconSettings.js +18 -27
  230. package/components/svg/IconSlice.js +18 -27
  231. package/components/svg/IconSubmit.js +18 -27
  232. package/components/svg/IconSubtract.js +19 -28
  233. package/components/svg/IconSynced.js +18 -27
  234. package/components/svg/IconTrashCan.js +18 -27
  235. package/components/svg/IconTreasureMap.js +18 -27
  236. package/components/svg/IconUnavailable.js +18 -27
  237. package/components/svg/IconUndo.js +18 -27
  238. package/components/svg/IconVariable.js +18 -27
  239. package/components/svg/IconVideo.js +19 -28
  240. package/components/svg/IconWifi.js +18 -27
  241. package/components/svg/Info.js +18 -27
  242. package/components/svg/Key.js +18 -27
  243. package/components/svg/Leaf.js +18 -27
  244. package/components/svg/Lock.js +18 -27
  245. package/components/svg/Logo.js +40 -45
  246. package/components/svg/MenuVertical.js +18 -27
  247. package/components/svg/Notification.js +18 -27
  248. package/components/svg/Person.js +18 -27
  249. package/components/svg/Plus.js +18 -27
  250. package/components/svg/RestorationSite.js +18 -27
  251. package/components/svg/Search.js +18 -27
  252. package/components/svg/Seeds.js +18 -27
  253. package/components/svg/Site.js +18 -27
  254. package/components/svg/Sparkles.js +18 -27
  255. package/components/svg/Species.js +18 -27
  256. package/components/svg/Species2.js +161 -158
  257. package/components/svg/Spinner.js +27 -36
  258. package/components/svg/Star.js +18 -27
  259. package/components/svg/Success.js +18 -27
  260. package/components/svg/SuccessFilled.js +18 -27
  261. package/components/svg/TerrawareLogoDesktop.js +44 -49
  262. package/components/svg/TerrawareLogoMobile.js +20 -29
  263. package/components/svg/Touchscreen.js +18 -27
  264. package/components/svg/UploadCloud.js +161 -158
  265. package/components/svg/Warning.js +18 -27
  266. package/components/svg/WelcomeClipboard.js +130 -135
  267. package/components/svg/index.d.ts +1 -0
  268. package/components/svg/index.d.ts.map +1 -1
  269. package/components/svg/index.js +127 -888
  270. package/components/table/EnhancedTableToolbar.js +45 -47
  271. package/components/table/EnhancedTableToolbarV2.js +18 -26
  272. package/components/table/TableCellRenderer.js +137 -143
  273. package/components/table/TableHeader.js +45 -47
  274. package/components/table/TableHeaderItem.js +65 -64
  275. package/components/table/density.js +3 -11
  276. package/components/table/index.js +225 -218
  277. package/components/table/sort.js +8 -18
  278. package/components/table/sort.test.js +6 -8
  279. package/components/table/types.js +1 -5
  280. package/components/types/index.js +1 -5
  281. package/hooks/useBoolean.d.ts +4 -0
  282. package/hooks/useBoolean.d.ts.map +1 -0
  283. package/hooks/useBoolean.js +12 -0
  284. package/hooks/useCameraPosition.d.ts +8 -0
  285. package/hooks/useCameraPosition.d.ts.map +1 -0
  286. package/hooks/useCameraPosition.js +33 -0
  287. package/index.js +57 -398
  288. package/license-report.html +1 -1
  289. package/package.json +10 -3
  290. package/style-dictionary-dist/TerrawareTheme.js +1 -7
  291. package/theme.js +7 -14
  292. package/utils/color.d.ts +2 -0
  293. package/utils/color.d.ts.map +1 -0
  294. package/utils/color.js +14 -0
  295. package/utils/date.js +13 -24
  296. package/utils/date.test.js +40 -43
  297. package/utils/index.js +5 -53
  298. package/utils/preventDefaultEvent.js +1 -7
  299. package/utils/text.js +2 -9
  300. package/utils/text.test.js +9 -11
  301. package/utils/useDeviceInfo.js +10 -16
  302. package/virtualWalkthrough.d.ts +31 -0
  303. package/virtualWalkthrough.d.ts.map +1 -0
  304. package/virtualWalkthrough.js +28 -0
@@ -1,41 +1,33 @@
1
- "use strict";
1
+ import React, { useState } from 'react';
2
+ import { Box } from '@mui/material';
3
+ import { DesktopDatePicker, DesktopDateTimePicker, LocalizationProvider } from '@mui/x-date-pickers';
4
+ import { AdapterLuxon } from '@mui/x-date-pickers/AdapterLuxon';
5
+ import { Settings } from 'luxon';
6
+ import { getDate, tz } from '../../utils/date';
7
+ import Icon from '../Icon/Icon';
8
+ import './styles.scss';
2
9
 
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 = DatePicker;
9
- var _react = _interopRequireWildcard(require("react"));
10
- var _material = require("@mui/material");
11
- var _xDatePickers = require("@mui/x-date-pickers");
12
- var _AdapterLuxon = require("@mui/x-date-pickers/AdapterLuxon");
13
- var _luxon = require("luxon");
14
- var _date = require("../../utils/date");
15
- var _Icon = _interopRequireDefault(require("../Icon/Icon"));
16
- require("./styles.scss");
17
10
  /**
18
11
  * TODO: remove support for JS Date in DatePickerDateType once
19
12
  * clients have moved to only using DateTime objects in input props
20
13
  * and callback arguments.
21
14
  * export type DatePickerDateType = Exclude<DateType, Date> | null;
22
15
  */
23
-
16
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
17
  const initializeDate = (value, timeZoneId) => {
25
18
  if (!value) {
26
19
  return null;
27
20
  }
28
- const date = (0, _date.getDate)(value, timeZoneId);
29
- return date !== null && date !== void 0 && date.isValid ? date : null;
21
+ const date = getDate(value, timeZoneId);
22
+ return date?.isValid ? date : null;
30
23
  };
31
- function DatePicker(props) {
32
- var _props$locale;
33
- const [temporalValue, setTemporalValue] = (0, _react.useState)(initializeDate(props.value, props.defaultTimeZone));
34
- const [minDateTime, setMinDateTime] = (0, _react.useState)(initializeDate(props.minDate, props.defaultTimeZone));
35
- const [maxDateTime, setMaxDateTime] = (0, _react.useState)(initializeDate(props.maxDate, props.defaultTimeZone));
36
- const locale = (_props$locale = props.locale) !== null && _props$locale !== void 0 ? _props$locale : 'en';
37
- _luxon.Settings.defaultZone = (0, _date.tz)(props.defaultTimeZone);
38
- _react.default.useEffect(() => {
24
+ export default function DatePicker(props) {
25
+ const [temporalValue, setTemporalValue] = useState(initializeDate(props.value, props.defaultTimeZone));
26
+ const [minDateTime, setMinDateTime] = useState(initializeDate(props.minDate, props.defaultTimeZone));
27
+ const [maxDateTime, setMaxDateTime] = useState(initializeDate(props.maxDate, props.defaultTimeZone));
28
+ const locale = props.locale ?? 'en';
29
+ Settings.defaultZone = tz(props.defaultTimeZone);
30
+ React.useEffect(() => {
39
31
  setTemporalValue(prev => {
40
32
  if (props.value !== prev) {
41
33
  return initializeDate(props.value, props.defaultTimeZone);
@@ -44,107 +36,114 @@ function DatePicker(props) {
44
36
  }
45
37
  });
46
38
  }, [props.defaultTimeZone, props.value]);
47
- _react.default.useEffect(() => {
39
+ React.useEffect(() => {
48
40
  setMinDateTime(initializeDate(props.minDate, props.defaultTimeZone));
49
41
  }, [props.defaultTimeZone, props.minDate]);
50
- _react.default.useEffect(() => {
42
+ React.useEffect(() => {
51
43
  setMaxDateTime(initializeDate(props.maxDate, props.defaultTimeZone));
52
44
  }, [props.defaultTimeZone, props.maxDate]);
53
45
 
54
46
  // TODO: Localize the yyyy-mm-dd placeholder string that is shown to users when the input is
55
47
  // empty. It appears to be generated programmatically deep in the guts of the MUI DatePicker
56
48
  // code, and it most likely uses the browser's locale.
57
- return /*#__PURE__*/_react.default.createElement(_material.Box, {
58
- className: "date-picker ".concat(props.className, " ").concat(props.errorText ? 'date-picker--error' : ''),
59
- sx: props.sx
60
- }, /*#__PURE__*/_react.default.createElement(_xDatePickers.LocalizationProvider, {
61
- dateAdapter: _AdapterLuxon.AdapterLuxon,
62
- adapterLocale: locale
63
- }, props.label && /*#__PURE__*/_react.default.createElement("label", {
64
- htmlFor: props.id,
65
- className: "textfield-label"
66
- }, props.label), props.showTime ? /*#__PURE__*/_react.default.createElement(_xDatePickers.DesktopDateTimePicker, {
67
- disabled: props.disabled,
68
- minDate: minDateTime && minDateTime.isValid ? minDateTime : undefined,
69
- maxDate: maxDateTime && maxDateTime.isValid ? maxDateTime : undefined,
70
- onChange: newValue => {
71
- setTemporalValue(newValue);
72
- // TODO: remove onChange and make onDateChange required
73
- if (props.onChange) {
74
- props.onChange(newValue && newValue.isValid ? newValue.toJSDate() : null);
75
- }
76
- if (props.onDateChange) {
77
- props.onDateChange(newValue && newValue.isValid ? newValue : undefined);
78
- }
79
- },
80
- onError: props.onError,
81
- slotProps: {
82
- textField: {
83
- sx: {
84
- '& fieldset': {
85
- border: 'none'
86
- },
87
- '& .MuiFormHelperText-root': {
88
- marginLeft: 0
49
+ return /*#__PURE__*/_jsx(Box, {
50
+ className: `date-picker ${props.className} ${props.errorText ? 'date-picker--error' : ''}`,
51
+ sx: props.sx,
52
+ children: /*#__PURE__*/_jsxs(LocalizationProvider, {
53
+ dateAdapter: AdapterLuxon,
54
+ adapterLocale: locale,
55
+ children: [props.label && /*#__PURE__*/_jsx("label", {
56
+ htmlFor: props.id,
57
+ className: "textfield-label",
58
+ children: props.label
59
+ }), props.showTime ? /*#__PURE__*/_jsx(DesktopDateTimePicker, {
60
+ disabled: props.disabled,
61
+ minDate: minDateTime && minDateTime.isValid ? minDateTime : undefined,
62
+ maxDate: maxDateTime && maxDateTime.isValid ? maxDateTime : undefined,
63
+ onChange: newValue => {
64
+ setTemporalValue(newValue);
65
+ // TODO: remove onChange and make onDateChange required
66
+ if (props.onChange) {
67
+ props.onChange(newValue && newValue.isValid ? newValue.toJSDate() : null);
68
+ }
69
+ if (props.onDateChange) {
70
+ props.onDateChange(newValue && newValue.isValid ? newValue : undefined);
89
71
  }
90
72
  },
91
- helperText: props.errorText ? /*#__PURE__*/_react.default.createElement("div", {
92
- className: "textfield-error-text-container"
93
- }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
94
- name: "error",
95
- className: "textfield-error-text--icon"
96
- }), /*#__PURE__*/_react.default.createElement("label", {
97
- htmlFor: props.id,
98
- className: "textfield-error-text"
99
- }, props.errorText)) : props.helperText,
100
- id: props.id,
101
- placeholder: props.placeholder,
102
- autoFocus: props.autoFocus,
103
- onKeyPress: props.onKeyPress
104
- }
105
- },
106
- value: temporalValue
107
- }) : /*#__PURE__*/_react.default.createElement(_xDatePickers.DesktopDatePicker, {
108
- disabled: props.disabled,
109
- format: "yyyy-MM-dd",
110
- minDate: minDateTime && minDateTime.isValid ? minDateTime : undefined,
111
- maxDate: maxDateTime && maxDateTime.isValid ? maxDateTime : undefined,
112
- onChange: newValue => {
113
- setTemporalValue(newValue);
114
- // TODO: remove onChange and make onDateChange required
115
- if (props.onChange) {
116
- props.onChange(newValue && newValue.isValid ? newValue.toJSDate() : null);
117
- }
118
- if (props.onDateChange) {
119
- props.onDateChange(newValue && newValue.isValid ? newValue : undefined);
120
- }
121
- },
122
- onError: props.onError,
123
- slotProps: {
124
- textField: {
125
- sx: {
126
- '& fieldset': {
127
- border: 'none'
128
- },
129
- '& .MuiFormHelperText-root': {
130
- marginLeft: 0
73
+ onError: props.onError,
74
+ slotProps: {
75
+ textField: {
76
+ sx: {
77
+ '& fieldset': {
78
+ border: 'none'
79
+ },
80
+ '& .MuiFormHelperText-root': {
81
+ marginLeft: 0
82
+ }
83
+ },
84
+ helperText: props.errorText ? /*#__PURE__*/_jsxs("div", {
85
+ className: "textfield-error-text-container",
86
+ children: [/*#__PURE__*/_jsx(Icon, {
87
+ name: "error",
88
+ className: "textfield-error-text--icon"
89
+ }), /*#__PURE__*/_jsx("label", {
90
+ htmlFor: props.id,
91
+ className: "textfield-error-text",
92
+ children: props.errorText
93
+ })]
94
+ }) : props.helperText,
95
+ id: props.id,
96
+ placeholder: props.placeholder,
97
+ autoFocus: props.autoFocus,
98
+ onKeyPress: props.onKeyPress
131
99
  }
132
100
  },
133
- helperText: props.errorText ? /*#__PURE__*/_react.default.createElement("div", {
134
- className: "textfield-error-text-container"
135
- }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
136
- name: "error",
137
- className: "textfield-error-text--icon"
138
- }), /*#__PURE__*/_react.default.createElement("label", {
139
- htmlFor: props.id,
140
- className: "textfield-error-text"
141
- }, props.errorText)) : props.helperText,
142
- id: props.id,
143
- placeholder: props.placeholder,
144
- autoFocus: props.autoFocus,
145
- onKeyPress: props.onKeyPress
146
- }
147
- },
148
- value: temporalValue
149
- })));
101
+ value: temporalValue
102
+ }) : /*#__PURE__*/_jsx(DesktopDatePicker, {
103
+ disabled: props.disabled,
104
+ format: "yyyy-MM-dd",
105
+ minDate: minDateTime && minDateTime.isValid ? minDateTime : undefined,
106
+ maxDate: maxDateTime && maxDateTime.isValid ? maxDateTime : undefined,
107
+ onChange: newValue => {
108
+ setTemporalValue(newValue);
109
+ // TODO: remove onChange and make onDateChange required
110
+ if (props.onChange) {
111
+ props.onChange(newValue && newValue.isValid ? newValue.toJSDate() : null);
112
+ }
113
+ if (props.onDateChange) {
114
+ props.onDateChange(newValue && newValue.isValid ? newValue : undefined);
115
+ }
116
+ },
117
+ onError: props.onError,
118
+ slotProps: {
119
+ textField: {
120
+ sx: {
121
+ '& fieldset': {
122
+ border: 'none'
123
+ },
124
+ '& .MuiFormHelperText-root': {
125
+ marginLeft: 0
126
+ }
127
+ },
128
+ helperText: props.errorText ? /*#__PURE__*/_jsxs("div", {
129
+ className: "textfield-error-text-container",
130
+ children: [/*#__PURE__*/_jsx(Icon, {
131
+ name: "error",
132
+ className: "textfield-error-text--icon"
133
+ }), /*#__PURE__*/_jsx("label", {
134
+ htmlFor: props.id,
135
+ className: "textfield-error-text",
136
+ children: props.errorText
137
+ })]
138
+ }) : props.helperText,
139
+ id: props.id,
140
+ placeholder: props.placeholder,
141
+ autoFocus: props.autoFocus,
142
+ onKeyPress: props.onKeyPress
143
+ }
144
+ },
145
+ value: temporalValue
146
+ })]
147
+ })
148
+ });
150
149
  }
@@ -1,17 +1,10 @@
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 = DialogBox;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
9
- var _react = _interopRequireDefault(require("react"));
10
- var _material = require("@mui/material");
11
- var _utils = require("../../utils");
12
- var _Icon = _interopRequireDefault(require("../Icon/Icon"));
13
- require("./styles.scss");
14
- function DialogBox(props) {
1
+ import React from 'react';
2
+ import { IconButton } from '@mui/material';
3
+ import { useDeviceInfo } from '../../utils';
4
+ import Icon from '../Icon/Icon';
5
+ import './styles.scss';
6
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
+ export default function DialogBox(props) {
15
8
  const {
16
9
  title,
17
10
  size,
@@ -29,60 +22,77 @@ function DialogBox(props) {
29
22
  const hasFooter = leftButton || rightButtons || middleButtons;
30
23
  const {
31
24
  isMobile
32
- } = (0, _utils.useDeviceInfo)();
33
- return open ? /*#__PURE__*/_react.default.createElement("div", {
34
- className: "dialog-box-container".concat(skrim ? '--skrim' : '', " ").concat(open ? 'dialog-box--opened' : 'dialog-box--closed', " ").concat(isMobile ? 'mobile' : ''),
25
+ } = useDeviceInfo();
26
+ return open ? /*#__PURE__*/_jsx("div", {
27
+ className: `dialog-box-container${skrim ? '--skrim' : ''} ${open ? 'dialog-box--opened' : 'dialog-box--closed'} ${isMobile ? 'mobile' : ''}`,
35
28
  onClick: event => {
36
29
  if (event.target instanceof HTMLElement && event.target.classList.contains('dialog-box--opened')) {
37
- onClose === null || onClose === void 0 ? void 0 : onClose();
30
+ onClose?.();
38
31
  }
39
32
  },
40
- style: style
41
- }, /*#__PURE__*/_react.default.createElement("div", {
42
- className: "dialog-box dialog-box--".concat(size)
43
- }, /*#__PURE__*/_react.default.createElement("div", {
44
- className: "dialog-box--header"
45
- }, /*#__PURE__*/_react.default.createElement("div", {
46
- className: "close-icon-spacer"
47
- }), /*#__PURE__*/_react.default.createElement("p", {
48
- className: "title"
49
- }, title), /*#__PURE__*/_react.default.createElement(_material.IconButton, {
50
- onClick: onClose,
51
- size: "small"
52
- }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
53
- name: "close",
54
- className: "icon-close"
55
- }))), /*#__PURE__*/_react.default.createElement("div", {
56
- className: (hasFooter ? 'dialog-box--body' : 'dialog-box--body-no-footer') + (scrolled ? ' scrolled' : '')
57
- }, /*#__PURE__*/_react.default.createElement("div", {
58
- className: "dialog-box--message"
59
- }, message), /*#__PURE__*/_react.default.createElement("div", {
60
- className: "dialog-box--boundary"
61
- }, children)), hasFooter && /*#__PURE__*/_react.default.createElement("div", {
62
- className: "dialog-box--footer"
63
- }, leftButton && /*#__PURE__*/_react.default.createElement("div", {
64
- className: "dialog-box--footer-container"
65
- }, /*#__PURE__*/_react.default.createElement("div", {
66
- className: "left-button"
67
- }, leftButton), /*#__PURE__*/_react.default.createElement("div", {
68
- className: "right-buttons"
69
- }, rightButtons === null || rightButtons === void 0 ? void 0 : rightButtons.map((rb, index) => {
70
- const rbWithKey = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, rb), {}, {
71
- key: "rb-".concat(index),
72
- props: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, rb.props), {}, {
73
- size: rb.props.size || 'medium'
74
- })
75
- });
76
- return rbWithKey;
77
- }))), middleButtons && /*#__PURE__*/_react.default.createElement("div", {
78
- className: "dialog-box--actions-container"
79
- }, middleButtons === null || middleButtons === void 0 ? void 0 : middleButtons.map((mb, index) => {
80
- const mbWithKey = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, mb), {}, {
81
- key: "mb-".concat(index),
82
- props: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, mb.props), {}, {
83
- size: mb.props.size || 'medium'
84
- })
85
- });
86
- return mbWithKey;
87
- }))))) : null;
33
+ style: style,
34
+ children: /*#__PURE__*/_jsxs("div", {
35
+ className: `dialog-box dialog-box--${size}`,
36
+ children: [/*#__PURE__*/_jsxs("div", {
37
+ className: "dialog-box--header",
38
+ children: [/*#__PURE__*/_jsx("div", {
39
+ className: "close-icon-spacer"
40
+ }), /*#__PURE__*/_jsx("p", {
41
+ className: "title",
42
+ children: title
43
+ }), /*#__PURE__*/_jsx(IconButton, {
44
+ onClick: onClose,
45
+ size: "small",
46
+ children: /*#__PURE__*/_jsx(Icon, {
47
+ name: "close",
48
+ className: "icon-close"
49
+ })
50
+ })]
51
+ }), /*#__PURE__*/_jsxs("div", {
52
+ className: (hasFooter ? 'dialog-box--body' : 'dialog-box--body-no-footer') + (scrolled ? ' scrolled' : ''),
53
+ children: [/*#__PURE__*/_jsx("div", {
54
+ className: "dialog-box--message",
55
+ children: message
56
+ }), /*#__PURE__*/_jsx("div", {
57
+ className: "dialog-box--boundary",
58
+ children: children
59
+ })]
60
+ }), hasFooter && /*#__PURE__*/_jsxs("div", {
61
+ className: "dialog-box--footer",
62
+ children: [leftButton && /*#__PURE__*/_jsxs("div", {
63
+ className: "dialog-box--footer-container",
64
+ children: [/*#__PURE__*/_jsx("div", {
65
+ className: "left-button",
66
+ children: leftButton
67
+ }), /*#__PURE__*/_jsx("div", {
68
+ className: "right-buttons",
69
+ children: rightButtons?.map((rb, index) => {
70
+ const rbWithKey = {
71
+ ...rb,
72
+ key: `rb-${index}`,
73
+ props: {
74
+ ...rb.props,
75
+ size: rb.props.size || 'medium'
76
+ }
77
+ };
78
+ return rbWithKey;
79
+ })
80
+ })]
81
+ }), middleButtons && /*#__PURE__*/_jsx("div", {
82
+ className: "dialog-box--actions-container",
83
+ children: middleButtons?.map((mb, index) => {
84
+ const mbWithKey = {
85
+ ...mb,
86
+ key: `mb-${index}`,
87
+ props: {
88
+ ...mb.props,
89
+ size: mb.props.size || 'medium'
90
+ }
91
+ };
92
+ return mbWithKey;
93
+ })
94
+ })]
95
+ })]
96
+ })
97
+ }) : null;
88
98
  }
@@ -1,21 +1,16 @@
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 = Divisor;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _material = require("@mui/material");
10
- function Divisor(_ref) {
11
- let {
12
- mt = 3
13
- } = _ref;
14
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_material.Box, {
15
- mt: mt
16
- }), /*#__PURE__*/_react.default.createElement(_material.Divider, {
17
- light: true
18
- }), /*#__PURE__*/_react.default.createElement(_material.Box, {
19
- mt: mt
20
- }));
1
+ import React from 'react';
2
+ import { Box, Divider } from '@mui/material';
3
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
4
+ export default function Divisor({
5
+ mt = 3
6
+ }) {
7
+ return /*#__PURE__*/_jsxs(_Fragment, {
8
+ children: [/*#__PURE__*/_jsx(Box, {
9
+ mt: mt
10
+ }), /*#__PURE__*/_jsx(Divider, {
11
+ light: true
12
+ }), /*#__PURE__*/_jsx(Box, {
13
+ mt: mt
14
+ })]
15
+ });
21
16
  }
@@ -1,55 +1,45 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.DropdownV1 = DropdownV1;
8
- exports.default = Dropdown;
9
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
10
- var _react = _interopRequireDefault(require("react"));
11
- var _material = require("@mui/material");
12
- var _Autocomplete = _interopRequireDefault(require("./Autocomplete/Autocomplete"));
13
- var _SelectT = _interopRequireDefault(require("./Select/SelectT"));
14
- const _excluded = ["selectedValue", "onChange", "options", "autocomplete"];
15
- function DropdownV1(_ref) {
16
- let {
17
- id,
18
- label,
19
- values,
20
- onChange,
21
- selected,
22
- disabled
23
- } = _ref;
1
+ import React from 'react';
2
+ import { FormControl, InputLabel, MenuItem, Select } from '@mui/material';
3
+ import Autocomplete from './Autocomplete/Autocomplete';
4
+ import SelectT from './Select/SelectT';
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
+ export function DropdownV1({
7
+ id,
8
+ label,
9
+ values,
10
+ onChange,
11
+ selected,
12
+ disabled
13
+ }) {
24
14
  const onChangeH = event => {
25
15
  onChange(event.target.value);
26
16
  };
27
- return /*#__PURE__*/_react.default.createElement(_material.FormControl, {
17
+ return /*#__PURE__*/_jsxs(FormControl, {
28
18
  variant: "outlined",
29
19
  size: "small",
30
20
  disabled: disabled,
31
21
  sx: {
32
22
  width: '100%'
33
- }
34
- }, /*#__PURE__*/_react.default.createElement(_material.InputLabel, {
35
- id: "".concat(id, "-outlined-label")
36
- }, label), /*#__PURE__*/_react.default.createElement(_material.Select, {
37
- labelId: "".concat(id, "-outlined-label"),
38
- id: id,
39
- label: label,
40
- onChange: onChangeH,
41
- value: selected
42
- }, values === null || values === void 0 ? void 0 : values.map(_ref2 => {
43
- let {
44
- label: inLabel,
45
- value
46
- } = _ref2;
47
- return /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
48
- id: value,
49
- key: value,
50
- value: value
51
- }, inLabel);
52
- })));
23
+ },
24
+ children: [/*#__PURE__*/_jsx(InputLabel, {
25
+ id: `${id}-outlined-label`,
26
+ children: label
27
+ }), /*#__PURE__*/_jsx(Select, {
28
+ labelId: `${id}-outlined-label`,
29
+ id: id,
30
+ label: label,
31
+ onChange: onChangeH,
32
+ value: selected,
33
+ children: values?.map(({
34
+ label: inLabel,
35
+ value
36
+ }) => /*#__PURE__*/_jsx(MenuItem, {
37
+ id: value,
38
+ value: value,
39
+ children: inLabel
40
+ }, value))
41
+ })]
42
+ });
53
43
  }
54
44
  /**
55
45
  * This is a simple dropdown that takes in a tuple { label, value }
@@ -63,33 +53,36 @@ function DropdownV1(_ref) {
63
53
  * selectedValue={'value1'}
64
54
  * />
65
55
  */
66
- function Dropdown(props) {
56
+ export default function Dropdown(props) {
67
57
  const {
68
- selectedValue,
69
- onChange,
70
- options,
71
- autocomplete
72
- } = props,
73
- remainingProps = (0, _objectWithoutProperties2.default)(props, _excluded);
74
- const selectedItem = options === null || options === void 0 ? void 0 : options.find(option => option.value === selectedValue);
58
+ selectedValue,
59
+ onChange,
60
+ options,
61
+ autocomplete,
62
+ ...remainingProps
63
+ } = props;
64
+ const selectedItem = options?.find(option => option.value === selectedValue);
75
65
  const renderOption = option => {
76
66
  const styles = {
77
67
  fontWeight: option.fontWeight || 'normal',
78
68
  fontStyle: option.fontStyle || 'normal'
79
69
  };
80
- return /*#__PURE__*/_react.default.createElement("span", {
81
- style: styles
82
- }, option.label);
70
+ return /*#__PURE__*/_jsx("span", {
71
+ style: styles,
72
+ children: option.label
73
+ });
83
74
  };
84
75
  if (autocomplete) {
85
- return /*#__PURE__*/_react.default.createElement(_Autocomplete.default, Object.assign({}, remainingProps, {
86
- options: options !== null && options !== void 0 ? options : [],
76
+ return /*#__PURE__*/_jsx(Autocomplete, {
77
+ ...remainingProps,
78
+ options: options ?? [],
87
79
  selected: selectedItem || '',
88
80
  isEqual: (A, B) => A.value === B.value,
89
81
  onChange: option => onChange(option.value)
90
- }));
82
+ });
91
83
  }
92
- return /*#__PURE__*/_react.default.createElement(_SelectT.default, Object.assign({}, remainingProps, {
84
+ return /*#__PURE__*/_jsx(SelectT, {
85
+ ...remainingProps,
93
86
  options: options,
94
87
  selectedValue: selectedItem,
95
88
  isEqual: (A, B) => A.value === B.value,
@@ -98,7 +91,7 @@ function Dropdown(props) {
98
91
  label: str,
99
92
  value: str
100
93
  }),
101
- displayLabel: option => (option === null || option === void 0 ? void 0 : option.label) || '',
94
+ displayLabel: option => option?.label || '',
102
95
  onChange: option => onChange(option.value)
103
- }));
96
+ });
104
97
  }