ar-design 0.2.96 → 0.2.97

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.
@@ -47,6 +47,18 @@
47
47
  border-radius: var(--border-radius-pill);
48
48
  z-index: 1;
49
49
  }
50
+ .ar-radio-wrapper > label > span > .past-trace {
51
+ position: absolute;
52
+ top: 50%;
53
+ left: 50%;
54
+ transform: translate(-50%, -50%);
55
+ display: inline-block;
56
+ content: "";
57
+ width: 1rem;
58
+ height: 1rem;
59
+ border-radius: var(--border-radius-pill);
60
+ z-index: 1;
61
+ }
50
62
 
51
63
  .ar-radio-wrapper > label > .validation {
52
64
  color: var(--danger);
@@ -27,5 +27,8 @@ interface IProps extends IVariant, IColors, IBorder, IIcon, ISize, IUpperCase, I
27
27
  trace?: {
28
28
  color: Color;
29
29
  };
30
+ pastTrace?: {
31
+ color: Color;
32
+ };
30
33
  }
31
34
  export default IProps;
@@ -2,14 +2,17 @@
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", color = "blue", border = { radius: "pill" }, trace, upperCase, validation, ...attributes }, ref) => {
5
+ const Radio = forwardRef(({ label, size = "normal", color = "blue", border = { radius: "pill" }, trace, pastTrace, upperCase, validation, ...attributes }, ref) => {
6
6
  // refs
7
7
  const _checkbox = useRef(null);
8
8
  const _checkboxClassName = ["ar-radio"];
9
9
  const _traceClassName = ["trace", "filled"];
10
+ const _pastTraceClassName = ["past-trace", "filled"];
10
11
  _checkboxClassName.push(...Utils.GetClassName("filled", undefined, attributes.checked ? color : "light", border, size, undefined, attributes.className));
11
12
  if (trace && Object.keys(trace).length > 0)
12
13
  _traceClassName.push(trace.color);
14
+ if (pastTrace && Object.keys(pastTrace).length > 0)
15
+ _pastTraceClassName.push(pastTrace.color);
13
16
  return (React.createElement("div", { className: "ar-radio-wrapper" },
14
17
  React.createElement("label", null,
15
18
  React.createElement("input", { ref: ref, type: "radio", ...attributes, size: 0, onChange: (event) => {
@@ -23,6 +26,7 @@ const Radio = forwardRef(({ label, size = "normal", color = "blue", border = { r
23
26
  React.createElement("span", null,
24
27
  React.createElement("span", { ref: _checkbox, className: _checkboxClassName.map((c) => c).join(" ") }),
25
28
  trace && Object.keys(trace).length > 0 && (React.createElement("span", { className: _traceClassName.map((c) => c).join(" ") })),
29
+ pastTrace && Object.keys(pastTrace).length > 0 && (React.createElement("span", { className: _pastTraceClassName.map((c) => c).join(" ") })),
26
30
  label && React.createElement("span", { className: "label" }, upperCase ? label.toUpperCase() : label)),
27
31
  validation?.text && React.createElement("span", { className: "validation" }, validation.text))));
28
32
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ar-design",
3
- "version": "0.2.96",
3
+ "version": "0.2.97",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",