@mandujs/core 0.18.10 → 0.18.11
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/package.json
CHANGED
|
@@ -202,29 +202,38 @@ export function ManduBadge({
|
|
|
202
202
|
}: ManduBadgeProps): React.ReactElement {
|
|
203
203
|
const character = MANDU_CHARACTERS[state];
|
|
204
204
|
const stateColor = stateColors[state];
|
|
205
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
205
206
|
|
|
206
207
|
const badgeStyle: React.CSSProperties = {
|
|
207
208
|
display: 'flex',
|
|
208
209
|
alignItems: 'center',
|
|
209
210
|
justifyContent: 'center',
|
|
210
|
-
gap: '
|
|
211
|
-
padding: '
|
|
211
|
+
gap: '8px',
|
|
212
|
+
padding: count > 0 ? '10px 16px' : '0',
|
|
213
|
+
width: count > 0 ? 'auto' : '48px',
|
|
214
|
+
height: '48px',
|
|
212
215
|
borderRadius: '9999px',
|
|
213
216
|
backgroundColor: colors.background.dark,
|
|
214
|
-
border: `2px solid ${stateColor}`,
|
|
217
|
+
border: `2px solid ${isHovered ? colors.brand.accent : stateColor}`,
|
|
215
218
|
cursor: 'pointer',
|
|
216
|
-
transition: `all ${animation.duration.
|
|
217
|
-
boxShadow:
|
|
218
|
-
|
|
219
|
+
transition: `all ${animation.duration.normal} ${animation.easing.spring}`,
|
|
220
|
+
boxShadow: isHovered
|
|
221
|
+
? `0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 4px ${stateColor}33`
|
|
222
|
+
: `0 4px 12px rgba(0, 0, 0, 0.3)`,
|
|
223
|
+
fontSize: '22px',
|
|
219
224
|
userSelect: 'none',
|
|
225
|
+
transform: isHovered ? 'scale(1.08)' : 'scale(1)',
|
|
226
|
+
outline: 'none',
|
|
227
|
+
lineHeight: 1,
|
|
220
228
|
};
|
|
221
229
|
|
|
222
230
|
const countStyle: React.CSSProperties = {
|
|
223
|
-
fontSize: '
|
|
224
|
-
fontWeight:
|
|
231
|
+
fontSize: '13px',
|
|
232
|
+
fontWeight: 700,
|
|
225
233
|
color: stateColor,
|
|
226
234
|
minWidth: '18px',
|
|
227
235
|
textAlign: 'center',
|
|
236
|
+
lineHeight: 1,
|
|
228
237
|
};
|
|
229
238
|
|
|
230
239
|
return (
|
|
@@ -232,9 +241,13 @@ export function ManduBadge({
|
|
|
232
241
|
data-testid={testIds.badge}
|
|
233
242
|
style={badgeStyle}
|
|
234
243
|
onClick={onClick}
|
|
244
|
+
onMouseEnter={() => setIsHovered(true)}
|
|
245
|
+
onMouseLeave={() => setIsHovered(false)}
|
|
246
|
+
onFocus={() => setIsHovered(true)}
|
|
247
|
+
onBlur={() => setIsHovered(false)}
|
|
235
248
|
aria-label={`Mandu Kitchen: ${character.message}${count > 0 ? `, ${count} issues` : ''}`}
|
|
236
249
|
>
|
|
237
|
-
<span aria-hidden="true"
|
|
250
|
+
<span aria-hidden="true">🥟</span>
|
|
238
251
|
{count > 0 && <span style={countStyle}>{count}</span>}
|
|
239
252
|
</button>
|
|
240
253
|
);
|