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

104 lines
4 KiB
TypeScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 8036
// Function ID: 8037
2026-07-20 16:05:17 +00:00
// Name: BaseIconButton
2026-08-15 05:55:55 +00:00
// Dependencies: [19, 21, 4661, 4749, 4115, 4747, 4750, 4752, 4754, 2]
2026-07-20 16:05:17 +00:00
2026-08-15 05:55:55 +00:00
// Module 8036 (BaseIconButton)
2026-07-29 08:29:29 +00:00
import importAllResult from "noop";
2026-07-23 10:11:24 +00:00
import { jsx } from "jsxProd";
2026-07-29 08:29:29 +00:00
import createCacheKey from "createCacheKey";
import IconSizes from "IconSizes";
2026-08-15 05:55:55 +00:00
import importDefaultResult from "module_4115";
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
let closure_4 = createCacheKey.createStyles((arg0, arg1) => {
2026-07-20 16:05:17 +00:00
if ("sm" === arg1) {
2026-07-29 08:29:29 +00:00
let obj = { paddingHorizontal: null, paddingVertical: null };
2026-08-15 05:55:55 +00:00
obj[0] = require(4749) /* MINIMUM_HIT_AREA */.SMALL_BUTTON_PADDING;
obj[1] = require(4749) /* MINIMUM_HIT_AREA */.SMALL_BUTTON_PADDING;
2026-07-20 16:05:17 +00:00
} else if ("md" === arg1) {
2026-07-29 08:29:29 +00:00
obj = { paddingHorizontal: null, paddingVertical: null };
2026-08-15 05:55:55 +00:00
obj[0] = require(4749) /* MINIMUM_HIT_AREA */.MEDIUM_BUTTON_PADDING;
obj[1] = require(4749) /* MINIMUM_HIT_AREA */.MEDIUM_BUTTON_PADDING;
2026-07-29 08:29:29 +00:00
} else {
obj = {};
if ("lg" === arg1) {
const obj1 = { paddingHorizontal: null, paddingVertical: null };
2026-08-15 05:55:55 +00:00
obj1[0] = require(4749) /* MINIMUM_HIT_AREA */.LARGE_BUTTON_PADDING;
obj1[1] = require(4749) /* MINIMUM_HIT_AREA */.LARGE_BUTTON_PADDING;
2026-07-29 08:29:29 +00:00
obj = obj1;
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj2 = { button: { flexShrink: 0, flexGrow: 0, alignSelf: "center" }, pill: null };
2026-07-20 16:05:17 +00:00
const merged = Object.assign(obj);
2026-07-29 08:29:29 +00:00
obj2[1] = {};
2026-07-20 16:05:17 +00:00
return obj2;
});
2026-07-29 08:29:29 +00:00
const forwardRefResult = importAllResult.forwardRef((variant, ref) => {
2026-07-20 16:05:17 +00:00
let icon;
let loading;
let maxFontSizeMultiplier;
let pillStyle;
let scaleAmountInPx;
let style;
variant = variant.variant;
let str = "primary";
({ style, pillStyle } = variant);
if (undefined !== variant) {
str = variant;
}
let DEFAULT_BUTTON_SIZE = variant.size;
if (undefined === DEFAULT_BUTTON_SIZE) {
2026-08-15 05:55:55 +00:00
DEFAULT_BUTTON_SIZE = require(4749) /* MINIMUM_HIT_AREA */.DEFAULT_BUTTON_SIZE;
2026-07-20 16:05:17 +00:00
}
({ icon, scaleAmountInPx } = variant);
2026-07-29 08:29:29 +00:00
let num = 4;
2026-07-20 16:05:17 +00:00
({ maxFontSizeMultiplier, loading } = variant);
if (undefined !== scaleAmountInPx) {
2026-07-29 08:29:29 +00:00
num = scaleAmountInPx;
2026-07-20 16:05:17 +00:00
}
const tmp3 = callback(str, DEFAULT_BUTTON_SIZE);
2026-08-15 05:55:55 +00:00
let obj = require(4115);
2026-07-20 16:05:17 +00:00
const sharedValue = obj.useSharedValue(0);
2026-08-15 05:55:55 +00:00
let obj1 = require(4750) /* styleProperties */;
2026-07-20 16:05:17 +00:00
const iconTintStyles = obj1.useIconTintStyles(str);
2026-08-15 05:55:55 +00:00
const iconSizeStyles = require(4750) /* styleProperties */.useIconSizeStyles(DEFAULT_BUTTON_SIZE, true, maxFontSizeMultiplier);
let MEDIUM_BUTTON_HEIGHT = require(4749) /* MINIMUM_HIT_AREA */.LARGE_BUTTON_HEIGHT;
2026-07-20 16:05:17 +00:00
if ("sm" === DEFAULT_BUTTON_SIZE) {
2026-08-15 05:55:55 +00:00
MEDIUM_BUTTON_HEIGHT = tmp4(4749).SMALL_BUTTON_HEIGHT;
2026-07-20 16:05:17 +00:00
} else if ("md" === DEFAULT_BUTTON_SIZE) {
2026-08-15 05:55:55 +00:00
MEDIUM_BUTTON_HEIGHT = tmp4(4749).MEDIUM_BUTTON_HEIGHT;
2026-07-20 16:05:17 +00:00
}
2026-08-15 05:55:55 +00:00
const bound = Math.max((tmp4(4749).MINIMUM_HIT_AREA - MEDIUM_BUTTON_HEIGHT) / 2, 0);
2026-07-20 16:05:17 +00:00
obj = {};
const merged = Object.assign(variant);
2026-07-29 08:29:29 +00:00
obj.ref = ref;
2026-07-20 16:05:17 +00:00
const items = [tmp3.button, style];
2026-07-29 08:29:29 +00:00
obj.style = items;
obj.pressed = sharedValue;
obj.scaleAmountInPx = num;
obj.hitSlop = bound;
obj = { style: items1, variant: str, size: DEFAULT_BUTTON_SIZE, loading, loaderSize: null, pressed: null, children: null };
2026-07-23 10:11:24 +00:00
items1 = [tmp3.pill, pillStyle];
2026-07-20 16:05:17 +00:00
let str3 = "xs";
if ("lg" === DEFAULT_BUTTON_SIZE) {
str3 = "sm";
}
2026-07-29 08:29:29 +00:00
obj[4] = str3;
obj[5] = sharedValue;
let tmp10Result = icon;
2026-07-20 16:05:17 +00:00
if (!importAllResult.isValidElement(icon)) {
2026-07-29 08:29:29 +00:00
obj1 = { source: null, style: null };
obj1[0] = icon;
2026-07-20 16:05:17 +00:00
const items2 = [iconTintStyles, iconSizeStyles];
2026-07-29 08:29:29 +00:00
obj1[1] = items2;
tmp10Result = tmp10(IconSizes, obj1);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[6] = tmp10Result;
2026-08-15 05:55:55 +00:00
obj.children = jsx(require(4754) /* PillWrapper */.ButtonPill, { style: items1, variant: str, size: DEFAULT_BUTTON_SIZE, loading, loaderSize: null, pressed: null, children: null });
return jsx(require(4752) /* BaseButton */.BaseButton, { style: items1, variant: str, size: DEFAULT_BUTTON_SIZE, loading, loaderSize: null, pressed: null, children: null });
2026-07-20 16:05:17 +00:00
});
2026-07-29 08:29:29 +00:00
const result = require("createCacheKey").fileFinishedImporting("design/components/Button/native/BaseIconButton.native.tsx");
2026-07-20 16:05:17 +00:00
export const BaseIconButton = forwardRefResult;