@trops/dash-react 1.0.11 → 1.0.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/dist/index.js CHANGED
@@ -6676,28 +6676,47 @@ var SettingsModalFooter = function SettingsModalFooter(_ref4) {
6676
6676
  })]
6677
6677
  });
6678
6678
  };
6679
- var SettingsModal = function SettingsModal(_ref5) {
6680
- var isOpen = _ref5.isOpen,
6681
- setIsOpen = _ref5.setIsOpen,
6682
- _ref5$width = _ref5.width,
6683
- width = _ref5$width === void 0 ? "w-11/12 xl:w-5/6" : _ref5$width,
6684
- _ref5$height = _ref5.height,
6685
- height = _ref5$height === void 0 ? "h-5/6" : _ref5$height,
6686
- children = _ref5.children,
6679
+ var SettingsModalTitle = function SettingsModalTitle(_ref5) {
6680
+ var children = _ref5.children,
6687
6681
  _ref5$className = _ref5.className,
6688
- className = _ref5$className === void 0 ? "" : _ref5$className;
6682
+ className = _ref5$className === void 0 ? "" : _ref5$className,
6683
+ _ref5$padding = _ref5.padding,
6684
+ padding = _ref5$padding === void 0 ? "px-4 py-3" : _ref5$padding;
6689
6685
  var _useContext4 = useContext(ThemeContext),
6690
6686
  currentTheme = _useContext4.currentTheme;
6687
+ var styles = getStylesForItem(themeObjects.PANEL_HEADER, currentTheme, {
6688
+ grow: false
6689
+ });
6690
+ return /*#__PURE__*/jsx("div", {
6691
+ className: "flex flex-row items-center flex-shrink-0 border-b ".concat(padding, " ").concat(styles.borderColor || "", " ").concat(styles.textColor || "", " ").concat(className),
6692
+ children: children
6693
+ });
6694
+ };
6695
+ var SettingsModal = function SettingsModal(_ref6) {
6696
+ var isOpen = _ref6.isOpen,
6697
+ setIsOpen = _ref6.setIsOpen,
6698
+ _ref6$width = _ref6.width,
6699
+ width = _ref6$width === void 0 ? "w-11/12 xl:w-5/6" : _ref6$width,
6700
+ _ref6$height = _ref6.height,
6701
+ height = _ref6$height === void 0 ? "h-5/6" : _ref6$height,
6702
+ children = _ref6.children,
6703
+ _ref6$className = _ref6.className,
6704
+ className = _ref6$className === void 0 ? "" : _ref6$className;
6705
+ var _useContext5 = useContext(ThemeContext),
6706
+ currentTheme = _useContext5.currentTheme;
6691
6707
  var panelStyles = getStylesForItem(themeObjects.PANEL, currentTheme, {
6692
6708
  scrollable: false,
6693
6709
  grow: false
6694
6710
  });
6695
6711
 
6696
- // Separate sidebar from other children
6712
+ // Separate title, sidebar, and other children
6713
+ var title = null;
6697
6714
  var sidebar = null;
6698
6715
  var otherChildren = [];
6699
6716
  Children.forEach(children, function (child) {
6700
- if (child && child.type === SettingsModalSidebar) {
6717
+ if (child && child.type === SettingsModalTitle) {
6718
+ title = child;
6719
+ } else if (child && child.type === SettingsModalSidebar) {
6701
6720
  sidebar = child;
6702
6721
  } else {
6703
6722
  otherChildren.push(child);
@@ -6709,14 +6728,18 @@ var SettingsModal = function SettingsModal(_ref5) {
6709
6728
  width: width,
6710
6729
  height: height,
6711
6730
  children: /*#__PURE__*/jsxs("div", {
6712
- className: "flex flex-row h-full w-full rounded-lg overflow-clip ".concat(panelStyles.backgroundColor || "", " ").concat(panelStyles.borderColor || "", " ").concat(panelStyles.textColor || "", " border ").concat(className),
6713
- children: [sidebar, /*#__PURE__*/jsx("div", {
6714
- className: "flex flex-col flex-1 min-w-0",
6715
- children: otherChildren
6731
+ className: "flex flex-col h-full w-full rounded-lg overflow-clip ".concat(panelStyles.backgroundColor || "", " ").concat(panelStyles.borderColor || "", " ").concat(panelStyles.textColor || "", " border ").concat(className),
6732
+ children: [title, /*#__PURE__*/jsxs("div", {
6733
+ className: "flex flex-row flex-1 min-h-0",
6734
+ children: [sidebar, /*#__PURE__*/jsx("div", {
6735
+ className: "flex flex-col flex-1 min-w-0",
6736
+ children: otherChildren
6737
+ })]
6716
6738
  })]
6717
6739
  })
6718
6740
  });
6719
6741
  };
6742
+ SettingsModal.Title = SettingsModalTitle;
6720
6743
  SettingsModal.Sidebar = SettingsModalSidebar;
6721
6744
  SettingsModal.Header = SettingsModalHeader;
6722
6745
  SettingsModal.Body = SettingsModalBody;