@aurora-ds/components 1.7.2 → 1.7.4

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 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: underline === 'always' ? 'underline' : 'none',
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
- textDecoration: underline !== 'none' ? 'underline' : 'none',
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
- textDecoration: 'none',
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?.(e);
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') {
@@ -3301,6 +3313,7 @@ const TEXTFIELD_WRAPPER_VARIANTS = theme.createVariants((theme) => {
3301
3313
  // `stretch` lets the inner input fill the full height of the box so
3302
3314
  // clicking anywhere (including the vertical padding area) hits it.
3303
3315
  alignItems: 'stretch',
3316
+ width: '100%',
3304
3317
  boxSizing: 'border-box',
3305
3318
  borderWidth: '1px',
3306
3319
  borderStyle: 'solid',
@@ -3450,13 +3463,13 @@ const useTextField = ({ id, ref, type, size, endAction, }) => {
3450
3463
  * @example <TextField label="Name" status="error" helperText="This field is required." />
3451
3464
  * @example <TextField label="Search" startIcon={SearchIcon} endAction={<ClearButton />} />
3452
3465
  */
3453
- const TextField = ({ ref, label, helperText, size = 'md', status = 'default', startIcon: StartIcon, endAction, type, id, disabled, required, ...rest }) => {
3466
+ const TextField = ({ ref, label, helperText, size = 'md', status = 'default', startIcon: StartIcon, endAction, type, id, disabled, required, width = '100%', ...rest }) => {
3454
3467
  const { fieldId, helperId, mergedRef, isPassword, showPassword, togglePassword, resolvedType, iconSize, iconButtonSize, hasEndSection, focusInput, } = useTextField({ id, ref, type, size, endAction });
3455
3468
  // Associate the label with the input via `aria-labelledby` (and NOT `htmlFor`)
3456
3469
  // so the label stays accessible without natively focusing the input on click —
3457
3470
  // only clicking inside the bordered box should focus the field.
3458
3471
  const labelId = `${fieldId}-label`;
3459
- return (jsxRuntime.jsxs(Stack, { flexDirection: 'column', gap: 'xs', 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 }))] }));
3472
+ 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 }))] }));
3460
3473
  };
3461
3474
  TextField.displayName = 'TextField';
3462
3475
 
@@ -7044,8 +7057,8 @@ const lightPalette = {
7044
7057
  skeletonSecondary: '#edf0f5',
7045
7058
  // Link (Blue)
7046
7059
  linkMain: '#1e40af',
7047
- linkHover: '#1d4ed8',
7048
- linkActive: '#2563eb',
7060
+ linkHover: '#2563eb',
7061
+ linkActive: '#4f46e5',
7049
7062
  linkDisabled: '#93c5fd',
7050
7063
  };
7051
7064
 
@@ -7322,11 +7335,11 @@ const darkPalette = {
7322
7335
  // Skeleton — visible shimmer on dark surfaces
7323
7336
  skeletonPrimary: '#1e293b',
7324
7337
  skeletonSecondary: '#334155',
7325
- // Link (Blue)
7338
+ // Link — 3-step progression: sky blue → indigo → violet
7326
7339
  // linkMain (#60a5fa) → contrast ~6.7:1 on surfaceBackground ✓ (AA)
7327
7340
  linkMain: '#60a5fa',
7328
- linkHover: '#93c5fd',
7329
- linkActive: '#bfdbfe',
7341
+ linkHover: '#818cf8',
7342
+ linkActive: '#c4b5fd',
7330
7343
  linkDisabled: '#1e40af',
7331
7344
  };
7332
7345