@tamagui/demos 1.27.2 → 1.28.0

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 (62) hide show
  1. package/dist/cjs/ButtonDemo.js +2 -2
  2. package/dist/cjs/ButtonDemo.js.map +1 -1
  3. package/dist/esm/ButtonDemo.js +2 -2
  4. package/dist/esm/ButtonDemo.js.map +1 -1
  5. package/dist/jsx/ButtonDemo.js +2 -2
  6. package/dist/jsx/ButtonDemo.js.map +1 -1
  7. package/dist/jsx/ButtonDemo.mjs +2 -2
  8. package/dist/jsx/ButtonDemo.mjs.map +1 -1
  9. package/package.json +18 -18
  10. package/src/ButtonDemo.tsx +2 -2
  11. package/dist/esm/AddThemeDemo.mjs +0 -36
  12. package/dist/esm/AlertDialogDemo.mjs +0 -53
  13. package/dist/esm/AnimationsDemo.mjs +0 -89
  14. package/dist/esm/AnimationsEnterDemo.mjs +0 -40
  15. package/dist/esm/AnimationsHoverDemo.mjs +0 -27
  16. package/dist/esm/AnimationsPresenceDemo.mjs +0 -73
  17. package/dist/esm/AnimationsTimingDemo.mjs +0 -26
  18. package/dist/esm/AvatarDemo.mjs +0 -30
  19. package/dist/esm/ButtonDemo.mjs +0 -25
  20. package/dist/esm/ButtonNewDemo.mjs +0 -31
  21. package/dist/esm/CardDemo.mjs +0 -48
  22. package/dist/esm/CheckboxDemo.mjs +0 -22
  23. package/dist/esm/ColorsDemo.mjs +0 -98
  24. package/dist/esm/DialogDemo.mjs +0 -84
  25. package/dist/esm/FormsDemo.mjs +0 -36
  26. package/dist/esm/GroupDemo.mjs +0 -25
  27. package/dist/esm/HeadingsDemo.mjs +0 -16
  28. package/dist/esm/ImageDemo.mjs +0 -18
  29. package/dist/esm/InputsDemo.mjs +0 -31
  30. package/dist/esm/LabelDemo.mjs +0 -18
  31. package/dist/esm/LinearGradientDemo.mjs +0 -33
  32. package/dist/esm/ListItemDemo.mjs +0 -47
  33. package/dist/esm/LucideIconsDemo.mjs +0 -52
  34. package/dist/esm/PopoverDemo.mjs +0 -76
  35. package/dist/esm/ProgressDemo.mjs +0 -59
  36. package/dist/esm/RadioGroupDemo.mjs +0 -21
  37. package/dist/esm/ReplaceThemeDemo.mjs +0 -49
  38. package/dist/esm/ScrollViewDemo.mjs +0 -18
  39. package/dist/esm/SelectDemo.mjs +0 -137
  40. package/dist/esm/SeparatorDemo.mjs +0 -20
  41. package/dist/esm/ShapesDemo.mjs +0 -12
  42. package/dist/esm/SheetDemo.mjs +0 -91
  43. package/dist/esm/SliderDemo.mjs +0 -19
  44. package/dist/esm/SpinnerDemo.mjs +0 -12
  45. package/dist/esm/StacksDemo.mjs +0 -58
  46. package/dist/esm/SwitchDemo.mjs +0 -33
  47. package/dist/esm/TabsAdvancedDemo.mjs +0 -283
  48. package/dist/esm/TabsDemo.mjs +0 -141
  49. package/dist/esm/TextDemo.mjs +0 -16
  50. package/dist/esm/ThemeInverseDemo.mjs +0 -42
  51. package/dist/esm/ToastDemo.mjs +0 -101
  52. package/dist/esm/ToastDuplicateDemo.mjs +0 -44
  53. package/dist/esm/ToggleGroupDemo.mjs +0 -49
  54. package/dist/esm/TokensDemo.mjs +0 -87
  55. package/dist/esm/TooltipDemo.mjs +0 -68
  56. package/dist/esm/UpdateThemeDemo.mjs +0 -56
  57. package/dist/esm/conf.mjs +0 -5
  58. package/dist/esm/index.mjs +0 -48
  59. package/dist/esm/tamagui.config.mjs +0 -6
  60. package/dist/esm/useOnIntersecting.mjs +0 -68
  61. package/dist/jsx/ButtonHeadlessDemo.mjs +0 -92
  62. package/dist/jsx/ButtonSimpleDemo.mjs +0 -24
