@apolitical/component-library 6.0.2 → 6.0.3-jc.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/cards/card/card.d.ts +1 -1
- package/cards/cards.types.d.ts +7 -2
- package/cards/carousel/components/carousel/carousel.helpers.d.ts +4 -1
- package/form/components/form/form.types.d.ts +1 -1
- package/form/types/password-form/password-form.d.ts +3 -11
- package/hooks/use-tooltips.d.ts +0 -2
- package/index.js +25 -25
- package/index.mjs +1346 -1343
- package/package.json +1 -1
- package/text/pill/index.d.ts +1 -0
- package/text/pill/pill.d.ts +6 -3
- package/text/status-banner/index.d.ts +1 -0
- package/text/status-banner/status-banner.d.ts +2 -2
package/cards/card/card.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { CardProps } from './../cards.types';
|
|
2
|
-
declare const Card: ({ id, className, buildCardData, buildMemberData, card, cta, gtmContext, handleCardClick,
|
|
2
|
+
declare const Card: ({ id, className, buildCardData, buildMemberData, card, cta, gtmContext, handleCardClick, meta, }: CardProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Card;
|
package/cards/cards.types.d.ts
CHANGED
|
@@ -93,8 +93,13 @@ export interface CardProps {
|
|
|
93
93
|
className?: string;
|
|
94
94
|
/** A callback to run when the user clicks on the card CTA */
|
|
95
95
|
handleCardClick?: (card: CardType) => Promise<string>;
|
|
96
|
-
/**
|
|
97
|
-
|
|
96
|
+
/** Metadata about the card */
|
|
97
|
+
meta?: {
|
|
98
|
+
/** If the browser should be able to reach the card, e.g. for out of view cards in carousels */
|
|
99
|
+
isTabbable?: boolean;
|
|
100
|
+
/** If the browser should focus on this card */
|
|
101
|
+
setFocus?: boolean;
|
|
102
|
+
};
|
|
98
103
|
}
|
|
99
104
|
export interface CarouselTitleProps {
|
|
100
105
|
/** The title text */
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export declare const shouldDisplayCard: (index: number, cardsPerPage: number, page: number, loadedPages: number[]) =>
|
|
1
|
+
export declare const shouldDisplayCard: (index: number, cardsPerPage: number, page: number, loadedPages: number[]) => {
|
|
2
|
+
inView: boolean;
|
|
3
|
+
isLoaded: boolean;
|
|
4
|
+
};
|
|
@@ -13,7 +13,7 @@ export interface ILabel {
|
|
|
13
13
|
htmlFor?: string;
|
|
14
14
|
}
|
|
15
15
|
export type FormActionTypes = 'addError' | 'formSubmitted' | 'formSubmittedAndReset' | 'removeError' | 'submitForm' | 'updateValue';
|
|
16
|
-
export type FieldValidationConditions = boolean | 'no-numbers' | 'required' | 'valid-email' | 'valid-url' | 'custom-validation' | ((arg: IFormValues) => boolean);
|
|
16
|
+
export type FieldValidationConditions = boolean | 'no-numbers' | 'required' | 'valid-email' | 'valid-url' | 'custom-validation' | ((arg: IFormValues) => boolean | null | string);
|
|
17
17
|
export interface IFieldOption {
|
|
18
18
|
/** The ID of the option */
|
|
19
19
|
id: string;
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export interface IPasswordFormProps {
|
|
2
|
+
import type { IFormProps, IFormValues } from '../../components/form/form.types';
|
|
3
|
+
export interface IPasswordFormProps extends Omit<IFormProps, 'id' | 'fields'> {
|
|
4
4
|
/** Indicated for whether to show the current password field */
|
|
5
5
|
isPasswordChange?: boolean;
|
|
6
6
|
/** The functions being passed to the form */
|
|
7
|
-
functions: {
|
|
7
|
+
functions: IFormProps['functions'] & {
|
|
8
8
|
/** The function to call to create the password */
|
|
9
9
|
createPassword: (arg: IFormValues) => Promise<void>;
|
|
10
|
-
/** The function to call when onSuccess fails */
|
|
11
|
-
onCatch?: (error?: unknown) => void;
|
|
12
|
-
/** The function to call when the form submission fails */
|
|
13
|
-
onFailure?: (arg: IFormValues, arg2?: FormValues) => void;
|
|
14
|
-
/** The function to call when the form is successfully submitted */
|
|
15
|
-
onSuccess?: (arg: IFormValues) => Promise<void>;
|
|
16
|
-
/** The function to call when the cancel button is clicked */
|
|
17
|
-
onCancel?: () => void;
|
|
18
10
|
};
|
|
19
11
|
/** Specify custom text for the submit button */
|
|
20
12
|
button?: {
|
package/hooks/use-tooltips.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ declare const _default: (hasTooltip?: boolean) => {
|
|
|
7
7
|
onMouseOut?: undefined;
|
|
8
8
|
onFocus?: undefined;
|
|
9
9
|
onBlur?: undefined;
|
|
10
|
-
tabIndex?: undefined;
|
|
11
10
|
};
|
|
12
11
|
} | {
|
|
13
12
|
showTooltip: boolean;
|
|
@@ -18,7 +17,6 @@ declare const _default: (hasTooltip?: boolean) => {
|
|
|
18
17
|
onMouseOut: () => void;
|
|
19
18
|
onFocus: () => void;
|
|
20
19
|
onBlur: () => void;
|
|
21
|
-
tabIndex: number;
|
|
22
20
|
};
|
|
23
21
|
};
|
|
24
22
|
export default _default;
|