labsense-ui-kit 1.0.15 → 1.0.16

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.
@@ -1,19 +1,9 @@
1
1
  import React from 'react';
2
- interface IconProps {
3
- size?: number;
4
- weight?: string;
5
- color?: string;
6
- }
7
2
  interface UseModalProps {
8
3
  maxWidth?: string;
9
- iconProps?: IconProps;
10
- icon?: boolean;
11
4
  }
12
- declare const useCustomModal: ({ maxWidth, iconProps, icon }: UseModalProps) => {
13
- isOpen: boolean;
5
+ declare const useCustomModal: ({ maxWidth }: UseModalProps) => {
14
6
  setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
15
- openModal: (content: React.ReactNode) => void;
16
- closeModal: () => void;
17
- createModal: () => React.JSX.Element;
7
+ createModal: (content: React.ReactNode) => React.JSX.Element;
18
8
  };
19
9
  export default useCustomModal;
package/dist/index.js CHANGED
@@ -2509,13 +2509,12 @@ var useClickOutside = function useClickOutside(elRef, elCallback) {
2509
2509
  }, [elCallback, elRef]);
2510
2510
  };
2511
2511
 
2512
- var _templateObject$5, _templateObject2$4, _templateObject3$3;
2513
- var ModalOverlay = styled__default.div(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteralLoose(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n font-family: Noto Sans, sans-serif;\n z-index: 9999;\n"])));
2514
- var ModalContainer = styled__default.div(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteralLoose(["\n background: ", ";\n box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n max-width: ", ";\n position: relative;\n"])), colorVariables.accent.light, function (_ref) {
2512
+ var _templateObject$5, _templateObject2$4;
2513
+ var ModalOverlay = styled__default.div(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteralLoose(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n font-family: Noto Sans, sans-serif;\n z-index: 9999;\n backdrop-filter: blur(4px);\n"])));
2514
+ var ModalContainer = styled__default.div(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteralLoose(["\n background: ", ";\n box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n max-width: ", ";\n"])), colorVariables.accent.light, function (_ref) {
2515
2515
  var maxWidth = _ref.maxWidth;
2516
- return maxWidth ? maxWidth : '500px';
2516
+ return maxWidth ? maxWidth : '400px';
2517
2517
  });
2518
- var IconWrapper$1 = styled__default.div(_templateObject3$3 || (_templateObject3$3 = _taggedTemplateLiteralLoose(["\n position: absolute;\n right: 12px;\n top: 12px;\n"])));
2519
2518
  var Modal = function Modal(_ref2) {
2520
2519
  var isOpen = _ref2.isOpen,
2521
2520
  maxWidth = _ref2.maxWidth,
@@ -2529,40 +2528,18 @@ var Modal = function Modal(_ref2) {
2529
2528
  }, children));
2530
2529
  };
2531
2530
  var useCustomModal = function useCustomModal(_ref3) {
2532
- var maxWidth = _ref3.maxWidth,
2533
- iconProps = _ref3.iconProps,
2534
- icon = _ref3.icon;
2531
+ var maxWidth = _ref3.maxWidth;
2535
2532
  var _useState = React.useState(false),
2536
2533
  isOpen = _useState[0],
2537
2534
  setIsOpen = _useState[1];
2538
- var _useState2 = React.useState(null),
2539
- modalContent = _useState2[0],
2540
- setModalContent = _useState2[1];
2541
- var openModal = function openModal(content) {
2542
- setModalContent(content);
2543
- setIsOpen(true);
2544
- };
2545
- var closeModal = function closeModal() {
2546
- setIsOpen(false);
2547
- setModalContent(null);
2548
- };
2549
- var createModal = function createModal() {
2535
+ var createModal = function createModal(content) {
2550
2536
  return React__default.createElement(Modal, {
2551
2537
  isOpen: isOpen,
2552
2538
  maxWidth: maxWidth
2553
- }, icon && React__default.createElement(IconWrapper$1, null, React__default.createElement(Icon, {
2554
- icon: "CloseCircle",
2555
- size: (iconProps === null || iconProps === void 0 ? void 0 : iconProps.size) || 18,
2556
- weight: (iconProps === null || iconProps === void 0 ? void 0 : iconProps.weight) || '5px',
2557
- color: (iconProps === null || iconProps === void 0 ? void 0 : iconProps.color) || colorVariables.text.medium,
2558
- onClick: closeModal
2559
- })), modalContent);
2539
+ }, content);
2560
2540
  };
2561
2541
  return {
2562
- isOpen: isOpen,
2563
2542
  setIsOpen: setIsOpen,
2564
- openModal: openModal,
2565
- closeModal: closeModal,
2566
2543
  createModal: createModal
2567
2544
  };
2568
2545
  };