@aurora-ds/components 0.24.1 → 0.24.2
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/index.js +6 -19
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils/ui/components/data-display/status/getStatusColorStyles.utils.d.ts +2 -2
- package/dist/esm/index.js +6 -19
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/ui/components/data-display/status/getStatusColorStyles.utils.d.ts +2 -2
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -374,24 +374,12 @@ const getStatusColorStyles = (theme, color, variant, disabled) => {
|
|
|
374
374
|
};
|
|
375
375
|
return colorMap[color][variant];
|
|
376
376
|
};
|
|
377
|
-
const getStatusTextColor = (
|
|
377
|
+
const getStatusTextColor = (color, disabled) => {
|
|
378
378
|
if (disabled) {
|
|
379
|
-
return
|
|
379
|
+
return 'disabledText';
|
|
380
380
|
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
primary: theme.colors.primary,
|
|
384
|
-
success: theme.colors.success,
|
|
385
|
-
warning: theme.colors.warning,
|
|
386
|
-
error: theme.colors.error,
|
|
387
|
-
info: theme.colors.info,
|
|
388
|
-
highlight: theme.colors.highlight,
|
|
389
|
-
accent: theme.colors.accent,
|
|
390
|
-
new: theme.colors.new,
|
|
391
|
-
rose: theme.colors.rose,
|
|
392
|
-
yellow: theme.colors.yellow,
|
|
393
|
-
};
|
|
394
|
-
return colorMap[color];
|
|
381
|
+
// Retourne directement la clé de couleur du thème
|
|
382
|
+
return color;
|
|
395
383
|
};
|
|
396
384
|
|
|
397
385
|
/**
|
|
@@ -480,8 +468,7 @@ const getStatusContentSize = (size) => {
|
|
|
480
468
|
*/
|
|
481
469
|
const Status = ({ label, icon, variant = 'filled', color = 'default', size = 'md', gap, radius, disabled = false, ariaLabel, ariaLabelledBy, ariaDescribedBy, role, tabIndex, }) => {
|
|
482
470
|
const isIconOnly = Boolean(icon) && !label;
|
|
483
|
-
const
|
|
484
|
-
const textColor = getStatusTextColor(theme$1, color, disabled);
|
|
471
|
+
const textColor = getStatusTextColor(color, disabled);
|
|
485
472
|
return (jsxRuntime.jsxs("span", { className: STATUS_STYLES.root({
|
|
486
473
|
variant,
|
|
487
474
|
color,
|
|
@@ -2903,7 +2890,7 @@ const DRAWER_ITEM_STYLES = theme.createStyles((theme) => ({
|
|
|
2903
2890
|
* Similar to a text button with selected state support.
|
|
2904
2891
|
*/
|
|
2905
2892
|
const DrawerItem = ({ label, startIcon, endIcon, selected = false, onClick, disabled, chip, ariaLabel, ariaLabelledBy, ariaDescribedBy, role, tabIndex, }) => {
|
|
2906
|
-
return (jsxRuntime.jsxs("button", { onClick: onClick, disabled: disabled, type: 'button', className: DRAWER_ITEM_STYLES.root({ selected }), "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, role: role, tabIndex: tabIndex, children: [jsxRuntime.jsxs(Stack, { children: [startIcon && (jsxRuntime.jsx(Icon, { children: startIcon })), jsxRuntime.jsx(Text, { variant: 'label', maxLines: 1, children: label }), endIcon && (jsxRuntime.jsx(Icon, { children: endIcon }))] }), chip && !selected && (jsxRuntime.jsx(Status, { ...chip, size: '2xs', color: chip.color ?? 'info', disabled: disabled }))] }));
|
|
2893
|
+
return (jsxRuntime.jsxs("button", { onClick: onClick, disabled: disabled, type: 'button', className: DRAWER_ITEM_STYLES.root({ selected }), "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, role: role, tabIndex: tabIndex, children: [jsxRuntime.jsxs(Stack, { children: [startIcon && (jsxRuntime.jsx(Icon, { color: selected ? 'surface' : 'textSecondary', children: startIcon })), jsxRuntime.jsx(Text, { variant: 'label', maxLines: 1, color: selected ? 'surface' : 'textSecondary', children: label }), endIcon && (jsxRuntime.jsx(Icon, { color: selected ? 'surface' : 'textSecondary', children: endIcon }))] }), chip && !selected && (jsxRuntime.jsx(Status, { ...chip, size: '2xs', color: chip.color ?? 'info', disabled: disabled }))] }));
|
|
2907
2894
|
};
|
|
2908
2895
|
DrawerItem.displayName = 'DrawerItem';
|
|
2909
2896
|
|