@razorpay/blade 5.2.0 → 5.3.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/CHANGELOG.md +13 -0
- package/build/components/index.d.ts +257 -45
- package/build/components/index.native.d.ts +257 -45
- package/build/components/index.native.js +22 -8
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.web.js +533 -186
- package/build/components/index.web.js.map +1 -1
- package/build/css/bankingThemeDarkDesktop.css +1 -1
- package/build/css/bankingThemeDarkMobile.css +1 -1
- package/build/css/bankingThemeLightDesktop.css +1 -1
- package/build/css/bankingThemeLightMobile.css +1 -1
- package/build/css/paymentThemeDarkDesktop.css +1 -1
- package/build/css/paymentThemeDarkMobile.css +1 -1
- package/build/css/paymentThemeLightDesktop.css +1 -1
- package/build/css/paymentThemeLightMobile.css +1 -1
- package/build/tokens/index.native.js +1 -1
- package/build/tokens/index.web.js +1 -1
- package/build/utils/index.d.ts +21 -2
- package/build/utils/index.native.d.ts +21 -2
- package/build/utils/index.native.js +5 -3
- package/build/utils/index.native.js.map +1 -1
- package/build/utils/index.web.js +30 -3
- package/build/utils/index.web.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
|
-
import React__default, { ReactChild, ReactElement, ReactNode,
|
|
3
|
+
import React__default, { ReactChild, ReactElement, ReactNode, SyntheticEvent, KeyboardEvent } from 'react';
|
|
4
4
|
import { AccessibilityRole, GestureResponderEvent } from 'react-native';
|
|
5
5
|
import { CSSObject } from 'styled-components';
|
|
6
6
|
|
|
@@ -240,6 +240,16 @@ type DotNotationColorStringToken<TokenType> = {
|
|
|
240
240
|
: DotNotationColorStringToken<TokenType[K]>}`;
|
|
241
241
|
}[keyof TokenType];
|
|
242
242
|
|
|
243
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* A type defining React component with additional static prop `componentId`
|
|
248
|
+
*/
|
|
249
|
+
type WithComponentId<Props> = ((props: Props) => React__default.ReactElement) & {
|
|
250
|
+
componentId: string;
|
|
251
|
+
};
|
|
252
|
+
|
|
243
253
|
// All the WAI-ARIA 1.1 role attribute values from https://www.w3.org/TR/wai-aria-1.1/#role_definitions
|
|
244
254
|
type AriaRoles =
|
|
245
255
|
| Exclude<AccessibilityRole, 'header' | 'adjustable' | 'image' | 'none' | 'summary'>
|
|
@@ -1039,6 +1049,75 @@ declare type Theme = {
|
|
|
1039
1049
|
typography: Typography;
|
|
1040
1050
|
};
|
|
1041
1051
|
|
|
1052
|
+
declare type CardProps = {
|
|
1053
|
+
/**
|
|
1054
|
+
* Card contents
|
|
1055
|
+
*/
|
|
1056
|
+
children: React__default.ReactNode;
|
|
1057
|
+
/**
|
|
1058
|
+
* Sets the background color of the Card according to the surface level tokens
|
|
1059
|
+
*
|
|
1060
|
+
* eg: `theme.colors.surface.background.level1`
|
|
1061
|
+
*
|
|
1062
|
+
* **Description:**
|
|
1063
|
+
*
|
|
1064
|
+
* - 2: Used in layouts which are on top of the main background
|
|
1065
|
+
* - 3: Used over the cards template or as a text input backgrounds.
|
|
1066
|
+
*
|
|
1067
|
+
* **Links:**
|
|
1068
|
+
* - Docs: https://blade.razorpay.com/?path=/docs/tokens-colors--page#-theme-tokens
|
|
1069
|
+
* - Figma: https://shorturl.at/fsvwK
|
|
1070
|
+
*/
|
|
1071
|
+
surfaceLevel: 2 | 3;
|
|
1072
|
+
};
|
|
1073
|
+
declare const Card: ({ children, surfaceLevel }: CardProps) => React__default.ReactElement;
|
|
1074
|
+
declare type CardBodyProps = {
|
|
1075
|
+
children: React__default.ReactNode;
|
|
1076
|
+
};
|
|
1077
|
+
declare const CardBody: ({ children }: CardBodyProps) => React__default.ReactElement;
|
|
1078
|
+
|
|
1079
|
+
declare type LinkCommonProps = {
|
|
1080
|
+
variant?: 'anchor' | 'button';
|
|
1081
|
+
icon?: IconComponent$1;
|
|
1082
|
+
iconPosition?: 'left' | 'right';
|
|
1083
|
+
isDisabled?: boolean;
|
|
1084
|
+
onClick?: (event: SyntheticEvent) => void;
|
|
1085
|
+
href?: string;
|
|
1086
|
+
target?: string;
|
|
1087
|
+
accessibilityLabel?: string;
|
|
1088
|
+
/**
|
|
1089
|
+
* Sets the size of the link
|
|
1090
|
+
*
|
|
1091
|
+
* @default medium
|
|
1092
|
+
*/
|
|
1093
|
+
size?: 'small' | 'medium';
|
|
1094
|
+
};
|
|
1095
|
+
declare type LinkWithoutIconProps = LinkCommonProps & {
|
|
1096
|
+
icon?: undefined;
|
|
1097
|
+
children: string;
|
|
1098
|
+
};
|
|
1099
|
+
declare type LinkWithIconProps = LinkCommonProps & {
|
|
1100
|
+
icon: IconComponent$1;
|
|
1101
|
+
children?: string;
|
|
1102
|
+
};
|
|
1103
|
+
declare type LinkPropsWithOrWithoutIcon = LinkWithIconProps | LinkWithoutIconProps;
|
|
1104
|
+
declare type LinkAnchorVariantProps = LinkPropsWithOrWithoutIcon & {
|
|
1105
|
+
variant?: 'anchor';
|
|
1106
|
+
href?: string;
|
|
1107
|
+
target?: string;
|
|
1108
|
+
rel?: string;
|
|
1109
|
+
isDisabled?: undefined;
|
|
1110
|
+
};
|
|
1111
|
+
declare type LinkButtonVariantProps = LinkPropsWithOrWithoutIcon & {
|
|
1112
|
+
variant?: 'button';
|
|
1113
|
+
isDisabled?: boolean;
|
|
1114
|
+
href?: undefined;
|
|
1115
|
+
target?: undefined;
|
|
1116
|
+
rel?: undefined;
|
|
1117
|
+
};
|
|
1118
|
+
declare type LinkProps = LinkAnchorVariantProps | LinkButtonVariantProps;
|
|
1119
|
+
declare const Link: ({ children, icon, iconPosition, isDisabled, onClick, variant, href, target, rel, accessibilityLabel, size, }: LinkProps) => ReactElement;
|
|
1120
|
+
|
|
1042
1121
|
declare type ButtonCommonProps = {
|
|
1043
1122
|
variant?: 'primary' | 'secondary' | 'tertiary';
|
|
1044
1123
|
size?: 'xsmall' | 'small' | 'medium' | 'large';
|
|
@@ -1064,6 +1143,181 @@ declare type ButtonWithIconProps = ButtonCommonProps & {
|
|
|
1064
1143
|
declare type ButtonProps = ButtonWithoutIconProps | ButtonWithIconProps;
|
|
1065
1144
|
declare const Button: ({ children, icon, iconPosition, isDisabled, isFullWidth, isLoading, onClick, size, type, variant, accessibilityLabel, }: ButtonProps) => React.ReactElement;
|
|
1066
1145
|
|
|
1146
|
+
type FeedbackColors$1 = `feedback.text.${DotNotationColorStringToken<
|
|
1147
|
+
Theme$1['colors']['feedback']['text']
|
|
1148
|
+
>}`;
|
|
1149
|
+
type FeedbackActionColors$1 = `feedback.${Feedback}.action.text.${DotNotationColorStringToken<
|
|
1150
|
+
Theme$1['colors']['feedback'][Feedback]['action']['text']
|
|
1151
|
+
>}`;
|
|
1152
|
+
type SurfaceColors$1 = `surface.text.${DotNotationColorStringToken<
|
|
1153
|
+
Theme$1['colors']['surface']['text']
|
|
1154
|
+
>}`;
|
|
1155
|
+
type ActionColors$1 = `action.text.${DotNotationColorStringToken<Theme$1['colors']['action']['text']>}`;
|
|
1156
|
+
type BadgeTextColors$1 = `badge.text.${DotNotationColorStringToken<
|
|
1157
|
+
Theme$1['colors']['badge']['text']
|
|
1158
|
+
>}`;
|
|
1159
|
+
|
|
1160
|
+
type BaseTextProps$1 = {
|
|
1161
|
+
id?: string;
|
|
1162
|
+
color?: ActionColors$1 | FeedbackColors$1 | SurfaceColors$1 | FeedbackActionColors$1 | BadgeTextColors$1;
|
|
1163
|
+
fontFamily?: keyof Theme$1['typography']['fonts']['family'];
|
|
1164
|
+
fontSize?: keyof Theme$1['typography']['fonts']['size'];
|
|
1165
|
+
fontWeight?: keyof Theme$1['typography']['fonts']['weight'];
|
|
1166
|
+
fontStyle?: 'italic' | 'normal';
|
|
1167
|
+
textDecorationLine?: 'line-through' | 'none' | 'underline';
|
|
1168
|
+
lineHeight?: keyof Theme$1['typography']['lineHeights'];
|
|
1169
|
+
/**
|
|
1170
|
+
* Web only
|
|
1171
|
+
*/
|
|
1172
|
+
as?: 'code' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span';
|
|
1173
|
+
textAlign?: 'center' | 'justify' | 'left' | 'right';
|
|
1174
|
+
truncateAfterLines?: number;
|
|
1175
|
+
className?: string;
|
|
1176
|
+
style?: React.CSSProperties;
|
|
1177
|
+
children: React.ReactNode;
|
|
1178
|
+
accessibilityProps?: Partial<AccessibilityProps>;
|
|
1179
|
+
/**
|
|
1180
|
+
* React Native only
|
|
1181
|
+
*/
|
|
1182
|
+
numberOfLines?: number;
|
|
1183
|
+
componentName?: 'text' | 'title' | 'heading' | 'code';
|
|
1184
|
+
};
|
|
1185
|
+
|
|
1186
|
+
/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */
|
|
1187
|
+
|
|
1188
|
+
|
|
1189
|
+
type TextCommonProps$1 = {
|
|
1190
|
+
type?: TextTypes;
|
|
1191
|
+
contrast?: ColorContrastTypes;
|
|
1192
|
+
truncateAfterLines?: number;
|
|
1193
|
+
children: React.ReactNode;
|
|
1194
|
+
weight?: keyof Theme$1['typography']['fonts']['weight'];
|
|
1195
|
+
/**
|
|
1196
|
+
* **For Internal use only**: Sets the color of the Text component
|
|
1197
|
+
*/
|
|
1198
|
+
color?: BaseTextProps$1['color'];
|
|
1199
|
+
};
|
|
1200
|
+
|
|
1201
|
+
type TextVariant$1 = 'body' | 'caption';
|
|
1202
|
+
|
|
1203
|
+
type TextBodyVariant$1 = TextCommonProps$1 & {
|
|
1204
|
+
variant?: Extract<TextVariant$1, 'body'>;
|
|
1205
|
+
size?: 'small' | 'medium';
|
|
1206
|
+
};
|
|
1207
|
+
|
|
1208
|
+
type TextCaptionVariant$1 = TextCommonProps$1 & {
|
|
1209
|
+
variant?: Extract<TextVariant$1, 'caption'>;
|
|
1210
|
+
size?: 'medium';
|
|
1211
|
+
};
|
|
1212
|
+
|
|
1213
|
+
/**
|
|
1214
|
+
* Conditionally changing props based on variant.
|
|
1215
|
+
* Overloads or union gives wrong intellisense.
|
|
1216
|
+
*/
|
|
1217
|
+
type TextProps$1<T> = T extends {
|
|
1218
|
+
variant: infer Variant;
|
|
1219
|
+
}
|
|
1220
|
+
? Variant extends 'caption'
|
|
1221
|
+
? TextCaptionVariant$1
|
|
1222
|
+
: Variant extends 'body'
|
|
1223
|
+
? TextBodyVariant$1
|
|
1224
|
+
: T
|
|
1225
|
+
: T;
|
|
1226
|
+
|
|
1227
|
+
type CounterProps$1 = {
|
|
1228
|
+
/**
|
|
1229
|
+
* Sets the value for the counter.
|
|
1230
|
+
*/
|
|
1231
|
+
value: number;
|
|
1232
|
+
/**
|
|
1233
|
+
* Sets the max value for the counter.
|
|
1234
|
+
* If value exceedes `max` it will render `value+`
|
|
1235
|
+
*/
|
|
1236
|
+
max?: number;
|
|
1237
|
+
/**
|
|
1238
|
+
* Sets the intent of the counter.
|
|
1239
|
+
*
|
|
1240
|
+
* @default 'neutral'
|
|
1241
|
+
*/
|
|
1242
|
+
intent?: Feedback;
|
|
1243
|
+
/**
|
|
1244
|
+
* Sets the contrast of the counter.
|
|
1245
|
+
*
|
|
1246
|
+
* @default 'low'
|
|
1247
|
+
*/
|
|
1248
|
+
contrast?: 'high' | 'low';
|
|
1249
|
+
/**
|
|
1250
|
+
* Sets the size of the counter.
|
|
1251
|
+
*
|
|
1252
|
+
* @default 'medium'
|
|
1253
|
+
*/
|
|
1254
|
+
size?: 'small' | 'medium' | 'large';
|
|
1255
|
+
};
|
|
1256
|
+
|
|
1257
|
+
declare const CardHeaderIcon: WithComponentId<{
|
|
1258
|
+
icon: IconComponent$1;
|
|
1259
|
+
}>;
|
|
1260
|
+
declare const CardHeaderCounter: WithComponentId<CounterProps$1>;
|
|
1261
|
+
declare const CardHeaderBadge: WithComponentId<BadgeProps>;
|
|
1262
|
+
declare const CardHeaderText: WithComponentId<TextProps$1<{
|
|
1263
|
+
variant: TextVariant$1;
|
|
1264
|
+
}>>;
|
|
1265
|
+
declare const CardHeaderLink: WithComponentId<LinkProps>;
|
|
1266
|
+
declare type CardHeaderIconButtonProps = Omit<ButtonProps, 'variant' | 'size' | 'iconPosition' | 'isFullWidth' | 'children'> & {
|
|
1267
|
+
icon: IconComponent$1;
|
|
1268
|
+
};
|
|
1269
|
+
declare const CardHeaderIconButton: WithComponentId<CardHeaderIconButtonProps>;
|
|
1270
|
+
declare type CardHeaderProps = {
|
|
1271
|
+
children?: React__default.ReactNode;
|
|
1272
|
+
};
|
|
1273
|
+
declare const CardHeader: ({ children }: CardHeaderProps) => React__default.ReactElement;
|
|
1274
|
+
declare type CardHeaderLeadingProps = {
|
|
1275
|
+
title: string;
|
|
1276
|
+
subtitle?: string;
|
|
1277
|
+
/**
|
|
1278
|
+
* prefix element of Card
|
|
1279
|
+
*
|
|
1280
|
+
* Accepts: `CardHeaderIcon` component
|
|
1281
|
+
*/
|
|
1282
|
+
prefix?: React__default.ReactNode;
|
|
1283
|
+
/**
|
|
1284
|
+
* suffix element of Card
|
|
1285
|
+
*
|
|
1286
|
+
* Accepts: `CardHeaderCounter` component
|
|
1287
|
+
*/
|
|
1288
|
+
suffix?: React__default.ReactNode;
|
|
1289
|
+
};
|
|
1290
|
+
declare const CardHeaderLeading: ({ title, subtitle, prefix, suffix, }: CardHeaderLeadingProps) => React__default.ReactElement;
|
|
1291
|
+
declare type CardHeaderTrailingProps = {
|
|
1292
|
+
/**
|
|
1293
|
+
* Renders a visual ornament in card header trailing section
|
|
1294
|
+
*
|
|
1295
|
+
* Accepts: `CardHeaderLink`, `CardHeaderText`, `CardHeaderIconButton`, `CardHeaderBadge`
|
|
1296
|
+
*/
|
|
1297
|
+
visual?: React__default.ReactNode;
|
|
1298
|
+
};
|
|
1299
|
+
declare const CardHeaderTrailing: ({ visual }: CardHeaderTrailingProps) => React__default.ReactElement;
|
|
1300
|
+
|
|
1301
|
+
declare type CardFooterAction = Pick<ButtonProps, 'type' | 'accessibilityLabel' | 'isLoading' | 'isDisabled' | 'icon' | 'iconPosition' | 'onClick'> & {
|
|
1302
|
+
text: ButtonProps['children'];
|
|
1303
|
+
};
|
|
1304
|
+
declare type CardFooterProps = {
|
|
1305
|
+
children?: React.ReactNode;
|
|
1306
|
+
};
|
|
1307
|
+
declare const CardFooter: ({ children }: CardFooterProps) => React.ReactElement;
|
|
1308
|
+
declare type CardFooterLeadingProps = {
|
|
1309
|
+
title?: string;
|
|
1310
|
+
subtitle?: string;
|
|
1311
|
+
};
|
|
1312
|
+
declare const CardFooterLeading: ({ title, subtitle }: CardFooterLeadingProps) => React.ReactElement;
|
|
1313
|
+
declare type CardFooterTrailingProps = {
|
|
1314
|
+
actions?: {
|
|
1315
|
+
primary?: CardFooterAction;
|
|
1316
|
+
secondary?: CardFooterAction;
|
|
1317
|
+
};
|
|
1318
|
+
};
|
|
1319
|
+
declare const CardFooterTrailing: ({ actions }: CardFooterTrailingProps) => React.ReactElement;
|
|
1320
|
+
|
|
1067
1321
|
declare type IconButtonProps = {
|
|
1068
1322
|
/**
|
|
1069
1323
|
* Icon component to be rendered, eg. `CloseIcon`
|
|
@@ -1459,7 +1713,7 @@ declare type BaseInputProps = FormInputLabelProps & FormInputValidationProps & {
|
|
|
1459
1713
|
*
|
|
1460
1714
|
* @default text
|
|
1461
1715
|
*/
|
|
1462
|
-
type?: 'text' | 'telephone' | 'email' | 'url' | '
|
|
1716
|
+
type?: 'text' | 'telephone' | 'email' | 'url' | 'number' | 'search' | 'password';
|
|
1463
1717
|
/**
|
|
1464
1718
|
* Used to set the default value of input field when it's uncontrolled
|
|
1465
1719
|
*/
|
|
@@ -1740,48 +1994,6 @@ declare type IndicatorWithA11yLabel = {
|
|
|
1740
1994
|
declare type IndicatorProps = IndicatorCommonProps & (IndicatorWithA11yLabel | IndicatorWithoutA11yLabel);
|
|
1741
1995
|
declare const Indicator: ({ accessibilityLabel, children, size, intent, }: IndicatorProps) => ReactElement;
|
|
1742
1996
|
|
|
1743
|
-
declare type LinkCommonProps = {
|
|
1744
|
-
variant?: 'anchor' | 'button';
|
|
1745
|
-
icon?: IconComponent$1;
|
|
1746
|
-
iconPosition?: 'left' | 'right';
|
|
1747
|
-
isDisabled?: boolean;
|
|
1748
|
-
onClick?: (event: SyntheticEvent) => void;
|
|
1749
|
-
href?: string;
|
|
1750
|
-
target?: string;
|
|
1751
|
-
accessibilityLabel?: string;
|
|
1752
|
-
/**
|
|
1753
|
-
* Sets the size of the link
|
|
1754
|
-
*
|
|
1755
|
-
* @default medium
|
|
1756
|
-
*/
|
|
1757
|
-
size?: 'small' | 'medium';
|
|
1758
|
-
};
|
|
1759
|
-
declare type LinkWithoutIconProps = LinkCommonProps & {
|
|
1760
|
-
icon?: undefined;
|
|
1761
|
-
children: string;
|
|
1762
|
-
};
|
|
1763
|
-
declare type LinkWithIconProps = LinkCommonProps & {
|
|
1764
|
-
icon: IconComponent$1;
|
|
1765
|
-
children?: string;
|
|
1766
|
-
};
|
|
1767
|
-
declare type LinkPropsWithOrWithoutIcon = LinkWithIconProps | LinkWithoutIconProps;
|
|
1768
|
-
declare type LinkAnchorVariantProps = LinkPropsWithOrWithoutIcon & {
|
|
1769
|
-
variant?: 'anchor';
|
|
1770
|
-
href?: string;
|
|
1771
|
-
target?: string;
|
|
1772
|
-
rel?: string;
|
|
1773
|
-
isDisabled?: undefined;
|
|
1774
|
-
};
|
|
1775
|
-
declare type LinkButtonVariantProps = LinkPropsWithOrWithoutIcon & {
|
|
1776
|
-
variant?: 'button';
|
|
1777
|
-
isDisabled?: boolean;
|
|
1778
|
-
href?: undefined;
|
|
1779
|
-
target?: undefined;
|
|
1780
|
-
rel?: undefined;
|
|
1781
|
-
};
|
|
1782
|
-
declare type LinkProps = LinkAnchorVariantProps | LinkButtonVariantProps;
|
|
1783
|
-
declare const Link: ({ children, icon, iconPosition, isDisabled, onClick, variant, href, target, rel, accessibilityLabel, size, }: LinkProps) => ReactElement;
|
|
1784
|
-
|
|
1785
1997
|
declare type Assertiveness = AriaAttributes['liveRegion'];
|
|
1786
1998
|
|
|
1787
1999
|
declare function announce(message: string, _assertiveness?: Assertiveness): void;
|
|
@@ -2091,4 +2303,4 @@ declare const VisuallyHidden: ({ children }: VisuallyHiddenProps) => JSX.Element
|
|
|
2091
2303
|
|
|
2092
2304
|
declare const screenReaderStyles: CSSObject;
|
|
2093
2305
|
|
|
2094
|
-
export { Alert, AlertTriangleIcon as AlertOctagonIcon, AlertProps, AlertTriangleIcon$1 as AlertTriangleIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, ArrowUpRightIcon, Badge, BadgeProps, BladeProvider, BladeProviderProps, Button, ButtonProps, CheckCircleIcon, CheckIcon, Checkbox, CheckboxGroup, CheckboxGroupProps, CheckboxProps, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, Code, CodeProps, Counter, CounterProps, CreditCardIcon, DollarIcon, DownloadIcon, EditIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileTextIcon, Heading, HeadingProps, HelpCircleIcon, HistoryIcon, HomeIcon, IconButton, IconButtonProps, IconComponent, IconProps, IconSize, Indicator, IndicatorProps, InfoIcon, Link, LinkIcon, LinkProps, LockIcon, MailIcon, MinusIcon, OTPInput, OTPInputProps, PasswordInput, PasswordInputProps, PauseIcon, PlusIcon, Radio, RadioGroup, RadioGroupProps, RadioProps, RefreshLeftIcon, RotateCounterClockWiseIcon, RupeeIcon, SearchIcon, SettingsIcon, SkipNavContent, SkipNavLink, SlashIcon, Spinner, SpinnerProps, Text, TextArea, TextAreaProps, TextInput, TextInputProps, TextProps, TextVariant, Theme, Title, TitleProps, TrashIcon, TrendingDownIcon, TrendingUpIcon, UsersIcon, VisuallyHidden, VisuallyHiddenProps, announce, clearAnnouncer, destroyAnnouncer, getTextProps, screenReaderStyles, useTheme };
|
|
2306
|
+
export { Alert, AlertTriangleIcon as AlertOctagonIcon, AlertProps, AlertTriangleIcon$1 as AlertTriangleIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, ArrowUpRightIcon, Badge, BadgeProps, BladeProvider, BladeProviderProps, Button, ButtonProps, Card, CardBody, CardFooter, CardFooterAction, CardFooterLeading, CardFooterTrailing, CardHeader, CardHeaderBadge, CardHeaderCounter, CardHeaderIcon, CardHeaderIconButton, CardHeaderLeading, CardHeaderLink, CardHeaderText, CardHeaderTrailing, CardProps, CheckCircleIcon, CheckIcon, Checkbox, CheckboxGroup, CheckboxGroupProps, CheckboxProps, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, Code, CodeProps, Counter, CounterProps, CreditCardIcon, DollarIcon, DownloadIcon, EditIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileTextIcon, Heading, HeadingProps, HelpCircleIcon, HistoryIcon, HomeIcon, IconButton, IconButtonProps, IconComponent, IconProps, IconSize, Indicator, IndicatorProps, InfoIcon, Link, LinkIcon, LinkProps, LockIcon, MailIcon, MinusIcon, OTPInput, OTPInputProps, PasswordInput, PasswordInputProps, PauseIcon, PlusIcon, Radio, RadioGroup, RadioGroupProps, RadioProps, RefreshLeftIcon, RotateCounterClockWiseIcon, RupeeIcon, SearchIcon, SettingsIcon, SkipNavContent, SkipNavLink, SlashIcon, Spinner, SpinnerProps, Text, TextArea, TextAreaProps, TextInput, TextInputProps, TextProps, TextVariant, Theme, Title, TitleProps, TrashIcon, TrendingDownIcon, TrendingUpIcon, UsersIcon, VisuallyHidden, VisuallyHiddenProps, announce, clearAnnouncer, destroyAnnouncer, getTextProps, screenReaderStyles, useTheme };
|
|
@@ -2512,6 +2512,8 @@ var Symbol = _Symbol;
|
|
|
2512
2512
|
var symbolProto = Symbol ? Symbol.prototype : undefined;
|
|
2513
2513
|
symbolProto ? symbolProto.valueOf : undefined;
|
|
2514
2514
|
|
|
2515
|
+
var getComponentId=function getComponentId(component){var _component$type;if(!React__default.isValidElement(component))return null;return (_component$type=component.type)==null?void 0:_component$type.componentId;};var isValidAllowedChildren=function isValidAllowedChildren(component,id){return getComponentId(component)===id;};
|
|
2516
|
+
|
|
2515
2517
|
var accessibilityValue={valueMax:'max',valueMin:'min',valueNow:'now',valueText:'text'};var accessibilityState={selected:'selected',disabled:'disabled',expanded:'expanded',busy:'busy',checked:'checked'};var accessibilityValueKeys=Object.keys(accessibilityValue);var accessibilityStateKeys=Object.keys(accessibilityState);var accessibilityMap=_extends({},accessibilityState,accessibilityValue,{activeDescendant:'accessibilityActiveDescendant',atomic:'accessibilityAtomic',autoComplete:'accessibilityAutoComplete',colCount:'accessibilityColCount',colIndex:'accessibilityColIndex',colSpan:'accessibilityColSpan',controls:'accessibilityControls',describedBy:'accessibilityDescribedBy',details:'accessibilityDetails',errorMessage:'accessibilityErrorMessage',flowTo:'accessibilityFlowTo',hasPopup:'accessibilityHasPopup',hidden:'accessibilityHidden',invalid:'accessibilityInvalid',keyShortcuts:'accessibilityKeyShortcuts',label:'accessibilityLabel',labelledBy:'accessibilityLabelledBy',liveRegion:'accessibilityLiveRegion',modal:'accessibilityModal',multiline:'accessibilityMultiline',multiSelectable:'accessibilityMultiSelectable',orientation:'accessibilityOrientation',owns:'accessibilityOwns',placeholder:'accessibilityPlaceholder',posInSet:'accessibilityPosInSet',pressed:'accessibilityPressed',readOnly:'accessibilityReadOnly',required:'accessibilityRequired',role:'accessibilityRole',roleDescription:'accessibilityRoleDescription',rowCount:'accessibilityRowCount',rowIndex:'accessibilityRowIndex',rowSpan:'accessibilityRowSpan',setSize:'accessibilitySetSize',sort:'accessibilitySort',current:'accessibilityCurrent',dropEffect:'accessibilityDropEffect',grabbed:'accessibilityGrabbed',level:'accessibilityLevel',relevant:'accessibilityRelevant'});var accessibilityRoleMap={alert:'alert',button:'button',checkbox:'checkbox',combobox:'combobox',image:'image',link:'link',menu:'menu',menubar:'menubar',menuitem:'menuitem',progressbar:'progressbar',radio:'radio',radiogroup:'radiogroup',scrollbar:'scrollbar',search:'search',spinbutton:'spinbutton',switch:'switch',tab:'tab',tablist:'tablist',timer:'timer',togglebutton:'togglebutton',toolbar:'toolbar',heading:'header',slider:'adjustable',img:'image',presentation:'none',region:'summary',imagebutton:'imagebutton',keyboardkey:'keyboardkey',label:'label',text:'text'};
|
|
2516
2518
|
|
|
2517
2519
|
var makeAccessible=function makeAccessible(props){var newProps={};for(var key in props){var propKey=key;var propValue=props[propKey];var accessibilityAttribute=accessibilityMap[propKey];if(accessibilityStateKeys.includes(propKey)){newProps.accessibilityState=_extends({},newProps.accessibilityState,_defineProperty$1({},accessibilityAttribute,propValue));continue;}if(accessibilityValueKeys.includes(propKey)){newProps.accessibilityValue=_extends({},newProps.accessibilityValue,_defineProperty$1({},accessibilityAttribute,propValue));continue;}if(propKey==='hidden'){if(propValue===true){newProps.accessibilityElementsHidden=true;newProps.importantForAccessibility='no-hide-descendants';}delete newProps.accessibilityHidden;continue;}if(accessibilityAttribute){newProps[accessibilityAttribute]=propValue;}else {console.warn("[Blade: makeAccessible]: No mapping found for "+propKey+". Make sure you have entered valid key");}}if(newProps.accessibilityRole){var role=accessibilityRoleMap[newProps.accessibilityRole];newProps.accessibilityRole=role;if(!role){var validRoles=Object.keys(accessibilityRoleMap).join(', ');console.log("[Blade: makeAccessible]: Unsupported accessibility role for react-native. Expected one of "+validRoles+" but found "+props.role);delete newProps.accessibilityRole;}}return newProps;};
|
|
@@ -3325,13 +3327,13 @@ var StyledPressable$1=styled.Pressable({alignSelf:'center'});var StyledIconButto
|
|
|
3325
3327
|
|
|
3326
3328
|
var IconButton=function IconButton(_ref){var icon=_ref.icon,onClick=_ref.onClick,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size,_ref$contrast=_ref.contrast,contrast=_ref$contrast===void 0?'low':_ref$contrast,accessibilityLabel=_ref.accessibilityLabel;return jsx(StyledIconButton,{onClick:onClick,contrast:contrast,size:size,icon:icon,accessibilityLabel:accessibilityLabel});};
|
|
3327
3329
|
|
|
3328
|
-
var getSpacingValue=function getSpacingValue(_ref){var value=_ref.value,theme=_ref.theme;if(value==='auto')return 'auto';if(typeof value==='number'){return makeSpace(value);}return value?makeSpace(get_1(theme,value)):undefined;};var getBoxStyles=function getBoxStyles(_ref2){var theme=_ref2.theme,display=_ref2.display,flex=_ref2.flex,flexWrap=_ref2.flexWrap,flexDirection=_ref2.flexDirection,flexGrow=_ref2.flexGrow,alignItems=_ref2.alignItems,alignContent=_ref2.alignContent,justifyContent=_ref2.justifyContent,alignSelf=_ref2.alignSelf,overflow=_ref2.overflow,paddingTop=_ref2.paddingTop,paddingBottom=_ref2.paddingBottom,paddingLeft=_ref2.paddingLeft,paddingRight=_ref2.paddingRight,marginTop=_ref2.marginTop,marginBottom=_ref2.marginBottom,marginLeft=_ref2.marginLeft,marginRight=_ref2.marginRight,gap=_ref2.gap,width=_ref2.width,height=_ref2.height,minHeight=_ref2.minHeight,minWidth=_ref2.minWidth,maxHeight=_ref2.maxHeight,maxWidth=_ref2.maxWidth,position=_ref2.position,transform=_ref2.transform,top=_ref2.top,left=_ref2.left,right=_ref2.right,bottom=_ref2.bottom,background=_ref2.background,zIndex=_ref2.zIndex;return {display:display,flex:flex,flexWrap:flexWrap,flexGrow:flexGrow,flexDirection:flexDirection,alignItems:alignItems,alignContent:alignContent,justifyContent:justifyContent,alignSelf:alignSelf,overflow:overflow,position:position,top:top,right:right,bottom:bottom,left:left,paddingTop:getSpacingValue({value:paddingTop,theme:theme}),paddingBottom:getSpacingValue({value:paddingBottom,theme:theme}),paddingLeft:getSpacingValue({value:paddingLeft,theme:theme}),paddingRight:getSpacingValue({value:paddingRight,theme:theme}),marginTop:getSpacingValue({value:marginTop,theme:theme}),marginBottom:getSpacingValue({value:marginBottom,theme:theme}),marginLeft:getSpacingValue({value:marginLeft,theme:theme}),marginRight:getSpacingValue({value:marginRight,theme:theme}),gap:getSpacingValue({value:gap,theme:theme}),width:width,height:height,minHeight:minHeight?makeSize(minHeight):undefined,minWidth:minWidth?makeSize(minWidth):undefined,maxHeight:maxHeight?makeSize(maxHeight):undefined,maxWidth:maxWidth?makeSize(maxWidth):undefined,transform:transform,background:background,zIndex:zIndex};};
|
|
3330
|
+
var getSpacingValue=function getSpacingValue(_ref){var value=_ref.value,theme=_ref.theme;if(value==='auto')return 'auto';if(typeof value==='number'){return makeSpace(value);}return value?makeSpace(get_1(theme,value)):undefined;};var getBoxStyles=function getBoxStyles(_ref2){var theme=_ref2.theme,display=_ref2.display,flex=_ref2.flex,flexWrap=_ref2.flexWrap,flexDirection=_ref2.flexDirection,flexGrow=_ref2.flexGrow,alignItems=_ref2.alignItems,alignContent=_ref2.alignContent,justifyContent=_ref2.justifyContent,alignSelf=_ref2.alignSelf,overflow=_ref2.overflow,paddingTop=_ref2.paddingTop,paddingBottom=_ref2.paddingBottom,paddingLeft=_ref2.paddingLeft,paddingRight=_ref2.paddingRight,marginTop=_ref2.marginTop,marginBottom=_ref2.marginBottom,marginLeft=_ref2.marginLeft,marginRight=_ref2.marginRight,gap=_ref2.gap,width=_ref2.width,height=_ref2.height,minHeight=_ref2.minHeight,minWidth=_ref2.minWidth,maxHeight=_ref2.maxHeight,maxWidth=_ref2.maxWidth,position=_ref2.position,transform=_ref2.transform,top=_ref2.top,left=_ref2.left,right=_ref2.right,bottom=_ref2.bottom,background=_ref2.background,zIndex=_ref2.zIndex,borderRadius=_ref2.borderRadius;return {display:display,flex:flex,flexWrap:flexWrap,flexGrow:flexGrow,flexDirection:flexDirection,alignItems:alignItems,alignContent:alignContent,justifyContent:justifyContent,alignSelf:alignSelf,overflow:overflow,position:position,top:top,right:right,bottom:bottom,left:left,paddingTop:getSpacingValue({value:paddingTop,theme:theme}),paddingBottom:getSpacingValue({value:paddingBottom,theme:theme}),paddingLeft:getSpacingValue({value:paddingLeft,theme:theme}),paddingRight:getSpacingValue({value:paddingRight,theme:theme}),marginTop:getSpacingValue({value:marginTop,theme:theme}),marginBottom:getSpacingValue({value:marginBottom,theme:theme}),marginLeft:getSpacingValue({value:marginLeft,theme:theme}),marginRight:getSpacingValue({value:marginRight,theme:theme}),gap:getSpacingValue({value:gap,theme:theme}),width:width,height:height,minHeight:minHeight?makeSize(minHeight):undefined,minWidth:minWidth?makeSize(minWidth):undefined,maxHeight:maxHeight?makeSize(maxHeight):undefined,maxWidth:maxWidth?makeSize(maxWidth):undefined,transform:transform,background:background,zIndex:zIndex,borderRadius:borderRadius?makeSize(get_1(theme,"border.radius."+borderRadius)):undefined};};
|
|
3329
3331
|
|
|
3330
3332
|
var Box=styled.View(getBoxStyles);
|
|
3331
3333
|
|
|
3332
3334
|
var getBaseTextStyles=function getBaseTextStyles(_ref){var _ref$color=_ref.color,color=_ref$color===void 0?'surface.text.normal.lowContrast':_ref$color,_ref$fontFamily=_ref.fontFamily,fontFamily=_ref$fontFamily===void 0?'text':_ref$fontFamily,_ref$fontSize=_ref.fontSize,fontSize=_ref$fontSize===void 0?200:_ref$fontSize,_ref$fontWeight=_ref.fontWeight,fontWeight=_ref$fontWeight===void 0?'regular':_ref$fontWeight,_ref$fontStyle=_ref.fontStyle,fontStyle=_ref$fontStyle===void 0?'normal':_ref$fontStyle,_ref$textDecorationLi=_ref.textDecorationLine,textDecorationLine=_ref$textDecorationLi===void 0?'none':_ref$textDecorationLi,_ref$lineHeight=_ref.lineHeight,lineHeight=_ref$lineHeight===void 0?'l':_ref$lineHeight,textAlign=_ref.textAlign,theme=_ref.theme;var textColor=get_1(theme.colors,color);var themeFontFamily=theme.typography.fonts.family[fontFamily];var themeFontSize=makeTypographySize(theme.typography.fonts.size[fontSize]);var themeFontWeight=theme.typography.fonts.weight[fontWeight];var themeLineHeight=makeTypographySize(theme.typography.lineHeights[lineHeight]);return {color:textColor,fontFamily:themeFontFamily,fontSize:themeFontSize,fontWeight:themeFontWeight,fontStyle:fontStyle,textDecorationLine:textDecorationLine,lineHeight:themeLineHeight,textAlign:textAlign,margin:0,padding:0};};
|
|
3333
3335
|
|
|
3334
|
-
var _excluded$
|
|
3336
|
+
var _excluded$4=["color","fontFamily","fontSize","fontWeight","fontStyle","textDecorationLine","lineHeight","textAlign","as"];var StyledBaseText=styled.Text(function(_ref){var color=_ref.color,fontFamily=_ref.fontFamily,fontSize=_ref.fontSize,fontWeight=_ref.fontWeight,fontStyle=_ref.fontStyle,textDecorationLine=_ref.textDecorationLine,lineHeight=_ref.lineHeight,textAlign=_ref.textAlign,as=_ref.as,props=_objectWithoutProperties(_ref,_excluded$4);if(as){throw new Error("[Blade: BaseText]: \"as\" prop is not supported for BaseText on React Native");}else {return getBaseTextStyles({color:color,fontFamily:fontFamily,fontSize:fontSize,fontWeight:fontWeight,fontStyle:fontStyle,textDecorationLine:textDecorationLine,lineHeight:lineHeight,textAlign:textAlign,theme:props.theme});}});var BaseText=function BaseText(_ref2){var id=_ref2.id,color=_ref2.color,fontFamily=_ref2.fontFamily,fontSize=_ref2.fontSize,fontWeight=_ref2.fontWeight,fontStyle=_ref2.fontStyle,textDecorationLine=_ref2.textDecorationLine,lineHeight=_ref2.lineHeight,as=_ref2.as,textAlign=_ref2.textAlign,children=_ref2.children,truncateAfterLines=_ref2.truncateAfterLines,className=_ref2.className,style=_ref2.style,_ref2$accessibilityPr=_ref2.accessibilityProps,accessibilityProps=_ref2$accessibilityPr===void 0?{}:_ref2$accessibilityPr;_ref2.componentName;return jsx(StyledBaseText,_extends({color:color,fontFamily:fontFamily,fontSize:fontSize,fontWeight:fontWeight,fontStyle:fontStyle,textDecorationLine:textDecorationLine,lineHeight:lineHeight,as:as,textAlign:textAlign,numberOfLines:truncateAfterLines,className:className,style:style,id:id},makeAccessible(accessibilityProps),metaAttribute(),{children:children}));};
|
|
3335
3337
|
|
|
3336
3338
|
var getProps$3=function getProps(_ref){var size=_ref.size,type=_ref.type,contrast=_ref.contrast;var isPlatformWeb=getPlatformType()==='browser'||getPlatformType()==='node';var colorContrast=contrast?contrast+"Contrast":'lowContrast';var props={color:"surface.text."+(type!=null?type:'normal')+"."+colorContrast,fontSize:600,fontWeight:'bold',fontStyle:'normal',lineHeight:'4xl',fontFamily:'text',accessibilityProps:isPlatformWeb?{}:{role:'heading'},componentName:'title'};if(size==='small'){props.fontSize=600;props.lineHeight='4xl';props.as=isPlatformWeb?'h3':undefined;}else if(size==='medium'){props.fontSize=700;props.lineHeight='4xl';props.as=isPlatformWeb?'h2':undefined;}else if(size==='large'){props.fontSize=1000;props.lineHeight='6xl';props.as=isPlatformWeb?'h1':undefined;}return props;};var Title=function Title(_ref2){var _ref2$size=_ref2.size,size=_ref2$size===void 0?'small':_ref2$size,_ref2$type=_ref2.type,type=_ref2$type===void 0?'normal':_ref2$type,_ref2$contrast=_ref2.contrast,contrast=_ref2$contrast===void 0?'low':_ref2$contrast,children=_ref2.children;var props=getProps$3({size:size,type:type,contrast:contrast});return jsx(BaseText,_extends({},props,{children:children}));};
|
|
3337
3339
|
|
|
@@ -3365,7 +3367,7 @@ var StyledNativeLink=styled.Pressable(_extends({},getStyledLinkStyles({}),{align
|
|
|
3365
3367
|
|
|
3366
3368
|
var useInteraction=function useInteraction(){var _useState=useState('default'),_useState2=_slicedToArray(_useState,2),currentInteraction=_useState2[0],setCurrentInteraction=_useState2[1];var onMouseEnter=function onMouseEnter(){if(currentInteraction!=='active')setCurrentInteraction('hover');};var onMouseLeave=function onMouseLeave(){if(currentInteraction!=='active')setCurrentInteraction('default');};var onFocus=function onFocus(){setCurrentInteraction('active');};var onBlur=function onBlur(){setCurrentInteraction('default');};return {onMouseEnter:onMouseEnter,onMouseLeave:onMouseLeave,onFocus:onFocus,onBlur:onBlur,currentInteraction:currentInteraction,setCurrentInteraction:setCurrentInteraction};};
|
|
3367
3369
|
|
|
3368
|
-
var _excluded$
|
|
3370
|
+
var _excluded$3=["currentInteraction","setCurrentInteraction"];var getColorToken=function getColorToken(_ref){var variant=_ref.variant,intent=_ref.intent,contrast=_ref.contrast,element=_ref.element,currentInteraction=_ref.currentInteraction,isDisabled=_ref.isDisabled,isVisited=_ref.isVisited;var state=currentInteraction;if(isDisabled&&variant=='button'){state='disabled';}if(isVisited&&variant=='anchor'&&!intent){state='visited';}if(intent&&state!=='visited'){return "feedback."+intent+".action."+element+".link."+state+"."+contrast+"Contrast";}return "action."+element+".link."+state;};var getProps=function getProps(_ref2){var theme=_ref2.theme,variant=_ref2.variant,currentInteraction=_ref2.currentInteraction,children=_ref2.children,isDisabled=_ref2.isDisabled,intent=_ref2.intent,contrast=_ref2.contrast,isVisited=_ref2.isVisited,target=_ref2.target,size=_ref2.size;var isButton=variant==='button';var props={as:isButton?'button':'a',textDecorationLine:!isButton&¤tInteraction!=='default'?'underline':'none',iconColor:getColorToken({variant:variant,intent:intent,contrast:contrast,element:'icon',currentInteraction:currentInteraction,isDisabled:isDisabled,isVisited:isVisited}),fontSize:size==='medium'?100:75,iconSize:size,iconPadding:children!=null&&children.trim()?'spacing.2':'spacing.0',textColor:getColorToken({variant:variant,intent:intent,contrast:contrast,element:'text',currentInteraction:currentInteraction,isDisabled:isDisabled,isVisited:isVisited}),focusRingColor:get_1(theme.colors,'brand.primary.400'),motionDuration:'duration.2xquick',motionEasing:'easing.standard.effective',cursor:isButton&&isDisabled?'not-allowed':'pointer',disabled:isButton&&isDisabled,role:isButton?'button':'link',defaultRel:target&&target==='_blank'?'noreferrer noopener':undefined,type:isButton?'button':undefined};return props;};var BaseLink=function BaseLink(_ref3){var children=_ref3.children,Icon=_ref3.icon,_ref3$iconPosition=_ref3.iconPosition,iconPosition=_ref3$iconPosition===void 0?'left':_ref3$iconPosition,_ref3$isDisabled=_ref3.isDisabled,isDisabled=_ref3$isDisabled===void 0?false:_ref3$isDisabled,onClick=_ref3.onClick,_ref3$variant=_ref3.variant,variant=_ref3$variant===void 0?'anchor':_ref3$variant,href=_ref3.href,target=_ref3.target,rel=_ref3.rel,intent=_ref3.intent,_ref3$contrast=_ref3.contrast,contrast=_ref3$contrast===void 0?'low':_ref3$contrast,accessibilityLabel=_ref3.accessibilityLabel,className=_ref3.className,style=_ref3.style,_ref3$size=_ref3.size,size=_ref3$size===void 0?'medium':_ref3$size;var _useState=useState(false),_useState2=_slicedToArray(_useState,2),isVisited=_useState2[0],setIsVisited=_useState2[1];var _useInteraction=useInteraction(),currentInteraction=_useInteraction.currentInteraction,setCurrentInteraction=_useInteraction.setCurrentInteraction,syntheticEvents=_objectWithoutProperties(_useInteraction,_excluded$3);var _useTheme=useTheme(),theme=_useTheme.theme;if(!Icon&&!(children!=null&&children.trim())){throw new Error("[Blade: BaseLink]: At least one of icon or text is required to render a link.");}var _getProps=getProps({theme:theme,variant:variant,currentInteraction:currentInteraction,children:children,isDisabled:isDisabled,intent:intent,contrast:contrast,isVisited:isVisited,target:target,size:size}),as=_getProps.as,textDecorationLine=_getProps.textDecorationLine,iconColor=_getProps.iconColor,iconPadding=_getProps.iconPadding,iconSize=_getProps.iconSize,fontSize=_getProps.fontSize,textColor=_getProps.textColor,focusRingColor=_getProps.focusRingColor,motionDuration=_getProps.motionDuration,motionEasing=_getProps.motionEasing,cursor=_getProps.cursor,disabled=_getProps.disabled,role=_getProps.role,defaultRel=_getProps.defaultRel,type=_getProps.type;var handleOnClick=function handleOnClick(event){if(!isVisited&&!intent&&variant==='anchor'){setIsVisited(true);}if(onClick){onClick(event);}};return jsx(StyledLink,_extends({},syntheticEvents,metaAttribute(),{accessibilityProps:_extends({},makeAccessible({role:role,label:accessibilityLabel,disabled:disabled})),variant:variant,as:as,href:href,target:target,rel:rel!=null?rel:defaultRel,onClick:handleOnClick,disabled:disabled,type:type,cursor:cursor,focusRingColor:focusRingColor,motionDuration:motionDuration,motionEasing:motionEasing,setCurrentInteraction:setCurrentInteraction,className:className,style:style,children:jsxs(Box,{display:"flex",flexDirection:"row",className:"content-container",alignItems:"center",children:[Icon&&iconPosition=='left'?jsx(Box,{paddingRight:iconPadding,display:"flex",alignItems:"center",children:jsx(Icon,{color:iconColor,size:iconSize})}):null,jsx(BaseText,{textDecorationLine:textDecorationLine,color:textColor,fontSize:fontSize,textAlign:"center",fontWeight:"bold",children:children}),Icon&&iconPosition=='right'?jsx(Box,{paddingLeft:iconPadding,display:"flex",alignItems:"center",children:jsx(Icon,{color:iconColor,size:iconSize})}):null]})}));};
|
|
3369
3371
|
|
|
3370
3372
|
var isReactNative$3=getPlatformType()==='react-native';var CloseButtonWrapper=isReactNative$3?Box:Fragment;var intentIconMap={positive:CheckCircleIcon,negative:AlertTriangleIcon,information:InfoIcon,neutral:InfoIcon,notice:AlertTriangleIcon$1};var Alert=function Alert(_ref){var description=_ref.description,title=_ref.title,_ref$isDismissable=_ref.isDismissable,isDismissable=_ref$isDismissable===void 0?true:_ref$isDismissable,onDismiss=_ref.onDismiss,_ref$contrast=_ref.contrast,contrast=_ref$contrast===void 0?'low':_ref$contrast,_ref$isFullWidth=_ref.isFullWidth,isFullWidth=_ref$isFullWidth===void 0?false:_ref$isFullWidth,_ref$intent=_ref.intent,intent=_ref$intent===void 0?'neutral':_ref$intent,actions=_ref.actions;if(!(actions!=null&&actions.primary)&&actions!=null&&actions.secondary){throw new Error('[Blade: Alert]: SecondaryAction is allowed only when PrimaryAction is defined.');}var _useTheme=useTheme(),theme=_useTheme.theme;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var isDesktop=matchedDeviceType==='desktop';var isMobile=!isDesktop;var _useState=useState(true),_useState2=_slicedToArray(_useState,2),isVisible=_useState2[0],setIsVisible=_useState2[1];var contrastType=contrast+"Contrast";var iconSize=isFullWidth?'large':'medium';var textSize=isFullWidth?'medium':'small';var Icon=intentIconMap[intent];var iconOffset='spacing.1';if(isReactNative$3){if(isFullWidth&&!title){iconOffset='spacing.1';}else if(!isFullWidth&&!title){iconOffset='spacing.0';}else if(!isFullWidth&&title){iconOffset='spacing.2';}}else if(isMobile){if(!isFullWidth&&title){iconOffset='spacing.2';}else if(isFullWidth&&!title){iconOffset='spacing.2';}}else if(isFullWidth){iconOffset='spacing.0';}var icon=jsx(Box,{marginTop:iconOffset,display:"flex",children:jsx(Icon,{color:"feedback.icon."+intent+"."+contrastType,size:iconSize})});var _title=title?jsx(Box,{marginBottom:"spacing.2",children:isFullWidth?jsx(Heading,{size:"small",contrast:contrast,children:title}):jsx(Text,{weight:"bold",contrast:contrast,children:title})}):null;var _description=jsx(Box,{marginTop:title||isReactNative$3?'spacing.0':'spacing.1',children:jsx(Text,{size:textSize,contrast:contrast,children:description})});var primaryAction=actions!=null&&actions.primary?jsx(Box,{marginRight:"spacing.5",display:isReactNative$3?'flex':'inline-flex',children:jsx(BaseButton,{size:textSize,onClick:actions.primary.onClick,intent:intent,contrast:contrast,children:actions.primary.text})}):null;var secondaryActionParams=actions!=null&&actions.secondary?{onClick:actions.secondary.onClick}:null;if(actions!=null&&actions.secondary&&secondaryActionParams&&'href'in actions.secondary){secondaryActionParams.href=actions.secondary.href;secondaryActionParams.target=actions.secondary.target;secondaryActionParams.rel=actions.secondary.rel;}var secondaryAction=actions!=null&&actions.secondary?jsx(Box,{marginRight:"spacing.4",display:isReactNative$3?'flex':'inline-flex',children:jsx(BaseLink,_extends({size:textSize,contrast:contrast,intent:intent},secondaryActionParams,{children:actions.secondary.text}))}):null;var showActionsHorizontal=isFullWidth&&isDesktop;var actionsHorizontal=showActionsHorizontal&&(primaryAction||secondaryAction)?jsxs(Box,{flexDirection:"row",alignItems:"center",children:[primaryAction,secondaryAction]}):null;var actionsVertical=!showActionsHorizontal&&(primaryAction||secondaryAction)?jsxs(Box,{marginTop:"spacing.4",flexDirection:"row",alignItems:"center",children:[primaryAction,secondaryAction]}):null;var onClickDismiss=function onClickDismiss(){if(onDismiss){onDismiss();}setIsVisible(false);};var closeButton=isDismissable?jsx(CloseButtonWrapper,{children:jsx(IconButton,{accessibilityLabel:"Dismiss alert",onClick:onClickDismiss,contrast:contrast,size:iconSize,icon:CloseIcon})}):null;var a11yProps=makeAccessible(_extends({role:isReactNative$3||intent==='negative'||intent==='notice'?'alert':'status'},intent==='notice'&&{liveRegion:'polite'}));if(!isVisible){return null;}return jsxs(StyledAlert,_extends({intent:intent,contrastType:contrastType,isFullWidth:isFullWidth,isDesktop:isDesktop},a11yProps,metaAttribute(),{children:[icon,jsxs(Box,{flex:1,paddingLeft:isFullWidth?'spacing.4':'spacing.3',paddingRight:showActionsHorizontal?'spacing.4':'spacing.2',children:[_title,_description,actionsVertical]}),actionsHorizontal,closeButton]}));};
|
|
3371
3373
|
|
|
@@ -3377,8 +3379,18 @@ var StyledBadge=styled.View(function(props){return _extends({},getStyledBadgeSty
|
|
|
3377
3379
|
|
|
3378
3380
|
var isFeedbackVariant=function isFeedbackVariant(variant){var feedbackVariants=['information','negative','neutral','notice','positive'];return feedbackVariants.includes(variant);};var getColorProps$1=function getColorProps(_ref){var variant=_ref.variant,contrast=_ref.contrast;var props={iconColor:'feedback.icon.neutral.lowContrast',textColor:'feedback.text.neutral.lowContrast',backgroundColor:'feedback.background.neutral.lowContrast'};if(isFeedbackVariant(variant)){props.iconColor="feedback.icon."+variant+"."+contrast+"Contrast";props.textColor="feedback.text."+variant+"."+contrast+"Contrast";props.backgroundColor="feedback.background."+variant+"."+contrast+"Contrast";}else {props.iconColor="badge.icon."+variant+"."+contrast+"Contrast";props.textColor="badge.text."+variant+"."+contrast+"Contrast";props.backgroundColor="badge.background."+variant+"."+contrast+"Contrast";}return props;};var Badge=function Badge(_ref2){var children=_ref2.children,_ref2$contrast=_ref2.contrast,contrast=_ref2$contrast===void 0?'low':_ref2$contrast,_ref2$fontWeight=_ref2.fontWeight,fontWeight=_ref2$fontWeight===void 0?'regular':_ref2$fontWeight,Icon=_ref2.icon,_ref2$size=_ref2.size,size=_ref2$size===void 0?'medium':_ref2$size,_ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?'neutral':_ref2$variant;if(!(children!=null&&children.trim())){throw new Error('[Blade: Badge]: Text as children is required for Badge.');}var _useTheme=useTheme(),platform=_useTheme.platform;var _getColorProps=getColorProps$1({variant:variant,contrast:contrast}),backgroundColor=_getColorProps.backgroundColor,iconColor=_getColorProps.iconColor,textColor=_getColorProps.textColor;return jsx(StyledBadge,_extends({backgroundColor:backgroundColor,size:size,platform:platform},metaAttribute(),{children:jsxs(Box,{paddingRight:horizontalPadding$1[size],paddingLeft:horizontalPadding$1[size],paddingTop:verticalPadding$1[size],paddingBottom:verticalPadding$1[size],display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",overflow:"hidden",children:[Icon?jsx(Box,{paddingRight:Boolean(Icon)?iconPadding[size]:'spacing.0',display:"flex",children:jsx(Icon,{color:iconColor,size:iconSize[size]})}):null,jsx(Text,_extends({},size==='small'?{variant:'caption'}:{variant:'body',size:'small'},{type:"normal",weight:fontWeight,truncateAfterLines:1,color:textColor,children:children}))]})}));};
|
|
3379
3381
|
|
|
3382
|
+
var _excluded$2=["children","surfaceLevel"];var isAndroid=Platform.OS==='android';var androidShadow={color:undefined,elevation:2};var CardSurfaceStyled=styled(Box)(function(_ref){var surfaceLevel=_ref.surfaceLevel,theme=_ref.theme;var backgroundColor=theme.colors.surface.background["level"+surfaceLevel].lowContrast;return {width:'100%',display:'flex',flexDirection:'column',shadowOpacity:'1',shadowRadius:theme.shadows.blurRadius.level[1],shadowColor:isAndroid?androidShadow.color:theme.shadows.color.level[1],shadowOffset:"0px "+theme.shadows.offsetY.level[1]+"px",backgroundColor:backgroundColor};});var CardSurface=function CardSurface(_ref2){var children=_ref2.children,surfaceLevel=_ref2.surfaceLevel,props=_objectWithoutProperties(_ref2,_excluded$2);var _useTheme=useTheme(),theme=_useTheme.theme;return jsx(CardSurfaceStyled,_extends({},props,{surfaceLevel:surfaceLevel,elevation:isAndroid?androidShadow.elevation:theme.shadows.androidElevation.level[1],children:children}));};
|
|
3383
|
+
|
|
3384
|
+
var CardContext=React__default.createContext(null);var useVerifyInsideCard=function useVerifyInsideCard(componentName){var context=React__default.useContext(CardContext);if(!context){throw new Error("[Blade Card]: "+componentName+" cannot be used outside of Card component");}return true;};var CardProvider=function CardProvider(_ref){var children=_ref.children;return jsx(CardContext.Provider,{value:true,children:children});};
|
|
3385
|
+
|
|
3386
|
+
var Card=function Card(_ref){var children=_ref.children,_ref$surfaceLevel=_ref.surfaceLevel,surfaceLevel=_ref$surfaceLevel===void 0?3:_ref$surfaceLevel;return jsx(CardProvider,{children:jsx(CardSurface,_extends({},metaAttribute(),{paddingLeft:"spacing.7",paddingRight:"spacing.7",paddingTop:"spacing.6",paddingBottom:"spacing.6",borderRadius:"medium",surfaceLevel:surfaceLevel,children:children}))});};var CardBody=function CardBody(_ref2){var children=_ref2.children;useVerifyInsideCard('CardBody');return jsx(Box,_extends({},metaAttribute(),{children:children}));};
|
|
3387
|
+
|
|
3388
|
+
var Link=function Link(_ref){var children=_ref.children,icon=_ref.icon,_ref$iconPosition=_ref.iconPosition,iconPosition=_ref$iconPosition===void 0?'left':_ref$iconPosition,_ref$isDisabled=_ref.isDisabled,isDisabled=_ref$isDisabled===void 0?false:_ref$isDisabled,onClick=_ref.onClick,_ref$variant=_ref.variant,variant=_ref$variant===void 0?'anchor':_ref$variant,href=_ref.href,target=_ref.target,rel=_ref.rel,accessibilityLabel=_ref.accessibilityLabel,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size;return jsx(BaseLink,_extends({},icon?{icon:icon,children:children}:{children:children},variant==='anchor'?{variant:variant,href:href,target:target,rel:rel}:{variant:variant,isDisabled:isDisabled},{iconPosition:iconPosition,onClick:onClick,accessibilityLabel:accessibilityLabel,size:size}));};
|
|
3389
|
+
|
|
3380
3390
|
var Button=function Button(_ref){var children=_ref.children,icon=_ref.icon,_ref$iconPosition=_ref.iconPosition,iconPosition=_ref$iconPosition===void 0?'left':_ref$iconPosition,_ref$isDisabled=_ref.isDisabled,isDisabled=_ref$isDisabled===void 0?false:_ref$isDisabled,_ref$isFullWidth=_ref.isFullWidth,isFullWidth=_ref$isFullWidth===void 0?false:_ref$isFullWidth,_ref$isLoading=_ref.isLoading,isLoading=_ref$isLoading===void 0?false:_ref$isLoading,onClick=_ref.onClick,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size,_ref$type=_ref.type,type=_ref$type===void 0?'button':_ref$type,_ref$variant=_ref.variant,variant=_ref$variant===void 0?'primary':_ref$variant,accessibilityLabel=_ref.accessibilityLabel;return jsx(BaseButton,_extends({},icon?{icon:icon,children:children}:{children:children},{accessibilityLabel:accessibilityLabel,iconPosition:iconPosition,isDisabled:isDisabled,isFullWidth:isFullWidth,onClick:onClick,size:size,type:type,variant:variant,isLoading:isLoading}));};
|
|
3381
3391
|
|
|
3392
|
+
var Divider=styled.View(function(_ref){var theme=_ref.theme;return {borderBottomWidth:makeSize(theme.border.width.thin),borderBottomStyle:'solid',borderColor:theme.colors.surface.border.normal.lowContrast};});
|
|
3393
|
+
|
|
3382
3394
|
var verticalPadding={small:'spacing.0',medium:'spacing.1',large:'spacing.1'};var horizontalPadding={small:'spacing.2',medium:'spacing.3',large:'spacing.3'};var maxWidth={onMobile:100,onDesktop:120};
|
|
3383
3395
|
|
|
3384
3396
|
var getStyledCounterStyles=function getStyledCounterStyles(_ref){var theme=_ref.theme,platform=_ref.platform,backgroundColor=_ref.backgroundColor;return {backgroundColor:get_1(theme.colors,backgroundColor),borderRadius:makeBorderSize(theme.border.radius.max),maxWidth:makeSize(maxWidth[platform]),display:'flex',flexWrap:'nowrap'};};
|
|
@@ -3387,6 +3399,10 @@ var StyledCounter=styled.View(function(props){return _extends({},getStyledCounte
|
|
|
3387
3399
|
|
|
3388
3400
|
var getColorProps=function getColorProps(_ref){var _ref$intent=_ref.intent,intent=_ref$intent===void 0?'neutral':_ref$intent,_ref$contrast=_ref.contrast,contrast=_ref$contrast===void 0?'low':_ref$contrast;var props={textColor:"feedback.text."+intent+"."+contrast+"Contrast",backgroundColor:"feedback.background."+intent+"."+contrast+"Contrast"};return props;};var Counter=function Counter(_ref2){var value=_ref2.value,max=_ref2.max,_ref2$intent=_ref2.intent,intent=_ref2$intent===void 0?'neutral':_ref2$intent,_ref2$contrast=_ref2.contrast,contrast=_ref2$contrast===void 0?'low':_ref2$contrast,_ref2$size=_ref2.size,size=_ref2$size===void 0?'medium':_ref2$size;var content=""+value;if(max&&value>max){content=max+"+";}var _useTheme=useTheme(),platform=_useTheme.platform;var _getColorProps=getColorProps({intent:intent,contrast:contrast}),backgroundColor=_getColorProps.backgroundColor,textColor=_getColorProps.textColor;var textSizes={small:{variant:'caption'},medium:{variant:'body',size:'small'},large:{variant:'body',size:'medium'}};return jsx(StyledCounter,{backgroundColor:backgroundColor,size:size,platform:platform,children:jsx(Box,_extends({paddingRight:horizontalPadding[size],paddingLeft:horizontalPadding[size],paddingTop:verticalPadding[size],paddingBottom:verticalPadding[size],display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",overflow:"hidden"},metaAttribute(),{children:jsx(Text,_extends({},textSizes[size],{type:"normal",weight:"regular",truncateAfterLines:1,color:textColor,children:content}))}))});};
|
|
3389
3401
|
|
|
3402
|
+
var ComponentIds={CardHeaderIcon:'CardHeaderIcon',CardHeaderCounter:'CardHeaderCounter',CardHeaderBadge:'CardHeaderBadge',CardHeaderText:'CardHeaderText',CardHeaderLink:'CardHeaderLink',CardHeaderIconButton:'CardHeaderIconButton'};var CardHeaderIcon=function CardHeaderIcon(_ref){var Icon=_ref.icon;useVerifyInsideCard('CardHeaderIcon');return jsx(Icon,{color:"surface.text.normal.lowContrast",size:"xlarge"});};CardHeaderIcon.componentId=ComponentIds.CardHeaderIcon;var CardHeaderCounter=function CardHeaderCounter(props){useVerifyInsideCard('CardHeaderCounter');return jsx(Counter,_extends({},props));};CardHeaderCounter.componentId=ComponentIds.CardHeaderCounter;var CardHeaderBadge=function CardHeaderBadge(props){useVerifyInsideCard('CardHeaderBadge');return jsx(Badge,_extends({},props));};CardHeaderBadge.componentId=ComponentIds.CardHeaderBadge;var CardHeaderText=function CardHeaderText(props){useVerifyInsideCard('CardHeaderText');return jsx(Text,_extends({},props));};CardHeaderText.componentId=ComponentIds.CardHeaderText;var CardHeaderLink=function CardHeaderLink(props){useVerifyInsideCard('CardHeaderLink');return jsx(Link,_extends({},props));};CardHeaderLink.componentId=ComponentIds.CardHeaderLink;var CardHeaderIconButton=function CardHeaderIconButton(props){useVerifyInsideCard('CardHeaderIconButton');return jsx(Box,{width:makeSpace(minHeight.xsmall),children:jsx(Button,_extends({},props,{variant:"tertiary",size:"xsmall",iconPosition:"left",isFullWidth:true}))});};CardHeaderIconButton.componentId=ComponentIds.CardHeaderIconButton;var CardHeader=function CardHeader(_ref2){var children=_ref2.children;useVerifyInsideCard('CardHeader');return jsxs(Box,_extends({marginBottom:"spacing.7"},metaAttribute(),{children:[jsx(Box,{marginBottom:"spacing.7",display:"flex",flexDirection:"row",justifyContent:"space-between",children:children}),jsx(Divider,{})]}));};var CardHeaderLeading=function CardHeaderLeading(_ref3){var title=_ref3.title,subtitle=_ref3.subtitle,prefix=_ref3.prefix,suffix=_ref3.suffix;useVerifyInsideCard('CardHeaderLeading');if(prefix&&!isValidAllowedChildren(prefix,ComponentIds.CardHeaderIcon)){throw new Error("[Blade CardHeaderLeading]: Only `"+ComponentIds.CardHeaderIcon+"` component is accepted in prefix");}if(suffix&&!isValidAllowedChildren(suffix,ComponentIds.CardHeaderCounter)){throw new Error("[Blade CardHeaderLeading]: Only `"+ComponentIds.CardHeaderCounter+"` component is accepted in prefix");}return jsxs(Box,{flex:1,display:"flex",flexDirection:"row",children:[jsx(Box,{marginRight:"spacing.3",alignSelf:"center",display:"flex",children:prefix}),jsxs(Box,{children:[jsxs(Box,{display:"flex",flexDirection:"row",alignItems:"center",flexWrap:"wrap",children:[jsx(Heading,{size:"small",variant:"regular",type:"normal",children:title}),jsx(Box,{marginLeft:"spacing.3",children:suffix})]}),jsx(Text,{variant:"body",size:"small",weight:"regular",children:subtitle})]})]});};var headerTrailingAllowedComponents=[ComponentIds.CardHeaderLink,ComponentIds.CardHeaderText,ComponentIds.CardHeaderIconButton,ComponentIds.CardHeaderBadge];var CardHeaderTrailing=function CardHeaderTrailing(_ref4){var visual=_ref4.visual;useVerifyInsideCard('CardHeaderTrailing');if(visual&&!headerTrailingAllowedComponents.includes(getComponentId(visual))){throw new Error("[Blade CardHeaderTrailing]: Only one of `"+headerTrailingAllowedComponents.join(', ')+"` component is accepted in visual");}return jsx(Box,{alignSelf:"center",children:visual});};
|
|
3403
|
+
|
|
3404
|
+
var useIsMobile=function useIsMobile(){var _useTheme=useTheme(),theme=_useTheme.theme;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;return matchedDeviceType==='mobile';};var CardFooter=function CardFooter(_ref){var children=_ref.children;var isMobile=useIsMobile();useVerifyInsideCard('CardFooter');return jsxs(Box,_extends({marginTop:"auto"},metaAttribute(),{children:[jsx(Box,{marginTop:"spacing.7"}),jsx(Divider,{}),jsx(Box,{marginTop:"spacing.7",display:"flex",flexDirection:isMobile?'column':'row',justifyContent:"space-between",alignItems:isMobile?'stretch':'center',children:children})]}));};var CardFooterLeading=function CardFooterLeading(_ref2){var title=_ref2.title,subtitle=_ref2.subtitle;useVerifyInsideCard('CardFooterLeading');return jsxs(Box,{children:[title&&jsx(Text,{variant:"body",size:"medium",weight:"bold",children:title}),subtitle&&jsx(Text,{variant:"body",size:"small",weight:"regular",children:subtitle})]});};var CardFooterTrailing=function CardFooterTrailing(_ref3){var actions=_ref3.actions;var isMobile=useIsMobile();useVerifyInsideCard('CardFooterTrailing');return jsxs(Box,{display:"flex",flexDirection:"row",alignSelf:isMobile?'auto':'center',marginTop:isMobile?'spacing.5':'spacing.0',marginLeft:isMobile?'spacing.0':'spacing.5',children:[jsx(Box,{flexGrow:1,children:actions!=null&&actions.secondary?jsx(Button,_extends({isFullWidth:true,size:"medium",variant:"secondary"},actions.secondary,{children:actions.secondary.text})):null}),jsx(Box,{marginLeft:"spacing.5"}),jsx(Box,{flexGrow:1,children:actions!=null&&actions.primary?jsx(Button,_extends({isFullWidth:true,size:"medium"},actions.primary,{children:actions.primary.text})):null})]});};
|
|
3405
|
+
|
|
3390
3406
|
/**
|
|
3391
3407
|
* Checks if `value` is `undefined`.
|
|
3392
3408
|
*
|
|
@@ -3441,7 +3457,7 @@ var screenReaderStyles={border:0,clip:'rect(0 0 0 0)',clipPath:'inset(50%)',heig
|
|
|
3441
3457
|
|
|
3442
3458
|
var StyledVisuallyHidden=styled.View(screenReaderStyles);var VisuallyHidden=function VisuallyHidden(_ref){var children=_ref.children;return jsx(StyledVisuallyHidden,{children:children});};
|
|
3443
3459
|
|
|
3444
|
-
var FormLabel=function FormLabel(_ref){var _ref$as=_ref.as,as=_ref$as===void 0?'span':_ref$as,_ref$position=_ref.position,position=_ref$position===void 0?'top':_ref$position,_ref$necessityIndicat=_ref.necessityIndicator,necessityIndicator=_ref$necessityIndicat===void 0?'none':_ref$necessityIndicat,accessibilityText=_ref.accessibilityText,children=_ref.children,id=_ref.id,htmlFor=_ref.htmlFor;var _useTheme=useTheme(),theme=_useTheme.theme;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var isDesktop=matchedDeviceType==='desktop';var isReactNative=getPlatformType()==='react-native';var necessityLabel=null;var isLabelLeftPositioned=position==='left'&&isDesktop;if(necessityIndicator==='optional'){necessityLabel=jsx(Text,{variant:"caption",weight:"regular",type:"placeholder",children:"(optional)"});}if(necessityIndicator==='required'){necessityLabel=jsx(BaseText,{lineHeight:"s",fontFamily:"text",fontStyle:"normal",fontSize:75,fontWeight:"bold",color:"feedback.text.negative.lowContrast",children:"*"});}var computedAccessibilityNode=jsxs(VisuallyHidden,{children:[necessityIndicator!=='none'&&jsx(Text,{children:necessityIndicator}),jsx(Text,{children:accessibilityText})]});var textNode=jsxs(Box,{gap:necessityIndicator==='optional'?'spacing.2':'spacing.0',display:"flex",flexDirection:"row",alignItems:"center",flexWrap:"wrap",children:[
|
|
3460
|
+
var FormLabel=function FormLabel(_ref){var _ref$as=_ref.as,as=_ref$as===void 0?'span':_ref$as,_ref$position=_ref.position,position=_ref$position===void 0?'top':_ref$position,_ref$necessityIndicat=_ref.necessityIndicator,necessityIndicator=_ref$necessityIndicat===void 0?'none':_ref$necessityIndicat,accessibilityText=_ref.accessibilityText,children=_ref.children,id=_ref.id,htmlFor=_ref.htmlFor;var _useTheme=useTheme(),theme=_useTheme.theme;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var isDesktop=matchedDeviceType==='desktop';var isReactNative=getPlatformType()==='react-native';var necessityLabel=null;var isLabelLeftPositioned=position==='left'&&isDesktop;if(necessityIndicator==='optional'){necessityLabel=jsx(Text,{variant:"caption",weight:"regular",type:"placeholder",children:"(optional)"});}if(necessityIndicator==='required'){necessityLabel=jsx(BaseText,{lineHeight:"s",fontFamily:"text",fontStyle:"normal",fontSize:75,fontWeight:"bold",color:"feedback.text.negative.lowContrast",children:"*"});}var computedAccessibilityNode=jsxs(VisuallyHidden,{children:[necessityIndicator!=='none'&&jsx(Text,{children:necessityIndicator}),jsx(Text,{children:accessibilityText})]});var textNode=jsxs(Box,{gap:necessityIndicator==='optional'?'spacing.2':'spacing.0',display:"flex",flexDirection:"row",alignItems:"center",flexWrap:"wrap",children:[jsx(Text,{type:"subdued",variant:"body",size:isLabelLeftPositioned?'medium':'small',weight:"bold",children:children}),computedAccessibilityNode,necessityLabel]});if(isReactNative){return jsx(Box,{marginRight:"spacing.5",marginBottom:"spacing.2",children:textNode});}var Component=as;var width=isLabelLeftPositioned&&isDesktop?'120px':'auto';return jsx(Component,{htmlFor:htmlFor,style:{width:width,flexShrink:0,marginRight:makeSpace(theme.spacing[5]),wordBreak:'break-all'},id:id,children:jsx(Box,{marginBottom:isLabelLeftPositioned?'spacing.0':'spacing.2',children:textNode})});};
|
|
3445
3461
|
|
|
3446
3462
|
var StyledSelectorLabel=styled.Pressable(function(_ref){var theme=_ref.theme;return {display:'flex',flexDirection:'row',marginTop:makeSpace(theme.spacing[1]),marginBottom:makeSpace(theme.spacing[1])};});var SelectorLabel=function SelectorLabel(_ref2){var children=_ref2.children,inputProps=_ref2.inputProps;return jsx(StyledSelectorLabel,_extends({},inputProps,{children:children}));};
|
|
3447
3463
|
|
|
@@ -3477,7 +3493,7 @@ var CharacterCounter=function CharacterCounter(_ref){var currentCount=_ref.curre
|
|
|
3477
3493
|
|
|
3478
3494
|
var Spinner=function Spinner(_ref){var _ref2;var label=_ref.label,labelPosition=_ref.labelPosition,accessibilityLabel=_ref.accessibilityLabel,_ref$contrast=_ref.contrast,contrast=_ref$contrast===void 0?'low':_ref$contrast,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size;return jsx(BaseSpinner,{label:label,labelPosition:labelPosition,accessibilityLabel:(_ref2=accessibilityLabel!=null?accessibilityLabel:label)!=null?_ref2:'Loading',contrast:contrast,size:size});};
|
|
3479
3495
|
|
|
3480
|
-
var getKeyboardAndAutocompleteProps=function getKeyboardAndAutocompleteProps(_ref){var _ref$type=_ref.type,type=_ref$type===void 0?'text':_ref$type,keyboardReturnKeyType=_ref.keyboardReturnKeyType,autoCompleteSuggestionType=_ref.autoCompleteSuggestionType;var keyboardAndAutocompleteProps={type:type,keyboardType:'text',keyboardReturnKeyType:'default',autoCompleteSuggestionType:'none'};var keyboardConfigMap={text:{keyboardType:'text',keyboardReturnKeyType:'default',autoCompleteSuggestionType:'none'},telephone:{keyboardType:'telephone',keyboardReturnKeyType:'done',autoCompleteSuggestionType:'telephone'},email:{keyboardType:'email',keyboardReturnKeyType:'done',autoCompleteSuggestionType:'email'},url:{keyboardType:'url',keyboardReturnKeyType:'go',autoCompleteSuggestionType:'none'},
|
|
3496
|
+
var getKeyboardAndAutocompleteProps=function getKeyboardAndAutocompleteProps(_ref){var _ref$type=_ref.type,type=_ref$type===void 0?'text':_ref$type,keyboardReturnKeyType=_ref.keyboardReturnKeyType,autoCompleteSuggestionType=_ref.autoCompleteSuggestionType;var keyboardAndAutocompleteProps={type:type,keyboardType:'text',keyboardReturnKeyType:'default',autoCompleteSuggestionType:'none'};var keyboardConfigMap={text:{keyboardType:'text',keyboardReturnKeyType:'default',autoCompleteSuggestionType:'none'},telephone:{keyboardType:'telephone',keyboardReturnKeyType:'done',autoCompleteSuggestionType:'telephone'},email:{keyboardType:'email',keyboardReturnKeyType:'done',autoCompleteSuggestionType:'email'},url:{keyboardType:'url',keyboardReturnKeyType:'go',autoCompleteSuggestionType:'none'},number:{keyboardType:'decimal',keyboardReturnKeyType:'done',autoCompleteSuggestionType:'none'},search:{keyboardType:'search',keyboardReturnKeyType:'search',autoCompleteSuggestionType:'none'}};var keyboardConfig=keyboardConfigMap[type];keyboardAndAutocompleteProps.keyboardType=keyboardConfig.keyboardType;keyboardAndAutocompleteProps.keyboardReturnKeyType=keyboardReturnKeyType!=null?keyboardReturnKeyType:keyboardConfig.keyboardReturnKeyType;keyboardAndAutocompleteProps.autoCompleteSuggestionType=autoCompleteSuggestionType!=null?autoCompleteSuggestionType:keyboardConfig.autoCompleteSuggestionType;if(type==='number'){keyboardAndAutocompleteProps.type='text';}if(type==='search'){keyboardAndAutocompleteProps.type='text';}return keyboardAndAutocompleteProps;};var isReactNative$2=function isReactNative(_textInputRef){return getPlatformType()==='react-native';};var TextInput=function TextInput(_ref2){var _Boolean;var label=_ref2.label,_ref2$labelPosition=_ref2.labelPosition,labelPosition=_ref2$labelPosition===void 0?'top':_ref2$labelPosition,placeholder=_ref2.placeholder,_ref2$type=_ref2.type,type=_ref2$type===void 0?'text':_ref2$type,defaultValue=_ref2.defaultValue,name=_ref2.name,value=_ref2.value,maxCharacters=_ref2.maxCharacters,_onChange=_ref2.onChange,onBlur=_ref2.onBlur,isDisabled=_ref2.isDisabled,necessityIndicator=_ref2.necessityIndicator,validationState=_ref2.validationState,errorText=_ref2.errorText,helpText=_ref2.helpText,successText=_ref2.successText,isRequired=_ref2.isRequired,icon=_ref2.icon,prefix=_ref2.prefix,showClearButton=_ref2.showClearButton,onClearButtonClick=_ref2.onClearButtonClick,isLoading=_ref2.isLoading,suffix=_ref2.suffix,autoFocus=_ref2.autoFocus,keyboardReturnKeyType=_ref2.keyboardReturnKeyType,autoCompleteSuggestionType=_ref2.autoCompleteSuggestionType;var textInputRef=React__default.useRef(null);var _useState=useState((_Boolean=Boolean(defaultValue!=null?defaultValue:value))!=null?_Boolean:false),_useState2=_slicedToArray(_useState,2),shouldShowClearButton=_useState2[0],setShouldShowClearButton=_useState2[1];var renderInteractionElement=function renderInteractionElement(){if(isLoading){return jsx(Spinner,{accessibilityLabel:"Loading Content"});}if(shouldShowClearButton){return jsx(IconButton,{size:"medium",icon:CloseIcon,onClick:function onClick(){var _textInputRef$current;if(isEmpty_1(value)&&textInputRef.current){if(isReactNative$2(textInputRef.current)){textInputRef.current.clear();textInputRef.current.focus();}else if(textInputRef.current instanceof HTMLInputElement){textInputRef.current.value='';textInputRef.current.focus();}}onClearButtonClick==null?void 0:onClearButtonClick();textInputRef==null?void 0:(_textInputRef$current=textInputRef.current)==null?void 0:_textInputRef$current.focus();setShouldShowClearButton(false);},accessibilityLabel:"Clear Input Content"});}return null;};return jsx(BaseInput,_extends({id:"textinput",componentName:"textinput",ref:textInputRef,label:label,labelPosition:labelPosition,placeholder:placeholder,defaultValue:defaultValue,value:value,name:name,maxCharacters:maxCharacters,onChange:function onChange(_ref3){var name=_ref3.name,value=_ref3.value;if(showClearButton&&value!=null&&value.length){setShouldShowClearButton(true);}if(shouldShowClearButton&&!(value!=null&&value.length)){setShouldShowClearButton(false);}_onChange==null?void 0:_onChange({name:name,value:value});},onBlur:onBlur,isDisabled:isDisabled,necessityIndicator:necessityIndicator,isRequired:isRequired,leadingIcon:icon,prefix:prefix,interactionElement:renderInteractionElement(),suffix:suffix,validationState:validationState,errorText:errorText,helpText:helpText,successText:successText,trailingFooterSlot:function trailingFooterSlot(value){var _value$length;return maxCharacters?jsx(Box,{marginTop:"spacing.2",marginRight:"spacing.1",children:jsx(CharacterCounter,{currentCount:(_value$length=value==null?void 0:value.length)!=null?_value$length:0,maxCount:maxCharacters})}):null;},autoFocus:autoFocus},getKeyboardAndAutocompleteProps({type:type,keyboardReturnKeyType:keyboardReturnKeyType,autoCompleteSuggestionType:autoCompleteSuggestionType})));};
|
|
3481
3497
|
|
|
3482
3498
|
var PasswordInput=function PasswordInput(_ref){var label=_ref.label,_ref$labelPosition=_ref.labelPosition,labelPosition=_ref$labelPosition===void 0?'top':_ref$labelPosition,_ref$showRevealButton=_ref.showRevealButton,showRevealButton=_ref$showRevealButton===void 0?true:_ref$showRevealButton,maxCharacters=_ref.maxCharacters,validationState=_ref.validationState,errorText=_ref.errorText,successText=_ref.successText,helpText=_ref.helpText,_ref$isDisabled=_ref.isDisabled,isDisabled=_ref$isDisabled===void 0?false:_ref$isDisabled,defaultValue=_ref.defaultValue,placeholder=_ref.placeholder,_ref$isRequired=_ref.isRequired,isRequired=_ref$isRequired===void 0?false:_ref$isRequired,_ref$necessityIndicat=_ref.necessityIndicator,necessityIndicator=_ref$necessityIndicat===void 0?'none':_ref$necessityIndicat,value=_ref.value,onChange=_ref.onChange,onFocus=_ref.onFocus,onBlur=_ref.onBlur,name=_ref.name,_ref$autoFocus=_ref.autoFocus,autoFocus=_ref$autoFocus===void 0?false:_ref$autoFocus,_ref$keyboardReturnKe=_ref.keyboardReturnKeyType,keyboardReturnKeyType=_ref$keyboardReturnKe===void 0?'done':_ref$keyboardReturnKe,autoCompleteSuggestionType=_ref.autoCompleteSuggestionType;var _useState=useState(false),_useState2=_slicedToArray(_useState,2),isRevealed=_useState2[0],setIsRevealed=_useState2[1];var isEnabled=!isDisabled;var isRevealedAndEnabled=isRevealed&&isEnabled;var toggleIsRevealed=function toggleIsRevealed(){return setIsRevealed(function(revealed){return !revealed;});};var accessibilityLabel=isRevealedAndEnabled?'Hide password':'Show password';var type=isRevealedAndEnabled?'text':'password';var revealButtonIcon=isRevealedAndEnabled?EyeOffIcon:EyeIcon;var revealButton=showRevealButton&&!isDisabled?jsx(IconButton,{size:"medium",icon:revealButtonIcon,onClick:toggleIsRevealed,accessibilityLabel:accessibilityLabel}):null;var trailingFooterSlot=function trailingFooterSlot(value){var _value$length;return maxCharacters?jsx(Box,{marginTop:"spacing.2",marginRight:"spacing.1",children:jsx(CharacterCounter,{currentCount:(_value$length=value==null?void 0:value.length)!=null?_value$length:0,maxCount:maxCharacters})}):null;};return jsx(BaseInput,{componentName:"password-input",id:"password-field",label:label,labelPosition:labelPosition,type:type,interactionElement:revealButton,trailingFooterSlot:trailingFooterSlot,maxCharacters:maxCharacters,validationState:validationState,errorText:errorText,successText:successText,helpText:helpText,isDisabled:isDisabled,defaultValue:defaultValue,placeholder:placeholder,isRequired:isRequired,necessityIndicator:necessityIndicator,value:value,onChange:onChange,onBlur:onBlur,onFocus:onFocus,name:name,autoFocus:autoFocus,autoCompleteSuggestionType:autoCompleteSuggestionType,keyboardReturnKeyType:keyboardReturnKeyType});};
|
|
3483
3499
|
|
|
@@ -3489,8 +3505,6 @@ var Circle=function Circle(_ref){var cx=_ref.cx,cy=_ref.cy,x=_ref.x,y=_ref.y,r=_
|
|
|
3489
3505
|
|
|
3490
3506
|
var Indicator=function Indicator(_ref){var accessibilityLabel=_ref.accessibilityLabel,children=_ref.children,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size,_ref$intent=_ref.intent,intent=_ref$intent===void 0?'neutral':_ref$intent;var _useTheme=useTheme(),theme=_useTheme.theme;var fillColor=theme.colors.feedback.background[intent].highContrast;var strokeColor=theme.colors.brand.gray.a100.highContrast;var getDimension=useCallback(function(){switch(size){case'small':return {svgSize:'6',textSize:'small'};case'large':return {svgSize:'10',textSize:'medium'};default:return {svgSize:'8',textSize:'medium'};}},[size]);var dimensions=getDimension();var isReactNative=getPlatformType()==='react-native';var isWeb=!isReactNative;var a11yProps=makeAccessible(_extends({label:accessibilityLabel!=null?accessibilityLabel:children},isWeb&&{role:'status'}));return jsxs(Box,_extends({display:"flex",flexDirection:"row",alignItems:"center"},a11yProps,metaAttribute(),{children:[jsxs(Svg,{width:dimensions.svgSize,height:dimensions.svgSize,viewBox:"0 0 10 10",fill:"none",children:[jsx(Circle,{cx:"5",cy:"5",r:"5",fill:fillColor}),jsx(Circle,{cx:"5",cy:"5",r:"4.75",stroke:strokeColor,strokeWidth:"0.5"})]}),jsx(Box,{marginLeft:"spacing.2",children:jsx(Text,{contrast:"low",type:"subtle",size:dimensions.textSize,children:children})})]}));};
|
|
3491
3507
|
|
|
3492
|
-
var Link=function Link(_ref){var children=_ref.children,icon=_ref.icon,_ref$iconPosition=_ref.iconPosition,iconPosition=_ref$iconPosition===void 0?'left':_ref$iconPosition,_ref$isDisabled=_ref.isDisabled,isDisabled=_ref$isDisabled===void 0?false:_ref$isDisabled,onClick=_ref.onClick,_ref$variant=_ref.variant,variant=_ref$variant===void 0?'anchor':_ref$variant,href=_ref.href,target=_ref.target,rel=_ref.rel,accessibilityLabel=_ref.accessibilityLabel,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size;return jsx(BaseLink,_extends({},icon?{icon:icon,children:children}:{children:children},variant==='anchor'?{variant:variant,href:href,target:target,rel:rel}:{variant:variant,isDisabled:isDisabled},{iconPosition:iconPosition,onClick:onClick,accessibilityLabel:accessibilityLabel,size:size}));};
|
|
3493
|
-
|
|
3494
3508
|
var useRadio=function useRadio(_ref){var isChecked=_ref.isChecked,defaultChecked=_ref.defaultChecked,isDisabled=_ref.isDisabled,isRequired=_ref.isRequired,hasError=_ref.hasError,onChange=_ref.onChange,name=_ref.name,value=_ref.value;var inputRef=React__default.useRef(null);var isReactNative=getPlatformType()==='react-native';if(isChecked&&defaultChecked){throw new Error("[Blade: Radio]: Do not provide both 'isChecked' and 'defaultChecked' to useRadio. Consider if you want this component to be controlled or uncontrolled.");}var _useControllableState=useControllableState({value:isChecked,defaultValue:defaultChecked!=null?defaultChecked:false}),_useControllableState2=_slicedToArray(_useControllableState,2),radioState=_useControllableState2[0],setRadioState=_useControllableState2[1];var handleOnChange=function handleOnChange(event){if(isDisabled){event.stopPropagation();event.preventDefault();return;}setRadioState(function(checked){if(checked===false){onChange==null?void 0:onChange({isChecked:true,event:event,value:value});return true;}return checked;});};var state={isChecked:radioState,setChecked:setRadioState};var idBase=useId('radio');var helpTextId=useId(idBase+"-helptext");var accessibilityProps=makeAccessible({role:'radio',required:Boolean(isRequired),invalid:Boolean(hasError),disabled:Boolean(isDisabled),checked:radioState,describedBy:helpTextId});if(isReactNative){return {state:state,inputProps:_extends({onPress:handleOnChange,name:name,value:value},accessibilityProps)};}return {state:state,ids:{helpTextId:helpTextId},inputProps:_extends({ref:inputRef,onChange:handleOnChange,type:'radio',name:name,value:value,checked:radioState,disabled:isDisabled,required:isRequired},accessibilityProps)};};
|
|
3495
3509
|
|
|
3496
3510
|
var radioSizes={group:{gap:{small:{mobile:'spacing.2',desktop:'spacing.0'},medium:{mobile:'spacing.3',desktop:'spacing.2'}}},icon:{small:{width:12,height:12,dotRadius:2},medium:{width:16,height:16,dotRadius:3}}};var radioIconColors={variants:{default:{dot:{checked:'colors.brand.gray.200.lowContrast',unchecked:'colors.brand.gray.200.lowContrast'},border:{checked:'colors.brand.primary.500',unchecked:'colors.brand.gray.500.lowContrast'},background:{checked:'colors.brand.primary.500',unchecked:'transparent'}},disabled:{dot:{checked:'colors.brand.gray.200.lowContrast',unchecked:'colors.brand.gray.200.lowContrast'},border:{checked:'transparent',unchecked:'colors.brand.gray.a100.lowContrast'},background:{checked:'colors.brand.gray.a100.lowContrast',unchecked:'transparent'}},negative:{dot:{checked:'colors.brand.gray.200.lowContrast',unchecked:'colors.brand.gray.200.lowContrast'},border:{checked:'colors.feedback.border.negative.highContrast',unchecked:'colors.feedback.border.negative.highContrast'},background:{checked:'colors.feedback.background.negative.highContrast',unchecked:'colors.feedback.background.negative.lowContrast'}}}};
|
|
@@ -3513,5 +3527,5 @@ var RadioGroup=function RadioGroup(_ref){var children=_ref.children,label=_ref.l
|
|
|
3513
3527
|
|
|
3514
3528
|
var SkipNavLink=function SkipNavLink(_props){throw new Error('[Blade: SkipNav]: SkipNavLink is not available on React Native');};var SkipNavContent=function SkipNavContent(_props){throw new Error('[Blade: SkipNav]: SkipNavContent is not available on React Native');};
|
|
3515
3529
|
|
|
3516
|
-
export { Alert, AlertTriangleIcon as AlertOctagonIcon, AlertTriangleIcon$1 as AlertTriangleIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, ArrowUpRightIcon, Badge, BladeProvider, Button, CheckCircleIcon, CheckIcon, Checkbox, CheckboxGroup, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, Code, Counter, CreditCardIcon, DollarIcon, DownloadIcon, EditIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileTextIcon, Heading, HelpCircleIcon, HistoryIcon, HomeIcon, IconButton, Indicator, InfoIcon, Link, LinkIcon, LockIcon, MailIcon, MinusIcon, OTPInput, PasswordInput, PauseIcon, PlusIcon, Radio, RadioGroup, RefreshLeftIcon, RotateCounterClockWiseIcon, RupeeIcon, SearchIcon, SettingsIcon, SkipNavContent, SkipNavLink, SlashIcon, Spinner, Text, TextArea, TextInput, Title, TrashIcon, TrendingDownIcon, TrendingUpIcon, UsersIcon, VisuallyHidden, announce, clearAnnouncer, destroyAnnouncer, getTextProps, screenReaderStyles, useTheme };
|
|
3530
|
+
export { Alert, AlertTriangleIcon as AlertOctagonIcon, AlertTriangleIcon$1 as AlertTriangleIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, ArrowUpRightIcon, Badge, BladeProvider, Button, Card, CardBody, CardFooter, CardFooterLeading, CardFooterTrailing, CardHeader, CardHeaderBadge, CardHeaderCounter, CardHeaderIcon, CardHeaderIconButton, CardHeaderLeading, CardHeaderLink, CardHeaderText, CardHeaderTrailing, CheckCircleIcon, CheckIcon, Checkbox, CheckboxGroup, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, Code, Counter, CreditCardIcon, DollarIcon, DownloadIcon, EditIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileTextIcon, Heading, HelpCircleIcon, HistoryIcon, HomeIcon, IconButton, Indicator, InfoIcon, Link, LinkIcon, LockIcon, MailIcon, MinusIcon, OTPInput, PasswordInput, PauseIcon, PlusIcon, Radio, RadioGroup, RefreshLeftIcon, RotateCounterClockWiseIcon, RupeeIcon, SearchIcon, SettingsIcon, SkipNavContent, SkipNavLink, SlashIcon, Spinner, Text, TextArea, TextInput, Title, TrashIcon, TrendingDownIcon, TrendingUpIcon, UsersIcon, VisuallyHidden, announce, clearAnnouncer, destroyAnnouncer, getTextProps, screenReaderStyles, useTheme };
|
|
3517
3531
|
//# sourceMappingURL=index.native.js.map
|