@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/esm/index.js
CHANGED
|
@@ -50424,7 +50424,7 @@ process.env.NODE_ENV !== "production" ? TextField$1.propTypes /* remove-proptype
|
|
|
50424
50424
|
} : void 0;
|
|
50425
50425
|
var MuiTextField = TextField$1;
|
|
50426
50426
|
|
|
50427
|
-
var Text = function (props) { return jsx(Typography$1, __assign$1({}, props)); };
|
|
50427
|
+
var Text = function (props) { return (jsx(Typography$1, __assign$1({ color: "greyXDark" }, props))); };
|
|
50428
50428
|
|
|
50429
50429
|
var Link = function (props) { return jsx(LinkMui, __assign$1({}, props)); };
|
|
50430
50430
|
|
|
@@ -50440,7 +50440,7 @@ var TextField = function (_a) {
|
|
|
50440
50440
|
setInternalValue(value);
|
|
50441
50441
|
}
|
|
50442
50442
|
}, [value]);
|
|
50443
|
-
return (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) {
|
|
50443
|
+
return (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) {
|
|
50444
50444
|
setInternalValue(e.currentTarget.value);
|
|
50445
50445
|
onChange(e);
|
|
50446
50446
|
}, onBlur: function (e) {
|
|
@@ -50459,15 +50459,17 @@ var Checkbox = function (_a) {
|
|
|
50459
50459
|
setInternalValue(value);
|
|
50460
50460
|
}
|
|
50461
50461
|
}, [value]);
|
|
50462
|
-
return (jsxs(FormControl$1, __assign$1({ fullWidth: true }, { children: [jsx(FormControlLabel$1, { control: jsx(Box$3, { children: jsx(CheckboxMUI, __assign$1({ name: name, sx: { marginTop: -
|
|
50462
|
+
return (jsxs(FormControl$1, __assign$1({ fullWidth: true }, { children: [jsx(FormControlLabel$1, { control: jsx(Box$3, { children: jsx(CheckboxMUI, __assign$1({ name: name, sx: { marginTop: '-2px' }, checked: internalValue, color: "primary", onChange: function (e) {
|
|
50463
50463
|
setInternalValue(e.target.checked);
|
|
50464
50464
|
onChange(name, e.target.checked, true);
|
|
50465
50465
|
} }, props)) }), label: jsx(Typography$1, __assign$1({ component: "span", sx: {
|
|
50466
50466
|
fontSize: '14px',
|
|
50467
|
+
marginLeft: '-3px',
|
|
50468
|
+
marginTop: '2px',
|
|
50467
50469
|
fontWeight: 400,
|
|
50468
50470
|
color: error ? '#B80025' : '#000'
|
|
50469
50471
|
} }, { children: label })) }), error && (jsx(Typography$1, __assign$1({ sx: {
|
|
50470
|
-
marginTop: -
|
|
50472
|
+
marginTop: -0.5,
|
|
50471
50473
|
color: '#B80025',
|
|
50472
50474
|
fontWeight: 400,
|
|
50473
50475
|
fontSize: '10px'
|
|
@@ -50490,7 +50492,7 @@ var FontAwesomeSvgIcon = forwardRef(function (_a, ref) {
|
|
|
50490
50492
|
var icon = _a.icon, fontSize = _a.fontSize;
|
|
50491
50493
|
var _b = icon.icon, width = _b[0], height = _b[1], svgPathData = _b[4];
|
|
50492
50494
|
return (jsx(SvgIcon$1, __assign$1({ ref: ref, viewBox: "0 0 ".concat(width, " ").concat(height), sx: {
|
|
50493
|
-
fontSize: fontSize
|
|
50495
|
+
fontSize: fontSize !== null && fontSize !== void 0 ? fontSize : '14px'
|
|
50494
50496
|
} }, { children: typeof svgPathData === 'string' ? (jsx("path", { d: svgPathData })) : (
|
|
50495
50497
|
/**
|
|
50496
50498
|
* A multi-path Font Awesome icon seems to imply a duotune icon. The 0th path seems to
|
|
@@ -50501,71 +50503,42 @@ var FontAwesomeSvgIcon = forwardRef(function (_a, ref) {
|
|
|
50501
50503
|
*/
|
|
50502
50504
|
svgPathData.map(function (d, i) { return (jsx("path", { style: { opacity: i === 0 ? 0.4 : 1 }, d: d }, i)); })) })));
|
|
50503
50505
|
});
|
|
50504
|
-
var
|
|
50505
|
-
var
|
|
50506
|
-
var getFontSize = function () {
|
|
50507
|
-
if (variant === 'roundedIcon') {
|
|
50508
|
-
return '1.5rem';
|
|
50509
|
-
}
|
|
50510
|
-
if (variant === 'smallRoundedIcon') {
|
|
50511
|
-
return '0.9rem';
|
|
50512
|
-
}
|
|
50513
|
-
switch (size) {
|
|
50514
|
-
case 'xxs':
|
|
50515
|
-
return '.8rem';
|
|
50516
|
-
case 'xs':
|
|
50517
|
-
return '1rem';
|
|
50518
|
-
case 'm':
|
|
50519
|
-
return '1.5rem';
|
|
50520
|
-
case 'lg':
|
|
50521
|
-
return '1.8rem';
|
|
50522
|
-
case 'xl':
|
|
50523
|
-
return '2.2rem';
|
|
50524
|
-
case 'xxl':
|
|
50525
|
-
return '4rem';
|
|
50526
|
-
default:
|
|
50527
|
-
return '1.2rem';
|
|
50528
|
-
}
|
|
50529
|
-
};
|
|
50506
|
+
var Icon = function (_a) {
|
|
50507
|
+
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;
|
|
50530
50508
|
var getStyles = function () {
|
|
50509
|
+
var theme = useTheme$1();
|
|
50510
|
+
var defaultColor = theme.palette[color]
|
|
50511
|
+
? theme.palette[color]
|
|
50512
|
+
: !color || (color === null || color === void 0 ? void 0 : color.length) === 0
|
|
50513
|
+
? '#136cac'
|
|
50514
|
+
: color;
|
|
50531
50515
|
switch (variant) {
|
|
50532
|
-
case '
|
|
50516
|
+
case 'square':
|
|
50533
50517
|
return {
|
|
50534
|
-
color:
|
|
50535
|
-
backgroundColor:
|
|
50536
|
-
borderRadius: '
|
|
50518
|
+
color: defaultColor,
|
|
50519
|
+
backgroundColor: "".concat(defaultColor, "14"),
|
|
50520
|
+
borderRadius: '4px',
|
|
50521
|
+
borderColor: '1px solid ' + defaultColor,
|
|
50537
50522
|
overflow: 'visible',
|
|
50538
|
-
|
|
50539
|
-
width:
|
|
50540
|
-
|
|
50541
|
-
fontSize: '1.5rem',
|
|
50542
|
-
justifyContent: 'center',
|
|
50543
|
-
alignItems: 'center'
|
|
50544
|
-
};
|
|
50545
|
-
case 'smallRoundedIcon':
|
|
50546
|
-
return {
|
|
50547
|
-
color: 'actual.main',
|
|
50548
|
-
backgroundColor: 'actual.light',
|
|
50549
|
-
borderRadius: '100px',
|
|
50550
|
-
overflow: 'visible',
|
|
50551
|
-
height: 30,
|
|
50552
|
-
width: 30,
|
|
50523
|
+
padding: '10px',
|
|
50524
|
+
width: fontSize,
|
|
50525
|
+
height: fontSize,
|
|
50553
50526
|
display: 'flex',
|
|
50554
50527
|
justifyContent: 'center',
|
|
50555
50528
|
alignItems: 'center'
|
|
50556
50529
|
};
|
|
50557
50530
|
default:
|
|
50558
50531
|
return {
|
|
50559
|
-
color:
|
|
50560
|
-
width:
|
|
50561
|
-
height:
|
|
50532
|
+
color: defaultColor,
|
|
50533
|
+
width: fontSize,
|
|
50534
|
+
height: fontSize,
|
|
50562
50535
|
display: 'inline-flex',
|
|
50563
50536
|
alignItems: 'center',
|
|
50564
50537
|
justifyContent: 'center'
|
|
50565
50538
|
};
|
|
50566
50539
|
}
|
|
50567
50540
|
};
|
|
50568
|
-
return (jsx(Box$1, __assign$1({ component: "span", sx: getStyles() }, { children: jsx(FontAwesomeSvgIcon, { icon: icon, fontSize:
|
|
50541
|
+
return (jsx(Box$1, __assign$1({ component: "span", sx: getStyles() }, { children: jsx(FontAwesomeSvgIcon, { icon: icon, fontSize: fontSize }) })));
|
|
50569
50542
|
};
|
|
50570
50543
|
|
|
50571
50544
|
/******************************************************************************
|
|
@@ -50951,7 +50924,12 @@ var TextFieldCss = function (muiTokens) {
|
|
|
50951
50924
|
},
|
|
50952
50925
|
MuiOutlinedInput: {
|
|
50953
50926
|
defaultProps: {
|
|
50954
|
-
|
|
50927
|
+
'&#text-field-mui': {
|
|
50928
|
+
notched: false
|
|
50929
|
+
},
|
|
50930
|
+
'&#text-field-ds': {
|
|
50931
|
+
notched: true
|
|
50932
|
+
}
|
|
50955
50933
|
},
|
|
50956
50934
|
styleOverrides: {
|
|
50957
50935
|
input: {
|
|
@@ -50959,7 +50937,7 @@ var TextFieldCss = function (muiTokens) {
|
|
|
50959
50937
|
lineHeight: '18px',
|
|
50960
50938
|
fontWeight: 400,
|
|
50961
50939
|
padding: '12px 14px !important',
|
|
50962
|
-
height: '
|
|
50940
|
+
height: '20px',
|
|
50963
50941
|
color: muiTokens.palette.greyXDark,
|
|
50964
50942
|
'&::placeholder': {
|
|
50965
50943
|
color: "".concat(muiTokens.palette.greyDark, " !important"),
|
|
@@ -50973,6 +50951,27 @@ var TextFieldCss = function (muiTokens) {
|
|
|
50973
50951
|
color: muiTokens.palette.greyDark,
|
|
50974
50952
|
borderColor: muiTokens.palette.greyLightDefaultborder,
|
|
50975
50953
|
WebkitTextFillColor: muiTokens.palette.greyDark
|
|
50954
|
+
},
|
|
50955
|
+
'&#text-field-mui': {
|
|
50956
|
+
fontSize: '14px',
|
|
50957
|
+
lineHeight: '18px',
|
|
50958
|
+
fontWeight: 400,
|
|
50959
|
+
padding: '12px 14px !important',
|
|
50960
|
+
height: '20px',
|
|
50961
|
+
color: muiTokens.palette.greyXDark,
|
|
50962
|
+
'&::placeholder': {
|
|
50963
|
+
color: "".concat(muiTokens.palette.greyDark, " !important"),
|
|
50964
|
+
opacity: 1 + ' !important',
|
|
50965
|
+
fontWeight: 400,
|
|
50966
|
+
lineHeight: '18px',
|
|
50967
|
+
fontSize: '14px'
|
|
50968
|
+
},
|
|
50969
|
+
'&.Mui-disabled': {
|
|
50970
|
+
backgroundColor: muiTokens.palette.greyXLight,
|
|
50971
|
+
color: muiTokens.palette.greyDark,
|
|
50972
|
+
borderColor: muiTokens.palette.greyLightDefaultborder,
|
|
50973
|
+
WebkitTextFillColor: muiTokens.palette.greyDark
|
|
50974
|
+
}
|
|
50976
50975
|
}
|
|
50977
50976
|
},
|
|
50978
50977
|
notchedOutline: {
|
|
@@ -50988,6 +50987,9 @@ var TextFieldCss = function (muiTokens) {
|
|
|
50988
50987
|
},
|
|
50989
50988
|
'&.Mui-hover.MuiOutlinedInput-notchedOutline': {
|
|
50990
50989
|
borderColor: muiTokens.palette.greyDark
|
|
50990
|
+
},
|
|
50991
|
+
'.MuiSvgIcon-root': {
|
|
50992
|
+
marginLeft: '-22px'
|
|
50991
50993
|
}
|
|
50992
50994
|
}
|
|
50993
50995
|
}
|
|
@@ -50995,14 +50997,35 @@ var TextFieldCss = function (muiTokens) {
|
|
|
50995
50997
|
MuiInputLabel: {
|
|
50996
50998
|
styleOverrides: {
|
|
50997
50999
|
root: {
|
|
50998
|
-
|
|
50999
|
-
|
|
51000
|
-
|
|
51001
|
-
|
|
51002
|
-
|
|
51003
|
-
|
|
51004
|
-
|
|
51005
|
-
|
|
51000
|
+
'&#text-field-mui-label': {
|
|
51001
|
+
fontSize: '14px',
|
|
51002
|
+
lineHeight: '18px',
|
|
51003
|
+
height: '16px',
|
|
51004
|
+
color: "".concat(muiTokens.palette.greyDark, " !important"),
|
|
51005
|
+
fontWeight: 400,
|
|
51006
|
+
marginTop: '-3px',
|
|
51007
|
+
'&.Mui-disabled': {
|
|
51008
|
+
color: muiTokens.palette.greyDark
|
|
51009
|
+
},
|
|
51010
|
+
'&.Mui-focused': {
|
|
51011
|
+
lineHeight: '16px',
|
|
51012
|
+
fontWeight: 500,
|
|
51013
|
+
fontSize: '16px',
|
|
51014
|
+
marginTop: 0,
|
|
51015
|
+
color: "".concat(muiTokens.palette.blueClickable, " !important"),
|
|
51016
|
+
transform: 'translate(14px, -7px) scale(0.75)'
|
|
51017
|
+
}
|
|
51018
|
+
},
|
|
51019
|
+
'&#text-field-ds-label': {
|
|
51020
|
+
fontSize: '16px',
|
|
51021
|
+
lineHeight: '16px',
|
|
51022
|
+
height: '16px',
|
|
51023
|
+
fontWeight: 500,
|
|
51024
|
+
transform: 'translate(14px, -7px) scale(0.75)',
|
|
51025
|
+
color: muiTokens.palette.greyXDark,
|
|
51026
|
+
'&.Mui-disabled': {
|
|
51027
|
+
color: muiTokens.palette.greyDark
|
|
51028
|
+
}
|
|
51006
51029
|
}
|
|
51007
51030
|
}
|
|
51008
51031
|
}
|
|
@@ -51015,12 +51038,13 @@ var ButtonCss = function (muiTokens) {
|
|
|
51015
51038
|
MuiButton: {
|
|
51016
51039
|
styleOverrides: {
|
|
51017
51040
|
root: {
|
|
51018
|
-
borderRadius:
|
|
51041
|
+
borderRadius: '4px',
|
|
51019
51042
|
padding: '7.5px 16px',
|
|
51020
51043
|
fontWeight: muiTokens.typography.fontWeightBold,
|
|
51021
51044
|
lineHeight: '18px',
|
|
51022
51045
|
textTransform: 'unset',
|
|
51023
51046
|
fontSize: '14px',
|
|
51047
|
+
height: '44px',
|
|
51024
51048
|
border: '1px solid'
|
|
51025
51049
|
},
|
|
51026
51050
|
primary: {
|
|
@@ -51049,8 +51073,9 @@ var ButtonCss = function (muiTokens) {
|
|
|
51049
51073
|
color: muiTokens.palette.greyMediumInactive + ' !important'
|
|
51050
51074
|
},
|
|
51051
51075
|
'&:hover': {
|
|
51052
|
-
borderColor: muiTokens.palette.
|
|
51053
|
-
backgroundColor: muiTokens.palette.white + ' !important'
|
|
51076
|
+
borderColor: muiTokens.palette.blueHoverClickable + ' !important',
|
|
51077
|
+
backgroundColor: muiTokens.palette.white + ' !important',
|
|
51078
|
+
color: muiTokens.palette.blueHoverClickable + ' !important'
|
|
51054
51079
|
}
|
|
51055
51080
|
}
|
|
51056
51081
|
}
|
|
@@ -51236,7 +51261,7 @@ var useMaterialThemeTokens = function (themeName) {
|
|
|
51236
51261
|
snackbar: 1400,
|
|
51237
51262
|
tooltip: 1500
|
|
51238
51263
|
},
|
|
51239
|
-
spacing: Number(designTokens[
|
|
51264
|
+
// spacing: Number(designTokens[`${themeName}SpacingXs`]), // spacing minimum
|
|
51240
51265
|
palette: getMuiPalette(themeName)
|
|
51241
51266
|
};
|
|
51242
51267
|
var muiCss = useMaterialThemeCss(muiTokensObject).muiCss;
|
|
@@ -51267,5 +51292,5 @@ var DesignSystemProvider = function (_a) {
|
|
|
51267
51292
|
return (jsx(DesignSystemContext.Provider, __assign$1({ value: { isDarkTheme: isDarkTheme, themeName: themeName, toggleDarkTheme: toggleDarkTheme } }, { children: jsx(MaterialThemeProvider, { children: children }) })));
|
|
51268
51293
|
};
|
|
51269
51294
|
|
|
51270
|
-
export { ActAccordion as Accordion, Button, Checkbox, DesignSystemContext, DesignSystemProvider, IconProvider, Link, Text, TextField };
|
|
51295
|
+
export { ActAccordion as Accordion, Button, Checkbox, DesignSystemContext, DesignSystemProvider, Icon as IconProvider, Link, Text, TextField };
|
|
51271
51296
|
//# sourceMappingURL=index.js.map
|