@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.
- package/components/AntSwitch/index.js +27 -0
- package/components/AntSwitch/styles.scss +66 -0
- package/components/Autocomplete/Autocomplete.js +131 -0
- package/components/Autocomplete/styles.scss +155 -0
- package/components/Badge/index.js +32 -0
- package/components/BusySpinner/index.js +49 -0
- package/components/Button/Button.js +51 -0
- package/components/Button/button.test.js +25 -0
- package/components/Button/styles.scss +453 -0
- package/components/Checkbox.js +70 -0
- package/components/Confirm/index.js +94 -0
- package/components/DatePicker/DatePicker.js +150 -0
- package/components/DatePicker/styles.scss +95 -0
- package/components/DialogBox/DialogBox.js +91 -0
- package/components/DialogBox/styles.scss +165 -0
- package/components/Divisor.js +21 -0
- package/components/Dropdown.js +102 -0
- package/components/ErrorBox/ErrorBox.js +47 -0
- package/components/ErrorBox/styles.scss +63 -0
- package/components/FileChooser/index.js +137 -0
- package/components/FormBottomBar/index.js +90 -0
- package/components/Icon/Icon.js +25 -0
- package/components/Icon/icons/index.js +241 -0
- package/components/Icon/styles.scss +41 -0
- package/components/IconTooltip/index.js +61 -0
- package/components/Map/MapBox.d.ts.map +1 -1
- package/components/Map/MapBox.js +479 -0
- package/components/Map/MapContainer.js +30 -0
- package/components/Map/MapDateSliderControl.js +66 -0
- package/components/Map/MapDrawer.js +45 -0
- package/components/Map/MapLegend.js +172 -0
- package/components/Map/MapViewStyleControl.js +74 -0
- package/components/Map/ReactMapboxWrapper.d.ts +3 -0
- package/components/Map/ReactMapboxWrapper.d.ts.map +1 -0
- package/components/Map/ReactMapboxWrapper.js +9 -0
- package/components/Map/index.js +190 -0
- package/components/Map/styles.scss +130 -0
- package/components/Map/types.js +24 -0
- package/components/Map/useMaintainLayerOrder.js +32 -0
- package/components/Message/Message.js +67 -0
- package/components/Message/styles.scss +202 -0
- package/components/MultiSelect/MultiSelect.test.js +75 -0
- package/components/MultiSelect/index.js +120 -0
- package/components/MultiSelect/styles.scss +180 -0
- package/components/Navbar/NavFooter.js +17 -0
- package/components/Navbar/NavItem.js +73 -0
- package/components/Navbar/NavSection.js +22 -0
- package/components/Navbar/Navbar.js +46 -0
- package/components/Navbar/SubNavbar.js +17 -0
- package/components/Navbar/styles.scss +155 -0
- package/components/Note.js +25 -0
- package/components/PageForm/index.js +43 -0
- package/components/PhotoChooser/index.js +137 -0
- package/components/Pill/index.js +46 -0
- package/components/Pill/styles.scss +50 -0
- package/components/PillList/index.js +29 -0
- package/components/PillList/styles.scss +12 -0
- package/components/PlacementWrapper/index.js +63 -0
- package/components/PopoverMenu/Popover.js +88 -0
- package/components/PopoverMenu/index.js +59 -0
- package/components/PopoverMultiSelect/index.js +62 -0
- package/components/PopoverMultiSelect/styles.scss +10 -0
- package/components/ProgressCircle/ProgressCircle.js +34 -0
- package/components/ProgressCircle/styles.scss +87 -0
- package/components/RadioButton.js +25 -0
- package/components/Select/Select.js +19 -0
- package/components/Select/SelectT.js +245 -0
- package/components/Select/styles.scss +307 -0
- package/components/Separator/index.js +21 -0
- package/components/Size.js +5 -0
- package/components/Slider/index.js +60 -0
- package/components/SummaryBox.js +73 -0
- package/components/Tabs/index.js +111 -0
- package/components/TextTruncated/index.js +146 -0
- package/components/Textfield/Textfield.js +172 -0
- package/components/Textfield/TruncatedTextArea.js +71 -0
- package/components/Textfield/styles.scss +271 -0
- package/components/Tooltip/Tooltip.js +54 -0
- package/components/ViewPhotosDialog/index.js +136 -0
- package/components/ViewPhotosDialog/styles.scss +18 -0
- package/components/svg/BlobbyGrayIconImage.js +39 -0
- package/components/svg/BlobbyGrayIconImport.js +39 -0
- package/components/svg/BlobbyGrayIconUploadToTheCloud.js +39 -0
- package/components/svg/BlobbyIconCloudChecked.js +156 -0
- package/components/svg/BlobbyIconExportOrUploadPhoto.js +156 -0
- package/components/svg/BlobbyIconFolder.js +156 -0
- package/components/svg/BlobbyIconGraphReport.js +156 -0
- package/components/svg/BlobbyIconHappy.js +156 -0
- package/components/svg/BlobbyIconHeartMonitor.js +156 -0
- package/components/svg/BlobbyIconLeaf.js +156 -0
- package/components/svg/BlobbyIconLibrary.js +156 -0
- package/components/svg/BlobbyIconNursery.js +158 -0
- package/components/svg/BlobbyIconOrganization.js +156 -0
- package/components/svg/BlobbyIconParchment.js +156 -0
- package/components/svg/BlobbyIconPeople.js +156 -0
- package/components/svg/BlobbyIconSeedBank.js +156 -0
- package/components/svg/BlobbyIconSeedling.js +156 -0
- package/components/svg/BlobbyIconSeeds.js +156 -0
- package/components/svg/BlobbyIconSite.js +159 -0
- package/components/svg/BlobbyIconSparkles.js +156 -0
- package/components/svg/BlobbyIconWrench.js +156 -0
- package/components/svg/Bug.js +25 -0
- package/components/svg/Calendar.js +25 -0
- package/components/svg/CaretDown.js +25 -0
- package/components/svg/CaretLeft.js +25 -0
- package/components/svg/CaretRight.js +25 -0
- package/components/svg/CaretUp.js +25 -0
- package/components/svg/ChevronDown.js +25 -0
- package/components/svg/ChevronUp.js +25 -0
- package/components/svg/Close.js +25 -0
- package/components/svg/Critical.js +25 -0
- package/components/svg/Edit.js +156 -0
- package/components/svg/Error.js +25 -0
- package/components/svg/Filter.js +25 -0
- package/components/svg/Folder.js +25 -0
- package/components/svg/Help.js +25 -0
- package/components/svg/Home.js +25 -0
- package/components/svg/IconAdd.js +25 -0
- package/components/svg/IconArrowRight.js +27 -0
- package/components/svg/IconBusinessNetwork.js +25 -0
- package/components/svg/IconCancel.js +25 -0
- package/components/svg/IconChargingBattery.js +25 -0
- package/components/svg/IconCheckmark.js +25 -0
- package/components/svg/IconCoinInHand.js +25 -0
- package/components/svg/IconColumns.js +25 -0
- package/components/svg/IconComment.js +26 -0
- package/components/svg/IconDashboard.js +25 -0
- package/components/svg/IconDataMigration.js +25 -0
- package/components/svg/IconEdit.js +27 -0
- package/components/svg/IconExport.js +25 -0
- package/components/svg/IconExternalLink.js +25 -0
- package/components/svg/IconEye.js +25 -0
- package/components/svg/IconEyeOff.js +25 -0
- package/components/svg/IconFile.js +25 -0
- package/components/svg/IconFolder.js +25 -0
- package/components/svg/IconFullScreen.js +26 -0
- package/components/svg/IconFutures.js +25 -0
- package/components/svg/IconGraphReport.js +25 -0
- package/components/svg/IconHeartMonitor.js +25 -0
- package/components/svg/IconHelp.js +27 -0
- package/components/svg/IconHistory.js +25 -0
- package/components/svg/IconImport.js +25 -0
- package/components/svg/IconIndex.js +25 -0
- package/components/svg/IconLayers.js +25 -0
- package/components/svg/IconLibrary.js +26 -0
- package/components/svg/IconList.js +25 -0
- package/components/svg/IconLivePlant.js +25 -0
- package/components/svg/IconLocations.js +25 -0
- package/components/svg/IconMail.js +25 -0
- package/components/svg/IconManager.js +25 -0
- package/components/svg/IconMarker.js +25 -0
- package/components/svg/IconMenu.js +25 -0
- package/components/svg/IconMenuHorizontal.js +25 -0
- package/components/svg/IconModule.js +25 -0
- package/components/svg/IconMyLocation.js +25 -0
- package/components/svg/IconNote.js +27 -0
- package/components/svg/IconNursery.js +27 -0
- package/components/svg/IconOrg.js +25 -0
- package/components/svg/IconParchment.js +25 -0
- package/components/svg/IconPhoto.js +25 -0
- package/components/svg/IconRedo.js +25 -0
- package/components/svg/IconRestorationSite.js +25 -0
- package/components/svg/IconSeedBank.js +25 -0
- package/components/svg/IconSeedling.js +25 -0
- package/components/svg/IconSettings.js +25 -0
- package/components/svg/IconSlice.js +25 -0
- package/components/svg/IconSubmit.js +25 -0
- package/components/svg/IconSubtract.js +27 -0
- package/components/svg/IconSynced.js +25 -0
- package/components/svg/IconTrashCan.js +25 -0
- package/components/svg/IconTreasureMap.js +25 -0
- package/components/svg/IconUndo.js +25 -0
- package/components/svg/IconVariable.js +25 -0
- package/components/svg/IconWifi.js +25 -0
- package/components/svg/Info.js +25 -0
- package/components/svg/Key.js +25 -0
- package/components/svg/Leaf.js +25 -0
- package/components/svg/Lock.js +25 -0
- package/components/svg/Logo.js +43 -0
- package/components/svg/MenuVertical.js +25 -0
- package/components/svg/Notification.js +25 -0
- package/components/svg/Person.js +25 -0
- package/components/svg/Plus.js +25 -0
- package/components/svg/RestorationSite.js +25 -0
- package/components/svg/Search.js +25 -0
- package/components/svg/Seeds.js +25 -0
- package/components/svg/Site.js +25 -0
- package/components/svg/Sparkles.js +25 -0
- package/components/svg/Species.js +25 -0
- package/components/svg/Species2.js +156 -0
- package/components/svg/Spinner.js +52 -0
- package/components/svg/Success.js +25 -0
- package/components/svg/SuccessFilled.js +25 -0
- package/components/svg/TerrawareLogoDesktop.js +49 -0
- package/components/svg/TerrawareLogoMobile.js +30 -0
- package/components/svg/Touchscreen.js +25 -0
- package/components/svg/UploadCloud.js +156 -0
- package/components/svg/Warning.js +25 -0
- package/components/svg/WelcomeClipboard.js +133 -0
- package/components/svg/index.js +832 -0
- package/components/table/EnhancedTableToolbar.js +76 -0
- package/components/table/EnhancedTableToolbarV2.js +49 -0
- package/components/table/TableCellRenderer.js +244 -0
- package/components/table/TableHeader.js +75 -0
- package/components/table/TableHeaderItem.js +100 -0
- package/components/table/density.js +28 -0
- package/components/table/index.js +346 -0
- package/components/table/sort.js +72 -0
- package/components/table/sort.test.js +37 -0
- package/components/table/types.js +5 -0
- package/components/types/index.js +5 -0
- package/fonts/Inter.ttf +0 -0
- package/index.css +11 -0
- package/index.js +377 -0
- package/package.json +2 -5
- package/setupTests.js +5 -0
- package/style-dictionary-dist/TerrawareTheme.js +193 -0
- package/style-dictionary-dist/terraware.scss +414 -0
- package/theme.js +86 -0
- package/utils/date.js +124 -0
- package/utils/date.test.js +87 -0
- package/utils/index.js +53 -0
- package/utils/preventDefaultEvent.js +8 -0
- package/utils/text.js +17 -0
- package/utils/text.test.js +23 -0
- package/utils/useDeviceInfo.js +85 -0
- package/index.cjs.js +0 -88606
- package/index.cjs.js.map +0 -1
- package/index.esm.js +0 -88533
- package/index.esm.js.map +0 -1
|
@@ -0,0 +1,73 @@
|
|
|
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 = NavItem;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _theme = _interopRequireDefault(require("../../theme"));
|
|
11
|
+
var _Icon = _interopRequireDefault(require("../Icon/Icon"));
|
|
12
|
+
require("./styles.scss");
|
|
13
|
+
function NavItem(props) {
|
|
14
|
+
const {
|
|
15
|
+
label,
|
|
16
|
+
icon,
|
|
17
|
+
iconColor,
|
|
18
|
+
children: childrenProps,
|
|
19
|
+
disabled,
|
|
20
|
+
selected,
|
|
21
|
+
onClick,
|
|
22
|
+
id,
|
|
23
|
+
isFooter,
|
|
24
|
+
href
|
|
25
|
+
} = props;
|
|
26
|
+
const children = href ? null : childrenProps;
|
|
27
|
+
const hasChildrenSelected = (0, _react.useCallback)(() => {
|
|
28
|
+
if (children && children.props && children.props.children) {
|
|
29
|
+
const subChildren = children.props.children;
|
|
30
|
+
if (Array.isArray(subChildren)) {
|
|
31
|
+
return subChildren.some(subChild => subChild.props && subChild.props.selected);
|
|
32
|
+
}
|
|
33
|
+
return subChildren.props && subChildren.props.selected;
|
|
34
|
+
}
|
|
35
|
+
return false;
|
|
36
|
+
}, [children]);
|
|
37
|
+
_react.default.useEffect(() => {
|
|
38
|
+
if (hasChildrenSelected()) {
|
|
39
|
+
setOpen(true);
|
|
40
|
+
}
|
|
41
|
+
}, [children, hasChildrenSelected, selected]);
|
|
42
|
+
const [open, setOpen] = _react.default.useState(hasChildrenSelected());
|
|
43
|
+
const onClickHandler = () => {
|
|
44
|
+
if (!disabled) {
|
|
45
|
+
setOpen(!open || hasChildrenSelected());
|
|
46
|
+
if (onClick) {
|
|
47
|
+
onClick(!open);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const customLabel = typeof label !== 'string';
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
53
|
+
className: "\n nav-item \n ".concat(selected ? 'nav-item--selected' : '', "\n ").concat(hasChildrenSelected() ? 'nav-item--children-selected' : '', "\n ").concat(isFooter ? 'nav-item--footer' : '', "\n ").concat(children ? 'nav-item--has-children' : '', "\n ")
|
|
54
|
+
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
55
|
+
className: "\n ".concat(customLabel ? 'nav-item-custom-content' : 'nav-item-content', "\n ").concat(disabled ? 'nav-item--disabled' : '', "\n "),
|
|
56
|
+
onClick: onClickHandler,
|
|
57
|
+
id: id
|
|
58
|
+
}, icon && /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
59
|
+
name: icon,
|
|
60
|
+
className: "nav-item--icon",
|
|
61
|
+
fillColor: iconColor !== null && iconColor !== void 0 ? iconColor : _theme.default.palette.TwClrIcnSecondary
|
|
62
|
+
}), !href && /*#__PURE__*/_react.default.createElement("span", {
|
|
63
|
+
className: "nav-item--label"
|
|
64
|
+
}, label), href && /*#__PURE__*/_react.default.createElement("a", {
|
|
65
|
+
className: "nav-item--label nav-item--anchor",
|
|
66
|
+
href: href,
|
|
67
|
+
rel: "noopener noreferrer",
|
|
68
|
+
target: "_external"
|
|
69
|
+
}, label), children && /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
70
|
+
name: open ? 'chevronUp' : 'chevronDown',
|
|
71
|
+
className: "nav-item--arrow"
|
|
72
|
+
})), children && open && children);
|
|
73
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 = NavSection;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
require("./styles.scss");
|
|
10
|
+
function NavSection(props) {
|
|
11
|
+
const {
|
|
12
|
+
title,
|
|
13
|
+
separator = true
|
|
14
|
+
} = props;
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
16
|
+
className: "nav-section"
|
|
17
|
+
}, separator && /*#__PURE__*/_react.default.createElement("div", {
|
|
18
|
+
className: "divider"
|
|
19
|
+
}), title && /*#__PURE__*/_react.default.createElement("span", {
|
|
20
|
+
className: "nav-section--title ".concat(separator ? '' : 'no-separator')
|
|
21
|
+
}, title));
|
|
22
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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 = Navbar;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _material = require("@mui/material");
|
|
10
|
+
var _utils = require("../../utils");
|
|
11
|
+
var _Icon = _interopRequireDefault(require("../Icon/Icon"));
|
|
12
|
+
require("./styles.scss");
|
|
13
|
+
function Navbar(props) {
|
|
14
|
+
const {
|
|
15
|
+
children,
|
|
16
|
+
setShowNavBar,
|
|
17
|
+
backgroundTransparent
|
|
18
|
+
} = props;
|
|
19
|
+
const {
|
|
20
|
+
isDesktop
|
|
21
|
+
} = (0, _utils.useDeviceInfo)();
|
|
22
|
+
const theme = (0, _material.useTheme)();
|
|
23
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
24
|
+
className: 'navbar' + (backgroundTransparent ? ' transparent' : '')
|
|
25
|
+
}, !isDesktop && /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
26
|
+
sx: {
|
|
27
|
+
display: 'flex',
|
|
28
|
+
justifyContent: 'start'
|
|
29
|
+
}
|
|
30
|
+
}, /*#__PURE__*/_react.default.createElement(_material.ButtonBase, {
|
|
31
|
+
onClick: () => setShowNavBar(false),
|
|
32
|
+
sx: {
|
|
33
|
+
background: 'none',
|
|
34
|
+
border: 'none',
|
|
35
|
+
cursor: 'pointer'
|
|
36
|
+
}
|
|
37
|
+
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
38
|
+
name: "close",
|
|
39
|
+
size: "medium",
|
|
40
|
+
style: {
|
|
41
|
+
fill: theme.palette.TwClrIcnSecondary,
|
|
42
|
+
marginRight: '16px',
|
|
43
|
+
marginBottom: '8px'
|
|
44
|
+
}
|
|
45
|
+
}))), children);
|
|
46
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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 = SubNavbar;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
require("./styles.scss");
|
|
10
|
+
function SubNavbar(props) {
|
|
11
|
+
const {
|
|
12
|
+
children
|
|
13
|
+
} = props;
|
|
14
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
15
|
+
className: "subnavbar"
|
|
16
|
+
}, children);
|
|
17
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
@import '../../style-dictionary-dist/terraware.scss';
|
|
2
|
+
|
|
3
|
+
@font-face {
|
|
4
|
+
font-family: 'Inter';
|
|
5
|
+
src: local('Inter'), url(../../fonts/Inter.ttf) format('truetype');
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.navbar {
|
|
9
|
+
height: 100%;
|
|
10
|
+
position: fixed;
|
|
11
|
+
z-index: 1101;
|
|
12
|
+
width: $tw-sz-nvgtn-side-nav-width;
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
padding-left: $tw-sz-base-small;
|
|
16
|
+
padding-right: $tw-sz-base-small;
|
|
17
|
+
padding-top: $tw-sz-base-small;
|
|
18
|
+
|
|
19
|
+
&.transparent {
|
|
20
|
+
background-color: transparent !important;
|
|
21
|
+
background-image: unset !important;
|
|
22
|
+
mix-blend-mode: multiply;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.nav-section {
|
|
26
|
+
padding: $tw-spc-base-x-small $tw-spc-base-small;
|
|
27
|
+
.divider {
|
|
28
|
+
border-top: 1px solid $tw-clr-brdr-tertiary;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&--title {
|
|
32
|
+
font-family: $tw-fnt-nvgtn-side-nav-section-title-font-family;
|
|
33
|
+
font-size: $tw-fnt-nvgtn-side-nav-section-title-font-size;
|
|
34
|
+
font-weight: $tw-fnt-nvgtn-side-nav-section-title-font-weight;
|
|
35
|
+
line-height: $tw-fnt-nvgtn-side-nav-section-title-line-height;
|
|
36
|
+
text-transform: $tw-fnt-nvgtn-side-nav-section-title-text-transform;
|
|
37
|
+
color: $tw-clr-txt;
|
|
38
|
+
display: block;
|
|
39
|
+
margin-top: $tw-spc-base-small;
|
|
40
|
+
|
|
41
|
+
&.no-separator {
|
|
42
|
+
margin-top: 0;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.nav-item-custom-content {
|
|
48
|
+
border: none;
|
|
49
|
+
background: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.nav-item {
|
|
53
|
+
font-family: $tw-fnt-nvgtn-side-nav-item-label-font-family;
|
|
54
|
+
font-size: $tw-fnt-nvgtn-side-nav-item-label-font-size;
|
|
55
|
+
font-weight: $tw-fnt-nvgtn-side-nav-item-label-font-weight;
|
|
56
|
+
line-height: $tw-fnt-nvgtn-side-nav-item-label-line-height;
|
|
57
|
+
color: $tw-clr-txt;
|
|
58
|
+
border-radius: 16px;
|
|
59
|
+
mix-blend-mode: multiply;
|
|
60
|
+
|
|
61
|
+
.nav-item--disabled {
|
|
62
|
+
opacity: 0.5;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.nav-item-content {
|
|
66
|
+
border-radius: 16px;
|
|
67
|
+
padding: 12px 16px;
|
|
68
|
+
display: flex;
|
|
69
|
+
width: 100%;
|
|
70
|
+
font-weight: $tw-fnt-nvgtn-side-nav-item-label-font-weight;
|
|
71
|
+
|
|
72
|
+
.nav-item--anchor {
|
|
73
|
+
text-decoration: none;
|
|
74
|
+
color: $tw-clr-txt;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.nav-item--label {
|
|
78
|
+
flex: 1 1 auto;
|
|
79
|
+
text-align: left;
|
|
80
|
+
font-size: 14px;
|
|
81
|
+
font-weight: 500;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&:hover {
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&--has-children {
|
|
90
|
+
> .nav-item-content:hover {
|
|
91
|
+
background-color: $tw-clr-bg-ghost-hover;
|
|
92
|
+
}
|
|
93
|
+
> .nav-item-content:active {
|
|
94
|
+
background-color: $tw-clr-bg-ghost-active;
|
|
95
|
+
}
|
|
96
|
+
&.nav-item--children-selected > .nav-item-content:hover {
|
|
97
|
+
background-color: transparent;
|
|
98
|
+
}
|
|
99
|
+
&.nav-item--children-selected > .nav-item-content:ative {
|
|
100
|
+
background-color: transparent;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&:not(.nav-item--has-children) {
|
|
105
|
+
&:hover {
|
|
106
|
+
background-color: $tw-clr-bg-ghost-hover;
|
|
107
|
+
}
|
|
108
|
+
&.nav-item--selected,
|
|
109
|
+
&.nav-item--selected:hover {
|
|
110
|
+
background-color: $tw-clr-bg-ghost-active;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
button {
|
|
115
|
+
background: none;
|
|
116
|
+
border: none;
|
|
117
|
+
color: $tw-clr-txt;
|
|
118
|
+
font-family: 'Inter';
|
|
119
|
+
padding-right: $tw-spc-base-small;
|
|
120
|
+
padding-left: 16px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&--icon {
|
|
124
|
+
margin-right: $tw-spc-base-x-small;
|
|
125
|
+
line-height: $tw-sz-icon-small;
|
|
126
|
+
height: $tw-sz-icon-small;
|
|
127
|
+
min-width: $tw-sz-icon-small;
|
|
128
|
+
width: $tw-sz-icon-small;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&--arrow {
|
|
132
|
+
height: $tw-sz-icon-small;
|
|
133
|
+
width: $tw-sz-icon-small;
|
|
134
|
+
margin-left: $tw-spc-base-x-small;
|
|
135
|
+
|
|
136
|
+
path {
|
|
137
|
+
fill: $tw-clr-icn-secondary;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.subnavbar .nav-item {
|
|
142
|
+
padding-left: $tw-spc-base-small;
|
|
143
|
+
padding-right: $tw-spc-base-small;
|
|
144
|
+
|
|
145
|
+
&-content {
|
|
146
|
+
padding-left: $tw-spc-base-medium;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.nav-footer {
|
|
152
|
+
margin-top: auto;
|
|
153
|
+
margin-bottom: 32px;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 = Note;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _material = require("@mui/material");
|
|
10
|
+
function Note(_ref) {
|
|
11
|
+
let {
|
|
12
|
+
children
|
|
13
|
+
} = _ref;
|
|
14
|
+
const theme = (0, _material.useTheme)();
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
16
|
+
sx: {
|
|
17
|
+
borderRadius: 8,
|
|
18
|
+
backgroundColor: theme.palette.neutral[200],
|
|
19
|
+
marginBottom: theme.spacing(3),
|
|
20
|
+
padding: theme.spacing(2)
|
|
21
|
+
}
|
|
22
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
23
|
+
component: "p"
|
|
24
|
+
}, children));
|
|
25
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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 = PageForm;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _material = require("@mui/material");
|
|
11
|
+
var _useDeviceInfo = _interopRequireDefault(require("../../utils/useDeviceInfo"));
|
|
12
|
+
var _BusySpinner = _interopRequireDefault(require("../BusySpinner"));
|
|
13
|
+
var _FormBottomBar = _interopRequireDefault(require("../FormBottomBar"));
|
|
14
|
+
function PageForm(props) {
|
|
15
|
+
const {
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
hideEdit,
|
|
19
|
+
onSave,
|
|
20
|
+
style,
|
|
21
|
+
...bottomBarProps
|
|
22
|
+
} = props;
|
|
23
|
+
const theme = (0, _material.useTheme)();
|
|
24
|
+
const {
|
|
25
|
+
isMobile
|
|
26
|
+
} = (0, _useDeviceInfo.default)();
|
|
27
|
+
const [processing, setProcessing] = (0, _react.useState)(false);
|
|
28
|
+
const handleSave = async () => {
|
|
29
|
+
setProcessing(true);
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/await-thenable
|
|
31
|
+
await onSave(); // <-- we want all onSaves to be async
|
|
32
|
+
setProcessing(false);
|
|
33
|
+
};
|
|
34
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, processing && /*#__PURE__*/_react.default.createElement(_BusySpinner.default, {
|
|
35
|
+
withSkrim: true
|
|
36
|
+
}), /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
37
|
+
className: className,
|
|
38
|
+
paddingBottom: hideEdit ? theme.spacing(4) : theme.spacing(isMobile ? 25 : 15),
|
|
39
|
+
style: style
|
|
40
|
+
}, children), !hideEdit && /*#__PURE__*/_react.default.createElement(_FormBottomBar.default, Object.assign({
|
|
41
|
+
onSave: handleSave
|
|
42
|
+
}, bottomBarProps)));
|
|
43
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
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 = PhotoChooser;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _material = require("@mui/material");
|
|
11
|
+
var _utils = require("../../utils");
|
|
12
|
+
var _Button = _interopRequireDefault(require("../Button/Button"));
|
|
13
|
+
var _ErrorBox = _interopRequireDefault(require("../ErrorBox/ErrorBox"));
|
|
14
|
+
var _FileChooser = _interopRequireDefault(require("../FileChooser"));
|
|
15
|
+
function PhotoChooser(props) {
|
|
16
|
+
const {
|
|
17
|
+
title,
|
|
18
|
+
description,
|
|
19
|
+
onPhotosChanged,
|
|
20
|
+
multipleSelection,
|
|
21
|
+
error,
|
|
22
|
+
selectedFile,
|
|
23
|
+
uploadText,
|
|
24
|
+
uploadMobileDescription,
|
|
25
|
+
uploadDescription,
|
|
26
|
+
photoSelectedText,
|
|
27
|
+
chooseFileText,
|
|
28
|
+
replaceFileText,
|
|
29
|
+
maxPhotos
|
|
30
|
+
} = props;
|
|
31
|
+
const {
|
|
32
|
+
isMobile
|
|
33
|
+
} = (0, _utils.useDeviceInfo)();
|
|
34
|
+
const [files, setFiles] = (0, _react.useState)([]);
|
|
35
|
+
const [filesData, setFilesData] = (0, _react.useState)([]);
|
|
36
|
+
const divRef = (0, _react.useRef)(null);
|
|
37
|
+
const theme = (0, _material.useTheme)();
|
|
38
|
+
const removeFileAtIndex = index => {
|
|
39
|
+
const filesList = [...files];
|
|
40
|
+
filesList.splice(index, 1);
|
|
41
|
+
setFiles(filesList);
|
|
42
|
+
};
|
|
43
|
+
const onChoosingFiles = () => {
|
|
44
|
+
var _divRef$current;
|
|
45
|
+
(_divRef$current = divRef.current) === null || _divRef$current === void 0 ? void 0 : _divRef$current.focus();
|
|
46
|
+
};
|
|
47
|
+
(0, _react.useEffect)(() => {
|
|
48
|
+
const filesDataList = files.map(file => URL.createObjectURL(file));
|
|
49
|
+
setFilesData(filesDataList);
|
|
50
|
+
onPhotosChanged(files);
|
|
51
|
+
return () => {
|
|
52
|
+
// we need to clean this up to avoid a memory leak
|
|
53
|
+
filesDataList.forEach(fileData => URL.revokeObjectURL(fileData));
|
|
54
|
+
};
|
|
55
|
+
}, [files]);
|
|
56
|
+
return /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
57
|
+
ref: divRef,
|
|
58
|
+
tabIndex: 0,
|
|
59
|
+
sx: {
|
|
60
|
+
backgroundColor: theme.palette.TwClrBg,
|
|
61
|
+
borderRadius: theme.spacing(4),
|
|
62
|
+
padding: theme.spacing(3)
|
|
63
|
+
}
|
|
64
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Box, null, title && /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
65
|
+
fontSize: 20,
|
|
66
|
+
fontWeight: 600
|
|
67
|
+
}, title), description && /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
68
|
+
fontSize: 14,
|
|
69
|
+
fontWeight: 400,
|
|
70
|
+
marginTop: theme.spacing(1),
|
|
71
|
+
marginBottom: theme.spacing(2)
|
|
72
|
+
}, Array.isArray(description) ? description.map((txt, i) => /*#__PURE__*/_react.default.createElement("div", {
|
|
73
|
+
key: i
|
|
74
|
+
}, txt)) : description), error && /*#__PURE__*/_react.default.createElement(_ErrorBox.default, {
|
|
75
|
+
title: error.title,
|
|
76
|
+
text: error.text,
|
|
77
|
+
sx: {
|
|
78
|
+
width: 'auto',
|
|
79
|
+
marginBottom: theme.spacing(2),
|
|
80
|
+
'&.mobile': {
|
|
81
|
+
width: 'auto'
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}), filesData.length > 0 && multipleSelection && /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
85
|
+
display: "flex",
|
|
86
|
+
flexDirection: "row",
|
|
87
|
+
flexWrap: "wrap",
|
|
88
|
+
marginBottom: theme.spacing(2)
|
|
89
|
+
}, filesData.map((fileData, index) => {
|
|
90
|
+
var _files$index;
|
|
91
|
+
return /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
92
|
+
key: index,
|
|
93
|
+
position: "relative",
|
|
94
|
+
height: 122,
|
|
95
|
+
width: 122,
|
|
96
|
+
marginRight: isMobile ? theme.spacing(2) : theme.spacing(3),
|
|
97
|
+
marginTop: theme.spacing(1),
|
|
98
|
+
border: "1px solid ".concat(theme.palette.TwClrBrdrTertiary)
|
|
99
|
+
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
100
|
+
icon: "iconTrashCan",
|
|
101
|
+
onClick: () => removeFileAtIndex(index),
|
|
102
|
+
size: "small",
|
|
103
|
+
style: {
|
|
104
|
+
position: 'absolute',
|
|
105
|
+
top: -10,
|
|
106
|
+
right: -10,
|
|
107
|
+
backgroundColor: theme.palette.TwClrBgDanger
|
|
108
|
+
}
|
|
109
|
+
}), /*#__PURE__*/_react.default.createElement("img", {
|
|
110
|
+
height: "120px",
|
|
111
|
+
src: fileData,
|
|
112
|
+
alt: (_files$index = files[index]) === null || _files$index === void 0 ? void 0 : _files$index.name,
|
|
113
|
+
style: {
|
|
114
|
+
margin: 'auto auto',
|
|
115
|
+
objectFit: 'contain',
|
|
116
|
+
display: 'flex',
|
|
117
|
+
maxWidth: '120px',
|
|
118
|
+
maxHeight: '120px'
|
|
119
|
+
}
|
|
120
|
+
}));
|
|
121
|
+
}))), /*#__PURE__*/_react.default.createElement(_FileChooser.default, {
|
|
122
|
+
acceptFileType: "image/jpeg,image/png",
|
|
123
|
+
chooseFileText: chooseFileText,
|
|
124
|
+
files: files,
|
|
125
|
+
fileSelectedText: photoSelectedText,
|
|
126
|
+
iconName: "blobbyGrayIconImage",
|
|
127
|
+
maxFiles: maxPhotos,
|
|
128
|
+
multipleSelection: multipleSelection,
|
|
129
|
+
onChoosingFiles: onChoosingFiles,
|
|
130
|
+
replaceFileText: replaceFileText,
|
|
131
|
+
selectedFile: selectedFile,
|
|
132
|
+
setFiles: setFiles,
|
|
133
|
+
uploadDescription: uploadDescription,
|
|
134
|
+
uploadMobileDescription: uploadMobileDescription,
|
|
135
|
+
uploadText: uploadText
|
|
136
|
+
}));
|
|
137
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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 = Pill;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _material = require("@mui/material");
|
|
10
|
+
var _Icon = _interopRequireDefault(require("../Icon/Icon"));
|
|
11
|
+
require("./styles.scss");
|
|
12
|
+
function Pill(props) {
|
|
13
|
+
const {
|
|
14
|
+
id,
|
|
15
|
+
label,
|
|
16
|
+
value,
|
|
17
|
+
onClick,
|
|
18
|
+
onRemove,
|
|
19
|
+
className
|
|
20
|
+
} = props;
|
|
21
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
22
|
+
className: "pill ".concat(className !== null && className !== void 0 ? className : ''),
|
|
23
|
+
onClick: ev => {
|
|
24
|
+
ev.stopPropagation();
|
|
25
|
+
if (onClick) {
|
|
26
|
+
onClick(id);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}, label && /*#__PURE__*/_react.default.createElement("p", {
|
|
30
|
+
className: "label"
|
|
31
|
+
}, label, ":"), /*#__PURE__*/_react.default.createElement("p", {
|
|
32
|
+
className: "value".concat(label ? '' : ' value--no-label')
|
|
33
|
+
}, value), onRemove ? /*#__PURE__*/_react.default.createElement(_material.IconButton, {
|
|
34
|
+
onClick: ev => {
|
|
35
|
+
ev.stopPropagation();
|
|
36
|
+
onRemove(id);
|
|
37
|
+
},
|
|
38
|
+
className: "iconContainer",
|
|
39
|
+
"aria-label": "remove"
|
|
40
|
+
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
41
|
+
name: "close",
|
|
42
|
+
className: "icon"
|
|
43
|
+
})) : /*#__PURE__*/_react.default.createElement("div", {
|
|
44
|
+
className: "spacer"
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
@import '../../style-dictionary-dist/terraware.scss';
|
|
2
|
+
|
|
3
|
+
@font-face {
|
|
4
|
+
font-family: 'Inter';
|
|
5
|
+
src: local('Inter'), url(../../fonts/Inter.ttf) format('truetype');
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.pill {
|
|
9
|
+
font-family: $tw-fnt-base-font-family;
|
|
10
|
+
background: $tw-clr-bg-tertiary;
|
|
11
|
+
padding: $tw-spc-base-xx-small $tw-spc-base-xx-small $tw-spc-base-xx-small 12px;
|
|
12
|
+
display: flex;
|
|
13
|
+
border-radius: 13px;
|
|
14
|
+
align-items: center;
|
|
15
|
+
|
|
16
|
+
.label {
|
|
17
|
+
font-size: 12px;
|
|
18
|
+
color: $tw-clr-txt;
|
|
19
|
+
font-weight: 400;
|
|
20
|
+
margin: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.value {
|
|
24
|
+
padding-left: $tw-spc-base-xx-small;
|
|
25
|
+
font-size: 12px;
|
|
26
|
+
color: $tw-clr-txt;
|
|
27
|
+
font-weight: 600;
|
|
28
|
+
margin: 0;
|
|
29
|
+
|
|
30
|
+
&--no-label {
|
|
31
|
+
padding-left: 0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.icon {
|
|
36
|
+
fill: $tw-clr-icn;
|
|
37
|
+
width: 12px;
|
|
38
|
+
height: 12px;
|
|
39
|
+
margin: 0 $tw-spc-base-xx-small;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.iconContainer {
|
|
43
|
+
padding: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.spacer {
|
|
47
|
+
width: $tw-spc-base-x-small;
|
|
48
|
+
height: 12px;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +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 = PillList;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _Pill = _interopRequireDefault(require("../Pill"));
|
|
10
|
+
require("./styles.scss");
|
|
11
|
+
function PillList(props) {
|
|
12
|
+
const {
|
|
13
|
+
data,
|
|
14
|
+
onClick,
|
|
15
|
+
onRemove,
|
|
16
|
+
className
|
|
17
|
+
} = props;
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
19
|
+
className: "pill-list"
|
|
20
|
+
}, data.map((item, index) => /*#__PURE__*/_react.default.createElement(_Pill.default, {
|
|
21
|
+
key: index,
|
|
22
|
+
id: item.id,
|
|
23
|
+
label: item.label,
|
|
24
|
+
value: item.value,
|
|
25
|
+
onClick: item.onClick || onClick,
|
|
26
|
+
onRemove: item.onRemove || onRemove,
|
|
27
|
+
className: item.className || className
|
|
28
|
+
})));
|
|
29
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@import '../../style-dictionary-dist/terraware.scss';
|
|
2
|
+
|
|
3
|
+
@font-face {
|
|
4
|
+
font-family: 'Inter';
|
|
5
|
+
src: local('Inter'), url(../../fonts/Inter.ttf) format('truetype');
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.pill-list {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-wrap: wrap;
|
|
11
|
+
gap: $tw-spc-base-x-small;
|
|
12
|
+
}
|