@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/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: underline === 'always' ? 'underline' : 'none',
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
- textDecoration: underline !== 'none' ? 'underline' : 'none',
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
- textDecoration: 'none',
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?.(e);
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') {
@@ -3281,6 +3293,7 @@ const TEXTFIELD_WRAPPER_VARIANTS = createVariants((theme) => {
3281
3293
  // `stretch` lets the inner input fill the full height of the box so
3282
3294
  // clicking anywhere (including the vertical padding area) hits it.
3283
3295
  alignItems: 'stretch',
3296
+ width: '100%',
3284
3297
  boxSizing: 'border-box',
3285
3298
  borderWidth: '1px',
3286
3299
  borderStyle: 'solid',
@@ -3430,13 +3443,13 @@ const useTextField = ({ id, ref, type, size, endAction, }) => {
3430
3443
  * @example <TextField label="Name" status="error" helperText="This field is required." />
3431
3444
  * @example <TextField label="Search" startIcon={SearchIcon} endAction={<ClearButton />} />
3432
3445
  */
3433
- const TextField = ({ ref, label, helperText, size = 'md', status = 'default', startIcon: StartIcon, endAction, type, id, disabled, required, ...rest }) => {
3446
+ const TextField = ({ ref, label, helperText, size = 'md', status = 'default', startIcon: StartIcon, endAction, type, id, disabled, required, width = '100%', ...rest }) => {
3434
3447
  const { fieldId, helperId, mergedRef, isPassword, showPassword, togglePassword, resolvedType, iconSize, iconButtonSize, hasEndSection, focusInput, } = useTextField({ id, ref, type, size, endAction });
3435
3448
  // Associate the label with the input via `aria-labelledby` (and NOT `htmlFor`)
3436
3449
  // so the label stays accessible without natively focusing the input on click —
3437
3450
  // only clicking inside the bordered box should focus the field.
3438
3451
  const labelId = `${fieldId}-label`;
3439
- return (jsxs(Stack, { flexDirection: 'column', gap: 'xs', 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 }))] }));
3452
+ 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 }))] }));
3440
3453
  };
3441
3454
  TextField.displayName = 'TextField';
3442
3455
 
@@ -7024,8 +7037,8 @@ const lightPalette = {
7024
7037
  skeletonSecondary: '#edf0f5',
7025
7038
  // Link (Blue)
7026
7039
  linkMain: '#1e40af',
7027
- linkHover: '#1d4ed8',
7028
- linkActive: '#2563eb',
7040
+ linkHover: '#2563eb',
7041
+ linkActive: '#4f46e5',
7029
7042
  linkDisabled: '#93c5fd',
7030
7043
  };
7031
7044
 
@@ -7302,11 +7315,11 @@ const darkPalette = {
7302
7315
  // Skeleton — visible shimmer on dark surfaces
7303
7316
  skeletonPrimary: '#1e293b',
7304
7317
  skeletonSecondary: '#334155',
7305
- // Link (Blue)
7318
+ // Link — 3-step progression: sky blue → indigo → violet
7306
7319
  // linkMain (#60a5fa) → contrast ~6.7:1 on surfaceBackground ✓ (AA)
7307
7320
  linkMain: '#60a5fa',
7308
- linkHover: '#93c5fd',
7309
- linkActive: '#bfdbfe',
7321
+ linkHover: '#818cf8',
7322
+ linkActive: '#c4b5fd',
7310
7323
  linkDisabled: '#1e40af',
7311
7324
  };
7312
7325