@aws-amplify/ui-react 2.19.1 → 2.20.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/components/Geo/LocationSearch/index.js +1 -1
- package/dist/esm/components/Geo/MapView/index.js +1 -1
- package/dist/esm/components/ThemeProvider/index.js +1 -1
- package/dist/esm/hooks/actions/shared/useTypeCastFields.js +1 -1
- package/dist/esm/hooks/useBreakpointValue.js +1 -1
- package/dist/esm/hooks/useTheme.js +1 -1
- package/dist/esm/primitives/shared/responsive/utils.js +1 -1
- package/dist/esm/primitives/shared/styleUtils.js +1 -1
- package/dist/esm/primitives/shared/utils.js +1 -1
- package/dist/esm/primitives/types/theme.js +1 -0
- package/dist/index.js +1 -1
- package/dist/internal.js +1 -1
- package/dist/styles.css +30 -30
- package/dist/types/components/Geo/LocationSearch/index.d.ts +1 -171
- package/dist/types/components/Geo/MapView/index.d.ts +6 -2
- package/dist/types/hooks/actions/useDataStoreCreateAction.d.ts +1 -1
- package/dist/types/hooks/actions/useDataStoreDeleteAction.d.ts +1 -1
- package/dist/types/hooks/actions/useDataStoreUpdateAction.d.ts +1 -1
- package/dist/types/hooks/actions/useNavigateAction.d.ts +1 -1
- package/dist/types/hooks/useBreakpointValue.d.ts +1 -1
- package/dist/types/hooks/useControllable.d.ts +2 -1
- package/dist/types/hooks/useStorageURL.d.ts +1 -4
- package/dist/types/hooks/useTheme.d.ts +5 -5
- package/dist/types/primitives/shared/responsive/utils.d.ts +1 -1
- package/dist/types/primitives/shared/utils.d.ts +1 -0
- package/dist/types/primitives/types/style.d.ts +41 -40
- package/dist/types/primitives/types/theme.d.ts +78 -0
- package/dist/utils-beb5a80b.js +1 -0
- package/package.json +2 -2
- package/dist/utils-55cbae67.js +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Property } from 'csstype';
|
|
3
3
|
import { WebDesignToken } from '@aws-amplify/ui';
|
|
4
|
+
import type { BoxShadowKeys, ColorKeys, FontFamilyKeys, FontSizeKeys, FontWeightKeys, LineHeightKeys, OpacityKeys, RadiiKeys, SpaceKeys, TransformKeys } from './theme';
|
|
4
5
|
import { FlexItemStyleProps, FlexContainerStyleProps } from './flex';
|
|
5
6
|
import { GridItemStyleProps, GridContainerStyleProps } from './grid';
|
|
6
7
|
import { ImageStyleProps } from './image';
|
|
@@ -25,55 +26,55 @@ export declare type StyleToken<PropertyType> = PropertyType | WebDesignToken<Pro
|
|
|
25
26
|
export declare type ResponsiveStyle<PropertyType> = StyleProp<PropertyType> | StyleProp<PropertyType>[] | ResponsiveObject<StyleProp<PropertyType>>;
|
|
26
27
|
export interface BaseStyleProps extends FlexItemStyleProps, GridItemStyleProps {
|
|
27
28
|
alignSelf?: ResponsiveStyle<StyleToken<Property.AlignSelf>>;
|
|
28
|
-
backgroundColor?: ResponsiveStyle<StyleToken<Property.BackgroundColor
|
|
29
|
+
backgroundColor?: ResponsiveStyle<ColorKeys<StyleToken<Property.BackgroundColor>>>;
|
|
29
30
|
backgroundImage?: ResponsiveStyle<StyleToken<Property.BackgroundImage>>;
|
|
30
31
|
border?: ResponsiveStyle<StyleToken<Property.Border>>;
|
|
31
|
-
borderRadius?: ResponsiveStyle<StyleToken<Property.BorderRadius
|
|
32
|
-
bottom?: ResponsiveStyle<StyleToken<Property.Bottom
|
|
33
|
-
boxShadow?: ResponsiveStyle<StyleToken<Property.BoxShadow
|
|
34
|
-
color?: ResponsiveStyle<StyleToken<Property.Color
|
|
32
|
+
borderRadius?: ResponsiveStyle<RadiiKeys<StyleToken<Property.BorderRadius>>>;
|
|
33
|
+
bottom?: ResponsiveStyle<SpaceKeys<StyleToken<Property.Bottom>>>;
|
|
34
|
+
boxShadow?: ResponsiveStyle<BoxShadowKeys<StyleToken<Property.BoxShadow>>>;
|
|
35
|
+
color?: ResponsiveStyle<ColorKeys<StyleToken<Property.Color>>>;
|
|
35
36
|
display?: ResponsiveStyle<StyleToken<Property.Display>>;
|
|
36
|
-
fontFamily?: ResponsiveStyle<StyleToken<Property.FontFamily
|
|
37
|
-
fontSize?: ResponsiveStyle<StyleToken<Property.FontSize
|
|
37
|
+
fontFamily?: ResponsiveStyle<FontFamilyKeys<StyleToken<Property.FontFamily>>>;
|
|
38
|
+
fontSize?: ResponsiveStyle<FontSizeKeys<StyleToken<Property.FontSize>>>;
|
|
38
39
|
fontStyle?: ResponsiveStyle<StyleToken<Property.FontStyle>>;
|
|
39
|
-
fontWeight?: ResponsiveStyle<StyleToken<Property.FontWeight
|
|
40
|
-
height?: ResponsiveStyle<StyleToken<Property.Height
|
|
41
|
-
left?: ResponsiveStyle<StyleToken<Property.Left
|
|
42
|
-
letterSpacing?: ResponsiveStyle<StyleToken<Property.LetterSpacing
|
|
43
|
-
lineHeight?: ResponsiveStyle<StyleToken<Property.LineHeight
|
|
40
|
+
fontWeight?: ResponsiveStyle<FontWeightKeys<StyleToken<Property.FontWeight>>>;
|
|
41
|
+
height?: ResponsiveStyle<SpaceKeys<StyleToken<Property.Height>>>;
|
|
42
|
+
left?: ResponsiveStyle<SpaceKeys<StyleToken<Property.Left>>>;
|
|
43
|
+
letterSpacing?: ResponsiveStyle<SpaceKeys<StyleToken<Property.LetterSpacing>>>;
|
|
44
|
+
lineHeight?: ResponsiveStyle<LineHeightKeys<StyleToken<Property.LineHeight>>>;
|
|
44
45
|
margin?: ResponsiveStyle<StyleToken<Property.Margin>>;
|
|
45
|
-
marginBlockEnd?: ResponsiveStyle<StyleToken<Property.MarginBlockEnd
|
|
46
|
-
marginBlockStart?: ResponsiveStyle<StyleToken<Property.MarginBlockStart
|
|
47
|
-
marginBottom?: ResponsiveStyle<StyleToken<Property.
|
|
48
|
-
marginInlineEnd?: ResponsiveStyle<StyleToken<Property.MarginInlineEnd
|
|
49
|
-
marginInlineStart?: ResponsiveStyle<StyleToken<Property.MarginInlineStart
|
|
50
|
-
marginLeft?: ResponsiveStyle<StyleToken<Property.
|
|
51
|
-
marginRight?: ResponsiveStyle<StyleToken<Property.
|
|
52
|
-
marginTop?: ResponsiveStyle<StyleToken<Property.
|
|
53
|
-
maxHeight?: ResponsiveStyle<StyleToken<Property.MaxHeight
|
|
54
|
-
maxWidth?: ResponsiveStyle<StyleToken<Property.MaxWidth
|
|
55
|
-
minHeight?: ResponsiveStyle<StyleToken<Property.MinHeight
|
|
56
|
-
minWidth?: ResponsiveStyle<StyleToken<Property.MinWidth
|
|
57
|
-
opacity?: ResponsiveStyle<StyleToken<Property.Opacity
|
|
46
|
+
marginBlockEnd?: ResponsiveStyle<SpaceKeys<StyleToken<Property.MarginBlockEnd>>>;
|
|
47
|
+
marginBlockStart?: ResponsiveStyle<SpaceKeys<StyleToken<Property.MarginBlockStart>>>;
|
|
48
|
+
marginBottom?: ResponsiveStyle<SpaceKeys<StyleToken<Property.MarginBottom>>>;
|
|
49
|
+
marginInlineEnd?: ResponsiveStyle<SpaceKeys<StyleToken<Property.MarginInlineEnd>>>;
|
|
50
|
+
marginInlineStart?: ResponsiveStyle<SpaceKeys<StyleToken<Property.MarginInlineStart>>>;
|
|
51
|
+
marginLeft?: ResponsiveStyle<SpaceKeys<StyleToken<Property.MarginLeft>>>;
|
|
52
|
+
marginRight?: ResponsiveStyle<SpaceKeys<StyleToken<Property.MarginRight>>>;
|
|
53
|
+
marginTop?: ResponsiveStyle<SpaceKeys<StyleToken<Property.MarginTop>>>;
|
|
54
|
+
maxHeight?: ResponsiveStyle<SpaceKeys<StyleToken<Property.MaxHeight>>>;
|
|
55
|
+
maxWidth?: ResponsiveStyle<SpaceKeys<StyleToken<Property.MaxWidth>>>;
|
|
56
|
+
minHeight?: ResponsiveStyle<SpaceKeys<StyleToken<Property.MinHeight>>>;
|
|
57
|
+
minWidth?: ResponsiveStyle<SpaceKeys<StyleToken<Property.MinWidth>>>;
|
|
58
|
+
opacity?: ResponsiveStyle<OpacityKeys<StyleToken<Property.Opacity>>>;
|
|
58
59
|
overflow?: ResponsiveStyle<StyleToken<Property.Overflow>>;
|
|
59
60
|
padding?: ResponsiveStyle<StyleToken<Property.Padding>>;
|
|
60
|
-
paddingBlockEnd?: ResponsiveStyle<StyleToken<Property.
|
|
61
|
-
paddingBlockStart?: ResponsiveStyle<StyleToken<Property.
|
|
62
|
-
paddingBottom?: ResponsiveStyle<StyleToken<Property.
|
|
63
|
-
paddingInlineEnd?: ResponsiveStyle<StyleToken<Property.
|
|
64
|
-
paddingInlineStart?: ResponsiveStyle<StyleToken<Property.
|
|
65
|
-
paddingLeft?: ResponsiveStyle<StyleToken<Property.
|
|
66
|
-
paddingRight?: ResponsiveStyle<StyleToken<Property.
|
|
67
|
-
paddingTop?: ResponsiveStyle<StyleToken<Property.
|
|
61
|
+
paddingBlockEnd?: ResponsiveStyle<SpaceKeys<StyleToken<Property.PaddingBlockEnd>>>;
|
|
62
|
+
paddingBlockStart?: ResponsiveStyle<SpaceKeys<StyleToken<Property.PaddingBlockStart>>>;
|
|
63
|
+
paddingBottom?: ResponsiveStyle<SpaceKeys<StyleToken<Property.PaddingBottom>>>;
|
|
64
|
+
paddingInlineEnd?: ResponsiveStyle<SpaceKeys<StyleToken<Property.PaddingInlineEnd>>>;
|
|
65
|
+
paddingInlineStart?: ResponsiveStyle<SpaceKeys<StyleToken<Property.PaddingInlineStart>>>;
|
|
66
|
+
paddingLeft?: ResponsiveStyle<SpaceKeys<StyleToken<Property.PaddingLeft>>>;
|
|
67
|
+
paddingRight?: ResponsiveStyle<SpaceKeys<StyleToken<Property.PaddingRight>>>;
|
|
68
|
+
paddingTop?: ResponsiveStyle<SpaceKeys<StyleToken<Property.PaddingTop>>>;
|
|
68
69
|
position?: ResponsiveStyle<StyleToken<Property.Position>>;
|
|
69
|
-
right?: ResponsiveStyle<StyleToken<Property.Right
|
|
70
|
+
right?: ResponsiveStyle<SpaceKeys<StyleToken<Property.Right>>>;
|
|
70
71
|
textAlign?: ResponsiveStyle<StyleToken<Property.TextAlign>>;
|
|
71
72
|
textDecoration?: ResponsiveStyle<StyleToken<Property.TextDecoration>>;
|
|
72
73
|
textTransform?: ResponsiveStyle<StyleToken<Property.TextTransform>>;
|
|
73
|
-
top?: ResponsiveStyle<StyleToken<Property.Top
|
|
74
|
-
transform?: ResponsiveStyle<StyleToken<Property.Transform
|
|
74
|
+
top?: ResponsiveStyle<SpaceKeys<StyleToken<Property.Top>>>;
|
|
75
|
+
transform?: ResponsiveStyle<TransformKeys<StyleToken<Property.Transform>>>;
|
|
75
76
|
transformOrigin?: ResponsiveStyle<StyleToken<Property.TransformOrigin>>;
|
|
76
|
-
width?: ResponsiveStyle<StyleToken<Property.Width
|
|
77
|
+
width?: ResponsiveStyle<SpaceKeys<StyleToken<Property.Width>>>;
|
|
77
78
|
whiteSpace?: ResponsiveStyle<StyleToken<Property.WhiteSpace>>;
|
|
78
79
|
}
|
|
79
80
|
export interface CSSLayoutStyleProps {
|
|
@@ -92,15 +93,15 @@ export interface CSSLayoutStyleProps {
|
|
|
92
93
|
/**
|
|
93
94
|
* Spacing between child components. Shorthand for rowGap and columnGap.
|
|
94
95
|
*/
|
|
95
|
-
gap?: ResponsiveStyle<StyleToken<Property.Gap
|
|
96
|
+
gap?: ResponsiveStyle<SpaceKeys<StyleToken<Property.Gap>>>;
|
|
96
97
|
/**
|
|
97
98
|
* Spacing between Flex/Grid child columns
|
|
98
99
|
*/
|
|
99
|
-
columnGap?: ResponsiveStyle<StyleToken<Property.GridColumnGap
|
|
100
|
+
columnGap?: ResponsiveStyle<SpaceKeys<StyleToken<Property.GridColumnGap>>>;
|
|
100
101
|
/**
|
|
101
102
|
* Spacing between Flex/Grid child rows
|
|
102
103
|
*/
|
|
103
|
-
rowGap?: ResponsiveStyle<StyleToken<Property.RowGap
|
|
104
|
+
rowGap?: ResponsiveStyle<SpaceKeys<StyleToken<Property.RowGap>>>;
|
|
104
105
|
}
|
|
105
106
|
export interface AllStyleProps extends BaseStyleProps, ImageStyleProps, FlexContainerStyleProps, GridContainerStyleProps, TextAreaStyleProps {
|
|
106
107
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { FontSizes, FontWeights, LineHeights, Radii, Shadows, SpaceSizes } from '@aws-amplify/ui';
|
|
2
|
+
/**
|
|
3
|
+
* Token keys for colors
|
|
4
|
+
*
|
|
5
|
+
* Though both 'white' and 'black' are valid CSS values
|
|
6
|
+
* We still want to define them as keys here and convert them into CSS variable reference afterwards
|
|
7
|
+
* This will make the default dark mode override work, where we flip these two
|
|
8
|
+
*/
|
|
9
|
+
declare type WhiteKey = 'white';
|
|
10
|
+
declare type BlackKey = 'black';
|
|
11
|
+
declare type RedKeys = 'red.10' | 'red.20' | 'red.40' | 'red.60' | 'red.80' | 'red.90' | 'red.100';
|
|
12
|
+
declare type OrangeKeys = 'orange.10' | 'orange.20' | 'orange.40' | 'orange.60' | 'orange.80' | 'orange.90' | 'orange.100';
|
|
13
|
+
declare type YellowKeys = 'yellow.10' | 'yellow.20' | 'yellow.40' | 'yellow.60' | 'yellow.80' | 'yellow.90' | 'yellow.100';
|
|
14
|
+
declare type GreenKeys = 'green.10' | 'green.20' | 'green.40' | 'green.60' | 'green.80' | 'green.90' | 'green.100';
|
|
15
|
+
declare type TealKeys = 'teal.10' | 'teal.20' | 'teal.40' | 'teal.60' | 'teal.80' | 'teal.90' | 'teal.100';
|
|
16
|
+
declare type BlueKeys = 'blue.10' | 'blue.20' | 'blue.40' | 'blue.60' | 'blue.80' | 'blue.90' | 'blue.100';
|
|
17
|
+
declare type PurpleKeys = 'purple.10' | 'purple.20' | 'purple.40' | 'purple.60' | 'purple.80' | 'purple.90' | 'purple.100';
|
|
18
|
+
declare type PinkKeys = 'pink.10' | 'pink.20' | 'pink.40' | 'pink.60' | 'pink.80' | 'pink.90' | 'pink.100';
|
|
19
|
+
declare type NeutralKeys = 'neutral.10' | 'neutral.20' | 'neutral.40' | 'neutral.60' | 'neutral.80' | 'neutral.90' | 'neutral.100';
|
|
20
|
+
declare type OverlayKeys = 'overlay.10' | 'overlay.20' | 'overlay.30' | 'overlay.40' | 'overlay.50' | 'overlay.60' | 'overlay.70' | 'overlay.80' | 'overlay.90';
|
|
21
|
+
declare 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
|
+
declare 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
|
+
declare type BackgroundColorKeys = 'background.primary' | 'background.secondary' | 'background.tertiary' | 'background.quaternary' | 'background.disabled' | 'background.success' | 'background.info' | 'background.warning' | 'background.error';
|
|
24
|
+
declare type BorderColorKeys = 'border.primary' | 'border.secondary' | 'border.tertiary' | 'border.disabled' | 'border.focus' | 'border.pressed' | 'border.error';
|
|
25
|
+
declare type ShadowColorKeys = 'shadow.primary' | 'shadow.secondary' | 'shadow.tertiary';
|
|
26
|
+
export declare type ColorKeys<PropertyType> = PropertyType | WhiteKey | BlackKey | RedKeys | OrangeKeys | YellowKeys | GreenKeys | TealKeys | BlueKeys | PurpleKeys | PinkKeys | NeutralKeys | OverlayKeys | BrandColorKeys | FontColorKeys | BackgroundColorKeys | BorderColorKeys | ShadowColorKeys;
|
|
27
|
+
export declare type BoxShadowKeys<PropertyType> = PropertyType | keyof Shadows;
|
|
28
|
+
export declare type FontSizeKeys<PropertyType> = PropertyType | keyof FontSizes;
|
|
29
|
+
export declare type FontWeightKeys<PropertyType> = PropertyType | keyof FontWeights;
|
|
30
|
+
export declare type FontFamilyKeys<PropertyType> = PropertyType | 'default.variable' | 'default.static';
|
|
31
|
+
export declare type LineHeightKeys<PropertyType> = PropertyType | keyof LineHeights;
|
|
32
|
+
export declare type OpacityKeys<PropertyType> = PropertyType | '0' | '10' | '20' | '30' | '40' | '50' | '60' | '70' | '80' | '90' | '100';
|
|
33
|
+
export declare type RadiiKeys<PropertyType> = PropertyType | keyof Radii;
|
|
34
|
+
export declare 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 declare type TransformKeys<PropertyType> = PropertyType | 'slideX.small' | 'slideX.medium' | 'slideX.large';
|
|
36
|
+
export declare const stylePropsToThemeKeys: {
|
|
37
|
+
backgroundColor: string;
|
|
38
|
+
color: string;
|
|
39
|
+
borderRadius: string;
|
|
40
|
+
fontSize: string;
|
|
41
|
+
fontWeight: string;
|
|
42
|
+
fontFamily: string;
|
|
43
|
+
lineHeight: string;
|
|
44
|
+
opacity: string;
|
|
45
|
+
boxShadow: string;
|
|
46
|
+
transform: string;
|
|
47
|
+
left: string;
|
|
48
|
+
right: string;
|
|
49
|
+
top: string;
|
|
50
|
+
bottom: string;
|
|
51
|
+
height: string;
|
|
52
|
+
width: string;
|
|
53
|
+
letterSpacing: string;
|
|
54
|
+
marginBlockEnd: string;
|
|
55
|
+
marginBlockStart: string;
|
|
56
|
+
marginInlineEnd: string;
|
|
57
|
+
marginInlineStart: string;
|
|
58
|
+
marginLeft: string;
|
|
59
|
+
marginRight: string;
|
|
60
|
+
marginTop: string;
|
|
61
|
+
marginBottom: string;
|
|
62
|
+
maxHeight: string;
|
|
63
|
+
maxWidth: string;
|
|
64
|
+
minHeight: string;
|
|
65
|
+
minWidth: string;
|
|
66
|
+
paddingBlockEnd: string;
|
|
67
|
+
paddingBlockStart: string;
|
|
68
|
+
paddingInlineEnd: string;
|
|
69
|
+
paddingInlineStart: string;
|
|
70
|
+
paddingLeft: string;
|
|
71
|
+
paddingRight: string;
|
|
72
|
+
paddingTop: string;
|
|
73
|
+
paddingBottom: string;
|
|
74
|
+
gap: string;
|
|
75
|
+
columnGap: string;
|
|
76
|
+
rowGap: string;
|
|
77
|
+
};
|
|
78
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("lodash/isEmpty"),t=require("lodash/isArray"),r=require("lodash/isObject"),n=require("@aws-amplify/ui");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=s(e),i=s(t),o=s(r);const c=e=>o.default(e)&&a.default(e),p=e=>i.default(e)&&a.default(e),l={backgroundColor:"colors",color:"colors",borderRadius:"radii",fontSize:"fontSizes",fontWeight:"fontWeights",fontFamily:"fonts",lineHeight:"lineHeights",opacity:"opacities",boxShadow:"shadows",transform:"transforms",left:"space",right:"space",top:"space",bottom:"space",height:"space",width:"space",letterSpacing:"space",marginBlockEnd:"space",marginBlockStart:"space",marginInlineEnd:"space",marginInlineStart:"space",marginLeft:"space",marginRight:"space",marginTop:"space",marginBottom:"space",maxHeight:"space",maxWidth:"space",minHeight:"space",minWidth:"space",paddingBlockEnd:"space",paddingBlockStart:"space",paddingInlineEnd:"space",paddingInlineStart:"space",paddingLeft:"space",paddingRight:"space",paddingTop:"space",paddingBottom:"space",gap:"space",columnGap:"space",rowGap:"space"},f=e=>"string"==typeof e&&0===e.length;exports.__awaiter=function(e,t,r,n){return new(r||(r=Promise))((function(s,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function o(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,o)}c((n=n.apply(e,t||[])).next())}))},exports.__rest=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]])}return r},exports.areArrayValuesEqual=(e,t)=>e.length===t.length&&e.every(((e,r)=>{const n=t[r];return!(!p(e)||!p(n))||(!(!c(e)||!c(n))||e===n)})),exports.classNameModifier=(e,t)=>t?`${e}--${t}`:null,exports.classNameModifierByFlag=(e,t,r)=>r?`${e}--${t}`:null,exports.findChildOverrides=(e,t)=>{if(!e)return null;const r=Object.entries(e).filter((e=>e[0].startsWith(t)));return Object.assign({},...Array.from(r,(([e,r])=>({[e.replace(t,"")]:r}))))},exports.getCSSVariableIfValueIsThemeKey=(e,t)=>{if("string"!=typeof t)return t;const r=t.split(".");let{tokens:s}=n.defaultTheme;s=s[l[e]];for(let e=0;e<r.length&&s;e++)s=s[r[e]];return n.isDesignToken(s)?`var(--${n.cssNameTransform({path:[l[e],...r]})})`:t},exports.getConsecutiveIntArray=(e,t)=>{const r=t-e+1;return Array.from({length:r},((t,r)=>r+e))},exports.getErrorMessage=e=>(e=>{if("object"==typeof(t=e)&&null!==t&&"message"in t&&"string"==typeof t.message)return e;var t;try{return new Error(JSON.stringify(e))}catch(t){return new Error(String(e))}})(e).message,exports.getFormDataFromEvent=e=>{const t=new FormData(e.target);return Object.fromEntries(t)},exports.getOverrideProps=(e,t)=>{if(!e)return null;const r=Object.entries(e).filter((([e])=>e===t)).flatMap((([,e])=>Object.entries(e))).filter((e=>null==e?void 0:e[0]));return Object.fromEntries(r)},exports.getOverridesFromVariants=function(e,t){const r=[...new Set(e.flatMap((e=>Object.keys(e.variantValues))))],n=Object.keys(t).filter((e=>r.includes(e)&&t[e])).reduce(((e,r)=>(e[r]=t[r],e)),{});return e.filter((({variantValues:e})=>Object.keys(e).length===Object.keys(n).length&&Object.entries(e).every((([e,t])=>n[e]===t)))).reduce(((e,t)=>Object.assign(Object.assign({},e),t.overrides)),{})},exports.isEmptyString=f,exports.isFunction=e=>"function"==typeof e,exports.isNullOrEmptyString=e=>null==e||f(e),exports.mergeVariantsAndOverrides=(e,t)=>{if(!e&&!t)return null;if(!t)return e;if(!e)return t;const r=new Set(Object.keys(t)),n=Object.keys(e).filter((e=>r.has(e))),s=Object.fromEntries(n.map((r=>[r,Object.assign(Object.assign({},e[r]),t[r])])));return Object.assign(Object.assign(Object.assign({},e),t),s)},exports.strHasLength=e=>"string"==typeof e&&e.length>0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/ui-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.20.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"size": "yarn run size-limit"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@aws-amplify/ui": "3.10.
|
|
62
|
+
"@aws-amplify/ui": "3.10.1",
|
|
63
63
|
"@aws-amplify/ui-react-v1": "npm:@aws-amplify/ui-react@1.2.9",
|
|
64
64
|
"@radix-ui/react-accordion": "0.1.6",
|
|
65
65
|
"@radix-ui/react-dropdown-menu": "0.1.6",
|
package/dist/utils-55cbae67.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("lodash/isEmpty"),t=require("lodash/isArray"),r=require("lodash/isObject");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=n(e),i=n(t),o=n(r);const a=e=>o.default(e)&&s.default(e),c=e=>i.default(e)&&s.default(e),l=e=>"string"==typeof e&&0===e.length;exports.__awaiter=function(e,t,r,n){return new(r||(r=Promise))((function(s,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}c((n=n.apply(e,t||[])).next())}))},exports.__rest=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]])}return r},exports.areArrayValuesEqual=(e,t)=>e.length===t.length&&e.every(((e,r)=>{const n=t[r];return!(!c(e)||!c(n))||(!(!a(e)||!a(n))||e===n)})),exports.classNameModifier=(e,t)=>t?`${e}--${t}`:null,exports.classNameModifierByFlag=(e,t,r)=>r?`${e}--${t}`:null,exports.findChildOverrides=(e,t)=>{if(!e)return null;const r=Object.entries(e).filter((e=>e[0].startsWith(t)));return Object.assign({},...Array.from(r,(([e,r])=>({[e.replace(t,"")]:r}))))},exports.getConsecutiveIntArray=(e,t)=>{const r=t-e+1;return Array.from({length:r},((t,r)=>r+e))},exports.getErrorMessage=e=>(e=>{if("object"==typeof(t=e)&&null!==t&&"message"in t&&"string"==typeof t.message)return e;var t;try{return new Error(JSON.stringify(e))}catch(t){return new Error(String(e))}})(e).message,exports.getFormDataFromEvent=e=>{const t=new FormData(e.target);return Object.fromEntries(t)},exports.getOverrideProps=(e,t)=>{if(!e)return null;const r=Object.entries(e).filter((([e])=>e===t)).flatMap((([,e])=>Object.entries(e))).filter((e=>null==e?void 0:e[0]));return Object.fromEntries(r)},exports.getOverridesFromVariants=function(e,t){const r=[...new Set(e.flatMap((e=>Object.keys(e.variantValues))))],n=Object.keys(t).filter((e=>r.includes(e)&&t[e])).reduce(((e,r)=>(e[r]=t[r],e)),{});return e.filter((({variantValues:e})=>Object.keys(e).length===Object.keys(n).length&&Object.entries(e).every((([e,t])=>n[e]===t)))).reduce(((e,t)=>Object.assign(Object.assign({},e),t.overrides)),{})},exports.isEmptyString=l,exports.isFunction=e=>"function"==typeof e,exports.isNullOrEmptyString=e=>null==e||l(e),exports.mergeVariantsAndOverrides=(e,t)=>{if(!e&&!t)return null;if(!t)return e;if(!e)return t;const r=new Set(Object.keys(t)),n=Object.keys(e).filter((e=>r.has(e))),s=Object.fromEntries(n.map((r=>[r,Object.assign(Object.assign({},e[r]),t[r])])));return Object.assign(Object.assign(Object.assign({},e),t),s)},exports.strHasLength=e=>"string"==typeof e&&e.length>0;
|