ar-design 0.2.84 → 0.2.86

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,15 +1,13 @@
1
1
  import React from "react";
2
- import Typography from "../typography";
3
2
  import "../../../assets/css/components/data-display/card/styles.css";
4
3
  import Utils from "../../../libs/infrastructure/shared/Utils";
5
- const { Title } = Typography;
6
- const Card = ({ children, title = "", actions, status }) => {
4
+ const Card = ({ children, title, actions, variant = "filled", status }) => {
7
5
  // variables
8
- const _titleClassName = ["title"];
9
- _titleClassName.push(...Utils.GetClassName(undefined, status, undefined, undefined, undefined, undefined, undefined));
10
- return (React.createElement("div", { className: "ar-card" },
11
- title && (React.createElement("div", { className: _titleClassName.map((c) => c).join(" ") },
12
- React.createElement(Title, { Level: "h4" }, title),
6
+ const _className = ["ar-card"];
7
+ _className.push(...Utils.GetClassName(variant, status, undefined, undefined, undefined, undefined, undefined));
8
+ return (React.createElement("div", { className: _className.map((c) => c).join(" ") },
9
+ title && (React.createElement("div", { className: "title" },
10
+ React.createElement("h4", null, title),
13
11
  React.createElement("div", null, actions))),
14
12
  React.createElement("div", { className: "content" }, children)));
15
13
  };
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import "../../../assets/css/components/feedback/alert/alert.css";
2
+ import "../../../assets/css/components/feedback/alert/styles.css";
3
3
  import IProps from "./IProps";
4
4
  declare const Alert: React.FC<IProps>;
5
5
  export default Alert;
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import React from "react";
3
- import "../../../assets/css/components/feedback/alert/alert.css";
3
+ import "../../../assets/css/components/feedback/alert/styles.css";
4
4
  import Utils from "../../../libs/infrastructure/shared/Utils";
5
5
  const Alert = ({ children, message, variant = "filled", status = "primary", border = { radius: "sm" }, emphasize, }) => {
6
6
  const _className = ["ar-alert"];
@@ -2,17 +2,17 @@
2
2
  import Utils from "../../../libs/infrastructure/shared/Utils";
3
3
  import React, { forwardRef, useRef } from "react";
4
4
  import "../../../assets/css/components/form/checkbox/checkbox.css";
5
- const Checkbox = forwardRef(({ label, size = "normal", color, border = { radius: "sm" }, upperCase, ...attributes }, ref) => {
5
+ const Checkbox = forwardRef(({ label, size = "normal", color = "blue", border = { radius: "sm" }, upperCase, ...attributes }, ref) => {
6
6
  // refs
7
7
  const _checkbox = useRef(null);
8
8
  const _checkboxClassName = ["ar-checkbox"];
9
- const isChecked = attributes.checked ?? false;
10
- _checkboxClassName.push(...Utils.GetClassName("filled", undefined, isChecked ? color : "light", border, size, undefined, attributes.className));
9
+ _checkboxClassName.push(...Utils.GetClassName("filled", undefined, attributes.checked ? color : "light", border, size, undefined, attributes.className));
11
10
  return (React.createElement("div", { className: "ar-checkbox-wrapper" },
12
11
  React.createElement("label", null,
13
12
  React.createElement("input", { ref: ref, type: "checkbox", ...attributes, size: 0, onChange: (event) => {
14
13
  // (() => {
15
- // attributes.onChange?.(event);
14
+ // const _current = _checkbox.current;
15
+ // if (!_current) return;
16
16
  // })();
17
17
  (() => attributes.onChange && attributes.onChange(event))();
18
18
  } }),
@@ -1,6 +1,6 @@
1
- import { IBorder, IColors, IIcon, ISize, IStatus, IUpperCase, IValidation, IVariant } from "../../../libs/types/IGlobalProps";
1
+ import { IBorder, IColors, IIcon, ISize, IUpperCase, IValidation, IVariant } from "../../../libs/types/IGlobalProps";
2
2
  import { Status } from "../../../libs/types";
3
- interface IProps extends IVariant, IStatus, IColors, IBorder, IIcon, ISize, IUpperCase, IValidation, Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "size" | "color"> {
3
+ interface IProps extends IVariant, IColors, IBorder, IIcon, ISize, IUpperCase, IValidation, Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "size" | "color"> {
4
4
  /**
5
5
  * Bileşenin başlığı veya etiket metnidir.
6
6
  *
@@ -2,12 +2,12 @@
2
2
  import React, { forwardRef, useRef } from "react";
3
3
  import "../../../assets/css/components/form/radio/radio.css";
4
4
  import Utils from "../../../libs/infrastructure/shared/Utils";
5
- const Radio = forwardRef(({ label, size = "normal", status, color, border = { radius: "sm" }, trace, upperCase, ...attributes }, ref) => {
5
+ const Radio = forwardRef(({ label, size = "normal", color = "blue", border = { radius: "pill" }, trace, upperCase, ...attributes }, ref) => {
6
6
  // refs
7
7
  const _checkbox = useRef(null);
8
8
  const _checkboxClassName = ["ar-radio"];
9
9
  const _traceClassName = ["trace", "filled"];
10
- _checkboxClassName.push(...Utils.GetClassName("filled", status, color, border, size, undefined, attributes.className));
10
+ _checkboxClassName.push(...Utils.GetClassName("filled", undefined, attributes.checked ? color : "light", border, size, undefined, attributes.className));
11
11
  if (trace && Object.keys(trace).length > 0)
12
12
  _traceClassName.push(trace.color);
13
13
  return (React.createElement("div", { className: "ar-radio-wrapper" },
@@ -42,7 +42,7 @@ export interface IVariant<T extends {
42
42
  * <Component variant="filled">Hello, World!</Component>
43
43
  * ```
44
44
  */
45
- variant?: T["component"] extends "alert" ? Exclude<Variants, "outlined" | "borderless"> : Variants;
45
+ variant?: T["component"] extends "alert" ? Exclude<Variants, "outlined" | "borderless"> : T["component"] extends "card" ? Exclude<Variants, "dashed" | "borderless"> : Variants;
46
46
  }
47
47
  export interface IStatus<T extends {
48
48
  component?: string;
@@ -56,7 +56,7 @@ export interface IStatus<T extends {
56
56
  * <Component status="success">Hello, World!</Component>
57
57
  * ```
58
58
  */
59
- status?: T["component"] extends "alert" ? Exclude<Status, "primary-light" | "secondary" | "information" | "dark" | "light"> : Status;
59
+ status?: T["component"] extends "alert" ? Exclude<Status, "primary-light" | "secondary" | "information" | "dark" | "light"> : T["component"] extends "card" ? Exclude<Status, "primary-light" | "secondary" | "information" | "dark" | "light"> : Status;
60
60
  }
61
61
  export interface IColors {
62
62
  /**
@@ -71,7 +71,7 @@ export type Errors<TData> = Partial<{
71
71
  export type MimeTypes = "image/jpeg" | "image/png" | "image/gif" | "image/webp" | "image/svg+xml" | "image/bmp" | "image/tiff" | "application/pdf" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/zip" | "application/x-rar-compressed" | "application/x-7z-compressed" | "application/gzip" | "application/json" | "application/xml" | "text/plain" | "text/csv" | "text/html" | "video/mp4" | "video/quicktime" | "video/x-msvideo" | "video/x-matroska" | "video/webm" | "video/x-flv" | "audio/mpeg" | "audio/wav" | "audio/ogg" | "audio/aac" | "audio/flac" | "application/octet-stream";
72
72
  export type FileCategory = "image" | "document" | "spreadsheet" | "presentation" | "archive" | "text" | "video" | "audio" | "json" | "xml" | "binary" | "other";
73
73
  export type IconVariants = "linear" | "fill";
74
- export type Icons = "Add" | "ArrowLeft" | "ArrowRight" | "Bold" | "BulletList" | "CameraReels" | "CheckAll" | "CloseCircle" | "CloseSquare" | "CloudUpload" | "Document" | "Download" | "Drive" | "ExclamationCircle" | "ExclamationDiamond" | "Eye" | "File" | "FileEarmark" | "FileTypeCsv" | "FileTypeDoc" | "FileTypeDocx" | "FileTypeHtml" | "FileTypeJson" | "FileTypePdf" | "FileTypePptx" | "FileTypeTxt" | "FileTypeXls" | "FileTypeXlsx" | "FileTypeXml" | "FileTypeZip" | "Filter" | "Folder" | "Image" | "Import" | "Italic" | "NumberList" | "Strikethrough" | "TextAlingCenter" | "TextAlingLeft" | "TextAlingRight" | "TickCircle" | "Trash" | "Underline" | "Upload" | "Warning" | "XCircle";
74
+ export type Icons = "Add" | "ArrowLeft" | "ArrowRight" | "Bold" | "BulletList" | "CameraReels" | "CheckAll" | "CloseCircle" | "CloseSquare" | "CloudUpload" | "Document" | "Download" | "ExclamationCircle" | "ExclamationDiamond" | "Eye" | "File" | "FileEarmark" | "FileTypeCsv" | "FileTypeDoc" | "FileTypeDocx" | "FileTypeHtml" | "FileTypeJson" | "FileTypePdf" | "FileTypePptx" | "FileTypeTxt" | "FileTypeXls" | "FileTypeXlsx" | "FileTypeXml" | "FileTypeZip" | "Filter" | "Folder" | "Import" | "Italic" | "NumberList" | "Strikethrough" | "TextAlingCenter" | "TextAlingLeft" | "TextAlingRight" | "TickCircle" | "Trash" | "Underline" | "Upload" | "Warning" | "XCircle";
75
75
  export type PieChartDataType = {
76
76
  value: number;
77
77
  text: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ar-design",
3
- "version": "0.2.84",
3
+ "version": "0.2.86",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1,206 +0,0 @@
1
- /* #region PRIMARY */
2
- .filled {
3
- &.primary {
4
- background-color: var(--blue-100);
5
- color: var(--blue-700);
6
- }
7
- }
8
- .surface {
9
- &.primary {
10
- background-color: var(--blue-100);
11
- border: solid 1px var(--blue-300);
12
- color: var(--blue-700);
13
- }
14
- }
15
- .dashed {
16
- &.primary {
17
- border: dashed 1px var(--blue-300);
18
- color: var(--blue-700);
19
- }
20
- }
21
- /* #endregion */
22
- /* PRIMARY */
23
-
24
- /* #region PRIMARY-LIGHT */
25
- .filled {
26
- &.primary-light {
27
- background-color: var(--blue-100);
28
- color: var(--blue-700);
29
- }
30
- }
31
- .surface {
32
- &.primary-light {
33
- background-color: var(--blue-100);
34
- border: solid 1px var(--blue-300);
35
- color: var(--blue-700);
36
- }
37
- }
38
- .dashed {
39
- &.primary-light {
40
- border: dashed 1px var(--blue-300);
41
- color: var(--blue-700);
42
- }
43
- }
44
- /* #endregion */
45
- /* PRIMARY-LIGHT */
46
-
47
- /* #region SECONDARY */
48
- .filled {
49
- &.secondary {
50
- background-color: var(--blue-100);
51
- color: var(--blue-700);
52
- }
53
- }
54
- .surface {
55
- &.secondary {
56
- background-color: var(--blue-100);
57
- border: solid 1px var(--blue-300);
58
- color: var(--blue-700);
59
- }
60
- }
61
- .dashed {
62
- &.secondary {
63
- border: dashed 1px var(--blue-300);
64
- color: var(--blue-700);
65
- }
66
- }
67
- /* #endregion */
68
- /* SECONDARY */
69
-
70
- /* #region SUCCESS */
71
- .filled {
72
- &.success {
73
- background-color: var(--green-100);
74
- color: var(--green-700);
75
- }
76
- }
77
- .surface {
78
- &.success {
79
- background-color: var(--green-100);
80
- border: solid 1px var(--green-300);
81
- color: var(--green-700);
82
- }
83
- }
84
- .dashed {
85
- &.success {
86
- border: dashed 1px var(--green-300);
87
- color: var(--green-700);
88
- }
89
- }
90
- /* #endregion */
91
- /* SUCCESS */
92
-
93
- /* #region WARNING */
94
- .filled {
95
- &.warning {
96
- background-color: var(--orange-100);
97
- color: var(--orange-700);
98
- }
99
- }
100
- .surface {
101
- &.warning {
102
- background-color: var(--orange-100);
103
- border: solid 1px var(--orange-300);
104
- color: var(--orange-700);
105
- }
106
- }
107
- .dashed {
108
- &.warning {
109
- border: dashed 1px var(--orange-300);
110
- color: var(--orange-700);
111
- }
112
- }
113
- /* #endregion */
114
- /* WARNING */
115
-
116
- /* #region DANGER */
117
- .filled {
118
- &.danger {
119
- background-color: var(--red-100);
120
- color: var(--red-700);
121
- }
122
- }
123
- .surface {
124
- &.danger {
125
- background-color: var(--red-100);
126
- border: solid 1px var(--red-300);
127
- color: var(--red-700);
128
- }
129
- }
130
- .dashed {
131
- &.danger {
132
- border: dashed 1px var(--red-300);
133
- color: var(--red-700);
134
- }
135
- }
136
- /* #endregion */
137
- /* DANGER */
138
-
139
- /* #region INFORMATION */
140
- .filled {
141
- &.information {
142
- background-color: var(--red-100);
143
- color: var(--red-700);
144
- }
145
- }
146
- .surface {
147
- &.information {
148
- background-color: var(--red-100);
149
- border: solid 1px var(--red-300);
150
- color: var(--red-700);
151
- }
152
- }
153
- .dashed {
154
- &.information {
155
- border: dashed 1px var(--red-300);
156
- color: var(--red-700);
157
- }
158
- }
159
- /* #endregion */
160
- /* INFORMATION */
161
-
162
- /* #region DARK */
163
- .filled {
164
- &.dark {
165
- background-color: var(--red-100);
166
- color: var(--red-700);
167
- }
168
- }
169
- .surface {
170
- &.dark {
171
- background-color: var(--red-100);
172
- border: solid 1px var(--red-300);
173
- color: var(--red-700);
174
- }
175
- }
176
- .dashed {
177
- &.dark {
178
- border: dashed 1px var(--red-300);
179
- color: var(--red-700);
180
- }
181
- }
182
- /* #endregion */
183
- /* DARK */
184
-
185
- /* #region LIGHT */
186
- .filled {
187
- &.light {
188
- background-color: var(--red-100);
189
- color: var(--red-700);
190
- }
191
- }
192
- .surface {
193
- &.light {
194
- background-color: var(--red-100);
195
- border: solid 1px var(--red-300);
196
- color: var(--red-700);
197
- }
198
- }
199
- .dashed {
200
- &.light {
201
- border: dashed 1px var(--red-300);
202
- color: var(--red-700);
203
- }
204
- }
205
- /* #endregion */
206
- /* LIGHT */