@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/esm/index.js
CHANGED
|
@@ -908,6 +908,10 @@ const LINK_STYLES = createStyles((theme) => ({
|
|
|
908
908
|
const hoverColor = color === 'secondary' ? theme.colors.textTertiary : theme.colors.linkHover;
|
|
909
909
|
const activeColor = color === 'secondary' ? theme.colors.textPrimary : theme.colors.linkActive;
|
|
910
910
|
const disabledColor = color === 'secondary' ? theme.colors.textDisabled : theme.colors.linkDisabled;
|
|
911
|
+
// We always set `text-decoration: underline` and drive visibility via
|
|
912
|
+
// `text-decoration-color` so the transition is smooth.
|
|
913
|
+
const underlineVisible = underline === 'always' ? mainColor : 'transparent';
|
|
914
|
+
const underlineHover = underline !== 'none' ? hoverColor : 'transparent';
|
|
911
915
|
return {
|
|
912
916
|
display: 'inline-flex',
|
|
913
917
|
alignItems: 'center',
|
|
@@ -917,22 +921,25 @@ const LINK_STYLES = createStyles((theme) => ({
|
|
|
917
921
|
fontSize: 'inherit',
|
|
918
922
|
lineHeight: 'inherit',
|
|
919
923
|
fontWeight: 'inherit',
|
|
920
|
-
textDecoration:
|
|
924
|
+
textDecoration: 'underline',
|
|
925
|
+
textDecorationColor: underlineVisible,
|
|
926
|
+
textUnderlineOffset: '0.2em',
|
|
921
927
|
cursor: 'pointer',
|
|
922
928
|
borderRadius: theme.radius.xs,
|
|
923
|
-
transition: `color ${theme.transition.fast}`,
|
|
929
|
+
transition: `color ${theme.transition.fast}, text-decoration-color ${theme.transition.fast}`,
|
|
924
930
|
':hover:not([aria-disabled="true"])': {
|
|
925
931
|
color: hoverColor,
|
|
926
|
-
|
|
932
|
+
textDecorationColor: underlineHover,
|
|
927
933
|
},
|
|
928
934
|
':active:not([aria-disabled="true"])': {
|
|
929
935
|
color: activeColor,
|
|
936
|
+
textDecorationColor: underline !== 'none' ? activeColor : 'transparent',
|
|
930
937
|
},
|
|
931
938
|
':focus-visible': getFocusRingStyles(theme),
|
|
932
939
|
'&[aria-disabled="true"]': {
|
|
933
940
|
color: disabledColor,
|
|
934
941
|
cursor: 'not-allowed',
|
|
935
|
-
|
|
942
|
+
textDecorationColor: 'transparent',
|
|
936
943
|
},
|
|
937
944
|
};
|
|
938
945
|
},
|
|
@@ -967,7 +974,12 @@ const Link = ({ ref, label, fontSize = 'sm', underline = 'hover', color = 'defau
|
|
|
967
974
|
e.preventDefault();
|
|
968
975
|
return;
|
|
969
976
|
}
|
|
970
|
-
onClick
|
|
977
|
+
// When an onClick handler is provided (e.g. React Router's navigate),
|
|
978
|
+
// prevent the browser from following the href and let the handler drive navigation.
|
|
979
|
+
if (onClick) {
|
|
980
|
+
e.preventDefault();
|
|
981
|
+
onClick(e);
|
|
982
|
+
}
|
|
971
983
|
};
|
|
972
984
|
const handleKeyDown = (e) => {
|
|
973
985
|
if (disabled && e.key === 'Enter') {
|
|
@@ -3431,13 +3443,15 @@ const useTextField = ({ id, ref, type, size, endAction, }) => {
|
|
|
3431
3443
|
* @example <TextField label="Name" status="error" helperText="This field is required." />
|
|
3432
3444
|
* @example <TextField label="Search" startIcon={SearchIcon} endAction={<ClearButton />} />
|
|
3433
3445
|
*/
|
|
3434
|
-
const TextField = ({ ref, label, helperText, size = 'md', status = 'default', startIcon: StartIcon, endAction, type, id, disabled, required,
|
|
3446
|
+
const TextField = ({ ref, label, helperText, size = 'md', status = 'default', startIcon: StartIcon, endAction, type, id, disabled, required,
|
|
3447
|
+
// ── Layout props → outer Stack wrapper (NOT the native <input>) ──
|
|
3448
|
+
width = '100%', minWidth = 0, maxWidth, flex, flexGrow, flexShrink, flexBasis, ...rest }) => {
|
|
3435
3449
|
const { fieldId, helperId, mergedRef, isPassword, showPassword, togglePassword, resolvedType, iconSize, iconButtonSize, hasEndSection, focusInput, } = useTextField({ id, ref, type, size, endAction });
|
|
3436
3450
|
// Associate the label with the input via `aria-labelledby` (and NOT `htmlFor`)
|
|
3437
3451
|
// so the label stays accessible without natively focusing the input on click —
|
|
3438
3452
|
// only clicking inside the bordered box should focus the field.
|
|
3439
3453
|
const labelId = `${fieldId}-label`;
|
|
3440
|
-
return (jsxs(Stack, { flexDirection: 'column', gap: 'xs', width: width, children: [label !== undefined && (jsxs(Text, { variant: 'label', fontSize: 'sm', fontWeight: 'medium', color: 'textSecondary', id: labelId, children: [label, required && (jsx(Text, { variant: 'span', color: 'errorMain', "aria-hidden": true, children: ' *' }))] })), jsxs("div", { className: TEXTFIELD_WRAPPER_VARIANTS({ size, status }), "data-disabled": disabled || undefined, children: [StartIcon && (jsx("span", { className: TEXTFIELD_STYLES.startIconWrap, onClick: focusInput, "aria-hidden": true, children: jsx(Icon, { icon: StartIcon, size: iconSize, strokeColor: 'textSecondary' }) })), 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 && (jsxs("span", { className: TEXTFIELD_STYLES.endActionWrap, children: [endAction, isPassword && (jsx(IconButton, { icon: showPassword ? EyeSlashIcon : EyeIcon, ariaLabel: showPassword ? 'Hide password' : 'Show password', variant: 'text', color: 'neutral', size: iconButtonSize, type: 'button', onClick: togglePassword }))] }))] }), helperText !== undefined && (jsx(FormHelperText, { id: helperId, status: status, children: helperText }))] }));
|
|
3454
|
+
return (jsxs(Stack, { flexDirection: 'column', gap: 'xs', width: width, minWidth: minWidth, maxWidth: maxWidth, flex: flex, flexGrow: flexGrow, flexShrink: flexShrink, flexBasis: flexBasis, children: [label !== undefined && (jsxs(Text, { variant: 'label', fontSize: 'sm', fontWeight: 'medium', color: 'textSecondary', id: labelId, children: [label, required && (jsx(Text, { variant: 'span', color: 'errorMain', "aria-hidden": true, children: ' *' }))] })), jsxs("div", { className: TEXTFIELD_WRAPPER_VARIANTS({ size, status }), "data-disabled": disabled || undefined, children: [StartIcon && (jsx("span", { className: TEXTFIELD_STYLES.startIconWrap, onClick: focusInput, "aria-hidden": true, children: jsx(Icon, { icon: StartIcon, size: iconSize, strokeColor: 'textSecondary' }) })), 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 && (jsxs("span", { className: TEXTFIELD_STYLES.endActionWrap, children: [endAction, isPassword && (jsx(IconButton, { icon: showPassword ? EyeSlashIcon : EyeIcon, ariaLabel: showPassword ? 'Hide password' : 'Show password', variant: 'text', color: 'neutral', size: iconButtonSize, type: 'button', onClick: togglePassword }))] }))] }), helperText !== undefined && (jsx(FormHelperText, { id: helperId, status: status, children: helperText }))] }));
|
|
3441
3455
|
};
|
|
3442
3456
|
TextField.displayName = 'TextField';
|
|
3443
3457
|
|
|
@@ -7025,8 +7039,8 @@ const lightPalette = {
|
|
|
7025
7039
|
skeletonSecondary: '#edf0f5',
|
|
7026
7040
|
// Link (Blue)
|
|
7027
7041
|
linkMain: '#1e40af',
|
|
7028
|
-
linkHover: '#
|
|
7029
|
-
linkActive: '#
|
|
7042
|
+
linkHover: '#2563eb',
|
|
7043
|
+
linkActive: '#4f46e5',
|
|
7030
7044
|
linkDisabled: '#93c5fd',
|
|
7031
7045
|
};
|
|
7032
7046
|
|
|
@@ -7303,11 +7317,11 @@ const darkPalette = {
|
|
|
7303
7317
|
// Skeleton — visible shimmer on dark surfaces
|
|
7304
7318
|
skeletonPrimary: '#1e293b',
|
|
7305
7319
|
skeletonSecondary: '#334155',
|
|
7306
|
-
// Link
|
|
7320
|
+
// Link — 3-step progression: sky blue → indigo → violet
|
|
7307
7321
|
// linkMain (#60a5fa) → contrast ~6.7:1 on surfaceBackground ✓ (AA)
|
|
7308
7322
|
linkMain: '#60a5fa',
|
|
7309
|
-
linkHover: '#
|
|
7310
|
-
linkActive: '#
|
|
7323
|
+
linkHover: '#818cf8',
|
|
7324
|
+
linkActive: '#c4b5fd',
|
|
7311
7325
|
linkDisabled: '#1e40af',
|
|
7312
7326
|
};
|
|
7313
7327
|
|