@butternutbox/pawprint-native 1.1.2 → 1.2.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 +12 -0
- package/dist/index.cjs +269 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +92 -5
- package/dist/index.d.ts +92 -5
- package/dist/index.js +270 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/Illustration/Illustration.tsx +0 -4
- package/src/components/molecules/FloatingActionButton/FloatingActionButton.stories.tsx +304 -0
- package/src/components/molecules/FloatingActionButton/FloatingActionButton.tsx +445 -0
- package/src/components/molecules/FloatingActionButton/index.ts +7 -0
- package/src/components/molecules/index.ts +1 -0
package/dist/index.d.cts
CHANGED
|
@@ -443,17 +443,13 @@ type IllustrationProps = IllustrationOwnProps & Omit<ViewProps, keyof Illustrati
|
|
|
443
443
|
* ```
|
|
444
444
|
*
|
|
445
445
|
* @param illustration - **(required)** Illustration component
|
|
446
|
-
<<<<<<< Updated upstream
|
|
447
446
|
* @param size - *(optional)* Size variant: sm (default), lg, xl, xxl, xxxl
|
|
448
|
-
=======
|
|
449
|
-
* @param size - *(optional)* Size variant: sm (default), lg, xl
|
|
450
447
|
* @param align - *(optional)* Flexbox alignItems (default: center)
|
|
451
448
|
* @param justify - *(optional)* Flexbox justifyContent (default: center)
|
|
452
449
|
* @param flexDirection - *(optional)* Flexbox flex direction
|
|
453
450
|
* @param flexWrap - *(optional)* Flexbox wrap
|
|
454
451
|
* @param alignContent - *(optional)* Flexbox alignContent
|
|
455
452
|
* @param alignSelf - *(optional)* Flexbox alignSelf
|
|
456
|
-
>>>>>>> Stashed changes
|
|
457
453
|
* @param aria-label - *(optional)* Accessible label
|
|
458
454
|
*/
|
|
459
455
|
declare const Illustration: React.ForwardRefExoticComponent<{
|
|
@@ -2529,8 +2525,99 @@ type TabNavigationComponent = React.ForwardRefExoticComponent<TabNavigationProps
|
|
|
2529
2525
|
};
|
|
2530
2526
|
declare const TabNavigation: TabNavigationComponent;
|
|
2531
2527
|
|
|
2528
|
+
type FloatingActionButtonVariant = "primary" | "secondary";
|
|
2529
|
+
type FloatingActionButtonIconButtonIcon = "chevronUp" | "chevronRight" | "close";
|
|
2530
|
+
type FloatingActionButtonAnimation = "shine" | "nudge";
|
|
2531
|
+
type FloatingActionButtonBaseProps = {
|
|
2532
|
+
variant?: FloatingActionButtonVariant;
|
|
2533
|
+
icon?: PawprintIcon;
|
|
2534
|
+
children: React.ReactNode;
|
|
2535
|
+
linkLabel: string;
|
|
2536
|
+
animation?: FloatingActionButtonAnimation;
|
|
2537
|
+
};
|
|
2538
|
+
type FloatingActionButtonLinkProps = {
|
|
2539
|
+
linkHref: string;
|
|
2540
|
+
onLinkPress?: () => void;
|
|
2541
|
+
} | {
|
|
2542
|
+
linkHref?: string;
|
|
2543
|
+
onLinkPress: () => void;
|
|
2544
|
+
};
|
|
2545
|
+
type FloatingActionButtonIconButtonProps = {
|
|
2546
|
+
iconButtonIcon: FloatingActionButtonIconButtonIcon;
|
|
2547
|
+
iconButtonLabel: string;
|
|
2548
|
+
iconButtonVariant?: IconButtonVariant;
|
|
2549
|
+
onIconButtonPress?: () => void;
|
|
2550
|
+
};
|
|
2551
|
+
type FloatingActionButtonOwnProps = FloatingActionButtonBaseProps & FloatingActionButtonLinkProps & FloatingActionButtonIconButtonProps;
|
|
2552
|
+
type FloatingActionButtonProps = FloatingActionButtonOwnProps & Omit<ViewProps, keyof FloatingActionButtonBaseProps | "iconButtonIcon">;
|
|
2553
|
+
/**
|
|
2554
|
+
* Floating pill that surfaces a short message with a link and an
|
|
2555
|
+
* icon button. Used for persistent prompts such as offers and
|
|
2556
|
+
* reminders.
|
|
2557
|
+
*
|
|
2558
|
+
* The component does not position itself — the consumer is responsible for
|
|
2559
|
+
* placing it (e.g. `position: "absolute"` at the bottom right) so it can avoid
|
|
2560
|
+
* other floating elements on the screen. It fills the width of its container.
|
|
2561
|
+
*
|
|
2562
|
+
* The icon button is always size `md` and limited to three icons: `chevronUp`,
|
|
2563
|
+
* `chevronRight` and `close`. Its style defaults to the Figma pairing —
|
|
2564
|
+
* `filled` (primary) for the chevrons and `text` for `close` — and can be
|
|
2565
|
+
* overridden with `iconButtonVariant`.
|
|
2566
|
+
*
|
|
2567
|
+
* Note: Unlike the web version, handlers are `onLinkPress` and
|
|
2568
|
+
* `onIconButtonPress` (web: `onLinkClick` / `onIconButtonClick`). The shadow
|
|
2569
|
+
* uses `boxShadow`, which requires React Native 0.76+ (New Architecture).
|
|
2570
|
+
*
|
|
2571
|
+
* @param {"primary" | "secondary"} [variant="primary"] - Colour scheme.
|
|
2572
|
+
* `primary` is pink with a white icon container; `secondary` is white with a
|
|
2573
|
+
* cream icon container.
|
|
2574
|
+
* @param {PawprintIcon} [icon=Gift] - Icon shown in the circular container on
|
|
2575
|
+
* the left. Rendered at size `xl` in the primary icon colour.
|
|
2576
|
+
* @param {React.ReactNode} children - Message copy. Nest a bold `Typography`
|
|
2577
|
+
* to emphasise part of it.
|
|
2578
|
+
* @param {string} linkLabel - Link text shown below the message. Use "Close"
|
|
2579
|
+
* to dismiss, or e.g. "See more" when the icon button is `close`.
|
|
2580
|
+
* @param {string} [linkHref] - **(required without `onLinkPress`)** URL opened
|
|
2581
|
+
* via `Linking` when pressed.
|
|
2582
|
+
* @param {() => void} [onLinkPress] - **(required without `linkHref`)** Link
|
|
2583
|
+
* press handler, e.g. to dismiss, navigate to a screen or open a Modal or
|
|
2584
|
+
* Drawer. Takes precedence over `linkHref`.
|
|
2585
|
+
* @param {"shine" | "nudge"} [animation] - Optional attention animation, off
|
|
2586
|
+
* by default. Runs 3 times after a short delay, then stops, and is disabled
|
|
2587
|
+
* when the user prefers reduced motion. `shine` sweeps a soft highlight
|
|
2588
|
+
* across the pill; `nudge` moves the chevron towards its direction (no effect
|
|
2589
|
+
* with `close`).
|
|
2590
|
+
* @param {"chevronUp" | "chevronRight" | "close"} iconButtonIcon - Icon button
|
|
2591
|
+
* on the right.
|
|
2592
|
+
* @param {"filled" | "outlined" | "text"} [iconButtonVariant] - Icon button
|
|
2593
|
+
* style. Defaults to `filled` for `chevronUp` / `chevronRight` and `text`
|
|
2594
|
+
* for `close`.
|
|
2595
|
+
* @param {string} iconButtonLabel - Accessible label for the icon button.
|
|
2596
|
+
* @param {() => void} [onIconButtonPress] - Icon button press handler.
|
|
2597
|
+
*
|
|
2598
|
+
* @example
|
|
2599
|
+
* ```tsx
|
|
2600
|
+
* import { FloatingActionButton, Typography } from "@butternutbox/pawprint-native"
|
|
2601
|
+
*
|
|
2602
|
+
* <FloatingActionButton
|
|
2603
|
+
* variant="primary"
|
|
2604
|
+
* linkLabel="Close"
|
|
2605
|
+
* onLinkPress={dismiss}
|
|
2606
|
+
* iconButtonIcon="chevronUp"
|
|
2607
|
+
* iconButtonLabel="View offer"
|
|
2608
|
+
* onIconButtonPress={openDrawer}
|
|
2609
|
+
* >
|
|
2610
|
+
* <Typography size="lg" weight="bold">
|
|
2611
|
+
* Free
|
|
2612
|
+
* </Typography>{" "}
|
|
2613
|
+
* gift in your next box
|
|
2614
|
+
* </FloatingActionButton>
|
|
2615
|
+
* ```
|
|
2616
|
+
*/
|
|
2617
|
+
declare const FloatingActionButton: React.ForwardRefExoticComponent<FloatingActionButtonProps & React.RefAttributes<View>>;
|
|
2618
|
+
|
|
2532
2619
|
declare const useDrawerKeyboardAvoidance: (minPadding?: number) => {
|
|
2533
2620
|
contentContainerStyle: StyleProp<ViewStyle>;
|
|
2534
2621
|
};
|
|
2535
2622
|
|
|
2536
|
-
export { Accordion, type AccordionItemProps, type AccordionProps, type AccordionSize, Animated, type AnimatedProps, type AnimatedVariant, Avatar, type AvatarFallbackType, type AvatarProps, type AvatarSize, 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, PROGRESS_ANIMATION, 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, type SelectFieldSearchResult, 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, resolveLogo, scaleAnimation, slideInAnimation, slideOutAnimation, theme, useCopyField, useDrawerKeyboardAvoidance, usePasswordField, usePawprint, useSearchField, useSelectField };
|
|
2623
|
+
export { Accordion, type AccordionItemProps, type AccordionProps, type AccordionSize, Animated, type AnimatedProps, type AnimatedVariant, Avatar, type AvatarFallbackType, type AvatarProps, type AvatarSize, 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, FloatingActionButton, type FloatingActionButtonAnimation, type FloatingActionButtonIconButtonIcon, type FloatingActionButtonProps, type FloatingActionButtonVariant, 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, PROGRESS_ANIMATION, 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, type SelectFieldSearchResult, 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, resolveLogo, scaleAnimation, slideInAnimation, slideOutAnimation, theme, useCopyField, useDrawerKeyboardAvoidance, usePasswordField, usePawprint, useSearchField, useSelectField };
|
package/dist/index.d.ts
CHANGED
|
@@ -443,17 +443,13 @@ type IllustrationProps = IllustrationOwnProps & Omit<ViewProps, keyof Illustrati
|
|
|
443
443
|
* ```
|
|
444
444
|
*
|
|
445
445
|
* @param illustration - **(required)** Illustration component
|
|
446
|
-
<<<<<<< Updated upstream
|
|
447
446
|
* @param size - *(optional)* Size variant: sm (default), lg, xl, xxl, xxxl
|
|
448
|
-
=======
|
|
449
|
-
* @param size - *(optional)* Size variant: sm (default), lg, xl
|
|
450
447
|
* @param align - *(optional)* Flexbox alignItems (default: center)
|
|
451
448
|
* @param justify - *(optional)* Flexbox justifyContent (default: center)
|
|
452
449
|
* @param flexDirection - *(optional)* Flexbox flex direction
|
|
453
450
|
* @param flexWrap - *(optional)* Flexbox wrap
|
|
454
451
|
* @param alignContent - *(optional)* Flexbox alignContent
|
|
455
452
|
* @param alignSelf - *(optional)* Flexbox alignSelf
|
|
456
|
-
>>>>>>> Stashed changes
|
|
457
453
|
* @param aria-label - *(optional)* Accessible label
|
|
458
454
|
*/
|
|
459
455
|
declare const Illustration: React.ForwardRefExoticComponent<{
|
|
@@ -2529,8 +2525,99 @@ type TabNavigationComponent = React.ForwardRefExoticComponent<TabNavigationProps
|
|
|
2529
2525
|
};
|
|
2530
2526
|
declare const TabNavigation: TabNavigationComponent;
|
|
2531
2527
|
|
|
2528
|
+
type FloatingActionButtonVariant = "primary" | "secondary";
|
|
2529
|
+
type FloatingActionButtonIconButtonIcon = "chevronUp" | "chevronRight" | "close";
|
|
2530
|
+
type FloatingActionButtonAnimation = "shine" | "nudge";
|
|
2531
|
+
type FloatingActionButtonBaseProps = {
|
|
2532
|
+
variant?: FloatingActionButtonVariant;
|
|
2533
|
+
icon?: PawprintIcon;
|
|
2534
|
+
children: React.ReactNode;
|
|
2535
|
+
linkLabel: string;
|
|
2536
|
+
animation?: FloatingActionButtonAnimation;
|
|
2537
|
+
};
|
|
2538
|
+
type FloatingActionButtonLinkProps = {
|
|
2539
|
+
linkHref: string;
|
|
2540
|
+
onLinkPress?: () => void;
|
|
2541
|
+
} | {
|
|
2542
|
+
linkHref?: string;
|
|
2543
|
+
onLinkPress: () => void;
|
|
2544
|
+
};
|
|
2545
|
+
type FloatingActionButtonIconButtonProps = {
|
|
2546
|
+
iconButtonIcon: FloatingActionButtonIconButtonIcon;
|
|
2547
|
+
iconButtonLabel: string;
|
|
2548
|
+
iconButtonVariant?: IconButtonVariant;
|
|
2549
|
+
onIconButtonPress?: () => void;
|
|
2550
|
+
};
|
|
2551
|
+
type FloatingActionButtonOwnProps = FloatingActionButtonBaseProps & FloatingActionButtonLinkProps & FloatingActionButtonIconButtonProps;
|
|
2552
|
+
type FloatingActionButtonProps = FloatingActionButtonOwnProps & Omit<ViewProps, keyof FloatingActionButtonBaseProps | "iconButtonIcon">;
|
|
2553
|
+
/**
|
|
2554
|
+
* Floating pill that surfaces a short message with a link and an
|
|
2555
|
+
* icon button. Used for persistent prompts such as offers and
|
|
2556
|
+
* reminders.
|
|
2557
|
+
*
|
|
2558
|
+
* The component does not position itself — the consumer is responsible for
|
|
2559
|
+
* placing it (e.g. `position: "absolute"` at the bottom right) so it can avoid
|
|
2560
|
+
* other floating elements on the screen. It fills the width of its container.
|
|
2561
|
+
*
|
|
2562
|
+
* The icon button is always size `md` and limited to three icons: `chevronUp`,
|
|
2563
|
+
* `chevronRight` and `close`. Its style defaults to the Figma pairing —
|
|
2564
|
+
* `filled` (primary) for the chevrons and `text` for `close` — and can be
|
|
2565
|
+
* overridden with `iconButtonVariant`.
|
|
2566
|
+
*
|
|
2567
|
+
* Note: Unlike the web version, handlers are `onLinkPress` and
|
|
2568
|
+
* `onIconButtonPress` (web: `onLinkClick` / `onIconButtonClick`). The shadow
|
|
2569
|
+
* uses `boxShadow`, which requires React Native 0.76+ (New Architecture).
|
|
2570
|
+
*
|
|
2571
|
+
* @param {"primary" | "secondary"} [variant="primary"] - Colour scheme.
|
|
2572
|
+
* `primary` is pink with a white icon container; `secondary` is white with a
|
|
2573
|
+
* cream icon container.
|
|
2574
|
+
* @param {PawprintIcon} [icon=Gift] - Icon shown in the circular container on
|
|
2575
|
+
* the left. Rendered at size `xl` in the primary icon colour.
|
|
2576
|
+
* @param {React.ReactNode} children - Message copy. Nest a bold `Typography`
|
|
2577
|
+
* to emphasise part of it.
|
|
2578
|
+
* @param {string} linkLabel - Link text shown below the message. Use "Close"
|
|
2579
|
+
* to dismiss, or e.g. "See more" when the icon button is `close`.
|
|
2580
|
+
* @param {string} [linkHref] - **(required without `onLinkPress`)** URL opened
|
|
2581
|
+
* via `Linking` when pressed.
|
|
2582
|
+
* @param {() => void} [onLinkPress] - **(required without `linkHref`)** Link
|
|
2583
|
+
* press handler, e.g. to dismiss, navigate to a screen or open a Modal or
|
|
2584
|
+
* Drawer. Takes precedence over `linkHref`.
|
|
2585
|
+
* @param {"shine" | "nudge"} [animation] - Optional attention animation, off
|
|
2586
|
+
* by default. Runs 3 times after a short delay, then stops, and is disabled
|
|
2587
|
+
* when the user prefers reduced motion. `shine` sweeps a soft highlight
|
|
2588
|
+
* across the pill; `nudge` moves the chevron towards its direction (no effect
|
|
2589
|
+
* with `close`).
|
|
2590
|
+
* @param {"chevronUp" | "chevronRight" | "close"} iconButtonIcon - Icon button
|
|
2591
|
+
* on the right.
|
|
2592
|
+
* @param {"filled" | "outlined" | "text"} [iconButtonVariant] - Icon button
|
|
2593
|
+
* style. Defaults to `filled` for `chevronUp` / `chevronRight` and `text`
|
|
2594
|
+
* for `close`.
|
|
2595
|
+
* @param {string} iconButtonLabel - Accessible label for the icon button.
|
|
2596
|
+
* @param {() => void} [onIconButtonPress] - Icon button press handler.
|
|
2597
|
+
*
|
|
2598
|
+
* @example
|
|
2599
|
+
* ```tsx
|
|
2600
|
+
* import { FloatingActionButton, Typography } from "@butternutbox/pawprint-native"
|
|
2601
|
+
*
|
|
2602
|
+
* <FloatingActionButton
|
|
2603
|
+
* variant="primary"
|
|
2604
|
+
* linkLabel="Close"
|
|
2605
|
+
* onLinkPress={dismiss}
|
|
2606
|
+
* iconButtonIcon="chevronUp"
|
|
2607
|
+
* iconButtonLabel="View offer"
|
|
2608
|
+
* onIconButtonPress={openDrawer}
|
|
2609
|
+
* >
|
|
2610
|
+
* <Typography size="lg" weight="bold">
|
|
2611
|
+
* Free
|
|
2612
|
+
* </Typography>{" "}
|
|
2613
|
+
* gift in your next box
|
|
2614
|
+
* </FloatingActionButton>
|
|
2615
|
+
* ```
|
|
2616
|
+
*/
|
|
2617
|
+
declare const FloatingActionButton: React.ForwardRefExoticComponent<FloatingActionButtonProps & React.RefAttributes<View>>;
|
|
2618
|
+
|
|
2532
2619
|
declare const useDrawerKeyboardAvoidance: (minPadding?: number) => {
|
|
2533
2620
|
contentContainerStyle: StyleProp<ViewStyle>;
|
|
2534
2621
|
};
|
|
2535
2622
|
|
|
2536
|
-
export { Accordion, type AccordionItemProps, type AccordionProps, type AccordionSize, Animated, type AnimatedProps, type AnimatedVariant, Avatar, type AvatarFallbackType, type AvatarProps, type AvatarSize, 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, PROGRESS_ANIMATION, 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, type SelectFieldSearchResult, 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, resolveLogo, scaleAnimation, slideInAnimation, slideOutAnimation, theme, useCopyField, useDrawerKeyboardAvoidance, usePasswordField, usePawprint, useSearchField, useSelectField };
|
|
2623
|
+
export { Accordion, type AccordionItemProps, type AccordionProps, type AccordionSize, Animated, type AnimatedProps, type AnimatedVariant, Avatar, type AvatarFallbackType, type AvatarProps, type AvatarSize, 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, FloatingActionButton, type FloatingActionButtonAnimation, type FloatingActionButtonIconButtonIcon, type FloatingActionButtonProps, type FloatingActionButtonVariant, 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, PROGRESS_ANIMATION, 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, type SelectFieldSearchResult, 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, resolveLogo, scaleAnimation, slideInAnimation, slideOutAnimation, theme, useCopyField, useDrawerKeyboardAvoidance, usePasswordField, usePawprint, useSearchField, useSelectField };
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import * as AvatarPrimitive from '@rn-primitives/avatar';
|
|
|
11
11
|
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';
|
|
12
12
|
import Svg, { Path, Defs, LinearGradient, Stop, Rect, G, ClipPath } from 'react-native-svg';
|
|
13
13
|
import * as SwitchPrimitive from '@rn-primitives/switch';
|
|
14
|
-
import Animated10, { Keyframe, Easing as Easing$1, FadeInLeft, FadeInRight, FadeInUp, FadeInDown, FadeIn, FadeOutLeft, FadeOutRight, FadeOutUp, FadeOutDown, FadeOut, useReducedMotion, useSharedValue, withTiming, useAnimatedStyle, ComplexAnimationBuilder, withSpring } from 'react-native-reanimated';
|
|
14
|
+
import Animated10, { Keyframe, Easing as Easing$1, FadeInLeft, FadeInRight, FadeInUp, FadeInDown, FadeIn, FadeOutLeft, FadeOutRight, FadeOutUp, FadeOutDown, FadeOut, useReducedMotion, useSharedValue, withTiming, useAnimatedStyle, ComplexAnimationBuilder, withSpring, withDelay, withRepeat, withSequence } from 'react-native-reanimated';
|
|
15
15
|
import { Slot } from '@rn-primitives/slot';
|
|
16
16
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
17
17
|
import * as ProgressPrimitive from '@rn-primitives/progress';
|
|
@@ -522,6 +522,7 @@ var Gift = (props, ref) => {
|
|
|
522
522
|
};
|
|
523
523
|
var ForwardRef29 = forwardRef(Gift);
|
|
524
524
|
ForwardRef29.category = "core";
|
|
525
|
+
var Gift_default = ForwardRef29;
|
|
525
526
|
var HelpOutline = (props, ref) => {
|
|
526
527
|
var _a, _b;
|
|
527
528
|
return /* @__PURE__ */ jsx(Svg, __spreadProps2(__spreadValues2(__spreadProps2(__spreadValues2({ xmlns: "http://www.w3.org/2000/svg", width: (_a = props.width) != null ? _a : 24, height: (_b = props.height) != null ? _b : 24 }, { fill: props.color || "currentColor" }), { viewBox: "0 0 24 24", ref }), props), { children: /* @__PURE__ */ jsx(Path, { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m-1-4h2v2h-2zm1.61-9.96c-2.06-.3-3.88.97-4.43 2.79-.18.58.26 1.17.87 1.17h.2c.41 0 .74-.29.88-.67.32-.89 1.27-1.5 2.3-1.28.95.2 1.65 1.13 1.57 2.1-.1 1.34-1.62 1.63-2.45 2.88 0 .01-.01.01-.01.02-.01.02-.02.03-.03.05-.09.15-.18.32-.25.5-.01.03-.03.05-.04.08-.01.02-.01.04-.02.07-.12.34-.2.75-.2 1.25h2c0-.42.11-.77.28-1.07.02-.03.03-.06.05-.09.08-.14.18-.27.28-.39.01-.01.02-.03.03-.04.1-.12.21-.23.33-.34.96-.91 2.26-1.65 1.99-3.56-.24-1.74-1.61-3.21-3.35-3.47" }) }));
|
|
@@ -592,6 +593,7 @@ var KeyboardArrowUp = (props, ref) => {
|
|
|
592
593
|
};
|
|
593
594
|
var ForwardRef39 = forwardRef(KeyboardArrowUp);
|
|
594
595
|
ForwardRef39.category = "core";
|
|
596
|
+
var KeyboardArrowUp_default = ForwardRef39;
|
|
595
597
|
var KeyboardDoubleArrowDown = (props, ref) => {
|
|
596
598
|
var _a, _b;
|
|
597
599
|
return /* @__PURE__ */ jsx(Svg, __spreadProps2(__spreadValues2(__spreadProps2(__spreadValues2({ xmlns: "http://www.w3.org/2000/svg", width: (_a = props.width) != null ? _a : 24, height: (_b = props.height) != null ? _b : 24 }, { fill: props.color || "currentColor" }), { viewBox: "0 0 24 24", ref }), props), { children: /* @__PURE__ */ jsx(Path, { fillRule: "evenodd", d: "M6.702 12.282a.996.996 0 0 1 1.41 0l3.88 3.88 3.88-3.87a.996.996 0 0 1 1.41 0c.39.39.39 1.02.01 1.4l-4.59 4.59a.996.996 0 0 1-1.41 0l-4.59-4.59a.996.996 0 0 1 0-1.41m-.01-6.59a.995.995 0 0 1 1.41 0l3.89 3.88 3.88-3.87a.996.996 0 0 1 1.41 0c.39.39.39 1.02 0 1.4l-4.59 4.59a.997.997 0 0 1-1.41 0l-4.59-4.59a.995.995 0 0 1 0-1.41", clipRule: "evenodd" }) }));
|
|
@@ -12534,7 +12536,273 @@ var TabNavigation = Object.assign(TabNavigationRoot, {
|
|
|
12534
12536
|
Tab: TabNavigationTab,
|
|
12535
12537
|
Panel: TabNavigationPanel
|
|
12536
12538
|
});
|
|
12539
|
+
var parseTokenValue62 = (value) => parseFloat(value);
|
|
12540
|
+
var ICON_BUTTON_CONFIG = {
|
|
12541
|
+
chevronUp: { icon: KeyboardArrowUp_default, defaultVariant: "filled" },
|
|
12542
|
+
chevronRight: { icon: KeyboardArrowRight_default, defaultVariant: "filled" },
|
|
12543
|
+
close: { icon: Close_default, defaultVariant: "text" }
|
|
12544
|
+
};
|
|
12545
|
+
var ANIMATION_DELAY = 1500;
|
|
12546
|
+
var ANIMATION_ITERATIONS = 3;
|
|
12547
|
+
var SHINE_SWEEP = 1100;
|
|
12548
|
+
var SHINE_REST = 4900;
|
|
12549
|
+
var SHINE_BAND_RATIO = 0.4;
|
|
12550
|
+
var SHINE_OPACITY = 0.55;
|
|
12551
|
+
var NUDGE_STEP = 200;
|
|
12552
|
+
var NUDGE_REST = 3200;
|
|
12553
|
+
var NUDGE_DISTANCE = 3;
|
|
12554
|
+
var ShineOverlay = ({
|
|
12555
|
+
radius,
|
|
12556
|
+
highlight
|
|
12557
|
+
}) => {
|
|
12558
|
+
const reducedMotion = useReducedMotion();
|
|
12559
|
+
const [width, setWidth] = React66.useState(0);
|
|
12560
|
+
const progress = useSharedValue(0);
|
|
12561
|
+
const bandWidth = width * SHINE_BAND_RATIO;
|
|
12562
|
+
React66.useEffect(() => {
|
|
12563
|
+
if (reducedMotion || !width) return;
|
|
12564
|
+
progress.value = withDelay(
|
|
12565
|
+
ANIMATION_DELAY,
|
|
12566
|
+
withRepeat(
|
|
12567
|
+
withSequence(
|
|
12568
|
+
withTiming(1, {
|
|
12569
|
+
duration: SHINE_SWEEP,
|
|
12570
|
+
easing: Easing$1.inOut(Easing$1.ease)
|
|
12571
|
+
}),
|
|
12572
|
+
withDelay(SHINE_REST, withTiming(0, { duration: 0 }))
|
|
12573
|
+
),
|
|
12574
|
+
ANIMATION_ITERATIONS
|
|
12575
|
+
)
|
|
12576
|
+
);
|
|
12577
|
+
}, [progress, reducedMotion, width]);
|
|
12578
|
+
const bandStyle = useAnimatedStyle(() => ({
|
|
12579
|
+
transform: [
|
|
12580
|
+
{
|
|
12581
|
+
translateX: -bandWidth * 1.5 + progress.value * (width + bandWidth * 2.5)
|
|
12582
|
+
},
|
|
12583
|
+
{ skewX: "-20deg" }
|
|
12584
|
+
]
|
|
12585
|
+
}));
|
|
12586
|
+
if (reducedMotion) return null;
|
|
12587
|
+
return /* @__PURE__ */ jsx(
|
|
12588
|
+
View,
|
|
12589
|
+
{
|
|
12590
|
+
pointerEvents: "none",
|
|
12591
|
+
accessible: false,
|
|
12592
|
+
importantForAccessibility: "no-hide-descendants",
|
|
12593
|
+
onLayout: (e) => setWidth(e.nativeEvent.layout.width),
|
|
12594
|
+
style: [
|
|
12595
|
+
StyleSheet.absoluteFill,
|
|
12596
|
+
{ borderRadius: radius, overflow: "hidden" }
|
|
12597
|
+
],
|
|
12598
|
+
children: width > 0 && /* @__PURE__ */ jsx(
|
|
12599
|
+
Animated10.View,
|
|
12600
|
+
{
|
|
12601
|
+
style: [
|
|
12602
|
+
{ position: "absolute", top: 0, bottom: 0, width: bandWidth },
|
|
12603
|
+
bandStyle
|
|
12604
|
+
],
|
|
12605
|
+
children: /* @__PURE__ */ jsxs(Svg, { width: "100%", height: "100%", children: [
|
|
12606
|
+
/* @__PURE__ */ jsx(Defs, { children: /* @__PURE__ */ jsxs(LinearGradient, { id: "fabShine", x1: "0", y1: "0", x2: "1", y2: "0", children: [
|
|
12607
|
+
/* @__PURE__ */ jsx(Stop, { offset: "0", stopColor: highlight, stopOpacity: 0 }),
|
|
12608
|
+
/* @__PURE__ */ jsx(
|
|
12609
|
+
Stop,
|
|
12610
|
+
{
|
|
12611
|
+
offset: "0.5",
|
|
12612
|
+
stopColor: highlight,
|
|
12613
|
+
stopOpacity: SHINE_OPACITY
|
|
12614
|
+
}
|
|
12615
|
+
),
|
|
12616
|
+
/* @__PURE__ */ jsx(Stop, { offset: "1", stopColor: highlight, stopOpacity: 0 })
|
|
12617
|
+
] }) }),
|
|
12618
|
+
/* @__PURE__ */ jsx(Rect, { width: "100%", height: "100%", fill: "url(#fabShine)" })
|
|
12619
|
+
] })
|
|
12620
|
+
}
|
|
12621
|
+
)
|
|
12622
|
+
}
|
|
12623
|
+
);
|
|
12624
|
+
};
|
|
12625
|
+
var createNudgingIcon = (IconComponent, axis, direction) => {
|
|
12626
|
+
var _a;
|
|
12627
|
+
const NudgingIcon = (props) => {
|
|
12628
|
+
const reducedMotion = useReducedMotion();
|
|
12629
|
+
const offset = useSharedValue(0);
|
|
12630
|
+
React66.useEffect(() => {
|
|
12631
|
+
if (reducedMotion) return;
|
|
12632
|
+
const step = (to) => withTiming(to, {
|
|
12633
|
+
duration: NUDGE_STEP,
|
|
12634
|
+
easing: Easing$1.inOut(Easing$1.ease)
|
|
12635
|
+
});
|
|
12636
|
+
const distance = NUDGE_DISTANCE * direction;
|
|
12637
|
+
offset.value = withDelay(
|
|
12638
|
+
ANIMATION_DELAY,
|
|
12639
|
+
withRepeat(
|
|
12640
|
+
withSequence(
|
|
12641
|
+
step(distance),
|
|
12642
|
+
step(0),
|
|
12643
|
+
step(distance),
|
|
12644
|
+
step(0),
|
|
12645
|
+
withDelay(NUDGE_REST, withTiming(0, { duration: 0 }))
|
|
12646
|
+
),
|
|
12647
|
+
ANIMATION_ITERATIONS
|
|
12648
|
+
)
|
|
12649
|
+
);
|
|
12650
|
+
}, [offset, reducedMotion]);
|
|
12651
|
+
const nudgeStyle = useAnimatedStyle(
|
|
12652
|
+
() => axis === "translateX" ? { transform: [{ translateX: offset.value }] } : { transform: [{ translateY: offset.value }] }
|
|
12653
|
+
);
|
|
12654
|
+
return /* @__PURE__ */ jsx(Animated10.View, { style: nudgeStyle, children: /* @__PURE__ */ jsx(IconComponent, __spreadValues({}, props)) });
|
|
12655
|
+
};
|
|
12656
|
+
NudgingIcon.displayName = `Nudging(${(_a = IconComponent.displayName) != null ? _a : "Icon"})`;
|
|
12657
|
+
return NudgingIcon;
|
|
12658
|
+
};
|
|
12659
|
+
var NUDGE_ICONS = {
|
|
12660
|
+
chevronUp: createNudgingIcon(KeyboardArrowUp_default, "translateY", -1),
|
|
12661
|
+
chevronRight: createNudgingIcon(KeyboardArrowRight_default, "translateX", 1)
|
|
12662
|
+
};
|
|
12663
|
+
var StyledRoot18 = styled51(View)(
|
|
12664
|
+
({
|
|
12665
|
+
rootGap,
|
|
12666
|
+
rootPaddingH,
|
|
12667
|
+
rootPaddingV,
|
|
12668
|
+
rootBgColor,
|
|
12669
|
+
rootBorderWidth,
|
|
12670
|
+
rootBorderColor,
|
|
12671
|
+
rootBorderRadius,
|
|
12672
|
+
rootBoxShadow
|
|
12673
|
+
}) => ({
|
|
12674
|
+
flexDirection: "row",
|
|
12675
|
+
alignItems: "center",
|
|
12676
|
+
width: "100%",
|
|
12677
|
+
gap: rootGap,
|
|
12678
|
+
paddingHorizontal: rootPaddingH,
|
|
12679
|
+
paddingVertical: rootPaddingV,
|
|
12680
|
+
backgroundColor: rootBgColor,
|
|
12681
|
+
borderWidth: rootBorderWidth,
|
|
12682
|
+
borderColor: rootBorderColor,
|
|
12683
|
+
borderRadius: rootBorderRadius,
|
|
12684
|
+
boxShadow: rootBoxShadow
|
|
12685
|
+
})
|
|
12686
|
+
);
|
|
12687
|
+
var StyledIconContainer = styled51(View)(({ containerSize, containerRadius, containerBgColor }) => ({
|
|
12688
|
+
alignItems: "center",
|
|
12689
|
+
justifyContent: "center",
|
|
12690
|
+
flexShrink: 0,
|
|
12691
|
+
width: containerSize,
|
|
12692
|
+
height: containerSize,
|
|
12693
|
+
borderRadius: containerRadius,
|
|
12694
|
+
backgroundColor: containerBgColor
|
|
12695
|
+
}));
|
|
12696
|
+
var StyledContent3 = styled51(View)({
|
|
12697
|
+
flex: 1,
|
|
12698
|
+
minWidth: 0,
|
|
12699
|
+
alignItems: "flex-start",
|
|
12700
|
+
justifyContent: "center"
|
|
12701
|
+
});
|
|
12702
|
+
var FloatingActionButton = React66.forwardRef(
|
|
12703
|
+
(_a, ref) => {
|
|
12704
|
+
var _b = _a, {
|
|
12705
|
+
variant = "primary",
|
|
12706
|
+
icon = Gift_default,
|
|
12707
|
+
children,
|
|
12708
|
+
linkLabel,
|
|
12709
|
+
linkHref,
|
|
12710
|
+
onLinkPress,
|
|
12711
|
+
animation,
|
|
12712
|
+
iconButtonIcon,
|
|
12713
|
+
iconButtonLabel,
|
|
12714
|
+
iconButtonVariant,
|
|
12715
|
+
onIconButtonPress
|
|
12716
|
+
} = _b, rest = __objRest(_b, [
|
|
12717
|
+
"variant",
|
|
12718
|
+
"icon",
|
|
12719
|
+
"children",
|
|
12720
|
+
"linkLabel",
|
|
12721
|
+
"linkHref",
|
|
12722
|
+
"onLinkPress",
|
|
12723
|
+
"animation",
|
|
12724
|
+
"iconButtonIcon",
|
|
12725
|
+
"iconButtonLabel",
|
|
12726
|
+
"iconButtonVariant",
|
|
12727
|
+
"onIconButtonPress"
|
|
12728
|
+
]);
|
|
12729
|
+
const theme2 = useTheme();
|
|
12730
|
+
const { floatingActionButton } = theme2.tokens.components;
|
|
12731
|
+
const { colour, dimensions: dimensions3 } = theme2.tokens.semantics;
|
|
12732
|
+
const { shadow } = colour;
|
|
12733
|
+
const iconButton = ICON_BUTTON_CONFIG[iconButtonIcon];
|
|
12734
|
+
const iconButtonElement = /* @__PURE__ */ jsx(
|
|
12735
|
+
IconButton,
|
|
12736
|
+
{
|
|
12737
|
+
icon: animation === "nudge" && iconButtonIcon !== "close" ? NUDGE_ICONS[iconButtonIcon] : iconButton.icon,
|
|
12738
|
+
variant: iconButtonVariant != null ? iconButtonVariant : iconButton.defaultVariant,
|
|
12739
|
+
size: "md",
|
|
12740
|
+
"aria-label": iconButtonLabel,
|
|
12741
|
+
onPress: onIconButtonPress
|
|
12742
|
+
}
|
|
12743
|
+
);
|
|
12744
|
+
return /* @__PURE__ */ jsxs(
|
|
12745
|
+
StyledRoot18,
|
|
12746
|
+
__spreadProps(__spreadValues({
|
|
12747
|
+
ref,
|
|
12748
|
+
rootGap: parseTokenValue62(floatingActionButton.spacing.gap),
|
|
12749
|
+
rootPaddingH: parseTokenValue62(
|
|
12750
|
+
floatingActionButton.spacing.horizontalPadding
|
|
12751
|
+
),
|
|
12752
|
+
rootPaddingV: parseTokenValue62(
|
|
12753
|
+
floatingActionButton.spacing.verticalPadding
|
|
12754
|
+
),
|
|
12755
|
+
rootBgColor: floatingActionButton.colour.background[variant],
|
|
12756
|
+
rootBorderWidth: parseTokenValue62(
|
|
12757
|
+
floatingActionButton.borderWidth.default
|
|
12758
|
+
),
|
|
12759
|
+
rootBorderColor: floatingActionButton.colour.border[variant],
|
|
12760
|
+
rootBorderRadius: parseTokenValue62(
|
|
12761
|
+
floatingActionButton.borderRadius.default
|
|
12762
|
+
),
|
|
12763
|
+
rootBoxShadow: `${shadow.md.offsetX} ${shadow.md.offsetY} ${shadow.md.blur} ${shadow.md.spread} ${shadow.md.color}`
|
|
12764
|
+
}, rest), {
|
|
12765
|
+
children: [
|
|
12766
|
+
/* @__PURE__ */ jsx(
|
|
12767
|
+
StyledIconContainer,
|
|
12768
|
+
{
|
|
12769
|
+
containerSize: parseTokenValue62(
|
|
12770
|
+
theme2.tokens.primitives.dimension.sizing["44"]
|
|
12771
|
+
),
|
|
12772
|
+
containerRadius: parseTokenValue62(dimensions3.borderRadius.round),
|
|
12773
|
+
containerBgColor: variant === "secondary" ? colour.background.container.secondary : colour.background.container.default,
|
|
12774
|
+
children: /* @__PURE__ */ jsx(Icon, { icon, size: "xl", colour: "primary" })
|
|
12775
|
+
}
|
|
12776
|
+
),
|
|
12777
|
+
/* @__PURE__ */ jsxs(StyledContent3, { children: [
|
|
12778
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body", size: "lg", weight: "medium", children }),
|
|
12779
|
+
/* @__PURE__ */ jsx(
|
|
12780
|
+
Link,
|
|
12781
|
+
__spreadProps(__spreadValues({
|
|
12782
|
+
href: linkHref,
|
|
12783
|
+
onPress: onLinkPress,
|
|
12784
|
+
size: "md",
|
|
12785
|
+
weight: "medium"
|
|
12786
|
+
}, !linkHref && { accessibilityRole: "button" }), {
|
|
12787
|
+
children: linkLabel
|
|
12788
|
+
})
|
|
12789
|
+
)
|
|
12790
|
+
] }),
|
|
12791
|
+
iconButtonElement,
|
|
12792
|
+
animation === "shine" && /* @__PURE__ */ jsx(
|
|
12793
|
+
ShineOverlay,
|
|
12794
|
+
{
|
|
12795
|
+
radius: parseTokenValue62(floatingActionButton.borderRadius.default),
|
|
12796
|
+
highlight: theme2.tokens.primitives.colour.system.neutral["1"]
|
|
12797
|
+
}
|
|
12798
|
+
)
|
|
12799
|
+
]
|
|
12800
|
+
})
|
|
12801
|
+
);
|
|
12802
|
+
}
|
|
12803
|
+
);
|
|
12804
|
+
FloatingActionButton.displayName = "FloatingActionButton";
|
|
12537
12805
|
|
|
12538
|
-
export { Accordion, Animated5 as Animated, Avatar, Badge, Button, ButtonDock, ButtonGroup, CarouselControls, Checkbox, CheckboxGroup, CopyField, CopyFieldInput, Countdown, DatePicker, Divider, Drawer, FilterTab, Hint, Icon, IconButton, Illustration, Input, InputDescription, InputError, InputField, InputLabel, InputText, Link, Logo, Menu2 as Menu, MenuItem, MessageCard, MessageCardBanner, MessageCardInsight, NativeSelectPicker, Notification, NumberField, NumberInput, NumberInputField, PROGRESS_ANIMATION, PasswordField, PasswordFieldInput, PasswordFieldRequirements, PawprintProvider, PictureSelector, ProductDisplayCard, ProductListingCardWithBadgeAndGrid as ProductListingCard, Progress, Radio, RadioGroup, RadioTile, SearchField, SearchFieldInput, SegmentedControl, SelectField, SelectFieldContent, SelectFieldItem, SelectFieldTrigger, SelectFieldValue, Slider, Spinner, StackedNotifications, Switch, TabNavigation, Tag, TextArea, TextAreaField, TextAreaLabel, ThemeProvider, Tooltip, Typography, createPawprintTheme, fadeAnimation, fadeDownAnimation, fadeUpAnimation, registerLogo, resolveLogo, scaleAnimation, slideInAnimation, slideOutAnimation, theme, useCopyField, useDrawerKeyboardAvoidance, usePasswordField, usePawprint, useSearchField, useSelectField };
|
|
12806
|
+
export { Accordion, Animated5 as Animated, Avatar, Badge, Button, ButtonDock, ButtonGroup, CarouselControls, Checkbox, CheckboxGroup, CopyField, CopyFieldInput, Countdown, DatePicker, Divider, Drawer, FilterTab, FloatingActionButton, Hint, Icon, IconButton, Illustration, Input, InputDescription, InputError, InputField, InputLabel, InputText, Link, Logo, Menu2 as Menu, MenuItem, MessageCard, MessageCardBanner, MessageCardInsight, NativeSelectPicker, Notification, NumberField, NumberInput, NumberInputField, PROGRESS_ANIMATION, PasswordField, PasswordFieldInput, PasswordFieldRequirements, PawprintProvider, PictureSelector, ProductDisplayCard, ProductListingCardWithBadgeAndGrid as ProductListingCard, Progress, Radio, RadioGroup, RadioTile, SearchField, SearchFieldInput, SegmentedControl, SelectField, SelectFieldContent, SelectFieldItem, SelectFieldTrigger, SelectFieldValue, Slider, Spinner, StackedNotifications, Switch, TabNavigation, Tag, TextArea, TextAreaField, TextAreaLabel, ThemeProvider, Tooltip, Typography, createPawprintTheme, fadeAnimation, fadeDownAnimation, fadeUpAnimation, registerLogo, resolveLogo, scaleAnimation, slideInAnimation, slideOutAnimation, theme, useCopyField, useDrawerKeyboardAvoidance, usePasswordField, usePawprint, useSearchField, useSelectField };
|
|
12539
12807
|
//# sourceMappingURL=index.js.map
|
|
12540
12808
|
//# sourceMappingURL=index.js.map
|