Skip to content

Commit d24b51f

Browse files
committed
Merge remote-tracking branch 'origin/dev'
2 parents c1a4f0c + 8c223b8 commit d24b51f

File tree

8 files changed

+16
-14
lines changed

8 files changed

+16
-14
lines changed

src/components/Checkbox/Checkbox.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import { UseUniqueId } from '@/use';
4646
import MinusMinor from '@icons/MinusMinor.svg';
4747
import TickSmallMinor from '@icons/TickSmallMinor.svg';
4848
import styles from '@/classes/Checkbox.json';
49-
import type { ErrorType } from '@/utilities/type';
49+
import type { Error } from '@/utilities/type';
5050
import { Key } from '../KeypressListener/utils';
5151
import { errorTextID } from '../InlineError/utils';
5252
import { Choice } from '../Choice';
@@ -73,7 +73,7 @@ interface Props {
7373
/** Value for v-model binding */
7474
modelValue?: string | boolean;
7575
/** Display an error message */
76-
error?: ErrorType | boolean;
76+
error?: Error;
7777
}
7878
7979
const isWithinListbox = inject<boolean>('withinListboxContext', false);

src/components/Choice/Choice.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ label(
3939
import { computed } from 'vue';
4040
import { classNames } from 'polaris/polaris-react/src/utilities/css';
4141
import styles from '@/classes/Choice.json';
42-
import type { ErrorType } from '@/utilities/type';
42+
import type { Error } from '@/utilities/type';
4343
import { helpTextID } from './utils';
4444
import { InlineError } from '../InlineError';
4545
@@ -49,7 +49,7 @@ interface Props {
4949
/** Whether the associated form control is disabled */
5050
disabled?: boolean;
5151
/** Display an error message */
52-
error?: ErrorType | boolean;
52+
error?: Error;
5353
/** Visually hide the label */
5454
labelHidden?: boolean;
5555
}

src/components/Combobox/components/TextField/TextField.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ PolarisTextField(
3333
import { inject, computed, watch } from 'vue';
3434
import { UseUniqueId } from '@/use';
3535
import type { ComboboxTextFieldType } from '@/utilities/interface';
36-
import type { ErrorType } from '@/utilities/type';
36+
import type { Error } from '@/utilities/type';
3737
import type { LabelledProps } from '../../../Labelled/utils'
3838
import { labelID } from '../../../Label/utils';
3939
import { TextField as PolarisTextField } from '../../../TextField';
@@ -89,7 +89,7 @@ interface TextFieldProps {
8989
/** Allow for multiple lines of input */
9090
multiline?: boolean | number;
9191
/** Error to display beneath the label */
92-
error?: ErrorType | boolean;
92+
error?: Error;
9393
/** Determine type of input */
9494
type?: Type;
9595
/** Name of the input */

src/components/Labelled/Labelled.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ div(:class="className")
4242
import { computed } from 'vue';
4343
import { classNames } from 'polaris/polaris-react/src/utilities/css';
4444
import styles from '@/classes/Labelled.json';
45-
import type { Action, ErrorType } from '@/utilities/type';
45+
import type { Action, Error } from '@/utilities/type';
4646
import { ButtonFrom } from '@/components';
4747
import type { LabelProps } from '../Label/utils';
4848
import { Label } from '../Label';
@@ -53,7 +53,7 @@ interface LabelledProps {
5353
/** A unique identifier for the label */
5454
id: LabelProps['id'];
5555
/** Error to display beneath the label */
56-
error?: ErrorType | boolean;
56+
error?: Error;
5757
/** An action */
5858
action?: Action;
5959
/** Visually hide the label */

src/components/Labelled/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Action, ErrorType } from '@/utilities/type';
1+
import type { Action, Error } from '@/utilities/type';
22
import { labelID } from '../Label/utils';
33
import type { LabelProps } from "../Label/utils";
44

@@ -16,7 +16,7 @@ export interface LabelledProps {
1616
/** A unique identifier for the label */
1717
id: LabelProps['id'];
1818
/** Error to display beneath the label */
19-
error?: ErrorType | boolean;
19+
error?: Error;
2020
/** An action */
2121
action?: Action;
2222
/** Visually hide the label */

src/components/Select/Select.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Labelled(
8181

8282
<script setup lang="ts">
8383
import { computed, useSlots } from 'vue';
84-
import type { Action, ErrorType } from '@/utilities/type';
84+
import type { Action, Error } from '@/utilities/type';
8585
import { classNames } from 'polaris/polaris-react/src/utilities/css';
8686
import { UseUniqueId } from '@/use';
8787
import styles from '@/classes/Select.json';
@@ -115,7 +115,7 @@ interface SelectProps {
115115
/** Value for form input */
116116
value?: string;
117117
/** Display an error state */
118-
error?: ErrorType | boolean;
118+
error?: Error;
119119
/** Visual required indicator, add an asterisk to label */
120120
requiredIndicator?: boolean;
121121
/** Value for v-model binding */

src/components/TextField/TextField.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ import { UseUniqueId } from '@/use';
163163
import styles from '@/classes/TextField.json';
164164
import CircleCancelMinor from '@icons/CircleCancelMinor.svg';
165165
import type { LabelledProps } from '../Labelled/utils';
166-
import type { ErrorType } from '@/utilities/type';
166+
import type { Error } from '@/utilities/type';
167167
import { helpTextID, labelID } from '../Labelled/utils';
168168
import { Resizer, Spinner as TextFieldSpinner } from './components';
169169
import { Connected } from '../Connected';
@@ -222,7 +222,7 @@ interface NonMutuallyExclusiveProps {
222222
/** Allow for multiple lines of input */
223223
multiline?: boolean | number;
224224
/** Error to display beneath the label */
225-
error?: ErrorType | boolean;
225+
error?: Error;
226226
/** Determine type of input */
227227
type?: Type;
228228
/** Name of the input */

src/utilities/type.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ export type IconSource = VueElementConstructor | 'placeholder' | string;
44

55
export type ErrorType = string | VueElementConstructor | (string | VueElementConstructor)[];
66

7+
export type Error = ErrorType | boolean;
8+
79
export type HeadingTagName = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p';
810

911
export type Action = {

0 commit comments

Comments
 (0)