@groupeactual/ui-kit 0.4.12 → 0.4.14
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/cjs/components/Form/Checkbox/Checkbox.d.ts +5 -6
- package/dist/cjs/components/Icon/Icon.d.ts +10 -0
- package/dist/cjs/components/Icon/index.d.ts +1 -1
- package/dist/cjs/components/index.d.ts +1 -1
- package/dist/cjs/index.js +116 -77
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/Form/Checkbox/Checkbox.d.ts +5 -6
- package/dist/esm/components/Icon/Icon.d.ts +10 -0
- package/dist/esm/components/Icon/index.d.ts +1 -1
- package/dist/esm/components/index.d.ts +1 -1
- package/dist/esm/index.js +116 -77
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +11 -12
- package/package.json +3 -2
- package/src/components/Form/Checkbox/Checkbox.tsx +25 -14
- package/src/components/Form/TextField/TextField.tsx +3 -3
- package/src/components/Icon/{IconProvider.tsx → Icon.tsx} +33 -56
- package/src/components/Icon/index.ts +1 -1
- package/src/components/Text/Text.tsx +3 -1
- package/src/components/index.ts +1 -1
- package/dist/cjs/components/Icon/IconProvider.d.ts +0 -10
- package/dist/esm/components/Icon/IconProvider.d.ts +0 -10
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { CheckboxProps } from '@mui/material/Checkbox';
|
|
3
3
|
interface Props {
|
|
4
|
-
error?: string;
|
|
5
|
-
label: string;
|
|
6
|
-
value: boolean;
|
|
7
4
|
name: string;
|
|
5
|
+
value: boolean;
|
|
6
|
+
label: string;
|
|
8
7
|
onChange: (field: string, value: any, shouldValidate?: boolean | undefined) => void;
|
|
9
|
-
|
|
8
|
+
error?: string;
|
|
10
9
|
}
|
|
11
|
-
declare const Checkbox: ({ name, value, error, label, onChange,
|
|
10
|
+
declare const Checkbox: ({ name, value, error, label, onChange, ...props }: CheckboxProps & Props) => JSX.Element;
|
|
12
11
|
export default Checkbox;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
3
|
+
interface Props {
|
|
4
|
+
variant?: 'square' | 'none';
|
|
5
|
+
icon: IconDefinition;
|
|
6
|
+
color?: string;
|
|
7
|
+
fontSize?: number;
|
|
8
|
+
}
|
|
9
|
+
declare const Icon: ({ variant, icon, color, fontSize }: Props) => JSX.Element;
|
|
10
|
+
export default Icon;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './
|
|
1
|
+
export { default } from './Icon';
|
|
@@ -4,4 +4,4 @@ export { default as Button } from './Button';
|
|
|
4
4
|
export { default as TextField } from './Form/TextField';
|
|
5
5
|
export { default as Checkbox } from './Form/Checkbox';
|
|
6
6
|
export { default as Accordion } from './Accordion';
|
|
7
|
-
export { default as IconProvider } from './Icon/
|
|
7
|
+
export { default as IconProvider } from './Icon/Icon';
|
package/dist/cjs/index.js
CHANGED
|
@@ -50450,7 +50450,7 @@ process.env.NODE_ENV !== "production" ? TextField$1.propTypes /* remove-proptype
|
|
|
50450
50450
|
} : void 0;
|
|
50451
50451
|
var MuiTextField = TextField$1;
|
|
50452
50452
|
|
|
50453
|
-
var Text = function (props) { return jsxRuntime.jsx(Typography$1, __assign$1({}, props)); };
|
|
50453
|
+
var Text = function (props) { return (jsxRuntime.jsx(Typography$1, __assign$1({ color: "greyXDark" }, props))); };
|
|
50454
50454
|
|
|
50455
50455
|
var Link = function (props) { return jsxRuntime.jsx(LinkMui, __assign$1({}, props)); };
|
|
50456
50456
|
|
|
@@ -50466,7 +50466,7 @@ var TextField = function (_a) {
|
|
|
50466
50466
|
setInternalValue(value);
|
|
50467
50467
|
}
|
|
50468
50468
|
}, [value]);
|
|
50469
|
-
return (jsxRuntime.jsx(MuiTextField, __assign$1({ variant: "outlined", name: name, label: label, value: internalValue, placeholder: placeholder, FormHelperTextProps: { component: 'div' }, InputLabelProps: { shrink: true }, onClick: function (e) { return e.stopPropagation(); }, onChange: function (e) {
|
|
50469
|
+
return (jsxRuntime.jsx(MuiTextField, __assign$1({ id: label === placeholder ? 'text-field-mui' : 'test-field-ds', variant: "outlined", name: name, label: label, value: internalValue, placeholder: label === placeholder ? undefined : placeholder, FormHelperTextProps: { component: 'div' }, InputLabelProps: { shrink: label === placeholder ? undefined : true }, onClick: function (e) { return e.stopPropagation(); }, onChange: function (e) {
|
|
50470
50470
|
setInternalValue(e.currentTarget.value);
|
|
50471
50471
|
onChange(e);
|
|
50472
50472
|
}, onBlur: function (e) {
|
|
@@ -50478,18 +50478,24 @@ var TextField = function (_a) {
|
|
|
50478
50478
|
};
|
|
50479
50479
|
|
|
50480
50480
|
var Checkbox = function (_a) {
|
|
50481
|
-
var name = _a.name, value = _a.value, error = _a.error, label = _a.label, onChange = _a.onChange,
|
|
50481
|
+
var name = _a.name, value = _a.value, error = _a.error, label = _a.label, onChange = _a.onChange, props = __rest(_a, ["name", "value", "error", "label", "onChange"]);
|
|
50482
50482
|
var _b = React.useState(value), internalValue = _b[0], setInternalValue = _b[1];
|
|
50483
50483
|
React.useEffect(function () {
|
|
50484
50484
|
if (value !== internalValue) {
|
|
50485
50485
|
setInternalValue(value);
|
|
50486
50486
|
}
|
|
50487
50487
|
}, [value]);
|
|
50488
|
-
return (jsxRuntime.jsxs(FormControl$1, __assign$1({ fullWidth: true }, { children: [jsxRuntime.jsx(FormControlLabel$1, {
|
|
50488
|
+
return (jsxRuntime.jsxs(FormControl$1, __assign$1({ fullWidth: true }, { children: [jsxRuntime.jsx(FormControlLabel$1, { control: jsxRuntime.jsx(Box$3, { children: jsxRuntime.jsx(CheckboxMUI, __assign$1({ name: name, sx: { marginTop: '-2px' }, checked: internalValue, color: "primary", onChange: function (e) {
|
|
50489
50489
|
setInternalValue(e.target.checked);
|
|
50490
50490
|
onChange(name, e.target.checked, true);
|
|
50491
|
-
} }) })
|
|
50492
|
-
|
|
50491
|
+
} }, props)) }), label: jsxRuntime.jsx(Typography$1, __assign$1({ component: "span", sx: {
|
|
50492
|
+
fontSize: '14px',
|
|
50493
|
+
marginLeft: '-3px',
|
|
50494
|
+
marginTop: '2px',
|
|
50495
|
+
fontWeight: 400,
|
|
50496
|
+
color: error ? '#B80025' : '#000'
|
|
50497
|
+
} }, { children: label })) }), error && (jsxRuntime.jsx(Typography$1, __assign$1({ sx: {
|
|
50498
|
+
marginTop: -0.5,
|
|
50493
50499
|
color: '#B80025',
|
|
50494
50500
|
fontWeight: 400,
|
|
50495
50501
|
fontSize: '10px'
|
|
@@ -50512,7 +50518,7 @@ var FontAwesomeSvgIcon = React.forwardRef(function (_a, ref) {
|
|
|
50512
50518
|
var icon = _a.icon, fontSize = _a.fontSize;
|
|
50513
50519
|
var _b = icon.icon, width = _b[0], height = _b[1], svgPathData = _b[4];
|
|
50514
50520
|
return (jsxRuntime.jsx(SvgIcon$1, __assign$1({ ref: ref, viewBox: "0 0 ".concat(width, " ").concat(height), sx: {
|
|
50515
|
-
fontSize: fontSize
|
|
50521
|
+
fontSize: fontSize !== null && fontSize !== void 0 ? fontSize : '14px'
|
|
50516
50522
|
} }, { children: typeof svgPathData === 'string' ? (jsxRuntime.jsx("path", { d: svgPathData })) : (
|
|
50517
50523
|
/**
|
|
50518
50524
|
* A multi-path Font Awesome icon seems to imply a duotune icon. The 0th path seems to
|
|
@@ -50523,71 +50529,42 @@ var FontAwesomeSvgIcon = React.forwardRef(function (_a, ref) {
|
|
|
50523
50529
|
*/
|
|
50524
50530
|
svgPathData.map(function (d, i) { return (jsxRuntime.jsx("path", { style: { opacity: i === 0 ? 0.4 : 1 }, d: d }, i)); })) })));
|
|
50525
50531
|
});
|
|
50526
|
-
var
|
|
50527
|
-
var
|
|
50528
|
-
var getFontSize = function () {
|
|
50529
|
-
if (variant === 'roundedIcon') {
|
|
50530
|
-
return '1.5rem';
|
|
50531
|
-
}
|
|
50532
|
-
if (variant === 'smallRoundedIcon') {
|
|
50533
|
-
return '0.9rem';
|
|
50534
|
-
}
|
|
50535
|
-
switch (size) {
|
|
50536
|
-
case 'xxs':
|
|
50537
|
-
return '.8rem';
|
|
50538
|
-
case 'xs':
|
|
50539
|
-
return '1rem';
|
|
50540
|
-
case 'm':
|
|
50541
|
-
return '1.5rem';
|
|
50542
|
-
case 'lg':
|
|
50543
|
-
return '1.8rem';
|
|
50544
|
-
case 'xl':
|
|
50545
|
-
return '2.2rem';
|
|
50546
|
-
case 'xxl':
|
|
50547
|
-
return '4rem';
|
|
50548
|
-
default:
|
|
50549
|
-
return '1.2rem';
|
|
50550
|
-
}
|
|
50551
|
-
};
|
|
50532
|
+
var Icon = function (_a) {
|
|
50533
|
+
var _b = _a.variant, variant = _b === void 0 ? 'none' : _b, icon = _a.icon, _c = _a.color, color = _c === void 0 ? '#136cac' : _c, _d = _a.fontSize, fontSize = _d === void 0 ? 16 : _d;
|
|
50552
50534
|
var getStyles = function () {
|
|
50535
|
+
var theme = useTheme$1();
|
|
50536
|
+
var defaultColor = theme.palette[color]
|
|
50537
|
+
? theme.palette[color]
|
|
50538
|
+
: !color || (color === null || color === void 0 ? void 0 : color.length) === 0
|
|
50539
|
+
? '#136cac'
|
|
50540
|
+
: color;
|
|
50553
50541
|
switch (variant) {
|
|
50554
|
-
case '
|
|
50555
|
-
return {
|
|
50556
|
-
color: 'actual.main',
|
|
50557
|
-
backgroundColor: 'actual.light',
|
|
50558
|
-
borderRadius: '100px',
|
|
50559
|
-
overflow: 'visible',
|
|
50560
|
-
height: 50,
|
|
50561
|
-
width: 50,
|
|
50562
|
-
display: 'flex',
|
|
50563
|
-
fontSize: '1.5rem',
|
|
50564
|
-
justifyContent: 'center',
|
|
50565
|
-
alignItems: 'center'
|
|
50566
|
-
};
|
|
50567
|
-
case 'smallRoundedIcon':
|
|
50542
|
+
case 'square':
|
|
50568
50543
|
return {
|
|
50569
|
-
color:
|
|
50570
|
-
backgroundColor:
|
|
50571
|
-
borderRadius: '
|
|
50544
|
+
color: defaultColor,
|
|
50545
|
+
backgroundColor: "".concat(defaultColor, "14"),
|
|
50546
|
+
borderRadius: '4px',
|
|
50547
|
+
borderColor: '1px solid ' + defaultColor,
|
|
50572
50548
|
overflow: 'visible',
|
|
50573
|
-
|
|
50574
|
-
width:
|
|
50549
|
+
padding: '10px',
|
|
50550
|
+
width: fontSize,
|
|
50551
|
+
height: fontSize,
|
|
50575
50552
|
display: 'flex',
|
|
50576
50553
|
justifyContent: 'center',
|
|
50577
50554
|
alignItems: 'center'
|
|
50578
50555
|
};
|
|
50579
50556
|
default:
|
|
50580
50557
|
return {
|
|
50581
|
-
color:
|
|
50582
|
-
width:
|
|
50583
|
-
height:
|
|
50558
|
+
color: defaultColor,
|
|
50559
|
+
width: fontSize,
|
|
50560
|
+
height: fontSize,
|
|
50584
50561
|
display: 'inline-flex',
|
|
50585
50562
|
alignItems: 'center',
|
|
50586
50563
|
justifyContent: 'center'
|
|
50587
50564
|
};
|
|
50588
50565
|
}
|
|
50589
50566
|
};
|
|
50590
|
-
return (jsxRuntime.jsx(Box$1, __assign$1({ component: "span", sx: getStyles() }, { children: jsxRuntime.jsx(FontAwesomeSvgIcon, { icon: icon, fontSize:
|
|
50567
|
+
return (jsxRuntime.jsx(Box$1, __assign$1({ component: "span", sx: getStyles() }, { children: jsxRuntime.jsx(FontAwesomeSvgIcon, { icon: icon, fontSize: fontSize }) })));
|
|
50591
50568
|
};
|
|
50592
50569
|
|
|
50593
50570
|
/******************************************************************************
|
|
@@ -50973,7 +50950,12 @@ var TextFieldCss = function (muiTokens) {
|
|
|
50973
50950
|
},
|
|
50974
50951
|
MuiOutlinedInput: {
|
|
50975
50952
|
defaultProps: {
|
|
50976
|
-
|
|
50953
|
+
'&#text-field-mui': {
|
|
50954
|
+
notched: false
|
|
50955
|
+
},
|
|
50956
|
+
'&#text-field-ds': {
|
|
50957
|
+
notched: true
|
|
50958
|
+
}
|
|
50977
50959
|
},
|
|
50978
50960
|
styleOverrides: {
|
|
50979
50961
|
input: {
|
|
@@ -50981,7 +50963,7 @@ var TextFieldCss = function (muiTokens) {
|
|
|
50981
50963
|
lineHeight: '18px',
|
|
50982
50964
|
fontWeight: 400,
|
|
50983
50965
|
padding: '12px 14px !important',
|
|
50984
|
-
height: '
|
|
50966
|
+
height: '20px',
|
|
50985
50967
|
color: muiTokens.palette.greyXDark,
|
|
50986
50968
|
'&::placeholder': {
|
|
50987
50969
|
color: "".concat(muiTokens.palette.greyDark, " !important"),
|
|
@@ -50995,6 +50977,27 @@ var TextFieldCss = function (muiTokens) {
|
|
|
50995
50977
|
color: muiTokens.palette.greyDark,
|
|
50996
50978
|
borderColor: muiTokens.palette.greyLightDefaultborder,
|
|
50997
50979
|
WebkitTextFillColor: muiTokens.palette.greyDark
|
|
50980
|
+
},
|
|
50981
|
+
'&#text-field-mui': {
|
|
50982
|
+
fontSize: '14px',
|
|
50983
|
+
lineHeight: '18px',
|
|
50984
|
+
fontWeight: 400,
|
|
50985
|
+
padding: '12px 14px !important',
|
|
50986
|
+
height: '20px',
|
|
50987
|
+
color: muiTokens.palette.greyXDark,
|
|
50988
|
+
'&::placeholder': {
|
|
50989
|
+
color: "".concat(muiTokens.palette.greyDark, " !important"),
|
|
50990
|
+
opacity: 1 + ' !important',
|
|
50991
|
+
fontWeight: 400,
|
|
50992
|
+
lineHeight: '18px',
|
|
50993
|
+
fontSize: '14px'
|
|
50994
|
+
},
|
|
50995
|
+
'&.Mui-disabled': {
|
|
50996
|
+
backgroundColor: muiTokens.palette.greyXLight,
|
|
50997
|
+
color: muiTokens.palette.greyDark,
|
|
50998
|
+
borderColor: muiTokens.palette.greyLightDefaultborder,
|
|
50999
|
+
WebkitTextFillColor: muiTokens.palette.greyDark
|
|
51000
|
+
}
|
|
50998
51001
|
}
|
|
50999
51002
|
},
|
|
51000
51003
|
notchedOutline: {
|
|
@@ -51010,6 +51013,9 @@ var TextFieldCss = function (muiTokens) {
|
|
|
51010
51013
|
},
|
|
51011
51014
|
'&.Mui-hover.MuiOutlinedInput-notchedOutline': {
|
|
51012
51015
|
borderColor: muiTokens.palette.greyDark
|
|
51016
|
+
},
|
|
51017
|
+
'.MuiSvgIcon-root': {
|
|
51018
|
+
marginLeft: '-22px'
|
|
51013
51019
|
}
|
|
51014
51020
|
}
|
|
51015
51021
|
}
|
|
@@ -51017,14 +51023,35 @@ var TextFieldCss = function (muiTokens) {
|
|
|
51017
51023
|
MuiInputLabel: {
|
|
51018
51024
|
styleOverrides: {
|
|
51019
51025
|
root: {
|
|
51020
|
-
|
|
51021
|
-
|
|
51022
|
-
|
|
51023
|
-
|
|
51024
|
-
|
|
51025
|
-
|
|
51026
|
-
|
|
51027
|
-
|
|
51026
|
+
'&#text-field-mui-label': {
|
|
51027
|
+
fontSize: '14px',
|
|
51028
|
+
lineHeight: '18px',
|
|
51029
|
+
height: '16px',
|
|
51030
|
+
color: "".concat(muiTokens.palette.greyDark, " !important"),
|
|
51031
|
+
fontWeight: 400,
|
|
51032
|
+
marginTop: '-3px',
|
|
51033
|
+
'&.Mui-disabled': {
|
|
51034
|
+
color: muiTokens.palette.greyDark
|
|
51035
|
+
},
|
|
51036
|
+
'&.Mui-focused': {
|
|
51037
|
+
lineHeight: '16px',
|
|
51038
|
+
fontWeight: 500,
|
|
51039
|
+
fontSize: '16px',
|
|
51040
|
+
marginTop: 0,
|
|
51041
|
+
color: "".concat(muiTokens.palette.blueClickable, " !important"),
|
|
51042
|
+
transform: 'translate(14px, -7px) scale(0.75)'
|
|
51043
|
+
}
|
|
51044
|
+
},
|
|
51045
|
+
'&#text-field-ds-label': {
|
|
51046
|
+
fontSize: '16px',
|
|
51047
|
+
lineHeight: '16px',
|
|
51048
|
+
height: '16px',
|
|
51049
|
+
fontWeight: 500,
|
|
51050
|
+
transform: 'translate(14px, -7px) scale(0.75)',
|
|
51051
|
+
color: muiTokens.palette.greyXDark,
|
|
51052
|
+
'&.Mui-disabled': {
|
|
51053
|
+
color: muiTokens.palette.greyDark
|
|
51054
|
+
}
|
|
51028
51055
|
}
|
|
51029
51056
|
}
|
|
51030
51057
|
}
|
|
@@ -51037,32 +51064,44 @@ var ButtonCss = function (muiTokens) {
|
|
|
51037
51064
|
MuiButton: {
|
|
51038
51065
|
styleOverrides: {
|
|
51039
51066
|
root: {
|
|
51040
|
-
borderRadius:
|
|
51067
|
+
borderRadius: '4px',
|
|
51041
51068
|
padding: '7.5px 16px',
|
|
51042
51069
|
fontWeight: muiTokens.typography.fontWeightBold,
|
|
51043
51070
|
lineHeight: '18px',
|
|
51044
51071
|
textTransform: 'unset',
|
|
51045
51072
|
fontSize: '14px',
|
|
51073
|
+
height: '44px',
|
|
51046
51074
|
border: '1px solid'
|
|
51047
51075
|
},
|
|
51048
51076
|
primary: {
|
|
51049
|
-
color: muiTokens.palette.white,
|
|
51050
|
-
backgroundColor: muiTokens.palette.blueClickable,
|
|
51051
|
-
|
|
51077
|
+
color: muiTokens.palette.white + ' !important',
|
|
51078
|
+
backgroundColor: muiTokens.palette.blueClickable + ' !important',
|
|
51079
|
+
border: '1px solid' + ' !important',
|
|
51080
|
+
borderColor: muiTokens.palette.blueClickable + ' !important',
|
|
51052
51081
|
'&.Mui-disabled': {
|
|
51053
|
-
backgroundColor: muiTokens.palette.greyMediumInactive,
|
|
51054
|
-
borderColor: muiTokens.palette.greyMediumInactive,
|
|
51055
|
-
color: muiTokens.palette.white
|
|
51082
|
+
backgroundColor: muiTokens.palette.greyMediumInactive + ' !important',
|
|
51083
|
+
borderColor: muiTokens.palette.greyMediumInactive + ' !important',
|
|
51084
|
+
color: muiTokens.palette.white + ' !important'
|
|
51085
|
+
},
|
|
51086
|
+
'&:hover': {
|
|
51087
|
+
backgroundColor: muiTokens.palette.blueHoverClickable + ' !important',
|
|
51088
|
+
borderColor: muiTokens.palette.blueHoverClickable + ' !important'
|
|
51056
51089
|
}
|
|
51057
51090
|
},
|
|
51058
51091
|
secondary: {
|
|
51059
51092
|
color: muiTokens.palette.blueClickable,
|
|
51060
51093
|
backgroundColor: muiTokens.palette.white,
|
|
51094
|
+
border: '1px solid',
|
|
51061
51095
|
borderColor: muiTokens.palette.greyLightDefaultborder,
|
|
51062
51096
|
'&.Mui-disabled': {
|
|
51063
51097
|
backgroundColor: muiTokens.palette.white,
|
|
51064
|
-
borderColor: muiTokens.palette.greyLightDefaultborder,
|
|
51065
|
-
color: muiTokens.palette.greyMediumInactive
|
|
51098
|
+
borderColor: muiTokens.palette.greyLightDefaultborder + ' !important',
|
|
51099
|
+
color: muiTokens.palette.greyMediumInactive + ' !important'
|
|
51100
|
+
},
|
|
51101
|
+
'&:hover': {
|
|
51102
|
+
borderColor: muiTokens.palette.blueHoverClickable + ' !important',
|
|
51103
|
+
backgroundColor: muiTokens.palette.white + ' !important',
|
|
51104
|
+
color: muiTokens.palette.blueHoverClickable + ' !important'
|
|
51066
51105
|
}
|
|
51067
51106
|
}
|
|
51068
51107
|
}
|
|
@@ -51248,7 +51287,7 @@ var useMaterialThemeTokens = function (themeName) {
|
|
|
51248
51287
|
snackbar: 1400,
|
|
51249
51288
|
tooltip: 1500
|
|
51250
51289
|
},
|
|
51251
|
-
spacing: Number(designTokens[
|
|
51290
|
+
// spacing: Number(designTokens[`${themeName}SpacingXs`]), // spacing minimum
|
|
51252
51291
|
palette: getMuiPalette(themeName)
|
|
51253
51292
|
};
|
|
51254
51293
|
var muiCss = useMaterialThemeCss(muiTokensObject).muiCss;
|
|
@@ -51284,7 +51323,7 @@ exports.Button = Button;
|
|
|
51284
51323
|
exports.Checkbox = Checkbox;
|
|
51285
51324
|
exports.DesignSystemContext = DesignSystemContext;
|
|
51286
51325
|
exports.DesignSystemProvider = DesignSystemProvider;
|
|
51287
|
-
exports.IconProvider =
|
|
51326
|
+
exports.IconProvider = Icon;
|
|
51288
51327
|
exports.Link = Link;
|
|
51289
51328
|
exports.Text = Text;
|
|
51290
51329
|
exports.TextField = TextField;
|