@olea-bps/base 1.0.4 → 1.0.5
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.
|
@@ -83,6 +83,12 @@ const CustomIcon = createIconSet(glyphMap, 'openasist');
|
|
|
83
83
|
* This component handles the load of the icon font and
|
|
84
84
|
* provides a simple way to include these icons.
|
|
85
85
|
*
|
|
86
|
+
* Icon lookup precedence:
|
|
87
|
+
* 1. `iconSVG` prop (explicit React component)
|
|
88
|
+
* 2. `theme.icons[icon]` (per-app SVG registry)
|
|
89
|
+
* 3. `theme.AppIcons` (per-app font icon set)
|
|
90
|
+
* 4. library-default `CustomIcon` font icon set
|
|
91
|
+
*
|
|
86
92
|
* Parameters:
|
|
87
93
|
* - icon: Name (slug) of the icon
|
|
88
94
|
* - size: Size (as Number) of the icon
|
|
@@ -94,6 +100,7 @@ const CustomIcon = createIconSet(glyphMap, 'openasist');
|
|
|
94
100
|
function IconsOpenasist({ icon, iconSVG: IconSVG, size, color, accessibilityLabel, ...props }) {
|
|
95
101
|
const theme = useTheme();
|
|
96
102
|
const { AppIcons } = theme;
|
|
103
|
+
const ThemeIcon = theme.icons?.[icon];
|
|
97
104
|
|
|
98
105
|
const iconSize = size ?? 26;
|
|
99
106
|
const iconAriaLabel = props?.['aria-label'] ?? accessibilityLabel ?? null;
|
|
@@ -113,6 +120,14 @@ function IconsOpenasist({ icon, iconSVG: IconSVG, size, color, accessibilityLabe
|
|
|
113
120
|
height={iconSize}
|
|
114
121
|
/>
|
|
115
122
|
);
|
|
123
|
+
} else if (typeof ThemeIcon === 'function') {
|
|
124
|
+
return (
|
|
125
|
+
<ThemeIcon
|
|
126
|
+
{...iconProps}
|
|
127
|
+
width={iconSize}
|
|
128
|
+
height={iconSize}
|
|
129
|
+
/>
|
|
130
|
+
);
|
|
116
131
|
} else if (AppIcons) {
|
|
117
132
|
return (
|
|
118
133
|
<AppIcons
|