@tamagui/demos 1.88.13 → 1.89.0-1706308641099
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/LICENSE +21 -0
- package/dist/esm/AccordionDemo.mjs +58 -0
- package/dist/esm/AddThemeDemo.mjs +35 -0
- package/dist/esm/AlertDialogDemo.mjs +72 -0
- package/dist/esm/AnimationsDemo.mjs +75 -0
- package/dist/esm/AnimationsEnterDemo.mjs +40 -0
- package/dist/esm/AnimationsHoverDemo.mjs +23 -0
- package/dist/esm/AnimationsPresenceDemo.mjs +88 -0
- package/dist/esm/AnimationsTimingDemo.mjs +22 -0
- package/dist/esm/AvatarDemo.mjs +29 -0
- package/dist/esm/BuildAButtonDemo.mjs +101 -0
- package/dist/esm/ButtonDemo.mjs +59 -0
- package/dist/esm/CardDemo.mjs +64 -0
- package/dist/esm/CheckboxDemo.mjs +45 -0
- package/dist/esm/ColorsDemo.mjs +97 -0
- package/dist/esm/DialogDemo.mjs +136 -0
- package/dist/esm/FormsDemo.mjs +35 -0
- package/dist/esm/Grid.mjs +37 -0
- package/dist/esm/GroupDemo.mjs +61 -0
- package/dist/esm/HeadingsDemo.mjs +21 -0
- package/dist/esm/ImageDemo.mjs +12 -0
- package/dist/esm/InputsDemo.mjs +36 -0
- package/dist/esm/LabelDemo.mjs +36 -0
- package/dist/esm/LinearGradientDemo.mjs +24 -0
- package/dist/esm/ListItemDemo.mjs +76 -0
- package/dist/esm/LucideIconsDemo.mjs +58 -0
- package/dist/esm/PopoverDemo.mjs +106 -0
- package/dist/esm/ProgressDemo.mjs +64 -0
- package/dist/esm/RadioGroupDemo.mjs +46 -0
- package/dist/esm/ReplaceThemeDemo.mjs +43 -0
- package/dist/esm/ScrollViewDemo.mjs +50 -0
- package/dist/esm/SelectDemo.mjs +188 -0
- package/dist/esm/SeparatorDemo.mjs +36 -0
- package/dist/esm/ShapesDemo.mjs +18 -0
- package/dist/esm/SheetDemo.mjs +141 -0
- package/dist/esm/SliderDemo.mjs +34 -0
- package/dist/esm/SpinnerDemo.mjs +17 -0
- package/dist/esm/StacksDemo.mjs +80 -0
- package/dist/esm/SwitchDemo.mjs +81 -0
- package/dist/esm/TabsAdvancedDemo.mjs +303 -0
- package/dist/esm/TabsDemo.mjs +158 -0
- package/dist/esm/TextDemo.mjs +28 -0
- package/dist/esm/ThemeBuilderDemo.mjs +154 -0
- package/dist/esm/ThemeInverseDemo.mjs +45 -0
- package/dist/esm/ToastDemo.mjs +98 -0
- package/dist/esm/ToastDuplicateDemo.mjs +48 -0
- package/dist/esm/ToggleGroupDemo.mjs +73 -0
- package/dist/esm/TokensDemo.mjs +90 -0
- package/dist/esm/TooltipDemo.mjs +101 -0
- package/dist/esm/UpdateThemeDemo.mjs +46 -0
- package/dist/esm/index.mjs +49 -0
- package/dist/esm/tamagui.config.mjs +4 -0
- package/dist/esm/useOnIntersecting.mjs +43 -0
- package/dist/jsx/AccordionDemo.mjs +58 -0
- package/dist/jsx/AddThemeDemo.mjs +35 -0
- package/dist/jsx/AlertDialogDemo.mjs +72 -0
- package/dist/jsx/AnimationsDemo.mjs +75 -0
- package/dist/jsx/AnimationsEnterDemo.mjs +40 -0
- package/dist/jsx/AnimationsHoverDemo.mjs +23 -0
- package/dist/jsx/AnimationsPresenceDemo.mjs +88 -0
- package/dist/jsx/AnimationsTimingDemo.mjs +22 -0
- package/dist/jsx/AvatarDemo.mjs +29 -0
- package/dist/jsx/BuildAButtonDemo.mjs +101 -0
- package/dist/jsx/ButtonDemo.mjs +59 -0
- package/dist/jsx/CardDemo.mjs +64 -0
- package/dist/jsx/CheckboxDemo.mjs +45 -0
- package/dist/jsx/ColorsDemo.mjs +97 -0
- package/dist/jsx/DialogDemo.mjs +136 -0
- package/dist/jsx/FormsDemo.mjs +35 -0
- package/dist/jsx/Grid.mjs +37 -0
- package/dist/jsx/GroupDemo.mjs +61 -0
- package/dist/jsx/HeadingsDemo.mjs +21 -0
- package/dist/jsx/ImageDemo.mjs +12 -0
- package/dist/jsx/InputsDemo.mjs +36 -0
- package/dist/jsx/LabelDemo.mjs +36 -0
- package/dist/jsx/LinearGradientDemo.mjs +24 -0
- package/dist/jsx/ListItemDemo.mjs +76 -0
- package/dist/jsx/LucideIconsDemo.mjs +58 -0
- package/dist/jsx/PopoverDemo.mjs +106 -0
- package/dist/jsx/ProgressDemo.mjs +64 -0
- package/dist/jsx/RadioGroupDemo.mjs +46 -0
- package/dist/jsx/ReplaceThemeDemo.mjs +43 -0
- package/dist/jsx/ScrollViewDemo.mjs +50 -0
- package/dist/jsx/SelectDemo.mjs +188 -0
- package/dist/jsx/SeparatorDemo.mjs +36 -0
- package/dist/jsx/ShapesDemo.mjs +18 -0
- package/dist/jsx/SheetDemo.mjs +141 -0
- package/dist/jsx/SliderDemo.mjs +34 -0
- package/dist/jsx/SpinnerDemo.mjs +17 -0
- package/dist/jsx/StacksDemo.mjs +80 -0
- package/dist/jsx/SwitchDemo.mjs +81 -0
- package/dist/jsx/TabsAdvancedDemo.mjs +303 -0
- package/dist/jsx/TabsDemo.mjs +158 -0
- package/dist/jsx/TextDemo.mjs +28 -0
- package/dist/jsx/ThemeBuilderDemo.mjs +154 -0
- package/dist/jsx/ThemeInverseDemo.mjs +45 -0
- package/dist/jsx/ToastDemo.mjs +98 -0
- package/dist/jsx/ToastDuplicateDemo.mjs +48 -0
- package/dist/jsx/ToggleGroupDemo.mjs +73 -0
- package/dist/jsx/TokensDemo.mjs +90 -0
- package/dist/jsx/TooltipDemo.mjs +101 -0
- package/dist/jsx/UpdateThemeDemo.mjs +46 -0
- package/dist/jsx/index.mjs +49 -0
- package/dist/jsx/tamagui.config.mjs +4 -0
- package/dist/jsx/useOnIntersecting.mjs +43 -0
- package/package.json +18 -18
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { AlertDialog, Button, XStack, YStack } from "tamagui";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
function AlertDialogDemo() {
|
|
4
|
+
return /* @__PURE__ */jsxs(AlertDialog, {
|
|
5
|
+
native: !0,
|
|
6
|
+
children: [/* @__PURE__ */jsx(AlertDialog.Trigger, {
|
|
7
|
+
asChild: !0,
|
|
8
|
+
children: /* @__PURE__ */jsx(Button, {
|
|
9
|
+
children: "Show Alert"
|
|
10
|
+
})
|
|
11
|
+
}), /* @__PURE__ */jsxs(AlertDialog.Portal, {
|
|
12
|
+
children: [/* @__PURE__ */jsx(AlertDialog.Overlay, {
|
|
13
|
+
animation: "quick",
|
|
14
|
+
opacity: 0.5,
|
|
15
|
+
enterStyle: {
|
|
16
|
+
opacity: 0
|
|
17
|
+
},
|
|
18
|
+
exitStyle: {
|
|
19
|
+
opacity: 0
|
|
20
|
+
}
|
|
21
|
+
}, "overlay"), /* @__PURE__ */jsx(AlertDialog.Content, {
|
|
22
|
+
bordered: !0,
|
|
23
|
+
elevate: !0,
|
|
24
|
+
animation: ["quick", {
|
|
25
|
+
opacity: {
|
|
26
|
+
overshootClamping: !0
|
|
27
|
+
}
|
|
28
|
+
}],
|
|
29
|
+
enterStyle: {
|
|
30
|
+
x: 0,
|
|
31
|
+
y: -20,
|
|
32
|
+
opacity: 0,
|
|
33
|
+
scale: 0.9
|
|
34
|
+
},
|
|
35
|
+
exitStyle: {
|
|
36
|
+
x: 0,
|
|
37
|
+
y: 10,
|
|
38
|
+
opacity: 0,
|
|
39
|
+
scale: 0.95
|
|
40
|
+
},
|
|
41
|
+
x: 0,
|
|
42
|
+
scale: 1,
|
|
43
|
+
opacity: 1,
|
|
44
|
+
y: 0,
|
|
45
|
+
children: /* @__PURE__ */jsxs(YStack, {
|
|
46
|
+
space: !0,
|
|
47
|
+
children: [/* @__PURE__ */jsx(AlertDialog.Title, {
|
|
48
|
+
children: "Accept"
|
|
49
|
+
}), /* @__PURE__ */jsx(AlertDialog.Description, {
|
|
50
|
+
children: "By pressing yes, you accept our terms and conditions."
|
|
51
|
+
}), /* @__PURE__ */jsxs(XStack, {
|
|
52
|
+
space: "$3",
|
|
53
|
+
justifyContent: "flex-end",
|
|
54
|
+
children: [/* @__PURE__ */jsx(AlertDialog.Cancel, {
|
|
55
|
+
asChild: !0,
|
|
56
|
+
children: /* @__PURE__ */jsx(Button, {
|
|
57
|
+
children: "Cancel"
|
|
58
|
+
})
|
|
59
|
+
}), /* @__PURE__ */jsx(AlertDialog.Action, {
|
|
60
|
+
asChild: !0,
|
|
61
|
+
children: /* @__PURE__ */jsx(Button, {
|
|
62
|
+
theme: "active",
|
|
63
|
+
children: "Accept"
|
|
64
|
+
})
|
|
65
|
+
})]
|
|
66
|
+
})]
|
|
67
|
+
})
|
|
68
|
+
}, "content")]
|
|
69
|
+
})]
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
export { AlertDialogDemo };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { LogoIcon } from "@tamagui/logo";
|
|
2
|
+
import { Play } from "@tamagui/lucide-icons";
|
|
3
|
+
import { Button, Square, useControllableState, useEvent } from "tamagui";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
function AnimationsDemo(props) {
|
|
6
|
+
const [positionI, setPositionI] = useControllableState({
|
|
7
|
+
strategy: "most-recent-wins",
|
|
8
|
+
prop: props.position,
|
|
9
|
+
defaultProp: 0
|
|
10
|
+
}),
|
|
11
|
+
position = positions[positionI],
|
|
12
|
+
onPress = useEvent(() => {
|
|
13
|
+
setPositionI(x => (x + 1) % positions.length);
|
|
14
|
+
});
|
|
15
|
+
return /* @__PURE__ */jsxs(Fragment, {
|
|
16
|
+
children: [/* @__PURE__ */jsx(Square, {
|
|
17
|
+
animation: props.animation || "bouncy",
|
|
18
|
+
animateOnly: ["transform"],
|
|
19
|
+
onPress,
|
|
20
|
+
size: 104,
|
|
21
|
+
borderColor: "$borderColor",
|
|
22
|
+
borderWidth: 1,
|
|
23
|
+
borderRadius: "$9",
|
|
24
|
+
backgroundColor: "$color9",
|
|
25
|
+
hoverStyle: {
|
|
26
|
+
scale: 1.5
|
|
27
|
+
},
|
|
28
|
+
pressStyle: {
|
|
29
|
+
scale: 0.9
|
|
30
|
+
},
|
|
31
|
+
...position,
|
|
32
|
+
children: props.children || /* @__PURE__ */jsx(LogoIcon, {
|
|
33
|
+
downscale: 0.75
|
|
34
|
+
})
|
|
35
|
+
}), /* @__PURE__ */jsx(Button, {
|
|
36
|
+
position: "absolute",
|
|
37
|
+
bottom: 20,
|
|
38
|
+
left: 20,
|
|
39
|
+
icon: Play,
|
|
40
|
+
theme: props.tint,
|
|
41
|
+
size: "$5",
|
|
42
|
+
circular: !0,
|
|
43
|
+
onPress
|
|
44
|
+
})]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
const positions = [{
|
|
48
|
+
x: 0,
|
|
49
|
+
y: 0,
|
|
50
|
+
scale: 1,
|
|
51
|
+
rotate: "0deg"
|
|
52
|
+
}, {
|
|
53
|
+
x: -50,
|
|
54
|
+
y: -50,
|
|
55
|
+
scale: 0.5,
|
|
56
|
+
rotate: "-45deg",
|
|
57
|
+
hoverStyle: {
|
|
58
|
+
scale: 0.6
|
|
59
|
+
},
|
|
60
|
+
pressStyle: {
|
|
61
|
+
scale: 0.4
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
64
|
+
x: 50,
|
|
65
|
+
y: 50,
|
|
66
|
+
scale: 1,
|
|
67
|
+
rotate: "180deg",
|
|
68
|
+
hoverStyle: {
|
|
69
|
+
scale: 1.1
|
|
70
|
+
},
|
|
71
|
+
pressStyle: {
|
|
72
|
+
scale: 0.9
|
|
73
|
+
}
|
|
74
|
+
}];
|
|
75
|
+
export { AnimationsDemo, positions };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { LogoIcon } from "@tamagui/logo";
|
|
2
|
+
import { useRef, useState } from "react";
|
|
3
|
+
import { Button, Square, YStack } from "tamagui";
|
|
4
|
+
import { useIsIntersecting } from "./useOnIntersecting.mjs";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
function AnimationsEnterDemo(props) {
|
|
7
|
+
const ref = useRef(null),
|
|
8
|
+
hasIntersected = useIsIntersecting(ref, {
|
|
9
|
+
once: !0
|
|
10
|
+
}),
|
|
11
|
+
[key, setKey] = useState(0);
|
|
12
|
+
return hasIntersected ? /* @__PURE__ */jsxs(Fragment, {
|
|
13
|
+
children: [/* @__PURE__ */jsx(Square, {
|
|
14
|
+
enterStyle: {
|
|
15
|
+
scale: 1.5,
|
|
16
|
+
y: -10,
|
|
17
|
+
opacity: 0
|
|
18
|
+
},
|
|
19
|
+
animation: "bouncy",
|
|
20
|
+
elevation: "$4",
|
|
21
|
+
size: 110,
|
|
22
|
+
opacity: 1,
|
|
23
|
+
scale: 1,
|
|
24
|
+
y: 0,
|
|
25
|
+
backgroundColor: "$pink10",
|
|
26
|
+
borderRadius: "$9",
|
|
27
|
+
children: props.children ?? /* @__PURE__ */jsx(LogoIcon, {
|
|
28
|
+
downscale: 0.75
|
|
29
|
+
})
|
|
30
|
+
}, key), /* @__PURE__ */jsx(Button, {
|
|
31
|
+
size: "$3",
|
|
32
|
+
marginTop: "$4",
|
|
33
|
+
onPress: () => setKey(Math.random()),
|
|
34
|
+
children: "Re-mount"
|
|
35
|
+
})]
|
|
36
|
+
}) : /* @__PURE__ */jsx(YStack, {
|
|
37
|
+
ref
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
export { AnimationsEnterDemo };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { LogoIcon } from "@tamagui/logo";
|
|
2
|
+
import { Square } from "tamagui";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
function AnimationsHoverDemo() {
|
|
5
|
+
return /* @__PURE__ */jsx(Square, {
|
|
6
|
+
borderColor: "$borderColor",
|
|
7
|
+
animation: "bouncy",
|
|
8
|
+
elevation: "$4",
|
|
9
|
+
backgroundColor: "$color9",
|
|
10
|
+
size: 104,
|
|
11
|
+
borderRadius: "$9",
|
|
12
|
+
hoverStyle: {
|
|
13
|
+
scale: 1.2
|
|
14
|
+
},
|
|
15
|
+
pressStyle: {
|
|
16
|
+
scale: 0.9
|
|
17
|
+
},
|
|
18
|
+
children: /* @__PURE__ */jsx(LogoIcon, {
|
|
19
|
+
downscale: 0.75
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export { AnimationsHoverDemo };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { AnimatePresence } from "@tamagui/animate-presence";
|
|
2
|
+
import { ArrowLeft, ArrowRight } from "@tamagui/lucide-icons";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Button, Image, XStack, YStack, styled } from "tamagui";
|
|
5
|
+
import photo1 from "../../public/photo1.jpg";
|
|
6
|
+
import photo2 from "../../public/photo2.jpg";
|
|
7
|
+
import photo3 from "../../public/photo3.jpg";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
const images = [photo1, photo2, photo3].map(x => x.src || x),
|
|
10
|
+
GalleryItem = styled(YStack, {
|
|
11
|
+
zIndex: 1,
|
|
12
|
+
x: 0,
|
|
13
|
+
opacity: 1,
|
|
14
|
+
fullscreen: !0,
|
|
15
|
+
variants: {
|
|
16
|
+
// 1 = right, 0 = nowhere, -1 = left
|
|
17
|
+
going: {
|
|
18
|
+
":number": going => ({
|
|
19
|
+
enterStyle: {
|
|
20
|
+
x: going > 0 ? 1e3 : -1e3,
|
|
21
|
+
opacity: 0
|
|
22
|
+
},
|
|
23
|
+
exitStyle: {
|
|
24
|
+
zIndex: 0,
|
|
25
|
+
x: going < 0 ? 1e3 : -1e3,
|
|
26
|
+
opacity: 0
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}),
|
|
32
|
+
wrap = (min, max, v) => {
|
|
33
|
+
const rangeSize = max - min;
|
|
34
|
+
return ((v - min) % rangeSize + rangeSize) % rangeSize + min;
|
|
35
|
+
};
|
|
36
|
+
function AnimationsPresenceDemo() {
|
|
37
|
+
const [[page, going], setPage] = useState([0, 0]),
|
|
38
|
+
imageIndex = wrap(0, images.length, page),
|
|
39
|
+
paginate = going2 => {
|
|
40
|
+
setPage([page + going2, going2]);
|
|
41
|
+
};
|
|
42
|
+
return /* @__PURE__ */jsxs(XStack, {
|
|
43
|
+
overflow: "hidden",
|
|
44
|
+
backgroundColor: "#000",
|
|
45
|
+
position: "relative",
|
|
46
|
+
height: 300,
|
|
47
|
+
width: "100%",
|
|
48
|
+
alignItems: "center",
|
|
49
|
+
children: [/* @__PURE__ */jsx(AnimatePresence, {
|
|
50
|
+
initial: !1,
|
|
51
|
+
custom: {
|
|
52
|
+
going
|
|
53
|
+
},
|
|
54
|
+
children: /* @__PURE__ */jsx(GalleryItem, {
|
|
55
|
+
animation: "slowest",
|
|
56
|
+
going,
|
|
57
|
+
children: /* @__PURE__ */jsx(Image, {
|
|
58
|
+
source: {
|
|
59
|
+
uri: images[imageIndex],
|
|
60
|
+
width: 780,
|
|
61
|
+
height: 300
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
}, page)
|
|
65
|
+
}), /* @__PURE__ */jsx(Button, {
|
|
66
|
+
accessibilityLabel: "Carousel left",
|
|
67
|
+
icon: ArrowLeft,
|
|
68
|
+
size: "$5",
|
|
69
|
+
position: "absolute",
|
|
70
|
+
left: "$4",
|
|
71
|
+
circular: !0,
|
|
72
|
+
elevate: !0,
|
|
73
|
+
onPress: () => paginate(-1),
|
|
74
|
+
zi: 100
|
|
75
|
+
}), /* @__PURE__ */jsx(Button, {
|
|
76
|
+
accessibilityLabel: "Carousel right",
|
|
77
|
+
icon: ArrowRight,
|
|
78
|
+
size: "$5",
|
|
79
|
+
position: "absolute",
|
|
80
|
+
right: "$4",
|
|
81
|
+
circular: !0,
|
|
82
|
+
elevate: !0,
|
|
83
|
+
onPress: () => paginate(1),
|
|
84
|
+
zi: 100
|
|
85
|
+
})]
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
export { AnimationsPresenceDemo, images };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LogoIcon } from "@tamagui/logo";
|
|
2
|
+
import { Square } from "tamagui";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
function AnimationsTimingDemo() {
|
|
5
|
+
return /* @__PURE__ */jsx(Square, {
|
|
6
|
+
backgroundColor: "$pink10",
|
|
7
|
+
animation: "100ms",
|
|
8
|
+
elevation: "$4",
|
|
9
|
+
size: 110,
|
|
10
|
+
borderRadius: "$9",
|
|
11
|
+
hoverStyle: {
|
|
12
|
+
scale: 1.2
|
|
13
|
+
},
|
|
14
|
+
pressStyle: {
|
|
15
|
+
scale: 0.9
|
|
16
|
+
},
|
|
17
|
+
children: /* @__PURE__ */jsx(LogoIcon, {
|
|
18
|
+
downscale: 0.75
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export { AnimationsTimingDemo };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Avatar, XStack } from "tamagui";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
function AvatarDemo() {
|
|
4
|
+
return /* @__PURE__ */jsxs(XStack, {
|
|
5
|
+
alignItems: "center",
|
|
6
|
+
space: "$6",
|
|
7
|
+
children: [/* @__PURE__ */jsxs(Avatar, {
|
|
8
|
+
circular: !0,
|
|
9
|
+
size: "$10",
|
|
10
|
+
children: [/* @__PURE__ */jsx(Avatar.Image, {
|
|
11
|
+
accessibilityLabel: "Cam",
|
|
12
|
+
src: "https://images.unsplash.com/photo-1548142813-c348350df52b?&w=150&h=150&dpr=2&q=80"
|
|
13
|
+
}), /* @__PURE__ */jsx(Avatar.Fallback, {
|
|
14
|
+
backgroundColor: "$blue10"
|
|
15
|
+
})]
|
|
16
|
+
}), /* @__PURE__ */jsxs(Avatar, {
|
|
17
|
+
circular: !0,
|
|
18
|
+
size: "$8",
|
|
19
|
+
children: [/* @__PURE__ */jsx(Avatar.Image, {
|
|
20
|
+
accessibilityLabel: "Nate Wienert",
|
|
21
|
+
src: "https://images.unsplash.com/photo-1531384441138-2736e62e0919?&w=100&h=100&dpr=2&q=80"
|
|
22
|
+
}), /* @__PURE__ */jsx(Avatar.Fallback, {
|
|
23
|
+
delayMs: 600,
|
|
24
|
+
backgroundColor: "$blue10"
|
|
25
|
+
})]
|
|
26
|
+
})]
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export { AvatarDemo };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Drumstick, Hand } from "@tamagui/lucide-icons";
|
|
2
|
+
import { Button, XStack, YStack } from "tamagui";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
const outlined = {
|
|
5
|
+
backgroundColor: "transparent",
|
|
6
|
+
borderWidth: 2,
|
|
7
|
+
borderColor: "$background",
|
|
8
|
+
borderRadius: "$10",
|
|
9
|
+
hoverStyle: {
|
|
10
|
+
backgroundColor: "transparent",
|
|
11
|
+
borderColor: "$backgroundPress"
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
function BuildAButtonDemo() {
|
|
15
|
+
return /* @__PURE__ */jsx(YStack, {
|
|
16
|
+
fullscreen: !0,
|
|
17
|
+
ov: "hidden",
|
|
18
|
+
children: /* @__PURE__ */jsxs(XStack, {
|
|
19
|
+
mah: 200,
|
|
20
|
+
y: -100,
|
|
21
|
+
x: -40,
|
|
22
|
+
rotate: "-10deg",
|
|
23
|
+
children: [/* @__PURE__ */jsx(ButtonCol, {
|
|
24
|
+
y: 35,
|
|
25
|
+
size: "$2",
|
|
26
|
+
...outlined,
|
|
27
|
+
subTheme: "alt1",
|
|
28
|
+
borderWidth: 1
|
|
29
|
+
}), /* @__PURE__ */jsx(ButtonCol, {
|
|
30
|
+
y: 30
|
|
31
|
+
}), /* @__PURE__ */jsx(ButtonCol, {
|
|
32
|
+
y: -50,
|
|
33
|
+
...outlined
|
|
34
|
+
}), /* @__PURE__ */jsx(ButtonCol, {
|
|
35
|
+
...outlined,
|
|
36
|
+
icon: /* @__PURE__ */jsx(Hand, {})
|
|
37
|
+
}), /* @__PURE__ */jsx(ButtonCol, {
|
|
38
|
+
size: "$6",
|
|
39
|
+
subTheme: "alt2"
|
|
40
|
+
}), /* @__PURE__ */jsx(ButtonCol, {
|
|
41
|
+
size: "$6",
|
|
42
|
+
subTheme: "alt2",
|
|
43
|
+
...outlined
|
|
44
|
+
}), /* @__PURE__ */jsx(ButtonCol, {
|
|
45
|
+
size: "$8",
|
|
46
|
+
subTheme: "alt2",
|
|
47
|
+
iconAfter: /* @__PURE__ */jsx(Drumstick, {}),
|
|
48
|
+
...outlined
|
|
49
|
+
}), /* @__PURE__ */jsx(ButtonCol, {
|
|
50
|
+
size: "$10",
|
|
51
|
+
subTheme: "alt1"
|
|
52
|
+
}), /* @__PURE__ */jsx(ButtonCol, {
|
|
53
|
+
size: "$8",
|
|
54
|
+
subTheme: "alt2",
|
|
55
|
+
...outlined,
|
|
56
|
+
borderRadius: 0
|
|
57
|
+
})]
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function ButtonCol(props) {
|
|
62
|
+
const subTheme = props.subTheme ? `_${props.subTheme}` : "";
|
|
63
|
+
return /* @__PURE__ */jsxs(YStack, {
|
|
64
|
+
padding: "$2",
|
|
65
|
+
space: "$3",
|
|
66
|
+
children: [/* @__PURE__ */jsx(Button, {
|
|
67
|
+
theme: props.subTheme,
|
|
68
|
+
...props,
|
|
69
|
+
children: "Hello"
|
|
70
|
+
}), /* @__PURE__ */jsx(Button, {
|
|
71
|
+
theme: "orange" + subTheme,
|
|
72
|
+
...props,
|
|
73
|
+
children: "Hello"
|
|
74
|
+
}), /* @__PURE__ */jsx(Button, {
|
|
75
|
+
theme: "yellow" + subTheme,
|
|
76
|
+
...props,
|
|
77
|
+
children: "Hello"
|
|
78
|
+
}), /* @__PURE__ */jsx(Button, {
|
|
79
|
+
theme: "green" + subTheme,
|
|
80
|
+
...props,
|
|
81
|
+
children: "Hello"
|
|
82
|
+
}), /* @__PURE__ */jsx(Button, {
|
|
83
|
+
theme: "blue" + subTheme,
|
|
84
|
+
...props,
|
|
85
|
+
children: "Hello"
|
|
86
|
+
}), /* @__PURE__ */jsx(Button, {
|
|
87
|
+
theme: "purple" + subTheme,
|
|
88
|
+
...props,
|
|
89
|
+
children: "Hello"
|
|
90
|
+
}), /* @__PURE__ */jsx(Button, {
|
|
91
|
+
theme: "pink" + subTheme,
|
|
92
|
+
...props,
|
|
93
|
+
children: "Hello"
|
|
94
|
+
}), /* @__PURE__ */jsx(Button, {
|
|
95
|
+
theme: "red" + subTheme,
|
|
96
|
+
...props,
|
|
97
|
+
children: "Hello"
|
|
98
|
+
})]
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
export { BuildAButtonDemo };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Activity, Airplay } from "@tamagui/lucide-icons";
|
|
2
|
+
import { Button, XGroup, XStack, YStack } from "tamagui";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
function ButtonDemo(props) {
|
|
5
|
+
return /* @__PURE__ */jsxs(YStack, {
|
|
6
|
+
padding: "$3",
|
|
7
|
+
space: "$3",
|
|
8
|
+
...props,
|
|
9
|
+
children: [/* @__PURE__ */jsx(Button, {
|
|
10
|
+
children: "Plain"
|
|
11
|
+
}), /* @__PURE__ */jsx(Button, {
|
|
12
|
+
alignSelf: "center",
|
|
13
|
+
icon: Airplay,
|
|
14
|
+
size: "$6",
|
|
15
|
+
children: "Large"
|
|
16
|
+
}), /* @__PURE__ */jsxs(XStack, {
|
|
17
|
+
space: "$2",
|
|
18
|
+
justifyContent: "center",
|
|
19
|
+
children: [/* @__PURE__ */jsx(Button, {
|
|
20
|
+
size: "$3",
|
|
21
|
+
theme: "active",
|
|
22
|
+
children: "Active"
|
|
23
|
+
}), /* @__PURE__ */jsx(Button, {
|
|
24
|
+
size: "$3",
|
|
25
|
+
variant: "outlined",
|
|
26
|
+
children: "Outlined"
|
|
27
|
+
})]
|
|
28
|
+
}), /* @__PURE__ */jsxs(XStack, {
|
|
29
|
+
space: "$2",
|
|
30
|
+
children: [/* @__PURE__ */jsx(Button, {
|
|
31
|
+
themeInverse: !0,
|
|
32
|
+
size: "$3",
|
|
33
|
+
children: "Inverse"
|
|
34
|
+
}), /* @__PURE__ */jsx(Button, {
|
|
35
|
+
iconAfter: Activity,
|
|
36
|
+
size: "$3",
|
|
37
|
+
children: "iconAfter"
|
|
38
|
+
})]
|
|
39
|
+
}), /* @__PURE__ */jsxs(XGroup, {
|
|
40
|
+
children: [/* @__PURE__ */jsx(XGroup.Item, {
|
|
41
|
+
children: /* @__PURE__ */jsx(Button, {
|
|
42
|
+
width: "50%",
|
|
43
|
+
size: "$2",
|
|
44
|
+
disabled: !0,
|
|
45
|
+
opacity: 0.5,
|
|
46
|
+
children: "disabled"
|
|
47
|
+
})
|
|
48
|
+
}), /* @__PURE__ */jsx(XGroup.Item, {
|
|
49
|
+
children: /* @__PURE__ */jsx(Button, {
|
|
50
|
+
width: "50%",
|
|
51
|
+
size: "$2",
|
|
52
|
+
chromeless: !0,
|
|
53
|
+
children: "chromeless"
|
|
54
|
+
})
|
|
55
|
+
})]
|
|
56
|
+
})]
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
export { ButtonDemo };
|