@butternutbox/pawprint-native 1.6.3 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +61 -0
- package/COMPONENT_GUIDELINES.md +57 -1
- package/dist/index.cjs +1459 -1380
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +81 -117
- package/dist/index.d.ts +81 -117
- package/dist/index.js +1206 -1125
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/__mocks__/react-native.tsx +33 -5
- package/src/__mocks__/rn-primitives/portal.tsx +71 -0
- package/src/components/atoms/Input/InputField.tsx +12 -2
- package/src/components/molecules/Drawer/Drawer.test.tsx +54 -2
- package/src/components/molecules/Drawer/DrawerBody.tsx +2 -17
- package/src/components/molecules/Drawer/DrawerContent.tsx +49 -2
- package/src/components/molecules/Drawer/DrawerOverlay.tsx +28 -16
- package/src/components/molecules/SelectField/AsyncSearch.test.tsx +373 -0
- package/src/components/molecules/SelectField/SelectDrawerField.stories.tsx +192 -0
- package/src/components/molecules/SelectField/SelectDrawerField.test.tsx +210 -0
- package/src/components/molecules/SelectField/SelectDrawerField.tsx +245 -0
- package/src/components/molecules/SelectField/SelectField.stories.tsx +221 -421
- package/src/components/molecules/SelectField/SelectField.test.tsx +214 -662
- package/src/components/molecules/SelectField/SelectField.tsx +269 -539
- package/src/components/molecules/SelectField/SelectFieldDropdown.tsx +90 -0
- package/src/components/molecules/SelectField/SelectFieldList.tsx +88 -0
- package/src/components/molecules/SelectField/SelectFieldOption.tsx +90 -0
- package/src/components/molecules/SelectField/core/index.ts +8 -0
- package/src/components/molecules/SelectField/core/listHeight.test.ts +22 -0
- package/src/components/molecules/SelectField/core/listHeight.ts +8 -0
- package/src/components/molecules/SelectField/core/options.ts +35 -0
- package/src/components/molecules/SelectField/core/useSelectOptions.ts +116 -0
- package/src/components/molecules/SelectField/index.ts +12 -9
- package/src/index.ts +0 -1
- package/src/test-utils.tsx +5 -1
- package/vitest.config.ts +7 -0
- package/src/components/molecules/SelectField/SelectFieldContent.tsx +0 -81
- package/src/components/molecules/SelectField/SelectFieldItem.tsx +0 -133
- package/src/components/molecules/SelectField/SelectFieldTrigger.tsx +0 -188
- package/src/components/molecules/SelectField/SelectFieldValue.tsx +0 -33
- package/src/components/molecules/SelectField/hooks/index.ts +0 -2
- package/src/components/molecules/SelectField/hooks/useSelectField.ts +0 -84
- package/src/hooks/index.ts +0 -1
- package/src/hooks/useDrawerKeyboardAvoidance.ts +0 -29
package/dist/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { useTheme, ThemeProvider as ThemeProvider$1 } from '@emotion/react';
|
|
2
2
|
import { Theme, Brand, DEFAULT_THEME_OPTIONS, THEME_OPTIONS_MAP, tokens } from '@butternutbox/pawprint-tokens';
|
|
3
3
|
export { tokens } from '@butternutbox/pawprint-tokens';
|
|
4
|
-
import
|
|
4
|
+
import styled52 from '@emotion/native';
|
|
5
5
|
export { default as styled } from '@emotion/native';
|
|
6
6
|
import { resolveFont } from '@butternutbox/pawprint-fonts';
|
|
7
7
|
export * from '@butternutbox/pawprint-fonts';
|
|
8
|
-
import
|
|
8
|
+
import React65, { createContext, forwardRef, useRef, useEffect, useState, useCallback, useMemo, useContext } from 'react';
|
|
9
9
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
10
10
|
import * as AvatarPrimitive from '@rn-primitives/avatar';
|
|
11
|
-
import { Text, View, Animated, Pressable, TextInput, Easing, StyleSheet,
|
|
11
|
+
import { Text, View, Animated, Pressable, TextInput, Easing, useWindowDimensions, StyleSheet, Platform, Keyboard, PanResponder, Image, ScrollView, ActionSheetIOS, TouchableOpacity, Modal, TouchableWithoutFeedback, FlatList, Linking, Clipboard, Alert } from 'react-native';
|
|
12
12
|
import Svg72, { Path, Defs, LinearGradient, Stop, Rect, G, ClipPath } from 'react-native-svg';
|
|
13
13
|
import * as SwitchPrimitive from '@rn-primitives/switch';
|
|
14
|
-
import
|
|
14
|
+
import Animated9, { Keyframe, Easing as Easing$1, FadeInLeft, FadeInRight, FadeInUp, FadeInDown, FadeIn, FadeOutLeft, FadeOutRight, FadeOutUp, FadeOutDown, FadeOut, useReducedMotion, useSharedValue, withTiming, useAnimatedStyle, ComplexAnimationBuilder, withSpring, withDelay, withRepeat, withSequence } from 'react-native-reanimated';
|
|
15
15
|
import { Slot } from '@rn-primitives/slot';
|
|
16
16
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
17
17
|
import * as ProgressPrimitive from '@rn-primitives/progress';
|
|
18
|
-
import
|
|
18
|
+
import { Portal } from '@rn-primitives/portal';
|
|
19
19
|
import * as SliderPrimitive from '@rn-primitives/slider';
|
|
20
20
|
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
21
21
|
import { scheduleOnRN } from 'react-native-worklets';
|
|
@@ -157,11 +157,11 @@ var VARIANT_DEFAULTS = {
|
|
|
157
157
|
heading: { size: "md" },
|
|
158
158
|
display: { size: "lg" }
|
|
159
159
|
};
|
|
160
|
-
var StyledText =
|
|
160
|
+
var StyledText = styled52(Text)({
|
|
161
161
|
includeFontPadding: false,
|
|
162
162
|
textAlignVertical: "center"
|
|
163
163
|
});
|
|
164
|
-
var Typography =
|
|
164
|
+
var Typography = React65.forwardRef(
|
|
165
165
|
(props, ref) => {
|
|
166
166
|
const theme2 = useTheme();
|
|
167
167
|
const { typography, colour } = theme2.tokens.semantics;
|
|
@@ -251,14 +251,14 @@ var Typography = React66.forwardRef(
|
|
|
251
251
|
);
|
|
252
252
|
Typography.displayName = "Typography";
|
|
253
253
|
var parseTokenValue2 = (value) => parseFloat(value);
|
|
254
|
-
var StyledIconRoot =
|
|
254
|
+
var StyledIconRoot = styled52(View)(({ iconDimension }) => ({
|
|
255
255
|
alignItems: "center",
|
|
256
256
|
justifyContent: "center",
|
|
257
257
|
flexShrink: 0,
|
|
258
258
|
width: iconDimension,
|
|
259
259
|
height: iconDimension
|
|
260
260
|
}));
|
|
261
|
-
var Icon =
|
|
261
|
+
var Icon = React65.forwardRef(
|
|
262
262
|
(_a, ref) => {
|
|
263
263
|
var _b = _a, {
|
|
264
264
|
icon: IconComponent,
|
|
@@ -784,7 +784,7 @@ var SIZE_MAP = {
|
|
|
784
784
|
lg: "large"
|
|
785
785
|
};
|
|
786
786
|
var parseTokenValue3 = (value) => parseFloat(value);
|
|
787
|
-
var StyledRoot =
|
|
787
|
+
var StyledRoot = styled52(AvatarPrimitive.Root)(({ theme: theme2, size, border }) => {
|
|
788
788
|
const { avatar } = theme2.tokens.components;
|
|
789
789
|
const { borderRadius } = theme2.tokens.semantics.dimensions;
|
|
790
790
|
const tokenSize = SIZE_MAP[size];
|
|
@@ -805,12 +805,12 @@ var StyledRoot = styled51(AvatarPrimitive.Root)(({ theme: theme2, size, border }
|
|
|
805
805
|
borderStyle: "solid"
|
|
806
806
|
});
|
|
807
807
|
});
|
|
808
|
-
var StyledImage =
|
|
808
|
+
var StyledImage = styled52(AvatarPrimitive.Image)({
|
|
809
809
|
width: "100%",
|
|
810
810
|
height: "100%",
|
|
811
811
|
resizeMode: "cover"
|
|
812
812
|
});
|
|
813
|
-
var StyledFallback =
|
|
813
|
+
var StyledFallback = styled52(AvatarPrimitive.Fallback)(({ theme: theme2 }) => {
|
|
814
814
|
const { background, text } = theme2.tokens.semantics.colour;
|
|
815
815
|
return {
|
|
816
816
|
display: "flex",
|
|
@@ -822,7 +822,7 @@ var StyledFallback = styled51(AvatarPrimitive.Fallback)(({ theme: theme2 }) => {
|
|
|
822
822
|
color: text.primary
|
|
823
823
|
};
|
|
824
824
|
});
|
|
825
|
-
var StyledIcon =
|
|
825
|
+
var StyledIcon = styled52(Icon)(({
|
|
826
826
|
theme: theme2,
|
|
827
827
|
avatarSize
|
|
828
828
|
}) => {
|
|
@@ -849,7 +849,7 @@ var AVATAR_SIZE_TO_ICON_SIZE = {
|
|
|
849
849
|
md: "md",
|
|
850
850
|
lg: "xl"
|
|
851
851
|
};
|
|
852
|
-
var AvatarRoot =
|
|
852
|
+
var AvatarRoot = React65.forwardRef(
|
|
853
853
|
(_a, ref) => {
|
|
854
854
|
var _b = _a, {
|
|
855
855
|
src,
|
|
@@ -886,7 +886,7 @@ var AvatarRoot = React66.forwardRef(
|
|
|
886
886
|
AvatarRoot.displayName = "Avatar";
|
|
887
887
|
var Avatar = AvatarRoot;
|
|
888
888
|
var parseTokenValue4 = (value) => parseFloat(value);
|
|
889
|
-
var Container =
|
|
889
|
+
var Container = styled52(View)(({ theme: theme2, showBg }) => {
|
|
890
890
|
const { colour, sizing, borderRadius } = theme2.tokens.components.carouselControls.carouselControl;
|
|
891
891
|
const spacing = theme2.tokens.semantics.dimensions.spacing;
|
|
892
892
|
return {
|
|
@@ -908,7 +908,7 @@ function getVisibleDots(count, activeIndex) {
|
|
|
908
908
|
const windowStart = Math.min(Math.max(activeIndex - 2, 0), count - 5);
|
|
909
909
|
return Array.from({ length: 5 }, (_, i) => windowStart + i);
|
|
910
910
|
}
|
|
911
|
-
var CarouselControls =
|
|
911
|
+
var CarouselControls = React65.forwardRef(
|
|
912
912
|
(_a, ref) => {
|
|
913
913
|
var _b = _a, { count, activeIndex, showBackground = true } = _b, props = __objRest(_b, ["count", "activeIndex", "showBackground"]);
|
|
914
914
|
const theme2 = useTheme();
|
|
@@ -955,7 +955,7 @@ var CarouselControls = React66.forwardRef(
|
|
|
955
955
|
);
|
|
956
956
|
CarouselControls.displayName = "CarouselControls";
|
|
957
957
|
var parseTokenValue5 = (value) => parseFloat(value);
|
|
958
|
-
var StyledBadge =
|
|
958
|
+
var StyledBadge = styled52(View)(({ theme: theme2, badgeVariant, badgeSize, pinned, top, bottom }) => {
|
|
959
959
|
const { sizing, spacing, colour, primary, pinnedBadge } = theme2.tokens.components.badges.badge;
|
|
960
960
|
const backgroundColorMap = {
|
|
961
961
|
primary: colour.background.default,
|
|
@@ -995,7 +995,7 @@ var StyledBadge = styled51(View)(({ theme: theme2, badgeVariant, badgeSize, pinn
|
|
|
995
995
|
backgroundColor: backgroundColorMap[badgeVariant]
|
|
996
996
|
}, borderRadiusStyles), positionStyles);
|
|
997
997
|
});
|
|
998
|
-
var Badge =
|
|
998
|
+
var Badge = React65.forwardRef(
|
|
999
999
|
(_a, ref) => {
|
|
1000
1000
|
var _b = _a, {
|
|
1001
1001
|
variant = "primary",
|
|
@@ -1069,8 +1069,8 @@ var Badge = React66.forwardRef(
|
|
|
1069
1069
|
);
|
|
1070
1070
|
Badge.displayName = "Badge";
|
|
1071
1071
|
var parseTokenValue6 = (value) => parseFloat(value);
|
|
1072
|
-
var StyledSpinner =
|
|
1073
|
-
var Spinner =
|
|
1072
|
+
var StyledSpinner = styled52(View)({});
|
|
1073
|
+
var Spinner = React65.forwardRef(
|
|
1074
1074
|
(_a, ref) => {
|
|
1075
1075
|
var _b = _a, { size = "md", variant = "dark", style } = _b, rest = __objRest(_b, ["size", "variant", "style"]);
|
|
1076
1076
|
const theme2 = useTheme();
|
|
@@ -1149,12 +1149,12 @@ var sizeToTypographyKey = {
|
|
|
1149
1149
|
md: "medium",
|
|
1150
1150
|
sm: "small"
|
|
1151
1151
|
};
|
|
1152
|
-
var IconWrapper =
|
|
1152
|
+
var IconWrapper = styled52(View)({
|
|
1153
1153
|
alignItems: "center",
|
|
1154
1154
|
justifyContent: "center",
|
|
1155
1155
|
flexShrink: 0
|
|
1156
1156
|
});
|
|
1157
|
-
var StyledButton =
|
|
1157
|
+
var StyledButton = styled52(Pressable)(
|
|
1158
1158
|
({
|
|
1159
1159
|
buttonMinHeight,
|
|
1160
1160
|
buttonMinWidth,
|
|
@@ -1182,12 +1182,12 @@ var StyledButton = styled51(Pressable)(
|
|
|
1182
1182
|
opacity: buttonOpacity
|
|
1183
1183
|
}, buttonBorderWidth ? { borderWidth: buttonBorderWidth, borderColor: buttonBorderColor } : {}), buttonFullWidth ? { width: "100%" } : {})
|
|
1184
1184
|
);
|
|
1185
|
-
var StyledSpinnerWrapper =
|
|
1185
|
+
var StyledSpinnerWrapper = styled52(View)({
|
|
1186
1186
|
position: "absolute",
|
|
1187
1187
|
alignItems: "center",
|
|
1188
1188
|
justifyContent: "center"
|
|
1189
1189
|
});
|
|
1190
|
-
var Button =
|
|
1190
|
+
var Button = React65.forwardRef(
|
|
1191
1191
|
(_a, ref) => {
|
|
1192
1192
|
var _b = _a, {
|
|
1193
1193
|
variant = "filled",
|
|
@@ -1219,7 +1219,7 @@ var Button = React66.forwardRef(
|
|
|
1219
1219
|
const typographyKey = sizeToTypographyKey[size];
|
|
1220
1220
|
const typography = buttons.text[typographyKey];
|
|
1221
1221
|
resolveFont(typography.fontFamily, typography.fontWeight);
|
|
1222
|
-
const [pressed, setPressed] =
|
|
1222
|
+
const [pressed, setPressed] = React65.useState(false);
|
|
1223
1223
|
const getVariantStyles = (isPressed) => {
|
|
1224
1224
|
if (variant === "filled") {
|
|
1225
1225
|
const { background: bgTokens, text: textTokens } = getFilledColourTokens(theme2, colour);
|
|
@@ -1248,12 +1248,12 @@ var Button = React66.forwardRef(
|
|
|
1248
1248
|
};
|
|
1249
1249
|
const variantStyles = getVariantStyles(pressed);
|
|
1250
1250
|
const renderIcon = (icon) => {
|
|
1251
|
-
if (!
|
|
1251
|
+
if (!React65.isValidElement(icon)) return icon;
|
|
1252
1252
|
const iconElement = icon;
|
|
1253
1253
|
if (!pressed) {
|
|
1254
1254
|
return icon;
|
|
1255
1255
|
}
|
|
1256
|
-
return
|
|
1256
|
+
return React65.cloneElement(iconElement, {
|
|
1257
1257
|
customColour: variantStyles.textColor
|
|
1258
1258
|
});
|
|
1259
1259
|
};
|
|
@@ -1314,7 +1314,7 @@ var Button = React66.forwardRef(
|
|
|
1314
1314
|
);
|
|
1315
1315
|
Button.displayName = "Button";
|
|
1316
1316
|
var parseTokenValue8 = (value) => parseFloat(value);
|
|
1317
|
-
var StyledDivider =
|
|
1317
|
+
var StyledDivider = styled52(View)(({ theme: theme2, dividerSize, dividerColour }) => {
|
|
1318
1318
|
const { colour, sizing } = theme2.tokens.components.dividers;
|
|
1319
1319
|
return {
|
|
1320
1320
|
width: "100%",
|
|
@@ -1322,7 +1322,7 @@ var StyledDivider = styled51(View)(({ theme: theme2, dividerSize, dividerColour
|
|
|
1322
1322
|
backgroundColor: colour[dividerColour]
|
|
1323
1323
|
};
|
|
1324
1324
|
});
|
|
1325
|
-
var Divider =
|
|
1325
|
+
var Divider = React65.forwardRef(
|
|
1326
1326
|
(_a, ref) => {
|
|
1327
1327
|
var _b = _a, { size = "small", colour = "light" } = _b, rest = __objRest(_b, ["size", "colour"]);
|
|
1328
1328
|
return /* @__PURE__ */ jsx(
|
|
@@ -1339,7 +1339,7 @@ Divider.displayName = "Divider";
|
|
|
1339
1339
|
|
|
1340
1340
|
// src/utils/token.ts
|
|
1341
1341
|
var parseTokenValue9 = (value) => parseFloat(value);
|
|
1342
|
-
var StyledHint =
|
|
1342
|
+
var StyledHint = styled52(View)(({
|
|
1343
1343
|
theme: theme2,
|
|
1344
1344
|
hintVariant
|
|
1345
1345
|
}) => {
|
|
@@ -1363,7 +1363,7 @@ var StyledHint = styled51(View)(({
|
|
|
1363
1363
|
backgroundColor: hintVariantMap[hintVariant]
|
|
1364
1364
|
};
|
|
1365
1365
|
});
|
|
1366
|
-
var Hint =
|
|
1366
|
+
var Hint = React65.forwardRef(
|
|
1367
1367
|
(_a, ref) => {
|
|
1368
1368
|
var _b = _a, { variant = "default" } = _b, rest = __objRest(_b, ["variant"]);
|
|
1369
1369
|
return /* @__PURE__ */ jsx(StyledHint, __spreadValues({ ref, hintVariant: variant }, rest));
|
|
@@ -1376,7 +1376,7 @@ var sizeToIconSizeToken = {
|
|
|
1376
1376
|
md: "lg",
|
|
1377
1377
|
sm: "md"
|
|
1378
1378
|
};
|
|
1379
|
-
var StyledIconButton =
|
|
1379
|
+
var StyledIconButton = styled52(Pressable)(
|
|
1380
1380
|
({
|
|
1381
1381
|
buttonDimension,
|
|
1382
1382
|
buttonBorderRadius,
|
|
@@ -1395,17 +1395,17 @@ var StyledIconButton = styled51(Pressable)(
|
|
|
1395
1395
|
opacity: buttonOpacity
|
|
1396
1396
|
}, buttonBorderWidth ? { borderWidth: buttonBorderWidth, borderColor: buttonBorderColor } : {})
|
|
1397
1397
|
);
|
|
1398
|
-
var StyledIconWrapper =
|
|
1398
|
+
var StyledIconWrapper = styled52(View)(({ iconDimension, iconOpacity }) => ({
|
|
1399
1399
|
width: iconDimension,
|
|
1400
1400
|
height: iconDimension,
|
|
1401
1401
|
opacity: iconOpacity
|
|
1402
1402
|
}));
|
|
1403
|
-
var StyledSpinnerWrapper2 =
|
|
1403
|
+
var StyledSpinnerWrapper2 = styled52(View)({
|
|
1404
1404
|
position: "absolute",
|
|
1405
1405
|
alignItems: "center",
|
|
1406
1406
|
justifyContent: "center"
|
|
1407
1407
|
});
|
|
1408
|
-
var IconButton =
|
|
1408
|
+
var IconButton = React65.forwardRef(
|
|
1409
1409
|
(_a, ref) => {
|
|
1410
1410
|
var _b = _a, {
|
|
1411
1411
|
icon: IconComponent,
|
|
@@ -1431,7 +1431,7 @@ var IconButton = React66.forwardRef(
|
|
|
1431
1431
|
const dimension = parseTokenValue10(sizeTokens.minHeight);
|
|
1432
1432
|
const iconSizing = theme2.tokens.components.icons.sizing.icons.core;
|
|
1433
1433
|
const iconDimension = parseTokenValue10(iconSizing[sizeToIconSizeToken[size]]);
|
|
1434
|
-
const [pressed, setPressed] =
|
|
1434
|
+
const [pressed, setPressed] = React65.useState(false);
|
|
1435
1435
|
const getVariantStyles = (isPressed) => {
|
|
1436
1436
|
if (variant === "filled") {
|
|
1437
1437
|
const filled = buttons.iconButton.filledButton;
|
|
@@ -1508,7 +1508,7 @@ var IconButton = React66.forwardRef(
|
|
|
1508
1508
|
);
|
|
1509
1509
|
IconButton.displayName = "IconButton";
|
|
1510
1510
|
var parseTokenValue11 = (value) => parseFloat(value);
|
|
1511
|
-
var StyledRoot2 =
|
|
1511
|
+
var StyledRoot2 = styled52(View)(({ illustrationHeight, flexboxProps }) => {
|
|
1512
1512
|
var _a, _b;
|
|
1513
1513
|
return {
|
|
1514
1514
|
alignItems: (_a = flexboxProps.align) != null ? _a : "center",
|
|
@@ -1521,7 +1521,7 @@ var StyledRoot2 = styled51(View)(({ illustrationHeight, flexboxProps }) => {
|
|
|
1521
1521
|
height: illustrationHeight
|
|
1522
1522
|
};
|
|
1523
1523
|
});
|
|
1524
|
-
var Illustration =
|
|
1524
|
+
var Illustration = React65.forwardRef(
|
|
1525
1525
|
(_a, ref) => {
|
|
1526
1526
|
var _b = _a, {
|
|
1527
1527
|
illustration: IllustrationComponent,
|
|
@@ -1573,12 +1573,12 @@ var Illustration = React66.forwardRef(
|
|
|
1573
1573
|
);
|
|
1574
1574
|
Illustration.displayName = "Illustration";
|
|
1575
1575
|
var parseTokenValue12 = (value) => parseFloat(value);
|
|
1576
|
-
var StyledLabelRow =
|
|
1576
|
+
var StyledLabelRow = styled52(View)(({ labelGap }) => ({
|
|
1577
1577
|
flexDirection: "row",
|
|
1578
1578
|
alignItems: "center",
|
|
1579
1579
|
gap: labelGap
|
|
1580
1580
|
}));
|
|
1581
|
-
var InputLabel =
|
|
1581
|
+
var InputLabel = React65.forwardRef(
|
|
1582
1582
|
(_a, ref) => {
|
|
1583
1583
|
var _b = _a, { optionalText, state = "default", children } = _b, rest = __objRest(_b, ["optionalText", "state", "children"]);
|
|
1584
1584
|
const theme2 = useTheme();
|
|
@@ -1606,7 +1606,7 @@ var InputLabel = React66.forwardRef(
|
|
|
1606
1606
|
);
|
|
1607
1607
|
InputLabel.displayName = "Input.Label";
|
|
1608
1608
|
var parseTokenValue13 = (value) => parseFloat(value);
|
|
1609
|
-
var StyledInputWrapper =
|
|
1609
|
+
var StyledInputWrapper = styled52(Animated.View)(({ theme: theme2, isDisabled, containerWidth, containerHeight }) => {
|
|
1610
1610
|
const { spacing, colour, borderRadius, size } = theme2.tokens.components.inputs;
|
|
1611
1611
|
return {
|
|
1612
1612
|
flexDirection: "row",
|
|
@@ -1620,7 +1620,7 @@ var StyledInputWrapper = styled51(Animated.View)(({ theme: theme2, isDisabled, c
|
|
|
1620
1620
|
flexShrink: containerWidth !== void 0 ? 0 : void 0
|
|
1621
1621
|
};
|
|
1622
1622
|
});
|
|
1623
|
-
var StyledInput =
|
|
1623
|
+
var StyledInput = styled52(TextInput)(({
|
|
1624
1624
|
theme: theme2,
|
|
1625
1625
|
hasInlineHelp
|
|
1626
1626
|
}) => {
|
|
@@ -1648,16 +1648,16 @@ var StyledInput = styled51(TextInput)(({
|
|
|
1648
1648
|
outlineColor: "transparent"
|
|
1649
1649
|
});
|
|
1650
1650
|
});
|
|
1651
|
-
var StyledFocusRing =
|
|
1651
|
+
var StyledFocusRing = styled52(View)({
|
|
1652
1652
|
position: "absolute",
|
|
1653
1653
|
pointerEvents: "none"
|
|
1654
1654
|
});
|
|
1655
|
-
var StyledIconSlot =
|
|
1655
|
+
var StyledIconSlot = styled52(View)({
|
|
1656
1656
|
alignItems: "center",
|
|
1657
1657
|
justifyContent: "center",
|
|
1658
1658
|
flexShrink: 0
|
|
1659
1659
|
});
|
|
1660
|
-
var InputField =
|
|
1660
|
+
var InputField = React65.forwardRef(
|
|
1661
1661
|
(_a, ref) => {
|
|
1662
1662
|
var _b = _a, {
|
|
1663
1663
|
leadingIcon,
|
|
@@ -1671,7 +1671,8 @@ var InputField = React66.forwardRef(
|
|
|
1671
1671
|
style,
|
|
1672
1672
|
editable,
|
|
1673
1673
|
onFocus,
|
|
1674
|
-
onBlur
|
|
1674
|
+
onBlur,
|
|
1675
|
+
onPress
|
|
1675
1676
|
} = _b, rest = __objRest(_b, [
|
|
1676
1677
|
"leadingIcon",
|
|
1677
1678
|
"trailingIcon",
|
|
@@ -1684,7 +1685,8 @@ var InputField = React66.forwardRef(
|
|
|
1684
1685
|
"style",
|
|
1685
1686
|
"editable",
|
|
1686
1687
|
"onFocus",
|
|
1687
|
-
"onBlur"
|
|
1688
|
+
"onBlur",
|
|
1689
|
+
"onPress"
|
|
1688
1690
|
]);
|
|
1689
1691
|
const theme2 = useTheme();
|
|
1690
1692
|
const { spacing, colour, borderWidth, borderRadius } = theme2.tokens.components.inputs;
|
|
@@ -1702,7 +1704,7 @@ var InputField = React66.forwardRef(
|
|
|
1702
1704
|
},
|
|
1703
1705
|
[ref]
|
|
1704
1706
|
);
|
|
1705
|
-
const isDisabled = editable === false;
|
|
1707
|
+
const isDisabled = editable === false && onPress === void 0;
|
|
1706
1708
|
const hasState = state === "error" || state === "success";
|
|
1707
1709
|
const baseBorderWidth = parseTokenValue13(borderWidth.field.default);
|
|
1708
1710
|
const selectedBorderWidth = parseTokenValue13(borderWidth.field.selected);
|
|
@@ -1765,7 +1767,7 @@ var InputField = React66.forwardRef(
|
|
|
1765
1767
|
var _a2;
|
|
1766
1768
|
(_a2 = internalInputRef.current) == null ? void 0 : _a2.focus();
|
|
1767
1769
|
};
|
|
1768
|
-
return /* @__PURE__ */ jsx(Pressable, { onPress: handleWrapperPress, children: /* @__PURE__ */ jsxs(
|
|
1770
|
+
return /* @__PURE__ */ jsx(Pressable, { onPress: onPress != null ? onPress : handleWrapperPress, children: /* @__PURE__ */ jsxs(
|
|
1769
1771
|
StyledInputWrapper,
|
|
1770
1772
|
{
|
|
1771
1773
|
isDisabled,
|
|
@@ -1802,6 +1804,7 @@ var InputField = React66.forwardRef(
|
|
|
1802
1804
|
style,
|
|
1803
1805
|
placeholderTextColor: colour.field.text.placeholder,
|
|
1804
1806
|
editable,
|
|
1807
|
+
pointerEvents: onPress ? "none" : void 0,
|
|
1805
1808
|
onFocus: handleFocus,
|
|
1806
1809
|
onBlur: handleBlur,
|
|
1807
1810
|
hasInlineHelp
|
|
@@ -1816,7 +1819,7 @@ var InputField = React66.forwardRef(
|
|
|
1816
1819
|
}
|
|
1817
1820
|
);
|
|
1818
1821
|
InputField.displayName = "Input.Field";
|
|
1819
|
-
var InputText =
|
|
1822
|
+
var InputText = React65.forwardRef(
|
|
1820
1823
|
(_a, ref) => {
|
|
1821
1824
|
var _b = _a, { placeholderTextColor } = _b, rest = __objRest(_b, ["placeholderTextColor"]);
|
|
1822
1825
|
const theme2 = useTheme();
|
|
@@ -1831,11 +1834,11 @@ var InputText = React66.forwardRef(
|
|
|
1831
1834
|
}
|
|
1832
1835
|
);
|
|
1833
1836
|
InputText.displayName = "Input.Text";
|
|
1834
|
-
var StyledDescriptionRow =
|
|
1837
|
+
var StyledDescriptionRow = styled52(View)({
|
|
1835
1838
|
flexDirection: "row",
|
|
1836
1839
|
alignItems: "center"
|
|
1837
1840
|
});
|
|
1838
|
-
var InputDescription =
|
|
1841
|
+
var InputDescription = React65.forwardRef(
|
|
1839
1842
|
(_a, ref) => {
|
|
1840
1843
|
var _b = _a, { state = "default", children } = _b, rest = __objRest(_b, ["state", "children"]);
|
|
1841
1844
|
const theme2 = useTheme();
|
|
@@ -1851,11 +1854,11 @@ var InputDescription = React66.forwardRef(
|
|
|
1851
1854
|
}
|
|
1852
1855
|
);
|
|
1853
1856
|
InputDescription.displayName = "Input.Description";
|
|
1854
|
-
var StyledErrorRow =
|
|
1857
|
+
var StyledErrorRow = styled52(View)({
|
|
1855
1858
|
flexDirection: "row",
|
|
1856
1859
|
alignItems: "center"
|
|
1857
1860
|
});
|
|
1858
|
-
var InputError =
|
|
1861
|
+
var InputError = React65.forwardRef(
|
|
1859
1862
|
(_a, ref) => {
|
|
1860
1863
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
1861
1864
|
const theme2 = useTheme();
|
|
@@ -1872,13 +1875,13 @@ var InputError = React66.forwardRef(
|
|
|
1872
1875
|
);
|
|
1873
1876
|
InputError.displayName = "Input.Error";
|
|
1874
1877
|
var parseTokenValue14 = (value) => parseFloat(value);
|
|
1875
|
-
var StyledRoot3 =
|
|
1878
|
+
var StyledRoot3 = styled52(View)(({ theme: theme2 }) => {
|
|
1876
1879
|
const { spacing } = theme2.tokens.components.inputs;
|
|
1877
1880
|
return {
|
|
1878
1881
|
gap: parseTokenValue14(spacing.gap)
|
|
1879
1882
|
};
|
|
1880
1883
|
});
|
|
1881
|
-
var InputRoot =
|
|
1884
|
+
var InputRoot = React65.forwardRef(
|
|
1882
1885
|
(_a, ref) => {
|
|
1883
1886
|
var _b = _a, {
|
|
1884
1887
|
label,
|
|
@@ -1922,7 +1925,7 @@ var Input = Object.assign(InputRoot, {
|
|
|
1922
1925
|
Description: InputDescription,
|
|
1923
1926
|
Error: InputError
|
|
1924
1927
|
});
|
|
1925
|
-
var Link =
|
|
1928
|
+
var Link = React65.forwardRef(
|
|
1926
1929
|
(_a, ref) => {
|
|
1927
1930
|
var _b = _a, {
|
|
1928
1931
|
size = "md",
|
|
@@ -4515,12 +4518,12 @@ function registerLogo(brand, variant, component) {
|
|
|
4515
4518
|
}
|
|
4516
4519
|
LOGOS[brand][variant] = component;
|
|
4517
4520
|
}
|
|
4518
|
-
var StyledRoot4 =
|
|
4521
|
+
var StyledRoot4 = styled52(View)({
|
|
4519
4522
|
alignItems: "center",
|
|
4520
4523
|
justifyContent: "center",
|
|
4521
4524
|
flexShrink: 0
|
|
4522
4525
|
});
|
|
4523
|
-
var Logo =
|
|
4526
|
+
var Logo = React65.forwardRef(
|
|
4524
4527
|
(_a, ref) => {
|
|
4525
4528
|
var _b = _a, { brand, variant = "primary", "aria-label": ariaLabel } = _b, rest = __objRest(_b, ["brand", "variant", "aria-label"]);
|
|
4526
4529
|
const effectiveVariant = brand === "bcorp" ? "primary" : variant;
|
|
@@ -4543,7 +4546,7 @@ var Logo = React66.forwardRef(
|
|
|
4543
4546
|
);
|
|
4544
4547
|
Logo.displayName = "Logo";
|
|
4545
4548
|
var parseTokenValue15 = (value) => parseFloat(value);
|
|
4546
|
-
var StyledFieldGroup =
|
|
4549
|
+
var StyledFieldGroup = styled52(View)(({ theme: theme2 }) => {
|
|
4547
4550
|
const { spacing } = theme2.tokens.components.inputs;
|
|
4548
4551
|
return {
|
|
4549
4552
|
flexDirection: "row",
|
|
@@ -4551,15 +4554,15 @@ var StyledFieldGroup = styled51(View)(({ theme: theme2 }) => {
|
|
|
4551
4554
|
gap: parseTokenValue15(spacing.field.gap)
|
|
4552
4555
|
};
|
|
4553
4556
|
});
|
|
4554
|
-
var StyledFieldTextWrapper =
|
|
4557
|
+
var StyledFieldTextWrapper = styled52(View)({
|
|
4555
4558
|
flexShrink: 0,
|
|
4556
4559
|
justifyContent: "center"
|
|
4557
4560
|
});
|
|
4558
|
-
var StyledInputContainer =
|
|
4561
|
+
var StyledInputContainer = styled52(View)(({ hasInlineHelp }) => ({
|
|
4559
4562
|
flexDirection: "column",
|
|
4560
4563
|
gap: hasInlineHelp ? 2 : 0
|
|
4561
4564
|
}));
|
|
4562
|
-
var NumberInputField =
|
|
4565
|
+
var NumberInputField = React65.forwardRef((_a, ref) => {
|
|
4563
4566
|
var _b = _a, { fieldText, inlineHelpText } = _b, props = __objRest(_b, ["fieldText", "inlineHelpText"]);
|
|
4564
4567
|
const theme2 = useTheme();
|
|
4565
4568
|
const { colour, description } = theme2.tokens.components.inputs;
|
|
@@ -4650,13 +4653,13 @@ var NumberInputField = React66.forwardRef((_a, ref) => {
|
|
|
4650
4653
|
});
|
|
4651
4654
|
NumberInputField.displayName = "NumberInput.Field";
|
|
4652
4655
|
var parseTokenValue16 = (value) => parseFloat(value);
|
|
4653
|
-
var StyledRoot5 =
|
|
4656
|
+
var StyledRoot5 = styled52(View)(({ theme: theme2 }) => {
|
|
4654
4657
|
const { spacing } = theme2.tokens.components.inputs;
|
|
4655
4658
|
return {
|
|
4656
4659
|
gap: parseTokenValue16(spacing.gap)
|
|
4657
4660
|
};
|
|
4658
4661
|
});
|
|
4659
|
-
var NumberInputRoot =
|
|
4662
|
+
var NumberInputRoot = React65.forwardRef(
|
|
4660
4663
|
(_a, ref) => {
|
|
4661
4664
|
var _b = _a, {
|
|
4662
4665
|
label,
|
|
@@ -4707,13 +4710,13 @@ var NumberInput = Object.assign(NumberInputRoot, {
|
|
|
4707
4710
|
Error: InputError
|
|
4708
4711
|
});
|
|
4709
4712
|
var parseTokenValue17 = (value) => parseFloat(value);
|
|
4710
|
-
var StyledContainer =
|
|
4713
|
+
var StyledContainer = styled52(View)(({ switchGap, switchOpacity }) => ({
|
|
4711
4714
|
flexDirection: "row",
|
|
4712
4715
|
alignItems: "flex-start",
|
|
4713
4716
|
gap: switchGap,
|
|
4714
4717
|
opacity: switchOpacity
|
|
4715
4718
|
}));
|
|
4716
|
-
var StyledControlTrack =
|
|
4719
|
+
var StyledControlTrack = styled52(View)(
|
|
4717
4720
|
({
|
|
4718
4721
|
switchChecked,
|
|
4719
4722
|
controlWidth,
|
|
@@ -4739,19 +4742,19 @@ var StyledControlTrack = styled51(View)(
|
|
|
4739
4742
|
justifyContent: "center"
|
|
4740
4743
|
})
|
|
4741
4744
|
);
|
|
4742
|
-
var StyledThumb =
|
|
4745
|
+
var StyledThumb = styled52(Animated.View)(({ thumbSize, thumbBgColor }) => ({
|
|
4743
4746
|
width: thumbSize,
|
|
4744
4747
|
height: thumbSize,
|
|
4745
4748
|
borderRadius: thumbSize / 2,
|
|
4746
4749
|
backgroundColor: thumbBgColor,
|
|
4747
4750
|
position: "absolute"
|
|
4748
4751
|
}));
|
|
4749
|
-
var StyledContent =
|
|
4752
|
+
var StyledContent = styled52(View)(({ contentGap }) => ({
|
|
4750
4753
|
gap: contentGap,
|
|
4751
4754
|
flex: 1,
|
|
4752
4755
|
minWidth: 0
|
|
4753
4756
|
}));
|
|
4754
|
-
var Switch =
|
|
4757
|
+
var Switch = React65.forwardRef(
|
|
4755
4758
|
(_a, ref) => {
|
|
4756
4759
|
var _b = _a, {
|
|
4757
4760
|
label,
|
|
@@ -4771,7 +4774,7 @@ var Switch = React66.forwardRef(
|
|
|
4771
4774
|
const theme2 = useTheme();
|
|
4772
4775
|
const { size, colour, opacity, borderWidth, spacing, typography } = theme2.tokens.components.switch;
|
|
4773
4776
|
const isControlled = controlledChecked !== void 0;
|
|
4774
|
-
const [internalChecked, setInternalChecked] =
|
|
4777
|
+
const [internalChecked, setInternalChecked] = React65.useState(defaultChecked);
|
|
4775
4778
|
const isChecked = isControlled ? controlledChecked : internalChecked;
|
|
4776
4779
|
const controlWidth = parseTokenValue17(size.control.width);
|
|
4777
4780
|
const controlHeight = parseTokenValue17(size.control.height);
|
|
@@ -4858,7 +4861,7 @@ var Switch = React66.forwardRef(
|
|
|
4858
4861
|
);
|
|
4859
4862
|
Switch.displayName = "Switch";
|
|
4860
4863
|
var parseTokenValue18 = (value) => parseFloat(value);
|
|
4861
|
-
var StyledTag =
|
|
4864
|
+
var StyledTag = styled52(View)(({ theme: theme2, tagVariant, tagSize }) => {
|
|
4862
4865
|
const { sizing, spacing, colour, badge } = theme2.tokens.components.tags;
|
|
4863
4866
|
const { spacing: semanticSpacing } = theme2.tokens.semantics.dimensions;
|
|
4864
4867
|
const backgroundColorMap = {
|
|
@@ -4890,10 +4893,10 @@ var StyledTag = styled51(View)(({ theme: theme2, tagVariant, tagSize }) => {
|
|
|
4890
4893
|
backgroundColor: backgroundColorMap[tagVariant]
|
|
4891
4894
|
};
|
|
4892
4895
|
});
|
|
4893
|
-
var StyledLabel =
|
|
4896
|
+
var StyledLabel = styled52(View)({
|
|
4894
4897
|
flexShrink: 1
|
|
4895
4898
|
});
|
|
4896
|
-
var Tag =
|
|
4899
|
+
var Tag = React65.forwardRef(
|
|
4897
4900
|
(_a, ref) => {
|
|
4898
4901
|
var _b = _a, { variant = "primary", size = "medium", icon, children } = _b, rest = __objRest(_b, ["variant", "size", "icon", "children"]);
|
|
4899
4902
|
const theme2 = useTheme();
|
|
@@ -4943,7 +4946,7 @@ var Tag = React66.forwardRef(
|
|
|
4943
4946
|
);
|
|
4944
4947
|
Tag.displayName = "Tag";
|
|
4945
4948
|
var parseTokenValue19 = (value) => parseFloat(value);
|
|
4946
|
-
var StyledTextAreaWrapper =
|
|
4949
|
+
var StyledTextAreaWrapper = styled52(Animated.View)(({ theme: theme2, isDisabled }) => {
|
|
4947
4950
|
const { spacing, colour, borderRadius, size } = theme2.tokens.components.inputs;
|
|
4948
4951
|
const { dimensions: dimensions3 } = theme2.tokens.semantics;
|
|
4949
4952
|
return {
|
|
@@ -4957,7 +4960,7 @@ var StyledTextAreaWrapper = styled51(Animated.View)(({ theme: theme2, isDisabled
|
|
|
4957
4960
|
position: "relative"
|
|
4958
4961
|
};
|
|
4959
4962
|
});
|
|
4960
|
-
var StyledTextArea =
|
|
4963
|
+
var StyledTextArea = styled52(TextInput)(({ theme: theme2 }) => {
|
|
4961
4964
|
var _a, _b;
|
|
4962
4965
|
const { colour, field } = theme2.tokens.components.inputs;
|
|
4963
4966
|
const typography = field.placeholder.default;
|
|
@@ -4983,17 +4986,17 @@ var StyledTextArea = styled51(TextInput)(({ theme: theme2 }) => {
|
|
|
4983
4986
|
outlineColor: "transparent"
|
|
4984
4987
|
});
|
|
4985
4988
|
});
|
|
4986
|
-
var StyledFocusRing2 =
|
|
4989
|
+
var StyledFocusRing2 = styled52(View)({
|
|
4987
4990
|
position: "absolute",
|
|
4988
4991
|
pointerEvents: "none"
|
|
4989
4992
|
});
|
|
4990
|
-
var TextAreaContainer =
|
|
4993
|
+
var TextAreaContainer = styled52(View)({
|
|
4991
4994
|
position: "relative",
|
|
4992
4995
|
width: "100%",
|
|
4993
4996
|
flex: 1,
|
|
4994
4997
|
flexDirection: "column"
|
|
4995
4998
|
});
|
|
4996
|
-
var IconWrapper2 =
|
|
4999
|
+
var IconWrapper2 = styled52(View)(({ side }) => {
|
|
4997
5000
|
return {
|
|
4998
5001
|
position: "absolute",
|
|
4999
5002
|
top: 0,
|
|
@@ -5004,7 +5007,7 @@ var IconWrapper2 = styled51(View)(({ side }) => {
|
|
|
5004
5007
|
zIndex: 1
|
|
5005
5008
|
};
|
|
5006
5009
|
});
|
|
5007
|
-
var TextAreaField =
|
|
5010
|
+
var TextAreaField = React65.forwardRef(
|
|
5008
5011
|
(_a, ref) => {
|
|
5009
5012
|
var _b = _a, {
|
|
5010
5013
|
leadingIcon,
|
|
@@ -5180,24 +5183,24 @@ var TextAreaField = React66.forwardRef(
|
|
|
5180
5183
|
);
|
|
5181
5184
|
TextAreaField.displayName = "TextArea.Field";
|
|
5182
5185
|
var parseTokenValue20 = (value) => parseFloat(value);
|
|
5183
|
-
var StyledLabelWrapper =
|
|
5186
|
+
var StyledLabelWrapper = styled52(View)({
|
|
5184
5187
|
flexDirection: "row",
|
|
5185
5188
|
alignItems: "center",
|
|
5186
5189
|
justifyContent: "space-between",
|
|
5187
5190
|
width: "100%"
|
|
5188
5191
|
});
|
|
5189
|
-
var StyledLabel2 =
|
|
5192
|
+
var StyledLabel2 = styled52(View)(({ labelGap }) => ({
|
|
5190
5193
|
flexDirection: "row",
|
|
5191
5194
|
alignItems: "center",
|
|
5192
5195
|
gap: labelGap
|
|
5193
5196
|
}));
|
|
5194
|
-
var StyledCharCountWrapper =
|
|
5197
|
+
var StyledCharCountWrapper = styled52(View)(({ charCountGap, charCountPadding }) => ({
|
|
5195
5198
|
flexDirection: "row",
|
|
5196
5199
|
alignItems: "center",
|
|
5197
5200
|
gap: charCountGap,
|
|
5198
5201
|
paddingLeft: charCountPadding
|
|
5199
5202
|
}));
|
|
5200
|
-
var TextAreaLabel =
|
|
5203
|
+
var TextAreaLabel = React65.forwardRef(
|
|
5201
5204
|
(_a, ref) => {
|
|
5202
5205
|
var _b = _a, {
|
|
5203
5206
|
optionalText,
|
|
@@ -5255,13 +5258,13 @@ var TextAreaLabel = React66.forwardRef(
|
|
|
5255
5258
|
);
|
|
5256
5259
|
TextAreaLabel.displayName = "TextArea.Label";
|
|
5257
5260
|
var parseTokenValue21 = (value) => parseFloat(value);
|
|
5258
|
-
var StyledRoot6 =
|
|
5261
|
+
var StyledRoot6 = styled52(View)(({ theme: theme2 }) => {
|
|
5259
5262
|
const { spacing } = theme2.tokens.components.inputs;
|
|
5260
5263
|
return {
|
|
5261
5264
|
gap: parseTokenValue21(spacing.gap)
|
|
5262
5265
|
};
|
|
5263
5266
|
});
|
|
5264
|
-
var TextAreaRoot =
|
|
5267
|
+
var TextAreaRoot = React65.forwardRef(
|
|
5265
5268
|
(_a, ref) => {
|
|
5266
5269
|
var _b = _a, {
|
|
5267
5270
|
label,
|
|
@@ -5288,8 +5291,8 @@ var TextAreaRoot = React66.forwardRef(
|
|
|
5288
5291
|
"defaultValue",
|
|
5289
5292
|
"onChangeText"
|
|
5290
5293
|
]);
|
|
5291
|
-
const [charCount, setCharCount] =
|
|
5292
|
-
|
|
5294
|
+
const [charCount, setCharCount] = React65.useState(0);
|
|
5295
|
+
React65.useEffect(() => {
|
|
5293
5296
|
if (value !== void 0) {
|
|
5294
5297
|
setCharCount(String(value).length);
|
|
5295
5298
|
} else if (defaultValue !== void 0) {
|
|
@@ -5342,7 +5345,7 @@ var TextArea = Object.assign(TextAreaRoot, {
|
|
|
5342
5345
|
Description: InputDescription,
|
|
5343
5346
|
Error: InputError
|
|
5344
5347
|
});
|
|
5345
|
-
var AccordionContext =
|
|
5348
|
+
var AccordionContext = React65.createContext({
|
|
5346
5349
|
openValues: [],
|
|
5347
5350
|
toggle: () => {
|
|
5348
5351
|
},
|
|
@@ -5350,30 +5353,30 @@ var AccordionContext = React66.createContext({
|
|
|
5350
5353
|
size: "small"
|
|
5351
5354
|
});
|
|
5352
5355
|
var parseTokenValue22 = (value) => parseFloat(value);
|
|
5353
|
-
var StyledRoot7 =
|
|
5356
|
+
var StyledRoot7 = styled52(View)(({ rootGap }) => ({
|
|
5354
5357
|
width: "100%",
|
|
5355
5358
|
flexDirection: "column",
|
|
5356
5359
|
gap: rootGap
|
|
5357
5360
|
}));
|
|
5358
|
-
var StyledItem =
|
|
5361
|
+
var StyledItem = styled52(View)({
|
|
5359
5362
|
flexDirection: "column"
|
|
5360
5363
|
});
|
|
5361
|
-
var StyledTrigger =
|
|
5364
|
+
var StyledTrigger = styled52(Pressable)(({ triggerOpacity }) => ({
|
|
5362
5365
|
flexDirection: "row",
|
|
5363
5366
|
alignItems: "center",
|
|
5364
5367
|
justifyContent: "space-between",
|
|
5365
5368
|
width: "100%",
|
|
5366
5369
|
opacity: triggerOpacity
|
|
5367
5370
|
}));
|
|
5368
|
-
var StyledPanel =
|
|
5371
|
+
var StyledPanel = styled52(View)(({ panelGap }) => ({
|
|
5369
5372
|
marginTop: panelGap
|
|
5370
5373
|
}));
|
|
5371
|
-
var StyledDivider2 =
|
|
5374
|
+
var StyledDivider2 = styled52(View)(({ dividerColor, dividerMarginTop }) => ({
|
|
5372
5375
|
height: 1,
|
|
5373
5376
|
backgroundColor: dividerColor,
|
|
5374
5377
|
marginTop: dividerMarginTop
|
|
5375
5378
|
}));
|
|
5376
|
-
var AccordionItem =
|
|
5379
|
+
var AccordionItem = React65.forwardRef(
|
|
5377
5380
|
(_a, ref) => {
|
|
5378
5381
|
var _b = _a, { title, children, value, disabled: itemDisabled } = _b, rest = __objRest(_b, ["title", "children", "value", "disabled"]);
|
|
5379
5382
|
const theme2 = useTheme();
|
|
@@ -5383,7 +5386,7 @@ var AccordionItem = React66.forwardRef(
|
|
|
5383
5386
|
toggle,
|
|
5384
5387
|
disabled: rootDisabled,
|
|
5385
5388
|
size
|
|
5386
|
-
} =
|
|
5389
|
+
} = React65.useContext(AccordionContext);
|
|
5387
5390
|
const itemValue = value != null ? value : title;
|
|
5388
5391
|
const isOpen = openValues.includes(itemValue);
|
|
5389
5392
|
const isDisabled = itemDisabled || rootDisabled;
|
|
@@ -5444,7 +5447,7 @@ var AccordionItem = React66.forwardRef(
|
|
|
5444
5447
|
}
|
|
5445
5448
|
);
|
|
5446
5449
|
AccordionItem.displayName = "Accordion.Item";
|
|
5447
|
-
var AccordionRoot =
|
|
5450
|
+
var AccordionRoot = React65.forwardRef(
|
|
5448
5451
|
(_a, ref) => {
|
|
5449
5452
|
var _b = _a, {
|
|
5450
5453
|
children,
|
|
@@ -5466,11 +5469,11 @@ var AccordionRoot = React66.forwardRef(
|
|
|
5466
5469
|
const theme2 = useTheme();
|
|
5467
5470
|
const { accordion } = theme2.tokens.components;
|
|
5468
5471
|
const isControlled = controlledValue !== void 0;
|
|
5469
|
-
const [internalValue, setInternalValue] =
|
|
5472
|
+
const [internalValue, setInternalValue] = React65.useState(
|
|
5470
5473
|
defaultValue != null ? defaultValue : []
|
|
5471
5474
|
);
|
|
5472
5475
|
const openValues = isControlled ? controlledValue : internalValue;
|
|
5473
|
-
const toggle =
|
|
5476
|
+
const toggle = React65.useCallback(
|
|
5474
5477
|
(itemValue) => {
|
|
5475
5478
|
const isOpen = openValues.includes(itemValue);
|
|
5476
5479
|
let next;
|
|
@@ -5488,7 +5491,7 @@ var AccordionRoot = React66.forwardRef(
|
|
|
5488
5491
|
},
|
|
5489
5492
|
[openValues, multiple, isControlled, onValueChange]
|
|
5490
5493
|
);
|
|
5491
|
-
const ctx =
|
|
5494
|
+
const ctx = React65.useMemo(
|
|
5492
5495
|
() => ({ openValues, toggle, disabled, size }),
|
|
5493
5496
|
[openValues, toggle, disabled, size]
|
|
5494
5497
|
);
|
|
@@ -5618,13 +5621,13 @@ function buildDelayedEntering(variant, delayMs) {
|
|
|
5618
5621
|
b.delay(delayMs);
|
|
5619
5622
|
return b;
|
|
5620
5623
|
}
|
|
5621
|
-
var Animated5 =
|
|
5624
|
+
var Animated5 = React65.forwardRef(
|
|
5622
5625
|
(_a, ref) => {
|
|
5623
5626
|
var _b = _a, { variant = "fade", delay, exit = true, children } = _b, props = __objRest(_b, ["variant", "delay", "exit", "children"]);
|
|
5624
5627
|
const delayMs = delay !== void 0 && delay > 0 ? Math.round(delay * 1e3) : 0;
|
|
5625
5628
|
const entering = delayMs > 0 ? buildDelayedEntering(variant, delayMs) : ENTERING[variant];
|
|
5626
5629
|
return /* @__PURE__ */ jsx(
|
|
5627
|
-
|
|
5630
|
+
Animated9.View,
|
|
5628
5631
|
__spreadProps(__spreadValues({
|
|
5629
5632
|
ref,
|
|
5630
5633
|
entering,
|
|
@@ -5636,7 +5639,7 @@ var Animated5 = React66.forwardRef(
|
|
|
5636
5639
|
}
|
|
5637
5640
|
);
|
|
5638
5641
|
Animated5.displayName = "Animated";
|
|
5639
|
-
var DrawerContext =
|
|
5642
|
+
var DrawerContext = React65.createContext({
|
|
5640
5643
|
isOpen: false,
|
|
5641
5644
|
modalVisible: false,
|
|
5642
5645
|
backdrop: true,
|
|
@@ -5647,12 +5650,13 @@ var DrawerContext = React66.createContext({
|
|
|
5647
5650
|
onExitComplete: () => {
|
|
5648
5651
|
}
|
|
5649
5652
|
});
|
|
5650
|
-
var useDrawerContext = () =>
|
|
5653
|
+
var useDrawerContext = () => React65.useContext(DrawerContext);
|
|
5651
5654
|
var DrawerOverlayContext = createContext(null);
|
|
5652
5655
|
var useDrawerOverlay = () => useContext(DrawerOverlayContext);
|
|
5653
5656
|
var FADE_DURATION = 220;
|
|
5654
|
-
var DrawerOverlay =
|
|
5657
|
+
var DrawerOverlay = React65.forwardRef(({ accessible = false }, _ref) => {
|
|
5655
5658
|
const theme2 = useTheme();
|
|
5659
|
+
const { width: screenWidth, height: screenHeight } = useWindowDimensions();
|
|
5656
5660
|
const { isOpen, closeDrawer, backdrop } = useDrawerContext();
|
|
5657
5661
|
const opacity = useRef(new Animated.Value(0)).current;
|
|
5658
5662
|
useEffect(() => {
|
|
@@ -5664,43 +5668,52 @@ var DrawerOverlay = React66.forwardRef(({ accessible = false }, _ref) => {
|
|
|
5664
5668
|
}, [isOpen, opacity]);
|
|
5665
5669
|
if (!backdrop) return null;
|
|
5666
5670
|
return /* @__PURE__ */ jsx(
|
|
5667
|
-
|
|
5671
|
+
Animated.View,
|
|
5668
5672
|
{
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
+
pointerEvents: "box-none",
|
|
5674
|
+
style: [
|
|
5675
|
+
StyleSheet.absoluteFillObject,
|
|
5676
|
+
{ width: screenWidth, height: screenHeight, opacity }
|
|
5677
|
+
],
|
|
5673
5678
|
children: /* @__PURE__ */ jsx(
|
|
5674
|
-
|
|
5679
|
+
Pressable,
|
|
5675
5680
|
{
|
|
5676
|
-
style:
|
|
5677
|
-
|
|
5681
|
+
style: { width: screenWidth, height: screenHeight },
|
|
5682
|
+
onPress: closeDrawer,
|
|
5683
|
+
accessible,
|
|
5684
|
+
accessibilityLabel: "Close drawer",
|
|
5685
|
+
children: /* @__PURE__ */ jsx(
|
|
5686
|
+
Animated.View,
|
|
5678
5687
|
{
|
|
5679
|
-
|
|
5680
|
-
|
|
5688
|
+
style: {
|
|
5689
|
+
width: screenWidth,
|
|
5690
|
+
height: screenHeight,
|
|
5691
|
+
backgroundColor: theme2.tokens.components.modal.overlay.colour
|
|
5692
|
+
}
|
|
5681
5693
|
}
|
|
5682
|
-
|
|
5694
|
+
)
|
|
5683
5695
|
}
|
|
5684
5696
|
)
|
|
5685
5697
|
}
|
|
5686
5698
|
);
|
|
5687
5699
|
});
|
|
5688
5700
|
DrawerOverlay.displayName = "Drawer.Overlay";
|
|
5689
|
-
var DrawerDragContext =
|
|
5690
|
-
var useDrawerDragContext = () =>
|
|
5701
|
+
var DrawerDragContext = React65.createContext(null);
|
|
5702
|
+
var useDrawerDragContext = () => React65.useContext(DrawerDragContext);
|
|
5691
5703
|
var DrawerMeasureContext = createContext(null);
|
|
5692
5704
|
var useDrawerMeasureContext = () => useContext(DrawerMeasureContext);
|
|
5693
5705
|
var DrawerBodyMaxContext = createContext(null);
|
|
5694
5706
|
var useDrawerBodyMax = () => useContext(DrawerBodyMaxContext);
|
|
5695
|
-
var DrawerFooterContext =
|
|
5696
|
-
var useDrawerFooterContext = () =>
|
|
5697
|
-
var DrawerHeaderContext =
|
|
5698
|
-
var useDrawerHeaderContext = () =>
|
|
5707
|
+
var DrawerFooterContext = React65.createContext(false);
|
|
5708
|
+
var useDrawerFooterContext = () => React65.useContext(DrawerFooterContext);
|
|
5709
|
+
var DrawerHeaderContext = React65.createContext(null);
|
|
5710
|
+
var useDrawerHeaderContext = () => React65.useContext(DrawerHeaderContext);
|
|
5711
|
+
var KEYBOARD_DURATION = 250;
|
|
5699
5712
|
var OPEN_DURATION = 320;
|
|
5700
5713
|
var CLOSE_DURATION = 220;
|
|
5701
5714
|
var DISMISS_THRESHOLD = 80;
|
|
5702
5715
|
var parseTokenValue23 = (value) => parseFloat(value);
|
|
5703
|
-
var StyledPanel2 =
|
|
5716
|
+
var StyledPanel2 = styled52(View)(
|
|
5704
5717
|
({
|
|
5705
5718
|
panelBorderRadius,
|
|
5706
5719
|
panelBgColor,
|
|
@@ -5731,7 +5744,7 @@ var StyledPanel2 = styled51(View)(
|
|
|
5731
5744
|
overflow: "hidden"
|
|
5732
5745
|
})
|
|
5733
5746
|
);
|
|
5734
|
-
var DrawerContent =
|
|
5747
|
+
var DrawerContent = React65.forwardRef(
|
|
5735
5748
|
(_a, ref) => {
|
|
5736
5749
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
5737
5750
|
var _a2;
|
|
@@ -5740,7 +5753,9 @@ var DrawerContent = React66.forwardRef(
|
|
|
5740
5753
|
const { colour, dimensions: dimensions3 } = theme2.tokens.semantics;
|
|
5741
5754
|
const { isOpen, closeDrawer, onExitComplete } = useDrawerContext();
|
|
5742
5755
|
const { height: windowHeight } = useWindowDimensions();
|
|
5743
|
-
const
|
|
5756
|
+
const [keyboardHeight, setKeyboardHeight] = useState(0);
|
|
5757
|
+
const keyboardSpacer = useRef(new Animated.Value(0)).current;
|
|
5758
|
+
const maxHeight = (windowHeight - keyboardHeight) * 0.9;
|
|
5744
5759
|
const topBorder = parseTokenValue23(dimensions3.borderWidth.sm);
|
|
5745
5760
|
const noFooterBodyPadding = parseTokenValue23(dimensions3.spacing["2xl"]);
|
|
5746
5761
|
const closeDrawerRef = useRef(closeDrawer);
|
|
@@ -5753,6 +5768,7 @@ var DrawerContent = React66.forwardRef(
|
|
|
5753
5768
|
const entryRanRef = useRef(false);
|
|
5754
5769
|
const isOpenRef = useRef(isOpen);
|
|
5755
5770
|
const activeAnim = useRef(null);
|
|
5771
|
+
const applyBodyMaxRef = useRef(null);
|
|
5756
5772
|
const [bodyMax, setBodyMax] = useState(null);
|
|
5757
5773
|
const bodyMaxRef = useRef(null);
|
|
5758
5774
|
const headerHeightRef = useRef(0);
|
|
@@ -5765,11 +5781,39 @@ var DrawerContent = React66.forwardRef(
|
|
|
5765
5781
|
});
|
|
5766
5782
|
return () => translateY.removeListener(id);
|
|
5767
5783
|
}, [translateY]);
|
|
5784
|
+
useEffect(() => {
|
|
5785
|
+
const showEvent = Platform.OS === "ios" ? "keyboardWillShow" : "keyboardDidShow";
|
|
5786
|
+
const hideEvent = Platform.OS === "ios" ? "keyboardWillHide" : "keyboardDidHide";
|
|
5787
|
+
const lift = (toValue, duration) => {
|
|
5788
|
+
Animated.timing(keyboardSpacer, {
|
|
5789
|
+
toValue,
|
|
5790
|
+
duration: duration && duration > 0 ? duration : KEYBOARD_DURATION,
|
|
5791
|
+
easing: Easing.out(Easing.ease),
|
|
5792
|
+
useNativeDriver: false
|
|
5793
|
+
}).start();
|
|
5794
|
+
};
|
|
5795
|
+
const shown = Keyboard.addListener(showEvent, (event) => {
|
|
5796
|
+
setKeyboardHeight(event.endCoordinates.height);
|
|
5797
|
+
lift(event.endCoordinates.height, event.duration);
|
|
5798
|
+
});
|
|
5799
|
+
const hidden = Keyboard.addListener(hideEvent, (event) => {
|
|
5800
|
+
setKeyboardHeight(0);
|
|
5801
|
+
lift(0, event.duration);
|
|
5802
|
+
});
|
|
5803
|
+
return () => {
|
|
5804
|
+
shown.remove();
|
|
5805
|
+
hidden.remove();
|
|
5806
|
+
};
|
|
5807
|
+
}, [keyboardSpacer]);
|
|
5768
5808
|
useEffect(() => {
|
|
5769
5809
|
if (panelHeightRef.current > maxHeight) {
|
|
5770
5810
|
panelHeightRef.current = maxHeight;
|
|
5771
5811
|
}
|
|
5772
5812
|
}, [maxHeight]);
|
|
5813
|
+
useEffect(() => {
|
|
5814
|
+
var _a3;
|
|
5815
|
+
(_a3 = applyBodyMaxRef.current) == null ? void 0 : _a3.call(applyBodyMaxRef);
|
|
5816
|
+
}, [maxHeight]);
|
|
5773
5817
|
const runEntry = useCallback(() => {
|
|
5774
5818
|
var _a3;
|
|
5775
5819
|
if (panelHeightRef.current === 0) return;
|
|
@@ -5834,6 +5878,7 @@ var DrawerContent = React66.forwardRef(
|
|
|
5834
5878
|
setBodyMax(availableBody);
|
|
5835
5879
|
}
|
|
5836
5880
|
}, [measureChrome, maxHeight]);
|
|
5881
|
+
applyBodyMaxRef.current = applyBodyMax;
|
|
5837
5882
|
const setHeaderHeight = useCallback(
|
|
5838
5883
|
(height) => {
|
|
5839
5884
|
if (height <= 0 || Math.abs(height - headerHeightRef.current) < 1)
|
|
@@ -5925,11 +5970,11 @@ var DrawerContent = React66.forwardRef(
|
|
|
5925
5970
|
() => ({ panHandlers: panResponder.panHandlers }),
|
|
5926
5971
|
[panResponder.panHandlers]
|
|
5927
5972
|
);
|
|
5928
|
-
const hasFooter =
|
|
5929
|
-
(child) =>
|
|
5973
|
+
const hasFooter = React65.Children.toArray(children).some(
|
|
5974
|
+
(child) => React65.isValidElement(child) && child.type.displayName === "Drawer.Footer"
|
|
5930
5975
|
);
|
|
5931
|
-
const headerChild =
|
|
5932
|
-
(child) =>
|
|
5976
|
+
const headerChild = React65.Children.toArray(children).find(
|
|
5977
|
+
(child) => React65.isValidElement(child) && child.type.displayName === "Drawer.Header"
|
|
5933
5978
|
);
|
|
5934
5979
|
hasHeaderRef.current = headerChild != null;
|
|
5935
5980
|
hasFooterRef.current = hasFooter;
|
|
@@ -5939,11 +5984,12 @@ var DrawerContent = React66.forwardRef(
|
|
|
5939
5984
|
return /* @__PURE__ */ jsx(DrawerHeaderContext.Provider, { value: headerContextValue, children: /* @__PURE__ */ jsx(DrawerFooterContext.Provider, { value: hasFooter, children: /* @__PURE__ */ jsx(DrawerMeasureContext.Provider, { value: measureContextValue, children: /* @__PURE__ */ jsx(DrawerDragContext.Provider, { value: dragContextValue, children: /* @__PURE__ */ jsx(
|
|
5940
5985
|
Animated.View,
|
|
5941
5986
|
{
|
|
5987
|
+
pointerEvents: "box-none",
|
|
5942
5988
|
style: [
|
|
5943
5989
|
styles.animatedWrapper,
|
|
5944
5990
|
{ transform: [{ translateY }] }
|
|
5945
5991
|
],
|
|
5946
|
-
children: /* @__PURE__ */
|
|
5992
|
+
children: /* @__PURE__ */ jsxs(
|
|
5947
5993
|
StyledPanel2,
|
|
5948
5994
|
__spreadProps(__spreadValues({
|
|
5949
5995
|
ref,
|
|
@@ -5951,7 +5997,7 @@ var DrawerContent = React66.forwardRef(
|
|
|
5951
5997
|
panelBorderRadius: parseTokenValue23(drawer.borderRadius.top),
|
|
5952
5998
|
panelBgColor: colour.background.container.default,
|
|
5953
5999
|
panelMaxWidth: parseTokenValue23(drawer.size.maxWidth),
|
|
5954
|
-
panelMaxHeight: maxHeight,
|
|
6000
|
+
panelMaxHeight: maxHeight + keyboardHeight,
|
|
5955
6001
|
panelBorderWidth: parseTokenValue23(dimensions3.borderWidth.sm),
|
|
5956
6002
|
panelBorderColor: colour.border.default,
|
|
5957
6003
|
panelShadowColor: modal.shadow.color,
|
|
@@ -5961,7 +6007,10 @@ var DrawerContent = React66.forwardRef(
|
|
|
5961
6007
|
accessibilityRole: "none",
|
|
5962
6008
|
accessibilityViewIsModal: true
|
|
5963
6009
|
}, props), {
|
|
5964
|
-
children:
|
|
6010
|
+
children: [
|
|
6011
|
+
/* @__PURE__ */ jsx(DrawerBodyMaxContext.Provider, { value: bodyMax, children }),
|
|
6012
|
+
/* @__PURE__ */ jsx(Animated.View, { style: { height: keyboardSpacer } })
|
|
6013
|
+
]
|
|
5965
6014
|
})
|
|
5966
6015
|
)
|
|
5967
6016
|
}
|
|
@@ -5978,7 +6027,7 @@ var styles = StyleSheet.create({
|
|
|
5978
6027
|
}
|
|
5979
6028
|
});
|
|
5980
6029
|
var parseTokenValue24 = (value) => parseFloat(value);
|
|
5981
|
-
var StyledWrapper =
|
|
6030
|
+
var StyledWrapper = styled52(View)(
|
|
5982
6031
|
({ grabberPaddingTop }) => ({
|
|
5983
6032
|
alignItems: "center",
|
|
5984
6033
|
justifyContent: "center",
|
|
@@ -5987,13 +6036,13 @@ var StyledWrapper = styled51(View)(
|
|
|
5987
6036
|
paddingBottom: grabberPaddingTop
|
|
5988
6037
|
})
|
|
5989
6038
|
);
|
|
5990
|
-
var StyledBar =
|
|
6039
|
+
var StyledBar = styled52(View)(({ barWidth, barHeight, barBorderRadius, barColor }) => ({
|
|
5991
6040
|
width: barWidth,
|
|
5992
6041
|
height: barHeight,
|
|
5993
6042
|
borderRadius: barBorderRadius,
|
|
5994
6043
|
backgroundColor: barColor
|
|
5995
6044
|
}));
|
|
5996
|
-
var DrawerGrabber =
|
|
6045
|
+
var DrawerGrabber = React65.forwardRef(
|
|
5997
6046
|
(props, ref) => {
|
|
5998
6047
|
var _a;
|
|
5999
6048
|
const theme2 = useTheme();
|
|
@@ -6021,7 +6070,7 @@ var DrawerGrabber = React66.forwardRef(
|
|
|
6021
6070
|
);
|
|
6022
6071
|
DrawerGrabber.displayName = "Drawer.Grabber";
|
|
6023
6072
|
var parseTokenValue25 = (value) => parseFloat(value);
|
|
6024
|
-
var DrawerClose =
|
|
6073
|
+
var DrawerClose = React65.forwardRef(
|
|
6025
6074
|
(_a, ref) => {
|
|
6026
6075
|
var _b = _a, { "aria-label": ariaLabel = "Close" } = _b, props = __objRest(_b, ["aria-label"]);
|
|
6027
6076
|
const theme2 = useTheme();
|
|
@@ -6068,7 +6117,7 @@ var styles2 = StyleSheet.create({
|
|
|
6068
6117
|
}
|
|
6069
6118
|
});
|
|
6070
6119
|
var parseTokenValue26 = (value) => parseFloat(value);
|
|
6071
|
-
var StyledGrabberWrapper =
|
|
6120
|
+
var StyledGrabberWrapper = styled52(View)(
|
|
6072
6121
|
({ grabberPaddingTop }) => ({
|
|
6073
6122
|
alignItems: "center",
|
|
6074
6123
|
justifyContent: "center",
|
|
@@ -6076,13 +6125,13 @@ var StyledGrabberWrapper = styled51(View)(
|
|
|
6076
6125
|
paddingTop: grabberPaddingTop
|
|
6077
6126
|
})
|
|
6078
6127
|
);
|
|
6079
|
-
var StyledGrabberBar =
|
|
6128
|
+
var StyledGrabberBar = styled52(View)(({ barWidth, barHeight, barBorderRadius, barColor }) => ({
|
|
6080
6129
|
width: barWidth,
|
|
6081
6130
|
height: barHeight,
|
|
6082
6131
|
borderRadius: barBorderRadius,
|
|
6083
6132
|
backgroundColor: barColor
|
|
6084
6133
|
}));
|
|
6085
|
-
var StyledHeader =
|
|
6134
|
+
var StyledHeader = styled52(View)(
|
|
6086
6135
|
({
|
|
6087
6136
|
headerPaddingHorizontal,
|
|
6088
6137
|
headerPaddingBottom,
|
|
@@ -6102,7 +6151,7 @@ var StyledHeader = styled51(View)(
|
|
|
6102
6151
|
borderBottomColor: headerBorderColor
|
|
6103
6152
|
} : {}), headerBgColor ? { backgroundColor: headerBgColor } : {})
|
|
6104
6153
|
);
|
|
6105
|
-
var StyledImageContainer =
|
|
6154
|
+
var StyledImageContainer = styled52(View)(({ imageHeight, imageBorderRadius }) => ({
|
|
6106
6155
|
position: "relative",
|
|
6107
6156
|
width: "100%",
|
|
6108
6157
|
height: imageHeight,
|
|
@@ -6110,20 +6159,20 @@ var StyledImageContainer = styled51(View)(({ imageHeight, imageBorderRadius }) =
|
|
|
6110
6159
|
overflow: "hidden",
|
|
6111
6160
|
flexShrink: 0
|
|
6112
6161
|
}));
|
|
6113
|
-
var StyledImageCloseWrapper =
|
|
6162
|
+
var StyledImageCloseWrapper = styled52(View)(({ closeTop, closeRight }) => ({
|
|
6114
6163
|
position: "absolute",
|
|
6115
6164
|
top: closeTop,
|
|
6116
6165
|
right: closeRight,
|
|
6117
6166
|
zIndex: 1
|
|
6118
6167
|
}));
|
|
6119
|
-
var StyledTitleRow =
|
|
6168
|
+
var StyledTitleRow = styled52(View)(({ rowGap }) => ({
|
|
6120
6169
|
flexDirection: "row",
|
|
6121
6170
|
gap: rowGap,
|
|
6122
6171
|
alignItems: "flex-start",
|
|
6123
6172
|
width: "100%",
|
|
6124
6173
|
flexShrink: 0
|
|
6125
6174
|
}));
|
|
6126
|
-
var StyledTitleContent =
|
|
6175
|
+
var StyledTitleContent = styled52(View)(
|
|
6127
6176
|
({ contentGap }) => ({
|
|
6128
6177
|
flexDirection: "column",
|
|
6129
6178
|
gap: contentGap,
|
|
@@ -6134,8 +6183,8 @@ var StyledTitleContent = styled51(View)(
|
|
|
6134
6183
|
function splitChildren(children) {
|
|
6135
6184
|
let closeChild = null;
|
|
6136
6185
|
const otherChildren = [];
|
|
6137
|
-
|
|
6138
|
-
if (
|
|
6186
|
+
React65.Children.forEach(children, (child) => {
|
|
6187
|
+
if (React65.isValidElement(child) && child.type === DrawerClose) {
|
|
6139
6188
|
closeChild = child;
|
|
6140
6189
|
} else {
|
|
6141
6190
|
otherChildren.push(child);
|
|
@@ -6143,7 +6192,7 @@ function splitChildren(children) {
|
|
|
6143
6192
|
});
|
|
6144
6193
|
return { closeChild, otherChildren };
|
|
6145
6194
|
}
|
|
6146
|
-
var DrawerHeader =
|
|
6195
|
+
var DrawerHeader = React65.forwardRef(
|
|
6147
6196
|
(_a, ref) => {
|
|
6148
6197
|
var _b = _a, { variant = "titleAndText", imageSource, children, onLayout } = _b, props = __objRest(_b, ["variant", "imageSource", "children", "onLayout"]);
|
|
6149
6198
|
var _a2, _b2, _c, _d, _e, _f;
|
|
@@ -6239,7 +6288,7 @@ var DrawerHeader = React66.forwardRef(
|
|
|
6239
6288
|
}
|
|
6240
6289
|
);
|
|
6241
6290
|
DrawerHeader.displayName = "Drawer.Header";
|
|
6242
|
-
var DrawerTitle =
|
|
6291
|
+
var DrawerTitle = React65.forwardRef(
|
|
6243
6292
|
(_a, ref) => {
|
|
6244
6293
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
6245
6294
|
const theme2 = useTheme();
|
|
@@ -6255,7 +6304,7 @@ var DrawerTitle = React66.forwardRef(
|
|
|
6255
6304
|
}
|
|
6256
6305
|
);
|
|
6257
6306
|
DrawerTitle.displayName = "Drawer.Title";
|
|
6258
|
-
var DrawerDescription =
|
|
6307
|
+
var DrawerDescription = React65.forwardRef(
|
|
6259
6308
|
(_a, ref) => {
|
|
6260
6309
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
6261
6310
|
const theme2 = useTheme();
|
|
@@ -6271,28 +6320,8 @@ var DrawerDescription = React66.forwardRef(
|
|
|
6271
6320
|
}
|
|
6272
6321
|
);
|
|
6273
6322
|
DrawerDescription.displayName = "Drawer.Description";
|
|
6274
|
-
var useDrawerKeyboardAvoidance = (minPadding = 16) => {
|
|
6275
|
-
const [keyboardHeight, setKeyboardHeight] = useState(0);
|
|
6276
|
-
useEffect(() => {
|
|
6277
|
-
const showListener = Keyboard.addListener("keyboardDidShow", (e) => {
|
|
6278
|
-
setKeyboardHeight(e.endCoordinates.height);
|
|
6279
|
-
});
|
|
6280
|
-
const hideListener = Keyboard.addListener("keyboardDidHide", () => {
|
|
6281
|
-
setKeyboardHeight(0);
|
|
6282
|
-
});
|
|
6283
|
-
return () => {
|
|
6284
|
-
showListener.remove();
|
|
6285
|
-
hideListener.remove();
|
|
6286
|
-
};
|
|
6287
|
-
}, []);
|
|
6288
|
-
return {
|
|
6289
|
-
contentContainerStyle: {
|
|
6290
|
-
paddingBottom: Math.max(minPadding, keyboardHeight)
|
|
6291
|
-
}
|
|
6292
|
-
};
|
|
6293
|
-
};
|
|
6294
6323
|
var parseTokenValue27 = (value) => parseFloat(value);
|
|
6295
|
-
var StyledScrollView =
|
|
6324
|
+
var StyledScrollView = styled52(ScrollView)(
|
|
6296
6325
|
({
|
|
6297
6326
|
bodyPaddingHorizontal,
|
|
6298
6327
|
bodyPaddingRight,
|
|
@@ -6310,17 +6339,9 @@ var StyledScrollView = styled51(ScrollView)(
|
|
|
6310
6339
|
paddingBottom: bodyPaddingBottom
|
|
6311
6340
|
})
|
|
6312
6341
|
);
|
|
6313
|
-
var DrawerBody =
|
|
6342
|
+
var DrawerBody = React65.forwardRef(
|
|
6314
6343
|
(_a, ref) => {
|
|
6315
|
-
var _b = _a, {
|
|
6316
|
-
children,
|
|
6317
|
-
contentContainerStyle,
|
|
6318
|
-
ignoreKeyboardAvoidance = false
|
|
6319
|
-
} = _b, props = __objRest(_b, [
|
|
6320
|
-
"children",
|
|
6321
|
-
"contentContainerStyle",
|
|
6322
|
-
"ignoreKeyboardAvoidance"
|
|
6323
|
-
]);
|
|
6344
|
+
var _b = _a, { children, contentContainerStyle } = _b, props = __objRest(_b, ["children", "contentContainerStyle"]);
|
|
6324
6345
|
const theme2 = useTheme();
|
|
6325
6346
|
const { spacing } = theme2.tokens.components.drawer;
|
|
6326
6347
|
const { buttons } = theme2.tokens.components;
|
|
@@ -6330,8 +6351,6 @@ var DrawerBody = React66.forwardRef(
|
|
|
6330
6351
|
const providedMaxHeight = useDrawerBodyMax();
|
|
6331
6352
|
const { height: windowHeight } = useWindowDimensions();
|
|
6332
6353
|
const insets = useSafeAreaInsets();
|
|
6333
|
-
const { contentContainerStyle: keyboardStyle } = useDrawerKeyboardAvoidance();
|
|
6334
|
-
const effectiveKeyboardStyle = ignoreKeyboardAvoidance ? {} : keyboardStyle;
|
|
6335
6354
|
const gap = parseTokenValue27(content.slot.gap);
|
|
6336
6355
|
const horizontalPadding = parseTokenValue27(content.slot.horizontalPadding);
|
|
6337
6356
|
const topPadding = parseTokenValue27(content.slot.verticalPadding);
|
|
@@ -6355,7 +6374,6 @@ var DrawerBody = React66.forwardRef(
|
|
|
6355
6374
|
paddingTop: topPadding,
|
|
6356
6375
|
paddingBottom: 0
|
|
6357
6376
|
},
|
|
6358
|
-
effectiveKeyboardStyle,
|
|
6359
6377
|
contentContainerStyle
|
|
6360
6378
|
]
|
|
6361
6379
|
}, props), {
|
|
@@ -6366,13 +6384,13 @@ var DrawerBody = React66.forwardRef(
|
|
|
6366
6384
|
);
|
|
6367
6385
|
DrawerBody.displayName = "Drawer.Body";
|
|
6368
6386
|
var parseTokenValue28 = (value) => parseFloat(value);
|
|
6369
|
-
var StyledFooter =
|
|
6387
|
+
var StyledFooter = styled52(View)(({ footerPaddingTop, footerPaddingHorizontal, footerPaddingBottom }) => ({
|
|
6370
6388
|
flexShrink: 0,
|
|
6371
6389
|
paddingTop: footerPaddingTop,
|
|
6372
6390
|
paddingHorizontal: footerPaddingHorizontal,
|
|
6373
6391
|
paddingBottom: footerPaddingBottom
|
|
6374
6392
|
}));
|
|
6375
|
-
var DrawerFooter =
|
|
6393
|
+
var DrawerFooter = React65.forwardRef(
|
|
6376
6394
|
(_a, ref) => {
|
|
6377
6395
|
var _b = _a, { children, onLayout } = _b, props = __objRest(_b, ["children", "onLayout"]);
|
|
6378
6396
|
const theme2 = useTheme();
|
|
@@ -6403,7 +6421,7 @@ var DrawerFooter = React66.forwardRef(
|
|
|
6403
6421
|
}
|
|
6404
6422
|
);
|
|
6405
6423
|
DrawerFooter.displayName = "Drawer.Footer";
|
|
6406
|
-
var DrawerRoot =
|
|
6424
|
+
var DrawerRoot = React65.forwardRef(
|
|
6407
6425
|
(_a, ref) => {
|
|
6408
6426
|
var _b = _a, {
|
|
6409
6427
|
open: controlledOpen,
|
|
@@ -6485,15 +6503,15 @@ var DrawerRoot = React66.forwardRef(
|
|
|
6485
6503
|
}
|
|
6486
6504
|
);
|
|
6487
6505
|
DrawerRoot.displayName = "Drawer";
|
|
6488
|
-
var DrawerTrigger =
|
|
6506
|
+
var DrawerTrigger = React65.forwardRef(
|
|
6489
6507
|
({ children }, ref) => {
|
|
6490
|
-
const { openDrawer } =
|
|
6508
|
+
const { openDrawer } = React65.useContext(DrawerContext);
|
|
6491
6509
|
return /* @__PURE__ */ jsx(Slot, { ref, onPress: openDrawer, children });
|
|
6492
6510
|
}
|
|
6493
6511
|
);
|
|
6494
6512
|
DrawerTrigger.displayName = "Drawer.Trigger";
|
|
6495
6513
|
var DrawerPortal = ({ children, topContent }) => {
|
|
6496
|
-
const { modalVisible, closeDrawer, backdrop } =
|
|
6514
|
+
const { modalVisible, closeDrawer, backdrop } = React65.useContext(DrawerContext);
|
|
6497
6515
|
const OverlayComponent = useDrawerOverlay();
|
|
6498
6516
|
if (!modalVisible) return null;
|
|
6499
6517
|
if (!backdrop) {
|
|
@@ -6545,7 +6563,7 @@ var styles3 = StyleSheet.create({
|
|
|
6545
6563
|
}
|
|
6546
6564
|
});
|
|
6547
6565
|
var parseTokenValue29 = (value) => parseFloat(value);
|
|
6548
|
-
var StyledDockRoot =
|
|
6566
|
+
var StyledDockRoot = styled52(View)(
|
|
6549
6567
|
({
|
|
6550
6568
|
dockBgColor,
|
|
6551
6569
|
dockBorderTopWidth,
|
|
@@ -6563,7 +6581,7 @@ var StyledDockRoot = styled51(View)(
|
|
|
6563
6581
|
paddingHorizontal: dockPaddingHorizontal
|
|
6564
6582
|
})
|
|
6565
6583
|
);
|
|
6566
|
-
var StyledStackedInner =
|
|
6584
|
+
var StyledStackedInner = styled52(View)(
|
|
6567
6585
|
({ innerGap }) => ({
|
|
6568
6586
|
alignItems: "center",
|
|
6569
6587
|
gap: innerGap,
|
|
@@ -6571,14 +6589,14 @@ var StyledStackedInner = styled51(View)(
|
|
|
6571
6589
|
maxWidth: 520
|
|
6572
6590
|
})
|
|
6573
6591
|
);
|
|
6574
|
-
var StyledButtonGroup =
|
|
6592
|
+
var StyledButtonGroup = styled52(View)(({ groupDirection, groupAlign, groupJustify, groupGap }) => __spreadValues({
|
|
6575
6593
|
flexDirection: groupDirection,
|
|
6576
6594
|
alignItems: groupAlign,
|
|
6577
6595
|
justifyContent: groupJustify,
|
|
6578
6596
|
gap: groupGap,
|
|
6579
6597
|
width: "100%"
|
|
6580
6598
|
}, groupDirection === "column" ? { maxWidth: 520 } : {}));
|
|
6581
|
-
var ButtonDock =
|
|
6599
|
+
var ButtonDock = React65.forwardRef(
|
|
6582
6600
|
(_a, ref) => {
|
|
6583
6601
|
var _b = _a, { variant = "stacked", leadingContent, description, children } = _b, rest = __objRest(_b, ["variant", "leadingContent", "description", "children"]);
|
|
6584
6602
|
const theme2 = useTheme();
|
|
@@ -6645,20 +6663,20 @@ var ButtonDock = React66.forwardRef(
|
|
|
6645
6663
|
);
|
|
6646
6664
|
ButtonDock.displayName = "ButtonDock";
|
|
6647
6665
|
var parseTokenValue30 = (value) => parseFloat(value);
|
|
6648
|
-
var StyledGroupRoot =
|
|
6666
|
+
var StyledGroupRoot = styled52(View)(({ rootGap }) => ({
|
|
6649
6667
|
gap: rootGap,
|
|
6650
6668
|
alignItems: "center",
|
|
6651
6669
|
width: "100%"
|
|
6652
6670
|
}));
|
|
6653
|
-
var StyledButtonRow =
|
|
6671
|
+
var StyledButtonRow = styled52(View)(({ rowDirection, rowAlign, rowGap }) => __spreadValues({
|
|
6654
6672
|
flexDirection: rowDirection,
|
|
6655
6673
|
width: "100%",
|
|
6656
6674
|
gap: rowGap
|
|
6657
6675
|
}, rowAlign ? { alignItems: rowAlign } : {}));
|
|
6658
|
-
var StyledChildSlot =
|
|
6676
|
+
var StyledChildSlot = styled52(View)(
|
|
6659
6677
|
({ slotInline }) => __spreadValues({}, slotInline ? { flex: 1, minWidth: 0 } : { width: "100%", alignSelf: "stretch" })
|
|
6660
6678
|
);
|
|
6661
|
-
var ButtonGroup =
|
|
6679
|
+
var ButtonGroup = React65.forwardRef(
|
|
6662
6680
|
(_a, ref) => {
|
|
6663
6681
|
var _b = _a, { layout = "stacked", description, children } = _b, rest = __objRest(_b, ["layout", "description", "children"]);
|
|
6664
6682
|
const theme2 = useTheme();
|
|
@@ -6680,9 +6698,9 @@ var ButtonGroup = React66.forwardRef(
|
|
|
6680
6698
|
rowGap: parseTokenValue30(
|
|
6681
6699
|
isInline ? buttonGroup.spacing.sideBySide.gap : buttonGroup.spacing.stacked.gap
|
|
6682
6700
|
),
|
|
6683
|
-
children:
|
|
6684
|
-
if (!
|
|
6685
|
-
return /* @__PURE__ */ jsx(StyledChildSlot, { slotInline: isInline, children:
|
|
6701
|
+
children: React65.Children.map(children, (child, index) => {
|
|
6702
|
+
if (!React65.isValidElement(child)) return child;
|
|
6703
|
+
return /* @__PURE__ */ jsx(StyledChildSlot, { slotInline: isInline, children: React65.cloneElement(
|
|
6686
6704
|
child,
|
|
6687
6705
|
{
|
|
6688
6706
|
fullWidth: true
|
|
@@ -6707,7 +6725,7 @@ var ButtonGroup = React66.forwardRef(
|
|
|
6707
6725
|
);
|
|
6708
6726
|
ButtonGroup.displayName = "ButtonGroup";
|
|
6709
6727
|
var parseTokenValue31 = (value) => parseFloat(value);
|
|
6710
|
-
var StyledRootPressable =
|
|
6728
|
+
var StyledRootPressable = styled52(Pressable)(
|
|
6711
6729
|
({
|
|
6712
6730
|
rootFlexAlign,
|
|
6713
6731
|
rootGap,
|
|
@@ -6727,7 +6745,7 @@ var StyledRootPressable = styled51(Pressable)(
|
|
|
6727
6745
|
opacity: rootOpacity
|
|
6728
6746
|
}, rootPaddingVertical !== void 0 ? { paddingVertical: rootPaddingVertical } : {}), rootPaddingHorizontal !== void 0 ? { paddingHorizontal: rootPaddingHorizontal } : {}), rootMaxWidth !== void 0 ? rootFitContent ? { maxWidth: rootMaxWidth, alignSelf: "flex-start" } : { maxWidth: rootMaxWidth, width: "100%" } : {}), rootBgColor ? { backgroundColor: rootBgColor } : {}), rootBorderWidth !== void 0 ? { borderWidth: rootBorderWidth, borderColor: rootBorderColor } : {}), rootBorderRadius !== void 0 ? { borderRadius: rootBorderRadius } : {})
|
|
6729
6747
|
);
|
|
6730
|
-
var StyledControl =
|
|
6748
|
+
var StyledControl = styled52(View)(
|
|
6731
6749
|
({
|
|
6732
6750
|
controlSize,
|
|
6733
6751
|
controlBorderWidth,
|
|
@@ -6746,19 +6764,19 @@ var StyledControl = styled51(View)(
|
|
|
6746
6764
|
justifyContent: "center"
|
|
6747
6765
|
})
|
|
6748
6766
|
);
|
|
6749
|
-
var StyledContent2 =
|
|
6767
|
+
var StyledContent2 = styled52(View)(({ contentGap, contentFlex, contentFitContent }) => __spreadValues({
|
|
6750
6768
|
flexDirection: "column",
|
|
6751
6769
|
gap: contentGap,
|
|
6752
6770
|
flex: contentFlex,
|
|
6753
6771
|
minWidth: 0
|
|
6754
6772
|
}, contentFitContent ? { maxWidth: "85%" } : {}));
|
|
6755
|
-
var StyledIllustration =
|
|
6773
|
+
var StyledIllustration = styled52(View)(({ illustrationSize }) => ({
|
|
6756
6774
|
flexShrink: 0,
|
|
6757
6775
|
width: illustrationSize,
|
|
6758
6776
|
height: illustrationSize,
|
|
6759
6777
|
overflow: "hidden"
|
|
6760
6778
|
}));
|
|
6761
|
-
var Checkbox =
|
|
6779
|
+
var Checkbox = React65.forwardRef(
|
|
6762
6780
|
(_a, ref) => {
|
|
6763
6781
|
var _b = _a, {
|
|
6764
6782
|
variant = "standalone",
|
|
@@ -6787,7 +6805,7 @@ var Checkbox = React66.forwardRef(
|
|
|
6787
6805
|
const { checkbox } = theme2.tokens.components;
|
|
6788
6806
|
const { dimensions: dimensions3 } = theme2.tokens.semantics;
|
|
6789
6807
|
const isControlled = controlledChecked !== void 0;
|
|
6790
|
-
const [internalChecked, setInternalChecked] =
|
|
6808
|
+
const [internalChecked, setInternalChecked] = React65.useState(defaultChecked);
|
|
6791
6809
|
const isChecked = isControlled ? controlledChecked : internalChecked;
|
|
6792
6810
|
const handlePress = () => {
|
|
6793
6811
|
if (disabled) return;
|
|
@@ -6876,22 +6894,22 @@ var Checkbox = React66.forwardRef(
|
|
|
6876
6894
|
);
|
|
6877
6895
|
Checkbox.displayName = "Checkbox";
|
|
6878
6896
|
var parseTokenValue32 = (value) => parseFloat(value);
|
|
6879
|
-
var StyledGroup =
|
|
6897
|
+
var StyledGroup = styled52(View)(({ groupDirection, groupGap, groupWrap }) => ({
|
|
6880
6898
|
flexDirection: groupDirection,
|
|
6881
6899
|
gap: groupGap,
|
|
6882
6900
|
flexWrap: groupWrap ? "wrap" : "nowrap"
|
|
6883
6901
|
}));
|
|
6884
|
-
var CheckboxGroup =
|
|
6902
|
+
var CheckboxGroup = React65.forwardRef(
|
|
6885
6903
|
(_a, ref) => {
|
|
6886
6904
|
var _b = _a, { orientation = "vertical", children } = _b, rest = __objRest(_b, ["orientation", "children"]);
|
|
6887
6905
|
const theme2 = useTheme();
|
|
6888
6906
|
const { checkbox } = theme2.tokens.components;
|
|
6889
6907
|
const isHorizontal = orientation === "horizontal";
|
|
6890
|
-
const renderChildren = () => isHorizontal ?
|
|
6908
|
+
const renderChildren = () => isHorizontal ? React65.Children.map(children, (child) => {
|
|
6891
6909
|
var _a2;
|
|
6892
|
-
if (!
|
|
6910
|
+
if (!React65.isValidElement(child)) return child;
|
|
6893
6911
|
const childProps = child.props;
|
|
6894
|
-
return
|
|
6912
|
+
return React65.cloneElement(
|
|
6895
6913
|
child,
|
|
6896
6914
|
{ fitContent: (_a2 = childProps.fitContent) != null ? _a2 : true }
|
|
6897
6915
|
);
|
|
@@ -6910,7 +6928,7 @@ var CheckboxGroup = React66.forwardRef(
|
|
|
6910
6928
|
}
|
|
6911
6929
|
);
|
|
6912
6930
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
6913
|
-
var CopyFieldInput =
|
|
6931
|
+
var CopyFieldInput = React65.forwardRef(
|
|
6914
6932
|
(_a, ref) => {
|
|
6915
6933
|
var _b = _a, {
|
|
6916
6934
|
onCopy,
|
|
@@ -6929,19 +6947,19 @@ var CopyFieldInput = React66.forwardRef(
|
|
|
6929
6947
|
"editable",
|
|
6930
6948
|
"defaultValue"
|
|
6931
6949
|
]);
|
|
6932
|
-
const [internalValue, setInternalValue] =
|
|
6950
|
+
const [internalValue, setInternalValue] = React65.useState(
|
|
6933
6951
|
typeof defaultValue === "string" ? defaultValue : ""
|
|
6934
6952
|
);
|
|
6935
|
-
const [copied, setCopied] =
|
|
6936
|
-
const timeoutRef =
|
|
6953
|
+
const [copied, setCopied] = React65.useState(false);
|
|
6954
|
+
const timeoutRef = React65.useRef(
|
|
6937
6955
|
void 0
|
|
6938
6956
|
);
|
|
6939
|
-
|
|
6957
|
+
React65.useEffect(() => {
|
|
6940
6958
|
if (defaultValue !== void 0 && value === void 0) {
|
|
6941
6959
|
setInternalValue(typeof defaultValue === "string" ? defaultValue : "");
|
|
6942
6960
|
}
|
|
6943
6961
|
}, [defaultValue, value]);
|
|
6944
|
-
|
|
6962
|
+
React65.useEffect(() => {
|
|
6945
6963
|
return () => {
|
|
6946
6964
|
if (timeoutRef.current) {
|
|
6947
6965
|
clearTimeout(timeoutRef.current);
|
|
@@ -7002,13 +7020,13 @@ var CopyFieldInput = React66.forwardRef(
|
|
|
7002
7020
|
);
|
|
7003
7021
|
CopyFieldInput.displayName = "CopyField.Field";
|
|
7004
7022
|
var parseTokenValue33 = (value) => parseFloat(value);
|
|
7005
|
-
var StyledRoot8 =
|
|
7023
|
+
var StyledRoot8 = styled52(View)(({ theme: theme2 }) => {
|
|
7006
7024
|
const { spacing } = theme2.tokens.components.inputs;
|
|
7007
7025
|
return {
|
|
7008
7026
|
gap: parseTokenValue33(spacing.gap)
|
|
7009
7027
|
};
|
|
7010
7028
|
});
|
|
7011
|
-
var CopyFieldRoot =
|
|
7029
|
+
var CopyFieldRoot = React65.forwardRef(
|
|
7012
7030
|
(_a, ref) => {
|
|
7013
7031
|
var _b = _a, {
|
|
7014
7032
|
label,
|
|
@@ -7076,20 +7094,20 @@ var useCopyField = (options = {}) => {
|
|
|
7076
7094
|
onCopy: handleCopy
|
|
7077
7095
|
};
|
|
7078
7096
|
};
|
|
7079
|
-
var FilterTabContext =
|
|
7097
|
+
var FilterTabContext = React65.createContext({
|
|
7080
7098
|
size: "sm",
|
|
7081
7099
|
selectedValues: [],
|
|
7082
7100
|
toggle: () => {
|
|
7083
7101
|
}
|
|
7084
7102
|
});
|
|
7085
7103
|
var parseTokenValue34 = (value) => parseFloat(value);
|
|
7086
|
-
var StyledRoot9 =
|
|
7104
|
+
var StyledRoot9 = styled52(View)(({ rootGap }) => ({
|
|
7087
7105
|
flexDirection: "row",
|
|
7088
7106
|
alignItems: "center",
|
|
7089
7107
|
gap: rootGap,
|
|
7090
7108
|
flexWrap: "nowrap"
|
|
7091
7109
|
}));
|
|
7092
|
-
var StyledItem2 =
|
|
7110
|
+
var StyledItem2 = styled52(Pressable)(
|
|
7093
7111
|
({
|
|
7094
7112
|
itemHeight,
|
|
7095
7113
|
itemMinWidth,
|
|
@@ -7115,7 +7133,7 @@ var StyledItem2 = styled51(Pressable)(
|
|
|
7115
7133
|
flexShrink: 0
|
|
7116
7134
|
})
|
|
7117
7135
|
);
|
|
7118
|
-
var FilterTabItem =
|
|
7136
|
+
var FilterTabItem = React65.forwardRef(
|
|
7119
7137
|
(_a, ref) => {
|
|
7120
7138
|
var _b = _a, {
|
|
7121
7139
|
value,
|
|
@@ -7135,7 +7153,7 @@ var FilterTabItem = React66.forwardRef(
|
|
|
7135
7153
|
"accessibilityLabel"
|
|
7136
7154
|
]);
|
|
7137
7155
|
const theme2 = useTheme();
|
|
7138
|
-
const { size, selectedValues, toggle } =
|
|
7156
|
+
const { size, selectedValues, toggle } = React65.useContext(FilterTabContext);
|
|
7139
7157
|
const isSelected = selectedValues.includes(value);
|
|
7140
7158
|
const isIconOnly = !!IconOnlyIcon && !label;
|
|
7141
7159
|
const isActive = isSelected && !disabled;
|
|
@@ -7209,7 +7227,7 @@ var FilterTabItem = React66.forwardRef(
|
|
|
7209
7227
|
}
|
|
7210
7228
|
);
|
|
7211
7229
|
FilterTabItem.displayName = "FilterTab.Item";
|
|
7212
|
-
var FilterTabRoot =
|
|
7230
|
+
var FilterTabRoot = React65.forwardRef(
|
|
7213
7231
|
(_a, ref) => {
|
|
7214
7232
|
var _b = _a, {
|
|
7215
7233
|
size = "sm",
|
|
@@ -7229,9 +7247,9 @@ var FilterTabRoot = React66.forwardRef(
|
|
|
7229
7247
|
const theme2 = useTheme();
|
|
7230
7248
|
const { filterTabs } = theme2.tokens.components;
|
|
7231
7249
|
const isControlled = controlledValue !== void 0;
|
|
7232
|
-
const [internalValue, setInternalValue] =
|
|
7250
|
+
const [internalValue, setInternalValue] = React65.useState(defaultValue);
|
|
7233
7251
|
const selectedValues = isControlled ? controlledValue : internalValue;
|
|
7234
|
-
const toggle =
|
|
7252
|
+
const toggle = React65.useCallback(
|
|
7235
7253
|
(itemValue) => {
|
|
7236
7254
|
let next;
|
|
7237
7255
|
if (multiple) {
|
|
@@ -7244,7 +7262,7 @@ var FilterTabRoot = React66.forwardRef(
|
|
|
7244
7262
|
},
|
|
7245
7263
|
[selectedValues, isControlled, onValueChange, multiple]
|
|
7246
7264
|
);
|
|
7247
|
-
const contextValue =
|
|
7265
|
+
const contextValue = React65.useMemo(
|
|
7248
7266
|
() => ({ size, selectedValues, toggle }),
|
|
7249
7267
|
[size, selectedValues, toggle]
|
|
7250
7268
|
);
|
|
@@ -7264,7 +7282,7 @@ var FilterTab = Object.assign(FilterTabRoot, {
|
|
|
7264
7282
|
Item: FilterTabItem
|
|
7265
7283
|
});
|
|
7266
7284
|
var parseTokenValue35 = (value) => parseFloat(value);
|
|
7267
|
-
var StyledFieldWrapper =
|
|
7285
|
+
var StyledFieldWrapper = styled52(View)(
|
|
7268
7286
|
({
|
|
7269
7287
|
fieldBgColor,
|
|
7270
7288
|
fieldBorderColor,
|
|
@@ -7288,7 +7306,7 @@ var StyledFieldWrapper = styled51(View)(
|
|
|
7288
7306
|
overflow: "hidden"
|
|
7289
7307
|
}, fullWidth && { flex: 1 })
|
|
7290
7308
|
);
|
|
7291
|
-
var StyledTextInput =
|
|
7309
|
+
var StyledTextInput = styled52(TextInput)(
|
|
7292
7310
|
({
|
|
7293
7311
|
inputColor,
|
|
7294
7312
|
inputFontFamily,
|
|
@@ -7309,12 +7327,12 @@ var StyledTextInput = styled51(TextInput)(
|
|
|
7309
7327
|
fontSize: inputFontSize
|
|
7310
7328
|
}), hasInlineHelp ? { position: "relative", top: -8 } : {})
|
|
7311
7329
|
);
|
|
7312
|
-
var StyledRow =
|
|
7330
|
+
var StyledRow = styled52(View)(({ rowGap }) => ({
|
|
7313
7331
|
flexDirection: "row",
|
|
7314
7332
|
alignItems: "center",
|
|
7315
7333
|
gap: rowGap
|
|
7316
7334
|
}));
|
|
7317
|
-
var NumberFieldInput =
|
|
7335
|
+
var NumberFieldInput = React65.forwardRef(
|
|
7318
7336
|
(_a, ref) => {
|
|
7319
7337
|
var _b = _a, {
|
|
7320
7338
|
fieldSize = "lg",
|
|
@@ -7361,9 +7379,9 @@ var NumberFieldInput = React66.forwardRef(
|
|
|
7361
7379
|
const theme2 = useTheme();
|
|
7362
7380
|
const tokens3 = theme2.tokens.components.numberField;
|
|
7363
7381
|
const inputTokens3 = theme2.tokens.components.inputs;
|
|
7364
|
-
const [isFocused, setIsFocused] =
|
|
7365
|
-
const [isEdited, setIsEdited] =
|
|
7366
|
-
const initialValueRef =
|
|
7382
|
+
const [isFocused, setIsFocused] = React65.useState(false);
|
|
7383
|
+
const [isEdited, setIsEdited] = React65.useState(false);
|
|
7384
|
+
const initialValueRef = React65.useRef((_a2 = value != null ? value : defaultValue) != null ? _a2 : "");
|
|
7367
7385
|
const isLarge = fieldSize === "lg";
|
|
7368
7386
|
const sizeTokens = isLarge ? tokens3.spacing.large : tokens3.spacing.small;
|
|
7369
7387
|
const buttonSize = isLarge ? "lg" : "sm";
|
|
@@ -7380,14 +7398,14 @@ var NumberFieldInput = React66.forwardRef(
|
|
|
7380
7398
|
if (isEdited) return tokens3.colour.field.border.edited;
|
|
7381
7399
|
return tokens3.colour.field.border.default;
|
|
7382
7400
|
};
|
|
7383
|
-
const handleFocus =
|
|
7401
|
+
const handleFocus = React65.useCallback(
|
|
7384
7402
|
(e) => {
|
|
7385
7403
|
setIsFocused(true);
|
|
7386
7404
|
onFocus == null ? void 0 : onFocus(e);
|
|
7387
7405
|
},
|
|
7388
7406
|
[onFocus]
|
|
7389
7407
|
);
|
|
7390
|
-
const handleBlur =
|
|
7408
|
+
const handleBlur = React65.useCallback(
|
|
7391
7409
|
(e) => {
|
|
7392
7410
|
setIsFocused(false);
|
|
7393
7411
|
if (value != null && onChangeText) {
|
|
@@ -7406,7 +7424,7 @@ var NumberFieldInput = React66.forwardRef(
|
|
|
7406
7424
|
const numericValue = value != null ? Number(value) : Number(defaultValue != null ? defaultValue : 0);
|
|
7407
7425
|
const isAtMin = min != null && numericValue <= min;
|
|
7408
7426
|
const isAtMax = max != null && numericValue >= max;
|
|
7409
|
-
const handleChangeText =
|
|
7427
|
+
const handleChangeText = React65.useCallback(
|
|
7410
7428
|
(text) => {
|
|
7411
7429
|
setIsEdited(text !== initialValueRef.current);
|
|
7412
7430
|
onChangeText == null ? void 0 : onChangeText(text);
|
|
@@ -7503,13 +7521,13 @@ var NumberFieldInput = React66.forwardRef(
|
|
|
7503
7521
|
);
|
|
7504
7522
|
NumberFieldInput.displayName = "NumberField.Input";
|
|
7505
7523
|
var parseTokenValue36 = (value) => parseFloat(value);
|
|
7506
|
-
var StyledRoot10 =
|
|
7524
|
+
var StyledRoot10 = styled52(View)(({ rootGap, fullWidth }) => __spreadValues({
|
|
7507
7525
|
gap: rootGap
|
|
7508
7526
|
}, fullWidth ? { width: "100%" } : { alignItems: "center" }));
|
|
7509
|
-
var StyledLabelGroup =
|
|
7527
|
+
var StyledLabelGroup = styled52(View)(({ labelGap }) => ({
|
|
7510
7528
|
gap: labelGap
|
|
7511
7529
|
}));
|
|
7512
|
-
var NumberField =
|
|
7530
|
+
var NumberField = React65.forwardRef(
|
|
7513
7531
|
(_a, ref) => {
|
|
7514
7532
|
var _b = _a, {
|
|
7515
7533
|
label,
|
|
@@ -7628,9 +7646,9 @@ var NumberField = React66.forwardRef(
|
|
|
7628
7646
|
);
|
|
7629
7647
|
NumberField.displayName = "NumberField";
|
|
7630
7648
|
var HIT_SLOP = 12;
|
|
7631
|
-
var PasswordFieldInput =
|
|
7649
|
+
var PasswordFieldInput = React65.forwardRef((_a, ref) => {
|
|
7632
7650
|
var _b = _a, { onValueChange, value, state, editable } = _b, inputFieldProps = __objRest(_b, ["onValueChange", "value", "state", "editable"]);
|
|
7633
|
-
const [showPassword, setShowPassword] =
|
|
7651
|
+
const [showPassword, setShowPassword] = React65.useState(false);
|
|
7634
7652
|
const handleValueChange = (newValue) => {
|
|
7635
7653
|
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
7636
7654
|
};
|
|
@@ -7670,12 +7688,12 @@ var PasswordFieldInput = React66.forwardRef((_a, ref) => {
|
|
|
7670
7688
|
});
|
|
7671
7689
|
PasswordFieldInput.displayName = "PasswordField.Field";
|
|
7672
7690
|
var parseTokenValue37 = (value) => parseFloat(value);
|
|
7673
|
-
var StyledErrorRow2 =
|
|
7691
|
+
var StyledErrorRow2 = styled52(View)(({ gap }) => ({
|
|
7674
7692
|
flexDirection: "row",
|
|
7675
7693
|
alignItems: "center",
|
|
7676
7694
|
gap
|
|
7677
7695
|
}));
|
|
7678
|
-
var PasswordFieldError =
|
|
7696
|
+
var PasswordFieldError = React65.forwardRef((_a, ref) => {
|
|
7679
7697
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
7680
7698
|
const theme2 = useTheme();
|
|
7681
7699
|
const { listItem } = theme2.tokens.components.validationList;
|
|
@@ -7702,19 +7720,19 @@ var PasswordFieldError = React66.forwardRef((_a, ref) => {
|
|
|
7702
7720
|
});
|
|
7703
7721
|
PasswordFieldError.displayName = "PasswordField.Error";
|
|
7704
7722
|
var parseTokenValue38 = (value) => parseFloat(value);
|
|
7705
|
-
var StyledRequirementsList =
|
|
7723
|
+
var StyledRequirementsList = styled52(View)(
|
|
7706
7724
|
({ listGap }) => ({
|
|
7707
7725
|
gap: listGap
|
|
7708
7726
|
})
|
|
7709
7727
|
);
|
|
7710
|
-
var StyledRequirementItem =
|
|
7728
|
+
var StyledRequirementItem = styled52(View)(
|
|
7711
7729
|
({ itemGap }) => ({
|
|
7712
7730
|
flexDirection: "row",
|
|
7713
7731
|
alignItems: "center",
|
|
7714
7732
|
gap: itemGap
|
|
7715
7733
|
})
|
|
7716
7734
|
);
|
|
7717
|
-
var PasswordFieldRequirements =
|
|
7735
|
+
var PasswordFieldRequirements = React65.forwardRef((_a, ref) => {
|
|
7718
7736
|
var _b = _a, { requirements } = _b, rest = __objRest(_b, ["requirements"]);
|
|
7719
7737
|
const theme2 = useTheme();
|
|
7720
7738
|
const { listItem, list } = theme2.tokens.components.validationList;
|
|
@@ -7764,13 +7782,13 @@ var PasswordFieldRequirements = React66.forwardRef((_a, ref) => {
|
|
|
7764
7782
|
});
|
|
7765
7783
|
PasswordFieldRequirements.displayName = "PasswordField.Requirements";
|
|
7766
7784
|
var parseTokenValue39 = (value) => parseFloat(value);
|
|
7767
|
-
var StyledRoot11 =
|
|
7785
|
+
var StyledRoot11 = styled52(View)(({ theme: theme2 }) => {
|
|
7768
7786
|
const { spacing } = theme2.tokens.components.inputs;
|
|
7769
7787
|
return {
|
|
7770
7788
|
gap: parseTokenValue39(spacing.gap)
|
|
7771
7789
|
};
|
|
7772
7790
|
});
|
|
7773
|
-
var PasswordFieldRoot =
|
|
7791
|
+
var PasswordFieldRoot = React65.forwardRef(
|
|
7774
7792
|
(_a, ref) => {
|
|
7775
7793
|
var _b = _a, {
|
|
7776
7794
|
label,
|
|
@@ -7882,19 +7900,19 @@ var PROGRESS_ANIMATION = {
|
|
|
7882
7900
|
easing: Easing$1.inOut(Easing$1.cubic)
|
|
7883
7901
|
};
|
|
7884
7902
|
var parseTokenValue40 = (value) => parseFloat(value);
|
|
7885
|
-
var StyledRoot12 =
|
|
7903
|
+
var StyledRoot12 = styled52(View)(({ rootGap }) => ({
|
|
7886
7904
|
flexDirection: "column",
|
|
7887
7905
|
alignItems: "stretch",
|
|
7888
7906
|
gap: rootGap,
|
|
7889
7907
|
width: "100%"
|
|
7890
7908
|
}));
|
|
7891
|
-
var StyledHeader2 =
|
|
7909
|
+
var StyledHeader2 = styled52(View)({
|
|
7892
7910
|
flexDirection: "row",
|
|
7893
7911
|
alignItems: "center",
|
|
7894
7912
|
justifyContent: "space-between",
|
|
7895
7913
|
width: "100%"
|
|
7896
7914
|
});
|
|
7897
|
-
var StyledTrack =
|
|
7915
|
+
var StyledTrack = styled52(View)(({ trackHeight, trackMinWidth, trackBorderRadius, trackBgColor }) => ({
|
|
7898
7916
|
position: "relative",
|
|
7899
7917
|
width: "100%",
|
|
7900
7918
|
minWidth: trackMinWidth,
|
|
@@ -7903,13 +7921,13 @@ var StyledTrack = styled51(View)(({ trackHeight, trackMinWidth, trackBorderRadiu
|
|
|
7903
7921
|
backgroundColor: trackBgColor,
|
|
7904
7922
|
overflow: "hidden"
|
|
7905
7923
|
}));
|
|
7906
|
-
var StyledIndicator =
|
|
7924
|
+
var StyledIndicator = styled52(Animated9.View)(({ indicatorBorderRadius, indicatorBgColor }) => ({
|
|
7907
7925
|
height: "100%",
|
|
7908
7926
|
borderRadius: indicatorBorderRadius,
|
|
7909
7927
|
backgroundColor: indicatorBgColor
|
|
7910
7928
|
}));
|
|
7911
7929
|
var clamp = (value, min, max) => Math.max(min, Math.min(max, value));
|
|
7912
|
-
var Progress =
|
|
7930
|
+
var Progress = React65.forwardRef(
|
|
7913
7931
|
(_a, ref) => {
|
|
7914
7932
|
var _b = _a, {
|
|
7915
7933
|
value = 0,
|
|
@@ -7947,7 +7965,7 @@ var Progress = React66.forwardRef(
|
|
|
7947
7965
|
const reducedMotion = useReducedMotion();
|
|
7948
7966
|
const shouldAnimate = animate && !reducedMotion;
|
|
7949
7967
|
const fill = useSharedValue(percent);
|
|
7950
|
-
|
|
7968
|
+
React65.useEffect(() => {
|
|
7951
7969
|
fill.value = shouldAnimate ? withTiming(percent, PROGRESS_ANIMATION) : percent;
|
|
7952
7970
|
}, [fill, percent, shouldAnimate]);
|
|
7953
7971
|
const indicatorStyle = useAnimatedStyle(() => ({
|
|
@@ -8011,7 +8029,7 @@ var Progress = React66.forwardRef(
|
|
|
8011
8029
|
);
|
|
8012
8030
|
Progress.displayName = "Progress";
|
|
8013
8031
|
var parseTokenValue41 = (value) => parseFloat(value);
|
|
8014
|
-
var StyledRadioRoot =
|
|
8032
|
+
var StyledRadioRoot = styled52(Pressable)(
|
|
8015
8033
|
({
|
|
8016
8034
|
radioGap,
|
|
8017
8035
|
radioOpacity,
|
|
@@ -8030,7 +8048,7 @@ var StyledRadioRoot = styled51(Pressable)(
|
|
|
8030
8048
|
opacity: radioOpacity
|
|
8031
8049
|
}, radioPaddingVertical !== void 0 ? { paddingVertical: radioPaddingVertical } : {}), radioPaddingHorizontal !== void 0 ? { paddingHorizontal: radioPaddingHorizontal } : {}), radioMaxWidth !== void 0 ? { maxWidth: radioMaxWidth } : {}), radioBgColor ? { backgroundColor: radioBgColor } : {}), radioBorderWidth !== void 0 ? { borderWidth: radioBorderWidth, borderColor: radioBorderColor } : {}), radioBorderRadius !== void 0 ? { borderRadius: radioBorderRadius } : {})
|
|
8032
8050
|
);
|
|
8033
|
-
var StyledRadioControl =
|
|
8051
|
+
var StyledRadioControl = styled52(View)(({ controlSize, controlBorderWidth, controlBorderColor }) => ({
|
|
8034
8052
|
width: controlSize,
|
|
8035
8053
|
height: controlSize,
|
|
8036
8054
|
minWidth: controlSize,
|
|
@@ -8041,29 +8059,29 @@ var StyledRadioControl = styled51(View)(({ controlSize, controlBorderWidth, cont
|
|
|
8041
8059
|
alignItems: "center",
|
|
8042
8060
|
justifyContent: "center"
|
|
8043
8061
|
}));
|
|
8044
|
-
var StyledIndicator2 =
|
|
8062
|
+
var StyledIndicator2 = styled52(View)(({ indicatorSize, indicatorBgColor }) => ({
|
|
8045
8063
|
width: indicatorSize,
|
|
8046
8064
|
height: indicatorSize,
|
|
8047
8065
|
borderRadius: indicatorSize / 2,
|
|
8048
8066
|
backgroundColor: indicatorBgColor
|
|
8049
8067
|
}));
|
|
8050
|
-
var StyledTextContent =
|
|
8068
|
+
var StyledTextContent = styled52(View)(({ textContentGap }) => ({
|
|
8051
8069
|
// Take the row's remaining width so long label/subText wraps within the tile
|
|
8052
8070
|
// instead of pushing the trailing asset past the tile's edge.
|
|
8053
8071
|
flex: 1,
|
|
8054
8072
|
flexDirection: "column",
|
|
8055
8073
|
gap: textContentGap
|
|
8056
8074
|
}));
|
|
8057
|
-
var StyledAssetWrapper =
|
|
8075
|
+
var StyledAssetWrapper = styled52(View)({
|
|
8058
8076
|
alignSelf: "center"
|
|
8059
8077
|
});
|
|
8060
|
-
var StyledTagWrapper =
|
|
8078
|
+
var StyledTagWrapper = styled52(View)(
|
|
8061
8079
|
({ tagTopPadding }) => ({
|
|
8062
8080
|
alignItems: "flex-start",
|
|
8063
8081
|
paddingTop: tagTopPadding
|
|
8064
8082
|
})
|
|
8065
8083
|
);
|
|
8066
|
-
var Radio =
|
|
8084
|
+
var Radio = React65.forwardRef(
|
|
8067
8085
|
(_a, ref) => {
|
|
8068
8086
|
var _b = _a, {
|
|
8069
8087
|
variant = "standalone",
|
|
@@ -8167,16 +8185,16 @@ var Radio = React66.forwardRef(
|
|
|
8167
8185
|
}
|
|
8168
8186
|
);
|
|
8169
8187
|
Radio.displayName = "Radio";
|
|
8170
|
-
var RadioTile =
|
|
8188
|
+
var RadioTile = React65.forwardRef(
|
|
8171
8189
|
(props, ref) => /* @__PURE__ */ jsx(Radio, __spreadProps(__spreadValues({ ref }, props), { variant: "tile" }))
|
|
8172
8190
|
);
|
|
8173
8191
|
RadioTile.displayName = "RadioTile";
|
|
8174
8192
|
var parseTokenValue42 = (value) => parseFloat(value);
|
|
8175
|
-
var StyledRadioGroup =
|
|
8193
|
+
var StyledRadioGroup = styled52(View)(({ groupDirection, groupGap }) => ({
|
|
8176
8194
|
flexDirection: groupDirection,
|
|
8177
8195
|
gap: groupGap
|
|
8178
8196
|
}));
|
|
8179
|
-
var RadioGroupRoot =
|
|
8197
|
+
var RadioGroupRoot = React65.forwardRef(
|
|
8180
8198
|
(_a, ref) => {
|
|
8181
8199
|
var _b = _a, {
|
|
8182
8200
|
name: _name,
|
|
@@ -8203,11 +8221,11 @@ var RadioGroupRoot = React66.forwardRef(
|
|
|
8203
8221
|
const optionsFirstValue = (_a2 = options == null ? void 0 : options[0]) == null ? void 0 : _a2.value;
|
|
8204
8222
|
const derivedDefaultValue = defaultValue != null ? defaultValue : optionsFirstValue;
|
|
8205
8223
|
const isControlled = value !== void 0;
|
|
8206
|
-
const [internalValue, setInternalValue] =
|
|
8224
|
+
const [internalValue, setInternalValue] = React65.useState(
|
|
8207
8225
|
derivedDefaultValue != null ? derivedDefaultValue : ""
|
|
8208
8226
|
);
|
|
8209
8227
|
const currentValue = isControlled ? value : internalValue;
|
|
8210
|
-
const handleSelect =
|
|
8228
|
+
const handleSelect = React65.useCallback(
|
|
8211
8229
|
(newValue) => {
|
|
8212
8230
|
if (!isControlled) {
|
|
8213
8231
|
setInternalValue(newValue);
|
|
@@ -8228,9 +8246,9 @@ var RadioGroupRoot = React66.forwardRef(
|
|
|
8228
8246
|
option.value
|
|
8229
8247
|
));
|
|
8230
8248
|
}
|
|
8231
|
-
return
|
|
8232
|
-
if (!
|
|
8233
|
-
return
|
|
8249
|
+
return React65.Children.map(children, (child) => {
|
|
8250
|
+
if (!React65.isValidElement(child)) return child;
|
|
8251
|
+
return React65.cloneElement(child, {
|
|
8234
8252
|
selected: currentValue === child.props.value,
|
|
8235
8253
|
onSelect: handleSelect,
|
|
8236
8254
|
disabled: disabled || child.props.disabled
|
|
@@ -8255,11 +8273,11 @@ var RadioGroup = Object.assign(RadioGroupRoot, {
|
|
|
8255
8273
|
Radio,
|
|
8256
8274
|
Tile: RadioTile
|
|
8257
8275
|
});
|
|
8258
|
-
var SearchFieldInput =
|
|
8276
|
+
var SearchFieldInput = React65.forwardRef((_a, ref) => {
|
|
8259
8277
|
var _b = _a, { onClear, onValueChange, value, state } = _b, inputFieldProps = __objRest(_b, ["onClear", "onValueChange", "value", "state"]);
|
|
8260
|
-
const [internalValue, setInternalValue] =
|
|
8261
|
-
const inputRef =
|
|
8262
|
-
|
|
8278
|
+
const [internalValue, setInternalValue] = React65.useState("");
|
|
8279
|
+
const inputRef = React65.useRef(null);
|
|
8280
|
+
React65.useImperativeHandle(ref, () => inputRef.current);
|
|
8263
8281
|
const handleValueChange = (newValue) => {
|
|
8264
8282
|
setInternalValue(newValue);
|
|
8265
8283
|
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
@@ -8299,13 +8317,13 @@ var SearchFieldInput = React66.forwardRef((_a, ref) => {
|
|
|
8299
8317
|
});
|
|
8300
8318
|
SearchFieldInput.displayName = "SearchField.Field";
|
|
8301
8319
|
var parseTokenValue43 = (value) => parseFloat(value);
|
|
8302
|
-
var StyledRoot13 =
|
|
8320
|
+
var StyledRoot13 = styled52(View)(({ theme: theme2 }) => {
|
|
8303
8321
|
const { spacing } = theme2.tokens.components.inputs;
|
|
8304
8322
|
return {
|
|
8305
8323
|
gap: parseTokenValue43(spacing.gap)
|
|
8306
8324
|
};
|
|
8307
8325
|
});
|
|
8308
|
-
var SearchFieldRoot =
|
|
8326
|
+
var SearchFieldRoot = React65.forwardRef(
|
|
8309
8327
|
(_a, ref) => {
|
|
8310
8328
|
var _b = _a, {
|
|
8311
8329
|
label,
|
|
@@ -8376,7 +8394,7 @@ function useSearchField({
|
|
|
8376
8394
|
};
|
|
8377
8395
|
}
|
|
8378
8396
|
var parseTokenValue44 = (value) => parseFloat(value);
|
|
8379
|
-
var StyledSegmentItem =
|
|
8397
|
+
var StyledSegmentItem = styled52(Pressable)(
|
|
8380
8398
|
({
|
|
8381
8399
|
itemHeight,
|
|
8382
8400
|
itemMinWidth,
|
|
@@ -8396,7 +8414,7 @@ var StyledSegmentItem = styled51(Pressable)(
|
|
|
8396
8414
|
opacity: itemOpacity
|
|
8397
8415
|
}, itemFlex !== void 0 ? { flex: itemFlex } : { flexShrink: 0 })
|
|
8398
8416
|
);
|
|
8399
|
-
var StyledIntrinsicClip =
|
|
8417
|
+
var StyledIntrinsicClip = styled52(View)(({ clipBorderRadius, clipBgColor, clipHeight, clipWidth }) => __spreadValues({
|
|
8400
8418
|
overflow: "hidden",
|
|
8401
8419
|
height: clipHeight,
|
|
8402
8420
|
borderRadius: clipBorderRadius,
|
|
@@ -8404,7 +8422,7 @@ var StyledIntrinsicClip = styled51(View)(({ clipBorderRadius, clipBgColor, clipH
|
|
|
8404
8422
|
alignSelf: "flex-start",
|
|
8405
8423
|
maxWidth: "100%"
|
|
8406
8424
|
}, clipWidth !== void 0 ? { width: clipWidth } : {}));
|
|
8407
|
-
var StyledScrollIndicator =
|
|
8425
|
+
var StyledScrollIndicator = styled52(Pressable)(
|
|
8408
8426
|
({
|
|
8409
8427
|
indicatorSide,
|
|
8410
8428
|
indicatorBorderRadius,
|
|
@@ -8436,7 +8454,7 @@ var ScrollIndicatorGradient = ({
|
|
|
8436
8454
|
side,
|
|
8437
8455
|
color
|
|
8438
8456
|
}) => {
|
|
8439
|
-
const uid =
|
|
8457
|
+
const uid = React65.useId();
|
|
8440
8458
|
const gradientId = `sc-scroll-indicator-${side}-${uid}`;
|
|
8441
8459
|
const isTrailing = side === "trailing";
|
|
8442
8460
|
return /* @__PURE__ */ jsx(View, { style: StyleSheet.absoluteFill, pointerEvents: "none", children: /* @__PURE__ */ jsxs(Svg72, { width: "100%", height: "100%", preserveAspectRatio: "none", children: [
|
|
@@ -8460,7 +8478,7 @@ var ScrollIndicatorGradient = ({
|
|
|
8460
8478
|
/* @__PURE__ */ jsx(Rect, { width: "100%", height: "100%", fill: `url(#${gradientId})` })
|
|
8461
8479
|
] }) });
|
|
8462
8480
|
};
|
|
8463
|
-
var StyledContainer2 =
|
|
8481
|
+
var StyledContainer2 = styled52(View)(
|
|
8464
8482
|
({
|
|
8465
8483
|
containerGap,
|
|
8466
8484
|
containerPaddingVertical,
|
|
@@ -8519,7 +8537,7 @@ var SegmentedControlItemBase = ({
|
|
|
8519
8537
|
}
|
|
8520
8538
|
);
|
|
8521
8539
|
};
|
|
8522
|
-
var SegmentedControlItem =
|
|
8540
|
+
var SegmentedControlItem = React65.forwardRef(
|
|
8523
8541
|
(_props, _ref) => {
|
|
8524
8542
|
return null;
|
|
8525
8543
|
}
|
|
@@ -8537,10 +8555,10 @@ var IntrinsicTrack = (_a) => {
|
|
|
8537
8555
|
"renderItems",
|
|
8538
8556
|
"forwardedRef"
|
|
8539
8557
|
]);
|
|
8540
|
-
const scrollRef =
|
|
8541
|
-
const [containerWidth, setContainerWidth] =
|
|
8542
|
-
const [contentWidth, setContentWidth] =
|
|
8543
|
-
const [scrollX, setScrollX] =
|
|
8558
|
+
const scrollRef = React65.useRef(null);
|
|
8559
|
+
const [containerWidth, setContainerWidth] = React65.useState(0);
|
|
8560
|
+
const [contentWidth, setContentWidth] = React65.useState(0);
|
|
8561
|
+
const [scrollX, setScrollX] = React65.useState(0);
|
|
8544
8562
|
const epsilon = 2;
|
|
8545
8563
|
const maxScroll = Math.max(0, contentWidth - containerWidth);
|
|
8546
8564
|
const canScrollLeft = scrollX > epsilon;
|
|
@@ -8637,7 +8655,7 @@ var IntrinsicTrack = (_a) => {
|
|
|
8637
8655
|
})
|
|
8638
8656
|
);
|
|
8639
8657
|
};
|
|
8640
|
-
var SegmentedControlRoot =
|
|
8658
|
+
var SegmentedControlRoot = React65.forwardRef(
|
|
8641
8659
|
(_a, ref) => {
|
|
8642
8660
|
var _b = _a, {
|
|
8643
8661
|
options,
|
|
@@ -8661,18 +8679,18 @@ var SegmentedControlRoot = React66.forwardRef(
|
|
|
8661
8679
|
const { spacing, borderRadius, colour, controlItem } = theme2.tokens.components.segmentedControl;
|
|
8662
8680
|
const { dimensions: dimensions3 } = theme2.tokens.semantics;
|
|
8663
8681
|
const optionsFirstValue = (_a2 = options == null ? void 0 : options[0]) == null ? void 0 : _a2.value;
|
|
8664
|
-
const childrenArray =
|
|
8682
|
+
const childrenArray = React65.Children.toArray(children);
|
|
8665
8683
|
const firstChildValue = childrenArray.map((child) => {
|
|
8666
|
-
if (!
|
|
8684
|
+
if (!React65.isValidElement(child)) return void 0;
|
|
8667
8685
|
return child.props.value;
|
|
8668
8686
|
}).find((v) => typeof v === "string");
|
|
8669
8687
|
const derivedDefaultValue = (_b2 = defaultValue != null ? defaultValue : optionsFirstValue) != null ? _b2 : firstChildValue;
|
|
8670
8688
|
const isControlled = typeof value === "string";
|
|
8671
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
8689
|
+
const [uncontrolledValue, setUncontrolledValue] = React65.useState(
|
|
8672
8690
|
() => derivedDefaultValue != null ? derivedDefaultValue : ""
|
|
8673
8691
|
);
|
|
8674
8692
|
const currentValue = isControlled ? value : uncontrolledValue;
|
|
8675
|
-
const handleSelect =
|
|
8693
|
+
const handleSelect = React65.useCallback(
|
|
8676
8694
|
(newValue) => {
|
|
8677
8695
|
if (!isControlled) {
|
|
8678
8696
|
setUncontrolledValue(newValue);
|
|
@@ -8698,7 +8716,7 @@ var SegmentedControlRoot = React66.forwardRef(
|
|
|
8698
8716
|
));
|
|
8699
8717
|
}
|
|
8700
8718
|
return childrenArray.map((child) => {
|
|
8701
|
-
if (!
|
|
8719
|
+
if (!React65.isValidElement(child)) return child;
|
|
8702
8720
|
const childProps = child.props;
|
|
8703
8721
|
return /* @__PURE__ */ jsx(
|
|
8704
8722
|
SegmentedControlItemBase,
|
|
@@ -8744,642 +8762,705 @@ SegmentedControlRoot.displayName = "SegmentedControl";
|
|
|
8744
8762
|
var SegmentedControl = Object.assign(SegmentedControlRoot, {
|
|
8745
8763
|
Item: SegmentedControlItem
|
|
8746
8764
|
});
|
|
8747
|
-
var
|
|
8748
|
-
var StyledTriggerWrapper = styled51(Animated.View)(({
|
|
8749
|
-
theme: theme2,
|
|
8750
|
-
state: _state
|
|
8751
|
-
}) => {
|
|
8752
|
-
const { spacing, colour, borderRadius, size } = theme2.tokens.components.inputs;
|
|
8753
|
-
return {
|
|
8754
|
-
flexDirection: "row",
|
|
8755
|
-
alignItems: "center",
|
|
8756
|
-
gap: parseTokenValue45(spacing.field.gap),
|
|
8757
|
-
minWidth: parseTokenValue45(size.field.minWidth),
|
|
8758
|
-
width: "100%",
|
|
8759
|
-
height: parseTokenValue45(size.field.height),
|
|
8760
|
-
backgroundColor: colour.field.background.default,
|
|
8761
|
-
borderRadius: parseTokenValue45(borderRadius.field.default)
|
|
8762
|
-
};
|
|
8763
|
-
});
|
|
8764
|
-
var StyledIconWrapper2 = styled51(View)({
|
|
8765
|
-
flexShrink: 0,
|
|
8766
|
-
alignItems: "center",
|
|
8767
|
-
justifyContent: "center"
|
|
8768
|
-
});
|
|
8769
|
-
var StyledArrowIcon = styled51(Animated.View)({
|
|
8770
|
-
flexShrink: 0,
|
|
8771
|
-
alignItems: "center",
|
|
8772
|
-
justifyContent: "center"
|
|
8773
|
-
});
|
|
8774
|
-
var SelectFieldTrigger = React66.forwardRef(
|
|
8775
|
-
(_a, ref) => {
|
|
8776
|
-
var _b = _a, {
|
|
8777
|
-
state = "default",
|
|
8778
|
-
leadingIcon,
|
|
8779
|
-
children,
|
|
8780
|
-
isOpen = false,
|
|
8781
|
-
isSearching = false,
|
|
8782
|
-
actionIcon
|
|
8783
|
-
} = _b, rest = __objRest(_b, [
|
|
8784
|
-
"state",
|
|
8785
|
-
"leadingIcon",
|
|
8786
|
-
"children",
|
|
8787
|
-
"isOpen",
|
|
8788
|
-
"isSearching",
|
|
8789
|
-
"actionIcon"
|
|
8790
|
-
]);
|
|
8791
|
-
const theme2 = useTheme();
|
|
8792
|
-
const { colour, borderWidth, spacing } = theme2.tokens.components.inputs;
|
|
8793
|
-
const hasState = state === "error" || state === "success";
|
|
8794
|
-
const baseBorderWidth = parseTokenValue45(borderWidth.field.default);
|
|
8795
|
-
const selectedBorderWidth = parseTokenValue45(borderWidth.field.selected);
|
|
8796
|
-
const baseVerticalPadding = parseTokenValue45(spacing.field.verticalPadding);
|
|
8797
|
-
const baseHorizontalPadding = parseTokenValue45(
|
|
8798
|
-
spacing.field.horizontalPadding
|
|
8799
|
-
);
|
|
8800
|
-
const borderDelta = selectedBorderWidth - baseBorderWidth;
|
|
8801
|
-
const borderColor = state === "error" ? colour.field.border.error : state === "success" ? colour.field.border.success : isOpen ? colour.field.border.selected : colour.field.border.default;
|
|
8802
|
-
const isActiveBorder = isOpen || hasState;
|
|
8803
|
-
const borderAnim = useRef(
|
|
8804
|
-
new Animated.Value(isActiveBorder ? 1 : 0)
|
|
8805
|
-
).current;
|
|
8806
|
-
const rotationAnim = useRef(new Animated.Value(isOpen ? 1 : 0)).current;
|
|
8807
|
-
useEffect(() => {
|
|
8808
|
-
Animated.parallel([
|
|
8809
|
-
Animated.timing(borderAnim, {
|
|
8810
|
-
toValue: isActiveBorder ? 1 : 0,
|
|
8811
|
-
duration: 50,
|
|
8812
|
-
easing: Easing.ease,
|
|
8813
|
-
useNativeDriver: false
|
|
8814
|
-
}),
|
|
8815
|
-
Animated.timing(rotationAnim, {
|
|
8816
|
-
toValue: isOpen ? 1 : 0,
|
|
8817
|
-
duration: 250,
|
|
8818
|
-
easing: Easing.bezier(0.4, 0, 0.2, 1),
|
|
8819
|
-
useNativeDriver: true
|
|
8820
|
-
})
|
|
8821
|
-
]).start();
|
|
8822
|
-
}, [isActiveBorder, isOpen, borderAnim, rotationAnim]);
|
|
8823
|
-
const animatedBorderWidth = borderAnim.interpolate({
|
|
8824
|
-
inputRange: [0, 1],
|
|
8825
|
-
outputRange: [baseBorderWidth, selectedBorderWidth]
|
|
8826
|
-
});
|
|
8827
|
-
const animatedPaddingVertical = borderAnim.interpolate({
|
|
8828
|
-
inputRange: [0, 1],
|
|
8829
|
-
outputRange: [baseVerticalPadding, baseVerticalPadding - borderDelta]
|
|
8830
|
-
});
|
|
8831
|
-
const animatedPaddingHorizontal = borderAnim.interpolate({
|
|
8832
|
-
inputRange: [0, 1],
|
|
8833
|
-
outputRange: [baseHorizontalPadding, baseHorizontalPadding - borderDelta]
|
|
8834
|
-
});
|
|
8835
|
-
const animatedRotation = rotationAnim.interpolate({
|
|
8836
|
-
inputRange: [0, 1],
|
|
8837
|
-
outputRange: ["0deg", "180deg"]
|
|
8838
|
-
});
|
|
8839
|
-
const stateIcon = state === "error" ? /* @__PURE__ */ jsx(Icon, { icon: Error_default, size: "md", colour: "error" }) : state === "success" ? /* @__PURE__ */ jsx(Icon, { icon: CheckCircle_default, size: "md", colour: "success" }) : null;
|
|
8840
|
-
const triggerContent = /* @__PURE__ */ jsxs(
|
|
8841
|
-
StyledTriggerWrapper,
|
|
8842
|
-
{
|
|
8843
|
-
state,
|
|
8844
|
-
style: [
|
|
8845
|
-
{
|
|
8846
|
-
borderColor,
|
|
8847
|
-
borderWidth: animatedBorderWidth,
|
|
8848
|
-
paddingVertical: animatedPaddingVertical,
|
|
8849
|
-
paddingHorizontal: animatedPaddingHorizontal
|
|
8850
|
-
}
|
|
8851
|
-
],
|
|
8852
|
-
children: [
|
|
8853
|
-
leadingIcon && /* @__PURE__ */ jsx(StyledIconWrapper2, { children: leadingIcon }),
|
|
8854
|
-
children,
|
|
8855
|
-
stateIcon && /* @__PURE__ */ jsx(StyledIconWrapper2, { children: stateIcon }),
|
|
8856
|
-
actionIcon ? /* @__PURE__ */ jsx(StyledIconWrapper2, { children: actionIcon }) : /* @__PURE__ */ jsx(
|
|
8857
|
-
StyledArrowIcon,
|
|
8858
|
-
{
|
|
8859
|
-
style: { transform: [{ rotate: animatedRotation }] },
|
|
8860
|
-
children: /* @__PURE__ */ jsx(Icon, { icon: KeyboardArrowDown_default, size: "md", colour: "primary" })
|
|
8861
|
-
}
|
|
8862
|
-
)
|
|
8863
|
-
]
|
|
8864
|
-
}
|
|
8865
|
-
);
|
|
8866
|
-
if (isSearching) {
|
|
8867
|
-
return /* @__PURE__ */ jsx(View, { ref, children: triggerContent });
|
|
8868
|
-
}
|
|
8869
|
-
return /* @__PURE__ */ jsx(SelectPrimitive3.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(Slot, { ref, children: /* @__PURE__ */ jsx(Pressable, __spreadProps(__spreadValues({}, rest), { children: triggerContent })) }) });
|
|
8870
|
-
}
|
|
8871
|
-
);
|
|
8872
|
-
SelectFieldTrigger.displayName = "SelectField.Trigger";
|
|
8873
|
-
var SelectFieldValue = React66.forwardRef(
|
|
8874
|
-
(_a, ref) => {
|
|
8875
|
-
var _b = _a, { placeholder, hasValue = true } = _b, rest = __objRest(_b, ["placeholder", "hasValue"]);
|
|
8876
|
-
const theme2 = useTheme();
|
|
8877
|
-
const { colour, field } = theme2.tokens.components.inputs;
|
|
8878
|
-
return /* @__PURE__ */ jsx(View, __spreadProps(__spreadValues({ ref, style: { flex: 1, minWidth: 0 } }, rest), { children: /* @__PURE__ */ jsx(
|
|
8879
|
-
Typography,
|
|
8880
|
-
{
|
|
8881
|
-
token: field.placeholder.default,
|
|
8882
|
-
color: hasValue ? colour.field.text.default : colour.field.text.placeholder,
|
|
8883
|
-
align: "left",
|
|
8884
|
-
children: /* @__PURE__ */ jsx(SelectPrimitive3.Value, { placeholder: placeholder != null ? placeholder : "" })
|
|
8885
|
-
}
|
|
8886
|
-
) }));
|
|
8887
|
-
}
|
|
8888
|
-
);
|
|
8889
|
-
SelectFieldValue.displayName = "SelectField.Value";
|
|
8890
|
-
var parseTokenValue46 = (value) => parseFloat(value);
|
|
8891
|
-
var StyledContentShadow = styled51(View)(({ theme: theme2 }) => {
|
|
8765
|
+
var StyledDropdown = styled52(View)(({ theme: theme2, dropdownPlacement, anchorRect, screenHeight }) => {
|
|
8892
8766
|
const { dropdown } = theme2.tokens.components.dropdownList;
|
|
8767
|
+
const { spacing } = theme2.tokens.components.inputs;
|
|
8893
8768
|
const shadow = dropdown.list.dropshadow.default;
|
|
8894
|
-
|
|
8895
|
-
|
|
8769
|
+
const offset = parseTokenValue9(spacing.gap);
|
|
8770
|
+
return __spreadProps(__spreadValues({
|
|
8771
|
+
position: "absolute",
|
|
8772
|
+
left: anchorRect.x,
|
|
8773
|
+
width: anchorRect.width
|
|
8774
|
+
}, dropdownPlacement === "below" ? { top: anchorRect.y + anchorRect.height + offset } : { bottom: screenHeight - anchorRect.y + offset }), {
|
|
8775
|
+
minWidth: parseTokenValue9(dropdown.list.size.minWidth),
|
|
8776
|
+
borderRadius: parseTokenValue9(dropdown.list.borderRadius.default),
|
|
8896
8777
|
shadowColor: shadow.color,
|
|
8897
8778
|
shadowOffset: {
|
|
8898
|
-
width:
|
|
8899
|
-
height:
|
|
8779
|
+
width: parseTokenValue9(shadow.offsetX),
|
|
8780
|
+
height: parseTokenValue9(shadow.offsetY)
|
|
8900
8781
|
},
|
|
8901
8782
|
shadowOpacity: 1,
|
|
8902
|
-
shadowRadius:
|
|
8783
|
+
shadowRadius: parseTokenValue9(shadow.blur),
|
|
8903
8784
|
elevation: 8
|
|
8904
|
-
};
|
|
8785
|
+
});
|
|
8905
8786
|
});
|
|
8906
|
-
var
|
|
8787
|
+
var StyledSurface = styled52(View)(({ theme: theme2 }) => {
|
|
8907
8788
|
const { dropdown } = theme2.tokens.components.dropdownList;
|
|
8908
8789
|
const { colour } = theme2.tokens.components.inputs;
|
|
8909
8790
|
return {
|
|
8910
8791
|
backgroundColor: colour.field.background.default,
|
|
8911
|
-
borderRadius:
|
|
8912
|
-
minWidth: parseTokenValue46(dropdown.list.size.minWidth),
|
|
8913
|
-
maxHeight: parseTokenValue46(dropdown.list.size.maxHeight),
|
|
8792
|
+
borderRadius: parseTokenValue9(dropdown.list.borderRadius.default),
|
|
8914
8793
|
overflow: "hidden"
|
|
8915
8794
|
};
|
|
8916
8795
|
});
|
|
8917
|
-
var
|
|
8918
|
-
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
8919
|
-
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
|
|
8923
|
-
|
|
8924
|
-
|
|
8925
|
-
|
|
8926
|
-
|
|
8927
|
-
|
|
8928
|
-
|
|
8929
|
-
|
|
8930
|
-
|
|
8931
|
-
|
|
8932
|
-
|
|
8933
|
-
|
|
8934
|
-
|
|
8935
|
-
|
|
8936
|
-
|
|
8937
|
-
|
|
8938
|
-
}
|
|
8939
|
-
) }) }) })) })
|
|
8940
|
-
}
|
|
8941
|
-
)
|
|
8942
|
-
] });
|
|
8796
|
+
var SelectFieldDropdown = React65.forwardRef((_a, ref) => {
|
|
8797
|
+
var _b = _a, { anchor, placement, maxHeight, screenHeight, children } = _b, rest = __objRest(_b, ["anchor", "placement", "maxHeight", "screenHeight", "children"]);
|
|
8798
|
+
return /* @__PURE__ */ jsx(
|
|
8799
|
+
StyledDropdown,
|
|
8800
|
+
__spreadProps(__spreadValues({
|
|
8801
|
+
ref,
|
|
8802
|
+
dropdownPlacement: placement,
|
|
8803
|
+
anchorRect: anchor,
|
|
8804
|
+
screenHeight
|
|
8805
|
+
}, rest), {
|
|
8806
|
+
children: /* @__PURE__ */ jsx(StyledSurface, { style: { maxHeight }, children: /* @__PURE__ */ jsx(
|
|
8807
|
+
ScrollView,
|
|
8808
|
+
{
|
|
8809
|
+
keyboardShouldPersistTaps: "always",
|
|
8810
|
+
nestedScrollEnabled: true,
|
|
8811
|
+
showsVerticalScrollIndicator: true,
|
|
8812
|
+
children
|
|
8813
|
+
}
|
|
8814
|
+
) })
|
|
8815
|
+
})
|
|
8816
|
+
);
|
|
8943
8817
|
});
|
|
8944
|
-
|
|
8945
|
-
var
|
|
8946
|
-
var StyledItem3 = styled51(Pressable)(({ theme: theme2 }) => {
|
|
8818
|
+
SelectFieldDropdown.displayName = "SelectField.Dropdown";
|
|
8819
|
+
var StyledOption = styled52(Pressable)(({ theme: theme2 }) => {
|
|
8947
8820
|
const { dropdown } = theme2.tokens.components.dropdownList;
|
|
8948
8821
|
return {
|
|
8949
8822
|
flexDirection: "row",
|
|
8950
8823
|
alignItems: "center",
|
|
8951
|
-
gap:
|
|
8952
|
-
height:
|
|
8953
|
-
|
|
8954
|
-
paddingHorizontal: parseTokenValue47(
|
|
8824
|
+
gap: parseTokenValue9(dropdown.listItem.content.gap),
|
|
8825
|
+
height: parseTokenValue9(dropdown.listItem.size.height),
|
|
8826
|
+
paddingHorizontal: parseTokenValue9(
|
|
8955
8827
|
dropdown.listItem.spacing.horiztonalPadding
|
|
8956
|
-
)
|
|
8957
|
-
backgroundColor: dropdown.listItem.colour.background.default
|
|
8828
|
+
)
|
|
8958
8829
|
};
|
|
8959
8830
|
});
|
|
8960
|
-
var
|
|
8831
|
+
var StyledIconSlot2 = styled52(View)({
|
|
8961
8832
|
flexShrink: 0,
|
|
8962
8833
|
alignItems: "center",
|
|
8963
8834
|
justifyContent: "center"
|
|
8964
8835
|
});
|
|
8965
|
-
var
|
|
8966
|
-
const { dropdown } = theme2.tokens.components.dropdownList;
|
|
8967
|
-
return {
|
|
8968
|
-
flexDirection: "row",
|
|
8969
|
-
alignItems: "center",
|
|
8970
|
-
gap: parseTokenValue47(dropdown.listItem.content.gap),
|
|
8971
|
-
flex: 1,
|
|
8972
|
-
minWidth: 0
|
|
8973
|
-
};
|
|
8974
|
-
});
|
|
8975
|
-
var StyledTextWrapper = styled51(View)({
|
|
8836
|
+
var StyledTextSlot = styled52(View)({
|
|
8976
8837
|
flex: 1,
|
|
8977
8838
|
minWidth: 0
|
|
8978
8839
|
});
|
|
8979
|
-
var
|
|
8980
|
-
const { dropdown } = theme2.tokens.components.dropdownList;
|
|
8981
|
-
return {
|
|
8982
|
-
color: dropdown.listItem.colour.text.placeholder.default
|
|
8983
|
-
};
|
|
8984
|
-
});
|
|
8985
|
-
var StyledHintText = styled51(Text)(({ theme: theme2 }) => {
|
|
8986
|
-
const { dropdown } = theme2.tokens.components.dropdownList;
|
|
8987
|
-
return {
|
|
8988
|
-
color: dropdown.listItem.colour.text.hint.default,
|
|
8989
|
-
flexShrink: 0
|
|
8990
|
-
};
|
|
8991
|
-
});
|
|
8992
|
-
var SelectFieldItem = React66.forwardRef(
|
|
8840
|
+
var SelectFieldOption = React65.forwardRef(
|
|
8993
8841
|
(_a, ref) => {
|
|
8994
|
-
var _b = _a, {
|
|
8842
|
+
var _b = _a, { label, leadingIcon, disabled = false, isSelected = false } = _b, rest = __objRest(_b, ["label", "leadingIcon", "disabled", "isSelected"]);
|
|
8995
8843
|
const theme2 = useTheme();
|
|
8996
8844
|
const { dropdown } = theme2.tokens.components.dropdownList;
|
|
8997
|
-
const
|
|
8998
|
-
const backgroundColor = disabled ?
|
|
8999
|
-
|
|
9000
|
-
|
|
9001
|
-
|
|
9002
|
-
|
|
9003
|
-
label: String(children),
|
|
9004
|
-
value,
|
|
8845
|
+
const { colour, typography } = dropdown.listItem;
|
|
8846
|
+
const backgroundColor = disabled ? colour.background.disabled : isSelected ? colour.background.hover : colour.background.default;
|
|
8847
|
+
return /* @__PURE__ */ jsxs(
|
|
8848
|
+
StyledOption,
|
|
8849
|
+
__spreadProps(__spreadValues({
|
|
8850
|
+
ref,
|
|
9005
8851
|
disabled,
|
|
9006
|
-
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9010
|
-
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
|
|
9015
|
-
|
|
9016
|
-
|
|
9017
|
-
|
|
9018
|
-
|
|
9019
|
-
|
|
9020
|
-
|
|
9021
|
-
]
|
|
9022
|
-
}
|
|
8852
|
+
accessibilityRole: "button",
|
|
8853
|
+
accessibilityState: { disabled, selected: isSelected },
|
|
8854
|
+
style: { backgroundColor }
|
|
8855
|
+
}, rest), {
|
|
8856
|
+
children: [
|
|
8857
|
+
leadingIcon && /* @__PURE__ */ jsx(StyledIconSlot2, { children: leadingIcon }),
|
|
8858
|
+
/* @__PURE__ */ jsx(StyledTextSlot, { children: /* @__PURE__ */ jsx(
|
|
8859
|
+
Typography,
|
|
8860
|
+
{
|
|
8861
|
+
token: isSelected ? typography.placeholder.hover : typography.placeholder.default,
|
|
8862
|
+
color: disabled ? colour.text.placeholder.disabled : colour.text.placeholder.default,
|
|
8863
|
+
numberOfLines: 1,
|
|
8864
|
+
children: label
|
|
8865
|
+
}
|
|
8866
|
+
) })
|
|
8867
|
+
]
|
|
8868
|
+
})
|
|
9023
8869
|
);
|
|
9024
8870
|
}
|
|
9025
8871
|
);
|
|
9026
|
-
|
|
9027
|
-
var
|
|
9028
|
-
var StyledStatusRow = styled51(View)(({ theme: theme2 }) => {
|
|
8872
|
+
SelectFieldOption.displayName = "SelectField.Option";
|
|
8873
|
+
var StyledStatusRow = styled52(View)(({ theme: theme2 }) => {
|
|
9029
8874
|
const { dropdown } = theme2.tokens.components.dropdownList;
|
|
9030
8875
|
return {
|
|
9031
|
-
|
|
9032
|
-
paddingHorizontal:
|
|
8876
|
+
height: parseTokenValue9(dropdown.listItem.size.height),
|
|
8877
|
+
paddingHorizontal: parseTokenValue9(
|
|
9033
8878
|
dropdown.listItem.spacing.horiztonalPadding
|
|
9034
8879
|
),
|
|
9035
|
-
alignItems: "center"
|
|
9036
|
-
|
|
9037
|
-
});
|
|
9038
|
-
var StyledRoot14 = styled51(View)(({ theme: theme2 }) => {
|
|
9039
|
-
const { spacing } = theme2.tokens.components.inputs;
|
|
9040
|
-
return {
|
|
9041
|
-
gap: parseTokenValue48(spacing.gap)
|
|
8880
|
+
alignItems: "center",
|
|
8881
|
+
justifyContent: "center"
|
|
9042
8882
|
};
|
|
9043
8883
|
});
|
|
9044
|
-
var
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
9052
|
-
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9061
|
-
|
|
9062
|
-
|
|
9063
|
-
|
|
9064
|
-
|
|
8884
|
+
var SelectFieldList = ({
|
|
8885
|
+
state,
|
|
8886
|
+
selectedValue,
|
|
8887
|
+
onSelect,
|
|
8888
|
+
noResultsText,
|
|
8889
|
+
errorText,
|
|
8890
|
+
searchHintText
|
|
8891
|
+
}) => {
|
|
8892
|
+
if (state.needsMoreInput) {
|
|
8893
|
+
return /* @__PURE__ */ jsx(StyledStatusRow, { children: /* @__PURE__ */ jsx(Typography, { size: "sm", children: searchHintText }) });
|
|
8894
|
+
}
|
|
8895
|
+
if (state.isLoading) {
|
|
8896
|
+
return /* @__PURE__ */ jsx(StyledStatusRow, { accessibilityLabel: "Loading results", children: /* @__PURE__ */ jsx(Spinner, { size: "sm" }) });
|
|
8897
|
+
}
|
|
8898
|
+
if (state.hasError) {
|
|
8899
|
+
return /* @__PURE__ */ jsx(StyledStatusRow, { children: /* @__PURE__ */ jsx(Typography, { size: "sm", children: errorText }) });
|
|
8900
|
+
}
|
|
8901
|
+
if (state.options.length === 0) {
|
|
8902
|
+
return /* @__PURE__ */ jsx(StyledStatusRow, { children: /* @__PURE__ */ jsx(Typography, { size: "sm", children: noResultsText }) });
|
|
8903
|
+
}
|
|
8904
|
+
return /* @__PURE__ */ jsx(Fragment, { children: state.options.map((option) => /* @__PURE__ */ jsx(
|
|
8905
|
+
SelectFieldOption,
|
|
8906
|
+
{
|
|
8907
|
+
label: option.label,
|
|
8908
|
+
leadingIcon: option.leadingIcon,
|
|
8909
|
+
disabled: option.disabled,
|
|
8910
|
+
isSelected: option.value === selectedValue,
|
|
8911
|
+
onPress: () => onSelect(option)
|
|
8912
|
+
},
|
|
8913
|
+
option.value
|
|
8914
|
+
)) });
|
|
8915
|
+
};
|
|
8916
|
+
SelectFieldList.displayName = "SelectField.List";
|
|
8917
|
+
|
|
8918
|
+
// src/components/molecules/SelectField/core/options.ts
|
|
8919
|
+
var matchOptions = (options, query) => {
|
|
8920
|
+
const needle = query.trim().toLowerCase();
|
|
8921
|
+
if (needle.length === 0) return options;
|
|
8922
|
+
const startsWith = [];
|
|
8923
|
+
const contains = [];
|
|
8924
|
+
options.forEach((option) => {
|
|
8925
|
+
const haystack = option.label.toLowerCase();
|
|
8926
|
+
if (haystack.startsWith(needle)) {
|
|
8927
|
+
startsWith.push(option);
|
|
8928
|
+
} else if (haystack.includes(needle)) {
|
|
8929
|
+
contains.push(option);
|
|
8930
|
+
}
|
|
8931
|
+
});
|
|
8932
|
+
return [...startsWith, ...contains];
|
|
8933
|
+
};
|
|
8934
|
+
var labelFor = (options, value) => {
|
|
8935
|
+
var _a, _b;
|
|
8936
|
+
return (_b = (_a = options.find((option) => option.value === value)) == null ? void 0 : _a.label) != null ? _b : "";
|
|
8937
|
+
};
|
|
8938
|
+
var useSelectOptions = ({
|
|
8939
|
+
options,
|
|
8940
|
+
query,
|
|
8941
|
+
onSearchQuery,
|
|
8942
|
+
debounceMs,
|
|
8943
|
+
minQueryLength,
|
|
8944
|
+
enabled
|
|
8945
|
+
}) => {
|
|
8946
|
+
const isQueryMode = enabled && typeof onSearchQuery === "function";
|
|
8947
|
+
const trimmedQuery = query.trim();
|
|
8948
|
+
const meetsMinimum = trimmedQuery.length >= minQueryLength;
|
|
8949
|
+
const isQueryActive = isQueryMode && trimmedQuery.length > 0 && meetsMinimum;
|
|
8950
|
+
const needsMoreInput = isQueryMode && !meetsMinimum;
|
|
8951
|
+
const [results, setResults] = React65.useState([]);
|
|
8952
|
+
const [isLoading, setIsLoading] = React65.useState(false);
|
|
8953
|
+
const [hasError, setHasError] = React65.useState(false);
|
|
8954
|
+
const resolverRef = React65.useRef(onSearchQuery);
|
|
8955
|
+
React65.useEffect(() => {
|
|
8956
|
+
resolverRef.current = onSearchQuery;
|
|
8957
|
+
});
|
|
8958
|
+
const requestIdRef = React65.useRef(0);
|
|
8959
|
+
React65.useEffect(() => {
|
|
8960
|
+
if (!isQueryMode) return;
|
|
8961
|
+
if (trimmedQuery.length === 0 || trimmedQuery.length < minQueryLength) {
|
|
8962
|
+
requestIdRef.current += 1;
|
|
8963
|
+
setResults([]);
|
|
8964
|
+
setIsLoading(false);
|
|
8965
|
+
setHasError(false);
|
|
8966
|
+
return;
|
|
8967
|
+
}
|
|
8968
|
+
const requestId = requestIdRef.current + 1;
|
|
8969
|
+
requestIdRef.current = requestId;
|
|
8970
|
+
setIsLoading(true);
|
|
8971
|
+
setHasError(false);
|
|
8972
|
+
const timer = setTimeout(() => {
|
|
8973
|
+
const resolve = resolverRef.current;
|
|
8974
|
+
if (!resolve) {
|
|
8975
|
+
setIsLoading(false);
|
|
8976
|
+
return;
|
|
8977
|
+
}
|
|
8978
|
+
Promise.resolve(resolve(trimmedQuery)).then((items) => {
|
|
8979
|
+
if (requestIdRef.current !== requestId) return;
|
|
8980
|
+
setResults(items);
|
|
8981
|
+
setIsLoading(false);
|
|
8982
|
+
}).catch(() => {
|
|
8983
|
+
if (requestIdRef.current !== requestId) return;
|
|
8984
|
+
setResults([]);
|
|
8985
|
+
setHasError(true);
|
|
8986
|
+
setIsLoading(false);
|
|
9065
8987
|
});
|
|
9066
|
-
|
|
8988
|
+
}, debounceMs);
|
|
8989
|
+
return () => clearTimeout(timer);
|
|
8990
|
+
}, [isQueryMode, trimmedQuery, debounceMs, minQueryLength]);
|
|
8991
|
+
const localOptions = React65.useMemo(
|
|
8992
|
+
() => enabled ? matchOptions(options, query) : options,
|
|
8993
|
+
[enabled, options, query]
|
|
8994
|
+
);
|
|
8995
|
+
if (needsMoreInput) {
|
|
8996
|
+
const hasDefaultList = trimmedQuery.length === 0 && options.length > 0;
|
|
8997
|
+
return {
|
|
8998
|
+
options: hasDefaultList ? options : [],
|
|
8999
|
+
isLoading: false,
|
|
9000
|
+
hasError: false,
|
|
9001
|
+
needsMoreInput: !hasDefaultList
|
|
9067
9002
|
};
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9003
|
+
}
|
|
9004
|
+
if (!isQueryActive) {
|
|
9005
|
+
return {
|
|
9006
|
+
options: localOptions,
|
|
9007
|
+
isLoading: false,
|
|
9008
|
+
hasError: false,
|
|
9009
|
+
needsMoreInput: false
|
|
9010
|
+
};
|
|
9011
|
+
}
|
|
9012
|
+
return { options: results, isLoading, hasError, needsMoreInput: false };
|
|
9013
|
+
};
|
|
9014
|
+
|
|
9015
|
+
// src/components/molecules/SelectField/core/listHeight.ts
|
|
9016
|
+
var LIST_HEIGHT_RATIO = 0.5;
|
|
9017
|
+
var LIST_HEIGHT_CEILING = 480;
|
|
9018
|
+
var drawerListMaxHeight = (windowHeight, override) => override != null ? override : Math.min(windowHeight * LIST_HEIGHT_RATIO, LIST_HEIGHT_CEILING);
|
|
9019
|
+
var MIN_DROPDOWN_HEIGHT = 80;
|
|
9020
|
+
var StyledRoot14 = styled52(View)(({ theme: theme2 }) => ({
|
|
9021
|
+
gap: parseTokenValue9(theme2.tokens.components.inputs.spacing.gap)
|
|
9022
|
+
}));
|
|
9023
|
+
var StyledAnchor = styled52(View)({});
|
|
9024
|
+
var SelectField = React65.forwardRef(
|
|
9074
9025
|
(_a, ref) => {
|
|
9075
9026
|
var _b = _a, {
|
|
9027
|
+
options,
|
|
9076
9028
|
label,
|
|
9077
|
-
placeholder,
|
|
9078
9029
|
description,
|
|
9079
9030
|
error,
|
|
9080
9031
|
state = "default",
|
|
9081
9032
|
optionalText,
|
|
9033
|
+
placeholder,
|
|
9082
9034
|
leadingIcon,
|
|
9083
|
-
children,
|
|
9084
|
-
value,
|
|
9085
|
-
defaultValue,
|
|
9086
|
-
onValueChange,
|
|
9087
|
-
disabled,
|
|
9088
|
-
searchable = false,
|
|
9089
|
-
searchPlaceholder,
|
|
9090
9035
|
noResultsText = "No results found",
|
|
9036
|
+
errorText = "Something went wrong",
|
|
9091
9037
|
onSearchQuery,
|
|
9092
9038
|
debounceMs = 300,
|
|
9093
|
-
|
|
9039
|
+
minQueryLength = 1,
|
|
9040
|
+
searchHintText = "Type to search",
|
|
9041
|
+
clearAccessibilityLabel = "Clear selection",
|
|
9042
|
+
disabled = false,
|
|
9043
|
+
value,
|
|
9044
|
+
defaultValue,
|
|
9045
|
+
onValueChange
|
|
9094
9046
|
} = _b, rest = __objRest(_b, [
|
|
9047
|
+
"options",
|
|
9095
9048
|
"label",
|
|
9096
|
-
"placeholder",
|
|
9097
9049
|
"description",
|
|
9098
9050
|
"error",
|
|
9099
9051
|
"state",
|
|
9100
9052
|
"optionalText",
|
|
9053
|
+
"placeholder",
|
|
9101
9054
|
"leadingIcon",
|
|
9102
|
-
"children",
|
|
9103
|
-
"value",
|
|
9104
|
-
"defaultValue",
|
|
9105
|
-
"onValueChange",
|
|
9106
|
-
"disabled",
|
|
9107
|
-
"searchable",
|
|
9108
|
-
"searchPlaceholder",
|
|
9109
9055
|
"noResultsText",
|
|
9056
|
+
"errorText",
|
|
9110
9057
|
"onSearchQuery",
|
|
9111
9058
|
"debounceMs",
|
|
9112
|
-
"
|
|
9059
|
+
"minQueryLength",
|
|
9060
|
+
"searchHintText",
|
|
9061
|
+
"clearAccessibilityLabel",
|
|
9062
|
+
"disabled",
|
|
9063
|
+
"value",
|
|
9064
|
+
"defaultValue",
|
|
9065
|
+
"onValueChange"
|
|
9113
9066
|
]);
|
|
9114
|
-
const
|
|
9115
|
-
const
|
|
9116
|
-
const
|
|
9067
|
+
const theme2 = useTheme();
|
|
9068
|
+
const { height: windowHeight } = useWindowDimensions();
|
|
9069
|
+
const maxDropdownHeight = parseTokenValue9(
|
|
9070
|
+
theme2.tokens.components.dropdownList.dropdown.list.size.maxHeight
|
|
9071
|
+
);
|
|
9072
|
+
const isControlled = value !== void 0;
|
|
9073
|
+
const [internalValue, setInternalValue] = React65.useState(
|
|
9117
9074
|
defaultValue != null ? defaultValue : null
|
|
9118
9075
|
);
|
|
9119
|
-
const
|
|
9120
|
-
const [
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9124
|
-
const [searchResults, setSearchResults] = React66.useState([]);
|
|
9125
|
-
const [isSearching, setIsSearching] = React66.useState(false);
|
|
9126
|
-
const [searchFailed, setSearchFailed] = React66.useState(false);
|
|
9127
|
-
const searchRequestIdRef = React66.useRef(0);
|
|
9128
|
-
const onSearchQueryRef = React66.useRef(onSearchQuery);
|
|
9129
|
-
React66.useEffect(() => {
|
|
9130
|
-
onSearchQueryRef.current = onSearchQuery;
|
|
9076
|
+
const selectedValue = isControlled ? value : internalValue;
|
|
9077
|
+
const [inputText, setInputText] = React65.useState(() => {
|
|
9078
|
+
var _a2, _b2;
|
|
9079
|
+
const initialValue = isControlled ? value : defaultValue != null ? defaultValue : null;
|
|
9080
|
+
return (_b2 = (_a2 = options.find((option) => option.value === initialValue)) == null ? void 0 : _a2.label) != null ? _b2 : "";
|
|
9131
9081
|
});
|
|
9132
|
-
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
if (searchRequestIdRef.current !== requestId) return;
|
|
9150
|
-
setSearchResults(items);
|
|
9151
|
-
setIsSearching(false);
|
|
9152
|
-
}).catch(() => {
|
|
9153
|
-
if (searchRequestIdRef.current !== requestId) return;
|
|
9154
|
-
setSearchResults([]);
|
|
9155
|
-
setSearchFailed(true);
|
|
9156
|
-
setIsSearching(false);
|
|
9157
|
-
});
|
|
9158
|
-
}, debounceMs);
|
|
9159
|
-
return () => clearTimeout(debounceTimer);
|
|
9160
|
-
}, [searchQuery, isQueryMode, debounceMs]);
|
|
9161
|
-
React66.useEffect(() => {
|
|
9162
|
-
if (!isOpen) {
|
|
9163
|
-
setShowContent(false);
|
|
9164
|
-
return;
|
|
9165
|
-
}
|
|
9166
|
-
if (!searchable) {
|
|
9167
|
-
setShowContent(true);
|
|
9168
|
-
return;
|
|
9169
|
-
}
|
|
9170
|
-
const openTimer = setTimeout(() => {
|
|
9171
|
-
var _a2;
|
|
9172
|
-
setShowContent(true);
|
|
9173
|
-
(_a2 = searchInputRef.current) == null ? void 0 : _a2.focus();
|
|
9174
|
-
}, 0);
|
|
9175
|
-
const keyboardSub = Keyboard.addListener("keyboardDidShow", () => {
|
|
9176
|
-
setTimeout(() => {
|
|
9177
|
-
var _a2;
|
|
9178
|
-
return (_a2 = searchInputRef.current) == null ? void 0 : _a2.focus();
|
|
9179
|
-
}, 0);
|
|
9180
|
-
});
|
|
9181
|
-
const hardwareKeyboardTimer = setTimeout(
|
|
9182
|
-
() => {
|
|
9183
|
-
var _a2;
|
|
9184
|
-
return (_a2 = searchInputRef.current) == null ? void 0 : _a2.focus();
|
|
9185
|
-
},
|
|
9186
|
-
100
|
|
9082
|
+
const [filterQuery, setFilterQuery] = React65.useState("");
|
|
9083
|
+
const [isFocused, setIsFocused] = React65.useState(false);
|
|
9084
|
+
const [keyboardHeight, setKeyboardHeight] = React65.useState(0);
|
|
9085
|
+
const [placement, setPlacement] = React65.useState({ direction: "below", maxHeight: maxDropdownHeight });
|
|
9086
|
+
const [anchorRect, setAnchorRect] = React65.useState(null);
|
|
9087
|
+
const portalName = React65.useId();
|
|
9088
|
+
const inputRef = React65.useRef(null);
|
|
9089
|
+
const anchorRef = React65.useRef(null);
|
|
9090
|
+
const selectionCountRef = React65.useRef(0);
|
|
9091
|
+
React65.useEffect(() => {
|
|
9092
|
+
const showSubscription = Keyboard.addListener(
|
|
9093
|
+
"keyboardDidShow",
|
|
9094
|
+
(event) => setKeyboardHeight(event.endCoordinates.height)
|
|
9095
|
+
);
|
|
9096
|
+
const hideSubscription = Keyboard.addListener(
|
|
9097
|
+
"keyboardDidHide",
|
|
9098
|
+
() => setKeyboardHeight(0)
|
|
9187
9099
|
);
|
|
9188
9100
|
return () => {
|
|
9189
|
-
|
|
9190
|
-
|
|
9191
|
-
keyboardSub.remove();
|
|
9101
|
+
showSubscription.remove();
|
|
9102
|
+
hideSubscription.remove();
|
|
9192
9103
|
};
|
|
9193
|
-
}, [
|
|
9194
|
-
const
|
|
9195
|
-
|
|
9196
|
-
|
|
9104
|
+
}, []);
|
|
9105
|
+
const measurePlacement = React65.useCallback(() => {
|
|
9106
|
+
var _a2;
|
|
9107
|
+
(_a2 = anchorRef.current) == null ? void 0 : _a2.measureInWindow(
|
|
9108
|
+
(anchorX, anchorY, anchorWidth, anchorHeight) => {
|
|
9109
|
+
setAnchorRect(
|
|
9110
|
+
(current) => current && current.x === anchorX && current.y === anchorY && current.width === anchorWidth && current.height === anchorHeight ? current : {
|
|
9111
|
+
x: anchorX,
|
|
9112
|
+
y: anchorY,
|
|
9113
|
+
width: anchorWidth,
|
|
9114
|
+
height: anchorHeight
|
|
9115
|
+
}
|
|
9116
|
+
);
|
|
9117
|
+
const spaceBelow = windowHeight - keyboardHeight - (anchorY + anchorHeight);
|
|
9118
|
+
const spaceAbove = anchorY;
|
|
9119
|
+
const preferAbove = spaceBelow < maxDropdownHeight && spaceAbove > spaceBelow;
|
|
9120
|
+
const availableSpace = preferAbove ? spaceAbove : spaceBelow;
|
|
9121
|
+
const direction = preferAbove ? "above" : "below";
|
|
9122
|
+
const maxHeight = Math.max(
|
|
9123
|
+
MIN_DROPDOWN_HEIGHT,
|
|
9124
|
+
Math.min(maxDropdownHeight, availableSpace)
|
|
9125
|
+
);
|
|
9126
|
+
setPlacement(
|
|
9127
|
+
(current) => current.direction === direction && current.maxHeight === maxHeight ? current : { direction, maxHeight }
|
|
9128
|
+
);
|
|
9129
|
+
}
|
|
9130
|
+
);
|
|
9131
|
+
}, [windowHeight, keyboardHeight, maxDropdownHeight]);
|
|
9132
|
+
React65.useEffect(() => {
|
|
9133
|
+
if (isFocused) measurePlacement();
|
|
9134
|
+
}, [isFocused, measurePlacement]);
|
|
9135
|
+
React65.useEffect(() => {
|
|
9136
|
+
if (!isControlled || isFocused) return;
|
|
9137
|
+
if (value === null || value === void 0) {
|
|
9138
|
+
setInputText("");
|
|
9139
|
+
return;
|
|
9140
|
+
}
|
|
9141
|
+
const selectedOption = options.find((option) => option.value === value);
|
|
9142
|
+
if (selectedOption) setInputText(selectedOption.label);
|
|
9143
|
+
}, [isControlled, isFocused, value, options]);
|
|
9144
|
+
const optionsState = useSelectOptions({
|
|
9145
|
+
options,
|
|
9146
|
+
query: filterQuery,
|
|
9147
|
+
onSearchQuery,
|
|
9148
|
+
debounceMs,
|
|
9149
|
+
minQueryLength,
|
|
9150
|
+
enabled: true
|
|
9197
9151
|
});
|
|
9198
|
-
const
|
|
9152
|
+
const commitValue = (nextValue) => {
|
|
9153
|
+
if (!isControlled) setInternalValue(nextValue);
|
|
9154
|
+
if (nextValue !== selectedValue) onValueChange == null ? void 0 : onValueChange(nextValue);
|
|
9155
|
+
};
|
|
9156
|
+
const handleFocus = () => {
|
|
9157
|
+
setIsFocused(true);
|
|
9158
|
+
setFilterQuery("");
|
|
9159
|
+
};
|
|
9160
|
+
const handleBlur = () => {
|
|
9161
|
+
const selectionsSeen = selectionCountRef.current;
|
|
9199
9162
|
setTimeout(() => {
|
|
9200
9163
|
var _a2;
|
|
9201
|
-
if (
|
|
9202
|
-
|
|
9164
|
+
if (selectionCountRef.current !== selectionsSeen) return;
|
|
9165
|
+
setIsFocused(false);
|
|
9166
|
+
const typedLabel = inputText.trim().toLowerCase();
|
|
9167
|
+
const exactMatch = options.find(
|
|
9168
|
+
(option) => option.label.toLowerCase() === typedLabel
|
|
9169
|
+
);
|
|
9170
|
+
commitValue((_a2 = exactMatch == null ? void 0 : exactMatch.value) != null ? _a2 : null);
|
|
9171
|
+
}, 0);
|
|
9172
|
+
};
|
|
9173
|
+
const handleChangeText = (text) => {
|
|
9174
|
+
setInputText(text);
|
|
9175
|
+
setFilterQuery(text);
|
|
9203
9176
|
};
|
|
9204
|
-
const
|
|
9205
|
-
|
|
9177
|
+
const handleSelect = (option) => {
|
|
9178
|
+
selectionCountRef.current += 1;
|
|
9179
|
+
setInputText(option.label);
|
|
9180
|
+
setFilterQuery("");
|
|
9181
|
+
setIsFocused(false);
|
|
9182
|
+
commitValue(option.value);
|
|
9183
|
+
Keyboard.dismiss();
|
|
9184
|
+
};
|
|
9185
|
+
const handleClear = () => {
|
|
9186
|
+
var _a2;
|
|
9187
|
+
setInputText("");
|
|
9188
|
+
setFilterQuery("");
|
|
9189
|
+
commitValue(null);
|
|
9190
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
9191
|
+
};
|
|
9192
|
+
const fieldState = error ? "error" : state;
|
|
9193
|
+
const isOpen = isFocused && !disabled;
|
|
9194
|
+
const clearAction = !disabled && inputText.length > 0 ? /* @__PURE__ */ jsx(
|
|
9195
|
+
Pressable,
|
|
9196
|
+
{
|
|
9197
|
+
onPress: handleClear,
|
|
9198
|
+
accessibilityRole: "button",
|
|
9199
|
+
accessibilityLabel: clearAccessibilityLabel,
|
|
9200
|
+
hitSlop: 8,
|
|
9201
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: Cancel_default, size: "md" })
|
|
9202
|
+
}
|
|
9203
|
+
) : void 0;
|
|
9204
|
+
const handleSelectRef = React65.useRef(handleSelect);
|
|
9205
|
+
handleSelectRef.current = handleSelect;
|
|
9206
|
+
const onOptionPress = React65.useCallback(
|
|
9207
|
+
(option) => handleSelectRef.current(option),
|
|
9208
|
+
[]
|
|
9206
9209
|
);
|
|
9207
|
-
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9210
|
+
const dropdown = React65.useMemo(() => {
|
|
9211
|
+
if (!isOpen || !anchorRect) return null;
|
|
9212
|
+
return /* @__PURE__ */ jsx(
|
|
9213
|
+
SelectFieldDropdown,
|
|
9214
|
+
{
|
|
9215
|
+
anchor: anchorRect,
|
|
9216
|
+
placement: placement.direction,
|
|
9217
|
+
maxHeight: placement.maxHeight,
|
|
9218
|
+
screenHeight: windowHeight,
|
|
9219
|
+
accessibilityLiveRegion: "polite",
|
|
9220
|
+
children: /* @__PURE__ */ jsx(
|
|
9221
|
+
SelectFieldList,
|
|
9222
|
+
{
|
|
9223
|
+
state: optionsState,
|
|
9224
|
+
selectedValue,
|
|
9225
|
+
onSelect: onOptionPress,
|
|
9226
|
+
noResultsText,
|
|
9227
|
+
errorText,
|
|
9228
|
+
searchHintText
|
|
9229
|
+
}
|
|
9230
|
+
)
|
|
9231
|
+
}
|
|
9232
|
+
);
|
|
9233
|
+
}, [
|
|
9234
|
+
isOpen,
|
|
9235
|
+
anchorRect,
|
|
9236
|
+
placement,
|
|
9237
|
+
windowHeight,
|
|
9238
|
+
optionsState,
|
|
9239
|
+
noResultsText,
|
|
9240
|
+
errorText,
|
|
9241
|
+
searchHintText,
|
|
9242
|
+
selectedValue,
|
|
9243
|
+
onOptionPress
|
|
9244
|
+
]);
|
|
9245
|
+
return /* @__PURE__ */ jsxs(StyledRoot14, __spreadProps(__spreadValues({ ref }, rest), { children: [
|
|
9246
|
+
label && /* @__PURE__ */ jsx(InputLabel, { optionalText, state: fieldState, children: label }),
|
|
9247
|
+
/* @__PURE__ */ jsx(StyledAnchor, { ref: anchorRef, children: /* @__PURE__ */ jsx(
|
|
9248
|
+
InputField,
|
|
9249
|
+
{
|
|
9250
|
+
ref: inputRef,
|
|
9251
|
+
value: inputText,
|
|
9252
|
+
onChangeText: handleChangeText,
|
|
9253
|
+
onFocus: handleFocus,
|
|
9254
|
+
onBlur: handleBlur,
|
|
9255
|
+
placeholder,
|
|
9256
|
+
editable: !disabled,
|
|
9257
|
+
state: fieldState,
|
|
9258
|
+
hideStateIcons: Boolean(clearAction),
|
|
9259
|
+
leadingIcon,
|
|
9260
|
+
actionIcon: clearAction,
|
|
9261
|
+
selectTextOnFocus: true,
|
|
9262
|
+
autoCorrect: false,
|
|
9263
|
+
autoCapitalize: "none",
|
|
9264
|
+
returnKeyType: "done",
|
|
9265
|
+
accessibilityRole: "combobox",
|
|
9266
|
+
accessibilityState: { disabled, expanded: isOpen }
|
|
9267
|
+
}
|
|
9268
|
+
) }),
|
|
9269
|
+
description && /* @__PURE__ */ jsx(InputDescription, { state: fieldState, children: description }),
|
|
9270
|
+
error && /* @__PURE__ */ jsx(InputError, { children: error }),
|
|
9271
|
+
dropdown && /* @__PURE__ */ jsx(Portal, { name: portalName, children: dropdown })
|
|
9272
|
+
] }));
|
|
9273
|
+
}
|
|
9274
|
+
);
|
|
9275
|
+
SelectField.displayName = "SelectField";
|
|
9276
|
+
var StyledRoot15 = styled52(View)(({ theme: theme2 }) => ({
|
|
9277
|
+
gap: parseTokenValue9(theme2.tokens.components.inputs.spacing.gap)
|
|
9278
|
+
}));
|
|
9279
|
+
var StyledSearchRow = styled52(View)(({ theme: theme2 }) => {
|
|
9280
|
+
const { colour } = theme2.tokens.semantics;
|
|
9281
|
+
return {
|
|
9282
|
+
backgroundColor: colour.background.container.default,
|
|
9283
|
+
paddingBottom: parseTokenValue9(theme2.tokens.components.inputs.spacing.gap)
|
|
9284
|
+
};
|
|
9285
|
+
});
|
|
9286
|
+
var SelectDrawerField = React65.forwardRef(
|
|
9287
|
+
(_a, ref) => {
|
|
9288
|
+
var _b = _a, {
|
|
9289
|
+
options,
|
|
9290
|
+
label,
|
|
9291
|
+
description,
|
|
9292
|
+
error,
|
|
9293
|
+
state = "default",
|
|
9294
|
+
optionalText,
|
|
9295
|
+
placeholder,
|
|
9296
|
+
leadingIcon,
|
|
9297
|
+
drawerTitle,
|
|
9298
|
+
searchable = true,
|
|
9299
|
+
searchPlaceholder = "Search",
|
|
9300
|
+
noResultsText = "No results found",
|
|
9301
|
+
errorText = "Something went wrong",
|
|
9302
|
+
onSearchQuery,
|
|
9303
|
+
debounceMs = 300,
|
|
9304
|
+
minQueryLength = 1,
|
|
9305
|
+
searchHintText = "Type to search",
|
|
9306
|
+
clearAccessibilityLabel = "Clear selection",
|
|
9307
|
+
listMaxHeight,
|
|
9308
|
+
disabled = false,
|
|
9309
|
+
value,
|
|
9310
|
+
defaultValue,
|
|
9311
|
+
onValueChange
|
|
9312
|
+
} = _b, rest = __objRest(_b, [
|
|
9313
|
+
"options",
|
|
9314
|
+
"label",
|
|
9315
|
+
"description",
|
|
9316
|
+
"error",
|
|
9317
|
+
"state",
|
|
9318
|
+
"optionalText",
|
|
9319
|
+
"placeholder",
|
|
9320
|
+
"leadingIcon",
|
|
9321
|
+
"drawerTitle",
|
|
9322
|
+
"searchable",
|
|
9323
|
+
"searchPlaceholder",
|
|
9324
|
+
"noResultsText",
|
|
9325
|
+
"errorText",
|
|
9326
|
+
"onSearchQuery",
|
|
9327
|
+
"debounceMs",
|
|
9328
|
+
"minQueryLength",
|
|
9329
|
+
"searchHintText",
|
|
9330
|
+
"clearAccessibilityLabel",
|
|
9331
|
+
"listMaxHeight",
|
|
9332
|
+
"disabled",
|
|
9333
|
+
"value",
|
|
9334
|
+
"defaultValue",
|
|
9335
|
+
"onValueChange"
|
|
9336
|
+
]);
|
|
9337
|
+
var _a2;
|
|
9338
|
+
const { height: windowHeight } = useWindowDimensions();
|
|
9339
|
+
const isControlled = value !== void 0;
|
|
9340
|
+
const [internalValue, setInternalValue] = React65.useState(
|
|
9341
|
+
defaultValue != null ? defaultValue : null
|
|
9342
|
+
);
|
|
9343
|
+
const selectedValue = isControlled ? value : internalValue;
|
|
9344
|
+
const [isOpen, setIsOpen] = React65.useState(false);
|
|
9345
|
+
const [searchQuery, setSearchQuery] = React65.useState("");
|
|
9346
|
+
const [lastSelected, setLastSelected] = React65.useState(null);
|
|
9347
|
+
const selectedLabel = labelFor(options, selectedValue) || (lastSelected && lastSelected.value === selectedValue ? lastSelected.label : "");
|
|
9348
|
+
const optionsState = useSelectOptions({
|
|
9349
|
+
options,
|
|
9350
|
+
query: searchQuery,
|
|
9351
|
+
onSearchQuery,
|
|
9352
|
+
debounceMs,
|
|
9353
|
+
minQueryLength,
|
|
9354
|
+
enabled: searchable
|
|
9355
|
+
});
|
|
9356
|
+
const commitValue = (nextValue) => {
|
|
9357
|
+
if (!isControlled) setInternalValue(nextValue);
|
|
9358
|
+
if (nextValue !== selectedValue) onValueChange == null ? void 0 : onValueChange(nextValue);
|
|
9214
9359
|
};
|
|
9215
9360
|
const handleOpenChange = (open) => {
|
|
9216
9361
|
setIsOpen(open);
|
|
9217
9362
|
if (!open) setSearchQuery("");
|
|
9218
9363
|
};
|
|
9219
|
-
const
|
|
9220
|
-
|
|
9221
|
-
|
|
9222
|
-
|
|
9223
|
-
|
|
9224
|
-
|
|
9225
|
-
|
|
9226
|
-
|
|
9227
|
-
|
|
9228
|
-
|
|
9364
|
+
const handleSelect = (option) => {
|
|
9365
|
+
setLastSelected(option);
|
|
9366
|
+
commitValue(option.value);
|
|
9367
|
+
handleOpenChange(false);
|
|
9368
|
+
};
|
|
9369
|
+
const handleClear = () => {
|
|
9370
|
+
setLastSelected(null);
|
|
9371
|
+
commitValue(null);
|
|
9372
|
+
};
|
|
9373
|
+
const bodyMaxHeight = drawerListMaxHeight(windowHeight, listMaxHeight);
|
|
9374
|
+
const fieldState = error ? "error" : state;
|
|
9375
|
+
const clearAction = !disabled && selectedLabel.length > 0 ? /* @__PURE__ */ jsx(
|
|
9376
|
+
Pressable,
|
|
9377
|
+
{
|
|
9378
|
+
onPress: handleClear,
|
|
9379
|
+
accessibilityRole: "button",
|
|
9380
|
+
accessibilityLabel: clearAccessibilityLabel,
|
|
9381
|
+
hitSlop: 8,
|
|
9382
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: Cancel_default, size: "md" })
|
|
9229
9383
|
}
|
|
9230
|
-
|
|
9231
|
-
|
|
9232
|
-
|
|
9233
|
-
const queryResultItems = searchResults.map((result) => /* @__PURE__ */ jsx(
|
|
9234
|
-
SelectFieldItem,
|
|
9384
|
+
) : void 0;
|
|
9385
|
+
const searchClearAction = searchQuery.length > 0 ? /* @__PURE__ */ jsx(
|
|
9386
|
+
Pressable,
|
|
9235
9387
|
{
|
|
9236
|
-
|
|
9237
|
-
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
children:
|
|
9241
|
-
}
|
|
9242
|
-
|
|
9243
|
-
)
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
|
|
9247
|
-
const searchActionIcon = (() => {
|
|
9248
|
-
if (!searchable) return void 0;
|
|
9249
|
-
const showClear = isOpen && searchQuery.length > 0 || !isOpen && Boolean(currentValue);
|
|
9250
|
-
if (!showClear) return /* @__PURE__ */ jsx(Icon, { icon: Search_default, size: "md" });
|
|
9251
|
-
return /* @__PURE__ */ jsx(
|
|
9252
|
-
Pressable,
|
|
9388
|
+
onPress: () => setSearchQuery(""),
|
|
9389
|
+
accessibilityRole: "button",
|
|
9390
|
+
accessibilityLabel: "Clear search",
|
|
9391
|
+
hitSlop: 8,
|
|
9392
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: Cancel_default, size: "md" })
|
|
9393
|
+
}
|
|
9394
|
+
) : void 0;
|
|
9395
|
+
return /* @__PURE__ */ jsxs(StyledRoot15, __spreadProps(__spreadValues({ ref }, rest), { children: [
|
|
9396
|
+
label && /* @__PURE__ */ jsx(InputLabel, { optionalText, state: fieldState, children: label }),
|
|
9397
|
+
/* @__PURE__ */ jsx(
|
|
9398
|
+
InputField,
|
|
9253
9399
|
{
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
|
|
9258
|
-
|
|
9259
|
-
|
|
9260
|
-
|
|
9261
|
-
|
|
9262
|
-
|
|
9263
|
-
|
|
9264
|
-
accessibilityRole: "button",
|
|
9265
|
-
hitSlop: 8,
|
|
9266
|
-
children: /* @__PURE__ */ jsx(Icon, { icon: Cancel_default, size: "md" })
|
|
9400
|
+
value: selectedLabel,
|
|
9401
|
+
placeholder,
|
|
9402
|
+
editable: false,
|
|
9403
|
+
onPress: disabled ? void 0 : () => setIsOpen(true),
|
|
9404
|
+
state: fieldState,
|
|
9405
|
+
hideStateIcons: Boolean(clearAction),
|
|
9406
|
+
leadingIcon,
|
|
9407
|
+
actionIcon: clearAction,
|
|
9408
|
+
accessibilityRole: "combobox",
|
|
9409
|
+
accessibilityState: { disabled, expanded: isOpen }
|
|
9267
9410
|
}
|
|
9268
|
-
)
|
|
9269
|
-
|
|
9270
|
-
|
|
9271
|
-
|
|
9272
|
-
|
|
9273
|
-
|
|
9274
|
-
|
|
9275
|
-
|
|
9276
|
-
|
|
9277
|
-
|
|
9278
|
-
/* @__PURE__ */ jsxs(
|
|
9279
|
-
|
|
9280
|
-
|
|
9281
|
-
|
|
9282
|
-
|
|
9283
|
-
|
|
9284
|
-
|
|
9285
|
-
|
|
9286
|
-
|
|
9287
|
-
isSearching: searchable && isOpen,
|
|
9288
|
-
actionIcon: searchActionIcon,
|
|
9289
|
-
children: searchable && isOpen ? /* @__PURE__ */ jsx(
|
|
9290
|
-
InputText,
|
|
9411
|
+
),
|
|
9412
|
+
description && /* @__PURE__ */ jsx(InputDescription, { state: fieldState, children: description }),
|
|
9413
|
+
error && /* @__PURE__ */ jsx(InputError, { children: error }),
|
|
9414
|
+
/* @__PURE__ */ jsx(Drawer.Root, { open: isOpen, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs(Drawer.Portal, { children: [
|
|
9415
|
+
/* @__PURE__ */ jsx(Drawer.Overlay, {}),
|
|
9416
|
+
/* @__PURE__ */ jsxs(Drawer.Content, { children: [
|
|
9417
|
+
/* @__PURE__ */ jsxs(Drawer.Header, { children: [
|
|
9418
|
+
/* @__PURE__ */ jsx(Drawer.Title, { children: (_a2 = drawerTitle != null ? drawerTitle : label) != null ? _a2 : "Select" }),
|
|
9419
|
+
/* @__PURE__ */ jsx(Drawer.Close, {})
|
|
9420
|
+
] }),
|
|
9421
|
+
/* @__PURE__ */ jsxs(
|
|
9422
|
+
Drawer.Body,
|
|
9423
|
+
{
|
|
9424
|
+
style: { maxHeight: bodyMaxHeight },
|
|
9425
|
+
keyboardShouldPersistTaps: "always",
|
|
9426
|
+
stickyHeaderIndices: searchable ? [0] : void 0,
|
|
9427
|
+
children: [
|
|
9428
|
+
searchable ? /* @__PURE__ */ jsx(StyledSearchRow, { children: /* @__PURE__ */ jsx(
|
|
9429
|
+
InputField,
|
|
9291
9430
|
{
|
|
9292
|
-
ref: searchInputRef,
|
|
9293
9431
|
value: searchQuery,
|
|
9294
9432
|
onChangeText: setSearchQuery,
|
|
9295
|
-
|
|
9296
|
-
|
|
9433
|
+
placeholder: searchPlaceholder,
|
|
9434
|
+
leadingIcon: /* @__PURE__ */ jsx(Icon, { icon: Search_default, size: "md" }),
|
|
9435
|
+
actionIcon: searchClearAction,
|
|
9436
|
+
autoFocus: true,
|
|
9437
|
+
selectTextOnFocus: true,
|
|
9438
|
+
autoCorrect: false,
|
|
9439
|
+
autoCapitalize: "none",
|
|
9297
9440
|
returnKeyType: "search",
|
|
9298
|
-
|
|
9299
|
-
accessibilityLabel: "Search options"
|
|
9441
|
+
accessibilityLabel: searchPlaceholder
|
|
9300
9442
|
}
|
|
9301
|
-
) :
|
|
9302
|
-
|
|
9443
|
+
) }) : null,
|
|
9444
|
+
/* @__PURE__ */ jsx(View, { children: /* @__PURE__ */ jsx(
|
|
9445
|
+
SelectFieldList,
|
|
9303
9446
|
{
|
|
9304
|
-
|
|
9305
|
-
|
|
9447
|
+
state: optionsState,
|
|
9448
|
+
selectedValue,
|
|
9449
|
+
onSelect: handleSelect,
|
|
9450
|
+
noResultsText,
|
|
9451
|
+
errorText,
|
|
9452
|
+
searchHintText
|
|
9306
9453
|
}
|
|
9307
|
-
)
|
|
9308
|
-
|
|
9309
|
-
),
|
|
9310
|
-
description && /* @__PURE__ */ jsx(InputDescription, { state, children: description }),
|
|
9311
|
-
error && state === "error" && /* @__PURE__ */ jsx(InputError, { children: error })
|
|
9312
|
-
] })),
|
|
9313
|
-
/* @__PURE__ */ jsx(
|
|
9314
|
-
SelectFieldAnchor,
|
|
9315
|
-
{
|
|
9316
|
-
triggerRef: triggerViewRef,
|
|
9317
|
-
enabled: searchable && isOpen
|
|
9454
|
+
) })
|
|
9455
|
+
]
|
|
9318
9456
|
}
|
|
9319
|
-
)
|
|
9320
|
-
|
|
9321
|
-
|
|
9322
|
-
|
|
9323
|
-
const selectedValue = currentValue && typeof currentValue === "object" && "value" in currentValue ? currentValue.value : currentValue;
|
|
9324
|
-
const childProps = child.props;
|
|
9325
|
-
return React66.cloneElement(
|
|
9326
|
-
child,
|
|
9327
|
-
{
|
|
9328
|
-
isSelected: childProps.value === selectedValue
|
|
9329
|
-
}
|
|
9330
|
-
);
|
|
9331
|
-
}
|
|
9332
|
-
return child;
|
|
9333
|
-
}),
|
|
9334
|
-
hasNoResults && /* @__PURE__ */ jsx(StyledStatusRow, { children: /* @__PURE__ */ jsx(Typography, { size: "sm", children: noResultsText }) })
|
|
9335
|
-
] }) })
|
|
9336
|
-
]
|
|
9337
|
-
},
|
|
9338
|
-
clearKey
|
|
9339
|
-
);
|
|
9457
|
+
)
|
|
9458
|
+
] })
|
|
9459
|
+
] }) })
|
|
9460
|
+
] }));
|
|
9340
9461
|
}
|
|
9341
9462
|
);
|
|
9342
|
-
|
|
9343
|
-
var SelectField = Object.assign(SelectFieldRoot, {
|
|
9344
|
-
Root: StyledRoot14,
|
|
9345
|
-
Label: InputLabel,
|
|
9346
|
-
Trigger: SelectFieldTrigger,
|
|
9347
|
-
Value: SelectFieldValue,
|
|
9348
|
-
Content: SelectFieldContent,
|
|
9349
|
-
Item: SelectFieldItem,
|
|
9350
|
-
Description: InputDescription,
|
|
9351
|
-
Error: InputError
|
|
9352
|
-
});
|
|
9353
|
-
function useSelectField(options = {}) {
|
|
9354
|
-
const {
|
|
9355
|
-
initialValue,
|
|
9356
|
-
onValueChange: onValueChangeCallback,
|
|
9357
|
-
validationRule
|
|
9358
|
-
} = options;
|
|
9359
|
-
const [value, setValue] = useState(initialValue != null ? initialValue : null);
|
|
9360
|
-
const handleValueChange = (newValue) => {
|
|
9361
|
-
const typedValue = Array.isArray(newValue) ? newValue[0] : newValue;
|
|
9362
|
-
setValue(typedValue != null ? typedValue : null);
|
|
9363
|
-
onValueChangeCallback == null ? void 0 : onValueChangeCallback(typedValue);
|
|
9364
|
-
};
|
|
9365
|
-
const { state, error } = useMemo(() => {
|
|
9366
|
-
if (!validationRule) {
|
|
9367
|
-
return { state: void 0, error: void 0 };
|
|
9368
|
-
}
|
|
9369
|
-
if (value === null || value === initialValue) {
|
|
9370
|
-
return { state: "default", error: void 0 };
|
|
9371
|
-
}
|
|
9372
|
-
const isValid = validationRule.test(value);
|
|
9373
|
-
return {
|
|
9374
|
-
state: isValid ? "success" : "error",
|
|
9375
|
-
error: isValid ? void 0 : validationRule.message
|
|
9376
|
-
};
|
|
9377
|
-
}, [value, validationRule, initialValue]);
|
|
9378
|
-
return __spreadValues({
|
|
9379
|
-
value,
|
|
9380
|
-
onValueChange: handleValueChange
|
|
9381
|
-
}, validationRule && { state, error });
|
|
9382
|
-
}
|
|
9463
|
+
SelectDrawerField.displayName = "SelectDrawerField";
|
|
9383
9464
|
var themeTokens = DEFAULT_THEME_OPTIONS.tokens;
|
|
9384
9465
|
var { components, semantics } = themeTokens;
|
|
9385
9466
|
var inputTokens = components.inputs;
|
|
@@ -9397,7 +9478,7 @@ var resolveTypography = (typography) => {
|
|
|
9397
9478
|
const letterSpacing = ((_a = typography.letterSpacing) == null ? void 0 : _a.endsWith("%")) ? parseFloat(typography.letterSpacing) / 100 * fontSize : parseFloat((_b = typography.letterSpacing) != null ? _b : "0");
|
|
9398
9479
|
return { fontFamily, fontSize, letterSpacing };
|
|
9399
9480
|
};
|
|
9400
|
-
var Wrapper =
|
|
9481
|
+
var Wrapper = styled52(View)({
|
|
9401
9482
|
borderWidth: parseSize(inputTokens.borderWidth.field.selected),
|
|
9402
9483
|
borderColor: inputTokens.colour.field.border.selected,
|
|
9403
9484
|
borderRadius: parseSize(inputTokens.borderRadius.field.default),
|
|
@@ -9409,27 +9490,27 @@ var Wrapper = styled51(View)({
|
|
|
9409
9490
|
alignItems: "center",
|
|
9410
9491
|
justifyContent: "space-between"
|
|
9411
9492
|
});
|
|
9412
|
-
var SelectIcon =
|
|
9493
|
+
var SelectIcon = styled52(Animated9.View)({
|
|
9413
9494
|
position: "absolute",
|
|
9414
9495
|
right: 0,
|
|
9415
9496
|
marginRight: 0
|
|
9416
9497
|
});
|
|
9417
|
-
var InputText2 =
|
|
9498
|
+
var InputText2 = styled52(Text)(__spreadProps(__spreadValues({
|
|
9418
9499
|
color: inputTokens.colour.field.text.default
|
|
9419
9500
|
}, resolveTypography(inputTokens.field.placeholder.default)), {
|
|
9420
9501
|
flex: 1
|
|
9421
9502
|
}));
|
|
9422
|
-
var PlaceholderText =
|
|
9503
|
+
var PlaceholderText = styled52(Text)(__spreadProps(__spreadValues({
|
|
9423
9504
|
color: inputTokens.colour.field.text.placeholder
|
|
9424
9505
|
}, resolveTypography(inputTokens.field.placeholder.default)), {
|
|
9425
9506
|
flex: 1
|
|
9426
9507
|
}));
|
|
9427
|
-
var ModalOverlay =
|
|
9508
|
+
var ModalOverlay = styled52(View)({
|
|
9428
9509
|
flex: 1,
|
|
9429
9510
|
backgroundColor: "rgba(0, 0, 0, 0.32)",
|
|
9430
9511
|
justifyContent: "flex-end"
|
|
9431
9512
|
});
|
|
9432
|
-
var AndroidDialog =
|
|
9513
|
+
var AndroidDialog = styled52(View)({
|
|
9433
9514
|
backgroundColor: inputTokens.colour.field.background.default,
|
|
9434
9515
|
borderTopLeftRadius: parseSize(dimensions.borderRadius.lg),
|
|
9435
9516
|
borderTopRightRadius: parseSize(dimensions.borderRadius.lg),
|
|
@@ -9439,12 +9520,12 @@ var AndroidDialog = styled51(View)({
|
|
|
9439
9520
|
paddingBottom: parseSize(dimensions.spacing.xl),
|
|
9440
9521
|
paddingHorizontal: parseSize(dimensions.spacing.md)
|
|
9441
9522
|
});
|
|
9442
|
-
var DialogTitle =
|
|
9523
|
+
var DialogTitle = styled52(Text)(__spreadProps(__spreadValues({}, resolveTypography(inputTokens.text.label)), {
|
|
9443
9524
|
color: inputTokens.colour.field.text.default,
|
|
9444
9525
|
marginBottom: parseSize(dimensions.spacing.md),
|
|
9445
9526
|
marginLeft: parseSize(dimensions.spacing.xs)
|
|
9446
9527
|
}));
|
|
9447
|
-
var AndroidOptionRow =
|
|
9528
|
+
var AndroidOptionRow = styled52(View)({
|
|
9448
9529
|
flexDirection: "row",
|
|
9449
9530
|
alignItems: "center",
|
|
9450
9531
|
paddingVertical: parseSize(dimensions.spacing.md),
|
|
@@ -9452,7 +9533,7 @@ var AndroidOptionRow = styled51(View)({
|
|
|
9452
9533
|
borderBottomWidth: parseSize(dimensions.borderWidth.sm),
|
|
9453
9534
|
borderBottomColor: themeTokens.primitives.colour.brand.brown[2]
|
|
9454
9535
|
});
|
|
9455
|
-
var RadioOuter =
|
|
9536
|
+
var RadioOuter = styled52(View)({
|
|
9456
9537
|
width: parseSize(dimensions.spacing.lg),
|
|
9457
9538
|
height: parseSize(dimensions.spacing.lg),
|
|
9458
9539
|
borderRadius: parseSize(dimensions.spacing.lg) / 2,
|
|
@@ -9462,13 +9543,13 @@ var RadioOuter = styled51(View)({
|
|
|
9462
9543
|
justifyContent: "center",
|
|
9463
9544
|
marginRight: parseSize(dimensions.spacing.sm)
|
|
9464
9545
|
});
|
|
9465
|
-
var RadioInner =
|
|
9546
|
+
var RadioInner = styled52(View)({
|
|
9466
9547
|
width: parseSize(dimensions.spacing.md) / 2,
|
|
9467
9548
|
height: parseSize(dimensions.spacing.md) / 2,
|
|
9468
9549
|
borderRadius: parseSize(dimensions.spacing.md) / 4,
|
|
9469
9550
|
backgroundColor: inputTokens.colour.field.border.selected
|
|
9470
9551
|
});
|
|
9471
|
-
var AndroidOptionText =
|
|
9552
|
+
var AndroidOptionText = styled52(Text)(
|
|
9472
9553
|
({ isSelected }) => __spreadProps(__spreadValues({}, resolveTypography(
|
|
9473
9554
|
isSelected ? inputTokens.text.label : inputTokens.field.placeholder.default
|
|
9474
9555
|
)), {
|
|
@@ -9495,7 +9576,7 @@ var useIconAnimation = () => {
|
|
|
9495
9576
|
iconAnimationStyles
|
|
9496
9577
|
};
|
|
9497
9578
|
};
|
|
9498
|
-
var NativeSelectPicker =
|
|
9579
|
+
var NativeSelectPicker = React65.forwardRef(
|
|
9499
9580
|
(_a, ref) => {
|
|
9500
9581
|
var _b = _a, {
|
|
9501
9582
|
items,
|
|
@@ -9648,19 +9729,19 @@ var NativeSelectPicker = React66.forwardRef(
|
|
|
9648
9729
|
}
|
|
9649
9730
|
);
|
|
9650
9731
|
NativeSelectPicker.displayName = "NativeSelectPicker";
|
|
9651
|
-
var
|
|
9652
|
-
var StyledLabelRow2 =
|
|
9732
|
+
var parseTokenValue45 = (value) => parseFloat(value);
|
|
9733
|
+
var StyledLabelRow2 = styled52(View)(({ labelRowGap }) => ({
|
|
9653
9734
|
flexDirection: "row",
|
|
9654
9735
|
alignItems: "center",
|
|
9655
9736
|
gap: labelRowGap
|
|
9656
9737
|
}));
|
|
9657
|
-
var StyledLabelSlot =
|
|
9738
|
+
var StyledLabelSlot = styled52(View)(({ labelSlotGap }) => ({
|
|
9658
9739
|
flexDirection: "row",
|
|
9659
9740
|
alignItems: "center",
|
|
9660
9741
|
gap: labelSlotGap,
|
|
9661
9742
|
flexShrink: 0
|
|
9662
9743
|
}));
|
|
9663
|
-
var Slider =
|
|
9744
|
+
var Slider = React65.forwardRef(
|
|
9664
9745
|
(_a, ref) => {
|
|
9665
9746
|
var _b = _a, {
|
|
9666
9747
|
value: controlledValue,
|
|
@@ -9695,10 +9776,10 @@ var Slider = React66.forwardRef(
|
|
|
9695
9776
|
const { slider, buttons } = theme2.tokens.components;
|
|
9696
9777
|
const { dimensions: dimensions3 } = theme2.tokens.semantics;
|
|
9697
9778
|
const isControlled = controlledValue !== void 0;
|
|
9698
|
-
const [internalValue, setInternalValue] =
|
|
9779
|
+
const [internalValue, setInternalValue] = React65.useState(defaultValue);
|
|
9699
9780
|
const currentValue = isControlled ? controlledValue : internalValue;
|
|
9700
|
-
const thumbSize =
|
|
9701
|
-
const trackHeight =
|
|
9781
|
+
const thumbSize = parseTokenValue45(buttons.size.md.minHeight);
|
|
9782
|
+
const trackHeight = parseTokenValue45(slider.sizing.track.height);
|
|
9702
9783
|
const isWeb = Platform.OS === "web";
|
|
9703
9784
|
const [trackLayoutWidth, setTrackLayoutWidth] = useState(0);
|
|
9704
9785
|
const webFraction = max > min ? (currentValue - min) / (max - min) : 0;
|
|
@@ -9793,8 +9874,8 @@ var Slider = React66.forwardRef(
|
|
|
9793
9874
|
};
|
|
9794
9875
|
const hasLeading = leadingIcon !== void 0 || leadingLabel !== void 0;
|
|
9795
9876
|
const hasTrailing = trailingIcon !== void 0 || trailingLabel !== void 0;
|
|
9796
|
-
const labelGap =
|
|
9797
|
-
const roundBorderRadius =
|
|
9877
|
+
const labelGap = parseTokenValue45(slider.sliderField.spacing.label.gap);
|
|
9878
|
+
const roundBorderRadius = parseTokenValue45(dimensions3.borderRadius.round);
|
|
9798
9879
|
const thumbIconColor = buttons.iconButton.filledButton.colour.icon.primary.default;
|
|
9799
9880
|
const thumbContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9800
9881
|
/* @__PURE__ */ jsx(
|
|
@@ -9819,15 +9900,15 @@ var Slider = React66.forwardRef(
|
|
|
9819
9900
|
const thumbStyle = {
|
|
9820
9901
|
width: thumbSize,
|
|
9821
9902
|
height: thumbSize,
|
|
9822
|
-
borderRadius:
|
|
9903
|
+
borderRadius: parseTokenValue45(buttons.borderRadius.default),
|
|
9823
9904
|
backgroundColor: buttons.iconButton.filledButton.colour.background.primary.default,
|
|
9824
9905
|
flexDirection: "row",
|
|
9825
9906
|
alignItems: "center",
|
|
9826
9907
|
justifyContent: "center"
|
|
9827
9908
|
};
|
|
9828
9909
|
const outerStyle = {
|
|
9829
|
-
gap:
|
|
9830
|
-
minWidth:
|
|
9910
|
+
gap: parseTokenValue45(slider.sliderField.spacing.gap),
|
|
9911
|
+
minWidth: parseTokenValue45(slider.sizing.minWidth),
|
|
9831
9912
|
opacity: disabled ? parseFloat(buttons.opacity.disabled) : 1
|
|
9832
9913
|
};
|
|
9833
9914
|
const leadingSlot = hasLeading && /* @__PURE__ */ jsxs(StyledLabelSlot, { labelSlotGap: labelGap, children: [
|
|
@@ -9865,7 +9946,7 @@ var Slider = React66.forwardRef(
|
|
|
9865
9946
|
height: trackHeight,
|
|
9866
9947
|
borderRadius: roundBorderRadius,
|
|
9867
9948
|
backgroundColor: slider.colour.track.background.default,
|
|
9868
|
-
borderWidth:
|
|
9949
|
+
borderWidth: parseTokenValue45(dimensions3.borderWidth.sm),
|
|
9869
9950
|
borderColor: slider.colour.track.border.default
|
|
9870
9951
|
};
|
|
9871
9952
|
const indicatorBaseStyle = {
|
|
@@ -9960,9 +10041,9 @@ var Slider = React66.forwardRef(
|
|
|
9960
10041
|
onLayout: handleNativeLayout,
|
|
9961
10042
|
children: [
|
|
9962
10043
|
/* @__PURE__ */ jsx(View, { style: trackBackgroundStyle }),
|
|
9963
|
-
/* @__PURE__ */ jsx(
|
|
10044
|
+
/* @__PURE__ */ jsx(Animated9.View, { style: [indicatorBaseStyle, indicatorAnimStyle] }),
|
|
9964
10045
|
/* @__PURE__ */ jsx(
|
|
9965
|
-
|
|
10046
|
+
Animated9.View,
|
|
9966
10047
|
{
|
|
9967
10048
|
style: [
|
|
9968
10049
|
__spreadProps(__spreadValues({}, thumbStyle), { position: "absolute", left: 0 }),
|
|
@@ -9989,8 +10070,8 @@ var ICON_MAP = {
|
|
|
9989
10070
|
warning: Error_default,
|
|
9990
10071
|
info: Info_default
|
|
9991
10072
|
};
|
|
9992
|
-
var
|
|
9993
|
-
var StyledInlineRoot =
|
|
10073
|
+
var parseTokenValue46 = (value) => parseFloat(value);
|
|
10074
|
+
var StyledInlineRoot = styled52(View)(
|
|
9994
10075
|
({ rootPaddingH, rootPaddingV, rootGap, rootBorderRadius, rootBgColor }) => ({
|
|
9995
10076
|
flexDirection: "row",
|
|
9996
10077
|
alignItems: "flex-start",
|
|
@@ -10001,7 +10082,7 @@ var StyledInlineRoot = styled51(View)(
|
|
|
10001
10082
|
backgroundColor: rootBgColor
|
|
10002
10083
|
})
|
|
10003
10084
|
);
|
|
10004
|
-
var StyledToastRoot =
|
|
10085
|
+
var StyledToastRoot = styled52(View)(
|
|
10005
10086
|
({
|
|
10006
10087
|
rootPaddingH,
|
|
10007
10088
|
rootPaddingV,
|
|
@@ -10028,7 +10109,7 @@ var StyledToastRoot = styled51(View)(
|
|
|
10028
10109
|
elevation: 4
|
|
10029
10110
|
})
|
|
10030
10111
|
);
|
|
10031
|
-
var StyledSystemRoot =
|
|
10112
|
+
var StyledSystemRoot = styled52(View)(
|
|
10032
10113
|
({
|
|
10033
10114
|
rootPaddingH,
|
|
10034
10115
|
rootPaddingTop,
|
|
@@ -10048,37 +10129,37 @@ var StyledSystemRoot = styled51(View)(
|
|
|
10048
10129
|
width: "100%"
|
|
10049
10130
|
})
|
|
10050
10131
|
);
|
|
10051
|
-
var StyledContents =
|
|
10132
|
+
var StyledContents = styled52(View)(({ contentsGap }) => ({
|
|
10052
10133
|
flexDirection: "column",
|
|
10053
10134
|
alignItems: "flex-start",
|
|
10054
10135
|
flex: 1,
|
|
10055
10136
|
minWidth: 0,
|
|
10056
10137
|
gap: contentsGap
|
|
10057
10138
|
}));
|
|
10058
|
-
var StyledCopyRow =
|
|
10139
|
+
var StyledCopyRow = styled52(View)(({ copyGap }) => ({
|
|
10059
10140
|
flexDirection: "row",
|
|
10060
10141
|
alignItems: "flex-start",
|
|
10061
10142
|
gap: copyGap,
|
|
10062
10143
|
width: "100%"
|
|
10063
10144
|
}));
|
|
10064
|
-
var StyledInlineCopy =
|
|
10145
|
+
var StyledInlineCopy = styled52(View)(({ copyGap }) => ({
|
|
10065
10146
|
flexDirection: "column",
|
|
10066
10147
|
alignItems: "flex-start",
|
|
10067
10148
|
gap: copyGap,
|
|
10068
10149
|
flex: 1,
|
|
10069
10150
|
minWidth: 0
|
|
10070
10151
|
}));
|
|
10071
|
-
var StyledLinkWrapper =
|
|
10152
|
+
var StyledLinkWrapper = styled52(View)(({ linkPaddingLeft }) => ({
|
|
10072
10153
|
paddingLeft: linkPaddingLeft,
|
|
10073
10154
|
width: "100%"
|
|
10074
10155
|
}));
|
|
10075
|
-
var StyledCloseButton =
|
|
10156
|
+
var StyledCloseButton = styled52(Pressable)({
|
|
10076
10157
|
alignItems: "center",
|
|
10077
10158
|
justifyContent: "center",
|
|
10078
10159
|
flexShrink: 0,
|
|
10079
10160
|
padding: 0
|
|
10080
10161
|
});
|
|
10081
|
-
var Notification =
|
|
10162
|
+
var Notification = React65.forwardRef(
|
|
10082
10163
|
(props, ref) => {
|
|
10083
10164
|
const _a = props, {
|
|
10084
10165
|
variant = "inline",
|
|
@@ -10114,10 +10195,10 @@ var Notification = React66.forwardRef(
|
|
|
10114
10195
|
ref,
|
|
10115
10196
|
accessible: true,
|
|
10116
10197
|
accessibilityRole: "summary",
|
|
10117
|
-
rootPaddingH:
|
|
10118
|
-
rootPaddingTop:
|
|
10119
|
-
rootPaddingBottom:
|
|
10120
|
-
rootGap:
|
|
10198
|
+
rootPaddingH: parseTokenValue46(sizeTokens.horizontalPadding),
|
|
10199
|
+
rootPaddingTop: parseTokenValue46(sizeTokens.topPadding),
|
|
10200
|
+
rootPaddingBottom: parseTokenValue46(sizeTokens.bottomPadding),
|
|
10201
|
+
rootGap: parseTokenValue46(sizeTokens.content.gap),
|
|
10121
10202
|
rootBgColor: bgMap[type],
|
|
10122
10203
|
rootAlignCenter: isLarge
|
|
10123
10204
|
}, rest), {
|
|
@@ -10142,7 +10223,7 @@ var Notification = React66.forwardRef(
|
|
|
10142
10223
|
link && /* @__PURE__ */ jsx(
|
|
10143
10224
|
StyledLinkWrapper,
|
|
10144
10225
|
{
|
|
10145
|
-
linkPaddingLeft:
|
|
10226
|
+
linkPaddingLeft: parseTokenValue46(sizeTokens.content.gap),
|
|
10146
10227
|
children: /* @__PURE__ */ jsx(
|
|
10147
10228
|
Link,
|
|
10148
10229
|
{
|
|
@@ -10166,12 +10247,12 @@ var Notification = React66.forwardRef(
|
|
|
10166
10247
|
ref,
|
|
10167
10248
|
accessible: true,
|
|
10168
10249
|
accessibilityRole: "alert",
|
|
10169
|
-
rootPaddingH:
|
|
10170
|
-
rootPaddingV:
|
|
10171
|
-
rootGap:
|
|
10172
|
-
rootBorderRadius:
|
|
10250
|
+
rootPaddingH: parseTokenValue46(toast.spacing.horizontalPadding),
|
|
10251
|
+
rootPaddingV: parseTokenValue46(toast.spacing.verticalPadding),
|
|
10252
|
+
rootGap: parseTokenValue46(toast.spacing.gap),
|
|
10253
|
+
rootBorderRadius: parseTokenValue46(toast.borderRadius.default),
|
|
10173
10254
|
rootBgColor: toast.colour.background.default,
|
|
10174
|
-
rootBorderWidth:
|
|
10255
|
+
rootBorderWidth: parseTokenValue46(toast.borderWidth.default),
|
|
10175
10256
|
rootBorderColor: toast.colour.border.default,
|
|
10176
10257
|
rootShadowColor: toast.shaddow.default.color
|
|
10177
10258
|
}, rest), {
|
|
@@ -10179,9 +10260,9 @@ var Notification = React66.forwardRef(
|
|
|
10179
10260
|
/* @__PURE__ */ jsxs(
|
|
10180
10261
|
StyledContents,
|
|
10181
10262
|
{
|
|
10182
|
-
contentsGap:
|
|
10263
|
+
contentsGap: parseTokenValue46(toast.content.spacing.gap),
|
|
10183
10264
|
children: [
|
|
10184
|
-
/* @__PURE__ */ jsxs(StyledCopyRow, { copyGap:
|
|
10265
|
+
/* @__PURE__ */ jsxs(StyledCopyRow, { copyGap: parseTokenValue46(toast.copy.spacing.gap), children: [
|
|
10185
10266
|
showIcon && /* @__PURE__ */ jsx(
|
|
10186
10267
|
Icon,
|
|
10187
10268
|
{
|
|
@@ -10203,7 +10284,7 @@ var Notification = React66.forwardRef(
|
|
|
10203
10284
|
link && /* @__PURE__ */ jsx(
|
|
10204
10285
|
StyledLinkWrapper,
|
|
10205
10286
|
{
|
|
10206
|
-
linkPaddingLeft:
|
|
10287
|
+
linkPaddingLeft: parseTokenValue46(
|
|
10207
10288
|
toast.link.spacing.leftPadding
|
|
10208
10289
|
),
|
|
10209
10290
|
children: /* @__PURE__ */ jsx(
|
|
@@ -10241,14 +10322,14 @@ var Notification = React66.forwardRef(
|
|
|
10241
10322
|
ref,
|
|
10242
10323
|
accessible: true,
|
|
10243
10324
|
accessibilityRole: "alert",
|
|
10244
|
-
rootPaddingH:
|
|
10245
|
-
rootPaddingV:
|
|
10246
|
-
rootGap:
|
|
10247
|
-
rootBorderRadius:
|
|
10325
|
+
rootPaddingH: parseTokenValue46(spacing.horizontalPadding),
|
|
10326
|
+
rootPaddingV: parseTokenValue46(spacing.verticalPadding),
|
|
10327
|
+
rootGap: parseTokenValue46(spacing.gap),
|
|
10328
|
+
rootBorderRadius: parseTokenValue46(borderRadius.default),
|
|
10248
10329
|
rootBgColor: bgMap[type]
|
|
10249
10330
|
}, rest), {
|
|
10250
10331
|
children: [
|
|
10251
|
-
/* @__PURE__ */ jsx(StyledContents, { contentsGap:
|
|
10332
|
+
/* @__PURE__ */ jsx(StyledContents, { contentsGap: parseTokenValue46(content.spacing.gap), children: /* @__PURE__ */ jsxs(StyledCopyRow, { copyGap: parseTokenValue46(content.spacing.gap), children: [
|
|
10252
10333
|
showIcon && /* @__PURE__ */ jsx(
|
|
10253
10334
|
Icon,
|
|
10254
10335
|
{
|
|
@@ -10261,7 +10342,7 @@ var Notification = React66.forwardRef(
|
|
|
10261
10342
|
/* @__PURE__ */ jsxs(
|
|
10262
10343
|
StyledInlineCopy,
|
|
10263
10344
|
{
|
|
10264
|
-
copyGap:
|
|
10345
|
+
copyGap: parseTokenValue46(content.copy.spacing.gap),
|
|
10265
10346
|
children: [
|
|
10266
10347
|
title && /* @__PURE__ */ jsx(
|
|
10267
10348
|
Typography,
|
|
@@ -10282,7 +10363,7 @@ var Notification = React66.forwardRef(
|
|
|
10282
10363
|
link && /* @__PURE__ */ jsx(
|
|
10283
10364
|
StyledLinkWrapper,
|
|
10284
10365
|
{
|
|
10285
|
-
linkPaddingLeft:
|
|
10366
|
+
linkPaddingLeft: parseTokenValue46(content.copy.spacing.gap),
|
|
10286
10367
|
children: /* @__PURE__ */ jsx(
|
|
10287
10368
|
Link,
|
|
10288
10369
|
{
|
|
@@ -10314,7 +10395,7 @@ var Notification = React66.forwardRef(
|
|
|
10314
10395
|
}
|
|
10315
10396
|
);
|
|
10316
10397
|
Notification.displayName = "Notification";
|
|
10317
|
-
var
|
|
10398
|
+
var parseTokenValue47 = (value) => parseFloat(value);
|
|
10318
10399
|
var SCALE_STEP = 0.06;
|
|
10319
10400
|
var SPRING_CONFIG = { damping: 20, stiffness: 260, mass: 0.5 };
|
|
10320
10401
|
var CARD_ENTERING = FadeInDown.duration(200).easing(Easing$1.inOut(Easing$1.quad));
|
|
@@ -10329,7 +10410,7 @@ var DEPTH_LAYER_STYLE = {
|
|
|
10329
10410
|
transformOrigin: "50% 100%",
|
|
10330
10411
|
width: "100%"
|
|
10331
10412
|
};
|
|
10332
|
-
var
|
|
10413
|
+
var StyledRoot16 = styled52(View)(({ rootBottom, rootPaddingH }) => ({
|
|
10333
10414
|
position: "absolute",
|
|
10334
10415
|
left: 0,
|
|
10335
10416
|
right: 0,
|
|
@@ -10337,7 +10418,7 @@ var StyledRoot15 = styled51(View)(({ rootBottom, rootPaddingH }) => ({
|
|
|
10337
10418
|
paddingHorizontal: rootPaddingH,
|
|
10338
10419
|
alignItems: "stretch"
|
|
10339
10420
|
}));
|
|
10340
|
-
var StyledStack =
|
|
10421
|
+
var StyledStack = styled52(View)({
|
|
10341
10422
|
position: "relative",
|
|
10342
10423
|
width: "100%"
|
|
10343
10424
|
});
|
|
@@ -10357,14 +10438,14 @@ var StackedCard = ({
|
|
|
10357
10438
|
onDismiss,
|
|
10358
10439
|
isBackfill
|
|
10359
10440
|
}) => {
|
|
10360
|
-
const isBackfillRef =
|
|
10441
|
+
const isBackfillRef = React65.useRef(isBackfill);
|
|
10361
10442
|
const wasBackfill = isBackfillRef.current;
|
|
10362
10443
|
const depthSV = useSharedValue(wasBackfill ? depth + 1 : depth);
|
|
10363
10444
|
const opacitySV = useSharedValue(wasBackfill ? 0 : 1);
|
|
10364
|
-
|
|
10445
|
+
React65.useEffect(() => {
|
|
10365
10446
|
depthSV.value = withSpring(depth, SPRING_CONFIG);
|
|
10366
10447
|
}, [depth, depthSV]);
|
|
10367
|
-
|
|
10448
|
+
React65.useEffect(() => {
|
|
10368
10449
|
if (wasBackfill) opacitySV.value = withSpring(1, SPRING_CONFIG);
|
|
10369
10450
|
}, []);
|
|
10370
10451
|
const depthStyle = useAnimatedStyle(() => ({
|
|
@@ -10376,7 +10457,7 @@ var StackedCard = ({
|
|
|
10376
10457
|
}));
|
|
10377
10458
|
const isFront = depth === 0;
|
|
10378
10459
|
return /* @__PURE__ */ jsx(
|
|
10379
|
-
|
|
10460
|
+
Animated9.View,
|
|
10380
10461
|
{
|
|
10381
10462
|
entering: wasBackfill ? void 0 : CARD_ENTERING,
|
|
10382
10463
|
exiting: CARD_EXITING,
|
|
@@ -10384,7 +10465,7 @@ var StackedCard = ({
|
|
|
10384
10465
|
accessibilityElementsHidden: !isFront,
|
|
10385
10466
|
importantForAccessibility: isFront ? "auto" : "no-hide-descendants",
|
|
10386
10467
|
style: [CARD_BASE_STYLE, { zIndex: -depth }],
|
|
10387
|
-
children: /* @__PURE__ */ jsx(
|
|
10468
|
+
children: /* @__PURE__ */ jsx(Animated9.View, { style: [DEPTH_LAYER_STYLE, depthStyle], children: /* @__PURE__ */ jsx(
|
|
10388
10469
|
Notification,
|
|
10389
10470
|
{
|
|
10390
10471
|
variant: "toast",
|
|
@@ -10396,13 +10477,13 @@ var StackedCard = ({
|
|
|
10396
10477
|
}
|
|
10397
10478
|
);
|
|
10398
10479
|
};
|
|
10399
|
-
var StackedNotifications =
|
|
10480
|
+
var StackedNotifications = React65.forwardRef((_a, ref) => {
|
|
10400
10481
|
var _b = _a, { items, onDismiss, bottomOffset } = _b, rest = __objRest(_b, ["items", "onDismiss", "bottomOffset"]);
|
|
10401
10482
|
const theme2 = useTheme();
|
|
10402
10483
|
const { spacing } = theme2.tokens.semantics.dimensions;
|
|
10403
|
-
const [dismissed, setDismissed] =
|
|
10484
|
+
const [dismissed, setDismissed] = React65.useState(/* @__PURE__ */ new Set());
|
|
10404
10485
|
const idsKey = items.map((item) => item.id).join("|");
|
|
10405
|
-
|
|
10486
|
+
React65.useEffect(() => {
|
|
10406
10487
|
setDismissed((prev) => {
|
|
10407
10488
|
if (prev.size === 0) return prev;
|
|
10408
10489
|
const present = new Set(items.map((item) => item.id));
|
|
@@ -10415,17 +10496,17 @@ var StackedNotifications = React66.forwardRef((_a, ref) => {
|
|
|
10415
10496
|
return changed ? next : prev;
|
|
10416
10497
|
});
|
|
10417
10498
|
}, [idsKey]);
|
|
10418
|
-
const activeItems =
|
|
10499
|
+
const activeItems = React65.useMemo(
|
|
10419
10500
|
() => items.filter((item) => !dismissed.has(item.id)),
|
|
10420
10501
|
[items, dismissed]
|
|
10421
10502
|
);
|
|
10422
|
-
const layers =
|
|
10503
|
+
const layers = React65.useMemo(
|
|
10423
10504
|
() => activeItems.slice(-3).reverse(),
|
|
10424
10505
|
[activeItems]
|
|
10425
10506
|
);
|
|
10426
|
-
const prevActiveIdsRef =
|
|
10427
|
-
const prevLayerIdsRef =
|
|
10428
|
-
const backfillIds =
|
|
10507
|
+
const prevActiveIdsRef = React65.useRef(/* @__PURE__ */ new Set());
|
|
10508
|
+
const prevLayerIdsRef = React65.useRef(/* @__PURE__ */ new Set());
|
|
10509
|
+
const backfillIds = React65.useMemo(
|
|
10429
10510
|
() => computeBackfillIds(
|
|
10430
10511
|
layers,
|
|
10431
10512
|
prevActiveIdsRef.current,
|
|
@@ -10433,7 +10514,7 @@ var StackedNotifications = React66.forwardRef((_a, ref) => {
|
|
|
10433
10514
|
),
|
|
10434
10515
|
[layers]
|
|
10435
10516
|
);
|
|
10436
|
-
|
|
10517
|
+
React65.useEffect(() => {
|
|
10437
10518
|
prevActiveIdsRef.current = new Set(activeItems.map((item) => item.id));
|
|
10438
10519
|
prevLayerIdsRef.current = new Set(layers.map((item) => item.id));
|
|
10439
10520
|
}, [activeItems, layers]);
|
|
@@ -10445,15 +10526,15 @@ var StackedNotifications = React66.forwardRef((_a, ref) => {
|
|
|
10445
10526
|
});
|
|
10446
10527
|
onDismiss == null ? void 0 : onDismiss(id);
|
|
10447
10528
|
};
|
|
10448
|
-
const rootBottom = bottomOffset != null ? bottomOffset :
|
|
10449
|
-
const peekStep =
|
|
10529
|
+
const rootBottom = bottomOffset != null ? bottomOffset : parseTokenValue47(spacing.lg);
|
|
10530
|
+
const peekStep = parseTokenValue47(spacing.xs);
|
|
10450
10531
|
return /* @__PURE__ */ jsx(
|
|
10451
|
-
|
|
10532
|
+
StyledRoot16,
|
|
10452
10533
|
__spreadProps(__spreadValues({
|
|
10453
10534
|
ref,
|
|
10454
10535
|
pointerEvents: "box-none",
|
|
10455
10536
|
rootBottom,
|
|
10456
|
-
rootPaddingH:
|
|
10537
|
+
rootPaddingH: parseTokenValue47(spacing.md)
|
|
10457
10538
|
}, rest), {
|
|
10458
10539
|
children: /* @__PURE__ */ jsx(StyledStack, { children: layers.map((item, depth) => /* @__PURE__ */ jsx(
|
|
10459
10540
|
StackedCard,
|
|
@@ -10470,16 +10551,16 @@ var StackedNotifications = React66.forwardRef((_a, ref) => {
|
|
|
10470
10551
|
);
|
|
10471
10552
|
});
|
|
10472
10553
|
StackedNotifications.displayName = "StackedNotifications";
|
|
10473
|
-
var
|
|
10554
|
+
var parseTokenValue48 = (value) => parseFloat(value);
|
|
10474
10555
|
var NIB_OFFSET = {
|
|
10475
10556
|
left: 24,
|
|
10476
10557
|
middle: 146,
|
|
10477
10558
|
right: 268
|
|
10478
10559
|
};
|
|
10479
|
-
var Container2 =
|
|
10560
|
+
var Container2 = styled52(View)(({ $width }) => ({
|
|
10480
10561
|
width: $width
|
|
10481
10562
|
}));
|
|
10482
|
-
var StyledBody =
|
|
10563
|
+
var StyledBody = styled52(View)(
|
|
10483
10564
|
({
|
|
10484
10565
|
bgColor,
|
|
10485
10566
|
borderColor,
|
|
@@ -10578,7 +10659,7 @@ function NibTriangle({
|
|
|
10578
10659
|
}
|
|
10579
10660
|
);
|
|
10580
10661
|
}
|
|
10581
|
-
var Tooltip =
|
|
10662
|
+
var Tooltip = React65.forwardRef(
|
|
10582
10663
|
(_a, ref) => {
|
|
10583
10664
|
var _b = _a, { text, alignment = "middle", position = "bottom", children } = _b, props = __objRest(_b, ["text", "alignment", "position", "children"]);
|
|
10584
10665
|
const theme2 = useTheme();
|
|
@@ -10592,9 +10673,9 @@ var Tooltip = React66.forwardRef(
|
|
|
10592
10673
|
width
|
|
10593
10674
|
} = theme2.tokens.components.tooltip;
|
|
10594
10675
|
const [open, setOpen] = useState(false);
|
|
10595
|
-
const tooltipWidth =
|
|
10596
|
-
const nibWidth =
|
|
10597
|
-
const nibHeight =
|
|
10676
|
+
const tooltipWidth = parseTokenValue48(width);
|
|
10677
|
+
const nibWidth = parseTokenValue48(nibToken.width);
|
|
10678
|
+
const nibHeight = parseTokenValue48(nibToken.height);
|
|
10598
10679
|
const nibHalfWidth = nibWidth / 2;
|
|
10599
10680
|
const nibOuterHeight = nibHeight + 1;
|
|
10600
10681
|
const nibX = NIB_OFFSET[alignment];
|
|
@@ -10603,11 +10684,11 @@ var Tooltip = React66.forwardRef(
|
|
|
10603
10684
|
const side = position === "bottom" ? "top" : "bottom";
|
|
10604
10685
|
const bgColor = colour.background.default;
|
|
10605
10686
|
const borderColor = colour.border.default;
|
|
10606
|
-
const borderW =
|
|
10607
|
-
const borderR =
|
|
10608
|
-
const topPad =
|
|
10609
|
-
const bottomPad =
|
|
10610
|
-
const horizontalPad =
|
|
10687
|
+
const borderW = parseTokenValue48(borderWidth.default);
|
|
10688
|
+
const borderR = parseTokenValue48(borderRadius.default);
|
|
10689
|
+
const topPad = parseTokenValue48(spacing.topPadding);
|
|
10690
|
+
const bottomPad = parseTokenValue48(spacing.bottomPadding);
|
|
10691
|
+
const horizontalPad = parseTokenValue48(spacing.horizontalPading);
|
|
10611
10692
|
const nibRow = /* @__PURE__ */ jsx(View, { style: { height: nibOuterHeight, position: "relative", zIndex: 2 }, children: /* @__PURE__ */ jsx(
|
|
10612
10693
|
NibTriangle,
|
|
10613
10694
|
{
|
|
@@ -10666,8 +10747,8 @@ var Tooltip = React66.forwardRef(
|
|
|
10666
10747
|
return bubble;
|
|
10667
10748
|
}
|
|
10668
10749
|
if (Platform.OS === "web") {
|
|
10669
|
-
const child =
|
|
10670
|
-
const trigger = child ?
|
|
10750
|
+
const child = React65.isValidElement(children) ? children : null;
|
|
10751
|
+
const trigger = child ? React65.cloneElement(child, {
|
|
10671
10752
|
onPress: () => {
|
|
10672
10753
|
var _a2, _b2;
|
|
10673
10754
|
(_b2 = (_a2 = child.props).onPress) == null ? void 0 : _b2.call(_a2);
|
|
@@ -10708,18 +10789,18 @@ var Tooltip = React66.forwardRef(
|
|
|
10708
10789
|
}
|
|
10709
10790
|
);
|
|
10710
10791
|
Tooltip.displayName = "Tooltip";
|
|
10711
|
-
var
|
|
10712
|
-
var Row =
|
|
10792
|
+
var parseTokenValue49 = (value) => parseFloat(value);
|
|
10793
|
+
var Row = styled52(Pressable)(({ theme: theme2 }) => {
|
|
10713
10794
|
const { spacing } = theme2.tokens.semantics.dimensions;
|
|
10714
10795
|
return {
|
|
10715
10796
|
width: "100%",
|
|
10716
10797
|
alignItems: "flex-start",
|
|
10717
10798
|
justifyContent: "center",
|
|
10718
|
-
paddingVertical:
|
|
10719
|
-
paddingHorizontal:
|
|
10799
|
+
paddingVertical: parseTokenValue49(spacing.md),
|
|
10800
|
+
paddingHorizontal: parseTokenValue49(spacing.md)
|
|
10720
10801
|
};
|
|
10721
10802
|
});
|
|
10722
|
-
var MenuItem =
|
|
10803
|
+
var MenuItem = React65.forwardRef((_a, ref) => {
|
|
10723
10804
|
var _b = _a, { variant = "action", onPress, children, divider = true } = _b, rest = __objRest(_b, ["variant", "onPress", "children", "divider"]);
|
|
10724
10805
|
const theme2 = useTheme();
|
|
10725
10806
|
const { colour, typography } = theme2.tokens.semantics;
|
|
@@ -10742,33 +10823,33 @@ var MenuItem = React66.forwardRef((_a, ref) => {
|
|
|
10742
10823
|
] });
|
|
10743
10824
|
});
|
|
10744
10825
|
MenuItem.displayName = "Menu.Item";
|
|
10745
|
-
var
|
|
10746
|
-
var DismissLayer =
|
|
10826
|
+
var parseTokenValue50 = (value) => parseFloat(value);
|
|
10827
|
+
var DismissLayer = styled52(Pressable)({
|
|
10747
10828
|
position: "absolute",
|
|
10748
10829
|
top: 0,
|
|
10749
10830
|
left: 0,
|
|
10750
10831
|
right: 0,
|
|
10751
10832
|
bottom: 0
|
|
10752
10833
|
});
|
|
10753
|
-
var Anchor =
|
|
10834
|
+
var Anchor = styled52(View)({
|
|
10754
10835
|
position: "absolute"
|
|
10755
10836
|
});
|
|
10756
|
-
var Card =
|
|
10837
|
+
var Card = styled52(Pressable)(({ theme: theme2, width }) => {
|
|
10757
10838
|
const { borderRadius } = theme2.tokens.semantics.dimensions;
|
|
10758
10839
|
const { shadow, background } = theme2.tokens.semantics.colour;
|
|
10759
10840
|
return {
|
|
10760
10841
|
width,
|
|
10761
|
-
borderRadius:
|
|
10842
|
+
borderRadius: parseTokenValue50(borderRadius.md),
|
|
10762
10843
|
overflow: "hidden",
|
|
10763
10844
|
backgroundColor: background.surface.default,
|
|
10764
10845
|
// Shadow token colour carries its own alpha, so opacity stays at 1.
|
|
10765
10846
|
shadowColor: shadow.md.color,
|
|
10766
10847
|
shadowOffset: {
|
|
10767
|
-
width:
|
|
10768
|
-
height:
|
|
10848
|
+
width: parseTokenValue50(shadow.md.offsetX),
|
|
10849
|
+
height: parseTokenValue50(shadow.md.offsetY)
|
|
10769
10850
|
},
|
|
10770
10851
|
shadowOpacity: 1,
|
|
10771
|
-
shadowRadius:
|
|
10852
|
+
shadowRadius: parseTokenValue50(shadow.md.blur),
|
|
10772
10853
|
elevation: 8
|
|
10773
10854
|
};
|
|
10774
10855
|
});
|
|
@@ -10789,10 +10870,10 @@ var MenuRoot = ({
|
|
|
10789
10870
|
if (anchor && anchor !== lastAnchor) setLastAnchor(anchor);
|
|
10790
10871
|
const shownAnchor = anchor != null ? anchor : lastAnchor;
|
|
10791
10872
|
const position = shownAnchor ? __spreadValues({
|
|
10792
|
-
top: shownAnchor.y + shownAnchor.height +
|
|
10873
|
+
top: shownAnchor.y + shownAnchor.height + parseTokenValue50(spacing.xs)
|
|
10793
10874
|
}, align === "right" ? { right: windowWidth - (shownAnchor.x + shownAnchor.width) } : { left: shownAnchor.x }) : {
|
|
10794
10875
|
top: anchorOffset,
|
|
10795
|
-
[align]:
|
|
10876
|
+
[align]: parseTokenValue50(spacing.md)
|
|
10796
10877
|
};
|
|
10797
10878
|
return /* @__PURE__ */ jsxs(
|
|
10798
10879
|
Modal,
|
|
@@ -10849,8 +10930,8 @@ var useMenuTrigger = () => {
|
|
|
10849
10930
|
menuProps: { open: isOpen, onClose: close, anchor }
|
|
10850
10931
|
};
|
|
10851
10932
|
};
|
|
10852
|
-
var
|
|
10853
|
-
var StyledInsightRoot =
|
|
10933
|
+
var parseTokenValue51 = (value) => parseFloat(value);
|
|
10934
|
+
var StyledInsightRoot = styled52(View)(
|
|
10854
10935
|
({
|
|
10855
10936
|
rootGap,
|
|
10856
10937
|
rootPaddingH,
|
|
@@ -10877,7 +10958,7 @@ var StyledInsightRoot = styled51(View)(
|
|
|
10877
10958
|
minWidth: rootMinWidth
|
|
10878
10959
|
})
|
|
10879
10960
|
);
|
|
10880
|
-
var StyledInsightContent =
|
|
10961
|
+
var StyledInsightContent = styled52(View)(
|
|
10881
10962
|
({ contentGap }) => ({
|
|
10882
10963
|
flex: 1,
|
|
10883
10964
|
flexDirection: "column",
|
|
@@ -10885,7 +10966,7 @@ var StyledInsightContent = styled51(View)(
|
|
|
10885
10966
|
gap: contentGap
|
|
10886
10967
|
})
|
|
10887
10968
|
);
|
|
10888
|
-
var MessageCardInsight =
|
|
10969
|
+
var MessageCardInsight = React65.forwardRef(
|
|
10889
10970
|
(_a, ref) => {
|
|
10890
10971
|
var _b = _a, { variant = "standalone", icon, illustration, title, children } = _b, rest = __objRest(_b, ["variant", "icon", "illustration", "title", "children"]);
|
|
10891
10972
|
const theme2 = useTheme();
|
|
@@ -10894,26 +10975,26 @@ var MessageCardInsight = React66.forwardRef(
|
|
|
10894
10975
|
const isSupporting = variant === "supporting";
|
|
10895
10976
|
const supporting = insightCard.spacing.supporting;
|
|
10896
10977
|
const standalone = insightCard.spacing.standalone;
|
|
10897
|
-
const radiusStandalone =
|
|
10978
|
+
const radiusStandalone = parseTokenValue51(
|
|
10898
10979
|
insightCard.borderRadius.standalone.default
|
|
10899
10980
|
);
|
|
10900
|
-
const radiusSupporting =
|
|
10981
|
+
const radiusSupporting = parseTokenValue51(
|
|
10901
10982
|
insightCard.borderRadius.supporting.bottom
|
|
10902
10983
|
);
|
|
10903
10984
|
return /* @__PURE__ */ jsxs(
|
|
10904
10985
|
StyledInsightRoot,
|
|
10905
10986
|
__spreadProps(__spreadValues({
|
|
10906
10987
|
ref,
|
|
10907
|
-
rootGap:
|
|
10988
|
+
rootGap: parseTokenValue51(
|
|
10908
10989
|
isSupporting ? supporting.gap : standalone.gap
|
|
10909
10990
|
),
|
|
10910
|
-
rootPaddingH:
|
|
10991
|
+
rootPaddingH: parseTokenValue51(
|
|
10911
10992
|
isSupporting ? semanticSpacing.md : standalone.horizontalPadding
|
|
10912
10993
|
),
|
|
10913
|
-
rootPaddingTop:
|
|
10994
|
+
rootPaddingTop: parseTokenValue51(
|
|
10914
10995
|
isSupporting ? supporting.topPadding : standalone.verticalPadding
|
|
10915
10996
|
),
|
|
10916
|
-
rootPaddingBottom:
|
|
10997
|
+
rootPaddingBottom: parseTokenValue51(
|
|
10917
10998
|
isSupporting ? supporting.bottomPadding : standalone.verticalPadding
|
|
10918
10999
|
),
|
|
10919
11000
|
rootBorderTopLeftRadius: isSupporting ? 0 : radiusStandalone,
|
|
@@ -10921,7 +11002,7 @@ var MessageCardInsight = React66.forwardRef(
|
|
|
10921
11002
|
rootBorderBottomLeftRadius: isSupporting ? radiusSupporting : radiusStandalone,
|
|
10922
11003
|
rootBorderBottomRightRadius: isSupporting ? radiusSupporting : radiusStandalone,
|
|
10923
11004
|
rootBgColor: insightCard.colour.background.default,
|
|
10924
|
-
rootMinWidth:
|
|
11005
|
+
rootMinWidth: parseTokenValue51(insightCard.size.minWidth),
|
|
10925
11006
|
accessible: true,
|
|
10926
11007
|
accessibilityRole: "summary"
|
|
10927
11008
|
}, rest), {
|
|
@@ -10930,7 +11011,7 @@ var MessageCardInsight = React66.forwardRef(
|
|
|
10930
11011
|
/* @__PURE__ */ jsxs(
|
|
10931
11012
|
StyledInsightContent,
|
|
10932
11013
|
{
|
|
10933
|
-
contentGap:
|
|
11014
|
+
contentGap: parseTokenValue51(standalone.content.gap),
|
|
10934
11015
|
children: [
|
|
10935
11016
|
title && /* @__PURE__ */ jsx(
|
|
10936
11017
|
Typography,
|
|
@@ -10957,7 +11038,7 @@ var MessageCardInsight = React66.forwardRef(
|
|
|
10957
11038
|
}
|
|
10958
11039
|
);
|
|
10959
11040
|
MessageCardInsight.displayName = "MessageCard.Insight";
|
|
10960
|
-
var StyledBannerRoot =
|
|
11041
|
+
var StyledBannerRoot = styled52(View)(({ rootGap, rootPadding, rootBorderRadius, rootBgColor }) => ({
|
|
10961
11042
|
flexDirection: "row",
|
|
10962
11043
|
alignItems: "center",
|
|
10963
11044
|
gap: rootGap,
|
|
@@ -10965,7 +11046,7 @@ var StyledBannerRoot = styled51(View)(({ rootGap, rootPadding, rootBorderRadius,
|
|
|
10965
11046
|
borderRadius: rootBorderRadius,
|
|
10966
11047
|
backgroundColor: rootBgColor
|
|
10967
11048
|
}));
|
|
10968
|
-
var StyledBannerImage =
|
|
11049
|
+
var StyledBannerImage = styled52(View)(({ imageRadius, imageBgColor }) => ({
|
|
10969
11050
|
flexShrink: 0,
|
|
10970
11051
|
width: 108,
|
|
10971
11052
|
height: 108,
|
|
@@ -10973,14 +11054,14 @@ var StyledBannerImage = styled51(View)(({ imageRadius, imageBgColor }) => ({
|
|
|
10973
11054
|
overflow: "hidden",
|
|
10974
11055
|
backgroundColor: imageBgColor
|
|
10975
11056
|
}));
|
|
10976
|
-
var StyledBannerIllustrationSlot =
|
|
11057
|
+
var StyledBannerIllustrationSlot = styled52(View)({
|
|
10977
11058
|
flexShrink: 0,
|
|
10978
11059
|
width: 108,
|
|
10979
11060
|
height: 108,
|
|
10980
11061
|
alignItems: "center",
|
|
10981
11062
|
justifyContent: "center"
|
|
10982
11063
|
});
|
|
10983
|
-
var StyledBannerContents =
|
|
11064
|
+
var StyledBannerContents = styled52(View)(
|
|
10984
11065
|
({ contentsGap }) => ({
|
|
10985
11066
|
flex: 1,
|
|
10986
11067
|
flexDirection: "column",
|
|
@@ -10990,13 +11071,13 @@ var StyledBannerContents = styled51(View)(
|
|
|
10990
11071
|
minWidth: 0
|
|
10991
11072
|
})
|
|
10992
11073
|
);
|
|
10993
|
-
var StyledBannerCopy =
|
|
11074
|
+
var StyledBannerCopy = styled52(View)(({ copyGap }) => ({
|
|
10994
11075
|
flexDirection: "column",
|
|
10995
11076
|
alignItems: "flex-start",
|
|
10996
11077
|
gap: copyGap,
|
|
10997
11078
|
width: "100%"
|
|
10998
11079
|
}));
|
|
10999
|
-
var MessageCardBanner =
|
|
11080
|
+
var MessageCardBanner = React65.forwardRef(
|
|
11000
11081
|
(_a, ref) => {
|
|
11001
11082
|
var _b = _a, {
|
|
11002
11083
|
colourScheme = "primary",
|
|
@@ -11022,21 +11103,21 @@ var MessageCardBanner = React66.forwardRef(
|
|
|
11022
11103
|
StyledBannerRoot,
|
|
11023
11104
|
__spreadProps(__spreadValues({
|
|
11024
11105
|
ref,
|
|
11025
|
-
rootGap:
|
|
11026
|
-
rootPadding:
|
|
11027
|
-
rootBorderRadius:
|
|
11106
|
+
rootGap: parseTokenValue51(dimensions3.spacing.md),
|
|
11107
|
+
rootPadding: parseTokenValue51(dimensions3.spacing.md),
|
|
11108
|
+
rootBorderRadius: parseTokenValue51(dimensions3.borderRadius.md),
|
|
11028
11109
|
rootBgColor: bgColor,
|
|
11029
11110
|
accessible: true,
|
|
11030
11111
|
accessibilityRole: "summary"
|
|
11031
11112
|
}, rest), {
|
|
11032
11113
|
children: [
|
|
11033
|
-
(media == null ? void 0 : media.type) === "illustration" ? /* @__PURE__ */ jsx(StyledBannerIllustrationSlot, { children:
|
|
11114
|
+
(media == null ? void 0 : media.type) === "illustration" ? /* @__PURE__ */ jsx(StyledBannerIllustrationSlot, { children: React65.createElement(media.illustration, {
|
|
11034
11115
|
width: 108,
|
|
11035
11116
|
height: 108
|
|
11036
11117
|
}) }) : (media == null ? void 0 : media.type) === "image" ? /* @__PURE__ */ jsx(
|
|
11037
11118
|
StyledBannerImage,
|
|
11038
11119
|
{
|
|
11039
|
-
imageRadius:
|
|
11120
|
+
imageRadius: parseTokenValue51(dimensions3.borderRadius.sm),
|
|
11040
11121
|
imageBgColor: colour.background.surface.secondary,
|
|
11041
11122
|
children: /* @__PURE__ */ jsx(
|
|
11042
11123
|
Image,
|
|
@@ -11052,12 +11133,12 @@ var MessageCardBanner = React66.forwardRef(
|
|
|
11052
11133
|
/* @__PURE__ */ jsxs(
|
|
11053
11134
|
StyledBannerContents,
|
|
11054
11135
|
{
|
|
11055
|
-
contentsGap:
|
|
11136
|
+
contentsGap: parseTokenValue51(dimensions3.spacing.xs),
|
|
11056
11137
|
children: [
|
|
11057
11138
|
/* @__PURE__ */ jsxs(
|
|
11058
11139
|
StyledBannerCopy,
|
|
11059
11140
|
{
|
|
11060
|
-
copyGap:
|
|
11141
|
+
copyGap: parseTokenValue51(dimensions3.spacing["3xs"]),
|
|
11061
11142
|
children: [
|
|
11062
11143
|
title && /* @__PURE__ */ jsx(Typography, { variant: "heading", size: "xs", color: "primary", children: title }),
|
|
11063
11144
|
/* @__PURE__ */ jsx(Typography, { variant: "body", size: "md", color: "secondary", children })
|
|
@@ -11088,7 +11169,7 @@ var MessageCard = {
|
|
|
11088
11169
|
Insight: MessageCardInsight,
|
|
11089
11170
|
Banner: MessageCardBanner
|
|
11090
11171
|
};
|
|
11091
|
-
var
|
|
11172
|
+
var parseTokenValue52 = (value) => parseFloat(value);
|
|
11092
11173
|
var slideEaseOut = Easing$1.out(Easing$1.quad);
|
|
11093
11174
|
var MONTH_SLIDE_ENTERING = {
|
|
11094
11175
|
forward: FadeInRight.duration(250).easing(slideEaseOut),
|
|
@@ -11129,14 +11210,14 @@ function defaultGetDateState(date) {
|
|
|
11129
11210
|
function getDefaultMonthLabel(year, month, locale) {
|
|
11130
11211
|
return format(new Date(year, month, 1), "MMMM yyyy", { locale });
|
|
11131
11212
|
}
|
|
11132
|
-
var StyledContainer3 =
|
|
11213
|
+
var StyledContainer3 = styled52(View)(({ containerMaxWidth }) => ({
|
|
11133
11214
|
flexDirection: "column",
|
|
11134
11215
|
// Fill the parent by default (capped by maxWidth) so consumers don't need a
|
|
11135
11216
|
// wrapper. Overridable via the `style` prop.
|
|
11136
11217
|
width: "100%",
|
|
11137
11218
|
maxWidth: containerMaxWidth
|
|
11138
11219
|
}));
|
|
11139
|
-
var StyledMonthHeader =
|
|
11220
|
+
var StyledMonthHeader = styled52(View)(
|
|
11140
11221
|
({ headerGap, datesGap }) => ({
|
|
11141
11222
|
flexDirection: "row",
|
|
11142
11223
|
alignItems: "center",
|
|
@@ -11145,24 +11226,24 @@ var StyledMonthHeader = styled51(View)(
|
|
|
11145
11226
|
marginBottom: datesGap
|
|
11146
11227
|
})
|
|
11147
11228
|
);
|
|
11148
|
-
var StyledWeekRow =
|
|
11229
|
+
var StyledWeekRow = styled52(View)(({ weekGap }) => ({
|
|
11149
11230
|
flexDirection: "row",
|
|
11150
11231
|
// Gap between the week-day header and the month header.
|
|
11151
11232
|
marginBottom: weekGap
|
|
11152
11233
|
}));
|
|
11153
|
-
var StyledWeekCell =
|
|
11234
|
+
var StyledWeekCell = styled52(View)({
|
|
11154
11235
|
flex: 1,
|
|
11155
11236
|
alignItems: "center",
|
|
11156
11237
|
justifyContent: "center"
|
|
11157
11238
|
});
|
|
11158
|
-
var StyledDatesGrid =
|
|
11239
|
+
var StyledDatesGrid = styled52(View)(({ rowGap }) => ({
|
|
11159
11240
|
flexDirection: "column",
|
|
11160
11241
|
gap: rowGap
|
|
11161
11242
|
}));
|
|
11162
|
-
var StyledDateRow =
|
|
11243
|
+
var StyledDateRow = styled52(View)({
|
|
11163
11244
|
flexDirection: "row"
|
|
11164
11245
|
});
|
|
11165
|
-
var StyledDateCell =
|
|
11246
|
+
var StyledDateCell = styled52(View)(
|
|
11166
11247
|
({ cellHeight }) => ({
|
|
11167
11248
|
flex: 1,
|
|
11168
11249
|
height: cellHeight,
|
|
@@ -11170,7 +11251,7 @@ var StyledDateCell = styled51(View)(
|
|
|
11170
11251
|
justifyContent: "center"
|
|
11171
11252
|
})
|
|
11172
11253
|
);
|
|
11173
|
-
var StyledIndicator3 =
|
|
11254
|
+
var StyledIndicator3 = styled52(View)(
|
|
11174
11255
|
({
|
|
11175
11256
|
indicatorSize,
|
|
11176
11257
|
indicatorBorderRadius,
|
|
@@ -11190,7 +11271,7 @@ var StyledIndicator3 = styled51(View)(
|
|
|
11190
11271
|
justifyContent: "center"
|
|
11191
11272
|
})
|
|
11192
11273
|
);
|
|
11193
|
-
var DatePicker =
|
|
11274
|
+
var DatePicker = React65.forwardRef(
|
|
11194
11275
|
(_a, ref) => {
|
|
11195
11276
|
var _b = _a, {
|
|
11196
11277
|
year,
|
|
@@ -11252,17 +11333,17 @@ var DatePicker = React66.forwardRef(
|
|
|
11252
11333
|
} = useMemo(
|
|
11253
11334
|
() => ({
|
|
11254
11335
|
// Gap between the week-day header and the month header.
|
|
11255
|
-
weekGap:
|
|
11336
|
+
weekGap: parseTokenValue52(datePicker.spacing.gap),
|
|
11256
11337
|
// Gap between the month header and the dates grid.
|
|
11257
|
-
datesGap:
|
|
11258
|
-
containerMaxWidth:
|
|
11259
|
-
headerGap:
|
|
11260
|
-
cellHeight:
|
|
11261
|
-
indicatorSize:
|
|
11262
|
-
indicatorBorderRadius:
|
|
11263
|
-
selectedBorderWidth:
|
|
11264
|
-
disabledOpacity:
|
|
11265
|
-
rowGap:
|
|
11338
|
+
datesGap: parseTokenValue52(theme2.tokens.semantics.dimensions.spacing.md),
|
|
11339
|
+
containerMaxWidth: parseTokenValue52(dt.size.width) * 7,
|
|
11340
|
+
headerGap: parseTokenValue52(datePicker.month.spacing.gap),
|
|
11341
|
+
cellHeight: parseTokenValue52(dt.size.height),
|
|
11342
|
+
indicatorSize: parseTokenValue52(dt.size.indicator),
|
|
11343
|
+
indicatorBorderRadius: parseTokenValue52(dt.borderRadius.indicator),
|
|
11344
|
+
selectedBorderWidth: parseTokenValue52(dt.borderWidth.indicator.selected),
|
|
11345
|
+
disabledOpacity: parseTokenValue52(dt.opacity.disabled),
|
|
11346
|
+
rowGap: parseTokenValue52(datePicker.dates.spacing.gap)
|
|
11266
11347
|
}),
|
|
11267
11348
|
[datePicker, dt, theme2]
|
|
11268
11349
|
);
|
|
@@ -11422,7 +11503,7 @@ var DatePicker = React66.forwardRef(
|
|
|
11422
11503
|
) })
|
|
11423
11504
|
] }),
|
|
11424
11505
|
/* @__PURE__ */ jsx(
|
|
11425
|
-
|
|
11506
|
+
Animated9.View,
|
|
11426
11507
|
{
|
|
11427
11508
|
entering: MONTH_SLIDE_ENTERING[slideDir],
|
|
11428
11509
|
exiting: MONTH_SLIDE_EXITING[slideDir],
|
|
@@ -11540,26 +11621,26 @@ var buildPointerPath = (r) => {
|
|
|
11540
11621
|
"Z"
|
|
11541
11622
|
].join(" ");
|
|
11542
11623
|
};
|
|
11543
|
-
var
|
|
11544
|
-
var
|
|
11624
|
+
var parseTokenValue53 = (value) => parseFloat(value);
|
|
11625
|
+
var StyledRoot17 = styled52(View)(({ rootGap }) => ({
|
|
11545
11626
|
flexDirection: "column",
|
|
11546
11627
|
gap: rootGap,
|
|
11547
11628
|
width: "100%"
|
|
11548
11629
|
}));
|
|
11549
|
-
var StyledRow2 =
|
|
11630
|
+
var StyledRow2 = styled52(View)(({ rowGap }) => ({
|
|
11550
11631
|
flexDirection: "row",
|
|
11551
11632
|
alignItems: "flex-start",
|
|
11552
11633
|
gap: rowGap,
|
|
11553
11634
|
width: "100%"
|
|
11554
11635
|
}));
|
|
11555
|
-
var StyledItemStack =
|
|
11636
|
+
var StyledItemStack = styled52(View)(({ stackGap }) => ({
|
|
11556
11637
|
flexDirection: "column",
|
|
11557
11638
|
alignItems: "center",
|
|
11558
11639
|
gap: stackGap,
|
|
11559
11640
|
flex: 1,
|
|
11560
11641
|
minWidth: 0
|
|
11561
11642
|
}));
|
|
11562
|
-
var StyledPictureButton =
|
|
11643
|
+
var StyledPictureButton = styled52(Pressable)(
|
|
11563
11644
|
({
|
|
11564
11645
|
buttonBorderRadius,
|
|
11565
11646
|
buttonBorderWidth,
|
|
@@ -11586,14 +11667,14 @@ var StyledPictureButton = styled51(Pressable)(
|
|
|
11586
11667
|
overflow: "hidden"
|
|
11587
11668
|
})
|
|
11588
11669
|
);
|
|
11589
|
-
var StyledPointer =
|
|
11670
|
+
var StyledPointer = styled52(Svg72)(
|
|
11590
11671
|
({ pointerVisible }) => ({
|
|
11591
11672
|
width: POINTER_WIDTH,
|
|
11592
11673
|
height: POINTER_HEIGHT,
|
|
11593
11674
|
opacity: pointerVisible ? 1 : 0
|
|
11594
11675
|
})
|
|
11595
11676
|
);
|
|
11596
|
-
var PictureSelector =
|
|
11677
|
+
var PictureSelector = React65.forwardRef(
|
|
11597
11678
|
(_a, ref) => {
|
|
11598
11679
|
var _b = _a, {
|
|
11599
11680
|
label,
|
|
@@ -11620,7 +11701,7 @@ var PictureSelector = React66.forwardRef(
|
|
|
11620
11701
|
const { pictureSelector } = theme2.tokens.components;
|
|
11621
11702
|
const { pictureButton } = pictureSelector;
|
|
11622
11703
|
const isControlled = value !== void 0;
|
|
11623
|
-
const [internalValue, setInternalValue] =
|
|
11704
|
+
const [internalValue, setInternalValue] = React65.useState(defaultValue);
|
|
11624
11705
|
const selectedValue = isControlled ? value : internalValue;
|
|
11625
11706
|
const selectedItem = items.find((item) => item.value === selectedValue);
|
|
11626
11707
|
const hasInsight = Boolean(
|
|
@@ -11630,24 +11711,24 @@ var PictureSelector = React66.forwardRef(
|
|
|
11630
11711
|
if (!isControlled) setInternalValue(nextValue);
|
|
11631
11712
|
onValueChange == null ? void 0 : onValueChange(nextValue);
|
|
11632
11713
|
};
|
|
11633
|
-
const rootGap =
|
|
11634
|
-
const rowGap =
|
|
11635
|
-
const stackGap =
|
|
11636
|
-
const buttonPadding =
|
|
11637
|
-
const buttonBorderRadius =
|
|
11714
|
+
const rootGap = parseTokenValue53(pictureSelector.spacing.container.gap);
|
|
11715
|
+
const rowGap = parseTokenValue53(pictureSelector.spacing.buttons.gap);
|
|
11716
|
+
const stackGap = parseTokenValue53(pictureButton.spacing.container.gap);
|
|
11717
|
+
const buttonPadding = parseTokenValue53(pictureButton.spacing.padding);
|
|
11718
|
+
const buttonBorderRadius = parseTokenValue53(
|
|
11638
11719
|
pictureButton.borderRadius.default
|
|
11639
11720
|
);
|
|
11640
|
-
const borderWidthDefault =
|
|
11721
|
+
const borderWidthDefault = parseTokenValue53(
|
|
11641
11722
|
pictureButton.borderWidth.default
|
|
11642
11723
|
);
|
|
11643
|
-
const borderWidthActive =
|
|
11724
|
+
const borderWidthActive = parseTokenValue53(pictureButton.borderWidth.active);
|
|
11644
11725
|
const pointerPath = buildPointerPath(
|
|
11645
|
-
|
|
11726
|
+
parseTokenValue53(pictureButton.pointer.borderRadius.default)
|
|
11646
11727
|
);
|
|
11647
|
-
const resolvedMinWidth = itemMinWidth != null ? itemMinWidth :
|
|
11728
|
+
const resolvedMinWidth = itemMinWidth != null ? itemMinWidth : parseTokenValue53(pictureButton.size.minWidth);
|
|
11648
11729
|
const resolvedMinHeight = itemMinHeight != null ? itemMinHeight : resolvedMinWidth;
|
|
11649
11730
|
return /* @__PURE__ */ jsxs(
|
|
11650
|
-
|
|
11731
|
+
StyledRoot17,
|
|
11651
11732
|
__spreadProps(__spreadValues({
|
|
11652
11733
|
ref,
|
|
11653
11734
|
rootGap,
|
|
@@ -11737,15 +11818,15 @@ var DEFAULT_UNIT_LABELS = {
|
|
|
11737
11818
|
seconds: { singular: "sec", plural: "secs" }
|
|
11738
11819
|
};
|
|
11739
11820
|
var resolveLabel = (label, value) => typeof label === "string" ? label : value === 1 ? label.singular : label.plural;
|
|
11740
|
-
var
|
|
11821
|
+
var parseTokenValue54 = (value) => parseFloat(value);
|
|
11741
11822
|
var pad = (value) => String(Math.max(0, Math.floor(value))).padStart(2, "0");
|
|
11742
|
-
var StackedRoot =
|
|
11823
|
+
var StackedRoot = styled52(View)(({ rootGap }) => ({
|
|
11743
11824
|
flexDirection: "row",
|
|
11744
11825
|
alignItems: "center",
|
|
11745
11826
|
alignSelf: "flex-start",
|
|
11746
11827
|
gap: rootGap
|
|
11747
11828
|
}));
|
|
11748
|
-
var StackedItem =
|
|
11829
|
+
var StackedItem = styled52(View)(
|
|
11749
11830
|
({
|
|
11750
11831
|
itemGap,
|
|
11751
11832
|
itemVerticalPadding,
|
|
@@ -11763,7 +11844,7 @@ var StackedItem = styled51(View)(
|
|
|
11763
11844
|
borderRadius: itemBorderRadius
|
|
11764
11845
|
})
|
|
11765
11846
|
);
|
|
11766
|
-
var StackedCountBox =
|
|
11847
|
+
var StackedCountBox = styled52(View)(({ countPaddingTop, countBgColor, countBorderRadius }) => ({
|
|
11767
11848
|
alignItems: "center",
|
|
11768
11849
|
justifyContent: "center",
|
|
11769
11850
|
// TODO: Add token — fixed count box dimensions are not yet tokenised.
|
|
@@ -11773,7 +11854,7 @@ var StackedCountBox = styled51(View)(({ countPaddingTop, countBgColor, countBord
|
|
|
11773
11854
|
backgroundColor: countBgColor,
|
|
11774
11855
|
borderRadius: countBorderRadius
|
|
11775
11856
|
}));
|
|
11776
|
-
var InlineRoot =
|
|
11857
|
+
var InlineRoot = styled52(View)(
|
|
11777
11858
|
({
|
|
11778
11859
|
rootGap,
|
|
11779
11860
|
rootVerticalPadding,
|
|
@@ -11793,18 +11874,18 @@ var InlineRoot = styled51(View)(
|
|
|
11793
11874
|
overflow: "hidden"
|
|
11794
11875
|
})
|
|
11795
11876
|
);
|
|
11796
|
-
var InlineGroup =
|
|
11877
|
+
var InlineGroup = styled52(View)(({ groupGap }) => ({
|
|
11797
11878
|
flexDirection: "row",
|
|
11798
11879
|
alignItems: "center",
|
|
11799
11880
|
justifyContent: "flex-end",
|
|
11800
11881
|
gap: groupGap
|
|
11801
11882
|
}));
|
|
11802
|
-
var InlineCount =
|
|
11883
|
+
var InlineCount = styled52(View)(({ countGap }) => ({
|
|
11803
11884
|
flexDirection: "row",
|
|
11804
11885
|
alignItems: "center",
|
|
11805
11886
|
gap: countGap
|
|
11806
11887
|
}));
|
|
11807
|
-
var Countdown =
|
|
11888
|
+
var Countdown = React65.forwardRef(
|
|
11808
11889
|
(_a, ref) => {
|
|
11809
11890
|
var _b = _a, {
|
|
11810
11891
|
layout = "stacked",
|
|
@@ -11867,28 +11948,28 @@ var Countdown = React66.forwardRef(
|
|
|
11867
11948
|
InlineRoot,
|
|
11868
11949
|
__spreadProps(__spreadValues({
|
|
11869
11950
|
ref,
|
|
11870
|
-
rootGap:
|
|
11871
|
-
rootVerticalPadding:
|
|
11951
|
+
rootGap: parseTokenValue54(countdown.spacing.gap),
|
|
11952
|
+
rootVerticalPadding: parseTokenValue54(
|
|
11872
11953
|
countdown.spacing.verticalPadding
|
|
11873
11954
|
),
|
|
11874
|
-
rootHorizontalPadding:
|
|
11955
|
+
rootHorizontalPadding: parseTokenValue54(
|
|
11875
11956
|
countdown.spacing.horizontalPadding
|
|
11876
11957
|
),
|
|
11877
11958
|
rootBgColor: countdown.colour.background.default,
|
|
11878
|
-
rootBorderRadius:
|
|
11959
|
+
rootBorderRadius: parseTokenValue54(countdown.borderRadius.default)
|
|
11879
11960
|
}, rest), {
|
|
11880
11961
|
children: [
|
|
11881
11962
|
label != null && /* @__PURE__ */ jsx(Typography, { variant: "body", weight: "bold", size: "md", color: "primary", children: label }),
|
|
11882
11963
|
/* @__PURE__ */ jsx(
|
|
11883
11964
|
InlineGroup,
|
|
11884
11965
|
{
|
|
11885
|
-
groupGap:
|
|
11886
|
-
children: units.map((unit, index) => /* @__PURE__ */ jsxs(
|
|
11966
|
+
groupGap: parseTokenValue54(countdown.countdownGroup.spacing.gap),
|
|
11967
|
+
children: units.map((unit, index) => /* @__PURE__ */ jsxs(React65.Fragment, { children: [
|
|
11887
11968
|
index > 0 && colon(`colon-${unit.key}`),
|
|
11888
11969
|
/* @__PURE__ */ jsxs(
|
|
11889
11970
|
InlineCount,
|
|
11890
11971
|
{
|
|
11891
|
-
countGap:
|
|
11972
|
+
countGap: parseTokenValue54(countdown.count.spacing.gap),
|
|
11892
11973
|
children: [
|
|
11893
11974
|
/* @__PURE__ */ jsx(
|
|
11894
11975
|
Typography,
|
|
@@ -11924,33 +12005,33 @@ var Countdown = React66.forwardRef(
|
|
|
11924
12005
|
StackedRoot,
|
|
11925
12006
|
__spreadProps(__spreadValues({
|
|
11926
12007
|
ref,
|
|
11927
|
-
rootGap:
|
|
12008
|
+
rootGap: parseTokenValue54(countdown.spacing.gap)
|
|
11928
12009
|
}, rest), {
|
|
11929
|
-
children: units.map((unit, index) => /* @__PURE__ */ jsxs(
|
|
12010
|
+
children: units.map((unit, index) => /* @__PURE__ */ jsxs(React65.Fragment, { children: [
|
|
11930
12011
|
index > 0 && colon(`colon-${unit.key}`),
|
|
11931
12012
|
/* @__PURE__ */ jsxs(
|
|
11932
12013
|
StackedItem,
|
|
11933
12014
|
{
|
|
11934
|
-
itemGap:
|
|
11935
|
-
itemVerticalPadding:
|
|
12015
|
+
itemGap: parseTokenValue54(countdownItem.spacing.gap),
|
|
12016
|
+
itemVerticalPadding: parseTokenValue54(
|
|
11936
12017
|
countdownItem.spacing.verticalPadding
|
|
11937
12018
|
),
|
|
11938
|
-
itemHorizontalPadding:
|
|
12019
|
+
itemHorizontalPadding: parseTokenValue54(
|
|
11939
12020
|
countdownItem.spacing.horizontalPadding
|
|
11940
12021
|
),
|
|
11941
12022
|
itemBgColor: countdownItem.colour.background.default,
|
|
11942
|
-
itemBorderRadius:
|
|
12023
|
+
itemBorderRadius: parseTokenValue54(
|
|
11943
12024
|
countdownItem.borderRadius.default
|
|
11944
12025
|
),
|
|
11945
12026
|
children: [
|
|
11946
12027
|
/* @__PURE__ */ jsx(
|
|
11947
12028
|
StackedCountBox,
|
|
11948
12029
|
{
|
|
11949
|
-
countPaddingTop:
|
|
12030
|
+
countPaddingTop: parseTokenValue54(
|
|
11950
12031
|
countdownItem.count.spacing.paddingTop
|
|
11951
12032
|
),
|
|
11952
12033
|
countBgColor: countdownItem.count.colour.background.default,
|
|
11953
|
-
countBorderRadius:
|
|
12034
|
+
countBorderRadius: parseTokenValue54(
|
|
11954
12035
|
countdownItem.count.borderRadius.default
|
|
11955
12036
|
),
|
|
11956
12037
|
children: /* @__PURE__ */ jsx(
|
|
@@ -11980,41 +12061,41 @@ var Countdown = React66.forwardRef(
|
|
|
11980
12061
|
}
|
|
11981
12062
|
);
|
|
11982
12063
|
Countdown.displayName = "Countdown";
|
|
11983
|
-
var
|
|
12064
|
+
var parseTokenValue55 = (value) => {
|
|
11984
12065
|
if (typeof value === "number") return value;
|
|
11985
12066
|
return parseFloat(value);
|
|
11986
12067
|
};
|
|
11987
|
-
var BadgeContainer =
|
|
12068
|
+
var BadgeContainer = styled52(View)(({ theme: theme2 }) => {
|
|
11988
12069
|
const spacing = theme2.tokens.semantics.dimensions.spacing;
|
|
11989
12070
|
const { sizing, borderRadius } = theme2.tokens.semantics.dimensions;
|
|
11990
12071
|
const { colour } = theme2.tokens.semantics;
|
|
11991
12072
|
return {
|
|
11992
12073
|
display: "flex",
|
|
11993
12074
|
flexDirection: "row",
|
|
11994
|
-
gap:
|
|
12075
|
+
gap: parseTokenValue55(spacing["2xs"]),
|
|
11995
12076
|
alignItems: "center",
|
|
11996
12077
|
justifyContent: "center",
|
|
11997
|
-
height:
|
|
11998
|
-
paddingRight:
|
|
12078
|
+
height: parseTokenValue55(sizing["2xl"]),
|
|
12079
|
+
paddingRight: parseTokenValue55(spacing.xs),
|
|
11999
12080
|
backgroundColor: colour.background.container.brand,
|
|
12000
|
-
borderTopRightRadius:
|
|
12001
|
-
borderBottomRightRadius:
|
|
12081
|
+
borderTopRightRadius: parseTokenValue55(borderRadius.xs),
|
|
12082
|
+
borderBottomRightRadius: parseTokenValue55(borderRadius.xs)
|
|
12002
12083
|
};
|
|
12003
12084
|
});
|
|
12004
|
-
var BadgeIcon =
|
|
12085
|
+
var BadgeIcon = styled52(View)(({ theme: theme2 }) => {
|
|
12005
12086
|
const spacing = theme2.tokens.semantics.dimensions.spacing;
|
|
12006
12087
|
const sizing = theme2.tokens.semantics.dimensions.sizing;
|
|
12007
12088
|
return {
|
|
12008
12089
|
display: "flex",
|
|
12009
12090
|
alignItems: "center",
|
|
12010
12091
|
justifyContent: "center",
|
|
12011
|
-
width:
|
|
12012
|
-
height:
|
|
12013
|
-
marginLeft:
|
|
12092
|
+
width: parseTokenValue55(sizing.md),
|
|
12093
|
+
height: parseTokenValue55(sizing.md),
|
|
12094
|
+
marginLeft: parseTokenValue55(spacing.xs),
|
|
12014
12095
|
flexShrink: 0
|
|
12015
12096
|
};
|
|
12016
12097
|
});
|
|
12017
|
-
var Badge2 =
|
|
12098
|
+
var Badge2 = React65.forwardRef(
|
|
12018
12099
|
(_a, ref) => {
|
|
12019
12100
|
var _b = _a, { icon, text } = _b, rest = __objRest(_b, ["icon", "text"]);
|
|
12020
12101
|
return /* @__PURE__ */ jsxs(BadgeContainer, __spreadProps(__spreadValues({ ref }, rest), { children: [
|
|
@@ -12024,7 +12105,7 @@ var Badge2 = React66.forwardRef(
|
|
|
12024
12105
|
}
|
|
12025
12106
|
);
|
|
12026
12107
|
Badge2.displayName = "ProductListingCard.Badge";
|
|
12027
|
-
var StyledGrid =
|
|
12108
|
+
var StyledGrid = styled52(View)(({ theme: theme2 }) => {
|
|
12028
12109
|
const spacing = theme2.tokens.semantics.dimensions.spacing;
|
|
12029
12110
|
return {
|
|
12030
12111
|
display: "grid",
|
|
@@ -12032,7 +12113,7 @@ var StyledGrid = styled51(View)(({ theme: theme2 }) => {
|
|
|
12032
12113
|
"grid-row-gap": spacing.xl
|
|
12033
12114
|
};
|
|
12034
12115
|
});
|
|
12035
|
-
var Grid =
|
|
12116
|
+
var Grid = React65.forwardRef(
|
|
12036
12117
|
(_a, ref) => {
|
|
12037
12118
|
var _b = _a, { children, xs = 1, md = 2, lg = 3 } = _b, rest = __objRest(_b, ["children", "xs", "md", "lg"]);
|
|
12038
12119
|
const { width } = useWindowDimensions();
|
|
@@ -12059,69 +12140,69 @@ var Grid = React66.forwardRef(
|
|
|
12059
12140
|
}
|
|
12060
12141
|
);
|
|
12061
12142
|
Grid.displayName = "ProductListingCard.Grid";
|
|
12062
|
-
var
|
|
12143
|
+
var parseTokenValue56 = (value) => {
|
|
12063
12144
|
if (typeof value === "number") return value;
|
|
12064
12145
|
return parseFloat(value);
|
|
12065
12146
|
};
|
|
12066
|
-
var
|
|
12147
|
+
var StyledRoot18 = styled52(Pressable)(({ theme: theme2 }) => {
|
|
12067
12148
|
const spacing = theme2.tokens.semantics.dimensions.spacing;
|
|
12068
12149
|
return {
|
|
12069
12150
|
display: "flex",
|
|
12070
12151
|
flexDirection: "column",
|
|
12071
|
-
gap:
|
|
12152
|
+
gap: parseTokenValue56(spacing.md),
|
|
12072
12153
|
alignItems: "flex-start",
|
|
12073
12154
|
width: "100%"
|
|
12074
12155
|
};
|
|
12075
12156
|
});
|
|
12076
|
-
var ImageContainer =
|
|
12157
|
+
var ImageContainer = styled52(View)(({ theme: theme2 }) => ({
|
|
12077
12158
|
position: "relative",
|
|
12078
12159
|
width: "100%",
|
|
12079
12160
|
aspectRatio: 1,
|
|
12080
12161
|
overflow: "hidden",
|
|
12081
|
-
borderRadius:
|
|
12162
|
+
borderRadius: parseTokenValue56(
|
|
12082
12163
|
theme2.tokens.semantics.dimensions.borderRadius.md
|
|
12083
12164
|
)
|
|
12084
12165
|
}));
|
|
12085
|
-
var StyledImage2 =
|
|
12166
|
+
var StyledImage2 = styled52(Image)({
|
|
12086
12167
|
width: "100%",
|
|
12087
12168
|
height: "100%",
|
|
12088
12169
|
resizeMode: "cover"
|
|
12089
12170
|
});
|
|
12090
|
-
var BadgeContainer2 =
|
|
12171
|
+
var BadgeContainer2 = styled52(View)(({ theme: theme2 }) => ({
|
|
12091
12172
|
position: "absolute",
|
|
12092
|
-
top:
|
|
12173
|
+
top: parseTokenValue56(theme2.tokens.semantics.dimensions.spacing.md),
|
|
12093
12174
|
left: 0
|
|
12094
12175
|
}));
|
|
12095
|
-
var ContentContainer =
|
|
12176
|
+
var ContentContainer = styled52(View)(({ theme: theme2 }) => {
|
|
12096
12177
|
const spacing = theme2.tokens.semantics.dimensions.spacing;
|
|
12097
12178
|
return {
|
|
12098
12179
|
display: "flex",
|
|
12099
12180
|
flexDirection: "column",
|
|
12100
|
-
gap:
|
|
12181
|
+
gap: parseTokenValue56(spacing.md),
|
|
12101
12182
|
alignItems: "flex-start",
|
|
12102
12183
|
width: "100%"
|
|
12103
12184
|
};
|
|
12104
12185
|
});
|
|
12105
|
-
var DetailsContainer =
|
|
12186
|
+
var DetailsContainer = styled52(View)({
|
|
12106
12187
|
display: "flex",
|
|
12107
12188
|
flexDirection: "column",
|
|
12108
12189
|
alignItems: "flex-start",
|
|
12109
12190
|
width: "100%"
|
|
12110
12191
|
});
|
|
12111
|
-
var CategoryWrapper =
|
|
12192
|
+
var CategoryWrapper = styled52(View)(({ theme: theme2 }) => {
|
|
12112
12193
|
const spacing = theme2.tokens.semantics.dimensions.spacing;
|
|
12113
12194
|
return {
|
|
12114
|
-
marginBottom:
|
|
12195
|
+
marginBottom: parseTokenValue56(spacing["3xs"])
|
|
12115
12196
|
};
|
|
12116
12197
|
});
|
|
12117
|
-
var TitleContainer =
|
|
12198
|
+
var TitleContainer = styled52(View)({
|
|
12118
12199
|
display: "flex",
|
|
12119
12200
|
flexDirection: "row",
|
|
12120
12201
|
width: "100%",
|
|
12121
12202
|
// 6px below the title to match Figma (4px title bottom padding + 2px gap).
|
|
12122
12203
|
marginBottom: 6
|
|
12123
12204
|
});
|
|
12124
|
-
var PricingContainer =
|
|
12205
|
+
var PricingContainer = styled52(View)(({ theme: theme2 }) => {
|
|
12125
12206
|
const spacing = theme2.tokens.semantics.dimensions.spacing;
|
|
12126
12207
|
return {
|
|
12127
12208
|
display: "flex",
|
|
@@ -12131,7 +12212,7 @@ var PricingContainer = styled51(View)(({ theme: theme2 }) => {
|
|
|
12131
12212
|
width: "100%"
|
|
12132
12213
|
};
|
|
12133
12214
|
});
|
|
12134
|
-
var _ProductListingCard =
|
|
12215
|
+
var _ProductListingCard = React65.forwardRef(
|
|
12135
12216
|
(_a, ref) => {
|
|
12136
12217
|
var _b = _a, {
|
|
12137
12218
|
image,
|
|
@@ -12164,7 +12245,7 @@ var _ProductListingCard = React66.forwardRef(
|
|
|
12164
12245
|
"showPrice",
|
|
12165
12246
|
"onPress"
|
|
12166
12247
|
]);
|
|
12167
|
-
return /* @__PURE__ */ jsxs(
|
|
12248
|
+
return /* @__PURE__ */ jsxs(StyledRoot18, __spreadProps(__spreadValues({ ref, onPress }, rest), { children: [
|
|
12168
12249
|
/* @__PURE__ */ jsxs(ImageContainer, { children: [
|
|
12169
12250
|
image && /* @__PURE__ */ jsx(View, { style: { flex: 1, width: "100%", height: "100%" }, children: typeof image === "string" ? /* @__PURE__ */ jsx(
|
|
12170
12251
|
StyledImage2,
|
|
@@ -12173,7 +12254,7 @@ var _ProductListingCard = React66.forwardRef(
|
|
|
12173
12254
|
accessibilityLabel: imageAlt,
|
|
12174
12255
|
accessible: true
|
|
12175
12256
|
}
|
|
12176
|
-
) :
|
|
12257
|
+
) : React65.isValidElement(image) ? image : /* @__PURE__ */ jsx(
|
|
12177
12258
|
StyledImage2,
|
|
12178
12259
|
{
|
|
12179
12260
|
source: image,
|
|
@@ -12211,7 +12292,7 @@ var ProductListingCardWithBadgeAndGrid = Object.assign(_ProductListingCard, {
|
|
|
12211
12292
|
Badge: Badge2,
|
|
12212
12293
|
Grid
|
|
12213
12294
|
});
|
|
12214
|
-
var StyledCardContainer =
|
|
12295
|
+
var StyledCardContainer = styled52(View, {
|
|
12215
12296
|
shouldForwardProp: (prop) => prop !== "showBanner"
|
|
12216
12297
|
})(({ theme: theme2 }) => {
|
|
12217
12298
|
const { spacing, borderRadius } = theme2.tokens.semantics.dimensions;
|
|
@@ -12242,7 +12323,7 @@ var StyledCardContainer = styled51(View, {
|
|
|
12242
12323
|
flex: 1
|
|
12243
12324
|
};
|
|
12244
12325
|
});
|
|
12245
|
-
var StyledImage3 =
|
|
12326
|
+
var StyledImage3 = styled52(View)(({ theme: theme2, imageBackgroundColor, thumbnailWidth = 148 }) => ({
|
|
12246
12327
|
flexShrink: 0,
|
|
12247
12328
|
backgroundColor: imageBackgroundColor || theme2.tokens.semantics.colour.background.container.secondary,
|
|
12248
12329
|
overflow: "hidden",
|
|
@@ -12252,7 +12333,7 @@ var StyledImage3 = styled51(View)(({ theme: theme2, imageBackgroundColor, thumbn
|
|
|
12252
12333
|
minHeight: thumbnailWidth,
|
|
12253
12334
|
position: "relative"
|
|
12254
12335
|
}));
|
|
12255
|
-
var StyledBadgeOverlay =
|
|
12336
|
+
var StyledBadgeOverlay = styled52(View)(({ theme: theme2 }) => {
|
|
12256
12337
|
const offset = parseTokenValue9(
|
|
12257
12338
|
theme2.tokens.semantics.dimensions.spacing["2xs"]
|
|
12258
12339
|
);
|
|
@@ -12263,7 +12344,7 @@ var StyledBadgeOverlay = styled51(View)(({ theme: theme2 }) => {
|
|
|
12263
12344
|
zIndex: 2
|
|
12264
12345
|
};
|
|
12265
12346
|
});
|
|
12266
|
-
var StyledContentArea =
|
|
12347
|
+
var StyledContentArea = styled52(View)(({ theme: theme2 }) => {
|
|
12267
12348
|
const { spacing } = theme2.tokens.semantics.dimensions;
|
|
12268
12349
|
const paddingValue = parseTokenValue9(spacing.md);
|
|
12269
12350
|
return {
|
|
@@ -12274,10 +12355,10 @@ var StyledContentArea = styled51(View)(({ theme: theme2 }) => {
|
|
|
12274
12355
|
justifyContent: "space-between"
|
|
12275
12356
|
};
|
|
12276
12357
|
});
|
|
12277
|
-
var StyledTextContainer =
|
|
12358
|
+
var StyledTextContainer = styled52(View)(() => ({
|
|
12278
12359
|
gap: 2
|
|
12279
12360
|
}));
|
|
12280
|
-
var StyledBannerWrapper =
|
|
12361
|
+
var StyledBannerWrapper = styled52(View)(({ theme: theme2 }) => {
|
|
12281
12362
|
const { spacing, borderRadius } = theme2.tokens.semantics.dimensions;
|
|
12282
12363
|
const radiusMd = parseTokenValue9(borderRadius.md);
|
|
12283
12364
|
const spacingMd = parseTokenValue9(spacing.md);
|
|
@@ -12291,13 +12372,13 @@ var StyledBannerWrapper = styled51(View)(({ theme: theme2 }) => {
|
|
|
12291
12372
|
paddingBottom: spacingMd
|
|
12292
12373
|
};
|
|
12293
12374
|
});
|
|
12294
|
-
var StyledRootWrapper =
|
|
12375
|
+
var StyledRootWrapper = styled52(View)(() => {
|
|
12295
12376
|
return {
|
|
12296
12377
|
flexDirection: "column",
|
|
12297
12378
|
width: "100%"
|
|
12298
12379
|
};
|
|
12299
12380
|
});
|
|
12300
|
-
var StyledNotification =
|
|
12381
|
+
var StyledNotification = styled52(Notification)(({ theme: theme2 }) => {
|
|
12301
12382
|
const { spacing, borderRadius } = theme2.tokens.semantics.dimensions;
|
|
12302
12383
|
const spacingMd = parseTokenValue9(spacing.md);
|
|
12303
12384
|
const radiusMd = parseTokenValue9(borderRadius.md);
|
|
@@ -12314,7 +12395,7 @@ var StyledNotification = styled51(Notification)(({ theme: theme2 }) => {
|
|
|
12314
12395
|
borderBottomRightRadius: radiusMd
|
|
12315
12396
|
};
|
|
12316
12397
|
});
|
|
12317
|
-
var StyledNoneBanner =
|
|
12398
|
+
var StyledNoneBanner = styled52(View)(({ theme: theme2 }) => {
|
|
12318
12399
|
const { spacing, borderRadius } = theme2.tokens.semantics.dimensions;
|
|
12319
12400
|
const { colour } = theme2.tokens.semantics;
|
|
12320
12401
|
const spacingMd = parseTokenValue9(spacing.md);
|
|
@@ -12330,7 +12411,7 @@ var StyledNoneBanner = styled51(View)(({ theme: theme2 }) => {
|
|
|
12330
12411
|
borderBottomRightRadius: radiusMd
|
|
12331
12412
|
};
|
|
12332
12413
|
});
|
|
12333
|
-
var ProductDisplayCard =
|
|
12414
|
+
var ProductDisplayCard = React65.forwardRef(
|
|
12334
12415
|
(_a, ref) => {
|
|
12335
12416
|
var _b = _a, {
|
|
12336
12417
|
title,
|
|
@@ -12470,9 +12551,9 @@ var ProductDisplayCard = React66.forwardRef(
|
|
|
12470
12551
|
}
|
|
12471
12552
|
);
|
|
12472
12553
|
ProductDisplayCard.displayName = "ProductDisplayCard";
|
|
12473
|
-
var TabNavigationContext =
|
|
12554
|
+
var TabNavigationContext = React65.createContext(void 0);
|
|
12474
12555
|
var useTabNavigationContext = () => {
|
|
12475
|
-
const context =
|
|
12556
|
+
const context = React65.useContext(TabNavigationContext);
|
|
12476
12557
|
if (!context) {
|
|
12477
12558
|
throw new Error(
|
|
12478
12559
|
"TabNavigation.List, TabNavigation.Tab and TabNavigation.Panel must be used within a TabNavigation component."
|
|
@@ -12480,13 +12561,13 @@ var useTabNavigationContext = () => {
|
|
|
12480
12561
|
}
|
|
12481
12562
|
return context;
|
|
12482
12563
|
};
|
|
12483
|
-
var
|
|
12484
|
-
var StyledFixedList =
|
|
12564
|
+
var parseTokenValue57 = (value) => parseFloat(value);
|
|
12565
|
+
var StyledFixedList = styled52(View)({
|
|
12485
12566
|
flexDirection: "row",
|
|
12486
12567
|
alignItems: "stretch",
|
|
12487
12568
|
width: "100%"
|
|
12488
12569
|
});
|
|
12489
|
-
var StyledTab =
|
|
12570
|
+
var StyledTab = styled52(Pressable)(
|
|
12490
12571
|
({
|
|
12491
12572
|
tabHeight,
|
|
12492
12573
|
tabMinWidth,
|
|
@@ -12515,7 +12596,7 @@ var StyledTab = styled51(Pressable)(
|
|
|
12515
12596
|
borderBottomColor: tabBorderColor
|
|
12516
12597
|
}, tabFlex !== void 0 ? { flex: tabFlex } : { flexShrink: 0 })
|
|
12517
12598
|
);
|
|
12518
|
-
var TabNavigationList =
|
|
12599
|
+
var TabNavigationList = React65.forwardRef(
|
|
12519
12600
|
(_a, ref) => {
|
|
12520
12601
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
12521
12602
|
const { layout } = useTabNavigationContext();
|
|
@@ -12534,7 +12615,7 @@ var TabNavigationList = React66.forwardRef(
|
|
|
12534
12615
|
}
|
|
12535
12616
|
);
|
|
12536
12617
|
TabNavigationList.displayName = "TabNavigation.List";
|
|
12537
|
-
var TabNavigationTab =
|
|
12618
|
+
var TabNavigationTab = React65.forwardRef(
|
|
12538
12619
|
(_a, ref) => {
|
|
12539
12620
|
var _b = _a, { value, disabled = false, icon, avatar, children } = _b, rest = __objRest(_b, ["value", "disabled", "icon", "avatar", "children"]);
|
|
12540
12621
|
const { layout } = useTabNavigationContext();
|
|
@@ -12550,13 +12631,13 @@ var TabNavigationTab = React66.forwardRef(
|
|
|
12550
12631
|
StyledTab,
|
|
12551
12632
|
__spreadProps(__spreadValues({
|
|
12552
12633
|
ref,
|
|
12553
|
-
tabHeight:
|
|
12554
|
-
tabMinWidth:
|
|
12555
|
-
tabPaddingTop:
|
|
12556
|
-
tabPaddingBottom:
|
|
12557
|
-
tabPaddingHorizontal:
|
|
12558
|
-
tabGap:
|
|
12559
|
-
tabBorderWidth:
|
|
12634
|
+
tabHeight: parseTokenValue57(tabitem.size.height),
|
|
12635
|
+
tabMinWidth: parseTokenValue57(tabitem.size.minWidth),
|
|
12636
|
+
tabPaddingTop: parseTokenValue57(spacing.topPadding),
|
|
12637
|
+
tabPaddingBottom: parseTokenValue57(spacing.bottomPadding),
|
|
12638
|
+
tabPaddingHorizontal: parseTokenValue57(spacing.horizontalPadding),
|
|
12639
|
+
tabGap: parseTokenValue57(spacing.gap),
|
|
12640
|
+
tabBorderWidth: parseTokenValue57(borderWidth.default),
|
|
12560
12641
|
tabBorderColor: borderColour,
|
|
12561
12642
|
tabFlex: layout === "fixed" ? 1 : void 0
|
|
12562
12643
|
}, rest), {
|
|
@@ -12570,7 +12651,7 @@ var TabNavigationTab = React66.forwardRef(
|
|
|
12570
12651
|
}
|
|
12571
12652
|
);
|
|
12572
12653
|
TabNavigationTab.displayName = "TabNavigation.Tab";
|
|
12573
|
-
var TabNavigationPanel =
|
|
12654
|
+
var TabNavigationPanel = React65.forwardRef(
|
|
12574
12655
|
(_a, ref) => {
|
|
12575
12656
|
var _b = _a, { value, children } = _b, rest = __objRest(_b, ["value", "children"]);
|
|
12576
12657
|
const { animation } = useTabNavigationContext();
|
|
@@ -12578,7 +12659,7 @@ var TabNavigationPanel = React66.forwardRef(
|
|
|
12578
12659
|
}
|
|
12579
12660
|
);
|
|
12580
12661
|
TabNavigationPanel.displayName = "TabNavigation.Panel";
|
|
12581
|
-
var TabNavigationRoot =
|
|
12662
|
+
var TabNavigationRoot = React65.forwardRef(
|
|
12582
12663
|
(_a, ref) => {
|
|
12583
12664
|
var _b = _a, {
|
|
12584
12665
|
value,
|
|
@@ -12596,11 +12677,11 @@ var TabNavigationRoot = React66.forwardRef(
|
|
|
12596
12677
|
"children"
|
|
12597
12678
|
]);
|
|
12598
12679
|
const isControlled = typeof value === "string";
|
|
12599
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
12680
|
+
const [uncontrolledValue, setUncontrolledValue] = React65.useState(
|
|
12600
12681
|
() => defaultValue != null ? defaultValue : ""
|
|
12601
12682
|
);
|
|
12602
12683
|
const currentValue = isControlled ? value : uncontrolledValue;
|
|
12603
|
-
const handleValueChange =
|
|
12684
|
+
const handleValueChange = React65.useCallback(
|
|
12604
12685
|
(newValue) => {
|
|
12605
12686
|
if (!isControlled) {
|
|
12606
12687
|
setUncontrolledValue(newValue);
|
|
@@ -12609,7 +12690,7 @@ var TabNavigationRoot = React66.forwardRef(
|
|
|
12609
12690
|
},
|
|
12610
12691
|
[isControlled, onValueChange]
|
|
12611
12692
|
);
|
|
12612
|
-
const contextValue =
|
|
12693
|
+
const contextValue = React65.useMemo(
|
|
12613
12694
|
() => ({ layout, animation }),
|
|
12614
12695
|
[layout, animation]
|
|
12615
12696
|
);
|
|
@@ -12637,7 +12718,7 @@ var TabNavigation = Object.assign(TabNavigationRoot, {
|
|
|
12637
12718
|
Tab: TabNavigationTab,
|
|
12638
12719
|
Panel: TabNavigationPanel
|
|
12639
12720
|
});
|
|
12640
|
-
var
|
|
12721
|
+
var parseTokenValue58 = (value) => parseFloat(value);
|
|
12641
12722
|
var ICON_BUTTON_CONFIG = {
|
|
12642
12723
|
chevronUp: { icon: KeyboardArrowUp_default, defaultVariant: "filled" },
|
|
12643
12724
|
chevronRight: { icon: KeyboardArrowRight_default, defaultVariant: "filled" },
|
|
@@ -12657,10 +12738,10 @@ var ShineOverlay = ({
|
|
|
12657
12738
|
highlight
|
|
12658
12739
|
}) => {
|
|
12659
12740
|
const reducedMotion = useReducedMotion();
|
|
12660
|
-
const [width, setWidth] =
|
|
12741
|
+
const [width, setWidth] = React65.useState(0);
|
|
12661
12742
|
const progress = useSharedValue(0);
|
|
12662
12743
|
const bandWidth = width * SHINE_BAND_RATIO;
|
|
12663
|
-
|
|
12744
|
+
React65.useEffect(() => {
|
|
12664
12745
|
if (reducedMotion || !width) return;
|
|
12665
12746
|
progress.value = withDelay(
|
|
12666
12747
|
ANIMATION_DELAY,
|
|
@@ -12697,7 +12778,7 @@ var ShineOverlay = ({
|
|
|
12697
12778
|
{ borderRadius: radius, overflow: "hidden" }
|
|
12698
12779
|
],
|
|
12699
12780
|
children: width > 0 && /* @__PURE__ */ jsx(
|
|
12700
|
-
|
|
12781
|
+
Animated9.View,
|
|
12701
12782
|
{
|
|
12702
12783
|
style: [
|
|
12703
12784
|
{ position: "absolute", top: 0, bottom: 0, width: bandWidth },
|
|
@@ -12728,7 +12809,7 @@ var createNudgingIcon = (IconComponent, axis, direction) => {
|
|
|
12728
12809
|
const NudgingIcon = (props) => {
|
|
12729
12810
|
const reducedMotion = useReducedMotion();
|
|
12730
12811
|
const offset = useSharedValue(0);
|
|
12731
|
-
|
|
12812
|
+
React65.useEffect(() => {
|
|
12732
12813
|
if (reducedMotion) return;
|
|
12733
12814
|
const step = (to) => withTiming(to, {
|
|
12734
12815
|
duration: NUDGE_STEP,
|
|
@@ -12752,7 +12833,7 @@ var createNudgingIcon = (IconComponent, axis, direction) => {
|
|
|
12752
12833
|
const nudgeStyle = useAnimatedStyle(
|
|
12753
12834
|
() => axis === "translateX" ? { transform: [{ translateX: offset.value }] } : { transform: [{ translateY: offset.value }] }
|
|
12754
12835
|
);
|
|
12755
|
-
return /* @__PURE__ */ jsx(
|
|
12836
|
+
return /* @__PURE__ */ jsx(Animated9.View, { style: nudgeStyle, children: /* @__PURE__ */ jsx(IconComponent, __spreadValues({}, props)) });
|
|
12756
12837
|
};
|
|
12757
12838
|
NudgingIcon.displayName = `Nudging(${(_a = IconComponent.displayName) != null ? _a : "Icon"})`;
|
|
12758
12839
|
return NudgingIcon;
|
|
@@ -12761,7 +12842,7 @@ var NUDGE_ICONS = {
|
|
|
12761
12842
|
chevronUp: createNudgingIcon(KeyboardArrowUp_default, "translateY", -1),
|
|
12762
12843
|
chevronRight: createNudgingIcon(KeyboardArrowRight_default, "translateX", 1)
|
|
12763
12844
|
};
|
|
12764
|
-
var
|
|
12845
|
+
var StyledRoot19 = styled52(View)(
|
|
12765
12846
|
({
|
|
12766
12847
|
rootGap,
|
|
12767
12848
|
rootPaddingH,
|
|
@@ -12785,7 +12866,7 @@ var StyledRoot18 = styled51(View)(
|
|
|
12785
12866
|
boxShadow: rootBoxShadow
|
|
12786
12867
|
})
|
|
12787
12868
|
);
|
|
12788
|
-
var StyledIconContainer =
|
|
12869
|
+
var StyledIconContainer = styled52(View)(({ containerSize, containerRadius, containerBgColor }) => ({
|
|
12789
12870
|
alignItems: "center",
|
|
12790
12871
|
justifyContent: "center",
|
|
12791
12872
|
flexShrink: 0,
|
|
@@ -12794,13 +12875,13 @@ var StyledIconContainer = styled51(View)(({ containerSize, containerRadius, cont
|
|
|
12794
12875
|
borderRadius: containerRadius,
|
|
12795
12876
|
backgroundColor: containerBgColor
|
|
12796
12877
|
}));
|
|
12797
|
-
var StyledContent3 =
|
|
12878
|
+
var StyledContent3 = styled52(View)({
|
|
12798
12879
|
flex: 1,
|
|
12799
12880
|
minWidth: 0,
|
|
12800
12881
|
alignItems: "flex-start",
|
|
12801
12882
|
justifyContent: "center"
|
|
12802
12883
|
});
|
|
12803
|
-
var FloatingActionButton =
|
|
12884
|
+
var FloatingActionButton = React65.forwardRef(
|
|
12804
12885
|
(_a, ref) => {
|
|
12805
12886
|
var _b = _a, {
|
|
12806
12887
|
variant = "primary",
|
|
@@ -12843,22 +12924,22 @@ var FloatingActionButton = React66.forwardRef(
|
|
|
12843
12924
|
}
|
|
12844
12925
|
);
|
|
12845
12926
|
return /* @__PURE__ */ jsxs(
|
|
12846
|
-
|
|
12927
|
+
StyledRoot19,
|
|
12847
12928
|
__spreadProps(__spreadValues({
|
|
12848
12929
|
ref,
|
|
12849
|
-
rootGap:
|
|
12850
|
-
rootPaddingH:
|
|
12930
|
+
rootGap: parseTokenValue58(floatingActionButton.spacing.gap),
|
|
12931
|
+
rootPaddingH: parseTokenValue58(
|
|
12851
12932
|
floatingActionButton.spacing.horizontalPadding
|
|
12852
12933
|
),
|
|
12853
|
-
rootPaddingV:
|
|
12934
|
+
rootPaddingV: parseTokenValue58(
|
|
12854
12935
|
floatingActionButton.spacing.verticalPadding
|
|
12855
12936
|
),
|
|
12856
12937
|
rootBgColor: floatingActionButton.colour.background[variant],
|
|
12857
|
-
rootBorderWidth:
|
|
12938
|
+
rootBorderWidth: parseTokenValue58(
|
|
12858
12939
|
floatingActionButton.borderWidth.default
|
|
12859
12940
|
),
|
|
12860
12941
|
rootBorderColor: floatingActionButton.colour.border[variant],
|
|
12861
|
-
rootBorderRadius:
|
|
12942
|
+
rootBorderRadius: parseTokenValue58(
|
|
12862
12943
|
floatingActionButton.borderRadius.default
|
|
12863
12944
|
),
|
|
12864
12945
|
rootBoxShadow: `${shadow.md.offsetX} ${shadow.md.offsetY} ${shadow.md.blur} ${shadow.md.spread} ${shadow.md.color}`
|
|
@@ -12867,10 +12948,10 @@ var FloatingActionButton = React66.forwardRef(
|
|
|
12867
12948
|
/* @__PURE__ */ jsx(
|
|
12868
12949
|
StyledIconContainer,
|
|
12869
12950
|
{
|
|
12870
|
-
containerSize:
|
|
12951
|
+
containerSize: parseTokenValue58(
|
|
12871
12952
|
theme2.tokens.primitives.dimension.sizing["44"]
|
|
12872
12953
|
),
|
|
12873
|
-
containerRadius:
|
|
12954
|
+
containerRadius: parseTokenValue58(dimensions3.borderRadius.round),
|
|
12874
12955
|
containerBgColor: variant === "secondary" ? colour.background.container.secondary : colour.background.container.default,
|
|
12875
12956
|
children: /* @__PURE__ */ jsx(Icon, { icon, size: "xl", colour: "primary" })
|
|
12876
12957
|
}
|
|
@@ -12893,7 +12974,7 @@ var FloatingActionButton = React66.forwardRef(
|
|
|
12893
12974
|
animation === "shine" && /* @__PURE__ */ jsx(
|
|
12894
12975
|
ShineOverlay,
|
|
12895
12976
|
{
|
|
12896
|
-
radius:
|
|
12977
|
+
radius: parseTokenValue58(floatingActionButton.borderRadius.default),
|
|
12897
12978
|
highlight: theme2.tokens.primitives.colour.system.neutral["1"]
|
|
12898
12979
|
}
|
|
12899
12980
|
)
|
|
@@ -12903,15 +12984,15 @@ var FloatingActionButton = React66.forwardRef(
|
|
|
12903
12984
|
}
|
|
12904
12985
|
);
|
|
12905
12986
|
FloatingActionButton.displayName = "FloatingActionButton";
|
|
12906
|
-
var NavigationHeaderContext =
|
|
12907
|
-
var useNavigationHeaderContext = () =>
|
|
12987
|
+
var NavigationHeaderContext = React65.createContext({ surface: "brand" });
|
|
12988
|
+
var useNavigationHeaderContext = () => React65.useContext(NavigationHeaderContext);
|
|
12908
12989
|
var getButtonDefaults = ({
|
|
12909
12990
|
surface
|
|
12910
12991
|
}) => surface === "brand" ? { variant: "filled", colour: "tertiary" } : { variant: "outlined", colour: "primary" };
|
|
12911
12992
|
var getIconButtonColour = ({
|
|
12912
12993
|
surface
|
|
12913
12994
|
}) => surface === "brand" ? "tertiary" : "secondary";
|
|
12914
|
-
var NavigationHeaderButton =
|
|
12995
|
+
var NavigationHeaderButton = React65.forwardRef((_a, ref) => {
|
|
12915
12996
|
var _b = _a, { variant, colour } = _b, props = __objRest(_b, ["variant", "colour"]);
|
|
12916
12997
|
const defaults = getButtonDefaults(useNavigationHeaderContext());
|
|
12917
12998
|
return /* @__PURE__ */ jsx(
|
|
@@ -12925,7 +13006,7 @@ var NavigationHeaderButton = React66.forwardRef((_a, ref) => {
|
|
|
12925
13006
|
);
|
|
12926
13007
|
});
|
|
12927
13008
|
NavigationHeaderButton.displayName = "NavigationHeader.Button";
|
|
12928
|
-
var NavigationHeaderIconButton =
|
|
13009
|
+
var NavigationHeaderIconButton = React65.forwardRef((_a, ref) => {
|
|
12929
13010
|
var _b = _a, { colour } = _b, props = __objRest(_b, ["colour"]);
|
|
12930
13011
|
const context = useNavigationHeaderContext();
|
|
12931
13012
|
return /* @__PURE__ */ jsx(
|
|
@@ -12938,7 +13019,7 @@ var NavigationHeaderIconButton = React66.forwardRef((_a, ref) => {
|
|
|
12938
13019
|
);
|
|
12939
13020
|
});
|
|
12940
13021
|
NavigationHeaderIconButton.displayName = "NavigationHeader.IconButton";
|
|
12941
|
-
var
|
|
13022
|
+
var parseTokenValue59 = (value) => parseFloat(value);
|
|
12942
13023
|
var getSurfaceColour = (theme2, surface) => {
|
|
12943
13024
|
const { navigationHeader } = theme2.tokens.components;
|
|
12944
13025
|
const { background } = theme2.tokens.semantics.colour;
|
|
@@ -12948,7 +13029,7 @@ var getSurfaceColour = (theme2, surface) => {
|
|
|
12948
13029
|
plain: background.surface.default
|
|
12949
13030
|
}[surface];
|
|
12950
13031
|
};
|
|
12951
|
-
var StyledNavContainer =
|
|
13032
|
+
var StyledNavContainer = styled52(View)(
|
|
12952
13033
|
({
|
|
12953
13034
|
containerPaddingTop,
|
|
12954
13035
|
containerPaddingV,
|
|
@@ -12965,7 +13046,7 @@ var StyledNavContainer = styled51(View)(
|
|
|
12965
13046
|
backgroundColor: containerBgColor
|
|
12966
13047
|
})
|
|
12967
13048
|
);
|
|
12968
|
-
var StyledTitleGroup =
|
|
13049
|
+
var StyledTitleGroup = styled52(View)(({ titleGroupGap, titleGroupMinHeight }) => ({
|
|
12969
13050
|
flex: 1,
|
|
12970
13051
|
flexDirection: "row",
|
|
12971
13052
|
alignItems: "center",
|
|
@@ -12973,11 +13054,11 @@ var StyledTitleGroup = styled51(View)(({ titleGroupGap, titleGroupMinHeight }) =
|
|
|
12973
13054
|
minHeight: titleGroupMinHeight,
|
|
12974
13055
|
gap: titleGroupGap
|
|
12975
13056
|
}));
|
|
12976
|
-
var StyledTitle =
|
|
13057
|
+
var StyledTitle = styled52(View)({
|
|
12977
13058
|
flex: 1,
|
|
12978
13059
|
minWidth: 0
|
|
12979
13060
|
});
|
|
12980
|
-
var StyledActionGroup =
|
|
13061
|
+
var StyledActionGroup = styled52(View)(
|
|
12981
13062
|
({ actionGroupGap }) => ({
|
|
12982
13063
|
flexDirection: "row",
|
|
12983
13064
|
alignItems: "center",
|
|
@@ -12985,7 +13066,7 @@ var StyledActionGroup = styled51(View)(
|
|
|
12985
13066
|
gap: actionGroupGap
|
|
12986
13067
|
})
|
|
12987
13068
|
);
|
|
12988
|
-
var StyledRadiusPips =
|
|
13069
|
+
var StyledRadiusPips = styled52(View)({
|
|
12989
13070
|
flexDirection: "row",
|
|
12990
13071
|
justifyContent: "space-between"
|
|
12991
13072
|
});
|
|
@@ -13012,7 +13093,7 @@ var RadiusPips = ({ radius, colour }) => /* @__PURE__ */ jsxs(
|
|
|
13012
13093
|
]
|
|
13013
13094
|
}
|
|
13014
13095
|
);
|
|
13015
|
-
var NavigationHeaderRoot =
|
|
13096
|
+
var NavigationHeaderRoot = React65.forwardRef(
|
|
13016
13097
|
(_a, ref) => {
|
|
13017
13098
|
var _b = _a, {
|
|
13018
13099
|
title,
|
|
@@ -13038,7 +13119,7 @@ var NavigationHeaderRoot = React66.forwardRef(
|
|
|
13038
13119
|
const { navigationHeader, buttons } = theme2.tokens.components;
|
|
13039
13120
|
const { spacing } = navigationHeader;
|
|
13040
13121
|
const surfaceColour = getSurfaceColour(theme2, surface);
|
|
13041
|
-
const contextValue =
|
|
13122
|
+
const contextValue = React65.useMemo(
|
|
13042
13123
|
() => ({ surface }),
|
|
13043
13124
|
[surface]
|
|
13044
13125
|
);
|
|
@@ -13047,20 +13128,20 @@ var NavigationHeaderRoot = React66.forwardRef(
|
|
|
13047
13128
|
StyledNavContainer,
|
|
13048
13129
|
{
|
|
13049
13130
|
containerPaddingTop: safeAreaTop ? top : 0,
|
|
13050
|
-
containerPaddingV:
|
|
13131
|
+
containerPaddingV: parseTokenValue59(
|
|
13051
13132
|
spacing.navContainer.verticalPadding
|
|
13052
13133
|
),
|
|
13053
|
-
containerPaddingH:
|
|
13134
|
+
containerPaddingH: parseTokenValue59(
|
|
13054
13135
|
spacing.navContainer.horizontalPadding
|
|
13055
13136
|
),
|
|
13056
|
-
containerGap:
|
|
13137
|
+
containerGap: parseTokenValue59(spacing.navContainer.gap),
|
|
13057
13138
|
containerBgColor: surfaceColour,
|
|
13058
13139
|
children: [
|
|
13059
13140
|
/* @__PURE__ */ jsxs(
|
|
13060
13141
|
StyledTitleGroup,
|
|
13061
13142
|
{
|
|
13062
|
-
titleGroupGap:
|
|
13063
|
-
titleGroupMinHeight:
|
|
13143
|
+
titleGroupGap: parseTokenValue59(spacing.titleGroup.gap),
|
|
13144
|
+
titleGroupMinHeight: parseTokenValue59(buttons.size.md.minHeight),
|
|
13064
13145
|
children: [
|
|
13065
13146
|
variant === "secondary" && /* @__PURE__ */ jsx(
|
|
13066
13147
|
IconButton,
|
|
@@ -13090,7 +13171,7 @@ var NavigationHeaderRoot = React66.forwardRef(
|
|
|
13090
13171
|
actions && /* @__PURE__ */ jsx(
|
|
13091
13172
|
StyledActionGroup,
|
|
13092
13173
|
{
|
|
13093
|
-
actionGroupGap:
|
|
13174
|
+
actionGroupGap: parseTokenValue59(spacing.actionGroup.gap),
|
|
13094
13175
|
children: actions
|
|
13095
13176
|
}
|
|
13096
13177
|
)
|
|
@@ -13100,7 +13181,7 @@ var NavigationHeaderRoot = React66.forwardRef(
|
|
|
13100
13181
|
showRadiusPips && /* @__PURE__ */ jsx(
|
|
13101
13182
|
RadiusPips,
|
|
13102
13183
|
{
|
|
13103
|
-
radius:
|
|
13184
|
+
radius: parseTokenValue59(
|
|
13104
13185
|
theme2.tokens.semantics.dimensions.borderRadius.lg
|
|
13105
13186
|
),
|
|
13106
13187
|
colour: surfaceColour
|
|
@@ -13115,6 +13196,6 @@ var NavigationHeader = Object.assign(NavigationHeaderRoot, {
|
|
|
13115
13196
|
IconButton: NavigationHeaderIconButton
|
|
13116
13197
|
});
|
|
13117
13198
|
|
|
13118
|
-
export { Accordion, Animated5 as Animated, Avatar, Badge, Button, ButtonDock, ButtonGroup, CarouselControls, Checkbox, CheckboxGroup, CopyField, CopyFieldInput, Countdown, DatePicker, Divider, Drawer, FilterTab, FloatingActionButton, Hint, Icon, IconButton, Illustration, Input, InputDescription, InputError, InputField, InputLabel, InputText, Link, Logo, Menu2 as Menu, MenuItem, MessageCard, MessageCardBanner, MessageCardInsight, NativeSelectPicker, NavigationHeader, NavigationHeaderButton, NavigationHeaderIconButton, Notification, NumberField, NumberInput, NumberInputField, PROGRESS_ANIMATION, PasswordField, PasswordFieldInput, PasswordFieldRequirements, PawprintProvider, PictureSelector, ProductDisplayCard, ProductListingCardWithBadgeAndGrid as ProductListingCard, Progress, Radio, RadioGroup, RadioTile, SearchField, SearchFieldInput, SegmentedControl,
|
|
13199
|
+
export { Accordion, Animated5 as Animated, Avatar, Badge, Button, ButtonDock, ButtonGroup, CarouselControls, Checkbox, CheckboxGroup, CopyField, CopyFieldInput, Countdown, DatePicker, Divider, Drawer, FilterTab, FloatingActionButton, Hint, Icon, IconButton, Illustration, Input, InputDescription, InputError, InputField, InputLabel, InputText, Link, Logo, Menu2 as Menu, MenuItem, MessageCard, MessageCardBanner, MessageCardInsight, NativeSelectPicker, NavigationHeader, NavigationHeaderButton, NavigationHeaderIconButton, Notification, NumberField, NumberInput, NumberInputField, PROGRESS_ANIMATION, PasswordField, PasswordFieldInput, PasswordFieldRequirements, PawprintProvider, PictureSelector, ProductDisplayCard, ProductListingCardWithBadgeAndGrid as ProductListingCard, Progress, Radio, RadioGroup, RadioTile, SearchField, SearchFieldInput, SegmentedControl, SelectDrawerField, SelectField, SelectFieldDropdown, SelectFieldOption, Slider, Spinner, StackedNotifications, Switch, TabNavigation, Tag, TextArea, TextAreaField, TextAreaLabel, ThemeProvider, Tooltip, Typography, createPawprintTheme, fadeAnimation, fadeDownAnimation, fadeUpAnimation, labelFor, matchOptions, registerLogo, resolveLogo, scaleAnimation, slideInAnimation, slideOutAnimation, theme, useCopyField, useMenuTrigger, usePasswordField, usePawprint, useSearchField };
|
|
13119
13200
|
//# sourceMappingURL=index.js.map
|
|
13120
13201
|
//# sourceMappingURL=index.js.map
|