decord/source/design/void/IconButton/native/IconButton.tsx

106 lines
3.9 KiB
TypeScript
Raw Normal View History

// Module ID: 13548
// Function ID: 13549
// Name: IconButton/IconButton
// Dependencies: [19, 21, 4636, 576, 5522, 5204, 1176, 2]
2026-07-20 16:05:17 +00:00
// Module 13548 (IconButton/IconButton)
import nativeDefault from "native" /* 576 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
const require = fn;
2026-07-20 16:05:17 +00:00
class SquareIconButton {
constructor(arg0) {
size = global.size;
({ disableColor, accessibilityHidden } = global);
2026-08-24 06:08:38 +00:00
closure_1 = undefined;
2026-07-20 16:05:17 +00:00
({ onPress, source, style, iconStyle, accessibilityLabel, disabled } = global);
2026-08-24 06:08:38 +00:00
tmp = closure_5();
closure_1 = tmp;
2026-07-20 16:05:17 +00:00
items = [, ];
items[0] = size;
items[1] = tmp;
2026-07-29 08:29:29 +00:00
tmp3 = jsx;
tmp4 = size;
2026-08-24 06:08:38 +00:00
tmp5 = closure_1;
memo = closure_2.useMemo(() => {
if (obj.MEDIUM_32 === size) {
2026-08-24 06:08:38 +00:00
return closure_1.medium;
2026-07-29 08:29:29 +00:00
} else if (tmp2.LARGE_40 === tmp) {
2026-08-24 06:08:38 +00:00
return closure_1.large;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const SMALL_24 = tmp2.SMALL_24;
2026-08-24 06:08:38 +00:00
return closure_1.small;
2026-07-20 16:05:17 +00:00
}
}, items);
2026-07-29 08:29:29 +00:00
tmp6 = undefined;
2026-07-20 16:05:17 +00:00
if (!accessibilityHidden) {
2026-07-29 08:29:29 +00:00
tmp6 = accessibilityLabel;
2026-07-20 16:05:17 +00:00
}
obj = { accessibilityRole: "button", accessibilityLabel: tmp6, accessibilityElementsHidden: accessibilityHidden, onPress, disabled, style: null, children: null };
2026-07-20 16:05:17 +00:00
items1 = [, , ];
items1[0] = tmp.container;
items1[1] = style;
items1[2] = memo;
obj.style = items1;
2026-08-24 06:08:38 +00:00
if (size === closure_4.LARGE_40) {
REFRESH_SMALL_16 = tmp4(tmp5[6]).Icon.Sizes.MEDIUM;
2026-07-20 16:05:17 +00:00
} else {
REFRESH_SMALL_16 = tmp4(tmp5[6]).Icon.Sizes.REFRESH_SMALL_16;
2026-07-20 16:05:17 +00:00
}
obj1 = { size: REFRESH_SMALL_16, style: null, disableColor: null, source: null };
2026-07-20 16:05:17 +00:00
icon = null;
if (!disableColor) {
icon = tmp.icon;
}
items2 = [, ];
items2[0] = icon;
items2[1] = iconStyle;
obj1.style = items2;
obj1.disableColor = disableColor;
obj1.source = source;
obj.children = tmp3(tmp4(tmp5[6]).Icon, obj1);
return tmp3(size(closure_1[5]).PressableOpacity, obj);
2026-07-20 16:05:17 +00:00
}
}
class CircularIconButton {
constructor(arg0) {
size = global.size;
({ style, disableColor } = global);
merged = Object.assign(global, Object.assign({ style: 0, size: 0, disableColor: 0 }));
2026-08-24 06:08:38 +00:00
tmp2 = closure_5();
tmp5 = closure_4;
2026-07-29 08:29:29 +00:00
tmp3 = jsx;
tmp4 = SquareIconButton;
2026-08-24 06:08:38 +00:00
if (closure_4.SMALL_24 === size) {
2026-07-29 08:29:29 +00:00
largeCircular = tmp2.smallCircular;
} else if (tmp5.MEDIUM_32 === size) {
largeCircular = tmp2.mediumCircular;
} else if (tmp5.LARGE_40 === size) {
largeCircular = tmp2.largeCircular;
2026-07-20 16:05:17 +00:00
}
obj = { style: null, size };
2026-07-20 16:05:17 +00:00
items = [, ];
items[0] = largeCircular;
items[1] = style;
obj.style = items;
2026-07-20 16:05:17 +00:00
merged1 = Object.assign(merged);
2026-07-29 08:29:29 +00:00
obj.disableColor = disableColor;
return tmp3(tmp4, obj);
2026-07-20 16:05:17 +00:00
}
}
const jsx = fn(21).jsx;
const Sizes = { SMALL_24: 24, [24]: "SMALL_24", MEDIUM_32: 32, [32]: "MEDIUM_32", LARGE_40: 40, [40]: "LARGE_40" };
const createStyles = fn(4636);
const obj3 = { container: { borderRadius: nativeDefault.radii.xs, alignItems: "center", justifyContent: "center", backgroundColor: fn(5522).DARK_PRIMARY_700_LIGHT_PRIMARY_230 }, small: { height: Sizes.SMALL_24, width: Sizes.SMALL_24 }, medium: { height: Sizes.MEDIUM_32, width: Sizes.MEDIUM_32 }, large: { height: Sizes.LARGE_40, width: Sizes.LARGE_40 }, smallCircular: { borderRadius: Sizes.SMALL_24 / 2 }, mediumCircular: { borderRadius: Sizes.MEDIUM_32 / 2 }, largeCircular: { borderRadius: Sizes.LARGE_40 / 2 }, icon: null };
const obj4 = { borderRadius: nativeDefault.radii.xs, alignItems: "center", justifyContent: "center", backgroundColor: fn(5522).DARK_PRIMARY_700_LIGHT_PRIMARY_230 };
const obj5 = { borderRadius: Sizes.SMALL_24 / 2 };
obj3.icon = { tintColor: fn(5522).DARK_PRIMARY_300_LIGHT_PRIMARY_500 };
const hasOwnProperty = createStyles.createStyles(obj3);
SquareIconButton.Sizes = Sizes;
CircularIconButton.Sizes = Sizes;
let size = fn(2);
const result = size.fileFinishedImporting("design/void/IconButton/native/IconButton.tsx");
2026-07-20 16:05:17 +00:00
export { SquareIconButton };
export { CircularIconButton };