@rudra-studio/rudra-layout 1.0.22 → 1.0.24
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 { default as React } from 'react';
|
|
2
|
-
export interface BoxProps
|
|
2
|
+
export interface BoxProps {
|
|
3
3
|
children?: React.ReactNode;
|
|
4
4
|
/**
|
|
5
5
|
* The Custom Attributes Dictionary
|
|
@@ -10,6 +10,17 @@ export interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
10
10
|
customAttributes?: Record<string, string>;
|
|
11
11
|
/** * @type|class
|
|
12
12
|
* @schema [{
|
|
13
|
+
* "key": "Display",
|
|
14
|
+
* "type": "select",
|
|
15
|
+
* "options": [
|
|
16
|
+
* {"key": "flex", "label": "Flex"},
|
|
17
|
+
* {"key": "block", "label": "Block"},
|
|
18
|
+
* {"key": "grid", "label": "Grid"},
|
|
19
|
+
* {"key": "inline-flex", "label": "Inline Flex"},
|
|
20
|
+
* {"key": "inline-block", "label": "Inline Block"},
|
|
21
|
+
* {"key": "hidden", "label": "Hidden"}
|
|
22
|
+
* ]
|
|
23
|
+
* },{
|
|
13
24
|
* "key": "Direction",
|
|
14
25
|
* "prefix": "flex",
|
|
15
26
|
* "type": "select",
|
|
@@ -59,6 +70,8 @@ export interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
59
70
|
* }]
|
|
60
71
|
*/
|
|
61
72
|
className?: string;
|
|
73
|
+
style?: React.CSSProperties;
|
|
74
|
+
onClick?: (e: any) => void;
|
|
62
75
|
}
|
|
63
76
|
export declare const Box: React.FC<BoxProps>;
|
|
64
77
|
export default Box;
|
package/components/Box/index.js
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
import "react";
|
|
2
2
|
import { jsx as e } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/Box/index.tsx
|
|
4
|
-
var t = ({ children: t, customAttributes: n = {}, className: r = "",
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
var t = ({ children: t, customAttributes: n = {}, className: r = "", style: i, onClick: a, ...o }) => {
|
|
5
|
+
let s = [
|
|
6
|
+
"flex",
|
|
7
|
+
"block",
|
|
8
|
+
"grid",
|
|
9
|
+
"inline-flex",
|
|
10
|
+
"inline-block",
|
|
11
|
+
"hidden"
|
|
12
|
+
];
|
|
13
|
+
return /* @__PURE__ */ e("div", {
|
|
14
|
+
className: r.split(" ").some((e) => s.includes(e)) ? r : `flex ${r}`.trim(),
|
|
15
|
+
style: i,
|
|
16
|
+
onClick: a,
|
|
17
|
+
...n,
|
|
18
|
+
...o,
|
|
19
|
+
children: t
|
|
20
|
+
});
|
|
21
|
+
};
|
|
10
22
|
//#endregion
|
|
11
23
|
export { t as default };
|
|
@@ -107,5 +107,12 @@ export interface SectionProps extends Omit<React.HTMLAttributes<HTMLElement>, "c
|
|
|
107
107
|
* ]
|
|
108
108
|
*/
|
|
109
109
|
className?: string;
|
|
110
|
+
/**
|
|
111
|
+
* The Custom Attributes Dictionary
|
|
112
|
+
* We use additionalProperties to tell the schema it's a dynamic key-value object
|
|
113
|
+
* @type|complex
|
|
114
|
+
* @schema {"type":"object"}
|
|
115
|
+
*/
|
|
116
|
+
customAttributes?: Record<string, string>;
|
|
110
117
|
}
|
|
111
|
-
export default function Section({ children, as, className, ...props }: SectionProps): import("react/jsx-runtime").JSX.Element;
|
|
118
|
+
export default function Section({ children, as, className, customAttributes, ...props }: SectionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import "react";
|
|
2
2
|
import { jsx as e } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/Section/index.tsx
|
|
4
|
-
function t({ children: t, as: n = "section", className: r = "",
|
|
4
|
+
function t({ children: t, as: n = "section", className: r = "", customAttributes: i = {}, ...a }) {
|
|
5
5
|
return /* @__PURE__ */ e(n, {
|
|
6
|
+
...a,
|
|
6
7
|
...i,
|
|
7
8
|
className: ["w-full", r].filter(Boolean).join(" "),
|
|
8
9
|
children: t
|
package/package.json
CHANGED