@aws-amplify/ui-react 5.2.0 → 5.3.1
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/dist/Field-4bd811d7.js +1 -0
- package/dist/esm/PrimitiveCatalog.mjs +1 -1
- package/dist/esm/components/AccountSettings/ChangePassword/ChangePassword.mjs +1 -1
- package/dist/esm/components/AccountSettings/ChangePassword/defaults.mjs +1 -1
- package/dist/esm/components/AccountSettings/DeleteUser/DeleteUser.mjs +1 -1
- package/dist/esm/components/AccountSettings/DeleteUser/defaults.mjs +1 -1
- package/dist/esm/components/AccountSettings/shared/Defaults.mjs +1 -1
- package/dist/esm/components/Storage/FileUploader/FileUploader.mjs +1 -1
- package/dist/esm/components/Storage/FileUploader/UploadDropZone/UploadDropZone.mjs +1 -1
- package/dist/esm/components/Storage/FileUploader/UploadPreviewer/UploadPreviewer.mjs +1 -1
- package/dist/esm/components/Storage/FileUploader/UploadTracker/UploadMessage.mjs +1 -1
- package/dist/esm/components/Storage/FileUploader/UploadTracker/UploadTracker.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal.mjs +1 -1
- package/dist/esm/primitives/Breadcrumbs/Breadcrumbs.mjs +1 -1
- package/dist/esm/primitives/Button/Button.mjs +1 -1
- package/dist/esm/primitives/ButtonGroup/ButtonGroup.mjs +1 -1
- package/dist/esm/primitives/Checkbox/Checkbox.mjs +1 -1
- package/dist/esm/primitives/DropZone/DropZone.mjs +1 -0
- package/dist/esm/primitives/DropZone/DropZoneChildren.mjs +1 -0
- package/dist/esm/primitives/DropZone/DropZoneContainer.mjs +1 -0
- package/dist/esm/primitives/DropZone/DropZoneProvider.mjs +1 -0
- package/dist/esm/primitives/DropZone/useDropZone.mjs +1 -0
- package/dist/esm/primitives/Fieldset/Fieldset.mjs +1 -0
- package/dist/esm/primitives/Fieldset/useFieldset.mjs +1 -0
- package/dist/esm/primitives/Input/Input.mjs +1 -1
- package/dist/esm/primitives/Message/Message.mjs +1 -0
- package/dist/esm/primitives/Message/MessageContainer.mjs +1 -0
- package/dist/esm/primitives/Message/MessageContent.mjs +1 -0
- package/dist/esm/primitives/Message/MessageDismiss.mjs +1 -0
- package/dist/esm/primitives/Message/MessageHeading.mjs +1 -0
- package/dist/esm/primitives/Message/MessageIcon.mjs +1 -0
- package/dist/esm/primitives/Message/useMessage.mjs +1 -0
- package/dist/esm/primitives/PasswordField/ShowPasswordButton.mjs +1 -1
- package/dist/esm/primitives/Radio/Radio.mjs +1 -1
- package/dist/esm/primitives/Select/Select.mjs +1 -1
- package/dist/esm/primitives/SliderField/SliderField.mjs +1 -1
- package/dist/esm/primitives/SwitchField/SwitchField.mjs +1 -1
- package/dist/esm/primitives/TextArea/TextArea.mjs +1 -1
- package/dist/esm/primitives/index.mjs +1 -1
- package/dist/esm/primitives/shared/constants.mjs +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/internal.js +1 -1
- package/dist/styles.css +472 -199
- package/dist/types/components/Authenticator/Authenticator.d.ts +20 -2
- package/dist/types/internal.d.ts +1 -0
- package/dist/types/primitives/DropZone/DropZone.d.ts +13 -0
- package/dist/types/primitives/DropZone/DropZoneChildren.d.ts +18 -0
- package/dist/types/primitives/DropZone/DropZoneContainer.d.ts +4 -0
- package/dist/types/primitives/DropZone/DropZoneProvider.d.ts +8 -0
- package/dist/types/primitives/DropZone/index.d.ts +2 -0
- package/dist/types/primitives/DropZone/types.d.ts +32 -0
- package/dist/types/primitives/DropZone/useDropZone.d.ts +2 -0
- package/dist/types/primitives/Fieldset/Fieldset.d.ts +5 -0
- package/dist/types/primitives/Fieldset/index.d.ts +2 -0
- package/dist/types/primitives/Fieldset/useFieldset.d.ts +12 -0
- package/dist/types/primitives/Icon/context/IconsContext.d.ts +1 -0
- package/dist/types/primitives/Message/Message.d.ts +5 -0
- package/dist/types/primitives/Message/MessageContainer.d.ts +2 -0
- package/dist/types/primitives/Message/MessageContent.d.ts +2 -0
- package/dist/types/primitives/Message/MessageDismiss.d.ts +2 -0
- package/dist/types/primitives/Message/MessageHeading.d.ts +2 -0
- package/dist/types/primitives/Message/MessageIcon.d.ts +2 -0
- package/dist/types/primitives/Message/index.d.ts +1 -0
- package/dist/types/primitives/Message/useMessage.d.ts +9 -0
- package/dist/types/primitives/components.d.ts +5 -0
- package/dist/types/primitives/shared/constants.d.ts +3 -0
- package/dist/types/primitives/shared/types.d.ts +2 -2
- package/dist/types/primitives/types/buttonGroup.d.ts +1 -1
- package/dist/types/primitives/types/fieldset.d.ts +46 -0
- package/dist/types/primitives/types/index.d.ts +2 -0
- package/dist/types/primitives/types/message.d.ts +70 -0
- package/dist/types/primitives/types/select.d.ts +10 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +3 -3
- package/dist/Field-503671cc.js +0 -1
|
@@ -1,15 +1,32 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { AuthenticatorMachineOptions, AmplifyUser } from '@aws-amplify/ui';
|
|
2
|
+
import { AuthenticatorMachineOptions, AmplifyUser, FormFieldComponents, FormFieldOptions } from '@aws-amplify/ui';
|
|
3
3
|
import { UseAuthenticator } from '@aws-amplify/ui-react-core';
|
|
4
4
|
import { ComponentsProviderProps } from './hooks/useCustomComponents';
|
|
5
5
|
import { RouterProps } from './Router';
|
|
6
6
|
export type SignOut = UseAuthenticator['signOut'];
|
|
7
|
-
export type AuthenticatorProps = Partial<AuthenticatorMachineOptions & ComponentsProviderProps & RouterProps & {
|
|
7
|
+
export type AuthenticatorProps = Partial<Omit<AuthenticatorMachineOptions, 'formFields'> & ComponentsProviderProps & RouterProps & {
|
|
8
8
|
children: React.ReactNode | ((props: {
|
|
9
9
|
signOut?: SignOut;
|
|
10
10
|
user?: AmplifyUser;
|
|
11
11
|
}) => JSX.Element);
|
|
12
|
+
formFields: {
|
|
13
|
+
[key in FormFieldComponents]?: {
|
|
14
|
+
[field_name: string]: ReactFormFieldOptions;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
12
17
|
}>;
|
|
18
|
+
interface ReactFormFieldOptions extends FormFieldOptions {
|
|
19
|
+
/** Desired HTML defaultValue type */
|
|
20
|
+
defaultValue?: string;
|
|
21
|
+
/** isReadOnly maps to readonly HTML type */
|
|
22
|
+
isReadOnly?: boolean;
|
|
23
|
+
/** Desired HTML pattern type */
|
|
24
|
+
pattern?: string | undefined;
|
|
25
|
+
/** Desired HTML minLength type */
|
|
26
|
+
minLength?: number;
|
|
27
|
+
/** Desired HTML maxLength type */
|
|
28
|
+
maxLength?: number;
|
|
29
|
+
}
|
|
13
30
|
export declare function AuthenticatorInternal({ children, className, components: customComponents, formFields, hideSignUp, initialState, loginMechanisms, passwordSettings, signUpAttributes, services, socialProviders, variation, }: AuthenticatorProps): JSX.Element;
|
|
14
31
|
/**
|
|
15
32
|
* [📖 Docs](https://ui.docs.amplify.aws/react/connected-components/authenticator)
|
|
@@ -36,3 +53,4 @@ export declare namespace Authenticator {
|
|
|
36
53
|
Footer(): JSX.Element | null;
|
|
37
54
|
};
|
|
38
55
|
}
|
|
56
|
+
export {};
|
package/dist/types/internal.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export type { UseDataStoreUpdateActionOptions } from './hooks/actions/useDataSto
|
|
|
14
14
|
export { AlertIcon } from './primitives/Alert/AlertIcon';
|
|
15
15
|
export * from './primitives/Icon/internal';
|
|
16
16
|
export * from './primitives/shared/datastore';
|
|
17
|
+
export { useDropZone } from './primitives/DropZone/useDropZone';
|
|
17
18
|
export { EscapeHatchProps, Variant, findChildOverrides, getOverridesFromVariants, getOverrideProps, mergeVariantsAndOverrides, } from './studio';
|
|
18
19
|
export { Field } from './primitives/Field';
|
|
19
20
|
export { PrimitiveCatalog } from './PrimitiveCatalog';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ForwardRefPrimitive } from '../types';
|
|
2
|
+
import { BaseDropZoneProps } from './types';
|
|
3
|
+
import { Accepted, Default, Rejected } from './DropZoneChildren';
|
|
4
|
+
type DropZoneType = ForwardRefPrimitive<BaseDropZoneProps, 'div'> & {
|
|
5
|
+
Accepted: typeof Accepted;
|
|
6
|
+
Rejected: typeof Rejected;
|
|
7
|
+
Default: typeof Default;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* [📖 Docs](https://ui.docs.amplify.aws/react/components/dropzone)
|
|
11
|
+
*/
|
|
12
|
+
declare const DropZone: DropZoneType;
|
|
13
|
+
export { DropZone };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Primitive } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* These are syntactic sugar components that make it easy to compose children
|
|
4
|
+
* in DropZone without having to expose the DropZoneContext.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* This component renders when the user is dragging ONLY accepted files on the DropZone.
|
|
8
|
+
*/
|
|
9
|
+
declare const Accepted: Primitive<{}, 'div'>;
|
|
10
|
+
/**
|
|
11
|
+
* This component renders when the user is dragging ANY rejected files on the DropZone.
|
|
12
|
+
*/
|
|
13
|
+
declare const Rejected: Primitive<{}, 'div'>;
|
|
14
|
+
/**
|
|
15
|
+
* This component renders by default when the user is not dragging.
|
|
16
|
+
*/
|
|
17
|
+
declare const Default: Primitive<{}, 'div'>;
|
|
18
|
+
export { Accepted, Rejected, Default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DragState } from './types';
|
|
3
|
+
declare const DropZoneContext: React.Context<DragState>;
|
|
4
|
+
declare const DropZoneProvider: ({ value, children, }: {
|
|
5
|
+
value: DragState;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}) => JSX.Element;
|
|
8
|
+
export { DropZoneProvider, DropZoneContext };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ElementType, PrimitiveProps, BaseViewProps } from '../types';
|
|
3
|
+
interface DropProps {
|
|
4
|
+
acceptedFiles: File[];
|
|
5
|
+
rejectedFiles: File[];
|
|
6
|
+
}
|
|
7
|
+
export interface UseDropZoneProps extends Partial<DragEvents> {
|
|
8
|
+
onDropComplete?: (props: DropProps) => void;
|
|
9
|
+
/**
|
|
10
|
+
* List of accepted File types, values of `['*']` or undefined allow any files
|
|
11
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept
|
|
12
|
+
*/
|
|
13
|
+
acceptedFileTypes?: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface BaseDropZoneProps extends BaseViewProps, UseDropZoneProps {
|
|
16
|
+
}
|
|
17
|
+
export type DropZoneProps<Element extends ElementType = 'div'> = PrimitiveProps<BaseDropZoneProps, Element>;
|
|
18
|
+
interface DragEvents {
|
|
19
|
+
onDragStart: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
20
|
+
onDragEnter: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
21
|
+
onDragLeave: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
22
|
+
onDragOver: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
23
|
+
onDrop: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
24
|
+
}
|
|
25
|
+
export type DragState = 'accept' | 'reject' | 'inactive';
|
|
26
|
+
export interface UseDropZoneReturn extends DragEvents {
|
|
27
|
+
dragState: DragState;
|
|
28
|
+
}
|
|
29
|
+
export interface BaseDropZoneContainerProps extends BaseViewProps, DragEvents {
|
|
30
|
+
}
|
|
31
|
+
export type DropZoneContainerProps<Element extends ElementType = 'div'> = PrimitiveProps<BaseDropZoneContainerProps, Element>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { UseDropZoneProps, UseDropZoneReturn } from './types';
|
|
2
|
+
export declare function useDropZone({ onDropComplete, onDragEnter: _onDragEnter, onDragLeave: _onDragLeave, onDragOver: _onDragOver, onDragStart: _onDragStart, onDrop: _onDrop, acceptedFileTypes, }: UseDropZoneProps): UseDropZoneReturn;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface FieldsetContextType {
|
|
3
|
+
isFieldsetDisabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const FieldsetContext: React.Context<FieldsetContextType>;
|
|
6
|
+
/**
|
|
7
|
+
* @description Fieldsets in HTML can be disabled, which disables all child
|
|
8
|
+
* fieldsets and input controls. `useFieldset` passes the disabled state down
|
|
9
|
+
* via context.
|
|
10
|
+
*/
|
|
11
|
+
export declare const useFieldset: () => FieldsetContextType;
|
|
12
|
+
export {};
|
|
@@ -8,6 +8,7 @@ export type IconsContextInterface = {
|
|
|
8
8
|
expander?: ComponentIcons<'more'>;
|
|
9
9
|
field?: ComponentIcons<'clear'>;
|
|
10
10
|
menu?: ComponentIcons<'menu'>;
|
|
11
|
+
message?: ComponentIcons<'close' | 'info' | 'error' | 'success' | 'warning'>;
|
|
11
12
|
pagination?: ComponentIcons<'previous' | 'next'>;
|
|
12
13
|
passwordField?: ComponentIcons<'visibility' | 'visibilityOff'>;
|
|
13
14
|
rating?: ComponentIcons<'filled' | 'empty'>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Message } from './Message';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MessageColorTheme } from '../types';
|
|
3
|
+
export interface MessageContextType {
|
|
4
|
+
colorTheme?: MessageColorTheme;
|
|
5
|
+
dismissed?: boolean;
|
|
6
|
+
setDismissed: (dismissed: boolean) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const MessageContext: React.Context<MessageContextType>;
|
|
9
|
+
export declare const useMessage: () => MessageContextType;
|
|
@@ -8,17 +8,22 @@ export { Card } from './Card';
|
|
|
8
8
|
export { CheckboxField } from './CheckboxField';
|
|
9
9
|
export { Collection } from './Collection';
|
|
10
10
|
export { Divider } from './Divider';
|
|
11
|
+
export { DropZone, DropZoneProps } from './DropZone';
|
|
11
12
|
export { Expander, ExpanderItem } from './Expander';
|
|
12
13
|
export { FieldGroupIcon, FieldGroupIconButton } from './FieldGroupIcon';
|
|
14
|
+
export { Fieldset } from './Fieldset';
|
|
13
15
|
export { Flex } from './Flex';
|
|
14
16
|
export { Grid } from './Grid';
|
|
15
17
|
export { Heading } from './Heading';
|
|
16
18
|
export { HighlightMatch } from './HighlightMatch';
|
|
17
19
|
export { Icon } from './Icon';
|
|
18
20
|
export { Image } from './Image';
|
|
21
|
+
export { Input } from './Input';
|
|
22
|
+
export { Label } from './Label';
|
|
19
23
|
export { Link } from './Link';
|
|
20
24
|
export { Loader } from './Loader';
|
|
21
25
|
export { Menu, MenuButton, MenuItem } from './Menu';
|
|
26
|
+
export { Message } from './Message';
|
|
22
27
|
export { Pagination } from './Pagination';
|
|
23
28
|
export { PasswordField } from './PasswordField';
|
|
24
29
|
export { PhoneNumberField } from './PhoneNumberField';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentClassName } from '@aws-amplify/ui';
|
|
2
|
-
type ComponentNameKey = 'Alert' | 'Autocomplete' | 'Badge' | 'Breadcrumbs' | 'Button' | 'Button' | 'Card' | 'Checkbox' | 'CheckboxField' | 'Collection' | 'PhoneNumberField' | 'Divider' | 'Expander' | 'FileUploader' | 'Flex' | 'Grid' | 'Heading' | 'HighlightMatch' | 'Icon' | 'Image' | 'Link' | 'Loader' | 'Menu' | 'Pagination' | 'PasswordField' | 'PhoneNumberField' | 'Placeholder' | 'Radio' | 'RadioGroupField' | 'Rating' | 'ScrollView' | 'SearchField' | 'Select' | 'SliderField' | 'SelectField' | 'StepperField' | 'StorageImage' | 'StorageManager' | 'SwitchField' | 'Table' | 'Tabs' | 'Text' | 'TextAreaField' | 'TextField' | 'ToggleButton' | 'ToggleButtonGroup' | 'VisuallyHidden';
|
|
3
|
-
type ComponentClassNameKey = 'Alert' | 'AlertIcon' | 'AlertHeading' | 'AlertBody' | 'AlertDismiss' | 'Autocomplete' | 'AutocompleteMenu' | 'AutocompleteMenuEmpty' | 'AutocompleteMenuFooter' | 'AutocompleteMenuHeader' | 'AutocompleteMenuLoading' | 'AutocompleteMenuOption' | 'AutocompleteMenuOptions' | 'Badge' | 'Breadcrumbs' | 'BreadcrumbsItem' | 'BreadcrumbsLink' | 'BreadcrumbsList' | 'BreadcrumbsSeparator' | 'Button' | 'ButtonGroup' | 'ButtonLoaderWrapper' | 'Card' | 'Checkbox' | 'CheckboxButton' | 'CheckboxIcon' | 'CheckboxInput' | 'CheckboxLabel' | 'CheckboxField' | 'Collection' | 'CollectionItems' | 'CollectionSearch' | 'CollectionPagination' | 'CountryCodeSelect' | 'DialCodeSelect' | 'Divider' | 'DividerLabel' | 'Expander' | 'ExpanderContent' | 'ExpanderContentText' | 'ExpanderHeader' | 'ExpanderIcon' | 'ExpanderItem' | 'ExpanderTrigger' | 'Field' | 'FieldDescription' | 'FieldErrorMessage' | 'FieldGroup' | 'FieldGroupControl' | 'FieldGroupOuterEnd' | 'FieldGroupOuterStart' | 'FieldGroupInnerEnd' | 'FieldGroupInnerStart' | 'FieldGroupIcon' | 'FieldGroupIconButton' | 'FieldGroupHasInnerEnd' | 'FieldGroupHasInnerStart' | 'FieldShowPassword' | 'FieldGroupFieldWrapper' | 'FileUploaderDropZone' | 'FileUploaderDropZoneIcon' | 'FileUploaderDropZoneText' | 'FileUploaderDropZoneButton' | 'FileUploaderFile' | 'FileUploaderFileWrapper' | 'FileUploaderFileName' | 'FileUploaderFileSize' | 'FileUploaderFileInfo' | 'FileUploaderFileStatus' | 'FileUploaderFileImage' | 'FileUploaderFileMain' | 'FileUploaderLoader' | 'FileUploaderPreviewer' | 'FileUploaderPreviewerText' | 'FileUploaderPreviewerBody' | 'FileUploaderPreviewerFooter' | 'FileUploaderPreviewerFooterActions' | 'Flex' | 'Grid' | 'Heading' | 'HighlightMatch' | 'HighlightMatchHighlighted' | 'Icon' | 'Image' | 'Input' | 'Label' | 'Link' | 'Loader' | 'LoaderDeterminate' | 'LoaderPercentageText' | 'MenuContent' | 'MenuContentWrapper' | 'MenuItem' | 'MenuTrigger' | 'Pagination' | 'PaginationItemButton' | 'PaginationItemCurrent' | 'PaginationItemEllipsis' | 'PasswordField' | 'PhoneNumberField' | 'Placeholder' | 'Radio' | 'RadioButton' | 'RadioInput' | 'RadioLabel' | 'RadioGroupField' | 'RadioGroup' | 'Rating' | 'ScrollView' | 'SearchField' | 'SearchFieldClear' | 'SearchFieldSearch' | 'Select' | 'SelectField' | 'SelectWrapper' | 'SelectIconWrapper' | 'SliderField' | 'SliderFieldGroup' | 'SliderFieldLabel' | 'SliderFieldRange' | 'SliderFieldRoot' | 'SliderFieldThumb' | 'SliderFieldTrack' | 'StepperField' | 'StepperFieldButtonDecrease' | 'StepperFieldButtonIncrease' | 'StepperFieldInput' | 'StorageImage' | 'StorageManager' | 'StorageManagerDropZone' | 'StorageManagerDropZoneIcon' | 'StorageManagerDropZoneText' | 'StorageManagerFilePicker' | 'StorageManagerFile' | 'StorageManagerFileWrapper' | 'StorageManagerFileList' | 'StorageManagerFileName' | 'StorageManagerFileSize' | 'StorageManagerFileInfo' | 'StorageManagerFileStatus' | 'StorageManagerFileImage' | 'StorageManagerFileMain' | 'StorageManagerLoader' | 'StorageManagerPreviewer' | 'StorageManagerPreviewerText' | 'SwitchField' | 'SwitchLabel' | 'SwitchThumb' | 'SwitchTrack' | 'SwitchWrapper' | 'Table' | 'TableCaption' | 'TableBody' | 'TableTd' | 'TableTh' | 'TableFoot' | 'TableHead' | 'TableRow' | 'Tabs' | 'TabItems' | 'Text' | 'Textarea' | 'TextAreaField' | 'TextField' | 'ToggleButton' | 'ToggleButtonGroup' | 'VisuallyHidden';
|
|
2
|
+
type ComponentNameKey = 'Alert' | 'Autocomplete' | 'Badge' | 'Breadcrumbs' | 'Button' | 'Button' | 'Card' | 'Checkbox' | 'CheckboxField' | 'Collection' | 'PhoneNumberField' | 'Divider' | 'DropZone' | 'Expander' | 'Fieldset' | 'FileUploader' | 'Flex' | 'Grid' | 'Heading' | 'HighlightMatch' | 'Icon' | 'Image' | 'Input' | 'Label' | 'Link' | 'Loader' | 'Menu' | 'Message' | 'Pagination' | 'PasswordField' | 'PhoneNumberField' | 'Placeholder' | 'Radio' | 'RadioGroupField' | 'Rating' | 'ScrollView' | 'SearchField' | 'Select' | 'SliderField' | 'SelectField' | 'StepperField' | 'StorageImage' | 'StorageManager' | 'SwitchField' | 'Table' | 'Tabs' | 'Text' | 'TextAreaField' | 'TextField' | 'ToggleButton' | 'ToggleButtonGroup' | 'VisuallyHidden';
|
|
3
|
+
type ComponentClassNameKey = 'Alert' | 'AlertIcon' | 'AlertHeading' | 'AlertBody' | 'AlertDismiss' | 'Autocomplete' | 'AutocompleteMenu' | 'AutocompleteMenuEmpty' | 'AutocompleteMenuFooter' | 'AutocompleteMenuHeader' | 'AutocompleteMenuLoading' | 'AutocompleteMenuOption' | 'AutocompleteMenuOptions' | 'Badge' | 'Breadcrumbs' | 'BreadcrumbsItem' | 'BreadcrumbsLink' | 'BreadcrumbsList' | 'BreadcrumbsSeparator' | 'Button' | 'ButtonGroup' | 'ButtonLoaderWrapper' | 'Card' | 'Checkbox' | 'CheckboxButton' | 'CheckboxIcon' | 'CheckboxInput' | 'CheckboxLabel' | 'CheckboxField' | 'Collection' | 'CollectionItems' | 'CollectionSearch' | 'CollectionPagination' | 'CountryCodeSelect' | 'DialCodeSelect' | 'Divider' | 'DividerLabel' | 'DropZone' | 'Expander' | 'ExpanderContent' | 'ExpanderContentText' | 'ExpanderHeader' | 'ExpanderIcon' | 'ExpanderItem' | 'ExpanderTrigger' | 'Field' | 'FieldDescription' | 'FieldErrorMessage' | 'FieldGroup' | 'FieldGroupControl' | 'FieldGroupOuterEnd' | 'FieldGroupOuterStart' | 'FieldGroupInnerEnd' | 'FieldGroupInnerStart' | 'FieldGroupIcon' | 'FieldGroupIconButton' | 'FieldGroupHasInnerEnd' | 'FieldGroupHasInnerStart' | 'FieldShowPassword' | 'FieldGroupFieldWrapper' | 'Fieldset' | 'FieldsetLegend' | 'FileUploaderDropZone' | 'FileUploaderDropZoneIcon' | 'FileUploaderDropZoneText' | 'FileUploaderDropZoneButton' | 'FileUploaderFile' | 'FileUploaderFileWrapper' | 'FileUploaderFileName' | 'FileUploaderFileSize' | 'FileUploaderFileInfo' | 'FileUploaderFileStatus' | 'FileUploaderFileImage' | 'FileUploaderFileMain' | 'FileUploaderLoader' | 'FileUploaderPreviewer' | 'FileUploaderPreviewerText' | 'FileUploaderPreviewerBody' | 'FileUploaderPreviewerFooter' | 'FileUploaderPreviewerFooterActions' | 'Flex' | 'Grid' | 'Heading' | 'HighlightMatch' | 'HighlightMatchHighlighted' | 'Icon' | 'Image' | 'Input' | 'Label' | 'Link' | 'Loader' | 'LoaderDeterminate' | 'LoaderPercentageText' | 'MenuContent' | 'MenuContentWrapper' | 'MenuItem' | 'MenuTrigger' | 'Message' | 'MessageIcon' | 'MessageHeading' | 'MessageBody' | 'MessageContent' | 'MessageDismiss' | 'Pagination' | 'PaginationItemButton' | 'PaginationItemCurrent' | 'PaginationItemEllipsis' | 'PasswordField' | 'PhoneNumberField' | 'Placeholder' | 'Radio' | 'RadioButton' | 'RadioInput' | 'RadioLabel' | 'RadioGroupField' | 'RadioGroup' | 'Rating' | 'ScrollView' | 'SearchField' | 'SearchFieldClear' | 'SearchFieldSearch' | 'Select' | 'SelectField' | 'SelectWrapper' | 'SelectIconWrapper' | 'SliderField' | 'SliderFieldGroup' | 'SliderFieldLabel' | 'SliderFieldRange' | 'SliderFieldRoot' | 'SliderFieldThumb' | 'SliderFieldTrack' | 'StepperField' | 'StepperFieldButtonDecrease' | 'StepperFieldButtonIncrease' | 'StepperFieldInput' | 'StorageImage' | 'StorageManager' | 'StorageManagerDropZone' | 'StorageManagerDropZoneIcon' | 'StorageManagerDropZoneText' | 'StorageManagerFilePicker' | 'StorageManagerFile' | 'StorageManagerFileWrapper' | 'StorageManagerFileList' | 'StorageManagerFileName' | 'StorageManagerFileSize' | 'StorageManagerFileInfo' | 'StorageManagerFileStatus' | 'StorageManagerFileImage' | 'StorageManagerFileMain' | 'StorageManagerLoader' | 'StorageManagerPreviewer' | 'StorageManagerPreviewerText' | 'StorageManagerPreviewerActions' | 'StorageManagerPreviewerFooter' | 'SwitchField' | 'SwitchLabel' | 'SwitchThumb' | 'SwitchTrack' | 'SwitchWrapper' | 'Table' | 'TableCaption' | 'TableBody' | 'TableTd' | 'TableTh' | 'TableFoot' | 'TableHead' | 'TableRow' | 'Tabs' | 'TabItems' | 'Text' | 'Textarea' | 'TextAreaField' | 'TextField' | 'ToggleButton' | 'ToggleButtonGroup' | 'VisuallyHidden';
|
|
4
4
|
interface ComponentClassNameMetadata {
|
|
5
5
|
className: ComponentClassName;
|
|
6
6
|
components?: ComponentNameKey[];
|
|
@@ -6,6 +6,6 @@ import { BaseFlexProps } from './flex';
|
|
|
6
6
|
import { ElementType, PrimitiveProps } from './view';
|
|
7
7
|
/** @deprecated For internal use only */
|
|
8
8
|
export interface BaseButtonGroupProps extends AriaProps, BaseStyleProps, BaseFlexProps, Pick<BaseButtonProps, 'size' | 'variation'> {
|
|
9
|
-
children
|
|
9
|
+
children?: React.ReactNode;
|
|
10
10
|
}
|
|
11
11
|
export type ButtonGroupProps<Element extends ElementType = 'div'> = PrimitiveProps<BaseButtonGroupProps, Element>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Sizes } from './base';
|
|
3
|
+
import { BaseViewProps } from './view';
|
|
4
|
+
import { FlexContainerStyleProps } from './flex';
|
|
5
|
+
import { ElementType, PrimitiveProps } from './view';
|
|
6
|
+
/** @deprecated For internal use only */
|
|
7
|
+
export interface BaseFieldsetProps extends BaseViewProps, FlexContainerStyleProps {
|
|
8
|
+
/**
|
|
9
|
+
* @description
|
|
10
|
+
* Legend is the label for the Fieldset.
|
|
11
|
+
*/
|
|
12
|
+
legend: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* @description
|
|
15
|
+
* Visually hides the legend while making it still accessible to screenreaders.
|
|
16
|
+
*/
|
|
17
|
+
legendHidden?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* @description
|
|
20
|
+
* Adds plain or outlined variation to the Fieldset
|
|
21
|
+
*/
|
|
22
|
+
variation?: 'outlined' | 'plain';
|
|
23
|
+
/**
|
|
24
|
+
* @description
|
|
25
|
+
* Changes the size of the Fieldset
|
|
26
|
+
*/
|
|
27
|
+
size?: Sizes;
|
|
28
|
+
/**
|
|
29
|
+
* @description
|
|
30
|
+
* Determines whether the Fieldset should be disabled.
|
|
31
|
+
* @default
|
|
32
|
+
* false
|
|
33
|
+
*/
|
|
34
|
+
isDisabled?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* @description
|
|
37
|
+
* Name of the Fieldset.
|
|
38
|
+
*/
|
|
39
|
+
name?: string;
|
|
40
|
+
/**
|
|
41
|
+
* @description
|
|
42
|
+
* Form to associate the Fieldset with
|
|
43
|
+
*/
|
|
44
|
+
form?: string;
|
|
45
|
+
}
|
|
46
|
+
export type FieldsetProps<Element extends ElementType = 'fieldset'> = PrimitiveProps<BaseFieldsetProps, Element>;
|
|
@@ -14,6 +14,7 @@ export * from './expander';
|
|
|
14
14
|
export * from './field';
|
|
15
15
|
export * from './fieldGroup';
|
|
16
16
|
export * from './fieldGroupIcon';
|
|
17
|
+
export * from './fieldset';
|
|
17
18
|
export * from './flex';
|
|
18
19
|
export * from './heading';
|
|
19
20
|
export * from './highlightMatch';
|
|
@@ -24,6 +25,7 @@ export * from './label';
|
|
|
24
25
|
export * from './link';
|
|
25
26
|
export * from './loader';
|
|
26
27
|
export * from './menu';
|
|
28
|
+
export * from './message';
|
|
27
29
|
export * from './pagination';
|
|
28
30
|
export * from './passwordField';
|
|
29
31
|
export * from './phoneNumberField';
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { BaseFlexProps } from './flex';
|
|
3
|
+
import { BaseButtonProps } from './button';
|
|
4
|
+
import { ElementType, PrimitiveProps, BaseViewProps } from './view';
|
|
5
|
+
export type MessageColorTheme = 'neutral' | 'info' | 'error' | 'warning' | 'success';
|
|
6
|
+
export interface BaseMessageContainerProps extends BaseFlexProps {
|
|
7
|
+
/**
|
|
8
|
+
* @description
|
|
9
|
+
* The variation property will affect the overall style of the Message.
|
|
10
|
+
*/
|
|
11
|
+
variation?: 'plain' | 'outlined' | 'filled';
|
|
12
|
+
/**
|
|
13
|
+
* @description
|
|
14
|
+
* The colorTheme property will affect the color and iconography used in the Message.
|
|
15
|
+
*/
|
|
16
|
+
colorTheme?: MessageColorTheme;
|
|
17
|
+
}
|
|
18
|
+
export interface BaseMessageProps extends BaseMessageContainerProps {
|
|
19
|
+
/**
|
|
20
|
+
* @description
|
|
21
|
+
* Configures the accessible label for the Message's dismiss button.
|
|
22
|
+
*/
|
|
23
|
+
dismissLabel?: string;
|
|
24
|
+
/**
|
|
25
|
+
* @description
|
|
26
|
+
* The isDismissible property will affect whether the user can dismiss (close) the Message. Defaults to false (not dismissible).
|
|
27
|
+
*/
|
|
28
|
+
isDismissible?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* @description
|
|
31
|
+
* The onDismiss callback will be called when the user dismisses (closes) the Message.
|
|
32
|
+
*/
|
|
33
|
+
onDismiss?: () => void;
|
|
34
|
+
/**
|
|
35
|
+
* @description
|
|
36
|
+
* The hasIcon property will determine whether or not an icon is displayed on the Message. Defaults to true (icon displayed).
|
|
37
|
+
*/
|
|
38
|
+
hasIcon?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* @description
|
|
41
|
+
* The heading property will affect the content of the Message heading.
|
|
42
|
+
*/
|
|
43
|
+
heading?: React.ReactNode;
|
|
44
|
+
}
|
|
45
|
+
export interface BaseMessageContentProps extends BaseFlexProps {
|
|
46
|
+
}
|
|
47
|
+
export interface BaseMessageDismissProps extends BaseButtonProps {
|
|
48
|
+
onDismiss?: () => void;
|
|
49
|
+
/**
|
|
50
|
+
* @description
|
|
51
|
+
* hasIcon determines whether the close icon will be displayed.
|
|
52
|
+
* @default true
|
|
53
|
+
*/
|
|
54
|
+
hasIcon?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* @description
|
|
57
|
+
* Configures the accessible label for the Message's dismiss button.
|
|
58
|
+
*/
|
|
59
|
+
dismissLabel?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface BaseMessageHeadingProps extends BaseFlexProps {
|
|
62
|
+
}
|
|
63
|
+
export interface BaseMessageIconProps extends BaseViewProps {
|
|
64
|
+
}
|
|
65
|
+
export type MessageContainerProps<Element extends ElementType = 'div'> = PrimitiveProps<BaseMessageContainerProps, Element>;
|
|
66
|
+
export type MessageContentProps<Element extends ElementType = 'div'> = PrimitiveProps<BaseMessageContentProps, Element>;
|
|
67
|
+
export type MessageDismissProps<Element extends ElementType = 'button'> = PrimitiveProps<BaseMessageDismissProps, Element>;
|
|
68
|
+
export type MessageHeadingProps<Element extends ElementType = 'div'> = PrimitiveProps<BaseMessageHeadingProps, Element>;
|
|
69
|
+
export type MessageIconProps<Element extends ElementType = 'div'> = PrimitiveProps<BaseMessageIconProps, Element>;
|
|
70
|
+
export type MessageProps<Element extends ElementType = 'div'> = PrimitiveProps<BaseMessageProps, Element>;
|
|
@@ -59,6 +59,16 @@ export interface BaseSelectProps extends BaseViewProps {
|
|
|
59
59
|
* A Boolean attribute indicating that the user cannot interact with the control
|
|
60
60
|
*/
|
|
61
61
|
isDisabled?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* @description
|
|
64
|
+
* A Boolean attribute indicating that multiple options can be selected at once
|
|
65
|
+
*/
|
|
66
|
+
isMultiple?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* @description
|
|
69
|
+
* Sets the number of visible options in a drop-down list
|
|
70
|
+
*/
|
|
71
|
+
selectSize?: number;
|
|
62
72
|
/**
|
|
63
73
|
* @description
|
|
64
74
|
* A Boolean attribute indicating that an option with a non-empty string value must be selected
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "5.
|
|
1
|
+
export declare const VERSION = "5.3.1";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/ui-react",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/esm/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"typecheck": "tsc --noEmit"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@aws-amplify/ui": "5.
|
|
51
|
-
"@aws-amplify/ui-react-core": "2.1.
|
|
50
|
+
"@aws-amplify/ui": "5.8.1",
|
|
51
|
+
"@aws-amplify/ui-react-core": "2.1.33",
|
|
52
52
|
"@radix-ui/react-accordion": "1.0.0",
|
|
53
53
|
"@radix-ui/react-direction": "1.0.0",
|
|
54
54
|
"@radix-ui/react-dropdown-menu": "1.0.0",
|