@tamagui/demos 1.116.1 → 1.116.2
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/AccordionDemo.js +43 -0
- package/dist/cjs/AddThemeDemo.js +56 -0
- package/dist/cjs/AlertDialogDemo.js +68 -0
- package/dist/cjs/AnimationsDemo.js +99 -0
- package/dist/cjs/AnimationsEnterDemo.js +55 -0
- package/dist/cjs/AnimationsHoverDemo.js +41 -0
- package/dist/cjs/AnimationsPresenceDemo.js +102 -0
- package/dist/cjs/AnimationsTimingDemo.js +40 -0
- package/dist/cjs/AvatarDemo.js +45 -0
- package/dist/cjs/BuildAButtonDemo.js +57 -0
- package/dist/cjs/ButtonDemo.js +39 -0
- package/dist/cjs/CardDemo.js +63 -0
- package/dist/cjs/CheckboxDemo.js +40 -0
- package/dist/cjs/CheckboxHeadlessDemo.js +62 -0
- package/dist/cjs/CheckboxUnstyledDemo.js +52 -0
- package/dist/cjs/ColorsDemo.js +95 -0
- package/dist/cjs/DialogDemo.js +99 -0
- package/dist/cjs/FormsDemo.js +57 -0
- package/dist/cjs/Grid.js +58 -0
- package/dist/cjs/GroupDemo.js +39 -0
- package/dist/cjs/HeadingsDemo.js +31 -0
- package/dist/cjs/ImageDemo.js +33 -0
- package/dist/cjs/InputsDemo.js +46 -0
- package/dist/cjs/LabelDemo.js +33 -0
- package/dist/cjs/LinearGradientDemo.js +47 -0
- package/dist/cjs/ListItemDemo.js +61 -0
- package/dist/cjs/LucideIconsDemo.js +72 -0
- package/dist/cjs/NewInputsDemo.js +46 -0
- package/dist/cjs/PopoverDemo.js +126 -0
- package/dist/cjs/ProgressDemo.js +88 -0
- package/dist/cjs/RadioGroupDemo.js +36 -0
- package/dist/cjs/RadioGroupHeadlessDemo.js +117 -0
- package/dist/cjs/RadioGroupUnstyledDemo.js +107 -0
- package/dist/cjs/ReplaceThemeDemo.js +58 -0
- package/dist/cjs/ScrollViewDemo.js +43 -0
- package/dist/cjs/SelectDemo.js +190 -0
- package/dist/cjs/SeparatorDemo.js +35 -0
- package/dist/cjs/ShapesDemo.js +27 -0
- package/dist/cjs/SheetDemo.js +120 -0
- package/dist/cjs/SliderDemo.js +34 -0
- package/dist/cjs/SpinnerDemo.js +27 -0
- package/dist/cjs/StacksDemo.js +93 -0
- package/dist/cjs/SwitchDemo.js +56 -0
- package/dist/cjs/SwitchHeadlessDemo.js +87 -0
- package/dist/cjs/SwitchUnstyledDemo.js +64 -0
- package/dist/cjs/TabsAdvancedDemo.js +283 -0
- package/dist/cjs/TabsDemo.js +144 -0
- package/dist/cjs/TextDemo.js +31 -0
- package/dist/cjs/ThemeBuilderDemo.js +149 -0
- package/dist/cjs/ThemeInverseDemo.js +56 -0
- package/dist/cjs/ToastDemo.js +112 -0
- package/dist/cjs/ToastDuplicateDemo.js +64 -0
- package/dist/cjs/ToggleGroupDemo.js +63 -0
- package/dist/cjs/TokensDemo.js +100 -0
- package/dist/cjs/TooltipDemo.js +68 -0
- package/dist/cjs/UpdateThemeDemo.js +61 -0
- package/dist/cjs/WebNativeImageDemo.js +24 -0
- package/dist/cjs/index.js +71 -0
- package/dist/cjs/tamagui.config.js +22 -0
- package/dist/cjs/useOnIntersecting.js +63 -0
- package/package.json +19 -19
- /package/dist/cjs/{AccordionDemo.cjs.map → AccordionDemo.js.map} +0 -0
- /package/dist/cjs/{AddThemeDemo.cjs.map → AddThemeDemo.js.map} +0 -0
- /package/dist/cjs/{AlertDialogDemo.cjs.map → AlertDialogDemo.js.map} +0 -0
- /package/dist/cjs/{AnimationsDemo.cjs.map → AnimationsDemo.js.map} +0 -0
- /package/dist/cjs/{AnimationsEnterDemo.cjs.map → AnimationsEnterDemo.js.map} +0 -0
- /package/dist/cjs/{AnimationsHoverDemo.cjs.map → AnimationsHoverDemo.js.map} +0 -0
- /package/dist/cjs/{AnimationsPresenceDemo.cjs.map → AnimationsPresenceDemo.js.map} +0 -0
- /package/dist/cjs/{AnimationsTimingDemo.cjs.map → AnimationsTimingDemo.js.map} +0 -0
- /package/dist/cjs/{AvatarDemo.cjs.map → AvatarDemo.js.map} +0 -0
- /package/dist/cjs/{BuildAButtonDemo.cjs.map → BuildAButtonDemo.js.map} +0 -0
- /package/dist/cjs/{ButtonDemo.cjs.map → ButtonDemo.js.map} +0 -0
- /package/dist/cjs/{CardDemo.cjs.map → CardDemo.js.map} +0 -0
- /package/dist/cjs/{CheckboxDemo.cjs.map → CheckboxDemo.js.map} +0 -0
- /package/dist/cjs/{CheckboxHeadlessDemo.cjs.map → CheckboxHeadlessDemo.js.map} +0 -0
- /package/dist/cjs/{CheckboxUnstyledDemo.cjs.map → CheckboxUnstyledDemo.js.map} +0 -0
- /package/dist/cjs/{ColorsDemo.cjs.map → ColorsDemo.js.map} +0 -0
- /package/dist/cjs/{DialogDemo.cjs.map → DialogDemo.js.map} +0 -0
- /package/dist/cjs/{FormsDemo.cjs.map → FormsDemo.js.map} +0 -0
- /package/dist/cjs/{Grid.cjs.map → Grid.js.map} +0 -0
- /package/dist/cjs/{GroupDemo.cjs.map → GroupDemo.js.map} +0 -0
- /package/dist/cjs/{HeadingsDemo.cjs.map → HeadingsDemo.js.map} +0 -0
- /package/dist/cjs/{ImageDemo.cjs.map → ImageDemo.js.map} +0 -0
- /package/dist/cjs/{InputsDemo.cjs.map → InputsDemo.js.map} +0 -0
- /package/dist/cjs/{LabelDemo.cjs.map → LabelDemo.js.map} +0 -0
- /package/dist/cjs/{LinearGradientDemo.cjs.map → LinearGradientDemo.js.map} +0 -0
- /package/dist/cjs/{ListItemDemo.cjs.map → ListItemDemo.js.map} +0 -0
- /package/dist/cjs/{LucideIconsDemo.cjs.map → LucideIconsDemo.js.map} +0 -0
- /package/dist/cjs/{NewInputsDemo.cjs.map → NewInputsDemo.js.map} +0 -0
- /package/dist/cjs/{PopoverDemo.cjs.map → PopoverDemo.js.map} +0 -0
- /package/dist/cjs/{ProgressDemo.cjs.map → ProgressDemo.js.map} +0 -0
- /package/dist/cjs/{RadioGroupDemo.cjs.map → RadioGroupDemo.js.map} +0 -0
- /package/dist/cjs/{RadioGroupHeadlessDemo.cjs.map → RadioGroupHeadlessDemo.js.map} +0 -0
- /package/dist/cjs/{RadioGroupUnstyledDemo.cjs.map → RadioGroupUnstyledDemo.js.map} +0 -0
- /package/dist/cjs/{ReplaceThemeDemo.cjs.map → ReplaceThemeDemo.js.map} +0 -0
- /package/dist/cjs/{ScrollViewDemo.cjs.map → ScrollViewDemo.js.map} +0 -0
- /package/dist/cjs/{SelectDemo.cjs.map → SelectDemo.js.map} +0 -0
- /package/dist/cjs/{SeparatorDemo.cjs.map → SeparatorDemo.js.map} +0 -0
- /package/dist/cjs/{ShapesDemo.cjs.map → ShapesDemo.js.map} +0 -0
- /package/dist/cjs/{SheetDemo.cjs.map → SheetDemo.js.map} +0 -0
- /package/dist/cjs/{SliderDemo.cjs.map → SliderDemo.js.map} +0 -0
- /package/dist/cjs/{SpinnerDemo.cjs.map → SpinnerDemo.js.map} +0 -0
- /package/dist/cjs/{StacksDemo.cjs.map → StacksDemo.js.map} +0 -0
- /package/dist/cjs/{SwitchDemo.cjs.map → SwitchDemo.js.map} +0 -0
- /package/dist/cjs/{SwitchHeadlessDemo.cjs.map → SwitchHeadlessDemo.js.map} +0 -0
- /package/dist/cjs/{SwitchUnstyledDemo.cjs.map → SwitchUnstyledDemo.js.map} +0 -0
- /package/dist/cjs/{TabsAdvancedDemo.cjs.map → TabsAdvancedDemo.js.map} +0 -0
- /package/dist/cjs/{TabsDemo.cjs.map → TabsDemo.js.map} +0 -0
- /package/dist/cjs/{TextDemo.cjs.map → TextDemo.js.map} +0 -0
- /package/dist/cjs/{ThemeBuilderDemo.cjs.map → ThemeBuilderDemo.js.map} +0 -0
- /package/dist/cjs/{ThemeInverseDemo.cjs.map → ThemeInverseDemo.js.map} +0 -0
- /package/dist/cjs/{ToastDemo.cjs.map → ToastDemo.js.map} +0 -0
- /package/dist/cjs/{ToastDuplicateDemo.cjs.map → ToastDuplicateDemo.js.map} +0 -0
- /package/dist/cjs/{ToggleGroupDemo.cjs.map → ToggleGroupDemo.js.map} +0 -0
- /package/dist/cjs/{TokensDemo.cjs.map → TokensDemo.js.map} +0 -0
- /package/dist/cjs/{TooltipDemo.cjs.map → TooltipDemo.js.map} +0 -0
- /package/dist/cjs/{UpdateThemeDemo.cjs.map → UpdateThemeDemo.js.map} +0 -0
- /package/dist/cjs/{WebNativeImageDemo.cjs.map → WebNativeImageDemo.js.map} +0 -0
- /package/dist/cjs/{index.cjs.map → index.js.map} +0 -0
- /package/dist/cjs/{tamagui.config.cjs.map → tamagui.config.js.map} +0 -0
- /package/dist/cjs/{useOnIntersecting.cjs.map → useOnIntersecting.js.map} +0 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
+
mod
|
|
22
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
+
var ToastDemo_exports = {};
|
|
24
|
+
__export(ToastDemo_exports, {
|
|
25
|
+
ToastDemo: () => ToastDemo
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(ToastDemo_exports);
|
|
28
|
+
var import_toast = require("@tamagui/toast"), import_react = __toESM(require("react")), import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
+
const ToastDemo = () => {
|
|
30
|
+
const [native, setNative] = import_react.default.useState(!1);
|
|
31
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, { space: !0, alignItems: "center", children: [
|
|
32
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToastControl, { native }),
|
|
33
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CurrentToast, {}),
|
|
34
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeOptions, { native, setNative })
|
|
35
|
+
] });
|
|
36
|
+
}, CurrentToast = () => {
|
|
37
|
+
const currentToast = (0, import_toast.useToastState)();
|
|
38
|
+
return !currentToast || currentToast.isHandledNatively ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
39
|
+
import_toast.Toast,
|
|
40
|
+
{
|
|
41
|
+
duration: currentToast.duration,
|
|
42
|
+
enterStyle: { opacity: 0, scale: 0.5, y: -25 },
|
|
43
|
+
exitStyle: { opacity: 0, scale: 1, y: -20 },
|
|
44
|
+
y: 0,
|
|
45
|
+
opacity: 1,
|
|
46
|
+
scale: 1,
|
|
47
|
+
animation: "100ms",
|
|
48
|
+
viewportName: currentToast.viewportName,
|
|
49
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, { children: [
|
|
50
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_toast.Toast.Title, { children: currentToast.title }),
|
|
51
|
+
!!currentToast.message && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_toast.Toast.Description, { children: currentToast.message })
|
|
52
|
+
] })
|
|
53
|
+
},
|
|
54
|
+
currentToast.id
|
|
55
|
+
);
|
|
56
|
+
}, ToastControl = ({ native }) => {
|
|
57
|
+
const toast = (0, import_toast.useToastController)();
|
|
58
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { gap: "$2", justifyContent: "center", children: [
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
|
+
import_tamagui.Button,
|
|
61
|
+
{
|
|
62
|
+
onPress: () => {
|
|
63
|
+
toast.show("Successfully saved!", {
|
|
64
|
+
message: "Don't worry, we've got your data.",
|
|
65
|
+
native
|
|
66
|
+
});
|
|
67
|
+
},
|
|
68
|
+
children: "Show"
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
72
|
+
import_tamagui.Button,
|
|
73
|
+
{
|
|
74
|
+
onPress: () => {
|
|
75
|
+
toast.hide();
|
|
76
|
+
},
|
|
77
|
+
children: "Hide"
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
] });
|
|
81
|
+
}, NativeOptions = ({
|
|
82
|
+
native,
|
|
83
|
+
setNative
|
|
84
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { gap: "$3", children: [
|
|
85
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Label, { size: "$1", onPress: () => setNative(!1), children: "Custom" }),
|
|
86
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
87
|
+
import_tamagui.Switch,
|
|
88
|
+
{
|
|
89
|
+
id: "native-toggle",
|
|
90
|
+
nativeID: "native-toggle",
|
|
91
|
+
theme: "active",
|
|
92
|
+
size: "$1",
|
|
93
|
+
checked: !!native,
|
|
94
|
+
onCheckedChange: (val) => setNative(val),
|
|
95
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
96
|
+
import_tamagui.Switch.Thumb,
|
|
97
|
+
{
|
|
98
|
+
animation: [
|
|
99
|
+
"quick",
|
|
100
|
+
{
|
|
101
|
+
transform: {
|
|
102
|
+
overshootClamping: !0
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Label, { size: "$1", onPress: () => setNative(!0), children: "Native" })
|
|
111
|
+
] });
|
|
112
|
+
//# sourceMappingURL=ToastDemo.js.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
+
mod
|
|
22
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
+
var ToastDuplicateDemo_exports = {};
|
|
24
|
+
__export(ToastDuplicateDemo_exports, {
|
|
25
|
+
ToastDuplicateDemo: () => ToastDuplicateDemo
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(ToastDuplicateDemo_exports);
|
|
28
|
+
var import_lucide_icons = require("@tamagui/lucide-icons"), import_toast = require("@tamagui/toast"), import_react = __toESM(require("react")), import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
+
const ToastDuplicateDemo = () => {
|
|
30
|
+
const [savedCount, setSavedCount] = import_react.default.useState(0);
|
|
31
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, { alignItems: "center", children: [
|
|
32
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
33
|
+
import_tamagui.Button,
|
|
34
|
+
{
|
|
35
|
+
onPress: () => {
|
|
36
|
+
setSavedCount((old) => old + 1);
|
|
37
|
+
},
|
|
38
|
+
children: "Show toast"
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
[...Array(savedCount)].map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
42
|
+
import_toast.Toast,
|
|
43
|
+
{
|
|
44
|
+
viewportName: "viewport-multiple",
|
|
45
|
+
duration: 4e3,
|
|
46
|
+
enterStyle: { opacity: 0, scale: 0.5, y: -25 },
|
|
47
|
+
exitStyle: { opacity: 0, scale: 1, y: -20 },
|
|
48
|
+
y: 0,
|
|
49
|
+
opacity: 1,
|
|
50
|
+
scale: 1,
|
|
51
|
+
animation: "100ms",
|
|
52
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { space: !0, alignItems: "center", children: [
|
|
53
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_icons.CheckCircle2, {}) }),
|
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, { children: [
|
|
55
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_toast.Toast.Title, { children: "Successfully saved!" }),
|
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_toast.Toast.Description, { children: "Don't worry... We've got your data." })
|
|
57
|
+
] })
|
|
58
|
+
] })
|
|
59
|
+
},
|
|
60
|
+
index
|
|
61
|
+
))
|
|
62
|
+
] });
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=ToastDuplicateDemo.js.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
+
var ToggleGroupDemo_exports = {};
|
|
16
|
+
__export(ToggleGroupDemo_exports, {
|
|
17
|
+
ToggleGroupDemo: () => ToggleGroupDemo
|
|
18
|
+
});
|
|
19
|
+
module.exports = __toCommonJS(ToggleGroupDemo_exports);
|
|
20
|
+
var import_lucide_icons = require("@tamagui/lucide-icons"), import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
|
|
21
|
+
function ToggleGroupDemo() {
|
|
22
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { paddingHorizontal: "$4", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { alignItems: "center", space: "$10", children: [
|
|
23
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, { alignItems: "center", space: "$6", children: [
|
|
24
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroupComponent, { type: "single", size: "$3", orientation: "horizontal" }),
|
|
25
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroupComponent, { type: "multiple", size: "$4", orientation: "horizontal" })
|
|
26
|
+
] }),
|
|
27
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { alignItems: "center", space: "$6", children: [
|
|
28
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroupComponent, { type: "single", size: "$3", orientation: "vertical" }),
|
|
29
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroupComponent, { type: "multiple", size: "$4", orientation: "vertical" })
|
|
30
|
+
] })
|
|
31
|
+
] }) });
|
|
32
|
+
}
|
|
33
|
+
function ToggleGroupComponent(props) {
|
|
34
|
+
const id = `switch-${props.size.toString().slice(1)}-${props.type}`;
|
|
35
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
36
|
+
import_tamagui.XStack,
|
|
37
|
+
{
|
|
38
|
+
flexDirection: props.orientation === "horizontal" ? "row" : "column",
|
|
39
|
+
alignItems: "center",
|
|
40
|
+
justifyContent: "center",
|
|
41
|
+
space: "$4",
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Label, { paddingRight: "$0", justifyContent: "flex-end", size: props.size, htmlFor: id, children: props.type === "single" ? "Single" : "Multiple" }),
|
|
44
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
45
|
+
import_tamagui.ToggleGroup,
|
|
46
|
+
{
|
|
47
|
+
orientation: props.orientation,
|
|
48
|
+
id,
|
|
49
|
+
type: props.type,
|
|
50
|
+
size: props.size,
|
|
51
|
+
disableDeactivation: props.type === "single" ? !0 : void 0,
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.ToggleGroup.Item, { value: "left", "aria-label": "Left aligned", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_icons.AlignLeft, {}) }),
|
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.ToggleGroup.Item, { value: "center", "aria-label": "Center aligned", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_icons.AlignCenter, {}) }),
|
|
55
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.ToggleGroup.Item, { value: "right", "aria-label": "Right aligned", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_icons.AlignRight, {}) })
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=ToggleGroupDemo.js.map
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
+
mod
|
|
22
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
+
var TokensDemo_exports = {};
|
|
24
|
+
__export(TokensDemo_exports, {
|
|
25
|
+
TokensDemo: () => TokensDemo
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(TokensDemo_exports);
|
|
28
|
+
var import_react = __toESM(require("react")), import_core = require("@tamagui/core"), import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
+
const sections = [
|
|
30
|
+
{
|
|
31
|
+
name: "Size",
|
|
32
|
+
key: "size"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "Space",
|
|
36
|
+
key: "space"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "Space (-)",
|
|
40
|
+
key: "spaceNegative"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "Radius",
|
|
44
|
+
key: "radius"
|
|
45
|
+
}
|
|
46
|
+
];
|
|
47
|
+
function TokensDemo() {
|
|
48
|
+
const [section, setSection] = import_react.default.useState("size");
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, { space: !0, children: [
|
|
50
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.XGroup, { alignItems: "center", alignSelf: "center", children: sections.map(({ name, key }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.XGroup.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51
|
+
import_tamagui.Button,
|
|
52
|
+
{
|
|
53
|
+
size: "$3",
|
|
54
|
+
theme: section === key ? "active" : null,
|
|
55
|
+
fontFamily: "$silkscreen",
|
|
56
|
+
onPress: () => setSection(key),
|
|
57
|
+
children: name
|
|
58
|
+
}
|
|
59
|
+
) }, key)) }),
|
|
60
|
+
(section === "size" || section === "spaceNegative" || section === "space" || section === "radius") && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SizeSection, { section })
|
|
61
|
+
] });
|
|
62
|
+
}
|
|
63
|
+
function SizeSection({ section }) {
|
|
64
|
+
const allTokens = (0, import_core.getConfig)().tokens, tokens = allTokens[section.startsWith("space") ? "space" : section], st = Object.keys(tokens).sort(
|
|
65
|
+
(a, b) => Number.parseFloat(a) > Number.parseFloat(b) ? 1 : -1
|
|
66
|
+
), spaceTokens = st.filter((t) => Number.parseFloat(t) >= 0), spaceTokensNegative = st.filter((t) => Number.parseFloat(t) < 0).sort((a, b) => Number.parseFloat(a) > Number.parseFloat(b) ? -1 : 1);
|
|
67
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, { flex: 1, space: !0, children: [
|
|
68
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.H2, { children: "Sizes" }),
|
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { width: "100%", space: "$2", separator: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Separator, {}), children: (section === "spaceNegative" ? spaceTokensNegative : spaceTokens).map(
|
|
70
|
+
(token) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { width: "100%", alignItems: "center", children: [
|
|
71
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { width: "25%", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.H3, { size: "$6", children: [
|
|
72
|
+
"$",
|
|
73
|
+
token
|
|
74
|
+
] }) }),
|
|
75
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { width: "20%", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.H4, { size: "$5", children: [
|
|
76
|
+
tokens[token]?.val,
|
|
77
|
+
"px"
|
|
78
|
+
] }) }),
|
|
79
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
80
|
+
import_tamagui.Square,
|
|
81
|
+
{
|
|
82
|
+
size: tokens[token]?.val,
|
|
83
|
+
backgroundColor: "$color5",
|
|
84
|
+
...section === "spaceNegative" && {
|
|
85
|
+
backgroundColor: "$red5",
|
|
86
|
+
size: -tokens[spaceTokensNegative.find(
|
|
87
|
+
(t) => Number.parseFloat(t) === -Number.parseFloat(token)
|
|
88
|
+
) ?? token]?.val
|
|
89
|
+
},
|
|
90
|
+
...section === "radius" && {
|
|
91
|
+
size: allTokens.size[token]?.val,
|
|
92
|
+
borderRadius: tokens[token]?.val
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
] }, token)
|
|
97
|
+
) })
|
|
98
|
+
] });
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=TokensDemo.js.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
+
var TooltipDemo_exports = {};
|
|
16
|
+
__export(TooltipDemo_exports, {
|
|
17
|
+
TooltipDemo: () => TooltipDemo
|
|
18
|
+
});
|
|
19
|
+
module.exports = __toCommonJS(TooltipDemo_exports);
|
|
20
|
+
var import_lucide_icons = require("@tamagui/lucide-icons"), import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
|
|
21
|
+
function TooltipDemo() {
|
|
22
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.TooltipGroup, { delay: { open: 3e3, close: 100 }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, { gap: "$2", alignSelf: "center", children: [
|
|
23
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { gap: "$2", children: [
|
|
24
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Demo, { groupId: "0", placement: "top-end", Icon: import_lucide_icons.Circle }),
|
|
25
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Demo, { groupId: "1", placement: "top", Icon: import_lucide_icons.ChevronUp }),
|
|
26
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Demo, { groupId: "2", placement: "top-start", Icon: import_lucide_icons.Circle })
|
|
27
|
+
] }),
|
|
28
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { gap: "$2", children: [
|
|
29
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Demo, { groupId: "3", placement: "left", Icon: import_lucide_icons.ChevronLeft }),
|
|
30
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, { flex: 1 }),
|
|
31
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Demo, { groupId: "4", placement: "right", Icon: import_lucide_icons.ChevronRight })
|
|
32
|
+
] }),
|
|
33
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.XStack, { gap: "$2", children: [
|
|
34
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Demo, { groupId: "5", placement: "bottom-end", Icon: import_lucide_icons.Circle }),
|
|
35
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Demo, { groupId: "6", placement: "bottom", Icon: import_lucide_icons.ChevronDown }),
|
|
36
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Demo, { groupId: "7", placement: "bottom-start", Icon: import_lucide_icons.Circle })
|
|
37
|
+
] })
|
|
38
|
+
] }) });
|
|
39
|
+
}
|
|
40
|
+
function Demo({ Icon, ...props }) {
|
|
41
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.Tooltip, { ...props, children: [
|
|
42
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Tooltip.Trigger, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Button, { icon: Icon, circular: !0 }) }),
|
|
43
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
44
|
+
import_tamagui.Tooltip.Content,
|
|
45
|
+
{
|
|
46
|
+
enterStyle: { x: 0, y: -5, opacity: 0, scale: 0.9 },
|
|
47
|
+
exitStyle: { x: 0, y: -5, opacity: 0, scale: 0.9 },
|
|
48
|
+
scale: 1,
|
|
49
|
+
x: 0,
|
|
50
|
+
y: 0,
|
|
51
|
+
opacity: 1,
|
|
52
|
+
animation: [
|
|
53
|
+
"quick",
|
|
54
|
+
{
|
|
55
|
+
opacity: {
|
|
56
|
+
overshootClamping: !0
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Tooltip.Arrow, {}),
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Paragraph, { size: "$2", lineHeight: "$1", children: "Hello world" })
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
] });
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=TooltipDemo.js.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
+
mod
|
|
22
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
+
var UpdateThemeDemo_exports = {};
|
|
24
|
+
__export(UpdateThemeDemo_exports, {
|
|
25
|
+
UpdateThemeDemo: () => UpdateThemeDemo
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(UpdateThemeDemo_exports);
|
|
28
|
+
var import_react = __toESM(require("react")), import_v3 = require("@tamagui/config/v3"), import_theme = require("@tamagui/theme"), import_tamagui = require("tamagui"), import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
+
const colors = import_v3.config.tokens.color, colorKeys = Object.keys(colors);
|
|
30
|
+
function UpdateThemeDemo() {
|
|
31
|
+
const [theme, setTheme] = import_react.default.useState(), update = (0, import_tamagui.useForceUpdate)();
|
|
32
|
+
return (0, import_tamagui.useIsomorphicLayoutEffect)(() => {
|
|
33
|
+
(0, import_theme.addTheme)({
|
|
34
|
+
name: "custom",
|
|
35
|
+
insertCSS: !0,
|
|
36
|
+
theme: {
|
|
37
|
+
color: "red"
|
|
38
|
+
}
|
|
39
|
+
}), setTheme("custom");
|
|
40
|
+
}, []), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.YStack, { alignItems: "center", space: !0, children: [
|
|
41
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.XStack, { gap: "$5", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Theme, { name: theme ?? null, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.Square, { borderRadius: "$8", size: 100, backgroundColor: "$color" }) }) }),
|
|
42
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
43
|
+
import_tamagui.Button,
|
|
44
|
+
{
|
|
45
|
+
onPress: () => {
|
|
46
|
+
const randomColor = (0, import_tamagui.getVariableValue)(
|
|
47
|
+
colors[colorKeys[Math.floor(Math.random() * colorKeys.length)]]
|
|
48
|
+
);
|
|
49
|
+
(0, import_theme.updateTheme)({
|
|
50
|
+
name: "custom",
|
|
51
|
+
theme: {
|
|
52
|
+
color: randomColor
|
|
53
|
+
}
|
|
54
|
+
}), update();
|
|
55
|
+
},
|
|
56
|
+
children: "Set to random color"
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
] });
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=UpdateThemeDemo.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
+
var WebNativeImageDemo_exports = {};
|
|
16
|
+
__export(WebNativeImageDemo_exports, {
|
|
17
|
+
WebNativeImageDemo: () => WebNativeImageDemo
|
|
18
|
+
});
|
|
19
|
+
module.exports = __toCommonJS(WebNativeImageDemo_exports);
|
|
20
|
+
var import_image_next = require("@tamagui/image-next"), import_jsx_runtime = require("react/jsx-runtime");
|
|
21
|
+
function WebNativeImageDemo() {
|
|
22
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image_next.Image, { src: "https://picsum.photos/200/300", width: 200, height: 300 });
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=WebNativeImageDemo.js.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
|
+
return to;
|
|
10
|
+
}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
11
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
12
|
+
var src_exports = {};
|
|
13
|
+
module.exports = __toCommonJS(src_exports);
|
|
14
|
+
__reExport(src_exports, require("./AccordionDemo"), module.exports);
|
|
15
|
+
__reExport(src_exports, require("./AddThemeDemo"), module.exports);
|
|
16
|
+
__reExport(src_exports, require("./AlertDialogDemo"), module.exports);
|
|
17
|
+
__reExport(src_exports, require("./AnimationsDemo"), module.exports);
|
|
18
|
+
__reExport(src_exports, require("./AnimationsEnterDemo"), module.exports);
|
|
19
|
+
__reExport(src_exports, require("./AnimationsHoverDemo"), module.exports);
|
|
20
|
+
__reExport(src_exports, require("./AnimationsPresenceDemo"), module.exports);
|
|
21
|
+
__reExport(src_exports, require("./AnimationsTimingDemo"), module.exports);
|
|
22
|
+
__reExport(src_exports, require("./AvatarDemo"), module.exports);
|
|
23
|
+
__reExport(src_exports, require("./BuildAButtonDemo"), module.exports);
|
|
24
|
+
__reExport(src_exports, require("./ButtonDemo"), module.exports);
|
|
25
|
+
__reExport(src_exports, require("./ThemeBuilderDemo"), module.exports);
|
|
26
|
+
__reExport(src_exports, require("./CardDemo"), module.exports);
|
|
27
|
+
__reExport(src_exports, require("./CheckboxDemo"), module.exports);
|
|
28
|
+
__reExport(src_exports, require("./CheckboxHeadlessDemo"), module.exports);
|
|
29
|
+
__reExport(src_exports, require("./CheckboxUnstyledDemo"), module.exports);
|
|
30
|
+
__reExport(src_exports, require("./ColorsDemo"), module.exports);
|
|
31
|
+
__reExport(src_exports, require("./DialogDemo"), module.exports);
|
|
32
|
+
__reExport(src_exports, require("./FormsDemo"), module.exports);
|
|
33
|
+
__reExport(src_exports, require("./GroupDemo"), module.exports);
|
|
34
|
+
__reExport(src_exports, require("./HeadingsDemo"), module.exports);
|
|
35
|
+
__reExport(src_exports, require("./ImageDemo"), module.exports);
|
|
36
|
+
__reExport(src_exports, require("./WebNativeImageDemo"), module.exports);
|
|
37
|
+
__reExport(src_exports, require("./InputsDemo"), module.exports);
|
|
38
|
+
__reExport(src_exports, require("./NewInputsDemo"), module.exports);
|
|
39
|
+
__reExport(src_exports, require("./LabelDemo"), module.exports);
|
|
40
|
+
__reExport(src_exports, require("./LinearGradientDemo"), module.exports);
|
|
41
|
+
__reExport(src_exports, require("./ListItemDemo"), module.exports);
|
|
42
|
+
__reExport(src_exports, require("./LucideIconsDemo"), module.exports);
|
|
43
|
+
__reExport(src_exports, require("./PopoverDemo"), module.exports);
|
|
44
|
+
__reExport(src_exports, require("./ProgressDemo"), module.exports);
|
|
45
|
+
__reExport(src_exports, require("./RadioGroupDemo"), module.exports);
|
|
46
|
+
__reExport(src_exports, require("./RadioGroupHeadlessDemo"), module.exports);
|
|
47
|
+
__reExport(src_exports, require("./RadioGroupUnstyledDemo"), module.exports);
|
|
48
|
+
__reExport(src_exports, require("./ReplaceThemeDemo"), module.exports);
|
|
49
|
+
__reExport(src_exports, require("./ScrollViewDemo"), module.exports);
|
|
50
|
+
__reExport(src_exports, require("./SelectDemo"), module.exports);
|
|
51
|
+
__reExport(src_exports, require("./SeparatorDemo"), module.exports);
|
|
52
|
+
__reExport(src_exports, require("./ShapesDemo"), module.exports);
|
|
53
|
+
__reExport(src_exports, require("./SheetDemo"), module.exports);
|
|
54
|
+
__reExport(src_exports, require("./SliderDemo"), module.exports);
|
|
55
|
+
__reExport(src_exports, require("./SpinnerDemo"), module.exports);
|
|
56
|
+
__reExport(src_exports, require("./StacksDemo"), module.exports);
|
|
57
|
+
__reExport(src_exports, require("./SwitchDemo"), module.exports);
|
|
58
|
+
__reExport(src_exports, require("./SwitchHeadlessDemo"), module.exports);
|
|
59
|
+
__reExport(src_exports, require("./SwitchUnstyledDemo"), module.exports);
|
|
60
|
+
__reExport(src_exports, require("./TabsAdvancedDemo"), module.exports);
|
|
61
|
+
__reExport(src_exports, require("./TabsDemo"), module.exports);
|
|
62
|
+
__reExport(src_exports, require("./TextDemo"), module.exports);
|
|
63
|
+
__reExport(src_exports, require("./ThemeInverseDemo"), module.exports);
|
|
64
|
+
__reExport(src_exports, require("./ToastDemo"), module.exports);
|
|
65
|
+
__reExport(src_exports, require("./ToastDuplicateDemo"), module.exports);
|
|
66
|
+
__reExport(src_exports, require("./ToggleGroupDemo"), module.exports);
|
|
67
|
+
__reExport(src_exports, require("./TokensDemo"), module.exports);
|
|
68
|
+
__reExport(src_exports, require("./TooltipDemo"), module.exports);
|
|
69
|
+
__reExport(src_exports, require("./UpdateThemeDemo"), module.exports);
|
|
70
|
+
__reExport(src_exports, require("./useOnIntersecting"), module.exports);
|
|
71
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
+
var tamagui_config_exports = {};
|
|
16
|
+
__export(tamagui_config_exports, {
|
|
17
|
+
config: () => import_v32.config,
|
|
18
|
+
default: () => tamagui_config_default
|
|
19
|
+
});
|
|
20
|
+
module.exports = __toCommonJS(tamagui_config_exports);
|
|
21
|
+
var import_v3 = require("@tamagui/config/v3"), import_v32 = require("@tamagui/config/v3"), tamagui_config_default = import_v3.config;
|
|
22
|
+
//# sourceMappingURL=tamagui.config.js.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
+
var useOnIntersecting_exports = {};
|
|
16
|
+
__export(useOnIntersecting_exports, {
|
|
17
|
+
useIsIntersecting: () => useIsIntersecting,
|
|
18
|
+
useOnIntersecting: () => useOnIntersecting
|
|
19
|
+
});
|
|
20
|
+
module.exports = __toCommonJS(useOnIntersecting_exports);
|
|
21
|
+
var import_react = require("react"), import_tamagui = require("tamagui");
|
|
22
|
+
function useIsIntersecting(refs, { once, ...opts } = {}) {
|
|
23
|
+
const [values, setValues] = (0, import_react.useState)([]);
|
|
24
|
+
return import_tamagui.isWeb && useOnIntersecting(
|
|
25
|
+
refs,
|
|
26
|
+
(entries) => {
|
|
27
|
+
const intersecting = entries.some((x) => x?.isIntersecting);
|
|
28
|
+
once && !intersecting || setValues((prev) => {
|
|
29
|
+
const next = entries.map((e) => e?.isIntersecting ?? !1);
|
|
30
|
+
return prev.length === next.length && prev.every((e, i) => e === next[i]) ? prev : next;
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
opts
|
|
34
|
+
), Array.isArray(refs) ? values : values[0];
|
|
35
|
+
}
|
|
36
|
+
function useOnIntersecting(refsIn, incomingCbRaw, { threshold = 0, root, rootMargin } = {}, mountArgs = []) {
|
|
37
|
+
const onIntersectEvent = (0, import_tamagui.useEvent)(incomingCbRaw);
|
|
38
|
+
(0, import_react.useEffect)(() => {
|
|
39
|
+
const refs = Array.isArray(refsIn) ? refsIn : [refsIn];
|
|
40
|
+
if (!refs.length) return;
|
|
41
|
+
let dispose = null, currentEntries = [];
|
|
42
|
+
const options = {
|
|
43
|
+
threshold,
|
|
44
|
+
root,
|
|
45
|
+
rootMargin
|
|
46
|
+
}, io = new IntersectionObserver((entries) => {
|
|
47
|
+
currentEntries = refs.map((ref, index) => entries.find((x) => x.target === ref.current) ?? currentEntries[index] ?? null), dispose?.(), dispose = onIntersectEvent(currentEntries) || null;
|
|
48
|
+
}, options);
|
|
49
|
+
for (const ref of refs)
|
|
50
|
+
ref.current && io.observe(ref.current);
|
|
51
|
+
return () => {
|
|
52
|
+
dispose?.(), io.disconnect();
|
|
53
|
+
};
|
|
54
|
+
}, [
|
|
55
|
+
onIntersectEvent,
|
|
56
|
+
refsIn,
|
|
57
|
+
root,
|
|
58
|
+
rootMargin,
|
|
59
|
+
threshold,
|
|
60
|
+
...mountArgs
|
|
61
|
+
]);
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=useOnIntersecting.js.map
|