@butternutbox/pawprint-native 0.10.8 → 0.10.9
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 +5 -5
- package/CHANGELOG.md +21 -0
- package/dist/index.cjs +696 -775
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +196 -275
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/Drawer/Drawer.stories.tsx +49 -110
- package/src/components/molecules/Drawer/DrawerBody.tsx +9 -42
- package/src/components/molecules/Drawer/DrawerContent.tsx +41 -122
- package/src/components/molecules/Drawer/DrawerMeasureContext.ts +0 -22
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import ibmPlexSansCondensed400 from './ibm-plex-sans-condensed-400-normal.ttf';
|
|
|
9
9
|
import ibmPlexSansCondensed500 from './ibm-plex-sans-condensed-500-normal.ttf';
|
|
10
10
|
import ibmPlexSansCondensed600 from './ibm-plex-sans-condensed-600-normal.ttf';
|
|
11
11
|
import ibmPlexSansCondensed700 from './ibm-plex-sans-condensed-700-normal.ttf';
|
|
12
|
-
import
|
|
12
|
+
import React65, { createContext, forwardRef, useRef, useEffect, useState, useCallback, useMemo, useContext } from 'react';
|
|
13
13
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
14
14
|
import * as AvatarPrimitive from '@rn-primitives/avatar';
|
|
15
15
|
import { Text, View, Animated, Pressable, TextInput, Easing, StyleSheet, useWindowDimensions, PanResponder, Image, ScrollView, Keyboard, ActionSheetIOS, TouchableOpacity, Platform, Modal, TouchableWithoutFeedback, FlatList, Linking, Clipboard, Alert } from 'react-native';
|
|
@@ -190,7 +190,7 @@ var VARIANT_DEFAULTS = {
|
|
|
190
190
|
display: { size: "lg" }
|
|
191
191
|
};
|
|
192
192
|
var StyledText = styled50(Text)({});
|
|
193
|
-
var Typography =
|
|
193
|
+
var Typography = React65.forwardRef(
|
|
194
194
|
(props, ref) => {
|
|
195
195
|
const theme2 = useTheme();
|
|
196
196
|
const { typography, colour } = theme2.tokens.semantics;
|
|
@@ -280,7 +280,7 @@ var StyledIconRoot = styled50(View)(({ iconDimension }) => ({
|
|
|
280
280
|
width: iconDimension,
|
|
281
281
|
height: iconDimension
|
|
282
282
|
}));
|
|
283
|
-
var Icon =
|
|
283
|
+
var Icon = React65.forwardRef(
|
|
284
284
|
(_a, ref) => {
|
|
285
285
|
var _b = _a, {
|
|
286
286
|
icon: IconComponent,
|
|
@@ -3880,7 +3880,7 @@ var AVATAR_SIZE_TO_ICON_SIZE = {
|
|
|
3880
3880
|
md: "md",
|
|
3881
3881
|
lg: "xl"
|
|
3882
3882
|
};
|
|
3883
|
-
var AvatarRoot =
|
|
3883
|
+
var AvatarRoot = React65.forwardRef(
|
|
3884
3884
|
(_a, ref) => {
|
|
3885
3885
|
var _b = _a, {
|
|
3886
3886
|
src,
|
|
@@ -3939,7 +3939,7 @@ function getVisibleDots(count, activeIndex) {
|
|
|
3939
3939
|
const windowStart = Math.min(Math.max(activeIndex - 2, 0), count - 5);
|
|
3940
3940
|
return Array.from({ length: 5 }, (_, i) => windowStart + i);
|
|
3941
3941
|
}
|
|
3942
|
-
var CarouselControls =
|
|
3942
|
+
var CarouselControls = React65.forwardRef(
|
|
3943
3943
|
(_a, ref) => {
|
|
3944
3944
|
var _b = _a, { count, activeIndex, showBackground = true } = _b, props = __objRest(_b, ["count", "activeIndex", "showBackground"]);
|
|
3945
3945
|
const theme2 = useTheme();
|
|
@@ -4026,7 +4026,7 @@ var StyledBadge = styled50(View)(({ theme: theme2, badgeVariant, badgeSize, pinn
|
|
|
4026
4026
|
backgroundColor: backgroundColorMap[badgeVariant]
|
|
4027
4027
|
}, borderRadiusStyles), positionStyles);
|
|
4028
4028
|
});
|
|
4029
|
-
var Badge =
|
|
4029
|
+
var Badge = React65.forwardRef(
|
|
4030
4030
|
(_a, ref) => {
|
|
4031
4031
|
var _b = _a, {
|
|
4032
4032
|
variant = "primary",
|
|
@@ -4101,7 +4101,7 @@ var Badge = React66.forwardRef(
|
|
|
4101
4101
|
Badge.displayName = "Badge";
|
|
4102
4102
|
var parseTokenValue6 = (value) => parseFloat(value);
|
|
4103
4103
|
var StyledSpinner = styled50(View)({});
|
|
4104
|
-
var Spinner =
|
|
4104
|
+
var Spinner = React65.forwardRef(
|
|
4105
4105
|
(_a, ref) => {
|
|
4106
4106
|
var _b = _a, { size = "md", variant = "dark", style } = _b, rest = __objRest(_b, ["size", "variant", "style"]);
|
|
4107
4107
|
const theme2 = useTheme();
|
|
@@ -4208,7 +4208,7 @@ var StyledSpinnerWrapper = styled50(View)({
|
|
|
4208
4208
|
alignItems: "center",
|
|
4209
4209
|
justifyContent: "center"
|
|
4210
4210
|
});
|
|
4211
|
-
var Button =
|
|
4211
|
+
var Button = React65.forwardRef(
|
|
4212
4212
|
(_a, ref) => {
|
|
4213
4213
|
var _b = _a, {
|
|
4214
4214
|
variant = "filled",
|
|
@@ -4240,7 +4240,7 @@ var Button = React66.forwardRef(
|
|
|
4240
4240
|
const typographyKey = sizeToTypographyKey[size];
|
|
4241
4241
|
const typography = buttons.text[typographyKey];
|
|
4242
4242
|
resolveFont(typography.fontFamily, typography.fontWeight);
|
|
4243
|
-
const [pressed, setPressed] =
|
|
4243
|
+
const [pressed, setPressed] = React65.useState(false);
|
|
4244
4244
|
const getVariantStyles = (isPressed) => {
|
|
4245
4245
|
if (variant === "filled") {
|
|
4246
4246
|
const bgTokens = buttons.filledButton.colour.background[colour];
|
|
@@ -4351,7 +4351,7 @@ var StyledHint = styled50(View)(({
|
|
|
4351
4351
|
backgroundColor: hintVariantMap[hintVariant]
|
|
4352
4352
|
};
|
|
4353
4353
|
});
|
|
4354
|
-
var Hint =
|
|
4354
|
+
var Hint = React65.forwardRef(
|
|
4355
4355
|
(_a, ref) => {
|
|
4356
4356
|
var _b = _a, { variant = "default" } = _b, rest = __objRest(_b, ["variant"]);
|
|
4357
4357
|
return /* @__PURE__ */ jsx(StyledHint, __spreadValues({ ref, hintVariant: variant }, rest));
|
|
@@ -4393,7 +4393,7 @@ var StyledSpinnerWrapper2 = styled50(View)({
|
|
|
4393
4393
|
alignItems: "center",
|
|
4394
4394
|
justifyContent: "center"
|
|
4395
4395
|
});
|
|
4396
|
-
var IconButton =
|
|
4396
|
+
var IconButton = React65.forwardRef(
|
|
4397
4397
|
(_a, ref) => {
|
|
4398
4398
|
var _b = _a, {
|
|
4399
4399
|
icon: IconComponent,
|
|
@@ -4419,7 +4419,7 @@ var IconButton = React66.forwardRef(
|
|
|
4419
4419
|
const dimension = parseTokenValue9(sizeTokens.height);
|
|
4420
4420
|
const iconSizing = theme2.tokens.components.icons.sizing.icons.core;
|
|
4421
4421
|
const iconDimension = parseTokenValue9(iconSizing[sizeToIconSizeToken[size]]);
|
|
4422
|
-
const [pressed, setPressed] =
|
|
4422
|
+
const [pressed, setPressed] = React65.useState(false);
|
|
4423
4423
|
const getVariantStyles = (isPressed) => {
|
|
4424
4424
|
if (variant === "filled") {
|
|
4425
4425
|
const filled = buttons.iconButton.filledButton;
|
|
@@ -4502,7 +4502,7 @@ var StyledRoot2 = styled50(View)(({ illustrationHeight }) => ({
|
|
|
4502
4502
|
flexShrink: 0,
|
|
4503
4503
|
height: illustrationHeight
|
|
4504
4504
|
}));
|
|
4505
|
-
var Illustration =
|
|
4505
|
+
var Illustration = React65.forwardRef(
|
|
4506
4506
|
(_a, ref) => {
|
|
4507
4507
|
var _b = _a, {
|
|
4508
4508
|
illustration: IllustrationComponent,
|
|
@@ -4538,7 +4538,7 @@ var StyledLabelRow = styled50(View)(({ labelGap }) => ({
|
|
|
4538
4538
|
alignItems: "center",
|
|
4539
4539
|
gap: labelGap
|
|
4540
4540
|
}));
|
|
4541
|
-
var InputLabel =
|
|
4541
|
+
var InputLabel = React65.forwardRef(
|
|
4542
4542
|
(_a, ref) => {
|
|
4543
4543
|
var _b = _a, { optionalText, state = "default", children } = _b, rest = __objRest(_b, ["optionalText", "state", "children"]);
|
|
4544
4544
|
const theme2 = useTheme();
|
|
@@ -4838,7 +4838,7 @@ var StyledIconSlot = styled50(View)({
|
|
|
4838
4838
|
justifyContent: "center",
|
|
4839
4839
|
flexShrink: 0
|
|
4840
4840
|
});
|
|
4841
|
-
var InputField =
|
|
4841
|
+
var InputField = React65.forwardRef(
|
|
4842
4842
|
(_a, ref) => {
|
|
4843
4843
|
var _b = _a, {
|
|
4844
4844
|
leadingIcon,
|
|
@@ -4997,7 +4997,7 @@ var InputField = React66.forwardRef(
|
|
|
4997
4997
|
}
|
|
4998
4998
|
);
|
|
4999
4999
|
InputField.displayName = "Input.Field";
|
|
5000
|
-
var InputText =
|
|
5000
|
+
var InputText = React65.forwardRef(
|
|
5001
5001
|
(_a, ref) => {
|
|
5002
5002
|
var _b = _a, { placeholderTextColor } = _b, rest = __objRest(_b, ["placeholderTextColor"]);
|
|
5003
5003
|
const theme2 = useTheme();
|
|
@@ -5016,7 +5016,7 @@ var StyledDescriptionRow = styled50(View)({
|
|
|
5016
5016
|
flexDirection: "row",
|
|
5017
5017
|
alignItems: "center"
|
|
5018
5018
|
});
|
|
5019
|
-
var InputDescription =
|
|
5019
|
+
var InputDescription = React65.forwardRef(
|
|
5020
5020
|
(_a, ref) => {
|
|
5021
5021
|
var _b = _a, { state = "default", children } = _b, rest = __objRest(_b, ["state", "children"]);
|
|
5022
5022
|
const theme2 = useTheme();
|
|
@@ -5036,7 +5036,7 @@ var StyledErrorRow = styled50(View)({
|
|
|
5036
5036
|
flexDirection: "row",
|
|
5037
5037
|
alignItems: "center"
|
|
5038
5038
|
});
|
|
5039
|
-
var InputError =
|
|
5039
|
+
var InputError = React65.forwardRef(
|
|
5040
5040
|
(_a, ref) => {
|
|
5041
5041
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
5042
5042
|
const theme2 = useTheme();
|
|
@@ -5059,7 +5059,7 @@ var StyledRoot3 = styled50(View)(({ theme: theme2 }) => {
|
|
|
5059
5059
|
gap: parseTokenValue13(spacing.gap)
|
|
5060
5060
|
};
|
|
5061
5061
|
});
|
|
5062
|
-
var InputRoot =
|
|
5062
|
+
var InputRoot = React65.forwardRef(
|
|
5063
5063
|
(_a, ref) => {
|
|
5064
5064
|
var _b = _a, {
|
|
5065
5065
|
label,
|
|
@@ -5103,7 +5103,7 @@ var Input = Object.assign(InputRoot, {
|
|
|
5103
5103
|
Description: InputDescription,
|
|
5104
5104
|
Error: InputError
|
|
5105
5105
|
});
|
|
5106
|
-
var Link =
|
|
5106
|
+
var Link = React65.forwardRef(
|
|
5107
5107
|
(_a, ref) => {
|
|
5108
5108
|
var _b = _a, {
|
|
5109
5109
|
size = "md",
|
|
@@ -7701,7 +7701,7 @@ var StyledRoot4 = styled50(View)({
|
|
|
7701
7701
|
justifyContent: "center",
|
|
7702
7702
|
flexShrink: 0
|
|
7703
7703
|
});
|
|
7704
|
-
var Logo =
|
|
7704
|
+
var Logo = React65.forwardRef(
|
|
7705
7705
|
(_a, ref) => {
|
|
7706
7706
|
var _b = _a, { brand, variant = "primary", "aria-label": ariaLabel } = _b, rest = __objRest(_b, ["brand", "variant", "aria-label"]);
|
|
7707
7707
|
const effectiveVariant = brand === "bcorp" ? "primary" : variant;
|
|
@@ -7740,7 +7740,7 @@ var StyledInputContainer = styled50(View)(({ hasInlineHelp }) => ({
|
|
|
7740
7740
|
flexDirection: "column",
|
|
7741
7741
|
gap: hasInlineHelp ? 2 : 0
|
|
7742
7742
|
}));
|
|
7743
|
-
var NumberInputField =
|
|
7743
|
+
var NumberInputField = React65.forwardRef((_a, ref) => {
|
|
7744
7744
|
var _b = _a, { fieldText, inlineHelpText } = _b, props = __objRest(_b, ["fieldText", "inlineHelpText"]);
|
|
7745
7745
|
const theme2 = useTheme();
|
|
7746
7746
|
const { colour, description } = theme2.tokens.components.inputs;
|
|
@@ -7837,7 +7837,7 @@ var StyledRoot5 = styled50(View)(({ theme: theme2 }) => {
|
|
|
7837
7837
|
gap: parseTokenValue15(spacing.gap)
|
|
7838
7838
|
};
|
|
7839
7839
|
});
|
|
7840
|
-
var NumberInputRoot =
|
|
7840
|
+
var NumberInputRoot = React65.forwardRef(
|
|
7841
7841
|
(_a, ref) => {
|
|
7842
7842
|
var _b = _a, {
|
|
7843
7843
|
label,
|
|
@@ -7932,7 +7932,7 @@ var StyledContent = styled50(View)(({ contentGap }) => ({
|
|
|
7932
7932
|
flex: 1,
|
|
7933
7933
|
minWidth: 0
|
|
7934
7934
|
}));
|
|
7935
|
-
var Switch =
|
|
7935
|
+
var Switch = React65.forwardRef(
|
|
7936
7936
|
(_a, ref) => {
|
|
7937
7937
|
var _b = _a, {
|
|
7938
7938
|
label,
|
|
@@ -7952,7 +7952,7 @@ var Switch = React66.forwardRef(
|
|
|
7952
7952
|
const theme2 = useTheme();
|
|
7953
7953
|
const { size, colour, opacity, borderWidth, spacing, typography } = theme2.tokens.components.switch;
|
|
7954
7954
|
const isControlled = controlledChecked !== void 0;
|
|
7955
|
-
const [internalChecked, setInternalChecked] =
|
|
7955
|
+
const [internalChecked, setInternalChecked] = React65.useState(defaultChecked);
|
|
7956
7956
|
const isChecked = isControlled ? controlledChecked : internalChecked;
|
|
7957
7957
|
const controlWidth = parseTokenValue16(size.control.width);
|
|
7958
7958
|
const controlHeight = parseTokenValue16(size.control.height);
|
|
@@ -8058,7 +8058,7 @@ var StyledTag = styled50(View)(({ theme: theme2, tagVariant, tagSize }) => {
|
|
|
8058
8058
|
backgroundColor: backgroundColorMap[tagVariant]
|
|
8059
8059
|
};
|
|
8060
8060
|
});
|
|
8061
|
-
var Tag =
|
|
8061
|
+
var Tag = React65.forwardRef(
|
|
8062
8062
|
(_a, ref) => {
|
|
8063
8063
|
var _b = _a, { variant = "primary", size = "medium", icon, children } = _b, rest = __objRest(_b, ["variant", "size", "icon", "children"]);
|
|
8064
8064
|
const theme2 = useTheme();
|
|
@@ -8158,7 +8158,7 @@ var IconWrapper2 = styled50(View)(({ side }) => {
|
|
|
8158
8158
|
zIndex: 1
|
|
8159
8159
|
};
|
|
8160
8160
|
});
|
|
8161
|
-
var TextAreaField =
|
|
8161
|
+
var TextAreaField = React65.forwardRef(
|
|
8162
8162
|
(_a, ref) => {
|
|
8163
8163
|
var _b = _a, {
|
|
8164
8164
|
leadingIcon,
|
|
@@ -8351,7 +8351,7 @@ var StyledCharCountWrapper = styled50(View)(({ charCountGap, charCountPadding })
|
|
|
8351
8351
|
gap: charCountGap,
|
|
8352
8352
|
paddingLeft: charCountPadding
|
|
8353
8353
|
}));
|
|
8354
|
-
var TextAreaLabel =
|
|
8354
|
+
var TextAreaLabel = React65.forwardRef(
|
|
8355
8355
|
(_a, ref) => {
|
|
8356
8356
|
var _b = _a, {
|
|
8357
8357
|
optionalText,
|
|
@@ -8415,7 +8415,7 @@ var StyledRoot6 = styled50(View)(({ theme: theme2 }) => {
|
|
|
8415
8415
|
gap: parseTokenValue20(spacing.gap)
|
|
8416
8416
|
};
|
|
8417
8417
|
});
|
|
8418
|
-
var TextAreaRoot =
|
|
8418
|
+
var TextAreaRoot = React65.forwardRef(
|
|
8419
8419
|
(_a, ref) => {
|
|
8420
8420
|
var _b = _a, {
|
|
8421
8421
|
label,
|
|
@@ -8442,8 +8442,8 @@ var TextAreaRoot = React66.forwardRef(
|
|
|
8442
8442
|
"defaultValue",
|
|
8443
8443
|
"onChangeText"
|
|
8444
8444
|
]);
|
|
8445
|
-
const [charCount, setCharCount] =
|
|
8446
|
-
|
|
8445
|
+
const [charCount, setCharCount] = React65.useState(0);
|
|
8446
|
+
React65.useEffect(() => {
|
|
8447
8447
|
if (value !== void 0) {
|
|
8448
8448
|
setCharCount(String(value).length);
|
|
8449
8449
|
} else if (defaultValue !== void 0) {
|
|
@@ -8496,7 +8496,7 @@ var TextArea = Object.assign(TextAreaRoot, {
|
|
|
8496
8496
|
Description: InputDescription,
|
|
8497
8497
|
Error: InputError
|
|
8498
8498
|
});
|
|
8499
|
-
var AccordionContext =
|
|
8499
|
+
var AccordionContext = React65.createContext({
|
|
8500
8500
|
openValues: [],
|
|
8501
8501
|
toggle: () => {
|
|
8502
8502
|
},
|
|
@@ -8527,7 +8527,7 @@ var StyledDivider = styled50(View)(({ dividerColor, dividerMarginTop }) => ({
|
|
|
8527
8527
|
backgroundColor: dividerColor,
|
|
8528
8528
|
marginTop: dividerMarginTop
|
|
8529
8529
|
}));
|
|
8530
|
-
var AccordionItem =
|
|
8530
|
+
var AccordionItem = React65.forwardRef(
|
|
8531
8531
|
(_a, ref) => {
|
|
8532
8532
|
var _b = _a, { title, children, value, disabled: itemDisabled } = _b, rest = __objRest(_b, ["title", "children", "value", "disabled"]);
|
|
8533
8533
|
const theme2 = useTheme();
|
|
@@ -8537,7 +8537,7 @@ var AccordionItem = React66.forwardRef(
|
|
|
8537
8537
|
toggle,
|
|
8538
8538
|
disabled: rootDisabled,
|
|
8539
8539
|
size
|
|
8540
|
-
} =
|
|
8540
|
+
} = React65.useContext(AccordionContext);
|
|
8541
8541
|
const itemValue = value != null ? value : title;
|
|
8542
8542
|
const isOpen = openValues.includes(itemValue);
|
|
8543
8543
|
const isDisabled = itemDisabled || rootDisabled;
|
|
@@ -8598,7 +8598,7 @@ var AccordionItem = React66.forwardRef(
|
|
|
8598
8598
|
}
|
|
8599
8599
|
);
|
|
8600
8600
|
AccordionItem.displayName = "Accordion.Item";
|
|
8601
|
-
var AccordionRoot =
|
|
8601
|
+
var AccordionRoot = React65.forwardRef(
|
|
8602
8602
|
(_a, ref) => {
|
|
8603
8603
|
var _b = _a, {
|
|
8604
8604
|
children,
|
|
@@ -8620,11 +8620,11 @@ var AccordionRoot = React66.forwardRef(
|
|
|
8620
8620
|
const theme2 = useTheme();
|
|
8621
8621
|
const { accordion } = theme2.tokens.components;
|
|
8622
8622
|
const isControlled = controlledValue !== void 0;
|
|
8623
|
-
const [internalValue, setInternalValue] =
|
|
8623
|
+
const [internalValue, setInternalValue] = React65.useState(
|
|
8624
8624
|
defaultValue != null ? defaultValue : []
|
|
8625
8625
|
);
|
|
8626
8626
|
const openValues = isControlled ? controlledValue : internalValue;
|
|
8627
|
-
const toggle =
|
|
8627
|
+
const toggle = React65.useCallback(
|
|
8628
8628
|
(itemValue) => {
|
|
8629
8629
|
const isOpen = openValues.includes(itemValue);
|
|
8630
8630
|
let next;
|
|
@@ -8642,7 +8642,7 @@ var AccordionRoot = React66.forwardRef(
|
|
|
8642
8642
|
},
|
|
8643
8643
|
[openValues, multiple, isControlled, onValueChange]
|
|
8644
8644
|
);
|
|
8645
|
-
const ctx =
|
|
8645
|
+
const ctx = React65.useMemo(
|
|
8646
8646
|
() => ({ openValues, toggle, disabled, size }),
|
|
8647
8647
|
[openValues, toggle, disabled, size]
|
|
8648
8648
|
);
|
|
@@ -8772,7 +8772,7 @@ function buildDelayedEntering(variant, delayMs) {
|
|
|
8772
8772
|
b.delay(delayMs);
|
|
8773
8773
|
return b;
|
|
8774
8774
|
}
|
|
8775
|
-
var Animated5 =
|
|
8775
|
+
var Animated5 = React65.forwardRef(
|
|
8776
8776
|
(_a, ref) => {
|
|
8777
8777
|
var _b = _a, { variant = "fade", delay, exit = true, children } = _b, props = __objRest(_b, ["variant", "delay", "exit", "children"]);
|
|
8778
8778
|
const delayMs = delay !== void 0 && delay > 0 ? Math.round(delay * 1e3) : 0;
|
|
@@ -8790,7 +8790,7 @@ var Animated5 = React66.forwardRef(
|
|
|
8790
8790
|
}
|
|
8791
8791
|
);
|
|
8792
8792
|
Animated5.displayName = "Animated";
|
|
8793
|
-
var DrawerContext =
|
|
8793
|
+
var DrawerContext = React65.createContext({
|
|
8794
8794
|
isOpen: false,
|
|
8795
8795
|
modalVisible: false,
|
|
8796
8796
|
openDrawer: () => {
|
|
@@ -8800,9 +8800,9 @@ var DrawerContext = React66.createContext({
|
|
|
8800
8800
|
onExitComplete: () => {
|
|
8801
8801
|
}
|
|
8802
8802
|
});
|
|
8803
|
-
var useDrawerContext = () =>
|
|
8803
|
+
var useDrawerContext = () => React65.useContext(DrawerContext);
|
|
8804
8804
|
var FADE_DURATION = 220;
|
|
8805
|
-
var DrawerOverlay =
|
|
8805
|
+
var DrawerOverlay = React65.forwardRef(({ accessible = false }, _ref) => {
|
|
8806
8806
|
const theme2 = useTheme();
|
|
8807
8807
|
const { isOpen, closeDrawer } = useDrawerContext();
|
|
8808
8808
|
const opacity = useRef(new Animated.Value(0)).current;
|
|
@@ -8836,14 +8836,12 @@ var DrawerOverlay = React66.forwardRef(({ accessible = false }, _ref) => {
|
|
|
8836
8836
|
);
|
|
8837
8837
|
});
|
|
8838
8838
|
DrawerOverlay.displayName = "Drawer.Overlay";
|
|
8839
|
-
var DrawerDragContext =
|
|
8840
|
-
var useDrawerDragContext = () =>
|
|
8841
|
-
var
|
|
8842
|
-
var
|
|
8843
|
-
var
|
|
8844
|
-
var
|
|
8845
|
-
var DrawerHeaderContext = React66.createContext(null);
|
|
8846
|
-
var useDrawerHeaderContext = () => React66.useContext(DrawerHeaderContext);
|
|
8839
|
+
var DrawerDragContext = React65.createContext(null);
|
|
8840
|
+
var useDrawerDragContext = () => React65.useContext(DrawerDragContext);
|
|
8841
|
+
var DrawerFooterContext = React65.createContext(false);
|
|
8842
|
+
var useDrawerFooterContext = () => React65.useContext(DrawerFooterContext);
|
|
8843
|
+
var DrawerHeaderContext = React65.createContext(null);
|
|
8844
|
+
var useDrawerHeaderContext = () => React65.useContext(DrawerHeaderContext);
|
|
8847
8845
|
var OPEN_DURATION = 320;
|
|
8848
8846
|
var CLOSE_DURATION = 220;
|
|
8849
8847
|
var DISMISS_THRESHOLD = 80;
|
|
@@ -8858,12 +8856,17 @@ var StyledPanel2 = styled50(View)(
|
|
|
8858
8856
|
panelShadowColor,
|
|
8859
8857
|
panelShadowOffsetY,
|
|
8860
8858
|
panelShadowBlur,
|
|
8861
|
-
|
|
8862
|
-
}) =>
|
|
8859
|
+
panelMaxHeight
|
|
8860
|
+
}) => ({
|
|
8863
8861
|
width: "100%",
|
|
8864
8862
|
maxWidth: panelMaxWidth,
|
|
8865
|
-
|
|
8866
|
-
|
|
8863
|
+
// The panel wraps its content and caps at maxHeight. It is intentionally
|
|
8864
|
+
// NOT given a fixed height: letting it size to content means it re-fits
|
|
8865
|
+
// automatically whenever the body grows or shrinks (async load, expanding
|
|
8866
|
+
// sections). The body's own maxHeight (see DrawerBody) bounds scrolling and
|
|
8867
|
+
// keeps the ScrollView from collapsing, so no fixed panel height is needed.
|
|
8868
|
+
maxHeight: panelMaxHeight,
|
|
8869
|
+
alignSelf: "center",
|
|
8867
8870
|
borderTopLeftRadius: panelBorderRadius,
|
|
8868
8871
|
borderTopRightRadius: panelBorderRadius,
|
|
8869
8872
|
borderTopWidth: panelBorderWidth,
|
|
@@ -8879,7 +8882,7 @@ var StyledPanel2 = styled50(View)(
|
|
|
8879
8882
|
overflow: "hidden"
|
|
8880
8883
|
})
|
|
8881
8884
|
);
|
|
8882
|
-
var DrawerContent =
|
|
8885
|
+
var DrawerContent = React65.forwardRef(
|
|
8883
8886
|
(_a, ref) => {
|
|
8884
8887
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
8885
8888
|
var _a2;
|
|
@@ -8889,7 +8892,6 @@ var DrawerContent = React66.forwardRef(
|
|
|
8889
8892
|
const { isOpen, closeDrawer, onExitComplete } = useDrawerContext();
|
|
8890
8893
|
const { height: windowHeight } = useWindowDimensions();
|
|
8891
8894
|
const maxHeight = windowHeight * 0.9;
|
|
8892
|
-
const bodyMaxHeight = windowHeight - 300;
|
|
8893
8895
|
const closeDrawerRef = useRef(closeDrawer);
|
|
8894
8896
|
useEffect(() => {
|
|
8895
8897
|
closeDrawerRef.current = closeDrawer;
|
|
@@ -8900,19 +8902,12 @@ var DrawerContent = React66.forwardRef(
|
|
|
8900
8902
|
const entryRanRef = useRef(false);
|
|
8901
8903
|
const isOpenRef = useRef(isOpen);
|
|
8902
8904
|
const activeAnim = useRef(null);
|
|
8903
|
-
const [panelHeight, setPanelHeight] = useState(0);
|
|
8904
8905
|
useEffect(() => {
|
|
8905
8906
|
const id = translateY.addListener(({ value }) => {
|
|
8906
8907
|
translateYValue.current = value;
|
|
8907
8908
|
});
|
|
8908
8909
|
return () => translateY.removeListener(id);
|
|
8909
8910
|
}, [translateY]);
|
|
8910
|
-
useEffect(() => {
|
|
8911
|
-
if (panelHeightRef.current > 0 && panelHeightRef.current > maxHeight) {
|
|
8912
|
-
setPanelHeight(maxHeight);
|
|
8913
|
-
panelHeightRef.current = maxHeight;
|
|
8914
|
-
}
|
|
8915
|
-
}, [maxHeight]);
|
|
8916
8911
|
const runEntry = useCallback(() => {
|
|
8917
8912
|
var _a3;
|
|
8918
8913
|
if (panelHeightRef.current === 0) return;
|
|
@@ -8961,60 +8956,16 @@ var DrawerContent = React66.forwardRef(
|
|
|
8961
8956
|
}, [isOpen, runEntry, runExit]);
|
|
8962
8957
|
const onLayout = useCallback(
|
|
8963
8958
|
({ nativeEvent }) => {
|
|
8964
|
-
if (entryRanRef.current) return;
|
|
8965
8959
|
const h = nativeEvent.layout.height;
|
|
8966
8960
|
const capped = Math.min(h, maxHeight);
|
|
8967
8961
|
if (capped <= 0) return;
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
panelHeightRef.current = capped;
|
|
8971
|
-
}
|
|
8972
|
-
if (isOpenRef.current) {
|
|
8962
|
+
panelHeightRef.current = capped;
|
|
8963
|
+
if (isOpenRef.current && !entryRanRef.current) {
|
|
8973
8964
|
runEntry();
|
|
8974
8965
|
}
|
|
8975
8966
|
},
|
|
8976
8967
|
[runEntry, maxHeight]
|
|
8977
8968
|
);
|
|
8978
|
-
const chromeRef = useRef(0);
|
|
8979
|
-
const bodyContentRef = useRef(0);
|
|
8980
|
-
const applyDesiredHeight = useCallback(() => {
|
|
8981
|
-
const chrome = chromeRef.current;
|
|
8982
|
-
const content = bodyContentRef.current;
|
|
8983
|
-
const current = panelHeightRef.current;
|
|
8984
|
-
if (chrome <= 0 || content <= 0 || current <= 0) return;
|
|
8985
|
-
const desired = Math.min(
|
|
8986
|
-
chrome + Math.min(content, bodyMaxHeight),
|
|
8987
|
-
maxHeight
|
|
8988
|
-
);
|
|
8989
|
-
if (Math.abs(desired - current) > 1) {
|
|
8990
|
-
panelHeightRef.current = desired;
|
|
8991
|
-
setPanelHeight(desired);
|
|
8992
|
-
}
|
|
8993
|
-
}, [maxHeight, bodyMaxHeight]);
|
|
8994
|
-
const setBodyFrameHeight = useCallback(
|
|
8995
|
-
(frameHeight) => {
|
|
8996
|
-
if (chromeRef.current <= 0) {
|
|
8997
|
-
const current = panelHeightRef.current;
|
|
8998
|
-
if (frameHeight > 0 && current > frameHeight) {
|
|
8999
|
-
chromeRef.current = current - frameHeight;
|
|
9000
|
-
}
|
|
9001
|
-
}
|
|
9002
|
-
applyDesiredHeight();
|
|
9003
|
-
},
|
|
9004
|
-
[applyDesiredHeight]
|
|
9005
|
-
);
|
|
9006
|
-
const setBodyContentHeight = useCallback(
|
|
9007
|
-
(contentHeight) => {
|
|
9008
|
-
if (contentHeight <= 0) return;
|
|
9009
|
-
bodyContentRef.current = contentHeight;
|
|
9010
|
-
applyDesiredHeight();
|
|
9011
|
-
},
|
|
9012
|
-
[applyDesiredHeight]
|
|
9013
|
-
);
|
|
9014
|
-
const measureContextValue = useMemo(
|
|
9015
|
-
() => ({ setBodyFrameHeight, setBodyContentHeight }),
|
|
9016
|
-
[setBodyFrameHeight, setBodyContentHeight]
|
|
9017
|
-
);
|
|
9018
8969
|
const panResponder = useRef(
|
|
9019
8970
|
PanResponder.create({
|
|
9020
8971
|
// Claim the responder as soon as a touch starts on the grabber so the
|
|
@@ -9073,23 +9024,19 @@ var DrawerContent = React66.forwardRef(
|
|
|
9073
9024
|
() => ({ panHandlers: panResponder.panHandlers }),
|
|
9074
9025
|
[panResponder.panHandlers]
|
|
9075
9026
|
);
|
|
9076
|
-
const hasFooter =
|
|
9077
|
-
(child) =>
|
|
9027
|
+
const hasFooter = React65.Children.toArray(children).some(
|
|
9028
|
+
(child) => React65.isValidElement(child) && child.type.displayName === "Drawer.Footer"
|
|
9078
9029
|
);
|
|
9079
|
-
const headerChild =
|
|
9080
|
-
(child) =>
|
|
9030
|
+
const headerChild = React65.Children.toArray(children).find(
|
|
9031
|
+
(child) => React65.isValidElement(child) && child.type.displayName === "Drawer.Header"
|
|
9081
9032
|
);
|
|
9082
9033
|
const headerContextValue = headerChild != null ? {
|
|
9083
9034
|
variant: (_a2 = headerChild.props.variant) != null ? _a2 : "titleAndText"
|
|
9084
9035
|
} : null;
|
|
9085
|
-
return /* @__PURE__ */ jsx(DrawerHeaderContext.Provider, { value: headerContextValue, children: /* @__PURE__ */ jsx(DrawerFooterContext.Provider, { value: hasFooter, children: /* @__PURE__ */ jsx(
|
|
9036
|
+
return /* @__PURE__ */ jsx(DrawerHeaderContext.Provider, { value: headerContextValue, children: /* @__PURE__ */ jsx(DrawerFooterContext.Provider, { value: hasFooter, children: /* @__PURE__ */ jsx(DrawerDragContext.Provider, { value: dragContextValue, children: /* @__PURE__ */ jsx(
|
|
9086
9037
|
Animated.View,
|
|
9087
9038
|
{
|
|
9088
|
-
style: [
|
|
9089
|
-
styles.animatedWrapper,
|
|
9090
|
-
panelHeight > 0 ? { height: panelHeight } : void 0,
|
|
9091
|
-
{ transform: [{ translateY }] }
|
|
9092
|
-
],
|
|
9039
|
+
style: [styles.animatedWrapper, { transform: [{ translateY }] }],
|
|
9093
9040
|
children: /* @__PURE__ */ jsx(
|
|
9094
9041
|
StyledPanel2,
|
|
9095
9042
|
__spreadProps(__spreadValues({
|
|
@@ -9098,7 +9045,7 @@ var DrawerContent = React66.forwardRef(
|
|
|
9098
9045
|
panelBorderRadius: parseTokenValue22(drawer.borderRadius.top),
|
|
9099
9046
|
panelBgColor: colour.background.container.default,
|
|
9100
9047
|
panelMaxWidth: parseTokenValue22(drawer.size.maxWidth),
|
|
9101
|
-
|
|
9048
|
+
panelMaxHeight: maxHeight,
|
|
9102
9049
|
panelBorderWidth: parseTokenValue22(dimensions3.borderWidth.sm),
|
|
9103
9050
|
panelBorderColor: colour.border.default,
|
|
9104
9051
|
panelShadowColor: modal.shadow.color,
|
|
@@ -9112,7 +9059,7 @@ var DrawerContent = React66.forwardRef(
|
|
|
9112
9059
|
})
|
|
9113
9060
|
)
|
|
9114
9061
|
}
|
|
9115
|
-
) }) }) })
|
|
9062
|
+
) }) }) });
|
|
9116
9063
|
}
|
|
9117
9064
|
);
|
|
9118
9065
|
DrawerContent.displayName = "Drawer.Content";
|
|
@@ -9140,7 +9087,7 @@ var StyledBar = styled50(View)(({ barWidth, barHeight, barBorderRadius, barColor
|
|
|
9140
9087
|
borderRadius: barBorderRadius,
|
|
9141
9088
|
backgroundColor: barColor
|
|
9142
9089
|
}));
|
|
9143
|
-
var DrawerGrabber =
|
|
9090
|
+
var DrawerGrabber = React65.forwardRef(
|
|
9144
9091
|
(props, ref) => {
|
|
9145
9092
|
var _a;
|
|
9146
9093
|
const theme2 = useTheme();
|
|
@@ -9168,7 +9115,7 @@ var DrawerGrabber = React66.forwardRef(
|
|
|
9168
9115
|
);
|
|
9169
9116
|
DrawerGrabber.displayName = "Drawer.Grabber";
|
|
9170
9117
|
var parseTokenValue24 = (value) => parseFloat(value);
|
|
9171
|
-
var DrawerClose =
|
|
9118
|
+
var DrawerClose = React65.forwardRef(
|
|
9172
9119
|
(_a, ref) => {
|
|
9173
9120
|
var _b = _a, { "aria-label": ariaLabel = "Close" } = _b, props = __objRest(_b, ["aria-label"]);
|
|
9174
9121
|
const theme2 = useTheme();
|
|
@@ -9281,8 +9228,8 @@ var StyledTitleContent = styled50(View)(
|
|
|
9281
9228
|
function splitChildren(children) {
|
|
9282
9229
|
let closeChild = null;
|
|
9283
9230
|
const otherChildren = [];
|
|
9284
|
-
|
|
9285
|
-
if (
|
|
9231
|
+
React65.Children.forEach(children, (child) => {
|
|
9232
|
+
if (React65.isValidElement(child) && child.type === DrawerClose) {
|
|
9286
9233
|
closeChild = child;
|
|
9287
9234
|
} else {
|
|
9288
9235
|
otherChildren.push(child);
|
|
@@ -9290,7 +9237,7 @@ function splitChildren(children) {
|
|
|
9290
9237
|
});
|
|
9291
9238
|
return { closeChild, otherChildren };
|
|
9292
9239
|
}
|
|
9293
|
-
var DrawerHeader =
|
|
9240
|
+
var DrawerHeader = React65.forwardRef(
|
|
9294
9241
|
(_a, ref) => {
|
|
9295
9242
|
var _b = _a, { variant = "titleAndText", imageSource, children } = _b, props = __objRest(_b, ["variant", "imageSource", "children"]);
|
|
9296
9243
|
var _a2, _b2, _c, _d, _e, _f;
|
|
@@ -9377,7 +9324,7 @@ var DrawerHeader = React66.forwardRef(
|
|
|
9377
9324
|
}
|
|
9378
9325
|
);
|
|
9379
9326
|
DrawerHeader.displayName = "Drawer.Header";
|
|
9380
|
-
var DrawerTitle =
|
|
9327
|
+
var DrawerTitle = React65.forwardRef(
|
|
9381
9328
|
(_a, ref) => {
|
|
9382
9329
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
9383
9330
|
const theme2 = useTheme();
|
|
@@ -9393,7 +9340,7 @@ var DrawerTitle = React66.forwardRef(
|
|
|
9393
9340
|
}
|
|
9394
9341
|
);
|
|
9395
9342
|
DrawerTitle.displayName = "Drawer.Title";
|
|
9396
|
-
var DrawerDescription =
|
|
9343
|
+
var DrawerDescription = React65.forwardRef(
|
|
9397
9344
|
(_a, ref) => {
|
|
9398
9345
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
9399
9346
|
const theme2 = useTheme();
|
|
@@ -9415,56 +9362,31 @@ var StyledScrollView = styled50(ScrollView)(
|
|
|
9415
9362
|
bodyPaddingHorizontal,
|
|
9416
9363
|
bodyPaddingRight,
|
|
9417
9364
|
bodyGap,
|
|
9365
|
+
bodyMaxHeight,
|
|
9418
9366
|
bodyPaddingBottom
|
|
9419
9367
|
}) => ({
|
|
9420
|
-
// flex: 1 fills the bounded panel so the ScrollView can scroll. The panel
|
|
9421
|
-
// (DrawerContent) is the single height authority — the body must NOT set
|
|
9422
|
-
// its own maxHeight, or it would cap independently of the panel and corrupt
|
|
9423
|
-
// the panel's chrome measurement.
|
|
9424
9368
|
flex: 1,
|
|
9425
9369
|
paddingLeft: bodyPaddingHorizontal,
|
|
9426
9370
|
paddingRight: bodyPaddingRight,
|
|
9427
9371
|
gap: bodyGap,
|
|
9372
|
+
maxHeight: bodyMaxHeight,
|
|
9428
9373
|
paddingBottom: bodyPaddingBottom
|
|
9429
9374
|
})
|
|
9430
9375
|
);
|
|
9431
|
-
var DrawerBody =
|
|
9376
|
+
var DrawerBody = React65.forwardRef(
|
|
9432
9377
|
(_a, ref) => {
|
|
9433
|
-
var _b = _a, {
|
|
9434
|
-
children,
|
|
9435
|
-
contentContainerStyle,
|
|
9436
|
-
onLayout,
|
|
9437
|
-
onContentSizeChange
|
|
9438
|
-
} = _b, props = __objRest(_b, [
|
|
9439
|
-
"children",
|
|
9440
|
-
"contentContainerStyle",
|
|
9441
|
-
"onLayout",
|
|
9442
|
-
"onContentSizeChange"
|
|
9443
|
-
]);
|
|
9378
|
+
var _b = _a, { children, contentContainerStyle } = _b, props = __objRest(_b, ["children", "contentContainerStyle"]);
|
|
9444
9379
|
const theme2 = useTheme();
|
|
9445
9380
|
const { spacing } = theme2.tokens.components.drawer;
|
|
9446
9381
|
const { buttons } = theme2.tokens.components;
|
|
9447
9382
|
const { content } = spacing;
|
|
9448
9383
|
const headerContext = useDrawerHeaderContext();
|
|
9449
9384
|
const footerContext = useDrawerFooterContext();
|
|
9450
|
-
const
|
|
9385
|
+
const { height: windowHeight } = useWindowDimensions();
|
|
9451
9386
|
const gap = parseTokenValue26(content.slot.gap);
|
|
9452
9387
|
const horizontalPadding = parseTokenValue26(content.slot.horizontalPadding);
|
|
9453
9388
|
const topPadding = parseTokenValue26(content.slot.verticalPadding);
|
|
9454
|
-
const
|
|
9455
|
-
(event) => {
|
|
9456
|
-
measureContext == null ? void 0 : measureContext.setBodyFrameHeight(event.nativeEvent.layout.height);
|
|
9457
|
-
onLayout == null ? void 0 : onLayout(event);
|
|
9458
|
-
},
|
|
9459
|
-
[measureContext, onLayout]
|
|
9460
|
-
);
|
|
9461
|
-
const handleContentSizeChange = useCallback(
|
|
9462
|
-
(width, height) => {
|
|
9463
|
-
measureContext == null ? void 0 : measureContext.setBodyContentHeight(height);
|
|
9464
|
-
onContentSizeChange == null ? void 0 : onContentSizeChange(width, height);
|
|
9465
|
-
},
|
|
9466
|
-
[measureContext, onContentSizeChange]
|
|
9467
|
-
);
|
|
9389
|
+
const bodyMaxHeight = windowHeight - 300;
|
|
9468
9390
|
const paddingRight = headerContext === null ? parseTokenValue26(spacing.close.right.md) + parseTokenValue26(buttons.size.sm.height) : horizontalPadding;
|
|
9469
9391
|
const bodyPaddingBottom = !footerContext ? parseTokenValue26(theme2.tokens.semantics.dimensions.spacing["2xl"]) : 0;
|
|
9470
9392
|
return /* @__PURE__ */ jsx(
|
|
@@ -9474,9 +9396,8 @@ var DrawerBody = React66.forwardRef(
|
|
|
9474
9396
|
bodyPaddingHorizontal: horizontalPadding,
|
|
9475
9397
|
bodyPaddingRight: paddingRight,
|
|
9476
9398
|
bodyGap: gap,
|
|
9399
|
+
bodyMaxHeight,
|
|
9477
9400
|
bodyPaddingBottom,
|
|
9478
|
-
onLayout: handleLayout,
|
|
9479
|
-
onContentSizeChange: handleContentSizeChange,
|
|
9480
9401
|
contentContainerStyle: [
|
|
9481
9402
|
{
|
|
9482
9403
|
gap,
|
|
@@ -9499,7 +9420,7 @@ var StyledFooter = styled50(View)(({ footerPaddingTop, footerPaddingHorizontal,
|
|
|
9499
9420
|
paddingHorizontal: footerPaddingHorizontal,
|
|
9500
9421
|
paddingBottom: footerPaddingBottom
|
|
9501
9422
|
}));
|
|
9502
|
-
var DrawerFooter =
|
|
9423
|
+
var DrawerFooter = React65.forwardRef(
|
|
9503
9424
|
(_a, ref) => {
|
|
9504
9425
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
9505
9426
|
const theme2 = useTheme();
|
|
@@ -9521,7 +9442,7 @@ var DrawerFooter = React66.forwardRef(
|
|
|
9521
9442
|
}
|
|
9522
9443
|
);
|
|
9523
9444
|
DrawerFooter.displayName = "Drawer.Footer";
|
|
9524
|
-
var DrawerRoot =
|
|
9445
|
+
var DrawerRoot = React65.forwardRef(
|
|
9525
9446
|
(_a, ref) => {
|
|
9526
9447
|
var _b = _a, {
|
|
9527
9448
|
open: controlledOpen,
|
|
@@ -9562,15 +9483,15 @@ var DrawerRoot = React66.forwardRef(
|
|
|
9562
9483
|
}
|
|
9563
9484
|
);
|
|
9564
9485
|
DrawerRoot.displayName = "Drawer";
|
|
9565
|
-
var DrawerTrigger =
|
|
9486
|
+
var DrawerTrigger = React65.forwardRef(
|
|
9566
9487
|
({ children }, ref) => {
|
|
9567
|
-
const { openDrawer } =
|
|
9488
|
+
const { openDrawer } = React65.useContext(DrawerContext);
|
|
9568
9489
|
return /* @__PURE__ */ jsx(Slot, { ref, onPress: openDrawer, children });
|
|
9569
9490
|
}
|
|
9570
9491
|
);
|
|
9571
9492
|
DrawerTrigger.displayName = "Drawer.Trigger";
|
|
9572
9493
|
var DrawerPortal = ({ children, topContent }) => {
|
|
9573
|
-
const { modalVisible, closeDrawer } =
|
|
9494
|
+
const { modalVisible, closeDrawer } = React65.useContext(DrawerContext);
|
|
9574
9495
|
if (!modalVisible) return null;
|
|
9575
9496
|
return /* @__PURE__ */ jsx(
|
|
9576
9497
|
Modal,
|
|
@@ -9641,7 +9562,7 @@ var StyledButtonGroup = styled50(View)(({ groupDirection, groupAlign, groupJusti
|
|
|
9641
9562
|
gap: groupGap,
|
|
9642
9563
|
width: "100%"
|
|
9643
9564
|
}, groupDirection === "column" ? { maxWidth: 520 } : {}));
|
|
9644
|
-
var ButtonDock =
|
|
9565
|
+
var ButtonDock = React65.forwardRef(
|
|
9645
9566
|
(_a, ref) => {
|
|
9646
9567
|
var _b = _a, { variant = "stacked", leadingContent, description, children } = _b, rest = __objRest(_b, ["variant", "leadingContent", "description", "children"]);
|
|
9647
9568
|
const theme2 = useTheme();
|
|
@@ -9721,7 +9642,7 @@ var StyledButtonRow = styled50(View)(({ rowDirection, rowAlign, rowGap }) => __s
|
|
|
9721
9642
|
var StyledChildSlot = styled50(View)(
|
|
9722
9643
|
({ slotInline }) => __spreadValues({}, slotInline ? { flex: 1, minWidth: 0 } : { width: "100%", alignSelf: "stretch" })
|
|
9723
9644
|
);
|
|
9724
|
-
var ButtonGroup =
|
|
9645
|
+
var ButtonGroup = React65.forwardRef(
|
|
9725
9646
|
(_a, ref) => {
|
|
9726
9647
|
var _b = _a, { layout = "stacked", description, children } = _b, rest = __objRest(_b, ["layout", "description", "children"]);
|
|
9727
9648
|
const theme2 = useTheme();
|
|
@@ -9743,9 +9664,9 @@ var ButtonGroup = React66.forwardRef(
|
|
|
9743
9664
|
rowGap: parseTokenValue29(
|
|
9744
9665
|
isInline ? buttonGroup.spacing.sideBySide.gap : buttonGroup.spacing.stacked.gap
|
|
9745
9666
|
),
|
|
9746
|
-
children:
|
|
9747
|
-
if (!
|
|
9748
|
-
return /* @__PURE__ */ jsx(StyledChildSlot, { slotInline: isInline, children:
|
|
9667
|
+
children: React65.Children.map(children, (child, index) => {
|
|
9668
|
+
if (!React65.isValidElement(child)) return child;
|
|
9669
|
+
return /* @__PURE__ */ jsx(StyledChildSlot, { slotInline: isInline, children: React65.cloneElement(
|
|
9749
9670
|
child,
|
|
9750
9671
|
{
|
|
9751
9672
|
fullWidth: true
|
|
@@ -9820,7 +9741,7 @@ var StyledIllustration = styled50(View)(({ illustrationSize }) => ({
|
|
|
9820
9741
|
height: illustrationSize,
|
|
9821
9742
|
overflow: "hidden"
|
|
9822
9743
|
}));
|
|
9823
|
-
var Checkbox =
|
|
9744
|
+
var Checkbox = React65.forwardRef(
|
|
9824
9745
|
(_a, ref) => {
|
|
9825
9746
|
var _b = _a, {
|
|
9826
9747
|
variant = "standalone",
|
|
@@ -9847,7 +9768,7 @@ var Checkbox = React66.forwardRef(
|
|
|
9847
9768
|
const { checkbox } = theme2.tokens.components;
|
|
9848
9769
|
const { dimensions: dimensions3 } = theme2.tokens.semantics;
|
|
9849
9770
|
const isControlled = controlledChecked !== void 0;
|
|
9850
|
-
const [internalChecked, setInternalChecked] =
|
|
9771
|
+
const [internalChecked, setInternalChecked] = React65.useState(defaultChecked);
|
|
9851
9772
|
const isChecked = isControlled ? controlledChecked : internalChecked;
|
|
9852
9773
|
const handleCheckedChange = (checked) => {
|
|
9853
9774
|
if (!isControlled) {
|
|
@@ -9942,7 +9863,7 @@ var StyledGroup = styled50(View)(({ groupDirection, groupGap }) => ({
|
|
|
9942
9863
|
flexDirection: groupDirection,
|
|
9943
9864
|
gap: groupGap
|
|
9944
9865
|
}));
|
|
9945
|
-
var CheckboxGroup =
|
|
9866
|
+
var CheckboxGroup = React65.forwardRef(
|
|
9946
9867
|
(_a, ref) => {
|
|
9947
9868
|
var _b = _a, { orientation = "vertical", children } = _b, rest = __objRest(_b, ["orientation", "children"]);
|
|
9948
9869
|
const theme2 = useTheme();
|
|
@@ -9960,7 +9881,7 @@ var CheckboxGroup = React66.forwardRef(
|
|
|
9960
9881
|
}
|
|
9961
9882
|
);
|
|
9962
9883
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
9963
|
-
var CopyFieldInput =
|
|
9884
|
+
var CopyFieldInput = React65.forwardRef(
|
|
9964
9885
|
(_a, ref) => {
|
|
9965
9886
|
var _b = _a, {
|
|
9966
9887
|
onCopy,
|
|
@@ -9979,19 +9900,19 @@ var CopyFieldInput = React66.forwardRef(
|
|
|
9979
9900
|
"editable",
|
|
9980
9901
|
"defaultValue"
|
|
9981
9902
|
]);
|
|
9982
|
-
const [internalValue, setInternalValue] =
|
|
9903
|
+
const [internalValue, setInternalValue] = React65.useState(
|
|
9983
9904
|
typeof defaultValue === "string" ? defaultValue : ""
|
|
9984
9905
|
);
|
|
9985
|
-
const [copied, setCopied] =
|
|
9986
|
-
const timeoutRef =
|
|
9906
|
+
const [copied, setCopied] = React65.useState(false);
|
|
9907
|
+
const timeoutRef = React65.useRef(
|
|
9987
9908
|
void 0
|
|
9988
9909
|
);
|
|
9989
|
-
|
|
9910
|
+
React65.useEffect(() => {
|
|
9990
9911
|
if (defaultValue !== void 0 && value === void 0) {
|
|
9991
9912
|
setInternalValue(typeof defaultValue === "string" ? defaultValue : "");
|
|
9992
9913
|
}
|
|
9993
9914
|
}, [defaultValue, value]);
|
|
9994
|
-
|
|
9915
|
+
React65.useEffect(() => {
|
|
9995
9916
|
return () => {
|
|
9996
9917
|
if (timeoutRef.current) {
|
|
9997
9918
|
clearTimeout(timeoutRef.current);
|
|
@@ -10058,7 +9979,7 @@ var StyledRoot8 = styled50(View)(({ theme: theme2 }) => {
|
|
|
10058
9979
|
gap: parseTokenValue32(spacing.gap)
|
|
10059
9980
|
};
|
|
10060
9981
|
});
|
|
10061
|
-
var CopyFieldRoot =
|
|
9982
|
+
var CopyFieldRoot = React65.forwardRef(
|
|
10062
9983
|
(_a, ref) => {
|
|
10063
9984
|
var _b = _a, {
|
|
10064
9985
|
label,
|
|
@@ -10126,7 +10047,7 @@ var useCopyField = (options = {}) => {
|
|
|
10126
10047
|
onCopy: handleCopy
|
|
10127
10048
|
};
|
|
10128
10049
|
};
|
|
10129
|
-
var FilterTabContext =
|
|
10050
|
+
var FilterTabContext = React65.createContext({
|
|
10130
10051
|
size: "sm",
|
|
10131
10052
|
selectedValues: [],
|
|
10132
10053
|
toggle: () => {
|
|
@@ -10165,7 +10086,7 @@ var StyledItem2 = styled50(Pressable)(
|
|
|
10165
10086
|
flexShrink: 0
|
|
10166
10087
|
})
|
|
10167
10088
|
);
|
|
10168
|
-
var FilterTabItem =
|
|
10089
|
+
var FilterTabItem = React65.forwardRef(
|
|
10169
10090
|
(_a, ref) => {
|
|
10170
10091
|
var _b = _a, {
|
|
10171
10092
|
value,
|
|
@@ -10185,7 +10106,7 @@ var FilterTabItem = React66.forwardRef(
|
|
|
10185
10106
|
"accessibilityLabel"
|
|
10186
10107
|
]);
|
|
10187
10108
|
const theme2 = useTheme();
|
|
10188
|
-
const { size, selectedValues, toggle } =
|
|
10109
|
+
const { size, selectedValues, toggle } = React65.useContext(FilterTabContext);
|
|
10189
10110
|
const isSelected = selectedValues.includes(value);
|
|
10190
10111
|
const isIconOnly = !!IconOnlyIcon && !label;
|
|
10191
10112
|
const isActive = isSelected && !disabled;
|
|
@@ -10259,7 +10180,7 @@ var FilterTabItem = React66.forwardRef(
|
|
|
10259
10180
|
}
|
|
10260
10181
|
);
|
|
10261
10182
|
FilterTabItem.displayName = "FilterTab.Item";
|
|
10262
|
-
var FilterTabRoot =
|
|
10183
|
+
var FilterTabRoot = React65.forwardRef(
|
|
10263
10184
|
(_a, ref) => {
|
|
10264
10185
|
var _b = _a, {
|
|
10265
10186
|
size = "sm",
|
|
@@ -10279,9 +10200,9 @@ var FilterTabRoot = React66.forwardRef(
|
|
|
10279
10200
|
const theme2 = useTheme();
|
|
10280
10201
|
const { filterTabs } = theme2.tokens.components;
|
|
10281
10202
|
const isControlled = controlledValue !== void 0;
|
|
10282
|
-
const [internalValue, setInternalValue] =
|
|
10203
|
+
const [internalValue, setInternalValue] = React65.useState(defaultValue);
|
|
10283
10204
|
const selectedValues = isControlled ? controlledValue : internalValue;
|
|
10284
|
-
const toggle =
|
|
10205
|
+
const toggle = React65.useCallback(
|
|
10285
10206
|
(itemValue) => {
|
|
10286
10207
|
let next;
|
|
10287
10208
|
if (multiple) {
|
|
@@ -10294,7 +10215,7 @@ var FilterTabRoot = React66.forwardRef(
|
|
|
10294
10215
|
},
|
|
10295
10216
|
[selectedValues, isControlled, onValueChange, multiple]
|
|
10296
10217
|
);
|
|
10297
|
-
const contextValue =
|
|
10218
|
+
const contextValue = React65.useMemo(
|
|
10298
10219
|
() => ({ size, selectedValues, toggle }),
|
|
10299
10220
|
[size, selectedValues, toggle]
|
|
10300
10221
|
);
|
|
@@ -10364,7 +10285,7 @@ var StyledRow = styled50(View)(({ rowGap }) => ({
|
|
|
10364
10285
|
alignItems: "center",
|
|
10365
10286
|
gap: rowGap
|
|
10366
10287
|
}));
|
|
10367
|
-
var NumberFieldInput =
|
|
10288
|
+
var NumberFieldInput = React65.forwardRef(
|
|
10368
10289
|
(_a, ref) => {
|
|
10369
10290
|
var _b = _a, {
|
|
10370
10291
|
fieldSize = "lg",
|
|
@@ -10411,9 +10332,9 @@ var NumberFieldInput = React66.forwardRef(
|
|
|
10411
10332
|
const theme2 = useTheme();
|
|
10412
10333
|
const tokens3 = theme2.tokens.components.numberField;
|
|
10413
10334
|
const inputTokens3 = theme2.tokens.components.inputs;
|
|
10414
|
-
const [isFocused, setIsFocused] =
|
|
10415
|
-
const [isEdited, setIsEdited] =
|
|
10416
|
-
const initialValueRef =
|
|
10335
|
+
const [isFocused, setIsFocused] = React65.useState(false);
|
|
10336
|
+
const [isEdited, setIsEdited] = React65.useState(false);
|
|
10337
|
+
const initialValueRef = React65.useRef((_a2 = value != null ? value : defaultValue) != null ? _a2 : "");
|
|
10417
10338
|
const isLarge = fieldSize === "lg";
|
|
10418
10339
|
const sizeTokens = isLarge ? tokens3.spacing.large : tokens3.spacing.small;
|
|
10419
10340
|
const buttonSize = isLarge ? "lg" : "sm";
|
|
@@ -10430,14 +10351,14 @@ var NumberFieldInput = React66.forwardRef(
|
|
|
10430
10351
|
if (isEdited) return tokens3.colour.field.border.edited;
|
|
10431
10352
|
return tokens3.colour.field.border.default;
|
|
10432
10353
|
};
|
|
10433
|
-
const handleFocus =
|
|
10354
|
+
const handleFocus = React65.useCallback(
|
|
10434
10355
|
(e) => {
|
|
10435
10356
|
setIsFocused(true);
|
|
10436
10357
|
onFocus == null ? void 0 : onFocus(e);
|
|
10437
10358
|
},
|
|
10438
10359
|
[onFocus]
|
|
10439
10360
|
);
|
|
10440
|
-
const handleBlur =
|
|
10361
|
+
const handleBlur = React65.useCallback(
|
|
10441
10362
|
(e) => {
|
|
10442
10363
|
setIsFocused(false);
|
|
10443
10364
|
if (value != null && onChangeText) {
|
|
@@ -10456,7 +10377,7 @@ var NumberFieldInput = React66.forwardRef(
|
|
|
10456
10377
|
const numericValue = value != null ? Number(value) : Number(defaultValue != null ? defaultValue : 0);
|
|
10457
10378
|
const isAtMin = min != null && numericValue <= min;
|
|
10458
10379
|
const isAtMax = max != null && numericValue >= max;
|
|
10459
|
-
const handleChangeText =
|
|
10380
|
+
const handleChangeText = React65.useCallback(
|
|
10460
10381
|
(text) => {
|
|
10461
10382
|
setIsEdited(text !== initialValueRef.current);
|
|
10462
10383
|
onChangeText == null ? void 0 : onChangeText(text);
|
|
@@ -10555,7 +10476,7 @@ var StyledRoot10 = styled50(View)(({ rootGap, fullWidth }) => __spreadValues({
|
|
|
10555
10476
|
var StyledLabelGroup = styled50(View)(({ labelGap }) => ({
|
|
10556
10477
|
gap: labelGap
|
|
10557
10478
|
}));
|
|
10558
|
-
var NumberField =
|
|
10479
|
+
var NumberField = React65.forwardRef(
|
|
10559
10480
|
(_a, ref) => {
|
|
10560
10481
|
var _b = _a, {
|
|
10561
10482
|
label,
|
|
@@ -10670,9 +10591,9 @@ var NumberField = React66.forwardRef(
|
|
|
10670
10591
|
);
|
|
10671
10592
|
NumberField.displayName = "NumberField";
|
|
10672
10593
|
var HIT_SLOP = 12;
|
|
10673
|
-
var PasswordFieldInput =
|
|
10594
|
+
var PasswordFieldInput = React65.forwardRef((_a, ref) => {
|
|
10674
10595
|
var _b = _a, { onValueChange, value, state, editable } = _b, inputFieldProps = __objRest(_b, ["onValueChange", "value", "state", "editable"]);
|
|
10675
|
-
const [showPassword, setShowPassword] =
|
|
10596
|
+
const [showPassword, setShowPassword] = React65.useState(false);
|
|
10676
10597
|
const handleValueChange = (newValue) => {
|
|
10677
10598
|
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
10678
10599
|
};
|
|
@@ -10717,7 +10638,7 @@ var StyledErrorRow2 = styled50(View)(({ gap }) => ({
|
|
|
10717
10638
|
alignItems: "center",
|
|
10718
10639
|
gap
|
|
10719
10640
|
}));
|
|
10720
|
-
var PasswordFieldError =
|
|
10641
|
+
var PasswordFieldError = React65.forwardRef((_a, ref) => {
|
|
10721
10642
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
10722
10643
|
const theme2 = useTheme();
|
|
10723
10644
|
const { listItem } = theme2.tokens.components.validationList;
|
|
@@ -10756,7 +10677,7 @@ var StyledRequirementItem = styled50(View)(
|
|
|
10756
10677
|
gap: itemGap
|
|
10757
10678
|
})
|
|
10758
10679
|
);
|
|
10759
|
-
var PasswordFieldRequirements =
|
|
10680
|
+
var PasswordFieldRequirements = React65.forwardRef((_a, ref) => {
|
|
10760
10681
|
var _b = _a, { requirements } = _b, rest = __objRest(_b, ["requirements"]);
|
|
10761
10682
|
const theme2 = useTheme();
|
|
10762
10683
|
const { listItem, list } = theme2.tokens.components.validationList;
|
|
@@ -10812,7 +10733,7 @@ var StyledRoot11 = styled50(View)(({ theme: theme2 }) => {
|
|
|
10812
10733
|
gap: parseTokenValue38(spacing.gap)
|
|
10813
10734
|
};
|
|
10814
10735
|
});
|
|
10815
|
-
var PasswordFieldRoot =
|
|
10736
|
+
var PasswordFieldRoot = React65.forwardRef(
|
|
10816
10737
|
(_a, ref) => {
|
|
10817
10738
|
var _b = _a, {
|
|
10818
10739
|
label,
|
|
@@ -10947,7 +10868,7 @@ var StyledIndicator = styled50(View)(({ indicatorBorderRadius, indicatorBgColor
|
|
|
10947
10868
|
backgroundColor: indicatorBgColor
|
|
10948
10869
|
}));
|
|
10949
10870
|
var clamp = (value, min, max) => Math.max(min, Math.min(max, value));
|
|
10950
|
-
var Progress =
|
|
10871
|
+
var Progress = React65.forwardRef(
|
|
10951
10872
|
(_a, ref) => {
|
|
10952
10873
|
var _b = _a, {
|
|
10953
10874
|
value = 0,
|
|
@@ -11090,7 +11011,7 @@ var StyledTagWrapper = styled50(View)(
|
|
|
11090
11011
|
paddingTop: tagTopPadding
|
|
11091
11012
|
})
|
|
11092
11013
|
);
|
|
11093
|
-
var Radio =
|
|
11014
|
+
var Radio = React65.forwardRef(
|
|
11094
11015
|
(_a, ref) => {
|
|
11095
11016
|
var _b = _a, {
|
|
11096
11017
|
variant = "standalone",
|
|
@@ -11194,7 +11115,7 @@ var Radio = React66.forwardRef(
|
|
|
11194
11115
|
}
|
|
11195
11116
|
);
|
|
11196
11117
|
Radio.displayName = "Radio";
|
|
11197
|
-
var RadioTile =
|
|
11118
|
+
var RadioTile = React65.forwardRef(
|
|
11198
11119
|
(props, ref) => /* @__PURE__ */ jsx(Radio, __spreadProps(__spreadValues({ ref }, props), { variant: "tile" }))
|
|
11199
11120
|
);
|
|
11200
11121
|
RadioTile.displayName = "RadioTile";
|
|
@@ -11203,7 +11124,7 @@ var StyledRadioGroup = styled50(View)(({ groupDirection, groupGap }) => ({
|
|
|
11203
11124
|
flexDirection: groupDirection,
|
|
11204
11125
|
gap: groupGap
|
|
11205
11126
|
}));
|
|
11206
|
-
var RadioGroupRoot =
|
|
11127
|
+
var RadioGroupRoot = React65.forwardRef(
|
|
11207
11128
|
(_a, ref) => {
|
|
11208
11129
|
var _b = _a, {
|
|
11209
11130
|
name: _name,
|
|
@@ -11230,11 +11151,11 @@ var RadioGroupRoot = React66.forwardRef(
|
|
|
11230
11151
|
const optionsFirstValue = (_a2 = options == null ? void 0 : options[0]) == null ? void 0 : _a2.value;
|
|
11231
11152
|
const derivedDefaultValue = defaultValue != null ? defaultValue : optionsFirstValue;
|
|
11232
11153
|
const isControlled = value !== void 0;
|
|
11233
|
-
const [internalValue, setInternalValue] =
|
|
11154
|
+
const [internalValue, setInternalValue] = React65.useState(
|
|
11234
11155
|
derivedDefaultValue != null ? derivedDefaultValue : ""
|
|
11235
11156
|
);
|
|
11236
11157
|
const currentValue = isControlled ? value : internalValue;
|
|
11237
|
-
const handleSelect =
|
|
11158
|
+
const handleSelect = React65.useCallback(
|
|
11238
11159
|
(newValue) => {
|
|
11239
11160
|
if (!isControlled) {
|
|
11240
11161
|
setInternalValue(newValue);
|
|
@@ -11255,9 +11176,9 @@ var RadioGroupRoot = React66.forwardRef(
|
|
|
11255
11176
|
option.value
|
|
11256
11177
|
));
|
|
11257
11178
|
}
|
|
11258
|
-
return
|
|
11259
|
-
if (!
|
|
11260
|
-
return
|
|
11179
|
+
return React65.Children.map(children, (child) => {
|
|
11180
|
+
if (!React65.isValidElement(child)) return child;
|
|
11181
|
+
return React65.cloneElement(child, {
|
|
11261
11182
|
selected: currentValue === child.props.value,
|
|
11262
11183
|
onSelect: handleSelect,
|
|
11263
11184
|
disabled: disabled || child.props.disabled
|
|
@@ -11282,11 +11203,11 @@ var RadioGroup = Object.assign(RadioGroupRoot, {
|
|
|
11282
11203
|
Radio,
|
|
11283
11204
|
Tile: RadioTile
|
|
11284
11205
|
});
|
|
11285
|
-
var SearchFieldInput =
|
|
11206
|
+
var SearchFieldInput = React65.forwardRef((_a, ref) => {
|
|
11286
11207
|
var _b = _a, { onClear, onValueChange, value, state } = _b, inputFieldProps = __objRest(_b, ["onClear", "onValueChange", "value", "state"]);
|
|
11287
|
-
const [internalValue, setInternalValue] =
|
|
11288
|
-
const inputRef =
|
|
11289
|
-
|
|
11208
|
+
const [internalValue, setInternalValue] = React65.useState("");
|
|
11209
|
+
const inputRef = React65.useRef(null);
|
|
11210
|
+
React65.useImperativeHandle(ref, () => inputRef.current);
|
|
11290
11211
|
const handleValueChange = (newValue) => {
|
|
11291
11212
|
setInternalValue(newValue);
|
|
11292
11213
|
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
@@ -11332,7 +11253,7 @@ var StyledRoot13 = styled50(View)(({ theme: theme2 }) => {
|
|
|
11332
11253
|
gap: parseTokenValue42(spacing.gap)
|
|
11333
11254
|
};
|
|
11334
11255
|
});
|
|
11335
|
-
var SearchFieldRoot =
|
|
11256
|
+
var SearchFieldRoot = React65.forwardRef(
|
|
11336
11257
|
(_a, ref) => {
|
|
11337
11258
|
var _b = _a, {
|
|
11338
11259
|
label,
|
|
@@ -11462,7 +11383,7 @@ var ScrollIndicatorGradient = ({
|
|
|
11462
11383
|
side,
|
|
11463
11384
|
color
|
|
11464
11385
|
}) => {
|
|
11465
|
-
const uid =
|
|
11386
|
+
const uid = React65.useId();
|
|
11466
11387
|
const gradientId = `sc-scroll-indicator-${side}-${uid}`;
|
|
11467
11388
|
const isTrailing = side === "trailing";
|
|
11468
11389
|
return /* @__PURE__ */ jsx(View, { style: StyleSheet.absoluteFill, pointerEvents: "none", children: /* @__PURE__ */ jsxs(Svg, { width: "100%", height: "100%", preserveAspectRatio: "none", children: [
|
|
@@ -11545,7 +11466,7 @@ var SegmentedControlItemBase = ({
|
|
|
11545
11466
|
}
|
|
11546
11467
|
);
|
|
11547
11468
|
};
|
|
11548
|
-
var SegmentedControlItem =
|
|
11469
|
+
var SegmentedControlItem = React65.forwardRef(
|
|
11549
11470
|
(_props, _ref) => {
|
|
11550
11471
|
return null;
|
|
11551
11472
|
}
|
|
@@ -11561,10 +11482,10 @@ var IntrinsicTrack = (_a) => {
|
|
|
11561
11482
|
"renderItems",
|
|
11562
11483
|
"forwardedRef"
|
|
11563
11484
|
]);
|
|
11564
|
-
const scrollRef =
|
|
11565
|
-
const [containerWidth, setContainerWidth] =
|
|
11566
|
-
const [contentWidth, setContentWidth] =
|
|
11567
|
-
const [scrollX, setScrollX] =
|
|
11485
|
+
const scrollRef = React65.useRef(null);
|
|
11486
|
+
const [containerWidth, setContainerWidth] = React65.useState(0);
|
|
11487
|
+
const [contentWidth, setContentWidth] = React65.useState(0);
|
|
11488
|
+
const [scrollX, setScrollX] = React65.useState(0);
|
|
11568
11489
|
const epsilon = 2;
|
|
11569
11490
|
const maxScroll = Math.max(0, contentWidth - containerWidth);
|
|
11570
11491
|
const canScrollLeft = scrollX > epsilon;
|
|
@@ -11660,7 +11581,7 @@ var IntrinsicTrack = (_a) => {
|
|
|
11660
11581
|
})
|
|
11661
11582
|
);
|
|
11662
11583
|
};
|
|
11663
|
-
var SegmentedControlRoot =
|
|
11584
|
+
var SegmentedControlRoot = React65.forwardRef(
|
|
11664
11585
|
(_a, ref) => {
|
|
11665
11586
|
var _b = _a, {
|
|
11666
11587
|
options,
|
|
@@ -11684,18 +11605,18 @@ var SegmentedControlRoot = React66.forwardRef(
|
|
|
11684
11605
|
const { spacing, borderRadius, colour } = theme2.tokens.components.segmentedControl;
|
|
11685
11606
|
const { dimensions: dimensions3 } = theme2.tokens.semantics;
|
|
11686
11607
|
const optionsFirstValue = (_a2 = options == null ? void 0 : options[0]) == null ? void 0 : _a2.value;
|
|
11687
|
-
const childrenArray =
|
|
11608
|
+
const childrenArray = React65.Children.toArray(children);
|
|
11688
11609
|
const firstChildValue = childrenArray.map((child) => {
|
|
11689
|
-
if (!
|
|
11610
|
+
if (!React65.isValidElement(child)) return void 0;
|
|
11690
11611
|
return child.props.value;
|
|
11691
11612
|
}).find((v) => typeof v === "string");
|
|
11692
11613
|
const derivedDefaultValue = (_b2 = defaultValue != null ? defaultValue : optionsFirstValue) != null ? _b2 : firstChildValue;
|
|
11693
11614
|
const isControlled = typeof value === "string";
|
|
11694
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
11615
|
+
const [uncontrolledValue, setUncontrolledValue] = React65.useState(
|
|
11695
11616
|
() => derivedDefaultValue != null ? derivedDefaultValue : ""
|
|
11696
11617
|
);
|
|
11697
11618
|
const currentValue = isControlled ? value : uncontrolledValue;
|
|
11698
|
-
const handleSelect =
|
|
11619
|
+
const handleSelect = React65.useCallback(
|
|
11699
11620
|
(newValue) => {
|
|
11700
11621
|
if (!isControlled) {
|
|
11701
11622
|
setUncontrolledValue(newValue);
|
|
@@ -11721,7 +11642,7 @@ var SegmentedControlRoot = React66.forwardRef(
|
|
|
11721
11642
|
));
|
|
11722
11643
|
}
|
|
11723
11644
|
return childrenArray.map((child) => {
|
|
11724
|
-
if (!
|
|
11645
|
+
if (!React65.isValidElement(child)) return child;
|
|
11725
11646
|
const childProps = child.props;
|
|
11726
11647
|
return /* @__PURE__ */ jsx(
|
|
11727
11648
|
SegmentedControlItemBase,
|
|
@@ -11792,7 +11713,7 @@ var StyledArrowIcon = styled50(Animated.View)({
|
|
|
11792
11713
|
alignItems: "center",
|
|
11793
11714
|
justifyContent: "center"
|
|
11794
11715
|
});
|
|
11795
|
-
var SelectFieldTrigger =
|
|
11716
|
+
var SelectFieldTrigger = React65.forwardRef(
|
|
11796
11717
|
(_a, ref) => {
|
|
11797
11718
|
var _b = _a, {
|
|
11798
11719
|
state = "default",
|
|
@@ -11891,7 +11812,7 @@ var SelectFieldTrigger = React66.forwardRef(
|
|
|
11891
11812
|
}
|
|
11892
11813
|
);
|
|
11893
11814
|
SelectFieldTrigger.displayName = "SelectField.Trigger";
|
|
11894
|
-
var SelectFieldValue =
|
|
11815
|
+
var SelectFieldValue = React65.forwardRef(
|
|
11895
11816
|
(_a, ref) => {
|
|
11896
11817
|
var _b = _a, { placeholder } = _b, rest = __objRest(_b, ["placeholder"]);
|
|
11897
11818
|
const theme2 = useTheme();
|
|
@@ -11935,7 +11856,7 @@ var StyledContentInner = styled50(View)(({ theme: theme2 }) => {
|
|
|
11935
11856
|
overflow: "hidden"
|
|
11936
11857
|
};
|
|
11937
11858
|
});
|
|
11938
|
-
var SelectFieldContent =
|
|
11859
|
+
var SelectFieldContent = React65.forwardRef((_a, ref) => {
|
|
11939
11860
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
11940
11861
|
const theme2 = useTheme();
|
|
11941
11862
|
const { spacing } = theme2.tokens.components.inputs;
|
|
@@ -12010,7 +11931,7 @@ var StyledHintText = styled50(Text)(({ theme: theme2 }) => {
|
|
|
12010
11931
|
flexShrink: 0
|
|
12011
11932
|
};
|
|
12012
11933
|
});
|
|
12013
|
-
var SelectFieldItem =
|
|
11934
|
+
var SelectFieldItem = React65.forwardRef(
|
|
12014
11935
|
(_a, ref) => {
|
|
12015
11936
|
var _b = _a, { value, leadingIcon, hintText, children, disabled, isSelected } = _b, rest = __objRest(_b, ["value", "leadingIcon", "hintText", "children", "disabled", "isSelected"]);
|
|
12016
11937
|
const theme2 = useTheme();
|
|
@@ -12062,7 +11983,7 @@ var StyledRoot14 = styled50(View)(({ theme: theme2 }) => {
|
|
|
12062
11983
|
gap: parseTokenValue47(spacing.gap)
|
|
12063
11984
|
};
|
|
12064
11985
|
});
|
|
12065
|
-
var SelectFieldRoot =
|
|
11986
|
+
var SelectFieldRoot = React65.forwardRef(
|
|
12066
11987
|
(_a, ref) => {
|
|
12067
11988
|
var _b = _a, {
|
|
12068
11989
|
label,
|
|
@@ -12097,15 +12018,15 @@ var SelectFieldRoot = React66.forwardRef(
|
|
|
12097
12018
|
"searchPlaceholder",
|
|
12098
12019
|
"noResultsText"
|
|
12099
12020
|
]);
|
|
12100
|
-
const [isOpen, setIsOpen] =
|
|
12101
|
-
const [showContent, setShowContent] =
|
|
12102
|
-
const [internalValue, setInternalValue] =
|
|
12021
|
+
const [isOpen, setIsOpen] = React65.useState(false);
|
|
12022
|
+
const [showContent, setShowContent] = React65.useState(false);
|
|
12023
|
+
const [internalValue, setInternalValue] = React65.useState(
|
|
12103
12024
|
defaultValue != null ? defaultValue : null
|
|
12104
12025
|
);
|
|
12105
|
-
const [searchQuery, setSearchQuery] =
|
|
12106
|
-
const [clearKey, setClearKey] =
|
|
12107
|
-
const searchInputRef =
|
|
12108
|
-
|
|
12026
|
+
const [searchQuery, setSearchQuery] = React65.useState("");
|
|
12027
|
+
const [clearKey, setClearKey] = React65.useState(0);
|
|
12028
|
+
const searchInputRef = React65.useRef(null);
|
|
12029
|
+
React65.useEffect(() => {
|
|
12109
12030
|
if (!isOpen) {
|
|
12110
12031
|
setShowContent(false);
|
|
12111
12032
|
return;
|
|
@@ -12138,8 +12059,8 @@ var SelectFieldRoot = React66.forwardRef(
|
|
|
12138
12059
|
keyboardSub.remove();
|
|
12139
12060
|
};
|
|
12140
12061
|
}, [isOpen, searchable]);
|
|
12141
|
-
const isCompound =
|
|
12142
|
-
(child) =>
|
|
12062
|
+
const isCompound = React65.Children.toArray(children).some(
|
|
12063
|
+
(child) => React65.isValidElement(child) && child.type === SelectFieldContent
|
|
12143
12064
|
);
|
|
12144
12065
|
if (isCompound) {
|
|
12145
12066
|
return /* @__PURE__ */ jsx(StyledRoot14, __spreadProps(__spreadValues({ ref }, rest), { children }));
|
|
@@ -12154,11 +12075,11 @@ var SelectFieldRoot = React66.forwardRef(
|
|
|
12154
12075
|
if (!open) setSearchQuery("");
|
|
12155
12076
|
};
|
|
12156
12077
|
const currentValue = value !== void 0 ? value : internalValue;
|
|
12157
|
-
const allItems =
|
|
12078
|
+
const allItems = React65.Children.toArray(children);
|
|
12158
12079
|
const filteredItems = searchable ? allItems.filter((child) => {
|
|
12159
12080
|
var _a2;
|
|
12160
12081
|
if (!searchQuery) return true;
|
|
12161
|
-
if (
|
|
12082
|
+
if (React65.isValidElement(child) && child.type === SelectFieldItem) {
|
|
12162
12083
|
const label2 = String(
|
|
12163
12084
|
(_a2 = child.props.children) != null ? _a2 : ""
|
|
12164
12085
|
);
|
|
@@ -12227,10 +12148,10 @@ var SelectFieldRoot = React66.forwardRef(
|
|
|
12227
12148
|
] })),
|
|
12228
12149
|
showContent && /* @__PURE__ */ jsxs(SelectFieldContent, { children: [
|
|
12229
12150
|
filteredItems.map((child) => {
|
|
12230
|
-
if (
|
|
12151
|
+
if (React65.isValidElement(child) && child.type === SelectFieldItem) {
|
|
12231
12152
|
const selectedValue = currentValue && typeof currentValue === "object" && "value" in currentValue ? currentValue.value : currentValue;
|
|
12232
12153
|
const childProps = child.props;
|
|
12233
|
-
return
|
|
12154
|
+
return React65.cloneElement(
|
|
12234
12155
|
child,
|
|
12235
12156
|
{
|
|
12236
12157
|
isSelected: childProps.value === selectedValue
|
|
@@ -12397,7 +12318,7 @@ var useIconAnimation = () => {
|
|
|
12397
12318
|
iconAnimationStyles
|
|
12398
12319
|
};
|
|
12399
12320
|
};
|
|
12400
|
-
var NativeSelectPicker =
|
|
12321
|
+
var NativeSelectPicker = React65.forwardRef(
|
|
12401
12322
|
(_a, ref) => {
|
|
12402
12323
|
var _b = _a, {
|
|
12403
12324
|
items,
|
|
@@ -12556,7 +12477,7 @@ var StyledLabelSlot = styled50(View)(({ labelSlotGap }) => ({
|
|
|
12556
12477
|
gap: labelSlotGap,
|
|
12557
12478
|
flexShrink: 0
|
|
12558
12479
|
}));
|
|
12559
|
-
var Slider =
|
|
12480
|
+
var Slider = React65.forwardRef(
|
|
12560
12481
|
(_a, ref) => {
|
|
12561
12482
|
var _b = _a, {
|
|
12562
12483
|
value: controlledValue,
|
|
@@ -12591,7 +12512,7 @@ var Slider = React66.forwardRef(
|
|
|
12591
12512
|
const { slider, buttons } = theme2.tokens.components;
|
|
12592
12513
|
const { dimensions: dimensions3 } = theme2.tokens.semantics;
|
|
12593
12514
|
const isControlled = controlledValue !== void 0;
|
|
12594
|
-
const [internalValue, setInternalValue] =
|
|
12515
|
+
const [internalValue, setInternalValue] = React65.useState(defaultValue);
|
|
12595
12516
|
const currentValue = isControlled ? controlledValue : internalValue;
|
|
12596
12517
|
const thumbSize = parseTokenValue48(buttons.size.md.height);
|
|
12597
12518
|
const trackHeight = parseTokenValue48(slider.sizing.track.height);
|
|
@@ -12974,7 +12895,7 @@ var StyledCloseButton = styled50(Pressable)({
|
|
|
12974
12895
|
flexShrink: 0,
|
|
12975
12896
|
padding: 0
|
|
12976
12897
|
});
|
|
12977
|
-
var Notification =
|
|
12898
|
+
var Notification = React65.forwardRef(
|
|
12978
12899
|
(props, ref) => {
|
|
12979
12900
|
const _a = props, {
|
|
12980
12901
|
variant = "inline",
|
|
@@ -13318,7 +13239,7 @@ function NibTriangle({
|
|
|
13318
13239
|
}
|
|
13319
13240
|
);
|
|
13320
13241
|
}
|
|
13321
|
-
var Tooltip =
|
|
13242
|
+
var Tooltip = React65.forwardRef(
|
|
13322
13243
|
(_a, ref) => {
|
|
13323
13244
|
var _b = _a, { text, alignment = "middle", position = "bottom", children } = _b, props = __objRest(_b, ["text", "alignment", "position", "children"]);
|
|
13324
13245
|
const theme2 = useTheme();
|
|
@@ -13406,8 +13327,8 @@ var Tooltip = React66.forwardRef(
|
|
|
13406
13327
|
return bubble;
|
|
13407
13328
|
}
|
|
13408
13329
|
if (Platform.OS === "web") {
|
|
13409
|
-
const child =
|
|
13410
|
-
const trigger = child ?
|
|
13330
|
+
const child = React65.isValidElement(children) ? children : null;
|
|
13331
|
+
const trigger = child ? React65.cloneElement(child, {
|
|
13411
13332
|
onPress: () => {
|
|
13412
13333
|
var _a2, _b2;
|
|
13413
13334
|
(_b2 = (_a2 = child.props).onPress) == null ? void 0 : _b2.call(_a2);
|
|
@@ -13484,7 +13405,7 @@ var StyledInsightContent = styled50(View)(
|
|
|
13484
13405
|
gap: contentGap
|
|
13485
13406
|
})
|
|
13486
13407
|
);
|
|
13487
|
-
var MessageCardInsight =
|
|
13408
|
+
var MessageCardInsight = React65.forwardRef(
|
|
13488
13409
|
(_a, ref) => {
|
|
13489
13410
|
var _b = _a, { variant = "standalone", icon, illustration, title, children } = _b, rest = __objRest(_b, ["variant", "icon", "illustration", "title", "children"]);
|
|
13490
13411
|
const theme2 = useTheme();
|
|
@@ -13595,7 +13516,7 @@ var StyledBannerCopy = styled50(View)(({ copyGap }) => ({
|
|
|
13595
13516
|
gap: copyGap,
|
|
13596
13517
|
width: "100%"
|
|
13597
13518
|
}));
|
|
13598
|
-
var MessageCardBanner =
|
|
13519
|
+
var MessageCardBanner = React65.forwardRef(
|
|
13599
13520
|
(_a, ref) => {
|
|
13600
13521
|
var _b = _a, {
|
|
13601
13522
|
colourScheme = "primary",
|
|
@@ -13629,7 +13550,7 @@ var MessageCardBanner = React66.forwardRef(
|
|
|
13629
13550
|
accessibilityRole: "summary"
|
|
13630
13551
|
}, rest), {
|
|
13631
13552
|
children: [
|
|
13632
|
-
(media == null ? void 0 : media.type) === "illustration" ? /* @__PURE__ */ jsx(StyledBannerIllustrationSlot, { children:
|
|
13553
|
+
(media == null ? void 0 : media.type) === "illustration" ? /* @__PURE__ */ jsx(StyledBannerIllustrationSlot, { children: React65.createElement(media.illustration, {
|
|
13633
13554
|
width: 108,
|
|
13634
13555
|
height: 108
|
|
13635
13556
|
}) }) : (media == null ? void 0 : media.type) === "image" ? /* @__PURE__ */ jsx(
|
|
@@ -13789,7 +13710,7 @@ var StyledIndicator3 = styled50(View)(
|
|
|
13789
13710
|
justifyContent: "center"
|
|
13790
13711
|
})
|
|
13791
13712
|
);
|
|
13792
|
-
var DatePicker =
|
|
13713
|
+
var DatePicker = React65.forwardRef(
|
|
13793
13714
|
(_a, ref) => {
|
|
13794
13715
|
var _b = _a, {
|
|
13795
13716
|
year,
|
|
@@ -14189,7 +14110,7 @@ var StyledPointer = styled50(Svg)(
|
|
|
14189
14110
|
opacity: pointerVisible ? 1 : 0
|
|
14190
14111
|
})
|
|
14191
14112
|
);
|
|
14192
|
-
var PictureSelector =
|
|
14113
|
+
var PictureSelector = React65.forwardRef(
|
|
14193
14114
|
(_a, ref) => {
|
|
14194
14115
|
var _b = _a, {
|
|
14195
14116
|
label,
|
|
@@ -14216,7 +14137,7 @@ var PictureSelector = React66.forwardRef(
|
|
|
14216
14137
|
const { pictureSelector } = theme2.tokens.components;
|
|
14217
14138
|
const { pictureButton } = pictureSelector;
|
|
14218
14139
|
const isControlled = value !== void 0;
|
|
14219
|
-
const [internalValue, setInternalValue] =
|
|
14140
|
+
const [internalValue, setInternalValue] = React65.useState(defaultValue);
|
|
14220
14141
|
const selectedValue = isControlled ? value : internalValue;
|
|
14221
14142
|
const selectedItem = items.find((item) => item.value === selectedValue);
|
|
14222
14143
|
const hasInsight = Boolean(
|
|
@@ -14400,7 +14321,7 @@ var InlineCount = styled50(View)(({ countGap }) => ({
|
|
|
14400
14321
|
alignItems: "center",
|
|
14401
14322
|
gap: countGap
|
|
14402
14323
|
}));
|
|
14403
|
-
var Countdown =
|
|
14324
|
+
var Countdown = React65.forwardRef(
|
|
14404
14325
|
(_a, ref) => {
|
|
14405
14326
|
var _b = _a, {
|
|
14406
14327
|
layout = "stacked",
|
|
@@ -14479,7 +14400,7 @@ var Countdown = React66.forwardRef(
|
|
|
14479
14400
|
InlineGroup,
|
|
14480
14401
|
{
|
|
14481
14402
|
groupGap: parseTokenValue54(countdown.countdownGroup.spacing.gap),
|
|
14482
|
-
children: units.map((unit, index) => /* @__PURE__ */ jsxs(
|
|
14403
|
+
children: units.map((unit, index) => /* @__PURE__ */ jsxs(React65.Fragment, { children: [
|
|
14483
14404
|
index > 0 && colon(`colon-${unit.key}`),
|
|
14484
14405
|
/* @__PURE__ */ jsxs(
|
|
14485
14406
|
InlineCount,
|
|
@@ -14522,7 +14443,7 @@ var Countdown = React66.forwardRef(
|
|
|
14522
14443
|
ref,
|
|
14523
14444
|
rootGap: parseTokenValue54(countdown.spacing.gap)
|
|
14524
14445
|
}, rest), {
|
|
14525
|
-
children: units.map((unit, index) => /* @__PURE__ */ jsxs(
|
|
14446
|
+
children: units.map((unit, index) => /* @__PURE__ */ jsxs(React65.Fragment, { children: [
|
|
14526
14447
|
index > 0 && colon(`colon-${unit.key}`),
|
|
14527
14448
|
/* @__PURE__ */ jsxs(
|
|
14528
14449
|
StackedItem,
|
|
@@ -14610,7 +14531,7 @@ var BadgeIcon = styled50(View)(({ theme: theme2 }) => {
|
|
|
14610
14531
|
flexShrink: 0
|
|
14611
14532
|
};
|
|
14612
14533
|
});
|
|
14613
|
-
var Badge2 =
|
|
14534
|
+
var Badge2 = React65.forwardRef(
|
|
14614
14535
|
(_a, ref) => {
|
|
14615
14536
|
var _b = _a, { icon, text } = _b, rest = __objRest(_b, ["icon", "text"]);
|
|
14616
14537
|
return /* @__PURE__ */ jsxs(BadgeContainer, __spreadProps(__spreadValues({ ref }, rest), { children: [
|
|
@@ -14628,7 +14549,7 @@ var StyledGrid = styled50(View)(({ theme: theme2 }) => {
|
|
|
14628
14549
|
"grid-row-gap": spacing.xl
|
|
14629
14550
|
};
|
|
14630
14551
|
});
|
|
14631
|
-
var Grid =
|
|
14552
|
+
var Grid = React65.forwardRef(
|
|
14632
14553
|
(_a, ref) => {
|
|
14633
14554
|
var _b = _a, { children, xs = 1, md = 2, lg = 3 } = _b, rest = __objRest(_b, ["children", "xs", "md", "lg"]);
|
|
14634
14555
|
const { width } = useWindowDimensions();
|
|
@@ -14727,7 +14648,7 @@ var PricingContainer = styled50(View)(({ theme: theme2 }) => {
|
|
|
14727
14648
|
width: "100%"
|
|
14728
14649
|
};
|
|
14729
14650
|
});
|
|
14730
|
-
var _ProductListingCard =
|
|
14651
|
+
var _ProductListingCard = React65.forwardRef(
|
|
14731
14652
|
(_a, ref) => {
|
|
14732
14653
|
var _b = _a, {
|
|
14733
14654
|
image,
|
|
@@ -14769,7 +14690,7 @@ var _ProductListingCard = React66.forwardRef(
|
|
|
14769
14690
|
accessibilityLabel: imageAlt,
|
|
14770
14691
|
accessible: true
|
|
14771
14692
|
}
|
|
14772
|
-
) :
|
|
14693
|
+
) : React65.isValidElement(image) ? image : /* @__PURE__ */ jsx(
|
|
14773
14694
|
StyledImage2,
|
|
14774
14695
|
{
|
|
14775
14696
|
source: image,
|
|
@@ -14915,7 +14836,7 @@ var StyledNoneBanner = styled50(View)(({ theme: theme2 }) => {
|
|
|
14915
14836
|
borderBottomRightRadius: radiusMd
|
|
14916
14837
|
};
|
|
14917
14838
|
});
|
|
14918
|
-
var ProductDisplayCard =
|
|
14839
|
+
var ProductDisplayCard = React65.forwardRef(
|
|
14919
14840
|
(_a, ref) => {
|
|
14920
14841
|
var _b = _a, {
|
|
14921
14842
|
title,
|
|
@@ -15045,9 +14966,9 @@ var ProductDisplayCard = React66.forwardRef(
|
|
|
15045
14966
|
}
|
|
15046
14967
|
);
|
|
15047
14968
|
ProductDisplayCard.displayName = "ProductDisplayCard";
|
|
15048
|
-
var TabNavigationContext =
|
|
14969
|
+
var TabNavigationContext = React65.createContext(void 0);
|
|
15049
14970
|
var useTabNavigationContext = () => {
|
|
15050
|
-
const context =
|
|
14971
|
+
const context = React65.useContext(TabNavigationContext);
|
|
15051
14972
|
if (!context) {
|
|
15052
14973
|
throw new Error(
|
|
15053
14974
|
"TabNavigation.List, TabNavigation.Tab and TabNavigation.Panel must be used within a TabNavigation component."
|
|
@@ -15086,7 +15007,7 @@ var StyledTab = styled50(Pressable)(
|
|
|
15086
15007
|
borderBottomColor: tabBorderColor
|
|
15087
15008
|
}, tabFlex !== void 0 ? { flex: tabFlex } : { flexShrink: 0 })
|
|
15088
15009
|
);
|
|
15089
|
-
var TabNavigationList =
|
|
15010
|
+
var TabNavigationList = React65.forwardRef(
|
|
15090
15011
|
(_a, ref) => {
|
|
15091
15012
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
15092
15013
|
const { layout } = useTabNavigationContext();
|
|
@@ -15105,7 +15026,7 @@ var TabNavigationList = React66.forwardRef(
|
|
|
15105
15026
|
}
|
|
15106
15027
|
);
|
|
15107
15028
|
TabNavigationList.displayName = "TabNavigation.List";
|
|
15108
|
-
var TabNavigationTab =
|
|
15029
|
+
var TabNavigationTab = React65.forwardRef(
|
|
15109
15030
|
(_a, ref) => {
|
|
15110
15031
|
var _b = _a, { value, disabled = false, icon, avatar, children } = _b, rest = __objRest(_b, ["value", "disabled", "icon", "avatar", "children"]);
|
|
15111
15032
|
const { layout } = useTabNavigationContext();
|
|
@@ -15141,7 +15062,7 @@ var TabNavigationTab = React66.forwardRef(
|
|
|
15141
15062
|
}
|
|
15142
15063
|
);
|
|
15143
15064
|
TabNavigationTab.displayName = "TabNavigation.Tab";
|
|
15144
|
-
var TabNavigationPanel =
|
|
15065
|
+
var TabNavigationPanel = React65.forwardRef(
|
|
15145
15066
|
(_a, ref) => {
|
|
15146
15067
|
var _b = _a, { value, children } = _b, rest = __objRest(_b, ["value", "children"]);
|
|
15147
15068
|
const { animation } = useTabNavigationContext();
|
|
@@ -15149,7 +15070,7 @@ var TabNavigationPanel = React66.forwardRef(
|
|
|
15149
15070
|
}
|
|
15150
15071
|
);
|
|
15151
15072
|
TabNavigationPanel.displayName = "TabNavigation.Panel";
|
|
15152
|
-
var TabNavigationRoot =
|
|
15073
|
+
var TabNavigationRoot = React65.forwardRef(
|
|
15153
15074
|
(_a, ref) => {
|
|
15154
15075
|
var _b = _a, {
|
|
15155
15076
|
value,
|
|
@@ -15167,11 +15088,11 @@ var TabNavigationRoot = React66.forwardRef(
|
|
|
15167
15088
|
"children"
|
|
15168
15089
|
]);
|
|
15169
15090
|
const isControlled = typeof value === "string";
|
|
15170
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
15091
|
+
const [uncontrolledValue, setUncontrolledValue] = React65.useState(
|
|
15171
15092
|
() => defaultValue != null ? defaultValue : ""
|
|
15172
15093
|
);
|
|
15173
15094
|
const currentValue = isControlled ? value : uncontrolledValue;
|
|
15174
|
-
const handleValueChange =
|
|
15095
|
+
const handleValueChange = React65.useCallback(
|
|
15175
15096
|
(newValue) => {
|
|
15176
15097
|
if (!isControlled) {
|
|
15177
15098
|
setUncontrolledValue(newValue);
|
|
@@ -15180,7 +15101,7 @@ var TabNavigationRoot = React66.forwardRef(
|
|
|
15180
15101
|
},
|
|
15181
15102
|
[isControlled, onValueChange]
|
|
15182
15103
|
);
|
|
15183
|
-
const contextValue =
|
|
15104
|
+
const contextValue = React65.useMemo(
|
|
15184
15105
|
() => ({ layout, animation }),
|
|
15185
15106
|
[layout, animation]
|
|
15186
15107
|
);
|