@aws-amplify/ui-react 4.5.1 → 4.6.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-1dd46eaa.js +1 -0
- package/dist/esm/components/AccountSettings/ChangePassword/ChangePassword.mjs +1 -1
- package/dist/esm/components/AccountSettings/DeleteUser/DeleteUser.mjs +1 -1
- package/dist/esm/components/Geo/LocationSearch/index.mjs +1 -1
- package/dist/esm/components/Geo/MapView/index.mjs +1 -1
- package/dist/esm/components/InAppMessaging/Backdrop/Backdrop.mjs +1 -1
- package/dist/esm/hooks/actions/constants.mjs +1 -1
- package/dist/esm/hooks/actions/useNavigateAction.mjs +1 -1
- package/dist/esm/hooks/useThemeBreakpoint.mjs +1 -0
- package/dist/esm/internal.mjs +1 -1
- package/dist/esm/primitives/CheckboxField/CheckboxField.mjs +1 -1
- package/dist/esm/primitives/Expander/ExpanderItem.mjs +1 -1
- package/dist/esm/primitives/Field/Field.mjs +1 -0
- package/dist/esm/primitives/Field/FieldDescription.mjs +1 -1
- package/dist/esm/primitives/Loader/Loader.mjs +1 -1
- package/dist/esm/primitives/Menu/Menu.mjs +1 -1
- package/dist/esm/primitives/Menu/MenuItem.mjs +1 -1
- package/dist/esm/primitives/Pagination/PaginationItem.mjs +1 -1
- package/dist/esm/primitives/Pagination/useRange.mjs +1 -1
- package/dist/esm/primitives/RadioGroupField/RadioGroupField.mjs +1 -1
- package/dist/esm/primitives/SearchField/SearchField.mjs +1 -1
- package/dist/esm/primitives/SelectField/SelectField.mjs +1 -1
- package/dist/esm/primitives/SliderField/SliderField.mjs +1 -1
- package/dist/esm/primitives/StepperField/StepperField.mjs +1 -1
- package/dist/esm/primitives/SwitchField/SwitchField.mjs +1 -1
- package/dist/esm/primitives/TextAreaField/TextAreaField.mjs +1 -1
- package/dist/esm/primitives/TextField/TextField.mjs +1 -1
- package/dist/esm/primitives/utils/useStableId.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 +403 -2
- package/dist/types/components/AccountSettings/DeleteUser/types.d.ts +2 -2
- package/dist/types/components/AccountSettings/types.d.ts +13 -13
- package/dist/types/components/Authenticator/Authenticator.d.ts +2 -2
- package/dist/types/components/Authenticator/RouteContainer/types.d.ts +2 -2
- package/dist/types/components/Authenticator/Router/types.d.ts +1 -1
- package/dist/types/components/Authenticator/withAuthenticator.d.ts +1 -1
- package/dist/types/components/Geo/types/maplibre-gl-geocoder.d.ts +1 -1
- package/dist/types/components/InAppMessaging/BannerMessage/types.d.ts +1 -1
- package/dist/types/components/InAppMessaging/InAppMessageDisplay/types.d.ts +4 -4
- package/dist/types/components/InAppMessaging/MessageLayout/types.d.ts +2 -2
- package/dist/types/components/InAppMessaging/hooks/useMessageImage/types.d.ts +1 -1
- package/dist/types/components/InAppMessaging/hooks/useMessageProps/types.d.ts +1 -1
- package/dist/types/components/Storage/FileUploader/types.d.ts +7 -7
- package/dist/types/components/ThemeProvider/index.d.ts +2 -2
- package/dist/types/helpers/utils.d.ts +1 -1
- package/dist/types/hooks/actions/shared/types.d.ts +2 -2
- package/dist/types/hooks/actions/shared/useTypeCastFields.d.ts +1 -1
- package/dist/types/hooks/actions/testModels/model.d.ts +1 -1
- package/dist/types/hooks/actions/testModels/todo.d.ts +1 -1
- package/dist/types/hooks/actions/useNavigateAction.d.ts +1 -1
- package/dist/types/hooks/actions/useStateMutationAction.d.ts +1 -1
- package/dist/types/hooks/useComposeRefsCallback.d.ts +1 -1
- package/dist/types/hooks/useThemeBreakpoint.d.ts +2 -0
- package/dist/types/internal.d.ts +4 -1
- package/dist/types/primitives/Alert/AlertIcon.d.ts +3 -0
- package/dist/types/primitives/Field/Field.d.ts +6 -0
- package/dist/types/primitives/Field/index.d.ts +1 -0
- package/dist/types/primitives/Heading/Heading.d.ts +1 -1
- package/dist/types/primitives/Icon/icons/types.d.ts +1 -1
- package/dist/types/primitives/PhoneNumberField/CountryCodeSelect.d.ts +1 -1
- package/dist/types/primitives/Rating/Rating.d.ts +1 -1
- package/dist/types/primitives/SearchField/useSearchField.d.ts +4 -4
- package/dist/types/primitives/Select/Select.d.ts +1 -1
- package/dist/types/primitives/SelectField/SelectField.d.ts +1 -1
- package/dist/types/primitives/StepperField/useStepper.d.ts +5 -5
- package/dist/types/primitives/SwitchField/useSwitch.d.ts +1 -1
- package/dist/types/primitives/ToggleButton/useToggleButton.d.ts +2 -2
- package/dist/types/primitives/ToggleButtonGroup/useToggleButtonGroup.d.ts +1 -1
- package/dist/types/primitives/View/View.d.ts +2 -2
- package/dist/types/primitives/shared/responsive/utils.d.ts +1 -1
- package/dist/types/primitives/shared/types.d.ts +4 -4
- package/dist/types/primitives/types/alert.d.ts +1 -1
- package/dist/types/primitives/types/autocomplete.d.ts +1 -1
- package/dist/types/primitives/types/badge.d.ts +2 -2
- package/dist/types/primitives/types/base.d.ts +1 -1
- package/dist/types/primitives/types/button.d.ts +3 -3
- package/dist/types/primitives/types/card.d.ts +1 -1
- package/dist/types/primitives/types/collection.d.ts +4 -4
- package/dist/types/primitives/types/datastore.d.ts +7 -7
- package/dist/types/primitives/types/divider.d.ts +2 -2
- package/dist/types/primitives/types/expander.d.ts +1 -1
- package/dist/types/primitives/types/field.d.ts +2 -2
- package/dist/types/primitives/types/fieldGroup.d.ts +1 -1
- package/dist/types/primitives/types/grid.d.ts +1 -1
- package/dist/types/primitives/types/heading.d.ts +1 -1
- package/dist/types/primitives/types/icon.d.ts +2 -2
- package/dist/types/primitives/types/input.d.ts +3 -3
- package/dist/types/primitives/types/loader.d.ts +2 -2
- package/dist/types/primitives/types/pagination.d.ts +3 -3
- package/dist/types/primitives/types/passwordField.d.ts +1 -1
- package/dist/types/primitives/types/phoneNumberField.d.ts +1 -1
- package/dist/types/primitives/types/placeholder.d.ts +1 -1
- package/dist/types/primitives/types/rating.d.ts +1 -1
- package/dist/types/primitives/types/responsive.d.ts +3 -3
- package/dist/types/primitives/types/scrollView.d.ts +1 -1
- package/dist/types/primitives/types/select.d.ts +1 -1
- package/dist/types/primitives/types/sliderField.d.ts +2 -2
- package/dist/types/primitives/types/style.d.ts +5 -5
- package/dist/types/primitives/types/table.d.ts +3 -3
- package/dist/types/primitives/types/tabs.d.ts +1 -1
- package/dist/types/primitives/types/text.d.ts +1 -1
- package/dist/types/primitives/types/theme.d.ts +29 -29
- package/dist/types/primitives/types/view.d.ts +8 -8
- package/dist/types/primitives/utils/useStableId.d.ts +1 -1
- package/dist/types/studio/types.d.ts +3 -3
- package/dist/types/types/catalog.d.ts +5 -5
- package/dist/types/version.d.ts +1 -1
- package/package.json +5 -5
- package/dist/constants-4b28bdd3.js +0 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { Sizes } from './base';
|
|
3
3
|
import { ViewProps } from './view';
|
|
4
4
|
import { FlexContainerStyleProps } from './flex';
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
5
|
+
export type ButtonSizes = Sizes;
|
|
6
|
+
export type ButtonTypes = 'button' | 'reset' | 'submit';
|
|
7
|
+
export type ButtonVariations = 'primary' | 'link' | 'menu' | 'warning' | 'destructive';
|
|
8
8
|
export interface ButtonProps extends ViewProps, FlexContainerStyleProps {
|
|
9
9
|
/**
|
|
10
10
|
* @description
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { FlexProps } from './flex';
|
|
3
3
|
import { GridProps } from './grid';
|
|
4
4
|
import { BaseStyleProps } from './style';
|
|
5
|
-
export
|
|
5
|
+
export type CollectionType = 'list' | 'grid' | 'table';
|
|
6
6
|
export interface CollectionWrapperProps extends BaseStyleProps {
|
|
7
7
|
/**
|
|
8
8
|
* @description
|
|
@@ -62,9 +62,9 @@ export interface CollectionBaseProps<Item> {
|
|
|
62
62
|
*/
|
|
63
63
|
children: (item: Item, index: number) => JSX.Element;
|
|
64
64
|
}
|
|
65
|
-
export
|
|
66
|
-
export
|
|
67
|
-
export
|
|
65
|
+
export type ListCollectionProps<Item> = FlexProps & CollectionBaseProps<Item>;
|
|
66
|
+
export type GridCollectionProps<Item> = GridProps & CollectionBaseProps<Item>;
|
|
67
|
+
export type CollectionProps<Item> = CollectionWrapperProps & (({
|
|
68
68
|
type: 'list';
|
|
69
69
|
} & ListCollectionProps<Item>) | ({
|
|
70
70
|
type: 'grid';
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { IdentifierFieldOrIdentifierObject, PersistentModel, PersistentModelConstructor, PersistentModelMetaData, ProducerPaginationInput, RecursiveModelPredicateExtender } from '@aws-amplify/datastore';
|
|
2
|
-
export
|
|
2
|
+
export type DataStoreItemProps<Model extends PersistentModel> = {
|
|
3
3
|
model: PersistentModelConstructor<Model>;
|
|
4
4
|
id: IdentifierFieldOrIdentifierObject<Model, PersistentModelMetaData<Model>>;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export type DataStoreCollectionProps<Model extends PersistentModel> = {
|
|
7
7
|
model: PersistentModelConstructor<Model>;
|
|
8
8
|
criteria?: RecursiveModelPredicateExtender<Model>;
|
|
9
9
|
pagination?: ProducerPaginationInput<Model>;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
type DataStoreBaseResult = {
|
|
12
12
|
error?: Error;
|
|
13
13
|
isLoading: boolean;
|
|
14
14
|
};
|
|
15
|
-
export
|
|
15
|
+
export type DataStoreItemResult<Model extends PersistentModel> = DataStoreBaseResult & {
|
|
16
16
|
item?: Model;
|
|
17
17
|
};
|
|
18
|
-
export
|
|
18
|
+
export type DataStoreCollectionResult<Model extends PersistentModel> = DataStoreBaseResult & {
|
|
19
19
|
items: Model[];
|
|
20
20
|
};
|
|
21
|
-
export
|
|
21
|
+
export type DataStoreBindingProps<Model extends PersistentModel, BindingType extends 'record' | 'collection'> = {
|
|
22
22
|
type: BindingType;
|
|
23
23
|
} & (BindingType extends 'record' ? DataStoreItemProps<Model> : BindingType extends 'collection' ? DataStoreCollectionProps<Model> : never);
|
|
24
|
-
export
|
|
24
|
+
export type DataStorePredicateObject = {
|
|
25
25
|
and?: DataStorePredicateObject[];
|
|
26
26
|
or?: DataStorePredicateObject[];
|
|
27
27
|
field?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Sizes } from './base';
|
|
2
2
|
import { ViewProps } from './view';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type DividerOrientations = 'horizontal' | 'vertical';
|
|
4
|
+
export type DividerSizes = Sizes;
|
|
5
5
|
export interface DividerOptions {
|
|
6
6
|
/**
|
|
7
7
|
* @description
|
|
@@ -42,5 +42,5 @@ export interface FieldDescriptionProps extends TextProps, Pick<FieldProps, 'desc
|
|
|
42
42
|
}
|
|
43
43
|
export interface FieldErrorMessageProps extends TextProps, Pick<FieldProps, 'errorMessage'>, Pick<InputProps, 'hasError'> {
|
|
44
44
|
}
|
|
45
|
-
export
|
|
46
|
-
export
|
|
45
|
+
export type FieldVariations = 'quiet';
|
|
46
|
+
export type LabelPositions = 'start' | 'end' | 'top' | 'bottom';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FlexProps } from './flex';
|
|
3
3
|
import { FieldVariations } from './field';
|
|
4
|
-
export
|
|
4
|
+
export type FieldGroupOrientation = 'horizontal' | 'vertical';
|
|
5
5
|
export interface FieldGroupOptions extends FlexProps {
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
orientation?: FieldGroupOrientation;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Property } from 'csstype';
|
|
2
2
|
import { ResponsiveStyle, CSSLayoutStyleProps } from './style';
|
|
3
3
|
import { ViewProps } from './view';
|
|
4
|
-
export
|
|
4
|
+
export type GridSpanType = number | string | 'auto';
|
|
5
5
|
export interface GridContainerStyleProps extends CSSLayoutStyleProps {
|
|
6
6
|
/**
|
|
7
7
|
* @description
|
|
@@ -2,13 +2,13 @@ import { Property } from 'csstype';
|
|
|
2
2
|
import { ViewProps } from './view';
|
|
3
3
|
import { Sizes } from './base';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
export
|
|
5
|
+
export type ViewBox = {
|
|
6
6
|
minX?: number;
|
|
7
7
|
minY?: number;
|
|
8
8
|
width?: number;
|
|
9
9
|
height?: number;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type IconSize = Sizes;
|
|
12
12
|
export interface IconProps extends ViewProps {
|
|
13
13
|
/**
|
|
14
14
|
* @description
|
|
@@ -2,9 +2,9 @@ import * as React from 'react';
|
|
|
2
2
|
import { Sizes } from './base';
|
|
3
3
|
import { FieldVariations } from './field';
|
|
4
4
|
import { ViewProps } from './view';
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
5
|
+
export type EnterKeyHint = 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
|
|
6
|
+
export type InputMode = 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
|
|
7
|
+
export type InputSizes = Sizes;
|
|
8
8
|
export interface InputProps extends ViewProps {
|
|
9
9
|
/**
|
|
10
10
|
* @description
|
|
@@ -2,8 +2,8 @@ import { Property } from 'csstype';
|
|
|
2
2
|
import { ViewProps } from '../types/view';
|
|
3
3
|
import { Sizes } from './base';
|
|
4
4
|
import { StyleToken } from './style';
|
|
5
|
-
export
|
|
6
|
-
export
|
|
5
|
+
export type LoaderSizes = Sizes;
|
|
6
|
+
export type LoaderVariations = 'linear';
|
|
7
7
|
export interface LoaderProps extends ViewProps {
|
|
8
8
|
/**
|
|
9
9
|
* @description
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BaseComponentProps, AriaProps } from './base';
|
|
2
2
|
import { BaseStyleProps } from './style';
|
|
3
3
|
import { ViewProps } from './view';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
4
|
+
export type PaginationItemType = 'page' | 'next' | 'previous' | 'ellipsis';
|
|
5
|
+
export type PaginationCallbackType = 'onNext' | 'onPrevious' | 'onChange';
|
|
6
|
+
export type PaginationLabelType = 'pageLabel' | 'currentPageLabel' | 'previousLabel' | 'nextLabel';
|
|
7
7
|
interface BasePaginationProps {
|
|
8
8
|
/**
|
|
9
9
|
* @description
|
|
@@ -51,7 +51,7 @@ export interface PasswordFieldProps extends TextFieldProps {
|
|
|
51
51
|
*/
|
|
52
52
|
showPasswordButtonRef?: React.Ref<HTMLButtonElement>;
|
|
53
53
|
}
|
|
54
|
-
export
|
|
54
|
+
export type PasswordFieldType = 'password' | 'text';
|
|
55
55
|
export interface ShowPasswordButtonProps extends ButtonProps {
|
|
56
56
|
/**
|
|
57
57
|
* @description
|
|
@@ -91,7 +91,7 @@ interface DialCodeRequired extends optionalPhoneNumberFieldProps {
|
|
|
91
91
|
*/
|
|
92
92
|
defaultDialCode: string;
|
|
93
93
|
}
|
|
94
|
-
export
|
|
94
|
+
export type PhoneNumberFieldProps = CountryCodeRequired | DialCodeRequired;
|
|
95
95
|
export interface DialCodeSelectProps extends SelectFieldProps {
|
|
96
96
|
defaultValue?: string;
|
|
97
97
|
dialCodeList?: Array<string>;
|
|
@@ -3,7 +3,7 @@ import { Property } from 'csstype';
|
|
|
3
3
|
import { FlexProps } from './flex';
|
|
4
4
|
import { Sizes } from './base';
|
|
5
5
|
import { StyleToken } from './style';
|
|
6
|
-
export
|
|
6
|
+
export type RatingSizes = Sizes;
|
|
7
7
|
export interface RatingOptions {
|
|
8
8
|
/**
|
|
9
9
|
* @description
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WebTheme } from '@aws-amplify/ui';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
2
|
+
export type Breakpoints = WebTheme['breakpoints']['values'];
|
|
3
|
+
export type Breakpoint = keyof WebTheme['breakpoints']['values'];
|
|
4
|
+
export type ValueBreakpoints<Value = unknown> = Partial<Record<Breakpoint, Value>>;
|
|
5
5
|
export interface MediaQueryBreakpoint {
|
|
6
6
|
breakpoint: Breakpoint;
|
|
7
7
|
query: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ViewProps } from './view';
|
|
2
|
-
|
|
2
|
+
type ScrollViewOrientation = 'horizontal' | 'vertical';
|
|
3
3
|
export interface ScrollViewProps extends ViewProps {
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated This prop has been deprecated. To get horizontal or vertical scrollbars,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ViewProps } from './view';
|
|
3
3
|
import { Sizes } from './base';
|
|
4
|
-
export
|
|
4
|
+
export type SelectVariation = 'quiet';
|
|
5
5
|
export interface SelectProps extends ViewProps {
|
|
6
6
|
/**
|
|
7
7
|
* @description
|
|
@@ -3,8 +3,8 @@ import React from 'react';
|
|
|
3
3
|
import { StyleToken } from './style';
|
|
4
4
|
import { TextFieldProps } from './textField';
|
|
5
5
|
import { ViewProps } from './view';
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
type SliderOrientation = 'horizontal' | 'vertical';
|
|
7
|
+
type Direction = 'ltr' | 'rtl';
|
|
8
8
|
export interface SliderFieldProps extends TextFieldProps, ViewProps {
|
|
9
9
|
/**
|
|
10
10
|
* @description
|
|
@@ -10,7 +10,7 @@ import { TextAreaStyleProps } from './textArea';
|
|
|
10
10
|
* @description
|
|
11
11
|
* Extract style compatible types (string literal | number | any string)
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export type StyleProp<PropertyType> = (PropertyType extends number ? number : PropertyType extends string | WebDesignToken ? PropertyType : never) | (string & {});
|
|
14
14
|
export interface ResponsiveObject<PropertyType> {
|
|
15
15
|
base?: PropertyType;
|
|
16
16
|
small?: PropertyType;
|
|
@@ -24,8 +24,8 @@ export interface ResponsiveObject<PropertyType> {
|
|
|
24
24
|
* Allows a style prop to be the property type
|
|
25
25
|
* or a design token of that property type.
|
|
26
26
|
*/
|
|
27
|
-
export
|
|
28
|
-
export
|
|
27
|
+
export type StyleToken<PropertyType> = PropertyType | WebDesignToken<PropertyType>;
|
|
28
|
+
export type ResponsiveStyle<PropertyType> = StyleProp<PropertyType> | StyleProp<PropertyType>[] | ResponsiveObject<StyleProp<PropertyType>>;
|
|
29
29
|
export interface BaseStyleProps extends FlexItemStyleProps, GridItemStyleProps {
|
|
30
30
|
/**
|
|
31
31
|
* @description
|
|
@@ -490,8 +490,8 @@ export interface CSSLayoutStyleProps {
|
|
|
490
490
|
}
|
|
491
491
|
export interface AllStyleProps extends BaseStyleProps, ImageStyleProps, FlexContainerStyleProps, GridContainerStyleProps, TextAreaStyleProps {
|
|
492
492
|
}
|
|
493
|
-
export
|
|
494
|
-
export
|
|
493
|
+
export type AllStylePropKey = keyof AllStyleProps;
|
|
494
|
+
export type ComponentPropToStyleProp = Required<{
|
|
495
495
|
[key in AllStylePropKey]: keyof React.CSSProperties;
|
|
496
496
|
}>;
|
|
497
497
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Sizes } from './base';
|
|
3
3
|
import { ViewProps } from './view';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type TableSize = Sizes;
|
|
5
|
+
export type TableVariation = 'bordered' | 'striped';
|
|
6
6
|
export interface TableProps extends ViewProps {
|
|
7
7
|
/**
|
|
8
8
|
* @description
|
|
@@ -28,7 +28,7 @@ export interface TableProps extends ViewProps {
|
|
|
28
28
|
}
|
|
29
29
|
export interface TableBodyProps extends ViewProps {
|
|
30
30
|
}
|
|
31
|
-
export
|
|
31
|
+
export type TableCellElement = 'td' | 'th';
|
|
32
32
|
export interface TableCellProps extends ViewProps {
|
|
33
33
|
as?: TableCellElement;
|
|
34
34
|
/**
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { BaseComponentProps } from './base';
|
|
3
3
|
import { BaseStyleProps } from './style';
|
|
4
4
|
import { FlexProps } from './flex';
|
|
5
|
-
export
|
|
5
|
+
export type TabsSpacing = 'equal' | 'relative';
|
|
6
6
|
export interface TabsProps extends FlexProps {
|
|
7
7
|
/**
|
|
8
8
|
* @description
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ViewProps } from './view';
|
|
2
|
-
export
|
|
2
|
+
export type TextVariation = 'primary' | 'secondary' | 'tertiary' | 'error' | 'warning' | 'info' | 'success';
|
|
3
3
|
export interface TextProps extends ViewProps {
|
|
4
4
|
/**
|
|
5
5
|
* @description
|
|
@@ -6,34 +6,34 @@ import type { FontSizes, FontWeights, LineHeights, Radii, Shadows, SpaceSizes }
|
|
|
6
6
|
* We still want to define them as keys here and convert them into CSS variable reference afterwards
|
|
7
7
|
* This will make the default dark mode override work, where we flip these two
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
export
|
|
30
|
-
export
|
|
31
|
-
export
|
|
32
|
-
export
|
|
33
|
-
export
|
|
34
|
-
export
|
|
35
|
-
export
|
|
9
|
+
type WhiteKey = 'white';
|
|
10
|
+
type BlackKey = 'black';
|
|
11
|
+
type RedKeys = 'red.10' | 'red.20' | 'red.40' | 'red.60' | 'red.80' | 'red.90' | 'red.100';
|
|
12
|
+
type OrangeKeys = 'orange.10' | 'orange.20' | 'orange.40' | 'orange.60' | 'orange.80' | 'orange.90' | 'orange.100';
|
|
13
|
+
type YellowKeys = 'yellow.10' | 'yellow.20' | 'yellow.40' | 'yellow.60' | 'yellow.80' | 'yellow.90' | 'yellow.100';
|
|
14
|
+
type GreenKeys = 'green.10' | 'green.20' | 'green.40' | 'green.60' | 'green.80' | 'green.90' | 'green.100';
|
|
15
|
+
type TealKeys = 'teal.10' | 'teal.20' | 'teal.40' | 'teal.60' | 'teal.80' | 'teal.90' | 'teal.100';
|
|
16
|
+
type BlueKeys = 'blue.10' | 'blue.20' | 'blue.40' | 'blue.60' | 'blue.80' | 'blue.90' | 'blue.100';
|
|
17
|
+
type PurpleKeys = 'purple.10' | 'purple.20' | 'purple.40' | 'purple.60' | 'purple.80' | 'purple.90' | 'purple.100';
|
|
18
|
+
type PinkKeys = 'pink.10' | 'pink.20' | 'pink.40' | 'pink.60' | 'pink.80' | 'pink.90' | 'pink.100';
|
|
19
|
+
type NeutralKeys = 'neutral.10' | 'neutral.20' | 'neutral.40' | 'neutral.60' | 'neutral.80' | 'neutral.90' | 'neutral.100';
|
|
20
|
+
type OverlayKeys = 'overlay.10' | 'overlay.20' | 'overlay.30' | 'overlay.40' | 'overlay.50' | 'overlay.60' | 'overlay.70' | 'overlay.80' | 'overlay.90';
|
|
21
|
+
type BrandColorKeys = 'brand.primary.10' | 'brand.primary.20' | 'brand.primary.40' | 'brand.primary.60' | 'brand.primary.80' | 'brand.primary.90' | 'brand.primary.100' | 'brand.secondary.10' | 'brand.secondary.20' | 'brand.secondary.40' | 'brand.secondary.60' | 'brand.secondary.80' | 'brand.secondary.90' | 'brand.secondary.100';
|
|
22
|
+
type FontColorKeys = 'font.primary' | 'font.secondary' | 'font.tertiary' | 'font.disabled' | 'font.inverse' | 'font.interactive' | 'font.hover' | 'font.focus' | 'font.active' | 'font.success' | 'font.info' | 'font.warning' | 'font.error';
|
|
23
|
+
type BackgroundColorKeys = 'background.primary' | 'background.secondary' | 'background.tertiary' | 'background.quaternary' | 'background.disabled' | 'background.success' | 'background.info' | 'background.warning' | 'background.error';
|
|
24
|
+
type BorderColorKeys = 'border.primary' | 'border.secondary' | 'border.tertiary' | 'border.disabled' | 'border.focus' | 'border.pressed' | 'border.error';
|
|
25
|
+
type ShadowColorKeys = 'shadow.primary' | 'shadow.secondary' | 'shadow.tertiary';
|
|
26
|
+
export type ColorKeys<PropertyType> = PropertyType | WhiteKey | BlackKey | RedKeys | OrangeKeys | YellowKeys | GreenKeys | TealKeys | BlueKeys | PurpleKeys | PinkKeys | NeutralKeys | OverlayKeys | BrandColorKeys | FontColorKeys | BackgroundColorKeys | BorderColorKeys | ShadowColorKeys;
|
|
27
|
+
export type BoxShadowKeys<PropertyType> = PropertyType | keyof Shadows;
|
|
28
|
+
export type FontSizeKeys<PropertyType> = PropertyType | keyof FontSizes;
|
|
29
|
+
export type FontWeightKeys<PropertyType> = PropertyType | keyof FontWeights;
|
|
30
|
+
export type FontFamilyKeys<PropertyType> = PropertyType | 'default.variable' | 'default.static';
|
|
31
|
+
export type LineHeightKeys<PropertyType> = PropertyType | keyof LineHeights;
|
|
32
|
+
export type OpacityKeys<PropertyType> = PropertyType | '0' | '10' | '20' | '30' | '40' | '50' | '60' | '70' | '80' | '90' | '100';
|
|
33
|
+
export type RadiiKeys<PropertyType> = PropertyType | keyof Radii;
|
|
34
|
+
export type SpaceKeys<PropertyType> = PropertyType | keyof SpaceSizes | 'zero' | 'relative.xxxs' | 'relative.xxs' | 'relative.xs' | 'relative.small' | 'relative.medium' | 'relative.large' | 'relative.xl' | 'relative.xxl' | 'relative.xxxl' | 'relative.full';
|
|
35
|
+
export type TransformKeys<PropertyType> = PropertyType | 'slideX.small' | 'slideX.medium' | 'slideX.large';
|
|
36
36
|
export declare const isThemeStylePropKey: (key: string) => key is ThemeStylePropKey;
|
|
37
|
-
export
|
|
38
|
-
export
|
|
37
|
+
export type ThemeStylePropKey = 'backgroundColor' | 'borderRadius' | 'bottom' | 'boxShadow' | 'color' | 'columnGap' | 'fontFamily' | 'fontSize' | 'fontWeight' | 'gap' | 'height' | 'left' | 'letterSpacing' | 'lineHeight' | 'margin' | 'marginBlock' | 'marginBlockEnd' | 'marginBlockStart' | 'marginBottom' | 'marginInline' | 'marginInlineEnd' | 'marginInlineStart' | 'marginLeft' | 'marginRight' | 'marginTop' | 'maxHeight' | 'maxWidth' | 'minHeight' | 'minWidth' | 'opacity' | 'padding' | 'paddingBlock' | 'paddingBlockEnd' | 'paddingBlockStart' | 'paddingInline' | 'paddingInlineEnd' | 'paddingInlineStart' | 'paddingLeft' | 'paddingRight' | 'paddingTop' | 'paddingBottom' | 'right' | 'rowGap' | 'top' | 'transform' | 'width';
|
|
38
|
+
export type ThemeTokenKey = 'components' | 'borderWidths' | 'colors' | 'fonts' | 'fontSizes' | 'fontWeights' | 'lineHeights' | 'opacities' | 'outlineOffsets' | 'outlineWidths' | 'radii' | 'shadows' | 'space' | 'time' | 'transforms';
|
|
39
39
|
export {};
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AriaProps, BaseComponentProps } from './base';
|
|
3
3
|
import { BaseStyleProps } from './style';
|
|
4
|
-
|
|
5
|
-
export
|
|
4
|
+
type MergeProps<A, B> = A & Omit<B, keyof A>;
|
|
5
|
+
export type ElementType = React.FC<any> | keyof JSX.IntrinsicElements;
|
|
6
6
|
/**
|
|
7
7
|
* @description
|
|
8
8
|
* Convert string element type to DOMElement Type
|
|
9
9
|
* e.g. 'button' => HTMLButtonElement
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export type HTMLElementType<Element extends ElementType> = Element extends keyof JSX.IntrinsicElements ? React.ElementRef<Element> : HTMLElementTypeFromExoticComponentRef<Element>;
|
|
12
12
|
/**
|
|
13
13
|
* @description
|
|
14
14
|
* Allows us to extract ElementType from `typeof Root` used in SliderField
|
|
15
15
|
* e.g. React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<HTMLSpanElement>> => HTMLSpanElement
|
|
16
16
|
*/
|
|
17
|
-
|
|
18
|
-
export
|
|
19
|
-
export
|
|
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'> & {
|
|
20
20
|
/**
|
|
21
21
|
* @description
|
|
22
22
|
* Changes the type of HTML element rendered
|
|
23
23
|
*/
|
|
24
24
|
as?: Element | Props['as'];
|
|
25
25
|
}, Omit<ElementProps<Element>, 'ref'>>;
|
|
26
|
-
export
|
|
26
|
+
export type PrimitivePropsWithRef<Props extends ViewProps, Element extends ElementType> = PrimitiveProps<Props, Element> & {
|
|
27
27
|
/**
|
|
28
28
|
* @description
|
|
29
29
|
* References a DOM element from within a parent component
|
|
30
30
|
*/
|
|
31
31
|
ref?: React.Ref<HTMLElementType<Element>>;
|
|
32
32
|
};
|
|
33
|
-
export
|
|
33
|
+
export type Primitive<Props extends ViewProps, Element extends ElementType> = React.ForwardRefRenderFunction<HTMLElementType<Element>, PrimitivePropsWithRef<Props, Element>>;
|
|
34
34
|
export interface ViewProps extends BaseComponentProps, BaseStyleProps, AriaProps {
|
|
35
35
|
/**
|
|
36
36
|
* @description
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
* When considering making changing to this file, please consult
|
|
7
7
|
* a member from the Studio UI Builder team.
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export type EscapeHatchProps = {
|
|
10
10
|
[elementHierarchy: string]: Record<string, unknown>;
|
|
11
11
|
} | null;
|
|
12
|
-
export
|
|
12
|
+
export type VariantValues = {
|
|
13
13
|
[key: string]: string;
|
|
14
14
|
};
|
|
15
|
-
export
|
|
15
|
+
export type Variant = {
|
|
16
16
|
variantValues: VariantValues;
|
|
17
17
|
overrides: EscapeHatchProps;
|
|
18
18
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type PrimitiveCatalogComponentPropertyType = 'boolean' | 'string' | 'number';
|
|
2
|
+
export type PrimitiveCatalogComponentProperty = {
|
|
3
3
|
type: PrimitiveCatalogComponentPropertyType;
|
|
4
4
|
priority?: boolean;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
7
|
-
export
|
|
6
|
+
export type PrimitiveCatalogComponentProperties = Record<string, PrimitiveCatalogComponentProperty>;
|
|
7
|
+
export type PrimitiveCatalogComponent = {
|
|
8
8
|
properties: PrimitiveCatalogComponentProperties;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type PrimitiveCatalogType = Record<string, PrimitiveCatalogComponent>;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.
|
|
1
|
+
export declare const VERSION = "4.6.1";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/ui-react",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.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.6.1",
|
|
51
|
+
"@aws-amplify/ui-react-core": "2.1.20",
|
|
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",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"maplibre-gl-js-amplify": "3.0.5",
|
|
64
64
|
"qrcode": "1.5.0",
|
|
65
65
|
"react-generate-context": "1.0.1",
|
|
66
|
-
"react-map-gl": "7.0.
|
|
66
|
+
"react-map-gl": "7.0.23",
|
|
67
67
|
"tinycolor2": "1.4.2",
|
|
68
68
|
"tslib": "2.4.1"
|
|
69
69
|
},
|
|
@@ -78,6 +78,7 @@
|
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
+
"@aws-amplify/eslint-config-amplify-ui": "0.0.0",
|
|
81
82
|
"@rollup/plugin-typescript": "^8.3.1",
|
|
82
83
|
"@size-limit/preset-big-lib": "^7.0.8",
|
|
83
84
|
"@svgr/core": "^5.5.0",
|
|
@@ -93,7 +94,6 @@
|
|
|
93
94
|
"@types/tinycolor2": "^1.4.3",
|
|
94
95
|
"esbuild-register": "^3.3.3",
|
|
95
96
|
"eslint": "^8.13.0",
|
|
96
|
-
"eslint-config-amplify-ui": "0.0.0",
|
|
97
97
|
"jest": "^27.0.4",
|
|
98
98
|
"jest-matchmedia-mock": "^1.1.0",
|
|
99
99
|
"react": "^17.0.2",
|