@groupeactual/ui-kit 0.4.13 → 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/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 +94 -69
- package/dist/cjs/index.js.map +1 -1
- 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 +94 -69
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/package.json +3 -2
- package/src/components/Form/Checkbox/Checkbox.tsx +4 -2
- package/src/components/Form/TextField/TextField.tsx +3 -2
- 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
|
@@ -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) {
|
|
@@ -50485,15 +50485,17 @@ var Checkbox = function (_a) {
|
|
|
50485
50485
|
setInternalValue(value);
|
|
50486
50486
|
}
|
|
50487
50487
|
}, [value]);
|
|
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: -
|
|
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
50491
|
} }, props)) }), label: jsxRuntime.jsx(Typography$1, __assign$1({ component: "span", sx: {
|
|
50492
50492
|
fontSize: '14px',
|
|
50493
|
+
marginLeft: '-3px',
|
|
50494
|
+
marginTop: '2px',
|
|
50493
50495
|
fontWeight: 400,
|
|
50494
50496
|
color: error ? '#B80025' : '#000'
|
|
50495
50497
|
} }, { children: label })) }), error && (jsxRuntime.jsx(Typography$1, __assign$1({ sx: {
|
|
50496
|
-
marginTop: -
|
|
50498
|
+
marginTop: -0.5,
|
|
50497
50499
|
color: '#B80025',
|
|
50498
50500
|
fontWeight: 400,
|
|
50499
50501
|
fontSize: '10px'
|
|
@@ -50516,7 +50518,7 @@ var FontAwesomeSvgIcon = React.forwardRef(function (_a, ref) {
|
|
|
50516
50518
|
var icon = _a.icon, fontSize = _a.fontSize;
|
|
50517
50519
|
var _b = icon.icon, width = _b[0], height = _b[1], svgPathData = _b[4];
|
|
50518
50520
|
return (jsxRuntime.jsx(SvgIcon$1, __assign$1({ ref: ref, viewBox: "0 0 ".concat(width, " ").concat(height), sx: {
|
|
50519
|
-
fontSize: fontSize
|
|
50521
|
+
fontSize: fontSize !== null && fontSize !== void 0 ? fontSize : '14px'
|
|
50520
50522
|
} }, { children: typeof svgPathData === 'string' ? (jsxRuntime.jsx("path", { d: svgPathData })) : (
|
|
50521
50523
|
/**
|
|
50522
50524
|
* A multi-path Font Awesome icon seems to imply a duotune icon. The 0th path seems to
|
|
@@ -50527,71 +50529,42 @@ var FontAwesomeSvgIcon = React.forwardRef(function (_a, ref) {
|
|
|
50527
50529
|
*/
|
|
50528
50530
|
svgPathData.map(function (d, i) { return (jsxRuntime.jsx("path", { style: { opacity: i === 0 ? 0.4 : 1 }, d: d }, i)); })) })));
|
|
50529
50531
|
});
|
|
50530
|
-
var
|
|
50531
|
-
var
|
|
50532
|
-
var getFontSize = function () {
|
|
50533
|
-
if (variant === 'roundedIcon') {
|
|
50534
|
-
return '1.5rem';
|
|
50535
|
-
}
|
|
50536
|
-
if (variant === 'smallRoundedIcon') {
|
|
50537
|
-
return '0.9rem';
|
|
50538
|
-
}
|
|
50539
|
-
switch (size) {
|
|
50540
|
-
case 'xxs':
|
|
50541
|
-
return '.8rem';
|
|
50542
|
-
case 'xs':
|
|
50543
|
-
return '1rem';
|
|
50544
|
-
case 'm':
|
|
50545
|
-
return '1.5rem';
|
|
50546
|
-
case 'lg':
|
|
50547
|
-
return '1.8rem';
|
|
50548
|
-
case 'xl':
|
|
50549
|
-
return '2.2rem';
|
|
50550
|
-
case 'xxl':
|
|
50551
|
-
return '4rem';
|
|
50552
|
-
default:
|
|
50553
|
-
return '1.2rem';
|
|
50554
|
-
}
|
|
50555
|
-
};
|
|
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;
|
|
50556
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;
|
|
50557
50541
|
switch (variant) {
|
|
50558
|
-
case '
|
|
50542
|
+
case 'square':
|
|
50559
50543
|
return {
|
|
50560
|
-
color:
|
|
50561
|
-
backgroundColor:
|
|
50562
|
-
borderRadius: '
|
|
50544
|
+
color: defaultColor,
|
|
50545
|
+
backgroundColor: "".concat(defaultColor, "14"),
|
|
50546
|
+
borderRadius: '4px',
|
|
50547
|
+
borderColor: '1px solid ' + defaultColor,
|
|
50563
50548
|
overflow: 'visible',
|
|
50564
|
-
|
|
50565
|
-
width:
|
|
50566
|
-
|
|
50567
|
-
fontSize: '1.5rem',
|
|
50568
|
-
justifyContent: 'center',
|
|
50569
|
-
alignItems: 'center'
|
|
50570
|
-
};
|
|
50571
|
-
case 'smallRoundedIcon':
|
|
50572
|
-
return {
|
|
50573
|
-
color: 'actual.main',
|
|
50574
|
-
backgroundColor: 'actual.light',
|
|
50575
|
-
borderRadius: '100px',
|
|
50576
|
-
overflow: 'visible',
|
|
50577
|
-
height: 30,
|
|
50578
|
-
width: 30,
|
|
50549
|
+
padding: '10px',
|
|
50550
|
+
width: fontSize,
|
|
50551
|
+
height: fontSize,
|
|
50579
50552
|
display: 'flex',
|
|
50580
50553
|
justifyContent: 'center',
|
|
50581
50554
|
alignItems: 'center'
|
|
50582
50555
|
};
|
|
50583
50556
|
default:
|
|
50584
50557
|
return {
|
|
50585
|
-
color:
|
|
50586
|
-
width:
|
|
50587
|
-
height:
|
|
50558
|
+
color: defaultColor,
|
|
50559
|
+
width: fontSize,
|
|
50560
|
+
height: fontSize,
|
|
50588
50561
|
display: 'inline-flex',
|
|
50589
50562
|
alignItems: 'center',
|
|
50590
50563
|
justifyContent: 'center'
|
|
50591
50564
|
};
|
|
50592
50565
|
}
|
|
50593
50566
|
};
|
|
50594
|
-
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 }) })));
|
|
50595
50568
|
};
|
|
50596
50569
|
|
|
50597
50570
|
/******************************************************************************
|
|
@@ -50977,7 +50950,12 @@ var TextFieldCss = function (muiTokens) {
|
|
|
50977
50950
|
},
|
|
50978
50951
|
MuiOutlinedInput: {
|
|
50979
50952
|
defaultProps: {
|
|
50980
|
-
|
|
50953
|
+
'&#text-field-mui': {
|
|
50954
|
+
notched: false
|
|
50955
|
+
},
|
|
50956
|
+
'&#text-field-ds': {
|
|
50957
|
+
notched: true
|
|
50958
|
+
}
|
|
50981
50959
|
},
|
|
50982
50960
|
styleOverrides: {
|
|
50983
50961
|
input: {
|
|
@@ -50985,7 +50963,7 @@ var TextFieldCss = function (muiTokens) {
|
|
|
50985
50963
|
lineHeight: '18px',
|
|
50986
50964
|
fontWeight: 400,
|
|
50987
50965
|
padding: '12px 14px !important',
|
|
50988
|
-
height: '
|
|
50966
|
+
height: '20px',
|
|
50989
50967
|
color: muiTokens.palette.greyXDark,
|
|
50990
50968
|
'&::placeholder': {
|
|
50991
50969
|
color: "".concat(muiTokens.palette.greyDark, " !important"),
|
|
@@ -50999,6 +50977,27 @@ var TextFieldCss = function (muiTokens) {
|
|
|
50999
50977
|
color: muiTokens.palette.greyDark,
|
|
51000
50978
|
borderColor: muiTokens.palette.greyLightDefaultborder,
|
|
51001
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
|
+
}
|
|
51002
51001
|
}
|
|
51003
51002
|
},
|
|
51004
51003
|
notchedOutline: {
|
|
@@ -51014,6 +51013,9 @@ var TextFieldCss = function (muiTokens) {
|
|
|
51014
51013
|
},
|
|
51015
51014
|
'&.Mui-hover.MuiOutlinedInput-notchedOutline': {
|
|
51016
51015
|
borderColor: muiTokens.palette.greyDark
|
|
51016
|
+
},
|
|
51017
|
+
'.MuiSvgIcon-root': {
|
|
51018
|
+
marginLeft: '-22px'
|
|
51017
51019
|
}
|
|
51018
51020
|
}
|
|
51019
51021
|
}
|
|
@@ -51021,14 +51023,35 @@ var TextFieldCss = function (muiTokens) {
|
|
|
51021
51023
|
MuiInputLabel: {
|
|
51022
51024
|
styleOverrides: {
|
|
51023
51025
|
root: {
|
|
51024
|
-
|
|
51025
|
-
|
|
51026
|
-
|
|
51027
|
-
|
|
51028
|
-
|
|
51029
|
-
|
|
51030
|
-
|
|
51031
|
-
|
|
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
|
+
}
|
|
51032
51055
|
}
|
|
51033
51056
|
}
|
|
51034
51057
|
}
|
|
@@ -51041,12 +51064,13 @@ var ButtonCss = function (muiTokens) {
|
|
|
51041
51064
|
MuiButton: {
|
|
51042
51065
|
styleOverrides: {
|
|
51043
51066
|
root: {
|
|
51044
|
-
borderRadius:
|
|
51067
|
+
borderRadius: '4px',
|
|
51045
51068
|
padding: '7.5px 16px',
|
|
51046
51069
|
fontWeight: muiTokens.typography.fontWeightBold,
|
|
51047
51070
|
lineHeight: '18px',
|
|
51048
51071
|
textTransform: 'unset',
|
|
51049
51072
|
fontSize: '14px',
|
|
51073
|
+
height: '44px',
|
|
51050
51074
|
border: '1px solid'
|
|
51051
51075
|
},
|
|
51052
51076
|
primary: {
|
|
@@ -51075,8 +51099,9 @@ var ButtonCss = function (muiTokens) {
|
|
|
51075
51099
|
color: muiTokens.palette.greyMediumInactive + ' !important'
|
|
51076
51100
|
},
|
|
51077
51101
|
'&:hover': {
|
|
51078
|
-
borderColor: muiTokens.palette.
|
|
51079
|
-
backgroundColor: muiTokens.palette.white + ' !important'
|
|
51102
|
+
borderColor: muiTokens.palette.blueHoverClickable + ' !important',
|
|
51103
|
+
backgroundColor: muiTokens.palette.white + ' !important',
|
|
51104
|
+
color: muiTokens.palette.blueHoverClickable + ' !important'
|
|
51080
51105
|
}
|
|
51081
51106
|
}
|
|
51082
51107
|
}
|
|
@@ -51262,7 +51287,7 @@ var useMaterialThemeTokens = function (themeName) {
|
|
|
51262
51287
|
snackbar: 1400,
|
|
51263
51288
|
tooltip: 1500
|
|
51264
51289
|
},
|
|
51265
|
-
spacing: Number(designTokens[
|
|
51290
|
+
// spacing: Number(designTokens[`${themeName}SpacingXs`]), // spacing minimum
|
|
51266
51291
|
palette: getMuiPalette(themeName)
|
|
51267
51292
|
};
|
|
51268
51293
|
var muiCss = useMaterialThemeCss(muiTokensObject).muiCss;
|
|
@@ -51298,7 +51323,7 @@ exports.Button = Button;
|
|
|
51298
51323
|
exports.Checkbox = Checkbox;
|
|
51299
51324
|
exports.DesignSystemContext = DesignSystemContext;
|
|
51300
51325
|
exports.DesignSystemProvider = DesignSystemProvider;
|
|
51301
|
-
exports.IconProvider =
|
|
51326
|
+
exports.IconProvider = Icon;
|
|
51302
51327
|
exports.Link = Link;
|
|
51303
51328
|
exports.Text = Text;
|
|
51304
51329
|
exports.TextField = TextField;
|