odaptos_design_system 2.0.179 → 2.0.181
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/Atoms/Badge/Badge.d.ts +2 -1
- package/dist/odaptos_design_system.cjs.development.js +13 -15
- package/dist/odaptos_design_system.cjs.development.js.map +1 -1
- package/dist/odaptos_design_system.cjs.production.min.js +1 -1
- package/dist/odaptos_design_system.cjs.production.min.js.map +1 -1
- package/dist/odaptos_design_system.esm.js +13 -15
- package/dist/odaptos_design_system.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/Atoms/Badge/Badge.tsx +5 -0
- package/src/Atoms/Checkbox/Checkbox.tsx +5 -9
|
@@ -7,10 +7,11 @@ interface BadgeProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
7
7
|
iconRight?: JSX.Element;
|
|
8
8
|
number?: number;
|
|
9
9
|
customColor?: string;
|
|
10
|
+
customTextColor?: string;
|
|
10
11
|
className?: string;
|
|
11
12
|
id?: string;
|
|
12
13
|
canBeRemoved?: boolean;
|
|
13
14
|
}
|
|
14
15
|
/** Figma link : https://www.figma.com/file/fjnhhbL12HvKccPmJchVnr/Atomic-Library?type=design&node-id=3073-110563&mode=dev */
|
|
15
|
-
export declare const Badge: ({ text, status, size, iconLeft, iconRight, number, customColor, className, canBeRemoved, id, ...props }: BadgeProps) => React.JSX.Element;
|
|
16
|
+
export declare const Badge: ({ text, status, size, iconLeft, iconRight, number, customColor, customTextColor, className, canBeRemoved, id, ...props }: BadgeProps) => React.JSX.Element;
|
|
16
17
|
export {};
|
|
@@ -134,6 +134,7 @@ const Badge = ({
|
|
|
134
134
|
iconRight,
|
|
135
135
|
number,
|
|
136
136
|
customColor,
|
|
137
|
+
customTextColor,
|
|
137
138
|
className,
|
|
138
139
|
canBeRemoved = false,
|
|
139
140
|
id,
|
|
@@ -141,6 +142,9 @@ const Badge = ({
|
|
|
141
142
|
}) => {
|
|
142
143
|
const badgeCustomColor = customColor ? colord.colord(customColor) : undefined;
|
|
143
144
|
const getTextColor = () => {
|
|
145
|
+
if (customTextColor) {
|
|
146
|
+
return customTextColor;
|
|
147
|
+
}
|
|
144
148
|
if (badgeCustomColor) {
|
|
145
149
|
return getReadableTextColor(badgeCustomColor);
|
|
146
150
|
} else if (status === 'idle') return '#64666A';else if (status === 'success') return '#3C743D';else if (status === 'info') return '#004799';else if (status === 'light') return '#32353A';else if (status === 'violet') return '#5C1994';else if (status === 'warning') return '#6E4F00';else if (status === 'critical') return '#98312E';else if (status === 'alt') return '#5C1994';else return '#004799';
|
|
@@ -11475,7 +11479,6 @@ function BpCheckbox({
|
|
|
11475
11479
|
id,
|
|
11476
11480
|
checked,
|
|
11477
11481
|
disabled = false,
|
|
11478
|
-
onChange,
|
|
11479
11482
|
required,
|
|
11480
11483
|
onBlur,
|
|
11481
11484
|
color = '#0077FF',
|
|
@@ -11515,13 +11518,7 @@ function BpCheckbox({
|
|
|
11515
11518
|
checked: checked,
|
|
11516
11519
|
disabled: disabled,
|
|
11517
11520
|
required: required,
|
|
11518
|
-
onChange:
|
|
11519
|
-
...e,
|
|
11520
|
-
target: {
|
|
11521
|
-
...e.target,
|
|
11522
|
-
name: name || ''
|
|
11523
|
-
}
|
|
11524
|
-
}),
|
|
11521
|
+
onChange: () => {},
|
|
11525
11522
|
onBlur: onBlur,
|
|
11526
11523
|
name: name,
|
|
11527
11524
|
id: id
|
|
@@ -11545,12 +11542,14 @@ const Checkbox = ({
|
|
|
11545
11542
|
style: {
|
|
11546
11543
|
cursor: disabled ? 'not-allowed' : 'pointer'
|
|
11547
11544
|
},
|
|
11548
|
-
onClick: () =>
|
|
11549
|
-
|
|
11550
|
-
|
|
11551
|
-
|
|
11552
|
-
|
|
11553
|
-
|
|
11545
|
+
onClick: () => {
|
|
11546
|
+
if (!disabled) onChange({
|
|
11547
|
+
target: {
|
|
11548
|
+
name: name || '',
|
|
11549
|
+
value: !checked
|
|
11550
|
+
}
|
|
11551
|
+
});
|
|
11552
|
+
}
|
|
11554
11553
|
}, leftLabel && /*#__PURE__*/React__default.createElement(TextWithLink, {
|
|
11555
11554
|
weight: "regular",
|
|
11556
11555
|
text: leftLabel,
|
|
@@ -11559,7 +11558,6 @@ const Checkbox = ({
|
|
|
11559
11558
|
}), /*#__PURE__*/React__default.createElement(BpCheckbox, {
|
|
11560
11559
|
checked: checked,
|
|
11561
11560
|
disabled: disabled,
|
|
11562
|
-
onChange: onChange,
|
|
11563
11561
|
required: required,
|
|
11564
11562
|
onBlur: onBlur,
|
|
11565
11563
|
color: color,
|