UNPKG

@trap_stevo/legendarybuilderproreact-ui

Version:

The legendary UI & utility API that makes your application a legendary application. ~ Created by Steven Compton

61 lines 3.73 kB
import _defineProperty from "@babel/runtime/helpers/defineProperty"; import _slicedToArray from "@babel/runtime/helpers/slicedToArray"; import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties"; var _excluded = ["containerTitleConfigurationSettings", "containerConfigurationSettings", "titleTyperSpeed", "titleTyperDelay", "containerTitle", "children"]; function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } import * as React from "react"; import { useState } from "react"; import { HUDIcon, HUDTyper } from "@trap_stevo/legendarybuilderproreact-ui"; function HUDContainerView(hudContainerViewConfigurationSettings) { var _hudContainerViewConf = hudContainerViewConfigurationSettings.containerTitleConfigurationSettings, containerTitleConfigurationSettings = _hudContainerViewConf === void 0 ? {} : _hudContainerViewConf, _hudContainerViewConf2 = hudContainerViewConfigurationSettings.containerConfigurationSettings, containerConfigurationSettings = _hudContainerViewConf2 === void 0 ? {} : _hudContainerViewConf2, _hudContainerViewConf3 = hudContainerViewConfigurationSettings.titleTyperSpeed, titleTyperSpeed = _hudContainerViewConf3 === void 0 ? 3.69 : _hudContainerViewConf3, _hudContainerViewConf4 = hudContainerViewConfigurationSettings.titleTyperDelay, titleTyperDelay = _hudContainerViewConf4 === void 0 ? 0 : _hudContainerViewConf4, _hudContainerViewConf5 = hudContainerViewConfigurationSettings.containerTitle, containerTitle = _hudContainerViewConf5 === void 0 ? "" : _hudContainerViewConf5, children = hudContainerViewConfigurationSettings.children, rest = _objectWithoutProperties(hudContainerViewConfigurationSettings, _excluded); var _useState = useState(false), _useState2 = _slicedToArray(_useState, 2), containerOpen = _useState2[0], setContainerOpen = _useState2[1]; return /*#__PURE__*/React.createElement("div", { style: _objectSpread({ position: "relative", border: "none", marginBottom: "3rem", marginTop: "1rem" }, containerConfigurationSettings) }, /*#__PURE__*/React.createElement("div", { className: "frame-36", style: { transition: "height 0.269s ease-in", height: "auto" } }, /*#__PURE__*/React.createElement("div", { className: "frame-26" }, /*#__PURE__*/React.createElement("div", { className: "text-wrapper-27", style: _objectSpread({ userSelect: "none" }, containerTitleConfigurationSettings) }, /*#__PURE__*/React.createElement(HUDTyper, { speed: titleTyperSpeed, delay: titleTyperDelay }, containerTitle)), /*#__PURE__*/React.createElement(HUDIcon, { iconConfigurationSettings: { cursor: "pointer" }, name: containerOpen ? "fa-chevron-left" : "fa-chevron-down", color: "black", onClick: function onClick() { return setContainerOpen(!containerOpen); } })), containerOpen ? /*#__PURE__*/React.createElement(React.Fragment, null, children) : /*#__PURE__*/React.createElement(React.Fragment, null))); } export default HUDContainerView;