@tedi-design-system/react 14.4.0-rc.11 → 14.4.0-rc.13
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/_virtual/index.cjs10.js +1 -1
- package/_virtual/index.cjs11.js +1 -1
- package/_virtual/index.cjs12.js +1 -1
- package/_virtual/index.cjs13.js +1 -1
- package/_virtual/index.cjs5.js +1 -1
- package/_virtual/index.cjs6.js +1 -1
- package/_virtual/index.cjs7.js +1 -1
- package/_virtual/index.cjs8.js +1 -1
- package/_virtual/index.cjs9.js +1 -1
- package/_virtual/index.es10.js +1 -1
- package/_virtual/index.es11.js +1 -1
- package/_virtual/index.es12.js +1 -1
- package/_virtual/index.es13.js +2 -4
- package/_virtual/index.es14.js +2 -2
- package/_virtual/index.es5.js +4 -2
- package/_virtual/index.es6.js +1 -1
- package/_virtual/index.es7.js +1 -1
- package/_virtual/index.es8.js +1 -1
- package/_virtual/index.es9.js +1 -1
- package/bundle-stats.html +1 -1
- package/external/@mui/system/colorManipulator.cjs.js +1 -1
- package/external/@mui/system/colorManipulator.es.js +2 -2
- package/external/@mui/system/createStyled.cjs.js +1 -1
- package/external/@mui/system/createStyled.es.js +6 -6
- package/external/@mui/system/useThemeWithoutDefault.cjs.js +1 -1
- package/external/@mui/system/useThemeWithoutDefault.es.js +1 -1
- package/external/react-is/index.cjs.js +1 -1
- package/external/react-is/index.es.js +1 -1
- package/external/toposort/index.cjs.js +1 -1
- package/external/toposort/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/tedi/components/form/radio/radio.cjs.js +1 -1
- package/src/tedi/components/form/radio/radio.es.js +42 -41
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),c=require("../../../../../external/classnames/index.cjs.js"),n=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),c=require("../../../../../external/classnames/index.cjs.js"),n=require("react"),I=require("../feedback-text/feedback-text.cjs.js"),S=require("../form-label/form-label.cjs.js"),a=require("./radio.module.scss.cjs.js"),T=require("../../layout/grid/row.cjs.js"),x=require("../../layout/grid/col.cjs.js"),j=k=>{const{id:i,label:o,value:u,className:g,disabled:f,onChange:t,hideLabel:q,helper:r,checked:l,defaultChecked:C,hover:N,name:R,tooltip:h,size:b="default",invalid:y,...w}=k,[m,L]=n.useState(C||!1),s=n.useRef(null),M=n.useMemo(()=>t&&typeof l<"u"?l:m,[t,m,l]),v=d=>{typeof l>"u"&&L(d==null?void 0:d.target.checked),t==null||t(u,d==null?void 0:d.target.checked)},_=r?r.id??`${i}-helper`:void 0,F=h?`${i}-tooltip`:void 0,p=c.default(a.default["tedi-radio"],{[a.default["tedi-radio--disabled"]]:f});return e.jsxs("div",{"data-name":"radio",...w,children:[e.jsxs(T.Row,{gutter:0,children:[e.jsx(x.Col,{width:"auto",children:e.jsxs("div",{className:a.default["tedi-radio__outer-indicator-wrapper"],children:[e.jsx("input",{id:i,value:u,name:R,type:"radio",disabled:f,checked:M,onChange:v,className:a.default["tedi-radio__input"],"aria-describedby":[_,F].filter(Boolean).join(" ")}),e.jsx("div",{"aria-hidden":"true",onClick:()=>{var d;return(d=s.current)==null?void 0:d.click()},className:c.default(a.default["tedi-radio__indicator"],{[a.default["tedi-radio__indicator--hover"]]:N},{[a.default[`tedi-radio__indicator--size-${b}`]]:b},{[a.default["tedi-radio__indicator--invalid"]]:y},g),"data-testid":"radio-indicator"})]})}),e.jsx(x.Col,{children:o&&typeof o=="string"?e.jsx(S.FormLabel,{ref:s,className:p,id:i,"data-testid":"radio-label",hideLabel:q,label:o,tooltip:h}):e.jsx("label",{ref:s,htmlFor:i,className:p,"data-testid":"radio-label",children:o})})]}),r&&e.jsx(I.FeedbackText,{id:_,...r,className:c.default(a.default["tedi-radio__helper"],r.className)})]})};exports.Radio=j;exports.default=j;
|
|
@@ -1,46 +1,47 @@
|
|
|
1
1
|
import { jsxs as s, jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import n from "../../../../../external/classnames/index.es.js";
|
|
3
3
|
import m from "react";
|
|
4
|
-
import { FeedbackText as
|
|
5
|
-
import { FormLabel as
|
|
4
|
+
import { FeedbackText as B } from "../feedback-text/feedback-text.es.js";
|
|
5
|
+
import { FormLabel as M } from "../form-label/form-label.es.js";
|
|
6
6
|
import i from "./radio.module.scss.es.js";
|
|
7
|
-
import { Row as
|
|
8
|
-
import { Col as
|
|
9
|
-
const
|
|
7
|
+
import { Row as v } from "../../layout/grid/row.es.js";
|
|
8
|
+
import { Col as N } from "../../layout/grid/col.es.js";
|
|
9
|
+
const J = (C) => {
|
|
10
10
|
const {
|
|
11
|
-
id:
|
|
11
|
+
id: a,
|
|
12
12
|
label: o,
|
|
13
|
-
value:
|
|
14
|
-
className:
|
|
15
|
-
disabled:
|
|
13
|
+
value: h,
|
|
14
|
+
className: g,
|
|
15
|
+
disabled: f,
|
|
16
16
|
onChange: r,
|
|
17
|
-
hideLabel:
|
|
18
|
-
helper:
|
|
17
|
+
hideLabel: y,
|
|
18
|
+
helper: t,
|
|
19
19
|
checked: l,
|
|
20
|
-
defaultChecked:
|
|
21
|
-
hover:
|
|
22
|
-
name:
|
|
23
|
-
tooltip:
|
|
24
|
-
size:
|
|
20
|
+
defaultChecked: R,
|
|
21
|
+
hover: x,
|
|
22
|
+
name: j,
|
|
23
|
+
tooltip: p,
|
|
24
|
+
size: u = "default",
|
|
25
25
|
invalid: w,
|
|
26
26
|
...F
|
|
27
|
-
} =
|
|
28
|
-
typeof l > "u" &&
|
|
29
|
-
},
|
|
27
|
+
} = C, [_, I] = m.useState(R || !1), c = m.useRef(null), L = m.useMemo(() => r && typeof l < "u" ? l : _, [r, _, l]), $ = (e) => {
|
|
28
|
+
typeof l > "u" && I(e == null ? void 0 : e.target.checked), r == null || r(h, e == null ? void 0 : e.target.checked);
|
|
29
|
+
}, b = t ? t.id ?? `${a}-helper` : void 0, z = p ? `${a}-tooltip` : void 0, k = n(i["tedi-radio"], { [i["tedi-radio--disabled"]]: f });
|
|
30
30
|
return /* @__PURE__ */ s("div", { "data-name": "radio", ...F, children: [
|
|
31
|
-
/* @__PURE__ */ s(
|
|
32
|
-
/* @__PURE__ */ d(
|
|
31
|
+
/* @__PURE__ */ s(v, { gutter: 0, children: [
|
|
32
|
+
/* @__PURE__ */ d(N, { width: "auto", children: /* @__PURE__ */ s("div", { className: i["tedi-radio__outer-indicator-wrapper"], children: [
|
|
33
33
|
/* @__PURE__ */ d(
|
|
34
34
|
"input",
|
|
35
35
|
{
|
|
36
|
-
id:
|
|
37
|
-
value:
|
|
38
|
-
name:
|
|
36
|
+
id: a,
|
|
37
|
+
value: h,
|
|
38
|
+
name: j,
|
|
39
39
|
type: "radio",
|
|
40
|
-
disabled:
|
|
41
|
-
checked:
|
|
42
|
-
onChange:
|
|
43
|
-
className: i["tedi-radio__input"]
|
|
40
|
+
disabled: f,
|
|
41
|
+
checked: L,
|
|
42
|
+
onChange: $,
|
|
43
|
+
className: i["tedi-radio__input"],
|
|
44
|
+
"aria-describedby": [b, z].filter(Boolean).join(" ")
|
|
44
45
|
}
|
|
45
46
|
),
|
|
46
47
|
/* @__PURE__ */ d(
|
|
@@ -53,32 +54,32 @@ const G = (k) => {
|
|
|
53
54
|
},
|
|
54
55
|
className: n(
|
|
55
56
|
i["tedi-radio__indicator"],
|
|
56
|
-
{ [i["tedi-radio__indicator--hover"]]:
|
|
57
|
-
{ [i[`tedi-radio__indicator--size-${
|
|
57
|
+
{ [i["tedi-radio__indicator--hover"]]: x },
|
|
58
|
+
{ [i[`tedi-radio__indicator--size-${u}`]]: u },
|
|
58
59
|
{ [i["tedi-radio__indicator--invalid"]]: w },
|
|
59
|
-
|
|
60
|
+
g
|
|
60
61
|
),
|
|
61
62
|
"data-testid": "radio-indicator"
|
|
62
63
|
}
|
|
63
64
|
)
|
|
64
65
|
] }) }),
|
|
65
|
-
/* @__PURE__ */ d(
|
|
66
|
-
|
|
66
|
+
/* @__PURE__ */ d(N, { children: o && typeof o == "string" ? /* @__PURE__ */ d(
|
|
67
|
+
M,
|
|
67
68
|
{
|
|
68
69
|
ref: c,
|
|
69
|
-
className:
|
|
70
|
-
id:
|
|
70
|
+
className: k,
|
|
71
|
+
id: a,
|
|
71
72
|
"data-testid": "radio-label",
|
|
72
|
-
hideLabel:
|
|
73
|
+
hideLabel: y,
|
|
73
74
|
label: o,
|
|
74
|
-
tooltip:
|
|
75
|
+
tooltip: p
|
|
75
76
|
}
|
|
76
|
-
) : /* @__PURE__ */ d("label", { ref: c, htmlFor:
|
|
77
|
+
) : /* @__PURE__ */ d("label", { ref: c, htmlFor: a, className: k, "data-testid": "radio-label", children: o }) })
|
|
77
78
|
] }),
|
|
78
|
-
|
|
79
|
+
t && /* @__PURE__ */ d(B, { id: b, ...t, className: n(i["tedi-radio__helper"], t.className) })
|
|
79
80
|
] });
|
|
80
81
|
};
|
|
81
82
|
export {
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
J as Radio,
|
|
84
|
+
J as default
|
|
84
85
|
};
|