decord/source/design/components/Button/native/FloatingActionButton.native.tsx

76 lines
3.4 KiB
TypeScript
Raw Normal View History

// Module ID: 8941
// Function ID: 8942
// Name: FloatingActionButton
// Dependencies: [19, 21, 4574, 576, 4994, 4310, 4988, 8114, 2]
2026-07-20 16:05:17 +00:00
// Exports: FloatingActionButton
// Module 8941 (FloatingActionButton)
import nativeDefault from "native" /* 576 */;
import spring from "spring" /* 4988 */;
import ButtonConstants from "ButtonConstants" /* 4994 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
require = fn;
const jsx = fn(21).jsx;
const createStyles = fn(4574);
const styles = createStyles.createStyles(() => {
const obj = { button: null, iconButtonPill: null };
const merged = Object.assign(nativeDefault.shadows.SHADOW_HIGH);
obj.button = {};
obj.iconButtonPill = { minWidth: ButtonConstants.FAB_BUTTON_SIZE, minHeight: ButtonConstants.FAB_BUTTON_SIZE, padding: 0, borderRadius: nativeDefault.radii.lg };
2026-07-20 16:05:17 +00:00
return obj;
});
const SPRING_CONFIG = { mass: 0.5, damping: 80, stiffness: 320 };
const __initData = { code: "function FloatingActionButtonNativeTsx1(){const{withSpring,positionBottom,DEFAULT_POSITION_OFFSET,SPRING_CONFIG,positionRight}=this.__closure;var _positionBottom,_positionRight;return{position:'absolute',bottom:withSpring((_positionBottom=positionBottom)!==null&&_positionBottom!==void 0?_positionBottom:DEFAULT_POSITION_OFFSET,SPRING_CONFIG),right:withSpring((_positionRight=positionRight)!==null&&_positionRight!==void 0?_positionRight:DEFAULT_POSITION_OFFSET,SPRING_CONFIG)};}" };
const size = fn(2);
const result = size.fileFinishedImporting("design/components/Button/native/FloatingActionButton.native.tsx");
2026-07-20 16:05:17 +00:00
export const DEFAULT_POSITION_OFFSET = 16;
export const useStyles = styles;
export const FloatingActionButton = function FloatingActionButton(positionRight) {
({ icon, positionBottom } = positionRight);
positionRight = positionRight.positionRight;
const merged = Object.assign(positionRight, Object.assign({ icon: 0, positionBottom: 0, positionRight: 0, accessibilityLabel: 0 }));
const tmp2 = styles();
2026-07-20 16:05:17 +00:00
class F {
constructor() {
tmp = closure_0;
tmp2 = closure_2;
obj = closure_0(closure_2[6]);
2026-07-29 08:29:29 +00:00
num = positionBottom;
if (positionBottom == null) {
num = 16;
2026-07-20 16:05:17 +00:00
}
rect = { position: "absolute", bottom: obj.withSpring(num, closure_6), right: null };
tmp3 = closure_6;
2026-08-31 15:47:37 +00:00
tmpResult = tmp(tmp2[6]);
2026-07-29 08:29:29 +00:00
num2 = positionRight;
if (positionRight == null) {
num2 = 16;
2026-07-20 16:05:17 +00:00
}
rect.right = tmpResult.withSpring(num2, tmp3);
return rect;
2026-07-20 16:05:17 +00:00
}
}
let obj = positionBottom(4310);
F.__closure = { withSpring: positionBottom(4988).withSpring, positionBottom, DEFAULT_POSITION_OFFSET: 16, SPRING_CONFIG, positionRight };
2026-07-20 16:05:17 +00:00
F.__workletHash = 10762818944671;
F.__initData = __initData;
2026-07-29 08:29:29 +00:00
const animatedStyle = obj.useAnimatedStyle(F);
const obj3 = { style: animatedStyle, children: null };
const obj6 = {};
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(merged);
obj6.accessibilityLabel = positionRight.accessibilityLabel;
obj6.size = "lg";
obj6.variant = "primary";
2026-07-20 16:05:17 +00:00
let cloneElementResult = icon;
if (noop.isValidElement(icon)) {
const obj10 = { color: positionRight(576).colors.WHITE };
cloneElementResult = noop.cloneElement(icon, obj10);
2026-07-20 16:05:17 +00:00
}
obj6.icon = cloneElementResult;
({ button: obj4.style, iconButtonPill: obj4.pillStyle } = tmp2);
obj3.children = jsx(positionBottom(8114).BaseIconButton, {});
return jsx(positionRight(4310).View, { style: animatedStyle, children: null });
2026-07-20 16:05:17 +00:00
};