@butternutbox/pawprint-native 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +11 -0
- package/dist/index.cjs +136 -83
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -1
- package/dist/index.d.ts +24 -1
- package/dist/index.js +136 -83
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/Drawer/Drawer.tsx +84 -4
- package/src/components/molecules/Drawer/DrawerBody.tsx +16 -23
- package/src/components/molecules/Drawer/DrawerBodyMaxContext.ts +21 -0
- package/src/components/molecules/Drawer/DrawerContent.tsx +98 -92
- package/src/components/molecules/Drawer/DrawerContext.ts +9 -0
- package/src/components/molecules/Drawer/DrawerFooter.tsx +17 -3
- package/src/components/molecules/Drawer/DrawerHeader.tsx +25 -3
- package/src/components/molecules/Drawer/DrawerMeasureContext.ts +9 -6
- package/src/components/molecules/Drawer/DrawerOverlay.tsx +4 -1
- package/src/components/molecules/Drawer/DrawerOverlayContext.ts +21 -0
- package/src/components/molecules/Drawer/index.ts +2 -1
package/dist/index.d.cts
CHANGED
|
@@ -949,6 +949,16 @@ type DrawerRootOwnProps = {
|
|
|
949
949
|
open?: boolean;
|
|
950
950
|
defaultOpen?: boolean;
|
|
951
951
|
onOpenChange?: (open: boolean) => void;
|
|
952
|
+
/**
|
|
953
|
+
* Whether the drawer shows a dimming backdrop and presents as a blocking
|
|
954
|
+
* modal (default `true`). Set to `false` for a backdrop-less, pass-through
|
|
955
|
+
* drawer: it renders inline instead of in a native `Modal`, omits the
|
|
956
|
+
* overlay, and lets touches outside the panel reach the content behind it
|
|
957
|
+
* (so e.g. a calendar stays interactive while the sheet is open). In this
|
|
958
|
+
* mode the root fills the screen with `pointerEvents="box-none"` so the
|
|
959
|
+
* panel's bottom-anchored positioning still resolves against the full screen.
|
|
960
|
+
*/
|
|
961
|
+
backdrop?: boolean;
|
|
952
962
|
children: React.ReactNode;
|
|
953
963
|
};
|
|
954
964
|
type DrawerProps = DrawerRootOwnProps & Omit<ViewProps, keyof DrawerRootOwnProps>;
|
|
@@ -959,6 +969,15 @@ type DrawerPortalProps = {
|
|
|
959
969
|
children: React.ReactNode;
|
|
960
970
|
topContent?: React.ReactNode;
|
|
961
971
|
};
|
|
972
|
+
type DrawerOverlayProviderProps = {
|
|
973
|
+
/**
|
|
974
|
+
* Component rendered on top of every modal drawer, inside the drawer's native
|
|
975
|
+
* Modal window (e.g. an app's toast/notification stack). Pass `null` to render
|
|
976
|
+
* nothing extra.
|
|
977
|
+
*/
|
|
978
|
+
component: React.ComponentType | null;
|
|
979
|
+
children: React.ReactNode;
|
|
980
|
+
};
|
|
962
981
|
declare const Drawer: React.ForwardRefExoticComponent<DrawerRootOwnProps & Omit<ViewProps, keyof DrawerRootOwnProps> & React.RefAttributes<View>> & {
|
|
963
982
|
Root: React.ForwardRefExoticComponent<DrawerRootOwnProps & Omit<ViewProps, keyof DrawerRootOwnProps> & React.RefAttributes<View>>;
|
|
964
983
|
Trigger: React.ForwardRefExoticComponent<DrawerTriggerProps & React.RefAttributes<View>>;
|
|
@@ -966,6 +985,10 @@ declare const Drawer: React.ForwardRefExoticComponent<DrawerRootOwnProps & Omit<
|
|
|
966
985
|
({ children, topContent }: DrawerPortalProps): react_jsx_runtime.JSX.Element | null;
|
|
967
986
|
displayName: string;
|
|
968
987
|
};
|
|
988
|
+
OverlayProvider: {
|
|
989
|
+
({ component, children }: DrawerOverlayProviderProps): React.ReactElement;
|
|
990
|
+
displayName: string;
|
|
991
|
+
};
|
|
969
992
|
Overlay: React.ForwardRefExoticComponent<DrawerOverlayProps & React.RefAttributes<View>>;
|
|
970
993
|
Content: React.ForwardRefExoticComponent<DrawerContentProps & React.RefAttributes<View>>;
|
|
971
994
|
Grabber: React.ForwardRefExoticComponent<ViewProps & React.RefAttributes<View>>;
|
|
@@ -2432,4 +2455,4 @@ type TabNavigationComponent = React.ForwardRefExoticComponent<TabNavigationProps
|
|
|
2432
2455
|
};
|
|
2433
2456
|
declare const TabNavigation: TabNavigationComponent;
|
|
2434
2457
|
|
|
2435
|
-
export { Accordion, type AccordionItemProps, type AccordionProps, type AccordionSize, Animated, type AnimatedProps, type AnimatedVariant, Avatar, type AvatarFallbackType, type AvatarProps, type AvatarSize, BRAND_FONTS, Badge$1 as Badge, type BadgeProps, Button, type ButtonColour, ButtonDock, type ButtonDockProps, type ButtonDockVariant, ButtonGroup, type ButtonGroupLayout, type ButtonGroupProps, type ButtonProps, type ButtonSize, type ButtonVariant, CarouselControls, type CarouselControlsProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type CheckboxVariant, CopyField, CopyFieldInput, type CopyFieldProps, Countdown, type CountdownLabels, type CountdownProps, type CountdownUnitLabel, type DateItemState, DatePicker, type DatePickerProps, Divider, type DividerColour, type DividerProps, type DividerSize, Drawer, type DrawerBodyProps, type DrawerCloseProps, type DrawerContentProps, type DrawerDescriptionProps, type DrawerFooterProps, type DrawerGrabberProps, type DrawerHeaderProps, type DrawerHeaderVariant, type DrawerOverlayProps, type DrawerPortalProps, type DrawerProps, type DrawerTitleProps, type DrawerTriggerProps, FilterTab, type FilterTabItemProps, type FilterTabProps, Hint, type HintProps, Icon, IconButton, type IconButtonColour, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconCategory, type IconColour, type IconProps, type IconSize, Illustration, type IllustrationProps, type IllustrationSize, Input, InputDescription, type InputDescriptionProps, InputError, type InputErrorProps, InputField, type InputFieldProps, InputLabel, type InputLabelProps, type InputProps, InputText, Link, type LinkProps, type LinkSize, type LinkWeight, Logo, type LogoBrand, type LogoProps, type LogoSvgComponent, type LogoVariant, Menu, type MenuAlign, MenuItem, type MenuItemProps, type MenuItemVariant, type MenuProps, MessageCard, MessageCardBanner, type MessageCardBannerMedia, type MessageCardBannerProps, MessageCardInsight, type MessageCardInsightProps, NativeSelectPicker, type NativeSelectPickerItem, type NativeSelectPickerProps, Notification, type NotificationProps, NumberField, type NumberFieldProps, NumberInput, NumberInputField, type NumberInputFieldProps, type NumberInputProps, PasswordField, PasswordFieldInput, type PasswordFieldProps, PasswordFieldRequirements, type PasswordFieldRequirementsProps, type PasswordRequirement, type PasswordValidationRule, type PawprintIcon, type PawprintIllustration$2 as PawprintIllustration, PawprintProvider, type PawprintProviderProps, PictureSelector, type PictureSelectorItem, type PictureSelectorProps, ProductDisplayCard, type ProductDisplayCardProps, ProductListingCardWithBadgeAndGrid as ProductListingCard, type ProductListingCardProps, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioOwnProps, type RadioProps, RadioTile, SearchField, SearchFieldInput, type SearchFieldProps, SegmentedControl, type SegmentedControlItemProps, type SegmentedControlProps, SelectField, SelectFieldContent, SelectFieldItem, type SelectFieldItemProps, type SelectFieldProps, SelectFieldTrigger, type SelectFieldTriggerProps, SelectFieldValue, type SelectValidationRule, Slider, type SliderProps, Spinner, type SpinnerProps, type SpinnerSize, type SpinnerVariant, type StackedNotificationItem, type StackedNotificationType, StackedNotifications, type StackedNotificationsProps, Switch, type SwitchProps, TabNavigation, type TabNavigationListProps, type TabNavigationPanelProps, type TabNavigationProps, type TabNavigationTabProps, Tag, type TagProps, TextArea, TextAreaField, type TextAreaFieldProps, TextAreaLabel, type TextAreaLabelProps, type TextAreaProps, ThemeProvider, Tooltip, type TooltipProps, Typography, type TypographyProps, createPawprintTheme, fadeAnimation, fadeDownAnimation, fadeUpAnimation, registerLogo, resolveFont, resolveLogo, scaleAnimation, slideInAnimation, slideOutAnimation, theme, useCopyField, usePasswordField, usePawprint, useSearchField, useSelectField };
|
|
2458
|
+
export { Accordion, type AccordionItemProps, type AccordionProps, type AccordionSize, Animated, type AnimatedProps, type AnimatedVariant, Avatar, type AvatarFallbackType, type AvatarProps, type AvatarSize, BRAND_FONTS, Badge$1 as Badge, type BadgeProps, Button, type ButtonColour, ButtonDock, type ButtonDockProps, type ButtonDockVariant, ButtonGroup, type ButtonGroupLayout, type ButtonGroupProps, type ButtonProps, type ButtonSize, type ButtonVariant, CarouselControls, type CarouselControlsProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type CheckboxVariant, CopyField, CopyFieldInput, type CopyFieldProps, Countdown, type CountdownLabels, type CountdownProps, type CountdownUnitLabel, type DateItemState, DatePicker, type DatePickerProps, Divider, type DividerColour, type DividerProps, type DividerSize, Drawer, type DrawerBodyProps, type DrawerCloseProps, type DrawerContentProps, type DrawerDescriptionProps, type DrawerFooterProps, type DrawerGrabberProps, type DrawerHeaderProps, type DrawerHeaderVariant, type DrawerOverlayProps, type DrawerOverlayProviderProps, type DrawerPortalProps, type DrawerProps, type DrawerTitleProps, type DrawerTriggerProps, FilterTab, type FilterTabItemProps, type FilterTabProps, Hint, type HintProps, Icon, IconButton, type IconButtonColour, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconCategory, type IconColour, type IconProps, type IconSize, Illustration, type IllustrationProps, type IllustrationSize, Input, InputDescription, type InputDescriptionProps, InputError, type InputErrorProps, InputField, type InputFieldProps, InputLabel, type InputLabelProps, type InputProps, InputText, Link, type LinkProps, type LinkSize, type LinkWeight, Logo, type LogoBrand, type LogoProps, type LogoSvgComponent, type LogoVariant, Menu, type MenuAlign, MenuItem, type MenuItemProps, type MenuItemVariant, type MenuProps, MessageCard, MessageCardBanner, type MessageCardBannerMedia, type MessageCardBannerProps, MessageCardInsight, type MessageCardInsightProps, NativeSelectPicker, type NativeSelectPickerItem, type NativeSelectPickerProps, Notification, type NotificationProps, NumberField, type NumberFieldProps, NumberInput, NumberInputField, type NumberInputFieldProps, type NumberInputProps, PasswordField, PasswordFieldInput, type PasswordFieldProps, PasswordFieldRequirements, type PasswordFieldRequirementsProps, type PasswordRequirement, type PasswordValidationRule, type PawprintIcon, type PawprintIllustration$2 as PawprintIllustration, PawprintProvider, type PawprintProviderProps, PictureSelector, type PictureSelectorItem, type PictureSelectorProps, ProductDisplayCard, type ProductDisplayCardProps, ProductListingCardWithBadgeAndGrid as ProductListingCard, type ProductListingCardProps, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioOwnProps, type RadioProps, RadioTile, SearchField, SearchFieldInput, type SearchFieldProps, SegmentedControl, type SegmentedControlItemProps, type SegmentedControlProps, SelectField, SelectFieldContent, SelectFieldItem, type SelectFieldItemProps, type SelectFieldProps, SelectFieldTrigger, type SelectFieldTriggerProps, SelectFieldValue, type SelectValidationRule, Slider, type SliderProps, Spinner, type SpinnerProps, type SpinnerSize, type SpinnerVariant, type StackedNotificationItem, type StackedNotificationType, StackedNotifications, type StackedNotificationsProps, Switch, type SwitchProps, TabNavigation, type TabNavigationListProps, type TabNavigationPanelProps, type TabNavigationProps, type TabNavigationTabProps, Tag, type TagProps, TextArea, TextAreaField, type TextAreaFieldProps, TextAreaLabel, type TextAreaLabelProps, type TextAreaProps, ThemeProvider, Tooltip, type TooltipProps, Typography, type TypographyProps, createPawprintTheme, fadeAnimation, fadeDownAnimation, fadeUpAnimation, registerLogo, resolveFont, resolveLogo, scaleAnimation, slideInAnimation, slideOutAnimation, theme, useCopyField, usePasswordField, usePawprint, useSearchField, useSelectField };
|
package/dist/index.d.ts
CHANGED
|
@@ -949,6 +949,16 @@ type DrawerRootOwnProps = {
|
|
|
949
949
|
open?: boolean;
|
|
950
950
|
defaultOpen?: boolean;
|
|
951
951
|
onOpenChange?: (open: boolean) => void;
|
|
952
|
+
/**
|
|
953
|
+
* Whether the drawer shows a dimming backdrop and presents as a blocking
|
|
954
|
+
* modal (default `true`). Set to `false` for a backdrop-less, pass-through
|
|
955
|
+
* drawer: it renders inline instead of in a native `Modal`, omits the
|
|
956
|
+
* overlay, and lets touches outside the panel reach the content behind it
|
|
957
|
+
* (so e.g. a calendar stays interactive while the sheet is open). In this
|
|
958
|
+
* mode the root fills the screen with `pointerEvents="box-none"` so the
|
|
959
|
+
* panel's bottom-anchored positioning still resolves against the full screen.
|
|
960
|
+
*/
|
|
961
|
+
backdrop?: boolean;
|
|
952
962
|
children: React.ReactNode;
|
|
953
963
|
};
|
|
954
964
|
type DrawerProps = DrawerRootOwnProps & Omit<ViewProps, keyof DrawerRootOwnProps>;
|
|
@@ -959,6 +969,15 @@ type DrawerPortalProps = {
|
|
|
959
969
|
children: React.ReactNode;
|
|
960
970
|
topContent?: React.ReactNode;
|
|
961
971
|
};
|
|
972
|
+
type DrawerOverlayProviderProps = {
|
|
973
|
+
/**
|
|
974
|
+
* Component rendered on top of every modal drawer, inside the drawer's native
|
|
975
|
+
* Modal window (e.g. an app's toast/notification stack). Pass `null` to render
|
|
976
|
+
* nothing extra.
|
|
977
|
+
*/
|
|
978
|
+
component: React.ComponentType | null;
|
|
979
|
+
children: React.ReactNode;
|
|
980
|
+
};
|
|
962
981
|
declare const Drawer: React.ForwardRefExoticComponent<DrawerRootOwnProps & Omit<ViewProps, keyof DrawerRootOwnProps> & React.RefAttributes<View>> & {
|
|
963
982
|
Root: React.ForwardRefExoticComponent<DrawerRootOwnProps & Omit<ViewProps, keyof DrawerRootOwnProps> & React.RefAttributes<View>>;
|
|
964
983
|
Trigger: React.ForwardRefExoticComponent<DrawerTriggerProps & React.RefAttributes<View>>;
|
|
@@ -966,6 +985,10 @@ declare const Drawer: React.ForwardRefExoticComponent<DrawerRootOwnProps & Omit<
|
|
|
966
985
|
({ children, topContent }: DrawerPortalProps): react_jsx_runtime.JSX.Element | null;
|
|
967
986
|
displayName: string;
|
|
968
987
|
};
|
|
988
|
+
OverlayProvider: {
|
|
989
|
+
({ component, children }: DrawerOverlayProviderProps): React.ReactElement;
|
|
990
|
+
displayName: string;
|
|
991
|
+
};
|
|
969
992
|
Overlay: React.ForwardRefExoticComponent<DrawerOverlayProps & React.RefAttributes<View>>;
|
|
970
993
|
Content: React.ForwardRefExoticComponent<DrawerContentProps & React.RefAttributes<View>>;
|
|
971
994
|
Grabber: React.ForwardRefExoticComponent<ViewProps & React.RefAttributes<View>>;
|
|
@@ -2432,4 +2455,4 @@ type TabNavigationComponent = React.ForwardRefExoticComponent<TabNavigationProps
|
|
|
2432
2455
|
};
|
|
2433
2456
|
declare const TabNavigation: TabNavigationComponent;
|
|
2434
2457
|
|
|
2435
|
-
export { Accordion, type AccordionItemProps, type AccordionProps, type AccordionSize, Animated, type AnimatedProps, type AnimatedVariant, Avatar, type AvatarFallbackType, type AvatarProps, type AvatarSize, BRAND_FONTS, Badge$1 as Badge, type BadgeProps, Button, type ButtonColour, ButtonDock, type ButtonDockProps, type ButtonDockVariant, ButtonGroup, type ButtonGroupLayout, type ButtonGroupProps, type ButtonProps, type ButtonSize, type ButtonVariant, CarouselControls, type CarouselControlsProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type CheckboxVariant, CopyField, CopyFieldInput, type CopyFieldProps, Countdown, type CountdownLabels, type CountdownProps, type CountdownUnitLabel, type DateItemState, DatePicker, type DatePickerProps, Divider, type DividerColour, type DividerProps, type DividerSize, Drawer, type DrawerBodyProps, type DrawerCloseProps, type DrawerContentProps, type DrawerDescriptionProps, type DrawerFooterProps, type DrawerGrabberProps, type DrawerHeaderProps, type DrawerHeaderVariant, type DrawerOverlayProps, type DrawerPortalProps, type DrawerProps, type DrawerTitleProps, type DrawerTriggerProps, FilterTab, type FilterTabItemProps, type FilterTabProps, Hint, type HintProps, Icon, IconButton, type IconButtonColour, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconCategory, type IconColour, type IconProps, type IconSize, Illustration, type IllustrationProps, type IllustrationSize, Input, InputDescription, type InputDescriptionProps, InputError, type InputErrorProps, InputField, type InputFieldProps, InputLabel, type InputLabelProps, type InputProps, InputText, Link, type LinkProps, type LinkSize, type LinkWeight, Logo, type LogoBrand, type LogoProps, type LogoSvgComponent, type LogoVariant, Menu, type MenuAlign, MenuItem, type MenuItemProps, type MenuItemVariant, type MenuProps, MessageCard, MessageCardBanner, type MessageCardBannerMedia, type MessageCardBannerProps, MessageCardInsight, type MessageCardInsightProps, NativeSelectPicker, type NativeSelectPickerItem, type NativeSelectPickerProps, Notification, type NotificationProps, NumberField, type NumberFieldProps, NumberInput, NumberInputField, type NumberInputFieldProps, type NumberInputProps, PasswordField, PasswordFieldInput, type PasswordFieldProps, PasswordFieldRequirements, type PasswordFieldRequirementsProps, type PasswordRequirement, type PasswordValidationRule, type PawprintIcon, type PawprintIllustration$2 as PawprintIllustration, PawprintProvider, type PawprintProviderProps, PictureSelector, type PictureSelectorItem, type PictureSelectorProps, ProductDisplayCard, type ProductDisplayCardProps, ProductListingCardWithBadgeAndGrid as ProductListingCard, type ProductListingCardProps, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioOwnProps, type RadioProps, RadioTile, SearchField, SearchFieldInput, type SearchFieldProps, SegmentedControl, type SegmentedControlItemProps, type SegmentedControlProps, SelectField, SelectFieldContent, SelectFieldItem, type SelectFieldItemProps, type SelectFieldProps, SelectFieldTrigger, type SelectFieldTriggerProps, SelectFieldValue, type SelectValidationRule, Slider, type SliderProps, Spinner, type SpinnerProps, type SpinnerSize, type SpinnerVariant, type StackedNotificationItem, type StackedNotificationType, StackedNotifications, type StackedNotificationsProps, Switch, type SwitchProps, TabNavigation, type TabNavigationListProps, type TabNavigationPanelProps, type TabNavigationProps, type TabNavigationTabProps, Tag, type TagProps, TextArea, TextAreaField, type TextAreaFieldProps, TextAreaLabel, type TextAreaLabelProps, type TextAreaProps, ThemeProvider, Tooltip, type TooltipProps, Typography, type TypographyProps, createPawprintTheme, fadeAnimation, fadeDownAnimation, fadeUpAnimation, registerLogo, resolveFont, resolveLogo, scaleAnimation, slideInAnimation, slideOutAnimation, theme, useCopyField, usePasswordField, usePawprint, useSearchField, useSelectField };
|
|
2458
|
+
export { Accordion, type AccordionItemProps, type AccordionProps, type AccordionSize, Animated, type AnimatedProps, type AnimatedVariant, Avatar, type AvatarFallbackType, type AvatarProps, type AvatarSize, BRAND_FONTS, Badge$1 as Badge, type BadgeProps, Button, type ButtonColour, ButtonDock, type ButtonDockProps, type ButtonDockVariant, ButtonGroup, type ButtonGroupLayout, type ButtonGroupProps, type ButtonProps, type ButtonSize, type ButtonVariant, CarouselControls, type CarouselControlsProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type CheckboxVariant, CopyField, CopyFieldInput, type CopyFieldProps, Countdown, type CountdownLabels, type CountdownProps, type CountdownUnitLabel, type DateItemState, DatePicker, type DatePickerProps, Divider, type DividerColour, type DividerProps, type DividerSize, Drawer, type DrawerBodyProps, type DrawerCloseProps, type DrawerContentProps, type DrawerDescriptionProps, type DrawerFooterProps, type DrawerGrabberProps, type DrawerHeaderProps, type DrawerHeaderVariant, type DrawerOverlayProps, type DrawerOverlayProviderProps, type DrawerPortalProps, type DrawerProps, type DrawerTitleProps, type DrawerTriggerProps, FilterTab, type FilterTabItemProps, type FilterTabProps, Hint, type HintProps, Icon, IconButton, type IconButtonColour, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconCategory, type IconColour, type IconProps, type IconSize, Illustration, type IllustrationProps, type IllustrationSize, Input, InputDescription, type InputDescriptionProps, InputError, type InputErrorProps, InputField, type InputFieldProps, InputLabel, type InputLabelProps, type InputProps, InputText, Link, type LinkProps, type LinkSize, type LinkWeight, Logo, type LogoBrand, type LogoProps, type LogoSvgComponent, type LogoVariant, Menu, type MenuAlign, MenuItem, type MenuItemProps, type MenuItemVariant, type MenuProps, MessageCard, MessageCardBanner, type MessageCardBannerMedia, type MessageCardBannerProps, MessageCardInsight, type MessageCardInsightProps, NativeSelectPicker, type NativeSelectPickerItem, type NativeSelectPickerProps, Notification, type NotificationProps, NumberField, type NumberFieldProps, NumberInput, NumberInputField, type NumberInputFieldProps, type NumberInputProps, PasswordField, PasswordFieldInput, type PasswordFieldProps, PasswordFieldRequirements, type PasswordFieldRequirementsProps, type PasswordRequirement, type PasswordValidationRule, type PawprintIcon, type PawprintIllustration$2 as PawprintIllustration, PawprintProvider, type PawprintProviderProps, PictureSelector, type PictureSelectorItem, type PictureSelectorProps, ProductDisplayCard, type ProductDisplayCardProps, ProductListingCardWithBadgeAndGrid as ProductListingCard, type ProductListingCardProps, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioOwnProps, type RadioProps, RadioTile, SearchField, SearchFieldInput, type SearchFieldProps, SegmentedControl, type SegmentedControlItemProps, type SegmentedControlProps, SelectField, SelectFieldContent, SelectFieldItem, type SelectFieldItemProps, type SelectFieldProps, SelectFieldTrigger, type SelectFieldTriggerProps, SelectFieldValue, type SelectValidationRule, Slider, type SliderProps, Spinner, type SpinnerProps, type SpinnerSize, type SpinnerVariant, type StackedNotificationItem, type StackedNotificationType, StackedNotifications, type StackedNotificationsProps, Switch, type SwitchProps, TabNavigation, type TabNavigationListProps, type TabNavigationPanelProps, type TabNavigationProps, type TabNavigationTabProps, Tag, type TagProps, TextArea, TextAreaField, type TextAreaFieldProps, TextAreaLabel, type TextAreaLabelProps, type TextAreaProps, ThemeProvider, Tooltip, type TooltipProps, Typography, type TypographyProps, createPawprintTheme, fadeAnimation, fadeDownAnimation, fadeUpAnimation, registerLogo, resolveFont, resolveLogo, scaleAnimation, slideInAnimation, slideOutAnimation, theme, useCopyField, usePasswordField, usePawprint, useSearchField, useSelectField };
|
package/dist/index.js
CHANGED
|
@@ -5600,6 +5600,7 @@ Animated5.displayName = "Animated";
|
|
|
5600
5600
|
var DrawerContext = React66.createContext({
|
|
5601
5601
|
isOpen: false,
|
|
5602
5602
|
modalVisible: false,
|
|
5603
|
+
backdrop: true,
|
|
5603
5604
|
openDrawer: () => {
|
|
5604
5605
|
},
|
|
5605
5606
|
closeDrawer: () => {
|
|
@@ -5608,10 +5609,12 @@ var DrawerContext = React66.createContext({
|
|
|
5608
5609
|
}
|
|
5609
5610
|
});
|
|
5610
5611
|
var useDrawerContext = () => React66.useContext(DrawerContext);
|
|
5612
|
+
var DrawerOverlayContext = createContext(null);
|
|
5613
|
+
var useDrawerOverlay = () => useContext(DrawerOverlayContext);
|
|
5611
5614
|
var FADE_DURATION = 220;
|
|
5612
5615
|
var DrawerOverlay = React66.forwardRef(({ accessible = false }, _ref) => {
|
|
5613
5616
|
const theme2 = useTheme();
|
|
5614
|
-
const { isOpen, closeDrawer } = useDrawerContext();
|
|
5617
|
+
const { isOpen, closeDrawer, backdrop } = useDrawerContext();
|
|
5615
5618
|
const opacity = useRef(new Animated.Value(0)).current;
|
|
5616
5619
|
useEffect(() => {
|
|
5617
5620
|
Animated.timing(opacity, {
|
|
@@ -5620,6 +5623,7 @@ var DrawerOverlay = React66.forwardRef(({ accessible = false }, _ref) => {
|
|
|
5620
5623
|
useNativeDriver: true
|
|
5621
5624
|
}).start();
|
|
5622
5625
|
}, [isOpen, opacity]);
|
|
5626
|
+
if (!backdrop) return null;
|
|
5623
5627
|
return /* @__PURE__ */ jsx(
|
|
5624
5628
|
Pressable,
|
|
5625
5629
|
{
|
|
@@ -5647,6 +5651,8 @@ var DrawerDragContext = React66.createContext(null);
|
|
|
5647
5651
|
var useDrawerDragContext = () => React66.useContext(DrawerDragContext);
|
|
5648
5652
|
var DrawerMeasureContext = createContext(null);
|
|
5649
5653
|
var useDrawerMeasureContext = () => useContext(DrawerMeasureContext);
|
|
5654
|
+
var DrawerBodyMaxContext = createContext(null);
|
|
5655
|
+
var useDrawerBodyMax = () => useContext(DrawerBodyMaxContext);
|
|
5650
5656
|
var DrawerFooterContext = React66.createContext(false);
|
|
5651
5657
|
var useDrawerFooterContext = () => React66.useContext(DrawerFooterContext);
|
|
5652
5658
|
var DrawerHeaderContext = React66.createContext(null);
|
|
@@ -5660,17 +5666,17 @@ var StyledPanel2 = styled51(View)(
|
|
|
5660
5666
|
panelBorderRadius,
|
|
5661
5667
|
panelBgColor,
|
|
5662
5668
|
panelMaxWidth,
|
|
5669
|
+
panelMaxHeight,
|
|
5663
5670
|
panelBorderWidth,
|
|
5664
5671
|
panelBorderColor,
|
|
5665
5672
|
panelShadowColor,
|
|
5666
5673
|
panelShadowOffsetY,
|
|
5667
|
-
panelShadowBlur
|
|
5668
|
-
|
|
5669
|
-
}) => __spreadProps(__spreadValues({
|
|
5674
|
+
panelShadowBlur
|
|
5675
|
+
}) => ({
|
|
5670
5676
|
width: "100%",
|
|
5671
5677
|
maxWidth: panelMaxWidth,
|
|
5672
|
-
|
|
5673
|
-
|
|
5678
|
+
maxHeight: panelMaxHeight,
|
|
5679
|
+
alignSelf: "center",
|
|
5674
5680
|
borderTopLeftRadius: panelBorderRadius,
|
|
5675
5681
|
borderTopRightRadius: panelBorderRadius,
|
|
5676
5682
|
borderTopWidth: panelBorderWidth,
|
|
@@ -5696,7 +5702,8 @@ var DrawerContent = React66.forwardRef(
|
|
|
5696
5702
|
const { isOpen, closeDrawer, onExitComplete } = useDrawerContext();
|
|
5697
5703
|
const { height: windowHeight } = useWindowDimensions();
|
|
5698
5704
|
const maxHeight = windowHeight * 0.9;
|
|
5699
|
-
const
|
|
5705
|
+
const topBorder = parseTokenValue23(dimensions3.borderWidth.sm);
|
|
5706
|
+
const noFooterBodyPadding = parseTokenValue23(dimensions3.spacing["2xl"]);
|
|
5700
5707
|
const closeDrawerRef = useRef(closeDrawer);
|
|
5701
5708
|
useEffect(() => {
|
|
5702
5709
|
closeDrawerRef.current = closeDrawer;
|
|
@@ -5707,10 +5714,12 @@ var DrawerContent = React66.forwardRef(
|
|
|
5707
5714
|
const entryRanRef = useRef(false);
|
|
5708
5715
|
const isOpenRef = useRef(isOpen);
|
|
5709
5716
|
const activeAnim = useRef(null);
|
|
5710
|
-
const [
|
|
5711
|
-
const
|
|
5712
|
-
const
|
|
5713
|
-
const
|
|
5717
|
+
const [bodyMax, setBodyMax] = useState(null);
|
|
5718
|
+
const bodyMaxRef = useRef(null);
|
|
5719
|
+
const headerHeightRef = useRef(0);
|
|
5720
|
+
const footerHeightRef = useRef(0);
|
|
5721
|
+
const hasHeaderRef = useRef(false);
|
|
5722
|
+
const hasFooterRef = useRef(false);
|
|
5714
5723
|
useEffect(() => {
|
|
5715
5724
|
const id = translateY.addListener(({ value }) => {
|
|
5716
5725
|
translateYValue.current = value;
|
|
@@ -5718,8 +5727,7 @@ var DrawerContent = React66.forwardRef(
|
|
|
5718
5727
|
return () => translateY.removeListener(id);
|
|
5719
5728
|
}, [translateY]);
|
|
5720
5729
|
useEffect(() => {
|
|
5721
|
-
if (panelHeightRef.current >
|
|
5722
|
-
setPanelHeight(maxHeight);
|
|
5730
|
+
if (panelHeightRef.current > maxHeight) {
|
|
5723
5731
|
panelHeightRef.current = maxHeight;
|
|
5724
5732
|
}
|
|
5725
5733
|
}, [maxHeight]);
|
|
@@ -5769,59 +5777,56 @@ var DrawerContent = React66.forwardRef(
|
|
|
5769
5777
|
runExit();
|
|
5770
5778
|
}
|
|
5771
5779
|
}, [isOpen, runEntry, runExit]);
|
|
5772
|
-
const
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
const
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
|
|
5780
|
+
const measureChrome = useCallback(() => {
|
|
5781
|
+
if (hasHeaderRef.current && headerHeightRef.current <= 0) return 0;
|
|
5782
|
+
if (hasFooterRef.current && footerHeightRef.current <= 0) return 0;
|
|
5783
|
+
const header = hasHeaderRef.current ? headerHeightRef.current : 0;
|
|
5784
|
+
const footer = hasFooterRef.current ? footerHeightRef.current : 0;
|
|
5785
|
+
const bodyBottomPad = hasFooterRef.current ? 0 : noFooterBodyPadding;
|
|
5786
|
+
return header + footer + topBorder + bodyBottomPad;
|
|
5787
|
+
}, [noFooterBodyPadding, topBorder]);
|
|
5788
|
+
const applyBodyMax = useCallback(() => {
|
|
5789
|
+
var _a3;
|
|
5790
|
+
const chrome = measureChrome();
|
|
5791
|
+
if (chrome <= 0) return;
|
|
5792
|
+
const availableBody = Math.max(0, maxHeight - chrome);
|
|
5793
|
+
if (Math.abs(availableBody - ((_a3 = bodyMaxRef.current) != null ? _a3 : -1)) > 1) {
|
|
5794
|
+
bodyMaxRef.current = availableBody;
|
|
5795
|
+
setBodyMax(availableBody);
|
|
5783
5796
|
}
|
|
5784
|
-
}, [
|
|
5785
|
-
const
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5797
|
+
}, [measureChrome, maxHeight]);
|
|
5798
|
+
const setHeaderHeight = useCallback(
|
|
5799
|
+
(height) => {
|
|
5800
|
+
if (height <= 0 || Math.abs(height - headerHeightRef.current) < 1)
|
|
5801
|
+
return;
|
|
5802
|
+
headerHeightRef.current = height;
|
|
5803
|
+
applyBodyMax();
|
|
5804
|
+
},
|
|
5805
|
+
[applyBodyMax]
|
|
5806
|
+
);
|
|
5807
|
+
const setFooterHeight = useCallback(
|
|
5793
5808
|
(height) => {
|
|
5794
|
-
if (height <= 0)
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5809
|
+
if (height <= 0 || Math.abs(height - footerHeightRef.current) < 1)
|
|
5810
|
+
return;
|
|
5811
|
+
footerHeightRef.current = height;
|
|
5812
|
+
applyBodyMax();
|
|
5798
5813
|
},
|
|
5799
|
-
[
|
|
5814
|
+
[applyBodyMax]
|
|
5800
5815
|
);
|
|
5801
5816
|
const measureContextValue = useMemo(
|
|
5802
|
-
() => ({
|
|
5803
|
-
[
|
|
5817
|
+
() => ({ setHeaderHeight, setFooterHeight }),
|
|
5818
|
+
[setHeaderHeight, setFooterHeight]
|
|
5804
5819
|
);
|
|
5805
5820
|
const onLayout = useCallback(
|
|
5806
5821
|
({ nativeEvent }) => {
|
|
5807
|
-
const
|
|
5808
|
-
const capped = Math.min(h, maxHeight);
|
|
5822
|
+
const capped = Math.min(nativeEvent.layout.height, maxHeight);
|
|
5809
5823
|
if (capped <= 0) return;
|
|
5810
|
-
|
|
5811
|
-
if (
|
|
5812
|
-
firstNaturalRef.current = h;
|
|
5813
|
-
lockChrome();
|
|
5814
|
-
}
|
|
5815
|
-
if (capped !== panelHeightRef.current) {
|
|
5816
|
-
panelHeightRef.current = capped;
|
|
5817
|
-
setPanelHeight(capped);
|
|
5818
|
-
}
|
|
5819
|
-
if (isOpenRef.current) {
|
|
5824
|
+
panelHeightRef.current = capped;
|
|
5825
|
+
if (!entryRanRef.current && isOpenRef.current) {
|
|
5820
5826
|
runEntry();
|
|
5821
5827
|
}
|
|
5822
|
-
applyRefit();
|
|
5823
5828
|
},
|
|
5824
|
-
[runEntry, maxHeight
|
|
5829
|
+
[runEntry, maxHeight]
|
|
5825
5830
|
);
|
|
5826
5831
|
const panResponder = useRef(
|
|
5827
5832
|
PanResponder.create({
|
|
@@ -5887,6 +5892,8 @@ var DrawerContent = React66.forwardRef(
|
|
|
5887
5892
|
const headerChild = React66.Children.toArray(children).find(
|
|
5888
5893
|
(child) => React66.isValidElement(child) && child.type.displayName === "Drawer.Header"
|
|
5889
5894
|
);
|
|
5895
|
+
hasHeaderRef.current = headerChild != null;
|
|
5896
|
+
hasFooterRef.current = hasFooter;
|
|
5890
5897
|
const headerContextValue = headerChild != null ? {
|
|
5891
5898
|
variant: (_a2 = headerChild.props.variant) != null ? _a2 : "titleAndText"
|
|
5892
5899
|
} : null;
|
|
@@ -5895,7 +5902,6 @@ var DrawerContent = React66.forwardRef(
|
|
|
5895
5902
|
{
|
|
5896
5903
|
style: [
|
|
5897
5904
|
styles.animatedWrapper,
|
|
5898
|
-
panelHeight > 0 ? { height: panelHeight } : void 0,
|
|
5899
5905
|
{ transform: [{ translateY }] }
|
|
5900
5906
|
],
|
|
5901
5907
|
children: /* @__PURE__ */ jsx(
|
|
@@ -5906,7 +5912,7 @@ var DrawerContent = React66.forwardRef(
|
|
|
5906
5912
|
panelBorderRadius: parseTokenValue23(drawer.borderRadius.top),
|
|
5907
5913
|
panelBgColor: colour.background.container.default,
|
|
5908
5914
|
panelMaxWidth: parseTokenValue23(drawer.size.maxWidth),
|
|
5909
|
-
|
|
5915
|
+
panelMaxHeight: maxHeight,
|
|
5910
5916
|
panelBorderWidth: parseTokenValue23(dimensions3.borderWidth.sm),
|
|
5911
5917
|
panelBorderColor: colour.border.default,
|
|
5912
5918
|
panelShadowColor: modal.shadow.color,
|
|
@@ -5916,7 +5922,7 @@ var DrawerContent = React66.forwardRef(
|
|
|
5916
5922
|
accessibilityRole: "none",
|
|
5917
5923
|
accessibilityViewIsModal: true
|
|
5918
5924
|
}, props), {
|
|
5919
|
-
children
|
|
5925
|
+
children: /* @__PURE__ */ jsx(DrawerBodyMaxContext.Provider, { value: bodyMax, children })
|
|
5920
5926
|
})
|
|
5921
5927
|
)
|
|
5922
5928
|
}
|
|
@@ -6100,12 +6106,20 @@ function splitChildren(children) {
|
|
|
6100
6106
|
}
|
|
6101
6107
|
var DrawerHeader = React66.forwardRef(
|
|
6102
6108
|
(_a, ref) => {
|
|
6103
|
-
var _b = _a, { variant = "titleAndText", imageSource, children } = _b, props = __objRest(_b, ["variant", "imageSource", "children"]);
|
|
6109
|
+
var _b = _a, { variant = "titleAndText", imageSource, children, onLayout } = _b, props = __objRest(_b, ["variant", "imageSource", "children", "onLayout"]);
|
|
6104
6110
|
var _a2, _b2, _c, _d, _e, _f;
|
|
6105
6111
|
const theme2 = useTheme();
|
|
6106
6112
|
const { drawer, grabber } = theme2.tokens.components;
|
|
6107
6113
|
const { colour, dimensions: dimensions3 } = theme2.tokens.semantics;
|
|
6108
6114
|
const dragContext = useDrawerDragContext();
|
|
6115
|
+
const measureContext = useDrawerMeasureContext();
|
|
6116
|
+
const handleLayout = useCallback(
|
|
6117
|
+
(event) => {
|
|
6118
|
+
measureContext == null ? void 0 : measureContext.setHeaderHeight(event.nativeEvent.layout.height);
|
|
6119
|
+
onLayout == null ? void 0 : onLayout(event);
|
|
6120
|
+
},
|
|
6121
|
+
[measureContext, onLayout]
|
|
6122
|
+
);
|
|
6109
6123
|
const contextValue = useMemo(() => ({ variant }), [variant]);
|
|
6110
6124
|
const { closeChild, otherChildren } = splitChildren(children);
|
|
6111
6125
|
const headerSpacing = drawer.spacing.drawerHeader[variant === "image" ? "Image" : variant];
|
|
@@ -6157,7 +6171,8 @@ var DrawerHeader = React66.forwardRef(
|
|
|
6157
6171
|
headerGap: parseTokenValue26(headerSpacing.gap),
|
|
6158
6172
|
headerBorderBottomWidth: variant === "titleAndText" ? parseTokenValue26(dimensions3.borderWidth.sm) : void 0,
|
|
6159
6173
|
headerBorderColor: variant === "titleAndText" ? colour.border.default : void 0,
|
|
6160
|
-
headerBgColor: variant === "fullBleed" ? drawer.drawerHeader.colour.background.fullBleed : void 0
|
|
6174
|
+
headerBgColor: variant === "fullBleed" ? drawer.drawerHeader.colour.background.fullBleed : void 0,
|
|
6175
|
+
onLayout: handleLayout
|
|
6161
6176
|
}, props), {
|
|
6162
6177
|
children: [
|
|
6163
6178
|
/* @__PURE__ */ jsx(
|
|
@@ -6222,40 +6237,35 @@ var StyledScrollView = styled51(ScrollView)(
|
|
|
6222
6237
|
({
|
|
6223
6238
|
bodyPaddingHorizontal,
|
|
6224
6239
|
bodyPaddingRight,
|
|
6225
|
-
bodyGap,
|
|
6226
6240
|
bodyMaxHeight,
|
|
6227
6241
|
bodyPaddingBottom
|
|
6228
6242
|
}) => ({
|
|
6229
|
-
flex: 1
|
|
6243
|
+
// No `flex: 1`: the ScrollView self-sizes to its content (up to
|
|
6244
|
+
// `maxHeight`), so the panel wraps tight around short content and scrolls
|
|
6245
|
+
// only when content exceeds the chrome-aware cap.
|
|
6246
|
+
flexGrow: 0,
|
|
6247
|
+
flexShrink: 1,
|
|
6230
6248
|
paddingLeft: bodyPaddingHorizontal,
|
|
6231
6249
|
paddingRight: bodyPaddingRight,
|
|
6232
|
-
gap: bodyGap,
|
|
6233
6250
|
maxHeight: bodyMaxHeight,
|
|
6234
6251
|
paddingBottom: bodyPaddingBottom
|
|
6235
6252
|
})
|
|
6236
6253
|
);
|
|
6237
6254
|
var DrawerBody = React66.forwardRef(
|
|
6238
6255
|
(_a, ref) => {
|
|
6239
|
-
var _b = _a, { children, contentContainerStyle
|
|
6256
|
+
var _b = _a, { children, contentContainerStyle } = _b, props = __objRest(_b, ["children", "contentContainerStyle"]);
|
|
6240
6257
|
const theme2 = useTheme();
|
|
6241
6258
|
const { spacing } = theme2.tokens.components.drawer;
|
|
6242
6259
|
const { buttons } = theme2.tokens.components;
|
|
6243
6260
|
const { content } = spacing;
|
|
6244
6261
|
const headerContext = useDrawerHeaderContext();
|
|
6245
6262
|
const footerContext = useDrawerFooterContext();
|
|
6246
|
-
const
|
|
6263
|
+
const providedMaxHeight = useDrawerBodyMax();
|
|
6247
6264
|
const { height: windowHeight } = useWindowDimensions();
|
|
6248
|
-
const handleContentSizeChange = useCallback(
|
|
6249
|
-
(width, height) => {
|
|
6250
|
-
measureContext == null ? void 0 : measureContext.setBodyContentHeight(height);
|
|
6251
|
-
onContentSizeChange == null ? void 0 : onContentSizeChange(width, height);
|
|
6252
|
-
},
|
|
6253
|
-
[measureContext, onContentSizeChange]
|
|
6254
|
-
);
|
|
6255
6265
|
const gap = parseTokenValue27(content.slot.gap);
|
|
6256
6266
|
const horizontalPadding = parseTokenValue27(content.slot.horizontalPadding);
|
|
6257
6267
|
const topPadding = parseTokenValue27(content.slot.verticalPadding);
|
|
6258
|
-
const bodyMaxHeight = windowHeight - 300;
|
|
6268
|
+
const bodyMaxHeight = providedMaxHeight != null ? providedMaxHeight : windowHeight - 300;
|
|
6259
6269
|
const paddingRight = headerContext === null ? parseTokenValue27(spacing.close.right.md) + parseTokenValue27(buttons.size.sm.height) : horizontalPadding;
|
|
6260
6270
|
const bodyPaddingBottom = !footerContext ? parseTokenValue27(theme2.tokens.semantics.dimensions.spacing["2xl"]) : 0;
|
|
6261
6271
|
return /* @__PURE__ */ jsx(
|
|
@@ -6264,10 +6274,8 @@ var DrawerBody = React66.forwardRef(
|
|
|
6264
6274
|
ref,
|
|
6265
6275
|
bodyPaddingHorizontal: horizontalPadding,
|
|
6266
6276
|
bodyPaddingRight: paddingRight,
|
|
6267
|
-
bodyGap: gap,
|
|
6268
6277
|
bodyMaxHeight,
|
|
6269
6278
|
bodyPaddingBottom,
|
|
6270
|
-
onContentSizeChange: handleContentSizeChange,
|
|
6271
6279
|
contentContainerStyle: [
|
|
6272
6280
|
{
|
|
6273
6281
|
gap,
|
|
@@ -6292,10 +6300,18 @@ var StyledFooter = styled51(View)(({ footerPaddingTop, footerPaddingHorizontal,
|
|
|
6292
6300
|
}));
|
|
6293
6301
|
var DrawerFooter = React66.forwardRef(
|
|
6294
6302
|
(_a, ref) => {
|
|
6295
|
-
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
6303
|
+
var _b = _a, { children, onLayout } = _b, props = __objRest(_b, ["children", "onLayout"]);
|
|
6296
6304
|
const theme2 = useTheme();
|
|
6297
6305
|
const { spacing } = theme2.tokens.components.drawer;
|
|
6298
6306
|
const insets = useSafeAreaInsets();
|
|
6307
|
+
const measureContext = useDrawerMeasureContext();
|
|
6308
|
+
const handleLayout = useCallback(
|
|
6309
|
+
(event) => {
|
|
6310
|
+
measureContext == null ? void 0 : measureContext.setFooterHeight(event.nativeEvent.layout.height);
|
|
6311
|
+
onLayout == null ? void 0 : onLayout(event);
|
|
6312
|
+
},
|
|
6313
|
+
[measureContext, onLayout]
|
|
6314
|
+
);
|
|
6299
6315
|
return /* @__PURE__ */ jsx(
|
|
6300
6316
|
StyledFooter,
|
|
6301
6317
|
__spreadProps(__spreadValues({
|
|
@@ -6304,7 +6320,8 @@ var DrawerFooter = React66.forwardRef(
|
|
|
6304
6320
|
footerPaddingHorizontal: parseTokenValue28(
|
|
6305
6321
|
spacing.footer.horizontalPadding
|
|
6306
6322
|
),
|
|
6307
|
-
footerPaddingBottom: parseTokenValue28(spacing.bottomPadding) + insets.bottom
|
|
6323
|
+
footerPaddingBottom: parseTokenValue28(spacing.bottomPadding) + insets.bottom,
|
|
6324
|
+
onLayout: handleLayout
|
|
6308
6325
|
}, props), {
|
|
6309
6326
|
children
|
|
6310
6327
|
})
|
|
@@ -6318,12 +6335,18 @@ var DrawerRoot = React66.forwardRef(
|
|
|
6318
6335
|
open: controlledOpen,
|
|
6319
6336
|
defaultOpen = false,
|
|
6320
6337
|
onOpenChange,
|
|
6321
|
-
|
|
6338
|
+
backdrop = true,
|
|
6339
|
+
children,
|
|
6340
|
+
style,
|
|
6341
|
+
pointerEvents
|
|
6322
6342
|
} = _b, rest = __objRest(_b, [
|
|
6323
6343
|
"open",
|
|
6324
6344
|
"defaultOpen",
|
|
6325
6345
|
"onOpenChange",
|
|
6326
|
-
"
|
|
6346
|
+
"backdrop",
|
|
6347
|
+
"children",
|
|
6348
|
+
"style",
|
|
6349
|
+
"pointerEvents"
|
|
6327
6350
|
]);
|
|
6328
6351
|
const isControlled = useRef(controlledOpen !== void 0);
|
|
6329
6352
|
const [internalOpen, setInternalOpen] = useState(defaultOpen);
|
|
@@ -6346,10 +6369,26 @@ var DrawerRoot = React66.forwardRef(
|
|
|
6346
6369
|
setModalVisible(false);
|
|
6347
6370
|
}, []);
|
|
6348
6371
|
const ctx = useMemo(
|
|
6349
|
-
() => ({
|
|
6350
|
-
|
|
6372
|
+
() => ({
|
|
6373
|
+
isOpen,
|
|
6374
|
+
modalVisible,
|
|
6375
|
+
backdrop,
|
|
6376
|
+
openDrawer,
|
|
6377
|
+
closeDrawer,
|
|
6378
|
+
onExitComplete
|
|
6379
|
+
}),
|
|
6380
|
+
[isOpen, modalVisible, backdrop, openDrawer, closeDrawer, onExitComplete]
|
|
6351
6381
|
);
|
|
6352
|
-
return /* @__PURE__ */ jsx(DrawerContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx(
|
|
6382
|
+
return /* @__PURE__ */ jsx(DrawerContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx(
|
|
6383
|
+
View,
|
|
6384
|
+
__spreadProps(__spreadValues({
|
|
6385
|
+
ref,
|
|
6386
|
+
style: backdrop ? style : [StyleSheet.absoluteFill, style],
|
|
6387
|
+
pointerEvents: backdrop ? pointerEvents : pointerEvents != null ? pointerEvents : "box-none"
|
|
6388
|
+
}, rest), {
|
|
6389
|
+
children
|
|
6390
|
+
})
|
|
6391
|
+
) });
|
|
6353
6392
|
}
|
|
6354
6393
|
);
|
|
6355
6394
|
DrawerRoot.displayName = "Drawer";
|
|
@@ -6361,8 +6400,15 @@ var DrawerTrigger = React66.forwardRef(
|
|
|
6361
6400
|
);
|
|
6362
6401
|
DrawerTrigger.displayName = "Drawer.Trigger";
|
|
6363
6402
|
var DrawerPortal = ({ children, topContent }) => {
|
|
6364
|
-
const { modalVisible, closeDrawer } = React66.useContext(DrawerContext);
|
|
6403
|
+
const { modalVisible, closeDrawer, backdrop } = React66.useContext(DrawerContext);
|
|
6404
|
+
const OverlayComponent = useDrawerOverlay();
|
|
6365
6405
|
if (!modalVisible) return null;
|
|
6406
|
+
if (!backdrop) {
|
|
6407
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6408
|
+
children,
|
|
6409
|
+
topContent
|
|
6410
|
+
] });
|
|
6411
|
+
}
|
|
6366
6412
|
return /* @__PURE__ */ jsx(
|
|
6367
6413
|
Modal,
|
|
6368
6414
|
{
|
|
@@ -6373,16 +6419,23 @@ var DrawerPortal = ({ children, topContent }) => {
|
|
|
6373
6419
|
onRequestClose: closeDrawer,
|
|
6374
6420
|
children: /* @__PURE__ */ jsxs(View, { style: styles3.modalContainer, children: [
|
|
6375
6421
|
children,
|
|
6376
|
-
topContent
|
|
6422
|
+
topContent,
|
|
6423
|
+
OverlayComponent ? /* @__PURE__ */ jsx(OverlayComponent, {}) : null
|
|
6377
6424
|
] })
|
|
6378
6425
|
}
|
|
6379
6426
|
);
|
|
6380
6427
|
};
|
|
6381
6428
|
DrawerPortal.displayName = "Drawer.Portal";
|
|
6429
|
+
var DrawerOverlayProvider = ({
|
|
6430
|
+
component,
|
|
6431
|
+
children
|
|
6432
|
+
}) => /* @__PURE__ */ jsx(DrawerOverlayContext.Provider, { value: component, children });
|
|
6433
|
+
DrawerOverlayProvider.displayName = "Drawer.OverlayProvider";
|
|
6382
6434
|
var Drawer = Object.assign(DrawerRoot, {
|
|
6383
6435
|
Root: DrawerRoot,
|
|
6384
6436
|
Trigger: DrawerTrigger,
|
|
6385
6437
|
Portal: DrawerPortal,
|
|
6438
|
+
OverlayProvider: DrawerOverlayProvider,
|
|
6386
6439
|
Overlay: DrawerOverlay,
|
|
6387
6440
|
Content: DrawerContent,
|
|
6388
6441
|
Grabber: DrawerGrabber,
|