@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.
Files changed (106) hide show
  1. package/LICENSE +21 -0
  2. package/dist/esm/AccordionDemo.mjs +58 -0
  3. package/dist/esm/AddThemeDemo.mjs +35 -0
  4. package/dist/esm/AlertDialogDemo.mjs +72 -0
  5. package/dist/esm/AnimationsDemo.mjs +75 -0
  6. package/dist/esm/AnimationsEnterDemo.mjs +40 -0
  7. package/dist/esm/AnimationsHoverDemo.mjs +23 -0
  8. package/dist/esm/AnimationsPresenceDemo.mjs +88 -0
  9. package/dist/esm/AnimationsTimingDemo.mjs +22 -0
  10. package/dist/esm/AvatarDemo.mjs +29 -0
  11. package/dist/esm/BuildAButtonDemo.mjs +101 -0
  12. package/dist/esm/ButtonDemo.mjs +59 -0
  13. package/dist/esm/CardDemo.mjs +64 -0
  14. package/dist/esm/CheckboxDemo.mjs +45 -0
  15. package/dist/esm/ColorsDemo.mjs +97 -0
  16. package/dist/esm/DialogDemo.mjs +136 -0
  17. package/dist/esm/FormsDemo.mjs +35 -0
  18. package/dist/esm/Grid.mjs +37 -0
  19. package/dist/esm/GroupDemo.mjs +61 -0
  20. package/dist/esm/HeadingsDemo.mjs +21 -0
  21. package/dist/esm/ImageDemo.mjs +12 -0
  22. package/dist/esm/InputsDemo.mjs +36 -0
  23. package/dist/esm/LabelDemo.mjs +36 -0
  24. package/dist/esm/LinearGradientDemo.mjs +24 -0
  25. package/dist/esm/ListItemDemo.mjs +76 -0
  26. package/dist/esm/LucideIconsDemo.mjs +58 -0
  27. package/dist/esm/PopoverDemo.mjs +106 -0
  28. package/dist/esm/ProgressDemo.mjs +64 -0
  29. package/dist/esm/RadioGroupDemo.mjs +46 -0
  30. package/dist/esm/ReplaceThemeDemo.mjs +43 -0
  31. package/dist/esm/ScrollViewDemo.mjs +50 -0
  32. package/dist/esm/SelectDemo.mjs +188 -0
  33. package/dist/esm/SeparatorDemo.mjs +36 -0
  34. package/dist/esm/ShapesDemo.mjs +18 -0
  35. package/dist/esm/SheetDemo.mjs +141 -0
  36. package/dist/esm/SliderDemo.mjs +34 -0
  37. package/dist/esm/SpinnerDemo.mjs +17 -0
  38. package/dist/esm/StacksDemo.mjs +80 -0
  39. package/dist/esm/SwitchDemo.mjs +81 -0
  40. package/dist/esm/TabsAdvancedDemo.mjs +303 -0
  41. package/dist/esm/TabsDemo.mjs +158 -0
  42. package/dist/esm/TextDemo.mjs +28 -0
  43. package/dist/esm/ThemeBuilderDemo.mjs +154 -0
  44. package/dist/esm/ThemeInverseDemo.mjs +45 -0
  45. package/dist/esm/ToastDemo.mjs +98 -0
  46. package/dist/esm/ToastDuplicateDemo.mjs +48 -0
  47. package/dist/esm/ToggleGroupDemo.mjs +73 -0
  48. package/dist/esm/TokensDemo.mjs +90 -0
  49. package/dist/esm/TooltipDemo.mjs +101 -0
  50. package/dist/esm/UpdateThemeDemo.mjs +46 -0
  51. package/dist/esm/index.mjs +49 -0
  52. package/dist/esm/tamagui.config.mjs +4 -0
  53. package/dist/esm/useOnIntersecting.mjs +43 -0
  54. package/dist/jsx/AccordionDemo.mjs +58 -0
  55. package/dist/jsx/AddThemeDemo.mjs +35 -0
  56. package/dist/jsx/AlertDialogDemo.mjs +72 -0
  57. package/dist/jsx/AnimationsDemo.mjs +75 -0
  58. package/dist/jsx/AnimationsEnterDemo.mjs +40 -0
  59. package/dist/jsx/AnimationsHoverDemo.mjs +23 -0
  60. package/dist/jsx/AnimationsPresenceDemo.mjs +88 -0
  61. package/dist/jsx/AnimationsTimingDemo.mjs +22 -0
  62. package/dist/jsx/AvatarDemo.mjs +29 -0
  63. package/dist/jsx/BuildAButtonDemo.mjs +101 -0
  64. package/dist/jsx/ButtonDemo.mjs +59 -0
  65. package/dist/jsx/CardDemo.mjs +64 -0
  66. package/dist/jsx/CheckboxDemo.mjs +45 -0
  67. package/dist/jsx/ColorsDemo.mjs +97 -0
  68. package/dist/jsx/DialogDemo.mjs +136 -0
  69. package/dist/jsx/FormsDemo.mjs +35 -0
  70. package/dist/jsx/Grid.mjs +37 -0
  71. package/dist/jsx/GroupDemo.mjs +61 -0
  72. package/dist/jsx/HeadingsDemo.mjs +21 -0
  73. package/dist/jsx/ImageDemo.mjs +12 -0
  74. package/dist/jsx/InputsDemo.mjs +36 -0
  75. package/dist/jsx/LabelDemo.mjs +36 -0
  76. package/dist/jsx/LinearGradientDemo.mjs +24 -0
  77. package/dist/jsx/ListItemDemo.mjs +76 -0
  78. package/dist/jsx/LucideIconsDemo.mjs +58 -0
  79. package/dist/jsx/PopoverDemo.mjs +106 -0
  80. package/dist/jsx/ProgressDemo.mjs +64 -0
  81. package/dist/jsx/RadioGroupDemo.mjs +46 -0
  82. package/dist/jsx/ReplaceThemeDemo.mjs +43 -0
  83. package/dist/jsx/ScrollViewDemo.mjs +50 -0
  84. package/dist/jsx/SelectDemo.mjs +188 -0
  85. package/dist/jsx/SeparatorDemo.mjs +36 -0
  86. package/dist/jsx/ShapesDemo.mjs +18 -0
  87. package/dist/jsx/SheetDemo.mjs +141 -0
  88. package/dist/jsx/SliderDemo.mjs +34 -0
  89. package/dist/jsx/SpinnerDemo.mjs +17 -0
  90. package/dist/jsx/StacksDemo.mjs +80 -0
  91. package/dist/jsx/SwitchDemo.mjs +81 -0
  92. package/dist/jsx/TabsAdvancedDemo.mjs +303 -0
  93. package/dist/jsx/TabsDemo.mjs +158 -0
  94. package/dist/jsx/TextDemo.mjs +28 -0
  95. package/dist/jsx/ThemeBuilderDemo.mjs +154 -0
  96. package/dist/jsx/ThemeInverseDemo.mjs +45 -0
  97. package/dist/jsx/ToastDemo.mjs +98 -0
  98. package/dist/jsx/ToastDuplicateDemo.mjs +48 -0
  99. package/dist/jsx/ToggleGroupDemo.mjs +73 -0
  100. package/dist/jsx/TokensDemo.mjs +90 -0
  101. package/dist/jsx/TooltipDemo.mjs +101 -0
  102. package/dist/jsx/UpdateThemeDemo.mjs +46 -0
  103. package/dist/jsx/index.mjs +49 -0
  104. package/dist/jsx/tamagui.config.mjs +4 -0
  105. package/dist/jsx/useOnIntersecting.mjs +43 -0
  106. package/package.json +18 -18
