@tedi-design-system/react 16.0.0-rc.3 → 16.0.0-rc.5

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.
Files changed (20) hide show
  1. package/bundle-stats.html +1 -1
  2. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
  3. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
  4. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
  5. package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
  6. package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
  7. package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
  8. package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
  9. package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
  10. package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
  11. package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
  12. package/external/prop-types/external/react-is/index.cjs.js +1 -1
  13. package/external/prop-types/external/react-is/index.es.js +1 -1
  14. package/index.css +1 -1
  15. package/package.json +1 -1
  16. package/src/tedi/components/buttons/info-button/info-button.cjs.js +1 -1
  17. package/src/tedi/components/buttons/info-button/info-button.d.ts +4 -3
  18. package/src/tedi/components/buttons/info-button/info-button.es.js +17 -16
  19. package/src/tedi/components/form/choice-group/components/choice-group-item/choice-group-item.cjs.js +1 -1
  20. package/src/tedi/components/form/choice-group/components/choice-group-item/choice-group-item.es.js +61 -58
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tedi-design-system/react",
3
- "version": "16.0.0-rc.3",
3
+ "version": "16.0.0-rc.5",
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 i=require("react/jsx-runtime"),a=require("../../../../../external/classnames/index.cjs.js"),r=require("react"),s=require("../button/button.cjs.js"),f=require("./info-button.module.scss.cjs.js"),t=r.forwardRef(({isSmall:e,children:n,...o},u)=>i.jsx(s.Button,{className:a.default(f.default["tedi-info-button"]),"data-name":"info-button",...o,type:"button",icon:{name:"info",size:e?16:18},visualType:"neutral",ref:u,children:n}));t.displayName="InfoButton";exports.InfoButton=t;exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),r=require("../../../../../external/classnames/index.cjs.js"),d=require("react"),s=require("../button/button.cjs.js"),f=require("./info-button.module.scss.cjs.js"),e=d.forwardRef(({isSmall:n,children:o,color:t="default",...u},i)=>a.jsx(s.Button,{className:r.default(f.default["tedi-info-button"]),"data-variant":t==="inverted"?"inverted":void 0,"data-name":"info-button",...u,icon:{name:"info",size:n?16:18},visualType:"neutral",color:t,ref:i,children:o}));e.displayName="InfoButton";exports.InfoButton=e;exports.default=e;
@@ -1,15 +1,16 @@
1
1
  import { default as React } from 'react';
2
2
  import { ButtonProps } from '../button/button';
