@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.
@@ -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()
@@ -37,6 +37,10 @@ export type InputGroupProps = {
37
37
  * Error message text
38
38
  */
39
39
  errorMessage?: string | string[];
40
+ /**
41
+ * Error title
42
+ */
43
+ errorTitle?: string;
40
44
  /**
41
45
  * Visually hide label
42
46
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@westpac/ui",
3
- "version": "1.5.0",
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}>
@@ -34,6 +34,10 @@ export type InputGroupProps = {
34
34
  * Error message text
35
35
  */
36
36
  errorMessage?: string | string[];
37
+ /**
38
+ * Error title
39
+ */
40
+ errorTitle?: string;
37
41
  /**
38
42
  * Visually hide label
39
43
  */