@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,21 +1,14 @@
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 = TextField;
9
- var _react = _interopRequireWildcard(require("react"));
10
- var _material = require("@mui/material");
11
- var _classnames = _interopRequireDefault(require("classnames"));
12
- var _utils = require("../../utils");
13
- var _Icon = _interopRequireDefault(require("../Icon/Icon"));
14
- var _IconTooltip = _interopRequireDefault(require("../IconTooltip"));
15
- var _Markdown = _interopRequireDefault(require("../Markdown"));
16
- var _TruncatedTextArea = _interopRequireDefault(require("./TruncatedTextArea"));
17
- require("./styles.scss");
18
- function TextField(props) {
1
+ import React, { useMemo } from 'react';
2
+ import { Box } from '@mui/material';
3
+ import classNames from 'classnames';
4
+ import { isWhitespaces } from '../../utils';
5
+ import Icon from '../Icon/Icon';
6
+ import IconTooltip from '../IconTooltip';
7
+ import Markdown from '../Markdown';
8
+ import TruncatedTextArea from './TruncatedTextArea';
9
+ import './styles.scss';
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ export default function TextField(props) {
19
12
  const {
20
13
  autoFocus,
21
14
  label,
@@ -49,7 +42,7 @@ function TextField(props) {
49
42
  value,
50
43
  warningText
51
44
  } = props;
52
- const textfieldClass = (0, _classnames.default)({
45
+ const textfieldClass = classNames({
53
46
  'textfield-value': true,
54
47
  'textfield-value--disabled': disabled,
55
48
  'textfield-value--error': !!errorText,
@@ -58,7 +51,7 @@ function TextField(props) {
58
51
  });
59
52
  const textfieldOnChange = event => {
60
53
  const textValue = event.target.value;
61
- if ((0, _utils.isWhitespaces)(textValue)) {
54
+ if (isWhitespaces(textValue)) {
62
55
  return;
63
56
  }
64
57
  if (onChange) {
@@ -70,11 +63,11 @@ function TextField(props) {
70
63
  if (type === 'number' && typeof value !== 'undefined' && String(value) === '0') {
71
64
  event.currentTarget.select();
72
65
  }
73
- onFocus === null || onFocus === void 0 ? void 0 : onFocus();
66
+ onFocus?.();
74
67
  };
75
68
  const onKeyDownHandler = e => {
76
69
  if (disabledCharacters && disabledCharacters.includes(e.key)) {
77
- e === null || e === void 0 ? void 0 : e.preventDefault();
70
+ e?.preventDefault();
78
71
  return;
79
72
  }
80
73
  if (onKeyDown) {
@@ -85,13 +78,14 @@ function TextField(props) {
85
78
  if (iconRight === 'cancel' && !value) {
86
79
  return null;
87
80
  }
88
- return /*#__PURE__*/_react.default.createElement("button", {
81
+ return /*#__PURE__*/_jsx("button", {
89
82
  onClick: onClickRightIcon,
90
- className: "textfield-value--icon-container"
91
- }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
92
- name: iconRight,
93
- className: "textfield-value--icon-right".concat(iconRight === 'cancel' ? '--cancel' : '')
94
- }));
83
+ className: "textfield-value--icon-container",
84
+ children: /*#__PURE__*/_jsx(Icon, {
85
+ name: iconRight,
86
+ className: `textfield-value--icon-right${iconRight === 'cancel' ? '--cancel' : ''}`
87
+ })
88
+ });
95
89
  };
96
90
  const typeProps = {
97
91
  type
@@ -104,80 +98,91 @@ function TextField(props) {
104
98
  typeProps.max = max;
105
99
  }
106
100
  }
107
- const displayComponent = (0, _react.useMemo)(() => {
101
+ const displayComponent = useMemo(() => {
108
102
  if (!display || value === undefined) {
109
103
  return null;
110
104
  }
111
- const component = markdown ? /*#__PURE__*/_react.default.createElement(_Markdown.default, {
105
+ const component = markdown ? /*#__PURE__*/_jsx(Markdown, {
112
106
  value: value.toString()
113
- }) : /*#__PURE__*/_react.default.createElement("p", {
114
- className: "textfield-value--display".concat(preserveNewlines ? ' preserve-newlines' : '')
115
- }, value);
107
+ }) : /*#__PURE__*/_jsx("p", {
108
+ className: `textfield-value--display${preserveNewlines ? ' preserve-newlines' : ''}`,
109
+ children: value
110
+ });
116
111
  if (type === 'textarea' && truncateConfig) {
117
- return /*#__PURE__*/_react.default.createElement(_TruncatedTextArea.default, {
118
- truncateConfig: truncateConfig
119
- }, component);
112
+ return /*#__PURE__*/_jsx(TruncatedTextArea, {
113
+ truncateConfig: truncateConfig,
114
+ children: component
115
+ });
120
116
  } else {
121
117
  return component;
122
118
  }
123
119
  }, [display, markdown, preserveNewlines, truncateConfig, type, value]);
124
- return /*#__PURE__*/_react.default.createElement(_material.Box, {
125
- className: "textfield ".concat(className),
126
- sx: sx
127
- }, /*#__PURE__*/_react.default.createElement("label", {
128
- htmlFor: id,
129
- className: "textfield-label"
130
- }, required && label ? "".concat(label, " *") : label, tooltipTitle && /*#__PURE__*/_react.default.createElement(_IconTooltip.default, {
131
- placement: "top",
132
- title: tooltipTitle
133
- })), !display && (type === 'text' || type === 'number' ? /*#__PURE__*/_react.default.createElement("div", {
134
- id: id,
135
- className: textfieldClass
136
- }, iconLeft && /*#__PURE__*/_react.default.createElement(_Icon.default, {
137
- name: iconLeft,
138
- className: "textfield-value--icon-left"
139
- }), /*#__PURE__*/_react.default.createElement("input", Object.assign({
140
- autoFocus: autoFocus,
141
- value: type === 'number' ? value : value || '',
142
- disabled: readonly || disabled,
143
- placeholder: placeholder,
144
- onChange: textfieldOnChange,
145
- onBlur: onBlur,
146
- onFocus: textfieldOnFocus,
147
- onKeyDown: onKeyDownHandler,
148
- onWheel: e => e.currentTarget.blur(),
149
- required: required,
150
- maxLength: maxLength
151
- }, typeProps)), iconRight ? renderRightIcon() : null) : /*#__PURE__*/_react.default.createElement("textarea", {
152
- autoFocus: autoFocus,
153
- className: textfieldClass,
154
- value: value,
155
- disabled: readonly || disabled,
156
- placeholder: placeholder,
157
- onChange: textfieldOnChange,
158
- onBlur: onBlur,
159
- onFocus: textfieldOnFocus,
160
- required: required,
161
- maxLength: maxLength,
162
- style: (styles || {}).textarea
163
- })), displayComponent, errorText && /*#__PURE__*/_react.default.createElement("div", {
164
- className: "textfield-label-container"
165
- }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
166
- name: "error",
167
- className: "textfield-error-text--icon"
168
- }), /*#__PURE__*/_react.default.createElement("label", {
169
- htmlFor: id,
170
- className: "textfield-error-text"
171
- }, errorText)), warningText && /*#__PURE__*/_react.default.createElement("div", {
172
- className: "textfield-label-container"
173
- }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
174
- name: "warning",
175
- className: "textfield-warning-text--icon"
176
- }), /*#__PURE__*/_react.default.createElement("label", {
177
- htmlFor: id,
178
- className: "textfield-warning-text"
179
- }, warningText)), helperText && /*#__PURE__*/_react.default.createElement("label", {
180
- htmlFor: id,
181
- className: "textfield-help-text"
182
- }, helperText));
120
+ return /*#__PURE__*/_jsxs(Box, {
121
+ className: `textfield ${className}`,
122
+ sx: sx,
123
+ children: [/*#__PURE__*/_jsxs("label", {
124
+ htmlFor: id,
125
+ className: "textfield-label",
126
+ children: [required && label ? `${label} *` : label, tooltipTitle && /*#__PURE__*/_jsx(IconTooltip, {
127
+ placement: "top",
128
+ title: tooltipTitle
129
+ })]
130
+ }), !display && (type === 'text' || type === 'number' ? /*#__PURE__*/_jsxs("div", {
131
+ id: id,
132
+ className: textfieldClass,
133
+ children: [iconLeft && /*#__PURE__*/_jsx(Icon, {
134
+ name: iconLeft,
135
+ className: "textfield-value--icon-left"
136
+ }), /*#__PURE__*/_jsx("input", {
137
+ autoFocus: autoFocus,
138
+ value: type === 'number' ? value : value || '',
139
+ disabled: readonly || disabled,
140
+ placeholder: placeholder,
141
+ onChange: textfieldOnChange,
142
+ onBlur: onBlur,
143
+ onFocus: textfieldOnFocus,
144
+ onKeyDown: onKeyDownHandler,
145
+ onWheel: e => e.currentTarget.blur(),
146
+ required: required,
147
+ maxLength: maxLength,
148
+ ...typeProps
149
+ }), iconRight ? renderRightIcon() : null]
150
+ }) : /*#__PURE__*/_jsx("textarea", {
151
+ autoFocus: autoFocus,
152
+ className: textfieldClass,
153
+ value: value,
154
+ disabled: readonly || disabled,
155
+ placeholder: placeholder,
156
+ onChange: textfieldOnChange,
157
+ onBlur: onBlur,
158
+ onFocus: textfieldOnFocus,
159
+ required: required,
160
+ maxLength: maxLength,
161
+ style: (styles || {}).textarea
162
+ })), displayComponent, errorText && /*#__PURE__*/_jsxs("div", {
163
+ className: "textfield-label-container",
164
+ children: [/*#__PURE__*/_jsx(Icon, {
165
+ name: "error",
166
+ className: "textfield-error-text--icon"
167
+ }), /*#__PURE__*/_jsx("label", {
168
+ htmlFor: id,
169
+ className: "textfield-error-text",
170
+ children: errorText
171
+ })]
172
+ }), warningText && /*#__PURE__*/_jsxs("div", {
173
+ className: "textfield-label-container",
174
+ children: [/*#__PURE__*/_jsx(Icon, {
175
+ name: "warning",
176
+ className: "textfield-warning-text--icon"
177
+ }), /*#__PURE__*/_jsx("label", {
178
+ htmlFor: id,
179
+ className: "textfield-warning-text",
180
+ children: warningText
181
+ })]
182
+ }), helperText && /*#__PURE__*/_jsx("label", {
183
+ htmlFor: id,
184
+ className: "textfield-help-text",
185
+ children: helperText
186
+ })]
187
+ });
183
188
  }
@@ -1,20 +1,11 @@
1
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
10
- var _react = _interopRequireWildcard(require("react"));
11
- var _material = require("@mui/material");
12
- require("./styles.scss");
13
- const TruncatedTextArea = _ref => {
14
- let {
15
- truncateConfig,
16
- children
17
- } = _ref;
1
+ import React, { useEffect, useRef, useState } from 'react';
2
+ import { Link, Typography, useTheme } from '@mui/material';
3
+ import './styles.scss';
4
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
5
+ const TruncatedTextArea = ({
6
+ truncateConfig,
7
+ children
8
+ }) => {
18
9
  const {
19
10
  maxHeight,
20
11
  showLessText,
@@ -22,12 +13,12 @@ const TruncatedTextArea = _ref => {
22
13
  showTextStyle,
23
14
  alignment = 'left'
24
15
  } = truncateConfig;
25
- const theme = (0, _material.useTheme)();
26
- const [showAll, setShowAll] = (0, _react.useState)(false);
27
- const [needsTruncating, setNeedsTruncating] = (0, _react.useState)(false);
28
- const [totalHeight, setTotalHeight] = (0, _react.useState)(0);
29
- const ref = (0, _react.useRef)(null);
30
- (0, _react.useEffect)(() => {
16
+ const theme = useTheme();
17
+ const [showAll, setShowAll] = useState(false);
18
+ const [needsTruncating, setNeedsTruncating] = useState(false);
19
+ const [totalHeight, setTotalHeight] = useState(0);
20
+ const ref = useRef(null);
21
+ useEffect(() => {
31
22
  if (ref && ref.current && !totalHeight) {
32
23
  const height = ref.current.clientHeight;
33
24
  setTotalHeight(height);
@@ -42,28 +33,35 @@ const TruncatedTextArea = _ref => {
42
33
  width: '100%'
43
34
  };
44
35
  if (needsTruncating && !showAll) {
45
- divStyle.maxHeight = "".concat(maxHeight, "px");
36
+ divStyle.maxHeight = `${maxHeight}px`;
46
37
  }
47
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
48
- ref: ref,
49
- style: divStyle
50
- }, children), needsTruncating && /*#__PURE__*/_react.default.createElement("div", {
51
- style: {
52
- width: '100%',
53
- textAlign: alignment
54
- }
55
- }, /*#__PURE__*/_react.default.createElement(_material.Link, {
56
- component: "button",
57
- onClick: toggleShowAll,
58
- onBlur: () => setShowAll(false),
59
- sx: {
60
- color: theme.palette.TwClrTxtBrand,
61
- textDecorationColor: "".concat(theme.palette.TwClrTxtBrand, "80")
62
- }
63
- }, /*#__PURE__*/_react.default.createElement(_material.Typography, {
64
- sx: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, showTextStyle), {}, {
65
- marginTop: '-3px'
66
- })
67
- }, showAll ? showLessText : showMoreText))));
38
+ return /*#__PURE__*/_jsxs(_Fragment, {
39
+ children: [/*#__PURE__*/_jsx("div", {
40
+ ref: ref,
41
+ style: divStyle,
42
+ children: children
43
+ }), needsTruncating && /*#__PURE__*/_jsx("div", {
44
+ style: {
45
+ width: '100%',
46
+ textAlign: alignment
47
+ },
48
+ children: /*#__PURE__*/_jsx(Link, {
49
+ component: "button",
50
+ onClick: toggleShowAll,
51
+ onBlur: () => setShowAll(false),
52
+ sx: {
53
+ color: theme.palette.TwClrTxtBrand,
54
+ textDecorationColor: `${theme.palette.TwClrTxtBrand}80`
55
+ },
56
+ children: /*#__PURE__*/_jsx(Typography, {
57
+ sx: {
58
+ ...showTextStyle,
59
+ marginTop: '-3px'
60
+ },
61
+ children: showAll ? showLessText : showMoreText
62
+ })
63
+ })
64
+ })]
65
+ });
68
66
  };
69
- var _default = exports.default = TruncatedTextArea;
67
+ export default TruncatedTextArea;
@@ -1,33 +1,29 @@
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 = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- require("./styles.scss");
10
- const TimelineMarker = _ref => {
11
- let {
12
- color,
13
- labelBottom,
14
- labelTop,
15
- onClick,
16
- size,
17
- value
18
- } = _ref;
1
+ import React from 'react';
2
+ import './styles.scss';
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
+ const TimelineMarker = ({
5
+ color,
6
+ labelBottom,
7
+ labelTop,
8
+ onClick,
9
+ size,
10
+ value
11
+ }) => {
19
12
  const clampedValue = Math.min(1, Math.max(0, value));
20
- return /*#__PURE__*/_react.default.createElement("div", {
21
- className: "timeline-marker timeline-marker--".concat(size, " ").concat(onClick ? 'timeline-marker--clickable' : ''),
13
+ return /*#__PURE__*/_jsxs("div", {
14
+ className: `timeline-marker timeline-marker--${size} ${onClick ? 'timeline-marker--clickable' : ''}`,
22
15
  style: {
23
- left: "".concat(clampedValue * 100, "%"),
16
+ left: `${clampedValue * 100}%`,
24
17
  backgroundColor: color
25
18
  },
26
- onClick: onClick
27
- }, labelTop && /*#__PURE__*/_react.default.createElement("div", {
28
- className: "timeline-marker__label timeline-marker__label--top"
29
- }, labelTop), labelBottom && /*#__PURE__*/_react.default.createElement("div", {
30
- className: "timeline-marker__label timeline-marker__label--bottom"
31
- }, labelBottom));
19
+ onClick: onClick,
20
+ children: [labelTop && /*#__PURE__*/_jsx("div", {
21
+ className: "timeline-marker__label timeline-marker__label--top",
22
+ children: labelTop
23
+ }), labelBottom && /*#__PURE__*/_jsx("div", {
24
+ className: "timeline-marker__label timeline-marker__label--bottom",
25
+ children: labelBottom
26
+ })]
27
+ });
32
28
  };
33
- var _default = exports.default = TimelineMarker;
29
+ export default TimelineMarker;
@@ -1,15 +1,9 @@
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 = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- require("./styles.scss");
1
+ import React from 'react';
2
+ import './styles.scss';
3
+ import { jsx as _jsx } from "react/jsx-runtime";
10
4
  const TimelineRail = () => {
11
- return /*#__PURE__*/_react.default.createElement("div", {
5
+ return /*#__PURE__*/_jsx("div", {
12
6
  className: "timeline-rail"
13
7
  });
14
8
  };
15
- var _default = exports.default = TimelineRail;
9
+ export default TimelineRail;
@@ -1,28 +1,20 @@
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 = void 0;
9
- var _react = _interopRequireWildcard(require("react"));
10
- var _material = require("@mui/material");
11
- var _TimelineMarker = _interopRequireDefault(require("./TimelineMarker"));
12
- var _TimelineRail = _interopRequireDefault(require("./TimelineRail"));
13
- require("./styles.scss");
14
- const TimelineSlider = _ref => {
15
- let {
16
- labelEnd,
17
- labelSelected,
18
- labelStart,
19
- marks
20
- } = _ref;
21
- const theme = (0, _material.useTheme)();
1
+ import React, { useMemo } from 'react';
2
+ import { useTheme } from '@mui/material';
3
+ import TimelineMarker from './TimelineMarker';
4
+ import TimelineRail from './TimelineRail';
5
+ import './styles.scss';
6
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
+ const TimelineSlider = ({
8
+ labelEnd,
9
+ labelSelected,
10
+ labelStart,
11
+ marks
12
+ }) => {
13
+ const theme = useTheme();
22
14
  const {
23
15
  minValue,
24
16
  maxValue
25
- } = (0, _react.useMemo)(() => {
17
+ } = useMemo(() => {
26
18
  const values = marks.map(mark => mark.value);
27
19
  if (values.length > 0) {
28
20
  return {
@@ -37,33 +29,37 @@ const TimelineSlider = _ref => {
37
29
  }
38
30
  }, [marks]);
39
31
  const range = maxValue - minValue;
40
- return /*#__PURE__*/_react.default.createElement("div", {
41
- className: 'timeline'
42
- }, /*#__PURE__*/_react.default.createElement("div", {
43
- className: 'timeline-label',
44
- style: {
45
- marginRight: theme.spacing(2)
46
- }
47
- }, labelStart), /*#__PURE__*/_react.default.createElement("div", {
48
- className: "timeline-container"
49
- }, /*#__PURE__*/_react.default.createElement(_TimelineRail.default, null), marks.map((mark, idx) => {
50
- const normalizedValue = range === 0 ? 1 : (mark.value - minValue) / range;
51
- return /*#__PURE__*/_react.default.createElement(_TimelineMarker.default, {
52
- key: idx,
53
- color: mark.color,
54
- labelBottom: mark.labelBottom,
55
- labelTop: mark.labelTop,
56
- onClick: mark.onClick,
57
- size: mark.size,
58
- value: normalizedValue
59
- });
60
- })), /*#__PURE__*/_react.default.createElement("div", {
61
- className: 'timeline-label',
62
- style: {
63
- marginLeft: theme.spacing(2)
64
- }
65
- }, labelEnd), labelSelected && /*#__PURE__*/_react.default.createElement("div", {
66
- className: 'timeline-selected-label'
67
- }, labelSelected));
32
+ return /*#__PURE__*/_jsxs("div", {
33
+ className: 'timeline',
34
+ children: [/*#__PURE__*/_jsx("div", {
35
+ className: 'timeline-label',
36
+ style: {
37
+ marginRight: theme.spacing(2)
38
+ },
39
+ children: labelStart
40
+ }), /*#__PURE__*/_jsxs("div", {
41
+ className: "timeline-container",
42
+ children: [/*#__PURE__*/_jsx(TimelineRail, {}), marks.map((mark, idx) => {
43
+ const normalizedValue = range === 0 ? 1 : (mark.value - minValue) / range;
44
+ return /*#__PURE__*/_jsx(TimelineMarker, {
45
+ color: mark.color,
46
+ labelBottom: mark.labelBottom,
47
+ labelTop: mark.labelTop,
48
+ onClick: mark.onClick,
49
+ size: mark.size,
50
+ value: normalizedValue
51
+ }, idx);
52
+ })]
53
+ }), /*#__PURE__*/_jsx("div", {
54
+ className: 'timeline-label',
55
+ style: {
56
+ marginLeft: theme.spacing(2)
57
+ },
58
+ children: labelEnd
59
+ }), labelSelected && /*#__PURE__*/_jsx("div", {
60
+ className: 'timeline-selected-label',
61
+ children: labelSelected
62
+ })]
63
+ });
68
64
  };
69
- var _default = exports.default = TimelineSlider;
65
+ export default TimelineSlider;
@@ -1,26 +1,19 @@
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
- children,
14
- placement = 'top-start',
15
- slotProps,
16
- sx,
17
- title
18
- } = _ref;
19
- const [open, setOpen] = _react.default.useState(false);
1
+ import React from 'react';
2
+ import { Tooltip as MUITooltip, useTheme } from '@mui/material';
3
+ import { useDeviceInfo } from '../../utils';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ export default function Tooltip({
6
+ children,
7
+ placement = 'top-start',
8
+ slotProps,
9
+ sx,
10
+ title
11
+ }) {
12
+ const [open, setOpen] = React.useState(false);
20
13
  const {
21
14
  isMobile
22
- } = (0, _utils.useDeviceInfo)();
23
- const theme = (0, _material.useTheme)();
15
+ } = useDeviceInfo();
16
+ const theme = useTheme();
24
17
  const handleTooltipClose = () => {
25
18
  setOpen(false);
26
19
  };
@@ -29,7 +22,7 @@ function Tooltip(_ref) {
29
22
  setOpen(true);
30
23
  }
31
24
  };
32
- return /*#__PURE__*/_react.default.createElement(_material.Tooltip, {
25
+ return /*#__PURE__*/_jsx(MUITooltip, {
33
26
  arrow: true,
34
27
  onOpen: handleTooltipOpen,
35
28
  onClose: handleTooltipClose,
@@ -50,8 +43,10 @@ function Tooltip(_ref) {
50
43
  }
51
44
  }
52
45
  }, ...(Array.isArray(sx) ? sx : [sx])],
53
- title: title
54
- }, /*#__PURE__*/_react.default.createElement("span", {
55
- onClick: handleTooltipOpen
56
- }, children));
46
+ title: title,
47
+ children: /*#__PURE__*/_jsx("span", {
48
+ onClick: handleTooltipOpen,
49
+ children: children
50
+ })
51
+ });
57
52
  }