@@ -0,0 +1,36 @@
1
+ import { Button, Input, TextArea, XStack, YStack } from "tamagui";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ function InputsDemo() {
4
+ return /* @__PURE__ */jsxs(YStack, {
5
+ width: 200,
6
+ minHeight: 250,
7
+ overflow: "hidden",
8
+ space: "$2",
9
+ margin: "$3",
10
+ padding: "$2",
11
+ children: [/* @__PURE__ */jsx(InputDemo, {
12
+ size: "$2"
13
+ }), /* @__PURE__ */jsx(InputDemo, {
14
+ size: "$3"
15
+ }), /* @__PURE__ */jsx(InputDemo, {
16
+ size: "$4"
17
+ }), /* @__PURE__ */jsx(TextArea, {
18
+ placeholder: "Enter your details..."
19
+ })]
20
+ });
21
+ }
22
+ function InputDemo(props) {
23
+ return /* @__PURE__ */jsxs(XStack, {
24
+ alignItems: "center",
25
+ space: "$2",
26
+ children: [/* @__PURE__ */jsx(Input, {
27
+ flex: 1,
28
+ size: props.size,
29
+ placeholder: `Size ${props.size}...`
30
+ }), /* @__PURE__ */jsx(Button, {
31
+ size: props.size,
32
+ children: "Go"
33
+ })]
34
+ });
35
+ }
36
+ export { InputsDemo };
@@ -0,0 +1,36 @@
1
+ import { Input, Label, Switch, XStack, YStack } from "tamagui";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ function LabelDemo() {
4
+ return /* @__PURE__ */jsxs(YStack, {
5
+ padding: "$3",
6
+ minWidth: 300,
7
+ space: "$4",
8
+ children: [/* @__PURE__ */jsxs(XStack, {
9
+ alignItems: "center",
10
+ space: "$4",
11
+ children: [/* @__PURE__ */jsx(Label, {
12
+ width: 90,
13
+ htmlFor: "name",
14
+ children: "Name"
15
+ }), /* @__PURE__ */jsx(Input, {
16
+ flex: 1,
17
+ id: "name",
18
+ defaultValue: "Nate Wienert"
19
+ })]
20
+ }), /* @__PURE__ */jsxs(XStack, {
21
+ alignItems: "center",
22
+ space: "$4",
23
+ children: [/* @__PURE__ */jsx(Label, {
24
+ width: 90,
25
+ htmlFor: "notify",
26
+ children: "Notifications"
27
+ }), /* @__PURE__ */jsx(Switch, {
28
+ id: "notify",
29
+ children: /* @__PURE__ */jsx(Switch.Thumb, {
30
+ animation: "quick"
31
+ })
32
+ })]
33
+ })]
34
+ });
35
+ }
36
+ export { LabelDemo };
@@ -0,0 +1,24 @@
1
+ import { XStack } from "tamagui";
2
+ import { LinearGradient } from "tamagui/linear-gradient";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ function LinearGradientDemo() {
5
+ return /* @__PURE__ */jsxs(XStack, {
6
+ space: !0,
7
+ children: [/* @__PURE__ */jsx(LinearGradient, {
8
+ width: "$6",
9
+ height: "$6",
10
+ borderRadius: "$4",
11
+ colors: ["$red10", "$yellow10"],
12
+ start: [0, 1],
13
+ end: [0, 0]
14
+ }), /* @__PURE__ */jsx(LinearGradient, {
15
+ width: "$6",
16
+ height: "$6",
17
+ borderRadius: "$4",
18
+ colors: ["$background", "$color"],
19
+ start: [1, 1],
20
+ end: [0, 0]
21
+ })]
22
+ });
23
+ }
24
+ export { LinearGradientDemo };
@@ -0,0 +1,76 @@
1
+ import { ChevronRight, Cloud, Moon, Star, Sun } from "@tamagui/lucide-icons";
2
+ import { ListItem, Separator, XStack, YGroup } from "tamagui";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ function ListItemDemo() {
5
+ return /* @__PURE__ */jsxs(XStack, {
6
+ $sm: {
7
+ flexDirection: "column"
8
+ },
9
+ paddingHorizontal: "$4",
10
+ space: !0,
11
+ children: [/* @__PURE__ */jsx(ListItemDemo1, {}), /* @__PURE__ */jsx(ListItemDemo2, {})]
12
+ });
13
+ }
14
+ function ListItemDemo1() {
15
+ return /* @__PURE__ */jsxs(YGroup, {
16
+ alignSelf: "center",
17
+ bordered: !0,
18
+ width: 240,
19
+ size: "$4",
20
+ children: [/* @__PURE__ */jsx(YGroup.Item, {
21
+ children: /* @__PURE__ */jsx(ListItem, {
22
+ hoverTheme: !0,
23
+ icon: Star,
24
+ title: "Star",
25
+ subTitle: "Twinkles"
26
+ })
27
+ }), /* @__PURE__ */jsx(YGroup.Item, {
28
+ children: /* @__PURE__ */jsx(ListItem, {
29
+ hoverTheme: !0,
30
+ icon: Moon,
31
+ children: "Moon"
32
+ })
33
+ }), /* @__PURE__ */jsx(YGroup.Item, {
34
+ children: /* @__PURE__ */jsx(ListItem, {
35
+ hoverTheme: !0,
36
+ icon: Sun,
37
+ children: "Sun"
38
+ })
39
+ }), /* @__PURE__ */jsx(YGroup.Item, {
40
+ children: /* @__PURE__ */jsx(ListItem, {
41
+ hoverTheme: !0,
42
+ icon: Cloud,
43
+ children: "Cloud"
44
+ })
45
+ })]
46
+ });
47
+ }
48
+ function ListItemDemo2() {
49
+ return /* @__PURE__ */jsxs(YGroup, {
50
+ alignSelf: "center",
51
+ bordered: !0,
52
+ width: 240,
53
+ size: "$5",
54
+ separator: /* @__PURE__ */jsx(Separator, {}),
55
+ children: [/* @__PURE__ */jsx(YGroup.Item, {
56
+ children: /* @__PURE__ */jsx(ListItem, {
57
+ hoverTheme: !0,
58
+ pressTheme: !0,
59
+ title: "Star",
60
+ subTitle: "Subtitle",
61
+ icon: Star,
62
+ iconAfter: ChevronRight
63
+ })
64
+ }), /* @__PURE__ */jsx(YGroup.Item, {
65
+ children: /* @__PURE__ */jsx(ListItem, {
66
+ hoverTheme: !0,
67
+ pressTheme: !0,
68
+ title: "Moon",
69
+ subTitle: "Subtitle",
70
+ icon: Moon,
71
+ iconAfter: ChevronRight
72
+ })
73
+ })]
74
+ });
75
+ }
76
+ export { ListItemDemo };
@@ -0,0 +1,58 @@
1
+ import * as LucideIcons from "@tamagui/lucide-icons";
2
+ import { useMemo, useState } from "react";
3
+ import { ScrollView } from "react-native-web";
4
+ import { Input, Paragraph, Spacer, YStack, useDebounceValue } from "tamagui";
5
+ import { Grid } from "./Grid.mjs";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ const lucideIcons = Object.keys(
8
+ // vite tree shaking workaround
9
+ typeof LucideIcons < "u" ? LucideIcons : {}).map(name => ({
10
+ key: name.toLowerCase(),
11
+ name,
12
+ Icon: LucideIcons[name]
13
+ }));
14
+ function LucideIconsDemo() {
15
+ const [searchRaw, setSearch] = useState(""),
16
+ search = useDebounceValue(searchRaw, 400),
17
+ size = 100,
18
+ iconsMemo = useMemo(() => lucideIcons.filter(x => x.key.includes(search.toLowerCase())).map(({
19
+ Icon,
20
+ name
21
+ }) => /* @__PURE__ */jsxs(YStack, {
22
+ height: size + 20,
23
+ alignItems: "center",
24
+ justifyContent: "center",
25
+ children: [/* @__PURE__ */jsx(Icon, {
26
+ size: size * 0.25
27
+ }), /* @__PURE__ */jsx(Spacer, {}), /* @__PURE__ */jsx(Paragraph, {
28
+ height: "$6",
29
+ wordWrap: "break-word",
30
+ maxWidth: "100%",
31
+ textAlign: "center",
32
+ paddingHorizontal: "$2",
33
+ size: "$1",
34
+ opacity: 0.5,
35
+ children: name
36
+ })]
37
+ }, name)), [search]);
38
+ return /* @__PURE__ */jsxs(YStack, {
39
+ minWidth: "100%",
40
+ padding: "$4",
41
+ paddingBottom: "$0",
42
+ space: !0,
43
+ children: [/* @__PURE__ */jsx(Input, {
44
+ value: searchRaw,
45
+ onChangeText: setSearch,
46
+ placeholder: "Search..."
47
+ }), /* @__PURE__ */jsx(YStack, {
48
+ height: 420,
49
+ children: /* @__PURE__ */jsx(ScrollView, {
50
+ children: /* @__PURE__ */jsx(Grid, {
51
+ itemMinWidth: size,
52
+ children: iconsMemo
53
+ })
54
+ })
55
+ })]
56
+ });
57
+ }
58
+ export { LucideIconsDemo };
@@ -0,0 +1,106 @@
1
+ import { ChevronDown, ChevronLeft, ChevronRight, ChevronUp } from "@tamagui/lucide-icons";
2
+ import { Adapt, Button, Input, Label, Popover, XStack, YStack } from "tamagui";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ function PopoverDemo() {
5
+ return /* @__PURE__ */jsxs(XStack, {
6
+ space: "$2",
7
+ flex: 1,
8
+ justifyContent: "center",
9
+ alignItems: "center",
10
+ children: [/* @__PURE__ */jsx(Demo, {
11
+ placement: "left",
12
+ Icon: ChevronLeft,
13
+ Name: "left-popover"
14
+ }), /* @__PURE__ */jsx(Demo, {
15
+ placement: "bottom",
16
+ Icon: ChevronDown,
17
+ Name: "bottom-popover"
18
+ }), /* @__PURE__ */jsx(Demo, {
19
+ placement: "top",
20
+ Icon: ChevronUp,
21
+ Name: "top-popover"
22
+ }), /* @__PURE__ */jsx(Demo, {
23
+ placement: "right",
24
+ Icon: ChevronRight,
25
+ Name: "right-popover"
26
+ })]
27
+ });
28
+ }
29
+ function Demo({
30
+ Icon,
31
+ Name,
32
+ ...props
33
+ }) {
34
+ return /* @__PURE__ */jsxs(Popover, {
35
+ size: "$5",
36
+ allowFlip: !0,
37
+ ...props,
38
+ children: [/* @__PURE__ */jsx(Popover.Trigger, {
39
+ asChild: !0,
40
+ children: /* @__PURE__ */jsx(Button, {
41
+ icon: Icon
42
+ })
43
+ }), /* @__PURE__ */jsx(Adapt, {
44
+ when: "sm",
45
+ platform: "touch",
46
+ children: /* @__PURE__ */jsxs(Popover.Sheet, {
47
+ modal: !0,
48
+ dismissOnSnapToBottom: !0,
49
+ children: [/* @__PURE__ */jsx(Popover.Sheet.Frame, {
50
+ padding: "$4",
51
+ children: /* @__PURE__ */jsx(Adapt.Contents, {})
52
+ }), /* @__PURE__ */jsx(Popover.Sheet.Overlay, {
53
+ animation: "lazy",
54
+ enterStyle: {
55
+ opacity: 0
56
+ },
57
+ exitStyle: {
58
+ opacity: 0
59
+ }
60
+ })]
61
+ })
62
+ }), /* @__PURE__ */jsxs(Popover.Content, {
63
+ borderWidth: 1,
64
+ borderColor: "$borderColor",
65
+ enterStyle: {
66
+ y: -10,
67
+ opacity: 0
68
+ },
69
+ exitStyle: {
70
+ y: -10,
71
+ opacity: 0
72
+ },
73
+ elevate: !0,
74
+ animation: ["quick", {
75
+ opacity: {
76
+ overshootClamping: !0
77
+ }
78
+ }],
79
+ children: [/* @__PURE__ */jsx(Popover.Arrow, {
80
+ borderWidth: 1,
81
+ borderColor: "$borderColor"
82
+ }), /* @__PURE__ */jsxs(YStack, {
83
+ space: "$3",
84
+ children: [/* @__PURE__ */jsxs(XStack, {
85
+ space: "$3",
86
+ children: [/* @__PURE__ */jsx(Label, {
87
+ size: "$3",
88
+ htmlFor: Name,
89
+ children: "Name"
90
+ }), /* @__PURE__ */jsx(Input, {
91
+ size: "$3",
92
+ id: Name
93
+ })]
94
+ }), /* @__PURE__ */jsx(Popover.Close, {
95
+ asChild: !0,
96
+ children: /* @__PURE__ */jsx(Button, {
97
+ size: "$3",
98
+ onPress: () => {},
99
+ children: "Submit"
100
+ })
101
+ })]
102
+ })]
103
+ })]
104
+ });
105
+ }
106
+ export { Demo, PopoverDemo };
@@ -0,0 +1,64 @@
1
+ import { useEffect, useState } from "react";
2
+ import { Button, Paragraph, Progress, Slider, XStack, YStack } from "tamagui";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ function ProgressDemo() {
5
+ const [size, setSize] = useState(4),
6
+ [progress, setProgress] = useState(20),
7
+ sizeProp = `$${size}`;
8
+ return useEffect(() => {
9
+ const timer = setTimeout(() => setProgress(60), 1e3);
10
+ return () => {
11
+ clearTimeout(timer);
12
+ };
13
+ }, []), /* @__PURE__ */jsxs(Fragment, {
14
+ children: [/* @__PURE__ */jsxs(YStack, {
15
+ height: 60,
16
+ alignItems: "center",
17
+ space: !0,
18
+ children: [/* @__PURE__ */jsxs(Paragraph, {
19
+ height: 30,
20
+ opacity: 0.5,
21
+ children: ["Size: ", size]
22
+ }), /* @__PURE__ */jsx(Progress, {
23
+ size: sizeProp,
24
+ value: progress,
25
+ children: /* @__PURE__ */jsx(Progress.Indicator, {
26
+ animation: "bouncy"
27
+ })
28
+ })]
29
+ }), /* @__PURE__ */jsxs(XStack, {
30
+ alignItems: "center",
31
+ space: !0,
32
+ position: "absolute",
33
+ bottom: "$3",
34
+ left: "$4",
35
+ $xxs: {
36
+ display: "none"
37
+ },
38
+ children: [/* @__PURE__ */jsxs(Slider, {
39
+ size: "$2",
40
+ width: 130,
41
+ defaultValue: [4],
42
+ min: 2,
43
+ max: 6,
44
+ step: 1,
45
+ onValueChange: ([val]) => {
46
+ setSize(val);
47
+ },
48
+ children: [/* @__PURE__ */jsx(Slider.Track, {
49
+ borderWidth: 1,
50
+ borderColor: "$color5",
51
+ children: /* @__PURE__ */jsx(Slider.TrackActive, {})
52
+ }), /* @__PURE__ */jsx(Slider.Thumb, {
53
+ circular: !0,
54
+ index: 0
55
+ })]
56
+ }), /* @__PURE__ */jsx(Button, {
57
+ size: "$2",
58
+ onPress: () => setProgress(prev => (prev + 20) % 100),
59
+ children: "Load"
60
+ })]
61
+ })]
62
+ });
63
+ }
64
+ export { ProgressDemo };
@@ -0,0 +1,46 @@
1
+ import { Label, RadioGroup, XStack, YStack } from "tamagui";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ function RadioGroupDemo() {
4
+ return /* @__PURE__ */jsx(RadioGroup, {
5
+ "aria-labelledby": "Select one item",
6
+ defaultValue: "3",
7
+ name: "form",
8
+ children: /* @__PURE__ */jsxs(YStack, {
9
+ width: 300,
10
+ alignItems: "center",
11
+ space: "$2",
12
+ children: [/* @__PURE__ */jsx(RadioGroupItemWithLabel, {
13
+ size: "$3",
14
+ value: "2",
15
+ label: "Second value"
16
+ }), /* @__PURE__ */jsx(RadioGroupItemWithLabel, {
17
+ size: "$4",
18
+ value: "3",
19
+ label: "Third value"
20
+ }), /* @__PURE__ */jsx(RadioGroupItemWithLabel, {
21
+ size: "$5",
22
+ value: "4",
23
+ label: "Fourth value"
24
+ })]
25
+ })
26
+ });
27
+ }
28
+ function RadioGroupItemWithLabel(props) {
29
+ const id = `radiogroup-${props.value}`;
30
+ return /* @__PURE__ */jsxs(XStack, {
31
+ width: 300,
32
+ alignItems: "center",
33
+ space: "$4",
34
+ children: [/* @__PURE__ */jsx(RadioGroup.Item, {
35
+ value: props.value,
36
+ id,
37
+ size: props.size,
38
+ children: /* @__PURE__ */jsx(RadioGroup.Indicator, {})
39
+ }), /* @__PURE__ */jsx(Label, {
40
+ size: props.size,
41
+ htmlFor: id,
42
+ children: props.label
43
+ })]
44
+ });
45
+ }
46
+ export { RadioGroupDemo, RadioGroupItemWithLabel };
@@ -0,0 +1,43 @@
1
+ import { addTheme, replaceTheme } from "@tamagui/theme";
2
+ import { useState } from "react";
3
+ import { Button, Square, Theme, XStack, YStack, useForceUpdate, useIsomorphicLayoutEffect } from "tamagui";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ function ReplaceThemeDemo() {
6
+ const [theme, setTheme] = useState(),
7
+ update = useForceUpdate();
8
+ return useIsomorphicLayoutEffect(() => {
9
+ addTheme({
10
+ name: "mytheme",
11
+ insertCSS: !0,
12
+ theme: {
13
+ color: "red",
14
+ color2: "green"
15
+ }
16
+ }), setTheme("mytheme");
17
+ }, []), /* @__PURE__ */jsxs(YStack, {
18
+ alignItems: "center",
19
+ space: !0,
20
+ children: [/* @__PURE__ */jsx(XStack, {
21
+ gap: "$5",
22
+ children: /* @__PURE__ */jsx(Theme, {
23
+ name: theme ?? null,
24
+ children: /* @__PURE__ */jsx(Square, {
25
+ borderRadius: "$8",
26
+ size: 100,
27
+ backgroundColor: "$color"
28
+ })
29
+ })
30
+ }), /* @__PURE__ */jsx(Button, {
31
+ onPress: () => {
32
+ replaceTheme({
33
+ name: "mytheme",
34
+ theme: {
35
+ color: "blue"
36
+ }
37
+ }), update();
38
+ },
39
+ children: "Replace theme to only have $color: blue"
40
+ })]
41
+ });
42
+ }
43
+ export { ReplaceThemeDemo };
@@ -0,0 +1,50 @@
1
+ import { Circle, ScrollView, Square, XStack } from "tamagui";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ function ScrollViewDemo() {
4
+ return /* @__PURE__ */jsx(ScrollView, {
5
+ maxHeight: 250,
6
+ width: "75%",
7
+ backgroundColor: "$background",
8
+ padding: "$4",
9
+ borderRadius: "$4",
10
+ children: /* @__PURE__ */jsxs(XStack, {
11
+ flexWrap: "wrap",
12
+ alignItems: "center",
13
+ justifyContent: "center",
14
+ children: [/* @__PURE__ */jsx(Square, {
15
+ margin: "$4",
16
+ size: 120,
17
+ backgroundColor: "$red9"
18
+ }), /* @__PURE__ */jsx(Circle, {
19
+ margin: "$4",
20
+ size: 120,
21
+ backgroundColor: "$orange9"
22
+ }), /* @__PURE__ */jsx(Square, {
23
+ margin: "$4",
24
+ size: 120,
25
+ backgroundColor: "$yellow9"
26
+ }), /* @__PURE__ */jsx(Circle, {
27
+ margin: "$4",
28
+ size: 120,
29
+ backgroundColor: "$green9"
30
+ }), /* @__PURE__ */jsx(Square, {
31
+ margin: "$4",
32
+ size: 120,
33
+ backgroundColor: "$blue9"
34
+ }), /* @__PURE__ */jsx(Circle, {
35
+ margin: "$4",
36
+ size: 120,
37
+ backgroundColor: "$purple9"
38
+ }), /* @__PURE__ */jsx(Square, {
39
+ margin: "$4",
40
+ size: 120,
41
+ backgroundColor: "$pink9"
42
+ }), /* @__PURE__ */jsx(Circle, {
43
+ margin: "$4",
44
+ size: 120,
45
+ backgroundColor: "$red9"
46
+ })]
47
+ })
48
+ });
49
+ }
50
+ export { ScrollViewDemo };