ar-design 0.0.9 → 0.0.10
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.
|
@@ -2,7 +2,7 @@ import React, { useEffect, useRef, useState } from "react";
|
|
|
2
2
|
import "../../libs/styles/syntax-highlighter/syntax-highlighter.css";
|
|
3
3
|
import Parser from "./classes/Parser";
|
|
4
4
|
import Compiler from "./classes/Compiler";
|
|
5
|
-
const SyntaxHighlighter = ({ children }) => {
|
|
5
|
+
const SyntaxHighlighter = ({ children, position = "center" }) => {
|
|
6
6
|
// refs
|
|
7
7
|
const _div = useRef(null);
|
|
8
8
|
const _code = useRef(null);
|
|
@@ -30,7 +30,7 @@ const SyntaxHighlighter = ({ children }) => {
|
|
|
30
30
|
}, [elements]);
|
|
31
31
|
return (React.createElement(React.Fragment, null,
|
|
32
32
|
React.createElement("div", { className: "ar-syntax" },
|
|
33
|
-
React.createElement("div", { ref: _div, className:
|
|
33
|
+
React.createElement("div", { ref: _div, className: `preview ${position}` }, children),
|
|
34
34
|
React.createElement("pre", { className: "pre" },
|
|
35
35
|
React.createElement("code", { ref: _code })))));
|
|
36
36
|
};
|
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
.ar-syntax {
|
|
2
|
+
border: solid 1px var(--gray-200);
|
|
2
3
|
border-radius: var(--border-radius-lg);
|
|
3
|
-
box-shadow:
|
|
4
|
+
box-shadow: 0px 0px 20px -10px rgba(var(--black-rgb), 0.25);
|
|
4
5
|
overflow: hidden;
|
|
5
6
|
}
|
|
6
7
|
.ar-syntax > .preview {
|
|
8
|
+
display: flex;
|
|
9
|
+
gap: 1rem;
|
|
7
10
|
background-color: var(--white);
|
|
8
11
|
padding: 1rem;
|
|
9
12
|
}
|
|
13
|
+
.ar-syntax > .preview.left {
|
|
14
|
+
justify-content: left;
|
|
15
|
+
}
|
|
16
|
+
.ar-syntax > .preview.center {
|
|
17
|
+
justify-content: center;
|
|
18
|
+
}
|
|
19
|
+
.ar-syntax > .preview.right {
|
|
20
|
+
justify-content: right;
|
|
21
|
+
}
|
|
22
|
+
|
|
10
23
|
.ar-syntax > .pre {
|
|
11
24
|
background-color: var(--bg-color);
|
|
12
25
|
margin: 0;
|