ar-design 0.1.2 → 0.1.3
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/assest/css/alert/alert.css +63 -0
- package/dist/assest/css/alert/core/border.css +24 -0
- package/dist/assest/css/alert/core/color.css +28 -0
- package/dist/assest/css/ar-core.css +6 -0
- package/dist/assest/css/button/button.css +23 -1
- package/dist/assest/css/button/core/icon.css +2 -0
- package/dist/assest/css/button/core/shape.css +4 -2
- package/dist/assest/css/button/core/size.css +12 -0
- package/dist/assest/css/css/alert/alert.css +63 -0
- package/dist/assest/css/css/alert/core/border.css +24 -0
- package/dist/assest/css/css/alert/core/color.css +28 -0
- package/dist/assest/css/css/ar-core.css +6 -0
- package/dist/assest/css/css/button/button.css +23 -1
- package/dist/assest/css/css/button/core/icon.css +2 -0
- package/dist/assest/css/css/button/core/shape.css +4 -2
- package/dist/assest/css/css/button/core/size.css +12 -0
- package/dist/assest/css/css/divider/divider.css +5 -1
- package/dist/assest/css/css/layout/header.css +18 -0
- package/dist/assest/css/css/layout/layout.css +27 -0
- package/dist/assest/css/css/menu/core/open-or-close.css +5 -0
- package/dist/assest/css/css/menu/core/selected.css +3 -4
- package/dist/assest/css/css/menu/menu.css +57 -1
- package/dist/assest/css/css/syntax-highlighter/syntax-highlighter.css +57 -1
- package/dist/assest/css/css/typography/paragraph/core.css +1 -0
- package/dist/assest/css/css/typography/title/core.css +1 -0
- package/dist/assest/css/divider/divider.css +5 -1
- package/dist/assest/css/layout/header.css +18 -0
- package/dist/assest/css/layout/layout.css +27 -0
- package/dist/assest/css/menu/core/open-or-close.css +5 -0
- package/dist/assest/css/menu/core/selected.css +3 -4
- package/dist/assest/css/menu/menu.css +57 -1
- package/dist/assest/css/syntax-highlighter/syntax-highlighter.css +57 -1
- package/dist/assest/css/typography/paragraph/core.css +1 -0
- package/dist/assest/css/typography/title/core.css +1 -0
- package/dist/components/alert/Types.d.ts +9 -0
- package/dist/components/alert/Types.js +1 -0
- package/dist/components/alert/index.d.ts +5 -0
- package/dist/components/alert/index.js +60 -0
- package/dist/components/button/Types.d.ts +2 -1
- package/dist/components/button/index.js +4 -2
- package/dist/components/grid-system/column/Column.js +2 -0
- package/dist/components/layout/Aside.d.ts +4 -0
- package/dist/components/layout/Aside.js +11 -0
- package/dist/components/layout/Footer.d.ts +3 -0
- package/dist/components/layout/Footer.js +7 -0
- package/dist/components/layout/Header.d.ts +4 -0
- package/dist/components/layout/Header.js +10 -0
- package/dist/components/layout/Main.d.ts +4 -0
- package/dist/components/layout/Main.js +3 -0
- package/dist/components/layout/Section.d.ts +4 -0
- package/dist/components/layout/Section.js +3 -0
- package/dist/components/layout/Types.d.ts +17 -0
- package/dist/components/layout/Types.js +1 -0
- package/dist/components/layout/index.d.ts +11 -0
- package/dist/components/layout/index.js +17 -0
- package/dist/components/menu/index.js +4 -1
- package/dist/components/syntax-highlighter/index.js +4 -1
- package/dist/components/typography/paragraph/Paragraph.js +1 -0
- package/dist/components/typography/title/Title.js +1 -0
- package/dist/index.d.ts +4 -6
- package/dist/index.js +4 -6
- package/dist/libs/core/application/contexts/Layout.d.ts +16 -0
- package/dist/libs/core/application/contexts/Layout.js +8 -0
- package/dist/libs/core/application/hooks/useLayout.d.ts +13 -0
- package/dist/libs/core/application/hooks/useLayout.js +4 -0
- package/package.json +1 -1
- package/dist/assest/css/button/core/core.css +0 -17
- package/dist/assest/css/css/button/core/core.css +0 -17
- package/dist/assest/css/css/divider/core/core.css +0 -4
- package/dist/assest/css/css/menu/core/core.css +0 -47
- package/dist/assest/css/css/syntax-highlighter/core/core.css +0 -55
- package/dist/assest/css/divider/core/core.css +0 -4
- package/dist/assest/css/menu/core/core.css +0 -47
- package/dist/assest/css/syntax-highlighter/core/core.css +0 -55
|
@@ -5,8 +5,13 @@
|
|
|
5
5
|
transition: max-height 250ms ease-in-out, opacity 250ms cubic-bezier(1, 0, 0, 1);
|
|
6
6
|
}
|
|
7
7
|
.ar-menu .ar-menu-list-item-groups.opened {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: 0.25rem 0;
|
|
8
11
|
opacity: 1;
|
|
9
12
|
max-height: 100rem;
|
|
13
|
+
padding-top: 0.2rem;
|
|
14
|
+
padding-bottom: 0.2rem;
|
|
10
15
|
}
|
|
11
16
|
.ar-menu .ar-menu-list-item-group-item-title {
|
|
12
17
|
display: flex;
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
border-bottom-left-radius: var(--border-radius-lg);
|
|
12
12
|
}
|
|
13
13
|
.ar-menu .ar-menu-list-item-group-item-title.selected {
|
|
14
|
-
background-color:
|
|
15
|
-
border-
|
|
16
|
-
|
|
17
|
-
color: var(--red);
|
|
14
|
+
background-color: var(--gray-200) !important;
|
|
15
|
+
border-radius: var(--border-radius-lg);
|
|
16
|
+
box-shadow: 0 0 0 1px var(--gray-200);
|
|
18
17
|
}
|
|
@@ -1,2 +1,58 @@
|
|
|
1
|
-
|
|
1
|
+
.ar-menu {
|
|
2
|
+
padding: 0 0.25rem;
|
|
3
|
+
font-family: var(--system-fonts);
|
|
4
|
+
}
|
|
5
|
+
.ar-menu ul {
|
|
6
|
+
margin: 0;
|
|
7
|
+
padding: 0;
|
|
8
|
+
list-style: none;
|
|
9
|
+
}
|
|
10
|
+
.ar-menu ul li:last-child {
|
|
11
|
+
padding-bottom: 0;
|
|
12
|
+
}
|
|
13
|
+
.ar-menu ul li ul {
|
|
14
|
+
margin-left: 0.5rem;
|
|
15
|
+
padding-left: 0.5rem;
|
|
16
|
+
}
|
|
17
|
+
.ar-menu > .ar-menu-list {
|
|
18
|
+
display: flex;
|
|
19
|
+
}
|
|
20
|
+
.ar-menu .ar-menu-list-item-group-item-title {
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
height: 2.5rem;
|
|
24
|
+
user-select: none;
|
|
25
|
+
}
|
|
26
|
+
.ar-menu .ar-menu-list-item-group-item-title a {
|
|
27
|
+
color: var(--black);
|
|
28
|
+
}
|
|
29
|
+
.ar-menu .ar-menu-list-item-group-item-title:not(.group) > * {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
width: 100%;
|
|
33
|
+
height: 100%;
|
|
34
|
+
padding: 0 1rem;
|
|
35
|
+
}
|
|
36
|
+
.ar-menu .ar-menu-list-item-group-item-title:not(.group):hover {
|
|
37
|
+
background-color: var(--gray-200);
|
|
38
|
+
border-radius: var(--border-radius-lg);
|
|
39
|
+
}
|
|
40
|
+
.ar-menu .ar-menu-list-item-group-item-title.selection-item {
|
|
41
|
+
background-color: red;
|
|
42
|
+
}
|
|
43
|
+
.ar-menu .ar-menu-list-item-group-item-title.group {
|
|
44
|
+
display: flex;
|
|
45
|
+
/* margin-left: 1rem; */
|
|
46
|
+
padding-left: 0;
|
|
47
|
+
border-radius: 0;
|
|
48
|
+
border-bottom: solid 1px var(--gray-100);
|
|
49
|
+
color: var(--gray-500);
|
|
50
|
+
font-size: 0.85rem;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Core Css */
|
|
54
|
+
@import url("./core/selected.css");
|
|
55
|
+
@import url("./core/open-or-close.css");
|
|
56
|
+
|
|
57
|
+
/* Variant Css */
|
|
2
58
|
@import url("./variant/vertical.css");
|
|
@@ -1,2 +1,58 @@
|
|
|
1
|
-
|
|
1
|
+
.ar-syntax {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
border: solid 1px var(--gray-200);
|
|
5
|
+
border-radius: var(--border-radius-lg);
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
}
|
|
8
|
+
.ar-syntax > .preview {
|
|
9
|
+
position: relative;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-wrap: wrap;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: 1rem;
|
|
14
|
+
background-color: var(--white);
|
|
15
|
+
padding: 1rem;
|
|
16
|
+
min-height: 7.5rem;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.ar-syntax > .preview.left {
|
|
20
|
+
justify-content: left;
|
|
21
|
+
}
|
|
22
|
+
.ar-syntax > .preview.center {
|
|
23
|
+
justify-content: center;
|
|
24
|
+
}
|
|
25
|
+
.ar-syntax > .preview.right {
|
|
26
|
+
justify-content: right;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.ar-syntax > .ar-syntax-button-group {
|
|
30
|
+
position: relative;
|
|
31
|
+
display: flex;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
align-items: center;
|
|
34
|
+
padding: 0.5rem 0;
|
|
35
|
+
border: dashed 1px transparent;
|
|
36
|
+
border-top-color: var(--gray-300);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ar-syntax > .pre {
|
|
40
|
+
background-color: var(--gray-900);
|
|
41
|
+
margin: 0;
|
|
42
|
+
padding: 1rem;
|
|
43
|
+
overflow-x: auto;
|
|
44
|
+
}
|
|
45
|
+
.ar-syntax > .pre.hidden {
|
|
46
|
+
display: none;
|
|
47
|
+
}
|
|
48
|
+
.ar-syntax > .pre.visible {
|
|
49
|
+
display: block;
|
|
50
|
+
}
|
|
51
|
+
.ar-syntax > .pre > code {
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
gap: 0.5rem 0;
|
|
55
|
+
font-family: var(--jetBrainsMonoRegular) !important;
|
|
56
|
+
}
|
|
57
|
+
|
|
2
58
|
@import url("./core/jsx.template.css");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { useRef } from "react";
|
|
3
|
+
import "../../assest/css/alert/alert.css";
|
|
4
|
+
const Alert = ({ message, type, border = true, emphasize }) => {
|
|
5
|
+
// refs
|
|
6
|
+
let _className = useRef("ar-alert").current;
|
|
7
|
+
// methods
|
|
8
|
+
const className = () => {
|
|
9
|
+
if (type)
|
|
10
|
+
_className += ` ${type}`;
|
|
11
|
+
if (border)
|
|
12
|
+
_className += ` ${type}-border`;
|
|
13
|
+
return _className;
|
|
14
|
+
};
|
|
15
|
+
const formattedTags = (message) => {
|
|
16
|
+
// TODO: Şuan için sadece transparent olan alert tiplerinde çalışmakta.
|
|
17
|
+
// TODO: Bu konu hakkında düşünüp karar verilecek.
|
|
18
|
+
if (!emphasize || type !== "transparent")
|
|
19
|
+
return message;
|
|
20
|
+
let _lowerCaseMessage = message.toLowerCase();
|
|
21
|
+
return emphasize.reduce((currentMessage, emphasize) => {
|
|
22
|
+
// TODO: ...
|
|
23
|
+
// if (['""', " "].includes(emphasize)) return currentMessage;
|
|
24
|
+
let _lowerCaseEmphasize = emphasize.toLowerCase();
|
|
25
|
+
let startIndex = _lowerCaseMessage.indexOf(_lowerCaseEmphasize);
|
|
26
|
+
while (startIndex !== -1) {
|
|
27
|
+
const endIndex = startIndex + emphasize.length;
|
|
28
|
+
const firstValue = currentMessage.substring(0, startIndex);
|
|
29
|
+
const originalTag = currentMessage.substring(startIndex, endIndex);
|
|
30
|
+
const lastValue = currentMessage.substring(endIndex);
|
|
31
|
+
currentMessage = `${firstValue} <span class="ar-alert-tag">${originalTag}</span> ${lastValue}`;
|
|
32
|
+
// Update the lowerCaseMessage to reflect the change
|
|
33
|
+
_lowerCaseMessage = currentMessage.toLowerCase();
|
|
34
|
+
// Find the next occurrence of the tag
|
|
35
|
+
startIndex = _lowerCaseMessage.indexOf(_lowerCaseEmphasize, startIndex + `<span class="ar-alert-tag">${originalTag}</span>`.length);
|
|
36
|
+
}
|
|
37
|
+
return currentMessage;
|
|
38
|
+
}, message);
|
|
39
|
+
};
|
|
40
|
+
const createList = (message, isSubMessage) => {
|
|
41
|
+
let className = "";
|
|
42
|
+
if (isSubMessage)
|
|
43
|
+
className += "subMessage";
|
|
44
|
+
else
|
|
45
|
+
className += "message";
|
|
46
|
+
return (React.createElement("ul", null, Array.isArray(message)
|
|
47
|
+
? message.map((messageItem, index) => (React.createElement("li", { key: index, className: className }, Array.isArray(messageItem) ? (createList(messageItem, true)) : (React.createElement("div", { dangerouslySetInnerHTML: {
|
|
48
|
+
__html: formattedTags(cleanMessage(messageItem)) ?? "",
|
|
49
|
+
} })))))
|
|
50
|
+
: message));
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @param message Yalnızca alfanümerik karakterleri (harfler ve sayılar) ve boşlukları tutar.
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
57
|
+
const cleanMessage = (message) => message.replace(/<\/?[^>]+>/g, "");
|
|
58
|
+
return (React.createElement("div", { className: className() }, Array.isArray(message) ? (createList(message)) : (React.createElement("p", { dangerouslySetInnerHTML: { __html: formattedTags(cleanMessage(message)) ?? "" } }))));
|
|
59
|
+
};
|
|
60
|
+
export default Alert;
|
|
@@ -62,7 +62,7 @@ export type Props = {
|
|
|
62
62
|
* <Button color="success">Hello, World!</Button>
|
|
63
63
|
* ```
|
|
64
64
|
*/
|
|
65
|
-
|
|
65
|
+
_type?: Colors;
|
|
66
66
|
/**
|
|
67
67
|
* Bileşenine ikon eklemeyi sağlar.
|
|
68
68
|
* İkonun kendisini, yönünü ve pozisyonunu tanımlamak için kullanılır.
|
|
@@ -152,6 +152,7 @@ export type Props = {
|
|
|
152
152
|
* ```
|
|
153
153
|
*/
|
|
154
154
|
width?: "max-width" | "auto";
|
|
155
|
+
size?: "large" | "normal" | "small";
|
|
155
156
|
position?: {
|
|
156
157
|
type: "fixed" | "absolute";
|
|
157
158
|
inset: ("top" | "right" | "bottom" | "left")[];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import React, { useRef } from "react";
|
|
3
3
|
import "../../assest/css/button/button.css";
|
|
4
|
-
const Button = ({ children, variant = "filled", shape,
|
|
4
|
+
const Button = ({ children, variant = "filled", shape, _type = "primary", border, width = "auto", size = "normal", position, icon, upperCase, ...attributes }) => {
|
|
5
5
|
// refs
|
|
6
6
|
const _button = useRef(null);
|
|
7
7
|
// methods
|
|
8
8
|
const handleClassName = () => {
|
|
9
|
-
let className = `ar-button ${variant} ${
|
|
9
|
+
let className = `ar-button ${variant} ${_type} ${width}`;
|
|
10
10
|
if (shape)
|
|
11
11
|
className += ` ar-button-shape ${shape}`;
|
|
12
12
|
if (border) {
|
|
@@ -15,6 +15,8 @@ const Button = ({ children, variant = "filled", shape, color = "primary", border
|
|
|
15
15
|
if (border.radius)
|
|
16
16
|
className += ` border-radius-${border?.radius}`;
|
|
17
17
|
}
|
|
18
|
+
if (size)
|
|
19
|
+
className += ` ${size}`;
|
|
18
20
|
if (position) {
|
|
19
21
|
className += ` ${position.type}`;
|
|
20
22
|
className += ` ${position.inset.map((_inset) => _inset).join(" ")}`;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import Menu from "../menu";
|
|
4
|
+
import useLayout from "../../libs/core/application/hooks/useLayout";
|
|
5
|
+
const Aside = ({ menu }) => {
|
|
6
|
+
// hooks
|
|
7
|
+
const { options } = useLayout();
|
|
8
|
+
return (options?.aside.active && (React.createElement("aside", null,
|
|
9
|
+
React.createElement(Menu, { menu: menu, variant: "vertical" }))));
|
|
10
|
+
};
|
|
11
|
+
export default Aside;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import Menu from "../menu";
|
|
4
|
+
const Header = ({ logo, menu }) => {
|
|
5
|
+
return (React.createElement("header", { className: "ar-header" },
|
|
6
|
+
React.createElement("div", { className: "ar-header-with-wrap" },
|
|
7
|
+
typeof logo === "string" ? React.createElement("h1", null, logo) : logo,
|
|
8
|
+
React.createElement(Menu, { menu: menu, variant: "horizontal" }))));
|
|
9
|
+
};
|
|
10
|
+
export default Header;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MenuProps } from "../menu/Types";
|
|
2
|
+
export type LayoutProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
};
|
|
5
|
+
export type HeaderProps = {
|
|
6
|
+
logo: string | React.JSX.Element;
|
|
7
|
+
menu: MenuProps[];
|
|
8
|
+
};
|
|
9
|
+
export type MainProps = {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
};
|
|
12
|
+
export type AsideProps = {
|
|
13
|
+
menu: MenuProps[];
|
|
14
|
+
};
|
|
15
|
+
export type SectionProps = {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { AsideProps, HeaderProps, LayoutProps, MainProps, SectionProps } from "./Types";
|
|
3
|
+
import "../../assest/css/layout/layout.css";
|
|
4
|
+
declare const Layout: React.FC<LayoutProps> & {
|
|
5
|
+
Header: React.FC<HeaderProps>;
|
|
6
|
+
Main: React.FC<MainProps>;
|
|
7
|
+
Aside: React.FC<AsideProps>;
|
|
8
|
+
Section: React.FC<SectionProps>;
|
|
9
|
+
Footer: React.FC;
|
|
10
|
+
};
|
|
11
|
+
export default Layout;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Footer from "./Footer";
|
|
3
|
+
import "../../assest/css/layout/layout.css";
|
|
4
|
+
import Header from "./Header";
|
|
5
|
+
import Aside from "./Aside";
|
|
6
|
+
import Main from "./Main";
|
|
7
|
+
import Section from "./Section";
|
|
8
|
+
import { LayoutProvider } from "../../libs/core/application/contexts/Layout";
|
|
9
|
+
const Layout = ({ children }) => (React.createElement("div", { className: "ar-layout" },
|
|
10
|
+
React.createElement(LayoutProvider, null, children)));
|
|
11
|
+
Layout.Header = Header;
|
|
12
|
+
Layout.Main = Main;
|
|
13
|
+
Layout.Aside = Aside;
|
|
14
|
+
Layout.Section = Section;
|
|
15
|
+
Layout.Footer = Footer;
|
|
16
|
+
Layout.displayName = "Layout";
|
|
17
|
+
export default Layout;
|
|
@@ -85,7 +85,10 @@ const Menu = ({ menu, variant = "vertical", ...attributes }) => {
|
|
|
85
85
|
_className_groupTitle += " ar-angle-down";
|
|
86
86
|
}
|
|
87
87
|
// Eğer seçili olan menüyse "selected" sınıfını ekler.
|
|
88
|
-
if (selectedMenu.length > 0 &&
|
|
88
|
+
if (selectedMenu.length > 0 &&
|
|
89
|
+
selectedMenu.includes(item) &&
|
|
90
|
+
item.type !== "group" &&
|
|
91
|
+
variant !== "horizontal")
|
|
89
92
|
_className_li += " selected";
|
|
90
93
|
return (React.createElement("li", { key: index, className: _className_li, onClick: (event) => handleOnClick(event, item, variant, null, setSelectedMenu) },
|
|
91
94
|
item.type === "divider" ? (React.createElement(Divider, null)) : (React.createElement("div", { className: _className_groupTitle }, item.render)),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import React, { useEffect, useRef, useState } from "react";
|
|
2
3
|
import Parser from "./classes/Parser";
|
|
3
4
|
import Compiler from "./classes/Compiler";
|
|
@@ -35,7 +36,9 @@ const SyntaxHighlighter = ({ children, position = "left" }) => {
|
|
|
35
36
|
React.createElement("div", { className: "ar-syntax" },
|
|
36
37
|
React.createElement("div", { ref: _div, className: `preview ${position}` }, children),
|
|
37
38
|
React.createElement("div", { className: "ar-syntax-button-group" },
|
|
38
|
-
React.createElement(Button, { variant: "outlined",
|
|
39
|
+
React.createElement(Button, { variant: "outlined", _type: "dark", border: {
|
|
40
|
+
style: "solid",
|
|
41
|
+
}, size: "small", onClick: () => setCodePanelIsOpen((x) => !x) }, codePanelIsOpen ? "Close Code" : "Open Code")),
|
|
39
42
|
React.createElement("pre", { className: `pre ${!codePanelIsOpen ? "hidden" : "visible"}` },
|
|
40
43
|
React.createElement("code", { ref: _code })))));
|
|
41
44
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import "./assest/css/ar-core.css";
|
|
2
|
+
import Alert from "./components/alert";
|
|
2
3
|
import Button from "./components/button";
|
|
3
|
-
export { Button };
|
|
4
4
|
import Menu from "./components/menu";
|
|
5
|
-
export { Menu };
|
|
6
5
|
import Grid from "./components/grid-system";
|
|
7
|
-
export { Grid };
|
|
8
6
|
import Typography from "./components/typography";
|
|
9
|
-
export { Typography };
|
|
10
7
|
import SyntaxHighlighter from "./components/syntax-highlighter";
|
|
11
|
-
export { SyntaxHighlighter };
|
|
12
8
|
import Divider from "./components/divider";
|
|
13
|
-
|
|
9
|
+
import Layout from "./components/layout";
|
|
10
|
+
import useLayout from "./libs/core/application/hooks/useLayout";
|
|
14
11
|
import type { MenuProps } from "./components/menu/Types";
|
|
12
|
+
export { Alert, Button, Menu, Grid, Typography, SyntaxHighlighter, Divider, Layout, useLayout };
|
|
15
13
|
export type { MenuProps };
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import "./assest/css/ar-core.css";
|
|
2
|
+
import Alert from "./components/alert";
|
|
2
3
|
import Button from "./components/button";
|
|
3
|
-
export { Button };
|
|
4
4
|
import Menu from "./components/menu";
|
|
5
|
-
export { Menu };
|
|
6
5
|
import Grid from "./components/grid-system";
|
|
7
|
-
export { Grid };
|
|
8
6
|
import Typography from "./components/typography";
|
|
9
|
-
export { Typography };
|
|
10
7
|
import SyntaxHighlighter from "./components/syntax-highlighter";
|
|
11
|
-
export { SyntaxHighlighter };
|
|
12
8
|
import Divider from "./components/divider";
|
|
13
|
-
|
|
9
|
+
import Layout from "./components/layout";
|
|
10
|
+
import useLayout from "./libs/core/application/hooks/useLayout";
|
|
11
|
+
export { Alert, Button, Menu, Grid, Typography, SyntaxHighlighter, Divider, Layout, useLayout };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type LayoutOptions = {
|
|
3
|
+
aside: {
|
|
4
|
+
active: boolean;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
type LayoutContextProps = {
|
|
8
|
+
options: LayoutOptions;
|
|
9
|
+
setOptions: React.Dispatch<React.SetStateAction<LayoutOptions>>;
|
|
10
|
+
};
|
|
11
|
+
type LayoutProviderProps = {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
};
|
|
14
|
+
declare const LayoutContext: React.Context<Partial<LayoutContextProps>>;
|
|
15
|
+
declare const LayoutProvider: ({ children }: LayoutProviderProps) => React.JSX.Element;
|
|
16
|
+
export { LayoutContext, LayoutProvider };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { createContext, useState } from "react";
|
|
3
|
+
const LayoutContext = createContext({});
|
|
4
|
+
const LayoutProvider = ({ children }) => {
|
|
5
|
+
const [options, setOptions] = useState({ aside: { active: false } });
|
|
6
|
+
return (React.createElement(LayoutContext.Provider, { value: { options, setOptions } }, children));
|
|
7
|
+
};
|
|
8
|
+
export { LayoutContext, LayoutProvider };
|
package/package.json
CHANGED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
.ar-button {
|
|
2
|
-
position: relative;
|
|
3
|
-
height: 2.5rem;
|
|
4
|
-
padding: 0 1rem;
|
|
5
|
-
border: none;
|
|
6
|
-
border-radius: var(--border-radius-sm);
|
|
7
|
-
cursor: pointer;
|
|
8
|
-
transition: background-color 150ms, border 150ms, color 150ms ease-in-out;
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
}
|
|
11
|
-
.ar-button.disabled {
|
|
12
|
-
cursor: no-drop;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.ar-button.max-width {
|
|
16
|
-
width: 100%;
|
|
17
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
.ar-button {
|
|
2
|
-
position: relative;
|
|
3
|
-
height: 2.5rem;
|
|
4
|
-
padding: 0 1rem;
|
|
5
|
-
border: none;
|
|
6
|
-
border-radius: var(--border-radius-sm);
|
|
7
|
-
cursor: pointer;
|
|
8
|
-
transition: background-color 150ms, border 150ms, color 150ms ease-in-out;
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
}
|
|
11
|
-
.ar-button.disabled {
|
|
12
|
-
cursor: no-drop;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.ar-button.max-width {
|
|
16
|
-
width: 100%;
|
|
17
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
@import url("./selected.css");
|
|
2
|
-
@import url("./open-or-close.css");
|
|
3
|
-
|
|
4
|
-
.ar-menu {
|
|
5
|
-
background-color: var(--white);
|
|
6
|
-
}
|
|
7
|
-
.ar-menu ul {
|
|
8
|
-
margin: 0;
|
|
9
|
-
padding: 0;
|
|
10
|
-
list-style: none;
|
|
11
|
-
}
|
|
12
|
-
.ar-menu ul li:last-child {
|
|
13
|
-
padding-bottom: 0;
|
|
14
|
-
}
|
|
15
|
-
.ar-menu ul li ul {
|
|
16
|
-
margin-left: 0.5rem;
|
|
17
|
-
padding-left: 0.5rem;
|
|
18
|
-
}
|
|
19
|
-
.ar-menu > .ar-menu-list {
|
|
20
|
-
display: flex;
|
|
21
|
-
}
|
|
22
|
-
.ar-menu .ar-menu-list-item-group-item-title {
|
|
23
|
-
display: flex;
|
|
24
|
-
align-items: center;
|
|
25
|
-
height: 2.5rem;
|
|
26
|
-
padding-left: 1rem;
|
|
27
|
-
user-select: none;
|
|
28
|
-
}
|
|
29
|
-
.ar-menu .ar-menu-list-item-group-item-title:not(.group) > * {
|
|
30
|
-
display: flex;
|
|
31
|
-
align-items: center;
|
|
32
|
-
width: 100%;
|
|
33
|
-
height: 100%;
|
|
34
|
-
}
|
|
35
|
-
.ar-menu .ar-menu-list-item-group-item-title:not(.group):hover {
|
|
36
|
-
background-color: var(--gray-100);
|
|
37
|
-
}
|
|
38
|
-
.ar-menu .ar-menu-list-item-group-item-title.selection-item {
|
|
39
|
-
background-color: red;
|
|
40
|
-
}
|
|
41
|
-
.ar-menu .ar-menu-list-item-group-item-title.group {
|
|
42
|
-
margin-left: 1rem;
|
|
43
|
-
padding-left: 0;
|
|
44
|
-
border-radius: 0;
|
|
45
|
-
border-bottom: solid 1px var(--gray-100);
|
|
46
|
-
color: var(--gray-500);
|
|
47
|
-
}
|