@aurora-ds/components 1.7.4 → 1.7.6
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 +15 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +15 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +28 -4
- package/package.json +92 -92
- package/dist/cjs/index.css +0 -1
- package/dist/esm/index.css +0 -1
package/dist/cjs/index.js
CHANGED
|
@@ -372,6 +372,11 @@ const buildActionButtonRootStyle = (theme, variant, color, focusOptions) => {
|
|
|
372
372
|
on: c.errorOn, subtle: c.errorSubtle, subtleHover: c.errorSubtleHover, subtleActive: c.errorSubtleActive,
|
|
373
373
|
fg: c.errorMain, fgHover: c.errorHover, border: c.errorMain,
|
|
374
374
|
},
|
|
375
|
+
textPrimary: {
|
|
376
|
+
main: c.primaryMain, hover: c.primaryHover, active: c.primaryActive,
|
|
377
|
+
on: c.primaryOn, subtle: c.primarySubtle, subtleHover: c.primarySubtleHover, subtleActive: c.primarySubtleActive,
|
|
378
|
+
fg: c.textPrimary, fgHover: c.textPrimary, border: c.primaryMain,
|
|
379
|
+
},
|
|
375
380
|
};
|
|
376
381
|
const intent = intents[color];
|
|
377
382
|
const colorVariantStyles = variant === 'contained'
|
|
@@ -3463,13 +3468,15 @@ const useTextField = ({ id, ref, type, size, endAction, }) => {
|
|
|
3463
3468
|
* @example <TextField label="Name" status="error" helperText="This field is required." />
|
|
3464
3469
|
* @example <TextField label="Search" startIcon={SearchIcon} endAction={<ClearButton />} />
|
|
3465
3470
|
*/
|
|
3466
|
-
const TextField = ({ ref, label, helperText, size = 'md', status = 'default', startIcon: StartIcon, endAction, type, id, disabled, required,
|
|
3471
|
+
const TextField = ({ ref, label, helperText, size = 'md', status = 'default', startIcon: StartIcon, endAction, type, id, disabled, required,
|
|
3472
|
+
// ── Layout props → outer Stack wrapper (NOT the native <input>) ──
|
|
3473
|
+
width = '100%', minWidth = 0, maxWidth, flex, flexGrow, flexShrink, flexBasis, ...rest }) => {
|
|
3467
3474
|
const { fieldId, helperId, mergedRef, isPassword, showPassword, togglePassword, resolvedType, iconSize, iconButtonSize, hasEndSection, focusInput, } = useTextField({ id, ref, type, size, endAction });
|
|
3468
3475
|
// Associate the label with the input via `aria-labelledby` (and NOT `htmlFor`)
|
|
3469
3476
|
// so the label stays accessible without natively focusing the input on click —
|
|
3470
3477
|
// only clicking inside the bordered box should focus the field.
|
|
3471
3478
|
const labelId = `${fieldId}-label`;
|
|
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 }))] }));
|
|
3479
|
+
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 }))] }));
|
|
3473
3480
|
};
|
|
3474
3481
|
TextField.displayName = 'TextField';
|
|
3475
3482
|
|
|
@@ -5906,7 +5913,12 @@ const DrawerItem = ({ startIcon, label, selected = false, endContent, href, onCl
|
|
|
5906
5913
|
e.preventDefault();
|
|
5907
5914
|
return;
|
|
5908
5915
|
}
|
|
5909
|
-
onClick
|
|
5916
|
+
// When an onClick handler is provided (e.g. React Router's navigate),
|
|
5917
|
+
// prevent the browser from following the href and let the handler drive navigation.
|
|
5918
|
+
if (onClick) {
|
|
5919
|
+
e.preventDefault();
|
|
5920
|
+
onClick(e);
|
|
5921
|
+
}
|
|
5910
5922
|
};
|
|
5911
5923
|
const innerContent = (jsxRuntime.jsxs(Stack, { width: '100%', justifyContent: 'start', children: [jsxRuntime.jsx("span", { className: DRAWER_ITEM_STYLES.iconWrap, children: jsxRuntime.jsx(Icon, { icon: startIcon, size: 'md' }) }), isLabelVisible && (jsxRuntime.jsxs("span", { className: DRAWER_ITEM_STYLES.labelWrapper({ isFadingIn: isLabelFadingIn }), children: [jsxRuntime.jsx(Text, { variant: 'span', fontSize: 'sm', fontWeight: 'medium', className: DRAWER_ITEM_STYLES.label, textAlign: 'start', children: label }), endContent && (jsxRuntime.jsx("span", { className: DRAWER_ITEM_STYLES.endContent, children: endContent }))] }))] }));
|
|
5912
5924
|
const item = href ? (jsxRuntime.jsx("a", { href: href, className: rootClassName, "aria-disabled": disabled || undefined, "aria-current": computedAriaCurrent, "aria-label": computedAriaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-controls": ariaControls, "aria-expanded": ariaExpanded, "aria-haspopup": ariaHasPopup, tabIndex: disabled ? -1 : undefined, onClick: handleClick, children: innerContent })) : (jsxRuntime.jsx("button", { type: 'button', className: rootClassName, disabled: disabled, "aria-current": computedAriaCurrent, "aria-label": computedAriaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-controls": ariaControls, "aria-expanded": ariaExpanded, "aria-haspopup": ariaHasPopup, onClick: handleClick, children: innerContent }));
|