@aws-amplify/ui-react 4.6.4 → 5.0.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/dist/esm/PrimitiveCatalog.mjs +1 -1
- package/dist/esm/components/AccountSettings/ChangePassword/ChangePassword.mjs +1 -1
- package/dist/esm/components/index.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/primitives/Autocomplete/AutocompleteMenu.mjs +1 -1
- package/dist/esm/primitives/Autocomplete/AutocompleteOption.mjs +1 -1
- package/dist/esm/primitives/Link/Link.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 +0 -378
- package/dist/types/components/AccountSettings/types.d.ts +4 -7
- package/dist/types/components/index.d.ts +0 -2
- package/dist/types/primitives/Alert/Alert.d.ts +2 -3
- package/dist/types/primitives/Autocomplete/Autocomplete.d.ts +2 -3
- package/dist/types/primitives/Autocomplete/AutocompleteMenu.d.ts +2 -2
- package/dist/types/primitives/Autocomplete/AutocompleteOption.d.ts +2 -2
- package/dist/types/primitives/Badge/Badge.d.ts +2 -3
- package/dist/types/primitives/Button/Button.d.ts +2 -3
- package/dist/types/primitives/ButtonGroup/ButtonGroup.d.ts +2 -3
- package/dist/types/primitives/Card/Card.d.ts +2 -3
- package/dist/types/primitives/Checkbox/Checkbox.d.ts +3 -3
- package/dist/types/primitives/CheckboxField/CheckboxField.d.ts +2 -3
- package/dist/types/primitives/Collection/Collection.d.ts +2 -2
- package/dist/types/primitives/Divider/Divider.d.ts +2 -3
- package/dist/types/primitives/Expander/Expander.d.ts +3 -3
- package/dist/types/primitives/Expander/ExpanderItem.d.ts +3 -3
- package/dist/types/primitives/Field/Field.d.ts +3 -4
- package/dist/types/primitives/Field/FieldClearButton.d.ts +2 -3
- package/dist/types/primitives/Field/FieldDescription.d.ts +2 -2
- package/dist/types/primitives/Field/FieldErrorMessage.d.ts +2 -2
- package/dist/types/primitives/FieldGroup/FieldGroup.d.ts +2 -3
- package/dist/types/primitives/FieldGroupIcon/FieldGroupIcon.d.ts +2 -3
- package/dist/types/primitives/FieldGroupIcon/FieldGroupIconButton.d.ts +2 -3
- package/dist/types/primitives/Flex/Flex.d.ts +2 -3
- package/dist/types/primitives/Grid/Grid.d.ts +2 -3
- package/dist/types/primitives/Heading/Heading.d.ts +2 -5
- package/dist/types/primitives/HighlightMatch/HighlightMatch.d.ts +2 -3
- package/dist/types/primitives/Icon/Icon.d.ts +2 -3
- package/dist/types/primitives/Image/Image.d.ts +2 -3
- package/dist/types/primitives/Input/Input.d.ts +2 -3
- package/dist/types/primitives/Label/Label.d.ts +2 -3
- package/dist/types/primitives/Link/Link.d.ts +2 -3
- package/dist/types/primitives/Loader/Loader.d.ts +3 -3
- package/dist/types/primitives/Menu/Menu.d.ts +2 -3
- package/dist/types/primitives/Menu/MenuButton.d.ts +2 -8
- package/dist/types/primitives/Menu/MenuItem.d.ts +2 -6
- package/dist/types/primitives/Pagination/Pagination.d.ts +2 -3
- package/dist/types/primitives/Pagination/PaginationItem.d.ts +2 -2
- package/dist/types/primitives/PasswordField/PasswordField.d.ts +2 -3
- package/dist/types/primitives/PasswordField/ShowPasswordButton.d.ts +2 -3
- package/dist/types/primitives/PhoneNumberField/CountryCodeSelect.d.ts +2 -3
- package/dist/types/primitives/PhoneNumberField/PhoneNumberField.d.ts +2 -3
- package/dist/types/primitives/Placeholder/Placeholder.d.ts +2 -3
- package/dist/types/primitives/Radio/Radio.d.ts +2 -3
- package/dist/types/primitives/RadioGroupField/RadioGroupField.d.ts +2 -3
- package/dist/types/primitives/Rating/Rating.d.ts +2 -3
- package/dist/types/primitives/ScrollView/ScrollView.d.ts +2 -3
- package/dist/types/primitives/SearchField/SearchField.d.ts +2 -3
- package/dist/types/primitives/SearchField/SearchFieldButton.d.ts +2 -3
- package/dist/types/primitives/Select/Select.d.ts +3 -3
- package/dist/types/primitives/SelectField/SelectField.d.ts +2 -3
- package/dist/types/primitives/SliderField/SliderField.d.ts +3 -4
- package/dist/types/primitives/StepperField/StepperField.d.ts +3 -3
- package/dist/types/primitives/StepperField/useStepper.d.ts +1 -1
- package/dist/types/primitives/SwitchField/SwitchField.d.ts +2 -3
- package/dist/types/primitives/Table/Table.d.ts +2 -3
- package/dist/types/primitives/Table/TableBody.d.ts +2 -3
- package/dist/types/primitives/Table/TableCell.d.ts +2 -3
- package/dist/types/primitives/Table/TableFoot.d.ts +2 -3
- package/dist/types/primitives/Table/TableHead.d.ts +2 -3
- package/dist/types/primitives/Table/TableRow.d.ts +2 -3
- package/dist/types/primitives/Tabs/Tabs.d.ts +3 -4
- package/dist/types/primitives/Text/Text.d.ts +2 -3
- package/dist/types/primitives/TextArea/TextArea.d.ts +3 -3
- package/dist/types/primitives/TextAreaField/TextAreaField.d.ts +3 -3
- package/dist/types/primitives/TextField/TextField.d.ts +2 -3
- package/dist/types/primitives/ToggleButton/ToggleButton.d.ts +2 -3
- package/dist/types/primitives/ToggleButtonGroup/ToggleButtonGroup.d.ts +2 -3
- package/dist/types/primitives/View/View.d.ts +2 -7
- package/dist/types/primitives/VisuallyHidden/VisuallyHidden.d.ts +2 -3
- package/dist/types/primitives/shared/styleUtils.d.ts +3 -3
- package/dist/types/primitives/types/alert.d.ts +4 -2
- package/dist/types/primitives/types/autocomplete.d.ts +8 -5
- package/dist/types/primitives/types/badge.d.ts +3 -2
- package/dist/types/primitives/types/base.d.ts +5 -0
- package/dist/types/primitives/types/button.d.ts +3 -2
- package/dist/types/primitives/types/buttonGroup.d.ts +5 -3
- package/dist/types/primitives/types/card.d.ts +3 -2
- package/dist/types/primitives/types/checkbox.d.ts +5 -3
- package/dist/types/primitives/types/checkboxField.d.ts +5 -3
- package/dist/types/primitives/types/collection.d.ts +7 -5
- package/dist/types/primitives/types/divider.d.ts +3 -2
- package/dist/types/primitives/types/expander.d.ts +5 -3
- package/dist/types/primitives/types/field.d.ts +12 -7
- package/dist/types/primitives/types/fieldGroup.d.ts +4 -2
- package/dist/types/primitives/types/fieldGroupIcon.d.ts +6 -4
- package/dist/types/primitives/types/flex.d.ts +3 -2
- package/dist/types/primitives/types/grid.d.ts +3 -2
- package/dist/types/primitives/types/heading.d.ts +5 -2
- package/dist/types/primitives/types/highlightMatch.d.ts +3 -2
- package/dist/types/primitives/types/icon.d.ts +3 -2
- package/dist/types/primitives/types/image.d.ts +3 -2
- package/dist/types/primitives/types/input.d.ts +3 -2
- package/dist/types/primitives/types/label.d.ts +3 -2
- package/dist/types/primitives/types/link.d.ts +8 -16
- package/dist/types/primitives/types/loader.d.ts +3 -2
- package/dist/types/primitives/types/menu.d.ts +7 -4
- package/dist/types/primitives/types/pagination.d.ts +6 -7
- package/dist/types/primitives/types/passwordField.d.ts +7 -4
- package/dist/types/primitives/types/phoneNumberField.d.ts +8 -5
- package/dist/types/primitives/types/placeholder.d.ts +3 -2
- package/dist/types/primitives/types/radio.d.ts +4 -2
- package/dist/types/primitives/types/radioGroupField.d.ts +5 -3
- package/dist/types/primitives/types/rating.d.ts +4 -2
- package/dist/types/primitives/types/scrollView.d.ts +3 -2
- package/dist/types/primitives/types/searchField.d.ts +6 -3
- package/dist/types/primitives/types/select.d.ts +3 -2
- package/dist/types/primitives/types/selectField.d.ts +5 -3
- package/dist/types/primitives/types/sliderField.d.ts +4 -3
- package/dist/types/primitives/types/stepperField.d.ts +4 -2
- package/dist/types/primitives/types/switchField.d.ts +5 -3
- package/dist/types/primitives/types/table.d.ts +13 -8
- package/dist/types/primitives/types/tabs.d.ts +6 -3
- package/dist/types/primitives/types/text.d.ts +3 -7
- package/dist/types/primitives/types/textArea.d.ts +3 -2
- package/dist/types/primitives/types/textAreaField.d.ts +5 -3
- package/dist/types/primitives/types/textField.d.ts +7 -5
- package/dist/types/primitives/types/toggleButton.d.ts +4 -2
- package/dist/types/primitives/types/toggleButtonGroup.d.ts +5 -3
- package/dist/types/primitives/types/view.d.ts +14 -30
- package/dist/types/primitives/types/visuallyHidden.d.ts +3 -2
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -21
- package/dist/esm/components/Geo/LocationSearch/index.mjs +0 -1
- package/dist/esm/components/Geo/MapView/index.mjs +0 -1
- package/dist/esm/components/InAppMessaging/Backdrop/Backdrop.mjs +0 -1
- package/dist/esm/components/InAppMessaging/Backdrop/withBackdrop.mjs +0 -1
- package/dist/esm/components/InAppMessaging/BannerMessage/BannerMessage.mjs +0 -1
- package/dist/esm/components/InAppMessaging/BannerMessage/constants.mjs +0 -1
- package/dist/esm/components/InAppMessaging/CloseIconButton/CloseIconButton.mjs +0 -1
- package/dist/esm/components/InAppMessaging/FullScreenMessage/FullScreenMessage.mjs +0 -1
- package/dist/esm/components/InAppMessaging/FullScreenMessage/constants.mjs +0 -1
- package/dist/esm/components/InAppMessaging/InAppMessageDisplay/InAppMessageDisplay.mjs +0 -1
- package/dist/esm/components/InAppMessaging/InAppMessageDisplay/handleMessageLinkAction.mjs +0 -1
- package/dist/esm/components/InAppMessaging/InAppMessagingProvider/InAppMessagingProvider.mjs +0 -1
- package/dist/esm/components/InAppMessaging/MessageLayout/MessageLayout.mjs +0 -1
- package/dist/esm/components/InAppMessaging/MessageLayout/constants.mjs +0 -1
- package/dist/esm/components/InAppMessaging/MessageLayout/utils.mjs +0 -1
- package/dist/esm/components/InAppMessaging/ModalMessage/ModalMessage.mjs +0 -1
- package/dist/esm/components/InAppMessaging/ModalMessage/constants.mjs +0 -1
- package/dist/esm/components/InAppMessaging/hooks/useMessageImage/types.mjs +0 -1
- package/dist/esm/components/InAppMessaging/hooks/useMessageImage/useMessageImage.mjs +0 -1
- package/dist/esm/components/InAppMessaging/hooks/useMessageProps/useMessageProps.mjs +0 -1
- package/dist/esm/components/InAppMessaging/hooks/useMessageProps/utils.mjs +0 -1
- package/dist/esm/components/InAppMessaging/useInAppMessaging/useInAppMessaging.mjs +0 -1
- package/dist/esm/components/InAppMessaging/withInAppMessaging/withInAppMessaging.mjs +0 -1
- package/dist/types/components/Geo/LocationSearch/index.d.ts +0 -25
- package/dist/types/components/Geo/MapView/index.d.ts +0 -24
- package/dist/types/components/Geo/index.d.ts +0 -2
- package/dist/types/components/Geo/types/maplibre-gl-geocoder.d.ts +0 -171
- package/dist/types/components/InAppMessaging/Backdrop/Backdrop.d.ts +0 -4
- package/dist/types/components/InAppMessaging/Backdrop/index.d.ts +0 -2
- package/dist/types/components/InAppMessaging/Backdrop/types.d.ts +0 -8
- package/dist/types/components/InAppMessaging/Backdrop/withBackdrop.d.ts +0 -3
- package/dist/types/components/InAppMessaging/BannerMessage/BannerMessage.d.ts +0 -3
- package/dist/types/components/InAppMessaging/BannerMessage/constants.d.ts +0 -1
- package/dist/types/components/InAppMessaging/BannerMessage/index.d.ts +0 -2
- package/dist/types/components/InAppMessaging/BannerMessage/types.d.ts +0 -7
- package/dist/types/components/InAppMessaging/CloseIconButton/CloseIconButton.d.ts +0 -3
- package/dist/types/components/InAppMessaging/CloseIconButton/index.d.ts +0 -1
- package/dist/types/components/InAppMessaging/CloseIconButton/types.d.ts +0 -8
- package/dist/types/components/InAppMessaging/FullScreenMessage/FullScreenMessage.d.ts +0 -3
- package/dist/types/components/InAppMessaging/FullScreenMessage/constants.d.ts +0 -1
- package/dist/types/components/InAppMessaging/FullScreenMessage/index.d.ts +0 -2
- package/dist/types/components/InAppMessaging/FullScreenMessage/types.d.ts +0 -4
- package/dist/types/components/InAppMessaging/InAppMessageDisplay/InAppMessageDisplay.d.ts +0 -10
- package/dist/types/components/InAppMessaging/InAppMessageDisplay/handleMessageLinkAction.d.ts +0 -3
- package/dist/types/components/InAppMessaging/InAppMessageDisplay/index.d.ts +0 -2
- package/dist/types/components/InAppMessaging/InAppMessageDisplay/types.d.ts +0 -23
- package/dist/types/components/InAppMessaging/InAppMessagingProvider/InAppMessagingProvider.d.ts +0 -4
- package/dist/types/components/InAppMessaging/InAppMessagingProvider/index.d.ts +0 -1
- package/dist/types/components/InAppMessaging/MessageLayout/MessageLayout.d.ts +0 -3
- package/dist/types/components/InAppMessaging/MessageLayout/constants.d.ts +0 -16
- package/dist/types/components/InAppMessaging/MessageLayout/index.d.ts +0 -1
- package/dist/types/components/InAppMessaging/MessageLayout/types.d.ts +0 -23
- package/dist/types/components/InAppMessaging/MessageLayout/utils.d.ts +0 -13
- package/dist/types/components/InAppMessaging/ModalMessage/ModalMessage.d.ts +0 -3
- package/dist/types/components/InAppMessaging/ModalMessage/constants.d.ts +0 -2
- package/dist/types/components/InAppMessaging/ModalMessage/index.d.ts +0 -2
- package/dist/types/components/InAppMessaging/ModalMessage/types.d.ts +0 -4
- package/dist/types/components/InAppMessaging/hooks/index.d.ts +0 -2
- package/dist/types/components/InAppMessaging/hooks/useMessageImage/index.d.ts +0 -1
- package/dist/types/components/InAppMessaging/hooks/useMessageImage/types.d.ts +0 -10
- package/dist/types/components/InAppMessaging/hooks/useMessageImage/useMessageImage.d.ts +0 -9
- package/dist/types/components/InAppMessaging/hooks/useMessageProps/index.d.ts +0 -2
- package/dist/types/components/InAppMessaging/hooks/useMessageProps/types.d.ts +0 -39
- package/dist/types/components/InAppMessaging/hooks/useMessageProps/useMessageProps.d.ts +0 -11
- package/dist/types/components/InAppMessaging/hooks/useMessageProps/utils.d.ts +0 -23
- package/dist/types/components/InAppMessaging/index.d.ts +0 -7
- package/dist/types/components/InAppMessaging/useInAppMessaging/index.d.ts +0 -1
- package/dist/types/components/InAppMessaging/useInAppMessaging/useInAppMessaging.d.ts +0 -3
- package/dist/types/components/InAppMessaging/withInAppMessaging/index.d.ts +0 -1
- package/dist/types/components/InAppMessaging/withInAppMessaging/withInAppMessaging.d.ts +0 -5
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { BaseTextFieldProps } from '../types/textField';
|
|
2
|
+
import { ElementType, PrimitiveProps } from './view';
|
|
3
|
+
export interface BaseStepperFieldProps extends BaseTextFieldProps {
|
|
3
4
|
/**
|
|
4
5
|
* @description
|
|
5
6
|
* <input> elements of type number are used to let the user enter a number. They include built-in validation to reject non-numerical entries.
|
|
@@ -62,3 +63,4 @@ export interface StepperFieldProps extends TextFieldProps {
|
|
|
62
63
|
*/
|
|
63
64
|
onDecrease?: () => void;
|
|
64
65
|
}
|
|
66
|
+
export type StepperFieldProps<Element extends ElementType = 'input'> = PrimitiveProps<BaseStepperFieldProps, Element>;
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
import { Property } from 'csstype';
|
|
3
3
|
import { Sizes } from './base';
|
|
4
4
|
import { BaseStyleProps, StyleToken } from './style';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
5
|
+
import { BaseInputProps } from './input';
|
|
6
|
+
import { BaseFieldProps, LabelPositions } from './field';
|
|
7
|
+
import { ElementType, PrimitiveProps } from './view';
|
|
8
|
+
export interface BaseSwitchFieldProps extends BaseInputProps, BaseFieldProps, BaseStyleProps {
|
|
8
9
|
/**
|
|
9
10
|
* @description
|
|
10
11
|
* Use this to provide a default checked value for an uncontrolled SwitchField
|
|
@@ -71,3 +72,4 @@ export interface SwitchFieldProps extends InputProps, FieldProps, BaseStyleProps
|
|
|
71
72
|
*/
|
|
72
73
|
value?: string | number;
|
|
73
74
|
}
|
|
75
|
+
export type SwitchFieldProps<Element extends ElementType = 'input'> = PrimitiveProps<BaseSwitchFieldProps, Element>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Sizes } from './base';
|
|
3
|
-
import {
|
|
3
|
+
import { ElementType, PrimitiveProps, BaseViewProps } from './view';
|
|
4
4
|
export type TableSize = Sizes;
|
|
5
5
|
export type TableVariation = 'bordered' | 'striped';
|
|
6
|
-
export interface
|
|
6
|
+
export interface BaseTableProps extends BaseViewProps {
|
|
7
7
|
/**
|
|
8
8
|
* @description
|
|
9
9
|
* Optional caption which serves as an accessible title/caption for
|
|
@@ -26,11 +26,12 @@ export interface TableProps extends ViewProps {
|
|
|
26
26
|
*/
|
|
27
27
|
variation?: TableVariation;
|
|
28
28
|
}
|
|
29
|
-
export
|
|
29
|
+
export type TableProps<Element extends ElementType = 'table'> = PrimitiveProps<BaseTableProps, Element>;
|
|
30
|
+
export interface BaseTableBodyProps extends BaseViewProps {
|
|
30
31
|
}
|
|
32
|
+
export type TableBodyProps<Element extends ElementType = 'tbody'> = PrimitiveProps<BaseTableBodyProps, Element>;
|
|
31
33
|
export type TableCellElement = 'td' | 'th';
|
|
32
|
-
export interface
|
|
33
|
-
as?: TableCellElement;
|
|
34
|
+
export interface BaseTableCellProps extends BaseViewProps {
|
|
34
35
|
/**
|
|
35
36
|
* @description
|
|
36
37
|
* Defines the number of columns spanned by a cell within a <table>
|
|
@@ -42,9 +43,13 @@ export interface TableCellProps extends ViewProps {
|
|
|
42
43
|
*/
|
|
43
44
|
rowspan?: Pick<React.HTMLProps<HTMLTableCellElement>, 'rowSpan'>;
|
|
44
45
|
}
|
|
45
|
-
export
|
|
46
|
+
export type TableCellProps<Element extends ElementType = TableCellElement> = PrimitiveProps<BaseTableCellProps, Element>;
|
|
47
|
+
export interface BaseTableFootProps extends BaseViewProps {
|
|
46
48
|
}
|
|
47
|
-
export
|
|
49
|
+
export type TableFootProps<Element extends ElementType = 'tfoot'> = PrimitiveProps<BaseTableFootProps, Element>;
|
|
50
|
+
export interface BaseTableHeadProps extends BaseViewProps {
|
|
48
51
|
}
|
|
49
|
-
export
|
|
52
|
+
export type TableHeadProps<Element extends ElementType = 'thead'> = PrimitiveProps<BaseTableHeadProps, Element>;
|
|
53
|
+
export interface BaseTableRowProps extends BaseViewProps {
|
|
50
54
|
}
|
|
55
|
+
export type TableRowProps<Element extends ElementType = 'tr'> = PrimitiveProps<BaseTableRowProps, Element>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BaseComponentProps } from './base';
|
|
3
3
|
import { BaseStyleProps } from './style';
|
|
4
|
-
import {
|
|
4
|
+
import { BaseFlexProps } from './flex';
|
|
5
|
+
import { ElementType, PrimitiveProps } from './view';
|
|
5
6
|
export type TabsSpacing = 'equal' | 'relative';
|
|
6
|
-
export interface
|
|
7
|
+
export interface BaseTabsProps extends BaseFlexProps {
|
|
7
8
|
/**
|
|
8
9
|
* @description
|
|
9
10
|
* The Tabs component only accepts TabItem components as children.
|
|
@@ -39,7 +40,8 @@ export interface TabsProps extends FlexProps {
|
|
|
39
40
|
*/
|
|
40
41
|
indicatorPosition?: 'top' | 'bottom';
|
|
41
42
|
}
|
|
42
|
-
export
|
|
43
|
+
export type TabsProps<Element extends ElementType = 'div'> = PrimitiveProps<BaseTabsProps, Element>;
|
|
44
|
+
export interface BaseTabItemProps extends BaseComponentProps, BaseStyleProps {
|
|
43
45
|
/**
|
|
44
46
|
* @description
|
|
45
47
|
* Change the title corresponding with each Tab's content panel.
|
|
@@ -56,3 +58,4 @@ export interface TabItemProps extends BaseComponentProps, BaseStyleProps {
|
|
|
56
58
|
*/
|
|
57
59
|
children?: React.ReactNode;
|
|
58
60
|
}
|
|
61
|
+
export type TabItemProps<Element extends ElementType = 'button'> = PrimitiveProps<BaseTabItemProps, Element>;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ElementType, PrimitiveProps, BaseViewProps } from './view';
|
|
2
2
|
export type TextVariation = 'primary' | 'secondary' | 'tertiary' | 'error' | 'warning' | 'info' | 'success';
|
|
3
|
-
export interface
|
|
4
|
-
/**
|
|
5
|
-
* @description
|
|
6
|
-
* HTML allowed tags
|
|
7
|
-
*/
|
|
8
|
-
as?: 'p' | 'span' | 'strong' | 'em';
|
|
3
|
+
export interface BaseTextProps extends BaseViewProps {
|
|
9
4
|
/**
|
|
10
5
|
* @description
|
|
11
6
|
* This should be the primary way to handle different styles of text. Lower-level
|
|
@@ -20,3 +15,4 @@ export interface TextProps extends ViewProps {
|
|
|
20
15
|
*/
|
|
21
16
|
isTruncated?: boolean;
|
|
22
17
|
}
|
|
18
|
+
export type TextProps<Element extends ElementType = 'p'> = PrimitiveProps<BaseTextProps, Element>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Property } from 'csstype';
|
|
3
3
|
import { Sizes } from './base';
|
|
4
4
|
import { FieldVariations } from './field';
|
|
5
|
-
import {
|
|
5
|
+
import { ElementType, PrimitiveProps, BaseViewProps } from './view';
|
|
6
6
|
export interface TextAreaStyleProps {
|
|
7
7
|
/**
|
|
8
8
|
* @description
|
|
@@ -10,7 +10,7 @@ export interface TextAreaStyleProps {
|
|
|
10
10
|
*/
|
|
11
11
|
resize?: Property.Resize;
|
|
12
12
|
}
|
|
13
|
-
export interface
|
|
13
|
+
export interface BaseTextAreaProps extends TextAreaStyleProps, BaseViewProps {
|
|
14
14
|
/**
|
|
15
15
|
* @description
|
|
16
16
|
* Specifies permissions for browser UA to autocomplete field.
|
|
@@ -87,3 +87,4 @@ export interface TextAreaProps extends TextAreaStyleProps, ViewProps {
|
|
|
87
87
|
*/
|
|
88
88
|
variation?: FieldVariations;
|
|
89
89
|
}
|
|
90
|
+
export type TextAreaProps<Element extends ElementType = 'textarea'> = PrimitiveProps<BaseTextAreaProps, Element>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { BaseTextAreaProps, TextAreaStyleProps } from './textArea';
|
|
2
|
+
import { BaseFieldProps } from './field';
|
|
3
3
|
import { FlexContainerStyleProps } from './flex';
|
|
4
4
|
import { BaseStyleProps } from './style';
|
|
5
|
-
|
|
5
|
+
import { ElementType, PrimitiveProps } from './view';
|
|
6
|
+
export interface BaseTextAreaFieldProps extends BaseFieldProps, FlexContainerStyleProps, BaseTextAreaProps {
|
|
6
7
|
inputStyles?: BaseStyleProps & TextAreaStyleProps;
|
|
7
8
|
}
|
|
9
|
+
export type TextAreaFieldProps<Element extends ElementType = 'textarea'> = PrimitiveProps<BaseTextAreaFieldProps, Element>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { FlexContainerStyleProps } from './flex';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
3
|
+
import { BaseInputProps } from './input';
|
|
4
|
+
import { BaseFieldProps } from './field';
|
|
5
|
+
import { PrimitiveProps, ElementType } from './view';
|
|
6
|
+
export interface TextFieldOptions extends BaseFieldProps, FlexContainerStyleProps {
|
|
6
7
|
/**
|
|
7
8
|
* @description
|
|
8
9
|
* Component(s) to show after input
|
|
@@ -27,7 +28,8 @@ export interface TextFieldOptions extends FieldProps, FlexContainerStyleProps {
|
|
|
27
28
|
* @description
|
|
28
29
|
* Input field type
|
|
29
30
|
*/
|
|
30
|
-
type?:
|
|
31
|
+
type?: BaseInputProps['type'];
|
|
31
32
|
}
|
|
32
|
-
export interface
|
|
33
|
+
export interface BaseTextFieldProps extends TextFieldOptions, BaseInputProps {
|
|
33
34
|
}
|
|
35
|
+
export type TextFieldProps<Element extends ElementType = 'input'> = PrimitiveProps<BaseTextFieldProps, Element>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { BaseButtonProps } from './button';
|
|
2
|
+
import { ElementType, PrimitiveProps } from './view';
|
|
3
|
+
export interface BaseToggleButtonProps extends BaseButtonProps {
|
|
3
4
|
/**
|
|
4
5
|
* @description
|
|
5
6
|
* Controls the selected state of the ToggleButton
|
|
@@ -21,3 +22,4 @@ export interface ToggleButtonProps extends ButtonProps {
|
|
|
21
22
|
*/
|
|
22
23
|
onChange?: (value: string | undefined) => void;
|
|
23
24
|
}
|
|
25
|
+
export type ToggleButtonProps<Element extends ElementType = 'button'> = PrimitiveProps<BaseToggleButtonProps, Element>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import { BaseFlexProps } from './flex';
|
|
3
|
+
import { BaseToggleButtonProps } from './toggleButton';
|
|
4
|
+
import { ElementType, PrimitiveProps } from './view';
|
|
5
|
+
export interface BaseToggleButtonGroupProps extends BaseFlexProps, Pick<BaseToggleButtonProps, 'size' | 'variation'> {
|
|
5
6
|
/**
|
|
6
7
|
* @description
|
|
7
8
|
* Accepts any number of ToggleButton components
|
|
@@ -28,3 +29,4 @@ export interface ToggleButtonGroupProps extends FlexProps, Pick<ToggleButtonProp
|
|
|
28
29
|
*/
|
|
29
30
|
onChange: (value: string | (string | undefined)[] | undefined) => void;
|
|
30
31
|
}
|
|
32
|
+
export type ToggleButtonGroupProps<Element extends ElementType = 'div'> = PrimitiveProps<BaseToggleButtonGroupProps, Element>;
|
|
@@ -1,42 +1,25 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AriaProps, BaseComponentProps } from './base';
|
|
3
3
|
import { BaseStyleProps } from './style';
|
|
4
|
+
export type IsAny<Type> = (Type extends never ? true : false) extends false ? false : true;
|
|
4
5
|
type MergeProps<A, B> = A & Omit<B, keyof A>;
|
|
5
|
-
export type ElementType = React.
|
|
6
|
-
|
|
7
|
-
* @description
|
|
8
|
-
* Convert string element type to DOMElement Type
|
|
9
|
-
* e.g. 'button' => HTMLButtonElement
|
|
10
|
-
*/
|
|
11
|
-
export type HTMLElementType<Element extends ElementType> = Element extends keyof JSX.IntrinsicElements ? React.ElementRef<Element> : HTMLElementTypeFromExoticComponentRef<Element>;
|
|
12
|
-
/**
|
|
13
|
-
* @description
|
|
14
|
-
* Allows us to extract ElementType from `typeof Root` used in SliderField
|
|
15
|
-
* e.g. React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<HTMLSpanElement>> => HTMLSpanElement
|
|
16
|
-
*/
|
|
17
|
-
type HTMLElementTypeFromExoticComponentRef<Element extends ElementType> = Element extends React.ForwardRefExoticComponent<React.RefAttributes<infer DOMHTMLElement>> ? DOMHTMLElement : HTMLElement;
|
|
18
|
-
export type ElementProps<Element extends ElementType> = Element extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[Element] : Element extends React.FC<infer ComponentProps> ? ComponentProps : never;
|
|
19
|
-
export type PrimitiveProps<Props extends ViewProps, Element extends ElementType> = MergeProps<Omit<Props, 'as'> & {
|
|
6
|
+
export type ElementType = React.ElementType;
|
|
7
|
+
type AsProp<Element extends ElementType> = {
|
|
20
8
|
/**
|
|
21
9
|
* @description
|
|
22
10
|
* Changes the type of HTML element rendered
|
|
23
11
|
*/
|
|
24
|
-
as?: Element
|
|
25
|
-
}, Omit<ElementProps<Element>, 'ref'>>;
|
|
26
|
-
export type PrimitivePropsWithRef<Props extends ViewProps, Element extends ElementType> = PrimitiveProps<Props, Element> & {
|
|
27
|
-
/**
|
|
28
|
-
* @description
|
|
29
|
-
* References a DOM element from within a parent component
|
|
30
|
-
*/
|
|
31
|
-
ref?: React.Ref<HTMLElementType<Element>>;
|
|
12
|
+
as?: Element;
|
|
32
13
|
};
|
|
33
|
-
export type
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
14
|
+
export type PrimitivePropsWithAs<Props extends BaseViewProps, Element extends ElementType> = Omit<Props, 'as'> & AsProp<Element>;
|
|
15
|
+
type PrimitivePropsWithRef<Props extends BaseViewProps, Element extends ElementType> = Omit<Props, 'ref'> & (IsAny<Element> extends false ? React.RefAttributes<React.ComponentRef<Element>> : React.RefAttributes<any>);
|
|
16
|
+
export type PrimitivePropsWithHTMLAttributes<Props extends BaseViewProps, Element extends ElementType> = MergeProps<PrimitivePropsWithRef<Props, Element>, React.ComponentPropsWithoutRef<Element>>;
|
|
17
|
+
export type PrimitiveProps<Props extends BaseViewProps, Element extends ElementType> = PrimitivePropsWithHTMLAttributes<PrimitivePropsWithAs<Props, Element>, Element>;
|
|
18
|
+
export type Primitive<Props extends BaseViewProps, Element extends ElementType> = React.ForwardRefRenderFunction<React.ComponentRef<Element>, Props>;
|
|
19
|
+
export interface ForwardRefPrimitive<Props extends BaseViewProps, DefaultElement extends ElementType> extends React.ForwardRefExoticComponent<Props> {
|
|
20
|
+
<Element extends ElementType = DefaultElement>(props: PrimitiveProps<Props, Element>): React.ReactElement | null;
|
|
21
|
+
}
|
|
22
|
+
export interface BaseViewProps extends BaseComponentProps, BaseStyleProps, AriaProps {
|
|
40
23
|
/**
|
|
41
24
|
* @description
|
|
42
25
|
* Sets the Boolean `disabled` HTML attribute, which, when present, makes the element not mutable, focusable, or even submitted with the form
|
|
@@ -51,4 +34,5 @@ export interface ViewProps extends BaseComponentProps, BaseStyleProps, AriaProps
|
|
|
51
34
|
*/
|
|
52
35
|
style?: React.CSSProperties;
|
|
53
36
|
}
|
|
37
|
+
export type ViewProps<Element extends ElementType = 'div'> = PrimitiveProps<BaseViewProps, Element>;
|
|
54
38
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface
|
|
1
|
+
import { ElementType, PrimitiveProps, BaseViewProps } from './view';
|
|
2
|
+
export interface BaseVisuallyHiddenProps extends BaseViewProps {
|
|
3
3
|
}
|
|
4
|
+
export type VisuallyHiddenProps<Element extends ElementType = 'span'> = PrimitiveProps<BaseVisuallyHiddenProps, Element>;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "
|
|
1
|
+
export declare const VERSION = "5.0.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/ui-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/esm/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@aws-amplify/ui": "5.6.4",
|
|
51
51
|
"@aws-amplify/ui-react-core": "2.1.23",
|
|
52
|
-
"@aws-amplify/ui-react-core-notifications": "1.0.0",
|
|
53
52
|
"@radix-ui/react-accordion": "1.0.0",
|
|
54
53
|
"@radix-ui/react-direction": "1.0.0",
|
|
55
54
|
"@radix-ui/react-dropdown-menu": "1.0.0",
|
|
@@ -59,13 +58,8 @@
|
|
|
59
58
|
"classnames": "2.3.1",
|
|
60
59
|
"deepmerge": "4.2.2",
|
|
61
60
|
"lodash": "4.17.21",
|
|
62
|
-
"mapbox-gl": "1.13.1",
|
|
63
|
-
"maplibre-gl": "2.1.9",
|
|
64
|
-
"maplibre-gl-js-amplify": "3.0.5",
|
|
65
61
|
"qrcode": "1.5.0",
|
|
66
62
|
"react-generate-context": "1.0.1",
|
|
67
|
-
"react-map-gl": "7.0.23",
|
|
68
|
-
"tinycolor2": "1.4.2",
|
|
69
63
|
"tslib": "2.4.1"
|
|
70
64
|
},
|
|
71
65
|
"peerDependencies": {
|
|
@@ -88,11 +82,9 @@
|
|
|
88
82
|
"@testing-library/react-hooks": "^7.0.1",
|
|
89
83
|
"@testing-library/user-event": "^13.2.1",
|
|
90
84
|
"@types/jest": "^26.0.23",
|
|
91
|
-
"@types/mapbox__mapbox-gl-draw": "^1.3.3",
|
|
92
85
|
"@types/qrcode": "^1.4.2",
|
|
93
86
|
"@types/react": "^17.0.2",
|
|
94
87
|
"@types/testing-library__jest-dom": "^5.14.1",
|
|
95
|
-
"@types/tinycolor2": "^1.4.3",
|
|
96
88
|
"esbuild-register": "^3.3.3",
|
|
97
89
|
"eslint": "^8.13.0",
|
|
98
90
|
"jest": "^27.0.4",
|
|
@@ -119,12 +111,6 @@
|
|
|
119
111
|
"import": "{ Authenticator }",
|
|
120
112
|
"limit": "120 kB"
|
|
121
113
|
},
|
|
122
|
-
{
|
|
123
|
-
"name": "Geo",
|
|
124
|
-
"path": "dist/esm/index.mjs",
|
|
125
|
-
"import": "{ MapView, LocationSearch }",
|
|
126
|
-
"limit": "330 kB"
|
|
127
|
-
},
|
|
128
114
|
{
|
|
129
115
|
"name": "Storage - FileUploader",
|
|
130
116
|
"path": "dist/esm/index.mjs",
|
|
@@ -136,12 +122,6 @@
|
|
|
136
122
|
"path": "dist/esm/index.mjs",
|
|
137
123
|
"import": "{ AccountSettings }",
|
|
138
124
|
"limit": "60 kB"
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
"name": "InAppMessaging",
|
|
142
|
-
"path": "dist/esm/index.mjs",
|
|
143
|
-
"import": "{ InAppMessagingProvider, InAppMessageDisplay }",
|
|
144
|
-
"limit": "110 kB"
|
|
145
125
|
}
|
|
146
126
|
]
|
|
147
127
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__rest as e}from"tslib";import r,{useRef as a,useEffect as o}from"react";import t from"maplibre-gl";import{createAmplifyGeocoder as i}from"maplibre-gl-js-amplify";import{useMap as n,useControl as s}from"react-map-gl";import{useDeprecationWarning as l}from"../../../hooks/useDeprecationWarning.mjs";const m={maplibregl:t,marker:{color:"#3FB1CE"},popup:!0,showResultMarkers:{color:"#3FB1CE"},showResultsWhileTyping:!0},c="geocoder-container",p=r=>{var{position:a="top-right"}=r,o=e(r,["position"]);return s((()=>i(o)),{position:a}),null},u=e=>{const t=a(!1);return o((()=>{t.current||(i(e).addTo(`#${c}`),t.current=!0)}),[e]),r.createElement("div",{id:c})},g=e=>{l({shouldWarn:!0,message:"The `LocationSearch` component has been migrated to `@aws-amplify/ui-react-geo` and will be removed from this package in a future major release. Please install `@aws-amplify/ui-react-geo` and update the import path."});const{current:a}=n();return a?r.createElement(p,Object.assign({},m,e)):r.createElement(u,Object.assign({},m,e))},d=e=>(l({shouldWarn:!0,message:"The `Geocoder` component has been replaced by `LocationSearch` and is available from `@aws-amplify/ui-react-geo`. `Geocoder` will be removed from this package in a future major release. Please install `@aws-amplify/ui-react-geo` and replace `Geocoder` usage with `LocationSearch`."}),r.createElement(g,Object.assign({},e)));export{d as Geocoder,g as LocationSearch};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__rest as e,__awaiter as i}from"tslib";import o,{forwardRef as a,useMemo as r,useState as t,useEffect as l}from"react";import n from"maplibre-gl";import{AmplifyMapLibreRequest as m}from"maplibre-gl-js-amplify";import s from"react-map-gl";import{Amplify as p,Auth as u}from"aws-amplify";import{useDeprecationWarning as d}from"../../../hooks/useDeprecationWarning.mjs";const f=a(((a,f)=>{var c,{mapLib:v,mapStyle:g,style:y}=a,h=e(a,["mapLib","mapStyle","style"]);d({shouldWarn:!0,message:"The `MapView` component has been migrated to `@aws-amplify/ui-react-geo` and will be removed from this package in a future major release. Please install `@aws-amplify/ui-react-geo` and update the import path."});const b=p.configure(),w=r((()=>{var e,i,o,a;return null!==(a=null!==(i=null===(e=b.geo)||void 0===e?void 0:e.amazon_location_service)&&void 0!==i?i:null===(o=b.geo)||void 0===o?void 0:o.AmazonLocationService)&&void 0!==a?a:{}}),[b]),[j,L]=t(),S=r((()=>Object.assign({height:"100vh",position:"relative",width:"100vw"},y)),[y]);return l((()=>{i(void 0,void 0,void 0,(function*(){const e=yield u.currentUserCredentials();if(e){const{region:i}=w,{transformRequest:o}=new m(e,i);L((()=>o))}}))}),[w]),j?o.createElement(s,Object.assign({},h,{mapLib:null!=v?v:n,mapStyle:null!=g?g:null===(c=w.maps)||void 0===c?void 0:c.default,ref:f,style:S,transformRequest:j,fog:h.fog,terrain:h.terrain})):null}));f.displayName="MapView";export{f as MapView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__rest as i}from"tslib";import t from"react";import{View as a}from"../../../primitives/View/View.mjs";const e="inappmessaging-backdrop";function r(r){var{onClick:o}=r,m=i(r,["onClick"]);return t.createElement(a,Object.assign({className:"amplify-inappmessaging-backdrop","data-testid":e,onClick:o},m))}export{e as BACKDROP_TEST_ID,r as Backdrop};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"react";import{Flex as t}from"../../../primitives/Flex/Flex.mjs";import{View as r}from"../../../primitives/View/View.mjs";import{Backdrop as m}from"./Backdrop.mjs";function n(n,a={}){return function(i){return e.createElement(e.Fragment,null,e.createElement(m,Object.assign({},a)),e.createElement(t,{className:"amplify-inappmessaging-backdrop-content-container"},e.createElement(r,{className:"amplify-inappmessaging-backdrop-content"},e.createElement(n,Object.assign({},i)))))}}export{n as withBackdrop};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"react";import s from"classnames";import{useBreakpointValue as o}from"../../../hooks/useBreakpointValue.mjs";import{Flex as t}from"../../../primitives/Flex/Flex.mjs";import"../hooks/useMessageImage/useMessageImage.mjs";import r from"../hooks/useMessageProps/useMessageProps.mjs";import{MessageLayout as m}from"../MessageLayout/MessageLayout.mjs";import{BLOCK_CLASS as a}from"./constants.mjs";function i(i){const n=r(i),l=o([!0,!0,!1]),{shouldRenderMessage:p,styles:g}=n;if(!p)return null;const{alignment:u="right",position:c="top"}=i,d="center"===u&&"middle"===c;return e.createElement(t,{className:s(a,{[`${a}--${c}`]:!d,[`${a}--${u}`]:!d,[`${a}--center-middle`]:d,[`${a}--full-width`]:l}),role:"dialog",testId:`inappmessaging-${c}banner-dialog`},e.createElement(m,Object.assign({},i,n,{orientation:"horizontal",buttonSize:"small",styles:g})))}export{i as BannerMessage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const a="amplify-inappmessaging-bannermessage";export{a as BLOCK_CLASS};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{__rest as i}from"tslib";import*as e from"react";import"../../../primitives/Alert/Alert.mjs";import"../../../primitives/Autocomplete/Autocomplete.mjs";import"../../../primitives/Badge/Badge.mjs";import{Button as m}from"../../../primitives/Button/Button.mjs";import"../../../primitives/ButtonGroup/ButtonGroup.mjs";import"../../../primitives/Card/Card.mjs";import"../../../primitives/CheckboxField/CheckboxField.mjs";import"../../../primitives/Collection/Collection.mjs";import"../../../primitives/Divider/Divider.mjs";import"../../../primitives/Expander/Expander.mjs";import"../../../primitives/Expander/ExpanderItem.mjs";import"../../../primitives/FieldGroupIcon/FieldGroupIcon.mjs";import"../../../primitives/FieldGroupIcon/FieldGroupIconButton.mjs";import"../../../primitives/Flex/Flex.mjs";import"../../../primitives/Grid/Grid.mjs";import"../../../primitives/Heading/Heading.mjs";import"../../../primitives/HighlightMatch/HighlightMatch.mjs";import"../../../primitives/Icon/Icon.mjs";import"../../../primitives/Image/Image.mjs";import"../../../primitives/Link/Link.mjs";import"../../../primitives/Loader/Loader.mjs";import"../../../primitives/Menu/Menu.mjs";import"../../../primitives/Menu/MenuButton.mjs";import"../../../primitives/Menu/MenuItem.mjs";import"../../../primitives/Pagination/Pagination.mjs";import"../../../primitives/PasswordField/PasswordField.mjs";import"../../../primitives/PhoneNumberField/PhoneNumberField.mjs";import"../../../primitives/Placeholder/Placeholder.mjs";import"../../../primitives/Radio/Radio.mjs";import"../../../primitives/RadioGroupField/RadioGroupField.mjs";import"../../../primitives/Rating/Rating.mjs";import"../../../primitives/ScrollView/ScrollView.mjs";import"../../../primitives/SearchField/SearchField.mjs";import"../../../primitives/SelectField/SelectField.mjs";import"../../../primitives/SliderField/SliderField.mjs";import"../../../primitives/StepperField/StepperField.mjs";import"../../../primitives/SwitchField/SwitchField.mjs";import"../../../primitives/Table/Table.mjs";import"../../../primitives/Table/TableBody.mjs";import"../../../primitives/Table/TableCell.mjs";import"../../../primitives/Table/TableFoot.mjs";import"../../../primitives/Table/TableHead.mjs";import"../../../primitives/Table/TableRow.mjs";import"../../../primitives/Tabs/Tabs.mjs";import"../../../primitives/Text/Text.mjs";import"../../../primitives/TextAreaField/TextAreaField.mjs";import"../../../primitives/TextField/TextField.mjs";import"../../../primitives/ToggleButton/ToggleButton.mjs";import"../../../primitives/ToggleButtonGroup/ToggleButtonGroup.mjs";import"../../../primitives/View/View.mjs";import"../../../primitives/VisuallyHidden/VisuallyHidden.mjs";import"../../../primitives/shared/constants.mjs";import"classnames";import{IconClose as t}from"../../../primitives/Icon/icons/IconClose.mjs";function r(r){var{className:s,dismissButtonLabel:o="Dismiss message",onClick:p,style:l}=r,a=i(r,["className","dismissButtonLabel","onClick","style"]);return e.createElement(m,Object.assign({ariaLabel:o,className:s,onClick:p,style:l,variation:"link"},a),e.createElement(t,{"aria-hidden":"true",size:"1.5rem"}))}export{r as CloseIconButton};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"react";import s from"classnames";import{useBreakpointValue as o}from"../../../hooks/useBreakpointValue.mjs";import{Flex as r}from"../../../primitives/Flex/Flex.mjs";import"tslib";import"../../../primitives/View/View.mjs";import{withBackdrop as t}from"../Backdrop/withBackdrop.mjs";import"../hooks/useMessageImage/useMessageImage.mjs";import m from"../hooks/useMessageProps/useMessageProps.mjs";import{MessageLayout as a}from"../MessageLayout/MessageLayout.mjs";import{BLOCK_CLASS as i}from"./constants.mjs";function l(l){const n=m(l),p=o([!0,!0,!1]),{shouldRenderMessage:c,styles:u}=n,{onClose:g}=l;if(!c)return null;const f=()=>e.createElement(r,{className:s(i,{[`${i}--fullscreen`]:p}),role:"dialog",testId:"inappmessaging-fullscreen-dialog"},e.createElement(a,Object.assign({},l,n,{styles:u})));if(p)return e.createElement(f,null);const j=t(f,{onClick:g});return e.createElement(j,null)}export{l as FullScreenMessage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e="amplify-inappmessaging-fullscreenmessage";export{e as BLOCK_CLASS};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"react";import{useMessage as s,handleMessageAction as a}from"@aws-amplify/ui-react-core-notifications";import{ThemeProvider as o}from"../../ThemeProvider/index.mjs";import{BannerMessage as n}from"../BannerMessage/BannerMessage.mjs";import{FullScreenMessage as r}from"../FullScreenMessage/FullScreenMessage.mjs";import{ModalMessage as t}from"../ModalMessage/ModalMessage.mjs";import i from"./handleMessageLinkAction.mjs";import{useDeprecationWarning as m}from"../../../hooks/useDeprecationWarning.mjs";function l(e){return null}const c={BannerMessage:n,CarouselMessage:l,FullScreenMessage:r,ModalMessage:t},g=({action:e,url:s})=>{a({action:e,url:s,handleMessageLinkAction:i})};function p({components:a}){m({shouldWarn:!0,message:"The `InAppMessageDisplay` component has been migrated to `@aws-amplify/ui-react-notifications` and will be removed from this package in a future major release. Please install `@aws-amplify/ui-react-notifications` and update the import path."});const n=e.useMemo((()=>Object.assign(Object.assign({},c),a)),[a]),{Component:r,props:t}=s({components:n,onMessageAction:g});return e.createElement(o,{colorMode:"light"},e.createElement(r,Object.assign({},t)))}p.BannerMessage=n,p.CarouselMessage=l,p.FullScreenMessage=r,p.ModalMessage=t;export{p as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ConsoleLogger as o}from"@aws-amplify/core";const t=new o("Notifications.InAppMessaging"),r=o=>{let r;try{r=new URL(o)}catch(r){return void t.warn(`Unsupported url provided: ${o}`)}const{protocol:p}=r;"http:"===p||"https:"===p?window.open(o):t.warn(`Unsupported url protocol provided: ${p}`)};export{r as default};
|
package/dist/esm/components/InAppMessaging/InAppMessagingProvider/InAppMessagingProvider.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"react";import{InAppMessagingProvider as a}from"@aws-amplify/ui-react-core-notifications";import{useDeprecationWarning as i}from"../../../hooks/useDeprecationWarning.mjs";function t(t){return i({shouldWarn:!0,message:"The `InAppMessagingProvider` component has been migrated to `@aws-amplify/ui-react-notifications` and will be removed from this package in a future major release. Please install `@aws-amplify/ui-react-notifications` and update the import path."}),e.createElement(a,Object.assign({},t))}export{t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as i from"react";import e from"classnames";import{isEmpty as t}from"@aws-amplify/ui";import"../../../primitives/Alert/Alert.mjs";import"../../../primitives/Autocomplete/Autocomplete.mjs";import"../../../primitives/Badge/Badge.mjs";import{Button as m}from"../../../primitives/Button/Button.mjs";import{ButtonGroup as r}from"../../../primitives/ButtonGroup/ButtonGroup.mjs";import"../../../primitives/Card/Card.mjs";import"../../../primitives/CheckboxField/CheckboxField.mjs";import"../../../primitives/Collection/Collection.mjs";import"../../../primitives/Divider/Divider.mjs";import"../../../primitives/Expander/Expander.mjs";import"../../../primitives/Expander/ExpanderItem.mjs";import"../../../primitives/FieldGroupIcon/FieldGroupIcon.mjs";import"../../../primitives/FieldGroupIcon/FieldGroupIconButton.mjs";import{Flex as o}from"../../../primitives/Flex/Flex.mjs";import"../../../primitives/Grid/Grid.mjs";import{Heading as s}from"../../../primitives/Heading/Heading.mjs";import"../../../primitives/HighlightMatch/HighlightMatch.mjs";import"../../../primitives/Icon/Icon.mjs";import{Image as p}from"../../../primitives/Image/Image.mjs";import"../../../primitives/Link/Link.mjs";import"../../../primitives/Loader/Loader.mjs";import"../../../primitives/Menu/Menu.mjs";import"../../../primitives/Menu/MenuButton.mjs";import"../../../primitives/Menu/MenuItem.mjs";import"../../../primitives/Pagination/Pagination.mjs";import"../../../primitives/PasswordField/PasswordField.mjs";import"../../../primitives/PhoneNumberField/PhoneNumberField.mjs";import"../../../primitives/Placeholder/Placeholder.mjs";import"../../../primitives/Radio/Radio.mjs";import"../../../primitives/RadioGroupField/RadioGroupField.mjs";import"../../../primitives/Rating/Rating.mjs";import"../../../primitives/ScrollView/ScrollView.mjs";import"../../../primitives/SearchField/SearchField.mjs";import"../../../primitives/SelectField/SelectField.mjs";import"../../../primitives/SliderField/SliderField.mjs";import"../../../primitives/StepperField/StepperField.mjs";import"../../../primitives/SwitchField/SwitchField.mjs";import"../../../primitives/Table/Table.mjs";import"../../../primitives/Table/TableBody.mjs";import"../../../primitives/Table/TableCell.mjs";import"../../../primitives/Table/TableFoot.mjs";import"../../../primitives/Table/TableHead.mjs";import"../../../primitives/Table/TableRow.mjs";import"../../../primitives/Tabs/Tabs.mjs";import{Text as l}from"../../../primitives/Text/Text.mjs";import"../../../primitives/TextAreaField/TextAreaField.mjs";import"../../../primitives/TextField/TextField.mjs";import"../../../primitives/ToggleButton/ToggleButton.mjs";import"../../../primitives/ToggleButtonGroup/ToggleButtonGroup.mjs";import"../../../primitives/View/View.mjs";import"../../../primitives/VisuallyHidden/VisuallyHidden.mjs";import"../../../primitives/shared/constants.mjs";import{CloseIconButton as a}from"../CloseIconButton/CloseIconButton.mjs";import{CLOSE_BUTTON_CLASS as n,BLOCK_CLASS as d,MESSAGE_LAYOUT_TEST_ID as c,CONTENT_CLASS as v,CONTENT_TEST_ID as j,IMAGE_CONTAINER_CLASS as u,IMAGE_CONTAINER_TEST_ID as F,TEXT_CONTAINER_CLASS as g,TEXT_CONTAINER_TEST_ID as y,HEADER_CLASS as T,HEADER_TEXT_TEST_ID as b,BODY_TEXT_TEST_ID as B,BUTTON_GROUP_TEST_ID as I,BUTTON_CLASS as h,SECONDARY_BUTTON_TEST_ID as f,PRIMARY_BUTTON_TEST_ID as x}from"./constants.mjs";import{getButtonModifier as E}from"./utils.mjs";const C=i=>!t(i);function S({body:t,buttonSize:S,hasRenderableImage:G,header:w,image:M,onClose:N,orientation:$="vertical",primaryButton:A,secondaryButton:P,styles:R}){const k=i.useMemo((()=>({primary:E(R.primaryButton),secondary:E(R.secondaryButton)})),[R]),H="horizontal"===$,V=i.createElement(a,{className:n,onClick:N,style:R.closeIconButton}),L=C(A),z=C(P),D=L||z;return i.createElement(o,{className:d,"data-testid":c,style:R.container},!H&&i.createElement(o,{justifyContent:"flex-end"},V),i.createElement(o,{className:e(v,`${v}--${$}`),"data-testid":j},G&&i.createElement(o,{className:e(u,`${u}--${$}`),"data-testid":F},i.createElement(p,{alt:"In-App Message Image",src:null==M?void 0:M.src,style:R.image})),i.createElement(o,{className:e(g,`${g}--${$}`),"data-testid":y},(null==w?void 0:w.content)&&i.createElement(s,{className:T,isTruncated:!0,level:2,style:R.header,testId:b},w.content),(null==t?void 0:t.content)&&i.createElement(l,{style:R.body,testId:B},t.content)),H&&i.createElement(o,{alignItems:"flex-start"},V)),D&&i.createElement(r,{size:S,testId:I},z&&i.createElement(m,{className:e(h,`${h}--${k.secondary}`),onClick:P.onAction,style:R.secondaryButton,testId:f},P.title),L&&i.createElement(m,{className:e(h,`${h}--${k.primary}`),onClick:A.onAction,style:R.primaryButton,testId:x},A.title)))}export{S as MessageLayout};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const a="amplify-inappmessaging-messagelayout",e=`${a}__button`,s=`${a}__close-button`,n=`${a}__content`,t=`${a}__header`,g=`${a}__image-container`,i=`${a}__text-container`,o="inappmessaging-messagelayout-bodytext",m="inappmessaging-messagelayout-buttongroup",p="inappmessaging-messagelayout-content",u="inappmessaging-messagelayout-headertext",y="inappmessaging-messagelayout-imagecontainer",l="inappmessaging-messagelayout",_="inappmessaging-messagelayout-primarybutton",r="inappmessaging-messagelayout-secondarybutton",c="inappmessaging-messagelayout-textcontainer";export{a as BLOCK_CLASS,o as BODY_TEXT_TEST_ID,e as BUTTON_CLASS,m as BUTTON_GROUP_TEST_ID,s as CLOSE_BUTTON_CLASS,n as CONTENT_CLASS,p as CONTENT_TEST_ID,t as HEADER_CLASS,u as HEADER_TEXT_TEST_ID,g as IMAGE_CONTAINER_CLASS,y as IMAGE_CONTAINER_TEST_ID,l as MESSAGE_LAYOUT_TEST_ID,_ as PRIMARY_BUTTON_TEST_ID,r as SECONDARY_BUTTON_TEST_ID,i as TEXT_CONTAINER_CLASS,c as TEXT_CONTAINER_TEST_ID};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import r from"tinycolor2";const o=(o,t="light")=>{const{backgroundColor:n}=null!=o?o:{};if(!n)return t;return r(n).isDark()?"dark":"light"};export{o as getButtonModifier};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"react";import s from"classnames";import{useBreakpointValue as o}from"../../../hooks/useBreakpointValue.mjs";import{Flex as m}from"../../../primitives/Flex/Flex.mjs";import"../hooks/useMessageImage/useMessageImage.mjs";import a from"../hooks/useMessageProps/useMessageProps.mjs";import{MessageLayout as t}from"../MessageLayout/MessageLayout.mjs";import{BLOCK_CLASS as r,DIALOG_CLASS as l}from"./constants.mjs";function i(i){const n=a(i),p=o([!0,!0,!1]),{shouldRenderMessage:g,styles:u}=n;return g?e.createElement(m,{className:r},e.createElement(m,{className:s(l,{[`${l}--full-width`]:p}),role:"dialog",testId:"inappmessaging-modal-dialog"},e.createElement(t,Object.assign({},i,n,{styles:u})))):null}export{i as ModalMessage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const a="amplify-inappmessaging-modalmessage",s=`${a}__dialog`;export{a as BLOCK_CLASS,s as DIALOG_CLASS};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e;!function(e){e.Aborted="ABORTED",e.Failure="FAILURE",e.Fetching="FETCHING",e.Success="SUCCESS"}(e||(e={}));export{e as ImagePrefetchStatus};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useState as e,useEffect as r}from"react";import{ConsoleLogger as o}from"@aws-amplify/core";import{ImagePrefetchStatus as t}from"./types.mjs";const a=new o("Notifications.InAppMessaging");function n(o){const{src:n}=null!=o?o:{},s=!!n,[c,i]=e(s?t.Fetching:null),m=c===t.Fetching,l=c===t.Success;return r((()=>{if(!s)return;const e=new Image;e.onload=()=>{i(t.Success)},e.onabort=()=>{a.error(`Image load aborted: ${n}`),i(t.Aborted)},e.onerror=()=>{a.error(`Image failed to load: ${n}`),i(t.Failure)},e.src=n}),[s,n]),{hasRenderableImage:l,isImageFetching:m}}export{n as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useRef as e,useEffect as s,useMemo as a}from"react";import r from"../useMessageImage/useMessageImage.mjs";import{getMessageStyles as t,getPayloadStyle as m}from"./utils.mjs";function l(l){const{image:o,onDisplay:n}=l,g=e(!1),{hasRenderableImage:i,isImageFetching:u}=r(o),c=!u;s((()=>{!g.current&&c&&(null==n||n(),g.current=!0)}),[n,c]);const d=a((()=>t({styleParams:{payloadStyle:m(l),overrideStyle:l.style}})),[l]);return{hasRenderableImage:i,shouldRenderMessage:c,styles:d}}export{l as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const n=({body:n,container:o,header:l,primaryButton:t,secondaryButton:i})=>{var e,d,u,a,s;return{body:null!==(e=null==n?void 0:n.style)&&void 0!==e?e:{},container:null!==(d=null==o?void 0:o.style)&&void 0!==d?d:{},header:null!==(u=null==l?void 0:l.style)&&void 0!==u?u:{},primaryButton:null!==(a=null==t?void 0:t.style)&&void 0!==a?a:{},secondaryButton:null!==(s=null==i?void 0:i.style)&&void 0!==s?s:{}}};function o({styleParams:n}){var o,l;const{payloadStyle:t,overrideStyle:i}=n;return{body:Object.assign(Object.assign({},null==t?void 0:t.body),null==i?void 0:i.body),closeIconButton:null!==(o=null==i?void 0:i.closeIconButton)&&void 0!==o?o:{},container:Object.assign(Object.assign({},null==t?void 0:t.container),null==i?void 0:i.container),header:Object.assign(Object.assign({},null==t?void 0:t.header),null==i?void 0:i.header),image:null!==(l=null==i?void 0:i.image)&&void 0!==l?l:{},primaryButton:Object.assign(Object.assign({},null==t?void 0:t.primaryButton),null==i?void 0:i.primaryButton),secondaryButton:Object.assign(Object.assign({},null==t?void 0:t.secondaryButton),null==i?void 0:i.secondaryButton)}}export{o as getMessageStyles,n as getPayloadStyle};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useInAppMessaging as a}from"@aws-amplify/ui-react-core-notifications";import{useDeprecationWarning as e}from"../../../hooks/useDeprecationWarning.mjs";function i(){return e({shouldWarn:!0,message:"The `useInAppMessaging` component has been migrated to `@aws-amplify/ui-react-notifications` and will be removed from this package in a future major release. Please install `@aws-amplify/ui-react-notifications` and update the import path."}),a()}export{i as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"react";import{InAppMessagingProvider as t}from"@aws-amplify/ui-react-core-notifications";import r from"../InAppMessageDisplay/InAppMessageDisplay.mjs";function a(a,n){return function(i){return e.createElement(t,null,e.createElement(r,Object.assign({},n)),e.createElement(a,Object.assign({},i)))}}export{a as default};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { LocationSearchProps } from '../types/maplibre-gl-geocoder';
|
|
3
|
-
/**
|
|
4
|
-
* The `<LocationSearch>` component provides location search.
|
|
5
|
-
*
|
|
6
|
-
* [📖 Docs](https://ui.docs.amplify.aws/react/connected-components/geo#location-search)
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* // Used as a map control:
|
|
10
|
-
* function App() {
|
|
11
|
-
* return (
|
|
12
|
-
* <MapView>
|
|
13
|
-
* <LocationSearch />
|
|
14
|
-
* </MapView>
|
|
15
|
-
* );
|
|
16
|
-
* }
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* // Used as a standalone component:
|
|
20
|
-
* function App() {
|
|
21
|
-
* return <LocationSearch />;
|
|
22
|
-
* }
|
|
23
|
-
*/
|
|
24
|
-
export declare const LocationSearch: (props: LocationSearchProps) => JSX.Element;
|
|
25
|
-
export declare const Geocoder: (props: LocationSearchProps) => JSX.Element;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import maplibregl from 'maplibre-gl';
|
|
3
|
-
import type { MapProps, MapRef } from 'react-map-gl';
|
|
4
|
-
interface MapViewProps extends Omit<MapProps, 'mapLib' | 'transformRequest'> {
|
|
5
|
-
mapLib?: typeof maplibregl;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* The `MapView` component uses [react-map-gl](https://visgl.github.io/react-map-gl/) and
|
|
9
|
-
* [maplibre-gl-js](https://visgl.github.io/react-map-gl/) to provide an interactive map using
|
|
10
|
-
* [Amplify Geo APIs](https://docs.amplify.aws/lib/geo/getting-started/q/platform/js/) powered by
|
|
11
|
-
* [Amazon Location Service](https://aws.amazon.com/location/). Since `MapView` is a wrapper of the
|
|
12
|
-
* [react-map-gl default Map](https://visgl.github.io/react-map-gl/docs/api-reference/map/), it accepts the same
|
|
13
|
-
* properties except `transformRequest` which is set by Amplify.
|
|
14
|
-
*
|
|
15
|
-
* [📖 Docs](https://ui.docs.amplify.aws/react/connected-components/geo#mapview)
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* // Basic usage of MapView:
|
|
19
|
-
* function App() {
|
|
20
|
-
* return <MapView />
|
|
21
|
-
* }
|
|
22
|
-
*/
|
|
23
|
-
declare const MapView: React.ForwardRefExoticComponent<MapViewProps & React.RefAttributes<MapRef>>;
|
|
24
|
-
export { MapView };
|