ar-design 0.2.91 → 0.2.92

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,5 +1,5 @@
1
1
  import { IChildren, ISize } from "../../../libs/types/IGlobalProps";
2
- interface IProps extends IChildren, ISize {
2
+ interface IProps extends IChildren, ISize, React.HTMLAttributes<HTMLDivElement> {
3
3
  /**
4
4
  * Modal'ın açık olup olmadığını kontrol eden ve değiştiren değerler.
5
5
  *
@@ -3,7 +3,7 @@ import React, { useEffect, useRef } from "react";
3
3
  import "../../../assets/css/components/feedback/modal/styles.css";
4
4
  import Typography from "../../data-display/typography";
5
5
  const { Title } = Typography;
6
- const Modal = ({ children, open, title, size = "normal", footer }) => {
6
+ const Modal = ({ children, open, title, size = "normal", footer, ...attributes }) => {
7
7
  // refs
8
8
  const _arModal = useRef(null);
9
9
  const _modalWrapperClassName = ["ar-modal-wrapper"];
@@ -64,6 +64,10 @@ const Modal = ({ children, open, title, size = "normal", footer }) => {
64
64
  window.removeEventListener("resize", handlePosition);
65
65
  };
66
66
  }, [open.get]);
67
+ useEffect(() => {
68
+ if (attributes.className)
69
+ _modalClassName.push(attributes.className);
70
+ }, [attributes.className]);
67
71
  return (React.createElement("div", { className: _modalWrapperClassName.map((c) => c).join(" ") },
68
72
  React.createElement("div", { className: "ar-modal-bg", onMouseDown: (event) => {
69
73
  event.stopPropagation();
@@ -71,7 +75,7 @@ const Modal = ({ children, open, title, size = "normal", footer }) => {
71
75
  if (_arModal.current && !_arModal.current.contains(target))
72
76
  open.set(false);
73
77
  } }),
74
- React.createElement("div", { ref: _arModal, className: _modalClassName.map((c) => c).join(" "), role: "dialog" },
78
+ React.createElement("div", { ref: _arModal, ...attributes, className: _modalClassName.map((c) => c).join(" "), role: "dialog" },
75
79
  title && (React.createElement("div", { className: "header" },
76
80
  React.createElement(Title, { Level: "h3" }, title),
77
81
  React.createElement("div", { className: "close", onClick: () => open.set((prev) => !prev) }))),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ar-design",
3
- "version": "0.2.91",
3
+ "version": "0.2.92",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",