@groupeactual/ui-kit 0.4.14 → 0.4.16
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 +2 -1
- package/dist/cjs/index.js +28 -17
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/Icon/Icon.d.ts +2 -1
- package/dist/esm/index.js +28 -17
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/package.json +1 -1
- package/src/components/Icon/Icon.tsx +33 -10
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
3
|
+
declare const Sizes: Record<string, number>;
|
|
3
4
|
interface Props {
|
|
4
5
|
variant?: 'square' | 'none';
|
|
5
6
|
icon: IconDefinition;
|
|
6
7
|
color?: string;
|
|
7
|
-
fontSize?: number;
|
|
8
|
+
fontSize?: number | keyof typeof Sizes;
|
|
8
9
|
}
|
|
9
10
|
declare const Icon: ({ variant, icon, color, fontSize }: Props) => JSX.Element;
|
|
10
11
|
export default Icon;
|
package/dist/cjs/index.js
CHANGED
|
@@ -50513,6 +50513,15 @@ var ActAccordion = function (_a) {
|
|
|
50513
50513
|
} }, { children: content }))] })));
|
|
50514
50514
|
};
|
|
50515
50515
|
|
|
50516
|
+
var Sizes = {
|
|
50517
|
+
xs: 8,
|
|
50518
|
+
sm: 12,
|
|
50519
|
+
md: 16,
|
|
50520
|
+
lg: 24,
|
|
50521
|
+
xl: 32,
|
|
50522
|
+
xxl: 40,
|
|
50523
|
+
xxxl: 72
|
|
50524
|
+
};
|
|
50516
50525
|
// eslint-disable-next-line react/display-name
|
|
50517
50526
|
var FontAwesomeSvgIcon = React.forwardRef(function (_a, ref) {
|
|
50518
50527
|
var icon = _a.icon, fontSize = _a.fontSize;
|
|
@@ -50533,7 +50542,7 @@ var Icon = function (_a) {
|
|
|
50533
50542
|
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;
|
|
50534
50543
|
var getStyles = function () {
|
|
50535
50544
|
var theme = useTheme$1();
|
|
50536
|
-
var
|
|
50545
|
+
var usedColor = theme.palette[color]
|
|
50537
50546
|
? theme.palette[color]
|
|
50538
50547
|
: !color || (color === null || color === void 0 ? void 0 : color.length) === 0
|
|
50539
50548
|
? '#136cac'
|
|
@@ -50541,22 +50550,22 @@ var Icon = function (_a) {
|
|
|
50541
50550
|
switch (variant) {
|
|
50542
50551
|
case 'square':
|
|
50543
50552
|
return {
|
|
50544
|
-
color:
|
|
50545
|
-
backgroundColor: "".concat(
|
|
50553
|
+
color: usedColor,
|
|
50554
|
+
backgroundColor: "".concat(usedColor, "14"),
|
|
50546
50555
|
borderRadius: '4px',
|
|
50547
|
-
borderColor: '1px solid ' +
|
|
50556
|
+
borderColor: '1px solid ' + usedColor,
|
|
50548
50557
|
overflow: 'visible',
|
|
50549
50558
|
padding: '10px',
|
|
50550
|
-
width:
|
|
50551
|
-
height:
|
|
50559
|
+
width: usedFontSize,
|
|
50560
|
+
height: usedFontSize,
|
|
50552
50561
|
display: 'flex',
|
|
50553
50562
|
justifyContent: 'center',
|
|
50554
50563
|
alignItems: 'center'
|
|
50555
50564
|
};
|
|
50556
50565
|
default:
|
|
50557
50566
|
return {
|
|
50558
|
-
color:
|
|
50559
|
-
width:
|
|
50567
|
+
color: usedColor,
|
|
50568
|
+
width: usedFontSize,
|
|
50560
50569
|
height: fontSize,
|
|
50561
50570
|
display: 'inline-flex',
|
|
50562
50571
|
alignItems: 'center',
|
|
@@ -50564,7 +50573,16 @@ var Icon = function (_a) {
|
|
|
50564
50573
|
};
|
|
50565
50574
|
}
|
|
50566
50575
|
};
|
|
50567
|
-
|
|
50576
|
+
var isKey = function (key) {
|
|
50577
|
+
return key in Sizes;
|
|
50578
|
+
};
|
|
50579
|
+
var usedFontSize = isKey(fontSize)
|
|
50580
|
+
? Sizes[fontSize]
|
|
50581
|
+
: fontSize >= 0
|
|
50582
|
+
? fontSize
|
|
50583
|
+
: 16;
|
|
50584
|
+
console.log('isKey', isKey(fontSize));
|
|
50585
|
+
return (jsxRuntime.jsx(Box$1, __assign$1({ component: "span", sx: getStyles() }, { children: jsxRuntime.jsx(FontAwesomeSvgIcon, { icon: icon, fontSize: usedFontSize }) })));
|
|
50568
50586
|
};
|
|
50569
50587
|
|
|
50570
50588
|
/******************************************************************************
|
|
@@ -50949,14 +50967,7 @@ var TextFieldCss = function (muiTokens) {
|
|
|
50949
50967
|
}
|
|
50950
50968
|
},
|
|
50951
50969
|
MuiOutlinedInput: {
|
|
50952
|
-
defaultProps: {
|
|
50953
|
-
'&#text-field-mui': {
|
|
50954
|
-
notched: false
|
|
50955
|
-
},
|
|
50956
|
-
'&#text-field-ds': {
|
|
50957
|
-
notched: true
|
|
50958
|
-
}
|
|
50959
|
-
},
|
|
50970
|
+
defaultProps: {},
|
|
50960
50971
|
styleOverrides: {
|
|
50961
50972
|
input: {
|
|
50962
50973
|
fontSize: '14px',
|