ar-design 0.2.87 → 0.2.89

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.
@@ -23,12 +23,12 @@
23
23
  flex-direction: column;
24
24
  row-gap: 0.5rem;
25
25
  }
26
- .ar-table > .header > .title > h3 {
26
+ .ar-table > .header > .title > h4 {
27
27
  color: var(--gray-700);
28
- /* -webkit-text-stroke: 0.25px var(--gray-700); */
29
28
  }
30
29
  .ar-table > .header > .title > h5 {
31
- color: var(--gray-600);
30
+ color: var(--gray-400);
31
+ font-weight: normal !important;
32
32
  }
33
33
  .ar-table > .header > .actions {
34
34
  display: flex;
@@ -15,7 +15,7 @@
15
15
  gap: 1rem;
16
16
  height: 100%;
17
17
  padding: 0 0.75rem;
18
- font-weight: 900;
18
+ color: var(--gray-700);
19
19
  cursor: pointer;
20
20
  }
21
21
  .ar-tabs > .tabs > .item > .close-button {
@@ -4,7 +4,7 @@
4
4
  padding: 0 0.75rem;
5
5
  color: var(--gray-600);
6
6
  font-size: 0.9rem;
7
- font-weight: 600;
7
+ font-weight: 400;
8
8
  line-height: var(--input-height);
9
9
  user-select: none;
10
10
  cursor: no-drop;
@@ -42,7 +42,7 @@
42
42
  .ar-input-wrapper > .ar-input > .validation {
43
43
  color: var(--danger);
44
44
  font-size: 0.8rem;
45
- font-weight: 600;
45
+ font-weight: 400;
46
46
  }
47
47
 
48
48
  /* Core Css */
@@ -105,7 +105,7 @@
105
105
  .ar-select-wrapper > .ar-select > .validation {
106
106
  color: var(--danger);
107
107
  font-size: 0.8rem;
108
- font-weight: 600;
108
+ font-weight: 400;
109
109
  }
110
110
 
111
111
  @import url("./options.css");
@@ -47,7 +47,7 @@
47
47
  .ar-text-editor > .validation {
48
48
  color: var(--danger);
49
49
  font-size: 0.8rem;
50
- font-weight: 600;
50
+ font-weight: 400;
51
51
  }
52
52
 
53
53
  .ar-text-editor--block-item {
@@ -1,5 +1,3 @@
1
- .ar-pagination {
2
- }
3
1
  .ar-pagination > ul {
4
2
  display: flex;
5
3
  flex-direction: row;
@@ -17,7 +15,7 @@
17
15
  box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.1);
18
16
  transform: scale(1);
19
17
  color: var(--gray-700);
20
- font-weight: 600;
18
+ font-weight: 400;
21
19
  cursor: pointer;
22
20
  user-select: none;
23
21
  }
@@ -45,10 +43,7 @@
45
43
  .ar-pagination > ul > li:is(:nth-last-child(2)) {
46
44
  margin-left: 1rem;
47
45
  }
48
- .ar-pagination
49
- > ul
50
- > li:is(:nth-child(1), :nth-child(2), :nth-last-child(1), :nth-last-child(2))
51
- > span {
46
+ .ar-pagination > ul > li:is(:nth-child(1), :nth-child(2), :nth-last-child(1), :nth-last-child(2)) > span {
52
47
  position: relative;
53
48
  top: -2px;
54
49
  font-size: 1.5rem;
@@ -396,8 +396,8 @@ iframe.outlined:not(.disabled),
396
396
 
397
397
  &:focus,
398
398
  &.focused {
399
- border-color: var(--light-300);
400
- box-shadow: 0 0 0 3.5px var(--light-100);
399
+ border-color: var(--gray-400);
400
+ box-shadow: 0 0 0 3.5px var(--gray-100);
401
401
  }
402
402
  }
403
403
  }
@@ -493,7 +493,7 @@ const Table = forwardRef(({ children, title, description, data, columns, actions
493
493
  return (React.createElement("div", { ref: _tableWrapper, className: _tableClassName.map((c) => c).join(" ") },
494
494
  (title || description || actions || React.Children.count(children) > 0) && (React.createElement("div", { className: "header" },
495
495
  React.createElement("div", { className: "title" },
496
- React.createElement("h3", null, title),
496
+ React.createElement("h4", null, title),
497
497
  description && React.createElement("h5", null, description)),
498
498
  React.createElement("div", { className: "actions" }, actions && (React.createElement(React.Fragment, null,
499
499
  actions.import && (React.createElement(Popover, { title: "\u0130\u00E7eri Aktar", message: "Se\u00E7ti\u011Finiz dosyalar\u0131 uygulamaya y\u00FCkleyebilirsiniz. Bu i\u015Flem, dosyalardaki verileri sistemimize aktar\u0131r ve verilerle i\u015Flem yapman\u0131za olanak tan\u0131r.", content: React.createElement(React.Fragment, null,
@@ -8,56 +8,51 @@ const Tooltip = ({ children, text, direction = "top" }) => {
8
8
  const _children = useRef(null);
9
9
  // states
10
10
  const [mouseEnter, setMouseEnter] = useState(false);
11
+ const [_direction, setDirection] = useState(direction);
11
12
  // methods
12
13
  const handlePosition = useCallback(() => {
13
- if (_children.current && _arTooltip.current) {
14
- const childRect = _children.current.getBoundingClientRect();
15
- const tooltipRect = _arTooltip.current.getBoundingClientRect();
16
- if (childRect) {
17
- const sx = window.scrollX || document.documentElement.scrollLeft;
18
- const sy = window.scrollY || document.documentElement.scrollTop;
19
- // Tooltip konumunu ayarlama için ortak bir fonksiyon.
20
- const setTooltipPosition = (top, left) => {
21
- if (!_arTooltip.current)
22
- return;
23
- _arTooltip.current.style.top = `${top + sy}px`;
24
- _arTooltip.current.style.left = `${left + sx}px`;
25
- };
26
- const margin = 17.5;
27
- let top = 0;
28
- let left = 0;
29
- switch (direction) {
30
- case "top":
31
- {
32
- top = childRect.top - tooltipRect.height - margin;
33
- left = childRect.left + childRect.width / 2 - tooltipRect.width / 2;
34
- setTooltipPosition(top, left);
35
- }
36
- break;
37
- case "right":
38
- {
39
- top = childRect.top + childRect.height / 2 - tooltipRect.height / 2;
40
- left = childRect.right + margin;
41
- setTooltipPosition(top, left);
42
- }
43
- break;
44
- case "bottom":
45
- {
46
- top = childRect.bottom + margin;
47
- left = childRect.left + childRect.width / 2 - tooltipRect.width / 2;
48
- setTooltipPosition(top, left);
49
- }
50
- break;
51
- case "left":
52
- {
53
- top = childRect.top + childRect.height / 2 - tooltipRect.height / 2;
54
- left = childRect.left - tooltipRect.width - margin;
55
- setTooltipPosition(top, left);
56
- }
57
- break;
58
- }
14
+ const child = _children.current;
15
+ const tooltip = _arTooltip.current;
16
+ if (!child || !tooltip)
17
+ return;
18
+ const margin = 17.5;
19
+ const windowWidth = window.innerWidth;
20
+ const screenCenterX = windowWidth / 2;
21
+ const childRect = child.getBoundingClientRect();
22
+ const tooltipRect = tooltip.getBoundingClientRect();
23
+ const isOnRight = childRect.left > screenCenterX;
24
+ const coordinate = isOnRight ? childRect.right + tooltipRect.width / 2 : childRect.left + tooltipRect.width;
25
+ if (direction === "top" || direction === "bottom") {
26
+ if (isOnRight && coordinate > windowWidth) {
27
+ direction = "left";
59
28
  }
29
+ else if (!isOnRight && coordinate < windowWidth) {
30
+ direction = "right";
31
+ }
32
+ }
33
+ let top = 0;
34
+ let left = 0;
35
+ switch (direction) {
36
+ case "top":
37
+ top = childRect.top - tooltipRect.height - margin;
38
+ left = childRect.left + childRect.width / 2 - tooltipRect.width / 2;
39
+ break;
40
+ case "right":
41
+ top = childRect.top + childRect.height / 2 - tooltipRect.height / 2;
42
+ left = childRect.right + margin;
43
+ break;
44
+ case "bottom":
45
+ top = childRect.bottom + margin;
46
+ left = childRect.left + childRect.width / 2 - tooltipRect.width / 2;
47
+ break;
48
+ case "left":
49
+ top = childRect.top + childRect.height / 2 - tooltipRect.height / 2;
50
+ left = childRect.left - tooltipRect.width - margin;
51
+ break;
60
52
  }
53
+ tooltip.style.top = `${top}px`;
54
+ tooltip.style.left = `${left}px`;
55
+ setDirection(direction);
61
56
  }, []);
62
57
  //useEffects
63
58
  useEffect(() => {
@@ -67,7 +62,7 @@ const Tooltip = ({ children, text, direction = "top" }) => {
67
62
  return (React.createElement("div", { className: "ar-tooltip-wrapper" },
68
63
  React.createElement("div", { ref: _children, onMouseEnter: () => setMouseEnter(true), onMouseLeave: () => setMouseEnter(false) }, children),
69
64
  mouseEnter &&
70
- ReactDOM.createPortal(React.createElement("div", { ref: _arTooltip, className: `ar-tooltip ${direction}` }, Array.isArray(text) ? (text.map((t) => (React.createElement("span", { className: "text" },
65
+ ReactDOM.createPortal(React.createElement("div", { ref: _arTooltip, className: `ar-tooltip ${_direction}` }, Array.isArray(text) ? (text.map((t) => (React.createElement("span", { className: "text" },
71
66
  React.createElement("span", { className: "bullet" }, "\u2022"),
72
67
  React.createElement("span", null, t))))) : (React.createElement("span", { className: "text" }, text))), document.body)));
73
68
  };
@@ -1,7 +1,9 @@
1
+ import { Color } from "../../../libs/types";
1
2
  interface IProps {
2
3
  buttons: {
3
4
  text: string;
4
5
  onClick: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
6
+ color?: Color;
5
7
  }[];
6
8
  }
7
9
  export default IProps;
@@ -60,9 +60,9 @@ const ButtonAction = ({ buttons }) => {
60
60
  }, [open]);
61
61
  return (React.createElement("div", { ref: _wrapper, className: "ar-button-action" },
62
62
  React.createElement("span", { ref: _button },
63
- React.createElement(Button, { variant: "borderless", color: "teal", border: { radius: "none" }, icon: { element: React.createElement("span", { className: "dotted" }) }, onClick: () => setOpen((prev) => !prev) })),
63
+ React.createElement(Button, { variant: "surface", color: "gray", icon: { element: React.createElement("span", { className: "dotted" }) }, onClick: () => setOpen((prev) => !prev) })),
64
64
  open &&
65
- ReactDOM.createPortal(React.createElement("span", { ref: _list, className: "ar-action-buttons" }, buttons.map((button) => (React.createElement(Button, { variant: "borderless", onClick: button.onClick }, button.text)))), document.body)));
65
+ ReactDOM.createPortal(React.createElement("span", { ref: _list, className: "ar-action-buttons" }, buttons.map((button) => (React.createElement(Button, { variant: "borderless", color: button.color ?? "blue", onClick: button.onClick }, button.text)))), document.body)));
66
66
  };
67
67
  ButtonAction.displayName = "ButtonAction";
68
68
  export default ButtonAction;
@@ -249,7 +249,7 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
249
249
  attributes.placeholder && attributes.placeholder.length > 0 && (React.createElement("label", null,
250
250
  validation ? "* " : "",
251
251
  attributes.placeholder)),
252
- React.createElement(Input, { ref: _beginDate, value: DATE.ParseValue(String(attributes.value), isClock), type: isClock ? "datetime-local" : "date", ...attributes, onKeyDown: (event) => {
252
+ React.createElement(Input, { ref: _beginDate, ...attributes, value: DATE.ParseValue(String(attributes.value), isClock), type: isClock ? "datetime-local" : "date", onKeyDown: (event) => {
253
253
  if (event.code === "Space")
254
254
  event.preventDefault();
255
255
  else if (event.code === "Enter")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ar-design",
3
- "version": "0.2.87",
3
+ "version": "0.2.89",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",