@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.
- package/bundle-stats.html +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/prop-types/external/react-is/index.cjs.js +1 -1
- package/external/prop-types/external/react-is/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/tedi/components/buttons/info-button/info-button.cjs.js +1 -1
- package/src/tedi/components/buttons/info-button/info-button.d.ts +4 -3
- package/src/tedi/components/buttons/info-button/info-button.es.js +17 -16
- package/src/tedi/components/form/choice-group/components/choice-group-item/choice-group-item.cjs.js +1 -1
- package/src/tedi/components/form/choice-group/components/choice-group-item/choice-group-item.es.js +61 -58
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
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
|
|
2
|
-
import
|
|
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
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
({ isSmall:
|
|
8
|
-
|
|
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:
|
|
10
|
+
className: r(s["tedi-info-button"]),
|
|
11
|
+
"data-variant": t === "inverted" ? "inverted" : void 0,
|
|
11
12
|
"data-name": "info-button",
|
|
12
|
-
...
|
|
13
|
-
|
|
14
|
-
icon: { name: "info", size: t ? 16 : 18 },
|
|
13
|
+
...e,
|
|
14
|
+
icon: { name: "info", size: o ? 16 : 18 },
|
|
15
15
|
visualType: "neutral",
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
color: t,
|
|
17
|
+
ref: n,
|
|
18
|
+
children: a
|
|
18
19
|
}
|
|
19
20
|
)
|
|
20
21
|
);
|
|
21
|
-
|
|
22
|
+
d.displayName = "InfoButton";
|
|
22
23
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
d as InfoButton,
|
|
25
|
+
d as default
|
|
25
26
|
};
|
package/src/tedi/components/form/choice-group/components/choice-group-item/choice-group-item.cjs.js
CHANGED
|
@@ -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"),
|
|
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;
|
package/src/tedi/components/form/choice-group/components/choice-group-item/choice-group-item.es.js
CHANGED
|
@@ -1,91 +1,94 @@
|
|
|
1
|
-
import { jsx as
|
|
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
|
|
4
|
-
import { Checkbox as
|
|
5
|
-
import { FeedbackText as
|
|
6
|
-
import { Radio as
|
|
7
|
-
import { ChoiceGroupContext as
|
|
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
|
|
10
|
-
import { Col as
|
|
11
|
-
const
|
|
12
|
-
const { getCurrentBreakpointProps:
|
|
13
|
-
id:
|
|
14
|
-
label:
|
|
15
|
-
value:
|
|
16
|
-
className:
|
|
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:
|
|
19
|
+
colProps: B = p === "column" ? { width: 12 } : { width: "auto" },
|
|
20
20
|
onChange: h,
|
|
21
|
-
hideLabel:
|
|
22
|
-
helper:
|
|
21
|
+
hideLabel: I,
|
|
22
|
+
helper: r,
|
|
23
23
|
tooltip: j,
|
|
24
|
-
type:
|
|
25
|
-
variant:
|
|
26
|
-
color:
|
|
27
|
-
layout:
|
|
28
|
-
showIndicator:
|
|
24
|
+
type: a = "radio",
|
|
25
|
+
variant: s = "default",
|
|
26
|
+
color: w = "primary",
|
|
27
|
+
layout: E,
|
|
28
|
+
showIndicator: C,
|
|
29
29
|
justifyContent: _ = "start"
|
|
30
|
-
} =
|
|
31
|
-
f == null || f(
|
|
32
|
-
},
|
|
33
|
-
e[`tedi-choice-group-item--${
|
|
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
|
-
),
|
|
35
|
+
), A = u(
|
|
36
36
|
e["tedi-choice-group-item"],
|
|
37
|
-
e[`tedi-choice-group-item--${
|
|
38
|
-
e[`tedi-choice-group-item--${
|
|
39
|
-
|
|
40
|
-
|
|
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__ */
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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:
|
|
51
|
-
label:
|
|
52
|
-
value:
|
|
53
|
-
name:
|
|
54
|
-
className: u(e["tedi-choice-group-item__indicator"],
|
|
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:
|
|
58
|
-
onChange:
|
|
59
|
-
hideLabel:
|
|
60
|
-
helper:
|
|
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__ */
|
|
66
|
-
/* @__PURE__ */
|
|
66
|
+
) : /* @__PURE__ */ x(M, { children: [
|
|
67
|
+
/* @__PURE__ */ n(
|
|
67
68
|
"input",
|
|
68
69
|
{
|
|
69
|
-
id:
|
|
70
|
-
value:
|
|
71
|
-
name:
|
|
72
|
-
type:
|
|
70
|
+
id: i,
|
|
71
|
+
value: c,
|
|
72
|
+
name: b,
|
|
73
|
+
type: F,
|
|
73
74
|
disabled: m,
|
|
74
75
|
checked: t,
|
|
75
|
-
defaultChecked:
|
|
76
|
-
onChange: (
|
|
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:
|
|
81
|
+
role: a === "radio" ? "radio" : void 0,
|
|
79
82
|
"aria-checked": t
|
|
80
83
|
}
|
|
81
84
|
),
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
90
|
-
|
|
92
|
+
te as ChoiceGroupItem,
|
|
93
|
+
te as default
|
|
91
94
|
};
|