@aurora-ds/components 1.7.3 → 1.7.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.
- package/dist/cjs/index.js +26 -12
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +26 -12
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +20 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -928,6 +928,10 @@ const LINK_STYLES = theme.createStyles((theme) => ({
|
|
|
928
928
|
const hoverColor = color === 'secondary' ? theme.colors.textTertiary : theme.colors.linkHover;
|
|
929
929
|
const activeColor = color === 'secondary' ? theme.colors.textPrimary : theme.colors.linkActive;
|
|
930
930
|
const disabledColor = color === 'secondary' ? theme.colors.textDisabled : theme.colors.linkDisabled;
|
|
931
|
+
// We always set `text-decoration: underline` and drive visibility via
|
|
932
|
+
// `text-decoration-color` so the transition is smooth.
|
|
933
|
+
const underlineVisible = underline === 'always' ? mainColor : 'transparent';
|
|
934
|
+
const underlineHover = underline !== 'none' ? hoverColor : 'transparent';
|
|
931
935
|
return {
|
|
932
936
|
display: 'inline-flex',
|
|
933
937
|
alignItems: 'center',
|
|
@@ -937,22 +941,25 @@ const LINK_STYLES = theme.createStyles((theme) => ({
|
|
|
937
941
|
fontSize: 'inherit',
|
|
938
942
|
lineHeight: 'inherit',
|
|
939
943
|
fontWeight: 'inherit',
|
|
940
|
-
textDecoration:
|
|
944
|
+
textDecoration: 'underline',
|
|
945
|
+
textDecorationColor: underlineVisible,
|
|
946
|
+
textUnderlineOffset: '0.2em',
|
|
941
947
|
cursor: 'pointer',
|
|
942
948
|
borderRadius: theme.radius.xs,
|
|
943
|
-
transition: `color ${theme.transition.fast}`,
|
|
949
|
+
transition: `color ${theme.transition.fast}, text-decoration-color ${theme.transition.fast}`,
|
|
944
950
|
':hover:not([aria-disabled="true"])': {
|
|
945
951
|
color: hoverColor,
|
|
946
|
-
|
|
952
|
+
textDecorationColor: underlineHover,
|
|
947
953
|
},
|
|
948
954
|
':active:not([aria-disabled="true"])': {
|
|
949
955
|
color: activeColor,
|
|
956
|
+
textDecorationColor: underline !== 'none' ? activeColor : 'transparent',
|
|
950
957
|
},
|
|
951
958
|
':focus-visible': getFocusRingStyles(theme),
|
|
952
959
|
'&[aria-disabled="true"]': {
|
|
953
960
|
color: disabledColor,
|
|
954
961
|
cursor: 'not-allowed',
|
|
955
|
-
|
|
962
|
+
textDecorationColor: 'transparent',
|
|
956
963
|
},
|
|
957
964
|
};
|
|
958
965
|
},
|
|
@@ -987,7 +994,12 @@ const Link = ({ ref, label, fontSize = 'sm', underline = 'hover', color = 'defau
|
|
|
987
994
|
e.preventDefault();
|
|
988
995
|
return;
|
|
989
996
|
}
|
|
990
|
-
onClick
|
|
997
|
+
// When an onClick handler is provided (e.g. React Router's navigate),
|
|
998
|
+
// prevent the browser from following the href and let the handler drive navigation.
|
|
999
|
+
if (onClick) {
|
|
1000
|
+
e.preventDefault();
|
|
1001
|
+
onClick(e);
|
|
1002
|
+
}
|
|
991
1003
|
};
|
|
992
1004
|
const handleKeyDown = (e) => {
|
|
993
1005
|
if (disabled && e.key === 'Enter') {
|
|
@@ -3451,13 +3463,15 @@ const useTextField = ({ id, ref, type, size, endAction, }) => {
|
|
|
3451
3463
|
* @example <TextField label="Name" status="error" helperText="This field is required." />
|
|
3452
3464
|
* @example <TextField label="Search" startIcon={SearchIcon} endAction={<ClearButton />} />
|
|
3453
3465
|
*/
|
|
3454
|
-
const TextField = ({ ref, label, helperText, size = 'md', status = 'default', startIcon: StartIcon, endAction, type, id, disabled, required,
|
|
3466
|
+
const TextField = ({ ref, label, helperText, size = 'md', status = 'default', startIcon: StartIcon, endAction, type, id, disabled, required,
|
|
3467
|
+
// ── Layout props → outer Stack wrapper (NOT the native <input>) ──
|
|
3468
|
+
width = '100%', minWidth = 0, maxWidth, flex, flexGrow, flexShrink, flexBasis, ...rest }) => {
|
|
3455
3469
|
const { fieldId, helperId, mergedRef, isPassword, showPassword, togglePassword, resolvedType, iconSize, iconButtonSize, hasEndSection, focusInput, } = useTextField({ id, ref, type, size, endAction });
|
|
3456
3470
|
// Associate the label with the input via `aria-labelledby` (and NOT `htmlFor`)
|
|
3457
3471
|
// so the label stays accessible without natively focusing the input on click —
|
|
3458
3472
|
// only clicking inside the bordered box should focus the field.
|
|
3459
3473
|
const labelId = `${fieldId}-label`;
|
|
3460
|
-
return (jsxRuntime.jsxs(Stack, { flexDirection: 'column', gap: 'xs', width: width, children: [label !== undefined && (jsxRuntime.jsxs(Text, { variant: 'label', fontSize: 'sm', fontWeight: 'medium', color: 'textSecondary', id: labelId, children: [label, required && (jsxRuntime.jsx(Text, { variant: 'span', color: 'errorMain', "aria-hidden": true, children: ' *' }))] })), jsxRuntime.jsxs("div", { className: TEXTFIELD_WRAPPER_VARIANTS({ size, status }), "data-disabled": disabled || undefined, children: [StartIcon && (jsxRuntime.jsx("span", { className: TEXTFIELD_STYLES.startIconWrap, onClick: focusInput, "aria-hidden": true, children: jsxRuntime.jsx(Icon, { icon: StartIcon, size: iconSize, strokeColor: 'textSecondary' }) })), jsxRuntime.jsx("input", { ref: mergedRef, id: fieldId, type: resolvedType, disabled: disabled, required: required, "aria-required": required || undefined, "aria-invalid": status === 'error' || undefined, "aria-labelledby": label !== undefined ? labelId : undefined, "aria-describedby": helperText !== undefined ? helperId : undefined, "aria-errormessage": status === 'error' && helperText !== undefined ? helperId : undefined, className: TEXTFIELD_INPUT_VARIANTS({ size }), ...rest }), hasEndSection && (jsxRuntime.jsxs("span", { className: TEXTFIELD_STYLES.endActionWrap, children: [endAction, isPassword && (jsxRuntime.jsx(IconButton, { icon: showPassword ? EyeSlashIcon : EyeIcon, ariaLabel: showPassword ? 'Hide password' : 'Show password', variant: 'text', color: 'neutral', size: iconButtonSize, type: 'button', onClick: togglePassword }))] }))] }), helperText !== undefined && (jsxRuntime.jsx(FormHelperText, { id: helperId, status: status, children: helperText }))] }));
|
|
3474
|
+
return (jsxRuntime.jsxs(Stack, { flexDirection: 'column', gap: 'xs', width: width, minWidth: minWidth, maxWidth: maxWidth, flex: flex, flexGrow: flexGrow, flexShrink: flexShrink, flexBasis: flexBasis, children: [label !== undefined && (jsxRuntime.jsxs(Text, { variant: 'label', fontSize: 'sm', fontWeight: 'medium', color: 'textSecondary', id: labelId, children: [label, required && (jsxRuntime.jsx(Text, { variant: 'span', color: 'errorMain', "aria-hidden": true, children: ' *' }))] })), jsxRuntime.jsxs("div", { className: TEXTFIELD_WRAPPER_VARIANTS({ size, status }), "data-disabled": disabled || undefined, children: [StartIcon && (jsxRuntime.jsx("span", { className: TEXTFIELD_STYLES.startIconWrap, onClick: focusInput, "aria-hidden": true, children: jsxRuntime.jsx(Icon, { icon: StartIcon, size: iconSize, strokeColor: 'textSecondary' }) })), jsxRuntime.jsx("input", { ref: mergedRef, id: fieldId, type: resolvedType, disabled: disabled, required: required, "aria-required": required || undefined, "aria-invalid": status === 'error' || undefined, "aria-labelledby": label !== undefined ? labelId : undefined, "aria-describedby": helperText !== undefined ? helperId : undefined, "aria-errormessage": status === 'error' && helperText !== undefined ? helperId : undefined, className: TEXTFIELD_INPUT_VARIANTS({ size }), ...rest }), hasEndSection && (jsxRuntime.jsxs("span", { className: TEXTFIELD_STYLES.endActionWrap, children: [endAction, isPassword && (jsxRuntime.jsx(IconButton, { icon: showPassword ? EyeSlashIcon : EyeIcon, ariaLabel: showPassword ? 'Hide password' : 'Show password', variant: 'text', color: 'neutral', size: iconButtonSize, type: 'button', onClick: togglePassword }))] }))] }), helperText !== undefined && (jsxRuntime.jsx(FormHelperText, { id: helperId, status: status, children: helperText }))] }));
|
|
3461
3475
|
};
|
|
3462
3476
|
TextField.displayName = 'TextField';
|
|
3463
3477
|
|
|
@@ -7045,8 +7059,8 @@ const lightPalette = {
|
|
|
7045
7059
|
skeletonSecondary: '#edf0f5',
|
|
7046
7060
|
// Link (Blue)
|
|
7047
7061
|
linkMain: '#1e40af',
|
|
7048
|
-
linkHover: '#
|
|
7049
|
-
linkActive: '#
|
|
7062
|
+
linkHover: '#2563eb',
|
|
7063
|
+
linkActive: '#4f46e5',
|
|
7050
7064
|
linkDisabled: '#93c5fd',
|
|
7051
7065
|
};
|
|
7052
7066
|
|
|
@@ -7323,11 +7337,11 @@ const darkPalette = {
|
|
|
7323
7337
|
// Skeleton — visible shimmer on dark surfaces
|
|
7324
7338
|
skeletonPrimary: '#1e293b',
|
|
7325
7339
|
skeletonSecondary: '#334155',
|
|
7326
|
-
// Link
|
|
7340
|
+
// Link — 3-step progression: sky blue → indigo → violet
|
|
7327
7341
|
// linkMain (#60a5fa) → contrast ~6.7:1 on surfaceBackground ✓ (AA)
|
|
7328
7342
|
linkMain: '#60a5fa',
|
|
7329
|
-
linkHover: '#
|
|
7330
|
-
linkActive: '#
|
|
7343
|
+
linkHover: '#818cf8',
|
|
7344
|
+
linkActive: '#c4b5fd',
|
|
7331
7345
|
linkDisabled: '#1e40af',
|
|
7332
7346
|
};
|
|
7333
7347
|
|