ingred-ui 25.4.3 → 25.5.0
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/dist/components/RadioButton/RadioButton.d.ts +2 -0
- package/dist/components/RadioButton/RadioButton.stories.d.ts +1 -0
- package/dist/components/RadioButton/styled.d.ts +2 -0
- package/dist/index.es.js +36 -6
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +36 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -19,11 +19,13 @@ export type RadioButtonProps = Omit<React.InputHTMLAttributes<HTMLInputElement>,
|
|
|
19
19
|
children?: React.ReactNode;
|
|
20
20
|
onChange?: RadioButtonChangeHandler;
|
|
21
21
|
inputRef?: React.Ref<HTMLInputElement>;
|
|
22
|
+
error?: boolean;
|
|
22
23
|
};
|
|
23
24
|
declare const RadioButton: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "size"> & {
|
|
24
25
|
size?: RadioButtonSize | undefined;
|
|
25
26
|
children?: React.ReactNode;
|
|
26
27
|
onChange?: RadioButtonChangeHandler | undefined;
|
|
27
28
|
inputRef?: React.Ref<HTMLInputElement> | undefined;
|
|
29
|
+
error?: boolean | undefined;
|
|
28
30
|
} & React.RefAttributes<HTMLSpanElement | HTMLLabelElement>>;
|
|
29
31
|
export default RadioButton;
|
|
@@ -8,6 +8,7 @@ declare const _default: {
|
|
|
8
8
|
children?: React.ReactNode;
|
|
9
9
|
onChange?: import("./RadioButton").RadioButtonChangeHandler | undefined;
|
|
10
10
|
inputRef?: React.Ref<HTMLInputElement> | undefined;
|
|
11
|
+
error?: boolean | undefined;
|
|
11
12
|
} & React.RefAttributes<HTMLSpanElement | HTMLLabelElement>>;
|
|
12
13
|
argTypes: {
|
|
13
14
|
disabled: {
|
|
@@ -7,10 +7,12 @@ type IndicatorProps = {
|
|
|
7
7
|
size: RadioButtonSize;
|
|
8
8
|
inside: string;
|
|
9
9
|
border: string;
|
|
10
|
+
error: boolean;
|
|
10
11
|
};
|
|
11
12
|
export declare const Indicator: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, IndicatorProps, never>;
|
|
12
13
|
export declare const Label: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {
|
|
13
14
|
checked?: boolean | undefined;
|
|
14
15
|
disabled?: boolean | undefined;
|
|
16
|
+
error?: boolean | undefined;
|
|
15
17
|
}, never>;
|
|
16
18
|
export {};
|
package/dist/index.es.js
CHANGED
|
@@ -1155,14 +1155,24 @@ var mi=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[hr
|
|
|
1155
1155
|
cursor: ${({disabled:e})=>e?"not-allowed":"pointer"};
|
|
1156
1156
|
display: flex;
|
|
1157
1157
|
align-items: center;
|
|
1158
|
+
|
|
1159
|
+
${({disabled:e})=>!e&&w`
|
|
1160
|
+
&:hover > span::before {
|
|
1161
|
+
border-color: ${({theme:e})=>e.palette.primary.main};
|
|
1162
|
+
}
|
|
1163
|
+
`}
|
|
1158
1164
|
`,zd=x.span`
|
|
1159
1165
|
display: inline-flex;
|
|
1160
1166
|
align-items: center;
|
|
1161
|
-
color: ${({error:e,
|
|
1167
|
+
color: ${({error:e,disabled:t,theme:n})=>t?n.palette.text.disabled:e?n.palette.danger.main:n.palette.black};
|
|
1162
1168
|
font-size: ${({size:e})=>e===Td.SMALL?`${le.sm}px`:`${le.md}px`};
|
|
1163
1169
|
&:disabled {
|
|
1164
1170
|
color: ${({theme:e})=>e.palette.text.disabled};
|
|
1165
1171
|
}
|
|
1172
|
+
|
|
1173
|
+
input:checked:not(:disabled) + & {
|
|
1174
|
+
color: ${({theme:e})=>e.palette.primary.main};
|
|
1175
|
+
}
|
|
1166
1176
|
&::before {
|
|
1167
1177
|
flex-shrink: 0;
|
|
1168
1178
|
content: "";
|
|
@@ -1174,7 +1184,9 @@ var mi=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[hr
|
|
|
1174
1184
|
box-shadow: ${({theme:e})=>e.shadow["3dShadowBasic"]};
|
|
1175
1185
|
background-color: ${({theme:e})=>e.palette.background.default};
|
|
1176
1186
|
margin-right: ${({hasChild:e,theme:t})=>e?t.spacing/2+"px":"auto"};
|
|
1177
|
-
transition:
|
|
1187
|
+
transition:
|
|
1188
|
+
background-color 0.3s ease,
|
|
1189
|
+
border-color 0.3s ease;
|
|
1178
1190
|
}
|
|
1179
1191
|
`;var Td;!function(e){e.SMALL="small",e.MEDIUM="medium"}(Td||(Td={}));const Bd=e.forwardRef((function(t,n){var{children:r,indeterminate:i=!1,error:o=!1,disabled:a=!1,inputRef:l,size:s=Td.MEDIUM}=t,c=S(t,["children","indeterminate","error","disabled","inputRef","size"]);return e.createElement(Zd,{ref:n,disabled:a},e.createElement(Rd,Object.assign({ref:l,error:o,readOnly:!0,type:"checkbox",indeterminate:i,disabled:a,_size:s},c)),e.createElement(zd,{size:s,error:o,indeterminate:i,hasChild:!!r,disabled:a,checked:c.checked},r))}));function Pd(...t){return e.useMemo((()=>t.every((e=>null===e))?null:e=>{for(const n of t)"function"==typeof n?n(e):n&&"string"!=typeof n&&(n.current=e)}),[t])}const Gd=({onClickAway:t,children:n})=>{const r=e.useRef(null),i=e.useRef(!1);e.useEffect((()=>(setTimeout((()=>{i.current=!0}),0),()=>{i.current=!1})),[]),e.useEffect((()=>{const e=e=>{i.current&&(null==r.current||r.current.contains(e.target)||t&&t(e))};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}}),[r,t]);const o=Object.assign(Object.assign({},n.props),{ref:Pd(r,n.ref)});return e.cloneElement(n,o)},_d=({height:e="auto",maxHeight:t="none",minHeight:n="none"})=>w`
|
|
1180
1192
|
height: ${e};
|
|
@@ -1439,6 +1451,12 @@ var mi=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[hr
|
|
|
1439
1451
|
opacity: 0;
|
|
1440
1452
|
cursor: ${({disabled:e})=>e?"not-allowed":"pointer"};
|
|
1441
1453
|
}
|
|
1454
|
+
|
|
1455
|
+
${({disabled:e})=>!e&&w`
|
|
1456
|
+
&:hover > input + span {
|
|
1457
|
+
border-color: ${({theme:e})=>e.palette.primary.main};
|
|
1458
|
+
}
|
|
1459
|
+
`}
|
|
1442
1460
|
`,Rf=x.span`
|
|
1443
1461
|
position: relative;
|
|
1444
1462
|
display: block;
|
|
@@ -1448,9 +1466,11 @@ var mi=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[hr
|
|
|
1448
1466
|
height: auto;
|
|
1449
1467
|
border-radius: 50%;
|
|
1450
1468
|
border: ${({border:e})=>e} solid
|
|
1451
|
-
${({theme:
|
|
1469
|
+
${({error:e,theme:t})=>e?t.palette.danger.main:t.palette.divider};
|
|
1452
1470
|
box-shadow: ${({theme:e})=>e.shadow["3dShadowBasic"]};
|
|
1453
|
-
transition:
|
|
1471
|
+
transition:
|
|
1472
|
+
all 0.3s ease,
|
|
1473
|
+
border-color 0.3s ease;
|
|
1454
1474
|
background: ${({theme:e})=>e.palette.background.default};
|
|
1455
1475
|
|
|
1456
1476
|
input:checked + & {
|
|
@@ -1492,8 +1512,12 @@ var mi=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[hr
|
|
|
1492
1512
|
`,Zf=x.span`
|
|
1493
1513
|
flex: 0 1 auto;
|
|
1494
1514
|
font-size: inherit;
|
|
1495
|
-
color: ${({
|
|
1496
|
-
|
|
1515
|
+
color: ${({disabled:e,error:t,theme:n})=>e?n.palette.text.disabled:t?n.palette.danger.main:n.palette.black};
|
|
1516
|
+
|
|
1517
|
+
input:checked:not(:disabled) ~ & {
|
|
1518
|
+
color: ${({theme:e})=>e.palette.primary.main};
|
|
1519
|
+
}
|
|
1520
|
+
`;var zf;!function(e){e.SMALL="16px",e.MEDIUM="18px"}(zf||(zf={}));const Tf={[zf.SMALL]:{inside:"6px",border:"1px"},[zf.MEDIUM]:{inside:"8px",border:"1px"}},Bf=e.forwardRef((function(t,n){var{size:r=zf.MEDIUM,onChange:i,inputRef:o,children:a,disabled:l,error:s=!1}=t,c=S(t,["size","onChange","inputRef","children","disabled","error"]);return e.createElement(Vf,{ref:n,as:null==a?"span":"label",disabled:l,size:r},e.createElement("input",Object.assign({},c,{ref:o,disabled:l,type:"radio",onChange:e=>{i&&i(e,e.target.checked)}})),e.createElement(Rf,Object.assign({size:r},Tf[r],{error:s})),null!=a?e.createElement(Zf,{checked:c.checked,disabled:l,error:s},a):null)})),Pf=t=>{var{header:n=!1,selected:r=!1,onClick:i}=t,o=S(t,["header","selected","onClick"]);const a=n?Hf:Lf;return e.createElement(a,Object.assign({},o),!n&&e.createElement(Bf,{checked:r,onClick:e=>{e.stopPropagation(),i&&i(e)}}))},Gf=x.td`
|
|
1497
1521
|
width: ${({width:e})=>e};
|
|
1498
1522
|
padding-right: ${({theme:e})=>2*e.spacing}px;
|
|
1499
1523
|
padding-left: ${({theme:e})=>2*e.spacing}px;
|
|
@@ -4841,6 +4865,12 @@ var mi=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[hr
|
|
|
4841
4865
|
opacity: 0;
|
|
4842
4866
|
}
|
|
4843
4867
|
`}
|
|
4868
|
+
|
|
4869
|
+
${({disabled:e,checked:t})=>!e&&!t&&w`
|
|
4870
|
+
&:hover {
|
|
4871
|
+
border-color: ${({theme:e})=>e.palette.primary.main};
|
|
4872
|
+
}
|
|
4873
|
+
`}
|
|
4844
4874
|
`,eM=x.input`
|
|
4845
4875
|
width: 0;
|
|
4846
4876
|
height: 0;
|