@@ -1,52 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import * as LucideIcons from "@tamagui/lucide-icons";
3
- import { useMemo, useState } from "react";
4
- import { ScrollView } from "react-native";
5
- import { Grid, Input, Paragraph, Spacer, YStack, useDebounceValue } from "tamagui";
6
- const lucideIcons = Object.keys(LucideIcons).map((name) => ({
7
- key: name.toLowerCase(),
8
- name,
9
- Icon: LucideIcons[name]
10
- }));
11
- function LucideIconsDemo() {
12
- const [searchRaw, setSearch] = useState("");
13
- const search = useDebounceValue(searchRaw, 400);
14
- const size = 100;
15
- const iconsMemo = useMemo(
16
- () => lucideIcons.filter((x) => x.key.startsWith(search.toLowerCase())).map(({ Icon, name }) => /* @__PURE__ */ jsxs(
17
- YStack,
18
- {
19
- height: size + 20,
20
- alignItems: "center",
21
- justifyContent: "center",
22
- children: [
23
- /* @__PURE__ */ jsx(Icon, { size: size * 0.25 }),
24
- /* @__PURE__ */ jsx(Spacer, {}),
25
- /* @__PURE__ */ jsx(
26
- Paragraph,
27
- {
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
- )
38
- ]
39
- },
40
- name
41
- )),
42
- [search]
43
- );
44
- return /* @__PURE__ */ jsxs(YStack, { minWidth: "100%", padding: "$4", paddingBottom: "$0", space: true, children: [
45
- /* @__PURE__ */ jsx(Input, { value: searchRaw, onChangeText: setSearch, placeholder: "Search..." }),
46
- /* @__PURE__ */ jsx(YStack, { height: 420, children: /* @__PURE__ */ jsx(ScrollView, { children: /* @__PURE__ */ jsx(Grid, { itemMinWidth: size, children: iconsMemo }) }) })
47
- ] });
48
- }
49
- export {
50
- LucideIconsDemo
51
- };
52
- //# sourceMappingURL=LucideIconsDemo.mjs.map
@@ -1,76 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { ChevronDown, ChevronLeft, ChevronRight, ChevronUp } from "@tamagui/lucide-icons";
3
- import {
4
- Adapt,
5
- Button,
6
- Input,
7
- Label,
8
- Popover,
9
- XStack,
10
- YStack
11
- } from "tamagui";
12
- function PopoverDemo() {
13
- return /* @__PURE__ */ jsxs(XStack, { space: "$2", flex: 1, justifyContent: "center", alignItems: "center", children: [
14
- /* @__PURE__ */ jsx(Demo, { placement: "left", Icon: ChevronLeft, Name: "left-popover" }),
15
- /* @__PURE__ */ jsx(Demo, { placement: "bottom", Icon: ChevronDown, Name: "bottom-popover" }),
16
- /* @__PURE__ */ jsx(Demo, { placement: "top", Icon: ChevronUp, Name: "top-popover" }),
17
- /* @__PURE__ */ jsx(Demo, { placement: "right", Icon: ChevronRight, Name: "right-popover" })
18
- ] });
19
- }
20
- function Demo({
21
- Icon,
22
- Name,
23
- ...props
24
- }) {
25
- return /* @__PURE__ */ jsxs(Popover, { size: "$5", allowFlip: true, ...props, children: [
26
- /* @__PURE__ */ jsx(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { icon: Icon }) }),
27
- /* @__PURE__ */ jsx(Adapt, { when: "sm", platform: "touch", children: /* @__PURE__ */ jsxs(Popover.Sheet, { modal: true, dismissOnSnapToBottom: true, children: [
28
- /* @__PURE__ */ jsx(Popover.Sheet.Frame, { padding: "$4", children: /* @__PURE__ */ jsx(Adapt.Contents, {}) }),
29
- /* @__PURE__ */ jsx(Popover.Sheet.Overlay, {})
30
- ] }) }),
31
- /* @__PURE__ */ jsxs(
32
- Popover.Content,
33
- {
34
- borderWidth: 1,
35
- borderColor: "$borderColor",
36
- enterStyle: { x: 0, y: -10, opacity: 0 },
37
- exitStyle: { x: 0, y: -10, opacity: 0 },
38
- x: 0,
39
- y: 0,
40
- opacity: 1,
41
- animation: [
42
- "quick",
43
- {
44
- opacity: {
45
- overshootClamping: true
46
- }
47
- }
48
- ],
49
- elevate: true,
50
- children: [
51
- /* @__PURE__ */ jsx(Popover.Arrow, { borderWidth: 1, borderColor: "$borderColor" }),
52
- /* @__PURE__ */ jsxs(YStack, { space: "$3", children: [
53
- /* @__PURE__ */ jsxs(XStack, { space: "$3", children: [
54
- /* @__PURE__ */ jsx(Label, { size: "$3", htmlFor: Name, children: "Name" }),
55
- /* @__PURE__ */ jsx(Input, { size: "$3", id: Name })
56
- ] }),
57
- /* @__PURE__ */ jsx(Popover.Close, { asChild: true, children: /* @__PURE__ */ jsx(
58
- Button,
59
- {
60
- size: "$3",
61
- onPress: () => {
62
- },
63
- children: "Submit"
64
- }
65
- ) })
66
- ] })
67
- ]
68
- }
69
- )
70
- ] });
71
- }
72
- export {
73
- Demo,
74
- PopoverDemo
75
- };
76
- //# sourceMappingURL=PopoverDemo.mjs.map
@@ -1,59 +0,0 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { useEffect, useState } from "react";
3
- import { Button, Paragraph, Progress, Slider, XStack, YStack } from "tamagui";
4
- function ProgressDemo() {
5
- const [size, setSize] = useState(4);
6
- const [progress, setProgress] = useState(20);
7
- const sizeProp = `$${size}`;
8
- useEffect(() => {
9
- const timer = setTimeout(() => setProgress(60), 1e3);
10
- return () => {
11
- clearTimeout(timer);
12
- };
13
- }, []);
14
- return /* @__PURE__ */ jsxs(Fragment, { children: [
15
- /* @__PURE__ */ jsxs(YStack, { height: 60, alignItems: "center", space: true, children: [
16
- /* @__PURE__ */ jsxs(Paragraph, { height: 30, opacity: 0.5, children: [
17
- "Size: ",
18
- size
19
- ] }),
20
- /* @__PURE__ */ jsx(Progress, { size: sizeProp, value: progress, children: /* @__PURE__ */ jsx(Progress.Indicator, { animation: "bouncy" }) })
21
- ] }),
22
- /* @__PURE__ */ jsxs(
23
- XStack,
24
- {
25
- alignItems: "center",
26
- space: true,
27
- position: "absolute",
28
- bottom: "$3",
29
- left: "$4",
30
- $xxs: { display: "none" },
31
- children: [
32
- /* @__PURE__ */ jsxs(
33
- Slider,
34
- {
35
- size: "$2",
36
- width: 130,
37
- defaultValue: [4],
38
- min: 2,
39
- max: 6,
40
- step: 1,
41
- onValueChange: ([val]) => {
42
- setSize(val);
43
- },
44
- children: [
45
- /* @__PURE__ */ jsx(Slider.Track, { borderWidth: 1, borderColor: "$color5", children: /* @__PURE__ */ jsx(Slider.TrackActive, {}) }),
46
- /* @__PURE__ */ jsx(Slider.Thumb, { circular: true, index: 0 })
47
- ]
48
- }
49
- ),
50
- /* @__PURE__ */ jsx(Button, { size: "$2", onPress: () => setProgress((prev) => (prev + 20) % 100), children: "Load" })
51
- ]
52
- }
53
- )
54
- ] });
55
- }
56
- export {
57
- ProgressDemo
58
- };
59
- //# sourceMappingURL=ProgressDemo.mjs.map
@@ -1,21 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Label, RadioGroup, XStack, YStack } from "tamagui";
3
- function RadioGroupDemo() {
4
- return /* @__PURE__ */ jsx(RadioGroup, { defaultValue: "3", name: "form", children: /* @__PURE__ */ jsxs(YStack, { width: 300, alignItems: "center", space: "$2", children: [
5
- /* @__PURE__ */ jsx(RadioGroupItemWithLabel, { size: "$3", value: "2", label: "Second value" }),
6
- /* @__PURE__ */ jsx(RadioGroupItemWithLabel, { size: "$4", value: "3", label: "Third value" }),
7
- /* @__PURE__ */ jsx(RadioGroupItemWithLabel, { size: "$5", value: "4", label: "Fourth value" })
8
- ] }) });
9
- }
10
- function RadioGroupItemWithLabel(props) {
11
- const id = `radiogroup-${props.value}`;
12
- return /* @__PURE__ */ jsxs(XStack, { width: 300, alignItems: "center", space: "$4", children: [
13
- /* @__PURE__ */ jsx(RadioGroup.Item, { value: props.value, id, size: props.size, children: /* @__PURE__ */ jsx(RadioGroup.Indicator, {}) }),
14
- /* @__PURE__ */ jsx(Label, { size: props.size, htmlFor: id, children: props.label })
15
- ] });
16
- }
17
- export {
18
- RadioGroupDemo,
19
- RadioGroupItemWithLabel
20
- };
21
- //# sourceMappingURL=RadioGroupDemo.mjs.map
@@ -1,49 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { addTheme, replaceTheme } from "@tamagui/theme";
3
- import { useState } from "react";
4
- import {
5
- Button,
6
- Square,
7
- Theme,
8
- XStack,
9
- YStack,
10
- useForceUpdate,
11
- useIsomorphicLayoutEffect
12
- } from "tamagui";
13
- function ReplaceThemeDemo() {
14
- const [theme, setTheme] = useState();
15
- const update = useForceUpdate();
16
- useIsomorphicLayoutEffect(() => {
17
- addTheme({
18
- name: "mytheme",
19
- insertCSS: true,
20
- theme: {
21
- color: "red",
22
- color2: "green"
23
- }
24
- });
25
- setTheme("mytheme");
26
- }, []);
27
- return /* @__PURE__ */ jsxs(YStack, { alignItems: "center", space: true, children: [
28
- /* @__PURE__ */ jsx(XStack, { gap: "$5", children: /* @__PURE__ */ jsx(Theme, { name: theme ?? null, children: /* @__PURE__ */ jsx(Square, { borderRadius: "$8", size: 100, backgroundColor: "$color" }) }) }),
29
- /* @__PURE__ */ jsx(
30
- Button,
31
- {
32
- onPress: () => {
33
- replaceTheme({
34
- name: "mytheme",
35
- theme: {
36
- color: "blue"
37
- }
38
- });
39
- update();
40
- },
41
- children: "Replace theme to only have $color: blue"
42
- }
43
- )
44
- ] });
45
- }
46
- export {
47
- ReplaceThemeDemo
48
- };
49
- //# sourceMappingURL=ReplaceThemeDemo.mjs.map
@@ -1,18 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Circle, ScrollView, Square, XStack } from "tamagui";
3
- function ScrollViewDemo() {
4
- return /* @__PURE__ */ jsx(ScrollView, { maxHeight: 250, width: "75%", backgroundColor: "$background", padding: "$4", borderRadius: "$4", children: /* @__PURE__ */ jsxs(XStack, { flexWrap: "wrap", alignItems: "center", justifyContent: "center", children: [
5
- /* @__PURE__ */ jsx(Square, { margin: "$4", size: 120, backgroundColor: "$red9" }),
6
- /* @__PURE__ */ jsx(Circle, { margin: "$4", size: 120, backgroundColor: "$orange9" }),
7
- /* @__PURE__ */ jsx(Square, { margin: "$4", size: 120, backgroundColor: "$yellow9" }),
8
- /* @__PURE__ */ jsx(Circle, { margin: "$4", size: 120, backgroundColor: "$green9" }),
9
- /* @__PURE__ */ jsx(Square, { margin: "$4", size: 120, backgroundColor: "$blue9" }),
10
- /* @__PURE__ */ jsx(Circle, { margin: "$4", size: 120, backgroundColor: "$purple9" }),
11
- /* @__PURE__ */ jsx(Square, { margin: "$4", size: 120, backgroundColor: "$pink9" }),
12
- /* @__PURE__ */ jsx(Circle, { margin: "$4", size: 120, backgroundColor: "$red9" })
13
- ] }) });
14
- }
15
- export {
16
- ScrollViewDemo
17
- };
18
- //# sourceMappingURL=ScrollViewDemo.mjs.map
@@ -1,137 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Check, ChevronDown, ChevronUp } from "@tamagui/lucide-icons";
3
- import { useState } from "react";
4
- import {
5
- Adapt,
6
- Label,
7
- Select,
8
- Sheet,
9
- XStack,
10
- YStack,
11
- getFontSize
12
- } from "tamagui";
13
- import { LinearGradient } from "tamagui/linear-gradient";
14
- function SelectDemo() {
15
- return /* @__PURE__ */ jsxs(YStack, { space: true, children: [
16
- /* @__PURE__ */ jsxs(XStack, { ai: "center", space: true, children: [
17
- /* @__PURE__ */ jsx(Label, { f: 1, fb: 0, children: "Custom" }),
18
- /* @__PURE__ */ jsx(SelectDemoItem, {})
19
- ] }),
20
- /* @__PURE__ */ jsxs(XStack, { ai: "center", space: true, children: [
21
- /* @__PURE__ */ jsx(Label, { f: 1, fb: 0, children: "Native" }),
22
- /* @__PURE__ */ jsx(SelectDemoItem, { native: true })
23
- ] })
24
- ] });
25
- }
26
- function SelectDemoItem(props) {
27
- const [val, setVal] = useState("apple");
28
- return /* @__PURE__ */ jsxs(Select, { id: "food", value: val, onValueChange: setVal, ...props, children: [
29
- /* @__PURE__ */ jsx(Select.Trigger, { width: 180, iconAfter: ChevronDown, children: /* @__PURE__ */ jsx(Select.Value, { placeholder: "Something" }) }),
30
- /* @__PURE__ */ jsx(Adapt, { when: "sm", platform: "touch", children: /* @__PURE__ */ jsxs(Sheet, { native: true, modal: true, dismissOnSnapToBottom: true, children: [
31
- /* @__PURE__ */ jsx(Sheet.Frame, { children: /* @__PURE__ */ jsx(Sheet.ScrollView, { children: /* @__PURE__ */ jsx(Adapt.Contents, {}) }) }),
32
- /* @__PURE__ */ jsx(Sheet.Overlay, {})
33
- ] }) }),
34
- /* @__PURE__ */ jsxs(Select.Content, { zIndex: 2e5, children: [
35
- /* @__PURE__ */ jsxs(
36
- Select.ScrollUpButton,
37
- {
38
- alignItems: "center",
39
- justifyContent: "center",
40
- position: "relative",
41
- width: "100%",
42
- height: "$3",
43
- children: [
44
- /* @__PURE__ */ jsx(YStack, { zIndex: 10, children: /* @__PURE__ */ jsx(ChevronUp, { size: 20 }) }),
45
- /* @__PURE__ */ jsx(
46
- LinearGradient,
47
- {
48
- start: [0, 0],
49
- end: [0, 1],
50
- fullscreen: true,
51
- colors: ["$background", "$backgroundTransparent"],
52
- borderRadius: "$4"
53
- }
54
- )
55
- ]
56
- }
57
- ),
58
- /* @__PURE__ */ jsx(Select.Viewport, { minWidth: 200, children: /* @__PURE__ */ jsxs(XStack, { children: [
59
- /* @__PURE__ */ jsxs(Select.Group, { space: "$0", children: [
60
- /* @__PURE__ */ jsx(Select.Label, { children: "Fruits" }),
61
- items.map((item, i) => {
62
- return /* @__PURE__ */ jsxs(Select.Item, { index: i, value: item.name.toLowerCase(), children: [
63
- /* @__PURE__ */ jsx(Select.ItemText, { children: item.name }),
64
- /* @__PURE__ */ jsx(Select.ItemIndicator, { marginLeft: "auto", children: /* @__PURE__ */ jsx(Check, { size: 16 }) })
65
- ] }, item.name);
66
- })
67
- ] }),
68
- props.native && /* @__PURE__ */ jsx(
69
- YStack,
70
- {
71
- position: "absolute",
72
- right: 0,
73
- top: 0,
74
- bottom: 0,
75
- alignItems: "center",
76
- justifyContent: "center",
77
- width: "$4",
78
- pointerEvents: "none",
79
- children: /* @__PURE__ */ jsx(ChevronDown, { size: getFontSize(props.size ?? "$true") })
80
- }
81
- )
82
- ] }) }),
83
- /* @__PURE__ */ jsxs(
84
- Select.ScrollDownButton,
85
- {
86
- alignItems: "center",
87
- justifyContent: "center",
88
- position: "relative",
89
- width: "100%",
90
- height: "$3",
91
- children: [
92
- /* @__PURE__ */ jsx(YStack, { zIndex: 10, children: /* @__PURE__ */ jsx(ChevronDown, { size: 20 }) }),
93
- /* @__PURE__ */ jsx(
94
- LinearGradient,
95
- {
96
- start: [0, 0],
97
- end: [0, 1],
98
- fullscreen: true,
99
- colors: ["$backgroundTransparent", "$background"],
100
- borderRadius: "$4"
101
- }
102
- )
103
- ]
104
- }
105
- )
106
- ] })
107
- ] });
108
- }
109
- const items = [
110
- { name: "Apple" },
111
- { name: "Pear" },
112
- { name: "Blackberry" },
113
- { name: "Peach" },
114
- { name: "Apricot" },
115
- { name: "Melon" },
116
- { name: "Honeydew" },
117
- { name: "Starfruit" },
118
- { name: "Blueberry" },
119
- { name: "Raspberry" },
120
- { name: "Strawberry" },
121
- { name: "Mango" },
122
- { name: "Pineapple" },
123
- { name: "Lime" },
124
- { name: "Lemon" },
125
- { name: "Coconut" },
126
- { name: "Guava" },
127
- { name: "Papaya" },
128
- { name: "Orange" },
129
- { name: "Grape" },
130
- { name: "Jackfruit" },
131
- { name: "Durian" }
132
- ];
133
- export {
134
- SelectDemo,
135
- SelectDemoItem
136
- };
137
- //# sourceMappingURL=SelectDemo.mjs.map
@@ -1,20 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Paragraph, Separator, XStack, YStack } from "tamagui";
3
- function SeparatorDemo() {
4
- return /* @__PURE__ */ jsxs(YStack, { width: "100%", maxWidth: 300, marginHorizontal: 15, children: [
5
- /* @__PURE__ */ jsx(Paragraph, { fontWeight: "800", children: "Tamagui" }),
6
- /* @__PURE__ */ jsx(Paragraph, { children: "A cross-platform component library." }),
7
- /* @__PURE__ */ jsx(Separator, { marginVertical: 15 }),
8
- /* @__PURE__ */ jsxs(XStack, { height: 20, alignItems: "center", children: [
9
- /* @__PURE__ */ jsx(Paragraph, { children: "Blog" }),
10
- /* @__PURE__ */ jsx(Separator, { alignSelf: "stretch", vertical: true, marginHorizontal: 15 }),
11
- /* @__PURE__ */ jsx(Paragraph, { children: "Docs" }),
12
- /* @__PURE__ */ jsx(Separator, { alignSelf: "stretch", vertical: true, marginHorizontal: 15 }),
13
- /* @__PURE__ */ jsx(Paragraph, { children: "Source" })
14
- ] })
15
- ] });
16
- }
17
- export {
18
- SeparatorDemo
19
- };
20
- //# sourceMappingURL=SeparatorDemo.mjs.map
@@ -1,12 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Circle, Square, XStack } from "tamagui";
3
- function ShapesDemo() {
4
- return /* @__PURE__ */ jsxs(XStack, { padding: "$2", space: "$4", children: [
5
- /* @__PURE__ */ jsx(Square, { size: 100, backgroundColor: "$color", elevation: "$4" }),
6
- /* @__PURE__ */ jsx(Circle, { size: 100, backgroundColor: "$color", elevation: "$4" })
7
- ] });
8
- }
9
- export {
10
- ShapesDemo
11
- };
12
- //# sourceMappingURL=ShapesDemo.mjs.map
@@ -1,91 +0,0 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { ChevronDown, ChevronUp } from "@tamagui/lucide-icons";
3
- import { Sheet } from "@tamagui/sheet";
4
- import { useState } from "react";
5
- import { Button, H1, H2, Input, Paragraph, XStack } from "tamagui";
6
- const SheetDemo = () => {
7
- const [position, setPosition] = useState(0);
8
- const [open, setOpen] = useState(false);
9
- const [modal, setModal] = useState(false);
10
- const [innerOpen, setInnerOpen] = useState(false);
11
- return /* @__PURE__ */ jsxs(Fragment, { children: [
12
- /* @__PURE__ */ jsxs(XStack, { space: true, children: [
13
- /* @__PURE__ */ jsx(Button, { onPress: () => setOpen(true), children: "Open" }),
14
- /* @__PURE__ */ jsx(Button, { onPress: () => setModal((x) => !x), children: modal ? "Type: Modal" : "Type: Inline" })
15
- ] }),
16
- /* @__PURE__ */ jsxs(
17
- Sheet,
18
- {
19
- forceRemoveScrollEnabled: open,
20
- modal,
21
- open,
22
- onOpenChange: setOpen,
23
- snapPoints: [85, 50, 25],
24
- dismissOnSnapToBottom: true,
25
- position,
26
- onPositionChange: setPosition,
27
- zIndex: 1e5,
28
- animation: "bouncy",
29
- native: true,
30
- children: [
31
- /* @__PURE__ */ jsx(Sheet.Overlay, {}),
32
- /* @__PURE__ */ jsx(Sheet.Handle, {}),
33
- /* @__PURE__ */ jsxs(
34
- Sheet.Frame,
35
- {
36
- flex: 1,
37
- padding: "$4",
38
- justifyContent: "center",
39
- alignItems: "center",
40
- space: "$5",
41
- children: [
42
- /* @__PURE__ */ jsx(Button, { size: "$6", circular: true, icon: ChevronDown, onPress: () => setOpen(false) }),
43
- /* @__PURE__ */ jsx(Input, { width: 200 }),
44
- modal && /* @__PURE__ */ jsxs(Fragment, { children: [
45
- /* @__PURE__ */ jsx(InnerSheet, { open: innerOpen, onOpenChange: setInnerOpen }),
46
- /* @__PURE__ */ jsx(
47
- Button,
48
- {
49
- size: "$6",
50
- circular: true,
51
- icon: ChevronUp,
52
- onPress: () => setInnerOpen(true)
53
- }
54
- )
55
- ] })
56
- ]
57
- }
58
- )
59
- ]
60
- }
61
- )
62
- ] });
63
- };
64
- function InnerSheet(props) {
65
- return /* @__PURE__ */ jsxs(Sheet, { modal: true, snapPoints: [90], dismissOnSnapToBottom: true, ...props, children: [
66
- /* @__PURE__ */ jsx(Sheet.Overlay, {}),
67
- /* @__PURE__ */ jsx(Sheet.Handle, {}),
68
- /* @__PURE__ */ jsx(Sheet.Frame, { flex: 1, justifyContent: "center", alignItems: "center", space: "$5", children: /* @__PURE__ */ jsxs(Sheet.ScrollView, { padding: "$4", space: true, children: [
69
- /* @__PURE__ */ jsx(
70
- Button,
71
- {
72
- size: "$8",
73
- circular: true,
74
- alignSelf: "center",
75
- icon: ChevronDown,
76
- onPress: () => {
77
- var _a;
78
- return (_a = props.onOpenChange) == null ? void 0 : _a.call(props, false);
79
- }
80
- }
81
- ),
82
- /* @__PURE__ */ jsx(H1, { children: "Hello world" }),
83
- /* @__PURE__ */ jsx(H2, { children: "You can scroll me" }),
84
- [1, 2, 3].map((i) => /* @__PURE__ */ jsx(Paragraph, { size: "$10", children: "Eu officia sunt ipsum nisi dolore labore est laborum laborum in esse ad pariatur. Dolor excepteur esse deserunt voluptate labore ea. Exercitation ipsum deserunt occaecat cupidatat consequat est adipisicing velit cupidatat ullamco veniam aliquip reprehenderit officia. Officia labore culpa ullamco velit. In sit occaecat velit ipsum fugiat esse aliqua dolor sint." }, i))
85
- ] }) })
86
- ] });
87
- }
88
- export {
89
- SheetDemo
90
- };
91
- //# sourceMappingURL=SheetDemo.mjs.map
@@ -1,19 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Slider, XStack } from "tamagui";
3
- function SliderDemo() {
4
- return /* @__PURE__ */ jsxs(XStack, { height: 200, alignItems: "center", space: "$8", children: [
5
- /* @__PURE__ */ jsx(SimpleSlider, { height: 200, orientation: "vertical" }),
6
- /* @__PURE__ */ jsx(SimpleSlider, { width: 200 })
7
- ] });
8
- }
9
- function SimpleSlider({ children, ...props }) {
10
- return /* @__PURE__ */ jsxs(Slider, { defaultValue: [50], max: 100, step: 1, ...props, children: [
11
- /* @__PURE__ */ jsx(Slider.Track, { children: /* @__PURE__ */ jsx(Slider.TrackActive, {}) }),
12
- /* @__PURE__ */ jsx(Slider.Thumb, { index: 0, circular: true, elevate: true }),
13
- children
14
- ] });
15
- }
16
- export {
17
- SliderDemo
18
- };
19
- //# sourceMappingURL=SliderDemo.mjs.map
@@ -1,12 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Spinner, YStack } from "tamagui";
3
- function SpinnerDemo() {
4
- return /* @__PURE__ */ jsxs(YStack, { padding: "$3", space: "$4", alignItems: "center", children: [
5
- /* @__PURE__ */ jsx(Spinner, { size: "small", color: "$green10" }),
6
- /* @__PURE__ */ jsx(Spinner, { size: "large", color: "$orange10" })
7
- ] });
8
- }
9
- export {
10
- SpinnerDemo
11
- };
12
- //# sourceMappingURL=SpinnerDemo.mjs.map
@@ -1,58 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { XStack, YStack, ZStack } from "tamagui";
3
- function StacksDemo() {
4
- return /* @__PURE__ */ jsxs(XStack, { maxWidth: 250, padding: "$2", alignSelf: "center", space: true, children: [
5
- /* @__PURE__ */ jsxs(
6
- YStack,
7
- {
8
- flex: 1,
9
- space: "$2",
10
- borderWidth: 2,
11
- borderColor: "$color",
12
- borderRadius: "$4",
13
- padding: "$2",
14
- children: [
15
- /* @__PURE__ */ jsx(YStack, { backgroundColor: "$color", borderRadius: "$3", padding: "$2" }),
16
- /* @__PURE__ */ jsx(YStack, { backgroundColor: "$color", borderRadius: "$3", padding: "$2" }),
17
- /* @__PURE__ */ jsx(YStack, { backgroundColor: "$color", borderRadius: "$3", padding: "$2" })
18
- ]
19
- }
20
- ),
21
- /* @__PURE__ */ jsxs(
22
- XStack,
23
- {
24
- flex: 1,
25
- space: "$2",
26
- borderWidth: 2,
27
- borderColor: "$color",
28
- borderRadius: "$4",
29
- padding: "$2",
30
- children: [
31
- /* @__PURE__ */ jsx(YStack, { backgroundColor: "$color", borderRadius: "$3", padding: "$2" }),
32
- /* @__PURE__ */ jsx(YStack, { backgroundColor: "$color", borderRadius: "$3", padding: "$2" }),
33
- /* @__PURE__ */ jsx(YStack, { backgroundColor: "$color", borderRadius: "$3", padding: "$2" })
34
- ]
35
- }
36
- ),
37
- /* @__PURE__ */ jsxs(ZStack, { maxWidth: 50, maxHeight: 85, width: 100, flex: 1, children: [
38
- /* @__PURE__ */ jsx(YStack, { fullscreen: true, borderWidth: 2, borderRadius: "$4", padding: "$2" }),
39
- /* @__PURE__ */ jsx(YStack, { fullscreen: true, y: 10, x: 10, borderWidth: 2, borderRadius: "$4", padding: "$2" }),
40
- /* @__PURE__ */ jsx(
41
- YStack,
42
- {
43
- fullscreen: true,
44
- y: 20,
45
- x: 20,
46
- borderWidth: 2,
47
- backgroundColor: "$color",
48
- borderRadius: "$4",
49
- padding: "$2"
50
- }
51
- )
52
- ] })
53
- ] });
54
- }
55
- export {
56
- StacksDemo
57
- };
58
- //# sourceMappingURL=StacksDemo.mjs.map
@@ -1,33 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Label, Separator, Switch, XStack, YStack } from "tamagui";
3
- function SwitchDemo() {
4
- return /* @__PURE__ */ jsxs(YStack, { width: 200, alignItems: "center", space: "$3", children: [
5
- /* @__PURE__ */ jsx(SwitchWithLabel, { size: "$2" }),
6
- /* @__PURE__ */ jsx(SwitchWithLabel, { size: "$3" }),
7
- /* @__PURE__ */ jsx(SwitchWithLabel, { size: "$4" }),
8
- /* @__PURE__ */ jsx(SwitchWithLabel, { size: "$5" })
9
- ] });
10
- }
11
- function SwitchWithLabel(props) {
12
- const id = `switch-${props.size.toString().slice(1)}`;
13
- return /* @__PURE__ */ jsxs(XStack, { width: 200, alignItems: "center", space: "$4", children: [
14
- /* @__PURE__ */ jsx(
15
- Label,
16
- {
17
- paddingRight: "$0",
18
- minWidth: 90,
19
- justifyContent: "flex-end",
20
- size: props.size,
21
- htmlFor: id,
22
- children: "Dark mode"
23
- }
24
- ),
25
- /* @__PURE__ */ jsx(Separator, { minHeight: 20, vertical: true }),
26
- /* @__PURE__ */ jsx(Switch, { id, size: props.size, children: /* @__PURE__ */ jsx(Switch.Thumb, { animation: "quick" }) })
27
- ] });
28
- }
29
- export {
30
- SwitchDemo,
31
- SwitchWithLabel
32
- };
33
- //# sourceMappingURL=SwitchDemo.mjs.map