@westpac/ui 1.5.0 → 1.6.0
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/CHANGELOG.md +6 -0
- package/dist/component-type.json +1 -1
- package/dist/components/input-group/input-group.component.d.ts +1 -1
- package/dist/components/input-group/input-group.component.js +2 -1
- package/dist/components/input-group/input-group.types.d.ts +4 -0
- package/package.json +2 -2
- package/src/components/input-group/input-group.component.tsx +2 -1
- package/src/components/input-group/input-group.types.ts +4 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type InputGroupProps } from './input-group.types.js';
|
|
2
|
-
export declare function InputGroup({ label, hideLabel, size, hint, errorMessage, supportingText, instanceId, after, before, children, tag: Tag, className, width, id: propID, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, 'aria-label': ariaLabel, ...props }: InputGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function InputGroup({ label, hideLabel, size, hint, errorMessage, errorTitle, supportingText, instanceId, after, before, children, tag: Tag, className, width, id: propID, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, 'aria-label': ariaLabel, ...props }: InputGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,7 +6,7 @@ import { ErrorMessage, Hint, Label } from '../index.js';
|
|
|
6
6
|
import { InputGroupSupportingText } from './components/index.js';
|
|
7
7
|
import { InputGroupAddOn } from './components/input-group-add-ons/input-group-add-ons.component.js';
|
|
8
8
|
import { styles as inputGroupStyles } from './input-group.styles.js';
|
|
9
|
-
export function InputGroup({ label, hideLabel, size = 'medium', hint, errorMessage, supportingText, instanceId, after, before, children, tag: Tag = 'div', className, width = 'full', id: propID, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, 'aria-label': ariaLabel, ...props }) {
|
|
9
|
+
export function InputGroup({ label, hideLabel, size = 'medium', hint, errorMessage, errorTitle, supportingText, instanceId, after, before, children, tag: Tag = 'div', className, width = 'full', id: propID, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, 'aria-label': ariaLabel, ...props }) {
|
|
10
10
|
const _id = useId();
|
|
11
11
|
const id = useMemo(()=>instanceId || `gel-field-${_id}`, [
|
|
12
12
|
_id,
|
|
@@ -124,6 +124,7 @@ export function InputGroup({ label, hideLabel, size = 'medium', hint, errorMessa
|
|
|
124
124
|
id: `${id}-hint`
|
|
125
125
|
}, hint), errorMessage && React.createElement(ErrorMessage, {
|
|
126
126
|
id: `${id}-error`,
|
|
127
|
+
errorTitle: errorTitle,
|
|
127
128
|
message: errorMessage
|
|
128
129
|
}), React.createElement("div", {
|
|
129
130
|
className: styles.input()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@westpac/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -253,9 +253,9 @@
|
|
|
253
253
|
"typescript": "^5.5.4",
|
|
254
254
|
"vite": "^7.1.12",
|
|
255
255
|
"vitest": "^3.2.4",
|
|
256
|
-
"@westpac/style-config": "~1.0.2",
|
|
257
256
|
"@westpac/eslint-config": "~1.1.0",
|
|
258
257
|
"@westpac/test-config": "~0.0.0",
|
|
258
|
+
"@westpac/style-config": "~1.0.2",
|
|
259
259
|
"@westpac/ts-config": "~0.0.0"
|
|
260
260
|
},
|
|
261
261
|
"dependencies": {
|
|
@@ -26,6 +26,7 @@ export function InputGroup({
|
|
|
26
26
|
size = 'medium',
|
|
27
27
|
hint,
|
|
28
28
|
errorMessage,
|
|
29
|
+
errorTitle,
|
|
29
30
|
supportingText,
|
|
30
31
|
instanceId,
|
|
31
32
|
after,
|
|
@@ -135,7 +136,7 @@ export function InputGroup({
|
|
|
135
136
|
</Label>
|
|
136
137
|
)}
|
|
137
138
|
{hint && <Hint id={`${id}-hint`}>{hint}</Hint>}
|
|
138
|
-
{errorMessage && <ErrorMessage id={`${id}-error`} message={errorMessage} />}
|
|
139
|
+
{errorMessage && <ErrorMessage id={`${id}-error`} errorTitle={errorTitle} message={errorMessage} />}
|
|
139
140
|
<div className={styles.input()}>
|
|
140
141
|
{before && (
|
|
141
142
|
<InputGroupAddOn position="before" size={resolvedSize} inset={beforeInset} icon={beforeIcon} id={id}>
|