@harjs/react-ui 1.1.9 → 1.1.11
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/assets/css/components/data-display/chip/css.cjs +2 -2
- package/dist/assets/css/components/data-display/chip/size.css +6 -6
- package/dist/assets/css/components/data-display/chip/styles.css +1 -0
- package/dist/assets/css/components/data-display/typography/paragraph/css.cjs +2 -2
- package/dist/assets/css/components/data-display/typography/paragraph/size.css +6 -6
- package/dist/assets/css/components/data-display/typography/title/core.css +1 -1
- package/dist/assets/css/components/data-display/typography/typography.css +0 -1
- package/dist/assets/css/components/feedback/drawer/css.cjs +13 -8
- package/dist/assets/css/components/feedback/drawer/size.css +31 -6
- package/dist/assets/css/components/feedback/modal/css.cjs +3 -6
- package/dist/assets/css/components/feedback/modal/size.css +6 -6
- package/dist/assets/css/components/form/button/css.cjs +2 -2
- package/dist/assets/css/components/form/button/size.css +6 -6
- package/dist/assets/css/components/form/checkbox/color.checked.css +1020 -1024
- package/dist/assets/css/components/form/checkbox/color.radio-checked.css +1150 -1154
- package/dist/assets/css/components/form/checkbox/color.radio-unchecked.css +727 -735
- package/dist/assets/css/components/form/checkbox/color.unchecked.css +727 -735
- package/dist/assets/css/components/form/checkbox/css.cjs +5 -5
- package/dist/assets/css/components/form/checkbox/size.css +3 -3
- package/dist/assets/css/components/form/input/addon.css +19 -15
- package/dist/assets/css/components/form/input/color.addon.css +511 -0
- package/dist/assets/css/components/form/input/css.cjs +6 -136
- package/dist/assets/css/components/form/input/size.css +6 -6
- package/dist/assets/css/components/form/input/styles.css +7 -0
- package/dist/assets/css/components/form/input/templates/color.addon.template.css +50 -0
- package/dist/assets/css/components/form/select/color.css +635 -0
- package/dist/assets/css/components/form/select/css.cjs +43 -0
- package/dist/assets/css/components/form/select/options.css +121 -100
- package/dist/assets/css/components/form/select/radius.css +45 -0
- package/dist/assets/css/components/form/select/size.css +35 -0
- package/dist/assets/css/components/form/select/styles.css +8 -6
- package/dist/assets/css/components/form/select/templates/color.template.css +62 -0
- package/dist/assets/css/components/form/select/templates/radius.template.css +3 -0
- package/dist/assets/css/components/form/select/templates/size.template.css +4 -0
- package/dist/assets/css/components/form/switch/color.css +721 -0
- package/dist/assets/css/components/form/switch/css.cjs +40 -0
- package/dist/assets/css/components/form/switch/radius.css +42 -0
- package/dist/assets/css/components/form/switch/size.css +28 -0
- package/dist/assets/css/components/form/switch/styles.css +7 -5
- package/dist/assets/css/components/form/switch/templates/color.template.css +71 -0
- package/dist/assets/css/components/form/switch/templates/radius.template.css +3 -0
- package/dist/assets/css/components/form/switch/templates/size.template.css +8 -0
- package/dist/components/data-display/typography/paragraph/Paragraph.js +1 -1
- package/dist/components/data-display/typography/title/IProps.d.ts +0 -1
- package/dist/components/data-display/typography/title/Title.js +5 -7
- package/dist/components/feedback/drawer/IProps.d.ts +4 -3
- package/dist/components/feedback/drawer/index.js +2 -2
- package/dist/components/form/checkbox/Props.d.ts +2 -3
- package/dist/components/form/checkbox/index.d.ts +1 -2
- package/dist/components/form/checkbox/index.js +1 -3
- package/dist/components/form/input/index.js +1 -1
- package/dist/components/form/select/index.js +33 -24
- package/dist/components/form/switch/index.js +5 -5
- package/dist/components/navigation/wizard/IProps.d.ts +3 -3
- package/dist/libs/infrastructure/shared/Utils.js +1 -1
- package/dist/libs/infrastructure/types/IGlobalProps.d.ts +1 -15
- package/dist/libs/infrastructure/types/index.d.ts +2 -1
- package/package.json +1 -1
- package/dist/assets/css/components/data-display/typography/title/size.css +0 -41
- package/dist/assets/css/components/form/switch/core/border.css +0 -208
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
const { execSync } = require("child_process");
|
|
4
|
+
|
|
5
|
+
const colors = ["blue", "purple", "pink", "red", "orange", "yellow", "green", "teal", "cyan", "gray"];
|
|
6
|
+
const radiuses = ["0", "2", "4", "6", "8", "12", "16", "20", "40", "full"];
|
|
7
|
+
const sizes = [
|
|
8
|
+
{ name: "xs", "w/h": "1rem", fontSize: "0.75rem" },
|
|
9
|
+
{ name: "sm", "w/h": "1.25rem", fontSize: "1rem" },
|
|
10
|
+
{ name: "md", "w/h": "1.5rem", fontSize: "1.25rem" },
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
const colorTemplate = fs.readFileSync("templates/color.template.css", "utf-8");
|
|
14
|
+
const radiusTemplate = fs.readFileSync("templates/radius.template.css", "utf-8");
|
|
15
|
+
const sizeTemplate = fs.readFileSync("templates/size.template.css", "utf-8");
|
|
16
|
+
|
|
17
|
+
let colorOutput = `.har-switch {${colors.map((color) => colorTemplate.replace(/__COLOR__/g, color)).join("\n")}}`;
|
|
18
|
+
let radiusOutput = `.har-switch, .har-switch > .handle {${radiuses.map((radius) => radiusTemplate.replace(/__RADIUS__/g, radius)).join("\n")}}`;
|
|
19
|
+
let sizeOutput = `.har-switch {${sizes
|
|
20
|
+
.map((size) =>
|
|
21
|
+
sizeTemplate
|
|
22
|
+
.replace(/__SIZE__/g, `size-${size.name}`)
|
|
23
|
+
.replace(/__SIZE_NUMBER__/g, size["w/h"])
|
|
24
|
+
.replace(/__FONT_SIZE__/g, size.fontSize),
|
|
25
|
+
)
|
|
26
|
+
.join("\n")}}`;
|
|
27
|
+
|
|
28
|
+
fs.writeFileSync("color.css", colorOutput);
|
|
29
|
+
fs.writeFileSync("radius.css", radiusOutput);
|
|
30
|
+
fs.writeFileSync("size.css", sizeOutput);
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
execSync(`npx prettier --write color.css`, { stdio: "inherit" });
|
|
34
|
+
execSync(`npx prettier --write radius.css`, { stdio: "inherit" });
|
|
35
|
+
execSync(`npx prettier --write size.css`, { stdio: "inherit" });
|
|
36
|
+
|
|
37
|
+
execSync("npm run no-css-build", { stdio: "inherit" });
|
|
38
|
+
} catch (err) {
|
|
39
|
+
console.error("⚠️ Prettier çalıştırılamadı:", err.message);
|
|
40
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
.har-switch,
|
|
2
|
+
.har-switch > .handle {
|
|
3
|
+
&.radius-0 {
|
|
4
|
+
border-radius: var(--radius-0);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
&.radius-2 {
|
|
8
|
+
border-radius: var(--radius-2);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&.radius-4 {
|
|
12
|
+
border-radius: var(--radius-4);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&.radius-6 {
|
|
16
|
+
border-radius: var(--radius-6);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.radius-8 {
|
|
20
|
+
border-radius: var(--radius-8);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&.radius-12 {
|
|
24
|
+
border-radius: var(--radius-12);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&.radius-16 {
|
|
28
|
+
border-radius: var(--radius-16);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&.radius-20 {
|
|
32
|
+
border-radius: var(--radius-20);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&.radius-40 {
|
|
36
|
+
border-radius: var(--radius-40);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&.radius-full {
|
|
40
|
+
border-radius: var(--radius-full);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.har-switch {
|
|
2
|
+
&.size-xs {
|
|
3
|
+
width: 1rem;
|
|
4
|
+
height: 1rem;
|
|
5
|
+
|
|
6
|
+
+ .label {
|
|
7
|
+
font-size: 0.75rem;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&.size-sm {
|
|
12
|
+
width: 1.25rem;
|
|
13
|
+
height: 1.25rem;
|
|
14
|
+
|
|
15
|
+
+ .label {
|
|
16
|
+
font-size: 1rem;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&.size-md {
|
|
21
|
+
width: 1.5rem;
|
|
22
|
+
height: 1.5rem;
|
|
23
|
+
|
|
24
|
+
+ .label {
|
|
25
|
+
font-size: 1.25rem;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
@import url("./
|
|
1
|
+
@import url("./color.css");
|
|
2
|
+
@import url("./size.css");
|
|
3
|
+
@import url("./radius.css");
|
|
2
4
|
|
|
3
|
-
.
|
|
5
|
+
.har-switch-wrapper {
|
|
4
6
|
display: flex;
|
|
5
7
|
flex-wrap: nowrap;
|
|
6
8
|
align-items: center;
|
|
@@ -18,7 +20,7 @@
|
|
|
18
20
|
> input[type="checkbox"] {
|
|
19
21
|
display: none;
|
|
20
22
|
|
|
21
|
-
+ .
|
|
23
|
+
+ .har-switch {
|
|
22
24
|
> .handle {
|
|
23
25
|
position: absolute;
|
|
24
26
|
top: 50%;
|
|
@@ -40,7 +42,7 @@
|
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
&.checked {
|
|
43
|
-
+ .
|
|
45
|
+
+ .har-switch {
|
|
44
46
|
> .handle {
|
|
45
47
|
left: calc(2.25rem - 1rem);
|
|
46
48
|
border: none;
|
|
@@ -50,7 +52,7 @@
|
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
> .
|
|
55
|
+
> .har-switch {
|
|
54
56
|
position: relative;
|
|
55
57
|
display: inline-block;
|
|
56
58
|
width: 2.25rem;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
&.__COLOR__ {
|
|
2
|
+
&.filled {
|
|
3
|
+
background-color: var(--__COLOR__-500);
|
|
4
|
+
|
|
5
|
+
&:hover {
|
|
6
|
+
background-color: var(--__COLOR__-400);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
&:active {
|
|
10
|
+
background-color: var(--__COLOR__-600);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&.surface {
|
|
15
|
+
background-color: var(--__COLOR__-300);
|
|
16
|
+
border: solid var(--stroke-1) var(--__COLOR__-200);
|
|
17
|
+
color: var(--__COLOR__-700);
|
|
18
|
+
|
|
19
|
+
&:hover {
|
|
20
|
+
background-color: var(--__COLOR__-200);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&:active {
|
|
24
|
+
background-color: var(--__COLOR__-300);
|
|
25
|
+
border: solid var(--stroke-1) var(--__COLOR__-300);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&.surface-borderless {
|
|
30
|
+
background-color: var(--__COLOR__-100);
|
|
31
|
+
border: solid var(--stroke-1) transparent;
|
|
32
|
+
color: var(--__COLOR__-700);
|
|
33
|
+
|
|
34
|
+
&:hover {
|
|
35
|
+
background-color: var(--__COLOR__-200);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&:active {
|
|
39
|
+
background-color: var(--__COLOR__-300);
|
|
40
|
+
border: solid var(--stroke-1) var(--__COLOR__-300);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&.outlined {
|
|
45
|
+
border: solid var(--stroke-1) var(--__COLOR__-500);
|
|
46
|
+
color: var(--__COLOR__-700);
|
|
47
|
+
|
|
48
|
+
&:hover {
|
|
49
|
+
background-color: var(--__COLOR__-100);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&:active {
|
|
53
|
+
background-color: var(--__COLOR__-200);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&.dashed {
|
|
58
|
+
border: dashed var(--stroke-1) var(--__COLOR__-500);
|
|
59
|
+
color: var(--__COLOR__-700);
|
|
60
|
+
|
|
61
|
+
&:hover {
|
|
62
|
+
border: dashed var(--stroke-1) var(--__COLOR__-300);
|
|
63
|
+
color: var(--__COLOR__-300);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&:active {
|
|
67
|
+
border: dashed var(--stroke-1) var(--__COLOR__-500);
|
|
68
|
+
color: var(--__COLOR__-700);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -7,7 +7,7 @@ const Paragraph = ({ children, color, align = "left", size = "md", upperCase = f
|
|
|
7
7
|
if (color)
|
|
8
8
|
_className.push(color);
|
|
9
9
|
if (size)
|
|
10
|
-
_className.push(size);
|
|
10
|
+
_className.push(`size-${size}`);
|
|
11
11
|
return (React.createElement("p", { className: _className.map((c) => c).join(" ") }, typeof children === "string" && upperCase ? children.toLocaleUpperCase() : children));
|
|
12
12
|
};
|
|
13
13
|
Paragraph.displayName = "Paragraph";
|
|
@@ -2,6 +2,5 @@ import { IChildrenProps, IUpperCaseProps } from "../../../../libs/infrastructure
|
|
|
2
2
|
interface IProps extends IChildrenProps, IUpperCaseProps, React.HTMLAttributes<HTMLHeadingElement> {
|
|
3
3
|
Level: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
4
4
|
align?: "left" | "center" | "right";
|
|
5
|
-
size?: "xx-small" | "x-small" | "small" | "medium" | "large" | "x-large" | "xx-large" | "xxx-large" | "smaller" | "larger";
|
|
6
5
|
}
|
|
7
6
|
export default IProps;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import React
|
|
3
|
-
const Title = ({ children, Level, align = "left",
|
|
2
|
+
import React from "react";
|
|
3
|
+
const Title = ({ children, Level, align = "left", upperCase = false, ...attributes }) => {
|
|
4
4
|
// refs
|
|
5
|
-
let _className =
|
|
5
|
+
let _className = ["har-typography-title"];
|
|
6
6
|
if (align)
|
|
7
|
-
_className
|
|
8
|
-
|
|
9
|
-
_className += ` ${size}`;
|
|
10
|
-
return (React.createElement(Level, { className: _className, ...attributes }, typeof children === "string" && upperCase ? children.toLocaleUpperCase() : children));
|
|
7
|
+
_className.push(align);
|
|
8
|
+
return (React.createElement(Level, { className: _className.map((c) => c).join(" "), ...attributes }, typeof children === "string" && upperCase ? children.toLocaleUpperCase() : children));
|
|
11
9
|
};
|
|
12
10
|
Title.displayName = "Title";
|
|
13
11
|
export default Title;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { TabProps, ValidationProps } from "../../../libs/infrastructure/types";
|
|
2
|
-
import { IChildrenProps
|
|
3
|
-
interface IProps<T extends object> extends IChildrenProps
|
|
1
|
+
import { DrawerSizes, TabProps, ValidationProps } from "../../../libs/infrastructure/types";
|
|
2
|
+
import { IChildrenProps } from "../../../libs/infrastructure/types/IGlobalProps";
|
|
3
|
+
interface IProps<T extends object> extends IChildrenProps {
|
|
4
4
|
title?: string;
|
|
5
|
+
size?: DrawerSizes;
|
|
5
6
|
tabs: TabProps[];
|
|
6
7
|
activeTab?: number;
|
|
7
8
|
open: {
|
|
@@ -4,11 +4,11 @@ import Typography from "../../data-display/typography";
|
|
|
4
4
|
import "../../../assets/css/components/feedback/drawer/styles.css";
|
|
5
5
|
import { useValidation } from "../../../libs/core/application/hooks";
|
|
6
6
|
const { Title } = Typography;
|
|
7
|
-
const Drawer = function ({ title, tabs = [], activeTab, open, size = "
|
|
7
|
+
const Drawer = function ({ title, tabs = [], activeTab, open, size = "2xl", onChange, validation, config, }) {
|
|
8
8
|
// refs
|
|
9
9
|
const _drawer = useRef(null);
|
|
10
10
|
const _drawerWrapperClassName = ["har-drawer-wrapper"];
|
|
11
|
-
const _drawerClassName = ["har-drawer", size];
|
|
11
|
+
const _drawerClassName = ["har-drawer", `size-${size}`];
|
|
12
12
|
if (Object.keys(open).length > 0 && open.get)
|
|
13
13
|
_drawerWrapperClassName.push("opened");
|
|
14
14
|
else
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { IBorderProps, IColorProps, IUpperCaseProps, IValidationProps, IVariantProps } from "../../../libs/infrastructure/types/IGlobalProps";
|
|
1
|
+
import { IBorderProps, IColorProps, ISizeProps, IUpperCaseProps, IValidationProps, IVariantProps } from "../../../libs/infrastructure/types/IGlobalProps";
|
|
2
2
|
type Props = {
|
|
3
3
|
label?: string;
|
|
4
|
-
size?: "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
|
|
5
4
|
} & IVariantProps<{
|
|
6
5
|
component: "checkbox";
|
|
7
|
-
}> & IColorProps & IBorderProps & IUpperCaseProps & IValidationProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "size" | "color">;
|
|
6
|
+
}> & IColorProps & IBorderProps & ISizeProps & IUpperCaseProps & IValidationProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "size" | "color">;
|
|
8
7
|
export default Props;
|
|
@@ -2,8 +2,7 @@ import React from "react";
|
|
|
2
2
|
import "../../../assets/css/components/form/checkbox/styles.css";
|
|
3
3
|
declare const Checkbox: React.ForwardRefExoticComponent<{
|
|
4
4
|
label?: string;
|
|
5
|
-
size?: "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
|
|
6
5
|
} & import("../../../libs/infrastructure/types/IGlobalProps").IVariantProps<{
|
|
7
6
|
component: "checkbox";
|
|
8
|
-
}> & import("../../../libs/infrastructure/types/IGlobalProps").IColorProps & import("../../../libs/infrastructure/types/IGlobalProps").IBorderProps & import("../../../libs/infrastructure/types/IGlobalProps").IUpperCaseProps & import("../../../libs/infrastructure/types/IGlobalProps").IValidationProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, "color" | "children" | "size"> & React.RefAttributes<HTMLInputElement>>;
|
|
7
|
+
}> & import("../../../libs/infrastructure/types/IGlobalProps").IColorProps & import("../../../libs/infrastructure/types/IGlobalProps").IBorderProps & import("../../../libs/infrastructure/types/IGlobalProps").ISizeProps & import("../../../libs/infrastructure/types/IGlobalProps").IUpperCaseProps & import("../../../libs/infrastructure/types/IGlobalProps").IValidationProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, "color" | "children" | "size"> & React.RefAttributes<HTMLInputElement>>;
|
|
9
8
|
export default Checkbox;
|
|
@@ -7,9 +7,7 @@ const Checkbox = forwardRef(({ label, variant, color = "blue", border = { radius
|
|
|
7
7
|
const _checkbox = useRef(null);
|
|
8
8
|
const _checkboxClassName = ["har-checkbox"];
|
|
9
9
|
const _innerRef = useRef(null);
|
|
10
|
-
_checkboxClassName.push(...Utils.GetClassName(variant ?? "outlined", undefined, validation?.text ? "red" : (color ?? "blue"), border ?? { radius: "4" },
|
|
11
|
-
if (size)
|
|
12
|
-
_checkboxClassName.push(size);
|
|
10
|
+
_checkboxClassName.push(...Utils.GetClassName(variant ?? "outlined", undefined, validation?.text ? "red" : (color ?? "blue"), border ?? { radius: "4" }, size, undefined, attributes.className));
|
|
13
11
|
if (attributes.disabled)
|
|
14
12
|
_checkboxClassName.push("disabled");
|
|
15
13
|
// hooks
|
|
@@ -100,7 +100,7 @@ const BaseInput = forwardRef(({ children, variant = "outlined", color = "gray",
|
|
|
100
100
|
setLabelWidth(width);
|
|
101
101
|
}
|
|
102
102
|
}, [value, attributes.placeholder]);
|
|
103
|
-
return (React.createElement("div", { className: _wrapperClassName.map((c) => c).join(" ") },
|
|
103
|
+
return (React.createElement("div", { className: _wrapperClassName.map((c) => c).join(" "), ...(validation?.text ? { style: { marginBottom: "var(--space-20)" } } : {}) },
|
|
104
104
|
renderAddon("before"),
|
|
105
105
|
React.createElement("div", { className: "har-input" },
|
|
106
106
|
renderIcon() && React.createElement("div", { className: "icon-element" }, renderIcon()),
|
|
@@ -6,7 +6,9 @@ import Chip from "../../data-display/chip";
|
|
|
6
6
|
import Checkbox from "../checkbox";
|
|
7
7
|
import Utils from "../../../libs/infrastructure/shared/Utils";
|
|
8
8
|
import ReactDOM from "react-dom";
|
|
9
|
-
|
|
9
|
+
import Button from "../button";
|
|
10
|
+
const Select = ({ variant = "outlined", status, color = "gray", border = { radius: "4" }, size, style, options, value, onChange, onSearch, onClick, onCreate, multiple, placeholder, validation, upperCase, disabled, readOnly, config = { clear: true, validation: { text: "visible" } }, }) => {
|
|
11
|
+
const _mWrapperClassName = ["wrapper"];
|
|
10
12
|
const _selectionClassName = ["selections"];
|
|
11
13
|
// refs
|
|
12
14
|
const _arSelect = useRef(null);
|
|
@@ -28,7 +30,7 @@ const Select = ({ variant = "outlined", status, color = "gray", border = { radiu
|
|
|
28
30
|
// options referans kararlılığı için JSON key
|
|
29
31
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
30
32
|
const optionsKey = useMemo(() => JSON.stringify(options), [options]);
|
|
31
|
-
_selectionClassName.push(...Utils.GetClassName(variant, undefined, validation?.text ? "red" : "gray", border,
|
|
33
|
+
_selectionClassName.push(...Utils.GetClassName(variant, undefined, validation?.text ? "red" : "gray", border, size, undefined, undefined));
|
|
32
34
|
// methods
|
|
33
35
|
const handleClickOutSide = (event) => {
|
|
34
36
|
const target = event.target;
|
|
@@ -188,7 +190,6 @@ const Select = ({ variant = "outlined", status, color = "gray", border = { radiu
|
|
|
188
190
|
};
|
|
189
191
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
190
192
|
}, [optionsOpen]);
|
|
191
|
-
// arama metni değiştiğinde filtrele
|
|
192
193
|
useEffect(() => {
|
|
193
194
|
if (searchText.length > 0 && onSearch) {
|
|
194
195
|
onSearch(searchText);
|
|
@@ -227,9 +228,9 @@ const Select = ({ variant = "outlined", status, color = "gray", border = { radiu
|
|
|
227
228
|
});
|
|
228
229
|
}, [navigationIndex]);
|
|
229
230
|
const handleBlur = () => setOptionsOpen(false);
|
|
230
|
-
return (React.createElement("div", { ref: _arSelect, className: "
|
|
231
|
-
React.createElement("div", { ref: _multipleInput, className: "
|
|
232
|
-
multiple ? (React.createElement("div", { className: "
|
|
231
|
+
return (React.createElement("div", { ref: _arSelect, className: "har-select-wrapper" },
|
|
232
|
+
React.createElement("div", { ref: _multipleInput, className: "har-select" },
|
|
233
|
+
multiple ? (React.createElement("div", { className: _mWrapperClassName.map((c) => c).join(" ") },
|
|
233
234
|
React.createElement("div", { ...(value.length > 0
|
|
234
235
|
? {
|
|
235
236
|
style: {
|
|
@@ -249,13 +250,13 @@ const Select = ({ variant = "outlined", status, color = "gray", border = { radiu
|
|
|
249
250
|
onClick && onClick();
|
|
250
251
|
setOptionsOpen((prev) => !prev);
|
|
251
252
|
} },
|
|
252
|
-
React.createElement("div", { className: "items" }, value.map((_value, index) => (React.createElement(Chip, { key: index, variant: status?.selected?.variant || "filled", color: status?.selected?.color || status?.color, text: _value.text }))))),
|
|
253
|
+
React.createElement("div", { className: "items" }, value.map((_value, index) => (React.createElement(Chip, { key: index, variant: status?.selected?.variant || "filled", color: status?.selected?.color || status?.color, text: _value.text, size: size }))))),
|
|
253
254
|
React.createElement("span", { ref: _placeholder, className: `placeholder ${value.length > 0 ? "visible" : "hidden"}`, onClick: () => {
|
|
254
255
|
onClick && onClick();
|
|
255
256
|
setOptionsOpen((prev) => !prev);
|
|
256
257
|
} },
|
|
257
258
|
validation ? "* " : "",
|
|
258
|
-
placeholder))) : (React.createElement(Input, { ref: _singleInput, style: { ...style
|
|
259
|
+
placeholder))) : (React.createElement(Input, { ref: _singleInput, style: { ...style }, variant: variant, color: !Utils.IsNullOrEmpty(validation?.text) ? "red" : color, border: { radius: border.radius }, size: size, value: singleInputText, onClick: () => {
|
|
259
260
|
onClick && onClick();
|
|
260
261
|
setOptionsOpen((prev) => !prev);
|
|
261
262
|
}, onChange: (event) => {
|
|
@@ -270,25 +271,33 @@ const Select = ({ variant = "outlined", status, color = "gray", border = { radiu
|
|
|
270
271
|
}, placeholder: placeholder, validation: {
|
|
271
272
|
...validation,
|
|
272
273
|
text: config.validation?.text === "visible" ? validation?.text : "",
|
|
273
|
-
}, disabled: disabled, readOnly: readOnly }
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
event
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
274
|
+
}, disabled: disabled, readOnly: readOnly },
|
|
275
|
+
config?.clear === true && (React.createElement(Input.AddonAfter, null,
|
|
276
|
+
React.createElement(Button, { variant: "borderless", color: "red", border: border, size: size, shape: "square", icon: {
|
|
277
|
+
element: (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "var(--red-500)", viewBox: "0 0 256 256" },
|
|
278
|
+
React.createElement("path", { d: "M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z" }))),
|
|
279
|
+
}, onClick: (event) => {
|
|
280
|
+
if (disabled)
|
|
281
|
+
return;
|
|
282
|
+
event.stopPropagation();
|
|
283
|
+
handleCleanSelection();
|
|
284
|
+
} }))),
|
|
285
|
+
React.createElement(Input.AddonAfter, null,
|
|
286
|
+
React.createElement(Button, { variant: "borderless", color: color, border: border, size: size, shape: "square", icon: {
|
|
287
|
+
element: optionsOpen ? (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "var(--black-100)", viewBox: "0 0 256 256" },
|
|
288
|
+
React.createElement("path", { d: "M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z" }))) : (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "var(--black-100)", viewBox: "0 0 256 256" },
|
|
289
|
+
React.createElement("path", { d: "M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z" }))),
|
|
290
|
+
}, onClick: (event) => {
|
|
291
|
+
if (disabled)
|
|
292
|
+
return;
|
|
293
|
+
onClick && onClick();
|
|
294
|
+
event.stopPropagation();
|
|
295
|
+
setOptionsOpen((prev) => !prev);
|
|
296
|
+
} })))),
|
|
288
297
|
multiple && validation && config.validation?.text === "visible" && (React.createElement("span", { className: "har-validation-text" }, validation.text))),
|
|
289
298
|
!disabled &&
|
|
290
299
|
optionsOpen &&
|
|
291
|
-
ReactDOM.createPortal(React.createElement("div", { ref: _options, className: "
|
|
300
|
+
ReactDOM.createPortal(React.createElement("div", { ref: _options, className: "har-select-options" },
|
|
292
301
|
multiple && (React.createElement("div", { className: "search-field" },
|
|
293
302
|
React.createElement(Input, { ref: _searchField, variant: "outlined", placeholder: "Search...", value: searchText, onChange: (event) => setSearchText(event.target.value), onClick: (event) => event.stopPropagation() }))),
|
|
294
303
|
filteredOptions.length > 0 ? (React.createElement("ul", null,
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import React, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
3
3
|
import "../../../assets/css/components/form/switch/styles.css";
|
|
4
4
|
import Utils from "../../../libs/infrastructure/shared/Utils";
|
|
5
|
-
const Switch = forwardRef(({ label, color, border = { radius: "full" }, ...attributes }, ref) => {
|
|
5
|
+
const Switch = forwardRef(({ label, variant = "filled", color = "blue", border = { radius: "full" }, ...attributes }, ref) => {
|
|
6
6
|
// refs
|
|
7
7
|
let _switchInput = useRef(null);
|
|
8
8
|
let _switch = useRef(null);
|
|
9
9
|
const _inputClassName = [];
|
|
10
|
-
const _switchClassName = ["
|
|
10
|
+
const _switchClassName = ["har-switch"];
|
|
11
11
|
// states
|
|
12
12
|
const [checked, setChecked] = useState(attributes.checked ?? false);
|
|
13
13
|
_inputClassName.push(attributes.checked ? "checked" : "unchecked");
|
|
14
|
-
_switchClassName.push(...Utils.GetClassName(
|
|
14
|
+
_switchClassName.push(...Utils.GetClassName(variant, undefined, attributes.checked ? color : "gray", border, undefined, undefined, attributes.className));
|
|
15
15
|
// hooks
|
|
16
16
|
// Dışarıdan gelen ref'i _innerRef'e bağla.
|
|
17
17
|
useImperativeHandle(ref, () => _switchInput.current);
|
|
@@ -19,7 +19,7 @@ const Switch = forwardRef(({ label, color, border = { radius: "full" }, ...attri
|
|
|
19
19
|
useEffect(() => {
|
|
20
20
|
setChecked(attributes.checked ?? false);
|
|
21
21
|
}, [attributes.checked]);
|
|
22
|
-
return (React.createElement("div", { className: "
|
|
22
|
+
return (React.createElement("div", { className: "har-switch-wrapper" },
|
|
23
23
|
React.createElement("label", null,
|
|
24
24
|
React.createElement("input", { ref: _switchInput, type: "checkbox", ...attributes, className: _inputClassName.map((c) => c).join(" "), checked: checked, size: 0, onChange: (event) => {
|
|
25
25
|
event.stopPropagation();
|
|
@@ -29,7 +29,7 @@ const Switch = forwardRef(({ label, color, border = { radius: "full" }, ...attri
|
|
|
29
29
|
(() => attributes.onChange && attributes.onChange(event))();
|
|
30
30
|
} }),
|
|
31
31
|
React.createElement("span", { ref: _switch, className: _switchClassName.map((c) => c).join(" ") },
|
|
32
|
-
React.createElement("span", { className:
|
|
32
|
+
React.createElement("span", { className: `handle ${border.radius ? `radius-${border.radius}` : "radius-full"}` })),
|
|
33
33
|
label && React.createElement("span", { className: "label" }, label))));
|
|
34
34
|
});
|
|
35
35
|
Switch.displayName = "Switch";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ComponentProps, Dispatch, SetStateAction } from "react";
|
|
2
|
-
import { StepProps, ValidationProps } from "../../../libs/infrastructure/types";
|
|
3
|
-
import { ISizeProps } from "../../../libs/infrastructure/types/IGlobalProps";
|
|
2
|
+
import { DrawerSizes, StepProps, ValidationProps } from "../../../libs/infrastructure/types";
|
|
4
3
|
import Wizard from ".";
|
|
5
|
-
export interface IProps<TData extends object>
|
|
4
|
+
export interface IProps<TData extends object> {
|
|
6
5
|
data: {
|
|
7
6
|
get: Partial<TData>;
|
|
8
7
|
set: Dispatch<SetStateAction<Partial<TData>>>;
|
|
@@ -10,6 +9,7 @@ export interface IProps<TData extends object> extends ISizeProps {
|
|
|
10
9
|
name: string;
|
|
11
10
|
title?: string;
|
|
12
11
|
description?: string;
|
|
12
|
+
size?: DrawerSizes;
|
|
13
13
|
steps: StepProps[];
|
|
14
14
|
currentStep?: number;
|
|
15
15
|
onChange: (currentStep: number) => void;
|
|
@@ -10,7 +10,7 @@ class Utils {
|
|
|
10
10
|
if (border)
|
|
11
11
|
classNames.push(`radius-${border.radius}`);
|
|
12
12
|
if (size)
|
|
13
|
-
classNames.push(size);
|
|
13
|
+
classNames.push(`size-${size}`);
|
|
14
14
|
if (icon && icon.element) {
|
|
15
15
|
classNames.push("icon");
|
|
16
16
|
classNames.push(`icon-${icon.position || "start"}`);
|
|
@@ -70,7 +70,7 @@ export interface IBorderProps {
|
|
|
70
70
|
* - `sm`: Small radius.
|
|
71
71
|
* - `lg`: Large radius.
|
|
72
72
|
* - `xl`: Extra-large radius.
|
|
73
|
-
* - `
|
|
73
|
+
* - `2xl`: Double extra-large radius.
|
|
74
74
|
* - `pill`: Fully rounded capsule shape.
|
|
75
75
|
* - `none`: Sharp corners (no radius).
|
|
76
76
|
*
|
|
@@ -108,20 +108,6 @@ export interface IIconProps {
|
|
|
108
108
|
icon?: Icon;
|
|
109
109
|
}
|
|
110
110
|
export interface ISizeProps {
|
|
111
|
-
/**
|
|
112
|
-
* Defines the overall scale and sizing of the component.
|
|
113
|
-
*
|
|
114
|
-
* - `large`: Scaled-up layout for prominence.
|
|
115
|
-
* - `normal`: Standard layout size (Default).
|
|
116
|
-
* - `small`: Compact layout for tight spaces.
|
|
117
|
-
*
|
|
118
|
-
* @example
|
|
119
|
-
* ```jsx
|
|
120
|
-
* <Component size="large">
|
|
121
|
-
* Large Layout
|
|
122
|
-
* </Component>
|
|
123
|
-
* ```
|
|
124
|
-
*/
|
|
125
111
|
size?: Sizes;
|
|
126
112
|
}
|
|
127
113
|
export interface IUpperCaseProps {
|
|
@@ -9,7 +9,8 @@ export type Border = {
|
|
|
9
9
|
radius: BorderRadiuses;
|
|
10
10
|
};
|
|
11
11
|
export type BorderRadiuses = "0" | "2" | "4" | "6" | "8" | "12" | "16" | "20" | "40" | "full";
|
|
12
|
-
export type Sizes = "xs" | "sm" | "md" | "lg" | "xl" | "
|
|
12
|
+
export type Sizes = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
13
|
+
export type DrawerSizes = Sizes | "3xl" | "4xl" | "5xl" | "6xl" | "full";
|
|
13
14
|
export type Icon = {
|
|
14
15
|
element: React.JSX.Element;
|
|
15
16
|
position?: "start" | "end";
|
package/package.json
CHANGED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
& {
|
|
2
|
-
&.xx-small {
|
|
3
|
-
font-size: 0.8rem; /* 12.8px (0.8 * 16) */
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
&.x-small {
|
|
7
|
-
font-size: 1rem; /* 16px */
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
&.small {
|
|
11
|
-
font-size: 1.3rem; /* 20.8px (1.3 * 16) */
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
&.medium {
|
|
15
|
-
font-size: 1.6rem; /* 25.6px (1.6 * 16) */
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
&.large {
|
|
19
|
-
font-size: 2rem; /* 32px (2 * 16) */
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
&.x-large {
|
|
23
|
-
font-size: 2.5rem; /* 40px (2.5 * 16) */
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&.xx-large {
|
|
27
|
-
font-size: 3rem; /* 48px (3 * 16) */
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&.xxx-large {
|
|
31
|
-
font-size: 4rem; /* 64px (4 * 16) */
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&.smaller {
|
|
35
|
-
font-size: smaller;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
&.larger {
|
|
39
|
-
font-size: larger;
|
|
40
|
-
}
|
|
41
|
-
}
|