@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tedi-design-system/react",
3
- "version": "14.4.0-rc.11",
3
+ "version": "14.4.0-rc.13",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "exports": {
@@ -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"),S=require("../feedback-text/feedback-text.cjs.js"),T=require("../form-label/form-label.cjs.js"),a=require("./radio.module.scss.cjs.js"),v=require("../../layout/grid/row.cjs.js"),b=require("../../layout/grid/col.cjs.js"),x=j=>{const{id:r,label:l,value:u,className:k,disabled:f,onChange:t,hideLabel:p,helper:i,checked:o,defaultChecked:g,hover:q,name:C,tooltip:N,size:h="default",invalid:R,...y}=j,[m,w]=n.useState(g||!1),s=n.useRef(null),L=n.useMemo(()=>t&&typeof o<"u"?o:m,[t,m,o]),M=d=>{typeof o>"u"&&w(d==null?void 0:d.target.checked),t==null||t(u,d==null?void 0:d.target.checked)},F=i?(i==null?void 0:i.id)??`${r}-helper`:void 0,_=c.default(a.default["tedi-radio"],{[a.default["tedi-radio--disabled"]]:f});return e.jsxs("div",{"data-name":"radio",...y,children:[e.jsxs(v.Row,{gutter:0,children:[e.jsx(b.Col,{width:"auto",children:e.jsxs("div",{className:a.default["tedi-radio__outer-indicator-wrapper"],children:[e.jsx("input",{id:r,value:u,name:C,type:"radio",disabled:f,checked:L,onChange:M,className:a.default["tedi-radio__input"]}),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"]]:q},{[a.default[`tedi-radio__indicator--size-${h}`]]:h},{[a.default["tedi-radio__indicator--invalid"]]:R},k),"data-testid":"radio-indicator"})]})}),e.jsx(b.Col,{children:l&&typeof l=="string"?e.jsx(T.FormLabel,{ref:s,className:_,id:r,"data-testid":"radio-label",hideLabel:p,label:l,tooltip:N}):e.jsx("label",{ref:s,htmlFor:r,className:_,"data-testid":"radio-label",children:l})})]}),i&&e.jsx(S.FeedbackText,{id:F,...i,className:c.default(a.default["tedi-radio__helper"],i.className)})]})};exports.Radio=x;exports.default=x;
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 M } from "../feedback-text/feedback-text.es.js";
5
- import { FormLabel as $ } from "../form-label/form-label.es.js";
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 B } from "../../layout/grid/row.es.js";
8
- import { Col as b } from "../../layout/grid/col.es.js";
9
- const G = (k) => {
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: t,
11
+ id: a,
12
12
  label: o,
13
- value: f,
14
- className: N,
15
- disabled: h,
13
+ value: h,
14
+ className: g,
15
+ disabled: f,
16
16
  onChange: r,
17
- hideLabel: C,
18
- helper: a,
17
+ hideLabel: y,
18
+ helper: t,
19
19
  checked: l,
20
- defaultChecked: g,
21
- hover: y,
22
- name: R,
23
- tooltip: x,
24
- size: p = "default",
20
+ defaultChecked: R,
21
+ hover: x,
22
+ name: j,
23
+ tooltip: p,
24
+ size: u = "default",
25
25
  invalid: w,
26
26
  ...F
27
- } = k, [u, L] = m.useState(g || !1), c = m.useRef(null), j = m.useMemo(() => r && typeof l < "u" ? l : u, [r, u, l]), z = (e) => {
28
- typeof l > "u" && L(e == null ? void 0 : e.target.checked), r == null || r(f, e == null ? void 0 : e.target.checked);
29
- }, I = a ? (a == null ? void 0 : a.id) ?? `${t}-helper` : void 0, _ = n(i["tedi-radio"], { [i["tedi-radio--disabled"]]: h });
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(B, { gutter: 0, children: [
32
- /* @__PURE__ */ d(b, { width: "auto", children: /* @__PURE__ */ s("div", { className: i["tedi-radio__outer-indicator-wrapper"], children: [
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: t,
37
- value: f,
38
- name: R,
36
+ id: a,
37
+ value: h,
38
+ name: j,
39
39
  type: "radio",
40
- disabled: h,
41
- checked: j,
42
- onChange: z,
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"]]: y },
57
- { [i[`tedi-radio__indicator--size-${p}`]]: p },
57
+ { [i["tedi-radio__indicator--hover"]]: x },
58
+ { [i[`tedi-radio__indicator--size-${u}`]]: u },
58
59
  { [i["tedi-radio__indicator--invalid"]]: w },
59
- N
60
+ g
60
61
  ),
61
62
  "data-testid": "radio-indicator"
62
63
  }
63
64
  )
64
65
  ] }) }),
65
- /* @__PURE__ */ d(b, { children: o && typeof o == "string" ? /* @__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: t,
70
+ className: k,
71
+ id: a,
71
72
  "data-testid": "radio-label",
72
- hideLabel: C,
73
+ hideLabel: y,
73
74
  label: o,
74
- tooltip: x
75
+ tooltip: p
75
76
  }
76
- ) : /* @__PURE__ */ d("label", { ref: c, htmlFor: t, className: _, "data-testid": "radio-label", children: o }) })
77
+ ) : /* @__PURE__ */ d("label", { ref: c, htmlFor: a, className: k, "data-testid": "radio-label", children: o }) })
77
78
  ] }),
78
- a && /* @__PURE__ */ d(M, { id: I, ...a, className: n(i["tedi-radio__helper"], a.className) })
79
+ t && /* @__PURE__ */ d(B, { id: b, ...t, className: n(i["tedi-radio__helper"], t.className) })
79
80
  ] });
80
81
  };
81
82
  export {
82
- G as Radio,
83
- G as default
83
+ J as Radio,
84
+ J as default
84
85
  };