3
- export interface InfoButtonProps extends Omit<ButtonProps, 'size' | 'children'> {
3
+ export interface InfoButtonProps extends Omit<ButtonProps, 'size' | 'children' | 'color'> {
4
4
  /**
5
- * If true, applies a small size to the InfoButton.
5
+ * If true, applies a small size to the InfoButton
6
6
  * @default false
7
7
  */
8
8
  isSmall?: boolean;
9
9
  /**
10
- * Children elements to be rendered inside the InfoButton.
10
+ * Children elements to be rendered inside the InfoButton
11
11
  */
12
12
  children?: React.ReactNode;
13
+ color?: 'default' | 'inverted';
13
14
  }
14
15
  export declare const InfoButton: React.ForwardRefExoticComponent<Omit<InfoButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
15
16
  export default InfoButton;
@@ -1,25 +1,26 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import m from "../../../../../external/classnames/index.es.js";
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import r from "../../../../../external/classnames/index.es.js";
3
3
  import f from "react";
4
- import { Button as r } from "../button/button.es.js";
5
- import i from "./info-button.module.scss.es.js";
6
- const s = f.forwardRef(
7
- ({ isSmall: t, children: o, ...a }, e) => /* @__PURE__ */ n(
8
- r,
4
+ import { Button as m } from "../button/button.es.js";
5
+ import s from "./info-button.module.scss.es.js";
6
+ const d = f.forwardRef(
7
+ ({ isSmall: o, children: a, color: t = "default", ...e }, n) => /* @__PURE__ */ i(
8
+ m,
9
9
  {
10
- className: m(i["tedi-info-button"]),
10
+ className: r(s["tedi-info-button"]),
11
+ "data-variant": t === "inverted" ? "inverted" : void 0,
11
12
  "data-name": "info-button",
12
- ...a,
13
- type: "button",
14
- icon: { name: "info", size: t ? 16 : 18 },
13
+ ...e,
14
+ icon: { name: "info", size: o ? 16 : 18 },
15
15
  visualType: "neutral",
16
- ref: e,
17
- children: o
16
+ color: t,
17
+ ref: n,
18
+ children: a
18
19
  }
19
20
  )
20
21
  );
21
- s.displayName = "InfoButton";
22
+ d.displayName = "InfoButton";
22
23
  export {
23
- s as InfoButton,
24
- s as default
24
+ d as InfoButton,
25
+ d as default
25
26
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),h=require("../../../../../../../external/classnames/index.cjs.js"),E=require("react"),F=require("../../../checkbox/checkbox.cjs.js"),L=require("../../../feedback-text/feedback-text.cjs.js"),R=require("../../../radio/radio.cjs.js"),S=require("../../choice-group-context.cjs.js"),e=require("./choice-group-item.module.scss.cjs.js"),H=require("../../../../../helpers/hooks/use-breakpoint-props.cjs.js"),O=require("../../../../layout/grid/col.cjs.js"),j=r=>{const{getCurrentBreakpointProps:q}=H.useBreakpointProps(r.defaultServerBreakpoint),{id:u,label:k,value:o,className:v,direction:m,disabled:l,colProps:y=m==="column"?{width:12}:{width:"auto"},onChange:p,hideLabel:N,helper:a,tooltip:B,type:s="radio",variant:n="default",color:$="primary",layout:G,showIndicator:C,justifyContent:x="start"}=q(r),{currentValue:d,name:b,onChange:f,inputType:I}=E.useContext(S.ChoiceGroupContext),i=Array.isArray(d)?d.includes(o):o===d,P=d===void 0?r.defaultChecked:i,g=(c,_)=>{f==null||f(c,_),p==null||p(c,_)},M=h.default(e.default[`tedi-choice-group-item--${G==="separated"?"separated":"segmented"}`],m&&e.default[`tedi-choice-group-item--${m}`]),T=h.default(e.default["tedi-choice-group-item"],e.default[`tedi-choice-group-item--${n}`],e.default[`tedi-choice-group-item--${n}-${$}`],C&&e.default["tedi-choice-group-item--indicator"],s&&e.default[`tedi-choice-group-item--${s}`],{[e.default["tedi-choice-group-item--disabled"]]:l},{[e.default["tedi-choice-group-item--checked"]]:i},{[`justify-content-${x}`]:x}),w=s==="radio"?R.Radio:F.Checkbox,A=c=>{c.target.tagName!=="LABEL"&&!l&&n==="card"&&g(o,!i)};return t.jsx(O.Col,{...y,className:M,children:t.jsx("div",{className:T,onClick:A,children:n==="default"||C?t.jsx(w,{id:u,label:k,value:o,name:b,className:h.default(e.default["tedi-choice-group-item__indicator"],v),disabled:l,checked:i,defaultChecked:P,onChange:g,hideLabel:N,helper:a?{...a,className:h.default(e.default["tedi-choice-group-item__feedback-text"],a.className)}:void 0,tooltip:B,"data-testid":"choice-group-item-indicator","aria-checked":i}):t.jsxs(t.Fragment,{children:[t.jsx("input",{id:u,value:o,name:b,type:I,disabled:l,checked:i,defaultChecked:d===void 0?r.defaultChecked:void 0,onChange:c=>g(o,c.target.checked),className:e.default["tedi-choice-group-item__input"],role:s==="radio"?"radio":void 0,"aria-checked":i}),t.jsxs("label",{htmlFor:u,className:e.default["tedi-choice-group-item__label"],children:[k,a&&t.jsx(L.FeedbackText,{...a,id:u,className:e.default["tedi-choice-group-item__feedback-text"]})]})]})})})};exports.ChoiceGroupItem=j;exports.default=j;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),h=require("../../../../../../../external/classnames/index.cjs.js"),R=require("react"),S=require("../../../checkbox/checkbox.cjs.js"),A=require("../../../feedback-text/feedback-text.cjs.js"),H=require("../../../radio/radio.cjs.js"),L=require("../../choice-group-context.cjs.js"),e=require("./choice-group-item.module.scss.cjs.js"),O=require("../../../../../helpers/hooks/use-breakpoint-props.cjs.js"),V=require("../../../../layout/grid/col.cjs.js"),y=l=>{const{getCurrentBreakpointProps:q}=O.useBreakpointProps(l.defaultServerBreakpoint),{id:c,label:k,value:a,className:v,direction:m,disabled:n,colProps:N=m==="column"?{width:12}:{width:"auto"},onChange:p,hideLabel:B,helper:r,tooltip:$,type:d="radio",variant:s="default",color:G="primary",layout:I,showIndicator:C,justifyContent:x="start"}=q(l),{currentValue:u,name:b,onChange:f,inputType:P}=R.useContext(L.ChoiceGroupContext),i=Array.isArray(u)?u.includes(a):a===u,M=u===void 0?l.defaultChecked:i,_=(o,g)=>{f==null||f(o,g),p==null||p(o,g)},T=h.default(e.default[`tedi-choice-group-item--${I==="separated"?"separated":"segmented"}`],m&&e.default[`tedi-choice-group-item--${m}`]),w=h.default(e.default["tedi-choice-group-item"],e.default[`tedi-choice-group-item--${s}`],e.default[`tedi-choice-group-item--${s}-${G}`],C&&e.default["tedi-choice-group-item--indicator"],d&&e.default[`tedi-choice-group-item--${d}`],{[e.default["tedi-choice-group-item--disabled"]]:n},{[e.default["tedi-choice-group-item--checked"]]:i},{[`justify-content-${x}`]:x}),E=d==="radio"?H.Radio:S.Checkbox,F=o=>{var j;n||s!=="card"||o.target.closest("input, label")||(j=document.getElementById(c))==null||j.click()};return t.jsx(V.Col,{...N,className:T,children:t.jsx("div",{className:w,onClick:F,role:d,"aria-checked":i,children:s==="default"||C?t.jsx(E,{id:c,label:k,value:a,name:b,className:h.default(e.default["tedi-choice-group-item__indicator"],v),disabled:n,checked:i,defaultChecked:M,onChange:_,hideLabel:B,helper:r?{...r,className:h.default(e.default["tedi-choice-group-item__feedback-text"],r.className)}:void 0,tooltip:$,"data-testid":"choice-group-item-indicator","aria-checked":i}):t.jsxs(t.Fragment,{children:[t.jsx("input",{id:c,value:a,name:b,type:P,disabled:n,checked:i,defaultChecked:u===void 0?l.defaultChecked:void 0,onChange:o=>{_(a,o.target.checked)},className:e.default["tedi-choice-group-item__input"],role:d==="radio"?"radio":void 0,"aria-checked":i}),t.jsxs("label",{htmlFor:c,className:e.default["tedi-choice-group-item__label"],children:[k,r&&t.jsx(A.FeedbackText,{...r,id:c,className:e.default["tedi-choice-group-item__feedback-text"]})]})]})})})};exports.ChoiceGroupItem=y;exports.default=y;
@@ -1,91 +1,94 @@
1
- import { jsx as a, jsxs as y, Fragment as L } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as x, Fragment as M } from "react/jsx-runtime";
2
2
  import u from "../../../../../../../external/classnames/index.es.js";
3
- import P from "react";
4
- import { Checkbox as M } from "../../../checkbox/checkbox.es.js";
5
- import { FeedbackText as R } from "../../../feedback-text/feedback-text.es.js";
6
- import { Radio as T } from "../../../radio/radio.es.js";
7
- import { ChoiceGroupContext as H } from "../../choice-group-context.es.js";
3
+ import R from "react";
4
+ import { Checkbox as T } from "../../../checkbox/checkbox.es.js";
5
+ import { FeedbackText as H } from "../../../feedback-text/feedback-text.es.js";
6
+ import { Radio as L } from "../../../radio/radio.es.js";
7
+ import { ChoiceGroupContext as S } from "../../choice-group-context.es.js";
8
8
  import e from "./choice-group-item.module.scss.es.js";
9
- import { useBreakpointProps as S } from "../../../../../helpers/hooks/use-breakpoint-props.es.js";
10
- import { Col as V } from "../../../../layout/grid/col.es.js";
11
- const ee = (d) => {
12
- const { getCurrentBreakpointProps: x } = S(d.defaultServerBreakpoint), {
13
- id: n,
14
- label: C,
15
- value: o,
16
- className: v,
9
+ import { useBreakpointProps as V } from "../../../../../helpers/hooks/use-breakpoint-props.es.js";
10
+ import { Col as q } from "../../../../layout/grid/col.es.js";
11
+ const te = (l) => {
12
+ const { getCurrentBreakpointProps: v } = V(l.defaultServerBreakpoint), {
13
+ id: i,
14
+ label: k,
15
+ value: c,
16
+ className: $,
17
17
  direction: p,
18
18
  disabled: m,
19
- colProps: $ = p === "column" ? { width: 12 } : { width: "auto" },
19
+ colProps: B = p === "column" ? { width: 12 } : { width: "auto" },
20
20
  onChange: h,
21
- hideLabel: B,
22
- helper: c,
21
+ hideLabel: I,
22
+ helper: r,
23
23
  tooltip: j,
24
- type: s = "radio",
25
- variant: l = "default",
26
- color: I = "primary",
27
- layout: w,
28
- showIndicator: k,
24
+ type: a = "radio",
25
+ variant: s = "default",
26
+ color: w = "primary",
27
+ layout: E,
28
+ showIndicator: C,
29
29
  justifyContent: _ = "start"
30
- } = x(d), { currentValue: r, name: N, onChange: f, inputType: A } = P.useContext(H), t = Array.isArray(r) ? r.includes(o) : o === r, E = r === void 0 ? d.defaultChecked : t, g = (i, b) => {
31
- f == null || f(i, b), h == null || h(i, b);
32
- }, F = u(
33
- e[`tedi-choice-group-item--${w === "separated" ? "separated" : "segmented"}`],
30
+ } = v(l), { currentValue: d, name: b, onChange: f, inputType: F } = R.useContext(S), t = Array.isArray(d) ? d.includes(c) : c === d, G = d === void 0 ? l.defaultChecked : t, y = (o, g) => {
31
+ f == null || f(o, g), h == null || h(o, g);
32
+ }, P = u(
33
+ e[`tedi-choice-group-item--${E === "separated" ? "separated" : "segmented"}`],
34
34
  p && e[`tedi-choice-group-item--${p}`]
35
- ), G = u(
35
+ ), A = u(
36
36
  e["tedi-choice-group-item"],
37
- e[`tedi-choice-group-item--${l}`],
38
- e[`tedi-choice-group-item--${l}-${I}`],
39
- k && e["tedi-choice-group-item--indicator"],
40
- s && e[`tedi-choice-group-item--${s}`],
37
+ e[`tedi-choice-group-item--${s}`],
38
+ e[`tedi-choice-group-item--${s}-${w}`],
39
+ C && e["tedi-choice-group-item--indicator"],
40
+ a && e[`tedi-choice-group-item--${a}`],
41
41
  { [e["tedi-choice-group-item--disabled"]]: m },
42
42
  { [e["tedi-choice-group-item--checked"]]: t },
43
43
  { [`justify-content-${_}`]: _ }
44
44
  );
45
- return /* @__PURE__ */ a(V, { ...$, className: F, children: /* @__PURE__ */ a("div", { className: G, onClick: (i) => {
46
- i.target.tagName !== "LABEL" && !m && l === "card" && g(o, !t);
47
- }, children: l === "default" || k ? /* @__PURE__ */ a(
48
- s === "radio" ? T : M,
45
+ return /* @__PURE__ */ n(q, { ...B, className: P, children: /* @__PURE__ */ n("div", { className: A, onClick: (o) => {
46
+ var N;
47
+ m || s !== "card" || o.target.closest("input, label") || (N = document.getElementById(i)) == null || N.click();
48
+ }, role: a, "aria-checked": t, children: s === "default" || C ? /* @__PURE__ */ n(
49
+ a === "radio" ? L : T,
49
50
  {
50
- id: n,
51
- label: C,
52
- value: o,
53
- name: N,
54
- className: u(e["tedi-choice-group-item__indicator"], v),
51
+ id: i,
52
+ label: k,
53
+ value: c,
54
+ name: b,
55
+ className: u(e["tedi-choice-group-item__indicator"], $),
55
56
  disabled: m,
56
57
  checked: t,
57
- defaultChecked: E,
58
- onChange: g,
59
- hideLabel: B,
60
- helper: c ? { ...c, className: u(e["tedi-choice-group-item__feedback-text"], c.className) } : void 0,
58
+ defaultChecked: G,
59
+ onChange: y,
60
+ hideLabel: I,
61
+ helper: r ? { ...r, className: u(e["tedi-choice-group-item__feedback-text"], r.className) } : void 0,
61
62
  tooltip: j,
62
63
  "data-testid": "choice-group-item-indicator",
63
64
  "aria-checked": t
64
65
  }
65
- ) : /* @__PURE__ */ y(L, { children: [
66
- /* @__PURE__ */ a(
66
+ ) : /* @__PURE__ */ x(M, { children: [
67
+ /* @__PURE__ */ n(
67
68
  "input",
68
69
  {
69
- id: n,
70
- value: o,
71
- name: N,
72
- type: A,
70
+ id: i,
71
+ value: c,
72
+ name: b,
73
+ type: F,
73
74
  disabled: m,
74
75
  checked: t,
75
- defaultChecked: r === void 0 ? d.defaultChecked : void 0,
76
- onChange: (i) => g(o, i.target.checked),
76
+ defaultChecked: d === void 0 ? l.defaultChecked : void 0,
77
+ onChange: (o) => {
78
+ y(c, o.target.checked);
79
+ },
77
80
  className: e["tedi-choice-group-item__input"],
78
- role: s === "radio" ? "radio" : void 0,
81
+ role: a === "radio" ? "radio" : void 0,
79
82
  "aria-checked": t
80
83
  }
81
84
  ),
82
- /* @__PURE__ */ y("label", { htmlFor: n, className: e["tedi-choice-group-item__label"], children: [
83
- C,
84
- c && /* @__PURE__ */ a(R, { ...c, id: n, className: e["tedi-choice-group-item__feedback-text"] })
85
+ /* @__PURE__ */ x("label", { htmlFor: i, className: e["tedi-choice-group-item__label"], children: [
86
+ k,
87
+ r && /* @__PURE__ */ n(H, { ...r, id: i, className: e["tedi-choice-group-item__feedback-text"] })
85
88
  ] })
86
89
  ] }) }) });
87
90
  };
88
91
  export {
89
- ee as ChoiceGroupItem,
90
- ee as default
92
+ te as ChoiceGroupItem,
93
+ te as default
91
94
  };