File tree Expand file tree Collapse file tree 8 files changed +16
-14
lines changed
Combobox/components/TextField Expand file tree Collapse file tree 8 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ import { UseUniqueId } from '@/use';
4646import MinusMinor from ' @icons/MinusMinor.svg' ;
4747import TickSmallMinor from ' @icons/TickSmallMinor.svg' ;
4848import styles from ' @/classes/Checkbox.json' ;
49- import type { ErrorType } from ' @/utilities/type' ;
49+ import type { Error } from ' @/utilities/type' ;
5050import { Key } from ' ../KeypressListener/utils' ;
5151import { errorTextID } from ' ../InlineError/utils' ;
5252import { 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
7979const isWithinListbox = inject <boolean >(' withinListboxContext' , false );
Original file line number Diff line number Diff line change 3939import { computed } from ' vue' ;
4040import { classNames } from ' polaris/polaris-react/src/utilities/css' ;
4141import styles from ' @/classes/Choice.json' ;
42- import type { ErrorType } from ' @/utilities/type' ;
42+ import type { Error } from ' @/utilities/type' ;
4343import { helpTextID } from ' ./utils' ;
4444import { 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}
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ PolarisTextField(
3333import { inject , computed , watch } from ' vue' ;
3434import { UseUniqueId } from ' @/use' ;
3535import type { ComboboxTextFieldType } from ' @/utilities/interface' ;
36- import type { ErrorType } from ' @/utilities/type' ;
36+ import type { Error } from ' @/utilities/type' ;
3737import type { LabelledProps } from ' ../../../Labelled/utils'
3838import { labelID } from ' ../../../Label/utils' ;
3939import { 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 */
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ div(:class="className")
4242import { computed } from ' vue' ;
4343import { classNames } from ' polaris/polaris-react/src/utilities/css' ;
4444import styles from ' @/classes/Labelled.json' ;
45- import type { Action , ErrorType } from ' @/utilities/type' ;
45+ import type { Action , Error } from ' @/utilities/type' ;
4646import { ButtonFrom } from ' @/components' ;
4747import type { LabelProps } from ' ../Label/utils' ;
4848import { 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 */
Original file line number Diff line number Diff line change 1- import type { Action , ErrorType } from '@/utilities/type' ;
1+ import type { Action , Error } from '@/utilities/type' ;
22import { labelID } from '../Label/utils' ;
33import 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 */
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ Labelled(
8181
8282<script setup lang="ts">
8383import { computed , useSlots } from ' vue' ;
84- import type { Action , ErrorType } from ' @/utilities/type' ;
84+ import type { Action , Error } from ' @/utilities/type' ;
8585import { classNames } from ' polaris/polaris-react/src/utilities/css' ;
8686import { UseUniqueId } from ' @/use' ;
8787import 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 */
Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ import { UseUniqueId } from '@/use';
163163import styles from ' @/classes/TextField.json' ;
164164import CircleCancelMinor from ' @icons/CircleCancelMinor.svg' ;
165165import type { LabelledProps } from ' ../Labelled/utils' ;
166- import type { ErrorType } from ' @/utilities/type' ;
166+ import type { Error } from ' @/utilities/type' ;
167167import { helpTextID , labelID } from ' ../Labelled/utils' ;
168168import { Resizer , Spinner as TextFieldSpinner } from ' ./components' ;
169169import { 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 */
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ export type IconSource = VueElementConstructor | 'placeholder' | string;
44
55export type ErrorType = string | VueElementConstructor | ( string | VueElementConstructor ) [ ] ;
66
7+ export type Error = ErrorType | boolean ;
8+
79export type HeadingTagName = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' ;
810
911export type Action = {
You can’t perform that action at this time.
0 commit comments