@tamagui/demos 1.26.1 → 1.27.0-1684163004699
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/dist/cjs/ButtonHeadlessDemo.js +110 -0
- package/dist/cjs/ButtonHeadlessDemo.js.map +6 -0
- package/dist/cjs/ButtonSimpleDemo.js +49 -0
- package/dist/cjs/ButtonSimpleDemo.js.map +6 -0
- package/dist/cjs/SheetDemo.js.map +1 -1
- package/dist/esm/ButtonHeadlessDemo.js +93 -0
- package/dist/esm/ButtonHeadlessDemo.js.map +6 -0
- package/dist/esm/{ButtonDemo.mjs → ButtonSimpleDemo.js} +3 -3
- package/dist/esm/ButtonSimpleDemo.js.map +6 -0
- package/dist/esm/SheetDemo.js.map +1 -1
- package/dist/jsx/ButtonHeadlessDemo.js +92 -0
- package/dist/jsx/ButtonHeadlessDemo.js.map +6 -0
- package/dist/jsx/ButtonHeadlessDemo.mjs.map +6 -0
- package/dist/jsx/ButtonSimpleDemo.js +24 -0
- package/dist/jsx/ButtonSimpleDemo.js.map +6 -0
- package/dist/jsx/ButtonSimpleDemo.mjs.map +6 -0
- package/dist/jsx/SheetDemo.js.map +1 -1
- package/dist/jsx/SheetDemo.mjs.map +1 -1
- package/package.json +18 -18
- package/src/SheetDemo.tsx +1 -1
- package/types/ButtonHeadlessDemo.d.ts.map +1 -0
- package/types/ButtonSimpleDemo.d.ts.map +1 -0
- package/dist/esm/AddThemeDemo.mjs +0 -36
- package/dist/esm/AlertDialogDemo.mjs +0 -53
- package/dist/esm/AnimationsDemo.mjs +0 -89
- package/dist/esm/AnimationsEnterDemo.mjs +0 -40
- package/dist/esm/AnimationsHoverDemo.mjs +0 -27
- package/dist/esm/AnimationsPresenceDemo.mjs +0 -73
- package/dist/esm/AnimationsTimingDemo.mjs +0 -26
- package/dist/esm/AvatarDemo.mjs +0 -30
- package/dist/esm/ButtonNewDemo.mjs +0 -31
- package/dist/esm/CardDemo.mjs +0 -48
- package/dist/esm/CheckboxDemo.mjs +0 -22
- package/dist/esm/ColorsDemo.mjs +0 -98
- package/dist/esm/DialogDemo.mjs +0 -84
- package/dist/esm/FormsDemo.mjs +0 -36
- package/dist/esm/GroupDemo.mjs +0 -25
- package/dist/esm/HeadingsDemo.mjs +0 -16
- package/dist/esm/ImageDemo.mjs +0 -18
- package/dist/esm/InputsDemo.mjs +0 -31
- package/dist/esm/LabelDemo.mjs +0 -18
- package/dist/esm/LinearGradientDemo.mjs +0 -33
- package/dist/esm/ListItemDemo.mjs +0 -47
- package/dist/esm/LucideIconsDemo.mjs +0 -52
- package/dist/esm/PopoverDemo.mjs +0 -76
- package/dist/esm/ProgressDemo.mjs +0 -59
- package/dist/esm/RadioGroupDemo.mjs +0 -21
- package/dist/esm/ReplaceThemeDemo.mjs +0 -49
- package/dist/esm/ScrollViewDemo.mjs +0 -18
- package/dist/esm/SelectDemo.mjs +0 -137
- package/dist/esm/SeparatorDemo.mjs +0 -20
- package/dist/esm/ShapesDemo.mjs +0 -12
- package/dist/esm/SheetDemo.mjs +0 -91
- package/dist/esm/SliderDemo.mjs +0 -19
- package/dist/esm/SpinnerDemo.mjs +0 -12
- package/dist/esm/StacksDemo.mjs +0 -58
- package/dist/esm/SwitchDemo.mjs +0 -33
- package/dist/esm/TabsAdvancedDemo.mjs +0 -283
- package/dist/esm/TabsDemo.mjs +0 -141
- package/dist/esm/TextDemo.mjs +0 -16
- package/dist/esm/ThemeInverseDemo.mjs +0 -42
- package/dist/esm/ToastDemo.mjs +0 -101
- package/dist/esm/ToastDuplicateDemo.mjs +0 -44
- package/dist/esm/ToggleGroupDemo.mjs +0 -49
- package/dist/esm/TokensDemo.mjs +0 -87
- package/dist/esm/TooltipDemo.mjs +0 -68
- package/dist/esm/UpdateThemeDemo.mjs +0 -56
- package/dist/esm/conf.mjs +0 -5
- package/dist/esm/index.mjs +0 -48
- package/dist/esm/tamagui.config.mjs +0 -6
- package/dist/esm/useOnIntersecting.mjs +0 -68
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
//! debug
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import {
|
|
5
|
-
AnimatePresence,
|
|
6
|
-
Button,
|
|
7
|
-
H5,
|
|
8
|
-
SizableText,
|
|
9
|
-
Stack,
|
|
10
|
-
Tabs,
|
|
11
|
-
XStack,
|
|
12
|
-
YStack,
|
|
13
|
-
styled
|
|
14
|
-
} from "tamagui";
|
|
15
|
-
const demos = ["background", "underline"];
|
|
16
|
-
const demosTitle = {
|
|
17
|
-
background: "Background Indicator",
|
|
18
|
-
underline: "Underline Indicator"
|
|
19
|
-
};
|
|
20
|
-
const TabsAdvancedDemo = () => {
|
|
21
|
-
const [demoIndex, setDemoIndex] = useState(0);
|
|
22
|
-
const demo = demos[demoIndex];
|
|
23
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24
|
-
demo === "underline" ? /* @__PURE__ */ jsx(TabsAdvancedUnderline, {}) : /* @__PURE__ */ jsx(TabsAdvancedBackground, {}),
|
|
25
|
-
/* @__PURE__ */ jsx(
|
|
26
|
-
XStack,
|
|
27
|
-
{
|
|
28
|
-
alignItems: "center",
|
|
29
|
-
space: true,
|
|
30
|
-
position: "absolute",
|
|
31
|
-
bottom: "$3",
|
|
32
|
-
left: "$4",
|
|
33
|
-
$xxs: { display: "none" },
|
|
34
|
-
children: /* @__PURE__ */ jsx(Button, { size: "$2", onPress: () => setDemoIndex((x) => (x + 1) % demos.length), children: demosTitle[demo] })
|
|
35
|
-
}
|
|
36
|
-
)
|
|
37
|
-
] });
|
|
38
|
-
};
|
|
39
|
-
const TabsAdvancedBackground = () => {
|
|
40
|
-
const [tabState, setTabState] = useState({
|
|
41
|
-
activeAt: null,
|
|
42
|
-
currentTab: "tab1",
|
|
43
|
-
intentAt: null,
|
|
44
|
-
prevActiveAt: null
|
|
45
|
-
});
|
|
46
|
-
const setCurrentTab = (currentTab2) => setTabState({ ...tabState, currentTab: currentTab2 });
|
|
47
|
-
const setIntentIndicator = (intentAt2) => setTabState({ ...tabState, intentAt: intentAt2 });
|
|
48
|
-
const setActiveIndicator = (activeAt2) => setTabState({ ...tabState, prevActiveAt: tabState.activeAt, activeAt: activeAt2 });
|
|
49
|
-
const { activeAt, intentAt, prevActiveAt, currentTab } = tabState;
|
|
50
|
-
const direction = (() => {
|
|
51
|
-
if (!activeAt || !prevActiveAt || activeAt.x === prevActiveAt.x) {
|
|
52
|
-
return 0;
|
|
53
|
-
}
|
|
54
|
-
return activeAt.x > prevActiveAt.x ? -1 : 1;
|
|
55
|
-
})();
|
|
56
|
-
const enterVariant = direction === 1 ? "isLeft" : direction === -1 ? "isRight" : "defaultFade";
|
|
57
|
-
const exitVariant = direction === 1 ? "isRight" : direction === -1 ? "isLeft" : "defaultFade";
|
|
58
|
-
const handleOnInteraction = (type, layout) => {
|
|
59
|
-
if (type === "select") {
|
|
60
|
-
setActiveIndicator(layout);
|
|
61
|
-
} else {
|
|
62
|
-
setIntentIndicator(layout);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
return /* @__PURE__ */ jsxs(
|
|
66
|
-
Tabs,
|
|
67
|
-
{
|
|
68
|
-
value: currentTab,
|
|
69
|
-
onValueChange: setCurrentTab,
|
|
70
|
-
orientation: "horizontal",
|
|
71
|
-
size: "$4",
|
|
72
|
-
padding: "$2",
|
|
73
|
-
height: 150,
|
|
74
|
-
flexDirection: "column",
|
|
75
|
-
activationMode: "manual",
|
|
76
|
-
backgroundColor: "$background",
|
|
77
|
-
borderRadius: "$4",
|
|
78
|
-
position: "relative",
|
|
79
|
-
children: [
|
|
80
|
-
/* @__PURE__ */ jsxs(YStack, { children: [
|
|
81
|
-
/* @__PURE__ */ jsx(AnimatePresence, { children: intentAt && /* @__PURE__ */ jsx(
|
|
82
|
-
TabsRovingIndicator,
|
|
83
|
-
{
|
|
84
|
-
borderRadius: "$4",
|
|
85
|
-
width: intentAt.width,
|
|
86
|
-
height: intentAt.height,
|
|
87
|
-
x: intentAt.x,
|
|
88
|
-
y: intentAt.y
|
|
89
|
-
}
|
|
90
|
-
) }),
|
|
91
|
-
/* @__PURE__ */ jsx(AnimatePresence, { children: activeAt && /* @__PURE__ */ jsx(
|
|
92
|
-
TabsRovingIndicator,
|
|
93
|
-
{
|
|
94
|
-
borderRadius: "$4",
|
|
95
|
-
theme: "active",
|
|
96
|
-
width: activeAt.width,
|
|
97
|
-
height: activeAt.height,
|
|
98
|
-
x: activeAt.x,
|
|
99
|
-
y: activeAt.y
|
|
100
|
-
}
|
|
101
|
-
) }),
|
|
102
|
-
/* @__PURE__ */ jsxs(
|
|
103
|
-
Tabs.List,
|
|
104
|
-
{
|
|
105
|
-
disablePassBorderRadius: true,
|
|
106
|
-
loop: false,
|
|
107
|
-
"aria-label": "Manage your account",
|
|
108
|
-
space: "$2",
|
|
109
|
-
backgroundColor: "transparent",
|
|
110
|
-
children: [
|
|
111
|
-
/* @__PURE__ */ jsx(Tabs.Tab, { unstyled: true, value: "tab1", onInteraction: handleOnInteraction, children: /* @__PURE__ */ jsx(SizableText, { children: "Profile" }) }),
|
|
112
|
-
/* @__PURE__ */ jsx(Tabs.Tab, { unstyled: true, value: "tab2", onInteraction: handleOnInteraction, children: /* @__PURE__ */ jsx(SizableText, { children: "Connections" }) }),
|
|
113
|
-
/* @__PURE__ */ jsx(Tabs.Tab, { unstyled: true, value: "tab3", onInteraction: handleOnInteraction, children: /* @__PURE__ */ jsx(SizableText, { children: "Notifications" }) })
|
|
114
|
-
]
|
|
115
|
-
}
|
|
116
|
-
)
|
|
117
|
-
] }),
|
|
118
|
-
/* @__PURE__ */ jsx(
|
|
119
|
-
AnimatePresence,
|
|
120
|
-
{
|
|
121
|
-
exitBeforeEnter: true,
|
|
122
|
-
enterVariant,
|
|
123
|
-
exitVariant,
|
|
124
|
-
children: /* @__PURE__ */ jsx(AnimatedYStack, { animation: "100ms", x: 0, opacity: 1, flex: 1, children: /* @__PURE__ */ jsx(Tabs.Content, { value: currentTab, forceMount: true, flex: 1, justifyContent: "center", children: /* @__PURE__ */ jsx(H5, { textAlign: "center", children: currentTab }) }) }, currentTab)
|
|
125
|
-
}
|
|
126
|
-
)
|
|
127
|
-
]
|
|
128
|
-
}
|
|
129
|
-
);
|
|
130
|
-
};
|
|
131
|
-
const TabsAdvancedUnderline = () => {
|
|
132
|
-
const [tabState, setTabState] = useState({
|
|
133
|
-
activeAt: null,
|
|
134
|
-
currentTab: "tab1",
|
|
135
|
-
intentAt: null,
|
|
136
|
-
prevActiveAt: null
|
|
137
|
-
});
|
|
138
|
-
const setCurrentTab = (currentTab2) => setTabState({ ...tabState, currentTab: currentTab2 });
|
|
139
|
-
const setIntentIndicator = (intentAt2) => setTabState({ ...tabState, intentAt: intentAt2 });
|
|
140
|
-
const setActiveIndicator = (activeAt2) => setTabState({ ...tabState, prevActiveAt: tabState.activeAt, activeAt: activeAt2 });
|
|
141
|
-
const { activeAt, intentAt, prevActiveAt, currentTab } = tabState;
|
|
142
|
-
const direction = (() => {
|
|
143
|
-
if (!activeAt || !prevActiveAt || activeAt.x === prevActiveAt.x) {
|
|
144
|
-
return 0;
|
|
145
|
-
}
|
|
146
|
-
return activeAt.x > prevActiveAt.x ? -1 : 1;
|
|
147
|
-
})();
|
|
148
|
-
const enterVariant = direction === 1 ? "isLeft" : direction === -1 ? "isRight" : "defaultFade";
|
|
149
|
-
const exitVariant = direction === 1 ? "isRight" : direction === -1 ? "isLeft" : "defaultFade";
|
|
150
|
-
const handleOnInteraction = (type, layout) => {
|
|
151
|
-
if (type === "select") {
|
|
152
|
-
setActiveIndicator(layout);
|
|
153
|
-
} else {
|
|
154
|
-
setIntentIndicator(layout);
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
return /* @__PURE__ */ jsxs(
|
|
158
|
-
Tabs,
|
|
159
|
-
{
|
|
160
|
-
value: currentTab,
|
|
161
|
-
onValueChange: setCurrentTab,
|
|
162
|
-
orientation: "horizontal",
|
|
163
|
-
size: "$4",
|
|
164
|
-
height: 150,
|
|
165
|
-
flexDirection: "column",
|
|
166
|
-
activationMode: "manual",
|
|
167
|
-
backgroundColor: "$background",
|
|
168
|
-
borderRadius: "$4",
|
|
169
|
-
children: [
|
|
170
|
-
/* @__PURE__ */ jsxs(YStack, { children: [
|
|
171
|
-
/* @__PURE__ */ jsx(AnimatePresence, { children: intentAt && /* @__PURE__ */ jsx(
|
|
172
|
-
TabsRovingIndicator,
|
|
173
|
-
{
|
|
174
|
-
width: intentAt.width,
|
|
175
|
-
height: "$0.5",
|
|
176
|
-
x: intentAt.x,
|
|
177
|
-
bottom: 0
|
|
178
|
-
}
|
|
179
|
-
) }),
|
|
180
|
-
/* @__PURE__ */ jsx(AnimatePresence, { children: activeAt && /* @__PURE__ */ jsx(
|
|
181
|
-
TabsRovingIndicator,
|
|
182
|
-
{
|
|
183
|
-
theme: "active",
|
|
184
|
-
active: true,
|
|
185
|
-
width: activeAt.width,
|
|
186
|
-
height: "$0.5",
|
|
187
|
-
x: activeAt.x,
|
|
188
|
-
bottom: 0
|
|
189
|
-
}
|
|
190
|
-
) }),
|
|
191
|
-
/* @__PURE__ */ jsxs(
|
|
192
|
-
Tabs.List,
|
|
193
|
-
{
|
|
194
|
-
disablePassBorderRadius: true,
|
|
195
|
-
loop: false,
|
|
196
|
-
"aria-label": "Manage your account",
|
|
197
|
-
borderBottomLeftRadius: 0,
|
|
198
|
-
borderBottomRightRadius: 0,
|
|
199
|
-
paddingBottom: "$1.5",
|
|
200
|
-
borderColor: "$color3",
|
|
201
|
-
borderBottomWidth: "$0.5",
|
|
202
|
-
backgroundColor: "transparent",
|
|
203
|
-
children: [
|
|
204
|
-
/* @__PURE__ */ jsx(
|
|
205
|
-
Tabs.Tab,
|
|
206
|
-
{
|
|
207
|
-
unstyled: true,
|
|
208
|
-
padding: "$5",
|
|
209
|
-
value: "tab1",
|
|
210
|
-
onInteraction: handleOnInteraction,
|
|
211
|
-
children: /* @__PURE__ */ jsx(SizableText, { children: "Profile" })
|
|
212
|
-
}
|
|
213
|
-
),
|
|
214
|
-
/* @__PURE__ */ jsx(
|
|
215
|
-
Tabs.Tab,
|
|
216
|
-
{
|
|
217
|
-
unstyled: true,
|
|
218
|
-
padding: "$5",
|
|
219
|
-
value: "tab2",
|
|
220
|
-
onInteraction: handleOnInteraction,
|
|
221
|
-
children: /* @__PURE__ */ jsx(SizableText, { children: "Connections" })
|
|
222
|
-
}
|
|
223
|
-
),
|
|
224
|
-
/* @__PURE__ */ jsx(
|
|
225
|
-
Tabs.Tab,
|
|
226
|
-
{
|
|
227
|
-
unstyled: true,
|
|
228
|
-
padding: "$5",
|
|
229
|
-
value: "tab3",
|
|
230
|
-
onInteraction: handleOnInteraction,
|
|
231
|
-
children: /* @__PURE__ */ jsx(SizableText, { children: "Notifications" })
|
|
232
|
-
}
|
|
233
|
-
)
|
|
234
|
-
]
|
|
235
|
-
}
|
|
236
|
-
)
|
|
237
|
-
] }),
|
|
238
|
-
/* @__PURE__ */ jsx(
|
|
239
|
-
AnimatePresence,
|
|
240
|
-
{
|
|
241
|
-
exitBeforeEnter: true,
|
|
242
|
-
enterVariant,
|
|
243
|
-
exitVariant,
|
|
244
|
-
children: /* @__PURE__ */ jsx(AnimatedYStack, { animation: "100ms", x: 0, opacity: 1, flex: 1, children: /* @__PURE__ */ jsx(Tabs.Content, { value: currentTab, forceMount: true, flex: 1, justifyContent: "center", children: /* @__PURE__ */ jsx(H5, { textAlign: "center", children: currentTab }) }) }, currentTab)
|
|
245
|
-
}
|
|
246
|
-
)
|
|
247
|
-
]
|
|
248
|
-
}
|
|
249
|
-
);
|
|
250
|
-
};
|
|
251
|
-
const TabsRovingIndicator = ({ active, ...props }) => {
|
|
252
|
-
return /* @__PURE__ */ jsx(
|
|
253
|
-
Stack,
|
|
254
|
-
{
|
|
255
|
-
position: "absolute",
|
|
256
|
-
backgroundColor: "$color5",
|
|
257
|
-
opacity: 0.7,
|
|
258
|
-
animation: "100ms",
|
|
259
|
-
enterStyle: {
|
|
260
|
-
opacity: 0
|
|
261
|
-
},
|
|
262
|
-
exitStyle: {
|
|
263
|
-
opacity: 0
|
|
264
|
-
},
|
|
265
|
-
...active && {
|
|
266
|
-
backgroundColor: "$color8",
|
|
267
|
-
opacity: 0.6
|
|
268
|
-
},
|
|
269
|
-
...props
|
|
270
|
-
}
|
|
271
|
-
);
|
|
272
|
-
};
|
|
273
|
-
const AnimatedYStack = styled(YStack, {
|
|
274
|
-
variants: {
|
|
275
|
-
isLeft: { true: { x: -25, opacity: 0 } },
|
|
276
|
-
isRight: { true: { x: 25, opacity: 0 } },
|
|
277
|
-
defaultFade: { true: { opacity: 0 } }
|
|
278
|
-
}
|
|
279
|
-
});
|
|
280
|
-
export {
|
|
281
|
-
TabsAdvancedDemo
|
|
282
|
-
};
|
|
283
|
-
//# sourceMappingURL=TabsAdvancedDemo.mjs.map
|
package/dist/esm/TabsDemo.mjs
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import {
|
|
4
|
-
Button,
|
|
5
|
-
H5,
|
|
6
|
-
Separator,
|
|
7
|
-
SizableText,
|
|
8
|
-
Tabs,
|
|
9
|
-
XStack,
|
|
10
|
-
YStack,
|
|
11
|
-
isWeb
|
|
12
|
-
} from "tamagui";
|
|
13
|
-
const demos = ["horizontal", "vertical"];
|
|
14
|
-
const demosTitle = {
|
|
15
|
-
horizontal: "Horizontal",
|
|
16
|
-
vertical: "Vertical"
|
|
17
|
-
};
|
|
18
|
-
function TabsDemo() {
|
|
19
|
-
const [demoIndex, setDemoIndex] = useState(0);
|
|
20
|
-
const demo = demos[demoIndex];
|
|
21
|
-
return (
|
|
22
|
-
// web only fix for position relative
|
|
23
|
-
/* @__PURE__ */ jsxs(
|
|
24
|
-
YStack,
|
|
25
|
-
{
|
|
26
|
-
paddingHorizontal: "$4",
|
|
27
|
-
...isWeb && {
|
|
28
|
-
position: "unset"
|
|
29
|
-
},
|
|
30
|
-
children: [
|
|
31
|
-
demo === "horizontal" ? /* @__PURE__ */ jsx(HorizontalTabs, {}) : /* @__PURE__ */ jsx(VerticalTabs, {}),
|
|
32
|
-
/* @__PURE__ */ jsx(
|
|
33
|
-
XStack,
|
|
34
|
-
{
|
|
35
|
-
alignItems: "center",
|
|
36
|
-
space: true,
|
|
37
|
-
position: "absolute",
|
|
38
|
-
bottom: "$3",
|
|
39
|
-
left: "$4",
|
|
40
|
-
$xxs: { display: "none" },
|
|
41
|
-
children: /* @__PURE__ */ jsx(Button, { size: "$2", onPress: () => setDemoIndex((x) => (x + 1) % demos.length), children: demosTitle[demo] })
|
|
42
|
-
}
|
|
43
|
-
)
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
)
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
const HorizontalTabs = () => {
|
|
50
|
-
return /* @__PURE__ */ jsxs(
|
|
51
|
-
Tabs,
|
|
52
|
-
{
|
|
53
|
-
defaultValue: "tab1",
|
|
54
|
-
orientation: "horizontal",
|
|
55
|
-
flexDirection: "column",
|
|
56
|
-
width: 400,
|
|
57
|
-
height: 150,
|
|
58
|
-
borderRadius: "$4",
|
|
59
|
-
borderWidth: "$0.25",
|
|
60
|
-
overflow: "hidden",
|
|
61
|
-
borderColor: "$borderColor",
|
|
62
|
-
children: [
|
|
63
|
-
/* @__PURE__ */ jsxs(
|
|
64
|
-
Tabs.List,
|
|
65
|
-
{
|
|
66
|
-
separator: /* @__PURE__ */ jsx(Separator, { vertical: true }),
|
|
67
|
-
disablePassBorderRadius: "bottom",
|
|
68
|
-
"aria-label": "Manage your account",
|
|
69
|
-
children: [
|
|
70
|
-
/* @__PURE__ */ jsx(Tabs.Tab, { flex: 1, value: "tab1", children: /* @__PURE__ */ jsx(SizableText, { fontFamily: "$body", children: "Profile" }) }),
|
|
71
|
-
/* @__PURE__ */ jsx(Tabs.Tab, { flex: 1, value: "tab2", children: /* @__PURE__ */ jsx(SizableText, { fontFamily: "$body", children: "Connections" }) }),
|
|
72
|
-
/* @__PURE__ */ jsx(Tabs.Tab, { flex: 1, value: "tab3", children: /* @__PURE__ */ jsx(SizableText, { fontFamily: "$body", children: "Notifications" }) })
|
|
73
|
-
]
|
|
74
|
-
}
|
|
75
|
-
),
|
|
76
|
-
/* @__PURE__ */ jsx(Separator, {}),
|
|
77
|
-
/* @__PURE__ */ jsx(TabsContent, { value: "tab1", children: /* @__PURE__ */ jsx(H5, { children: "Profile" }) }),
|
|
78
|
-
/* @__PURE__ */ jsx(TabsContent, { value: "tab2", children: /* @__PURE__ */ jsx(H5, { children: "Connections" }) }),
|
|
79
|
-
/* @__PURE__ */ jsx(TabsContent, { value: "tab3", children: /* @__PURE__ */ jsx(H5, { children: "Notifications" }) })
|
|
80
|
-
]
|
|
81
|
-
}
|
|
82
|
-
);
|
|
83
|
-
};
|
|
84
|
-
const VerticalTabs = () => {
|
|
85
|
-
return /* @__PURE__ */ jsxs(
|
|
86
|
-
Tabs,
|
|
87
|
-
{
|
|
88
|
-
defaultValue: "tab1",
|
|
89
|
-
flexDirection: "row",
|
|
90
|
-
orientation: "vertical",
|
|
91
|
-
width: 400,
|
|
92
|
-
borderRadius: "$4",
|
|
93
|
-
borderWidth: "$0.25",
|
|
94
|
-
overflow: "hidden",
|
|
95
|
-
borderColor: "$borderColor",
|
|
96
|
-
children: [
|
|
97
|
-
/* @__PURE__ */ jsxs(
|
|
98
|
-
Tabs.List,
|
|
99
|
-
{
|
|
100
|
-
disablePassBorderRadius: "end",
|
|
101
|
-
"aria-label": "Manage your account",
|
|
102
|
-
separator: /* @__PURE__ */ jsx(Separator, {}),
|
|
103
|
-
children: [
|
|
104
|
-
/* @__PURE__ */ jsx(Tabs.Tab, { value: "tab1", children: /* @__PURE__ */ jsx(SizableText, { children: "Profile" }) }),
|
|
105
|
-
/* @__PURE__ */ jsx(Tabs.Tab, { value: "tab2", children: /* @__PURE__ */ jsx(SizableText, { children: "Connections" }) }),
|
|
106
|
-
/* @__PURE__ */ jsx(Tabs.Tab, { value: "tab3", children: /* @__PURE__ */ jsx(SizableText, { children: "Notifications" }) })
|
|
107
|
-
]
|
|
108
|
-
}
|
|
109
|
-
),
|
|
110
|
-
/* @__PURE__ */ jsx(Separator, { vertical: true }),
|
|
111
|
-
/* @__PURE__ */ jsx(TabsContent, { value: "tab1", children: /* @__PURE__ */ jsx(H5, { textAlign: "center", children: "Profile" }) }),
|
|
112
|
-
/* @__PURE__ */ jsx(TabsContent, { value: "tab2", children: /* @__PURE__ */ jsx(H5, { textAlign: "center", children: "Connections" }) }),
|
|
113
|
-
/* @__PURE__ */ jsx(TabsContent, { value: "tab3", children: /* @__PURE__ */ jsx(H5, { textAlign: "center", children: "Notifications" }) })
|
|
114
|
-
]
|
|
115
|
-
}
|
|
116
|
-
);
|
|
117
|
-
};
|
|
118
|
-
const TabsContent = (props) => {
|
|
119
|
-
return /* @__PURE__ */ jsx(
|
|
120
|
-
Tabs.Content,
|
|
121
|
-
{
|
|
122
|
-
backgroundColor: "$background",
|
|
123
|
-
padding: "$2",
|
|
124
|
-
alignItems: "center",
|
|
125
|
-
justifyContent: "center",
|
|
126
|
-
flex: 1,
|
|
127
|
-
borderColor: "$background",
|
|
128
|
-
borderRadius: "$2",
|
|
129
|
-
borderTopLeftRadius: 0,
|
|
130
|
-
borderTopRightRadius: 0,
|
|
131
|
-
borderWidth: "$2",
|
|
132
|
-
...props,
|
|
133
|
-
children: props.children
|
|
134
|
-
},
|
|
135
|
-
"tab3"
|
|
136
|
-
);
|
|
137
|
-
};
|
|
138
|
-
export {
|
|
139
|
-
TabsDemo
|
|
140
|
-
};
|
|
141
|
-
//# sourceMappingURL=TabsDemo.mjs.map
|
package/dist/esm/TextDemo.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Paragraph, SizableText, XStack, YStack } from "tamagui";
|
|
3
|
-
function TextDemo() {
|
|
4
|
-
return /* @__PURE__ */ jsxs(YStack, { space: "$2", alignItems: "center", children: [
|
|
5
|
-
/* @__PURE__ */ jsx(SizableText, { size: "$3", children: "SizableText" }),
|
|
6
|
-
/* @__PURE__ */ jsxs(XStack, { space: true, children: [
|
|
7
|
-
/* @__PURE__ */ jsx(SizableText, { theme: "alt1", size: "$3", children: "alt1" }),
|
|
8
|
-
/* @__PURE__ */ jsx(SizableText, { theme: "alt2", size: "$3", children: "alt2" })
|
|
9
|
-
] }),
|
|
10
|
-
/* @__PURE__ */ jsx(Paragraph, { size: "$2", fontWeight: "800", children: "Paragraph" })
|
|
11
|
-
] });
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
TextDemo
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=TextDemo.mjs.map
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button, H5, Theme, XStack, YStack, useThemeName } from "tamagui";
|
|
3
|
-
function ThemeInverseDemo() {
|
|
4
|
-
const themeName = useThemeName();
|
|
5
|
-
const opposite = themeName.includes("dark") ? "light" : "dark";
|
|
6
|
-
return /* @__PURE__ */ jsxs(XStack, { space: true, children: [
|
|
7
|
-
/* @__PURE__ */ jsx(Buttons, { title: "Normal", name: themeName }),
|
|
8
|
-
/* @__PURE__ */ jsx(Theme, { inverse: true, children: /* @__PURE__ */ jsx(
|
|
9
|
-
Buttons,
|
|
10
|
-
{
|
|
11
|
-
title: "Inversed",
|
|
12
|
-
name: themeName.replace(themeName.split("_")[0], opposite)
|
|
13
|
-
}
|
|
14
|
-
) })
|
|
15
|
-
] });
|
|
16
|
-
}
|
|
17
|
-
function Buttons(props) {
|
|
18
|
-
return /* @__PURE__ */ jsxs(
|
|
19
|
-
YStack,
|
|
20
|
-
{
|
|
21
|
-
elevation: "$4",
|
|
22
|
-
backgroundColor: "$background",
|
|
23
|
-
padding: "$4",
|
|
24
|
-
borderRadius: "$4",
|
|
25
|
-
space: "$3",
|
|
26
|
-
children: [
|
|
27
|
-
/* @__PURE__ */ jsx(H5, { children: props.title }),
|
|
28
|
-
/* @__PURE__ */ jsx(Button, { children: props.name }),
|
|
29
|
-
/* @__PURE__ */ jsx(Button, { themeInverse: true, children: "inversed" }),
|
|
30
|
-
/* @__PURE__ */ jsxs(Button, { theme: "alt1", children: [
|
|
31
|
-
props.name,
|
|
32
|
-
"_alt1"
|
|
33
|
-
] }),
|
|
34
|
-
/* @__PURE__ */ jsx(Theme, { name: "yellow", children: /* @__PURE__ */ jsx(Button, { children: props.name.split("_")[0] + "_yellow" }) })
|
|
35
|
-
]
|
|
36
|
-
}
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
export {
|
|
40
|
-
ThemeInverseDemo
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=ThemeInverseDemo.mjs.map
|
package/dist/esm/ToastDemo.mjs
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Toast, useToastController, useToastState } from "@tamagui/toast";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { Button, Label, Switch, XStack, YStack } from "tamagui";
|
|
5
|
-
const ToastDemo = () => {
|
|
6
|
-
const [native, setNative] = React.useState(false);
|
|
7
|
-
return /* @__PURE__ */ jsxs(YStack, { space: true, alignItems: "center", children: [
|
|
8
|
-
/* @__PURE__ */ jsx(ToastControl, { native }),
|
|
9
|
-
/* @__PURE__ */ jsx(CurrentToast, {}),
|
|
10
|
-
/* @__PURE__ */ jsx(NativeOptions, { native, setNative })
|
|
11
|
-
] });
|
|
12
|
-
};
|
|
13
|
-
const CurrentToast = () => {
|
|
14
|
-
const currentToast = useToastState();
|
|
15
|
-
if (!currentToast || currentToast.isHandledNatively)
|
|
16
|
-
return null;
|
|
17
|
-
return /* @__PURE__ */ jsx(
|
|
18
|
-
Toast,
|
|
19
|
-
{
|
|
20
|
-
duration: currentToast.duration,
|
|
21
|
-
enterStyle: { opacity: 0, scale: 0.5, y: -25 },
|
|
22
|
-
exitStyle: { opacity: 0, scale: 1, y: -20 },
|
|
23
|
-
y: 0,
|
|
24
|
-
opacity: 1,
|
|
25
|
-
scale: 1,
|
|
26
|
-
animation: "100ms",
|
|
27
|
-
viewportName: currentToast.viewportName,
|
|
28
|
-
children: /* @__PURE__ */ jsxs(YStack, { children: [
|
|
29
|
-
/* @__PURE__ */ jsx(Toast.Title, { children: currentToast.title }),
|
|
30
|
-
!!currentToast.message && /* @__PURE__ */ jsx(Toast.Description, { children: currentToast.message })
|
|
31
|
-
] })
|
|
32
|
-
},
|
|
33
|
-
currentToast.id
|
|
34
|
-
);
|
|
35
|
-
};
|
|
36
|
-
const ToastControl = ({ native }) => {
|
|
37
|
-
const toast = useToastController();
|
|
38
|
-
return /* @__PURE__ */ jsxs(XStack, { space: "$2", justifyContent: "center", children: [
|
|
39
|
-
/* @__PURE__ */ jsx(
|
|
40
|
-
Button,
|
|
41
|
-
{
|
|
42
|
-
onPress: () => {
|
|
43
|
-
toast.show("Successfully saved!", {
|
|
44
|
-
message: "Don't worry, we've got your data.",
|
|
45
|
-
native
|
|
46
|
-
});
|
|
47
|
-
},
|
|
48
|
-
children: "Show"
|
|
49
|
-
}
|
|
50
|
-
),
|
|
51
|
-
/* @__PURE__ */ jsx(
|
|
52
|
-
Button,
|
|
53
|
-
{
|
|
54
|
-
id: "wot",
|
|
55
|
-
nativeID: "woot",
|
|
56
|
-
onPress: () => {
|
|
57
|
-
toast.hide();
|
|
58
|
-
},
|
|
59
|
-
children: "Hide"
|
|
60
|
-
}
|
|
61
|
-
)
|
|
62
|
-
] });
|
|
63
|
-
};
|
|
64
|
-
const NativeOptions = ({
|
|
65
|
-
native,
|
|
66
|
-
setNative
|
|
67
|
-
}) => {
|
|
68
|
-
return /* @__PURE__ */ jsxs(XStack, { space: "$3", children: [
|
|
69
|
-
/* @__PURE__ */ jsx(Label, { size: "$1", onPress: () => setNative(false), children: "Custom" }),
|
|
70
|
-
/* @__PURE__ */ jsx(
|
|
71
|
-
Switch,
|
|
72
|
-
{
|
|
73
|
-
debug: "verbose",
|
|
74
|
-
id: "native-toggle",
|
|
75
|
-
nativeID: "native-toggle",
|
|
76
|
-
theme: "active",
|
|
77
|
-
size: "$1",
|
|
78
|
-
checked: !!native,
|
|
79
|
-
onCheckedChange: (val) => setNative(val),
|
|
80
|
-
children: /* @__PURE__ */ jsx(
|
|
81
|
-
Switch.Thumb,
|
|
82
|
-
{
|
|
83
|
-
animation: [
|
|
84
|
-
"quick",
|
|
85
|
-
{
|
|
86
|
-
transform: {
|
|
87
|
-
overshootClamping: true
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
]
|
|
91
|
-
}
|
|
92
|
-
)
|
|
93
|
-
}
|
|
94
|
-
),
|
|
95
|
-
/* @__PURE__ */ jsx(Label, { size: "$1", onPress: () => setNative(true), children: "Native" })
|
|
96
|
-
] });
|
|
97
|
-
};
|
|
98
|
-
export {
|
|
99
|
-
ToastDemo
|
|
100
|
-
};
|
|
101
|
-
//# sourceMappingURL=ToastDemo.mjs.map
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { CheckCircle2 } from "@tamagui/lucide-icons";
|
|
3
|
-
import { Toast } from "@tamagui/toast";
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { Button, XStack, YStack } from "tamagui";
|
|
6
|
-
const ToastDuplicateDemo = () => {
|
|
7
|
-
const [savedCount, setSavedCount] = React.useState(0);
|
|
8
|
-
return /* @__PURE__ */ jsxs(YStack, { alignItems: "center", children: [
|
|
9
|
-
/* @__PURE__ */ jsx(
|
|
10
|
-
Button,
|
|
11
|
-
{
|
|
12
|
-
onPress: () => {
|
|
13
|
-
setSavedCount((old) => old + 1);
|
|
14
|
-
},
|
|
15
|
-
children: "Show toast"
|
|
16
|
-
}
|
|
17
|
-
),
|
|
18
|
-
[...Array(savedCount)].map((_, index) => /* @__PURE__ */ jsx(
|
|
19
|
-
Toast,
|
|
20
|
-
{
|
|
21
|
-
viewportName: "viewport-multiple",
|
|
22
|
-
duration: 4e3,
|
|
23
|
-
enterStyle: { opacity: 0, scale: 0.5, y: -25 },
|
|
24
|
-
exitStyle: { opacity: 0, scale: 1, y: -20 },
|
|
25
|
-
y: 0,
|
|
26
|
-
opacity: 1,
|
|
27
|
-
scale: 1,
|
|
28
|
-
animation: "100ms",
|
|
29
|
-
children: /* @__PURE__ */ jsxs(XStack, { space: true, alignItems: "center", children: [
|
|
30
|
-
/* @__PURE__ */ jsx(YStack, { children: /* @__PURE__ */ jsx(CheckCircle2, {}) }),
|
|
31
|
-
/* @__PURE__ */ jsxs(YStack, { children: [
|
|
32
|
-
/* @__PURE__ */ jsx(Toast.Title, { children: "Successfully saved!" }),
|
|
33
|
-
/* @__PURE__ */ jsx(Toast.Description, { children: "Don't worry... We've got your data." })
|
|
34
|
-
] })
|
|
35
|
-
] })
|
|
36
|
-
},
|
|
37
|
-
index
|
|
38
|
-
))
|
|
39
|
-
] });
|
|
40
|
-
};
|
|
41
|
-
export {
|
|
42
|
-
ToastDuplicateDemo
|
|
43
|
-
};
|
|
44
|
-
//# sourceMappingURL=ToastDuplicateDemo.mjs.map
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { AlignCenter, AlignLeft, AlignRight } from "@tamagui/lucide-icons";
|
|
3
|
-
import { Label, ToggleGroup, XStack, YStack } from "tamagui";
|
|
4
|
-
function ToggleGroupDemo() {
|
|
5
|
-
return /* @__PURE__ */ jsx(YStack, { paddingHorizontal: "$4", children: /* @__PURE__ */ jsxs(XStack, { alignItems: "center", space: "$10", children: [
|
|
6
|
-
/* @__PURE__ */ jsxs(YStack, { alignItems: "center", space: "$6", children: [
|
|
7
|
-
/* @__PURE__ */ jsx(ToggleGroupComponent, { type: "single", size: "$3", orientation: "horizontal" }),
|
|
8
|
-
/* @__PURE__ */ jsx(ToggleGroupComponent, { type: "multiple", size: "$4", orientation: "horizontal" })
|
|
9
|
-
] }),
|
|
10
|
-
/* @__PURE__ */ jsxs(XStack, { alignItems: "center", space: "$6", children: [
|
|
11
|
-
/* @__PURE__ */ jsx(ToggleGroupComponent, { type: "single", size: "$3", orientation: "vertical" }),
|
|
12
|
-
/* @__PURE__ */ jsx(ToggleGroupComponent, { type: "multiple", size: "$4", orientation: "vertical" })
|
|
13
|
-
] })
|
|
14
|
-
] }) });
|
|
15
|
-
}
|
|
16
|
-
function ToggleGroupComponent(props) {
|
|
17
|
-
const id = `switch-${props.size.toString().slice(1)}-${props.type}`;
|
|
18
|
-
return /* @__PURE__ */ jsxs(
|
|
19
|
-
XStack,
|
|
20
|
-
{
|
|
21
|
-
flexDirection: props.orientation === "horizontal" ? "row" : "column",
|
|
22
|
-
alignItems: "center",
|
|
23
|
-
justifyContent: "center",
|
|
24
|
-
space: "$4",
|
|
25
|
-
children: [
|
|
26
|
-
/* @__PURE__ */ jsx(Label, { paddingRight: "$0", justifyContent: "flex-end", size: props.size, htmlFor: id, children: props.type === "single" ? "Single" : "Multiple" }),
|
|
27
|
-
/* @__PURE__ */ jsxs(
|
|
28
|
-
ToggleGroup,
|
|
29
|
-
{
|
|
30
|
-
orientation: props.orientation,
|
|
31
|
-
id,
|
|
32
|
-
type: props.type,
|
|
33
|
-
size: props.size,
|
|
34
|
-
disableDeactivation: props.type === "single" ? true : void 0,
|
|
35
|
-
children: [
|
|
36
|
-
/* @__PURE__ */ jsx(ToggleGroup.Item, { value: "left", "aria-label": "Left aligned", children: /* @__PURE__ */ jsx(AlignLeft, {}) }),
|
|
37
|
-
/* @__PURE__ */ jsx(ToggleGroup.Item, { value: "center", "aria-label": "Center aligned", children: /* @__PURE__ */ jsx(AlignCenter, {}) }),
|
|
38
|
-
/* @__PURE__ */ jsx(ToggleGroup.Item, { value: "right", "aria-label": "Right aligned", children: /* @__PURE__ */ jsx(AlignRight, {}) })
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
)
|
|
42
|
-
]
|
|
43
|
-
}
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
export {
|
|
47
|
-
ToggleGroupDemo
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=ToggleGroupDemo.mjs.map
|