@butternutbox/pawprint-native 1.1.3 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +12 -0
- package/dist/index.cjs +326 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +362 -234
- package/dist/index.d.ts +362 -234
- package/dist/index.js +326 -39
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- 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/Menu/Menu.stories.tsx +19 -55
- package/src/components/molecules/Menu/Menu.test.tsx +55 -1
- package/src/components/molecules/Menu/Menu.tsx +56 -31
- package/src/components/molecules/Menu/MenuItem.tsx +32 -39
- package/src/components/molecules/Menu/hooks/index.ts +1 -0
- package/src/components/molecules/Menu/hooks/useMenuTrigger.test.ts +48 -0
- package/src/components/molecules/Menu/hooks/useMenuTrigger.ts +40 -0
- package/src/components/molecules/Menu/index.ts +2 -1
- package/src/components/molecules/index.ts +1 -0
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" }) }));
|
|
@@ -10625,46 +10627,37 @@ var Tooltip = React66.forwardRef(
|
|
|
10625
10627
|
);
|
|
10626
10628
|
Tooltip.displayName = "Tooltip";
|
|
10627
10629
|
var parseTokenValue53 = (value) => parseFloat(value);
|
|
10628
|
-
var Row = styled51(Pressable)(({ theme: theme2
|
|
10630
|
+
var Row = styled51(Pressable)(({ theme: theme2 }) => {
|
|
10629
10631
|
const { spacing } = theme2.tokens.semantics.dimensions;
|
|
10630
|
-
const { colour } = theme2.tokens.semantics;
|
|
10631
10632
|
return {
|
|
10632
10633
|
width: "100%",
|
|
10633
|
-
alignItems: "
|
|
10634
|
+
alignItems: "flex-start",
|
|
10634
10635
|
justifyContent: "center",
|
|
10635
10636
|
paddingVertical: parseTokenValue53(spacing.md),
|
|
10636
|
-
paddingHorizontal: parseTokenValue53(spacing.md)
|
|
10637
|
-
borderBottomWidth: divider ? 1 : 0,
|
|
10638
|
-
borderBottomColor: colour.border.divider
|
|
10637
|
+
paddingHorizontal: parseTokenValue53(spacing.md)
|
|
10639
10638
|
};
|
|
10640
10639
|
});
|
|
10641
10640
|
var MenuItem = React66.forwardRef((_a, ref) => {
|
|
10642
10641
|
var _b = _a, { variant = "action", onPress, children, divider = true } = _b, rest = __objRest(_b, ["variant", "onPress", "children", "divider"]);
|
|
10643
10642
|
const theme2 = useTheme();
|
|
10644
10643
|
const { colour, typography } = theme2.tokens.semantics;
|
|
10645
|
-
const labelColour = variant === "destructive" ? colour.text.error : colour.text.
|
|
10644
|
+
const labelColour = variant === "destructive" ? colour.text.error : colour.text.link.default;
|
|
10646
10645
|
const label = typeof children === "string" || typeof children === "number" ? String(children) : void 0;
|
|
10647
|
-
return /* @__PURE__ */
|
|
10648
|
-
|
|
10649
|
-
|
|
10650
|
-
|
|
10651
|
-
|
|
10652
|
-
|
|
10653
|
-
|
|
10654
|
-
|
|
10655
|
-
|
|
10656
|
-
|
|
10657
|
-
|
|
10658
|
-
|
|
10659
|
-
|
|
10660
|
-
|
|
10661
|
-
|
|
10662
|
-
color: labelColour,
|
|
10663
|
-
children: label
|
|
10664
|
-
}
|
|
10665
|
-
) : children
|
|
10666
|
-
})
|
|
10667
|
-
);
|
|
10646
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10647
|
+
/* @__PURE__ */ jsx(
|
|
10648
|
+
Row,
|
|
10649
|
+
__spreadProps(__spreadValues({
|
|
10650
|
+
ref,
|
|
10651
|
+
onPress,
|
|
10652
|
+
accessible: true,
|
|
10653
|
+
accessibilityRole: "menuitem",
|
|
10654
|
+
accessibilityLabel: label
|
|
10655
|
+
}, rest), {
|
|
10656
|
+
children: label !== void 0 ? /* @__PURE__ */ jsx(Typography, { token: typography.body.medium.md, color: labelColour, children: label }) : children
|
|
10657
|
+
})
|
|
10658
|
+
),
|
|
10659
|
+
divider && /* @__PURE__ */ jsx(Divider, {})
|
|
10660
|
+
] });
|
|
10668
10661
|
});
|
|
10669
10662
|
MenuItem.displayName = "Menu.Item";
|
|
10670
10663
|
var parseTokenValue54 = (value) => parseFloat(value);
|
|
@@ -10675,18 +10668,14 @@ var DismissLayer = styled51(Pressable)({
|
|
|
10675
10668
|
right: 0,
|
|
10676
10669
|
bottom: 0
|
|
10677
10670
|
});
|
|
10678
|
-
var Anchor = styled51(View)(
|
|
10679
|
-
|
|
10680
|
-
return __spreadValues({
|
|
10681
|
-
position: "absolute"
|
|
10682
|
-
}, align === "right" ? { right: inset } : { left: inset });
|
|
10671
|
+
var Anchor = styled51(View)({
|
|
10672
|
+
position: "absolute"
|
|
10683
10673
|
});
|
|
10684
10674
|
var Card = styled51(Pressable)(({ theme: theme2, width }) => {
|
|
10685
10675
|
const { borderRadius } = theme2.tokens.semantics.dimensions;
|
|
10686
10676
|
const { shadow, background } = theme2.tokens.semantics.colour;
|
|
10687
10677
|
return {
|
|
10688
10678
|
width,
|
|
10689
|
-
maxWidth: "90%",
|
|
10690
10679
|
borderRadius: parseTokenValue54(borderRadius.md),
|
|
10691
10680
|
overflow: "hidden",
|
|
10692
10681
|
backgroundColor: background.surface.default,
|
|
@@ -10704,12 +10693,25 @@ var Card = styled51(Pressable)(({ theme: theme2, width }) => {
|
|
|
10704
10693
|
var MenuRoot = ({
|
|
10705
10694
|
open,
|
|
10706
10695
|
onClose,
|
|
10696
|
+
anchor,
|
|
10707
10697
|
anchorOffset = 0,
|
|
10708
10698
|
align = "right",
|
|
10709
|
-
width =
|
|
10699
|
+
width = 280,
|
|
10710
10700
|
closeAccessibilityLabel = "Close menu",
|
|
10711
10701
|
children
|
|
10712
10702
|
}) => {
|
|
10703
|
+
const theme2 = useTheme();
|
|
10704
|
+
const { width: windowWidth } = useWindowDimensions();
|
|
10705
|
+
const { spacing } = theme2.tokens.semantics.dimensions;
|
|
10706
|
+
const [lastAnchor, setLastAnchor] = useState(anchor);
|
|
10707
|
+
if (anchor && anchor !== lastAnchor) setLastAnchor(anchor);
|
|
10708
|
+
const shownAnchor = anchor != null ? anchor : lastAnchor;
|
|
10709
|
+
const position = shownAnchor ? __spreadValues({
|
|
10710
|
+
top: shownAnchor.y + shownAnchor.height + parseTokenValue54(spacing.xs)
|
|
10711
|
+
}, align === "right" ? { right: windowWidth - (shownAnchor.x + shownAnchor.width) } : { left: shownAnchor.x }) : {
|
|
10712
|
+
top: anchorOffset,
|
|
10713
|
+
[align]: parseTokenValue54(spacing.md)
|
|
10714
|
+
};
|
|
10713
10715
|
return /* @__PURE__ */ jsxs(
|
|
10714
10716
|
Modal,
|
|
10715
10717
|
{
|
|
@@ -10727,10 +10729,10 @@ var MenuRoot = ({
|
|
|
10727
10729
|
accessibilityLabel: closeAccessibilityLabel
|
|
10728
10730
|
}
|
|
10729
10731
|
),
|
|
10730
|
-
/* @__PURE__ */ jsx(Anchor, {
|
|
10732
|
+
/* @__PURE__ */ jsx(Anchor, { style: position, children: /* @__PURE__ */ jsx(
|
|
10731
10733
|
Card,
|
|
10732
10734
|
{
|
|
10733
|
-
width,
|
|
10735
|
+
width: Math.min(width, windowWidth * 0.9),
|
|
10734
10736
|
onPress: () => {
|
|
10735
10737
|
},
|
|
10736
10738
|
accessible: false,
|
|
@@ -10746,6 +10748,25 @@ MenuRoot.displayName = "Menu";
|
|
|
10746
10748
|
var Menu2 = Object.assign(MenuRoot, {
|
|
10747
10749
|
Item: MenuItem
|
|
10748
10750
|
});
|
|
10751
|
+
var useMenuTrigger = () => {
|
|
10752
|
+
const triggerRef = useRef(null);
|
|
10753
|
+
const [anchor, setAnchor] = useState();
|
|
10754
|
+
const open = useCallback(() => {
|
|
10755
|
+
var _a;
|
|
10756
|
+
(_a = triggerRef.current) == null ? void 0 : _a.measureInWindow(
|
|
10757
|
+
(x, y, width, height) => setAnchor({ x, y, width, height })
|
|
10758
|
+
);
|
|
10759
|
+
}, []);
|
|
10760
|
+
const close = useCallback(() => setAnchor(void 0), []);
|
|
10761
|
+
const isOpen = anchor !== void 0;
|
|
10762
|
+
return {
|
|
10763
|
+
triggerRef,
|
|
10764
|
+
isOpen,
|
|
10765
|
+
open,
|
|
10766
|
+
close,
|
|
10767
|
+
menuProps: { open: isOpen, onClose: close, anchor }
|
|
10768
|
+
};
|
|
10769
|
+
};
|
|
10749
10770
|
var parseTokenValue55 = (value) => parseFloat(value);
|
|
10750
10771
|
var StyledInsightRoot = styled51(View)(
|
|
10751
10772
|
({
|
|
@@ -12534,7 +12555,273 @@ var TabNavigation = Object.assign(TabNavigationRoot, {
|
|
|
12534
12555
|
Tab: TabNavigationTab,
|
|
12535
12556
|
Panel: TabNavigationPanel
|
|
12536
12557
|
});
|
|
12558
|
+
var parseTokenValue62 = (value) => parseFloat(value);
|
|
12559
|
+
var ICON_BUTTON_CONFIG = {
|
|
12560
|
+
chevronUp: { icon: KeyboardArrowUp_default, defaultVariant: "filled" },
|
|
12561
|
+
chevronRight: { icon: KeyboardArrowRight_default, defaultVariant: "filled" },
|
|
12562
|
+
close: { icon: Close_default, defaultVariant: "text" }
|
|
12563
|
+
};
|
|
12564
|
+
var ANIMATION_DELAY = 1500;
|
|
12565
|
+
var ANIMATION_ITERATIONS = 3;
|
|
12566
|
+
var SHINE_SWEEP = 1100;
|
|
12567
|
+
var SHINE_REST = 4900;
|
|
12568
|
+
var SHINE_BAND_RATIO = 0.4;
|
|
12569
|
+
var SHINE_OPACITY = 0.55;
|
|
12570
|
+
var NUDGE_STEP = 200;
|
|
12571
|
+
var NUDGE_REST = 3200;
|
|
12572
|
+
var NUDGE_DISTANCE = 3;
|
|
12573
|
+
var ShineOverlay = ({
|
|
12574
|
+
radius,
|
|
12575
|
+
highlight
|
|
12576
|
+
}) => {
|
|
12577
|
+
const reducedMotion = useReducedMotion();
|
|
12578
|
+
const [width, setWidth] = React66.useState(0);
|
|
12579
|
+
const progress = useSharedValue(0);
|
|
12580
|
+
const bandWidth = width * SHINE_BAND_RATIO;
|
|
12581
|
+
React66.useEffect(() => {
|
|
12582
|
+
if (reducedMotion || !width) return;
|
|
12583
|
+
progress.value = withDelay(
|
|
12584
|
+
ANIMATION_DELAY,
|
|
12585
|
+
withRepeat(
|
|
12586
|
+
withSequence(
|
|
12587
|
+
withTiming(1, {
|
|
12588
|
+
duration: SHINE_SWEEP,
|
|
12589
|
+
easing: Easing$1.inOut(Easing$1.ease)
|
|
12590
|
+
}),
|
|
12591
|
+
withDelay(SHINE_REST, withTiming(0, { duration: 0 }))
|
|
12592
|
+
),
|
|
12593
|
+
ANIMATION_ITERATIONS
|
|
12594
|
+
)
|
|
12595
|
+
);
|
|
12596
|
+
}, [progress, reducedMotion, width]);
|
|
12597
|
+
const bandStyle = useAnimatedStyle(() => ({
|
|
12598
|
+
transform: [
|
|
12599
|
+
{
|
|
12600
|
+
translateX: -bandWidth * 1.5 + progress.value * (width + bandWidth * 2.5)
|
|
12601
|
+
},
|
|
12602
|
+
{ skewX: "-20deg" }
|
|
12603
|
+
]
|
|
12604
|
+
}));
|
|
12605
|
+
if (reducedMotion) return null;
|
|
12606
|
+
return /* @__PURE__ */ jsx(
|
|
12607
|
+
View,
|
|
12608
|
+
{
|
|
12609
|
+
pointerEvents: "none",
|
|
12610
|
+
accessible: false,
|
|
12611
|
+
importantForAccessibility: "no-hide-descendants",
|
|
12612
|
+
onLayout: (e) => setWidth(e.nativeEvent.layout.width),
|
|
12613
|
+
style: [
|
|
12614
|
+
StyleSheet.absoluteFill,
|
|
12615
|
+
{ borderRadius: radius, overflow: "hidden" }
|
|
12616
|
+
],
|
|
12617
|
+
children: width > 0 && /* @__PURE__ */ jsx(
|
|
12618
|
+
Animated10.View,
|
|
12619
|
+
{
|
|
12620
|
+
style: [
|
|
12621
|
+
{ position: "absolute", top: 0, bottom: 0, width: bandWidth },
|
|
12622
|
+
bandStyle
|
|
12623
|
+
],
|
|
12624
|
+
children: /* @__PURE__ */ jsxs(Svg, { width: "100%", height: "100%", children: [
|
|
12625
|
+
/* @__PURE__ */ jsx(Defs, { children: /* @__PURE__ */ jsxs(LinearGradient, { id: "fabShine", x1: "0", y1: "0", x2: "1", y2: "0", children: [
|
|
12626
|
+
/* @__PURE__ */ jsx(Stop, { offset: "0", stopColor: highlight, stopOpacity: 0 }),
|
|
12627
|
+
/* @__PURE__ */ jsx(
|
|
12628
|
+
Stop,
|
|
12629
|
+
{
|
|
12630
|
+
offset: "0.5",
|
|
12631
|
+
stopColor: highlight,
|
|
12632
|
+
stopOpacity: SHINE_OPACITY
|
|
12633
|
+
}
|
|
12634
|
+
),
|
|
12635
|
+
/* @__PURE__ */ jsx(Stop, { offset: "1", stopColor: highlight, stopOpacity: 0 })
|
|
12636
|
+
] }) }),
|
|
12637
|
+
/* @__PURE__ */ jsx(Rect, { width: "100%", height: "100%", fill: "url(#fabShine)" })
|
|
12638
|
+
] })
|
|
12639
|
+
}
|
|
12640
|
+
)
|
|
12641
|
+
}
|
|
12642
|
+
);
|
|
12643
|
+
};
|
|
12644
|
+
var createNudgingIcon = (IconComponent, axis, direction) => {
|
|
12645
|
+
var _a;
|
|
12646
|
+
const NudgingIcon = (props) => {
|
|
12647
|
+
const reducedMotion = useReducedMotion();
|
|
12648
|
+
const offset = useSharedValue(0);
|
|
12649
|
+
React66.useEffect(() => {
|
|
12650
|
+
if (reducedMotion) return;
|
|
12651
|
+
const step = (to) => withTiming(to, {
|
|
12652
|
+
duration: NUDGE_STEP,
|
|
12653
|
+
easing: Easing$1.inOut(Easing$1.ease)
|
|
12654
|
+
});
|
|
12655
|
+
const distance = NUDGE_DISTANCE * direction;
|
|
12656
|
+
offset.value = withDelay(
|
|
12657
|
+
ANIMATION_DELAY,
|
|
12658
|
+
withRepeat(
|
|
12659
|
+
withSequence(
|
|
12660
|
+
step(distance),
|
|
12661
|
+
step(0),
|
|
12662
|
+
step(distance),
|
|
12663
|
+
step(0),
|
|
12664
|
+
withDelay(NUDGE_REST, withTiming(0, { duration: 0 }))
|
|
12665
|
+
),
|
|
12666
|
+
ANIMATION_ITERATIONS
|
|
12667
|
+
)
|
|
12668
|
+
);
|
|
12669
|
+
}, [offset, reducedMotion]);
|
|
12670
|
+
const nudgeStyle = useAnimatedStyle(
|
|
12671
|
+
() => axis === "translateX" ? { transform: [{ translateX: offset.value }] } : { transform: [{ translateY: offset.value }] }
|
|
12672
|
+
);
|
|
12673
|
+
return /* @__PURE__ */ jsx(Animated10.View, { style: nudgeStyle, children: /* @__PURE__ */ jsx(IconComponent, __spreadValues({}, props)) });
|
|
12674
|
+
};
|
|
12675
|
+
NudgingIcon.displayName = `Nudging(${(_a = IconComponent.displayName) != null ? _a : "Icon"})`;
|
|
12676
|
+
return NudgingIcon;
|
|
12677
|
+
};
|
|
12678
|
+
var NUDGE_ICONS = {
|
|
12679
|
+
chevronUp: createNudgingIcon(KeyboardArrowUp_default, "translateY", -1),
|
|
12680
|
+
chevronRight: createNudgingIcon(KeyboardArrowRight_default, "translateX", 1)
|
|
12681
|
+
};
|
|
12682
|
+
var StyledRoot18 = styled51(View)(
|
|
12683
|
+
({
|
|
12684
|
+
rootGap,
|
|
12685
|
+
rootPaddingH,
|
|
12686
|
+
rootPaddingV,
|
|
12687
|
+
rootBgColor,
|
|
12688
|
+
rootBorderWidth,
|
|
12689
|
+
rootBorderColor,
|
|
12690
|
+
rootBorderRadius,
|
|
12691
|
+
rootBoxShadow
|
|
12692
|
+
}) => ({
|
|
12693
|
+
flexDirection: "row",
|
|
12694
|
+
alignItems: "center",
|
|
12695
|
+
width: "100%",
|
|
12696
|
+
gap: rootGap,
|
|
12697
|
+
paddingHorizontal: rootPaddingH,
|
|
12698
|
+
paddingVertical: rootPaddingV,
|
|
12699
|
+
backgroundColor: rootBgColor,
|
|
12700
|
+
borderWidth: rootBorderWidth,
|
|
12701
|
+
borderColor: rootBorderColor,
|
|
12702
|
+
borderRadius: rootBorderRadius,
|
|
12703
|
+
boxShadow: rootBoxShadow
|
|
12704
|
+
})
|
|
12705
|
+
);
|
|
12706
|
+
var StyledIconContainer = styled51(View)(({ containerSize, containerRadius, containerBgColor }) => ({
|
|
12707
|
+
alignItems: "center",
|
|
12708
|
+
justifyContent: "center",
|
|
12709
|
+
flexShrink: 0,
|
|
12710
|
+
width: containerSize,
|
|
12711
|
+
height: containerSize,
|
|
12712
|
+
borderRadius: containerRadius,
|
|
12713
|
+
backgroundColor: containerBgColor
|
|
12714
|
+
}));
|
|
12715
|
+
var StyledContent3 = styled51(View)({
|
|
12716
|
+
flex: 1,
|
|
12717
|
+
minWidth: 0,
|
|
12718
|
+
alignItems: "flex-start",
|
|
12719
|
+
justifyContent: "center"
|
|
12720
|
+
});
|
|
12721
|
+
var FloatingActionButton = React66.forwardRef(
|
|
12722
|
+
(_a, ref) => {
|
|
12723
|
+
var _b = _a, {
|
|
12724
|
+
variant = "primary",
|
|
12725
|
+
icon = Gift_default,
|
|
12726
|
+
children,
|
|
12727
|
+
linkLabel,
|
|
12728
|
+
linkHref,
|
|
12729
|
+
onLinkPress,
|
|
12730
|
+
animation,
|
|
12731
|
+
iconButtonIcon,
|
|
12732
|
+
iconButtonLabel,
|
|
12733
|
+
iconButtonVariant,
|
|
12734
|
+
onIconButtonPress
|
|
12735
|
+
} = _b, rest = __objRest(_b, [
|
|
12736
|
+
"variant",
|
|
12737
|
+
"icon",
|
|
12738
|
+
"children",
|
|
12739
|
+
"linkLabel",
|
|
12740
|
+
"linkHref",
|
|
12741
|
+
"onLinkPress",
|
|
12742
|
+
"animation",
|
|
12743
|
+
"iconButtonIcon",
|
|
12744
|
+
"iconButtonLabel",
|
|
12745
|
+
"iconButtonVariant",
|
|
12746
|
+
"onIconButtonPress"
|
|
12747
|
+
]);
|
|
12748
|
+
const theme2 = useTheme();
|
|
12749
|
+
const { floatingActionButton } = theme2.tokens.components;
|
|
12750
|
+
const { colour, dimensions: dimensions3 } = theme2.tokens.semantics;
|
|
12751
|
+
const { shadow } = colour;
|
|
12752
|
+
const iconButton = ICON_BUTTON_CONFIG[iconButtonIcon];
|
|
12753
|
+
const iconButtonElement = /* @__PURE__ */ jsx(
|
|
12754
|
+
IconButton,
|
|
12755
|
+
{
|
|
12756
|
+
icon: animation === "nudge" && iconButtonIcon !== "close" ? NUDGE_ICONS[iconButtonIcon] : iconButton.icon,
|
|
12757
|
+
variant: iconButtonVariant != null ? iconButtonVariant : iconButton.defaultVariant,
|
|
12758
|
+
size: "md",
|
|
12759
|
+
"aria-label": iconButtonLabel,
|
|
12760
|
+
onPress: onIconButtonPress
|
|
12761
|
+
}
|
|
12762
|
+
);
|
|
12763
|
+
return /* @__PURE__ */ jsxs(
|
|
12764
|
+
StyledRoot18,
|
|
12765
|
+
__spreadProps(__spreadValues({
|
|
12766
|
+
ref,
|
|
12767
|
+
rootGap: parseTokenValue62(floatingActionButton.spacing.gap),
|
|
12768
|
+
rootPaddingH: parseTokenValue62(
|
|
12769
|
+
floatingActionButton.spacing.horizontalPadding
|
|
12770
|
+
),
|
|
12771
|
+
rootPaddingV: parseTokenValue62(
|
|
12772
|
+
floatingActionButton.spacing.verticalPadding
|
|
12773
|
+
),
|
|
12774
|
+
rootBgColor: floatingActionButton.colour.background[variant],
|
|
12775
|
+
rootBorderWidth: parseTokenValue62(
|
|
12776
|
+
floatingActionButton.borderWidth.default
|
|
12777
|
+
),
|
|
12778
|
+
rootBorderColor: floatingActionButton.colour.border[variant],
|
|
12779
|
+
rootBorderRadius: parseTokenValue62(
|
|
12780
|
+
floatingActionButton.borderRadius.default
|
|
12781
|
+
),
|
|
12782
|
+
rootBoxShadow: `${shadow.md.offsetX} ${shadow.md.offsetY} ${shadow.md.blur} ${shadow.md.spread} ${shadow.md.color}`
|
|
12783
|
+
}, rest), {
|
|
12784
|
+
children: [
|
|
12785
|
+
/* @__PURE__ */ jsx(
|
|
12786
|
+
StyledIconContainer,
|
|
12787
|
+
{
|
|
12788
|
+
containerSize: parseTokenValue62(
|
|
12789
|
+
theme2.tokens.primitives.dimension.sizing["44"]
|
|
12790
|
+
),
|
|
12791
|
+
containerRadius: parseTokenValue62(dimensions3.borderRadius.round),
|
|
12792
|
+
containerBgColor: variant === "secondary" ? colour.background.container.secondary : colour.background.container.default,
|
|
12793
|
+
children: /* @__PURE__ */ jsx(Icon, { icon, size: "xl", colour: "primary" })
|
|
12794
|
+
}
|
|
12795
|
+
),
|
|
12796
|
+
/* @__PURE__ */ jsxs(StyledContent3, { children: [
|
|
12797
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body", size: "lg", weight: "medium", children }),
|
|
12798
|
+
/* @__PURE__ */ jsx(
|
|
12799
|
+
Link,
|
|
12800
|
+
__spreadProps(__spreadValues({
|
|
12801
|
+
href: linkHref,
|
|
12802
|
+
onPress: onLinkPress,
|
|
12803
|
+
size: "md",
|
|
12804
|
+
weight: "medium"
|
|
12805
|
+
}, !linkHref && { accessibilityRole: "button" }), {
|
|
12806
|
+
children: linkLabel
|
|
12807
|
+
})
|
|
12808
|
+
)
|
|
12809
|
+
] }),
|
|
12810
|
+
iconButtonElement,
|
|
12811
|
+
animation === "shine" && /* @__PURE__ */ jsx(
|
|
12812
|
+
ShineOverlay,
|
|
12813
|
+
{
|
|
12814
|
+
radius: parseTokenValue62(floatingActionButton.borderRadius.default),
|
|
12815
|
+
highlight: theme2.tokens.primitives.colour.system.neutral["1"]
|
|
12816
|
+
}
|
|
12817
|
+
)
|
|
12818
|
+
]
|
|
12819
|
+
})
|
|
12820
|
+
);
|
|
12821
|
+
}
|
|
12822
|
+
);
|
|
12823
|
+
FloatingActionButton.displayName = "FloatingActionButton";
|
|
12537
12824
|
|
|
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 };
|
|
12825
|
+
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, useMenuTrigger, usePasswordField, usePawprint, useSearchField, useSelectField };
|
|
12539
12826
|
//# sourceMappingURL=index.js.map
|
|
12540
12827
|
//# sourceMappingURL=index.js.map
|